From: support Date: Wed, 8 Jun 2022 10:43:12 +0000 (+0000) Subject: Built motion from commit fb3f4319.|2.6.11 X-Git-Url: http://repos.xcallymotion.com/base/%22https:/wiki.xcallymotion.com/display/XMV//%22?a=commitdiff_plain;h=112859e58e2f36033e15a69646abe27e62d072ef;p=motion2.git Built motion from commit fb3f4319.|2.6.11 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 8543f4f..41f128e 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-06-03T17:25:33.757Z", + "time": "2022-06-08T10:35:17.722Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 7c1ef99..fe7f753 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-06-03T17:25:33.757Z", + "time": "2022-06-08T10:35:17.722Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/public/app/errors/404/i18n/is.json b/public/app/errors/404/i18n/is.json new file mode 100644 index 0000000..b061703 --- /dev/null +++ b/public/app/errors/404/i18n/is.json @@ -0,0 +1,8 @@ +{ + "ERROR404": { + "CODE": "404", + "MESSAGE": "Sorry but we couldn’t find the page you are looking for", + "SEARCH": "Search for anything", + "GO_BACK": "Go back to dashboard" + } +} diff --git a/public/app/errors/500/i18n/is.json b/public/app/errors/500/i18n/is.json new file mode 100644 index 0000000..b218b70 --- /dev/null +++ b/public/app/errors/500/i18n/is.json @@ -0,0 +1,11 @@ +{ + "ERROR500": { + "CODE": "500", + "MESSAGE": "Well, you broke the internet!", + "SUBMESSAGE": "Just kidding, looks like we have an internal issue, please try again in couple minutes", + "REPORT": "Report this problem", + "JIRA_MESSAGE": "Your request has been received and will be processed shortly.", + "JIRA_SUBMESSAGE": "Sorry for the inconvenience. If you have any questions or concerns, please do not hesitate to contact us.", + "GO_BACK": "Go back to dashboard" + } +} diff --git a/public/app/footer/i18n/is.json b/public/app/footer/i18n/is.json new file mode 100644 index 0000000..8a47415 --- /dev/null +++ b/public/app/footer/i18n/is.json @@ -0,0 +1,6 @@ +{ + "FOOTER": { + "COOKIE_LAW": "We use cookies to give you the best experience. Read our cookie policy.", + "ERRORS": {} + } +} diff --git a/public/app/forgot/i18n/bs.json b/public/app/forgot/i18n/bs.json index be7b81a..6168cc3 100644 --- a/public/app/forgot/i18n/bs.json +++ b/public/app/forgot/i18n/bs.json @@ -1,15 +1,15 @@ { "FORGOTPASSWORD": { - "TITLE": "Recover your password", - "EMAIL_ADRESS": "Email address", - "SEND_RESET_LINK": "SEND RESET LINK", - "GO_BACK": "Go back to login", - "LINK_SENT": "Link Sent", - "LINNK_SENT_MESSAGE": "An email containing a link to reset your password has been sent to your address!", - "PASSWORD_RESET_ERROR": "Password Reset Error", + "TITLE": "Restartuj svoju lozinku", + "EMAIL_ADRESS": "E-mail adresa", + "SEND_RESET_LINK": "POŠALJI RESET LINK", + "GO_BACK": "Vrati se na prijavu", + "LINK_SENT": "Link je poslan", + "LINNK_SENT_MESSAGE": "E-mail koji sadrži link za poništavanje lozinke je poslan na tvoju adresu!", + "PASSWORD_RESET_ERROR": "Greška restartovanja lozinke", "ERRORS": { - "EMAIL_REQUIRED": "Mandatory field", - "EMAIL_MUST_VALID": "Wrong format" + "EMAIL_REQUIRED": "Obavezno polje", + "EMAIL_MUST_VALID": "Pogrešan format" } } } diff --git a/public/app/forgot/i18n/cs.json b/public/app/forgot/i18n/cs.json index be7b81a..277bd94 100644 --- a/public/app/forgot/i18n/cs.json +++ b/public/app/forgot/i18n/cs.json @@ -1,15 +1,15 @@ { "FORGOTPASSWORD": { - "TITLE": "Recover your password", - "EMAIL_ADRESS": "Email address", - "SEND_RESET_LINK": "SEND RESET LINK", - "GO_BACK": "Go back to login", - "LINK_SENT": "Link Sent", - "LINNK_SENT_MESSAGE": "An email containing a link to reset your password has been sent to your address!", - "PASSWORD_RESET_ERROR": "Password Reset Error", + "TITLE": "Obnovit heslo", + "EMAIL_ADRESS": "Emailová adresa", + "SEND_RESET_LINK": "Poslat odkaz pro obnovení", + "GO_BACK": "Zpět na přihlášení", + "LINK_SENT": "Odkaz odeslán", + "LINNK_SENT_MESSAGE": "Email obsahující odkaz pro obnovení hesla byl odeslán na vaši emailovou adresu!", + "PASSWORD_RESET_ERROR": "Chyba při obnovení hesla", "ERRORS": { - "EMAIL_REQUIRED": "Mandatory field", - "EMAIL_MUST_VALID": "Wrong format" + "EMAIL_REQUIRED": "Povinné pole", + "EMAIL_MUST_VALID": "Špatný formát" } } } diff --git a/public/app/forgot/i18n/is.json b/public/app/forgot/i18n/is.json new file mode 100644 index 0000000..be7b81a --- /dev/null +++ b/public/app/forgot/i18n/is.json @@ -0,0 +1,15 @@ +{ + "FORGOTPASSWORD": { + "TITLE": "Recover your password", + "EMAIL_ADRESS": "Email address", + "SEND_RESET_LINK": "SEND RESET LINK", + "GO_BACK": "Go back to login", + "LINK_SENT": "Link Sent", + "LINNK_SENT_MESSAGE": "An email containing a link to reset your password has been sent to your address!", + "PASSWORD_RESET_ERROR": "Password Reset Error", + "ERRORS": { + "EMAIL_REQUIRED": "Mandatory field", + "EMAIL_MUST_VALID": "Wrong format" + } + } +} diff --git a/public/app/header/i18n/is.json b/public/app/header/i18n/is.json new file mode 100644 index 0000000..f78785b --- /dev/null +++ b/public/app/header/i18n/is.json @@ -0,0 +1,6 @@ +{ + "HEADER": { + "NEWS": "Please visit our Wiki to discover the new cool features available on XCALLY.", + "ERRORS": {} + } +} diff --git a/public/app/login/i18n/bs.json b/public/app/login/i18n/bs.json index 78f3f74..085ff3b 100644 --- a/public/app/login/i18n/bs.json +++ b/public/app/login/i18n/bs.json @@ -1,26 +1,26 @@ { "LOGIN": { - "TELEPHONES": "Telephones", - "SELECT": "Select", - "CANCEL": "Cancel", - "TITLE": "Log in to your account", - "EMAIL": "Email", - "USERNAME": "Username", - "PASSWORD": "Password", - "REMEMBER_ME": "Remember Me", - "FORGOT_PASSWORD": "Forgot Password?", - "LOG_IN": "LOG IN", - "OR": "OR", - "WITH_GOOGLE": "Log in with Google", - "WITH_AD": "Log in with Active Directory", - "WITH_FACEBOOK": "Log in with Facebook", - "DONT_HAVE_ACCOUNT": "No account?", - "CREATE_ACCOUNT": "Create an account", + "TELEPHONES": "Telefoni", + "SELECT": "Odaberi", + "CANCEL": "Poništi", + "TITLE": "Prijavi se na svoj nalog", + "EMAIL": "E-mail", + "USERNAME": "Korisničko ime", + "PASSWORD": "Lozinka", + "REMEMBER_ME": "Zapamti me", + "FORGOT_PASSWORD": "Zaboravio lozinku?", + "LOG_IN": "PRIJAVI SE", + "OR": "ILI", + "WITH_GOOGLE": "Prijavi se sa Google", + "WITH_AD": "Prijavi se sa Aktivnim Direktorijem", + "WITH_FACEBOOK": "Prijavi se sa Facebook", + "DONT_HAVE_ACCOUNT": "Nemaš Nalog?", + "CREATE_ACCOUNT": "Kreiraj Nalog", "ERRORS": { - "EMAIL_REQUIRED": "Mandatory field", - "EMAIL_MUST_VALID": "Wrong format", - "PASSWORD_REQUIRED": "Mandatory field", - "USERNAME_REQUIRED": "Mandatory field" + "EMAIL_REQUIRED": "Obavezno polje", + "EMAIL_MUST_VALID": "Pogrešana format", + "PASSWORD_REQUIRED": "Obavezno polje", + "USERNAME_REQUIRED": "Obavezno polje" } } } diff --git a/public/app/login/i18n/cs.json b/public/app/login/i18n/cs.json index c29c7dc..ff305aa 100644 --- a/public/app/login/i18n/cs.json +++ b/public/app/login/i18n/cs.json @@ -1,25 +1,25 @@ { "LOGIN": { - "TELEPHONES": "Telephones", - "SELECT": "Select", - "CANCEL": "Cancel", - "TITLE": "Log in to your account", + "TELEPHONES": "Telefony", + "SELECT": "Vybrat", + "CANCEL": "Zrušit", + "TITLE": "Příhlášení k účtu", "EMAIL": "Email", - "USERNAME": "Username", - "PASSWORD": "Password", - "REMEMBER_ME": "Remember Me", - "FORGOT_PASSWORD": "Forgot Password?", - "LOG_IN": "LOG IN", - "OR": "OR", - "WITH_GOOGLE": "Log in with Google", - "WITH_FACEBOOK": "Log in with Facebook", - "DONT_HAVE_ACCOUNT": "No account?", - "CREATE_ACCOUNT": "Create an account", + "USERNAME": "Uživatel", + "PASSWORD": "Heslo", + "REMEMBER_ME": "Zapamatovat si", + "FORGOT_PASSWORD": "Zapomenuté heslo?", + "LOG_IN": "PŘIHLÁSIT", + "OR": "nebo", + "WITH_GOOGLE": "Přihlásit pomocí Google", + "WITH_FACEBOOK": "Přihlásit pomocí Facebook", + "DONT_HAVE_ACCOUNT": "Memáte účet?", + "CREATE_ACCOUNT": "Vytvořit nový účet", "ERRORS": { - "EMAIL_REQUIRED": "Mandatory field", - "EMAIL_MUST_VALID": "Wrong format", - "PASSWORD_REQUIRED": "Mandatory field", - "USERNAME_REQUIRED": "Mandatory field" + "EMAIL_REQUIRED": "Povinné pole", + "EMAIL_MUST_VALID": "Neplatný formát", + "PASSWORD_REQUIRED": "Povinné pole", + "USERNAME_REQUIRED": "Povinné pole" }, "WITH_AD": "Přihlaste se pomocí Active Directory" } diff --git a/public/app/login/i18n/is.json b/public/app/login/i18n/is.json new file mode 100644 index 0000000..78f3f74 --- /dev/null +++ b/public/app/login/i18n/is.json @@ -0,0 +1,26 @@ +{ + "LOGIN": { + "TELEPHONES": "Telephones", + "SELECT": "Select", + "CANCEL": "Cancel", + "TITLE": "Log in to your account", + "EMAIL": "Email", + "USERNAME": "Username", + "PASSWORD": "Password", + "REMEMBER_ME": "Remember Me", + "FORGOT_PASSWORD": "Forgot Password?", + "LOG_IN": "LOG IN", + "OR": "OR", + "WITH_GOOGLE": "Log in with Google", + "WITH_AD": "Log in with Active Directory", + "WITH_FACEBOOK": "Log in with Facebook", + "DONT_HAVE_ACCOUNT": "No account?", + "CREATE_ACCOUNT": "Create an account", + "ERRORS": { + "EMAIL_REQUIRED": "Mandatory field", + "EMAIL_MUST_VALID": "Wrong format", + "PASSWORD_REQUIRED": "Mandatory field", + "USERNAME_REQUIRED": "Mandatory field" + } + } +} diff --git a/public/app/main/apps/analytics/i18n/bs.json b/public/app/main/apps/analytics/i18n/bs.json index 71cf72f..71678f2 100644 --- a/public/app/main/apps/analytics/i18n/bs.json +++ b/public/app/main/apps/analytics/i18n/bs.json @@ -1,89 +1,89 @@ { "ANALYTICS": { - "SEND_IF_EMPTY": "Send if empty", - "REPORTNAME": "Report Name", - "DELETE": "Delete", - "NAME": "Name", - "ANALYTICS": "Analytics", - "METRICS": "Metrics", - "ID": "Id", - "TABLE": "Table", - "DESCRIPTION": "Description", - "SEARCH_FOR_ANYONE": "Search", - "METRIC": "Metric", + "SEND_IF_EMPTY": "Pošalji ako je prazno", + "REPORTNAME": "Ime Izvještaja", + "DELETE": "Izbriši", + "NAME": "Naziv", + "ANALYTICS": "Analitika", + "METRICS": "Metrika", + "ID": "ID", + "TABLE": "Tablica", + "DESCRIPTION": "Opis", + "SEARCH_FOR_ANYONE": "Traži", + "METRIC": "Metrika", "ERRORS": { - "NAME_REQUIRED": "Mandatory field", - "METRIC_REQUIRED": "Mandatory field", - "COLUMN_REQUIRED": "Mandatory field", - "VALUE_REQUIRED": "Mandatory field", - "CUSTOM_METRIC_REQUIRED": "Mandatory field", - "ALIAS_REQUIRED": "Mandatory field" + "NAME_REQUIRED": "Obavezno Polje", + "METRIC_REQUIRED": "Obavezno Polje", + "COLUMN_REQUIRED": "Obavezno Polje", + "VALUE_REQUIRED": "Obavezno Polje", + "CUSTOM_METRIC_REQUIRED": "Obavezno Polje", + "ALIAS_REQUIRED": "Obavezno Polje" }, - "NEW_METRIC": "New Metric", - "ADD_METRIC": "Add Metric", - "EDIT_METRIC": "Edit Metric", - "DELETE_METRIC": "Delete Metric", - "SAVE": "Save", - "BACK": "Back", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "TYPE": "Type", - "EXTRACTEDREPORTS": "Extracted Reports", - "DATE_RANGE_FROM": "Date Range From", - "DATE_RANGE_TO": "Date Range To", - "GENERATED_AT": "Generated At", + "NEW_METRIC": "Nova Metrika", + "ADD_METRIC": "Dodaj Metriku", + "EDIT_METRIC": "Uredi Metriku", + "DELETE_METRIC": "Izbriši Metriku", + "SAVE": "Sačuvaj", + "BACK": "Nazad", + "SELECTED": "Odabrano", + "SELECT_ALL": "Odaberi Sve", + "SELECT_NONE": "Bez Odabira", + "TYPE": "Tip", + "EXTRACTEDREPORTS": "Izvučeni Izvještaji", + "DATE_RANGE_FROM": "Raspon Datuma Od", + "DATE_RANGE_TO": "Raspon Datuma Do", + "GENERATED_AT": "Generisano U", "STATUS": "Status", - "OUTPUT": "Output", - "REPORTS": "Reports", - "SEARCH_FOR_FOLDER": "Search for folder", - "CREATED_AT": "Created At", - "NEW_REPORT": "New Report", - "ADD_REPORT": "Add Report", - "COPY_REPORT": "Copy Report", - "PREVIEW_REPORT": "Preview Report", - "WEB_REPORT": "Web Report", - "RUN_REPORT": "Run Report", - "DOWNLOAD_JSON_REPORT": "Export Report JSON", - "EDIT_REPORT": "Edit Report", - "DELETE_REPORT": "Delete Report", - "CREATE": "Create Folder", - "RENAME": "Rename Folder", - "REMOVE": "Remove Folder", - "SELECT_NODE": "Select Folder", - "ERROR": "Error", - "QUERY_ERROR": "Query Error", - "MESSAGE": "Message", - "CLOSE": "Close", + "OUTPUT": "Izlaz", + "REPORTS": "Izvještaji", + "SEARCH_FOR_FOLDER": "Traži folder", + "CREATED_AT": "Kreirano U", + "NEW_REPORT": "Novi Izvještaj", + "ADD_REPORT": "Dodaj Izvještaj", + "COPY_REPORT": "Kopiraj Izvještaj", + "PREVIEW_REPORT": "Pregled Izvještaj", + "WEB_REPORT": "Web Izvještaj", + "RUN_REPORT": "Pokreni Izvještaj", + "DOWNLOAD_JSON_REPORT": "Preuzmi Izvještaj JSON", + "EDIT_REPORT": "Uredi Izvještaj", + "DELETE_REPORT": "Izbriši Izvještaj", + "CREATE": "Kreiraj Folder", + "RENAME": "Preimenuj Folder", + "REMOVE": "Ukloni Folder", + "SELECT_NODE": "Odaberi Folder", + "ERROR": "Greška", + "QUERY_ERROR": "Greška U Upitu", + "MESSAGE": "Poruka", + "CLOSE": "Zatvori", "FORMAT": "Format", - "SETTINGS": "Settings", - "GENERAL": "General", - "FIELDS": "Fields", - "CONDITION": "Condition", - "OPERATOR": "Operator", - "GROUP": "Group", - "COLUMN": "Column", - "VALUE": "Value", - "PREVIEW": "Preview", - "LIMITED_RESULT": "*Limited Results", - "NO_DATA": "No data results", - "CONDITIONS": "Conditions", - "ALIAS": "Alias", - "FUNCTION": "Function", - "GROUP_BY": "Group By", - "ORDER_BY": "Order By", - "ADD_REPORTFIELD": "Add Field", - "EDIT_REPORTFIELD": "Edit Field", - "DELETE_REPORTFIELD": "Delete Field", - "METRIC_NAME": "Metric", - "NO_METRIC_FOUND": "No metric found", - "NO_AVAILABLE_INFO": "No available info", - "CUSTOM_METRIC": "Custom Metric", - "DELETE_EXTRACTEDREPORT": "Delete Extracted Report", - "EDIT_EXTRACTEDREPORT": "Edit Extracted Report", - "DOWNLOAD_EXTRACTEDREPORT": "Download Extracted Report", - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of" + "SETTINGS": "Postavke", + "GENERAL": "Općenito", + "FIELDS": "Polja", + "CONDITION": "Uslov", + "OPERATOR": "Operater", + "GROUP": "Grupa", + "COLUMN": "Kolona", + "VALUE": "Vrijednost", + "PREVIEW": "Pregled", + "LIMITED_RESULT": "*Ograničeni Rezultati", + "NO_DATA": "Nema podataka", + "CONDITIONS": "Uslovi", + "ALIAS": "Pseudonim", + "FUNCTION": "Funkcija", + "GROUP_BY": "Grupiraj Po", + "ORDER_BY": "Naruči Po", + "ADD_REPORTFIELD": "Dodaj Polje", + "EDIT_REPORTFIELD": "Uredi Polje", + "DELETE_REPORTFIELD": "Izbriši Polje", + "METRIC_NAME": "Naziv Metrike", + "NO_METRIC_FOUND": "Nije pronađena metrika", + "NO_AVAILABLE_INFO": "Nema dostupnih informacija", + "CUSTOM_METRIC": "Prilagođena Metrika", + "DELETE_EXTRACTEDREPORT": "Izbriši Izvučeni Izvještaj", + "EDIT_EXTRACTEDREPORT": "Uredi Izvučeni Izvještaj", + "DOWNLOAD_EXTRACTEDREPORT": "Preuzmi Izvučeni Izvještaj", + "PAGE": "Strana", + "ROWSPERPAGE": "Redova po stranici", + "OF": "Od" } } diff --git a/public/app/main/apps/analytics/i18n/cs.json b/public/app/main/apps/analytics/i18n/cs.json index 9555c69..7da42d7 100644 --- a/public/app/main/apps/analytics/i18n/cs.json +++ b/public/app/main/apps/analytics/i18n/cs.json @@ -1,89 +1,89 @@ { "ANALYTICS": { - "SEND_IF_EMPTY": "Send if empty", - "REPORTNAME": "Report Name", - "DELETE": "Delete", - "NAME": "Name", + "SEND_IF_EMPTY": "Odeslat prázdné", + "REPORTNAME": "Název Reportu", + "DELETE": "Smazat", + "NAME": "Název", "ANALYTICS": "Analytics", - "METRICS": "Metrics", + "METRICS": "Metriky", "ID": "Id", - "TABLE": "Table", - "DESCRIPTION": "Description", - "SEARCH_FOR_ANYONE": "Search", - "METRIC": "Metric", + "TABLE": "Tabulka", + "DESCRIPTION": "Popis", + "SEARCH_FOR_ANYONE": "Vyhledat", + "METRIC": "Metrika", "ERRORS": { - "NAME_REQUIRED": "Mandatory field", - "METRIC_REQUIRED": "Mandatory field", - "COLUMN_REQUIRED": "Mandatory field", - "VALUE_REQUIRED": "Mandatory field", - "CUSTOM_METRIC_REQUIRED": "Mandatory field", - "ALIAS_REQUIRED": "Mandatory field" + "NAME_REQUIRED": "Povinné pole", + "METRIC_REQUIRED": "Povinné pole", + "COLUMN_REQUIRED": "Povinné pole", + "VALUE_REQUIRED": "Povinné pole", + "CUSTOM_METRIC_REQUIRED": "Povinné pole", + "ALIAS_REQUIRED": "Povinné pole" }, - "NEW_METRIC": "New Metric", - "ADD_METRIC": "Add Metric", - "EDIT_METRIC": "Edit Metric", - "DELETE_METRIC": "Delete Metric", - "SAVE": "Save", - "BACK": "Back", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "TYPE": "Type", - "EXTRACTEDREPORTS": "Extracted Reports", - "DATE_RANGE_FROM": "Date Range From", - "DATE_RANGE_TO": "Date Range To", - "GENERATED_AT": "Generated At", - "STATUS": "Status", - "OUTPUT": "Output", - "REPORTS": "Reports", - "SEARCH_FOR_FOLDER": "Search for folder", - "CREATED_AT": "Created At", - "NEW_REPORT": "New Report", - "ADD_REPORT": "Add Report", - "COPY_REPORT": "Copy Report", - "PREVIEW_REPORT": "Preview Report", - "RUN_REPORT": "Run Report", - "DOWNLOAD_JSON_REPORT": "Export Report JSON", - "EDIT_REPORT": "Edit Report", - "DELETE_REPORT": "Delete Report", - "CREATE": "Create Folder", - "RENAME": "Rename Folder", - "REMOVE": "Remove Folder", - "SELECT_NODE": "Select Folder", - "ERROR": "Error", - "QUERY_ERROR": "Query Error", - "MESSAGE": "Message", - "CLOSE": "Close", - "FORMAT": "Format", - "SETTINGS": "Settings", - "GENERAL": "General", - "FIELDS": "Fields", - "CONDITION": "Condition", - "OPERATOR": "Operator", - "GROUP": "Group", - "COLUMN": "Column", - "VALUE": "Value", - "PREVIEW": "Preview", - "LIMITED_RESULT": "*Limited Results", - "NO_DATA": "No data results", - "CONDITIONS": "Conditions", + "NEW_METRIC": "Nová Metrika", + "ADD_METRIC": "Přidat Metriku", + "EDIT_METRIC": "Upravit Metriku", + "DELETE_METRIC": "Smazat Metriku", + "SAVE": "Uložit", + "BACK": "Zpět", + "SELECTED": "Vybráno", + "SELECT_ALL": "Vybrat vše", + "SELECT_NONE": "Zrušit výběr", + "TYPE": "Typ", + "EXTRACTEDREPORTS": "Povinné pole", + "DATE_RANGE_FROM": "Datum od", + "DATE_RANGE_TO": "Datum do", + "GENERATED_AT": "Vytvořeno", + "STATUS": "Stav", + "OUTPUT": "Výstup", + "REPORTS": "Reporty", + "SEARCH_FOR_FOLDER": "Vyhledat složku", + "CREATED_AT": "Vytvořeno", + "NEW_REPORT": "Nový Report", + "ADD_REPORT": "Přidat Report", + "COPY_REPORT": "Kopírovat Report", + "PREVIEW_REPORT": "Náhledový Report", + "RUN_REPORT": "Spustit Report", + "DOWNLOAD_JSON_REPORT": "Exportovat Report JSON", + "EDIT_REPORT": "Upravit Report", + "DELETE_REPORT": "Smazat Report", + "CREATE": "Vytvořit Složku", + "RENAME": "Přejmenovat složku", + "REMOVE": "Odstranit složku", + "SELECT_NODE": "Vybrat složku", + "ERROR": "Chyba", + "QUERY_ERROR": "Chyba požadavku", + "MESSAGE": "Zpráva", + "CLOSE": "Zavřít", + "FORMAT": "Formát", + "SETTINGS": "Nastavení", + "GENERAL": "Obecné", + "FIELDS": "Pole", + "CONDITION": "Podmínka", + "OPERATOR": "Operátor", + "GROUP": "Seskupit", + "COLUMN": "Sloupec", + "VALUE": "Hodnota", + "PREVIEW": "Náhled", + "LIMITED_RESULT": "*omezený výsledek", + "NO_DATA": "žádná data", + "CONDITIONS": "Podmínky", "ALIAS": "Alias", - "FUNCTION": "Function", - "GROUP_BY": "Group By", - "ORDER_BY": "Order By", - "ADD_REPORTFIELD": "Add Field", - "EDIT_REPORTFIELD": "Edit Field", - "DELETE_REPORTFIELD": "Delete Field", - "METRIC_NAME": "Metric", - "NO_METRIC_FOUND": "No metric found", - "NO_AVAILABLE_INFO": "No available info", - "CUSTOM_METRIC": "Custom Metric", - "DELETE_EXTRACTEDREPORT": "Delete Extracted Report", - "EDIT_EXTRACTEDREPORT": "Edit Extracted Report", - "DOWNLOAD_EXTRACTEDREPORT": "Download Extracted Report", - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", - "WEB_REPORT": "Webová zpráva" + "FUNCTION": "Funkce", + "GROUP_BY": "Seskupit podle", + "ORDER_BY": "Seřadit podle", + "ADD_REPORTFIELD": "Přidat Pole", + "EDIT_REPORTFIELD": "Upravit Pole", + "DELETE_REPORTFIELD": "Smazat Pole", + "METRIC_NAME": "Metrika", + "NO_METRIC_FOUND": "Metrika nenalezena", + "NO_AVAILABLE_INFO": "žádné infromace", + "CUSTOM_METRIC": "Vlastní Metrika", + "DELETE_EXTRACTEDREPORT": "Smazat vytvořené Reporty", + "EDIT_EXTRACTEDREPORT": "Upravit vytvořený Report", + "DOWNLOAD_EXTRACTEDREPORT": "Smazat vytvořený Report", + "PAGE": "Stránka", + "ROWSPERPAGE": "Řádků na stránku", + "OF": "z", + "WEB_REPORT": "Webový report" } } diff --git a/public/app/main/apps/analytics/i18n/is.json b/public/app/main/apps/analytics/i18n/is.json new file mode 100644 index 0000000..71cf72f --- /dev/null +++ b/public/app/main/apps/analytics/i18n/is.json @@ -0,0 +1,89 @@ +{ + "ANALYTICS": { + "SEND_IF_EMPTY": "Send if empty", + "REPORTNAME": "Report Name", + "DELETE": "Delete", + "NAME": "Name", + "ANALYTICS": "Analytics", + "METRICS": "Metrics", + "ID": "Id", + "TABLE": "Table", + "DESCRIPTION": "Description", + "SEARCH_FOR_ANYONE": "Search", + "METRIC": "Metric", + "ERRORS": { + "NAME_REQUIRED": "Mandatory field", + "METRIC_REQUIRED": "Mandatory field", + "COLUMN_REQUIRED": "Mandatory field", + "VALUE_REQUIRED": "Mandatory field", + "CUSTOM_METRIC_REQUIRED": "Mandatory field", + "ALIAS_REQUIRED": "Mandatory field" + }, + "NEW_METRIC": "New Metric", + "ADD_METRIC": "Add Metric", + "EDIT_METRIC": "Edit Metric", + "DELETE_METRIC": "Delete Metric", + "SAVE": "Save", + "BACK": "Back", + "SELECTED": "Selected", + "SELECT_ALL": "Select All", + "SELECT_NONE": "Select None", + "TYPE": "Type", + "EXTRACTEDREPORTS": "Extracted Reports", + "DATE_RANGE_FROM": "Date Range From", + "DATE_RANGE_TO": "Date Range To", + "GENERATED_AT": "Generated At", + "STATUS": "Status", + "OUTPUT": "Output", + "REPORTS": "Reports", + "SEARCH_FOR_FOLDER": "Search for folder", + "CREATED_AT": "Created At", + "NEW_REPORT": "New Report", + "ADD_REPORT": "Add Report", + "COPY_REPORT": "Copy Report", + "PREVIEW_REPORT": "Preview Report", + "WEB_REPORT": "Web Report", + "RUN_REPORT": "Run Report", + "DOWNLOAD_JSON_REPORT": "Export Report JSON", + "EDIT_REPORT": "Edit Report", + "DELETE_REPORT": "Delete Report", + "CREATE": "Create Folder", + "RENAME": "Rename Folder", + "REMOVE": "Remove Folder", + "SELECT_NODE": "Select Folder", + "ERROR": "Error", + "QUERY_ERROR": "Query Error", + "MESSAGE": "Message", + "CLOSE": "Close", + "FORMAT": "Format", + "SETTINGS": "Settings", + "GENERAL": "General", + "FIELDS": "Fields", + "CONDITION": "Condition", + "OPERATOR": "Operator", + "GROUP": "Group", + "COLUMN": "Column", + "VALUE": "Value", + "PREVIEW": "Preview", + "LIMITED_RESULT": "*Limited Results", + "NO_DATA": "No data results", + "CONDITIONS": "Conditions", + "ALIAS": "Alias", + "FUNCTION": "Function", + "GROUP_BY": "Group By", + "ORDER_BY": "Order By", + "ADD_REPORTFIELD": "Add Field", + "EDIT_REPORTFIELD": "Edit Field", + "DELETE_REPORTFIELD": "Delete Field", + "METRIC_NAME": "Metric", + "NO_METRIC_FOUND": "No metric found", + "NO_AVAILABLE_INFO": "No available info", + "CUSTOM_METRIC": "Custom Metric", + "DELETE_EXTRACTEDREPORT": "Delete Extracted Report", + "EDIT_EXTRACTEDREPORT": "Edit Extracted Report", + "DOWNLOAD_EXTRACTEDREPORT": "Download Extracted Report", + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "OF": "of" + } +} diff --git a/public/app/main/apps/callysquare/i18n/bs.json b/public/app/main/apps/callysquare/i18n/bs.json index 22b9fef..b8fc6d7 100644 --- a/public/app/main/apps/callysquare/i18n/bs.json +++ b/public/app/main/apps/callysquare/i18n/bs.json @@ -1,244 +1,244 @@ { "CALLYSQUARE": { - "ACCOUNT_ID": "Account", - "ADDUSER_PROJECTS": "Add Users to Project", - "ADD_ODBC": "Add ODBC", - "ADD_PROJECT": "Add Project", - "ADD_VARIABLE": "Add Variable", - "AGENTS": "Agents", + "ACCOUNT_ID": "Nalog", + "ADDUSER_PROJECTS": "Dodaj Korisnike u Projekat", + "ADD_ODBC": "Dodaj ODBC", + "ADD_PROJECT": "Dodaj Projekat", + "ADD_VARIABLE": "Dodaj Varijablu", + "AGENTS": "Specijalist", "AGI": "AGI", - "ALL_USERS": "All Users", - "ANSWER": "Answer", - "APIKEY": "ApiKey", - "APPID": "App ID", - "APPLICATION": "Application", - "APPSECRET": "App Secret", - "ARGS": "Arguments", - "ATTACHMENT_NAME": "Attachment Name", - "ATTACHMENT_PATH": "Attachment Path", - "ATTACHMENT_TYPE": "Attachment Type", + "ALL_USERS": "Svi Korisnici", + "ANSWER": "Odgovor", + "APIKEY": "Ključ API", + "APPID": "Aplikacija ID", + "APPLICATION": "Aplikacija", + "APPSECRET": "Tajna Aplikacija", + "ARGS": "Argumenti", + "ATTACHMENT_NAME": "Naziv Priloga", + "ATTACHMENT_PATH": "Putanja Priloga", + "ATTACHMENT_TYPE": "Tip Priloga", "AUDIO": "Audio", - "AUDIOENCODING": "Audio Encoding", + "AUDIOENCODING": "Audio Kodiranje", "AWSLEX": "Amazon Lex", "AWSPOLLY": "AWS Polly", - "AWS_ACCESS_KEY_ID": "Access Key ID", - "AWS_BOT_NAME": "Bot name", + "AWS_ACCESS_KEY_ID": "Pristupni Ključ ID", + "AWS_BOT_NAME": "Naziv Bota", "AWS_LEX_REGION": "Region", "AWS_POLLY_REGION": "Region", "AWS_POLLY_VOICE": "Voice", - "AWS_SECRET_ACCESS_KEY": "Secret Access Key", - "AWS_TEXT_TYPE": "Text type", - "BACK": "Back", + "AWS_SECRET_ACCESS_KEY": "Tajni Pristupni Ključ", + "AWS_TEXT_TYPE": "Vrsta teksta", + "BACK": "Nazad", "BCC": "BCC", "BEEP": "Beep", - "BODY": "Body", - "CALLBACK": "Callback", - "CALLBACK_PRIORITY": "Priority", + "BODY": "Tijelo", + "CALLBACK": "Povratni poziv", + "CALLBACK_PRIORITY": "Prioritet", "CALLYSQUARE": "Cally Square", "CC": "CC", - "CHOOSE_ATTACHMENT": "Choose Attachment", - "CLIENT_EMAIL": "Client Email", - "CLOSE": "Close", - "COMMAND": "Command", - "COMPUTEDVARIABLES": "Computed Variables Script Path", - "CONDITION": "Condition", - "CONTEXT": "Context", - "COPY": "Copy", - "COPY_PROJECT": "Copy Project", - "CREATED_AT": "Created At", - "CUSTOM_ACTION": "Custom Action", - "CUSTOM_ACTION_DATA": "Custom Action Data", - "CUSTOM_APP": "Custom Application", - "DATABASE": "Database", - "DELAY": "delay [min]", - "DELETE": "Delete", - "DELETE_ODBC": "Delete ODBC", - "DELETE_PROJECT": "Delete Project", - "DELETE_SQUARERECORDING": "Delete Square Recording", - "DESCRIPTION": "Description", - "DIAL": "Dial", + "CHOOSE_ATTACHMENT": "Odaberi Prilog", + "CLIENT_EMAIL": "E-mail Stranke", + "CLOSE": "Zatvori", + "COMMAND": "Komanda", + "COMPUTEDVARIABLES": "Putanja Skripte za Izračunate Varijable", + "CONDITION": "Uslov", + "CONTEXT": "Kontekst", + "COPY": "Kopiraj", + "COPY_PROJECT": "Kopiraj Projekat", + "CREATED_AT": "Kreirano U", + "CUSTOM_ACTION": "Prilagođena Aplikacija", + "CUSTOM_ACTION_DATA": "Podaci o Prilagođenim Radnjama", + "CUSTOM_APP": "Prilagođena Aplikacija", + "DATABASE": "Baza Podataka", + "DELAY": "kašnjenje [min]", + "DELETE": "Izbriši", + "DELETE_ODBC": "Izbriši ODBC", + "DELETE_PROJECT": "Izbriši Projekat", + "DELETE_SQUARERECORDING": "Izbriši Square Snimak", + "DESCRIPTION": "Opis", + "DIAL": "Biraj", "DIALOGFLOW": "Dialogflow", "DIALOGFLOWV2": "DialogflowV2", - "DIALOGFLOWV2_LANGUAGE": "Language", - "DIALOGFLOWV2_PROJECT_ID": "Project ID", - "DIALOGFLOW_LANGUAGE": "Language", - "DIALTIMEZONE": "Dial timezone", - "DIGIT": "Max Digits", - "DIGITS": "Digits", - "DOWNLOAD_SQUARERECORDING": "Download Square Recording", - "DROP_TO_UPLOAD": "DROP TO UPLOAD", - "DROP_TO_UPLOAD_MESSAGE": "You can also drop files here to upload. Only XML - Max. 5MB", + "DIALOGFLOWV2_LANGUAGE": "Jezik", + "DIALOGFLOWV2_PROJECT_ID": "Projekat ID", + "DIALOGFLOW_LANGUAGE": "Jezik", + "DIALTIMEZONE": "Vremenska Zona Biranja", + "DIGIT": "Maksimalno Cifara", + "DIGITS": "Cifre", + "DOWNLOAD_SQUARERECORDING": "Preuzmi Square Snimak", + "DROP_TO_UPLOAD": "ISPUSTI ZA UČITAVANJE", + "DROP_TO_UPLOAD_MESSAGE": "Možeš i ovdje ispustiti datoteku za učitavanje. Samo XML - Maks. 5MB", "DSN": "DSN", - "EDIT": "Edit", - "EDIT_ODBC": "Edit ODBC", - "EDIT_PROJECT": "Edit Project", - "EDIT_SQUARERECORDING": "Edit Square Recording", - "EDIT_XML": "Edit XML", - "END": "End", + "EDIT": "Uredi", + "EDIT_ODBC": "Uredi ODBC", + "EDIT_PROJECT": "Uredi Projekat", + "EDIT_SQUARERECORDING": "Uredi Square Snimak", + "EDIT_XML": "Uredit XML", + "END": "Kraj", "ERRORS": { - "DSN_REQUIRED": "Mandatory field", - "FIELD_REQUIRED": "Mandatory field", - "NAME_REQUIRED": "Mandatory field", - "PROJECT_REQUIRED": "Mandatory field", - "URL_REQUIRED": "Mandatory field" + "DSN_REQUIRED": "Obavezno polje", + "FIELD_REQUIRED": "Obavezno polje", + "NAME_REQUIRED": "Obavezno polje", + "PROJECT_REQUIRED": "Obavezno polje", + "URL_REQUIRED": "Obavezno polje" }, - "ESCAPE_DIGITS": "Escape Digits", + "ESCAPE_DIGITS": "Izlazne Cifre", "EXTEN": "Exten", - "EXTENSION": "Extension", - "EXT_DIAL": "External Dial", - "FILE": "Filename", - "FILENAME": "Filename", + "EXTENSION": "Ekstenzija", + "EXT_DIAL": "Eksterno Biranje", + "FILE": "Ime Datoteke", + "FILENAME": "Ime Datoteke", "FILE_ID": "Audio", - "FINALLY": "Finally", - "FINDBY": "Find By", - "GETDIGITS": "Get Digits", - "GETSECRETDIGITS": "Get Secret Digits", - "GOAL": "Goal", - "GOALNAME": "Goal Name", + "FINALLY": "Konačno", + "FINDBY": "Pronađi do", + "GETDIGITS": "Dobiti Cifre", + "GETSECRETDIGITS": "Dobiti Tajne Cifre", + "GOAL": "Cilj", + "GOALNAME": "Ime Cilja", "GOOGLEASR": "GoogleASR", - "GOOGLE_ASR_LANGUAGE": "Language", + "GOOGLE_ASR_LANGUAGE": "Jezik", "GOOGLE_CLOUD_TTS": "Google Cloud TTS", - "GOOGLE_CLOUD_TTS_TEXT_TYPE": "Text Type", - "GOOGLE_TTS_LANGUAGE": "Language", + "GOOGLE_CLOUD_TTS_TEXT_TYPE": "Vrsta Teksta", + "GOOGLE_TTS_LANGUAGE": "Jezik", "GOSUB": "GoSub", "GOTOC": "GoTo", "GOTOIF": "GoToIf", "GOTOIFTIME": "GoToIfTime", - "GO_TO_PROJECTS": "Go to projects", - "GRAMMAR": "Grammar", - "HANGUP": "Hangup", - "HEADERS": "Headers", + "GO_TO_PROJECTS": "Idi na projekte", + "GRAMMAR": "Gramatika", + "HANGUP": "Prekid", + "HEADERS": "Zaglavlje", "HELP": { - "BCC": "You can add multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)", - "CC": "You can add multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)", - "DSN": "Example: DRIVER=MySQL;SERVER=127.0.0.1;UID=xcall;PWD=password;DATABASE=motion", + "BCC": "Možeš dodati više adresa odvojenih zarezima (npr. korisnik1@toyota.ba, korisnik2@toyota.ba)", + "CC": "Možeš dodati više adresa odvojenih zarezima (npr. korisnik1@toyota.ba, korisnik2@toyota.ba)", + "DSN": "Primjer: DRIVER=MySQL;SERVER=127.0.0.1;UID=xcall;PWD=password;DATABASE=motion", "MAILBOX": "mailbox@context", - "MAX_TEXT_TTS": "The maximum number of characters supported is 200", - "TO": "You can add multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)" + "MAX_TEXT_TTS": "Maksimalan broj podržanih znakova je 200", + "TO": "Možeš dodati više adresa odvojenih zarezima (npr. korisnik1@toyota.ba, korisnik2@toyota.ba)" }, - "HIDDENDIGITSNUM": "Hiddden Digits Number", - "HIDDENDIGITSPOS": "hidden Digits Position", - "ID": "Id", - "IMPORT": "Import", - "IMPORT_XML": "Import XML", + "HIDDENDIGITSNUM": "Broj Sakrivenih Cifara", + "HIDDENDIGITSPOS": "Pozicija Sakrivenih Cifara", + "ID": "ID", + "IMPORT": "Uvoz", + "IMPORT_XML": "Uvezi XML", "INTERVAL_ID": "Interval", - "INTKEY": "Interrupt Key", + "INTKEY": "Ključ Prekida", "ISPEECHASR": "iSpeech ASR", "ISPEECHTTS": "iSpeech Text-To-Speech", - "ISPEECH_ASR_LANGUAGE": "Language", - "ISPEECH_TTS_LANGUAGE": "Language", - "KEY": "Key", - "LABEL": "Label", - "LANGUAGECODE": "Language Code", - "LASTNAME": "Last Name", - "LIST_ID": "List", - "LOGIN": "Login", - "LOGOUT": "Logout", + "ISPEECH_ASR_LANGUAGE": "Jezik", + "ISPEECH_TTS_LANGUAGE": "Jezik", + "KEY": "Ključ", + "LABEL": "Oznaka", + "LANGUAGECODE": "Šifra Jezika", + "LASTNAME": "Prezime", + "LIST_ID": "Lista", + "LOGIN": "Prijava", + "LOGOUT": "Odjava", "LUMENVOXASR": "Lumenvox ASR", "LUMENVOXTTS": "Lumenvox Text-To-Speech", - "MACRO": "Macro", - "MAILBOX": "Mailbox", - "MATH": "Math", - "MAXDIGIT": "Maximum Digits", - "MENU": "Menu", - "METHOD": "Method", - "MINDIGIT": "Minimum Digits", + "MACRO": "Makro", + "MAILBOX": "Poštansko sanduče", + "MATH": "Matematika", + "MAXDIGIT": "Maksimalno Cifara", + "MENU": "Meni", + "METHOD": "Metoda", + "MINDIGIT": "Minimalno Cifara", "MODEL": "Model", "MRCPRECOG": "MRCPRecog", "MRCPSYNTH": "MRCPSynth", - "NAME": "Name", - "NDAACTIVITY_TYPE": "Activity Type", - "NDAGENERATE_AUDIO": "Generate Audio File", - "NDASSISTANT_URL": "NDASSISTANT Url", - "NDAUTH_URL": "NDAUTH Url", - "NEW": "New", - "NEW_ODBC": "New ODBC connection", - "NEW_PROJECT": "New Project", - "NEW_VARIABLE": "New Variable", + "NAME": "Ime", + "NDAACTIVITY_TYPE": "Tip Aktivnosti", + "NDAGENERATE_AUDIO": "Generiši Audio Fajl", + "NDASSISTANT_URL": "NDASSISTANT URL", + "NDAUTH_URL": "NDAUTH URL", + "NEW": "Novo", + "NEW_ODBC": "Nova ODBC konekcija", + "NEW_PROJECT": "Novi Projekat", + "NEW_VARIABLE": "Nova Varijabla", "NOOP": "NoOp", - "NOTES": "Notes", - "NO_AVAILABLE_INFO": "No available info", - "NUMBER": "Number", + "NOTES": "Bilješka", + "NO_AVAILABLE_INFO": "Nema dostupnih informacija", + "NUMBER": "Broj", "ODBC": "ODBC", - "ODBC_ID": "ODBC Connection", - "OF": "of", - "OPEN": "Open", - "OPEN_NEW_WINDOW": "Open in a new window", - "OPEN_PROJECT": "Open Project", - "OPERATION": "Operation", - "OPTIONS": "Options", - "OPTS": "Options", - "OUTPUT": "Output", - "PAGE": "Page", - "PASSWORD": "Password", - "PAUSE": "Pause", - "PAUSE_ID": "Pause type", - "PERMISSIONADD_PROJECTS": "Add Users to Project", - "PHONE": "Phone", - "PLAYBACK": "Playback", - "POSITION": "Position", - "PRIORITY": "Priority", - "PRIVATE_KEY": "Private Key", - "PROJECT": "Project", - "PROJECTS": "Projects", - "PROJECT_ID": "Project", - "QUERY": "Query", + "ODBC_ID": "ODBC Konekcija", + "OF": "od", + "OPEN": "Otvoreno", + "OPEN_NEW_WINDOW": "Otvori u novom prozoru", + "OPEN_PROJECT": "Otvori Projekat", + "OPERATION": "Operacija", + "OPTIONS": "Opcije", + "OPTS": "Opcije", + "OUTPUT": "Izlaz", + "PAGE": "Stranica", + "PASSWORD": "Šifra", + "PAUSE": "Pauza", + "PAUSE_ID": "Pauza ID", + "PERMISSIONADD_PROJECTS": "Dodaj Korisnike na Projekat", + "PHONE": "Telefon", + "PLAYBACK": "Reprodukcija", + "POSITION": "Pozicija", + "PRIORITY": "Prioritet", + "PRIVATE_KEY": "Privatni Ključ", + "PROJECT": "Projekat", + "PROJECTS": "Projekti", + "PROJECT_ID": "Projekat", + "QUERY": "Upit", "QUEUE": "Queue", "QUEUE_ID": "Queue", - "RAWBODY": "Body", - "RAWHEADERS": "Headers", - "RECORD": "Record", - "RECORDINGFORMAT": "Recording Format", - "RESPONSE": "Response Timeout", + "RAWBODY": "Tijelo", + "RAWHEADERS": "Zaglavlje", + "RECORD": "Zapis", + "RECORDINGFORMAT": "Format Snimanja", + "RESPONSE": "Istek vremena za odgovor", "RESTAPI": "Rest API", - "RETRY": "Retries", - "ROWSPERPAGE": "Rows per page", - "SAVE": "Save", - "SAYDIGITS": "Say Digits", - "SAYNUMBER": "Say number", - "SAYPHONETIC": "Say Phonetics", - "SEARCH_FOR_ANYONE": "Search", - "SELECTED": "Selected", - "SELECTED_USERS": "Selected Users", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "SENDFAX": "Send Fax", - "SENDMAIL": "Send Email", - "SENDSMS": "Send SMS", + "RETRY": "Ponovljeni Pokušaj", + "ROWSPERPAGE": "Redova po stranici", + "SAVE": "Sačuvaj", + "SAYDIGITS": "Izgovori Cifre", + "SAYNUMBER": "Izgovori Broj", + "SAYPHONETIC": "Izgovori Fonem", + "SEARCH_FOR_ANYONE": "Traži", + "SELECTED": "Odabrano", + "SELECTED_USERS": "Odabrani Korisnici", + "SELECT_ALL": "Odaberi Sve", + "SELECT_NONE": "Bez Odabira", + "SENDFAX": "Pošalji Fax", + "SENDMAIL": "Pošalji E-mail", + "SENDSMS": "Pošalji SMS", "SESTEKASR": "Sestek ASR", "SESTEKNDA": "Sestek NDA", "SESTEKTTS": "Sestek TTS", - "SET": "Set", + "SET": "Postavi", "SIP_ID": "SIP", - "SMS_ACCOUNT_ID": "Account", - "SMS_TEXT": "Text", - "SPEED": "Speed", - "SQUARERECORDINGS": "Recordings", - "SSMLGENDER": "Gender", + "SMS_ACCOUNT_ID": "Nalog", + "SMS_TEXT": "Tekst", + "SPEED": "Brzina", + "SQUARERECORDINGS": "Snimci", + "SSMLGENDER": "Spol", "START": "Start", - "SUBJECT": "Subject", - "SUBPROJECT": "Sub Project", - "SYSTEM": "System", - "TELEPHONES": "Telephones", - "TEMPLATE_ID": "Template", + "SUBJECT": "Predmet", + "SUBPROJECT": "Podprojekat", + "SYSTEM": "Sistem", + "TELEPHONES": "Telefoni", + "TEMPLATE_ID": "Šablon", "TEST_ODBC": "Test ODBC", - "TEXT": "Text", + "TEXT": "Tekst", "TILDEASR": "Tilde ASR", "TIMEOUT": "Timeout", - "TO": "To", + "TO": "Za", "TRUNK_NAME": "Trunk", "TTS": "Google Text-To-Speech", - "UNIQUEID": "Unique ID", - "UNPAUSE": "End Pause", - "UPDATE_DESCRIPTION": "Update Description", - "UPDATE_INFO": "Update Info", + "UNIQUEID": "Jedinstveni ID", + "UNPAUSE": "Kraj Pauze", + "UPDATE_DESCRIPTION": "Ažuriraj Opis", + "UPDATE_INFO": "Ažuriraj Informacije", "URI": "URI", "URL": "URL", - "USERNAME": "Username", - "USERS": "Users", - "VARIABLE_ID": "Variable", - "VARIABLE_VALUE": "Value", - "VOICEMAIL": "Voicemail", - "VSWITCH": "Variable Switch" + "USERNAME": "Korisničko Ime", + "USERS": "Korisnici", + "VARIABLE_ID": "Varijabla", + "VARIABLE_VALUE": "Vrijednost", + "VOICEMAIL": "Govorna pošta", + "VSWITCH": "Zamjena Varijable" } } diff --git a/public/app/main/apps/callysquare/i18n/et.json b/public/app/main/apps/callysquare/i18n/et.json index 2389db1..4e87d3b 100644 --- a/public/app/main/apps/callysquare/i18n/et.json +++ b/public/app/main/apps/callysquare/i18n/et.json @@ -76,7 +76,6 @@ "PROJECT_REQUIRED": "Kohustuslik väli", "URL_REQUIRED": "Kohustuslik väli" }, - "ESCAPE_DIGITS": "Väldi numbrimärke", "EXTEN": "Exten", "EXTENSION": "Laiendus", @@ -239,6 +238,8 @@ "DIALOGFLOWV2_LANGUAGE": "Keel", "DIALOGFLOWV2_PROJECT_ID": "Projekti ID", "PRIVATE_KEY": "Privaatne võti", - "DIALTIMEZONE": "Vali ajavöönd" + "DIALTIMEZONE": "Vali ajavöönd", + "APPLICATION": "Rakendus", + "AWSPOLLY": "AWS Polly" } } diff --git a/public/app/main/apps/callysquare/i18n/is.json b/public/app/main/apps/callysquare/i18n/is.json new file mode 100644 index 0000000..22b9fef --- /dev/null +++ b/public/app/main/apps/callysquare/i18n/is.json @@ -0,0 +1,244 @@ +{ + "CALLYSQUARE": { + "ACCOUNT_ID": "Account", + "ADDUSER_PROJECTS": "Add Users to Project", + "ADD_ODBC": "Add ODBC", + "ADD_PROJECT": "Add Project", + "ADD_VARIABLE": "Add Variable", + "AGENTS": "Agents", + "AGI": "AGI", + "ALL_USERS": "All Users", + "ANSWER": "Answer", + "APIKEY": "ApiKey", + "APPID": "App ID", + "APPLICATION": "Application", + "APPSECRET": "App Secret", + "ARGS": "Arguments", + "ATTACHMENT_NAME": "Attachment Name", + "ATTACHMENT_PATH": "Attachment Path", + "ATTACHMENT_TYPE": "Attachment Type", + "AUDIO": "Audio", + "AUDIOENCODING": "Audio Encoding", + "AWSLEX": "Amazon Lex", + "AWSPOLLY": "AWS Polly", + "AWS_ACCESS_KEY_ID": "Access Key ID", + "AWS_BOT_NAME": "Bot name", + "AWS_LEX_REGION": "Region", + "AWS_POLLY_REGION": "Region", + "AWS_POLLY_VOICE": "Voice", + "AWS_SECRET_ACCESS_KEY": "Secret Access Key", + "AWS_TEXT_TYPE": "Text type", + "BACK": "Back", + "BCC": "BCC", + "BEEP": "Beep", + "BODY": "Body", + "CALLBACK": "Callback", + "CALLBACK_PRIORITY": "Priority", + "CALLYSQUARE": "Cally Square", + "CC": "CC", + "CHOOSE_ATTACHMENT": "Choose Attachment", + "CLIENT_EMAIL": "Client Email", + "CLOSE": "Close", + "COMMAND": "Command", + "COMPUTEDVARIABLES": "Computed Variables Script Path", + "CONDITION": "Condition", + "CONTEXT": "Context", + "COPY": "Copy", + "COPY_PROJECT": "Copy Project", + "CREATED_AT": "Created At", + "CUSTOM_ACTION": "Custom Action", + "CUSTOM_ACTION_DATA": "Custom Action Data", + "CUSTOM_APP": "Custom Application", + "DATABASE": "Database", + "DELAY": "delay [min]", + "DELETE": "Delete", + "DELETE_ODBC": "Delete ODBC", + "DELETE_PROJECT": "Delete Project", + "DELETE_SQUARERECORDING": "Delete Square Recording", + "DESCRIPTION": "Description", + "DIAL": "Dial", + "DIALOGFLOW": "Dialogflow", + "DIALOGFLOWV2": "DialogflowV2", + "DIALOGFLOWV2_LANGUAGE": "Language", + "DIALOGFLOWV2_PROJECT_ID": "Project ID", + "DIALOGFLOW_LANGUAGE": "Language", + "DIALTIMEZONE": "Dial timezone", + "DIGIT": "Max Digits", + "DIGITS": "Digits", + "DOWNLOAD_SQUARERECORDING": "Download Square Recording", + "DROP_TO_UPLOAD": "DROP TO UPLOAD", + "DROP_TO_UPLOAD_MESSAGE": "You can also drop files here to upload. Only XML - Max. 5MB", + "DSN": "DSN", + "EDIT": "Edit", + "EDIT_ODBC": "Edit ODBC", + "EDIT_PROJECT": "Edit Project", + "EDIT_SQUARERECORDING": "Edit Square Recording", + "EDIT_XML": "Edit XML", + "END": "End", + "ERRORS": { + "DSN_REQUIRED": "Mandatory field", + "FIELD_REQUIRED": "Mandatory field", + "NAME_REQUIRED": "Mandatory field", + "PROJECT_REQUIRED": "Mandatory field", + "URL_REQUIRED": "Mandatory field" + }, + "ESCAPE_DIGITS": "Escape Digits", + "EXTEN": "Exten", + "EXTENSION": "Extension", + "EXT_DIAL": "External Dial", + "FILE": "Filename", + "FILENAME": "Filename", + "FILE_ID": "Audio", + "FINALLY": "Finally", + "FINDBY": "Find By", + "GETDIGITS": "Get Digits", + "GETSECRETDIGITS": "Get Secret Digits", + "GOAL": "Goal", + "GOALNAME": "Goal Name", + "GOOGLEASR": "GoogleASR", + "GOOGLE_ASR_LANGUAGE": "Language", + "GOOGLE_CLOUD_TTS": "Google Cloud TTS", + "GOOGLE_CLOUD_TTS_TEXT_TYPE": "Text Type", + "GOOGLE_TTS_LANGUAGE": "Language", + "GOSUB": "GoSub", + "GOTOC": "GoTo", + "GOTOIF": "GoToIf", + "GOTOIFTIME": "GoToIfTime", + "GO_TO_PROJECTS": "Go to projects", + "GRAMMAR": "Grammar", + "HANGUP": "Hangup", + "HEADERS": "Headers", + "HELP": { + "BCC": "You can add multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)", + "CC": "You can add multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)", + "DSN": "Example: DRIVER=MySQL;SERVER=127.0.0.1;UID=xcall;PWD=password;DATABASE=motion", + "MAILBOX": "mailbox@context", + "MAX_TEXT_TTS": "The maximum number of characters supported is 200", + "TO": "You can add multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)" + }, + "HIDDENDIGITSNUM": "Hiddden Digits Number", + "HIDDENDIGITSPOS": "hidden Digits Position", + "ID": "Id", + "IMPORT": "Import", + "IMPORT_XML": "Import XML", + "INTERVAL_ID": "Interval", + "INTKEY": "Interrupt Key", + "ISPEECHASR": "iSpeech ASR", + "ISPEECHTTS": "iSpeech Text-To-Speech", + "ISPEECH_ASR_LANGUAGE": "Language", + "ISPEECH_TTS_LANGUAGE": "Language", + "KEY": "Key", + "LABEL": "Label", + "LANGUAGECODE": "Language Code", + "LASTNAME": "Last Name", + "LIST_ID": "List", + "LOGIN": "Login", + "LOGOUT": "Logout", + "LUMENVOXASR": "Lumenvox ASR", + "LUMENVOXTTS": "Lumenvox Text-To-Speech", + "MACRO": "Macro", + "MAILBOX": "Mailbox", + "MATH": "Math", + "MAXDIGIT": "Maximum Digits", + "MENU": "Menu", + "METHOD": "Method", + "MINDIGIT": "Minimum Digits", + "MODEL": "Model", + "MRCPRECOG": "MRCPRecog", + "MRCPSYNTH": "MRCPSynth", + "NAME": "Name", + "NDAACTIVITY_TYPE": "Activity Type", + "NDAGENERATE_AUDIO": "Generate Audio File", + "NDASSISTANT_URL": "NDASSISTANT Url", + "NDAUTH_URL": "NDAUTH Url", + "NEW": "New", + "NEW_ODBC": "New ODBC connection", + "NEW_PROJECT": "New Project", + "NEW_VARIABLE": "New Variable", + "NOOP": "NoOp", + "NOTES": "Notes", + "NO_AVAILABLE_INFO": "No available info", + "NUMBER": "Number", + "ODBC": "ODBC", + "ODBC_ID": "ODBC Connection", + "OF": "of", + "OPEN": "Open", + "OPEN_NEW_WINDOW": "Open in a new window", + "OPEN_PROJECT": "Open Project", + "OPERATION": "Operation", + "OPTIONS": "Options", + "OPTS": "Options", + "OUTPUT": "Output", + "PAGE": "Page", + "PASSWORD": "Password", + "PAUSE": "Pause", + "PAUSE_ID": "Pause type", + "PERMISSIONADD_PROJECTS": "Add Users to Project", + "PHONE": "Phone", + "PLAYBACK": "Playback", + "POSITION": "Position", + "PRIORITY": "Priority", + "PRIVATE_KEY": "Private Key", + "PROJECT": "Project", + "PROJECTS": "Projects", + "PROJECT_ID": "Project", + "QUERY": "Query", + "QUEUE": "Queue", + "QUEUE_ID": "Queue", + "RAWBODY": "Body", + "RAWHEADERS": "Headers", + "RECORD": "Record", + "RECORDINGFORMAT": "Recording Format", + "RESPONSE": "Response Timeout", + "RESTAPI": "Rest API", + "RETRY": "Retries", + "ROWSPERPAGE": "Rows per page", + "SAVE": "Save", + "SAYDIGITS": "Say Digits", + "SAYNUMBER": "Say number", + "SAYPHONETIC": "Say Phonetics", + "SEARCH_FOR_ANYONE": "Search", + "SELECTED": "Selected", + "SELECTED_USERS": "Selected Users", + "SELECT_ALL": "Select All", + "SELECT_NONE": "Select None", + "SENDFAX": "Send Fax", + "SENDMAIL": "Send Email", + "SENDSMS": "Send SMS", + "SESTEKASR": "Sestek ASR", + "SESTEKNDA": "Sestek NDA", + "SESTEKTTS": "Sestek TTS", + "SET": "Set", + "SIP_ID": "SIP", + "SMS_ACCOUNT_ID": "Account", + "SMS_TEXT": "Text", + "SPEED": "Speed", + "SQUARERECORDINGS": "Recordings", + "SSMLGENDER": "Gender", + "START": "Start", + "SUBJECT": "Subject", + "SUBPROJECT": "Sub Project", + "SYSTEM": "System", + "TELEPHONES": "Telephones", + "TEMPLATE_ID": "Template", + "TEST_ODBC": "Test ODBC", + "TEXT": "Text", + "TILDEASR": "Tilde ASR", + "TIMEOUT": "Timeout", + "TO": "To", + "TRUNK_NAME": "Trunk", + "TTS": "Google Text-To-Speech", + "UNIQUEID": "Unique ID", + "UNPAUSE": "End Pause", + "UPDATE_DESCRIPTION": "Update Description", + "UPDATE_INFO": "Update Info", + "URI": "URI", + "URL": "URL", + "USERNAME": "Username", + "USERS": "Users", + "VARIABLE_ID": "Variable", + "VARIABLE_VALUE": "Value", + "VOICEMAIL": "Voicemail", + "VSWITCH": "Variable Switch" + } +} diff --git a/public/app/main/apps/callysquare/i18n/pt-BR.json b/public/app/main/apps/callysquare/i18n/pt-BR.json index 43ccb77..1cb4fc1 100644 --- a/public/app/main/apps/callysquare/i18n/pt-BR.json +++ b/public/app/main/apps/callysquare/i18n/pt-BR.json @@ -56,7 +56,7 @@ "DELETE_SQUARERECORDING": "Excluir Gravação Cally Square", "DESCRIPTION": "Descrição", "DIAL": "Discar", - "DIALOGFLOW": "Dialogflow", + "DIALOGFLOW": "Fluxo de diálogo", "DIALOGFLOW_LANGUAGE": "Idioma", "DIGIT": "Max Dígitos", "DIGITS": "Dígitos", @@ -156,14 +156,14 @@ "NUMBER": "Número", "ODBC": "ODBC", "ODBC_ID": "Conexão ODBC", - "OF": "do", + "OF": "de", "OPEN": "Abrir", "OPEN_NEW_WINDOW": "Abra em uma nova janela", "OPEN_PROJECT": "Projeto Aberto", "OPERATION": "Operação", "OPTIONS": "Opções", "OPTS": "Opções", - "OUTPUT": "Output", + "OUTPUT": "Saída", "PAGE": "Página", "PASSWORD": "Senha", "PAUSE": "Pausa", @@ -178,7 +178,7 @@ "PROJECT_ID": "Projeto", "QUERY": "Query", "QUEUE": "Fila", - "QUEUE_ID": "Fila", + "QUEUE_ID": "ID da Fila", "RAWBODY": "Corpo", "RAWHEADERS": "Cabeçalhos", "RECORD": "Gravação", @@ -203,8 +203,8 @@ "SESTEKNDA": "Sestek NDA", "SESTEKTTS": "Sestek TTS", "SET": "Set", - "SIP_ID": "SIP", - "SMS_ACCOUNT_ID": "Conta", + "SIP_ID": "ID SIP", + "SMS_ACCOUNT_ID": "ID da CONTA SMS", "SMS_TEXT": "Texto", "SPEED": "Velocidade", "SQUARERECORDINGS": "Gravações", @@ -219,8 +219,8 @@ "TEXT": "Texto", "TILDEASR": "Tilde ASR", "TIMEOUT": "Timeout", - "TO": "To", - "TRUNK_NAME": "Tronco", + "TO": "Para", + "TRUNK_NAME": "Nome do Tronco", "TTS": "Google Text-To-Speech", "UNIQUEID": "Unique ID", "UNPAUSE": "Fim da Pausa", @@ -235,7 +235,7 @@ "VOICEMAIL": "Correio de Voz", "VSWITCH": "Variable Switch", "CLIENT_EMAIL": "Email do Cliente", - "DIALOGFLOWV2": "DialogflowV2", + "DIALOGFLOWV2": "Fluxo de diálogo V2", "DIALOGFLOWV2_LANGUAGE": "Idioma", "DIALOGFLOWV2_PROJECT_ID": "ID do Projeto", "PRIVATE_KEY": "Chave Privada", diff --git a/public/app/main/apps/chat/i18n/bs.json b/public/app/main/apps/chat/i18n/bs.json index a8f7e5c..e51bee9 100644 --- a/public/app/main/apps/chat/i18n/bs.json +++ b/public/app/main/apps/chat/i18n/bs.json @@ -1,491 +1,491 @@ { "CHAT": { - "EDIT_DIALOGFLOWV2": "Edit Dialogflow V2", + "EDIT_DIALOGFLOWV2": "Uredi Dialogflow V2", "DIALOGFLOWV2": "Dialogflow V2", - "PRIVATEKEY": "Private Key", - "CLIENTEMAIL": "Client Email", - "PROJECTID": "Project ID", - "VIDAOOESCALATION": "Start Video Call", - "VIDAOOAPIKEY": "Vidaoo Api Key", - "VIDAOOSESSION": "Start Video Call", - "VIDAOOTOPIC": "Vidaoo Topic", - "VIDAOONOTE": "Vidaoo Note", - "VIDAOOMETADATA": "Vidaoo Metadata", + "PRIVATEKEY": "Privatni Ključ", + "CLIENTEMAIL": "E-mail Stranke", + "PROJECTID": "Projekat ID", + "VIDAOOESCALATION": "Započni Video Poziv", + "VIDAOOAPIKEY": "Vidaoo Api Ključ", + "VIDAOOSESSION": "Započni Video Poziv", + "VIDAOOTOPIC": "Vidaoo Tema", + "VIDAOONOTE": "Vidaoo Bilješka", + "VIDAOOMETADATA": "Vidaoo Metapodaci", "VIDEO": "Video", "VIDAOO": "Vidaoo", - "EDIT_AMAZONLEX": "Edit Amazon Lex", + "EDIT_AMAZONLEX": "Uredi Amazon Lex", "AMAZONLEX": "Amazon Lex", - "ACCESSKEYID": "Access Key ID", - "SECRETACCESSKEY": "Secret Access Key", + "ACCESSKEYID": "Pristupni Ključ ID", + "SECRETACCESSKEY": "Tajni Pristupni Ključ", "LEXREGION": "Region", - "BOTNAME": "Bot Name", - "LOGIN_TIME": "Login time", - "PAUSE_TIME": "Pause time", - "DOWNLOAD_INTERACTION": "Download", - "ENABLECUSTOMERCHECKMARKS": "Enable customer delivered/read notifications", - "TRANSFER": "Transfer", - "QUEUETRANSFER": "Queue Transfer", - "QUEUETRANSFERTIMEOUT": "Queue Transfer Timeout", - "AGENTTRANSFER": "Agent Transfer", - "AGENTTRANSFERTIMEOUT": "Agent Transfer Timeout", - "SYSTEMAVATAR": "System Avatar", - "SYSTEMALIAS": "System Alias", - "OPEN_NEW_INTERACTION": "Open new interaction", - "EMAIL_ACCOUNT": "Email account", - "SUBJECT": "Subject", - "WELCOMEMESSAGE": "Welcome Message", - "LANGUAGE": "Language", - "EDIT_DIALOGFLOW": "Edit Dialogflow", + "BOTNAME": "Bot Naziv", + "LOGIN_TIME": "Vrijeme prijave", + "PAUSE_TIME": "Vrijeme pauze", + "DOWNLOAD_INTERACTION": "Preuzmi", + "ENABLECUSTOMERCHECKMARKS": "Omogući obavještenja o isporuci/čitanju stranke", + "TRANSFER": "Prijenos", + "QUEUETRANSFER": "Prijenos Queue", + "QUEUETRANSFERTIMEOUT": "Prijenos Queue Timeout", + "AGENTTRANSFER": "Prijenost Specijaliste", + "AGENTTRANSFERTIMEOUT": "Timeout Prijenosa Specijaliste", + "SYSTEMAVATAR": "Avatar Sistema", + "SYSTEMALIAS": "Pseudonim Sistema", + "OPEN_NEW_INTERACTION": "Otvori novu interakciju", + "EMAIL_ACCOUNT": "E-mail nalog", + "SUBJECT": "Predmet", + "WELCOMEMESSAGE": "Poruka Dobrodošlice", + "LANGUAGE": "Jezik", + "EDIT_DIALOGFLOW": "Uredi Dialogflow", "DIALOGFLOW": "Dialogflow", - "BACKGROUNDCOLOR": "Background Color", - "MESSAGEFONTSIZE": "Message Font Size", - "ADD_NOTE": "Add note", - "NOTE": "Note", + "BACKGROUNDCOLOR": "Boja Pozadine", + "MESSAGEFONTSIZE": "Veličina Fonta Poruke", + "ADD_NOTE": "Dodaj Bilješku", + "NOTE": "Bilješka", "TAG": "Tag", - "EDIT_TAG": "Edit Tag", - "CUSTOMERALIAS": "Customer Alias", - "SNIPPETSWIPEOUT": "Snippet swipe out", - "CUSTOMERAVATAR": "Customer Avatar", - "SHOWCUSTOMERAVATAR": "Show customer avatar", - "CANNED_ANSWER_NOT_FOUND": "No Canned Answers were found", - "DEFAULTTITLE": "Default Title", - "MESSAGESALIGNMENT": "Messages Alignment", - "ALTERNATE": "Alternate", - "CENTERED": "Centered", - "POSITION": "Position", - "VERTICALPOSITION": "Vertical position", - "ALIGNMENT": "Alignment", - "VERTICALALIGNMENT": "Vertical alignment", - "BOTTOM_RIGHT": "Bottom right", - "RIGHT": "Right", - "LEFT": "Left", - "WAITFORTHEASSIGNEDAGENT": "Wait for the assigned agent", - "AGENTIDENTIFIER": "Identifier", - "WEBSITEALIAS": "Website Alias", - "AGENTALIAS": "Agent Alias", - "AGENTFULLNAME": "Agent Fullname", - "INSERT_MESSAGE_HERE": "Insert your text message here", - "HIDEWHENOFFLINE": "Hide", - "NOTIFICATION": "Notification", - "NOTIFICATIONSOUND": "Sound", - "NOTIFICATIONSHAKE": "Shake", - "NOTIFICATIONTEMPLATE": "Template", - "SYSTEM": "System", - "EDIT_SYSTEM": "Edit System", - "COMMAND": "Command", - "TEXTCOLOR": "Text Color", - "TEXT_BUTTON_COLOR": "Text Button Color", - "FONTSIZE": "Font Size", - "WEBSCRIPT": "Web Script", - "CANNEDANSWERS": "Canned Answers", - "CHATCANNEDANSWERS": "Canned Answers", - "NO_CHATCANNEDANSWER_AVAILABLE": "No Canned Answers Available", - "NEW_CHATCANNEDANSWER": "New Canned Answer", - "ADD_CHATCANNEDANSWER": "Add Canned Answer", - "EDIT_CHATCANNEDANSWER": "Edit", - "DELETE_CHATCANNEDANSWER": "Delete", - "OFFLINEMESSAGESUBJECT": "Message subject", - "OFFLINEMESSAGEBODY": "Message body", - "FORMSUBMITSUCCESSMESSAGE": "Form submit success message", - "FORMSUBMITFAILUREMESSAGE": "Form submit failure message", - "PLACEHOLDERMESSAGE": "Message placeholder", - "NOTETITLE": "Note's title", - "CLOSINGQUESTION": "Closing question", - "TAGS": "Tags", - "SHOWAGENTAVATAR": "Show personal agent avatar", - "AGENTAVATAR": "Agent Avatar", + "EDIT_TAG": "Uredi Tag", + "CUSTOMERALIAS": "Pseudonim Stranke", + "SNIPPETSWIPEOUT": "Isječak swipe out", + "CUSTOMERAVATAR": "Avatar Stranke", + "SHOWCUSTOMERAVATAR": "Prikaži avatar stranke", + "CANNED_ANSWER_NOT_FOUND": "Nije pronađen nijedan pripremljeni odgovor", + "DEFAULTTITLE": "Zadani Naslov", + "MESSAGESALIGNMENT": "Poravnanje Poruke", + "ALTERNATE": "Alternativno", + "CENTERED": "Centrirano", + "POSITION": "Pozicija", + "VERTICALPOSITION": "Vertikalna pozicija", + "ALIGNMENT": "Poravnanje", + "VERTICALALIGNMENT": "Vertikalno poravnanje", + "BOTTOM_RIGHT": "Dole Desno", + "RIGHT": "Desno", + "LEFT": "Lijevo", + "WAITFORTHEASSIGNEDAGENT": "Pričekaj dodijeljenog specijalistu", + "AGENTIDENTIFIER": "Identifikator", + "WEBSITEALIAS": "Website Pseudonim", + "AGENTALIAS": "Pseudonim Specijaliste", + "AGENTFULLNAME": "Puno Ime Specijaliste", + "INSERT_MESSAGE_HERE": "Ovdje upiši svoju tekstualnu poruku", + "HIDEWHENOFFLINE": "Sakrij", + "NOTIFICATION": "Obavijest", + "NOTIFICATIONSOUND": "Zvuk", + "NOTIFICATIONSHAKE": "Protresi", + "NOTIFICATIONTEMPLATE": "Šablon", + "SYSTEM": "Sistem", + "EDIT_SYSTEM": "Uredi Sistem", + "COMMAND": "Naredba", + "TEXTCOLOR": "Boja Teksta", + "TEXT_BUTTON_COLOR": "Boja Teksta Dugmeta", + "FONTSIZE": "Veličina Fonta", + "WEBSCRIPT": "Web Skripta", + "CANNEDANSWERS": "Pripremljeni Odgovori", + "CHATCANNEDANSWERS": "Pripremljeni Odgovori", + "NO_CHATCANNEDANSWER_AVAILABLE": "Nema dostupnih Pripremljenih Odgovora", + "NEW_CHATCANNEDANSWER": "Novi Pripremljeni Odgovor", + "ADD_CHATCANNEDANSWER": "Dodaj Pripremljeni Odgovor", + "EDIT_CHATCANNEDANSWER": "Uredi", + "DELETE_CHATCANNEDANSWER": "Izbriši", + "OFFLINEMESSAGESUBJECT": "Predmet poruke", + "OFFLINEMESSAGEBODY": "Tijelo poruke", + "FORMSUBMITSUCCESSMESSAGE": "Poruka o uspješnom slanju obrasca", + "FORMSUBMITFAILUREMESSAGE": "Poruka o neuspješnom slanju obrasca", + "PLACEHOLDERMESSAGE": "Placeholder poruke", + "NOTETITLE": "Naslov Bilješke", + "CLOSINGQUESTION": "Završno Pitanje", + "TAGS": "Tagovi", + "SHOWAGENTAVATAR": "Prikaži lični avatar specijaliste", + "AGENTAVATAR": "Avatar Specijaliste", "SPYINTERACTION": "Spy", - "NO_AGENT_ONLINE": "No Agent Online", - "GOTOREALTIME_CHATQUEUE": "Go To Realtime Chat Queue", - "PARTIALPAUSE": "Partial Pause", - "BUSY": "Busy", + "NO_AGENT_ONLINE": "Nema Specijalista Online", + "GOTOREALTIME_CHATQUEUE": "Idi na Realtime Chat Queue", + "PARTIALPAUSE": "Djelomična pauza", + "BUSY": "Zauzet", "TIMER": "Timer", "IDLE": "Idle", - "CAPACITY": "Capacity", - "AGENTSADD_QUEUE": "Add Agent to Chat Queue", + "CAPACITY": "Kapacitet", + "AGENTSADD_QUEUE": "Dodaj Specijalistu u Chat Queue", "QUEUES": "Queues", - "LOGGED_IN": "Logged in", - "PAUSED": "Paused", - "READY": "Ready", - "WAITING": "Waiting", - "WRITING": "Writing", + "LOGGED_IN": "Prijavljen", + "PAUSED": "Pauzirano", + "READY": "Spreman", + "WAITING": "Čekanje", + "WRITING": "Piše", "CHAT": "Chat", - "MAIL": "Email", + "MAIL": "E-mail", "SMS": "SMS", - "OPENCHANNEL": "Openchannel", + "OPENCHANNEL": "Otvoreni kanal", "FAX": "Fax", - "PAUSE": "Pause", + "PAUSE": "Pauza", "REALTIME": "Realtime", - "AGENTS": "Agents", - "FULLNAME": "Full Name", - "INTERNAL": "Internal", - "PHONE_STATE": "Phone State", - "PHONE_STATUS": "Phone Status", - "LOGOUT": "Logout", - "UNPAUSE": "End Pause", - "AGENTADD_QUEUE": "Add Agent to Chat Queue", - "TEXT": "Text", - "TIMES": "Number of times per interaction", - "EDIT_AUTOREPLY": "Edit Auto Reply", - "AUTOREPLY": "Auto Reply", - "NEW_CHATDISPOSITION": "New Chat Disposition", - "ENABLECUSTOMERATTACHMENT": "Enable Customer Attachments", - "ENABLESENDBUTTON": "Enable Send Button", - "OFFLINE_CHAT_BUTTON": "'Offline Chat' Button", + "AGENTS": "Specijaliste", + "FULLNAME": "Puno Ime", + "INTERNAL": "Interni", + "PHONE_STATE": "Stanje telefona", + "PHONE_STATUS": "Status telefona", + "LOGOUT": "Odjava", + "UNPAUSE": "Završi Pauzu", + "AGENTADD_QUEUE": "Dodaj Specijalistu u Chat Queue", + "TEXT": "Tekst", + "TIMES": "Broj puta po interakciji", + "EDIT_AUTOREPLY": "Uredi Automatski Odgovor", + "AUTOREPLY": "Automatski Odgovor", + "NEW_CHATDISPOSITION": "Nova Chat Dispozicija", + "ENABLECUSTOMERATTACHMENT": "Omogući Priloge Stranke", + "ENABLESENDBUTTON": "Omogući Dugme za Slanje", + "OFFLINE_CHAT_BUTTON": "'Offline Chat' Dugme", "OFFLINESTATUS": "Offline Status", - "NAME": "Name", - "CHATQUEUES": "Chat Queues", - "SEARCH_FOR_ANYONE": "Search", - "STRATEGY": "Strategy", - "AGENT_TIMEOUT": "Agent Timeout", - "DESCRIPTION": "Description", - "KEY": "Key", - "ALIAS": "Alias", - "VARIABLE": "Variable", + "NAME": "Ime", + "CHATQUEUES": "Chat Queue", + "SEARCH_FOR_ANYONE": "Traži", + "STRATEGY": "Strategija", + "AGENT_TIMEOUT": "Timeout Specijaliste", + "DESCRIPTION": "Opis", + "KEY": "Ključ", + "ALIAS": "Pseudonim", + "VARIABLE": "Varijabla", "INTERVAL": "Interval", - "EDIT_CLOSE": "Edit Close", - "TIMEZONE": "Timezone", - "MESSAGE": "Message", - "ADVANCED": "Advanced", - "FORWARDTRANSCRIPT": "Forward Transcript", - "FORWARDTRANSCRIPTMESSAGE": "Forward Transcript Message", - "SKIPMESSAGEBUTTON": "Skip Message Button", - "EDIT_MESSAGE": "Edit Message", - "CONDITION_AGREEMENT": "Condition Agreement", - "NONE": "None", - "PRIORITY": "Priority", + "EDIT_CLOSE": "Uredi Zatvaranje", + "TIMEZONE": "Vremenska zona", + "MESSAGE": "Poruka", + "ADVANCED": "Napredno", + "FORWARDTRANSCRIPT": "Proslijedi Transkript", + "FORWARDTRANSCRIPTMESSAGE": "Proslijedi Transkript Poruku", + "SKIPMESSAGEBUTTON": "Dugme Skip Poruke", + "EDIT_MESSAGE": "Uredi Poruku", + "CONDITION_AGREEMENT": "Ugovor o Uslovima", + "NONE": "Ništa", + "PRIORITY": "Prioritet", "ONLINESTATUS": "Online Status", - "UNMANAGEDSTATUS": "Unmanaged Status", - "AUTOCLOSE": "Enable Autoclose", - "ENABLEUNMANAGEDNOTE": "Enable Unmanaged Message", - "UNMANAGEDMESSAGE": "Message", - "SKIPUNMANAGED": "Skip Message", - "SENDUNMANAGED": "Send Message", - "WEBSITESCRIPT": "Website Script", - "DELETE_OFFLINEMESSAGE": "Delete", - "OFFLINEMESSAGES": "Offline Messages", - "FORWARD_OFFLINE": "Forward Offline", - "SHOW_OFFLINEMESSAGE": "Show", - "FORWARD_OFFLINE_ADDRESS": "Forward Offline Address", - "CLOSINGFORM": "Closing Form", - "ENABLERATING": "Enable Rating", - "ENABLECUSTOMERWRITING": "Allow customer writing before agent accepting", - "ENABLEFEEDBACK": "Enable Feedback", - "FEEDBACKTITLE": "Feedback Title", - "RATINGTYPE": "Rating Type", - "CLOSINGMESSAGE": "Closing Message", - "CLOSINGMESSAGEBUTTON": "Closing Message Button", - "RATINGSTARSNUMBER": "Rating Stars Number", - "EDIT_GOTOIF": "Edit GotoIf", - "CONDITION": "Condition", - "TRUEPRIORITY": "True Priority", - "FALSEPRIORITY": "False Priority", - "VALUE": "Value", - "MANDATORYDISPOSITION": "Mandatory disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pause to use if mandatory disposition is enabled", - "SERVICEID": "Service ID", - "CHANNELID": "Channel ID", - "EDIT_TVOX": "Edit TVox", - "SERVICENAME": "Service name", + "UNMANAGEDSTATUS": "Neupravljani Status", + "AUTOCLOSE": "Omogući Automatsko Zatvaranje", + "ENABLEUNMANAGEDNOTE": "Omogući Neupravljanu Poruku", + "UNMANAGEDMESSAGE": "Poruka", + "SKIPUNMANAGED": "Skip Poruku", + "SENDUNMANAGED": "Pošalji Poruku", + "WEBSITESCRIPT": "Website Skripta", + "DELETE_OFFLINEMESSAGE": "Izbriši", + "OFFLINEMESSAGES": "Offline Poruke", + "FORWARD_OFFLINE": "Proslijedi Offline", + "SHOW_OFFLINEMESSAGE": "Prikaži", + "FORWARD_OFFLINE_ADDRESS": "Proslijedi Offline Adresu", + "CLOSINGFORM": "Obrazan Zatvaranja", + "ENABLERATING": "Omogući Ocjenjivanje", + "ENABLECUSTOMERWRITING": "Dozvoli stranci pisanje prije nego što Specijalista prihvati", + "ENABLEFEEDBACK": "Omogući Povratne Informacije", + "FEEDBACKTITLE": "Naslov Povratne Informacije", + "RATINGTYPE": "Tip Ocjene", + "CLOSINGMESSAGE": "Završna Poruka", + "CLOSINGMESSAGEBUTTON": "Dugme Završne Poruke", + "RATINGSTARSNUMBER": "Broj Zvjezdica Ocjene", + "EDIT_GOTOIF": "Uredi GotoIf", + "CONDITION": "Uslov", + "TRUEPRIORITY": "Pravi Prioritet", + "FALSEPRIORITY": "Pogrešan Prioritet", + "VALUE": "Vrijednost", + "MANDATORYDISPOSITION": "Obavezna dispozicija", + "MANDATORYDISPOSITIONPAUSEID": "Pauza koja se koristi ukoliko je Obavezna dispozicija uključena", + "SERVICEID": "Servis ID", + "CHANNELID": "Kanal ID", + "EDIT_TVOX": "Uredi TVox", + "SERVICENAME": "Ime Servisa", "TVOX": "TVox", "TVOXURL": "TVox IP URL", - "TVOXIP": "TVox IP Address", - "TVOXUSERNAME": "TVox Username", - "TVOXPASSWD": "TVox Password", - "TVOXLOGINURL": "TVox Login REST Url", - "TVOXSESSIONURL": "TVox Session REST Url", - "MOTIONURLONRING": "Motion URL On Ring", - "MOTIONURLONANSWER": "Motion URL On Answer", - "MOTIONTITLE": "Motion Title", + "TVOXIP": "TVox IP Adresa", + "TVOXUSERNAME": "TVox Korisničko ime", + "TVOXPASSWD": "TVox Šifra", + "TVOXLOGINURL": "TVox Prijava REST Url", + "TVOXSESSIONURL": "TVox Sesija REST Url", + "MOTIONURLONRING": "Motion URL u Zazvoniti", + "MOTIONURLONANSWER": "Motion URL u Odgovoru", + "MOTIONTITLE": "Motion Naslov", "MOTIONURL": "Motion URL", "ERRORS": { - "PROJECTID_REQUIRED": "Mandatory Field", - "CLIENTEMAIL_REQUIRED": "Mandatory Field", - "PRIVATEKEY_REQUIRED": "Mandatory Field", - "VIDAOOAPIKEY_REQUIRED": "Mandatory Field", - "VIDAOOTOPIC_REQUIRED": "Mandatory Field", - "BOTNAME_REQUIRED": "Mandatory Field", - "SECRETACCESSKEY_REQUIRED": "Mandatory Field", - "ACCESSKEYID_REQUIRED": "Mandatory Field", - "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "QUEUETRANSFERTIMEOUT_REQUIRED": "Mandatory Field", - "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "AGENTTRANSFERTIMEOUT_REQUIRED": "Mandatory Field", - "CUSTOMERALIAS_REQUIRED": "Mandatory Field", - "AGENTALIAS_REQUIRED": "Mandatory Field", - "SYSTEMALIAS_REQUIRED": "Mandatory Field", - "MESSAGEFONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "MESSAGEFONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "MESSAGEFONTSIZE_REQUIRED": "Mandatory Field", - "TAG_REQUIRED": "Mandatory Field", - "VERTICALPOSITION_REQUIRED": "Mandatory Field", - "VERTICALPOSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "VERTICALPOSITION_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Mandatory Field", - "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "NAME_MUST_VALID_PATTERN": "Wrong format", - "COMMAND_REQUIRED": "Mandatory Field", - "FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "FONTSIZE_REQUIRED": "Mandatory Field", - "TEXT_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "VALUE_REQUIRED": "Mandatory Field", - "CUSTOMERALIAS_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "SYSTEMALIAS_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "OFFLINEMESSAGESUBJECT_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "OFFLINEMESSAGEBODY_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "PLACEHOLDERMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "NOTETITLE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "FORMSUBMITSUCCESSMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "FORMSUBMITFAILUREMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "CLOSINGQUESTION_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "HEADER_OFFLINE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "OFFLINE_CHAT_BUTTON_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "TEXT_REQUIRED": "Mandatory Field", - "SENDUNMANAGED_REQUIRED": "Mandatory Field", - "SENDUNMANAGED_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "SKIPUNMANAGED_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "UNMANAGEDMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "WEBSITEALIAS_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "AGENT_REQUIRED": "Mandatory Field", - "QUEUE_REQUIRED": "Mandatory Field", - "CONDITION_REQUIRED": "Mandatory Field", - "PRIORITY_REQUIRED": "Mandatory Field", - "TRUEPRIORITY_REQUIRED": "Mandatory Field", - "FALSEPRIORITY_REQUIRED": "Mandatory Field", - "NAME_REQUIRED": "Mandatory Field", - "LIST_REQUIRED": "Mandatory Field", - "AGENT_TIMEOUT_REQUIRED": "Mandatory Field", - "MOTIONADDRESS_REQUIRED": "Mandatory Field", - "DISPOSITION_REQUIRED": "Mandatory Field", - "MOTIONADDRESS_MUST_VALID_URL": "Wrong format", - "EMAIL_MUST_BE_VALID": "Wrong format", - "ADDRESS_REQUIRED": "Mandatory Field", - "ADDRESS_MUST_VALID_URL": "Wrong format", - "ENQUIRY_FORWARDING_ADDRESS_REQUIRED": "Mandatory Field", - "ACCEPTURL_MUST_VALID_URL": "Wrong format", - "TIMEOUT_REQUIRED": "Mandatory Field", - "REJECTURL_MUST_VALID_URL": "Wrong format", - "CLOSEURL_MUST_VALID_URL": "Wrong format", - "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", - "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", - "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", - "POLLING_INTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", - "WAITINGMESSAGE_REQUIRED": "Mandatory Field", - "WAITINGTITLE_REQUIRED": "Mandatory Field", - "KEY_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "KEY_REQUIRED": "Mandatory Field", - "WAITINGMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "WAITINGTITLE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "RATINGSTARSNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Mandatory field", - "EMAIL_ACCOUNT_REQUIRED": "Mandatory field" + "PROJECTID_REQUIRED": "Obavezno Polje", + "CLIENTEMAIL_REQUIRED": "Obavezno Polje", + "PRIVATEKEY_REQUIRED": "Obavezno Polje", + "VIDAOOAPIKEY_REQUIRED": "Obavezno Polje", + "VIDAOOTOPIC_REQUIRED": "Obavezno Polje", + "BOTNAME_REQUIRED": "Obavezno Polje", + "SECRETACCESSKEY_REQUIRED": "Obavezno Polje", + "ACCESSKEYID_REQUIRED": "Obavezno Polje", + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Obavezno Polje", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Obavezno Polje", + "CUSTOMERALIAS_REQUIRED": "Obavezno Polje", + "AGENTALIAS_REQUIRED": "Obavezno Polje", + "SYSTEMALIAS_REQUIRED": "Obavezno Polje", + "MESSAGEFONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "MESSAGEFONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "MESSAGEFONTSIZE_REQUIRED": "Obavezno Polje", + "TAG_REQUIRED": "Obavezno Polje", + "VERTICALPOSITION_REQUIRED": "Obavezno Polje", + "VERTICALPOSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "VERTICALPOSITION_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Obavezno Polje", + "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "NAME_MUST_VALID_PATTERN": "Pogrešan Format", + "COMMAND_REQUIRED": "Obavezno Polje", + "FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "FONTSIZE_REQUIRED": "Obavezno Polje", + "TEXT_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "VALUE_REQUIRED": "Obavezno Polje", + "CUSTOMERALIAS_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "SYSTEMALIAS_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "OFFLINEMESSAGESUBJECT_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "OFFLINEMESSAGEBODY_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "PLACEHOLDERMESSAGE_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "NOTETITLE_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "FORMSUBMITSUCCESSMESSAGE_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "FORMSUBMITFAILUREMESSAGE_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "CLOSINGQUESTION_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "HEADER_OFFLINE_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "OFFLINE_CHAT_BUTTON_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "TEXT_REQUIRED": "Obavezno Polje", + "SENDUNMANAGED_REQUIRED": "Obavezno Polje", + "SENDUNMANAGED_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "SKIPUNMANAGED_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "UNMANAGEDMESSAGE_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "WEBSITEALIAS_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "AGENT_REQUIRED": "Obavezno Polje", + "QUEUE_REQUIRED": "Obavezno Polje", + "CONDITION_REQUIRED": "Obavezno Polje", + "PRIORITY_REQUIRED": "Obavezno Polje", + "TRUEPRIORITY_REQUIRED": "Obavezno Polje", + "FALSEPRIORITY_REQUIRED": "Obavezno Polje", + "NAME_REQUIRED": "Obavezno Polje", + "LIST_REQUIRED": "Obavezno Polje", + "AGENT_TIMEOUT_REQUIRED": "Obavezno Polje", + "MOTIONADDRESS_REQUIRED": "Obavezno Polje", + "DISPOSITION_REQUIRED": "Obavezno Polje", + "MOTIONADDRESS_MUST_VALID_URL": "Pogrešan Format", + "EMAIL_MUST_BE_VALID": "Pogrešan Format", + "ADDRESS_REQUIRED": "Obavezno Polje", + "ADDRESS_MUST_VALID_URL": "Pogrešan Format", + "ENQUIRY_FORWARDING_ADDRESS_REQUIRED": "Obavezno Polje", + "ACCEPTURL_MUST_VALID_URL": "Pogrešan Format", + "TIMEOUT_REQUIRED": "Obavezno Polje", + "REJECTURL_MUST_VALID_URL": "Pogrešan Format", + "CLOSEURL_MUST_VALID_URL": "Pogrešan Format", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "POLLING_INTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka", + "WAITINGMESSAGE_REQUIRED": "Obavezno Polje", + "WAITINGTITLE_REQUIRED": "Obavezno Polje", + "KEY_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "KEY_REQUIRED": "Obavezno Polje", + "WAITINGMESSAGE_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "WAITINGTITLE_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "RATINGSTARSNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Obavezno Polje", + "EMAIL_ACCOUNT_REQUIRED": "Obavezno Polje" }, - "CM_FIELD": "Contact Manager Field", - "CHATPROACTIVEACTIONS": "Proactive Actions", - "NEW_CHATPROACTIVEACTION": "New Proactive Action", - "EDIT_CHATPROACTIVEACTION": "Edit Proactive Action", - "DELETE_CHATPROACTIVEACTION": "Delete Proactive Action", - "ADD_CHATPROACTIVEACTION": "Add Proactive Action", - "NO_CHATPROACTIVEACTION_AVAILABLE": "No Proactive Actions Available", - "NO_OFFLINEMESSAGE_AVAILABLE": "No Offline Messages Available", - "MOUSEOVER": "Mouse Over", + "CM_FIELD": "Kontakt Menadžer Polje", + "CHATPROACTIVEACTIONS": "Proaktivne Radnje", + "NEW_CHATPROACTIVEACTION": "Nova Proaktivna Radnja", + "EDIT_CHATPROACTIVEACTION": "Uredi Proaktivne Radnje", + "DELETE_CHATPROACTIVEACTION": "Izbriši Proaktivnu Radnju", + "ADD_CHATPROACTIVEACTION": "Dodaj Proaktivnu Radnju", + "NO_CHATPROACTIVEACTION_AVAILABLE": "Nema dostupnih Proaktivnih Radnji", + "NO_OFFLINEMESSAGE_AVAILABLE": "Nema dostupnih Offline Poruka", + "MOUSEOVER": "Miš Preko", "TIMEOUT": "Timeout", - "TYPE": "Type", - "SELECTOR": "Selector", - "AGENT": "Agent", + "TYPE": "Tip", + "SELECTOR": "Selektror", + "AGENT": "Specijalist", "GOTO": "Goto", "GOTOIF": "GotoIf", "NOOP": "Noop", "QUEUE": "Queue", - "BUILDER": "Builder", - "PREVIEW": "Preview", - "EDIT_AGENT": "Edit Agent", - "EDIT_QUEUE": "Edit Queue", - "EDIT_GOTO": "Edit Goto", - "EDIT_GOTOIf": "Edit GotoIf", - "EDIT_NOOP": "Edit Noop", - "ADD_CHATQUEUE": "Add Chat Queue", - "EDIT_CHATQUEUE": "Edit Chat Queue", - "DELETE_CHATQUEUE": "Delete Chat Queue", - "SETTINGS": "Settings", - "SAVE": "Save", - "SCRIPT": "Script", + "BUILDER": "Graditelj", + "PREVIEW": "Pregled", + "EDIT_AGENT": "Uredi Specijalistu", + "EDIT_QUEUE": "Uredi Queue", + "EDIT_GOTO": "Uredi Goto", + "EDIT_GOTOIf": "Uredi GotoIf", + "EDIT_NOOP": "Uredi Noop", + "ADD_CHATQUEUE": "Dodaj Chat Queue", + "EDIT_CHATQUEUE": "Uredi Chat Red", + "DELETE_CHATQUEUE": "Izbriši Chat Queue", + "SETTINGS": "Postavke", + "SAVE": "Sačuvaj", + "SCRIPT": "Skripta", "TOKEN": "Token", - "CREATED_AT": "Created At", - "CHATWEBSITES": "Chat Websites", - "MOTIONADDRESS": "Website Domain", - "MOTIONPROXY": "Proxy Or Motion Domain", - "ADD_CHATWEBSITE": "Add Chat Website", - "EDIT_CHATWEBSITE": "Edit Chat Website", - "DELETE_CHATWEBSITE": "Delete Chat Website", - "LIST": "List", - "SNIPPET": "Snippet", - "FORMS": "Forms", - "UP": "Up", - "DOWN": "Down", - "COLLAPSE": "Collapse", - "PROACTIVEACTIONS": "Proactive Actions", - "DISPOSITIONS": "Dispositions", + "CREATED_AT": "Kreirano U", + "CHATWEBSITES": "Chat Website", + "MOTIONADDRESS": "Domena Web Stranice", + "MOTIONPROXY": "Proxy Or Motion Domena", + "ADD_CHATWEBSITE": "Dodaj Chat Website", + "EDIT_CHATWEBSITE": "Uredi Chat Website", + "DELETE_CHATWEBSITE": "Izbriši Chat Website", + "LIST": "Lista", + "SNIPPET": "Isječak", + "FORMS": "Obrasci", + "UP": "Gore", + "DOWN": "Dole", + "COLLAPSE": "Zatvori", + "PROACTIVEACTIONS": "Proaktivna Radnja", + "DISPOSITIONS": "Dispozicije", "WEBHOOKS": "WebHooks", - "ACTIONS": "Actions", - "FIDELITY": "Fidelity", - "APPEARANCE": "Appearance", - "MAINCOLOR": "Main Color", - "FOCUSCOLOR": "Focus Color", - "BUTTONCOLOR": "Button Color", - "HEADERSHAPE": "Header Shape", - "ANIMATION": "Animation", - "DEFAULT": "Default", + "ACTIONS": "Radnje", + "FIDELITY": "Vjernost", + "APPEARANCE": "Izgled", + "MAINCOLOR": "Glavna Boja", + "FOCUSCOLOR": "Boja Fokusa", + "BUTTONCOLOR": "Boja Dugmeta", + "HEADERSHAPE": "Oblik Zaglavlja", + "ANIMATION": "Animacija", + "DEFAULT": "Zadano", "WHITELABEL": "White Label", "LOGO": "Logo", - "DOWNLOADTRANSCRIPT": "Download Transcript", - "ENQUIRY_ENABLE": "Enquiry Enable", - "ENQUIRY_FORWARDING": "Enquiry Forwarding", - "ENQUIRY_FORWARDING_ADDRESS": "Enquiry Forwarding Address", - "LABELS": "Labels", - "HEADER_ONLINE": "Online Header", - "ONLINE_MESSAGE": "Online Message", - "NAME_TITLE": "Name Input Label", - "USERNAME_PLACEHOLDER": "Username Input Placeholder", - "EMAIL_TITLE": "Email Input Label", - "EMAIL_PLACEHOLDER": "Email Input Placeholder", - "START_CHAT_BUTTON": "'Start Chat' Button", - "AGENTS_BUSY": "Busy Agents Message", - "HEADER_OFFLINE": "Offline Header", - "OFFLINE_MESSAGE": "Offline Message", - "MESSAGE_TITLE": "Message Label", - "ENQUIRY_MESSAGE_PLACEHOLDER": "Enquiry Message Input Placeholder", - "ENQUIRY_BUTTON": "Enquiry Button Text", - "RATING_MESSAGE": "Rating Message", - "RATING_SEND": "Rating Send Button Text", - "RATING_SKIP": "Rating Skip Button Text", + "DOWNLOADTRANSCRIPT": "Preuzmi Transkript", + "ENQUIRY_ENABLE": "Omogućen Upit", + "ENQUIRY_FORWARDING": "Prosljeđivanje Upita", + "ENQUIRY_FORWARDING_ADDRESS": "Adresa za Prosljeđivanje Upita", + "LABELS": "Oznake", + "HEADER_ONLINE": "Online Zaglavlje", + "ONLINE_MESSAGE": "Online Poruka", + "NAME_TITLE": "Oznaka Unosa Imena", + "USERNAME_PLACEHOLDER": "Korisničko ime Unos Placeholder", + "EMAIL_TITLE": "E-mail Unos Oznake", + "EMAIL_PLACEHOLDER": "E-mail Unos Placeholder", + "START_CHAT_BUTTON": "'Pokreni Chat' Dugme", + "AGENTS_BUSY": "Poruka Zauzetih Specijalista", + "HEADER_OFFLINE": "Offline Zaglavlje", + "OFFLINE_MESSAGE": "Offline Poruka", + "MESSAGE_TITLE": "Oznaka Poruke", + "ENQUIRY_MESSAGE_PLACEHOLDER": "Upit Poruka Unos Placeholder", + "ENQUIRY_BUTTON": "Tekst Dugmeta za Upit", + "RATING_MESSAGE": "Poruka Ocjene", + "RATING_SEND": "Tekst Dugmeta za Slanje Ocjene", + "RATING_SKIP": "Tekst Dugmeta za Skip Ocjene", "ONLINE": "Online", "OFFLINE": "Offline", - "PROACTIVE": "Proactive", - "ACCEPT": "Accept", - "ACCEPTMETHOD": "Accept Method", - "ACCEPTURL": "Accept URL", - "REJECT": "Reject", - "REJECTMETHOD": "Reject Method", - "REJECTURL": "Reject URL", - "CLOSE": "Close", - "CLOSEMETHOD": "Close Method", - "CLOSEURL": "Close URL", - "EMBEDDING": "Embedding", - "GENERAL": "General", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "BACK": "Back", + "PROACTIVE": "Proaktivni", + "ACCEPT": "Prihvati", + "ACCEPTMETHOD": "Prihvati Metodu", + "ACCEPTURL": "Prihvati URL", + "REJECT": "Odbaci", + "REJECTMETHOD": "Odbaci Metodu", + "REJECTURL": "Odbaci URL", + "CLOSE": "Zatvori", + "CLOSEMETHOD": "Metoda Zatvaranja", + "CLOSEURL": "Zatvori URL", + "EMBEDDING": "Ugrađivanje", + "GENERAL": "Općenito", + "SELECTED": "Odabrano", + "SELECT_ALL": "Odaberi Sve", + "SELECT_NONE": "Odaberi Ništa", + "BACK": "Nazad", "HELP": { - "VERTICALPOSITION": "Represents the distance in percentage from top", - "AGENTIDENTIFIER": "Represents the agent identifier within the chat session in the snippet", - "HIDEWHENOFFLINE": "Hides snippet when offline", - "KEY": "Website short name (5 char) shown on the Agent Tab", - "TOKEN": "Automatically generated token used in the Script", - "INTEVAL": "To be selected from the list of the available intervals", - "TIMEZONE": "Select one from the list (default=local timezone)", - "ENABLERATING": "Enable it if you want the web visitor can rate the interaction at the end", - "ENABLEFEEDBACK": "Enable it if you want the web visitor can send a feedback (up to 150 char) at the end", - "FORWARDTRANSCRIPT": "Enable it if you want the web visitor is asked to receive a chat transcript via email", - "AUTOCLOSE": "Enable it if you want chat sessions to be closed as Unmanaged if no agent is available. Learn more about it at: https://wiki.xcallymotion.com/display/XMV/Chat+Websites#ChatWebsites-Snippet", - "ENABLEUNMANAGEDNOTE": "Enable it if you want the visitor is shown a message when all the agents are busy and the chat gets unmanaged", - "WEBSITEALIAS": "A prefix used to compose the agent name (prefix+Agent Id) shown to the web visitor during the chat session", - "ENABLECUSTOMERWRITING": " Enable it if you want the chat starts without waiting for an available agent (pay attention: if you enable it, your chats will never get unmanaged). Learn more at: https://wiki.xcallymotion.com/display/XMV/Chat+Websites#ChatWebsites-Snippet", - "MAPKEY": "The following Motion Contact Manager field:", - "FROMKEY": "Will be mapped in your Motion Chat Snippet as:", - "COPYSCRIPTTOCLIPBOARD": "Copy and paste the script text into your website", - "FORWARD_OFFLINE": "You can add multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)", - "MOTIONADDRESS": "The field must have the following format: ://[:]. Example: https://X.Y.Z.W", - "MOTIONPROXY": "The field must have the following format: ://[:]. Example: https://X.Y.Z.W", - "NAME": "Only numbers, letters and specific characters (._) are supported", - "LIST": "Contact Manager list used to associate Contacts", - "INTERVAL": "Select one from the list", - "MANDATORYDISPOSITION": "Mandatory disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pause to use if mandatory disposition is enabled", - "WELCOMEMESSAGE": "Leave empty if you don't want to send any welcome message" + "VERTICALPOSITION": "Predstavlja udaljenost u postocima sa vrha", + "AGENTIDENTIFIER": "Predstavlja identifikator specijaliste unutar sesije chat-a u isječku", + "HIDEWHENOFFLINE": "Sakriva isječak kada si offline", + "KEY": "Kratak naziv web stranice (5 znakova) prikazan na Kartici Specijaliste", + "TOKEN": "Automatski generisani token koji se koristi u Skripti", + "INTEVAL": "Biti izabran sa liste dostupnih intervala", + "TIMEZONE": "Odaberi jednu sa liste (zadano=lokalna vremenska zona)", + "ENABLERATING": "Omogući ako želiš da posjetitelj web stranice može ocijeniti interakciju na kraju", + "ENABLEFEEDBACK": "Omogući ako želiš da posjetitelj web stranice može poslati povratnu informaciju (do 150 znakova) na kraju", + "FORWARDTRANSCRIPT": "Omogući ako želiš da se posjetitelja web stranice pita da li želi da primi transkript chat-a putem e-maila", + "AUTOCLOSE": "Omogući ako želiš da se sesije chat-a zatvore kao Neupravljane, ako specijalista nije dostupan. Saznaj više o tome na: https://wiki.xcallymotion.com/display/XMV/Chat+Websites#ChatWebsites-Snippet", + "ENABLEUNMANAGEDNOTE": "Omogući ako želiš da se posjetiocu prikaže poruka kada su svi specijalisti zauzeti i chat-om se ne upravlja", + "WEBSITEALIAS": "Prefiks koji se koristi za sastavljanje imena specijaliste (prefiks+ID specijaliste) koji se prikazuje web posjetitelju tokom chat sesije", + "ENABLECUSTOMERWRITING": "Omogući ga ako želiš da chat počne bez čekanja dostupnog specijaliste (obrati pažnju: ako ga omogućiš, tvoji chat-ovi nikada neće ostati kao Neupravljani). Saznaj više na: https://wiki.xcallymotion.com/display/XMV/Chat+Websites#ChatWebsites-Snippet", + "MAPKEY": "Sljedeće Motion Kontakt Menadžer polje:", + "FROMKEY": "Bit će mapirano u tvom Motion Chat Isječku kao:", + "COPYSCRIPTTOCLIPBOARD": "Kopiraj i zalijepi tekst skripte na svoju web stranicu", + "FORWARD_OFFLINE": "Možeš dodati više adresa odvojenih zarezima (npr. korisnik1@toyota.ba, korisnik2@toyota.ba)", + "MOTIONADDRESS": "Polje mora imati sljedeći format:://[:]. Primjer: https://X.Y.Z.W", + "MOTIONPROXY": "Polje mora imati sljedeći format: ://[:]. Primjer: https://X.Y.Z.W", + "NAME": "Podržani su samo brojevi, slova i specifični znakovi (._)", + "LIST": "Kontakt Menadžer lista koja se koristi za povezivanje Kontakata", + "INTERVAL": "Odaberi jedan sa liste", + "MANDATORYDISPOSITION": "Obavezna dispozicija", + "MANDATORYDISPOSITIONPAUSEID": "Pauza koja se koristi ako je obavezna dispozicija uključena", + "WELCOMEMESSAGE": "Ostavi prazno ako ne želiš da šalješ poruku dobrodošlice" }, - "ADDRESS": "Address", + "ADDRESS": "Adresa", "ONLINESTATE": "Online Status", "OFFLINESTATE": "Offline Status", - "RATINGSTATE": "Rating State", - "ENQUIRY": "Enquiry", - "OFFLINETEMPLATE": "Offline Template", - "CHATDISPOSITIONS": "Chat Dispositions", - "NO_CHATDISPOSITION_AVAILABLE": "No Chat Dispositions available", - "ADD_CHATDISPOSITION": "Add Chat Disposition", - "DELETE": "Delete", - "EDIT_CHATDISPOSITION": "Edit Chat Disposition", - "DELETE_CHATDISPOSITION": "Delete Chat Disposition", - "ID": "Id", - "NEW_CHATQUEUE": "New Chat Queue", - "NEW_CHATWEBSITE": "New Chat Website", - "ROUNDED": "Rounded", - "SQUARED": "Squared", - "NO_AVAILABLE_INFO": "No available info", - "ALL_TEAMS": "All Teams", - "SELECTED_TEAMS": "Selected Teams", - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", - "CONTACT": "Contact", - "STARTEDAT": "Started At", - "LASTMESSAGE": "Last message", + "RATINGSTATE": "Stanje Ocjene", + "ENQUIRY": "Upit", + "OFFLINETEMPLATE": "Offline Šablon", + "CHATDISPOSITIONS": "Chat Dispozicija", + "NO_CHATDISPOSITION_AVAILABLE": "Nema dostupnih Chat Dispozicija", + "ADD_CHATDISPOSITION": "Dodaj Chat Dispoziciju", + "DELETE": "Izbriši", + "EDIT_CHATDISPOSITION": "Uredi Chat Dispozicije", + "DELETE_CHATDISPOSITION": "Izbriši Chat Dispoziciju", + "ID": "ID", + "NEW_CHATQUEUE": "Novi Chat Queue", + "NEW_CHATWEBSITE": "Novi Chat Website", + "ROUNDED": "Zaobljen", + "SQUARED": "Kvadratno", + "NO_AVAILABLE_INFO": "Nema dostupnih informacija", + "ALL_TEAMS": "Svi Timovi", + "SELECTED_TEAMS": "Odabrani Timovi", + "PAGE": "Stranica", + "ROWSPERPAGE": "Redova po stranici", + "OF": "od", + "CONTACT": "Kontakt", + "STARTEDAT": "Počelo U", + "LASTMESSAGE": "Zadnja poruka", "STATUS": "Status", - "CLOSED": "Closed", - "OPENED": "Open", - "OPEN": "Open", - "ACCOUNT": "Account", - "INTERACTION": "Interaction", - "INTERACTIONS": "Interactions", + "CLOSED": "Zatvoreno", + "OPENED": "Otvoreno", + "OPEN": "Otvori", + "ACCOUNT": "Nalog", + "INTERACTION": "Interakcija", + "INTERACTIONS": "Interakcije", "WEBSITE": "Website", - "ALL": "All", - "SELECT_STATUS": "Select a status", + "ALL": "Svi", + "SELECT_STATUS": "Odaberi status", "FILTER": "Filter", - "FILTERS": "Filters", - "TEAMADD_CHATQUEUE": "Add Team to Chat Queue", - "AGENTADD_CHATQUEUE": "Add Agent to Chat Queue", - "ALL_AGENTS": "All Agents", - "SELECTED_AGENTS": "Selected Agents", - "CLOSEDAT": "Closed At", - "DISPOSITION": "Disposition", - "CREATEDAT": "Created At", - "NOTES": "Notes", - "NO_INTERACTION_AVAILABLE": "No interactions available", - "SELECTED_WEBSITE": "Select a website", + "FILTERS": "Filteri", + "TEAMADD_CHATQUEUE": "Dodaj Tim u Chat Queue", + "AGENTADD_CHATQUEUE": "Dodaj Specijalistu u Chat Queue", + "ALL_AGENTS": "Svi Specijalisti", + "SELECTED_AGENTS": "Odabrani Specijalisti", + "CLOSEDAT": "Zatvoreno U", + "DISPOSITION": "Dispozicija", + "CREATEDAT": "Kreirano U", + "NOTES": "Bilješke", + "NO_INTERACTION_AVAILABLE": "Nema dostupnih Interakcija", + "SELECTED_WEBSITE": "Odaberi Website", "GOTOP": "Gotop", - "EDIT_GOTOP": "Edit Gotop", - "SELECT_WEBSITE": "Select a website", + "EDIT_GOTOP": "Uredi Gotop", + "SELECT_WEBSITE": "Odaberi website", "INFO": "Info", - "OFFLINEMESSAGES_CHATWEBSITE": "Go to Offline Messages", - "WAITINGTITLE": "Waiting Title", - "WAITINGMESSAGE": "Waiting Message", - "RATING": "Rating", - "NO_RATINGVALUE": "No Rating", - "DEFAULT_PAUSE": "Default pause", - "UNKNOWN": "Unknown", - "UNREGISTERED": "Unregistered", - "UNAVAILABLE": "Unavailable", - "NOT_INUSE": "Not in use", - "REACHABLE": "Reachable", - "IN_USE": "In use", + "OFFLINEMESSAGES_CHATWEBSITE": "Idi na Offline Poruke", + "WAITINGTITLE": "Naslov Čekanja", + "WAITINGMESSAGE": "Poruka Čekanja", + "RATING": "Ocjena", + "NO_RATINGVALUE": "Bez ocjene", + "DEFAULT_PAUSE": "Zadana Pauza", + "UNKNOWN": "Nepoznato", + "UNREGISTERED": "Neregistrovan", + "UNAVAILABLE": "Nedostupno", + "NOT_INUSE": "Nije u upotrebi", + "REACHABLE": "Dostupno", + "IN_USE": "U upotrebi", "VOICE": "Voice", - "INTERACTIONS_CHATWEBSITE": "Go to Interactions", - "REFRESH_INTERACTIONS": "Refresh Interactions", - "DELETE_INTERACTION": "Delete Interaction", - "AGENTADD_CHATWEBSITE": "Add Agent to Chat Website", - "TEAMS_ASSOCIATION": "Teams Association", - "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", - "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available", - "DOWNLOAD_WITH_ATTACHMENTS": "Download with attachments", - "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download without attachments", - "LABELTEXT": "Label text" + "INTERACTIONS_CHATWEBSITE": "Idi na Interakcije", + "REFRESH_INTERACTIONS": "Osvježi Interakciju", + "DELETE_INTERACTION": "Izbriši Interakciju", + "AGENTADD_CHATWEBSITE": "Dodaj Specijalistu u Chat Website", + "TEAMS_ASSOCIATION": "Asocijacija Timova", + "TOOLTIP_SCREENRECORDING_ON": "Snimanje Ekrana u procesu", + "TOOLTIP_SCREENRECORDING_OFF": "Snimanje Ekrana dostupno", + "DOWNLOAD_WITH_ATTACHMENTS": "Preuzmi sa prilogom", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Preuzmi bez priloga", + "LABELTEXT": "Tekst oznake" } } diff --git a/public/app/main/apps/chat/i18n/cs.json b/public/app/main/apps/chat/i18n/cs.json index 6df2c80..6140e22 100644 --- a/public/app/main/apps/chat/i18n/cs.json +++ b/public/app/main/apps/chat/i18n/cs.json @@ -1,196 +1,196 @@ { "CHAT": { - "EDIT_AMAZONLEX": "Edit Amazon Lex", + "EDIT_AMAZONLEX": "Upravit Amazon Lex", "AMAZONLEX": "Amazon Lex", - "ACCESSKEYID": "Access Key ID", - "SECRETACCESSKEY": "Secret Access Key", + "ACCESSKEYID": "Přístupový klíč ID", + "SECRETACCESSKEY": "Tajný přístupový klíč", "LEXREGION": "Region", - "BOTNAME": "Bot Name", - "LOGIN_TIME": "Login time", - "PAUSE_TIME": "Pause time", - "DOWNLOAD_INTERACTION": "Download", - "ENABLECUSTOMERCHECKMARKS": "Enable customer delivered/read notifications", - "TRANSFER": "Transfer", - "QUEUETRANSFER": "Queue Transfer", - "QUEUETRANSFERTIMEOUT": "Queue Transfer Timeout", - "AGENTTRANSFER": "Agent Transfer", - "AGENTTRANSFERTIMEOUT": "Agent Transfer Timeout", - "SYSTEMAVATAR": "System Avatar", - "SYSTEMALIAS": "System Alias", - "WELCOMEMESSAGE": "Welcome Message", - "LANGUAGE": "Language", - "EDIT_DIALOGFLOW": "Edit Dialogflow", + "BOTNAME": "Jméno Bota", + "LOGIN_TIME": "Doba přihlášení", + "PAUSE_TIME": "Čas v pauze", + "DOWNLOAD_INTERACTION": "Stáhnout", + "ENABLECUSTOMERCHECKMARKS": "Povolit klientovy doručeno/přečteno notifikace", + "TRANSFER": "Přepojit", + "QUEUETRANSFER": "Přepojení Fronty", + "QUEUETRANSFERTIMEOUT": "Časový limit přepojení fronty", + "AGENTTRANSFER": "Přepojit Agenta", + "AGENTTRANSFERTIMEOUT": "časový limit přepojení Agenta", + "SYSTEMAVATAR": "Avatar Systému", + "SYSTEMALIAS": "Alias Systému", + "WELCOMEMESSAGE": "Uvítací zpráva", + "LANGUAGE": "Jazyk", + "EDIT_DIALOGFLOW": "Upravit Dialogflow", "DIALOGFLOW": "Dialogflow", - "BACKGROUNDCOLOR": "Background Color", - "MESSAGEFONTSIZE": "Message Font Size", - "TAG": "Tag", - "EDIT_TAG": "Edit Tag", - "CUSTOMERALIAS": "Customer Alias", - "SNIPPETSWIPEOUT": "Snippet swipe out", - "CUSTOMERAVATAR": "Customer Avatar", - "SHOWCUSTOMERAVATAR": "Show customer avatar", - "DEFAULTTITLE": "Default Title", - "MESSAGESALIGNMENT": "Messages Alignment", + "BACKGROUNDCOLOR": "Barva pozadí", + "MESSAGEFONTSIZE": "Velikost fontu zprávy", + "TAG": "Značka", + "EDIT_TAG": "Upravit Značku", + "CUSTOMERALIAS": "Zákaznický Alias", + "SNIPPETSWIPEOUT": "Snippet mizení", + "CUSTOMERAVATAR": "Zákaznický Avatar", + "SHOWCUSTOMERAVATAR": "Zobrazit avatara klienta", + "DEFAULTTITLE": "Výchozí titulek", + "MESSAGESALIGNMENT": "Zarovnání zprávy", "ALTERNATE": "Alternate", - "CENTERED": "Centered", - "POSITION": "Position", - "VERTICALPOSITION": "Vertical position", - "ALIGNMENT": "Alignment", - "VERTICALALIGNMENT": "Vertical alignment", - "BOTTOM_RIGHT": "Bottom right", - "RIGHT": "Right", - "LEFT": "Left", - "WAITFORTHEASSIGNEDAGENT": "Wait for the assigned agent", - "AGENTIDENTIFIER": "Identifier", - "WEBSITEALIAS": "Website Alias", + "CENTERED": "Vystředěno", + "POSITION": "Pozice", + "VERTICALPOSITION": "Vertikální poloha", + "ALIGNMENT": "Zarovnání", + "VERTICALALIGNMENT": "Vertikální zarovnání", + "BOTTOM_RIGHT": "Vpravo dole", + "RIGHT": "Vpravo", + "LEFT": "Opuštěno", + "WAITFORTHEASSIGNEDAGENT": "Vyčkejte na přiřazeného agenta", + "AGENTIDENTIFIER": "Identifikátor", + "WEBSITEALIAS": "Alias Webstránky", "AGENTALIAS": "Agent Alias", - "AGENTFULLNAME": "Agent Fullname", - "INSERT_MESSAGE_HERE": "Insert your text message here", - "HIDEWHENOFFLINE": "Hide", - "NOTIFICATION": "Notification", - "NOTIFICATIONSOUND": "Sound", - "NOTIFICATIONSHAKE": "Shake", - "NOTIFICATIONTEMPLATE": "Template", - "SYSTEM": "System", - "EDIT_SYSTEM": "Edit System", - "COMMAND": "Command", - "TEXTCOLOR": "Text Color", - "FONTSIZE": "Font Size", - "WEBSCRIPT": "Web Script", - "CANNEDANSWERS": "Canned Answers", - "CHATCANNEDANSWERS": "Canned Answers", - "NO_CHATCANNEDANSWER_AVAILABLE": "No Canned Answers Available", - "NEW_CHATCANNEDANSWER": "New Canned Answer", - "ADD_CHATCANNEDANSWER": "Add Canned Answer", - "EDIT_CHATCANNEDANSWER": "Edit", - "DELETE_CHATCANNEDANSWER": "Delete", - "OFFLINEMESSAGESUBJECT": "Message subject", - "OFFLINEMESSAGEBODY": "Message body", + "AGENTFULLNAME": "Agent celé jméno", + "INSERT_MESSAGE_HERE": "Vložte zde svoji zprávu", + "HIDEWHENOFFLINE": "Schovat", + "NOTIFICATION": "Upozornění", + "NOTIFICATIONSOUND": "Zvuk", + "NOTIFICATIONSHAKE": "Zatřesení", + "NOTIFICATIONTEMPLATE": "Šablona", + "SYSTEM": "Systém", + "EDIT_SYSTEM": "Upravit Systém", + "COMMAND": "Příkaz", + "TEXTCOLOR": "Barva Textu", + "FONTSIZE": "Velikost Fontu", + "WEBSCRIPT": "Web Skript", + "CANNEDANSWERS": "Definované odpovědi", + "CHATCANNEDANSWERS": "Definované odpovědi", + "NO_CHATCANNEDANSWER_AVAILABLE": "Žádné definované odpovědi", + "NEW_CHATCANNEDANSWER": "Nová definovaná odpověď", + "ADD_CHATCANNEDANSWER": "Přidat definovanou odpověď", + "EDIT_CHATCANNEDANSWER": "Upravit", + "DELETE_CHATCANNEDANSWER": "Smazat", + "OFFLINEMESSAGESUBJECT": "Předmět zprávy", + "OFFLINEMESSAGEBODY": "Tělo zprávy", "FORMSUBMITSUCCESSMESSAGE": "Form submit success message", "FORMSUBMITFAILUREMESSAGE": "Form submit failure message", - "PLACEHOLDERMESSAGE": "Message placeholder", - "NOTETITLE": "Note's title", - "CLOSINGQUESTION": "Closing question", - "TAGS": "Tags", - "SHOWAGENTAVATAR": "Show personal agent avatar", + "PLACEHOLDERMESSAGE": "Místo pro text zprávy", + "NOTETITLE": "Název poznámky", + "CLOSINGQUESTION": "Otázka při uzavření", + "TAGS": "Značky", + "SHOWAGENTAVATAR": "Zobrazit osobního avatara agenta", "AGENTAVATAR": "Agent Avatar", - "SPYINTERACTION": "Spy", - "NO_AGENT_ONLINE": "No Agent Online", - "GOTOREALTIME_CHATQUEUE": "Go To Realtime Chat Queue", - "PARTIALPAUSE": "Partial Pause", - "BUSY": "Busy", - "TIMER": "Timer", - "IDLE": "Idle", - "CAPACITY": "Capacity", - "AGENTSADD_QUEUE": "Add Agent to Chat Queue", - "QUEUES": "Queues", - "LOGGED_IN": "Logged in", - "PAUSED": "Paused", - "READY": "Ready", - "WAITING": "Waiting", - "WRITING": "Writing", + "SPYINTERACTION": "Náhled", + "NO_AGENT_ONLINE": "Žádný Agent nepřihlášen", + "GOTOREALTIME_CHATQUEUE": "Jít na Realtime Frontu Chatu", + "PARTIALPAUSE": "Částečná pauza", + "BUSY": "Obsazeno", + "TIMER": "Časovač", + "IDLE": "V klidu", + "CAPACITY": "Kapacita", + "AGENTSADD_QUEUE": "Přidat agenta do fronty chatu", + "QUEUES": "Fronty", + "LOGGED_IN": "Přihlášen", + "PAUSED": "Pauza", + "READY": "Připraven", + "WAITING": "Čekání", + "WRITING": "Zapisuji", "CHAT": "Chat", "MAIL": "Email", "SMS": "SMS", "OPENCHANNEL": "Openchannel", "FAX": "Fax", - "PAUSE": "Pause", + "PAUSE": "Pauza", "REALTIME": "Realtime", - "AGENTS": "Agents", - "FULLNAME": "Full Name", - "INTERNAL": "Internal", - "PHONE_STATE": "Phone State", - "PHONE_STATUS": "Phone Status", - "LOGOUT": "Logout", - "UNPAUSE": "End Pause", - "AGENTADD_QUEUE": "Add Agent to Chat Queue", + "AGENTS": "Agenti", + "FULLNAME": "Celé Jméno", + "INTERNAL": "Interní", + "PHONE_STATE": "Stav telefonu", + "PHONE_STATUS": "Status telefonu", + "LOGOUT": "Odhlásit", + "UNPAUSE": "Ukončit Pauzu", + "AGENTADD_QUEUE": "Přidat agenta do fronty chatu", "TEXT": "Text", - "TIMES": "Number of times per interaction", - "EDIT_AUTOREPLY": "Edit Auto Reply", - "AUTOREPLY": "Auto Reply", - "NEW_CHATDISPOSITION": "New Chat Disposition", - "ENABLECUSTOMERATTACHMENT": "Enable Customer Attachments", - "OFFLINE_CHAT_BUTTON": "'Offline Chat' Button", + "TIMES": "Počet na interakci", + "EDIT_AUTOREPLY": "Upravit Automatickou Odpověď", + "AUTOREPLY": "Automaticky odpovědět", + "NEW_CHATDISPOSITION": "Nová dispozice chatu", + "ENABLECUSTOMERATTACHMENT": "Povolit klientovy přílohy", + "OFFLINE_CHAT_BUTTON": "'Offline Chat' Tlačítko", "OFFLINESTATUS": "Offline Status", - "NAME": "Name", - "CHATQUEUES": "Chat Queues", - "SEARCH_FOR_ANYONE": "Search", - "STRATEGY": "Strategy", - "AGENT_TIMEOUT": "Agent Timeout", - "DESCRIPTION": "Description", - "KEY": "Key", + "NAME": "Jméno", + "CHATQUEUES": "Chat Fronty", + "SEARCH_FOR_ANYONE": "Vyhledat", + "STRATEGY": "Strategie", + "AGENT_TIMEOUT": "Časový limit Agenta", + "DESCRIPTION": "Popis", + "KEY": "Klíč", "ALIAS": "Alias", - "VARIABLE": "Variable", + "VARIABLE": "Proměnná", "INTERVAL": "Interval", - "EDIT_CLOSE": "Edit Close", - "TIMEZONE": "Timezone", - "MESSAGE": "Message", - "ADVANCED": "Advanced", + "EDIT_CLOSE": "Upravit Uzavřít", + "TIMEZONE": "Časová zóna", + "MESSAGE": "Zpráva", + "ADVANCED": "Rozšířené", "FORWARDTRANSCRIPT": "Forward Transcript", "FORWARDTRANSCRIPTMESSAGE": "Forward Transcript Message", - "SKIPMESSAGEBUTTON": "Skip Message Button", - "EDIT_MESSAGE": "Edit Message", - "CONDITION_AGREEMENT": "Condition Agreement", - "NONE": "None", - "PRIORITY": "Priority", + "SKIPMESSAGEBUTTON": "Zpráva tlačítka Přeskočit", + "EDIT_MESSAGE": "Upravit Zprávu", + "CONDITION_AGREEMENT": "Odsouhlasení Podmínek", + "NONE": "Žádné", + "PRIORITY": "Priorita", "ONLINESTATUS": "Online Status", - "UNMANAGEDSTATUS": "Unmanaged Status", - "AUTOCLOSE": "Enable Autoclose", - "ENABLEUNMANAGEDNOTE": "Enable Unmanaged Message", - "UNMANAGEDMESSAGE": "Message", - "SKIPUNMANAGED": "Skip Message", - "SENDUNMANAGED": "Send Message", - "WEBSITESCRIPT": "Website Script", - "DELETE_OFFLINEMESSAGE": "Delete", - "OFFLINEMESSAGES": "Offline Messages", + "UNMANAGEDSTATUS": "Nezpracovaný Status", + "AUTOCLOSE": "Pomolit automatické uzavření", + "ENABLEUNMANAGEDNOTE": "Povolit Nezpracované Zprávy", + "UNMANAGEDMESSAGE": "Zpráva", + "SKIPUNMANAGED": "Zpráva Přeskočit", + "SENDUNMANAGED": "Odeslat zprávu", + "WEBSITESCRIPT": "Skript Webstránky", + "DELETE_OFFLINEMESSAGE": "Smazat", + "OFFLINEMESSAGES": "Offline zpráva", "FORWARD_OFFLINE": "Forward Offline", - "SHOW_OFFLINEMESSAGE": "Show", + "SHOW_OFFLINEMESSAGE": "Zobrazit", "FORWARD_OFFLINE_ADDRESS": "Forward Offline Address", - "CLOSINGFORM": "Closing Form", - "ENABLERATING": "Enable Rating", - "ENABLECUSTOMERWRITING": "Allow customer writing before agent accepting", - "ENABLEFEEDBACK": "Enable Feedback", - "RATINGTYPE": "Rating Type", - "CLOSINGMESSAGE": "Closing Message", - "CLOSINGMESSAGEBUTTON": "Closing Message Button", - "RATINGSTARSNUMBER": "Rating Stars Number", - "EDIT_GOTOIF": "Edit GotoIf", - "CONDITION": "Condition", + "CLOSINGFORM": "Formulář uzavření", + "ENABLERATING": "Povlit hodnocení", + "ENABLECUSTOMERWRITING": "Povolit klientovy napsat před přijmutím agentem", + "ENABLEFEEDBACK": "Povolit zpětnou vazbu", + "RATINGTYPE": "Typ hodnocení", + "CLOSINGMESSAGE": "Zpráva uzavření", + "CLOSINGMESSAGEBUTTON": "Tlačítko uzavření zprávy", + "RATINGSTARSNUMBER": "Číslo hodnocení hvězdičkami", + "EDIT_GOTOIF": "Upravit GotoIf", + "CONDITION": "Podmínka", "TRUEPRIORITY": "True Priority", - "FALSEPRIORITY": "False Priority", - "VALUE": "Value", + "FALSEPRIORITY": "Neplatná priorita", + "VALUE": "Hodnota", "ERRORS": { - "BOTNAME_REQUIRED": "Mandatory Field", - "SECRETACCESSKEY_REQUIRED": "Mandatory Field", - "ACCESSKEYID_REQUIRED": "Mandatory Field", + "BOTNAME_REQUIRED": "Povinné pole", + "SECRETACCESSKEY_REQUIRED": "Povinné pole", + "ACCESSKEYID_REQUIRED": "Povinné pole", "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "QUEUETRANSFERTIMEOUT_REQUIRED": "Mandatory Field", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Povinné pole", "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "AGENTTRANSFERTIMEOUT_REQUIRED": "Mandatory Field", - "CUSTOMERALIAS_REQUIRED": "Mandatory Field", - "AGENTALIAS_REQUIRED": "Mandatory Field", - "SYSTEMALIAS_REQUIRED": "Mandatory Field", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Povinné pole", + "CUSTOMERALIAS_REQUIRED": "Povinné pole", + "AGENTALIAS_REQUIRED": "Povinné pole", + "SYSTEMALIAS_REQUIRED": "Povinné pole", "MESSAGEFONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", "MESSAGEFONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "MESSAGEFONTSIZE_REQUIRED": "Mandatory Field", - "TAG_REQUIRED": "Mandatory Field", - "VERTICALPOSITION_REQUIRED": "Mandatory Field", + "MESSAGEFONTSIZE_REQUIRED": "Povinné pole", + "TAG_REQUIRED": "Povinné pole", + "VERTICALPOSITION_REQUIRED": "Povinné pole", "VERTICALPOSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", "VERTICALPOSITION_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Mandatory Field", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Povinné pole", "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "NAME_MUST_VALID_PATTERN": "Wrong format", - "COMMAND_REQUIRED": "Mandatory Field", + "NAME_MUST_VALID_PATTERN": "Neplatný formát", + "COMMAND_REQUIRED": "Povinné pole", "FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "FONTSIZE_REQUIRED": "Mandatory Field", + "FONTSIZE_REQUIRED": "Povinné pole", "TEXT_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "VALUE_REQUIRED": "Mandatory Field", + "VALUE_REQUIRED": "Povinné pole", "CUSTOMERALIAS_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", "SYSTEMALIAS_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", "OFFLINEMESSAGESUBJECT_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", @@ -202,41 +202,41 @@ "CLOSINGQUESTION_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", "HEADER_OFFLINE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", "OFFLINE_CHAT_BUTTON_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "TEXT_REQUIRED": "Mandatory Field", - "SENDUNMANAGED_REQUIRED": "Mandatory Field", + "TEXT_REQUIRED": "Povinné pole", + "SENDUNMANAGED_REQUIRED": "Povinné pole", "SENDUNMANAGED_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", "SKIPUNMANAGED_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", "UNMANAGEDMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", "WEBSITEALIAS_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "AGENT_REQUIRED": "Mandatory Field", - "QUEUE_REQUIRED": "Mandatory Field", - "CONDITION_REQUIRED": "Mandatory Field", - "PRIORITY_REQUIRED": "Mandatory Field", - "TRUEPRIORITY_REQUIRED": "Mandatory Field", - "FALSEPRIORITY_REQUIRED": "Mandatory Field", - "NAME_REQUIRED": "Mandatory Field", - "LIST_REQUIRED": "Mandatory Field", - "AGENT_TIMEOUT_REQUIRED": "Mandatory Field", - "MOTIONADDRESS_REQUIRED": "Mandatory Field", - "DISPOSITION_REQUIRED": "Mandatory Field", - "MOTIONADDRESS_MUST_VALID_URL": "Wrong format", - "EMAIL_MUST_BE_VALID": "Wrong format", - "ADDRESS_REQUIRED": "Mandatory Field", - "ADDRESS_MUST_VALID_URL": "Wrong format", - "ENQUIRY_FORWARDING_ADDRESS_REQUIRED": "Mandatory Field", - "ACCEPTURL_MUST_VALID_URL": "Wrong format", - "TIMEOUT_REQUIRED": "Mandatory Field", - "REJECTURL_MUST_VALID_URL": "Wrong format", - "CLOSEURL_MUST_VALID_URL": "Wrong format", + "AGENT_REQUIRED": "Povinné pole", + "QUEUE_REQUIRED": "Povinné pole", + "CONDITION_REQUIRED": "Povinné pole", + "PRIORITY_REQUIRED": "Povinné pole", + "TRUEPRIORITY_REQUIRED": "Povinné pole", + "FALSEPRIORITY_REQUIRED": "Povinné pole", + "NAME_REQUIRED": "Povinné pole", + "LIST_REQUIRED": "Povinné pole", + "AGENT_TIMEOUT_REQUIRED": "Povinné pole", + "MOTIONADDRESS_REQUIRED": "Povinné pole", + "DISPOSITION_REQUIRED": "Povinné pole", + "MOTIONADDRESS_MUST_VALID_URL": "Neplatný formát", + "EMAIL_MUST_BE_VALID": "Neplatný formát", + "ADDRESS_REQUIRED": "Povinné pole", + "ADDRESS_MUST_VALID_URL": "Neplatný formát", + "ENQUIRY_FORWARDING_ADDRESS_REQUIRED": "Povinné pole", + "ACCEPTURL_MUST_VALID_URL": "Neplatný formát", + "TIMEOUT_REQUIRED": "Povinné pole", + "REJECTURL_MUST_VALID_URL": "Neplatný formát", + "CLOSEURL_MUST_VALID_URL": "Neplatný formát", "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", "POLLING_INTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", - "WAITINGMESSAGE_REQUIRED": "Mandatory Field", - "WAITINGTITLE_REQUIRED": "Mandatory Field", + "WAITINGMESSAGE_REQUIRED": "Povinné pole", + "WAITINGTITLE_REQUIRED": "Povinné pole", "KEY_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "KEY_REQUIRED": "Mandatory Field", + "KEY_REQUIRED": "Povinné pole", "WAITINGMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", "WAITINGTITLE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", "RATINGSTARSNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", @@ -248,103 +248,103 @@ "VIDAOOTOPIC_REQUIRED": "Povinné pole", "EMAIL_ACCOUNT_REQUIRED": "Povinné pole" }, - "CM_FIELD": "Contact Manager Field", - "CHATPROACTIVEACTIONS": "Proactive Actions", - "NEW_CHATPROACTIVEACTION": "New Proactive Action", - "EDIT_CHATPROACTIVEACTION": "Edit Proactive Action", - "DELETE_CHATPROACTIVEACTION": "Delete Proactive Action", - "ADD_CHATPROACTIVEACTION": "Add Proactive Action", - "NO_CHATPROACTIVEACTION_AVAILABLE": "No Proactive Actions Available", - "NO_OFFLINEMESSAGE_AVAILABLE": "No Offline Messages Available", - "MOUSEOVER": "Mouse Over", - "TIMEOUT": "Timeout", - "TYPE": "Type", - "SELECTOR": "Selector", + "CM_FIELD": "Pole kontaktního managera", + "CHATPROACTIVEACTIONS": "Proaktivní Akce", + "NEW_CHATPROACTIVEACTION": "Nová proaktivní akce", + "EDIT_CHATPROACTIVEACTION": "Upravit Proaktivní Akci", + "DELETE_CHATPROACTIVEACTION": "Smazat proaktivní akci", + "ADD_CHATPROACTIVEACTION": "Přidat Proaktivní Akci", + "NO_CHATPROACTIVEACTION_AVAILABLE": "Žádné proaktivní akce", + "NO_OFFLINEMESSAGE_AVAILABLE": "Žádné Offline zprávy", + "MOUSEOVER": "Myš přes", + "TIMEOUT": "Časový limit", + "TYPE": "Typ", + "SELECTOR": "Výběr", "AGENT": "Agent", "GOTO": "Goto", "GOTOIF": "GotoIf", "NOOP": "Noop", - "QUEUE": "Queue", + "QUEUE": "Fronta", "BUILDER": "Builder", - "PREVIEW": "Preview", - "EDIT_AGENT": "Edit Agent", - "EDIT_QUEUE": "Edit Queue", - "EDIT_GOTO": "Edit Goto", - "EDIT_GOTOIf": "Edit GotoIf", - "EDIT_NOOP": "Edit Noop", - "ADD_CHATQUEUE": "Add Chat Queue", - "EDIT_CHATQUEUE": "Edit Chat Queue", - "DELETE_CHATQUEUE": "Delete Chat Queue", - "SETTINGS": "Settings", - "SAVE": "Save", - "SCRIPT": "Script", + "PREVIEW": "Náhled", + "EDIT_AGENT": "Upravit Agenta", + "EDIT_QUEUE": "Upravit Frontu", + "EDIT_GOTO": "Upravit Goto", + "EDIT_GOTOIf": "Upravit GotoIf", + "EDIT_NOOP": "Upravit Noop", + "ADD_CHATQUEUE": "Přidat Frontu Chatu", + "EDIT_CHATQUEUE": "Upravit Frontu Chatu", + "DELETE_CHATQUEUE": "Smazat frontu chatu", + "SETTINGS": "Nastavení", + "SAVE": "Uložit", + "SCRIPT": "Skript", "TOKEN": "Token", - "CREATED_AT": "Created At", - "CHATWEBSITES": "Chat Websites", - "MOTIONADDRESS": "Website Domain", - "MOTIONPROXY": "Proxy Or Motion Domain", - "ADD_CHATWEBSITE": "Add Chat Website", - "EDIT_CHATWEBSITE": "Edit Chat Website", - "DELETE_CHATWEBSITE": "Delete Chat Website", - "LIST": "List", + "CREATED_AT": "Vytvořeno", + "CHATWEBSITES": "Chat Webstránky", + "MOTIONADDRESS": "Doména webstránky", + "MOTIONPROXY": "Proxy nebo Motion doména", + "ADD_CHATWEBSITE": "Přidat Webstránku Chatu", + "EDIT_CHATWEBSITE": "Upravit Webstránku Chatu", + "DELETE_CHATWEBSITE": "Smazat webstránku chatu", + "LIST": "Seznam", "SNIPPET": "Snippet", - "FORMS": "Forms", - "UP": "Up", - "DOWN": "Down", - "COLLAPSE": "Collapse", - "PROACTIVEACTIONS": "Proactive Actions", - "DISPOSITIONS": "Dispositions", + "FORMS": "Formuláře", + "UP": "Nahoru", + "DOWN": "Dolů", + "COLLAPSE": "Zabalit", + "PROACTIVEACTIONS": "Proaktivní akce", + "DISPOSITIONS": "Dispozice", "WEBHOOKS": "WebHooks", - "ACTIONS": "Actions", + "ACTIONS": "Akce", "FIDELITY": "Fidelity", - "APPEARANCE": "Appearance", - "MAINCOLOR": "Main Color", - "FOCUSCOLOR": "Focus Color", - "BUTTONCOLOR": "Button Color", - "HEADERSHAPE": "Header Shape", - "ANIMATION": "Animation", - "DEFAULT": "Default", + "APPEARANCE": "Vzhled", + "MAINCOLOR": "Hlavní Barva", + "FOCUSCOLOR": "Focus Barva", + "BUTTONCOLOR": "Barva tlačítka", + "HEADERSHAPE": "Tvar Záhlaví", + "ANIMATION": "Animace", + "DEFAULT": "Výchozí", "WHITELABEL": "White Label", "LOGO": "Logo", - "DOWNLOADTRANSCRIPT": "Download Transcript", - "ENQUIRY_ENABLE": "Enquiry Enable", - "ENQUIRY_FORWARDING": "Enquiry Forwarding", - "ENQUIRY_FORWARDING_ADDRESS": "Enquiry Forwarding Address", - "LABELS": "Labels", - "HEADER_ONLINE": "Online Header", - "ONLINE_MESSAGE": "Online Message", - "NAME_TITLE": "Name Input Label", - "USERNAME_PLACEHOLDER": "Username Input Placeholder", - "EMAIL_TITLE": "Email Input Label", - "EMAIL_PLACEHOLDER": "Email Input Placeholder", - "START_CHAT_BUTTON": "'Start Chat' Button", - "AGENTS_BUSY": "Busy Agents Message", - "HEADER_OFFLINE": "Offline Header", - "OFFLINE_MESSAGE": "Offline Message", - "MESSAGE_TITLE": "Message Label", - "ENQUIRY_MESSAGE_PLACEHOLDER": "Enquiry Message Input Placeholder", - "ENQUIRY_BUTTON": "Enquiry Button Text", - "RATING_MESSAGE": "Rating Message", - "RATING_SEND": "Rating Send Button Text", - "RATING_SKIP": "Rating Skip Button Text", + "DOWNLOADTRANSCRIPT": "Stáhnout přepis", + "ENQUIRY_ENABLE": "Povolit Dotaz", + "ENQUIRY_FORWARDING": "Přeposlání Dotazu", + "ENQUIRY_FORWARDING_ADDRESS": "Adresa přeposlání dotazu", + "LABELS": "Štítky", + "HEADER_ONLINE": "Online Záhlaví", + "ONLINE_MESSAGE": "Online Zpráva", + "NAME_TITLE": "Štítek Vstupu Jména", + "USERNAME_PLACEHOLDER": "Vstup Jméno užiavtele místo pro text", + "EMAIL_TITLE": "Email Vstup Štítky", + "EMAIL_PLACEHOLDER": "Email Vstup místo pro text", + "START_CHAT_BUTTON": "Tlačítko 'Zahájit Chat'", + "AGENTS_BUSY": "Zpráva při obsazení agentů", + "HEADER_OFFLINE": "Offline Záhlaví", + "OFFLINE_MESSAGE": "Offline zpráva", + "MESSAGE_TITLE": "Štítek zprávy", + "ENQUIRY_MESSAGE_PLACEHOLDER": "Zpráva Dotazu vstupní místo pro text", + "ENQUIRY_BUTTON": "Text Tlačítka Dotaz", + "RATING_MESSAGE": "Zpráva hodnocení", + "RATING_SEND": "Text tlačítka Odeslat hodnocení", + "RATING_SKIP": "Text tlačítka Přeskočit hodnocení", "ONLINE": "Online", "OFFLINE": "Offline", - "PROACTIVE": "Proactive", - "ACCEPT": "Accept", - "ACCEPTMETHOD": "Accept Method", - "ACCEPTURL": "Accept URL", - "REJECT": "Reject", - "REJECTMETHOD": "Reject Method", - "REJECTURL": "Reject URL", - "CLOSE": "Close", - "CLOSEMETHOD": "Close Method", - "CLOSEURL": "Close URL", - "EMBEDDING": "Embedding", - "GENERAL": "General", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "BACK": "Back", + "PROACTIVE": "Proaktivní", + "ACCEPT": "Přijmout", + "ACCEPTMETHOD": "Způsob příjmu", + "ACCEPTURL": "Přijmout URL", + "REJECT": "Odmítnout", + "REJECTMETHOD": "Způsob odmítnutí", + "REJECTURL": "URL Odmítnutí", + "CLOSE": "Uzavřít", + "CLOSEMETHOD": "Způsob uzavření", + "CLOSEURL": "URL Uzavření", + "EMBEDDING": "Vložený", + "GENERAL": "Obecné", + "SELECTED": "Vybráno", + "SELECT_ALL": "Vybrat Vše", + "SELECT_NONE": "Zrušit výběr", + "BACK": "Zpět", "HELP": { "VERTICALPOSITION": "Represents the distance in percentage from top", "AGENTIDENTIFIER": "Represents the agent identifier within the chat session in the snippet", @@ -373,74 +373,74 @@ "MANDATORYDISPOSITION": "Povinná dispozice", "MANDATORYDISPOSITIONPAUSEID": "Pokud je povolena povinná dispozice, pozastavte jej" }, - "ADDRESS": "Address", - "ONLINESTATE": "Online Status", - "OFFLINESTATE": "Offline Status", - "RATINGSTATE": "Rating State", - "ENQUIRY": "Enquiry", - "OFFLINETEMPLATE": "Offline Template", - "CHATDISPOSITIONS": "Chat Dispositions", - "NO_CHATDISPOSITION_AVAILABLE": "No Chat Dispositions available", - "ADD_CHATDISPOSITION": "Add Chat Disposition", - "DELETE": "Delete", - "EDIT_CHATDISPOSITION": "Edit Chat Disposition", - "DELETE_CHATDISPOSITION": "Delete Chat Disposition", + "ADDRESS": "Adresa", + "ONLINESTATE": "Online Stav", + "OFFLINESTATE": "Offline Stav", + "RATINGSTATE": "Stav Hodnocení", + "ENQUIRY": "Dotaz", + "OFFLINETEMPLATE": "Offline Šablona", + "CHATDISPOSITIONS": "Dispozice Chatu", + "NO_CHATDISPOSITION_AVAILABLE": "Žádné dispozice chatu", + "ADD_CHATDISPOSITION": "Přidat Dispozici Chatu", + "DELETE": "Smazat", + "EDIT_CHATDISPOSITION": "Upravit Dispozici Chatu", + "DELETE_CHATDISPOSITION": "Smazat Dispozici Chatu", "ID": "Id", - "NEW_CHATQUEUE": "New Chat Queue", - "NEW_CHATWEBSITE": "New Chat Website", - "ROUNDED": "Rounded", - "SQUARED": "Squared", - "NO_AVAILABLE_INFO": "No available info", - "ALL_TEAMS": "All Teams", - "SELECTED_TEAMS": "Selected Teams", - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", - "CONTACT": "Contact", - "STARTEDAT": "Started At", + "NEW_CHATQUEUE": "Nová fronta Chatu", + "NEW_CHATWEBSITE": "Nová Webstránka Chatu", + "ROUNDED": "Zakulacen", + "SQUARED": "Hranatý", + "NO_AVAILABLE_INFO": "Žádné dustupné info", + "ALL_TEAMS": "Všechny Týmy", + "SELECTED_TEAMS": "Vybrané Týmy", + "PAGE": "Stránka", + "ROWSPERPAGE": "Řádek na stránku", + "OF": "z", + "CONTACT": "Kontakt", + "STARTEDAT": "Spuštěn", "STATUS": "Status", - "CLOSED": "Closed", - "OPENED": "Open", - "OPEN": "Open", - "ACCOUNT": "Account", - "INTERACTION": "Interaction", - "INTERACTIONS": "Interactions", - "WEBSITE": "Website", - "ALL": "All", - "SELECT_STATUS": "Select a status", - "FILTER": "Filter", - "FILTERS": "Filters", - "TEAMADD_CHATQUEUE": "Add Team to Chat Queue", - "AGENTADD_CHATQUEUE": "Add Agent to Chat Queue", - "ALL_AGENTS": "All Agents", - "SELECTED_AGENTS": "Selected Agents", - "CLOSEDAT": "Closed At", - "DISPOSITION": "Disposition", - "CREATEDAT": "Created At", - "NOTES": "Notes", - "NO_INTERACTION_AVAILABLE": "No interactions available", - "SELECTED_WEBSITE": "Select a website", + "CLOSED": "Uzavřeno", + "OPENED": "Otevřeno", + "OPEN": "Otevřít", + "ACCOUNT": "Účet", + "INTERACTION": "Interakce", + "INTERACTIONS": "Interakce", + "WEBSITE": "Webstránka", + "ALL": "Vše", + "SELECT_STATUS": "Vybrat status", + "FILTER": "Filtr", + "FILTERS": "Filtry", + "TEAMADD_CHATQUEUE": "Přidat team do fronty chatu", + "AGENTADD_CHATQUEUE": "Přidat agenta do fronty chatu", + "ALL_AGENTS": "Všichni Agenti", + "SELECTED_AGENTS": "Vybraní Agenti", + "CLOSEDAT": "Uzavřeno", + "DISPOSITION": "Dispozice", + "CREATEDAT": "Vytvořeno", + "NOTES": "Poznámky", + "NO_INTERACTION_AVAILABLE": "Žádné interakce", + "SELECTED_WEBSITE": "Vybrat Webstránku", "GOTOP": "Gotop", - "EDIT_GOTOP": "Edit Gotop", - "SELECT_WEBSITE": "Select a website", + "EDIT_GOTOP": "Upravit Gotop", + "SELECT_WEBSITE": "Vybrat webstránku", "INFO": "Info", - "OFFLINEMESSAGES_CHATWEBSITE": "Go to Offline Messages", - "WAITINGTITLE": "Waiting Title", - "WAITINGMESSAGE": "Waiting Message", - "RATING": "Rating", - "NO_RATINGVALUE": "No Rating", - "DEFAULT_PAUSE": "Default pause", - "UNKNOWN": "Unknown", - "UNREGISTERED": "Unregistered", - "UNAVAILABLE": "Unavailable", - "NOT_INUSE": "Not in use", - "REACHABLE": "Reachable", - "IN_USE": "In use", - "VOICE": "Voice", - "INTERACTIONS_CHATWEBSITE": "Go to Interactions", - "REFRESH_INTERACTIONS": "Refresh Interactions", - "DELETE_INTERACTION": "Delete Interaction", - "AGENTADD_CHATWEBSITE": "Add Agent to Chat Website", + "OFFLINEMESSAGES_CHATWEBSITE": "Přejít na Offline zprávy", + "WAITINGTITLE": "Čekací titulek", + "WAITINGMESSAGE": "Čekací zprává", + "RATING": "Hodnocení", + "NO_RATINGVALUE": "Nehodnoceno", + "DEFAULT_PAUSE": "Výchozí pauza", + "UNKNOWN": "Neznámý", + "UNREGISTERED": "Neregistrován", + "UNAVAILABLE": "Nedostupný", + "NOT_INUSE": "Nepoužíván", + "REACHABLE": "Dostupný", + "IN_USE": "Používán", + "VOICE": "Hlas", + "INTERACTIONS_CHATWEBSITE": "Přejít na Interakce", + "REFRESH_INTERACTIONS": "Aktualizovat interakce", + "DELETE_INTERACTION": "Smazat interakci", + "AGENTADD_CHATWEBSITE": "Přidat agenta k webstránce chatu", "DOWNLOAD_WITHOUT_ATTACHMENTS": "Stahujte bez příloh", "DOWNLOAD_WITH_ATTACHMENTS": "Stáhnout s přílohami", "ENABLESENDBUTTON": "Povolit tlačítko Odeslat", @@ -448,7 +448,7 @@ "LASTMESSAGE": "Poslední zpráva", "MANDATORYDISPOSITION": "Povinná dispozice", "MANDATORYDISPOSITIONPAUSEID": "Pokud je povolena povinná dispozice, pozastavte jej", - "TEAMS_ASSOCIATION": "Asociace týmů", + "TEAMS_ASSOCIATION": "Přiřazení týmů", "TOOLTIP_SCREENRECORDING_OFF": "K dispozici je nahrávání obrazovky", "TOOLTIP_SCREENRECORDING_ON": "Probíhá nahrávání obrazovky", "VIDAOO": "Vidaoo", @@ -456,7 +456,7 @@ "VIDAOOESCALATION": "Zahajte videohovor", "VIDAOOSESSION": "Zahajte videohovor", "VIDEO": "Video", - "CLIENTEMAIL": "E-mail klienta", + "CLIENTEMAIL": "E-mail klient", "DIALOGFLOWV2": "Dialogflow V2", "EDIT_DIALOGFLOWV2": "Upravit Dialogflow V2", "PRIVATEKEY": "Soukromý klíč", @@ -465,17 +465,17 @@ "OPEN_NEW_INTERACTION": "Otevřít novou interakci", "SUBJECT": "Předmět", "ADD_NOTE": "Přidat poznámku", - "CANNED_ANSWER_NOT_FOUND": "Nebyly nalezeny žádné konzervované odpovědi", + "CANNED_ANSWER_NOT_FOUND": "Nebyly nalezeny žádné definované odpovědi", "NOTE": "Poznámka", "VIDAOOMETADATA": "Vidaoo metadata", - "VIDAOONOTE": "Vidaoo Note", + "VIDAOONOTE": "Vidaoo Poznámka", "VIDAOOTOPIC": "Téma Vidaoo", "CHANNELID": "ID kanálu", "EDIT_TVOX": "Upravit TVox", - "MOTIONTITLE": "Název pohybu", - "MOTIONURL": "Pohybová URL", - "MOTIONURLONANSWER": "Pohybovat URL při odpovědi", - "MOTIONURLONRING": "Pohybová URL na prstenu", + "MOTIONTITLE": "Název Motion", + "MOTIONURL": "Motion URL", + "MOTIONURLONANSWER": "Motion URL při odpovědi", + "MOTIONURLONRING": "Motion URL při vyzvánění", "SERVICEID": "ID služby", "SERVICENAME": "Název služby", "TVOX": "TVox", diff --git a/public/app/main/apps/chat/i18n/is.json b/public/app/main/apps/chat/i18n/is.json new file mode 100644 index 0000000..a8f7e5c --- /dev/null +++ b/public/app/main/apps/chat/i18n/is.json @@ -0,0 +1,491 @@ +{ + "CHAT": { + "EDIT_DIALOGFLOWV2": "Edit Dialogflow V2", + "DIALOGFLOWV2": "Dialogflow V2", + "PRIVATEKEY": "Private Key", + "CLIENTEMAIL": "Client Email", + "PROJECTID": "Project ID", + "VIDAOOESCALATION": "Start Video Call", + "VIDAOOAPIKEY": "Vidaoo Api Key", + "VIDAOOSESSION": "Start Video Call", + "VIDAOOTOPIC": "Vidaoo Topic", + "VIDAOONOTE": "Vidaoo Note", + "VIDAOOMETADATA": "Vidaoo Metadata", + "VIDEO": "Video", + "VIDAOO": "Vidaoo", + "EDIT_AMAZONLEX": "Edit Amazon Lex", + "AMAZONLEX": "Amazon Lex", + "ACCESSKEYID": "Access Key ID", + "SECRETACCESSKEY": "Secret Access Key", + "LEXREGION": "Region", + "BOTNAME": "Bot Name", + "LOGIN_TIME": "Login time", + "PAUSE_TIME": "Pause time", + "DOWNLOAD_INTERACTION": "Download", + "ENABLECUSTOMERCHECKMARKS": "Enable customer delivered/read notifications", + "TRANSFER": "Transfer", + "QUEUETRANSFER": "Queue Transfer", + "QUEUETRANSFERTIMEOUT": "Queue Transfer Timeout", + "AGENTTRANSFER": "Agent Transfer", + "AGENTTRANSFERTIMEOUT": "Agent Transfer Timeout", + "SYSTEMAVATAR": "System Avatar", + "SYSTEMALIAS": "System Alias", + "OPEN_NEW_INTERACTION": "Open new interaction", + "EMAIL_ACCOUNT": "Email account", + "SUBJECT": "Subject", + "WELCOMEMESSAGE": "Welcome Message", + "LANGUAGE": "Language", + "EDIT_DIALOGFLOW": "Edit Dialogflow", + "DIALOGFLOW": "Dialogflow", + "BACKGROUNDCOLOR": "Background Color", + "MESSAGEFONTSIZE": "Message Font Size", + "ADD_NOTE": "Add note", + "NOTE": "Note", + "TAG": "Tag", + "EDIT_TAG": "Edit Tag", + "CUSTOMERALIAS": "Customer Alias", + "SNIPPETSWIPEOUT": "Snippet swipe out", + "CUSTOMERAVATAR": "Customer Avatar", + "SHOWCUSTOMERAVATAR": "Show customer avatar", + "CANNED_ANSWER_NOT_FOUND": "No Canned Answers were found", + "DEFAULTTITLE": "Default Title", + "MESSAGESALIGNMENT": "Messages Alignment", + "ALTERNATE": "Alternate", + "CENTERED": "Centered", + "POSITION": "Position", + "VERTICALPOSITION": "Vertical position", + "ALIGNMENT": "Alignment", + "VERTICALALIGNMENT": "Vertical alignment", + "BOTTOM_RIGHT": "Bottom right", + "RIGHT": "Right", + "LEFT": "Left", + "WAITFORTHEASSIGNEDAGENT": "Wait for the assigned agent", + "AGENTIDENTIFIER": "Identifier", + "WEBSITEALIAS": "Website Alias", + "AGENTALIAS": "Agent Alias", + "AGENTFULLNAME": "Agent Fullname", + "INSERT_MESSAGE_HERE": "Insert your text message here", + "HIDEWHENOFFLINE": "Hide", + "NOTIFICATION": "Notification", + "NOTIFICATIONSOUND": "Sound", + "NOTIFICATIONSHAKE": "Shake", + "NOTIFICATIONTEMPLATE": "Template", + "SYSTEM": "System", + "EDIT_SYSTEM": "Edit System", + "COMMAND": "Command", + "TEXTCOLOR": "Text Color", + "TEXT_BUTTON_COLOR": "Text Button Color", + "FONTSIZE": "Font Size", + "WEBSCRIPT": "Web Script", + "CANNEDANSWERS": "Canned Answers", + "CHATCANNEDANSWERS": "Canned Answers", + "NO_CHATCANNEDANSWER_AVAILABLE": "No Canned Answers Available", + "NEW_CHATCANNEDANSWER": "New Canned Answer", + "ADD_CHATCANNEDANSWER": "Add Canned Answer", + "EDIT_CHATCANNEDANSWER": "Edit", + "DELETE_CHATCANNEDANSWER": "Delete", + "OFFLINEMESSAGESUBJECT": "Message subject", + "OFFLINEMESSAGEBODY": "Message body", + "FORMSUBMITSUCCESSMESSAGE": "Form submit success message", + "FORMSUBMITFAILUREMESSAGE": "Form submit failure message", + "PLACEHOLDERMESSAGE": "Message placeholder", + "NOTETITLE": "Note's title", + "CLOSINGQUESTION": "Closing question", + "TAGS": "Tags", + "SHOWAGENTAVATAR": "Show personal agent avatar", + "AGENTAVATAR": "Agent Avatar", + "SPYINTERACTION": "Spy", + "NO_AGENT_ONLINE": "No Agent Online", + "GOTOREALTIME_CHATQUEUE": "Go To Realtime Chat Queue", + "PARTIALPAUSE": "Partial Pause", + "BUSY": "Busy", + "TIMER": "Timer", + "IDLE": "Idle", + "CAPACITY": "Capacity", + "AGENTSADD_QUEUE": "Add Agent to Chat Queue", + "QUEUES": "Queues", + "LOGGED_IN": "Logged in", + "PAUSED": "Paused", + "READY": "Ready", + "WAITING": "Waiting", + "WRITING": "Writing", + "CHAT": "Chat", + "MAIL": "Email", + "SMS": "SMS", + "OPENCHANNEL": "Openchannel", + "FAX": "Fax", + "PAUSE": "Pause", + "REALTIME": "Realtime", + "AGENTS": "Agents", + "FULLNAME": "Full Name", + "INTERNAL": "Internal", + "PHONE_STATE": "Phone State", + "PHONE_STATUS": "Phone Status", + "LOGOUT": "Logout", + "UNPAUSE": "End Pause", + "AGENTADD_QUEUE": "Add Agent to Chat Queue", + "TEXT": "Text", + "TIMES": "Number of times per interaction", + "EDIT_AUTOREPLY": "Edit Auto Reply", + "AUTOREPLY": "Auto Reply", + "NEW_CHATDISPOSITION": "New Chat Disposition", + "ENABLECUSTOMERATTACHMENT": "Enable Customer Attachments", + "ENABLESENDBUTTON": "Enable Send Button", + "OFFLINE_CHAT_BUTTON": "'Offline Chat' Button", + "OFFLINESTATUS": "Offline Status", + "NAME": "Name", + "CHATQUEUES": "Chat Queues", + "SEARCH_FOR_ANYONE": "Search", + "STRATEGY": "Strategy", + "AGENT_TIMEOUT": "Agent Timeout", + "DESCRIPTION": "Description", + "KEY": "Key", + "ALIAS": "Alias", + "VARIABLE": "Variable", + "INTERVAL": "Interval", + "EDIT_CLOSE": "Edit Close", + "TIMEZONE": "Timezone", + "MESSAGE": "Message", + "ADVANCED": "Advanced", + "FORWARDTRANSCRIPT": "Forward Transcript", + "FORWARDTRANSCRIPTMESSAGE": "Forward Transcript Message", + "SKIPMESSAGEBUTTON": "Skip Message Button", + "EDIT_MESSAGE": "Edit Message", + "CONDITION_AGREEMENT": "Condition Agreement", + "NONE": "None", + "PRIORITY": "Priority", + "ONLINESTATUS": "Online Status", + "UNMANAGEDSTATUS": "Unmanaged Status", + "AUTOCLOSE": "Enable Autoclose", + "ENABLEUNMANAGEDNOTE": "Enable Unmanaged Message", + "UNMANAGEDMESSAGE": "Message", + "SKIPUNMANAGED": "Skip Message", + "SENDUNMANAGED": "Send Message", + "WEBSITESCRIPT": "Website Script", + "DELETE_OFFLINEMESSAGE": "Delete", + "OFFLINEMESSAGES": "Offline Messages", + "FORWARD_OFFLINE": "Forward Offline", + "SHOW_OFFLINEMESSAGE": "Show", + "FORWARD_OFFLINE_ADDRESS": "Forward Offline Address", + "CLOSINGFORM": "Closing Form", + "ENABLERATING": "Enable Rating", + "ENABLECUSTOMERWRITING": "Allow customer writing before agent accepting", + "ENABLEFEEDBACK": "Enable Feedback", + "FEEDBACKTITLE": "Feedback Title", + "RATINGTYPE": "Rating Type", + "CLOSINGMESSAGE": "Closing Message", + "CLOSINGMESSAGEBUTTON": "Closing Message Button", + "RATINGSTARSNUMBER": "Rating Stars Number", + "EDIT_GOTOIF": "Edit GotoIf", + "CONDITION": "Condition", + "TRUEPRIORITY": "True Priority", + "FALSEPRIORITY": "False Priority", + "VALUE": "Value", + "MANDATORYDISPOSITION": "Mandatory disposition", + "MANDATORYDISPOSITIONPAUSEID": "Pause to use if mandatory disposition is enabled", + "SERVICEID": "Service ID", + "CHANNELID": "Channel ID", + "EDIT_TVOX": "Edit TVox", + "SERVICENAME": "Service name", + "TVOX": "TVox", + "TVOXURL": "TVox IP URL", + "TVOXIP": "TVox IP Address", + "TVOXUSERNAME": "TVox Username", + "TVOXPASSWD": "TVox Password", + "TVOXLOGINURL": "TVox Login REST Url", + "TVOXSESSIONURL": "TVox Session REST Url", + "MOTIONURLONRING": "Motion URL On Ring", + "MOTIONURLONANSWER": "Motion URL On Answer", + "MOTIONTITLE": "Motion Title", + "MOTIONURL": "Motion URL", + "ERRORS": { + "PROJECTID_REQUIRED": "Mandatory Field", + "CLIENTEMAIL_REQUIRED": "Mandatory Field", + "PRIVATEKEY_REQUIRED": "Mandatory Field", + "VIDAOOAPIKEY_REQUIRED": "Mandatory Field", + "VIDAOOTOPIC_REQUIRED": "Mandatory Field", + "BOTNAME_REQUIRED": "Mandatory Field", + "SECRETACCESSKEY_REQUIRED": "Mandatory Field", + "ACCESSKEYID_REQUIRED": "Mandatory Field", + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Mandatory Field", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Mandatory Field", + "CUSTOMERALIAS_REQUIRED": "Mandatory Field", + "AGENTALIAS_REQUIRED": "Mandatory Field", + "SYSTEMALIAS_REQUIRED": "Mandatory Field", + "MESSAGEFONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "MESSAGEFONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "MESSAGEFONTSIZE_REQUIRED": "Mandatory Field", + "TAG_REQUIRED": "Mandatory Field", + "VERTICALPOSITION_REQUIRED": "Mandatory Field", + "VERTICALPOSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "VERTICALPOSITION_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Mandatory Field", + "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "NAME_MUST_VALID_PATTERN": "Wrong format", + "COMMAND_REQUIRED": "Mandatory Field", + "FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "FONTSIZE_REQUIRED": "Mandatory Field", + "TEXT_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "VALUE_REQUIRED": "Mandatory Field", + "CUSTOMERALIAS_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "SYSTEMALIAS_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "OFFLINEMESSAGESUBJECT_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "OFFLINEMESSAGEBODY_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "PLACEHOLDERMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "NOTETITLE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "FORMSUBMITSUCCESSMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "FORMSUBMITFAILUREMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "CLOSINGQUESTION_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "HEADER_OFFLINE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "OFFLINE_CHAT_BUTTON_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "TEXT_REQUIRED": "Mandatory Field", + "SENDUNMANAGED_REQUIRED": "Mandatory Field", + "SENDUNMANAGED_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "SKIPUNMANAGED_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "UNMANAGEDMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "WEBSITEALIAS_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "AGENT_REQUIRED": "Mandatory Field", + "QUEUE_REQUIRED": "Mandatory Field", + "CONDITION_REQUIRED": "Mandatory Field", + "PRIORITY_REQUIRED": "Mandatory Field", + "TRUEPRIORITY_REQUIRED": "Mandatory Field", + "FALSEPRIORITY_REQUIRED": "Mandatory Field", + "NAME_REQUIRED": "Mandatory Field", + "LIST_REQUIRED": "Mandatory Field", + "AGENT_TIMEOUT_REQUIRED": "Mandatory Field", + "MOTIONADDRESS_REQUIRED": "Mandatory Field", + "DISPOSITION_REQUIRED": "Mandatory Field", + "MOTIONADDRESS_MUST_VALID_URL": "Wrong format", + "EMAIL_MUST_BE_VALID": "Wrong format", + "ADDRESS_REQUIRED": "Mandatory Field", + "ADDRESS_MUST_VALID_URL": "Wrong format", + "ENQUIRY_FORWARDING_ADDRESS_REQUIRED": "Mandatory Field", + "ACCEPTURL_MUST_VALID_URL": "Wrong format", + "TIMEOUT_REQUIRED": "Mandatory Field", + "REJECTURL_MUST_VALID_URL": "Wrong format", + "CLOSEURL_MUST_VALID_URL": "Wrong format", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", + "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", + "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", + "POLLING_INTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", + "WAITINGMESSAGE_REQUIRED": "Mandatory Field", + "WAITINGTITLE_REQUIRED": "Mandatory Field", + "KEY_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "KEY_REQUIRED": "Mandatory Field", + "WAITINGMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "WAITINGTITLE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "RATINGSTARSNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Mandatory field", + "EMAIL_ACCOUNT_REQUIRED": "Mandatory field" + }, + "CM_FIELD": "Contact Manager Field", + "CHATPROACTIVEACTIONS": "Proactive Actions", + "NEW_CHATPROACTIVEACTION": "New Proactive Action", + "EDIT_CHATPROACTIVEACTION": "Edit Proactive Action", + "DELETE_CHATPROACTIVEACTION": "Delete Proactive Action", + "ADD_CHATPROACTIVEACTION": "Add Proactive Action", + "NO_CHATPROACTIVEACTION_AVAILABLE": "No Proactive Actions Available", + "NO_OFFLINEMESSAGE_AVAILABLE": "No Offline Messages Available", + "MOUSEOVER": "Mouse Over", + "TIMEOUT": "Timeout", + "TYPE": "Type", + "SELECTOR": "Selector", + "AGENT": "Agent", + "GOTO": "Goto", + "GOTOIF": "GotoIf", + "NOOP": "Noop", + "QUEUE": "Queue", + "BUILDER": "Builder", + "PREVIEW": "Preview", + "EDIT_AGENT": "Edit Agent", + "EDIT_QUEUE": "Edit Queue", + "EDIT_GOTO": "Edit Goto", + "EDIT_GOTOIf": "Edit GotoIf", + "EDIT_NOOP": "Edit Noop", + "ADD_CHATQUEUE": "Add Chat Queue", + "EDIT_CHATQUEUE": "Edit Chat Queue", + "DELETE_CHATQUEUE": "Delete Chat Queue", + "SETTINGS": "Settings", + "SAVE": "Save", + "SCRIPT": "Script", + "TOKEN": "Token", + "CREATED_AT": "Created At", + "CHATWEBSITES": "Chat Websites", + "MOTIONADDRESS": "Website Domain", + "MOTIONPROXY": "Proxy Or Motion Domain", + "ADD_CHATWEBSITE": "Add Chat Website", + "EDIT_CHATWEBSITE": "Edit Chat Website", + "DELETE_CHATWEBSITE": "Delete Chat Website", + "LIST": "List", + "SNIPPET": "Snippet", + "FORMS": "Forms", + "UP": "Up", + "DOWN": "Down", + "COLLAPSE": "Collapse", + "PROACTIVEACTIONS": "Proactive Actions", + "DISPOSITIONS": "Dispositions", + "WEBHOOKS": "WebHooks", + "ACTIONS": "Actions", + "FIDELITY": "Fidelity", + "APPEARANCE": "Appearance", + "MAINCOLOR": "Main Color", + "FOCUSCOLOR": "Focus Color", + "BUTTONCOLOR": "Button Color", + "HEADERSHAPE": "Header Shape", + "ANIMATION": "Animation", + "DEFAULT": "Default", + "WHITELABEL": "White Label", + "LOGO": "Logo", + "DOWNLOADTRANSCRIPT": "Download Transcript", + "ENQUIRY_ENABLE": "Enquiry Enable", + "ENQUIRY_FORWARDING": "Enquiry Forwarding", + "ENQUIRY_FORWARDING_ADDRESS": "Enquiry Forwarding Address", + "LABELS": "Labels", + "HEADER_ONLINE": "Online Header", + "ONLINE_MESSAGE": "Online Message", + "NAME_TITLE": "Name Input Label", + "USERNAME_PLACEHOLDER": "Username Input Placeholder", + "EMAIL_TITLE": "Email Input Label", + "EMAIL_PLACEHOLDER": "Email Input Placeholder", + "START_CHAT_BUTTON": "'Start Chat' Button", + "AGENTS_BUSY": "Busy Agents Message", + "HEADER_OFFLINE": "Offline Header", + "OFFLINE_MESSAGE": "Offline Message", + "MESSAGE_TITLE": "Message Label", + "ENQUIRY_MESSAGE_PLACEHOLDER": "Enquiry Message Input Placeholder", + "ENQUIRY_BUTTON": "Enquiry Button Text", + "RATING_MESSAGE": "Rating Message", + "RATING_SEND": "Rating Send Button Text", + "RATING_SKIP": "Rating Skip Button Text", + "ONLINE": "Online", + "OFFLINE": "Offline", + "PROACTIVE": "Proactive", + "ACCEPT": "Accept", + "ACCEPTMETHOD": "Accept Method", + "ACCEPTURL": "Accept URL", + "REJECT": "Reject", + "REJECTMETHOD": "Reject Method", + "REJECTURL": "Reject URL", + "CLOSE": "Close", + "CLOSEMETHOD": "Close Method", + "CLOSEURL": "Close URL", + "EMBEDDING": "Embedding", + "GENERAL": "General", + "SELECTED": "Selected", + "SELECT_ALL": "Select All", + "SELECT_NONE": "Select None", + "BACK": "Back", + "HELP": { + "VERTICALPOSITION": "Represents the distance in percentage from top", + "AGENTIDENTIFIER": "Represents the agent identifier within the chat session in the snippet", + "HIDEWHENOFFLINE": "Hides snippet when offline", + "KEY": "Website short name (5 char) shown on the Agent Tab", + "TOKEN": "Automatically generated token used in the Script", + "INTEVAL": "To be selected from the list of the available intervals", + "TIMEZONE": "Select one from the list (default=local timezone)", + "ENABLERATING": "Enable it if you want the web visitor can rate the interaction at the end", + "ENABLEFEEDBACK": "Enable it if you want the web visitor can send a feedback (up to 150 char) at the end", + "FORWARDTRANSCRIPT": "Enable it if you want the web visitor is asked to receive a chat transcript via email", + "AUTOCLOSE": "Enable it if you want chat sessions to be closed as Unmanaged if no agent is available. Learn more about it at: https://wiki.xcallymotion.com/display/XMV/Chat+Websites#ChatWebsites-Snippet", + "ENABLEUNMANAGEDNOTE": "Enable it if you want the visitor is shown a message when all the agents are busy and the chat gets unmanaged", + "WEBSITEALIAS": "A prefix used to compose the agent name (prefix+Agent Id) shown to the web visitor during the chat session", + "ENABLECUSTOMERWRITING": " Enable it if you want the chat starts without waiting for an available agent (pay attention: if you enable it, your chats will never get unmanaged). Learn more at: https://wiki.xcallymotion.com/display/XMV/Chat+Websites#ChatWebsites-Snippet", + "MAPKEY": "The following Motion Contact Manager field:", + "FROMKEY": "Will be mapped in your Motion Chat Snippet as:", + "COPYSCRIPTTOCLIPBOARD": "Copy and paste the script text into your website", + "FORWARD_OFFLINE": "You can add multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)", + "MOTIONADDRESS": "The field must have the following format: ://[:]. Example: https://X.Y.Z.W", + "MOTIONPROXY": "The field must have the following format: ://[:]. Example: https://X.Y.Z.W", + "NAME": "Only numbers, letters and specific characters (._) are supported", + "LIST": "Contact Manager list used to associate Contacts", + "INTERVAL": "Select one from the list", + "MANDATORYDISPOSITION": "Mandatory disposition", + "MANDATORYDISPOSITIONPAUSEID": "Pause to use if mandatory disposition is enabled", + "WELCOMEMESSAGE": "Leave empty if you don't want to send any welcome message" + }, + "ADDRESS": "Address", + "ONLINESTATE": "Online Status", + "OFFLINESTATE": "Offline Status", + "RATINGSTATE": "Rating State", + "ENQUIRY": "Enquiry", + "OFFLINETEMPLATE": "Offline Template", + "CHATDISPOSITIONS": "Chat Dispositions", + "NO_CHATDISPOSITION_AVAILABLE": "No Chat Dispositions available", + "ADD_CHATDISPOSITION": "Add Chat Disposition", + "DELETE": "Delete", + "EDIT_CHATDISPOSITION": "Edit Chat Disposition", + "DELETE_CHATDISPOSITION": "Delete Chat Disposition", + "ID": "Id", + "NEW_CHATQUEUE": "New Chat Queue", + "NEW_CHATWEBSITE": "New Chat Website", + "ROUNDED": "Rounded", + "SQUARED": "Squared", + "NO_AVAILABLE_INFO": "No available info", + "ALL_TEAMS": "All Teams", + "SELECTED_TEAMS": "Selected Teams", + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "OF": "of", + "CONTACT": "Contact", + "STARTEDAT": "Started At", + "LASTMESSAGE": "Last message", + "STATUS": "Status", + "CLOSED": "Closed", + "OPENED": "Open", + "OPEN": "Open", + "ACCOUNT": "Account", + "INTERACTION": "Interaction", + "INTERACTIONS": "Interactions", + "WEBSITE": "Website", + "ALL": "All", + "SELECT_STATUS": "Select a status", + "FILTER": "Filter", + "FILTERS": "Filters", + "TEAMADD_CHATQUEUE": "Add Team to Chat Queue", + "AGENTADD_CHATQUEUE": "Add Agent to Chat Queue", + "ALL_AGENTS": "All Agents", + "SELECTED_AGENTS": "Selected Agents", + "CLOSEDAT": "Closed At", + "DISPOSITION": "Disposition", + "CREATEDAT": "Created At", + "NOTES": "Notes", + "NO_INTERACTION_AVAILABLE": "No interactions available", + "SELECTED_WEBSITE": "Select a website", + "GOTOP": "Gotop", + "EDIT_GOTOP": "Edit Gotop", + "SELECT_WEBSITE": "Select a website", + "INFO": "Info", + "OFFLINEMESSAGES_CHATWEBSITE": "Go to Offline Messages", + "WAITINGTITLE": "Waiting Title", + "WAITINGMESSAGE": "Waiting Message", + "RATING": "Rating", + "NO_RATINGVALUE": "No Rating", + "DEFAULT_PAUSE": "Default pause", + "UNKNOWN": "Unknown", + "UNREGISTERED": "Unregistered", + "UNAVAILABLE": "Unavailable", + "NOT_INUSE": "Not in use", + "REACHABLE": "Reachable", + "IN_USE": "In use", + "VOICE": "Voice", + "INTERACTIONS_CHATWEBSITE": "Go to Interactions", + "REFRESH_INTERACTIONS": "Refresh Interactions", + "DELETE_INTERACTION": "Delete Interaction", + "AGENTADD_CHATWEBSITE": "Add Agent to Chat Website", + "TEAMS_ASSOCIATION": "Teams Association", + "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", + "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available", + "DOWNLOAD_WITH_ATTACHMENTS": "Download with attachments", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download without attachments", + "LABELTEXT": "Label text" + } +} diff --git a/public/app/main/apps/contactmanager/i18n/bs.json b/public/app/main/apps/contactmanager/i18n/bs.json index b700161..f1dcd06 100644 --- a/public/app/main/apps/contactmanager/i18n/bs.json +++ b/public/app/main/apps/contactmanager/i18n/bs.json @@ -1,200 +1,200 @@ { "CONTACTMANAGER": { - "SELECT_TAG": "Select tags", - "CUSTOMER_JOURNEY": "Customer Journey", - "USERID": "Recall Agent ID", - "PRIORITY": "Priority", + "SELECT_TAG": "Odaberi Tagove", + "CUSTOMER_JOURNEY": "Putovanje Kupca", + "USERID": "Pozovi Specijalista ID", + "PRIORITY": "Prioritet", "MOTIONDIALER": "Motion Bull", - "IMPORT_CONTACTS": "Import Contacts", - "PREFIX": "Dial Prefix", + "IMPORT_CONTACTS": "Uvez Kontakte", + "PREFIX": "Prefix Biranja", "VOICEQUEUEID": "VoiceQueue ID", - "CAMPAIGNID": "Campaign ID", - "STATE": "State", - "NAME": "Name", - "LISTS": "Lists", - "UNIQUEID": "Unique Id", + "CAMPAIGNID": "Kampanja ID", + "STATE": "Država", + "NAME": "Ime", + "LISTS": "Liste", + "UNIQUEID": "Jedinstveni ID", "STATUS": "Status", - "STARTTIME": "Start Time", - "ENDTIME": "End Time", + "STARTTIME": "Vrijeme Početka", + "ENDTIME": "Vrijeme završetka", "MOTION_BULL": "Motion Bull", - "MOVE_DOWN": "Move down", - "MOVE_UP": "Move up", + "MOVE_DOWN": "Pomakni dole", + "MOVE_UP": "Pomakni gore", "HOPPER": "Hopper", "FINAL": "Hopper Final", "HISTORY": "Hopper History", - "SCHEDULEDAT": "Scheduled At", - "DIALTIMEZONE": "Dial Timezone", - "TIMEZONE": "Dial Timezone", - "SEARCH_FOR_ANYONE": "Search", - "EDIT_LIST": "Edit List", - "EDIT_HOPPER": "Edit Hopper", - "DELETE_LIST": "Delete List", - "DELETE_HOPPER": "Delete Hopper", - "RELOAD": "Reload", - "ADDITIONAL_PHONES": "Additional phones", - "NO_COMPANIES": "No Company", - "NO_AVAILABLE_ITEMS": "No Available Items", - "ADD": "Add", - "UPDATE_EXISTING_CONTACTS": "Update existing contacts", + "SCHEDULEDAT": "Zakazano U", + "DIALTIMEZONE": "Timezone Pozivanja", + "TIMEZONE": "Timezone Pozivanja", + "SEARCH_FOR_ANYONE": "Traži", + "EDIT_LIST": "Uredi Listu", + "EDIT_HOPPER": "Uredi Hopper", + "DELETE_LIST": "Izbriši Listu", + "DELETE_HOPPER": "Izbriši Hopper", + "RELOAD": "Ponovno učitavanje", + "ADDITIONAL_PHONES": "Dodatni telefoni", + "NO_COMPANIES": "Nema Kompanije", + "NO_AVAILABLE_ITEMS": "Nema Dostupnih Stavki", + "ADD": "Dodaj", + "UPDATE_EXISTING_CONTACTS": "Ažuriraj Postojeće Kontakte", "ERRORS": { - "NAME_REQUIRED": "Mandatory field", - "FIRSTNAME_REQUIRED": "Mandatory field", - "PHONE_REQUIRED": "Mandatory field", - "ALIAS_REQUIRED": "Mandatory field", - "VALUE_REQUIRED": "Mandatory field", - "CLICKTOACTION_REQUIRED": "Mandatory field", - "ACTIONTYPE_REQUIRED": "Mandatory field", - "EMAIL_MUST_VALID": "Wrong format", - "PHONEBAR_API": "Check the MotionBar is running and the remote control switch for the agent is turned on" + "NAME_REQUIRED": "Obavezno polje", + "FIRSTNAME_REQUIRED": "Obavezno polje", + "PHONE_REQUIRED": "Obavezno polje", + "ALIAS_REQUIRED": "Obavezno polje", + "VALUE_REQUIRED": "Obavezno polje", + "CLICKTOACTION_REQUIRED": "Obavezno polje", + "ACTIONTYPE_REQUIRED": "Obavezno polje", + "EMAIL_MUST_VALID": "Pogrešan format", + "PHONEBAR_API": "Provjeri da li je MotionBar aktivan, i da li je prekidač za daljinsko upravljanje uključen." }, - "DESCRIPTION": "Description", - "DISPOSITION": "Disposition", - "DISPOSITIONS": "Dispositions", - "VOICEDISPOSITIONS": "Voice Dispositions", - "NEW_VOICEDISPOSITION": "New Voice Disposition", - "CUSTOM_FIELDS": "Custom Fields", - "ADD_LIST": "Add List", - "BACK": "Back", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "COMPANIES": "Companies", - "EDIT_COMPANY": "Edit Company", - "DELETE_COMPANY": "Delete Company", - "PHONE": "Phone", - "EMAIL": "Email", - "ADD_COMPANY": "Add Company", - "CONTACTS": "Contacts", - "NEW_LIST": "New List", - "FIRSTNAME": "First Name", - "LASTNAME": "Last Name", - "LIST": "List", - "COMPANY": "Company", - "ADD_CONTACT": "Add Contact", - "EDIT_CONTACT": "Edit Contact", - "MERGE_CONTACT": "Merge Contact", - "DUPLICATE_CONTACT": "Duplicate Contact", - "DELETE_CONTACT": "Delete Contact", - "CREATED_AT": "Created At", - "SAVE": "Save", - "DETAIL": "Detail", - "PERSONAL_INFO": "Personal Info", - "MOBILE": "Mobile", + "DESCRIPTION": "Opis", + "DISPOSITION": "Dispozciija", + "DISPOSITIONS": "Dispozicije", + "VOICEDISPOSITIONS": "Voice Dispozicija", + "NEW_VOICEDISPOSITION": "Nova Voice Dispozicija", + "CUSTOM_FIELDS": "Prilagođena Polja", + "ADD_LIST": "Dodaj Listu", + "BACK": "Nazad", + "SELECTED": "Odabrano", + "SELECT_ALL": "Odaberi Sve", + "SELECT_NONE": "Odaberi Ništa", + "COMPANIES": "Kompanije", + "EDIT_COMPANY": "Uredi Kompaniju", + "DELETE_COMPANY": "Izbriši Kompaniju", + "PHONE": "Telefon", + "EMAIL": "E-mail", + "ADD_COMPANY": "Dodaj Kompaniju", + "CONTACTS": "Kontakti", + "NEW_LIST": "Nova Lista", + "FIRSTNAME": "Ime", + "LASTNAME": "Prezime", + "LIST": "Lista", + "COMPANY": "Kompanija", + "ADD_CONTACT": "Dodaj Kontakt", + "EDIT_CONTACT": "Uredi Kontakt", + "MERGE_CONTACT": "Spoji Kontakt", + "DUPLICATE_CONTACT": "Dupliciraj Kontakt", + "DELETE_CONTACT": "Izbriši Kontakt", + "CREATED_AT": "Kreirano U", + "SAVE": "Sačuvaj", + "DETAIL": "Detalji", + "PERSONAL_INFO": "Osobni Podaci", + "MOBILE": "Mobilni", "FAX": "Fax", - "TAGS": "Tags", - "SHOW_ALL_FIELDS": "Show all fields", - "FEWER_FIELDS": "Show less fields", - "COUNTRY": "Country", - "CITY": "City", - "STREET": "Street", - "POSTALCODE": "Postal Code", - "DELETE": "Delete", - "DELETE_ALL": "Delete All", - "CONTACTMANAGER": "Contacts Manager", - "ID": "Id", - "SETTINGS": "Settings", - "GENERAL": "General", - "CUSTOMFIELDS": "Custom Fields", - "NO_CUSTOMFIELD_AVAILABLE": "No Custom Fields available", - "ADD_TAG": "Add Tag", - "NO_TAG": "No Tags", - "ALIAS": "Alias", - "CLICKTOACTION": "Click to action", - "ACTIONTYPE": "Action type", - "TYPE": "Type", - "VALUE": "Value", - "ADD_CUSTOMFIELD": "Add Custom Field", - "EDIT_CUSTOMFIELD": "Edit Custom Field", - "DELETE_CUSTOMFIELD": "Delete Custom Field", - "NEW_COMPANY": "New Company", - "NEW_CONTACT": "New Contact", - "NEW_TAG": "New Tag", - "UPLOAD_CONTACTS": "Upload Contacts", - "FINISH": "Finish", - "SUCCESS": "Success", - "FAILURE": "Failure", - "ALL_CONTACTS": "All Contacts", - "NEW_CUSTOMFIELD": "New Custom Field", - "NO_VOICEDISPOSITION_AVAILABLE": "No Voice Dispositions available", - "ADD_VOICEDISPOSITION": "Add Voice Disposition", - "EDIT_VOICEDISPOSITION": "Edit Voice Disposition", - "DELETE_VOICEDISPOSITION": "Delete Voice Disposition", - "VAT": "VAT", - "COMPANYID": "Company ID", + "TAGS": "Tagovi", + "SHOW_ALL_FIELDS": "Prikaži sva polja", + "FEWER_FIELDS": "Prikaži manje polja", + "COUNTRY": "Država", + "CITY": "Grad", + "STREET": "Ulica", + "POSTALCODE": "Poštanski Broj", + "DELETE": "Izbriši", + "DELETE_ALL": "Izbriši Sve", + "CONTACTMANAGER": "Menadžer Kontakata", + "ID": "ID", + "SETTINGS": "Postavke", + "GENERAL": "Općenito", + "CUSTOMFIELDS": "Prilagođena Polja", + "NO_CUSTOMFIELD_AVAILABLE": "Nema dostupnih Prilagođenih Polja", + "ADD_TAG": "Dodaj Tag", + "NO_TAG": "Bez Tagova", + "ALIAS": "Pseudonim", + "CLICKTOACTION": "Klikni za Radnju", + "ACTIONTYPE": "Tip Radnje", + "TYPE": "Tip", + "VALUE": "Vrijednost", + "ADD_CUSTOMFIELD": "Dodaj Prilagođeno Polje", + "EDIT_CUSTOMFIELD": "Uredi Prilagođeno Polje", + "DELETE_CUSTOMFIELD": "Izbriši Prilagođeno Polje", + "NEW_COMPANY": "Ime Kompanije", + "NEW_CONTACT": "Ime Kontakta", + "NEW_TAG": "Novi Tag", + "UPLOAD_CONTACTS": "Učitavanje Kontakata", + "FINISH": "Završi", + "SUCCESS": "Uspjeh", + "FAILURE": "Neuspjeh", + "ALL_CONTACTS": "Svi Kontakti", + "NEW_CUSTOMFIELD": "Novo Prilagođeno Polje", + "NO_VOICEDISPOSITION_AVAILABLE": "Nema dostupnih Voice Dispozicija", + "ADD_VOICEDISPOSITION": "Dodaj Voice Dispoziciju", + "EDIT_VOICEDISPOSITION": "Uredi Voice Dispoziciju", + "DELETE_VOICEDISPOSITION": "Izbriši Voice Dispoziciju", + "VAT": "PDV", + "COMPANYID": "Kompanija ID", "WEBSITE": "Website", - "EMAIL_DOMAIN": "Email Domain", - "ADDRESS": "Address", - "POSTAL_CODE": "Postal Code", - "SHIPMENTADDRESS": "Shipment Address", - "COPY_CONTACT": "Copy Contact", - "GOTOCONTACTS_LIST": "Show Contacts", - "GOTOCONTACTS_COMPANY": "Show Contacts", - "ADD_AGENT_TO_LIST": "Add Agent to List", - "AGENTADD_LIST": "Add Agents to List", - "NO_AVAILABLE_INFO": "No available info", - "NONE": "None", - "ALL": "All", - "FULLNAME": "Full Name", - "CHECK_DUPLICATES": "Check Duplicates", - "DUPLICATES": "Duplicates", - "UPLOAD_CSV": "Upload CSV", + "EMAIL_DOMAIN": "E-mail Domena", + "ADDRESS": "Adresa", + "POSTAL_CODE": "Poštanski Broj", + "SHIPMENTADDRESS": "Adresa Isporuke", + "COPY_CONTACT": "Kopiraj Kontakt", + "GOTOCONTACTS_LIST": "Prikaži Kontakte", + "GOTOCONTACTS_COMPANY": "Prikaži Kontakte", + "ADD_AGENT_TO_LIST": "Dodaj Specijalistu na Listu", + "AGENTADD_LIST": "Dodaj Specijaliste na Listu", + "NO_AVAILABLE_INFO": "Nema Dostupnih Informacija", + "NONE": "Ništa", + "ALL": "Svi", + "FULLNAME": "Puno Ime", + "CHECK_DUPLICATES": "Provjeri Duplikate", + "DUPLICATES": "Duplikati", + "UPLOAD_CSV": "Učitaj CSV", "TAG": "Tag", - "UPLOAD": "Upload", - "ALL_AGENTS": "All Agents", - "SELECTED_AGENTS": "Selected Agents", - "DATE_OF_BIRTH": "Birthdate", - "DATEOFBIRTH": "Birthdate", - "NOTES": "Notes", - "EXPORTCSVCONTACTS_LIST": "Export to CSV", - "GOTO_LIST": "Show Contacts", - "GOTO_COMPANY": "Show Contacts", - "REQUIRED": "Required", - "GLOBALCUSTOMFIELDS": "Global Custom Fields", - "NEW_GLOBALCUSTOMFIELD": "New Custom Fields", - "ADD_GLOBALCUSTOMFIELD": "Add Custom Field", - "EDIT_GLOBALCUSTOMFIELD": "Edit Custom Field", - "DELETE_GLOBALCUSTOMFIELD": "Delete Custom Field", + "UPLOAD": "Učitaj", + "ALL_AGENTS": "Svi Specijalisti", + "SELECTED_AGENTS": "Odabrani Specijalisti", + "DATE_OF_BIRTH": "Datum rođenja", + "DATEOFBIRTH": "Datum rođenja", + "NOTES": "Bilješke", + "EXPORTCSVCONTACTS_LIST": "Izvoz u CSV", + "GOTO_LIST": "Prikaži Kontakte", + "GOTO_COMPANY": "Prikaži Kontakte", + "REQUIRED": "Potrebno", + "GLOBALCUSTOMFIELDS": "Globalna Prilagođena Polja", + "NEW_GLOBALCUSTOMFIELD": "Nova Prilagođena Polja", + "ADD_GLOBALCUSTOMFIELD": "Dodaj Prilagođeno Polje", + "EDIT_GLOBALCUSTOMFIELD": "Uredi Prilagođeno Polje", + "DELETE_GLOBALCUSTOMFIELD": "Izbiri Prilagođeno Polje", "JSCRIPTY": "Jscripty", - "SESSIONS": "Sessions", - "AGENT": "Agent", - "PROJECT": "Project", - "SELECT_LIST": "Select a list", - "SELECT_COMPANY": "Select a company", - "SELECT_TAGS": "Select one or more tags", + "SESSIONS": "Sesije", + "AGENT": "Specijalist", + "PROJECT": "Projekat", + "SELECT_LIST": "Odaberi Listu", + "SELECT_COMPANY": "Odaberi Kompaniju", + "SELECT_TAGS": "Odaberi jedan ili više tagova", "HELP": { - "PHONEBAR_API_MESSAGE": "To enable click-to-call, insert a phone number and check the remote control switch for the Agent is turned on", - "PHONEBAR_API": "To enable click-to-call, insert a phone number and check the remote control switch for the Agent is turned on" + "PHONEBAR_API_MESSAGE": "Da bi omogućio click-to-call, ukucaj broj telefona i provjeri da li je prekidač za daljinsko upravljanje uključen", + "PHONEBAR_API": "Da bi omogućio click-to-call, ukucaj broj telefona i provjeri da li je prekidač za daljinsko upravljanje uključen" }, - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", - "SOCIAL": "Social", - "ROW": "Row", - "EXPORT_ERRORS": "Export Errors", - "UPLOAD_COMPLETED": "Upload Completed", - "STOP": "Stop", - "SELECT_FILE": "Select File", - "BILLINGINFORMATION": "Billing Information", - "FLATDISCOUNT": "Company Discount", - "EUROPE": "Europe", - "ISOCODE": "ISO National Code", - "VATNUMBER_CF": "Codice Fiscale/VAT", - "PIVA": "VAT Number", - "SDICODE": "SDI Code", - "EXPIREDAY": "Expiration Days", - "INVOICEARTICLE": "Law Articles", - "PAYMENTMETHOD": "Payment Method", - "SOCIAL_CAPITAL": "Share Capital", - "COMPANY_FISCAL_TYPE": "Company Fiscal Type", - "RELATIONSHIP": "Relationship ...", - "RELATIONSHIPCOMPANY": " ... with", - "CREATE": "Create", + "PAGE": "Stranica", + "ROWSPERPAGE": "Redovi po stranici", + "OF": "od", + "SOCIAL": "Društveni", + "ROW": "Red", + "EXPORT_ERRORS": "Izvoz Greška", + "UPLOAD_COMPLETED": "Učitavanje Završeno", + "STOP": "Stani", + "SELECT_FILE": "Odaberi Datoteku", + "BILLINGINFORMATION": "Naplatne Informacije", + "FLATDISCOUNT": "Popusti Kompanije", + "EUROPE": "Europa", + "ISOCODE": "ISO Nacionalna Šifra", + "VATNUMBER_CF": "Fiskalni Kod/PDV", + "PIVA": "PDV Broj", + "SDICODE": "SDI Šifra", + "EXPIREDAY": "Dani Isteka", + "INVOICEARTICLE": "Zakonski Članci", + "PAYMENTMETHOD": "Način Plaćanja", + "SOCIAL_CAPITAL": "Podijeli Kapital", + "COMPANY_FISCAL_TYPE": "Fiskalni Tip Kompanije", + "RELATIONSHIP": "Veza ...", + "RELATIONSHIPCOMPANY": "... sa", + "CREATE": "Kreiraj", "RECALLME": "Recall Me", "NOTIFICATIONS": { - "NO_DATA_ERROR": "Unable to retrieve any data", - "INTERACTION_OPEN_ERROR": "Unable to open the interaction", - "ACCOUNTS_GET_ERROR": "Unable to retrieve any {{channel}} account", - "JSCRIPTY_GET_ERROR": "Unable to retrieve any Jscripty project" + "NO_DATA_ERROR": "Nije moguće povući podatke", + "INTERACTION_OPEN_ERROR": "Nije moguće otvoriti interakciju", + "ACCOUNTS_GET_ERROR": "Nije moguće povući nijedan {{channel}} nalog", + "JSCRIPTY_GET_ERROR": "Nije moguće povući nijdan Jscripty projekat" } } } diff --git a/public/app/main/apps/contactmanager/i18n/cs.json b/public/app/main/apps/contactmanager/i18n/cs.json index f1945cc..d974f01 100644 --- a/public/app/main/apps/contactmanager/i18n/cs.json +++ b/public/app/main/apps/contactmanager/i18n/cs.json @@ -1,170 +1,170 @@ { "CONTACTMANAGER": { - "SELECT_TAG": "Select tags", - "CUSTOMER_JOURNEY": "Customer Journey", - "USERID": "Recall Agent ID", - "PRIORITY": "Priority", + "SELECT_TAG": "Vybrat značku", + "CUSTOMER_JOURNEY": "Historie zákazníka", + "USERID": "Připomenutí Agent ID", + "PRIORITY": "Priorita", "MOTIONDIALER": "Motion Bull", - "IMPORT_CONTACTS": "Import Contacts", - "PREFIX": "Dial Prefix", - "VOICEQUEUEID": "VoiceQueue ID", - "CAMPAIGNID": "Campaign ID", - "STATE": "State", - "NAME": "Name", - "LISTS": "Lists", - "UNIQUEID": "Unique Id", + "IMPORT_CONTACTS": "Importovat kontakty", + "PREFIX": "Prefix vytáčení", + "VOICEQUEUEID": "ID Hlasové fronty", + "CAMPAIGNID": "ID kampaně", + "STATE": "Stát", + "NAME": "Jméno", + "LISTS": "Seznamy", + "UNIQUEID": "Unikátní Id", "STATUS": "Status", - "STARTTIME": "Start Time", - "ENDTIME": "End Time", + "STARTTIME": "Čas začátku", + "ENDTIME": "Čas konce", "MOTION_BULL": "Motion Bull", "HOPPER": "Hopper", - "FINAL": "Hopper Final", - "HISTORY": "Hopper History", - "SCHEDULEDAT": "Scheduled At", - "SEARCH_FOR_ANYONE": "Search", - "EDIT_LIST": "Edit List", - "EDIT_HOPPER": "Edit Hopper", - "DELETE_LIST": "Delete List", - "DELETE_HOPPER": "Delete Hopper", - "RELOAD": "Reload", - "NO_COMPANIES": "No Company", - "NO_AVAILABLE_ITEMS": "No Available Items", - "ADD": "Add", + "FINAL": "Výsledný Hopper", + "HISTORY": "Historie Hopper", + "SCHEDULEDAT": "Naplánováno", + "SEARCH_FOR_ANYONE": "Vyhledat", + "EDIT_LIST": "Upravit seznam", + "EDIT_HOPPER": "Upravit Hopper", + "DELETE_LIST": "Samzat seznam", + "DELETE_HOPPER": "Smazat Hopper", + "RELOAD": "Obnovit", + "NO_COMPANIES": "Žádná společnost", + "NO_AVAILABLE_ITEMS": "Žádné položky", + "ADD": "Přidat", "ERRORS": { - "NAME_REQUIRED": "Mandatory field", - "FIRSTNAME_REQUIRED": "Mandatory field", - "PHONE_REQUIRED": "Mandatory field", - "ALIAS_REQUIRED": "Mandatory field", - "VALUE_REQUIRED": "Mandatory field", - "EMAIL_MUST_VALID": "Wrong format", - "PHONEBAR_API": "Check the MotionBar is running and the remote control switch for the agent is turned on", + "NAME_REQUIRED": "Povinné pole", + "FIRSTNAME_REQUIRED": "Povinné pole", + "PHONE_REQUIRED": "Povinné pole", + "ALIAS_REQUIRED": "Povinné pole", + "VALUE_REQUIRED": "Povinné pole", + "EMAIL_MUST_VALID": "Neplatný formát", + "PHONEBAR_API": "Zkontrolujte zda MotionBar je spuštěn a agent má zapnuto remote control", "ACTIONTYPE_REQUIRED": "Povinné pole", "CLICKTOACTION_REQUIRED": "Povinné pole" }, - "DESCRIPTION": "Description", - "DISPOSITION": "Disposition", - "DISPOSITIONS": "Dispositions", - "VOICEDISPOSITIONS": "Voice Dispositions", - "NEW_VOICEDISPOSITION": "New Voice Disposition", - "CUSTOM_FIELDS": "Custom Fields", - "ADD_LIST": "Add List", - "BACK": "Back", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "COMPANIES": "Companies", - "EDIT_COMPANY": "Edit Company", - "DELETE_COMPANY": "Delete Company", - "PHONE": "Phone", + "DESCRIPTION": "Popis", + "DISPOSITION": "Dispozice", + "DISPOSITIONS": "Dispozice", + "VOICEDISPOSITIONS": "Hlasové dispozice", + "NEW_VOICEDISPOSITION": "Nový dispoziční kód", + "CUSTOM_FIELDS": "Uživatelská pole", + "ADD_LIST": "Přidat seznam", + "BACK": "Zpět", + "SELECTED": "Vybráno", + "SELECT_ALL": "Vybrat vše", + "SELECT_NONE": "Zrušit výběr", + "COMPANIES": "Společnosti", + "EDIT_COMPANY": "Upravit společnost", + "DELETE_COMPANY": "Smazat společnost", + "PHONE": "Telefon", "EMAIL": "Email", - "ADD_COMPANY": "Add Company", - "CONTACTS": "Contacts", - "NEW_LIST": "New List", - "FIRSTNAME": "First Name", - "LASTNAME": "Last Name", - "LIST": "List", - "COMPANY": "Company", - "ADD_CONTACT": "Add Contact", - "EDIT_CONTACT": "Edit Contact", - "MERGE_CONTACT": "Merge Contact", - "DUPLICATE_CONTACT": "Duplicate Contact", - "DELETE_CONTACT": "Delete Contact", - "CREATED_AT": "Created At", - "SAVE": "Save", + "ADD_COMPANY": "Přidat společnost", + "CONTACTS": "Kontakty", + "NEW_LIST": "Nový seznam", + "FIRSTNAME": "Jméno", + "LASTNAME": "Příjmení", + "LIST": "Seznam", + "COMPANY": "Společnost", + "ADD_CONTACT": "Přidat kontakt", + "EDIT_CONTACT": "Upravit kontakt", + "MERGE_CONTACT": "Spojit kontakty", + "DUPLICATE_CONTACT": "Kopírovat kontakt", + "DELETE_CONTACT": "Smazat kontakt", + "CREATED_AT": "Vytvořeno", + "SAVE": "Uložit", "DETAIL": "Detail", - "PERSONAL_INFO": "Personal Info", - "MOBILE": "Mobile", + "PERSONAL_INFO": "Osobní Info", + "MOBILE": "Mobil", "FAX": "Fax", - "TAGS": "Tags", - "SHOW_ALL_FIELDS": "Show all fields", - "FEWER_FIELDS": "Show less fields", - "COUNTRY": "Country", - "CITY": "City", - "STREET": "Street", - "POSTALCODE": "Postal Code", - "DELETE": "Delete", - "DELETE_ALL": "Delete All", - "CONTACTMANAGER": "Contacts Manager", + "TAGS": "Značky", + "SHOW_ALL_FIELDS": "Zobrazit všechna pole", + "FEWER_FIELDS": "Zobrazit méně polí", + "COUNTRY": "Země", + "CITY": "Město", + "STREET": "Ulice", + "POSTALCODE": "Poštovní kód", + "DELETE": "Smazat", + "DELETE_ALL": "Smazat vše", + "CONTACTMANAGER": "Kontaktní Manager", "ID": "Id", - "SETTINGS": "Settings", - "GENERAL": "General", - "CUSTOMFIELDS": "Custom Fields", - "NO_CUSTOMFIELD_AVAILABLE": "No Custom Fields available", - "ADD_TAG": "Add Tag", - "NO_TAG": "No Tags", + "SETTINGS": "Nastavení", + "GENERAL": "Obecné", + "CUSTOMFIELDS": "Uživatelská pole", + "NO_CUSTOMFIELD_AVAILABLE": "Žádná uživatelská pole", + "ADD_TAG": "Přidat značku", + "NO_TAG": "Žádné značky", "ALIAS": "Alias", - "TYPE": "Type", - "VALUE": "Value", - "ADD_CUSTOMFIELD": "Add Custom Field", - "EDIT_CUSTOMFIELD": "Edit Custom Field", - "DELETE_CUSTOMFIELD": "Delete Custom Field", - "NEW_COMPANY": "New Company", - "NEW_CONTACT": "New Contact", - "NEW_TAG": "New Tag", - "UPLOAD_CONTACTS": "Upload Contacts", - "FINISH": "Finish", - "SUCCESS": "Success", - "FAILURE": "Failure", - "ALL_CONTACTS": "All Contacts", - "NEW_CUSTOMFIELD": "New Custom Field", - "NO_VOICEDISPOSITION_AVAILABLE": "No Voice Dispositions available", - "ADD_VOICEDISPOSITION": "Add Voice Disposition", - "EDIT_VOICEDISPOSITION": "Edit Voice Disposition", - "DELETE_VOICEDISPOSITION": "Delete Voice Disposition", - "VAT": "VAT", - "COMPANYID": "Company ID", - "WEBSITE": "Website", - "EMAIL_DOMAIN": "Email Domain", - "ADDRESS": "Address", - "POSTAL_CODE": "Postal Code", - "SHIPMENTADDRESS": "Shipment Address", - "COPY_CONTACT": "Copy Contact", - "GOTOCONTACTS_LIST": "Show Contacts", - "GOTOCONTACTS_COMPANY": "Show Contacts", - "ADD_AGENT_TO_LIST": "Add Agent to List", - "AGENTADD_LIST": "Add Agents to List", - "NO_AVAILABLE_INFO": "No available info", - "NONE": "None", - "FULLNAME": "Full Name", - "CHECK_DUPLICATES": "Check Duplicates", - "DUPLICATES": "Duplicates", - "UPLOAD_CSV": "Upload CSV", - "TAG": "Tag", - "UPLOAD": "Upload", - "ALL_AGENTS": "All Agents", - "SELECTED_AGENTS": "Selected Agents", - "DATE_OF_BIRTH": "Birthdate", - "DATEOFBIRTH": "Birthdate", - "NOTES": "Notes", - "EXPORTCSVCONTACTS_LIST": "Export to CSV", - "GOTO_LIST": "Show Contacts", - "GOTO_COMPANY": "Show Contacts", - "REQUIRED": "Required", - "GLOBALCUSTOMFIELDS": "Global Custom Fields", - "NEW_GLOBALCUSTOMFIELD": "New Custom Fields", - "ADD_GLOBALCUSTOMFIELD": "Add Custom Field", - "EDIT_GLOBALCUSTOMFIELD": "Edit Custom Field", - "DELETE_GLOBALCUSTOMFIELD": "Delete Custom Field", + "TYPE": "Typ", + "VALUE": "Hodnota", + "ADD_CUSTOMFIELD": "Přidat uživatelské pole", + "EDIT_CUSTOMFIELD": "Upravit uživatelské pole", + "DELETE_CUSTOMFIELD": "Smazat uživatelské pole", + "NEW_COMPANY": "Nová společnost", + "NEW_CONTACT": "Nový kontakt", + "NEW_TAG": "Nová značka", + "UPLOAD_CONTACTS": "Nahrát kontakty", + "FINISH": "Ukončneo", + "SUCCESS": "Úspěch", + "FAILURE": "Chyba", + "ALL_CONTACTS": "Všechny kontakty", + "NEW_CUSTOMFIELD": "Nové uživatelské pole", + "NO_VOICEDISPOSITION_AVAILABLE": "Žádný hlasový dispoziční kód", + "ADD_VOICEDISPOSITION": "Přidat hlasovou Dispozice", + "EDIT_VOICEDISPOSITION": "Upravit uživatelské pole", + "DELETE_VOICEDISPOSITION": "Smazat hlasovou dispozici", + "VAT": "DIČ", + "COMPANYID": "ID Společnosti", + "WEBSITE": "Webová stránka", + "EMAIL_DOMAIN": "Email doména", + "ADDRESS": "Adresa", + "POSTAL_CODE": "Poštovní kód", + "SHIPMENTADDRESS": "Dodací adresa", + "COPY_CONTACT": "Kopírovat kontakt", + "GOTOCONTACTS_LIST": "Zobrazit kontakty", + "GOTOCONTACTS_COMPANY": "Zobrazit kontakty", + "ADD_AGENT_TO_LIST": "Přidat agenta k seznamu", + "AGENTADD_LIST": "Přidat agenty k seznamu", + "NO_AVAILABLE_INFO": "Žádné informace", + "NONE": "žádné", + "FULLNAME": "Celé jméno", + "CHECK_DUPLICATES": "Kontrola duplicit", + "DUPLICATES": "Duplikovat", + "UPLOAD_CSV": "Nahrát CSV", + "TAG": "Značka", + "UPLOAD": "Nahrát", + "ALL_AGENTS": "Všichni agenti", + "SELECTED_AGENTS": "Vybraní agenti", + "DATE_OF_BIRTH": "Narozeniny", + "DATEOFBIRTH": "Narozeniny", + "NOTES": "Poznámky", + "EXPORTCSVCONTACTS_LIST": "Export do CSV", + "GOTO_LIST": "Zobrazit kontakty", + "GOTO_COMPANY": "Zobrazit kontakty", + "REQUIRED": "Vyžadováno", + "GLOBALCUSTOMFIELDS": "Obecné uživatelské pole", + "NEW_GLOBALCUSTOMFIELD": "Nová uživatelská pole", + "ADD_GLOBALCUSTOMFIELD": "Přidat uživatelské pole", + "EDIT_GLOBALCUSTOMFIELD": "Upravit uživatelské pole", + "DELETE_GLOBALCUSTOMFIELD": "Smazat uživatelské pole", "JSCRIPTY": "Jscripty", - "SESSIONS": "Sessions", + "SESSIONS": "Sezení", "AGENT": "Agent", - "PROJECT": "Project", - "SELECT_LIST": "Select a list", - "SELECT_COMPANY": "Select a company", - "SELECT_TAGS": "Select one or more tags", + "PROJECT": "Projekt", + "SELECT_LIST": "Vybrat seznam", + "SELECT_COMPANY": "Vybrat společnost", + "SELECT_TAGS": "Vybrat jednu nebo více značek", "HELP": { - "PHONEBAR_API_MESSAGE": "To enable click-to-call, insert a phone number and check the remote control switch for the Agent is turned on", - "PHONEBAR_API": "To enable click-to-call, insert a phone number and check the remote control switch for the Agent is turned on" + "PHONEBAR_API_MESSAGE": "Pro click-to-call funkci vložte telefonní číslo a porvěřte že Agent má povoleno remote control", + "PHONEBAR_API": "Pro click-to-call funkci vložte telefonní číslo a porvěřte že Agent má povoleno remote control" }, - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", + "PAGE": "Strana", + "ROWSPERPAGE": "Řádek na stránku", + "OF": "z", "SOCIAL": "Social", - "ROW": "Row", - "EXPORT_ERRORS": "Export Errors", - "UPLOAD_COMPLETED": "Upload Completed", + "ROW": "Řádka", + "EXPORT_ERRORS": "Export chyby", + "UPLOAD_COMPLETED": "Nahrávání kompletní", "STOP": "Stop", - "SELECT_FILE": "Select File", + "SELECT_FILE": "Vybrat soubor", "ALL": "Všechno", "BILLINGINFORMATION": "Fakturační údaje", "COMPANY_FISCAL_TYPE": "Fiskální typ společnosti", @@ -181,7 +181,7 @@ "RELATIONSHIPCOMPANY": " ... s", "SDICODE": "Kód SDI", "SOCIAL_CAPITAL": "Základní kapitál", - "VATNUMBER_CF": "Codice Fiscale / DPH", + "VATNUMBER_CF": "DIČ", "ACTIONTYPE": "Typ akce", "CLICKTOACTION": "Klikněte na akci", "ADDITIONAL_PHONES": "Další telefony", diff --git a/public/app/main/apps/contactmanager/i18n/et.json b/public/app/main/apps/contactmanager/i18n/et.json index 494d629..4daf2c5 100644 --- a/public/app/main/apps/contactmanager/i18n/et.json +++ b/public/app/main/apps/contactmanager/i18n/et.json @@ -185,6 +185,10 @@ "ACTIONTYPE": "Toimingu tüüp", "CLICKTOACTION": "Klõpsake toimimiseks", "DIALTIMEZONE": "Vali ajavöönd", - "TIMEZONE": "Vali ajavöönd" + "TIMEZONE": "Vali ajavöönd", + "ADDITIONAL_PHONES": "Lisatelefonid", + "MOVE_DOWN": "Liigu alla", + "MOVE_UP": "Üles liikuma", + "UPDATE_EXISTING_CONTACTS": "Värskendage olemasolevaid kontakte" } } diff --git a/public/app/main/apps/contactmanager/i18n/is.json b/public/app/main/apps/contactmanager/i18n/is.json new file mode 100644 index 0000000..b700161 --- /dev/null +++ b/public/app/main/apps/contactmanager/i18n/is.json @@ -0,0 +1,200 @@ +{ + "CONTACTMANAGER": { + "SELECT_TAG": "Select tags", + "CUSTOMER_JOURNEY": "Customer Journey", + "USERID": "Recall Agent ID", + "PRIORITY": "Priority", + "MOTIONDIALER": "Motion Bull", + "IMPORT_CONTACTS": "Import Contacts", + "PREFIX": "Dial Prefix", + "VOICEQUEUEID": "VoiceQueue ID", + "CAMPAIGNID": "Campaign ID", + "STATE": "State", + "NAME": "Name", + "LISTS": "Lists", + "UNIQUEID": "Unique Id", + "STATUS": "Status", + "STARTTIME": "Start Time", + "ENDTIME": "End Time", + "MOTION_BULL": "Motion Bull", + "MOVE_DOWN": "Move down", + "MOVE_UP": "Move up", + "HOPPER": "Hopper", + "FINAL": "Hopper Final", + "HISTORY": "Hopper History", + "SCHEDULEDAT": "Scheduled At", + "DIALTIMEZONE": "Dial Timezone", + "TIMEZONE": "Dial Timezone", + "SEARCH_FOR_ANYONE": "Search", + "EDIT_LIST": "Edit List", + "EDIT_HOPPER": "Edit Hopper", + "DELETE_LIST": "Delete List", + "DELETE_HOPPER": "Delete Hopper", + "RELOAD": "Reload", + "ADDITIONAL_PHONES": "Additional phones", + "NO_COMPANIES": "No Company", + "NO_AVAILABLE_ITEMS": "No Available Items", + "ADD": "Add", + "UPDATE_EXISTING_CONTACTS": "Update existing contacts", + "ERRORS": { + "NAME_REQUIRED": "Mandatory field", + "FIRSTNAME_REQUIRED": "Mandatory field", + "PHONE_REQUIRED": "Mandatory field", + "ALIAS_REQUIRED": "Mandatory field", + "VALUE_REQUIRED": "Mandatory field", + "CLICKTOACTION_REQUIRED": "Mandatory field", + "ACTIONTYPE_REQUIRED": "Mandatory field", + "EMAIL_MUST_VALID": "Wrong format", + "PHONEBAR_API": "Check the MotionBar is running and the remote control switch for the agent is turned on" + }, + "DESCRIPTION": "Description", + "DISPOSITION": "Disposition", + "DISPOSITIONS": "Dispositions", + "VOICEDISPOSITIONS": "Voice Dispositions", + "NEW_VOICEDISPOSITION": "New Voice Disposition", + "CUSTOM_FIELDS": "Custom Fields", + "ADD_LIST": "Add List", + "BACK": "Back", + "SELECTED": "Selected", + "SELECT_ALL": "Select All", + "SELECT_NONE": "Select None", + "COMPANIES": "Companies", + "EDIT_COMPANY": "Edit Company", + "DELETE_COMPANY": "Delete Company", + "PHONE": "Phone", + "EMAIL": "Email", + "ADD_COMPANY": "Add Company", + "CONTACTS": "Contacts", + "NEW_LIST": "New List", + "FIRSTNAME": "First Name", + "LASTNAME": "Last Name", + "LIST": "List", + "COMPANY": "Company", + "ADD_CONTACT": "Add Contact", + "EDIT_CONTACT": "Edit Contact", + "MERGE_CONTACT": "Merge Contact", + "DUPLICATE_CONTACT": "Duplicate Contact", + "DELETE_CONTACT": "Delete Contact", + "CREATED_AT": "Created At", + "SAVE": "Save", + "DETAIL": "Detail", + "PERSONAL_INFO": "Personal Info", + "MOBILE": "Mobile", + "FAX": "Fax", + "TAGS": "Tags", + "SHOW_ALL_FIELDS": "Show all fields", + "FEWER_FIELDS": "Show less fields", + "COUNTRY": "Country", + "CITY": "City", + "STREET": "Street", + "POSTALCODE": "Postal Code", + "DELETE": "Delete", + "DELETE_ALL": "Delete All", + "CONTACTMANAGER": "Contacts Manager", + "ID": "Id", + "SETTINGS": "Settings", + "GENERAL": "General", + "CUSTOMFIELDS": "Custom Fields", + "NO_CUSTOMFIELD_AVAILABLE": "No Custom Fields available", + "ADD_TAG": "Add Tag", + "NO_TAG": "No Tags", + "ALIAS": "Alias", + "CLICKTOACTION": "Click to action", + "ACTIONTYPE": "Action type", + "TYPE": "Type", + "VALUE": "Value", + "ADD_CUSTOMFIELD": "Add Custom Field", + "EDIT_CUSTOMFIELD": "Edit Custom Field", + "DELETE_CUSTOMFIELD": "Delete Custom Field", + "NEW_COMPANY": "New Company", + "NEW_CONTACT": "New Contact", + "NEW_TAG": "New Tag", + "UPLOAD_CONTACTS": "Upload Contacts", + "FINISH": "Finish", + "SUCCESS": "Success", + "FAILURE": "Failure", + "ALL_CONTACTS": "All Contacts", + "NEW_CUSTOMFIELD": "New Custom Field", + "NO_VOICEDISPOSITION_AVAILABLE": "No Voice Dispositions available", + "ADD_VOICEDISPOSITION": "Add Voice Disposition", + "EDIT_VOICEDISPOSITION": "Edit Voice Disposition", + "DELETE_VOICEDISPOSITION": "Delete Voice Disposition", + "VAT": "VAT", + "COMPANYID": "Company ID", + "WEBSITE": "Website", + "EMAIL_DOMAIN": "Email Domain", + "ADDRESS": "Address", + "POSTAL_CODE": "Postal Code", + "SHIPMENTADDRESS": "Shipment Address", + "COPY_CONTACT": "Copy Contact", + "GOTOCONTACTS_LIST": "Show Contacts", + "GOTOCONTACTS_COMPANY": "Show Contacts", + "ADD_AGENT_TO_LIST": "Add Agent to List", + "AGENTADD_LIST": "Add Agents to List", + "NO_AVAILABLE_INFO": "No available info", + "NONE": "None", + "ALL": "All", + "FULLNAME": "Full Name", + "CHECK_DUPLICATES": "Check Duplicates", + "DUPLICATES": "Duplicates", + "UPLOAD_CSV": "Upload CSV", + "TAG": "Tag", + "UPLOAD": "Upload", + "ALL_AGENTS": "All Agents", + "SELECTED_AGENTS": "Selected Agents", + "DATE_OF_BIRTH": "Birthdate", + "DATEOFBIRTH": "Birthdate", + "NOTES": "Notes", + "EXPORTCSVCONTACTS_LIST": "Export to CSV", + "GOTO_LIST": "Show Contacts", + "GOTO_COMPANY": "Show Contacts", + "REQUIRED": "Required", + "GLOBALCUSTOMFIELDS": "Global Custom Fields", + "NEW_GLOBALCUSTOMFIELD": "New Custom Fields", + "ADD_GLOBALCUSTOMFIELD": "Add Custom Field", + "EDIT_GLOBALCUSTOMFIELD": "Edit Custom Field", + "DELETE_GLOBALCUSTOMFIELD": "Delete Custom Field", + "JSCRIPTY": "Jscripty", + "SESSIONS": "Sessions", + "AGENT": "Agent", + "PROJECT": "Project", + "SELECT_LIST": "Select a list", + "SELECT_COMPANY": "Select a company", + "SELECT_TAGS": "Select one or more tags", + "HELP": { + "PHONEBAR_API_MESSAGE": "To enable click-to-call, insert a phone number and check the remote control switch for the Agent is turned on", + "PHONEBAR_API": "To enable click-to-call, insert a phone number and check the remote control switch for the Agent is turned on" + }, + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "OF": "of", + "SOCIAL": "Social", + "ROW": "Row", + "EXPORT_ERRORS": "Export Errors", + "UPLOAD_COMPLETED": "Upload Completed", + "STOP": "Stop", + "SELECT_FILE": "Select File", + "BILLINGINFORMATION": "Billing Information", + "FLATDISCOUNT": "Company Discount", + "EUROPE": "Europe", + "ISOCODE": "ISO National Code", + "VATNUMBER_CF": "Codice Fiscale/VAT", + "PIVA": "VAT Number", + "SDICODE": "SDI Code", + "EXPIREDAY": "Expiration Days", + "INVOICEARTICLE": "Law Articles", + "PAYMENTMETHOD": "Payment Method", + "SOCIAL_CAPITAL": "Share Capital", + "COMPANY_FISCAL_TYPE": "Company Fiscal Type", + "RELATIONSHIP": "Relationship ...", + "RELATIONSHIPCOMPANY": " ... with", + "CREATE": "Create", + "RECALLME": "Recall Me", + "NOTIFICATIONS": { + "NO_DATA_ERROR": "Unable to retrieve any data", + "INTERACTION_OPEN_ERROR": "Unable to open the interaction", + "ACCOUNTS_GET_ERROR": "Unable to retrieve any {{channel}} account", + "JSCRIPTY_GET_ERROR": "Unable to retrieve any Jscripty project" + } + } +} diff --git a/public/app/main/apps/contactmanager/i18n/pt-BR.json b/public/app/main/apps/contactmanager/i18n/pt-BR.json index df501db..8dae8b1 100644 --- a/public/app/main/apps/contactmanager/i18n/pt-BR.json +++ b/public/app/main/apps/contactmanager/i18n/pt-BR.json @@ -2,7 +2,7 @@ "CONTACTMANAGER": { "SELECT_TAG": "Selecione Tags", "CUSTOMER_JOURNEY": "Jornada do Cliente", - "USERID": "Lembrar ID do Agente", + "USERID": "Recall Agent ID", "PRIORITY": "Prioridade", "MOTIONDIALER": "Motion Bull", "IMPORT_CONTACTS": "Importar Contatos", @@ -18,8 +18,8 @@ "ENDTIME": "Fim", "MOTION_BULL": "Motion Bull", "HOPPER": "Funil", - "FINAL": "Final do Funil", - "HISTORY": "Histórico do Funil", + "FINAL": "Final", + "HISTORY": "Histórico", "SCHEDULEDAT": "Agendado em", "SEARCH_FOR_ANYONE": "Procurar", "EDIT_LIST": "Editar Lista", @@ -37,7 +37,7 @@ "ALIAS_REQUIRED": "Campo obrigatório", "VALUE_REQUIRED": "Campo obrigatório", "EMAIL_MUST_VALID": "Formato incorreto", - "PHONEBAR_API": "Verifique se o MotionBar está em execução e se o interruptor do controle remoto do agente está ligado", + "PHONEBAR_API": "Verifique se o MotionBar está em execução e se foi ativado o controle remoto.", "ACTIONTYPE_REQUIRED": "Campo obrigatório", "CLICKTOACTION_REQUIRED": "Campo obrigatório" }, @@ -84,7 +84,7 @@ "POSTALCODE": "CEP", "DELETE": "Excluir", "DELETE_ALL": "Excluir Tudo", - "CONTACTMANAGER": "Mailing", + "CONTACTMANAGER": "Gestor Contatos", "ID": "Id", "SETTINGS": "Configurações", "GENERAL": "Geral", @@ -101,12 +101,12 @@ "NEW_COMPANY": "Nova Empresa", "NEW_CONTACT": "Novo Contato", "NEW_TAG": "Nova Tag", - "UPLOAD_CONTACTS": "Atualizar Contatos", + "UPLOAD_CONTACTS": "Upload Contatos", "FINISH": "Terminar", "SUCCESS": "Sucesso", "FAILURE": "Falha", "ALL_CONTACTS": "Todos os Contatos", - "NEW_CUSTOMFIELD": "Novo campo Personalizado", + "NEW_CUSTOMFIELD": "Novo Campo Personalizado", "NO_VOICEDISPOSITION_AVAILABLE": "Nenhuma Disposição de Voz Disponível", "ADD_VOICEDISPOSITION": "Adicionar Disposição de Voz", "EDIT_VOICEDISPOSITION": "Editar Disposição de Voz", @@ -128,7 +128,7 @@ "FULLNAME": "Nome Completo", "CHECK_DUPLICATES": "Verificar Duplicados", "DUPLICATES": "Duplicados", - "UPLOAD_CSV": "Envio CSV", + "UPLOAD_CSV": "Upload CSV", "TAG": "Tag", "UPLOAD": "Envio", "ALL_AGENTS": "Todos os Agentes", @@ -153,8 +153,8 @@ "SELECT_COMPANY": "Selecione Empresa", "SELECT_TAGS": "Selecione uma ou mais Tags", "HELP": { - "PHONEBAR_API_MESSAGE": "Para ativar o recurso clique para ligar, insira um número de telefone e verifique se a chave de controle remoto do agente está ativada", - "PHONEBAR_API": "Para ativar o recurso clique para ligar, insira um número de telefone e verifique se a chave de controle remoto do agente está ativada" + "PHONEBAR_API_MESSAGE": "Para habilitar click-to-call, insira o telefone e verifique se o controle remoto esta ativo.", + "PHONEBAR_API": "Para habilitar click-to-call, insira o telefone e verifique se o controle remoto esta ativo." }, "PAGE": "Página", "ROWSPERPAGE": "Linhas por Página", @@ -166,29 +166,29 @@ "STOP": "Pare", "SELECT_FILE": "Selecione o Arquivo", "ALL": "Tudo", - "BILLINGINFORMATION": "Informações de pagamento", + "BILLINGINFORMATION": "Informações de Pagamento", "COMPANY_FISCAL_TYPE": "Tipo Fiscal da Empresa", "CREATE": "Crio", "EUROPE": "Europa", "EXPIREDAY": "Dias de Vencimento", - "FLATDISCOUNT": "Desconto da empresa", - "INVOICEARTICLE": "Artigos de Direito", - "ISOCODE": "Código Nacional ISO", + "FLATDISCOUNT": "Desconto da Empresa", + "INVOICEARTICLE": "Law Articles", + "ISOCODE": "Código ISO", "PAYMENTMETHOD": "Forma de pagamento", "PIVA": "Número de IVA", "RELATIONSHIP": "Relacionamento ...", "RELATIONSHIPCOMPANY": " ... com", "SDICODE": "Código SDI", - "SOCIAL_CAPITAL": "Capital social", - "VATNUMBER_CF": "Codice Fiscale / IVA", + "SOCIAL_CAPITAL": "Capital Social", + "VATNUMBER_CF": "Código Fiscal / IVA", "RECALLME": "Lembre-me", - "ACTIONTYPE": "Tipo de acão", - "CLICKTOACTION": "Clique para ação", - "ADDITIONAL_PHONES": "Telefones adicionais", - "UPDATE_EXISTING_CONTACTS": "Atualizar contatos existentes", + "ACTIONTYPE": "Tipo de Acão", + "CLICKTOACTION": "Clique para Ação", + "ADDITIONAL_PHONES": "Telefones Adicionais", + "UPDATE_EXISTING_CONTACTS": "Atualizar Contatos Existentes", "DIALTIMEZONE": "Disque fuso horário", - "TIMEZONE": "Disque fuso horário", - "MOVE_DOWN": "Mover para baixo", - "MOVE_UP": "Subir" + "TIMEZONE": "Fuso Horário", + "MOVE_DOWN": "Mover para Baixo", + "MOVE_UP": "Mover para Cima" } } diff --git a/public/app/main/apps/dashboards/i18n/ar.json b/public/app/main/apps/dashboards/i18n/ar.json index b372a50..dd64bf1 100644 --- a/public/app/main/apps/dashboards/i18n/ar.json +++ b/public/app/main/apps/dashboards/i18n/ar.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "هاتف الاتصال", "RECALLME_CALL_REMINDER": "تذكرني مكالمة تذكير", "SCHEDULED_TIME": "جدول زمني", - "UPCOMING_RECALLME_CALL": "القادمة تذكرني المكالمة" + "UPCOMING_RECALLME_CALL": "القادمة تذكرني المكالمة", + "WAITING_CALLS": "انتظار المكالمات", + "WAITING_INTERACTIONS": "انتظار التفاعلات" } } diff --git a/public/app/main/apps/dashboards/i18n/bs.json b/public/app/main/apps/dashboards/i18n/bs.json index 3169c3f..35e22cc 100644 --- a/public/app/main/apps/dashboards/i18n/bs.json +++ b/public/app/main/apps/dashboards/i18n/bs.json @@ -1,594 +1,596 @@ { "DASHBOARDS": { - "VISIBILITY": "Visibility", - "PUBLIC": "Public", - "PRIVATE": "Private", - "PUBLIC_INTERACTION": "The interaction is public", - "LOST_CONNECTION": "Experiencing network connectivity issues. Please check your internet connection.", - "SCHEDULED_CALLS": "Scheduled Calls", - "DOWNLOAD": "Download", - "DOWNLOAD_WITH_ATTACHMENTS": "Download with attachments", - "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download without attachments", - "UNMANAGED_RATE": "Unmanaged Rate", - "UPCOMING_RECALLME_CALL": "Upcoming Recall Me call", - "RECALLME_CALL_REMINDER": "Recall Me call reminder", - "CONTACT_NAME": "Contact Name", - "CONTACT_PHONE": "Contact Phone", - "SCHEDULED_TIME": "Scheduled time", - "LIST_NAME": "List name", - "UNMANAGED_RATE_TEXT": "Interactions Unmanaged Rate", - "VOICE_WAITING": "WAITING", - "VOICE_WAITING_TEXT": "WAITING QUEUE CALLS", - "VOICE_TALKING": "TALKING", - "VOICE_TALKING_TEXT": "ACTIVE QUEUE CALLS", - "VOICE_ANSWERED": "ANSWERED", - "VOICE_ANSWERED_TEXT": "ANSWERED QUEUE CALLS", - "VOICE_ABANDONED": "ABANDONED", - "VOICE_ABANDONED_TEXT": "ABANDONED QUEUE CALLS", - "VOICE_TOTAL_OFFERED": "TOTAL OFFERED", - "VOICE_TOTAL_OFFERED_TEXT": "TOTAL QUEUE CALLS", - "TODAY_INTERACTIONS_STATS": "Interactions Daily Stats", - "DIAL_TIMEZONE": "Dial timezone", - "VOICE_AVG_HOLD_TIME": "AVERAGE HOLD TIME", - "VOICE_AVG_HOLD_TIME_TEXT": "QUEUE CALLS AVG HOLD TIME", - "VOICE_AVG_TALK_TIME": "AVERAGE TALK TIME", - "VOICE_AVG_TALK_TIME_TEXT": "QUEUE CALLS TALK TIME", - "VOICE_ANSWER_RATE": "ANSWER RATE", - "VOICE_ANSWER_RATE_TEXT": "QUEUE CALLS ANSWER RATE", - "VOICE_ABANDON_RATE": "ABANDON RATE", - "VOICE_ABANDON_RATE_TEXT": "QUEUE CALLS ABANDON RATE", - "VOICE_UNMANAGED": "UNMANAGED", - "VOICE_UNMANAGED_TEXT": "UNMANAGED QUEUE CALLS", - "OPENED_TEXT": "Opened Interactions", - "MANAGED": "Managed", - "MANAGED_TEXT": "Managed Interactions", - "ABANDONED": "Abandoned", - "ABANDONED_TEXT": "Abandoned Interactions", - "ABANDONED_RATE": "Abandoned Rate", - "ABANDONED_RATE_TEXT": "Interactions Abandon Rate", - "SYSTEM_TIME": "System time", - "TOTAL_OFFERED": "Total Offered", - "TOTAL_OFFERED_TEXT": "Offered Interactions", - "AVG_HOLD_TIME_TEXT": "Interactions AVG Hold Time", - "MANAGED_RATE": "Managed Rate", - "MANAGED_RATE_TEXT": "Interactions Managed Rate ", - "AVG_MANAGED_TIME": "AVG Management Time", - "AVG_MANAGED_TIME_TEXT": "Interactions AVG Management Time", - "NO_DISPOSITION_SET": "No disposition set", - "AGENTS": "Agents", - "TRANSFER": "Transfer", - "NO_DATA_AVAILABLE": "No data available", - "CUSTOMER_JOURNEY": "Customer Journey", - "ME": "Me", - "CURRENTLY_IN_USE_BY": "Currently in use by", - "NOTAVAILABLE": "Not available", - "CLICKRELOAD": "New abandoned calls! Reload please", - "ASSIGNTO": "Assign to", - "SELECT_QUEUE": "Select Queue", - "SELECT_CAMPAIGN": "Select Queue", - "FREE": "Free", - "RESERVED": "Reserved", - "QUEUECALLEREXITREASON": "Reason", - "QUEUECALLEREXITAT": "Dropped", - "LASTASSIGNEDTO": "Last Assigned To", - "ABANDONEDQUEUECALLS": "Abandoned Queue Calls", - "ABANDONAT": "Abandoned", + "VISIBILITY": "Vidljivost", + "PUBLIC": "Javno", + "PRIVATE": "Privatno", + "PUBLIC_INTERACTION": "Interakcija je javna", + "LOST_CONNECTION": "Problemi sa mrežnim povezivanjem. Provjerite svoju internet vezu.", + "SCHEDULED_CALLS": "Zakazani Pozivi", + "DOWNLOAD": "Preuzmi", + "DOWNLOAD_WITH_ATTACHMENTS": "Preuzmi sa prilozima", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Preuzmi bez priloga", + "UNMANAGED_RATE": "Stopa Neupravljanih", + "UPCOMING_RECALLME_CALL": "Predstojeći Recall Me poziv", + "RECALLME_CALL_REMINDER": "Recall Me podsjetnik za poziv", + "CONTACT_NAME": "Kontakt Ime", + "CONTACT_PHONE": "Kontakt Telefon", + "SCHEDULED_TIME": "Zakazano Vrijeme", + "LIST_NAME": "Naziv Liste", + "UNMANAGED_RATE_TEXT": "Stopa Neupravjanih Interakcija", + "VOICE_WAITING": "ČEKA", + "VOICE_WAITING_TEXT": "QUEUE POZIVI NA ČEKANJU", + "VOICE_TALKING": "RAZGOVARA", + "VOICE_TALKING_TEXT": "AKTIVNI QUEUE POZIVI", + "VOICE_ANSWERED": "ODGOVRENI", + "VOICE_ANSWERED_TEXT": "ODGOVORENI QUEUE POZIVI", + "VOICE_ABANDONED": "NAPUŠTENI", + "VOICE_ABANDONED_TEXT": "NAPUŠTENI QUEUE POZIVI", + "VOICE_TOTAL_OFFERED": "UKUPNO PONUĐENO", + "VOICE_TOTAL_OFFERED_TEXT": "UKUPNO QUEUE POZIVA", + "TODAY_INTERACTIONS_STATS": "Interakcije Dnevna Statistika", + "DIAL_TIMEZONE": "Vremenska Zona Biranja", + "VOICE_AVG_HOLD_TIME": "PROSJEČNO VRIJEME ČEKANJA", + "VOICE_AVG_HOLD_TIME_TEXT": "PROSJEČNO VRIJEME ČEKANJA QUEUE POZIVA", + "VOICE_AVG_TALK_TIME": "PROSJEČNO VRIJEME RAZGOVORA", + "VOICE_AVG_TALK_TIME_TEXT": "VRIJEME RAZGOVORA QUEUE POZIVA", + "VOICE_ANSWER_RATE": "STOPA ODGOVORENIH", + "VOICE_ANSWER_RATE_TEXT": "STOPA ODGOVORENIH QUEUE POZIVA", + "VOICE_ABANDON_RATE": "STOPA NAPUŠTENIH", + "VOICE_ABANDON_RATE_TEXT": "STOPA NAPUŠTENIH QUEUE POZIVA", + "VOICE_UNMANAGED": "NEUPRAVLJANO", + "VOICE_UNMANAGED_TEXT": "NEUPRAVLJANI QUEUE POZIVI", + "OPENED_TEXT": "Otvorene Interakcije", + "MANAGED": "Obrađeno", + "MANAGED_TEXT": "Obrađene Interakcije", + "ABANDONED": "Napušteno", + "ABANDONED_TEXT": "Napuštene Interakcije", + "ABANDONED_RATE": "Stopa Napuštenih", + "ABANDONED_RATE_TEXT": "Stopa Napuštenih Interakcija", + "SYSTEM_TIME": "Sistem vrijeme", + "TOTAL_OFFERED": "Ukupno Ponuđeno", + "TOTAL_OFFERED_TEXT": "Ponuđenih Interakcija", + "AVG_HOLD_TIME_TEXT": "Interakcije Prosječno Vrijeme Čekanja", + "MANAGED_RATE": "Stopa Obrađenih", + "MANAGED_RATE_TEXT": "Stopa Obrađenih Interakcija", + "AVG_MANAGED_TIME": "Prosječno Vrijeme Obrade", + "AVG_MANAGED_TIME_TEXT": "Interakcije Prosječno Vrijeme Čekanja", + "NO_DISPOSITION_SET": "Nije postavljena dispozicija", + "AGENTS": "Specijalisti", + "TRANSFER": "Prijenos", + "NO_DATA_AVAILABLE": "Nema dostupnih podataka", + "CUSTOMER_JOURNEY": "Putovanje Kupca", + "ME": "Ja", + "CURRENTLY_IN_USE_BY": "Trenutno u upotrebi od", + "NOTAVAILABLE": "Nije dostupno", + "CLICKRELOAD": "Novi napušteni pozivi! Učitaj ponovo", + "ASSIGNTO": "Dodijeli", + "SELECT_QUEUE": "Odaberi Queue", + "SELECT_CAMPAIGN": "Odaberi Queue", + "FREE": "Slobodno", + "RESERVED": "Rezervisano", + "QUEUECALLEREXITREASON": "Razlog", + "QUEUECALLEREXITAT": "Ispušteno", + "LASTASSIGNEDTO": "Posljednje Dodijeljeno", + "ABANDONEDQUEUECALLS": "Napušteni Queue Pozivi", + "ABANDONAT": "Napušteno", "QUEUE": "Queue", - "SELECT_SUBSTATUS": "Select Substatus", - "READ": "Read", - "UNREAD": "Unread", - "SELECT_READ_UNREAD": "Select Read/Unread", - "SELECT_AGENT": "Select Agent", - "MARK_AS_UNREAD": "Mark as unread", - "FILTER_VOICE_QUEUES": "Filter Voice Queues", - "FILTER_CHAT_WEBSITES": "Filter Chat Websites", - "FILTER_SMS_ACCOUNTS": "Filter Sms Accounts", - "FILTER_FAX_ACCOUNTS": "Filter Fax Accounts", - "FILTER_OPENCHANNEL_ACCOUNTS": "Filter Openchannel Accounts", - "FILTER_MAIL_ACCOUNTS": "Filter Mail Accounts", - "FILTER_WHATSAPP_ACCOUNTS": "Filter Whatsapp Accounts", - "SETFILTERS": "Set Filters", - "FILTERS": "Filters", - "CONFIRM": "Confirm", - "CHANNEL_WAITING_TEXT": "Waiting Queue Interactions", + "SELECT_SUBSTATUS": "Odaberi Podstatus", + "READ": "Pročitajte", + "UNREAD": "Nepročitano", + "SELECT_READ_UNREAD": "Odaberi Pročitano/Nepročitano", + "SELECT_AGENT": "Odaberi Specijalistu", + "MARK_AS_UNREAD": "Označi kao nepročitano", + "FILTER_VOICE_QUEUES": "Filtriraj Voice Queues", + "FILTER_CHAT_WEBSITES": "Filtriraj Chat Websites", + "FILTER_SMS_ACCOUNTS": "Filtriraj SMS RačuneNaloge", + "FILTER_FAX_ACCOUNTS": "Filtriraj Fax Naloge", + "FILTER_OPENCHANNEL_ACCOUNTS": "Filtriraj Otvoreni kanal Naloge", + "FILTER_MAIL_ACCOUNTS": "Filtriraj Mail Račune", + "FILTER_WHATSAPP_ACCOUNTS": "Filtriraj Whatsapp Naloge", + "SETFILTERS": "Postafi Filtere", + "FILTERS": "Filteri", + "CONFIRM": "Potvrdi", + "CHANNEL_WAITING_TEXT": "Waiting Queue Interakcija", "CHANNEL_QUEUE": "Queue", - "CHANNEL_FROM": "From", - "LOADING_INTERACTION": "We are loading the interaction...", - "JANUARY": "January", - "FEBRUARY": "February", - "MARCH": "March", + "CHANNEL_FROM": "Od", + "LOADING_INTERACTION": "Učitavamo interakciju...", + "JANUARY": "Januar", + "FEBRUARY": "Februar", + "MARCH": "Mart", "APRIL": "April", - "MAY": "May", - "JUNE": "June", - "JULY": "July", + "MAY": "Maj", + "JUNE": "Juni", + "JULY": "Juli", "AUGUST": "August", - "SEPTEMBER": "September", - "OCTOBER": "October", - "NOVEMBER": "November", - "DECEMBER": "December", - "MON": "Mon", - "TUE": "Tue", - "WED": "Wed", - "THU": "Thu", - "FRI": "Fri", - "SAT": "Sat", - "SUN": "Sun", - "DELETE": "Delete", - "LAST_3_DAYS": "Last 3 Day", - "LAST_YEAR": "Last Year", - "THIS_YEAR": "This Year", - "LAST_MONTH": "Last Month", - "THIS_MONTH": "This Month", - "LAST_WEEK": "Last Week", - "THIS_WEEK": "This Week", - "YESTERDAY": "Yesterday", - "TODAY": "Today", - "SELECT_DATE": "Select Start Date", + "SEPTEMBER": "Septembar", + "OCTOBER": "Oktobar", + "NOVEMBER": "Novembar", + "DECEMBER": "Decembar", + "MON": "Pon", + "TUE": "Uto", + "WED": "Sri", + "THU": "Čet", + "FRI": "Pet", + "SAT": "Sub", + "SUN": "Ned", + "DELETE": "Ibriši", + "LAST_3_DAYS": "Zadnja 3 Dana", + "LAST_YEAR": "Zadnja Godina", + "THIS_YEAR": "Ova Godina", + "LAST_MONTH": "Zadnji Mjesec ", + "THIS_MONTH": "Ovaj Mjesec", + "LAST_WEEK": "Zadnja Sedmica", + "THIS_WEEK": "Ova Sedmica", + "YESTERDAY": "Juče", + "TODAY": "Danas", + "SELECT_DATE": "Odaberi Datum Početka", "HOME": "Home", - "SET_AS": "Set As", - "PENDING": "Pending", - "CANNED_ANSWER_NOT_FOUND": "No Canned Answers were found", - "CANNED_ANSWER_SEARCH": "Enter a text to search a Canned Answer", - "TAGS": "Tags", - "SELECT_TAG": "Select Tag", - "TYPE": "Type", - "SOURCE": "Source", - "DESTINATION": "Destination", - "CALLERID": "Caller ID", - "END_AT": "End At", - "DURATION": "Duration", + "SET_AS": "Postavo Kao", + "PENDING": "Na čekanju", + "CANNED_ANSWER_NOT_FOUND": "Nisu pronađeni Pripremljeni Odgovori", + "CANNED_ANSWER_SEARCH": "Unesi tekst za pretraživanje Pripremljenih Odgovora", + "TAGS": "Tag-ovi", + "SELECT_TAG": "Odaberi Tag", + "TYPE": "Vrsta", + "SOURCE": "Izvor", + "DESTINATION": "Destinacija", + "CALLERID": "Pozivatelj ID", + "END_AT": "Završi Sa", + "DURATION": "Trajanje", "CHAT": "Chat", - "MAIL": "Email", - "SMS": "Sms", - "OPENCHANNEL": "Open Channel", + "MAIL": "E-mail", + "SMS": "SMS", + "OPENCHANNEL": "Otvoreni Kanal", "FAX": "Fax", - "NOT_ASSIGNED": "Not Assigned", - "UNKNOWN": "Unknown", - "SELECT_USER": "Select User", - "LAST_MESSAGE": "Last message", - "USER": "User", - "RATING": "Rating", - "FEEDBACK": "Feedback", - "SUBJECT": "Subject", - "CUSTOMER_IP": "Originating IP Address", - "REFERER": "Referer", - "ACCOUNT": "Account", + "NOT_ASSIGNED": "Nije Dodijeljeno", + "UNKNOWN": "Nepoznato", + "SELECT_USER": "Odaberi Korisnika", + "LAST_MESSAGE": "Zadnja Poruka", + "USER": "Korisnik", + "RATING": "Ocjena", + "FEEDBACK": "Povratne informacije", + "SUBJECT": "Predmet", + "CUSTOMER_IP": "Izvorna IP Adresa", + "REFERER": "Referent", + "ACCOUNT": "Nalog", "WEBSITE": "Website", - "AGENT": "Agent", - "CREATED_AT": "Created At", - "CLOSED_AT": "Closed At", - "DISPOSITION": "Disposition", - "CONTACT": "Contact", - "INTERACTION": "Interaction", - "BROWSER_NAME": "Browser Name", - "BROWSER_VERSION": "Browser Version", - "OS_NAME": "Operating System Name", - "OS_VERSION": "Operating System Version", - "DEVICE_MODEL": "Device Model", - "DEVICE_VENDOR": "Device Vendor", - "DEVICE_TYPE": "Device Type", - "RECALLME": "Recall Me", - "DROP_RATE": "Drop Rate", - "DROPPED": "Dropped", - "DROPPED_TEXT": "Dropped Queue Calls", - "DETAIL": "Detail", + "AGENT": "Specijalist", + "CREATED_AT": "Stvoreno U", + "CLOSED_AT": "Zatvoreno U", + "DISPOSITION": "Dispozicija", + "CONTACT": "Kontakt", + "INTERACTION": "Interakcija", + "BROWSER_NAME": "Naziv Pretraživača", + "BROWSER_VERSION": "Verzija Pretraživača", + "OS_NAME": "Naziv Operativnog Sistema", + "OS_VERSION": "Verzija Operativnog Sistema", + "DEVICE_MODEL": "Model Uređaja", + "DEVICE_VENDOR": "Prodavač Uređaja", + "DEVICE_TYPE": "Tip Uređaja", + "RECALLME": "Recall me", + "DROP_RATE": "Stopa Prekinutih", + "DROPPED": "Prekinut", + "DROPPED_TEXT": "Prekinuti Queue Pozivi", + "DETAIL": "Detalj", "MOTION_BULL": "Motion Bull", - "LIMITED": "Limited", - "LIMITED_TEXT": "IVR Campaigns Calls Originated/Limit", - "DASHBOARDS": "Dashboards", - "RECORDINGS": "Recordings", - "TODAY_MOTION_BULL_STATS": "Queue Campaigns Daily Stats", - "ORIGINATED": "Originated", - "ORIGINATED_TEXT": "Queue Calls Originated", - "UPDATE": "Update", - "MORE": "More", + "LIMITED": "Ograničeno", + "LIMITED_TEXT": "IVR Pozivi Kampanje Izazvani/Limit", + "DASHBOARDS": "Nadzorne ploče", + "RECORDINGS": "Snimci", + "TODAY_MOTION_BULL_STATS": "Motion Bull Dnevna Statistika", + "ORIGINATED": "Porijeklo", + "ORIGINATED_TEXT": "Porijeklo Queue Poziva", + "UPDATE": "Ažuriraj", + "MORE": "Više", "MOTIONDIALER": "Motion Bull", - "DISPOSE": "Dispose", + "DISPOSE": "Odložiti", "QUEUES": "Queues", - "DIALER_CALL": "Dialer Call", - "ELAPSED_TIME": "Elapsed Time", - "EDIT": "Edit", - "MERGE": "Merge", - "DUPLICATE": "Duplicate", - "UNIQUEID": "Uniqueid", - "AUTOCLOSE": "Automatically close contact tab after disposal", - "CAMPAIGN": "Campaign", - "NONE": "None", - "NAME": "Name", - "ANSWER_MACHINE": "Answer Machine", - "INTERESTED": "Interested", - "NOT_INTERESTED": "Not Interested", - "PERSONAL_INFO": "Personal Info", - "SOLD": "Sold", - "SPECIAL": "Special", + "DIALER_CALL": "Poziv Birača", + "ELAPSED_TIME": "Proteklo Vrijeme", + "EDIT": "Uredi", + "MERGE": "Spoji", + "DUPLICATE": "Duplikat", + "UNIQUEID": "Jedinstveni ID", + "AUTOCLOSE": "Automatski zatvori kontakt tab nakon dispozicije", + "CAMPAIGN": "Kampanja", + "NONE": "Ništa", + "NAME": "Ime", + "ANSWER_MACHINE": "Telefonska Sekretarica", + "INTERESTED": "Zainteresovan", + "NOT_INTERESTED": "Nezainteresovan", + "PERSONAL_INFO": "Lični Podaci", + "SOLD": "Prodato", + "SPECIAL": "Specijalno", "BLACKLIST": "Blacklist", - "RESCHEDULE": "Reschedule", - "FIRSTNAME": "Firstname", - "LASTNAME": "Lastname", - "MOBILE": "Mobile", - "DATE_OF_BIRTH": "Birthdate", - "COMPANY": "Company", + "RESCHEDULE": "Pomjeri raspored", + "FIRSTNAME": "Ime", + "LASTNAME": "Prezime", + "MOBILE": "Mobilni", + "DATE_OF_BIRTH": "Datum rođenja", + "COMPANY": "Kompanija", "TAG": "Tag", - "COUNTRY": "Country", - "CITY": "City", - "STREET": "Address", - "POSTALCODE": "Postal Code", - "CUSTOM_FIELDS": "Custom Fields", - "GENERAL": "General", + "COUNTRY": "Država", + "CITY": "Grad", + "STREET": "Adresa", + "POSTALCODE": "Poštanski Broj", + "CUSTOM_FIELDS": "Prilagođena Polja", + "GENERAL": "Općenito", "VOICE": "Voice", - "TODAY_IVR_CAMPAIGNS_STATS": "Daily Ivr Campaigns Stats", - "TODAY_INBOUND_STATS": "Inbound Queue Daily Stats", - "TODAY_OUTBOUND_STATS": "Outbound Daily Stats", - "WAITING": "Waiting", - "TALKING": "Talking", - "INBOUND_ANSWERED": "Answered", - "OUTBOUND_ANSWERED": "Answered", - "AVG_HOLD_TIME": "Average Hold Time", - "INBOUND_ANSWER_RATE": "Answer Rate", - "OUTBOUND_ANSWER_RATE": "Answer Rate", - "ABANDON_RATE": "Abandon Rate", - "UNMANAGED": "Unmanaged", - "TOTAL": "Total", - "TOT_DURATION": "Total Duration", - "AVG_DURATION": "Average Duration", + "TODAY_IVR_CAMPAIGNS_STATS": "IVR Kampanje Dnevna Statistika", + "TODAY_INBOUND_STATS": "Dolazni Dnevna Statistika", + "TODAY_OUTBOUND_STATS": "Odlazni Dnevna Statistika", + "WAITING": "ČEKA", + "TALKING": "Priča", + "INBOUND_ANSWERED": "Odgovoreno", + "OUTBOUND_ANSWERED": "Odgovoreno", + "AVG_HOLD_TIME": "Prosječno Vrijeme Čekanja", + "INBOUND_ANSWER_RATE": "Stopa Odgovora", + "OUTBOUND_ANSWER_RATE": "Stopa Odgovorenih", + "ABANDON_RATE": "Stopa Napuštenih", + "UNMANAGED": "Neupravljano", + "TOTAL": "Ukupno", + "TOT_DURATION": "Ukupno trajanje", + "AVG_DURATION": "Prosječno Trajanje", "HELP": { - "MANDATORY_DISPOSITION_ENABLED": "Mandatory disposition enabled for this account", - "UNMANAGED_RATE": "The Unmanaged Rate of all the Interactions", - "WAITING": "The total number of Waiting Interactions", - "OPENED": "The total number of Active Interactions", - "MANAGED": "The total number of Completed Interactions", - "ABANDONED": "The total number of Abandoned Interactions", - "TOTAL_OFFERED": "The total number of Interactions (completed + abandoned)", - "AVG_HOLD_TIME": "The Average Interaction Hold Time, namely the average time spent waiting for an agent to answer, for all the existing Interactions", - "AVG_MANAGED_TIME": "The Average Interaction Managed Time, namely the average time spent during conversation", - "MANAGED_RATE": "The Managed Rate of all the Interactions", - "ABANDONED_RATE": "The Abandon Rate of all the Interactions", - "UNMANAGED": "The total number of Unmanaged Interactions", - "VOICE_WAITING": "The total number of Waiting Queue Calls, for all the existing Queues", - "VOICE_TALKING": "The total number of Active Queue Calls, for all the existing Queues", - "VOICE_ANSWERED": "The total number of Completed Queue Calls, for all the existing Queues", - "VOICE_ABANDONED": "The total number of Abandoned Queue Calls, considering all the existing Queues. Note that the calls which are abandoned for timeout and joinempty will not be considered", - "VOICE_TOTAL_OFFERED": "The total number of Queue Calls (completed + abandoned + unmanaged in the last queue of the flow). Note that the calls which enter in an IVR and not in a queue, will not be considered", - "VOICE_AVG_TALK_TIME": "The Average Queue Talk Time, namely the average time spent during conversation, for all the existing Queues", - "VOICE_AVG_HOLD_TIME": "The Average Queue Hold Time, namely the average time spent waiting for an agent to answer, for all the existing Queues", - "VOICE_ANSWER_RATE": "The Answer Rate of all the Queue Calls", - "VOICE_UNMANAGED": "The total number of Unmanaged Queue Calls, for all the existing Queues. It includes the calls which are abandoned for timeout, joinempty, leavewhenempty and exitwithkey (cfr. asterisk doc for more information)", - "ORIGINATED": "Total number of calls dialed in the queue campaigns", - "ORIGINATEDLIMITED": "IVR Campaigns Calls Originated/Limit", - "DROPPED": "The total number of Dropped Queue Calls, for all the existing Queues", - "DROP_RATE": "The Drop Rate of all the Queue Calls", - "OUTBOUND_ANSWERED": "The total number of Completed Outbound Calls", - "OUTBOUND_ANSWER_RATE": "The Answer Rate of all the Outbound Calls", - "ABANDON_RATE": "The Abandon Rate of all the Queue Calls", - "TOTAL": "The total number of Outbound Calls", - "TOT_DURATION": "The total duration of all the Outbound Calls", - "AVG_DURATION": "The average duration of all the Completed Outbound Calls", - "EXACT_MATCH_FILTER": "Search for an exact match", - "LIKE_FILTER": "Search for the specified pattern" + "MANDATORY_DISPOSITION_ENABLED": "Obavezna dispozicija uključena za ovaj račun", + "UNMANAGED_RATE": "Stopa Neupravljanih od svih Interakcija", + "WAITING": "Ukupan broj Interakcija na Čekanju", + "OPENED": "Ukupan broj Aktivnih Interakcija", + "MANAGED": "Ukupan broj Završenih Interakcija", + "ABANDONED": "Ukupan broj Napuštenih Interakcija", + "TOTAL_OFFERED": "Ukupan broj interakcija (Završenih + Napuštenih)", + "AVG_HOLD_TIME": "Prosječno Vrijeme Čekanja, odnosno prosječno vrijeme provedeno čekajući da specijalist odgovori, za sve postojeće Interakcije", + "AVG_MANAGED_TIME": "Prosječno Vrijeme Obrade, odnosno prosječno vrijeme provedeno tokom razgovora", + "MANAGED_RATE": "Stopa Obrade od svih Interakcija", + "ABANDONED_RATE": "Stopa Napuštanja od svih Interakcija", + "UNMANAGED": "Ukupan broj Neupravljanih Interakcija", + "VOICE_WAITING": "Ukupan broj Čekajućih Queue Poziva, za sve postojeće Queues", + "VOICE_TALKING": "Ukupan broj Aktivnih Queue Poziva, za sve postojeće Queues", + "VOICE_ANSWERED": "Ukupan broj Završenih Queue Poziva, za sve postojeće Queues", + "VOICE_ABANDONED": "Ukupan broj Napuštenih Queue Poziva, uzimajući u obzir sve postojeće Queues. Imaj na umu da pozivi koji su napuštenih zbog timeout-a i joinempty neće biti uzeti u obzir", + "VOICE_TOTAL_OFFERED": "Ukupan broj Queue Poziva (Završeni + Napušteni + Neupravljani u posljednjem queueflow). Imaj na umu da pozivi koji ulaze u IVR, a ne Queue, neće biti uzeti u obzir", + "VOICE_AVG_TALK_TIME": "Prosječno Queue Vrijeme Razgovora, odnosno prosječno vrijeme provedeno u konverzaciji, za sve postojeće Queues", + "VOICE_AVG_HOLD_TIME": "Prosječno Queue Vrijeme Čekanja, odnosno prosječno vrijeme provedeno čekajući da specijalista odgovori, za sve postojeće Queues", + "VOICE_ANSWER_RATE": "Stopa Odgovora od svih Queue Poziva", + "VOICE_UNMANAGED": "Ukupan broj Neupravljanih Queue Poziva, za sve postojeće Queue Pozive. Uključuje pozive koji su napušteni zbog timeout-a, joinempty, leavewhenempty and exitwithkey (pogledaj Asterisk dokumentaciju za više informacija)", + "ORIGINATED": "Ukupan broj poziva upućenih u queue kampanjama", + "ORIGINATEDLIMITED": "IVR Pozivi Kampanje Izazvani/Limit", + "DROPPED": "Ukupan broj Prekinutih Queue Poziva, za sve postojeće Queues", + "DROP_RATE": "Stopa Prekida od svih Queue Poziva", + "OUTBOUND_ANSWERED": "Ukupan broj Završenih Odlaznih Poziva", + "OUTBOUND_ANSWER_RATE": "Stopa Odgovora od svih Odlaznih Poziva", + "ABANDON_RATE": "Stopa Napuštanja od svih Queue Poziva", + "TOTAL": "Ukupan broj Odlaznih Poziva", + "TOT_DURATION": "Ukupno trajanje od svih Odlaznih Poziva", + "AVG_DURATION": "Prosječno trajanje od svih Završenih Odlaznih Poziva", + "EXACT_MATCH_FILTER": "Potraži tačno podudaranje", + "LIKE_FILTER": "Potraži specifičan uzorak" }, "ERRORS": { - "CAMPAIGN_REQUIRED": "Mandatory field", - "FIRSTNAME_REQUIRED": "Mandatory field", - "PHONE_REQUIRED": "Mandatory field", - "DISPOSITION_REQUIRED": "Mandatory field", - "AGENT_REQUIRED": "Mandatory field", - "QUEUE_REQUIRED": "Mandatory field", - "FAILED_INITIALIZATION": "Error during initialization" + "CAMPAIGN_REQUIRED": "Obavezno polje", + "FIRSTNAME_REQUIRED": "Obavezno polje", + "PHONE_REQUIRED": "Obavezno polje", + "DISPOSITION_REQUIRED": "Obavezno polje", + "AGENT_REQUIRED": "Obavezno polje", + "QUEUE_REQUIRED": "Obavezno polje", + "FAILED_INITIALIZATION": "Greška tokom inicijalizacije" }, - "NO_AVAILABLE_INFO": "No available info", - "WELCOME_TO_MOTION": "Welcome to Motion", - "WELCOME_MESSAGE": "Use the left sidebar to navigate through available sections", - "ADD": "Add", - "CONTACTMANAGER": "Contact Manager", - "DASHBOARD": "Dashboard", - "EDIT_CONTACT": "Edit contact", - "EMAIL": "Email", - "FULLNAME": "Fullname", - "CREATEDAT": "Created At", - "LIST": "List", - "NEW_CONTACT": "New Contact", - "PHONE": "Phone", - "SAVE": "Save", - "INBOUND_WAITING_CALLS": "Inbound Waiting Calls", - "CONTACTS": "Contacts", - "MYCONTACTS": "My Contacts", - "ADD_CONTACT": "Add Contact", - "RELOAD": "Reload", - "WAITING_TEXT": "Waiting Interactions", - "TALKING_TEXT": "Active Queue Calls", - "INBOUND_ANSWERED_TEXT": "Answered Queue Calls", - "DROP_RATE_TEXT": "Queue Calls Drop Rate", - "AVG_TALK_TIME_TEXT": "Queue Calls Talk Time", - "INBOUND_ANSWER_RATE_TEXT": "Queue Calls Answer Rate", - "UNMANAGED_TEXT": "Unmanaged Interactions", - "TOTAL_TEXT": "Total Outbound Calls", - "OUTBOUND_ANSWERED_TEXT": "Outbound Answered Calls", - "TOT_DURATION_TEXT": "Outbound Calls Total Duration", - "AVG_DURATION_TEXT": "Outbound Calls Average Duration", - "OUTBOUND_ANSWER_RATE_TEXT": "Outbound calls Answer Rate", - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", - "REPLY_PLACEHOLDER": "Type and hit enter to send a message", - "CONTACT_INFO": "Contact Info", - "CLOSE_AND_DISPOSE": "Close and dispose", - "DISPOSITIONS": "Dispositions", - "CLOSE_WITHOUT_DISPOSE": "Close without dispose", - "ACCEPT": "Accept", - "REJECT": "Reject", - "CLOSED": "Closed", + "NO_AVAILABLE_INFO": "Nema dostupnih informacija", + "WELCOME_TO_MOTION": "Dobrodošao u Motion", + "WELCOME_MESSAGE": "Koristi lijevu bočnu traku za navigaciju kroz dostupne odjelke", + "ADD": "Dodaj", + "CONTACTMANAGER": "Kontakt Menadžer", + "DASHBOARD": "Nadzorna ploča", + "EDIT_CONTACT": "Uredi kontakt", + "EMAIL": "E-mail", + "FULLNAME": "Puno ime", + "CREATEDAT": "Stvoreno U", + "LIST": "Lista", + "NEW_CONTACT": "Novi Kontakt", + "PHONE": "Telefon", + "SAVE": "Sačuvaj", + "INBOUND_WAITING_CALLS": "Dolazni Čekajući Pozivi", + "CONTACTS": "Kontakti", + "MYCONTACTS": "Moji Kontakti", + "ADD_CONTACT": "Dodaj Kontakt", + "RELOAD": "Ponovo učitaj", + "WAITING_TEXT": "INTERAKCIJE NA ČEKANJU", + "TALKING_TEXT": "Aktivni Queue Pozivi", + "INBOUND_ANSWERED_TEXT": "Odgovoreni Queue Pozivi", + "DROP_RATE_TEXT": "Queue Pozivi Stopa Prekinutih", + "AVG_TALK_TIME_TEXT": "Vrijeme Razgovora za Pozive u Queue", + "INBOUND_ANSWER_RATE_TEXT": "Queue Pozivi Stopa Odgovora", + "UNMANAGED_TEXT": "Neupravljane Interakcije", + "TOTAL_TEXT": "Ukupno Odlaznih Poziva", + "OUTBOUND_ANSWERED_TEXT": "Odgovoreni Odlazni Pozivi", + "TOT_DURATION_TEXT": "Odlazni Pozivi Ukupno Trajanje", + "AVG_DURATION_TEXT": "Odlazni Pozivi Prosječno Trajanje", + "OUTBOUND_ANSWER_RATE_TEXT": "Stopa Odgovorenih Odlaznih Poziva", + "PAGE": "Stranica", + "ROWSPERPAGE": "Redova po stranici", + "OF": "od", + "REPLY_PLACEHOLDER": "Unesi i pritisni enter da pošalješ poruku", + "CONTACT_INFO": "Kontakt Info", + "CLOSE_AND_DISPOSE": "Zatvori i rasporedi", + "DISPOSITIONS": "Dispozicije", + "CLOSE_WITHOUT_DISPOSE": "Zatvori bez raspoređivanja", + "ACCEPT": "Prihvati", + "REJECT": "Odbaci", + "CLOSED": "Zatvoreno", "INFO": "Info", - "NOTE": "Note", - "ACCEPT_ELSEWHERE": "Accepted elsewhere", - "ATTENTION": "Attention", - "SOCIAL": "Social", - "NO_JSCRIPTY_PROJECTS_AVAILABLE": "No Jscripty Projects available", - "OPENED": "Opened", + "NOTE": "Bilješka", + "ACCEPT_ELSEWHERE": "Prihvaćeno drugdje", + "ATTENTION": "Pažnja", + "SOCIAL": "Društveni", + "NO_JSCRIPTY_PROJECTS_AVAILABLE": "Nema dostupnih Jscripty Projekata", + "OPENED": "Otvoreno", "FILTER": "Filter", - "SELECT_STATUS": "Select Status", - "SELECT_ACCOUNT": "Select Account", - "SELECT_WEBSITE": "Select Website", - "ALL": "All", - "INTERACTIONS": "Interactions", - "STARTEDAT": "Started At", + "SELECT_STATUS": "Odaberi Status", + "SELECT_ACCOUNT": "Odaberi Nalog", + "SELECT_WEBSITE": "Odaberi Website", + "ALL": "Svi", + "INTERACTIONS": "Interakcije", + "STARTEDAT": "Počelo U", "STATUS": "Status", - "OPEN": "Open", - "SHOW": "Show", - "SHOW_DETAILS": "Show Details", - "HIDE_DETAILS": "Hide Details", - "EXTERNAL_URL": "External Link", - "NO_MAIL_ACCOUNTS_AVAILABLE": "No Email Accounts available", - "NO_FAX_ACCOUNTS_AVAILABLE": "No Fax Accounts available", - "NO_SMS_ACCOUNTS_AVAILABLE": "No SMS Accounts available", - "NO_WHATSAPP_ACCOUNTS_AVAILABLE": "No Whatsapp Account available", - "SELECT_DATE_RANGE": "Select Date Range", - "CLEAR": "Clear", - "CALL_NUMBER": "Call", - "TRANSFER_NUMBER": "Transfer", - "CALL_SAVED": "Call properly saved", - "CALL_DISPOSED": "Call properly disposed", - "CUSTOMER_PORT": "Originating TCP Port", - "INTERACTION_CLOSED": "Interaction properly closed", - "INTERACTION_DISPOSED": "Interaction properly disposed", - "INTERACTION_CLOSED_DISPOSED": "Interaction properly closed and disposed", - "SELECT_ALL": "Select all", - "ASSIGNED_TO_OTHERS": "Assigned to others", - "ID": "Id", - "CHAT_INTERACTIONS": "Chat Interactions", - "MAIL_INTERACTIONS": "Email Interactions", - "SMS_INTERACTIONS": "SMS Interactions", - "OPENCHANNEL_INTERACTIONS": "Open Channel Interactions", - "FAX_INTERACTIONS": "Fax Interactions", - "DRAFT": "Draft", - "DRAFT_SAVE_WARNING_TITLE": "Overwrite existing draft?", - "DRAFT_SAVE_WARNING_MESSAGE": "There is already a draft saved for this interaction. Are you sure you want to overwrite it?", - "OVERWRITE": "Overwrite", - "CANCEL": "Cancel", - "UNTITLED": "Untitled", - "SAVE_AS_DRAFT": "Save as draft", - "UPDATE_DRAFT": "Update draft", - "NO_AVAILABLE_INTERACTION": "No available interaction", - "DOSSIERS": "Dossiers", - "DOSSIER": "Dossier", - "DOSSIER_INFO": "Information", - "SELECT_COMPANY": "Select Company", - "DOSSIERNAME": "Dossier Name", - "OPENDATE": "Open Date", - "ALL_COMPANIES": "All Companies", - "SELECT_WORKFLOW": "Select Workflow", - "WORKFLOW": "Select Workflow", - "SELECT_WORKFLOWSTEPS": "Select Workflow State", - "ALL_WORKFLOW": "All Workflow", - "STATE": "State", - "STEP": "Step", - "NEW_DOSSIER": "New Dossier", - "PRICELIST": "Price List", - "PRODUCTFILTERNAME": "Filter Name", - "PRODUCTNAME": "Product", - "PRODUCTINQUOTATION": "PRODUCT DETAILS", - "REQUEST": "REQUEST", - "QUOTATION": "QUOTATION", - "DOSSIERID": "Dossier ID", - "QUOTATIONNAME": "Quotation Name", - "QUOTATIONNOTES": "Quotation Notes", - "QUOTATIONSTATUS": "State", - "REQUESTNAME": "Request Name", - "REQUESTNOTES": "Request Notes", - "ALL_STEP": "All", - "UPDATED_AT": "Modified on", - "BY": "By", - "ORDER": "Order", + "OPEN": "Otvoreno", + "SHOW": "Pokaži", + "SHOW_DETAILS": "Pokaži Detalje ", + "HIDE_DETAILS": "Sakrij Detalje", + "EXTERNAL_URL": "Eksterni Link", + "NO_MAIL_ACCOUNTS_AVAILABLE": "Nema dostupnih E-mail Naloga", + "NO_FAX_ACCOUNTS_AVAILABLE": "Nema dostupnih Fax Naloga", + "NO_SMS_ACCOUNTS_AVAILABLE": "Nema dostupnih SMS Naloga", + "NO_WHATSAPP_ACCOUNTS_AVAILABLE": "Nema dostupnih Whatsapp Naloga", + "SELECT_DATE_RANGE": "Odaberi Datum Raspona", + "CLEAR": "Briši", + "CALL_NUMBER": "Poziv", + "TRANSFER_NUMBER": "Prijenos", + "CALL_SAVED": "Poziv pravilno spremljen", + "CALL_DISPOSED": "Poziv pravilno zbrinut", + "CUSTOMER_PORT": "Izvorni TCP Port", + "INTERACTION_CLOSED": "Interakcija je ispravno zatvorena", + "INTERACTION_DISPOSED": "Interakcija je pravilno odložena", + "INTERACTION_CLOSED_DISPOSED": "Interakcija je ispravno zatvorena i odložena", + "SELECT_ALL": "Odaberi sve", + "ASSIGNED_TO_OTHERS": "Dodijeljeno drugima", + "ID": "ID", + "CHAT_INTERACTIONS": "Chat Interakcija", + "MAIL_INTERACTIONS": "E-mail Interakcije", + "SMS_INTERACTIONS": "SMS Interakcije", + "OPENCHANNEL_INTERACTIONS": "Interakcije Otvorenog Kanala", + "FAX_INTERACTIONS": "Fax Interakcije", + "DRAFT": "Nacrt", + "DRAFT_SAVE_WARNING_TITLE": "Zamijeni postojeći nacrt?", + "DRAFT_SAVE_WARNING_MESSAGE": "Već postoji nacrt za ovu interakciju. Jesi li siguran da ga želiš zamijeniti?", + "OVERWRITE": "Prepiši", + "CANCEL": "Otkaži", + "UNTITLED": "Bez naslova", + "SAVE_AS_DRAFT": "Sačuvaj kao nacrt", + "UPDATE_DRAFT": "Ažuriraj nacrt", + "NO_AVAILABLE_INTERACTION": "Nema dostupnih interakcija", + "DOSSIERS": "Dosjei", + "DOSSIER": "Dosije", + "DOSSIER_INFO": "Informacije", + "SELECT_COMPANY": "Odaberi Kompaniju", + "DOSSIERNAME": "Dosije Naziv", + "OPENDATE": "Datum Otvaranja", + "ALL_COMPANIES": "Sve Kompanije", + "SELECT_WORKFLOW": "Odaberi Workflow", + "WORKFLOW": "Odaberi Workflow", + "SELECT_WORKFLOWSTEPS": "Odaberi Stanje Workflow-a", + "ALL_WORKFLOW": "Sav Workflow", + "STATE": "Država", + "STEP": "Korak", + "NEW_DOSSIER": "Novi Dosije", + "PRICELIST": "Cjenik", + "PRODUCTFILTERNAME": "Naziv Filtera", + "PRODUCTNAME": "Produkt", + "PRODUCTINQUOTATION": "DETALJI O PROIZVODU", + "REQUEST": "ZAHTJEV", + "QUOTATION": "PONUDA", + "DOSSIERID": "Dosije ID", + "QUOTATIONNAME": "Naziv Ponude", + "QUOTATIONNOTES": "Bilješke Ponude", + "QUOTATIONSTATUS": "Država", + "REQUESTNAME": "Naziv Zahtjeva", + "REQUESTNOTES": "Bilješke Zahtjeva", + "ALL_STEP": "Svi", + "UPDATED_AT": "Ažurirano", + "BY": "Od", + "ORDER": "Red", "PROFORMA": "PROFORMA", - "INVOICE": "INVOICE", - "REQUESTID": "Request", - "QUOTATIONID": "Offer", - "ORDERID": "Order", - "PRICELISTNAME": "Price List", - "PRODUCTCODE": "Product Code", - "PRICELISTNETPRICE": "Net Price", - "PRICELISTDISCOUNT": "Price list discount", - "QUOTATIONQTY": "Quantity", - "QUOTATIONTAX": "Tax", + "INVOICE": "FAKTURA", + "REQUESTID": "Zahtjev", + "QUOTATIONID": "PONUDA", + "ORDERID": "Naruči", + "PRICELISTNAME": "Cjenik", + "PRODUCTCODE": "Šifra Produkta", + "PRICELISTNETPRICE": "Neto Cijena", + "PRICELISTDISCOUNT": "Popust na cjenovnik", + "QUOTATIONQTY": "Količina", + "QUOTATIONTAX": "Porez", "QUOTATIONPROFORMAID": "Proforma ID", - "QUOTATIONINVOICEID": "Invoice ID", - "QUOTATIONDISCOUNT": "Quotation Discount", - "ORDER_INFO": "Order", - "REQUEST_INFO": "Request", - "QUOTATION_INFO": "Quotation", - "ORDERCLIENTCODE": "Customer Code", - "ORDERNOTES": "Note", - "PROFORMANAME": "Proforma name", - "AGENTFULLNAME": "Agent", - "PROFORMANOTES": "Note", - "PRODUCTINPROFORMA": "Products in proforma", - "INVOICENAME": "Invoice Name", - "INVOICENOTES": "Note", - "DOSSIERNOTES": "Note", - "QUOTATIONTOTALPRICE": "Total net", - "QUOTATIONTOTALTAX": "Total tax", + "QUOTATIONINVOICEID": "FAKTURA ID", + "QUOTATIONDISCOUNT": "Popust na ponudu", + "ORDER_INFO": "Naruči", + "REQUEST_INFO": "Zahtjev", + "QUOTATION_INFO": "Ponuda", + "ORDERCLIENTCODE": "Šifra Klijenta", + "ORDERNOTES": "Bilješka", + "PROFORMANAME": "Naziv Proforme", + "AGENTFULLNAME": "Specijalist", + "PROFORMANOTES": "Bilješka", + "PRODUCTINPROFORMA": "Produkti u proformi", + "INVOICENAME": "Naziv Fakture", + "INVOICENOTES": "Bilješka", + "DOSSIERNOTES": "Bilješka", + "QUOTATIONTOTALPRICE": "Ukupno net", + "QUOTATIONTOTALTAX": "Ukupno poreza", "PROFORMA_INFO": "Proforma", - "PROFORMAID": "Id Proforma", - "PRICESALELISTNETPRICE": "Prezzo listino", - "PROFORMASTATUS": "State", - "INVOICESTATUS": "State", - "NO_PRODUCTINVOICE_AVAILABLE": "No product", - "INVOICEID": "Invoice", - "PRODUCTNOTE": "Note", - "INVOICE_INFO": "Invoice", - "COMPANYSTREET": "Address", - "COMPANYCITY": "City", - "COMPANYPOSTALCODE": "Postal Code", - "COMPANYCOUNTRY": "Country", + "PROFORMAID": "ID Proforma", + "PRICESALELISTNETPRICE": "Cjenik", + "PROFORMASTATUS": "Država", + "INVOICESTATUS": "Država", + "NO_PRODUCTINVOICE_AVAILABLE": "Nema proizvoda", + "INVOICEID": "Faktura", + "PRODUCTNOTE": "Bilješka", + "INVOICE_INFO": "Faktura", + "COMPANYSTREET": "Adresa", + "COMPANYCITY": "Grad", + "COMPANYPOSTALCODE": "Poštanski Broj", + "COMPANYCOUNTRY": "Država", "COMPANYFAX": "Fax", - "COMPANYVAT": "Fiscal Code/VAT", - "COMPANYPHONE": "Telephone", - "COMPANYEMAIL": "Email", - "NOTES": "Note", - "QUOTATIONPRODUCTNOTE": "Product Note", - "QUOTATIONVAT": "VAT", + "COMPANYVAT": "Fiskalni Kod/PDV", + "COMPANYPHONE": "Telefon", + "COMPANYEMAIL": "E-mail", + "NOTES": "Bilješka", + "QUOTATIONPRODUCTNOTE": "Bilješke Produkta", + "QUOTATIONVAT": "PDV", "AUTOPROFORMA": "SELF-PROFORMA", "AUTOINVOICE": "SELF-INVOICE", - "MOVEASSET": "ASSET", - "ORDERSTATUS": "State", - "QUOTATIONTOTALS": "Total", - "QUOTATIONTOTAL": "TOTAL", - "PRODUCTTYPE": "Type", - "PRODUCTSUBSCRIPTION": "Duration", - "PRODUCTATUNIT": "Unit", - "INASSET": "Asset", - "PRODUCTININVOICE": "Products on the invoice", - "SUBSCRIPTIONS": "CUSTOMER SCHEDULE", - "SUBSCRIPTIONNAME": "Subscription", - "COMPANYNAME": "Company", - "NEXTINVOICE": "Next Invoice", - "SUBSCRIPTIONDETAIL": "Detail", - "PRODUCTDESCRIPTION": "Description", - "NETPRICE": "Price", - "DISCOUNT": "Discount", - "TAX": "Tax", - "ATTENDACELASTINVOICE": "Last invoice", - "ATTENDACENEXTINVOICE": "Next invoice", - "SELECT_PRODUCT": "Select product", - "SELECT_PRODUCTTYPE": "Select type", - "ALL_PRODUCTS": "All", - "ALL_STATUS": "All", - "PAYMENT_INFO": "Payment information", - "PAYMENTMETHOD": "Payment methods", - "PAYMENT": "Payment", - "DETAILS": "Details", - "INVOICEDETAILS": "INVOICE DETAILS", - "QUANTITY": "Quantity", - "MANAGESALES": "Subscriptions", - "ACCOUNTINGDOC": "Accounting", - "INVOICES": "INVOICES", + "MOVEASSET": "IMOVINA", + "ORDERSTATUS": "Država", + "QUOTATIONTOTALS": "Ukupno", + "QUOTATIONTOTAL": "Ukupno", + "PRODUCTTYPE": "Vrsta", + "PRODUCTSUBSCRIPTION": "Trajanje", + "PRODUCTATUNIT": "Jedinica", + "INASSET": "Imovina", + "PRODUCTININVOICE": "Proizvodi na fakturi", + "SUBSCRIPTIONS": "RASPORED STRANKE", + "SUBSCRIPTIONNAME": "Pretplata", + "COMPANYNAME": "Kompanija", + "NEXTINVOICE": "Sljedeća Faktura", + "SUBSCRIPTIONDETAIL": "Detalji", + "PRODUCTDESCRIPTION": "Opis", + "NETPRICE": "Cijena", + "DISCOUNT": "Popust", + "TAX": "Porez", + "ATTENDACELASTINVOICE": "Posljednja faktura", + "ATTENDACENEXTINVOICE": "Sljedeća faktura", + "SELECT_PRODUCT": "Odaberi Proizvod", + "SELECT_PRODUCTTYPE": "Odaberi vrstu", + "ALL_PRODUCTS": "Svi", + "ALL_STATUS": "Svi", + "PAYMENT_INFO": "Informacije o plaćanju", + "PAYMENTMETHOD": "Način plaćanja", + "PAYMENT": "Plaćanje", + "DETAILS": "Detalji", + "INVOICEDETAILS": "DETALJI FAKTURE", + "QUANTITY": "Količina", + "MANAGESALES": "Pretplate", + "ACCOUNTINGDOC": "Računovodstvo", + "INVOICES": "FAKTURE", "PROFORMAS": "PROFORMA", - "PAYMENTS": "PAYMENTS", - "SELECT_PERIOD": "Select range", - "NO_PRODUCTPROFORMA_AVAILABLE": "No data available", - "NO_PRODUCTPRICELIST_AVAILABLE": "No data available", - "PROFORMAAUTHORIZED": "Authorized proforma", - "ADD_PRODUCTPRICELIST": "ADD PRODUCT", - "DELETE_PRODUCT": "Delete Product", - "AUTHORIZED": "AUTHORIZED", - "INVOICEDISCOUNT": "Discount", - "DEPOSIT": "DEPOSIT", - "BALANCE": "BALANCE", - "PRODUCTS": "PRODUCTS", - "INVOICENOPRODUCTDESCRIPTION": "Description on the invoice", + "PAYMENTS": "PLAĆANJA", + "SELECT_PERIOD": "Odaberi raspon", + "NO_PRODUCTPROFORMA_AVAILABLE": "Nema dostupnih podataka", + "NO_PRODUCTPRICELIST_AVAILABLE": "Nema dostupnih podataka", + "PROFORMAAUTHORIZED": "Ovlaštena proforma", + "ADD_PRODUCTPRICELIST": "DODAJ PROIZVOD", + "DELETE_PRODUCT": "Izbriši Produkt", + "AUTHORIZED": "OVLAŠTEN", + "INVOICEDISCOUNT": "Popust na fakturu ", + "DEPOSIT": "DEPOZIT", + "BALANCE": "BALANS", + "PRODUCTS": "PROIZVODI", + "INVOICENOPRODUCTDESCRIPTION": "Opis na fakturi", "INVOICENOPRODUCTAMOUNT": "Amount", - "INVOICENOTAXAMOUNT": "TAX", - "INVOICENOPRODUCTSAVE": "Save", - "INVOICENOPRODUCTUPDATE": "Update", + "INVOICENOTAXAMOUNT": "POREZ", + "INVOICENOPRODUCTSAVE": "Sačuvaj", + "INVOICENOPRODUCTUPDATE": "Ažuriraj", "PDFPROFORMA": "PDF", "PDFINVOICE": "PDF", - "PAIDANDEXPIRED": "Payment", - "CREDITNOTE": "CREDIT NOTE", - "CREDITNOTE_INFO": "Credit Note", - "MOVECREDITNOTE": "SELF-CREDIT NOTE", - "CREDITNOTEDETAILS": "Credit Note Detail", + "PAIDANDEXPIRED": "Plaćanje", + "CREDITNOTE": "KREDITNA NOTA", + "CREDITNOTE_INFO": "Kreditna Nota", + "MOVECREDITNOTE": "SELF-CREDIT BILJEŠKA", + "CREDITNOTEDETAILS": "Kreditna Nota Detalji", "PDFCREDITNOTE": "PDF", - "CREDITINOTENAME": "Name", - "TOTALPAYMENTS": "Total payments", - "PROFORMADETAILS": "Details", - "CREATIONDATE": "Created at", - "STARTDATE": "Invoice Date", - "ENDDATE": "Expiry Date", - "NUMBER": "Number", - "PRODUCTPRICE": "Price", - "PRODUCTTAX": "Tax percentage", - "PRODUCTQTY": "Quantity", - "UPDATE_PRODUCT": "Update Product", - "QUOTATIONPRODUCTTYPE": "Type", - "QUOTATIONUNIT": "Unit", - "QUOTATIONSUBSCRIPTION": "Duration", - "SELECT_PERIOD_CREATION": "Select Creation Date", - "SELECT_PERIOD_START": "Select Date", - "SELECT_PERIOD_EXPIRE": "Select Expiry Date", - "NEW_COMPANY": "New", - "COMPANIES": "Companies", - "PAYED_AY": "Payed on", - "CLONEPROFORMA": "Clone", - "COMPANYDESC": "Description", - "COMPANYNATION": "Nation", - "GRAPHINVOICES": "Invoice emission chart", - "YEARS": "Years", - "FROM": "From", - "TO": "To", - "INVOICEEMITED": "Issued", - "INVOICEPAYED": "Payed", - "INVOICETOTAL": "Total", - "CHOOSE": "Choose", - "ADVANCED_SEARCH": "Advanced Search", - "NEW_CONDITION": "New Condition", - "SELECT_FIELD": "Select field", - "SELECT_OPERATOR": "Select operator", - "VALUE": "Value", - "VALUES": "Values", - "APPLY": "Apply", - "MEET_ALL_CONDITIONS": "Meet all conditions", - "MEET_ANY_CONDITIONS": "Meet at least one condition", - "EQUALS": "Equals", - "IS_NOT_EQUAL": "Does not equal", - "IS_AMONG": "Is among", - "IS_NOT_AMONG": "Is not among", - "IS_GREATER_THAN": "Is greater than", - "IS_GREATER_THAN_OR_EQUAL_TO": "Is greater than or equal to", - "IS_LESS_THAN": "Is less than", - "IS_LESS_THAN_OR_EQUAL_TO": "Is less than or equal to", - "IS_BETWEEN": "Is between", - "CONTAINS": "Contains", - "STARTS_WITH": "Starts with", - "ENDS_WITH": "Ends with", - "STARTING_DATE": "Starting date", - "ENDING_DATE": "Ending date", - "STARTING_VALUE": "Starting value", - "ENDING_VALUE": "Ending value", - "VALUE_RANGE_CHECK": "Value must be greater than", - "AND": "And", - "ENABLED": "Enabled", - "DISABLED": "Disabled", - "ELAPSED_ANSWERED": "Elapsed time since call started", - "ELAPSED_DISPOSED": "Elapsed time since call ended", - "WHATSAPP": "WhatsApp Connector", - "WHATSAPP_INTERACTIONS": "WhatsApp Connector Interactions", - "SECOND_LEVEL_DISPOSITION": "Second Level Disposition", - "THIRD_LEVEL_DISPOSITION": "Third Level Disposition", - "VIDAOOSESSION": "Start Video Call", - "SELECT_CONTACT": "Select contact", - "SELECT": "Select", - "LAST_UPDATED": "Last updated", - "MATCHING_FIELD": "Matching field", - "MULTIPLE_CONTACTS_FOUND": "Multiple contacts found for number", - "WHICH_ONE_TO_USE": "Which one do you want to use?", - "LICENSE_EXPIRE_REMAINING_DAYS": "Your license is about to expire! Please contact your Administrator", - "NO_RESULTS_AVAILABLE": "No results available", - "AVAILABLE": "Available", - "AGENT_PRESENCE": "Agent Presence", - "SELECT_TEAM": "Select Team", + "CREDITINOTENAME": "Ime", + "TOTALPAYMENTS": "Ukupno plaćanja", + "PROFORMADETAILS": "Detalji", + "CREATIONDATE": "Stvoreno U", + "STARTDATE": "Datum Fakture", + "ENDDATE": "Datum Isteka", + "NUMBER": "Broj", + "PRODUCTPRICE": "Cijena", + "PRODUCTTAX": "Porezni postotak", + "PRODUCTQTY": "Količina", + "UPDATE_PRODUCT": "Ažuriraj Proizvod", + "QUOTATIONPRODUCTTYPE": "Vrsta", + "QUOTATIONUNIT": "Jedinica", + "QUOTATIONSUBSCRIPTION": "Trajanje", + "SELECT_PERIOD_CREATION": "Odaberi Datum Kreiranja", + "SELECT_PERIOD_START": "Odaberi Datum", + "SELECT_PERIOD_EXPIRE": "Odaberi Datum Isteka", + "NEW_COMPANY": "Novo", + "COMPANIES": "Kompanije", + "PAYED_AY": "Plaćeno na", + "CLONEPROFORMA": "Kloniraj", + "COMPANYDESC": "Opis", + "COMPANYNATION": "Nacija", + "GRAPHINVOICES": "Emisije Računa Chart", + "YEARS": "Godine", + "FROM": "Od", + "TO": "Do", + "INVOICEEMITED": "Izdato", + "INVOICEPAYED": "Plaćeno", + "INVOICETOTAL": "Ukupno", + "CHOOSE": "Biraj", + "ADVANCED_SEARCH": "Napredno Pretraživanje", + "NEW_CONDITION": "Novo Stanje", + "SELECT_FIELD": "Odaberi polje", + "SELECT_OPERATOR": "Odaberi specijalistu", + "VALUE": "Vrijednost", + "VALUES": "Vrijednosti", + "APPLY": "Primijeni", + "MEET_ALL_CONDITIONS": "Ispunjava sve uslove", + "MEET_ANY_CONDITIONS": "Ispunjava barem jedan uslov", + "EQUALS": "Jednako", + "IS_NOT_EQUAL": "Nije jednako", + "IS_AMONG": "Je među", + "IS_NOT_AMONG": "Nije među", + "IS_GREATER_THAN": "Je veće od", + "IS_GREATER_THAN_OR_EQUAL_TO": "Je veće od ili jednako", + "IS_LESS_THAN": "Je manje od", + "IS_LESS_THAN_OR_EQUAL_TO": "Je manje od ili jednako", + "IS_BETWEEN": "Je izumeđu", + "CONTAINS": "Sadrži", + "STARTS_WITH": "Počinje sa", + "ENDS_WITH": "Završava Sa", + "STARTING_DATE": "Početni datum", + "ENDING_DATE": "Datum Isteka", + "STARTING_VALUE": "Početna vrijednost", + "ENDING_VALUE": "Vrijednost Isteka", + "VALUE_RANGE_CHECK": "Vrijednost mora biti veća od", + "AND": "I", + "ENABLED": "Omogućeno", + "DISABLED": "Onemogućeno", + "ELAPSED_ANSWERED": "Proteklo vrijeme od početka poziva", + "ELAPSED_DISPOSED": "Proteklo vrijeme od završetka poziva", + "WHATSAPP": "WhatsApp Konektor", + "WHATSAPP_INTERACTIONS": "WhatsApp Konektor Interakcija", + "SECOND_LEVEL_DISPOSITION": "Dispozicija Drugog Nivoa", + "THIRD_LEVEL_DISPOSITION": "Disozicija Trećeg Nivoa", + "VIDAOOSESSION": "Započni Video Poziv", + "SELECT_CONTACT": "Odaberi kontakt", + "SELECT": "Odaberi", + "LAST_UPDATED": "Zadnje Ažuriranje", + "MATCHING_FIELD": "Podudarno polje", + "MULTIPLE_CONTACTS_FOUND": "Višestruki kontakti pronađeni za broj", + "WHICH_ONE_TO_USE": "Koji želiš koristiti?", + "LICENSE_EXPIRE_REMAINING_DAYS": "Tvoja licenca uskoro ističe! Molim kontaktiraj svog Kontakt Centar Menadžera", + "NO_RESULTS_AVAILABLE": "Nema dostupnih rezultata", + "AVAILABLE": "Dostupno", + "AGENT_PRESENCE": "Prisutnost Specijaliste", + "SELECT_TEAM": "Odaberi Tim", "NOTIFICATIONS": { - "TRANSFER_AGENT_EXECUTED": "Transfer to agent successfully executed", - "TRANSFER_QUEUE_EXECUTED": "Transfer to queue successfully executed" + "TRANSFER_AGENT_EXECUTED": "Prijenos Specijaliste je uspješno izvršen", + "TRANSFER_QUEUE_EXECUTED": "Prijenos u Queue je uspješno izvršen" }, - "LIMIT_TABS_REACHED": "Maximum number of open tabs reached" + "LIMIT_TABS_REACHED": "Dostignut je maksimalan broj otvorenih tab-ova", + "WAITING_CALLS": "Pozivi na čekanju", + "WAITING_INTERACTIONS": "Interakcije na čekanju" } } diff --git a/public/app/main/apps/dashboards/i18n/cs.json b/public/app/main/apps/dashboards/i18n/cs.json index e0a66cd..72f96de 100644 --- a/public/app/main/apps/dashboards/i18n/cs.json +++ b/public/app/main/apps/dashboards/i18n/cs.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "Kontaktní Telefon", "RECALLME_CALL_REMINDER": "Připomenutí hovoru Recall Me", "SCHEDULED_TIME": "Naplánovaný čas", - "UPCOMING_RECALLME_CALL": "Nadcházející volání Recall Me" + "UPCOMING_RECALLME_CALL": "Nadcházející volání Recall Me", + "WAITING_CALLS": "Čekající hovory", + "WAITING_INTERACTIONS": "Interakce při čekání" } } diff --git a/public/app/main/apps/dashboards/i18n/da.json b/public/app/main/apps/dashboards/i18n/da.json index 20b67fd..abd0dc4 100644 --- a/public/app/main/apps/dashboards/i18n/da.json +++ b/public/app/main/apps/dashboards/i18n/da.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "Kontakt telefon", "RECALLME_CALL_REMINDER": "Husk mig opkaldspåmindelse", "SCHEDULED_TIME": "Planlagt tid", - "UPCOMING_RECALLME_CALL": "Kommende Recall Me-opkald" + "UPCOMING_RECALLME_CALL": "Kommende Recall Me-opkald", + "WAITING_CALLS": "Ventende opkald", + "WAITING_INTERACTIONS": "Ventende interaktioner" } } diff --git a/public/app/main/apps/dashboards/i18n/de.json b/public/app/main/apps/dashboards/i18n/de.json index 6015548..b494e4e 100644 --- a/public/app/main/apps/dashboards/i18n/de.json +++ b/public/app/main/apps/dashboards/i18n/de.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "Kontakt-Telefon", "RECALLME_CALL_REMINDER": "Recall Me Anruferinnerung", "SCHEDULED_TIME": "Geplante Zeit", - "UPCOMING_RECALLME_CALL": "Anstehender Recall Me-Anruf" + "UPCOMING_RECALLME_CALL": "Anstehender Recall Me-Anruf", + "WAITING_CALLS": "Wartende Anrufe", + "WAITING_INTERACTIONS": "Wartende Interaktionen" } } diff --git a/public/app/main/apps/dashboards/i18n/es.json b/public/app/main/apps/dashboards/i18n/es.json index abbb32f..2f1a2c4 100644 --- a/public/app/main/apps/dashboards/i18n/es.json +++ b/public/app/main/apps/dashboards/i18n/es.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "teléfono de contacto", "RECALLME_CALL_REMINDER": "Recuérdame recordatorio de llamada", "SCHEDULED_TIME": "Hora programada", - "UPCOMING_RECALLME_CALL": "Próxima llamada de Recall Me" + "UPCOMING_RECALLME_CALL": "Próxima llamada de Recall Me", + "WAITING_CALLS": "Llamadas en espera", + "WAITING_INTERACTIONS": "Interacciones en espera" } } diff --git a/public/app/main/apps/dashboards/i18n/et.json b/public/app/main/apps/dashboards/i18n/et.json index 739750c..2e257c3 100644 --- a/public/app/main/apps/dashboards/i18n/et.json +++ b/public/app/main/apps/dashboards/i18n/et.json @@ -583,6 +583,13 @@ "PREVIEW_CALL": "Kõne eelvaade", "PREVIEW_CALL_FOR": "Tulevane eelvaatekutse", "SCHEDULED_AT": "kavas kl", - "SYSTEM_TIME": "Süsteemi aeg" + "SYSTEM_TIME": "Süsteemi aeg", + "CONTACT_NAME": "kontaktisiku nimi", + "CONTACT_PHONE": "Kontakt Telefon", + "RECALLME_CALL_REMINDER": "Helista mulle meeldetuletus", + "SCHEDULED_TIME": "Planeeritud aeg", + "UPCOMING_RECALLME_CALL": "Tulevane Recall Me kõne", + "WAITING_CALLS": "Kõnede ootel", + "WAITING_INTERACTIONS": "Interaktsioonide ootel" } } diff --git a/public/app/main/apps/dashboards/i18n/fa.json b/public/app/main/apps/dashboards/i18n/fa.json index 76aa749..036c4a6 100644 --- a/public/app/main/apps/dashboards/i18n/fa.json +++ b/public/app/main/apps/dashboards/i18n/fa.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "تلفن تماس", "RECALLME_CALL_REMINDER": "یادآوری تماس مرا Recall Me", "SCHEDULED_TIME": "زمان برنامه ریزی شده", - "UPCOMING_RECALLME_CALL": "تماس بعدی Recall Me" + "UPCOMING_RECALLME_CALL": "تماس بعدی Recall Me", + "WAITING_CALLS": "تماس های انتظار", + "WAITING_INTERACTIONS": "تعاملات انتظار" } } diff --git a/public/app/main/apps/dashboards/i18n/fi.json b/public/app/main/apps/dashboards/i18n/fi.json index 59d46ce..c2eefe6 100644 --- a/public/app/main/apps/dashboards/i18n/fi.json +++ b/public/app/main/apps/dashboards/i18n/fi.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "Yhteyspuhelinnumero", "RECALLME_CALL_REMINDER": "Recall Me -soittomuistutus", "SCHEDULED_TIME": "Sovittu aika", - "UPCOMING_RECALLME_CALL": "Tuleva Recall Me -puhelu" + "UPCOMING_RECALLME_CALL": "Tuleva Recall Me -puhelu", + "WAITING_CALLS": "Odottavat puhelut", + "WAITING_INTERACTIONS": "Vuorovaikutuksia odottamassa" } } diff --git a/public/app/main/apps/dashboards/i18n/fr.json b/public/app/main/apps/dashboards/i18n/fr.json index 40bf467..80f6205 100644 --- a/public/app/main/apps/dashboards/i18n/fr.json +++ b/public/app/main/apps/dashboards/i18n/fr.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "Numéro du contact", "RECALLME_CALL_REMINDER": "rappelez-moi rappel d'appel", "SCHEDULED_TIME": "Heure prévue", - "UPCOMING_RECALLME_CALL": "Appel de rappel à venir" + "UPCOMING_RECALLME_CALL": "Appel de rappel à venir", + "WAITING_CALLS": "Appels en attente", + "WAITING_INTERACTIONS": "Interactions en attente" } } diff --git a/public/app/main/apps/dashboards/i18n/he.json b/public/app/main/apps/dashboards/i18n/he.json index fff6efe..edc1037 100644 --- a/public/app/main/apps/dashboards/i18n/he.json +++ b/public/app/main/apps/dashboards/i18n/he.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "טלפון ליצירת קשר", "RECALLME_CALL_REMINDER": "תזכורת להתקשרות זכור לי", "SCHEDULED_TIME": "זמן מתוכנן", - "UPCOMING_RECALLME_CALL": "שיחת Recall Me הקרובה" + "UPCOMING_RECALLME_CALL": "שיחת Recall Me הקרובה", + "WAITING_CALLS": "שיחות ממתינות", + "WAITING_INTERACTIONS": "המתנה לאינטראקציות" } } diff --git a/public/app/main/apps/dashboards/i18n/hi.json b/public/app/main/apps/dashboards/i18n/hi.json index fa4b16a..e89676e 100644 --- a/public/app/main/apps/dashboards/i18n/hi.json +++ b/public/app/main/apps/dashboards/i18n/hi.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "संपर्क फ़ोन", "RECALLME_CALL_REMINDER": "रिकॉल मी कॉल रिमाइंडर", "SCHEDULED_TIME": "निर्धारित समय", - "UPCOMING_RECALLME_CALL": "अपकमिंग रिकॉल मी कॉल" + "UPCOMING_RECALLME_CALL": "अपकमिंग रिकॉल मी कॉल", + "WAITING_CALLS": "वेटिंग कॉल", + "WAITING_INTERACTIONS": "प्रतीक्षा बातचीत" } } diff --git a/public/app/main/apps/dashboards/i18n/hu.json b/public/app/main/apps/dashboards/i18n/hu.json index e6dc890..31b1630 100644 --- a/public/app/main/apps/dashboards/i18n/hu.json +++ b/public/app/main/apps/dashboards/i18n/hu.json @@ -590,6 +590,8 @@ "CONTACT_PHONE": "Kapcsolat Telefon", "RECALLME_CALL_REMINDER": "Recall Me hívás emlékeztető", "SCHEDULED_TIME": "Menetrendszeri idő", - "UPCOMING_RECALLME_CALL": "Közelgő Recall Me hívás" + "UPCOMING_RECALLME_CALL": "Közelgő Recall Me hívás", + "WAITING_CALLS": "Várakozó hívások", + "WAITING_INTERACTIONS": "Várakozó interakciók" } } diff --git a/public/app/main/apps/dashboards/i18n/id.json b/public/app/main/apps/dashboards/i18n/id.json index a6dfab9..fa27c1e 100644 --- a/public/app/main/apps/dashboards/i18n/id.json +++ b/public/app/main/apps/dashboards/i18n/id.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "Hubungi Telepon", "RECALLME_CALL_REMINDER": "Ingatkan Saya pengingat panggilan", "SCHEDULED_TIME": "Waktu yang dijadwalkan", - "UPCOMING_RECALLME_CALL": "Panggilan Recall Me yang akan datang" + "UPCOMING_RECALLME_CALL": "Panggilan Recall Me yang akan datang", + "WAITING_CALLS": "Panggilan Menunggu", + "WAITING_INTERACTIONS": "Interaksi Menunggu" } } diff --git a/public/app/main/apps/dashboards/i18n/is.json b/public/app/main/apps/dashboards/i18n/is.json new file mode 100644 index 0000000..34b7937 --- /dev/null +++ b/public/app/main/apps/dashboards/i18n/is.json @@ -0,0 +1,596 @@ +{ + "DASHBOARDS": { + "VISIBILITY": "Visibility", + "PUBLIC": "Public", + "PRIVATE": "Private", + "PUBLIC_INTERACTION": "The interaction is public", + "LOST_CONNECTION": "Experiencing network connectivity issues. Please check your internet connection.", + "SCHEDULED_CALLS": "Scheduled Calls", + "DOWNLOAD": "Download", + "DOWNLOAD_WITH_ATTACHMENTS": "Download with attachments", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download without attachments", + "UNMANAGED_RATE": "Unmanaged Rate", + "UPCOMING_RECALLME_CALL": "Upcoming Recall Me call", + "RECALLME_CALL_REMINDER": "Recall Me call reminder", + "CONTACT_NAME": "Contact Name", + "CONTACT_PHONE": "Contact Phone", + "SCHEDULED_TIME": "Scheduled time", + "LIST_NAME": "List name", + "UNMANAGED_RATE_TEXT": "Interactions Unmanaged Rate", + "VOICE_WAITING": "WAITING", + "VOICE_WAITING_TEXT": "WAITING QUEUE CALLS", + "VOICE_TALKING": "TALKING", + "VOICE_TALKING_TEXT": "ACTIVE QUEUE CALLS", + "VOICE_ANSWERED": "ANSWERED", + "VOICE_ANSWERED_TEXT": "ANSWERED QUEUE CALLS", + "VOICE_ABANDONED": "ABANDONED", + "VOICE_ABANDONED_TEXT": "ABANDONED QUEUE CALLS", + "VOICE_TOTAL_OFFERED": "TOTAL OFFERED", + "VOICE_TOTAL_OFFERED_TEXT": "TOTAL QUEUE CALLS", + "TODAY_INTERACTIONS_STATS": "Interactions Daily Stats", + "DIAL_TIMEZONE": "Dial timezone", + "VOICE_AVG_HOLD_TIME": "AVERAGE HOLD TIME", + "VOICE_AVG_HOLD_TIME_TEXT": "QUEUE CALLS AVG HOLD TIME", + "VOICE_AVG_TALK_TIME": "AVERAGE TALK TIME", + "VOICE_AVG_TALK_TIME_TEXT": "QUEUE CALLS TALK TIME", + "VOICE_ANSWER_RATE": "ANSWER RATE", + "VOICE_ANSWER_RATE_TEXT": "QUEUE CALLS ANSWER RATE", + "VOICE_ABANDON_RATE": "ABANDON RATE", + "VOICE_ABANDON_RATE_TEXT": "QUEUE CALLS ABANDON RATE", + "VOICE_UNMANAGED": "UNMANAGED", + "VOICE_UNMANAGED_TEXT": "UNMANAGED QUEUE CALLS", + "OPENED_TEXT": "Opened Interactions", + "MANAGED": "Managed", + "MANAGED_TEXT": "Managed Interactions", + "ABANDONED": "Abandoned", + "ABANDONED_TEXT": "Abandoned Interactions", + "ABANDONED_RATE": "Abandoned Rate", + "ABANDONED_RATE_TEXT": "Interactions Abandon Rate", + "SYSTEM_TIME": "System time", + "TOTAL_OFFERED": "Total Offered", + "TOTAL_OFFERED_TEXT": "Offered Interactions", + "AVG_HOLD_TIME_TEXT": "Interactions AVG Hold Time", + "MANAGED_RATE": "Managed Rate", + "MANAGED_RATE_TEXT": "Interactions Managed Rate ", + "AVG_MANAGED_TIME": "AVG Management Time", + "AVG_MANAGED_TIME_TEXT": "Interactions AVG Management Time", + "NO_DISPOSITION_SET": "No disposition set", + "AGENTS": "Agents", + "TRANSFER": "Transfer", + "NO_DATA_AVAILABLE": "No data available", + "CUSTOMER_JOURNEY": "Customer Journey", + "ME": "Me", + "CURRENTLY_IN_USE_BY": "Currently in use by", + "NOTAVAILABLE": "Not available", + "CLICKRELOAD": "New abandoned calls! Reload please", + "ASSIGNTO": "Assign to", + "SELECT_QUEUE": "Select Queue", + "SELECT_CAMPAIGN": "Select Queue", + "FREE": "Free", + "RESERVED": "Reserved", + "QUEUECALLEREXITREASON": "Reason", + "QUEUECALLEREXITAT": "Dropped", + "LASTASSIGNEDTO": "Last Assigned To", + "ABANDONEDQUEUECALLS": "Abandoned Queue Calls", + "ABANDONAT": "Abandoned", + "QUEUE": "Queue", + "SELECT_SUBSTATUS": "Select Substatus", + "READ": "Read", + "UNREAD": "Unread", + "SELECT_READ_UNREAD": "Select Read/Unread", + "SELECT_AGENT": "Select Agent", + "MARK_AS_UNREAD": "Mark as unread", + "FILTER_VOICE_QUEUES": "Filter Voice Queues", + "FILTER_CHAT_WEBSITES": "Filter Chat Websites", + "FILTER_SMS_ACCOUNTS": "Filter Sms Accounts", + "FILTER_FAX_ACCOUNTS": "Filter Fax Accounts", + "FILTER_OPENCHANNEL_ACCOUNTS": "Filter Openchannel Accounts", + "FILTER_MAIL_ACCOUNTS": "Filter Mail Accounts", + "FILTER_WHATSAPP_ACCOUNTS": "Filter Whatsapp Accounts", + "SETFILTERS": "Set Filters", + "FILTERS": "Filters", + "CONFIRM": "Confirm", + "CHANNEL_WAITING_TEXT": "Waiting Queue Interactions", + "CHANNEL_QUEUE": "Queue", + "CHANNEL_FROM": "From", + "LOADING_INTERACTION": "We are loading the interaction...", + "JANUARY": "January", + "FEBRUARY": "February", + "MARCH": "March", + "APRIL": "April", + "MAY": "May", + "JUNE": "June", + "JULY": "July", + "AUGUST": "August", + "SEPTEMBER": "September", + "OCTOBER": "October", + "NOVEMBER": "November", + "DECEMBER": "December", + "MON": "Mon", + "TUE": "Tue", + "WED": "Wed", + "THU": "Thu", + "FRI": "Fri", + "SAT": "Sat", + "SUN": "Sun", + "DELETE": "Delete", + "LAST_3_DAYS": "Last 3 Day", + "LAST_YEAR": "Last Year", + "THIS_YEAR": "This Year", + "LAST_MONTH": "Last Month", + "THIS_MONTH": "This Month", + "LAST_WEEK": "Last Week", + "THIS_WEEK": "This Week", + "YESTERDAY": "Yesterday", + "TODAY": "Today", + "SELECT_DATE": "Select Start Date", + "HOME": "Home", + "SET_AS": "Set As", + "PENDING": "Pending", + "CANNED_ANSWER_NOT_FOUND": "No Canned Answers were found", + "CANNED_ANSWER_SEARCH": "Enter a text to search a Canned Answer", + "TAGS": "Tags", + "SELECT_TAG": "Select Tag", + "TYPE": "Type", + "SOURCE": "Source", + "DESTINATION": "Destination", + "CALLERID": "Caller ID", + "END_AT": "End At", + "DURATION": "Duration", + "CHAT": "Chat", + "MAIL": "Email", + "SMS": "Sms", + "OPENCHANNEL": "Open Channel", + "FAX": "Fax", + "NOT_ASSIGNED": "Not Assigned", + "UNKNOWN": "Unknown", + "SELECT_USER": "Select User", + "LAST_MESSAGE": "Last message", + "USER": "User", + "RATING": "Rating", + "FEEDBACK": "Feedback", + "SUBJECT": "Subject", + "CUSTOMER_IP": "Originating IP Address", + "REFERER": "Referer", + "ACCOUNT": "Account", + "WEBSITE": "Website", + "AGENT": "Agent", + "CREATED_AT": "Created At", + "CLOSED_AT": "Closed At", + "DISPOSITION": "Disposition", + "CONTACT": "Contact", + "INTERACTION": "Interaction", + "BROWSER_NAME": "Browser Name", + "BROWSER_VERSION": "Browser Version", + "OS_NAME": "Operating System Name", + "OS_VERSION": "Operating System Version", + "DEVICE_MODEL": "Device Model", + "DEVICE_VENDOR": "Device Vendor", + "DEVICE_TYPE": "Device Type", + "RECALLME": "Recall Me", + "DROP_RATE": "Drop Rate", + "DROPPED": "Dropped", + "DROPPED_TEXT": "Dropped Queue Calls", + "DETAIL": "Detail", + "MOTION_BULL": "Motion Bull", + "LIMITED": "Limited", + "LIMITED_TEXT": "IVR Campaigns Calls Originated/Limit", + "DASHBOARDS": "Dashboards", + "RECORDINGS": "Recordings", + "TODAY_MOTION_BULL_STATS": "Queue Campaigns Daily Stats", + "ORIGINATED": "Originated", + "ORIGINATED_TEXT": "Queue Calls Originated", + "UPDATE": "Update", + "MORE": "More", + "MOTIONDIALER": "Motion Bull", + "DISPOSE": "Dispose", + "QUEUES": "Queues", + "DIALER_CALL": "Dialer Call", + "ELAPSED_TIME": "Elapsed Time", + "EDIT": "Edit", + "MERGE": "Merge", + "DUPLICATE": "Duplicate", + "UNIQUEID": "Uniqueid", + "AUTOCLOSE": "Automatically close contact tab after disposal", + "CAMPAIGN": "Campaign", + "NONE": "None", + "NAME": "Name", + "ANSWER_MACHINE": "Answer Machine", + "INTERESTED": "Interested", + "NOT_INTERESTED": "Not Interested", + "PERSONAL_INFO": "Personal Info", + "SOLD": "Sold", + "SPECIAL": "Special", + "BLACKLIST": "Blacklist", + "RESCHEDULE": "Reschedule", + "FIRSTNAME": "Firstname", + "LASTNAME": "Lastname", + "MOBILE": "Mobile", + "DATE_OF_BIRTH": "Birthdate", + "COMPANY": "Company", + "TAG": "Tag", + "COUNTRY": "Country", + "CITY": "City", + "STREET": "Address", + "POSTALCODE": "Postal Code", + "CUSTOM_FIELDS": "Custom Fields", + "GENERAL": "General", + "VOICE": "Voice", + "TODAY_IVR_CAMPAIGNS_STATS": "Daily Ivr Campaigns Stats", + "TODAY_INBOUND_STATS": "Inbound Queue Daily Stats", + "TODAY_OUTBOUND_STATS": "Outbound Daily Stats", + "WAITING": "Waiting", + "TALKING": "Talking", + "INBOUND_ANSWERED": "Answered", + "OUTBOUND_ANSWERED": "Answered", + "AVG_HOLD_TIME": "Average Hold Time", + "INBOUND_ANSWER_RATE": "Answer Rate", + "OUTBOUND_ANSWER_RATE": "Answer Rate", + "ABANDON_RATE": "Abandon Rate", + "UNMANAGED": "Unmanaged", + "TOTAL": "Total", + "TOT_DURATION": "Total Duration", + "AVG_DURATION": "Average Duration", + "HELP": { + "MANDATORY_DISPOSITION_ENABLED": "Mandatory disposition enabled for this account", + "UNMANAGED_RATE": "The Unmanaged Rate of all the Interactions", + "WAITING": "The total number of Waiting Interactions", + "OPENED": "The total number of Active Interactions", + "MANAGED": "The total number of Completed Interactions", + "ABANDONED": "The total number of Abandoned Interactions", + "TOTAL_OFFERED": "The total number of Interactions (completed + abandoned)", + "AVG_HOLD_TIME": "The Average Interaction Hold Time, namely the average time spent waiting for an agent to answer, for all the existing Interactions", + "AVG_MANAGED_TIME": "The Average Interaction Managed Time, namely the average time spent during conversation", + "MANAGED_RATE": "The Managed Rate of all the Interactions", + "ABANDONED_RATE": "The Abandon Rate of all the Interactions", + "UNMANAGED": "The total number of Unmanaged Interactions", + "VOICE_WAITING": "The total number of Waiting Queue Calls, for all the existing Queues", + "VOICE_TALKING": "The total number of Active Queue Calls, for all the existing Queues", + "VOICE_ANSWERED": "The total number of Completed Queue Calls, for all the existing Queues", + "VOICE_ABANDONED": "The total number of Abandoned Queue Calls, considering all the existing Queues. Note that the calls which are abandoned for timeout and joinempty will not be considered", + "VOICE_TOTAL_OFFERED": "The total number of Queue Calls (completed + abandoned + unmanaged in the last queue of the flow). Note that the calls which enter in an IVR and not in a queue, will not be considered", + "VOICE_AVG_TALK_TIME": "The Average Queue Talk Time, namely the average time spent during conversation, for all the existing Queues", + "VOICE_AVG_HOLD_TIME": "The Average Queue Hold Time, namely the average time spent waiting for an agent to answer, for all the existing Queues", + "VOICE_ANSWER_RATE": "The Answer Rate of all the Queue Calls", + "VOICE_UNMANAGED": "The total number of Unmanaged Queue Calls, for all the existing Queues. It includes the calls which are abandoned for timeout, joinempty, leavewhenempty and exitwithkey (cfr. asterisk doc for more information)", + "ORIGINATED": "Total number of calls dialed in the queue campaigns", + "ORIGINATEDLIMITED": "IVR Campaigns Calls Originated/Limit", + "DROPPED": "The total number of Dropped Queue Calls, for all the existing Queues", + "DROP_RATE": "The Drop Rate of all the Queue Calls", + "OUTBOUND_ANSWERED": "The total number of Completed Outbound Calls", + "OUTBOUND_ANSWER_RATE": "The Answer Rate of all the Outbound Calls", + "ABANDON_RATE": "The Abandon Rate of all the Queue Calls", + "TOTAL": "The total number of Outbound Calls", + "TOT_DURATION": "The total duration of all the Outbound Calls", + "AVG_DURATION": "The average duration of all the Completed Outbound Calls", + "EXACT_MATCH_FILTER": "Search for an exact match", + "LIKE_FILTER": "Search for the specified pattern" + }, + "ERRORS": { + "CAMPAIGN_REQUIRED": "Mandatory field", + "FIRSTNAME_REQUIRED": "Mandatory field", + "PHONE_REQUIRED": "Mandatory field", + "DISPOSITION_REQUIRED": "Mandatory field", + "AGENT_REQUIRED": "Mandatory field", + "QUEUE_REQUIRED": "Mandatory field", + "FAILED_INITIALIZATION": "Error during initialization" + }, + "NO_AVAILABLE_INFO": "No available info", + "WELCOME_TO_MOTION": "Welcome to Motion", + "WELCOME_MESSAGE": "Use the left sidebar to navigate through available sections", + "ADD": "Add", + "CONTACTMANAGER": "Contact Manager", + "DASHBOARD": "Dashboard", + "EDIT_CONTACT": "Edit contact", + "EMAIL": "Email", + "FULLNAME": "Fullname", + "CREATEDAT": "Created At", + "LIST": "List", + "NEW_CONTACT": "New Contact", + "PHONE": "Phone", + "SAVE": "Save", + "INBOUND_WAITING_CALLS": "Inbound Waiting Calls", + "CONTACTS": "Contacts", + "MYCONTACTS": "My Contacts", + "ADD_CONTACT": "Add Contact", + "RELOAD": "Reload", + "WAITING_TEXT": "Waiting Interactions", + "TALKING_TEXT": "Active Queue Calls", + "INBOUND_ANSWERED_TEXT": "Answered Queue Calls", + "DROP_RATE_TEXT": "Queue Calls Drop Rate", + "AVG_TALK_TIME_TEXT": "Queue Calls Talk Time", + "INBOUND_ANSWER_RATE_TEXT": "Queue Calls Answer Rate", + "UNMANAGED_TEXT": "Unmanaged Interactions", + "TOTAL_TEXT": "Total Outbound Calls", + "OUTBOUND_ANSWERED_TEXT": "Outbound Answered Calls", + "TOT_DURATION_TEXT": "Outbound Calls Total Duration", + "AVG_DURATION_TEXT": "Outbound Calls Average Duration", + "OUTBOUND_ANSWER_RATE_TEXT": "Outbound calls Answer Rate", + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "OF": "of", + "REPLY_PLACEHOLDER": "Type and hit enter to send a message", + "CONTACT_INFO": "Contact Info", + "CLOSE_AND_DISPOSE": "Close and dispose", + "DISPOSITIONS": "Dispositions", + "CLOSE_WITHOUT_DISPOSE": "Close without dispose", + "ACCEPT": "Accept", + "REJECT": "Reject", + "CLOSED": "Closed", + "INFO": "Info", + "NOTE": "Note", + "ACCEPT_ELSEWHERE": "Accepted elsewhere", + "ATTENTION": "Attention", + "SOCIAL": "Social", + "NO_JSCRIPTY_PROJECTS_AVAILABLE": "No Jscripty Projects available", + "OPENED": "Opened", + "FILTER": "Filter", + "SELECT_STATUS": "Select Status", + "SELECT_ACCOUNT": "Select Account", + "SELECT_WEBSITE": "Select Website", + "ALL": "All", + "INTERACTIONS": "Interactions", + "STARTEDAT": "Started At", + "STATUS": "Status", + "OPEN": "Open", + "SHOW": "Show", + "SHOW_DETAILS": "Show Details", + "HIDE_DETAILS": "Hide Details", + "EXTERNAL_URL": "External Link", + "NO_MAIL_ACCOUNTS_AVAILABLE": "No Email Accounts available", + "NO_FAX_ACCOUNTS_AVAILABLE": "No Fax Accounts available", + "NO_SMS_ACCOUNTS_AVAILABLE": "No SMS Accounts available", + "NO_WHATSAPP_ACCOUNTS_AVAILABLE": "No Whatsapp Account available", + "SELECT_DATE_RANGE": "Select Date Range", + "CLEAR": "Clear", + "CALL_NUMBER": "Call", + "TRANSFER_NUMBER": "Transfer", + "CALL_SAVED": "Call properly saved", + "CALL_DISPOSED": "Call properly disposed", + "CUSTOMER_PORT": "Originating TCP Port", + "INTERACTION_CLOSED": "Interaction properly closed", + "INTERACTION_DISPOSED": "Interaction properly disposed", + "INTERACTION_CLOSED_DISPOSED": "Interaction properly closed and disposed", + "SELECT_ALL": "Select all", + "ASSIGNED_TO_OTHERS": "Assigned to others", + "ID": "Id", + "CHAT_INTERACTIONS": "Chat Interactions", + "MAIL_INTERACTIONS": "Email Interactions", + "SMS_INTERACTIONS": "SMS Interactions", + "OPENCHANNEL_INTERACTIONS": "Open Channel Interactions", + "FAX_INTERACTIONS": "Fax Interactions", + "DRAFT": "Draft", + "DRAFT_SAVE_WARNING_TITLE": "Overwrite existing draft?", + "DRAFT_SAVE_WARNING_MESSAGE": "There is already a draft saved for this interaction. Are you sure you want to overwrite it?", + "OVERWRITE": "Overwrite", + "CANCEL": "Cancel", + "UNTITLED": "Untitled", + "SAVE_AS_DRAFT": "Save as draft", + "UPDATE_DRAFT": "Update draft", + "NO_AVAILABLE_INTERACTION": "No available interaction", + "DOSSIERS": "Dossiers", + "DOSSIER": "Dossier", + "DOSSIER_INFO": "Information", + "SELECT_COMPANY": "Select Company", + "DOSSIERNAME": "Dossier Name", + "OPENDATE": "Open Date", + "ALL_COMPANIES": "All Companies", + "SELECT_WORKFLOW": "Select Workflow", + "WORKFLOW": "Select Workflow", + "SELECT_WORKFLOWSTEPS": "Select Workflow State", + "ALL_WORKFLOW": "All Workflow", + "STATE": "State", + "STEP": "Step", + "NEW_DOSSIER": "New Dossier", + "PRICELIST": "Price List", + "PRODUCTFILTERNAME": "Filter Name", + "PRODUCTNAME": "Product", + "PRODUCTINQUOTATION": "PRODUCT DETAILS", + "REQUEST": "REQUEST", + "QUOTATION": "QUOTATION", + "DOSSIERID": "Dossier ID", + "QUOTATIONNAME": "Quotation Name", + "QUOTATIONNOTES": "Quotation Notes", + "QUOTATIONSTATUS": "State", + "REQUESTNAME": "Request Name", + "REQUESTNOTES": "Request Notes", + "ALL_STEP": "All", + "UPDATED_AT": "Modified on", + "BY": "By", + "ORDER": "Order", + "PROFORMA": "PROFORMA", + "INVOICE": "INVOICE", + "REQUESTID": "Request", + "QUOTATIONID": "Offer", + "ORDERID": "Order", + "PRICELISTNAME": "Price List", + "PRODUCTCODE": "Product Code", + "PRICELISTNETPRICE": "Net Price", + "PRICELISTDISCOUNT": "Price list discount", + "QUOTATIONQTY": "Quantity", + "QUOTATIONTAX": "Tax", + "QUOTATIONPROFORMAID": "Proforma ID", + "QUOTATIONINVOICEID": "Invoice ID", + "QUOTATIONDISCOUNT": "Quotation Discount", + "ORDER_INFO": "Order", + "REQUEST_INFO": "Request", + "QUOTATION_INFO": "Quotation", + "ORDERCLIENTCODE": "Customer Code", + "ORDERNOTES": "Note", + "PROFORMANAME": "Proforma name", + "AGENTFULLNAME": "Agent", + "PROFORMANOTES": "Note", + "PRODUCTINPROFORMA": "Products in proforma", + "INVOICENAME": "Invoice Name", + "INVOICENOTES": "Note", + "DOSSIERNOTES": "Note", + "QUOTATIONTOTALPRICE": "Total net", + "QUOTATIONTOTALTAX": "Total tax", + "PROFORMA_INFO": "Proforma", + "PROFORMAID": "Id Proforma", + "PRICESALELISTNETPRICE": "Prezzo listino", + "PROFORMASTATUS": "State", + "INVOICESTATUS": "State", + "NO_PRODUCTINVOICE_AVAILABLE": "No product", + "INVOICEID": "Invoice", + "PRODUCTNOTE": "Note", + "INVOICE_INFO": "Invoice", + "COMPANYSTREET": "Address", + "COMPANYCITY": "City", + "COMPANYPOSTALCODE": "Postal Code", + "COMPANYCOUNTRY": "Country", + "COMPANYFAX": "Fax", + "COMPANYVAT": "Fiscal Code/VAT", + "COMPANYPHONE": "Telephone", + "COMPANYEMAIL": "Email", + "NOTES": "Note", + "QUOTATIONPRODUCTNOTE": "Product Note", + "QUOTATIONVAT": "VAT", + "AUTOPROFORMA": "SELF-PROFORMA", + "AUTOINVOICE": "SELF-INVOICE", + "MOVEASSET": "ASSET", + "ORDERSTATUS": "State", + "QUOTATIONTOTALS": "Total", + "QUOTATIONTOTAL": "TOTAL", + "PRODUCTTYPE": "Type", + "PRODUCTSUBSCRIPTION": "Duration", + "PRODUCTATUNIT": "Unit", + "INASSET": "Asset", + "PRODUCTININVOICE": "Products on the invoice", + "SUBSCRIPTIONS": "CUSTOMER SCHEDULE", + "SUBSCRIPTIONNAME": "Subscription", + "COMPANYNAME": "Company", + "NEXTINVOICE": "Next Invoice", + "SUBSCRIPTIONDETAIL": "Detail", + "PRODUCTDESCRIPTION": "Description", + "NETPRICE": "Price", + "DISCOUNT": "Discount", + "TAX": "Tax", + "ATTENDACELASTINVOICE": "Last invoice", + "ATTENDACENEXTINVOICE": "Next invoice", + "SELECT_PRODUCT": "Select product", + "SELECT_PRODUCTTYPE": "Select type", + "ALL_PRODUCTS": "All", + "ALL_STATUS": "All", + "PAYMENT_INFO": "Payment information", + "PAYMENTMETHOD": "Payment methods", + "PAYMENT": "Payment", + "DETAILS": "Details", + "INVOICEDETAILS": "INVOICE DETAILS", + "QUANTITY": "Quantity", + "MANAGESALES": "Subscriptions", + "ACCOUNTINGDOC": "Accounting", + "INVOICES": "INVOICES", + "PROFORMAS": "PROFORMA", + "PAYMENTS": "PAYMENTS", + "SELECT_PERIOD": "Select range", + "NO_PRODUCTPROFORMA_AVAILABLE": "No data available", + "NO_PRODUCTPRICELIST_AVAILABLE": "No data available", + "PROFORMAAUTHORIZED": "Authorized proforma", + "ADD_PRODUCTPRICELIST": "ADD PRODUCT", + "DELETE_PRODUCT": "Delete Product", + "AUTHORIZED": "AUTHORIZED", + "INVOICEDISCOUNT": "Discount", + "DEPOSIT": "DEPOSIT", + "BALANCE": "BALANCE", + "PRODUCTS": "PRODUCTS", + "INVOICENOPRODUCTDESCRIPTION": "Description on the invoice", + "INVOICENOPRODUCTAMOUNT": "Amount", + "INVOICENOTAXAMOUNT": "TAX", + "INVOICENOPRODUCTSAVE": "Save", + "INVOICENOPRODUCTUPDATE": "Update", + "PDFPROFORMA": "PDF", + "PDFINVOICE": "PDF", + "PAIDANDEXPIRED": "Payment", + "CREDITNOTE": "CREDIT NOTE", + "CREDITNOTE_INFO": "Credit Note", + "MOVECREDITNOTE": "SELF-CREDIT NOTE", + "CREDITNOTEDETAILS": "Credit Note Detail", + "PDFCREDITNOTE": "PDF", + "CREDITINOTENAME": "Name", + "TOTALPAYMENTS": "Total payments", + "PROFORMADETAILS": "Details", + "CREATIONDATE": "Created at", + "STARTDATE": "Invoice Date", + "ENDDATE": "Expiry Date", + "NUMBER": "Number", + "PRODUCTPRICE": "Price", + "PRODUCTTAX": "Tax percentage", + "PRODUCTQTY": "Quantity", + "UPDATE_PRODUCT": "Update Product", + "QUOTATIONPRODUCTTYPE": "Type", + "QUOTATIONUNIT": "Unit", + "QUOTATIONSUBSCRIPTION": "Duration", + "SELECT_PERIOD_CREATION": "Select Creation Date", + "SELECT_PERIOD_START": "Select Date", + "SELECT_PERIOD_EXPIRE": "Select Expiry Date", + "NEW_COMPANY": "New", + "COMPANIES": "Companies", + "PAYED_AY": "Payed on", + "CLONEPROFORMA": "Clone", + "COMPANYDESC": "Description", + "COMPANYNATION": "Nation", + "GRAPHINVOICES": "Invoice emission chart", + "YEARS": "Years", + "FROM": "From", + "TO": "To", + "INVOICEEMITED": "Issued", + "INVOICEPAYED": "Payed", + "INVOICETOTAL": "Total", + "CHOOSE": "Choose", + "ADVANCED_SEARCH": "Advanced Search", + "NEW_CONDITION": "New Condition", + "SELECT_FIELD": "Select field", + "SELECT_OPERATOR": "Select operator", + "VALUE": "Value", + "VALUES": "Values", + "APPLY": "Apply", + "MEET_ALL_CONDITIONS": "Meet all conditions", + "MEET_ANY_CONDITIONS": "Meet at least one condition", + "EQUALS": "Equals", + "IS_NOT_EQUAL": "Does not equal", + "IS_AMONG": "Is among", + "IS_NOT_AMONG": "Is not among", + "IS_GREATER_THAN": "Is greater than", + "IS_GREATER_THAN_OR_EQUAL_TO": "Is greater than or equal to", + "IS_LESS_THAN": "Is less than", + "IS_LESS_THAN_OR_EQUAL_TO": "Is less than or equal to", + "IS_BETWEEN": "Is between", + "CONTAINS": "Contains", + "STARTS_WITH": "Starts with", + "ENDS_WITH": "Ends with", + "STARTING_DATE": "Starting date", + "ENDING_DATE": "Ending date", + "STARTING_VALUE": "Starting value", + "ENDING_VALUE": "Ending value", + "VALUE_RANGE_CHECK": "Value must be greater than", + "AND": "And", + "ENABLED": "Enabled", + "DISABLED": "Disabled", + "ELAPSED_ANSWERED": "Elapsed time since call started", + "ELAPSED_DISPOSED": "Elapsed time since call ended", + "WHATSAPP": "WhatsApp Connector", + "WHATSAPP_INTERACTIONS": "WhatsApp Connector Interactions", + "SECOND_LEVEL_DISPOSITION": "Second Level Disposition", + "THIRD_LEVEL_DISPOSITION": "Third Level Disposition", + "VIDAOOSESSION": "Start Video Call", + "SELECT_CONTACT": "Select contact", + "SELECT": "Select", + "LAST_UPDATED": "Last updated", + "MATCHING_FIELD": "Matching field", + "MULTIPLE_CONTACTS_FOUND": "Multiple contacts found for number", + "WHICH_ONE_TO_USE": "Which one do you want to use?", + "LICENSE_EXPIRE_REMAINING_DAYS": "Your license is about to expire! Please contact your Administrator", + "NO_RESULTS_AVAILABLE": "No results available", + "AVAILABLE": "Available", + "AGENT_PRESENCE": "Agent Presence", + "SELECT_TEAM": "Select Team", + "NOTIFICATIONS": { + "TRANSFER_AGENT_EXECUTED": "Transfer to agent successfully executed", + "TRANSFER_QUEUE_EXECUTED": "Transfer to queue successfully executed" + }, + "LIMIT_TABS_REACHED": "Maximum number of open tabs reached", + "WAITING_CALLS": "Waiting Calls", + "WAITING_INTERACTIONS": "Waiting Interactions" + } +} diff --git a/public/app/main/apps/dashboards/i18n/ja.json b/public/app/main/apps/dashboards/i18n/ja.json index 7971add..eae6747 100644 --- a/public/app/main/apps/dashboards/i18n/ja.json +++ b/public/app/main/apps/dashboards/i18n/ja.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "電話に連絡する", "RECALLME_CALL_REMINDER": "リコールミーコールリマインダー", "SCHEDULED_TIME": "予定時間", - "UPCOMING_RECALLME_CALL": "今後のリコールミーコール" + "UPCOMING_RECALLME_CALL": "今後のリコールミーコール", + "WAITING_CALLS": "待機中の電話", + "WAITING_INTERACTIONS": "相互作用を待っています" } } diff --git a/public/app/main/apps/dashboards/i18n/ko.json b/public/app/main/apps/dashboards/i18n/ko.json index bfd643f..622d508 100644 --- a/public/app/main/apps/dashboards/i18n/ko.json +++ b/public/app/main/apps/dashboards/i18n/ko.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "연락 전화 번호", "RECALLME_CALL_REMINDER": "나에게 전화 걸기 알림", "SCHEDULED_TIME": "예정된 시간", - "UPCOMING_RECALLME_CALL": "리콜 미 콜 예정" + "UPCOMING_RECALLME_CALL": "리콜 미 콜 예정", + "WAITING_CALLS": "통화 대기", + "WAITING_INTERACTIONS": "대기 상호 작용" } } diff --git a/public/app/main/apps/dashboards/i18n/lt.json b/public/app/main/apps/dashboards/i18n/lt.json index 21fa3cd..c947204 100644 --- a/public/app/main/apps/dashboards/i18n/lt.json +++ b/public/app/main/apps/dashboards/i18n/lt.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "Kontaktinis Telefonas", "RECALLME_CALL_REMINDER": "„Recall Me“ skambučio priminimas", "SCHEDULED_TIME": "Numatytas laikas", - "UPCOMING_RECALLME_CALL": "Būsimas „Recall Me“ skambutis" + "UPCOMING_RECALLME_CALL": "Būsimas „Recall Me“ skambutis", + "WAITING_CALLS": "Laukia skambučiai", + "WAITING_INTERACTIONS": "Laukiama sąveika" } } diff --git a/public/app/main/apps/dashboards/i18n/lv.json b/public/app/main/apps/dashboards/i18n/lv.json index f70d78b..c5fceea 100644 --- a/public/app/main/apps/dashboards/i18n/lv.json +++ b/public/app/main/apps/dashboards/i18n/lv.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "Kontakttālrunis", "RECALLME_CALL_REMINDER": "Atgādināt man zvanu atgādinājums", "SCHEDULED_TIME": "Plānotais laiks", - "UPCOMING_RECALLME_CALL": "Gaidāmais Recall Me zvans" + "UPCOMING_RECALLME_CALL": "Gaidāmais Recall Me zvans", + "WAITING_CALLS": "Zvanu gaidīšana", + "WAITING_INTERACTIONS": "Mijiedarbības gaidīšana" } } diff --git a/public/app/main/apps/dashboards/i18n/nl.json b/public/app/main/apps/dashboards/i18n/nl.json index 55e3cf9..6a693b5 100644 --- a/public/app/main/apps/dashboards/i18n/nl.json +++ b/public/app/main/apps/dashboards/i18n/nl.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "Neem contact op met telefoon", "RECALLME_CALL_REMINDER": "Herinner mij oproepherinnering", "SCHEDULED_TIME": "Geplande tijd", - "UPCOMING_RECALLME_CALL": "Aankomende oproep voor terugroepactie" + "UPCOMING_RECALLME_CALL": "Aankomende oproep voor terugroepactie", + "WAITING_CALLS": "Oproepen in de wacht", + "WAITING_INTERACTIONS": "Wachtende interacties" } } diff --git a/public/app/main/apps/dashboards/i18n/no.json b/public/app/main/apps/dashboards/i18n/no.json index 9d354d3..40a9d0e 100644 --- a/public/app/main/apps/dashboards/i18n/no.json +++ b/public/app/main/apps/dashboards/i18n/no.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "kontakt telefon", "RECALLME_CALL_REMINDER": "Tilbakekall meg ringepåminnelse", "SCHEDULED_TIME": "Planlagt tid", - "UPCOMING_RECALLME_CALL": "Kommende Recall Me-samtale" + "UPCOMING_RECALLME_CALL": "Kommende Recall Me-samtale", + "WAITING_CALLS": "Ventende anrop", + "WAITING_INTERACTIONS": "Ventende interaksjoner" } } diff --git a/public/app/main/apps/dashboards/i18n/pl.json b/public/app/main/apps/dashboards/i18n/pl.json index b032714..8d4594c 100644 --- a/public/app/main/apps/dashboards/i18n/pl.json +++ b/public/app/main/apps/dashboards/i18n/pl.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "telefon kontaktowy", "RECALLME_CALL_REMINDER": "Przypomnij mi przypomnienie o połączeniu", "SCHEDULED_TIME": "Zaplanowany czas", - "UPCOMING_RECALLME_CALL": "Nadchodzące połączenie Przypomnij mnie" + "UPCOMING_RECALLME_CALL": "Nadchodzące połączenie Przypomnij mnie", + "WAITING_CALLS": "Połączenia oczekujące", + "WAITING_INTERACTIONS": "Interakcje oczekujące" } } diff --git a/public/app/main/apps/dashboards/i18n/pt-BR.json b/public/app/main/apps/dashboards/i18n/pt-BR.json index 760ba7d..38d32a2 100644 --- a/public/app/main/apps/dashboards/i18n/pt-BR.json +++ b/public/app/main/apps/dashboards/i18n/pt-BR.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "telefone de contato", "RECALLME_CALL_REMINDER": "Lembrete de chamada de Recall Me", "SCHEDULED_TIME": "Hora marcada", - "UPCOMING_RECALLME_CALL": "Próxima chamada de Recall Me" + "UPCOMING_RECALLME_CALL": "Próxima chamada de Recall Me", + "WAITING_CALLS": "Chamadas em espera", + "WAITING_INTERACTIONS": "Interações em espera" } } diff --git a/public/app/main/apps/dashboards/i18n/pt-PT.json b/public/app/main/apps/dashboards/i18n/pt-PT.json index 1931296..8b34987 100644 --- a/public/app/main/apps/dashboards/i18n/pt-PT.json +++ b/public/app/main/apps/dashboards/i18n/pt-PT.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "telefone de contato", "RECALLME_CALL_REMINDER": "Lembrete de chamada de Recall Me", "SCHEDULED_TIME": "Hora marcada", - "UPCOMING_RECALLME_CALL": "Próxima chamada de Recall Me" + "UPCOMING_RECALLME_CALL": "Próxima chamada de Recall Me", + "WAITING_CALLS": "Chamadas em espera", + "WAITING_INTERACTIONS": "Interações em espera" } } diff --git a/public/app/main/apps/dashboards/i18n/ru.json b/public/app/main/apps/dashboards/i18n/ru.json index 76debab..cd87ab5 100644 --- a/public/app/main/apps/dashboards/i18n/ru.json +++ b/public/app/main/apps/dashboards/i18n/ru.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "Контактный телефон", "RECALLME_CALL_REMINDER": "Напомнить мне о звонке", "SCHEDULED_TIME": "Запланированное время", - "UPCOMING_RECALLME_CALL": "Предстоящий вызов «Напомнить мне»" + "UPCOMING_RECALLME_CALL": "Предстоящий вызов «Напомнить мне»", + "WAITING_CALLS": "Ожидание звонков", + "WAITING_INTERACTIONS": "Ожидающие взаимодействия" } } diff --git a/public/app/main/apps/dashboards/i18n/sv.json b/public/app/main/apps/dashboards/i18n/sv.json index cdc4504..a74581e 100644 --- a/public/app/main/apps/dashboards/i18n/sv.json +++ b/public/app/main/apps/dashboards/i18n/sv.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "Kontakt Telefon", "RECALLME_CALL_REMINDER": "Ring mig påminnelse", "SCHEDULED_TIME": "Schemalagd tid", - "UPCOMING_RECALLME_CALL": "Kommande Recall Me-samtal" + "UPCOMING_RECALLME_CALL": "Kommande Recall Me-samtal", + "WAITING_CALLS": "Väntande samtal", + "WAITING_INTERACTIONS": "Väntar på interaktioner" } } diff --git a/public/app/main/apps/dashboards/i18n/tr.json b/public/app/main/apps/dashboards/i18n/tr.json index b5b8081..e173ec1 100644 --- a/public/app/main/apps/dashboards/i18n/tr.json +++ b/public/app/main/apps/dashboards/i18n/tr.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "İletişim Telefonu", "RECALLME_CALL_REMINDER": "Beni Hatırla çağrı hatırlatıcısı", "SCHEDULED_TIME": "Planlanmış zaman", - "UPCOMING_RECALLME_CALL": "Yaklaşan Beni Geri Çağır araması" + "UPCOMING_RECALLME_CALL": "Yaklaşan Beni Geri Çağır araması", + "WAITING_CALLS": "Bekleyen Aramalar", + "WAITING_INTERACTIONS": "Bekleyen Etkileşimler" } } diff --git a/public/app/main/apps/dashboards/i18n/zh-CN.json b/public/app/main/apps/dashboards/i18n/zh-CN.json index 4a3630d..42c9ea0 100644 --- a/public/app/main/apps/dashboards/i18n/zh-CN.json +++ b/public/app/main/apps/dashboards/i18n/zh-CN.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "联系电话", "RECALLME_CALL_REMINDER": "Recall Me 来电提醒", "SCHEDULED_TIME": "计划的时间", - "UPCOMING_RECALLME_CALL": "即将到来的 Recall Me 电话" + "UPCOMING_RECALLME_CALL": "即将到来的 Recall Me 电话", + "WAITING_CALLS": "等待电话", + "WAITING_INTERACTIONS": "等待互动" } } diff --git a/public/app/main/apps/dashboards/i18n/zh-TW.json b/public/app/main/apps/dashboards/i18n/zh-TW.json index 2d4380f..3495a7b 100644 --- a/public/app/main/apps/dashboards/i18n/zh-TW.json +++ b/public/app/main/apps/dashboards/i18n/zh-TW.json @@ -586,6 +586,8 @@ "CONTACT_PHONE": "聯繫電話", "RECALLME_CALL_REMINDER": "Recall Me 來電提醒", "SCHEDULED_TIME": "計劃的時間", - "UPCOMING_RECALLME_CALL": "即將到來的 Recall Me 電話" + "UPCOMING_RECALLME_CALL": "即將到來的 Recall Me 電話", + "WAITING_CALLS": "等待電話", + "WAITING_INTERACTIONS": "等待互動" } } diff --git a/public/app/main/apps/fax/i18n/bs.json b/public/app/main/apps/fax/i18n/bs.json index bc9aa75..b099aa4 100644 --- a/public/app/main/apps/fax/i18n/bs.json +++ b/public/app/main/apps/fax/i18n/bs.json @@ -1,261 +1,261 @@ { "FAX": { - "LOGIN_TIME": "Login time", - "PAUSE_TIME": "Pause time", - "DOWNLOAD_INTERACTION": "Download", - "TRANSFER": "Transfer", - "QUEUETRANSFER": "Queue Transfer", - "QUEUETRANSFERTIMEOUT": "Queue Transfer Timeout", - "AGENTTRANSFER": "Agent Transfer", - "AGENTTRANSFERTIMEOUT": "Agent Transfer Timeout", + "LOGIN_TIME": "Vrijeme prijave", + "PAUSE_TIME": "Vrijeme Pauze", + "DOWNLOAD_INTERACTION": "Skini", + "TRANSFER": "Prijenos", + "QUEUETRANSFER": "Queue Prijenos", + "QUEUETRANSFERTIMEOUT": "Timeout Queue Prijenosa", + "AGENTTRANSFER": "Prijenost Specijaliste", + "AGENTTRANSFERTIMEOUT": "Timeout Prijenosa Specijaliste", "TAG": "Tag", - "EDIT_TAG": "Edit Tag", - "WAITFORTHEASSIGNEDAGENT": "Wait for the assigned agent", - "NOTIFICATION": "Notification", - "NOTIFICATIONSOUND": "Sound", - "NOTIFICATIONSHAKE": "Shake", - "NOTIFICATIONTEMPLATE": "Template", - "SYSTEM": "System", - "EDIT_SYSTEM": "Edit System", - "COMMAND": "Command", - "VARIABLE": "Variable", - "CANNEDANSWERS": "Canned Answers", - "FAXCANNEDANSWERS": "Canned Answers", - "NO_FAXCANNEDANSWER_AVAILABLE": "No Canned Answers Available", - "NEW_FAXCANNEDANSWER": "New Canned Answer", - "ADD_FAXCANNEDANSWER": "Add Canned Answer", - "EDIT_CHATCANNEDANSWER": "Edit Canned Answer", - "DELETE_CHATCANNEDANSWER": "Delete Canned Answer", + "EDIT_TAG": "Uredi Tag", + "WAITFORTHEASSIGNEDAGENT": "Pričekaj dodijeljenog specijalistu", + "NOTIFICATION": "Notifikacija", + "NOTIFICATIONSOUND": "Zvuk", + "NOTIFICATIONSHAKE": "Protresi", + "NOTIFICATIONTEMPLATE": "Šablon", + "SYSTEM": "Sistem", + "EDIT_SYSTEM": "Uredi Sistem", + "COMMAND": "Komanda", + "VARIABLE": "Varijabla", + "CANNEDANSWERS": "Pripremljeni Odgovori", + "FAXCANNEDANSWERS": "Pripremljeni Odgovori", + "NO_FAXCANNEDANSWER_AVAILABLE": "Nema dostupnih Pripremljenih odgovora", + "NEW_FAXCANNEDANSWER": "Novi Pripremljeni Odgovor", + "ADD_FAXCANNEDANSWER": "Dodaj Pripremljeni odgovor", + "EDIT_CHATCANNEDANSWER": "Uredi Pripremljeni Odgovor", + "DELETE_CHATCANNEDANSWER": "Izbriši Pripremljeni Odgovor", "SPYINTERACTION": "Spy", - "TAGS": "Tags", - "REPLY": "Reply", - "SEND": "Send", - "TO": "To", - "FROM": "From", - "NO_AGENT_ONLINE": "No Agent Online", - "GOTOREALTIME_FAXQUEUE": "Go To Realtime Fax Queue", - "EDIT_TRUNK": "Edit Trunk", - "REGISTERED": "Registered", - "UNREGISTERED": "Unregistered", - "EDIT_ACCOUNT": "Edit Fax Account", - "PARTIALPAUSE": "Partial Pause", - "BUSY": "Busy", + "TAGS": "Tag-ovi", + "REPLY": "Odgovori", + "SEND": "Pošalji", + "TO": "Do", + "FROM": "Od", + "NO_AGENT_ONLINE": "Nema Online Specijalista", + "GOTOREALTIME_FAXQUEUE": "Idi na Realtime Fax Queue", + "EDIT_TRUNK": "Uredi Trunk", + "REGISTERED": "Registrovano", + "UNREGISTERED": "Neregistrovano", + "EDIT_ACCOUNT": "Uredi Fax Nalog", + "PARTIALPAUSE": "Djelomična Pauza", + "BUSY": "Zauzet", "TIMER": "Timer", - "IDLE": "Idle", - "CAPACITY": "Capacity", - "GOTO_FAXACCOUNT": "Go To Realtime Fax", - "ACCOUNTS": "Accounts", - "GOTOREALTIME_FAXACCOUNT": "Go To Realtime Fax", - "TRUNK_STATUS": "Trunk Status", - "TRUNKS": "Trunks", - "REGISTRY": "Registry", - "NO_REGISTRY": "No Registry", - "PAUSE": "Pause", + "IDLE": "Neaktivan", + "CAPACITY": "Kapacitet", + "GOTO_FAXACCOUNT": "Idi na Realtime Fax", + "ACCOUNTS": "Nalozi", + "GOTOREALTIME_FAXACCOUNT": "Idi na Realtime Fax", + "TRUNK_STATUS": "Status Trunka", + "TRUNKS": "Trunk-ovi", + "REGISTRY": "Registar", + "NO_REGISTRY": "Nema Registra", + "PAUSE": "Pauza", "INFO": "Info", - "FULLNAME": "Fullname", - "INTERNAL": "Internal", - "PHONE_STATE": "Phone State", - "PHONE_STATUS": "Phone Status", - "LOGOUT": "Logout", - "DEFAULT_PAUSE": "Default pause", - "AGENTADD_QUEUE": "Add Agent to Fax queue", - "AGENTSADD_QUEUE": "Add Agents to Fax queue", - "UNPAUSE": "End Pause", - "AGENTS": "Agents", + "FULLNAME": "Puno ime", + "INTERNAL": "Unutrašnji", + "PHONE_STATE": "Stanje Telefona", + "PHONE_STATUS": "Status Telefona", + "LOGOUT": "Odjava", + "DEFAULT_PAUSE": "Zadana pauza ", + "AGENTADD_QUEUE": "Dodaj Specijalistu na Fax Queue", + "AGENTSADD_QUEUE": "Dodaj Specijalistu na Fax Queue", + "UNPAUSE": "Prekini Pauzu", + "AGENTS": "Specijalisti", "QUEUES": "Queues", - "LOGGED_IN": "Logged in", - "PAUSED": "Paused", - "READY": "Ready", - "WAITING": "Waiting", - "PRIORITY": "Priority", - "CONDITION": "Condition", - "TRUEPRIORITY": "True Priority", - "FALSEPRIORITY": "False Priority", - "VALUE": "Value", - "EDIT_FAXQUEUE": "Edit Fax Queue", - "EDIT_AGENT": "Edit Agent", - "EDIT_GOTO": "Edit Goto", - "EDIT_NOOP": "Edit Noop", - "EDIT_GOTOP": "Edit GotoP", - "EDIT_GOTOIF": "Edit GotoIf", - "EDIT_QUEUE": "Edit Fax Queue", - "EDIT_CLOSE": "Edit Close", + "LOGGED_IN": "Prijavljen", + "PAUSED": "Pauzirano", + "READY": "Spreman", + "WAITING": "Čeka", + "PRIORITY": "Prioritet", + "CONDITION": "Stanje", + "TRUEPRIORITY": "Tačan Prioritet", + "FALSEPRIORITY": "Pogrešan Prioritet", + "VALUE": "Vrijednost", + "EDIT_FAXQUEUE": "Uredi Fax Queue", + "EDIT_AGENT": "Uredi Specijalistu", + "EDIT_GOTO": "Uredi Goto", + "EDIT_NOOP": "Uredi Noop", + "EDIT_GOTOP": "Uredi GoToP", + "EDIT_GOTOIF": "Uredi GoToIf", + "EDIT_QUEUE": "Uredi Fax Queue", + "EDIT_CLOSE": "Uredi Zatvaranje", "QUEUE": "Queue", "GOTOIF": "GotoIf", "GOTOP": "GotoP", "NOOP": "Noop", - "AGENT": "Agent", - "NOTES": "Notes", - "CLOSEDAT": "Closed At", - "DISPOSITION": "Disposition", + "AGENT": "Specijalist", + "NOTES": "Bilješke", + "CLOSEDAT": "Zatvoreno U", + "DISPOSITION": "Dispozicija", "REALTIME": "Realtime", - "TEAMADD_FAXQUEUE": "Add Team to Fax Queue", - "AGENTADD_FAXQUEUE": "Add Agent to Fax Queue", - "NAME": "Name", + "TEAMADD_FAXQUEUE": "Dodaj Tim u Fax Queue", + "AGENTADD_FAXQUEUE": "Dodaj Specijalistu na Fax Queue", + "NAME": "Ime", "FAXQUEUES": "Fax Queues", - "SEARCH_FOR_ANYONE": "Search", - "MANDATORYDISPOSITION": "Mandatory disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pause status when in mandatory disposition", + "SEARCH_FOR_ANYONE": "Traži", + "MANDATORYDISPOSITION": "Obavezna dispozicija", + "MANDATORYDISPOSITIONPAUSEID": "Status pauze kada je u obaveznoj dispoziciji", "ERRORS": { - "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "QUEUETRANSFERTIMEOUT_REQUIRED": "Mandatory Field", - "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "AGENTTRANSFERTIMEOUT_REQUIRED": "Mandatory Field", - "TAG_REQUIRED": "Mandatory Field", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Mandatory Field", - "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "NAME_MUST_VALID_PATTERN": "Wrong format", - "COMMAND_REQUIRED": "Mandatory Field", - "TEXT_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "TEXT_REQUIRED": "Mandatory Field", - "VALUE_REQUIRED": "Mandatory Field", - "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "AGENT_REQUIRED": "Mandatory Field", - "QUEUE_REQUIRED": "Mandatory Field", - "TRUEPRIORITY_REQUIRED": "Mandatory Field", - "FALSEPRIORITY_REQUIRED": "Mandatory Field", - "CONDITION_REQUIRED": "Mandatory Field", - "PRIORITY_REQUIRED": "Mandatory Field", - "DISPOSITION_REQUIRED": "Mandatory Field", - "NAME_REQUIRED": "Mandatory Field", - "AGENT_TIMEOUT_REQUIRED": "Mandatory Field", - "MOTIONADDRESS_REQUIRED": "Mandatory Field", - "MOTIONADDRESS_MUST_VALID_URL": "Wrong format", - "LOCALSTATIONID_REQUIRED": "Mandatory Field", - "MODEM_REQUIRED": "Mandatory Field", - "GATEWAY_REQUIRED": "Mandatory Field", - "FAXDETECT_REQUIRED": "Mandatory Field", - "T38TIMEOUT_REQUIRED": "Mandatory Field", - "TIMEOUT_REQUIRED": "Mandatory Field", - "HEADERINFO_REQUIRED": "Mandatory Field", - "TRUNK_REQUIRED": "Mandatory Field", - "LIST_REQUIRED": "Mandatory Field", - "KEY_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "KEY_REQUIRED": "Mandatory Field", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "You should specify a pause status when in mandatory disposition" + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja od ili jednaka", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Obavezno polje", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednst mora bit manja od ili jednaka", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Obavezno polje", + "TAG_REQUIRED": "Obavezno polje", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja od ili jednaka", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Obavezno polje", + "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja od ili jednaka", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja od ili jednaka", + "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "NAME_MUST_VALID_PATTERN": "Pogrešan format", + "COMMAND_REQUIRED": "Obavezno polje", + "TEXT_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "TEXT_REQUIRED": "Obavezno polje", + "VALUE_REQUIRED": "Obavezno polje", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "AGENT_REQUIRED": "Obavezno polje", + "QUEUE_REQUIRED": "Obavezno polje", + "TRUEPRIORITY_REQUIRED": "Obavezno polje", + "FALSEPRIORITY_REQUIRED": "Obavezno polje", + "CONDITION_REQUIRED": "Obavezno polje", + "PRIORITY_REQUIRED": "Obavezno polje", + "DISPOSITION_REQUIRED": "Obavezno polje", + "NAME_REQUIRED": "Obavezno polje", + "AGENT_TIMEOUT_REQUIRED": "Obavezno polje", + "MOTIONADDRESS_REQUIRED": "Obavezno polje", + "MOTIONADDRESS_MUST_VALID_URL": "Pogrešan format", + "LOCALSTATIONID_REQUIRED": "Obavezno polje", + "MODEM_REQUIRED": "Obavezno polje", + "GATEWAY_REQUIRED": "Obavezno polje", + "FAXDETECT_REQUIRED": "Obavezno polje", + "T38TIMEOUT_REQUIRED": "Obavezno polje", + "TIMEOUT_REQUIRED": "Obavezno polje", + "HEADERINFO_REQUIRED": "Obavezno polje", + "TRUNK_REQUIRED": "Obavezno polje", + "LIST_REQUIRED": "Obavezno polje", + "KEY_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "KEY_REQUIRED": "Obavezno polje", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Trebalo bi navesti status pauze kada je u obaveznoj dispoziciji" }, - "STRATEGY": "Strategy", - "AGENT_TIMEOUT": "Agent Timeout", - "DESCRIPTION": "Description", - "ADD_FAXQUEUE": "Add Fax Queue", - "DELETE_FAXQUEUE": "Delete Fax Queue", - "CREATED_AT": "Created At", - "SAVE": "Save", - "SETTINGS": "Settings", - "GENERAL": "General", - "FAXACCOUNTS": "Fax Accounts", - "MOTIONADDRESS": "Motion Address", - "ADD_FAXACCOUNT": "Add Fax Account", - "EDIT_FAXACCOUNT": "Edit Fax Account", - "DELETE_FAXACCOUNT": "Delete Fax Account", - "DISPOSITIONS": "Dispositions", + "STRATEGY": "Strategija", + "AGENT_TIMEOUT": "Specijalista Timeout", + "DESCRIPTION": "Opis", + "ADD_FAXQUEUE": "Dodaj Fax Queue", + "DELETE_FAXQUEUE": "Izbriši Fax Queue", + "CREATED_AT": "Kreirano U", + "SAVE": "Sačuvaj", + "SETTINGS": "Postavke", + "GENERAL": "Općenito", + "FAXACCOUNTS": "Fax Nalozi", + "MOTIONADDRESS": "Motion Adresa", + "ADD_FAXACCOUNT": "Dodaj Fax Nalog", + "EDIT_FAXACCOUNT": "Uredi Fax Nalog", + "DELETE_FAXACCOUNT": "Izbriši Fax Nalog", + "DISPOSITIONS": "Dispozicije", "WEBHOOKS": "WebHooks", - "ACTIONS": "Actions", - "LIST": "List", - "FIDELITY": "Fidelity", - "ACCEPT": "Accept", - "ACCEPTMETHOD": "Accept Method", - "ACCEPTURL": "Accept URL", - "REJECT": "Reject", - "REJECTMETHOD": "Reject Method", - "REJECTURL": "Reject URL", - "CLOSE": "Close", - "CLOSEMETHOD": "Close Method", - "CLOSEURL": "Close URL", + "ACTIONS": "Radnje", + "LIST": "Lista", + "FIDELITY": "Vjernost", + "ACCEPT": "Prihvati", + "ACCEPTMETHOD": "Prihvati Metodu", + "ACCEPTURL": "Prihvati URL", + "REJECT": "Odbaci", + "REJECTMETHOD": "Metoda odbacivanja", + "REJECTURL": "Odbaci URL", + "CLOSE": "Zatvori", + "CLOSEMETHOD": "Metoda Zatvaranja", + "CLOSEURL": "Zatvori URL", "TRUNK": "Trunk", - "LOCALSTATIONID": "Local Station Identifier", + "LOCALSTATIONID": "Identifikator Lokalne Stanice", "HELP": { - "LOCALSTATIONID": "Local Station Identifier (telephone number)", - "HEADERINFO": "Outbound Fax Header information", - "MODEM": "Modem Type (v17/v27/v29)", - "GATEWAY": "T.38 Fax Gateway, with optional fax activity timeout in seconds (yes/no/[timeout])", - "FAXDETECT": "Enable Fax Detect with optional timeout in seconds (yes/t38/cng/[timeout]/no)", - "T38TIMEOUT": "The timeout used for T.38 negotiation (minimum value=1000)", + "LOCALSTATIONID": "Identifikator Lokalne Stanice (telefonski broj)", + "HEADERINFO": "Informacije Zaglavlja Odlaznog Fax-a", + "MODEM": "Vrsta Modema (v17/v27/v29)", + "GATEWAY": "T.38 Fax Gateway, sa opcionalnim timeout-om aktivnosti faxa u sekundama (yes/no/[timeout])", + "FAXDETECT": "Omogući Otkrivanje Fax-a sa opcionalnim timeout-om u sekundama (yes/t38/cng/[timeout]/no)", + "T38TIMEOUT": "Vremensko ograničenje korišteno za T.38 pregovaranje (minimalna vrijednost=1000)", "ECM": "Error Connection Mode (ECM)", - "MINRATE": "Minimum transfer rate set before transmission", - "MAXRATE": "Maximum transfer rate set before transmission", - "MANDATORYDISPOSITION": "Mandatory disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pause status for mandatory disposition", - "NAME": "Only numbers, letters and specific characters (._) are supported" + "MINRATE": "Minimalna brzina prijenosa postavljena prije prijenosa", + "MAXRATE": "Maksimalna brzina prijenosa postavljena prije prijenosa", + "MANDATORYDISPOSITION": "Obavezna dispozicija", + "MANDATORYDISPOSITIONPAUSEID": "Status pauze za obaveznu dispoziciju", + "NAME": "Podržani su samo brojevi, slova i specifični znakovi (._)" }, - "ADVANCED": "Advanced", + "ADVANCED": "Napredno", "ECM": "ECM", - "MINRATE": "Min Rate", - "MAXRATE": "Max Rate", + "MINRATE": "Minimalna Brzina", + "MAXRATE": "Maksimalna Brzina", "MODEM": "Modem", "GATEWAY": "Gateway", - "FAXDETECT": "Fax Detect", + "FAXDETECT": "Fax Otkrivanje", "T38TIMEOUT": "T.38 Timeout", - "SIP": "Technology", - "HEADERINFO": "Header Info", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "BACK": "Back", + "SIP": "Tehnologija", + "HEADERINFO": "Informacije Zaglavlja", + "SELECTED": "Odabrano", + "SELECT_ALL": "Odaberi Sve", + "SELECT_NONE": "Odaberi Ništa", + "BACK": "Nazad", "FAX": "Fax", - "ID": "Id", + "ID": "ID", "TIMEOUT": "Timeout", - "FAXDISPOSITIONS": "Fax Dispositions", + "FAXDISPOSITIONS": "Fax Dispozicije", "NO_FAXDISPOSITION_AVAILABLE": "No Fax Dispositions available", - "NEW_FAXDISPOSITION": "New Fax Disposition", - "ADD_FAXDISPOSITION": "Add Fax Disposition", - "EDIT_FAXDISPOSITION": "Edit Fax Disposition", - "DELETE_FAXDISPOSITION": "Delete Fax Disposition", - "NEW_FAXQUEUE": "New Fax Queue", - "NEW_FAXACCOUNT": "New Fax Account", - "NO_AVAILABLE_INFO": "No available info", - "ALL_TEAMS": "All Teams", - "SELECTED_TEAMS": "Selected Teams", - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", - "DELETE": "Delete", - "KEY": "Key", - "ALL_AGENTS": "All Agents", - "SELECTED_AGENTS": "Selected Agents", + "NEW_FAXDISPOSITION": "Nova Fax Dispozicija", + "ADD_FAXDISPOSITION": "Dodaj Fax Dispoziciju", + "EDIT_FAXDISPOSITION": "Uredi Fax Dispoziciju", + "DELETE_FAXDISPOSITION": "Izbriši Fax Dispoziciju", + "NEW_FAXQUEUE": "Novi Fax Queue", + "NEW_FAXACCOUNT": "Novi Fax Nalog", + "NO_AVAILABLE_INFO": "Nema dostupnih informacija", + "ALL_TEAMS": "Svi TImovi", + "SELECTED_TEAMS": "Odabrani Timovi", + "PAGE": "Stranica", + "ROWSPERPAGE": "Redova po stranici", + "OF": "od", + "DELETE": "Izbriši", + "KEY": "Ključ", + "ALL_AGENTS": "Svi Specijalisti", + "SELECTED_AGENTS": "Odabrani Specijalisti", "FILTER": "Filter", - "SELECT_STATUS": "Select Status", - "ALL": "All", - "CLOSED": "Closed", - "OPENED": "Opened", - "SELECT_ACCOUNT": "Select Account", - "INTERACTIONS": "Interactions", - "CONTACT": "Contact", - "STARTEDAT": "Started At", - "LASTMESSAGE": "Last message", + "SELECT_STATUS": "Odaberi Status", + "ALL": "Svi", + "CLOSED": "Zatvoreno", + "OPENED": "Otvoreno", + "SELECT_ACCOUNT": "Odaberi Nalog", + "INTERACTIONS": "Interakcije", + "CONTACT": "Kontakt", + "STARTEDAT": "Počelo U", + "LASTMESSAGE": "Zadnja poruka", "STATUS": "Status", - "ACCOUNT": "Account", - "UNKNOWN": "Unknown", - "UNAVAILABLE": "Unavailable", - "NOT_INUSE": "Not in use", - "REACHABLE": "Reachable", - "IN_USE": "In use", + "ACCOUNT": "Nalog", + "UNKNOWN": "Nepoznato", + "UNAVAILABLE": "Nedostupno", + "NOT_INUSE": "Nije u upotrebi", + "REACHABLE": "Dostupno", + "IN_USE": "U upotrebi", "VOICE": "Voice", "CHAT": "Chat", - "MAIL": "Email", + "MAIL": "E-mail", "SMS": "SMS", - "OPENCHANNEL": "Open Channel", - "TOTAL": "Total", - "IN": "In", - "OUT": "Out", - "NO_INTERACTION_AVAILABLE": "No interactions available", - "INTERACTIONS_FAXACCOUNT": "Go to Interactions", - "REFRESH_INTERACTIONS": "Refresh Interactions", - "DELETE_INTERACTION": "Delete Interaction", - "AGENTADD_FAXACCOUNT": "Add Agent to Fax Account", - "TEAMS_ASSOCIATION": "Teams Association", - "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", - "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available", - "DOWNLOAD_WITH_ATTACHMENTS": "Download with attachments", - "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download without attachments" + "OPENCHANNEL": "Otvoreni Kanal", + "TOTAL": "Ukupno", + "IN": "IN", + "OUT": "Van", + "NO_INTERACTION_AVAILABLE": "Nema dostupnih Interakcija", + "INTERACTIONS_FAXACCOUNT": "Idi na Interakcije", + "REFRESH_INTERACTIONS": "Osvježi Interakcije", + "DELETE_INTERACTION": "Izbriši Interakciju", + "AGENTADD_FAXACCOUNT": "Dodaj Specijalistu na Fax Nalog", + "TEAMS_ASSOCIATION": "Asocijacija Timova", + "TOOLTIP_SCREENRECORDING_ON": "Snimanje Ekrana je u toku", + "TOOLTIP_SCREENRECORDING_OFF": "Snimanje Ekrana je dostupno", + "DOWNLOAD_WITH_ATTACHMENTS": "Skini sa prilogom", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Skini bez priloga" } } diff --git a/public/app/main/apps/fax/i18n/et.json b/public/app/main/apps/fax/i18n/et.json index fd6d9b8..13373f5 100644 --- a/public/app/main/apps/fax/i18n/et.json +++ b/public/app/main/apps/fax/i18n/et.json @@ -139,7 +139,8 @@ "LIST_REQUIRED": "Kohustuslik Väli", "KEY_MAX_LENGTH": "Väärtuse maksimaalne pikkus peab olema võrdne {{maks}}", "KEY_REQUIRED": "Kohustuslik Väli", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Pead pausi oleku määrama, kui see on kohustuslik" + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Pead pausi oleku määrama, kui see on kohustuslik", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Väärtus peab olema suurem või võrdne sellega" }, "STRATEGY": "Strateegia", "AGENT_TIMEOUT": "Agendi Aegumine", diff --git a/public/app/main/apps/fax/i18n/is.json b/public/app/main/apps/fax/i18n/is.json new file mode 100644 index 0000000..bc9aa75 --- /dev/null +++ b/public/app/main/apps/fax/i18n/is.json @@ -0,0 +1,261 @@ +{ + "FAX": { + "LOGIN_TIME": "Login time", + "PAUSE_TIME": "Pause time", + "DOWNLOAD_INTERACTION": "Download", + "TRANSFER": "Transfer", + "QUEUETRANSFER": "Queue Transfer", + "QUEUETRANSFERTIMEOUT": "Queue Transfer Timeout", + "AGENTTRANSFER": "Agent Transfer", + "AGENTTRANSFERTIMEOUT": "Agent Transfer Timeout", + "TAG": "Tag", + "EDIT_TAG": "Edit Tag", + "WAITFORTHEASSIGNEDAGENT": "Wait for the assigned agent", + "NOTIFICATION": "Notification", + "NOTIFICATIONSOUND": "Sound", + "NOTIFICATIONSHAKE": "Shake", + "NOTIFICATIONTEMPLATE": "Template", + "SYSTEM": "System", + "EDIT_SYSTEM": "Edit System", + "COMMAND": "Command", + "VARIABLE": "Variable", + "CANNEDANSWERS": "Canned Answers", + "FAXCANNEDANSWERS": "Canned Answers", + "NO_FAXCANNEDANSWER_AVAILABLE": "No Canned Answers Available", + "NEW_FAXCANNEDANSWER": "New Canned Answer", + "ADD_FAXCANNEDANSWER": "Add Canned Answer", + "EDIT_CHATCANNEDANSWER": "Edit Canned Answer", + "DELETE_CHATCANNEDANSWER": "Delete Canned Answer", + "SPYINTERACTION": "Spy", + "TAGS": "Tags", + "REPLY": "Reply", + "SEND": "Send", + "TO": "To", + "FROM": "From", + "NO_AGENT_ONLINE": "No Agent Online", + "GOTOREALTIME_FAXQUEUE": "Go To Realtime Fax Queue", + "EDIT_TRUNK": "Edit Trunk", + "REGISTERED": "Registered", + "UNREGISTERED": "Unregistered", + "EDIT_ACCOUNT": "Edit Fax Account", + "PARTIALPAUSE": "Partial Pause", + "BUSY": "Busy", + "TIMER": "Timer", + "IDLE": "Idle", + "CAPACITY": "Capacity", + "GOTO_FAXACCOUNT": "Go To Realtime Fax", + "ACCOUNTS": "Accounts", + "GOTOREALTIME_FAXACCOUNT": "Go To Realtime Fax", + "TRUNK_STATUS": "Trunk Status", + "TRUNKS": "Trunks", + "REGISTRY": "Registry", + "NO_REGISTRY": "No Registry", + "PAUSE": "Pause", + "INFO": "Info", + "FULLNAME": "Fullname", + "INTERNAL": "Internal", + "PHONE_STATE": "Phone State", + "PHONE_STATUS": "Phone Status", + "LOGOUT": "Logout", + "DEFAULT_PAUSE": "Default pause", + "AGENTADD_QUEUE": "Add Agent to Fax queue", + "AGENTSADD_QUEUE": "Add Agents to Fax queue", + "UNPAUSE": "End Pause", + "AGENTS": "Agents", + "QUEUES": "Queues", + "LOGGED_IN": "Logged in", + "PAUSED": "Paused", + "READY": "Ready", + "WAITING": "Waiting", + "PRIORITY": "Priority", + "CONDITION": "Condition", + "TRUEPRIORITY": "True Priority", + "FALSEPRIORITY": "False Priority", + "VALUE": "Value", + "EDIT_FAXQUEUE": "Edit Fax Queue", + "EDIT_AGENT": "Edit Agent", + "EDIT_GOTO": "Edit Goto", + "EDIT_NOOP": "Edit Noop", + "EDIT_GOTOP": "Edit GotoP", + "EDIT_GOTOIF": "Edit GotoIf", + "EDIT_QUEUE": "Edit Fax Queue", + "EDIT_CLOSE": "Edit Close", + "QUEUE": "Queue", + "GOTOIF": "GotoIf", + "GOTOP": "GotoP", + "NOOP": "Noop", + "AGENT": "Agent", + "NOTES": "Notes", + "CLOSEDAT": "Closed At", + "DISPOSITION": "Disposition", + "REALTIME": "Realtime", + "TEAMADD_FAXQUEUE": "Add Team to Fax Queue", + "AGENTADD_FAXQUEUE": "Add Agent to Fax Queue", + "NAME": "Name", + "FAXQUEUES": "Fax Queues", + "SEARCH_FOR_ANYONE": "Search", + "MANDATORYDISPOSITION": "Mandatory disposition", + "MANDATORYDISPOSITIONPAUSEID": "Pause status when in mandatory disposition", + "ERRORS": { + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Mandatory Field", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Mandatory Field", + "TAG_REQUIRED": "Mandatory Field", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Mandatory Field", + "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "NAME_MUST_VALID_PATTERN": "Wrong format", + "COMMAND_REQUIRED": "Mandatory Field", + "TEXT_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "TEXT_REQUIRED": "Mandatory Field", + "VALUE_REQUIRED": "Mandatory Field", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "AGENT_REQUIRED": "Mandatory Field", + "QUEUE_REQUIRED": "Mandatory Field", + "TRUEPRIORITY_REQUIRED": "Mandatory Field", + "FALSEPRIORITY_REQUIRED": "Mandatory Field", + "CONDITION_REQUIRED": "Mandatory Field", + "PRIORITY_REQUIRED": "Mandatory Field", + "DISPOSITION_REQUIRED": "Mandatory Field", + "NAME_REQUIRED": "Mandatory Field", + "AGENT_TIMEOUT_REQUIRED": "Mandatory Field", + "MOTIONADDRESS_REQUIRED": "Mandatory Field", + "MOTIONADDRESS_MUST_VALID_URL": "Wrong format", + "LOCALSTATIONID_REQUIRED": "Mandatory Field", + "MODEM_REQUIRED": "Mandatory Field", + "GATEWAY_REQUIRED": "Mandatory Field", + "FAXDETECT_REQUIRED": "Mandatory Field", + "T38TIMEOUT_REQUIRED": "Mandatory Field", + "TIMEOUT_REQUIRED": "Mandatory Field", + "HEADERINFO_REQUIRED": "Mandatory Field", + "TRUNK_REQUIRED": "Mandatory Field", + "LIST_REQUIRED": "Mandatory Field", + "KEY_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "KEY_REQUIRED": "Mandatory Field", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "You should specify a pause status when in mandatory disposition" + }, + "STRATEGY": "Strategy", + "AGENT_TIMEOUT": "Agent Timeout", + "DESCRIPTION": "Description", + "ADD_FAXQUEUE": "Add Fax Queue", + "DELETE_FAXQUEUE": "Delete Fax Queue", + "CREATED_AT": "Created At", + "SAVE": "Save", + "SETTINGS": "Settings", + "GENERAL": "General", + "FAXACCOUNTS": "Fax Accounts", + "MOTIONADDRESS": "Motion Address", + "ADD_FAXACCOUNT": "Add Fax Account", + "EDIT_FAXACCOUNT": "Edit Fax Account", + "DELETE_FAXACCOUNT": "Delete Fax Account", + "DISPOSITIONS": "Dispositions", + "WEBHOOKS": "WebHooks", + "ACTIONS": "Actions", + "LIST": "List", + "FIDELITY": "Fidelity", + "ACCEPT": "Accept", + "ACCEPTMETHOD": "Accept Method", + "ACCEPTURL": "Accept URL", + "REJECT": "Reject", + "REJECTMETHOD": "Reject Method", + "REJECTURL": "Reject URL", + "CLOSE": "Close", + "CLOSEMETHOD": "Close Method", + "CLOSEURL": "Close URL", + "TRUNK": "Trunk", + "LOCALSTATIONID": "Local Station Identifier", + "HELP": { + "LOCALSTATIONID": "Local Station Identifier (telephone number)", + "HEADERINFO": "Outbound Fax Header information", + "MODEM": "Modem Type (v17/v27/v29)", + "GATEWAY": "T.38 Fax Gateway, with optional fax activity timeout in seconds (yes/no/[timeout])", + "FAXDETECT": "Enable Fax Detect with optional timeout in seconds (yes/t38/cng/[timeout]/no)", + "T38TIMEOUT": "The timeout used for T.38 negotiation (minimum value=1000)", + "ECM": "Error Connection Mode (ECM)", + "MINRATE": "Minimum transfer rate set before transmission", + "MAXRATE": "Maximum transfer rate set before transmission", + "MANDATORYDISPOSITION": "Mandatory disposition", + "MANDATORYDISPOSITIONPAUSEID": "Pause status for mandatory disposition", + "NAME": "Only numbers, letters and specific characters (._) are supported" + }, + "ADVANCED": "Advanced", + "ECM": "ECM", + "MINRATE": "Min Rate", + "MAXRATE": "Max Rate", + "MODEM": "Modem", + "GATEWAY": "Gateway", + "FAXDETECT": "Fax Detect", + "T38TIMEOUT": "T.38 Timeout", + "SIP": "Technology", + "HEADERINFO": "Header Info", + "SELECTED": "Selected", + "SELECT_ALL": "Select All", + "SELECT_NONE": "Select None", + "BACK": "Back", + "FAX": "Fax", + "ID": "Id", + "TIMEOUT": "Timeout", + "FAXDISPOSITIONS": "Fax Dispositions", + "NO_FAXDISPOSITION_AVAILABLE": "No Fax Dispositions available", + "NEW_FAXDISPOSITION": "New Fax Disposition", + "ADD_FAXDISPOSITION": "Add Fax Disposition", + "EDIT_FAXDISPOSITION": "Edit Fax Disposition", + "DELETE_FAXDISPOSITION": "Delete Fax Disposition", + "NEW_FAXQUEUE": "New Fax Queue", + "NEW_FAXACCOUNT": "New Fax Account", + "NO_AVAILABLE_INFO": "No available info", + "ALL_TEAMS": "All Teams", + "SELECTED_TEAMS": "Selected Teams", + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "OF": "of", + "DELETE": "Delete", + "KEY": "Key", + "ALL_AGENTS": "All Agents", + "SELECTED_AGENTS": "Selected Agents", + "FILTER": "Filter", + "SELECT_STATUS": "Select Status", + "ALL": "All", + "CLOSED": "Closed", + "OPENED": "Opened", + "SELECT_ACCOUNT": "Select Account", + "INTERACTIONS": "Interactions", + "CONTACT": "Contact", + "STARTEDAT": "Started At", + "LASTMESSAGE": "Last message", + "STATUS": "Status", + "ACCOUNT": "Account", + "UNKNOWN": "Unknown", + "UNAVAILABLE": "Unavailable", + "NOT_INUSE": "Not in use", + "REACHABLE": "Reachable", + "IN_USE": "In use", + "VOICE": "Voice", + "CHAT": "Chat", + "MAIL": "Email", + "SMS": "SMS", + "OPENCHANNEL": "Open Channel", + "TOTAL": "Total", + "IN": "In", + "OUT": "Out", + "NO_INTERACTION_AVAILABLE": "No interactions available", + "INTERACTIONS_FAXACCOUNT": "Go to Interactions", + "REFRESH_INTERACTIONS": "Refresh Interactions", + "DELETE_INTERACTION": "Delete Interaction", + "AGENTADD_FAXACCOUNT": "Add Agent to Fax Account", + "TEAMS_ASSOCIATION": "Teams Association", + "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", + "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available", + "DOWNLOAD_WITH_ATTACHMENTS": "Download with attachments", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download without attachments" + } +} diff --git a/public/app/main/apps/help/i18n/bs.json b/public/app/main/apps/help/i18n/bs.json index 4c1be43..33cd974 100644 --- a/public/app/main/apps/help/i18n/bs.json +++ b/public/app/main/apps/help/i18n/bs.json @@ -1,8 +1,8 @@ { "HELP": { - "ABOUT": "About", - "CONTACT_US": "Contact us", - "HELP": "Help", - "USEFUL_LINKS": "Useful links" + "ABOUT": "O nama", + "CONTACT_US": "Kontaktiraj nas", + "HELP": "Pomoć", + "USEFUL_LINKS": "Korisni linkovi" } } diff --git a/public/app/main/apps/help/i18n/is.json b/public/app/main/apps/help/i18n/is.json new file mode 100644 index 0000000..4c1be43 --- /dev/null +++ b/public/app/main/apps/help/i18n/is.json @@ -0,0 +1,8 @@ +{ + "HELP": { + "ABOUT": "About", + "CONTACT_US": "Contact us", + "HELP": "Help", + "USEFUL_LINKS": "Useful links" + } +} diff --git a/public/app/main/apps/integrations/i18n/bs.json b/public/app/main/apps/integrations/i18n/bs.json index da1fa10..74cee29 100644 --- a/public/app/main/apps/integrations/i18n/bs.json +++ b/public/app/main/apps/integrations/i18n/bs.json @@ -1,252 +1,252 @@ { "INTEGRATIONS": { - "ZONE": "Zone", - "ADVANCED": "Advanced", - "MODULE_SEARCH": "Module Search", - "MODULE_CREATE": "Module Create", + "ZONE": "Zona", + "ADVANCED": "Napredno", + "MODULE_SEARCH": "Modul Traži", + "MODULE_CREATE": "Modul kreiraj", "LEADS": "Lead", - "CONTACTS": "Contact", - "INTEGRATIONS": "Integrations", - "ZENDESKACCOUNTS": "Zendesk Accounts", - "ID": "Id", - "NAME": "Name", - "USERNAME": "Username", + "CONTACTS": "Kontakt", + "INTEGRATIONS": "Integracije", + "ZENDESKACCOUNTS": "Zendesk Nalozi", + "ID": "ID", + "NAME": "Ime", + "USERNAME": "Korisničko ime", "URI": "URL", - "BACK": "Back", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "EDIT_ZENDESKACCOUNT": "Edit Zendesk Account", - "DELETE_ZENDESKACCOUNT": "Delete Zendesk Account", - "NEW_ZENDESKACCOUNT": "New Zendesk Account", - "AUTHTYPE": "Authentication Type", - "PASSWORD": "Password", - "CONFIRM_PASSWORD": "Confirm Password", - "EMAIL": "Email", + "BACK": "Nazad", + "SELECTED": "Odabrano", + "SELECT_ALL": "Odaberi Sve", + "SELECT_NONE": "Odaberi Ništa", + "EDIT_ZENDESKACCOUNT": "Uredi Zendesk Nalog", + "DELETE_ZENDESKACCOUNT": "Izbriši Zendesk Nalo", + "NEW_ZENDESKACCOUNT": "Novi Zendesk Nalog", + "AUTHTYPE": "Vrsta Ovjere", + "PASSWORD": "Lozinka", + "CONFIRM_PASSWORD": "Potvrdi Lozinku", + "EMAIL": "E-mail", "TOKEN": "Token", - "MOTIONPROXYADDRESS": "Motion or Proxy IP Address", - "DESCRIPTION": "Description", - "ADD_ZENDESKACCOUNT": "Add Zendesk Account", + "MOTIONPROXYADDRESS": "Motion ili Proxy IP Adresa", + "DESCRIPTION": "Opis", + "ADD_ZENDESKACCOUNT": "Dodaj Zendesk Nalog", "ERRORS": { - "NAME_REQUIRED": "Mandatory field", - "USERNAME_REQUIRED": "Mandatory field", - "URI_REQUIRED": "Mandatory field", - "URI_MUST_VALID_URL": "Wrong format", - "PASSWORD_REQUIRED": "Mandatory field", - "CONFIRM_NOT_MATCH": "The passwords don't match", - "TOKEN_REQUIRED": "Mandatory field", - "MOTIONPROXYADDRESS_MUST_VALID_URL": "Wrong format", - "CLIENTID_REQUIRED": "Mandatory field", - "CLIENTSECRET_REQUIRED": "Mandatory field", - "SECURITYTOKEN_REQUIRED": "Mandatory field", - "APIKEY_REQUIRED": "Mandatory field", - "CONTENT_REQUIRED": "Mandatory field", - "VARIABLENAME_REQUIRED": "Mandatory field", - "KEY_REQUIRED": "Mandatory field", - "TYPE_REQUIRED": "Mandatory field", - "VALUE_REQUIRED": "Mandatory field", - "FIELD_REQUIRED": "Mandatory field", - "CONSUMERKEY_REQUIRED": "Mandatory field", - "CONSUMERSECRET_REQUIRED": "Mandatory field", - "TOKENSECRET_REQUIRED": "Mandatory field", - "HOST_REQUIRED": "Mandatory field", - "AUTHTOKEN_REQUIRED": "Mandatory field", - "VTIGER_USER_NAME_REQUIRED": "Mandatory field", - "ACCESS_KEY_REQUIRED": "Mandatory field", - "EMAIL_REQUIRED": "Mandatory field", - "TENANTID_REQUIRED": "Mandatory field", - "CODE_REQUIRED": "Mandatory field", - "MOTIONPROXYADDRESS_REQUIRED": "Mandatory field", - "MODULECREATE_REQUIRED": "Mandatory field" + "NAME_REQUIRED": "Obavezno polje", + "USERNAME_REQUIRED": "Obavezno polje", + "URI_REQUIRED": "Obavezno polje", + "URI_MUST_VALID_URL": "Pogrešan format", + "PASSWORD_REQUIRED": "Obavezno polje", + "CONFIRM_NOT_MATCH": "Lozinke se ne slažu", + "TOKEN_REQUIRED": "Obavezno polje", + "MOTIONPROXYADDRESS_MUST_VALID_URL": "Pogrešan format", + "CLIENTID_REQUIRED": "Obavezno polje", + "CLIENTSECRET_REQUIRED": "Obavezno polje", + "SECURITYTOKEN_REQUIRED": "Obavezno polje", + "APIKEY_REQUIRED": "Obavezno polje", + "CONTENT_REQUIRED": "Obavezno polje", + "VARIABLENAME_REQUIRED": "Obavezno polje", + "KEY_REQUIRED": "Obavezno polje", + "TYPE_REQUIRED": "Obavezno polje", + "VALUE_REQUIRED": "Obavezno polje", + "FIELD_REQUIRED": "Obavezno polje", + "CONSUMERKEY_REQUIRED": "Obavezno polje", + "CONSUMERSECRET_REQUIRED": "Obavezno polje", + "TOKENSECRET_REQUIRED": "Obavezno polje", + "HOST_REQUIRED": "Obavezno polje", + "AUTHTOKEN_REQUIRED": "Obavezno polje", + "VTIGER_USER_NAME_REQUIRED": "Obavezno polje", + "ACCESS_KEY_REQUIRED": "Obavezno polje", + "EMAIL_REQUIRED": "Obavezno polje", + "TENANTID_REQUIRED": "Obavezno polje", + "CODE_REQUIRED": "Obavezno polje", + "MOTIONPROXYADDRESS_REQUIRED": "Obavezno polje", + "MODULECREATE_REQUIRED": "Obavezno polje" }, "HELP": { - "MOTIONPROXYADDRESS": "Motion (Proxy) Address: it is reqired if you want to fill the ticket body with Recording URL. Enter the address in the following format: : //[:]. Example: https://X.Y.Z.W", - "TICKETTYPE": "Ticket Type", - "ZONE": "Choose your geographic zone (US, AU, EU, IN, CN) to activate the domain-specific Zoho Accounts", - "CLIENTID": "The specific CLient Id of your application", - "CLIENTSECRET": "The specific CLientSecret of your application", - "CODE": "The specific code generated through Developer Console", - "REFRESHTOKEN": "The automatically generated refresh token used to refresh expired access tokens. Also the access token are automatically generated each time an api is launched.", - "LEADID": "Field name used to link Case and Lead objects", - "ADDITIONALSEARCHACCOUNT": "Additional field name used to search customer phone number in Accounts", - "ADDITIONALSEARCHCONTACT": "Additional field name used to search customer phone number in Contacts", - "ADDITIONALSEARCHLEAD": "Additional field name used to search customer phone number in Leads", - "MODERN_AUTHENTICATION": "Switch to enable Modern Authentication" + "MOTIONPROXYADDRESS": "Motion (Proxy) Adresa: je potrebna ako želiš popuniti tijelo tiketa sa URL-om Snimka. Unesi adresu u sljedećem formatu: : //[:]. Primjer: https://X.Y.Z.W", + "TICKETTYPE": "Tiket Vrsta", + "ZONE": "Odaberi svoju geografsku zonu (US, AU, EU, IN, CN) da aktiviraš Zoho Naloge specifične za domenu", + "CLIENTID": "Specifični Stranka ID u aplikaciji", + "CLIENTSECRET": "Specifični Stranka Tajna u aplikaciji", + "CODE": "Specifična šifra generisana preko Developer Konzole", + "REFRESHTOKEN": "Automatski generisani token za osvježavanje koji se koristi za osvježavanje isteklih token pristupa. Također, pristupni token se automatski generiše svaki put kada se API pokrene.", + "LEADID": "Naziv polja koje se koristi za povezivanje Case i Lead predmeta", + "ADDITIONALSEARCHACCOUNT": "Dodatni naziv polja koji se koristi za pretraživanje broja telefona u Računima", + "ADDITIONALSEARCHCONTACT": "Dodatni naziv polja koji se koristi za pretraživanje broja telefona u Kontaktima", + "ADDITIONALSEARCHLEAD": "Dodatni naziv polja koji se koristi za pretraživanje broja telefona u Leads-ima", + "MODERN_AUTHENTICATION": "Uključi da bi omogućio Modernu Autentifikaciju" }, - "MODULECREATE": "Module create", - "CODE": "Developer Console Code", - "REFRESHTOKEN": "Refresh Token (generated)", - "ACCOUNT": "Account", - "ZENDESKCONFIGURATIONS": "Zendesk Configurations", - "SALESFORCECONFIGURATIONS": "Salesforce Configurations", - "SUGARCRMCONFIGURATIONS": "SugarCRM Configurations", - "FRESHDESKCONFIGURATIONS": "Freshdesk Configurations", - "GENERAL": "General", - "CREATED_AT": "Created At", - "SAVE": "Save", - "NO_ZENDESKCONFIGURATION_AVAILABLE": "No Zendesk Configurations available", - "NEW_ZENDESKCONFIGURATION": "New Zendesk Configuration", - "ADD_ZENDESKCONFIGURATION": "Add Zendesk Configuration", - "EDIT_ZENDESKCONFIGURATION": "Edit Zendesk Configuration", - "DELETE_ZENDESKCONFIGURATION": "Delete Zendesk Configuration", - "NO_SALESFORCECONFIGURATION_AVAILABLE": "No Salesforce Configurations available", - "NEW_SALESFORCECONFIGURATION": "New Salesforce Configuration", - "ADD_SALESFORCECONFIGURATION": "Add Salesforce Configuration", - "EDIT_SALESFORCECONFIGURATION": "Edit Salesforce Configuration", - "DELETE_SALESFORCECONFIGURATION": "Delete Salesforce Configuration", - "NO_SUGARCRMCONFIGURATION_AVAILABLE": "No SugarCRM Configurations available", - "NEW_SUGARCRMCONFIGURATION": "New SugarCRM Configuration", - "ADD_SUGARCRMCONFIGURATION": "Add SugarCRM Configuration", - "EDIT_SUGARCRMCONFIGURATION": "Edit SugarCRM Configuration", - "DELETE_SUGARCRMCONFIGURATION": "Delete SugarCRM Configuration", - "NO_FRESHDESKCONFIGURATION_AVAILABLE": "No Freshdesk Configurations available", - "NEW_FRESHDESKCONFIGURATION": "New Freshdesk Configuration", - "ADD_FRESHDESKCONFIGURATION": "Add Freshdesk Configuration", - "EDIT_FRESHDESKCONFIGURATION": "Edit Freshdesk Configuration", - "DELETE_FRESHDESKCONFIGURATION": "Delete Freshdesk Configuration", - "SALESFORCEACCOUNTS": "Salesforce Accounts", - "EDIT_SALESFORCEACCOUNT": "Edit Salesforce Account", - "DELETE_SALESFORCEACCOUNT": "Delete Salesforce Account", - "NEW_SALESFORCEACCOUNT": "New Salesforce Account", - "ADD_SALESFORCEACCOUNT": "Add Salesforce Account", - "CLIENTID": "Client ID", - "CLIENTSECRET": "Client Secret", - "SECURITYTOKEN": "Security Token", - "SEARCH_FOR_ANYONE": "Search", - "APIKEY": "Api Key", - "FRESHDESKACCOUNTS": "Freshdesk Accounts", - "EDIT_FRESHDESKACCOUNT": "Edit Freshdesk Account", - "DELETE_FRESHDESKACCOUNT": "Delete Freshdesk Account", - "NEW_FRESHDESKACCOUNT": "New Freshdesk Account", - "ADD_FRESHDESKACCOUNT": "Add Freshdesk Account", - "SUGARCRMACCOUNTS": "SugarCRM Accounts", - "EDIT_SUGARCRMACCOUNT": "Edit SugarCRM Account", - "DELETE_SUGARCRMACCOUNT": "Delete SugarCRM Account", - "NEW_SUGARCRMACCOUNT": "New SugarCRM Account", - "ADD_SUGARCRMACCOUNT": "Add SugarCRM Account", - "CONFIGURATIONS": "Configurations", - "NO_CONFIGURATION_AVAILABLE": "No Configurations available", - "NEW_CONFIGURATION": "New Configuration", - "ADD_CONFIGURATION": "Add Configuration", - "EDIT_CONFIGURATION": "Edit Configuration", - "DELETE_CONFIGURATION": "Delete Configuration", - "SUBJECTS": "Subjects", - "DESCRIPTIONS": "Descriptions", - "FIELDS": "Fields", - "TAGS": "Tags", - "TYPE": "Type", - "CONTENT": "Content", - "EDIT_SUBJECT": "Edit Subject", - "DELETE_SUBJECT": "Delete Subject", - "NEW_SUBJECT": "New Subject", - "ADD_SUBJECT": "Add Subject", - "EDIT_DESCRIPTION": "Edit Description", - "DELETE_DESCRIPTION": "Delete Description", - "NEW_DESCRIPTION": "New Description", - "ADD_DESCRIPTION": "Add Description", - "EDIT_FIELD": "Edit Field", - "DELETE_FIELD": "Delete Field", - "NEW_FIELD": "New Field", - "ADD_FIELD": "Add Field", - "ADD": "Add", + "MODULECREATE": "Modul kreiraj", + "CODE": "Šifra Developer Konzole", + "REFRESHTOKEN": "Osvježi Token (generisan)", + "ACCOUNT": "Nalog", + "ZENDESKCONFIGURATIONS": "Zendesk Konfiguracije", + "SALESFORCECONFIGURATIONS": "Salesforce Konfiguracije", + "SUGARCRMCONFIGURATIONS": "SugarCRM Konfiguracije", + "FRESHDESKCONFIGURATIONS": "Freshdesk Konfiguracije", + "GENERAL": "Općenito", + "CREATED_AT": "Kreirano U", + "SAVE": "Sačuvaj", + "NO_ZENDESKCONFIGURATION_AVAILABLE": "Nema dostupnih Zendesk Konfiguracija", + "NEW_ZENDESKCONFIGURATION": "Nova Zendesk Konfiguracija", + "ADD_ZENDESKCONFIGURATION": "Dodaj Zendesk Konfiguraciju", + "EDIT_ZENDESKCONFIGURATION": "Uredi Zendesk Konfiguraciju", + "DELETE_ZENDESKCONFIGURATION": "Izbriši Zendesk Konfiguraciju", + "NO_SALESFORCECONFIGURATION_AVAILABLE": "Nema dostupnih Salesforce Konfiguracija", + "NEW_SALESFORCECONFIGURATION": "Nova Salesforce Konfiguracija", + "ADD_SALESFORCECONFIGURATION": "Dodaj Salesforce Konfiguraciju", + "EDIT_SALESFORCECONFIGURATION": "Uredi Salesforce Konfiguraciju", + "DELETE_SALESFORCECONFIGURATION": "Izbriši Salesforce Konfiguraciju", + "NO_SUGARCRMCONFIGURATION_AVAILABLE": "Nema dostupnih SugarCRM Konfiguracija", + "NEW_SUGARCRMCONFIGURATION": "Nova SugarCRM Konfiguracija", + "ADD_SUGARCRMCONFIGURATION": "Dodaj SugarCRM Konfiguraciju", + "EDIT_SUGARCRMCONFIGURATION": "Uredi SugarCRM Konfiguraciju", + "DELETE_SUGARCRMCONFIGURATION": "Izbriši SugarCRM Konfiguraciju", + "NO_FRESHDESKCONFIGURATION_AVAILABLE": "Nema dostupnih Freshdesk Konfiguracija", + "NEW_FRESHDESKCONFIGURATION": "Nova Freshdesk Konfiguracija", + "ADD_FRESHDESKCONFIGURATION": "Dodaj Freshdesk Konfiguraciju", + "EDIT_FRESHDESKCONFIGURATION": "Uredi Freshdesk Konfiguraciju", + "DELETE_FRESHDESKCONFIGURATION": "Izbriši Freshdesk Konfiguraciju", + "SALESFORCEACCOUNTS": "Salesforce Nalozi", + "EDIT_SALESFORCEACCOUNT": "Uredi Salesforce Nalog", + "DELETE_SALESFORCEACCOUNT": "Izbriši Salesforce Nalog", + "NEW_SALESFORCEACCOUNT": "Novi Salesforce Nalog", + "ADD_SALESFORCEACCOUNT": "Dodaj Salesforce Nalog", + "CLIENTID": "Stranka ID", + "CLIENTSECRET": "Stranka Tajna", + "SECURITYTOKEN": "Sigurnosni Token", + "SEARCH_FOR_ANYONE": "Traži", + "APIKEY": "API Ključ", + "FRESHDESKACCOUNTS": "Freshdesk Nalozi", + "EDIT_FRESHDESKACCOUNT": "Uredi Freshdesk Nalog", + "DELETE_FRESHDESKACCOUNT": "Izbriši Freshdesk Nalog", + "NEW_FRESHDESKACCOUNT": "Novi Freshdesk Nalog", + "ADD_FRESHDESKACCOUNT": "Dodaj Freshdesk Nalog", + "SUGARCRMACCOUNTS": "SugarCRM Nalozi", + "EDIT_SUGARCRMACCOUNT": "Uredi SugarCRM Nalog", + "DELETE_SUGARCRMACCOUNT": "Izbriši SugarCRM Nalog", + "NEW_SUGARCRMACCOUNT": "Novi SugarCRM Nalog", + "ADD_SUGARCRMACCOUNT": "Dodaj SugarCRM Nalog", + "CONFIGURATIONS": "Konfiguracije", + "NO_CONFIGURATION_AVAILABLE": "Nema dostupnih konfiguracija", + "NEW_CONFIGURATION": "Nova Konfiguracija", + "ADD_CONFIGURATION": "Dodaj Konfiguraciju", + "EDIT_CONFIGURATION": "Uredi Konfiguraciju", + "DELETE_CONFIGURATION": "Izbriši Konfiguraciju", + "SUBJECTS": "Predmeti", + "DESCRIPTIONS": "Opisi", + "FIELDS": "Polja", + "TAGS": "Tag-ovi", + "TYPE": "Vrsta", + "CONTENT": "Sadržaj", + "EDIT_SUBJECT": "Uredi Predmet", + "DELETE_SUBJECT": "Izbriši Predmet", + "NEW_SUBJECT": "Nova Tema", + "ADD_SUBJECT": "Dodaj Predmet", + "EDIT_DESCRIPTION": "Uredi Opis", + "DELETE_DESCRIPTION": "Izbriši Opis", + "NEW_DESCRIPTION": "Novi Opis", + "ADD_DESCRIPTION": "Dodaj Opis", + "EDIT_FIELD": "Uredi Polje", + "DELETE_FIELD": "Izbriši Polje", + "NEW_FIELD": "Novo Polje", + "ADD_FIELD": "Dodaj Polje", + "ADD": "Dodaj", "VOICE": "Voice", - "MAIL": "Email", + "MAIL": "E-mail", "CHAT": "Chat", "SMS": "SMS", - "OPENCHANNEL": "Open Channel", - "INBOUND_IN_QUEUE": "Inbound in Queue", - "OUTBOUND_CALL": "Outbound Call", - "VALUE": "Value", - "FIELD": "Field", - "KEY": "Key", - "CHANNEL": "Channel", - "DELETE": "Delete", - "NO_AVAILABLE_INFO": "No available info", - "TEST_ZENDESKACCOUNT": "Test Zendesk Account", - "TEST_FRESHDESKACCOUNT": "Test Freshdesk Account", - "TEST_SUGARCRMACCOUNT": "Test SugerCRM Account", - "TEST_SALESFORCEACCOUNT": "Test Salesforce Account", - "INTEGRATION_TAB": "Integration Tab", - "NEW_TAB": "New Tab", - "DESKACCOUNTS": "Desk Accounts", - "EDIT_DESKACCOUNT": "Edit Desk Account", - "TEST_DESKACCOUNT": "Test Desk Account", - "DELETE_DESKACCOUNT": "Delete Desk Account", - "CONSUMERKEY": "Consumer Key", - "CONSUMERSECRET": "Consumer Secret", - "TOKENSECRET": "Token Secret", - "ADD_DESKACCOUNT": "Add Desk Account", - "NEW_DESKACCOUNT": "New Desk Account", - "ADD_DESKCONFIGURATION": "Add Desk Configuration", - "NEW_DESKCONFIGURATION": "New Desk Configuration", - "DELETE_DESKCONFIGURATION": "Delete Desk Configuration", - "ZOHOACCOUNTS": "Zoho Accounts", - "EDIT_ZOHOACCOUNT": "Edit Zoho Account", - "TEST_ZOHOACCOUNT": "Test Zoho Account", - "DELETE_ZOHOACCOUNT": "Delete Zoho Account", - "ADD_ZOHOACCOUNT": "Add Zoho Account", - "NEW_ZOHOACCOUNT": "New Zoho Account", - "ADD_ZOHOCONFIGURATION": "Add Zoho Configuration", - "NEW_ZOHOCONFIGURATION": "New Zoho Configuration", - "AUTHTOKEN": "Authorization Token", + "OPENCHANNEL": "Otvoreni Kanal", + "INBOUND_IN_QUEUE": "Dolazni u Queue", + "OUTBOUND_CALL": "Odlazni Poziv", + "VALUE": "Vrijednost", + "FIELD": "Polje", + "KEY": "Ključ", + "CHANNEL": "Kanal", + "DELETE": "Izbriši", + "NO_AVAILABLE_INFO": "Nema dostupnih podataka", + "TEST_ZENDESKACCOUNT": "Testiraj Zendesk Nalog", + "TEST_FRESHDESKACCOUNT": "Testiraj Freshdesk Nalog", + "TEST_SUGARCRMACCOUNT": "Testiraj SugarCRM Nalog", + "TEST_SALESFORCEACCOUNT": "Testiraj Salesforce Nalog", + "INTEGRATION_TAB": "Integracija Tab", + "NEW_TAB": "Novi Tab", + "DESKACCOUNTS": "Desk Nalozi", + "EDIT_DESKACCOUNT": "Uredi Desk Nalog", + "TEST_DESKACCOUNT": "Testiraj Desk Nalog", + "DELETE_DESKACCOUNT": "Izbriši Desk Nalog", + "CONSUMERKEY": "Ključ Potrošača", + "CONSUMERSECRET": "Porošač Tajna", + "TOKENSECRET": "Token Tajni", + "ADD_DESKACCOUNT": "Dodaj Desk nalog", + "NEW_DESKACCOUNT": "Novi Desk nalog", + "ADD_DESKCONFIGURATION": "Dodaj Desk Konfiguraciju", + "NEW_DESKCONFIGURATION": "Nova Desk Konfiguracija", + "DELETE_DESKCONFIGURATION": "Izbriši Desk Konfiguraciju", + "ZOHOACCOUNTS": "Zoho Nalozi", + "EDIT_ZOHOACCOUNT": "Uredi Zoho Nalog", + "TEST_ZOHOACCOUNT": "Testiraj Zoho Nalog", + "DELETE_ZOHOACCOUNT": "Izbriši Zoho Nalog", + "ADD_ZOHOACCOUNT": "DOdaj Zoho Nalog", + "NEW_ZOHOACCOUNT": "Novi Zoho Nalog", + "ADD_ZOHOCONFIGURATION": "Dodaj Zoho Konfiguraciju", + "NEW_ZOHOCONFIGURATION": "Nova Zoho Konfiguracija", + "AUTHTOKEN": "Autorizacijski Token", "HOST": "Host", - "DELETE_ZOHOCONFIGURATION": "Delete Zoho Configuration", - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", - "VTIGERACCOUNTS": "vTiger Accounts", - "VTIGER_USER_NAME": "vTiger User Name", - "MODULE_NAME": "vTiger Module Name", - "ACCESS_KEY": "vTiger Access Key", - "ADD_VTIGERACCOUNT": "Add new vTiger Account", - "EDIT_VTIGERACCOUNT": "Edit vTiger Account", - "TEST_VTIGERACCOUNT": "Test vTiger Account", - "DELETE_VTIGERACCOUNT": "Delete vTiger Account", - "NEW_VTIGERACCOUNT": "New vTiger Account", - "NEW_VTIGERCONFIGURATION": "Create vTiger Configuration", - "DELETE_VTIGERCONFIGURATION": "Delete vTiger Configuration", - "ADD_VTIGERCONFIGURATION": "Add vTiger Configuration", - "FRESHSALESACCOUNTS": "Freshsales Accounts", - "EDIT_FRESHSALESACCOUNT": "Edit Freshsales Account", - "DELETE_FRESHSALESACCOUNT": "Delete Freshsales Account", - "NEW_FRESHSALESACCOUNT": "New Freshsales Account", - "ADD_FRESHSALESACCOUNT": "Add Freshsales Account", - "NO_FRESHSALESCONFIGURATION_AVAILABLE": "No Freshsales Configurations available", - "NEW_FRESHSALESCONFIGURATION": "New Freshsales Configuration", - "ADD_FRESHSALESCONFIGURATION": "Add Freshsales Configuration", - "EDIT_FRESHSALESCONFIGURATION": "Edit Freshsales Configuration", - "DELETE_FRESHSALESCONFIGURATION": "Delete Freshsales Configuration", - "TEST_FRESHSALESACCOUNT": "Test Freshsales Account", - "SERVICENOWACCOUNTS": "ServiceNow Accounts", - "ADD_SERVICENOWACCOUNT": "Add new ServiceNow Account", - "EDIT_SERVICENOWACCOUNT": "Edit ServiceNow Account", - "TEST_SERVICENOWACCOUNT": "Test ServiceNow Account", - "DELETE_SERVICENOWACCOUNT": "Delete ServiceNow Account", - "NEW_SERVICENOWACCOUNT": "New ServiceNow Account", - "NEW_SERVICENOWCONFIGURATION": "Create ServiceNow Configuration", - "DELETE_SERVICENOWCONFIGURATION": "Delete ServiceNow Configuration", - "ADD_SERVICENOWCONFIGURATION": "Add ServiceNow Configuration", - "DYNAMICS365ACCOUNTS": "Dynamics365 Accounts", - "TENANTID": "Tenant Id", - "ADD_DYNAMICS365ACCOUNT": "Add new Dynamics365 Account", - "EDIT_DYNAMICS365ACCOUNT": "Edit Dynamics365 Account", - "TEST_DYNAMICS365ACCOUNT": "Test Dynamics365 Account", - "DELETE_DYNAMICS365ACCOUNT": "Delete Dynamics365 Account", - "NEW_DYNAMICS365ACCOUNT": "New Dynamics365 Account", - "NEW_DYNAMICS365CONFIGURATION": "Create Dynamics365 Configuration", - "DELETE_DYNAMICS365CONFIGURATION": "Delete Dynamics365 Configuration", - "ADD_DYNAMICS365CONFIGURATION": "Add Dynamics365 Configuration", - "TICKETTYPE": "Ticket Type", - "CASE": "Case", - "LEADID": "Lead Id", - "ADDITIONALSEARCHACCOUNT": "Additional Search Account", - "ADDITIONALSEARCHCONTACT": "Additional Search Contact", - "ADDITIONALSEARCHLEAD": "Additional Search Lead", - "PHONECALL": "Phonecall", - "TASK": "Task", - "DYNAMIC365CONTACT": "Contact", - "DYNAMIC365NOTHING": "Nothing", - "MODERN_AUTHENTICATION": "Modern Authentication", - "OPENNEWTAB": "Open new tab" + "DELETE_ZOHOCONFIGURATION": "Izbriši Zoho Konfiguraciju", + "PAGE": "Stranica", + "ROWSPERPAGE": "Redova po stranici", + "OF": "od", + "VTIGERACCOUNTS": "vTiger Nalozi", + "VTIGER_USER_NAME": "vTiger Korisničko Ime", + "MODULE_NAME": "vTiger Modul Naziv", + "ACCESS_KEY": "vTiger Pristupni Ključ", + "ADD_VTIGERACCOUNT": "Dodaj novi vTiger Nalog", + "EDIT_VTIGERACCOUNT": "Uredi vTiger Nalog", + "TEST_VTIGERACCOUNT": "Testiraj vTiger Nalog", + "DELETE_VTIGERACCOUNT": "Izbriši vTiger Nalog", + "NEW_VTIGERACCOUNT": "Novi vTiger Nalog", + "NEW_VTIGERCONFIGURATION": "Nova vTiger Konfiguracija", + "DELETE_VTIGERCONFIGURATION": "Izbriši vTiger Konfiguraciju", + "ADD_VTIGERCONFIGURATION": "Dodaj vTiger Konfiguraciju", + "FRESHSALESACCOUNTS": "Freshsales Nalozi", + "EDIT_FRESHSALESACCOUNT": "Uredi Freshsales Nalog", + "DELETE_FRESHSALESACCOUNT": "Izbriši Freshsales Nalog", + "NEW_FRESHSALESACCOUNT": "Novi Freshsales Nalog", + "ADD_FRESHSALESACCOUNT": "Dodaj Freshsales Nalog", + "NO_FRESHSALESCONFIGURATION_AVAILABLE": "Nema dostupnih Freshsales Konfiguracija", + "NEW_FRESHSALESCONFIGURATION": "Nova Freshsales Konfiguracija", + "ADD_FRESHSALESCONFIGURATION": "Dodaj Freshsales Konfiguraciju", + "EDIT_FRESHSALESCONFIGURATION": "Uredi Freshsales Konfiguraciju", + "DELETE_FRESHSALESCONFIGURATION": "Izbriši Freshsales Konfiguraciju", + "TEST_FRESHSALESACCOUNT": "Testiraj Freshsales Nalog", + "SERVICENOWACCOUNTS": "ServiceNow Nalozi", + "ADD_SERVICENOWACCOUNT": "Dodaj novi ServiceNow Nalog", + "EDIT_SERVICENOWACCOUNT": "Uredi ServiceNow Nalog", + "TEST_SERVICENOWACCOUNT": "Testiraj ServiceNow Nalog", + "DELETE_SERVICENOWACCOUNT": "Izriši ServiceNow Nalog", + "NEW_SERVICENOWACCOUNT": "Novi ServiceNow Nalog", + "NEW_SERVICENOWCONFIGURATION": "Nova ServiceNow Konfiguracija", + "DELETE_SERVICENOWCONFIGURATION": "Izbriši ServiceNow Konfiguraciju", + "ADD_SERVICENOWCONFIGURATION": "Dodaj ServiceNow Konfiguraciju", + "DYNAMICS365ACCOUNTS": "MD365 Nalozi", + "TENANTID": "Zakupac ID", + "ADD_DYNAMICS365ACCOUNT": "Dodaj novi MD365 Nalog", + "EDIT_DYNAMICS365ACCOUNT": "Uredi MD365 Nalog", + "TEST_DYNAMICS365ACCOUNT": "Testiraj MD365 Nalog", + "DELETE_DYNAMICS365ACCOUNT": "Izbriši MD365 Nalog", + "NEW_DYNAMICS365ACCOUNT": "Novi MD365 Nalog", + "NEW_DYNAMICS365CONFIGURATION": "Kreiraj MD365 Konfiguraciju", + "DELETE_DYNAMICS365CONFIGURATION": "Izbriši MD365 Konfiguraciju", + "ADD_DYNAMICS365CONFIGURATION": "Dodaj MD365 Konfiguraciju", + "TICKETTYPE": "Tiket Vrsta", + "CASE": "Slučaj", + "LEADID": "Lead ID", + "ADDITIONALSEARCHACCOUNT": "Dodatni Nalog za Pretraživanje", + "ADDITIONALSEARCHCONTACT": "Dodatni Kontakt za Pretraživanje", + "ADDITIONALSEARCHLEAD": "Dodatni Lead za Pretraživanje", + "PHONECALL": "Telefonski poiv", + "TASK": "Zadaci", + "DYNAMIC365CONTACT": "Kontakt", + "DYNAMIC365NOTHING": "Ništa", + "MODERN_AUTHENTICATION": "Moderna Autentifikacija", + "OPENNEWTAB": "Otvori novi tab" } } diff --git a/public/app/main/apps/integrations/i18n/et.json b/public/app/main/apps/integrations/i18n/et.json index 7444e6b..cba6b07 100644 --- a/public/app/main/apps/integrations/i18n/et.json +++ b/public/app/main/apps/integrations/i18n/et.json @@ -66,7 +66,8 @@ "ADDITIONALSEARCHACCOUNT": "Täiendav välja nimi, mida kasutatakse kontol kliendi telefoninumbri otsimiseks", "ADDITIONALSEARCHCONTACT": "Täiendav välja nimi, mida kasutatakse kliendi telefoninumbri otsimiseks menüüst Kontaktid", "ADDITIONALSEARCHLEAD": "Potentsiaalsete klientide telefoninumbri otsimiseks kasutatav täiendav välja nimi", - "LEADID": "Välja ja juhtumi objektide linkimiseks kasutatav välja nimi" + "LEADID": "Välja ja juhtumi objektide linkimiseks kasutatav välja nimi", + "MODERN_AUTHENTICATION": "Lülitage sisse, et lubada kaasaegne autentimine" }, "ACCOUNT": "Konto", "ZENDESKCONFIGURATIONS": "Zendesk Konfiguratsioonid", @@ -242,6 +243,10 @@ "ADDITIONALSEARCHACCOUNT": "Täiendav otsingukonto", "ADDITIONALSEARCHCONTACT": "Täiendav otsingu kontakt", "ADDITIONALSEARCHLEAD": "Täiendav otsinguvihje", - "LEADID": "Vihje ID" + "LEADID": "Vihje ID", + "DYNAMIC365CONTACT": "Võtke ühendust", + "DYNAMIC365NOTHING": "Mitte midagi", + "MODERN_AUTHENTICATION": "Kaasaegne autentimine", + "OPENNEWTAB": "Ava uus vaheleht" } } diff --git a/public/app/main/apps/integrations/i18n/is.json b/public/app/main/apps/integrations/i18n/is.json new file mode 100644 index 0000000..da1fa10 --- /dev/null +++ b/public/app/main/apps/integrations/i18n/is.json @@ -0,0 +1,252 @@ +{ + "INTEGRATIONS": { + "ZONE": "Zone", + "ADVANCED": "Advanced", + "MODULE_SEARCH": "Module Search", + "MODULE_CREATE": "Module Create", + "LEADS": "Lead", + "CONTACTS": "Contact", + "INTEGRATIONS": "Integrations", + "ZENDESKACCOUNTS": "Zendesk Accounts", + "ID": "Id", + "NAME": "Name", + "USERNAME": "Username", + "URI": "URL", + "BACK": "Back", + "SELECTED": "Selected", + "SELECT_ALL": "Select All", + "SELECT_NONE": "Select None", + "EDIT_ZENDESKACCOUNT": "Edit Zendesk Account", + "DELETE_ZENDESKACCOUNT": "Delete Zendesk Account", + "NEW_ZENDESKACCOUNT": "New Zendesk Account", + "AUTHTYPE": "Authentication Type", + "PASSWORD": "Password", + "CONFIRM_PASSWORD": "Confirm Password", + "EMAIL": "Email", + "TOKEN": "Token", + "MOTIONPROXYADDRESS": "Motion or Proxy IP Address", + "DESCRIPTION": "Description", + "ADD_ZENDESKACCOUNT": "Add Zendesk Account", + "ERRORS": { + "NAME_REQUIRED": "Mandatory field", + "USERNAME_REQUIRED": "Mandatory field", + "URI_REQUIRED": "Mandatory field", + "URI_MUST_VALID_URL": "Wrong format", + "PASSWORD_REQUIRED": "Mandatory field", + "CONFIRM_NOT_MATCH": "The passwords don't match", + "TOKEN_REQUIRED": "Mandatory field", + "MOTIONPROXYADDRESS_MUST_VALID_URL": "Wrong format", + "CLIENTID_REQUIRED": "Mandatory field", + "CLIENTSECRET_REQUIRED": "Mandatory field", + "SECURITYTOKEN_REQUIRED": "Mandatory field", + "APIKEY_REQUIRED": "Mandatory field", + "CONTENT_REQUIRED": "Mandatory field", + "VARIABLENAME_REQUIRED": "Mandatory field", + "KEY_REQUIRED": "Mandatory field", + "TYPE_REQUIRED": "Mandatory field", + "VALUE_REQUIRED": "Mandatory field", + "FIELD_REQUIRED": "Mandatory field", + "CONSUMERKEY_REQUIRED": "Mandatory field", + "CONSUMERSECRET_REQUIRED": "Mandatory field", + "TOKENSECRET_REQUIRED": "Mandatory field", + "HOST_REQUIRED": "Mandatory field", + "AUTHTOKEN_REQUIRED": "Mandatory field", + "VTIGER_USER_NAME_REQUIRED": "Mandatory field", + "ACCESS_KEY_REQUIRED": "Mandatory field", + "EMAIL_REQUIRED": "Mandatory field", + "TENANTID_REQUIRED": "Mandatory field", + "CODE_REQUIRED": "Mandatory field", + "MOTIONPROXYADDRESS_REQUIRED": "Mandatory field", + "MODULECREATE_REQUIRED": "Mandatory field" + }, + "HELP": { + "MOTIONPROXYADDRESS": "Motion (Proxy) Address: it is reqired if you want to fill the ticket body with Recording URL. Enter the address in the following format: : //[:]. Example: https://X.Y.Z.W", + "TICKETTYPE": "Ticket Type", + "ZONE": "Choose your geographic zone (US, AU, EU, IN, CN) to activate the domain-specific Zoho Accounts", + "CLIENTID": "The specific CLient Id of your application", + "CLIENTSECRET": "The specific CLientSecret of your application", + "CODE": "The specific code generated through Developer Console", + "REFRESHTOKEN": "The automatically generated refresh token used to refresh expired access tokens. Also the access token are automatically generated each time an api is launched.", + "LEADID": "Field name used to link Case and Lead objects", + "ADDITIONALSEARCHACCOUNT": "Additional field name used to search customer phone number in Accounts", + "ADDITIONALSEARCHCONTACT": "Additional field name used to search customer phone number in Contacts", + "ADDITIONALSEARCHLEAD": "Additional field name used to search customer phone number in Leads", + "MODERN_AUTHENTICATION": "Switch to enable Modern Authentication" + }, + "MODULECREATE": "Module create", + "CODE": "Developer Console Code", + "REFRESHTOKEN": "Refresh Token (generated)", + "ACCOUNT": "Account", + "ZENDESKCONFIGURATIONS": "Zendesk Configurations", + "SALESFORCECONFIGURATIONS": "Salesforce Configurations", + "SUGARCRMCONFIGURATIONS": "SugarCRM Configurations", + "FRESHDESKCONFIGURATIONS": "Freshdesk Configurations", + "GENERAL": "General", + "CREATED_AT": "Created At", + "SAVE": "Save", + "NO_ZENDESKCONFIGURATION_AVAILABLE": "No Zendesk Configurations available", + "NEW_ZENDESKCONFIGURATION": "New Zendesk Configuration", + "ADD_ZENDESKCONFIGURATION": "Add Zendesk Configuration", + "EDIT_ZENDESKCONFIGURATION": "Edit Zendesk Configuration", + "DELETE_ZENDESKCONFIGURATION": "Delete Zendesk Configuration", + "NO_SALESFORCECONFIGURATION_AVAILABLE": "No Salesforce Configurations available", + "NEW_SALESFORCECONFIGURATION": "New Salesforce Configuration", + "ADD_SALESFORCECONFIGURATION": "Add Salesforce Configuration", + "EDIT_SALESFORCECONFIGURATION": "Edit Salesforce Configuration", + "DELETE_SALESFORCECONFIGURATION": "Delete Salesforce Configuration", + "NO_SUGARCRMCONFIGURATION_AVAILABLE": "No SugarCRM Configurations available", + "NEW_SUGARCRMCONFIGURATION": "New SugarCRM Configuration", + "ADD_SUGARCRMCONFIGURATION": "Add SugarCRM Configuration", + "EDIT_SUGARCRMCONFIGURATION": "Edit SugarCRM Configuration", + "DELETE_SUGARCRMCONFIGURATION": "Delete SugarCRM Configuration", + "NO_FRESHDESKCONFIGURATION_AVAILABLE": "No Freshdesk Configurations available", + "NEW_FRESHDESKCONFIGURATION": "New Freshdesk Configuration", + "ADD_FRESHDESKCONFIGURATION": "Add Freshdesk Configuration", + "EDIT_FRESHDESKCONFIGURATION": "Edit Freshdesk Configuration", + "DELETE_FRESHDESKCONFIGURATION": "Delete Freshdesk Configuration", + "SALESFORCEACCOUNTS": "Salesforce Accounts", + "EDIT_SALESFORCEACCOUNT": "Edit Salesforce Account", + "DELETE_SALESFORCEACCOUNT": "Delete Salesforce Account", + "NEW_SALESFORCEACCOUNT": "New Salesforce Account", + "ADD_SALESFORCEACCOUNT": "Add Salesforce Account", + "CLIENTID": "Client ID", + "CLIENTSECRET": "Client Secret", + "SECURITYTOKEN": "Security Token", + "SEARCH_FOR_ANYONE": "Search", + "APIKEY": "Api Key", + "FRESHDESKACCOUNTS": "Freshdesk Accounts", + "EDIT_FRESHDESKACCOUNT": "Edit Freshdesk Account", + "DELETE_FRESHDESKACCOUNT": "Delete Freshdesk Account", + "NEW_FRESHDESKACCOUNT": "New Freshdesk Account", + "ADD_FRESHDESKACCOUNT": "Add Freshdesk Account", + "SUGARCRMACCOUNTS": "SugarCRM Accounts", + "EDIT_SUGARCRMACCOUNT": "Edit SugarCRM Account", + "DELETE_SUGARCRMACCOUNT": "Delete SugarCRM Account", + "NEW_SUGARCRMACCOUNT": "New SugarCRM Account", + "ADD_SUGARCRMACCOUNT": "Add SugarCRM Account", + "CONFIGURATIONS": "Configurations", + "NO_CONFIGURATION_AVAILABLE": "No Configurations available", + "NEW_CONFIGURATION": "New Configuration", + "ADD_CONFIGURATION": "Add Configuration", + "EDIT_CONFIGURATION": "Edit Configuration", + "DELETE_CONFIGURATION": "Delete Configuration", + "SUBJECTS": "Subjects", + "DESCRIPTIONS": "Descriptions", + "FIELDS": "Fields", + "TAGS": "Tags", + "TYPE": "Type", + "CONTENT": "Content", + "EDIT_SUBJECT": "Edit Subject", + "DELETE_SUBJECT": "Delete Subject", + "NEW_SUBJECT": "New Subject", + "ADD_SUBJECT": "Add Subject", + "EDIT_DESCRIPTION": "Edit Description", + "DELETE_DESCRIPTION": "Delete Description", + "NEW_DESCRIPTION": "New Description", + "ADD_DESCRIPTION": "Add Description", + "EDIT_FIELD": "Edit Field", + "DELETE_FIELD": "Delete Field", + "NEW_FIELD": "New Field", + "ADD_FIELD": "Add Field", + "ADD": "Add", + "VOICE": "Voice", + "MAIL": "Email", + "CHAT": "Chat", + "SMS": "SMS", + "OPENCHANNEL": "Open Channel", + "INBOUND_IN_QUEUE": "Inbound in Queue", + "OUTBOUND_CALL": "Outbound Call", + "VALUE": "Value", + "FIELD": "Field", + "KEY": "Key", + "CHANNEL": "Channel", + "DELETE": "Delete", + "NO_AVAILABLE_INFO": "No available info", + "TEST_ZENDESKACCOUNT": "Test Zendesk Account", + "TEST_FRESHDESKACCOUNT": "Test Freshdesk Account", + "TEST_SUGARCRMACCOUNT": "Test SugerCRM Account", + "TEST_SALESFORCEACCOUNT": "Test Salesforce Account", + "INTEGRATION_TAB": "Integration Tab", + "NEW_TAB": "New Tab", + "DESKACCOUNTS": "Desk Accounts", + "EDIT_DESKACCOUNT": "Edit Desk Account", + "TEST_DESKACCOUNT": "Test Desk Account", + "DELETE_DESKACCOUNT": "Delete Desk Account", + "CONSUMERKEY": "Consumer Key", + "CONSUMERSECRET": "Consumer Secret", + "TOKENSECRET": "Token Secret", + "ADD_DESKACCOUNT": "Add Desk Account", + "NEW_DESKACCOUNT": "New Desk Account", + "ADD_DESKCONFIGURATION": "Add Desk Configuration", + "NEW_DESKCONFIGURATION": "New Desk Configuration", + "DELETE_DESKCONFIGURATION": "Delete Desk Configuration", + "ZOHOACCOUNTS": "Zoho Accounts", + "EDIT_ZOHOACCOUNT": "Edit Zoho Account", + "TEST_ZOHOACCOUNT": "Test Zoho Account", + "DELETE_ZOHOACCOUNT": "Delete Zoho Account", + "ADD_ZOHOACCOUNT": "Add Zoho Account", + "NEW_ZOHOACCOUNT": "New Zoho Account", + "ADD_ZOHOCONFIGURATION": "Add Zoho Configuration", + "NEW_ZOHOCONFIGURATION": "New Zoho Configuration", + "AUTHTOKEN": "Authorization Token", + "HOST": "Host", + "DELETE_ZOHOCONFIGURATION": "Delete Zoho Configuration", + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "OF": "of", + "VTIGERACCOUNTS": "vTiger Accounts", + "VTIGER_USER_NAME": "vTiger User Name", + "MODULE_NAME": "vTiger Module Name", + "ACCESS_KEY": "vTiger Access Key", + "ADD_VTIGERACCOUNT": "Add new vTiger Account", + "EDIT_VTIGERACCOUNT": "Edit vTiger Account", + "TEST_VTIGERACCOUNT": "Test vTiger Account", + "DELETE_VTIGERACCOUNT": "Delete vTiger Account", + "NEW_VTIGERACCOUNT": "New vTiger Account", + "NEW_VTIGERCONFIGURATION": "Create vTiger Configuration", + "DELETE_VTIGERCONFIGURATION": "Delete vTiger Configuration", + "ADD_VTIGERCONFIGURATION": "Add vTiger Configuration", + "FRESHSALESACCOUNTS": "Freshsales Accounts", + "EDIT_FRESHSALESACCOUNT": "Edit Freshsales Account", + "DELETE_FRESHSALESACCOUNT": "Delete Freshsales Account", + "NEW_FRESHSALESACCOUNT": "New Freshsales Account", + "ADD_FRESHSALESACCOUNT": "Add Freshsales Account", + "NO_FRESHSALESCONFIGURATION_AVAILABLE": "No Freshsales Configurations available", + "NEW_FRESHSALESCONFIGURATION": "New Freshsales Configuration", + "ADD_FRESHSALESCONFIGURATION": "Add Freshsales Configuration", + "EDIT_FRESHSALESCONFIGURATION": "Edit Freshsales Configuration", + "DELETE_FRESHSALESCONFIGURATION": "Delete Freshsales Configuration", + "TEST_FRESHSALESACCOUNT": "Test Freshsales Account", + "SERVICENOWACCOUNTS": "ServiceNow Accounts", + "ADD_SERVICENOWACCOUNT": "Add new ServiceNow Account", + "EDIT_SERVICENOWACCOUNT": "Edit ServiceNow Account", + "TEST_SERVICENOWACCOUNT": "Test ServiceNow Account", + "DELETE_SERVICENOWACCOUNT": "Delete ServiceNow Account", + "NEW_SERVICENOWACCOUNT": "New ServiceNow Account", + "NEW_SERVICENOWCONFIGURATION": "Create ServiceNow Configuration", + "DELETE_SERVICENOWCONFIGURATION": "Delete ServiceNow Configuration", + "ADD_SERVICENOWCONFIGURATION": "Add ServiceNow Configuration", + "DYNAMICS365ACCOUNTS": "Dynamics365 Accounts", + "TENANTID": "Tenant Id", + "ADD_DYNAMICS365ACCOUNT": "Add new Dynamics365 Account", + "EDIT_DYNAMICS365ACCOUNT": "Edit Dynamics365 Account", + "TEST_DYNAMICS365ACCOUNT": "Test Dynamics365 Account", + "DELETE_DYNAMICS365ACCOUNT": "Delete Dynamics365 Account", + "NEW_DYNAMICS365ACCOUNT": "New Dynamics365 Account", + "NEW_DYNAMICS365CONFIGURATION": "Create Dynamics365 Configuration", + "DELETE_DYNAMICS365CONFIGURATION": "Delete Dynamics365 Configuration", + "ADD_DYNAMICS365CONFIGURATION": "Add Dynamics365 Configuration", + "TICKETTYPE": "Ticket Type", + "CASE": "Case", + "LEADID": "Lead Id", + "ADDITIONALSEARCHACCOUNT": "Additional Search Account", + "ADDITIONALSEARCHCONTACT": "Additional Search Contact", + "ADDITIONALSEARCHLEAD": "Additional Search Lead", + "PHONECALL": "Phonecall", + "TASK": "Task", + "DYNAMIC365CONTACT": "Contact", + "DYNAMIC365NOTHING": "Nothing", + "MODERN_AUTHENTICATION": "Modern Authentication", + "OPENNEWTAB": "Open new tab" + } +} diff --git a/public/app/main/apps/integrations/i18n/pt-BR.json b/public/app/main/apps/integrations/i18n/pt-BR.json index 791db6c..156770a 100644 --- a/public/app/main/apps/integrations/i18n/pt-BR.json +++ b/public/app/main/apps/integrations/i18n/pt-BR.json @@ -1,28 +1,28 @@ { "INTEGRATIONS": { "ADVANCED": "Avançado", - "MODULE_SEARCH": "Pesquisa de módulo", - "MODULE_CREATE": "Módulo Criar", + "MODULE_SEARCH": "Pesquisar Módulo", + "MODULE_CREATE": "Módulo Criado", "INTEGRATIONS": "Integrações", - "ZENDESKACCOUNTS": "Contas do Zendesk", + "ZENDESKACCOUNTS": "Contas Zendesk", "ID": "Id", "NAME": "Nome", "USERNAME": "Usuário", "URI": "URL", "BACK": "Voltar", "SELECTED": "Selecionado", - "SELECT_ALL": "Selecionar tudo", - "SELECT_NONE": "Selecionar nenhum", - "EDIT_ZENDESKACCOUNT": "Editar conta do Zendesk", - "DELETE_ZENDESKACCOUNT": "Excluir conta do Zendesk", - "NEW_ZENDESKACCOUNT": "Nova conta do Zendesk", - "AUTHTYPE": "Tipo de AutenticaçãoType", + "SELECT_ALL": "Selecionar Tudo", + "SELECT_NONE": "Selecionar Nenhum", + "EDIT_ZENDESKACCOUNT": "Editar Conta Zendesk", + "DELETE_ZENDESKACCOUNT": "Excluir Conta Zendesk", + "NEW_ZENDESKACCOUNT": "Nova Conta Zendesk", + "AUTHTYPE": "Tipo de Autenticação", "PASSWORD": "Senha", - "CONFIRM_PASSWORD": "Confirme a Senha", + "CONFIRM_PASSWORD": "Confirme Senha", "TOKEN": "Token", - "MOTIONPROXYADDRESS": "Endereço IP de movimento ou proxy", + "MOTIONPROXYADDRESS": "Endereço IP Motion ou Proxy", "DESCRIPTION": "Descrição", - "ADD_ZENDESKACCOUNT": "Adicionar conta do Zendesk", + "ADD_ZENDESKACCOUNT": "Adicionar Conta Zendesk", "ERRORS": { "NAME_REQUIRED": "Campo obrigatório", "USERNAME_REQUIRED": "Campo obrigatório", @@ -56,13 +56,13 @@ "MODULECREATE_REQUIRED": "Campo obrigatório" }, "HELP": { - "MOTIONPROXYADDRESS": "Endereço de movimento (proxy): é necessário se você quiser preencher o corpo do ticket com o URL de gravação. Digite o endereço no seguinte formato: : // [: ]. Exemplo: https: //X.Y.Z.W", - "TICKETTYPE": "Tipo de bilhete", + "MOTIONPROXYADDRESS": "Motion (Proxy) Address: é necessario se quiser utilizar o ticket body com Recording URL. Entre com o endereço no seguinte formato: : //[:]. Exemplo: https://X.Y.Z.W", + "TICKETTYPE": "Tipo Ticket", "CLIENTID": "O ID do cliente específico do seu aplicativo", "CLIENTSECRET": "O CLientSecret específico do seu aplicativo", "CODE": "O código específico gerado pelo Developer Console", - "REFRESHTOKEN": "O token de atualização gerado automaticamente usado para atualizar os tokens de acesso expirados. Além disso, o token de acesso é gerado automaticamente sempre que uma API é iniciada.", - "ZONE": "Escolha sua zona geográfica (EUA, AU, UE, IN, CN) para ativar as Contas Zoho específicas do domínio", + "REFRESHTOKEN": "O token de atualização gerado automaticamente e usado para atualizar os tokens de acesso expirados. Além disso, o token de acesso é gerado automaticamente toda vez que uma API é iniciada.", + "ZONE": "Escolha sua zona geográfica (EUA, AU, UE, IN, CN) para ativar o domain-specific da conta Zoho", "ADDITIONALSEARCHACCOUNT": "Nome de campo adicional usado para pesquisar o número de telefone do cliente em contas", "ADDITIONALSEARCHCONTACT": "Nome de campo adicional usado para pesquisar o número de telefone do cliente em Contatos", "ADDITIONALSEARCHLEAD": "Nome de campo adicional usado para pesquisar o número de telefone do cliente no Leads", @@ -70,183 +70,183 @@ "MODERN_AUTHENTICATION": "Alterne para habilitar a autenticação moderna" }, "ACCOUNT": "Conta", - "ZENDESKCONFIGURATIONS": "Configurações do Zendesk", - "SALESFORCECONFIGURATIONS": "Configurações do Salesforce", + "ZENDESKCONFIGURATIONS": "Configurações Zendesk", + "SALESFORCECONFIGURATIONS": "Configurações Salesforce", "SUGARCRMCONFIGURATIONS": "Configurações SugarCRM", - "FRESHDESKCONFIGURATIONS": "Configurações do Freshdesk", + "FRESHDESKCONFIGURATIONS": "Configurações Freshdesk", "GENERAL": "Geral", "CREATED_AT": "Criado em", "SAVE": "Salvar", "NO_ZENDESKCONFIGURATION_AVAILABLE": "Nenhuma configuração do Zendesk disponível", - "NEW_ZENDESKCONFIGURATION": "Nova configuração do Zendesk", - "ADD_ZENDESKCONFIGURATION": "Adicionar configuração do Zendesk", - "EDIT_ZENDESKCONFIGURATION": "Editar configuração do Zendesk", - "DELETE_ZENDESKCONFIGURATION": "Excluir configuração do Zendesk", + "NEW_ZENDESKCONFIGURATION": "Nova Configuração Zendesk", + "ADD_ZENDESKCONFIGURATION": "Adicionar Configuração Zendesk", + "EDIT_ZENDESKCONFIGURATION": "Editar Configuração Zendesk", + "DELETE_ZENDESKCONFIGURATION": "Excluir Configuração Zendesk", "NO_SALESFORCECONFIGURATION_AVAILABLE": "Nenhuma configuração do Salesforce disponível", - "NEW_SALESFORCECONFIGURATION": "Nova configuração do Salesforce", - "ADD_SALESFORCECONFIGURATION": "Adicionar configuração do Salesforce", - "EDIT_SALESFORCECONFIGURATION": "Editar configuração do Salesforce", - "DELETE_SALESFORCECONFIGURATION": "Excluir configuração do Salesforce", + "NEW_SALESFORCECONFIGURATION": "Nova Configuração Salesforce", + "ADD_SALESFORCECONFIGURATION": "Adicionar Configuração Salesforce", + "EDIT_SALESFORCECONFIGURATION": "Editar Configuração Salesforce", + "DELETE_SALESFORCECONFIGURATION": "Excluir Configuração Salesforce", "NO_SUGARCRMCONFIGURATION_AVAILABLE": "Nenhuma configuração do SugarCRM disponível", - "NEW_SUGARCRMCONFIGURATION": "Nova configuração do SugarCRM", - "ADD_SUGARCRMCONFIGURATION": "Adicionar configuração do SugarCRM", - "EDIT_SUGARCRMCONFIGURATION": "Editar configuração do SugarCRM", - "DELETE_SUGARCRMCONFIGURATION": "Excluir configuração do SugarCRM", + "NEW_SUGARCRMCONFIGURATION": "Nova Configuração SugarCRM", + "ADD_SUGARCRMCONFIGURATION": "Adicionar Configuração SugarCRM", + "EDIT_SUGARCRMCONFIGURATION": "Editar Configuração SugarCRM", + "DELETE_SUGARCRMCONFIGURATION": "Excluir Configuração SugarCRM", "NO_FRESHDESKCONFIGURATION_AVAILABLE": "Não há configurações Freshdesk disponíveis", - "NEW_FRESHDESKCONFIGURATION": "Nova configuração do Freshdesk", - "ADD_FRESHDESKCONFIGURATION": "Adicionar configuração do Freshdesk", - "EDIT_FRESHDESKCONFIGURATION": "Editar configuração do Freshdesk", - "DELETE_FRESHDESKCONFIGURATION": "Excluir configuração do Freshdesk", - "SALESFORCEACCOUNTS": "Contas do Salesforce", - "EDIT_SALESFORCEACCOUNT": "Editar conta do Salesforce", - "DELETE_SALESFORCEACCOUNT": "Excluir conta do Salesforce", - "NEW_SALESFORCEACCOUNT": "Nova conta do Salesforce", - "ADD_SALESFORCEACCOUNT": "Adicionar conta do Salesforce", + "NEW_FRESHDESKCONFIGURATION": "Nova Configuração Freshdesk", + "ADD_FRESHDESKCONFIGURATION": "Adicionar Configuração Freshdesk", + "EDIT_FRESHDESKCONFIGURATION": "Editar Configuração Freshdesk", + "DELETE_FRESHDESKCONFIGURATION": "Excluir Configuração Freshdesk", + "SALESFORCEACCOUNTS": "Contas Salesforce", + "EDIT_SALESFORCEACCOUNT": "Editar Conta Salesforce", + "DELETE_SALESFORCEACCOUNT": "Excluir Conta Salesforce", + "NEW_SALESFORCEACCOUNT": "Nova Conta Salesforce", + "ADD_SALESFORCEACCOUNT": "Adicionar Conta Salesforce", "CLIENTID": "ID do Cliente", - "CLIENTSECRET": "Segredo do Cliente", - "SECURITYTOKEN": "Token de segurança", + "CLIENTSECRET": "Senha do Cliente", + "SECURITYTOKEN": "Token Segurança", "SEARCH_FOR_ANYONE": "Procurar", "APIKEY": "Api Key", "FRESHDESKACCOUNTS": "Contas Freshdesk", - "EDIT_FRESHDESKACCOUNT": "Editar conta do Freshdesk", - "DELETE_FRESHDESKACCOUNT": "Delete Freshdesk Account", - "NEW_FRESHDESKACCOUNT": "New Freshdesk Account", - "ADD_FRESHDESKACCOUNT": "Add Freshdesk Account", - "SUGARCRMACCOUNTS": "SugarCRM Accounts", - "EDIT_SUGARCRMACCOUNT": "Edit SugarCRM Account", - "DELETE_SUGARCRMACCOUNT": "Excluir conta do Freshdesk", - "NEW_SUGARCRMACCOUNT": "Nova conta do SugarCRM", - "ADD_SUGARCRMACCOUNT": "Adicionar conta do SugarCRM", + "EDIT_FRESHDESKACCOUNT": "Editar Conta Freshdesk", + "DELETE_FRESHDESKACCOUNT": "Excluir Conta Freshdesk", + "NEW_FRESHDESKACCOUNT": "Nova Conta Freshdesk", + "ADD_FRESHDESKACCOUNT": "Adicionar Conta Freshdesk", + "SUGARCRMACCOUNTS": "Contas SugarCRM", + "EDIT_SUGARCRMACCOUNT": "Editar Conta SugarCRM", + "DELETE_SUGARCRMACCOUNT": "Excluir Conta Freshdesk", + "NEW_SUGARCRMACCOUNT": "Nova Conta SugarCRM", + "ADD_SUGARCRMACCOUNT": "Adicionar Conta SugarCRM", "CONFIGURATIONS": "Configurações", - "NO_CONFIGURATION_AVAILABLE": "Nenhuma configuração disponível", - "NEW_CONFIGURATION": "Nova configuração", - "ADD_CONFIGURATION": "Adicionar configuração", - "EDIT_CONFIGURATION": "Editar configuração", - "DELETE_CONFIGURATION": "Excluir configuração", + "NO_CONFIGURATION_AVAILABLE": "Nenhuma Configuração Disponível", + "NEW_CONFIGURATION": "Nova Configuração", + "ADD_CONFIGURATION": "Adicionar Configuração", + "EDIT_CONFIGURATION": "Editar Configuração", + "DELETE_CONFIGURATION": "Excluir Configuração", "SUBJECTS": "Assuntos", "DESCRIPTIONS": "Descrições", "FIELDS": "Campos", "TAGS": "Tags", "TYPE": "Tipo", "CONTENT": "Conteúdo", - "EDIT_SUBJECT": "Editar assunto", - "DELETE_SUBJECT": "Excluir assunto", - "NEW_SUBJECT": "Novo assunto", - "ADD_SUBJECT": "Adicionar assunto", - "EDIT_DESCRIPTION": "Edite a Descrição", - "DELETE_DESCRIPTION": "Excluir descrição", - "NEW_DESCRIPTION": "Nova descrição", - "ADD_DESCRIPTION": "Adicionar descrição", - "EDIT_FIELD": "Editar campo", - "DELETE_FIELD": "Excluir campo", - "NEW_FIELD": "Novo campo", - "ADD_FIELD": "Adicionar campo", + "EDIT_SUBJECT": "Editar Assunto", + "DELETE_SUBJECT": "Excluir Assunto", + "NEW_SUBJECT": "Novo Assunto", + "ADD_SUBJECT": "Adicionar Assunto", + "EDIT_DESCRIPTION": "Editar Descrição", + "DELETE_DESCRIPTION": "Excluir Descrição", + "NEW_DESCRIPTION": "Nova Descrição", + "ADD_DESCRIPTION": "Adicionar Descrição", + "EDIT_FIELD": "Editar Campo", + "DELETE_FIELD": "Excluir Campo", + "NEW_FIELD": "Novo Campo", + "ADD_FIELD": "Adicionar Campo", "ADD": "Adicionar", "VOICE": "Voz", "MAIL": "Email", "CHAT": "Chat", "SMS": "SMS", "OPENCHANNEL": "Open Channel", - "INBOUND_IN_QUEUE": "Entrada na fila", - "OUTBOUND_CALL": "Chamada de saída", + "INBOUND_IN_QUEUE": "Entrada na Fila", + "OUTBOUND_CALL": "Outbound Call", "VALUE": "Valor", "FIELD": "Campo", "KEY": "Key", "CHANNEL": "Canal", "DELETE": "Excluir", - "NO_AVAILABLE_INFO": "Nenhuma informação disponível", - "TEST_ZENDESKACCOUNT": "Testar conta do Zendesk", - "TEST_FRESHDESKACCOUNT": "Testar conta do Freshdesk", - "TEST_SUGARCRMACCOUNT": "Test SugerCRM Account", - "TEST_SALESFORCEACCOUNT": "Testar conta do Salesforce", + "NO_AVAILABLE_INFO": "Nenhuma Informação Disponível", + "TEST_ZENDESKACCOUNT": "Testar Conta Zendesk", + "TEST_FRESHDESKACCOUNT": "Testar Conta Freshdesk", + "TEST_SUGARCRMACCOUNT": "Testar Conta SugerCRM", + "TEST_SALESFORCEACCOUNT": "Testar Conta Salesforce", "INTEGRATION_TAB": "Guia Integração", - "NEW_TAB": "Nova aba", - "DESKACCOUNTS": "Contas de mesa", - "EDIT_DESKACCOUNT": "Editar conta de mesa", - "TEST_DESKACCOUNT": "Conta de teste de mesa", - "DELETE_DESKACCOUNT": "Excluir conta de mesa", - "CONSUMERKEY": "Chave do consumidor", - "CONSUMERSECRET": "Consumidor secreto", - "TOKENSECRET": "Segredo do Token", - "ADD_DESKACCOUNT": "Adicionar conta de mesa", - "NEW_DESKACCOUNT": "Nova conta de mesa", - "ADD_DESKCONFIGURATION": "Adicionar configuração de mesa", - "NEW_DESKCONFIGURATION": "Nova configuração de mesa", - "DELETE_DESKCONFIGURATION": "Excluir configuração da mesa", + "NEW_TAB": "Nova Aba", + "DESKACCOUNTS": "Contas Desk", + "EDIT_DESKACCOUNT": "Editar Conta Desk", + "TEST_DESKACCOUNT": "Contas Desk", + "DELETE_DESKACCOUNT": "Excluir conta Desk", + "CONSUMERKEY": "Chave do Consumidor", + "CONSUMERSECRET": "Senha do Consumidor", + "TOKENSECRET": "Senha do Token", + "ADD_DESKACCOUNT": "Adicionar Conta Desk", + "NEW_DESKACCOUNT": "Nova Conta Desk", + "ADD_DESKCONFIGURATION": "Adicionar Configuração Desk", + "NEW_DESKCONFIGURATION": "Nova Configuração Desk", + "DELETE_DESKCONFIGURATION": "Excluir configuração Desk", "ZOHOACCOUNTS": "Contas Zoho", - "EDIT_ZOHOACCOUNT": "Editar conta Zoho", + "EDIT_ZOHOACCOUNT": "Editar Conta Zoho", "TEST_ZOHOACCOUNT": "Testar Conta Zoho", - "DELETE_ZOHOACCOUNT": "Excluir conta do Zoho", - "ADD_ZOHOACCOUNT": "Add Zoho Account", - "NEW_ZOHOACCOUNT": "New Zoho Account", - "ADD_ZOHOCONFIGURATION": "Adicionar Conta Zoho", - "NEW_ZOHOCONFIGURATION": "Nova configuração Zoho", + "DELETE_ZOHOACCOUNT": "Excluir Conta Zoho", + "ADD_ZOHOACCOUNT": "Adicionar Conta Zoho", + "NEW_ZOHOACCOUNT": "Nova Conta Zoho", + "ADD_ZOHOCONFIGURATION": "Adicionar Configuração Zoho", + "NEW_ZOHOCONFIGURATION": "Nova Configuração Zoho", "AUTHTOKEN": "Token de Autorização", "HOST": "Host", - "DELETE_ZOHOCONFIGURATION": "Excluir configuração do Zoho", + "DELETE_ZOHOCONFIGURATION": "Excluir Configuração Zoho", "PAGE": "Página", "ROWSPERPAGE": "Linhas por Página", "OF": "do", "VTIGERACCOUNTS": "Contas vTiger", - "VTIGER_USER_NAME": "Nome do usuário vTiger", + "VTIGER_USER_NAME": "Nome do Usuário vTiger", "MODULE_NAME": "Nome do Módulo vTiger", - "ACCESS_KEY": "Chave de acesso vTiger", - "ADD_VTIGERACCOUNT": "Adicionar nova conta vTiger", - "EDIT_VTIGERACCOUNT": "Editar conta vTiger", - "TEST_VTIGERACCOUNT": "Testar conta vTiger", - "DELETE_VTIGERACCOUNT": "Excluir conta vTiger", - "NEW_VTIGERACCOUNT": "Nova conta vTiger", - "NEW_VTIGERCONFIGURATION": "Criar configuração vTiger", - "DELETE_VTIGERCONFIGURATION": "Excluir configuração vTiger", - "ADD_VTIGERCONFIGURATION": "Adicionar configuração vTiger", - "ADD_DYNAMICS365ACCOUNT": "Adicionar nova conta do Dynamics365", - "ADD_DYNAMICS365CONFIGURATION": "Adicionar configuração do Dynamics365", - "CASE": "Caso", - "DELETE_DYNAMICS365ACCOUNT": "Excluir conta do Dynamics365", - "DELETE_DYNAMICS365CONFIGURATION": "Excluir configuração do Dynamics365", - "DYNAMICS365ACCOUNTS": "Contas do Dynamics365", - "EDIT_DYNAMICS365ACCOUNT": "Editar conta do Dynamics365", - "NEW_DYNAMICS365ACCOUNT": "Nova conta do Dynamics365", - "NEW_DYNAMICS365CONFIGURATION": "Criar configuração do Dynamics365", - "PHONECALL": "Chamada telefónica", - "TENANTID": "ID do inquilino", - "TEST_DYNAMICS365ACCOUNT": "Testar conta Dynamics365", - "TICKETTYPE": "Tipo de bilhete", - "ADD_SERVICENOWACCOUNT": "Adicionar nova conta ServiceNow", - "ADD_SERVICENOWCONFIGURATION": "Adicionar configuração do ServiceNow", - "DELETE_SERVICENOWACCOUNT": "Excluir conta ServiceNow", - "DELETE_SERVICENOWCONFIGURATION": "Excluir configuração do ServiceNow", - "EDIT_SERVICENOWACCOUNT": "Editar conta ServiceNow", - "EMAIL": "O email", - "NEW_SERVICENOWACCOUNT": "Nova conta ServiceNow", - "NEW_SERVICENOWCONFIGURATION": "Criar configuração do ServiceNow", + "ACCESS_KEY": "Chave de Acesso vTiger", + "ADD_VTIGERACCOUNT": "Adicionar Conta vTiger", + "EDIT_VTIGERACCOUNT": "Editar Conta vTiger", + "TEST_VTIGERACCOUNT": "Testar Conta vTiger", + "DELETE_VTIGERACCOUNT": "Excluir Conta vTiger", + "NEW_VTIGERACCOUNT": "Nova Conta vTiger", + "NEW_VTIGERCONFIGURATION": "Criar Configuração vTiger", + "DELETE_VTIGERCONFIGURATION": "Excluir Configuração vTiger", + "ADD_VTIGERCONFIGURATION": "Adicionar Configuração vTiger", + "ADD_DYNAMICS365ACCOUNT": "Adicionar Conta Dynamics365", + "ADD_DYNAMICS365CONFIGURATION": "Adicionar Configuração Dynamics365", + "CASE": "Case", + "DELETE_DYNAMICS365ACCOUNT": "Excluir Conta Dynamics365", + "DELETE_DYNAMICS365CONFIGURATION": "Excluir Configuração Dynamics365", + "DYNAMICS365ACCOUNTS": "Contas Dynamics365", + "EDIT_DYNAMICS365ACCOUNT": "Editar Conta Dynamics365", + "NEW_DYNAMICS365ACCOUNT": "Nova Conta Dynamics365", + "NEW_DYNAMICS365CONFIGURATION": "Criar Configuração Dynamics365", + "PHONECALL": "Chamada telefônica", + "TENANTID": "Tenant ID", + "TEST_DYNAMICS365ACCOUNT": "Testar Conta Dynamics365", + "TICKETTYPE": "Tipo de Ticket", + "ADD_SERVICENOWACCOUNT": "Adicionar Conta ServiceNow", + "ADD_SERVICENOWCONFIGURATION": "Adicionar Configuração ServiceNow", + "DELETE_SERVICENOWACCOUNT": "Excluir Conta ServiceNow", + "DELETE_SERVICENOWCONFIGURATION": "Excluir Configuração ServiceNow", + "EDIT_SERVICENOWACCOUNT": "Editar Conta ServiceNow", + "EMAIL": "Email", + "NEW_SERVICENOWACCOUNT": "Nova Conta ServiceNow", + "NEW_SERVICENOWCONFIGURATION": "Nova Configuração ServiceNow", "SERVICENOWACCOUNTS": "Contas ServiceNow", - "TEST_SERVICENOWACCOUNT": "Conta de Serviço de Teste", + "TEST_SERVICENOWACCOUNT": "Testar Conta ServiceNow", "TASK": "Tarefa", - "CODE": "Código do console do desenvolvedor", - "REFRESHTOKEN": "Atualizar token (gerado)", + "CODE": "Developer Console Code", + "REFRESHTOKEN": "Atualizar Token (gerado)", "ZONE": "Zona", "CONTACTS": "Contato", - "LEADS": "Conduzir", - "MODULECREATE": "Criar módulo", - "ADD_FRESHSALESACCOUNT": "Adicionar conta Freshsales", - "ADD_FRESHSALESCONFIGURATION": "Adicionar configuração de vendas frescas", - "DELETE_FRESHSALESACCOUNT": "Excluir conta Freshsales", - "DELETE_FRESHSALESCONFIGURATION": "Excluir configuração de vendas recentes", - "EDIT_FRESHSALESACCOUNT": "Editar conta de vendas frescas", - "EDIT_FRESHSALESCONFIGURATION": "Editar configuração de vendas frescas", - "FRESHSALESACCOUNTS": "Contas de vendas frescas", - "NEW_FRESHSALESACCOUNT": "Nova conta de vendas frescas", - "NEW_FRESHSALESCONFIGURATION": "Nova configuração de vendas frescas", - "NO_FRESHSALESCONFIGURATION_AVAILABLE": "Nenhuma configuração de vendas frescas disponível", - "TEST_FRESHSALESACCOUNT": "Conta de teste de vendas frescas", - "ADDITIONALSEARCHACCOUNT": "Conta de pesquisa adicional", - "ADDITIONALSEARCHCONTACT": "Contato de pesquisa adicional", - "ADDITIONALSEARCHLEAD": "Lead de pesquisa adicional", - "LEADID": "Id de chumbo", + "LEADS": "Lead", + "MODULECREATE": "Criar Módulo", + "ADD_FRESHSALESACCOUNT": "Adicionar Conta Freshsales", + "ADD_FRESHSALESCONFIGURATION": "Adicionar Configuração Freshsales", + "DELETE_FRESHSALESACCOUNT": "Excluir Conta Freshsales", + "DELETE_FRESHSALESCONFIGURATION": "Excluir configuração Freshsales", + "EDIT_FRESHSALESACCOUNT": "Editar Conta Freshsales", + "EDIT_FRESHSALESCONFIGURATION": "Editar Configuração Freshsales", + "FRESHSALESACCOUNTS": "Contas Freshsales", + "NEW_FRESHSALESACCOUNT": "Nova Conta Freshsales", + "NEW_FRESHSALESCONFIGURATION": "Nova Configuração Freshsales", + "NO_FRESHSALESCONFIGURATION_AVAILABLE": "Nenhuma configuração de Freshsales disponível", + "TEST_FRESHSALESACCOUNT": "Testar Conta Freshsales", + "ADDITIONALSEARCHACCOUNT": "Conta de Pesquisa Adicional", + "ADDITIONALSEARCHCONTACT": "Contato de Pesquisa Adicional", + "ADDITIONALSEARCHLEAD": "Lead de Pesquisa Adicional", + "LEADID": "Lead ID", "DYNAMIC365CONTACT": "Contato", - "DYNAMIC365NOTHING": "Nenhuma coisa", + "DYNAMIC365NOTHING": "Nothing", "MODERN_AUTHENTICATION": "Autenticação Moderna", - "OPENNEWTAB": "Abrir nova guia" + "OPENNEWTAB": "Abrir Nova Aba" } } diff --git a/public/app/main/apps/jscripty/i18n/bs.json b/public/app/main/apps/jscripty/i18n/bs.json index c5e12d7..8d2329d 100644 --- a/public/app/main/apps/jscripty/i18n/bs.json +++ b/public/app/main/apps/jscripty/i18n/bs.json @@ -1,228 +1,228 @@ { "JSCRIPTY": { - "CLONE_PROJECT": "Clone Project", - "NAME": "Name", - "SEARCH_FOR_ANYONE": "Search", - "BACK": "Back", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "DESCRIPTION": "Description", + "CLONE_PROJECT": "Kloniraj Projekat", + "NAME": "Ime", + "SEARCH_FOR_ANYONE": "Traži", + "BACK": "Nazad", + "SELECTED": "Odabrano", + "SELECT_ALL": "Odaberi Sve", + "SELECT_NONE": "Odaberi Ništa", + "DESCRIPTION": "Opis", "ERRORS": { - "NAME_REQUIRED": "Mandatory field", - "PROJECT_REQUIRED": "Mandatory field", - "FIELD_REQUIRED": "Mandatory field", - "NAME_MUST_VALID_PATTERN": "Wrong format" + "NAME_REQUIRED": "Obavezno polje", + "PROJECT_REQUIRED": "Obavezno polje", + "FIELD_REQUIRED": "Obavezno polje", + "NAME_MUST_VALID_PATTERN": "Pogrešan format" }, - "SAVE": "Save", - "PROJECTS": "Projects", - "ADD_PROJECT": "Add Project", - "EDIT_PROJECT": "Edit Project", - "DELETE_PROJECT": "Delete Project", + "SAVE": "Sačuvaj", + "PROJECTS": "Projekti", + "ADD_PROJECT": "Dodaj Projekat", + "EDIT_PROJECT": "Uredi Projekat", + "DELETE_PROJECT": "Izbriši Projekat", "JSCRIPTY": "Jscripty", - "ID": "Id", - "PROJECT": "Project", - "CREATED_AT": "Created At", - "NEW_PROJECT": "New Project", - "EDIT": "Edit", - "SETTINGS": "Settings", - "GENERAL": "General", - "BUILDER": "Builder", - "PREVIEW": "Preview", - "OPEN_CONTACT": "Open Contact", - "SENDUNPAUSEONSUBMIT": "Unpause agent on Submit", + "ID": "ID", + "PROJECT": "Projekat", + "CREATED_AT": "Kreirano U", + "NEW_PROJECT": "Novi Projekat", + "EDIT": "Uredi", + "SETTINGS": "Postavke", + "GENERAL": "Općenito", + "BUILDER": "Graditelj", + "PREVIEW": "Pregled", + "OPEN_CONTACT": "Otvori Kontakt", + "SENDUNPAUSEONSUBMIT": "Skini pauzu specijalista nakon Podnošenja", "HELP": { - "NAME": "Only numbers, letters and specific characters (._) are supported", - "ENABLEUNCOMPLETESAVE": "Allow to save the agent session even if the survey is not complete", - "SENDUNPAUSEONSUBMIT": "At the end of the survey, automatically stop the agent's pause" + "NAME": "Podržani su samo brojevi, slova i specifični znakovi (._)", + "ENABLEUNCOMPLETESAVE": "Dozvoli da se sesija specijaliste sačuva čak i ako anketa nije završena", + "SENDUNPAUSEONSUBMIT": "Na kraju ankete, automatski zaustavi pauzu specijaliste" }, - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", - "JSCRIPTYSESSIONS": "Project Sessions", - "SESSIONS": "Sessions", - "STARTTIME": "Start Time", - "ENDTIME": "End Time", - "MEMBERNAME": "Member Name", - "CALLERIDNUM": "Caller Number", - "NO_SESSION_AVAILABLE": "No Sessions available", - "SESSION_RESULTS": "Session Results", - "SHOW_QUESTIONS_SESSION": "Show Session Results", - "ANSWERS": "Answers", - "NO_RESULTS_AVAILABLE": "No results available", - "TOTAL": "Total", - "ANSWER": "Answer", - "EXPORT_TO_CSV": "Export to CSV", - "NO_ANSWERS_AVAILABLE": "No answers available", - "DELETE_SESSION": "Delete Session", - "RESET_SESSION": "Reset Session", - "YES": "Yes", - "NO": "No", - "DO_YOU_WANT_TO_RESET_SESSION": "Do you want to reset the session?", - "ALL_SURVEY_DATA_WILL_BE_LOST": "All survey answers will be lost!", - "ENABLEUNCOMPLETESAVE": "Enable incomplete save", - "SUBMIT": "Submit", - "PROJECT_NOT_AVAILABLE": "Project is not available. Please contact the administrator", - "COMPLETE": "Complete", - "SESSIONS_PROJECT": "Go to Sessions" + "PAGE": "Stranica", + "ROWSPERPAGE": "Redova po stranici", + "OF": "od", + "JSCRIPTYSESSIONS": "Sesija Projekta", + "SESSIONS": "Sesije", + "STARTTIME": "Vrijeme Početka", + "ENDTIME": "Vrijeme Završetka", + "MEMBERNAME": "Ime Člana", + "CALLERIDNUM": "Broj Pozivaoca", + "NO_SESSION_AVAILABLE": "Nema dostupnih sesija", + "SESSION_RESULTS": "Reultati Sesije", + "SHOW_QUESTIONS_SESSION": "Prikaži Rezultate Sesije", + "ANSWERS": "Odgovori", + "NO_RESULTS_AVAILABLE": "Nema dostupnih rezultata", + "TOTAL": "Ukupno", + "ANSWER": "Odgovori", + "EXPORT_TO_CSV": "Izvoz u CSV", + "NO_ANSWERS_AVAILABLE": "Nema dostupnih odgovora", + "DELETE_SESSION": "Izbriši Sesiju", + "RESET_SESSION": "Poništi Sesiju", + "YES": "Da", + "NO": "Ne", + "DO_YOU_WANT_TO_RESET_SESSION": "Želiš li poništiti sesiju?", + "ALL_SURVEY_DATA_WILL_BE_LOST": "Svi odgovori na anketu će biti izgubljeni!", + "ENABLEUNCOMPLETESAVE": "Omogući nepotpuno spremanje", + "SUBMIT": "Podnesi", + "PROJECT_NOT_AVAILABLE": "Projekat nije dostupan. Molimo kontaktiraj Kontakt Centar Menadžera", + "COMPLETE": "Završi", + "SESSIONS_PROJECT": "Idi na Sesije" }, "mwForm": { "form": { - "name": "Title", - "name.placeholder": "Form title", - "description": "Description" + "name": "Naziv", + "name.placeholder": "Naziv forme", + "description": "Opis" }, "buttons": { - "addPage": "Add page", - "moveDown": "Move down", - "moveUp": "Move up", - "removePage": "Remove page", - "remove": "Remove", - "addElement": "Add element", - "questionReady": "Ready", - "next": "Next", - "back": "Back", - "submit": "Submit", - "begin": "Begin", - "fold": "Fold", - "unfold": "Unfold", - "edit": "Edit", - "clone": "Clone", - "view": "View" + "addPage": "Dodaj stranicu", + "moveDown": "Pomakni dolje", + "moveUp": "Pomakni gore", + "removePage": "Ukloni stranicu", + "remove": "Ukloni", + "addElement": "Dodaj element", + "questionReady": "Spreman", + "next": "Sljedeći", + "back": "Nazad", + "submit": "Podnesi", + "begin": "Počni", + "fold": "Preklopi", + "unfold": "Rasklopi", + "edit": "Uredi", + "clone": "Kloniraj", + "view": "Pogledaj" }, "page": { "tab": { - "heading": "Page {{page}} of {{allPages}}" + "heading": "Stranica {{page}} od {{allPages}}" }, "elements": { - "empty": "Empty page" + "empty": "Prazna stranica" }, - "pageWithNameCheckbox": "named", - "name": "Page name" + "pageWithNameCheckbox": "imenovan", + "name": "Naziv stranice" }, "pageFlow": { - "afterPage": "After page {{page}}:", - "afterQuestionAnswer": "Go to page based on answer", - "goToPage": "Go to page {{page.number}}", - "goToNextPage": "Continue to next page", - "submitForm": "Submit form" + "afterPage": "Nakon stranice {{page}}:", + "afterQuestionAnswer": "Idi na stranicu na osnovu odgovora", + "goToPage": "Idi na stranicu {{page.number}}", + "goToNextPage": "Nastavi na sljedeću stranicu", + "submitForm": "Podnesi formu" }, "elements": { - "question": "Question", - "image": "Image", - "paragraph": "Paragraph" + "question": "Pitanje", + "image": "Slika", + "paragraph": "Paragraf" }, "question": { "types": { "text": { - "name": "Short text" + "name": "Kratki tekst" }, "textarea": { - "name": "Long text" + "name": "Dugi tekst" }, "radio": { "name": "Radio" }, "select": { - "name": "Select" + "name": "Odaberi" }, "checkbox": { - "name": "Checkboxes" + "name": "Polja za potvrdu" }, "grid": { - "name": "Grid" + "name": "Mreža" }, "priority": { - "name": "Priority" + "name": "Prioritet" }, "division": { - "name": "Division" + "name": "Divizija" }, "number": { - "name": "Number" + "name": "Broj" }, "date": { - "name": "Date" + "name": "Datum" }, "datetime": { - "name": "Datetime" + "name": "Datum i vrijeme" }, "time": { - "name": "Time" + "name": "Vrijeme" }, "email": { - "name": "Email" + "name": "E-mail" }, "range": { - "name": "Range" + "name": "Raspon" }, "url": { "name": "URL" } }, - "text": "Question text", - "type": "Question type", - "required": "Required", + "text": "Tekst pitanja", + "type": "Vrsta pitanja", + "required": "Obavezno", "preview": { - "text": "Short answer text", - "textarea": "Long answer text", - "otherAnswer": "Other" + "text": "Tekst kratkog odgovora", + "textarea": "Tekst dugog odgovora", + "otherAnswer": "Ostalo" }, "division": { - "quantity": "Quantity", - "unit": "Unit label", - "assignedSumLabel": "Assigned", - "fromRequiredLabel": "from required" + "quantity": "Količina", + "unit": "Oznaka jedinice", + "assignedSumLabel": "Dodijeljeno", + "fromRequiredLabel": "od potrebnog" }, "priority": { - "sorted": "Sorted", - "available": "Available", - "clickToAddItem": "Click to add item" + "sorted": "Sortirano", + "available": "Dostupno", + "clickToAddItem": "Klikni da dodaš stavku" }, "grid": { - "cellInputType": "Cell input type", + "cellInputType": "Vrsta unosa Ćelije", "cellInputTypes": { "radio": "Radio", - "checkbox": "Checkbox", - "text": "Text", - "number": "Number", - "date": "Date", - "time": "Time" + "checkbox": "Polje za potvrdu", + "text": "Tekst", + "number": "Broj", + "date": "Datum", + "time": "Vrijeme" }, - "rowLabel": "Row {{row}}", - "clickToAddRow": "Click to add row", - "columnLabel": "Column {{col}}", - "clickToAddColumn": "Click to add column" + "rowLabel": "Red {{row}}", + "clickToAddRow": "Klikni da dodaš red", + "columnLabel": "Kolona {{col}}", + "clickToAddColumn": "Klikni da dodaš kolonu" }, "range": { - "from": "Range from", - "to": "to" + "from": "Raspon od", + "to": "do" }, "number": { "min": "Min", - "max": "Max" + "max": "Maks" }, - "orLabel": "or ", - "otherLabel": "Other: ", - "userAnswer": "User answer", + "orLabel": "ili", + "otherLabel": "Ostalo:", + "userAnswer": "Odgovor korisnika", "buttons": { - "addOption": "Click to add option", - "addOther": "Add 'Other'" + "addOption": "Klikni da dodate opciju", + "addOther": "Dodaj 'Ostalo'" } }, "image": { - "selectImageButton": "Select image", - "caption": "Image caption" + "selectImageButton": "Odaberi sliku", + "caption": "Natpis slike" }, "paragraph": { - "placeholder": "Enter paragraph text" + "placeholder": "Unesi tekst paragrafa" }, "confirmationPage": { - "title": "Confirmation page", - "customMessage": "Custom confirmation message", - "defaultMessage": "Your response has been saved", - "errorMessage": "Error! Your response has not been saved", - "pendingMessage": "Your response is being saved" + "title": "Stranica potvrde", + "customMessage": "Prilagođena poruka potvrde", + "defaultMessage": "Vaš odgovor je sačuvan", + "errorMessage": "Greška! Vaš odgovor nije sačuvan", + "pendingMessage": "Vaš odgovor se pohranjuje" } } } diff --git a/public/app/main/apps/jscripty/i18n/is.json b/public/app/main/apps/jscripty/i18n/is.json new file mode 100644 index 0000000..c5e12d7 --- /dev/null +++ b/public/app/main/apps/jscripty/i18n/is.json @@ -0,0 +1,228 @@ +{ + "JSCRIPTY": { + "CLONE_PROJECT": "Clone Project", + "NAME": "Name", + "SEARCH_FOR_ANYONE": "Search", + "BACK": "Back", + "SELECTED": "Selected", + "SELECT_ALL": "Select All", + "SELECT_NONE": "Select None", + "DESCRIPTION": "Description", + "ERRORS": { + "NAME_REQUIRED": "Mandatory field", + "PROJECT_REQUIRED": "Mandatory field", + "FIELD_REQUIRED": "Mandatory field", + "NAME_MUST_VALID_PATTERN": "Wrong format" + }, + "SAVE": "Save", + "PROJECTS": "Projects", + "ADD_PROJECT": "Add Project", + "EDIT_PROJECT": "Edit Project", + "DELETE_PROJECT": "Delete Project", + "JSCRIPTY": "Jscripty", + "ID": "Id", + "PROJECT": "Project", + "CREATED_AT": "Created At", + "NEW_PROJECT": "New Project", + "EDIT": "Edit", + "SETTINGS": "Settings", + "GENERAL": "General", + "BUILDER": "Builder", + "PREVIEW": "Preview", + "OPEN_CONTACT": "Open Contact", + "SENDUNPAUSEONSUBMIT": "Unpause agent on Submit", + "HELP": { + "NAME": "Only numbers, letters and specific characters (._) are supported", + "ENABLEUNCOMPLETESAVE": "Allow to save the agent session even if the survey is not complete", + "SENDUNPAUSEONSUBMIT": "At the end of the survey, automatically stop the agent's pause" + }, + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "OF": "of", + "JSCRIPTYSESSIONS": "Project Sessions", + "SESSIONS": "Sessions", + "STARTTIME": "Start Time", + "ENDTIME": "End Time", + "MEMBERNAME": "Member Name", + "CALLERIDNUM": "Caller Number", + "NO_SESSION_AVAILABLE": "No Sessions available", + "SESSION_RESULTS": "Session Results", + "SHOW_QUESTIONS_SESSION": "Show Session Results", + "ANSWERS": "Answers", + "NO_RESULTS_AVAILABLE": "No results available", + "TOTAL": "Total", + "ANSWER": "Answer", + "EXPORT_TO_CSV": "Export to CSV", + "NO_ANSWERS_AVAILABLE": "No answers available", + "DELETE_SESSION": "Delete Session", + "RESET_SESSION": "Reset Session", + "YES": "Yes", + "NO": "No", + "DO_YOU_WANT_TO_RESET_SESSION": "Do you want to reset the session?", + "ALL_SURVEY_DATA_WILL_BE_LOST": "All survey answers will be lost!", + "ENABLEUNCOMPLETESAVE": "Enable incomplete save", + "SUBMIT": "Submit", + "PROJECT_NOT_AVAILABLE": "Project is not available. Please contact the administrator", + "COMPLETE": "Complete", + "SESSIONS_PROJECT": "Go to Sessions" + }, + "mwForm": { + "form": { + "name": "Title", + "name.placeholder": "Form title", + "description": "Description" + }, + "buttons": { + "addPage": "Add page", + "moveDown": "Move down", + "moveUp": "Move up", + "removePage": "Remove page", + "remove": "Remove", + "addElement": "Add element", + "questionReady": "Ready", + "next": "Next", + "back": "Back", + "submit": "Submit", + "begin": "Begin", + "fold": "Fold", + "unfold": "Unfold", + "edit": "Edit", + "clone": "Clone", + "view": "View" + }, + "page": { + "tab": { + "heading": "Page {{page}} of {{allPages}}" + }, + "elements": { + "empty": "Empty page" + }, + "pageWithNameCheckbox": "named", + "name": "Page name" + }, + "pageFlow": { + "afterPage": "After page {{page}}:", + "afterQuestionAnswer": "Go to page based on answer", + "goToPage": "Go to page {{page.number}}", + "goToNextPage": "Continue to next page", + "submitForm": "Submit form" + }, + "elements": { + "question": "Question", + "image": "Image", + "paragraph": "Paragraph" + }, + "question": { + "types": { + "text": { + "name": "Short text" + }, + "textarea": { + "name": "Long text" + }, + "radio": { + "name": "Radio" + }, + "select": { + "name": "Select" + }, + "checkbox": { + "name": "Checkboxes" + }, + "grid": { + "name": "Grid" + }, + "priority": { + "name": "Priority" + }, + "division": { + "name": "Division" + }, + "number": { + "name": "Number" + }, + "date": { + "name": "Date" + }, + "datetime": { + "name": "Datetime" + }, + "time": { + "name": "Time" + }, + "email": { + "name": "Email" + }, + "range": { + "name": "Range" + }, + "url": { + "name": "URL" + } + }, + "text": "Question text", + "type": "Question type", + "required": "Required", + "preview": { + "text": "Short answer text", + "textarea": "Long answer text", + "otherAnswer": "Other" + }, + "division": { + "quantity": "Quantity", + "unit": "Unit label", + "assignedSumLabel": "Assigned", + "fromRequiredLabel": "from required" + }, + "priority": { + "sorted": "Sorted", + "available": "Available", + "clickToAddItem": "Click to add item" + }, + "grid": { + "cellInputType": "Cell input type", + "cellInputTypes": { + "radio": "Radio", + "checkbox": "Checkbox", + "text": "Text", + "number": "Number", + "date": "Date", + "time": "Time" + }, + "rowLabel": "Row {{row}}", + "clickToAddRow": "Click to add row", + "columnLabel": "Column {{col}}", + "clickToAddColumn": "Click to add column" + }, + "range": { + "from": "Range from", + "to": "to" + }, + "number": { + "min": "Min", + "max": "Max" + }, + "orLabel": "or ", + "otherLabel": "Other: ", + "userAnswer": "User answer", + "buttons": { + "addOption": "Click to add option", + "addOther": "Add 'Other'" + } + }, + "image": { + "selectImageButton": "Select image", + "caption": "Image caption" + }, + "paragraph": { + "placeholder": "Enter paragraph text" + }, + "confirmationPage": { + "title": "Confirmation page", + "customMessage": "Custom confirmation message", + "defaultMessage": "Your response has been saved", + "errorMessage": "Error! Your response has not been saved", + "pendingMessage": "Your response is being saved" + } + } +} diff --git a/public/app/main/apps/mail/i18n/bs.json b/public/app/main/apps/mail/i18n/bs.json index 22a7db6..caf47e2 100644 --- a/public/app/main/apps/mail/i18n/bs.json +++ b/public/app/main/apps/mail/i18n/bs.json @@ -1,346 +1,346 @@ { "MAIL": { - "ADVANCED": "Advanced", - "DOWNLOAD_WITH_ATTACHMENTS": "Download with attachments", - "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download without attachments", - "DOWNLOAD": "Download", - "LOGIN_TIME": "Login time", - "PAUSE_TIME": "Pause time", - "DOWNLOAD_INTERACTION": "Download", - "YOU_ARE_REGISTERED_AS_A": "You are registered as a", - "TRANSFER": "Transfer", - "QUEUETRANSFER": "Queue Transfer", - "QUEUETRANSFERTIMEOUT": "Queue Transfer Timeout", - "AGENTTRANSFER": "Agent Transfer", - "AGENTTRANSFERTIMEOUT": "Agent Transfer Timeout", + "ADVANCED": "Napredno", + "DOWNLOAD_WITH_ATTACHMENTS": "Skini sa prilozima", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Skini bez priloga", + "DOWNLOAD": "Skini", + "LOGIN_TIME": "Vrijeme prijave", + "PAUSE_TIME": "Vrijeme pauze", + "DOWNLOAD_INTERACTION": "Skini", + "YOU_ARE_REGISTERED_AS_A": "Registrovan si kao", + "TRANSFER": "Prijenos", + "QUEUETRANSFER": "Queue Prijenos", + "QUEUETRANSFERTIMEOUT": "Timeout Queue Prijenosa", + "AGENTTRANSFER": "Prijenos Specijaliste", + "AGENTTRANSFERTIMEOUT": "Timeout Prijenosa Spacijaliste", "TAG": "Tag", - "EDIT_TAG": "Edit Tag", - "WAITFORTHEASSIGNEDAGENT": "Wait for the assigned agent", - "NOTIFICATION": "Notification", - "NOTIFICATIONSOUND": "Sound", - "NOTIFICATIONSHAKE": "Shake", - "NOTIFICATIONTEMPLATE": "Template", - "SYSTEM": "System", - "EDIT_SYSTEM": "Edit System", - "COMMAND": "Command", - "VARIABLE": "Variable", - "SEND_AS": "Send as", - "NEW_MAILSUBSTATUS": "New Sub Status", - "ADD_MAILSUBSTATUS": "Add Sub Status", - "MAILSUBSTATUSES": "Email Sub Statuses", - "EDIT_MAILSUBSTATUS": "Edit", - "DELETE_MAILSUBSTATUS": "Delete", - "FONT_FAMILY": "Font Family", - "FONT_SIZE": "Font Size", - "MARK_AS_UNREAD": "Mark as unread", - "ACCEPTED": "Accepted", - "CANNEDANSWERS": "Canned Answers", - "MAILCANNEDANSWERS": "Canned Answers", - "NO_MAILCANNEDANSWER_AVAILABLE": "No Canned Answers Available", - "NEW_MAILCANNEDANSWER": "New Canned Answer", - "ADD_MAILCANNEDANSWER": "Add Canned Answer", - "EDIT_MAILCANNEDANSWER": "Edit Canned Answer", - "DELETE_MAILCANNEDANSWER": "Delete Canned Answer", - "SHOW_ORIGINAL_MESSAGE": "Show original message", - "PENDING": "Pending", - "SEND_AS_PENDING": "Send as Pending", - "SEND_AND_CLOSE": "Send and Close", - "CANNED_ANSWER_NOT_FOUND": "No Canned Answers were found", - "CANNED_ANSWER_SEARCH": "Enter a text to search a Canned Answer", + "EDIT_TAG": "Uredi Tag", + "WAITFORTHEASSIGNEDAGENT": "Pričekaj dodijeljenog specijalistu", + "NOTIFICATION": "Obavijest", + "NOTIFICATIONSOUND": "Zvuk", + "NOTIFICATIONSHAKE": "Protresi", + "NOTIFICATIONTEMPLATE": "Šablon", + "SYSTEM": "Sistem", + "EDIT_SYSTEM": "Uredi Sistem", + "COMMAND": "Komanda", + "VARIABLE": "Varijabla", + "SEND_AS": "Pošalji kao", + "NEW_MAILSUBSTATUS": "Novi Podstatus", + "ADD_MAILSUBSTATUS": "Dodaj Podstatus", + "MAILSUBSTATUSES": "E-mail Podstatusi", + "EDIT_MAILSUBSTATUS": "Uredi", + "DELETE_MAILSUBSTATUS": "Izbriši", + "FONT_FAMILY": "Font", + "FONT_SIZE": "Veličina Fonta", + "MARK_AS_UNREAD": "Označi kao nepročitano", + "ACCEPTED": "Prihvaćeno", + "CANNEDANSWERS": "Pripremljeni Odgovori", + "MAILCANNEDANSWERS": "Pripremljeni Odgovori", + "NO_MAILCANNEDANSWER_AVAILABLE": "Nema dostupnih Pripremljenih Odgovora", + "NEW_MAILCANNEDANSWER": "Novi Pripremljeni Odgovor", + "ADD_MAILCANNEDANSWER": "DOdaj Pripremljeni Odgovor", + "EDIT_MAILCANNEDANSWER": "Uredi Pripremljeni Odgovor", + "DELETE_MAILCANNEDANSWER": "Izbriši Pripremljeni Odgovor", + "SHOW_ORIGINAL_MESSAGE": "Pokaži originalnu poruku", + "PENDING": "Na čekanju", + "SEND_AS_PENDING": "Pošalji kao Na čekanju", + "SEND_AND_CLOSE": "Pošalji i Zatvori", + "CANNED_ANSWER_NOT_FOUND": "Nije pronađen nijedan Pripremljeni Odgovor", + "CANNED_ANSWER_SEARCH": "Unesi tekst za pretraživanje Pripremljenih Odgovora", "SPYINTERACTION": "Spy", - "ADD_NOTE": "Add note", - "NOTE": "Note", - "TAGS": "Tags", - "NO_AGENT_ONLINE": "No Agent Online", - "GOTOREALTIME_MAILQUEUE": "Go To Realtime Mail Queue", - "PARTIALPAUSE": "Parital Pause", - "BUSY": "Busy", + "ADD_NOTE": "Dodaj bilješku", + "NOTE": "Bilješka", + "TAGS": "Tag-ovi", + "NO_AGENT_ONLINE": "Nema Specijalista Online", + "GOTOREALTIME_MAILQUEUE": "Idi na Realtime E-mail Queue", + "PARTIALPAUSE": "Parcijalna Pauza", + "BUSY": "Zauzet", "TIMER": "Timer", "IDLE": "Idle", - "CAPACITY": "Capacity", - "UNPAUSE": "End Pause", - "DEFAULT_PAUSE": "Default pause", - "LOGOUT": "Logout", - "AGENTADD_QUEUE": "Add agent to Email queue", + "CAPACITY": "Kapacitet", + "UNPAUSE": "Prekini Pauzu", + "DEFAULT_PAUSE": "Zadana pauza", + "LOGOUT": "Odjava", + "AGENTADD_QUEUE": "Dodaj Specijalistu na E-mail Queue", "VOICE": "Voice", "CHAT": "Chat", - "SMS": "Sms", - "OPENCHANNEL": "Open channel", + "SMS": "SMS", + "OPENCHANNEL": "Otvoreni Kanal", "FAX": "Fax", "REALTIME": "Realtime", - "AGENTS": "Agents", + "AGENTS": "Specijalisti", "QUEUES": "Queues", - "ACCOUNTS": "Accounts", - "FULLNAME": "Full Name", - "INTERNAL": "Internal", - "PHONE_STATE": "Phone State", - "PHONE_STATUS": "Phone Status", - "PAUSE": "Pause", - "LOGGED_IN": "Logged In", - "PAUSED": "Paused", - "READY": "Ready", - "WAITING": "Waiting", - "TOTAL": "Total", - "IN": "In", - "OUT": "Out", + "ACCOUNTS": "Nalozi", + "FULLNAME": "Puno Ime", + "INTERNAL": "Interni", + "PHONE_STATE": "Stanje Telefona", + "PHONE_STATUS": "Status Telefona", + "PAUSE": "Pauza", + "LOGGED_IN": "Prijavljen", + "PAUSED": "Pauzirano", + "READY": "Spreman", + "WAITING": "Čeka", + "TOTAL": "Ukupno", + "IN": "U", + "OUT": "Van", "IMAP_STATUS": "IMAP Status", "SMTP_STATUS": "SMTP Status", - "DISABLED": "Disabled", - "CONNECTED": "Connected", - "NEVER_VERIFIED": "Never Verified", - "ERROR": "Error", - "EDIT_ACCOUNT": "Edit Account", - "VERIFY_SMTP": "Verify SMTP", - "VERIFIED": "Verified", - "VERIFYSMTP_MAILACCOUNT": "Verify SMTP", - "GOTOREALTIME_MAILACCOUNT": "Go to Realtime Email Account", - "GOTO_MAILACCOUNT": "Go to Realtime Email Account", - "TEXT": "Text", - "TIMES": "Number of times per interaction", - "REPLY_TYPE": "Reply Type", - "EDIT_AUTOREPLY": "Edit Auto Reply", - "AUTOREPLY": "Auto Reply", - "SHOW_AUTOREPLY": "Show Auto Reply", - "SHOW_DETAILS": "Show details", - "HIDE_DETAILS": "Hide details", - "TO": "To", - "FROM": "From", - "DATE": "Date", - "CC": "Cc", - "REPLY": "Reply", - "REPLY_ALL": "Reply All", - "FORWARD": "Forward", - "SUBJECT": "Subject", - "BCC": "Bcc", - "SEND": "Send", - "ATTACHMENT": "Attachment", - "ATTACHMENTS": "Attachments", - "NAME": "Name", - "MAILQUEUES": "Email Queues", - "SEARCH_FOR_ANYONE": "Search", - "STRATEGY": "Strategy", - "MANDATORYDISPOSITION": "Mandatory disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pause to use if mandatory disposition is enabled", + "DISABLED": "Onemogućeno", + "CONNECTED": "Konektovano", + "NEVER_VERIFIED": "Nikad Verifikovano", + "ERROR": "Greška", + "EDIT_ACCOUNT": "Uredi Nalog", + "VERIFY_SMTP": "Verifikuj SMTP", + "VERIFIED": "Verifikovano", + "VERIFYSMTP_MAILACCOUNT": "Verifikuj SMTP", + "GOTOREALTIME_MAILACCOUNT": "Idi na Realtime E-mail Nalog", + "GOTO_MAILACCOUNT": "Idi na Realtime E-mail Nalog", + "TEXT": "Tekst", + "TIMES": "Broj puta po interakciji", + "REPLY_TYPE": "Odgovori Vrsta", + "EDIT_AUTOREPLY": "Uredi Automatski Odgovor", + "AUTOREPLY": "Automatski Odgovor", + "SHOW_AUTOREPLY": "Pokaži Automatski Odgovor", + "SHOW_DETAILS": "Pokaži detalje", + "HIDE_DETAILS": "Sakrij detalje", + "TO": "Za", + "FROM": "Od", + "DATE": "Datum", + "CC": "CC", + "REPLY": "Odgovori", + "REPLY_ALL": "Odgovori Svima", + "FORWARD": "Naprijed", + "SUBJECT": "Predmet", + "BCC": "BCC", + "SEND": "Pošalji", + "ATTACHMENT": "Prilog", + "ATTACHMENTS": "Prilozi", + "NAME": "Ime", + "MAILQUEUES": "E-mail Queues", + "SEARCH_FOR_ANYONE": "Traži", + "STRATEGY": "Strategija", + "MANDATORYDISPOSITION": "Obavezna dispozicija", + "MANDATORYDISPOSITIONPAUSEID": "Zadana pauza ako je obavezna dispozicija omogućena", "ERRORS": { - "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "QUEUETRANSFERTIMEOUT_REQUIRED": "Mandatory Field", - "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "AGENTTRANSFERTIMEOUT_REQUIRED": "Mandatory Field", - "TAG_REQUIRED": "Mandatory Field", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Mandatory Field", - "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "NAME_MUST_VALID_PATTERN": "Wrong format", - "COMMAND_REQUIRED": "Mandatory Field", - "FONT_SIZE_REQUIRED": "Mandatory Field", - "FONT_SIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "FONT_SIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "TEXT_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "VALUE_REQUIRED": "Mandatory Field", - "TEXT_REQUIRED": "Mandatory Field", - "REPLY_TYPE_REQUIRED": "Mandatory Field", - "NAME_REQUIRED": "Mandatory Field", - "AGENT_TIMEOUT_REQUIRED": "Mandatory Field", - "EMAIL_ADDRESS_REQUIRED": "Mandatory Field", - "EMAIL_ADDRESS_MUST_VALID": "Wrong format", - "HOST_REQUIRED": "Mandatory Field", - "USERNAME_REQUIRED": "Mandatory Field", - "PORT_REQUIRED": "Mandatory Field", - "CONNTIMEOUT_REQUIRED": "Mandatory Field", - "AUTHTIMEOUT_REQUIRED": "Mandatory Field", - "ACCEPTURL_MUST_VALID_URL": "Wrong format", - "TIMEOUT_REQUIRED": "Mandatory Field", - "REJECTURL_MUST_VALID_URL": "Wrong format", - "CLOSEURL_MUST_VALID_URL": "Wrong format", - "AGENT_REQUIRED": "Mandatory Field", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "DISPOSITION_REQUIRED": "Mandatory Field", - "CONDITION_REQUIRED": "Mandatory Field", - "TRUEPRIORITY_REQUIRED": "Mandatory Field", - "FALSEPRIORITY_REQUIRED": "Mandatory Field", - "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "PRIORITY_REQUIRED": "Mandatory Field", - "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "QUEUE_REQUIRED": "Mandatory Field", - "LIST_REQUIRED": "Mandatory Field", - "PASSWORD_REQUIRED": "Mandatory Field", - "SERVICE_REQUIRED": "Mandatory Field", - "IMAP_HOST_REQUIRED": "Mandatory Field", - "IMAP_PORT_REQUIRED": "Mandatory Field", - "SMTP_HOST_REQUIRED": "Mandatory Field", - "SMTP_PORT_REQUIRED": "Mandatory Field", - "CONFIRM_NOT_MATCH": "The passwords inserted don't match", - "KEY_MAX_LENGTH": "Key must have a maximum length equal to {{max}}", - "KEY_REQUIRED": "Mandatory Field", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Mandatory field", - "FIELD_REQUIRED": "Mandatory field" + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja od ili jednaka", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Obavezno polje", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja od ili jednaka", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Obavezno polje", + "TAG_REQUIRED": "Obavezno polje", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja od ili jednaka", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Obavezno polje", + "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja od ili jednaka", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja od ili jednaka", + "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "NAME_MUST_VALID_PATTERN": "Pogrešan format", + "COMMAND_REQUIRED": "Obavezno polje", + "FONT_SIZE_REQUIRED": "Obavezno polje", + "FONT_SIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "FONT_SIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja od ili jednaka", + "TEXT_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "VALUE_REQUIRED": "Obavezno polje", + "TEXT_REQUIRED": "Obavezno polje", + "REPLY_TYPE_REQUIRED": "Obavezno polje", + "NAME_REQUIRED": "Obavezno polje", + "AGENT_TIMEOUT_REQUIRED": "Obavezno polje", + "EMAIL_ADDRESS_REQUIRED": "Obavezno polje", + "EMAIL_ADDRESS_MUST_VALID": "Pogrešan format", + "HOST_REQUIRED": "Obavezno polje", + "USERNAME_REQUIRED": "Obavezno polje", + "PORT_REQUIRED": "Obavezno polje", + "CONNTIMEOUT_REQUIRED": "Obavezno polje", + "AUTHTIMEOUT_REQUIRED": "Obavezno polje", + "ACCEPTURL_MUST_VALID_URL": "Pogrešan format", + "TIMEOUT_REQUIRED": "Obavezno polje", + "REJECTURL_MUST_VALID_URL": "Pogrešan format", + "CLOSEURL_MUST_VALID_URL": "Pogrešan format", + "AGENT_REQUIRED": "Obavezno polje", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "DISPOSITION_REQUIRED": "Obavezno polje", + "CONDITION_REQUIRED": "Obavezno polje", + "TRUEPRIORITY_REQUIRED": "Obavezno polje", + "FALSEPRIORITY_REQUIRED": "Obavezno polje", + "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "PRIORITY_REQUIRED": "Obavezno polje", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka", + "QUEUE_REQUIRED": "Obavezno polje", + "LIST_REQUIRED": "Obavezno polje", + "PASSWORD_REQUIRED": "Obavezno polje", + "SERVICE_REQUIRED": "Obavezno polje", + "IMAP_HOST_REQUIRED": "Obavezno polje", + "IMAP_PORT_REQUIRED": "Obavezno polje", + "SMTP_HOST_REQUIRED": "Obavezno polje", + "SMTP_PORT_REQUIRED": "Obavezno polje", + "CONFIRM_NOT_MATCH": "Lozinke se ne podudaraju", + "KEY_MAX_LENGTH": "Ključ mora imati maksimalnu dužinu {{max}}", + "KEY_REQUIRED": "Obavezno polje", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Obavezno polje", + "FIELD_REQUIRED": "Obavezno polje" }, - "AGENT_TIMEOUT": "Agent Timeout", - "DESCRIPTION": "Description", - "ADD_MAILQUEUE": "Add Email Queue", - "EDIT_MAILQUEUE": "Edit Email Queue", - "DELETE_MAILQUEUE": "Delete Email Queue", - "SETTINGS": "Settings", - "GENERAL": "General", - "SAVE": "Save", - "MAILACCOUNTS": "Email Accounts", - "EMAIL_ADDRESS": "Email Address", - "ADD_MAILACCOUNT": "Add Email Account", - "EDIT_MAILACCOUNT": "Edit Email Account", - "DELETE_MAILACCOUNT": "Delete Email Account", - "DISPOSITIONS": "Dispositions", + "AGENT_TIMEOUT": "Timeout Specijaliste", + "DESCRIPTION": "Opis", + "ADD_MAILQUEUE": "Dodaj E-mail Queue", + "EDIT_MAILQUEUE": "Uredi E-mail Queue", + "DELETE_MAILQUEUE": "Izriši E-mail Queue", + "SETTINGS": "Postavke", + "GENERAL": "Općenito", + "SAVE": "Sačuvaj", + "MAILACCOUNTS": "E-mail Nalozi", + "EMAIL_ADDRESS": "E-mail Adresa", + "ADD_MAILACCOUNT": "Dodaj E-mail nalog", + "EDIT_MAILACCOUNT": "Uredi E-mail Nalog", + "DELETE_MAILACCOUNT": "Izbriši E-mail Nalog", + "DISPOSITIONS": "Dispozicije", "WEBHOOKS": "WebHooks", - "ACTIONS": "Actions", - "OTHERS": "Others", - "LIST": "List", - "TEMPLATE": "Template", - "FIDELITY": "Fidelity", - "SERVICE": "Service", - "CREATED_AT": "Created At", - "ACCEPT": "Accept", - "ACCEPTMETHOD": "Accept Method", - "ACCEPTURL": "Accept URL", - "REJECT": "Reject", - "REJECTMETHOD": "Reject Method", - "REJECTURL": "Reject URL", - "CLOSE": "Close", - "CLOSEMETHOD": "Close Method", - "CLOSEURL": "Close URL", + "ACTIONS": "Radnje", + "OTHERS": "Ostali", + "LIST": "Lista", + "TEMPLATE": "Šablon", + "FIDELITY": "Vjernost", + "SERVICE": "Servis", + "CREATED_AT": "Kreirano U", + "ACCEPT": "Prihvati", + "ACCEPTMETHOD": "Metoda Prihvaćanja", + "ACCEPTURL": "Prihvati URL", + "REJECT": "Odbaci", + "REJECTMETHOD": "Metoda Odbacivanja", + "REJECTURL": "Odbaci URL", + "CLOSE": "Zatvori", + "CLOSEMETHOD": "Metoda Zatvaranja", + "CLOSEURL": "Zatvori URL", "WHITELABEL": "White Label", - "SIGNATURE": "Signature", + "SIGNATURE": "Potpis", "IMAP": "IMAP", "HOST": "Host", - "USERNAME": "Username", + "USERNAME": "Korisnično ime", "PORT": "Port", - "MAILBOX": "Mailbox", + "MAILBOX": "Poštansko sanduče", "FILTER": "Filter", - "CONNTIMEOUT": "Connection Timeout [sec]", - "AUTHTIMEOUT": "Authentication Timeout [sec]", - "DELETE": "Delete Email From Server", + "CONNTIMEOUT": "Timeout Konekcije [sec]", + "AUTHTIMEOUT": "Timeout Autentifikacije [sec] ", + "DELETE": "Izbriši E-mail sa Servera", "SSL": "SSL", "KEEPALIVE": "Keepalive", - "POLLING": "Polling", + "POLLING": "Anketiranje", "SMTP": "SMTP", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "BACK": "Back", - "MAIL": "Email", - "ID": "Id", + "SELECTED": "Odabrano", + "SELECT_ALL": "Odaberi Sve", + "SELECT_NONE": "Odaberi Ništa", + "BACK": "Nazad", + "MAIL": "E-mail", + "ID": "ID", "TIMEOUT": "Timeout", - "PASSWORD": "Password", - "NO_MAILDISPOSITION_AVAILABLE": "No Email Dispositions available", - "ADD_MAILDISPOSITION": "Add Email Disposition", - "NEW_MAILDISPOSITION": "New Email Disposition", - "EDIT_MAILDISPOSITION": "Edit Email Disposition", - "DELETE_MAILDISPOSITION": "Delete Email Disposition", - "MAILDISPOSITIONS": "Email Dispositions", - "NEW_MAILQUEUE": "New Email Queue", - "NEW_MAILACCOUNT": "New Email Account", - "NO_AVAILABLE_INFO": "No availables info", - "ALL_TEAMS": "All Teams", - "SELECTED_TEAMS": "Selected Teams", + "PASSWORD": "Lozinka", + "NO_MAILDISPOSITION_AVAILABLE": "Nema dostupnih E-mail Dispozicija", + "ADD_MAILDISPOSITION": "Dodaj E-mail Dispoziciju", + "NEW_MAILDISPOSITION": "Nova E-mail Dispozicija", + "EDIT_MAILDISPOSITION": "Uredi E-mail Dispoziciju", + "DELETE_MAILDISPOSITION": "Izbriši E-mail Dispoziciju", + "MAILDISPOSITIONS": "E-mail Dispozicije", + "NEW_MAILQUEUE": "Novi E-mail Queue", + "NEW_MAILACCOUNT": "Novi E-mail Nalog", + "NO_AVAILABLE_INFO": "Nema dostupnih informacija", + "ALL_TEAMS": "Svi Timovi", + "SELECTED_TEAMS": "Odabrani Timovi", "HELP": { - "FONT_FAMILY": "Default Font Family", - "FONT_SIZE": "Default Font Size", - "NAME": "Only numbers, letters and specific characters (._) are supported", - "USERNAME": "Username used for authentication", - "PASSWORD": "Password used for authentication", - "SECURE": "If true, the connection will use TLS when connecting to server", - "MANDATORYDISPOSITION": "Mandatory disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pause to use when mandatory disposition is enabled", - "MARK_AS_UNREAD": "Enable/Disable agent to mark as unread the last message of an interaction", - "CLOUD_PROVIDER": "Cloud Provider used for authentication" + "FONT_FAMILY": "Zadani Font", + "FONT_SIZE": "Zadana Veličina Fonta", + "NAME": "Podržani su samo brojevi, slova i specifični znakovi (._)", + "USERNAME": "Korisničko ime koje se koristi za autentifikaciju", + "PASSWORD": "Lozinka koja se koristi za autentifikaciju", + "SECURE": "Ako je tačno, konekcija će koristiti TLS prilikom povezivanja na server", + "MANDATORYDISPOSITION": "Obavezna dispozicija", + "MANDATORYDISPOSITIONPAUSEID": "Zadana pauza kada je Obavezna dispozicija omogućena", + "MARK_AS_UNREAD": "Omogući/Onemogući specijalistu da oznaži posljednju oruku interakcije kao nepročitanu", + "CLOUD_PROVIDER": "Cloud Provajder koji se koristi za autentifikaciju" }, - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", - "TEAMADD_MAILQUEUE": "Add Team to Email Queue", - "AGENTADD_MAILQUEUE": "Add Agent to Email Queue", - "ALL_AGENTS": "All Agents", - "SELECTED_AGENTS": "Selected Agents", - "AGENT": "Agent", - "EDIT_AGENT": "Edit Agent", - "EDIT_CLOSE": "Edit Close", - "DISPOSITION": "Disposition", + "PAGE": "Stranica", + "ROWSPERPAGE": "Redova po stranici", + "OF": "od", + "TEAMADD_MAILQUEUE": "Dodaj Tim na E-mail Queue", + "AGENTADD_MAILQUEUE": "Dodaj Specijalistu na E-mail Queue", + "ALL_AGENTS": "Svi Specijalisti", + "SELECTED_AGENTS": "Odabrani Specijalisti", + "AGENT": "Specijalist", + "EDIT_AGENT": "Uredi Specijalistu", + "EDIT_CLOSE": "Uredi Zatvaranje", + "DISPOSITION": "Dispozicija", "GOTOIF": "GotoIf", - "EDIT_GOTOIF": "Edit GotoIf", - "CONDITION": "Condition", - "TRUEPRIORITY": "True Priority", - "FALSEPRIORITY": "False Priority", + "EDIT_GOTOIF": "Uredi GotoIf", + "CONDITION": "Stanje", + "TRUEPRIORITY": "Pravi Prioritet", + "FALSEPRIORITY": "Pogrešan Prioritet", "GOTOP": "GotoP", - "EDIT_GOTOP": "Edit GotoP", - "PRIORITY": "Priority", + "EDIT_GOTOP": "Uredi GotoP", + "PRIORITY": "Prioritet", "NOOP": "Noop", - "EDIT_NOOP": "Edit Noop", - "VALUE": "Value", + "EDIT_NOOP": "Uredi Noop", + "VALUE": "Vrijednost", "QUEUE": "Queue", - "EDIT_QUEUE": "Edit Queue", - "INTERACTIONS": "Interactions", - "STARTEDAT": "Started At", - "LASTMESSAGE": "Last message", - "CONTACT": "Contact", - "CLOSEDAT": "Closed At", - "NOTES": "Notes", - "NO_INTERACTION_AVAILABLE": "No interactions available", - "ACTIVE": "Active", - "SECURE": "Secure", - "AUTHENTICATION": "Authentication", + "EDIT_QUEUE": "Uredi Queue", + "INTERACTIONS": "Interakcije", + "STARTEDAT": "Počelo U", + "LASTMESSAGE": "Zadnja poruka", + "CONTACT": "Kontakt", + "CLOSEDAT": "Zatvoreno U", + "NOTES": "Bilješke", + "NO_INTERACTION_AVAILABLE": "Nema dostupnih Interakcija", + "ACTIVE": "Aktivan", + "SECURE": "Sigurno", + "AUTHENTICATION": "Autentifikacija", "SMTP_HOST": "SMTP Host", "SMTP_PORT": "SMTP Port", "IMAP_HOST": "IMAP Host", "IMAP_PORT": "IMAP Port", - "CONFIRM_PASSWORD": "Confirm Password", - "SELECT_STATUS": "Select Status", - "OPENED": "Open", - "CLOSED": "Closed", - "ALL": "All", - "SELECT_ACCOUNT": "Select Account", + "CONFIRM_PASSWORD": "Potvrdi Lozinku", + "SELECT_STATUS": "Odaberi Status", + "OPENED": "Otvoreno", + "CLOSED": "Zatvoreno", + "ALL": "Svi", + "SELECT_ACCOUNT": "Odaberi Nalog", "STATUS": "Status", - "ACCOUNT": "Account", - "OPEN": "Open", - "KEY": "Key", - "SMTPSERVICE": "SMTP Service", - "UNKNOWN": "Unknown", - "UNREGISTERED": "Unregistered", - "UNAVAILABLE": "Unavailable", - "NOT_INUSE": "Not in use", - "REACHABLE": "Reachable", - "IN_USE": "In use", - "AGENTSADD_QUEUE": "Add agents to Email Queue", + "ACCOUNT": "Nalog", + "OPEN": "Otvori", + "KEY": "Ključ", + "SMTPSERVICE": "SMTP Servis", + "UNKNOWN": "Nepoznati", + "UNREGISTERED": "Neregistrovano", + "UNAVAILABLE": "Nedostupno", + "NOT_INUSE": "Nije u upotrebi", + "REACHABLE": "Dostupan", + "IN_USE": "U upotrebi", + "AGENTSADD_QUEUE": "Dodaj Specijaliste na E-mail Queue", "INFO": "Info", - "INTERACTIONS_MAILACCOUNT": "Go to Interactions", - "REFRESH_INTERACTIONS": "Refresh Interactions", - "DELETE_INTERACTION": "Delete Interaction", - "AGENTADD_MAILACCOUNT": "Add Agent to Email Account", - "TEAMS_ASSOCIATION": "Teams Association", - "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", - "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available", - "DOWNLOAD_WITH_ATTACHMENT": "Download with attachment", - "DOWNLOAD_WITHOUT_ATTACHMENT": "Download without attachment", - "MODERN_AUTHENTICATION": "Modern Authentication", - "CLOUD_PROVIDER": "Cloud Provider", - "CUSTOM": "Custom", - "CREDENTIALS": "Credentials", + "INTERACTIONS_MAILACCOUNT": "Idi na Interakcije", + "REFRESH_INTERACTIONS": "Osvježi Interakcije", + "DELETE_INTERACTION": "Izbriši Interakciju", + "AGENTADD_MAILACCOUNT": "Dodaj Specijalistu na E-mail Nalog", + "TEAMS_ASSOCIATION": "Asocijacija Timova", + "TOOLTIP_SCREENRECORDING_ON": "Snimanje ekrana je u toku", + "TOOLTIP_SCREENRECORDING_OFF": "Snimanje ekrana je dostupno", + "DOWNLOAD_WITH_ATTACHMENT": "Skini sa prilogom", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Skini bez priloga", + "MODERN_AUTHENTICATION": "Moderna Autentifikacija", + "CLOUD_PROVIDER": "Cloud Provajder", + "CUSTOM": "Prilagođeno", + "CREDENTIALS": "Akreditiv", "NOTIFICATIONS": { - "ACCOUNT_CREATED_SUCCESS_TITLE": "Account successfully created", - "ACCOUNT_SAVED_SUCCESS_TITLE": "Account successfully saved", - "ACCOUNT_DELETE_TITLE": "Are you sure want to delete the account?", - "ACCOUNT_DELETE_MESSAGE": "{{ name }} will be deleted", - "ACCOUNT_DELETED_SUCCESS_TITLE": "Account successfully deleted", - "ACCOUNT_SERVICE_DELETE": "You cannot delete a service account", - "ACCOUNTS_DELETE_TITLE": "Are you sure want to delete the selected accounts?", - "ACCOUNTS_DELETE_MESSAGE": "{{ total }} accounts will be deleted", - "ACCOUNTS_DELETED_SUCCESS_TITLE": "Accounts successfully deleted", - "SMTP_CONNECTION_SUCCESS_TITLE": "Successfully connected to the SMTP server", - "SMTP_CONNECTION_FAIL_TITLE": "Unable to connect to the SMTP server", - "UNKNOWN_SMTP_SERVER": "Unknown STMP server" + "ACCOUNT_CREATED_SUCCESS_TITLE": "Nalog je uspješno kreiran", + "ACCOUNT_SAVED_SUCCESS_TITLE": "Nalog uspješno sačuvan", + "ACCOUNT_DELETE_TITLE": "Jesi li siguran da želiš izbrisati nalog?", + "ACCOUNT_DELETE_MESSAGE": "{{ name }} će biti obrisan", + "ACCOUNT_DELETED_SUCCESS_TITLE": "Nalog je uspješno obrisan", + "ACCOUNT_SERVICE_DELETE": "Ne možete izbrisati servisni nalog", + "ACCOUNTS_DELETE_TITLE": "Jesi li siguran da želiš izbrisati odabrane naloge?", + "ACCOUNTS_DELETE_MESSAGE": "{{ total }} naloga će biti izbrisano", + "ACCOUNTS_DELETED_SUCCESS_TITLE": "Nalozi uspješno izbrisani", + "SMTP_CONNECTION_SUCCESS_TITLE": "Uspješno povezan na SMTP server", + "SMTP_CONNECTION_FAIL_TITLE": "Nije se moguće povezati na SMTP server", + "UNKNOWN_SMTP_SERVER": "Nepoznat SMTP server" } } } diff --git a/public/app/main/apps/mail/i18n/et.json b/public/app/main/apps/mail/i18n/et.json index 9c16790..a7ca5e8 100644 --- a/public/app/main/apps/mail/i18n/et.json +++ b/public/app/main/apps/mail/i18n/et.json @@ -326,6 +326,7 @@ "REPLY_TYPE": "Vastamise tüüp", "CLOUD_PROVIDER": "Pilvepakkuja", "CREDENTIALS": "Mandaat", - "CUSTOM": "Kohandatud" + "CUSTOM": "Kohandatud", + "MODERN_AUTHENTICATION": "Kaasaegne autentimine" } } diff --git a/public/app/main/apps/mail/i18n/is.json b/public/app/main/apps/mail/i18n/is.json new file mode 100644 index 0000000..22a7db6 --- /dev/null +++ b/public/app/main/apps/mail/i18n/is.json @@ -0,0 +1,346 @@ +{ + "MAIL": { + "ADVANCED": "Advanced", + "DOWNLOAD_WITH_ATTACHMENTS": "Download with attachments", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download without attachments", + "DOWNLOAD": "Download", + "LOGIN_TIME": "Login time", + "PAUSE_TIME": "Pause time", + "DOWNLOAD_INTERACTION": "Download", + "YOU_ARE_REGISTERED_AS_A": "You are registered as a", + "TRANSFER": "Transfer", + "QUEUETRANSFER": "Queue Transfer", + "QUEUETRANSFERTIMEOUT": "Queue Transfer Timeout", + "AGENTTRANSFER": "Agent Transfer", + "AGENTTRANSFERTIMEOUT": "Agent Transfer Timeout", + "TAG": "Tag", + "EDIT_TAG": "Edit Tag", + "WAITFORTHEASSIGNEDAGENT": "Wait for the assigned agent", + "NOTIFICATION": "Notification", + "NOTIFICATIONSOUND": "Sound", + "NOTIFICATIONSHAKE": "Shake", + "NOTIFICATIONTEMPLATE": "Template", + "SYSTEM": "System", + "EDIT_SYSTEM": "Edit System", + "COMMAND": "Command", + "VARIABLE": "Variable", + "SEND_AS": "Send as", + "NEW_MAILSUBSTATUS": "New Sub Status", + "ADD_MAILSUBSTATUS": "Add Sub Status", + "MAILSUBSTATUSES": "Email Sub Statuses", + "EDIT_MAILSUBSTATUS": "Edit", + "DELETE_MAILSUBSTATUS": "Delete", + "FONT_FAMILY": "Font Family", + "FONT_SIZE": "Font Size", + "MARK_AS_UNREAD": "Mark as unread", + "ACCEPTED": "Accepted", + "CANNEDANSWERS": "Canned Answers", + "MAILCANNEDANSWERS": "Canned Answers", + "NO_MAILCANNEDANSWER_AVAILABLE": "No Canned Answers Available", + "NEW_MAILCANNEDANSWER": "New Canned Answer", + "ADD_MAILCANNEDANSWER": "Add Canned Answer", + "EDIT_MAILCANNEDANSWER": "Edit Canned Answer", + "DELETE_MAILCANNEDANSWER": "Delete Canned Answer", + "SHOW_ORIGINAL_MESSAGE": "Show original message", + "PENDING": "Pending", + "SEND_AS_PENDING": "Send as Pending", + "SEND_AND_CLOSE": "Send and Close", + "CANNED_ANSWER_NOT_FOUND": "No Canned Answers were found", + "CANNED_ANSWER_SEARCH": "Enter a text to search a Canned Answer", + "SPYINTERACTION": "Spy", + "ADD_NOTE": "Add note", + "NOTE": "Note", + "TAGS": "Tags", + "NO_AGENT_ONLINE": "No Agent Online", + "GOTOREALTIME_MAILQUEUE": "Go To Realtime Mail Queue", + "PARTIALPAUSE": "Parital Pause", + "BUSY": "Busy", + "TIMER": "Timer", + "IDLE": "Idle", + "CAPACITY": "Capacity", + "UNPAUSE": "End Pause", + "DEFAULT_PAUSE": "Default pause", + "LOGOUT": "Logout", + "AGENTADD_QUEUE": "Add agent to Email queue", + "VOICE": "Voice", + "CHAT": "Chat", + "SMS": "Sms", + "OPENCHANNEL": "Open channel", + "FAX": "Fax", + "REALTIME": "Realtime", + "AGENTS": "Agents", + "QUEUES": "Queues", + "ACCOUNTS": "Accounts", + "FULLNAME": "Full Name", + "INTERNAL": "Internal", + "PHONE_STATE": "Phone State", + "PHONE_STATUS": "Phone Status", + "PAUSE": "Pause", + "LOGGED_IN": "Logged In", + "PAUSED": "Paused", + "READY": "Ready", + "WAITING": "Waiting", + "TOTAL": "Total", + "IN": "In", + "OUT": "Out", + "IMAP_STATUS": "IMAP Status", + "SMTP_STATUS": "SMTP Status", + "DISABLED": "Disabled", + "CONNECTED": "Connected", + "NEVER_VERIFIED": "Never Verified", + "ERROR": "Error", + "EDIT_ACCOUNT": "Edit Account", + "VERIFY_SMTP": "Verify SMTP", + "VERIFIED": "Verified", + "VERIFYSMTP_MAILACCOUNT": "Verify SMTP", + "GOTOREALTIME_MAILACCOUNT": "Go to Realtime Email Account", + "GOTO_MAILACCOUNT": "Go to Realtime Email Account", + "TEXT": "Text", + "TIMES": "Number of times per interaction", + "REPLY_TYPE": "Reply Type", + "EDIT_AUTOREPLY": "Edit Auto Reply", + "AUTOREPLY": "Auto Reply", + "SHOW_AUTOREPLY": "Show Auto Reply", + "SHOW_DETAILS": "Show details", + "HIDE_DETAILS": "Hide details", + "TO": "To", + "FROM": "From", + "DATE": "Date", + "CC": "Cc", + "REPLY": "Reply", + "REPLY_ALL": "Reply All", + "FORWARD": "Forward", + "SUBJECT": "Subject", + "BCC": "Bcc", + "SEND": "Send", + "ATTACHMENT": "Attachment", + "ATTACHMENTS": "Attachments", + "NAME": "Name", + "MAILQUEUES": "Email Queues", + "SEARCH_FOR_ANYONE": "Search", + "STRATEGY": "Strategy", + "MANDATORYDISPOSITION": "Mandatory disposition", + "MANDATORYDISPOSITIONPAUSEID": "Pause to use if mandatory disposition is enabled", + "ERRORS": { + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Mandatory Field", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Mandatory Field", + "TAG_REQUIRED": "Mandatory Field", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Mandatory Field", + "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "NAME_MUST_VALID_PATTERN": "Wrong format", + "COMMAND_REQUIRED": "Mandatory Field", + "FONT_SIZE_REQUIRED": "Mandatory Field", + "FONT_SIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "FONT_SIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "TEXT_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "VALUE_REQUIRED": "Mandatory Field", + "TEXT_REQUIRED": "Mandatory Field", + "REPLY_TYPE_REQUIRED": "Mandatory Field", + "NAME_REQUIRED": "Mandatory Field", + "AGENT_TIMEOUT_REQUIRED": "Mandatory Field", + "EMAIL_ADDRESS_REQUIRED": "Mandatory Field", + "EMAIL_ADDRESS_MUST_VALID": "Wrong format", + "HOST_REQUIRED": "Mandatory Field", + "USERNAME_REQUIRED": "Mandatory Field", + "PORT_REQUIRED": "Mandatory Field", + "CONNTIMEOUT_REQUIRED": "Mandatory Field", + "AUTHTIMEOUT_REQUIRED": "Mandatory Field", + "ACCEPTURL_MUST_VALID_URL": "Wrong format", + "TIMEOUT_REQUIRED": "Mandatory Field", + "REJECTURL_MUST_VALID_URL": "Wrong format", + "CLOSEURL_MUST_VALID_URL": "Wrong format", + "AGENT_REQUIRED": "Mandatory Field", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "DISPOSITION_REQUIRED": "Mandatory Field", + "CONDITION_REQUIRED": "Mandatory Field", + "TRUEPRIORITY_REQUIRED": "Mandatory Field", + "FALSEPRIORITY_REQUIRED": "Mandatory Field", + "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "PRIORITY_REQUIRED": "Mandatory Field", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "QUEUE_REQUIRED": "Mandatory Field", + "LIST_REQUIRED": "Mandatory Field", + "PASSWORD_REQUIRED": "Mandatory Field", + "SERVICE_REQUIRED": "Mandatory Field", + "IMAP_HOST_REQUIRED": "Mandatory Field", + "IMAP_PORT_REQUIRED": "Mandatory Field", + "SMTP_HOST_REQUIRED": "Mandatory Field", + "SMTP_PORT_REQUIRED": "Mandatory Field", + "CONFIRM_NOT_MATCH": "The passwords inserted don't match", + "KEY_MAX_LENGTH": "Key must have a maximum length equal to {{max}}", + "KEY_REQUIRED": "Mandatory Field", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Mandatory field", + "FIELD_REQUIRED": "Mandatory field" + }, + "AGENT_TIMEOUT": "Agent Timeout", + "DESCRIPTION": "Description", + "ADD_MAILQUEUE": "Add Email Queue", + "EDIT_MAILQUEUE": "Edit Email Queue", + "DELETE_MAILQUEUE": "Delete Email Queue", + "SETTINGS": "Settings", + "GENERAL": "General", + "SAVE": "Save", + "MAILACCOUNTS": "Email Accounts", + "EMAIL_ADDRESS": "Email Address", + "ADD_MAILACCOUNT": "Add Email Account", + "EDIT_MAILACCOUNT": "Edit Email Account", + "DELETE_MAILACCOUNT": "Delete Email Account", + "DISPOSITIONS": "Dispositions", + "WEBHOOKS": "WebHooks", + "ACTIONS": "Actions", + "OTHERS": "Others", + "LIST": "List", + "TEMPLATE": "Template", + "FIDELITY": "Fidelity", + "SERVICE": "Service", + "CREATED_AT": "Created At", + "ACCEPT": "Accept", + "ACCEPTMETHOD": "Accept Method", + "ACCEPTURL": "Accept URL", + "REJECT": "Reject", + "REJECTMETHOD": "Reject Method", + "REJECTURL": "Reject URL", + "CLOSE": "Close", + "CLOSEMETHOD": "Close Method", + "CLOSEURL": "Close URL", + "WHITELABEL": "White Label", + "SIGNATURE": "Signature", + "IMAP": "IMAP", + "HOST": "Host", + "USERNAME": "Username", + "PORT": "Port", + "MAILBOX": "Mailbox", + "FILTER": "Filter", + "CONNTIMEOUT": "Connection Timeout [sec]", + "AUTHTIMEOUT": "Authentication Timeout [sec]", + "DELETE": "Delete Email From Server", + "SSL": "SSL", + "KEEPALIVE": "Keepalive", + "POLLING": "Polling", + "SMTP": "SMTP", + "SELECTED": "Selected", + "SELECT_ALL": "Select All", + "SELECT_NONE": "Select None", + "BACK": "Back", + "MAIL": "Email", + "ID": "Id", + "TIMEOUT": "Timeout", + "PASSWORD": "Password", + "NO_MAILDISPOSITION_AVAILABLE": "No Email Dispositions available", + "ADD_MAILDISPOSITION": "Add Email Disposition", + "NEW_MAILDISPOSITION": "New Email Disposition", + "EDIT_MAILDISPOSITION": "Edit Email Disposition", + "DELETE_MAILDISPOSITION": "Delete Email Disposition", + "MAILDISPOSITIONS": "Email Dispositions", + "NEW_MAILQUEUE": "New Email Queue", + "NEW_MAILACCOUNT": "New Email Account", + "NO_AVAILABLE_INFO": "No availables info", + "ALL_TEAMS": "All Teams", + "SELECTED_TEAMS": "Selected Teams", + "HELP": { + "FONT_FAMILY": "Default Font Family", + "FONT_SIZE": "Default Font Size", + "NAME": "Only numbers, letters and specific characters (._) are supported", + "USERNAME": "Username used for authentication", + "PASSWORD": "Password used for authentication", + "SECURE": "If true, the connection will use TLS when connecting to server", + "MANDATORYDISPOSITION": "Mandatory disposition", + "MANDATORYDISPOSITIONPAUSEID": "Pause to use when mandatory disposition is enabled", + "MARK_AS_UNREAD": "Enable/Disable agent to mark as unread the last message of an interaction", + "CLOUD_PROVIDER": "Cloud Provider used for authentication" + }, + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "OF": "of", + "TEAMADD_MAILQUEUE": "Add Team to Email Queue", + "AGENTADD_MAILQUEUE": "Add Agent to Email Queue", + "ALL_AGENTS": "All Agents", + "SELECTED_AGENTS": "Selected Agents", + "AGENT": "Agent", + "EDIT_AGENT": "Edit Agent", + "EDIT_CLOSE": "Edit Close", + "DISPOSITION": "Disposition", + "GOTOIF": "GotoIf", + "EDIT_GOTOIF": "Edit GotoIf", + "CONDITION": "Condition", + "TRUEPRIORITY": "True Priority", + "FALSEPRIORITY": "False Priority", + "GOTOP": "GotoP", + "EDIT_GOTOP": "Edit GotoP", + "PRIORITY": "Priority", + "NOOP": "Noop", + "EDIT_NOOP": "Edit Noop", + "VALUE": "Value", + "QUEUE": "Queue", + "EDIT_QUEUE": "Edit Queue", + "INTERACTIONS": "Interactions", + "STARTEDAT": "Started At", + "LASTMESSAGE": "Last message", + "CONTACT": "Contact", + "CLOSEDAT": "Closed At", + "NOTES": "Notes", + "NO_INTERACTION_AVAILABLE": "No interactions available", + "ACTIVE": "Active", + "SECURE": "Secure", + "AUTHENTICATION": "Authentication", + "SMTP_HOST": "SMTP Host", + "SMTP_PORT": "SMTP Port", + "IMAP_HOST": "IMAP Host", + "IMAP_PORT": "IMAP Port", + "CONFIRM_PASSWORD": "Confirm Password", + "SELECT_STATUS": "Select Status", + "OPENED": "Open", + "CLOSED": "Closed", + "ALL": "All", + "SELECT_ACCOUNT": "Select Account", + "STATUS": "Status", + "ACCOUNT": "Account", + "OPEN": "Open", + "KEY": "Key", + "SMTPSERVICE": "SMTP Service", + "UNKNOWN": "Unknown", + "UNREGISTERED": "Unregistered", + "UNAVAILABLE": "Unavailable", + "NOT_INUSE": "Not in use", + "REACHABLE": "Reachable", + "IN_USE": "In use", + "AGENTSADD_QUEUE": "Add agents to Email Queue", + "INFO": "Info", + "INTERACTIONS_MAILACCOUNT": "Go to Interactions", + "REFRESH_INTERACTIONS": "Refresh Interactions", + "DELETE_INTERACTION": "Delete Interaction", + "AGENTADD_MAILACCOUNT": "Add Agent to Email Account", + "TEAMS_ASSOCIATION": "Teams Association", + "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", + "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available", + "DOWNLOAD_WITH_ATTACHMENT": "Download with attachment", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Download without attachment", + "MODERN_AUTHENTICATION": "Modern Authentication", + "CLOUD_PROVIDER": "Cloud Provider", + "CUSTOM": "Custom", + "CREDENTIALS": "Credentials", + "NOTIFICATIONS": { + "ACCOUNT_CREATED_SUCCESS_TITLE": "Account successfully created", + "ACCOUNT_SAVED_SUCCESS_TITLE": "Account successfully saved", + "ACCOUNT_DELETE_TITLE": "Are you sure want to delete the account?", + "ACCOUNT_DELETE_MESSAGE": "{{ name }} will be deleted", + "ACCOUNT_DELETED_SUCCESS_TITLE": "Account successfully deleted", + "ACCOUNT_SERVICE_DELETE": "You cannot delete a service account", + "ACCOUNTS_DELETE_TITLE": "Are you sure want to delete the selected accounts?", + "ACCOUNTS_DELETE_MESSAGE": "{{ total }} accounts will be deleted", + "ACCOUNTS_DELETED_SUCCESS_TITLE": "Accounts successfully deleted", + "SMTP_CONNECTION_SUCCESS_TITLE": "Successfully connected to the SMTP server", + "SMTP_CONNECTION_FAIL_TITLE": "Unable to connect to the SMTP server", + "UNKNOWN_SMTP_SERVER": "Unknown STMP server" + } + } +} diff --git a/public/app/main/apps/marketplace/i18n/is.json b/public/app/main/apps/marketplace/i18n/is.json new file mode 100644 index 0000000..e80fbe2 --- /dev/null +++ b/public/app/main/apps/marketplace/i18n/is.json @@ -0,0 +1,51 @@ +{ + "MARKETPLACE": { + "MARKETPLACE": "App Zone", + "PLUGINS": "Plugins", + "BACK": "Back", + "SEARCH_FOR_ANYONE": "Search", + "SELECTED": "Selected", + "SELECT_ALL": "Select all", + "SELECT_NONE": "Select none", + "NAME": "Name", + "DESCRIPTION": "Description", + "ACTIVE": "Active", + "TYPE": "Type", + "ICON": "Icon", + "ADMINURL": "Admin url", + "AGENTURL": "Agent url", + "SCRIPTNAME": "Script name", + "SCRIPTPATH": "Script path", + "SIDEBAR": "Sidebar", + "VERSION": "Version", + "NO_AVAILABLE_INFO": "No available info", + "MORE": "More", + "INSTALL_PLUGIN": "Install plugin", + "EDIT_PLUGIN": "Edit plugin", + "STOP_PLUGIN": "Stop plugin", + "RESTART_PLUGIN": "Restart plugin", + "DOWNLOAD_PLUGIN": "Download plugin", + "UNINSTALL_PLUGIN": "Uninstall plugin", + "DELETE_PLUGIN": "Remove plugin", + "CANCEL": "Cancel", + "FINISH": "Finish", + "DELETE": "Delete", + "SAVE": "Save", + "INSTALLING": "Installing", + "DROP_TO_UPLOAD": "Drop To Upload", + "DROP_TO_UPLOAD_MESSAGE": "Drop your file here to upload. Only ZIP - Max. 2MB", + "UPLOAD_PLUGIN": "Upload plugin", + "UPLOADING": "Uploading", + "CREATED_AT": "Created at", + "GENERAL": "General", + "SETTINGS": "Settings", + "EDITOR": "Editor", + "ERRORS": { + "URL_REQUIRED": "Mandatory field" + }, + "HELP": {}, + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "OF": "of" + } +} diff --git a/public/app/main/apps/motiondialer/i18n/bs.json b/public/app/main/apps/motiondialer/i18n/bs.json index 6b63309..62d9acb 100644 --- a/public/app/main/apps/motiondialer/i18n/bs.json +++ b/public/app/main/apps/motiondialer/i18n/bs.json @@ -1,701 +1,701 @@ { "MOTIONDIALER": { - "SECOND_LEVEL_DISPOSITION": "Second Level Disposition", - "THIRD_LEVEL_DISPOSITION": "Third Level Disposition", - "ONE_CALL_EVERY": "One call every", - "CURRENT_INTERVAL": "Current Interval", - "PREVIOUS_INTERVAL": "Previous Interval", - "PREDICTIVE_IS_RUNNING": "Predictive is running", - "PREDICTIVE_IS_NOT_RUNNING": "Predictive is not running", - "DATA_COLLECTION_IN_PROGRESSIVE": "Data collection in Progressive", - "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "Show Predictive Info", - "AVG_TALK_TIME": "Avg Talk Time", - "ANSWERED_CALLS": "Answered Calls", - "TOTAL_CALLS": "Total Calls", - "THRESHOLDS": "Thresholds", - "PREDICTIVEMAXTHRESHOLD": "Predictive Max Threshold [%]", - "PREDICTIVEMINTHRESHOLD": "Predictive Min Threshold [%]", - "REFRESH_SCHEDULED_CALLS": "Refresh Scheduled Calls", - "RECALLINQUEUE": "Recall in queue", - "SELECT_DATE": "Select Date", - "SELECT_TYPE": "Select Type", - "SELECT_CAMPAIGN": "Select Campaign", - "SCHEDULED_CALLS": "Scheduled Calls", - "LOGIN_TIME": "Login time", - "PAUSE_TIME": "Pause time", - "PREVIEW_RECALL_ME_REMINDER": "Recall Me Reminder", - "CUTDIGIT": "Cut Digits", - "RANDOMLASTDIGITCALLERIDNUMBER": "Random Outgoing CallerId Number", - "CLONE_IVRCAMPAIGN": "Clone Campaign", - "CLONE_QUEUECAMPAIGN": "Clone Queue Campaign", - "ABANDONEDCALLS": "Abandoned Queue Calls", - "HOPPERWIDGET": "Summary", - "RESETLIST_IVRCAMPAIGN": "Reset Lists", - "RESETLIST_QUEUECAMPAIGN": "Reset Lists", - "RESET": "Reset", - "RESETLIST": "Reset Lists", - "SELECTALL": "Select All", - "UNSELECTALL": "Un-Select All", - "NO_AVAILABLE_INFO": "No available info", + "SECOND_LEVEL_DISPOSITION": "Drugi Nivo Dispozicija", + "THIRD_LEVEL_DISPOSITION": "Treći Nivo Dispozicija", + "ONE_CALL_EVERY": "Jedan poziv svako", + "CURRENT_INTERVAL": "Trenutni Interval", + "PREVIOUS_INTERVAL": "Prethodni Interval", + "PREDICTIVE_IS_RUNNING": "Preditkivni radi", + "PREDICTIVE_IS_NOT_RUNNING": "Prediktivni ne radi ", + "DATA_COLLECTION_IN_PROGRESSIVE": "Prikupljanje podataka u Progressive", + "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "Pokaži Prediktivne Informacije", + "AVG_TALK_TIME": "Prosječno Vrijeme Razgovora", + "ANSWERED_CALLS": "Odgovoreni Pozivi", + "TOTAL_CALLS": "Ukupno Poziva", + "THRESHOLDS": "Pragovi", + "PREDICTIVEMAXTHRESHOLD": "Prediktivni Maks Prag [%]", + "PREDICTIVEMINTHRESHOLD": "Prediktivni Maks Prag [%]", + "REFRESH_SCHEDULED_CALLS": "Osvježi Zakazane Pozive", + "RECALLINQUEUE": "Recall u queue", + "SELECT_DATE": "Odaberi Datum", + "SELECT_TYPE": "Odaberi Vrstu", + "SELECT_CAMPAIGN": "Odaberi Kampanju", + "SCHEDULED_CALLS": "Zakazani Pozivi", + "LOGIN_TIME": "Vrijeme prijave", + "PAUSE_TIME": "Vrijeme pauze", + "PREVIEW_RECALL_ME_REMINDER": "Recall Me Podsjetnik", + "CUTDIGIT": "Izreži Cifre", + "RANDOMLASTDIGITCALLERIDNUMBER": "Nasumičan Odlazni Pozivatelj ID Broj", + "CLONE_IVRCAMPAIGN": "Kloniraj Kampanju", + "CLONE_QUEUECAMPAIGN": "Kloniraj Queue Kampanju", + "ABANDONEDCALLS": "Napušteni Queue Pozivi", + "HOPPERWIDGET": "Sažetak", + "RESETLIST_IVRCAMPAIGN": "Resetuj Liste", + "RESETLIST_QUEUECAMPAIGN": "Resetuj Liste", + "RESET": "Resetuj", + "RESETLIST": "Resetuj Liste", + "SELECTALL": "Odaberi Sve", + "UNSELECTALL": "Poništi Odabri Svih", + "NO_AVAILABLE_INFO": "Nema dostupnih informacija", "TIMEOUT": "Timeout", - "CALLYSQUAREPROJECTPREVIEW": "Cally Square Project Preview", - "CALLYSQUAREPROJECTPREVIEW2": "Cally Square Project After Preview", - "RUNIFHANGUPAGENT": "Run Cally Square Project After even if the agent hangs up the call", - "CALLYSQUAREPROJECT2": "Cally Square Project After Queue", - "NO_AGENT_ONLINE": "No Agent Online", - "PARTIALPAUSE": "Parital Pause", - "ALL": "All", + "CALLYSQUAREPROJECTPREVIEW": "Cally Square Projekat Pregled", + "CALLYSQUAREPROJECTPREVIEW2": "Cally Square Projekat Nakon Pregleda", + "RUNIFHANGUPAGENT": "Pokreni Cally Square Projekat Nakon čak i ako Specijalista prekine poziv", + "CALLYSQUAREPROJECT2": "Cally Square Projekat Nakon Queue", + "NO_AGENT_ONLINE": "Nema Specijalista Online", + "PARTIALPAUSE": "Djelimična Pauza", + "ALL": "Svi", "IDLE": "Idle", "TIMER": "Timer", - "MOVE_HOPPERFINAL": "Restore contact", - "RESTORECONTACTS": "Restore Contacts", - "NO_SUCH_NUMBER": "No Such Number", - "ANSWERING_MACHINE": "Answering machine", - "DIALORDERBYSCHEDULEDAT": "Order By scheduledat", + "MOVE_HOPPERFINAL": "Povrati kontakt", + "RESTORECONTACTS": "Vrati Kontakte", + "NO_SUCH_NUMBER": "Nepostojeći broj", + "ANSWERING_MACHINE": "Telefonska sekretarica", + "DIALORDERBYSCHEDULEDAT": "Poredak Po Zakazan U", "ASC": "ASC", "DESC": "DESC", - "RECALLAGENT": "Recall Agent", - "DIALRECALLINQUEUE": "Recall In Queue", + "RECALLAGENT": "Recall Specijalistu", + "DIALRECALLINQUEUE": "Recall u Queue", "DIALRECALLMETIMEOUT": "Recall Me Timeout [min]", "RECALLME": "Recall Me", - "RECALLFAILEDTIMEOUT": "Recall Failed", - "PREVIEW_CAMPAIGN": "Preview Campaigns", - "PREVIEW_CAMPAIGNS": "Preview Campaigns", + "RECALLFAILEDTIMEOUT": "Recall Neuspješno", + "PREVIEW_CAMPAIGN": "Pregled Kampanja", + "PREVIEW_CAMPAIGNS": "Pregled Kampanja", "AMD": "Asterisk Answering Machine Detection (AMD)", - "AMDTOTALANALYSISTIME": "Total Analysis Time", + "AMDTOTALANALYSISTIME": "Ukupno Vrijeme Analize", "AMDACTIVE": "AMD", - "AMDINITIALSILENCE": "Initial Silence", - "AMDGREETING": "Greeting", - "AMDAFTERGREETINGSILENCE": "Silence after Greeting", - "AMDSILENCETHRESHOLD": "Silence Threshold", - "AMDMINWORDLENGTH": "Min Word Length", - "AMDBETWEENWORDSSILENCE": "Silence Between Words", - "AMDMAXIMUMWORDLENGTH": "Maximum Word Length", - "AMDMAXIMUMNUMBEROFWORDS": "Maximum Number Of Words", - "GOTO_QUEUECAMPAIGN": "Go To Realtime Queue Campaigns", - "GOTOREALTIME_QUEUECAMPAIGN": "Go To Realtime Queue Campaigns", - "GOTO_IVRCAMPAIGN": "Go To Realtime IVR Campaigns", - "GOTOREALTIME_IVRCAMPAIGN": "Go To Realtime IVR Campaigns", - "LOGOUT": "Logout", - "EDIT_CAMPAIGN": "Edit Campaign", - "LIMITED": "Limited", - "IVR_CAMPAIGNS": "IVR Campaigns", + "AMDINITIALSILENCE": "Početna Tišina", + "AMDGREETING": "Pozdrav", + "AMDAFTERGREETINGSILENCE": "Tišina nakon Pozdrava", + "AMDSILENCETHRESHOLD": "Prag Tišine", + "AMDMINWORDLENGTH": "Minimalna Dužina Riječi", + "AMDBETWEENWORDSSILENCE": "Tišina Između Riječi", + "AMDMAXIMUMWORDLENGTH": "Maksimalna Dužina Riječi", + "AMDMAXIMUMNUMBEROFWORDS": "Maksimalan Broj Riječi", + "GOTO_QUEUECAMPAIGN": "Idi Na Realtime Queue Kampanje", + "GOTOREALTIME_QUEUECAMPAIGN": "Idi Na Realtime Queue Kampanje", + "GOTO_IVRCAMPAIGN": "Idi Na Realtime IVR Kampanje", + "GOTOREALTIME_IVRCAMPAIGN": "Idi Na Realtime IVR Kampanje", + "LOGOUT": "Odjava", + "EDIT_CAMPAIGN": "Uredi Kampanju", + "LIMITED": "Ograničeno", + "IVR_CAMPAIGNS": "IVR Kampanje", "MOTIONDIALER": "Motion Bull", - "QUEUECAMPAIGNS": "Queue Campaigns", - "IVRCAMPAIGNS": "IVR Campaigns", - "MANAGED": "Managed", - "AVAILABLE_CONTACTS_FINISHED": "Available contacts finished", - "HISTORY": "History", - "SCHEDULEDAT": "Scheduled At", + "QUEUECAMPAIGNS": "Queue Kampanje", + "IVRCAMPAIGNS": "IVR Kampanje", + "MANAGED": "Upravljano", + "AVAILABLE_CONTACTS_FINISHED": "Dostupni kontakti gotovi", + "HISTORY": "Historija", + "SCHEDULEDAT": "Zakazano U", "HOPPERBLACKS": "Hopper Blacklist", - "NO_HOPPERBLACK_AVAILABLE": "No items available", + "NO_HOPPERBLACK_AVAILABLE": "Nema dostupnih stavki", "HOPPERFINALS": "Hopper Final", - "NO_HOPPERFINAL_AVAILABLE": "No items available", - "HOPPERHISTORIES": "Call history", - "NO_HOPPERHISTORY_AVAILABLE": "No items available", - "DELETE_HOPPERHISTORY": "Delete", - "DELETE_HOPPERFINAL": "Delete", - "CONTACTID": "Contact ID", - "STARTTIME": "Start Time", - "RESPONSETIME": "Response Time", - "ENDTIME": "End Time", + "NO_HOPPERFINAL_AVAILABLE": "Nema dostupnih stavki", + "HOPPERHISTORIES": "Historija Poziva", + "NO_HOPPERHISTORY_AVAILABLE": "Nema dostupnih stavki", + "DELETE_HOPPERHISTORY": "Izbriši", + "DELETE_HOPPERFINAL": "Izbriši", + "CONTACTID": "Kontakt ID", + "STARTTIME": "Vrijeme Početka", + "RESPONSETIME": "Vrijeme Odgovora", + "ENDTIME": "Završetak Vrijeme", "STATUS": "Status", "HOPPERS": "Hopper", - "NO_HOPPER_AVAILABLE": "No items available", - "EDIT_HOPPER": "Edit Hopper", - "DELETE_HOPPER": "Delete Hopper", - "FINAL": "Final", - "BLACKLIST": "Blacklist", - "NAME": "Name", + "NO_HOPPER_AVAILABLE": "Nema dostupnih stavki", + "EDIT_HOPPER": "Uredi Hopper", + "DELETE_HOPPER": "Izbriši Hopper", + "FINAL": "Finalan", + "BLACKLIST": "Crna Lista", + "NAME": "Naziv", "VOICEQUEUES": "Voice Queues", - "SEARCH_FOR_ANYONE": "Search", - "BACK": "Back", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "DELETE_VOICEDISPOSITION": "Delete Voice Disposition", - "EDIT_VOICEDISPOSITION": "Edit Voice Disposition", - "EDIT_VOICEQUEUE": "Edit Voice Queue", - "DELETE_VOICEQUEUE": "Delete Voice Queue", - "MOHSOUNDS": "Moh Sounds", - "STRATEGY": "Strategy", - "DESCRIPTION": "Description", - "INTERVAL": "Time Interval", - "ADD_VOICEQUEUE": "Add Voice Queue", - "NEW_QUEUECAMPAIGN": "New Queue Campaign", - "ACTIVE": "Active", - "METHOD": "Method", - "POWERLEVEL": "Power Level", - "DROPRATE": "Drop Rate", - "AGENTBUSYFACTOR": "Agent Busy Factor", - "PREDICTIVEOPTIMIZATION": "Predictive Optimization", - "PREDICTIVEOPTIMIZATIONPERCENTAGE": "Predictive Optimization Percentage", - "PREDICTIVEINTERVAL": "Predictive Interval", - "ADD_QUEUECAMPAIGN": "Add Queue Campaign", - "CAMPAIGN": "Campaign", - "MAXCONCURRENTCALLS": "Max Concurrent Calls", - "CONCURRENTCALLS": "Max Concurrent Calls", - "ORIGINATE": "Originate", - "ORIGINATECALLERIDNAME": "Caller ID Name", - "ORIGINATECALLERIDNUMBER": "Caller ID Number", - "ORIGINATETIMEOUT": "Originate Timeout", - "QUEUEOPTIONS": "Queue Options", + "SEARCH_FOR_ANYONE": "Traži", + "BACK": "Nazad", + "SELECTED": "Odabrano", + "SELECT_ALL": "Odaberi Sve", + "SELECT_NONE": "Odaberi Ništa", + "DELETE_VOICEDISPOSITION": "Izbriši Voice Dispoziciju", + "EDIT_VOICEDISPOSITION": "Uredi Voice Dispoziciju", + "EDIT_VOICEQUEUE": "Uredi Voice Queue", + "DELETE_VOICEQUEUE": "Izbriši Voice Queue", + "MOHSOUNDS": "MNČ Zvukovi", + "STRATEGY": "Strategija", + "DESCRIPTION": "Opis", + "INTERVAL": "Vremenski Interval", + "ADD_VOICEQUEUE": "Dodaj Voice Queue", + "NEW_QUEUECAMPAIGN": "Nova Queue Kampanja", + "ACTIVE": "Aktivno", + "METHOD": "Metoda", + "POWERLEVEL": "Nivo Snage", + "DROPRATE": "Stopa Ispuštenih", + "AGENTBUSYFACTOR": "Specijalist Zauzetost Faktor", + "PREDICTIVEOPTIMIZATION": "Prediktivna Optimizacija", + "PREDICTIVEOPTIMIZATIONPERCENTAGE": "Preditkivni Procenat Optimizacije", + "PREDICTIVEINTERVAL": "Interval Predviđanja", + "ADD_QUEUECAMPAIGN": "Dodaj Queue Kampanju", + "CAMPAIGN": "Kampanja", + "MAXCONCURRENTCALLS": "Maks Istovremenih Poziva", + "CONCURRENTCALLS": "Maksimalno Istovremenih Poziva", + "ORIGINATE": "Porijeklo", + "ORIGINATECALLERIDNAME": "Pozivatelj ID Naziv", + "ORIGINATECALLERIDNUMBER": "Pozivatelj ID Broj", + "ORIGINATETIMEOUT": "Porijeklo Timeout", + "QUEUEOPTIONS": "Queue Opcije", "QUEUETIMEOUT": "Queue Timeout", - "CALLYSQUAREPROJECT": "Cally Square Project", - "RETRYANDFREQUENCY": "Retry Settings", - "GLOBAL": "Global", - "GLOBALMAXRETRY": "Max Retries", - "CONGESTION": "Congestion", - "CONGESTIONMAXRETRY": "Max Retries", - "CONGESTIONRETRYTIME": "Retry Time [min]", - "BUSYMAXRETRY": "Max Retries", - "BUSYRETRYTIME": "Retry Time [min]", - "NOANSWER": "No Answer", - "NOANSWERMAXRETRY": "Max Retries", - "NOANSWERRETRYTIME": "Retry Time [min]", - "NOSUCHNUMBER": "No such number", - "NOSUCHNUMBERMAXRETRY": "Max Retries", - "NOSUCHNUMBERRETRYTIME": "Retry Time [min]", - "DROP": "Drop", - "DROPMAXRETRY": "Max Retries", - "DROPRETRYTIME": "Retry Time [min]", - "ABANDONEDMAXRETRY": "Max Retries", - "ABANDONEDRETRYTIME": "Retry Time [min]", - "MACHINE": "Machine", - "MACHINEMAXRETRY": "Max Retries", - "MACHINERETRYTIME": "Retry Time [min]", - "AGENTREJECT": "Agent Reject", - "AGENTREJECTMAXRETRY": "Max Retries", - "AGENTREJECTRETRYTIME": "Retry Time [min]", - "CALLADDITIONALPHONEAFTERMIN": "Call additional phone after [min]", - "ADDITIONALPHONES": "Additional phones", - "QUEUE_PARAMS": "Queue Parameters", - "ORIGINATED": "Originated", - "MESSAGE": "Message", - "DROPPED": "Dropped", - "CREATED_AT": "Created At", + "CALLYSQUAREPROJECT": "Cally Square Projekat", + "RETRYANDFREQUENCY": "Postavke Ponovljenog Pokušaja", + "GLOBAL": "Globalno", + "GLOBALMAXRETRY": "Maksimalno Pokušaja", + "CONGESTION": "Zagušenje", + "CONGESTIONMAXRETRY": "Maksimalno Pokušaja", + "CONGESTIONRETRYTIME": "Pokušaj Vrijeme [min]", + "BUSYMAXRETRY": "Maksimalno Pokušaja", + "BUSYRETRYTIME": "Pokušaj Vrijeme [min]", + "NOANSWER": "Bez Odgovora", + "NOANSWERMAXRETRY": "Maks Pokušaja", + "NOANSWERRETRYTIME": "Pokušaj Vrijeme [min]", + "NOSUCHNUMBER": "Nepostojeći broj", + "NOSUCHNUMBERMAXRETRY": "Maks Pokušaja", + "NOSUCHNUMBERRETRYTIME": "Pokušaj Vrijeme [min]", + "DROP": "Ispusti", + "DROPMAXRETRY": "Maksimalno Pokušaja", + "DROPRETRYTIME": "Pokušaj Vrijeme [min]", + "ABANDONEDMAXRETRY": "Maksimalno Pokušaja", + "ABANDONEDRETRYTIME": "Pokušaj Vrijeme [min]", + "MACHINE": "Mašina", + "MACHINEMAXRETRY": "Maksimalno Pokušaja", + "MACHINERETRYTIME": "Pokušaja Vrijeme [min]", + "AGENTREJECT": "Specijalist Odbij", + "AGENTREJECTMAXRETRY": "Maksimalno Pokušaja", + "AGENTREJECTRETRYTIME": "Pokušaj Vrijeme [min]", + "CALLADDITIONALPHONEAFTERMIN": "Pozovi dodatni telefon nakon [min]", + "ADDITIONALPHONES": "Dodatni telefoni", + "QUEUE_PARAMS": "Queue Parametri", + "ORIGINATED": "Porijeklo", + "MESSAGE": "Poruka", + "DROPPED": "Ispušteno", + "CREATED_AT": "Kreirano U", "LEGEND": { - "CUSTOM_APPLICATION": "(*) - Custom application." + "CUSTOM_APPLICATION": "(*) - Prilagođena aplikacija." }, "ERRORS": { - "AGENT_REQUIRED": "Mandatory field", - "CUTDIGIT_REQUIRED": "Mandatory field", - "CUTDIGIT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "CUTDIGIT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "RANDOMLASTDIGITCALLERIDNUMBER_REQUIRED": "Mandatory field", - "RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "AGENTTIMEOUT_REQUIRED": "Mandatory field", - "INTERVAL_REQUIRED": "Mandatory field", - "EMAIL_REQUIRED": "Mandatory field", - "DIALRECALLMETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "DIALRECALLMETIMEOUT_REQUIRED": "Mandatory field", - "NAME_MUST_VALID_PATTERN": "Wrong format", - "PREFIX_MUST_VALID_PATTERN": "Wrong format", - "NAME_REQUIRED": "Mandatory field", - "TIMEOUT_REQUIRED": "Mandatory field", - "PHONENUMBER_REQUIRED": "Mandatory field", - "CONTEXT_REQUIRED": "Mandatory field", - "DESTINATIONPATTERN_REQUIRED": "Mandatory field", - "FULLNAME_REQUIRED": "Mandatory field", - "EMAIL_REQUUIRED": "Mandatory field", - "EMAIL_MUST_VALID": "Wrong format", - "MAILBOX_REQUIRED": "Mandatory Field", - "PASSWORD_REQUIRED": "Mandatory field", - "CONFIRM_NOT_MATCH": "The passwords don't match", - "TIMEZONE_REQUIRED": "Mandatory field", - "PREFIX_REQUIRED": "Mandatory field", - "OPTIONS_REQUIRED": "Mandatory field", - "AFTERCALLWORKDURATION_REQUIRED": "Mandatory field", - "TECHNOLOGY/RESOURCE_REQUIRED": "Mandatory field", - "PHONE_REQUIRED": "Mandatory field", - "VALUE_REQUIRED": "Mandatory field", - "EXTENSION_REQUIRED": "Mandatory field", - "PRIORITY_REQUIRED": "Mandatory field", - "GLOBALMAXRETRY_REQUIRED": "Mandatory field", - "CONGESTIONMAXRETRY_REQUIRED": "Mandatory field", - "CONGESTIONRETRYTIME_REQUIRED": "Mandatory field", - "BUSYMAXRETRY_REQUIRED": "Mandatory field", - "BUSYRETRYTIME_REQUIRED": "Mandatory field", - "NOANSWERMAXRETRY_REQUIRED": "Mandatory field", - "NOANSWERRETRYTIME_REQUIRED": "Mandatory field", - "QUEUETIMEOUT_REQUIRED": "Mandatory field", - "ORIGINATETIMEOUT_REQUIRED": "Mandatory field", - "GLOBALINTERVAL_REQUIRED": "Mandatory field", - "MAXCONCURRENTCALLS_REQUIRED": "Mandatory field", - "CONCURRENTCALLS_REQUIRED": "Mandatory field", - "NOSUCHNUMBERMAXRETRY_REQUIRED": "Mandatory field", - "NOSUCHNUMBERRETRYTIME_REQUIRED": "Mandatory field", - "DROPMAXRETRY_REQUIRED": "Mandatory field", - "DROPRETRYTIME_REQUIRED": "Mandatory field", - "ABANDONEDMAXRETRY_REQUIRED": "Mandatory field", - "ABANDONEDRETRYTIME_REQUIRED": "Mandatory field", - "MACHINEMAXRETRY_REQUIRED": "Mandatory field", - "MACHINERETRYTIME_REQUIRED": "Mandatory field", - "AGENTREJECTMAXRETRY_REQUIRED": "Mandatory field", - "AGENTREJECTRETRYTIME_REQUIRED": "Mandatory field", - "POWERLEVEL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "PREDICTIVEOPTIMIZATIONPERCENTAGE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "PREDICTIVEINTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "MAXCONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "ORIGINATETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "QUEUETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "AGENTTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "GLOBALMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "CONGESTIONMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "CONGESTIONRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "BUSYMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "BUSYRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "NOANSWERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "NOANSWERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "CONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "POWERLEVEL_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "PREDICTIVEOPTIMIZATIONPERCENTAGE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "PREDICTIVEINTERVAL_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "MAXCONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "ORIGINATETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "QUEUETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "GLOBALMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "CONGESTIONMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "CONGESTIONRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "BUSYMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "BUSYRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "NOANSWERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "NOANSWERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "DROPMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "DROPRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "ABANDONEDMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "ABANDONEDRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "AGENTREJECTMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "AGENTREJECTRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "CONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Mandatory field", - "CALLYSQUAREPROJECT_REQUIRED": "Mandatory field", - "TRUNK_REQUIRED": "Mandatory field", - "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "Mandatory field", - "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Call add.phone after min. should be greater than or equal to" + "AGENT_REQUIRED": "Obavezno polje", + "CUTDIGIT_REQUIRED": "Obavezno polje", + "CUTDIGIT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "CUTDIGIT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "RANDOMLASTDIGITCALLERIDNUMBER_REQUIRED": "Obavezno polje", + "RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "AGENTTIMEOUT_REQUIRED": "Obavezno polje", + "INTERVAL_REQUIRED": "Obavezno polje", + "EMAIL_REQUIRED": "Obavezno polje", + "DIALRECALLMETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "DIALRECALLMETIMEOUT_REQUIRED": "Obavezno polje", + "NAME_MUST_VALID_PATTERN": "Pogrešan format", + "PREFIX_MUST_VALID_PATTERN": "Pogrešan format", + "NAME_REQUIRED": "Obavezno polje", + "TIMEOUT_REQUIRED": "Obavezno polje", + "PHONENUMBER_REQUIRED": "Obavezno polje", + "CONTEXT_REQUIRED": "Obavezno polje", + "DESTINATIONPATTERN_REQUIRED": "Obavezno polje", + "FULLNAME_REQUIRED": "Obavezno polje", + "EMAIL_REQUUIRED": "Obavezno polje", + "EMAIL_MUST_VALID": "Pogrešan format", + "MAILBOX_REQUIRED": "Obavezno polje", + "PASSWORD_REQUIRED": "Obavezno polje", + "CONFIRM_NOT_MATCH": "Lozinke se ne poklapaju", + "TIMEZONE_REQUIRED": "Obavezno polje", + "PREFIX_REQUIRED": "Obavezno polje", + "OPTIONS_REQUIRED": "Obavezno polje", + "AFTERCALLWORKDURATION_REQUIRED": "Obavezno polje", + "TECHNOLOGY/RESOURCE_REQUIRED": "Obavezno polje", + "PHONE_REQUIRED": "Obavezno polje", + "VALUE_REQUIRED": "Obavezno polje", + "EXTENSION_REQUIRED": "Obavezno polje", + "PRIORITY_REQUIRED": "Obavezno polje", + "GLOBALMAXRETRY_REQUIRED": "Obavezno polje", + "CONGESTIONMAXRETRY_REQUIRED": "Obavezno polje", + "CONGESTIONRETRYTIME_REQUIRED": "Obavezno polje", + "BUSYMAXRETRY_REQUIRED": "Obavezno polje", + "BUSYRETRYTIME_REQUIRED": "Obavezno polje", + "NOANSWERMAXRETRY_REQUIRED": "Obavezno polje", + "NOANSWERRETRYTIME_REQUIRED": "Obavezno polje", + "QUEUETIMEOUT_REQUIRED": "Obavezno polje", + "ORIGINATETIMEOUT_REQUIRED": "Obavezno polje", + "GLOBALINTERVAL_REQUIRED": "Obavezno polje", + "MAXCONCURRENTCALLS_REQUIRED": "Obavezno polje", + "CONCURRENTCALLS_REQUIRED": "Obavezno polje", + "NOSUCHNUMBERMAXRETRY_REQUIRED": "Obavezno polje", + "NOSUCHNUMBERRETRYTIME_REQUIRED": "Obavezno polje", + "DROPMAXRETRY_REQUIRED": "Obavezno polje", + "DROPRETRYTIME_REQUIRED": "Obavezno polje", + "ABANDONEDMAXRETRY_REQUIRED": "Obavezno polje", + "ABANDONEDRETRYTIME_REQUIRED": "Obavezno polje", + "MACHINEMAXRETRY_REQUIRED": "Obavezno polje", + "MACHINERETRYTIME_REQUIRED": "Obavezno polje", + "AGENTREJECTMAXRETRY_REQUIRED": "Obavezno polje", + "AGENTREJECTRETRYTIME_REQUIRED": "Obavezno polje", + "POWERLEVEL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "PREDICTIVEOPTIMIZATIONPERCENTAGE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "PREDICTIVEINTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "MAXCONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "ORIGINATETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "QUEUETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "AGENTTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "GLOBALMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "CONGESTIONMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "CONGESTIONRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "BUSYMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "BUSYRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "NOANSWERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "NOANSWERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "CONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "POWERLEVEL_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "PREDICTIVEOPTIMIZATIONPERCENTAGE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "PREDICTIVEINTERVAL_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "MAXCONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "ORIGINATETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "QUEUETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "GLOBALMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "CONGESTIONMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "CONGESTIONRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "BUSYMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "BUSYRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "NOANSWERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "NOANSWERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "DROPMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "DROPRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "ABANDONEDMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "ABANDONEDRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "AGENTREJECTMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "AGENTREJECTRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "CONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Obavezno polje", + "CALLYSQUAREPROJECT_REQUIRED": "Obavezno polje", + "TRUNK_REQUIRED": "Obavezno polje", + "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "Obavezno polje", + "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Poziv dod.telefon nakon min. treba biti veći ili jednak od" }, - "GENERAL": "General", - "AGENTTIMEOUT": "Agent Timeout", - "MAXLENGTH": "Maximum Length", - "RETRY": "Retry", - "WRAPUPTIME": "Wrapup Time", - "WEIGHT": "Weight", - "JOINWHENEMPTY": "Join when empty", - "LEAVEWHENEMPTY": "Leave when empty", + "GENERAL": "Općenito", + "AGENTTIMEOUT": "Specijalist Timeout", + "MAXLENGTH": "Maksimalna Dužina", + "RETRY": "Ponovljeni Pokušaj", + "WRAPUPTIME": "Vrijeme Završetka", + "WEIGHT": "Težina", + "JOINWHENEMPTY": "Pridruži se kada je prazno", + "LEAVEWHENEMPTY": "Napusti kada je prazno", "HELP": { - "PREDICTIVEMAXTHRESHOLD": "If the percentage of agents available in the time window, compared to the agents available at the time of prediction, exceeds the configured maximum limit, the predictive recalculates the prediction. ", - "PREDICTIVEMINTHRESHOLD": "If the percentage of agents available in the time window, compared to the agents available at the time of prediction, exceeds the configured minimum limit, the predictive recalculates the prediction.", - "RANDOMLASTDIGITCALLERIDNUMBER": "If greater than 0, it generates randomly the corresponding last digits of the Outgoing Caller Id Number", - "TIMEOUT": "Number of seconds to ring agent in queue", - "CALLYSQUAREPROJECTPREVIEW": "Selecting an IVR project, the dialer will forward the call to the IVR when an agent answers (the IVR will be directed to the agent)", - "CALLYSQUAREPROJECTPREVIEW2": "Selecting an IVR project, the dialer will forward the call to the IVR when an client hangup or unreachable (the IVR will be directed to the agent)", - "RUNIFHANGUPAGENT": "Run Cally Square Project After even if the agent hangs up the call", - "CALLYSQUAREPROJECT2": "Selecting an IVR project, the dialer will forward the call to the IVR after the queue (if the queue ends by timeout)", - "DIALORDERBYSCHEDULEDAT": "Get contacts from hopper (descending or ascending).", - "DIALRECALLINQUEUE": "Reschedule call for agents in the Queue", - "DIALRECALLMETIMEOUT": "Time interval (in minutes) for Recall Me period of validity", - "PRIORITY": "Priority in the list", - "TIMEZONE": "Specify timezone", - "PREVIEW_RECALL_ME_REMINDER": "If enabled, the system will send a notification to the agent n minutes (according to time interval set in general settings) before generating the recall me", - "AMDMAXIMUMWORDLENGTH": "Maximum duration allowed of a single Voice utterance", - "AMDMINWORDLENGTH": "Minimum duration of a Voice to be considered a word", - "AMDSILENCETHRESHOLD": "If the average level of noise in a sample does not reach this value, from a scale of 0 to 32767, then we will consider it as silence", - "AMDTOTALANALYSISTIME": "Maximum time allowed for the algorithm to decide on whether the audio represents a HUMAN or a MACHINE", - "AMDAFTERGREETINGSILENCE": "Silence after detecting a greeting. If exceeded, then the result is detection as a HUMAN", - "AMDGREETING": "Maximum length of a greeting. If exceeded, then the result is detection as a MACHINE", - "AMDINITIALSILENCE": "Maximum silence duration before the greeting. If exceeded, then the result is detection as a MACHINE", - "AMDACTIVE": "Activate or disactivate answering machines detection attempts", - "AMDBETWEENWORDSSILENCE": "Minimum duration of silence after a word to consider the audio that follows as a new word", - "AMDMAXIMUMNUMBEROFWORDS": "Maximum number of words in the greeting. If REACHED, then the result is detection as a MACHINE", - "CALLYSQUAREPROJECT": "Selecting an IVR project, the dialer will forward the call to the IVR before the queue", - "PREFIX": "Telephone prefix", - "ACTIVE": "Active", - "AGENTTIMEOUT": "How long (in seconds) to ring an agent’s device", - "MAXLENGTH": "Maximum number of callers allowed to be waiting in a queue (0=unlimited)", - "RETRY": "How long (in seconds) to wait before calling the next agent in the queue when the agent timeout is expired", - "WRAPUPTIME": "How long (in seconds) to keep an agent unavailable in a queue after completing a call", - "WEIGHT": "Used to determine priority if the agents are associated with more than one queue", - "JOINWHENEMPTY": "If a caller is added to the queue, when no agents are available", - "LEAVEWHENEMPTY": "If a caller is expelled from the queue when no agents are available", - "ANNOUNCEFREQUENCY": "How often to announce the caller’s position and/or estimated hold time in the queue (0=disable)", - "MINANNOUNCEFREQUENCY": "Minimum announcement frequency (useful when the caller’s position changes frequently)", - "PERIODICANNOUNCEFREQUENCY": "Frequency of periodic announcements to the caller", - "ANNOUNCEPOSITIONLIMIT": "Used if you’ve defined announce-position as either 'limit' or 'more'", - "AFTERCALLWORKDURATION": "Pause length triggered by the After Call Work option", - "MEMBERDELAY": "Inserts a delay prior to the caller and agent in queue get connected", - "MUSICONHOLD": "Sets the music class to use for a particular queue", - "ANNOUNCETOAGENT": "Plays an announcement to the agent answering the call (e.g. to let him know which queue the caller is coming from)", - "RANDOMPERIODICANNOUNCE": "If yes, it plays the periodic announcements in random order", - "ANNOUNCEHOLDTIME": "Plays the estimated hold time along with the periodic announcements (Yes/No/Once)", - "ANNOUNCECALLERPOSITION": "Used to define if the caller’s position in the queue should be announced: No=never; Yes=always; Limit=only if it is within the limit defined by announce-position-limit; More= only if it is beyond the value defined by announce-position-limit", - "REPORTHOLDTIMEAGENT": "Enables reporting caller’s hold time to the agent in queue prior to connection", - "PERIODICANNOUNCE": "Set of periodic announcements to be played (in the order)", - "HOLDTIMEANNOUNCE": "Choose a Sound defined in Tools. Default=“Hold time”. Undefined=no announcement", - "YOUARENEXTANNOUNCE": "Choose a Sound defined in Tools. Default=“You are now first in line”. Undefined=no announcement", - "THEREAREANNOUNCE": "Choose a Sound defined in Tools. Default=“There are”. Undefined=no announcement", - "WAITINGCALLSANNOUNCE": "Choose a Sound defined in Tools. Default=“calls waiting”. Undefined=no announcement", - "ESTIMATEDHOLDTIMEANNOUNCE": "Choose a Sound defined in Tools. Default=“The current estimated hold time is”. Undefined=no announcement", - "MINUTESANNOUNCE": "Choose a Sound defined in Tools. Default=“minutes”. Undefined=no announcement", - "MINUTEANNOUNCE": "Choose a Sound defined in Tools. Default=“minute”. Undefined=no announcement", - "SECONDSANNOUNCE": "Choose a Sound defined in Tools. Default=“seconds”. Undefined=no announcement", - "THANKYOUANNOUNCE": "Choose a Sound defined in Tools. Default=“Thank you for your patience”. Undefined=no announcement", - "AFTERCALLWORK": "If enabled, the agent will be set on Pause after completing a call", - "AUTOPAUSE": "Enables/disables the automatic pause of agents who fail to answer a call. If enabled, it causes the agent to be paused in all queues he belongs to", - "RINGINUSE": "To avoid/allow sending calls to members whose status is In Use", - "TIMEOUTRESTART": "If yes, this resets the timeout for an agent to answer when either a BUSY or CONGESTION status is received from the channel", - "MONITORFORMAT": "Specifies the file format to use when recording. If monitor-format is inactive, calls will not be recorded", - "CONTEXT": "Allows a caller to exit the queue by pressing a single DTMF digit. If a context is specified and the caller enters a number, that digit will attempt to be matched in the context specified, and dialplan execution will continue there", - "SETINTERFACEVARIABLES": "If set to yes, just prior to the caller being connected with a queue agent some variables will be set (for more information see wiki docs:click here)", - "SETQUEUEVARIABLES": "If set to yes, just prior to the caller being connected with a queue agent and leaving the queue, some variables will be set (for more information, see wiki docs:click here)", - "SETQUEUEENTRYVARIABLES": "If set to yes, just prior to the caller being connected with a queue agent some variables will be set (for more information, see wiki docs:click here)", - "RECORDING": "Enable call recording", - "VOICEMAIL_CONTEXT": "The context of the relative extension", - "METHOD": "Outbound dialer method", - "POWERLEVEL": "Number of contacts to call for any available agent", - "PREDICTIVEOPTIMIZATION": "A factor to optimize in the predictive algorithm", - "PREDICTIVEOPTIMIZATIONPERCENTAGE": "Percentage based on the selected predictive optimization factor", - "PREDICTIVEINTERVAL": "Time interval (in minutes) considered by the predictive algorithm to calculate the amount of calls to generate to optimize the result", - "MAXCONCURRENTCALLS": "Maximum number of concurrent calls that will be originated by the outbound dialer for this campaign (0=unlimited)", - "CONCURRENTCALLS": "Maximum number of concurrent calls that will be originated by the outbound dialer for this campaign", - "ORIGINATECALLERIDNAME": "Outgoing Caller Id Name", - "ORIGINATECALLERIDNUMBER": "Outgoing Caller Id Number", - "ORIGINATETIMEOUT": "Time (in seconds) for the outbound call to establish a connection, otherwise the status is set to No Answer ", - "QUEUETIMEOUT": "Time (in seconds) a call will wait in the queue before it is dropped (Min 1 and Max 999)", - "GLOBALMAXRETRY": "Maximum number of times a contact is called before considering it closed", - "CONGESTIONMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for congestion", - "CONGESTIONRETRYTIME": "Time in minutes before trying to call again a failed contact due to congestion", - "BUSYMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for busy", - "BUSYRETRYTIME": "Time in minutes before trying to call again a failed contact due to busy", - "NOANSWERMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for no answer", - "NOANSWERRETRYTIME": "Time in minutes before trying to call again a failed contact due to no answer", - "NOSUCHNUMBERMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for no such number", - "NOSUCHNUMBERRETRYTIME": "Time in minutes before trying to call again a failed contact due to no such number", - "DROPMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for drop", - "DROPRETRYTIME": "Time in minutes before trying to call again a failed contact due to drop", - "ABANDONEDMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for abandon", - "ABANDONEDRETRYTIME": "Time in minutes before trying to call again a failed contact due to abandon", - "MACHINEMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for machine", - "MACHINERETRYTIME": "Time in minutes before trying to call again a failed contact due to machine", - "AGENTREJECTMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for agent reject", - "AGENTREJECTRETRYTIME": "Time in minutes before trying to call again a failed contact due to agent reject", + "PREDICTIVEMAXTHRESHOLD": "Ako procenat Specijalista dostupnih u vremenskom intervalu, u poređenju sa Specijalistima dostupnim u vrijeme predviđanja, premašuje konfigurisano maksimalno ograničenje, prediktivni sistem ponovo izračunava predviđanje.", + "PREDICTIVEMINTHRESHOLD": "Ako procenat Specijalista dostupnih u vremenskom intervalu, u poređenju sa Specijalistima dostupnim u vrijeme predviđanja, premašuje konfigurisano mainimalno ograničenje, prediktivni sistem ponovo izračunava predviđanje.", + "RANDOMLASTDIGITCALLERIDNUMBER": "Ako je veći od 0, nasumično generira odgovarajuće posljednje cifre Odlaznog Pozivatelja ID Broj", + "TIMEOUT": "Broj sekundi koliko se poziva Specijalista u queue", + "CALLYSQUAREPROJECTPREVIEW": "Odabirom IVR projekta, birač će proslijediti poziv IVR-u kada se Specijalista javi (IVR će biti usmjeren na Specijalistu)", + "CALLYSQUAREPROJECTPREVIEW2": "Odabirom IVR projekta, birač će proslijediti poziv IVR-u kada klijent prekine vezu ili je nedostupan (IVR će biti usmjeren na Specijalistu)", + "RUNIFHANGUPAGENT": "Pokreni Cally Square Projekat Nakon čak i ako Specijalista prekine poziv", + "CALLYSQUAREPROJECT2": "Odabirom IVR projekta, birač će proslijediti poziv na IVR nakon queue (ako se queue završi do timeout-a)", + "DIALORDERBYSCHEDULEDAT": "Dobijte kontakte iz Hopper (silazni ili uzlazni).", + "DIALRECALLINQUEUE": "Ponovo zakaži pozive za Specijaliste u Queue ", + "DIALRECALLMETIMEOUT": "Vremenski interval (u minutama) za Recall Me period važenja", + "PRIORITY": "Prioritet na listi", + "TIMEZONE": "Odredite vremensku zonu", + "PREVIEW_RECALL_ME_REMINDER": "Ako je omogućeno, sistem će poslati obavještenje Specijalisti n minuta (prema vremenskom intervalu postavljenom u općim postavkama) prije generisanja recall me", + "AMDMAXIMUMWORDLENGTH": "Maksimalno dozvoljeno trajanje jednog govornog izgovora", + "AMDMINWORDLENGTH": "Minimalno trajanje glasa koje se smatra riječju", + "AMDSILENCETHRESHOLD": "Ako prosječan nivo buke u uzorku ne dostigne ovu vrijednost, sa skale od 0 do 32767, onda će se matrati tišinom ", + "AMDTOTALANALYSISTIME": "Maksimalno vrijeme dozvoljeno algoritmu da odluči o tome da li zvuk predstavlja LJUDSKI ili MAŠINSKI", + "AMDAFTERGREETINGSILENCE": "Tišina nakon otkrivanja pozdrava. Ako se prekorači, rezultat je otkrivanje kao LJUDSKO", + "AMDGREETING": "Maksimalna dužina pozdrava. Ako se prekorači, rezultat je detekcija kao MAŠINSKO", + "AMDINITIALSILENCE": "Maksimalno trajanje tišine prije pozdrava. Ako se prekorači, rezultat je detekcija kao MAŠINSKO", + "AMDACTIVE": "Aktiviraj ili deaktiviraj pokušaje otkrivanja telefonskih sekretarica", + "AMDBETWEENWORDSSILENCE": "Minimalno trajanje tišine nakon riječi kako bi se audio koji slijedi smatrao novom riječju", + "AMDMAXIMUMNUMBEROFWORDS": "Maksimalan broj riječi u pozdravu. Ako se DOSTIGNE, onda je rezultat detekcija kao MAŠINSKO", + "CALLYSQUAREPROJECT": "Odabirom IVR projekta, birač će proslijediti poziv IVR-u prije queue", + "PREFIX": "Telefonski prefiks", + "ACTIVE": "Aktivan", + "AGENTTIMEOUT": "Koliko dugo (u sekundama) treba zvoniti uređaj Specijaliste", + "MAXLENGTH": "Maksimalan broj pozivatelja koji mogu čekati u queue (0 = neograničeno)", + "RETRY": "Koliko dugo (u sekundama) treba čekati prije pozivanja sljedećeg Specijaliste u queue kada Specijalistin timeout istekne", + "WRAPUPTIME": "Koliko dugo (u sekundama) treba zadržati Specijalistu nedostupnim u queue nakon završetka poziva", + "WEIGHT": "Koristi se za određivanje prioriteta ako su Specijalisti povezani s više od jednog queue", + "JOINWHENEMPTY": "Ako je pozivatelj dodan u queue, kada nema dostupnih Specijalista", + "LEAVEWHENEMPTY": "Ako je pozivatelj izbačen iz queue kada nema dostupnih Specijalista", + "ANNOUNCEFREQUENCY": "Koliko često najavljivati poziciju pozivaoca i/ili procjenjeno vrijeme čekanja u queue (0=onemogućeno)", + "MINANNOUNCEFREQUENCY": "Minimalna učestalost najava (korisno kada se pozicija pozivatelja često mijenja)", + "PERIODICANNOUNCEFREQUENCY": "Učestalost periodičnih najava pozivatelju", + "ANNOUNCEPOSITIONLIMIT": "Koristi se ako ste definisali poziciju najave kao 'ograničenje' ili 'više'", + "AFTERCALLWORKDURATION": "Dužina pauze koju pokreće opcija Nakon Poziva Posao", + "MEMBERDELAY": "Unosi odgodu prije nego što se pozivatelj i Specijalista u queue se povežu", + "MUSICONHOLD": "Postavlja muzičku klasu za korištenje u određeni queue", + "ANNOUNCETOAGENT": "Reproducira najavu Specijaliste koji odgovara na poziv (npr. da bi ga obavijestio iz kojeg queue pozivatelj dolazi)", + "RANDOMPERIODICANNOUNCE": "Ako je da, reproducira periodične najave slučajnim redoslijedom", + "ANNOUNCEHOLDTIME": "Reproducira procijenjeno vrijeme čekanja zajedno s periodičnim najavama (Da/Ne/Jednom)", + "ANNOUNCECALLERPOSITION": "Koristi se za definisanje da li treba objaviti poziciji pozivatelja u queue: Ne=nikada;Da=uvijek;Limit=samo ako je unutar ograničenja definisanog sa najava-pozicija-limit; Više=samo ako je iznad vrijednositi definisane sa najava-pozicija-limit", + "REPORTHOLDTIMEAGENT": "Omogućuje izvještavanje o vremenu čekanja pozivatelja Specijalisti u queue prije povezivanja", + "PERIODICANNOUNCE": "Set periodičnih najava koje će se puštati (po redoslijedu)", + "HOLDTIMEANNOUNCE": "Odaberi Zvuk definisan u Alatima. Zadano=\"Vrijeme čekanja\". Nedefinisano=bez najave", + "YOUARENEXTANNOUNCE": "Odaberite Zvuk definiram u Alatima. Zadano=\"Sada ste prvi u redu\". Nedifinirano=bez najave", + "THEREAREANNOUNCE": "Odaberite Zvuk definisan u Alatima. Zadano=\"Ispred su\". Nedefinisano=bez najave", + "WAITINGCALLSANNOUNCE": "Odaberide Zvuk definiran u Alatima. Zadano=\"pozivi na čekanju\". Nedifinirano=bez najave", + "ESTIMATEDHOLDTIMEANNOUNCE": "Odaberi Zvuk definisan u Alatima. Zadano=\"Trenutno procijenjeno vrijeme čekanja je\". Nedefinisano=Bez najave", + "MINUTESANNOUNCE": "Odaberite Zvuk definisan u Alatima. Zadano=“minute”. Nedefinisano=bez najave", + "MINUTEANNOUNCE": "Odaberite Zvuk definisan u Alatima. Zadano=“minute”. Nedefinisano=bez najave", + "SECONDSANNOUNCE": "Odaberi Zvuk definisan u Alatima. Zadano=\"sekunde\". Nedefinisano=bez najave", + "THANKYOUANNOUNCE": "Odaberite Zvuk definisan u Alatima. Zadano=\"Hvala Vam na strpljenju\". Nedefinisano=bez najave", + "AFTERCALLWORK": "Ako je omogućeno, Specijalist će biti postavljen na pauzu nakon završetka poziva", + "AUTOPAUSE": "Omogućava/onemogućava automatsku pauzu Specijaliste koji ne odgovaraju na poziv. Ako je omogućeno, to uzrokuje da Specijalista bude pauziran u svim queue kojima pripada", + "RINGINUSE": "Za izbjegavanje/dozvoljavanje slanja poziva članovima čiji je status U Upotrebi", + "TIMEOUTRESTART": "Ako je da, ovo restartuje timeout za Specijalistu da odgovori kada je ili Zauzet ili Zagušen status primljen od kanala", + "MONITORFORMAT": "Određuje format datoteke koji će se koristiti prilikom snimanja. Ako je format monitora neaktivan, pozivi se neće snimati", + "CONTEXT": "Omogućava pozivatelju da napusti queue pritiskom na jednu DTMF cifru. Ako je kontekst određen i pozivatelj unese broj, ta cifra će se pokušati upariti u određenom kontekstu, a izvršavanje plana biranja će se tamo nastaviti.", + "SETINTERFACEVARIABLES": "Ako je da, neposredno prije povezivanja pozivatelja sa Specijalistom queue neke varijable će biti postavljene (za više informacija pogledaj wiki dokumente:kliknite ovdje)", + "SETQUEUEVARIABLES": "Ako je da, neposredno prije povezivanja pozivatelja sa Specijalistom queue i napusti queue neke varijable će biti postavljene (za više informacija pogledaj wiki dokumente:kliknite ovdje)", + "SETQUEUEENTRYVARIABLES": "Ako je da, neposredno prije povezivanja pozivatelja sa Specijalistom queue neke varijable će biti postavljene (za više informacija pogledaj wiki dokumente:kliknite ovdje)", + "RECORDING": "Omogući snimanje poziva", + "VOICEMAIL_CONTEXT": "Kontekst relativne ekstenzije", + "METHOD": "Odlazni birač metoda", + "POWERLEVEL": "Broj kontakata za pozivanje bilo kojeg dostupnog Specijaliste", + "PREDICTIVEOPTIMIZATION": "Faktor za optimizaciju u prediktivnom algoritmu", + "PREDICTIVEOPTIMIZATIONPERCENTAGE": "Postotak zasnovan na odabranom faktoru prediktivne optimizacije", + "PREDICTIVEINTERVAL": "Vremenski interval (u minutama) koji prediktivni algoritam razmatra za izračunavanje količine poziva za generisanje radi optimizacije rezultata", + "MAXCONCURRENTCALLS": "Maksimalan broj istovremenih poziva koje će uputiti odlazni birač za ovu kampanju (0 = neograničeno)", + "CONCURRENTCALLS": "Maksimalan broj istovremenih poziva koje će pokrenuti odlazni birač za ovu kampanju", + "ORIGINATECALLERIDNAME": "Odlazni Pozivatelj ID Naziv", + "ORIGINATECALLERIDNUMBER": "Odlazni Pozivatelj ID Broj", + "ORIGINATETIMEOUT": "Vrijeme (u sekundama) za uspostavljanje veze odlaznim pozivom, inače je status postavljen na Bez Odgovora", + "QUEUETIMEOUT": "Vrijeme (u sekundama) koliko će poziv čekati u queue prije nego što bude ispušten (Min 1 i Maks 999)", + "GLOBALMAXRETRY": "Maksimalan broj poziva kontakta prije nego što se smatra zatvorenim", + "CONGESTIONMAXRETRY": "Maksimalan broj poziva kontakta prije nego što se smatra da je zatvoren, kada poziv nije uspio zbog zagušenja", + "CONGESTIONRETRYTIME": "Vrijeme u minutama prije pokušaja ponovnog pozivanja kontakta koji nije uspio zbog zagušenja", + "BUSYMAXRETRY": "Maksimalan broj puta da je kontakt pozvan prije nego što se smatra da je zatvoren, kada poziv nije uspio zbog zauzetosti", + "BUSYRETRYTIME": "Vrijeme u minutama prije ponovnog pokušaja pozivanja kontakta koji nije uspio zbog zauzetosti", + "NOANSWERMAXRETRY": "Maksimalan broj puta da je kontakt pozvan prije nego što se smatra da je zatvoren, kada poziv nije uspio zbog neodgovaranja", + "NOANSWERRETRYTIME": "Vrijeme u minutama prije ponovnog pokušaja pozivanja kontakta koji nije uspio zbog neodgovaranja", + "NOSUCHNUMBERMAXRETRY": "Maksimalan broj poziva kontakta prije nego što se smatra da je zatvoren, kada poziv nije uspio zbog nepostojećeg broja", + "NOSUCHNUMBERRETRYTIME": " Vrijeme u minutama prije pokušaja ponovnog pozivanja kontakta koji nije uspio zbog nepostojećeg broja", + "DROPMAXRETRY": "Vremenski interval (u minutama za Recall Me period važenja", + "DROPRETRYTIME": "Vrijeme u minutama prije pokušaja ponovnog pozivanja neuspjelog kontakta zbog pada", + "ABANDONEDMAXRETRY": "Maksimalan broj puta da je kontakt pozvan prije nego što se smatra da je zatvoren, kada poziv nije uspio zbog napuštanja", + "ABANDONEDRETRYTIME": "Vrijeme u minutama prije pokušaja ponovnog pozivanja kontakta koji nije uspio zbog napuštanja", + "MACHINEMAXRETRY": "Maksimalan broj poiva kontakta prije nego što se smatra zatvorenim, kada poziv nije uspio za mašinu", + "MACHINERETRYTIME": "Vrijeme u minutama prije pokušaja ponovnog pozivanja kontakta koji nije uspio zbog mašine", + "AGENTREJECTMAXRETRY": "Maksimalan broj puta da je kontakt pozvan prije nego što se smatra da je zatvoren, kada poziv nije uspio zbog odbijanja Specijaliste", + "AGENTREJECTRETRYTIME": "Vrijeme u minutam prije pokušaja ponovnog pozivanja neuspjelog kontakta zbog odbijanja Specijaliste", "CALLADDITIONALPHONEAFTERMIN": "", - "GLOBALINTERVAL": "Global time interval during which the dialer is allowed to call contacts. We decline responsibility: pay attention when you modify this field, because you may fail to comply with the national Autodialer Laws and Regulations", - "NAME": "Only numbers, letters and specific characters (._) are supported", - "MANDATORYDISPOSITIONPAUSEID": "Pause status to set during mandatory disposition", - "PREVIEW_AUTO_RECALL_ME": "If enabled, the system will automatically generate the Recall Me calls; otherwise, the agent must do it manually" + "GLOBALINTERVAL": "Globalni vremenski interval tokom kojeg je biraču dozvoljeno da poziva kontakte. Odbijamo odgovornost: obrati pažnju kada se modifikujete ovo polje, jer se možda nećeš pridržavati nacionalnih zakona i propisa o automatskom biranju brojeva", + "NAME": "Samo brojevi, slova i specifični znakovi (._) su podržani", + "MANDATORYDISPOSITIONPAUSEID": "Status pauze za postavljanje tokom obavezne dispozicije", + "PREVIEW_AUTO_RECALL_ME": "Ako je omogućeno, sistem će automatski generisati Recall Me pozive; inače, Specijalista to mora učiniti ručno" }, - "MUSICONHOLD": "Music On Hold", - "ANNOUNCETOAGENT": "Announce To Agent", - "ANNOUNCEMENTS": "Announcements", - "ADVANCEDPREVIEW": "Advanced", - "ADVANCED": "Advanced", - "ADVANCE": "Advanced", - "ANNOUNCEFREQUENCY": "Announce Frequency", - "MINANNOUNCEFREQUENCY": "Minimum Announce Frequency", - "PERIODICANNOUNCEFREQUENCY": "Periodic Announce Frequency", - "RANDOMPERIODICANNOUNCE": "Random Periodic Announce", - "ANNOUNCEHOLDTIME": "Announce Hold Time", - "ANNOUNCECALLERPOSITION": "Announce Caller Position", - "ANNOUNCEPOSITIONLIMIT": "Announce Position Limit", - "REPORTHOLDTIMEAGENT": "Report Agent Hold Time", - "PERIODICANNOUNCE": "Periodic Announce", - "HOLDTIMEANNOUNCE": "Hold Time Announce", - "YOUARENEXTANNOUNCE": "'You are next' Announce", - "THEREAREANNOUNCE": "'There are' Announce", - "WAITINGCALLSANNOUNCE": "Waiting Calls Announce", - "ESTIMATEDHOLDTIMEANNOUNCE": "Estimated Hold Time Announce", - "MINUTESANNOUNCE": "Minutes Announce", - "MINUTEANNOUNCE": "Minute Announce", - "SECONDSANNOUNCE": "Seconds Announce", - "THANKYOUANNOUNCE": "'Thank You' Announce", - "AUTOPAUSE": "Auto Pause", - "AFTERCALLWORK": "After Call Work", - "AFTERCALLWORKDURATION": "After Call Work Duration", - "RINGINUSE": "Ring In Use", - "MEMBERDELAY": "Member Delay", + "MUSICONHOLD": "Muzika Na Čekanju", + "ANNOUNCETOAGENT": "Najavi Specijalisti", + "ANNOUNCEMENTS": "Najave", + "ADVANCEDPREVIEW": "Napredno", + "ADVANCED": "Napredno", + "ADVANCE": "Napredno", + "ANNOUNCEFREQUENCY": "Najava Učestalost", + "MINANNOUNCEFREQUENCY": "Minimalna Učestalost Najava", + "PERIODICANNOUNCEFREQUENCY": "Učestalost Periodičnih Najava", + "RANDOMPERIODICANNOUNCE": "Nasumično Periodično Objavljivanje", + "ANNOUNCEHOLDTIME": "Najavi Vrijeme Čekanja", + "ANNOUNCECALLERPOSITION": "Najavi Poziciju Pozivaoca", + "ANNOUNCEPOSITIONLIMIT": "Najavi Limit Pozicije", + "REPORTHOLDTIMEAGENT": "Izvještaj Vrijeme Čekanja Specijaliste", + "PERIODICANNOUNCE": "Periodična Najava", + "HOLDTIMEANNOUNCE": "Vrijeme Čekanja Najave", + "YOUARENEXTANNOUNCE": "'Vi ste sljedeći' Najava", + "THEREAREANNOUNCE": "'Ispred su' Najava", + "WAITINGCALLSANNOUNCE": "Najava Poziva Na Čekanju", + "ESTIMATEDHOLDTIMEANNOUNCE": "Procjenjeno Hold Vrijeme Najava", + "MINUTESANNOUNCE": "Minute Najava", + "MINUTEANNOUNCE": "Minuta Najava", + "SECONDSANNOUNCE": "Sekunde Najava", + "THANKYOUANNOUNCE": "'Hvala Vam' Najava", + "AUTOPAUSE": "Automatska Pauza", + "AFTERCALLWORK": "Nakon Poziva Posao", + "AFTERCALLWORKDURATION": "Nakon Poziva Posao Trajanje", + "RINGINUSE": "Zvono U Upotrebi", + "MEMBERDELAY": "Član Odgoda", "TIMEOUTRESTART": "Timeout Restart", - "MONITORFORMAT": "Recording Format", - "SETINTERFACEVARIABLES": "Set Interface Variables", - "SETQUEUEVARIABLES": "Set Queue Variables", - "SETQUEUEENTRYVARIABLES": "Set Queue Entry Variables", - "CONTEXT": "Context", - "SAVE": "Save", - "SETTINGS": "Settings", - "INBOUNDROUTES": "Inbound Routes", - "PHONENUMBER": "Phone Number", - "ADD_INBOUNDROUTE": "Add Inbound Route", - "EDIT_INBOUNDROUTE": "Edit Inbound Route", - "DELETE_INBOUNDROUTE": "Delete Inbound Route", - "ACTIONS": "Actions", - "OUTBOUNDROUTES": "Outbound Routes", - "DESTINATIONPATTERN": "Destination Pattern", - "ADD_OUTBOUNDROUTE": "Add Outbound Route", - "EDIT_OUTBOUNDROUTE": "Edit Outbound Route", - "DELETE_OUTBOUNDROUTE": "Delete Outbound Route", - "CUTDIGITS": "Cut Digits", - "RECORDING": "Recording", - "RECORDINGFORMAT": "Recording format", - "INTERNALROUTES": "Internal Routes", - "ADD_INTERNALROUTE": "Add Internal Route", - "EDIT_INTERNALROUTE": "Edit Internal Route", - "DELETE_INTERNALROUTE": "Delete Internal Route", - "CONTEXTS": "Contexts", - "ADD_CONTEXT": "Add Context", - "EDIT_CONTEXT": "Edit Context", - "DELETE_CONTEXT": "Delete Context", - "VOICEMAILS": "Voicemails", - "ADD_VOICEMAIL": "Add Voicemail", - "EDIT_VOICEMAIL": "Edit Voicemail", - "DELETE_VOICEMAIL": "Delete Voicemail", - "FULLNAME": "Full Name", - "EMAIL": "Email", - "MAILBOX": "Mailbox", - "PASSWORD": "Password", - "CONFIRM_PASSWORD": "Confirm Password", - "TIMEZONE": "Timezone", - "ATTACH": "Attach", + "MONITORFORMAT": "Format Snimanja", + "SETINTERFACEVARIABLES": "Postavi Varijable Interfejsa ", + "SETQUEUEVARIABLES": "Postavi Varijable Queue", + "SETQUEUEENTRYVARIABLES": "Postavi Varijable Ulaznog Queue", + "CONTEXT": "Kontekst", + "SAVE": "Sačuvaj", + "SETTINGS": "Postavke", + "INBOUNDROUTES": "Dolazne Rute", + "PHONENUMBER": "Broj Telefona", + "ADD_INBOUNDROUTE": "Dodaj Inbound Rutu", + "EDIT_INBOUNDROUTE": "Uredi Internu Rutu", + "DELETE_INBOUNDROUTE": "Izbriši Dolaznu Rutu", + "ACTIONS": "Radnje", + "OUTBOUNDROUTES": "Odlazne Rute", + "DESTINATIONPATTERN": "Obrazac Odredišta", + "ADD_OUTBOUNDROUTE": "Dodaj Outbound Rutu", + "EDIT_OUTBOUNDROUTE": "Uredi Odlaznu Rutu", + "DELETE_OUTBOUNDROUTE": "Izbriši Odlaznu Rutu", + "CUTDIGITS": "Izreži Cifre", + "RECORDING": "Snimanje", + "RECORDINGFORMAT": "Format snimanja", + "INTERNALROUTES": "Interne Rute", + "ADD_INTERNALROUTE": "Dodaj Internu Rutu", + "EDIT_INTERNALROUTE": "Uredi Internu Rutu", + "DELETE_INTERNALROUTE": "Izbriši Internu Rutu", + "CONTEXTS": "Konteksti", + "ADD_CONTEXT": "Dodaj Kontekst", + "EDIT_CONTEXT": "Uredi Kontekst", + "DELETE_CONTEXT": "Izbriši Kontekst", + "VOICEMAILS": "Govorne pošte", + "ADD_VOICEMAIL": "Dodaj Govornu Poštu ", + "EDIT_VOICEMAIL": "Uredi Govornu Poštu", + "DELETE_VOICEMAIL": "Izbriši Govorno Poštu", + "FULLNAME": "Puno Ime", + "EMAIL": "E-Mail", + "MAILBOX": "Poštansko sanduče", + "PASSWORD": "Lozinka", + "CONFIRM_PASSWORD": "Potvrdi Lozinku", + "TIMEZONE": "Vremenska Zona", + "ATTACH": "Priloži", "ENVELOPE": "Envelope", - "DELETE": "Delete", - "EMAILBODY": "Email Body", - "EMAILSUBJECT": "Email Subject", - "MAXSECONDS": "Max Seconds", - "MAXMESSAGES": "Max Messages", - "MESSAGES": "Messages", - "SORT": "Sort", - "ADD_MUSICONHOLD": "Add Music On Hold", - "MUSICONHOLDS": "Music On Hold", - "EDIT_MUSICONHOLD": "Edit Music On Hold", - "DELETE_MUSICONHOLD": "Delete Music On Hold", - "DIRECTORY": "Directory", - "AUDIOFILES": "Audio Files", - "RECORDINGS": "Recordings", + "DELETE": "Izbriši", + "EMAILBODY": "E-Mail Tijelo", + "EMAILSUBJECT": "E-Mail Predmet", + "MAXSECONDS": "Maks Sekundi", + "MAXMESSAGES": "Maks Poruka", + "MESSAGES": "Poruke", + "SORT": "Sortiraj", + "ADD_MUSICONHOLD": "Dodaj Muziku Na Čekanju", + "MUSICONHOLDS": "Muzika Na Čekanju", + "EDIT_MUSICONHOLD": "Uredi Muzika Na Čekanju", + "DELETE_MUSICONHOLD": "Izbriši Muzika Na Čekanju", + "DIRECTORY": "Adresar", + "AUDIOFILES": "Audio Datoteke", + "RECORDINGS": "Snimci", "CHANSPY": "ChanSpy", - "PREFIX": "Prefix", - "OPTIONS": "Options", + "PREFIX": "Prefiks", + "OPTIONS": "Opcije", "AUTH": "Auth", - "ADD_CHANSPY": "Add ChanSpy", - "EDIT_CHANSPY": "Edit ChanSpy", - "DELETE_CHANSPY": "Delete ChanSpy", - "AGENTS": "Agents", - "TELEPHONES": "Telephones", + "ADD_CHANSPY": "Dodaj ChanSpy", + "EDIT_CHANSPY": "Uredi ChanSpy", + "DELETE_CHANSPY": "Izbriši ChanSpy", + "AGENTS": "Specijalisti", + "TELEPHONES": "Telefoni", "QUEUES": "Queues", - "QUEUE_CALLS": "Queue Calls", - "QUEUE_PARAMETERS": "Queue Parameters", - "ABANDONED_CALLS": "Abandoned Calls", - "OUTBOUND_CALLS": "Outbound Calls", + "QUEUE_CALLS": "Queue Pozivi", + "QUEUE_PARAMETERS": "Queue Parametri", + "ABANDONED_CALLS": "Napušteni Pozivi", + "OUTBOUND_CALLS": "Odlazni Pozivi", "AGI": "AGI", - "DIAL": "Dial", - "INTERNALDIAL": "Internal Dial", - "EXTERNALDIAL": "External Dial", - "RINGGROUP": "Ring Group", - "PLAYBACK": "Playback", + "DIAL": "Biraj", + "INTERNALDIAL": "Interno Biranje", + "EXTERNALDIAL": "Eksterno Pozivanje", + "RINGGROUP": "Grupa Zvona", + "PLAYBACK": "Reprodukcija", "QUEUE": "Queue", - "SET": "Set", - "VOICEMAIL": "Voicemail", + "SET": "Postavi", + "VOICEMAIL": "Govorna pošta", "GOTO": "GoTo", - "HANGUP": "Hangup", - "CUSTOM": "Custom", - "PROJECT": "Cally-Square Project", - "TECHNOLOGY/RESOURCE": "Technology/Resource", + "HANGUP": "Prekid", + "CUSTOM": "Prilagođeno", + "PROJECT": "Cally-Square Projekat", + "TECHNOLOGY/RESOURCE": "Tehnologija/Resursi", "URL": "URL", - "EDIT_APP": "Edit Application", - "EDIT_INTERVAL": "Edit Interval", - "DELETE_APP": "Delete Application", - "INTERVALS": "Intervals", - "USER": "User", + "EDIT_APP": "Uredi Aplikaciju", + "EDIT_INTERVAL": "Uredi Interval", + "DELETE_APP": "Izbriši Aplikaciju", + "INTERVALS": "Intervali", + "USER": "Korisnik", "TRUNK": "Trunk", - "PHONE": "Phone", - "AUDIO_FILES": "Audio Files", - "ANNOUNCE_OVERRIDES": "Announce Overrides", - "MACRO": "Macro", + "PHONE": "Telefon", + "AUDIO_FILES": "Audio Datoteke", + "ANNOUNCE_OVERRIDES": "Najave Nadjačavanja", + "MACRO": "Makro", "GOSUB": "GoSub", - "RULE": "Rule", - "POSITION": "Position", - "ANSWER": "Answer", - "VALUE": "Value", - "MAILBOX@CONTEXT": "Mailbox@Context", - "EXTENSION": "Extension", - "PRIORITY": "Priority", - "HANGUP_CAUSE": "Hangup Cause", - "OUTBOUNDDIAL": "Outbound Dial", - "CALLER_ID": "Caller ID", - "NO_MESSAGE_AVAILABLE": "No messages available", - "NO_SOUND_AVAILABLE": "No sounds available", - "VOICERECORDINGS": "Voice Recordings", + "RULE": "Pravilo", + "POSITION": "Pozicija", + "ANSWER": "Odgovori", + "VALUE": "Vrijednost", + "MAILBOX@CONTEXT": "Poštanskosanduče@Kontekst", + "EXTENSION": "Ekstenzija", + "PRIORITY": "Prioritet", + "HANGUP_CAUSE": "Hangup Razlog", + "OUTBOUNDDIAL": "Odlazno Biranje", + "CALLER_ID": "Pozivatelj ID", + "NO_MESSAGE_AVAILABLE": "Nema dostupnih poruka", + "NO_SOUND_AVAILABLE": "Nema dostupnih zvukova", + "VOICERECORDINGS": "Voice Snimci", "CHANSPIES": "ChanSpy", "VOICE": "Voice", "REALTIME": "Realtime", - "ID": "Id", - "VOICEMAIL_CONTEXT": "Context", - "NO_MOHSOUND_AVAILABLE": "No Music On Hold available", - "FILE": "File", - "ADD_MOHSOUND": "Add Music On Hold sound", - "DOWNLOAD_MOHSOUND": "Download Music On Hold sound", - "DELETE_MOHSOUND": "Delete Music On Hold sound", - "UNIQUEID": "Unique ID", - "AGENT": "Agent", - "TYPE": "Type", - "RATING": "Rating", + "ID": "ID", + "VOICEMAIL_CONTEXT": "Kontekst", + "NO_MOHSOUND_AVAILABLE": "Nema dostupne Muzike Na Čekanju", + "FILE": "Datoteka", + "ADD_MOHSOUND": "Dodaj Muzika Na Čekanju zvuk ", + "DOWNLOAD_MOHSOUND": "Skini Muzika Na Čekanju zvuk", + "DELETE_MOHSOUND": "Izbriši Muzika Na Čekanju zvuk", + "UNIQUEID": "Jedinstveni ID", + "AGENT": "Specijalist", + "TYPE": "Vrsta", + "RATING": "Ocjena", "AUDIO": "Audio", - "DATE": "Date", - "NEW_VOICEQUEUE": "New Voice Queue", - "NEW_INBOUNDROUTE": "New Inbound Route", - "NEW_OUTBOUNDROUTE": "New Outbound Route", - "NEW_INTERNALROUTE": "New Internal Route", - "NEW_CONTEXT": "New Context", - "NEW_VOICEMAIL": "New Voicemail", - "NEW_MUSICONHOLD": "New Music On Hold", - "NEW_CHANSPY": "New ChanSpy", - "PENALTY": "Penalty", - "ADD_TEAM_TO_VOICEQUEUE": "Add Team to Voice Queue", - "ADD_AGENT_TO_VOICEQUEUE": "Add Agent to Voice Queue", - "EDIT_DIAL": "Edit Dial", - "EDIT_AGI": "Edit AGI", - "EDIT_INTERNALDIAL": "Edit Internal Dial", - "EDIT_EXTERNALDIAL": "Edit External Dial", - "EDIT_RINGGROUP": "Edit Ring Group", - "EDIT_PLAYBACK": "Edit Playback", - "EDIT_QUEUE": "Edit Queue", - "EDIT_SET": "Edit Set", - "EDIT_GOTO": "Edit GoTo", - "EDIT_HANGUP": "Edit Hangup", - "EDIT_CUSTOM": "Edit Custom", - "DURATION": "Duration", - "RECEIVED_AT": "Received At", - "YES": "Yes", - "NO": "No", - "HANGUPCAUSE_1": "1 = Unallocated number", - "HANGUPCAUSE_16": "16 = Normal call clearing", - "HANGUPCAUSE_17": "17 = User busy", - "HANGUPCAUSE_18": "18 = No user responding (telehone device not connected)", - "HANGUPCAUSE_21": "21 = Call rejected", - "HANGUPCAUSE_22": "22 = Number changed", - "HANGUPCAUSE_27": "27 = Destination out of order", - "HANGUPCAUSE_38": "38 = Network out of order", - "HANGUPCAUSE_41": "41 = Temporary failure", - "RANDOM": "Random", - "ALPHABETICAL": "Alphabetical", - "NO_APPS_AVAILABLE": "No applications available", - "DOWNLOAD_VOICERECORDING": "Download Voice Recording", - "DELETE_VOICERECORDING": "Delete Voice Recording", - "INTERNAL": "Internal", - "PHONE_STATE": "Phone State", - "PHONE_STATUS": "Phone Status", - "REGISTERED": "Registered", - "UNREGISTERED": "Unregistered", - "LAGGED": "Lagged", - "REACHABLE": "Reachable", - "UNREACHABLE": "Unreachable", - "UNKNOWN": "Unknown", - "NOT_INUSE": "Not in use", - "INUSE": "In Use", - "BUSY": "Busy", - "INVALID": "Invalid", - "UNAVAILABLE": "Unavailable", - "RINGING": "Ringing", - "ONHOLD": "On Hold", - "RING": "Ring", - "UP": "Up", + "DATE": "Datum", + "NEW_VOICEQUEUE": "Novi Voice Queue", + "NEW_INBOUNDROUTE": "Nova Dolazna Ruta", + "NEW_OUTBOUNDROUTE": "Nova Odlazna Ruta", + "NEW_INTERNALROUTE": "Nova Interna Ruta", + "NEW_CONTEXT": "Novi Kontekst", + "NEW_VOICEMAIL": "Nova Govorna Pošta", + "NEW_MUSICONHOLD": "Nova Muzika Na Čekanju", + "NEW_CHANSPY": "Novi ChanSpy", + "PENALTY": "Kazna", + "ADD_TEAM_TO_VOICEQUEUE": "Dodaj Tim u Voice Queue", + "ADD_AGENT_TO_VOICEQUEUE": "Dodaj Specijalistu u Voice Queue", + "EDIT_DIAL": "Uredi Biranje", + "EDIT_AGI": "Uredi AGI", + "EDIT_INTERNALDIAL": "Uredi Interno Biranje", + "EDIT_EXTERNALDIAL": "Uredi Eksterno Biranje", + "EDIT_RINGGROUP": "Uredi Ring Grupu", + "EDIT_PLAYBACK": "Uredi Reprodukciju", + "EDIT_QUEUE": "Uredi Queue", + "EDIT_SET": "Uredi Postavljanje", + "EDIT_GOTO": "Uredi GoTo", + "EDIT_HANGUP": "Uredi Hangup", + "EDIT_CUSTOM": "Uredi Prilagođeno", + "DURATION": "Trajanje", + "RECEIVED_AT": "Primljeno U", + "YES": "Da", + "NO": "Ne", + "HANGUPCAUSE_1": "1 = Nedodijeljen broj", + "HANGUPCAUSE_16": "16 = Normalno brisanje poziva", + "HANGUPCAUSE_17": "17 = Korisnik zauzet", + "HANGUPCAUSE_18": "18 = Korisnik ne odgovara (telefonski uređaj nije povezan)", + "HANGUPCAUSE_21": "21 = Poziv odbijen", + "HANGUPCAUSE_22": "22 = Broj promijenjen", + "HANGUPCAUSE_27": "27 = Odredište poremećeno", + "HANGUPCAUSE_38": "38 = Mreža poremećena", + "HANGUPCAUSE_41": "41 = Privremeno neuspješno", + "RANDOM": "Nasumično", + "ALPHABETICAL": "Abecedno", + "NO_APPS_AVAILABLE": "Nema dostupnih aplikacija", + "DOWNLOAD_VOICERECORDING": "Skini Voice Snimanje", + "DELETE_VOICERECORDING": "Izbriši Voice Snimak", + "INTERNAL": "Interno", + "PHONE_STATE": "Stanje Telefona", + "PHONE_STATUS": "Status Telefona", + "REGISTERED": "Registrovan", + "UNREGISTERED": "Neregistrovan", + "LAGGED": "Zaostao", + "REACHABLE": "Dostupno", + "UNREACHABLE": "Nedostupan", + "UNKNOWN": "Nepoznato", + "NOT_INUSE": "Nije u upotrebi", + "INUSE": "U Upotrebi", + "BUSY": "Zauzet", + "INVALID": "Nevažeći", + "UNAVAILABLE": "Nedostupno", + "RINGING": "Zvoniti", + "ONHOLD": "Na Čekanju", + "RING": "Zvono", + "UP": "Gore", "INFO": "Info", - "TRUNKS": "Trunks", - "REGISTRY": "Registry", - "NO_REGISTRY": "No registry", - "LOGGED_IN": "Logged in (SIP connected)", - "PAUSED": "Paused", - "DISPOSITION": "Disposition", - "WAITING": "Waiting", - "TALKING": "Talking", + "TRUNKS": "Trunkovi", + "REGISTRY": "Registar", + "NO_REGISTRY": "Nema registra", + "LOGGED_IN": "Prijavljen (SIP povezan)", + "PAUSED": "Pauzirano", + "DISPOSITION": "Dispozicija", + "WAITING": "Čeka", + "TALKING": "Priča", "DID": "DID", - "CALLER": "Caller", - "TOTAL": "Total", - "ANSWERED": "Answered", - "ABANDONED": "Abandoned", - "UNMANAGED": "Unmanaged", - "REDIRECT_TO_NUMBER": "Redirect to a number", - "REDIRECT_TO_AGENT": "Redirect to an agent", - "CLOSING": "Closing", - "AVG_HOLD_TIME": "Avg Hold Time", - "AVG_DURATION": "Avg Duration", - "AVG_BILLABLE": "Avg Billable", - "SOURCE": "Source", - "DESTINATION": "Destination", - "REJECTED": "Rejected", - "FAILED": "Failed", - "CALLED": "Called", - "CONNECTED": "Connected", - "NO_RATING": "No rating", - "EDIT_VOICERECORDING": "Edit Voice Recording", - "APPLICATION_NAME": "Application Name", - "ARGUMENTS": "Arguments", - "EDIT_QUEUECAMPAIGN": "Edit Campaign", - "LISTADD_QUEUECAMPAIGN": "Add List", - "BLACKLISTADD_QUEUECAMPAIGN": "Add Blacklist", - "TEAMADD_QUEUECAMPAIGN": "Add Team", - "AGENTADD_QUEUECAMPAIGN": "Add Agent", - "DELETE_QUEUECAMPAIGN": "Delete Campaign", - "DELETE_IVRCAMPAIGN": "Delete Campaign", - "EDIT_IVRCAMPAIGN": "Edit Campaign", - "NEW_IVRCAMPAIGN": "New IVR Campaign", - "ADD_IVRCAMPAIGN": "Add IVR Campaign", - "LISTADD_IVRCAMPAIGN": "Add List", - "BLACKLISTADD_IVRCAMPAIGN": "Add Blacklist", - "ENABLED": "Enabled", - "READY": "Ready", - "PAUSE": "Pause", - "UNPAUSE": "End Pause", - "DEFAULT_PAUSE": "Default Pause", - "AGENTADD_QUEUE": "Add Agent to queue campaign", - "AGENTSADD_QUEUE": "Add Agents to queue campaign", - "ALL_TEAMS": "All Teams", - "SELECTED_TEAMS": "Selected Teams", - "ALL_LISTS": "All Lists", - "SELECTED_LISTS": "Selected Lists", - "ALL_AGENTS": "All Agents", - "SELECTED_AGENTS": "Selected Agents", - "WAITING_FOR_AGENT": "Waiting for Agent", - "TOTAL_OFFERED": "Total Offered", - "RUNNING": "Running", - "TRUNK_IS_NOT_REACHABLE": "Trunk is Not Reachable", - "AGENTS_NOT_LOGGED": "Agent not logged", - "NOT_ACTIVE": "Not Active", - "IS_DISACTIVED": "Deactivated", + "CALLER": "Pozivatelj", + "TOTAL": "Ukupno", + "ANSWERED": "Odgovoreno", + "ABANDONED": "Napušteno", + "UNMANAGED": "Neupravljan", + "REDIRECT_TO_NUMBER": "Preusmjeri na broj", + "REDIRECT_TO_AGENT": "Preusmjeri na Specijalistu", + "CLOSING": "Zatvaranje", + "AVG_HOLD_TIME": "Prosječno Vrijeme Čekanja", + "AVG_DURATION": "Prosječno Trajanje", + "AVG_BILLABLE": "Prosječno Naplativo", + "SOURCE": "Izvor", + "DESTINATION": "Odredište", + "REJECTED": "Odbijeno", + "FAILED": "Neuspješno", + "CALLED": "Zvao", + "CONNECTED": "Povezano", + "NO_RATING": "Nema ocjene", + "EDIT_VOICERECORDING": "Uredi Voice Snimanje", + "APPLICATION_NAME": "Naziv Aplikacije", + "ARGUMENTS": "Argumenti", + "EDIT_QUEUECAMPAIGN": "Uredi Kampanju", + "LISTADD_QUEUECAMPAIGN": "Dodaj Listu", + "BLACKLISTADD_QUEUECAMPAIGN": "Dodaj Crnu Listu", + "TEAMADD_QUEUECAMPAIGN": "Dodaj Tim", + "AGENTADD_QUEUECAMPAIGN": "Dodaj Specijalistu", + "DELETE_QUEUECAMPAIGN": "Izbriši Kampanju", + "DELETE_IVRCAMPAIGN": "Izbriši Kampanju", + "EDIT_IVRCAMPAIGN": "Uredi Kampanju", + "NEW_IVRCAMPAIGN": "Nova IVR Kampanja", + "ADD_IVRCAMPAIGN": "Dodaj IVR Kampanju", + "LISTADD_IVRCAMPAIGN": "Dodaj Listu", + "BLACKLISTADD_IVRCAMPAIGN": "Dodaj Crnu Listu", + "ENABLED": "Omogućeno", + "READY": "Spreman", + "PAUSE": "Pauza", + "UNPAUSE": "Prekini Pauzu", + "DEFAULT_PAUSE": "Zadana Pauza", + "AGENTADD_QUEUE": "Dodaj Specijalistu u queue kampanju ", + "AGENTSADD_QUEUE": "Dodaj Specijalistu u queue kampanju ", + "ALL_TEAMS": "Svi Timovi", + "SELECTED_TEAMS": "Odabrani Timovi", + "ALL_LISTS": "Sve Liste", + "SELECTED_LISTS": "Odabrane Liste", + "ALL_AGENTS": "Svi Specijalisti", + "SELECTED_AGENTS": "Odabrani Specijalisti", + "WAITING_FOR_AGENT": "Čeka na Specijalistu", + "TOTAL_OFFERED": "Ukupno Ponuđeno", + "RUNNING": "Pokrenuto", + "TRUNK_IS_NOT_REACHABLE": "Trunk Nije Dostupan", + "AGENTS_NOT_LOGGED": "Specijalist nije prijavljen", + "NOT_ACTIVE": "Nije Aktivno", + "IS_DISACTIVED": "Deaktivirano", "BACKUPTRUNK": "Backup Trunk", - "GLOBALINTERVAL": "Global Interval", - "RESCHEDULED_CONTACTS": "Rescheduled contacts", - "INTERVAL_IS_OVERTIME": "Out of Interval", - "GLOBAL_INTERVAL_IS_OVERTIME": "Out of Interval (Global)", - "INTERVAL_IS_NULL": "Interval is Null", - "TIMEZONE_UNKNOW": "Timezone Unknow", - "INTERVAL_IS_EMPTY": "Interval is Empty", - "TOTAL_MANAGED": "Total Managed", - "OPEN": "Open", - "FRESH": "Fresh", - "CLOSED": "Closed", - "ALWAYS": "Always", - "NEVER": "Never", - "ONLY_IF_OPEN": "Only If Open", - "CHECKDUPLICATE": "Check Duplicate", - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", + "GLOBALINTERVAL": "Globalni Interval", + "RESCHEDULED_CONTACTS": "Ponovo zakazati contakti", + "INTERVAL_IS_OVERTIME": "Van Intervala", + "GLOBAL_INTERVAL_IS_OVERTIME": "Van Intervala (Globalno)", + "INTERVAL_IS_NULL": "Interval je Nula", + "TIMEZONE_UNKNOW": "Vremenska Zona Nepoznata", + "INTERVAL_IS_EMPTY": "Interval je Prazan", + "TOTAL_MANAGED": "Ukupno Upravljano", + "OPEN": "Otvori", + "FRESH": "Svježe", + "CLOSED": "Zatvoreno", + "ALWAYS": "Uvijek", + "NEVER": "Nikada", + "ONLY_IF_OPEN": "Samo Ako Je Otvoreno", + "CHECKDUPLICATE": "Provjeri Duplikate", + "PAGE": "Stranica", + "ROWSPERPAGE": "Redova po stranici", + "OF": "od", "CHAT": "Chat", - "MAIL": "Email", + "MAIL": "E-Mail", "SMS": "SMS", - "OPENCHANNEL": "Open Channel", + "OPENCHANNEL": "Otvoreni Kanal", "FAX": "Fax", - "TEAMS_ASSOCIATION": "Teams Association", - "MANDATORYDISPOSITION": "Mandatory disposition", - "MANDATORYDISPOSITIONPAUSEID": "Mandatory disposition pause status", - "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", - "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available", - "PREVIEW_AUTO_RECALL_ME": "Automate Recall Me calls" + "TEAMS_ASSOCIATION": "Asocijacija Timova", + "MANDATORYDISPOSITION": "Obavezna dispozicija", + "MANDATORYDISPOSITIONPAUSEID": "Obavezna dispozicija status pauze", + "TOOLTIP_SCREENRECORDING_ON": "Snimanje Ekrana u toku", + "TOOLTIP_SCREENRECORDING_OFF": "Snimanje Ekrana dostupno", + "PREVIEW_AUTO_RECALL_ME": "Automatizuj Recall Me pozive" } } diff --git a/public/app/main/apps/motiondialer/i18n/et.json b/public/app/main/apps/motiondialer/i18n/et.json index db6abd5..3b207cb 100644 --- a/public/app/main/apps/motiondialer/i18n/et.json +++ b/public/app/main/apps/motiondialer/i18n/et.json @@ -239,7 +239,9 @@ "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Väärtus peab olema väiksem või võrdne", "NOSUCHNUMBERMAXRETRY_REQUIRED": "Kohustuslik väli", "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Väärtus peab olema väiksem või võrdne", - "NOSUCHNUMBERRETRYTIME_REQUIRED": "Kohustuslik väli" + "NOSUCHNUMBERRETRYTIME_REQUIRED": "Kohustuslik väli", + "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Helista add.phone min. peaks olema suurem või võrdne", + "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "Kohustuslik väli" }, "GENERAL": "Üldine", "AGENTTIMEOUT": "Agendi Aegumine", @@ -691,6 +693,8 @@ "SECOND_LEVEL_DISPOSITION": "Teise taseme kasutamine", "THIRD_LEVEL_DISPOSITION": "Kolmanda taseme kasutamine", "PREVIEW_AUTO_RECALL_ME": "Automatiseerige Call Me kõned", - "PREVIEW_RECALL_ME_REMINDER": "Tuleta mulle meelde" + "PREVIEW_RECALL_ME_REMINDER": "Tuleta mulle meelde", + "ADDITIONALPHONES": "Lisatelefonid", + "CALLADDITIONALPHONEAFTERMIN": "Helistage veel pärast [min]" } } diff --git a/public/app/main/apps/motiondialer/i18n/is.json b/public/app/main/apps/motiondialer/i18n/is.json new file mode 100644 index 0000000..6b63309 --- /dev/null +++ b/public/app/main/apps/motiondialer/i18n/is.json @@ -0,0 +1,701 @@ +{ + "MOTIONDIALER": { + "SECOND_LEVEL_DISPOSITION": "Second Level Disposition", + "THIRD_LEVEL_DISPOSITION": "Third Level Disposition", + "ONE_CALL_EVERY": "One call every", + "CURRENT_INTERVAL": "Current Interval", + "PREVIOUS_INTERVAL": "Previous Interval", + "PREDICTIVE_IS_RUNNING": "Predictive is running", + "PREDICTIVE_IS_NOT_RUNNING": "Predictive is not running", + "DATA_COLLECTION_IN_PROGRESSIVE": "Data collection in Progressive", + "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "Show Predictive Info", + "AVG_TALK_TIME": "Avg Talk Time", + "ANSWERED_CALLS": "Answered Calls", + "TOTAL_CALLS": "Total Calls", + "THRESHOLDS": "Thresholds", + "PREDICTIVEMAXTHRESHOLD": "Predictive Max Threshold [%]", + "PREDICTIVEMINTHRESHOLD": "Predictive Min Threshold [%]", + "REFRESH_SCHEDULED_CALLS": "Refresh Scheduled Calls", + "RECALLINQUEUE": "Recall in queue", + "SELECT_DATE": "Select Date", + "SELECT_TYPE": "Select Type", + "SELECT_CAMPAIGN": "Select Campaign", + "SCHEDULED_CALLS": "Scheduled Calls", + "LOGIN_TIME": "Login time", + "PAUSE_TIME": "Pause time", + "PREVIEW_RECALL_ME_REMINDER": "Recall Me Reminder", + "CUTDIGIT": "Cut Digits", + "RANDOMLASTDIGITCALLERIDNUMBER": "Random Outgoing CallerId Number", + "CLONE_IVRCAMPAIGN": "Clone Campaign", + "CLONE_QUEUECAMPAIGN": "Clone Queue Campaign", + "ABANDONEDCALLS": "Abandoned Queue Calls", + "HOPPERWIDGET": "Summary", + "RESETLIST_IVRCAMPAIGN": "Reset Lists", + "RESETLIST_QUEUECAMPAIGN": "Reset Lists", + "RESET": "Reset", + "RESETLIST": "Reset Lists", + "SELECTALL": "Select All", + "UNSELECTALL": "Un-Select All", + "NO_AVAILABLE_INFO": "No available info", + "TIMEOUT": "Timeout", + "CALLYSQUAREPROJECTPREVIEW": "Cally Square Project Preview", + "CALLYSQUAREPROJECTPREVIEW2": "Cally Square Project After Preview", + "RUNIFHANGUPAGENT": "Run Cally Square Project After even if the agent hangs up the call", + "CALLYSQUAREPROJECT2": "Cally Square Project After Queue", + "NO_AGENT_ONLINE": "No Agent Online", + "PARTIALPAUSE": "Parital Pause", + "ALL": "All", + "IDLE": "Idle", + "TIMER": "Timer", + "MOVE_HOPPERFINAL": "Restore contact", + "RESTORECONTACTS": "Restore Contacts", + "NO_SUCH_NUMBER": "No Such Number", + "ANSWERING_MACHINE": "Answering machine", + "DIALORDERBYSCHEDULEDAT": "Order By scheduledat", + "ASC": "ASC", + "DESC": "DESC", + "RECALLAGENT": "Recall Agent", + "DIALRECALLINQUEUE": "Recall In Queue", + "DIALRECALLMETIMEOUT": "Recall Me Timeout [min]", + "RECALLME": "Recall Me", + "RECALLFAILEDTIMEOUT": "Recall Failed", + "PREVIEW_CAMPAIGN": "Preview Campaigns", + "PREVIEW_CAMPAIGNS": "Preview Campaigns", + "AMD": "Asterisk Answering Machine Detection (AMD)", + "AMDTOTALANALYSISTIME": "Total Analysis Time", + "AMDACTIVE": "AMD", + "AMDINITIALSILENCE": "Initial Silence", + "AMDGREETING": "Greeting", + "AMDAFTERGREETINGSILENCE": "Silence after Greeting", + "AMDSILENCETHRESHOLD": "Silence Threshold", + "AMDMINWORDLENGTH": "Min Word Length", + "AMDBETWEENWORDSSILENCE": "Silence Between Words", + "AMDMAXIMUMWORDLENGTH": "Maximum Word Length", + "AMDMAXIMUMNUMBEROFWORDS": "Maximum Number Of Words", + "GOTO_QUEUECAMPAIGN": "Go To Realtime Queue Campaigns", + "GOTOREALTIME_QUEUECAMPAIGN": "Go To Realtime Queue Campaigns", + "GOTO_IVRCAMPAIGN": "Go To Realtime IVR Campaigns", + "GOTOREALTIME_IVRCAMPAIGN": "Go To Realtime IVR Campaigns", + "LOGOUT": "Logout", + "EDIT_CAMPAIGN": "Edit Campaign", + "LIMITED": "Limited", + "IVR_CAMPAIGNS": "IVR Campaigns", + "MOTIONDIALER": "Motion Bull", + "QUEUECAMPAIGNS": "Queue Campaigns", + "IVRCAMPAIGNS": "IVR Campaigns", + "MANAGED": "Managed", + "AVAILABLE_CONTACTS_FINISHED": "Available contacts finished", + "HISTORY": "History", + "SCHEDULEDAT": "Scheduled At", + "HOPPERBLACKS": "Hopper Blacklist", + "NO_HOPPERBLACK_AVAILABLE": "No items available", + "HOPPERFINALS": "Hopper Final", + "NO_HOPPERFINAL_AVAILABLE": "No items available", + "HOPPERHISTORIES": "Call history", + "NO_HOPPERHISTORY_AVAILABLE": "No items available", + "DELETE_HOPPERHISTORY": "Delete", + "DELETE_HOPPERFINAL": "Delete", + "CONTACTID": "Contact ID", + "STARTTIME": "Start Time", + "RESPONSETIME": "Response Time", + "ENDTIME": "End Time", + "STATUS": "Status", + "HOPPERS": "Hopper", + "NO_HOPPER_AVAILABLE": "No items available", + "EDIT_HOPPER": "Edit Hopper", + "DELETE_HOPPER": "Delete Hopper", + "FINAL": "Final", + "BLACKLIST": "Blacklist", + "NAME": "Name", + "VOICEQUEUES": "Voice Queues", + "SEARCH_FOR_ANYONE": "Search", + "BACK": "Back", + "SELECTED": "Selected", + "SELECT_ALL": "Select All", + "SELECT_NONE": "Select None", + "DELETE_VOICEDISPOSITION": "Delete Voice Disposition", + "EDIT_VOICEDISPOSITION": "Edit Voice Disposition", + "EDIT_VOICEQUEUE": "Edit Voice Queue", + "DELETE_VOICEQUEUE": "Delete Voice Queue", + "MOHSOUNDS": "Moh Sounds", + "STRATEGY": "Strategy", + "DESCRIPTION": "Description", + "INTERVAL": "Time Interval", + "ADD_VOICEQUEUE": "Add Voice Queue", + "NEW_QUEUECAMPAIGN": "New Queue Campaign", + "ACTIVE": "Active", + "METHOD": "Method", + "POWERLEVEL": "Power Level", + "DROPRATE": "Drop Rate", + "AGENTBUSYFACTOR": "Agent Busy Factor", + "PREDICTIVEOPTIMIZATION": "Predictive Optimization", + "PREDICTIVEOPTIMIZATIONPERCENTAGE": "Predictive Optimization Percentage", + "PREDICTIVEINTERVAL": "Predictive Interval", + "ADD_QUEUECAMPAIGN": "Add Queue Campaign", + "CAMPAIGN": "Campaign", + "MAXCONCURRENTCALLS": "Max Concurrent Calls", + "CONCURRENTCALLS": "Max Concurrent Calls", + "ORIGINATE": "Originate", + "ORIGINATECALLERIDNAME": "Caller ID Name", + "ORIGINATECALLERIDNUMBER": "Caller ID Number", + "ORIGINATETIMEOUT": "Originate Timeout", + "QUEUEOPTIONS": "Queue Options", + "QUEUETIMEOUT": "Queue Timeout", + "CALLYSQUAREPROJECT": "Cally Square Project", + "RETRYANDFREQUENCY": "Retry Settings", + "GLOBAL": "Global", + "GLOBALMAXRETRY": "Max Retries", + "CONGESTION": "Congestion", + "CONGESTIONMAXRETRY": "Max Retries", + "CONGESTIONRETRYTIME": "Retry Time [min]", + "BUSYMAXRETRY": "Max Retries", + "BUSYRETRYTIME": "Retry Time [min]", + "NOANSWER": "No Answer", + "NOANSWERMAXRETRY": "Max Retries", + "NOANSWERRETRYTIME": "Retry Time [min]", + "NOSUCHNUMBER": "No such number", + "NOSUCHNUMBERMAXRETRY": "Max Retries", + "NOSUCHNUMBERRETRYTIME": "Retry Time [min]", + "DROP": "Drop", + "DROPMAXRETRY": "Max Retries", + "DROPRETRYTIME": "Retry Time [min]", + "ABANDONEDMAXRETRY": "Max Retries", + "ABANDONEDRETRYTIME": "Retry Time [min]", + "MACHINE": "Machine", + "MACHINEMAXRETRY": "Max Retries", + "MACHINERETRYTIME": "Retry Time [min]", + "AGENTREJECT": "Agent Reject", + "AGENTREJECTMAXRETRY": "Max Retries", + "AGENTREJECTRETRYTIME": "Retry Time [min]", + "CALLADDITIONALPHONEAFTERMIN": "Call additional phone after [min]", + "ADDITIONALPHONES": "Additional phones", + "QUEUE_PARAMS": "Queue Parameters", + "ORIGINATED": "Originated", + "MESSAGE": "Message", + "DROPPED": "Dropped", + "CREATED_AT": "Created At", + "LEGEND": { + "CUSTOM_APPLICATION": "(*) - Custom application." + }, + "ERRORS": { + "AGENT_REQUIRED": "Mandatory field", + "CUTDIGIT_REQUIRED": "Mandatory field", + "CUTDIGIT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "CUTDIGIT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "RANDOMLASTDIGITCALLERIDNUMBER_REQUIRED": "Mandatory field", + "RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "AGENTTIMEOUT_REQUIRED": "Mandatory field", + "INTERVAL_REQUIRED": "Mandatory field", + "EMAIL_REQUIRED": "Mandatory field", + "DIALRECALLMETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "DIALRECALLMETIMEOUT_REQUIRED": "Mandatory field", + "NAME_MUST_VALID_PATTERN": "Wrong format", + "PREFIX_MUST_VALID_PATTERN": "Wrong format", + "NAME_REQUIRED": "Mandatory field", + "TIMEOUT_REQUIRED": "Mandatory field", + "PHONENUMBER_REQUIRED": "Mandatory field", + "CONTEXT_REQUIRED": "Mandatory field", + "DESTINATIONPATTERN_REQUIRED": "Mandatory field", + "FULLNAME_REQUIRED": "Mandatory field", + "EMAIL_REQUUIRED": "Mandatory field", + "EMAIL_MUST_VALID": "Wrong format", + "MAILBOX_REQUIRED": "Mandatory Field", + "PASSWORD_REQUIRED": "Mandatory field", + "CONFIRM_NOT_MATCH": "The passwords don't match", + "TIMEZONE_REQUIRED": "Mandatory field", + "PREFIX_REQUIRED": "Mandatory field", + "OPTIONS_REQUIRED": "Mandatory field", + "AFTERCALLWORKDURATION_REQUIRED": "Mandatory field", + "TECHNOLOGY/RESOURCE_REQUIRED": "Mandatory field", + "PHONE_REQUIRED": "Mandatory field", + "VALUE_REQUIRED": "Mandatory field", + "EXTENSION_REQUIRED": "Mandatory field", + "PRIORITY_REQUIRED": "Mandatory field", + "GLOBALMAXRETRY_REQUIRED": "Mandatory field", + "CONGESTIONMAXRETRY_REQUIRED": "Mandatory field", + "CONGESTIONRETRYTIME_REQUIRED": "Mandatory field", + "BUSYMAXRETRY_REQUIRED": "Mandatory field", + "BUSYRETRYTIME_REQUIRED": "Mandatory field", + "NOANSWERMAXRETRY_REQUIRED": "Mandatory field", + "NOANSWERRETRYTIME_REQUIRED": "Mandatory field", + "QUEUETIMEOUT_REQUIRED": "Mandatory field", + "ORIGINATETIMEOUT_REQUIRED": "Mandatory field", + "GLOBALINTERVAL_REQUIRED": "Mandatory field", + "MAXCONCURRENTCALLS_REQUIRED": "Mandatory field", + "CONCURRENTCALLS_REQUIRED": "Mandatory field", + "NOSUCHNUMBERMAXRETRY_REQUIRED": "Mandatory field", + "NOSUCHNUMBERRETRYTIME_REQUIRED": "Mandatory field", + "DROPMAXRETRY_REQUIRED": "Mandatory field", + "DROPRETRYTIME_REQUIRED": "Mandatory field", + "ABANDONEDMAXRETRY_REQUIRED": "Mandatory field", + "ABANDONEDRETRYTIME_REQUIRED": "Mandatory field", + "MACHINEMAXRETRY_REQUIRED": "Mandatory field", + "MACHINERETRYTIME_REQUIRED": "Mandatory field", + "AGENTREJECTMAXRETRY_REQUIRED": "Mandatory field", + "AGENTREJECTRETRYTIME_REQUIRED": "Mandatory field", + "POWERLEVEL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "PREDICTIVEOPTIMIZATIONPERCENTAGE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "PREDICTIVEINTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "MAXCONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "ORIGINATETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "QUEUETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "AGENTTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "GLOBALMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "CONGESTIONMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "CONGESTIONRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "BUSYMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "BUSYRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "NOANSWERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "NOANSWERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "CONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "POWERLEVEL_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "PREDICTIVEOPTIMIZATIONPERCENTAGE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "PREDICTIVEINTERVAL_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "MAXCONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "ORIGINATETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "QUEUETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "GLOBALMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "CONGESTIONMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "CONGESTIONRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "BUSYMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "BUSYRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "NOANSWERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "NOANSWERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "DROPMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "DROPRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "ABANDONEDMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "ABANDONEDRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "AGENTREJECTMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "AGENTREJECTRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "CONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Mandatory field", + "CALLYSQUAREPROJECT_REQUIRED": "Mandatory field", + "TRUNK_REQUIRED": "Mandatory field", + "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "Mandatory field", + "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Call add.phone after min. should be greater than or equal to" + }, + "GENERAL": "General", + "AGENTTIMEOUT": "Agent Timeout", + "MAXLENGTH": "Maximum Length", + "RETRY": "Retry", + "WRAPUPTIME": "Wrapup Time", + "WEIGHT": "Weight", + "JOINWHENEMPTY": "Join when empty", + "LEAVEWHENEMPTY": "Leave when empty", + "HELP": { + "PREDICTIVEMAXTHRESHOLD": "If the percentage of agents available in the time window, compared to the agents available at the time of prediction, exceeds the configured maximum limit, the predictive recalculates the prediction. ", + "PREDICTIVEMINTHRESHOLD": "If the percentage of agents available in the time window, compared to the agents available at the time of prediction, exceeds the configured minimum limit, the predictive recalculates the prediction.", + "RANDOMLASTDIGITCALLERIDNUMBER": "If greater than 0, it generates randomly the corresponding last digits of the Outgoing Caller Id Number", + "TIMEOUT": "Number of seconds to ring agent in queue", + "CALLYSQUAREPROJECTPREVIEW": "Selecting an IVR project, the dialer will forward the call to the IVR when an agent answers (the IVR will be directed to the agent)", + "CALLYSQUAREPROJECTPREVIEW2": "Selecting an IVR project, the dialer will forward the call to the IVR when an client hangup or unreachable (the IVR will be directed to the agent)", + "RUNIFHANGUPAGENT": "Run Cally Square Project After even if the agent hangs up the call", + "CALLYSQUAREPROJECT2": "Selecting an IVR project, the dialer will forward the call to the IVR after the queue (if the queue ends by timeout)", + "DIALORDERBYSCHEDULEDAT": "Get contacts from hopper (descending or ascending).", + "DIALRECALLINQUEUE": "Reschedule call for agents in the Queue", + "DIALRECALLMETIMEOUT": "Time interval (in minutes) for Recall Me period of validity", + "PRIORITY": "Priority in the list", + "TIMEZONE": "Specify timezone", + "PREVIEW_RECALL_ME_REMINDER": "If enabled, the system will send a notification to the agent n minutes (according to time interval set in general settings) before generating the recall me", + "AMDMAXIMUMWORDLENGTH": "Maximum duration allowed of a single Voice utterance", + "AMDMINWORDLENGTH": "Minimum duration of a Voice to be considered a word", + "AMDSILENCETHRESHOLD": "If the average level of noise in a sample does not reach this value, from a scale of 0 to 32767, then we will consider it as silence", + "AMDTOTALANALYSISTIME": "Maximum time allowed for the algorithm to decide on whether the audio represents a HUMAN or a MACHINE", + "AMDAFTERGREETINGSILENCE": "Silence after detecting a greeting. If exceeded, then the result is detection as a HUMAN", + "AMDGREETING": "Maximum length of a greeting. If exceeded, then the result is detection as a MACHINE", + "AMDINITIALSILENCE": "Maximum silence duration before the greeting. If exceeded, then the result is detection as a MACHINE", + "AMDACTIVE": "Activate or disactivate answering machines detection attempts", + "AMDBETWEENWORDSSILENCE": "Minimum duration of silence after a word to consider the audio that follows as a new word", + "AMDMAXIMUMNUMBEROFWORDS": "Maximum number of words in the greeting. If REACHED, then the result is detection as a MACHINE", + "CALLYSQUAREPROJECT": "Selecting an IVR project, the dialer will forward the call to the IVR before the queue", + "PREFIX": "Telephone prefix", + "ACTIVE": "Active", + "AGENTTIMEOUT": "How long (in seconds) to ring an agent’s device", + "MAXLENGTH": "Maximum number of callers allowed to be waiting in a queue (0=unlimited)", + "RETRY": "How long (in seconds) to wait before calling the next agent in the queue when the agent timeout is expired", + "WRAPUPTIME": "How long (in seconds) to keep an agent unavailable in a queue after completing a call", + "WEIGHT": "Used to determine priority if the agents are associated with more than one queue", + "JOINWHENEMPTY": "If a caller is added to the queue, when no agents are available", + "LEAVEWHENEMPTY": "If a caller is expelled from the queue when no agents are available", + "ANNOUNCEFREQUENCY": "How often to announce the caller’s position and/or estimated hold time in the queue (0=disable)", + "MINANNOUNCEFREQUENCY": "Minimum announcement frequency (useful when the caller’s position changes frequently)", + "PERIODICANNOUNCEFREQUENCY": "Frequency of periodic announcements to the caller", + "ANNOUNCEPOSITIONLIMIT": "Used if you’ve defined announce-position as either 'limit' or 'more'", + "AFTERCALLWORKDURATION": "Pause length triggered by the After Call Work option", + "MEMBERDELAY": "Inserts a delay prior to the caller and agent in queue get connected", + "MUSICONHOLD": "Sets the music class to use for a particular queue", + "ANNOUNCETOAGENT": "Plays an announcement to the agent answering the call (e.g. to let him know which queue the caller is coming from)", + "RANDOMPERIODICANNOUNCE": "If yes, it plays the periodic announcements in random order", + "ANNOUNCEHOLDTIME": "Plays the estimated hold time along with the periodic announcements (Yes/No/Once)", + "ANNOUNCECALLERPOSITION": "Used to define if the caller’s position in the queue should be announced: No=never; Yes=always; Limit=only if it is within the limit defined by announce-position-limit; More= only if it is beyond the value defined by announce-position-limit", + "REPORTHOLDTIMEAGENT": "Enables reporting caller’s hold time to the agent in queue prior to connection", + "PERIODICANNOUNCE": "Set of periodic announcements to be played (in the order)", + "HOLDTIMEANNOUNCE": "Choose a Sound defined in Tools. Default=“Hold time”. Undefined=no announcement", + "YOUARENEXTANNOUNCE": "Choose a Sound defined in Tools. Default=“You are now first in line”. Undefined=no announcement", + "THEREAREANNOUNCE": "Choose a Sound defined in Tools. Default=“There are”. Undefined=no announcement", + "WAITINGCALLSANNOUNCE": "Choose a Sound defined in Tools. Default=“calls waiting”. Undefined=no announcement", + "ESTIMATEDHOLDTIMEANNOUNCE": "Choose a Sound defined in Tools. Default=“The current estimated hold time is”. Undefined=no announcement", + "MINUTESANNOUNCE": "Choose a Sound defined in Tools. Default=“minutes”. Undefined=no announcement", + "MINUTEANNOUNCE": "Choose a Sound defined in Tools. Default=“minute”. Undefined=no announcement", + "SECONDSANNOUNCE": "Choose a Sound defined in Tools. Default=“seconds”. Undefined=no announcement", + "THANKYOUANNOUNCE": "Choose a Sound defined in Tools. Default=“Thank you for your patience”. Undefined=no announcement", + "AFTERCALLWORK": "If enabled, the agent will be set on Pause after completing a call", + "AUTOPAUSE": "Enables/disables the automatic pause of agents who fail to answer a call. If enabled, it causes the agent to be paused in all queues he belongs to", + "RINGINUSE": "To avoid/allow sending calls to members whose status is In Use", + "TIMEOUTRESTART": "If yes, this resets the timeout for an agent to answer when either a BUSY or CONGESTION status is received from the channel", + "MONITORFORMAT": "Specifies the file format to use when recording. If monitor-format is inactive, calls will not be recorded", + "CONTEXT": "Allows a caller to exit the queue by pressing a single DTMF digit. If a context is specified and the caller enters a number, that digit will attempt to be matched in the context specified, and dialplan execution will continue there", + "SETINTERFACEVARIABLES": "If set to yes, just prior to the caller being connected with a queue agent some variables will be set (for more information see wiki docs:click here)", + "SETQUEUEVARIABLES": "If set to yes, just prior to the caller being connected with a queue agent and leaving the queue, some variables will be set (for more information, see wiki docs:click here)", + "SETQUEUEENTRYVARIABLES": "If set to yes, just prior to the caller being connected with a queue agent some variables will be set (for more information, see wiki docs:click here)", + "RECORDING": "Enable call recording", + "VOICEMAIL_CONTEXT": "The context of the relative extension", + "METHOD": "Outbound dialer method", + "POWERLEVEL": "Number of contacts to call for any available agent", + "PREDICTIVEOPTIMIZATION": "A factor to optimize in the predictive algorithm", + "PREDICTIVEOPTIMIZATIONPERCENTAGE": "Percentage based on the selected predictive optimization factor", + "PREDICTIVEINTERVAL": "Time interval (in minutes) considered by the predictive algorithm to calculate the amount of calls to generate to optimize the result", + "MAXCONCURRENTCALLS": "Maximum number of concurrent calls that will be originated by the outbound dialer for this campaign (0=unlimited)", + "CONCURRENTCALLS": "Maximum number of concurrent calls that will be originated by the outbound dialer for this campaign", + "ORIGINATECALLERIDNAME": "Outgoing Caller Id Name", + "ORIGINATECALLERIDNUMBER": "Outgoing Caller Id Number", + "ORIGINATETIMEOUT": "Time (in seconds) for the outbound call to establish a connection, otherwise the status is set to No Answer ", + "QUEUETIMEOUT": "Time (in seconds) a call will wait in the queue before it is dropped (Min 1 and Max 999)", + "GLOBALMAXRETRY": "Maximum number of times a contact is called before considering it closed", + "CONGESTIONMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for congestion", + "CONGESTIONRETRYTIME": "Time in minutes before trying to call again a failed contact due to congestion", + "BUSYMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for busy", + "BUSYRETRYTIME": "Time in minutes before trying to call again a failed contact due to busy", + "NOANSWERMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for no answer", + "NOANSWERRETRYTIME": "Time in minutes before trying to call again a failed contact due to no answer", + "NOSUCHNUMBERMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for no such number", + "NOSUCHNUMBERRETRYTIME": "Time in minutes before trying to call again a failed contact due to no such number", + "DROPMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for drop", + "DROPRETRYTIME": "Time in minutes before trying to call again a failed contact due to drop", + "ABANDONEDMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for abandon", + "ABANDONEDRETRYTIME": "Time in minutes before trying to call again a failed contact due to abandon", + "MACHINEMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for machine", + "MACHINERETRYTIME": "Time in minutes before trying to call again a failed contact due to machine", + "AGENTREJECTMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for agent reject", + "AGENTREJECTRETRYTIME": "Time in minutes before trying to call again a failed contact due to agent reject", + "CALLADDITIONALPHONEAFTERMIN": "", + "GLOBALINTERVAL": "Global time interval during which the dialer is allowed to call contacts. We decline responsibility: pay attention when you modify this field, because you may fail to comply with the national Autodialer Laws and Regulations", + "NAME": "Only numbers, letters and specific characters (._) are supported", + "MANDATORYDISPOSITIONPAUSEID": "Pause status to set during mandatory disposition", + "PREVIEW_AUTO_RECALL_ME": "If enabled, the system will automatically generate the Recall Me calls; otherwise, the agent must do it manually" + }, + "MUSICONHOLD": "Music On Hold", + "ANNOUNCETOAGENT": "Announce To Agent", + "ANNOUNCEMENTS": "Announcements", + "ADVANCEDPREVIEW": "Advanced", + "ADVANCED": "Advanced", + "ADVANCE": "Advanced", + "ANNOUNCEFREQUENCY": "Announce Frequency", + "MINANNOUNCEFREQUENCY": "Minimum Announce Frequency", + "PERIODICANNOUNCEFREQUENCY": "Periodic Announce Frequency", + "RANDOMPERIODICANNOUNCE": "Random Periodic Announce", + "ANNOUNCEHOLDTIME": "Announce Hold Time", + "ANNOUNCECALLERPOSITION": "Announce Caller Position", + "ANNOUNCEPOSITIONLIMIT": "Announce Position Limit", + "REPORTHOLDTIMEAGENT": "Report Agent Hold Time", + "PERIODICANNOUNCE": "Periodic Announce", + "HOLDTIMEANNOUNCE": "Hold Time Announce", + "YOUARENEXTANNOUNCE": "'You are next' Announce", + "THEREAREANNOUNCE": "'There are' Announce", + "WAITINGCALLSANNOUNCE": "Waiting Calls Announce", + "ESTIMATEDHOLDTIMEANNOUNCE": "Estimated Hold Time Announce", + "MINUTESANNOUNCE": "Minutes Announce", + "MINUTEANNOUNCE": "Minute Announce", + "SECONDSANNOUNCE": "Seconds Announce", + "THANKYOUANNOUNCE": "'Thank You' Announce", + "AUTOPAUSE": "Auto Pause", + "AFTERCALLWORK": "After Call Work", + "AFTERCALLWORKDURATION": "After Call Work Duration", + "RINGINUSE": "Ring In Use", + "MEMBERDELAY": "Member Delay", + "TIMEOUTRESTART": "Timeout Restart", + "MONITORFORMAT": "Recording Format", + "SETINTERFACEVARIABLES": "Set Interface Variables", + "SETQUEUEVARIABLES": "Set Queue Variables", + "SETQUEUEENTRYVARIABLES": "Set Queue Entry Variables", + "CONTEXT": "Context", + "SAVE": "Save", + "SETTINGS": "Settings", + "INBOUNDROUTES": "Inbound Routes", + "PHONENUMBER": "Phone Number", + "ADD_INBOUNDROUTE": "Add Inbound Route", + "EDIT_INBOUNDROUTE": "Edit Inbound Route", + "DELETE_INBOUNDROUTE": "Delete Inbound Route", + "ACTIONS": "Actions", + "OUTBOUNDROUTES": "Outbound Routes", + "DESTINATIONPATTERN": "Destination Pattern", + "ADD_OUTBOUNDROUTE": "Add Outbound Route", + "EDIT_OUTBOUNDROUTE": "Edit Outbound Route", + "DELETE_OUTBOUNDROUTE": "Delete Outbound Route", + "CUTDIGITS": "Cut Digits", + "RECORDING": "Recording", + "RECORDINGFORMAT": "Recording format", + "INTERNALROUTES": "Internal Routes", + "ADD_INTERNALROUTE": "Add Internal Route", + "EDIT_INTERNALROUTE": "Edit Internal Route", + "DELETE_INTERNALROUTE": "Delete Internal Route", + "CONTEXTS": "Contexts", + "ADD_CONTEXT": "Add Context", + "EDIT_CONTEXT": "Edit Context", + "DELETE_CONTEXT": "Delete Context", + "VOICEMAILS": "Voicemails", + "ADD_VOICEMAIL": "Add Voicemail", + "EDIT_VOICEMAIL": "Edit Voicemail", + "DELETE_VOICEMAIL": "Delete Voicemail", + "FULLNAME": "Full Name", + "EMAIL": "Email", + "MAILBOX": "Mailbox", + "PASSWORD": "Password", + "CONFIRM_PASSWORD": "Confirm Password", + "TIMEZONE": "Timezone", + "ATTACH": "Attach", + "ENVELOPE": "Envelope", + "DELETE": "Delete", + "EMAILBODY": "Email Body", + "EMAILSUBJECT": "Email Subject", + "MAXSECONDS": "Max Seconds", + "MAXMESSAGES": "Max Messages", + "MESSAGES": "Messages", + "SORT": "Sort", + "ADD_MUSICONHOLD": "Add Music On Hold", + "MUSICONHOLDS": "Music On Hold", + "EDIT_MUSICONHOLD": "Edit Music On Hold", + "DELETE_MUSICONHOLD": "Delete Music On Hold", + "DIRECTORY": "Directory", + "AUDIOFILES": "Audio Files", + "RECORDINGS": "Recordings", + "CHANSPY": "ChanSpy", + "PREFIX": "Prefix", + "OPTIONS": "Options", + "AUTH": "Auth", + "ADD_CHANSPY": "Add ChanSpy", + "EDIT_CHANSPY": "Edit ChanSpy", + "DELETE_CHANSPY": "Delete ChanSpy", + "AGENTS": "Agents", + "TELEPHONES": "Telephones", + "QUEUES": "Queues", + "QUEUE_CALLS": "Queue Calls", + "QUEUE_PARAMETERS": "Queue Parameters", + "ABANDONED_CALLS": "Abandoned Calls", + "OUTBOUND_CALLS": "Outbound Calls", + "AGI": "AGI", + "DIAL": "Dial", + "INTERNALDIAL": "Internal Dial", + "EXTERNALDIAL": "External Dial", + "RINGGROUP": "Ring Group", + "PLAYBACK": "Playback", + "QUEUE": "Queue", + "SET": "Set", + "VOICEMAIL": "Voicemail", + "GOTO": "GoTo", + "HANGUP": "Hangup", + "CUSTOM": "Custom", + "PROJECT": "Cally-Square Project", + "TECHNOLOGY/RESOURCE": "Technology/Resource", + "URL": "URL", + "EDIT_APP": "Edit Application", + "EDIT_INTERVAL": "Edit Interval", + "DELETE_APP": "Delete Application", + "INTERVALS": "Intervals", + "USER": "User", + "TRUNK": "Trunk", + "PHONE": "Phone", + "AUDIO_FILES": "Audio Files", + "ANNOUNCE_OVERRIDES": "Announce Overrides", + "MACRO": "Macro", + "GOSUB": "GoSub", + "RULE": "Rule", + "POSITION": "Position", + "ANSWER": "Answer", + "VALUE": "Value", + "MAILBOX@CONTEXT": "Mailbox@Context", + "EXTENSION": "Extension", + "PRIORITY": "Priority", + "HANGUP_CAUSE": "Hangup Cause", + "OUTBOUNDDIAL": "Outbound Dial", + "CALLER_ID": "Caller ID", + "NO_MESSAGE_AVAILABLE": "No messages available", + "NO_SOUND_AVAILABLE": "No sounds available", + "VOICERECORDINGS": "Voice Recordings", + "CHANSPIES": "ChanSpy", + "VOICE": "Voice", + "REALTIME": "Realtime", + "ID": "Id", + "VOICEMAIL_CONTEXT": "Context", + "NO_MOHSOUND_AVAILABLE": "No Music On Hold available", + "FILE": "File", + "ADD_MOHSOUND": "Add Music On Hold sound", + "DOWNLOAD_MOHSOUND": "Download Music On Hold sound", + "DELETE_MOHSOUND": "Delete Music On Hold sound", + "UNIQUEID": "Unique ID", + "AGENT": "Agent", + "TYPE": "Type", + "RATING": "Rating", + "AUDIO": "Audio", + "DATE": "Date", + "NEW_VOICEQUEUE": "New Voice Queue", + "NEW_INBOUNDROUTE": "New Inbound Route", + "NEW_OUTBOUNDROUTE": "New Outbound Route", + "NEW_INTERNALROUTE": "New Internal Route", + "NEW_CONTEXT": "New Context", + "NEW_VOICEMAIL": "New Voicemail", + "NEW_MUSICONHOLD": "New Music On Hold", + "NEW_CHANSPY": "New ChanSpy", + "PENALTY": "Penalty", + "ADD_TEAM_TO_VOICEQUEUE": "Add Team to Voice Queue", + "ADD_AGENT_TO_VOICEQUEUE": "Add Agent to Voice Queue", + "EDIT_DIAL": "Edit Dial", + "EDIT_AGI": "Edit AGI", + "EDIT_INTERNALDIAL": "Edit Internal Dial", + "EDIT_EXTERNALDIAL": "Edit External Dial", + "EDIT_RINGGROUP": "Edit Ring Group", + "EDIT_PLAYBACK": "Edit Playback", + "EDIT_QUEUE": "Edit Queue", + "EDIT_SET": "Edit Set", + "EDIT_GOTO": "Edit GoTo", + "EDIT_HANGUP": "Edit Hangup", + "EDIT_CUSTOM": "Edit Custom", + "DURATION": "Duration", + "RECEIVED_AT": "Received At", + "YES": "Yes", + "NO": "No", + "HANGUPCAUSE_1": "1 = Unallocated number", + "HANGUPCAUSE_16": "16 = Normal call clearing", + "HANGUPCAUSE_17": "17 = User busy", + "HANGUPCAUSE_18": "18 = No user responding (telehone device not connected)", + "HANGUPCAUSE_21": "21 = Call rejected", + "HANGUPCAUSE_22": "22 = Number changed", + "HANGUPCAUSE_27": "27 = Destination out of order", + "HANGUPCAUSE_38": "38 = Network out of order", + "HANGUPCAUSE_41": "41 = Temporary failure", + "RANDOM": "Random", + "ALPHABETICAL": "Alphabetical", + "NO_APPS_AVAILABLE": "No applications available", + "DOWNLOAD_VOICERECORDING": "Download Voice Recording", + "DELETE_VOICERECORDING": "Delete Voice Recording", + "INTERNAL": "Internal", + "PHONE_STATE": "Phone State", + "PHONE_STATUS": "Phone Status", + "REGISTERED": "Registered", + "UNREGISTERED": "Unregistered", + "LAGGED": "Lagged", + "REACHABLE": "Reachable", + "UNREACHABLE": "Unreachable", + "UNKNOWN": "Unknown", + "NOT_INUSE": "Not in use", + "INUSE": "In Use", + "BUSY": "Busy", + "INVALID": "Invalid", + "UNAVAILABLE": "Unavailable", + "RINGING": "Ringing", + "ONHOLD": "On Hold", + "RING": "Ring", + "UP": "Up", + "INFO": "Info", + "TRUNKS": "Trunks", + "REGISTRY": "Registry", + "NO_REGISTRY": "No registry", + "LOGGED_IN": "Logged in (SIP connected)", + "PAUSED": "Paused", + "DISPOSITION": "Disposition", + "WAITING": "Waiting", + "TALKING": "Talking", + "DID": "DID", + "CALLER": "Caller", + "TOTAL": "Total", + "ANSWERED": "Answered", + "ABANDONED": "Abandoned", + "UNMANAGED": "Unmanaged", + "REDIRECT_TO_NUMBER": "Redirect to a number", + "REDIRECT_TO_AGENT": "Redirect to an agent", + "CLOSING": "Closing", + "AVG_HOLD_TIME": "Avg Hold Time", + "AVG_DURATION": "Avg Duration", + "AVG_BILLABLE": "Avg Billable", + "SOURCE": "Source", + "DESTINATION": "Destination", + "REJECTED": "Rejected", + "FAILED": "Failed", + "CALLED": "Called", + "CONNECTED": "Connected", + "NO_RATING": "No rating", + "EDIT_VOICERECORDING": "Edit Voice Recording", + "APPLICATION_NAME": "Application Name", + "ARGUMENTS": "Arguments", + "EDIT_QUEUECAMPAIGN": "Edit Campaign", + "LISTADD_QUEUECAMPAIGN": "Add List", + "BLACKLISTADD_QUEUECAMPAIGN": "Add Blacklist", + "TEAMADD_QUEUECAMPAIGN": "Add Team", + "AGENTADD_QUEUECAMPAIGN": "Add Agent", + "DELETE_QUEUECAMPAIGN": "Delete Campaign", + "DELETE_IVRCAMPAIGN": "Delete Campaign", + "EDIT_IVRCAMPAIGN": "Edit Campaign", + "NEW_IVRCAMPAIGN": "New IVR Campaign", + "ADD_IVRCAMPAIGN": "Add IVR Campaign", + "LISTADD_IVRCAMPAIGN": "Add List", + "BLACKLISTADD_IVRCAMPAIGN": "Add Blacklist", + "ENABLED": "Enabled", + "READY": "Ready", + "PAUSE": "Pause", + "UNPAUSE": "End Pause", + "DEFAULT_PAUSE": "Default Pause", + "AGENTADD_QUEUE": "Add Agent to queue campaign", + "AGENTSADD_QUEUE": "Add Agents to queue campaign", + "ALL_TEAMS": "All Teams", + "SELECTED_TEAMS": "Selected Teams", + "ALL_LISTS": "All Lists", + "SELECTED_LISTS": "Selected Lists", + "ALL_AGENTS": "All Agents", + "SELECTED_AGENTS": "Selected Agents", + "WAITING_FOR_AGENT": "Waiting for Agent", + "TOTAL_OFFERED": "Total Offered", + "RUNNING": "Running", + "TRUNK_IS_NOT_REACHABLE": "Trunk is Not Reachable", + "AGENTS_NOT_LOGGED": "Agent not logged", + "NOT_ACTIVE": "Not Active", + "IS_DISACTIVED": "Deactivated", + "BACKUPTRUNK": "Backup Trunk", + "GLOBALINTERVAL": "Global Interval", + "RESCHEDULED_CONTACTS": "Rescheduled contacts", + "INTERVAL_IS_OVERTIME": "Out of Interval", + "GLOBAL_INTERVAL_IS_OVERTIME": "Out of Interval (Global)", + "INTERVAL_IS_NULL": "Interval is Null", + "TIMEZONE_UNKNOW": "Timezone Unknow", + "INTERVAL_IS_EMPTY": "Interval is Empty", + "TOTAL_MANAGED": "Total Managed", + "OPEN": "Open", + "FRESH": "Fresh", + "CLOSED": "Closed", + "ALWAYS": "Always", + "NEVER": "Never", + "ONLY_IF_OPEN": "Only If Open", + "CHECKDUPLICATE": "Check Duplicate", + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "OF": "of", + "CHAT": "Chat", + "MAIL": "Email", + "SMS": "SMS", + "OPENCHANNEL": "Open Channel", + "FAX": "Fax", + "TEAMS_ASSOCIATION": "Teams Association", + "MANDATORYDISPOSITION": "Mandatory disposition", + "MANDATORYDISPOSITIONPAUSEID": "Mandatory disposition pause status", + "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", + "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available", + "PREVIEW_AUTO_RECALL_ME": "Automate Recall Me calls" + } +} diff --git a/public/app/main/apps/openchannel/i18n/bs.json b/public/app/main/apps/openchannel/i18n/bs.json index 49fbeed..304b95b 100644 --- a/public/app/main/apps/openchannel/i18n/bs.json +++ b/public/app/main/apps/openchannel/i18n/bs.json @@ -1,271 +1,271 @@ { "OPENCHANNEL": { - "EDIT_DIALOGFLOWV2": "Edit Dialogflow V2", + "EDIT_DIALOGFLOWV2": "Uredi Dialogflow V2", "DIALOGFLOWV2": "Dialogflow V2", - "PRIVATEKEY": "Private Key", - "CLIENTEMAIL": "Client Email", - "PROJECTID": "Project ID", + "PRIVATEKEY": "Privatni Ključ", + "CLIENTEMAIL": "E-Mail Stranke", + "PROJECTID": "Projekat ID", "AMAZONLEX": "AmazonLex", - "EDIT_AMAZONLEX": "Edit Lex configuration", - "ACCESSKEYID": "Access key ID", - "SECRETACCESSKEY": "Access key secret", + "EDIT_AMAZONLEX": "Uredi Lex konfiguraciju", + "ACCESSKEYID": "Pristupni ključ ID", + "SECRETACCESSKEY": "Tajni Pristupni Ključ", "LEXREGION": "Region", - "BOTNAME": "Bot name", - "WELCOMEMESSAGE": "Welcome message", + "BOTNAME": "Bot naziv", + "WELCOMEMESSAGE": "Poruka dobrodošlice", "DIALOGFLOW": "Dialogflow", - "EDIT_DIALOGFLOW": "Edit Dialogflow configuration", - "LANGUAGE": "Language", - "LOGIN_TIME": "Login time", - "PAUSE_TIME": "Pause time", - "DOWNLOAD_INTERACTION": "Download", - "TRANSFER": "Transfer", - "QUEUETRANSFER": "Queue Transfer", - "QUEUETRANSFERTIMEOUT": "Queue Transfer Timeout", - "AGENTTRANSFER": "Agent Transfer", - "AGENTTRANSFERTIMEOUT": "Agent Transfer Timeout", + "EDIT_DIALOGFLOW": "Uredi Dialogflow konfiguraciju", + "LANGUAGE": "Jezik", + "LOGIN_TIME": "Vrijeme prijave", + "PAUSE_TIME": "Vrijeme pauze", + "DOWNLOAD_INTERACTION": "Skini", + "TRANSFER": "Prijenos", + "QUEUETRANSFER": "Queue Prijenos", + "QUEUETRANSFERTIMEOUT": "Timeout Queue Prijenosa", + "AGENTTRANSFER": "Prijenos Specijaliste", + "AGENTTRANSFERTIMEOUT": "Timeout Prijenosa Specijaliste", "TAG": "Tag", - "EDIT_TAG": "Edit Tag", - "ADVANCED": "Advanced", + "EDIT_TAG": "Uredi Tag", + "ADVANCED": "Napredno", "PROXY": "Proxy", "TOKEN": "Token", - "ADD_NOTE": "Add note", - "NOTE": "Note", - "WAITFORTHEASSIGNEDAGENT": "Wait for the assigned agent", - "INSERT_MESSAGE_HERE": "Insert your text message here", - "NOTIFICATION": "Notification", - "NOTIFICATIONSOUND": "Sound", - "NOTIFICATIONSHAKE": "Shake", - "NOTIFICATIONTEMPLATE": "Template", - "SYSTEM": "System", - "EDIT_SYSTEM": "Edit System", - "COMMAND": "Command", - "VARIABLE": "Variable", - "DELETE": "Delete", - "CANNEDANSWERS": "Canned Answers", - "OPENCHANNELCANNEDANSWERS": "Canned Answers", - "NO_OPENCHANNELCANNEDANSWER_AVAILABLE": "No Canned Answers Available", - "NEW_OPENCHANNELCANNEDANSWER": "New Canned Answer", - "ADD_OPENCHANNELCANNEDANSWER": "Add Canned Answer", - "EDIT_OPENCHANNELCANNEDANSWER": "Edit", - "DELETE_OPENCHANNELCANNEDANSWER": "Delete", - "DELIVERYREPORTURL": "Delivery Report URL", - "TAGS": "Tags", + "ADD_NOTE": "Dodaj bilješku", + "NOTE": "Bilješka", + "WAITFORTHEASSIGNEDAGENT": "Pričekaj dodijeljenog specijalistu", + "INSERT_MESSAGE_HERE": "Odje unesi svoju tekstualnu poruku", + "NOTIFICATION": "Obavijesti", + "NOTIFICATIONSOUND": "Zvuk", + "NOTIFICATIONSHAKE": "Protresi", + "NOTIFICATIONTEMPLATE": "Šablon", + "SYSTEM": "Sistem", + "EDIT_SYSTEM": "Uredi Sistem", + "COMMAND": "Komanda", + "VARIABLE": "Varijabla", + "DELETE": "Izbriši", + "CANNEDANSWERS": "Pripremljeni Odgovori", + "OPENCHANNELCANNEDANSWERS": "Pripremljeni Odgovori", + "NO_OPENCHANNELCANNEDANSWER_AVAILABLE": "Nema dostupnih Pripremljenih Odgovora", + "NEW_OPENCHANNELCANNEDANSWER": "Novi Pripremljeni Odgovor", + "ADD_OPENCHANNELCANNEDANSWER": "Dodaj Pripremljeni Odgovor", + "EDIT_OPENCHANNELCANNEDANSWER": "Uredi", + "DELETE_OPENCHANNELCANNEDANSWER": "Izbriši", + "DELIVERYREPORTURL": "Izvještaj Isporuke URL", + "TAGS": "Tag-ovi", "SPYINTERACTION": "Spy", - "NO_AGENT_ONLINE": "No Agent Online", - "GOTOREALTIME_OPENCHANNELQUEUE": "Go To Realtime Open Channel Queue", - "PARTIALPAUSE": "Parital Pause", - "BUSY": "Busy", + "NO_AGENT_ONLINE": "Nema Specijalista Online", + "GOTOREALTIME_OPENCHANNELQUEUE": "Idi na Realtime Otvoreni Kanal Queue", + "PARTIALPAUSE": "Parcijalna Pauza", + "BUSY": "Zauzet", "TIMER": "Timer", "IDLE": "Idle", - "CAPACITY": "Capacity", + "CAPACITY": "Kapacitet", "REALTIME": "Realtime", - "TEXT": "Text", - "TIMES": "Number of times per interaction", - "EDIT_AUTOREPLY": "Edit Auto Reply", - "AUTOREPLY": "Auto Reply", - "NAME": "Name", - "OPENCHANNELQUEUES": "Open Channel Queues", - "SEARCH_FOR_ANYONE": "Search", - "MANDATORYDISPOSITION": "Mandatory disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pause to use if mandatory disposition is enabled", + "TEXT": "Tekst", + "TIMES": "Broj puta po interakciji", + "EDIT_AUTOREPLY": "Uredi Automatski Odgovor", + "AUTOREPLY": "Automatski Odgovor", + "NAME": "Naziv", + "OPENCHANNELQUEUES": "Otvoreni Kanal Queues", + "SEARCH_FOR_ANYONE": "Traži", + "MANDATORYDISPOSITION": "Obavezna dispozicija", + "MANDATORYDISPOSITIONPAUSEID": "Zadana pauza kada je Obavezna dispozicija omogućena", "ERRORS": { - "PROJECTID_REQUIRED": "Mandatory Field", - "CLIENTEMAIL_REQUIRED": "Mandatory Field", - "PRIVATEKEY_REQUIRED": "Mandatory Field", - "ACCESSKEYID_REQUIRED": "Access key ID is required", - "SECRETACCESSKEY_REQUIRED": "Access key secret is required", - "BOTNAME_REQUIRED": "Bot name is required", - "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "QUEUETRANSFERTIMEOUT_REQUIRED": "Mandatory Field", - "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "AGENTTRANSFERTIMEOUT_REQUIRED": "Mandatory Field", - "TAG_REQUIRED": "Mandatory Field", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Mandatory Field", - "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "NAME_MUST_VALID_PATTERN": "Wrong format", - "KEY_REQUIRED": "Mandatory Field", - "LIST_REQUIRED": "Mandatory Field", - "COMMAND_REQUIRED": "Mandatory Field", - "TEXT_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "VALUE_REQUIRED": "Mandatory Field", - "TEXT_REQUIRED": "The field text is required", - "NAME_REQUIRED": "Mandatory field", - "AGENT_TIMEOUT_REQUIRED": "Mandatory field", - "MOTIONADDRESS_REQUIRED": "Mandatory field", - "MOTIONADDRESS_MUST_VALID_URL": "Wrong format", - "ACCEPTURL_MUST_VALID_URL": "Wrong format", - "TIMEOUT_REQUIRED": "Mandatory field", - "REJECTURL_MUST_VALID_URL": "Wrong format", - "CLOSEURL_MUST_VALID_URL": "Wrong format", - "REPLYURI_REQUIRED": "Mandatory field", - "REPLYURI_MUST_VALID_URL": "Wrong format", - "PRIORITY_REQUIRED": "Mandatory field", - "CONDITION_REQUIRED": "Mandatory field", - "TRUEPRIORITY_REQUIRED": "Mandatory field", - "FALSEPRIORITY_REQUIRED": "Mandatory field", - "AGENT_REQUIRED": "Mandatory field", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "DISPOSITION_REQUIRED": "Mandatory field", - "QUEUE_REQUIRED": "Mandatory field", - "KEY_MAX_LENGTH": "Key must have a maximum length equal to {{max}}", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Mandatory field" + "PROJECTID_REQUIRED": "Obavezno polje", + "CLIENTEMAIL_REQUIRED": "Obavezno polje", + "PRIVATEKEY_REQUIRED": "Obavezno polje", + "ACCESSKEYID_REQUIRED": "Pristupni ključ ID je potreban", + "SECRETACCESSKEY_REQUIRED": "Tajni pristupni ključ je potreban", + "BOTNAME_REQUIRED": "Bot naziv je potreban", + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja od ili jednaka", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka od", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Obavezno polje", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja od ili jednaka", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka od", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Obavezno polje", + "TAG_REQUIRED": "Obavezno polje", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja od ili jednaka", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka od", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Obavezno polje", + "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja od ili jednaka", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja od ili jednaka", + "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka od", + "NAME_MUST_VALID_PATTERN": "Pogrešan format", + "KEY_REQUIRED": "Obavezno polje", + "LIST_REQUIRED": "Obavezno polje", + "COMMAND_REQUIRED": "Obavezno polje", + "TEXT_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "VALUE_REQUIRED": "Obavezno polje", + "TEXT_REQUIRED": "Tekst polja je obavezan", + "NAME_REQUIRED": "Obavezno polje", + "AGENT_TIMEOUT_REQUIRED": "Obavezno polje", + "MOTIONADDRESS_REQUIRED": "Obavezno polje", + "MOTIONADDRESS_MUST_VALID_URL": "Pogrešan format", + "ACCEPTURL_MUST_VALID_URL": "Pogrešan format", + "TIMEOUT_REQUIRED": "Obavezno polje", + "REJECTURL_MUST_VALID_URL": "Pogrešan format", + "CLOSEURL_MUST_VALID_URL": "Pogrešan format", + "REPLYURI_REQUIRED": "Obavezno polje", + "REPLYURI_MUST_VALID_URL": "Pogrešan format", + "PRIORITY_REQUIRED": "Obavezno polje", + "CONDITION_REQUIRED": "Obavezno polje", + "TRUEPRIORITY_REQUIRED": "Obavezno polje", + "FALSEPRIORITY_REQUIRED": "Obavezno polje", + "AGENT_REQUIRED": "Obavezno polje", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka od", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka od", + "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka od", + "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća od ili jednaka od", + "DISPOSITION_REQUIRED": "Obavezno polje", + "QUEUE_REQUIRED": "Obavezno polje", + "KEY_MAX_LENGTH": "Ključ mora imati maksimalnu dužinu {{max}}", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Obavezno polje" }, - "STRATEGY": "Strategy", - "AGENT": "Agent", + "STRATEGY": "Strategija", + "AGENT": "Specijalist", "GOTO": "Goto", "GOTOIF": "Gotoif", "NOOP": "Noop", "QUEUE": "Queue", - "EDIT_AGENT": "Edit Agent", - "EDIT_GOTO": "Edit Goto", - "EDIT_NOOP": "Edit Noop", - "EDIT_GOTOIF": "Edit Gotoif", - "EDIT_QUEUE": "Edit Queue", - "CONDITION": "Condition", - "TRUEPRIORITY": "True Priority", - "FALSEPRIORITY": "False Priority", - "VALUE": "Value", - "PRIORITY": "Priority", - "AGENT_TIMEOUT": "Agent Timeout", - "DESCRIPTION": "Description", - "ADD_OPENCHANNELQUEUE": "Add Open Channel Queue", - "EDIT_OPENCHANNELQUEUE": "Edit Open Channel Queue", - "DELETE_OPENCHANNELQUEUE": "Delete Open Channel Queue", - "PENALTY": "Penalty", - "TEAMADD_OPENCHANNELQUEUE": "Add Team To Open Channel Queue", - "AGENTADD_OPENCHANNELQUEUE": "Add Agent To Open Channel Queue", - "ALL_AGENTS": "All Agents", - "SELECTED_AGENTS": "Selected Agents", - "CREATED_AT": "Created At", - "SAVE": "Save", - "SETTINGS": "Settings", - "GENERAL": "General", - "OPENCHANNELACCOUNTS": "Open Channel Accounts", - "MOTIONADDRESS": "Motion Address", - "ADD_OPENCHANNELACCOUNT": "Add Open Channel Account", - "EDIT_OPENCHANNELACCOUNT": "Edit Open Channel Account", - "DELETE_OPENCHANNELACCOUNT": "Delete Open Channel Account", + "EDIT_AGENT": "Uredi Specijalistu", + "EDIT_GOTO": "Uredi Goto", + "EDIT_NOOP": "Uredi Noop", + "EDIT_GOTOIF": "Uredi Gotoif", + "EDIT_QUEUE": "Uredi Queue", + "CONDITION": "Uslov", + "TRUEPRIORITY": "Pravi Prioritet", + "FALSEPRIORITY": "Pogrešan Prioritet", + "VALUE": "Vrijednost", + "PRIORITY": "Prioritet", + "AGENT_TIMEOUT": "Timeout Specijaliste", + "DESCRIPTION": "Opis", + "ADD_OPENCHANNELQUEUE": "Dodaj Otvoreni Kanal Queue", + "EDIT_OPENCHANNELQUEUE": "Uredi Otvoreni Kanal Queue", + "DELETE_OPENCHANNELQUEUE": "Izbriši Otvoreni Kanal Queue", + "PENALTY": "Kazna", + "TEAMADD_OPENCHANNELQUEUE": "Dodaj Tim u Otvoreni Kanal Queue", + "AGENTADD_OPENCHANNELQUEUE": "Dodaj Specijalistu na Otvoreni Kanal Queue", + "ALL_AGENTS": "Svi Specijalisti", + "SELECTED_AGENTS": "Odabrani Specijalisti", + "CREATED_AT": "Kreirano U", + "SAVE": "Sačuvaj", + "SETTINGS": "Postavke", + "GENERAL": "Općenito", + "OPENCHANNELACCOUNTS": "Otvoreni Kanal Nalozi", + "MOTIONADDRESS": "Motion Adresa", + "ADD_OPENCHANNELACCOUNT": "Dodaj Otvoreni Kanal Nalog", + "EDIT_OPENCHANNELACCOUNT": "Uredi Otvoreni Kanal Nalog", + "DELETE_OPENCHANNELACCOUNT": "Izbriši Otvoreni Kanal Nalog", "API": "API", - "DISPOSITIONS": "Dispositions", + "DISPOSITIONS": "Dispozicije", "WEBHOOKS": "WebHooks", - "ACTIONS": "Actions", - "LIST": "List", - "FIDELITY": "Fidelity", - "ACCEPT": "Accept", - "ACCEPTMETHOD": "Accept Method", - "ACCEPTURL": "Accept URL", - "REJECT": "Reject", - "REJECTMETHOD": "Reject Method", - "REJECTURL": "Reject URL", - "CLOSE": "Close", - "CLOSEMETHOD": "Close Method", - "CLOSEURL": "Close URL", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "BACK": "Back", - "OPENCHANNEL": "Open Channel", - "ID": "Id", + "ACTIONS": "Radnje", + "LIST": "Lista", + "FIDELITY": "Vjernost", + "ACCEPT": "Prihvati", + "ACCEPTMETHOD": "Prihvati Metodu", + "ACCEPTURL": "Prihvati URL", + "REJECT": "Odbaci", + "REJECTMETHOD": "Metoda Odbacivanja", + "REJECTURL": "Odbaci URL", + "CLOSE": "Zatvori", + "CLOSEMETHOD": "Metoda Zatvaranja", + "CLOSEURL": "Zatvori URL", + "SELECTED": "Odabrano", + "SELECT_ALL": "Odaberi Sve", + "SELECT_NONE": "Odaberi Ništa", + "BACK": "Nazad", + "OPENCHANNEL": "Otvoreni Kanal", + "ID": "ID", "TIMEOUT": "Timeout", - "OPENCHANNELDISPOSITIONS": "Open Channel Dispositions", - "NO_OPENCHANNELDISPOSITION_AVAILABLE": "No Open Channel Dispositions available", - "NEW_OPENCHANNELDISPOSITION": "New Open Channel Disposition", - "ADD_OPENCHANNELDISPOSITION": "Add Open Channel Disposition", - "EDIT_OPENCHANNELDISPOSITION": "Edit Open Channel Disposition", - "DELETE_OPENCHANNELDISPOSITION": "Delete Open Channel Disposition", - "NEW_OPENCHANNELQUEUE": "New Open channel Queue", - "NEW_OPENCHANNELACCOUNT": "New Open channel Account", - "NO_AVAILABLE_INFO": "No available info", - "ALL_TEAMS": "All Teams", - "SELECTED_TEAMS": "Selected Teams", - "REPLYURI": "Reply URL", - "RECEIVEURI": "Receive URL", + "OPENCHANNELDISPOSITIONS": "Otvoreni Kanal Dispozicije", + "NO_OPENCHANNELDISPOSITION_AVAILABLE": "Nema dostupnih Otvoreni Kanal Dispozicija", + "NEW_OPENCHANNELDISPOSITION": "Nova Otvoreni Kanal Dispozicija", + "ADD_OPENCHANNELDISPOSITION": "Dodaj Otvoreni Kanal Dispoziciju", + "EDIT_OPENCHANNELDISPOSITION": "Uredi Otvoreni Kanal Dispoziciju", + "DELETE_OPENCHANNELDISPOSITION": "Izbriši Otvoreni Kanal Dispoziciju", + "NEW_OPENCHANNELQUEUE": "Novi Otvoreni Kanal Queue", + "NEW_OPENCHANNELACCOUNT": "Novi Otvoreni Kanal Nalog", + "NO_AVAILABLE_INFO": "Nema dostupnih informacija", + "ALL_TEAMS": "Svi Timovi", + "SELECTED_TEAMS": "Odabrani Timovi", + "REPLYURI": "Odgovori URL", + "RECEIVEURI": "Prihvati URL", "HELP": { - "WELCOMEMESSAGE": "This is the first response message sent to new interactions.", - "TOKEN": "Add this property as query string in your Web Service URL. For more details see the doc here", - "RECEIVEURI": "Auto-generated API string to be used in order to receive messages inside your open channel from the external application (using POST method). Click the clipboard button to copy it ", - "REPLYURI": "The URL the open channel will call when sending or replying to a message. For more details see the doc here", - "NAME": "Only numbers, letters and specific characters (._) are supported", - "LIST": "Contact Manager List used to associate contacts", - "MANDATORYDISPOSITION": "Mandatory disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pause to use if mandatory disposition is enabled" + "WELCOMEMESSAGE": "Ovo je prva poruka odgovora poslana novim interakcijama.", + "TOKEN": "Dodajte ovo svojstvo kao query string u URL adresu vaše Web Usluge. Za više detalja pogledajte dokument ovdje", + "RECEIVEURI": "Automatski generisani API niz koji će se koristiti za primanje poruka unutar tvog otvorenog kanala iz vanjske aplikacije (koristeći POST metodu). Kliknite na dugme međuspremnika da ga kopiraš", + "REPLYURI": "URL koji će otvoreni kanal pozvati prilikom slanja ili odgovaranja na poruku. Za više detalja pogledajte dokument ovdje", + "NAME": "Podržani su samo brojevi, slova i specifični znakovi (._)", + "LIST": "Kontakt Menadžer Lista koja se koristi za povezivanje kontakata", + "MANDATORYDISPOSITION": "Obavezna dispozicija", + "MANDATORYDISPOSITIONPAUSEID": "Zadana pauza kada je Obavezna dispozicija omogućena" }, - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", - "CONTACT": "Contact", - "STARTEDAT": "Started At", - "LASTMESSAGE": "Last message", + "PAGE": "Stranica", + "ROWSPERPAGE": "Redova po stranici", + "OF": "od", + "CONTACT": "Kontakt", + "STARTEDAT": "Počelo U", + "LASTMESSAGE": "Posljednja poruka", "STATUS": "Status", - "CLOSED": "Closed", - "OPENED": "Open", - "OPEN": "Open", - "ACCOUNT": "Account", - "INTERACTION": "Interaction", - "INTERACTIONS": "Interactions", - "ALL": "All", - "SELECT_STATUS": "Select a status", + "CLOSED": "Zatvoreno", + "OPENED": "Otvori", + "OPEN": "Otvori", + "ACCOUNT": "Nalog", + "INTERACTION": "Interakcija", + "INTERACTIONS": "Interakcije", + "ALL": "Svi", + "SELECT_STATUS": "Odaberi Status", "FILTER": "Filter", - "FILTERS": "Filters", - "CLOSEDAT": "Closed At", - "DISPOSITION": "Disposition", - "NOTES": "Notes", - "NO_INTERACTION_AVAILABLE": "No interactions available", - "SELECT_ACCOUNT": "Select an account", + "FILTERS": "Filteri", + "CLOSEDAT": "Zatvoreno U", + "DISPOSITION": "Dispozicija", + "NOTES": "Bilješke", + "NO_INTERACTION_AVAILABLE": "Nema dostupnih Interakcija", + "SELECT_ACCOUNT": "Odaberi Nalog", "GOTOP": "Gotop", - "EDIT_GOTOP": "Edit Gotop", - "EDIT_CLOSE": "Edit Close", + "EDIT_GOTOP": "Uredi Gotop", + "EDIT_CLOSE": "Uredi Zatvori", "INFO": "Info", - "KEY": "Key", - "UNKNOWN": "Unknown", - "UNREGISTERED": "Unregistered", - "UNAVAILABLE": "Unavailable", - "NOT_INUSE": "Not in use", - "REACHABLE": "Reachable", - "IN_USE": "In use", - "AGENTS": "Agents", + "KEY": "Ključ", + "UNKNOWN": "Nepoznati", + "UNREGISTERED": "Neregistrovano", + "UNAVAILABLE": "Nedostupno", + "NOT_INUSE": "Nije u upotrebi", + "REACHABLE": "Dostupan", + "IN_USE": "U Upotrebi", + "AGENTS": "Specijalisti", "QUEUES": "Queues", - "FULLNAME": "Fullname", - "INTERNAL": "Internal", - "PHONE_STATE": "Phone State", - "PHONE_STATUS": "Phone Status", - "PAUSE": "Pause", - "LOGOUT": "Logout", - "AGENTADD_QUEUE": "Add agent to Open Channel queue", - "UNPAUSE": "End Pause", - "DEFAULT_PAUSE": "Default pause", - "LOGGED_IN": "Logged in", - "PAUSED": "Paused", - "READY": "Ready", - "WAITING": "Waiting", + "FULLNAME": "Puno Ime", + "INTERNAL": "Interno", + "PHONE_STATE": "Stanje Telefona", + "PHONE_STATUS": "Status Telefona", + "PAUSE": "Pauza", + "LOGOUT": "Odjava", + "AGENTADD_QUEUE": "Dodaj Specijalistu na Otvoreni Kanal Queue", + "UNPAUSE": "Prekini Pauzu", + "DEFAULT_PAUSE": "Zadana pauza", + "LOGGED_IN": "Prijavljen", + "PAUSED": "Pauzirano", + "READY": "Spreman", + "WAITING": "Čeka", "VOICE": "Voice", "CHAT": "Chat", - "MAIL": "Email", + "MAIL": "E-Mail", "SMS": "SMS", "FAX": "Fax", - "AGENTSADD_QUEUE": "Add agents to Open Channel queue", - "INTERACTIONS_OPENCHANNELACCOUNT": "Go to Interactions", - "REFRESH_INTERACTIONS": "Refresh Interactions", - "DELETE_INTERACTION": "Delete Interaction", - "AGENTADD_OPENCHANNELACCOUNT": "Add Agent to Openchannel Account", - "CANNED_ANSWER_SEARCH": "Enter a text to seach a Canned Answer", - "CANNED_ANSWER_NOT_FOUND": "No Canned Answer were found", - "SEND": "Send", - "TO": "To", + "AGENTSADD_QUEUE": "Dodaj Specijaliste na Otvoreni Kanal Queue", + "INTERACTIONS_OPENCHANNELACCOUNT": "Idi na Interakcije", + "REFRESH_INTERACTIONS": "Osvježi Interakcije", + "DELETE_INTERACTION": "Izbriši Interakciju", + "AGENTADD_OPENCHANNELACCOUNT": "Dodaj Specijalistu na Otvoreni Kanal Nalog", + "CANNED_ANSWER_SEARCH": "Unesi tekst za pretraživanje Pripremljenih Odgovora", + "CANNED_ANSWER_NOT_FOUND": "Nije pronađen nijedan Pripremljeni Odgovor", + "SEND": "Pošalji", + "TO": "Za", "MAPKEY": "Map Key", - "TEAMS_ASSOCIATION": "Teams Association", - "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", - "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available", - "DOWNLOAD_WITH_ATTACHMENTS": "Download with attachments", - "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download without attachments" + "TEAMS_ASSOCIATION": "Asocijacija Timova", + "TOOLTIP_SCREENRECORDING_ON": "Snimanje ekrana je u toku", + "TOOLTIP_SCREENRECORDING_OFF": "Snimanje ekrana je dostupno", + "DOWNLOAD_WITH_ATTACHMENTS": "Skini sa prilozima", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Skini bez priloga" } } diff --git a/public/app/main/apps/openchannel/i18n/is.json b/public/app/main/apps/openchannel/i18n/is.json new file mode 100644 index 0000000..49fbeed --- /dev/null +++ b/public/app/main/apps/openchannel/i18n/is.json @@ -0,0 +1,271 @@ +{ + "OPENCHANNEL": { + "EDIT_DIALOGFLOWV2": "Edit Dialogflow V2", + "DIALOGFLOWV2": "Dialogflow V2", + "PRIVATEKEY": "Private Key", + "CLIENTEMAIL": "Client Email", + "PROJECTID": "Project ID", + "AMAZONLEX": "AmazonLex", + "EDIT_AMAZONLEX": "Edit Lex configuration", + "ACCESSKEYID": "Access key ID", + "SECRETACCESSKEY": "Access key secret", + "LEXREGION": "Region", + "BOTNAME": "Bot name", + "WELCOMEMESSAGE": "Welcome message", + "DIALOGFLOW": "Dialogflow", + "EDIT_DIALOGFLOW": "Edit Dialogflow configuration", + "LANGUAGE": "Language", + "LOGIN_TIME": "Login time", + "PAUSE_TIME": "Pause time", + "DOWNLOAD_INTERACTION": "Download", + "TRANSFER": "Transfer", + "QUEUETRANSFER": "Queue Transfer", + "QUEUETRANSFERTIMEOUT": "Queue Transfer Timeout", + "AGENTTRANSFER": "Agent Transfer", + "AGENTTRANSFERTIMEOUT": "Agent Transfer Timeout", + "TAG": "Tag", + "EDIT_TAG": "Edit Tag", + "ADVANCED": "Advanced", + "PROXY": "Proxy", + "TOKEN": "Token", + "ADD_NOTE": "Add note", + "NOTE": "Note", + "WAITFORTHEASSIGNEDAGENT": "Wait for the assigned agent", + "INSERT_MESSAGE_HERE": "Insert your text message here", + "NOTIFICATION": "Notification", + "NOTIFICATIONSOUND": "Sound", + "NOTIFICATIONSHAKE": "Shake", + "NOTIFICATIONTEMPLATE": "Template", + "SYSTEM": "System", + "EDIT_SYSTEM": "Edit System", + "COMMAND": "Command", + "VARIABLE": "Variable", + "DELETE": "Delete", + "CANNEDANSWERS": "Canned Answers", + "OPENCHANNELCANNEDANSWERS": "Canned Answers", + "NO_OPENCHANNELCANNEDANSWER_AVAILABLE": "No Canned Answers Available", + "NEW_OPENCHANNELCANNEDANSWER": "New Canned Answer", + "ADD_OPENCHANNELCANNEDANSWER": "Add Canned Answer", + "EDIT_OPENCHANNELCANNEDANSWER": "Edit", + "DELETE_OPENCHANNELCANNEDANSWER": "Delete", + "DELIVERYREPORTURL": "Delivery Report URL", + "TAGS": "Tags", + "SPYINTERACTION": "Spy", + "NO_AGENT_ONLINE": "No Agent Online", + "GOTOREALTIME_OPENCHANNELQUEUE": "Go To Realtime Open Channel Queue", + "PARTIALPAUSE": "Parital Pause", + "BUSY": "Busy", + "TIMER": "Timer", + "IDLE": "Idle", + "CAPACITY": "Capacity", + "REALTIME": "Realtime", + "TEXT": "Text", + "TIMES": "Number of times per interaction", + "EDIT_AUTOREPLY": "Edit Auto Reply", + "AUTOREPLY": "Auto Reply", + "NAME": "Name", + "OPENCHANNELQUEUES": "Open Channel Queues", + "SEARCH_FOR_ANYONE": "Search", + "MANDATORYDISPOSITION": "Mandatory disposition", + "MANDATORYDISPOSITIONPAUSEID": "Pause to use if mandatory disposition is enabled", + "ERRORS": { + "PROJECTID_REQUIRED": "Mandatory Field", + "CLIENTEMAIL_REQUIRED": "Mandatory Field", + "PRIVATEKEY_REQUIRED": "Mandatory Field", + "ACCESSKEYID_REQUIRED": "Access key ID is required", + "SECRETACCESSKEY_REQUIRED": "Access key secret is required", + "BOTNAME_REQUIRED": "Bot name is required", + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Mandatory Field", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Mandatory Field", + "TAG_REQUIRED": "Mandatory Field", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Mandatory Field", + "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "NAME_MUST_VALID_PATTERN": "Wrong format", + "KEY_REQUIRED": "Mandatory Field", + "LIST_REQUIRED": "Mandatory Field", + "COMMAND_REQUIRED": "Mandatory Field", + "TEXT_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "VALUE_REQUIRED": "Mandatory Field", + "TEXT_REQUIRED": "The field text is required", + "NAME_REQUIRED": "Mandatory field", + "AGENT_TIMEOUT_REQUIRED": "Mandatory field", + "MOTIONADDRESS_REQUIRED": "Mandatory field", + "MOTIONADDRESS_MUST_VALID_URL": "Wrong format", + "ACCEPTURL_MUST_VALID_URL": "Wrong format", + "TIMEOUT_REQUIRED": "Mandatory field", + "REJECTURL_MUST_VALID_URL": "Wrong format", + "CLOSEURL_MUST_VALID_URL": "Wrong format", + "REPLYURI_REQUIRED": "Mandatory field", + "REPLYURI_MUST_VALID_URL": "Wrong format", + "PRIORITY_REQUIRED": "Mandatory field", + "CONDITION_REQUIRED": "Mandatory field", + "TRUEPRIORITY_REQUIRED": "Mandatory field", + "FALSEPRIORITY_REQUIRED": "Mandatory field", + "AGENT_REQUIRED": "Mandatory field", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "DISPOSITION_REQUIRED": "Mandatory field", + "QUEUE_REQUIRED": "Mandatory field", + "KEY_MAX_LENGTH": "Key must have a maximum length equal to {{max}}", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Mandatory field" + }, + "STRATEGY": "Strategy", + "AGENT": "Agent", + "GOTO": "Goto", + "GOTOIF": "Gotoif", + "NOOP": "Noop", + "QUEUE": "Queue", + "EDIT_AGENT": "Edit Agent", + "EDIT_GOTO": "Edit Goto", + "EDIT_NOOP": "Edit Noop", + "EDIT_GOTOIF": "Edit Gotoif", + "EDIT_QUEUE": "Edit Queue", + "CONDITION": "Condition", + "TRUEPRIORITY": "True Priority", + "FALSEPRIORITY": "False Priority", + "VALUE": "Value", + "PRIORITY": "Priority", + "AGENT_TIMEOUT": "Agent Timeout", + "DESCRIPTION": "Description", + "ADD_OPENCHANNELQUEUE": "Add Open Channel Queue", + "EDIT_OPENCHANNELQUEUE": "Edit Open Channel Queue", + "DELETE_OPENCHANNELQUEUE": "Delete Open Channel Queue", + "PENALTY": "Penalty", + "TEAMADD_OPENCHANNELQUEUE": "Add Team To Open Channel Queue", + "AGENTADD_OPENCHANNELQUEUE": "Add Agent To Open Channel Queue", + "ALL_AGENTS": "All Agents", + "SELECTED_AGENTS": "Selected Agents", + "CREATED_AT": "Created At", + "SAVE": "Save", + "SETTINGS": "Settings", + "GENERAL": "General", + "OPENCHANNELACCOUNTS": "Open Channel Accounts", + "MOTIONADDRESS": "Motion Address", + "ADD_OPENCHANNELACCOUNT": "Add Open Channel Account", + "EDIT_OPENCHANNELACCOUNT": "Edit Open Channel Account", + "DELETE_OPENCHANNELACCOUNT": "Delete Open Channel Account", + "API": "API", + "DISPOSITIONS": "Dispositions", + "WEBHOOKS": "WebHooks", + "ACTIONS": "Actions", + "LIST": "List", + "FIDELITY": "Fidelity", + "ACCEPT": "Accept", + "ACCEPTMETHOD": "Accept Method", + "ACCEPTURL": "Accept URL", + "REJECT": "Reject", + "REJECTMETHOD": "Reject Method", + "REJECTURL": "Reject URL", + "CLOSE": "Close", + "CLOSEMETHOD": "Close Method", + "CLOSEURL": "Close URL", + "SELECTED": "Selected", + "SELECT_ALL": "Select All", + "SELECT_NONE": "Select None", + "BACK": "Back", + "OPENCHANNEL": "Open Channel", + "ID": "Id", + "TIMEOUT": "Timeout", + "OPENCHANNELDISPOSITIONS": "Open Channel Dispositions", + "NO_OPENCHANNELDISPOSITION_AVAILABLE": "No Open Channel Dispositions available", + "NEW_OPENCHANNELDISPOSITION": "New Open Channel Disposition", + "ADD_OPENCHANNELDISPOSITION": "Add Open Channel Disposition", + "EDIT_OPENCHANNELDISPOSITION": "Edit Open Channel Disposition", + "DELETE_OPENCHANNELDISPOSITION": "Delete Open Channel Disposition", + "NEW_OPENCHANNELQUEUE": "New Open channel Queue", + "NEW_OPENCHANNELACCOUNT": "New Open channel Account", + "NO_AVAILABLE_INFO": "No available info", + "ALL_TEAMS": "All Teams", + "SELECTED_TEAMS": "Selected Teams", + "REPLYURI": "Reply URL", + "RECEIVEURI": "Receive URL", + "HELP": { + "WELCOMEMESSAGE": "This is the first response message sent to new interactions.", + "TOKEN": "Add this property as query string in your Web Service URL. For more details see the doc here", + "RECEIVEURI": "Auto-generated API string to be used in order to receive messages inside your open channel from the external application (using POST method). Click the clipboard button to copy it ", + "REPLYURI": "The URL the open channel will call when sending or replying to a message. For more details see the doc here", + "NAME": "Only numbers, letters and specific characters (._) are supported", + "LIST": "Contact Manager List used to associate contacts", + "MANDATORYDISPOSITION": "Mandatory disposition", + "MANDATORYDISPOSITIONPAUSEID": "Pause to use if mandatory disposition is enabled" + }, + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "OF": "of", + "CONTACT": "Contact", + "STARTEDAT": "Started At", + "LASTMESSAGE": "Last message", + "STATUS": "Status", + "CLOSED": "Closed", + "OPENED": "Open", + "OPEN": "Open", + "ACCOUNT": "Account", + "INTERACTION": "Interaction", + "INTERACTIONS": "Interactions", + "ALL": "All", + "SELECT_STATUS": "Select a status", + "FILTER": "Filter", + "FILTERS": "Filters", + "CLOSEDAT": "Closed At", + "DISPOSITION": "Disposition", + "NOTES": "Notes", + "NO_INTERACTION_AVAILABLE": "No interactions available", + "SELECT_ACCOUNT": "Select an account", + "GOTOP": "Gotop", + "EDIT_GOTOP": "Edit Gotop", + "EDIT_CLOSE": "Edit Close", + "INFO": "Info", + "KEY": "Key", + "UNKNOWN": "Unknown", + "UNREGISTERED": "Unregistered", + "UNAVAILABLE": "Unavailable", + "NOT_INUSE": "Not in use", + "REACHABLE": "Reachable", + "IN_USE": "In use", + "AGENTS": "Agents", + "QUEUES": "Queues", + "FULLNAME": "Fullname", + "INTERNAL": "Internal", + "PHONE_STATE": "Phone State", + "PHONE_STATUS": "Phone Status", + "PAUSE": "Pause", + "LOGOUT": "Logout", + "AGENTADD_QUEUE": "Add agent to Open Channel queue", + "UNPAUSE": "End Pause", + "DEFAULT_PAUSE": "Default pause", + "LOGGED_IN": "Logged in", + "PAUSED": "Paused", + "READY": "Ready", + "WAITING": "Waiting", + "VOICE": "Voice", + "CHAT": "Chat", + "MAIL": "Email", + "SMS": "SMS", + "FAX": "Fax", + "AGENTSADD_QUEUE": "Add agents to Open Channel queue", + "INTERACTIONS_OPENCHANNELACCOUNT": "Go to Interactions", + "REFRESH_INTERACTIONS": "Refresh Interactions", + "DELETE_INTERACTION": "Delete Interaction", + "AGENTADD_OPENCHANNELACCOUNT": "Add Agent to Openchannel Account", + "CANNED_ANSWER_SEARCH": "Enter a text to seach a Canned Answer", + "CANNED_ANSWER_NOT_FOUND": "No Canned Answer were found", + "SEND": "Send", + "TO": "To", + "MAPKEY": "Map Key", + "TEAMS_ASSOCIATION": "Teams Association", + "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", + "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available", + "DOWNLOAD_WITH_ATTACHMENTS": "Download with attachments", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download without attachments" + } +} diff --git a/public/app/main/apps/plugins/i18n/is.json b/public/app/main/apps/plugins/i18n/is.json new file mode 100644 index 0000000..be8be0f --- /dev/null +++ b/public/app/main/apps/plugins/i18n/is.json @@ -0,0 +1,7 @@ +{ + "PLUGINS": { + "PLUGINS": "Plugins", + "ERRORS": {}, + "HELP": {} + } +} diff --git a/public/app/main/apps/settings/i18n/et.json b/public/app/main/apps/settings/i18n/et.json index 3fc4dff..b1f5844 100644 --- a/public/app/main/apps/settings/i18n/et.json +++ b/public/app/main/apps/settings/i18n/et.json @@ -158,7 +158,8 @@ "USERNAME_REQUIRED": "Kohustuslik väli", "FIELD_REQUIRED": "Kohustuslik väli", "PREVIEW_RECALLME_REMINDER_INTERVAL_REQUIRED": "Kohustuslik väli", - "WRONG_FORMAT": "Vale formaat" + "WRONG_FORMAT": "Vale formaat", + "PREVIEW_RECALLME_REMINDER_INTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Väärtus peab olema suurem või võrdne sellega" }, "EDIT_NETWORK": "Redigeeri Võrku", "DELETE_NETWORK": "Kustuta Võrk", diff --git a/public/app/main/apps/settings/i18n/is.json b/public/app/main/apps/settings/i18n/is.json new file mode 100644 index 0000000..6a12726 --- /dev/null +++ b/public/app/main/apps/settings/i18n/is.json @@ -0,0 +1,309 @@ +{ + "SETTINGS": { + "RTLSUPPORT": "RTL Support", + "PREFERRED": "Preferred Logo", + "DEFAULT_PREFERRED": "Default Preferred Logo", + "FAVICON": "Favicon", + "DEFAULT_FAVICON": "Default Favicon", + "MOTIONBARREMEMBERME": "Remember Me", + "CHATTIMEOUT": "Chat closing interaction timeout", + "VIRTUAL": "Chat", + "VOICE": "Voice", + "SESSIONS": "Sessions", + "ADDONS": "Add-ons", + "REPORT": "Report", + "SPLIT": "Split report", + "SPLITSIZECSV": "Split report size [CSV records]", + "SPLITSIZEPDF": "Split report size [PDF records]", + "SPLITSIZEXLSX": "Split report size [XLSX records]", + "ENABLEEMAILPREVIEW": "Enable Email Preview", + "COPY_LICENSE": "Copy token to clipboard", + "DOWNLOAD_LICENSE_LOG_FILE": "Download license log file", + "LICENSE_LOG_FILE": "License log file", + "LICENSE_LOG_FILE_DOWNLOADED": "License log file downloaded!", + "CLIPBOARD": "Clipboard", + "COPIED_TO_CLIPBOARD": "Token copied to clipboard", + "JAWS": "Jaws", + "MOTIONBAR": "Motionbar", + "MOTIONBARAUTOUPDATER": "Auto Updater", + "MOTIONBARAUTOUPDATERURL": "Auto Updater URL", + "SMTP_SSL": "SMTP SSL", + "CALL_RECORDING_ENCRYPTION": "Voice Recording Encryption", + "TURNADDR": "TURN Address", + "TURN_USERNAME": "TURN Username", + "TURN_PASSWORD": "TURN Password", + "WEBRTC": "WebRTC", + "CALLYSQUARE": "Cally Square", + "PREVIEW_RECALLME_REMINDER_INTERVAL": "Preview Recallme Reminder Interval", + "ENABLED": "Enabled", + "DISABLED": "Disabled", + "UNLIMITED_CHANNELS": "Unlimited Channels", + "RELOAD": "Reload", + "VERIFY": "Verify", + "INTERFACE": "Interface", + "UPDATING": "Updating", + "REMOTE_VERSION": "Remote Version", + "NO_NEW_VERSION_AVAILABLE": "No new version available", + "TOP_N_PROCESSES": "Top {{value}} processes", + "SYSTEM": "System", + "FILE_SYSTEM": "File System", + "PROCESSES": "Processes", + "MOUNT_POINT": "Mount", + "AVG_LOAD": "AVG Load", + "TOTAL": "Total", + "USED": "Used", + "FREE": "Free", + "NAME": "Name", + "STATE": "State", + "CHAT": "Chat", + "MAIL": "Email", + "MESSAGING": "Sms", + "WHATSAPP": "WhatsApp Connector", + "FAX": "Fax", + "OPENCHANNEL": "Open Channel", + "AGENTS": "Agents", + "USERS": "Users", + "TELEPHONES": "Telephones", + "STAFF": "Staff", + "CHANNELS": "Channels", + "MODULES": "Modules", + "CM": "Contacts Manager", + "DIALER": "Dialer", + "JSCRIPTY": "Jscripty", + "CUSTOM": "Customization", + "VIDEO": "Video", + "SCREENRECORDING": "Screen Recording", + "UPDATE": "Update", + "OTHERS": "Others", + "SETTINGS": "Settings", + "GENERAL": "General", + "SMTP": "SMTP", + "NETWORKS": "Networks", + "UPDATES": "Updates", + "LICENSE": "License", + "ID": "Id", + "MIN_INTERNAL": "Min Internal", + "MIN_MAILBOX": "Min Mailbox", + "INSTALLED_AT": "Installed At", + "SEARCH_FOR_ANYONE": "Search", + "EDIT_GENERAL": "Edit General", + "SECURE_PASSWORD": "Secure Password", + "LOGO": "Logo", + "DEFAULT_LOGO": "Default Logo", + "DEFAULT_LOGIN_LOGO": "Default Login Logo", + "WHITELABEL": "White Label", + "DEFAULT_HEADER_WHITELABEL": "Default Header White Label", + "HEADER_WHITELABEL": "Header White Label", + "CREATED_AT": "Created At", + "SAVE": "Save", + "SMTP_SERVICE": "Service", + "SMTP_HOST": "Host", + "SMTP_USERNAME": "Username", + "DESCRIPTION": "Description", + "SMTP_PASSWORD": "Password", + "SMTP_PORT": "Port", + "SMTP_SECURE": "Secure", + "TYPE": "Type", + "ADDRESS": "Address", + "USERNAME": "Username", + "NEW_NETWORK": "New Network", + "ADD_NETWORK": "Add Network", + "IMAPGENERALSETTINGS": "IMAP", + "LOGINMAILFREQUENCY": "Login Mail Frequency (sec)", + "DEFAULTSCREENRECORDINGPATH": "Screen Recording path", + "APPZONE": "App Zone", + "EDIT_NETWORK": "Edit Network", + "DELETE_NETWORK": "Delete Network", + "BACK": "Back", + "SELECTED": "Selected", + "SELECT_ALL": "Select All", + "SELECT_NONE": "Select None", + "EXPIRATION_DATE": "Expiration Date", + "REQUEST_LICENSE": "Request License", + "EMAIL": "Email", + "SEND": "Send", + "PLAN": "Plan", + "MONTH_TO_MONTH": "Month to month", + "MOTION_PROCESS_MANAGEMENT": "Motion Process Management", + "USEFUL_COMMANDS": "Useful Commands", + "COMMAND": "Command", + "PM2_LIST": "List all processes", + "PM2_START": "Start a process by id or name", + "PM2_STOP": "Stop a process by id or name or insert 'all' to stop all the active processes", + "PM2_RESTART": "Restart a process by id or name", + "PM2_LOGS": "Stream all processes log files, unless a specific process id or name is provided", + "PASSWORD": "Password", + "NO_AVAILABLE_INFO": "No available info", + "STUNADDR": "STUN Address", + "CHANGELOG": "Changelog", + "CURRENT_VERSION": "Current version", + "CUSTOMIZATIONS": "Customizations", + "LOCALNETADDRESS": "Localnet Address", + "NEW_VERSION": "New Version", + "TRIAL_VERSION": "Trial Version", + "TOKEN": "Token", + "NEW_TOKEN_DETECTED": "New Token Detected", + "EXPIRATION_GRAY_PERIOD": "Gray Period Expiration", + "NEW_TOKEN": "New Token", + "PRICES": "Prices", + "UPDATE_LICENSE": "Update License", + "LOGOLOGIN": "Login Logo", + "EXPIRATION_REASON": "Expiration Reason", + "GLOBAL": "Global", + "SMTP_AUTHENTICATION": "Authentication", + "LICENSE_REQUEST_SENT": "Thank you! The Licensing Team will check your account asap in order to approve your request: you will receive an email when the changes become effective. Please refer to license@xcally.com for further informations.", + "ACCOUNTNAME": "Account Name", + "EMAILADDRESS": "Email Address", + "EXPIRATION_REASON_MESSAGE_DISABLED": "Your license has been disabled.", + "EXPIRATION_REASON_MESSAGE_CHANGED": "Your machine unique id has been updated due to a change to your system.", + "EXPIRATION_CHANGED_ADVISE": "Contact xCALLY Motion License Team sending both your old and your new uuid.", + "OLD_TOKEN": "Old Token", + "SEND_EMAIL_TO": "Send Email to", + "JIRA_ERROR_MESSAGE": "Error during license request. Please contact our license team at license@xcally.com with your request", + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "OF": "of", + "PAGE_TITLE": "Page Title", + "DEFAULT_PAGE_TITLE": "Default Page Title", + "PERPETUAL": "Perpetual", + "SECURITY_SUITE": "Security Suite", + "ANNUALLY": "Annually", + "AGENTOMNIDESKTOPINTERFACE": "Agent Omni Desktop Interface", + "MESSAGESALIGNMENT": "Messages Alignment", + "ENTER_LICENSE": "Enter your license", + "UPDATE_LICENSE_MANUALLY": "Do you want to update your license manually?", + "SECURITY": "Security", + "ALLOWEDLOGINATTEMPTS": "Allowed login attempts before locking the user/agent", + "BLOCKDURATION": "Minutes to wait before automatic unlock", + "AI": "A.I. Tools", + "AITOOLS": "A.I. Tools", + "SERVICE": "Service", + "NEW_CLOUDPROVIDER": "New Account", + "ADD_CLOUDPROVIDER": "Add Account", + "DELETE": "Delete", + "SECRETACCESSKEY": "Secret Access Key", + "ACCESSKEY": "Access Key ID", + "EDIT_CLOUDPROVIDER": "Edit Account", + "DELETE_CLOUDPROVIDER": "Delete Account", + "LANGUAGE": "Language", + "BUCKET": "Bucket", + "TRANSCRIBE": "Transcribe", + "TRANSCRIBEREGION": "Transcribe Region", + "TRANSCRIBEACCOUNT": "Transcribe Account", + "SENTIMENTANALYSIS": "Sentiment Analysis", + "SENTIMENTREGION": "Sentiment Analysis Region", + "SENTIMENTACCOUNT": "Sentiment Analysis Account", + "SSO": "SSO", + "GOOGLE_SSO_ENABLED": "Google SSO Enabled", + "ENFORCE_PASSWORD_HISTORY": "Enforce Password History", + "PASSWORD_HISTORY_LIMIT": "Password History Limit", + "PRIVACY_POLICY_EMAIL": "Privacy Policy for Email Addresses", + "PRIVACY_POLICY_NAME": "Privacy Policy for Names", + "PRIVACY_POLICY_NUMBER": "Privacy Policy for Numbers", + "SEARCH_ON_ENTER_KEY": "Search on Enter key", + "CHAT_INTERACTIONS_RELOAD_TIMEOUT": "Chat interactions reload timeout", + "MAIL_INTERACTIONS_RELOAD_TIMEOUT": "Email interactions reload timeout", + "OPENCHANNEL_INTERACTIONS_RELOAD_TIMEOUT": "Open Channel interactions reload timeout", + "SMS_INTERACTIONS_RELOAD_TIMEOUT": "SMS interactions reload timeout", + "WHATSAPP_INTERACTIONS_RELOAD_TIMEOUT": "WhatsApp Connector interactions reload timeout", + "STOP_RECORDING_ON_VOICE_CALL_TRANSFER": "Stop recording on voice call transfer", + "DISABLED_COOKIE": "Cookies banner", + "AD_SSO_ENABLED": "Active Directory SSO Enabled", + "CLOUD_PROVIDERS": "Cloud Providers", + "APPLICATION_ID": "Application Id", + "TENANT_ID": "Tenant Id", + "CLIENT_SECRET": "Client Secret", + "NEW_CLIENT_SECRET": "New Client Secret", + "REDIRECT_URI": "Redirect URI", + "REMOTE_URI": "Remote URI", + "AUTHENTICATE": "Authenticate", + "AUTHENTICATE_TO_MICROSOFT_IDENTITY_PLATFORM": "Authenticate to Microsoft Identity Platform", + "MICROSOFT_AUTHENTICATION_SUCCESS": "Authentication to the Microsoft Identity Platform completed successfully", + "MICROSOFT_AUTHENTICATION_FAIL": "Something went wrong while authenticating to the Microsoft Identity Platform", + "UPDATE_CLIENT_SECRET": "Update Client Secret", + "HELP": { + "DEFAULTSCREENRECORDINGPATH": "Enter the path where to store screen recording files on the Agent computer (leave empty for default Video Folder path)", + "RTLSUPPORT": "Enables the RTL Support for Arabic, Persian and Hebrew languages", + "ADDRESS": "External (public) ip address", + "LOCALNETADDRESS": "Local ip address/subnet", + "SMTP_SECURE": "If true, the connection to the server will use TLS", + "SMTP_USERNAME": "Username used for authentication", + "SMTP_PASSWORD": "Password used for authentication", + "EMAILADDRESS": "The message origin Email address (from)", + "SECURITY_SUITE": "Enables the secure password format, the mandatory password reset after the first login and the password expiration after 90 days", + "MOTIONBARREMEMBERME": "Enable/Disable the Remember Me feature in Motion Phonebar", + "LOGINMAILFREQUENCY": "Please remember to restart the EMAIL service each time this parameter has been changed", + "USERNAME": "Username", + "PASSWORD": "Password", + "PREVIEW_RECALLME_REMINDER_INTERVAL": "Time interval in minutes before which notification will be sent to agent informing him about preview recall to be made", + "ENFORCE_PASSWORD_HISTORY": "Enables the validation against previously used passwords", + "PASSWORD_HISTORY_LIMIT": "Number of last used unique passwords to check", + "PRIVACY_POLICY": "Number of characters that will be replaced with an asterisk (*) (0 = all characters)", + "SEARCH_ON_ENTER_KEY": "Start searching only after the agent hits the Enter key", + "INTERACTIONS_RELOAD_TIMEOUT": "Time interval in seconds after which interactions are reloaded (0 = real-time update)", + "CLIENT_SECRET": "The secret will no longer be visible once the configuration is saved. Store it safely if you want to use it elsewhere.", + "LIMIT_TABS": "Maximum number of possible interaction tabs open" + }, + "ERRORS": { + "CHATTIMEOUT_REQUIRED": "Mandatory field", + "CHATTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "MOTIONBARAUTOUPDATERURL_MUST_VALID_URL": "Wrong format", + "MOTIONBARAUTOUPDATERURL_REQUIRED": "Mandatory field", + "ADDRESS_REQUIRED": "Mandatory field", + "MIN_INTERNAL_REQUIRED": "Mandatory field", + "MIN_MAILBOX_REQUIRED": "Mandatory field", + "NAME_REQUIRED": "Mandatory field", + "HEADER_WHITELABEL_REQUIRED": "Mandatory field", + "LOCALNETADDRESS_REQUIRED": "Mandatory field", + "LOCALNETADDRESS_MUST_VALID_PATTERN": "Wrong format", + "ADDRESS_MUST_VALID_PATTERN": "Wrong format", + "ACCOUNTNAME_REQUIRED": "Mandatory field", + "EMAIL_MUST_VALID": "Wrong format", + "SMTP_USERNAME_REQUIRED": "Mandatory field", + "PASSWORD_REQUIRED": "Mandatory field", + "SMTP_HOST_REQUIRED": "Mandatory field", + "SMTP_PORT_REQUIRED": "Mandatory field", + "PREVIEW_RECALLME_REMINDER_INTERVAL_REQUIRED": "Mandatory field", + "MIN_INTERNAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "MIN_MAILBOX_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "PAGE_TITLE_REQUIRED": "Mandatory field", + "EMAIL_REQUIRED": "Mandatory field", + "PLAN_REQUIRED": "Mandatory field", + "LICENSE_REQUIRED": "Mandatory field", + "LOGINMAILFREQUENCY_REQUIRED": "Mandatory field", + "LOGINMAILFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "ALLOWEDLOGINATTEMPTS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "BLOCKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "ALLOWEDLOGINATTEMPTS_REQUIRED": "Mandatory field", + "BLOCKDURATION_REQUIRED": "Mandatory field", + "SERVICE_REQUIRED": "Mandatory field", + "SECRETACCESSKEY_REQUIRED": "Mandatory field", + "ACCESSKEY_REQUIRED": "Mandatory field", + "LANGUAGE_REQUIRED": "Mandatory field", + "BUCKET_REQUIRED": "Mandatory field", + "TRANSCRIBEREGION_REQUIRED": "Mandatory field", + "TRANSCRIBEACCOUNT_REQUIRED": "Mandatory field", + "SENTIMENTREGION_REQUIRED": "Mandatory field", + "SENTIMENTACCOUNT_REQUIRED": "Mandatory field", + "USERNAME_REQUIRED": "Mandatory field", + "FIELD_REQUIRED": "Mandatory field", + "WRONG_FORMAT": "Wrong format", + "PREVIEW_RECALLME_REMINDER_INTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to" + }, + "NOTIFICATIONS": { + "MICROSOFT_AUTHENTICATION_SUCCESS": "Authentication to the Microsoft Identity Platform completed successfully", + "MICROSOFT_AUTHENTICATION_FAIL": "Something went wrong while authenticating to the Microsoft Identity Platform", + "CLOUD_PROVIDER_CREATED_SUCCESS_TITLE": "Cloud Provider successfully created", + "CLOUD_PROVIDER_SAVED_SUCCESS_TITLE": "Cloud Provider successfully saved", + "CLOUD_PROVIDER_DELETE_TITLE": "Are you sure want to delete the cloud provider?", + "CLOUD_PROVIDER_DELETE_MESSAGE": "{{ name }} will be deleted", + "CLOUD_PROVIDER_DELETED_SUCCESS_TITLE": "Cloud Provider successfully deleted", + "CLOUD_PROVIDERS_DELETE_TITLE": "Are you sure want to delete the selected cloud providers?", + "CLOUD_PROVIDERS_DELETE_MESSAGE": "{{ total }} cloud providers will be deleted", + "CLOUD_PROVIDERS_DELETED_SUCCESS_TITLE": "Cloud Providers successfully deleted", + "SMTP_SAVED_SUCCESS_TITLE": "SMTP configuration successfully saved", + "CLOUD_PROVIDER_SECRET_UPDATE_SUCCESS_TITLE": "Client Secret successfully updated" + }, + "LIMIT_TABS": "Limit of interaction tab" + } +} diff --git a/public/app/main/apps/sms/i18n/is.json b/public/app/main/apps/sms/i18n/is.json new file mode 100644 index 0000000..9f9a57b --- /dev/null +++ b/public/app/main/apps/sms/i18n/is.json @@ -0,0 +1,297 @@ +{ + "SMS": { + "EDIT_DIALOGFLOWV2": "Edit Dialogflow V2", + "DIALOGFLOWV2": "Dialogflow V2", + "PRIVATEKEY": "Private Key", + "CLIENTEMAIL": "Client Email", + "PROJECTID": "Project ID", + "AMAZONLEX": "AmazonLex", + "EDIT_AMAZONLEX": "Edit Lex configuration", + "ACCESSKEYID": "Access key ID", + "SECRETACCESSKEY": "Access key secret", + "LEXREGION": "Region", + "BOTNAME": "Bot name", + "WELCOMEMESSAGE": "Welcome message", + "LOGIN_TIME": "Login time", + "PAUSE_TIME": "Pause time", + "DOWNLOAD_INTERACTION": "Download", + "TRANSFER": "Transfer", + "QUEUETRANSFER": "Queue Transfer", + "QUEUETRANSFERTIMEOUT": "Queue Transfer Timeout", + "AGENTTRANSFER": "Agent Transfer", + "AGENTTRANSFERTIMEOUT": "Agent Transfer Timeout", + "TAG": "Tag", + "EDIT_TAG": "Edit Tag", + "WAITFORTHEASSIGNEDAGENT": "Wait for the assigned agent", + "NOTIFICATION": "Notification", + "NOTIFICATIONSOUND": "Sound", + "NOTIFICATIONSHAKE": "Shake", + "NOTIFICATIONTEMPLATE": "Template", + "SYSTEM": "System", + "EDIT_SYSTEM": "Edit System", + "COMMAND": "Command", + "VARIABLE": "Variable", + "AUTHID": "Auth ID", + "NO_SMSDISPOSITIONS_AVAILABLE": "No Sms Disposition Available", + "CANNEDANSWERS": "Canned Answers", + "SMSCANNEDANSWERS": "Canned Answers", + "NO_SMSCANNEDANSWER_AVAILABLE": "No Canned Answers Available", + "NEW_SMSCANNEDANSWER": "New Canned Answer", + "ADD_SMSCANNEDANSWER": "Add Canned Answer", + "EDIT_SMSCANNEDANSWER": "Edit", + "DELETE_SMSCANNEDANSWER": "Delete", + "DELIVERYREPORTURL": "Delivery Report URL", + "DELETE": "Delete", + "SENDERSTRING": "Sender String", + "DELIVERYREPORT": "Delivery Report", + "METHOD": "Method", + "ADD_NOTE": "Add note", + "NOTE": "Note", + "SPYINTERACTION": "Spy", + "AUTOREPLY": "Auto Reply", + "EDIT_AUTOREPLY": "Edit Auto Reply", + "TIMES": "Number of times per interaction", + "TEXT": "Text", + "INSERT_MESSAGE_HERE": "Insert your text message here", + "CANNED_ANSWER_NOT_FOUND": "No Canned Answers were found", + "CANNED_ANSWER_SEARCH": "Enter a text to search a Canned Answer", + "SEND": "Send", + "TO": "To", + "MESSAGE": "Message", + "TAGS": "Tags", + "NO_AGENT_ONLINE": "No Agent Online", + "GOTOREALTIME_SMSQUEUE": "Go To Realtime Sms Queue", + "PARTIALPAUSE": "Parital Pause", + "BUSY": "Busy", + "TIMER": "Timer", + "IDLE": "Idle", + "CAPACITY": "Capacity", + "PROXY": "Proxy", + "ADVANCED": "Advanced", + "MOTIONPROXY": "Proxy Or Motion Domain", + "REALTIME": "Realtime", + "KEY": "Key", + "NAME": "Name", + "SMSQUEUES": "SMS Queues", + "SEARCH_FOR_ANYONE": "Search", + "STRATEGY": "Strategy", + "BASEURL": "Base URL", + "MANDATORYDISPOSITION": "Mandatory disposition", + "MANDATORYDISPOSITIONPAUSEID": "Pause to use when mandatory disposition is enabled", + "ERRORS": { + "PROJECTID_REQUIRED": "Mandatory Field", + "CLIENTEMAIL_REQUIRED": "Mandatory Field", + "PRIVATEKEY_REQUIRED": "Mandatory Field", + "ACCESSKEYID_REQUIRED": "Access key ID is required", + "SECRETACCESSKEY_REQUIRED": "Access key secret is required", + "BOTNAME_REQUIRED": "Bot name is required", + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Mandatory Field", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Mandatory Field", + "TAG_REQUIRED": "Mandatory Field", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Mandatory Field", + "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "NAME_MUST_VALID_PATTERN": "Wrong format", + "COMMAND_REQUIRED": "Mandatory Field", + "AUTHID_REQUIRED": "Mandatory Field", + "TEXT_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "TEXT_REQUIRED": "Mandatory Field", + "VALUE_REQUIRED": "Mandatory Field", + "SENDERSTRING_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "SENDERSTRING_MUST_VALID_PATTERN": "Wrong format", + "METHOD_REQUIRED": "Mandatory Field", + "MOTIONPROXY_REQUIRED": "Mandatory Field", + "MOTIONPROXY_MUST_VALID_URL": "Wrong format", + "KEY_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "KEY_REQUIRED": "Mandatory Field", + "NAME_REQUIRED": "Mandatory Field", + "AGENT_TIMEOUT_REQUIRED": "Mandatory Field", + "PHONE_REQUIRED": "Mandatory Field", + "SID_REQUIRED": "Mandatory Field", + "TOKEN_REQUIRED": "Mandatory Field", + "USERNAME_REQUIRED": "Mandatory Field", + "PASSWORD_REQUIRED": "Mandatory Field", + "MOTIONADDRESS_REQUIRED": "Mandatory Field", + "MOTIONADDRESS_MUST_VALID_URL": "Wrong format", + "ACCEPTURL_MUST_VALID_URL": "Wrong format", + "TIMEOUT_REQUIRED": "Mandatory Field", + "REJECTURL_MUST_VALID_URL": "Wrong format", + "CLOSEURL_MUST_VALID_URL": "Wrong format", + "TYPE_REQUIRED": "Mandatory Field", + "LIST_REQUIRED": "Mandatory Field", + "PRIORITY_REQUIRED": "Mandatory Field", + "CONDITION_REQUIRED": "Mandatory Field", + "TRUEPRIORITY_REQUIRED": "Mandatory Field", + "FALSEPRIORITY_REQUIRED": "Mandatory Field", + "AGENT_REQUIRED": "Mandatory Field", + "QUEUE_REQUIRED": "Mandatory Field", + "DISPOSITION_REQUIRED": "Mandatory Field", + "ACCOUNTSID_REQUIRED": "Mandatory Field", + "AUTHTOKEN_REQUIRED": "Mandatory Field", + "BASEURL_REQUIRED": "Mandatory Field", + "APIKEY_REQUIRED": "Mandatory Field", + "APPLICATIONID_REQUIRED": "Mandatory Field", + "ACCOUNTID_REQUIRED": "Mandatory Field", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Mandatory field" + }, + "AGENT_TIMEOUT": "Agent Timeout", + "DESCRIPTION": "Description", + "ADD_SMSQUEUE": "Add SMS Queue", + "EDIT_SMSQUEUE": "Edit SMS Queue", + "DELETE_SMSQUEUE": "Delete SMS Queue", + "SETTINGS": "Settings", + "GENERAL": "General", + "CREATED_AT": "Created At", + "SAVE": "Save", + "SMSACCOUNTS": "SMS Accounts", + "TYPE": "Type", + "PHONE": "Phone", + "SID": "SID", + "TOKEN": "Token", + "SMSTYPE": "SMS Type", + "USERNAME": "Username", + "PASSWORD": "Password", + "MOTIONADDRESS": "Motion Address", + "ADD_SMSACCOUNT": "Add SMS Account", + "EDIT_SMSACCOUNT": "Edit SMS Account", + "DELETE_SMSACCOUNT": "Delete SMS Account", + "LIST": "List", + "FIDELITY": "Fidelity", + "API": "API", + "DISPOSITIONS": "Dispositions", + "WEBHOOKS": "WebHooks", + "ACTIONS": "Actions", + "ACCEPT": "Accept", + "ACCEPTMETHOD": "Accept Method", + "ACCEPTURL": "Accept URL", + "REJECT": "Reject", + "REJECTMETHOD": "Reject Method", + "REJECTURL": "Reject URL", + "CLOSE": "Close", + "CLOSEMETHOD": "Close Method", + "CLOSEURL": "Close URL", + "SELECTED": "Selected", + "SELECT_ALL": "Select All", + "SELECT_NONE": "Select None", + "BACK": "Back", + "SMS": "SMS", + "ID": "Id", + "APIKEY": "ApiKey", + "APPLICATIONID": "Application ID", + "ACCOUNTID": "Account ID", + "CONFIRM_PASSWORD": "Confirm Password", + "SMSDISPOSITIONS": "SMS Dispositions", + "NO_SMSDISPOSITION_AVAILABLE": "No SMS Dispositions available", + "NEW_SMSDISPOSITION": "New SMS Disposition", + "ADD_SMSDISPOSITION": "Add SMS Disposition", + "EDIT_SMSDISPOSITION": "Edit SMS Disposition", + "DELETE_SMSDISPOSITION": "Delete SMS Disposition", + "NEW_SMSQUEUE": "New SMS Queue", + "NEW_SMSACCOUNT": "New SMS Account", + "NO_AVAILABLE_INFO": "No available info", + "ALL_TEAMS": "All Teams", + "SELECTED_TEAMS": "Selected Teams", + "DIALOGFLOW": "DialogFlow", + "EDIT_DIALOGFLOW": "Edit DialogFlow configuration", + "LANGUAGE": "Language", + "HELP": { + "WELCOMEMESSAGE": "This is the first response message sent to new interactions", + "MOTIONPROXY": "The field must have the following format: ://[:]. Example: https://X.Y.Z.W", + "NAME": "Only numbers, letters and specific characters (._) are supported", + "LIST": "Contact Manager list used to associate contacts", + "RECEIVEURL": "This is the auto-generated API string you need to use to receive the messages inside your account from your SMS provider (POST method must be used): click the clipboard button to copy it", + "DELIVERYREPORTURL": "This is the auto-generated API string you need to use to receive the delivery report of sent messages from your SMS provider (POST method must be used): click the clipboard button to copy it", + "MANDATORYDISPOSITION": "Mandatory disposition", + "MANDATORYDISPOSITIONPAUSEID": "Pause to use when mandatory disposition is enabled" + }, + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "OF": "of", + "TEAMADD_SMSQUEUE": "Add Team To SMS Queue", + "AGENTADD_SMSQUEUE": "Add Agent To SMS Queue", + "ALL_AGENTS": "All Agents", + "SELECTED_AGENTS": "Selected Agents", + "RECEIVEURL": "Receive URL", + "INTERACTION": "Interaction", + "INTERACTIONS": "Interactions", + "NO_INTERACTION_AVAILABLE": "No interactions available", + "CONTACT": "Contact", + "STARTEDAT": "Started At", + "LASTMESSAGE": "Last message", + "AGENT": "Agent", + "CLOSEDAT": "Closed At", + "DISPOSITION": "Disposition", + "NOTES": "Notes", + "GOTO": "Goto", + "GOTOIF": "Gotoif", + "NOOP": "Noop", + "QUEUE": "Queue", + "TIMEOUT": "Timeout", + "VALUE": "Value", + "EDIT_AGENT": "Edit Agent", + "EDIT_GOTO": "Edit Goto", + "EDIT_NOOP": "Edit Noop", + "EDIT_GOTOIF": "Edit Gotoif", + "EDIT_QUEUE": "Edit Queue", + "CONDITION": "Condition", + "TRUEPRIORITY": "True Priority", + "FALSEPRIORITY": "False Priority", + "PRIORITY": "Priority", + "GOTOP": "Gotop", + "EDIT_GOTOP": "Edit Gotop", + "EDIT_CLOSE": "Edit Close", + "FILTER": "Filter", + "SELECT_STATUS": "Select a status", + "ALL": "All", + "SELECT_ACCOUNT": "Select an account", + "OPENED": "Open", + "CLOSED": "Closed", + "STATUS": "Status", + "ACCOUNT": "Account", + "OPEN": "Open", + "INFO": "Info", + "ACCOUNTSID": "Account SID", + "AUTHTOKEN": "Auth Token", + "UNKNOWN": "Unknown", + "UNREGISTERED": "Unregistered", + "UNAVAILABLE": "Unavailable", + "NOT_INUSE": "Not in use", + "REACHABLE": "Reachable", + "IN_USE": "In use", + "AGENTS": "Agents", + "QUEUES": "Queues", + "FULLNAME": "Fullname", + "INTERNAL": "Internal", + "PHONE_STATE": "Phone State", + "PHONE_STATUS": "Phone Status", + "PAUSE": "Pause", + "LOGOUT": "Logout", + "AGENTADD_QUEUE": "Add agent to SMS queue", + "UNPAUSE": "End Pause", + "DEFAULT_PAUSE": "Default pause", + "LOGGED_IN": "Logged in", + "PAUSED": "Paused", + "READY": "Ready", + "WAITING": "Waiting", + "VOICE": "Voice", + "CHAT": "Chat", + "MAIL": "Email", + "OPENCHANNEL": "Open channel", + "FAX": "Fax", + "AGENTSADD_QUEUE": "Add agents to SMS queue", + "INTERACTIONS_SMSACCOUNT": "Go to Interactions", + "REFRESH_INTERACTIONS": "Refresh Interactions", + "DELETE_INTERACTION": "Delete Interaction", + "AGENTADD_SMSACCOUNT": "Add Agent to SMS Account", + "TEAMS_ASSOCIATION": "Teams Association", + "DOWNLOAD_WITH_ATTACHMENT": "Download with attachment", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Download without attachment" + } +} diff --git a/public/app/main/apps/staff/i18n/bs.json b/public/app/main/apps/staff/i18n/bs.json index 16c4dd6..40425f7 100644 --- a/public/app/main/apps/staff/i18n/bs.json +++ b/public/app/main/apps/staff/i18n/bs.json @@ -1,140 +1,140 @@ { "STAFF": { "MANAGE_API_KEY": "API Key Manager", - "GENERATE": "Generate", + "GENERATE": "Generiši", "REGENERATE": "Regenerate", "REMOVE": "Remove", - "APIKEYMANAGER_USER": "API Key Manager", - "APIKEY": "API Key", + "APIKEYMANAGER_USER": "API Upravitelj Ključeva", + "APIKEY": "API Ključ", "VIDEOSUPPORT": "Video support", "HOTDESK": "Hot desk", - "ENABLEVIDEOECORDING": "Enable Video Recording", - "ENABLESCREENRECORDINGBYAGENT": "Enable Screen Recording by Agent", - "ENABLEAUTOMATICSCREENRECORDING": "Enable Automatic Screen Recording", + "ENABLEVIDEOECORDING": "Omogući Video Snimanje", + "ENABLESCREENRECORDINGBYAGENT": "Omogući Snimanje Ekrana od Specijaliste", + "ENABLEAUTOMATICSCREENRECORDING": "Omogući Automatski Snimanje Ekrana", "OLD_PASSWORD": "Old Password", - "ENABLEJAWSINTEGRATION": "Enable Jaws Integration", - "ALIAS": "Alias", + "ENABLEJAWSINTEGRATION": "Omogući Jaws Intergraciju", + "ALIAS": "Pseudonim", "NO_PASSWORD_CHANGE": "No Password Change", "SECURITY_SUITE": "Security Suite", - "AUTO_ANSWER": "Auto answer", - "CHAT_AUTOANSWER": "Chat auto answer", - "CHAT_AUTOANSWERDELAY": "Chat auto answer delay [s]", - "EMAIL_AUTOANSWER": "Email auto answer", - "EMAIL_AUTOANSWERDELAY": "Email auto answer delay [s]", + "AUTO_ANSWER": "Automatski odgovor", + "CHAT_AUTOANSWER": "Chat automatski odgovor", + "CHAT_AUTOANSWERDELAY": "Chat automatski dogovor odgoda [s]", + "EMAIL_AUTOANSWER": "E-Mail automatski odgovor", + "EMAIL_AUTOANSWERDELAY": "E-Mail automatski odgovor odgoda [s]", "SMS_AUTOANSWER": "Sms auto answer", "SMS_AUTOANSWERDELAY": "Sms auto answer delay [s]", "OPENCHANNEL_AUTOANSWER": "Openchannel auto answer", "OPENCHANNEL_AUTOANSWERDELAY": "Openchannel auto answer delay [s]", - "FAX_AUTOANSWER": "Fax auto answer", - "FAX_AUTOANSWERDELAY": "Fax auto answer delay [s]", + "FAX_AUTOANSWER": "Fax automatski odgovor", + "FAX_AUTOANSWERDELAY": "Fax automatski odgovor odgoda [s]", "WHATSAPP_AUTOANSWER": "Whatsapp connector auto answer", "WHATSAPP_AUTOANSWERDELAY": "Whatsapp connector auto answer delay [s]", "LAST_PASSWORD_RESET_AT": "Last Password Reset At", "SIP_WEBRTC": "Sip", "SETTINGS_WEBRTC": "Settings", "WEBRTC": "WebRTC", - "DTLSCERTFILE": "TLS certificate", - "DTLSPRIVATEKEY": "TLS certificate's private key", - "CONTEXT": "Context", + "DTLSCERTFILE": "TLS certifikat", + "DTLSPRIVATEKEY": "TLS certifikatov privatni ključ", + "CONTEXT": "Kontekst", "RINGINUSE": "Ring In Use", "USERS": "Users", - "AGENTS": "Agents", + "AGENTS": "Specijalisti", "TOGGLE_SIDENAV": "Toggle sidenav", "SEARCH_FOR_ANYONE": "Search", - "BACK": "Back", + "BACK": "Nazad", "MULTI_SELECT_TOGGLE": "multi select toggle", "SELECT_ALL": "Select all", "SELECT_NONE": "Select None", "SELECTED": "Selected", - "DELETE_SELECTED": "Delete selected", - "EXPORT_SELECTED": "Export selected", - "ALL_USERS": "All users", - "ALL_AGENTS": "All agents", + "DELETE_SELECTED": "Izbriši odabrano", + "EXPORT_SELECTED": "Izvezi odabrano", + "ALL_USERS": "Svi Korisnici", + "ALL_AGENTS": "Svi specijalisti", "SORT": "sort", "NAME": "Name", - "FULLNAME": "Full Name", - "A_TO_Z": "(A to Z)", + "FULLNAME": "Puno Ime", + "A_TO_Z": "(A do Z)", "Z_TO_A": "(Z to A)", "MORE": "More", - "DELETE_USER": "Delete User", - "EDIT_USER": "Edit User", - "DELETE_AGENT": "Delete Agent", - "EDIT_AGENT": "Edit Agent", - "DELETE": "Delete", + "DELETE_USER": "Izbriši Korisnika", + "EDIT_USER": "Uredi Korisnika", + "DELETE_AGENT": "Izbriši Specijalistu", + "EDIT_AGENT": "Uredi Specijalistu", + "DELETE": "Izbriši", "SAVE": "SAVE", - "ADD_USER": "ADD USER", - "ADD_AGENT": "ADD AGENT", + "ADD_USER": "DODAJ KORISNIKA", + "ADD_AGENT": "DODAJ SPECIJALISTU", "NO_RESULTS": "No results..", - "CLOSE_DIALOG": "Close dialog", + "CLOSE_DIALOG": "Zatvori dijalog", "NAME_REQUIRED": "Name (required)", "USERNAME": "Username", "SHOW_ALL_FIELDS": "Show All Fields", "PHONE_NUMBER": "Phone number", - "EMAIL": "Email", + "EMAIL": "E-Mail", "PASSWORD": "Password", "ERRORS": { - "CONFIRM_REQUIRED": "Mandatory field", - "ALLOWCODECS_REQUIRED": "Mandatory field", - "ENCRYPTION": "SRTP (Secure Realtime Protocol) Encryption", - "DTLSCERTFILE_REQUIRED": "Mandatory field", - "DTLSPRIVATEKEY_REQUIRED": "Mandatory field", - "FULLNAME_REQUIRED": "Mandatory field", - "USERNAME_REQUIRED": "Mandatory field", - "EMAIL_REQUIRED": "Mandatory field", - "PASSWORD_REQUIRED": "Mandatory field", - "CONFIRM_NOT_MATCH": "The passwords don't match", - "EMAIL_MUST_VALID": "Wrong format", - "ACCOUNTNAME_REQUIRED": "Mandatory field", - "NAME_REQUIRED": "Mandatory field", - "HOST_REQUIRED": "Mandatory field", - "CHATCAPACITY_REQUIRED": "Mandatory field", - "MAILCAPACITY_REQUIRED": "Mandatory field", - "FAXCAPACITY_REQUIRED": "Mandatory field", - "SMSCAPACITY_REQUIRED": "Mandatory field", - "WHATSAPPCAPACITY_REQUIRED": "Mandatory field", - "OPENCHANNELCAPACITY_REQUIRED": "Mandatory field", - "SIPEXPIRES_REQUIRED": "Mandatory field", - "SIPPORT_REQUIRED": "Mandatory field", - "UNCONDITIONALNUMBER_REQUIRED": "Mandatory field", - "NOREPLYNUMBER_REQUIRED": "Mandatory field", - "BUSYNUMBER_REQUIRED": "Mandatory field", - "USERNAME_MUST_VALID_PATTERN": "Wrong format {{regex}}", - "REMOTECONTROLPORT_REQUIRED": "Mandatory field", - "CHATCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "MAILCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "FAXCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "OPENCHANNELCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "AUTOANSWERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "AUTOANSWERDELAY_REQUIRED": "Mandatory field", - "MONITOREXTENSION_REQUIRED": "Mandatory field", - "SECURE_PASSWORD_PATTERN": "The password must be at least 8 characters long and have 1 lowercase character, 1 uppercase character, 1 number and 1 special character ~!@#$%^&-_=+[{]}.", - "CRUDPERMISSIONS_REQUIRED": "Mandatory field", - "USERPROFILE_REQUIRED": "Mandatory field", - "PASSWORD_OLDPASSWORD_MATCH": "New password must be different from previous one" + "CONFIRM_REQUIRED": "Obavezno polje", + "ALLOWCODECS_REQUIRED": "Obavezno polje", + "ENCRYPTION": "SRTP (Secure Realtime Protocol) Enkripcija", + "DTLSCERTFILE_REQUIRED": "Obavezno polje", + "DTLSPRIVATEKEY_REQUIRED": "Obavezno polje", + "FULLNAME_REQUIRED": "Obavezno polje", + "USERNAME_REQUIRED": "Obavezno polje", + "EMAIL_REQUIRED": "Obavezno polje", + "PASSWORD_REQUIRED": "Obavezno polje", + "CONFIRM_NOT_MATCH": "Lozinke se ne podudraju", + "EMAIL_MUST_VALID": "Pogrešan format", + "ACCOUNTNAME_REQUIRED": "Obavezno polje", + "NAME_REQUIRED": "Obavezno polje", + "HOST_REQUIRED": "Obavezno polje", + "CHATCAPACITY_REQUIRED": "Obavezno polje", + "MAILCAPACITY_REQUIRED": "Obavezno polje", + "FAXCAPACITY_REQUIRED": "Obavezno polje", + "SMSCAPACITY_REQUIRED": "Obavezno polje", + "WHATSAPPCAPACITY_REQUIRED": "Obavezno polje", + "OPENCHANNELCAPACITY_REQUIRED": "Obavezno polje", + "SIPEXPIRES_REQUIRED": "Obavezno polje", + "SIPPORT_REQUIRED": "Obavezno polje", + "UNCONDITIONALNUMBER_REQUIRED": "Obavezno polje", + "NOREPLYNUMBER_REQUIRED": "Obavezno polje", + "BUSYNUMBER_REQUIRED": "Obavezno polje", + "USERNAME_MUST_VALID_PATTERN": "Pogrešan format {{regex}}", + "REMOTECONTROLPORT_REQUIRED": "Obavezno polje", + "CHATCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "MAILCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "FAXCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "OPENCHANNELCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "AUTOANSWERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "AUTOANSWERDELAY_REQUIRED": "Obavezno polje", + "MONITOREXTENSION_REQUIRED": "Obavezno polje", + "SECURE_PASSWORD_PATTERN": "Lozinka mora imati najmanje 8 znakova i 1 malo slovo, 1 veliko slovo, 1 broj i 1 specijalni znak ~!@#$%^&-_=+[{]}. ", + "CRUDPERMISSIONS_REQUIRED": "Obavezno polje", + "USERPROFILE_REQUIRED": "Obavezno polje", + "PASSWORD_OLDPASSWORD_MATCH": "Nova lozinka mora biti drugačija od prethodne" }, - "ACCOUNT": "Account", + "ACCOUNT": "Nalog", "VOICE": "Voice", - "CREATED_AT": "Created At", + "CREATED_AT": "Kreirano U", "ROLE": "Role", "PERSONAL_INFO": "Personal Info", - "DESCRIPTION": "Description", - "CHANGE_AVATAR": "Change Avatar", - "GENERAL": "General", + "DESCRIPTION": "Opis", + "CHANGE_AVATAR": "Promijeni Avatar", + "GENERAL": "Općenito", "INTERNAL": "Internal", "TRANSPORT": "Transport", - "ALLOWCODECS": "Allowed Codecs", - "DISABLED": "Deactivated", - "BLOCKED": "Locked", + "ALLOWCODECS": "Dozvoljeni Kodeci", + "DISABLED": "Deaktivirano", + "BLOCKED": "Zaključano", "AD_SSO_ENABLED": "Active Directory SSO", - "AUTHENTICATION": "Authentication", + "AUTHENTICATION": "Autentifikacija", "HELP": { "DISABLED": "select to deactivate / unselect to reactivate", "BLOCKED": "Lock / Unlock access", - "APIKEY": "Please use 'API key manager' button on toolbar to manage this key", + "APIKEY": "Molimo koristi 'API Menadžer Ključeva' dugme na traci sa alatkama za upravljanjem ovim ključem", "LAST_PASSWORD_RESET_AT": "Last date and time the password has been changed. If Secure Suite General Setting is enabled, the password will expire after 90 days.", "DTLSCERTFILE": "Link to the valid TLS certificate(.crt file). Default value: '/etc/pki/tls/certs/motion.crt'.", "DTLSPRIVATEKEY": "Link to the certificate's private key(.key file). Default value: '/etc/pki/tls/private/motion.key'.", - "ALLOWCODECS": "Allowed Codecs in order of preference", + "ALLOWCODECS": "Dozvoljeni Kodeci prema željenemo poretku", "TRANSPORT": "Set the default transports in order of preference", "HOST": "How to find the client - IP or host name. If you want the phone to register itself, use the keyword dynamic instead of Host IP", "NAT": "Changes the behaviour of Asterisk for clients behind a firewall. If any of the comma-separated options is 'no', Asterisk will ignore other settings and set nat=no", @@ -156,36 +156,36 @@ "ENABLEAUTOMATICSCREENRECORDING": "The functionality is available only for voice channel", "MASK_SENSITIVE_DATA": "Mask any sensitive data throughout the application (e.g. phone numbers and email addresses)", "WSS_PORT": "Default: 8089", - "AD_SSO_ENABLED": "Login in with your Active Directory credentials" + "AD_SSO_ENABLED": "Prijavi se sa svojima Active Directory akreditivima" }, "NEW_PASSWORD": "New Password", - "CONFIRM_PASSWORD": "Confirm Password", - "CHANGE_PASSWORD": "Change Password", - "CHANGEPASSWORD_AGENT": "Change Password", - "CHANGEPASSWORD_USER": "Change Password", - "CHANGEPASSWORD_TELEPHONE": "Change Password", + "CONFIRM_PASSWORD": "Potvrdi Lozinku", + "CHANGE_PASSWORD": "Promijeni Lozinku", + "CHANGEPASSWORD_AGENT": "Promijeni Lozinku", + "CHANGEPASSWORD_USER": "Promijeni Lozinku", + "CHANGEPASSWORD_TELEPHONE": "Promijeni Lozinku", "LOGININPAUSE": "Login In Pause", "HOST": "Host", "NAT": "NAT", "CHANSPY": "ChanSpy", "OTHER_CHANNELS": "Other Channels", - "CHATCAPACITY": "Chat Capacity", + "CHATCAPACITY": "Chat Kapacitet", "MAILCAPACITY": "Email Capacity", - "FAXCAPACITY": "Fax Capacity", + "FAXCAPACITY": "Fax Kapacitet", "SMSCAPACITY": "Sms Capacity", "WHATSAPPCAPACITY": "WhatsApp Connector Capacity", "OPENCHANNELCAPACITY": "Open Channel Capacity", "MOTIONBAR": "Motion Bar", "SETTINGS": "Settings", - "AUTOANSWER": "Auto Answer", - "ENABLESETTINGS": "Enable Settings", - "CALL_FORWARDING": "Call Forwarding", + "AUTOANSWER": "Automatski Odgovor", + "ENABLESETTINGS": "Omogući Postavke", + "CALL_FORWARDING": "Prosljeđivanje Poziva", "UNCONDITIONAL": "Unconditional", "UNCONDITIONALNUMBER": "Unconditional Number", "NOREPLY": "No Reply", "NOREPLYNUMBER": "No Reply Number", - "BUSY": "Busy", - "BUSYNUMBER": "Busy Number", + "BUSY": "Zauzet", + "BUSYNUMBER": "Zauzet Broj", "REMOTE_CONTROL": "Remote Control", "REMOTECONTROL": "Remote Control", "REMOTECONTROLPORT": "Remote Control Port", @@ -193,44 +193,44 @@ "SIPEXPIRES": "SIP Expires [sec]", "SIPPORT": "SIP Port", "PENALTY": "Penalty", - "ACCOUNTNAME": "Account Name", - "ADD_TELEPHONE": "Add Telephone", - "EDIT_TELEPHONE": "Edit Telephone", - "DELETE_TELEPHONE": "Delete Telephone", + "ACCOUNTNAME": "Nalog Naziv", + "ADD_TELEPHONE": "Dodaj Telefon", + "EDIT_TELEPHONE": "Uredi Telefon", + "DELETE_TELEPHONE": "Izbriši Telefon", "TEAMS": "Teams", - "DELETE_TEAM": "Delete Team", - "AGENTADD_TEAM": "Add Agents to Team", - "EDIT_TEAM": "Edit Team", + "DELETE_TEAM": "Izbriši Tim", + "AGENTADD_TEAM": "Dodaj Specijaliste u Tim", + "EDIT_TEAM": "Uredi Tim", "TYPE": "Type", "TELEPHONES": "Telephones", - "CALLERID": "Caller ID", - "ENABLERECORDING": "Enable Recording", + "CALLERID": "Pozivatelj ID", + "ENABLERECORDING": "Omogući Snimanje", "STAFF": "Staff", "ID": "Id", "NEW_USER": "New User", "NEW_AGENT": "New Agent", "NEW_TELEPHONE": "New Telephone", "NEW_TEAM": "New Team", - "ADD_TEAM": "Add Team", + "ADD_TEAM": "Dodaj Tim", "JOIN_QUEUE": "Join Queue", - "CAPACITY": "Capacity", - "AUTOINTERNAL": "Auto generate internal number", - "ADD_AGENT_TO_TEAM": "Add Agent to Team", + "CAPACITY": "Kapacitet", + "AUTOINTERNAL": "Automatsko generisanje internog broja", + "ADD_AGENT_TO_TEAM": "Dodaj Specijalistu u Tim", "TEAMADD_AGENT": "Add Agent to Team", "NO_AVAILABLE_INFO": "No available info", "PERMISSIONS": "Permissions", - "ADD_AGENT_TO_QUEUE": "Add Agent to Queue", - "ALL_MODULES_AVAILABLE": "All modules available", - "CALLGROUP": "Call Group", + "ADD_AGENT_TO_QUEUE": "Dodaj Specijalistu u Queue", + "ALL_MODULES_AVAILABLE": "Svi dostupni moduli", + "CALLGROUP": "Grupa Poziva", "PICKUPGROUP": "Pickup Group", - "ADD_AGENT_TO_QUEUE_CAMPAIGNS": "Add Agent to Queue Campaigns", - "ADD_AGENT_TO_VOICE_QUEUES": "Add Agent to Voice Queues", - "ADD_AGENT_TO_CHAT_QUEUES": "Add Agent to Chat Queues", - "ADD_AGENT_TO_MAIL_QUEUES": "Add Agent to Email Queues", - "ADD_AGENT_TO_SMS_QUEUES": "Add Agent to SMS Queues", - "ADD_AGENT_TO_WHATSAPP_QUEUES": "Add Agent to WhatsApp Queues", - "ADD_AGENT_TO_OPENCHANNEL_QUEUES": "Add Agent to Open Channel Queues", - "ADD_AGENT_TO_FAX_QUEUES": "Add Agent to Fax Queues", + "ADD_AGENT_TO_QUEUE_CAMPAIGNS": "Dodaj Specijalistu u Queue Kampanja", + "ADD_AGENT_TO_VOICE_QUEUES": "Dodaj Specijalistu u Voice Queues", + "ADD_AGENT_TO_CHAT_QUEUES": "Dodaj Specijalistu u Chat Queues", + "ADD_AGENT_TO_MAIL_QUEUES": "Dodaj Specijalistu u E-Mail Queues", + "ADD_AGENT_TO_SMS_QUEUES": "Dodaj Specijalistu u SMS Queues", + "ADD_AGENT_TO_WHATSAPP_QUEUES": "Dodaj Specijalistu u WhatsApp Queues", + "ADD_AGENT_TO_OPENCHANNEL_QUEUES": "Dodaj Specijalistu u Otvoreni Kanal Queues", + "ADD_AGENT_TO_FAX_QUEUES": "Dodaj Specijalistu u Fax Queues", "QUEUEADD_USER_VOICE_INBOUND": "Add User to Voice Queues", "QUEUEADD_USER_CHAT_INBOUND": "Add User to Chat Queues", "QUEUEADD_USER_MAIL_INBOUND": "Add User to Email Queues", @@ -238,37 +238,37 @@ "QUEUEADD_USER_WHATSAPP_INBOUND": "Add User to WhatsApp Queues", "QUEUEADD_USER_OPENCHANNEL_INBOUND": "Add User to Open Channel Queues", "QUEUEADD_USER_FAX_INBOUND": "Add User to Fax Queues", - "ALL_TEAMS": "All Teams", + "ALL_TEAMS": "Svi Timovi", "SELECTED_TEAMS": "Selected Teams", "SELECTED_AGENTS": "Selected Agents", - "ALL_QUEUE_CAMPAIGNS": "All Queue Campaigns", + "ALL_QUEUE_CAMPAIGNS": "Sve Queue Kampanje", "SELECTED_QUEUE_CAMPAIGNS": "Selected Queue Campaigns", - "ALL_VOICE_QUEUES": "All Voice Queues", + "ALL_VOICE_QUEUES": "Svi Voice Queues", "SELECTED_VOICE_QUEUES": "Selected Voice Queues", - "ALL_CHAT_QUEUES": "All Chat Queues", + "ALL_CHAT_QUEUES": "Svi Chat Queues", "SELECTED_CHAT_QUEUES": "Selected Chat Queues", - "ALL_MAIL_QUEUES": "All Email Queues", + "ALL_MAIL_QUEUES": "Svi E-Mail Queues", "SELECTED_MAIL_QUEUES": "Selected Email Queues", - "ALL_SMS_QUEUES": "All SMS Queues", + "ALL_SMS_QUEUES": "Svi SMS Queues", "SELECTED_SMS_QUEUES": "Selected SMS Queues", - "ALL_WHATSAPP_QUEUES": "All WhatsApp Queues", + "ALL_WHATSAPP_QUEUES": "Svi WhatsApp Queues", "SELECTED_WHATSAPP_QUEUES": "Selected WhatsApp Queues", - "ALL_OPENCHANNEL_QUEUES": "All Open Channel Queues", + "ALL_OPENCHANNEL_QUEUES": "Svi Otvoreni Kanal Queues", "SELECTED_OPENCHANNEL_QUEUES": "Selected Open Channel Queues", - "ALL_FAX_QUEUES": "All Fax Queues", + "ALL_FAX_QUEUES": "Svi Fax Queues", "SELECTED_FAX_QUEUES": "Selected Fax Queues", "VOICEMAIL": "Voicemail", "SHOWWEBCONTROL": "Typology", "PAGE": "Page", "ROWSPERPAGE": "Rows per page", "OF": "of", - "CALLFORWARDING": "Call Forwarding", - "DND": "Do not disturb during pause", + "CALLFORWARDING": "Prosljeđivanje Poziva", + "DND": "Ne ometaj tokom pauze", "UNANSWEREDCALLBADGE": "Show unanswered call badge", - "ENABLEDTMFTONE": "Enable Dtmf tones", - "AUTOANSWERDELAY": "Auto Answer Delay [s]", - "ENCRYPTION": "Encryption", - "CHANNELS": "Channels", + "ENABLEDTMFTONE": "Omogući DTMF tonove", + "AUTOANSWERDELAY": "Automatski Odgovor Odgoda [s]", + "ENCRYPTION": "Enkripcija", + "CHANNELS": "Kanali", "CHAT": "Chat", "SMS": "Sms", "WHATSAPP": "WhatsApp Connector", @@ -276,70 +276,70 @@ "FAX": "Fax", "QUEUEADD_USER_VOICE_OUTBOUND": "Add User to Queue Campaigns", "MONITOREXTENSION": "Record calls to user extension", - "EDITPERMISSIONS": "Editing Permissions", + "EDITPERMISSIONS": "Uredi Prava", "READ_PERMISSION": "Read", - "EDIT_PERMISSION": "Edit", - "DELETE_PERMISSION": "Delete", - "GENERAL_PERMISSIONS": "General", - "ENABLEMESSENGER": "Enable Internal Messenger", + "EDIT_PERMISSION": "Uredi", + "DELETE_PERMISSION": "Izbriši", + "GENERAL_PERMISSIONS": "Općenito", + "ENABLEMESSENGER": "Omogući Interni Messenger", "OUTBOUNDPROXY": "Oubound Proxy", "PHONE": "Phone", "MOBILE": "Mobile", "PREFIXREQUIRED": "Prefix Required", "MANAGE_PERMISSIONS": "Manage Permissions", "USERADD_VOICEQUEUES": "Add Voice Queue to User", - "ALL_VOICEQUEUES": "All Voice Queues", + "ALL_VOICEQUEUES": "Svi Voice Queues", "SELECTED_VOICEQUEUES": "Selected Voice Queues", "USERADD_CHATQUEUES": "Add Chat Queue to User", - "ALL_CHATQUEUES": "All Chat Queues", + "ALL_CHATQUEUES": "Svi Chat Queues", "SELECTED_CHATQUEUES": "Selected Email Queues", "USERADD_MAILQUEUES": "Add Email Queue to User", - "ALL_MAILQUEUES": "All Email Queues", + "ALL_MAILQUEUES": "Svi E-Mail Queues", "SELECTED_MAILQUEUES": "Selected Chat Queues", "USERADD_SMSQUEUES": "Add SMS Queue to User", - "ALL_SMSQUEUES": "All SMS Queues", + "ALL_SMSQUEUES": "Svi SMS Queues", "SELECTED_SMSQUEUES": "Selected SMS Queues", "USERADD_WHATSAPPQUEUES": "Add Whataspp Queue to User", - "ALL_WHATSAPPQUEUES": "All Whataspp Queues", + "ALL_WHATSAPPQUEUES": "Svi WhatsApp Queues", "SELECTED_WHATSAPPQUEUES": "Selected WhatsApp Queues", "USERADD_FAXQUEUES": "Add Fax Queue to User", - "ALL_FAXQUEUES": "All Fax Queues", + "ALL_FAXQUEUES": "Svi Fax Queues", "SELECTED_FAXQUEUES": "Selected Fax Queues", "USERADD_OPENCHANNELQUEUES": "Add Open Channel Queue to User", - "ALL_OPENCHANNELQUEUES": "All Open Channel Queues", + "ALL_OPENCHANNELQUEUES": "Svi Otvoreni Kanal Queues", "SELECTED_OPENCHANNELQUEUES": "Selected Open Channel Queues", "USERADD_PROJECTS": "Add Cally Square Project to User", - "ALL_PROJECTS": "All Cally Square Projects", + "ALL_PROJECTS": "Svi Cally Square Projekti", "SELECTED_PROJECTS": "Selected Cally Square Projects", "USERADD_CHATWEBSITES": "Add Chat Website to User", - "ALL_CHATWEBSITES": "All Chat Websites", + "ALL_CHATWEBSITES": "Sve Chat Webstranice", "SELECTED_CHATWEBSITES": "Selected Chat Websites", "USERADD_QUEUECAMPAIGNS": "Add Queue Campaign to User", - "ALL_QUEUECAMPAIGNS": "All Queue Campaigns", + "ALL_QUEUECAMPAIGNS": "Sve Queue Kampanje", "SELECTED_QUEUECAMPAIGNS": "Selected Queue Campaigns", "USERADD_MAILACCOUNTS": "Add Email Account to User", - "ALL_MAILACCOUNTS": "All Email Accounts", + "ALL_MAILACCOUNTS": "Svi E-Mail Nalozi", "SELECTED_MAILACCOUNTS": "Selected Email Accounts", "USERADD_FAXACCOUNTS": "Add Fax Account to User", - "ALL_FAXACCOUNTS": "All Fax Accounts", + "ALL_FAXACCOUNTS": "Svi Fax Nalozi", "SELECTED_FAXACCOUNTS": "Selected Fax Accounts", "USERADD_SMSACCOUNTS": "Add SMS Account to User", - "ALL_SMSACCOUNTS": "All SMS Accounts", + "ALL_SMSACCOUNTS": "Svi SMS Nalozi", "SELECTED_SMSACCOUNTS": "Selected SMS Accounts", "USERADD_WHATSAPPACCOUNTS": "Add WhatsApp Account to User", - "ALL_WHATSAPPACCOUNTS": "All WhatsApp Accounts", + "ALL_WHATSAPPACCOUNTS": "Svi WhatsApp Nalozi", "SELECTED_WHATSAPPACCOUNTS": "Selected WhatsApp Accounts", "USERADD_OPENCHANNELACCOUNTS": "Add Open Channel Account to User", - "ALL_OPENCHANNELACCOUNTS": "All Open Channel Accounts", + "ALL_OPENCHANNELACCOUNTS": "Svi Otvoreni Kanal Nalozi", "SELECTED_OPENCHANNELACCOUNTS": "Selected Open Channel Accounts", "USERPROFILES": "User Profiles", "USERPROFILE": "User Profile", "NEW_USERPROFILE": "New User Profile", - "ADD_USERPROFILE": "Add User Profile", - "EDIT_USERPROFILE": "Edit User Profile", - "CLONE_USERPROFILE": "Clone User Profile", - "DELETE_USERPROFILE": "Delete User Profile", - "CRUDPERMISSIONS": "Permission Type", + "ADD_USERPROFILE": "DODAJ PROFIL KORISNIKA", + "EDIT_USERPROFILE": "Uredi Profil Korisnika", + "CLONE_USERPROFILE": "Kloniraj Profil Korisnika", + "DELETE_USERPROFILE": "Izbriši Profil Korisnika", + "CRUDPERMISSIONS": "Vrsta Prava", "SECTIONS": "Sections", "MODULES": "Modules", "SUMMARY": "Summary", @@ -366,9 +366,9 @@ "PERMISSIONS_SAVED_SUCCESS_TITLE": "{{sectionName}} section saved", "PERMISSIONS_SAVED_SUCCESS_MESSAGE": "Permissions successfully updated!" }, - "CONFIRM": "Confirm", - "CANCEL": "Cancel", - "CLOSE": "Close", + "CONFIRM": "Potvrdi", + "CANCEL": "Otkaži", + "CLOSE": "Zatvori", "QUEUES_ASSOCIATION": "{{channel}} Queues Association", "TEAMS_ASSOCIATION": "Teams Association", "PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE": "Unauthorized action", @@ -376,26 +376,26 @@ "PERMISSIONS_UNAUTHORIZED_CREATION_MESSAGE": "You are not allowed to create the resource", "MASK_SENSITIVE_DATA": "Mask Sensitive Data", "WSS_PORT": "WSS Port", - "DOWNLOADS": "Downloads", - "DOWNLOAD_PERMISSIONS": "Download Permissions", + "DOWNLOADS": "Preuzimanja", + "DOWNLOAD_PERMISSIONS": "Prava za Preuzimanja", "VOICE_RECORDINGS": "Voice Recordings", "OMNICHANNEL_INTERACTIONS": "Omnichannel Interactions", - "ATTACHMENTS": "Attachments", + "ATTACHMENTS": "Prilozi", "SCREEN_RECORDINGS": "Screen Recordings", "JSCRIPTY_SESSIONS": "Jscripty Sessions", - "CONTACT_MANAGER_LISTS": "Contact Manager Lists", - "CALLYSQUARE_RECORDINGS": "Cally Square Recordings", + "CONTACT_MANAGER_LISTS": "Kontakt Menadžer Lista", + "CALLYSQUARE_RECORDINGS": "Cally Square Snimci", "IGNORE_AGENT_BREAK_STATUS_FOR_PREVIEW_CALLS": "Ignore agent break status for preview calls", "SELECT_RECALLME_CAMPAIGN": "Select Recall Me Campaign", - "CLIENT_LOGS": "Client Logs", - "CLIENT_LOGS_DISABLED": "Client logs are disabled", - "CLIENT_LOGS_ENABLED": "Client logs are enabled", - "CLIENT_LOGS_LOGLEVEL_SELECT": "Select min logging level (severity)", - "CLIENT_LOGS_LOGLEVEL": "Log level: {{logLevel}}", - "CLIENT_LOGS_ENABLED_SINCE": "Enabled since: {{enabledSince}}", - "CLIENT_LOGS_ENABLED_MSG": "Client logs have been enabled for your user", - "CLIENT_LOGS_DISABLED_MSG": "Client logs have been disabled for your user", - "CLIENT_LOGS_ALL_ENABLED_WARNING": "Warning: this could severely affect server performances if many agents are logged in at the same time!", + "CLIENT_LOGS": "Logovi Klijenata", + "CLIENT_LOGS_DISABLED": "Logovi klijenata su onemogućeni", + "CLIENT_LOGS_ENABLED": "Logovi klijenata su omogućeni", + "CLIENT_LOGS_LOGLEVEL_SELECT": "Odaberi min nivo evidentiranja (ozbiljnost)", + "CLIENT_LOGS_LOGLEVEL": "Log nivo: {{logLevel}}", + "CLIENT_LOGS_ENABLED_SINCE": "Omogućeno od: {{enabledSince}}", + "CLIENT_LOGS_ENABLED_MSG": "Logovi klijenata su omogućeni za tvog korisnika", + "CLIENT_LOGS_DISABLED_MSG": "Logovi klijenata su onemogućeni za tvog korisnika", + "CLIENT_LOGS_ALL_ENABLED_WARNING": "Upozorenje: ovo može ozbiljno uticati na performanse servera ako je više Specijalista istovremeno prijavljeno!", "QUEUEADD_AGENT_VOICE_OUTBOUND": "Add Agent to Queue Campaigns", "QUEUEADD_AGENT_VOICE_INBOUND": "Add Agent to Voice Queues", "QUEUEADD_AGENT_CHAT_INBOUND": "Add Agent to Chat Queues", @@ -404,21 +404,21 @@ "QUEUEADD_AGENT_WHATSAPP_INBOUND": "Add Agent to WhatsApp Queues", "QUEUEADD_AGENT_OPENCHANNEL_INBOUND": "Add Agent to Open Channel Queues", "QUEUEADD_AGENT_FAX_INBOUND": "Add Agent to Fax Queues", - "ALL_QUEUES_VOICE_OUTBOUND": "All Queue Campaigns", + "ALL_QUEUES_VOICE_OUTBOUND": "Sve Queue Kampanje", "SELECTED_QUEUES_VOICE_OUTBOUND": "Selected Queue Campaigns", - "ALL_QUEUES_VOICE_INBOUND": "All Voice Queues", + "ALL_QUEUES_VOICE_INBOUND": "Svi Voice Queues", "SELECTED_QUEUES_VOICE_INBOUND": "Selected Voice Queues", - "ALL_QUEUES_CHAT_INBOUND": "All Chat Queues", + "ALL_QUEUES_CHAT_INBOUND": "Svi Chat Queues", "SELECTED_QUEUES_CHAT_INBOUND": "Selected Chat Queues", - "ALL_QUEUES_MAIL_INBOUND": "All Email Queues", + "ALL_QUEUES_MAIL_INBOUND": "Svi E-Mail Queues", "SELECTED_QUEUES_MAIL_INBOUND": "Selected Email Queues", - "ALL_QUEUES_SMS_INBOUND": "All SMS Queues", + "ALL_QUEUES_SMS_INBOUND": "Svi SMS Queues", "SELECTED_QUEUES_SMS_INBOUND": "Selected SMS Queues", - "ALL_QUEUES_WHATSAPP_INBOUND": "All WhatsApp Queues", + "ALL_QUEUES_WHATSAPP_INBOUND": "Svi WhatsApp Queues", "SELECTED_QUEUES_WHATSAPP_INBOUND": "Selected WhatsApp Queues", - "ALL_QUEUES_OPENCHANNEL_INBOUND": "All Open Channel Queues", + "ALL_QUEUES_OPENCHANNEL_INBOUND": "Svi Otvoreni Kanal Queues", "SELECTED_QUEUES_OPENCHANNEL_INBOUND": "Selected Open Channel Queues", - "ALL_QUEUES_FAX_INBOUND": "All Fax Queues", + "ALL_QUEUES_FAX_INBOUND": "Svi Fax Queues", "SELECTED_QUEUES_FAX_INBOUND": "Selected Fax Queues" } } diff --git a/public/app/main/apps/staff/i18n/et.json b/public/app/main/apps/staff/i18n/et.json index 75fb8d9..cb39da7 100644 --- a/public/app/main/apps/staff/i18n/et.json +++ b/public/app/main/apps/staff/i18n/et.json @@ -375,6 +375,43 @@ "CLIENT_LOGS_LOGLEVEL": "Logitase: {{logLevel}}", "CLIENT_LOGS_LOGLEVEL_SELECT": "Valige minimaalne logimise tase (raskusaste)", "CLIENT_LOGS_DISABLED_MSG": "Kliendilogid on teie kasutaja jaoks keelatud", - "CLIENT_LOGS_ENABLED_MSG": "Teie kasutaja jaoks on kliendilogid lubatud" + "CLIENT_LOGS_ENABLED_MSG": "Teie kasutaja jaoks on kliendilogid lubatud", + "ADD_AGENT_TO_CHAT_QUEUES": "Lisage agent vestlusjärjekordadesse", + "ADD_AGENT_TO_FAX_QUEUES": "Lisage agent faksijärjekordadesse", + "ADD_AGENT_TO_MAIL_QUEUES": "Lisage agent meilijärjekordadesse", + "ADD_AGENT_TO_OPENCHANNEL_QUEUES": "Lisage agent avatud kanalite järjekordadesse", + "ADD_AGENT_TO_QUEUE_CAMPAIGNS": "Lisage agent kampaaniate järjekorda", + "ADD_AGENT_TO_SMS_QUEUES": "Lisage agent SMS-i järjekordadesse", + "ADD_AGENT_TO_VOICE_QUEUES": "Lisage agent hääljärjekordadesse", + "ADD_AGENT_TO_WHATSAPP_QUEUES": "Lisage agent WhatsAppi järjekordadesse", + "ALL_CHAT_QUEUES": "Kõik vestlusjärjekorrad", + "ALL_FAX_QUEUES": "Kõik faksijärjekorrad", + "ALL_MAIL_QUEUES": "Kõik meilijärjekorrad", + "ALL_OPENCHANNEL_QUEUES": "Kõik avatud kanalite järjekorrad", + "ALL_QUEUE_CAMPAIGNS": "Kõik järjekorrakampaaniad", + "ALL_SMS_QUEUES": "Kõik SMS-i järjekorrad", + "ALL_VOICE_QUEUES": "Kõik häälejärjekorrad", + "ALL_WHATSAPP_QUEUES": "Kõik WhatsAppi järjekorrad", + "AUTO_ANSWER": "Automaatne vastus", + "CHAT_AUTOANSWER": "Vestluse automaatne vastus", + "CHAT_AUTOANSWERDELAY": "Vestluse automaatse vastuse viivitus [s]", + "EMAIL_AUTOANSWER": "Meili automaatne vastus", + "EMAIL_AUTOANSWERDELAY": "Meili automaatse vastuse viivitus [s]", + "FAX_AUTOANSWER": "Faksi automaatne vastus", + "FAX_AUTOANSWERDELAY": "Faksi automaatvastuse viivitus [s]", + "OPENCHANNEL_AUTOANSWER": "Openchanneli automaatne vastus", + "OPENCHANNEL_AUTOANSWERDELAY": "Avatud kanali automaatvastuse viivitus [s]", + "SELECTED_CHAT_QUEUES": "Valitud vestlusjärjekorrad", + "SELECTED_FAX_QUEUES": "Valitud faksijärjekorrad", + "SELECTED_MAIL_QUEUES": "Valitud meilijärjekorrad", + "SELECTED_OPENCHANNEL_QUEUES": "Valitud Ava kanalite järjekorrad", + "SELECTED_QUEUE_CAMPAIGNS": "Valitud järjekorrakampaaniad", + "SELECTED_SMS_QUEUES": "Valitud SMS-i järjekorrad", + "SELECTED_VOICE_QUEUES": "Valitud häälejärjekorrad", + "SELECTED_WHATSAPP_QUEUES": "Valitud WhatsAppi järjekorrad", + "SMS_AUTOANSWER": "Automaatne SMS-vastus", + "SMS_AUTOANSWERDELAY": "SMS-i automaatvastuse viivitus [s]", + "WHATSAPP_AUTOANSWER": "WhatsAppi pistiku automaatne vastus", + "WHATSAPP_AUTOANSWERDELAY": "WhatsAppi konnektori automaatse vastamise viivitus [s]" } } diff --git a/public/app/main/apps/staff/i18n/is.json b/public/app/main/apps/staff/i18n/is.json new file mode 100644 index 0000000..16c4dd6 --- /dev/null +++ b/public/app/main/apps/staff/i18n/is.json @@ -0,0 +1,424 @@ +{ + "STAFF": { + "MANAGE_API_KEY": "API Key Manager", + "GENERATE": "Generate", + "REGENERATE": "Regenerate", + "REMOVE": "Remove", + "APIKEYMANAGER_USER": "API Key Manager", + "APIKEY": "API Key", + "VIDEOSUPPORT": "Video support", + "HOTDESK": "Hot desk", + "ENABLEVIDEOECORDING": "Enable Video Recording", + "ENABLESCREENRECORDINGBYAGENT": "Enable Screen Recording by Agent", + "ENABLEAUTOMATICSCREENRECORDING": "Enable Automatic Screen Recording", + "OLD_PASSWORD": "Old Password", + "ENABLEJAWSINTEGRATION": "Enable Jaws Integration", + "ALIAS": "Alias", + "NO_PASSWORD_CHANGE": "No Password Change", + "SECURITY_SUITE": "Security Suite", + "AUTO_ANSWER": "Auto answer", + "CHAT_AUTOANSWER": "Chat auto answer", + "CHAT_AUTOANSWERDELAY": "Chat auto answer delay [s]", + "EMAIL_AUTOANSWER": "Email auto answer", + "EMAIL_AUTOANSWERDELAY": "Email auto answer delay [s]", + "SMS_AUTOANSWER": "Sms auto answer", + "SMS_AUTOANSWERDELAY": "Sms auto answer delay [s]", + "OPENCHANNEL_AUTOANSWER": "Openchannel auto answer", + "OPENCHANNEL_AUTOANSWERDELAY": "Openchannel auto answer delay [s]", + "FAX_AUTOANSWER": "Fax auto answer", + "FAX_AUTOANSWERDELAY": "Fax auto answer delay [s]", + "WHATSAPP_AUTOANSWER": "Whatsapp connector auto answer", + "WHATSAPP_AUTOANSWERDELAY": "Whatsapp connector auto answer delay [s]", + "LAST_PASSWORD_RESET_AT": "Last Password Reset At", + "SIP_WEBRTC": "Sip", + "SETTINGS_WEBRTC": "Settings", + "WEBRTC": "WebRTC", + "DTLSCERTFILE": "TLS certificate", + "DTLSPRIVATEKEY": "TLS certificate's private key", + "CONTEXT": "Context", + "RINGINUSE": "Ring In Use", + "USERS": "Users", + "AGENTS": "Agents", + "TOGGLE_SIDENAV": "Toggle sidenav", + "SEARCH_FOR_ANYONE": "Search", + "BACK": "Back", + "MULTI_SELECT_TOGGLE": "multi select toggle", + "SELECT_ALL": "Select all", + "SELECT_NONE": "Select None", + "SELECTED": "Selected", + "DELETE_SELECTED": "Delete selected", + "EXPORT_SELECTED": "Export selected", + "ALL_USERS": "All users", + "ALL_AGENTS": "All agents", + "SORT": "sort", + "NAME": "Name", + "FULLNAME": "Full Name", + "A_TO_Z": "(A to Z)", + "Z_TO_A": "(Z to A)", + "MORE": "More", + "DELETE_USER": "Delete User", + "EDIT_USER": "Edit User", + "DELETE_AGENT": "Delete Agent", + "EDIT_AGENT": "Edit Agent", + "DELETE": "Delete", + "SAVE": "SAVE", + "ADD_USER": "ADD USER", + "ADD_AGENT": "ADD AGENT", + "NO_RESULTS": "No results..", + "CLOSE_DIALOG": "Close dialog", + "NAME_REQUIRED": "Name (required)", + "USERNAME": "Username", + "SHOW_ALL_FIELDS": "Show All Fields", + "PHONE_NUMBER": "Phone number", + "EMAIL": "Email", + "PASSWORD": "Password", + "ERRORS": { + "CONFIRM_REQUIRED": "Mandatory field", + "ALLOWCODECS_REQUIRED": "Mandatory field", + "ENCRYPTION": "SRTP (Secure Realtime Protocol) Encryption", + "DTLSCERTFILE_REQUIRED": "Mandatory field", + "DTLSPRIVATEKEY_REQUIRED": "Mandatory field", + "FULLNAME_REQUIRED": "Mandatory field", + "USERNAME_REQUIRED": "Mandatory field", + "EMAIL_REQUIRED": "Mandatory field", + "PASSWORD_REQUIRED": "Mandatory field", + "CONFIRM_NOT_MATCH": "The passwords don't match", + "EMAIL_MUST_VALID": "Wrong format", + "ACCOUNTNAME_REQUIRED": "Mandatory field", + "NAME_REQUIRED": "Mandatory field", + "HOST_REQUIRED": "Mandatory field", + "CHATCAPACITY_REQUIRED": "Mandatory field", + "MAILCAPACITY_REQUIRED": "Mandatory field", + "FAXCAPACITY_REQUIRED": "Mandatory field", + "SMSCAPACITY_REQUIRED": "Mandatory field", + "WHATSAPPCAPACITY_REQUIRED": "Mandatory field", + "OPENCHANNELCAPACITY_REQUIRED": "Mandatory field", + "SIPEXPIRES_REQUIRED": "Mandatory field", + "SIPPORT_REQUIRED": "Mandatory field", + "UNCONDITIONALNUMBER_REQUIRED": "Mandatory field", + "NOREPLYNUMBER_REQUIRED": "Mandatory field", + "BUSYNUMBER_REQUIRED": "Mandatory field", + "USERNAME_MUST_VALID_PATTERN": "Wrong format {{regex}}", + "REMOTECONTROLPORT_REQUIRED": "Mandatory field", + "CHATCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "MAILCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "FAXCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "OPENCHANNELCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "AUTOANSWERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "AUTOANSWERDELAY_REQUIRED": "Mandatory field", + "MONITOREXTENSION_REQUIRED": "Mandatory field", + "SECURE_PASSWORD_PATTERN": "The password must be at least 8 characters long and have 1 lowercase character, 1 uppercase character, 1 number and 1 special character ~!@#$%^&-_=+[{]}.", + "CRUDPERMISSIONS_REQUIRED": "Mandatory field", + "USERPROFILE_REQUIRED": "Mandatory field", + "PASSWORD_OLDPASSWORD_MATCH": "New password must be different from previous one" + }, + "ACCOUNT": "Account", + "VOICE": "Voice", + "CREATED_AT": "Created At", + "ROLE": "Role", + "PERSONAL_INFO": "Personal Info", + "DESCRIPTION": "Description", + "CHANGE_AVATAR": "Change Avatar", + "GENERAL": "General", + "INTERNAL": "Internal", + "TRANSPORT": "Transport", + "ALLOWCODECS": "Allowed Codecs", + "DISABLED": "Deactivated", + "BLOCKED": "Locked", + "AD_SSO_ENABLED": "Active Directory SSO", + "AUTHENTICATION": "Authentication", + "HELP": { + "DISABLED": "select to deactivate / unselect to reactivate", + "BLOCKED": "Lock / Unlock access", + "APIKEY": "Please use 'API key manager' button on toolbar to manage this key", + "LAST_PASSWORD_RESET_AT": "Last date and time the password has been changed. If Secure Suite General Setting is enabled, the password will expire after 90 days.", + "DTLSCERTFILE": "Link to the valid TLS certificate(.crt file). Default value: '/etc/pki/tls/certs/motion.crt'.", + "DTLSPRIVATEKEY": "Link to the certificate's private key(.key file). Default value: '/etc/pki/tls/private/motion.key'.", + "ALLOWCODECS": "Allowed Codecs in order of preference", + "TRANSPORT": "Set the default transports in order of preference", + "HOST": "How to find the client - IP or host name. If you want the phone to register itself, use the keyword dynamic instead of Host IP", + "NAT": "Changes the behaviour of Asterisk for clients behind a firewall. If any of the comma-separated options is 'no', Asterisk will ignore other settings and set nat=no", + "SIPEXPIRES": "Default: 160", + "SIPPORT": "Default: 5160", + "TYPE": "Determines the SIP role within asterisk. User: used to authenticate incoming - Peer: for outgoing calls - Friend: covers both characteristics of the above", + "CHATCAPACITY": "Maximum number of concurrent channel interactions per agent (0=unlimited)", + "MAILCAPACITY": "Maximum number of concurrent channel interactions per agent (0=unlimited)", + "FAXCAPACITY": "Maximum number of concurrent channel interactions per agent (0=unlimited)", + "SMSCAPACITY": "Maximum number of concurrent channel interactions per agent (0=unlimited)", + "WHATSAPPCAPACITY": "Maximum number of concurrent channel interactions per agent (0=unlimited)", + "OPENCHANNELCAPACITY": "Maximum number of concurrent channel interactions per agent (0=unlimited)", + "CALLGROUP": "The agent's callgroup", + "PICKUPGROUP": "The groups in which the agent can answer calls", + "USERNAME": "Only numbers, letters and specific characters (._) are supported", + "ENCRYPTION": "SRTP (Secure Realtime Protocol) Encryption", + "SAVE_PERMISSIONS": "Every section containing any pending changes will be saved", + "CUSTOM_DASHBOARDS_PERMISSIONS": "Custom Dashboards permissions are managed in the Tools module", + "ENABLEAUTOMATICSCREENRECORDING": "The functionality is available only for voice channel", + "MASK_SENSITIVE_DATA": "Mask any sensitive data throughout the application (e.g. phone numbers and email addresses)", + "WSS_PORT": "Default: 8089", + "AD_SSO_ENABLED": "Login in with your Active Directory credentials" + }, + "NEW_PASSWORD": "New Password", + "CONFIRM_PASSWORD": "Confirm Password", + "CHANGE_PASSWORD": "Change Password", + "CHANGEPASSWORD_AGENT": "Change Password", + "CHANGEPASSWORD_USER": "Change Password", + "CHANGEPASSWORD_TELEPHONE": "Change Password", + "LOGININPAUSE": "Login In Pause", + "HOST": "Host", + "NAT": "NAT", + "CHANSPY": "ChanSpy", + "OTHER_CHANNELS": "Other Channels", + "CHATCAPACITY": "Chat Capacity", + "MAILCAPACITY": "Email Capacity", + "FAXCAPACITY": "Fax Capacity", + "SMSCAPACITY": "Sms Capacity", + "WHATSAPPCAPACITY": "WhatsApp Connector Capacity", + "OPENCHANNELCAPACITY": "Open Channel Capacity", + "MOTIONBAR": "Motion Bar", + "SETTINGS": "Settings", + "AUTOANSWER": "Auto Answer", + "ENABLESETTINGS": "Enable Settings", + "CALL_FORWARDING": "Call Forwarding", + "UNCONDITIONAL": "Unconditional", + "UNCONDITIONALNUMBER": "Unconditional Number", + "NOREPLY": "No Reply", + "NOREPLYNUMBER": "No Reply Number", + "BUSY": "Busy", + "BUSYNUMBER": "Busy Number", + "REMOTE_CONTROL": "Remote Control", + "REMOTECONTROL": "Remote Control", + "REMOTECONTROLPORT": "Remote Control Port", + "SIP": "SIP", + "SIPEXPIRES": "SIP Expires [sec]", + "SIPPORT": "SIP Port", + "PENALTY": "Penalty", + "ACCOUNTNAME": "Account Name", + "ADD_TELEPHONE": "Add Telephone", + "EDIT_TELEPHONE": "Edit Telephone", + "DELETE_TELEPHONE": "Delete Telephone", + "TEAMS": "Teams", + "DELETE_TEAM": "Delete Team", + "AGENTADD_TEAM": "Add Agents to Team", + "EDIT_TEAM": "Edit Team", + "TYPE": "Type", + "TELEPHONES": "Telephones", + "CALLERID": "Caller ID", + "ENABLERECORDING": "Enable Recording", + "STAFF": "Staff", + "ID": "Id", + "NEW_USER": "New User", + "NEW_AGENT": "New Agent", + "NEW_TELEPHONE": "New Telephone", + "NEW_TEAM": "New Team", + "ADD_TEAM": "Add Team", + "JOIN_QUEUE": "Join Queue", + "CAPACITY": "Capacity", + "AUTOINTERNAL": "Auto generate internal number", + "ADD_AGENT_TO_TEAM": "Add Agent to Team", + "TEAMADD_AGENT": "Add Agent to Team", + "NO_AVAILABLE_INFO": "No available info", + "PERMISSIONS": "Permissions", + "ADD_AGENT_TO_QUEUE": "Add Agent to Queue", + "ALL_MODULES_AVAILABLE": "All modules available", + "CALLGROUP": "Call Group", + "PICKUPGROUP": "Pickup Group", + "ADD_AGENT_TO_QUEUE_CAMPAIGNS": "Add Agent to Queue Campaigns", + "ADD_AGENT_TO_VOICE_QUEUES": "Add Agent to Voice Queues", + "ADD_AGENT_TO_CHAT_QUEUES": "Add Agent to Chat Queues", + "ADD_AGENT_TO_MAIL_QUEUES": "Add Agent to Email Queues", + "ADD_AGENT_TO_SMS_QUEUES": "Add Agent to SMS Queues", + "ADD_AGENT_TO_WHATSAPP_QUEUES": "Add Agent to WhatsApp Queues", + "ADD_AGENT_TO_OPENCHANNEL_QUEUES": "Add Agent to Open Channel Queues", + "ADD_AGENT_TO_FAX_QUEUES": "Add Agent to Fax Queues", + "QUEUEADD_USER_VOICE_INBOUND": "Add User to Voice Queues", + "QUEUEADD_USER_CHAT_INBOUND": "Add User to Chat Queues", + "QUEUEADD_USER_MAIL_INBOUND": "Add User to Email Queues", + "QUEUEADD_USER_SMS_INBOUND": "Add User to SMS Queues", + "QUEUEADD_USER_WHATSAPP_INBOUND": "Add User to WhatsApp Queues", + "QUEUEADD_USER_OPENCHANNEL_INBOUND": "Add User to Open Channel Queues", + "QUEUEADD_USER_FAX_INBOUND": "Add User to Fax Queues", + "ALL_TEAMS": "All Teams", + "SELECTED_TEAMS": "Selected Teams", + "SELECTED_AGENTS": "Selected Agents", + "ALL_QUEUE_CAMPAIGNS": "All Queue Campaigns", + "SELECTED_QUEUE_CAMPAIGNS": "Selected Queue Campaigns", + "ALL_VOICE_QUEUES": "All Voice Queues", + "SELECTED_VOICE_QUEUES": "Selected Voice Queues", + "ALL_CHAT_QUEUES": "All Chat Queues", + "SELECTED_CHAT_QUEUES": "Selected Chat Queues", + "ALL_MAIL_QUEUES": "All Email Queues", + "SELECTED_MAIL_QUEUES": "Selected Email Queues", + "ALL_SMS_QUEUES": "All SMS Queues", + "SELECTED_SMS_QUEUES": "Selected SMS Queues", + "ALL_WHATSAPP_QUEUES": "All WhatsApp Queues", + "SELECTED_WHATSAPP_QUEUES": "Selected WhatsApp Queues", + "ALL_OPENCHANNEL_QUEUES": "All Open Channel Queues", + "SELECTED_OPENCHANNEL_QUEUES": "Selected Open Channel Queues", + "ALL_FAX_QUEUES": "All Fax Queues", + "SELECTED_FAX_QUEUES": "Selected Fax Queues", + "VOICEMAIL": "Voicemail", + "SHOWWEBCONTROL": "Typology", + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "OF": "of", + "CALLFORWARDING": "Call Forwarding", + "DND": "Do not disturb during pause", + "UNANSWEREDCALLBADGE": "Show unanswered call badge", + "ENABLEDTMFTONE": "Enable Dtmf tones", + "AUTOANSWERDELAY": "Auto Answer Delay [s]", + "ENCRYPTION": "Encryption", + "CHANNELS": "Channels", + "CHAT": "Chat", + "SMS": "Sms", + "WHATSAPP": "WhatsApp Connector", + "OPENCHANNEL": "Open Channel", + "FAX": "Fax", + "QUEUEADD_USER_VOICE_OUTBOUND": "Add User to Queue Campaigns", + "MONITOREXTENSION": "Record calls to user extension", + "EDITPERMISSIONS": "Editing Permissions", + "READ_PERMISSION": "Read", + "EDIT_PERMISSION": "Edit", + "DELETE_PERMISSION": "Delete", + "GENERAL_PERMISSIONS": "General", + "ENABLEMESSENGER": "Enable Internal Messenger", + "OUTBOUNDPROXY": "Oubound Proxy", + "PHONE": "Phone", + "MOBILE": "Mobile", + "PREFIXREQUIRED": "Prefix Required", + "MANAGE_PERMISSIONS": "Manage Permissions", + "USERADD_VOICEQUEUES": "Add Voice Queue to User", + "ALL_VOICEQUEUES": "All Voice Queues", + "SELECTED_VOICEQUEUES": "Selected Voice Queues", + "USERADD_CHATQUEUES": "Add Chat Queue to User", + "ALL_CHATQUEUES": "All Chat Queues", + "SELECTED_CHATQUEUES": "Selected Email Queues", + "USERADD_MAILQUEUES": "Add Email Queue to User", + "ALL_MAILQUEUES": "All Email Queues", + "SELECTED_MAILQUEUES": "Selected Chat Queues", + "USERADD_SMSQUEUES": "Add SMS Queue to User", + "ALL_SMSQUEUES": "All SMS Queues", + "SELECTED_SMSQUEUES": "Selected SMS Queues", + "USERADD_WHATSAPPQUEUES": "Add Whataspp Queue to User", + "ALL_WHATSAPPQUEUES": "All Whataspp Queues", + "SELECTED_WHATSAPPQUEUES": "Selected WhatsApp Queues", + "USERADD_FAXQUEUES": "Add Fax Queue to User", + "ALL_FAXQUEUES": "All Fax Queues", + "SELECTED_FAXQUEUES": "Selected Fax Queues", + "USERADD_OPENCHANNELQUEUES": "Add Open Channel Queue to User", + "ALL_OPENCHANNELQUEUES": "All Open Channel Queues", + "SELECTED_OPENCHANNELQUEUES": "Selected Open Channel Queues", + "USERADD_PROJECTS": "Add Cally Square Project to User", + "ALL_PROJECTS": "All Cally Square Projects", + "SELECTED_PROJECTS": "Selected Cally Square Projects", + "USERADD_CHATWEBSITES": "Add Chat Website to User", + "ALL_CHATWEBSITES": "All Chat Websites", + "SELECTED_CHATWEBSITES": "Selected Chat Websites", + "USERADD_QUEUECAMPAIGNS": "Add Queue Campaign to User", + "ALL_QUEUECAMPAIGNS": "All Queue Campaigns", + "SELECTED_QUEUECAMPAIGNS": "Selected Queue Campaigns", + "USERADD_MAILACCOUNTS": "Add Email Account to User", + "ALL_MAILACCOUNTS": "All Email Accounts", + "SELECTED_MAILACCOUNTS": "Selected Email Accounts", + "USERADD_FAXACCOUNTS": "Add Fax Account to User", + "ALL_FAXACCOUNTS": "All Fax Accounts", + "SELECTED_FAXACCOUNTS": "Selected Fax Accounts", + "USERADD_SMSACCOUNTS": "Add SMS Account to User", + "ALL_SMSACCOUNTS": "All SMS Accounts", + "SELECTED_SMSACCOUNTS": "Selected SMS Accounts", + "USERADD_WHATSAPPACCOUNTS": "Add WhatsApp Account to User", + "ALL_WHATSAPPACCOUNTS": "All WhatsApp Accounts", + "SELECTED_WHATSAPPACCOUNTS": "Selected WhatsApp Accounts", + "USERADD_OPENCHANNELACCOUNTS": "Add Open Channel Account to User", + "ALL_OPENCHANNELACCOUNTS": "All Open Channel Accounts", + "SELECTED_OPENCHANNELACCOUNTS": "Selected Open Channel Accounts", + "USERPROFILES": "User Profiles", + "USERPROFILE": "User Profile", + "NEW_USERPROFILE": "New User Profile", + "ADD_USERPROFILE": "Add User Profile", + "EDIT_USERPROFILE": "Edit User Profile", + "CLONE_USERPROFILE": "Clone User Profile", + "DELETE_USERPROFILE": "Delete User Profile", + "CRUDPERMISSIONS": "Permission Type", + "SECTIONS": "Sections", + "MODULES": "Modules", + "SUMMARY": "Summary", + "REPORT_TYPE": "Report Type", + "PERMISSIONS_MANAGE": "Manage", + "PERMISSIONS_SECTION_TITLE": "{{sectionName}} Permissions", + "PERMISSIONS_AUTO_ASSOCIATION_INFO": "Automatically associate every current and future resource of this section to the User Profile", + "PERMISSIONS_PLACEHOLDER_SEARCH": "Search...", + "PERMISSIONS_SELECT_SECTION": "Select a section", + "PERMISSIONS_SELECT_REPORT_TYPE": "Select report type", + "PERMISSIONS_ALL_RESOURCES": "All resources", + "PERMISSIONS_SELECTED_RESOURCES": "Selected resources", + "PERMISSIONS_SECTION_HIDE": "Hide section to the User", + "PERMISSIONS_SECTION_SHOW": "Show section to the User", + "PERMISSIONS_WARNING_ENABLE_ALL": "All {{sectionName}} subsections and their resources will be enabled. Are you sure you want to continue?", + "PERMISSIONS_WARNING_CLOSE": "You have unsaved changes. Are you sure you want to exit without saving?", + "NOTIFICATIONS": { + "PERMISSIONS_ENABLED_ALL_SUCCESS_TITLE": "{{sectionName}} section enabled", + "PERMISSIONS_ENABLED_ALL_SUCCESS_MESSAGE": "All {{sectionName}} resources have been added to {{userProfileName}} User Profile", + "PERMISSIONS_ENABLED_ALL_SUCCESS_MESSAGE_NO_RESOURCES": "{{sectionName}} has been added to {{userProfileName}} User Profile", + "PERMISSIONS_DISABLED_ALL_SUCCESS_TITLE": "{{sectionName}} section disabled", + "PERMISSIONS_DISABLED_ALL_SUCCESS_MESSAGE": "All {{sectionName}} resources have been removed from {{userProfileName}} User Profile", + "PERMISSIONS_DISABLED_ALL_SUCCESS_MESSAGE_NO_RESOURCES": "{{sectionName}} has been removed from {{userProfileName}} User Profile", + "PERMISSIONS_SAVED_SUCCESS_TITLE": "{{sectionName}} section saved", + "PERMISSIONS_SAVED_SUCCESS_MESSAGE": "Permissions successfully updated!" + }, + "CONFIRM": "Confirm", + "CANCEL": "Cancel", + "CLOSE": "Close", + "QUEUES_ASSOCIATION": "{{channel}} Queues Association", + "TEAMS_ASSOCIATION": "Teams Association", + "PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE": "Unauthorized action", + "PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE": "You are not allowed to access the selected section", + "PERMISSIONS_UNAUTHORIZED_CREATION_MESSAGE": "You are not allowed to create the resource", + "MASK_SENSITIVE_DATA": "Mask Sensitive Data", + "WSS_PORT": "WSS Port", + "DOWNLOADS": "Downloads", + "DOWNLOAD_PERMISSIONS": "Download Permissions", + "VOICE_RECORDINGS": "Voice Recordings", + "OMNICHANNEL_INTERACTIONS": "Omnichannel Interactions", + "ATTACHMENTS": "Attachments", + "SCREEN_RECORDINGS": "Screen Recordings", + "JSCRIPTY_SESSIONS": "Jscripty Sessions", + "CONTACT_MANAGER_LISTS": "Contact Manager Lists", + "CALLYSQUARE_RECORDINGS": "Cally Square Recordings", + "IGNORE_AGENT_BREAK_STATUS_FOR_PREVIEW_CALLS": "Ignore agent break status for preview calls", + "SELECT_RECALLME_CAMPAIGN": "Select Recall Me Campaign", + "CLIENT_LOGS": "Client Logs", + "CLIENT_LOGS_DISABLED": "Client logs are disabled", + "CLIENT_LOGS_ENABLED": "Client logs are enabled", + "CLIENT_LOGS_LOGLEVEL_SELECT": "Select min logging level (severity)", + "CLIENT_LOGS_LOGLEVEL": "Log level: {{logLevel}}", + "CLIENT_LOGS_ENABLED_SINCE": "Enabled since: {{enabledSince}}", + "CLIENT_LOGS_ENABLED_MSG": "Client logs have been enabled for your user", + "CLIENT_LOGS_DISABLED_MSG": "Client logs have been disabled for your user", + "CLIENT_LOGS_ALL_ENABLED_WARNING": "Warning: this could severely affect server performances if many agents are logged in at the same time!", + "QUEUEADD_AGENT_VOICE_OUTBOUND": "Add Agent to Queue Campaigns", + "QUEUEADD_AGENT_VOICE_INBOUND": "Add Agent to Voice Queues", + "QUEUEADD_AGENT_CHAT_INBOUND": "Add Agent to Chat Queues", + "QUEUEADD_AGENT_MAIL_INBOUND": "Add Agent to Email Queues", + "QUEUEADD_AGENT_SMS_INBOUND": "Add Agent to SMS Queues", + "QUEUEADD_AGENT_WHATSAPP_INBOUND": "Add Agent to WhatsApp Queues", + "QUEUEADD_AGENT_OPENCHANNEL_INBOUND": "Add Agent to Open Channel Queues", + "QUEUEADD_AGENT_FAX_INBOUND": "Add Agent to Fax Queues", + "ALL_QUEUES_VOICE_OUTBOUND": "All Queue Campaigns", + "SELECTED_QUEUES_VOICE_OUTBOUND": "Selected Queue Campaigns", + "ALL_QUEUES_VOICE_INBOUND": "All Voice Queues", + "SELECTED_QUEUES_VOICE_INBOUND": "Selected Voice Queues", + "ALL_QUEUES_CHAT_INBOUND": "All Chat Queues", + "SELECTED_QUEUES_CHAT_INBOUND": "Selected Chat Queues", + "ALL_QUEUES_MAIL_INBOUND": "All Email Queues", + "SELECTED_QUEUES_MAIL_INBOUND": "Selected Email Queues", + "ALL_QUEUES_SMS_INBOUND": "All SMS Queues", + "SELECTED_QUEUES_SMS_INBOUND": "Selected SMS Queues", + "ALL_QUEUES_WHATSAPP_INBOUND": "All WhatsApp Queues", + "SELECTED_QUEUES_WHATSAPP_INBOUND": "Selected WhatsApp Queues", + "ALL_QUEUES_OPENCHANNEL_INBOUND": "All Open Channel Queues", + "SELECTED_QUEUES_OPENCHANNEL_INBOUND": "Selected Open Channel Queues", + "ALL_QUEUES_FAX_INBOUND": "All Fax Queues", + "SELECTED_QUEUES_FAX_INBOUND": "Selected Fax Queues" + } +} diff --git a/public/app/main/apps/tools/i18n/bs.json b/public/app/main/apps/tools/i18n/bs.json index 306ec24..cbafa39 100644 --- a/public/app/main/apps/tools/i18n/bs.json +++ b/public/app/main/apps/tools/i18n/bs.json @@ -1,528 +1,528 @@ { "TOOLS": { - "VIDEOSUPPORT": "Video support", - "PREVIOUSCONTACT": "Previous", + "VIDEOSUPPORT": "Video podrška", + "PREVIOUSCONTACT": "Prethodni", "BOT": "Voicebot", - "CLONE_TRUNK": "Clone Trunk", - "DISPOSITIONS": "Dispositions", - "NEW_DISPOSITION": "New Disposition", - "ADD_DISPOSITION": "Add Disposition", - "EDIT_DISPOSITION": "Edit Disposition", - "DELETE_DISPOSITION": "Delete Disposition", - "RUN_SCHEDULE": "Run schedule", - "SENDIFEMPTY": "Send if empty", - "NEXTCONTACT": "Next", - "OUTBOUND_ROUTE": "Outbound Route", - "EDIT_DASHBOARDITEM": "Edit Dashboard Widget", - "FONTSIZE": "Font Size", - "TITLEFONTSIZE": "Font Title Size", - "CLONE_CUSTOMDASHBOARD": "Clone Custom Dashboard", + "CLONE_TRUNK": "Kloniraj Trunk", + "DISPOSITIONS": "Dispozicije", + "NEW_DISPOSITION": "Nova Dispozicija", + "ADD_DISPOSITION": "Dodaj Dispoziciju", + "EDIT_DISPOSITION": "Uredi Dispoziciju", + "DELETE_DISPOSITION": "Izbriši Dispoziciju", + "RUN_SCHEDULE": "Pokreni raspored", + "SENDIFEMPTY": "Pošalji ako je prazno", + "NEXTCONTACT": "Sljedeći", + "OUTBOUND_ROUTE": "Odlazna Ruta", + "EDIT_DASHBOARDITEM": "Uredi Widget Table", + "FONTSIZE": "Veličina Fonta", + "TITLEFONTSIZE": "Veličina Fonta Naslova", + "CLONE_CUSTOMDASHBOARD": "Kloniraj Prilagođenu Tablu", "LINK": "Link [https://]", - "BACKGROUND": "Background", + "BACKGROUND": "Pozadina", "FOREGROUND": "Foreground", - "IGNOREDIALERCONTACTID": "Ignore dialer contact Id", - "NONE": "None", - "TOTAL": "Total", - "ABANDONED": "Abandoned", - "WAITING": "Waiting", - "TALKING": "Talking", - "ANSWERED": "Answered", - "CONTACTITEMTYPE": "Contact item types", - "ORDER_BY": "Order by", - "RGBBACKGROUNDCOLOR": "RGB Background color", - "NEW_CONTACTITEMTYPE": "New contact item type", - "EDIT_CONTACTITEMTYPE": "Edit contact item type", - "DELETE_CONTACTITEMTYPE": "Delete contact item type", - "ORDER_BY_NUMERIC": "Order by field should be numeric value!", - "ADD_CONTACTITEMTYPE": "Add", - "UNMANAGED": "Unmanaged", - "CUSTOMTYPE": "Custom [path]", - "WEBREPORT": "Web Report", - "PIECHART": "Pie Chart", - "MULTIBARCHART": "Multibar Chart", - "MOVE_WIDGET": "Move Widget", - "USERADD_CUSTOMDASHBOARD": "Add User Permissions", - "GOTODASHBOARD_CUSTOMDASHBOARD": "Go to preview dashboard", - "GOTO_CUSTOMDASHBOARD": "Go to preview dashboard", - "METRIC": "Metric", - "FILTERVOICEQUEUES": "Filter Voice Queues", - "SERIE1": "Serie 1", - "SERIE2": "Serie 2", - "SERIE3": "Serie 3", - "REFRESH": "Refresh [s]", + "IGNOREDIALERCONTACTID": "Ingoriši pozivatelj kondakt ID", + "NONE": "Ništa", + "TOTAL": "Ukupno", + "ABANDONED": "Napušteno", + "WAITING": "Čeka", + "TALKING": "Priča", + "ANSWERED": "Odgovorio", + "CONTACTITEMTYPE": "Kontakt vrste stavki", + "ORDER_BY": "Poredaj po", + "RGBBACKGROUNDCOLOR": "RGB Pozadinska boja", + "NEW_CONTACTITEMTYPE": "Nova vrsta kontakt stavke", + "EDIT_CONTACTITEMTYPE": "Uredi kontakt vrstu stavke", + "DELETE_CONTACTITEMTYPE": "Izbriši kontakt vrstu stavke", + "ORDER_BY_NUMERIC": "Poredaj po polje treba biti numeričke vrijednosti!", + "ADD_CONTACTITEMTYPE": "Dodaj", + "UNMANAGED": "Neupravljan", + "CUSTOMTYPE": "Prilagođeno [path]", + "WEBREPORT": "Web Izvještaj", + "PIECHART": "Pie Grafikon", + "MULTIBARCHART": "Multibar Grafikon", + "MOVE_WIDGET": "Pomjeri Widget", + "USERADD_CUSTOMDASHBOARD": "Dodaj Korisniku Prava", + "GOTODASHBOARD_CUSTOMDASHBOARD": "Idi na pregled table", + "GOTO_CUSTOMDASHBOARD": "Idi na pregled table", + "METRIC": "Metrika", + "FILTERVOICEQUEUES": "Filtriraj Voice Queues", + "SERIE1": "Serija¸1", + "SERIE2": "Serija 2", + "SERIE3": "Serija 3", + "REFRESH": "Osvježi [s]", "FORMAT": "Format", - "PATH": "Absolute Path", - "ALL_USERS": "All Users", - "SELECTED_USERS": "Selected Users", - "ADD_WIDGET": "Add Widget", - "COLOR": "Color", + "PATH": "Apsolutni Put", + "ALL_USERS": "Svi Korisnici", + "SELECTED_USERS": "Odabrani Korisnici", + "ADD_WIDGET": "Dodaj Widget", + "COLOR": "Boja", "FAX": "Fax", - "INTERACTION": "Interaction", - "MESSAGE": "Message", + "INTERACTION": "Interakcija", + "MESSAGE": "Poruka", "T38PT_UDPTL": "T38pt Udptl", - "CALL": "Call", - "NAME": "Name", - "TRUNKS": "Trunks", - "SEARCH_FOR_ANYONE": "Search", - "SCRIPT": "Script", + "CALL": "Poziv", + "NAME": "Naziv", + "TRUNKS": "Trunkovi", + "SEARCH_FOR_ANYONE": "Traži", + "SCRIPT": "Skripta", "SCRIPT_INFO": "Info", - "SCRIPT_TYPE": "Type", - "EMAIL": "Email", - "FILTERFAXACCOUNTS": "Filter Fax Accounts", - "FILTERSMSACCOUNTS": "Filter Sms Accounts", - "FILTERCHATWEBSITES": "Filter Chat Websites", - "FILTERWHATSAPPACCOUNTS": "Filter Whatsapp Accounts", - "FILTEREMAILACCOUNTS": "Filter Email Accounts", - "FILTEROPENCHANNELACCOUNTS": "Filter OpenChannel Accounts", - "OPENED": "Opened", - "OPENED_TEXT": "Opened Interactions", - "MANAGED": "Managed", - "MANAGED_TEXT": "Managed Interactions", + "SCRIPT_TYPE": "Vrsta", + "EMAIL": "E-Mail", + "FILTERFAXACCOUNTS": "Filtriraj Fax Naloge", + "FILTERSMSACCOUNTS": "Filtriraj SMS Naloge", + "FILTERCHATWEBSITES": "Filtriraj Chat Webstranice", + "FILTERWHATSAPPACCOUNTS": "Filtriraj WhatsApp Naloge", + "FILTEREMAILACCOUNTS": "Filtriraj E-Mail Naloge", + "FILTEROPENCHANNELACCOUNTS": "Filtriraj Otvoreni Kanal Naloge", + "OPENED": "Otvoreno", + "OPENED_TEXT": "Otvorene Interakcije", + "MANAGED": "Upravljano", + "MANAGED_TEXT": "Upravljane Interakcije", "ERRORS": { - "INFO_REQUIRED": "Mandatory field", - "SCRIPT_REQUIRED": "Mandatory field", - "NAME_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "TITLE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "REFRESH_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "REFRESH_REQUIRED": "Mandatory field", - "FONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "FONTSIZE_REQUIRED": "Mandatory field", - "PATH_REQUIRED": "Mandatory field", - "FORMAT_REQUIRED": "Mandatory field", - "REPORT_REQUIRED": "Mandatory field", - "TYPE_REQUIRED": "Mandatory field", - "VALUE_REQUIRED": "Mandatory field", - "ACCOUNT_REQUIRED": "Mandatory field", - "IGNOREDIALERCONTACTID_REQUIRED": "Ignore dialer contact Id field is required", - "FIELD_REQUIRED": "Mandatory field", - "NAME_REQUIRED": "Mandatory field", - "HOST_REQUIRED": "Mandatory field", - "DEFAULTUSER_REQUIRED": "Mandatory field", - "CALLERID_REQUIRED": "Mandatory field", - "KEY_REQUIRED": "Mandatory field", - "CONFIRM_NOT_MATCH": "The Passwords don't match", - "VALIDITYSTART_REQUIRED": "Mandatory field", - "VALIDITYEND_REQUIRED": "Mandatory field", - "MONTHDAY_REQUIRED": "Mandatory field", - "HOUR_REQUIRED": "Mandatory field", - "CONTENT_REQUIRED": "Mandatory field", - "URL_REQUIRED": "Mandatory field", - "URL_MUST_VALID_URL": "Wrong format", - "APPLICATION_REQUIRED": "Mandatory field", - "ARGUMENTS_REQUIRED": "Mandatory field", - "NAME_MUST_VALID_PATTERN": "Wrong format", - "POLLING_INTERVAL_REQUIRED": "Mandatory field", - "TITLE_REQUIRED": "Mandatory field", - "EMAILADDRESS_REQUIRED": "Mandatory field", - "EVENTVARIABLES_REQUIRED": "Mandatory field", - "INTEGRATION_REQUIRED": "Mandatory field", - "LIST_REQUIRED": "Mandatory field", - "TEMPLATE_REQUIRED": "Mandatory field", - "AUTOCREATECONTACT_REQUIRED": "Mandatory field", - "AUTOCREATE_FIELD_REQUIRED": "Mandatory field", - "OUTBOUNDROUTE_REQUIRED": "Mandatory field", - "QUEUE_REQUIRED": "Mandatory field", - "TIME_RANGE_TO_REQUIRED": "Mandatory field", - "WEEK_DAYS_TO_REQUIRED": "Mandatory field", - "MONTH_DAYS_TO_REQUIRED": "Mandatory field", - "MONTH_TO_REQUIRED": "Mandatory field", - "TIME_RANGE_FROM_INVALID": "Wrong Format", - "TIME_RANGE_TO_INVALID": "Wrong Format", - "ACTION_REQUIRED": "Mandatory field", - "CONFIGURATION_REQUIRED": "Mandatory field", - "PROJECT_REQUIRED": "Mandatory field", - "LOCATION_REQUIRED": "Mandatory field", - "OUTPUT_REQUIRED": "Mandatory field", - "REPORTTYPE_REQUIRED": "Mandatory field", - "REPORTFOLDER_REQUIRED": "Mandatory field", - "REPORTSUBFOLDER_REQUIRED": "Mandatory field", - "AGENT_REQUIRED": "Mandatory field", - "TIMEOUT_REQUIRED": "Mandatory field", - "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "CHANNEL_REQUIRED": "Mandatory field" + "INFO_REQUIRED": "Obavezno polje", + "SCRIPT_REQUIRED": "Obavezno polje", + "NAME_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "TITLE_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "REFRESH_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "REFRESH_REQUIRED": "Obavezno polje", + "FONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "FONTSIZE_REQUIRED": "Obavezno polje", + "PATH_REQUIRED": "Obavezno polje", + "FORMAT_REQUIRED": "Obavezno polje", + "REPORT_REQUIRED": "Obavezno polje", + "TYPE_REQUIRED": "Obavezno polje", + "VALUE_REQUIRED": "Obavezno polje", + "ACCOUNT_REQUIRED": "Obavezno polje", + "IGNOREDIALERCONTACTID_REQUIRED": "Zanemari birač kontakt ID polja je obavezno", + "FIELD_REQUIRED": "Obavezno polje", + "NAME_REQUIRED": "Obavezno polje", + "HOST_REQUIRED": "Obavezno polje", + "DEFAULTUSER_REQUIRED": "Obavezno polje", + "CALLERID_REQUIRED": "Obavezno polje", + "KEY_REQUIRED": "Obavezno polje", + "CONFIRM_NOT_MATCH": "Lozinske se ne podudaraju", + "VALIDITYSTART_REQUIRED": "Obavezno polje", + "VALIDITYEND_REQUIRED": "Obavezno polje", + "MONTHDAY_REQUIRED": "Obavezno polje", + "HOUR_REQUIRED": "Obavezno polje", + "CONTENT_REQUIRED": "Obavezno polje", + "URL_REQUIRED": "Obavezno polje", + "URL_MUST_VALID_URL": "Pogrešan format", + "APPLICATION_REQUIRED": "Obavezno polje", + "ARGUMENTS_REQUIRED": "Obavezno polje", + "NAME_MUST_VALID_PATTERN": "Pogrešan format", + "POLLING_INTERVAL_REQUIRED": "Obavezno polje", + "TITLE_REQUIRED": "Obavezno polje", + "EMAILADDRESS_REQUIRED": "Obavezno polje", + "EVENTVARIABLES_REQUIRED": "Obavezno polje", + "INTEGRATION_REQUIRED": "Obavezno polje", + "LIST_REQUIRED": "Obavezno polje", + "TEMPLATE_REQUIRED": "Obavezno polje", + "AUTOCREATECONTACT_REQUIRED": "Obavezno polje", + "AUTOCREATE_FIELD_REQUIRED": "Obavezno polje", + "OUTBOUNDROUTE_REQUIRED": "Obavezno polje", + "QUEUE_REQUIRED": "Obavezno polje", + "TIME_RANGE_TO_REQUIRED": "Obavezno polje", + "WEEK_DAYS_TO_REQUIRED": "Obavezno polje", + "MONTH_DAYS_TO_REQUIRED": "Obavezno polje", + "MONTH_TO_REQUIRED": "Obavezno polje", + "TIME_RANGE_FROM_INVALID": "Pogrešan format", + "TIME_RANGE_TO_INVALID": "Pogrešan format", + "ACTION_REQUIRED": "Obavezno polje", + "CONFIGURATION_REQUIRED": "Obavezno polje", + "PROJECT_REQUIRED": "Obavezno polje", + "LOCATION_REQUIRED": "Obavezno polje", + "OUTPUT_REQUIRED": "Obavezno polje", + "REPORTTYPE_REQUIRED": "Obavezno polje", + "REPORTFOLDER_REQUIRED": "Obavezno polje", + "REPORTSUBFOLDER_REQUIRED": "Obavezno polje", + "AGENT_REQUIRED": "Obavezno polje", + "TIMEOUT_REQUIRED": "Obavezno polje", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "CHANNEL_REQUIRED": "Obavezno polje" }, "HOST": "Host", - "SECRET": "Secret", - "DEFAULTUSER": "Default User", - "DESCRIPTION": "Description", - "ADD_TRUNK": "Add Trunk", + "SECRET": "Tajni", + "DEFAULTUSER": "Zadani Korisnik", + "DESCRIPTION": "Opis", + "ADD_TRUNK": "Dodaj Trunk", "HELP": { - "OPENED": "The total number of Active Interactions", - "MANAGED": "The total number of Completed Interactions", - "SCRIPT_INFO": "Insert a description for the script", - "SCRIPT_TYPE": "Insert a typology for the script (eg. curl, bash...)", - "INFO": "Insert title", - "SCRIPT": "Insert script", + "OPENED": "Ukupan broj Aktivnih Interakcija", + "MANAGED": "Ukupan broj Završenih Interakcija", + "SCRIPT_INFO": "Ubaci opis za skriptu", + "SCRIPT_TYPE": "Ubaci tiplogiju za skriptu (npr. curl, bash...)", + "INFO": "Unesti naslov", + "SCRIPT": "Ubaci skriptu", "T38PT_UDPTL": "Es: yes,redundancy,maxdatagram=400", - "SECRET": "Authentication password", - "HOST": "The domain or host name", - "DEFAULTUSER": "Authentication username", - "CALLERID": "The Caller ID, in the format \"name\" ", - "REGISTRY": "The registry string, if required by provider, usually defaultuser:secret@host", - "FROMDOMAIN": "Set default From:domain in SIP messages when acting as a SIP ua (client). Some destinations may require mandatory identity name instead of only the IP address", - "FROMUSER": "How your provider knows you. This is which user to put instead of callerid when placing calls to peer (another SIP proxy). Valid only for type=peer.", - "OUTBOUNDPROXY": "IP_address or DNS SRV name (excluding the _sip._udp prefix): SRV name, hostname, or IP address of the outbound SIP Proxy. Send outbound signaling to this proxy, not directly to the devices. Valid only for type=peer.", - "PORT": "The SIP port number", - "CONTEXT": "The context for the trunk", - "TYPE": "Determine the SIP role within asterisk. User: used to authenticate incoming - Peer: for outgoing calls - Friend: covers both characteristics of the above.", - "DTMFMODE": "How DTMF (Dual-Tone Multi-Frequency) are sent. RFC2833: the default mode, the DTMF are sent with RTP but outside the audio stream. INBAND: The DTMF is sent in audio stream of the current conversation, becoming audible from the speakers. Requires a high CPU load. INFO: Although this method is very reliable, it is not supported by all PBX devices and many SIP Trunks.", - "NAT": "Change the behaviour of Asterisk for clients behind a firewall. If any of the comma-separated options is 'no', Asterisk will ignore any other settings and set nat=no.", - "QUALIFY": "Determine when the SIP is achievable", - "ALLOWCODECS": "Allowed codecs in order of preference", - "INSECURE": "Specify how to handle connections with peer, allowing insecure settings", - "CALL_LIMIT": "The limit number of the inbound and outbound concurrent calls", - "DIRECTMEDIA": "Asterisk by default tries to redirect the RTP media stream to go directly from the caller to the callee. Some devices do not support this (especially if one of them is behind a NAT). The default setting is YES. If you have all clients behind a NAT, or for some other reason want Asterisk to stay in the audio path, you may want to turn this off.", - "CALLCOUNTER": "Enable call counters on devices", - "ADD_PHONE_TO_URI": "Define if the provider requires ';user=phone' on URL", - "TRUST_REMOTE_PARTY_ID": "Define if Remote-Party-ID should be trusted", - "SEND_REMOTE_PARTY_ID_HEADER": "Define if Remote-Party-ID should be sent (defaults is no)", - "ENCRYPTION": "Whether to offer SRTP encrypted media (and only SRTP encrypted media) on outgoing calls to a peer. Calls will fail with HANGUPCAUSE=58 if the peer does not support SRTP. Defaults value is No", - "TRANSPORT": "Set the default transports, in order of preference", - "OTHERFIELDS": "Other fields to add in the trunks conf files. Follow default asterisk format (key=value), each field on a single row", - "EMAILADDRESS": "Add one or multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)", - "EMAILCCADDRESS": "Add one or multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)", - "EMAILBCCADDRESS": "Add one or multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)", - "NAME": "Only numbers, letters and specific characters (._) are supported", - "EVENTVARIABLES": "If enabled, it adds all the event variables to the url (recommended value=No. Set to Yes only for evaluation purposes) ", - "HEADERS": "Note: Headers section must be in RAW JSON format {\"key\":\"value\"} \nNote: If not filled out, the default value will be sent", - "BODY": "Note: the body must be in RAW JSON format {\"key\":\"value\"} \nNote: If not filled out, the default value will be sent", - "TIMEOUT": "Request timeout in seconds. The value must be between 1 and 10 and the default value is 5." + "SECRET": "Lozinka za autentifikaciju", + "HOST": "Naziv domene ili hosta", + "DEFAULTUSER": "Korisničko ime za autentifikaciju", + "CALLERID": "Pozivatelj ID, u formatu \"ime\" ", + "REGISTRY": "String registratora, ako to zahtijeva provajder, obično zadanikorisnik:secret@host", + "FROMDOMAIN": "Postavi zadano Od:domena u SIP porukama kada djeluje kao SIP ua (klijent). Neka odredišta mogu zahtijevati obavezno ime identiteta umjesto samo IP adrese", + "FROMUSER": "Kako te tvoj provajder prepoznaje. Ovo je kojeg korisnika treba postaviti umjesto Pozivatelj IDa kada upućuje poziv peeru (drugi SIP proxy). Vrijedi samo za type=peer.", + "OUTBOUNDPROXY": "IP adresa ili DNS SRV naziv (isključujući _sip._udp prefiks): SRV naziv, naziv hosta ili IP adresa odlaznog SIP Proxy. Šalji odlazni signal na ovaj proxy, a ne direktno na uređaje. Vrijedi samo za type=peer.", + "PORT": "Broj SIP porta", + "CONTEXT": "Kontekst za Trunk", + "TYPE": "Odredi SIP ulogu unutar asteriska. Korisnik: koristi se za autentifikaciju dolaznih - Peer: za odlazne pozive - Prijatelj: pokriva obje gore navedene karakteristike.", + "DTMFMODE": "Kako se DTMF (Dual-Tone Multi-Frequency) šalje. RFC2833: zadani način rada, DTMF se šalju sa RTPom, ali izvan audio streama. INBAND: DTMF se šalje u audio streamu trenutne konverzacije, postajući čujni iz zvučnika. Zahtijeva veliko CPU opterećenje. INFORMACIJE: Iako je ovaj metod vrlo pouzdan, ne podržavaju ga svi PBX uređaji i mnogi SIP Trunkovi.", + "NAT": "Promijeni ponašanje Asteriska za klijente iza firewalla. Ako je bilo koja od opcija razdvojenih zarezima 'ne', Asterisk će zanemariti sve druge postavke i postaviti nat=no.", + "QUALIFY": "Odredi kada je SIP dostupan", + "ALLOWCODECS": "Dozvoljeni kodeci prema željenom redoslijedu", + "INSECURE": "Odredi kako se rukovati vezama sa peer, dozvoljavajući nesigurne postavke", + "CALL_LIMIT": "Broj ograničenja dolaznih i odlaznih istovremenih poziva", + "DIRECTMEDIA": "Asterisk zadano pokušava da preusmjeri RTP medijski stream da ide direktno od pozivatelja do pozvanog. Neki uređaji to ne podržavaju (posebno ako je jedan od njih iza NATa). Zadana postavka je DA. Ako imate sve klijente iza NATa, ili iz nekog drugog razloga želite da Asterisk ostane na audio putanji, možda biste trebali ovo isključiti.", + "CALLCOUNTER": "Omogući brojače poziva na uređajima", + "ADD_PHONE_TO_URI": "Definiraj da li provajder zahtijeva ';user=phone' na URLu", + "TRUST_REMOTE_PARTY_ID": "Definiši da li se Remote-party-ID treba vjerovati", + "SEND_REMOTE_PARTY_ID_HEADER": "Definiši da li Remote-Party-ID treba biti poslan (zadano je ne)", + "ENCRYPTION": "Da li ponuditi SRTP šifrirane medije (i samo SRTP šifrirane medije) za odlazne pozive prema peer. Pozivi će biti neuspješni sa HANGUPCAUSE=58 ako peer ne podržava SRTP. Zadana vrijednost je Ne", + "TRANSPORT": "Postaiv zadane transporte, prema željenom rasporedu", + "OTHERFIELDS": "Ostala polja za dodavanje u trunk .conf datoteke. Slijedi zadani asterisk format (key=value), svako polje u jednom redu", + "EMAILADDRESS": "Dodaj jednu ili više adresa odvojenih zarezima (npr. din.becirovic@toyota.ba, semir.seferovic@toyota.ba)", + "EMAILCCADDRESS": "Dodaj jednu ili više adresa odvojenih zarezima (npr. din.becirovic@toyota.ba, semir.seferovic@toyota.ba)", + "EMAILBCCADDRESS": "Dodaj jednu ili više adresa odvojenih zarezima (npr. din.becirovic@toyota.ba, semir.seferovic@toyota.ba)", + "NAME": "Samo brojevi, slova i specifični znakovi (._) su podržani", + "EVENTVARIABLES": "Ako je omogućeno, dodaje sve varijable događaja u URL (preporučena vrijednost=Ne. Postavite na Da samo u svrhu evaluacije)", + "HEADERS": "Napomena: odjeljak zaglavlja mora biti u RAW JSON formatu {\"key\":\"value\"} \nNapomena: Ako nije popunjen, bit će poslana zadana vrijednost", + "BODY": "Napomena: tijelo mora biti u RAW JSON formatu {\"key\":\"value\"} \nNapomena: Ako nije popunjeno, bit će poslana zadana vrijednost", + "TIMEOUT": "Timeout zahtjev u sekundama. Vrijednost mora biti između 1 i 10, zadana verzija je 5." }, - "EDIT_TRUNK": "Edit Trunk", - "DELETE_TRUNK": "Delete Trunk", - "CREATED_AT": "Created At", - "SETTINGS": "Settings", - "ADVANCED": "Advanced", - "OTHER": "Other", - "ACTIVE": "Active", - "CONTEXT": "Context", - "CALLERID": "Caller ID", - "TYPE": "Type", - "DTMFMODE": "DTMF Mode", + "EDIT_TRUNK": "Uredi Trunk", + "DELETE_TRUNK": "IZbriši Trunk", + "CREATED_AT": "Kreirano U", + "SETTINGS": "Postavke", + "ADVANCED": "Napredno", + "OTHER": "Ostao", + "ACTIVE": "Aktivno", + "CONTEXT": "Kontekst", + "CALLERID": "Pozivatelj ID", + "TYPE": "Vrsta", + "DTMFMODE": "DTMF Način rada", "NAT": "NAT", - "QUALIFY": "Qualify", - "ALLOWCODECS": "Allowed Codecs", - "INSECURE": "Insecure", - "REGISTRY": "Registry", - "DIRECTMEDIA": "Direct Media", - "CALLCOUNTER": "Call Counter", - "FROMDOMAIN": "From Domain", - "FROMUSER": "From User", - "OUTBOUNDPROXY": "Outbound Proxy", - "ADD_PHONE_TO_URI": "Add Phone to URL", + "QUALIFY": "Kvalifikuj", + "ALLOWCODECS": "Dozvoljeni Kodeci:", + "INSECURE": "Nesiugran", + "REGISTRY": "Registart", + "DIRECTMEDIA": "Direktni Medij", + "CALLCOUNTER": "Brojač Poziva", + "FROMDOMAIN": "Iz Domene", + "FROMUSER": "Od Korisnika", + "OUTBOUNDPROXY": "Odlazni Proxy", + "ADD_PHONE_TO_URI": "Dodaj Telefon u URL", "TRUST_REMOTE_PARTY_ID": "Trust Remote Party ID", - "SEND_REMOTE_PARTY_ID_HEADER": "Send Remote Party ID Header", - "ENCRYPTION": "Encryption", + "SEND_REMOTE_PARTY_ID_HEADER": "Pošalji Remote Party ID Zaglavlje", + "ENCRYPTION": "Enkripcija", "PORT": "Port", "TRANSPORT": "Transport", - "SAVE": "Save", - "VARIABLES": "Variables", - "ADD_VARIABLE": "Add Variable", - "EDIT_VARIABLE": "Edit Variable", - "DELETE_VARIABLE": "Delete Variable", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "TAGS": "Tags", - "ADD_TAG": "Add Tag", - "EDIT_TAG": "Edit Tag", - "DELETE_TAG": "Delete Tag", - "PAUSES": "Pauses", - "ADD_PAUSE": "Add Pause", - "EDIT_PAUSE": "Edit Pause", - "DELETE_PAUSE": "Delete Pause", - "CANNEDANSWERS": "Canned Answers", - "ADD_CANNEDANSWER": "Add Canned Answer", - "EDIT_CANNEDANSWER": "Edit Canned Answer", - "DELETE_CANNEDANSWER": "Delete Canned Answer", - "KEY": "Key", - "VALUE": "Value", - "SOUNDS": "Sounds", - "EDIT_SOUND": "Edit Sound", - "DELETE_SOUND": "Delete Sound", - "CANCEL": "Cancel", - "FINISH": "Finish", - "DROP_TO_UPLOAD": "Drop To Upload", - "UPLOADING": "Uploading", - "TRIGGERS": "Triggers", - "EDIT_TRIGGER": "Edit Trigger", - "DELETE_TRIGGER": "Delete Trigger", - "ADD_TRIGGER": "Add Trigger", - "DELETE": "Delete", - "AUTOMATIONS": "Automations", - "EDIT_AUTOMATION": "Edit Automation", - "DELETE_AUTOMATION": "Delete Automation", - "ADD_AUTOMATION": "Add Automation", - "INTERVALS": "Intervals", - "EDIT_INTERVAL": "Edit Interval", - "DELETE_INTERVAL": "Delete Interval", - "ADD_INTERVAL": "Add Interval", - "TOOLS": "Tools", - "ID": "Id", + "SAVE": "Sačuvaj", + "VARIABLES": "Varijabla", + "ADD_VARIABLE": "Dodaj Varijablu", + "EDIT_VARIABLE": "Uredi Varijablu", + "DELETE_VARIABLE": "Izbriši Varijablu", + "SELECTED": "Odabrano", + "SELECT_ALL": "Odaberi Sve", + "SELECT_NONE": "Odaberi Ništa", + "TAGS": "Tagovi", + "ADD_TAG": "Dodaj Tag", + "EDIT_TAG": "Uredi Tag", + "DELETE_TAG": "Izbriši Tag", + "PAUSES": "Pauze", + "ADD_PAUSE": "Dodaj Pauzu", + "EDIT_PAUSE": "Uredi Pauzu", + "DELETE_PAUSE": "Izbriši Pauzu", + "CANNEDANSWERS": "Pripremljeni Odgovori", + "ADD_CANNEDANSWER": "Dodaj Pripremljeni Odgovor", + "EDIT_CANNEDANSWER": "Uredi Pripremljeni Odgovor", + "DELETE_CANNEDANSWER": "Izbriši Pripremljeni Odgovor", + "KEY": "Ključ", + "VALUE": "Vrijednost", + "SOUNDS": "Zvukovi", + "EDIT_SOUND": "Uredi Zvuk", + "DELETE_SOUND": "Izbriši Zvuk", + "CANCEL": "Otkaži", + "FINISH": "Završi", + "DROP_TO_UPLOAD": "Ispusti za Učitavanje", + "UPLOADING": "Učitavanje", + "TRIGGERS": "Trigers", + "EDIT_TRIGGER": "Uredi Triger", + "DELETE_TRIGGER": "Izbriši Triger", + "ADD_TRIGGER": "Dodaj Triger", + "DELETE": "Ibriši", + "AUTOMATIONS": "Automatizacija", + "EDIT_AUTOMATION": "Uredi Automatizaciju", + "DELETE_AUTOMATION": "Izbriši Automatizaciju", + "ADD_AUTOMATION": "Dodaj Automatizaciju", + "INTERVALS": "Intervali", + "EDIT_INTERVAL": "Uredi Interval", + "DELETE_INTERVAL": "Izbriši Interval", + "ADD_INTERVAL": "Dodaj Interval", + "TOOLS": "Alati", + "ID": "ID", "AUDIO": "Audio", - "DOWNLOAD_SOUND": "Download Sound", - "UPLOAD_SOUND": "Tools", - "CHANNEL": "Channel", - "NEW_TRIGGER": "New Trigger", - "GENERAL": "General", + "DOWNLOAD_SOUND": "Skini Zvuk", + "UPLOAD_SOUND": "Alati", + "CHANNEL": "Kanal", + "NEW_TRIGGER": "Novi Triger", + "GENERAL": "Općenito", "STATUS": "Status", - "CONDITIONS&ACTIONS": "Conditions & Actions", - "ALLCONDITIONS": "Meet all these conditions:", - "ANYCONDITIONS": "Meet any of these conditions:", - "ACTIONS": "Actions:", - "NEW_AUTOMATION": "New Automation", + "CONDITIONS&ACTIONS": "Uslovi & Radnje", + "ALLCONDITIONS": "Ispuni sve ove uslove:", + "ANYCONDITIONS": "Ispuni bilo koji od ovih uslova:", + "ACTIONS": "Radnje", + "NEW_AUTOMATION": "Nova Automatizacija", "TIMEOUT": "Timeout", "PEERSTATUS": "Peer Status", - "CALL_LIMIT": "Calls Limit", - "OTHERFIELDS": "Other Fields", - "NEW_VARIABLE": "New Variable", - "NEW_TAG": "New Tag", - "NEW_PAUSE": "New Pause", - "NEW_CANNEDANSWER": "New Canned Answer", - "CONFIRM_PASSWORD": "Confirm Password", - "NEW_TRUNK": "New Trunk", - "FROM": "From", - "TO": "To", - "WEEKDAY": "Week Day", - "MONTHDAY": "Month Day", - "MONTH": "Month", - "ALWAYS": "Always", - "MON": "Monday", - "TUE": "Tuesday", - "WED": "Wednesday", - "THU": "Thursday", - "FRI": "Friday", - "SAT": "Saturday", - "SUN": "Sunday", - "JAN": "January", - "FEB": "February", - "MAR": "March", + "CALL_LIMIT": "Limit Poziva", + "OTHERFIELDS": "Ostala Polja", + "NEW_VARIABLE": "Nova Varijabla", + "NEW_TAG": "Novi Tag", + "NEW_PAUSE": "Nova Pauza", + "NEW_CANNEDANSWER": "Novi Pripremljeni Odgovor", + "CONFIRM_PASSWORD": "Potvrdi lozinku", + "NEW_TRUNK": "Novi Trunk", + "FROM": "Od", + "TO": "Za", + "WEEKDAY": "Dan u Sedmici", + "MONTHDAY": "Dan u Mjesecu", + "MONTH": "Mjesec", + "ALWAYS": "Uvijek", + "MON": "Ponedjeljak", + "TUE": "Utorak", + "WED": "Srijeda", + "THU": "Četvrtak", + "FRI": "Petak", + "SAT": "Subota", + "SUN": "Nedelja", + "JAN": "Januar", + "FEB": "Februar", + "MAR": "Mart", "APR": "April", - "MAY": "May", - "JUN": "June", - "JUL": "July", + "MAY": "Maj", + "JUN": "Juni", + "JUL": "Juli", "AUG": "August", - "SEP": "September", - "OCT": "October", - "NOV": "November", - "DEC": "December", - "PASSWORD": "Password", - "CUSTOMDASHBOARDS": "Custom Dashboards", - "NEW_CUSTOMDASHBOARD": "New Custom Dashboard", - "ADD_CUSTOMDASHBOARD": "Add Custom Dashboard", - "EDIT_CUSTOMDASHBOARD": "Edit Custom Dashboard", - "DELETE_CUSTOMDASHBOARD": "Delete Custom Dashboard", - "SCHEDULER": "Scheduler", - "NEW_SCHEDULE": "New Schedule", - "ADD_SCHEDULE": "Add Schedule", - "EDIT_SCHEDULE": "Edit Schedule", - "DELETE_SCHEDULE": "Delete Schedule", - "SENDMAIL": "Send Email", - "CONFIGURATION": "Configuration", - "MAIL": "Email", - "REPORTTYPE": "Report Type", - "REPORT": "Report", - "OUTPUT": "Output", - "EXECUTEON": "Execute On", - "REPORTRANGE": "Report Range", - "VALIDITYSTART": "Start Time", - "VALIDITYEND": "End Time", - "EXECUTEEVERY": "Execute every", - "ACCOUNT": "Account", - "EMAILADDRESS": "Email Address", + "SEP": "Septembar", + "OCT": "Oktobar", + "NOV": "Novembar", + "DEC": "Decembar", + "PASSWORD": "Lozinka", + "CUSTOMDASHBOARDS": "Prilagođena Tabla", + "NEW_CUSTOMDASHBOARD": "Nova Prilagođena Tabla", + "ADD_CUSTOMDASHBOARD": "Dodaj Prilagođenu Tablu", + "EDIT_CUSTOMDASHBOARD": "Uredi Prilagođenu Tablu", + "DELETE_CUSTOMDASHBOARD": "Izbriši Prilagođenu Tablu", + "SCHEDULER": "Planer", + "NEW_SCHEDULE": "Novi Raspored", + "ADD_SCHEDULE": "Dodaj Raspored", + "EDIT_SCHEDULE": "Uredi Raspored", + "DELETE_SCHEDULE": "Izbriši Raspored", + "SENDMAIL": "Pošalji E-Mail", + "CONFIGURATION": "Konfiguracija", + "MAIL": "E-Mail", + "REPORTTYPE": "Vrsta Izvještaja", + "REPORT": "Izvještaj", + "OUTPUT": "Izlaz", + "EXECUTEON": "Izvrši Na", + "REPORTRANGE": "Opseg Izvještaja", + "VALIDITYSTART": "Vrijeme Početka", + "VALIDITYEND": "Vrijeme Završetka", + "EXECUTEEVERY": "Izvrši svaki", + "ACCOUNT": "Nalog", + "EMAILADDRESS": "E-Mail Adresa", "EMAILCCADDRESS": "Cc", "EMAILBCCADDRESS": "Bcc", - "CURRENTDAY": "Current Day", - "DAILY": "Daily", - "WEEKLY": "Weekly", - "MONTHLY": "Monthly", - "PREVIOUS_DAY": "Previous Day", - "LAST_SEVEN_DAYS": "Last Seven Days", - "LAST_THIRTY_DAYS": "Last Thirthy Days", - "LAST_MONTH": "Last Month", - "WEEKDAYS": "Week Days", - "HOUR": "Hour", - "DEFAULT": "Default", + "CURRENTDAY": "Današnji dan", + "DAILY": "Dnevno", + "WEEKLY": "Sedmično", + "MONTHLY": "Mjesečno", + "PREVIOUS_DAY": "Prethodni Dan", + "LAST_SEVEN_DAYS": "Posljednjih Sedam Dana", + "LAST_THIRTY_DAYS": "Posljednjih Trideset Data", + "LAST_MONTH": "Posljednji Mjesec", + "WEEKDAYS": "Dani u Sedmici", + "HOUR": "Sat", + "DEFAULT": "Zadano", "CSV": "CSV", "PDF": "PDF", - "15MIN": "15 minutes", - "30MIN": "30 minutes", - "1H": "1 hour", + "15MIN": "15 minuta", + "30MIN": "30 minuta", + "1H": "1 sat", "VOICE": "Voice", "CHAT": "Chat", "SMS": "SMS", - "OPENCHANNEL": "Open Channel", - "TEMPLATES": "Templates", - "EDIT_TEMPLATE": "Edit Template", - "DELETE_TEMPLATE": "Delete Template", - "NEW_TEMPLATE": "New Template", - "ADD_TEMPLATE": "Add Template", - "CONTENT": "Content", - "FIELD": "Field", - "NO_ANYCONDITION_AVAILABLE": "No Conditions available", - "NO_ALLCONDITION_AVAILABLE": "No Conditions available", - "NO_ACTION_AVAILABLE": "No Actions available", - "ACTION": "Action", - "EDIT_ANYCONDITION": "Edit Condition", - "DELETE_ANYCONDITION": "Delete Condition", - "NEW_ANYCONDITION": "New Condition", - "ADD_ANYCONDITION": "Add Condition", - "EDIT_ALLCONDITION": "Edit Condition", - "DELETE_ALLCONDITION": "Delete Condition", - "NEW_ALLCONDITION": "New Condition", - "ADD_ALLCONDITION": "Add Condition", - "EDIT_ACTION": "Edit Action", - "DELETE_ACTION": "Delete Action", - "NEW_ACTION": "New Action", - "ADD_ACTION": "Add Action", + "OPENCHANNEL": "Otvoreni Kanal", + "TEMPLATES": "Šabloni", + "EDIT_TEMPLATE": "Uredi Šablon", + "DELETE_TEMPLATE": "Izbriši Šablon", + "NEW_TEMPLATE": "Novi Šablon", + "ADD_TEMPLATE": "Dodaj Šablon", + "CONTENT": "Sadržaj", + "FIELD": "Polje", + "NO_ANYCONDITION_AVAILABLE": "Nema dostupnih Uslova", + "NO_ALLCONDITION_AVAILABLE": "Nema dostupnih Uslova", + "NO_ACTION_AVAILABLE": "Nema dostupnih radnji", + "ACTION": "Radnja", + "EDIT_ANYCONDITION": "Uredi Uslov", + "DELETE_ANYCONDITION": "Izbriši Uslov", + "NEW_ANYCONDITION": "Novi Uslov", + "ADD_ANYCONDITION": "Dodaj Uslov", + "EDIT_ALLCONDITION": "Uredi Uslov", + "DELETE_ALLCONDITION": "Izbriši Uslov", + "NEW_ALLCONDITION": "Novi Uslov", + "ADD_ALLCONDITION": "Dodaj Uslov", + "EDIT_ACTION": "Uredi Radnju", + "DELETE_ACTION": "Izbriši Radnju", + "NEW_ACTION": "Nova Radnja", + "ADD_ACTION": "Dodaj Radnju", "QUEUE": "Queue", - "CALL_STATUS": "Call Status", - "OUTBOUNDROUTE": "Outbound Route", - "MAIL_SUBSTATUS": "Email Substatus", - "OFFLINE_MESSAGE": "Offline Message", - "EQUALS": "Equals", - "NOT_EQUALS": "Not Equals", - "CONTACT_MANAGER": "Contacts Manager", - "INTEGRATIONS": "Integrations", + "CALL_STATUS": "Status Poziva", + "OUTBOUNDROUTE": "Odlazna Ruta", + "MAIL_SUBSTATUS": "E-Mail Podstatusi", + "OFFLINE_MESSAGE": "Offline Poruka", + "EQUALS": "Jednako", + "NOT_EQUALS": "Nije Jednako", + "CONTACT_MANAGER": "Kontakt Menadžer", + "INTEGRATIONS": "Integracije", "MOTIONBAR": "Motion Bar", "JSCRIPTY": "Jscripty", "URL_FORWARD": "URL Forward", "WEB_POPUP": "Web Popup", - "LIST": "List", - "INTEGRATION": "Integration", - "TEMPLATE": "Template", + "LIST": "Lista", + "INTEGRATION": "Integracija", + "TEMPLATE": "Šablon", "URL": "URL", - "APPLICATION": "Application", - "ARGUMENTS": "Arguments", - "NO_APPS_AVAILABLE": "No applications available", - "NEW_INTERVAL": "New Interval", - "OPERATOR": "Operator", - "NO_INTERVALS_AVAILABLE": "No intervals available", - "YES": "Yes", - "NO": "No", - "SUBJECT": "Subject", - "NO_AVAILABLE_INFO": "No available info", - "BROWSER": "Browser", + "APPLICATION": "Aplikacija", + "ARGUMENTS": "Argumenti", + "NO_APPS_AVAILABLE": "Nema dostupnih aplikacija", + "NEW_INTERVAL": "Novi Interval", + "OPERATOR": "Operater", + "NO_INTERVALS_AVAILABLE": "Nema dostupnih intervala", + "YES": "Da", + "NO": "Ne", + "SUBJECT": "Predmet", + "NO_AVAILABLE_INFO": "Nema dostupnih informacija", + "BROWSER": "Pretraživač", "INTERVAL": "Interval", "INFO": "Info", - "TIME_RANGE": "Time Range", - "WEEK_DAYS": "Week Days", - "MONTH_DAYS": "Month Days", - "MONTHS": "Months", - "DROP_TO_UPLOAD_MESSAGE": "Drop audio files here to upload. Only MP3, WAV, GSM - Max. 15MB", - "POLLING_INTERVAL": "Polling Interval (seconds)", - "DASHBOARD": "Dashboard", - "NEW_DASHBOARDITEM": "New Dashboard Widget", - "COUNTER": "Counter", + "TIME_RANGE": "Vremenski Raspon", + "WEEK_DAYS": "Dani u Sedmici", + "MONTH_DAYS": "Dani u Mjesecu", + "MONTHS": "Mjeseci", + "DROP_TO_UPLOAD_MESSAGE": "Ovdje ispusti audio datoteke za učitavanje. Samo MP3, WAV, GSM - Maks. 15MB", + "POLLING_INTERVAL": "Polling Interval (sekunde)", + "DASHBOARD": "Tabla", + "NEW_DASHBOARDITEM": "Nova Tabla Widget", + "COUNTER": "Brojač", "IFRAME": "IFrame", - "CLOCK": "Clock", - "ADD_DASHBOARDITEM": "Add Dashboard Widget", - "EDIT_WIDGET": "Edit Widget", - "DELETE_WIDGET": "Delete Widget", - "FLIP_WIDGET": "Flip Widget", - "TITLE": "Title", - "UPDATE": "Update", - "LAYOUT": "Layout", - "BACKGROUND_COLOR": "Background Color", - "FOREGROUND_COLOR": "Foreground Color", - "FOREGROUND_TITLE_COLOR": "Foreground Title Color", - "THEME": "Theme", - "LIGHT": "Light", - "DARK": "Dark", - "TIMEZONE": "TimeZone", - "DIGITAL_FORMAT": "Digital Date Format", - "TOOLS_QUERY": "Query", - "SELECT": "Select", - "WHERE": "Where", - "BACK": "Back", - "PROJECT": "Project", - "GOTOREALTIME_TRUNK": "Go To Realtime Trunk", - "GOTO_TRUNK": "Go To Trunk", + "CLOCK": "Sat", + "ADD_DASHBOARDITEM": "Dodaj Widget Table", + "EDIT_WIDGET": "Uredi Widget", + "DELETE_WIDGET": "Izbriši Widget", + "FLIP_WIDGET": "Okreni Widget", + "TITLE": "Naslov", + "UPDATE": "Ažuriraj", + "LAYOUT": "Izgled", + "BACKGROUND_COLOR": "Boja Pozadine", + "FOREGROUND_COLOR": "Foreground Boja", + "FOREGROUND_TITLE_COLOR": "Foreground Naslov Boja ", + "THEME": "Tema", + "LIGHT": "Svjetlo", + "DARK": "Tamno", + "TIMEZONE": "Vremenska Zona", + "DIGITAL_FORMAT": "Izbriši Format Datuma", + "TOOLS_QUERY": "Upit", + "SELECT": "Odaberi", + "WHERE": "Gdje", + "BACK": "Nazad", + "PROJECT": "Projekat", + "GOTOREALTIME_TRUNK": "Idi na Realtime Trunk", + "GOTO_TRUNK": "Idi na Trunk", "CRON": "Cron", - "MINUTES": "Minutes", - "HOURLY": "Hourly", - "YEARLY": "Yearly", - "EVERY": "Every", - "MINUTE": "Minute", - "ON_SECOND": "On second", - "HOUR_ON_MINUTE": "Hour on minute", - "AND_SECOND": "And second", - "DAY_AT": "Day at", - "START_TIME": "Start Time", - "ON_THE": "On the", - "OF_EVERY": "Of every", - "MONTH_AT": "Month at", - "AT": "At", - "LAST": "Last", - "LASTUNIT": "Unit", - "MAILACCOUNT": "Email Account", - "OF": "of", - "PAST_THE_HOUR": "Past the hour", - "DAY": "Day", - "WEEK": "Week", - "YEAR": "Year", - "ON": "On", + "MINUTES": "Minute", + "HOURLY": "Po satu", + "YEARLY": "Godišnje", + "EVERY": "Svaki", + "MINUTE": "Minuta", + "ON_SECOND": "Na drugom", + "HOUR_ON_MINUTE": "Sat na minut", + "AND_SECOND": "I drugo", + "DAY_AT": "Dan u", + "START_TIME": "Vrijeme Početka", + "ON_THE": "Na", + "OF_EVERY": "Od svakog", + "MONTH_AT": "Mjesec U", + "AT": "Na", + "LAST": "Posljednji", + "LASTUNIT": "Jedinica", + "MAILACCOUNT": "E-Mail nalog", + "OF": "od", + "PAST_THE_HOUR": "Prošao sat", + "DAY": "Dan", + "WEEK": "Sedmica", + "YEAR": "Godina", + "ON": "Na", "PAI": "P-Asserted-Identity", - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "EVENTVARIABLES": "Event Variables", - "AUTOCREATECONTACT": "Create contact automatically", - "LOCATION": "Location", - "NEW_TAB": "New Tab", - "NEW_WINDOW": "New Window", - "MOTION_TAB": "New Agent Dashboard Tab", - "WINDOWWIDTH": "Window Width(px)", - "WINDOWHEIGHT": "Window Height(px)", - "BODY": "Body", - "REPORTFOLDER": "Report Folder", - "REPORTSUBFOLDER": "Report Subfolder", - "AGENT": "Agent", - "HEADERS": "Headers", - "WHATSAPP": "WhatsApp Connector", - "LEVEL": "Level", + "PAGE": "Stranica", + "ROWSPERPAGE": "Redova po stranici", + "EVENTVARIABLES": "Varijable Događaja", + "AUTOCREATECONTACT": "Kreiraj kontakt automatski", + "LOCATION": "Lokacija", + "NEW_TAB": "Novi Tab", + "NEW_WINDOW": "Novi Prozor", + "MOTION_TAB": "Novi Specijalista Tabla Tab", + "WINDOWWIDTH": "Širina Prozora(px)", + "WINDOWHEIGHT": "Visina Prozora(px)", + "BODY": "Tijelo", + "REPORTFOLDER": "Folder Izvještaja", + "REPORTSUBFOLDER": "Podfolder Izvještaja", + "AGENT": "Specijalista", + "HEADERS": "Zaglavlja", + "WHATSAPP": "WhatsApp Konektor", + "LEVEL": "Nivo", "NOTIFICATIONS": { - "DISPOSITION_CREATED_SUCCESS_TITLE": "Disposition successfully created", - "DISPOSITION_SAVED_SUCCESS_TITLE": "Disposition successfully saved", - "DISPOSITION_DELETE_TITLE": "Are you sure want to delete the disposition?", - "DISPOSITION_DELETE_MESSAGE": "{{ name }} will be deleted", - "DISPOSITION_DELETE_MESSAGE_CHILDREN": "{{ name }} will be deleted with all its sub dispositions", - "DISPOSITION_DELETED_SUCCESS_TITLE": "Disposition successfully deleted", - "DISPOSITIONS_DELETE_TITLE": "Are you sure want to delete the selected dispositions?", - "DISPOSITIONS_DELETE_MESSAGE": "{{ total }} dispositions will be deleted", - "TRIGGER_CREATED_SUCCESS_TITLE": "Trigger successfully created", - "TRIGGER_SAVED_SUCCESS_TITLE": "Trigger successfully saved", - "TRIGGER_DELETE_TITLE": "Are you sure want to delete the trigger?", - "TRIGGER_DELETE_MESSAGE": "{{ name }} will be deleted", - "TRIGGER_DELETED_SUCCESS_TITLE": "Trigger successfully deleted", - "TRIGGERS_DELETE_TITLE": "Are you sure want to delete the selected triggers?", - "TRIGGERS_DELETE_MESSAGE": "{{ total }} triggers will be deleted", - "TRIGGERS_DELETED_SUCCESS_TITLE": "Triggers successfully deleted", - "ACTION_CREATED_SUCCESS_TITLE": "Action successfully created", - "ACTION_SAVED_SUCCESS_TITLE": "Action successfully saved", - "ACTION_DELETE_TITLE": "Are you sure want to delete the action?", - "ACTION_DELETED_SUCCESS_TITLE": "Action successfully deleted", - "ACTIONS_DELETE_TITLE": "Are you sure want to delete the selected actions?", - "ACTIONS_DELETE_MESSAGE": "{{ total }} actions will be deleted", - "ACTIONS_DELETED_SUCCESS_TITLE": "Actions successfully deleted", - "CONDITION_CREATED_SUCCESS_TITLE": "Condition successfully created", - "CONDITION_SAVED_SUCCESS_TITLE": "Condition successfully saved", - "CONDITION_DELETE_TITLE": "Are you sure want to delete the condition?", - "CONDITION_DELETED_SUCCESS_TITLE": "Condition successfully deleted", - "CONDITIONS_DELETE_TITLE": "Are you sure want to delete the selected conditions?", - "CONDITIONS_DELETE_MESSAGE": "{{ total }} conditions will be deleted", - "CONDITIONS_DELETED_SUCCESS_TITLE": "Conditions successfully deleted" + "DISPOSITION_CREATED_SUCCESS_TITLE": "Dispozicija uspješno kreirana", + "DISPOSITION_SAVED_SUCCESS_TITLE": "Dispozicija uspješno sačuvana", + "DISPOSITION_DELETE_TITLE": "Jesi li siguran da želiš izbrisati dispoziciju?", + "DISPOSITION_DELETE_MESSAGE": "{{ name }} će biti izbrisano", + "DISPOSITION_DELETE_MESSAGE_CHILDREN": "{{ name }} će biti izbrisano sa svim pod-dispozicijama", + "DISPOSITION_DELETED_SUCCESS_TITLE": "Dispozicija uspješno izbrisana", + "DISPOSITIONS_DELETE_TITLE": "Jesi li siguran da želiš izbrisati odabrane dispozicije?", + "DISPOSITIONS_DELETE_MESSAGE": "{{ total }} dispozicija će biti izbrisano", + "TRIGGER_CREATED_SUCCESS_TITLE": "Triger uspješno kreiran", + "TRIGGER_SAVED_SUCCESS_TITLE": "Triger uspješno sačuvan", + "TRIGGER_DELETE_TITLE": "Jesi li siguran da želiš izbrisati triger?", + "TRIGGER_DELETE_MESSAGE": "{{ name }} će biti izbrisano", + "TRIGGER_DELETED_SUCCESS_TITLE": "Triger uspješno izbrisan", + "TRIGGERS_DELETE_TITLE": "Jesi li siguran da želiš izbrisati odabrane trigere?", + "TRIGGERS_DELETE_MESSAGE": "{{ total }} trigera će biti izbrisano", + "TRIGGERS_DELETED_SUCCESS_TITLE": "Trigeri uspješno izbrisani", + "ACTION_CREATED_SUCCESS_TITLE": "Radnja uspješno kreirana", + "ACTION_SAVED_SUCCESS_TITLE": "Radnja je uspješno sačuvana", + "ACTION_DELETE_TITLE": "Jesi li siguran da želiš izbrisati radnju?", + "ACTION_DELETED_SUCCESS_TITLE": "Radnja uspješno izbrisana", + "ACTIONS_DELETE_TITLE": "Jesi li siguran da želiš izbrisati odabrane radnje?", + "ACTIONS_DELETE_MESSAGE": "{{ total }} radnji će biti izbrisano", + "ACTIONS_DELETED_SUCCESS_TITLE": "Radnje uspješno izbrisane", + "CONDITION_CREATED_SUCCESS_TITLE": "Uslov uspješno kreiran", + "CONDITION_SAVED_SUCCESS_TITLE": "Uslov uspješno sačuvan", + "CONDITION_DELETE_TITLE": "Jesi li siguran da želiš izbrisati uslov?", + "CONDITION_DELETED_SUCCESS_TITLE": "Uslov uspješno izbrisan", + "CONDITIONS_DELETE_TITLE": "Jesi li siguran da želiš izbrisati odabrane uslove?", + "CONDITIONS_DELETE_MESSAGE": "{{ total }} uslova će biti izbrisano", + "CONDITIONS_DELETED_SUCCESS_TITLE": "Uslovi uspješno izbrisani" }, - "ALL_DISPOSITIONS": "All dispositions", - "SELECT_LEVEL": "Select a level", - "ALL": "All", - "FIRST_LEVEL_DISPOSITION": "First Level Disposition", - "SECOND_LEVEL_DISPOSITION": "Second Level Disposition", - "SEARCH_FIELDS": "Search fields", - "AUTOCREATE_FIELD": "Autocreate field", + "ALL_DISPOSITIONS": "Sve dispozicije", + "SELECT_LEVEL": "Odaberi nivo", + "ALL": "Svi", + "FIRST_LEVEL_DISPOSITION": "Prvi Nivo Dispozicija", + "SECOND_LEVEL_DISPOSITION": "Drugi Nivo Dispozicije", + "SEARCH_FIELDS": "Polje pretrage", + "AUTOCREATE_FIELD": "Automatsko kreiranje polje", "STANDARD": "Standard", - "GLOBALS": "Globals", + "GLOBALS": "Globalni", "MOTION_BAR": "Motion Bar" } } diff --git a/public/app/main/apps/tools/i18n/et.json b/public/app/main/apps/tools/i18n/et.json index e2ccdbf..7343b76 100644 --- a/public/app/main/apps/tools/i18n/et.json +++ b/public/app/main/apps/tools/i18n/et.json @@ -483,6 +483,14 @@ "OPENED_TEXT": "Avatud interaktsioonid", "IGNOREDIALERCONTACTID": "Ignoreeri helistaja kontakti ID", "MAIL_SUBSTATUS": "Meili alamolek", - "OFFLINE_MESSAGE": "Võrguühenduseta sõnum" + "OFFLINE_MESSAGE": "Võrguühenduseta sõnum", + "ADD_CONTACTITEMTYPE": "Lisama", + "CONTACTITEMTYPE": "Kontaktüksuste tüübid", + "DELETE_CONTACTITEMTYPE": "Kustuta kontaktiüksuse tüüp", + "EDIT_CONTACTITEMTYPE": "Redigeerige kontaktiüksuse tüüpi", + "NEW_CONTACTITEMTYPE": "Uus kontaktiüksuse tüüp", + "ORDER_BY": "Telli järgi", + "ORDER_BY_NUMERIC": "Järjestus välja järgi peab olema numbriline!", + "RGBBACKGROUNDCOLOR": "RGB taustavärv" } } diff --git a/public/app/main/apps/tools/i18n/is.json b/public/app/main/apps/tools/i18n/is.json new file mode 100644 index 0000000..306ec24 --- /dev/null +++ b/public/app/main/apps/tools/i18n/is.json @@ -0,0 +1,528 @@ +{ + "TOOLS": { + "VIDEOSUPPORT": "Video support", + "PREVIOUSCONTACT": "Previous", + "BOT": "Voicebot", + "CLONE_TRUNK": "Clone Trunk", + "DISPOSITIONS": "Dispositions", + "NEW_DISPOSITION": "New Disposition", + "ADD_DISPOSITION": "Add Disposition", + "EDIT_DISPOSITION": "Edit Disposition", + "DELETE_DISPOSITION": "Delete Disposition", + "RUN_SCHEDULE": "Run schedule", + "SENDIFEMPTY": "Send if empty", + "NEXTCONTACT": "Next", + "OUTBOUND_ROUTE": "Outbound Route", + "EDIT_DASHBOARDITEM": "Edit Dashboard Widget", + "FONTSIZE": "Font Size", + "TITLEFONTSIZE": "Font Title Size", + "CLONE_CUSTOMDASHBOARD": "Clone Custom Dashboard", + "LINK": "Link [https://]", + "BACKGROUND": "Background", + "FOREGROUND": "Foreground", + "IGNOREDIALERCONTACTID": "Ignore dialer contact Id", + "NONE": "None", + "TOTAL": "Total", + "ABANDONED": "Abandoned", + "WAITING": "Waiting", + "TALKING": "Talking", + "ANSWERED": "Answered", + "CONTACTITEMTYPE": "Contact item types", + "ORDER_BY": "Order by", + "RGBBACKGROUNDCOLOR": "RGB Background color", + "NEW_CONTACTITEMTYPE": "New contact item type", + "EDIT_CONTACTITEMTYPE": "Edit contact item type", + "DELETE_CONTACTITEMTYPE": "Delete contact item type", + "ORDER_BY_NUMERIC": "Order by field should be numeric value!", + "ADD_CONTACTITEMTYPE": "Add", + "UNMANAGED": "Unmanaged", + "CUSTOMTYPE": "Custom [path]", + "WEBREPORT": "Web Report", + "PIECHART": "Pie Chart", + "MULTIBARCHART": "Multibar Chart", + "MOVE_WIDGET": "Move Widget", + "USERADD_CUSTOMDASHBOARD": "Add User Permissions", + "GOTODASHBOARD_CUSTOMDASHBOARD": "Go to preview dashboard", + "GOTO_CUSTOMDASHBOARD": "Go to preview dashboard", + "METRIC": "Metric", + "FILTERVOICEQUEUES": "Filter Voice Queues", + "SERIE1": "Serie 1", + "SERIE2": "Serie 2", + "SERIE3": "Serie 3", + "REFRESH": "Refresh [s]", + "FORMAT": "Format", + "PATH": "Absolute Path", + "ALL_USERS": "All Users", + "SELECTED_USERS": "Selected Users", + "ADD_WIDGET": "Add Widget", + "COLOR": "Color", + "FAX": "Fax", + "INTERACTION": "Interaction", + "MESSAGE": "Message", + "T38PT_UDPTL": "T38pt Udptl", + "CALL": "Call", + "NAME": "Name", + "TRUNKS": "Trunks", + "SEARCH_FOR_ANYONE": "Search", + "SCRIPT": "Script", + "SCRIPT_INFO": "Info", + "SCRIPT_TYPE": "Type", + "EMAIL": "Email", + "FILTERFAXACCOUNTS": "Filter Fax Accounts", + "FILTERSMSACCOUNTS": "Filter Sms Accounts", + "FILTERCHATWEBSITES": "Filter Chat Websites", + "FILTERWHATSAPPACCOUNTS": "Filter Whatsapp Accounts", + "FILTEREMAILACCOUNTS": "Filter Email Accounts", + "FILTEROPENCHANNELACCOUNTS": "Filter OpenChannel Accounts", + "OPENED": "Opened", + "OPENED_TEXT": "Opened Interactions", + "MANAGED": "Managed", + "MANAGED_TEXT": "Managed Interactions", + "ERRORS": { + "INFO_REQUIRED": "Mandatory field", + "SCRIPT_REQUIRED": "Mandatory field", + "NAME_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "TITLE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "REFRESH_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "REFRESH_REQUIRED": "Mandatory field", + "FONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "FONTSIZE_REQUIRED": "Mandatory field", + "PATH_REQUIRED": "Mandatory field", + "FORMAT_REQUIRED": "Mandatory field", + "REPORT_REQUIRED": "Mandatory field", + "TYPE_REQUIRED": "Mandatory field", + "VALUE_REQUIRED": "Mandatory field", + "ACCOUNT_REQUIRED": "Mandatory field", + "IGNOREDIALERCONTACTID_REQUIRED": "Ignore dialer contact Id field is required", + "FIELD_REQUIRED": "Mandatory field", + "NAME_REQUIRED": "Mandatory field", + "HOST_REQUIRED": "Mandatory field", + "DEFAULTUSER_REQUIRED": "Mandatory field", + "CALLERID_REQUIRED": "Mandatory field", + "KEY_REQUIRED": "Mandatory field", + "CONFIRM_NOT_MATCH": "The Passwords don't match", + "VALIDITYSTART_REQUIRED": "Mandatory field", + "VALIDITYEND_REQUIRED": "Mandatory field", + "MONTHDAY_REQUIRED": "Mandatory field", + "HOUR_REQUIRED": "Mandatory field", + "CONTENT_REQUIRED": "Mandatory field", + "URL_REQUIRED": "Mandatory field", + "URL_MUST_VALID_URL": "Wrong format", + "APPLICATION_REQUIRED": "Mandatory field", + "ARGUMENTS_REQUIRED": "Mandatory field", + "NAME_MUST_VALID_PATTERN": "Wrong format", + "POLLING_INTERVAL_REQUIRED": "Mandatory field", + "TITLE_REQUIRED": "Mandatory field", + "EMAILADDRESS_REQUIRED": "Mandatory field", + "EVENTVARIABLES_REQUIRED": "Mandatory field", + "INTEGRATION_REQUIRED": "Mandatory field", + "LIST_REQUIRED": "Mandatory field", + "TEMPLATE_REQUIRED": "Mandatory field", + "AUTOCREATECONTACT_REQUIRED": "Mandatory field", + "AUTOCREATE_FIELD_REQUIRED": "Mandatory field", + "OUTBOUNDROUTE_REQUIRED": "Mandatory field", + "QUEUE_REQUIRED": "Mandatory field", + "TIME_RANGE_TO_REQUIRED": "Mandatory field", + "WEEK_DAYS_TO_REQUIRED": "Mandatory field", + "MONTH_DAYS_TO_REQUIRED": "Mandatory field", + "MONTH_TO_REQUIRED": "Mandatory field", + "TIME_RANGE_FROM_INVALID": "Wrong Format", + "TIME_RANGE_TO_INVALID": "Wrong Format", + "ACTION_REQUIRED": "Mandatory field", + "CONFIGURATION_REQUIRED": "Mandatory field", + "PROJECT_REQUIRED": "Mandatory field", + "LOCATION_REQUIRED": "Mandatory field", + "OUTPUT_REQUIRED": "Mandatory field", + "REPORTTYPE_REQUIRED": "Mandatory field", + "REPORTFOLDER_REQUIRED": "Mandatory field", + "REPORTSUBFOLDER_REQUIRED": "Mandatory field", + "AGENT_REQUIRED": "Mandatory field", + "TIMEOUT_REQUIRED": "Mandatory field", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "CHANNEL_REQUIRED": "Mandatory field" + }, + "HOST": "Host", + "SECRET": "Secret", + "DEFAULTUSER": "Default User", + "DESCRIPTION": "Description", + "ADD_TRUNK": "Add Trunk", + "HELP": { + "OPENED": "The total number of Active Interactions", + "MANAGED": "The total number of Completed Interactions", + "SCRIPT_INFO": "Insert a description for the script", + "SCRIPT_TYPE": "Insert a typology for the script (eg. curl, bash...)", + "INFO": "Insert title", + "SCRIPT": "Insert script", + "T38PT_UDPTL": "Es: yes,redundancy,maxdatagram=400", + "SECRET": "Authentication password", + "HOST": "The domain or host name", + "DEFAULTUSER": "Authentication username", + "CALLERID": "The Caller ID, in the format \"name\" ", + "REGISTRY": "The registry string, if required by provider, usually defaultuser:secret@host", + "FROMDOMAIN": "Set default From:domain in SIP messages when acting as a SIP ua (client). Some destinations may require mandatory identity name instead of only the IP address", + "FROMUSER": "How your provider knows you. This is which user to put instead of callerid when placing calls to peer (another SIP proxy). Valid only for type=peer.", + "OUTBOUNDPROXY": "IP_address or DNS SRV name (excluding the _sip._udp prefix): SRV name, hostname, or IP address of the outbound SIP Proxy. Send outbound signaling to this proxy, not directly to the devices. Valid only for type=peer.", + "PORT": "The SIP port number", + "CONTEXT": "The context for the trunk", + "TYPE": "Determine the SIP role within asterisk. User: used to authenticate incoming - Peer: for outgoing calls - Friend: covers both characteristics of the above.", + "DTMFMODE": "How DTMF (Dual-Tone Multi-Frequency) are sent. RFC2833: the default mode, the DTMF are sent with RTP but outside the audio stream. INBAND: The DTMF is sent in audio stream of the current conversation, becoming audible from the speakers. Requires a high CPU load. INFO: Although this method is very reliable, it is not supported by all PBX devices and many SIP Trunks.", + "NAT": "Change the behaviour of Asterisk for clients behind a firewall. If any of the comma-separated options is 'no', Asterisk will ignore any other settings and set nat=no.", + "QUALIFY": "Determine when the SIP is achievable", + "ALLOWCODECS": "Allowed codecs in order of preference", + "INSECURE": "Specify how to handle connections with peer, allowing insecure settings", + "CALL_LIMIT": "The limit number of the inbound and outbound concurrent calls", + "DIRECTMEDIA": "Asterisk by default tries to redirect the RTP media stream to go directly from the caller to the callee. Some devices do not support this (especially if one of them is behind a NAT). The default setting is YES. If you have all clients behind a NAT, or for some other reason want Asterisk to stay in the audio path, you may want to turn this off.", + "CALLCOUNTER": "Enable call counters on devices", + "ADD_PHONE_TO_URI": "Define if the provider requires ';user=phone' on URL", + "TRUST_REMOTE_PARTY_ID": "Define if Remote-Party-ID should be trusted", + "SEND_REMOTE_PARTY_ID_HEADER": "Define if Remote-Party-ID should be sent (defaults is no)", + "ENCRYPTION": "Whether to offer SRTP encrypted media (and only SRTP encrypted media) on outgoing calls to a peer. Calls will fail with HANGUPCAUSE=58 if the peer does not support SRTP. Defaults value is No", + "TRANSPORT": "Set the default transports, in order of preference", + "OTHERFIELDS": "Other fields to add in the trunks conf files. Follow default asterisk format (key=value), each field on a single row", + "EMAILADDRESS": "Add one or multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)", + "EMAILCCADDRESS": "Add one or multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)", + "EMAILBCCADDRESS": "Add one or multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)", + "NAME": "Only numbers, letters and specific characters (._) are supported", + "EVENTVARIABLES": "If enabled, it adds all the event variables to the url (recommended value=No. Set to Yes only for evaluation purposes) ", + "HEADERS": "Note: Headers section must be in RAW JSON format {\"key\":\"value\"} \nNote: If not filled out, the default value will be sent", + "BODY": "Note: the body must be in RAW JSON format {\"key\":\"value\"} \nNote: If not filled out, the default value will be sent", + "TIMEOUT": "Request timeout in seconds. The value must be between 1 and 10 and the default value is 5." + }, + "EDIT_TRUNK": "Edit Trunk", + "DELETE_TRUNK": "Delete Trunk", + "CREATED_AT": "Created At", + "SETTINGS": "Settings", + "ADVANCED": "Advanced", + "OTHER": "Other", + "ACTIVE": "Active", + "CONTEXT": "Context", + "CALLERID": "Caller ID", + "TYPE": "Type", + "DTMFMODE": "DTMF Mode", + "NAT": "NAT", + "QUALIFY": "Qualify", + "ALLOWCODECS": "Allowed Codecs", + "INSECURE": "Insecure", + "REGISTRY": "Registry", + "DIRECTMEDIA": "Direct Media", + "CALLCOUNTER": "Call Counter", + "FROMDOMAIN": "From Domain", + "FROMUSER": "From User", + "OUTBOUNDPROXY": "Outbound Proxy", + "ADD_PHONE_TO_URI": "Add Phone to URL", + "TRUST_REMOTE_PARTY_ID": "Trust Remote Party ID", + "SEND_REMOTE_PARTY_ID_HEADER": "Send Remote Party ID Header", + "ENCRYPTION": "Encryption", + "PORT": "Port", + "TRANSPORT": "Transport", + "SAVE": "Save", + "VARIABLES": "Variables", + "ADD_VARIABLE": "Add Variable", + "EDIT_VARIABLE": "Edit Variable", + "DELETE_VARIABLE": "Delete Variable", + "SELECTED": "Selected", + "SELECT_ALL": "Select All", + "SELECT_NONE": "Select None", + "TAGS": "Tags", + "ADD_TAG": "Add Tag", + "EDIT_TAG": "Edit Tag", + "DELETE_TAG": "Delete Tag", + "PAUSES": "Pauses", + "ADD_PAUSE": "Add Pause", + "EDIT_PAUSE": "Edit Pause", + "DELETE_PAUSE": "Delete Pause", + "CANNEDANSWERS": "Canned Answers", + "ADD_CANNEDANSWER": "Add Canned Answer", + "EDIT_CANNEDANSWER": "Edit Canned Answer", + "DELETE_CANNEDANSWER": "Delete Canned Answer", + "KEY": "Key", + "VALUE": "Value", + "SOUNDS": "Sounds", + "EDIT_SOUND": "Edit Sound", + "DELETE_SOUND": "Delete Sound", + "CANCEL": "Cancel", + "FINISH": "Finish", + "DROP_TO_UPLOAD": "Drop To Upload", + "UPLOADING": "Uploading", + "TRIGGERS": "Triggers", + "EDIT_TRIGGER": "Edit Trigger", + "DELETE_TRIGGER": "Delete Trigger", + "ADD_TRIGGER": "Add Trigger", + "DELETE": "Delete", + "AUTOMATIONS": "Automations", + "EDIT_AUTOMATION": "Edit Automation", + "DELETE_AUTOMATION": "Delete Automation", + "ADD_AUTOMATION": "Add Automation", + "INTERVALS": "Intervals", + "EDIT_INTERVAL": "Edit Interval", + "DELETE_INTERVAL": "Delete Interval", + "ADD_INTERVAL": "Add Interval", + "TOOLS": "Tools", + "ID": "Id", + "AUDIO": "Audio", + "DOWNLOAD_SOUND": "Download Sound", + "UPLOAD_SOUND": "Tools", + "CHANNEL": "Channel", + "NEW_TRIGGER": "New Trigger", + "GENERAL": "General", + "STATUS": "Status", + "CONDITIONS&ACTIONS": "Conditions & Actions", + "ALLCONDITIONS": "Meet all these conditions:", + "ANYCONDITIONS": "Meet any of these conditions:", + "ACTIONS": "Actions:", + "NEW_AUTOMATION": "New Automation", + "TIMEOUT": "Timeout", + "PEERSTATUS": "Peer Status", + "CALL_LIMIT": "Calls Limit", + "OTHERFIELDS": "Other Fields", + "NEW_VARIABLE": "New Variable", + "NEW_TAG": "New Tag", + "NEW_PAUSE": "New Pause", + "NEW_CANNEDANSWER": "New Canned Answer", + "CONFIRM_PASSWORD": "Confirm Password", + "NEW_TRUNK": "New Trunk", + "FROM": "From", + "TO": "To", + "WEEKDAY": "Week Day", + "MONTHDAY": "Month Day", + "MONTH": "Month", + "ALWAYS": "Always", + "MON": "Monday", + "TUE": "Tuesday", + "WED": "Wednesday", + "THU": "Thursday", + "FRI": "Friday", + "SAT": "Saturday", + "SUN": "Sunday", + "JAN": "January", + "FEB": "February", + "MAR": "March", + "APR": "April", + "MAY": "May", + "JUN": "June", + "JUL": "July", + "AUG": "August", + "SEP": "September", + "OCT": "October", + "NOV": "November", + "DEC": "December", + "PASSWORD": "Password", + "CUSTOMDASHBOARDS": "Custom Dashboards", + "NEW_CUSTOMDASHBOARD": "New Custom Dashboard", + "ADD_CUSTOMDASHBOARD": "Add Custom Dashboard", + "EDIT_CUSTOMDASHBOARD": "Edit Custom Dashboard", + "DELETE_CUSTOMDASHBOARD": "Delete Custom Dashboard", + "SCHEDULER": "Scheduler", + "NEW_SCHEDULE": "New Schedule", + "ADD_SCHEDULE": "Add Schedule", + "EDIT_SCHEDULE": "Edit Schedule", + "DELETE_SCHEDULE": "Delete Schedule", + "SENDMAIL": "Send Email", + "CONFIGURATION": "Configuration", + "MAIL": "Email", + "REPORTTYPE": "Report Type", + "REPORT": "Report", + "OUTPUT": "Output", + "EXECUTEON": "Execute On", + "REPORTRANGE": "Report Range", + "VALIDITYSTART": "Start Time", + "VALIDITYEND": "End Time", + "EXECUTEEVERY": "Execute every", + "ACCOUNT": "Account", + "EMAILADDRESS": "Email Address", + "EMAILCCADDRESS": "Cc", + "EMAILBCCADDRESS": "Bcc", + "CURRENTDAY": "Current Day", + "DAILY": "Daily", + "WEEKLY": "Weekly", + "MONTHLY": "Monthly", + "PREVIOUS_DAY": "Previous Day", + "LAST_SEVEN_DAYS": "Last Seven Days", + "LAST_THIRTY_DAYS": "Last Thirthy Days", + "LAST_MONTH": "Last Month", + "WEEKDAYS": "Week Days", + "HOUR": "Hour", + "DEFAULT": "Default", + "CSV": "CSV", + "PDF": "PDF", + "15MIN": "15 minutes", + "30MIN": "30 minutes", + "1H": "1 hour", + "VOICE": "Voice", + "CHAT": "Chat", + "SMS": "SMS", + "OPENCHANNEL": "Open Channel", + "TEMPLATES": "Templates", + "EDIT_TEMPLATE": "Edit Template", + "DELETE_TEMPLATE": "Delete Template", + "NEW_TEMPLATE": "New Template", + "ADD_TEMPLATE": "Add Template", + "CONTENT": "Content", + "FIELD": "Field", + "NO_ANYCONDITION_AVAILABLE": "No Conditions available", + "NO_ALLCONDITION_AVAILABLE": "No Conditions available", + "NO_ACTION_AVAILABLE": "No Actions available", + "ACTION": "Action", + "EDIT_ANYCONDITION": "Edit Condition", + "DELETE_ANYCONDITION": "Delete Condition", + "NEW_ANYCONDITION": "New Condition", + "ADD_ANYCONDITION": "Add Condition", + "EDIT_ALLCONDITION": "Edit Condition", + "DELETE_ALLCONDITION": "Delete Condition", + "NEW_ALLCONDITION": "New Condition", + "ADD_ALLCONDITION": "Add Condition", + "EDIT_ACTION": "Edit Action", + "DELETE_ACTION": "Delete Action", + "NEW_ACTION": "New Action", + "ADD_ACTION": "Add Action", + "QUEUE": "Queue", + "CALL_STATUS": "Call Status", + "OUTBOUNDROUTE": "Outbound Route", + "MAIL_SUBSTATUS": "Email Substatus", + "OFFLINE_MESSAGE": "Offline Message", + "EQUALS": "Equals", + "NOT_EQUALS": "Not Equals", + "CONTACT_MANAGER": "Contacts Manager", + "INTEGRATIONS": "Integrations", + "MOTIONBAR": "Motion Bar", + "JSCRIPTY": "Jscripty", + "URL_FORWARD": "URL Forward", + "WEB_POPUP": "Web Popup", + "LIST": "List", + "INTEGRATION": "Integration", + "TEMPLATE": "Template", + "URL": "URL", + "APPLICATION": "Application", + "ARGUMENTS": "Arguments", + "NO_APPS_AVAILABLE": "No applications available", + "NEW_INTERVAL": "New Interval", + "OPERATOR": "Operator", + "NO_INTERVALS_AVAILABLE": "No intervals available", + "YES": "Yes", + "NO": "No", + "SUBJECT": "Subject", + "NO_AVAILABLE_INFO": "No available info", + "BROWSER": "Browser", + "INTERVAL": "Interval", + "INFO": "Info", + "TIME_RANGE": "Time Range", + "WEEK_DAYS": "Week Days", + "MONTH_DAYS": "Month Days", + "MONTHS": "Months", + "DROP_TO_UPLOAD_MESSAGE": "Drop audio files here to upload. Only MP3, WAV, GSM - Max. 15MB", + "POLLING_INTERVAL": "Polling Interval (seconds)", + "DASHBOARD": "Dashboard", + "NEW_DASHBOARDITEM": "New Dashboard Widget", + "COUNTER": "Counter", + "IFRAME": "IFrame", + "CLOCK": "Clock", + "ADD_DASHBOARDITEM": "Add Dashboard Widget", + "EDIT_WIDGET": "Edit Widget", + "DELETE_WIDGET": "Delete Widget", + "FLIP_WIDGET": "Flip Widget", + "TITLE": "Title", + "UPDATE": "Update", + "LAYOUT": "Layout", + "BACKGROUND_COLOR": "Background Color", + "FOREGROUND_COLOR": "Foreground Color", + "FOREGROUND_TITLE_COLOR": "Foreground Title Color", + "THEME": "Theme", + "LIGHT": "Light", + "DARK": "Dark", + "TIMEZONE": "TimeZone", + "DIGITAL_FORMAT": "Digital Date Format", + "TOOLS_QUERY": "Query", + "SELECT": "Select", + "WHERE": "Where", + "BACK": "Back", + "PROJECT": "Project", + "GOTOREALTIME_TRUNK": "Go To Realtime Trunk", + "GOTO_TRUNK": "Go To Trunk", + "CRON": "Cron", + "MINUTES": "Minutes", + "HOURLY": "Hourly", + "YEARLY": "Yearly", + "EVERY": "Every", + "MINUTE": "Minute", + "ON_SECOND": "On second", + "HOUR_ON_MINUTE": "Hour on minute", + "AND_SECOND": "And second", + "DAY_AT": "Day at", + "START_TIME": "Start Time", + "ON_THE": "On the", + "OF_EVERY": "Of every", + "MONTH_AT": "Month at", + "AT": "At", + "LAST": "Last", + "LASTUNIT": "Unit", + "MAILACCOUNT": "Email Account", + "OF": "of", + "PAST_THE_HOUR": "Past the hour", + "DAY": "Day", + "WEEK": "Week", + "YEAR": "Year", + "ON": "On", + "PAI": "P-Asserted-Identity", + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "EVENTVARIABLES": "Event Variables", + "AUTOCREATECONTACT": "Create contact automatically", + "LOCATION": "Location", + "NEW_TAB": "New Tab", + "NEW_WINDOW": "New Window", + "MOTION_TAB": "New Agent Dashboard Tab", + "WINDOWWIDTH": "Window Width(px)", + "WINDOWHEIGHT": "Window Height(px)", + "BODY": "Body", + "REPORTFOLDER": "Report Folder", + "REPORTSUBFOLDER": "Report Subfolder", + "AGENT": "Agent", + "HEADERS": "Headers", + "WHATSAPP": "WhatsApp Connector", + "LEVEL": "Level", + "NOTIFICATIONS": { + "DISPOSITION_CREATED_SUCCESS_TITLE": "Disposition successfully created", + "DISPOSITION_SAVED_SUCCESS_TITLE": "Disposition successfully saved", + "DISPOSITION_DELETE_TITLE": "Are you sure want to delete the disposition?", + "DISPOSITION_DELETE_MESSAGE": "{{ name }} will be deleted", + "DISPOSITION_DELETE_MESSAGE_CHILDREN": "{{ name }} will be deleted with all its sub dispositions", + "DISPOSITION_DELETED_SUCCESS_TITLE": "Disposition successfully deleted", + "DISPOSITIONS_DELETE_TITLE": "Are you sure want to delete the selected dispositions?", + "DISPOSITIONS_DELETE_MESSAGE": "{{ total }} dispositions will be deleted", + "TRIGGER_CREATED_SUCCESS_TITLE": "Trigger successfully created", + "TRIGGER_SAVED_SUCCESS_TITLE": "Trigger successfully saved", + "TRIGGER_DELETE_TITLE": "Are you sure want to delete the trigger?", + "TRIGGER_DELETE_MESSAGE": "{{ name }} will be deleted", + "TRIGGER_DELETED_SUCCESS_TITLE": "Trigger successfully deleted", + "TRIGGERS_DELETE_TITLE": "Are you sure want to delete the selected triggers?", + "TRIGGERS_DELETE_MESSAGE": "{{ total }} triggers will be deleted", + "TRIGGERS_DELETED_SUCCESS_TITLE": "Triggers successfully deleted", + "ACTION_CREATED_SUCCESS_TITLE": "Action successfully created", + "ACTION_SAVED_SUCCESS_TITLE": "Action successfully saved", + "ACTION_DELETE_TITLE": "Are you sure want to delete the action?", + "ACTION_DELETED_SUCCESS_TITLE": "Action successfully deleted", + "ACTIONS_DELETE_TITLE": "Are you sure want to delete the selected actions?", + "ACTIONS_DELETE_MESSAGE": "{{ total }} actions will be deleted", + "ACTIONS_DELETED_SUCCESS_TITLE": "Actions successfully deleted", + "CONDITION_CREATED_SUCCESS_TITLE": "Condition successfully created", + "CONDITION_SAVED_SUCCESS_TITLE": "Condition successfully saved", + "CONDITION_DELETE_TITLE": "Are you sure want to delete the condition?", + "CONDITION_DELETED_SUCCESS_TITLE": "Condition successfully deleted", + "CONDITIONS_DELETE_TITLE": "Are you sure want to delete the selected conditions?", + "CONDITIONS_DELETE_MESSAGE": "{{ total }} conditions will be deleted", + "CONDITIONS_DELETED_SUCCESS_TITLE": "Conditions successfully deleted" + }, + "ALL_DISPOSITIONS": "All dispositions", + "SELECT_LEVEL": "Select a level", + "ALL": "All", + "FIRST_LEVEL_DISPOSITION": "First Level Disposition", + "SECOND_LEVEL_DISPOSITION": "Second Level Disposition", + "SEARCH_FIELDS": "Search fields", + "AUTOCREATE_FIELD": "Autocreate field", + "STANDARD": "Standard", + "GLOBALS": "Globals", + "MOTION_BAR": "Motion Bar" + } +} diff --git a/public/app/main/apps/tools/i18n/pt-BR.json b/public/app/main/apps/tools/i18n/pt-BR.json index 89475fd..ba506de 100644 --- a/public/app/main/apps/tools/i18n/pt-BR.json +++ b/public/app/main/apps/tools/i18n/pt-BR.json @@ -2,21 +2,21 @@ "TOOLS": { "BOT": "Voicebot", "CLONE_TRUNK": "Clonar Tronco", - "DISPOSITIONS": "Disposições", - "NEW_DISPOSITION": "Nova Disposição", - "ADD_DISPOSITION": "Adicionar Disposição", - "EDIT_DISPOSITION": "Editar Disposição", - "DELETE_DISPOSITION": "Excluir Disposição", + "DISPOSITIONS": "Qualificações", + "NEW_DISPOSITION": "Nova Qualificação", + "ADD_DISPOSITION": "Adicionar Qualificação", + "EDIT_DISPOSITION": "Editar Qualificação", + "DELETE_DISPOSITION": "Excluir Qualificação", "RUN_SCHEDULE": "Horário de execução", "SENDIFEMPTY": "Enviar se vazio", "NEXTCONTACT": "Próximo", "OUTBOUND_ROUTE": "Rota de Saída", - "EDIT_DASHBOARDITEM": "Editar widget do painel", - "FONTSIZE": "Tamanho da fonte", + "EDIT_DASHBOARDITEM": "Editar Widget", + "FONTSIZE": "Tamanho da Fonte", "CLONE_CUSTOMDASHBOARD": "Clonar Dashboard Personalizado", "LINK": "Link [https://]", "BACKGROUND": "Fundo", - "FOREGROUND": "Primeiro plano", + "FOREGROUND": "Primeiro Plano", "NONE": "Nenhum", "TOTAL": "Total", "ABANDONED": "Abandonado", @@ -30,17 +30,17 @@ "MULTIBARCHART": "Gráfico de Multibar", "MOVE_WIDGET": "Mover Widget", "USERADD_CUSTOMDASHBOARD": "Adicionar permissões do usuário", - "GOTODASHBOARD_CUSTOMDASHBOARD": "Ir para o painel de pré-visualização", - "GOTO_CUSTOMDASHBOARD": "Ir para o painel de pré-visualização", + "GOTODASHBOARD_CUSTOMDASHBOARD": "Pré-visualizar Dashboard", + "GOTO_CUSTOMDASHBOARD": "Pré-visualizar Dashboard", "METRIC": "Métrica", - "FILTERVOICEQUEUES": "Filtrar filas de voz", + "FILTERVOICEQUEUES": "Filtrar Filas de Voz", "SERIE1": "Serie 1", "SERIE2": "Serie 2", "SERIE3": "Serie 3", "REFRESH": "Atualizar [s]", "FORMAT": "Formato", "PATH": "Caminho absoluto", - "ALL_USERS": "Todos os usuários", + "ALL_USERS": "Todos Usuários", "SELECTED_USERS": "Usuários Selecionados", "ADD_WIDGET": "Adicionar Widget", "COLOR": "Cor", @@ -115,38 +115,38 @@ "TIMEOUT_REQUIRED": "Campo obrigatório", "AUTOCREATE_FIELD_REQUIRED": "Campo obrigatório", "CHANNEL_REQUIRED": "Campo obrigatório", - "IGNOREDIALERCONTACTID_REQUIRED": "O campo Ignore dialer contact Id é obrigatório" + "IGNOREDIALERCONTACTID_REQUIRED": "O campo Ignore Dialer Contact ID é obrigatório" }, "HOST": "Host", "SECRET": "Segredo", - "DEFAULTUSER": "Usuário padrão", + "DEFAULTUSER": "Usuário Padrão", "DESCRIPTION": "Descrição", - "ADD_TRUNK": "Adicionar tronco", + "ADD_TRUNK": "Adicionar Tronco", "HELP": { "T38PT_UDPTL": "Ex: sim, redundância, maxdatagram = 400", "SECRET": "Senha de autenticação", "HOST": "O domínio ou nome do host", "DEFAULTUSER": "Nome de usuário de autenticação", - "CALLERID": "O identificador de chamadas, no formato \\ \"name \" ", + "CALLERID": "O Caller ID, no formato \"name\" ", "REGISTRY": "A cadeia de registro, se exigida pelo provedor, geralmente defaultuser: secret @ host", "FROMDOMAIN": "Defina o padrão de: domínio em mensagens SIP ao atuar como um SIP ua (cliente). Alguns destinos podem exigir um nome de identidade obrigatório, em vez de apenas o endereço IP", "FROMUSER": "Como seu provedor conhece você. Este é qual usuário colocar em vez de callerid ao fazer chamadas para peer (outro proxy SIP). Válido apenas para type = peer.", "OUTBOUNDPROXY": "IP_address ou DNS SRV name (excluindo o prefixo _sip._udp): nome do SRV, nome do host ou endereço IP do SIP Proxy de saída. Envie a sinalização de saída para este proxy, não diretamente para os dispositivos. Válido apenas para type = peer.", "PORT": "O número da porta SIP", - "CONTEXT": "O contexto para o tronco", + "CONTEXT": "Contexto para o Tronco", "TYPE": "Determine o papel do SIP no asterisco. Usuário: usado para autenticar entrada - Peer: para chamadas de saída - Amigo: abrange as duas características dos itens acima.", - "DTMFMODE": "Como DTMF (Dual-Tone Multi-Frequency) são enviados. RFC2833: o modo padrão, os DTMF são enviados com RTP, mas fora do fluxo de áudio. INBAND: O DTMF é enviado em fluxo de áudio da conversa atual, tornando-se audível pelos alto-falantes. Requer uma alta carga de CPU. INFO: Embora esse método seja muito confiável, ele não é suportado por todos os dispositivos PBX e muitos troncos SIP.", + "DTMFMODE": "Como DTMF (Dual-Tone Multi-Frequency) é enviado. RFC2833: modo padrão, os DTMF são enviados com RTP, mas fora do fluxo de áudio. INBAND: O DTMF é enviado em fluxo de áudio da conversa atual, tornando-se audível pelos alto-falantes. Aumenta uso de CPU. INFO: Embora esse método seja muito confiável, ele não é suportado por todos os PBX e muitos troncos SIP.", "NAT": "Altere o comportamento do Asterisk para clientes atrás de um firewall. Se qualquer uma das opções separadas por vírgula for 'no', o Asterisk irá ignorar quaisquer outras configurações e definir nat = no.", "QUALIFY": "Determinar quando o SIP é realizável", - "ALLOWCODECS": "Codecs permitidos em ordem de preferência", + "ALLOWCODECS": "Codecs Permitidos em Ordem de Preferência", "INSECURE": "Especifique como lidar com conexões com peer, permitindo configurações inseguras", - "CALL_LIMIT": "O número limite das chamadas simultâneas de entrada e saída", - "DIRECTMEDIA": "Por padrão, o Asterisk tenta redirecionar o fluxo de mídia RTP para ir diretamente do chamador para o chamado. Alguns dispositivos não suportam isso (especialmente se um deles estiver por trás de um NAT). A configuração padrão é YES. Se você tiver todos os clientes por trás de um NAT ou, por algum outro motivo, quiser que o Asterisk permaneça no caminho de áudio, talvez seja necessário desativá-lo.", - "CALLCOUNTER": "Ativar contadores de chamadas em dispositivos", + "CALL_LIMIT": "Limite das Chamadas Simultâneas", + "DIRECTMEDIA": "Por padrão, o Asterisk tenta redirecionar o fluxo de mídia RTP para ir diretamente do chamador para o chamado. Alguns dispositivos não suportam isso (especialmente se um deles estiver por trás de um NAT). A configuração padrão é YES.", + "CALLCOUNTER": "Ativar Contagem de Chamadas no Dispositivos", "ADD_PHONE_TO_URI": "Definir se o provedor requer '; user = phone' no URL", "TRUST_REMOTE_PARTY_ID": "Definir se o ID do participante remoto deve ser confiável", "SEND_REMOTE_PARTY_ID_HEADER": "Definir se o Remote-Party-ID deve ser enviado (o padrão é não)", - "ENCRYPTION": "Se deve oferecer mídia criptografada SRTP (e somente mídia criptografada SRTP) em chamadas de saída para um peer. As chamadas falharão com HANGUPCAUSE = 58 se o par não suportar SRTP. O valor padrão é No", + "ENCRYPTION": "Se oferece SRTP encrypted media (e somente SRTP encrypted media) em chamadas outgoing para um peer. Causará falha HANGUPCAUSE=58 se peer não suportar SRTP. Padrão = Não", "TRANSPORT": "Definir os transportes padrão, em ordem de preferência", "OTHERFIELDS": "Outros campos para adicionar nos arquivos conf de troncos. Siga o formato de asterisco padrão (chave = valor), cada campo em uma única linha", "EMAILADDRESS": "Adicione um ou vários endereços separados por vírgulas (por exemplo, john.doe@xcally.com, jane.miller@xcally.com)", @@ -154,7 +154,7 @@ "EMAILBCCADDRESS": "Adicione um ou vários endereços separados por vírgulas (por exemplo, john.doe@xcally.com, jane.miller@xcally.com)", "NAME": "Somente números, letras e caracteres específicos (._) são suportados", "EVENTVARIABLES": "Se ativado, ele adiciona todas as variáveis ​​do evento ao URL (valor recomendado = Não. Defina como Sim somente para fins de avaliação)", - "BODY": "Se não for preenchido, o valor padrão será enviado", + "BODY": "Note: the body must be in RAW JSON format {\"key\":\"value\"} \nNote: If not filled out, o valor padrão será enviado", "INFO": "Inserir título", "SCRIPT": "Inserir script", "SCRIPT_INFO": "Inserir uma descrição para o script", @@ -172,20 +172,20 @@ "OTHER": "Outros", "ACTIVE": "Ativo", "CONTEXT": "Contexto", - "CALLERID": "Identificador de chamadas", + "CALLERID": "Identificador de Chamadas", "TYPE": "Tipo", "DTMFMODE": "Modo DTMF", "NAT": "NAT", "QUALIFY": "Qualificar", - "ALLOWCODECS": "Codecs permitidos", + "ALLOWCODECS": "Codecs Permitidos", "INSECURE": "Inseguro", "REGISTRY": "Registro", "DIRECTMEDIA": "Mídia Direta", - "CALLCOUNTER": "Contador de chamadas", + "CALLCOUNTER": "Contador de Chamadas", "FROMDOMAIN": "Do domínio", "FROMUSER": "Do usuário", "OUTBOUNDPROXY": "Proxy de saída", - "ADD_PHONE_TO_URI": "Adicionar telefone ao URL", + "ADD_PHONE_TO_URI": "Adicionar Telefone ao URL", "TRUST_REMOTE_PARTY_ID": "Trust Remote Party ID", "SEND_REMOTE_PARTY_ID_HEADER": "Send Remote Party ID Header", "ENCRYPTION": "Encriptação", @@ -207,18 +207,18 @@ "ADD_PAUSE": "Adicionar Pausas", "EDIT_PAUSE": "Editar Pausas", "DELETE_PAUSE": "Excluir Pausas", - "CANNEDANSWERS": "Respostas Prontas", - "ADD_CANNEDANSWER": "Adicionar Resposta Pronta", - "EDIT_CANNEDANSWER": "Editar Resposta Pronta", - "DELETE_CANNEDANSWER": "Excluir Resposta Pronta", + "CANNEDANSWERS": "Respostas Pré-definidas", + "ADD_CANNEDANSWER": "Adicionar Resposta Pré-definida", + "EDIT_CANNEDANSWER": "Editar Resposta Pré-fenida", + "DELETE_CANNEDANSWER": "Excluir Resposta Pré-definida", "KEY": "Key", "VALUE": "Valor", "SOUNDS": "Sons", "EDIT_SOUND": "Editar Som", - "DELETE_SOUND": " Ecluir Som", + "DELETE_SOUND": " Ecluir Áudio", "CANCEL": "Cancelar", "FINISH": "Finalizar", - "DROP_TO_UPLOAD": "Largar para fazer o upload", + "DROP_TO_UPLOAD": "Soltar para Fazer Upload", "UPLOADING": "Uploading", "TRIGGERS": "Gatilhos", "EDIT_TRIGGER": "Editar Gatilhos", @@ -235,26 +235,26 @@ "ADD_INTERVAL": "Adicionar Intervalo", "TOOLS": "Ferramentas", "ID": "Id", - "AUDIO": "Audio", - "DOWNLOAD_SOUND": "Download Som", + "AUDIO": "Áudio", + "DOWNLOAD_SOUND": "Download Áudio", "UPLOAD_SOUND": "Ferramentas", "CHANNEL": "Canal", "NEW_TRIGGER": "Novo Gatilho", "GENERAL": "Geral", "STATUS": "Status", - "CONDITIONS&ACTIONS": "Condições e ações", - "ALLCONDITIONS": "Conheça todas estas condições:", - "ANYCONDITIONS": "Conheça qualquer uma destas condições:", + "CONDITIONS&ACTIONS": "Condições e Ações", + "ALLCONDITIONS": "Atenda todas estas condições:", + "ANYCONDITIONS": "Atenda alguma destas condições:", "ACTIONS": "Ações:", "NEW_AUTOMATION": "Nova Automação", "TIMEOUT": "Tempo esgotado", "PEERSTATUS": "Status de par Status", - "CALL_LIMIT": "Limite de chamadas", + "CALL_LIMIT": "Limite de Chamadas", "OTHERFIELDS": "Outros campos", "NEW_VARIABLE": "Nova Variável", "NEW_TAG": "Nova Tag", "NEW_PAUSE": "Nova Pausa", - "NEW_CANNEDANSWER": "Nova Resposta Pronta", + "NEW_CANNEDANSWER": "Nova Resposta Pré-definada", "CONFIRM_PASSWORD": "Confirme a Senha", "NEW_TRUNK": "Novo Tronco", "FROM": "De ", @@ -308,7 +308,7 @@ "EMAILADDRESS": "Endereço de Email", "EMAILCCADDRESS": "Cc", "EMAILBCCADDRESS": "Bcc", - "CURRENTDAY": "Dia atual", + "CURRENTDAY": "Dia Atual", "DAILY": "Diariamente", "WEEKLY": "Semanal", "MONTHLY": "Mensal", @@ -339,14 +339,14 @@ "NO_ALLCONDITION_AVAILABLE": "Nenhuma condição disponível", "NO_ACTION_AVAILABLE": "Nenhuma ação disponível", "ACTION": "Ação", - "EDIT_ANYCONDITION": "Editar condição", - "DELETE_ANYCONDITION": "Excluir condição", - "NEW_ANYCONDITION": "Nova condição", - "ADD_ANYCONDITION": "Adicionar condição", - "EDIT_ALLCONDITION": "Editar condição", - "DELETE_ALLCONDITION": "Excluir condição", - "NEW_ALLCONDITION": "Nova condição", - "ADD_ALLCONDITION": "Adicionar condição", + "EDIT_ANYCONDITION": "Editar Condição", + "DELETE_ANYCONDITION": "Excluir Condição", + "NEW_ANYCONDITION": "Nova Condição", + "ADD_ANYCONDITION": "Adicionar Condição", + "EDIT_ALLCONDITION": "Editar Condição", + "DELETE_ALLCONDITION": "Excluir Condição", + "NEW_ALLCONDITION": "Nova Condição", + "ADD_ALLCONDITION": "Adicionar Condição", "EDIT_ACTION": "Editar Ação", "DELETE_ACTION": "Excluir Ação", "NEW_ACTION": "Nova Ação", @@ -356,9 +356,9 @@ "OUTBOUNDROUTE": "Rota de Saída", "EQUALS": "Igual a", "NOT_EQUALS": "Não é igual a", - "CONTACT_MANAGER": "Gerente de contatos", + "CONTACT_MANAGER": "Gestor de Contatos", "INTEGRATIONS": "Integrações", - "MOTIONBAR": "Motion Bar", + "MOTIONBAR": "MotionBar", "JSCRIPTY": "Jscripty", "URL_FORWARD": "URL Forward", "WEB_POPUP": "Web Popup", @@ -386,11 +386,11 @@ "DROP_TO_UPLOAD_MESSAGE": "Solte arquivos de áudio aqui para fazer o upload. Apenas MP3, WAV, GSM - máx. 15MB", "POLLING_INTERVAL": "Intervalo de pesquisa (segundos)", "DASHBOARD": "Dashboard", - "NEW_DASHBOARDITEM": "Novo widget do Dashboard", + "NEW_DASHBOARDITEM": "Novo Widget do Dashboard", "COUNTER": "Contador", "IFRAME": "IFrame", "CLOCK": "Relógio", - "ADD_DASHBOARDITEM": "Adicionar widget do Dashboard", + "ADD_DASHBOARDITEM": "Adicionar Widget do Dashboard", "EDIT_WIDGET": "Editar Widget", "DELETE_WIDGET": "Excluir Widget", "FLIP_WIDGET": "Girar Widget", @@ -398,28 +398,28 @@ "UPDATE": "Atualizar", "LAYOUT": "Layout", "BACKGROUND_COLOR": "Cor de fundo", - "FOREGROUND_COLOR": "Cor do primeiro plano", + "FOREGROUND_COLOR": "Cor do Primeiro Plano", "FOREGROUND_TITLE_COLOR": "Cor do Título do Primeiro Plano", "THEME": "Tema", "LIGHT": "Claro", - "DARK": "Sombrio", + "DARK": "Dark", "TIMEZONE": "Fuso horário", - "DIGITAL_FORMAT": "Formato de data digital", + "DIGITAL_FORMAT": "Formato Data Digital", "TOOLS_QUERY": "Query", "SELECT": "Selecione", "WHERE": "Where", "BACK": "Voltar", "PROJECT": "Projeto", - "GOTOREALTIME_TRUNK": "Ir para o tronco em tempo real", - "GOTO_TRUNK": "Ir para o tronco", + "GOTOREALTIME_TRUNK": "Ir para o Tronco em Tempo Real", + "GOTO_TRUNK": "Ir para Tronco", "CRON": "Cron", "MINUTES": "Minutos", - "HOURLY": "De hora em hora", + "HOURLY": "De Hora em Hora", "YEARLY": "Anual", "EVERY": "Cada", "MINUTE": "Minuto", "ON_SECOND": "No segundo", - "HOUR_ON_MINUTE": "Hora no minuto", + "HOUR_ON_MINUTE": "Hora no Minuto", "AND_SECOND": "Em segundo lugar", "DAY_AT": "Dia em", "START_TIME": "Hora de início", @@ -440,7 +440,7 @@ "PAGE": "Página", "ROWSPERPAGE": "Linhas por Página", "EVENTVARIABLES": "Variáveis ​​de Eventos", - "AUTOCREATECONTACT": "Criar contato automaticamente", + "AUTOCREATECONTACT": "Criar Contato Automaticamente", "LOCATION": "Localização", "NEW_TAB": "Nova aba", "NEW_WINDOW": "Nova janela", @@ -456,41 +456,41 @@ "SCRIPT": "Roteiro", "SCRIPT_INFO": "Informações", "SCRIPT_TYPE": "Tipo", - "MOTION_TAB": "Nova guia Painel do agente", + "MOTION_TAB": "Nova Aba", "WHATSAPP": "Conector WhatsApp", - "AUTOCREATE_FIELD": "Autocreate field", + "AUTOCREATE_FIELD": "Criar Campo Automaticamente", "GLOBALS": "Globais", "SEARCH_FIELDS": "Campos de busca", "STANDARD": "Padrão", - "MOTION_BAR": "Motion Bar", + "MOTION_BAR": "MotionBar", "ALL": "Tudo", - "ALL_DISPOSITIONS": "Todas as disposições", - "FIRST_LEVEL_DISPOSITION": "Disposição de primeiro nível", + "ALL_DISPOSITIONS": "Todas Qualificações", + "FIRST_LEVEL_DISPOSITION": "Qualificação de Primeiro Nível", "LEVEL": "Nível", "SECOND_LEVEL_DISPOSITION": "Disposição de Segundo Nível", "SELECT_LEVEL": "Selecione um nível", "TITLEFONTSIZE": "Tamanho do título da fonte", "ADD_CONTACTITEMTYPE": "Adicionar", - "CONTACTITEMTYPE": "Tipos de item de contato", + "CONTACTITEMTYPE": "Tipos de Item de Contato", "NEW_CONTACTITEMTYPE": "Novo tipo de item de contato", "ORDER_BY": "Ordenar por", "RGBBACKGROUNDCOLOR": "Cor de fundo RGB", "EMAIL": "E-mail", - "FILTERCHATWEBSITES": "Filtrar sites de bate-papo", - "FILTEREMAILACCOUNTS": "Filtrar contas de e-mail", - "FILTERFAXACCOUNTS": "Filtrar contas de fax", - "FILTEROPENCHANNELACCOUNTS": "Filtrar contas OpenChannel", - "FILTERSMSACCOUNTS": "Filtrar contas de SMS", - "FILTERWHATSAPPACCOUNTS": "Filtrar contas do Whatsapp", + "FILTERCHATWEBSITES": "Filtrar Sites Chat", + "FILTEREMAILACCOUNTS": "Filtrar Contas Email", + "FILTERFAXACCOUNTS": "Filtrar Contas Fax", + "FILTEROPENCHANNELACCOUNTS": "Filtrar Contas OpenChannel", + "FILTERSMSACCOUNTS": "Filtrar Contas SMS", + "FILTERWHATSAPPACCOUNTS": "Filtrar Contas Whatsapp", "MANAGED": "Gerenciou", "MANAGED_TEXT": "Interações gerenciadas", "OPENED": "Aberto", "OPENED_TEXT": "Interações abertas", - "IGNOREDIALERCONTACTID": "Ignorar o ID de contato do discador", + "IGNOREDIALERCONTACTID": "Ignorar o ID de Contato do Discador", "MAIL_SUBSTATUS": "Substatus do Email", "OFFLINE_MESSAGE": "Mensagem offline", - "DELETE_CONTACTITEMTYPE": "Excluir tipo de item de contato", - "EDIT_CONTACTITEMTYPE": "Editar tipo de item de contato", + "DELETE_CONTACTITEMTYPE": "Excluir Tipo de Item de Contato", + "EDIT_CONTACTITEMTYPE": "Editar Tipo de Item de Contato", "ORDER_BY_NUMERIC": "A ordem por campo deve ser um valor numérico!" } } diff --git a/public/app/main/apps/video/i18n/is.json b/public/app/main/apps/video/i18n/is.json new file mode 100644 index 0000000..81b9c5c --- /dev/null +++ b/public/app/main/apps/video/i18n/is.json @@ -0,0 +1,40 @@ +{ + "VIDEO": { + "VIDEO": "Video", + "SCREENRECORDINGS": "Screen Recordings", + "SEARCH_FOR_ANYONE": "Search", + "INTERACTIONID": "Interaction ID", + "CHANNEL": "Channel", + "AGENT": "Agent", + "RATING": "Rating", + "NO_RATING": "No Rating", + "RECORDSTARTTIME": "Record Start Time", + "RECORDENDTIME": "Record End Time", + "DURATION": "Duration", + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "OF": "of", + "NO_AVAILABLE_INFO": "No Available Info", + "EDIT_SCREENRECORDING": "Rate Screen Recording", + "PLAY_SCREENRECORDING": "Play Screen Recording", + "DOWNLOAD_SCREENRECORDING": "Download Screen Recording", + "DELETE_SCREENRECORDING": "Delete Screen Recording", + "CANT_DOWNLOAD_THIS_FILE": "Can't download this file", + "WRONG_EXTENSION": "The file presents the wrong extension", + "FILE_NOT_FOUND": "File not found", + "SAVE": "Save", + "DELETE": "Delete", + "UPDATEDAT": "Last Update", + "PROPERTIES": "Properties", + "FORMAT": "Format", + "STARTEDAT": "Record Start Time", + "CLOSEDAT": "Record End Time", + "CREATEDAT": "Created at", + "ID": "Id", + "AGENTNAME": "Agent", + "CANT_PLAY_THIS_FILE": "Can't play this type of file", + "LEGEND": {}, + "ERRORS": {}, + "HELP": {} + } +} diff --git a/public/app/main/apps/voice/i18n/ar.json b/public/app/main/apps/voice/i18n/ar.json index e913b7d..f58cd7c 100644 --- a/public/app/main/apps/voice/i18n/ar.json +++ b/public/app/main/apps/voice/i18n/ar.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "أضف الفريق إلى البادئة", "ALIAS": "الاسم المستعار", "MAXCAPACITY": "السعة القصوى", - "WORKING": "عمل" + "WORKING": "عمل", + "CALL_NUMBER_REDIRECT": "إلى أي رقم تريد إعادة توجيه المكالمة؟", + "NO_AGENT_AVAILABLE": "لا يوجد وكيل متاح" } } diff --git a/public/app/main/apps/voice/i18n/bs.json b/public/app/main/apps/voice/i18n/bs.json index 28d2655..e88dc1c 100644 --- a/public/app/main/apps/voice/i18n/bs.json +++ b/public/app/main/apps/voice/i18n/bs.json @@ -1,507 +1,511 @@ { "VOICE": { - "SECOND_LEVEL_DISPOSITION": "Second Level Disposition", - "THIRD_LEVEL_DISPOSITION": "Third Level Disposition", - "FAILUREREASON": "Failure reason", - "TEXT": "Text", - "DOWNLOADTRANSCRIBE_VOICERECORDING": "Download Transcript", - "INBOUND": "Inbound", - "OUTBOUND": "Outbound", - "DIALER": "Dialer", - "LOGIN_TIME": "Login time", - "PAUSE_TIME": "Pause time", - "ABANDONEDCALLS": "Abandoned Queue Calls", - "WAITING_FOR_AGENTS": "Waiting for agents", - "ACTIVE": "Active", - "NO_AGENT_ONLINE": "No Agent Online", - "PARTIALPAUSE": "Partial Pause", + "SECOND_LEVEL_DISPOSITION": "Drugi Nivo Dispozicija", + "THIRD_LEVEL_DISPOSITION": "Treći Nivo Dispozicija", + "FAILUREREASON": "Razlog neuspjeha", + "TEXT": "Tekst", + "DOWNLOADTRANSCRIBE_VOICERECORDING": "Skini Transkript", + "INBOUND": "Dolazni", + "OUTBOUND": "Odlazni", + "DIALER": "Birač", + "LOGIN_TIME": "Vrijeme prijave", + "PAUSE_TIME": "Vrijeme pauze", + "ABANDONEDCALLS": "Napušteni Queue Pozivi", + "WAITING_FOR_AGENTS": "Čeka na Specijalistu", + "ACTIVE": "Aktivno", + "NO_AGENT_ONLINE": "Nema Specijalista Online", + "PARTIALPAUSE": "Djelimična Pauza", "STATUS": "Status", "TIMER": "Timer", - "ALIAS": "Alias", - "ALL": "All", + "ALIAS": "Pseudonim", + "ALL": "Svi", "IDLE": "Idle", - "EDIT_TRUNK": "Edit Trunk", - "GOTO_VOICEQUEUE": "Go To Realtime Voice Queues", - "GOTOREALTIME_VOICEQUEUE": "Go To Realtime Voice Queues", - "NAME": "Name", - "LOGOUT": "Logout", + "EDIT_TRUNK": "Uredi Trunk", + "GOTO_VOICEQUEUE": "Idi Na Realtime Voice Queues", + "GOTOREALTIME_VOICEQUEUE": "Idi Na Realtime Voice Queues", + "NAME": "Naziv", + "LOGOUT": "Odjava", "VOICEQUEUES": "Voice Queues", - "SEARCH_FOR_ANYONE": "Search", - "BACK": "Back", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "DELETE_VOICEDISPOSITION": "Delete Voice Disposition", - "EDIT_VOICEDISPOSITION": "Edit Voice Disposition", - "EDIT_VOICEQUEUE": "Edit Voice Queue", - "DELETE_VOICEQUEUE": "Delete Voice Queue", - "MOHSOUNDS": "Moh Sounds", - "STRATEGY": "Strategy", - "DESCRIPTION": "Description", - "ADD_VOICEQUEUE": "Add Voice Queue", - "CREATED_AT": "Created At", - "CANT_PLAY_GSM_AUDIO_FILES": "Can't play gsm or wav49 audio files", - "APPLICATIONS_LIST": "Applications List", - "GENERAL": "General", + "SEARCH_FOR_ANYONE": "Traži", + "BACK": "Nazad", + "SELECTED": "Odabrano", + "SELECT_ALL": "Odaberi Sve", + "SELECT_NONE": "Odaberi Ništa", + "DELETE_VOICEDISPOSITION": "Izbriši Voice Dispoziciju", + "EDIT_VOICEDISPOSITION": "Uredi Voice Dispoziciju", + "EDIT_VOICEQUEUE": "Uredi Voice Queue", + "DELETE_VOICEQUEUE": "Izbriši Voice Queue", + "MOHSOUNDS": "MNČ Zvukovi", + "STRATEGY": "Strategija", + "DESCRIPTION": "Opis", + "ADD_VOICEQUEUE": "Dodaj Voice Queue", + "CREATED_AT": "Kreirano U", + "CANT_PLAY_GSM_AUDIO_FILES": "Ne mogu reproducirati gsm ili wav49 audio datoteku", + "APPLICATIONS_LIST": "Lista Aplikacija", + "GENERAL": "Općenito", "TIMEOUT": "Timeout", - "MAXLENGTH": "Maximum Length", - "RETRY": "Retry", - "WRAPUPTIME": "Wrapup Time", - "WEIGHT": "Weight", - "JOINWHENEMPTY": "Join when empty", - "LEAVEWHENEMPTY": "Leave when empty", - "MUSICONHOLD": "Music On Hold", - "ANNOUNCETOAGENT": "Announce To Agent", - "ANNOUNCEMENTS": "Announcements", - "ADVANCED": "Advanced", - "ANNOUNCEFREQUENCY": "Announce Frequency", - "MINANNOUNCEFREQUENCY": "Minimum Announce Frequency", - "PERIODICANNOUNCEFREQUENCY": "Periodic Announce Frequency", - "RANDOMPERIODICANNOUNCE": "Random Periodic Announce", - "ANNOUNCEHOLDTIME": "Announce Hold Time", - "ANNOUNCECALLERPOSITION": "Announce Caller Position", - "ANNOUNCEPOSITIONLIMIT": "Announce Position Limit", - "REPORTHOLDTIMEAGENT": "Report Agent Hold Time", - "PERIODICANNOUNCE": "Periodic Announce", - "HOLDTIMEANNOUNCE": "Hold Time Announce", - "YOUARENEXTANNOUNCE": "'You are next' Announce", - "THEREAREANNOUNCE": "'There are' Announce", - "WAITINGCALLSANNOUNCE": "Waiting Calls Announce", - "ESTIMATEDHOLDTIMEANNOUNCE": "Estimated Hold Time Announce", - "MINUTESANNOUNCE": "Minutes Announce", - "MINUTEANNOUNCE": "Minute Announce", - "SECONDSANNOUNCE": "Seconds Announce", - "THANKYOUANNOUNCE": "'Thank You' Announce", - "AUTOPAUSE": "Auto Pause", - "AFTERCALLWORK": "After Call Work", - "AFTERCALLWORKDURATION": "After Call Work Duration", - "RINGINUSE": "Ring In Use", - "MEMBERDELAY": "Member Delay", + "MAXLENGTH": "Maksimalna Dužina", + "RETRY": "Ponovljeni Pokušaj", + "WRAPUPTIME": "Vrijeme Završetka", + "WEIGHT": "Težina", + "JOINWHENEMPTY": "Pridruži se kada je prazno", + "LEAVEWHENEMPTY": "Napusti kada je prazno", + "MUSICONHOLD": "Muzika Na Čekanju", + "ANNOUNCETOAGENT": "Najavi Specijalisti", + "ANNOUNCEMENTS": "Najave", + "ADVANCED": "Napredno", + "ANNOUNCEFREQUENCY": "Najava Učestalost", + "MINANNOUNCEFREQUENCY": "Minimalna Učestalost Najava", + "PERIODICANNOUNCEFREQUENCY": "Učestalost Periodičnih Najava", + "RANDOMPERIODICANNOUNCE": "Nasumično Periodično Objavljivanje", + "ANNOUNCEHOLDTIME": "Najavi Vrijeme Čekanja", + "ANNOUNCECALLERPOSITION": "Najavi Poziciju Pozivaoca", + "ANNOUNCEPOSITIONLIMIT": "Najavi Limit Pozicije", + "REPORTHOLDTIMEAGENT": "Izvještaj Vrijeme Čekanja Specijaliste", + "PERIODICANNOUNCE": "Periodična Najava", + "HOLDTIMEANNOUNCE": "Vrijeme Čekanja Najave", + "YOUARENEXTANNOUNCE": "'Vi ste sljedeći' Najava", + "THEREAREANNOUNCE": "'Ispred su' Najava", + "WAITINGCALLSANNOUNCE": "Najava Poziva Na Čekanju", + "ESTIMATEDHOLDTIMEANNOUNCE": "Procjenjeno Hold Vrijeme Najava", + "MINUTESANNOUNCE": "Minute Najava", + "MINUTEANNOUNCE": "Minuta Najava", + "SECONDSANNOUNCE": "Sekunde Najava", + "THANKYOUANNOUNCE": "'Hvala Vam' Najava", + "AUTOPAUSE": "Automatska Pauza", + "AFTERCALLWORK": "Posao Nakon Poziva", + "AFTERCALLWORKDURATION": "Posao Nakon Poziva Trajanje", + "RINGINUSE": "Zvono U Upotrebi", + "MEMBERDELAY": "Član Odgoda", "TIMEOUTRESTART": "Timeout Restart", - "MONITORFORMAT": "Recording Format", - "SETINTERFACEVARIABLES": "Set Interface Variables", - "SETQUEUEVARIABLES": "Set Queue Variables", - "SETQUEUEENTRYVARIABLES": "Set Queue Entry Variables", - "VARIABLE": "Variable", - "CONTEXT": "Context", - "SAVE": "Save", - "SETTINGS": "Settings", - "INBOUNDROUTES": "Inbound Routes", - "PHONENUMBER": "Phone Number", - "ADD_INBOUNDROUTE": "Add Inbound Route", - "EDIT_INBOUNDROUTE": "Edit Inbound Route", - "DELETE_INBOUNDROUTE": "Delete Inbound Route", - "ACTIONS": "Actions", - "OUTBOUNDROUTES": "Outbound Routes", - "DESTINATIONPATTERN": "Destination Pattern", - "ADD_OUTBOUNDROUTE": "Add Outbound Route", - "EDIT_OUTBOUNDROUTE": "Edit Outbound Route", - "DELETE_OUTBOUNDROUTE": "Delete Outbound Route", - "CUTDIGITS": "Cut Digits", - "RECORDING": "Recording", - "RECORDINGFORMAT": "Recording format", - "INTERNALROUTES": "Internal Routes", - "ADD_INTERNALROUTE": "Add Internal Route", - "EDIT_INTERNALROUTE": "Edit Internal Route", - "DELETE_INTERNALROUTE": "Delete Internal Route", - "CONTEXTS": "Contexts", - "ADD_CONTEXT": "Add Context", - "EDIT_CONTEXT": "Edit Context", - "DELETE_CONTEXT": "Delete Context", - "VOICEMAILS": "Voicemails", - "ADD_VOICEMAIL": "Add Voicemail", - "EDIT_VOICEMAIL": "Edit Voicemail", - "DELETE_VOICEMAIL": "Delete Voicemail", - "FULLNAME": "Full Name", - "EMAIL": "Email", - "MAILBOX": "Mailbox", - "PASSWORD": "Password", - "CONFIRM_PASSWORD": "Confirm Password", - "TIMEZONE": "Timezone", - "ATTACH": "Attach", - "ENVELOPE": "Envelope", - "DELETE": "Delete", - "EMAILBODY": "Email Body", - "EMAILSUBJECT": "Email Subject", - "MAXSECONDS": "Max Seconds", - "MAXMESSAGES": "Max Messages", - "MESSAGES": "Messages", - "SORT": "Sort", - "ADD_MUSICONHOLD": "Add Music On Hold", - "MUSICONHOLDS": "Music On Hold", - "EDIT_MUSICONHOLD": "Edit Music On Hold", - "DELETE_MUSICONHOLD": "Delete Music On Hold", - "DIRECTORY": "Directory", - "AUDIOFILES": "Audio Files", - "RECORDINGS": "Recordings", + "MONITORFORMAT": "Format Snimanja", + "SETINTERFACEVARIABLES": "Postavi Varijable Interfejsa ", + "SETQUEUEVARIABLES": "Postavi Varijable Queue", + "SETQUEUEENTRYVARIABLES": "Postavi Varijable Ulaznog Queue", + "VARIABLE": "Varijabla", + "CONTEXT": "Kontekst", + "SAVE": "Sačuvaj", + "SETTINGS": "Postavke", + "INBOUNDROUTES": "Dolazne Rute", + "PHONENUMBER": "Broj Telefona", + "ADD_INBOUNDROUTE": "Dodaj Inbound Rutu", + "EDIT_INBOUNDROUTE": "Uredi Dolaznu Rutu", + "DELETE_INBOUNDROUTE": "Izbriši Dolaznu Rutu", + "ACTIONS": "Radnje", + "OUTBOUNDROUTES": "Odlazne Rute", + "DESTINATIONPATTERN": "Obrazac Odredišta", + "ADD_OUTBOUNDROUTE": "Dodaj Outbound Rutu", + "EDIT_OUTBOUNDROUTE": "Uredi Odlaznu Rutu", + "DELETE_OUTBOUNDROUTE": "Izbriši Odlaznu Rutu", + "CUTDIGITS": "Izreži Cifre", + "RECORDING": "Snimanje", + "RECORDINGFORMAT": "Format snimanja", + "INTERNALROUTES": "Interne Rute", + "ADD_INTERNALROUTE": "Dodaj Internu Rutu", + "EDIT_INTERNALROUTE": "Uredi Internu Rutu", + "DELETE_INTERNALROUTE": "Izbriši Internu Rutu", + "CONTEXTS": "Konteksti", + "ADD_CONTEXT": "Dodaj Kontekst", + "EDIT_CONTEXT": "Uredi Kontekst", + "DELETE_CONTEXT": "Izbriši Kontekst", + "VOICEMAILS": "Govorne pošte", + "ADD_VOICEMAIL": "Dodaj Govornu Poštu ", + "EDIT_VOICEMAIL": "Uredi Govornu Poštu", + "DELETE_VOICEMAIL": "Izbriši Govorno Poštu", + "FULLNAME": "Puno Ime", + "EMAIL": "E-Mail", + "MAILBOX": "Poštansko sanduče", + "PASSWORD": "Lozinka", + "CONFIRM_PASSWORD": "Potvrdi Lozinku", + "TIMEZONE": "Vremenska Zona", + "ATTACH": "Priloži", + "ENVELOPE": "Koverta", + "DELETE": "Izbriši", + "EMAILBODY": "E-Mail Tijelo", + "EMAILSUBJECT": "E-Mail Predmet", + "MAXSECONDS": "Maks Sekundi", + "MAXMESSAGES": "Maks Poruka", + "MESSAGES": "Poruke", + "SORT": "Sortiraj", + "ADD_MUSICONHOLD": "Dodaj Muziku Na Čekanju", + "MUSICONHOLDS": "Muzika Na Čekanju", + "EDIT_MUSICONHOLD": "Uredi Muzika Na Čekanju", + "DELETE_MUSICONHOLD": "Izbriši Muzika Na Čekanju", + "DIRECTORY": "Adresar", + "AUDIOFILES": "Audio Datoteke", + "RECORDINGS": "Snimci", "CHANSPY": "ChanSpy", - "PREFIX": "Prefix", - "OPTIONS": "Options", + "PREFIX": "Prefiks", + "OPTIONS": "Opcije", "AUTH": "Auth", - "ADD_CHANSPY": "Add ChanSpy", - "EDIT_CHANSPY": "Edit ChanSpy", - "DELETE_CHANSPY": "Delete ChanSpy", - "AGENTS": "Agents", - "TELEPHONES": "Telephones", + "ADD_CHANSPY": "Dodaj ChanSpy", + "EDIT_CHANSPY": "Uredi ChanSpy", + "DELETE_CHANSPY": "Izbriši ChanSpy", + "AGENTS": "Specijalisti", + "TELEPHONES": "Telefoni", "QUEUES": "Queues", - "QUEUE_CALLS": "Queue Calls", - "QUEUE_PARAMETERS": "Queue Parameters", - "ABANDONED_CALLS": "Abandoned Calls", - "OUTBOUND_CALLS": "Outbound Calls", - "AGI": "Agi", - "DIAL": "Dial", + "QUEUE_CALLS": "Queue Pozivi", + "QUEUE_PARAMETERS": "Queue Parametri", + "ABANDONED_CALLS": "Napušteni Pozivi", + "OUTBOUND_CALLS": "Odlazni Pozivi", + "AGI": "AGI", + "DIAL": "Biraj", "CALLYSQUARE": "CallySquare", - "INTERNALDIAL": "Internal Dial", - "EXTERNALDIAL": "External Dial", - "RINGGROUP": "Ring Group", - "PLAYBACK": "Playback", + "INTERNALDIAL": "Interno Biranje", + "EXTERNALDIAL": "Eksterno Pozivanje", + "RINGGROUP": "Grupa Zvona", + "PLAYBACK": "Reprodukcija", "QUEUE": "Queue", - "SET": "Set", - "VOICEMAIL": "Voicemail", + "SET": "Postavi", + "VOICEMAIL": "Govorna pošta", "GOTO": "GoTo", - "HANGUP": "Hangup", - "CUSTOM": "Custom", - "PROJECT": "Cally-Square Project", - "TECHNOLOGY/RESOURCE": "Technology/Resource", + "HANGUP": "Prekid", + "CUSTOM": "Prilagođeno", + "PROJECT": "Cally-Square Projekat", + "TECHNOLOGY/RESOURCE": "Tehnologija/Resursi", "URL": "URL", - "EDIT_APP": "Edit Application", - "EDIT_INTERVAL": "Edit Interval", - "DELETE_APP": "Delete Application", - "INTERVALS": "Intervals", - "USER": "User", + "EDIT_APP": "Uredi Aplikaciju", + "EDIT_INTERVAL": "Uredi Interval", + "DELETE_APP": "Izbriši Aplikaciju", + "INTERVALS": "Intervali", + "USER": "Korisnik", "TRUNK": "Trunk", - "PHONE": "Phone", - "AUDIO_FILES": "Audio Files", - "ANNOUNCE_OVERRIDES": "Announce Overrides", - "MACRO": "Macro", + "PHONE": "Telefon", + "AUDIO_FILES": "Audio Datoteke", + "ANNOUNCE_OVERRIDES": "Najave Nadjačavanja", + "MACRO": "Makro", "GOSUB": "GoSub", - "RULE": "Rule", - "POSITION": "Position", - "ANSWER": "Answer", - "VALUE": "Value", - "MAILBOX@CONTEXT": "Mailbox@Context", - "EXTENSION": "Extension", - "PRIORITY": "Priority", - "HANGUP_CAUSE": "Hangup Cause", - "OUTBOUNDDIAL": "Outbound Dial", - "CALLER_ID": "Caller ID", - "NO_MESSAGE_AVAILABLE": "No messages available", - "NO_SOUND_AVAILABLE": "No sounds available", - "VOICERECORDINGS": "Voice Recordings", + "RULE": "Pravilo", + "POSITION": "Pozicija", + "ANSWER": "Odgovori", + "VALUE": "Vrijednost", + "MAILBOX@CONTEXT": "Poštanskosanduče@Kontekst", + "EXTENSION": "Ekstenzija", + "PRIORITY": "Prioritet", + "HANGUP_CAUSE": "Uzrok Prekida", + "OUTBOUNDDIAL": "Odlazno Biranje", + "CALLER_ID": "Pozivatelj ID", + "NO_MESSAGE_AVAILABLE": "Nema dostupnih poruka", + "NO_SOUND_AVAILABLE": "Nema dostupnih zvukova", + "VOICERECORDINGS": "Voice Snimci", "CHANSPIES": "ChanSpy", "VOICE": "Voice", "REALTIME": "Realtime", - "ID": "Id", - "VOICEMAIL_CONTEXT": "Context", - "NO_MOHSOUND_AVAILABLE": "No Music On Hold available", - "FILE": "File", - "ADD_MOHSOUND": "Add Music On Hold sound", - "DOWNLOAD_MOHSOUND": "Download Music On Hold sound", - "DELETE_MOHSOUND": "Delete Music On Hold sound", - "UNIQUEID": "Unique ID", - "AGENT": "Agent", - "TYPE": "Type", - "RATING": "Rating", + "ID": "ID", + "VOICEMAIL_CONTEXT": "Kontekst", + "NO_MOHSOUND_AVAILABLE": "Nema dostupne Muzike Na Čekanju", + "FILE": "Datoteka", + "ADD_MOHSOUND": "Dodaj Muzika Na Čekanju zvuk ", + "DOWNLOAD_MOHSOUND": "Skini Muzika Na Čekanju zvuk", + "DELETE_MOHSOUND": "Izbriši Muzika Na Čekanju zvuk", + "UNIQUEID": "Jedinstveni ID", + "AGENT": "Specijalist", + "TYPE": "Vrsta", + "RATING": "Ocjena", "AUDIO": "Audio", - "DATE": "Date", - "NEW_VOICEQUEUE": "New Voice Queue", - "NEW_INBOUNDROUTE": "New Inbound Route", - "NEW_OUTBOUNDROUTE": "New Outbound Route", - "NEW_INTERNALROUTE": "New Internal Route", - "NEW_CONTEXT": "New Context", - "NEW_VOICEMAIL": "New Voicemail", - "NEW_MUSICONHOLD": "New Music On Hold", - "NEW_CHANSPY": "New ChanSpy", - "PENALTY": "Penalty", - "ADD_TEAM_TO_VOICEQUEUE": "Add Team to Voice Queue", - "ADD_AGENT_TO_VOICEQUEUE": "Add Agent to Voice Queue", - "EDIT_DIAL": "Edit Dial", - "EDIT_AGI": "Edit AGI", - "EDIT_INTERNALDIAL": "Edit Internal Dial", - "EDIT_EXTERNALDIAL": "Edit External Dial", - "EDIT_RINGGROUP": "Edit Ring Group", - "EDIT_PLAYBACK": "Edit Playback", - "EDIT_QUEUE": "Edit Queue", - "EDIT_SET": "Edit Set", - "EDIT_GOTO": "Edit GoTo", - "EDIT_HANGUP": "Edit Hangup", - "EDIT_CUSTOM": "Edit Custom", - "DURATION": "Duration", - "RECEIVED_AT": "Received At", - "YES": "Yes", - "NO": "No", - "HANGUPCAUSE_1": "1 = Unallocated number", - "HANGUPCAUSE_16": "16 = Normal call clearing", - "HANGUPCAUSE_17": "17 = User busy", - "HANGUPCAUSE_18": "18 = No user responding (telehone device not connected)", - "HANGUPCAUSE_21": "21 = Call rejected", - "HANGUPCAUSE_22": "22 = Number changed", - "HANGUPCAUSE_27": "27 = Destination out of order", - "HANGUPCAUSE_38": "38 = Network out of order", - "HANGUPCAUSE_41": "41 = Temporary failure", - "RANDOM": "Random", - "ALPHABETICAL": "Alphabetical", - "NO_APPS_AVAILABLE": "No applications available", - "DOWNLOAD_VOICERECORDING": "Download Voice Recording", - "DELETE_VOICERECORDING": "Delete Voice Recording", - "INTERNAL": "Internal", - "PHONE_STATE": "Phone State", - "PHONE_STATUS": "Phone Status", + "DATE": "Datum", + "NEW_VOICEQUEUE": "Novi Voice Queue", + "NEW_INBOUNDROUTE": "Nova Dolazna Ruta", + "NEW_OUTBOUNDROUTE": "Nova Odlazna Ruta", + "NEW_INTERNALROUTE": "Nova Interna Ruta", + "NEW_CONTEXT": "Novi Kontekst", + "NEW_VOICEMAIL": "Nova Govorna Pošta", + "NEW_MUSICONHOLD": "Nova Muzika Na Čekanju", + "NEW_CHANSPY": "Novi ChanSpy", + "PENALTY": "Kazna", + "ADD_TEAM_TO_VOICEQUEUE": "Dodaj Tim u Voice Queue", + "ADD_AGENT_TO_VOICEQUEUE": "Dodaj Specijalistu u Voice Queue", + "EDIT_DIAL": "Uredi Biranje", + "EDIT_AGI": "Uredi AGI", + "EDIT_INTERNALDIAL": "Uredi Interno Biranje", + "EDIT_EXTERNALDIAL": "Uredi Eksterno Biranje", + "EDIT_RINGGROUP": "Uredi Ring Grupu", + "EDIT_PLAYBACK": "Uredi Reprodukciju", + "EDIT_QUEUE": "Uredi Queue", + "EDIT_SET": "Uredi Postavljanje", + "EDIT_GOTO": "Uredi GoTo", + "EDIT_HANGUP": "Uredi Hangup", + "EDIT_CUSTOM": "Uredi Prilagođeno", + "DURATION": "Trajanje", + "RECEIVED_AT": "Primljeno U", + "YES": "Da", + "NO": "Ne", + "HANGUPCAUSE_1": "1 = Nedodijeljen broj", + "HANGUPCAUSE_16": "16 = Normalno brisanje poziva", + "HANGUPCAUSE_17": "17 = Korisnik zauzet", + "HANGUPCAUSE_18": "18 = Korisnik ne odgovara (telefonski uređaj nije povezan)", + "HANGUPCAUSE_21": "21 = Poziv odbijen", + "HANGUPCAUSE_22": "22 = Broj promijenjen", + "HANGUPCAUSE_27": "27 = Odredište poremećeno", + "HANGUPCAUSE_38": "38 = Mreža poremećena", + "HANGUPCAUSE_41": "41 = Privremeno neuspješno", + "RANDOM": "Nasumično", + "ALPHABETICAL": "Abecedno", + "NO_APPS_AVAILABLE": "Nema dostupnih aplikacija", + "DOWNLOAD_VOICERECORDING": "Skini Voice Snimanje", + "DELETE_VOICERECORDING": "Izbriši Voice Snimak", + "INTERNAL": "Interno", + "PHONE_STATE": "Stanje Telefona", + "PHONE_STATUS": "Status Telefona", "TRUNK_STATUS": "Trunk Status", - "REGISTERED": "Registered", - "UNREGISTERED": "Unregistered", - "LAGGED": "Lagged", - "REACHABLE": "Reachable", - "UNREACHABLE": "Unreachable", - "UNKNOWN": "Unknown", - "NOT_INUSE": "Not In Use", - "INUSE": "In Use", - "BUSY": "Busy", - "INVALID": "Invalid", - "UNAVAILABLE": "Unavailable", - "RINGING": "Ringing", - "ONHOLD": "On Hold", - "RING": "Ring", - "UP": "Up", + "REGISTERED": "Registrovan", + "UNREGISTERED": "Neregistrovan", + "LAGGED": "Zaostao", + "REACHABLE": "Dostupno", + "UNREACHABLE": "Nedostupan", + "UNKNOWN": "Nepoznato", + "NOT_INUSE": "Nije u upotrebi", + "INUSE": "U Upotrebi", + "BUSY": "Zauzet", + "INVALID": "Nevažeći", + "UNAVAILABLE": "Nedostupno", + "RINGING": "Zvoniti", + "ONHOLD": "Na Čekanju", + "RING": "Zvono", + "UP": "Gore", "INFO": "Info", - "TRUNKS": "Trunks", - "REGISTRY": "Registry", - "NO_REGISTRY": "No Registry", - "LOGGED_IN": "Logged In (SIP Connected)", - "PAUSED": "Paused", - "WAITING": "Waiting", - "TALKING": "Talking", + "TRUNKS": "Trunkovi", + "REGISTRY": "Registar", + "NO_REGISTRY": "Nema registra", + "LOGGED_IN": "Prijavljen (SIP povezan)", + "PAUSED": "Pauzirano", + "WAITING": "Čeka", + "TALKING": "Priča", "DID": "DID", - "CALLER": "Caller", - "TOTAL": "Total", - "ANSWERED": "Answered", - "ABANDONED": "Abandoned", - "UNMANAGED": "Unmanaged", - "AVG_HOLD_TIME": "Avg Hold Time", - "AVG_DURATION": "Av Duration", - "AVG_BILLABLE": "Avg Billable", - "SOURCE": "Source", - "DESTINATION": "Destination", - "REJECTED": "Rejected", - "FAILED": "Failed", - "CALLED": "Called", - "CONNECTED": "Connected", - "NO_RATING": "No rating", - "EDIT_VOICERECORDING": "Edit Voice Recording", - "APPLICATION_NAME": "Application Name", - "ARGUMENTS": "Arguments", - "NO_AVAILABLE_INFO": "No Available Info", - "ADD_AGENT_TO_QUEUE": "Add Agent To Queue", - "DEFAULT_PAUSE": "DEFAULT PAUSE", - "PAUSE": "Pause", - "UNPAUSE": "End Pause", - "REDIRECT_TO_NUMBER": "Redirect To Number", - "REDIRECT_TO_AGENT": "Redirect To Agent", - "AGENTADD_VOICEQUEUE": "Add Agent To Voice Queue", - "APPLICATION": "Application", - "FILES": "Files", + "CALLER": "Pozivatelj", + "TOTAL": "Ukupno", + "ANSWERED": "Odgovoreno", + "ABANDONED": "Napušteno", + "UNMANAGED": "Neupravljan", + "AVG_HOLD_TIME": "Prosječno Vrijeme Čekanja", + "AVG_DURATION": "Prosječno Trajanje", + "AVG_BILLABLE": "Prosječno Naplativo", + "SOURCE": "Izvor", + "DESTINATION": "Odredište", + "REJECTED": "Odbijeno", + "FAILED": "Neuspješno", + "CALLED": "Zvao", + "CONNECTED": "Povezano", + "NO_RATING": "Nema ocjene", + "EDIT_VOICERECORDING": "Uredi Voice Snimanje", + "APPLICATION_NAME": "Naziv Aplikacije", + "ARGUMENTS": "Argumenti", + "NO_AVAILABLE_INFO": "Nema dostupnih informacija", + "ADD_AGENT_TO_QUEUE": "Dodaj Specijalistu u Queue", + "DEFAULT_PAUSE": "ZADANA PAUZA", + "PAUSE": "Pauza", + "UNPAUSE": "Prekini Pauzu", + "REDIRECT_TO_NUMBER": "Preusmjeri na broj", + "REDIRECT_TO_AGENT": "Preusmjeri na Specijalistu", + "AGENTADD_VOICEQUEUE": "Dodaj Specijalistu u Voice Queue", + "APPLICATION": "Aplikacija", + "FILES": "Datoteke", "FORMAT": "Format", - "MODE": "Mode", - "RECORD": "Record", - "TEAMADD_VOICEQUEUE": "Add Team To Voice Queue", - "NEW_MOHSOUND": "New Music On Hold sound", - "DOWNLOAD_MESSAGE": "Download", - "DELETE_MESSAGE": "Delete", - "QUEUE_PARAMS": "Queue Parameters", - "TOTAL_OFFERED": "Total Offered", - "READY": "Ready", - "AGENTADD_QUEUE": "Add Agent To Voice Queue", - "AGENTSADD_QUEUE": "Add Agents To Voice Queue", - "ALL_TEAMS": "All Teams", - "SELECTED_TEAMS": "Selected Teams", - "ALL_AGENTS": "All Agents", - "SELECTED_AGENTS": "Selected Agents", - "CLOSING": "Closing", - "TAGS": "Tags", - "WAITING_FOR_AGENT": "Waiting For Agents", - "EDIT_OUTBOUNDDIAL": "Edit Outbound Dial", - "ACCOUNTNAME": "Account Name", - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", - "DISPOSITION": "Disposition", + "MODE": "Način", + "RECORD": "Snimai", + "TEAMADD_VOICEQUEUE": "Dodaj Tim u Voice Queue", + "NEW_MOHSOUND": "Novi Muzika Na Čekanju zvuk", + "DOWNLOAD_MESSAGE": "Skini", + "DELETE_MESSAGE": "Izbriši", + "QUEUE_PARAMS": "Queue Parametri", + "TOTAL_OFFERED": "Ukupno Ponuđeno", + "READY": "Spreman", + "AGENTADD_QUEUE": "Dodaj Specijalistu u Voice Queue", + "AGENTSADD_QUEUE": "Dodaj Specijaliste u Voice Queue", + "ALL_TEAMS": "Svi Timovi", + "SELECTED_TEAMS": "Odabrani Timovi", + "ALL_AGENTS": "Svi Specijalisti", + "SELECTED_AGENTS": "Odabrani Specijalisti", + "CLOSING": "Zatvaranje", + "TAGS": "Tagovi", + "WAITING_FOR_AGENT": "Čeka na Specijalistu", + "EDIT_OUTBOUNDDIAL": "Uredi Odlazno Biranje", + "ACCOUNTNAME": "Nalog Naziv", + "PAGE": "Stranica", + "ROWSPERPAGE": "Redova po stranici", + "OF": "od", + "DISPOSITION": "Dispozicija", "CHAT": "Chat", - "MAIL": "Email", + "MAIL": "E-Mail", "SMS": "SMS", - "OPENCHANNEL": "Open Channel", + "OPENCHANNEL": "Otvoreni Kanal", "FAX": "Fax", - "CLEAR": "Clear", - "CALLS": "Calls", - "STARTEDAT": "Started At", - "ENDEDAT": "Ended At", + "CLEAR": "Izbriši", + "CALLS": "Pozivi", + "STARTEDAT": "Počelo U", + "ENDEDAT": "Završeno U", "TAG": "Tag", "DETAILS": "Details", - "BILLABLESECONDS": "Billable seconds", - "ANSWEREDAT": "Answered At", - "NOTE": "Note", - "CLOSE": "Close", - "SELECT_DATE": "Select Start Date", - "SELECT_TYPE": "Select Type", - "VOICEPREFIXES": "Out Prefixes", - "NEW_VOICEPREFIX": "New Prefix", - "ADD_VOICEPREFIX": "Add Prefix", - "EDIT_VOICEPREFIX": "Edit Prefix", - "AGENTADD_VOICEPREFIX": "Add Agent to Prefix", - "TEAMADD_VOICEPREFIX": "Add Team to Prefix", - "DELETE_VOICEPREFIX": "Delete Prefix", - "OUTBOUNDROUTE": "Outbound Route", - "CALLERIDALL": "Caller Id", - "MANDATORYDISPOSITION": "Mandatory disposition", - "MANDATORYDISPOSITIONPAUSEID": "Mandatory disposition pause status", - "SCREENRECORDING": "Manage Screen Recording", - "START_SCREENRECORDING": "Start Screen Recording", - "STOP_SCREENRECORDING": "Stop Screen Recording", - "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", - "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available", - "CANT_DOWNLOAD_THIS_FILE": "Can't download this file", - "WRONG_EXTENSION": "The file presents the wrong extension", - "FILE_NOT_FOUND": "File not found", - "TEAMS_ASSOCIATION": "Teams Association", + "BILLABLESECONDS": "Naplative sekunde", + "ANSWEREDAT": "Odgovoreno Na", + "NOTE": "Bilješka", + "CLOSE": "Zatvori", + "SELECT_DATE": "Odaberi Datum", + "SELECT_TYPE": "Odaberi Vrstu", + "VOICEPREFIXES": "Odlazni Prefiksi", + "NEW_VOICEPREFIX": "Novi Prefiks", + "ADD_VOICEPREFIX": "Dodaj Prefiks", + "EDIT_VOICEPREFIX": "Uredi Prefiks", + "AGENTADD_VOICEPREFIX": "Dodaj Specijalistu u Prefiks", + "TEAMADD_VOICEPREFIX": "Dodaj Tim u Prefiks", + "DELETE_VOICEPREFIX": "Izbriši Prefiks", + "OUTBOUNDROUTE": "Odlazna Ruta", + "CALLERIDALL": "Pozivatelj ID", + "MANDATORYDISPOSITION": "Obavezna dispozicija", + "MANDATORYDISPOSITIONPAUSEID": "Obavezna dispozicija status pauze", + "SCREENRECORDING": "Upravljaj Snimanjem Ekrana", + "START_SCREENRECORDING": "Pokreni Snimanje Ekrana", + "STOP_SCREENRECORDING": "Zaustavi Snimanje Ekrana", + "TOOLTIP_SCREENRECORDING_ON": "Snimanje Ekrana u toku", + "TOOLTIP_SCREENRECORDING_OFF": "Snimanje Ekrana dostupno", + "CANT_DOWNLOAD_THIS_FILE": "Ne mogu skinuti ovau datoteku", + "WRONG_EXTENSION": "Datoteka ima pogrešnu ekstenziju", + "FILE_NOT_FOUND": "Datoteka nije pronađen", + "TEAMS_ASSOCIATION": "Asocijacija Timova", "TRANSCRIBE": "Transcribe", - "TRANSCRIPT": "Transcript", - "SENTIMENTANALYSIS": "Sentiment Analysis", - "TRANSCRIBESTATUS_COMPLETED": "Completed", - "TRANSCRIBESTATUS_IN_PROGRESS": "In progress", - "TRANSCRIBESTATUS_FAILED": "Failed", - "TRANSCRIBESTATUS_NEW": "New", - "TRANSCRIPTANALYSIS": "Transcript & Analysis", - "SENTIMENT_POSITIVE": "Positive", - "SENTIMENT_NEGATIVE": "Negative", - "SENTIMENT_NEUTRAL": "Neutral", - "SENTIMENT_MIXED": "Mixed", - "RUNTRANSCRIBE_VOICERECORDING": "Run Transcribe", - "RUNTRANSCRIBESENTIMENT_VOICERECORDING": "Run Transcribe&Sentiment", - "RUNSENTIMENT_VOICERECORDING": "Run Sentiment", + "TRANSCRIPT": "Transkript", + "SENTIMENTANALYSIS": "Sentiment Analiza", + "TRANSCRIBESTATUS_COMPLETED": "Završeno", + "TRANSCRIBESTATUS_IN_PROGRESS": "U toku", + "TRANSCRIBESTATUS_FAILED": "Nije uspjelo", + "TRANSCRIBESTATUS_NEW": "Novi", + "TRANSCRIPTANALYSIS": "Transkript & Analiza", + "SENTIMENT_POSITIVE": "Pozitivno", + "SENTIMENT_NEGATIVE": "Negativno", + "SENTIMENT_NEUTRAL": "Neutralno", + "SENTIMENT_MIXED": "Miješano", + "RUNTRANSCRIBE_VOICERECORDING": "Pokreni Transcribe", + "RUNTRANSCRIBESENTIMENT_VOICERECORDING": "Pokreni Transcribe&Sentiment", + "RUNSENTIMENT_VOICERECORDING": "Pokreni Sentiment", "SENTIMENT": "Sentiment", - "SERVICELEVEL": "Service level", - "MAXCAPACITY": "Max capacity", + "SERVICELEVEL": "Nivo Servisa", + "MAXCAPACITY": "Maks Kapacitet", "WORKING": "Working", "LEGEND": { - "CUSTOM_APPLICATION": "(*) - Custom application" + "CUSTOM_APPLICATION": "(*) - Prilagođena aplikacija." }, "ERRORS": { - "PROJECT_REQUIRED": "Mandatory field", - "TRUNK_REQUIRED": "Mandatory field", - "VARIABLE_REQUIRED": "Mandatory field", - "NAME_REQUIRED": "Mandatory field", - "APPLICATION_NAME_REQUIRED": "Mandatory field", - "TIMEOUT_REQUIRED": "Mandatory field", - "PHONENUMBER_REQUIRED": "Mandatory field", - "CONTEXT_REQUIRED": "Mandatory field", - "DESTINATIONPATTERN_REQUIRED": "Mandatory field", - "FULLNAME_REQUIRED": "Mandatory field", - "EMAIL_REQUIRED": "Mandatory field", - "EMAIL_MUST_VALID": "Wrong format", - "MAILBOX_REQUIRED": "Mandatory field", - "PASSWORD_REQUIRED": "Mandatory field", - "CONFIRM_NOT_MATCH": "The passwords don't match", - "TIMEZONE_REQUIRED": "Mandatory field", - "PREFIX_REQUIRED": "Mandatory field", - "OPTIONS_REQUIRED": "Mandatory field", - "AFTERCALLWORKDURATION_REQUIRED": "Mandatory field", - "TECHNOLOGY/RESOURCE_REQUIRED": "Mandatory field", - "PHONE_REQUIRED": "Mandatory field", - "VALUE_REQUIRED": "Mandatory field", - "EXTENSION_REQUIRED": "Mandatory field", - "PRIORITY_REQUIRED": "Mandatory field", - "APPLICATION_REQUIRED": "Mandatory field", - "OUTBOUNDROUTE_REQUIRED": "Mandatory field", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "MAXLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "ANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "MINANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "PERIODICANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "AFTERCALLWORKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "MEMBERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "POSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "CUTDIGITS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "MAXSECONDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "MAXMESSAGES_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "MAXMESSAGES_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "NAME_MUST_VALID_PATTERN": "Wrong format", - "CALLERIDALL_MUST_VALID_PATTERN": "Wrong format", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Mandatory field", - "CALLER_ID_MUST_VALID_PATTERN": "Wrong format", - "PENALTY_REQUIRED": "You must specify a value for penalty" + "PROJECT_REQUIRED": "Obavezno polje", + "TRUNK_REQUIRED": "Obavezno polje", + "VARIABLE_REQUIRED": "Obavezno polje", + "NAME_REQUIRED": "Obavezno polje", + "APPLICATION_NAME_REQUIRED": "Obavezno polje", + "TIMEOUT_REQUIRED": "Obavezno polje", + "PHONENUMBER_REQUIRED": "Obavezno polje", + "CONTEXT_REQUIRED": "Obavezno polje", + "DESTINATIONPATTERN_REQUIRED": "Obavezno polje", + "FULLNAME_REQUIRED": "Obavezno polje", + "EMAIL_REQUIRED": "Obavezno polje", + "EMAIL_MUST_VALID": "Pogrešan format", + "MAILBOX_REQUIRED": "Obavezno polje", + "PASSWORD_REQUIRED": "Obavezno polje", + "CONFIRM_NOT_MATCH": "Lozinke se ne poklapaju", + "TIMEZONE_REQUIRED": "Obavezno polje", + "PREFIX_REQUIRED": "Obavezno polje", + "OPTIONS_REQUIRED": "Obavezno polje", + "AFTERCALLWORKDURATION_REQUIRED": "Obavezno polje", + "TECHNOLOGY/RESOURCE_REQUIRED": "Obavezno polje", + "PHONE_REQUIRED": "Obavezno polje", + "VALUE_REQUIRED": "Obavezno polje", + "EXTENSION_REQUIRED": "Obavezno polje", + "PRIORITY_REQUIRED": "Obavezno polje", + "APPLICATION_REQUIRED": "Obavezno polje", + "OUTBOUNDROUTE_REQUIRED": "Obavezno polje", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "MAXLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "ANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "MINANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "PERIODICANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "AFTERCALLWORKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "MEMBERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "POSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "CUTDIGITS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "MAXSECONDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "MAXMESSAGES_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "MAXMESSAGES_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "NAME_MUST_VALID_PATTERN": "Pogrešan format", + "CALLERIDALL_MUST_VALID_PATTERN": "Pogrešan format", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Obavezno polje", + "CALLER_ID_MUST_VALID_PATTERN": "Pogrešan format", + "PENALTY_REQUIRED": "Moraš navesti vrijednost za kaznu" }, "HELP": { - "TIMEOUT": "How many seconds to ring a device", - "MAXLENGTH": "Maximum number of callers allowed to wait in a queue: zero means unlimited", - "RETRY": "Time in seconds to wait before calling the next agent in queue when the timeout is expired", - "WRAPUPTIME": "Time in seconds to keep a queue member unavailable after completing a call", - "WEIGHT": "Weight of a queue in order to define priority if members are associated with multiple queues", - "JOINWHENEMPTY": "Used to control whether a caller is passed to a queue when no members are available", - "LEAVEWHENEMPTY": "Used to control whether callers are made leave the queue when no members are available to take calls", - "ANNOUNCEFREQUENCY": "How often to announce the caller’s position and/or estimated hold time in the queue (zero to disable)", - "MINANNOUNCEFREQUENCY": "Minimum announcement frequency (useful when the caller’s position changes frequently)", - "PERIODICANNOUNCEFREQUENCY": "Frequency of periodic announcements to the caller", - "ANNOUNCEPOSITIONLIMIT": "Used if announce-position is defined as either 'limit' or 'more'", - "AFTERCALLWORKDURATION": "Pause length triggered by the After Call Work option", - "MEMBERDELAY": "Inserts a delay prior to the caller and agent in queue get connected", - "MUSICONHOLD": "Sets the music class to use for a particular queue", - "ANNOUNCETOAGENT": "Play an announcement to the agent answering the call (typically to let him know what queue the caller is coming from)", - "RANDOMPERIODICANNOUNCE": "If yes, the defined periodic announcements will be played random", - "ANNOUNCEHOLDTIME": "Plays the estimated hold time along with the periodic announcements (Yes/No/Once)", - "ANNOUNCECALLERPOSITION": "Used to define if the caller’s position in the queue should be announced: No=never; Yes=always; Limit=only if it is within the limit defined by announce-position-limit; More= only if it is beyond the value defined by announce-position-limit", - "REPORTHOLDTIMEAGENT": "Enables reporting caller’s hold time to the agent in queue prior to connection", - "PERIODICANNOUNCE": "Set of periodic announcements to be played (in the order)", - "HOLDTIMEANNOUNCE": "Choose a Sound defined in Tools. Default=“Hold time”. Undefined=no announcement", - "YOUARENEXTANNOUNCE": "Choose a Sound defined in Tools. Default=“You are now first in line”. Undefined=no announcement", - "THEREAREANNOUNCE": "Choose a Sound defined in Tools. Default=“There are”. Undefined=no announcement", - "WAITINGCALLSANNOUNCE": "Choose a Sound defined in Tools. Default=“calls waiting”. Undefined=no announcement", - "ESTIMATEDHOLDTIMEANNOUNCE": "Choose a Sound defined in Tools. Default=“The current estimated hold time is”. Undefined=no announcement", - "MINUTESANNOUNCE": "Choose a Sound defined in Tools. Default=“minutes”. Undefined=no announcement", - "MINUTEANNOUNCE": "Choose a Sound defined in Tools. Default=“minute”. Undefined=no announcement", - "SECONDSANNOUNCE": "Choose a Sound defined in Tools. Default=“seconds”. Undefined=no announcement", - "THANKYOUANNOUNCE": "Choose a Sound defined in Tools. Default=“Thank you for your patience”. Undefined=no announcement", - "AFTERCALLWORK": "If enabled, the agent will be set on Pause after completing a call", - "AUTOPAUSE": "Enables/disables the automatic pause of agents who fail to answer a call. If enabled it causes the agent to be paused in all queues he belongs to", - "RINGINUSE": "To avoid/allow sending calls to members whose status is In Use", - "TIMEOUTRESTART": "If yes, this resets the timeout for an agent to answer when either a BUSY or CONGESTION status is received from the channel", - "MONITORFORMAT": "Specifies the format of the recording file. If it set to 'inactive', calls will not be recorded", - "CONTEXT": "Allows a caller to exit the queue by pressing a single DTMF digit. If a context is specified and the caller enters a number, that digit will attempt to be matched in the context specified, and dialplan execution will continue there", - "SETINTERFACEVARIABLES": "If set to yes, just prior to the caller being connected with a queue agent some variables will be set (for more information see wiki docs)", - "SETQUEUEVARIABLES": "If set to yes, just prior to the caller being connected with a queue agent and leaving the queue, some variables will be set (for more information, see wiki docs)", - "SETQUEUEENTRYVARIABLES": "If set to yes, just prior to the caller being connected with a queue agent some variables will be set (for more information, see wiki docs)", - "RECORDING": "Enable call recording", - "VOICEMAIL_CONTEXT": "The context of the relative extension", - "NAME": "Only numbers, letters and specific characters (._) are supported", - "CALLERIDALL": "Supported format: \"CallerId\" <number>", - "CALLER_ID": "Supported format: \"CallerId\" <number>", - "MANDATORYDISPOSITIONPAUSEID": "Pause status to set during mandatory disposition", - "SERVICELEVEL": "Second settings for service level (default=0, no SL). Used for service level statistics (calls answered within service level time frame)", - "SAVE_ROUTES": "The routing has been modified. Remember to save if you don't want to lose your changes." + "TIMEOUT": "Broj sekundi koliko se poziva Specijalista u queue", + "MAXLENGTH": "Maksimalan broj pozivatelja koji mogu čekati u queue (0 = neograničeno)", + "RETRY": "Koliko dugo (u sekundama) treba čekati prije pozivanja sljedećeg Specijaliste u queue kada Specijalistin timeout istekne", + "WRAPUPTIME": "Koliko dugo (u sekundama) treba zadržati Specijalistu nedostupnim u queue nakon završetka poziva", + "WEIGHT": "Koristi se za određivanje prioriteta ako su Specijalisti povezani s više od jednog queue", + "JOINWHENEMPTY": "Ako je pozivatelj dodan u queue, kada nema dostupnih Specijalista", + "LEAVEWHENEMPTY": "Ako je pozivatelj izbačen iz queue kada nema dostupnih Specijalista", + "ANNOUNCEFREQUENCY": "Koliko često najavljivati poziciju pozivaoca i/ili procjenjeno vrijeme čekanja u queue (0=onemogućeno)", + "MINANNOUNCEFREQUENCY": "Minimalna učestalost najava (korisno kada se pozicija pozivatelja često mijenja)", + "PERIODICANNOUNCEFREQUENCY": "Učestalost periodičnih najava pozivatelju", + "ANNOUNCEPOSITIONLIMIT": "Koristi se ako ste definisali poziciju najave kao 'ograničenje' ili 'više'", + "AFTERCALLWORKDURATION": "Dužina pauze koju pokreće opcija Nakon Poziva Posao", + "MEMBERDELAY": "Unosi odgodu prije nego što se pozivatelj i Specijalista u queue se povežu", + "MUSICONHOLD": "Postavlja muzičku klasu za korištenje u određeni queue", + "ANNOUNCETOAGENT": "Reproducira najavu Specijaliste koji odgovara na poziv (npr. da bi ga obavijestio iz kojeg queue pozivatelj dolazi)", + "RANDOMPERIODICANNOUNCE": "Ako je da, reproducira periodične najave slučajnim redoslijedom", + "ANNOUNCEHOLDTIME": "Reproducira procijenjeno vrijeme čekanja zajedno s periodičnim najavama (Da/Ne/Jednom)", + "ANNOUNCECALLERPOSITION": "Koristi se za definisanje da li treba najaviti poziciju pozivatelja u queue: Ne=nikada; Da=uvijek; Limit=samo ako je unutar ograničenja definisanog sa announce-position-limit; Više=samo ako je preko vrijednosti definisane sa announce-position-limit", + "REPORTHOLDTIMEAGENT": "Omogućuje izvještavanje o vremenu čekanja pozivatelja Specijalisti u queue prije povezivanja", + "PERIODICANNOUNCE": "Set periodičnih najava koje će se puštati (po redoslijedu)", + "HOLDTIMEANNOUNCE": "Odaberi Zvuk definisan u Alatima. Zadano=\"Vrijeme čekanja\". Nedefinisano=bez najave", + "YOUARENEXTANNOUNCE": "Odaberite Zvuk definiram u Alatima. Zadano=\"Sada ste prvi u redu\". Nedifinirano=bez najave", + "THEREAREANNOUNCE": "Odaberite Zvuk definisan u Alatima. Zadano=\"Ispred su\". Nedefinisano=bez najave", + "WAITINGCALLSANNOUNCE": "Odaberide Zvuk definiran u Alatima. Zadano=\"pozivi na čekanju\". Nedifinirano=bez najave", + "ESTIMATEDHOLDTIMEANNOUNCE": "Odaberi Zvuk definisan u Alatima. Zadano=\"Trenutno procijenjeno vrijeme čekanja je\". Nedefinisano=bez najave", + "MINUTESANNOUNCE": "Odaberite Zvuk definisan u Alatima. Zadano=“minute”. Nedefinisano=bez najave", + "MINUTEANNOUNCE": "Odaberite Zvuk definisan u Alatima. Zadano=“minute”. Nedefinisano=bez najave", + "SECONDSANNOUNCE": "Odaberi Zvuk definisan u Alatima. Zadano=\"sekunde\". Nedefinisano=bez najave", + "THANKYOUANNOUNCE": "Odaberite Zvuk definisan u Alatima. Zadano=\"Hvala Vam na strpljenju\". Nedefinisano=bez najave", + "AFTERCALLWORK": "Ako je omogućeno, Specijalist će biti postavljen na pauzu nakon završetka poziva", + "AUTOPAUSE": "Omogućava/onemogućava automatsku pauzu Specijaliste koji ne odgovaraju na poziv. Ako je omogućeno, to uzrokuje da Specijalista bude pauziran u svim queue kojima pripada", + "RINGINUSE": "Za izbjegavanje/dozvoljavanje slanja poziva članovima čiji je status U Upotrebi", + "TIMEOUTRESTART": "Ako je da, ovo restartuje timeout za Specijalistu da odgovori kada je ili Zauzet ili Zagušen status primljen od kanala", + "MONITORFORMAT": "Određuje format datoteke koji će se koristiti prilikom snimanja. Ako je format monitora neaktivan, pozivi se neće snimati", + "CONTEXT": "Omogućava pozivatelju da napusti queue pritiskom na jednu DTMF cifru. Ako je kontekst određen i pozivatelj unese broj, ta cifra će se pokušati upariti u određenom kontekstu, a izvršavanje plana biranja će se tamo nastaviti.", + "SETINTERFACEVARIABLES": "Ako je da, neposredno prije povezivanja pozivatelja sa Specijalistom queue neke varijable će biti postavljene (za više informacija pogledaj wiki dokumente:kliknite ovdje)", + "SETQUEUEVARIABLES": "Ako je da, neposredno prije povezivanja pozivatelja sa Specijalistom queue i napusti queue neke varijable će biti postavljene (za više informacija pogledaj wiki dokumente:kliknite ovdje)", + "SETQUEUEENTRYVARIABLES": "Ako je da, neposredno prije povezivanja pozivatelja sa Specijalistom queue neke varijable će biti postavljene (za više informacija pogledaj wiki dokumente:kliknite ovdje)", + "RECORDING": "Omogući snimanje poziva", + "VOICEMAIL_CONTEXT": "Kontekst relativne ekstenzije", + "NAME": "Samo brojevi, slova i specifični znakovi (._) su podržani", + "CALLERIDALL": "Podržan format: \"CallerId\" ", + "CALLER_ID": "Podržan format: \"CallerId\" ", + "MANDATORYDISPOSITIONPAUSEID": "Status pauze za postavljanje tokom obavezne dispozicije", + "SERVICELEVEL": "Druga podešavanja za nivo servisa (zadano=0, bez SL). Koristi se za statistiku nivoa servisa (odgovoreni pozivi unutar vremenskog okvira nivoa servisa \"SLA\")", + "SAVE_ROUTES": "Rutiranje je izmijenjeno. Ne zaboravi da sačuvaš ako ne želiš da izgubiš promijene." }, "NOTIFICATIONS": { - "EXTENSION_CREATED_SUCCESS_TITLE": "Route successfully created", - "EXTENSION_SAVED_SUCCESS_TITLE": "Route successfully saved", - "EXTENSION_DELETE_TITLE": "Are you sure want to delete the route?", - "EXTENSION_DELETE_MESSAGE": "{{ name }} will be deleted", - "EXTENSION_DELETED_SUCCESS_TITLE": "Route successfully deleted", - "EXTENSIONS_DELETE_TITLE": "Are you sure want to delete the selected routes?", - "EXTENSIONS_DELETE_MESSAGE": "{{ total }} routes will be deleted", - "ROUTING_APPLICATION_DELETE_TITLE": "Are you sure want to delete the application?", - "ROUTING_APPLICATION_DELETE_MESSAGE": "{{ name }} will be deleted", - "ROUTING_APPLICATIONS_DELETE_TITLE": "Are you sure want to delete the selected applications?", - "ROUTING_APPLICATIONS_DELETE_MESSAGE": "{{ total }} applications will be deleted", - "CALLYSQUARE_PROJECTS_GET_ERROR": "Unable to retrieve any CallySquare project", - "TRUNKS_GET_ERROR": "Unable to retrieve any trunk", - "VOICE_CONTEXTS_GET_ERROR": "Unable to retrieve any voice context", - "QUEUES_GET_ERROR": "Unable to retrieve any queue", - "SOUNDS_GET_ERROR": "Unable to retrieve any sound", - "USERS_GET_ERROR": "Unable to retrieve any user", - "VARIABLES_GET_ERROR": "Unable to retrieve any variable", - "VOICEMAILS_GET_ERROR": "Unable to retrieve any voicemail", - "TAGS_GET_ERROR": "Unable to retrieve any tag", - "INTERVALS_GET_ERROR": "Unable to retrieve any interval" - } + "EXTENSION_CREATED_SUCCESS_TITLE": "Ruta uspješno kreirana", + "EXTENSION_SAVED_SUCCESS_TITLE": "Ruta je uspješno sačuvana", + "EXTENSION_DELETE_TITLE": "Jesi li siguran da želiš izbrisati rutu?", + "EXTENSION_DELETE_MESSAGE": "{{ name }} će biti izbrisan", + "EXTENSION_DELETED_SUCCESS_TITLE": "Ruta uspješno izbrisana", + "EXTENSIONS_DELETE_TITLE": "Jesi li siguran da želiš izbrisati odabrane rute?", + "EXTENSIONS_DELETE_MESSAGE": "{{ total }} ruta će biti izbrisano", + "ROUTING_APPLICATION_DELETE_TITLE": "Jesi li siguran da želiš izbrisati aplikaciju?", + "ROUTING_APPLICATION_DELETE_MESSAGE": "{{ name }} će biti izbrisano", + "ROUTING_APPLICATIONS_DELETE_TITLE": "Jesi li siguran da želiš izbrisati odabrane aplikacije?", + "ROUTING_APPLICATIONS_DELETE_MESSAGE": "{{ total }} aplikacija će biti izbrisao", + "CALLYSQUARE_PROJECTS_GET_ERROR": "Nije moguće pozvati bilo koji CallySquare projekat", + "TRUNKS_GET_ERROR": "Nije moguće pozvati bilo koji trunk", + "VOICE_CONTEXTS_GET_ERROR": "Nije moguće pozvati bilo kakav voice kontekst", + "QUEUES_GET_ERROR": "Nije moguće pozvati bilo koji queue", + "SOUNDS_GET_ERROR": "Nije moguće pozvati nikakav zvuk", + "USERS_GET_ERROR": "Nije moguće pozvati nijednog korisnika", + "VARIABLES_GET_ERROR": "Nije moguće pozvati nijednu varijablu", + "VOICEMAILS_GET_ERROR": "Nije moguće pozvati govornu poštu", + "TAGS_GET_ERROR": "Nije moguće pozvati nijedan tag", + "INTERVALS_GET_ERROR": "Nije moguće pozvati bilo koji interval", + "CALL_HANGUP_SUCCESS": "Poziv je uspješno prekinuo vezu", + "CALL_REDIRECT_SUCCESS": "Poziv je uspješno preusmjeren" + }, + "CALL_NUMBER_REDIRECT": "Na koji broj želite preusmjeriti poziv?", + "NO_AGENT_AVAILABLE": "Nema raspoloživog agenta" } } diff --git a/public/app/main/apps/voice/i18n/cs.json b/public/app/main/apps/voice/i18n/cs.json index acf12e0..8da2a19 100644 --- a/public/app/main/apps/voice/i18n/cs.json +++ b/public/app/main/apps/voice/i18n/cs.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "Přidat tým k předponě", "ALIAS": "Alias", "MAXCAPACITY": "Maximální kapacita", - "WORKING": "Pracovní" + "WORKING": "Pracovní", + "CALL_NUMBER_REDIRECT": "Na jaké číslo chcete hovor přesměrovat?", + "NO_AGENT_AVAILABLE": "Žádný agent není k dispozici" } } diff --git a/public/app/main/apps/voice/i18n/da.json b/public/app/main/apps/voice/i18n/da.json index d178808..e16b6e8 100644 --- a/public/app/main/apps/voice/i18n/da.json +++ b/public/app/main/apps/voice/i18n/da.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "Føj team til præfiks", "ALIAS": "Alias", "MAXCAPACITY": "Max kapacitet", - "WORKING": "Arbejder" + "WORKING": "Arbejder", + "CALL_NUMBER_REDIRECT": "Hvilket nummer vil du omdirigere opkaldet til?", + "NO_AGENT_AVAILABLE": "Ingen tilgængelig agent" } } diff --git a/public/app/main/apps/voice/i18n/de.json b/public/app/main/apps/voice/i18n/de.json index 832ae56..b2a2d0e 100644 --- a/public/app/main/apps/voice/i18n/de.json +++ b/public/app/main/apps/voice/i18n/de.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "Team zum Präfix hinzufügen", "ALIAS": "Alias", "MAXCAPACITY": "Max. Kapazität erreicht", - "WORKING": "am Arbeiten" + "WORKING": "am Arbeiten", + "CALL_NUMBER_REDIRECT": "Auf welche Nummer möchten Sie den Anruf umleiten?", + "NO_AGENT_AVAILABLE": "Kein Agent verfügbar" } } diff --git a/public/app/main/apps/voice/i18n/es.json b/public/app/main/apps/voice/i18n/es.json index d815a36..c6497be 100644 --- a/public/app/main/apps/voice/i18n/es.json +++ b/public/app/main/apps/voice/i18n/es.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "Agregar equipo al prefijo", "ALIAS": "Alias", "MAXCAPACITY": "máxima capacidad", - "WORKING": "Laboral" + "WORKING": "Laboral", + "CALL_NUMBER_REDIRECT": "¿A qué número desea redirigir la llamada?", + "NO_AGENT_AVAILABLE": "Ningún agente disponible" } } diff --git a/public/app/main/apps/voice/i18n/et.json b/public/app/main/apps/voice/i18n/et.json index fe28adb..409e74d 100644 --- a/public/app/main/apps/voice/i18n/et.json +++ b/public/app/main/apps/voice/i18n/et.json @@ -477,6 +477,10 @@ "SECOND_LEVEL_DISPOSITION": "Teise taseme korraldus", "THIRD_LEVEL_DISPOSITION": "Kolmanda taseme korraldus", "TEAMADD_VOICEPREFIX": "Lisa meeskond eesliidesse", - "ALIAS": "Teise nimega" + "ALIAS": "Teise nimega", + "CALL_NUMBER_REDIRECT": "Millisele numbrile soovite kõne ümber suunata?", + "MAXCAPACITY": "Maksimaalne mahutavus", + "NO_AGENT_AVAILABLE": "Agent pole saadaval", + "WORKING": "Töötab" } } diff --git a/public/app/main/apps/voice/i18n/fa.json b/public/app/main/apps/voice/i18n/fa.json index eed1435..71e049b 100644 --- a/public/app/main/apps/voice/i18n/fa.json +++ b/public/app/main/apps/voice/i18n/fa.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "اضافه کردن تیم به پیشوند", "ALIAS": "نام مستعار", "MAXCAPACITY": "حداکثر ظرفیت", - "WORKING": "کار کردن" + "WORKING": "کار کردن", + "CALL_NUMBER_REDIRECT": "می‌خواهید تماس را به کدام شماره تغییر مسیر دهید؟", + "NO_AGENT_AVAILABLE": "هیچ عاملی در دسترس نیست" } } diff --git a/public/app/main/apps/voice/i18n/fi.json b/public/app/main/apps/voice/i18n/fi.json index 3745db0..8b5f5c1 100644 --- a/public/app/main/apps/voice/i18n/fi.json +++ b/public/app/main/apps/voice/i18n/fi.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "Lisää joukkue etuliitteeseen", "ALIAS": "Alias", "MAXCAPACITY": "Max kapasiteetti", - "WORKING": "Työskentely" + "WORKING": "Työskentely", + "CALL_NUMBER_REDIRECT": "Mihin numeroon haluat ohjata puhelun?", + "NO_AGENT_AVAILABLE": "Agenttia ei ole saatavilla" } } diff --git a/public/app/main/apps/voice/i18n/fr.json b/public/app/main/apps/voice/i18n/fr.json index 627cf9d..7e3461e 100644 --- a/public/app/main/apps/voice/i18n/fr.json +++ b/public/app/main/apps/voice/i18n/fr.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "Ajouter une équipe au préfixe", "ALIAS": "Alias", "MAXCAPACITY": "capacité maximale", - "WORKING": "Travail" + "WORKING": "Travail", + "CALL_NUMBER_REDIRECT": "Vers quel numéro souhaitez-vous rediriger l'appel ?", + "NO_AGENT_AVAILABLE": "Aucun agent disponible" } } diff --git a/public/app/main/apps/voice/i18n/he.json b/public/app/main/apps/voice/i18n/he.json index 84f003f..feefd95 100644 --- a/public/app/main/apps/voice/i18n/he.json +++ b/public/app/main/apps/voice/i18n/he.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "הוסף צוות לקידומת", "ALIAS": "כינוי", "MAXCAPACITY": "קיבולת מקסימלית", - "WORKING": "עובד" + "WORKING": "עובד", + "CALL_NUMBER_REDIRECT": "לאיזה מספר אתה רוצה להפנות את השיחה?", + "NO_AGENT_AVAILABLE": "אין סוכן זמין" } } diff --git a/public/app/main/apps/voice/i18n/hi.json b/public/app/main/apps/voice/i18n/hi.json index 1fa63c5..fcd8f49 100644 --- a/public/app/main/apps/voice/i18n/hi.json +++ b/public/app/main/apps/voice/i18n/hi.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "उपसर्ग में टीम जोड़ें", "ALIAS": "उपनाम", "MAXCAPACITY": "अधिकतम क्षमता", - "WORKING": "काम में हो" + "WORKING": "काम में हो", + "CALL_NUMBER_REDIRECT": "आप कॉल को किस नंबर पर रीडायरेक्ट करना चाहते हैं?", + "NO_AGENT_AVAILABLE": "कोई एजेंट उपलब्ध नहीं" } } diff --git a/public/app/main/apps/voice/i18n/hu.json b/public/app/main/apps/voice/i18n/hu.json index 28d2655..5469f61 100644 --- a/public/app/main/apps/voice/i18n/hu.json +++ b/public/app/main/apps/voice/i18n/hu.json @@ -501,7 +501,11 @@ "VARIABLES_GET_ERROR": "Unable to retrieve any variable", "VOICEMAILS_GET_ERROR": "Unable to retrieve any voicemail", "TAGS_GET_ERROR": "Unable to retrieve any tag", - "INTERVALS_GET_ERROR": "Unable to retrieve any interval" - } + "INTERVALS_GET_ERROR": "Unable to retrieve any interval", + "CALL_HANGUP_SUCCESS": "Sikeresen bontotta a hívást", + "CALL_REDIRECT_SUCCESS": "A hívás átirányítása sikeresen megtörtént" + }, + "CALL_NUMBER_REDIRECT": "Melyik számra szeretné átirányítani a hívást?", + "NO_AGENT_AVAILABLE": "Nincs elérhető ügynök" } } diff --git a/public/app/main/apps/voice/i18n/id.json b/public/app/main/apps/voice/i18n/id.json index 3c7b0cc..fa04692 100644 --- a/public/app/main/apps/voice/i18n/id.json +++ b/public/app/main/apps/voice/i18n/id.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "Tambahkan Tim ke Awalan", "ALIAS": "Alias", "MAXCAPACITY": "kapasitas maksimum", - "WORKING": "Bekerja" + "WORKING": "Bekerja", + "CALL_NUMBER_REDIRECT": "Nomor mana yang ingin Anda alihkan panggilannya?", + "NO_AGENT_AVAILABLE": "Tidak ada agen yang tersedia" } } diff --git a/public/app/main/apps/voice/i18n/is.json b/public/app/main/apps/voice/i18n/is.json new file mode 100644 index 0000000..cb5e0a9 --- /dev/null +++ b/public/app/main/apps/voice/i18n/is.json @@ -0,0 +1,511 @@ +{ + "VOICE": { + "SECOND_LEVEL_DISPOSITION": "Second Level Disposition", + "THIRD_LEVEL_DISPOSITION": "Third Level Disposition", + "FAILUREREASON": "Failure reason", + "TEXT": "Text", + "DOWNLOADTRANSCRIBE_VOICERECORDING": "Download Transcript", + "INBOUND": "Inbound", + "OUTBOUND": "Outbound", + "DIALER": "Dialer", + "LOGIN_TIME": "Login time", + "PAUSE_TIME": "Pause time", + "ABANDONEDCALLS": "Abandoned Queue Calls", + "WAITING_FOR_AGENTS": "Waiting for agents", + "ACTIVE": "Active", + "NO_AGENT_ONLINE": "No Agent Online", + "PARTIALPAUSE": "Partial Pause", + "STATUS": "Status", + "TIMER": "Timer", + "ALIAS": "Alias", + "ALL": "All", + "IDLE": "Idle", + "EDIT_TRUNK": "Edit Trunk", + "GOTO_VOICEQUEUE": "Go To Realtime Voice Queues", + "GOTOREALTIME_VOICEQUEUE": "Go To Realtime Voice Queues", + "NAME": "Name", + "LOGOUT": "Logout", + "VOICEQUEUES": "Voice Queues", + "SEARCH_FOR_ANYONE": "Search", + "BACK": "Back", + "SELECTED": "Selected", + "SELECT_ALL": "Select All", + "SELECT_NONE": "Select None", + "DELETE_VOICEDISPOSITION": "Delete Voice Disposition", + "EDIT_VOICEDISPOSITION": "Edit Voice Disposition", + "EDIT_VOICEQUEUE": "Edit Voice Queue", + "DELETE_VOICEQUEUE": "Delete Voice Queue", + "MOHSOUNDS": "Moh Sounds", + "STRATEGY": "Strategy", + "DESCRIPTION": "Description", + "ADD_VOICEQUEUE": "Add Voice Queue", + "CREATED_AT": "Created At", + "CANT_PLAY_GSM_AUDIO_FILES": "Can't play gsm or wav49 audio files", + "APPLICATIONS_LIST": "Applications List", + "GENERAL": "General", + "TIMEOUT": "Timeout", + "MAXLENGTH": "Maximum Length", + "RETRY": "Retry", + "WRAPUPTIME": "Wrapup Time", + "WEIGHT": "Weight", + "JOINWHENEMPTY": "Join when empty", + "LEAVEWHENEMPTY": "Leave when empty", + "MUSICONHOLD": "Music On Hold", + "ANNOUNCETOAGENT": "Announce To Agent", + "ANNOUNCEMENTS": "Announcements", + "ADVANCED": "Advanced", + "ANNOUNCEFREQUENCY": "Announce Frequency", + "MINANNOUNCEFREQUENCY": "Minimum Announce Frequency", + "PERIODICANNOUNCEFREQUENCY": "Periodic Announce Frequency", + "RANDOMPERIODICANNOUNCE": "Random Periodic Announce", + "ANNOUNCEHOLDTIME": "Announce Hold Time", + "ANNOUNCECALLERPOSITION": "Announce Caller Position", + "ANNOUNCEPOSITIONLIMIT": "Announce Position Limit", + "REPORTHOLDTIMEAGENT": "Report Agent Hold Time", + "PERIODICANNOUNCE": "Periodic Announce", + "HOLDTIMEANNOUNCE": "Hold Time Announce", + "YOUARENEXTANNOUNCE": "'You are next' Announce", + "THEREAREANNOUNCE": "'There are' Announce", + "WAITINGCALLSANNOUNCE": "Waiting Calls Announce", + "ESTIMATEDHOLDTIMEANNOUNCE": "Estimated Hold Time Announce", + "MINUTESANNOUNCE": "Minutes Announce", + "MINUTEANNOUNCE": "Minute Announce", + "SECONDSANNOUNCE": "Seconds Announce", + "THANKYOUANNOUNCE": "'Thank You' Announce", + "AUTOPAUSE": "Auto Pause", + "AFTERCALLWORK": "After Call Work", + "AFTERCALLWORKDURATION": "After Call Work Duration", + "RINGINUSE": "Ring In Use", + "MEMBERDELAY": "Member Delay", + "TIMEOUTRESTART": "Timeout Restart", + "MONITORFORMAT": "Recording Format", + "SETINTERFACEVARIABLES": "Set Interface Variables", + "SETQUEUEVARIABLES": "Set Queue Variables", + "SETQUEUEENTRYVARIABLES": "Set Queue Entry Variables", + "VARIABLE": "Variable", + "CONTEXT": "Context", + "SAVE": "Save", + "SETTINGS": "Settings", + "INBOUNDROUTES": "Inbound Routes", + "PHONENUMBER": "Phone Number", + "ADD_INBOUNDROUTE": "Add Inbound Route", + "EDIT_INBOUNDROUTE": "Edit Inbound Route", + "DELETE_INBOUNDROUTE": "Delete Inbound Route", + "ACTIONS": "Actions", + "OUTBOUNDROUTES": "Outbound Routes", + "DESTINATIONPATTERN": "Destination Pattern", + "ADD_OUTBOUNDROUTE": "Add Outbound Route", + "EDIT_OUTBOUNDROUTE": "Edit Outbound Route", + "DELETE_OUTBOUNDROUTE": "Delete Outbound Route", + "CUTDIGITS": "Cut Digits", + "RECORDING": "Recording", + "RECORDINGFORMAT": "Recording format", + "INTERNALROUTES": "Internal Routes", + "ADD_INTERNALROUTE": "Add Internal Route", + "EDIT_INTERNALROUTE": "Edit Internal Route", + "DELETE_INTERNALROUTE": "Delete Internal Route", + "CONTEXTS": "Contexts", + "ADD_CONTEXT": "Add Context", + "EDIT_CONTEXT": "Edit Context", + "DELETE_CONTEXT": "Delete Context", + "VOICEMAILS": "Voicemails", + "ADD_VOICEMAIL": "Add Voicemail", + "EDIT_VOICEMAIL": "Edit Voicemail", + "DELETE_VOICEMAIL": "Delete Voicemail", + "FULLNAME": "Full Name", + "EMAIL": "Email", + "MAILBOX": "Mailbox", + "PASSWORD": "Password", + "CONFIRM_PASSWORD": "Confirm Password", + "TIMEZONE": "Timezone", + "ATTACH": "Attach", + "ENVELOPE": "Envelope", + "DELETE": "Delete", + "EMAILBODY": "Email Body", + "EMAILSUBJECT": "Email Subject", + "MAXSECONDS": "Max Seconds", + "MAXMESSAGES": "Max Messages", + "MESSAGES": "Messages", + "SORT": "Sort", + "ADD_MUSICONHOLD": "Add Music On Hold", + "MUSICONHOLDS": "Music On Hold", + "EDIT_MUSICONHOLD": "Edit Music On Hold", + "DELETE_MUSICONHOLD": "Delete Music On Hold", + "DIRECTORY": "Directory", + "AUDIOFILES": "Audio Files", + "RECORDINGS": "Recordings", + "CHANSPY": "ChanSpy", + "PREFIX": "Prefix", + "OPTIONS": "Options", + "AUTH": "Auth", + "ADD_CHANSPY": "Add ChanSpy", + "EDIT_CHANSPY": "Edit ChanSpy", + "DELETE_CHANSPY": "Delete ChanSpy", + "AGENTS": "Agents", + "TELEPHONES": "Telephones", + "QUEUES": "Queues", + "QUEUE_CALLS": "Queue Calls", + "QUEUE_PARAMETERS": "Queue Parameters", + "ABANDONED_CALLS": "Abandoned Calls", + "OUTBOUND_CALLS": "Outbound Calls", + "AGI": "Agi", + "DIAL": "Dial", + "CALLYSQUARE": "CallySquare", + "INTERNALDIAL": "Internal Dial", + "EXTERNALDIAL": "External Dial", + "RINGGROUP": "Ring Group", + "PLAYBACK": "Playback", + "QUEUE": "Queue", + "SET": "Set", + "VOICEMAIL": "Voicemail", + "GOTO": "GoTo", + "HANGUP": "Hangup", + "CUSTOM": "Custom", + "PROJECT": "Cally-Square Project", + "TECHNOLOGY/RESOURCE": "Technology/Resource", + "URL": "URL", + "EDIT_APP": "Edit Application", + "EDIT_INTERVAL": "Edit Interval", + "DELETE_APP": "Delete Application", + "INTERVALS": "Intervals", + "USER": "User", + "TRUNK": "Trunk", + "PHONE": "Phone", + "AUDIO_FILES": "Audio Files", + "ANNOUNCE_OVERRIDES": "Announce Overrides", + "MACRO": "Macro", + "GOSUB": "GoSub", + "RULE": "Rule", + "POSITION": "Position", + "ANSWER": "Answer", + "VALUE": "Value", + "MAILBOX@CONTEXT": "Mailbox@Context", + "EXTENSION": "Extension", + "PRIORITY": "Priority", + "HANGUP_CAUSE": "Hangup Cause", + "OUTBOUNDDIAL": "Outbound Dial", + "CALLER_ID": "Caller ID", + "NO_MESSAGE_AVAILABLE": "No messages available", + "NO_SOUND_AVAILABLE": "No sounds available", + "VOICERECORDINGS": "Voice Recordings", + "CHANSPIES": "ChanSpy", + "VOICE": "Voice", + "REALTIME": "Realtime", + "ID": "Id", + "VOICEMAIL_CONTEXT": "Context", + "NO_MOHSOUND_AVAILABLE": "No Music On Hold available", + "FILE": "File", + "ADD_MOHSOUND": "Add Music On Hold sound", + "DOWNLOAD_MOHSOUND": "Download Music On Hold sound", + "DELETE_MOHSOUND": "Delete Music On Hold sound", + "UNIQUEID": "Unique ID", + "AGENT": "Agent", + "TYPE": "Type", + "RATING": "Rating", + "AUDIO": "Audio", + "DATE": "Date", + "NEW_VOICEQUEUE": "New Voice Queue", + "NEW_INBOUNDROUTE": "New Inbound Route", + "NEW_OUTBOUNDROUTE": "New Outbound Route", + "NEW_INTERNALROUTE": "New Internal Route", + "NEW_CONTEXT": "New Context", + "NEW_VOICEMAIL": "New Voicemail", + "NEW_MUSICONHOLD": "New Music On Hold", + "NEW_CHANSPY": "New ChanSpy", + "PENALTY": "Penalty", + "ADD_TEAM_TO_VOICEQUEUE": "Add Team to Voice Queue", + "ADD_AGENT_TO_VOICEQUEUE": "Add Agent to Voice Queue", + "EDIT_DIAL": "Edit Dial", + "EDIT_AGI": "Edit AGI", + "EDIT_INTERNALDIAL": "Edit Internal Dial", + "EDIT_EXTERNALDIAL": "Edit External Dial", + "EDIT_RINGGROUP": "Edit Ring Group", + "EDIT_PLAYBACK": "Edit Playback", + "EDIT_QUEUE": "Edit Queue", + "EDIT_SET": "Edit Set", + "EDIT_GOTO": "Edit GoTo", + "EDIT_HANGUP": "Edit Hangup", + "EDIT_CUSTOM": "Edit Custom", + "DURATION": "Duration", + "RECEIVED_AT": "Received At", + "YES": "Yes", + "NO": "No", + "HANGUPCAUSE_1": "1 = Unallocated number", + "HANGUPCAUSE_16": "16 = Normal call clearing", + "HANGUPCAUSE_17": "17 = User busy", + "HANGUPCAUSE_18": "18 = No user responding (telehone device not connected)", + "HANGUPCAUSE_21": "21 = Call rejected", + "HANGUPCAUSE_22": "22 = Number changed", + "HANGUPCAUSE_27": "27 = Destination out of order", + "HANGUPCAUSE_38": "38 = Network out of order", + "HANGUPCAUSE_41": "41 = Temporary failure", + "RANDOM": "Random", + "ALPHABETICAL": "Alphabetical", + "NO_APPS_AVAILABLE": "No applications available", + "DOWNLOAD_VOICERECORDING": "Download Voice Recording", + "DELETE_VOICERECORDING": "Delete Voice Recording", + "INTERNAL": "Internal", + "PHONE_STATE": "Phone State", + "PHONE_STATUS": "Phone Status", + "TRUNK_STATUS": "Trunk Status", + "REGISTERED": "Registered", + "UNREGISTERED": "Unregistered", + "LAGGED": "Lagged", + "REACHABLE": "Reachable", + "UNREACHABLE": "Unreachable", + "UNKNOWN": "Unknown", + "NOT_INUSE": "Not In Use", + "INUSE": "In Use", + "BUSY": "Busy", + "INVALID": "Invalid", + "UNAVAILABLE": "Unavailable", + "RINGING": "Ringing", + "ONHOLD": "On Hold", + "RING": "Ring", + "UP": "Up", + "INFO": "Info", + "TRUNKS": "Trunks", + "REGISTRY": "Registry", + "NO_REGISTRY": "No Registry", + "LOGGED_IN": "Logged In (SIP Connected)", + "PAUSED": "Paused", + "WAITING": "Waiting", + "TALKING": "Talking", + "DID": "DID", + "CALLER": "Caller", + "TOTAL": "Total", + "ANSWERED": "Answered", + "ABANDONED": "Abandoned", + "UNMANAGED": "Unmanaged", + "AVG_HOLD_TIME": "Avg Hold Time", + "AVG_DURATION": "Av Duration", + "AVG_BILLABLE": "Avg Billable", + "SOURCE": "Source", + "DESTINATION": "Destination", + "REJECTED": "Rejected", + "FAILED": "Failed", + "CALLED": "Called", + "CONNECTED": "Connected", + "NO_RATING": "No rating", + "EDIT_VOICERECORDING": "Edit Voice Recording", + "APPLICATION_NAME": "Application Name", + "ARGUMENTS": "Arguments", + "NO_AVAILABLE_INFO": "No Available Info", + "ADD_AGENT_TO_QUEUE": "Add Agent To Queue", + "DEFAULT_PAUSE": "DEFAULT PAUSE", + "PAUSE": "Pause", + "UNPAUSE": "End Pause", + "REDIRECT_TO_NUMBER": "Redirect To Number", + "REDIRECT_TO_AGENT": "Redirect To Agent", + "AGENTADD_VOICEQUEUE": "Add Agent To Voice Queue", + "APPLICATION": "Application", + "FILES": "Files", + "FORMAT": "Format", + "MODE": "Mode", + "RECORD": "Record", + "TEAMADD_VOICEQUEUE": "Add Team To Voice Queue", + "NEW_MOHSOUND": "New Music On Hold sound", + "DOWNLOAD_MESSAGE": "Download", + "DELETE_MESSAGE": "Delete", + "QUEUE_PARAMS": "Queue Parameters", + "TOTAL_OFFERED": "Total Offered", + "READY": "Ready", + "AGENTADD_QUEUE": "Add Agent To Voice Queue", + "AGENTSADD_QUEUE": "Add Agents To Voice Queue", + "ALL_TEAMS": "All Teams", + "SELECTED_TEAMS": "Selected Teams", + "ALL_AGENTS": "All Agents", + "SELECTED_AGENTS": "Selected Agents", + "CLOSING": "Closing", + "TAGS": "Tags", + "WAITING_FOR_AGENT": "Waiting For Agents", + "EDIT_OUTBOUNDDIAL": "Edit Outbound Dial", + "ACCOUNTNAME": "Account Name", + "PAGE": "Page", + "ROWSPERPAGE": "Rows per page", + "OF": "of", + "DISPOSITION": "Disposition", + "CHAT": "Chat", + "MAIL": "Email", + "SMS": "SMS", + "OPENCHANNEL": "Open Channel", + "FAX": "Fax", + "CLEAR": "Clear", + "CALLS": "Calls", + "STARTEDAT": "Started At", + "ENDEDAT": "Ended At", + "TAG": "Tag", + "DETAILS": "Details", + "BILLABLESECONDS": "Billable seconds", + "ANSWEREDAT": "Answered At", + "NOTE": "Note", + "CLOSE": "Close", + "SELECT_DATE": "Select Start Date", + "SELECT_TYPE": "Select Type", + "VOICEPREFIXES": "Out Prefixes", + "NEW_VOICEPREFIX": "New Prefix", + "ADD_VOICEPREFIX": "Add Prefix", + "EDIT_VOICEPREFIX": "Edit Prefix", + "AGENTADD_VOICEPREFIX": "Add Agent to Prefix", + "TEAMADD_VOICEPREFIX": "Add Team to Prefix", + "DELETE_VOICEPREFIX": "Delete Prefix", + "OUTBOUNDROUTE": "Outbound Route", + "CALLERIDALL": "Caller Id", + "MANDATORYDISPOSITION": "Mandatory disposition", + "MANDATORYDISPOSITIONPAUSEID": "Mandatory disposition pause status", + "SCREENRECORDING": "Manage Screen Recording", + "START_SCREENRECORDING": "Start Screen Recording", + "STOP_SCREENRECORDING": "Stop Screen Recording", + "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", + "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available", + "CANT_DOWNLOAD_THIS_FILE": "Can't download this file", + "WRONG_EXTENSION": "The file presents the wrong extension", + "FILE_NOT_FOUND": "File not found", + "TEAMS_ASSOCIATION": "Teams Association", + "TRANSCRIBE": "Transcribe", + "TRANSCRIPT": "Transcript", + "SENTIMENTANALYSIS": "Sentiment Analysis", + "TRANSCRIBESTATUS_COMPLETED": "Completed", + "TRANSCRIBESTATUS_IN_PROGRESS": "In progress", + "TRANSCRIBESTATUS_FAILED": "Failed", + "TRANSCRIBESTATUS_NEW": "New", + "TRANSCRIPTANALYSIS": "Transcript & Analysis", + "SENTIMENT_POSITIVE": "Positive", + "SENTIMENT_NEGATIVE": "Negative", + "SENTIMENT_NEUTRAL": "Neutral", + "SENTIMENT_MIXED": "Mixed", + "RUNTRANSCRIBE_VOICERECORDING": "Run Transcribe", + "RUNTRANSCRIBESENTIMENT_VOICERECORDING": "Run Transcribe&Sentiment", + "RUNSENTIMENT_VOICERECORDING": "Run Sentiment", + "SENTIMENT": "Sentiment", + "SERVICELEVEL": "Service level", + "MAXCAPACITY": "Max capacity", + "WORKING": "Working", + "NO_AGENT_AVAILABLE": "No agent available", + "CALL_NUMBER_REDIRECT": "Which number do you want to redirect the call to?", + "LEGEND": { + "CUSTOM_APPLICATION": "(*) - Custom application" + }, + "ERRORS": { + "PROJECT_REQUIRED": "Mandatory field", + "TRUNK_REQUIRED": "Mandatory field", + "VARIABLE_REQUIRED": "Mandatory field", + "NAME_REQUIRED": "Mandatory field", + "APPLICATION_NAME_REQUIRED": "Mandatory field", + "TIMEOUT_REQUIRED": "Mandatory field", + "PHONENUMBER_REQUIRED": "Mandatory field", + "CONTEXT_REQUIRED": "Mandatory field", + "DESTINATIONPATTERN_REQUIRED": "Mandatory field", + "FULLNAME_REQUIRED": "Mandatory field", + "EMAIL_REQUIRED": "Mandatory field", + "EMAIL_MUST_VALID": "Wrong format", + "MAILBOX_REQUIRED": "Mandatory field", + "PASSWORD_REQUIRED": "Mandatory field", + "CONFIRM_NOT_MATCH": "The passwords don't match", + "TIMEZONE_REQUIRED": "Mandatory field", + "PREFIX_REQUIRED": "Mandatory field", + "OPTIONS_REQUIRED": "Mandatory field", + "AFTERCALLWORKDURATION_REQUIRED": "Mandatory field", + "TECHNOLOGY/RESOURCE_REQUIRED": "Mandatory field", + "PHONE_REQUIRED": "Mandatory field", + "VALUE_REQUIRED": "Mandatory field", + "EXTENSION_REQUIRED": "Mandatory field", + "PRIORITY_REQUIRED": "Mandatory field", + "APPLICATION_REQUIRED": "Mandatory field", + "OUTBOUNDROUTE_REQUIRED": "Mandatory field", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "MAXLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "ANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "MINANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "PERIODICANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "AFTERCALLWORKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "MEMBERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "POSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "CUTDIGITS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "MAXSECONDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "MAXMESSAGES_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", + "MAXMESSAGES_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", + "NAME_MUST_VALID_PATTERN": "Wrong format", + "CALLERIDALL_MUST_VALID_PATTERN": "Wrong format", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Mandatory field", + "CALLER_ID_MUST_VALID_PATTERN": "Wrong format", + "PENALTY_REQUIRED": "You must specify a value for penalty" + }, + "HELP": { + "TIMEOUT": "How many seconds to ring a device", + "MAXLENGTH": "Maximum number of callers allowed to wait in a queue: zero means unlimited", + "RETRY": "Time in seconds to wait before calling the next agent in queue when the timeout is expired", + "WRAPUPTIME": "Time in seconds to keep a queue member unavailable after completing a call", + "WEIGHT": "Weight of a queue in order to define priority if members are associated with multiple queues", + "JOINWHENEMPTY": "Used to control whether a caller is passed to a queue when no members are available", + "LEAVEWHENEMPTY": "Used to control whether callers are made leave the queue when no members are available to take calls", + "ANNOUNCEFREQUENCY": "How often to announce the caller’s position and/or estimated hold time in the queue (zero to disable)", + "MINANNOUNCEFREQUENCY": "Minimum announcement frequency (useful when the caller’s position changes frequently)", + "PERIODICANNOUNCEFREQUENCY": "Frequency of periodic announcements to the caller", + "ANNOUNCEPOSITIONLIMIT": "Used if announce-position is defined as either 'limit' or 'more'", + "AFTERCALLWORKDURATION": "Pause length triggered by the After Call Work option", + "MEMBERDELAY": "Inserts a delay prior to the caller and agent in queue get connected", + "MUSICONHOLD": "Sets the music class to use for a particular queue", + "ANNOUNCETOAGENT": "Play an announcement to the agent answering the call (typically to let him know what queue the caller is coming from)", + "RANDOMPERIODICANNOUNCE": "If yes, the defined periodic announcements will be played random", + "ANNOUNCEHOLDTIME": "Plays the estimated hold time along with the periodic announcements (Yes/No/Once)", + "ANNOUNCECALLERPOSITION": "Used to define if the caller’s position in the queue should be announced: No=never; Yes=always; Limit=only if it is within the limit defined by announce-position-limit; More= only if it is beyond the value defined by announce-position-limit", + "REPORTHOLDTIMEAGENT": "Enables reporting caller’s hold time to the agent in queue prior to connection", + "PERIODICANNOUNCE": "Set of periodic announcements to be played (in the order)", + "HOLDTIMEANNOUNCE": "Choose a Sound defined in Tools. Default=“Hold time”. Undefined=no announcement", + "YOUARENEXTANNOUNCE": "Choose a Sound defined in Tools. Default=“You are now first in line”. Undefined=no announcement", + "THEREAREANNOUNCE": "Choose a Sound defined in Tools. Default=“There are”. Undefined=no announcement", + "WAITINGCALLSANNOUNCE": "Choose a Sound defined in Tools. Default=“calls waiting”. Undefined=no announcement", + "ESTIMATEDHOLDTIMEANNOUNCE": "Choose a Sound defined in Tools. Default=“The current estimated hold time is”. Undefined=no announcement", + "MINUTESANNOUNCE": "Choose a Sound defined in Tools. Default=“minutes”. Undefined=no announcement", + "MINUTEANNOUNCE": "Choose a Sound defined in Tools. Default=“minute”. Undefined=no announcement", + "SECONDSANNOUNCE": "Choose a Sound defined in Tools. Default=“seconds”. Undefined=no announcement", + "THANKYOUANNOUNCE": "Choose a Sound defined in Tools. Default=“Thank you for your patience”. Undefined=no announcement", + "AFTERCALLWORK": "If enabled, the agent will be set on Pause after completing a call", + "AUTOPAUSE": "Enables/disables the automatic pause of agents who fail to answer a call. If enabled it causes the agent to be paused in all queues he belongs to", + "RINGINUSE": "To avoid/allow sending calls to members whose status is In Use", + "TIMEOUTRESTART": "If yes, this resets the timeout for an agent to answer when either a BUSY or CONGESTION status is received from the channel", + "MONITORFORMAT": "Specifies the format of the recording file. If it set to 'inactive', calls will not be recorded", + "CONTEXT": "Allows a caller to exit the queue by pressing a single DTMF digit. If a context is specified and the caller enters a number, that digit will attempt to be matched in the context specified, and dialplan execution will continue there", + "SETINTERFACEVARIABLES": "If set to yes, just prior to the caller being connected with a queue agent some variables will be set (for more information see wiki docs)", + "SETQUEUEVARIABLES": "If set to yes, just prior to the caller being connected with a queue agent and leaving the queue, some variables will be set (for more information, see wiki docs)", + "SETQUEUEENTRYVARIABLES": "If set to yes, just prior to the caller being connected with a queue agent some variables will be set (for more information, see wiki docs)", + "RECORDING": "Enable call recording", + "VOICEMAIL_CONTEXT": "The context of the relative extension", + "NAME": "Only numbers, letters and specific characters (._) are supported", + "CALLERIDALL": "Supported format: \"CallerId\" <number>", + "CALLER_ID": "Supported format: \"CallerId\" <number>", + "MANDATORYDISPOSITIONPAUSEID": "Pause status to set during mandatory disposition", + "SERVICELEVEL": "Second settings for service level (default=0, no SL). Used for service level statistics (calls answered within service level time frame)", + "SAVE_ROUTES": "The routing has been modified. Remember to save if you don't want to lose your changes." + }, + "NOTIFICATIONS": { + "EXTENSION_CREATED_SUCCESS_TITLE": "Route successfully created", + "EXTENSION_SAVED_SUCCESS_TITLE": "Route successfully saved", + "EXTENSION_DELETE_TITLE": "Are you sure want to delete the route?", + "EXTENSION_DELETE_MESSAGE": "{{ name }} will be deleted", + "EXTENSION_DELETED_SUCCESS_TITLE": "Route successfully deleted", + "EXTENSIONS_DELETE_TITLE": "Are you sure want to delete the selected routes?", + "EXTENSIONS_DELETE_MESSAGE": "{{ total }} routes will be deleted", + "ROUTING_APPLICATION_DELETE_TITLE": "Are you sure want to delete the application?", + "ROUTING_APPLICATION_DELETE_MESSAGE": "{{ name }} will be deleted", + "ROUTING_APPLICATIONS_DELETE_TITLE": "Are you sure want to delete the selected applications?", + "ROUTING_APPLICATIONS_DELETE_MESSAGE": "{{ total }} applications will be deleted", + "CALLYSQUARE_PROJECTS_GET_ERROR": "Unable to retrieve any CallySquare project", + "TRUNKS_GET_ERROR": "Unable to retrieve any trunk", + "VOICE_CONTEXTS_GET_ERROR": "Unable to retrieve any voice context", + "QUEUES_GET_ERROR": "Unable to retrieve any queue", + "SOUNDS_GET_ERROR": "Unable to retrieve any sound", + "USERS_GET_ERROR": "Unable to retrieve any user", + "VARIABLES_GET_ERROR": "Unable to retrieve any variable", + "VOICEMAILS_GET_ERROR": "Unable to retrieve any voicemail", + "TAGS_GET_ERROR": "Unable to retrieve any tag", + "INTERVALS_GET_ERROR": "Unable to retrieve any interval", + "CALL_HANGUP_SUCCESS": "Call hung up successfully", + "CALL_REDIRECT_SUCCESS": "Call redirected successfully" + } + } +} diff --git a/public/app/main/apps/voice/i18n/ja.json b/public/app/main/apps/voice/i18n/ja.json index 3aeb53a..2be9d73 100644 --- a/public/app/main/apps/voice/i18n/ja.json +++ b/public/app/main/apps/voice/i18n/ja.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "プレフィックスにチームを追加", "ALIAS": "エイリアス", "MAXCAPACITY": "最大容量", - "WORKING": "働く" + "WORKING": "働く", + "CALL_NUMBER_REDIRECT": "通話をリダイレクトする番号はどれですか。", + "NO_AGENT_AVAILABLE": "利用可能なエージェントはありません" } } diff --git a/public/app/main/apps/voice/i18n/ko.json b/public/app/main/apps/voice/i18n/ko.json index 6792938..6f73a96 100644 --- a/public/app/main/apps/voice/i18n/ko.json +++ b/public/app/main/apps/voice/i18n/ko.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "접두사에 팀 추가", "ALIAS": "별명", "MAXCAPACITY": "최대 용량", - "WORKING": "일하고있는" + "WORKING": "일하고있는", + "CALL_NUMBER_REDIRECT": "어떤 번호로 통화를 재전송하시겠습니까?", + "NO_AGENT_AVAILABLE": "사용 가능한 에이전트 없음" } } diff --git a/public/app/main/apps/voice/i18n/lt.json b/public/app/main/apps/voice/i18n/lt.json index 37fad45..0ef10db 100644 --- a/public/app/main/apps/voice/i18n/lt.json +++ b/public/app/main/apps/voice/i18n/lt.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "Pridėti komandą prie priešdėlio", "ALIAS": "Pseudonimas", "MAXCAPACITY": "Maksimali talpa", - "WORKING": "Darbas" + "WORKING": "Darbas", + "CALL_NUMBER_REDIRECT": "Kuriuo numeriu norite peradresuoti skambutį?", + "NO_AGENT_AVAILABLE": "Nėra agento" } } diff --git a/public/app/main/apps/voice/i18n/lv.json b/public/app/main/apps/voice/i18n/lv.json index ee73c26..08b63c0 100644 --- a/public/app/main/apps/voice/i18n/lv.json +++ b/public/app/main/apps/voice/i18n/lv.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "Pievienot komandu prefiksam", "ALIAS": "Pseidonīms", "MAXCAPACITY": "Maksimālā ietilpība", - "WORKING": "Darbojas" + "WORKING": "Darbojas", + "CALL_NUMBER_REDIRECT": "Uz kuru numuru vēlaties pāradresēt zvanu?", + "NO_AGENT_AVAILABLE": "Nav pieejams neviens aģents" } } diff --git a/public/app/main/apps/voice/i18n/nl.json b/public/app/main/apps/voice/i18n/nl.json index 656bb91..a6af508 100644 --- a/public/app/main/apps/voice/i18n/nl.json +++ b/public/app/main/apps/voice/i18n/nl.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "Team toevoegen aan voorvoegsel", "ALIAS": "Alias", "MAXCAPACITY": "maximum capaciteit", - "WORKING": "Werken" + "WORKING": "Werken", + "CALL_NUMBER_REDIRECT": "Naar welk nummer wilt u de oproep doorschakelen?", + "NO_AGENT_AVAILABLE": "Geen agent beschikbaar" } } diff --git a/public/app/main/apps/voice/i18n/no.json b/public/app/main/apps/voice/i18n/no.json index add2de9..4397cdd 100644 --- a/public/app/main/apps/voice/i18n/no.json +++ b/public/app/main/apps/voice/i18n/no.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "Legg Team til prefiks", "ALIAS": "Alias", "MAXCAPACITY": "Maks kapasitet", - "WORKING": "Jobber" + "WORKING": "Jobber", + "CALL_NUMBER_REDIRECT": "Hvilket nummer vil du omdirigere anropet til?", + "NO_AGENT_AVAILABLE": "Ingen agent tilgjengelig" } } diff --git a/public/app/main/apps/voice/i18n/pl.json b/public/app/main/apps/voice/i18n/pl.json index c709395..50dd679 100644 --- a/public/app/main/apps/voice/i18n/pl.json +++ b/public/app/main/apps/voice/i18n/pl.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "Dodaj drużynę do prefiksu", "ALIAS": "Alias", "MAXCAPACITY": "Maksymalna pojemność", - "WORKING": "Pracujący" + "WORKING": "Pracujący", + "CALL_NUMBER_REDIRECT": "Na jaki numer chcesz przekierować połączenie?", + "NO_AGENT_AVAILABLE": "Brak dostępnego agenta" } } diff --git a/public/app/main/apps/voice/i18n/pt-BR.json b/public/app/main/apps/voice/i18n/pt-BR.json index 971bf53..5fec1b5 100644 --- a/public/app/main/apps/voice/i18n/pt-BR.json +++ b/public/app/main/apps/voice/i18n/pt-BR.json @@ -1,40 +1,40 @@ { "VOICE": { - "LOGIN_TIME": "Tempo de login", - "PAUSE_TIME": "Tempo de pausa", - "ABANDONEDCALLS": "Chamadas abandonadas", + "LOGIN_TIME": "Tempo de Login", + "PAUSE_TIME": "Tempo de Pausa", + "ABANDONEDCALLS": "Chamadas Abandonadas", "WAITING_FOR_AGENTS": "Esperando por agentes", "ACTIVE": "Ativo", - "NO_AGENT_ONLINE": "Nenhum agente online", + "NO_AGENT_ONLINE": "Nenhum aAente Online", "PARTIALPAUSE": "Pausa Parcial", "STATUS": "Status", "TIMER": "Cronômetro", "ALL": "Todos", "IDLE": "Ocioso", "EDIT_TRUNK": "Editar Tronco", - "GOTO_VOICEQUEUE": "Ir para filas de voz em tempo real", - "GOTOREALTIME_VOICEQUEUE": "Ir para filas de voz em tempo real", + "GOTO_VOICEQUEUE": "Ir para Filas de Voz em Tempo Real", + "GOTOREALTIME_VOICEQUEUE": "Ir para Filas de Voz em Tempo Real", "NAME": "Nome", "LOGOUT": "Logout", - "VOICEQUEUES": "Filas de voz", + "VOICEQUEUES": "Filas de Voz", "SEARCH_FOR_ANYONE": "Procurar", "BACK": "Voltar", "SELECTED": "Selecionado", - "SELECT_ALL": "Selecionar tudo", - "SELECT_NONE": "Selecione nenhum", - "DELETE_VOICEDISPOSITION": "Excluir disposição de voz", - "EDIT_VOICEDISPOSITION": "Editar disposição de voz", - "EDIT_VOICEQUEUE": "Editar fila de voz", - "DELETE_VOICEQUEUE": "Excluir fila de voz", + "SELECT_ALL": "Selecionar Tudo", + "SELECT_NONE": "Selecione Nenhum", + "DELETE_VOICEDISPOSITION": "Excluir Qualicação de Voz", + "EDIT_VOICEDISPOSITION": "Editar Qualificação de Voz", + "EDIT_VOICEQUEUE": "Editar Fila de Voz", + "DELETE_VOICEQUEUE": "Excluir Fila de Voz", "MOHSOUNDS": "Moh Sounds", "STRATEGY": "Estratégia", "DESCRIPTION": "Descrição", - "ADD_VOICEQUEUE": "Adicionar fila de voz", + "ADD_VOICEQUEUE": "Adicionar Fila de Voz", "CREATED_AT": "Criado em", "CANT_PLAY_GSM_AUDIO_FILES": "Não é possível reproduzir arquivos de áudio gsm ou wav49", "APPLICATIONS_LIST": "Lista de Aplicações", "LEGEND": { - "CUSTOM_APPLICATION": "(*) - Aplicativo personalizado" + "CUSTOM_APPLICATION": "(*) - Aplicativo Personalizado" }, "ERRORS": { "TRUNK_REQUIRED": "Campo obrigatório", @@ -85,184 +85,184 @@ "PENALTY_REQUIRED": "Você deve especificar um valor para a penalidade" }, "GENERAL": "Geral", - "TIMEOUT": "Tempo esgotado", - "MAXLENGTH": "Comprimento máximo", - "RETRY": "Tente novamente", - "WRAPUPTIME": "Tempo de finalização", + "TIMEOUT": "Tempo eEgotado", + "MAXLENGTH": "Tamanho Máximo", + "RETRY": "Tente Novamente", + "WRAPUPTIME": "Tempo de Qualificação", "WEIGHT": "Peso", - "JOINWHENEMPTY": "Juntar quando vazio", - "LEAVEWHENEMPTY": "Sair quando vazio", + "JOINWHENEMPTY": "Juntar quando Vazio", + "LEAVEWHENEMPTY": "Sair quando Vazio", "HELP": { - "TIMEOUT": "Quantos segundos para tocar um dispositivo", + "TIMEOUT": "Tempo em segundos ficar chamando (toques) um dispositivo", "MAXLENGTH": "Número máximo de chamadores que podem esperar em uma fila: zero significa ilimitado", - "RETRY": "Tempo em segundos para aguardar antes de chamar o próximo agente na fila quando o tempo limite expirar", - "WRAPUPTIME": "Tempo em segundos para manter um membro da fila indisponível depois de concluir uma chamada", - "WEIGHT": "Peso de uma fila para definir a prioridade se os membros estiverem associados a várias filas", - "JOINWHENEMPTY": "Usado para controlar se um chamador é passado para uma fila quando nenhum membro está disponível", - "LEAVEWHENEMPTY": "Usado para controlar se os chamadores são deixados na fila quando nenhum membro está disponível para receber chamadas", - "ANNOUNCEFREQUENCY": "Com que frequência anunciar a posição do chamador e / ou o tempo estimado de espera na fila (zero para desativar)", + "RETRY": "Tempo em segundos para aguardar antes de chamar o próximo agente quando o tempo limite expirar", + "WRAPUPTIME": "Tempo em segundos para manter um agente indisponível depois de concluir uma chamada", + "WEIGHT": "Peso para definir a prioridade se os agentes estiverem associados a várias filas", + "JOINWHENEMPTY": "Usado para controlar se um chamador é passado para fila quando nenhum agente está disponível", + "LEAVEWHENEMPTY": "Usado para controlar se os chamadores serão passados para fila quando nenhum agente está disponível", + "ANNOUNCEFREQUENCY": "Com que frequência anunciará a posição do chamador e / ou o tempo estimado de espera na fila (zero para desativar)", "MINANNOUNCEFREQUENCY": "Frequência mínima de anúncio (útil quando a posição do chamador muda com frequência)", - "PERIODICANNOUNCEFREQUENCY": "Freqüência de anúncios periódicos para o chamador", + "PERIODICANNOUNCEFREQUENCY": "Frequência de anúncios periódicos para o chamador", "ANNOUNCEPOSITIONLIMIT": "Usado se a posição de anúncio for definida como \"limite\" ou \"mais\"", - "AFTERCALLWORKDURATION": "Comprimento de pausa acionado pela opção After Call Work", + "AFTERCALLWORKDURATION": "Duração da Pausa configurado pela opção Após Chamada", "MEMBERDELAY": "Insere um atraso antes de o chamador e o agente na fila se conectarem", - "MUSICONHOLD": "Define a música a ser usada para uma fila específica", + "MUSICONHOLD": "Define a Música de Espera", "ANNOUNCETOAGENT": "Reproduzir um anúncio para o agente que atende a chamada (geralmente para que ele saiba de qual fila o chamador está vindo)", "RANDOMPERIODICANNOUNCE": "Se sim, os anúncios periódicos definidos serão reproduzidos aleatoriamente", "ANNOUNCEHOLDTIME": "Reproduz o tempo de espera estimado junto com os anúncios periódicos (Sim / Não / Uma vez)", - "ANNOUNCECALLERPOSITION": "Usado para definir se a posição do chamador na fila deve ser anunciada: No = never; Sim = sempre; Limite = somente se estiver dentro do limite definido pelo limite de posição de anúncio; Mais = apenas se estiver além do valor definido pelo limite de posição de anúncio", - "REPORTHOLDTIMEAGENT": "Permite que o tempo de espera do chamador seja informado ao agente na fila antes da conexão", + "ANNOUNCECALLERPOSITION": "Usado para ativar anúncio de posição do chamador na fila: No = nunca; Yes = sempre; Limite = somente se estiver dentro do valor definido pelo limite de posição de anúncio; Mais = apenas se estiver além do valor definido pelo limite de posição de anúncio.", + "REPORTHOLDTIMEAGENT": "Permite que o tempo de espera do chamador seja informado ao agente antes da conexão", "PERIODICANNOUNCE": "Conjunto de anúncios periódicos a serem reproduzidos (na ordem)", "HOLDTIMEANNOUNCE": "Escolha um som definido em ferramentas. Padrão = “Tempo de Espera”. Indefinido = sem anúncio", - "YOUARENEXTANNOUNCE": "Escolha um som definido em ferramentas. Padrão = “Você agora é o primeiro da fila”. Indefinido = sem anúncio", - "THEREAREANNOUNCE": "Escolha um som definido em ferramentas. Padrão = “Existem”. Indefinido = sem anúncio", - "WAITINGCALLSANNOUNCE": "Escolha um som definido em ferramentas. Padrão = “chamadas em espera”. Indefinido = sem anúncio", + "YOUARENEXTANNOUNCE": "Escolha um áudio definido em ferramentas. Padrão = “Você agora é o primeiro da fila”. Indefinido = sem anúncio", + "THEREAREANNOUNCE": "Escolha um áudio definido em ferramentas. Padrão = “Existem”. Indefinido = sem anúncio", + "WAITINGCALLSANNOUNCE": "Escolha um aúdio definido em ferramentas. Padrão = “chamadas em espera”. Indefinido = sem anúncio", "ESTIMATEDHOLDTIMEANNOUNCE": "Escolha um som definido em ferramentas. Padrão = “O tempo de espera estimado atual é“. Indefinido = sem anúncio", - "MINUTESANNOUNCE": "Escolha um som definido em ferramentas. Padrão = “minutos”. Indefinido = sem anúncio", - "MINUTEANNOUNCE": "Escolha um som definido em ferramentas. Padrão = “minuto”. Indefinido = sem anúncio", - "SECONDSANNOUNCE": "Escolha um som definido em ferramentas. Padrão = “segundos”. Indefinido = sem anúncio", - "THANKYOUANNOUNCE": "Escolha um som definido em ferramentas. Padrão = “Obrigado pela sua paciência”. Indefinido = sem anúncio", - "AFTERCALLWORK": "Se ativado, o agente será definido em Pausar após concluir uma chamada", - "AUTOPAUSE": "Ativa / desativa a pausa automática de agentes que não atendem uma chamada. Se ativado, faz com que o agente seja pausado em todas as filas às quais ele pertence", - "RINGINUSE": "Para evitar / permitir o envio de chamadas para membros cujo status é Em uso", + "MINUTESANNOUNCE": "Escolha um áudio definido em ferramentas. Padrão = “minutos”. Indefinido = sem anúncio", + "MINUTEANNOUNCE": "Escolha um áudio definido em ferramentas. Padrão = “minuto”. Indefinido = sem anúncio", + "SECONDSANNOUNCE": "Escolha um áudio definido em ferramentas. Padrão = “segundos”. Indefinido = sem anúncio", + "THANKYOUANNOUNCE": "Escolha um áudio definido em ferramentas. Padrão = “Obrigado pela sua paciência”. Indefinido = sem anúncio", + "AFTERCALLWORK": "Se ativado, o agente entrará em Pausa após desligar", + "AUTOPAUSE": "Ativar / desativar a pausa automática para agentes que não atendem chamada. Se ativado, faz com que o agente entre em pausa em todas as filas às quais ele pertence.", + "RINGINUSE": "Para permitir ou não o envio de chamadas para agentes cujo status é Ocupado", "TIMEOUTRESTART": "Se sim, isso redefine o tempo limite para um agente responder quando um status OCUPADO ou CONGESTIONADO é recebido do canal", - "CONTEXT": "Permite que um chamador saia da fila pressionando um único dígito DTMF. Se um contexto for especificado e o chamador inserir um número, esse dígito tentará ser correspondido no contexto especificado e a execução da planta de discagem continuará lá.", - "SETINTERFACEVARIABLES": "Se configurado como yes, antes de o chamador ser conectado a um agente de fila, algumas variáveis ​​serão configuradas (para obter mais informações, consulte os documentos do wiki)", - "SETQUEUEVARIABLES": "Se definido como yes, logo antes de o chamador se conectar com um agente de fila e sair da fila, algumas variáveis ​​serão configuradas (para obter mais informações, consulte docs do wiki)", - "SETQUEUEENTRYVARIABLES": "Se definido como sim, pouco antes de o chamador ser conectado a um agente de fila, algumas variáveis ​​serão definidas (para obter mais informações, consulte docs do wiki)", - "RECORDING": "Ativar gravação de chamadas", - "VOICEMAIL_CONTEXT": "O contexto da extensão relativa", - "NAME": "Somente números, letras e caracteres específicos (._) são suportados", - "CALLERIDALL": "Formato suportado: \"CallerId \" ", - "CALLER_ID": "Formato suportado: \\ \"CallerId \" ", - "MANDATORYDISPOSITIONPAUSEID": "Pausar status para definir durante a disposição obrigatória", - "SERVICELEVEL": "Segundos ajustes para o nível de serviço (padrão = 0, sem SL). Usado para estatísticas de nível de serviço (chamadas atendidas dentro do período de tempo de nível de serviço)", + "CONTEXT": "Permite que o chamador saia da fila pressionando um dígito DTMF. Se um contexto for configurado e o chamador digitar um número, esse dígito tentará localizar no contexto configurado e continuará o dialplan.", + "SETINTERFACEVARIABLES": "Se configurado como sim, antes de o chamador ser conectado a um agente, algumas variáveis ​​serão configuradas (para obter mais informações, consulte os documentos do wiki)", + "SETQUEUEVARIABLES": "Se definido como sim, pouco antes de o chamador ser conectado a um agente de fila, algumas variáveis ​​serão definidas (para obter mais informações, consulte a wiki)", + "SETQUEUEENTRYVARIABLES": "Se definido como sim, pouco antes de o chamador ser conectado a um agente de fila, algumas variáveis ​​serão definidas (para obter mais informações, consulte a wiki)", + "RECORDING": "Ativar Gravação de Chamadas", + "VOICEMAIL_CONTEXT": "Define contexto da extensão", + "NAME": "Somente é suportado números, letras e caracteres específicos (._)", + "CALLERIDALL": "Supported format: \"CallerId\" ", + "CALLER_ID": "Supported format: \"CallerId\" ", + "MANDATORYDISPOSITIONPAUSEID": "Tipo de Pausa para qualificação obrigatória", + "SERVICELEVEL": "Ajuste de Segundos para o nível de serviço (padrão = 0, sem Nível de Serviço). Usado para estatísticas de nível de serviço (chamadas atendidas dentro do período cumprem o nível de serviço)", "MONITORFORMAT": "Especifica o formato do arquivo de gravação. Se for definido como 'inativo', as chamadas não serão gravadas", "SAVE_ROUTES": "O roteamento foi modificado. Lembre-se de salvar se não quiser perder suas alterações." }, - "MUSICONHOLD": "Música em espera", - "ANNOUNCETOAGENT": "Anunciar ao agente", + "MUSICONHOLD": "Música em Espera", + "ANNOUNCETOAGENT": "Anunciar ao Agente", "ANNOUNCEMENTS": "Anúncios", "ADVANCED": "Avançado", - "ANNOUNCEFREQUENCY": "Anunciar Frequência", + "ANNOUNCEFREQUENCY": "Frequência Anúncio", "MINANNOUNCEFREQUENCY": "Frequência mínima de anúncio", - "PERIODICANNOUNCEFREQUENCY": "Periodicidade periódica de anúncio", - "RANDOMPERIODICANNOUNCE": "Anúncio periódico aleatório", - "ANNOUNCEHOLDTIME": "Anunciar tempo de espera", - "ANNOUNCECALLERPOSITION": "Anunciar a posição do chamador", - "ANNOUNCEPOSITIONLIMIT": "Anunciar limite de posição", - "REPORTHOLDTIMEAGENT": "Tempo de espera do agente de relatório", - "PERIODICANNOUNCE": "Anúncio periódico", - "HOLDTIMEANNOUNCE": "Anuncio em Tempo de Espera", - "YOUARENEXTANNOUNCE": "'Você é o próximo' Anunciar", - "THEREAREANNOUNCE": "'Existem' Anuncie", - "WAITINGCALLSANNOUNCE": "Chamadas em Espera Anunciam", - "ESTIMATEDHOLDTIMEANNOUNCE": "Anuncio estimado em tempo de espera", - "MINUTESANNOUNCE": "Anuncio de minutos", - "MINUTEANNOUNCE": "Anuncio de minuto", - "SECONDSANNOUNCE": "Anuncio de Segundos", - "THANKYOUANNOUNCE": "'Obrigado' Anuncie", + "PERIODICANNOUNCEFREQUENCY": "Frequencia Anúncio Periódico", + "RANDOMPERIODICANNOUNCE": "Anúncio Periódico Aleatório", + "ANNOUNCEHOLDTIME": "Anunciar Tempo de Espera", + "ANNOUNCECALLERPOSITION": "Anunciar a Posição na Fila", + "ANNOUNCEPOSITIONLIMIT": "Anunciar Limite de Posição", + "REPORTHOLDTIMEAGENT": "Relatório de Tempo de Espera do Agente", + "PERIODICANNOUNCE": "Anúncio Periódico", + "HOLDTIMEANNOUNCE": "Anúncio em Tempo de Espera", + "YOUARENEXTANNOUNCE": "Anúncio 'Você é o próximo'", + "THEREAREANNOUNCE": "Anúncio 'Existem'", + "WAITINGCALLSANNOUNCE": "Anúncio Chamadas em Espera", + "ESTIMATEDHOLDTIMEANNOUNCE": "Anunciar Tempo de Espera Estimado", + "MINUTESANNOUNCE": "Anuncio Minutos", + "MINUTEANNOUNCE": "Anúncio Minuto", + "SECONDSANNOUNCE": "Anúncio Segundos", + "THANKYOUANNOUNCE": "Anúncio 'Obrigado'", "AUTOPAUSE": "Pausa Automática", - "AFTERCALLWORK": "Pausa após ligação", - "AFTERCALLWORKDURATION": "Duração de pausa após ligação", - "RINGINUSE": "Toque em uso", + "AFTERCALLWORK": "Pausa Após Ligação", + "AFTERCALLWORKDURATION": "Duração Pausa Após Ligação", + "RINGINUSE": "Toque em Uso", "MEMBERDELAY": "Member Delay", "TIMEOUTRESTART": "Timeout Restart", - "MONITORFORMAT": "Formato de gravação", - "SETINTERFACEVARIABLES": "Definir variáveis ​​de interface", - "SETQUEUEVARIABLES": "Definir as variáveis ​​da fila", - "SETQUEUEENTRYVARIABLES": "Definir as Variáveis ​​de Entrada da Fila", + "MONITORFORMAT": "Formato de Gravação", + "SETINTERFACEVARIABLES": "Definir Variáveis ​​de Interface", + "SETQUEUEVARIABLES": "Definir as Variáveis ​​da Fila", + "SETQUEUEENTRYVARIABLES": "Definir as Variáveis ​​de Entrada na Fila", "VARIABLE": "Variável", "CONTEXT": "Contexto", "SAVE": "Salvar", "SETTINGS": "Configurações", - "INBOUNDROUTES": "Rotas de entrada", - "PHONENUMBER": "Número de telefone", - "ADD_INBOUNDROUTE": "Adicionar rota de entrada", - "EDIT_INBOUNDROUTE": "Editar rota de entrada", - "DELETE_INBOUNDROUTE": "Excluir rota de entrada", + "INBOUNDROUTES": "Rotas de Entrada", + "PHONENUMBER": "Número de Telefone", + "ADD_INBOUNDROUTE": "Adicionar Rota de Entrada", + "EDIT_INBOUNDROUTE": "Editar Rota de Entrada", + "DELETE_INBOUNDROUTE": "Excluir Rota de Entrada", "ACTIONS": "Ações", - "OUTBOUNDROUTES": "Rotas de saída", - "DESTINATIONPATTERN": "Padrão de destino", - "ADD_OUTBOUNDROUTE": "Adicionar rota de saída", - "EDIT_OUTBOUNDROUTE": "Editar rota de saída", - "DELETE_OUTBOUNDROUTE": "Excluir rota de saída", + "OUTBOUNDROUTES": "Rotas de Saída", + "DESTINATIONPATTERN": "Destino Padrão", + "ADD_OUTBOUNDROUTE": "Adicionar Rota de Saída", + "EDIT_OUTBOUNDROUTE": "Editar Rota de Saída", + "DELETE_OUTBOUNDROUTE": "Excluir Rota de Saída", "CUTDIGITS": "Cut Digits", "RECORDING": "Gravação", - "RECORDINGFORMAT": "Formato de gravação", + "RECORDINGFORMAT": "Formato de Gravação", "INTERNALROUTES": "Rotas Internas", - "ADD_INTERNALROUTE": "Adicionar rota interna", - "EDIT_INTERNALROUTE": "Editar rota interna", - "DELETE_INTERNALROUTE": "Excluir rota interna", + "ADD_INTERNALROUTE": "Adicionar Rota Interna", + "EDIT_INTERNALROUTE": "Editar Rota Interna", + "DELETE_INTERNALROUTE": "Excluir Rota Interna", "CONTEXTS": "Contextos", "ADD_CONTEXT": "Adicionar Contexto", - "EDIT_CONTEXT": "Editar contexto", - "DELETE_CONTEXT": "Excluir contexto", - "VOICEMAILS": "Correios de voz", - "ADD_VOICEMAIL": "Adicionar correio de voz", - "EDIT_VOICEMAIL": "Editar correio de voz", - "DELETE_VOICEMAIL": "Excluir correio de voz", - "FULLNAME": "Nome completo", + "EDIT_CONTEXT": "Editar Contexto", + "DELETE_CONTEXT": "Excluir Contexto", + "VOICEMAILS": "Correios de Voz", + "ADD_VOICEMAIL": "Adicionar Correio de Voz", + "EDIT_VOICEMAIL": "Editar Correio de Voz", + "DELETE_VOICEMAIL": "Excluir Correio de Voz", + "FULLNAME": "Nome Completo", "EMAIL": "Email", - "MAILBOX": "Caixa de correio", + "MAILBOX": "Caixa Postal", "PASSWORD": "Senha", "CONFIRM_PASSWORD": "Confirmar Senha", - "TIMEZONE": "Fuso horário", + "TIMEZONE": "Fuso Horário", "ATTACH": "Anexar", "ENVELOPE": "Envelope", "DELETE": "Excluir", "EMAILBODY": "Corpo do e-mail", "EMAILSUBJECT": "Assunto do email", - "MAXSECONDS": "Segundos máximos", - "MAXMESSAGES": "Mensagens máximas", + "MAXSECONDS": "Segundos Máximos", + "MAXMESSAGES": "Mensagens Máximas", "MESSAGES": "Mensagens", "SORT": "Ordenar", - "ADD_MUSICONHOLD": "Adicionar música em espera", - "MUSICONHOLDS": "Música em espera", - "EDIT_MUSICONHOLD": "Editar música em espera", - "DELETE_MUSICONHOLD": "Excluir música em espera", + "ADD_MUSICONHOLD": "Adicionar Música em Espera", + "MUSICONHOLDS": "Música em Espera", + "EDIT_MUSICONHOLD": "Editar Música em Espera", + "DELETE_MUSICONHOLD": "Excluir Música em Espera", "DIRECTORY": "Diretório", "AUDIOFILES": "Arquivos de áudio", "RECORDINGS": "Gravações", - "CHANSPY": "Espião", + "CHANSPY": "Intercalação", "PREFIX": "Prefixo", "OPTIONS": "Opções", "AUTH": "Auth", - "ADD_CHANSPY": "Adicionar Espião", - "EDIT_CHANSPY": "Editar Espião", - "DELETE_CHANSPY": "Excluir Espião", + "ADD_CHANSPY": "Adicionar Intercalação", + "EDIT_CHANSPY": "Editar Intercalação", + "DELETE_CHANSPY": "Excluir Intercalação", "AGENTS": "Agentes", "TELEPHONES": "Telefones", "QUEUES": "Filas", - "QUEUE_CALLS": "Filas de ligação", + "QUEUE_CALLS": "Filas de Ligação", "QUEUE_PARAMETERS": "Parametros da Fila", - "ABANDONED_CALLS": "Chamadas abandonadas", - "OUTBOUND_CALLS": "Chamadas externas", + "ABANDONED_CALLS": "Chamadas Abandonadas", + "OUTBOUND_CALLS": "Chamadas Externas", "AGI": "Agi", "DIAL": "Discar", "CALLYSQUARE": "CallySquare", - "INTERNALDIAL": "Discagem interna", - "EXTERNALDIAL": "Discagem externa", - "RINGGROUP": "Toque de grupo", + "INTERNALDIAL": "Discagem Interna", + "EXTERNALDIAL": "Discagem Externa", + "RINGGROUP": "Grupo de Toque", "PLAYBACK": "Reprodução", "QUEUE": "Fila", "SET": "Conjunto", - "VOICEMAIL": "Correio de voz", + "VOICEMAIL": "Correio de Voz", "GOTO": "GoTo", "HANGUP": "Desligar", "CUSTOM": "Personalizadas", - "PROJECT": "Projeto Cally-Square", + "PROJECT": "Projeto CallySquare", "TECHNOLOGY/RESOURCE": "Tecnologia / Recurso", "URL": "URL", - "EDIT_APP": "Editar aplicativo", - "EDIT_INTERVAL": "Editar intervalo", - "DELETE_APP": "Excluir aplicativo", + "EDIT_APP": "Editar Aplicativo", + "EDIT_INTERVAL": "Editar Intervalo", + "DELETE_APP": "Excluir Aplicativo", "INTERVALS": "Intervalos", - "USER": "Usuarios", + "USER": "Usuários", "TRUNK": "Tronco", "PHONE": "Telefone", "AUDIO_FILES": "Arquivos de áudio", - "ANNOUNCE_OVERRIDES": "Anunciar Substituto", + "ANNOUNCE_OVERRIDES": "Anúncio Substituto", "MACRO": "Macro", "GOSUB": "GoSub", "RULE": "Regra", @@ -272,47 +272,47 @@ "MAILBOX@CONTEXT": "Mailbox@Context", "EXTENSION": "Extensão", "PRIORITY": "Prioridade", - "HANGUP_CAUSE": "Causa do desligamento", - "OUTBOUNDDIAL": "Discagem de saída", - "CALLER_ID": "Identificador de chamadas", - "NO_MESSAGE_AVAILABLE": "Nenhuma mensagem disponível", - "NO_SOUND_AVAILABLE": "Nenhum som disponível", - "VOICERECORDINGS": "Gravações de voz", - "CHANSPIES": "Espião", + "HANGUP_CAUSE": "Causa do Desligamento", + "OUTBOUNDDIAL": "Discagem de Saída", + "CALLER_ID": "Identificador de Chamadas", + "NO_MESSAGE_AVAILABLE": "Nenhuma Mensagem Disponível", + "NO_SOUND_AVAILABLE": "Nenhum Áudio Disponível", + "VOICERECORDINGS": "Gravações de Voz", + "CHANSPIES": "Intercalação", "VOICE": "Voz", "REALTIME": "Tempo Real", "ID": "Id", "VOICEMAIL_CONTEXT": "Contexto", - "NO_MOHSOUND_AVAILABLE": "Não há música na espera disponível", + "NO_MOHSOUND_AVAILABLE": "Não há Música na Espera Disponível", "FILE": "Arquivo", - "ADD_MOHSOUND": "Adicionar som de música em espera", - "DOWNLOAD_MOHSOUND": "Download Musica do som em espera", - "DELETE_MOHSOUND": "Excluir som de música em espera", + "ADD_MOHSOUND": "Adicionar Música em Espera", + "DOWNLOAD_MOHSOUND": "Download Música de Espera", + "DELETE_MOHSOUND": "Excluir Música em Espera", "UNIQUEID": "ID único", "AGENT": "Agente", "TYPE": "Tipo", "RATING": "Avaliação", - "AUDIO": "Audio", + "AUDIO": "Áudio", "DATE": "Data", - "NEW_VOICEQUEUE": "Nova fila de voz", - "NEW_INBOUNDROUTE": "Nova rota de entrada", - "NEW_OUTBOUNDROUTE": "Nova rota de saída", - "NEW_INTERNALROUTE": "Nova rota interna", - "NEW_CONTEXT": "Novo contexto", - "NEW_VOICEMAIL": "Nova mensagem de voz", - "NEW_MUSICONHOLD": "Nova música em espera", - "NEW_CHANSPY": "Novo espião", + "NEW_VOICEQUEUE": "Nova Fila de Voz", + "NEW_INBOUNDROUTE": "Nova Rota de Entrada", + "NEW_OUTBOUNDROUTE": "Nova Rota de Saída", + "NEW_INTERNALROUTE": "Nova Rota Interna", + "NEW_CONTEXT": "Novo Contexto", + "NEW_VOICEMAIL": "Nova Mensagem de Voz", + "NEW_MUSICONHOLD": "Nova Música em Espera", + "NEW_CHANSPY": "Nova Intercalação", "PENALTY": "Peso", - "ADD_TEAM_TO_VOICEQUEUE": "Adicionar equipe à fila de voz", - "ADD_AGENT_TO_VOICEQUEUE": "Adicionar agente à fila de voz", - "EDIT_DIAL": "Editar discagem", + "ADD_TEAM_TO_VOICEQUEUE": "Adicionar Equipe à Fila de Voz", + "ADD_AGENT_TO_VOICEQUEUE": "Adicionar Agente à Fila de Voz", + "EDIT_DIAL": "Editar Discagem", "EDIT_AGI": "Editar AGI", - "EDIT_INTERNALDIAL": "Editar discagem interna", - "EDIT_EXTERNALDIAL": "Editar discagem externa", - "EDIT_RINGGROUP": "Editar grupo de toques", - "EDIT_PLAYBACK": "Editar reprodução", - "EDIT_QUEUE": "Editar fila", - "EDIT_SET": "Editar conjunto", + "EDIT_INTERNALDIAL": "Editar Discagem Interna", + "EDIT_EXTERNALDIAL": "Editar Discagem Externa", + "EDIT_RINGGROUP": "Editar Grupo de Toques", + "EDIT_PLAYBACK": "Editar Reprodução", + "EDIT_QUEUE": "Editar Fila", + "EDIT_SET": "Editar Conjunto", "EDIT_GOTO": "Editar GoTo", "EDIT_HANGUP": "Editar Hangup", "EDIT_CUSTOM": "Editar Customizado", @@ -321,9 +321,9 @@ "YES": "Sim", "NO": "Não", "HANGUPCAUSE_1": "1 = Número não alocado", - "HANGUPCAUSE_16": "16 = Limpeza de chamada normal", + "HANGUPCAUSE_16": "16 = Chamada normal", "HANGUPCAUSE_17": "17 = Usuário ocupado", - "HANGUPCAUSE_18": "18 = Nenhuma resposta do usuário (dispositivo teleônico não conectado)", + "HANGUPCAUSE_18": "18 = Nenhuma resposta do usuário (Não atendeu)", "HANGUPCAUSE_21": "21 = Chamada rejeitada", "HANGUPCAUSE_22": "22 = Número alterado", "HANGUPCAUSE_27": "27 = Destino fora de ordem", @@ -331,32 +331,32 @@ "HANGUPCAUSE_41": "41 = Falha temporária", "RANDOM": "Aleatória", "ALPHABETICAL": "Alfabético", - "NO_APPS_AVAILABLE": "Não há aplicativos disponíveis", + "NO_APPS_AVAILABLE": "Não há Aplicativos Disponíveis", "DOWNLOAD_VOICERECORDING": "Download Gravação de Voz", - "DELETE_VOICERECORDING": "Excluir gravação de voz", + "DELETE_VOICERECORDING": "Excluir Gravação de Voz", "INTERNAL": "Interno", - "PHONE_STATE": "Estado do telefone", - "PHONE_STATUS": "Status do telefone", - "TRUNK_STATUS": "Status do Tronco", + "PHONE_STATE": "Status do Telefone", + "PHONE_STATUS": "Status do Telefone", + "TRUNK_STATUS": "Status Tronco", "REGISTERED": "Registrado", - "UNREGISTERED": "Não registrado", + "UNREGISTERED": "Não Registrado", "LAGGED": "Atrasado", "REACHABLE": "Alcançável", "UNREACHABLE": "Inacessível", "UNKNOWN": "Desconhecido", - "NOT_INUSE": "Fora de uso", + "NOT_INUSE": "Fora de Uso", "INUSE": "Em uso", "BUSY": "Ocupado", - "INVALID": "Invalido", + "INVALID": "Inválido", "UNAVAILABLE": "Indisponível", - "RINGING": "Tocando", - "ONHOLD": "Em espera", + "RINGING": "Chamando", + "ONHOLD": "Em Espera", "RING": "Tocar", "UP": "Cima", "INFO": "Informação", - "TRUNKS": "Trunks", + "TRUNKS": "Troncos", "REGISTRY": "Registro", - "NO_REGISTRY": "Nenhum registro", + "NO_REGISTRY": "Nenhum Registro", "LOGGED_IN": "Conectado (SIP conectado)", "PAUSED": "Pausado", "WAITING": "Esperando", @@ -366,55 +366,55 @@ "TOTAL": "Total", "ANSWERED": "Respondidas", "ABANDONED": "Abandonadas", - "UNMANAGED": "Não gerenciado", - "AVG_HOLD_TIME": "Tempo médio de espera", - "AVG_DURATION": "Duração média", - "AVG_BILLABLE": "Média faturável", + "UNMANAGED": "Não Gerenciado", + "AVG_HOLD_TIME": "Tempo Médio de Epera", + "AVG_DURATION": "Duração Média", + "AVG_BILLABLE": "Média Faturável", "SOURCE": "Fonte", "DESTINATION": "Destino", "REJECTED": "Rejeitado", "FAILED": "Falhou", "CALLED": "Chamado", "CONNECTED": "Conectado", - "NO_RATING": "Sem avaliação", - "EDIT_VOICERECORDING": "Editar gravação de voz", + "NO_RATING": "Sem Avaliação", + "EDIT_VOICERECORDING": "Editar Gravação de Voz", "APPLICATION_NAME": "Nome da Aplicação", "ARGUMENTS": "Argumentos", - "NO_AVAILABLE_INFO": "Nenhuma informação disponível", - "ADD_AGENT_TO_QUEUE": "Adicionar agente à fila", + "NO_AVAILABLE_INFO": "Nenhuma Informação Disponível", + "ADD_AGENT_TO_QUEUE": "Adicionar Agente à Fila", "DEFAULT_PAUSE": "PAUSA PADRÃO", "PAUSE": "Pausa", "UNPAUSE": "Fim Pausa", - "REDIRECT_TO_NUMBER": "Redirecionar para número", - "REDIRECT_TO_AGENT": "Redirecionar para agente", - "AGENTADD_VOICEQUEUE": "Adicionar agente à fila de voz", + "REDIRECT_TO_NUMBER": "Redirecionar para Número", + "REDIRECT_TO_AGENT": "Redirecionar para Agente", + "AGENTADD_VOICEQUEUE": "Adicionar Agente à Fila de Coz", "APPLICATION": "Aplicação", "FILES": "Arquivos", "FORMAT": "Formato", "MODE": "Modo", "RECORD": "Registro", - "TEAMADD_VOICEQUEUE": "Adicionar equipe à fila de voz", - "NEW_MOHSOUND": "Novo som de música em espera", + "TEAMADD_VOICEQUEUE": "Adicionar Equipe à Fila de Voz", + "NEW_MOHSOUND": "Novo aúdio de Música em Espera", "DOWNLOAD_MESSAGE": "Download", "DELETE_MESSAGE": "Excluir", "QUEUE_PARAMS": "Parâmetros da fila", - "TOTAL_OFFERED": "Total oferecido", + "TOTAL_OFFERED": "Total Oferecido", "READY": "Pronto", - "AGENTADD_QUEUE": "Adicionar agente à fila de voz", - "AGENTSADD_QUEUE": "Adicionar agentes à fila de voz", - "ALL_TEAMS": "Todas as equipes", + "AGENTADD_QUEUE": "Adicionar Agente à Fila de Voz", + "AGENTSADD_QUEUE": "Adicionar Agentes à Fila de Voz", + "ALL_TEAMS": "Todas Equipes", "SELECTED_TEAMS": "Equipes Selecionadas", - "ALL_AGENTS": "Todos os agentes", + "ALL_AGENTS": "Todos Agentes", "SELECTED_AGENTS": "Agentes Selecionados", "CLOSING": "Fechamento", "TAGS": "Tags", - "WAITING_FOR_AGENT": "Aguardando Agentes", - "EDIT_OUTBOUNDDIAL": "Editar discagem de saída", - "ACCOUNTNAME": "Nome da conta", + "WAITING_FOR_AGENT": "Aguardando Por Agentes", + "EDIT_OUTBOUNDDIAL": "Editar Discagem de Saída", + "ACCOUNTNAME": "Nome da Conta", "PAGE": "Página", "ROWSPERPAGE": "Linhas por Página", "OF": "do", - "DISPOSITION": "Disposição", + "DISPOSITION": "Qualificação", "CHAT": "Chat", "MAIL": "Email", "SMS": "SMS", @@ -426,41 +426,41 @@ "ENDEDAT": "Terminou em", "TAG": "Tag", "DETAILS": "Detalhes", - "BILLABLESECONDS": "Segundos faturáveis", + "BILLABLESECONDS": "Segundos Faturáveis", "ANSWEREDAT": "Respondido em", "NOTE": "Nota", "CLOSE": "Fechar", - "SELECT_DATE": "Selecione a data de início", - "SELECT_TYPE": "Selecione o tipo", - "VOICEPREFIXES": "Prefixos de saída", - "NEW_VOICEPREFIX": "Novo prefixo", - "ADD_VOICEPREFIX": "Adicionar prefixo", - "EDIT_VOICEPREFIX": "Editar prefixo", - "AGENTADD_VOICEPREFIX": "Adicionar agente ao prefixo", - "DELETE_VOICEPREFIX": "Excluir prefixo", + "SELECT_DATE": "Selecione Data de Início", + "SELECT_TYPE": "Selecione Tipo", + "VOICEPREFIXES": "Prefixos de Saída", + "NEW_VOICEPREFIX": "Novo Prefixo", + "ADD_VOICEPREFIX": "Adicionar Prefixo", + "EDIT_VOICEPREFIX": "Editar Prefixo", + "AGENTADD_VOICEPREFIX": "Adicionar Agente ao Prefixo", + "DELETE_VOICEPREFIX": "Excluir Rrefixo", "OUTBOUNDROUTE": "Rota de Saída", - "CALLERIDALL": "ID do chamador", + "CALLERIDALL": "ID do Chamador", "DIALER": "Discador", "INBOUND": "Entrada", - "OUTBOUND": "Saída", - "MANDATORYDISPOSITION": "Disposição obrigatória", - "MANDATORYDISPOSITIONPAUSEID": "Status de pausa de disposição obrigatória", + "OUTBOUND": "Outbound", + "MANDATORYDISPOSITION": "Qualificação Obrigatória", + "MANDATORYDISPOSITIONPAUSEID": "Status de Pausa para Qualificação Obrigatória", "TEAMS_ASSOCIATION": "Associação de Equipas", "CANT_DOWNLOAD_THIS_FILE": "Não é possível baixar este arquivo", - "FILE_NOT_FOUND": "Arquivo não encontrado", - "SCREENRECORDING": "Gerenciar gravação de tela", - "START_SCREENRECORDING": "Iniciar gravação na tela", - "STOP_SCREENRECORDING": "Parar gravação de tela", - "TOOLTIP_SCREENRECORDING_OFF": "Gravação de tela disponível", - "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento", + "FILE_NOT_FOUND": "Arquivo Não Encontrado", + "SCREENRECORDING": "Gerenciar Gravação de Tela", + "START_SCREENRECORDING": "Iniciar Gravação de Tela", + "STOP_SCREENRECORDING": "Parar Gravação de Tela", + "TOOLTIP_SCREENRECORDING_OFF": "Gravação de Tela Disponível", + "TOOLTIP_SCREENRECORDING_ON": "Gravação de Tela em Andamento", "WRONG_EXTENSION": "O arquivo apresenta a extensão incorreta", - "DOWNLOADTRANSCRIBE_VOICERECORDING": "Baixar transcrição", - "FAILUREREASON": "Razão da falha", - "RUNSENTIMENT_VOICERECORDING": "Executar Sentiment", - "RUNTRANSCRIBESENTIMENT_VOICERECORDING": "Executar transcrição e sentimento", - "RUNTRANSCRIBE_VOICERECORDING": "Executar a transcrição", + "DOWNLOADTRANSCRIBE_VOICERECORDING": "Baixar Transcrição", + "FAILUREREASON": "Razão da Falha", + "RUNSENTIMENT_VOICERECORDING": "Executar Sentimento", + "RUNTRANSCRIBESENTIMENT_VOICERECORDING": "Executar Transcrição e Sentimento", + "RUNTRANSCRIBE_VOICERECORDING": "Executar Transcrição", "SENTIMENT": "Sentimento", - "SENTIMENTANALYSIS": "Análise de sentimentos", + "SENTIMENTANALYSIS": "Análise de Sentimentos", "SENTIMENT_MIXED": "Misturado", "SENTIMENT_NEGATIVE": "Negativo", "SENTIMENT_NEUTRAL": "Neutro", @@ -469,16 +469,18 @@ "TRANSCRIBE": "Transcrever", "TRANSCRIBESTATUS_COMPLETED": "Concluído", "TRANSCRIBESTATUS_FAILED": "Falhou", - "TRANSCRIBESTATUS_IN_PROGRESS": "Em progresso", + "TRANSCRIBESTATUS_IN_PROGRESS": "Em Progresso", "TRANSCRIBESTATUS_NEW": "Novo", "TRANSCRIPT": "Transcrição", "TRANSCRIPTANALYSIS": "Transcrição e Análise", - "SERVICELEVEL": "Nível de serviço", - "SECOND_LEVEL_DISPOSITION": "Disposição de Segundo Nível", - "THIRD_LEVEL_DISPOSITION": "Disposição de terceiro nível", - "TEAMADD_VOICEPREFIX": "Adicionar equipe ao prefixo", - "ALIAS": "Pseudônimo", - "MAXCAPACITY": "capacidade máxima", - "WORKING": "Trabalhando" + "SERVICELEVEL": "Nível de Serviço", + "SECOND_LEVEL_DISPOSITION": "Qualificação de Segundo Nível", + "THIRD_LEVEL_DISPOSITION": "Qualificação de Terceiro Nível", + "TEAMADD_VOICEPREFIX": "Adicionar Equipe ao Prefixo", + "ALIAS": "Alias", + "MAXCAPACITY": "Capacidade Máxima", + "WORKING": "Trabalhando", + "CALL_NUMBER_REDIRECT": "Para qual número você deseja redirecionar a chamada?", + "NO_AGENT_AVAILABLE": "Nenhum agente disponível" } } diff --git a/public/app/main/apps/voice/i18n/pt-PT.json b/public/app/main/apps/voice/i18n/pt-PT.json index faa44b9..7d2439d 100644 --- a/public/app/main/apps/voice/i18n/pt-PT.json +++ b/public/app/main/apps/voice/i18n/pt-PT.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "Adicionar equipe ao prefixo", "ALIAS": "Pseudônimo", "MAXCAPACITY": "capacidade máxima", - "WORKING": "Trabalhando" + "WORKING": "Trabalhando", + "CALL_NUMBER_REDIRECT": "Para qual número você deseja redirecionar a chamada?", + "NO_AGENT_AVAILABLE": "Nenhum agente disponível" } } diff --git a/public/app/main/apps/voice/i18n/ru.json b/public/app/main/apps/voice/i18n/ru.json index cc17b0e..b18d4f5 100644 --- a/public/app/main/apps/voice/i18n/ru.json +++ b/public/app/main/apps/voice/i18n/ru.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "Добавить команду к префиксу", "ALIAS": "Псевдоним", "MAXCAPACITY": "Максимальная вместимость", - "WORKING": "Работающий" + "WORKING": "Работающий", + "CALL_NUMBER_REDIRECT": "На какой номер вы хотите перенаправить вызов?", + "NO_AGENT_AVAILABLE": "Агент недоступен" } } diff --git a/public/app/main/apps/voice/i18n/sv.json b/public/app/main/apps/voice/i18n/sv.json index fa7f690..4828255 100644 --- a/public/app/main/apps/voice/i18n/sv.json +++ b/public/app/main/apps/voice/i18n/sv.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "Lägg till Team i prefixet", "ALIAS": "Alias", "MAXCAPACITY": "Max kapacitet", - "WORKING": "Arbetssätt" + "WORKING": "Arbetssätt", + "CALL_NUMBER_REDIRECT": "Vilket nummer vill du omdirigera samtalet till?", + "NO_AGENT_AVAILABLE": "Ingen agent tillgänglig" } } diff --git a/public/app/main/apps/voice/i18n/tr.json b/public/app/main/apps/voice/i18n/tr.json index 5cd2e05..c93e5db 100644 --- a/public/app/main/apps/voice/i18n/tr.json +++ b/public/app/main/apps/voice/i18n/tr.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "Önek'e Takım Ekle", "ALIAS": "takma ad", "MAXCAPACITY": "maksimum kapasite", - "WORKING": "Çalışma" + "WORKING": "Çalışma", + "CALL_NUMBER_REDIRECT": "Aramayı hangi numaraya yönlendirmek istiyorsunuz?", + "NO_AGENT_AVAILABLE": "Temsilci yok" } } diff --git a/public/app/main/apps/voice/i18n/zh-CN.json b/public/app/main/apps/voice/i18n/zh-CN.json index 6792883..1b717c3 100644 --- a/public/app/main/apps/voice/i18n/zh-CN.json +++ b/public/app/main/apps/voice/i18n/zh-CN.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "将团队添加到前缀", "ALIAS": "别名", "MAXCAPACITY": "最大容量", - "WORKING": "在职的" + "WORKING": "在职的", + "CALL_NUMBER_REDIRECT": "您要将呼叫重定向到哪个号码?", + "NO_AGENT_AVAILABLE": "没有可用的代理" } } diff --git a/public/app/main/apps/voice/i18n/zh-TW.json b/public/app/main/apps/voice/i18n/zh-TW.json index 62cf89c..8824a4b 100644 --- a/public/app/main/apps/voice/i18n/zh-TW.json +++ b/public/app/main/apps/voice/i18n/zh-TW.json @@ -479,6 +479,8 @@ "TEAMADD_VOICEPREFIX": "將團隊添加到前綴", "ALIAS": "別名", "MAXCAPACITY": "最大容量", - "WORKING": "在職的" + "WORKING": "在職的", + "CALL_NUMBER_REDIRECT": "您要將呼叫重定向到哪個號碼?", + "NO_AGENT_AVAILABLE": "沒有可用的代理" } } diff --git a/public/app/main/apps/whatsapp/i18n/bs.json b/public/app/main/apps/whatsapp/i18n/bs.json index 68808ad..6e95133 100644 --- a/public/app/main/apps/whatsapp/i18n/bs.json +++ b/public/app/main/apps/whatsapp/i18n/bs.json @@ -1,247 +1,247 @@ { "WHATSAPP": { - "EDIT_DIALOGFLOWV2": "Edit Dialogflow V2", + "EDIT_DIALOGFLOWV2": "Uredi Dialogflow V2", "DIALOGFLOWV2": "Dialogflow V2", - "PRIVATEKEY": "Private Key", - "CLIENTEMAIL": "Client Email", - "PROJECTID": "Project ID", - "ACCESSKEYID": "Access Key ID", - "ACCOUNTSID": "Account SID", - "ACTIONS": "Actions", - "ADD_NOTE": "Add note", - "ADD_WHATSAPPACCOUNT": "Add", - "ADD_WHATSAPPCANNEDANSWER": "Add Canned Answer", - "ADD_WHATSAPPDISPOSITION": "Add WhatsApp Disposition", - "ADD_WHATSAPPQUEUE": "Add WhatsApp queue", - "ADVANCED": "Advanced", - "AGENT": "Agent", - "AGENT_TIMEOUT": "Agent Timeout", - "AGENTADD_QUEUE": "Add Agent To WhatsApp Queue", - "AGENTADD_WHATSAPPACCOUNT": "Add Agent To WhatsApp Account", - "AGENTADD_WHATSAPPQUEUE": "Add Agent To WhatsApp Queue", - "AGENTS": "Agents", - "AGENTSADD_QUEUE": "Add agents to WhatsApp queue", - "AGENTTRANSFER": "Agent Transfer", - "AGENTTRANSFERTIMEOUT": "Agent Transfer Timeout", - "ALL": "All", - "ALL_AGENTS": "All Agents", - "ALL_TEAMS": "All Teams", + "PRIVATEKEY": "Privatni Ključ", + "CLIENTEMAIL": "E-mail Stranke", + "PROJECTID": "Projekat ID", + "ACCESSKEYID": "Pristupni Ključ ID", + "ACCOUNTSID": "Nalog SID", + "ACTIONS": "Radnje", + "ADD_NOTE": "Dodaj Bilješku", + "ADD_WHATSAPPACCOUNT": "Dodaj", + "ADD_WHATSAPPCANNEDANSWER": "Dodaj Pripremljeni Odgovor", + "ADD_WHATSAPPDISPOSITION": "Dodaj WhatsApp Dispoziciju", + "ADD_WHATSAPPQUEUE": "Dodaj WhatsApp Queue", + "ADVANCED": "Napredno", + "AGENT": "Specijalist", + "AGENT_TIMEOUT": "Timeout Specijaliste", + "AGENTADD_QUEUE": "Dodaj Specijalistu u WhatsApp Queue", + "AGENTADD_WHATSAPPACCOUNT": "Dodaj Specijalistu u WhatsApp Nalog", + "AGENTADD_WHATSAPPQUEUE": "Dodaj Specijalistu u WhatsApp Queue", + "AGENTS": "Specijaliste", + "AGENTSADD_QUEUE": "Dodaj Specijaliste u WhatsApp Queue", + "AGENTTRANSFER": "Prijenost Specijaliste", + "AGENTTRANSFERTIMEOUT": "Timeout Prijenosa Specijaliste", + "ALL": "Svi", + "ALL_AGENTS": "Svi Specijalisti", + "ALL_TEAMS": "Svi Timovi", "AMAZONLEX": "AmazonLex", "AUTHTOKEN": "Auth Token", - "AUTOREPLY": "Auto Reply", - "BACK": "Back", + "AUTOREPLY": "Automatski Odgovor", + "BACK": "Nazad", "BASEURL": "Base URL", - "BOTNAME": "Bot Name", - "BUSY": "Busy", - "CANNED_ANSWER_NOT_FOUND": "No Canned Answers were found", - "CANNED_ANSWER_SEARCH": "Enter a text to search a Canned Answer", - "CANNEDANSWERS": "Canned Answers", - "CAPACITY": "Capacity", - "CLOSE": "Close", - "CLOSED": "Closed", - "CLOSEMETHOD": "Close Method", - "CLOSEURL": "Close URL", - "COMMAND": "Command", - "CONDITION": "Condition", - "CONTACT": "Contact", - "CREATED_AT": "Created at", - "DEFAULT_PAUSE": "DEFAULT PAUSE", - "DELETE": "Delete", - "DELETE_INTERACTION": "Delete Interaction", - "DELETE_SELECTED": "Delete selected", - "DELETE_WHATSAPPACCOUNT": "Delete WhatsApp Account", - "DELETE_WHATSAPPCANNEDANSWER": "Deleted", - "DELETE_WHATSAPPDISPOSITION": "Delete WhatsApp Disposition", - "DELETE_WHATSAPPQUEUE": "Delete WhatsApp Queue", - "DESCRIPTION": "Description", + "BOTNAME": "Bot Naziv", + "BUSY": "Zauzet", + "CANNED_ANSWER_NOT_FOUND": "Nije pronađen nijedan pripremljeni odgovor", + "CANNED_ANSWER_SEARCH": "Unesi tekst da pretražiš Pripremljene Odgovore", + "CANNEDANSWERS": "Pripremljeni Odgovori", + "CAPACITY": "Kapacitet", + "CLOSE": "Zatvori", + "CLOSED": "Zatvoreno", + "CLOSEMETHOD": "Metoda Zatvaranja", + "CLOSEURL": "Zatvori URL", + "COMMAND": "Naredba", + "CONDITION": "Uslov", + "CONTACT": "Kontakt", + "CREATED_AT": "Kreirano U", + "DEFAULT_PAUSE": "ZADANA PAUZA", + "DELETE": "Izbriši", + "DELETE_INTERACTION": "Izbriši Interakciju", + "DELETE_SELECTED": "Izbriši odabrano", + "DELETE_WHATSAPPACCOUNT": "Izbriši WhatsApp nalog", + "DELETE_WHATSAPPCANNEDANSWER": "Izbrisano", + "DELETE_WHATSAPPDISPOSITION": "Izbriši WhatsApp Dispoziciju", + "DELETE_WHATSAPPQUEUE": "Izbriši WhatsApp Queue", + "DESCRIPTION": "Opis", "DIALOGFLOW": "DialogFlow", - "DISPOSITION": "Disposition", - "DISPOSITIONS": "Dispositions", - "DOWNLOAD_INTERACTION": "Download", - "DOWNLOAD_WITH_ATTACHMENTS": "Download With Attachments", - "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download Without Attachments", - "EDIT_AGENT": "Edit Agent", - "EDIT_AMAZONLEX": "Edit Lex configuration", - "EDIT_AUTOREPLY": "Edit Auto Reply", - "EDIT_CLOSE": "Edit Close", - "EDIT_DIALOGFLOW": "Edit DialogFlow configuration", - "EDIT_GOTOIF": "Edit Gotoif", - "EDIT_GOTOP": "Edit Gotop", - "EDIT_NOOP": "Edit Noop", - "EDIT_QUEUE": "Edit Queue", - "EDIT_SYSTEM": "Edit System", - "EDIT_TAG": "Edit Tag", - "EDIT_WHATSAPPACCOUNT": "Edit WhatsApp Account", - "EDIT_WHATSAPPCANNEDANSWER": "Edit", - "EDIT_WHATSAPPDISPOSITION": "Edit WhatsApp Disposition", - "EDIT_WHATSAPPQUEUE": "Edit WhatsApp Queue", + "DISPOSITION": "Dispozicija", + "DISPOSITIONS": "Dispozicije", + "DOWNLOAD_INTERACTION": "Skini", + "DOWNLOAD_WITH_ATTACHMENTS": "Skini Sa Prilozima", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Skini Bez Priloga", + "EDIT_AGENT": "Uredi Specijalistu", + "EDIT_AMAZONLEX": "Uredi Lex konfiguraciju", + "EDIT_AUTOREPLY": "Uredi Automatski Odgovor", + "EDIT_CLOSE": "Uredi Zatvaranje", + "EDIT_DIALOGFLOW": "Uredi DialogFlow konfiguraciju", + "EDIT_GOTOIF": "Uredi Gotoif", + "EDIT_GOTOP": "Uredi Gotop", + "EDIT_NOOP": "Uredi Noop", + "EDIT_QUEUE": "Uredi Queue", + "EDIT_SYSTEM": "Uredi Sistem", + "EDIT_TAG": "Uredi Tag", + "EDIT_WHATSAPPACCOUNT": "Uredi WhatsApp Nalog", + "EDIT_WHATSAPPCANNEDANSWER": "Uredi", + "EDIT_WHATSAPPDISPOSITION": "Uredi WhatsApp Dispoziciju", + "EDIT_WHATSAPPQUEUE": "Uredi WhatsApp Queue", "ERRORS": { - "PROJECTID_REQUIRED": "Mandatory Field", - "CLIENTEMAIL_REQUIRED": "Mandatory Field", - "PRIVATEKEY_REQUIRED": "Mandatory Field", - "ACCESSKEYID_REQUIRED": "Mandatory Field", - "ACCOUNTSID_REQUIRED": "Mandatory Field", - "AGENT_REQUIRED": "Mandatory Field", - "AGENT_TIMEOUT_REQUIRED": "Mandatory Field", - "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", - "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less or equal than", - "AGENTTRANSFERTIMEOUT_REQUIRED": "Mandatory Field", - "AUTHTOKEN_REQUIRED": "Mandatory Field", - "BASEURL_REQUIRED": "Mandatory Field", - "BOTNAME_REQUIRED": "Mandatory Field", - "COMMAND_REQUIRED": "Mandatory Field", - "CONDITION_REQUIRED": "Mandatory Field", - "DESCRIPTION_REQUIRED": "Mandatory Field", - "DISPOSITION_REQUIRED": "Mandatory Field", - "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", - "FALSEPRIORITY_REQUIRED": "Mandatory Field", - "KEY_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "KEY_REQUIRED": "Mandatory Field", - "LANGUAGE_REQUIRED": "Mandtory Field", - "LEXREGION_REQUIRED": "Mandatory Field", - "LIST_REQUIRED": "Mandatory Field", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Mandatory Field", - "NAME_REQUIRED": "Mandatory Field", - "PHONE_REQUIRED": "Mandatory Field", - "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", - "PRIORITY_REQUIRED": "Mandatory Field", - "QUEUE_REQUIRED": "Mandatory Field", - "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", - "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less or equal than", - "QUEUETRANSFERTIMEOUT_REQUIRED": "Mandatory Field", - "SECRETACCESSKEY_REQUIRED": "Mandatory Field", - "TAG_REQUIRED": "Mandatory Field", - "TEXT_REQUIRED": "Mandatory Field", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", - "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less or equal than", - "TIMEOUT_REQUIRED": "Mandatory Field", - "TIMES_REQUIRED": "Mandatory Field", - "TOKEN_REQUIRED": "Mandatory Field", - "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", - "TRUEPRIORITY_REQUIRED": "Mandatory Field", - "TYPE_REQUIRED": "Mandatory Field", - "VALUE_REQUIRED": "Mandatory Field", - "VARIABLE_REQUIRED": "Mandatory Field", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less or equal than", - "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Mandatory Field", - "WELCOMEMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "WELCOMEMESSAGE_REQUIRED": "Mandatory Field" + "PROJECTID_REQUIRED": "Obavezno Polje", + "CLIENTEMAIL_REQUIRED": "Obavezno Polje", + "PRIVATEKEY_REQUIRED": "Obavezno Polje", + "ACCESSKEYID_REQUIRED": "Obavezno Polje", + "ACCOUNTSID_REQUIRED": "Obavezno Polje", + "AGENT_REQUIRED": "Obavezno Polje", + "AGENT_TIMEOUT_REQUIRED": "Obavezno Polje", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Obavezno Polje", + "AUTHTOKEN_REQUIRED": "Obavezno Polje", + "BASEURL_REQUIRED": "Obavezno Polje", + "BOTNAME_REQUIRED": "Obavezno Polje", + "COMMAND_REQUIRED": "Obavezno Polje", + "CONDITION_REQUIRED": "Obavezno Polje", + "DESCRIPTION_REQUIRED": "Obavezno Polje", + "DISPOSITION_REQUIRED": "Obavezno Polje", + "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "FALSEPRIORITY_REQUIRED": "Obavezno Polje", + "KEY_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "KEY_REQUIRED": "Obavezno Polje", + "LANGUAGE_REQUIRED": "Obavezno Polje", + "LEXREGION_REQUIRED": "Obavezno Polje", + "LIST_REQUIRED": "Obavezno Polje", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Obavezno Polje", + "NAME_REQUIRED": "Obavezno Polje", + "PHONE_REQUIRED": "Obavezno Polje", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "PRIORITY_REQUIRED": "Obavezno Polje", + "QUEUE_REQUIRED": "Obavezno Polje", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Obavezno Polje", + "SECRETACCESSKEY_REQUIRED": "Obavezno Polje", + "TAG_REQUIRED": "Obavezno Polje", + "TEXT_REQUIRED": "Obavezno Polje", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "TIMEOUT_REQUIRED": "Obavezno Polje", + "TIMES_REQUIRED": "Obavezno Polje", + "TOKEN_REQUIRED": "Obavezno Polje", + "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "TRUEPRIORITY_REQUIRED": "Obavezno Polje", + "TYPE_REQUIRED": "Obavezno Polje", + "VALUE_REQUIRED": "Obavezno Polje", + "VARIABLE_REQUIRED": "Obavezno Polje", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Obavezno Polje", + "WELCOMEMESSAGE_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "WELCOMEMESSAGE_REQUIRED": "Obavezno Polje" }, "FALSEPRIORITY": "False Priority", - "GENERAL": "General", - "GO_TO_WHATSAPPACCOUNTS": "Go To Account", + "GENERAL": "Općenito", + "GO_TO_WHATSAPPACCOUNTS": "Idi Na Nalog", "GOTOIF": "Gotoif", "GOTOP": "Gotop", - "GOTOREALTIME_WHATSAPPQUEUE": "Go To Realtime WhatsApp Queue", + "GOTOREALTIME_WHATSAPPQUEUE": "Idi na Realtime WhatsApp Queue", "HELP": { - "LIST": "Contact Manager list used to associate contacts", - "MANDATORYDISPOSITION": "Mandatory disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pause to use when mandatory disposition is enabled", - "MOTIONPROXY": "The field must have the following format: ://[:]. Example: https://X.Y.Z.W", - "NAME": "Only numbers, letters and specific characters (._) are supported", - "RECEIVEURL": "This is the auto-generated API string you need to use to receive the messages inside your account from your WhatsApp Connector provider (POST method must be used): click the clipboard button to copy it", - "WELCOMEMESSAGE": "This is the first response message sent to new interactions" + "LIST": "Kontakt Menadžer lista koja se koristi za povezivanje Kontakata", + "MANDATORYDISPOSITION": "Obavezna dispozicija", + "MANDATORYDISPOSITIONPAUSEID": "Pauza koja se koristi ako je obavezna dispozicija uključena", + "MOTIONPROXY": "Polje mora imati sljedeći format: ://[:]. Primjer: https://X.Y.Z.W", + "NAME": "Podržani su samo brojevi, slova i specifični znakovi (._)", + "RECEIVEURL": "Ovo je automatski generisani API niz koji treba koristiti za primanje poruka unutar tvog računa od tvog WhatsApp Konektor provajdera (mora se koristiti POST metoda): kliknite na dugme međuspremnika da biste ga kopirali", + "WELCOMEMESSAGE": "Ovo je prva poruka odgovora poslana novim interakcijama" }, - "ID": "Id", + "ID": "ID", "IDLE": "Idle", - "INSERT_MESSAGE_HERE": "Insert message here", - "INTERACTIONS": "Interactions", - "INTERACTIONS_WHATSAPPACCOUNT": "Go to Interactions", - "KEY": "Key", - "LANGUAGE": "Language", - "LASTMESSAGE": "Last Message", + "INSERT_MESSAGE_HERE": "Ovdje upiši svoju tekstualnu poruku", + "INTERACTIONS": "Interakcije", + "INTERACTIONS_WHATSAPPACCOUNT": "Idi na Interakcije", + "KEY": "Ključ", + "LANGUAGE": "Jezik", + "LASTMESSAGE": "Zadnja poruka", "LEXREGION": "Region", - "LIST": "List", - "LOGGED_IN": "Logged In (SIP Connected)", - "LOGIN_TIME": "Login Time", - "LOGOUT": "Logout", - "MANDATORYDISPOSITION": "Mandatory Disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pause to use when mandatory disposition is enabled", - "MORE": "More", - "MOTIONPROXY": "Proxy Or Motion Domain", - "MULTI_SELECT_TOGGLE": "Multi select toggle", - "NAME": "Name", - "NEW_WHATSAPPACCOUNT": "New WhatsApp Account", - "NEW_WHATSAPPCANNEDANSWER": "New WhatsApp Canned Answer", - "NEW_WHATSAPPDISPOSITION": "New WhatsApp Disposition", - "NEW_WHATSAPPQUEUE": "New WhatsApp Queue", - "NO_AGENT_ONLINE": "No Agent Online", - "NO_AVAILABLE_INFO": "No Available Info", - "NO_INTERACTION_AVAILABLE": "No Interactions Available", - "NO_WHATSAPP_ACCOUNTS_AVAILABLE": "No WhatsApp Accounts available", - "NO_WHATSAPPCANNEDANSWER_AVAILABLE": "No WhatsApp Canned Answers Available", - "NO_WHATSAPPDISPOSITION_AVAILABLE": "No WhatsApp Dispositions Available", + "LIST": "Lista", + "LOGGED_IN": "Prijavljen (SIP konektovan)", + "LOGIN_TIME": "Vrijeme prijave", + "LOGOUT": "Odjava", + "MANDATORYDISPOSITION": "Obavezna dispozicija", + "MANDATORYDISPOSITIONPAUSEID": "Pauza koja se koristi ukoliko je Obavezna dispozicija uključena", + "MORE": "Više", + "MOTIONPROXY": "Proxy Or Motion Domena", + "MULTI_SELECT_TOGGLE": "Višestruki odabir lista", + "NAME": "Naziv", + "NEW_WHATSAPPACCOUNT": "Novi WhatsApp Nalog", + "NEW_WHATSAPPCANNEDANSWER": "Novi WhatsApp Pripremljeni Odgovor ", + "NEW_WHATSAPPDISPOSITION": "Nova WhatsApp Dispozicija", + "NEW_WHATSAPPQUEUE": "Novi WhatsApp Queue", + "NO_AGENT_ONLINE": "Nema Specijalista Online", + "NO_AVAILABLE_INFO": "Nema dostupnih informacija", + "NO_INTERACTION_AVAILABLE": "Nema dostupnih Interakcija", + "NO_WHATSAPP_ACCOUNTS_AVAILABLE": "Nema WhatsApp dostupnih naloga", + "NO_WHATSAPPCANNEDANSWER_AVAILABLE": "Nema WhatsApp dostupnih Pripremljenih Odgovora", + "NO_WHATSAPPDISPOSITION_AVAILABLE": "Nema dostupnih WhatsApp Dispozicija", "NOOP": "Noop", - "NOTE": "Note", - "NOTIFICATION": "Notification", - "NOTIFICATIONSHAKE": "Shake", + "NOTE": "Bilješka", + "NOTIFICATION": "Obavijest", + "NOTIFICATIONSHAKE": "Protresi", "NOTIFICATIONSOUND": "Sound", - "NOTIFICATIONTEMPLATE": "Template", - "OF": "of", - "OPENED": "Opened", - "PAGE": "Page", - "PARTIALPAUSE": "Partial Pause", - "PAUSE": "Pause", - "PAUSE_TIME": "Pause Time", - "PAUSED": "Paused", - "PHONE": "Phone", - "PRIORITY": "Priority", + "NOTIFICATIONTEMPLATE": "Šablon", + "OF": "od", + "OPENED": "Otvoreno", + "PAGE": "Stranica", + "PARTIALPAUSE": "Djelomična pauza", + "PAUSE": "Pauza", + "PAUSE_TIME": "Vrijeme pauze", + "PAUSED": "Pauzirano", + "PHONE": "Telefon", + "PRIORITY": "Prioritet", "PROXY": "Proxy", "QUEUE": "Queue", "QUEUES": "Queues", - "QUEUETRANSFER": "Queue Transfer", - "QUEUETRANSFERTIMEOUT": "Queue Transfer Timeout", - "READY": "Ready", + "QUEUETRANSFER": "Prijenos Queue", + "QUEUETRANSFERTIMEOUT": "Prijenos Queue Timeout", + "READY": "Spreman", "REALTIME": "Realtime", - "RECEIVEURL": "Receive URL", - "DELIVERYREPORTURL": "Delivery report URL", - "REFRESH_INTERACTIONS": "Refresh Interactions", - "REMOTE": "Remote", - "ROWSPERPAGE": "Rows per page", - "SAVE": "Save", - "SCREENRECORDING": "Manage Screen Recording", - "SEARCH_FOR_ANYONE": "Search", - "SECRETACCESSKEY": "Access key secret", - "SELECT_ALL": "Select all", - "SELECT_NONE": "Select none", - "SELECTED": "Selected", - "SELECTED_AGENTS": "Selected Agents", - "SELECTED_TEAMS": "Selected Teams", - "SEND": "Send", - "SETTINGS": "Settings", - "SPYINTERACTION": "Spy Interaction", - "START_SCREENRECORDING": "Start Screen Recording", - "STARTEDAT": "Started at", + "RECEIVEURL": "Prihvatni URL", + "DELIVERYREPORTURL": "Izvještaj isporuke URL", + "REFRESH_INTERACTIONS": "Osvježi Interakciju", + "REMOTE": "Daljinski", + "ROWSPERPAGE": "Redova po stranici", + "SAVE": "Sačuvaj", + "SCREENRECORDING": "Upravljanje Snimanjem Ekrana", + "SEARCH_FOR_ANYONE": "Traži", + "SECRETACCESSKEY": "Tajni Pristupni Ključ", + "SELECT_ALL": "Odaberi Sve", + "SELECT_NONE": "Odaberi Ništa", + "SELECTED": "Odabrano", + "SELECTED_AGENTS": "Odabrani Specijalisti", + "SELECTED_TEAMS": "Odabrani Timovi", + "SEND": "Pošalji", + "SETTINGS": "Postavke", + "SPYINTERACTION": "Spy Interakcije", + "START_SCREENRECORDING": "Započni Snimanje Ekrana", + "STARTEDAT": "Počelo U", "STATUS": "Status", - "STOP_SCREENRECORDING": "Stop Screen Recording", - "STRATEGY": "Strategy", - "SYSTEM": "System", + "STOP_SCREENRECORDING": "Zaustavi Snimanje Ekrana", + "STRATEGY": "Strategija", + "SYSTEM": "Sistem", "TAG": "Tag", - "TAGS": "Tags", - "TEAMADD_WHATSAPPQUEUE": "Add Team To WhatsApp Queue", - "TEAMS_ASSOCIATION": "Teams Association", - "TEXT": "Text", + "TAGS": "Tagovi", + "TEAMADD_WHATSAPPQUEUE": "Dodaj Team u WhatsApp Queue", + "TEAMS_ASSOCIATION": "Asocijacija Timova", + "TEXT": "Tekst", "TIMEOUT": "Timeout", "TIMER": "Timer", - "TIMES": "Times", - "TO": "To", + "TIMES": "Broj puta po interakciji", + "TO": "Za", "TOKEN": "Token", - "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available", - "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", - "TRANSFER": "Transfer", - "TRUEPRIORITY": "True Priority", - "TYPE": "Type", - "UNPAUSE": "End Pause", + "TOOLTIP_SCREENRECORDING_OFF": "Snimanje Ekrana dostupno", + "TOOLTIP_SCREENRECORDING_ON": "Snimanje Ekrana u procesu", + "TRANSFER": "Prijenos", + "TRUEPRIORITY": "Pravi Prioritet", + "TYPE": "Vrsta", + "UNPAUSE": "Završi Pauzu", "VALUE": "Value", - "VARIABLE": "Variable", - "WAITFORTHEASSIGNEDAGENT": "Wait for the assigned agent", - "WAITING": "Waiting", - "WELCOMEMESSAGE": "Welcome Message", - "WHATSAPP": "WhatsApp Connector", - "WHATSAPPACCOUNTS": "WhatsApp Accounts", - "WHATSAPPCANNEDANSWERS": "WhatsApp Canned Answers", - "WHATSAPPDISPOSITIONS": "WhatsApp Dispositions", + "VARIABLE": "Vrijednost", + "WAITFORTHEASSIGNEDAGENT": "Pričekaj dodijeljenog specijalistu", + "WAITING": "Čekanje", + "WELCOMEMESSAGE": "Poruka Čekanja", + "WHATSAPP": "WhatsApp Konektor", + "WHATSAPPACCOUNTS": "WhatsApp Nalozi", + "WHATSAPPCANNEDANSWERS": "WhatsApp Pripremljeni Odgovori", + "WHATSAPPDISPOSITIONS": "WhatsApp Dispozicije", "WHATSAPPQUEUES": "WhatsApp Queues" } } diff --git a/public/app/main/apps/whatsapp/i18n/et.json b/public/app/main/apps/whatsapp/i18n/et.json index e8c6282..330cf45 100644 --- a/public/app/main/apps/whatsapp/i18n/et.json +++ b/public/app/main/apps/whatsapp/i18n/et.json @@ -50,7 +50,8 @@ "WELCOMEMESSAGE_REQUIRED": "Kohustuslik väli", "CLIENTEMAIL_REQUIRED": "Kohustuslik väli", "PRIVATEKEY_REQUIRED": "Kohustuslik väli", - "PROJECTID_REQUIRED": "Kohustuslik väli" + "PROJECTID_REQUIRED": "Kohustuslik väli", + "BASEURL_REQUIRED": "Kohustuslik väli" }, "HELP": { "LIST": "Kontaktide halduri loend, mida kasutatakse kontaktide seostamiseks", @@ -239,6 +240,8 @@ "DIALOGFLOWV2": "Dialoogivoog V2", "EDIT_DIALOGFLOWV2": "Redigeerimise dialoogivoog V2", "PRIVATEKEY": "Privaatne võti", - "PROJECTID": "Projekti ID" + "PROJECTID": "Projekti ID", + "BASEURL": "Baas-URL", + "DELIVERYREPORTURL": "Edastamisaruande URL" } } diff --git a/public/app/main/apps/whatsapp/i18n/is.json b/public/app/main/apps/whatsapp/i18n/is.json new file mode 100644 index 0000000..68808ad --- /dev/null +++ b/public/app/main/apps/whatsapp/i18n/is.json @@ -0,0 +1,247 @@ +{ + "WHATSAPP": { + "EDIT_DIALOGFLOWV2": "Edit Dialogflow V2", + "DIALOGFLOWV2": "Dialogflow V2", + "PRIVATEKEY": "Private Key", + "CLIENTEMAIL": "Client Email", + "PROJECTID": "Project ID", + "ACCESSKEYID": "Access Key ID", + "ACCOUNTSID": "Account SID", + "ACTIONS": "Actions", + "ADD_NOTE": "Add note", + "ADD_WHATSAPPACCOUNT": "Add", + "ADD_WHATSAPPCANNEDANSWER": "Add Canned Answer", + "ADD_WHATSAPPDISPOSITION": "Add WhatsApp Disposition", + "ADD_WHATSAPPQUEUE": "Add WhatsApp queue", + "ADVANCED": "Advanced", + "AGENT": "Agent", + "AGENT_TIMEOUT": "Agent Timeout", + "AGENTADD_QUEUE": "Add Agent To WhatsApp Queue", + "AGENTADD_WHATSAPPACCOUNT": "Add Agent To WhatsApp Account", + "AGENTADD_WHATSAPPQUEUE": "Add Agent To WhatsApp Queue", + "AGENTS": "Agents", + "AGENTSADD_QUEUE": "Add agents to WhatsApp queue", + "AGENTTRANSFER": "Agent Transfer", + "AGENTTRANSFERTIMEOUT": "Agent Transfer Timeout", + "ALL": "All", + "ALL_AGENTS": "All Agents", + "ALL_TEAMS": "All Teams", + "AMAZONLEX": "AmazonLex", + "AUTHTOKEN": "Auth Token", + "AUTOREPLY": "Auto Reply", + "BACK": "Back", + "BASEURL": "Base URL", + "BOTNAME": "Bot Name", + "BUSY": "Busy", + "CANNED_ANSWER_NOT_FOUND": "No Canned Answers were found", + "CANNED_ANSWER_SEARCH": "Enter a text to search a Canned Answer", + "CANNEDANSWERS": "Canned Answers", + "CAPACITY": "Capacity", + "CLOSE": "Close", + "CLOSED": "Closed", + "CLOSEMETHOD": "Close Method", + "CLOSEURL": "Close URL", + "COMMAND": "Command", + "CONDITION": "Condition", + "CONTACT": "Contact", + "CREATED_AT": "Created at", + "DEFAULT_PAUSE": "DEFAULT PAUSE", + "DELETE": "Delete", + "DELETE_INTERACTION": "Delete Interaction", + "DELETE_SELECTED": "Delete selected", + "DELETE_WHATSAPPACCOUNT": "Delete WhatsApp Account", + "DELETE_WHATSAPPCANNEDANSWER": "Deleted", + "DELETE_WHATSAPPDISPOSITION": "Delete WhatsApp Disposition", + "DELETE_WHATSAPPQUEUE": "Delete WhatsApp Queue", + "DESCRIPTION": "Description", + "DIALOGFLOW": "DialogFlow", + "DISPOSITION": "Disposition", + "DISPOSITIONS": "Dispositions", + "DOWNLOAD_INTERACTION": "Download", + "DOWNLOAD_WITH_ATTACHMENTS": "Download With Attachments", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download Without Attachments", + "EDIT_AGENT": "Edit Agent", + "EDIT_AMAZONLEX": "Edit Lex configuration", + "EDIT_AUTOREPLY": "Edit Auto Reply", + "EDIT_CLOSE": "Edit Close", + "EDIT_DIALOGFLOW": "Edit DialogFlow configuration", + "EDIT_GOTOIF": "Edit Gotoif", + "EDIT_GOTOP": "Edit Gotop", + "EDIT_NOOP": "Edit Noop", + "EDIT_QUEUE": "Edit Queue", + "EDIT_SYSTEM": "Edit System", + "EDIT_TAG": "Edit Tag", + "EDIT_WHATSAPPACCOUNT": "Edit WhatsApp Account", + "EDIT_WHATSAPPCANNEDANSWER": "Edit", + "EDIT_WHATSAPPDISPOSITION": "Edit WhatsApp Disposition", + "EDIT_WHATSAPPQUEUE": "Edit WhatsApp Queue", + "ERRORS": { + "PROJECTID_REQUIRED": "Mandatory Field", + "CLIENTEMAIL_REQUIRED": "Mandatory Field", + "PRIVATEKEY_REQUIRED": "Mandatory Field", + "ACCESSKEYID_REQUIRED": "Mandatory Field", + "ACCOUNTSID_REQUIRED": "Mandatory Field", + "AGENT_REQUIRED": "Mandatory Field", + "AGENT_TIMEOUT_REQUIRED": "Mandatory Field", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less or equal than", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Mandatory Field", + "AUTHTOKEN_REQUIRED": "Mandatory Field", + "BASEURL_REQUIRED": "Mandatory Field", + "BOTNAME_REQUIRED": "Mandatory Field", + "COMMAND_REQUIRED": "Mandatory Field", + "CONDITION_REQUIRED": "Mandatory Field", + "DESCRIPTION_REQUIRED": "Mandatory Field", + "DISPOSITION_REQUIRED": "Mandatory Field", + "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", + "FALSEPRIORITY_REQUIRED": "Mandatory Field", + "KEY_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "KEY_REQUIRED": "Mandatory Field", + "LANGUAGE_REQUIRED": "Mandtory Field", + "LEXREGION_REQUIRED": "Mandatory Field", + "LIST_REQUIRED": "Mandatory Field", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Mandatory Field", + "NAME_REQUIRED": "Mandatory Field", + "PHONE_REQUIRED": "Mandatory Field", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", + "PRIORITY_REQUIRED": "Mandatory Field", + "QUEUE_REQUIRED": "Mandatory Field", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less or equal than", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Mandatory Field", + "SECRETACCESSKEY_REQUIRED": "Mandatory Field", + "TAG_REQUIRED": "Mandatory Field", + "TEXT_REQUIRED": "Mandatory Field", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less or equal than", + "TIMEOUT_REQUIRED": "Mandatory Field", + "TIMES_REQUIRED": "Mandatory Field", + "TOKEN_REQUIRED": "Mandatory Field", + "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", + "TRUEPRIORITY_REQUIRED": "Mandatory Field", + "TYPE_REQUIRED": "Mandatory Field", + "VALUE_REQUIRED": "Mandatory Field", + "VARIABLE_REQUIRED": "Mandatory Field", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less or equal than", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Mandatory Field", + "WELCOMEMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", + "WELCOMEMESSAGE_REQUIRED": "Mandatory Field" + }, + "FALSEPRIORITY": "False Priority", + "GENERAL": "General", + "GO_TO_WHATSAPPACCOUNTS": "Go To Account", + "GOTOIF": "Gotoif", + "GOTOP": "Gotop", + "GOTOREALTIME_WHATSAPPQUEUE": "Go To Realtime WhatsApp Queue", + "HELP": { + "LIST": "Contact Manager list used to associate contacts", + "MANDATORYDISPOSITION": "Mandatory disposition", + "MANDATORYDISPOSITIONPAUSEID": "Pause to use when mandatory disposition is enabled", + "MOTIONPROXY": "The field must have the following format: ://[:]. Example: https://X.Y.Z.W", + "NAME": "Only numbers, letters and specific characters (._) are supported", + "RECEIVEURL": "This is the auto-generated API string you need to use to receive the messages inside your account from your WhatsApp Connector provider (POST method must be used): click the clipboard button to copy it", + "WELCOMEMESSAGE": "This is the first response message sent to new interactions" + }, + "ID": "Id", + "IDLE": "Idle", + "INSERT_MESSAGE_HERE": "Insert message here", + "INTERACTIONS": "Interactions", + "INTERACTIONS_WHATSAPPACCOUNT": "Go to Interactions", + "KEY": "Key", + "LANGUAGE": "Language", + "LASTMESSAGE": "Last Message", + "LEXREGION": "Region", + "LIST": "List", + "LOGGED_IN": "Logged In (SIP Connected)", + "LOGIN_TIME": "Login Time", + "LOGOUT": "Logout", + "MANDATORYDISPOSITION": "Mandatory Disposition", + "MANDATORYDISPOSITIONPAUSEID": "Pause to use when mandatory disposition is enabled", + "MORE": "More", + "MOTIONPROXY": "Proxy Or Motion Domain", + "MULTI_SELECT_TOGGLE": "Multi select toggle", + "NAME": "Name", + "NEW_WHATSAPPACCOUNT": "New WhatsApp Account", + "NEW_WHATSAPPCANNEDANSWER": "New WhatsApp Canned Answer", + "NEW_WHATSAPPDISPOSITION": "New WhatsApp Disposition", + "NEW_WHATSAPPQUEUE": "New WhatsApp Queue", + "NO_AGENT_ONLINE": "No Agent Online", + "NO_AVAILABLE_INFO": "No Available Info", + "NO_INTERACTION_AVAILABLE": "No Interactions Available", + "NO_WHATSAPP_ACCOUNTS_AVAILABLE": "No WhatsApp Accounts available", + "NO_WHATSAPPCANNEDANSWER_AVAILABLE": "No WhatsApp Canned Answers Available", + "NO_WHATSAPPDISPOSITION_AVAILABLE": "No WhatsApp Dispositions Available", + "NOOP": "Noop", + "NOTE": "Note", + "NOTIFICATION": "Notification", + "NOTIFICATIONSHAKE": "Shake", + "NOTIFICATIONSOUND": "Sound", + "NOTIFICATIONTEMPLATE": "Template", + "OF": "of", + "OPENED": "Opened", + "PAGE": "Page", + "PARTIALPAUSE": "Partial Pause", + "PAUSE": "Pause", + "PAUSE_TIME": "Pause Time", + "PAUSED": "Paused", + "PHONE": "Phone", + "PRIORITY": "Priority", + "PROXY": "Proxy", + "QUEUE": "Queue", + "QUEUES": "Queues", + "QUEUETRANSFER": "Queue Transfer", + "QUEUETRANSFERTIMEOUT": "Queue Transfer Timeout", + "READY": "Ready", + "REALTIME": "Realtime", + "RECEIVEURL": "Receive URL", + "DELIVERYREPORTURL": "Delivery report URL", + "REFRESH_INTERACTIONS": "Refresh Interactions", + "REMOTE": "Remote", + "ROWSPERPAGE": "Rows per page", + "SAVE": "Save", + "SCREENRECORDING": "Manage Screen Recording", + "SEARCH_FOR_ANYONE": "Search", + "SECRETACCESSKEY": "Access key secret", + "SELECT_ALL": "Select all", + "SELECT_NONE": "Select none", + "SELECTED": "Selected", + "SELECTED_AGENTS": "Selected Agents", + "SELECTED_TEAMS": "Selected Teams", + "SEND": "Send", + "SETTINGS": "Settings", + "SPYINTERACTION": "Spy Interaction", + "START_SCREENRECORDING": "Start Screen Recording", + "STARTEDAT": "Started at", + "STATUS": "Status", + "STOP_SCREENRECORDING": "Stop Screen Recording", + "STRATEGY": "Strategy", + "SYSTEM": "System", + "TAG": "Tag", + "TAGS": "Tags", + "TEAMADD_WHATSAPPQUEUE": "Add Team To WhatsApp Queue", + "TEAMS_ASSOCIATION": "Teams Association", + "TEXT": "Text", + "TIMEOUT": "Timeout", + "TIMER": "Timer", + "TIMES": "Times", + "TO": "To", + "TOKEN": "Token", + "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available", + "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", + "TRANSFER": "Transfer", + "TRUEPRIORITY": "True Priority", + "TYPE": "Type", + "UNPAUSE": "End Pause", + "VALUE": "Value", + "VARIABLE": "Variable", + "WAITFORTHEASSIGNEDAGENT": "Wait for the assigned agent", + "WAITING": "Waiting", + "WELCOMEMESSAGE": "Welcome Message", + "WHATSAPP": "WhatsApp Connector", + "WHATSAPPACCOUNTS": "WhatsApp Accounts", + "WHATSAPPCANNEDANSWERS": "WhatsApp Canned Answers", + "WHATSAPPDISPOSITIONS": "WhatsApp Dispositions", + "WHATSAPPQUEUES": "WhatsApp Queues" + } +} diff --git a/public/app/quick-panel/i18n/bs.json b/public/app/quick-panel/i18n/bs.json index fd2a755..e1803e1 100644 --- a/public/app/quick-panel/i18n/bs.json +++ b/public/app/quick-panel/i18n/bs.json @@ -1,73 +1,73 @@ { "QUICKPANEL": { - "EXPIRATION_GRAY_PERIOD": "Expiration Gray Period", - "NO_AVAILABLE_GROUPS": "No Available Groups", - "SAVE": "Save", + "EXPIRATION_GRAY_PERIOD": "Istek Gray Perioda", + "NO_AVAILABLE_GROUPS": "Nema Dostupnih Grupa", + "SAVE": "Sačuvaj", "INFO": "Info", - "NEW_CHATGROUP": "New Group", - "NAME": "Name", - "MEMBERS": "Members", - "ENABLE_WRITING": "Enable Writing", - "GROUPS": "Groups", - "YOU": "You + {{participants}}", - "NEW_INTERNAL_MESSAGE": "New internal message", - "DELETE": "Delete", - "SEARCH": "Search", - "USERS": "Users", - "TODAY": "TODAY", - "MONDAY": "Monday", - "TUESDAY": "Tuesday", - "WEDNESDAY": "Wednesday", - "THURSDAY": "Thursday", - "FRIDAY": "Friday", - "SATURDAY": "Saturday", - "SUNDAY": "Sunday", - "JANUARY": "January", - "FEBRUARY": "February", - "MARCH": "March", + "NEW_CHATGROUP": "Nova Grupa", + "NAME": "Ime", + "MEMBERS": "Članovi", + "ENABLE_WRITING": "Omogući Pisanje", + "GROUPS": "Grupe", + "YOU": "Ti + {{participants}}", + "NEW_INTERNAL_MESSAGE": "Nova interna poruka", + "DELETE": "Izbriši", + "SEARCH": "Traži", + "USERS": "Korisnici", + "TODAY": "DANAS", + "MONDAY": "Ponedjeljak", + "TUESDAY": "Utorak", + "WEDNESDAY": "Srijeda", + "THURSDAY": "Četvrtak", + "FRIDAY": "Petak", + "SATURDAY": "Subota", + "SUNDAY": "Nedjelja", + "JANUARY": "Januar", + "FEBRUARY": "Februar", + "MARCH": "Mart", "APRIL": "April", - "MAY": "May", - "JUNE": "June", - "JULY": "July", + "MAY": "Maj", + "JUNE": "Juni", + "JULY": "Juli", "AUGUST": "August", - "SEPTEMBER": "September", - "OCTOBER": "October", - "NOVEMBER": "November", - "DECEMBER": "December", + "SEPTEMBER": "Septembar", + "OCTOBER": "Oktobar", + "NOVEMBER": "Novembar", + "DECEMBER": "Decembar", "CHAT": "CHAT", - "ACTIVITY": "ACTIVITY", - "FRIENDS": "Friends", - "APP_SERVERS": "Application Servers", - "USER_STATS": "User Stats", - "EVENTS": "Events", - "NOTES": "Notes", - "QUICK_SETTINGS": "Quick Settings", - "NOTIFICATIONS": "Notifications", + "ACTIVITY": "AKTIVNOST", + "FRIENDS": "Prijatelji", + "APP_SERVERS": "Serveri Aplikacije", + "USER_STATS": "Statusi Korisnika", + "EVENTS": "Događaji", + "NOTES": "Bilješke", + "QUICK_SETTINGS": "Brze Postavke", + "NOTIFICATIONS": "Obavještenja", "CLOUD_SYNC": "Cloud Sync", - "RETRO_THRUSTERS": "Retro Thrusters", - "RECENT": "Recent", - "START_NEW_CHAT": "Start New Chat", - "BACK": "Back", - "CALL": "Call", - "MORE": "More", - "SEND_MESSAGE": "Send message", - "REPLY_PLACEHOLDER": "Type and hit enter to send message", - "CONTACT_XCALLY_MOTION_SUPPORT": "Contact xCALLY Motion Support", - "EXPIRATION_DATE": "Expiration Date", - "EXPIRATION_REASON": "Expiration Reason", - "LICENSE": "License", - "NEW_TOKEN": "New Token", - "OLD_TOKEN": "Old Token", - "SEND_EMAIL_TO": "Send Email To", + "RETRO_THRUSTERS": "Retro Potisnici", + "RECENT": "Nedavno", + "START_NEW_CHAT": "Započni Novi Chat", + "BACK": "Nazad", + "CALL": "Pozovi", + "MORE": "Više", + "SEND_MESSAGE": "Pošalji poruku", + "REPLY_PLACEHOLDER": "Ukucajte i pritisnite enter da pošaljete poruku", + "CONTACT_XCALLY_MOTION_SUPPORT": "Kontaktiraj XCally Motion Podršku", + "EXPIRATION_DATE": "Datum Isteka", + "EXPIRATION_REASON": "Razlog Isteka", + "LICENSE": "Licenca", + "NEW_TOKEN": "Novi Token", + "OLD_TOKEN": "Stari Token", + "SEND_EMAIL_TO": "Pošalji E-mail", "TOKEN": "Token", - "EXPIRATION_REASON_MESSAGE": "Your license has expired or your machine unique id has been updated due to a change to your system. Contact xCALLY Motion Support Team sending both your old and your new uuid.", - "GRAY_PERIOD_EXPIRATION": "Gray Period Expiration", - "EXPIRATION_REASON_MESSAGE_GRAY": "Your license has expired or has been disabled. Contact xCALLY Motion Support Team.", - "EXPIRATION_REASON_MESSAGE_CHANGED": "Your machine unique id has been updated due to a change to your system. Contact xCALLY Motion Support Team sending both your old and your new uuid.", - "MESSENGER_DISABLED": "The internal messaging is disabled for this agent!", - "WARNING": "Warning", + "EXPIRATION_REASON_MESSAGE": "Tvoja licenca je istekla ili je tvoj jedinstveni ID uređaja ažuriran zbog promjena na tvom sistemu.", + "GRAY_PERIOD_EXPIRATION": "Istek Gray Perioda", + "EXPIRATION_REASON_MESSAGE_GRAY": "Tvoja licenca je istekla ili je onemogućena. Kontaktiraj XCally Motion Podršku.", + "EXPIRATION_REASON_MESSAGE_CHANGED": "Jedinstveni ID uređaja je ažuriran zbog promjena na tvom sistemu. Kontaktiraj XCally Motion Podršku, i pošalji stari i novi UUID. ", + "MESSENGER_DISABLED": "Interna razmjena poruka je onemogućena za ovog specijalistu!", + "WARNING": "Upozorenje", "ERRORS": { - "NAME_REQUIRED": "Mandatory Field" + "NAME_REQUIRED": "Obavezno polje" } } } diff --git a/public/app/quick-panel/i18n/cs.json b/public/app/quick-panel/i18n/cs.json index fd2a755..ed82376 100644 --- a/public/app/quick-panel/i18n/cs.json +++ b/public/app/quick-panel/i18n/cs.json @@ -1,73 +1,73 @@ { "QUICKPANEL": { "EXPIRATION_GRAY_PERIOD": "Expiration Gray Period", - "NO_AVAILABLE_GROUPS": "No Available Groups", - "SAVE": "Save", + "NO_AVAILABLE_GROUPS": "Žádné dostupné skupiny", + "SAVE": "Uložit", "INFO": "Info", - "NEW_CHATGROUP": "New Group", - "NAME": "Name", - "MEMBERS": "Members", - "ENABLE_WRITING": "Enable Writing", - "GROUPS": "Groups", - "YOU": "You + {{participants}}", - "NEW_INTERNAL_MESSAGE": "New internal message", - "DELETE": "Delete", - "SEARCH": "Search", - "USERS": "Users", - "TODAY": "TODAY", - "MONDAY": "Monday", - "TUESDAY": "Tuesday", - "WEDNESDAY": "Wednesday", - "THURSDAY": "Thursday", - "FRIDAY": "Friday", - "SATURDAY": "Saturday", - "SUNDAY": "Sunday", - "JANUARY": "January", - "FEBRUARY": "February", - "MARCH": "March", - "APRIL": "April", - "MAY": "May", - "JUNE": "June", - "JULY": "July", - "AUGUST": "August", - "SEPTEMBER": "September", - "OCTOBER": "October", - "NOVEMBER": "November", - "DECEMBER": "December", + "NEW_CHATGROUP": "Nová skupina", + "NAME": "Jméno", + "MEMBERS": "Členové", + "ENABLE_WRITING": "Povolit zápis", + "GROUPS": "Skupiny", + "YOU": "Vy + {{participants}}", + "NEW_INTERNAL_MESSAGE": "Nová interní zpráva", + "DELETE": "Vymazat", + "SEARCH": "Vyhledat", + "USERS": "Uživatelé", + "TODAY": "DNES", + "MONDAY": "Pondělí", + "TUESDAY": "Úterý", + "WEDNESDAY": "Středa", + "THURSDAY": "Čtvrtek", + "FRIDAY": "Pátek", + "SATURDAY": "Sobota", + "SUNDAY": "Neděle", + "JANUARY": "Leden", + "FEBRUARY": "Únor", + "MARCH": "Březen", + "APRIL": "Duben", + "MAY": "Květen", + "JUNE": "Červen", + "JULY": "Červenec", + "AUGUST": "Srpen", + "SEPTEMBER": "Září", + "OCTOBER": "Říjen", + "NOVEMBER": "Listopad", + "DECEMBER": "Prosinec", "CHAT": "CHAT", - "ACTIVITY": "ACTIVITY", - "FRIENDS": "Friends", - "APP_SERVERS": "Application Servers", - "USER_STATS": "User Stats", - "EVENTS": "Events", - "NOTES": "Notes", - "QUICK_SETTINGS": "Quick Settings", - "NOTIFICATIONS": "Notifications", - "CLOUD_SYNC": "Cloud Sync", + "ACTIVITY": "AKTIVITA", + "FRIENDS": "Přátelé", + "APP_SERVERS": "Aplikační servery", + "USER_STATS": "Uživatelské statistiky", + "EVENTS": "Události", + "NOTES": "Poznámky", + "QUICK_SETTINGS": "Rychlé nastavení", + "NOTIFICATIONS": "Oznámení", + "CLOUD_SYNC": "Cloud Synch", "RETRO_THRUSTERS": "Retro Thrusters", - "RECENT": "Recent", - "START_NEW_CHAT": "Start New Chat", - "BACK": "Back", - "CALL": "Call", - "MORE": "More", - "SEND_MESSAGE": "Send message", - "REPLY_PLACEHOLDER": "Type and hit enter to send message", + "RECENT": "Současný", + "START_NEW_CHAT": "Spustit nový chat", + "BACK": "Zpět", + "CALL": "Zavolat", + "MORE": "Další", + "SEND_MESSAGE": "Odeslat zprávu", + "REPLY_PLACEHOLDER": "Napište zprávu a odešlete pomocí enter", "CONTACT_XCALLY_MOTION_SUPPORT": "Contact xCALLY Motion Support", - "EXPIRATION_DATE": "Expiration Date", - "EXPIRATION_REASON": "Expiration Reason", - "LICENSE": "License", - "NEW_TOKEN": "New Token", - "OLD_TOKEN": "Old Token", - "SEND_EMAIL_TO": "Send Email To", + "EXPIRATION_DATE": "Datum expirace", + "EXPIRATION_REASON": "Důvod expirace", + "LICENSE": "Licence", + "NEW_TOKEN": "Nový Token", + "OLD_TOKEN": "Starý Token", + "SEND_EMAIL_TO": "Odeslat email na", "TOKEN": "Token", "EXPIRATION_REASON_MESSAGE": "Your license has expired or your machine unique id has been updated due to a change to your system. Contact xCALLY Motion Support Team sending both your old and your new uuid.", "GRAY_PERIOD_EXPIRATION": "Gray Period Expiration", "EXPIRATION_REASON_MESSAGE_GRAY": "Your license has expired or has been disabled. Contact xCALLY Motion Support Team.", "EXPIRATION_REASON_MESSAGE_CHANGED": "Your machine unique id has been updated due to a change to your system. Contact xCALLY Motion Support Team sending both your old and your new uuid.", - "MESSENGER_DISABLED": "The internal messaging is disabled for this agent!", - "WARNING": "Warning", + "MESSENGER_DISABLED": "Interni messager je pro tohoto agenta neaktivní!", + "WARNING": "Varování", "ERRORS": { - "NAME_REQUIRED": "Mandatory Field" + "NAME_REQUIRED": "Povinné pole" } } } diff --git a/public/app/quick-panel/i18n/is.json b/public/app/quick-panel/i18n/is.json new file mode 100644 index 0000000..fd2a755 --- /dev/null +++ b/public/app/quick-panel/i18n/is.json @@ -0,0 +1,73 @@ +{ + "QUICKPANEL": { + "EXPIRATION_GRAY_PERIOD": "Expiration Gray Period", + "NO_AVAILABLE_GROUPS": "No Available Groups", + "SAVE": "Save", + "INFO": "Info", + "NEW_CHATGROUP": "New Group", + "NAME": "Name", + "MEMBERS": "Members", + "ENABLE_WRITING": "Enable Writing", + "GROUPS": "Groups", + "YOU": "You + {{participants}}", + "NEW_INTERNAL_MESSAGE": "New internal message", + "DELETE": "Delete", + "SEARCH": "Search", + "USERS": "Users", + "TODAY": "TODAY", + "MONDAY": "Monday", + "TUESDAY": "Tuesday", + "WEDNESDAY": "Wednesday", + "THURSDAY": "Thursday", + "FRIDAY": "Friday", + "SATURDAY": "Saturday", + "SUNDAY": "Sunday", + "JANUARY": "January", + "FEBRUARY": "February", + "MARCH": "March", + "APRIL": "April", + "MAY": "May", + "JUNE": "June", + "JULY": "July", + "AUGUST": "August", + "SEPTEMBER": "September", + "OCTOBER": "October", + "NOVEMBER": "November", + "DECEMBER": "December", + "CHAT": "CHAT", + "ACTIVITY": "ACTIVITY", + "FRIENDS": "Friends", + "APP_SERVERS": "Application Servers", + "USER_STATS": "User Stats", + "EVENTS": "Events", + "NOTES": "Notes", + "QUICK_SETTINGS": "Quick Settings", + "NOTIFICATIONS": "Notifications", + "CLOUD_SYNC": "Cloud Sync", + "RETRO_THRUSTERS": "Retro Thrusters", + "RECENT": "Recent", + "START_NEW_CHAT": "Start New Chat", + "BACK": "Back", + "CALL": "Call", + "MORE": "More", + "SEND_MESSAGE": "Send message", + "REPLY_PLACEHOLDER": "Type and hit enter to send message", + "CONTACT_XCALLY_MOTION_SUPPORT": "Contact xCALLY Motion Support", + "EXPIRATION_DATE": "Expiration Date", + "EXPIRATION_REASON": "Expiration Reason", + "LICENSE": "License", + "NEW_TOKEN": "New Token", + "OLD_TOKEN": "Old Token", + "SEND_EMAIL_TO": "Send Email To", + "TOKEN": "Token", + "EXPIRATION_REASON_MESSAGE": "Your license has expired or your machine unique id has been updated due to a change to your system. Contact xCALLY Motion Support Team sending both your old and your new uuid.", + "GRAY_PERIOD_EXPIRATION": "Gray Period Expiration", + "EXPIRATION_REASON_MESSAGE_GRAY": "Your license has expired or has been disabled. Contact xCALLY Motion Support Team.", + "EXPIRATION_REASON_MESSAGE_CHANGED": "Your machine unique id has been updated due to a change to your system. Contact xCALLY Motion Support Team sending both your old and your new uuid.", + "MESSENGER_DISABLED": "The internal messaging is disabled for this agent!", + "WARNING": "Warning", + "ERRORS": { + "NAME_REQUIRED": "Mandatory Field" + } + } +} diff --git a/public/app/reset/i18n/bs.json b/public/app/reset/i18n/bs.json index c3cf8da..2213573 100644 --- a/public/app/reset/i18n/bs.json +++ b/public/app/reset/i18n/bs.json @@ -1,20 +1,20 @@ { "RESETPASSWORD": { - "TITLE": "Reset your password", - "EMAIL_ADRESS": "Email address", - "PASSWORD": "Password", - "PASSWORD_CONFIRM": "Password (Confirm)", - "UPDATE_PASSWORD": "RESET MY PASSWORD", - "GO_BACK": "Go back to login", - "PASSWORD_RESET": "Password Reset", - "PASSWORD_RESET_MESSAGE": "Your password has been correctly reset, you can now login!", - "PASSWORD_RESET_ERROR": "Password Reset Error", + "TITLE": "Resetuj svoju lozinku", + "EMAIL_ADRESS": "E-mail adresa", + "PASSWORD": "Lozinka", + "PASSWORD_CONFIRM": "Lozinka (Potvrdi)", + "UPDATE_PASSWORD": "RESETUJ MOJU LOZINKU", + "GO_BACK": "Vrati se na prijavu", + "PASSWORD_RESET": "Reset Lozinke", + "PASSWORD_RESET_MESSAGE": "Tvoja lozinka je ispravno resetovana, sada se možeš prijaviti! ", + "PASSWORD_RESET_ERROR": "Greška Resetiranja Lozinke", "ERRORS": { - "EMAIL_REQUIRED": "Email field is required", - "EMAIL_MUST_VALID": "Email must be a valid e-mail address", - "PASSWORD_REQUIRED": "Password field is required", - "CONFIRM_NOT_MATCH": "The passwords don't match", - "SECURE_PASSWORD_PATTERN": "Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}." + "EMAIL_REQUIRED": "Polje za E-mail je obavezno", + "EMAIL_MUST_VALID": "E-mail mora biti važeća e-mail adresa", + "PASSWORD_REQUIRED": "Polje za lozinku je obavezno", + "CONFIRM_NOT_MATCH": "Lozinke se ne podudaraju", + "SECURE_PASSWORD_PATTERN": "Mora sadržavati najmanje 8 znakova, sa najmanje 1 malim slovom, 1 velikim slovo, 1 numeričkim znakom i 1 posebnim znakom ~!?*@#$%^&-_=+[{]}." } } } diff --git a/public/app/reset/i18n/cs.json b/public/app/reset/i18n/cs.json index c3cf8da..797c909 100644 --- a/public/app/reset/i18n/cs.json +++ b/public/app/reset/i18n/cs.json @@ -1,20 +1,20 @@ { "RESETPASSWORD": { - "TITLE": "Reset your password", - "EMAIL_ADRESS": "Email address", - "PASSWORD": "Password", - "PASSWORD_CONFIRM": "Password (Confirm)", - "UPDATE_PASSWORD": "RESET MY PASSWORD", - "GO_BACK": "Go back to login", - "PASSWORD_RESET": "Password Reset", - "PASSWORD_RESET_MESSAGE": "Your password has been correctly reset, you can now login!", - "PASSWORD_RESET_ERROR": "Password Reset Error", + "TITLE": "Obnovení hesla", + "EMAIL_ADRESS": "Emailová adresa", + "PASSWORD": "Heslo", + "PASSWORD_CONFIRM": "Heslo (potvrzení)", + "UPDATE_PASSWORD": "OBNOVIT HESLO", + "GO_BACK": "Zpět na přihlášení", + "PASSWORD_RESET": "Obnovení hesla", + "PASSWORD_RESET_MESSAGE": "Vaše heslo bylo obnoveno, můžete se přihlásit!", + "PASSWORD_RESET_ERROR": "Chyba při obnovení hesla", "ERRORS": { - "EMAIL_REQUIRED": "Email field is required", - "EMAIL_MUST_VALID": "Email must be a valid e-mail address", - "PASSWORD_REQUIRED": "Password field is required", - "CONFIRM_NOT_MATCH": "The passwords don't match", - "SECURE_PASSWORD_PATTERN": "Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}." + "EMAIL_REQUIRED": "Emailová adresa je povinná", + "EMAIL_MUST_VALID": "Emailová adresa musí být platná", + "PASSWORD_REQUIRED": "Heslo je povinné", + "CONFIRM_NOT_MATCH": "Hesla nesouhlasí", + "SECURE_PASSWORD_PATTERN": "Musí obsahovat minimálně 8 znaků s minimálně 1 malým, 1 velkým písmenem, číslem a 1 speciální znak ~!?*@#$%^&-_=+[{]}." } } } diff --git a/public/app/reset/i18n/is.json b/public/app/reset/i18n/is.json new file mode 100644 index 0000000..c3cf8da --- /dev/null +++ b/public/app/reset/i18n/is.json @@ -0,0 +1,20 @@ +{ + "RESETPASSWORD": { + "TITLE": "Reset your password", + "EMAIL_ADRESS": "Email address", + "PASSWORD": "Password", + "PASSWORD_CONFIRM": "Password (Confirm)", + "UPDATE_PASSWORD": "RESET MY PASSWORD", + "GO_BACK": "Go back to login", + "PASSWORD_RESET": "Password Reset", + "PASSWORD_RESET_MESSAGE": "Your password has been correctly reset, you can now login!", + "PASSWORD_RESET_ERROR": "Password Reset Error", + "ERRORS": { + "EMAIL_REQUIRED": "Email field is required", + "EMAIL_MUST_VALID": "Email must be a valid e-mail address", + "PASSWORD_REQUIRED": "Password field is required", + "CONFIRM_NOT_MATCH": "The passwords don't match", + "SECURE_PASSWORD_PATTERN": "Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}." + } + } +} diff --git a/public/app/toolbar/i18n/ar.json b/public/app/toolbar/i18n/ar.json index 8783ff5..f7d1abd 100644 --- a/public/app/toolbar/i18n/ar.json +++ b/public/app/toolbar/i18n/ar.json @@ -120,6 +120,7 @@ "SMS": "رسالة قصيرة", "WHATSAPP": "ال WhatsApp", "NO_AUTOANSWER_CONFIGURED": "لم يتم تكوين الرد التلقائي للقنوات", - "BOSNIAN": "البوسنية" + "BOSNIAN": "البوسنية", + "ICELANDIC": "جزيرة" } } diff --git a/public/app/toolbar/i18n/bs.json b/public/app/toolbar/i18n/bs.json index 2b659de..ebaee51 100644 --- a/public/app/toolbar/i18n/bs.json +++ b/public/app/toolbar/i18n/bs.json @@ -1,128 +1,129 @@ { "TOOLBAR": { - "CHANGE_LANGUAGE_TITLE": "Change language", - "CHANGE_LANGUAGE_MESSAGE": "Remember to refresh the page to apply RTL Support (if enabled)", - "HEBREW": "Hebrew", - "PREFIXES": "Prefixes", - "CALL": "Call", - "ARABIC": "Arabic", - "INDONESIAN": "Indonesian", - "RESETPASSWORD": "Reset Password", - "PASSWORD_EXPIRE_REMAINING_DAYS": "Remaining days before your password expires", - "BROWSER_COMPATIBILITY": "Browser Compatibility [Chrome, Opera, Safari]", - "RECORDING": "Recording", - "INVALID_LICENSE": "Invalid License", - "BROWSER": "Browser", - "OS": "Operating System", - "REQUIREMENTS": "Requirements", - "LICENSE": "License", + "CHANGE_LANGUAGE_TITLE": "Promijeni jezik", + "CHANGE_LANGUAGE_MESSAGE": "Ne zaboravite osvježiti stranicu da primijenite RTL Podršku (ako jeo omogućena)", + "HEBREW": "Hebrejski", + "PREFIXES": "Prefiksi", + "CALL": "Pozivi", + "ARABIC": "Arapski", + "INDONESIAN": "Indonezijski", + "RESETPASSWORD": "Resetuj Lozinku", + "PASSWORD_EXPIRE_REMAINING_DAYS": "Preostali dani prije isteka lozinke", + "BROWSER_COMPATIBILITY": "Kompatibilnost Pretraživača [Chrome, Opera, Safari]", + "RECORDING": "Snimanje", + "INVALID_LICENSE": "Nevažeća Licenca", + "BROWSER": "Pretraživač", + "OS": "Operativni Sistem", + "REQUIREMENTS": "Zahtjevi", + "LICENSE": "Licenca", "HTTPS": "HTTPS", - "PHONE2CALL": "Phone to call", - "CHANNELS": "Channels", - "CHANNEL": "Channel", - "NUM_NOTIFICATIONS": "Notifications", - "NOTIFICATIONS": "Autoanswer enabled", - "DELAY": "Autoanswer delay [secs]", - "AUTOANSWER_NOTIFICATIONS": "Autoanswer notifications", + "PHONE2CALL": "Telefon za poziv", + "CHANNELS": "Kanali", + "CHANNEL": "Kanal", + "NUM_NOTIFICATIONS": "Obavještenja", + "NOTIFICATIONS": "Automatski odgovor je omogućen", + "DELAY": "Kašnjenje automatskog odgovora [secs] ", + "AUTOANSWER_NOTIFICATIONS": "Obavještenja o automatskim odgovorima", "CHAT": "Chat", - "EMAIL": "Email", + "EMAIL": "E-mail", "SMS": "SMS", - "OPENCHANNEL": "Openchannel", + "OPENCHANNEL": "Otvoreni Kanal", "FAX": "Fax", - "WHATSAPP": "Whatsapp connector", - "WEBRTCSUPPORT": "WebRTC Support", - "REGISTERED": "Registered", - "NOT_REGISTERED": "Not registered", - "WEBRTC_LICENSE_NOT_ENABELD": "WebRTC License is not enabled", - "ATTENDED_TRANSFER": "Attended Tranfer", - "TRANSFER": "Transfer", - "TARGET": "Target", - "CANCEL": "Cancel", - "FILENAME": "File name", + "WHATSAPP": "Whatsapp konektor", + "WEBRTCSUPPORT": "WebRTC Podrška", + "REGISTERED": "Registrovan", + "NOT_REGISTERED": "Nije registrovan", + "WEBRTC_LICENSE_NOT_ENABELD": "WebRTC licenca nije omogućena", + "ATTENDED_TRANSFER": "Prisustvovao Prijenosu", + "TRANSFER": "Prijenos", + "TARGET": "Cilj", + "CANCEL": "Otkaži", + "FILENAME": "Ime datoteke", "STATUS": "Status", - "NO_AUTOANSWER_CONFIGURED": "No autoanswer configured for channels", - "ACTIONS": "Actions", - "SPEAKER": "Speaker", - "RINGING": "Ringing tone", - "MICROPHONE": "Microphone", - "CONFERENCE": "Conference with 2 active sessions", - "PROFILE": "Profile", - "SERVICES": "Services", + "NO_AUTOANSWER_CONFIGURED": "Automatski odgovor nije konfigurisan za kanale", + "ACTIONS": "Radnje", + "SPEAKER": "Zvučnik", + "RINGING": "Ton zvuka", + "MICROPHONE": "Mikrofon", + "CONFERENCE": "Konferencija sa 2 aktivne sesije", + "PROFILE": "Profil", + "SERVICES": "Usluge", "AUDIO": "Audio", - "FULLNAME": "Fullname", - "NAME": "Name", - "INTERNAL": "Internal", - "RINGINGDEVICE": "Ringing Device", - "SPEAKERDEVICE": "Speaker Device", - "MICROPHONEDEVICE": "Microphone Device", - "CHANGEPASSWORD": "Change password", - "SETTINGS": "Settings", - "AUTOANSWER": "Auto answer", - "TOGGLE_NAVIGATION": "Toggle navigation", - "TOGGLE_NAVIGATION_FOLD": "Toggle navigation fold", - "TOGGLE_NAVIGATION_MODE": "Toggle navigation mode", - "SEARCH": "Search", - "USER_SETTINGS": "User settings", - "TOGGLE_QUICK_PANEL": "Toggle quick panel", - "SOMEONE_LOGGED_YOU_OUT": "Someone logged out, do you want to stay logged?", - "STAY_LOGGED": "Stay logged", - "WARNING": "Warning", - "ENGLISH": "English", - "ITALIAN": "Italian", - "FRENCH": "French", - "KOREAN": "Korean", - "SPANISH": "Spanish", - "SWEDISH": "Swedish", - "RUSSIAN": "Russian", - "GERMAN": "German", - "JAPANESE": "Japanese", - "CHINESESIMPLIFIED": "Chinese Simplified", - "CHINESETRADITIONAL": "Chinese Traditional", - "DUTCH": "Dutch", - "FINNISH": "Finnish", - "DANISH": "Danish", - "PORTUGUESE": "Portuguese", - "NORWEGIAN": "Norwegian", - "HINDI": "Hindi", - "HUNGARIAN": "Hungarian", - "TURKISH": "Turkish", - "PERSIAN": "Persian", - "LATVIAN": "Latvian", - "POLISH": "Polish", - "LOGIN_TIME": "Login Time", - "PAUSE_TIME": "Pause Time", - "PREVIEW": "Preview", - "CONFIRM_PASSWORD": "Confirm Password", - "NEW_PASSWORD": "New Password", - "OLD_PASSWORD": "Old Password", - "SAVE": "Save", - "TRIAL_VERSION": "Trial Version", - "PAUSE": "Pause", - "RESUME": "End Pause", - "NO_PAUSES_AVAILABLE": "No pauses available", - "CZECH": "Czech", + "FULLNAME": "Puno ime", + "NAME": "Ime", + "INTERNAL": "Interni", + "RINGINGDEVICE": "Uređaj na kojem zvoni", + "SPEAKERDEVICE": "Uređaj za zvučnik", + "MICROPHONEDEVICE": "Uređaj za mikrofon", + "CHANGEPASSWORD": "Promijeni Lozinku", + "SETTINGS": "Postavke", + "AUTOANSWER": "Automatski odgovor", + "TOGGLE_NAVIGATION": "Uključi navigaciju", + "TOGGLE_NAVIGATION_FOLD": "Uključi navigacijski preklop", + "TOGGLE_NAVIGATION_MODE": "Uključi navigacijski način", + "SEARCH": "Traži", + "USER_SETTINGS": "Postavke korisnika", + "TOGGLE_QUICK_PANEL": "Uključi brzi panel", + "SOMEONE_LOGGED_YOU_OUT": "Neko se odjavio, da li želiš ostati prijavljen?", + "STAY_LOGGED": "Ostani prijavljen", + "WARNING": "Upozorenje", + "ENGLISH": "Engleski", + "ITALIAN": "Italijanski", + "FRENCH": "Francuski", + "KOREAN": "Korejski", + "SPANISH": "Španski", + "SWEDISH": "Švedski", + "RUSSIAN": "Ruski", + "GERMAN": "Njemački", + "JAPANESE": "Japanski", + "CHINESESIMPLIFIED": "Kineski Pojednostavljen", + "CHINESETRADITIONAL": "Kineski Tradicionalni", + "DUTCH": "Holandski", + "FINNISH": "Finski", + "DANISH": "Danski", + "PORTUGUESE": "Portugalski", + "NORWEGIAN": "Norveški", + "HINDI": "Hindski", + "HUNGARIAN": "Mađarski", + "TURKISH": "Turski", + "PERSIAN": "Perzijski", + "LATVIAN": "Latvijski", + "POLISH": "Poljski", + "LOGIN_TIME": "Vrijeme prijave", + "PAUSE_TIME": "Vrijeme pauze", + "PREVIEW": "Pregled", + "CONFIRM_PASSWORD": "Potvrdi Lozinku", + "NEW_PASSWORD": "Nova Lozinka", + "OLD_PASSWORD": "Stara Lozinka", + "SAVE": "Sačuvaj", + "TRIAL_VERSION": "Probna Verzija", + "PAUSE": "Pauza", + "RESUME": "Prekini Pauzu", + "NO_PAUSES_AVAILABLE": "Pauze nisu dostupne", + "CZECH": "Češki", "ERRORS": { - "FIELD_REQUIRED": "Mandatory Field", - "PASSWORD_REQUIRED": "Mandatory Field", - "CONFIRM_NOT_MATCH": "The passwords don't match", - "SECURE_PASSWORD_PATTERN": "The password must be at least 8 characters long and have 1 lowercase character, 1 uppercase character, 1 number and 1 special character ~!?*@#$%^&-_=+[{]}.", - "PASSWORD_OLDPASSWORD_MATCH": "New password must be different from previous one" + "FIELD_REQUIRED": "Obavezno Polje", + "PASSWORD_REQUIRED": "Obavezno Polje", + "CONFIRM_NOT_MATCH": "Lozinske se ne podudaraju", + "SECURE_PASSWORD_PATTERN": "Lozinka mora imati najmanje 8 znakova i 1 znak malog slova, 1 veliko slovo, 1 broj i 1 specijalni znak ~!?*@#$%^&-_=+[{]}.", + "PASSWORD_OLDPASSWORD_MATCH": "Nova lozinka mora biti drugačija od prethodne" }, - "BRAZILIAN": "Brazilian", - "ESTONIAN": "Estonian", - "WEBRTC_MICROPHONE_NOT_AVAILABLE": "No microphone available", - "WEBRTC_SPEAKER_NOT_AVAILABLE": "No speaker available", - "WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE": "No audio devices available", - "NO_AVAILABLE_INFO": "No available info", - "LITHUANIAN": "Lithuanian", - "NOTIFICATION_TITLE": "New notification from {{sender}}", - "NOTIFICATION_TITLE_RECIPIENT": "to {{recipient}}", - "USER_FORCE_LOGOUT": "{{ip}} has logged in with your credentials. \nMultiple logins are not allowed", - "LOGOUT": "Logout", - "SESSION_TIMEOUT": "The session will be automatically closed after 60 seconds", + "BRAZILIAN": "Brazilski", + "ESTONIAN": "Estonski", + "WEBRTC_MICROPHONE_NOT_AVAILABLE": "Mikrofon nije dostupan", + "WEBRTC_SPEAKER_NOT_AVAILABLE": "Zvučnik nije dostupan", + "WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE": "Audio uređaj nije dostupan", + "NO_AVAILABLE_INFO": "Nema dostupnih informacija", + "LITHUANIAN": "Litvanski", + "NOTIFICATION_TITLE": "Novo obavještenje od {{sender}}", + "NOTIFICATION_TITLE_RECIPIENT": "za {{recipient}}", + "USER_FORCE_LOGOUT": "{{ip}} se prijavio sa tvojim akreditivima. \nVišestruke prijave nisu dozvoljene", + "LOGOUT": "Odjava", + "SESSION_TIMEOUT": "Sesija će se automatski zatvoriti nakon 60 sekundi", "HELP": { - "PREVIEW_RECALLME": "This is a Recall Me call scheduled for {{date}}" + "PREVIEW_RECALLME": "Ovo je Recall Me poziv zakazan za {{date}}" }, - "BOSNIAN": "bosanski" + "BOSNIAN": "Bosanski", + "ICELANDIC": "Islandic" } } diff --git a/public/app/toolbar/i18n/cs.json b/public/app/toolbar/i18n/cs.json index 64a44b1..6a0408a 100644 --- a/public/app/toolbar/i18n/cs.json +++ b/public/app/toolbar/i18n/cs.json @@ -120,6 +120,7 @@ "SMS": "SMS", "WHATSAPP": "Whatsapp", "NO_AUTOANSWER_CONFIGURED": "Pro kanály není nakonfigurována žádná automatická odpověď", - "BOSNIAN": "bosenský" + "BOSNIAN": "bosenský", + "ICELANDIC": "Islandský" } } diff --git a/public/app/toolbar/i18n/da.json b/public/app/toolbar/i18n/da.json index e9b51cb..60ae458 100644 --- a/public/app/toolbar/i18n/da.json +++ b/public/app/toolbar/i18n/da.json @@ -120,6 +120,7 @@ "SMS": "SMS", "WHATSAPP": "Whatsapp", "NO_AUTOANSWER_CONFIGURED": "Intet autosvar konfigureret for kanaler", - "BOSNIAN": "bosnisk" + "BOSNIAN": "bosnisk", + "ICELANDIC": "Islandsk" } } diff --git a/public/app/toolbar/i18n/de.json b/public/app/toolbar/i18n/de.json index 9d138a9..d452759 100644 --- a/public/app/toolbar/i18n/de.json +++ b/public/app/toolbar/i18n/de.json @@ -120,6 +120,7 @@ "SMS": "SMS", "WHATSAPP": "WhatsApp", "NO_AUTOANSWER_CONFIGURED": "Keine automatische Antwort für Kanäle konfiguriert", - "BOSNIAN": "bosnisch" + "BOSNIAN": "bosnisch", + "ICELANDIC": "Isländisch" } } diff --git a/public/app/toolbar/i18n/en.json b/public/app/toolbar/i18n/en.json index 7bb2214..37f389e 100644 --- a/public/app/toolbar/i18n/en.json +++ b/public/app/toolbar/i18n/en.json @@ -123,6 +123,7 @@ "HELP": { "PREVIEW_RECALLME": "This is a Recall Me call scheduled for {{date}}" }, - "BOSNIAN": "Bosnian" + "BOSNIAN": "Bosnian", + "ICELANDIC": "Islandic" } } diff --git a/public/app/toolbar/i18n/es.json b/public/app/toolbar/i18n/es.json index 408a79d..2a5f385 100644 --- a/public/app/toolbar/i18n/es.json +++ b/public/app/toolbar/i18n/es.json @@ -120,6 +120,7 @@ "SMS": "SMS", "WHATSAPP": "Whatsapp", "NO_AUTOANSWER_CONFIGURED": "No hay respuesta automática configurada para los canales", - "BOSNIAN": "bosnio" + "BOSNIAN": "bosnio", + "ICELANDIC": "isleño" } } diff --git a/public/app/toolbar/i18n/et.json b/public/app/toolbar/i18n/et.json index 5b08987..5092009 100644 --- a/public/app/toolbar/i18n/et.json +++ b/public/app/toolbar/i18n/et.json @@ -120,6 +120,7 @@ "SMS": "SMS", "WHATSAPP": "Whatsapp", "NO_AUTOANSWER_CONFIGURED": "Kanalite jaoks pole automaatset vastust seadistatud", - "BOSNIAN": "bosnia keel" + "BOSNIAN": "bosnia keel", + "ICELANDIC": "saarlane" } } diff --git a/public/app/toolbar/i18n/fa.json b/public/app/toolbar/i18n/fa.json index 42c27e5..100dc92 100644 --- a/public/app/toolbar/i18n/fa.json +++ b/public/app/toolbar/i18n/fa.json @@ -120,6 +120,7 @@ "SMS": "پیامک", "WHATSAPP": "واتساپ", "NO_AUTOANSWER_CONFIGURED": "هیچ پاسخ خودکار برای کانال ها پیکربندی نشده است", - "BOSNIAN": "بوسنیایی" + "BOSNIAN": "بوسنیایی", + "ICELANDIC": "جزیره ای" } } diff --git a/public/app/toolbar/i18n/fi.json b/public/app/toolbar/i18n/fi.json index 469092f..248942a 100644 --- a/public/app/toolbar/i18n/fi.json +++ b/public/app/toolbar/i18n/fi.json @@ -120,6 +120,7 @@ "SMS": "tekstiviesti", "WHATSAPP": "Whatsapp", "NO_AUTOANSWER_CONFIGURED": "Kanaville ei ole määritetty automaattista vastausta", - "BOSNIAN": "bosnialainen" + "BOSNIAN": "bosnialainen", + "ICELANDIC": "Islannin kieli" } } diff --git a/public/app/toolbar/i18n/fr.json b/public/app/toolbar/i18n/fr.json index bb1147a..2a35a78 100644 --- a/public/app/toolbar/i18n/fr.json +++ b/public/app/toolbar/i18n/fr.json @@ -120,6 +120,7 @@ "SMS": "SMS", "WHATSAPP": "WhatsApp", "NO_AUTOANSWER_CONFIGURED": "Aucune réponse automatique configurée pour les canaux", - "BOSNIAN": "bosniaque" + "BOSNIAN": "bosniaque", + "ICELANDIC": "Islandais" } } diff --git a/public/app/toolbar/i18n/he.json b/public/app/toolbar/i18n/he.json index 7204fd1..52611b6 100644 --- a/public/app/toolbar/i18n/he.json +++ b/public/app/toolbar/i18n/he.json @@ -120,6 +120,7 @@ "SMS": "סמס", "WHATSAPP": "וואטסאפ", "NO_AUTOANSWER_CONFIGURED": "לא הוגדר תשובה אוטומטית עבור ערוצים", - "BOSNIAN": "בוסנית" + "BOSNIAN": "בוסנית", + "ICELANDIC": "אילנדית" } } diff --git a/public/app/toolbar/i18n/hi.json b/public/app/toolbar/i18n/hi.json index 7c9bdbb..61c0fbf 100644 --- a/public/app/toolbar/i18n/hi.json +++ b/public/app/toolbar/i18n/hi.json @@ -120,6 +120,7 @@ "SMS": "एसएमएस", "WHATSAPP": "Whatsapp", "NO_AUTOANSWER_CONFIGURED": "चैनलों के लिए कोई स्वतः उत्तर कॉन्फ़िगर नहीं किया गया", - "BOSNIAN": "बोस्नियाई" + "BOSNIAN": "बोस्नियाई", + "ICELANDIC": "आइलैंडिक" } } diff --git a/public/app/toolbar/i18n/hu.json b/public/app/toolbar/i18n/hu.json index b34b508..b91b9d5 100644 --- a/public/app/toolbar/i18n/hu.json +++ b/public/app/toolbar/i18n/hu.json @@ -123,6 +123,7 @@ "WHATSAPP": "Whatsapp", "PHONE2CALL": "Telefon a híváshoz", "NO_AUTOANSWER_CONFIGURED": "Nincs automatikus válasz konfigurálva a csatornákhoz", - "BOSNIAN": "bosnyák" + "BOSNIAN": "bosnyák", + "ICELANDIC": "szigeti" } } diff --git a/public/app/toolbar/i18n/id.json b/public/app/toolbar/i18n/id.json index b75a67a..da184b6 100644 --- a/public/app/toolbar/i18n/id.json +++ b/public/app/toolbar/i18n/id.json @@ -120,6 +120,7 @@ "SMS": "SMS", "WHATSAPP": "ada apa", "NO_AUTOANSWER_CONFIGURED": "Tidak ada jawaban otomatis yang dikonfigurasi untuk saluran", - "BOSNIAN": "Bosnia" + "BOSNIAN": "Bosnia", + "ICELANDIC": "pulau" } } diff --git a/public/app/toolbar/i18n/is.json b/public/app/toolbar/i18n/is.json new file mode 100644 index 0000000..161e45c --- /dev/null +++ b/public/app/toolbar/i18n/is.json @@ -0,0 +1,129 @@ +{ + "TOOLBAR": { + "CHANGE_LANGUAGE_TITLE": "Change language", + "CHANGE_LANGUAGE_MESSAGE": "Remember to refresh the page to apply RTL Support (if enabled)", + "HEBREW": "Hebrew", + "PREFIXES": "Prefixes", + "CALL": "Call", + "ARABIC": "Arabic", + "INDONESIAN": "Indonesian", + "RESETPASSWORD": "Reset Password", + "PASSWORD_EXPIRE_REMAINING_DAYS": "Remaining days before your password expires", + "BROWSER_COMPATIBILITY": "Browser Compatibility [Chrome, Opera, Safari]", + "RECORDING": "Recording", + "INVALID_LICENSE": "Invalid License", + "BROWSER": "Browser", + "OS": "Operating System", + "REQUIREMENTS": "Requirements", + "LICENSE": "License", + "HTTPS": "HTTPS", + "PHONE2CALL": "Phone to call", + "CHANNELS": "Channels", + "CHANNEL": "Channel", + "NUM_NOTIFICATIONS": "Notifications", + "NOTIFICATIONS": "Autoanswer enabled", + "DELAY": "Autoanswer delay [secs]", + "AUTOANSWER_NOTIFICATIONS": "Autoanswer notifications", + "CHAT": "Chat", + "EMAIL": "Email", + "SMS": "SMS", + "OPENCHANNEL": "Openchannel", + "FAX": "Fax", + "WHATSAPP": "Whatsapp connector", + "WEBRTCSUPPORT": "WebRTC Support", + "REGISTERED": "Registered", + "NOT_REGISTERED": "Not registered", + "WEBRTC_LICENSE_NOT_ENABELD": "WebRTC License is not enabled", + "ATTENDED_TRANSFER": "Attended Tranfer", + "TRANSFER": "Transfer", + "TARGET": "Target", + "CANCEL": "Cancel", + "FILENAME": "File name", + "STATUS": "Status", + "NO_AUTOANSWER_CONFIGURED": "No autoanswer configured for channels", + "ACTIONS": "Actions", + "SPEAKER": "Speaker", + "RINGING": "Ringing tone", + "MICROPHONE": "Microphone", + "CONFERENCE": "Conference with 2 active sessions", + "PROFILE": "Profile", + "SERVICES": "Services", + "AUDIO": "Audio", + "FULLNAME": "Fullname", + "NAME": "Name", + "INTERNAL": "Internal", + "RINGINGDEVICE": "Ringing Device", + "SPEAKERDEVICE": "Speaker Device", + "MICROPHONEDEVICE": "Microphone Device", + "CHANGEPASSWORD": "Change password", + "SETTINGS": "Settings", + "AUTOANSWER": "Auto answer", + "TOGGLE_NAVIGATION": "Toggle navigation", + "TOGGLE_NAVIGATION_FOLD": "Toggle navigation fold", + "TOGGLE_NAVIGATION_MODE": "Toggle navigation mode", + "SEARCH": "Search", + "USER_SETTINGS": "User settings", + "TOGGLE_QUICK_PANEL": "Toggle quick panel", + "SOMEONE_LOGGED_YOU_OUT": "Someone logged out, do you want to stay logged?", + "STAY_LOGGED": "Stay logged", + "WARNING": "Warning", + "ENGLISH": "English", + "ITALIAN": "Italian", + "FRENCH": "French", + "KOREAN": "Korean", + "SPANISH": "Spanish", + "SWEDISH": "Swedish", + "RUSSIAN": "Russian", + "GERMAN": "German", + "JAPANESE": "Japanese", + "CHINESESIMPLIFIED": "Chinese Simplified", + "CHINESETRADITIONAL": "Chinese Traditional", + "DUTCH": "Dutch", + "FINNISH": "Finnish", + "DANISH": "Danish", + "PORTUGUESE": "Portuguese", + "NORWEGIAN": "Norwegian", + "HINDI": "Hindi", + "HUNGARIAN": "Hungarian", + "TURKISH": "Turkish", + "PERSIAN": "Persian", + "LATVIAN": "Latvian", + "POLISH": "Polish", + "LOGIN_TIME": "Login Time", + "PAUSE_TIME": "Pause Time", + "PREVIEW": "Preview", + "CONFIRM_PASSWORD": "Confirm Password", + "NEW_PASSWORD": "New Password", + "OLD_PASSWORD": "Old Password", + "SAVE": "Save", + "TRIAL_VERSION": "Trial Version", + "PAUSE": "Pause", + "RESUME": "End Pause", + "NO_PAUSES_AVAILABLE": "No pauses available", + "CZECH": "Czech", + "ERRORS": { + "FIELD_REQUIRED": "Mandatory Field", + "PASSWORD_REQUIRED": "Mandatory Field", + "CONFIRM_NOT_MATCH": "The passwords don't match", + "SECURE_PASSWORD_PATTERN": "The password must be at least 8 characters long and have 1 lowercase character, 1 uppercase character, 1 number and 1 special character ~!?*@#$%^&-_=+[{]}.", + "PASSWORD_OLDPASSWORD_MATCH": "New password must be different from previous one" + }, + "BRAZILIAN": "Brazilian", + "ESTONIAN": "Estonian", + "WEBRTC_MICROPHONE_NOT_AVAILABLE": "No microphone available", + "WEBRTC_SPEAKER_NOT_AVAILABLE": "No speaker available", + "WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE": "No audio devices available", + "NO_AVAILABLE_INFO": "No available info", + "LITHUANIAN": "Lithuanian", + "NOTIFICATION_TITLE": "New notification from {{sender}}", + "NOTIFICATION_TITLE_RECIPIENT": "to {{recipient}}", + "USER_FORCE_LOGOUT": "{{ip}} has logged in with your credentials. \nMultiple logins are not allowed", + "LOGOUT": "Logout", + "SESSION_TIMEOUT": "The session will be automatically closed after 60 seconds", + "HELP": { + "PREVIEW_RECALLME": "This is a Recall Me call scheduled for {{date}}" + }, + "BOSNIAN": "Bosnian", + "ICELANDIC": "íslenskt" + } +} diff --git a/public/app/toolbar/i18n/it.json b/public/app/toolbar/i18n/it.json index 7e3c26d..590be2a 100644 --- a/public/app/toolbar/i18n/it.json +++ b/public/app/toolbar/i18n/it.json @@ -123,6 +123,7 @@ "SMS": "sms", "WHATSAPP": "WhatsApp", "NO_AUTOANSWER_CONFIGURED": "Nessuna risposta automatica configurata per i canali", - "BOSNIAN": "bosniaco" + "BOSNIAN": "bosniaco", + "ICELANDIC": "isolano" } } diff --git a/public/app/toolbar/i18n/ja.json b/public/app/toolbar/i18n/ja.json index 9ce87b6..d58a8eb 100644 --- a/public/app/toolbar/i18n/ja.json +++ b/public/app/toolbar/i18n/ja.json @@ -120,6 +120,7 @@ "SMS": "SMS", "WHATSAPP": "Whatsapp", "NO_AUTOANSWER_CONFIGURED": "チャネルに自動応答が設定されていません", - "BOSNIAN": "ボスニア語" + "BOSNIAN": "ボスニア語", + "ICELANDIC": "島の" } } diff --git a/public/app/toolbar/i18n/ko.json b/public/app/toolbar/i18n/ko.json index 33a0099..b39b7a4 100644 --- a/public/app/toolbar/i18n/ko.json +++ b/public/app/toolbar/i18n/ko.json @@ -120,6 +120,7 @@ "SMS": "SMS", "WHATSAPP": "왓츠앱", "NO_AUTOANSWER_CONFIGURED": "채널에 대해 구성된 자동 응답이 없습니다.", - "BOSNIAN": "보스니아어" + "BOSNIAN": "보스니아어", + "ICELANDIC": "아일랜드어" } } diff --git a/public/app/toolbar/i18n/lt.json b/public/app/toolbar/i18n/lt.json index b6b187e..b4f3558 100644 --- a/public/app/toolbar/i18n/lt.json +++ b/public/app/toolbar/i18n/lt.json @@ -120,6 +120,7 @@ "SMS": "trumpoji žinutė", "WHATSAPP": "Whatsapp", "NO_AUTOANSWER_CONFIGURED": "Automatinis atsakymas kanalams nesukonfigūruotas", - "BOSNIAN": "bosnių" + "BOSNIAN": "bosnių", + "ICELANDIC": "Islandiškas" } } diff --git a/public/app/toolbar/i18n/lv.json b/public/app/toolbar/i18n/lv.json index 3bfa440..1d28d64 100644 --- a/public/app/toolbar/i18n/lv.json +++ b/public/app/toolbar/i18n/lv.json @@ -120,6 +120,7 @@ "SMS": "īsziņa", "WHATSAPP": "Whatsapp", "NO_AUTOANSWER_CONFIGURED": "Kanāliem nav konfigurēta automātiskā atbilde", - "BOSNIAN": "bosniešu" + "BOSNIAN": "bosniešu", + "ICELANDIC": "Islandisks" } } diff --git a/public/app/toolbar/i18n/nl.json b/public/app/toolbar/i18n/nl.json index 159c730..da368a8 100644 --- a/public/app/toolbar/i18n/nl.json +++ b/public/app/toolbar/i18n/nl.json @@ -120,6 +120,7 @@ "SMS": "sms", "WHATSAPP": "Whatsapp", "NO_AUTOANSWER_CONFIGURED": "Geen automatisch antwoord geconfigureerd voor kanalen", - "BOSNIAN": "Bosnisch" + "BOSNIAN": "Bosnisch", + "ICELANDIC": "eilandachtig" } } diff --git a/public/app/toolbar/i18n/no.json b/public/app/toolbar/i18n/no.json index 35f8c16..1829459 100644 --- a/public/app/toolbar/i18n/no.json +++ b/public/app/toolbar/i18n/no.json @@ -120,6 +120,7 @@ "SMS": "tekstmelding", "WHATSAPP": "Hva skjer", "NO_AUTOANSWER_CONFIGURED": "Ingen autosvar konfigurert for kanaler", - "BOSNIAN": "bosnisk" + "BOSNIAN": "bosnisk", + "ICELANDIC": "Islandsk" } } diff --git a/public/app/toolbar/i18n/pl.json b/public/app/toolbar/i18n/pl.json index fa881d4..0239f1b 100644 --- a/public/app/toolbar/i18n/pl.json +++ b/public/app/toolbar/i18n/pl.json @@ -120,6 +120,7 @@ "SMS": "SMS", "WHATSAPP": "Whatsapp", "NO_AUTOANSWER_CONFIGURED": "Brak automatycznej odpowiedzi skonfigurowanej dla kanałów", - "BOSNIAN": "bośniacki" + "BOSNIAN": "bośniacki", + "ICELANDIC": "Islandzki" } } diff --git a/public/app/toolbar/i18n/pt-BR.json b/public/app/toolbar/i18n/pt-BR.json index e44f597..2ebfc33 100644 --- a/public/app/toolbar/i18n/pt-BR.json +++ b/public/app/toolbar/i18n/pt-BR.json @@ -120,6 +120,7 @@ "SMS": "SMS", "WHATSAPP": "Whatsapp", "NO_AUTOANSWER_CONFIGURED": "Nenhuma resposta automática configurada para canais", - "BOSNIAN": "bósnio" + "BOSNIAN": "bósnio", + "ICELANDIC": "ilhéu" } } diff --git a/public/app/toolbar/i18n/pt-PT.json b/public/app/toolbar/i18n/pt-PT.json index efc2d09..7a5cb84 100644 --- a/public/app/toolbar/i18n/pt-PT.json +++ b/public/app/toolbar/i18n/pt-PT.json @@ -120,6 +120,7 @@ "SMS": "SMS", "WHATSAPP": "Whatsapp", "NO_AUTOANSWER_CONFIGURED": "Nenhuma resposta automática configurada para canais", - "BOSNIAN": "bósnio" + "BOSNIAN": "bósnio", + "ICELANDIC": "ilhéu" } } diff --git a/public/app/toolbar/i18n/ru.json b/public/app/toolbar/i18n/ru.json index 12d8d12..ea13d42 100644 --- a/public/app/toolbar/i18n/ru.json +++ b/public/app/toolbar/i18n/ru.json @@ -120,6 +120,7 @@ "SMS": "смс", "WHATSAPP": "WhatsApp", "NO_AUTOANSWER_CONFIGURED": "Для каналов не настроен автоответчик", - "BOSNIAN": "боснийский" + "BOSNIAN": "боснийский", + "ICELANDIC": "островной" } } diff --git a/public/app/toolbar/i18n/sv.json b/public/app/toolbar/i18n/sv.json index 5c41096..dffab42 100644 --- a/public/app/toolbar/i18n/sv.json +++ b/public/app/toolbar/i18n/sv.json @@ -120,6 +120,7 @@ "SMS": "SMS", "WHATSAPP": "Whatsapp", "NO_AUTOANSWER_CONFIGURED": "Inget autosvar konfigurerat för kanaler", - "BOSNIAN": "bosniska" + "BOSNIAN": "bosniska", + "ICELANDIC": "Islandic" } } diff --git a/public/app/toolbar/i18n/tr.json b/public/app/toolbar/i18n/tr.json index 50eec67..d0e603c 100644 --- a/public/app/toolbar/i18n/tr.json +++ b/public/app/toolbar/i18n/tr.json @@ -120,6 +120,7 @@ "SMS": "SMS", "WHATSAPP": "Naber", "NO_AUTOANSWER_CONFIGURED": "Kanallar için yapılandırılmamış otomatik yanıt yok", - "BOSNIAN": "Boşnakça" + "BOSNIAN": "Boşnakça", + "ICELANDIC": "adalı" } } diff --git a/public/app/toolbar/i18n/zh-CN.json b/public/app/toolbar/i18n/zh-CN.json index 900ccde..34075b2 100644 --- a/public/app/toolbar/i18n/zh-CN.json +++ b/public/app/toolbar/i18n/zh-CN.json @@ -120,6 +120,7 @@ "SMS": "短信", "WHATSAPP": "Whatsapp", "NO_AUTOANSWER_CONFIGURED": "没有为频道配置自动应答", - "BOSNIAN": "波斯尼亚语" + "BOSNIAN": "波斯尼亚语", + "ICELANDIC": "岛国" } } diff --git a/public/app/toolbar/i18n/zh-TW.json b/public/app/toolbar/i18n/zh-TW.json index 84404e6..d301196 100644 --- a/public/app/toolbar/i18n/zh-TW.json +++ b/public/app/toolbar/i18n/zh-TW.json @@ -120,6 +120,7 @@ "SMS": "短信", "WHATSAPP": "Whatsapp", "NO_AUTOANSWER_CONFIGURED": "沒有為頻道配置自動應答", - "BOSNIAN": "波斯尼亞語" + "BOSNIAN": "波斯尼亞語", + "ICELANDIC": "島國" } } diff --git a/public/assets/images/flags/is.png b/public/assets/images/flags/is.png new file mode 100644 index 0000000..a1a77a3 Binary files /dev/null and b/public/assets/images/flags/is.png differ diff --git a/public/tvox/answer.controller.js b/public/tvox/answer.controller.js index 9aa5de5..177b62b 100644 --- a/public/tvox/answer.controller.js +++ b/public/tvox/answer.controller.js @@ -50,7 +50,6 @@ angular.module('AnswerApp', ['ngMaterial', 'ngCookies', 'motion', 'ngResource', $scope.dispo.mandatoryDisposition = false; $scope.dispo.mandatoryDispositionPause = ''; $scope.dispo.note = ''; - tvoxCallId = ""; @@ -100,7 +99,6 @@ angular.module('AnswerApp', ['ngMaterial', 'ngCookies', 'motion', 'ngResource', } } - this.$onInit = function() { var urlParams = new URLSearchParams(window.location.search); var params = urlParams.get("params"); @@ -306,7 +304,6 @@ angular.module('AnswerApp', ['ngMaterial', 'ngCookies', 'motion', 'ngResource', }). then( function ret(response) { - console.log("RMID", response.data.id); $scope.reportMemberId = response.data.id; } ); diff --git a/public/tvox/answer.html b/public/tvox/answer.html index 36fd6cd..f4edc0d 100644 --- a/public/tvox/answer.html +++ b/public/tvox/answer.html @@ -53,14 +53,14 @@
{{contactName}} - {{message.createdAt.substring(11,16)}} + {{ message.createdAt | date: 'medium'}}
- {{message.createdAt.substring(11,16)}} + {{ message.createdAt | date: 'medium' }}
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 2ee96e5..d05fda2 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 _0xf5e8=['exports','VIRTUAL','getDataValue','action','STRING','integration','motionbar','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize'];(function(_0x35fc9f,_0x531f14){var _0xf7ff51=function(_0x68201f){while(--_0x68201f){_0x35fc9f['push'](_0x35fc9f['shift']());}};_0xf7ff51(++_0x531f14);}(_0xf5e8,0x17b));var _0x8f5e=function(_0x1d1963,_0x32cc0e){_0x1d1963=_0x1d1963-0x0;var _0x3f58bb=_0xf5e8[_0x1d1963];return _0x3f58bb;};'use strict';var Sequelize=require(_0x8f5e('0x0'));module[_0x8f5e('0x1')]={'name':{'type':Sequelize[_0x8f5e('0x2')],'get':function(_0x3e6cc6){return this[_0x8f5e('0x3')](_0x8f5e('0x4'));}},'action':{'type':Sequelize[_0x8f5e('0x5')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x8f5e('0x6'),_0x8f5e('0x7'),'jscripty',_0x8f5e('0x8'),_0x8f5e('0x9'),_0x8f5e('0xa'),_0x8f5e('0xb')]],'msg':_0x8f5e('0xc')}},'comment':_0x8f5e('0xc')},'data1':{'type':Sequelize[_0x8f5e('0x5')](0x1000),'comment':_0x8f5e('0xd')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x8f5e('0xe')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x8f5e('0xf')},'data4':{'type':Sequelize[_0x8f5e('0x5')](0x1000),'comments':_0x8f5e('0x10')},'data5':{'type':Sequelize[_0x8f5e('0x5')](0x1000),'comments':_0x8f5e('0x11')},'data6':{'type':Sequelize[_0x8f5e('0x5')],'comments':_0x8f5e('0x12')},'data7':{'type':Sequelize['TEXT'],'comments':_0x8f5e('0x13')}}; \ No newline at end of file +var _0x3436=['TEXT','urlForward[body]','sequelize','exports','getDataValue','action','STRING','contactManager','integration','motionbar','urlForward','browser','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x3436,0x192));var _0x6343=function(_0x20f430,_0x5358fc){_0x20f430=_0x20f430-0x0;var _0x34fda6=_0x3436[_0x20f430];return _0x34fda6;};'use strict';var Sequelize=require(_0x6343('0x0'));module[_0x6343('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1e2ec5){return this[_0x6343('0x2')](_0x6343('0x3'));}},'action':{'type':Sequelize[_0x6343('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x6343('0x5'),_0x6343('0x6'),_0x6343('0x7'),'jscripty',_0x6343('0x8'),_0x6343('0x9'),'bot','script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x6343('0x4')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x6343('0xa')},'data3':{'type':Sequelize[_0x6343('0x4')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x6343('0x4')](0x1000),'comments':_0x6343('0xb')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x6343('0xc')},'data6':{'type':Sequelize['STRING'],'comments':_0x6343('0xd')},'data7':{'type':Sequelize[_0x6343('0xe')],'comments':_0x6343('0xf')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 6ca3875..c7de97f 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 _0x1fcf=['Content-Range','apply','reject','save','destroy','then','sendStatus','error','stack','name','update','body','Action','params','catch','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set'];(function(_0x140357,_0x6670bd){var _0x4fdf00=function(_0x527977){while(--_0x527977){_0x140357['push'](_0x140357['shift']());}};_0x4fdf00(++_0x6670bd);}(_0x1fcf,0x117));var _0xf1fc=function(_0x52e68e,_0x309912){_0x52e68e=_0x52e68e-0x0;var _0x3211a4=_0x1fcf[_0x52e68e];return _0x3211a4;};'use strict';var emlformat=require(_0xf1fc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf1fc('0x1'));var jsonpatch=require(_0xf1fc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf1fc('0x3'));var Mustache=require(_0xf1fc('0x4'));var util=require(_0xf1fc('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf1fc('0x6'));var fs=require('fs');var fs_extra=require(_0xf1fc('0x7'));var _=require(_0xf1fc('0x8'));var squel=require(_0xf1fc('0x9'));var crypto=require(_0xf1fc('0xa'));var jsforce=require(_0xf1fc('0xb'));var deskjs=require(_0xf1fc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf1fc('0xd'));var Papa=require(_0xf1fc('0xe'));var Redis=require(_0xf1fc('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf1fc('0x10'));var as=require(_0xf1fc('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xf1fc('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xf1fc('0x13'));var db=require(_0xf1fc('0x14'))['db'];function respondWithStatusCode(_0x26f6eb,_0x5532a6){_0x5532a6=_0x5532a6||0xcc;return function(_0x24975c){if(_0x24975c){return _0x26f6eb['sendStatus'](_0x5532a6);}return _0x26f6eb[_0xf1fc('0x15')](_0x5532a6)[_0xf1fc('0x16')]();};}function respondWithResult(_0x11cea3,_0x4afde8){_0x4afde8=_0x4afde8||0xc8;return function(_0x4fd0b2){if(_0x4fd0b2){return _0x11cea3[_0xf1fc('0x15')](_0x4afde8)[_0xf1fc('0x17')](_0x4fd0b2);}};}function respondWithFilteredResult(_0x40878e,_0x323530){return function(_0x19d387){if(_0x19d387){var _0x3fc8c6=typeof _0x323530['offset']===_0xf1fc('0x18')&&typeof _0x323530[_0xf1fc('0x19')]===_0xf1fc('0x18');var _0x230c35=_0x19d387[_0xf1fc('0x1a')];var _0xed86af=_0x3fc8c6?0x0:_0x323530[_0xf1fc('0x1b')];var _0x24e301=_0x3fc8c6?_0x19d387[_0xf1fc('0x1a')]:_0x323530[_0xf1fc('0x1b')]+_0x323530[_0xf1fc('0x19')];var _0x852ec3;if(_0x24e301>=_0x230c35){_0x24e301=_0x230c35;_0x852ec3=0xc8;}else{_0x852ec3=0xce;}_0x40878e['status'](_0x852ec3);return _0x40878e[_0xf1fc('0x1c')](_0xf1fc('0x1d'),_0xed86af+'-'+_0x24e301+'/'+_0x230c35)['json'](_0x19d387);}return null;};}function patchUpdates(_0x23e17a){return function(_0x50712f){try{jsonpatch[_0xf1fc('0x1e')](_0x50712f,_0x23e17a,!![]);}catch(_0x5d4775){return BPromise[_0xf1fc('0x1f')](_0x5d4775);}return _0x50712f[_0xf1fc('0x20')]();};}function saveUpdates(_0x1860ae,_0x521279){return function(_0x593f50){if(_0x593f50){return _0x593f50['update'](_0x1860ae)['then'](function(_0x3c191a){return _0x3c191a;});}return null;};}function removeEntity(_0x1d4741,_0x4f9fa7){return function(_0x5784b6){if(_0x5784b6){return _0x5784b6[_0xf1fc('0x21')]()[_0xf1fc('0x22')](function(){_0x1d4741[_0xf1fc('0x15')](0xcc)[_0xf1fc('0x16')]();});}};}function handleEntityNotFound(_0x12265e,_0x5b0be5){return function(_0x4da339){if(!_0x4da339){_0x12265e[_0xf1fc('0x23')](0x194);}return _0x4da339;};}function handleError(_0xb9105c,_0x6b597e){_0x6b597e=_0x6b597e||0x1f4;return function(_0x117ea0){logger[_0xf1fc('0x24')](_0x117ea0[_0xf1fc('0x25')]);if(_0x117ea0[_0xf1fc('0x26')]){delete _0x117ea0[_0xf1fc('0x26')];}_0xb9105c[_0xf1fc('0x15')](_0x6b597e)['send'](_0x117ea0);};}exports[_0xf1fc('0x27')]=function(_0x55b9c4,_0x1494df){if(_0x55b9c4['body']['id']){delete _0x55b9c4[_0xf1fc('0x28')]['id'];}return db[_0xf1fc('0x29')]['find']({'where':{'id':_0x55b9c4['params']['id']}})[_0xf1fc('0x22')](handleEntityNotFound(_0x1494df,null))['then'](saveUpdates(_0x55b9c4[_0xf1fc('0x28')],null))[_0xf1fc('0x22')](respondWithResult(_0x1494df,null))['catch'](handleError(_0x1494df,null));};exports['destroy']=function(_0x4ebcd7,_0x209baf){return db['Action']['find']({'where':{'id':_0x4ebcd7[_0xf1fc('0x2a')]['id']}})[_0xf1fc('0x22')](handleEntityNotFound(_0x209baf,null))[_0xf1fc('0x22')](removeEntity(_0x209baf,null))[_0xf1fc('0x2b')](handleError(_0x209baf,null));}; \ No newline at end of file +var _0xa789=['../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','then','end','error','send','body','Action','find','params','catch','eml-format','zip-dir','request-promise','moment','bluebird','to-csv','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa789,0x1f0));var _0x9a78=function(_0x48179a,_0x20ff29){_0x48179a=_0x48179a-0x0;var _0x54c50c=_0xa789[_0x48179a];return _0x54c50c;};'use strict';var emlformat=require(_0x9a78('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9a78('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9a78('0x2'));var moment=require(_0x9a78('0x3'));var BPromise=require(_0x9a78('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9a78('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9a78('0x6'));var _=require('lodash');var squel=require(_0x9a78('0x7'));var crypto=require('crypto');var jsforce=require(_0x9a78('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x9a78('0x5'));var querystring=require(_0x9a78('0x9'));var Papa=require(_0x9a78('0xa'));var Redis=require(_0x9a78('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x9a78('0xc'));var as=require(_0x9a78('0xd'));var hardwareService=require(_0x9a78('0xe'));var logger=require(_0x9a78('0xf'))(_0x9a78('0x10'));var utils=require(_0x9a78('0x11'));var config=require(_0x9a78('0x12'));var licenseUtil=require(_0x9a78('0x13'));var db=require(_0x9a78('0x14'))['db'];function respondWithStatusCode(_0x5316ad,_0x5e9c14){_0x5e9c14=_0x5e9c14||0xcc;return function(_0x51f592){if(_0x51f592){return _0x5316ad[_0x9a78('0x15')](_0x5e9c14);}return _0x5316ad[_0x9a78('0x16')](_0x5e9c14)['end']();};}function respondWithResult(_0x184d3d,_0x233fed){_0x233fed=_0x233fed||0xc8;return function(_0x58ae61){if(_0x58ae61){return _0x184d3d['status'](_0x233fed)['json'](_0x58ae61);}};}function respondWithFilteredResult(_0x21c700,_0x1a8e85){return function(_0x4218ca){if(_0x4218ca){var _0x182e60=typeof _0x1a8e85[_0x9a78('0x17')]===_0x9a78('0x18')&&typeof _0x1a8e85[_0x9a78('0x19')]==='undefined';var _0x13a2e6=_0x4218ca[_0x9a78('0x1a')];var _0x5240fb=_0x182e60?0x0:_0x1a8e85[_0x9a78('0x17')];var _0x112984=_0x182e60?_0x4218ca['count']:_0x1a8e85['offset']+_0x1a8e85[_0x9a78('0x19')];var _0x10fc3c;if(_0x112984>=_0x13a2e6){_0x112984=_0x13a2e6;_0x10fc3c=0xc8;}else{_0x10fc3c=0xce;}_0x21c700[_0x9a78('0x16')](_0x10fc3c);return _0x21c700[_0x9a78('0x1b')](_0x9a78('0x1c'),_0x5240fb+'-'+_0x112984+'/'+_0x13a2e6)[_0x9a78('0x1d')](_0x4218ca);}return null;};}function patchUpdates(_0x1fe37b){return function(_0x3ae443){try{jsonpatch[_0x9a78('0x1e')](_0x3ae443,_0x1fe37b,!![]);}catch(_0x2194bc){return BPromise[_0x9a78('0x1f')](_0x2194bc);}return _0x3ae443[_0x9a78('0x20')]();};}function saveUpdates(_0x21f405,_0x3012b2){return function(_0x57f06e){if(_0x57f06e){return _0x57f06e['update'](_0x21f405)['then'](function(_0x41b3ee){return _0x41b3ee;});}return null;};}function removeEntity(_0x589bb6,_0x15293f){return function(_0x1c87cb){if(_0x1c87cb){return _0x1c87cb[_0x9a78('0x21')]()[_0x9a78('0x22')](function(){_0x589bb6[_0x9a78('0x16')](0xcc)[_0x9a78('0x23')]();});}};}function handleEntityNotFound(_0x5136de,_0x38f105){return function(_0x2fc1b3){if(!_0x2fc1b3){_0x5136de[_0x9a78('0x15')](0x194);}return _0x2fc1b3;};}function handleError(_0x2ec4f1,_0x4b69ea){_0x4b69ea=_0x4b69ea||0x1f4;return function(_0x550e75){logger[_0x9a78('0x24')](_0x550e75['stack']);if(_0x550e75['name']){delete _0x550e75['name'];}_0x2ec4f1[_0x9a78('0x16')](_0x4b69ea)[_0x9a78('0x25')](_0x550e75);};}exports['update']=function(_0x14fbb3,_0x432513){if(_0x14fbb3[_0x9a78('0x26')]['id']){delete _0x14fbb3[_0x9a78('0x26')]['id'];}return db[_0x9a78('0x27')][_0x9a78('0x28')]({'where':{'id':_0x14fbb3[_0x9a78('0x29')]['id']}})[_0x9a78('0x22')](handleEntityNotFound(_0x432513,null))[_0x9a78('0x22')](saveUpdates(_0x14fbb3[_0x9a78('0x26')],null))[_0x9a78('0x22')](respondWithResult(_0x432513,null))[_0x9a78('0x2a')](handleError(_0x432513,null));};exports[_0x9a78('0x21')]=function(_0x4e4fb6,_0x4552e7){return db[_0x9a78('0x27')][_0x9a78('0x28')]({'where':{'id':_0x4e4fb6[_0x9a78('0x29')]['id']}})[_0x9a78('0x22')](handleEntityNotFound(_0x4552e7,null))['then'](removeEntity(_0x4552e7,null))[_0x9a78('0x2a')](handleError(_0x4552e7,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 297e5d9..9856ad4 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 _0x9a0c=['request-promise','path','rimraf','../../config/environment','./action.attributes','define','tools_actions','util','../../config/logger','api','moment','bluebird'];(function(_0x537db8,_0x606b11){var _0x3fdebd=function(_0x47c1f4){while(--_0x47c1f4){_0x537db8['push'](_0x537db8['shift']());}};_0x3fdebd(++_0x606b11);}(_0x9a0c,0x8b));var _0xc9a0=function(_0x553554,_0x266f60){_0x553554=_0x553554-0x0;var _0x384431=_0x9a0c[_0x553554];return _0x384431;};'use strict';var _=require('lodash');var util=require(_0xc9a0('0x0'));var logger=require(_0xc9a0('0x1'))(_0xc9a0('0x2'));var moment=require(_0xc9a0('0x3'));var BPromise=require(_0xc9a0('0x4'));var rp=require(_0xc9a0('0x5'));var fs=require('fs');var path=require(_0xc9a0('0x6'));var rimraf=require(_0xc9a0('0x7'));var config=require(_0xc9a0('0x8'));var attributes=require(_0xc9a0('0x9'));module['exports']=function(_0x2195d7,_0x150993){return _0x2195d7[_0xc9a0('0xa')]('Action',attributes,{'tableName':_0xc9a0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc25d=['request-promise','rimraf','./action.attributes','define','Action','tools_actions','api','moment'];(function(_0x2b0e7f,_0x557c5c){var _0x22fa86=function(_0xa888a){while(--_0xa888a){_0x2b0e7f['push'](_0x2b0e7f['shift']());}};_0x22fa86(++_0x557c5c);}(_0xc25d,0x1ee));var _0xdc25=function(_0x2d344f,_0x25fa84){_0x2d344f=_0x2d344f-0x0;var _0x2e796b=_0xc25d[_0x2d344f];return _0x2e796b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xdc25('0x0'));var moment=require(_0xdc25('0x1'));var BPromise=require('bluebird');var rp=require(_0xdc25('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdc25('0x3'));var config=require('../../config/environment');var attributes=require(_0xdc25('0x4'));module['exports']=function(_0x3a2376,_0xb06b60){return _0x3a2376[_0xdc25('0x5')](_0xdc25('0x6'),attributes,{'tableName':_0xdc25('0x7'),'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 c9bf0a4..4351a25 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1f0c26,_0x365f93){var _0x2ebbc6=function(_0x563c22){while(--_0x563c22){_0x1f0c26['push'](_0x1f0c26['shift']());}};_0x2ebbc6(++_0x365f93);}(_0x5fab,0x177));var _0xb5fa=function(_0xbf4849,_0x1ba7fe){_0xbf4849=_0xbf4849-0x0;var _0x4f893a=_0x5fab[_0xbf4849];return _0x4f893a;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});} \ No newline at end of file +var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1fecb2,_0x133fd5){_0x1fecb2=_0x1fecb2-0x0;var _0x22833c=_0x1cb9[_0x1fecb2];return _0x22833c;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Action,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 8822e44..d5a0843 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 _0xacb2=['isAuthenticated','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','put'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xacb2,0xc6));var _0x2acb=function(_0x231c25,_0x237859){_0x231c25=_0x231c25-0x0;var _0x2b5c30=_0xacb2[_0x231c25];return _0x2b5c30;};'use strict';var multer=require(_0x2acb('0x0'));var util=require(_0x2acb('0x1'));var path=require(_0x2acb('0x2'));var timeout=require(_0x2acb('0x3'));var express=require(_0x2acb('0x4'));var router=express[_0x2acb('0x5')]();var fs_extra=require(_0x2acb('0x6'));var auth=require(_0x2acb('0x7'));var interaction=require(_0x2acb('0x8'));var config=require('../../config/environment');var controller=require('./action.controller');router[_0x2acb('0x9')]('/:id',auth[_0x2acb('0xa')](),controller['update']);router['delete']('/:id',auth[_0x2acb('0xa')](),controller[_0x2acb('0xb')]);module[_0x2acb('0xc')]=router; \ No newline at end of file +var _0xa6ab=['isAuthenticated','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./action.controller','put','/:id'];(function(_0x29a30e,_0x2202ea){var _0x2db439=function(_0x1ca8d7){while(--_0x1ca8d7){_0x29a30e['push'](_0x29a30e['shift']());}};_0x2db439(++_0x2202ea);}(_0xa6ab,0xf4));var _0xba6a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa6ab[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xba6a('0x0'));var util=require(_0xba6a('0x1'));var path=require(_0xba6a('0x2'));var timeout=require('connect-timeout');var express=require(_0xba6a('0x3'));var router=express[_0xba6a('0x4')]();var fs_extra=require(_0xba6a('0x5'));var auth=require(_0xba6a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xba6a('0x7'));var controller=require(_0xba6a('0x8'));router[_0xba6a('0x9')](_0xba6a('0xa'),auth[_0xba6a('0xb')](),controller[_0xba6a('0xc')]);router['delete'](_0xba6a('0xa'),auth[_0xba6a('0xb')](),controller[_0xba6a('0xd')]);module[_0xba6a('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 3df72e2..693904e 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 _0x53ec=['STRING','TEXT','sequelize','exports'];(function(_0x39f3c6,_0x363fe0){var _0x2ef6e6=function(_0xfedf3e){while(--_0xfedf3e){_0x39f3c6['push'](_0x39f3c6['shift']());}};_0x2ef6e6(++_0x363fe0);}(_0x53ec,0x192));var _0xc53e=function(_0x105ace,_0x3bb3c1){_0x105ace=_0x105ace-0x0;var _0x3131b7=_0x53ec[_0x105ace];return _0x3131b7;};'use strict';var Sequelize=require(_0xc53e('0x0'));module[_0xc53e('0x1')]={'name':{'type':Sequelize[_0xc53e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc53e('0x2')]},'parent':{'type':Sequelize[_0xc53e('0x2')]},'table':{'type':Sequelize[_0xc53e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xc53e('0x3')]}}; \ No newline at end of file +var _0x8958=['TEXT','exports'];(function(_0x143ce6,_0x46e089){var _0x33ed64=function(_0x5a6856){while(--_0x5a6856){_0x143ce6['push'](_0x143ce6['shift']());}};_0x33ed64(++_0x46e089);}(_0x8958,0x93));var _0x8895=function(_0x32017c,_0x3991d4){_0x32017c=_0x32017c-0x0;var _0xca9140=_0x8958[_0x32017c];return _0xca9140;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x8895('0x1')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 48874fb..ec01546 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 _0x36be=['format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','ROUND(%s)','IS\x20NULL','getFields','ValidationErrorItem','select','clone','output','web','%s-%s.%s','randomstring','generate','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','run','runReport','HOUR(%s)','operator','Sequelize','eml-format','rimraf','request-promise','moment','mustache','path','sox','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','AnalyticCustomReport','includeAll','include','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x36be,0xd3));var _0xe36b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x36be[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xe36b('0x0'));var rimraf=require(_0xe36b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe36b('0x2'));var moment=require(_0xe36b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe36b('0x4'));var util=require('util');var path=require(_0xe36b('0x5'));var sox=require(_0xe36b('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe36b('0x7'));var squel=require(_0xe36b('0x8'));var crypto=require('crypto');var jsforce=require(_0xe36b('0x9'));var deskjs=require(_0xe36b('0xa'));var toCsv=require('to-csv');var querystring=require(_0xe36b('0xb'));var Papa=require(_0xe36b('0xc'));var Redis=require(_0xe36b('0xd'));var authService=require(_0xe36b('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe36b('0xf'));var logger=require(_0xe36b('0x10'))(_0xe36b('0x11'));var utils=require(_0xe36b('0x12'));var config=require(_0xe36b('0x13'));var licenseUtil=require(_0xe36b('0x14'));var db=require(_0xe36b('0x15'))['db'];var dbH=require(_0xe36b('0x15'))[_0xe36b('0x16')];function respondWithStatusCode(_0x223c3f,_0x459684){_0x459684=_0x459684||0xcc;return function(_0xf5d9a3){if(_0xf5d9a3){return _0x223c3f[_0xe36b('0x17')](_0x459684);}return _0x223c3f['status'](_0x459684)[_0xe36b('0x18')]();};}function respondWithResult(_0x14eda3,_0x186e07){_0x186e07=_0x186e07||0xc8;return function(_0x140b19){if(_0x140b19){return _0x14eda3[_0xe36b('0x19')](_0x186e07)[_0xe36b('0x1a')](_0x140b19);}};}function respondWithFilteredResult(_0x508774,_0x3f0103){return function(_0x13070e){if(_0x13070e){var _0x3e9809=typeof _0x3f0103[_0xe36b('0x1b')]===_0xe36b('0x1c')&&typeof _0x3f0103[_0xe36b('0x1d')]==='undefined';var _0x379916=_0x13070e[_0xe36b('0x1e')];var _0x3921d3=_0x3e9809?0x0:_0x3f0103[_0xe36b('0x1b')];var _0x524f21=_0x3e9809?_0x13070e['count']:_0x3f0103[_0xe36b('0x1b')]+_0x3f0103['limit'];var _0x24d5ce;if(_0x524f21>=_0x379916){_0x524f21=_0x379916;_0x24d5ce=0xc8;}else{_0x24d5ce=0xce;}_0x508774['status'](_0x24d5ce);return _0x508774[_0xe36b('0x1f')]('Content-Range',_0x3921d3+'-'+_0x524f21+'/'+_0x379916)[_0xe36b('0x1a')](_0x13070e);}return null;};}function patchUpdates(_0x5ab06e){return function(_0x555d7a){try{jsonpatch['apply'](_0x555d7a,_0x5ab06e,!![]);}catch(_0x2992d6){return BPromise[_0xe36b('0x20')](_0x2992d6);}return _0x555d7a[_0xe36b('0x21')]();};}function saveUpdates(_0x424283,_0x356992){return function(_0x105792){if(_0x105792){return _0x105792['update'](_0x424283)[_0xe36b('0x22')](function(_0x3bdb2b){return _0x3bdb2b;});}return null;};}function removeEntity(_0x5145b8,_0x10f944){return function(_0x5be4d1){if(_0x5be4d1){return _0x5be4d1[_0xe36b('0x23')]()[_0xe36b('0x22')](function(){var _0x1c8e89=_0x5be4d1[_0xe36b('0x24')]({'plain':!![]});var _0x56f055=_0xe36b('0x25');return db[_0xe36b('0x26')][_0xe36b('0x23')]({'where':{'type':_0x56f055,'resourceId':_0x1c8e89['id']}})[_0xe36b('0x22')](function(){return _0x5be4d1;});})['then'](function(){_0x5145b8[_0xe36b('0x19')](0xcc)[_0xe36b('0x18')]();});}};}function handleEntityNotFound(_0x22db12,_0x4537e3){return function(_0x42aa58){if(!_0x42aa58){_0x22db12['sendStatus'](0x194);}return _0x42aa58;};}function handleError(_0x19d112,_0x28590c){_0x28590c=_0x28590c||0x1f4;return function(_0x14dce1){logger[_0xe36b('0x27')](_0x14dce1[_0xe36b('0x28')]);if(_0x14dce1[_0xe36b('0x29')]){delete _0x14dce1[_0xe36b('0x29')];}_0x19d112['status'](_0x28590c)['send'](_0x14dce1);};}exports[_0xe36b('0x2a')]=function(_0x4cbe29,_0x48bc19){var _0x3274a8={},_0x28cac9={},_0x421a74={'count':0x0,'rows':[]};var _0x412998=_[_0xe36b('0x2b')](db['AnalyticCustomReport'][_0xe36b('0x2c')],function(_0xd8bce1){return{'name':_0xd8bce1[_0xe36b('0x2d')],'type':_0xd8bce1['type'][_0xe36b('0x2e')]};});_0x28cac9[_0xe36b('0x2f')]=_[_0xe36b('0x2b')](_0x412998,'name');_0x28cac9[_0xe36b('0x30')]=_[_0xe36b('0x31')](_0x4cbe29[_0xe36b('0x30')]);_0x28cac9['filters']=_[_0xe36b('0x32')](_0x28cac9[_0xe36b('0x2f')],_0x28cac9[_0xe36b('0x30')]);_0x3274a8[_0xe36b('0x33')]=_[_0xe36b('0x32')](_0x28cac9[_0xe36b('0x2f')],qs[_0xe36b('0x34')](_0x4cbe29[_0xe36b('0x30')][_0xe36b('0x34')]));_0x3274a8[_0xe36b('0x33')]=_0x3274a8[_0xe36b('0x33')][_0xe36b('0x35')]?_0x3274a8['attributes']:_0x28cac9[_0xe36b('0x2f')];if(!_0x4cbe29[_0xe36b('0x30')][_0xe36b('0x36')]('nolimit')){_0x3274a8[_0xe36b('0x1d')]=qs[_0xe36b('0x1d')](_0x4cbe29[_0xe36b('0x30')]['limit']);_0x3274a8[_0xe36b('0x1b')]=qs[_0xe36b('0x1b')](_0x4cbe29['query'][_0xe36b('0x1b')]);}_0x3274a8[_0xe36b('0x37')]=qs[_0xe36b('0x38')](_0x4cbe29[_0xe36b('0x30')][_0xe36b('0x38')]);_0x3274a8[_0xe36b('0x39')]=qs[_0xe36b('0x3a')](_[_0xe36b('0x3b')](_0x4cbe29[_0xe36b('0x30')],_0x28cac9['filters']),_0x412998);if(_0x4cbe29[_0xe36b('0x30')][_0xe36b('0x3c')]){_0x3274a8[_0xe36b('0x39')]=_[_0xe36b('0x3d')](_0x3274a8['where'],{'$or':_['map'](_0x412998,function(_0x5779fb){if(_0x5779fb[_0xe36b('0x3e')]!==_0xe36b('0x3f')){var _0x3ad774={};_0x3ad774[_0x5779fb[_0xe36b('0x29')]]={'$like':'%'+_0x4cbe29[_0xe36b('0x30')][_0xe36b('0x3c')]+'%'};return _0x3ad774;}})});}_0x3274a8=_[_0xe36b('0x3d')]({},_0x3274a8,_0x4cbe29[_0xe36b('0x40')]);var _0x2cb34d={'where':_0x3274a8[_0xe36b('0x39')]};return db[_0xe36b('0x41')][_0xe36b('0x1e')](_0x2cb34d)[_0xe36b('0x22')](function(_0x3177a0){_0x421a74[_0xe36b('0x1e')]=_0x3177a0;if(_0x4cbe29['query'][_0xe36b('0x42')]){_0x3274a8[_0xe36b('0x43')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xe36b('0x44')](_0x3274a8);})['then'](function(_0x37e6a8){_0x421a74[_0xe36b('0x45')]=_0x37e6a8;return _0x421a74;})[_0xe36b('0x22')](respondWithFilteredResult(_0x48bc19,_0x3274a8))[_0xe36b('0x46')](handleError(_0x48bc19,null));};exports[_0xe36b('0x47')]=function(_0x8b74c1,_0x495e6a){var _0x349612={'raw':![],'where':{'id':_0x8b74c1['params']['id']}},_0x18eedf={};_0x18eedf[_0xe36b('0x2f')]=_['keys'](db[_0xe36b('0x41')][_0xe36b('0x2c')]);_0x18eedf['query']=_[_0xe36b('0x31')](_0x8b74c1[_0xe36b('0x30')]);_0x18eedf[_0xe36b('0x3a')]=_[_0xe36b('0x32')](_0x18eedf[_0xe36b('0x2f')],_0x18eedf[_0xe36b('0x30')]);_0x349612[_0xe36b('0x33')]=_[_0xe36b('0x32')](_0x18eedf[_0xe36b('0x2f')],qs['fields'](_0x8b74c1[_0xe36b('0x30')][_0xe36b('0x34')]));_0x349612[_0xe36b('0x33')]=_0x349612[_0xe36b('0x33')]['length']?_0x349612[_0xe36b('0x33')]:_0x18eedf[_0xe36b('0x2f')];if(_0x8b74c1[_0xe36b('0x30')][_0xe36b('0x42')]){_0x349612[_0xe36b('0x43')]=[{'all':!![]}];}_0x349612=_[_0xe36b('0x3d')]({},_0x349612,_0x8b74c1['options']);return db[_0xe36b('0x41')][_0xe36b('0x48')](_0x349612)['then'](handleEntityNotFound(_0x495e6a,null))['then'](respondWithResult(_0x495e6a,null))[_0xe36b('0x46')](handleError(_0x495e6a,null));};exports[_0xe36b('0x49')]=function(_0x889a4d,_0x3990b9){return db[_0xe36b('0x41')][_0xe36b('0x49')](_0x889a4d[_0xe36b('0x4a')],{})[_0xe36b('0x22')](function(_0x4b6ed2){var _0x24e663=_0x889a4d[_0xe36b('0x4b')][_0xe36b('0x24')]({'plain':!![]});if(!_0x24e663)throw new Error(_0xe36b('0x4c'));if(_0x24e663['role']===_0xe36b('0x4b')){var _0x1a4f32=_0x4b6ed2['get']({'plain':!![]});var _0x2d9316=_0xe36b('0x4d');return db[_0xe36b('0x4e')][_0xe36b('0x48')]({'where':{'name':_0x2d9316,'userProfileId':_0x24e663[_0xe36b('0x4f')]},'raw':!![]})['then'](function(_0x69f7d0){if(_0x69f7d0&&_0x69f7d0[_0xe36b('0x50')]===0x0){return db[_0xe36b('0x26')][_0xe36b('0x49')]({'name':_0x1a4f32[_0xe36b('0x29')],'resourceId':_0x1a4f32['id'],'type':'CustomReports','sectionId':_0x69f7d0['id']},{})[_0xe36b('0x22')](function(){return _0x4b6ed2;});}else{return _0x4b6ed2;}})[_0xe36b('0x46')](function(_0x3058c0){logger[_0xe36b('0x27')](_0xe36b('0x51'),_0x3058c0);throw _0x3058c0;});}return _0x4b6ed2;})['then'](respondWithResult(_0x3990b9,0xc9))[_0xe36b('0x46')](handleError(_0x3990b9,null));};exports['update']=function(_0x7ff4f5,_0x195cfb){if(_0x7ff4f5['body']['id']){delete _0x7ff4f5[_0xe36b('0x4a')]['id'];}return db[_0xe36b('0x41')][_0xe36b('0x48')]({'where':{'id':_0x7ff4f5['params']['id']}})[_0xe36b('0x22')](handleEntityNotFound(_0x195cfb,null))[_0xe36b('0x22')](saveUpdates(_0x7ff4f5[_0xe36b('0x4a')],null))[_0xe36b('0x22')](respondWithResult(_0x195cfb,null))[_0xe36b('0x46')](handleError(_0x195cfb,null));};exports[_0xe36b('0x23')]=function(_0x2f5f6d,_0x3aa943){return db['AnalyticCustomReport']['find']({'where':{'id':_0x2f5f6d[_0xe36b('0x52')]['id']}})[_0xe36b('0x22')](handleEntityNotFound(_0x3aa943,null))[_0xe36b('0x22')](removeEntity(_0x3aa943,null))[_0xe36b('0x46')](handleError(_0x3aa943,null));};exports[_0xe36b('0x53')]=function(_0x4b52f3,_0x46bff4){var _0x1a525d=0xa;var _0x526c62=[_0xe36b('0x54'),_0xe36b('0x55'),_0xe36b('0x56'),_0xe36b('0x57')];var _0xb0750f={'SUM':_0xe36b('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xe36b('0x59'),'MAX':_0xe36b('0x5a'),'MIN':_0xe36b('0x5b'),'AVG':_0xe36b('0x5c'),'GROUP_CONCAT':_0xe36b('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xe36b('0x5e')};var _0x26e519={'SEC_TO_TIME':_0xe36b('0x5f'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xe36b('0x60')};var _0xd985ea=function(_0x4345f5){return!_[_0xe36b('0x61')](['IS\x20NULL',_0xe36b('0x62'),_0xe36b('0x63'),_0xe36b('0x64')],_0x4345f5);};var _0x553f20=function(_0x515624){if(!_0x515624||!_0x515624['rules'][_0xe36b('0x35')]){return'';}for(var _0x1e3b26='(',_0x960d9b=0x0;_0x960d9b<_0x515624[_0xe36b('0x65')]['length'];_0x960d9b+=0x1){_0x960d9b>0x0&&(_0x1e3b26+='\x20'+_0x515624['operator']+'\x20');_0x1e3b26+=_0x515624['rules'][_0x960d9b][_0xe36b('0x66')]?_0x553f20(_0x515624[_0xe36b('0x65')][_0x960d9b][_0xe36b('0x66')]):_0x515624['rules'][_0x960d9b][_0xe36b('0x67')]+'\x20'+_0x515624[_0xe36b('0x65')][_0x960d9b][_0xe36b('0x68')]+(_0xd985ea(_0x515624[_0xe36b('0x65')][_0x960d9b][_0xe36b('0x68')])?'\x20'+_0x515624[_0xe36b('0x65')][_0x960d9b][_0xe36b('0x69')]:'');}return _0x1e3b26+')';};var _0x39bab3={'where':{'id':_0x4b52f3[_0xe36b('0x52')]['id']}},_0x74a216,_0x47ba2e,_0x481678,_0xd7e66,_0x29bc7e;_0x39bab3=_[_0xe36b('0x3d')]({},_0x39bab3,_0x4b52f3[_0xe36b('0x40')]);return db[_0xe36b('0x41')]['find'](_0x39bab3)['then'](function(_0x48d839){if(_0x48d839){_0x74a216=_0x48d839;return _0x48d839['getFields']();}return null;})[_0xe36b('0x22')](function(_0x53becc){if(_0x53becc){if(!_0x53becc[_0xe36b('0x35')]){throw new db['Sequelize']['ValidationErrorItem'](_0xe36b('0x6a'),0x193);}_0x47ba2e=_0x53becc;return db[_0xe36b('0x6b')]['findAll']({'raw':!![]});}return null;})[_0xe36b('0x22')](function(_0x127aec){if(_0x127aec){_0x481678=_[_0xe36b('0x6c')](_0x127aec,'id');var _0x1ba48b;var _0x3b40cd=squel['select']();_0x3b40cd[_0xe36b('0x6d')](_0x74a216[_0xe36b('0x6e')]);for(var _0x19de18=0x0;_0x19de18<_0x47ba2e['length'];_0x19de18+=0x1){_0x1ba48b=_0x47ba2e[_0x19de18]['MetricId']?_0x481678[_0x47ba2e[_0x19de18][_0xe36b('0x6f')]][_0xe36b('0x70')]:_0x47ba2e[_0x19de18][_0xe36b('0x67')];_0x1ba48b=_0x47ba2e[_0x19de18][_0xe36b('0x71')]?_[_0xe36b('0x72')](_0xb0750f[_0x47ba2e[_0x19de18]['function']],'%s',_0x1ba48b):_0x1ba48b;_0x1ba48b=_0x47ba2e[_0x19de18]['format']?_[_0xe36b('0x72')](_0x26e519[_0x47ba2e[_0x19de18][_0xe36b('0x73')]],'%s',_0x1ba48b):_0x1ba48b;if(_0x47ba2e[_0x19de18][_0xe36b('0x74')]){_0x3b40cd[_0xe36b('0x66')](_0x1ba48b);}_0x47ba2e[_0x19de18]['orderBy']&&_0x3b40cd[_0xe36b('0x37')](_0x1ba48b,_0x47ba2e[_0x19de18][_0xe36b('0x75')]===_0xe36b('0x76')?![]:!![]);_0x3b40cd['field'](_0x1ba48b,_0x47ba2e[_0x19de18][_0xe36b('0x77')]||_0x1ba48b);}if(_0x74a216[_0xe36b('0x78')]){_0x74a216[_0xe36b('0x78')]=JSON[_0xe36b('0x79')](_0x74a216[_0xe36b('0x78')]);for(var _0x40e7c0=0x0;_0x40e7c0<_0x74a216[_0xe36b('0x78')][_0xe36b('0x35')];_0x40e7c0+=0x1){if(_0x74a216[_0xe36b('0x78')][_0x40e7c0][_0xe36b('0x3e')]&&_[_0xe36b('0x61')](_0x526c62,_0x74a216[_0xe36b('0x78')][_0x40e7c0]['type'])&&_0x74a216[_0xe36b('0x78')][_0x40e7c0][_0xe36b('0x7a')]&&_0x74a216[_0xe36b('0x78')][_0x40e7c0][_0xe36b('0x7b')]&&_0x74a216['joins'][_0x40e7c0][_0xe36b('0x7c')]){_0x3b40cd[_0x74a216[_0xe36b('0x78')][_0x40e7c0]['type']](_0x74a216[_0xe36b('0x78')][_0x40e7c0][_0xe36b('0x7b')],null,util['format'](_0xe36b('0x7d'),_0x74a216[_0xe36b('0x6e')],_0x74a216[_0xe36b('0x78')][_0x40e7c0][_0xe36b('0x7a')],_0x74a216[_0xe36b('0x78')][_0x40e7c0]['foreignTable'],_0x74a216['joins'][_0x40e7c0][_0xe36b('0x7c')]));}}}if(_0x74a216[_0xe36b('0x7e')]){_0x74a216[_0xe36b('0x7e')]=JSON[_0xe36b('0x79')](_0x74a216['conditions']);_0x3b40cd[_0xe36b('0x39')](_0x553f20(_0x74a216[_0xe36b('0x7e')][_0xe36b('0x66')]));}_0x29bc7e=_0x3b40cd['clone']();_0x3b40cd[_0xe36b('0x1d')](_0x1a525d);_0x3b40cd[_0xe36b('0x1b')](0x0);logger[_0xe36b('0x7f')](_0xe36b('0x80'),_0x3b40cd[_0xe36b('0x81')]());return dbH['sequelize'][_0xe36b('0x30')](_0x3b40cd[_0xe36b('0x81')](),{'type':dbH[_0xe36b('0x82')][_0xe36b('0x83')][_0xe36b('0x84')]});}})[_0xe36b('0x22')](respondWithResult(_0x46bff4,null))[_0xe36b('0x46')](handleError(_0x46bff4,null));};function runReport(_0x51808c,_0x34f5b5,_0x168dbe){var _0x5e8ff6=_0x34f5b5[_0xe36b('0x29')];var _0x3942b2=0xa;var _0x976b4a=[_0xe36b('0x54'),_0xe36b('0x55'),_0xe36b('0x56'),_0xe36b('0x57')];var _0x441429={'SUM':_0xe36b('0x58'),'COUNT':_0xe36b('0x85'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe36b('0x5a'),'MIN':_0xe36b('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xe36b('0x5d'),'GROUP_CONCAT ASC':_0xe36b('0x86'),'GROUP_CONCAT DESC':_0xe36b('0x5e')};var _0x42543c={'SEC_TO_TIME':_0xe36b('0x5f'),'DATE':_0xe36b('0x87'),'HOUR':'HOUR(%s)','ROUND':_0xe36b('0x88'),'UNIX_TIMESTAMP':_0xe36b('0x60')};var _0x4980f5=function(_0x2c2817){return!_[_0xe36b('0x61')]([_0xe36b('0x89'),_0xe36b('0x62'),_0xe36b('0x63'),'IS\x20NOT\x20EMPTY'],_0x2c2817);};var _0x53c569=function(_0xbb4a68){if(!_0xbb4a68||!_0xbb4a68[_0xe36b('0x65')][_0xe36b('0x35')]){return'';}for(var _0x4fa8f2='(',_0x3f0255=0x0;_0x3f0255<_0xbb4a68['rules']['length'];_0x3f0255+=0x1){_0x3f0255>0x0&&(_0x4fa8f2+='\x20'+_0xbb4a68['operator']+'\x20');_0x4fa8f2+=_0xbb4a68[_0xe36b('0x65')][_0x3f0255][_0xe36b('0x66')]?_0x53c569(_0xbb4a68['rules'][_0x3f0255][_0xe36b('0x66')]):_0xbb4a68[_0xe36b('0x65')][_0x3f0255][_0xe36b('0x67')]+'\x20'+_0xbb4a68[_0xe36b('0x65')][_0x3f0255]['condition']+(_0x4980f5(_0xbb4a68[_0xe36b('0x65')][_0x3f0255][_0xe36b('0x68')])?'\x20'+_0xbb4a68[_0xe36b('0x65')][_0x3f0255][_0xe36b('0x69')]:'');}return _0x4fa8f2+')';};var _0x76f0a7={'where':{'id':_0x51808c['id']}},_0x27ad7b,_0x49a6f1,_0x459c42,_0x353f16,_0x325d64;_0x76f0a7=_['merge']({},_0x76f0a7,_0x168dbe);return db[_0xe36b('0x41')]['find'](_0x76f0a7)[_0xe36b('0x22')](function(_0x4b967e){if(_0x4b967e){_0x27ad7b=_0x4b967e;return _0x4b967e[_0xe36b('0x8a')]();}return null;})['then'](function(_0x30a1f1){if(_0x30a1f1){if(!_0x30a1f1[_0xe36b('0x35')]){throw new db['Sequelize'][(_0xe36b('0x8b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x49a6f1=_0x30a1f1;return db[_0xe36b('0x6b')][_0xe36b('0x44')]({'raw':!![]});}return null;})[_0xe36b('0x22')](function(_0x2e02cd){if(_0x2e02cd){_0x459c42=_[_0xe36b('0x6c')](_0x2e02cd,'id');var _0x26a41d;var _0x4c1f5e=squel[_0xe36b('0x8c')]();_0x4c1f5e[_0xe36b('0x6d')](_0x27ad7b['table']);for(var _0x36bfe8=0x0;_0x36bfe8<_0x49a6f1[_0xe36b('0x35')];_0x36bfe8+=0x1){_0x26a41d=_0x49a6f1[_0x36bfe8][_0xe36b('0x6f')]?_0x459c42[_0x49a6f1[_0x36bfe8][_0xe36b('0x6f')]][_0xe36b('0x70')]:_0x49a6f1[_0x36bfe8]['field'];_0x26a41d=_0x49a6f1[_0x36bfe8][_0xe36b('0x71')]?_['replace'](_0x441429[_0x49a6f1[_0x36bfe8][_0xe36b('0x71')]],'%s',_0x26a41d):_0x26a41d;_0x26a41d=_0x49a6f1[_0x36bfe8]['format']?_[_0xe36b('0x72')](_0x42543c[_0x49a6f1[_0x36bfe8][_0xe36b('0x73')]],'%s',_0x26a41d):_0x26a41d;if(_0x49a6f1[_0x36bfe8][_0xe36b('0x74')]){_0x4c1f5e['group'](_0x26a41d);}_0x49a6f1[_0x36bfe8][_0xe36b('0x75')]&&_0x4c1f5e[_0xe36b('0x37')](_0x26a41d,_0x49a6f1[_0x36bfe8][_0xe36b('0x75')]===_0xe36b('0x76')?![]:!![]);_0x4c1f5e[_0xe36b('0x67')](_0x26a41d,_0x49a6f1[_0x36bfe8][_0xe36b('0x77')]||_0x26a41d);}if(_0x27ad7b['joins']){_0x27ad7b['joins']=JSON[_0xe36b('0x79')](_0x27ad7b['joins']);for(var _0x557df8=0x0;_0x557df8<_0x27ad7b[_0xe36b('0x78')][_0xe36b('0x35')];_0x557df8+=0x1){if(_0x27ad7b[_0xe36b('0x78')][_0x557df8][_0xe36b('0x3e')]&&_[_0xe36b('0x61')](_0x976b4a,_0x27ad7b[_0xe36b('0x78')][_0x557df8][_0xe36b('0x3e')])&&_0x27ad7b[_0xe36b('0x78')][_0x557df8][_0xe36b('0x7a')]&&_0x27ad7b[_0xe36b('0x78')][_0x557df8]['foreignTable']&&_0x27ad7b[_0xe36b('0x78')][_0x557df8][_0xe36b('0x7c')]){_0x4c1f5e[_0x27ad7b[_0xe36b('0x78')][_0x557df8]['type']](_0x27ad7b[_0xe36b('0x78')][_0x557df8][_0xe36b('0x7b')],null,util[_0xe36b('0x73')]('%s.%s\x20=\x20%s.%s',_0x27ad7b[_0xe36b('0x6e')],_0x27ad7b[_0xe36b('0x78')][_0x557df8][_0xe36b('0x7a')],_0x27ad7b[_0xe36b('0x78')][_0x557df8]['foreignTable'],_0x27ad7b[_0xe36b('0x78')][_0x557df8]['foreignKey']));}}}if(_0x27ad7b['conditions']){_0x27ad7b[_0xe36b('0x7e')]=JSON[_0xe36b('0x79')](_0x27ad7b['conditions']);_0x4c1f5e[_0xe36b('0x39')](_0x53c569(_0x27ad7b[_0xe36b('0x7e')]['group']));}_0x325d64=_0x4c1f5e[_0xe36b('0x8d')]();_0x4c1f5e[_0xe36b('0x1d')](_0x3942b2);_0x4c1f5e[_0xe36b('0x1b')](0x0);return;}})['then'](function(){if(_0x34f5b5[_0xe36b('0x8e')]===_0xe36b('0x8f')){return null;}var _0x3f88e8=_[_0xe36b('0x3d')](_0x34f5b5,{'name':_0x34f5b5['fullPath']||_0x34f5b5['name']||_0x27ad7b[_0xe36b('0x29')],'basename':_0x5e8ff6,'savename':util[_0xe36b('0x73')](_0xe36b('0x90'),_0x34f5b5[_0xe36b('0x29')]||_0x27ad7b['name'],require(_0xe36b('0x91'))[_0xe36b('0x92')](0x4),_0x34f5b5[_0xe36b('0x8e')]||'csv'),'reportId':_0x27ad7b['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0xe36b('0x49')](_0x3f88e8,{'raw':!![]});})[_0xe36b('0x22')](function(_0x59e0b0){if(_0x27ad7b[_0xe36b('0x6e')]===_0xe36b('0x93')){_0x325d64[_0xe36b('0x39')](_0x27ad7b[_0xe36b('0x6e')]+_0xe36b('0x94'),_0x34f5b5['startDate'],_0x34f5b5[_0xe36b('0x95')]);}else{_0x325d64[_0xe36b('0x39')](_0x27ad7b[_0xe36b('0x6e')]+_0xe36b('0x96'),_0x34f5b5[_0xe36b('0x97')],_0x34f5b5[_0xe36b('0x95')]);}if(_0x59e0b0){logger['info']('Run\x20Query:',_0x325d64[_0xe36b('0x81')]());require(_0xe36b('0x98'))[_0xe36b('0x99')](path[_0xe36b('0x54')](__dirname,_0xe36b('0x9a'),_0x59e0b0[_0xe36b('0x8e')]),[_0x59e0b0['id'],_0x325d64['toString'](),path['join'](__dirname,'../../files/reports',_0x59e0b0[_0xe36b('0x9b')]),_0x5e8ff6]);return _0x59e0b0;}else{var _0x25b4bf=squel[_0xe36b('0x8c')]();_0x25b4bf[_0xe36b('0x6d')]('('+_0x325d64[_0xe36b('0x81')]()+')',_0xe36b('0x9c'));_0x25b4bf[_0xe36b('0x67')](_0xe36b('0x9d'),_0xe36b('0x1e'));_0x325d64[_0xe36b('0x1d')](_0x34f5b5[_0xe36b('0x1d')]||_0x3942b2);_0x325d64[_0xe36b('0x1b')](_0x34f5b5[_0xe36b('0x1b')]||0x0);return dbH[_0xe36b('0x82')]['query'](_0x25b4bf[_0xe36b('0x81')](),{'type':dbH[_0xe36b('0x82')][_0xe36b('0x83')]['SELECT']})[_0xe36b('0x22')](function(_0x150864){if(!_0x150864[_0xe36b('0x35')]){_0x353f16=0x0;}else{_0x353f16=_0x150864[0x0]['count']||0x0;}return dbH[_0xe36b('0x82')][_0xe36b('0x30')](_0x325d64[_0xe36b('0x81')](),{'type':dbH[_0xe36b('0x82')]['QueryTypes'][_0xe36b('0x84')]});})[_0xe36b('0x22')](function(_0x3b003f){return{'rows':_0x3b003f||[],'count':_0x353f16};});}});}exports[_0xe36b('0x9e')]=function(_0x3b6fe6,_0x49b122){return runReport(_0x3b6fe6[_0xe36b('0x52')],_0x3b6fe6[_0xe36b('0x30')],_0x3b6fe6[_0xe36b('0x40')])[_0xe36b('0x22')](respondWithResult(_0x49b122,null))[_0xe36b('0x46')](handleError(_0x49b122,null));};exports[_0xe36b('0x9f')]=runReport;exports[_0xe36b('0x30')]=function(_0x1d92cc,_0xcfc6b2){var _0x308c9d=0xa;var _0x44e192=[_0xe36b('0x54'),_0xe36b('0x55'),_0xe36b('0x56'),_0xe36b('0x57')];var _0x244655={'SUM':'SUM(%s)','COUNT':_0xe36b('0x85'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe36b('0x5a'),'MIN':_0xe36b('0x5b'),'AVG':_0xe36b('0x5c'),'GROUP_CONCAT':_0xe36b('0x5d'),'GROUP_CONCAT ASC':_0xe36b('0x86'),'GROUP_CONCAT DESC':_0xe36b('0x5e')};var _0x129ad5={'SEC_TO_TIME':_0xe36b('0x5f'),'DATE':_0xe36b('0x87'),'HOUR':_0xe36b('0xa0'),'ROUND':_0xe36b('0x88'),'UNIX_TIMESTAMP':_0xe36b('0x60')};var _0x2ee7af=function(_0x1e20e5){return!_[_0xe36b('0x61')]([_0xe36b('0x89'),_0xe36b('0x62'),_0xe36b('0x63'),_0xe36b('0x64')],_0x1e20e5);};var _0x4e0319=function(_0x502d2d){if(!_0x502d2d||!_0x502d2d['rules'][_0xe36b('0x35')]){return'';}for(var _0x4d64cd='(',_0x18d40f=0x0;_0x18d40f<_0x502d2d['rules']['length'];_0x18d40f+=0x1){_0x18d40f>0x0&&(_0x4d64cd+='\x20'+_0x502d2d[_0xe36b('0xa1')]+'\x20');_0x4d64cd+=_0x502d2d[_0xe36b('0x65')][_0x18d40f]['group']?_0x4e0319(_0x502d2d[_0xe36b('0x65')][_0x18d40f][_0xe36b('0x66')]):_0x502d2d[_0xe36b('0x65')][_0x18d40f][_0xe36b('0x67')]+'\x20'+_0x502d2d[_0xe36b('0x65')][_0x18d40f][_0xe36b('0x68')]+(_0x2ee7af(_0x502d2d[_0xe36b('0x65')][_0x18d40f]['condition'])?'\x20'+_0x502d2d['rules'][_0x18d40f][_0xe36b('0x69')]:'');}return _0x4d64cd+')';};var _0x2d97f8={'where':{'id':_0x1d92cc[_0xe36b('0x52')]['id']}},_0x19d09c,_0x34c8d0,_0xc1020e,_0x236605,_0x5e9ed8;_0x2d97f8=_['merge']({},_0x2d97f8,_0x1d92cc[_0xe36b('0x40')]);return db[_0xe36b('0x41')][_0xe36b('0x48')](_0x2d97f8)[_0xe36b('0x22')](function(_0x287d7f){if(_0x287d7f){_0x19d09c=_0x287d7f;return _0x287d7f['getFields']();}return null;})[_0xe36b('0x22')](function(_0x3ea767){if(_0x3ea767){if(!_0x3ea767[_0xe36b('0x35')]){throw new db[(_0xe36b('0xa2'))]['ValidationErrorItem'](_0xe36b('0x6a'),0x193);}_0x34c8d0=_0x3ea767;return db['AnalyticMetric'][_0xe36b('0x44')]({'raw':!![]});}return null;})[_0xe36b('0x22')](function(_0x1632cb){if(_0x1632cb){_0xc1020e=_[_0xe36b('0x6c')](_0x1632cb,'id');var _0x1039b9;var _0x10f3fe=squel[_0xe36b('0x8c')]();_0x10f3fe[_0xe36b('0x6d')](_0x19d09c['table']);for(var _0x342315=0x0;_0x342315<_0x34c8d0[_0xe36b('0x35')];_0x342315+=0x1){_0x1039b9=_0x34c8d0[_0x342315][_0xe36b('0x6f')]?_0xc1020e[_0x34c8d0[_0x342315][_0xe36b('0x6f')]][_0xe36b('0x70')]:_0x34c8d0[_0x342315][_0xe36b('0x67')];_0x1039b9=_0x34c8d0[_0x342315][_0xe36b('0x71')]?_[_0xe36b('0x72')](_0x244655[_0x34c8d0[_0x342315][_0xe36b('0x71')]],'%s',_0x1039b9):_0x1039b9;_0x1039b9=_0x34c8d0[_0x342315]['format']?_[_0xe36b('0x72')](_0x129ad5[_0x34c8d0[_0x342315]['format']],'%s',_0x1039b9):_0x1039b9;if(_0x34c8d0[_0x342315][_0xe36b('0x74')]){_0x10f3fe['group'](_0x1039b9);}_0x34c8d0[_0x342315][_0xe36b('0x75')]&&_0x10f3fe['order'](_0x1039b9,_0x34c8d0[_0x342315]['orderBy']===_0xe36b('0x76')?![]:!![]);_0x10f3fe[_0xe36b('0x67')](_0x1039b9,_0x34c8d0[_0x342315][_0xe36b('0x77')]||_0x1039b9);}if(_0x19d09c[_0xe36b('0x78')]){_0x19d09c['joins']=JSON['parse'](_0x19d09c['joins']);for(var _0x495735=0x0;_0x495735<_0x19d09c['joins'][_0xe36b('0x35')];_0x495735+=0x1){if(_0x19d09c['joins'][_0x495735]['type']&&_[_0xe36b('0x61')](_0x44e192,_0x19d09c[_0xe36b('0x78')][_0x495735]['type'])&&_0x19d09c[_0xe36b('0x78')][_0x495735]['parentKey']&&_0x19d09c[_0xe36b('0x78')][_0x495735]['foreignTable']&&_0x19d09c[_0xe36b('0x78')][_0x495735][_0xe36b('0x7c')]){_0x10f3fe[_0x19d09c[_0xe36b('0x78')][_0x495735]['type']](_0x19d09c['joins'][_0x495735][_0xe36b('0x7b')],null,util[_0xe36b('0x73')](_0xe36b('0x7d'),_0x19d09c['table'],_0x19d09c[_0xe36b('0x78')][_0x495735]['parentKey'],_0x19d09c['joins'][_0x495735][_0xe36b('0x7b')],_0x19d09c['joins'][_0x495735]['foreignKey']));}}}if(_0x19d09c['conditions']){_0x19d09c[_0xe36b('0x7e')]=JSON['parse'](_0x19d09c['conditions']);_0x10f3fe['where'](_0x4e0319(_0x19d09c[_0xe36b('0x7e')][_0xe36b('0x66')]));}_0x5e9ed8=_0x10f3fe['clone']();_0x10f3fe[_0xe36b('0x1d')](_0x308c9d);_0x10f3fe[_0xe36b('0x1b')](0x0);logger[_0xe36b('0x7f')](_0xe36b('0x80'),_0x10f3fe['toString']());return dbH[_0xe36b('0x82')][_0xe36b('0x30')](_0x10f3fe[_0xe36b('0x81')](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});}})[_0xe36b('0x22')](function(){return{'sql':_0x5e9ed8[_0xe36b('0x81')]()};})[_0xe36b('0x22')](respondWithResult(_0xcfc6b2,null))[_0xe36b('0x46')](handleError(_0xcfc6b2,null));}; \ No newline at end of file +var _0xadf9=['util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','CustomReports','error','stack','name','send','index','map','AnalyticCustomReport','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','preview','join','left_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','MetricId','metric','field','function','replace','format','groupBy','orderBy','parse','joins','includes','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','clone','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','AVG(%s)','SEC_TO_TIME(%s)','value','select','DESC','alias','output','web','fullPath','%s-%s.%s','randomstring','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','right_join','Limited\x20Query:','eml-format','rimraf','zip-dir','moment','bluebird'];(function(_0x1c7cc7,_0x15289d){var _0x2d7875=function(_0x5876b1){while(--_0x5876b1){_0x1c7cc7['push'](_0x1c7cc7['shift']());}};_0x2d7875(++_0x15289d);}(_0xadf9,0xa4));var _0x9adf=function(_0x540a65,_0x1b75e2){_0x540a65=_0x540a65-0x0;var _0x14dc3e=_0xadf9[_0x540a65];return _0x14dc3e;};'use strict';var emlformat=require(_0x9adf('0x0'));var rimraf=require(_0x9adf('0x1'));var zipdir=require(_0x9adf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9adf('0x3'));var BPromise=require(_0x9adf('0x4'));var Mustache=require('mustache');var util=require(_0x9adf('0x5'));var path=require(_0x9adf('0x6'));var sox=require(_0x9adf('0x7'));var csv=require('to-csv');var ejs=require(_0x9adf('0x8'));var fs=require('fs');var fs_extra=require(_0x9adf('0x9'));var _=require(_0x9adf('0xa'));var squel=require(_0x9adf('0xb'));var crypto=require(_0x9adf('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9adf('0xd'));var toCsv=require(_0x9adf('0xe'));var querystring=require('querystring');var Papa=require(_0x9adf('0xf'));var Redis=require(_0x9adf('0x10'));var authService=require(_0x9adf('0x11'));var qs=require(_0x9adf('0x12'));var as=require(_0x9adf('0x13'));var hardwareService=require(_0x9adf('0x14'));var logger=require('../../config/logger')(_0x9adf('0x15'));var utils=require(_0x9adf('0x16'));var config=require(_0x9adf('0x17'));var licenseUtil=require(_0x9adf('0x18'));var db=require(_0x9adf('0x19'))['db'];var dbH=require(_0x9adf('0x19'))[_0x9adf('0x1a')];function respondWithStatusCode(_0x4e5396,_0x2f9b53){_0x2f9b53=_0x2f9b53||0xcc;return function(_0x545d9e){if(_0x545d9e){return _0x4e5396[_0x9adf('0x1b')](_0x2f9b53);}return _0x4e5396['status'](_0x2f9b53)[_0x9adf('0x1c')]();};}function respondWithResult(_0x5ddaff,_0x3dddbb){_0x3dddbb=_0x3dddbb||0xc8;return function(_0x5fde6f){if(_0x5fde6f){return _0x5ddaff[_0x9adf('0x1d')](_0x3dddbb)[_0x9adf('0x1e')](_0x5fde6f);}};}function respondWithFilteredResult(_0x442dc1,_0x1717c4){return function(_0x50a85e){if(_0x50a85e){var _0x674ecb=typeof _0x1717c4[_0x9adf('0x1f')]===_0x9adf('0x20')&&typeof _0x1717c4[_0x9adf('0x21')]==='undefined';var _0x31d7b1=_0x50a85e[_0x9adf('0x22')];var _0x327b79=_0x674ecb?0x0:_0x1717c4[_0x9adf('0x1f')];var _0x4ca467=_0x674ecb?_0x50a85e[_0x9adf('0x22')]:_0x1717c4[_0x9adf('0x1f')]+_0x1717c4['limit'];var _0x5797ba;if(_0x4ca467>=_0x31d7b1){_0x4ca467=_0x31d7b1;_0x5797ba=0xc8;}else{_0x5797ba=0xce;}_0x442dc1['status'](_0x5797ba);return _0x442dc1['set'](_0x9adf('0x23'),_0x327b79+'-'+_0x4ca467+'/'+_0x31d7b1)['json'](_0x50a85e);}return null;};}function patchUpdates(_0x4c203a){return function(_0x195fd9){try{jsonpatch[_0x9adf('0x24')](_0x195fd9,_0x4c203a,!![]);}catch(_0x3dc800){return BPromise[_0x9adf('0x25')](_0x3dc800);}return _0x195fd9[_0x9adf('0x26')]();};}function saveUpdates(_0x3b77b0,_0x5f5cb7){return function(_0x59ca89){if(_0x59ca89){return _0x59ca89[_0x9adf('0x27')](_0x3b77b0)['then'](function(_0x2e8eb0){return _0x2e8eb0;});}return null;};}function removeEntity(_0xe46ec8,_0x2b6b7a){return function(_0x5d1113){if(_0x5d1113){return _0x5d1113['destroy']()[_0x9adf('0x28')](function(){var _0x3db4af=_0x5d1113[_0x9adf('0x29')]({'plain':!![]});var _0x1f269c=_0x9adf('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x1f269c,'resourceId':_0x3db4af['id']}})[_0x9adf('0x28')](function(){return _0x5d1113;});})['then'](function(){_0xe46ec8[_0x9adf('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x295955,_0x7b3c6a){return function(_0x1eb460){if(!_0x1eb460){_0x295955[_0x9adf('0x1b')](0x194);}return _0x1eb460;};}function handleError(_0x285501,_0x3a8e3a){_0x3a8e3a=_0x3a8e3a||0x1f4;return function(_0x2ebd92){logger[_0x9adf('0x2b')](_0x2ebd92[_0x9adf('0x2c')]);if(_0x2ebd92[_0x9adf('0x2d')]){delete _0x2ebd92[_0x9adf('0x2d')];}_0x285501[_0x9adf('0x1d')](_0x3a8e3a)[_0x9adf('0x2e')](_0x2ebd92);};}exports[_0x9adf('0x2f')]=function(_0x5e9d83,_0x27a761){var _0x179e5c={},_0x341481={},_0x3a03d1={'count':0x0,'rows':[]};var _0x5d715b=_[_0x9adf('0x30')](db[_0x9adf('0x31')]['rawAttributes'],function(_0x55f300){return{'name':_0x55f300[_0x9adf('0x32')],'type':_0x55f300[_0x9adf('0x33')][_0x9adf('0x34')]};});_0x341481['model']=_[_0x9adf('0x30')](_0x5d715b,_0x9adf('0x2d'));_0x341481['query']=_[_0x9adf('0x35')](_0x5e9d83[_0x9adf('0x36')]);_0x341481[_0x9adf('0x37')]=_[_0x9adf('0x38')](_0x341481[_0x9adf('0x39')],_0x341481[_0x9adf('0x36')]);_0x179e5c[_0x9adf('0x3a')]=_[_0x9adf('0x38')](_0x341481['model'],qs[_0x9adf('0x3b')](_0x5e9d83[_0x9adf('0x36')][_0x9adf('0x3b')]));_0x179e5c[_0x9adf('0x3a')]=_0x179e5c['attributes']['length']?_0x179e5c['attributes']:_0x341481[_0x9adf('0x39')];if(!_0x5e9d83[_0x9adf('0x36')][_0x9adf('0x3c')](_0x9adf('0x3d'))){_0x179e5c['limit']=qs[_0x9adf('0x21')](_0x5e9d83[_0x9adf('0x36')]['limit']);_0x179e5c[_0x9adf('0x1f')]=qs[_0x9adf('0x1f')](_0x5e9d83[_0x9adf('0x36')][_0x9adf('0x1f')]);}_0x179e5c[_0x9adf('0x3e')]=qs[_0x9adf('0x3f')](_0x5e9d83[_0x9adf('0x36')]['sort']);_0x179e5c[_0x9adf('0x40')]=qs[_0x9adf('0x37')](_['pick'](_0x5e9d83[_0x9adf('0x36')],_0x341481['filters']),_0x5d715b);if(_0x5e9d83[_0x9adf('0x36')][_0x9adf('0x41')]){_0x179e5c['where']=_[_0x9adf('0x42')](_0x179e5c[_0x9adf('0x40')],{'$or':_[_0x9adf('0x30')](_0x5d715b,function(_0x253e19){if(_0x253e19[_0x9adf('0x33')]!==_0x9adf('0x43')){var _0x257e81={};_0x257e81[_0x253e19[_0x9adf('0x2d')]]={'$like':'%'+_0x5e9d83[_0x9adf('0x36')][_0x9adf('0x41')]+'%'};return _0x257e81;}})});}_0x179e5c=_[_0x9adf('0x42')]({},_0x179e5c,_0x5e9d83[_0x9adf('0x44')]);var _0x360ed3={'where':_0x179e5c[_0x9adf('0x40')]};return db[_0x9adf('0x31')][_0x9adf('0x22')](_0x360ed3)[_0x9adf('0x28')](function(_0x221aad){_0x3a03d1[_0x9adf('0x22')]=_0x221aad;if(_0x5e9d83[_0x9adf('0x36')][_0x9adf('0x45')]){_0x179e5c[_0x9adf('0x46')]=[{'all':!![]}];}return db[_0x9adf('0x31')][_0x9adf('0x47')](_0x179e5c);})[_0x9adf('0x28')](function(_0x1b89eb){_0x3a03d1[_0x9adf('0x48')]=_0x1b89eb;return _0x3a03d1;})[_0x9adf('0x28')](respondWithFilteredResult(_0x27a761,_0x179e5c))[_0x9adf('0x49')](handleError(_0x27a761,null));};exports[_0x9adf('0x4a')]=function(_0x387c44,_0x24ef75){var _0x3c0bb2={'raw':![],'where':{'id':_0x387c44[_0x9adf('0x4b')]['id']}},_0x3eed5d={};_0x3eed5d[_0x9adf('0x39')]=_[_0x9adf('0x35')](db[_0x9adf('0x31')][_0x9adf('0x4c')]);_0x3eed5d[_0x9adf('0x36')]=_[_0x9adf('0x35')](_0x387c44[_0x9adf('0x36')]);_0x3eed5d['filters']=_[_0x9adf('0x38')](_0x3eed5d[_0x9adf('0x39')],_0x3eed5d[_0x9adf('0x36')]);_0x3c0bb2['attributes']=_[_0x9adf('0x38')](_0x3eed5d[_0x9adf('0x39')],qs[_0x9adf('0x3b')](_0x387c44[_0x9adf('0x36')][_0x9adf('0x3b')]));_0x3c0bb2['attributes']=_0x3c0bb2[_0x9adf('0x3a')][_0x9adf('0x4d')]?_0x3c0bb2[_0x9adf('0x3a')]:_0x3eed5d[_0x9adf('0x39')];if(_0x387c44[_0x9adf('0x36')][_0x9adf('0x45')]){_0x3c0bb2['include']=[{'all':!![]}];}_0x3c0bb2=_[_0x9adf('0x42')]({},_0x3c0bb2,_0x387c44[_0x9adf('0x44')]);return db[_0x9adf('0x31')][_0x9adf('0x4e')](_0x3c0bb2)[_0x9adf('0x28')](handleEntityNotFound(_0x24ef75,null))[_0x9adf('0x28')](respondWithResult(_0x24ef75,null))['catch'](handleError(_0x24ef75,null));};exports[_0x9adf('0x4f')]=function(_0x1b43d3,_0x84ea9){return db['AnalyticCustomReport'][_0x9adf('0x4f')](_0x1b43d3['body'],{})[_0x9adf('0x28')](function(_0x1a141c){var _0x2dec69=_0x1b43d3['user'][_0x9adf('0x29')]({'plain':!![]});if(!_0x2dec69)throw new Error(_0x9adf('0x50'));if(_0x2dec69['role']===_0x9adf('0x51')){var _0x6167f3=_0x1a141c[_0x9adf('0x29')]({'plain':!![]});var _0x21b456='Reports';return db['UserProfileSection'][_0x9adf('0x4e')]({'where':{'name':_0x21b456,'userProfileId':_0x2dec69[_0x9adf('0x52')]},'raw':!![]})['then'](function(_0x267fc0){if(_0x267fc0&&_0x267fc0['autoAssociation']===0x0){return db[_0x9adf('0x53')][_0x9adf('0x4f')]({'name':_0x6167f3[_0x9adf('0x2d')],'resourceId':_0x6167f3['id'],'type':'CustomReports','sectionId':_0x267fc0['id']},{})[_0x9adf('0x28')](function(){return _0x1a141c;});}else{return _0x1a141c;}})['catch'](function(_0x3f768e){logger[_0x9adf('0x2b')](_0x9adf('0x54'),_0x3f768e);throw _0x3f768e;});}return _0x1a141c;})[_0x9adf('0x28')](respondWithResult(_0x84ea9,0xc9))[_0x9adf('0x49')](handleError(_0x84ea9,null));};exports['update']=function(_0xa777f,_0x2f0938){if(_0xa777f[_0x9adf('0x55')]['id']){delete _0xa777f['body']['id'];}return db['AnalyticCustomReport'][_0x9adf('0x4e')]({'where':{'id':_0xa777f[_0x9adf('0x4b')]['id']}})[_0x9adf('0x28')](handleEntityNotFound(_0x2f0938,null))[_0x9adf('0x28')](saveUpdates(_0xa777f[_0x9adf('0x55')],null))[_0x9adf('0x28')](respondWithResult(_0x2f0938,null))[_0x9adf('0x49')](handleError(_0x2f0938,null));};exports[_0x9adf('0x56')]=function(_0x173474,_0x271a91){return db[_0x9adf('0x31')]['find']({'where':{'id':_0x173474[_0x9adf('0x4b')]['id']}})['then'](handleEntityNotFound(_0x271a91,null))[_0x9adf('0x28')](removeEntity(_0x271a91,null))[_0x9adf('0x49')](handleError(_0x271a91,null));};exports[_0x9adf('0x57')]=function(_0x45f279,_0x35ae7f){var _0x3d9547=0xa;var _0x2cedbb=[_0x9adf('0x58'),_0x9adf('0x59'),'right_join',_0x9adf('0x5a')];var _0x32fa81={'SUM':_0x9adf('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x9adf('0x5c'),'MAX':_0x9adf('0x5d'),'MIN':_0x9adf('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9adf('0x5f'),'GROUP_CONCAT ASC':_0x9adf('0x60'),'GROUP_CONCAT DESC':_0x9adf('0x61')};var _0x446363={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9adf('0x62'),'HOUR':_0x9adf('0x63'),'ROUND':_0x9adf('0x64'),'UNIX_TIMESTAMP':_0x9adf('0x65')};var _0x4b5da8=function(_0x2b2065){return!_['includes']([_0x9adf('0x66'),_0x9adf('0x67'),_0x9adf('0x68'),_0x9adf('0x69')],_0x2b2065);};var _0x363aa2=function(_0x23c7e0){if(!_0x23c7e0||!_0x23c7e0[_0x9adf('0x6a')][_0x9adf('0x4d')]){return'';}for(var _0x1e7e1e='(',_0x2de2e9=0x0;_0x2de2e9<_0x23c7e0[_0x9adf('0x6a')][_0x9adf('0x4d')];_0x2de2e9+=0x1){_0x2de2e9>0x0&&(_0x1e7e1e+='\x20'+_0x23c7e0[_0x9adf('0x6b')]+'\x20');_0x1e7e1e+=_0x23c7e0['rules'][_0x2de2e9][_0x9adf('0x6c')]?_0x363aa2(_0x23c7e0['rules'][_0x2de2e9]['group']):_0x23c7e0[_0x9adf('0x6a')][_0x2de2e9]['field']+'\x20'+_0x23c7e0[_0x9adf('0x6a')][_0x2de2e9][_0x9adf('0x6d')]+(_0x4b5da8(_0x23c7e0['rules'][_0x2de2e9][_0x9adf('0x6d')])?'\x20'+_0x23c7e0['rules'][_0x2de2e9]['value']:'');}return _0x1e7e1e+')';};var _0x22f940={'where':{'id':_0x45f279[_0x9adf('0x4b')]['id']}},_0x58c4a8,_0x3bf5d4,_0x345606,_0x2b787b,_0x4444d9;_0x22f940=_[_0x9adf('0x42')]({},_0x22f940,_0x45f279[_0x9adf('0x44')]);return db['AnalyticCustomReport'][_0x9adf('0x4e')](_0x22f940)[_0x9adf('0x28')](function(_0x2c1236){if(_0x2c1236){_0x58c4a8=_0x2c1236;return _0x2c1236[_0x9adf('0x6e')]();}return null;})[_0x9adf('0x28')](function(_0x585ad4){if(_0x585ad4){if(!_0x585ad4[_0x9adf('0x4d')]){throw new db[(_0x9adf('0x6f'))][(_0x9adf('0x70'))](_0x9adf('0x71'),0x193);}_0x3bf5d4=_0x585ad4;return db[_0x9adf('0x72')][_0x9adf('0x47')]({'raw':!![]});}return null;})[_0x9adf('0x28')](function(_0x231d77){if(_0x231d77){_0x345606=_[_0x9adf('0x73')](_0x231d77,'id');var _0x9ae5ee;var _0x331227=squel['select']();_0x331227[_0x9adf('0x74')](_0x58c4a8['table']);for(var _0x56d8e5=0x0;_0x56d8e5<_0x3bf5d4[_0x9adf('0x4d')];_0x56d8e5+=0x1){_0x9ae5ee=_0x3bf5d4[_0x56d8e5][_0x9adf('0x75')]?_0x345606[_0x3bf5d4[_0x56d8e5][_0x9adf('0x75')]][_0x9adf('0x76')]:_0x3bf5d4[_0x56d8e5][_0x9adf('0x77')];_0x9ae5ee=_0x3bf5d4[_0x56d8e5][_0x9adf('0x78')]?_[_0x9adf('0x79')](_0x32fa81[_0x3bf5d4[_0x56d8e5]['function']],'%s',_0x9ae5ee):_0x9ae5ee;_0x9ae5ee=_0x3bf5d4[_0x56d8e5][_0x9adf('0x7a')]?_[_0x9adf('0x79')](_0x446363[_0x3bf5d4[_0x56d8e5][_0x9adf('0x7a')]],'%s',_0x9ae5ee):_0x9ae5ee;if(_0x3bf5d4[_0x56d8e5][_0x9adf('0x7b')]){_0x331227['group'](_0x9ae5ee);}_0x3bf5d4[_0x56d8e5][_0x9adf('0x7c')]&&_0x331227[_0x9adf('0x3e')](_0x9ae5ee,_0x3bf5d4[_0x56d8e5][_0x9adf('0x7c')]==='DESC'?![]:!![]);_0x331227[_0x9adf('0x77')](_0x9ae5ee,_0x3bf5d4[_0x56d8e5]['alias']||_0x9ae5ee);}if(_0x58c4a8['joins']){_0x58c4a8['joins']=JSON[_0x9adf('0x7d')](_0x58c4a8[_0x9adf('0x7e')]);for(var _0x448556=0x0;_0x448556<_0x58c4a8[_0x9adf('0x7e')][_0x9adf('0x4d')];_0x448556+=0x1){if(_0x58c4a8['joins'][_0x448556][_0x9adf('0x33')]&&_[_0x9adf('0x7f')](_0x2cedbb,_0x58c4a8['joins'][_0x448556]['type'])&&_0x58c4a8[_0x9adf('0x7e')][_0x448556][_0x9adf('0x80')]&&_0x58c4a8[_0x9adf('0x7e')][_0x448556]['foreignTable']&&_0x58c4a8[_0x9adf('0x7e')][_0x448556][_0x9adf('0x81')]){_0x331227[_0x58c4a8[_0x9adf('0x7e')][_0x448556][_0x9adf('0x33')]](_0x58c4a8[_0x9adf('0x7e')][_0x448556][_0x9adf('0x82')],null,util[_0x9adf('0x7a')](_0x9adf('0x83'),_0x58c4a8[_0x9adf('0x84')],_0x58c4a8['joins'][_0x448556][_0x9adf('0x80')],_0x58c4a8['joins'][_0x448556][_0x9adf('0x82')],_0x58c4a8[_0x9adf('0x7e')][_0x448556][_0x9adf('0x81')]));}}}if(_0x58c4a8[_0x9adf('0x85')]){_0x58c4a8['conditions']=JSON[_0x9adf('0x7d')](_0x58c4a8[_0x9adf('0x85')]);_0x331227['where'](_0x363aa2(_0x58c4a8[_0x9adf('0x85')]['group']));}_0x4444d9=_0x331227[_0x9adf('0x86')]();_0x331227[_0x9adf('0x21')](_0x3d9547);_0x331227[_0x9adf('0x1f')](0x0);logger['debug']('Limited\x20Query:',_0x331227[_0x9adf('0x87')]());return dbH[_0x9adf('0x88')][_0x9adf('0x36')](_0x331227[_0x9adf('0x87')](),{'type':dbH[_0x9adf('0x88')][_0x9adf('0x89')][_0x9adf('0x8a')]});}})[_0x9adf('0x28')](respondWithResult(_0x35ae7f,null))['catch'](handleError(_0x35ae7f,null));};function runReport(_0x2a35f4,_0x2690f6,_0x279efc){var _0x180fc1=_0x2690f6[_0x9adf('0x2d')];var _0x503ac3=0xa;var _0x3b9bcc=['join',_0x9adf('0x59'),'right_join',_0x9adf('0x5a')];var _0xb58c4c={'SUM':_0x9adf('0x5b'),'COUNT':_0x9adf('0x8b'),'COUNT DISTINCT':_0x9adf('0x5c'),'MAX':_0x9adf('0x5d'),'MIN':'MIN(%s)','AVG':_0x9adf('0x8c'),'GROUP_CONCAT':_0x9adf('0x5f'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9adf('0x61')};var _0x46b3fb={'SEC_TO_TIME':_0x9adf('0x8d'),'DATE':_0x9adf('0x62'),'HOUR':_0x9adf('0x63'),'ROUND':_0x9adf('0x64'),'UNIX_TIMESTAMP':_0x9adf('0x65')};var _0x4e5ee4=function(_0x9fcadc){return!_[_0x9adf('0x7f')]([_0x9adf('0x66'),_0x9adf('0x67'),_0x9adf('0x68'),'IS\x20NOT\x20EMPTY'],_0x9fcadc);};var _0x112459=function(_0x3596e8){if(!_0x3596e8||!_0x3596e8[_0x9adf('0x6a')][_0x9adf('0x4d')]){return'';}for(var _0x31a222='(',_0x85109f=0x0;_0x85109f<_0x3596e8['rules'][_0x9adf('0x4d')];_0x85109f+=0x1){_0x85109f>0x0&&(_0x31a222+='\x20'+_0x3596e8[_0x9adf('0x6b')]+'\x20');_0x31a222+=_0x3596e8[_0x9adf('0x6a')][_0x85109f]['group']?_0x112459(_0x3596e8[_0x9adf('0x6a')][_0x85109f][_0x9adf('0x6c')]):_0x3596e8[_0x9adf('0x6a')][_0x85109f][_0x9adf('0x77')]+'\x20'+_0x3596e8[_0x9adf('0x6a')][_0x85109f][_0x9adf('0x6d')]+(_0x4e5ee4(_0x3596e8[_0x9adf('0x6a')][_0x85109f][_0x9adf('0x6d')])?'\x20'+_0x3596e8[_0x9adf('0x6a')][_0x85109f][_0x9adf('0x8e')]:'');}return _0x31a222+')';};var _0x1e2a51={'where':{'id':_0x2a35f4['id']}},_0x42c0f7,_0x1df937,_0x4fb0b2,_0x3f9a0b,_0x1305fa;_0x1e2a51=_[_0x9adf('0x42')]({},_0x1e2a51,_0x279efc);return db[_0x9adf('0x31')][_0x9adf('0x4e')](_0x1e2a51)[_0x9adf('0x28')](function(_0x29b6e7){if(_0x29b6e7){_0x42c0f7=_0x29b6e7;return _0x29b6e7[_0x9adf('0x6e')]();}return null;})[_0x9adf('0x28')](function(_0x10bd6e){if(_0x10bd6e){if(!_0x10bd6e[_0x9adf('0x4d')]){throw new db[(_0x9adf('0x6f'))][(_0x9adf('0x70'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1df937=_0x10bd6e;return db[_0x9adf('0x72')]['findAll']({'raw':!![]});}return null;})[_0x9adf('0x28')](function(_0x29c1b3){if(_0x29c1b3){_0x4fb0b2=_[_0x9adf('0x73')](_0x29c1b3,'id');var _0x39e61c;var _0x3853a8=squel[_0x9adf('0x8f')]();_0x3853a8[_0x9adf('0x74')](_0x42c0f7['table']);for(var _0x36548f=0x0;_0x36548f<_0x1df937['length'];_0x36548f+=0x1){_0x39e61c=_0x1df937[_0x36548f][_0x9adf('0x75')]?_0x4fb0b2[_0x1df937[_0x36548f][_0x9adf('0x75')]][_0x9adf('0x76')]:_0x1df937[_0x36548f]['field'];_0x39e61c=_0x1df937[_0x36548f]['function']?_[_0x9adf('0x79')](_0xb58c4c[_0x1df937[_0x36548f][_0x9adf('0x78')]],'%s',_0x39e61c):_0x39e61c;_0x39e61c=_0x1df937[_0x36548f][_0x9adf('0x7a')]?_[_0x9adf('0x79')](_0x46b3fb[_0x1df937[_0x36548f][_0x9adf('0x7a')]],'%s',_0x39e61c):_0x39e61c;if(_0x1df937[_0x36548f]['groupBy']){_0x3853a8[_0x9adf('0x6c')](_0x39e61c);}_0x1df937[_0x36548f][_0x9adf('0x7c')]&&_0x3853a8[_0x9adf('0x3e')](_0x39e61c,_0x1df937[_0x36548f]['orderBy']===_0x9adf('0x90')?![]:!![]);_0x3853a8['field'](_0x39e61c,_0x1df937[_0x36548f][_0x9adf('0x91')]||_0x39e61c);}if(_0x42c0f7[_0x9adf('0x7e')]){_0x42c0f7[_0x9adf('0x7e')]=JSON[_0x9adf('0x7d')](_0x42c0f7[_0x9adf('0x7e')]);for(var _0xae1167=0x0;_0xae1167<_0x42c0f7[_0x9adf('0x7e')][_0x9adf('0x4d')];_0xae1167+=0x1){if(_0x42c0f7['joins'][_0xae1167][_0x9adf('0x33')]&&_[_0x9adf('0x7f')](_0x3b9bcc,_0x42c0f7[_0x9adf('0x7e')][_0xae1167][_0x9adf('0x33')])&&_0x42c0f7['joins'][_0xae1167][_0x9adf('0x80')]&&_0x42c0f7[_0x9adf('0x7e')][_0xae1167][_0x9adf('0x82')]&&_0x42c0f7['joins'][_0xae1167]['foreignKey']){_0x3853a8[_0x42c0f7[_0x9adf('0x7e')][_0xae1167][_0x9adf('0x33')]](_0x42c0f7[_0x9adf('0x7e')][_0xae1167][_0x9adf('0x82')],null,util[_0x9adf('0x7a')]('%s.%s\x20=\x20%s.%s',_0x42c0f7[_0x9adf('0x84')],_0x42c0f7[_0x9adf('0x7e')][_0xae1167]['parentKey'],_0x42c0f7[_0x9adf('0x7e')][_0xae1167]['foreignTable'],_0x42c0f7['joins'][_0xae1167][_0x9adf('0x81')]));}}}if(_0x42c0f7['conditions']){_0x42c0f7[_0x9adf('0x85')]=JSON['parse'](_0x42c0f7['conditions']);_0x3853a8[_0x9adf('0x40')](_0x112459(_0x42c0f7['conditions'][_0x9adf('0x6c')]));}_0x1305fa=_0x3853a8[_0x9adf('0x86')]();_0x3853a8[_0x9adf('0x21')](_0x503ac3);_0x3853a8[_0x9adf('0x1f')](0x0);return;}})[_0x9adf('0x28')](function(){if(_0x2690f6[_0x9adf('0x92')]===_0x9adf('0x93')){return null;}var _0x5ca22e=_[_0x9adf('0x42')](_0x2690f6,{'name':_0x2690f6[_0x9adf('0x94')]||_0x2690f6[_0x9adf('0x2d')]||_0x42c0f7[_0x9adf('0x2d')],'basename':_0x180fc1,'savename':util[_0x9adf('0x7a')](_0x9adf('0x95'),_0x2690f6[_0x9adf('0x2d')]||_0x42c0f7[_0x9adf('0x2d')],require(_0x9adf('0x96'))['generate'](0x4),_0x2690f6[_0x9adf('0x92')]||_0x9adf('0x97')),'reportId':_0x42c0f7['id'],'reportType':_0x9adf('0x98')});return db['AnalyticExtractedReport']['create'](_0x5ca22e,{'raw':!![]});})[_0x9adf('0x28')](function(_0x36de15){if(_0x42c0f7[_0x9adf('0x84')]===_0x9adf('0x99')){_0x1305fa[_0x9adf('0x40')](_0x42c0f7[_0x9adf('0x84')]+_0x9adf('0x9a'),_0x2690f6['startDate'],_0x2690f6[_0x9adf('0x9b')]);}else{_0x1305fa[_0x9adf('0x40')](_0x42c0f7[_0x9adf('0x84')]+_0x9adf('0x9c'),_0x2690f6[_0x9adf('0x9d')],_0x2690f6[_0x9adf('0x9b')]);}if(_0x36de15){logger[_0x9adf('0x9e')]('Run\x20Query:',_0x1305fa[_0x9adf('0x87')]());require(_0x9adf('0x9f'))[_0x9adf('0xa0')](path[_0x9adf('0x58')](__dirname,_0x9adf('0xa1'),_0x36de15[_0x9adf('0x92')]),[_0x36de15['id'],_0x1305fa[_0x9adf('0x87')](),path[_0x9adf('0x58')](__dirname,_0x9adf('0xa2'),_0x36de15['savename']),_0x180fc1]);return _0x36de15;}else{var _0x298b2b=squel['select']();_0x298b2b['from']('('+_0x1305fa[_0x9adf('0x87')]()+')',_0x9adf('0xa3'));_0x298b2b[_0x9adf('0x77')](_0x9adf('0xa4'),'count');_0x1305fa[_0x9adf('0x21')](_0x2690f6['limit']||_0x503ac3);_0x1305fa['offset'](_0x2690f6['offset']||0x0);return dbH['sequelize'][_0x9adf('0x36')](_0x298b2b[_0x9adf('0x87')](),{'type':dbH['sequelize'][_0x9adf('0x89')][_0x9adf('0x8a')]})[_0x9adf('0x28')](function(_0x4abfe6){if(!_0x4abfe6['length']){_0x3f9a0b=0x0;}else{_0x3f9a0b=_0x4abfe6[0x0][_0x9adf('0x22')]||0x0;}return dbH[_0x9adf('0x88')][_0x9adf('0x36')](_0x1305fa[_0x9adf('0x87')](),{'type':dbH[_0x9adf('0x88')][_0x9adf('0x89')][_0x9adf('0x8a')]});})[_0x9adf('0x28')](function(_0x215692){return{'rows':_0x215692||[],'count':_0x3f9a0b};});}});}exports[_0x9adf('0xa5')]=function(_0x2fb491,_0x599efb){return runReport(_0x2fb491[_0x9adf('0x4b')],_0x2fb491[_0x9adf('0x36')],_0x2fb491[_0x9adf('0x44')])[_0x9adf('0x28')](respondWithResult(_0x599efb,null))['catch'](handleError(_0x599efb,null));};exports[_0x9adf('0xa6')]=runReport;exports[_0x9adf('0x36')]=function(_0x516d8a,_0x403d62){var _0x59318c=0xa;var _0x2f85a4=[_0x9adf('0x58'),'left_join',_0x9adf('0xa7'),_0x9adf('0x5a')];var _0x565c79={'SUM':'SUM(%s)','COUNT':_0x9adf('0x8b'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9adf('0x5d'),'MIN':_0x9adf('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x9adf('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x164793={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x9adf('0x63'),'ROUND':_0x9adf('0x64'),'UNIX_TIMESTAMP':_0x9adf('0x65')};var _0xefe829=function(_0x114e07){return!_[_0x9adf('0x7f')]([_0x9adf('0x66'),_0x9adf('0x67'),_0x9adf('0x68'),_0x9adf('0x69')],_0x114e07);};var _0x109b47=function(_0x7a352f){if(!_0x7a352f||!_0x7a352f[_0x9adf('0x6a')][_0x9adf('0x4d')]){return'';}for(var _0x41bc42='(',_0x117bb0=0x0;_0x117bb0<_0x7a352f[_0x9adf('0x6a')][_0x9adf('0x4d')];_0x117bb0+=0x1){_0x117bb0>0x0&&(_0x41bc42+='\x20'+_0x7a352f[_0x9adf('0x6b')]+'\x20');_0x41bc42+=_0x7a352f[_0x9adf('0x6a')][_0x117bb0]['group']?_0x109b47(_0x7a352f[_0x9adf('0x6a')][_0x117bb0]['group']):_0x7a352f[_0x9adf('0x6a')][_0x117bb0][_0x9adf('0x77')]+'\x20'+_0x7a352f['rules'][_0x117bb0]['condition']+(_0xefe829(_0x7a352f['rules'][_0x117bb0][_0x9adf('0x6d')])?'\x20'+_0x7a352f[_0x9adf('0x6a')][_0x117bb0][_0x9adf('0x8e')]:'');}return _0x41bc42+')';};var _0x53ddbf={'where':{'id':_0x516d8a[_0x9adf('0x4b')]['id']}},_0x4a2e93,_0x5c41f4,_0x5436a7,_0x26be82,_0x57bda8;_0x53ddbf=_[_0x9adf('0x42')]({},_0x53ddbf,_0x516d8a[_0x9adf('0x44')]);return db['AnalyticCustomReport'][_0x9adf('0x4e')](_0x53ddbf)[_0x9adf('0x28')](function(_0xa770c){if(_0xa770c){_0x4a2e93=_0xa770c;return _0xa770c[_0x9adf('0x6e')]();}return null;})['then'](function(_0x1ca25c){if(_0x1ca25c){if(!_0x1ca25c[_0x9adf('0x4d')]){throw new db[(_0x9adf('0x6f'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5c41f4=_0x1ca25c;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})['then'](function(_0x5ea4f7){if(_0x5ea4f7){_0x5436a7=_[_0x9adf('0x73')](_0x5ea4f7,'id');var _0x34cf14;var _0x1e6833=squel['select']();_0x1e6833[_0x9adf('0x74')](_0x4a2e93['table']);for(var _0x4b5fcc=0x0;_0x4b5fcc<_0x5c41f4[_0x9adf('0x4d')];_0x4b5fcc+=0x1){_0x34cf14=_0x5c41f4[_0x4b5fcc][_0x9adf('0x75')]?_0x5436a7[_0x5c41f4[_0x4b5fcc][_0x9adf('0x75')]]['metric']:_0x5c41f4[_0x4b5fcc][_0x9adf('0x77')];_0x34cf14=_0x5c41f4[_0x4b5fcc][_0x9adf('0x78')]?_['replace'](_0x565c79[_0x5c41f4[_0x4b5fcc][_0x9adf('0x78')]],'%s',_0x34cf14):_0x34cf14;_0x34cf14=_0x5c41f4[_0x4b5fcc]['format']?_[_0x9adf('0x79')](_0x164793[_0x5c41f4[_0x4b5fcc][_0x9adf('0x7a')]],'%s',_0x34cf14):_0x34cf14;if(_0x5c41f4[_0x4b5fcc][_0x9adf('0x7b')]){_0x1e6833[_0x9adf('0x6c')](_0x34cf14);}_0x5c41f4[_0x4b5fcc]['orderBy']&&_0x1e6833[_0x9adf('0x3e')](_0x34cf14,_0x5c41f4[_0x4b5fcc][_0x9adf('0x7c')]===_0x9adf('0x90')?![]:!![]);_0x1e6833[_0x9adf('0x77')](_0x34cf14,_0x5c41f4[_0x4b5fcc]['alias']||_0x34cf14);}if(_0x4a2e93[_0x9adf('0x7e')]){_0x4a2e93[_0x9adf('0x7e')]=JSON['parse'](_0x4a2e93[_0x9adf('0x7e')]);for(var _0x64f756=0x0;_0x64f756<_0x4a2e93[_0x9adf('0x7e')][_0x9adf('0x4d')];_0x64f756+=0x1){if(_0x4a2e93[_0x9adf('0x7e')][_0x64f756][_0x9adf('0x33')]&&_[_0x9adf('0x7f')](_0x2f85a4,_0x4a2e93[_0x9adf('0x7e')][_0x64f756]['type'])&&_0x4a2e93[_0x9adf('0x7e')][_0x64f756]['parentKey']&&_0x4a2e93[_0x9adf('0x7e')][_0x64f756][_0x9adf('0x82')]&&_0x4a2e93[_0x9adf('0x7e')][_0x64f756][_0x9adf('0x81')]){_0x1e6833[_0x4a2e93[_0x9adf('0x7e')][_0x64f756][_0x9adf('0x33')]](_0x4a2e93[_0x9adf('0x7e')][_0x64f756][_0x9adf('0x82')],null,util[_0x9adf('0x7a')]('%s.%s\x20=\x20%s.%s',_0x4a2e93['table'],_0x4a2e93[_0x9adf('0x7e')][_0x64f756][_0x9adf('0x80')],_0x4a2e93[_0x9adf('0x7e')][_0x64f756][_0x9adf('0x82')],_0x4a2e93[_0x9adf('0x7e')][_0x64f756][_0x9adf('0x81')]));}}}if(_0x4a2e93['conditions']){_0x4a2e93['conditions']=JSON[_0x9adf('0x7d')](_0x4a2e93['conditions']);_0x1e6833[_0x9adf('0x40')](_0x109b47(_0x4a2e93[_0x9adf('0x85')]['group']));}_0x57bda8=_0x1e6833['clone']();_0x1e6833[_0x9adf('0x21')](_0x59318c);_0x1e6833[_0x9adf('0x1f')](0x0);logger['debug'](_0x9adf('0xa8'),_0x1e6833[_0x9adf('0x87')]());return dbH['sequelize']['query'](_0x1e6833[_0x9adf('0x87')](),{'type':dbH[_0x9adf('0x88')]['QueryTypes'][_0x9adf('0x8a')]});}})[_0x9adf('0x28')](function(){return{'sql':_0x57bda8[_0x9adf('0x87')]()};})[_0x9adf('0x28')](respondWithResult(_0x403d62,null))[_0x9adf('0x49')](handleError(_0x403d62,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 44db0bf..09b572e 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 _0x0abf=['rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xc40b9f,_0x17ec1f){var _0x535b9c=function(_0x591b19){while(--_0x591b19){_0xc40b9f['push'](_0xc40b9f['shift']());}};_0x535b9c(++_0x17ec1f);}(_0x0abf,0x149));var _0xf0ab=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x0abf[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xf0ab('0x0'));var util=require('util');var logger=require(_0xf0ab('0x1'))(_0xf0ab('0x2'));var moment=require(_0xf0ab('0x3'));var BPromise=require(_0xf0ab('0x4'));var rp=require(_0xf0ab('0x5'));var fs=require('fs');var path=require(_0xf0ab('0x6'));var rimraf=require(_0xf0ab('0x7'));var config=require(_0xf0ab('0x8'));var attributes=require(_0xf0ab('0x9'));module[_0xf0ab('0xa')]=function(_0x121dcf,_0x1c021f){return _0x121dcf[_0xf0ab('0xb')]('AnalyticCustomReport',attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e99=['request-promise','path','rimraf','./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash','api','moment','bluebird'];(function(_0xf0b977,_0xe512bd){var _0x32199c=function(_0xe0eb43){while(--_0xe0eb43){_0xf0b977['push'](_0xf0b977['shift']());}};_0x32199c(++_0xe512bd);}(_0x8e99,0x130));var _0x98e9=function(_0x1dede4,_0x3eefa1){_0x1dede4=_0x1dede4-0x0;var _0x34c28f=_0x8e99[_0x1dede4];return _0x34c28f;};'use strict';var _=require(_0x98e9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x98e9('0x1'));var moment=require(_0x98e9('0x2'));var BPromise=require(_0x98e9('0x3'));var rp=require(_0x98e9('0x4'));var fs=require('fs');var path=require(_0x98e9('0x5'));var rimraf=require(_0x98e9('0x6'));var config=require('../../config/environment');var attributes=require(_0x98e9('0x7'));module[_0x98e9('0x8')]=function(_0x4dd17f,_0x49e484){return _0x4dd17f[_0x98e9('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0x98e9('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 75b747d..0439157 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 _0x4c9c=['../../config/utils','../../config/logger','rpc','../../config/environment','client','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x55af0d,_0x5db5c9){var _0x245085=function(_0x39d897){while(--_0x39d897){_0x55af0d['push'](_0x55af0d['shift']());}};_0x245085(++_0x5db5c9);}(_0x4c9c,0x18a));var _0xc4c9=function(_0x291ec3,_0x2f19a7){_0x291ec3=_0x291ec3-0x0;var _0x423b99=_0x4c9c[_0x291ec3];return _0x423b99;};'use strict';var _=require(_0xc4c9('0x0'));var util=require(_0xc4c9('0x1'));var moment=require(_0xc4c9('0x2'));var BPromise=require(_0xc4c9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc4c9('0x4'));var db=require(_0xc4c9('0x5'))['db'];var utils=require(_0xc4c9('0x6'));var logger=require(_0xc4c9('0x7'))(_0xc4c9('0x8'));var config=require(_0xc4c9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc4c9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14b9f7,_0x52e269,_0x165f25){return new BPromise(function(_0x5c54d8,_0x4cf170){return client['request'](_0x14b9f7,_0x165f25)['then'](function(_0x4facae){logger['info'](_0xc4c9('0xb'),_0x52e269,_0xc4c9('0xc'));logger[_0xc4c9('0xd')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x52e269,_0xc4c9('0xc'),JSON[_0xc4c9('0xe')](_0x4facae));if(_0x4facae[_0xc4c9('0xf')]){if(_0x4facae[_0xc4c9('0xf')][_0xc4c9('0x10')]===0x1f4){logger[_0xc4c9('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x52e269,_0x4facae[_0xc4c9('0xf')][_0xc4c9('0x11')]);return _0x4cf170(_0x4facae[_0xc4c9('0xf')][_0xc4c9('0x11')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x52e269,_0x4facae[_0xc4c9('0xf')][_0xc4c9('0x11')]);return _0x5c54d8(_0x4facae[_0xc4c9('0xf')][_0xc4c9('0x11')]);}else{logger[_0xc4c9('0x12')](_0xc4c9('0xb'),_0x52e269,_0xc4c9('0xc'));_0x5c54d8(_0x4facae[_0xc4c9('0x13')][_0xc4c9('0x11')]);}})['catch'](function(_0x392f4a){logger[_0xc4c9('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x52e269,_0x392f4a);_0x4cf170(_0x392f4a);});});} \ No newline at end of file +var _0x7955=['http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0x5f1ec2,_0x2277f2){var _0x21d939=function(_0x467086){while(--_0x467086){_0x5f1ec2['push'](_0x5f1ec2['shift']());}};_0x21d939(++_0x2277f2);}(_0x7955,0xdd));var _0x5795=function(_0x3cd7a7,_0x2e5189){_0x3cd7a7=_0x3cd7a7-0x0;var _0x4446f0=_0x7955[_0x3cd7a7];return _0x4446f0;};'use strict';var _=require(_0x5795('0x0'));var util=require(_0x5795('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5795('0x2'));var db=require(_0x5795('0x3'))['db'];var utils=require(_0x5795('0x4'));var logger=require('../../config/logger')(_0x5795('0x5'));var config=require('../../config/environment');var jayson=require(_0x5795('0x6'));var client=jayson['client'][_0x5795('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4f5a4b,_0x44a4dc,_0x230e47){return new BPromise(function(_0x4a7ada,_0x50af95){return client[_0x5795('0x8')](_0x4f5a4b,_0x230e47)[_0x5795('0x9')](function(_0x648aa6){logger[_0x5795('0xa')](_0x5795('0xb'),_0x44a4dc,_0x5795('0xc'));logger['debug'](_0x5795('0xd'),_0x44a4dc,_0x5795('0xc'),JSON[_0x5795('0xe')](_0x648aa6));if(_0x648aa6[_0x5795('0xf')]){if(_0x648aa6[_0x5795('0xf')][_0x5795('0x10')]===0x1f4){logger[_0x5795('0xf')](_0x5795('0xb'),_0x44a4dc,_0x648aa6[_0x5795('0xf')]['message']);return _0x50af95(_0x648aa6[_0x5795('0xf')][_0x5795('0x11')]);}logger[_0x5795('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x44a4dc,_0x648aa6['error'][_0x5795('0x11')]);return _0x4a7ada(_0x648aa6[_0x5795('0xf')]['message']);}else{logger[_0x5795('0xa')](_0x5795('0xb'),_0x44a4dc,_0x5795('0xc'));_0x4a7ada(_0x648aa6[_0x5795('0x12')]['message']);}})['catch'](function(_0xabbdaf){logger[_0x5795('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x44a4dc,_0xabbdaf);_0x50af95(_0xabbdaf);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 1261ad7..84b7d70 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 _0x7416=['../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','/:id/preview','/:id/query','query','create','put','update','delete','exports','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2d0cdd,_0x5b25b4){var _0x30ba3a=function(_0x150a0d){while(--_0x150a0d){_0x2d0cdd['push'](_0x2d0cdd['shift']());}};_0x30ba3a(++_0x5b25b4);}(_0x7416,0xa6));var _0x6741=function(_0x872b02,_0x4f4458){_0x872b02=_0x872b02-0x0;var _0x1a6b24=_0x7416[_0x872b02];return _0x1a6b24;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6741('0x0'));var timeout=require('connect-timeout');var express=require(_0x6741('0x1'));var router=express[_0x6741('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6741('0x3'));var interaction=require(_0x6741('0x4'));var config=require(_0x6741('0x5'));var controller=require(_0x6741('0x6'));router[_0x6741('0x7')]('/',auth[_0x6741('0x8')](),controller[_0x6741('0x9')]);router[_0x6741('0x7')](_0x6741('0xa'),auth[_0x6741('0x8')](),controller['show']);router['get'](_0x6741('0xb'),auth[_0x6741('0x8')](),controller['preview']);router[_0x6741('0x7')]('/:id/run',auth['isAuthenticated'](),controller['run']);router[_0x6741('0x7')](_0x6741('0xc'),auth[_0x6741('0x8')](),controller[_0x6741('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6741('0xe')]);router[_0x6741('0xf')](_0x6741('0xa'),auth[_0x6741('0x8')](),controller[_0x6741('0x10')]);router[_0x6741('0x11')](_0x6741('0xa'),auth[_0x6741('0x8')](),controller['destroy']);module[_0x6741('0x12')]=router; \ No newline at end of file +var _0xba23=['connect-timeout','Router','../../config/environment','get','isAuthenticated','index','/:id/preview','/:id/run','run','/:id/query','query','create','put','/:id','multer','util','path'];(function(_0x231bb5,_0xeb54e0){var _0x3f6e40=function(_0x14b39e){while(--_0x14b39e){_0x231bb5['push'](_0x231bb5['shift']());}};_0x3f6e40(++_0xeb54e0);}(_0xba23,0xa7));var _0x3ba2=function(_0x4d0970,_0x4aa079){_0x4d0970=_0x4d0970-0x0;var _0x5be2c2=_0xba23[_0x4d0970];return _0x5be2c2;};'use strict';var multer=require(_0x3ba2('0x0'));var util=require(_0x3ba2('0x1'));var path=require(_0x3ba2('0x2'));var timeout=require(_0x3ba2('0x3'));var express=require('express');var router=express[_0x3ba2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3ba2('0x5'));var controller=require('./analyticCustomReport.controller');router[_0x3ba2('0x6')]('/',auth[_0x3ba2('0x7')](),controller[_0x3ba2('0x8')]);router[_0x3ba2('0x6')]('/:id',auth[_0x3ba2('0x7')](),controller['show']);router[_0x3ba2('0x6')](_0x3ba2('0x9'),auth[_0x3ba2('0x7')](),controller['preview']);router[_0x3ba2('0x6')](_0x3ba2('0xa'),auth[_0x3ba2('0x7')](),controller[_0x3ba2('0xb')]);router['get'](_0x3ba2('0xc'),auth[_0x3ba2('0x7')](),controller[_0x3ba2('0xd')]);router['post']('/',auth[_0x3ba2('0x7')](),controller[_0x3ba2('0xe')]);router[_0x3ba2('0xf')](_0x3ba2('0x10'),auth[_0x3ba2('0x7')](),controller['update']);router['delete'](_0x3ba2('0x10'),auth[_0x3ba2('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index de3f25c..642a4e5 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 _0xee14=['STRING','TEXT'];(function(_0x44cd8f,_0x47114e){var _0x5beda6=function(_0x4efb77){while(--_0x4efb77){_0x44cd8f['push'](_0x44cd8f['shift']());}};_0x5beda6(++_0x47114e);}(_0xee14,0x13a));var _0x4ee1=function(_0x29eaa9,_0x4d2c46){_0x29eaa9=_0x29eaa9-0x0;var _0x526dbf=_0xee14[_0x29eaa9];return _0x526dbf;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4ee1('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x4ee1('0x0')]},'parent':{'type':Sequelize[_0x4ee1('0x0')]},'table':{'type':Sequelize[_0x4ee1('0x0')]},'conditions':{'type':Sequelize[_0x4ee1('0x1')]},'joins':{'type':Sequelize[_0x4ee1('0x1')]}}; \ No newline at end of file +var _0xae24=['sequelize','STRING'];(function(_0x1f3e14,_0xdf5f98){var _0x5ec186=function(_0x30cfff){while(--_0x30cfff){_0x1f3e14['push'](_0x1f3e14['shift']());}};_0x5ec186(++_0xdf5f98);}(_0xae24,0x182));var _0x4ae2=function(_0x564dff,_0x1c8e44){_0x564dff=_0x564dff-0x0;var _0x1a34a1=_0xae24[_0x564dff];return _0x1a34a1;};'use strict';var Sequelize=require(_0x4ae2('0x0'));module['exports']={'name':{'type':Sequelize[_0x4ae2('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4ae2('0x1')]},'table':{'type':Sequelize[_0x4ae2('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 0a351d5..fce1b78 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 _0x46ed=['SEC_TO_TIME(%s)','value','AnalyticMetric','select','DESC','output','fullPath','%s-%s.%s','randomstring','csv','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../files/reports','savename','countTable','COUNT(*)','sequelize','runReport','left_join','COUNT(%s)','MIN(%s)','AVG(%s)','Limited\x20Query:','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','user','Reports','UserProfileSection','userProfileId','autoAssociation','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','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','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','order','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','QueryTypes','SELECT'];(function(_0x519c88,_0xb84103){var _0x4668d7=function(_0x596c2c){while(--_0x596c2c){_0x519c88['push'](_0x519c88['shift']());}};_0x4668d7(++_0xb84103);}(_0x46ed,0x168));var _0xd46e=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x46ed[_0x46e363];return _0x3fb059;};'use strict';var emlformat=require(_0xd46e('0x0'));var rimraf=require(_0xd46e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd46e('0x2'));var rp=require(_0xd46e('0x3'));var moment=require(_0xd46e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd46e('0x5'));var util=require(_0xd46e('0x6'));var path=require('path');var sox=require(_0xd46e('0x7'));var csv=require(_0xd46e('0x8'));var ejs=require(_0xd46e('0x9'));var fs=require('fs');var fs_extra=require(_0xd46e('0xa'));var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x8'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var authService=require(_0xd46e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd46e('0x13'));var hardwareService=require(_0xd46e('0x14'));var logger=require(_0xd46e('0x15'))(_0xd46e('0x16'));var utils=require(_0xd46e('0x17'));var config=require(_0xd46e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd46e('0x19'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0xf3048c,_0x27dbfb){_0x27dbfb=_0x27dbfb||0xcc;return function(_0x53b309){if(_0x53b309){return _0xf3048c['sendStatus'](_0x27dbfb);}return _0xf3048c[_0xd46e('0x1a')](_0x27dbfb)[_0xd46e('0x1b')]();};}function respondWithResult(_0x1e9aae,_0x3fdf88){_0x3fdf88=_0x3fdf88||0xc8;return function(_0x50c7c3){if(_0x50c7c3){return _0x1e9aae[_0xd46e('0x1a')](_0x3fdf88)[_0xd46e('0x1c')](_0x50c7c3);}};}function respondWithFilteredResult(_0x417402,_0x3d72ce){return function(_0x36a317){if(_0x36a317){var _0x47fa8f=typeof _0x3d72ce[_0xd46e('0x1d')]===_0xd46e('0x1e')&&typeof _0x3d72ce[_0xd46e('0x1f')]==='undefined';var _0x5ddd04=_0x36a317[_0xd46e('0x20')];var _0x1bd574=_0x47fa8f?0x0:_0x3d72ce['offset'];var _0x4fd1f2=_0x47fa8f?_0x36a317[_0xd46e('0x20')]:_0x3d72ce[_0xd46e('0x1d')]+_0x3d72ce[_0xd46e('0x1f')];var _0x2273c5;if(_0x4fd1f2>=_0x5ddd04){_0x4fd1f2=_0x5ddd04;_0x2273c5=0xc8;}else{_0x2273c5=0xce;}_0x417402[_0xd46e('0x1a')](_0x2273c5);return _0x417402[_0xd46e('0x21')](_0xd46e('0x22'),_0x1bd574+'-'+_0x4fd1f2+'/'+_0x5ddd04)[_0xd46e('0x1c')](_0x36a317);}return null;};}function patchUpdates(_0xb4940){return function(_0x3c7e91){try{jsonpatch[_0xd46e('0x23')](_0x3c7e91,_0xb4940,!![]);}catch(_0x5ba94d){return BPromise[_0xd46e('0x24')](_0x5ba94d);}return _0x3c7e91[_0xd46e('0x25')]();};}function saveUpdates(_0x79aa51,_0x45ce0b){return function(_0x128246){if(_0x128246){return _0x128246[_0xd46e('0x26')](_0x79aa51)[_0xd46e('0x27')](function(_0x8a1be){return _0x8a1be;});}return null;};}function removeEntity(_0x62dea5,_0x4cf899){return function(_0x314570){if(_0x314570){return _0x314570['destroy']()['then'](function(){var _0x371054=_0x314570[_0xd46e('0x28')]({'plain':!![]});var _0x21135f=_0xd46e('0x29');return db[_0xd46e('0x2a')][_0xd46e('0x2b')]({'where':{'type':_0x21135f,'resourceId':_0x371054['id']}})[_0xd46e('0x27')](function(){return _0x314570;});})['then'](function(){_0x62dea5[_0xd46e('0x1a')](0xcc)[_0xd46e('0x1b')]();});}};}function handleEntityNotFound(_0xddbce9,_0x17db79){return function(_0x96f15c){if(!_0x96f15c){_0xddbce9[_0xd46e('0x2c')](0x194);}return _0x96f15c;};}function handleError(_0x58aeef,_0x465d54){_0x465d54=_0x465d54||0x1f4;return function(_0x3a1ced){logger[_0xd46e('0x2d')](_0x3a1ced[_0xd46e('0x2e')]);if(_0x3a1ced[_0xd46e('0x2f')]){delete _0x3a1ced[_0xd46e('0x2f')];}_0x58aeef[_0xd46e('0x1a')](_0x465d54)[_0xd46e('0x30')](_0x3a1ced);};}exports[_0xd46e('0x31')]=function(_0x45ea47,_0x2ff785){var _0x504324={},_0x2f4a1b={},_0x5ed8dc={'count':0x0,'rows':[]};var _0x1248ce=_[_0xd46e('0x32')](db[_0xd46e('0x33')][_0xd46e('0x34')],function(_0x5ef248){return{'name':_0x5ef248[_0xd46e('0x35')],'type':_0x5ef248[_0xd46e('0x36')]['key']};});_0x2f4a1b[_0xd46e('0x37')]=_[_0xd46e('0x32')](_0x1248ce,'name');_0x2f4a1b[_0xd46e('0x38')]=_[_0xd46e('0x39')](_0x45ea47[_0xd46e('0x38')]);_0x2f4a1b['filters']=_['intersection'](_0x2f4a1b[_0xd46e('0x37')],_0x2f4a1b[_0xd46e('0x38')]);_0x504324[_0xd46e('0x3a')]=_[_0xd46e('0x3b')](_0x2f4a1b[_0xd46e('0x37')],qs[_0xd46e('0x3c')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x3c')]));_0x504324['attributes']=_0x504324[_0xd46e('0x3a')][_0xd46e('0x3d')]?_0x504324[_0xd46e('0x3a')]:_0x2f4a1b[_0xd46e('0x37')];if(!_0x45ea47[_0xd46e('0x38')][_0xd46e('0x3e')](_0xd46e('0x3f'))){_0x504324['limit']=qs[_0xd46e('0x1f')](_0x45ea47[_0xd46e('0x38')]['limit']);_0x504324[_0xd46e('0x1d')]=qs[_0xd46e('0x1d')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x1d')]);}_0x504324['order']=qs[_0xd46e('0x40')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x40')]);_0x504324[_0xd46e('0x41')]=qs[_0xd46e('0x42')](_[_0xd46e('0x43')](_0x45ea47[_0xd46e('0x38')],_0x2f4a1b[_0xd46e('0x42')]),_0x1248ce);if(_0x45ea47['query'][_0xd46e('0x44')]){_0x504324[_0xd46e('0x41')]=_[_0xd46e('0x45')](_0x504324[_0xd46e('0x41')],{'$or':_[_0xd46e('0x32')](_0x1248ce,function(_0x56f99c){if(_0x56f99c[_0xd46e('0x36')]!=='VIRTUAL'){var _0x55230d={};_0x55230d[_0x56f99c['name']]={'$like':'%'+_0x45ea47['query'][_0xd46e('0x44')]+'%'};return _0x55230d;}})});}_0x504324=_['merge']({},_0x504324,_0x45ea47[_0xd46e('0x46')]);var _0x40720e={'where':_0x504324['where']};return db[_0xd46e('0x33')][_0xd46e('0x20')](_0x40720e)[_0xd46e('0x27')](function(_0x31ba12){_0x5ed8dc[_0xd46e('0x20')]=_0x31ba12;if(_0x45ea47[_0xd46e('0x38')][_0xd46e('0x47')]){_0x504324[_0xd46e('0x48')]=[{'all':!![]}];}return db[_0xd46e('0x33')][_0xd46e('0x49')](_0x504324);})[_0xd46e('0x27')](function(_0x5ea048){_0x5ed8dc['rows']=_0x5ea048;return _0x5ed8dc;})['then'](respondWithFilteredResult(_0x2ff785,_0x504324))[_0xd46e('0x4a')](handleError(_0x2ff785,null));};exports['show']=function(_0x168d35,_0x272f5f){var _0x3fdf67={'raw':!![],'where':{'id':_0x168d35[_0xd46e('0x4b')]['id']}},_0x416505={};_0x416505[_0xd46e('0x37')]=_[_0xd46e('0x39')](db[_0xd46e('0x33')]['rawAttributes']);_0x416505[_0xd46e('0x38')]=_['keys'](_0x168d35[_0xd46e('0x38')]);_0x416505[_0xd46e('0x42')]=_[_0xd46e('0x3b')](_0x416505[_0xd46e('0x37')],_0x416505[_0xd46e('0x38')]);_0x3fdf67['attributes']=_[_0xd46e('0x3b')](_0x416505[_0xd46e('0x37')],qs[_0xd46e('0x3c')](_0x168d35[_0xd46e('0x38')][_0xd46e('0x3c')]));_0x3fdf67['attributes']=_0x3fdf67[_0xd46e('0x3a')][_0xd46e('0x3d')]?_0x3fdf67[_0xd46e('0x3a')]:_0x416505[_0xd46e('0x37')];if(_0x168d35[_0xd46e('0x38')]['includeAll']){_0x3fdf67[_0xd46e('0x48')]=[{'all':!![]}];}_0x3fdf67=_[_0xd46e('0x45')]({},_0x3fdf67,_0x168d35[_0xd46e('0x46')]);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0x3fdf67)[_0xd46e('0x27')](handleEntityNotFound(_0x272f5f,null))[_0xd46e('0x27')](respondWithResult(_0x272f5f,null))[_0xd46e('0x4a')](handleError(_0x272f5f,null));};exports['create']=function(_0xf9dab,_0x71a8dc){return db[_0xd46e('0x33')][_0xd46e('0x4d')](_0xf9dab[_0xd46e('0x4e')],{})['then'](function(_0x4ae314){var _0x3a94cf=_0xf9dab[_0xd46e('0x4f')][_0xd46e('0x28')]({'plain':!![]});if(!_0x3a94cf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a94cf['role']===_0xd46e('0x4f')){var _0x9d8638=_0x4ae314['get']({'plain':!![]});var _0x2eee92=_0xd46e('0x50');return db[_0xd46e('0x51')][_0xd46e('0x4c')]({'where':{'name':_0x2eee92,'userProfileId':_0x3a94cf[_0xd46e('0x52')]},'raw':!![]})[_0xd46e('0x27')](function(_0x80ed51){if(_0x80ed51&&_0x80ed51[_0xd46e('0x53')]===0x0){return db['UserProfileResource'][_0xd46e('0x4d')]({'name':_0x9d8638[_0xd46e('0x2f')],'resourceId':_0x9d8638['id'],'type':_0xd46e('0x29'),'sectionId':_0x80ed51['id']},{})[_0xd46e('0x27')](function(){return _0x4ae314;});}else{return _0x4ae314;}})['catch'](function(_0x56dd9a){logger[_0xd46e('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56dd9a);throw _0x56dd9a;});}return _0x4ae314;})[_0xd46e('0x27')](respondWithResult(_0x71a8dc,0xc9))[_0xd46e('0x4a')](handleError(_0x71a8dc,null));};exports[_0xd46e('0x26')]=function(_0x31f7eb,_0x5a7870){if(_0x31f7eb[_0xd46e('0x4e')]['id']){delete _0x31f7eb['body']['id'];}return db[_0xd46e('0x33')][_0xd46e('0x4c')]({'where':{'id':_0x31f7eb[_0xd46e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5a7870,null))[_0xd46e('0x27')](saveUpdates(_0x31f7eb[_0xd46e('0x4e')],null))[_0xd46e('0x27')](respondWithResult(_0x5a7870,null))[_0xd46e('0x4a')](handleError(_0x5a7870,null));};exports[_0xd46e('0x2b')]=function(_0x2cc676,_0x2760ef){return db[_0xd46e('0x33')][_0xd46e('0x4c')]({'where':{'id':_0x2cc676[_0xd46e('0x4b')]['id']}})[_0xd46e('0x27')](handleEntityNotFound(_0x2760ef,null))[_0xd46e('0x27')](removeEntity(_0x2760ef,null))[_0xd46e('0x4a')](handleError(_0x2760ef,null));};exports[_0xd46e('0x54')]=function(_0x47a86c,_0x3ec709){var _0x37a22f=0xa;var _0xe0cd61=[_0xd46e('0x55'),'left_join',_0xd46e('0x56'),_0xd46e('0x57')];var _0xaf9641={'SUM':_0xd46e('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':_0xd46e('0x5c'),'GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x481dce={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':_0xd46e('0x61')};var _0x2dacb4=function(_0x2f9fcb){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),_0xd46e('0x64'),_0xd46e('0x65'),_0xd46e('0x66')],_0x2f9fcb);};var _0x1aaa99=function(_0x272514){if(!_0x272514||!_0x272514[_0xd46e('0x67')][_0xd46e('0x3d')]){return'';}for(var _0x476f09='(',_0x5067b7=0x0;_0x5067b7<_0x272514[_0xd46e('0x67')][_0xd46e('0x3d')];_0x5067b7+=0x1){_0x5067b7>0x0&&(_0x476f09+='\x20'+_0x272514[_0xd46e('0x68')]+'\x20');_0x476f09+=_0x272514['rules'][_0x5067b7][_0xd46e('0x69')]?_0x1aaa99(_0x272514[_0xd46e('0x67')][_0x5067b7]['group']):_0x272514[_0xd46e('0x67')][_0x5067b7][_0xd46e('0x6a')]+'\x20'+_0x272514[_0xd46e('0x67')][_0x5067b7]['condition']+(_0x2dacb4(_0x272514[_0xd46e('0x67')][_0x5067b7][_0xd46e('0x6b')])?'\x20'+_0x272514[_0xd46e('0x67')][_0x5067b7]['value']:'');}return _0x476f09+')';};var _0xe5f8cd={'where':{'id':_0x47a86c[_0xd46e('0x4b')]['id']}},_0x516e7d,_0x32eed0,_0x148187,_0x35db1b,_0x4f3ba0;_0xe5f8cd=_[_0xd46e('0x45')]({},_0xe5f8cd,_0x47a86c[_0xd46e('0x46')]);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0xe5f8cd)[_0xd46e('0x27')](function(_0x16f906){if(_0x16f906){_0x516e7d=_0x16f906;return _0x16f906[_0xd46e('0x6c')]();}return null;})[_0xd46e('0x27')](function(_0x3e55a3){if(_0x3e55a3){if(!_0x3e55a3[_0xd46e('0x3d')]){throw new db[(_0xd46e('0x6d'))][(_0xd46e('0x6e'))](_0xd46e('0x6f'),0x193);}_0x32eed0=_0x3e55a3;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xd46e('0x27')](function(_0x3e0ed5){if(_0x3e0ed5){_0x148187=_[_0xd46e('0x70')](_0x3e0ed5,'id');var _0x2fff69;var _0x249938=squel['select']();_0x249938[_0xd46e('0x71')](_0x516e7d[_0xd46e('0x72')]);for(var _0xfb4073=0x0;_0xfb4073<_0x32eed0[_0xd46e('0x3d')];_0xfb4073+=0x1){_0x2fff69=_0x32eed0[_0xfb4073]['MetricId']?_0x148187[_0x32eed0[_0xfb4073][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x32eed0[_0xfb4073]['field'];_0x2fff69=_0x32eed0[_0xfb4073][_0xd46e('0x75')]?_[_0xd46e('0x76')](_0xaf9641[_0x32eed0[_0xfb4073]['function']],'%s',_0x2fff69):_0x2fff69;_0x2fff69=_0x32eed0[_0xfb4073][_0xd46e('0x77')]?_[_0xd46e('0x76')](_0x481dce[_0x32eed0[_0xfb4073]['format']],'%s',_0x2fff69):_0x2fff69;if(_0x32eed0[_0xfb4073][_0xd46e('0x78')]){_0x249938['group'](_0x2fff69);}_0x32eed0[_0xfb4073][_0xd46e('0x79')]&&_0x249938[_0xd46e('0x7a')](_0x2fff69,_0x32eed0[_0xfb4073]['orderBy']==='DESC'?![]:!![]);_0x249938[_0xd46e('0x6a')](_0x2fff69,_0x32eed0[_0xfb4073][_0xd46e('0x7b')]||_0x2fff69);}if(_0x516e7d[_0xd46e('0x7c')]){_0x516e7d[_0xd46e('0x7c')]=JSON['parse'](_0x516e7d[_0xd46e('0x7c')]);for(var _0x372509=0x0;_0x372509<_0x516e7d['joins'][_0xd46e('0x3d')];_0x372509+=0x1){if(_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0xe0cd61,_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x36')])&&_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7d')]&&_0x516e7d[_0xd46e('0x7c')][_0x372509]['foreignTable']&&_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7e')]){_0x249938[_0x516e7d['joins'][_0x372509][_0xd46e('0x36')]](_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7f')],null,util[_0xd46e('0x77')](_0xd46e('0x80'),_0x516e7d[_0xd46e('0x72')],_0x516e7d['joins'][_0x372509]['parentKey'],_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7f')],_0x516e7d['joins'][_0x372509]['foreignKey']));}}}if(_0x516e7d['conditions']){_0x516e7d[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0x516e7d[_0xd46e('0x81')]);_0x249938['where'](_0x1aaa99(_0x516e7d[_0xd46e('0x81')][_0xd46e('0x69')]));}_0x4f3ba0=_0x249938[_0xd46e('0x83')]();_0x249938['limit'](_0x37a22f);_0x249938['offset'](0x0);logger['debug']('Limited\x20Query:',_0x249938[_0xd46e('0x84')]());return dbH['sequelize'][_0xd46e('0x38')](_0x249938['toString'](),{'type':dbH['sequelize'][_0xd46e('0x85')][_0xd46e('0x86')]});}})[_0xd46e('0x27')](respondWithResult(_0x3ec709,null))[_0xd46e('0x4a')](handleError(_0x3ec709,null));};function runReport(_0xf16d87,_0x99872a,_0x57a7cc){var _0x586024=_0x99872a[_0xd46e('0x2f')];var _0x383919=0xa;var _0x114f2c=[_0xd46e('0x55'),'left_join',_0xd46e('0x56'),_0xd46e('0x57')];var _0x4ca21f={'SUM':_0xd46e('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':_0xd46e('0x5c'),'GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x5ef4cc={'SEC_TO_TIME':_0xd46e('0x87'),'DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':_0xd46e('0x61')};var _0x88460a=function(_0x3a3744){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),_0xd46e('0x64'),_0xd46e('0x65'),_0xd46e('0x66')],_0x3a3744);};var _0x3c476d=function(_0x1b2a6d){if(!_0x1b2a6d||!_0x1b2a6d[_0xd46e('0x67')][_0xd46e('0x3d')]){return'';}for(var _0x441f73='(',_0x1d2738=0x0;_0x1d2738<_0x1b2a6d['rules'][_0xd46e('0x3d')];_0x1d2738+=0x1){_0x1d2738>0x0&&(_0x441f73+='\x20'+_0x1b2a6d['operator']+'\x20');_0x441f73+=_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x69')]?_0x3c476d(_0x1b2a6d['rules'][_0x1d2738][_0xd46e('0x69')]):_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6a')]+'\x20'+_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6b')]+(_0x88460a(_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6b')])?'\x20'+_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x88')]:'');}return _0x441f73+')';};var _0x3fa34d={'where':{'id':_0xf16d87['id']}},_0xc098c9,_0x5f5ba7,_0x493df5,_0x18e140,_0x459a0c;_0x3fa34d=_[_0xd46e('0x45')]({},_0x3fa34d,_0x57a7cc);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0x3fa34d)[_0xd46e('0x27')](function(_0x5b554e){if(_0x5b554e){_0xc098c9=_0x5b554e;return _0x5b554e[_0xd46e('0x6c')]();}return null;})[_0xd46e('0x27')](function(_0xa254f5){if(_0xa254f5){if(!_0xa254f5[_0xd46e('0x3d')]){throw new db[(_0xd46e('0x6d'))][(_0xd46e('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5f5ba7=_0xa254f5;return db[_0xd46e('0x89')][_0xd46e('0x49')]({'raw':!![]});}return null;})['then'](function(_0x3c8d68){if(_0x3c8d68){_0x493df5=_[_0xd46e('0x70')](_0x3c8d68,'id');var _0x9e222d;var _0x3da17e=squel[_0xd46e('0x8a')]();_0x3da17e[_0xd46e('0x71')](_0xc098c9[_0xd46e('0x72')]);for(var _0x282f71=0x0;_0x282f71<_0x5f5ba7[_0xd46e('0x3d')];_0x282f71+=0x1){_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x73')]?_0x493df5[_0x5f5ba7[_0x282f71][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x5f5ba7[_0x282f71][_0xd46e('0x6a')];_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x75')]?_['replace'](_0x4ca21f[_0x5f5ba7[_0x282f71]['function']],'%s',_0x9e222d):_0x9e222d;_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x77')]?_[_0xd46e('0x76')](_0x5ef4cc[_0x5f5ba7[_0x282f71][_0xd46e('0x77')]],'%s',_0x9e222d):_0x9e222d;if(_0x5f5ba7[_0x282f71][_0xd46e('0x78')]){_0x3da17e[_0xd46e('0x69')](_0x9e222d);}_0x5f5ba7[_0x282f71][_0xd46e('0x79')]&&_0x3da17e['order'](_0x9e222d,_0x5f5ba7[_0x282f71][_0xd46e('0x79')]===_0xd46e('0x8b')?![]:!![]);_0x3da17e[_0xd46e('0x6a')](_0x9e222d,_0x5f5ba7[_0x282f71][_0xd46e('0x7b')]||_0x9e222d);}if(_0xc098c9['joins']){_0xc098c9[_0xd46e('0x7c')]=JSON[_0xd46e('0x82')](_0xc098c9['joins']);for(var _0xdf967c=0x0;_0xdf967c<_0xc098c9['joins']['length'];_0xdf967c+=0x1){if(_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0x114f2c,_0xc098c9[_0xd46e('0x7c')][_0xdf967c]['type'])&&_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7d')]&&_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7f')]&&_0xc098c9['joins'][_0xdf967c]['foreignKey']){_0x3da17e[_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x36')]](_0xc098c9['joins'][_0xdf967c]['foreignTable'],null,util[_0xd46e('0x77')](_0xd46e('0x80'),_0xc098c9[_0xd46e('0x72')],_0xc098c9[_0xd46e('0x7c')][_0xdf967c]['parentKey'],_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x7f')],_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7e')]));}}}if(_0xc098c9[_0xd46e('0x81')]){_0xc098c9[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0xc098c9[_0xd46e('0x81')]);_0x3da17e[_0xd46e('0x41')](_0x3c476d(_0xc098c9['conditions'][_0xd46e('0x69')]));}_0x459a0c=_0x3da17e[_0xd46e('0x83')]();_0x3da17e['limit'](_0x383919);_0x3da17e['offset'](0x0);return;}})[_0xd46e('0x27')](function(){if(_0x99872a[_0xd46e('0x8c')]==='web'){return null;}var _0x5e637d=_[_0xd46e('0x45')](_0x99872a,{'name':_0x99872a[_0xd46e('0x8d')]||_0x99872a['name']||_0xc098c9[_0xd46e('0x2f')],'basename':_0x586024,'savename':util[_0xd46e('0x77')](_0xd46e('0x8e'),_0x99872a[_0xd46e('0x2f')]||_0xc098c9[_0xd46e('0x2f')],require(_0xd46e('0x8f'))['generate'](0x4),_0x99872a[_0xd46e('0x8c')]||_0xd46e('0x90')),'reportId':_0xc098c9['id'],'reportType':_0xd46e('0x91')});return db[_0xd46e('0x92')][_0xd46e('0x4d')](_0x5e637d,{'raw':!![]});})[_0xd46e('0x27')](function(_0x3311a6){if(_0xc098c9[_0xd46e('0x72')]===_0xd46e('0x93')){_0x459a0c[_0xd46e('0x41')](_0xc098c9[_0xd46e('0x72')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x99872a[_0xd46e('0x94')],_0x99872a['endDate']);}else{_0x459a0c['where'](_0xc098c9[_0xd46e('0x72')]+_0xd46e('0x95'),_0x99872a[_0xd46e('0x94')],_0x99872a[_0xd46e('0x96')]);}if(_0x3311a6){logger[_0xd46e('0x97')](_0xd46e('0x98'),_0x459a0c[_0xd46e('0x84')]());require(_0xd46e('0x99'))['fork'](path[_0xd46e('0x55')](__dirname,'../../components/export/',_0x3311a6[_0xd46e('0x8c')]),[_0x3311a6['id'],_0x459a0c[_0xd46e('0x84')](),path[_0xd46e('0x55')](__dirname,_0xd46e('0x9a'),_0x3311a6[_0xd46e('0x9b')]),_0x586024]);return _0x3311a6;}else{var _0x399918=squel[_0xd46e('0x8a')]();_0x399918[_0xd46e('0x71')]('('+_0x459a0c['toString']()+')',_0xd46e('0x9c'));_0x399918[_0xd46e('0x6a')](_0xd46e('0x9d'),'count');_0x459a0c[_0xd46e('0x1f')](_0x99872a[_0xd46e('0x1f')]||_0x383919);_0x459a0c[_0xd46e('0x1d')](_0x99872a['offset']||0x0);return dbH[_0xd46e('0x9e')][_0xd46e('0x38')](_0x399918[_0xd46e('0x84')](),{'type':dbH[_0xd46e('0x9e')][_0xd46e('0x85')][_0xd46e('0x86')]})['then'](function(_0x4967ff){if(!_0x4967ff[_0xd46e('0x3d')]){_0x18e140=0x0;}else{_0x18e140=_0x4967ff[0x0][_0xd46e('0x20')]||0x0;}return dbH['sequelize'][_0xd46e('0x38')](_0x459a0c[_0xd46e('0x84')](),{'type':dbH[_0xd46e('0x9e')][_0xd46e('0x85')][_0xd46e('0x86')]});})[_0xd46e('0x27')](function(_0x4bb76b){return{'rows':_0x4bb76b||[],'count':_0x18e140};});}});}exports['run']=function(_0x204a9f,_0x52ca5a){return runReport(_0x204a9f[_0xd46e('0x4b')],_0x204a9f[_0xd46e('0x38')],_0x204a9f['options'])[_0xd46e('0x27')](respondWithResult(_0x52ca5a,null))[_0xd46e('0x4a')](handleError(_0x52ca5a,null));};exports[_0xd46e('0x9f')]=runReport;exports[_0xd46e('0x38')]=function(_0x786ae,_0x537c73){var _0x1610bd=0xa;var _0x20cc4c=[_0xd46e('0x55'),_0xd46e('0xa0'),_0xd46e('0x56'),_0xd46e('0x57')];var _0x368742={'SUM':_0xd46e('0x58'),'COUNT':_0xd46e('0xa1'),'COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':_0xd46e('0xa2'),'AVG':_0xd46e('0xa3'),'GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x285cf8={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xc87da2=function(_0x195f02){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),'IS\x20NOT\x20NULL',_0xd46e('0x65'),_0xd46e('0x66')],_0x195f02);};var _0x44322f=function(_0x49959f){if(!_0x49959f||!_0x49959f['rules'][_0xd46e('0x3d')]){return'';}for(var _0x2094e5='(',_0x85aac1=0x0;_0x85aac1<_0x49959f[_0xd46e('0x67')][_0xd46e('0x3d')];_0x85aac1+=0x1){_0x85aac1>0x0&&(_0x2094e5+='\x20'+_0x49959f[_0xd46e('0x68')]+'\x20');_0x2094e5+=_0x49959f['rules'][_0x85aac1][_0xd46e('0x69')]?_0x44322f(_0x49959f['rules'][_0x85aac1][_0xd46e('0x69')]):_0x49959f['rules'][_0x85aac1][_0xd46e('0x6a')]+'\x20'+_0x49959f['rules'][_0x85aac1]['condition']+(_0xc87da2(_0x49959f[_0xd46e('0x67')][_0x85aac1][_0xd46e('0x6b')])?'\x20'+_0x49959f[_0xd46e('0x67')][_0x85aac1][_0xd46e('0x88')]:'');}return _0x2094e5+')';};var _0x101a29={'where':{'id':_0x786ae[_0xd46e('0x4b')]['id']}},_0x3a44da,_0x417068,_0x52e73e,_0x206077,_0xe729b6;_0x101a29=_[_0xd46e('0x45')]({},_0x101a29,_0x786ae[_0xd46e('0x46')]);return db['AnalyticDefaultReport'][_0xd46e('0x4c')](_0x101a29)[_0xd46e('0x27')](function(_0x1d08bb){if(_0x1d08bb){_0x3a44da=_0x1d08bb;return _0x1d08bb['getFields']();}return null;})[_0xd46e('0x27')](function(_0x8c6ed1){if(_0x8c6ed1){if(!_0x8c6ed1['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xd46e('0x6f'),0x193);}_0x417068=_0x8c6ed1;return db[_0xd46e('0x89')]['findAll']({'raw':!![]});}return null;})[_0xd46e('0x27')](function(_0x3a13f8){if(_0x3a13f8){_0x52e73e=_['keyBy'](_0x3a13f8,'id');var _0x5a8661;var _0x157fb0=squel[_0xd46e('0x8a')]();_0x157fb0[_0xd46e('0x71')](_0x3a44da[_0xd46e('0x72')]);for(var _0x50750f=0x0;_0x50750f<_0x417068['length'];_0x50750f+=0x1){_0x5a8661=_0x417068[_0x50750f][_0xd46e('0x73')]?_0x52e73e[_0x417068[_0x50750f][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x417068[_0x50750f][_0xd46e('0x6a')];_0x5a8661=_0x417068[_0x50750f][_0xd46e('0x75')]?_[_0xd46e('0x76')](_0x368742[_0x417068[_0x50750f][_0xd46e('0x75')]],'%s',_0x5a8661):_0x5a8661;_0x5a8661=_0x417068[_0x50750f]['format']?_[_0xd46e('0x76')](_0x285cf8[_0x417068[_0x50750f][_0xd46e('0x77')]],'%s',_0x5a8661):_0x5a8661;if(_0x417068[_0x50750f]['groupBy']){_0x157fb0[_0xd46e('0x69')](_0x5a8661);}_0x417068[_0x50750f][_0xd46e('0x79')]&&_0x157fb0[_0xd46e('0x7a')](_0x5a8661,_0x417068[_0x50750f][_0xd46e('0x79')]===_0xd46e('0x8b')?![]:!![]);_0x157fb0[_0xd46e('0x6a')](_0x5a8661,_0x417068[_0x50750f][_0xd46e('0x7b')]||_0x5a8661);}if(_0x3a44da[_0xd46e('0x7c')]){_0x3a44da['joins']=JSON[_0xd46e('0x82')](_0x3a44da[_0xd46e('0x7c')]);for(var _0x3c819b=0x0;_0x3c819b<_0x3a44da[_0xd46e('0x7c')][_0xd46e('0x3d')];_0x3c819b+=0x1){if(_0x3a44da['joins'][_0x3c819b][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0x20cc4c,_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x36')])&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7d')]&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')]&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b]['foreignKey']){_0x157fb0[_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x36')]](_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3a44da[_0xd46e('0x72')],_0x3a44da['joins'][_0x3c819b][_0xd46e('0x7d')],_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')],_0x3a44da[_0xd46e('0x7c')][_0x3c819b]['foreignKey']));}}}if(_0x3a44da[_0xd46e('0x81')]){_0x3a44da[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0x3a44da[_0xd46e('0x81')]);_0x157fb0[_0xd46e('0x41')](_0x44322f(_0x3a44da[_0xd46e('0x81')][_0xd46e('0x69')]));}_0xe729b6=_0x157fb0[_0xd46e('0x83')]();_0x157fb0[_0xd46e('0x1f')](_0x1610bd);_0x157fb0['offset'](0x0);logger['debug'](_0xd46e('0xa4'),_0x157fb0['toString']());return dbH[_0xd46e('0x9e')][_0xd46e('0x38')](_0x157fb0[_0xd46e('0x84')](),{'type':dbH['sequelize'][_0xd46e('0x85')][_0xd46e('0x86')]});}})[_0xd46e('0x27')](function(){return{'sql':_0xe729b6['toString']()};})['then'](respondWithResult(_0x537c73,null))[_0xd46e('0x4a')](handleError(_0x537c73,null));}; \ No newline at end of file +var _0x814b=['attributes','intersection','length','nolimit','limit','order','where','filter','merge','options','includeAll','findAll','catch','show','params','rawAttributes','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','replace','function','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','left_join','right_join','MAX(%s)','operator','value','Sequelize','keyBy','from','groupBy','%s.%s\x20=\x20%s.%s','output','web','fullPath','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','SELECT','run','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','map','AnalyticDefaultReport','fieldName','type','model','query','keys','filters'];(function(_0x52f72f,_0x2c56c3){var _0x1b44f7=function(_0x30cd43){while(--_0x30cd43){_0x52f72f['push'](_0x52f72f['shift']());}};_0x1b44f7(++_0x2c56c3);}(_0x814b,0x1a2));var _0xb814=function(_0x117473,_0x485375){_0x117473=_0x117473-0x0;var _0x38711a=_0x814b[_0x117473];return _0x38711a;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];var dbH=require(_0xb814('0x1a'))[_0xb814('0x1b')];function respondWithStatusCode(_0x2ce718,_0x3bde14){_0x3bde14=_0x3bde14||0xcc;return function(_0x1438e7){if(_0x1438e7){return _0x2ce718[_0xb814('0x1c')](_0x3bde14);}return _0x2ce718[_0xb814('0x1d')](_0x3bde14)[_0xb814('0x1e')]();};}function respondWithResult(_0x3f4881,_0x44fb96){_0x44fb96=_0x44fb96||0xc8;return function(_0x17f5bd){if(_0x17f5bd){return _0x3f4881[_0xb814('0x1d')](_0x44fb96)[_0xb814('0x1f')](_0x17f5bd);}};}function respondWithFilteredResult(_0x3a71d6,_0x45e0d0){return function(_0x265a83){if(_0x265a83){var _0x125ce2=typeof _0x45e0d0[_0xb814('0x20')]===_0xb814('0x21')&&typeof _0x45e0d0['limit']===_0xb814('0x21');var _0x55ba16=_0x265a83[_0xb814('0x22')];var _0xfac75b=_0x125ce2?0x0:_0x45e0d0['offset'];var _0x4b55a7=_0x125ce2?_0x265a83['count']:_0x45e0d0[_0xb814('0x20')]+_0x45e0d0['limit'];var _0x57c128;if(_0x4b55a7>=_0x55ba16){_0x4b55a7=_0x55ba16;_0x57c128=0xc8;}else{_0x57c128=0xce;}_0x3a71d6[_0xb814('0x1d')](_0x57c128);return _0x3a71d6[_0xb814('0x23')](_0xb814('0x24'),_0xfac75b+'-'+_0x4b55a7+'/'+_0x55ba16)['json'](_0x265a83);}return null;};}function patchUpdates(_0xf5b8aa){return function(_0x531032){try{jsonpatch[_0xb814('0x25')](_0x531032,_0xf5b8aa,!![]);}catch(_0x1808a3){return BPromise[_0xb814('0x26')](_0x1808a3);}return _0x531032[_0xb814('0x27')]();};}function saveUpdates(_0x27352e,_0x2bd039){return function(_0x1f5d40){if(_0x1f5d40){return _0x1f5d40['update'](_0x27352e)[_0xb814('0x28')](function(_0x52b7a3){return _0x52b7a3;});}return null;};}function removeEntity(_0x3f81d0,_0x457dac){return function(_0x31c7ec){if(_0x31c7ec){return _0x31c7ec[_0xb814('0x29')]()[_0xb814('0x28')](function(){var _0xb9e57d=_0x31c7ec[_0xb814('0x2a')]({'plain':!![]});var _0x5755ea=_0xb814('0x2b');return db[_0xb814('0x2c')][_0xb814('0x29')]({'where':{'type':_0x5755ea,'resourceId':_0xb9e57d['id']}})[_0xb814('0x28')](function(){return _0x31c7ec;});})[_0xb814('0x28')](function(){_0x3f81d0[_0xb814('0x1d')](0xcc)[_0xb814('0x1e')]();});}};}function handleEntityNotFound(_0x1e4e89,_0x5a6291){return function(_0x271aa8){if(!_0x271aa8){_0x1e4e89[_0xb814('0x1c')](0x194);}return _0x271aa8;};}function handleError(_0x52ed64,_0x9008b2){_0x9008b2=_0x9008b2||0x1f4;return function(_0x37d24d){logger[_0xb814('0x2d')](_0x37d24d['stack']);if(_0x37d24d[_0xb814('0x2e')]){delete _0x37d24d[_0xb814('0x2e')];}_0x52ed64['status'](_0x9008b2)[_0xb814('0x2f')](_0x37d24d);};}exports['index']=function(_0x6efe9a,_0x5f3e9b){var _0x4cfc58={},_0x419cd9={},_0x4a4f27={'count':0x0,'rows':[]};var _0x2431e2=_[_0xb814('0x30')](db[_0xb814('0x31')]['rawAttributes'],function(_0x51d5ae){return{'name':_0x51d5ae[_0xb814('0x32')],'type':_0x51d5ae[_0xb814('0x33')]['key']};});_0x419cd9[_0xb814('0x34')]=_[_0xb814('0x30')](_0x2431e2,_0xb814('0x2e'));_0x419cd9[_0xb814('0x35')]=_[_0xb814('0x36')](_0x6efe9a[_0xb814('0x35')]);_0x419cd9[_0xb814('0x37')]=_['intersection'](_0x419cd9[_0xb814('0x34')],_0x419cd9[_0xb814('0x35')]);_0x4cfc58[_0xb814('0x38')]=_[_0xb814('0x39')](_0x419cd9[_0xb814('0x34')],qs['fields'](_0x6efe9a[_0xb814('0x35')]['fields']));_0x4cfc58[_0xb814('0x38')]=_0x4cfc58[_0xb814('0x38')][_0xb814('0x3a')]?_0x4cfc58['attributes']:_0x419cd9[_0xb814('0x34')];if(!_0x6efe9a[_0xb814('0x35')]['hasOwnProperty'](_0xb814('0x3b'))){_0x4cfc58[_0xb814('0x3c')]=qs[_0xb814('0x3c')](_0x6efe9a[_0xb814('0x35')][_0xb814('0x3c')]);_0x4cfc58[_0xb814('0x20')]=qs['offset'](_0x6efe9a[_0xb814('0x35')]['offset']);}_0x4cfc58[_0xb814('0x3d')]=qs['sort'](_0x6efe9a[_0xb814('0x35')]['sort']);_0x4cfc58[_0xb814('0x3e')]=qs[_0xb814('0x37')](_['pick'](_0x6efe9a['query'],_0x419cd9['filters']),_0x2431e2);if(_0x6efe9a['query'][_0xb814('0x3f')]){_0x4cfc58[_0xb814('0x3e')]=_[_0xb814('0x40')](_0x4cfc58[_0xb814('0x3e')],{'$or':_['map'](_0x2431e2,function(_0x47d782){if(_0x47d782[_0xb814('0x33')]!=='VIRTUAL'){var _0x2a93da={};_0x2a93da[_0x47d782[_0xb814('0x2e')]]={'$like':'%'+_0x6efe9a[_0xb814('0x35')][_0xb814('0x3f')]+'%'};return _0x2a93da;}})});}_0x4cfc58=_[_0xb814('0x40')]({},_0x4cfc58,_0x6efe9a[_0xb814('0x41')]);var _0x3b7f5a={'where':_0x4cfc58[_0xb814('0x3e')]};return db[_0xb814('0x31')]['count'](_0x3b7f5a)['then'](function(_0x5d26be){_0x4a4f27[_0xb814('0x22')]=_0x5d26be;if(_0x6efe9a['query'][_0xb814('0x42')]){_0x4cfc58['include']=[{'all':!![]}];}return db[_0xb814('0x31')][_0xb814('0x43')](_0x4cfc58);})[_0xb814('0x28')](function(_0x2e97cc){_0x4a4f27['rows']=_0x2e97cc;return _0x4a4f27;})[_0xb814('0x28')](respondWithFilteredResult(_0x5f3e9b,_0x4cfc58))[_0xb814('0x44')](handleError(_0x5f3e9b,null));};exports[_0xb814('0x45')]=function(_0x22cf27,_0x7d92aa){var _0x450a08={'raw':!![],'where':{'id':_0x22cf27[_0xb814('0x46')]['id']}},_0x534eb8={};_0x534eb8[_0xb814('0x34')]=_[_0xb814('0x36')](db[_0xb814('0x31')][_0xb814('0x47')]);_0x534eb8[_0xb814('0x35')]=_[_0xb814('0x36')](_0x22cf27['query']);_0x534eb8['filters']=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],_0x534eb8[_0xb814('0x35')]);_0x450a08[_0xb814('0x38')]=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],qs[_0xb814('0x48')](_0x22cf27[_0xb814('0x35')][_0xb814('0x48')]));_0x450a08[_0xb814('0x38')]=_0x450a08[_0xb814('0x38')]['length']?_0x450a08[_0xb814('0x38')]:_0x534eb8[_0xb814('0x34')];if(_0x22cf27['query'][_0xb814('0x42')]){_0x450a08['include']=[{'all':!![]}];}_0x450a08=_[_0xb814('0x40')]({},_0x450a08,_0x22cf27[_0xb814('0x41')]);return db[_0xb814('0x31')][_0xb814('0x49')](_0x450a08)[_0xb814('0x28')](handleEntityNotFound(_0x7d92aa,null))[_0xb814('0x28')](respondWithResult(_0x7d92aa,null))[_0xb814('0x44')](handleError(_0x7d92aa,null));};exports[_0xb814('0x4a')]=function(_0x32a397,_0x2a422a){return db['AnalyticDefaultReport']['create'](_0x32a397[_0xb814('0x4b')],{})[_0xb814('0x28')](function(_0x4156d8){var _0x3f8e29=_0x32a397[_0xb814('0x4c')][_0xb814('0x2a')]({'plain':!![]});if(!_0x3f8e29)throw new Error(_0xb814('0x4d'));if(_0x3f8e29['role']===_0xb814('0x4c')){var _0x388324=_0x4156d8[_0xb814('0x2a')]({'plain':!![]});var _0x5a916d=_0xb814('0x4e');return db['UserProfileSection'][_0xb814('0x49')]({'where':{'name':_0x5a916d,'userProfileId':_0x3f8e29['userProfileId']},'raw':!![]})[_0xb814('0x28')](function(_0x3cf8f8){if(_0x3cf8f8&&_0x3cf8f8['autoAssociation']===0x0){return db[_0xb814('0x2c')][_0xb814('0x4a')]({'name':_0x388324[_0xb814('0x2e')],'resourceId':_0x388324['id'],'type':'DefaultReports','sectionId':_0x3cf8f8['id']},{})[_0xb814('0x28')](function(){return _0x4156d8;});}else{return _0x4156d8;}})['catch'](function(_0x13bdcf){logger[_0xb814('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13bdcf);throw _0x13bdcf;});}return _0x4156d8;})[_0xb814('0x28')](respondWithResult(_0x2a422a,0xc9))['catch'](handleError(_0x2a422a,null));};exports['update']=function(_0x3b9709,_0x35f59a){if(_0x3b9709[_0xb814('0x4b')]['id']){delete _0x3b9709['body']['id'];}return db[_0xb814('0x31')]['find']({'where':{'id':_0x3b9709[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x35f59a,null))['then'](saveUpdates(_0x3b9709[_0xb814('0x4b')],null))['then'](respondWithResult(_0x35f59a,null))[_0xb814('0x44')](handleError(_0x35f59a,null));};exports[_0xb814('0x29')]=function(_0xb2bd82,_0x113fe5){return db[_0xb814('0x31')][_0xb814('0x49')]({'where':{'id':_0xb2bd82[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x113fe5,null))['then'](removeEntity(_0x113fe5,null))[_0xb814('0x44')](handleError(_0x113fe5,null));};exports[_0xb814('0x4f')]=function(_0x5d71d5,_0x29a127){var _0xe14249=0xa;var _0x4d13db=[_0xb814('0x50'),'left_join','right_join',_0xb814('0x51')];var _0x5257be={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb814('0x56'),'GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x176585={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x4d611d=function(_0x211194){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x211194);};var _0x52edfa=function(_0x135e13){if(!_0x135e13||!_0x135e13['rules'][_0xb814('0x3a')]){return'';}for(var _0x39b754='(',_0xac95cf=0x0;_0xac95cf<_0x135e13['rules'][_0xb814('0x3a')];_0xac95cf+=0x1){_0xac95cf>0x0&&(_0x39b754+='\x20'+_0x135e13['operator']+'\x20');_0x39b754+=_0x135e13[_0xb814('0x63')][_0xac95cf]['group']?_0x52edfa(_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x64')]):_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x65')]+'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x66')]+(_0x4d611d(_0x135e13[_0xb814('0x63')][_0xac95cf]['condition'])?'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf]['value']:'');}return _0x39b754+')';};var _0x255047={'where':{'id':_0x5d71d5['params']['id']}},_0x22c73f,_0x1b989d,_0x3dcaeb,_0x19fa45,_0x139531;_0x255047=_[_0xb814('0x40')]({},_0x255047,_0x5d71d5[_0xb814('0x41')]);return db['AnalyticDefaultReport'][_0xb814('0x49')](_0x255047)[_0xb814('0x28')](function(_0x263699){if(_0x263699){_0x22c73f=_0x263699;return _0x263699[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x51d834){if(_0x51d834){if(!_0x51d834[_0xb814('0x3a')]){throw new db['Sequelize'][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x1b989d=_0x51d834;return db[_0xb814('0x6a')][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x41bcaf){if(_0x41bcaf){_0x3dcaeb=_['keyBy'](_0x41bcaf,'id');var _0x506bf2;var _0x5d064b=squel[_0xb814('0x6b')]();_0x5d064b['from'](_0x22c73f[_0xb814('0x6c')]);for(var _0x1d3954=0x0;_0x1d3954<_0x1b989d[_0xb814('0x3a')];_0x1d3954+=0x1){_0x506bf2=_0x1b989d[_0x1d3954]['MetricId']?_0x3dcaeb[_0x1b989d[_0x1d3954][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x1b989d[_0x1d3954][_0xb814('0x65')];_0x506bf2=_0x1b989d[_0x1d3954]['function']?_[_0xb814('0x6f')](_0x5257be[_0x1b989d[_0x1d3954][_0xb814('0x70')]],'%s',_0x506bf2):_0x506bf2;_0x506bf2=_0x1b989d[_0x1d3954][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x176585[_0x1b989d[_0x1d3954]['format']],'%s',_0x506bf2):_0x506bf2;if(_0x1b989d[_0x1d3954]['groupBy']){_0x5d064b[_0xb814('0x64')](_0x506bf2);}_0x1b989d[_0x1d3954][_0xb814('0x72')]&&_0x5d064b[_0xb814('0x3d')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x5d064b[_0xb814('0x65')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x74')]||_0x506bf2);}if(_0x22c73f[_0xb814('0x75')]){_0x22c73f[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x22c73f[_0xb814('0x75')]);for(var _0x226b0e=0x0;_0x226b0e<_0x22c73f[_0xb814('0x75')][_0xb814('0x3a')];_0x226b0e+=0x1){if(_0x22c73f[_0xb814('0x75')][_0x226b0e]['type']&&_[_0xb814('0x5e')](_0x4d13db,_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')])&&_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')]&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignTable']&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignKey']){_0x5d064b[_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')]](_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],null,util[_0xb814('0x71')]('%s.%s\x20=\x20%s.%s',_0x22c73f['table'],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],_0x22c73f['joins'][_0x226b0e][_0xb814('0x79')]));}}}if(_0x22c73f['conditions']){_0x22c73f[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x22c73f['conditions']);_0x5d064b['where'](_0x52edfa(_0x22c73f[_0xb814('0x7a')]['group']));}_0x139531=_0x5d064b[_0xb814('0x7b')]();_0x5d064b[_0xb814('0x3c')](_0xe14249);_0x5d064b[_0xb814('0x20')](0x0);logger[_0xb814('0x7c')](_0xb814('0x7d'),_0x5d064b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')]['query'](_0x5d064b[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')]['SELECT']});}})[_0xb814('0x28')](respondWithResult(_0x29a127,null))[_0xb814('0x44')](handleError(_0x29a127,null));};function runReport(_0x58d56c,_0x10a90d,_0x583f26){var _0x37adec=_0x10a90d[_0xb814('0x2e')];var _0x4e15c2=0xa;var _0x5a0c4a=[_0xb814('0x50'),_0xb814('0x81'),_0xb814('0x82'),_0xb814('0x51')];var _0x220f8b={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':_0xb814('0x83'),'MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x52b6da={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1fb1ea=function(_0x31c072){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x31c072);};var _0x5cf5ad=function(_0x20efc3){if(!_0x20efc3||!_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x30faa0='(',_0x55ceb8=0x0;_0x55ceb8<_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')];_0x55ceb8+=0x1){_0x55ceb8>0x0&&(_0x30faa0+='\x20'+_0x20efc3[_0xb814('0x84')]+'\x20');_0x30faa0+=_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x64')]?_0x5cf5ad(_0x20efc3['rules'][_0x55ceb8]['group']):_0x20efc3[_0xb814('0x63')][_0x55ceb8]['field']+'\x20'+_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x66')]+(_0x1fb1ea(_0x20efc3['rules'][_0x55ceb8][_0xb814('0x66')])?'\x20'+_0x20efc3['rules'][_0x55ceb8][_0xb814('0x85')]:'');}return _0x30faa0+')';};var _0x520d0f={'where':{'id':_0x58d56c['id']}},_0x44e668,_0x1aff2b,_0x41867b,_0x2c3948,_0x2d8899;_0x520d0f=_[_0xb814('0x40')]({},_0x520d0f,_0x583f26);return db[_0xb814('0x31')]['find'](_0x520d0f)['then'](function(_0x21aa36){if(_0x21aa36){_0x44e668=_0x21aa36;return _0x21aa36['getFields']();}return null;})['then'](function(_0x2d0061){if(_0x2d0061){if(!_0x2d0061[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))]['ValidationErrorItem'](_0xb814('0x69'),0x193);}_0x1aff2b=_0x2d0061;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x14ec54){if(_0x14ec54){_0x41867b=_[_0xb814('0x87')](_0x14ec54,'id');var _0x4c8a00;var _0x1454b3=squel[_0xb814('0x6b')]();_0x1454b3[_0xb814('0x88')](_0x44e668['table']);for(var _0x1ebbf6=0x0;_0x1ebbf6<_0x1aff2b[_0xb814('0x3a')];_0x1ebbf6+=0x1){_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x6d')]?_0x41867b[_0x1aff2b[_0x1ebbf6]['MetricId']][_0xb814('0x6e')]:_0x1aff2b[_0x1ebbf6][_0xb814('0x65')];_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]?_[_0xb814('0x6f')](_0x220f8b[_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]],'%s',_0x4c8a00):_0x4c8a00;_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x52b6da[_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]],'%s',_0x4c8a00):_0x4c8a00;if(_0x1aff2b[_0x1ebbf6][_0xb814('0x89')]){_0x1454b3[_0xb814('0x64')](_0x4c8a00);}_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]&&_0x1454b3[_0xb814('0x3d')](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]==='DESC'?![]:!![]);_0x1454b3['field'](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x74')]||_0x4c8a00);}if(_0x44e668['joins']){_0x44e668[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x44e668[_0xb814('0x75')]);for(var _0x2bc95b=0x0;_0x2bc95b<_0x44e668[_0xb814('0x75')][_0xb814('0x3a')];_0x2bc95b+=0x1){if(_0x44e668[_0xb814('0x75')][_0x2bc95b]['type']&&_['includes'](_0x5a0c4a,_0x44e668[_0xb814('0x75')][_0x2bc95b]['type'])&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')]&&_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable']&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]){_0x1454b3[_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x33')]](_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],null,util[_0xb814('0x71')](_0xb814('0x8a'),_0x44e668['table'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')],_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]));}}}if(_0x44e668['conditions']){_0x44e668[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x44e668['conditions']);_0x1454b3[_0xb814('0x3e')](_0x5cf5ad(_0x44e668[_0xb814('0x7a')][_0xb814('0x64')]));}_0x2d8899=_0x1454b3[_0xb814('0x7b')]();_0x1454b3[_0xb814('0x3c')](_0x4e15c2);_0x1454b3[_0xb814('0x20')](0x0);return;}})[_0xb814('0x28')](function(){if(_0x10a90d[_0xb814('0x8b')]===_0xb814('0x8c')){return null;}var _0x1f8c7a=_[_0xb814('0x40')](_0x10a90d,{'name':_0x10a90d[_0xb814('0x8d')]||_0x10a90d['name']||_0x44e668['name'],'basename':_0x37adec,'savename':util[_0xb814('0x71')]('%s-%s.%s',_0x10a90d['name']||_0x44e668[_0xb814('0x2e')],require('randomstring')['generate'](0x4),_0x10a90d['output']||_0xb814('0x8e')),'reportId':_0x44e668['id'],'reportType':_0xb814('0x8f')});return db[_0xb814('0x90')]['create'](_0x1f8c7a,{'raw':!![]});})[_0xb814('0x28')](function(_0x4dbe89){if(_0x44e668[_0xb814('0x6c')]===_0xb814('0x91')){_0x2d8899['where'](_0x44e668[_0xb814('0x6c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}else{_0x2d8899[_0xb814('0x3e')](_0x44e668[_0xb814('0x6c')]+_0xb814('0x94'),_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}if(_0x4dbe89){logger[_0xb814('0x95')](_0xb814('0x96'),_0x2d8899[_0xb814('0x7e')]());require(_0xb814('0x97'))[_0xb814('0x98')](path[_0xb814('0x50')](__dirname,_0xb814('0x99'),_0x4dbe89[_0xb814('0x8b')]),[_0x4dbe89['id'],_0x2d8899['toString'](),path[_0xb814('0x50')](__dirname,_0xb814('0x9a'),_0x4dbe89['savename']),_0x37adec]);return _0x4dbe89;}else{var _0x2c7cd6=squel[_0xb814('0x6b')]();_0x2c7cd6[_0xb814('0x88')]('('+_0x2d8899['toString']()+')','countTable');_0x2c7cd6[_0xb814('0x65')]('COUNT(*)',_0xb814('0x22'));_0x2d8899['limit'](_0x10a90d[_0xb814('0x3c')]||_0x4e15c2);_0x2d8899['offset'](_0x10a90d['offset']||0x0);return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x2c7cd6[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]})[_0xb814('0x28')](function(_0x4543c3){if(!_0x4543c3[_0xb814('0x3a')]){_0x2c3948=0x0;}else{_0x2c3948=_0x4543c3[0x0][_0xb814('0x22')]||0x0;}return dbH[_0xb814('0x7f')]['query'](_0x2d8899[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')][_0xb814('0x9b')]});})[_0xb814('0x28')](function(_0x4fde6a){return{'rows':_0x4fde6a||[],'count':_0x2c3948};});}});}exports[_0xb814('0x9c')]=function(_0x18fb74,_0x371e92){return runReport(_0x18fb74[_0xb814('0x46')],_0x18fb74[_0xb814('0x35')],_0x18fb74[_0xb814('0x41')])[_0xb814('0x28')](respondWithResult(_0x371e92,null))[_0xb814('0x44')](handleError(_0x371e92,null));};exports[_0xb814('0x9d')]=runReport;exports[_0xb814('0x35')]=function(_0x3b65c0,_0x11e0c3){var _0x22c811=0xa;var _0x3fd24c=[_0xb814('0x50'),'left_join',_0xb814('0x82'),_0xb814('0x51')];var _0x3e61eb={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x5be0bb={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1bd9ab=function(_0x20e608){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),'IS\x20NOT\x20EMPTY'],_0x20e608);};var _0x2a5dff=function(_0x553635){if(!_0x553635||!_0x553635[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x35e8f7='(',_0xa7ff62=0x0;_0xa7ff62<_0x553635[_0xb814('0x63')][_0xb814('0x3a')];_0xa7ff62+=0x1){_0xa7ff62>0x0&&(_0x35e8f7+='\x20'+_0x553635[_0xb814('0x84')]+'\x20');_0x35e8f7+=_0x553635[_0xb814('0x63')][_0xa7ff62]['group']?_0x2a5dff(_0x553635['rules'][_0xa7ff62]['group']):_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x65')]+'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')]+(_0x1bd9ab(_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')])?'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x85')]:'');}return _0x35e8f7+')';};var _0x41847e={'where':{'id':_0x3b65c0[_0xb814('0x46')]['id']}},_0x1a5685,_0x51313d,_0x5c989a,_0x41486b,_0x16c05b;_0x41847e=_[_0xb814('0x40')]({},_0x41847e,_0x3b65c0[_0xb814('0x41')]);return db[_0xb814('0x31')]['find'](_0x41847e)[_0xb814('0x28')](function(_0x52899a){if(_0x52899a){_0x1a5685=_0x52899a;return _0x52899a[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x205c6c){if(_0x205c6c){if(!_0x205c6c[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x51313d=_0x205c6c;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x1f04eb){if(_0x1f04eb){_0x5c989a=_[_0xb814('0x87')](_0x1f04eb,'id');var _0x4a1c4e;var _0x17c63b=squel[_0xb814('0x6b')]();_0x17c63b[_0xb814('0x88')](_0x1a5685[_0xb814('0x6c')]);for(var _0xa66ca3=0x0;_0xa66ca3<_0x51313d['length'];_0xa66ca3+=0x1){_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x6d')]?_0x5c989a[_0x51313d[_0xa66ca3][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x51313d[_0xa66ca3]['field'];_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x70')]?_['replace'](_0x3e61eb[_0x51313d[_0xa66ca3][_0xb814('0x70')]],'%s',_0x4a1c4e):_0x4a1c4e;_0x4a1c4e=_0x51313d[_0xa66ca3]['format']?_[_0xb814('0x6f')](_0x5be0bb[_0x51313d[_0xa66ca3][_0xb814('0x71')]],'%s',_0x4a1c4e):_0x4a1c4e;if(_0x51313d[_0xa66ca3][_0xb814('0x89')]){_0x17c63b[_0xb814('0x64')](_0x4a1c4e);}_0x51313d[_0xa66ca3]['orderBy']&&_0x17c63b[_0xb814('0x3d')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x17c63b[_0xb814('0x65')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x74')]||_0x4a1c4e);}if(_0x1a5685[_0xb814('0x75')]){_0x1a5685[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x75')]);for(var _0x152260=0x0;_0x152260<_0x1a5685[_0xb814('0x75')][_0xb814('0x3a')];_0x152260+=0x1){if(_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]&&_[_0xb814('0x5e')](_0x3fd24c,_0x1a5685['joins'][_0x152260][_0xb814('0x33')])&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')]&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')]&&_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']){_0x17c63b[_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]](_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1a5685[_0xb814('0x6c')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']));}}}if(_0x1a5685[_0xb814('0x7a')]){_0x1a5685[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x7a')]);_0x17c63b['where'](_0x2a5dff(_0x1a5685[_0xb814('0x7a')][_0xb814('0x64')]));}_0x16c05b=_0x17c63b[_0xb814('0x7b')]();_0x17c63b[_0xb814('0x3c')](_0x22c811);_0x17c63b[_0xb814('0x20')](0x0);logger['debug'](_0xb814('0x7d'),_0x17c63b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x17c63b[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]});}})[_0xb814('0x28')](function(){return{'sql':_0x16c05b[_0xb814('0x7e')]()};})[_0xb814('0x28')](respondWithResult(_0x11e0c3,null))[_0xb814('0x44')](handleError(_0x11e0c3,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 8787506..1ceab69 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 _0x0e10=['../../config/logger','bluebird','request-promise','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','util'];(function(_0x2679b0,_0x2a1a6f){var _0x192302=function(_0x258202){while(--_0x258202){_0x2679b0['push'](_0x2679b0['shift']());}};_0x192302(++_0x2a1a6f);}(_0x0e10,0x104));var _0x00e1=function(_0x3ab47f,_0x30a6be){_0x3ab47f=_0x3ab47f-0x0;var _0x570c12=_0x0e10[_0x3ab47f];return _0x570c12;};'use strict';var _=require('lodash');var util=require(_0x00e1('0x0'));var logger=require(_0x00e1('0x1'))('api');var moment=require('moment');var BPromise=require(_0x00e1('0x2'));var rp=require(_0x00e1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x00e1('0x4'));var attributes=require(_0x00e1('0x5'));module[_0x00e1('0x6')]=function(_0x35305c,_0x5c9f9e){return _0x35305c[_0x00e1('0x7')](_0x00e1('0x8'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x88c2=['request-promise','../../config/environment','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger'];(function(_0x243217,_0x522951){var _0x478029=function(_0x18d053){while(--_0x18d053){_0x243217['push'](_0x243217['shift']());}};_0x478029(++_0x522951);}(_0x88c2,0xbd));var _0x288c=function(_0x4cba56,_0x5b2c44){_0x4cba56=_0x4cba56-0x0;var _0x3cc9f3=_0x88c2[_0x4cba56];return _0x3cc9f3;};'use strict';var _=require(_0x288c('0x0'));var util=require(_0x288c('0x1'));var logger=require(_0x288c('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x288c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x288c('0x4'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x1549f6,_0x3685ff){return _0x1549f6[_0x288c('0x5')](_0x288c('0x6'),attributes,{'tableName':_0x288c('0x7'),'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 e49ec24..9d6d77e 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 _0x19a3=['moment','bluebird','randomstring','../../config/utils','../../config/logger','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0x19a3,0x124));var _0x319a=function(_0x4ac98b,_0x33edf2){_0x4ac98b=_0x4ac98b-0x0;var _0x335257=_0x19a3[_0x4ac98b];return _0x335257;};'use strict';var _=require(_0x319a('0x0'));var util=require(_0x319a('0x1'));var moment=require(_0x319a('0x2'));var BPromise=require(_0x319a('0x3'));var rs=require(_0x319a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x319a('0x5'));var logger=require(_0x319a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x319a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x415e8a,_0x1c9edb,_0x923c5b){return new BPromise(function(_0x36c443,_0x195a81){return client[_0x319a('0x8')](_0x415e8a,_0x923c5b)[_0x319a('0x9')](function(_0x496e1b){logger[_0x319a('0xa')](_0x319a('0xb'),_0x1c9edb,_0x319a('0xc'));logger[_0x319a('0xd')](_0x319a('0xe'),_0x1c9edb,_0x319a('0xc'),JSON[_0x319a('0xf')](_0x496e1b));if(_0x496e1b[_0x319a('0x10')]){if(_0x496e1b[_0x319a('0x10')][_0x319a('0x11')]===0x1f4){logger[_0x319a('0x10')](_0x319a('0xb'),_0x1c9edb,_0x496e1b[_0x319a('0x10')][_0x319a('0x12')]);return _0x195a81(_0x496e1b['error'][_0x319a('0x12')]);}logger[_0x319a('0x10')](_0x319a('0xb'),_0x1c9edb,_0x496e1b[_0x319a('0x10')]['message']);return _0x36c443(_0x496e1b[_0x319a('0x10')][_0x319a('0x12')]);}else{logger[_0x319a('0xa')](_0x319a('0xb'),_0x1c9edb,'request\x20sent');_0x36c443(_0x496e1b[_0x319a('0x13')]['message']);}})[_0x319a('0x14')](function(_0x10ec99){logger['error'](_0x319a('0xb'),_0x1c9edb,_0x10ec99);_0x195a81(_0x10ec99);});});} \ No newline at end of file +var _0x4348=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x4e4b17,_0x2b8fc2){var _0x290beb=function(_0x47180c){while(--_0x47180c){_0x4e4b17['push'](_0x4e4b17['shift']());}};_0x290beb(++_0x2b8fc2);}(_0x4348,0xa2));var _0x8434=function(_0x39eddc,_0x506997){_0x39eddc=_0x39eddc-0x0;var _0x5fa131=_0x4348[_0x39eddc];return _0x5fa131;};'use strict';var _=require(_0x8434('0x0'));var util=require(_0x8434('0x1'));var moment=require(_0x8434('0x2'));var BPromise=require('bluebird');var rs=require(_0x8434('0x3'));var fs=require('fs');var Redis=require(_0x8434('0x4'));var db=require(_0x8434('0x5'))['db'];var utils=require(_0x8434('0x6'));var logger=require(_0x8434('0x7'))(_0x8434('0x8'));var config=require('../../config/environment');var jayson=require(_0x8434('0x9'));var client=jayson['client'][_0x8434('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x110344,_0x5c5d47,_0xb317a8){return new BPromise(function(_0x5788da,_0x275b8c){return client['request'](_0x110344,_0xb317a8)['then'](function(_0x38d21d){logger[_0x8434('0xb')](_0x8434('0xc'),_0x5c5d47,_0x8434('0xd'));logger[_0x8434('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x5c5d47,'request\x20sent',JSON[_0x8434('0xf')](_0x38d21d));if(_0x38d21d['error']){if(_0x38d21d['error']['code']===0x1f4){logger['error'](_0x8434('0xc'),_0x5c5d47,_0x38d21d[_0x8434('0x10')][_0x8434('0x11')]);return _0x275b8c(_0x38d21d['error'][_0x8434('0x11')]);}logger[_0x8434('0x10')](_0x8434('0xc'),_0x5c5d47,_0x38d21d[_0x8434('0x10')][_0x8434('0x11')]);return _0x5788da(_0x38d21d[_0x8434('0x10')][_0x8434('0x11')]);}else{logger[_0x8434('0xb')](_0x8434('0xc'),_0x5c5d47,_0x8434('0xd'));_0x5788da(_0x38d21d[_0x8434('0x12')][_0x8434('0x11')]);}})[_0x8434('0x13')](function(_0x3729f8){logger[_0x8434('0x10')](_0x8434('0xc'),_0x5c5d47,_0x3729f8);_0x275b8c(_0x3729f8);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index c36f39c..2448a8f 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 _0xbcf1=['/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0xbcf1,0x18d));var _0x1bcf=function(_0x286bfb,_0x46ac3c){_0x286bfb=_0x286bfb-0x0;var _0x52b683=_0xbcf1[_0x286bfb];return _0x52b683;};'use strict';var multer=require(_0x1bcf('0x0'));var util=require(_0x1bcf('0x1'));var path=require(_0x1bcf('0x2'));var timeout=require(_0x1bcf('0x3'));var express=require(_0x1bcf('0x4'));var router=express[_0x1bcf('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1bcf('0x6'));var interaction=require(_0x1bcf('0x7'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0x1bcf('0x8')]('/',auth[_0x1bcf('0x9')](),controller[_0x1bcf('0xa')]);router[_0x1bcf('0x8')](_0x1bcf('0xb'),auth['isAuthenticated'](),controller[_0x1bcf('0xc')]);router['get'](_0x1bcf('0xd'),auth[_0x1bcf('0x9')](),controller[_0x1bcf('0xe')]);router[_0x1bcf('0x8')](_0x1bcf('0xf'),auth['isAuthenticated'](),controller[_0x1bcf('0x10')]);router['get'](_0x1bcf('0x11'),auth[_0x1bcf('0x9')](),controller['query']);router['post']('/',auth[_0x1bcf('0x9')](),controller[_0x1bcf('0x12')]);router[_0x1bcf('0x13')](_0x1bcf('0xb'),auth['isAuthenticated'](),controller[_0x1bcf('0x14')]);router[_0x1bcf('0x15')](_0x1bcf('0xb'),auth[_0x1bcf('0x9')](),controller[_0x1bcf('0x16')]);module[_0x1bcf('0x17')]=router; \ No newline at end of file +var _0xcfa1=['./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x21e996,_0x3e86d1){var _0x5a9243=function(_0x450a00){while(--_0x450a00){_0x21e996['push'](_0x21e996['shift']());}};_0x5a9243(++_0x3e86d1);}(_0xcfa1,0x99));var _0x1cfa=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xcfa1[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0x1cfa('0x0'));var util=require(_0x1cfa('0x1'));var path=require(_0x1cfa('0x2'));var timeout=require(_0x1cfa('0x3'));var express=require(_0x1cfa('0x4'));var router=express['Router']();var fs_extra=require(_0x1cfa('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1cfa('0x6'));var config=require(_0x1cfa('0x7'));var controller=require(_0x1cfa('0x8'));router[_0x1cfa('0x9')]('/',auth[_0x1cfa('0xa')](),controller[_0x1cfa('0xb')]);router[_0x1cfa('0x9')](_0x1cfa('0xc'),auth[_0x1cfa('0xa')](),controller[_0x1cfa('0xd')]);router[_0x1cfa('0x9')](_0x1cfa('0xe'),auth[_0x1cfa('0xa')](),controller[_0x1cfa('0xf')]);router[_0x1cfa('0x9')]('/:id/run',auth['isAuthenticated'](),controller[_0x1cfa('0x10')]);router['get']('/:id/query',auth[_0x1cfa('0xa')](),controller['query']);router[_0x1cfa('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1cfa('0x12')](_0x1cfa('0xc'),auth['isAuthenticated'](),controller[_0x1cfa('0x13')]);router[_0x1cfa('0x14')]('/:id',auth[_0x1cfa('0xa')](),controller[_0x1cfa('0x15')]);module[_0x1cfa('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index cd75719..c1bcb0a 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 _0x8804=['pdf','xlsx','DATE','Loading','manual','INTEGER','sequelize','moment','exports','STRING','ENUM','csv'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x8804,0x132));var _0x4880=function(_0x48045a,_0x407f21){_0x48045a=_0x48045a-0x0;var _0x261298=_0x8804[_0x48045a];return _0x261298;};'use strict';var Sequelize=require(_0x4880('0x0'));var moment=require(_0x4880('0x1'));module[_0x4880('0x2')]={'name':{'type':Sequelize[_0x4880('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x4880('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x4880('0x4')](_0x4880('0x5'),_0x4880('0x6'),_0x4880('0x7')),'allowNull':![],'defaultValue':_0x4880('0x5')},'savename':{'type':Sequelize[_0x4880('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x4880('0x8')]},'status':{'type':Sequelize[_0x4880('0x3')],'defaultValue':_0x4880('0x9')},'type':{'type':Sequelize['ENUM'](_0x4880('0xa'),'scheduled'),'allowNull':![],'defaultValue':_0x4880('0xa')},'reportId':{'type':Sequelize[_0x4880('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x4880('0x3')]}}; \ No newline at end of file +var _0x3ff0=['exports','STRING','ENUM','csv','pdf','xlsx','DATE','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x3ff0,0xce));var _0x03ff=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0x3ff0[_0x4ae625];return _0x31accf;};'use strict';var Sequelize=require(_0x03ff('0x0'));var moment=require(_0x03ff('0x1'));module[_0x03ff('0x2')]={'name':{'type':Sequelize[_0x03ff('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x03ff('0x4')](_0x03ff('0x5'),_0x03ff('0x6'),_0x03ff('0x7')),'allowNull':![],'defaultValue':_0x03ff('0x5')},'savename':{'type':Sequelize[_0x03ff('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x03ff('0x8')]},'endDate':{'type':Sequelize[_0x03ff('0x8')]},'status':{'type':Sequelize[_0x03ff('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x03ff('0x4')](_0x03ff('0x9'),_0x03ff('0xa')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x03ff('0xb')](0xb)[_0x03ff('0xc')]},'reportType':{'type':Sequelize[_0x03ff('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 92adc6a..e0d9c5b 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 _0x564f=['fieldName','key','keys','query','filters','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','merge','options','includeAll','include','findAll','rows','catch','show','params','intersection','create','body','role','user','ExtractedReports','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','download','basename','savename','output','existsSync','join','server/files/reports','Sequelize','ValidationError','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes'];(function(_0x367873,_0x35e012){var _0x2aa5fa=function(_0x320e96){while(--_0x320e96){_0x367873['push'](_0x367873['shift']());}};_0x2aa5fa(++_0x35e012);}(_0x564f,0xe7));var _0xf564=function(_0xfe7ca7,_0x45c035){_0xfe7ca7=_0xfe7ca7-0x0;var _0x302a10=_0x564f[_0xfe7ca7];return _0x302a10;};'use strict';var emlformat=require(_0xf564('0x0'));var rimraf=require(_0xf564('0x1'));var zipdir=require(_0xf564('0x2'));var jsonpatch=require(_0xf564('0x3'));var rp=require(_0xf564('0x4'));var moment=require(_0xf564('0x5'));var BPromise=require(_0xf564('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf564('0x7'));var sox=require('sox');var csv=require(_0xf564('0x8'));var ejs=require(_0xf564('0x9'));var fs=require('fs');var fs_extra=require(_0xf564('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf564('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf564('0xc'));var toCsv=require(_0xf564('0x8'));var querystring=require(_0xf564('0xd'));var Papa=require(_0xf564('0xe'));var Redis=require(_0xf564('0xf'));var authService=require(_0xf564('0x10'));var qs=require(_0xf564('0x11'));var as=require(_0xf564('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf564('0x13'))(_0xf564('0x14'));var utils=require('../../config/utils');var config=require(_0xf564('0x15'));var licenseUtil=require(_0xf564('0x16'));var db=require(_0xf564('0x17'))['db'];function respondWithStatusCode(_0x374b11,_0x432717){_0x432717=_0x432717||0xcc;return function(_0x2ee7c4){if(_0x2ee7c4){return _0x374b11[_0xf564('0x18')](_0x432717);}return _0x374b11[_0xf564('0x19')](_0x432717)[_0xf564('0x1a')]();};}function respondWithResult(_0x1a44c3,_0x1c3565){_0x1c3565=_0x1c3565||0xc8;return function(_0x26ad1d){if(_0x26ad1d){return _0x1a44c3[_0xf564('0x19')](_0x1c3565)[_0xf564('0x1b')](_0x26ad1d);}};}function respondWithFilteredResult(_0x2f7741,_0x285b3d){return function(_0x181111){if(_0x181111){var _0x50e341=typeof _0x285b3d['offset']===_0xf564('0x1c')&&typeof _0x285b3d[_0xf564('0x1d')]===_0xf564('0x1c');var _0x1bf08a=_0x181111[_0xf564('0x1e')];var _0x189df9=_0x50e341?0x0:_0x285b3d[_0xf564('0x1f')];var _0x5f5465=_0x50e341?_0x181111[_0xf564('0x1e')]:_0x285b3d['offset']+_0x285b3d[_0xf564('0x1d')];var _0x514fab;if(_0x5f5465>=_0x1bf08a){_0x5f5465=_0x1bf08a;_0x514fab=0xc8;}else{_0x514fab=0xce;}_0x2f7741[_0xf564('0x19')](_0x514fab);return _0x2f7741['set'](_0xf564('0x20'),_0x189df9+'-'+_0x5f5465+'/'+_0x1bf08a)[_0xf564('0x1b')](_0x181111);}return null;};}function patchUpdates(_0x4c8998){return function(_0x206e7d){try{jsonpatch[_0xf564('0x21')](_0x206e7d,_0x4c8998,!![]);}catch(_0x40c725){return BPromise['reject'](_0x40c725);}return _0x206e7d[_0xf564('0x22')]();};}function saveUpdates(_0x36d909,_0x18a302){return function(_0x4e9835){if(_0x4e9835){return _0x4e9835[_0xf564('0x23')](_0x36d909)[_0xf564('0x24')](function(_0x293609){return _0x293609;});}return null;};}function removeEntity(_0x2fa668,_0x120b98){return function(_0x212827){if(_0x212827){return _0x212827[_0xf564('0x25')]()[_0xf564('0x24')](function(){var _0x475171=_0x212827[_0xf564('0x26')]({'plain':!![]});var _0x305b4f='ExtractedReports';return db[_0xf564('0x27')][_0xf564('0x25')]({'where':{'type':_0x305b4f,'resourceId':_0x475171['id']}})['then'](function(){return _0x212827;});})['then'](function(){_0x2fa668[_0xf564('0x19')](0xcc)[_0xf564('0x1a')]();});}};}function handleEntityNotFound(_0x10523a,_0x1703ae){return function(_0x249452){if(!_0x249452){_0x10523a[_0xf564('0x18')](0x194);}return _0x249452;};}function handleError(_0x48d7db,_0x44d9ae){_0x44d9ae=_0x44d9ae||0x1f4;return function(_0x2dc0e8){logger[_0xf564('0x28')](_0x2dc0e8[_0xf564('0x29')]);if(_0x2dc0e8[_0xf564('0x2a')]){delete _0x2dc0e8[_0xf564('0x2a')];}_0x48d7db[_0xf564('0x19')](_0x44d9ae)[_0xf564('0x2b')](_0x2dc0e8);};}exports[_0xf564('0x2c')]=function(_0x460f12,_0x31074c){var _0x2d2d99={},_0x35e820={},_0x413396={'count':0x0,'rows':[]};var _0x570eb7=_[_0xf564('0x2d')](db[_0xf564('0x2e')][_0xf564('0x2f')],function(_0x58b42e){return{'name':_0x58b42e[_0xf564('0x30')],'type':_0x58b42e['type'][_0xf564('0x31')]};});_0x35e820['model']=_[_0xf564('0x2d')](_0x570eb7,'name');_0x35e820['query']=_[_0xf564('0x32')](_0x460f12[_0xf564('0x33')]);_0x35e820[_0xf564('0x34')]=_['intersection'](_0x35e820[_0xf564('0x35')],_0x35e820[_0xf564('0x33')]);_0x2d2d99[_0xf564('0x36')]=_['intersection'](_0x35e820[_0xf564('0x35')],qs[_0xf564('0x37')](_0x460f12[_0xf564('0x33')][_0xf564('0x37')]));_0x2d2d99[_0xf564('0x36')]=_0x2d2d99[_0xf564('0x36')][_0xf564('0x38')]?_0x2d2d99[_0xf564('0x36')]:_0x35e820[_0xf564('0x35')];if(!_0x460f12[_0xf564('0x33')][_0xf564('0x39')]('nolimit')){_0x2d2d99[_0xf564('0x1d')]=qs[_0xf564('0x1d')](_0x460f12[_0xf564('0x33')]['limit']);_0x2d2d99[_0xf564('0x1f')]=qs['offset'](_0x460f12[_0xf564('0x33')][_0xf564('0x1f')]);}_0x2d2d99[_0xf564('0x3a')]=qs[_0xf564('0x3b')](_0x460f12['query'][_0xf564('0x3b')]);_0x2d2d99[_0xf564('0x3c')]=qs[_0xf564('0x34')](_[_0xf564('0x3d')](_0x460f12[_0xf564('0x33')],_0x35e820[_0xf564('0x34')]),_0x570eb7);if(_0x460f12[_0xf564('0x33')][_0xf564('0x3e')]){_0x2d2d99['where']=_['merge'](_0x2d2d99[_0xf564('0x3c')],{'$or':_[_0xf564('0x2d')](_0x570eb7,function(_0x442ffa){if(_0x442ffa[_0xf564('0x3f')]!=='VIRTUAL'){var _0x501912={};_0x501912[_0x442ffa[_0xf564('0x2a')]]={'$like':'%'+_0x460f12[_0xf564('0x33')][_0xf564('0x3e')]+'%'};return _0x501912;}})});}_0x2d2d99=_[_0xf564('0x40')]({},_0x2d2d99,_0x460f12[_0xf564('0x41')]);var _0x2a1fda={'where':_0x2d2d99['where']};return db[_0xf564('0x2e')][_0xf564('0x1e')](_0x2a1fda)[_0xf564('0x24')](function(_0x668774){_0x413396[_0xf564('0x1e')]=_0x668774;if(_0x460f12['query'][_0xf564('0x42')]){_0x2d2d99[_0xf564('0x43')]=[{'all':!![]}];}return db[_0xf564('0x2e')][_0xf564('0x44')](_0x2d2d99);})[_0xf564('0x24')](function(_0x513ea2){_0x413396[_0xf564('0x45')]=_0x513ea2;return _0x413396;})['then'](respondWithFilteredResult(_0x31074c,_0x2d2d99))[_0xf564('0x46')](handleError(_0x31074c,null));};exports[_0xf564('0x47')]=function(_0x2cb04e,_0x3198cd){var _0x2944f7={'raw':!![],'where':{'id':_0x2cb04e[_0xf564('0x48')]['id']}},_0x3d0306={};_0x3d0306[_0xf564('0x35')]=_[_0xf564('0x32')](db['AnalyticExtractedReport'][_0xf564('0x2f')]);_0x3d0306[_0xf564('0x33')]=_['keys'](_0x2cb04e[_0xf564('0x33')]);_0x3d0306[_0xf564('0x34')]=_[_0xf564('0x49')](_0x3d0306[_0xf564('0x35')],_0x3d0306['query']);_0x2944f7[_0xf564('0x36')]=_[_0xf564('0x49')](_0x3d0306[_0xf564('0x35')],qs[_0xf564('0x37')](_0x2cb04e['query'][_0xf564('0x37')]));_0x2944f7[_0xf564('0x36')]=_0x2944f7[_0xf564('0x36')]['length']?_0x2944f7[_0xf564('0x36')]:_0x3d0306[_0xf564('0x35')];if(_0x2cb04e['query']['includeAll']){_0x2944f7['include']=[{'all':!![]}];}_0x2944f7=_[_0xf564('0x40')]({},_0x2944f7,_0x2cb04e[_0xf564('0x41')]);return db['AnalyticExtractedReport']['find'](_0x2944f7)['then'](handleEntityNotFound(_0x3198cd,null))[_0xf564('0x24')](respondWithResult(_0x3198cd,null))[_0xf564('0x46')](handleError(_0x3198cd,null));};exports['create']=function(_0x136138,_0x25ac07){return db[_0xf564('0x2e')][_0xf564('0x4a')](_0x136138[_0xf564('0x4b')],{})['then'](function(_0x3fdd9e){var _0x2744f9=_0x136138['user'][_0xf564('0x26')]({'plain':!![]});if(!_0x2744f9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2744f9[_0xf564('0x4c')]===_0xf564('0x4d')){var _0x2f17af=_0x3fdd9e[_0xf564('0x26')]({'plain':!![]});var _0x3a3d3b=_0xf564('0x4e');return db[_0xf564('0x4f')]['find']({'where':{'name':_0x3a3d3b,'userProfileId':_0x2744f9['userProfileId']},'raw':!![]})['then'](function(_0x8ad11f){if(_0x8ad11f&&_0x8ad11f['autoAssociation']===0x0){return db[_0xf564('0x27')][_0xf564('0x4a')]({'name':_0x2f17af[_0xf564('0x2a')],'resourceId':_0x2f17af['id'],'type':_0x8ad11f['name'],'sectionId':_0x8ad11f['id']},{})[_0xf564('0x24')](function(){return _0x3fdd9e;});}else{return _0x3fdd9e;}})[_0xf564('0x46')](function(_0x54ceec){logger['error'](_0xf564('0x50'),_0x54ceec);throw _0x54ceec;});}return _0x3fdd9e;})[_0xf564('0x24')](respondWithResult(_0x25ac07,0xc9))['catch'](handleError(_0x25ac07,null));};exports[_0xf564('0x23')]=function(_0x11edf9,_0x4e49a8){if(_0x11edf9[_0xf564('0x4b')]['id']){delete _0x11edf9['body']['id'];}return db[_0xf564('0x2e')]['find']({'where':{'id':_0x11edf9[_0xf564('0x48')]['id']}})[_0xf564('0x24')](handleEntityNotFound(_0x4e49a8,null))[_0xf564('0x24')](saveUpdates(_0x11edf9[_0xf564('0x4b')],null))[_0xf564('0x24')](respondWithResult(_0x4e49a8,null))['catch'](handleError(_0x4e49a8,null));};exports['destroy']=function(_0x301a67,_0x468f35){return db[_0xf564('0x2e')][_0xf564('0x51')]({'where':{'id':_0x301a67[_0xf564('0x48')]['id']}})[_0xf564('0x24')](handleEntityNotFound(_0x468f35,null))['then'](removeEntity(_0x468f35,null))['catch'](handleError(_0x468f35,null));};exports[_0xf564('0x52')]=function(_0x4b791c,_0x2f99a7,_0xa2524a){return db[_0xf564('0x2e')][_0xf564('0x51')]({'where':{'id':_0x4b791c['params']['id']},'attributes':['name',_0xf564('0x53'),_0xf564('0x54'),_0xf564('0x55')],'raw':!![]})[_0xf564('0x24')](handleEntityNotFound(_0x2f99a7,null))['then'](function(_0x560192){if(_0x560192){if(!fs[_0xf564('0x56')](path[_0xf564('0x57')](config['root'],_0xf564('0x58'),_0x560192[_0xf564('0x54')]))){throw new db[(_0xf564('0x59'))][(_0xf564('0x5a'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x4b791c[_0xf564('0x33')]['exists']){return _0x2f99a7[_0xf564('0x18')](0xc8);}return _0x2f99a7[_0xf564('0x52')](path[_0xf564('0x57')](config['root'],_0xf564('0x58'),_0x560192[_0xf564('0x54')]),util['format'](_0xf564('0x5b'),_0x560192[_0xf564('0x53')]||_0x560192[_0xf564('0x2a')],_0x560192['output'][_0xf564('0x5c')]()));}})[_0xf564('0x46')](handleError(_0x2f99a7,null));}; \ No newline at end of file +var _0x2a3d=['UserProfileResource','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','AnalyticExtractedReport','includeAll','include','findAll','rows','catch','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','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','destroy','get'];(function(_0x2ca851,_0x4343d7){var _0x1a1371=function(_0x363577){while(--_0x363577){_0x2ca851['push'](_0x2ca851['shift']());}};_0x1a1371(++_0x4343d7);}(_0x2a3d,0x156));var _0xd2a3=function(_0x14e200,_0x55d3e2){_0x14e200=_0x14e200-0x0;var _0x40237d=_0x2a3d[_0x14e200];return _0x40237d;};'use strict';var emlformat=require(_0xd2a3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd2a3('0x1'));var jsonpatch=require(_0xd2a3('0x2'));var rp=require(_0xd2a3('0x3'));var moment=require(_0xd2a3('0x4'));var BPromise=require(_0xd2a3('0x5'));var Mustache=require('mustache');var util=require(_0xd2a3('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd2a3('0x7'));var ejs=require(_0xd2a3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd2a3('0x9'));var crypto=require(_0xd2a3('0xa'));var jsforce=require(_0xd2a3('0xb'));var deskjs=require(_0xd2a3('0xc'));var toCsv=require(_0xd2a3('0x7'));var querystring=require('querystring');var Papa=require(_0xd2a3('0xd'));var Redis=require(_0xd2a3('0xe'));var authService=require(_0xd2a3('0xf'));var qs=require(_0xd2a3('0x10'));var as=require(_0xd2a3('0x11'));var hardwareService=require(_0xd2a3('0x12'));var logger=require(_0xd2a3('0x13'))(_0xd2a3('0x14'));var utils=require(_0xd2a3('0x15'));var config=require(_0xd2a3('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd2a3('0x17'))['db'];function respondWithStatusCode(_0x3a9a3b,_0x17fc20){_0x17fc20=_0x17fc20||0xcc;return function(_0x4f307e){if(_0x4f307e){return _0x3a9a3b[_0xd2a3('0x18')](_0x17fc20);}return _0x3a9a3b[_0xd2a3('0x19')](_0x17fc20)[_0xd2a3('0x1a')]();};}function respondWithResult(_0x280c90,_0x165465){_0x165465=_0x165465||0xc8;return function(_0x245516){if(_0x245516){return _0x280c90['status'](_0x165465)[_0xd2a3('0x1b')](_0x245516);}};}function respondWithFilteredResult(_0x57c6ec,_0x48641a){return function(_0x3137e9){if(_0x3137e9){var _0x2df2bd=typeof _0x48641a[_0xd2a3('0x1c')]==='undefined'&&typeof _0x48641a[_0xd2a3('0x1d')]===_0xd2a3('0x1e');var _0x449f89=_0x3137e9[_0xd2a3('0x1f')];var _0xe2c643=_0x2df2bd?0x0:_0x48641a[_0xd2a3('0x1c')];var _0x2cdd26=_0x2df2bd?_0x3137e9['count']:_0x48641a[_0xd2a3('0x1c')]+_0x48641a[_0xd2a3('0x1d')];var _0x45d556;if(_0x2cdd26>=_0x449f89){_0x2cdd26=_0x449f89;_0x45d556=0xc8;}else{_0x45d556=0xce;}_0x57c6ec[_0xd2a3('0x19')](_0x45d556);return _0x57c6ec[_0xd2a3('0x20')](_0xd2a3('0x21'),_0xe2c643+'-'+_0x2cdd26+'/'+_0x449f89)[_0xd2a3('0x1b')](_0x3137e9);}return null;};}function patchUpdates(_0x4ca0c5){return function(_0x226ba0){try{jsonpatch[_0xd2a3('0x22')](_0x226ba0,_0x4ca0c5,!![]);}catch(_0x24da31){return BPromise[_0xd2a3('0x23')](_0x24da31);}return _0x226ba0['save']();};}function saveUpdates(_0x72c623,_0x3ca8ae){return function(_0xc927bd){if(_0xc927bd){return _0xc927bd['update'](_0x72c623)['then'](function(_0x3cbcb6){return _0x3cbcb6;});}return null;};}function removeEntity(_0x2942f8,_0x2ab3a7){return function(_0x23c2f7){if(_0x23c2f7){return _0x23c2f7[_0xd2a3('0x24')]()['then'](function(){var _0x3a62ac=_0x23c2f7[_0xd2a3('0x25')]({'plain':!![]});var _0x4810d5='ExtractedReports';return db[_0xd2a3('0x26')][_0xd2a3('0x24')]({'where':{'type':_0x4810d5,'resourceId':_0x3a62ac['id']}})[_0xd2a3('0x27')](function(){return _0x23c2f7;});})['then'](function(){_0x2942f8[_0xd2a3('0x19')](0xcc)[_0xd2a3('0x1a')]();});}};}function handleEntityNotFound(_0x4dfbdf,_0x5abda8){return function(_0x4839b0){if(!_0x4839b0){_0x4dfbdf[_0xd2a3('0x18')](0x194);}return _0x4839b0;};}function handleError(_0x4b8f8f,_0x4261bc){_0x4261bc=_0x4261bc||0x1f4;return function(_0x69cecb){logger[_0xd2a3('0x28')](_0x69cecb[_0xd2a3('0x29')]);if(_0x69cecb[_0xd2a3('0x2a')]){delete _0x69cecb[_0xd2a3('0x2a')];}_0x4b8f8f[_0xd2a3('0x19')](_0x4261bc)['send'](_0x69cecb);};}exports[_0xd2a3('0x2b')]=function(_0x20c636,_0x1ea189){var _0x429b3f={},_0x3b8e77={},_0x50a1a2={'count':0x0,'rows':[]};var _0x3a49b2=_[_0xd2a3('0x2c')](db['AnalyticExtractedReport'][_0xd2a3('0x2d')],function(_0x2ef7f5){return{'name':_0x2ef7f5[_0xd2a3('0x2e')],'type':_0x2ef7f5[_0xd2a3('0x2f')][_0xd2a3('0x30')]};});_0x3b8e77[_0xd2a3('0x31')]=_['map'](_0x3a49b2,'name');_0x3b8e77[_0xd2a3('0x32')]=_['keys'](_0x20c636[_0xd2a3('0x32')]);_0x3b8e77['filters']=_[_0xd2a3('0x33')](_0x3b8e77['model'],_0x3b8e77[_0xd2a3('0x32')]);_0x429b3f[_0xd2a3('0x34')]=_['intersection'](_0x3b8e77[_0xd2a3('0x31')],qs[_0xd2a3('0x35')](_0x20c636[_0xd2a3('0x32')]['fields']));_0x429b3f[_0xd2a3('0x34')]=_0x429b3f[_0xd2a3('0x34')][_0xd2a3('0x36')]?_0x429b3f['attributes']:_0x3b8e77[_0xd2a3('0x31')];if(!_0x20c636[_0xd2a3('0x32')][_0xd2a3('0x37')]('nolimit')){_0x429b3f[_0xd2a3('0x1d')]=qs[_0xd2a3('0x1d')](_0x20c636[_0xd2a3('0x32')][_0xd2a3('0x1d')]);_0x429b3f['offset']=qs[_0xd2a3('0x1c')](_0x20c636[_0xd2a3('0x32')]['offset']);}_0x429b3f[_0xd2a3('0x38')]=qs['sort'](_0x20c636[_0xd2a3('0x32')][_0xd2a3('0x39')]);_0x429b3f[_0xd2a3('0x3a')]=qs[_0xd2a3('0x3b')](_['pick'](_0x20c636[_0xd2a3('0x32')],_0x3b8e77[_0xd2a3('0x3b')]),_0x3a49b2);if(_0x20c636[_0xd2a3('0x32')][_0xd2a3('0x3c')]){_0x429b3f[_0xd2a3('0x3a')]=_[_0xd2a3('0x3d')](_0x429b3f[_0xd2a3('0x3a')],{'$or':_[_0xd2a3('0x2c')](_0x3a49b2,function(_0xcee3eb){if(_0xcee3eb[_0xd2a3('0x2f')]!==_0xd2a3('0x3e')){var _0x3c1c17={};_0x3c1c17[_0xcee3eb['name']]={'$like':'%'+_0x20c636['query']['filter']+'%'};return _0x3c1c17;}})});}_0x429b3f=_['merge']({},_0x429b3f,_0x20c636[_0xd2a3('0x3f')]);var _0x3b3938={'where':_0x429b3f[_0xd2a3('0x3a')]};return db[_0xd2a3('0x40')][_0xd2a3('0x1f')](_0x3b3938)['then'](function(_0x3e0448){_0x50a1a2[_0xd2a3('0x1f')]=_0x3e0448;if(_0x20c636['query'][_0xd2a3('0x41')]){_0x429b3f[_0xd2a3('0x42')]=[{'all':!![]}];}return db[_0xd2a3('0x40')][_0xd2a3('0x43')](_0x429b3f);})[_0xd2a3('0x27')](function(_0x1e0fff){_0x50a1a2[_0xd2a3('0x44')]=_0x1e0fff;return _0x50a1a2;})[_0xd2a3('0x27')](respondWithFilteredResult(_0x1ea189,_0x429b3f))[_0xd2a3('0x45')](handleError(_0x1ea189,null));};exports[_0xd2a3('0x46')]=function(_0x5919ad,_0x1463f5){var _0x2c6c12={'raw':!![],'where':{'id':_0x5919ad[_0xd2a3('0x47')]['id']}},_0x2c8e59={};_0x2c8e59[_0xd2a3('0x31')]=_['keys'](db['AnalyticExtractedReport']['rawAttributes']);_0x2c8e59['query']=_['keys'](_0x5919ad['query']);_0x2c8e59[_0xd2a3('0x3b')]=_['intersection'](_0x2c8e59[_0xd2a3('0x31')],_0x2c8e59[_0xd2a3('0x32')]);_0x2c6c12[_0xd2a3('0x34')]=_[_0xd2a3('0x33')](_0x2c8e59[_0xd2a3('0x31')],qs[_0xd2a3('0x35')](_0x5919ad['query'][_0xd2a3('0x35')]));_0x2c6c12['attributes']=_0x2c6c12[_0xd2a3('0x34')][_0xd2a3('0x36')]?_0x2c6c12[_0xd2a3('0x34')]:_0x2c8e59[_0xd2a3('0x31')];if(_0x5919ad[_0xd2a3('0x32')]['includeAll']){_0x2c6c12['include']=[{'all':!![]}];}_0x2c6c12=_[_0xd2a3('0x3d')]({},_0x2c6c12,_0x5919ad[_0xd2a3('0x3f')]);return db[_0xd2a3('0x40')][_0xd2a3('0x48')](_0x2c6c12)[_0xd2a3('0x27')](handleEntityNotFound(_0x1463f5,null))[_0xd2a3('0x27')](respondWithResult(_0x1463f5,null))[_0xd2a3('0x45')](handleError(_0x1463f5,null));};exports[_0xd2a3('0x49')]=function(_0x388aa3,_0x167552){return db[_0xd2a3('0x40')][_0xd2a3('0x49')](_0x388aa3['body'],{})[_0xd2a3('0x27')](function(_0x27e1c3){var _0x1b6490=_0x388aa3[_0xd2a3('0x4a')]['get']({'plain':!![]});if(!_0x1b6490)throw new Error(_0xd2a3('0x4b'));if(_0x1b6490[_0xd2a3('0x4c')]===_0xd2a3('0x4a')){var _0x481add=_0x27e1c3[_0xd2a3('0x25')]({'plain':!![]});var _0x5c3cd6='ExtractedReports';return db[_0xd2a3('0x4d')][_0xd2a3('0x48')]({'where':{'name':_0x5c3cd6,'userProfileId':_0x1b6490['userProfileId']},'raw':!![]})[_0xd2a3('0x27')](function(_0x17348f){if(_0x17348f&&_0x17348f[_0xd2a3('0x4e')]===0x0){return db['UserProfileResource'][_0xd2a3('0x49')]({'name':_0x481add[_0xd2a3('0x2a')],'resourceId':_0x481add['id'],'type':_0x17348f[_0xd2a3('0x2a')],'sectionId':_0x17348f['id']},{})[_0xd2a3('0x27')](function(){return _0x27e1c3;});}else{return _0x27e1c3;}})[_0xd2a3('0x45')](function(_0x150234){logger[_0xd2a3('0x28')](_0xd2a3('0x4f'),_0x150234);throw _0x150234;});}return _0x27e1c3;})[_0xd2a3('0x27')](respondWithResult(_0x167552,0xc9))['catch'](handleError(_0x167552,null));};exports['update']=function(_0x1442d5,_0x58a4d5){if(_0x1442d5[_0xd2a3('0x50')]['id']){delete _0x1442d5[_0xd2a3('0x50')]['id'];}return db[_0xd2a3('0x40')][_0xd2a3('0x48')]({'where':{'id':_0x1442d5[_0xd2a3('0x47')]['id']}})[_0xd2a3('0x27')](handleEntityNotFound(_0x58a4d5,null))['then'](saveUpdates(_0x1442d5[_0xd2a3('0x50')],null))[_0xd2a3('0x27')](respondWithResult(_0x58a4d5,null))['catch'](handleError(_0x58a4d5,null));};exports[_0xd2a3('0x24')]=function(_0x39fc48,_0x5892a0){return db[_0xd2a3('0x40')][_0xd2a3('0x48')]({'where':{'id':_0x39fc48[_0xd2a3('0x47')]['id']}})[_0xd2a3('0x27')](handleEntityNotFound(_0x5892a0,null))[_0xd2a3('0x27')](removeEntity(_0x5892a0,null))[_0xd2a3('0x45')](handleError(_0x5892a0,null));};exports[_0xd2a3('0x51')]=function(_0x40cb10,_0x22a9b3,_0x3a53a6){return db[_0xd2a3('0x40')][_0xd2a3('0x48')]({'where':{'id':_0x40cb10[_0xd2a3('0x47')]['id']},'attributes':['name',_0xd2a3('0x52'),_0xd2a3('0x53'),_0xd2a3('0x54')],'raw':!![]})['then'](handleEntityNotFound(_0x22a9b3,null))[_0xd2a3('0x27')](function(_0xc195d9){if(_0xc195d9){if(!fs[_0xd2a3('0x55')](path[_0xd2a3('0x56')](config[_0xd2a3('0x57')],_0xd2a3('0x58'),_0xc195d9[_0xd2a3('0x53')]))){throw new db[(_0xd2a3('0x59'))][(_0xd2a3('0x5a'))](_0xd2a3('0x5b'));}if(_0x40cb10[_0xd2a3('0x32')][_0xd2a3('0x5c')]){return _0x22a9b3[_0xd2a3('0x18')](0xc8);}return _0x22a9b3[_0xd2a3('0x51')](path[_0xd2a3('0x56')](config[_0xd2a3('0x57')],_0xd2a3('0x58'),_0xc195d9[_0xd2a3('0x53')]),util[_0xd2a3('0x5d')](_0xd2a3('0x5e'),_0xc195d9[_0xd2a3('0x52')]||_0xc195d9[_0xd2a3('0x2a')],_0xc195d9[_0xd2a3('0x54')]['toLowerCase']()));}})['catch'](handleError(_0x22a9b3,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 27d613f..543fb07 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 _0x057c=['../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','../../config/logger','api','request-promise','path'];(function(_0x5e518a,_0x5d7562){var _0x3765a0=function(_0x56ee86){while(--_0x56ee86){_0x5e518a['push'](_0x5e518a['shift']());}};_0x3765a0(++_0x5d7562);}(_0x057c,0x1e6));var _0xc057=function(_0x3f4da5,_0x6a40a2){_0x3f4da5=_0x3f4da5-0x0;var _0x491103=_0x057c[_0x3f4da5];return _0x491103;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc057('0x0'))(_0xc057('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc057('0x2'));var fs=require('fs');var path=require(_0xc057('0x3'));var rimraf=require('rimraf');var config=require(_0xc057('0x4'));var attributes=require(_0xc057('0x5'));module[_0xc057('0x6')]=function(_0x56eb2d,_0x829b4d){return _0x56eb2d[_0xc057('0x7')](_0xc057('0x8'),attributes,{'tableName':_0xc057('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdbe6=['define','AnalyticExtractedReport','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports'];(function(_0xd158dc,_0x128608){var _0x12d25f=function(_0x2e9d2b){while(--_0x2e9d2b){_0xd158dc['push'](_0xd158dc['shift']());}};_0x12d25f(++_0x128608);}(_0xdbe6,0x15e));var _0x6dbe=function(_0x20f87e,_0x271ce3){_0x20f87e=_0x20f87e-0x0;var _0x2d4828=_0xdbe6[_0x20f87e];return _0x2d4828;};'use strict';var _=require(_0x6dbe('0x0'));var util=require(_0x6dbe('0x1'));var logger=require(_0x6dbe('0x2'))(_0x6dbe('0x3'));var moment=require(_0x6dbe('0x4'));var BPromise=require('bluebird');var rp=require(_0x6dbe('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6dbe('0x6'));var config=require(_0x6dbe('0x7'));var attributes=require(_0x6dbe('0x8'));module[_0x6dbe('0x9')]=function(_0x4b40b9,_0x4edae0){return _0x4b40b9[_0x6dbe('0xa')](_0x6dbe('0xb'),attributes,{'tableName':'analytics_extracted_reports','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 3f19019..a34c078 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 _0xbff2=['jayson/promise','debug','request\x20sent','stringify','error','code','message','AnalyticExtractedReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0xaf3963,_0x30a89b){var _0x450d55=function(_0x218c1e){while(--_0x218c1e){_0xaf3963['push'](_0xaf3963['shift']());}};_0x450d55(++_0x30a89b);}(_0xbff2,0x10e));var _0x2bff=function(_0x2e149d,_0x2976e7){_0x2e149d=_0x2e149d-0x0;var _0x152b76=_0xbff2[_0x2e149d];return _0x152b76;};'use strict';var _=require(_0x2bff('0x0'));var util=require(_0x2bff('0x1'));var moment=require(_0x2bff('0x2'));var BPromise=require(_0x2bff('0x3'));var rs=require(_0x2bff('0x4'));var fs=require('fs');var Redis=require(_0x2bff('0x5'));var db=require(_0x2bff('0x6'))['db'];var utils=require(_0x2bff('0x7'));var logger=require(_0x2bff('0x8'))('rpc');var config=require(_0x2bff('0x9'));var jayson=require(_0x2bff('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x48838e,_0x318d56,_0x34f4a0){return new BPromise(function(_0x4f5537,_0x1aa341){return client['request'](_0x48838e,_0x34f4a0)['then'](function(_0x172498){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x318d56,'request\x20sent');logger[_0x2bff('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x318d56,_0x2bff('0xc'),JSON[_0x2bff('0xd')](_0x172498));if(_0x172498['error']){if(_0x172498[_0x2bff('0xe')][_0x2bff('0xf')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x318d56,_0x172498[_0x2bff('0xe')][_0x2bff('0x10')]);return _0x1aa341(_0x172498['error'][_0x2bff('0x10')]);}logger[_0x2bff('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x318d56,_0x172498[_0x2bff('0xe')][_0x2bff('0x10')]);return _0x4f5537(_0x172498[_0x2bff('0xe')][_0x2bff('0x10')]);}else{logger['info'](_0x2bff('0x11'),_0x318d56,_0x2bff('0xc'));_0x4f5537(_0x172498[_0x2bff('0x12')][_0x2bff('0x10')]);}})[_0x2bff('0x13')](function(_0x3fd79e){logger['error'](_0x2bff('0x11'),_0x318d56,_0x3fd79e);_0x1aa341(_0x3fd79e);});});} \ No newline at end of file +var _0xa84d=['../../config/environment','jayson/promise','client','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xa84d,0x1e8));var _0xda84=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa84d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xda84('0x0'));var moment=require(_0xda84('0x1'));var BPromise=require('bluebird');var rs=require(_0xda84('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xda84('0x3'))['db'];var utils=require(_0xda84('0x4'));var logger=require(_0xda84('0x5'))('rpc');var config=require(_0xda84('0x6'));var jayson=require(_0xda84('0x7'));var client=jayson[_0xda84('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e1d78,_0x23de56,_0x1673d7){return new BPromise(function(_0x503b2b,_0x1a102){return client['request'](_0x3e1d78,_0x1673d7)['then'](function(_0x8f43ea){logger[_0xda84('0x9')](_0xda84('0xa'),_0x23de56,_0xda84('0xb'));logger[_0xda84('0xc')](_0xda84('0xd'),_0x23de56,_0xda84('0xb'),JSON['stringify'](_0x8f43ea));if(_0x8f43ea[_0xda84('0xe')]){if(_0x8f43ea[_0xda84('0xe')][_0xda84('0xf')]===0x1f4){logger[_0xda84('0xe')](_0xda84('0xa'),_0x23de56,_0x8f43ea['error'][_0xda84('0x10')]);return _0x1a102(_0x8f43ea[_0xda84('0xe')]['message']);}logger[_0xda84('0xe')](_0xda84('0xa'),_0x23de56,_0x8f43ea[_0xda84('0xe')]['message']);return _0x503b2b(_0x8f43ea[_0xda84('0xe')]['message']);}else{logger[_0xda84('0x9')](_0xda84('0xa'),_0x23de56,_0xda84('0xb'));_0x503b2b(_0x8f43ea[_0xda84('0x11')][_0xda84('0x10')]);}})[_0xda84('0x12')](function(_0x27b369){logger[_0xda84('0xe')](_0xda84('0xa'),_0x23de56,_0x27b369);_0x1a102(_0x27b369);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 27665ef..7011e33 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 _0xdcd4=['show','download','/:id','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated'];(function(_0x1dceb5,_0x1ce7d6){var _0xbba053=function(_0x2e4d3e){while(--_0x2e4d3e){_0x1dceb5['push'](_0x1dceb5['shift']());}};_0xbba053(++_0x1ce7d6);}(_0xdcd4,0x19a));var _0x4dcd=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xdcd4[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x4dcd('0x0'));var util=require(_0x4dcd('0x1'));var path=require('path');var timeout=require(_0x4dcd('0x2'));var express=require(_0x4dcd('0x3'));var router=express['Router']();var fs_extra=require(_0x4dcd('0x4'));var auth=require(_0x4dcd('0x5'));var interaction=require(_0x4dcd('0x6'));var config=require('../../config/environment');var controller=require(_0x4dcd('0x7'));router[_0x4dcd('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x4dcd('0x9')](),controller[_0x4dcd('0xa')]);router[_0x4dcd('0x8')]('/:id/download',auth[_0x4dcd('0x9')](),controller[_0x4dcd('0xb')]);router['post']('/',auth[_0x4dcd('0x9')](),controller['create']);router['put'](_0x4dcd('0xc'),auth[_0x4dcd('0x9')](),controller['update']);router[_0x4dcd('0xd')](_0x4dcd('0xc'),auth[_0x4dcd('0x9')](),controller[_0x4dcd('0xe')]);module['exports']=router; \ No newline at end of file +var _0xe6ce=['show','/:id/download','download','create','/:id','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get'];(function(_0xa0285c,_0xd2e0e9){var _0x152d45=function(_0x1e7058){while(--_0x1e7058){_0xa0285c['push'](_0xa0285c['shift']());}};_0x152d45(++_0xd2e0e9);}(_0xe6ce,0x97));var _0xee6c=function(_0x2eeedd,_0x15f12a){_0x2eeedd=_0x2eeedd-0x0;var _0xc789d2=_0xe6ce[_0x2eeedd];return _0xc789d2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xee6c('0x0'));var timeout=require(_0xee6c('0x1'));var express=require(_0xee6c('0x2'));var router=express[_0xee6c('0x3')]();var fs_extra=require(_0xee6c('0x4'));var auth=require(_0xee6c('0x5'));var interaction=require(_0xee6c('0x6'));var config=require(_0xee6c('0x7'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0xee6c('0x8')](),controller[_0xee6c('0x9')]);router[_0xee6c('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xee6c('0xb')]);router[_0xee6c('0xa')](_0xee6c('0xc'),auth[_0xee6c('0x8')](),controller[_0xee6c('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xee6c('0xe')]);router['put'](_0xee6c('0xf'),auth['isAuthenticated'](),controller['update']);router[_0xee6c('0x10')](_0xee6c('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0xee6c('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 4b1aebd..6561ae4 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 _0x5fd8=['STRING','BOOLEAN','TEXT'];(function(_0x201d4a,_0x194ad1){var _0x108ec4=function(_0xc45dfb){while(--_0xc45dfb){_0x201d4a['push'](_0x201d4a['shift']());}};_0x108ec4(++_0x194ad1);}(_0x5fd8,0xfe));var _0x85fd=function(_0x2822e5,_0x2b65e0){_0x2822e5=_0x2822e5-0x0;var _0x4a0167=_0x5fd8[_0x2822e5];return _0x4a0167;};'use strict';var Sequelize=require('sequelize');module['exports']={'field':{'type':Sequelize[_0x85fd('0x0')]},'alias':{'type':Sequelize[_0x85fd('0x1')]},'function':{'type':Sequelize[_0x85fd('0x1')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x85fd('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x85fd('0x1')]},'custom':{'type':Sequelize[_0x85fd('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xb725=['TEXT','STRING','BOOLEAN','exports'];(function(_0x25fe97,_0x378726){var _0x5414c3=function(_0x365616){while(--_0x365616){_0x25fe97['push'](_0x25fe97['shift']());}};_0x5414c3(++_0x378726);}(_0xb725,0x123));var _0x5b72=function(_0x5ee058,_0x84818b){_0x5ee058=_0x5ee058-0x0;var _0x479af1=_0xb725[_0x5ee058];return _0x479af1;};'use strict';var Sequelize=require('sequelize');module[_0x5b72('0x0')]={'field':{'type':Sequelize[_0x5b72('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x5b72('0x2')]},'format':{'type':Sequelize[_0x5b72('0x2')]},'groupBy':{'type':Sequelize[_0x5b72('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x5b72('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 6623265..fe88e1f 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 _0x3352=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','AnalyticFieldReport','fieldName','key','model','query','attributes','fields','length','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','rawAttributes','intersection','includeAll','create','bulkCreate','body','find','ids','addFields','AnalyticCustomReport','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3352,0xe6));var _0x2335=function(_0x8590da,_0xbbe20f){_0x8590da=_0x8590da-0x0;var _0x203f0f=_0x3352[_0x8590da];return _0x203f0f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2335('0x0'));var zipdir=require(_0x2335('0x1'));var jsonpatch=require(_0x2335('0x2'));var rp=require(_0x2335('0x3'));var moment=require(_0x2335('0x4'));var BPromise=require(_0x2335('0x5'));var Mustache=require(_0x2335('0x6'));var util=require(_0x2335('0x7'));var path=require(_0x2335('0x8'));var sox=require('sox');var csv=require(_0x2335('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2335('0xa'));var _=require(_0x2335('0xb'));var squel=require(_0x2335('0xc'));var crypto=require(_0x2335('0xd'));var jsforce=require(_0x2335('0xe'));var deskjs=require(_0x2335('0xf'));var toCsv=require(_0x2335('0x9'));var querystring=require(_0x2335('0x10'));var Papa=require(_0x2335('0x11'));var Redis=require(_0x2335('0x12'));var authService=require(_0x2335('0x13'));var qs=require(_0x2335('0x14'));var as=require(_0x2335('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2335('0x16'))(_0x2335('0x17'));var utils=require('../../config/utils');var config=require(_0x2335('0x18'));var licenseUtil=require(_0x2335('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xdee8fe,_0x495702){_0x495702=_0x495702||0xcc;return function(_0xbf05fa){if(_0xbf05fa){return _0xdee8fe[_0x2335('0x1a')](_0x495702);}return _0xdee8fe[_0x2335('0x1b')](_0x495702)[_0x2335('0x1c')]();};}function respondWithResult(_0x17a99,_0x5f3bb5){_0x5f3bb5=_0x5f3bb5||0xc8;return function(_0x3c174d){if(_0x3c174d){return _0x17a99[_0x2335('0x1b')](_0x5f3bb5)[_0x2335('0x1d')](_0x3c174d);}};}function respondWithFilteredResult(_0x3c997a,_0x2649d9){return function(_0x22fbf0){if(_0x22fbf0){var _0x2e5805=typeof _0x2649d9[_0x2335('0x1e')]===_0x2335('0x1f')&&typeof _0x2649d9[_0x2335('0x20')]===_0x2335('0x1f');var _0x13398a=_0x22fbf0[_0x2335('0x21')];var _0x5b4d6e=_0x2e5805?0x0:_0x2649d9[_0x2335('0x1e')];var _0x3b2210=_0x2e5805?_0x22fbf0[_0x2335('0x21')]:_0x2649d9[_0x2335('0x1e')]+_0x2649d9[_0x2335('0x20')];var _0x387bd1;if(_0x3b2210>=_0x13398a){_0x3b2210=_0x13398a;_0x387bd1=0xc8;}else{_0x387bd1=0xce;}_0x3c997a[_0x2335('0x1b')](_0x387bd1);return _0x3c997a[_0x2335('0x22')](_0x2335('0x23'),_0x5b4d6e+'-'+_0x3b2210+'/'+_0x13398a)[_0x2335('0x1d')](_0x22fbf0);}return null;};}function patchUpdates(_0x11bca0){return function(_0x9e5d7a){try{jsonpatch[_0x2335('0x24')](_0x9e5d7a,_0x11bca0,!![]);}catch(_0x5558cd){return BPromise['reject'](_0x5558cd);}return _0x9e5d7a[_0x2335('0x25')]();};}function saveUpdates(_0x5ae7b5,_0x330af8){return function(_0x213c2a){if(_0x213c2a){return _0x213c2a[_0x2335('0x26')](_0x5ae7b5)[_0x2335('0x27')](function(_0x345529){return _0x345529;});}return null;};}function removeEntity(_0x40f401,_0x7e1c77){return function(_0x5710e9){if(_0x5710e9){return _0x5710e9[_0x2335('0x28')]()[_0x2335('0x27')](function(){_0x40f401[_0x2335('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54e65a,_0x394446){return function(_0x5adddb){if(!_0x5adddb){_0x54e65a[_0x2335('0x1a')](0x194);}return _0x5adddb;};}function handleError(_0x1b3b95,_0x36ad09){_0x36ad09=_0x36ad09||0x1f4;return function(_0x57b74b){logger[_0x2335('0x29')](_0x57b74b[_0x2335('0x2a')]);if(_0x57b74b[_0x2335('0x2b')]){delete _0x57b74b[_0x2335('0x2b')];}_0x1b3b95[_0x2335('0x1b')](_0x36ad09)['send'](_0x57b74b);};}exports[_0x2335('0x2c')]=function(_0x524c5b,_0x13a808){var _0x598304={},_0x5bc107={},_0x52a922={'count':0x0,'rows':[]};var _0x5afb8b=_[_0x2335('0x2d')](db[_0x2335('0x2e')]['rawAttributes'],function(_0x53ae25){return{'name':_0x53ae25[_0x2335('0x2f')],'type':_0x53ae25['type'][_0x2335('0x30')]};});_0x5bc107[_0x2335('0x31')]=_[_0x2335('0x2d')](_0x5afb8b,'name');_0x5bc107[_0x2335('0x32')]=_['keys'](_0x524c5b[_0x2335('0x32')]);_0x5bc107['filters']=_['intersection'](_0x5bc107[_0x2335('0x31')],_0x5bc107[_0x2335('0x32')]);_0x598304[_0x2335('0x33')]=_['intersection'](_0x5bc107[_0x2335('0x31')],qs[_0x2335('0x34')](_0x524c5b[_0x2335('0x32')]['fields']));_0x598304[_0x2335('0x33')]=_0x598304[_0x2335('0x33')][_0x2335('0x35')]?_0x598304[_0x2335('0x33')]:_0x5bc107['model'];if(!_0x524c5b['query']['hasOwnProperty']('nolimit')){_0x598304['limit']=qs[_0x2335('0x20')](_0x524c5b[_0x2335('0x32')]['limit']);_0x598304[_0x2335('0x1e')]=qs[_0x2335('0x1e')](_0x524c5b[_0x2335('0x32')][_0x2335('0x1e')]);}_0x598304[_0x2335('0x36')]=qs[_0x2335('0x37')](_0x524c5b[_0x2335('0x32')][_0x2335('0x37')]);_0x598304[_0x2335('0x38')]=qs[_0x2335('0x39')](_[_0x2335('0x3a')](_0x524c5b['query'],_0x5bc107[_0x2335('0x39')]),_0x5afb8b);if(_0x524c5b[_0x2335('0x32')][_0x2335('0x3b')]){_0x598304[_0x2335('0x38')]=_[_0x2335('0x3c')](_0x598304[_0x2335('0x38')],{'$or':_['map'](_0x5afb8b,function(_0x4aae58){if(_0x4aae58[_0x2335('0x3d')]!==_0x2335('0x3e')){var _0x43c2d9={};_0x43c2d9[_0x4aae58['name']]={'$like':'%'+_0x524c5b[_0x2335('0x32')]['filter']+'%'};return _0x43c2d9;}})});}_0x598304=_[_0x2335('0x3c')]({},_0x598304,_0x524c5b[_0x2335('0x3f')]);var _0x56c8ca={'where':_0x598304[_0x2335('0x38')]};return db[_0x2335('0x2e')]['count'](_0x56c8ca)['then'](function(_0xa386b4){_0x52a922[_0x2335('0x21')]=_0xa386b4;if(_0x524c5b[_0x2335('0x32')]['includeAll']){_0x598304[_0x2335('0x40')]=[{'all':!![]}];}return db[_0x2335('0x2e')][_0x2335('0x41')](_0x598304);})[_0x2335('0x27')](function(_0x583648){_0x52a922[_0x2335('0x42')]=_0x583648;return _0x52a922;})[_0x2335('0x27')](respondWithFilteredResult(_0x13a808,_0x598304))[_0x2335('0x43')](handleError(_0x13a808,null));};exports[_0x2335('0x44')]=function(_0x5c76a6,_0x1144ec){var _0x50e962={'raw':![],'where':{'id':_0x5c76a6[_0x2335('0x45')]['id']}},_0x35ab11={};_0x35ab11[_0x2335('0x31')]=_[_0x2335('0x46')](db[_0x2335('0x2e')][_0x2335('0x47')]);_0x35ab11[_0x2335('0x32')]=_['keys'](_0x5c76a6[_0x2335('0x32')]);_0x35ab11['filters']=_['intersection'](_0x35ab11[_0x2335('0x31')],_0x35ab11[_0x2335('0x32')]);_0x50e962['attributes']=_[_0x2335('0x48')](_0x35ab11[_0x2335('0x31')],qs[_0x2335('0x34')](_0x5c76a6[_0x2335('0x32')][_0x2335('0x34')]));_0x50e962[_0x2335('0x33')]=_0x50e962[_0x2335('0x33')]['length']?_0x50e962[_0x2335('0x33')]:_0x35ab11[_0x2335('0x31')];if(_0x5c76a6[_0x2335('0x32')][_0x2335('0x49')]){_0x50e962[_0x2335('0x40')]=[{'all':!![]}];}_0x50e962=_[_0x2335('0x3c')]({},_0x50e962,_0x5c76a6[_0x2335('0x3f')]);return db[_0x2335('0x2e')]['find'](_0x50e962)[_0x2335('0x27')](handleEntityNotFound(_0x1144ec,null))['then'](respondWithResult(_0x1144ec,null))[_0x2335('0x43')](handleError(_0x1144ec,null));};exports['create']=function(_0x2e297d,_0x23ba1e){return db[_0x2335('0x2e')][_0x2335('0x4a')](_0x2e297d['body'],{})[_0x2335('0x27')](respondWithResult(_0x23ba1e,0xc9))[_0x2335('0x43')](handleError(_0x23ba1e,null));};exports[_0x2335('0x4b')]=function(_0x59e792,_0x31dd05){return db['AnalyticFieldReport'][_0x2335('0x4b')](_0x59e792[_0x2335('0x4c')],{'raw':![],'individualHooks':!![]})[_0x2335('0x27')](respondWithResult(_0x31dd05,0xc9))[_0x2335('0x43')](handleError(_0x31dd05,null));};exports[_0x2335('0x26')]=function(_0x49d1fa,_0x165a69){if(_0x49d1fa[_0x2335('0x4c')]['id']){delete _0x49d1fa['body']['id'];}return db[_0x2335('0x2e')][_0x2335('0x4d')]({'where':{'id':_0x49d1fa[_0x2335('0x45')]['id']}})[_0x2335('0x27')](handleEntityNotFound(_0x165a69,null))[_0x2335('0x27')](saveUpdates(_0x49d1fa['body'],null))[_0x2335('0x27')](respondWithResult(_0x165a69,null))['catch'](handleError(_0x165a69,null));};exports[_0x2335('0x28')]=function(_0x20f713,_0xefc9f7){return db[_0x2335('0x2e')][_0x2335('0x4d')]({'where':{'id':_0x20f713['params']['id']}})[_0x2335('0x27')](handleEntityNotFound(_0xefc9f7,null))[_0x2335('0x27')](removeEntity(_0xefc9f7,null))[_0x2335('0x43')](handleError(_0xefc9f7,null));};exports['bulkDestroy']=function(_0x38adc6,_0x27710e){return db[_0x2335('0x2e')][_0x2335('0x28')]({'where':{'id':_0x38adc6[_0x2335('0x32')][_0x2335('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0x2335('0x27')](respondWithResult(_0x27710e,0xcc))['catch'](handleError(_0x27710e,null));};exports[_0x2335('0x4f')]=function(_0xdfc486,_0x34e51e,_0x5ae905){return db[_0x2335('0x50')]['findOne']({'where':{'id':_0xdfc486[_0x2335('0x45')]['id']}})[_0x2335('0x27')](handleEntityNotFound(_0x34e51e,null))[_0x2335('0x27')](function(_0x4cfc4b){if(_0x4cfc4b){return db['sequelize']['transaction'](function(_0x5243d2){return db[_0x2335('0x2e')][_0x2335('0x28')]({'where':{'CustomReportId':_0xdfc486[_0x2335('0x45')]['id']},'transaction':_0x5243d2})[_0x2335('0x27')](function(_0x4f4bf1){var _0x16802a=_['map'](_0xdfc486[_0x2335('0x4c')],function(_0x548b5a){delete _0x548b5a['id'];_0x548b5a['CustomReportId']=_0xdfc486[_0x2335('0x45')]['id'];return _0x548b5a;});return db[_0x2335('0x2e')][_0x2335('0x4b')](_0x16802a,{'transaction':_0x5243d2});});})['then'](function(){return db['AnalyticFieldReport'][_0x2335('0x41')]({'where':{'CustomReportId':_0xdfc486[_0x2335('0x45')]['id']}});});}})[_0x2335('0x27')](respondWithResult(_0x34e51e,null))[_0x2335('0x43')](handleError(_0x34e51e,null));}; \ No newline at end of file +var _0xa7ba=['status','end','error','name','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort','filter','where','merge','VIRTUAL','options','AnalyticFieldReport','count','includeAll','include','findAll','catch','show','params','find','create','body','bulkCreate','update','bulkDestroy','addFields','findOne','transaction','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','json','offset','undefined','limit','Content-Range','reject','save','then','destroy'];(function(_0x837dad,_0x1d9098){var _0x1d62d3=function(_0x40b7c1){while(--_0x40b7c1){_0x837dad['push'](_0x837dad['shift']());}};_0x1d62d3(++_0x1d9098);}(_0xa7ba,0xbd));var _0xaa7b=function(_0x4b292d,_0x274ba4){_0x4b292d=_0x4b292d-0x0;var _0x2f1c3a=_0xa7ba[_0x4b292d];return _0x2f1c3a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaa7b('0x0'));var zipdir=require(_0xaa7b('0x1'));var jsonpatch=require(_0xaa7b('0x2'));var rp=require(_0xaa7b('0x3'));var moment=require(_0xaa7b('0x4'));var BPromise=require(_0xaa7b('0x5'));var Mustache=require(_0xaa7b('0x6'));var util=require(_0xaa7b('0x7'));var path=require(_0xaa7b('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaa7b('0x9'));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(_0xaa7b('0xf'));var querystring=require(_0xaa7b('0x10'));var Papa=require('papaparse');var Redis=require(_0xaa7b('0x11'));var authService=require(_0xaa7b('0x12'));var qs=require(_0xaa7b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa7b('0x14'));var logger=require(_0xaa7b('0x15'))(_0xaa7b('0x16'));var utils=require(_0xaa7b('0x17'));var config=require(_0xaa7b('0x18'));var licenseUtil=require(_0xaa7b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b3227,_0x211788){_0x211788=_0x211788||0xcc;return function(_0x3f47ad){if(_0x3f47ad){return _0x5b3227[_0xaa7b('0x1a')](_0x211788);}return _0x5b3227['status'](_0x211788)['end']();};}function respondWithResult(_0x1e31b5,_0x27e3b2){_0x27e3b2=_0x27e3b2||0xc8;return function(_0x1b498f){if(_0x1b498f){return _0x1e31b5['status'](_0x27e3b2)[_0xaa7b('0x1b')](_0x1b498f);}};}function respondWithFilteredResult(_0x4c9323,_0x4b2f99){return function(_0x1cab5c){if(_0x1cab5c){var _0x5dd4e5=typeof _0x4b2f99[_0xaa7b('0x1c')]===_0xaa7b('0x1d')&&typeof _0x4b2f99[_0xaa7b('0x1e')]===_0xaa7b('0x1d');var _0x50a572=_0x1cab5c['count'];var _0xac956e=_0x5dd4e5?0x0:_0x4b2f99['offset'];var _0x30299d=_0x5dd4e5?_0x1cab5c['count']:_0x4b2f99['offset']+_0x4b2f99[_0xaa7b('0x1e')];var _0x43d5cd;if(_0x30299d>=_0x50a572){_0x30299d=_0x50a572;_0x43d5cd=0xc8;}else{_0x43d5cd=0xce;}_0x4c9323['status'](_0x43d5cd);return _0x4c9323['set'](_0xaa7b('0x1f'),_0xac956e+'-'+_0x30299d+'/'+_0x50a572)['json'](_0x1cab5c);}return null;};}function patchUpdates(_0x57290c){return function(_0x402134){try{jsonpatch['apply'](_0x402134,_0x57290c,!![]);}catch(_0x1f11bd){return BPromise[_0xaa7b('0x20')](_0x1f11bd);}return _0x402134[_0xaa7b('0x21')]();};}function saveUpdates(_0x1381a0,_0x109ddd){return function(_0x19e829){if(_0x19e829){return _0x19e829['update'](_0x1381a0)[_0xaa7b('0x22')](function(_0x5f26a7){return _0x5f26a7;});}return null;};}function removeEntity(_0x4768c7,_0xe8a02f){return function(_0x198b00){if(_0x198b00){return _0x198b00[_0xaa7b('0x23')]()[_0xaa7b('0x22')](function(){_0x4768c7[_0xaa7b('0x24')](0xcc)[_0xaa7b('0x25')]();});}};}function handleEntityNotFound(_0x1b9f1e,_0x2f5597){return function(_0x15375e){if(!_0x15375e){_0x1b9f1e['sendStatus'](0x194);}return _0x15375e;};}function handleError(_0x3fc9db,_0x4ee680){_0x4ee680=_0x4ee680||0x1f4;return function(_0x227e72){logger[_0xaa7b('0x26')](_0x227e72['stack']);if(_0x227e72[_0xaa7b('0x27')]){delete _0x227e72['name'];}_0x3fc9db[_0xaa7b('0x24')](_0x4ee680)['send'](_0x227e72);};}exports['index']=function(_0x36b26c,_0xa2211b){var _0x540b09={},_0xf7450b={},_0x21617c={'count':0x0,'rows':[]};var _0x2e7235=_[_0xaa7b('0x28')](db['AnalyticFieldReport'][_0xaa7b('0x29')],function(_0x4f521b){return{'name':_0x4f521b['fieldName'],'type':_0x4f521b[_0xaa7b('0x2a')][_0xaa7b('0x2b')]};});_0xf7450b[_0xaa7b('0x2c')]=_['map'](_0x2e7235,_0xaa7b('0x27'));_0xf7450b['query']=_[_0xaa7b('0x2d')](_0x36b26c[_0xaa7b('0x2e')]);_0xf7450b[_0xaa7b('0x2f')]=_[_0xaa7b('0x30')](_0xf7450b[_0xaa7b('0x2c')],_0xf7450b[_0xaa7b('0x2e')]);_0x540b09[_0xaa7b('0x31')]=_['intersection'](_0xf7450b[_0xaa7b('0x2c')],qs[_0xaa7b('0x32')](_0x36b26c[_0xaa7b('0x2e')][_0xaa7b('0x32')]));_0x540b09[_0xaa7b('0x31')]=_0x540b09['attributes']['length']?_0x540b09[_0xaa7b('0x31')]:_0xf7450b[_0xaa7b('0x2c')];if(!_0x36b26c[_0xaa7b('0x2e')][_0xaa7b('0x33')]('nolimit')){_0x540b09[_0xaa7b('0x1e')]=qs[_0xaa7b('0x1e')](_0x36b26c['query']['limit']);_0x540b09[_0xaa7b('0x1c')]=qs[_0xaa7b('0x1c')](_0x36b26c['query'][_0xaa7b('0x1c')]);}_0x540b09['order']=qs['sort'](_0x36b26c[_0xaa7b('0x2e')][_0xaa7b('0x34')]);_0x540b09['where']=qs['filters'](_['pick'](_0x36b26c[_0xaa7b('0x2e')],_0xf7450b[_0xaa7b('0x2f')]),_0x2e7235);if(_0x36b26c[_0xaa7b('0x2e')][_0xaa7b('0x35')]){_0x540b09[_0xaa7b('0x36')]=_[_0xaa7b('0x37')](_0x540b09[_0xaa7b('0x36')],{'$or':_[_0xaa7b('0x28')](_0x2e7235,function(_0x412744){if(_0x412744[_0xaa7b('0x2a')]!==_0xaa7b('0x38')){var _0x3a0af1={};_0x3a0af1[_0x412744[_0xaa7b('0x27')]]={'$like':'%'+_0x36b26c[_0xaa7b('0x2e')]['filter']+'%'};return _0x3a0af1;}})});}_0x540b09=_[_0xaa7b('0x37')]({},_0x540b09,_0x36b26c[_0xaa7b('0x39')]);var _0x31c1fe={'where':_0x540b09['where']};return db[_0xaa7b('0x3a')][_0xaa7b('0x3b')](_0x31c1fe)['then'](function(_0x1b730b){_0x21617c['count']=_0x1b730b;if(_0x36b26c[_0xaa7b('0x2e')][_0xaa7b('0x3c')]){_0x540b09[_0xaa7b('0x3d')]=[{'all':!![]}];}return db[_0xaa7b('0x3a')][_0xaa7b('0x3e')](_0x540b09);})[_0xaa7b('0x22')](function(_0x4c4b54){_0x21617c['rows']=_0x4c4b54;return _0x21617c;})[_0xaa7b('0x22')](respondWithFilteredResult(_0xa2211b,_0x540b09))[_0xaa7b('0x3f')](handleError(_0xa2211b,null));};exports[_0xaa7b('0x40')]=function(_0x399425,_0x4f1ca0){var _0x2be305={'raw':![],'where':{'id':_0x399425[_0xaa7b('0x41')]['id']}},_0x1202de={};_0x1202de['model']=_['keys'](db[_0xaa7b('0x3a')][_0xaa7b('0x29')]);_0x1202de[_0xaa7b('0x2e')]=_['keys'](_0x399425[_0xaa7b('0x2e')]);_0x1202de[_0xaa7b('0x2f')]=_[_0xaa7b('0x30')](_0x1202de[_0xaa7b('0x2c')],_0x1202de[_0xaa7b('0x2e')]);_0x2be305[_0xaa7b('0x31')]=_[_0xaa7b('0x30')](_0x1202de[_0xaa7b('0x2c')],qs['fields'](_0x399425[_0xaa7b('0x2e')][_0xaa7b('0x32')]));_0x2be305[_0xaa7b('0x31')]=_0x2be305['attributes']['length']?_0x2be305[_0xaa7b('0x31')]:_0x1202de[_0xaa7b('0x2c')];if(_0x399425[_0xaa7b('0x2e')]['includeAll']){_0x2be305[_0xaa7b('0x3d')]=[{'all':!![]}];}_0x2be305=_['merge']({},_0x2be305,_0x399425['options']);return db[_0xaa7b('0x3a')][_0xaa7b('0x42')](_0x2be305)[_0xaa7b('0x22')](handleEntityNotFound(_0x4f1ca0,null))[_0xaa7b('0x22')](respondWithResult(_0x4f1ca0,null))[_0xaa7b('0x3f')](handleError(_0x4f1ca0,null));};exports[_0xaa7b('0x43')]=function(_0x184a7d,_0x7f5698){return db[_0xaa7b('0x3a')][_0xaa7b('0x43')](_0x184a7d[_0xaa7b('0x44')],{})['then'](respondWithResult(_0x7f5698,0xc9))['catch'](handleError(_0x7f5698,null));};exports[_0xaa7b('0x45')]=function(_0x549b45,_0x174ea1){return db[_0xaa7b('0x3a')][_0xaa7b('0x45')](_0x549b45[_0xaa7b('0x44')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x174ea1,0xc9))[_0xaa7b('0x3f')](handleError(_0x174ea1,null));};exports[_0xaa7b('0x46')]=function(_0x328061,_0x3289a5){if(_0x328061['body']['id']){delete _0x328061['body']['id'];}return db['AnalyticFieldReport'][_0xaa7b('0x42')]({'where':{'id':_0x328061[_0xaa7b('0x41')]['id']}})[_0xaa7b('0x22')](handleEntityNotFound(_0x3289a5,null))[_0xaa7b('0x22')](saveUpdates(_0x328061['body'],null))[_0xaa7b('0x22')](respondWithResult(_0x3289a5,null))[_0xaa7b('0x3f')](handleError(_0x3289a5,null));};exports[_0xaa7b('0x23')]=function(_0x22bafe,_0xb1067b){return db[_0xaa7b('0x3a')][_0xaa7b('0x42')]({'where':{'id':_0x22bafe['params']['id']}})[_0xaa7b('0x22')](handleEntityNotFound(_0xb1067b,null))[_0xaa7b('0x22')](removeEntity(_0xb1067b,null))[_0xaa7b('0x3f')](handleError(_0xb1067b,null));};exports[_0xaa7b('0x47')]=function(_0x235e82,_0x9ddb3f){return db[_0xaa7b('0x3a')][_0xaa7b('0x23')]({'where':{'id':_0x235e82[_0xaa7b('0x2e')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xaa7b('0x22')](respondWithResult(_0x9ddb3f,0xcc))[_0xaa7b('0x3f')](handleError(_0x9ddb3f,null));};exports[_0xaa7b('0x48')]=function(_0x4a1fed,_0x1210b8,_0x3956de){return db['AnalyticCustomReport'][_0xaa7b('0x49')]({'where':{'id':_0x4a1fed[_0xaa7b('0x41')]['id']}})[_0xaa7b('0x22')](handleEntityNotFound(_0x1210b8,null))[_0xaa7b('0x22')](function(_0x4585df){if(_0x4585df){return db['sequelize'][_0xaa7b('0x4a')](function(_0x2a5979){return db[_0xaa7b('0x3a')]['destroy']({'where':{'CustomReportId':_0x4a1fed[_0xaa7b('0x41')]['id']},'transaction':_0x2a5979})[_0xaa7b('0x22')](function(_0x55a9f5){var _0x481eb4=_['map'](_0x4a1fed[_0xaa7b('0x44')],function(_0x494805){delete _0x494805['id'];_0x494805['CustomReportId']=_0x4a1fed[_0xaa7b('0x41')]['id'];return _0x494805;});return db[_0xaa7b('0x3a')][_0xaa7b('0x45')](_0x481eb4,{'transaction':_0x2a5979});});})[_0xaa7b('0x22')](function(){return db['AnalyticFieldReport'][_0xaa7b('0x3e')]({'where':{'CustomReportId':_0x4a1fed['params']['id']}});});}})[_0xaa7b('0x22')](respondWithResult(_0x1210b8,null))[_0xaa7b('0x3f')](handleError(_0x1210b8,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 92ba2f6..e8377e2 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 _0x6757=['rimraf','../../config/environment','./analyticFieldReport.attributes','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x18afca,_0x4219d9){var _0x11603f=function(_0x21d5d1){while(--_0x21d5d1){_0x18afca['push'](_0x18afca['shift']());}};_0x11603f(++_0x4219d9);}(_0x6757,0x1ed));var _0x7675=function(_0x3079e0,_0x3c77c8){_0x3079e0=_0x3079e0-0x0;var _0x47a908=_0x6757[_0x3079e0];return _0x47a908;};'use strict';var _=require(_0x7675('0x0'));var util=require(_0x7675('0x1'));var logger=require(_0x7675('0x2'))('api');var moment=require(_0x7675('0x3'));var BPromise=require(_0x7675('0x4'));var rp=require(_0x7675('0x5'));var fs=require('fs');var path=require(_0x7675('0x6'));var rimraf=require(_0x7675('0x7'));var config=require(_0x7675('0x8'));var attributes=require(_0x7675('0x9'));module['exports']=function(_0x4b5868,_0x33be01){return _0x4b5868['define']('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x684a=['analytics_report_fields','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','AnalyticFieldReport'];(function(_0x1529a3,_0x529f63){var _0x1a0d4b=function(_0x6f1058){while(--_0x6f1058){_0x1529a3['push'](_0x1529a3['shift']());}};_0x1a0d4b(++_0x529f63);}(_0x684a,0x1e1));var _0xa684=function(_0x58d980,_0xc69762){_0x58d980=_0x58d980-0x0;var _0xee1673=_0x684a[_0x58d980];return _0xee1673;};'use strict';var _=require('lodash');var util=require(_0xa684('0x0'));var logger=require(_0xa684('0x1'))(_0xa684('0x2'));var moment=require(_0xa684('0x3'));var BPromise=require(_0xa684('0x4'));var rp=require(_0xa684('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa684('0x6'));var config=require(_0xa684('0x7'));var attributes=require('./analyticFieldReport.attributes');module[_0xa684('0x8')]=function(_0x210cd6,_0x7613d4){return _0x210cd6[_0xa684('0x9')](_0xa684('0xa'),attributes,{'tableName':_0xa684('0xb'),'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 0636afa..8713c5a 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 _0xdd0b=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x180faa,_0x696cd){var _0x284a60=function(_0x479794){while(--_0x479794){_0x180faa['push'](_0x180faa['shift']());}};_0x284a60(++_0x696cd);}(_0xdd0b,0x159));var _0xbdd0=function(_0x1e0aa4,_0x2bc4c7){_0x1e0aa4=_0x1e0aa4-0x0;var _0x350f1d=_0xdd0b[_0x1e0aa4];return _0x350f1d;};'use strict';var _=require(_0xbdd0('0x0'));var util=require(_0xbdd0('0x1'));var moment=require(_0xbdd0('0x2'));var BPromise=require(_0xbdd0('0x3'));var rs=require(_0xbdd0('0x4'));var fs=require('fs');var Redis=require(_0xbdd0('0x5'));var db=require(_0xbdd0('0x6'))['db'];var utils=require(_0xbdd0('0x7'));var logger=require(_0xbdd0('0x8'))(_0xbdd0('0x9'));var config=require(_0xbdd0('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xbdd0('0xb')][_0xbdd0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3bc5d9,_0x40fff1,_0x55706c){return new BPromise(function(_0x815381,_0x3edcea){return client['request'](_0x3bc5d9,_0x55706c)[_0xbdd0('0xd')](function(_0x4067e9){logger[_0xbdd0('0xe')](_0xbdd0('0xf'),_0x40fff1,_0xbdd0('0x10'));logger[_0xbdd0('0x11')](_0xbdd0('0x12'),_0x40fff1,_0xbdd0('0x10'),JSON['stringify'](_0x4067e9));if(_0x4067e9[_0xbdd0('0x13')]){if(_0x4067e9['error'][_0xbdd0('0x14')]===0x1f4){logger[_0xbdd0('0x13')](_0xbdd0('0xf'),_0x40fff1,_0x4067e9[_0xbdd0('0x13')]['message']);return _0x3edcea(_0x4067e9[_0xbdd0('0x13')][_0xbdd0('0x15')]);}logger[_0xbdd0('0x13')](_0xbdd0('0xf'),_0x40fff1,_0x4067e9[_0xbdd0('0x13')][_0xbdd0('0x15')]);return _0x815381(_0x4067e9['error']['message']);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x40fff1,_0xbdd0('0x10'));_0x815381(_0x4067e9[_0xbdd0('0x16')][_0xbdd0('0x15')]);}})['catch'](function(_0x4cd12c){logger[_0xbdd0('0x13')](_0xbdd0('0xf'),_0x40fff1,_0x4cd12c);_0x3edcea(_0x4cd12c);});});} \ No newline at end of file +var _0x2e8c=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','AnalyticFieldReport,\x20%s,\x20%s','result','lodash','bluebird','randomstring','ioredis'];(function(_0x36335c,_0x3d4036){var _0x4be46e=function(_0x5eafe2){while(--_0x5eafe2){_0x36335c['push'](_0x36335c['shift']());}};_0x4be46e(++_0x3d4036);}(_0x2e8c,0xd8));var _0xc2e8=function(_0x4fbc9f,_0x1ba070){_0x4fbc9f=_0x4fbc9f-0x0;var _0x205885=_0x2e8c[_0x4fbc9f];return _0x205885;};'use strict';var _=require(_0xc2e8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc2e8('0x1'));var rs=require(_0xc2e8('0x2'));var fs=require('fs');var Redis=require(_0xc2e8('0x3'));var db=require(_0xc2e8('0x4'))['db'];var utils=require(_0xc2e8('0x5'));var logger=require(_0xc2e8('0x6'))(_0xc2e8('0x7'));var config=require(_0xc2e8('0x8'));var jayson=require(_0xc2e8('0x9'));var client=jayson[_0xc2e8('0xa')][_0xc2e8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ec653,_0x30d4d0,_0x3858eb){return new BPromise(function(_0x9c9982,_0x124602){return client['request'](_0x3ec653,_0x3858eb)[_0xc2e8('0xc')](function(_0x4550ff){logger[_0xc2e8('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x30d4d0,_0xc2e8('0xe'));logger[_0xc2e8('0xf')](_0xc2e8('0x10'),_0x30d4d0,_0xc2e8('0xe'),JSON[_0xc2e8('0x11')](_0x4550ff));if(_0x4550ff[_0xc2e8('0x12')]){if(_0x4550ff[_0xc2e8('0x12')]['code']===0x1f4){logger[_0xc2e8('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x30d4d0,_0x4550ff[_0xc2e8('0x12')][_0xc2e8('0x13')]);return _0x124602(_0x4550ff[_0xc2e8('0x12')][_0xc2e8('0x13')]);}logger[_0xc2e8('0x12')](_0xc2e8('0x14'),_0x30d4d0,_0x4550ff['error'][_0xc2e8('0x13')]);return _0x9c9982(_0x4550ff[_0xc2e8('0x12')][_0xc2e8('0x13')]);}else{logger[_0xc2e8('0xd')](_0xc2e8('0x14'),_0x30d4d0,_0xc2e8('0xe'));_0x9c9982(_0x4550ff[_0xc2e8('0x15')][_0xc2e8('0x13')]);}})['catch'](function(_0x5d045a){logger[_0xc2e8('0x12')](_0xc2e8('0x14'),_0x30d4d0,_0x5d045a);_0x124602(_0x5d045a);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index c64b725..b5a930e 100644 --- a/server/api/analyticFieldReport/index.js +++ b/server/api/analyticFieldReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x4c99c6,_0x25931a){var _0x2da1c3=function(_0x55ba7e){while(--_0x55ba7e){_0x4c99c6['push'](_0x4c99c6['shift']());}};_0x2da1c3(++_0x25931a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file +var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0xe51925,_0x513834){var _0x36d4da=function(_0x458223){while(--_0x458223){_0xe51925['push'](_0xe51925['shift']());}};_0x36d4da(++_0x513834);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index b9386fb..5203aeb 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 _0xd138=['exports','STRING','sequelize'];(function(_0x3aabbc,_0x3017d2){var _0x298f4f=function(_0x122480){while(--_0x122480){_0x3aabbc['push'](_0x3aabbc['shift']());}};_0x298f4f(++_0x3017d2);}(_0xd138,0x1dc));var _0x8d13=function(_0x10c190,_0xda61fe){_0x10c190=_0x10c190-0x0;var _0x3ed8ec=_0xd138[_0x10c190];return _0x3ed8ec;};'use strict';var Sequelize=require(_0x8d13('0x0'));module[_0x8d13('0x1')]={'name':{'type':Sequelize[_0x8d13('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x8d13('0x2')]}}; \ No newline at end of file +var _0x19c3=['TEXT','sequelize','STRING','name'];(function(_0x2d549a,_0x3f9945){var _0x5f5938=function(_0x1071ca){while(--_0x1071ca){_0x2d549a['push'](_0x2d549a['shift']());}};_0x5f5938(++_0x3f9945);}(_0x19c3,0xf9));var _0x319c=function(_0x39d5cd,_0x1d8568){_0x39d5cd=_0x39d5cd-0x0;var _0x42e0e1=_0x19c3[_0x39d5cd];return _0x42e0e1;};'use strict';var Sequelize=require(_0x319c('0x0'));module['exports']={'name':{'type':Sequelize[_0x319c('0x1')],'allowNull':![],'unique':_0x319c('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x319c('0x3')]},'description':{'type':Sequelize[_0x319c('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index e112e9f..5822eb3 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 _0x81bd=['filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','AnalyticMetric','includeAll','include','findAll','rows','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','Metrics','stack','name','send','index','map','fieldName','query','keys'];(function(_0x34ada8,_0x393fd4){var _0x1adcf8=function(_0x506250){while(--_0x506250){_0x34ada8['push'](_0x34ada8['shift']());}};_0x1adcf8(++_0x393fd4);}(_0x81bd,0x7c));var _0xd81b=function(_0x1badc1,_0x19fd91){_0x1badc1=_0x1badc1-0x0;var _0x37e23d=_0x81bd[_0x1badc1];return _0x37e23d;};'use strict';var emlformat=require(_0xd81b('0x0'));var rimraf=require(_0xd81b('0x1'));var zipdir=require(_0xd81b('0x2'));var jsonpatch=require(_0xd81b('0x3'));var rp=require(_0xd81b('0x4'));var moment=require(_0xd81b('0x5'));var BPromise=require(_0xd81b('0x6'));var Mustache=require('mustache');var util=require(_0xd81b('0x7'));var path=require(_0xd81b('0x8'));var sox=require(_0xd81b('0x9'));var csv=require('to-csv');var ejs=require(_0xd81b('0xa'));var fs=require('fs');var fs_extra=require(_0xd81b('0xb'));var _=require(_0xd81b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd81b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd81b('0xe'));var querystring=require(_0xd81b('0xf'));var Papa=require(_0xd81b('0x10'));var Redis=require(_0xd81b('0x11'));var authService=require(_0xd81b('0x12'));var qs=require(_0xd81b('0x13'));var as=require(_0xd81b('0x14'));var hardwareService=require(_0xd81b('0x15'));var logger=require(_0xd81b('0x16'))(_0xd81b('0x17'));var utils=require(_0xd81b('0x18'));var config=require(_0xd81b('0x19'));var licenseUtil=require(_0xd81b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21dfff,_0x57f71d){_0x57f71d=_0x57f71d||0xcc;return function(_0x3f2405){if(_0x3f2405){return _0x21dfff[_0xd81b('0x1b')](_0x57f71d);}return _0x21dfff['status'](_0x57f71d)[_0xd81b('0x1c')]();};}function respondWithResult(_0x47dd04,_0x13dd00){_0x13dd00=_0x13dd00||0xc8;return function(_0x41bf7a){if(_0x41bf7a){return _0x47dd04[_0xd81b('0x1d')](_0x13dd00)[_0xd81b('0x1e')](_0x41bf7a);}};}function respondWithFilteredResult(_0x128162,_0x552215){return function(_0x1c620d){if(_0x1c620d){var _0x27b7a0=typeof _0x552215['offset']===_0xd81b('0x1f')&&typeof _0x552215[_0xd81b('0x20')]===_0xd81b('0x1f');var _0x15e860=_0x1c620d[_0xd81b('0x21')];var _0xc49b8d=_0x27b7a0?0x0:_0x552215[_0xd81b('0x22')];var _0x3d4d34=_0x27b7a0?_0x1c620d[_0xd81b('0x21')]:_0x552215[_0xd81b('0x22')]+_0x552215[_0xd81b('0x20')];var _0x453952;if(_0x3d4d34>=_0x15e860){_0x3d4d34=_0x15e860;_0x453952=0xc8;}else{_0x453952=0xce;}_0x128162[_0xd81b('0x1d')](_0x453952);return _0x128162[_0xd81b('0x23')](_0xd81b('0x24'),_0xc49b8d+'-'+_0x3d4d34+'/'+_0x15e860)[_0xd81b('0x1e')](_0x1c620d);}return null;};}function patchUpdates(_0x5f101a){return function(_0x4d566e){try{jsonpatch[_0xd81b('0x25')](_0x4d566e,_0x5f101a,!![]);}catch(_0x1b7876){return BPromise[_0xd81b('0x26')](_0x1b7876);}return _0x4d566e['save']();};}function saveUpdates(_0x19ed0e,_0x6571a6){return function(_0x542ee2){if(_0x542ee2){return _0x542ee2[_0xd81b('0x27')](_0x19ed0e)[_0xd81b('0x28')](function(_0x1670cd){return _0x1670cd;});}return null;};}function removeEntity(_0x1ad65c,_0x279176){return function(_0xcb4f91){if(_0xcb4f91){return _0xcb4f91[_0xd81b('0x29')]()[_0xd81b('0x28')](function(){var _0x341aec=_0xcb4f91[_0xd81b('0x2a')]({'plain':!![]});var _0x2ccedf=_0xd81b('0x2b');return db['UserProfileResource'][_0xd81b('0x29')]({'where':{'type':_0x2ccedf,'resourceId':_0x341aec['id']}})[_0xd81b('0x28')](function(){return _0xcb4f91;});})[_0xd81b('0x28')](function(){_0x1ad65c[_0xd81b('0x1d')](0xcc)[_0xd81b('0x1c')]();});}};}function handleEntityNotFound(_0x2d0d02,_0x3e28dd){return function(_0x73dc09){if(!_0x73dc09){_0x2d0d02[_0xd81b('0x1b')](0x194);}return _0x73dc09;};}function handleError(_0x483a3d,_0x469cc4){_0x469cc4=_0x469cc4||0x1f4;return function(_0x4e2eff){logger['error'](_0x4e2eff[_0xd81b('0x2c')]);if(_0x4e2eff[_0xd81b('0x2d')]){delete _0x4e2eff['name'];}_0x483a3d['status'](_0x469cc4)[_0xd81b('0x2e')](_0x4e2eff);};}exports[_0xd81b('0x2f')]=function(_0x1b1434,_0x289f54){var _0x1a1572={},_0x4654ba={},_0x5527ed={'count':0x0,'rows':[]};var _0x37d381=_[_0xd81b('0x30')](db['AnalyticMetric']['rawAttributes'],function(_0x165892){return{'name':_0x165892[_0xd81b('0x31')],'type':_0x165892['type']['key']};});_0x4654ba['model']=_[_0xd81b('0x30')](_0x37d381,_0xd81b('0x2d'));_0x4654ba[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x1b1434[_0xd81b('0x32')]);_0x4654ba[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x4654ba['model'],_0x4654ba[_0xd81b('0x32')]);_0x1a1572['attributes']=_[_0xd81b('0x35')](_0x4654ba[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x37')]));_0x1a1572[_0xd81b('0x38')]=_0x1a1572[_0xd81b('0x38')][_0xd81b('0x39')]?_0x1a1572[_0xd81b('0x38')]:_0x4654ba[_0xd81b('0x36')];if(!_0x1b1434[_0xd81b('0x32')][_0xd81b('0x3a')](_0xd81b('0x3b'))){_0x1a1572['limit']=qs['limit'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x20')]);_0x1a1572[_0xd81b('0x22')]=qs['offset'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x22')]);}_0x1a1572['order']=qs[_0xd81b('0x3c')](_0x1b1434[_0xd81b('0x32')]['sort']);_0x1a1572[_0xd81b('0x3d')]=qs['filters'](_[_0xd81b('0x3e')](_0x1b1434[_0xd81b('0x32')],_0x4654ba[_0xd81b('0x34')]),_0x37d381);if(_0x1b1434[_0xd81b('0x32')]['filter']){_0x1a1572[_0xd81b('0x3d')]=_[_0xd81b('0x3f')](_0x1a1572[_0xd81b('0x3d')],{'$or':_[_0xd81b('0x30')](_0x37d381,function(_0x3abd60){if(_0x3abd60[_0xd81b('0x40')]!==_0xd81b('0x41')){var _0x532ada={};_0x532ada[_0x3abd60[_0xd81b('0x2d')]]={'$like':'%'+_0x1b1434[_0xd81b('0x32')][_0xd81b('0x42')]+'%'};return _0x532ada;}})});}_0x1a1572=_['merge']({},_0x1a1572,_0x1b1434[_0xd81b('0x43')]);var _0x3a05f4={'where':_0x1a1572[_0xd81b('0x3d')]};return db[_0xd81b('0x44')][_0xd81b('0x21')](_0x3a05f4)['then'](function(_0x3dfba7){_0x5527ed[_0xd81b('0x21')]=_0x3dfba7;if(_0x1b1434[_0xd81b('0x32')][_0xd81b('0x45')]){_0x1a1572[_0xd81b('0x46')]=[{'all':!![]}];}return db[_0xd81b('0x44')][_0xd81b('0x47')](_0x1a1572);})[_0xd81b('0x28')](function(_0x4405a8){_0x5527ed[_0xd81b('0x48')]=_0x4405a8;return _0x5527ed;})[_0xd81b('0x28')](respondWithFilteredResult(_0x289f54,_0x1a1572))['catch'](handleError(_0x289f54,null));};exports[_0xd81b('0x49')]=function(_0x2778b3,_0x25824e){var _0xa5e391={'raw':!![],'where':{'id':_0x2778b3[_0xd81b('0x4a')]['id']}},_0x1e6654={};_0x1e6654[_0xd81b('0x36')]=_[_0xd81b('0x33')](db['AnalyticMetric']['rawAttributes']);_0x1e6654[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x2778b3[_0xd81b('0x32')]);_0x1e6654[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],_0x1e6654[_0xd81b('0x32')]);_0xa5e391[_0xd81b('0x38')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x2778b3[_0xd81b('0x32')]['fields']));_0xa5e391[_0xd81b('0x38')]=_0xa5e391[_0xd81b('0x38')][_0xd81b('0x39')]?_0xa5e391[_0xd81b('0x38')]:_0x1e6654[_0xd81b('0x36')];if(_0x2778b3[_0xd81b('0x32')][_0xd81b('0x45')]){_0xa5e391[_0xd81b('0x46')]=[{'all':!![]}];}_0xa5e391=_[_0xd81b('0x3f')]({},_0xa5e391,_0x2778b3['options']);return db[_0xd81b('0x44')][_0xd81b('0x4b')](_0xa5e391)[_0xd81b('0x28')](handleEntityNotFound(_0x25824e,null))[_0xd81b('0x28')](respondWithResult(_0x25824e,null))['catch'](handleError(_0x25824e,null));};exports[_0xd81b('0x4c')]=function(_0x151127,_0x15030b){return db[_0xd81b('0x44')][_0xd81b('0x4c')](_0x151127[_0xd81b('0x4d')],{})[_0xd81b('0x28')](function(_0x43d7ce){var _0x133a76=_0x151127['user']['get']({'plain':!![]});if(!_0x133a76)throw new Error(_0xd81b('0x4e'));if(_0x133a76[_0xd81b('0x4f')]===_0xd81b('0x50')){var _0x4da281=_0x43d7ce[_0xd81b('0x2a')]({'plain':!![]});var _0x3d6ab3=_0xd81b('0x2b');return db[_0xd81b('0x51')]['find']({'where':{'name':_0x3d6ab3,'userProfileId':_0x133a76[_0xd81b('0x52')]},'raw':!![]})[_0xd81b('0x28')](function(_0x1b523c){if(_0x1b523c&&_0x1b523c[_0xd81b('0x53')]===0x0){return db[_0xd81b('0x54')]['create']({'name':_0x4da281[_0xd81b('0x2d')],'resourceId':_0x4da281['id'],'type':_0x1b523c[_0xd81b('0x2d')],'sectionId':_0x1b523c['id']},{})['then'](function(){return _0x43d7ce;});}else{return _0x43d7ce;}})[_0xd81b('0x55')](function(_0x315bd5){logger[_0xd81b('0x56')](_0xd81b('0x57'),_0x315bd5);throw _0x315bd5;});}return _0x43d7ce;})[_0xd81b('0x28')](respondWithResult(_0x15030b,0xc9))[_0xd81b('0x55')](handleError(_0x15030b,null));};exports[_0xd81b('0x27')]=function(_0x22f588,_0x3ed626){if(_0x22f588[_0xd81b('0x4d')]['id']){delete _0x22f588[_0xd81b('0x4d')]['id'];}return db['AnalyticMetric'][_0xd81b('0x4b')]({'where':{'id':_0x22f588['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x3ed626,null))[_0xd81b('0x28')](saveUpdates(_0x22f588[_0xd81b('0x4d')],null))[_0xd81b('0x28')](respondWithResult(_0x3ed626,null))[_0xd81b('0x55')](handleError(_0x3ed626,null));};exports[_0xd81b('0x29')]=function(_0x5c196a,_0x2d978d){return db[_0xd81b('0x44')]['find']({'where':{'id':_0x5c196a['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x2d978d,null))['then'](removeEntity(_0x2d978d,null))[_0xd81b('0x55')](handleError(_0x2d978d,null));}; \ No newline at end of file +var _0x425d=['VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','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','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','where','merge'];(function(_0xba6bf1,_0x48bdc1){var _0x49a551=function(_0x565772){while(--_0x565772){_0xba6bf1['push'](_0xba6bf1['shift']());}};_0x49a551(++_0x48bdc1);}(_0x425d,0x1e0));var _0xd425=function(_0x3f29bc,_0x102fa1){_0x3f29bc=_0x3f29bc-0x0;var _0x253de9=_0x425d[_0x3f29bc];return _0x253de9;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];function respondWithStatusCode(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xcc;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x1d')](_0x3cacf7);}return _0x9bb611['status'](_0x3cacf7)[_0xd425('0x1e')]();};}function respondWithResult(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0xc8;return function(_0x5d3d60){if(_0x5d3d60){return _0x17a498[_0xd425('0x1f')](_0x336dc3)[_0xd425('0x20')](_0x5d3d60);}};}function respondWithFilteredResult(_0x643fd2,_0x41f34d){return function(_0x1fc822){if(_0x1fc822){var _0x538a0a=typeof _0x41f34d[_0xd425('0x21')]===_0xd425('0x22')&&typeof _0x41f34d[_0xd425('0x23')]===_0xd425('0x22');var _0x5d6585=_0x1fc822[_0xd425('0x24')];var _0x434d97=_0x538a0a?0x0:_0x41f34d[_0xd425('0x21')];var _0x1155bc=_0x538a0a?_0x1fc822['count']:_0x41f34d['offset']+_0x41f34d['limit'];var _0x4b293a;if(_0x1155bc>=_0x5d6585){_0x1155bc=_0x5d6585;_0x4b293a=0xc8;}else{_0x4b293a=0xce;}_0x643fd2[_0xd425('0x1f')](_0x4b293a);return _0x643fd2[_0xd425('0x25')](_0xd425('0x26'),_0x434d97+'-'+_0x1155bc+'/'+_0x5d6585)['json'](_0x1fc822);}return null;};}function patchUpdates(_0x355af0){return function(_0x7e982e){try{jsonpatch['apply'](_0x7e982e,_0x355af0,!![]);}catch(_0x2e1ec4){return BPromise[_0xd425('0x27')](_0x2e1ec4);}return _0x7e982e[_0xd425('0x28')]();};}function saveUpdates(_0x1d3fc0,_0x3e93db){return function(_0xb240c4){if(_0xb240c4){return _0xb240c4[_0xd425('0x29')](_0x1d3fc0)[_0xd425('0x2a')](function(_0x314201){return _0x314201;});}return null;};}function removeEntity(_0x2b030b,_0x151ad9){return function(_0x40e84b){if(_0x40e84b){return _0x40e84b['destroy']()[_0xd425('0x2a')](function(){var _0x264b0e=_0x40e84b[_0xd425('0x2b')]({'plain':!![]});var _0x1908a5=_0xd425('0x2c');return db[_0xd425('0x2d')][_0xd425('0x2e')]({'where':{'type':_0x1908a5,'resourceId':_0x264b0e['id']}})['then'](function(){return _0x40e84b;});})[_0xd425('0x2a')](function(){_0x2b030b[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();});}};}function handleEntityNotFound(_0x57c950,_0x27ef8a){return function(_0x3ad9bd){if(!_0x3ad9bd){_0x57c950[_0xd425('0x1d')](0x194);}return _0x3ad9bd;};}function handleError(_0x999fb9,_0x27d29a){_0x27d29a=_0x27d29a||0x1f4;return function(_0x185d7e){logger[_0xd425('0x2f')](_0x185d7e[_0xd425('0x30')]);if(_0x185d7e[_0xd425('0x31')]){delete _0x185d7e[_0xd425('0x31')];}_0x999fb9['status'](_0x27d29a)[_0xd425('0x32')](_0x185d7e);};}exports[_0xd425('0x33')]=function(_0x298602,_0x3695dd){var _0x3275b1={},_0x1abf33={},_0x47405f={'count':0x0,'rows':[]};var _0x40c392=_[_0xd425('0x34')](db[_0xd425('0x35')][_0xd425('0x36')],function(_0x5f3dab){return{'name':_0x5f3dab[_0xd425('0x37')],'type':_0x5f3dab[_0xd425('0x38')][_0xd425('0x39')]};});_0x1abf33[_0xd425('0x3a')]=_[_0xd425('0x34')](_0x40c392,'name');_0x1abf33[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x298602['query']);_0x1abf33['filters']=_['intersection'](_0x1abf33[_0xd425('0x3a')],_0x1abf33[_0xd425('0x3b')]);_0x3275b1[_0xd425('0x3d')]=_[_0xd425('0x3e')](_0x1abf33['model'],qs[_0xd425('0x3f')](_0x298602[_0xd425('0x3b')][_0xd425('0x3f')]));_0x3275b1[_0xd425('0x3d')]=_0x3275b1[_0xd425('0x3d')][_0xd425('0x40')]?_0x3275b1[_0xd425('0x3d')]:_0x1abf33['model'];if(!_0x298602[_0xd425('0x3b')]['hasOwnProperty'](_0xd425('0x41'))){_0x3275b1[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x298602['query'][_0xd425('0x23')]);_0x3275b1[_0xd425('0x21')]=qs[_0xd425('0x21')](_0x298602[_0xd425('0x3b')]['offset']);}_0x3275b1[_0xd425('0x42')]=qs[_0xd425('0x43')](_0x298602['query']['sort']);_0x3275b1['where']=qs[_0xd425('0x44')](_[_0xd425('0x45')](_0x298602[_0xd425('0x3b')],_0x1abf33['filters']),_0x40c392);if(_0x298602['query']['filter']){_0x3275b1[_0xd425('0x46')]=_[_0xd425('0x47')](_0x3275b1[_0xd425('0x46')],{'$or':_[_0xd425('0x34')](_0x40c392,function(_0xa9fd7c){if(_0xa9fd7c[_0xd425('0x38')]!==_0xd425('0x48')){var _0x4b922f={};_0x4b922f[_0xa9fd7c[_0xd425('0x31')]]={'$like':'%'+_0x298602[_0xd425('0x3b')][_0xd425('0x49')]+'%'};return _0x4b922f;}})});}_0x3275b1=_['merge']({},_0x3275b1,_0x298602[_0xd425('0x4a')]);var _0x2dffc7={'where':_0x3275b1[_0xd425('0x46')]};return db['AnalyticMetric'][_0xd425('0x24')](_0x2dffc7)[_0xd425('0x2a')](function(_0x1c5ba6){_0x47405f[_0xd425('0x24')]=_0x1c5ba6;if(_0x298602['query'][_0xd425('0x4b')]){_0x3275b1[_0xd425('0x4c')]=[{'all':!![]}];}return db[_0xd425('0x35')][_0xd425('0x4d')](_0x3275b1);})[_0xd425('0x2a')](function(_0x2f6bf7){_0x47405f[_0xd425('0x4e')]=_0x2f6bf7;return _0x47405f;})['then'](respondWithFilteredResult(_0x3695dd,_0x3275b1))[_0xd425('0x4f')](handleError(_0x3695dd,null));};exports[_0xd425('0x50')]=function(_0x5b65fe,_0x1a44a8){var _0x491c51={'raw':!![],'where':{'id':_0x5b65fe[_0xd425('0x51')]['id']}},_0x5e12bf={};_0x5e12bf['model']=_[_0xd425('0x3c')](db['AnalyticMetric'][_0xd425('0x36')]);_0x5e12bf[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x5b65fe[_0xd425('0x3b')]);_0x5e12bf[_0xd425('0x44')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],_0x5e12bf['query']);_0x491c51[_0xd425('0x3d')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],qs[_0xd425('0x3f')](_0x5b65fe[_0xd425('0x3b')][_0xd425('0x3f')]));_0x491c51[_0xd425('0x3d')]=_0x491c51['attributes'][_0xd425('0x40')]?_0x491c51[_0xd425('0x3d')]:_0x5e12bf[_0xd425('0x3a')];if(_0x5b65fe[_0xd425('0x3b')][_0xd425('0x4b')]){_0x491c51['include']=[{'all':!![]}];}_0x491c51=_[_0xd425('0x47')]({},_0x491c51,_0x5b65fe[_0xd425('0x4a')]);return db[_0xd425('0x35')][_0xd425('0x52')](_0x491c51)[_0xd425('0x2a')](handleEntityNotFound(_0x1a44a8,null))[_0xd425('0x2a')](respondWithResult(_0x1a44a8,null))['catch'](handleError(_0x1a44a8,null));};exports[_0xd425('0x53')]=function(_0x128cb3,_0x5bfac6){return db[_0xd425('0x35')][_0xd425('0x53')](_0x128cb3[_0xd425('0x54')],{})[_0xd425('0x2a')](function(_0x5c0219){var _0x54f1d=_0x128cb3[_0xd425('0x55')][_0xd425('0x2b')]({'plain':!![]});if(!_0x54f1d)throw new Error(_0xd425('0x56'));if(_0x54f1d[_0xd425('0x57')]==='user'){var _0x4be6fa=_0x5c0219[_0xd425('0x2b')]({'plain':!![]});var _0x5496d8=_0xd425('0x2c');return db[_0xd425('0x58')]['find']({'where':{'name':_0x5496d8,'userProfileId':_0x54f1d[_0xd425('0x59')]},'raw':!![]})['then'](function(_0x48d5b8){if(_0x48d5b8&&_0x48d5b8[_0xd425('0x5a')]===0x0){return db[_0xd425('0x2d')][_0xd425('0x53')]({'name':_0x4be6fa[_0xd425('0x31')],'resourceId':_0x4be6fa['id'],'type':_0x48d5b8[_0xd425('0x31')],'sectionId':_0x48d5b8['id']},{})[_0xd425('0x2a')](function(){return _0x5c0219;});}else{return _0x5c0219;}})[_0xd425('0x4f')](function(_0x4118fe){logger['error'](_0xd425('0x5b'),_0x4118fe);throw _0x4118fe;});}return _0x5c0219;})[_0xd425('0x2a')](respondWithResult(_0x5bfac6,0xc9))[_0xd425('0x4f')](handleError(_0x5bfac6,null));};exports[_0xd425('0x29')]=function(_0x7b1080,_0x1c80c2){if(_0x7b1080[_0xd425('0x54')]['id']){delete _0x7b1080[_0xd425('0x54')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0x7b1080['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x1c80c2,null))[_0xd425('0x2a')](saveUpdates(_0x7b1080[_0xd425('0x54')],null))[_0xd425('0x2a')](respondWithResult(_0x1c80c2,null))['catch'](handleError(_0x1c80c2,null));};exports['destroy']=function(_0x499a60,_0x5e1294){return db[_0xd425('0x35')][_0xd425('0x52')]({'where':{'id':_0x499a60['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x5e1294,null))[_0xd425('0x2a')](removeEntity(_0x5e1294,null))[_0xd425('0x4f')](handleError(_0x5e1294,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 31c4d91..7af3a06 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 _0xe0ae=['api','bluebird','path','rimraf','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','../../config/logger'];(function(_0x32a01a,_0xf83be0){var _0x4839cf=function(_0x533088){while(--_0x533088){_0x32a01a['push'](_0x32a01a['shift']());}};_0x4839cf(++_0xf83be0);}(_0xe0ae,0xa1));var _0xee0a=function(_0x49c653,_0x390195){_0x49c653=_0x49c653-0x0;var _0x31e169=_0xe0ae[_0x49c653];return _0x31e169;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xee0a('0x0'))(_0xee0a('0x1'));var moment=require('moment');var BPromise=require(_0xee0a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xee0a('0x3'));var rimraf=require(_0xee0a('0x4'));var config=require('../../config/environment');var attributes=require(_0xee0a('0x5'));module['exports']=function(_0x5bef07,_0x39a302){return _0x5bef07[_0xee0a('0x6')](_0xee0a('0x7'),attributes,{'tableName':_0xee0a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x51f2=['analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticMetric.attributes','exports','define'];(function(_0x20b29c,_0xe22528){var _0x20d81b=function(_0xd63a71){while(--_0xd63a71){_0x20b29c['push'](_0x20b29c['shift']());}};_0x20d81b(++_0xe22528);}(_0x51f2,0xeb));var _0x251f=function(_0x1349d5,_0x3d33b5){_0x1349d5=_0x1349d5-0x0;var _0x3478bb=_0x51f2[_0x1349d5];return _0x3478bb;};'use strict';var _=require(_0x251f('0x0'));var util=require(_0x251f('0x1'));var logger=require(_0x251f('0x2'))(_0x251f('0x3'));var moment=require(_0x251f('0x4'));var BPromise=require(_0x251f('0x5'));var rp=require(_0x251f('0x6'));var fs=require('fs');var path=require(_0x251f('0x7'));var rimraf=require(_0x251f('0x8'));var config=require('../../config/environment');var attributes=require(_0x251f('0x9'));module[_0x251f('0xa')]=function(_0x145630,_0xd9d8e1){return _0x145630[_0x251f('0xb')]('AnalyticMetric',attributes,{'tableName':_0x251f('0xc'),'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 0246614..722b058 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 _0x052a=['info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','randomstring','../../config/utils','rpc','jayson/promise','client','http','request','then'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x052a,0xfd));var _0xa052=function(_0x31e5cb,_0x2f5adf){_0x31e5cb=_0x31e5cb-0x0;var _0x4170df=_0x052a[_0x31e5cb];return _0x4170df;};'use strict';var _=require(_0xa052('0x0'));var util=require(_0xa052('0x1'));var moment=require(_0xa052('0x2'));var BPromise=require('bluebird');var rs=require(_0xa052('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa052('0x4'));var logger=require('../../config/logger')(_0xa052('0x5'));var config=require('../../config/environment');var jayson=require(_0xa052('0x6'));var client=jayson[_0xa052('0x7')][_0xa052('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3453d7,_0x147bf3,_0x37372b){return new BPromise(function(_0x5285a1,_0x471896){return client[_0xa052('0x9')](_0x3453d7,_0x37372b)[_0xa052('0xa')](function(_0x51c9ee){logger[_0xa052('0xb')](_0xa052('0xc'),_0x147bf3,_0xa052('0xd'));logger[_0xa052('0xe')](_0xa052('0xf'),_0x147bf3,_0xa052('0xd'),JSON[_0xa052('0x10')](_0x51c9ee));if(_0x51c9ee['error']){if(_0x51c9ee['error'][_0xa052('0x11')]===0x1f4){logger[_0xa052('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x147bf3,_0x51c9ee[_0xa052('0x12')][_0xa052('0x13')]);return _0x471896(_0x51c9ee[_0xa052('0x12')][_0xa052('0x13')]);}logger[_0xa052('0x12')](_0xa052('0xc'),_0x147bf3,_0x51c9ee[_0xa052('0x12')][_0xa052('0x13')]);return _0x5285a1(_0x51c9ee[_0xa052('0x12')][_0xa052('0x13')]);}else{logger['info'](_0xa052('0xc'),_0x147bf3,_0xa052('0xd'));_0x5285a1(_0x51c9ee[_0xa052('0x14')][_0xa052('0x13')]);}})[_0xa052('0x15')](function(_0x1b6814){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x147bf3,_0x1b6814);_0x471896(_0x1b6814);});});} \ No newline at end of file +var _0x416a=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash'];(function(_0x5eee2a,_0x983d85){var _0x192b00=function(_0x2babf2){while(--_0x2babf2){_0x5eee2a['push'](_0x5eee2a['shift']());}};_0x192b00(++_0x983d85);}(_0x416a,0x141));var _0xa416=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x416a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa416('0x0'));var util=require(_0xa416('0x1'));var moment=require(_0xa416('0x2'));var BPromise=require(_0xa416('0x3'));var rs=require(_0xa416('0x4'));var fs=require('fs');var Redis=require(_0xa416('0x5'));var db=require(_0xa416('0x6'))['db'];var utils=require(_0xa416('0x7'));var logger=require(_0xa416('0x8'))(_0xa416('0x9'));var config=require(_0xa416('0xa'));var jayson=require(_0xa416('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x303b14,_0x4e1ec7,_0x1c6a88){return new BPromise(function(_0x25d7a7,_0x14d872){return client[_0xa416('0xc')](_0x303b14,_0x1c6a88)[_0xa416('0xd')](function(_0x403e89){logger[_0xa416('0xe')](_0xa416('0xf'),_0x4e1ec7,_0xa416('0x10'));logger[_0xa416('0x11')](_0xa416('0x12'),_0x4e1ec7,_0xa416('0x10'),JSON[_0xa416('0x13')](_0x403e89));if(_0x403e89['error']){if(_0x403e89[_0xa416('0x14')][_0xa416('0x15')]===0x1f4){logger[_0xa416('0x14')]('AnalyticMetric,\x20%s,\x20%s',_0x4e1ec7,_0x403e89['error'][_0xa416('0x16')]);return _0x14d872(_0x403e89[_0xa416('0x14')][_0xa416('0x16')]);}logger[_0xa416('0x14')]('AnalyticMetric,\x20%s,\x20%s',_0x4e1ec7,_0x403e89[_0xa416('0x14')]['message']);return _0x25d7a7(_0x403e89[_0xa416('0x14')][_0xa416('0x16')]);}else{logger[_0xa416('0xe')](_0xa416('0xf'),_0x4e1ec7,_0xa416('0x10'));_0x25d7a7(_0x403e89['result'][_0xa416('0x16')]);}})['catch'](function(_0x31d704){logger[_0xa416('0x14')](_0xa416('0xf'),_0x4e1ec7,_0x31d704);_0x14d872(_0x31d704);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 67f80a9..821d7dd 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 _0xaab2=['../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','post','create','put','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xaab2,0xca));var _0x2aab=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xaab2[_0xc6be3a];return _0x56a310;};'use strict';var multer=require('multer');var util=require(_0x2aab('0x0'));var path=require(_0x2aab('0x1'));var timeout=require(_0x2aab('0x2'));var express=require('express');var router=express[_0x2aab('0x3')]();var fs_extra=require(_0x2aab('0x4'));var auth=require(_0x2aab('0x5'));var interaction=require(_0x2aab('0x6'));var config=require(_0x2aab('0x7'));var controller=require('./analyticMetric.controller');router[_0x2aab('0x8')]('/',auth['isAuthenticated'](),controller[_0x2aab('0x9')]);router[_0x2aab('0x8')](_0x2aab('0xa'),auth[_0x2aab('0xb')](),controller['show']);router[_0x2aab('0xc')]('/',auth[_0x2aab('0xb')](),controller[_0x2aab('0xd')]);router[_0x2aab('0xe')](_0x2aab('0xa'),auth[_0x2aab('0xb')](),controller['update']);router['delete'](_0x2aab('0xa'),auth[_0x2aab('0xb')](),controller['destroy']);module[_0x2aab('0xf')]=router; \ No newline at end of file +var _0x5581=['./analyticMetric.controller','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x5de1bc,_0x434be1){var _0x19f4b8=function(_0x35f764){while(--_0x35f764){_0x5de1bc['push'](_0x5de1bc['shift']());}};_0x19f4b8(++_0x434be1);}(_0x5581,0x115));var _0x1558=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x5581[_0x3b0731];return _0x4204d7;};'use strict';var multer=require(_0x1558('0x0'));var util=require('util');var path=require(_0x1558('0x1'));var timeout=require(_0x1558('0x2'));var express=require(_0x1558('0x3'));var router=express[_0x1558('0x4')]();var fs_extra=require(_0x1558('0x5'));var auth=require(_0x1558('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1558('0x7'));var controller=require(_0x1558('0x8'));router['get']('/',auth[_0x1558('0x9')](),controller[_0x1558('0xa')]);router['get'](_0x1558('0xb'),auth[_0x1558('0x9')](),controller[_0x1558('0xc')]);router[_0x1558('0xd')]('/',auth[_0x1558('0x9')](),controller['create']);router[_0x1558('0xe')](_0x1558('0xb'),auth[_0x1558('0x9')](),controller[_0x1558('0xf')]);router[_0x1558('0x10')](_0x1558('0xb'),auth[_0x1558('0x9')](),controller[_0x1558('0x11')]);module[_0x1558('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 0239bee..ad8fcea 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 _0xb207=['TEXT','exports'];(function(_0x3c858f,_0x235201){var _0x198090=function(_0xc4c406){while(--_0xc4c406){_0x3c858f['push'](_0x3c858f['shift']());}};_0x198090(++_0x235201);}(_0xb207,0x95));var _0x7b20=function(_0x39758d,_0x346423){_0x39758d=_0x39758d-0x0;var _0x44ac11=_0xb207[_0x39758d];return _0x44ac11;};'use strict';var Sequelize=require('sequelize');module[_0x7b20('0x0')]={'tree':{'type':Sequelize[_0x7b20('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x7d51=['exports','sequelize'];(function(_0x3dd188,_0x4d848d){var _0x52a058=function(_0x2400ec){while(--_0x2400ec){_0x3dd188['push'](_0x3dd188['shift']());}};_0x52a058(++_0x4d848d);}(_0x7d51,0x1e9));var _0x17d5=function(_0x558346,_0x156abb){_0x558346=_0x558346-0x0;var _0x4edad0=_0x7d51[_0x558346];return _0x4edad0;};'use strict';var Sequelize=require(_0x17d5('0x0'));module[_0x17d5('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 8cfd961..a9ecf26 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 _0x268c=['filter','merge','options','includeAll','include','rows','catch','show','params','length','find','create','update','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','sort','where','pick','type','VIRTUAL'];(function(_0x4f137a,_0xc4857c){var _0x55456e=function(_0x27e08e){while(--_0x27e08e){_0x4f137a['push'](_0x4f137a['shift']());}};_0x55456e(++_0xc4857c);}(_0x268c,0xec));var _0xc268=function(_0x2af160,_0x765b1){_0x2af160=_0x2af160-0x0;var _0x439d67=_0x268c[_0x2af160];return _0x439d67;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc268('0x0'));var zipdir=require(_0xc268('0x1'));var jsonpatch=require(_0xc268('0x2'));var rp=require(_0xc268('0x3'));var moment=require(_0xc268('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc268('0x5'));var util=require('util');var path=require(_0xc268('0x6'));var sox=require(_0xc268('0x7'));var csv=require('to-csv');var ejs=require(_0xc268('0x8'));var fs=require('fs');var fs_extra=require(_0xc268('0x9'));var _=require(_0xc268('0xa'));var squel=require(_0xc268('0xb'));var crypto=require(_0xc268('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc268('0xd'));var toCsv=require(_0xc268('0xe'));var querystring=require(_0xc268('0xf'));var Papa=require(_0xc268('0x10'));var Redis=require(_0xc268('0x11'));var authService=require(_0xc268('0x12'));var qs=require(_0xc268('0x13'));var as=require(_0xc268('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc268('0x15'));var licenseUtil=require(_0xc268('0x16'));var db=require(_0xc268('0x17'))['db'];function respondWithStatusCode(_0x5b5916,_0x429ffc){_0x429ffc=_0x429ffc||0xcc;return function(_0x1edef2){if(_0x1edef2){return _0x5b5916[_0xc268('0x18')](_0x429ffc);}return _0x5b5916['status'](_0x429ffc)[_0xc268('0x19')]();};}function respondWithResult(_0x20d673,_0xe5db75){_0xe5db75=_0xe5db75||0xc8;return function(_0x373558){if(_0x373558){return _0x20d673[_0xc268('0x1a')](_0xe5db75)[_0xc268('0x1b')](_0x373558);}};}function respondWithFilteredResult(_0x498ad7,_0x5ce739){return function(_0x278076){if(_0x278076){var _0x4dbc47=typeof _0x5ce739[_0xc268('0x1c')]===_0xc268('0x1d')&&typeof _0x5ce739[_0xc268('0x1e')]===_0xc268('0x1d');var _0x43fe0c=_0x278076[_0xc268('0x1f')];var _0x2c3c3e=_0x4dbc47?0x0:_0x5ce739[_0xc268('0x1c')];var _0x3f0494=_0x4dbc47?_0x278076['count']:_0x5ce739[_0xc268('0x1c')]+_0x5ce739[_0xc268('0x1e')];var _0x2f4e26;if(_0x3f0494>=_0x43fe0c){_0x3f0494=_0x43fe0c;_0x2f4e26=0xc8;}else{_0x2f4e26=0xce;}_0x498ad7[_0xc268('0x1a')](_0x2f4e26);return _0x498ad7[_0xc268('0x20')](_0xc268('0x21'),_0x2c3c3e+'-'+_0x3f0494+'/'+_0x43fe0c)[_0xc268('0x1b')](_0x278076);}return null;};}function patchUpdates(_0x20f2ff){return function(_0x7fcf7){try{jsonpatch[_0xc268('0x22')](_0x7fcf7,_0x20f2ff,!![]);}catch(_0x247a6){return BPromise[_0xc268('0x23')](_0x247a6);}return _0x7fcf7['save']();};}function saveUpdates(_0x3bf080,_0x3c5c78){return function(_0x363e3c){if(_0x363e3c){return _0x363e3c['update'](_0x3bf080)[_0xc268('0x24')](function(_0x3ea94e){return _0x3ea94e;});}return null;};}function removeEntity(_0x275d47,_0x1ef316){return function(_0x2437ac){if(_0x2437ac){return _0x2437ac[_0xc268('0x25')]()[_0xc268('0x24')](function(){_0x275d47['status'](0xcc)[_0xc268('0x19')]();});}};}function handleEntityNotFound(_0x2c55a9,_0x53a606){return function(_0x5a6f0f){if(!_0x5a6f0f){_0x2c55a9[_0xc268('0x18')](0x194);}return _0x5a6f0f;};}function handleError(_0x40d2fd,_0x93c73e){_0x93c73e=_0x93c73e||0x1f4;return function(_0x374212){logger[_0xc268('0x26')](_0x374212[_0xc268('0x27')]);if(_0x374212[_0xc268('0x28')]){delete _0x374212[_0xc268('0x28')];}_0x40d2fd['status'](_0x93c73e)[_0xc268('0x29')](_0x374212);};}exports[_0xc268('0x2a')]=function(_0x2366eb,_0x48df1a){var _0x26d29c={},_0x179ea2={},_0x48c557={'count':0x0,'rows':[]};var _0x437aa5=_['map'](db[_0xc268('0x2b')][_0xc268('0x2c')],function(_0x50ffe1){return{'name':_0x50ffe1[_0xc268('0x2d')],'type':_0x50ffe1['type'][_0xc268('0x2e')]};});_0x179ea2['model']=_[_0xc268('0x2f')](_0x437aa5,_0xc268('0x28'));_0x179ea2[_0xc268('0x30')]=_[_0xc268('0x31')](_0x2366eb[_0xc268('0x30')]);_0x179ea2[_0xc268('0x32')]=_[_0xc268('0x33')](_0x179ea2[_0xc268('0x34')],_0x179ea2[_0xc268('0x30')]);_0x26d29c[_0xc268('0x35')]=_[_0xc268('0x33')](_0x179ea2['model'],qs[_0xc268('0x36')](_0x2366eb[_0xc268('0x30')][_0xc268('0x36')]));_0x26d29c[_0xc268('0x35')]=_0x26d29c[_0xc268('0x35')]['length']?_0x26d29c[_0xc268('0x35')]:_0x179ea2[_0xc268('0x34')];if(!_0x2366eb[_0xc268('0x30')]['hasOwnProperty']('nolimit')){_0x26d29c[_0xc268('0x1e')]=qs[_0xc268('0x1e')](_0x2366eb[_0xc268('0x30')][_0xc268('0x1e')]);_0x26d29c[_0xc268('0x1c')]=qs[_0xc268('0x1c')](_0x2366eb['query'][_0xc268('0x1c')]);}_0x26d29c['order']=qs[_0xc268('0x37')](_0x2366eb['query'][_0xc268('0x37')]);_0x26d29c[_0xc268('0x38')]=qs[_0xc268('0x32')](_[_0xc268('0x39')](_0x2366eb[_0xc268('0x30')],_0x179ea2[_0xc268('0x32')]),_0x437aa5);if(_0x2366eb['query']['filter']){_0x26d29c[_0xc268('0x38')]=_['merge'](_0x26d29c['where'],{'$or':_['map'](_0x437aa5,function(_0x4d4b2a){if(_0x4d4b2a[_0xc268('0x3a')]!==_0xc268('0x3b')){var _0x2f6133={};_0x2f6133[_0x4d4b2a[_0xc268('0x28')]]={'$like':'%'+_0x2366eb[_0xc268('0x30')][_0xc268('0x3c')]+'%'};return _0x2f6133;}})});}_0x26d29c=_[_0xc268('0x3d')]({},_0x26d29c,_0x2366eb[_0xc268('0x3e')]);var _0x589ce6={'where':_0x26d29c[_0xc268('0x38')]};return db[_0xc268('0x2b')][_0xc268('0x1f')](_0x589ce6)[_0xc268('0x24')](function(_0x21dda5){_0x48c557[_0xc268('0x1f')]=_0x21dda5;if(_0x2366eb[_0xc268('0x30')][_0xc268('0x3f')]){_0x26d29c[_0xc268('0x40')]=[{'all':!![]}];}return db[_0xc268('0x2b')]['findAll'](_0x26d29c);})[_0xc268('0x24')](function(_0x5818bd){_0x48c557[_0xc268('0x41')]=_0x5818bd;return _0x48c557;})[_0xc268('0x24')](respondWithFilteredResult(_0x48df1a,_0x26d29c))[_0xc268('0x42')](handleError(_0x48df1a,null));};exports[_0xc268('0x43')]=function(_0x46d693,_0x38918c){var _0x3182ea={'raw':!![],'where':{'id':_0x46d693[_0xc268('0x44')]['id']}},_0x20cb9c={};_0x20cb9c['model']=_[_0xc268('0x31')](db[_0xc268('0x2b')][_0xc268('0x2c')]);_0x20cb9c[_0xc268('0x30')]=_[_0xc268('0x31')](_0x46d693[_0xc268('0x30')]);_0x20cb9c[_0xc268('0x32')]=_[_0xc268('0x33')](_0x20cb9c[_0xc268('0x34')],_0x20cb9c['query']);_0x3182ea['attributes']=_['intersection'](_0x20cb9c[_0xc268('0x34')],qs[_0xc268('0x36')](_0x46d693[_0xc268('0x30')][_0xc268('0x36')]));_0x3182ea[_0xc268('0x35')]=_0x3182ea[_0xc268('0x35')][_0xc268('0x45')]?_0x3182ea['attributes']:_0x20cb9c[_0xc268('0x34')];if(_0x46d693[_0xc268('0x30')][_0xc268('0x3f')]){_0x3182ea['include']=[{'all':!![]}];}_0x3182ea=_['merge']({},_0x3182ea,_0x46d693[_0xc268('0x3e')]);return db['AnalyticTreeReport'][_0xc268('0x46')](_0x3182ea)[_0xc268('0x24')](handleEntityNotFound(_0x38918c,null))[_0xc268('0x24')](respondWithResult(_0x38918c,null))[_0xc268('0x42')](handleError(_0x38918c,null));};exports[_0xc268('0x47')]=function(_0xe2cae7,_0x5ac6bb){return db[_0xc268('0x2b')][_0xc268('0x47')](_0xe2cae7['body'],{})[_0xc268('0x24')](respondWithResult(_0x5ac6bb,0xc9))[_0xc268('0x42')](handleError(_0x5ac6bb,null));};exports[_0xc268('0x48')]=function(_0x3ecb8c,_0x581194){if(_0x3ecb8c[_0xc268('0x49')]['id']){delete _0x3ecb8c[_0xc268('0x49')]['id'];}return db[_0xc268('0x2b')][_0xc268('0x46')]({'where':{'id':_0x3ecb8c[_0xc268('0x44')]['id']}})[_0xc268('0x24')](handleEntityNotFound(_0x581194,null))[_0xc268('0x24')](saveUpdates(_0x3ecb8c[_0xc268('0x49')],null))[_0xc268('0x24')](respondWithResult(_0x581194,null))['catch'](handleError(_0x581194,null));};exports['destroy']=function(_0x50059b,_0xa37665){return db[_0xc268('0x2b')][_0xc268('0x46')]({'where':{'id':_0x50059b[_0xc268('0x44')]['id']}})[_0xc268('0x24')](handleEntityNotFound(_0xa37665,null))['then'](removeEntity(_0xa37665,null))['catch'](handleError(_0xa37665,null));}; \ No newline at end of file +var _0xedca=['../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','update','destroy','then','stack','name','send','index','map','AnalyticTreeReport','fieldName','type','model','query','filters','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','rawAttributes','intersection','fields','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils'];(function(_0x31218c,_0x28ae34){var _0x13e4ab=function(_0x3e0521){while(--_0x3e0521){_0x31218c['push'](_0x31218c['shift']());}};_0x13e4ab(++_0x28ae34);}(_0xedca,0x1ef));var _0xaedc=function(_0x30196b,_0x291493){_0x30196b=_0x30196b-0x0;var _0xdf5085=_0xedca[_0x30196b];return _0xdf5085;};'use strict';var emlformat=require(_0xaedc('0x0'));var rimraf=require(_0xaedc('0x1'));var zipdir=require(_0xaedc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaedc('0x3'));var moment=require(_0xaedc('0x4'));var BPromise=require(_0xaedc('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xaedc('0x6'));var sox=require(_0xaedc('0x7'));var csv=require('to-csv');var ejs=require(_0xaedc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaedc('0x9'));var squel=require(_0xaedc('0xa'));var crypto=require(_0xaedc('0xb'));var jsforce=require(_0xaedc('0xc'));var deskjs=require(_0xaedc('0xd'));var toCsv=require(_0xaedc('0xe'));var querystring=require(_0xaedc('0xf'));var Papa=require(_0xaedc('0x10'));var Redis=require(_0xaedc('0x11'));var authService=require(_0xaedc('0x12'));var qs=require(_0xaedc('0x13'));var as=require(_0xaedc('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xaedc('0x15'));var utils=require(_0xaedc('0x16'));var config=require(_0xaedc('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c82dd,_0x196f29){_0x196f29=_0x196f29||0xcc;return function(_0x3b5f9f){if(_0x3b5f9f){return _0x2c82dd[_0xaedc('0x18')](_0x196f29);}return _0x2c82dd[_0xaedc('0x19')](_0x196f29)[_0xaedc('0x1a')]();};}function respondWithResult(_0x4e6c78,_0x5473a4){_0x5473a4=_0x5473a4||0xc8;return function(_0x31a8b5){if(_0x31a8b5){return _0x4e6c78[_0xaedc('0x19')](_0x5473a4)[_0xaedc('0x1b')](_0x31a8b5);}};}function respondWithFilteredResult(_0x5ae59d,_0x4faf62){return function(_0x13c87e){if(_0x13c87e){var _0x436307=typeof _0x4faf62[_0xaedc('0x1c')]==='undefined'&&typeof _0x4faf62[_0xaedc('0x1d')]===_0xaedc('0x1e');var _0x531ec7=_0x13c87e[_0xaedc('0x1f')];var _0x44ef2b=_0x436307?0x0:_0x4faf62['offset'];var _0x1d0957=_0x436307?_0x13c87e['count']:_0x4faf62['offset']+_0x4faf62['limit'];var _0x884a0e;if(_0x1d0957>=_0x531ec7){_0x1d0957=_0x531ec7;_0x884a0e=0xc8;}else{_0x884a0e=0xce;}_0x5ae59d[_0xaedc('0x19')](_0x884a0e);return _0x5ae59d[_0xaedc('0x20')](_0xaedc('0x21'),_0x44ef2b+'-'+_0x1d0957+'/'+_0x531ec7)[_0xaedc('0x1b')](_0x13c87e);}return null;};}function patchUpdates(_0x39939c){return function(_0xdc36bb){try{jsonpatch['apply'](_0xdc36bb,_0x39939c,!![]);}catch(_0x141e00){return BPromise[_0xaedc('0x22')](_0x141e00);}return _0xdc36bb['save']();};}function saveUpdates(_0x57117e,_0x2cf077){return function(_0x442779){if(_0x442779){return _0x442779[_0xaedc('0x23')](_0x57117e)['then'](function(_0x2df931){return _0x2df931;});}return null;};}function removeEntity(_0x56fee9,_0xce14ae){return function(_0x3b73d2){if(_0x3b73d2){return _0x3b73d2[_0xaedc('0x24')]()[_0xaedc('0x25')](function(){_0x56fee9[_0xaedc('0x19')](0xcc)[_0xaedc('0x1a')]();});}};}function handleEntityNotFound(_0x55492b,_0x3d8093){return function(_0x423f8d){if(!_0x423f8d){_0x55492b[_0xaedc('0x18')](0x194);}return _0x423f8d;};}function handleError(_0x541562,_0x26e519){_0x26e519=_0x26e519||0x1f4;return function(_0x10c292){logger['error'](_0x10c292[_0xaedc('0x26')]);if(_0x10c292[_0xaedc('0x27')]){delete _0x10c292[_0xaedc('0x27')];}_0x541562[_0xaedc('0x19')](_0x26e519)[_0xaedc('0x28')](_0x10c292);};}exports[_0xaedc('0x29')]=function(_0x59b22c,_0x4b952e){var _0x34a68e={},_0x3def67={},_0x149e43={'count':0x0,'rows':[]};var _0x4f5678=_[_0xaedc('0x2a')](db[_0xaedc('0x2b')]['rawAttributes'],function(_0x1a6e56){return{'name':_0x1a6e56[_0xaedc('0x2c')],'type':_0x1a6e56[_0xaedc('0x2d')]['key']};});_0x3def67[_0xaedc('0x2e')]=_[_0xaedc('0x2a')](_0x4f5678,_0xaedc('0x27'));_0x3def67[_0xaedc('0x2f')]=_['keys'](_0x59b22c[_0xaedc('0x2f')]);_0x3def67[_0xaedc('0x30')]=_['intersection'](_0x3def67[_0xaedc('0x2e')],_0x3def67[_0xaedc('0x2f')]);_0x34a68e[_0xaedc('0x31')]=_['intersection'](_0x3def67[_0xaedc('0x2e')],qs['fields'](_0x59b22c[_0xaedc('0x2f')]['fields']));_0x34a68e[_0xaedc('0x31')]=_0x34a68e[_0xaedc('0x31')][_0xaedc('0x32')]?_0x34a68e[_0xaedc('0x31')]:_0x3def67[_0xaedc('0x2e')];if(!_0x59b22c[_0xaedc('0x2f')][_0xaedc('0x33')](_0xaedc('0x34'))){_0x34a68e[_0xaedc('0x1d')]=qs[_0xaedc('0x1d')](_0x59b22c[_0xaedc('0x2f')]['limit']);_0x34a68e[_0xaedc('0x1c')]=qs[_0xaedc('0x1c')](_0x59b22c[_0xaedc('0x2f')][_0xaedc('0x1c')]);}_0x34a68e['order']=qs[_0xaedc('0x35')](_0x59b22c[_0xaedc('0x2f')][_0xaedc('0x35')]);_0x34a68e[_0xaedc('0x36')]=qs[_0xaedc('0x30')](_[_0xaedc('0x37')](_0x59b22c[_0xaedc('0x2f')],_0x3def67[_0xaedc('0x30')]),_0x4f5678);if(_0x59b22c[_0xaedc('0x2f')][_0xaedc('0x38')]){_0x34a68e[_0xaedc('0x36')]=_[_0xaedc('0x39')](_0x34a68e[_0xaedc('0x36')],{'$or':_['map'](_0x4f5678,function(_0x39e048){if(_0x39e048[_0xaedc('0x2d')]!==_0xaedc('0x3a')){var _0x7088e1={};_0x7088e1[_0x39e048[_0xaedc('0x27')]]={'$like':'%'+_0x59b22c[_0xaedc('0x2f')][_0xaedc('0x38')]+'%'};return _0x7088e1;}})});}_0x34a68e=_[_0xaedc('0x39')]({},_0x34a68e,_0x59b22c[_0xaedc('0x3b')]);var _0x5884cb={'where':_0x34a68e[_0xaedc('0x36')]};return db[_0xaedc('0x2b')]['count'](_0x5884cb)['then'](function(_0x36de85){_0x149e43['count']=_0x36de85;if(_0x59b22c['query']['includeAll']){_0x34a68e[_0xaedc('0x3c')]=[{'all':!![]}];}return db[_0xaedc('0x2b')][_0xaedc('0x3d')](_0x34a68e);})[_0xaedc('0x25')](function(_0xe52d15){_0x149e43[_0xaedc('0x3e')]=_0xe52d15;return _0x149e43;})[_0xaedc('0x25')](respondWithFilteredResult(_0x4b952e,_0x34a68e))['catch'](handleError(_0x4b952e,null));};exports[_0xaedc('0x3f')]=function(_0x26cc32,_0x2806d0){var _0x2b9b42={'raw':!![],'where':{'id':_0x26cc32[_0xaedc('0x40')]['id']}},_0x2754cb={};_0x2754cb['model']=_[_0xaedc('0x41')](db[_0xaedc('0x2b')][_0xaedc('0x42')]);_0x2754cb[_0xaedc('0x2f')]=_[_0xaedc('0x41')](_0x26cc32['query']);_0x2754cb[_0xaedc('0x30')]=_[_0xaedc('0x43')](_0x2754cb[_0xaedc('0x2e')],_0x2754cb[_0xaedc('0x2f')]);_0x2b9b42[_0xaedc('0x31')]=_[_0xaedc('0x43')](_0x2754cb[_0xaedc('0x2e')],qs[_0xaedc('0x44')](_0x26cc32[_0xaedc('0x2f')][_0xaedc('0x44')]));_0x2b9b42[_0xaedc('0x31')]=_0x2b9b42[_0xaedc('0x31')][_0xaedc('0x32')]?_0x2b9b42[_0xaedc('0x31')]:_0x2754cb[_0xaedc('0x2e')];if(_0x26cc32[_0xaedc('0x2f')][_0xaedc('0x45')]){_0x2b9b42['include']=[{'all':!![]}];}_0x2b9b42=_['merge']({},_0x2b9b42,_0x26cc32[_0xaedc('0x3b')]);return db[_0xaedc('0x2b')][_0xaedc('0x46')](_0x2b9b42)[_0xaedc('0x25')](handleEntityNotFound(_0x2806d0,null))['then'](respondWithResult(_0x2806d0,null))[_0xaedc('0x47')](handleError(_0x2806d0,null));};exports[_0xaedc('0x48')]=function(_0x5ec603,_0x456988){return db[_0xaedc('0x2b')][_0xaedc('0x48')](_0x5ec603[_0xaedc('0x49')],{})['then'](respondWithResult(_0x456988,0xc9))[_0xaedc('0x47')](handleError(_0x456988,null));};exports['update']=function(_0x4c789f,_0x3cddb1){if(_0x4c789f['body']['id']){delete _0x4c789f[_0xaedc('0x49')]['id'];}return db[_0xaedc('0x2b')][_0xaedc('0x46')]({'where':{'id':_0x4c789f[_0xaedc('0x40')]['id']}})[_0xaedc('0x25')](handleEntityNotFound(_0x3cddb1,null))[_0xaedc('0x25')](saveUpdates(_0x4c789f['body'],null))[_0xaedc('0x25')](respondWithResult(_0x3cddb1,null))[_0xaedc('0x47')](handleError(_0x3cddb1,null));};exports['destroy']=function(_0x14ddc0,_0x31da1f){return db['AnalyticTreeReport'][_0xaedc('0x46')]({'where':{'id':_0x14ddc0[_0xaedc('0x40')]['id']}})[_0xaedc('0x25')](handleEntityNotFound(_0x31da1f,null))['then'](removeEntity(_0x31da1f,null))['catch'](handleError(_0x31da1f,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index f323f1d..57b87c6 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 _0xcaac=['exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','request-promise','rimraf','./analyticTreeReport.attributes'];(function(_0x3dd306,_0x127ba7){var _0x32d7f7=function(_0x5d1adf){while(--_0x5d1adf){_0x3dd306['push'](_0x3dd306['shift']());}};_0x32d7f7(++_0x127ba7);}(_0xcaac,0x1d8));var _0xccaa=function(_0x485a5d,_0x4f346b){_0x485a5d=_0x485a5d-0x0;var _0xd13bf5=_0xcaac[_0x485a5d];return _0xd13bf5;};'use strict';var _=require(_0xccaa('0x0'));var util=require(_0xccaa('0x1'));var logger=require(_0xccaa('0x2'))(_0xccaa('0x3'));var moment=require(_0xccaa('0x4'));var BPromise=require('bluebird');var rp=require(_0xccaa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xccaa('0x6'));var config=require('../../config/environment');var attributes=require(_0xccaa('0x7'));module[_0xccaa('0x8')]=function(_0x4b7e53,_0x52a95a){return _0x4b7e53[_0xccaa('0x9')](_0xccaa('0xa'),attributes,{'tableName':_0xccaa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbbaa=['../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x85ee24,_0x164147){var _0x4b0c51=function(_0x4a8948){while(--_0x4a8948){_0x85ee24['push'](_0x85ee24['shift']());}};_0x4b0c51(++_0x164147);}(_0xbbaa,0x18c));var _0xabba=function(_0x2881cd,_0x1dd6cd){_0x2881cd=_0x2881cd-0x0;var _0x125af7=_0xbbaa[_0x2881cd];return _0x125af7;};'use strict';var _=require(_0xabba('0x0'));var util=require(_0xabba('0x1'));var logger=require(_0xabba('0x2'))(_0xabba('0x3'));var moment=require(_0xabba('0x4'));var BPromise=require(_0xabba('0x5'));var rp=require(_0xabba('0x6'));var fs=require('fs');var path=require(_0xabba('0x7'));var rimraf=require(_0xabba('0x8'));var config=require(_0xabba('0x9'));var attributes=require(_0xabba('0xa'));module[_0xabba('0xb')]=function(_0x406231,_0x4fa9ac){return _0x406231[_0xabba('0xc')](_0xabba('0xd'),attributes,{'tableName':_0xabba('0xe'),'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 e716fda..cc701f5 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x2e1ca2,_0x1fe47b){var _0x2d5cb5=function(_0x2670a5){while(--_0x2670a5){_0x2e1ca2['push'](_0x2e1ca2['shift']());}};_0x2d5cb5(++_0x1fe47b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3283b1,_0x4db411){_0x3283b1=_0x3283b1-0x0;var _0x146da0=_0x5f2f[_0x3283b1];return _0x146da0;};'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')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x39234c,_0xd66b1d){var _0x49257b=function(_0x2a170a){while(--_0x2a170a){_0x39234c['push'](_0x39234c['shift']());}};_0x49257b(++_0xd66b1d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x7e6d00,_0x1660cf){_0x7e6d00=_0x7e6d00-0x0;var _0x2a81d7=_0x5f2f[_0x7e6d00];return _0x2a81d7;};'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')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 8b717a9..6c96dcd 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 _0x1ebb=['delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','get','post','/:id'];(function(_0x53a5f6,_0x4e0900){var _0x55deb4=function(_0x51c9dc){while(--_0x51c9dc){_0x53a5f6['push'](_0x53a5f6['shift']());}};_0x55deb4(++_0x4e0900);}(_0x1ebb,0x152));var _0xb1eb=function(_0x219760,_0x13f08e){_0x219760=_0x219760-0x0;var _0x41badc=_0x1ebb[_0x219760];return _0x41badc;};'use strict';var multer=require(_0xb1eb('0x0'));var util=require(_0xb1eb('0x1'));var path=require(_0xb1eb('0x2'));var timeout=require(_0xb1eb('0x3'));var express=require('express');var router=express[_0xb1eb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb1eb('0x5'));var interaction=require(_0xb1eb('0x6'));var config=require(_0xb1eb('0x7'));var controller=require(_0xb1eb('0x8'));router['get']('/',auth[_0xb1eb('0x9')](),controller[_0xb1eb('0xa')]);router[_0xb1eb('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xb1eb('0xc')]('/',auth[_0xb1eb('0x9')](),controller['create']);router['put'](_0xb1eb('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xb1eb('0xe')](_0xb1eb('0xd'),auth[_0xb1eb('0x9')](),controller[_0xb1eb('0xf')]);module['exports']=router; \ No newline at end of file +var _0x0278=['isAuthenticated','index','/:id','show','post','create','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get'];(function(_0x109b2e,_0x330b20){var _0x595a66=function(_0x2849c6){while(--_0x2849c6){_0x109b2e['push'](_0x109b2e['shift']());}};_0x595a66(++_0x330b20);}(_0x0278,0x1b9));var _0x8027=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x0278[_0x42245d];return _0x4b211a;};'use strict';var multer=require(_0x8027('0x0'));var util=require('util');var path=require(_0x8027('0x1'));var timeout=require(_0x8027('0x2'));var express=require('express');var router=express[_0x8027('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8027('0x4'));var interaction=require(_0x8027('0x5'));var config=require(_0x8027('0x6'));var controller=require(_0x8027('0x7'));router[_0x8027('0x8')]('/',auth[_0x8027('0x9')](),controller[_0x8027('0xa')]);router[_0x8027('0x8')](_0x8027('0xb'),auth[_0x8027('0x9')](),controller[_0x8027('0xc')]);router[_0x8027('0xd')]('/',auth[_0x8027('0x9')](),controller[_0x8027('0xe')]);router['put'](_0x8027('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8027('0xf')](_0x8027('0xb'),auth[_0x8027('0x9')](),controller[_0x8027('0x10')]);module[_0x8027('0x11')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index c8c2559..d335fd7 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 _0x34e5=['exports','STRING'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x34e5,0x172));var _0x534e=function(_0x1030d8,_0x56afb1){_0x1030d8=_0x1030d8-0x0;var _0x4d2b0a=_0x34e5[_0x1030d8];return _0x4d2b0a;};'use strict';var Sequelize=require('sequelize');module[_0x534e('0x0')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x534e('0x1')]},'type':{'type':Sequelize[_0x534e('0x1')]}}; \ No newline at end of file +var _0x8bdf=['sequelize','exports','STRING'];(function(_0x28a608,_0x563755){var _0x4b7256=function(_0x53652f){while(--_0x53652f){_0x28a608['push'](_0x28a608['shift']());}};_0x4b7256(++_0x563755);}(_0x8bdf,0x1a7));var _0xf8bd=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x8bdf[_0x5b561d];return _0x431060;};'use strict';var Sequelize=require(_0xf8bd('0x0'));module[_0xf8bd('0x1')]={'name':{'type':Sequelize[_0xf8bd('0x2')]},'basename':{'type':Sequelize[_0xf8bd('0x2')]},'type':{'type':Sequelize[_0xf8bd('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index c16f82c..f3439ee 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 _0xcf98=['keys','query','filters','intersection','model','attributes','fields','length','limit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','find','clone','options','get','omit','updatedAt','body','createdAt','create','file','basename','filename','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','set','apply','reject','save','update','then','sendStatus','stack','name','index','map','Attachment','rawAttributes','type','key'];(function(_0xf82311,_0x29504b){var _0x39d8fa=function(_0x27c1d2){while(--_0x27c1d2){_0xf82311['push'](_0xf82311['shift']());}};_0x39d8fa(++_0x29504b);}(_0xcf98,0x16f));var _0x8cf9=function(_0x27db0a,_0x37d347){_0x27db0a=_0x27db0a-0x0;var _0x4decce=_0xcf98[_0x27db0a];return _0x4decce;};'use strict';var emlformat=require(_0x8cf9('0x0'));var rimraf=require(_0x8cf9('0x1'));var zipdir=require(_0x8cf9('0x2'));var jsonpatch=require(_0x8cf9('0x3'));var rp=require(_0x8cf9('0x4'));var moment=require(_0x8cf9('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8cf9('0x6'));var path=require('path');var sox=require(_0x8cf9('0x7'));var csv=require(_0x8cf9('0x8'));var ejs=require(_0x8cf9('0x9'));var fs=require('fs');var fs_extra=require(_0x8cf9('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8cf9('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8cf9('0xc'));var Papa=require(_0x8cf9('0xd'));var Redis=require(_0x8cf9('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8cf9('0xf'));var hardwareService=require(_0x8cf9('0x10'));var logger=require(_0x8cf9('0x11'))(_0x8cf9('0x12'));var utils=require(_0x8cf9('0x13'));var config=require(_0x8cf9('0x14'));var licenseUtil=require(_0x8cf9('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5940ed,_0x32ae2c){_0x32ae2c=_0x32ae2c||0xcc;return function(_0x1ddb6e){if(_0x1ddb6e){return _0x5940ed['sendStatus'](_0x32ae2c);}return _0x5940ed[_0x8cf9('0x16')](_0x32ae2c)[_0x8cf9('0x17')]();};}function respondWithResult(_0x26d601,_0x320f44){_0x320f44=_0x320f44||0xc8;return function(_0x58e4ad){if(_0x58e4ad){return _0x26d601[_0x8cf9('0x16')](_0x320f44)[_0x8cf9('0x18')](_0x58e4ad);}};}function respondWithFilteredResult(_0x412b77,_0x573780){return function(_0x55a07d){if(_0x55a07d){var _0x2a23bd=typeof _0x573780[_0x8cf9('0x19')]===_0x8cf9('0x1a')&&typeof _0x573780['limit']===_0x8cf9('0x1a');var _0x231699=_0x55a07d[_0x8cf9('0x1b')];var _0x17dbae=_0x2a23bd?0x0:_0x573780[_0x8cf9('0x19')];var _0x259dbd=_0x2a23bd?_0x55a07d[_0x8cf9('0x1b')]:_0x573780['offset']+_0x573780['limit'];var _0x46d7e2;if(_0x259dbd>=_0x231699){_0x259dbd=_0x231699;_0x46d7e2=0xc8;}else{_0x46d7e2=0xce;}_0x412b77['status'](_0x46d7e2);return _0x412b77[_0x8cf9('0x1c')]('Content-Range',_0x17dbae+'-'+_0x259dbd+'/'+_0x231699)[_0x8cf9('0x18')](_0x55a07d);}return null;};}function patchUpdates(_0x12cbb4){return function(_0x393d8e){try{jsonpatch[_0x8cf9('0x1d')](_0x393d8e,_0x12cbb4,!![]);}catch(_0x25a2f3){return BPromise[_0x8cf9('0x1e')](_0x25a2f3);}return _0x393d8e[_0x8cf9('0x1f')]();};}function saveUpdates(_0x1268be,_0x6902c3){return function(_0x9b0290){if(_0x9b0290){return _0x9b0290[_0x8cf9('0x20')](_0x1268be)['then'](function(_0x2e5b8f){return _0x2e5b8f;});}return null;};}function removeEntity(_0x5655a9,_0x1c39b2){return function(_0x2f8584){if(_0x2f8584){return _0x2f8584['destroy']()[_0x8cf9('0x21')](function(){_0x5655a9[_0x8cf9('0x16')](0xcc)[_0x8cf9('0x17')]();});}};}function handleEntityNotFound(_0x1f7f31,_0x18b05c){return function(_0x3f385d){if(!_0x3f385d){_0x1f7f31[_0x8cf9('0x22')](0x194);}return _0x3f385d;};}function handleError(_0x534446,_0x51d1a8){_0x51d1a8=_0x51d1a8||0x1f4;return function(_0xc9df2){logger['error'](_0xc9df2[_0x8cf9('0x23')]);if(_0xc9df2[_0x8cf9('0x24')]){delete _0xc9df2['name'];}_0x534446[_0x8cf9('0x16')](_0x51d1a8)['send'](_0xc9df2);};}exports[_0x8cf9('0x25')]=function(_0x2e551a,_0xc07512){var _0x113154={},_0x2ba29b={},_0xff4e64={'count':0x0,'rows':[]};var _0x39a681=_[_0x8cf9('0x26')](db[_0x8cf9('0x27')][_0x8cf9('0x28')],function(_0x2421de){return{'name':_0x2421de['fieldName'],'type':_0x2421de[_0x8cf9('0x29')][_0x8cf9('0x2a')]};});_0x2ba29b['model']=_[_0x8cf9('0x26')](_0x39a681,'name');_0x2ba29b['query']=_[_0x8cf9('0x2b')](_0x2e551a[_0x8cf9('0x2c')]);_0x2ba29b[_0x8cf9('0x2d')]=_[_0x8cf9('0x2e')](_0x2ba29b[_0x8cf9('0x2f')],_0x2ba29b['query']);_0x113154[_0x8cf9('0x30')]=_[_0x8cf9('0x2e')](_0x2ba29b[_0x8cf9('0x2f')],qs[_0x8cf9('0x31')](_0x2e551a[_0x8cf9('0x2c')][_0x8cf9('0x31')]));_0x113154['attributes']=_0x113154[_0x8cf9('0x30')][_0x8cf9('0x32')]?_0x113154[_0x8cf9('0x30')]:_0x2ba29b[_0x8cf9('0x2f')];if(!_0x2e551a[_0x8cf9('0x2c')]['hasOwnProperty']('nolimit')){_0x113154[_0x8cf9('0x33')]=qs['limit'](_0x2e551a[_0x8cf9('0x2c')][_0x8cf9('0x33')]);_0x113154[_0x8cf9('0x19')]=qs['offset'](_0x2e551a[_0x8cf9('0x2c')][_0x8cf9('0x19')]);}_0x113154['order']=qs['sort'](_0x2e551a[_0x8cf9('0x2c')][_0x8cf9('0x34')]);_0x113154[_0x8cf9('0x35')]=qs[_0x8cf9('0x2d')](_[_0x8cf9('0x36')](_0x2e551a[_0x8cf9('0x2c')],_0x2ba29b[_0x8cf9('0x2d')]),_0x39a681);if(_0x2e551a[_0x8cf9('0x2c')][_0x8cf9('0x37')]){_0x113154[_0x8cf9('0x35')]=_[_0x8cf9('0x38')](_0x113154[_0x8cf9('0x35')],{'$or':_['map'](_0x39a681,function(_0x28b9b1){if(_0x28b9b1[_0x8cf9('0x29')]!==_0x8cf9('0x39')){var _0x3d5f08={};_0x3d5f08[_0x28b9b1[_0x8cf9('0x24')]]={'$like':'%'+_0x2e551a['query'][_0x8cf9('0x37')]+'%'};return _0x3d5f08;}})});}_0x113154=_[_0x8cf9('0x38')]({},_0x113154,_0x2e551a['options']);var _0x590bc0={'where':_0x113154[_0x8cf9('0x35')]};return db[_0x8cf9('0x27')][_0x8cf9('0x1b')](_0x590bc0)[_0x8cf9('0x21')](function(_0x208248){_0xff4e64[_0x8cf9('0x1b')]=_0x208248;if(_0x2e551a[_0x8cf9('0x2c')][_0x8cf9('0x3a')]){_0x113154[_0x8cf9('0x3b')]=[{'all':!![]}];}return db[_0x8cf9('0x27')][_0x8cf9('0x3c')](_0x113154);})[_0x8cf9('0x21')](function(_0x24d50c){_0xff4e64[_0x8cf9('0x3d')]=_0x24d50c;return _0xff4e64;})[_0x8cf9('0x21')](respondWithFilteredResult(_0xc07512,_0x113154))[_0x8cf9('0x3e')](handleError(_0xc07512,null));};exports['show']=function(_0x39e614,_0x156bfd){var _0x257a73={'raw':!![],'where':{'id':_0x39e614[_0x8cf9('0x3f')]['id']}},_0x16888d={};_0x16888d[_0x8cf9('0x2f')]=_[_0x8cf9('0x2b')](db['Attachment'][_0x8cf9('0x28')]);_0x16888d[_0x8cf9('0x2c')]=_['keys'](_0x39e614[_0x8cf9('0x2c')]);_0x16888d['filters']=_['intersection'](_0x16888d[_0x8cf9('0x2f')],_0x16888d[_0x8cf9('0x2c')]);_0x257a73[_0x8cf9('0x30')]=_['intersection'](_0x16888d[_0x8cf9('0x2f')],qs[_0x8cf9('0x31')](_0x39e614['query'][_0x8cf9('0x31')]));_0x257a73['attributes']=_0x257a73[_0x8cf9('0x30')][_0x8cf9('0x32')]?_0x257a73['attributes']:_0x16888d['model'];if(_0x39e614[_0x8cf9('0x2c')][_0x8cf9('0x3a')]){_0x257a73[_0x8cf9('0x3b')]=[{'all':!![]}];}_0x257a73=_[_0x8cf9('0x38')]({},_0x257a73,_0x39e614['options']);return db[_0x8cf9('0x27')][_0x8cf9('0x40')](_0x257a73)[_0x8cf9('0x21')](handleEntityNotFound(_0x156bfd,null))[_0x8cf9('0x21')](respondWithResult(_0x156bfd,null))[_0x8cf9('0x3e')](handleError(_0x156bfd,null));};exports[_0x8cf9('0x41')]=function(_0x41801b,_0x23e6d4){var _0x151b9d={'where':{'id':_0x41801b['params']['id']}},_0x1beba4={};_0x1beba4[_0x8cf9('0x2f')]=_['keys'](db[_0x8cf9('0x27')][_0x8cf9('0x28')]);_0x151b9d[_0x8cf9('0x30')]=_['intersection'](_0x1beba4[_0x8cf9('0x2f')],qs['fields'](_0x41801b[_0x8cf9('0x2c')]['fields']));_0x151b9d[_0x8cf9('0x30')]=_0x151b9d[_0x8cf9('0x30')][_0x8cf9('0x32')]?_0x151b9d['attributes']:_0x1beba4[_0x8cf9('0x2f')];if(_0x41801b[_0x8cf9('0x2c')][_0x8cf9('0x3a')]){_0x151b9d[_0x8cf9('0x3b')]=[{'all':!![]}];}_0x151b9d=_[_0x8cf9('0x38')]({},_0x151b9d,_0x41801b[_0x8cf9('0x42')]);return db[_0x8cf9('0x27')][_0x8cf9('0x40')](_0x151b9d)[_0x8cf9('0x21')](handleEntityNotFound(_0x23e6d4,null))[_0x8cf9('0x21')](function(_0x1b543a){if(_0x1b543a){var _0x9d9e53=_0x1b543a[_0x8cf9('0x43')]({'plain':!![]});_0x9d9e53=qs[_0x8cf9('0x44')](_0x9d9e53,['id','createdAt',_0x8cf9('0x45')]);_0x41801b[_0x8cf9('0x46')]=_[_0x8cf9('0x44')](_0x41801b[_0x8cf9('0x46')],['id',_0x8cf9('0x47'),_0x8cf9('0x45')]);return db[_0x8cf9('0x27')][_0x8cf9('0x48')](_[_0x8cf9('0x38')](_0x9d9e53,_0x41801b[_0x8cf9('0x46')]),{'include':_0x41801b[_0x8cf9('0x2c')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x8cf9('0x21')](respondWithResult(_0x23e6d4,0xc9))[_0x8cf9('0x3e')](handleError(_0x23e6d4,null));};exports[_0x8cf9('0x20')]=function(_0x319d89,_0x233bd4){if(_0x319d89[_0x8cf9('0x46')]['id']){delete _0x319d89[_0x8cf9('0x46')]['id'];}return db['Attachment'][_0x8cf9('0x40')]({'where':{'id':_0x319d89['params']['id']}})[_0x8cf9('0x21')](handleEntityNotFound(_0x233bd4,null))[_0x8cf9('0x21')](saveUpdates(_0x319d89[_0x8cf9('0x46')],null))['then'](respondWithResult(_0x233bd4,null))[_0x8cf9('0x3e')](handleError(_0x233bd4,null));};exports['destroy']=function(_0x379728,_0x558ef9){return db[_0x8cf9('0x27')]['find']({'where':{'id':_0x379728[_0x8cf9('0x3f')]['id']}})[_0x8cf9('0x21')](handleEntityNotFound(_0x558ef9,null))[_0x8cf9('0x21')](removeEntity(_0x558ef9,null))['catch'](handleError(_0x558ef9,null));};exports[_0x8cf9('0x48')]=function(_0x45aced,_0x575367,_0xe5f1b9){_0x45aced[_0x8cf9('0x46')][_0x8cf9('0x24')]=_0x45aced[_0x8cf9('0x49')]['originalname'];_0x45aced[_0x8cf9('0x46')][_0x8cf9('0x4a')]=_0x45aced['file'][_0x8cf9('0x4b')];_0x45aced[_0x8cf9('0x46')][_0x8cf9('0x29')]=_0x45aced[_0x8cf9('0x49')]['mimetype'];return db[_0x8cf9('0x27')][_0x8cf9('0x48')](_0x45aced['body'])[_0x8cf9('0x21')](respondWithResult(_0x575367,0xc9))[_0x8cf9('0x3e')](handleError(_0x575367,null));};exports['download']=function(_0x5735a3,_0x319f99,_0x540b78){return db[_0x8cf9('0x27')][_0x8cf9('0x4c')]({'where':{'id':_0x5735a3[_0x8cf9('0x3f')]['id']},'raw':!![]})[_0x8cf9('0x21')](handleEntityNotFound(_0x319f99,null))[_0x8cf9('0x21')](function(_0xa08dee){if(_0xa08dee){var _0x323766=_0xa08dee[_0x8cf9('0x4d')]!==null;var _0x51557f=path['join'](config[_0x8cf9('0x4e')],_0x8cf9('0x4f'));if(_0x323766){_0x51557f=path[_0x8cf9('0x50')](_0x51557f,'offline-chat/');}var _0x4810a0=path[_0x8cf9('0x50')](_0x51557f,_0xa08dee[_0x8cf9('0x4a')]);return _0x319f99[_0x8cf9('0x51')](_0x4810a0);}})[_0x8cf9('0x3e')](handleError(_0x319f99,null));}; \ No newline at end of file +var _0xe156=['../../mysqldb','end','status','undefined','offset','set','Content-Range','json','apply','reject','then','error','name','send','index','Attachment','rawAttributes','fieldName','type','query','keys','filters','attributes','intersection','fields','length','model','hasOwnProperty','limit','order','sort','where','pick','merge','filter','options','count','includeAll','include','findAll','rows','catch','show','params','find','get','omit','createdAt','updatedAt','create','body','update','originalname','basename','file','download','findOne','ChatOfflineMessageId','server/files/attachments/','join','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x135448,_0x4ca19f){var _0x28389e=function(_0x5a2113){while(--_0x5a2113){_0x135448['push'](_0x135448['shift']());}};_0x28389e(++_0x4ca19f);}(_0xe156,0x1a1));var _0x6e15=function(_0x15ea09,_0x2f30ab){_0x15ea09=_0x15ea09-0x0;var _0x3e9c78=_0xe156[_0x15ea09];return _0x3e9c78;};'use strict';var emlformat=require(_0x6e15('0x0'));var rimraf=require(_0x6e15('0x1'));var zipdir=require(_0x6e15('0x2'));var jsonpatch=require(_0x6e15('0x3'));var rp=require(_0x6e15('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6e15('0x5'));var util=require(_0x6e15('0x6'));var path=require(_0x6e15('0x7'));var sox=require(_0x6e15('0x8'));var csv=require('to-csv');var ejs=require(_0x6e15('0x9'));var fs=require('fs');var fs_extra=require(_0x6e15('0xa'));var _=require(_0x6e15('0xb'));var squel=require(_0x6e15('0xc'));var crypto=require(_0x6e15('0xd'));var jsforce=require(_0x6e15('0xe'));var deskjs=require(_0x6e15('0xf'));var toCsv=require(_0x6e15('0x10'));var querystring=require(_0x6e15('0x11'));var Papa=require(_0x6e15('0x12'));var Redis=require(_0x6e15('0x13'));var authService=require(_0x6e15('0x14'));var qs=require(_0x6e15('0x15'));var as=require(_0x6e15('0x16'));var hardwareService=require(_0x6e15('0x17'));var logger=require('../../config/logger')(_0x6e15('0x18'));var utils=require(_0x6e15('0x19'));var config=require(_0x6e15('0x1a'));var licenseUtil=require(_0x6e15('0x1b'));var db=require(_0x6e15('0x1c'))['db'];function respondWithStatusCode(_0x148d29,_0x41f43c){_0x41f43c=_0x41f43c||0xcc;return function(_0x5405af){if(_0x5405af){return _0x148d29['sendStatus'](_0x41f43c);}return _0x148d29['status'](_0x41f43c)[_0x6e15('0x1d')]();};}function respondWithResult(_0x3f8432,_0xfbc600){_0xfbc600=_0xfbc600||0xc8;return function(_0x3579ec){if(_0x3579ec){return _0x3f8432[_0x6e15('0x1e')](_0xfbc600)['json'](_0x3579ec);}};}function respondWithFilteredResult(_0x1a8c0c,_0x43f299){return function(_0x39a0f8){if(_0x39a0f8){var _0x49038b=typeof _0x43f299['offset']==='undefined'&&typeof _0x43f299['limit']===_0x6e15('0x1f');var _0x4bb393=_0x39a0f8['count'];var _0x2e1778=_0x49038b?0x0:_0x43f299[_0x6e15('0x20')];var _0x70fe19=_0x49038b?_0x39a0f8['count']:_0x43f299[_0x6e15('0x20')]+_0x43f299['limit'];var _0x25e29b;if(_0x70fe19>=_0x4bb393){_0x70fe19=_0x4bb393;_0x25e29b=0xc8;}else{_0x25e29b=0xce;}_0x1a8c0c[_0x6e15('0x1e')](_0x25e29b);return _0x1a8c0c[_0x6e15('0x21')](_0x6e15('0x22'),_0x2e1778+'-'+_0x70fe19+'/'+_0x4bb393)[_0x6e15('0x23')](_0x39a0f8);}return null;};}function patchUpdates(_0x5e3ebd){return function(_0x3eba14){try{jsonpatch[_0x6e15('0x24')](_0x3eba14,_0x5e3ebd,!![]);}catch(_0x3367a3){return BPromise[_0x6e15('0x25')](_0x3367a3);}return _0x3eba14['save']();};}function saveUpdates(_0x26c5ba,_0x1ab923){return function(_0x53e941){if(_0x53e941){return _0x53e941['update'](_0x26c5ba)[_0x6e15('0x26')](function(_0x5202ce){return _0x5202ce;});}return null;};}function removeEntity(_0x81c154,_0x25cf83){return function(_0x1b474c){if(_0x1b474c){return _0x1b474c['destroy']()['then'](function(){_0x81c154['status'](0xcc)[_0x6e15('0x1d')]();});}};}function handleEntityNotFound(_0x4f2d58,_0x142021){return function(_0x1519db){if(!_0x1519db){_0x4f2d58['sendStatus'](0x194);}return _0x1519db;};}function handleError(_0x336b61,_0x4cb505){_0x4cb505=_0x4cb505||0x1f4;return function(_0x3b5ff7){logger[_0x6e15('0x27')](_0x3b5ff7['stack']);if(_0x3b5ff7[_0x6e15('0x28')]){delete _0x3b5ff7[_0x6e15('0x28')];}_0x336b61['status'](_0x4cb505)[_0x6e15('0x29')](_0x3b5ff7);};}exports[_0x6e15('0x2a')]=function(_0x24105f,_0x1b43e8){var _0x55a687={},_0x4e1655={},_0x56e9ae={'count':0x0,'rows':[]};var _0x13989f=_['map'](db[_0x6e15('0x2b')][_0x6e15('0x2c')],function(_0x10c56b){return{'name':_0x10c56b[_0x6e15('0x2d')],'type':_0x10c56b[_0x6e15('0x2e')]['key']};});_0x4e1655['model']=_['map'](_0x13989f,_0x6e15('0x28'));_0x4e1655[_0x6e15('0x2f')]=_[_0x6e15('0x30')](_0x24105f['query']);_0x4e1655[_0x6e15('0x31')]=_['intersection'](_0x4e1655['model'],_0x4e1655[_0x6e15('0x2f')]);_0x55a687[_0x6e15('0x32')]=_[_0x6e15('0x33')](_0x4e1655['model'],qs[_0x6e15('0x34')](_0x24105f['query'][_0x6e15('0x34')]));_0x55a687[_0x6e15('0x32')]=_0x55a687[_0x6e15('0x32')][_0x6e15('0x35')]?_0x55a687[_0x6e15('0x32')]:_0x4e1655[_0x6e15('0x36')];if(!_0x24105f[_0x6e15('0x2f')][_0x6e15('0x37')]('nolimit')){_0x55a687[_0x6e15('0x38')]=qs['limit'](_0x24105f['query'][_0x6e15('0x38')]);_0x55a687[_0x6e15('0x20')]=qs[_0x6e15('0x20')](_0x24105f[_0x6e15('0x2f')]['offset']);}_0x55a687[_0x6e15('0x39')]=qs[_0x6e15('0x3a')](_0x24105f['query'][_0x6e15('0x3a')]);_0x55a687[_0x6e15('0x3b')]=qs['filters'](_[_0x6e15('0x3c')](_0x24105f[_0x6e15('0x2f')],_0x4e1655[_0x6e15('0x31')]),_0x13989f);if(_0x24105f[_0x6e15('0x2f')]['filter']){_0x55a687[_0x6e15('0x3b')]=_[_0x6e15('0x3d')](_0x55a687[_0x6e15('0x3b')],{'$or':_['map'](_0x13989f,function(_0x295010){if(_0x295010['type']!=='VIRTUAL'){var _0x3143d9={};_0x3143d9[_0x295010[_0x6e15('0x28')]]={'$like':'%'+_0x24105f['query'][_0x6e15('0x3e')]+'%'};return _0x3143d9;}})});}_0x55a687=_[_0x6e15('0x3d')]({},_0x55a687,_0x24105f[_0x6e15('0x3f')]);var _0x4597a9={'where':_0x55a687[_0x6e15('0x3b')]};return db[_0x6e15('0x2b')]['count'](_0x4597a9)[_0x6e15('0x26')](function(_0x2a8dd1){_0x56e9ae[_0x6e15('0x40')]=_0x2a8dd1;if(_0x24105f[_0x6e15('0x2f')][_0x6e15('0x41')]){_0x55a687[_0x6e15('0x42')]=[{'all':!![]}];}return db[_0x6e15('0x2b')][_0x6e15('0x43')](_0x55a687);})['then'](function(_0x26e266){_0x56e9ae[_0x6e15('0x44')]=_0x26e266;return _0x56e9ae;})[_0x6e15('0x26')](respondWithFilteredResult(_0x1b43e8,_0x55a687))[_0x6e15('0x45')](handleError(_0x1b43e8,null));};exports[_0x6e15('0x46')]=function(_0x10f5ea,_0x1af816){var _0x41a6f2={'raw':!![],'where':{'id':_0x10f5ea[_0x6e15('0x47')]['id']}},_0x2b9752={};_0x2b9752['model']=_['keys'](db['Attachment'][_0x6e15('0x2c')]);_0x2b9752['query']=_[_0x6e15('0x30')](_0x10f5ea['query']);_0x2b9752['filters']=_[_0x6e15('0x33')](_0x2b9752[_0x6e15('0x36')],_0x2b9752['query']);_0x41a6f2[_0x6e15('0x32')]=_[_0x6e15('0x33')](_0x2b9752['model'],qs['fields'](_0x10f5ea[_0x6e15('0x2f')][_0x6e15('0x34')]));_0x41a6f2['attributes']=_0x41a6f2[_0x6e15('0x32')][_0x6e15('0x35')]?_0x41a6f2['attributes']:_0x2b9752[_0x6e15('0x36')];if(_0x10f5ea[_0x6e15('0x2f')][_0x6e15('0x41')]){_0x41a6f2[_0x6e15('0x42')]=[{'all':!![]}];}_0x41a6f2=_[_0x6e15('0x3d')]({},_0x41a6f2,_0x10f5ea[_0x6e15('0x3f')]);return db[_0x6e15('0x2b')][_0x6e15('0x48')](_0x41a6f2)[_0x6e15('0x26')](handleEntityNotFound(_0x1af816,null))[_0x6e15('0x26')](respondWithResult(_0x1af816,null))['catch'](handleError(_0x1af816,null));};exports['clone']=function(_0x3d45c3,_0x4a8e17){var _0x358bf0={'where':{'id':_0x3d45c3[_0x6e15('0x47')]['id']}},_0x2ff5d5={};_0x2ff5d5[_0x6e15('0x36')]=_[_0x6e15('0x30')](db[_0x6e15('0x2b')][_0x6e15('0x2c')]);_0x358bf0[_0x6e15('0x32')]=_[_0x6e15('0x33')](_0x2ff5d5[_0x6e15('0x36')],qs[_0x6e15('0x34')](_0x3d45c3[_0x6e15('0x2f')]['fields']));_0x358bf0[_0x6e15('0x32')]=_0x358bf0['attributes'][_0x6e15('0x35')]?_0x358bf0[_0x6e15('0x32')]:_0x2ff5d5[_0x6e15('0x36')];if(_0x3d45c3[_0x6e15('0x2f')][_0x6e15('0x41')]){_0x358bf0['include']=[{'all':!![]}];}_0x358bf0=_[_0x6e15('0x3d')]({},_0x358bf0,_0x3d45c3[_0x6e15('0x3f')]);return db[_0x6e15('0x2b')][_0x6e15('0x48')](_0x358bf0)[_0x6e15('0x26')](handleEntityNotFound(_0x4a8e17,null))[_0x6e15('0x26')](function(_0x2e5ef9){if(_0x2e5ef9){var _0x35129d=_0x2e5ef9[_0x6e15('0x49')]({'plain':!![]});_0x35129d=qs[_0x6e15('0x4a')](_0x35129d,['id',_0x6e15('0x4b'),'updatedAt']);_0x3d45c3['body']=_['omit'](_0x3d45c3['body'],['id',_0x6e15('0x4b'),_0x6e15('0x4c')]);return db['Attachment'][_0x6e15('0x4d')](_[_0x6e15('0x3d')](_0x35129d,_0x3d45c3[_0x6e15('0x4e')]),{'include':_0x3d45c3[_0x6e15('0x2f')][_0x6e15('0x41')]?[{'all':!![]}]:undefined});}})[_0x6e15('0x26')](respondWithResult(_0x4a8e17,0xc9))[_0x6e15('0x45')](handleError(_0x4a8e17,null));};exports[_0x6e15('0x4f')]=function(_0x53eaf2,_0x4a0454){if(_0x53eaf2['body']['id']){delete _0x53eaf2[_0x6e15('0x4e')]['id'];}return db['Attachment'][_0x6e15('0x48')]({'where':{'id':_0x53eaf2[_0x6e15('0x47')]['id']}})[_0x6e15('0x26')](handleEntityNotFound(_0x4a0454,null))[_0x6e15('0x26')](saveUpdates(_0x53eaf2[_0x6e15('0x4e')],null))[_0x6e15('0x26')](respondWithResult(_0x4a0454,null))[_0x6e15('0x45')](handleError(_0x4a0454,null));};exports['destroy']=function(_0x591459,_0x1e336c){return db[_0x6e15('0x2b')][_0x6e15('0x48')]({'where':{'id':_0x591459[_0x6e15('0x47')]['id']}})[_0x6e15('0x26')](handleEntityNotFound(_0x1e336c,null))['then'](removeEntity(_0x1e336c,null))[_0x6e15('0x45')](handleError(_0x1e336c,null));};exports['create']=function(_0x27a414,_0x3646e6,_0x44f619){_0x27a414[_0x6e15('0x4e')][_0x6e15('0x28')]=_0x27a414['file'][_0x6e15('0x50')];_0x27a414[_0x6e15('0x4e')][_0x6e15('0x51')]=_0x27a414[_0x6e15('0x52')]['filename'];_0x27a414[_0x6e15('0x4e')][_0x6e15('0x2e')]=_0x27a414[_0x6e15('0x52')]['mimetype'];return db[_0x6e15('0x2b')][_0x6e15('0x4d')](_0x27a414['body'])['then'](respondWithResult(_0x3646e6,0xc9))[_0x6e15('0x45')](handleError(_0x3646e6,null));};exports[_0x6e15('0x53')]=function(_0x20f445,_0x28677b,_0x4a9fac){return db[_0x6e15('0x2b')][_0x6e15('0x54')]({'where':{'id':_0x20f445[_0x6e15('0x47')]['id']},'raw':!![]})[_0x6e15('0x26')](handleEntityNotFound(_0x28677b,null))[_0x6e15('0x26')](function(_0xe8669a){if(_0xe8669a){var _0x3ec454=_0xe8669a[_0x6e15('0x55')]!==null;var _0x30a7c3=path['join'](config['root'],_0x6e15('0x56'));if(_0x3ec454){_0x30a7c3=path[_0x6e15('0x57')](_0x30a7c3,_0x6e15('0x58'));}var _0x122d80=path['join'](_0x30a7c3,_0xe8669a['basename']);return _0x28677b[_0x6e15('0x53')](_0x122d80);}})[_0x6e15('0x45')](handleError(_0x28677b,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 0c09ef4..4609cad 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 _0x4427=['../../config/environment','./attachment.attributes','exports','define','Attachment','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x296bcd,_0x115fbd){var _0x13523e=function(_0x30ffff){while(--_0x30ffff){_0x296bcd['push'](_0x296bcd['shift']());}};_0x13523e(++_0x115fbd);}(_0x4427,0x7d));var _0x7442=function(_0xddc012,_0x5cf07a){_0xddc012=_0xddc012-0x0;var _0x395581=_0x4427[_0xddc012];return _0x395581;};'use strict';var _=require(_0x7442('0x0'));var util=require(_0x7442('0x1'));var logger=require(_0x7442('0x2'))('api');var moment=require(_0x7442('0x3'));var BPromise=require(_0x7442('0x4'));var rp=require(_0x7442('0x5'));var fs=require('fs');var path=require(_0x7442('0x6'));var rimraf=require('rimraf');var config=require(_0x7442('0x7'));var attributes=require(_0x7442('0x8'));module[_0x7442('0x9')]=function(_0x5ea0c4,_0x450dae){return _0x5ea0c4[_0x7442('0xa')](_0x7442('0xb'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa581=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','Attachment','attachments'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xa581,0x15c));var _0x1a58=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa581[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1a58('0x0'))(_0x1a58('0x1'));var moment=require(_0x1a58('0x2'));var BPromise=require(_0x1a58('0x3'));var rp=require(_0x1a58('0x4'));var fs=require('fs');var path=require(_0x1a58('0x5'));var rimraf=require(_0x1a58('0x6'));var config=require(_0x1a58('0x7'));var attributes=require(_0x1a58('0x8'));module[_0x1a58('0x9')]=function(_0x1fa4b7,_0x2391d1){return _0x1fa4b7['define'](_0x1a58('0xa'),attributes,{'tableName':_0x1a58('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index e95ebef..261f9db 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 _0x2f68=['client','request','then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x38cefa,_0x5f01bd){var _0xee2d85=function(_0x1ee987){while(--_0x1ee987){_0x38cefa['push'](_0x38cefa['shift']());}};_0xee2d85(++_0x5f01bd);}(_0x2f68,0x9a));var _0x82f6=function(_0x30c34d,_0x406d0c){_0x30c34d=_0x30c34d-0x0;var _0x552696=_0x2f68[_0x30c34d];return _0x552696;};'use strict';var _=require('lodash');var util=require(_0x82f6('0x0'));var moment=require(_0x82f6('0x1'));var BPromise=require(_0x82f6('0x2'));var rs=require(_0x82f6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x82f6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x82f6('0x5'))(_0x82f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x82f6('0x7'));var client=jayson[_0x82f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a8089,_0x1bc0be,_0x5660bf){return new BPromise(function(_0x5daa3c,_0x864400){return client[_0x82f6('0x9')](_0x5a8089,_0x5660bf)[_0x82f6('0xa')](function(_0x5ee0e5){logger[_0x82f6('0xb')](_0x82f6('0xc'),_0x1bc0be,'request\x20sent');logger[_0x82f6('0xd')](_0x82f6('0xe'),_0x1bc0be,_0x82f6('0xf'),JSON[_0x82f6('0x10')](_0x5ee0e5));if(_0x5ee0e5[_0x82f6('0x11')]){if(_0x5ee0e5[_0x82f6('0x11')]['code']===0x1f4){logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x5ee0e5['error'][_0x82f6('0x12')]);return _0x864400(_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);}logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);return _0x5daa3c(_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);}else{logger['info'](_0x82f6('0xc'),_0x1bc0be,'request\x20sent');_0x5daa3c(_0x5ee0e5[_0x82f6('0x13')][_0x82f6('0x12')]);}})[_0x82f6('0x14')](function(_0x1033d3){logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x1033d3);_0x864400(_0x1033d3);});});}exports[_0x82f6('0x15')]=function(_0xcbc95f){var _0x4072f0=this;return new Promise(function(_0x2bfd57,_0x1c79f9){return db[_0x82f6('0x16')][_0x82f6('0x17')](_0xcbc95f[_0x82f6('0x18')],{'raw':_0xcbc95f[_0x82f6('0x19')]?_0xcbc95f['options'][_0x82f6('0x1a')]===undefined?!![]:![]:!![]})[_0x82f6('0xa')](function(_0x55cbce){logger[_0x82f6('0xb')](_0x82f6('0x15'),_0xcbc95f);logger[_0x82f6('0xd')](_0x82f6('0x15'),_0xcbc95f,JSON['stringify'](_0x55cbce));_0x2bfd57(_0x55cbce);})[_0x82f6('0x14')](function(_0x4beccf){logger[_0x82f6('0x11')](_0x82f6('0x15'),_0x4beccf['message'],_0xcbc95f);_0x1c79f9(_0x4072f0['error'](0x1f4,_0x4beccf[_0x82f6('0x12')]));});});}; \ No newline at end of file +var _0x3ee5=['body','options','raw','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateAttachment','Attachment','create'];(function(_0x20714c,_0x3d500c){var _0x155cba=function(_0x4b3d01){while(--_0x4b3d01){_0x20714c['push'](_0x20714c['shift']());}};_0x155cba(++_0x3d500c);}(_0x3ee5,0x1b6));var _0x53ee=function(_0x5e7bbc,_0x47e61e){_0x5e7bbc=_0x5e7bbc-0x0;var _0x22f4f0=_0x3ee5[_0x5e7bbc];return _0x22f4f0;};'use strict';var _=require('lodash');var util=require(_0x53ee('0x0'));var moment=require(_0x53ee('0x1'));var BPromise=require('bluebird');var rs=require(_0x53ee('0x2'));var fs=require('fs');var Redis=require(_0x53ee('0x3'));var db=require(_0x53ee('0x4'))['db'];var utils=require(_0x53ee('0x5'));var logger=require(_0x53ee('0x6'))(_0x53ee('0x7'));var config=require(_0x53ee('0x8'));var jayson=require(_0x53ee('0x9'));var client=jayson[_0x53ee('0xa')][_0x53ee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3173b2,_0x48bc62,_0x299b23){return new BPromise(function(_0x235c9f,_0x1ec296){return client[_0x53ee('0xc')](_0x3173b2,_0x299b23)[_0x53ee('0xd')](function(_0x3b1252){logger[_0x53ee('0xe')](_0x53ee('0xf'),_0x48bc62,_0x53ee('0x10'));logger[_0x53ee('0x11')](_0x53ee('0x12'),_0x48bc62,_0x53ee('0x10'),JSON['stringify'](_0x3b1252));if(_0x3b1252['error']){if(_0x3b1252[_0x53ee('0x13')][_0x53ee('0x14')]===0x1f4){logger[_0x53ee('0x13')](_0x53ee('0xf'),_0x48bc62,_0x3b1252[_0x53ee('0x13')]['message']);return _0x1ec296(_0x3b1252['error'][_0x53ee('0x15')]);}logger[_0x53ee('0x13')]('Attachment,\x20%s,\x20%s',_0x48bc62,_0x3b1252['error'][_0x53ee('0x15')]);return _0x235c9f(_0x3b1252[_0x53ee('0x13')][_0x53ee('0x15')]);}else{logger['info'](_0x53ee('0xf'),_0x48bc62,_0x53ee('0x10'));_0x235c9f(_0x3b1252[_0x53ee('0x16')][_0x53ee('0x15')]);}})[_0x53ee('0x17')](function(_0x2fb3cd){logger['error'](_0x53ee('0xf'),_0x48bc62,_0x2fb3cd);_0x1ec296(_0x2fb3cd);});});}exports[_0x53ee('0x18')]=function(_0x3d788e){var _0x17c3cb=this;return new Promise(function(_0x708604,_0x29a4b4){return db[_0x53ee('0x19')][_0x53ee('0x1a')](_0x3d788e[_0x53ee('0x1b')],{'raw':_0x3d788e[_0x53ee('0x1c')]?_0x3d788e[_0x53ee('0x1c')][_0x53ee('0x1d')]===undefined?!![]:![]:!![]})[_0x53ee('0xd')](function(_0x2cbd98){logger['info'](_0x53ee('0x18'),_0x3d788e);logger['debug']('CreateAttachment',_0x3d788e,JSON[_0x53ee('0x1e')](_0x2cbd98));_0x708604(_0x2cbd98);})[_0x53ee('0x17')](function(_0x4105d6){logger['error'](_0x53ee('0x18'),_0x4105d6[_0x53ee('0x15')],_0x3d788e);_0x29a4b4(_0x17c3cb[_0x53ee('0x13')](0x1f4,_0x4105d6[_0x53ee('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 6eba9fa..c882f85 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 _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x14a220,_0x5347e9){var _0x447c81=function(_0x23bc62){while(--_0x23bc62){_0x14a220['push'](_0x14a220['shift']());}};_0x447c81(++_0x5347e9);}(_0xadb5,0xad));var _0x5adb=function(_0x52f919,_0x196455){_0x52f919=_0x52f919-0x0;var _0x2cbf1b=_0xadb5[_0x52f919];return _0x2cbf1b;};'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 fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router; \ No newline at end of file +var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x1897ea,_0x2f1f1d){var _0x11cc1c=function(_0xe23c55){while(--_0xe23c55){_0x1897ea['push'](_0x1897ea['shift']());}};_0x11cc1c(++_0x2f1f1d);}(_0x2032,0xd9));var _0x2203=function(_0x1a167f,_0x3591ae){_0x1a167f=_0x1a167f-0x0;var _0x3a13d6=_0x2032[_0x1a167f];return _0x3a13d6;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 9667af3..660edf3 100644 --- a/server/api/authActiveDirectory/authActiveDirectory.controller.js +++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7f5e=['blocked','blockedAt','online','user','agent','blockDuration','add','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','signToken','use','password','User','activedirectory2','../../mysqldb','../../config/utils','../../config/environment','api','undefined','activedirectory','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','salt','role','disabled'];(function(_0x57f7fb,_0x5f4bf7){var _0x5db724=function(_0x2b78c0){while(--_0x2b78c0){_0x57f7fb['push'](_0x57f7fb['shift']());}};_0x5db724(++_0x5f4bf7);}(_0x7f5e,0x18d));var _0xe7f5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7f5e[_0x20a584];return _0x4b41a8;};'use strict';var passport=require('passport');var LocalStrategy=require('passport-local')['Strategy'];var moment=require('moment');var ActiveDirectory=require(_0xe7f5('0x0'));var BPromise=require('bluebird');var util=require('util');var db=require(_0xe7f5('0x1'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xe7f5('0x2'));var config=require(_0xe7f5('0x3'));var logger=require('../../config/logger')(_0xe7f5('0x4'));function isActiveDirectoryConfigured(_0x29f208){var _0xb2d31d=![];if(typeof _0x29f208['activedirectory']!==_0xe7f5('0x5')){_0xb2d31d=_0x29f208[_0xe7f5('0x6')][_0xe7f5('0x7')]&&_0x29f208[_0xe7f5('0x6')][_0xe7f5('0x8')]&&_0x29f208[_0xe7f5('0x6')][_0xe7f5('0x9')];}return _0xb2d31d;}function adAuthenticate(_0x31f746,_0xdf882,_0x431032){return new BPromise(function(_0x4861c6,_0x510a36){try{var _0x53270b=new ActiveDirectory(_0x31f746);_0x53270b[_0xe7f5('0xa')](_0xdf882,_0x431032,function(_0x395fd8,_0x475bfd){if(_0x395fd8){logger[_0xe7f5('0xb')](_0xe7f5('0xc'),_0xdf882,util[_0xe7f5('0xd')](_0x395fd8,{'showHidden':![],'depth':null}));_0x510a36(_0xe7f5('0xe'));}else if(!_0x475bfd){logger[_0xe7f5('0xb')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0xdf882);_0x510a36(_0xe7f5('0xe'));}else{_0x4861c6(_0x475bfd);}});}catch(_0xe5188a){_0x510a36(_0xe5188a);}});}function ActiveDirectoryAuthenticate(_0x4d0bdb,_0x205e2b,_0x463bd6,_0x4971b2){var _0x352c5f,_0xf08ab1;if(!isActiveDirectoryConfigured(config)){logger[_0xe7f5('0xb')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x205e2b);return _0x4971b2(null,![],{'message':_0xe7f5('0xe')});}return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xe7f5('0xf'),'blockDuration'],'raw':!![]})[_0xe7f5('0x10')](function(_0x1b8df0){_0x352c5f=_0x1b8df0;if(!_0x352c5f[_0xe7f5('0xf')]){logger['error'](_0xe7f5('0x11'),_0x205e2b);throw new Error(_0xe7f5('0xe'));}return _0x4d0bdb[_0xe7f5('0x12')]({'attributes':['id',_0xe7f5('0x13'),'password',_0xe7f5('0x14'),_0xe7f5('0x15'),_0xe7f5('0x16'),_0xe7f5('0x17'),_0xe7f5('0x18'),_0xe7f5('0x19')],'where':{'name':_0x205e2b,'role':{'$or':['admin',_0xe7f5('0x1a'),_0xe7f5('0x1b')]},'adSsoEnabled':!![]}});})[_0xe7f5('0x10')](function(_0x78deb2){if(!_0x78deb2||_0x78deb2&&_0x78deb2['name']!==_0x205e2b){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0xf08ab1=_0x78deb2;var _0x2bd0e6=_0xf08ab1['name']+'@'+config['activedirectory'][_0xe7f5('0x9')];return adAuthenticate(config['activedirectory'],_0x2bd0e6,_0x463bd6);})[_0xe7f5('0x10')](function(_0x36bcb7){if(_0xf08ab1[_0xe7f5('0x16')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x352c5f[_0xe7f5('0x1c')]>0x0){if(_0xf08ab1['blocked']){if(moment(_0xf08ab1['blockedAt'])[_0xe7f5('0x1d')](_0x352c5f['blockDuration'],'minutes')>moment()){throw new Error(_0xe7f5('0xe'));}return utils[_0xe7f5('0x1e')](_0xf08ab1,0x0,![],null)[_0xe7f5('0x10')](function(){return utils[_0xe7f5('0x1f')](_0xf08ab1);})[_0xe7f5('0x10')](function(){return _0x4971b2(null,_0xf08ab1);});}else{return utils[_0xe7f5('0x1f')](_0xf08ab1)[_0xe7f5('0x10')](function(){return _0x4971b2(null,_0xf08ab1);});}}else{return utils[_0xe7f5('0x1f')](_0xf08ab1)[_0xe7f5('0x10')](function(){return _0x4971b2(null,_0xf08ab1);});}})[_0xe7f5('0x20')](function(_0x21be57){return _0x4971b2(null,![],_0x21be57);});}function handleError(_0x451d82,_0xddc51a,_0x4bd6bb){return _0x451d82[_0xe7f5('0x21')](_0xddc51a||0x1f4)[_0xe7f5('0x22')]({'message':_0x4bd6bb?_0x4bd6bb[_0xe7f5('0x23')]||_0x4bd6bb:''});}exports[_0xe7f5('0x24')]=function(_0x5e5e65,_0x40c2e9,_0x3b99fa){passport[_0xe7f5('0xa')](_0xe7f5('0x25'),function(_0x1dd2b3,_0x18b4ac,_0x288f65){var _0x1ea9e3=_0x1dd2b3||_0x288f65;if(_0x1ea9e3){return handleError(_0x40c2e9,0x191,_0x1ea9e3);}if(!_0x18b4ac){return handleError(_0x40c2e9,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0xba4420={'payload':{'id':_0x18b4ac['id'],'role':_0x18b4ac[_0xe7f5('0x15')]},'options':{'expiresIn':0x15180}};return authService[_0xe7f5('0x26')](_0xba4420)[_0xe7f5('0x10')](function(_0x4bc186){_0x40c2e9['json']({'id':_0x18b4ac['id'],'token':_0x4bc186,'statusCall':'','isAlreadyLogged':_0x18b4ac[_0xe7f5('0x19')]});});}})(_0x5e5e65,_0x40c2e9,_0x3b99fa);};passport[_0xe7f5('0x27')](_0xe7f5('0x25'),new LocalStrategy({'usernameField':'name','passwordField':_0xe7f5('0x28')},function(_0xb3c26,_0x2fb6d9,_0x349080){return ActiveDirectoryAuthenticate(db[_0xe7f5('0x29')],_0xb3c26,_0x2fb6d9,_0x349080);})); \ No newline at end of file +var _0x3470=['clearBlockUser','getLicense','catch','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','use','passport','passport-local','Strategy','activedirectory2','bluebird','util','../../mysqldb','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','admin','user','domain','disabled','blockDuration','blocked','blockedAt','add','minutes'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x3470,0xeb));var _0x0347=function(_0x3a44e4,_0x3ab711){_0x3a44e4=_0x3a44e4-0x0;var _0x2c94c1=_0x3470[_0x3a44e4];return _0x2c94c1;};'use strict';var passport=require(_0x0347('0x0'));var LocalStrategy=require(_0x0347('0x1'))[_0x0347('0x2')];var moment=require('moment');var ActiveDirectory=require(_0x0347('0x3'));var BPromise=require(_0x0347('0x4'));var util=require(_0x0347('0x5'));var db=require(_0x0347('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x0347('0x7'));var config=require(_0x0347('0x8'));var logger=require(_0x0347('0x9'))(_0x0347('0xa'));function isActiveDirectoryConfigured(_0x4b16de){var _0x58e731=![];if(typeof _0x4b16de[_0x0347('0xb')]!==_0x0347('0xc')){_0x58e731=_0x4b16de['activedirectory']['baseDN']&&_0x4b16de['activedirectory']['url']&&_0x4b16de[_0x0347('0xb')]['domain'];}return _0x58e731;}function adAuthenticate(_0x1bc0c0,_0x105afa,_0x104157){return new BPromise(function(_0x2c5641,_0xadb0f8){try{var _0x553239=new ActiveDirectory(_0x1bc0c0);_0x553239[_0x0347('0xd')](_0x105afa,_0x104157,function(_0x47355c,_0x2ef131){if(_0x47355c){logger[_0x0347('0xe')](_0x0347('0xf'),_0x105afa,util['inspect'](_0x47355c,{'showHidden':![],'depth':null}));_0xadb0f8(_0x0347('0x10'));}else if(!_0x2ef131){logger[_0x0347('0xe')](_0x0347('0x11'),_0x105afa);_0xadb0f8(_0x0347('0x10'));}else{_0x2c5641(_0x2ef131);}});}catch(_0x428349){_0xadb0f8(_0x428349);}});}function ActiveDirectoryAuthenticate(_0x27c06c,_0x5bd41c,_0x3cd1f6,_0xc3fa54){var _0x414881,_0x56a5a1;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x0347('0x12'),_0x5bd41c);return _0xc3fa54(null,![],{'message':_0x0347('0x10')});}return db[_0x0347('0x13')][_0x0347('0x14')]({'where':{'id':0x1},'attributes':['adSsoEnabled','blockDuration'],'raw':!![]})[_0x0347('0x15')](function(_0x10c99e){_0x414881=_0x10c99e;if(!_0x414881['adSsoEnabled']){logger[_0x0347('0xe')](_0x0347('0x16'),_0x5bd41c);throw new Error(_0x0347('0x10'));}return _0x27c06c[_0x0347('0x14')]({'attributes':['id',_0x0347('0x17'),_0x0347('0x18'),_0x0347('0x19'),'role','disabled','blocked','blockedAt','online'],'where':{'name':_0x5bd41c,'role':{'$or':[_0x0347('0x1a'),_0x0347('0x1b'),'agent']},'adSsoEnabled':!![]}});})[_0x0347('0x15')](function(_0x48f712){if(!_0x48f712||_0x48f712&&_0x48f712[_0x0347('0x17')]!==_0x5bd41c){throw new Error(_0x0347('0x10'));}_0x56a5a1=_0x48f712;var _0x556fff=_0x56a5a1[_0x0347('0x17')]+'@'+config[_0x0347('0xb')][_0x0347('0x1c')];return adAuthenticate(config['activedirectory'],_0x556fff,_0x3cd1f6);})[_0x0347('0x15')](function(_0xc486ae){if(_0x56a5a1[_0x0347('0x1d')]){throw new Error(_0x0347('0x10'));}if(_0x414881[_0x0347('0x1e')]>0x0){if(_0x56a5a1[_0x0347('0x1f')]){if(moment(_0x56a5a1[_0x0347('0x20')])[_0x0347('0x21')](_0x414881[_0x0347('0x1e')],_0x0347('0x22'))>moment()){throw new Error(_0x0347('0x10'));}return utils[_0x0347('0x23')](_0x56a5a1,0x0,![],null)[_0x0347('0x15')](function(){return utils['getLicense'](_0x56a5a1);})[_0x0347('0x15')](function(){return _0xc3fa54(null,_0x56a5a1);});}else{return utils[_0x0347('0x24')](_0x56a5a1)[_0x0347('0x15')](function(){return _0xc3fa54(null,_0x56a5a1);});}}else{return utils['getLicense'](_0x56a5a1)['then'](function(){return _0xc3fa54(null,_0x56a5a1);});}})[_0x0347('0x25')](function(_0x3637ea){return _0xc3fa54(null,![],_0x3637ea);});}function handleError(_0xb8be48,_0x40c984,_0x56e73a){return _0xb8be48['status'](_0x40c984||0x1f4)['send']({'message':_0x56e73a?_0x56e73a['message']||_0x56e73a:''});}exports[_0x0347('0x26')]=function(_0x20866d,_0x309ff7,_0x210eff){passport[_0x0347('0xd')]('ad-login',function(_0x8a085f,_0x580b74,_0xcfe27e){var _0x147b49=_0x8a085f||_0xcfe27e;if(_0x147b49){return handleError(_0x309ff7,0x191,_0x147b49);}if(!_0x580b74){return handleError(_0x309ff7,0x194,{'message':_0x0347('0x27')});}else{var _0x352ec1={'payload':{'id':_0x580b74['id'],'role':_0x580b74[_0x0347('0x28')]},'options':{'expiresIn':0x15180}};return authService[_0x0347('0x29')](_0x352ec1)[_0x0347('0x15')](function(_0x240f2d){_0x309ff7[_0x0347('0x2a')]({'id':_0x580b74['id'],'token':_0x240f2d,'statusCall':'','isAlreadyLogged':_0x580b74[_0x0347('0x2b')]});});}})(_0x20866d,_0x309ff7,_0x210eff);};passport[_0x0347('0x2c')]('ad-login',new LocalStrategy({'usernameField':_0x0347('0x17'),'passwordField':_0x0347('0x18')},function(_0x663a74,_0x3390f9,_0x2bc53f){return ActiveDirectoryAuthenticate(db['User'],_0x663a74,_0x3390f9,_0x2bc53f);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 81d92f4..19a73e1 100644 --- a/server/api/authActiveDirectory/index.js +++ b/server/api/authActiveDirectory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x64e3=['post','login','exports','Router','./authActiveDirectory.controller'];(function(_0xd544f5,_0x57b438){var _0x1f802b=function(_0x1d4431){while(--_0x1d4431){_0xd544f5['push'](_0xd544f5['shift']());}};_0x1f802b(++_0x57b438);}(_0x64e3,0x14d));var _0x364e=function(_0x240261,_0x4fe66c){_0x240261=_0x240261-0x0;var _0x45c332=_0x64e3[_0x240261];return _0x45c332;};'use strict';var express=require('express');var router=express[_0x364e('0x0')]();var controller=require(_0x364e('0x1'));router[_0x364e('0x2')]('/',controller[_0x364e('0x3')]);module[_0x364e('0x4')]=router; \ No newline at end of file +var _0x9cea=['exports','express','Router','./authActiveDirectory.controller','post'];(function(_0x12a2e4,_0x1ad4da){var _0x493e66=function(_0x3a5e5b){while(--_0x3a5e5b){_0x12a2e4['push'](_0x12a2e4['shift']());}};_0x493e66(++_0x1ad4da);}(_0x9cea,0x1dc));var _0xa9ce=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x9cea[_0xbd08b4];return _0x314f1e;};'use strict';var express=require(_0xa9ce('0x0'));var router=express[_0xa9ce('0x1')]();var controller=require(_0xa9ce('0x2'));router[_0xa9ce('0x3')]('/',controller['login']);module[_0xa9ce('0x4')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 22aef70..c54ce03 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0x7a54,0x106));var _0x47a5=function(_0x46a359,_0x2dbb69){_0x46a359=_0x46a359-0x0;var _0x47532d=_0x7a54[_0x46a359];return _0x47532d;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x7a54,0x106));var _0x47a5=function(_0xfaf9b3,_0x239bac){_0xfaf9b3=_0xfaf9b3-0x0;var _0x4195d7=_0x7a54[_0xfaf9b3];return _0x4195d7;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 3655dee..115af61 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 _0xebb1=['login','/callback','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','get'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0xebb1,0x1d8));var _0x1ebb=function(_0x52cd85,_0x4d2eb7){_0x52cd85=_0x52cd85-0x0;var _0x386ba5=_0xebb1[_0x52cd85];return _0x386ba5;};'use strict';var express=require(_0x1ebb('0x0'));var passport=require(_0x1ebb('0x1'));var router=express[_0x1ebb('0x2')]();var controller=require(_0x1ebb('0x3'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0x1ebb('0x4')]('/',controller[_0x1ebb('0x5')]);router['get'](_0x1ebb('0x6'),controller['callback'],authService['isMiddleware'],userController[_0x1ebb('0x5')],authService[_0x1ebb('0x7')]);module[_0x1ebb('0x8')]=router; \ No newline at end of file +var _0xc6f8=['express','passport','Router','./authGoogle.controller','../../components/auth/service','login','/callback','callback','isMiddleware'];(function(_0x1bd7b7,_0x18e7c4){var _0x46a408=function(_0x447563){while(--_0x447563){_0x1bd7b7['push'](_0x1bd7b7['shift']());}};_0x46a408(++_0x18e7c4);}(_0xc6f8,0x87));var _0x8c6f=function(_0x5a7be2,_0x26c1c1){_0x5a7be2=_0x5a7be2-0x0;var _0x441406=_0xc6f8[_0x5a7be2];return _0x441406;};'use strict';var express=require(_0x8c6f('0x0'));var passport=require(_0x8c6f('0x1'));var router=express[_0x8c6f('0x2')]();var controller=require(_0x8c6f('0x3'));var userController=require('../user/user.controller.js');var authService=require(_0x8c6f('0x4'));router['get']('/',controller[_0x8c6f('0x5')]);router['get'](_0x8c6f('0x6'),controller[_0x8c6f('0x7')],authService[_0x8c6f('0x8')],userController['login'],authService['setTokenCookie']);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 415fbed..ff550bb 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 _0x746e=['clearBlockUser','getLicense','catch','MailAccount','find','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','\x22%s\x22\x20<%s>','SendMail','error','stringify','status','send','message','login','local-login','signToken','forgot','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','Password\x20reset!','use','util','passport','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','findOne','allowedLoginAttempts','blockDuration','name','password','salt','disabled','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','blocked','blockedAt','add','minutes'];(function(_0x496d7f,_0xe63e95){var _0x7a10df=function(_0x756d90){while(--_0x756d90){_0x496d7f['push'](_0x496d7f['shift']());}};_0x7a10df(++_0xe63e95);}(_0x746e,0x7f));var _0xe746=function(_0x256d6a,_0x2f002f){_0x256d6a=_0x256d6a-0x0;var _0x460058=_0x746e[_0x256d6a];return _0x460058;};'use strict';var util=require(_0xe746('0x0'));var passport=require(_0xe746('0x1'));var LocalStrategy=require('passport-local')[_0xe746('0x2')];var jayson=require(_0xe746('0x3'));var _=require(_0xe746('0x4'));var rs=require(_0xe746('0x5'));var moment=require(_0xe746('0x6'));var db=require(_0xe746('0x7'))['db'];var authService=require(_0xe746('0x8'));var utils=require(_0xe746('0x9'));var client=jayson[_0xe746('0xa')]['http']({'port':0x232b});function localAuthenticate(_0x18a109,_0x535437,_0x1f4234,_0x31714c){var _0x25055e,_0xa478b5;return db['Setting'][_0xe746('0xb')]({'where':{'id':0x1},'attributes':[_0xe746('0xc'),_0xe746('0xd')],'raw':!![]})['then'](function(_0x4c2bd2){_0x25055e=_0x4c2bd2;return _0x18a109[_0xe746('0xb')]({'attributes':['id',_0xe746('0xe'),_0xe746('0xf'),_0xe746('0x10'),'role',_0xe746('0x11'),'blocked','blockedAt','loginAttempts'],'where':{'name':_0x535437,'role':{'$or':[_0xe746('0x12'),_0xe746('0x13'),_0xe746('0x14')]}}});})[_0xe746('0x15')](function(_0x7fea24){if(!_0x7fea24||_0x7fea24&&_0x7fea24['name']!==_0x535437){throw new Error(_0xe746('0x16'));}else{_0xa478b5=_0x7fea24;return _0xa478b5;}})['then'](function(){_0xa478b5[_0xe746('0x17')](_0x1f4234,function(_0x818f68,_0x58d58f){var _0x1b853c=_0xa478b5[_0xe746('0x18')]+0x1;if(_0x818f68){return _0x31714c(_0x818f68);}else if(!_0x58d58f){if(_0xa478b5[_0xe746('0x11')]){return _0x31714c(null,![],{'message':_0xe746('0x16')});}else if(_0x25055e[_0xe746('0xc')]>0x0){if(_0xa478b5[_0xe746('0x19')]){if(_0x25055e[_0xe746('0xd')]>0x0){if(moment(_0xa478b5[_0xe746('0x1a')])[_0xe746('0x1b')](_0x25055e['blockDuration'],_0xe746('0x1c'))>moment()){return _0x31714c(null,![],{'message':_0xe746('0x16')});}else{return utils[_0xe746('0x1d')](_0xa478b5,_0x1b853c,![],null)['then'](function(){return _0x31714c(null,![],{'message':_0xe746('0x16')});});}}else{return _0x31714c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x1b853c>=_0x25055e[_0xe746('0xc')]){return utils['clearBlockUser'](_0xa478b5,0x0,!![],moment())[_0xe746('0x15')](function(){return _0x31714c(null,![],{'message':_0xe746('0x16')});});}else{return utils[_0xe746('0x1d')](_0xa478b5,_0x1b853c,![],null)[_0xe746('0x15')](function(){return _0x31714c(null,![],{'message':_0xe746('0x16')});});}}}else{return _0x31714c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0xa478b5[_0xe746('0x11')]){return _0x31714c(null,![],{'message':_0xe746('0x16')});}else if(_0x25055e[_0xe746('0xc')]>0x0){if(_0xa478b5['blocked']){if(_0x25055e['blockDuration']>0x0){if(moment(_0xa478b5[_0xe746('0x1a')])[_0xe746('0x1b')](_0x25055e[_0xe746('0xd')],_0xe746('0x1c'))>moment()){return _0x31714c(null,![],{'message':_0xe746('0x16')});}else{return utils[_0xe746('0x1d')](_0xa478b5,0x0,![],null)[_0xe746('0x15')](function(){return utils['getLicense'](_0xa478b5);})[_0xe746('0x15')](function(){return _0x31714c(null,_0xa478b5);});}}else{return _0x31714c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xe746('0x1d')](_0xa478b5,0x0,![],null)[_0xe746('0x15')](function(){return utils[_0xe746('0x1e')](_0xa478b5);})['then'](function(){return _0x31714c(null,_0xa478b5);})[_0xe746('0x1f')](function(_0x302a1b){return _0x31714c(null,![],_0x302a1b);});}}else{if(_0xa478b5[_0xe746('0x19')]){return _0x31714c(null,![],{'message':_0xe746('0x16')});}else{return utils[_0xe746('0x1e')](_0xa478b5)['then'](function(){return _0x31714c(null,_0xa478b5);});}}}});})[_0xe746('0x1f')](function(_0x567af7){return _0x31714c(null,![],_0x567af7);});}function sendServiceMail(_0x1796fc){return db[_0xe746('0x20')][_0xe746('0x21')]({'where':{'service':!![]},'attributes':['id',_0xe746('0xe'),_0xe746('0x22')],'include':[{'model':db['MailServerOut'],'as':_0xe746('0x23'),'include':[{'model':db['CloudProvider'],'as':_0xe746('0x24')}]}]})[_0xe746('0x15')](function(_0x21c665){if(!_0x21c665){throw new Error(_0xe746('0x25'));}var _0x37476e=_0x21c665[_0xe746('0x26')]();var _0x227538={'account':_0x37476e,'message':_['merge']({'from':util[_0xe746('0x27')](_0xe746('0x28'),_0x21c665[_0xe746('0xe')],_0x21c665[_0xe746('0x22')]||_0x21c665['Smtp'][_0xe746('0x13')])},_0x1796fc)};return client['request'](_0xe746('0x29'),_0x227538);})[_0xe746('0x15')](function(_0x58d88f){if(_0x58d88f[_0xe746('0x2a')]){throw new Error(util[_0xe746('0x27')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x58d88f[_0xe746('0x2a')]['message']||JSON[_0xe746('0x2b')](_0x58d88f[_0xe746('0x2a')])));}return!![];});}function handleError(_0x2d75ed,_0x2aba8f,_0x1b209e){return _0x2d75ed[_0xe746('0x2c')](_0x2aba8f||0x1f4)[_0xe746('0x2d')]({'message':_0x1b209e?_0x1b209e[_0xe746('0x2e')]||_0x1b209e:''});}exports[_0xe746('0x2f')]=function(_0x3ad23c,_0x424fa9,_0x129edb){passport[_0xe746('0x17')](_0xe746('0x30'),function(_0x23ae9b,_0x144052,_0x196271){var _0x4d00af=_0x23ae9b||_0x196271;if(_0x4d00af){return handleError(_0x424fa9,0x191,_0x4d00af);}if(!_0x144052){return handleError(_0x424fa9,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x3c6439={'payload':{'id':_0x144052['id'],'role':_0x144052['role']},'options':{'expiresIn':0x15180}};return authService[_0xe746('0x31')](_0x3c6439)[_0xe746('0x15')](function(_0x21bf1a){_0x424fa9['json']({'id':_0x144052['id'],'token':_0x21bf1a,'statusCall':'','isAlreadyLogged':_0x144052['online']});});}})(_0x3ad23c,_0x424fa9,_0x129edb);};exports[_0xe746('0x32')]=function(_0x68eae0,_0x5e7f07){if(!_0x68eae0[_0xe746('0x33')]['email']){return handleError(_0x5e7f07,0x1f4,{'message':_0xe746('0x34')});}var _0x5c057a=rs['generate']();_0x68eae0[_0xe746('0x33')]['email']=_0x68eae0['body'][_0xe746('0x22')][_0xe746('0x35')]()[_0xe746('0x36')]();var _0x32e86d;return db[_0xe746('0x37')]['findOne']({'where':{'id':0x1},'attributes':[_0xe746('0xc'),_0xe746('0xd')],'raw':!![]})[_0xe746('0x15')](function(_0x89c930){_0x32e86d=_0x89c930;return db[_0xe746('0x38')][_0xe746('0x21')]({'where':{'email':_0x68eae0[_0xe746('0x33')][_0xe746('0x22')]}});})[_0xe746('0x15')](function(_0x5396ad){if(!_0x5396ad){throw new Error(_0xe746('0x39'));}if(_0x5396ad['disabled']){throw new Error(_0xe746('0x3a'));}if(_0x5396ad[_0xe746('0x19')]){if(moment(_0x5396ad[_0xe746('0x1a')])[_0xe746('0x1b')](_0x32e86d[_0xe746('0xd')],_0xe746('0x1c'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x5396ad[_0xe746('0x19')]=![];_0x5396ad[_0xe746('0x1a')]=null;}}_0x5396ad['resetPasswordToken']=_0x5c057a;_0x5396ad[_0xe746('0x3b')]=Date[_0xe746('0x3c')]()+0x36ee80;return _0x5396ad[_0xe746('0x3d')]();})[_0xe746('0x15')](function(){return sendServiceMail({'to':_0x68eae0['body']['email'],'subject':_0xe746('0x3e'),'text':_0xe746('0x3f')+_0xe746('0x40')+_0xe746('0x41')+_0x68eae0[_0xe746('0x42')][_0xe746('0x43')]+'/reset/'+_0x5c057a+'\x0a\x0a'+_0xe746('0x44')});})[_0xe746('0x15')](function(){_0x5e7f07['status'](0xc8)[_0xe746('0x2d')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x31c1d4){return handleError(_0x5e7f07,0x1f4,_0x31c1d4);});};exports['reset']=function(_0x59f342,_0x364e32){return db[_0xe746('0x38')][_0xe746('0x21')]({'where':{'resetPasswordToken':_0x59f342['params'][_0xe746('0x45')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xe746('0x15')](function(_0x4d2ab3){if(!_0x4d2ab3){throw new Error(_0xe746('0x46'));}return db[_0xe746('0x37')][_0xe746('0xb')]({'attributes':['id','securePassword',_0xe746('0x47'),_0xe746('0x48')]})[_0xe746('0x15')](function(_0x351ba0){if(_0x351ba0[_0xe746('0x49')])authService[_0xe746('0x4a')](_0x59f342[_0xe746('0x33')][_0xe746('0xf')]);if(!_0x351ba0[_0xe746('0x47')]||!_0x4d2ab3[_0xe746('0x4b')])return _0x4d2ab3;authService['validatePasswordHistory'](_0x59f342[_0xe746('0x33')][_0xe746('0xf')],_0x4d2ab3[_0xe746('0x4b')],_0x351ba0[_0xe746('0x48')]);return _0x4d2ab3;})[_0xe746('0x15')](function(){_0x4d2ab3['password']=_0x59f342['body'][_0xe746('0xf')];_0x4d2ab3['resetPasswordToken']=null;_0x4d2ab3[_0xe746('0x3b')]=null;return _0x4d2ab3['save']();});})[_0xe746('0x15')](function(){_0x364e32[_0xe746('0x2c')](0xc8)['send']({'message':_0xe746('0x4c')});})['catch'](function(_0x35b2f3){return handleError(_0x364e32,0x1f4,_0x35b2f3);});};passport[_0xe746('0x4d')](_0xe746('0x30'),new LocalStrategy({'usernameField':_0xe746('0xe'),'passwordField':_0xe746('0xf')},function(_0x34a15a,_0xc30611,_0x410a6a){return localAuthenticate(db[_0xe746('0x38')],_0x34a15a,_0xc30611,_0x410a6a);})); \ No newline at end of file +var _0x7aee=['now','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','save','Password\x20reset!','use','util','passport','Strategy','jayson/promise','lodash','../../mysqldb','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','salt','role','disabled','admin','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','add','minutes','clearBlockUser','blocked','blockedAt','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','user','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires'];(function(_0x40f094,_0x5826c4){var _0x23f991=function(_0x1c1300){while(--_0x1c1300){_0x40f094['push'](_0x40f094['shift']());}};_0x23f991(++_0x5826c4);}(_0x7aee,0x6f));var _0xe7ae=function(_0x251b1e,_0x7ddddd){_0x251b1e=_0x251b1e-0x0;var _0x2fa336=_0x7aee[_0x251b1e];return _0x2fa336;};'use strict';var util=require(_0xe7ae('0x0'));var passport=require(_0xe7ae('0x1'));var LocalStrategy=require('passport-local')[_0xe7ae('0x2')];var jayson=require(_0xe7ae('0x3'));var _=require(_0xe7ae('0x4'));var rs=require('randomstring');var moment=require('moment');var db=require(_0xe7ae('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var client=jayson[_0xe7ae('0x6')][_0xe7ae('0x7')]({'port':0x232b});function localAuthenticate(_0x4f7813,_0x2c66e5,_0x1d7811,_0x15534f){var _0x2c3c2a,_0x1d1740;return db[_0xe7ae('0x8')][_0xe7ae('0x9')]({'where':{'id':0x1},'attributes':[_0xe7ae('0xa'),_0xe7ae('0xb')],'raw':!![]})[_0xe7ae('0xc')](function(_0x53a4b5){_0x2c3c2a=_0x53a4b5;return _0x4f7813['findOne']({'attributes':['id','name','password',_0xe7ae('0xd'),_0xe7ae('0xe'),_0xe7ae('0xf'),'blocked','blockedAt','loginAttempts'],'where':{'name':_0x2c66e5,'role':{'$or':[_0xe7ae('0x10'),'user','agent']}}});})[_0xe7ae('0xc')](function(_0x533557){if(!_0x533557||_0x533557&&_0x533557[_0xe7ae('0x11')]!==_0x2c66e5){throw new Error(_0xe7ae('0x12'));}else{_0x1d1740=_0x533557;return _0x1d1740;}})[_0xe7ae('0xc')](function(){_0x1d1740[_0xe7ae('0x13')](_0x1d7811,function(_0x1f2368,_0x45afcf){var _0x1611ca=_0x1d1740[_0xe7ae('0x14')]+0x1;if(_0x1f2368){return _0x15534f(_0x1f2368);}else if(!_0x45afcf){if(_0x1d1740['disabled']){return _0x15534f(null,![],{'message':_0xe7ae('0x12')});}else if(_0x2c3c2a[_0xe7ae('0xa')]>0x0){if(_0x1d1740['blocked']){if(_0x2c3c2a[_0xe7ae('0xb')]>0x0){if(moment(_0x1d1740['blockedAt'])[_0xe7ae('0x15')](_0x2c3c2a[_0xe7ae('0xb')],_0xe7ae('0x16'))>moment()){return _0x15534f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x1d1740,_0x1611ca,![],null)[_0xe7ae('0xc')](function(){return _0x15534f(null,![],{'message':_0xe7ae('0x12')});});}}else{return _0x15534f(null,![],{'message':_0xe7ae('0x12')});}}else{if(_0x1611ca>=_0x2c3c2a[_0xe7ae('0xa')]){return utils[_0xe7ae('0x17')](_0x1d1740,0x0,!![],moment())[_0xe7ae('0xc')](function(){return _0x15534f(null,![],{'message':_0xe7ae('0x12')});});}else{return utils[_0xe7ae('0x17')](_0x1d1740,_0x1611ca,![],null)['then'](function(){return _0x15534f(null,![],{'message':_0xe7ae('0x12')});});}}}else{return _0x15534f(null,![],{'message':_0xe7ae('0x12')});}}else{if(_0x1d1740[_0xe7ae('0xf')]){return _0x15534f(null,![],{'message':_0xe7ae('0x12')});}else if(_0x2c3c2a[_0xe7ae('0xa')]>0x0){if(_0x1d1740[_0xe7ae('0x18')]){if(_0x2c3c2a[_0xe7ae('0xb')]>0x0){if(moment(_0x1d1740[_0xe7ae('0x19')])['add'](_0x2c3c2a[_0xe7ae('0xb')],'minutes')>moment()){return _0x15534f(null,![],{'message':_0xe7ae('0x12')});}else{return utils[_0xe7ae('0x17')](_0x1d1740,0x0,![],null)[_0xe7ae('0xc')](function(){return utils[_0xe7ae('0x1a')](_0x1d1740);})['then'](function(){return _0x15534f(null,_0x1d1740);});}}else{return _0x15534f(null,![],{'message':_0xe7ae('0x12')});}}else{return utils[_0xe7ae('0x17')](_0x1d1740,0x0,![],null)[_0xe7ae('0xc')](function(){return utils['getLicense'](_0x1d1740);})[_0xe7ae('0xc')](function(){return _0x15534f(null,_0x1d1740);})[_0xe7ae('0x1b')](function(_0x468449){return _0x15534f(null,![],_0x468449);});}}else{if(_0x1d1740[_0xe7ae('0x18')]){return _0x15534f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xe7ae('0x1a')](_0x1d1740)[_0xe7ae('0xc')](function(){return _0x15534f(null,_0x1d1740);});}}}});})[_0xe7ae('0x1b')](function(_0x120bac){return _0x15534f(null,![],_0x120bac);});}function sendServiceMail(_0x280054){return db[_0xe7ae('0x1c')][_0xe7ae('0x1d')]({'where':{'service':!![]},'attributes':['id',_0xe7ae('0x11'),_0xe7ae('0x1e')],'include':[{'model':db[_0xe7ae('0x1f')],'as':_0xe7ae('0x20'),'include':[{'model':db[_0xe7ae('0x21')],'as':'CloudProvider'}]}]})['then'](function(_0x4d7b1c){if(!_0x4d7b1c){throw new Error(_0xe7ae('0x22'));}var _0x43dcee=_0x4d7b1c[_0xe7ae('0x23')]();var _0x197907={'account':_0x43dcee,'message':_[_0xe7ae('0x24')]({'from':util[_0xe7ae('0x25')](_0xe7ae('0x26'),_0x4d7b1c['name'],_0x4d7b1c['email']||_0x4d7b1c[_0xe7ae('0x20')][_0xe7ae('0x27')])},_0x280054)};return client[_0xe7ae('0x28')](_0xe7ae('0x29'),_0x197907);})[_0xe7ae('0xc')](function(_0x28dfa5){if(_0x28dfa5[_0xe7ae('0x2a')]){throw new Error(util[_0xe7ae('0x25')](_0xe7ae('0x2b'),_0x28dfa5[_0xe7ae('0x2a')][_0xe7ae('0x2c')]||JSON[_0xe7ae('0x2d')](_0x28dfa5['error'])));}return!![];});}function handleError(_0x56f533,_0x2391b0,_0x5201c3){return _0x56f533['status'](_0x2391b0||0x1f4)[_0xe7ae('0x2e')]({'message':_0x5201c3?_0x5201c3['message']||_0x5201c3:''});}exports[_0xe7ae('0x2f')]=function(_0x29a6e1,_0x2928aa,_0x42af3c){passport['authenticate'](_0xe7ae('0x30'),function(_0xc9147c,_0x303b04,_0x3c15d9){var _0x191b23=_0xc9147c||_0x3c15d9;if(_0x191b23){return handleError(_0x2928aa,0x191,_0x191b23);}if(!_0x303b04){return handleError(_0x2928aa,0x194,{'message':_0xe7ae('0x31')});}else{var _0x2bcfdf={'payload':{'id':_0x303b04['id'],'role':_0x303b04[_0xe7ae('0xe')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2bcfdf)[_0xe7ae('0xc')](function(_0x3ef295){_0x2928aa[_0xe7ae('0x32')]({'id':_0x303b04['id'],'token':_0x3ef295,'statusCall':'','isAlreadyLogged':_0x303b04[_0xe7ae('0x33')]});});}})(_0x29a6e1,_0x2928aa,_0x42af3c);};exports[_0xe7ae('0x34')]=function(_0x21cfb1,_0x459925){if(!_0x21cfb1[_0xe7ae('0x35')][_0xe7ae('0x1e')]){return handleError(_0x459925,0x1f4,{'message':_0xe7ae('0x36')});}var _0xa910eb=rs[_0xe7ae('0x37')]();_0x21cfb1['body'][_0xe7ae('0x1e')]=_0x21cfb1[_0xe7ae('0x35')]['email'][_0xe7ae('0x38')]()[_0xe7ae('0x39')]();var _0x311dc1;return db[_0xe7ae('0x8')][_0xe7ae('0x9')]({'where':{'id':0x1},'attributes':[_0xe7ae('0xa'),_0xe7ae('0xb')],'raw':!![]})[_0xe7ae('0xc')](function(_0x272c2a){_0x311dc1=_0x272c2a;return db['User']['find']({'where':{'email':_0x21cfb1['body'][_0xe7ae('0x1e')]}});})['then'](function(_0x580205){if(!_0x580205){throw new Error(_0xe7ae('0x3a'));}if(_0x580205['disabled']){throw new Error(_0xe7ae('0x3b'));}if(_0x580205[_0xe7ae('0x18')]){if(moment(_0x580205[_0xe7ae('0x19')])[_0xe7ae('0x15')](_0x311dc1[_0xe7ae('0xb')],'minutes')>moment()){throw new Error(_0xe7ae('0x3c'));}else{_0x580205[_0xe7ae('0x18')]=![];_0x580205[_0xe7ae('0x19')]=null;}}_0x580205[_0xe7ae('0x3d')]=_0xa910eb;_0x580205[_0xe7ae('0x3e')]=Date[_0xe7ae('0x3f')]()+0x36ee80;return _0x580205['save']();})['then'](function(){return sendServiceMail({'to':_0x21cfb1[_0xe7ae('0x35')][_0xe7ae('0x1e')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xe7ae('0x40')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xe7ae('0x41')+_0x21cfb1[_0xe7ae('0x42')][_0xe7ae('0x43')]+_0xe7ae('0x44')+_0xa910eb+'\x0a\x0a'+_0xe7ae('0x45')});})[_0xe7ae('0xc')](function(){_0x459925[_0xe7ae('0x46')](0xc8)[_0xe7ae('0x2e')]({'message':_0xe7ae('0x47')});})[_0xe7ae('0x1b')](function(_0x3f29ce){return handleError(_0x459925,0x1f4,_0x3f29ce);});};exports[_0xe7ae('0x48')]=function(_0xbb2598,_0x190a2e){return db[_0xe7ae('0x49')][_0xe7ae('0x1d')]({'where':{'resetPasswordToken':_0xbb2598[_0xe7ae('0x4a')][_0xe7ae('0x4b')],'resetPasswordExpires':{'$gt':Date[_0xe7ae('0x3f')]()}}})[_0xe7ae('0xc')](function(_0x264c81){if(!_0x264c81){throw new Error(_0xe7ae('0x4c'));}return db[_0xe7ae('0x8')]['findOne']({'attributes':['id',_0xe7ae('0x4d'),_0xe7ae('0x4e'),_0xe7ae('0x4f')]})[_0xe7ae('0xc')](function(_0x1b77cc){if(_0x1b77cc[_0xe7ae('0x4d')])authService[_0xe7ae('0x50')](_0xbb2598[_0xe7ae('0x35')][_0xe7ae('0x51')]);if(!_0x1b77cc['enforcePasswordHistory']||!_0x264c81[_0xe7ae('0x52')])return _0x264c81;authService[_0xe7ae('0x53')](_0xbb2598[_0xe7ae('0x35')][_0xe7ae('0x51')],_0x264c81['previousPasswords'],_0x1b77cc[_0xe7ae('0x4f')]);return _0x264c81;})[_0xe7ae('0xc')](function(){_0x264c81[_0xe7ae('0x51')]=_0xbb2598[_0xe7ae('0x35')]['password'];_0x264c81[_0xe7ae('0x3d')]=null;_0x264c81['resetPasswordExpires']=null;return _0x264c81[_0xe7ae('0x54')]();});})[_0xe7ae('0xc')](function(){_0x190a2e[_0xe7ae('0x46')](0xc8)[_0xe7ae('0x2e')]({'message':_0xe7ae('0x55')});})[_0xe7ae('0x1b')](function(_0x8b1f0c){return handleError(_0x190a2e,0x1f4,_0x8b1f0c);});};passport[_0xe7ae('0x56')](_0xe7ae('0x30'),new LocalStrategy({'usernameField':_0xe7ae('0x11'),'passwordField':_0xe7ae('0x51')},function(_0x4e0efe,_0x41aedd,_0x43fc8a){return localAuthenticate(db[_0xe7ae('0x49')],_0x4e0efe,_0x41aedd,_0x43fc8a);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index cb8c8d4..41df572 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 _0xb9c6=['post','/forgot','/reset/:token','reset','express','Router','login'];(function(_0x14a5d2,_0x3a5fac){var _0x2d66cd=function(_0x1f7a57){while(--_0x1f7a57){_0x14a5d2['push'](_0x14a5d2['shift']());}};_0x2d66cd(++_0x3a5fac);}(_0xb9c6,0xd6));var _0x6b9c=function(_0x5844bd,_0x1d82d6){_0x5844bd=_0x5844bd-0x0;var _0x4a25be=_0xb9c6[_0x5844bd];return _0x4a25be;};'use strict';var express=require(_0x6b9c('0x0'));var router=express[_0x6b9c('0x1')]();var controller=require('./authLocal.controller');router['post']('/',controller[_0x6b9c('0x2')]);router[_0x6b9c('0x3')](_0x6b9c('0x4'),controller['forgot']);router[_0x6b9c('0x3')](_0x6b9c('0x5'),controller[_0x6b9c('0x6')]);module['exports']=router; \ No newline at end of file +var _0x8cd8=['post','login','/forgot','forgot','/reset/:token','reset','Router','./authLocal.controller'];(function(_0x3b0820,_0x5ac0a1){var _0xf5ae85=function(_0x361004){while(--_0x361004){_0x3b0820['push'](_0x3b0820['shift']());}};_0xf5ae85(++_0x5ac0a1);}(_0x8cd8,0x156));var _0x88cd=function(_0x95cc87,_0x299ed6){_0x95cc87=_0x95cc87-0x0;var _0x42d038=_0x8cd8[_0x95cc87];return _0x42d038;};'use strict';var express=require('express');var router=express[_0x88cd('0x0')]();var controller=require(_0x88cd('0x1'));router[_0x88cd('0x2')]('/',controller[_0x88cd('0x3')]);router[_0x88cd('0x2')](_0x88cd('0x4'),controller[_0x88cd('0x5')]);router['post'](_0x88cd('0x6'),controller[_0x88cd('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 61edc41..1cf0a18 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 _0x6691=['INTEGER','sequelize','exports','STRING'];(function(_0x4d423c,_0x1db25f){var _0x5499a1=function(_0x2c4bfa){while(--_0x2c4bfa){_0x4d423c['push'](_0x4d423c['shift']());}};_0x5499a1(++_0x1db25f);}(_0x6691,0x139));var _0x1669=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x6691[_0x2d7f0e];return _0x110b07;};'use strict';var Sequelize=require(_0x1669('0x0'));module[_0x1669('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x1669('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x1669('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x2d60=['sequelize','STRING','BOOLEAN','INTEGER'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x2d60,0xf8));var _0x02d6=function(_0x1c5224,_0x59d728){_0x1c5224=_0x1c5224-0x0;var _0x512514=_0x2d60[_0x1c5224];return _0x512514;};'use strict';var Sequelize=require(_0x02d6('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x02d6('0x1')]},'description':{'type':Sequelize[_0x02d6('0x1')]},'status':{'type':Sequelize[_0x02d6('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x02d6('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 d543a98..348626b 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 _0x124e=['getActions','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','filter','where','VIRTUAL','merge','include','findAll','rows','catch','params','filters','includeAll','options','find','create','body','addConditions','Condition','omit','getConditions','findOne','order','pick','Action','ids'];(function(_0x3458d6,_0xfb4d2a){var _0x5c89bf=function(_0x517ff){while(--_0x517ff){_0x3458d6['push'](_0x3458d6['shift']());}};_0x5c89bf(++_0xfb4d2a);}(_0x124e,0x19b));var _0xe124=function(_0x2afbb0,_0x44f16d){_0x2afbb0=_0x2afbb0-0x0;var _0x411ff2=_0x124e[_0x2afbb0];return _0x411ff2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe124('0x0'));var jsonpatch=require(_0xe124('0x1'));var rp=require('request-promise');var moment=require(_0xe124('0x2'));var BPromise=require(_0xe124('0x3'));var Mustache=require('mustache');var util=require(_0xe124('0x4'));var path=require(_0xe124('0x5'));var sox=require(_0xe124('0x6'));var csv=require(_0xe124('0x7'));var ejs=require(_0xe124('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe124('0x9'));var crypto=require('crypto');var jsforce=require(_0xe124('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xe124('0x7'));var querystring=require(_0xe124('0xb'));var Papa=require(_0xe124('0xc'));var Redis=require(_0xe124('0xd'));var authService=require(_0xe124('0xe'));var qs=require(_0xe124('0xf'));var as=require(_0xe124('0x10'));var hardwareService=require(_0xe124('0x11'));var logger=require(_0xe124('0x12'))('api');var utils=require(_0xe124('0x13'));var config=require(_0xe124('0x14'));var licenseUtil=require(_0xe124('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24a845,_0x2e6858){_0x2e6858=_0x2e6858||0xcc;return function(_0x48579a){if(_0x48579a){return _0x24a845['sendStatus'](_0x2e6858);}return _0x24a845[_0xe124('0x16')](_0x2e6858)[_0xe124('0x17')]();};}function respondWithResult(_0x76e98d,_0x403220){_0x403220=_0x403220||0xc8;return function(_0x28962a){if(_0x28962a){return _0x76e98d[_0xe124('0x16')](_0x403220)[_0xe124('0x18')](_0x28962a);}};}function respondWithFilteredResult(_0x32fa61,_0x180787){return function(_0x8df518){if(_0x8df518){var _0xe5ed09=typeof _0x180787[_0xe124('0x19')]===_0xe124('0x1a')&&typeof _0x180787['limit']===_0xe124('0x1a');var _0x3613d9=_0x8df518[_0xe124('0x1b')];var _0x2f513e=_0xe5ed09?0x0:_0x180787['offset'];var _0x105bbe=_0xe5ed09?_0x8df518['count']:_0x180787[_0xe124('0x19')]+_0x180787['limit'];var _0x3682b7;if(_0x105bbe>=_0x3613d9){_0x105bbe=_0x3613d9;_0x3682b7=0xc8;}else{_0x3682b7=0xce;}_0x32fa61[_0xe124('0x16')](_0x3682b7);return _0x32fa61[_0xe124('0x1c')](_0xe124('0x1d'),_0x2f513e+'-'+_0x105bbe+'/'+_0x3613d9)[_0xe124('0x18')](_0x8df518);}return null;};}function patchUpdates(_0x562cde){return function(_0x11c134){try{jsonpatch[_0xe124('0x1e')](_0x11c134,_0x562cde,!![]);}catch(_0x537f5b){return BPromise['reject'](_0x537f5b);}return _0x11c134[_0xe124('0x1f')]();};}function saveUpdates(_0x20e78e,_0x16d3eb){return function(_0x168690){if(_0x168690){return _0x168690[_0xe124('0x20')](_0x20e78e)[_0xe124('0x21')](function(_0x15adcf){return _0x15adcf;});}return null;};}function removeEntity(_0x442f62,_0xc17bfd){return function(_0x10caad){if(_0x10caad){return _0x10caad[_0xe124('0x22')]()[_0xe124('0x21')](function(){_0x442f62[_0xe124('0x16')](0xcc)[_0xe124('0x17')]();});}};}function handleEntityNotFound(_0x9532d8,_0x35e1db){return function(_0x20272a){if(!_0x20272a){_0x9532d8[_0xe124('0x23')](0x194);}return _0x20272a;};}function handleError(_0x2ff79d,_0x574722){_0x574722=_0x574722||0x1f4;return function(_0x53ef5c){logger[_0xe124('0x24')](_0x53ef5c['stack']);if(_0x53ef5c[_0xe124('0x25')]){delete _0x53ef5c[_0xe124('0x25')];}_0x2ff79d['status'](_0x574722)[_0xe124('0x26')](_0x53ef5c);};}exports[_0xe124('0x27')]=function(_0x2f4b14,_0x534dc8){var _0x5b44e7={},_0x59584d={},_0xda4692={'count':0x0,'rows':[]};var _0x56d73f=_[_0xe124('0x28')](db[_0xe124('0x29')][_0xe124('0x2a')],function(_0x5d56b2){return{'name':_0x5d56b2[_0xe124('0x2b')],'type':_0x5d56b2[_0xe124('0x2c')][_0xe124('0x2d')]};});_0x59584d[_0xe124('0x2e')]=_[_0xe124('0x28')](_0x56d73f,'name');_0x59584d[_0xe124('0x2f')]=_[_0xe124('0x30')](_0x2f4b14[_0xe124('0x2f')]);_0x59584d['filters']=_[_0xe124('0x31')](_0x59584d['model'],_0x59584d[_0xe124('0x2f')]);_0x5b44e7[_0xe124('0x32')]=_[_0xe124('0x31')](_0x59584d[_0xe124('0x2e')],qs[_0xe124('0x33')](_0x2f4b14[_0xe124('0x2f')][_0xe124('0x33')]));_0x5b44e7['attributes']=_0x5b44e7['attributes'][_0xe124('0x34')]?_0x5b44e7[_0xe124('0x32')]:_0x59584d['model'];if(!_0x2f4b14[_0xe124('0x2f')][_0xe124('0x35')](_0xe124('0x36'))){_0x5b44e7[_0xe124('0x37')]=qs['limit'](_0x2f4b14['query'][_0xe124('0x37')]);_0x5b44e7[_0xe124('0x19')]=qs['offset'](_0x2f4b14[_0xe124('0x2f')][_0xe124('0x19')]);}_0x5b44e7['order']=qs[_0xe124('0x38')](_0x2f4b14[_0xe124('0x2f')][_0xe124('0x38')]);_0x5b44e7['where']=qs['filters'](_['pick'](_0x2f4b14['query'],_0x59584d['filters']),_0x56d73f);if(_0x2f4b14[_0xe124('0x2f')][_0xe124('0x39')]){_0x5b44e7[_0xe124('0x3a')]=_['merge'](_0x5b44e7[_0xe124('0x3a')],{'$or':_[_0xe124('0x28')](_0x56d73f,function(_0x5e525c){if(_0x5e525c['type']!==_0xe124('0x3b')){var _0x3e8415={};_0x3e8415[_0x5e525c[_0xe124('0x25')]]={'$like':'%'+_0x2f4b14['query']['filter']+'%'};return _0x3e8415;}})});}_0x5b44e7=_[_0xe124('0x3c')]({},_0x5b44e7,_0x2f4b14['options']);var _0x37d7e5={'where':_0x5b44e7[_0xe124('0x3a')]};return db[_0xe124('0x29')][_0xe124('0x1b')](_0x37d7e5)['then'](function(_0xf4c226){_0xda4692[_0xe124('0x1b')]=_0xf4c226;if(_0x2f4b14['query']['includeAll']){_0x5b44e7[_0xe124('0x3d')]=[{'all':!![]}];}return db[_0xe124('0x29')][_0xe124('0x3e')](_0x5b44e7);})[_0xe124('0x21')](function(_0x3d8e9){_0xda4692[_0xe124('0x3f')]=_0x3d8e9;return _0xda4692;})[_0xe124('0x21')](respondWithFilteredResult(_0x534dc8,_0x5b44e7))[_0xe124('0x40')](handleError(_0x534dc8,null));};exports['show']=function(_0x355c72,_0x55df18){var _0x4b092d={'raw':![],'where':{'id':_0x355c72[_0xe124('0x41')]['id']}},_0x535a1c={};_0x535a1c[_0xe124('0x2e')]=_[_0xe124('0x30')](db['Automation'][_0xe124('0x2a')]);_0x535a1c['query']=_['keys'](_0x355c72[_0xe124('0x2f')]);_0x535a1c[_0xe124('0x42')]=_[_0xe124('0x31')](_0x535a1c[_0xe124('0x2e')],_0x535a1c[_0xe124('0x2f')]);_0x4b092d['attributes']=_['intersection'](_0x535a1c['model'],qs[_0xe124('0x33')](_0x355c72[_0xe124('0x2f')]['fields']));_0x4b092d[_0xe124('0x32')]=_0x4b092d[_0xe124('0x32')][_0xe124('0x34')]?_0x4b092d['attributes']:_0x535a1c['model'];if(_0x355c72[_0xe124('0x2f')][_0xe124('0x43')]){_0x4b092d[_0xe124('0x3d')]=[{'all':!![]}];}_0x4b092d=_[_0xe124('0x3c')]({},_0x4b092d,_0x355c72[_0xe124('0x44')]);return db[_0xe124('0x29')][_0xe124('0x45')](_0x4b092d)[_0xe124('0x21')](handleEntityNotFound(_0x55df18,null))['then'](respondWithResult(_0x55df18,null))[_0xe124('0x40')](handleError(_0x55df18,null));};exports[_0xe124('0x46')]=function(_0x35a65c,_0x30de37){return db[_0xe124('0x29')][_0xe124('0x46')](_0x35a65c[_0xe124('0x47')],{})['then'](respondWithResult(_0x30de37,0xc9))[_0xe124('0x40')](handleError(_0x30de37,null));};exports['update']=function(_0x2d1fb2,_0x3fd6bf){if(_0x2d1fb2[_0xe124('0x47')]['id']){delete _0x2d1fb2['body']['id'];}return db[_0xe124('0x29')]['find']({'where':{'id':_0x2d1fb2['params']['id']}})[_0xe124('0x21')](handleEntityNotFound(_0x3fd6bf,null))[_0xe124('0x21')](saveUpdates(_0x2d1fb2[_0xe124('0x47')],null))['then'](respondWithResult(_0x3fd6bf,null))[_0xe124('0x40')](handleError(_0x3fd6bf,null));};exports[_0xe124('0x22')]=function(_0x4b693f,_0x500403){return db[_0xe124('0x29')]['find']({'where':{'id':_0x4b693f[_0xe124('0x41')]['id']}})['then'](handleEntityNotFound(_0x500403,null))[_0xe124('0x21')](removeEntity(_0x500403,null))[_0xe124('0x40')](handleError(_0x500403,null));};exports[_0xe124('0x48')]=function(_0x4e8e44,_0x2a4b29,_0xb4f0d0){return db[_0xe124('0x49')][_0xe124('0x45')]({'where':{'id':_0x4e8e44[_0xe124('0x41')]['id']}})[_0xe124('0x21')](handleEntityNotFound(_0x2a4b29,null))[_0xe124('0x21')](function(_0x495a94){if(_0x495a94){return _0x495a94[_0xe124('0x48')](_0x4e8e44['body']['ids'],_[_0xe124('0x4a')](_0x4e8e44['body'],['ids','id'])||{});}})[_0xe124('0x21')](respondWithResult(_0x2a4b29,null))[_0xe124('0x40')](handleError(_0x2a4b29,null));};exports[_0xe124('0x4b')]=function(_0x563ef7,_0x11a65a,_0x4232f1){var _0xb5e08b={};var _0x52ca38={};var _0x43e8eb;var _0x5e1bc3;return db[_0xe124('0x29')][_0xe124('0x4c')]({'where':{'id':_0x563ef7[_0xe124('0x41')]['id']}})[_0xe124('0x21')](handleEntityNotFound(_0x11a65a,null))[_0xe124('0x21')](function(_0x4f41bb){if(_0x4f41bb){_0x43e8eb=_0x4f41bb;_0x52ca38[_0xe124('0x2e')]=_[_0xe124('0x30')](db['Condition'][_0xe124('0x2a')]);_0x52ca38[_0xe124('0x2f')]=_[_0xe124('0x30')](_0x563ef7['query']);_0x52ca38[_0xe124('0x42')]=_[_0xe124('0x31')](_0x52ca38['model'],_0x52ca38[_0xe124('0x2f')]);_0xb5e08b['attributes']=_[_0xe124('0x31')](_0x52ca38[_0xe124('0x2e')],qs[_0xe124('0x33')](_0x563ef7['query']['fields']));_0xb5e08b[_0xe124('0x32')]=_0xb5e08b[_0xe124('0x32')][_0xe124('0x34')]?_0xb5e08b[_0xe124('0x32')]:_0x52ca38[_0xe124('0x2e')];_0xb5e08b[_0xe124('0x4d')]=qs['sort'](_0x563ef7[_0xe124('0x2f')][_0xe124('0x38')]);_0xb5e08b['where']=qs[_0xe124('0x42')](_[_0xe124('0x4e')](_0x563ef7['query'],_0x52ca38[_0xe124('0x42')]));if(_0x563ef7[_0xe124('0x2f')][_0xe124('0x39')]){_0xb5e08b[_0xe124('0x3a')]=_[_0xe124('0x3c')](_0xb5e08b[_0xe124('0x3a')],{'$or':_[_0xe124('0x28')](_0xb5e08b['attributes'],function(_0x399e2a){var _0x4644d4={};_0x4644d4[_0x399e2a]={'$like':'%'+_0x563ef7[_0xe124('0x2f')][_0xe124('0x39')]+'%'};return _0x4644d4;})});}_0xb5e08b=_[_0xe124('0x3c')]({},_0xb5e08b,_0x563ef7[_0xe124('0x44')]);return _0x43e8eb[_0xe124('0x4b')](_0xb5e08b);}})[_0xe124('0x21')](function(_0x920bb4){if(_0x920bb4){_0x5e1bc3=_0x920bb4['length'];if(!_0x563ef7[_0xe124('0x2f')][_0xe124('0x35')](_0xe124('0x36'))){_0xb5e08b['limit']=qs[_0xe124('0x37')](_0x563ef7[_0xe124('0x2f')]['limit']);_0xb5e08b[_0xe124('0x19')]=qs[_0xe124('0x19')](_0x563ef7[_0xe124('0x2f')][_0xe124('0x19')]);}return _0x43e8eb['getConditions'](_0xb5e08b);}})[_0xe124('0x21')](function(_0x4e0fcf){if(_0x4e0fcf){return _0x4e0fcf?{'count':_0x5e1bc3,'rows':_0x4e0fcf}:null;}})[_0xe124('0x21')](respondWithResult(_0x11a65a,null))['catch'](handleError(_0x11a65a,null));};exports['addActions']=function(_0x8d1f7c,_0x8a2226,_0xf01248){return db[_0xe124('0x4f')][_0xe124('0x45')]({'where':{'id':_0x8d1f7c['params']['id']}})[_0xe124('0x21')](handleEntityNotFound(_0x8a2226,null))[_0xe124('0x21')](function(_0x2575b1){if(_0x2575b1){return _0x2575b1['addActions'](_0x8d1f7c['body'][_0xe124('0x50')],_[_0xe124('0x4a')](_0x8d1f7c[_0xe124('0x47')],[_0xe124('0x50'),'id'])||{});}})[_0xe124('0x21')](respondWithResult(_0x8a2226,null))[_0xe124('0x40')](handleError(_0x8a2226,null));};exports['getActions']=function(_0x1c2f3a,_0x3cfbbd,_0x1c663a){var _0x397fa2={};var _0x190d8c={};var _0x13dd9a;var _0x362a10;return db[_0xe124('0x29')][_0xe124('0x4c')]({'where':{'id':_0x1c2f3a['params']['id']}})['then'](handleEntityNotFound(_0x3cfbbd,null))[_0xe124('0x21')](function(_0x3f868c){if(_0x3f868c){_0x13dd9a=_0x3f868c;_0x190d8c[_0xe124('0x2e')]=_[_0xe124('0x30')](db[_0xe124('0x4f')][_0xe124('0x2a')]);_0x190d8c[_0xe124('0x2f')]=_[_0xe124('0x30')](_0x1c2f3a['query']);_0x190d8c[_0xe124('0x42')]=_['intersection'](_0x190d8c['model'],_0x190d8c[_0xe124('0x2f')]);_0x397fa2['attributes']=_[_0xe124('0x31')](_0x190d8c[_0xe124('0x2e')],qs['fields'](_0x1c2f3a[_0xe124('0x2f')][_0xe124('0x33')]));_0x397fa2[_0xe124('0x32')]=_0x397fa2[_0xe124('0x32')]['length']?_0x397fa2[_0xe124('0x32')]:_0x190d8c[_0xe124('0x2e')];_0x397fa2['order']=qs[_0xe124('0x38')](_0x1c2f3a[_0xe124('0x2f')][_0xe124('0x38')]);_0x397fa2['where']=qs[_0xe124('0x42')](_['pick'](_0x1c2f3a[_0xe124('0x2f')],_0x190d8c[_0xe124('0x42')]));if(_0x1c2f3a['query'][_0xe124('0x39')]){_0x397fa2[_0xe124('0x3a')]=_['merge'](_0x397fa2[_0xe124('0x3a')],{'$or':_[_0xe124('0x28')](_0x397fa2[_0xe124('0x32')],function(_0x333cb4){var _0x465b83={};_0x465b83[_0x333cb4]={'$like':'%'+_0x1c2f3a[_0xe124('0x2f')]['filter']+'%'};return _0x465b83;})});}_0x397fa2=_[_0xe124('0x3c')]({},_0x397fa2,_0x1c2f3a[_0xe124('0x44')]);return _0x13dd9a[_0xe124('0x51')](_0x397fa2);}})[_0xe124('0x21')](function(_0x480bd0){if(_0x480bd0){_0x362a10=_0x480bd0[_0xe124('0x34')];if(!_0x1c2f3a['query']['hasOwnProperty'](_0xe124('0x36'))){_0x397fa2[_0xe124('0x37')]=qs[_0xe124('0x37')](_0x1c2f3a[_0xe124('0x2f')][_0xe124('0x37')]);_0x397fa2[_0xe124('0x19')]=qs['offset'](_0x1c2f3a['query'][_0xe124('0x19')]);}return _0x13dd9a[_0xe124('0x51')](_0x397fa2);}})[_0xe124('0x21')](function(_0x3b31b7){if(_0x3b31b7){return _0x3b31b7?{'count':_0x362a10,'rows':_0x3b31b7}:null;}})[_0xe124('0x21')](respondWithResult(_0x3cfbbd,null))[_0xe124('0x40')](handleError(_0x3cfbbd,null));}; \ No newline at end of file +var _0x2163=['key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','addConditions','Condition','ids','findOne','pick','getConditions','hasOwnProperty','addActions','Action','omit','getActions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','status','end','limit','undefined','count','offset','set','Content-Range','apply','update','then','stack','name','send','index','map','Automation','rawAttributes','fieldName','type'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x2163,0x78));var _0x3216=function(_0x3ad910,_0xbb07d0){_0x3ad910=_0x3ad910-0x0;var _0x277a52=_0x2163[_0x3ad910];return _0x277a52;};'use strict';var emlformat=require(_0x3216('0x0'));var rimraf=require(_0x3216('0x1'));var zipdir=require(_0x3216('0x2'));var jsonpatch=require(_0x3216('0x3'));var rp=require('request-promise');var moment=require(_0x3216('0x4'));var BPromise=require(_0x3216('0x5'));var Mustache=require(_0x3216('0x6'));var util=require(_0x3216('0x7'));var path=require(_0x3216('0x8'));var sox=require(_0x3216('0x9'));var csv=require(_0x3216('0xa'));var ejs=require(_0x3216('0xb'));var fs=require('fs');var fs_extra=require(_0x3216('0xc'));var _=require(_0x3216('0xd'));var squel=require(_0x3216('0xe'));var crypto=require('crypto');var jsforce=require(_0x3216('0xf'));var deskjs=require(_0x3216('0x10'));var toCsv=require(_0x3216('0xa'));var querystring=require(_0x3216('0x11'));var Papa=require(_0x3216('0x12'));var Redis=require(_0x3216('0x13'));var authService=require(_0x3216('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x3216('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3216('0x16'))(_0x3216('0x17'));var utils=require(_0x3216('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x3216('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x46dd01,_0x36265a){_0x36265a=_0x36265a||0xcc;return function(_0x19a9ce){if(_0x19a9ce){return _0x46dd01['sendStatus'](_0x36265a);}return _0x46dd01[_0x3216('0x1a')](_0x36265a)[_0x3216('0x1b')]();};}function respondWithResult(_0x1fe292,_0x24d0d3){_0x24d0d3=_0x24d0d3||0xc8;return function(_0x1b147d){if(_0x1b147d){return _0x1fe292['status'](_0x24d0d3)['json'](_0x1b147d);}};}function respondWithFilteredResult(_0x1c2a6d,_0xaa0a7d){return function(_0x2fc37d){if(_0x2fc37d){var _0x476142=typeof _0xaa0a7d['offset']==='undefined'&&typeof _0xaa0a7d[_0x3216('0x1c')]===_0x3216('0x1d');var _0x18b712=_0x2fc37d[_0x3216('0x1e')];var _0x3602c4=_0x476142?0x0:_0xaa0a7d[_0x3216('0x1f')];var _0x1876dc=_0x476142?_0x2fc37d[_0x3216('0x1e')]:_0xaa0a7d[_0x3216('0x1f')]+_0xaa0a7d['limit'];var _0x3a27fa;if(_0x1876dc>=_0x18b712){_0x1876dc=_0x18b712;_0x3a27fa=0xc8;}else{_0x3a27fa=0xce;}_0x1c2a6d['status'](_0x3a27fa);return _0x1c2a6d[_0x3216('0x20')](_0x3216('0x21'),_0x3602c4+'-'+_0x1876dc+'/'+_0x18b712)['json'](_0x2fc37d);}return null;};}function patchUpdates(_0x15f670){return function(_0xfb1abe){try{jsonpatch[_0x3216('0x22')](_0xfb1abe,_0x15f670,!![]);}catch(_0x27bdd8){return BPromise['reject'](_0x27bdd8);}return _0xfb1abe['save']();};}function saveUpdates(_0x2c1aae,_0x28872c){return function(_0x24afce){if(_0x24afce){return _0x24afce[_0x3216('0x23')](_0x2c1aae)['then'](function(_0x5e54cc){return _0x5e54cc;});}return null;};}function removeEntity(_0x17ac15,_0x3fa15d){return function(_0x3b3c03){if(_0x3b3c03){return _0x3b3c03['destroy']()[_0x3216('0x24')](function(){_0x17ac15[_0x3216('0x1a')](0xcc)[_0x3216('0x1b')]();});}};}function handleEntityNotFound(_0x2af95b,_0x16b501){return function(_0x360a3a){if(!_0x360a3a){_0x2af95b['sendStatus'](0x194);}return _0x360a3a;};}function handleError(_0x592ab0,_0x4ac019){_0x4ac019=_0x4ac019||0x1f4;return function(_0x52dbbe){logger['error'](_0x52dbbe[_0x3216('0x25')]);if(_0x52dbbe[_0x3216('0x26')]){delete _0x52dbbe[_0x3216('0x26')];}_0x592ab0[_0x3216('0x1a')](_0x4ac019)[_0x3216('0x27')](_0x52dbbe);};}exports[_0x3216('0x28')]=function(_0x3ed080,_0x185fcb){var _0x36aa55={},_0x56fa0d={},_0x3b90da={'count':0x0,'rows':[]};var _0x4299c9=_[_0x3216('0x29')](db[_0x3216('0x2a')][_0x3216('0x2b')],function(_0x1114ed){return{'name':_0x1114ed[_0x3216('0x2c')],'type':_0x1114ed[_0x3216('0x2d')][_0x3216('0x2e')]};});_0x56fa0d[_0x3216('0x2f')]=_[_0x3216('0x29')](_0x4299c9,_0x3216('0x26'));_0x56fa0d[_0x3216('0x30')]=_[_0x3216('0x31')](_0x3ed080['query']);_0x56fa0d[_0x3216('0x32')]=_['intersection'](_0x56fa0d[_0x3216('0x2f')],_0x56fa0d[_0x3216('0x30')]);_0x36aa55[_0x3216('0x33')]=_[_0x3216('0x34')](_0x56fa0d['model'],qs['fields'](_0x3ed080[_0x3216('0x30')][_0x3216('0x35')]));_0x36aa55[_0x3216('0x33')]=_0x36aa55['attributes'][_0x3216('0x36')]?_0x36aa55[_0x3216('0x33')]:_0x56fa0d[_0x3216('0x2f')];if(!_0x3ed080[_0x3216('0x30')]['hasOwnProperty'](_0x3216('0x37'))){_0x36aa55['limit']=qs[_0x3216('0x1c')](_0x3ed080['query']['limit']);_0x36aa55[_0x3216('0x1f')]=qs[_0x3216('0x1f')](_0x3ed080[_0x3216('0x30')]['offset']);}_0x36aa55[_0x3216('0x38')]=qs['sort'](_0x3ed080[_0x3216('0x30')][_0x3216('0x39')]);_0x36aa55['where']=qs[_0x3216('0x32')](_['pick'](_0x3ed080[_0x3216('0x30')],_0x56fa0d[_0x3216('0x32')]),_0x4299c9);if(_0x3ed080['query'][_0x3216('0x3a')]){_0x36aa55[_0x3216('0x3b')]=_['merge'](_0x36aa55['where'],{'$or':_['map'](_0x4299c9,function(_0x1da06b){if(_0x1da06b[_0x3216('0x2d')]!==_0x3216('0x3c')){var _0x4d94aa={};_0x4d94aa[_0x1da06b[_0x3216('0x26')]]={'$like':'%'+_0x3ed080[_0x3216('0x30')]['filter']+'%'};return _0x4d94aa;}})});}_0x36aa55=_[_0x3216('0x3d')]({},_0x36aa55,_0x3ed080[_0x3216('0x3e')]);var _0x2abd33={'where':_0x36aa55['where']};return db['Automation'][_0x3216('0x1e')](_0x2abd33)[_0x3216('0x24')](function(_0x2b9d1f){_0x3b90da[_0x3216('0x1e')]=_0x2b9d1f;if(_0x3ed080[_0x3216('0x30')][_0x3216('0x3f')]){_0x36aa55[_0x3216('0x40')]=[{'all':!![]}];}return db['Automation'][_0x3216('0x41')](_0x36aa55);})[_0x3216('0x24')](function(_0x531c6f){_0x3b90da['rows']=_0x531c6f;return _0x3b90da;})[_0x3216('0x24')](respondWithFilteredResult(_0x185fcb,_0x36aa55))[_0x3216('0x42')](handleError(_0x185fcb,null));};exports[_0x3216('0x43')]=function(_0x479024,_0x59d4d2){var _0x3ece3b={'raw':![],'where':{'id':_0x479024[_0x3216('0x44')]['id']}},_0x2404a5={};_0x2404a5[_0x3216('0x2f')]=_[_0x3216('0x31')](db[_0x3216('0x2a')][_0x3216('0x2b')]);_0x2404a5[_0x3216('0x30')]=_[_0x3216('0x31')](_0x479024[_0x3216('0x30')]);_0x2404a5[_0x3216('0x32')]=_[_0x3216('0x34')](_0x2404a5[_0x3216('0x2f')],_0x2404a5['query']);_0x3ece3b[_0x3216('0x33')]=_['intersection'](_0x2404a5[_0x3216('0x2f')],qs[_0x3216('0x35')](_0x479024[_0x3216('0x30')][_0x3216('0x35')]));_0x3ece3b['attributes']=_0x3ece3b[_0x3216('0x33')]['length']?_0x3ece3b[_0x3216('0x33')]:_0x2404a5['model'];if(_0x479024[_0x3216('0x30')][_0x3216('0x3f')]){_0x3ece3b['include']=[{'all':!![]}];}_0x3ece3b=_[_0x3216('0x3d')]({},_0x3ece3b,_0x479024[_0x3216('0x3e')]);return db[_0x3216('0x2a')][_0x3216('0x45')](_0x3ece3b)[_0x3216('0x24')](handleEntityNotFound(_0x59d4d2,null))['then'](respondWithResult(_0x59d4d2,null))['catch'](handleError(_0x59d4d2,null));};exports[_0x3216('0x46')]=function(_0x498944,_0xce95c1){return db[_0x3216('0x2a')][_0x3216('0x46')](_0x498944[_0x3216('0x47')],{})[_0x3216('0x24')](respondWithResult(_0xce95c1,0xc9))['catch'](handleError(_0xce95c1,null));};exports['update']=function(_0x32bdf8,_0x39aedd){if(_0x32bdf8[_0x3216('0x47')]['id']){delete _0x32bdf8[_0x3216('0x47')]['id'];}return db[_0x3216('0x2a')]['find']({'where':{'id':_0x32bdf8[_0x3216('0x44')]['id']}})[_0x3216('0x24')](handleEntityNotFound(_0x39aedd,null))['then'](saveUpdates(_0x32bdf8[_0x3216('0x47')],null))[_0x3216('0x24')](respondWithResult(_0x39aedd,null))[_0x3216('0x42')](handleError(_0x39aedd,null));};exports['destroy']=function(_0x2d2fcf,_0x5a3a73){return db[_0x3216('0x2a')][_0x3216('0x45')]({'where':{'id':_0x2d2fcf[_0x3216('0x44')]['id']}})['then'](handleEntityNotFound(_0x5a3a73,null))[_0x3216('0x24')](removeEntity(_0x5a3a73,null))['catch'](handleError(_0x5a3a73,null));};exports[_0x3216('0x48')]=function(_0x5a3a48,_0x30d3e0,_0x52f304){return db[_0x3216('0x49')]['find']({'where':{'id':_0x5a3a48[_0x3216('0x44')]['id']}})['then'](handleEntityNotFound(_0x30d3e0,null))[_0x3216('0x24')](function(_0x112849){if(_0x112849){return _0x112849[_0x3216('0x48')](_0x5a3a48['body']['ids'],_['omit'](_0x5a3a48['body'],[_0x3216('0x4a'),'id'])||{});}})[_0x3216('0x24')](respondWithResult(_0x30d3e0,null))['catch'](handleError(_0x30d3e0,null));};exports['getConditions']=function(_0x4ca2c7,_0xb654cf,_0xfd399){var _0x17b930={};var _0x20bb99={};var _0x56a791;var _0x3e9ba7;return db[_0x3216('0x2a')][_0x3216('0x4b')]({'where':{'id':_0x4ca2c7[_0x3216('0x44')]['id']}})[_0x3216('0x24')](handleEntityNotFound(_0xb654cf,null))['then'](function(_0x3d260a){if(_0x3d260a){_0x56a791=_0x3d260a;_0x20bb99[_0x3216('0x2f')]=_['keys'](db[_0x3216('0x49')][_0x3216('0x2b')]);_0x20bb99['query']=_['keys'](_0x4ca2c7['query']);_0x20bb99[_0x3216('0x32')]=_[_0x3216('0x34')](_0x20bb99[_0x3216('0x2f')],_0x20bb99[_0x3216('0x30')]);_0x17b930[_0x3216('0x33')]=_[_0x3216('0x34')](_0x20bb99['model'],qs['fields'](_0x4ca2c7['query'][_0x3216('0x35')]));_0x17b930[_0x3216('0x33')]=_0x17b930['attributes'][_0x3216('0x36')]?_0x17b930[_0x3216('0x33')]:_0x20bb99['model'];_0x17b930[_0x3216('0x38')]=qs[_0x3216('0x39')](_0x4ca2c7[_0x3216('0x30')][_0x3216('0x39')]);_0x17b930[_0x3216('0x3b')]=qs['filters'](_[_0x3216('0x4c')](_0x4ca2c7[_0x3216('0x30')],_0x20bb99[_0x3216('0x32')]));if(_0x4ca2c7[_0x3216('0x30')][_0x3216('0x3a')]){_0x17b930[_0x3216('0x3b')]=_[_0x3216('0x3d')](_0x17b930[_0x3216('0x3b')],{'$or':_[_0x3216('0x29')](_0x17b930[_0x3216('0x33')],function(_0x5b9635){var _0x42c436={};_0x42c436[_0x5b9635]={'$like':'%'+_0x4ca2c7[_0x3216('0x30')][_0x3216('0x3a')]+'%'};return _0x42c436;})});}_0x17b930=_[_0x3216('0x3d')]({},_0x17b930,_0x4ca2c7[_0x3216('0x3e')]);return _0x56a791[_0x3216('0x4d')](_0x17b930);}})[_0x3216('0x24')](function(_0x12dc74){if(_0x12dc74){_0x3e9ba7=_0x12dc74[_0x3216('0x36')];if(!_0x4ca2c7['query'][_0x3216('0x4e')](_0x3216('0x37'))){_0x17b930[_0x3216('0x1c')]=qs['limit'](_0x4ca2c7['query'][_0x3216('0x1c')]);_0x17b930[_0x3216('0x1f')]=qs[_0x3216('0x1f')](_0x4ca2c7['query'][_0x3216('0x1f')]);}return _0x56a791[_0x3216('0x4d')](_0x17b930);}})[_0x3216('0x24')](function(_0x479b0b){if(_0x479b0b){return _0x479b0b?{'count':_0x3e9ba7,'rows':_0x479b0b}:null;}})[_0x3216('0x24')](respondWithResult(_0xb654cf,null))[_0x3216('0x42')](handleError(_0xb654cf,null));};exports[_0x3216('0x4f')]=function(_0x5c8864,_0x1cfdf2,_0xa18f9c){return db[_0x3216('0x50')]['find']({'where':{'id':_0x5c8864[_0x3216('0x44')]['id']}})['then'](handleEntityNotFound(_0x1cfdf2,null))[_0x3216('0x24')](function(_0x52c7b8){if(_0x52c7b8){return _0x52c7b8[_0x3216('0x4f')](_0x5c8864[_0x3216('0x47')][_0x3216('0x4a')],_[_0x3216('0x51')](_0x5c8864[_0x3216('0x47')],[_0x3216('0x4a'),'id'])||{});}})[_0x3216('0x24')](respondWithResult(_0x1cfdf2,null))[_0x3216('0x42')](handleError(_0x1cfdf2,null));};exports[_0x3216('0x52')]=function(_0x21ec67,_0x173c17,_0x56a7f2){var _0x5b0fae={};var _0x5b78de={};var _0x23000b;var _0x3abbb8;return db[_0x3216('0x2a')]['findOne']({'where':{'id':_0x21ec67[_0x3216('0x44')]['id']}})[_0x3216('0x24')](handleEntityNotFound(_0x173c17,null))[_0x3216('0x24')](function(_0x2478ef){if(_0x2478ef){_0x23000b=_0x2478ef;_0x5b78de[_0x3216('0x2f')]=_[_0x3216('0x31')](db['Action'][_0x3216('0x2b')]);_0x5b78de[_0x3216('0x30')]=_[_0x3216('0x31')](_0x21ec67[_0x3216('0x30')]);_0x5b78de[_0x3216('0x32')]=_[_0x3216('0x34')](_0x5b78de[_0x3216('0x2f')],_0x5b78de[_0x3216('0x30')]);_0x5b0fae[_0x3216('0x33')]=_[_0x3216('0x34')](_0x5b78de[_0x3216('0x2f')],qs[_0x3216('0x35')](_0x21ec67[_0x3216('0x30')][_0x3216('0x35')]));_0x5b0fae[_0x3216('0x33')]=_0x5b0fae['attributes'][_0x3216('0x36')]?_0x5b0fae[_0x3216('0x33')]:_0x5b78de[_0x3216('0x2f')];_0x5b0fae[_0x3216('0x38')]=qs[_0x3216('0x39')](_0x21ec67[_0x3216('0x30')]['sort']);_0x5b0fae[_0x3216('0x3b')]=qs['filters'](_[_0x3216('0x4c')](_0x21ec67['query'],_0x5b78de[_0x3216('0x32')]));if(_0x21ec67[_0x3216('0x30')][_0x3216('0x3a')]){_0x5b0fae['where']=_[_0x3216('0x3d')](_0x5b0fae[_0x3216('0x3b')],{'$or':_['map'](_0x5b0fae[_0x3216('0x33')],function(_0x2b5ab5){var _0x597625={};_0x597625[_0x2b5ab5]={'$like':'%'+_0x21ec67[_0x3216('0x30')][_0x3216('0x3a')]+'%'};return _0x597625;})});}_0x5b0fae=_[_0x3216('0x3d')]({},_0x5b0fae,_0x21ec67[_0x3216('0x3e')]);return _0x23000b[_0x3216('0x52')](_0x5b0fae);}})[_0x3216('0x24')](function(_0x55b2eb){if(_0x55b2eb){_0x3abbb8=_0x55b2eb[_0x3216('0x36')];if(!_0x21ec67[_0x3216('0x30')][_0x3216('0x4e')](_0x3216('0x37'))){_0x5b0fae['limit']=qs[_0x3216('0x1c')](_0x21ec67[_0x3216('0x30')][_0x3216('0x1c')]);_0x5b0fae[_0x3216('0x1f')]=qs['offset'](_0x21ec67[_0x3216('0x30')][_0x3216('0x1f')]);}return _0x23000b[_0x3216('0x52')](_0x5b0fae);}})[_0x3216('0x24')](function(_0x503f1e){if(_0x503f1e){return _0x503f1e?{'count':_0x3abbb8,'rows':_0x503f1e}:null;}})['then'](respondWithResult(_0x173c17,null))[_0x3216('0x42')](handleError(_0x173c17,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 458276c..6b3fc36 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 _0x29ef=['request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','../../config/logger','moment','bluebird'];(function(_0x1e81af,_0x287f4b){var _0x34204b=function(_0x40089f){while(--_0x40089f){_0x1e81af['push'](_0x1e81af['shift']());}};_0x34204b(++_0x287f4b);}(_0x29ef,0x17d));var _0xf29e=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x29ef[_0x17928f];return _0x500b63;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf29e('0x0'))('api');var moment=require(_0xf29e('0x1'));var BPromise=require(_0xf29e('0x2'));var rp=require(_0xf29e('0x3'));var fs=require('fs');var path=require(_0xf29e('0x4'));var rimraf=require(_0xf29e('0x5'));var config=require(_0xf29e('0x6'));var attributes=require(_0xf29e('0x7'));module[_0xf29e('0x8')]=function(_0x12029c,_0x3741ac){return _0x12029c[_0xf29e('0x9')](_0xf29e('0xa'),attributes,{'tableName':_0xf29e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf1df=['./automation.attributes','exports','define','Automation','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x367fd1,_0x5eb011){var _0x561d39=function(_0x17f191){while(--_0x17f191){_0x367fd1['push'](_0x367fd1['shift']());}};_0x561d39(++_0x5eb011);}(_0xf1df,0x10c));var _0xff1d=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xf1df[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xff1d('0x0'));var util=require(_0xff1d('0x1'));var logger=require('../../config/logger')(_0xff1d('0x2'));var moment=require('moment');var BPromise=require(_0xff1d('0x3'));var rp=require(_0xff1d('0x4'));var fs=require('fs');var path=require(_0xff1d('0x5'));var rimraf=require(_0xff1d('0x6'));var config=require(_0xff1d('0x7'));var attributes=require(_0xff1d('0x8'));module[_0xff1d('0x9')]=function(_0x14ba6d,_0x3c900d){return _0x14ba6d[_0xff1d('0xa')](_0xff1d('0xb'),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 c039975..5ca90b8 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 _0x7916=['result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','Automation,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x3a3de1,_0x58237a){var _0x2cc7c9=function(_0x3250dc){while(--_0x3250dc){_0x3a3de1['push'](_0x3a3de1['shift']());}};_0x2cc7c9(++_0x58237a);}(_0x7916,0x128));var _0x6791=function(_0x2786b3,_0x8e6d26){_0x2786b3=_0x2786b3-0x0;var _0x34223e=_0x7916[_0x2786b3];return _0x34223e;};'use strict';var _=require(_0x6791('0x0'));var util=require('util');var moment=require(_0x6791('0x1'));var BPromise=require(_0x6791('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6791('0x3'));var db=require(_0x6791('0x4'))['db'];var utils=require(_0x6791('0x5'));var logger=require(_0x6791('0x6'))('rpc');var config=require(_0x6791('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6791('0x8')][_0x6791('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ad8c0,_0x8b85ff,_0x5d2118){return new BPromise(function(_0x2b240c,_0x50c563){return client['request'](_0x5ad8c0,_0x5d2118)[_0x6791('0xa')](function(_0x198a64){logger['info'](_0x6791('0xb'),_0x8b85ff,_0x6791('0xc'));logger[_0x6791('0xd')]('Automation,\x20%s,\x20%s,\x20%s',_0x8b85ff,_0x6791('0xc'),JSON[_0x6791('0xe')](_0x198a64));if(_0x198a64[_0x6791('0xf')]){if(_0x198a64[_0x6791('0xf')][_0x6791('0x10')]===0x1f4){logger[_0x6791('0xf')](_0x6791('0xb'),_0x8b85ff,_0x198a64[_0x6791('0xf')][_0x6791('0x11')]);return _0x50c563(_0x198a64[_0x6791('0xf')][_0x6791('0x11')]);}logger['error']('Automation,\x20%s,\x20%s',_0x8b85ff,_0x198a64[_0x6791('0xf')]['message']);return _0x2b240c(_0x198a64[_0x6791('0xf')]['message']);}else{logger[_0x6791('0x12')](_0x6791('0xb'),_0x8b85ff,'request\x20sent');_0x2b240c(_0x198a64[_0x6791('0x13')]['message']);}})[_0x6791('0x14')](function(_0x150d1f){logger['error'](_0x6791('0xb'),_0x8b85ff,_0x150d1f);_0x50c563(_0x150d1f);});});} \ No newline at end of file +var _0x530f=['message','result','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','Automation,\x20%s,\x20%s'];(function(_0x49cc47,_0x100f9e){var _0x14f3db=function(_0x2c0d65){while(--_0x2c0d65){_0x49cc47['push'](_0x49cc47['shift']());}};_0x14f3db(++_0x100f9e);}(_0x530f,0x167));var _0xf530=function(_0x11c913,_0x1c6f22){_0x11c913=_0x11c913-0x0;var _0x5ba6eb=_0x530f[_0x11c913];return _0x5ba6eb;};'use strict';var _=require('lodash');var util=require(_0xf530('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf530('0x1'));var fs=require('fs');var Redis=require(_0xf530('0x2'));var db=require(_0xf530('0x3'))['db'];var utils=require(_0xf530('0x4'));var logger=require(_0xf530('0x5'))(_0xf530('0x6'));var config=require(_0xf530('0x7'));var jayson=require(_0xf530('0x8'));var client=jayson['client'][_0xf530('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ce7f8,_0x1e8282,_0x50682f){return new BPromise(function(_0x2bbe3c,_0xf205be){return client[_0xf530('0xa')](_0x2ce7f8,_0x50682f)[_0xf530('0xb')](function(_0x4132bf){logger[_0xf530('0xc')]('Automation,\x20%s,\x20%s',_0x1e8282,_0xf530('0xd'));logger[_0xf530('0xe')](_0xf530('0xf'),_0x1e8282,_0xf530('0xd'),JSON[_0xf530('0x10')](_0x4132bf));if(_0x4132bf[_0xf530('0x11')]){if(_0x4132bf['error']['code']===0x1f4){logger[_0xf530('0x11')](_0xf530('0x12'),_0x1e8282,_0x4132bf[_0xf530('0x11')][_0xf530('0x13')]);return _0xf205be(_0x4132bf[_0xf530('0x11')]['message']);}logger[_0xf530('0x11')](_0xf530('0x12'),_0x1e8282,_0x4132bf[_0xf530('0x11')][_0xf530('0x13')]);return _0x2bbe3c(_0x4132bf[_0xf530('0x11')][_0xf530('0x13')]);}else{logger[_0xf530('0xc')](_0xf530('0x12'),_0x1e8282,'request\x20sent');_0x2bbe3c(_0x4132bf[_0xf530('0x14')][_0xf530('0x13')]);}})['catch'](function(_0x32eaea){logger[_0xf530('0x11')]('Automation,\x20%s,\x20%s',_0x1e8282,_0x32eaea);_0xf205be(_0x32eaea);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 2777795..329f0df 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 _0x52b2=['index','/:id','isAuthenticated','show','getConditions','/:id/actions','getActions','post','create','/:id/conditions','addConditions','addActions','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get'];(function(_0xf75f1b,_0x1cfe97){var _0x315806=function(_0x5c8a64){while(--_0x5c8a64){_0xf75f1b['push'](_0xf75f1b['shift']());}};_0x315806(++_0x1cfe97);}(_0x52b2,0x11e));var _0x252b=function(_0x277898,_0x2ec1fa){_0x277898=_0x277898-0x0;var _0x534b98=_0x52b2[_0x277898];return _0x534b98;};'use strict';var multer=require(_0x252b('0x0'));var util=require(_0x252b('0x1'));var path=require(_0x252b('0x2'));var timeout=require(_0x252b('0x3'));var express=require(_0x252b('0x4'));var router=express[_0x252b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x252b('0x6'));var interaction=require(_0x252b('0x7'));var config=require(_0x252b('0x8'));var controller=require(_0x252b('0x9'));router[_0x252b('0xa')]('/',auth['isAuthenticated'](),controller[_0x252b('0xb')]);router[_0x252b('0xa')](_0x252b('0xc'),auth[_0x252b('0xd')](),controller[_0x252b('0xe')]);router[_0x252b('0xa')]('/:id/conditions',auth[_0x252b('0xd')](),controller[_0x252b('0xf')]);router['get'](_0x252b('0x10'),auth[_0x252b('0xd')](),controller[_0x252b('0x11')]);router[_0x252b('0x12')]('/',auth[_0x252b('0xd')](),controller[_0x252b('0x13')]);router[_0x252b('0x12')](_0x252b('0x14'),auth[_0x252b('0xd')](),controller[_0x252b('0x15')]);router[_0x252b('0x12')]('/:id/actions',auth[_0x252b('0xd')](),controller[_0x252b('0x16')]);router[_0x252b('0x17')](_0x252b('0xc'),auth[_0x252b('0xd')](),controller[_0x252b('0x18')]);router[_0x252b('0x19')](_0x252b('0xc'),auth[_0x252b('0xd')](),controller['destroy']);module[_0x252b('0x1a')]=router; \ No newline at end of file +var _0x8aaa=['addActions','update','/:id','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','index','isAuthenticated','show','/:id/conditions','getActions','post','create','addConditions','/:id/actions'];(function(_0x5a814d,_0xd749b2){var _0x430f9f=function(_0x5d0588){while(--_0x5d0588){_0x5a814d['push'](_0x5a814d['shift']());}};_0x430f9f(++_0xd749b2);}(_0x8aaa,0x64));var _0xa8aa=function(_0x1ebb10,_0x156b3e){_0x1ebb10=_0x1ebb10-0x0;var _0x20d709=_0x8aaa[_0x1ebb10];return _0x20d709;};'use strict';var multer=require(_0xa8aa('0x0'));var util=require(_0xa8aa('0x1'));var path=require(_0xa8aa('0x2'));var timeout=require('connect-timeout');var express=require(_0xa8aa('0x3'));var router=express[_0xa8aa('0x4')]();var fs_extra=require(_0xa8aa('0x5'));var auth=require(_0xa8aa('0x6'));var interaction=require(_0xa8aa('0x7'));var config=require(_0xa8aa('0x8'));var controller=require(_0xa8aa('0x9'));router[_0xa8aa('0xa')]('/',auth['isAuthenticated'](),controller[_0xa8aa('0xb')]);router['get']('/:id',auth[_0xa8aa('0xc')](),controller[_0xa8aa('0xd')]);router['get'](_0xa8aa('0xe'),auth[_0xa8aa('0xc')](),controller['getConditions']);router['get']('/:id/actions',auth[_0xa8aa('0xc')](),controller[_0xa8aa('0xf')]);router[_0xa8aa('0x10')]('/',auth[_0xa8aa('0xc')](),controller[_0xa8aa('0x11')]);router[_0xa8aa('0x10')](_0xa8aa('0xe'),auth['isAuthenticated'](),controller[_0xa8aa('0x12')]);router['post'](_0xa8aa('0x13'),auth[_0xa8aa('0xc')](),controller[_0xa8aa('0x14')]);router['put']('/:id',auth[_0xa8aa('0xc')](),controller[_0xa8aa('0x15')]);router['delete'](_0xa8aa('0x16'),auth[_0xa8aa('0xc')](),controller['destroy']);module[_0xa8aa('0x17')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 7d01a93..d62a338 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 _0x9339=['#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','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','never','onlyIfOpen','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting'];(function(_0x3eaf1d,_0x3c0d2a){var _0x35b471=function(_0x1d3e48){while(--_0x1d3e48){_0x3eaf1d['push'](_0x3eaf1d['shift']());}};_0x35b471(++_0x3c0d2a);}(_0x9339,0x1bd));var _0x9933=function(_0x527fb4,_0xc15f2e){_0x527fb4=_0x527fb4-0x0;var _0x4d50cd=_0x9339[_0x527fb4];return _0x4d50cd;};'use strict';var Sequelize=require(_0x9933('0x0'));module[_0x9933('0x1')]={'name':{'type':Sequelize[_0x9933('0x2')],'unique':_0x9933('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x9933('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x9933('0x2')]},'active':{'type':Sequelize[_0x9933('0x5')],'defaultValue':0x0,'comment':_0x9933('0x6')},'limitCalls':{'type':Sequelize[_0x9933('0x7')](0x4)[_0x9933('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x9933('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x9933('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x9933('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x9933('0x7')](0x3)[_0x9933('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9933('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x9933('0x7')](0x5)[_0x9933('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9933('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x9933('0x7')](0x3)[_0x9933('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9933('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9933('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x9933('0x7')](0x3)[_0x9933('0x8')],'defaultValue':0x3,'comment':_0x9933('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x9933('0x7')](0x5)[_0x9933('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x9933('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x9933('0xf')},'dialTimezone':{'type':Sequelize[_0x9933('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x9933('0x2')],'defaultValue':_0x9933('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x9933('0x11')]('always',_0x9933('0x12'),_0x9933('0x13')),'defaultValue':_0x9933('0x14')},'dialAMDActive':{'type':Sequelize[_0x9933('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x9933('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x9933('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x9933('0x7')](0x9)[_0x9933('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x9933('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x9933('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x9933('0x7')](0x9)[_0x9933('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x9933('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x9933('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x9933('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x9933('0x7')](0x9)[_0x9933('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x9933('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x9933('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x9933('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9933('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x9933('0x11')](_0x9933('0x1d'),_0x9933('0x1e')),'defaultValue':_0x9933('0x1d')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x9933('0x7')](0x3)[_0x9933('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x9933('0x7')](0x3)[_0x9933('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9933('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x9933('0x7')](0x3)[_0x9933('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x9933('0x7')](0x5)[_0x9933('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x9933('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9933('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0x9933('0x7')](0x5)[_0x9933('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9933('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x9933('0x7')](0x3)[_0x9933('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x9933('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9933('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0x9933('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9933('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x9933('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9933('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x9933('0x7')](0x3)[_0x9933('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9933('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x9933('0x7')](0x5)[_0x9933('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9933('0x26')}}; \ No newline at end of file +var _0x5e8c=['Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','name','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','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,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)'];(function(_0x37c630,_0x547511){var _0x1ffd0d=function(_0x42ca36){while(--_0x42ca36){_0x37c630['push'](_0x37c630['shift']());}};_0x1ffd0d(++_0x547511);}(_0x5e8c,0x1da));var _0xc5e8=function(_0x334df9,_0x1a6594){_0x334df9=_0x334df9-0x0;var _0x4211c0=_0x5e8c[_0x334df9];return _0x4211c0;};'use strict';var Sequelize=require(_0xc5e8('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xc5e8('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc5e8('0x2')](_0xc5e8('0x3')),'allowNull':![],'defaultValue':_0xc5e8('0x3')},'description':{'type':Sequelize[_0xc5e8('0x4')]},'active':{'type':Sequelize[_0xc5e8('0x5')],'defaultValue':0x0,'comment':_0xc5e8('0x6')},'limitCalls':{'type':Sequelize[_0xc5e8('0x7')](0x4)[_0xc5e8('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xc5e8('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xc5e8('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc5e8('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc5e8('0x7')](0x3)[_0xc5e8('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc5e8('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc5e8('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xc5e8('0x7')](0x3)[_0xc5e8('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xc5e8('0x7')](0x5)[_0xc5e8('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5e8('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc5e8('0x7')](0x3)[_0xc5e8('0x8')],'defaultValue':0x3,'comment':_0xc5e8('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc5e8('0x7')](0x5)[_0xc5e8('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xc5e8('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc5e8('0xe')},'dialTimezone':{'type':Sequelize[_0xc5e8('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc5e8('0x4')],'defaultValue':_0xc5e8('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xc5e8('0x2')](_0xc5e8('0x10'),_0xc5e8('0x11'),_0xc5e8('0x12')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xc5e8('0x5')],'defaultValue':0x0,'comment':_0xc5e8('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xc5e8('0x7')](0x9)[_0xc5e8('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc5e8('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xc5e8('0x7')](0x9)[_0xc5e8('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc5e8('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc5e8('0x7')](0x9)[_0xc5e8('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xc5e8('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc5e8('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xc5e8('0x7')](0x9)[_0xc5e8('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc5e8('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc5e8('0x7')](0x9)[_0xc5e8('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc5e8('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc5e8('0x7')](0x9)[_0xc5e8('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xc5e8('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc5e8('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc5e8('0x7')](0x9)[_0xc5e8('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc5e8('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xc5e8('0x2')](_0xc5e8('0x1c'),'ASC'),'defaultValue':_0xc5e8('0x1c')},'dialPrefix':{'type':Sequelize[_0xc5e8('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc5e8('0x7')](0x3)[_0xc5e8('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc5e8('0x1d')},'dialCutDigit':{'type':Sequelize[_0xc5e8('0x7')](0x3)[_0xc5e8('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc5e8('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc5e8('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc5e8('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc5e8('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5e8('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xc5e8('0x7')](0x3)[_0xc5e8('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc5e8('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0xc5e8('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc5e8('0x7')](0x3)[_0xc5e8('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc5e8('0x7')](0x5)[_0xc5e8('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5e8('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xc5e8('0x7')](0x3)[_0xc5e8('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xc5e8('0x7')](0x5)[_0xc5e8('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5e8('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xc5e8('0x7')](0x5)[_0xc5e8('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 04f9dd0..32f63ca 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 _0xa71a=['model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','clone','updatedAt','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','CmHopperBlack','CmList','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','omit','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','createdAt','select','field','NOW()','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','IvrCampaigns','UserProfileResource','name','send','Campaign','type','key'];(function(_0x1d5b97,_0x4b174d){var _0x569aad=function(_0x453100){while(--_0x453100){_0x1d5b97['push'](_0x1d5b97['shift']());}};_0x569aad(++_0x4b174d);}(_0xa71a,0xf1));var _0xaa71=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa71a[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0xaa71('0x0'));var rimraf=require(_0xaa71('0x1'));var zipdir=require(_0xaa71('0x2'));var jsonpatch=require(_0xaa71('0x3'));var rp=require('request-promise');var moment=require(_0xaa71('0x4'));var BPromise=require(_0xaa71('0x5'));var Mustache=require(_0xaa71('0x6'));var util=require('util');var path=require(_0xaa71('0x7'));var sox=require('sox');var csv=require(_0xaa71('0x8'));var ejs=require(_0xaa71('0x9'));var fs=require('fs');var fs_extra=require(_0xaa71('0xa'));var _=require('lodash');var squel=require(_0xaa71('0xb'));var crypto=require(_0xaa71('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xaa71('0x8'));var querystring=require(_0xaa71('0xd'));var Papa=require(_0xaa71('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xaa71('0xf'));var as=require(_0xaa71('0x10'));var hardwareService=require(_0xaa71('0x11'));var logger=require(_0xaa71('0x12'))(_0xaa71('0x13'));var utils=require(_0xaa71('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x464b95,_0x128712){_0x128712=_0x128712||0xcc;return function(_0x3b7a53){if(_0x3b7a53){return _0x464b95['sendStatus'](_0x128712);}return _0x464b95[_0xaa71('0x15')](_0x128712)[_0xaa71('0x16')]();};}function respondWithResult(_0x2131ba,_0x2b3ea2){_0x2b3ea2=_0x2b3ea2||0xc8;return function(_0x1851a3){if(_0x1851a3){return _0x2131ba[_0xaa71('0x15')](_0x2b3ea2)['json'](_0x1851a3);}};}function respondWithFilteredResult(_0x31bce1,_0x400021){return function(_0x33b581){if(_0x33b581){var _0x5b4f5a=typeof _0x400021[_0xaa71('0x17')]===_0xaa71('0x18')&&typeof _0x400021[_0xaa71('0x19')]===_0xaa71('0x18');var _0x23b9e7=_0x33b581[_0xaa71('0x1a')];var _0x42405c=_0x5b4f5a?0x0:_0x400021[_0xaa71('0x17')];var _0x1d8dc1=_0x5b4f5a?_0x33b581[_0xaa71('0x1a')]:_0x400021['offset']+_0x400021[_0xaa71('0x19')];var _0xdbe4c5;if(_0x1d8dc1>=_0x23b9e7){_0x1d8dc1=_0x23b9e7;_0xdbe4c5=0xc8;}else{_0xdbe4c5=0xce;}_0x31bce1[_0xaa71('0x15')](_0xdbe4c5);return _0x31bce1[_0xaa71('0x1b')](_0xaa71('0x1c'),_0x42405c+'-'+_0x1d8dc1+'/'+_0x23b9e7)['json'](_0x33b581);}return null;};}function patchUpdates(_0x3d7b88){return function(_0x51b618){try{jsonpatch[_0xaa71('0x1d')](_0x51b618,_0x3d7b88,!![]);}catch(_0x179827){return BPromise[_0xaa71('0x1e')](_0x179827);}return _0x51b618[_0xaa71('0x1f')]();};}function saveUpdates(_0x2e3f95,_0x51b31b){return function(_0x5d087e){if(_0x5d087e){return _0x5d087e[_0xaa71('0x20')](_0x2e3f95)['then'](function(_0xc150a3){return _0xc150a3;});}return null;};}function removeEntity(_0x844d51,_0x46fc48){return function(_0x434dda){if(_0x434dda){return _0x434dda[_0xaa71('0x21')]()[_0xaa71('0x22')](function(){var _0x1bde4f=_0x434dda[_0xaa71('0x23')]({'plain':!![]});var _0x286c40=_0xaa71('0x24');return db[_0xaa71('0x25')][_0xaa71('0x21')]({'where':{'type':_0x286c40,'resourceId':_0x1bde4f['id']}})[_0xaa71('0x22')](function(){return _0x434dda;});})['then'](function(){_0x844d51['status'](0xcc)[_0xaa71('0x16')]();});}};}function handleEntityNotFound(_0x320982,_0x1e7517){return function(_0x496582){if(!_0x496582){_0x320982['sendStatus'](0x194);}return _0x496582;};}function handleError(_0x123a82,_0x4ee6fe){_0x4ee6fe=_0x4ee6fe||0x1f4;return function(_0x1d3a37){logger['error'](_0x1d3a37['stack']);if(_0x1d3a37[_0xaa71('0x26')]){delete _0x1d3a37['name'];}_0x123a82[_0xaa71('0x15')](_0x4ee6fe)[_0xaa71('0x27')](_0x1d3a37);};}exports['index']=function(_0x35a9e8,_0x300707){var _0x1a8161={},_0x59e8ea={},_0x33242d={'count':0x0,'rows':[]};var _0x53d46f=_['map'](db[_0xaa71('0x28')]['rawAttributes'],function(_0x3f862a){return{'name':_0x3f862a['fieldName'],'type':_0x3f862a[_0xaa71('0x29')][_0xaa71('0x2a')]};});_0x59e8ea[_0xaa71('0x2b')]=_[_0xaa71('0x2c')](_0x53d46f,_0xaa71('0x26'));_0x59e8ea[_0xaa71('0x2d')]=_[_0xaa71('0x2e')](_0x35a9e8[_0xaa71('0x2d')]);_0x59e8ea[_0xaa71('0x2f')]=_['intersection'](_0x59e8ea['model'],_0x59e8ea[_0xaa71('0x2d')]);_0x1a8161[_0xaa71('0x30')]=_['intersection'](_0x59e8ea[_0xaa71('0x2b')],qs[_0xaa71('0x31')](_0x35a9e8[_0xaa71('0x2d')][_0xaa71('0x31')]));_0x1a8161[_0xaa71('0x30')]=_0x1a8161[_0xaa71('0x30')][_0xaa71('0x32')]?_0x1a8161['attributes']:_0x59e8ea[_0xaa71('0x2b')];if(!_0x35a9e8[_0xaa71('0x2d')][_0xaa71('0x33')](_0xaa71('0x34'))){_0x1a8161['limit']=qs[_0xaa71('0x19')](_0x35a9e8[_0xaa71('0x2d')][_0xaa71('0x19')]);_0x1a8161['offset']=qs[_0xaa71('0x17')](_0x35a9e8['query']['offset']);}_0x1a8161[_0xaa71('0x35')]=qs[_0xaa71('0x36')](_0x35a9e8[_0xaa71('0x2d')]['sort']);_0x1a8161[_0xaa71('0x37')]=qs[_0xaa71('0x2f')](_[_0xaa71('0x38')](_0x35a9e8[_0xaa71('0x2d')],_0x59e8ea[_0xaa71('0x2f')]),_0x53d46f);if(_0x35a9e8['query'][_0xaa71('0x39')]){_0x1a8161['where']=_['merge'](_0x1a8161[_0xaa71('0x37')],{'$or':_['map'](_0x53d46f,function(_0x40eb5a){if(_0x40eb5a[_0xaa71('0x29')]!==_0xaa71('0x3a')){var _0x5a9055={};_0x5a9055[_0x40eb5a[_0xaa71('0x26')]]={'$like':'%'+_0x35a9e8[_0xaa71('0x2d')]['filter']+'%'};return _0x5a9055;}})});}_0x1a8161=_[_0xaa71('0x3b')]({},_0x1a8161,_0x35a9e8[_0xaa71('0x3c')]);var _0x322da9={'where':_0x1a8161[_0xaa71('0x37')]};return db[_0xaa71('0x28')][_0xaa71('0x1a')](_0x322da9)[_0xaa71('0x22')](function(_0x40b3b4){_0x33242d[_0xaa71('0x1a')]=_0x40b3b4;if(_0x35a9e8[_0xaa71('0x2d')][_0xaa71('0x3d')]){_0x1a8161[_0xaa71('0x3e')]=[{'all':!![]}];}return db['Campaign'][_0xaa71('0x3f')](_0x1a8161);})[_0xaa71('0x22')](function(_0x38d148){_0x33242d[_0xaa71('0x40')]=_0x38d148;return _0x33242d;})[_0xaa71('0x22')](respondWithFilteredResult(_0x300707,_0x1a8161))[_0xaa71('0x41')](handleError(_0x300707,null));};exports[_0xaa71('0x42')]=function(_0x5e72b0,_0x318922){var _0x10a7fa={'raw':![],'where':{'id':_0x5e72b0[_0xaa71('0x43')]['id']}},_0x20e852={};_0x20e852[_0xaa71('0x2b')]=_[_0xaa71('0x2e')](db[_0xaa71('0x28')][_0xaa71('0x44')]);_0x20e852[_0xaa71('0x2d')]=_['keys'](_0x5e72b0['query']);_0x20e852[_0xaa71('0x2f')]=_[_0xaa71('0x45')](_0x20e852[_0xaa71('0x2b')],_0x20e852[_0xaa71('0x2d')]);_0x10a7fa[_0xaa71('0x30')]=_[_0xaa71('0x45')](_0x20e852[_0xaa71('0x2b')],qs[_0xaa71('0x31')](_0x5e72b0[_0xaa71('0x2d')][_0xaa71('0x31')]));_0x10a7fa[_0xaa71('0x30')]=_0x10a7fa[_0xaa71('0x30')][_0xaa71('0x32')]?_0x10a7fa[_0xaa71('0x30')]:_0x20e852[_0xaa71('0x2b')];if(_0x5e72b0['query'][_0xaa71('0x3d')]){_0x10a7fa[_0xaa71('0x3e')]=[{'all':!![]}];}_0x10a7fa=_[_0xaa71('0x3b')]({},_0x10a7fa,_0x5e72b0['options']);return db['Campaign']['find'](_0x10a7fa)['then'](handleEntityNotFound(_0x318922,null))[_0xaa71('0x22')](respondWithResult(_0x318922,null))['catch'](handleError(_0x318922,null));};exports[_0xaa71('0x46')]=function(_0x2b670d,_0xd6de04){return db[_0xaa71('0x28')][_0xaa71('0x46')](_0x2b670d[_0xaa71('0x47')],{})['then'](function(_0x2db14b){var _0x211621=_0x2b670d[_0xaa71('0x48')][_0xaa71('0x23')]({'plain':!![]});if(!_0x211621)throw new Error(_0xaa71('0x49'));if(_0x211621[_0xaa71('0x4a')]===_0xaa71('0x48')){var _0x303417=_0x2db14b[_0xaa71('0x23')]({'plain':!![]});var _0x3d836c=_0xaa71('0x24');return db[_0xaa71('0x4b')][_0xaa71('0x4c')]({'where':{'name':_0x3d836c,'userProfileId':_0x211621['userProfileId']},'raw':!![]})[_0xaa71('0x22')](function(_0x46c6fa){if(_0x46c6fa&&_0x46c6fa[_0xaa71('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x303417[_0xaa71('0x26')],'resourceId':_0x303417['id'],'type':_0x46c6fa[_0xaa71('0x26')],'sectionId':_0x46c6fa['id']},{})[_0xaa71('0x22')](function(){return _0x2db14b;});}else{return _0x2db14b;}})[_0xaa71('0x41')](function(_0x5762b5){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5762b5);throw _0x5762b5;});}return _0x2db14b;})[_0xaa71('0x22')](respondWithResult(_0xd6de04,0xc9))[_0xaa71('0x41')](handleError(_0xd6de04,null));};exports[_0xaa71('0x4e')]=function(_0xf2d5a4,_0x276dc4){var _0x2ce8eb={'where':{'id':_0xf2d5a4[_0xaa71('0x43')]['id']}},_0x5a5c37={};_0x5a5c37[_0xaa71('0x2b')]=_['keys'](db[_0xaa71('0x28')]['rawAttributes']);_0x2ce8eb[_0xaa71('0x30')]=_[_0xaa71('0x45')](_0x5a5c37[_0xaa71('0x2b')],qs[_0xaa71('0x31')](_0xf2d5a4[_0xaa71('0x2d')][_0xaa71('0x31')]));_0x2ce8eb[_0xaa71('0x30')]=_0x2ce8eb[_0xaa71('0x30')][_0xaa71('0x32')]?_0x2ce8eb[_0xaa71('0x30')]:_0x5a5c37[_0xaa71('0x2b')];if(_0xf2d5a4[_0xaa71('0x2d')][_0xaa71('0x3d')]){_0x2ce8eb[_0xaa71('0x3e')]=[{'all':!![]}];}_0x2ce8eb=_[_0xaa71('0x3b')]({},_0x2ce8eb,_0xf2d5a4['options']);return db['Campaign'][_0xaa71('0x4c')](_0x2ce8eb)[_0xaa71('0x22')](handleEntityNotFound(_0x276dc4,null))[_0xaa71('0x22')](function(_0x79c19b){if(_0x79c19b){var _0x53354c=_0x79c19b[_0xaa71('0x23')]({'plain':!![]});_0x53354c=qs['omit'](_0x53354c,['id','createdAt','updatedAt']);_0xf2d5a4[_0xaa71('0x47')]=_['omit'](_0xf2d5a4[_0xaa71('0x47')],['id','createdAt',_0xaa71('0x4f')]);return db['Campaign'][_0xaa71('0x46')](_[_0xaa71('0x3b')](_0x53354c,_0xf2d5a4['body']),{'include':_0xf2d5a4[_0xaa71('0x2d')][_0xaa71('0x3d')]?[{'all':!![]}]:undefined})[_0xaa71('0x22')](function(_0x11e699){var _0x28759b=_0xf2d5a4[_0xaa71('0x48')][_0xaa71('0x23')]({'plain':!![]});if(!_0x28759b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x28759b['role']===_0xaa71('0x48')){var _0x489138=_0x11e699[_0xaa71('0x23')]({'plain':!![]});var _0x5d7893='IvrCampaigns';return db[_0xaa71('0x4b')][_0xaa71('0x4c')]({'where':{'name':_0x5d7893,'userProfileId':_0x28759b[_0xaa71('0x50')]},'raw':!![]})['then'](function(_0x4f394a){if(_0x4f394a&&_0x4f394a['autoAssociation']===0x0){return db[_0xaa71('0x25')][_0xaa71('0x46')]({'name':_0x489138['name'],'resourceId':_0x489138['id'],'type':_0x4f394a[_0xaa71('0x26')],'sectionId':_0x4f394a['id']},{})[_0xaa71('0x22')](function(){return _0x11e699;});}else{return _0x11e699;}})['catch'](function(_0x571440){logger[_0xaa71('0x51')](_0xaa71('0x52'),_0x571440);throw _0x571440;});}return _0x11e699;});}})[_0xaa71('0x22')](respondWithResult(_0x276dc4,0xc9))['catch'](handleError(_0x276dc4,null));};exports[_0xaa71('0x20')]=function(_0x9923b2,_0x1c4863){if(_0x9923b2[_0xaa71('0x47')]['id']){delete _0x9923b2['body']['id'];}return db['Campaign'][_0xaa71('0x4c')]({'where':{'id':_0x9923b2['params']['id']}})['then'](handleEntityNotFound(_0x1c4863,null))[_0xaa71('0x22')](saveUpdates(_0x9923b2['body'],null))[_0xaa71('0x22')](respondWithResult(_0x1c4863,null))[_0xaa71('0x41')](handleError(_0x1c4863,null));};exports[_0xaa71('0x21')]=function(_0x2c765f,_0x3bc6ba){return db['Campaign'][_0xaa71('0x4c')]({'where':{'id':_0x2c765f[_0xaa71('0x43')]['id']}})[_0xaa71('0x22')](handleEntityNotFound(_0x3bc6ba,null))[_0xaa71('0x22')](removeEntity(_0x3bc6ba,null))['catch'](handleError(_0x3bc6ba,null));};exports[_0xaa71('0x53')]=function(_0x4d88f5,_0x5c6526,_0x2a65af){var _0x4aa21b={'raw':!![],'where':{}};var _0x47c094={};var _0x297cb4={'count':0x0,'rows':[]};return db[_0xaa71('0x28')][_0xaa71('0x54')]({'where':{'id':_0x4d88f5[_0xaa71('0x43')]['id']}})[_0xaa71('0x22')](handleEntityNotFound(_0x5c6526,null))[_0xaa71('0x22')](function(_0x248306){if(_0x248306){_0x47c094['model']=_[_0xaa71('0x2e')](db['CmHopper'][_0xaa71('0x44')]);_0x47c094[_0xaa71('0x2d')]=_[_0xaa71('0x2e')](_0x4d88f5[_0xaa71('0x2d')]);_0x47c094['filters']=_['intersection'](_0x47c094[_0xaa71('0x2b')],_0x47c094['query']);_0x4aa21b['attributes']=_[_0xaa71('0x45')](_0x47c094[_0xaa71('0x2b')],qs[_0xaa71('0x31')](_0x4d88f5[_0xaa71('0x2d')][_0xaa71('0x31')]));_0x4aa21b[_0xaa71('0x30')]=_0x4aa21b['attributes'][_0xaa71('0x32')]?_0x4aa21b['attributes']:_0x47c094[_0xaa71('0x2b')];if(!_0x4d88f5['query'][_0xaa71('0x33')](_0xaa71('0x34'))){_0x4aa21b[_0xaa71('0x19')]=qs[_0xaa71('0x19')](_0x4d88f5[_0xaa71('0x2d')][_0xaa71('0x19')]);_0x4aa21b[_0xaa71('0x17')]=qs[_0xaa71('0x17')](_0x4d88f5[_0xaa71('0x2d')][_0xaa71('0x17')]);}_0x4aa21b['order']=qs['sort'](_0x4d88f5[_0xaa71('0x2d')][_0xaa71('0x36')]);_0x4aa21b[_0xaa71('0x37')]=qs[_0xaa71('0x2f')](_['pick'](_0x4d88f5[_0xaa71('0x2d')],_0x47c094[_0xaa71('0x2f')]));_0x4aa21b['where'][_0xaa71('0x55')]=_0x248306['id'];if(_0x4d88f5[_0xaa71('0x2d')]['filter']){_0x4aa21b[_0xaa71('0x37')]=_['merge'](_0x4aa21b['where'],{'$or':_[_0xaa71('0x2c')](_0x4aa21b[_0xaa71('0x30')],function(_0x1a817c){var _0x52f736={};_0x52f736[_0x1a817c]={'$like':'%'+_0x4d88f5[_0xaa71('0x2d')]['filter']+'%'};return _0x52f736;})});}_0x4aa21b=_['merge']({},_0x4aa21b,_0x4d88f5[_0xaa71('0x3c')]);return db[_0xaa71('0x56')][_0xaa71('0x1a')]({'where':_0x4aa21b['where']})[_0xaa71('0x22')](function(_0x4ae275){_0x297cb4[_0xaa71('0x1a')]=_0x4ae275;if(_0x4d88f5['query'][_0xaa71('0x3d')]){_0x4aa21b[_0xaa71('0x3e')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x4aa21b);})[_0xaa71('0x22')](function(_0x3d68ac){_0x297cb4[_0xaa71('0x40')]=_0x3d68ac;return _0x297cb4;});}})[_0xaa71('0x22')](respondWithFilteredResult(_0x5c6526,_0x4aa21b))['catch'](handleError(_0x5c6526,null));};exports[_0xaa71('0x57')]=function(_0x51874e,_0x170f4f,_0x112cbd){var _0x801796={'raw':!![],'where':{}};var _0x3a00fa={};var _0x59e6b4={'count':0x0,'rows':[]};return db[_0xaa71('0x28')][_0xaa71('0x54')]({'where':{'id':_0x51874e['params']['id']}})[_0xaa71('0x22')](handleEntityNotFound(_0x170f4f,null))[_0xaa71('0x22')](function(_0x1116c2){if(_0x1116c2){_0x3a00fa[_0xaa71('0x2b')]=_[_0xaa71('0x2e')](db['CmHopperHistory']['rawAttributes']);_0x3a00fa[_0xaa71('0x2d')]=_[_0xaa71('0x2e')](_0x51874e['query']);_0x3a00fa[_0xaa71('0x2f')]=_['intersection'](_0x3a00fa[_0xaa71('0x2b')],_0x3a00fa['query']);_0x801796[_0xaa71('0x30')]=_['intersection'](_0x3a00fa[_0xaa71('0x2b')],qs[_0xaa71('0x31')](_0x51874e[_0xaa71('0x2d')][_0xaa71('0x31')]));_0x801796['attributes']=_0x801796['attributes'][_0xaa71('0x32')]?_0x801796[_0xaa71('0x30')]:_0x3a00fa[_0xaa71('0x2b')];if(!_0x51874e[_0xaa71('0x2d')][_0xaa71('0x33')]('nolimit')){_0x801796[_0xaa71('0x19')]=qs[_0xaa71('0x19')](_0x51874e[_0xaa71('0x2d')][_0xaa71('0x19')]);_0x801796[_0xaa71('0x17')]=qs['offset'](_0x51874e[_0xaa71('0x2d')][_0xaa71('0x17')]);}_0x801796[_0xaa71('0x35')]=qs['sort'](_0x51874e['query'][_0xaa71('0x36')]);_0x801796[_0xaa71('0x37')]=qs['filters'](_[_0xaa71('0x38')](_0x51874e[_0xaa71('0x2d')],_0x3a00fa[_0xaa71('0x2f')]));_0x801796['where'][_0xaa71('0x55')]=_0x1116c2['id'];if(_0x51874e[_0xaa71('0x2d')]['filter']){_0x801796['where']=_[_0xaa71('0x3b')](_0x801796[_0xaa71('0x37')],{'$or':_[_0xaa71('0x2c')](_0x801796['attributes'],function(_0x11c83a){var _0x1456a3={};_0x1456a3[_0x11c83a]={'$like':'%'+_0x51874e[_0xaa71('0x2d')]['filter']+'%'};return _0x1456a3;})});}_0x801796=_[_0xaa71('0x3b')]({},_0x801796,_0x51874e['options']);return db[_0xaa71('0x58')][_0xaa71('0x1a')]({'where':_0x801796[_0xaa71('0x37')]})[_0xaa71('0x22')](function(_0x2f0d85){_0x59e6b4['count']=_0x2f0d85;if(_0x51874e[_0xaa71('0x2d')][_0xaa71('0x3d')]){_0x801796['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0xaa71('0x3f')](_0x801796);})[_0xaa71('0x22')](function(_0x198a5c){_0x59e6b4['rows']=_0x198a5c;return _0x59e6b4;});}})[_0xaa71('0x22')](respondWithFilteredResult(_0x170f4f,_0x801796))[_0xaa71('0x41')](handleError(_0x170f4f,null));};exports['getHopperFinals']=function(_0x14d886,_0x171aff,_0x19d143){var _0x304761={'raw':!![],'where':{}};var _0x246bf0={};var _0x4a0227={'count':0x0,'rows':[]};return db[_0xaa71('0x28')][_0xaa71('0x54')]({'where':{'id':_0x14d886[_0xaa71('0x43')]['id']}})[_0xaa71('0x22')](handleEntityNotFound(_0x171aff,null))[_0xaa71('0x22')](function(_0x4c2d7c){if(_0x4c2d7c){_0x246bf0[_0xaa71('0x2b')]=_[_0xaa71('0x2e')](db[_0xaa71('0x59')][_0xaa71('0x44')]);_0x246bf0[_0xaa71('0x2d')]=_['keys'](_0x14d886[_0xaa71('0x2d')]);_0x246bf0[_0xaa71('0x2f')]=_['intersection'](_0x246bf0['model'],_0x246bf0[_0xaa71('0x2d')]);_0x304761['attributes']=_[_0xaa71('0x45')](_0x246bf0[_0xaa71('0x2b')],qs[_0xaa71('0x31')](_0x14d886[_0xaa71('0x2d')][_0xaa71('0x31')]));_0x304761['attributes']=_0x304761[_0xaa71('0x30')][_0xaa71('0x32')]?_0x304761[_0xaa71('0x30')]:_0x246bf0[_0xaa71('0x2b')];if(!_0x14d886['query'][_0xaa71('0x33')]('nolimit')){_0x304761[_0xaa71('0x19')]=qs[_0xaa71('0x19')](_0x14d886[_0xaa71('0x2d')]['limit']);_0x304761[_0xaa71('0x17')]=qs[_0xaa71('0x17')](_0x14d886[_0xaa71('0x2d')]['offset']);}_0x304761[_0xaa71('0x35')]=qs[_0xaa71('0x36')](_0x14d886['query'][_0xaa71('0x36')]);_0x304761[_0xaa71('0x37')]=qs['filters'](_['pick'](_0x14d886[_0xaa71('0x2d')],_0x246bf0[_0xaa71('0x2f')]));_0x304761[_0xaa71('0x37')]['CampaignId']=_0x4c2d7c['id'];if(_0x14d886[_0xaa71('0x2d')]['filter']){_0x304761[_0xaa71('0x37')]=_[_0xaa71('0x3b')](_0x304761['where'],{'$or':_['map'](_0x304761[_0xaa71('0x30')],function(_0x2dcb7c){var _0x3a3451={};_0x3a3451[_0x2dcb7c]={'$like':'%'+_0x14d886[_0xaa71('0x2d')]['filter']+'%'};return _0x3a3451;})});}_0x304761=_[_0xaa71('0x3b')]({},_0x304761,_0x14d886[_0xaa71('0x3c')]);return db[_0xaa71('0x59')]['count']({'where':_0x304761['where']})['then'](function(_0x2621eb){_0x4a0227[_0xaa71('0x1a')]=_0x2621eb;if(_0x14d886[_0xaa71('0x2d')]['includeAll']){_0x304761[_0xaa71('0x3e')]=[{'all':!![]}];}return db[_0xaa71('0x59')][_0xaa71('0x3f')](_0x304761);})[_0xaa71('0x22')](function(_0x3dfc6e){_0x4a0227['rows']=_0x3dfc6e;return _0x4a0227;});}})['then'](respondWithFilteredResult(_0x171aff,_0x304761))[_0xaa71('0x41')](handleError(_0x171aff,null));};exports['getHopperBlacks']=function(_0x330015,_0x22b10e,_0x53de7e){var _0x1afbdf={'raw':!![],'where':{}};var _0x1de17a={};var _0x258fc0={'count':0x0,'rows':[]};return db[_0xaa71('0x28')][_0xaa71('0x54')]({'where':{'id':_0x330015[_0xaa71('0x43')]['id']}})[_0xaa71('0x22')](handleEntityNotFound(_0x22b10e,null))[_0xaa71('0x22')](function(_0x33f9f5){if(_0x33f9f5){_0x1de17a[_0xaa71('0x2b')]=_['keys'](db[_0xaa71('0x5a')]['rawAttributes']);_0x1de17a[_0xaa71('0x2d')]=_['keys'](_0x330015[_0xaa71('0x2d')]);_0x1de17a[_0xaa71('0x2f')]=_[_0xaa71('0x45')](_0x1de17a['model'],_0x1de17a[_0xaa71('0x2d')]);_0x1afbdf[_0xaa71('0x30')]=_[_0xaa71('0x45')](_0x1de17a[_0xaa71('0x2b')],qs[_0xaa71('0x31')](_0x330015[_0xaa71('0x2d')][_0xaa71('0x31')]));_0x1afbdf[_0xaa71('0x30')]=_0x1afbdf[_0xaa71('0x30')][_0xaa71('0x32')]?_0x1afbdf[_0xaa71('0x30')]:_0x1de17a[_0xaa71('0x2b')];if(!_0x330015[_0xaa71('0x2d')][_0xaa71('0x33')]('nolimit')){_0x1afbdf['limit']=qs[_0xaa71('0x19')](_0x330015['query'][_0xaa71('0x19')]);_0x1afbdf[_0xaa71('0x17')]=qs[_0xaa71('0x17')](_0x330015[_0xaa71('0x2d')][_0xaa71('0x17')]);}_0x1afbdf['order']=qs[_0xaa71('0x36')](_0x330015[_0xaa71('0x2d')][_0xaa71('0x36')]);_0x1afbdf[_0xaa71('0x37')]=qs[_0xaa71('0x2f')](_[_0xaa71('0x38')](_0x330015[_0xaa71('0x2d')],_0x1de17a[_0xaa71('0x2f')]));_0x1afbdf['where']['CampaignId']=_0x33f9f5['id'];if(_0x330015['query'][_0xaa71('0x39')]){_0x1afbdf[_0xaa71('0x37')]=_['merge'](_0x1afbdf[_0xaa71('0x37')],{'$or':_[_0xaa71('0x2c')](_0x1afbdf['attributes'],function(_0xa9124){var _0x23415c={};_0x23415c[_0xa9124]={'$like':'%'+_0x330015[_0xaa71('0x2d')]['filter']+'%'};return _0x23415c;})});}_0x1afbdf=_[_0xaa71('0x3b')]({},_0x1afbdf,_0x330015[_0xaa71('0x3c')]);return db[_0xaa71('0x5a')]['count']({'where':_0x1afbdf[_0xaa71('0x37')]})[_0xaa71('0x22')](function(_0x4d94ae){_0x258fc0[_0xaa71('0x1a')]=_0x4d94ae;if(_0x330015[_0xaa71('0x2d')][_0xaa71('0x3d')]){_0x1afbdf[_0xaa71('0x3e')]=[{'all':!![]}];}return db[_0xaa71('0x5a')]['findAll'](_0x1afbdf);})[_0xaa71('0x22')](function(_0xe67601){_0x258fc0[_0xaa71('0x40')]=_0xe67601;return _0x258fc0;});}})[_0xaa71('0x22')](respondWithFilteredResult(_0x22b10e,_0x1afbdf))[_0xaa71('0x41')](handleError(_0x22b10e,null));};exports['getLists']=function(_0x323c93,_0x20c650,_0x6bd9ec){var _0x3ccabf={};var _0x396cb4={};var _0x50bb2e;var _0x2c51c4;return db['Campaign'][_0xaa71('0x54')]({'where':{'id':_0x323c93[_0xaa71('0x43')]['id']}})[_0xaa71('0x22')](handleEntityNotFound(_0x20c650,null))['then'](function(_0x12ac53){if(_0x12ac53){_0x50bb2e=_0x12ac53;_0x396cb4[_0xaa71('0x2b')]=_[_0xaa71('0x2e')](db[_0xaa71('0x5b')][_0xaa71('0x44')]);_0x396cb4[_0xaa71('0x2d')]=_[_0xaa71('0x2e')](_0x323c93[_0xaa71('0x2d')]);_0x396cb4[_0xaa71('0x2f')]=_[_0xaa71('0x45')](_0x396cb4[_0xaa71('0x2b')],_0x396cb4[_0xaa71('0x2d')]);_0x3ccabf['attributes']=_['intersection'](_0x396cb4[_0xaa71('0x2b')],qs[_0xaa71('0x31')](_0x323c93['query'][_0xaa71('0x31')]));_0x3ccabf[_0xaa71('0x30')]=_0x3ccabf['attributes']['length']?_0x3ccabf['attributes']:_0x396cb4[_0xaa71('0x2b')];_0x3ccabf['order']=qs[_0xaa71('0x36')](_0x323c93[_0xaa71('0x2d')]['sort']);_0x3ccabf[_0xaa71('0x37')]=qs[_0xaa71('0x2f')](_[_0xaa71('0x38')](_0x323c93[_0xaa71('0x2d')],_0x396cb4[_0xaa71('0x2f')]));if(_0x323c93['query'][_0xaa71('0x39')]){_0x3ccabf[_0xaa71('0x37')]=_[_0xaa71('0x3b')](_0x3ccabf['where'],{'$or':_[_0xaa71('0x2c')](_0x3ccabf[_0xaa71('0x30')],function(_0x57fe5a){var _0x36879d={};_0x36879d[_0x57fe5a]={'$like':'%'+_0x323c93[_0xaa71('0x2d')]['filter']+'%'};return _0x36879d;})});}_0x3ccabf=_[_0xaa71('0x3b')]({},_0x3ccabf,_0x323c93[_0xaa71('0x3c')]);return _0x50bb2e['getLists'](_0x3ccabf);}})[_0xaa71('0x22')](function(_0x20abfd){if(_0x20abfd){_0x2c51c4=_0x20abfd[_0xaa71('0x32')];if(!_0x323c93[_0xaa71('0x2d')][_0xaa71('0x33')](_0xaa71('0x34'))){_0x3ccabf[_0xaa71('0x19')]=qs[_0xaa71('0x19')](_0x323c93['query'][_0xaa71('0x19')]);_0x3ccabf[_0xaa71('0x17')]=qs[_0xaa71('0x17')](_0x323c93[_0xaa71('0x2d')][_0xaa71('0x17')]);}return _0x50bb2e[_0xaa71('0x5c')](_0x3ccabf);}})[_0xaa71('0x22')](function(_0x39a239){if(_0x39a239){return _0x39a239?{'count':_0x2c51c4,'rows':_0x39a239}:null;}})[_0xaa71('0x22')](respondWithResult(_0x20c650,null))[_0xaa71('0x41')](handleError(_0x20c650,null));};exports[_0xaa71('0x5d')]=function(_0x39fe02,_0x3cac49,_0x1be767){var _0x34db90,_0x287539;var _0x179591=[];var _0x320c44=moment()[_0xaa71('0x5e')](_0xaa71('0x5f'));return db[_0xaa71('0x28')][_0xaa71('0x4c')]({'where':{'id':_0x39fe02[_0xaa71('0x43')]['id']}})['then'](handleEntityNotFound(_0x3cac49,null))[_0xaa71('0x22')](function(_0x1b5461){if(_0x1b5461){_0x287539=_0x1b5461;return _0x1b5461[_0xaa71('0x5d')](_0x39fe02['body'][_0xaa71('0x60')],_[_0xaa71('0x61')](_0x39fe02[_0xaa71('0x47')],[_0xaa71('0x60'),'id'])||{});}return null;})[_0xaa71('0x62')](function(_0x4426b2){var _0x4d5b2a;var _0x297444;_0x34db90=_0x4426b2||[];var _0x51f592=[];if(_0x4426b2){for(var _0x45f189=0x0;_0x45f189<_0x4426b2[_0xaa71('0x32')];_0x45f189+=0x1){var _0x16963a=_0x4426b2[_0x45f189][_0xaa71('0x23')]({'plain':!![]});_0x287539['dialCheckDuplicateType']=_0x39fe02[_0xaa71('0x47')]['dialCheckDuplicateType']?_0x39fe02[_0xaa71('0x47')][_0xaa71('0x63')]:_0x287539[_0xaa71('0x63')];switch(_0x287539[_0xaa71('0x63')]){case _0xaa71('0x64'):_0x4d5b2a=squel[_0xaa71('0x65')]()[_0xaa71('0x66')](_0xaa71('0x67'))[_0xaa71('0x68')]([_0xaa71('0x69'),_0xaa71('0x6a'),_0xaa71('0x6b'),_0xaa71('0x6c'),_0xaa71('0x55'),_0xaa71('0x6d'),_0xaa71('0x4f')],squel[_0xaa71('0x6e')]()['field'](_0xaa71('0x69'),_0xaa71('0x69'))[_0xaa71('0x6f')](_0xaa71('0x70'),_0xaa71('0x6a'))['field']('id',_0xaa71('0x6b'))[_0xaa71('0x6f')](_0x16963a[_0xaa71('0x71')][_0xaa71('0x72')](),'ListId')['field'](_0x39fe02[_0xaa71('0x43')]['id'][_0xaa71('0x72')](),'CampaignId')[_0xaa71('0x6f')]('\x27'+_0x320c44+'\x27',_0xaa71('0x6d'))[_0xaa71('0x6f')]('\x27'+_0x320c44+'\x27',_0xaa71('0x4f'))[_0xaa71('0x73')](_0xaa71('0x74'))[_0xaa71('0x37')]('deletedAt\x20IS\x20NULL')[_0xaa71('0x37')](_0xaa71('0x75'),_0x16963a[_0xaa71('0x71')][_0xaa71('0x72')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xaa71('0x37')](_0xaa71('0x76'),squel['select']()[_0xaa71('0x6f')](_0xaa71('0x77'))[_0xaa71('0x73')](_0xaa71('0x78'))[_0xaa71('0x37')](_0xaa71('0x79'),_0x39fe02[_0xaa71('0x43')]['id'][_0xaa71('0x72')]()))[_0xaa71('0x37')](_0xaa71('0x76'),squel[_0xaa71('0x6e')]()['field']('COALESCE(phone,\x27\x27)')['from'](_0xaa71('0x67'))[_0xaa71('0x37')](_0xaa71('0x79'),_0x39fe02[_0xaa71('0x43')]['id'][_0xaa71('0x72')]())))[_0xaa71('0x72')]();break;case'onlyIfOpen':_0x4d5b2a=squel[_0xaa71('0x65')]()[_0xaa71('0x66')]('cm_hopper')[_0xaa71('0x68')]([_0xaa71('0x69'),_0xaa71('0x6a'),_0xaa71('0x6b'),_0xaa71('0x6c'),_0xaa71('0x55'),_0xaa71('0x6d'),_0xaa71('0x4f')],squel[_0xaa71('0x6e')]()[_0xaa71('0x6f')]('phone','phone')['field'](_0xaa71('0x70'),_0xaa71('0x6a'))[_0xaa71('0x6f')]('id',_0xaa71('0x6b'))['field'](_0x16963a[_0xaa71('0x71')][_0xaa71('0x72')](),'ListId')[_0xaa71('0x6f')](_0x39fe02[_0xaa71('0x43')]['id'][_0xaa71('0x72')](),_0xaa71('0x55'))[_0xaa71('0x6f')]('\x27'+_0x320c44+'\x27',_0xaa71('0x6d'))[_0xaa71('0x6f')]('\x27'+_0x320c44+'\x27',_0xaa71('0x4f'))[_0xaa71('0x73')](_0xaa71('0x74'))[_0xaa71('0x37')](_0xaa71('0x7a'))[_0xaa71('0x37')](_0xaa71('0x75'),_0x16963a['CmListId'][_0xaa71('0x72')]())['where'](_0xaa71('0x7b'))[_0xaa71('0x37')]('phone\x20NOT\x20IN\x20(?)',squel[_0xaa71('0x6e')]()[_0xaa71('0x6f')]('COALESCE(phone,\x27\x27)')[_0xaa71('0x73')](_0xaa71('0x67'))[_0xaa71('0x37')](_0xaa71('0x79'),_0x39fe02[_0xaa71('0x43')]['id']['toString']())))[_0xaa71('0x72')]();break;default:_0x4d5b2a=squel[_0xaa71('0x65')]()[_0xaa71('0x66')](_0xaa71('0x67'))['fromQuery']([_0xaa71('0x69'),_0xaa71('0x6a'),_0xaa71('0x6b'),'ListId',_0xaa71('0x55'),'createdAt',_0xaa71('0x4f')],squel[_0xaa71('0x6e')]()[_0xaa71('0x6f')](_0xaa71('0x69'),_0xaa71('0x69'))[_0xaa71('0x6f')](_0xaa71('0x70'),_0xaa71('0x6a'))['field']('id',_0xaa71('0x6b'))[_0xaa71('0x6f')](_0x16963a['CmListId']['toString'](),_0xaa71('0x6c'))['field'](_0x39fe02[_0xaa71('0x43')]['id'][_0xaa71('0x72')](),_0xaa71('0x55'))[_0xaa71('0x6f')]('\x27'+_0x320c44+'\x27',_0xaa71('0x6d'))[_0xaa71('0x6f')]('\x27'+_0x320c44+'\x27',_0xaa71('0x4f'))[_0xaa71('0x73')](_0xaa71('0x74'))[_0xaa71('0x37')](_0xaa71('0x7a'))[_0xaa71('0x37')]('ListId\x20=\x20?',_0x16963a[_0xaa71('0x71')][_0xaa71('0x72')]())[_0xaa71('0x37')](_0xaa71('0x7b')))[_0xaa71('0x72')]();}_0x297444=squel[_0xaa71('0x65')]()[_0xaa71('0x66')](_0xaa71('0x7c'))[_0xaa71('0x68')]([_0xaa71('0x7d'),_0xaa71('0x6a'),'phone',_0xaa71('0x7e'),_0xaa71('0x6d'),_0xaa71('0x4f')],squel[_0xaa71('0x6e')]()[_0xaa71('0x6f')](_0xaa71('0x7f'),'id')['field'](_0xaa71('0x70'),_0xaa71('0x6a'))[_0xaa71('0x6f')](_0xaa71('0x80'),'phone')[_0xaa71('0x6f')]('ci.OrderBY',_0xaa71('0x7e'))[_0xaa71('0x6f')]('\x27'+_0x320c44+'\x27',_0xaa71('0x6d'))['field']('\x27'+_0x320c44+'\x27',_0xaa71('0x4f'))[_0xaa71('0x73')](_0xaa71('0x81'),'ci')[_0xaa71('0x82')](_0xaa71('0x67'),'h',_0xaa71('0x83'))[_0xaa71('0x37')](_0xaa71('0x84'),_0x16963a[_0xaa71('0x71')][_0xaa71('0x72')]())[_0xaa71('0x37')](_0xaa71('0x85'),_0x39fe02[_0xaa71('0x43')]['id']['toString']())[_0xaa71('0x37')](_0xaa71('0x86'),_0x320c44))[_0xaa71('0x72')]();_0x51f592[_0xaa71('0x87')](db[_0xaa71('0x88')][_0xaa71('0x2d')](_0x4d5b2a));_0x179591['push'](db[_0xaa71('0x88')][_0xaa71('0x2d')](_0x297444));}return BPromise[_0xaa71('0x89')](_0x51f592);}})[_0xaa71('0x22')](function(){return BPromise[_0xaa71('0x89')](_0x179591);})[_0xaa71('0x22')](function(){return _0x34db90;})[_0xaa71('0x22')](respondWithResult(_0x3cac49,null))[_0xaa71('0x41')](handleError(_0x3cac49,null));};exports[_0xaa71('0x8a')]=function(_0x1238ab,_0x1ff11e,_0x75837a){return db['Campaign'][_0xaa71('0x4c')]({'where':{'id':_0x1238ab[_0xaa71('0x43')]['id']}})[_0xaa71('0x22')](handleEntityNotFound(_0x1ff11e,null))[_0xaa71('0x22')](function(_0x5e1ce2){if(_0x5e1ce2){return _0x5e1ce2[_0xaa71('0x8a')](_0x1238ab[_0xaa71('0x2d')]['ids']);}})['then'](function(_0x576b0b){if(_0x576b0b){return db[_0xaa71('0x56')]['destroy']({'where':{'ListId':_0x1238ab[_0xaa71('0x2d')][_0xaa71('0x60')],'CampaignId':_0x1238ab['params']['id']}})[_0xaa71('0x22')](function(){return _0x576b0b;});}})['then'](respondWithStatusCode(_0x1ff11e,null))[_0xaa71('0x41')](handleError(_0x1ff11e,null));};exports[_0xaa71('0x8b')]=function(_0x44948b,_0x555ae1,_0x4001c6){var _0x48a319={};var _0x26eed9={};var _0x11f277;var _0x15edda;return db[_0xaa71('0x28')][_0xaa71('0x54')]({'where':{'id':_0x44948b[_0xaa71('0x43')]['id']}})['then'](handleEntityNotFound(_0x555ae1,null))['then'](function(_0x4842ca){if(_0x4842ca){_0x11f277=_0x4842ca;_0x26eed9['model']=_[_0xaa71('0x2e')](db['CmList'][_0xaa71('0x44')]);_0x26eed9[_0xaa71('0x2d')]=_[_0xaa71('0x2e')](_0x44948b[_0xaa71('0x2d')]);_0x26eed9[_0xaa71('0x2f')]=_['intersection'](_0x26eed9['model'],_0x26eed9[_0xaa71('0x2d')]);_0x48a319[_0xaa71('0x30')]=_[_0xaa71('0x45')](_0x26eed9[_0xaa71('0x2b')],qs[_0xaa71('0x31')](_0x44948b[_0xaa71('0x2d')][_0xaa71('0x31')]));_0x48a319[_0xaa71('0x30')]=_0x48a319[_0xaa71('0x30')][_0xaa71('0x32')]?_0x48a319['attributes']:_0x26eed9[_0xaa71('0x2b')];_0x48a319[_0xaa71('0x35')]=qs[_0xaa71('0x36')](_0x44948b[_0xaa71('0x2d')][_0xaa71('0x36')]);_0x48a319[_0xaa71('0x37')]=qs['filters'](_['pick'](_0x44948b['query'],_0x26eed9[_0xaa71('0x2f')]));if(_0x44948b['query'][_0xaa71('0x39')]){_0x48a319[_0xaa71('0x37')]=_[_0xaa71('0x3b')](_0x48a319[_0xaa71('0x37')],{'$or':_[_0xaa71('0x2c')](_0x48a319[_0xaa71('0x30')],function(_0x4fecd6){var _0x3c9bc3={};_0x3c9bc3[_0x4fecd6]={'$like':'%'+_0x44948b['query'][_0xaa71('0x39')]+'%'};return _0x3c9bc3;})});}_0x48a319=_[_0xaa71('0x3b')]({},_0x48a319,_0x44948b[_0xaa71('0x3c')]);return _0x11f277[_0xaa71('0x8b')](_0x48a319);}})[_0xaa71('0x22')](function(_0x234035){if(_0x234035){_0x15edda=_0x234035[_0xaa71('0x32')];if(!_0x44948b['query'][_0xaa71('0x33')](_0xaa71('0x34'))){_0x48a319[_0xaa71('0x19')]=qs[_0xaa71('0x19')](_0x44948b[_0xaa71('0x2d')][_0xaa71('0x19')]);_0x48a319[_0xaa71('0x17')]=qs[_0xaa71('0x17')](_0x44948b[_0xaa71('0x2d')][_0xaa71('0x17')]);}return _0x11f277[_0xaa71('0x8b')](_0x48a319);}})[_0xaa71('0x22')](function(_0x309fa5){if(_0x309fa5){return _0x309fa5?{'count':_0x15edda,'rows':_0x309fa5}:null;}})['then'](respondWithResult(_0x555ae1,null))[_0xaa71('0x41')](handleError(_0x555ae1,null));};exports[_0xaa71('0x8c')]=function(_0x5ef5f0,_0x5c7be9,_0x596e82){var _0x370179,_0x3a93c9;var _0x462739=[];var _0x1ac7de=moment()[_0xaa71('0x5e')](_0xaa71('0x5f'));return db[_0xaa71('0x28')]['find']({'where':{'id':_0x5ef5f0[_0xaa71('0x43')]['id']}})[_0xaa71('0x22')](handleEntityNotFound(_0x5c7be9,null))['then'](function(_0x24dacf){if(_0x24dacf){_0x3a93c9=_0x24dacf;return _0x24dacf['addBlackLists'](_0x5ef5f0['body'][_0xaa71('0x60')],_['omit'](_0x5ef5f0['body'],[_0xaa71('0x60'),'id'])||{});}return null;})[_0xaa71('0x62')](function(_0x5df96d){var _0x5d9016;var _0x5ab837;_0x370179=_0x5df96d||[];var _0x574fb1=[];if(_0x5df96d){for(var _0xaf211e=0x0;_0xaf211e<_0x5df96d['length'];_0xaf211e+=0x1){var _0x25d7a2=_0x5df96d[_0xaf211e]['get']({'plain':!![]});_0x5d9016=squel[_0xaa71('0x65')]()[_0xaa71('0x66')]('cm_hopper_black')['fromQuery']([_0xaa71('0x69'),_0xaa71('0x6b'),_0xaa71('0x6c'),'CampaignId',_0xaa71('0x6d'),_0xaa71('0x4f')],squel[_0xaa71('0x6e')]()['field'](_0xaa71('0x69'),_0xaa71('0x69'))[_0xaa71('0x6f')]('id',_0xaa71('0x6b'))[_0xaa71('0x6f')](_0x25d7a2[_0xaa71('0x71')]['toString'](),'ListId')[_0xaa71('0x6f')](_0x5ef5f0[_0xaa71('0x43')]['id'][_0xaa71('0x72')](),'CampaignId')['field'](_0xaa71('0x70'),_0xaa71('0x6d'))['field']('NOW()',_0xaa71('0x4f'))['from']('cm_contacts')[_0xaa71('0x37')](_0xaa71('0x7a'))[_0xaa71('0x37')](_0xaa71('0x75'),_0x25d7a2[_0xaa71('0x71')]['toString']())[_0xaa71('0x37')](_0xaa71('0x7b')))[_0xaa71('0x72')]();_0x574fb1[_0xaa71('0x87')](db[_0xaa71('0x88')][_0xaa71('0x2d')](_0x5d9016));}return BPromise[_0xaa71('0x89')](_0x574fb1);}})[_0xaa71('0x22')](function(){return _0x370179;})['then'](respondWithResult(_0x5c7be9,null))[_0xaa71('0x41')](handleError(_0x5c7be9,null));};exports['removeBlackLists']=function(_0x37c255,_0x4e54de,_0xb97425){return db[_0xaa71('0x28')][_0xaa71('0x4c')]({'where':{'id':_0x37c255[_0xaa71('0x43')]['id']}})['then'](handleEntityNotFound(_0x4e54de,null))[_0xaa71('0x22')](function(_0x47d320){if(_0x47d320){return _0x47d320[_0xaa71('0x8d')](_0x37c255[_0xaa71('0x2d')][_0xaa71('0x60')]);}})[_0xaa71('0x22')](function(_0x1bfdbc){if(_0x1bfdbc){return db[_0xaa71('0x5a')][_0xaa71('0x21')]({'where':{'ListId':_0x37c255['query'][_0xaa71('0x60')],'CampaignId':_0x37c255[_0xaa71('0x43')]['id']}})[_0xaa71('0x22')](function(){return _0x1bfdbc;});}})[_0xaa71('0x22')](respondWithStatusCode(_0x4e54de,null))[_0xaa71('0x41')](handleError(_0x4e54de,null));}; \ No newline at end of file +var _0x2c1b=['cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','insert','into','NOW()','cm_hopper_additional_phones','cmHopperId','h.id','OrderBy','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset','count','limit','set','apply','reject','update','then','destroy','IvrCampaigns','end','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','intersection','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','UserProfileResource','clone','createdAt','updatedAt','body','role','autoAssociation','error','getHoppers','findOne','nolimit','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','omit','spread','dialCheckDuplicateType','always','fromQuery','phone','scheduledAt','ContactId','select','field','CmListId','toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)'];(function(_0x25e154,_0x2086d7){var _0x531b8f=function(_0x40faeb){while(--_0x40faeb){_0x25e154['push'](_0x25e154['shift']());}};_0x531b8f(++_0x2086d7);}(_0x2c1b,0xb0));var _0xb2c1=function(_0x12ca5f,_0x223d98){_0x12ca5f=_0x12ca5f-0x0;var _0xfc3ae9=_0x2c1b[_0x12ca5f];return _0xfc3ae9;};'use strict';var emlformat=require(_0xb2c1('0x0'));var rimraf=require(_0xb2c1('0x1'));var zipdir=require(_0xb2c1('0x2'));var jsonpatch=require(_0xb2c1('0x3'));var rp=require(_0xb2c1('0x4'));var moment=require(_0xb2c1('0x5'));var BPromise=require(_0xb2c1('0x6'));var Mustache=require('mustache');var util=require(_0xb2c1('0x7'));var path=require(_0xb2c1('0x8'));var sox=require(_0xb2c1('0x9'));var csv=require(_0xb2c1('0xa'));var ejs=require(_0xb2c1('0xb'));var fs=require('fs');var fs_extra=require(_0xb2c1('0xc'));var _=require(_0xb2c1('0xd'));var squel=require(_0xb2c1('0xe'));var crypto=require(_0xb2c1('0xf'));var jsforce=require(_0xb2c1('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb2c1('0x11'));var Papa=require(_0xb2c1('0x12'));var Redis=require(_0xb2c1('0x13'));var authService=require(_0xb2c1('0x14'));var qs=require(_0xb2c1('0x15'));var as=require(_0xb2c1('0x16'));var hardwareService=require(_0xb2c1('0x17'));var logger=require(_0xb2c1('0x18'))('api');var utils=require(_0xb2c1('0x19'));var config=require(_0xb2c1('0x1a'));var licenseUtil=require(_0xb2c1('0x1b'));var db=require(_0xb2c1('0x1c'))['db'];function respondWithStatusCode(_0x218998,_0x4cc09b){_0x4cc09b=_0x4cc09b||0xcc;return function(_0x404159){if(_0x404159){return _0x218998[_0xb2c1('0x1d')](_0x4cc09b);}return _0x218998[_0xb2c1('0x1e')](_0x4cc09b)['end']();};}function respondWithResult(_0x3c4313,_0x4470e5){_0x4470e5=_0x4470e5||0xc8;return function(_0x22a2b3){if(_0x22a2b3){return _0x3c4313[_0xb2c1('0x1e')](_0x4470e5)[_0xb2c1('0x1f')](_0x22a2b3);}};}function respondWithFilteredResult(_0x47571f,_0x2b4d8f){return function(_0x46d620){if(_0x46d620){var _0x1e26f3=typeof _0x2b4d8f['offset']===_0xb2c1('0x20')&&typeof _0x2b4d8f['limit']==='undefined';var _0x59268e=_0x46d620['count'];var _0x486411=_0x1e26f3?0x0:_0x2b4d8f[_0xb2c1('0x21')];var _0x16c1ed=_0x1e26f3?_0x46d620[_0xb2c1('0x22')]:_0x2b4d8f[_0xb2c1('0x21')]+_0x2b4d8f[_0xb2c1('0x23')];var _0x165875;if(_0x16c1ed>=_0x59268e){_0x16c1ed=_0x59268e;_0x165875=0xc8;}else{_0x165875=0xce;}_0x47571f[_0xb2c1('0x1e')](_0x165875);return _0x47571f[_0xb2c1('0x24')]('Content-Range',_0x486411+'-'+_0x16c1ed+'/'+_0x59268e)[_0xb2c1('0x1f')](_0x46d620);}return null;};}function patchUpdates(_0x42f519){return function(_0x2af0fa){try{jsonpatch[_0xb2c1('0x25')](_0x2af0fa,_0x42f519,!![]);}catch(_0x49d87c){return BPromise[_0xb2c1('0x26')](_0x49d87c);}return _0x2af0fa['save']();};}function saveUpdates(_0x27d5bf,_0x31ae39){return function(_0x2f6c51){if(_0x2f6c51){return _0x2f6c51[_0xb2c1('0x27')](_0x27d5bf)[_0xb2c1('0x28')](function(_0x270fb2){return _0x270fb2;});}return null;};}function removeEntity(_0x4af0bd,_0xc3f671){return function(_0x40dac3){if(_0x40dac3){return _0x40dac3[_0xb2c1('0x29')]()[_0xb2c1('0x28')](function(){var _0x1cdadf=_0x40dac3['get']({'plain':!![]});var _0x48f58c=_0xb2c1('0x2a');return db['UserProfileResource'][_0xb2c1('0x29')]({'where':{'type':_0x48f58c,'resourceId':_0x1cdadf['id']}})['then'](function(){return _0x40dac3;});})[_0xb2c1('0x28')](function(){_0x4af0bd[_0xb2c1('0x1e')](0xcc)[_0xb2c1('0x2b')]();});}};}function handleEntityNotFound(_0x17153b,_0x306b17){return function(_0x1b459c){if(!_0x1b459c){_0x17153b[_0xb2c1('0x1d')](0x194);}return _0x1b459c;};}function handleError(_0x5e9108,_0x5b7808){_0x5b7808=_0x5b7808||0x1f4;return function(_0x2d9a64){logger['error'](_0x2d9a64[_0xb2c1('0x2c')]);if(_0x2d9a64[_0xb2c1('0x2d')]){delete _0x2d9a64['name'];}_0x5e9108[_0xb2c1('0x1e')](_0x5b7808)[_0xb2c1('0x2e')](_0x2d9a64);};}exports[_0xb2c1('0x2f')]=function(_0x28c136,_0x1cac02){var _0x1feb6a={},_0x5a71ab={},_0x3b9d67={'count':0x0,'rows':[]};var _0x145e94=_[_0xb2c1('0x30')](db[_0xb2c1('0x31')][_0xb2c1('0x32')],function(_0x445372){return{'name':_0x445372[_0xb2c1('0x33')],'type':_0x445372[_0xb2c1('0x34')][_0xb2c1('0x35')]};});_0x5a71ab[_0xb2c1('0x36')]=_[_0xb2c1('0x30')](_0x145e94,_0xb2c1('0x2d'));_0x5a71ab['query']=_[_0xb2c1('0x37')](_0x28c136[_0xb2c1('0x38')]);_0x5a71ab[_0xb2c1('0x39')]=_['intersection'](_0x5a71ab[_0xb2c1('0x36')],_0x5a71ab[_0xb2c1('0x38')]);_0x1feb6a[_0xb2c1('0x3a')]=_['intersection'](_0x5a71ab[_0xb2c1('0x36')],qs[_0xb2c1('0x3b')](_0x28c136[_0xb2c1('0x38')][_0xb2c1('0x3b')]));_0x1feb6a[_0xb2c1('0x3a')]=_0x1feb6a['attributes'][_0xb2c1('0x3c')]?_0x1feb6a[_0xb2c1('0x3a')]:_0x5a71ab['model'];if(!_0x28c136[_0xb2c1('0x38')][_0xb2c1('0x3d')]('nolimit')){_0x1feb6a[_0xb2c1('0x23')]=qs[_0xb2c1('0x23')](_0x28c136[_0xb2c1('0x38')][_0xb2c1('0x23')]);_0x1feb6a['offset']=qs[_0xb2c1('0x21')](_0x28c136[_0xb2c1('0x38')][_0xb2c1('0x21')]);}_0x1feb6a[_0xb2c1('0x3e')]=qs['sort'](_0x28c136[_0xb2c1('0x38')][_0xb2c1('0x3f')]);_0x1feb6a[_0xb2c1('0x40')]=qs[_0xb2c1('0x39')](_[_0xb2c1('0x41')](_0x28c136['query'],_0x5a71ab[_0xb2c1('0x39')]),_0x145e94);if(_0x28c136['query'][_0xb2c1('0x42')]){_0x1feb6a[_0xb2c1('0x40')]=_[_0xb2c1('0x43')](_0x1feb6a[_0xb2c1('0x40')],{'$or':_[_0xb2c1('0x30')](_0x145e94,function(_0x24dcbc){if(_0x24dcbc['type']!==_0xb2c1('0x44')){var _0x59288c={};_0x59288c[_0x24dcbc[_0xb2c1('0x2d')]]={'$like':'%'+_0x28c136[_0xb2c1('0x38')][_0xb2c1('0x42')]+'%'};return _0x59288c;}})});}_0x1feb6a=_[_0xb2c1('0x43')]({},_0x1feb6a,_0x28c136[_0xb2c1('0x45')]);var _0x44e15e={'where':_0x1feb6a[_0xb2c1('0x40')]};return db[_0xb2c1('0x31')][_0xb2c1('0x22')](_0x44e15e)[_0xb2c1('0x28')](function(_0x305d17){_0x3b9d67[_0xb2c1('0x22')]=_0x305d17;if(_0x28c136['query'][_0xb2c1('0x46')]){_0x1feb6a[_0xb2c1('0x47')]=[{'all':!![]}];}return db['Campaign'][_0xb2c1('0x48')](_0x1feb6a);})[_0xb2c1('0x28')](function(_0x2e546e){_0x3b9d67[_0xb2c1('0x49')]=_0x2e546e;return _0x3b9d67;})[_0xb2c1('0x28')](respondWithFilteredResult(_0x1cac02,_0x1feb6a))['catch'](handleError(_0x1cac02,null));};exports['show']=function(_0xdd775d,_0x2e7d7b){var _0x419f48={'raw':![],'where':{'id':_0xdd775d[_0xb2c1('0x4a')]['id']}},_0x57c76c={};_0x57c76c['model']=_[_0xb2c1('0x37')](db[_0xb2c1('0x31')]['rawAttributes']);_0x57c76c[_0xb2c1('0x38')]=_['keys'](_0xdd775d['query']);_0x57c76c[_0xb2c1('0x39')]=_[_0xb2c1('0x4b')](_0x57c76c[_0xb2c1('0x36')],_0x57c76c[_0xb2c1('0x38')]);_0x419f48[_0xb2c1('0x3a')]=_[_0xb2c1('0x4b')](_0x57c76c[_0xb2c1('0x36')],qs[_0xb2c1('0x3b')](_0xdd775d[_0xb2c1('0x38')][_0xb2c1('0x3b')]));_0x419f48['attributes']=_0x419f48[_0xb2c1('0x3a')][_0xb2c1('0x3c')]?_0x419f48[_0xb2c1('0x3a')]:_0x57c76c['model'];if(_0xdd775d[_0xb2c1('0x38')]['includeAll']){_0x419f48[_0xb2c1('0x47')]=[{'all':!![]}];}_0x419f48=_['merge']({},_0x419f48,_0xdd775d[_0xb2c1('0x45')]);return db[_0xb2c1('0x31')][_0xb2c1('0x4c')](_0x419f48)[_0xb2c1('0x28')](handleEntityNotFound(_0x2e7d7b,null))[_0xb2c1('0x28')](respondWithResult(_0x2e7d7b,null))[_0xb2c1('0x4d')](handleError(_0x2e7d7b,null));};exports['create']=function(_0x486011,_0xf730c3){return db['Campaign'][_0xb2c1('0x4e')](_0x486011['body'],{})['then'](function(_0x38539a){var _0x413518=_0x486011[_0xb2c1('0x4f')][_0xb2c1('0x50')]({'plain':!![]});if(!_0x413518)throw new Error(_0xb2c1('0x51'));if(_0x413518['role']===_0xb2c1('0x4f')){var _0x4c3929=_0x38539a[_0xb2c1('0x50')]({'plain':!![]});var _0x2d4c27=_0xb2c1('0x2a');return db[_0xb2c1('0x52')][_0xb2c1('0x4c')]({'where':{'name':_0x2d4c27,'userProfileId':_0x413518['userProfileId']},'raw':!![]})['then'](function(_0x2cb41a){if(_0x2cb41a&&_0x2cb41a['autoAssociation']===0x0){return db[_0xb2c1('0x53')]['create']({'name':_0x4c3929[_0xb2c1('0x2d')],'resourceId':_0x4c3929['id'],'type':_0x2cb41a[_0xb2c1('0x2d')],'sectionId':_0x2cb41a['id']},{})[_0xb2c1('0x28')](function(){return _0x38539a;});}else{return _0x38539a;}})[_0xb2c1('0x4d')](function(_0x99ec3d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x99ec3d);throw _0x99ec3d;});}return _0x38539a;})[_0xb2c1('0x28')](respondWithResult(_0xf730c3,0xc9))[_0xb2c1('0x4d')](handleError(_0xf730c3,null));};exports[_0xb2c1('0x54')]=function(_0x5e81e0,_0x517e92){var _0x4384a7={'where':{'id':_0x5e81e0[_0xb2c1('0x4a')]['id']}},_0x37e093={};_0x37e093[_0xb2c1('0x36')]=_[_0xb2c1('0x37')](db['Campaign'][_0xb2c1('0x32')]);_0x4384a7['attributes']=_['intersection'](_0x37e093[_0xb2c1('0x36')],qs[_0xb2c1('0x3b')](_0x5e81e0['query'][_0xb2c1('0x3b')]));_0x4384a7[_0xb2c1('0x3a')]=_0x4384a7[_0xb2c1('0x3a')]['length']?_0x4384a7[_0xb2c1('0x3a')]:_0x37e093['model'];if(_0x5e81e0[_0xb2c1('0x38')][_0xb2c1('0x46')]){_0x4384a7[_0xb2c1('0x47')]=[{'all':!![]}];}_0x4384a7=_[_0xb2c1('0x43')]({},_0x4384a7,_0x5e81e0[_0xb2c1('0x45')]);return db[_0xb2c1('0x31')][_0xb2c1('0x4c')](_0x4384a7)[_0xb2c1('0x28')](handleEntityNotFound(_0x517e92,null))[_0xb2c1('0x28')](function(_0x4dfb8f){if(_0x4dfb8f){var _0x904c1b=_0x4dfb8f[_0xb2c1('0x50')]({'plain':!![]});_0x904c1b=qs['omit'](_0x904c1b,['id',_0xb2c1('0x55'),_0xb2c1('0x56')]);_0x5e81e0['body']=_['omit'](_0x5e81e0[_0xb2c1('0x57')],['id',_0xb2c1('0x55'),'updatedAt']);return db[_0xb2c1('0x31')][_0xb2c1('0x4e')](_[_0xb2c1('0x43')](_0x904c1b,_0x5e81e0['body']),{'include':_0x5e81e0[_0xb2c1('0x38')]['includeAll']?[{'all':!![]}]:undefined})[_0xb2c1('0x28')](function(_0x379a2d){var _0x256c3a=_0x5e81e0[_0xb2c1('0x4f')][_0xb2c1('0x50')]({'plain':!![]});if(!_0x256c3a)throw new Error(_0xb2c1('0x51'));if(_0x256c3a[_0xb2c1('0x58')]===_0xb2c1('0x4f')){var _0x259cf5=_0x379a2d['get']({'plain':!![]});var _0x39985e=_0xb2c1('0x2a');return db['UserProfileSection']['find']({'where':{'name':_0x39985e,'userProfileId':_0x256c3a['userProfileId']},'raw':!![]})[_0xb2c1('0x28')](function(_0x4130e2){if(_0x4130e2&&_0x4130e2[_0xb2c1('0x59')]===0x0){return db[_0xb2c1('0x53')][_0xb2c1('0x4e')]({'name':_0x259cf5[_0xb2c1('0x2d')],'resourceId':_0x259cf5['id'],'type':_0x4130e2[_0xb2c1('0x2d')],'sectionId':_0x4130e2['id']},{})[_0xb2c1('0x28')](function(){return _0x379a2d;});}else{return _0x379a2d;}})[_0xb2c1('0x4d')](function(_0x204baf){logger[_0xb2c1('0x5a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x204baf);throw _0x204baf;});}return _0x379a2d;});}})[_0xb2c1('0x28')](respondWithResult(_0x517e92,0xc9))[_0xb2c1('0x4d')](handleError(_0x517e92,null));};exports[_0xb2c1('0x27')]=function(_0x47c57d,_0x2693be){if(_0x47c57d[_0xb2c1('0x57')]['id']){delete _0x47c57d['body']['id'];}return db[_0xb2c1('0x31')][_0xb2c1('0x4c')]({'where':{'id':_0x47c57d[_0xb2c1('0x4a')]['id']}})[_0xb2c1('0x28')](handleEntityNotFound(_0x2693be,null))[_0xb2c1('0x28')](saveUpdates(_0x47c57d[_0xb2c1('0x57')],null))[_0xb2c1('0x28')](respondWithResult(_0x2693be,null))[_0xb2c1('0x4d')](handleError(_0x2693be,null));};exports['destroy']=function(_0xb31fd8,_0x30eef9){return db[_0xb2c1('0x31')][_0xb2c1('0x4c')]({'where':{'id':_0xb31fd8[_0xb2c1('0x4a')]['id']}})[_0xb2c1('0x28')](handleEntityNotFound(_0x30eef9,null))[_0xb2c1('0x28')](removeEntity(_0x30eef9,null))[_0xb2c1('0x4d')](handleError(_0x30eef9,null));};exports[_0xb2c1('0x5b')]=function(_0x523224,_0x45530f,_0x4b1bd2){var _0x37dd50={'raw':!![],'where':{}};var _0x357156={};var _0x4054d8={'count':0x0,'rows':[]};return db[_0xb2c1('0x31')][_0xb2c1('0x5c')]({'where':{'id':_0x523224[_0xb2c1('0x4a')]['id']}})[_0xb2c1('0x28')](handleEntityNotFound(_0x45530f,null))['then'](function(_0x1517fa){if(_0x1517fa){_0x357156[_0xb2c1('0x36')]=_[_0xb2c1('0x37')](db['CmHopper']['rawAttributes']);_0x357156[_0xb2c1('0x38')]=_[_0xb2c1('0x37')](_0x523224[_0xb2c1('0x38')]);_0x357156[_0xb2c1('0x39')]=_[_0xb2c1('0x4b')](_0x357156[_0xb2c1('0x36')],_0x357156[_0xb2c1('0x38')]);_0x37dd50[_0xb2c1('0x3a')]=_['intersection'](_0x357156[_0xb2c1('0x36')],qs[_0xb2c1('0x3b')](_0x523224['query']['fields']));_0x37dd50[_0xb2c1('0x3a')]=_0x37dd50[_0xb2c1('0x3a')][_0xb2c1('0x3c')]?_0x37dd50['attributes']:_0x357156[_0xb2c1('0x36')];if(!_0x523224[_0xb2c1('0x38')]['hasOwnProperty'](_0xb2c1('0x5d'))){_0x37dd50[_0xb2c1('0x23')]=qs['limit'](_0x523224[_0xb2c1('0x38')]['limit']);_0x37dd50[_0xb2c1('0x21')]=qs[_0xb2c1('0x21')](_0x523224[_0xb2c1('0x38')][_0xb2c1('0x21')]);}_0x37dd50[_0xb2c1('0x3e')]=qs[_0xb2c1('0x3f')](_0x523224[_0xb2c1('0x38')][_0xb2c1('0x3f')]);_0x37dd50[_0xb2c1('0x40')]=qs[_0xb2c1('0x39')](_[_0xb2c1('0x41')](_0x523224[_0xb2c1('0x38')],_0x357156[_0xb2c1('0x39')]));_0x37dd50[_0xb2c1('0x40')][_0xb2c1('0x5e')]=_0x1517fa['id'];if(_0x523224[_0xb2c1('0x38')][_0xb2c1('0x42')]){_0x37dd50[_0xb2c1('0x40')]=_[_0xb2c1('0x43')](_0x37dd50[_0xb2c1('0x40')],{'$or':_[_0xb2c1('0x30')](_0x37dd50[_0xb2c1('0x3a')],function(_0x477cb0){var _0x320b24={};_0x320b24[_0x477cb0]={'$like':'%'+_0x523224[_0xb2c1('0x38')][_0xb2c1('0x42')]+'%'};return _0x320b24;})});}_0x37dd50=_['merge']({},_0x37dd50,_0x523224[_0xb2c1('0x45')]);return db[_0xb2c1('0x5f')][_0xb2c1('0x22')]({'where':_0x37dd50[_0xb2c1('0x40')]})[_0xb2c1('0x28')](function(_0x1241ea){_0x4054d8['count']=_0x1241ea;if(_0x523224[_0xb2c1('0x38')][_0xb2c1('0x46')]){_0x37dd50[_0xb2c1('0x47')]=[{'all':!![]}];}return db[_0xb2c1('0x5f')][_0xb2c1('0x48')](_0x37dd50);})[_0xb2c1('0x28')](function(_0x443e13){_0x4054d8[_0xb2c1('0x49')]=_0x443e13;return _0x4054d8;});}})['then'](respondWithFilteredResult(_0x45530f,_0x37dd50))[_0xb2c1('0x4d')](handleError(_0x45530f,null));};exports[_0xb2c1('0x60')]=function(_0x50ad43,_0x452006,_0x2cb07d){var _0xab0705={'raw':!![],'where':{}};var _0x399973={};var _0x2a8516={'count':0x0,'rows':[]};return db[_0xb2c1('0x31')]['findOne']({'where':{'id':_0x50ad43[_0xb2c1('0x4a')]['id']}})[_0xb2c1('0x28')](handleEntityNotFound(_0x452006,null))[_0xb2c1('0x28')](function(_0x4e27ef){if(_0x4e27ef){_0x399973[_0xb2c1('0x36')]=_[_0xb2c1('0x37')](db[_0xb2c1('0x61')]['rawAttributes']);_0x399973['query']=_[_0xb2c1('0x37')](_0x50ad43['query']);_0x399973[_0xb2c1('0x39')]=_[_0xb2c1('0x4b')](_0x399973[_0xb2c1('0x36')],_0x399973[_0xb2c1('0x38')]);_0xab0705[_0xb2c1('0x3a')]=_[_0xb2c1('0x4b')](_0x399973[_0xb2c1('0x36')],qs['fields'](_0x50ad43[_0xb2c1('0x38')][_0xb2c1('0x3b')]));_0xab0705[_0xb2c1('0x3a')]=_0xab0705[_0xb2c1('0x3a')][_0xb2c1('0x3c')]?_0xab0705[_0xb2c1('0x3a')]:_0x399973['model'];if(!_0x50ad43[_0xb2c1('0x38')][_0xb2c1('0x3d')](_0xb2c1('0x5d'))){_0xab0705['limit']=qs[_0xb2c1('0x23')](_0x50ad43[_0xb2c1('0x38')][_0xb2c1('0x23')]);_0xab0705['offset']=qs['offset'](_0x50ad43[_0xb2c1('0x38')][_0xb2c1('0x21')]);}_0xab0705[_0xb2c1('0x3e')]=qs['sort'](_0x50ad43['query'][_0xb2c1('0x3f')]);_0xab0705[_0xb2c1('0x40')]=qs[_0xb2c1('0x39')](_[_0xb2c1('0x41')](_0x50ad43['query'],_0x399973[_0xb2c1('0x39')]));_0xab0705[_0xb2c1('0x40')][_0xb2c1('0x5e')]=_0x4e27ef['id'];if(_0x50ad43[_0xb2c1('0x38')][_0xb2c1('0x42')]){_0xab0705[_0xb2c1('0x40')]=_['merge'](_0xab0705[_0xb2c1('0x40')],{'$or':_['map'](_0xab0705[_0xb2c1('0x3a')],function(_0x35aded){var _0x2750a7={};_0x2750a7[_0x35aded]={'$like':'%'+_0x50ad43['query']['filter']+'%'};return _0x2750a7;})});}_0xab0705=_[_0xb2c1('0x43')]({},_0xab0705,_0x50ad43[_0xb2c1('0x45')]);return db['CmHopperHistory'][_0xb2c1('0x22')]({'where':_0xab0705[_0xb2c1('0x40')]})[_0xb2c1('0x28')](function(_0x40ad4a){_0x2a8516[_0xb2c1('0x22')]=_0x40ad4a;if(_0x50ad43[_0xb2c1('0x38')]['includeAll']){_0xab0705['include']=[{'all':!![]}];}return db[_0xb2c1('0x61')][_0xb2c1('0x48')](_0xab0705);})[_0xb2c1('0x28')](function(_0x2e0576){_0x2a8516[_0xb2c1('0x49')]=_0x2e0576;return _0x2a8516;});}})['then'](respondWithFilteredResult(_0x452006,_0xab0705))[_0xb2c1('0x4d')](handleError(_0x452006,null));};exports[_0xb2c1('0x62')]=function(_0x53492a,_0x4132d3,_0x438dc3){var _0xa8c2a8={'raw':!![],'where':{}};var _0x1d070f={};var _0xf26bb5={'count':0x0,'rows':[]};return db[_0xb2c1('0x31')][_0xb2c1('0x5c')]({'where':{'id':_0x53492a[_0xb2c1('0x4a')]['id']}})[_0xb2c1('0x28')](handleEntityNotFound(_0x4132d3,null))['then'](function(_0x13ec87){if(_0x13ec87){_0x1d070f[_0xb2c1('0x36')]=_[_0xb2c1('0x37')](db[_0xb2c1('0x63')][_0xb2c1('0x32')]);_0x1d070f[_0xb2c1('0x38')]=_[_0xb2c1('0x37')](_0x53492a[_0xb2c1('0x38')]);_0x1d070f[_0xb2c1('0x39')]=_[_0xb2c1('0x4b')](_0x1d070f[_0xb2c1('0x36')],_0x1d070f[_0xb2c1('0x38')]);_0xa8c2a8[_0xb2c1('0x3a')]=_['intersection'](_0x1d070f[_0xb2c1('0x36')],qs[_0xb2c1('0x3b')](_0x53492a['query'][_0xb2c1('0x3b')]));_0xa8c2a8['attributes']=_0xa8c2a8[_0xb2c1('0x3a')]['length']?_0xa8c2a8['attributes']:_0x1d070f[_0xb2c1('0x36')];if(!_0x53492a[_0xb2c1('0x38')][_0xb2c1('0x3d')]('nolimit')){_0xa8c2a8[_0xb2c1('0x23')]=qs[_0xb2c1('0x23')](_0x53492a[_0xb2c1('0x38')][_0xb2c1('0x23')]);_0xa8c2a8['offset']=qs[_0xb2c1('0x21')](_0x53492a[_0xb2c1('0x38')][_0xb2c1('0x21')]);}_0xa8c2a8['order']=qs[_0xb2c1('0x3f')](_0x53492a['query'][_0xb2c1('0x3f')]);_0xa8c2a8[_0xb2c1('0x40')]=qs[_0xb2c1('0x39')](_[_0xb2c1('0x41')](_0x53492a[_0xb2c1('0x38')],_0x1d070f[_0xb2c1('0x39')]));_0xa8c2a8[_0xb2c1('0x40')][_0xb2c1('0x5e')]=_0x13ec87['id'];if(_0x53492a[_0xb2c1('0x38')][_0xb2c1('0x42')]){_0xa8c2a8[_0xb2c1('0x40')]=_['merge'](_0xa8c2a8[_0xb2c1('0x40')],{'$or':_[_0xb2c1('0x30')](_0xa8c2a8[_0xb2c1('0x3a')],function(_0x1c5c58){var _0x37f764={};_0x37f764[_0x1c5c58]={'$like':'%'+_0x53492a['query']['filter']+'%'};return _0x37f764;})});}_0xa8c2a8=_['merge']({},_0xa8c2a8,_0x53492a[_0xb2c1('0x45')]);return db['CmHopperFinal']['count']({'where':_0xa8c2a8[_0xb2c1('0x40')]})[_0xb2c1('0x28')](function(_0x209487){_0xf26bb5['count']=_0x209487;if(_0x53492a[_0xb2c1('0x38')][_0xb2c1('0x46')]){_0xa8c2a8['include']=[{'all':!![]}];}return db[_0xb2c1('0x63')][_0xb2c1('0x48')](_0xa8c2a8);})['then'](function(_0x2b31f2){_0xf26bb5[_0xb2c1('0x49')]=_0x2b31f2;return _0xf26bb5;});}})[_0xb2c1('0x28')](respondWithFilteredResult(_0x4132d3,_0xa8c2a8))[_0xb2c1('0x4d')](handleError(_0x4132d3,null));};exports['getHopperBlacks']=function(_0x4a611b,_0x15fc1f,_0x2a5203){var _0x44bb8a={'raw':!![],'where':{}};var _0x207595={};var _0x4882b4={'count':0x0,'rows':[]};return db[_0xb2c1('0x31')][_0xb2c1('0x5c')]({'where':{'id':_0x4a611b[_0xb2c1('0x4a')]['id']}})[_0xb2c1('0x28')](handleEntityNotFound(_0x15fc1f,null))['then'](function(_0x16b340){if(_0x16b340){_0x207595['model']=_['keys'](db['CmHopperBlack'][_0xb2c1('0x32')]);_0x207595['query']=_[_0xb2c1('0x37')](_0x4a611b[_0xb2c1('0x38')]);_0x207595[_0xb2c1('0x39')]=_['intersection'](_0x207595['model'],_0x207595[_0xb2c1('0x38')]);_0x44bb8a['attributes']=_[_0xb2c1('0x4b')](_0x207595['model'],qs['fields'](_0x4a611b[_0xb2c1('0x38')][_0xb2c1('0x3b')]));_0x44bb8a[_0xb2c1('0x3a')]=_0x44bb8a[_0xb2c1('0x3a')][_0xb2c1('0x3c')]?_0x44bb8a['attributes']:_0x207595[_0xb2c1('0x36')];if(!_0x4a611b[_0xb2c1('0x38')][_0xb2c1('0x3d')](_0xb2c1('0x5d'))){_0x44bb8a[_0xb2c1('0x23')]=qs[_0xb2c1('0x23')](_0x4a611b[_0xb2c1('0x38')][_0xb2c1('0x23')]);_0x44bb8a[_0xb2c1('0x21')]=qs[_0xb2c1('0x21')](_0x4a611b[_0xb2c1('0x38')][_0xb2c1('0x21')]);}_0x44bb8a[_0xb2c1('0x3e')]=qs['sort'](_0x4a611b[_0xb2c1('0x38')][_0xb2c1('0x3f')]);_0x44bb8a[_0xb2c1('0x40')]=qs[_0xb2c1('0x39')](_['pick'](_0x4a611b['query'],_0x207595[_0xb2c1('0x39')]));_0x44bb8a['where'][_0xb2c1('0x5e')]=_0x16b340['id'];if(_0x4a611b[_0xb2c1('0x38')][_0xb2c1('0x42')]){_0x44bb8a[_0xb2c1('0x40')]=_[_0xb2c1('0x43')](_0x44bb8a[_0xb2c1('0x40')],{'$or':_[_0xb2c1('0x30')](_0x44bb8a[_0xb2c1('0x3a')],function(_0x40031a){var _0x1fc17e={};_0x1fc17e[_0x40031a]={'$like':'%'+_0x4a611b[_0xb2c1('0x38')][_0xb2c1('0x42')]+'%'};return _0x1fc17e;})});}_0x44bb8a=_['merge']({},_0x44bb8a,_0x4a611b['options']);return db[_0xb2c1('0x64')][_0xb2c1('0x22')]({'where':_0x44bb8a[_0xb2c1('0x40')]})[_0xb2c1('0x28')](function(_0x23d54c){_0x4882b4[_0xb2c1('0x22')]=_0x23d54c;if(_0x4a611b[_0xb2c1('0x38')][_0xb2c1('0x46')]){_0x44bb8a[_0xb2c1('0x47')]=[{'all':!![]}];}return db[_0xb2c1('0x64')]['findAll'](_0x44bb8a);})[_0xb2c1('0x28')](function(_0x326442){_0x4882b4[_0xb2c1('0x49')]=_0x326442;return _0x4882b4;});}})[_0xb2c1('0x28')](respondWithFilteredResult(_0x15fc1f,_0x44bb8a))[_0xb2c1('0x4d')](handleError(_0x15fc1f,null));};exports[_0xb2c1('0x65')]=function(_0x4b471c,_0x3b249b,_0x33bb00){var _0x3190a2={};var _0xdffd6c={};var _0x2a5e13;var _0x2ff4e7;return db[_0xb2c1('0x31')][_0xb2c1('0x5c')]({'where':{'id':_0x4b471c[_0xb2c1('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3b249b,null))[_0xb2c1('0x28')](function(_0x9b4c9){if(_0x9b4c9){_0x2a5e13=_0x9b4c9;_0xdffd6c['model']=_['keys'](db[_0xb2c1('0x66')][_0xb2c1('0x32')]);_0xdffd6c[_0xb2c1('0x38')]=_['keys'](_0x4b471c[_0xb2c1('0x38')]);_0xdffd6c['filters']=_['intersection'](_0xdffd6c[_0xb2c1('0x36')],_0xdffd6c['query']);_0x3190a2[_0xb2c1('0x3a')]=_[_0xb2c1('0x4b')](_0xdffd6c['model'],qs[_0xb2c1('0x3b')](_0x4b471c[_0xb2c1('0x38')]['fields']));_0x3190a2[_0xb2c1('0x3a')]=_0x3190a2[_0xb2c1('0x3a')][_0xb2c1('0x3c')]?_0x3190a2[_0xb2c1('0x3a')]:_0xdffd6c[_0xb2c1('0x36')];_0x3190a2['order']=qs['sort'](_0x4b471c['query']['sort']);_0x3190a2[_0xb2c1('0x40')]=qs['filters'](_[_0xb2c1('0x41')](_0x4b471c[_0xb2c1('0x38')],_0xdffd6c['filters']));if(_0x4b471c[_0xb2c1('0x38')][_0xb2c1('0x42')]){_0x3190a2[_0xb2c1('0x40')]=_[_0xb2c1('0x43')](_0x3190a2[_0xb2c1('0x40')],{'$or':_[_0xb2c1('0x30')](_0x3190a2[_0xb2c1('0x3a')],function(_0x31f90d){var _0x288e11={};_0x288e11[_0x31f90d]={'$like':'%'+_0x4b471c['query'][_0xb2c1('0x42')]+'%'};return _0x288e11;})});}_0x3190a2=_[_0xb2c1('0x43')]({},_0x3190a2,_0x4b471c[_0xb2c1('0x45')]);return _0x2a5e13[_0xb2c1('0x65')](_0x3190a2);}})[_0xb2c1('0x28')](function(_0x2993ef){if(_0x2993ef){_0x2ff4e7=_0x2993ef[_0xb2c1('0x3c')];if(!_0x4b471c[_0xb2c1('0x38')][_0xb2c1('0x3d')](_0xb2c1('0x5d'))){_0x3190a2[_0xb2c1('0x23')]=qs[_0xb2c1('0x23')](_0x4b471c['query'][_0xb2c1('0x23')]);_0x3190a2[_0xb2c1('0x21')]=qs[_0xb2c1('0x21')](_0x4b471c[_0xb2c1('0x38')]['offset']);}return _0x2a5e13[_0xb2c1('0x65')](_0x3190a2);}})[_0xb2c1('0x28')](function(_0x5cec2f){if(_0x5cec2f){return _0x5cec2f?{'count':_0x2ff4e7,'rows':_0x5cec2f}:null;}})['then'](respondWithResult(_0x3b249b,null))[_0xb2c1('0x4d')](handleError(_0x3b249b,null));};exports['addLists']=function(_0x52b3c6,_0xa4789,_0x5f1f9c){var _0x36b3d0,_0x42ec8b;var _0x1cad65=[];var _0x29932d=moment()['format'](_0xb2c1('0x67'));return db['Campaign']['find']({'where':{'id':_0x52b3c6[_0xb2c1('0x4a')]['id']}})[_0xb2c1('0x28')](handleEntityNotFound(_0xa4789,null))[_0xb2c1('0x28')](function(_0x31c00b){if(_0x31c00b){_0x42ec8b=_0x31c00b;return _0x31c00b[_0xb2c1('0x68')](_0x52b3c6[_0xb2c1('0x57')][_0xb2c1('0x69')],_[_0xb2c1('0x6a')](_0x52b3c6['body'],[_0xb2c1('0x69'),'id'])||{});}return null;})[_0xb2c1('0x6b')](function(_0x2d0769){var _0xb38e4a;var _0x5f03d3;_0x36b3d0=_0x2d0769||[];var _0x557d91=[];if(_0x2d0769){for(var _0x16709e=0x0;_0x16709e<_0x2d0769[_0xb2c1('0x3c')];_0x16709e+=0x1){var _0x1e1aad=_0x2d0769[_0x16709e][_0xb2c1('0x50')]({'plain':!![]});_0x42ec8b['dialCheckDuplicateType']=_0x52b3c6[_0xb2c1('0x57')][_0xb2c1('0x6c')]?_0x52b3c6[_0xb2c1('0x57')]['dialCheckDuplicateType']:_0x42ec8b['dialCheckDuplicateType'];switch(_0x42ec8b[_0xb2c1('0x6c')]){case _0xb2c1('0x6d'):_0xb38e4a=squel['insert']()['into']('cm_hopper')[_0xb2c1('0x6e')]([_0xb2c1('0x6f'),_0xb2c1('0x70'),_0xb2c1('0x71'),'ListId',_0xb2c1('0x5e'),_0xb2c1('0x55'),_0xb2c1('0x56')],squel[_0xb2c1('0x72')]()[_0xb2c1('0x73')](_0xb2c1('0x6f'),_0xb2c1('0x6f'))[_0xb2c1('0x73')]('NOW()',_0xb2c1('0x70'))[_0xb2c1('0x73')]('id',_0xb2c1('0x71'))['field'](_0x1e1aad[_0xb2c1('0x74')][_0xb2c1('0x75')](),_0xb2c1('0x76'))[_0xb2c1('0x73')](_0x52b3c6[_0xb2c1('0x4a')]['id']['toString'](),_0xb2c1('0x5e'))[_0xb2c1('0x73')]('\x27'+_0x29932d+'\x27','createdAt')[_0xb2c1('0x73')]('\x27'+_0x29932d+'\x27','updatedAt')[_0xb2c1('0x77')](_0xb2c1('0x78'))['where'](_0xb2c1('0x79'))['where'](_0xb2c1('0x7a'),_0x1e1aad[_0xb2c1('0x74')][_0xb2c1('0x75')]())[_0xb2c1('0x40')](_0xb2c1('0x7b'))['where'](_0xb2c1('0x7c'),squel['select']()[_0xb2c1('0x73')](_0xb2c1('0x7d'))[_0xb2c1('0x77')](_0xb2c1('0x7e'))[_0xb2c1('0x40')](_0xb2c1('0x7f'),_0x52b3c6[_0xb2c1('0x4a')]['id'][_0xb2c1('0x75')]()))['where'](_0xb2c1('0x7c'),squel[_0xb2c1('0x72')]()['field'](_0xb2c1('0x80'))[_0xb2c1('0x77')](_0xb2c1('0x81'))[_0xb2c1('0x40')](_0xb2c1('0x7f'),_0x52b3c6[_0xb2c1('0x4a')]['id'][_0xb2c1('0x75')]())))[_0xb2c1('0x75')]();break;case _0xb2c1('0x82'):_0xb38e4a=squel[_0xb2c1('0x83')]()[_0xb2c1('0x84')]('cm_hopper')['fromQuery']([_0xb2c1('0x6f'),'scheduledAt',_0xb2c1('0x71'),'ListId',_0xb2c1('0x5e'),'createdAt',_0xb2c1('0x56')],squel[_0xb2c1('0x72')]()[_0xb2c1('0x73')](_0xb2c1('0x6f'),_0xb2c1('0x6f'))['field'](_0xb2c1('0x85'),_0xb2c1('0x70'))[_0xb2c1('0x73')]('id',_0xb2c1('0x71'))[_0xb2c1('0x73')](_0x1e1aad['CmListId']['toString'](),'ListId')[_0xb2c1('0x73')](_0x52b3c6[_0xb2c1('0x4a')]['id'][_0xb2c1('0x75')](),_0xb2c1('0x5e'))[_0xb2c1('0x73')]('\x27'+_0x29932d+'\x27',_0xb2c1('0x55'))[_0xb2c1('0x73')]('\x27'+_0x29932d+'\x27',_0xb2c1('0x56'))[_0xb2c1('0x77')](_0xb2c1('0x78'))[_0xb2c1('0x40')](_0xb2c1('0x79'))[_0xb2c1('0x40')]('ListId\x20=\x20?',_0x1e1aad[_0xb2c1('0x74')][_0xb2c1('0x75')]())[_0xb2c1('0x40')](_0xb2c1('0x7b'))['where'](_0xb2c1('0x7c'),squel['select']()[_0xb2c1('0x73')]('COALESCE(phone,\x27\x27)')[_0xb2c1('0x77')](_0xb2c1('0x81'))[_0xb2c1('0x40')](_0xb2c1('0x7f'),_0x52b3c6['params']['id'][_0xb2c1('0x75')]())))[_0xb2c1('0x75')]();break;default:_0xb38e4a=squel['insert']()[_0xb2c1('0x84')](_0xb2c1('0x81'))[_0xb2c1('0x6e')]([_0xb2c1('0x6f'),_0xb2c1('0x70'),_0xb2c1('0x71'),'ListId',_0xb2c1('0x5e'),_0xb2c1('0x55'),_0xb2c1('0x56')],squel[_0xb2c1('0x72')]()[_0xb2c1('0x73')](_0xb2c1('0x6f'),_0xb2c1('0x6f'))[_0xb2c1('0x73')](_0xb2c1('0x85'),'scheduledAt')['field']('id',_0xb2c1('0x71'))[_0xb2c1('0x73')](_0x1e1aad[_0xb2c1('0x74')][_0xb2c1('0x75')](),'ListId')[_0xb2c1('0x73')](_0x52b3c6[_0xb2c1('0x4a')]['id'][_0xb2c1('0x75')](),_0xb2c1('0x5e'))[_0xb2c1('0x73')]('\x27'+_0x29932d+'\x27','createdAt')['field']('\x27'+_0x29932d+'\x27',_0xb2c1('0x56'))[_0xb2c1('0x77')](_0xb2c1('0x78'))[_0xb2c1('0x40')](_0xb2c1('0x79'))['where'](_0xb2c1('0x7a'),_0x1e1aad[_0xb2c1('0x74')]['toString']())['where'](_0xb2c1('0x7b')))[_0xb2c1('0x75')]();}_0x5f03d3=squel['insert']()[_0xb2c1('0x84')](_0xb2c1('0x86'))[_0xb2c1('0x6e')]([_0xb2c1('0x87'),_0xb2c1('0x70'),_0xb2c1('0x6f'),'OrderBy',_0xb2c1('0x55'),_0xb2c1('0x56')],squel[_0xb2c1('0x72')]()[_0xb2c1('0x73')](_0xb2c1('0x88'),'id')[_0xb2c1('0x73')](_0xb2c1('0x85'),_0xb2c1('0x70'))[_0xb2c1('0x73')]('ci.item',_0xb2c1('0x6f'))[_0xb2c1('0x73')]('ci.OrderBY',_0xb2c1('0x89'))[_0xb2c1('0x73')]('\x27'+_0x29932d+'\x27',_0xb2c1('0x55'))['field']('\x27'+_0x29932d+'\x27',_0xb2c1('0x56'))[_0xb2c1('0x77')](_0xb2c1('0x8a'),'ci')[_0xb2c1('0x8b')](_0xb2c1('0x81'),'h',_0xb2c1('0x8c'))[_0xb2c1('0x40')](_0xb2c1('0x8d'),_0x1e1aad[_0xb2c1('0x74')][_0xb2c1('0x75')]())[_0xb2c1('0x40')](_0xb2c1('0x8e'),_0x52b3c6[_0xb2c1('0x4a')]['id'][_0xb2c1('0x75')]())[_0xb2c1('0x40')](_0xb2c1('0x8f'),_0x29932d))[_0xb2c1('0x75')]();_0x557d91['push'](db[_0xb2c1('0x90')]['query'](_0xb38e4a));_0x1cad65['push'](db['sequelize'][_0xb2c1('0x38')](_0x5f03d3));}return BPromise[_0xb2c1('0x91')](_0x557d91);}})['then'](function(){return BPromise[_0xb2c1('0x91')](_0x1cad65);})['then'](function(){return _0x36b3d0;})[_0xb2c1('0x28')](respondWithResult(_0xa4789,null))[_0xb2c1('0x4d')](handleError(_0xa4789,null));};exports[_0xb2c1('0x92')]=function(_0x3d97ae,_0x5837ee,_0x56100e){return db[_0xb2c1('0x31')][_0xb2c1('0x4c')]({'where':{'id':_0x3d97ae['params']['id']}})[_0xb2c1('0x28')](handleEntityNotFound(_0x5837ee,null))['then'](function(_0x55ff57){if(_0x55ff57){return _0x55ff57['removeLists'](_0x3d97ae[_0xb2c1('0x38')][_0xb2c1('0x69')]);}})[_0xb2c1('0x28')](function(_0x49d057){if(_0x49d057){return db[_0xb2c1('0x5f')]['destroy']({'where':{'ListId':_0x3d97ae['query'][_0xb2c1('0x69')],'CampaignId':_0x3d97ae[_0xb2c1('0x4a')]['id']}})[_0xb2c1('0x28')](function(){return _0x49d057;});}})['then'](respondWithStatusCode(_0x5837ee,null))[_0xb2c1('0x4d')](handleError(_0x5837ee,null));};exports[_0xb2c1('0x93')]=function(_0x5d7cb5,_0x5e99f7,_0x3bd470){var _0xa14ce5={};var _0xc380c7={};var _0x40c862;var _0x18f9e5;return db[_0xb2c1('0x31')][_0xb2c1('0x5c')]({'where':{'id':_0x5d7cb5[_0xb2c1('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5e99f7,null))[_0xb2c1('0x28')](function(_0x2455d5){if(_0x2455d5){_0x40c862=_0x2455d5;_0xc380c7[_0xb2c1('0x36')]=_['keys'](db[_0xb2c1('0x66')][_0xb2c1('0x32')]);_0xc380c7[_0xb2c1('0x38')]=_['keys'](_0x5d7cb5[_0xb2c1('0x38')]);_0xc380c7[_0xb2c1('0x39')]=_[_0xb2c1('0x4b')](_0xc380c7[_0xb2c1('0x36')],_0xc380c7['query']);_0xa14ce5[_0xb2c1('0x3a')]=_['intersection'](_0xc380c7['model'],qs['fields'](_0x5d7cb5[_0xb2c1('0x38')][_0xb2c1('0x3b')]));_0xa14ce5[_0xb2c1('0x3a')]=_0xa14ce5[_0xb2c1('0x3a')]['length']?_0xa14ce5[_0xb2c1('0x3a')]:_0xc380c7[_0xb2c1('0x36')];_0xa14ce5[_0xb2c1('0x3e')]=qs[_0xb2c1('0x3f')](_0x5d7cb5[_0xb2c1('0x38')][_0xb2c1('0x3f')]);_0xa14ce5[_0xb2c1('0x40')]=qs['filters'](_[_0xb2c1('0x41')](_0x5d7cb5[_0xb2c1('0x38')],_0xc380c7[_0xb2c1('0x39')]));if(_0x5d7cb5[_0xb2c1('0x38')][_0xb2c1('0x42')]){_0xa14ce5['where']=_[_0xb2c1('0x43')](_0xa14ce5[_0xb2c1('0x40')],{'$or':_[_0xb2c1('0x30')](_0xa14ce5[_0xb2c1('0x3a')],function(_0x580b5a){var _0x4e23bc={};_0x4e23bc[_0x580b5a]={'$like':'%'+_0x5d7cb5[_0xb2c1('0x38')][_0xb2c1('0x42')]+'%'};return _0x4e23bc;})});}_0xa14ce5=_[_0xb2c1('0x43')]({},_0xa14ce5,_0x5d7cb5['options']);return _0x40c862['getBlackLists'](_0xa14ce5);}})[_0xb2c1('0x28')](function(_0x3dc416){if(_0x3dc416){_0x18f9e5=_0x3dc416[_0xb2c1('0x3c')];if(!_0x5d7cb5['query']['hasOwnProperty'](_0xb2c1('0x5d'))){_0xa14ce5[_0xb2c1('0x23')]=qs[_0xb2c1('0x23')](_0x5d7cb5[_0xb2c1('0x38')]['limit']);_0xa14ce5['offset']=qs['offset'](_0x5d7cb5[_0xb2c1('0x38')]['offset']);}return _0x40c862[_0xb2c1('0x93')](_0xa14ce5);}})[_0xb2c1('0x28')](function(_0xf7a210){if(_0xf7a210){return _0xf7a210?{'count':_0x18f9e5,'rows':_0xf7a210}:null;}})['then'](respondWithResult(_0x5e99f7,null))['catch'](handleError(_0x5e99f7,null));};exports[_0xb2c1('0x94')]=function(_0x3bae27,_0x4747a6,_0x37b5c0){var _0x30368a,_0xfc3d10;var _0x5636cc=[];var _0x2732e6=moment()['format'](_0xb2c1('0x67'));return db[_0xb2c1('0x31')][_0xb2c1('0x4c')]({'where':{'id':_0x3bae27[_0xb2c1('0x4a')]['id']}})[_0xb2c1('0x28')](handleEntityNotFound(_0x4747a6,null))[_0xb2c1('0x28')](function(_0x1be578){if(_0x1be578){_0xfc3d10=_0x1be578;return _0x1be578['addBlackLists'](_0x3bae27[_0xb2c1('0x57')]['ids'],_['omit'](_0x3bae27[_0xb2c1('0x57')],[_0xb2c1('0x69'),'id'])||{});}return null;})[_0xb2c1('0x6b')](function(_0x576e50){var _0x4def4e;var _0x1a356d;_0x30368a=_0x576e50||[];var _0x146fe6=[];if(_0x576e50){for(var _0x165013=0x0;_0x165013<_0x576e50['length'];_0x165013+=0x1){var _0x16c70d=_0x576e50[_0x165013][_0xb2c1('0x50')]({'plain':!![]});_0x4def4e=squel['insert']()[_0xb2c1('0x84')](_0xb2c1('0x95'))[_0xb2c1('0x6e')]([_0xb2c1('0x6f'),_0xb2c1('0x71'),_0xb2c1('0x76'),_0xb2c1('0x5e'),_0xb2c1('0x55'),_0xb2c1('0x56')],squel[_0xb2c1('0x72')]()['field'](_0xb2c1('0x6f'),_0xb2c1('0x6f'))[_0xb2c1('0x73')]('id',_0xb2c1('0x71'))[_0xb2c1('0x73')](_0x16c70d[_0xb2c1('0x74')][_0xb2c1('0x75')](),'ListId')['field'](_0x3bae27['params']['id'][_0xb2c1('0x75')](),'CampaignId')[_0xb2c1('0x73')](_0xb2c1('0x85'),_0xb2c1('0x55'))[_0xb2c1('0x73')](_0xb2c1('0x85'),_0xb2c1('0x56'))[_0xb2c1('0x77')](_0xb2c1('0x78'))[_0xb2c1('0x40')](_0xb2c1('0x79'))[_0xb2c1('0x40')](_0xb2c1('0x7a'),_0x16c70d[_0xb2c1('0x74')][_0xb2c1('0x75')]())[_0xb2c1('0x40')](_0xb2c1('0x7b')))[_0xb2c1('0x75')]();_0x146fe6['push'](db[_0xb2c1('0x90')][_0xb2c1('0x38')](_0x4def4e));}return BPromise[_0xb2c1('0x91')](_0x146fe6);}})[_0xb2c1('0x28')](function(){return _0x30368a;})[_0xb2c1('0x28')](respondWithResult(_0x4747a6,null))['catch'](handleError(_0x4747a6,null));};exports[_0xb2c1('0x96')]=function(_0x1f6b8c,_0x3ece13,_0x733d0a){return db[_0xb2c1('0x31')][_0xb2c1('0x4c')]({'where':{'id':_0x1f6b8c[_0xb2c1('0x4a')]['id']}})[_0xb2c1('0x28')](handleEntityNotFound(_0x3ece13,null))[_0xb2c1('0x28')](function(_0x47e0d8){if(_0x47e0d8){return _0x47e0d8['removeBlackLists'](_0x1f6b8c['query']['ids']);}})['then'](function(_0x504df0){if(_0x504df0){return db['CmHopperBlack'][_0xb2c1('0x29')]({'where':{'ListId':_0x1f6b8c['query'][_0xb2c1('0x69')],'CampaignId':_0x1f6b8c['params']['id']}})[_0xb2c1('0x28')](function(){return _0x504df0;});}})[_0xb2c1('0x28')](respondWithStatusCode(_0x3ece13,null))[_0xb2c1('0x4d')](handleError(_0x3ece13,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 57086f8..29de92f 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x4fbdf4,_0x2719b1){var _0x186fce=function(_0x1b3fb8){while(--_0x1b3fb8){_0x4fbdf4['push'](_0x4fbdf4['shift']());}};_0x186fce(++_0x2719b1);}(_0x7a54,0x106));var _0x47a5=function(_0x1043fa,_0x3a93de){_0x1043fa=_0x1043fa-0x0;var _0x3d6810=_0x7a54[_0x1043fa];return _0x3d6810;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 2663e5d..e81cce4 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 _0x50a6=['../../config/utils','../../config/logger','../../config/environment','http','then','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Campaign','options','raw','where','attributes','limit','map','include','model','info','GetCampaign','lodash','util','randomstring','../../mysqldb'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x50a6,0xa4));var _0x650a=function(_0x33cb97,_0x2be8e8){_0x33cb97=_0x33cb97-0x0;var _0xe85595=_0x50a6[_0x33cb97];return _0xe85595;};'use strict';var _=require(_0x650a('0x0'));var util=require(_0x650a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x650a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x650a('0x3'))['db'];var utils=require(_0x650a('0x4'));var logger=require(_0x650a('0x5'))('rpc');var config=require(_0x650a('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x650a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2d1bb4,_0x2c22b9,_0x61618a){return new BPromise(function(_0x56d38f,_0x25366e){return client['request'](_0x2d1bb4,_0x61618a)[_0x650a('0x8')](function(_0x1e4796){logger['info'](_0x650a('0x9'),_0x2c22b9,_0x650a('0xa'));logger['debug'](_0x650a('0xb'),_0x2c22b9,'request\x20sent',JSON[_0x650a('0xc')](_0x1e4796));if(_0x1e4796['error']){if(_0x1e4796[_0x650a('0xd')]['code']===0x1f4){logger[_0x650a('0xd')]('Campaign,\x20%s,\x20%s',_0x2c22b9,_0x1e4796[_0x650a('0xd')][_0x650a('0xe')]);return _0x25366e(_0x1e4796[_0x650a('0xd')]['message']);}logger[_0x650a('0xd')](_0x650a('0x9'),_0x2c22b9,_0x1e4796[_0x650a('0xd')][_0x650a('0xe')]);return _0x56d38f(_0x1e4796[_0x650a('0xd')][_0x650a('0xe')]);}else{logger['info'](_0x650a('0x9'),_0x2c22b9,'request\x20sent');_0x56d38f(_0x1e4796[_0x650a('0xf')][_0x650a('0xe')]);}})[_0x650a('0x10')](function(_0x5d9c92){logger['error']('Campaign,\x20%s,\x20%s',_0x2c22b9,_0x5d9c92);_0x25366e(_0x5d9c92);});});}exports['GetCampaign']=function(_0x2ad2d7){var _0x359314=this;return new Promise(function(_0x41d2fa,_0xd0f717){return db[_0x650a('0x11')]['findAll']({'raw':_0x2ad2d7['options']?_0x2ad2d7[_0x650a('0x12')][_0x650a('0x13')]===undefined?!![]:![]:!![],'where':_0x2ad2d7['options']?_0x2ad2d7[_0x650a('0x12')][_0x650a('0x14')]||null:null,'attributes':_0x2ad2d7['options']?_0x2ad2d7[_0x650a('0x12')][_0x650a('0x15')]||null:null,'limit':_0x2ad2d7[_0x650a('0x12')]?_0x2ad2d7[_0x650a('0x12')][_0x650a('0x16')]||null:null,'include':_0x2ad2d7['options']?_0x2ad2d7[_0x650a('0x12')]['include']?_[_0x650a('0x17')](_0x2ad2d7[_0x650a('0x12')][_0x650a('0x18')],function(_0x469e53){return{'model':db[_0x469e53[_0x650a('0x19')]],'as':_0x469e53['as'],'attributes':_0x469e53[_0x650a('0x15')],'include':_0x469e53[_0x650a('0x18')]?_[_0x650a('0x17')](_0x469e53[_0x650a('0x18')],function(_0x2761a8){return{'model':db[_0x2761a8[_0x650a('0x19')]],'as':_0x2761a8['as'],'attributes':_0x2761a8[_0x650a('0x15')],'include':_0x2761a8[_0x650a('0x18')]?_[_0x650a('0x17')](_0x2761a8[_0x650a('0x18')],function(_0x39a155){return{'model':db[_0x39a155[_0x650a('0x19')]],'as':_0x39a155['as'],'attributes':_0x39a155[_0x650a('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2290a7){logger[_0x650a('0x1a')](_0x650a('0x1b'),_0x2ad2d7);logger['debug'](_0x650a('0x1b'),_0x2ad2d7,JSON[_0x650a('0xc')](_0x2290a7));_0x41d2fa(_0x2290a7);})[_0x650a('0x10')](function(_0x783509){logger[_0x650a('0xd')](_0x650a('0x1b'),_0x783509['message'],_0x2ad2d7);_0xd0f717(_0x359314[_0x650a('0xd')](0x1f4,_0x783509[_0x650a('0xe')]));});});}; \ No newline at end of file +var _0xfb3f=['options','where','attributes','limit','include','model','map','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','GetCampaign','Campaign'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xfb3f,0xd9));var _0xffb3=function(_0x2a430f,_0x3057cf){_0x2a430f=_0x2a430f-0x0;var _0x108a2f=_0xfb3f[_0x2a430f];return _0x108a2f;};'use strict';var _=require(_0xffb3('0x0'));var util=require(_0xffb3('0x1'));var moment=require('moment');var BPromise=require(_0xffb3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xffb3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xffb3('0x4'))(_0xffb3('0x5'));var config=require(_0xffb3('0x6'));var jayson=require(_0xffb3('0x7'));var client=jayson[_0xffb3('0x8')][_0xffb3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3868a6,_0x146133,_0x5177aa){return new BPromise(function(_0x2e9697,_0x250f0f){return client[_0xffb3('0xa')](_0x3868a6,_0x5177aa)[_0xffb3('0xb')](function(_0x39c7eb){logger['info'](_0xffb3('0xc'),_0x146133,_0xffb3('0xd'));logger[_0xffb3('0xe')](_0xffb3('0xf'),_0x146133,_0xffb3('0xd'),JSON[_0xffb3('0x10')](_0x39c7eb));if(_0x39c7eb[_0xffb3('0x11')]){if(_0x39c7eb[_0xffb3('0x11')]['code']===0x1f4){logger[_0xffb3('0x11')](_0xffb3('0xc'),_0x146133,_0x39c7eb['error'][_0xffb3('0x12')]);return _0x250f0f(_0x39c7eb[_0xffb3('0x11')][_0xffb3('0x12')]);}logger[_0xffb3('0x11')](_0xffb3('0xc'),_0x146133,_0x39c7eb[_0xffb3('0x11')][_0xffb3('0x12')]);return _0x2e9697(_0x39c7eb[_0xffb3('0x11')][_0xffb3('0x12')]);}else{logger[_0xffb3('0x13')](_0xffb3('0xc'),_0x146133,_0xffb3('0xd'));_0x2e9697(_0x39c7eb['result'][_0xffb3('0x12')]);}})[_0xffb3('0x14')](function(_0x42b807){logger['error']('Campaign,\x20%s,\x20%s',_0x146133,_0x42b807);_0x250f0f(_0x42b807);});});}exports[_0xffb3('0x15')]=function(_0x167ed7){var _0x57d096=this;return new Promise(function(_0x3b35de,_0x30f403){return db[_0xffb3('0x16')]['findAll']({'raw':_0x167ed7[_0xffb3('0x17')]?_0x167ed7[_0xffb3('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x167ed7[_0xffb3('0x17')]?_0x167ed7[_0xffb3('0x17')][_0xffb3('0x18')]||null:null,'attributes':_0x167ed7[_0xffb3('0x17')]?_0x167ed7[_0xffb3('0x17')][_0xffb3('0x19')]||null:null,'limit':_0x167ed7[_0xffb3('0x17')]?_0x167ed7['options'][_0xffb3('0x1a')]||null:null,'include':_0x167ed7[_0xffb3('0x17')]?_0x167ed7['options'][_0xffb3('0x1b')]?_['map'](_0x167ed7['options'][_0xffb3('0x1b')],function(_0x3d55e6){return{'model':db[_0x3d55e6[_0xffb3('0x1c')]],'as':_0x3d55e6['as'],'attributes':_0x3d55e6[_0xffb3('0x19')],'include':_0x3d55e6[_0xffb3('0x1b')]?_[_0xffb3('0x1d')](_0x3d55e6['include'],function(_0x796b8e){return{'model':db[_0x796b8e['model']],'as':_0x796b8e['as'],'attributes':_0x796b8e[_0xffb3('0x19')],'include':_0x796b8e[_0xffb3('0x1b')]?_['map'](_0x796b8e[_0xffb3('0x1b')],function(_0x5e0474){return{'model':db[_0x5e0474[_0xffb3('0x1c')]],'as':_0x5e0474['as'],'attributes':_0x5e0474[_0xffb3('0x19')]};}):[]};}):[]};}):[]:[]})[_0xffb3('0xb')](function(_0x6ba942){logger['info']('GetCampaign',_0x167ed7);logger['debug']('GetCampaign',_0x167ed7,JSON[_0xffb3('0x10')](_0x6ba942));_0x3b35de(_0x6ba942);})['catch'](function(_0x17f601){logger[_0xffb3('0x11')](_0xffb3('0x15'),_0x17f601[_0xffb3('0x12')],_0x167ed7);_0x30f403(_0x57d096['error'](0x1f4,_0x17f601[_0xffb3('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 72be7f6..a4ab806 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 _0x377e=['update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','show','/:id/hoppers','isAuthenticated','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','create','clone','addLists','put'];(function(_0x5ca6b7,_0x1a4f32){var _0x2d7743=function(_0x569d42){while(--_0x569d42){_0x5ca6b7['push'](_0x5ca6b7['shift']());}};_0x2d7743(++_0x1a4f32);}(_0x377e,0x1e2));var _0xe377=function(_0xc989a3,_0x2ad1b0){_0xc989a3=_0xc989a3-0x0;var _0x24de1a=_0x377e[_0xc989a3];return _0x24de1a;};'use strict';var multer=require(_0xe377('0x0'));var util=require(_0xe377('0x1'));var path=require('path');var timeout=require(_0xe377('0x2'));var express=require('express');var router=express[_0xe377('0x3')]();var fs_extra=require(_0xe377('0x4'));var auth=require(_0xe377('0x5'));var interaction=require(_0xe377('0x6'));var config=require(_0xe377('0x7'));var controller=require('./campaign.controller');router[_0xe377('0x8')]('/',auth['isAuthenticated'](),controller[_0xe377('0x9')]);router[_0xe377('0x8')](_0xe377('0xa'),auth['isAuthenticated'](),controller[_0xe377('0xb')]);router['get'](_0xe377('0xc'),auth[_0xe377('0xd')](),controller[_0xe377('0xe')]);router[_0xe377('0x8')](_0xe377('0xf'),auth[_0xe377('0xd')](),controller['getHopperHistories']);router[_0xe377('0x8')](_0xe377('0x10'),auth[_0xe377('0xd')](),controller[_0xe377('0x11')]);router['get'](_0xe377('0x12'),auth['isAuthenticated'](),controller[_0xe377('0x13')]);router[_0xe377('0x8')](_0xe377('0x14'),auth[_0xe377('0xd')](),controller['getLists']);router[_0xe377('0x8')](_0xe377('0x15'),auth[_0xe377('0xd')](),controller[_0xe377('0x16')]);router[_0xe377('0x17')]('/',auth[_0xe377('0xd')](),controller[_0xe377('0x18')]);router['post']('/:id/clone',auth['isAuthenticated'](),controller[_0xe377('0x19')]);router[_0xe377('0x17')](_0xe377('0x14'),auth[_0xe377('0xd')](),controller[_0xe377('0x1a')]);router['post']('/:id/blacklists',auth[_0xe377('0xd')](),controller['addBlackLists']);router[_0xe377('0x1b')]('/:id',auth[_0xe377('0xd')](),controller[_0xe377('0x1c')]);router[_0xe377('0x1d')](_0xe377('0xa'),auth[_0xe377('0xd')](),controller[_0xe377('0x1e')]);router[_0xe377('0x1d')]('/:id/lists',auth[_0xe377('0xd')](),controller[_0xe377('0x1f')]);router[_0xe377('0x1d')](_0xe377('0x15'),auth[_0xe377('0xd')](),controller[_0xe377('0x20')]);module[_0xe377('0x21')]=router; \ No newline at end of file +var _0x2bce=['removeBlackLists','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','/:id/hopper_histories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','delete','destroy','removeLists'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x2bce,0xd3));var _0xe2bc=function(_0x392125,_0x133d3b){_0x392125=_0x392125-0x0;var _0x360aae=_0x2bce[_0x392125];return _0x360aae;};'use strict';var multer=require(_0xe2bc('0x0'));var util=require(_0xe2bc('0x1'));var path=require(_0xe2bc('0x2'));var timeout=require(_0xe2bc('0x3'));var express=require(_0xe2bc('0x4'));var router=express[_0xe2bc('0x5')]();var fs_extra=require(_0xe2bc('0x6'));var auth=require(_0xe2bc('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe2bc('0x8'));var controller=require(_0xe2bc('0x9'));router[_0xe2bc('0xa')]('/',auth[_0xe2bc('0xb')](),controller[_0xe2bc('0xc')]);router[_0xe2bc('0xa')](_0xe2bc('0xd'),auth['isAuthenticated'](),controller[_0xe2bc('0xe')]);router[_0xe2bc('0xa')](_0xe2bc('0xf'),auth[_0xe2bc('0xb')](),controller['getHoppers']);router['get'](_0xe2bc('0x10'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xe2bc('0xa')](_0xe2bc('0x11'),auth[_0xe2bc('0xb')](),controller['getHopperFinals']);router[_0xe2bc('0xa')](_0xe2bc('0x12'),auth['isAuthenticated'](),controller[_0xe2bc('0x13')]);router['get'](_0xe2bc('0x14'),auth['isAuthenticated'](),controller[_0xe2bc('0x15')]);router[_0xe2bc('0xa')](_0xe2bc('0x16'),auth[_0xe2bc('0xb')](),controller[_0xe2bc('0x17')]);router[_0xe2bc('0x18')]('/',auth[_0xe2bc('0xb')](),controller[_0xe2bc('0x19')]);router['post'](_0xe2bc('0x1a'),auth[_0xe2bc('0xb')](),controller[_0xe2bc('0x1b')]);router['post'](_0xe2bc('0x14'),auth[_0xe2bc('0xb')](),controller[_0xe2bc('0x1c')]);router[_0xe2bc('0x18')]('/:id/blacklists',auth[_0xe2bc('0xb')](),controller[_0xe2bc('0x1d')]);router[_0xe2bc('0x1e')](_0xe2bc('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xe2bc('0x1f')]('/:id',auth['isAuthenticated'](),controller[_0xe2bc('0x20')]);router[_0xe2bc('0x1f')](_0xe2bc('0x14'),auth['isAuthenticated'](),controller[_0xe2bc('0x21')]);router[_0xe2bc('0x1f')](_0xe2bc('0x16'),auth[_0xe2bc('0xb')](),controller[_0xe2bc('0x22')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 68f4075..4b10493 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 _0x7b34=['key','sequelize','exports','STRING','TEXT','VIRTUAL','getDataValue'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7b34,0x182));var _0x47b3=function(_0x42e340,_0x27b137){_0x42e340=_0x42e340-0x0;var _0x531d71=_0x7b34[_0x42e340];return _0x531d71;};'use strict';var Sequelize=require(_0x47b3('0x0'));module[_0x47b3('0x1')]={'key':{'type':Sequelize[_0x47b3('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x47b3('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x47b3('0x2')]},'name':{'type':Sequelize[_0x47b3('0x4')],'get':function(){return this[_0x47b3('0x5')](_0x47b3('0x6'));}}}; \ No newline at end of file +var _0xc63d=['exports','STRING','TEXT','VIRTUAL','getDataValue','key'];(function(_0x454fa0,_0x10bf58){var _0x13fcde=function(_0x36d615){while(--_0x36d615){_0x454fa0['push'](_0x454fa0['shift']());}};_0x13fcde(++_0x10bf58);}(_0xc63d,0x1b6));var _0xdc63=function(_0x20650a,_0x3942eb){_0x20650a=_0x20650a-0x0;var _0x4817b2=_0xc63d[_0x20650a];return _0x4817b2;};'use strict';var Sequelize=require('sequelize');module[_0xdc63('0x0')]={'key':{'type':Sequelize[_0xdc63('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xdc63('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdc63('0x1')]},'name':{'type':Sequelize[_0xdc63('0x3')],'get':function(){return this[_0xdc63('0x4')](_0xdc63('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 8f2c6f6..3f747f3 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 _0x3d95=['api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','name','send','index','map','CannedAnswer','rawAttributes','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','filter','options','include','findAll','rows','catch','show','keys','length','includeAll','find','body','params','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','moment','bluebird','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x9df41a,_0x48e96e){var _0x27241a=function(_0xc73912){while(--_0xc73912){_0x9df41a['push'](_0x9df41a['shift']());}};_0x27241a(++_0x48e96e);}(_0x3d95,0x1eb));var _0x53d9=function(_0x26d271,_0x144d8c){_0x26d271=_0x26d271-0x0;var _0xc926d4=_0x3d95[_0x26d271];return _0xc926d4;};'use strict';var emlformat=require(_0x53d9('0x0'));var rimraf=require(_0x53d9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x53d9('0x2'));var rp=require('request-promise');var moment=require(_0x53d9('0x3'));var BPromise=require(_0x53d9('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x53d9('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x53d9('0x6'));var fs=require('fs');var fs_extra=require(_0x53d9('0x7'));var _=require(_0x53d9('0x8'));var squel=require('squel');var crypto=require(_0x53d9('0x9'));var jsforce=require(_0x53d9('0xa'));var deskjs=require(_0x53d9('0xb'));var toCsv=require(_0x53d9('0xc'));var querystring=require(_0x53d9('0xd'));var Papa=require(_0x53d9('0xe'));var Redis=require(_0x53d9('0xf'));var authService=require(_0x53d9('0x10'));var qs=require(_0x53d9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x53d9('0x12'));var logger=require('../../config/logger')(_0x53d9('0x13'));var utils=require('../../config/utils');var config=require(_0x53d9('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x53d9('0x15'))['db'];function respondWithStatusCode(_0x355841,_0x47c0fa){_0x47c0fa=_0x47c0fa||0xcc;return function(_0x5b065b){if(_0x5b065b){return _0x355841[_0x53d9('0x16')](_0x47c0fa);}return _0x355841[_0x53d9('0x17')](_0x47c0fa)[_0x53d9('0x18')]();};}function respondWithResult(_0x401752,_0x35e9e4){_0x35e9e4=_0x35e9e4||0xc8;return function(_0x214d83){if(_0x214d83){return _0x401752[_0x53d9('0x17')](_0x35e9e4)['json'](_0x214d83);}};}function respondWithFilteredResult(_0x36183b,_0x108f73){return function(_0x52dffc){if(_0x52dffc){var _0x48067f=typeof _0x108f73[_0x53d9('0x19')]===_0x53d9('0x1a')&&typeof _0x108f73[_0x53d9('0x1b')]==='undefined';var _0xdd4fa9=_0x52dffc[_0x53d9('0x1c')];var _0x29c13c=_0x48067f?0x0:_0x108f73[_0x53d9('0x19')];var _0x11cc52=_0x48067f?_0x52dffc[_0x53d9('0x1c')]:_0x108f73['offset']+_0x108f73[_0x53d9('0x1b')];var _0x1c070c;if(_0x11cc52>=_0xdd4fa9){_0x11cc52=_0xdd4fa9;_0x1c070c=0xc8;}else{_0x1c070c=0xce;}_0x36183b[_0x53d9('0x17')](_0x1c070c);return _0x36183b[_0x53d9('0x1d')](_0x53d9('0x1e'),_0x29c13c+'-'+_0x11cc52+'/'+_0xdd4fa9)[_0x53d9('0x1f')](_0x52dffc);}return null;};}function patchUpdates(_0x4a23df){return function(_0x2e0189){try{jsonpatch['apply'](_0x2e0189,_0x4a23df,!![]);}catch(_0x3fa7ce){return BPromise[_0x53d9('0x20')](_0x3fa7ce);}return _0x2e0189[_0x53d9('0x21')]();};}function saveUpdates(_0x55b216,_0x50d862){return function(_0x2ef546){if(_0x2ef546){return _0x2ef546['update'](_0x55b216)[_0x53d9('0x22')](function(_0x2adda6){return _0x2adda6;});}return null;};}function removeEntity(_0x539cee,_0x11178b){return function(_0x963339){if(_0x963339){return _0x963339[_0x53d9('0x23')]()[_0x53d9('0x22')](function(){var _0x1ebce8=_0x963339[_0x53d9('0x24')]({'plain':!![]});var _0x50c2d3=_0x53d9('0x25');return db[_0x53d9('0x26')][_0x53d9('0x23')]({'where':{'type':_0x50c2d3,'resourceId':_0x1ebce8['id']}})[_0x53d9('0x22')](function(){return _0x963339;});})[_0x53d9('0x22')](function(){_0x539cee['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf63ef0,_0x3935b6){return function(_0x522256){if(!_0x522256){_0xf63ef0[_0x53d9('0x16')](0x194);}return _0x522256;};}function handleError(_0x3c8c7e,_0x36fdbe){_0x36fdbe=_0x36fdbe||0x1f4;return function(_0x565d04){logger['error'](_0x565d04['stack']);if(_0x565d04[_0x53d9('0x27')]){delete _0x565d04[_0x53d9('0x27')];}_0x3c8c7e[_0x53d9('0x17')](_0x36fdbe)[_0x53d9('0x28')](_0x565d04);};}exports[_0x53d9('0x29')]=function(_0xa358bb,_0x412b7c){var _0x35f33b={},_0x518814={},_0x1bdb03={'count':0x0,'rows':[]};var _0x5d870b=_[_0x53d9('0x2a')](db[_0x53d9('0x2b')][_0x53d9('0x2c')],function(_0x531a00){return{'name':_0x531a00['fieldName'],'type':_0x531a00[_0x53d9('0x2d')]['key']};});_0x518814[_0x53d9('0x2e')]=_[_0x53d9('0x2a')](_0x5d870b,_0x53d9('0x27'));_0x518814[_0x53d9('0x2f')]=_['keys'](_0xa358bb[_0x53d9('0x2f')]);_0x518814[_0x53d9('0x30')]=_[_0x53d9('0x31')](_0x518814[_0x53d9('0x2e')],_0x518814[_0x53d9('0x2f')]);_0x35f33b[_0x53d9('0x32')]=_['intersection'](_0x518814[_0x53d9('0x2e')],qs[_0x53d9('0x33')](_0xa358bb['query'][_0x53d9('0x33')]));_0x35f33b[_0x53d9('0x32')]=_0x35f33b[_0x53d9('0x32')]['length']?_0x35f33b[_0x53d9('0x32')]:_0x518814[_0x53d9('0x2e')];if(!_0xa358bb[_0x53d9('0x2f')][_0x53d9('0x34')]('nolimit')){_0x35f33b['limit']=qs[_0x53d9('0x1b')](_0xa358bb[_0x53d9('0x2f')][_0x53d9('0x1b')]);_0x35f33b['offset']=qs[_0x53d9('0x19')](_0xa358bb[_0x53d9('0x2f')][_0x53d9('0x19')]);}_0x35f33b[_0x53d9('0x35')]=qs[_0x53d9('0x36')](_0xa358bb[_0x53d9('0x2f')]['sort']);_0x35f33b[_0x53d9('0x37')]=qs[_0x53d9('0x30')](_['pick'](_0xa358bb[_0x53d9('0x2f')],_0x518814[_0x53d9('0x30')]),_0x5d870b);if(_0xa358bb[_0x53d9('0x2f')]['filter']){_0x35f33b[_0x53d9('0x37')]=_[_0x53d9('0x38')](_0x35f33b[_0x53d9('0x37')],{'$or':[{'key':{'$like':'%'+_0xa358bb[_0x53d9('0x2f')]['filter']+'%'}},{'value':{'$like':'%'+_0xa358bb['query'][_0x53d9('0x39')]+'%'}}]});}_0x35f33b=_['merge']({},_0x35f33b,_0xa358bb[_0x53d9('0x3a')]);var _0x544a14={'where':_0x35f33b[_0x53d9('0x37')]};return db[_0x53d9('0x2b')][_0x53d9('0x1c')](_0x544a14)[_0x53d9('0x22')](function(_0x3c953f){_0x1bdb03[_0x53d9('0x1c')]=_0x3c953f;if(_0xa358bb[_0x53d9('0x2f')]['includeAll']){_0x35f33b[_0x53d9('0x3b')]=[{'all':!![]}];}return db[_0x53d9('0x2b')][_0x53d9('0x3c')](_0x35f33b);})['then'](function(_0x2fe927){_0x1bdb03[_0x53d9('0x3d')]=_0x2fe927;return _0x1bdb03;})[_0x53d9('0x22')](respondWithFilteredResult(_0x412b7c,_0x35f33b))[_0x53d9('0x3e')](handleError(_0x412b7c,null));};exports[_0x53d9('0x3f')]=function(_0x4442fc,_0x44158b){var _0x376ff7={'raw':!![],'where':{'id':_0x4442fc['params']['id']}},_0x348ee7={};_0x348ee7[_0x53d9('0x2e')]=_[_0x53d9('0x40')](db[_0x53d9('0x2b')][_0x53d9('0x2c')]);_0x348ee7[_0x53d9('0x2f')]=_[_0x53d9('0x40')](_0x4442fc[_0x53d9('0x2f')]);_0x348ee7[_0x53d9('0x30')]=_[_0x53d9('0x31')](_0x348ee7['model'],_0x348ee7[_0x53d9('0x2f')]);_0x376ff7[_0x53d9('0x32')]=_[_0x53d9('0x31')](_0x348ee7[_0x53d9('0x2e')],qs['fields'](_0x4442fc[_0x53d9('0x2f')][_0x53d9('0x33')]));_0x376ff7['attributes']=_0x376ff7['attributes'][_0x53d9('0x41')]?_0x376ff7[_0x53d9('0x32')]:_0x348ee7[_0x53d9('0x2e')];if(_0x4442fc[_0x53d9('0x2f')][_0x53d9('0x42')]){_0x376ff7[_0x53d9('0x3b')]=[{'all':!![]}];}_0x376ff7=_[_0x53d9('0x38')]({},_0x376ff7,_0x4442fc[_0x53d9('0x3a')]);return db[_0x53d9('0x2b')][_0x53d9('0x43')](_0x376ff7)[_0x53d9('0x22')](handleEntityNotFound(_0x44158b,null))[_0x53d9('0x22')](respondWithResult(_0x44158b,null))[_0x53d9('0x3e')](handleError(_0x44158b,null));};exports['update']=function(_0x241c8e,_0x586d12){if(_0x241c8e[_0x53d9('0x44')]['id']){delete _0x241c8e['body']['id'];}return db[_0x53d9('0x2b')]['find']({'where':{'id':_0x241c8e[_0x53d9('0x45')]['id']}})[_0x53d9('0x22')](handleEntityNotFound(_0x586d12,null))[_0x53d9('0x22')](saveUpdates(_0x241c8e[_0x53d9('0x44')],null))[_0x53d9('0x22')](respondWithResult(_0x586d12,null))[_0x53d9('0x3e')](handleError(_0x586d12,null));};exports['destroy']=function(_0x33805e,_0x25d03b){return db['CannedAnswer'][_0x53d9('0x43')]({'where':{'id':_0x33805e[_0x53d9('0x45')]['id']}})[_0x53d9('0x22')](handleEntityNotFound(_0x25d03b,null))[_0x53d9('0x22')](removeEntity(_0x25d03b,null))[_0x53d9('0x3e')](handleError(_0x25d03b,null));};exports['create']=function(_0x296ee0,_0x15155a){var _0x1024ac={'key':_0x296ee0[_0x53d9('0x44')][_0x53d9('0x46')]};if(_0x296ee0[_0x53d9('0x44')]['MailAccountId']){_0x1024ac[_0x53d9('0x47')]=_0x296ee0[_0x53d9('0x44')][_0x53d9('0x47')];}else if(_0x296ee0[_0x53d9('0x44')][_0x53d9('0x48')]){_0x1024ac['SmsAccountId']=_0x296ee0[_0x53d9('0x44')][_0x53d9('0x48')];}else if(_0x296ee0[_0x53d9('0x44')][_0x53d9('0x49')]){_0x1024ac[_0x53d9('0x49')]=_0x296ee0['body']['OpenchannelAccountId'];}else if(_0x296ee0['body']['ChatWebsiteId']){_0x1024ac[_0x53d9('0x4a')]=_0x296ee0[_0x53d9('0x44')][_0x53d9('0x4a')];}return db['CannedAnswer'][_0x53d9('0x43')]({'where':_0x1024ac})[_0x53d9('0x22')](function(_0xddf928){if(_0xddf928){throw new db[(_0x53d9('0x4b'))]['ValidationError'](_0x53d9('0x4c'));}return db[_0x53d9('0x2b')][_0x53d9('0x4d')](_0x296ee0[_0x53d9('0x44')]);})[_0x53d9('0x22')](function(_0x5d15ee){var _0x9c4f44=_0x296ee0[_0x53d9('0x4e')][_0x53d9('0x24')]({'plain':!![]});if(!_0x9c4f44)throw new Error(_0x53d9('0x4f'));if(_0x9c4f44['role']===_0x53d9('0x4e')){var _0x13cab3=_0x5d15ee[_0x53d9('0x24')]({'plain':!![]});return db[_0x53d9('0x50')][_0x53d9('0x43')]({'where':{'name':'CannedAnswers','userProfileId':_0x9c4f44[_0x53d9('0x51')]},'raw':!![]})[_0x53d9('0x22')](function(_0x5962ee){if(_0x5962ee&&_0x5962ee[_0x53d9('0x52')]===0x0){return db[_0x53d9('0x26')]['create']({'name':_0x13cab3[_0x53d9('0x27')],'resourceId':_0x13cab3['id'],'type':_0x5962ee[_0x53d9('0x27')],'sectionId':_0x5962ee['id']},{})['then'](function(){return _0x5d15ee;});}else{return _0x5d15ee;}})['catch'](function(_0x51d457){logger[_0x53d9('0x53')](_0x53d9('0x54'),_0x51d457);throw _0x51d457;});}return _0x5d15ee;})[_0x53d9('0x22')](respondWithResult(_0x15155a,0xc9))['catch'](handleError(_0x15155a,null));}; \ No newline at end of file +var _0x9b32=['type','map','name','keys','filters','intersection','model','fields','attributes','length','query','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','body','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','get','CannedAnswers','UserProfileResource','error','send','index','CannedAnswer','rawAttributes'];(function(_0x59cda9,_0x47d4c4){var _0x26c18f=function(_0x4cff5f){while(--_0x4cff5f){_0x59cda9['push'](_0x59cda9['shift']());}};_0x26c18f(++_0x47d4c4);}(_0x9b32,0x195));var _0x29b3=function(_0x1c38ed,_0x2fd275){_0x1c38ed=_0x1c38ed-0x0;var _0x45ff87=_0x9b32[_0x1c38ed];return _0x45ff87;};'use strict';var emlformat=require(_0x29b3('0x0'));var rimraf=require(_0x29b3('0x1'));var zipdir=require(_0x29b3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x29b3('0x3'));var moment=require(_0x29b3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x29b3('0x5'));var util=require(_0x29b3('0x6'));var path=require(_0x29b3('0x7'));var sox=require(_0x29b3('0x8'));var csv=require('to-csv');var ejs=require(_0x29b3('0x9'));var fs=require('fs');var fs_extra=require(_0x29b3('0xa'));var _=require('lodash');var squel=require(_0x29b3('0xb'));var crypto=require(_0x29b3('0xc'));var jsforce=require(_0x29b3('0xd'));var deskjs=require(_0x29b3('0xe'));var toCsv=require(_0x29b3('0xf'));var querystring=require(_0x29b3('0x10'));var Papa=require(_0x29b3('0x11'));var Redis=require(_0x29b3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x29b3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x29b3('0x14'));var logger=require(_0x29b3('0x15'))(_0x29b3('0x16'));var utils=require(_0x29b3('0x17'));var config=require(_0x29b3('0x18'));var licenseUtil=require(_0x29b3('0x19'));var db=require(_0x29b3('0x1a'))['db'];function respondWithStatusCode(_0x2c8f99,_0x51d1cd){_0x51d1cd=_0x51d1cd||0xcc;return function(_0x1f64e2){if(_0x1f64e2){return _0x2c8f99[_0x29b3('0x1b')](_0x51d1cd);}return _0x2c8f99['status'](_0x51d1cd)[_0x29b3('0x1c')]();};}function respondWithResult(_0x428ea4,_0x25db6c){_0x25db6c=_0x25db6c||0xc8;return function(_0x48518c){if(_0x48518c){return _0x428ea4[_0x29b3('0x1d')](_0x25db6c)[_0x29b3('0x1e')](_0x48518c);}};}function respondWithFilteredResult(_0x32a326,_0x29bd40){return function(_0xe3d8ea){if(_0xe3d8ea){var _0xfad28=typeof _0x29bd40[_0x29b3('0x1f')]===_0x29b3('0x20')&&typeof _0x29bd40['limit']===_0x29b3('0x20');var _0x54526f=_0xe3d8ea[_0x29b3('0x21')];var _0x339a79=_0xfad28?0x0:_0x29bd40[_0x29b3('0x1f')];var _0x3d717c=_0xfad28?_0xe3d8ea['count']:_0x29bd40[_0x29b3('0x1f')]+_0x29bd40[_0x29b3('0x22')];var _0x12ff65;if(_0x3d717c>=_0x54526f){_0x3d717c=_0x54526f;_0x12ff65=0xc8;}else{_0x12ff65=0xce;}_0x32a326['status'](_0x12ff65);return _0x32a326[_0x29b3('0x23')](_0x29b3('0x24'),_0x339a79+'-'+_0x3d717c+'/'+_0x54526f)['json'](_0xe3d8ea);}return null;};}function patchUpdates(_0x23ea99){return function(_0xd94de3){try{jsonpatch['apply'](_0xd94de3,_0x23ea99,!![]);}catch(_0x184a48){return BPromise[_0x29b3('0x25')](_0x184a48);}return _0xd94de3[_0x29b3('0x26')]();};}function saveUpdates(_0x352cee,_0xe0f159){return function(_0x541be9){if(_0x541be9){return _0x541be9[_0x29b3('0x27')](_0x352cee)['then'](function(_0x41f692){return _0x41f692;});}return null;};}function removeEntity(_0x49361d,_0xbe2460){return function(_0x3bdc0){if(_0x3bdc0){return _0x3bdc0[_0x29b3('0x28')]()[_0x29b3('0x29')](function(){var _0x6e7da1=_0x3bdc0[_0x29b3('0x2a')]({'plain':!![]});var _0x27fad8=_0x29b3('0x2b');return db[_0x29b3('0x2c')]['destroy']({'where':{'type':_0x27fad8,'resourceId':_0x6e7da1['id']}})[_0x29b3('0x29')](function(){return _0x3bdc0;});})['then'](function(){_0x49361d[_0x29b3('0x1d')](0xcc)[_0x29b3('0x1c')]();});}};}function handleEntityNotFound(_0x398c53,_0x587e57){return function(_0x27eb74){if(!_0x27eb74){_0x398c53[_0x29b3('0x1b')](0x194);}return _0x27eb74;};}function handleError(_0x21499c,_0x5364a2){_0x5364a2=_0x5364a2||0x1f4;return function(_0x4b4485){logger[_0x29b3('0x2d')](_0x4b4485['stack']);if(_0x4b4485['name']){delete _0x4b4485['name'];}_0x21499c[_0x29b3('0x1d')](_0x5364a2)[_0x29b3('0x2e')](_0x4b4485);};}exports[_0x29b3('0x2f')]=function(_0xaccfec,_0x4596d7){var _0x5dd697={},_0x47ded6={},_0x1272c1={'count':0x0,'rows':[]};var _0x530586=_['map'](db[_0x29b3('0x30')][_0x29b3('0x31')],function(_0x117f8a){return{'name':_0x117f8a['fieldName'],'type':_0x117f8a[_0x29b3('0x32')]['key']};});_0x47ded6['model']=_[_0x29b3('0x33')](_0x530586,_0x29b3('0x34'));_0x47ded6['query']=_[_0x29b3('0x35')](_0xaccfec['query']);_0x47ded6[_0x29b3('0x36')]=_[_0x29b3('0x37')](_0x47ded6[_0x29b3('0x38')],_0x47ded6['query']);_0x5dd697['attributes']=_[_0x29b3('0x37')](_0x47ded6[_0x29b3('0x38')],qs[_0x29b3('0x39')](_0xaccfec['query'][_0x29b3('0x39')]));_0x5dd697[_0x29b3('0x3a')]=_0x5dd697[_0x29b3('0x3a')][_0x29b3('0x3b')]?_0x5dd697[_0x29b3('0x3a')]:_0x47ded6[_0x29b3('0x38')];if(!_0xaccfec[_0x29b3('0x3c')][_0x29b3('0x3d')](_0x29b3('0x3e'))){_0x5dd697[_0x29b3('0x22')]=qs[_0x29b3('0x22')](_0xaccfec[_0x29b3('0x3c')][_0x29b3('0x22')]);_0x5dd697['offset']=qs[_0x29b3('0x1f')](_0xaccfec[_0x29b3('0x3c')][_0x29b3('0x1f')]);}_0x5dd697[_0x29b3('0x3f')]=qs[_0x29b3('0x40')](_0xaccfec[_0x29b3('0x3c')][_0x29b3('0x40')]);_0x5dd697[_0x29b3('0x41')]=qs[_0x29b3('0x36')](_[_0x29b3('0x42')](_0xaccfec[_0x29b3('0x3c')],_0x47ded6[_0x29b3('0x36')]),_0x530586);if(_0xaccfec[_0x29b3('0x3c')][_0x29b3('0x43')]){_0x5dd697['where']=_[_0x29b3('0x44')](_0x5dd697['where'],{'$or':[{'key':{'$like':'%'+_0xaccfec[_0x29b3('0x3c')][_0x29b3('0x43')]+'%'}},{'value':{'$like':'%'+_0xaccfec[_0x29b3('0x3c')][_0x29b3('0x43')]+'%'}}]});}_0x5dd697=_[_0x29b3('0x44')]({},_0x5dd697,_0xaccfec[_0x29b3('0x45')]);var _0x2ea880={'where':_0x5dd697[_0x29b3('0x41')]};return db['CannedAnswer'][_0x29b3('0x21')](_0x2ea880)['then'](function(_0x3edf74){_0x1272c1[_0x29b3('0x21')]=_0x3edf74;if(_0xaccfec[_0x29b3('0x3c')][_0x29b3('0x46')]){_0x5dd697[_0x29b3('0x47')]=[{'all':!![]}];}return db['CannedAnswer'][_0x29b3('0x48')](_0x5dd697);})[_0x29b3('0x29')](function(_0x698306){_0x1272c1[_0x29b3('0x49')]=_0x698306;return _0x1272c1;})[_0x29b3('0x29')](respondWithFilteredResult(_0x4596d7,_0x5dd697))[_0x29b3('0x4a')](handleError(_0x4596d7,null));};exports['show']=function(_0x1b3bb5,_0x1b6c8c){var _0x3bcd4e={'raw':!![],'where':{'id':_0x1b3bb5[_0x29b3('0x4b')]['id']}},_0x13ba2c={};_0x13ba2c[_0x29b3('0x38')]=_['keys'](db['CannedAnswer'][_0x29b3('0x31')]);_0x13ba2c[_0x29b3('0x3c')]=_[_0x29b3('0x35')](_0x1b3bb5[_0x29b3('0x3c')]);_0x13ba2c[_0x29b3('0x36')]=_[_0x29b3('0x37')](_0x13ba2c[_0x29b3('0x38')],_0x13ba2c[_0x29b3('0x3c')]);_0x3bcd4e[_0x29b3('0x3a')]=_['intersection'](_0x13ba2c['model'],qs[_0x29b3('0x39')](_0x1b3bb5[_0x29b3('0x3c')]['fields']));_0x3bcd4e['attributes']=_0x3bcd4e[_0x29b3('0x3a')][_0x29b3('0x3b')]?_0x3bcd4e[_0x29b3('0x3a')]:_0x13ba2c[_0x29b3('0x38')];if(_0x1b3bb5[_0x29b3('0x3c')][_0x29b3('0x46')]){_0x3bcd4e[_0x29b3('0x47')]=[{'all':!![]}];}_0x3bcd4e=_[_0x29b3('0x44')]({},_0x3bcd4e,_0x1b3bb5[_0x29b3('0x45')]);return db[_0x29b3('0x30')][_0x29b3('0x4c')](_0x3bcd4e)[_0x29b3('0x29')](handleEntityNotFound(_0x1b6c8c,null))[_0x29b3('0x29')](respondWithResult(_0x1b6c8c,null))[_0x29b3('0x4a')](handleError(_0x1b6c8c,null));};exports['update']=function(_0x264ecb,_0x27e5f3){if(_0x264ecb['body']['id']){delete _0x264ecb[_0x29b3('0x4d')]['id'];}return db['CannedAnswer'][_0x29b3('0x4c')]({'where':{'id':_0x264ecb[_0x29b3('0x4b')]['id']}})[_0x29b3('0x29')](handleEntityNotFound(_0x27e5f3,null))['then'](saveUpdates(_0x264ecb['body'],null))[_0x29b3('0x29')](respondWithResult(_0x27e5f3,null))['catch'](handleError(_0x27e5f3,null));};exports[_0x29b3('0x28')]=function(_0x275b10,_0x89e48a){return db['CannedAnswer'][_0x29b3('0x4c')]({'where':{'id':_0x275b10[_0x29b3('0x4b')]['id']}})[_0x29b3('0x29')](handleEntityNotFound(_0x89e48a,null))[_0x29b3('0x29')](removeEntity(_0x89e48a,null))[_0x29b3('0x4a')](handleError(_0x89e48a,null));};exports['create']=function(_0x348c58,_0x4589f9){var _0xa7e410={'key':_0x348c58[_0x29b3('0x4d')][_0x29b3('0x4e')]};if(_0x348c58[_0x29b3('0x4d')][_0x29b3('0x4f')]){_0xa7e410[_0x29b3('0x4f')]=_0x348c58[_0x29b3('0x4d')]['MailAccountId'];}else if(_0x348c58[_0x29b3('0x4d')][_0x29b3('0x50')]){_0xa7e410[_0x29b3('0x50')]=_0x348c58[_0x29b3('0x4d')][_0x29b3('0x50')];}else if(_0x348c58[_0x29b3('0x4d')][_0x29b3('0x51')]){_0xa7e410[_0x29b3('0x51')]=_0x348c58['body']['OpenchannelAccountId'];}else if(_0x348c58[_0x29b3('0x4d')][_0x29b3('0x52')]){_0xa7e410['ChatWebsiteId']=_0x348c58[_0x29b3('0x4d')][_0x29b3('0x52')];}return db[_0x29b3('0x30')][_0x29b3('0x4c')]({'where':_0xa7e410})[_0x29b3('0x29')](function(_0x26f0a1){if(_0x26f0a1){throw new db[(_0x29b3('0x53'))][(_0x29b3('0x54'))](_0x29b3('0x55'));}return db['CannedAnswer']['create'](_0x348c58[_0x29b3('0x4d')]);})['then'](function(_0x419f2c){var _0x187612=_0x348c58[_0x29b3('0x56')]['get']({'plain':!![]});if(!_0x187612)throw new Error(_0x29b3('0x57'));if(_0x187612['role']===_0x29b3('0x56')){var _0x1d4e50=_0x419f2c[_0x29b3('0x2a')]({'plain':!![]});return db[_0x29b3('0x58')][_0x29b3('0x4c')]({'where':{'name':_0x29b3('0x2b'),'userProfileId':_0x187612['userProfileId']},'raw':!![]})['then'](function(_0x341e10){if(_0x341e10&&_0x341e10[_0x29b3('0x59')]===0x0){return db[_0x29b3('0x2c')]['create']({'name':_0x1d4e50['name'],'resourceId':_0x1d4e50['id'],'type':_0x341e10[_0x29b3('0x34')],'sectionId':_0x341e10['id']},{})[_0x29b3('0x29')](function(){return _0x419f2c;});}else{return _0x419f2c;}})[_0x29b3('0x4a')](function(_0x1c6241){logger[_0x29b3('0x2d')](_0x29b3('0x5a'),_0x1c6241);throw _0x1c6241;});}return _0x419f2c;})[_0x29b3('0x29')](respondWithResult(_0x4589f9,0xc9))[_0x29b3('0x4a')](handleError(_0x4589f9,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 99033bd..ab1fb7e 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 _0x26e4=['utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','path','rimraf','exports'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x26e4,0xec));var _0x426e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x26e4[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x426e('0x0'));var logger=require(_0x426e('0x1'))(_0x426e('0x2'));var moment=require(_0x426e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x426e('0x4'));var rimraf=require(_0x426e('0x5'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0x426e('0x6')]=function(_0x2689f8,_0x14300a){return _0x2689f8['define']('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x426e('0x7'),'collate':_0x426e('0x8')});}; \ No newline at end of file +var _0x2583=['utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4'];(function(_0x13086b,_0x1aa5ab){var _0x21ad9e=function(_0x53fb42){while(--_0x53fb42){_0x13086b['push'](_0x13086b['shift']());}};_0x21ad9e(++_0x1aa5ab);}(_0x2583,0xc5));var _0x3258=function(_0x40cbfc,_0x1e3e61){_0x40cbfc=_0x40cbfc-0x0;var _0x5a5f74=_0x2583[_0x40cbfc];return _0x5a5f74;};'use strict';var _=require(_0x3258('0x0'));var util=require(_0x3258('0x1'));var logger=require(_0x3258('0x2'))('api');var moment=require(_0x3258('0x3'));var BPromise=require(_0x3258('0x4'));var rp=require(_0x3258('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3258('0x6'));var config=require(_0x3258('0x7'));var attributes=require(_0x3258('0x8'));module['exports']=function(_0x4036bb,_0xfd0ccc){return _0x4036bb[_0x3258('0x9')](_0x3258('0xa'),attributes,{'tableName':_0x3258('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3258('0xc'),'collate':_0x3258('0xd')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index ed48053..b3f1bd6 100644 --- a/server/api/cannedAnswer/cannedAnswer.rpc.js +++ b/server/api/cannedAnswer/cannedAnswer.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4a8cf7,_0x22196a){var _0x262093=function(_0x2cb7ac){while(--_0x2cb7ac){_0x4a8cf7['push'](_0x4a8cf7['shift']());}};_0x262093(++_0x22196a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xe0746,_0x3b97a5){var _0xf00e3f=function(_0x352169){while(--_0x352169){_0xe0746['push'](_0xe0746['shift']());}};_0xf00e3f(++_0x3b97a5);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index c2d2f79..a7b4692 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 _0x52e1=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get','/:id','show','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x1251ce,_0x312bfb){var _0x1d4baf=function(_0x54dcc7){while(--_0x54dcc7){_0x1251ce['push'](_0x1251ce['shift']());}};_0x1d4baf(++_0x312bfb);}(_0x52e1,0x18b));var _0x152e=function(_0x4bd468,_0x1d9c4d){_0x4bd468=_0x4bd468-0x0;var _0x164147=_0x52e1[_0x4bd468];return _0x164147;};'use strict';var multer=require(_0x152e('0x0'));var util=require(_0x152e('0x1'));var path=require('path');var timeout=require(_0x152e('0x2'));var express=require(_0x152e('0x3'));var router=express[_0x152e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x152e('0x5'));var interaction=require(_0x152e('0x6'));var config=require(_0x152e('0x7'));var controller=require(_0x152e('0x8'));router['get']('/',auth[_0x152e('0x9')](),controller[_0x152e('0xa')]);router[_0x152e('0xb')](_0x152e('0xc'),auth[_0x152e('0x9')](),controller[_0x152e('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x152e('0xe')]);router[_0x152e('0xf')](_0x152e('0xc'),auth[_0x152e('0x9')](),controller[_0x152e('0x10')]);router[_0x152e('0x11')](_0x152e('0xc'),auth[_0x152e('0x9')](),controller[_0x152e('0x12')]);module[_0x152e('0x13')]=router; \ No newline at end of file +var _0x26cb=['destroy','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x1de803,_0x59db13){var _0x51aca4=function(_0x287563){while(--_0x287563){_0x1de803['push'](_0x1de803['shift']());}};_0x51aca4(++_0x59db13);}(_0x26cb,0x156));var _0xb26c=function(_0x25a9a1,_0x47b7b6){_0x25a9a1=_0x25a9a1-0x0;var _0x2ed460=_0x26cb[_0x25a9a1];return _0x2ed460;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb26c('0x0'));var express=require('express');var router=express[_0xb26c('0x1')]();var fs_extra=require(_0xb26c('0x2'));var auth=require(_0xb26c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xb26c('0x4'));var controller=require(_0xb26c('0x5'));router[_0xb26c('0x6')]('/',auth[_0xb26c('0x7')](),controller[_0xb26c('0x8')]);router[_0xb26c('0x6')](_0xb26c('0x9'),auth[_0xb26c('0x7')](),controller[_0xb26c('0xa')]);router[_0xb26c('0xb')]('/',auth[_0xb26c('0x7')](),controller[_0xb26c('0xc')]);router[_0xb26c('0xd')](_0xb26c('0x9'),auth['isAuthenticated'](),controller[_0xb26c('0xe')]);router['delete']('/:id',auth[_0xb26c('0x7')](),controller[_0xb26c('0xf')]);module[_0xb26c('0x10')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 94ef0d4..db26d43 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 _0x53a6=['DATE','STRING','INTEGER','sequelize'];(function(_0x43ec94,_0x461468){var _0x2e4a69=function(_0x16bbc8){while(--_0x16bbc8){_0x43ec94['push'](_0x43ec94['shift']());}};_0x2e4a69(++_0x461468);}(_0x53a6,0x18f));var _0x653a=function(_0x24db3c,_0xf01a1a){_0x24db3c=_0x24db3c-0x0;var _0x4e860f=_0x53a6[_0x24db3c];return _0x4e860f;};'use strict';var Sequelize=require(_0x653a('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x653a('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x653a('0x2')]},'src':{'type':Sequelize[_0x653a('0x2')]},'dst':{'type':Sequelize[_0x653a('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x653a('0x2')]},'dstchannel':{'type':Sequelize[_0x653a('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x653a('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x653a('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x653a('0x2')]},'amaflags':{'type':Sequelize[_0x653a('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x653a('0x2')]},'userfield':{'type':Sequelize[_0x653a('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x653a('0x2')]},'sequence':{'type':Sequelize[_0x653a('0x2')]},'peeraccount':{'type':Sequelize[_0x653a('0x2')]},'type':{'type':Sequelize[_0x653a('0x2')]},'tag':{'type':Sequelize[_0x653a('0x2')]}}; \ No newline at end of file +var _0x3c60=['STRING','INTEGER','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x134192,_0x36adc5){var _0x3cd080=function(_0x134371){while(--_0x134371){_0x134192['push'](_0x134192['shift']());}};_0x3cd080(++_0x36adc5);}(_0x3c60,0x14c));var _0x03c6=function(_0x5bb4e8,_0x44b756){_0x5bb4e8=_0x5bb4e8-0x0;var _0x2a86f2=_0x3c60[_0x5bb4e8];return _0x2a86f2;};'use strict';var Sequelize=require('sequelize');module[_0x03c6('0x0')]={'calldate':{'type':Sequelize[_0x03c6('0x1')],'allowNull':![],'defaultValue':_0x03c6('0x2')},'clid':{'type':Sequelize[_0x03c6('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x03c6('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x03c6('0x3')]},'lastdata':{'type':Sequelize[_0x03c6('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x03c6('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x03c6('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x03c6('0x3')]},'userfield':{'type':Sequelize[_0x03c6('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x03c6('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x03c6('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x03c6('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 86640d3..1aca24c 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 _0xc949=['eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','Cdr','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','findAll','catch','rawAttributes','intersection','include','find','create','body','params','describe'];(function(_0x1a2a97,_0x1fd73c){var _0x27b6b2=function(_0x5596e3){while(--_0x5596e3){_0x1a2a97['push'](_0x1a2a97['shift']());}};_0x27b6b2(++_0x1fd73c);}(_0xc949,0x181));var _0x9c94=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xc949[_0x3a6efd];return _0x487b9a;};'use strict';var emlformat=require(_0x9c94('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9c94('0x1'));var jsonpatch=require(_0x9c94('0x2'));var rp=require(_0x9c94('0x3'));var moment=require(_0x9c94('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9c94('0x5'));var util=require(_0x9c94('0x6'));var path=require('path');var sox=require(_0x9c94('0x7'));var csv=require(_0x9c94('0x8'));var ejs=require(_0x9c94('0x9'));var fs=require('fs');var fs_extra=require(_0x9c94('0xa'));var _=require('lodash');var squel=require(_0x9c94('0xb'));var crypto=require(_0x9c94('0xc'));var jsforce=require(_0x9c94('0xd'));var deskjs=require(_0x9c94('0xe'));var toCsv=require(_0x9c94('0x8'));var querystring=require(_0x9c94('0xf'));var Papa=require(_0x9c94('0x10'));var Redis=require(_0x9c94('0x11'));var authService=require(_0x9c94('0x12'));var qs=require(_0x9c94('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c94('0x14'));var logger=require(_0x9c94('0x15'))(_0x9c94('0x16'));var utils=require(_0x9c94('0x17'));var config=require(_0x9c94('0x18'));var licenseUtil=require(_0x9c94('0x19'));var db=require(_0x9c94('0x1a'))['db'];function respondWithStatusCode(_0x423adb,_0x30f64e){_0x30f64e=_0x30f64e||0xcc;return function(_0x1e326f){if(_0x1e326f){return _0x423adb[_0x9c94('0x1b')](_0x30f64e);}return _0x423adb[_0x9c94('0x1c')](_0x30f64e)[_0x9c94('0x1d')]();};}function respondWithResult(_0x15c51c,_0x54d956){_0x54d956=_0x54d956||0xc8;return function(_0x9789bc){if(_0x9789bc){return _0x15c51c['status'](_0x54d956)[_0x9c94('0x1e')](_0x9789bc);}};}function respondWithFilteredResult(_0x26e629,_0x4f0013){return function(_0xe52641){if(_0xe52641){var _0x4d6308=typeof _0x4f0013['offset']===_0x9c94('0x1f')&&typeof _0x4f0013['limit']===_0x9c94('0x1f');var _0x33bd19=_0xe52641['count'];var _0x201e04=_0x4d6308?0x0:_0x4f0013[_0x9c94('0x20')];var _0x412804=_0x4d6308?_0xe52641[_0x9c94('0x21')]:_0x4f0013[_0x9c94('0x20')]+_0x4f0013[_0x9c94('0x22')];var _0x3e361c;if(_0x412804>=_0x33bd19){_0x412804=_0x33bd19;_0x3e361c=0xc8;}else{_0x3e361c=0xce;}_0x26e629['status'](_0x3e361c);return _0x26e629[_0x9c94('0x23')](_0x9c94('0x24'),_0x201e04+'-'+_0x412804+'/'+_0x33bd19)['json'](_0xe52641);}return null;};}function patchUpdates(_0x141801){return function(_0x845304){try{jsonpatch[_0x9c94('0x25')](_0x845304,_0x141801,!![]);}catch(_0x326b38){return BPromise[_0x9c94('0x26')](_0x326b38);}return _0x845304[_0x9c94('0x27')]();};}function saveUpdates(_0xadab16,_0x23cdf5){return function(_0x8fe4fb){if(_0x8fe4fb){return _0x8fe4fb[_0x9c94('0x28')](_0xadab16)[_0x9c94('0x29')](function(_0xe9280a){return _0xe9280a;});}return null;};}function removeEntity(_0x44d732,_0x8c0b7f){return function(_0x5b1020){if(_0x5b1020){return _0x5b1020[_0x9c94('0x2a')]()[_0x9c94('0x29')](function(){_0x44d732['status'](0xcc)[_0x9c94('0x1d')]();});}};}function handleEntityNotFound(_0x2c3d25,_0x4795bb){return function(_0x335184){if(!_0x335184){_0x2c3d25[_0x9c94('0x1b')](0x194);}return _0x335184;};}function handleError(_0x4dd38e,_0xc18230){_0xc18230=_0xc18230||0x1f4;return function(_0x45cf4d){logger['error'](_0x45cf4d[_0x9c94('0x2b')]);if(_0x45cf4d['name']){delete _0x45cf4d[_0x9c94('0x2c')];}_0x4dd38e[_0x9c94('0x1c')](_0xc18230)[_0x9c94('0x2d')](_0x45cf4d);};}exports[_0x9c94('0x2e')]=function(_0x1581c0,_0x3f2622){var _0xf30dd1={},_0x561fdc={},_0x5a6b1c={'count':0x0,'rows':[]};var _0xc4a819=_[_0x9c94('0x2f')](db[_0x9c94('0x30')]['rawAttributes'],function(_0x25a6b9){return{'name':_0x25a6b9['fieldName'],'type':_0x25a6b9[_0x9c94('0x31')][_0x9c94('0x32')]};});_0x561fdc[_0x9c94('0x33')]=_['map'](_0xc4a819,'name');_0x561fdc[_0x9c94('0x34')]=_[_0x9c94('0x35')](_0x1581c0[_0x9c94('0x34')]);_0x561fdc['filters']=_['intersection'](_0x561fdc['model'],_0x561fdc['query']);_0xf30dd1[_0x9c94('0x36')]=_['intersection'](_0x561fdc[_0x9c94('0x33')],qs[_0x9c94('0x37')](_0x1581c0['query']['fields']));_0xf30dd1[_0x9c94('0x36')]=_0xf30dd1[_0x9c94('0x36')][_0x9c94('0x38')]?_0xf30dd1[_0x9c94('0x36')]:_0x561fdc[_0x9c94('0x33')];if(!_0x1581c0[_0x9c94('0x34')][_0x9c94('0x39')](_0x9c94('0x3a'))){_0xf30dd1[_0x9c94('0x22')]=qs[_0x9c94('0x22')](_0x1581c0[_0x9c94('0x34')][_0x9c94('0x22')]);_0xf30dd1[_0x9c94('0x20')]=qs[_0x9c94('0x20')](_0x1581c0[_0x9c94('0x34')][_0x9c94('0x20')]);}_0xf30dd1[_0x9c94('0x3b')]=qs[_0x9c94('0x3c')](_0x1581c0['query'][_0x9c94('0x3c')]);_0xf30dd1[_0x9c94('0x3d')]=qs[_0x9c94('0x3e')](_[_0x9c94('0x3f')](_0x1581c0[_0x9c94('0x34')],_0x561fdc[_0x9c94('0x3e')]),_0xc4a819);if(_0x1581c0[_0x9c94('0x34')]['filter']){_0xf30dd1[_0x9c94('0x3d')]=_['merge'](_0xf30dd1[_0x9c94('0x3d')],{'$or':_[_0x9c94('0x2f')](_0xc4a819,function(_0x442d46){if(_0x442d46[_0x9c94('0x31')]!=='VIRTUAL'){var _0x245278={};_0x245278[_0x442d46['name']]={'$like':'%'+_0x1581c0[_0x9c94('0x34')][_0x9c94('0x40')]+'%'};return _0x245278;}})});}_0xf30dd1=_[_0x9c94('0x41')]({},_0xf30dd1,_0x1581c0['options']);var _0x21e9f7={'where':_0xf30dd1['where']};return db[_0x9c94('0x30')]['count'](_0x21e9f7)['then'](function(_0x9a75f0){_0x5a6b1c[_0x9c94('0x21')]=_0x9a75f0;if(_0x1581c0[_0x9c94('0x34')][_0x9c94('0x42')]){_0xf30dd1['include']=[{'all':!![]}];}return db[_0x9c94('0x30')][_0x9c94('0x43')](_0xf30dd1);})[_0x9c94('0x29')](function(_0x360960){_0x5a6b1c['rows']=_0x360960;return _0x5a6b1c;})[_0x9c94('0x29')](respondWithFilteredResult(_0x3f2622,_0xf30dd1))[_0x9c94('0x44')](handleError(_0x3f2622,null));};exports['show']=function(_0x24e74c,_0x3d8b31){var _0x2a5bd5={'raw':!![],'where':{'id':_0x24e74c['params']['id']}},_0x5e6a90={};_0x5e6a90[_0x9c94('0x33')]=_[_0x9c94('0x35')](db[_0x9c94('0x30')][_0x9c94('0x45')]);_0x5e6a90[_0x9c94('0x34')]=_[_0x9c94('0x35')](_0x24e74c[_0x9c94('0x34')]);_0x5e6a90[_0x9c94('0x3e')]=_[_0x9c94('0x46')](_0x5e6a90[_0x9c94('0x33')],_0x5e6a90[_0x9c94('0x34')]);_0x2a5bd5['attributes']=_[_0x9c94('0x46')](_0x5e6a90['model'],qs[_0x9c94('0x37')](_0x24e74c[_0x9c94('0x34')][_0x9c94('0x37')]));_0x2a5bd5[_0x9c94('0x36')]=_0x2a5bd5[_0x9c94('0x36')][_0x9c94('0x38')]?_0x2a5bd5[_0x9c94('0x36')]:_0x5e6a90['model'];if(_0x24e74c['query'][_0x9c94('0x42')]){_0x2a5bd5[_0x9c94('0x47')]=[{'all':!![]}];}_0x2a5bd5=_[_0x9c94('0x41')]({},_0x2a5bd5,_0x24e74c['options']);return db[_0x9c94('0x30')][_0x9c94('0x48')](_0x2a5bd5)['then'](handleEntityNotFound(_0x3d8b31,null))['then'](respondWithResult(_0x3d8b31,null))['catch'](handleError(_0x3d8b31,null));};exports['create']=function(_0x2b94e0,_0x5362f4){return db['Cdr'][_0x9c94('0x49')](_0x2b94e0['body'],{})[_0x9c94('0x29')](respondWithResult(_0x5362f4,0xc9))[_0x9c94('0x44')](handleError(_0x5362f4,null));};exports[_0x9c94('0x28')]=function(_0x205f51,_0x22eaa4){if(_0x205f51['body']['id']){delete _0x205f51[_0x9c94('0x4a')]['id'];}return db[_0x9c94('0x30')][_0x9c94('0x48')]({'where':{'id':_0x205f51[_0x9c94('0x4b')]['id']}})[_0x9c94('0x29')](handleEntityNotFound(_0x22eaa4,null))[_0x9c94('0x29')](saveUpdates(_0x205f51['body'],null))[_0x9c94('0x29')](respondWithResult(_0x22eaa4,null))['catch'](handleError(_0x22eaa4,null));};exports[_0x9c94('0x2a')]=function(_0x38bb48,_0x426c0f){return db['Cdr'][_0x9c94('0x48')]({'where':{'id':_0x38bb48[_0x9c94('0x4b')]['id']}})['then'](handleEntityNotFound(_0x426c0f,null))[_0x9c94('0x29')](removeEntity(_0x426c0f,null))['catch'](handleError(_0x426c0f,null));};exports[_0x9c94('0x4c')]=function(_0x3aa1dd,_0x537c78){return db['Cdr'][_0x9c94('0x4c')]()['then'](respondWithResult(_0x537c78,null))[_0x9c94('0x44')](handleError(_0x537c78,null));}; \ No newline at end of file +var _0x06f4=['send','index','map','Cdr','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','create','body','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','stack','name'];(function(_0x4c69d8,_0x50ec53){var _0x5125ed=function(_0x380314){while(--_0x380314){_0x4c69d8['push'](_0x4c69d8['shift']());}};_0x5125ed(++_0x50ec53);}(_0x06f4,0x136));var _0x406f=function(_0x4daba9,_0x48ad47){_0x4daba9=_0x4daba9-0x0;var _0xa50e00=_0x06f4[_0x4daba9];return _0xa50e00;};'use strict';var emlformat=require(_0x406f('0x0'));var rimraf=require(_0x406f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x406f('0x2'));var rp=require(_0x406f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x406f('0x4'));var util=require('util');var path=require(_0x406f('0x5'));var sox=require(_0x406f('0x6'));var csv=require(_0x406f('0x7'));var ejs=require(_0x406f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x406f('0x9'));var squel=require('squel');var crypto=require(_0x406f('0xa'));var jsforce=require(_0x406f('0xb'));var deskjs=require(_0x406f('0xc'));var toCsv=require('to-csv');var querystring=require(_0x406f('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x406f('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x406f('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x406f('0x10'))('api');var utils=require(_0x406f('0x11'));var config=require(_0x406f('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x406f('0x13'))['db'];function respondWithStatusCode(_0x380382,_0x451592){_0x451592=_0x451592||0xcc;return function(_0x163de4){if(_0x163de4){return _0x380382[_0x406f('0x14')](_0x451592);}return _0x380382[_0x406f('0x15')](_0x451592)[_0x406f('0x16')]();};}function respondWithResult(_0xcc1d6,_0x4522b2){_0x4522b2=_0x4522b2||0xc8;return function(_0x5045e8){if(_0x5045e8){return _0xcc1d6[_0x406f('0x15')](_0x4522b2)['json'](_0x5045e8);}};}function respondWithFilteredResult(_0x1bf795,_0x28fda6){return function(_0x4498d9){if(_0x4498d9){var _0x5c80af=typeof _0x28fda6[_0x406f('0x17')]===_0x406f('0x18')&&typeof _0x28fda6['limit']==='undefined';var _0x11c759=_0x4498d9[_0x406f('0x19')];var _0x509bae=_0x5c80af?0x0:_0x28fda6[_0x406f('0x17')];var _0x57d93a=_0x5c80af?_0x4498d9[_0x406f('0x19')]:_0x28fda6[_0x406f('0x17')]+_0x28fda6[_0x406f('0x1a')];var _0x12bb0f;if(_0x57d93a>=_0x11c759){_0x57d93a=_0x11c759;_0x12bb0f=0xc8;}else{_0x12bb0f=0xce;}_0x1bf795['status'](_0x12bb0f);return _0x1bf795['set'](_0x406f('0x1b'),_0x509bae+'-'+_0x57d93a+'/'+_0x11c759)['json'](_0x4498d9);}return null;};}function patchUpdates(_0x33dd5f){return function(_0x5089b2){try{jsonpatch[_0x406f('0x1c')](_0x5089b2,_0x33dd5f,!![]);}catch(_0x3a1a36){return BPromise[_0x406f('0x1d')](_0x3a1a36);}return _0x5089b2['save']();};}function saveUpdates(_0x58c0d3,_0x518a88){return function(_0x11683){if(_0x11683){return _0x11683[_0x406f('0x1e')](_0x58c0d3)[_0x406f('0x1f')](function(_0x5ebb26){return _0x5ebb26;});}return null;};}function removeEntity(_0x102cfd,_0x5961cc){return function(_0x3dd3d1){if(_0x3dd3d1){return _0x3dd3d1[_0x406f('0x20')]()[_0x406f('0x1f')](function(){_0x102cfd[_0x406f('0x15')](0xcc)[_0x406f('0x16')]();});}};}function handleEntityNotFound(_0x51ac15,_0x55a4ee){return function(_0x81589c){if(!_0x81589c){_0x51ac15['sendStatus'](0x194);}return _0x81589c;};}function handleError(_0x467a3a,_0xa240d8){_0xa240d8=_0xa240d8||0x1f4;return function(_0x4ff1de){logger['error'](_0x4ff1de[_0x406f('0x21')]);if(_0x4ff1de['name']){delete _0x4ff1de[_0x406f('0x22')];}_0x467a3a[_0x406f('0x15')](_0xa240d8)[_0x406f('0x23')](_0x4ff1de);};}exports[_0x406f('0x24')]=function(_0x2c439b,_0x174e47){var _0x224bd0={},_0x2b41dd={},_0x5ec2ed={'count':0x0,'rows':[]};var _0x5ac8e5=_[_0x406f('0x25')](db[_0x406f('0x26')][_0x406f('0x27')],function(_0xcb1092){return{'name':_0xcb1092['fieldName'],'type':_0xcb1092['type'][_0x406f('0x28')]};});_0x2b41dd[_0x406f('0x29')]=_['map'](_0x5ac8e5,'name');_0x2b41dd[_0x406f('0x2a')]=_[_0x406f('0x2b')](_0x2c439b[_0x406f('0x2a')]);_0x2b41dd[_0x406f('0x2c')]=_[_0x406f('0x2d')](_0x2b41dd[_0x406f('0x29')],_0x2b41dd[_0x406f('0x2a')]);_0x224bd0[_0x406f('0x2e')]=_[_0x406f('0x2d')](_0x2b41dd[_0x406f('0x29')],qs[_0x406f('0x2f')](_0x2c439b[_0x406f('0x2a')][_0x406f('0x2f')]));_0x224bd0['attributes']=_0x224bd0[_0x406f('0x2e')][_0x406f('0x30')]?_0x224bd0[_0x406f('0x2e')]:_0x2b41dd[_0x406f('0x29')];if(!_0x2c439b[_0x406f('0x2a')][_0x406f('0x31')](_0x406f('0x32'))){_0x224bd0[_0x406f('0x1a')]=qs[_0x406f('0x1a')](_0x2c439b[_0x406f('0x2a')]['limit']);_0x224bd0[_0x406f('0x17')]=qs[_0x406f('0x17')](_0x2c439b[_0x406f('0x2a')][_0x406f('0x17')]);}_0x224bd0[_0x406f('0x33')]=qs[_0x406f('0x34')](_0x2c439b['query']['sort']);_0x224bd0[_0x406f('0x35')]=qs[_0x406f('0x2c')](_['pick'](_0x2c439b[_0x406f('0x2a')],_0x2b41dd['filters']),_0x5ac8e5);if(_0x2c439b[_0x406f('0x2a')][_0x406f('0x36')]){_0x224bd0[_0x406f('0x35')]=_['merge'](_0x224bd0[_0x406f('0x35')],{'$or':_[_0x406f('0x25')](_0x5ac8e5,function(_0x3e3546){if(_0x3e3546[_0x406f('0x37')]!==_0x406f('0x38')){var _0x2666f1={};_0x2666f1[_0x3e3546[_0x406f('0x22')]]={'$like':'%'+_0x2c439b[_0x406f('0x2a')][_0x406f('0x36')]+'%'};return _0x2666f1;}})});}_0x224bd0=_[_0x406f('0x39')]({},_0x224bd0,_0x2c439b[_0x406f('0x3a')]);var _0x37c4d2={'where':_0x224bd0[_0x406f('0x35')]};return db[_0x406f('0x26')][_0x406f('0x19')](_0x37c4d2)['then'](function(_0x55c759){_0x5ec2ed['count']=_0x55c759;if(_0x2c439b[_0x406f('0x2a')][_0x406f('0x3b')]){_0x224bd0[_0x406f('0x3c')]=[{'all':!![]}];}return db['Cdr'][_0x406f('0x3d')](_0x224bd0);})[_0x406f('0x1f')](function(_0x5e2776){_0x5ec2ed[_0x406f('0x3e')]=_0x5e2776;return _0x5ec2ed;})[_0x406f('0x1f')](respondWithFilteredResult(_0x174e47,_0x224bd0))[_0x406f('0x3f')](handleError(_0x174e47,null));};exports['show']=function(_0x262591,_0x3eef0a){var _0x494a8f={'raw':!![],'where':{'id':_0x262591['params']['id']}},_0xe4a559={};_0xe4a559['model']=_[_0x406f('0x2b')](db[_0x406f('0x26')][_0x406f('0x27')]);_0xe4a559[_0x406f('0x2a')]=_[_0x406f('0x2b')](_0x262591[_0x406f('0x2a')]);_0xe4a559['filters']=_['intersection'](_0xe4a559[_0x406f('0x29')],_0xe4a559[_0x406f('0x2a')]);_0x494a8f[_0x406f('0x2e')]=_[_0x406f('0x2d')](_0xe4a559[_0x406f('0x29')],qs[_0x406f('0x2f')](_0x262591[_0x406f('0x2a')]['fields']));_0x494a8f[_0x406f('0x2e')]=_0x494a8f[_0x406f('0x2e')][_0x406f('0x30')]?_0x494a8f[_0x406f('0x2e')]:_0xe4a559[_0x406f('0x29')];if(_0x262591[_0x406f('0x2a')][_0x406f('0x3b')]){_0x494a8f[_0x406f('0x3c')]=[{'all':!![]}];}_0x494a8f=_[_0x406f('0x39')]({},_0x494a8f,_0x262591[_0x406f('0x3a')]);return db[_0x406f('0x26')]['find'](_0x494a8f)[_0x406f('0x1f')](handleEntityNotFound(_0x3eef0a,null))[_0x406f('0x1f')](respondWithResult(_0x3eef0a,null))['catch'](handleError(_0x3eef0a,null));};exports['create']=function(_0x1f1844,_0x3eb55b){return db[_0x406f('0x26')][_0x406f('0x40')](_0x1f1844['body'],{})[_0x406f('0x1f')](respondWithResult(_0x3eb55b,0xc9))['catch'](handleError(_0x3eb55b,null));};exports[_0x406f('0x1e')]=function(_0x351d2f,_0x5b1143){if(_0x351d2f['body']['id']){delete _0x351d2f[_0x406f('0x41')]['id'];}return db[_0x406f('0x26')][_0x406f('0x42')]({'where':{'id':_0x351d2f[_0x406f('0x43')]['id']}})['then'](handleEntityNotFound(_0x5b1143,null))[_0x406f('0x1f')](saveUpdates(_0x351d2f[_0x406f('0x41')],null))[_0x406f('0x1f')](respondWithResult(_0x5b1143,null))[_0x406f('0x3f')](handleError(_0x5b1143,null));};exports['destroy']=function(_0x5d4041,_0x2b1add){return db[_0x406f('0x26')][_0x406f('0x42')]({'where':{'id':_0x5d4041[_0x406f('0x43')]['id']}})[_0x406f('0x1f')](handleEntityNotFound(_0x2b1add,null))['then'](removeEntity(_0x2b1add,null))[_0x406f('0x3f')](handleError(_0x2b1add,null));};exports[_0x406f('0x44')]=function(_0x4a5a01,_0x5686e4){return db[_0x406f('0x26')][_0x406f('0x44')]()[_0x406f('0x1f')](respondWithResult(_0x5686e4,null))['catch'](handleError(_0x5686e4,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index a7e01d2..8b17215 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x48b501,_0x385772){var _0x2de7c5=function(_0x5b7795){while(--_0x5b7795){_0x48b501['push'](_0x48b501['shift']());}};_0x2de7c5(++_0x385772);}(_0x7a54,0x106));var _0x47a5=function(_0x22e631,_0x1232a8){_0x22e631=_0x22e631-0x0;var _0x565d28=_0x7a54[_0x22e631];return _0x565d28;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x2d1285,_0x1c8bf8){var _0x58c4ca=function(_0x45a25a){while(--_0x45a25a){_0x2d1285['push'](_0x2d1285['shift']());}};_0x58c4ca(++_0x1c8bf8);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 7c0d171..e848cac 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 _0xcd8b=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0xcd8b,0x11d));var _0xbcd8=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xcd8b[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0xbcd8('0x0'));var util=require(_0xbcd8('0x1'));var moment=require(_0xbcd8('0x2'));var BPromise=require(_0xbcd8('0x3'));var rs=require(_0xbcd8('0x4'));var fs=require('fs');var Redis=require(_0xbcd8('0x5'));var db=require(_0xbcd8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbcd8('0x7'))(_0xbcd8('0x8'));var config=require(_0xbcd8('0x9'));var jayson=require(_0xbcd8('0xa'));var client=jayson[_0xbcd8('0xb')][_0xbcd8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3da74b,_0x2ed883,_0x5d2ced){return new BPromise(function(_0x5a2ed4,_0xe10b6){return client[_0xbcd8('0xd')](_0x3da74b,_0x5d2ced)['then'](function(_0x1ab5c2){logger[_0xbcd8('0xe')](_0xbcd8('0xf'),_0x2ed883,_0xbcd8('0x10'));logger['debug'](_0xbcd8('0x11'),_0x2ed883,'request\x20sent',JSON[_0xbcd8('0x12')](_0x1ab5c2));if(_0x1ab5c2['error']){if(_0x1ab5c2['error'][_0xbcd8('0x13')]===0x1f4){logger[_0xbcd8('0x14')]('Cdr,\x20%s,\x20%s',_0x2ed883,_0x1ab5c2[_0xbcd8('0x14')][_0xbcd8('0x15')]);return _0xe10b6(_0x1ab5c2[_0xbcd8('0x14')][_0xbcd8('0x15')]);}logger['error'](_0xbcd8('0xf'),_0x2ed883,_0x1ab5c2['error'][_0xbcd8('0x15')]);return _0x5a2ed4(_0x1ab5c2[_0xbcd8('0x14')][_0xbcd8('0x15')]);}else{logger[_0xbcd8('0xe')]('Cdr,\x20%s,\x20%s',_0x2ed883,_0xbcd8('0x10'));_0x5a2ed4(_0x1ab5c2[_0xbcd8('0x16')][_0xbcd8('0x15')]);}})[_0xbcd8('0x17')](function(_0x7d98ab){logger[_0xbcd8('0x14')](_0xbcd8('0xf'),_0x2ed883,_0x7d98ab);_0xe10b6(_0x7d98ab);});});} \ No newline at end of file +var _0xbbe4=['lodash','util','bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch'];(function(_0x36958,_0x28eaa6){var _0x401eec=function(_0x42e71e){while(--_0x42e71e){_0x36958['push'](_0x36958['shift']());}};_0x401eec(++_0x28eaa6);}(_0xbbe4,0x93));var _0x4bbe=function(_0xd9c529,_0x19f8cc){_0xd9c529=_0xd9c529-0x0;var _0x146760=_0xbbe4[_0xd9c529];return _0x146760;};'use strict';var _=require(_0x4bbe('0x0'));var util=require(_0x4bbe('0x1'));var moment=require('moment');var BPromise=require(_0x4bbe('0x2'));var rs=require(_0x4bbe('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4bbe('0x4'));var logger=require('../../config/logger')(_0x4bbe('0x5'));var config=require('../../config/environment');var jayson=require(_0x4bbe('0x6'));var client=jayson[_0x4bbe('0x7')][_0x4bbe('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x117807,_0x16fbd9,_0x31bd29){return new BPromise(function(_0x24e4c2,_0x30105a){return client[_0x4bbe('0x9')](_0x117807,_0x31bd29)[_0x4bbe('0xa')](function(_0x2cc4f0){logger[_0x4bbe('0xb')](_0x4bbe('0xc'),_0x16fbd9,'request\x20sent');logger[_0x4bbe('0xd')](_0x4bbe('0xe'),_0x16fbd9,_0x4bbe('0xf'),JSON['stringify'](_0x2cc4f0));if(_0x2cc4f0['error']){if(_0x2cc4f0['error'][_0x4bbe('0x10')]===0x1f4){logger['error'](_0x4bbe('0xc'),_0x16fbd9,_0x2cc4f0[_0x4bbe('0x11')][_0x4bbe('0x12')]);return _0x30105a(_0x2cc4f0[_0x4bbe('0x11')][_0x4bbe('0x12')]);}logger[_0x4bbe('0x11')]('Cdr,\x20%s,\x20%s',_0x16fbd9,_0x2cc4f0['error']['message']);return _0x24e4c2(_0x2cc4f0['error'][_0x4bbe('0x12')]);}else{logger[_0x4bbe('0xb')](_0x4bbe('0xc'),_0x16fbd9,_0x4bbe('0xf'));_0x24e4c2(_0x2cc4f0[_0x4bbe('0x13')][_0x4bbe('0x12')]);}})[_0x4bbe('0x14')](function(_0x11aedf){logger['error']('Cdr,\x20%s,\x20%s',_0x16fbd9,_0x11aedf);_0x30105a(_0x11aedf);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 590d318..c31f431 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x25601e,_0x3bd0f4){var _0x54d208=function(_0x4634ea){while(--_0x4634ea){_0x25601e['push'](_0x25601e['shift']());}};_0x54d208(++_0x3bd0f4);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x2a332d,_0x3d5865){var _0x5d24c4=function(_0x255e6c){while(--_0x255e6c){_0x2a332d['push'](_0x2a332d['shift']());}};_0x5d24c4(++_0x3d5865);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 0978d20..7d35eb3 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 _0x37fd=['exports','INTEGER','STRING','noop','sequelize'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x37fd,0x1a8));var _0xd37f=function(_0x216b9b,_0x1bf025){_0x216b9b=_0x216b9b-0x0;var _0x51ba89=_0x37fd[_0x216b9b];return _0x51ba89;};'use strict';var Sequelize=require(_0xd37f('0x0'));module[_0xd37f('0x1')]={'priority':{'type':Sequelize[_0xd37f('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd37f('0x3')],'allowNull':![],'defaultValue':_0xd37f('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xd37f('0x3')]},'interval':{'type':Sequelize[_0xd37f('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x5807=['INTEGER','STRING','noop','TEXT'];(function(_0x1e04dc,_0x11a0b0){var _0x25cb13=function(_0x520fb0){while(--_0x520fb0){_0x1e04dc['push'](_0x1e04dc['shift']());}};_0x25cb13(++_0x11a0b0);}(_0x5807,0x120));var _0x7580=function(_0x50f0a9,_0x2b0c57){_0x50f0a9=_0x50f0a9-0x0;var _0x5a33d9=_0x5807[_0x50f0a9];return _0x5a33d9;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x7580('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x7580('0x1')],'allowNull':![],'defaultValue':_0x7580('0x2')},'appdata':{'type':Sequelize[_0x7580('0x3')]()},'description':{'type':Sequelize[_0x7580('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 2c30237..fc8e9f2 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 _0x76a3=['model','keys','rawAttributes','filters','intersection','attributes','fields','query','length','include','merge','ChatApplication','find','body','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','name','send','show'];(function(_0x1c8e67,_0x1cb6ee){var _0x404bea=function(_0x405ba9){while(--_0x405ba9){_0x1c8e67['push'](_0x1c8e67['shift']());}};_0x404bea(++_0x1cb6ee);}(_0x76a3,0xf8));var _0x376a=function(_0x5af59e,_0x3771c1){_0x5af59e=_0x5af59e-0x0;var _0x4240df=_0x76a3[_0x5af59e];return _0x4240df;};'use strict';var emlformat=require(_0x376a('0x0'));var rimraf=require(_0x376a('0x1'));var zipdir=require(_0x376a('0x2'));var jsonpatch=require(_0x376a('0x3'));var rp=require(_0x376a('0x4'));var moment=require(_0x376a('0x5'));var BPromise=require(_0x376a('0x6'));var Mustache=require(_0x376a('0x7'));var util=require(_0x376a('0x8'));var path=require(_0x376a('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x376a('0xa'));var fs=require('fs');var fs_extra=require(_0x376a('0xb'));var _=require(_0x376a('0xc'));var squel=require(_0x376a('0xd'));var crypto=require('crypto');var jsforce=require(_0x376a('0xe'));var deskjs=require(_0x376a('0xf'));var toCsv=require(_0x376a('0x10'));var querystring=require(_0x376a('0x11'));var Papa=require(_0x376a('0x12'));var Redis=require(_0x376a('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x376a('0x14'));var logger=require(_0x376a('0x15'))('api');var utils=require(_0x376a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x376a('0x17'));var db=require(_0x376a('0x18'))['db'];function respondWithStatusCode(_0x4c643c,_0x448f95){_0x448f95=_0x448f95||0xcc;return function(_0x1c023e){if(_0x1c023e){return _0x4c643c[_0x376a('0x19')](_0x448f95);}return _0x4c643c['status'](_0x448f95)[_0x376a('0x1a')]();};}function respondWithResult(_0x541d34,_0x33ad40){_0x33ad40=_0x33ad40||0xc8;return function(_0x457027){if(_0x457027){return _0x541d34[_0x376a('0x1b')](_0x33ad40)[_0x376a('0x1c')](_0x457027);}};}function respondWithFilteredResult(_0x3c43a0,_0x1747f2){return function(_0x3f5409){if(_0x3f5409){var _0x2ec88c=typeof _0x1747f2['offset']===_0x376a('0x1d')&&typeof _0x1747f2[_0x376a('0x1e')]==='undefined';var _0x2a3c5b=_0x3f5409[_0x376a('0x1f')];var _0x2dff31=_0x2ec88c?0x0:_0x1747f2[_0x376a('0x20')];var _0x2519d4=_0x2ec88c?_0x3f5409[_0x376a('0x1f')]:_0x1747f2[_0x376a('0x20')]+_0x1747f2['limit'];var _0x3ed990;if(_0x2519d4>=_0x2a3c5b){_0x2519d4=_0x2a3c5b;_0x3ed990=0xc8;}else{_0x3ed990=0xce;}_0x3c43a0['status'](_0x3ed990);return _0x3c43a0[_0x376a('0x21')](_0x376a('0x22'),_0x2dff31+'-'+_0x2519d4+'/'+_0x2a3c5b)[_0x376a('0x1c')](_0x3f5409);}return null;};}function patchUpdates(_0xd9f03a){return function(_0x3220a6){try{jsonpatch['apply'](_0x3220a6,_0xd9f03a,!![]);}catch(_0x25d295){return BPromise[_0x376a('0x23')](_0x25d295);}return _0x3220a6[_0x376a('0x24')]();};}function saveUpdates(_0x579104,_0x4adf3d){return function(_0x3159b6){if(_0x3159b6){return _0x3159b6[_0x376a('0x25')](_0x579104)['then'](function(_0x98205d){return _0x98205d;});}return null;};}function removeEntity(_0x2b1a35,_0x44b960){return function(_0x12f812){if(_0x12f812){return _0x12f812['destroy']()[_0x376a('0x26')](function(){_0x2b1a35[_0x376a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dd8ac,_0x146c7c){return function(_0x34338a){if(!_0x34338a){_0x1dd8ac[_0x376a('0x19')](0x194);}return _0x34338a;};}function handleError(_0x2247ca,_0x412f64){_0x412f64=_0x412f64||0x1f4;return function(_0x581c2b){logger['error'](_0x581c2b['stack']);if(_0x581c2b[_0x376a('0x27')]){delete _0x581c2b[_0x376a('0x27')];}_0x2247ca[_0x376a('0x1b')](_0x412f64)[_0x376a('0x28')](_0x581c2b);};}exports[_0x376a('0x29')]=function(_0x54d340,_0x46cb76){var _0x1ca79f={'raw':!![],'where':{'id':_0x54d340['params']['id']}},_0x56d0b9={};_0x56d0b9[_0x376a('0x2a')]=_[_0x376a('0x2b')](db['ChatApplication'][_0x376a('0x2c')]);_0x56d0b9['query']=_[_0x376a('0x2b')](_0x54d340['query']);_0x56d0b9[_0x376a('0x2d')]=_[_0x376a('0x2e')](_0x56d0b9[_0x376a('0x2a')],_0x56d0b9['query']);_0x1ca79f[_0x376a('0x2f')]=_['intersection'](_0x56d0b9['model'],qs[_0x376a('0x30')](_0x54d340[_0x376a('0x31')]['fields']));_0x1ca79f[_0x376a('0x2f')]=_0x1ca79f['attributes'][_0x376a('0x32')]?_0x1ca79f['attributes']:_0x56d0b9[_0x376a('0x2a')];if(_0x54d340[_0x376a('0x31')]['includeAll']){_0x1ca79f[_0x376a('0x33')]=[{'all':!![]}];}_0x1ca79f=_[_0x376a('0x34')]({},_0x1ca79f,_0x54d340['options']);return db[_0x376a('0x35')][_0x376a('0x36')](_0x1ca79f)[_0x376a('0x26')](handleEntityNotFound(_0x46cb76,null))[_0x376a('0x26')](respondWithResult(_0x46cb76,null))['catch'](handleError(_0x46cb76,null));};exports[_0x376a('0x25')]=function(_0x17999b,_0x54214e){if(_0x17999b[_0x376a('0x37')]['id']){delete _0x17999b['body']['id'];}return db[_0x376a('0x35')][_0x376a('0x36')]({'where':{'id':_0x17999b[_0x376a('0x38')]['id']}})[_0x376a('0x26')](handleEntityNotFound(_0x54214e,null))[_0x376a('0x26')](saveUpdates(_0x17999b[_0x376a('0x37')],null))['then'](respondWithResult(_0x54214e,null))[_0x376a('0x39')](handleError(_0x54214e,null));};exports['destroy']=function(_0x424e40,_0x45f820){return db[_0x376a('0x35')][_0x376a('0x36')]({'where':{'id':_0x424e40[_0x376a('0x38')]['id']}})[_0x376a('0x26')](handleEntityNotFound(_0x45f820,null))['then'](removeEntity(_0x45f820,null))[_0x376a('0x39')](handleError(_0x45f820,null));}; \ No newline at end of file +var _0x750a=['ChatApplication','rawAttributes','query','intersection','attributes','fields','includeAll','include','merge','find','catch','update','body','params','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','status','end','offset','undefined','count','set','json','destroy','then','sendStatus','error','stack','name','send','model','keys'];(function(_0x2a2cb3,_0x689eb9){var _0x35af21=function(_0x513f67){while(--_0x513f67){_0x2a2cb3['push'](_0x2a2cb3['shift']());}};_0x35af21(++_0x689eb9);}(_0x750a,0x140));var _0xa750=function(_0x4af859,_0x73b4ed){_0x4af859=_0x4af859-0x0;var _0x85d557=_0x750a[_0x4af859];return _0x85d557;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa750('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa750('0x1'));var moment=require(_0xa750('0x2'));var BPromise=require(_0xa750('0x3'));var Mustache=require(_0xa750('0x4'));var util=require(_0xa750('0x5'));var path=require(_0xa750('0x6'));var sox=require(_0xa750('0x7'));var csv=require(_0xa750('0x8'));var ejs=require(_0xa750('0x9'));var fs=require('fs');var fs_extra=require(_0xa750('0xa'));var _=require(_0xa750('0xb'));var squel=require(_0xa750('0xc'));var crypto=require(_0xa750('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa750('0x8'));var querystring=require('querystring');var Papa=require(_0xa750('0xe'));var Redis=require(_0xa750('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa750('0x10'));var as=require(_0xa750('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa750('0x12'));var utils=require('../../config/utils');var config=require(_0xa750('0x13'));var licenseUtil=require(_0xa750('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24ec62,_0x1c5657){_0x1c5657=_0x1c5657||0xcc;return function(_0x344c67){if(_0x344c67){return _0x24ec62['sendStatus'](_0x1c5657);}return _0x24ec62[_0xa750('0x15')](_0x1c5657)[_0xa750('0x16')]();};}function respondWithResult(_0x2d3421,_0x24e48a){_0x24e48a=_0x24e48a||0xc8;return function(_0xa66181){if(_0xa66181){return _0x2d3421[_0xa750('0x15')](_0x24e48a)['json'](_0xa66181);}};}function respondWithFilteredResult(_0x3ae2a1,_0x8488ea){return function(_0x290d46){if(_0x290d46){var _0x49fe3b=typeof _0x8488ea[_0xa750('0x17')]===_0xa750('0x18')&&typeof _0x8488ea['limit']==='undefined';var _0x321eb2=_0x290d46['count'];var _0x433dbd=_0x49fe3b?0x0:_0x8488ea[_0xa750('0x17')];var _0x4f1faa=_0x49fe3b?_0x290d46[_0xa750('0x19')]:_0x8488ea['offset']+_0x8488ea['limit'];var _0x25e335;if(_0x4f1faa>=_0x321eb2){_0x4f1faa=_0x321eb2;_0x25e335=0xc8;}else{_0x25e335=0xce;}_0x3ae2a1['status'](_0x25e335);return _0x3ae2a1[_0xa750('0x1a')]('Content-Range',_0x433dbd+'-'+_0x4f1faa+'/'+_0x321eb2)[_0xa750('0x1b')](_0x290d46);}return null;};}function patchUpdates(_0x4a007d){return function(_0x3dc7f1){try{jsonpatch['apply'](_0x3dc7f1,_0x4a007d,!![]);}catch(_0x1efb68){return BPromise['reject'](_0x1efb68);}return _0x3dc7f1['save']();};}function saveUpdates(_0xaa9d3e,_0x52da84){return function(_0x216fbf){if(_0x216fbf){return _0x216fbf['update'](_0xaa9d3e)['then'](function(_0x5b433d){return _0x5b433d;});}return null;};}function removeEntity(_0x5d758e,_0x15d72f){return function(_0x2ec6c4){if(_0x2ec6c4){return _0x2ec6c4[_0xa750('0x1c')]()[_0xa750('0x1d')](function(){_0x5d758e[_0xa750('0x15')](0xcc)[_0xa750('0x16')]();});}};}function handleEntityNotFound(_0x3001bc,_0x7e22ad){return function(_0x3d52b3){if(!_0x3d52b3){_0x3001bc[_0xa750('0x1e')](0x194);}return _0x3d52b3;};}function handleError(_0xe92342,_0x27a5eb){_0x27a5eb=_0x27a5eb||0x1f4;return function(_0x31ea63){logger[_0xa750('0x1f')](_0x31ea63[_0xa750('0x20')]);if(_0x31ea63['name']){delete _0x31ea63[_0xa750('0x21')];}_0xe92342[_0xa750('0x15')](_0x27a5eb)[_0xa750('0x22')](_0x31ea63);};}exports['show']=function(_0x35ab53,_0x6ade2b){var _0x3270e3={'raw':!![],'where':{'id':_0x35ab53['params']['id']}},_0x1223d2={};_0x1223d2[_0xa750('0x23')]=_[_0xa750('0x24')](db[_0xa750('0x25')][_0xa750('0x26')]);_0x1223d2[_0xa750('0x27')]=_['keys'](_0x35ab53[_0xa750('0x27')]);_0x1223d2['filters']=_[_0xa750('0x28')](_0x1223d2[_0xa750('0x23')],_0x1223d2['query']);_0x3270e3[_0xa750('0x29')]=_[_0xa750('0x28')](_0x1223d2[_0xa750('0x23')],qs[_0xa750('0x2a')](_0x35ab53[_0xa750('0x27')][_0xa750('0x2a')]));_0x3270e3[_0xa750('0x29')]=_0x3270e3[_0xa750('0x29')]['length']?_0x3270e3[_0xa750('0x29')]:_0x1223d2['model'];if(_0x35ab53[_0xa750('0x27')][_0xa750('0x2b')]){_0x3270e3[_0xa750('0x2c')]=[{'all':!![]}];}_0x3270e3=_[_0xa750('0x2d')]({},_0x3270e3,_0x35ab53['options']);return db[_0xa750('0x25')][_0xa750('0x2e')](_0x3270e3)['then'](handleEntityNotFound(_0x6ade2b,null))[_0xa750('0x1d')](respondWithResult(_0x6ade2b,null))[_0xa750('0x2f')](handleError(_0x6ade2b,null));};exports[_0xa750('0x30')]=function(_0x15b682,_0x4b13fc){if(_0x15b682[_0xa750('0x31')]['id']){delete _0x15b682['body']['id'];}return db['ChatApplication'][_0xa750('0x2e')]({'where':{'id':_0x15b682[_0xa750('0x32')]['id']}})[_0xa750('0x1d')](handleEntityNotFound(_0x4b13fc,null))['then'](saveUpdates(_0x15b682[_0xa750('0x31')],null))[_0xa750('0x1d')](respondWithResult(_0x4b13fc,null))[_0xa750('0x2f')](handleError(_0x4b13fc,null));};exports['destroy']=function(_0x37abd2,_0xca7f52){return db[_0xa750('0x25')]['find']({'where':{'id':_0x37abd2[_0xa750('0x32')]['id']}})[_0xa750('0x1d')](handleEntityNotFound(_0xca7f52,null))[_0xa750('0x1d')](removeEntity(_0xca7f52,null))['catch'](handleError(_0xca7f52,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 0c1aca4..d6e6a1d 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 _0x192f=['moment','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x536e71,_0xd2c2c1){var _0x5f903e=function(_0x14e796){while(--_0x14e796){_0x536e71['push'](_0x536e71['shift']());}};_0x5f903e(++_0xd2c2c1);}(_0x192f,0xd6));var _0xf192=function(_0x545b1b,_0x5600f2){_0x545b1b=_0x545b1b-0x0;var _0x276f35=_0x192f[_0x545b1b];return _0x276f35;};'use strict';var _=require(_0xf192('0x0'));var util=require('util');var logger=require(_0xf192('0x1'))('api');var moment=require(_0xf192('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf192('0x3'));var rimraf=require(_0xf192('0x4'));var config=require(_0xf192('0x5'));var attributes=require(_0xf192('0x6'));module[_0xf192('0x7')]=function(_0x221f55,_0x5a05b0){return _0x221f55[_0xf192('0x8')](_0xf192('0x9'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf192('0xa'),'collate':_0xf192('0xb')});}; \ No newline at end of file +var _0xe3ab=['../../config/logger','api','moment','bluebird','path','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0xba1857,_0x29cad2){var _0x1b297b=function(_0x1e51ed){while(--_0x1e51ed){_0xba1857['push'](_0xba1857['shift']());}};_0x1b297b(++_0x29cad2);}(_0xe3ab,0x8b));var _0xbe3a=function(_0x4ace18,_0x37092e){_0x4ace18=_0x4ace18-0x0;var _0x24f7fe=_0xe3ab[_0x4ace18];return _0x24f7fe;};'use strict';var _=require(_0xbe3a('0x0'));var util=require('util');var logger=require(_0xbe3a('0x1'))(_0xbe3a('0x2'));var moment=require(_0xbe3a('0x3'));var BPromise=require(_0xbe3a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe3a('0x5'));var rimraf=require('rimraf');var config=require(_0xbe3a('0x6'));var attributes=require(_0xbe3a('0x7'));module[_0xbe3a('0x8')]=function(_0xe218e1,_0x3f4fde){return _0xe218e1[_0xbe3a('0x9')](_0xbe3a('0xa'),attributes,{'tableName':_0xbe3a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbe3a('0xc'),'collate':_0xbe3a('0xd')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 81c3935..5fd067a 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 _0x9397=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','moment','bluebird','ioredis','../../mysqldb'];(function(_0x4a9ff5,_0xa33072){var _0x2889ec=function(_0x594e2a){while(--_0x594e2a){_0x4a9ff5['push'](_0x4a9ff5['shift']());}};_0x2889ec(++_0xa33072);}(_0x9397,0xcd));var _0x7939=function(_0x354b61,_0x3a611d){_0x354b61=_0x354b61-0x0;var _0x1aedb4=_0x9397[_0x354b61];return _0x1aedb4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7939('0x0'));var BPromise=require(_0x7939('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7939('0x2'));var db=require(_0x7939('0x3'))['db'];var utils=require(_0x7939('0x4'));var logger=require(_0x7939('0x5'))(_0x7939('0x6'));var config=require(_0x7939('0x7'));var jayson=require(_0x7939('0x8'));var client=jayson[_0x7939('0x9')][_0x7939('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x332fd,_0x5ed0e8,_0x3a0357){return new BPromise(function(_0x4800dd,_0x2de574){return client['request'](_0x332fd,_0x3a0357)['then'](function(_0x4b5d02){logger[_0x7939('0xb')](_0x7939('0xc'),_0x5ed0e8,_0x7939('0xd'));logger['debug'](_0x7939('0xe'),_0x5ed0e8,_0x7939('0xd'),JSON['stringify'](_0x4b5d02));if(_0x4b5d02['error']){if(_0x4b5d02[_0x7939('0xf')][_0x7939('0x10')]===0x1f4){logger[_0x7939('0xf')]('ChatApplication,\x20%s,\x20%s',_0x5ed0e8,_0x4b5d02[_0x7939('0xf')]['message']);return _0x2de574(_0x4b5d02[_0x7939('0xf')][_0x7939('0x11')]);}logger[_0x7939('0xf')](_0x7939('0xc'),_0x5ed0e8,_0x4b5d02[_0x7939('0xf')][_0x7939('0x11')]);return _0x4800dd(_0x4b5d02[_0x7939('0xf')][_0x7939('0x11')]);}else{logger[_0x7939('0xb')](_0x7939('0xc'),_0x5ed0e8,_0x7939('0xd'));_0x4800dd(_0x4b5d02['result'][_0x7939('0x11')]);}})[_0x7939('0x12')](function(_0xbe120a){logger['error'](_0x7939('0xc'),_0x5ed0e8,_0xbe120a);_0x2de574(_0xbe120a);});});} \ No newline at end of file +var _0xe34d=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5e238b,_0x17ae49){var _0x389bea=function(_0x3cc1c1){while(--_0x3cc1c1){_0x5e238b['push'](_0x5e238b['shift']());}};_0x389bea(++_0x17ae49);}(_0xe34d,0x101));var _0xde34=function(_0x56ec9b,_0x3d1f06){_0x56ec9b=_0x56ec9b-0x0;var _0x4d6c25=_0xe34d[_0x56ec9b];return _0x4d6c25;};'use strict';var _=require(_0xde34('0x0'));var util=require(_0xde34('0x1'));var moment=require(_0xde34('0x2'));var BPromise=require(_0xde34('0x3'));var rs=require(_0xde34('0x4'));var fs=require('fs');var Redis=require(_0xde34('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xde34('0x6'));var logger=require('../../config/logger')(_0xde34('0x7'));var config=require(_0xde34('0x8'));var jayson=require(_0xde34('0x9'));var client=jayson[_0xde34('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x414918,_0x45b322,_0x2a70c1){return new BPromise(function(_0x7c653e,_0x33b4b7){return client['request'](_0x414918,_0x2a70c1)[_0xde34('0xb')](function(_0xb71c98){logger[_0xde34('0xc')](_0xde34('0xd'),_0x45b322,_0xde34('0xe'));logger[_0xde34('0xf')](_0xde34('0x10'),_0x45b322,'request\x20sent',JSON[_0xde34('0x11')](_0xb71c98));if(_0xb71c98[_0xde34('0x12')]){if(_0xb71c98[_0xde34('0x12')][_0xde34('0x13')]===0x1f4){logger[_0xde34('0x12')]('ChatApplication,\x20%s,\x20%s',_0x45b322,_0xb71c98[_0xde34('0x12')][_0xde34('0x14')]);return _0x33b4b7(_0xb71c98['error'][_0xde34('0x14')]);}logger['error'](_0xde34('0xd'),_0x45b322,_0xb71c98['error'][_0xde34('0x14')]);return _0x7c653e(_0xb71c98['error'][_0xde34('0x14')]);}else{logger['info'](_0xde34('0xd'),_0x45b322,_0xde34('0xe'));_0x7c653e(_0xb71c98[_0xde34('0x15')][_0xde34('0x14')]);}})[_0xde34('0x16')](function(_0x78adf9){logger[_0xde34('0x12')]('ChatApplication,\x20%s,\x20%s',_0x45b322,_0x78adf9);_0x33b4b7(_0x78adf9);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index ad54b58..0be2075 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 _0x9f2c=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','update','destroy'];(function(_0x3e3bee,_0x4f91fe){var _0x3ae14c=function(_0x3861a0){while(--_0x3861a0){_0x3e3bee['push'](_0x3e3bee['shift']());}};_0x3ae14c(++_0x4f91fe);}(_0x9f2c,0xc0));var _0xc9f2=function(_0xf65eb3,_0x1e68ce){_0xf65eb3=_0xf65eb3-0x0;var _0x5a4024=_0x9f2c[_0xf65eb3];return _0x5a4024;};'use strict';var multer=require(_0xc9f2('0x0'));var util=require(_0xc9f2('0x1'));var path=require(_0xc9f2('0x2'));var timeout=require(_0xc9f2('0x3'));var express=require(_0xc9f2('0x4'));var router=express[_0xc9f2('0x5')]();var fs_extra=require(_0xc9f2('0x6'));var auth=require(_0xc9f2('0x7'));var interaction=require(_0xc9f2('0x8'));var config=require(_0xc9f2('0x9'));var controller=require(_0xc9f2('0xa'));router[_0xc9f2('0xb')](_0xc9f2('0xc'),auth[_0xc9f2('0xd')](),controller['show']);router['put']('/:id',auth[_0xc9f2('0xd')](),controller[_0xc9f2('0xe')]);router['delete'](_0xc9f2('0xc'),auth['isAuthenticated'](),controller[_0xc9f2('0xf')]);module['exports']=router; \ No newline at end of file +var _0xcaf1=['path','express','Router','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show','/:id','update','delete','util'];(function(_0x4db23f,_0x265851){var _0x2c6aee=function(_0x337d61){while(--_0x337d61){_0x4db23f['push'](_0x4db23f['shift']());}};_0x2c6aee(++_0x265851);}(_0xcaf1,0xc2));var _0x1caf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcaf1[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x1caf('0x0'));var path=require(_0x1caf('0x1'));var timeout=require('connect-timeout');var express=require(_0x1caf('0x2'));var router=express[_0x1caf('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1caf('0x4'));var config=require(_0x1caf('0x5'));var controller=require(_0x1caf('0x6'));router[_0x1caf('0x7')]('/:id',auth[_0x1caf('0x8')](),controller[_0x1caf('0x9')]);router['put'](_0x1caf('0xa'),auth[_0x1caf('0x8')](),controller[_0x1caf('0xb')]);router[_0x1caf('0xc')]('/:id',auth[_0x1caf('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 46c5120..97757c5 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 _0x563e=['sequelize','exports','STRING'];(function(_0x14087f,_0x17257f){var _0x350349=function(_0x17641a){while(--_0x17641a){_0x14087f['push'](_0x14087f['shift']());}};_0x350349(++_0x17257f);}(_0x563e,0x1cb));var _0xe563=function(_0x386b69,_0x5d9360){_0x386b69=_0x386b69-0x0;var _0x476415=_0x563e[_0x386b69];return _0x476415;};'use strict';var Sequelize=require(_0xe563('0x0'));module[_0xe563('0x1')]={'name':{'type':Sequelize[_0xe563('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xe563('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x649e=['BOOLEAN','sequelize','exports','STRING'];(function(_0x4f2aa6,_0x2e56a4){var _0x469358=function(_0x132e96){while(--_0x132e96){_0x4f2aa6['push'](_0x4f2aa6['shift']());}};_0x469358(++_0x2e56a4);}(_0x649e,0xdd));var _0xe649=function(_0x3d7d45,_0x50df96){_0x3d7d45=_0x3d7d45-0x0;var _0x1f76e0=_0x649e[_0x3d7d45];return _0x1f76e0;};'use strict';var Sequelize=require(_0xe649('0x0'));module[_0xe649('0x1')]={'name':{'type':Sequelize[_0xe649('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xe649('0x2')]},'write':{'type':Sequelize[_0xe649('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 d44b9a6..5ebf4ed 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 _0x5587=['redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','limit','count','reject','save','update','then','destroy','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','filter','where','merge','VIRTUAL','options','ChatGroup','includeAll','include','findAll','rows','show','length','find','catch','create','body','params','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','findOne','User','pick','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x4255e3,_0x5c0830){var _0x28dbd1=function(_0x56f3b0){while(--_0x56f3b0){_0x4255e3['push'](_0x4255e3['shift']());}};_0x28dbd1(++_0x5c0830);}(_0x5587,0x1d6));var _0x7558=function(_0x561a86,_0x21c5c9){_0x561a86=_0x561a86-0x0;var _0xc6a833=_0x5587[_0x561a86];return _0xc6a833;};'use strict';var emlformat=require(_0x7558('0x0'));var rimraf=require(_0x7558('0x1'));var zipdir=require(_0x7558('0x2'));var jsonpatch=require(_0x7558('0x3'));var rp=require(_0x7558('0x4'));var moment=require('moment');var BPromise=require(_0x7558('0x5'));var Mustache=require('mustache');var util=require(_0x7558('0x6'));var path=require(_0x7558('0x7'));var sox=require(_0x7558('0x8'));var csv=require('to-csv');var ejs=require(_0x7558('0x9'));var fs=require('fs');var fs_extra=require(_0x7558('0xa'));var _=require(_0x7558('0xb'));var squel=require(_0x7558('0xc'));var crypto=require(_0x7558('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7558('0xe'));var toCsv=require(_0x7558('0xf'));var querystring=require(_0x7558('0x10'));var Papa=require('papaparse');var Redis=require(_0x7558('0x11'));var authService=require(_0x7558('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7558('0x13'));var hardwareService=require(_0x7558('0x14'));var logger=require('../../config/logger')(_0x7558('0x15'));var utils=require('../../config/utils');var config=require(_0x7558('0x16'));var licenseUtil=require(_0x7558('0x17'));var db=require(_0x7558('0x18'))['db'];config[_0x7558('0x19')]=_[_0x7558('0x1a')](config[_0x7558('0x19')],{'host':_0x7558('0x1b'),'port':0x18eb});var socket=require(_0x7558('0x1c'))(new Redis(config[_0x7558('0x19')]));require(_0x7558('0x1d'))[_0x7558('0x1e')](socket);function respondWithStatusCode(_0x3cc526,_0x460fc6){_0x460fc6=_0x460fc6||0xcc;return function(_0x1c643c){if(_0x1c643c){return _0x3cc526[_0x7558('0x1f')](_0x460fc6);}return _0x3cc526[_0x7558('0x20')](_0x460fc6)['end']();};}function respondWithResult(_0x2dad87,_0x44237d){_0x44237d=_0x44237d||0xc8;return function(_0x1c5840){if(_0x1c5840){return _0x2dad87['status'](_0x44237d)[_0x7558('0x21')](_0x1c5840);}};}function respondWithFilteredResult(_0x4dde40,_0x196665){return function(_0x1790d0){if(_0x1790d0){var _0x20a985=typeof _0x196665[_0x7558('0x22')]===_0x7558('0x23')&&typeof _0x196665[_0x7558('0x24')]===_0x7558('0x23');var _0x527e9f=_0x1790d0['count'];var _0x4f0316=_0x20a985?0x0:_0x196665[_0x7558('0x22')];var _0x30e85b=_0x20a985?_0x1790d0[_0x7558('0x25')]:_0x196665[_0x7558('0x22')]+_0x196665[_0x7558('0x24')];var _0xedbc32;if(_0x30e85b>=_0x527e9f){_0x30e85b=_0x527e9f;_0xedbc32=0xc8;}else{_0xedbc32=0xce;}_0x4dde40[_0x7558('0x20')](_0xedbc32);return _0x4dde40['set']('Content-Range',_0x4f0316+'-'+_0x30e85b+'/'+_0x527e9f)[_0x7558('0x21')](_0x1790d0);}return null;};}function patchUpdates(_0x1122ac){return function(_0x3b1e39){try{jsonpatch['apply'](_0x3b1e39,_0x1122ac,!![]);}catch(_0x3c6919){return BPromise[_0x7558('0x26')](_0x3c6919);}return _0x3b1e39[_0x7558('0x27')]();};}function saveUpdates(_0x5037c6,_0x35f646){return function(_0x4c068f){if(_0x4c068f){return _0x4c068f[_0x7558('0x28')](_0x5037c6)[_0x7558('0x29')](function(_0x5a6b81){return _0x5a6b81;});}return null;};}function removeEntity(_0x368edb,_0x1ce087){return function(_0x25fc78){if(_0x25fc78){return _0x25fc78[_0x7558('0x2a')]()[_0x7558('0x29')](function(){_0x368edb[_0x7558('0x20')](0xcc)[_0x7558('0x2b')]();});}};}function handleEntityNotFound(_0x351d19,_0x356802){return function(_0x218f15){if(!_0x218f15){_0x351d19[_0x7558('0x1f')](0x194);}return _0x218f15;};}function handleError(_0x1e4727,_0x3e3fe6){_0x3e3fe6=_0x3e3fe6||0x1f4;return function(_0x48ddf3){logger[_0x7558('0x2c')](_0x48ddf3['stack']);if(_0x48ddf3[_0x7558('0x2d')]){delete _0x48ddf3[_0x7558('0x2d')];}_0x1e4727[_0x7558('0x20')](_0x3e3fe6)[_0x7558('0x2e')](_0x48ddf3);};}exports[_0x7558('0x2f')]=function(_0x23b165,_0x31f441){var _0x497e0a={},_0x1ffb7c={},_0x9d5f88={'count':0x0,'rows':[]};var _0x56501b=_[_0x7558('0x30')](db['ChatGroup'][_0x7558('0x31')],function(_0x2f4028){return{'name':_0x2f4028[_0x7558('0x32')],'type':_0x2f4028[_0x7558('0x33')][_0x7558('0x34')]};});_0x1ffb7c[_0x7558('0x35')]=_['map'](_0x56501b,_0x7558('0x2d'));_0x1ffb7c[_0x7558('0x36')]=_[_0x7558('0x37')](_0x23b165[_0x7558('0x36')]);_0x1ffb7c[_0x7558('0x38')]=_[_0x7558('0x39')](_0x1ffb7c[_0x7558('0x35')],_0x1ffb7c[_0x7558('0x36')]);_0x497e0a[_0x7558('0x3a')]=_[_0x7558('0x39')](_0x1ffb7c[_0x7558('0x35')],qs['fields'](_0x23b165[_0x7558('0x36')][_0x7558('0x3b')]));_0x497e0a[_0x7558('0x3a')]=_0x497e0a[_0x7558('0x3a')]['length']?_0x497e0a[_0x7558('0x3a')]:_0x1ffb7c['model'];if(!_0x23b165['query']['hasOwnProperty'](_0x7558('0x3c'))){_0x497e0a['limit']=qs[_0x7558('0x24')](_0x23b165[_0x7558('0x36')][_0x7558('0x24')]);_0x497e0a[_0x7558('0x22')]=qs['offset'](_0x23b165[_0x7558('0x36')][_0x7558('0x22')]);}_0x497e0a[_0x7558('0x3d')]=qs[_0x7558('0x3e')](_0x23b165[_0x7558('0x36')][_0x7558('0x3e')]);_0x497e0a['where']=qs[_0x7558('0x38')](_['pick'](_0x23b165['query'],_0x1ffb7c[_0x7558('0x38')]),_0x56501b);if(_0x23b165[_0x7558('0x36')][_0x7558('0x3f')]){_0x497e0a[_0x7558('0x40')]=_[_0x7558('0x41')](_0x497e0a[_0x7558('0x40')],{'$or':_[_0x7558('0x30')](_0x56501b,function(_0x2df4f5){if(_0x2df4f5['type']!==_0x7558('0x42')){var _0x137beb={};_0x137beb[_0x2df4f5[_0x7558('0x2d')]]={'$like':'%'+_0x23b165['query'][_0x7558('0x3f')]+'%'};return _0x137beb;}})});}_0x497e0a=_['merge']({},_0x497e0a,_0x23b165[_0x7558('0x43')]);var _0x3f05da={'where':_0x497e0a[_0x7558('0x40')]};return db[_0x7558('0x44')][_0x7558('0x25')](_0x3f05da)[_0x7558('0x29')](function(_0x457e0d){_0x9d5f88['count']=_0x457e0d;if(_0x23b165[_0x7558('0x36')][_0x7558('0x45')]){_0x497e0a[_0x7558('0x46')]=[{'all':!![]}];}return db[_0x7558('0x44')][_0x7558('0x47')](_0x497e0a);})[_0x7558('0x29')](function(_0x2ddd69){_0x9d5f88[_0x7558('0x48')]=_0x2ddd69;return _0x9d5f88;})[_0x7558('0x29')](respondWithFilteredResult(_0x31f441,_0x497e0a))['catch'](handleError(_0x31f441,null));};exports[_0x7558('0x49')]=function(_0x8bf301,_0x13bc71){var _0x9c808a={'raw':!![],'where':{'id':_0x8bf301['params']['id']}},_0x2d3fdb={};_0x2d3fdb[_0x7558('0x35')]=_[_0x7558('0x37')](db[_0x7558('0x44')][_0x7558('0x31')]);_0x2d3fdb[_0x7558('0x36')]=_[_0x7558('0x37')](_0x8bf301[_0x7558('0x36')]);_0x2d3fdb[_0x7558('0x38')]=_[_0x7558('0x39')](_0x2d3fdb[_0x7558('0x35')],_0x2d3fdb[_0x7558('0x36')]);_0x9c808a['attributes']=_[_0x7558('0x39')](_0x2d3fdb['model'],qs[_0x7558('0x3b')](_0x8bf301[_0x7558('0x36')][_0x7558('0x3b')]));_0x9c808a[_0x7558('0x3a')]=_0x9c808a['attributes'][_0x7558('0x4a')]?_0x9c808a[_0x7558('0x3a')]:_0x2d3fdb['model'];if(_0x8bf301[_0x7558('0x36')]['includeAll']){_0x9c808a[_0x7558('0x46')]=[{'all':!![]}];}_0x9c808a=_[_0x7558('0x41')]({},_0x9c808a,_0x8bf301[_0x7558('0x43')]);return db[_0x7558('0x44')][_0x7558('0x4b')](_0x9c808a)['then'](handleEntityNotFound(_0x13bc71,null))[_0x7558('0x29')](respondWithResult(_0x13bc71,null))[_0x7558('0x4c')](handleError(_0x13bc71,null));};exports[_0x7558('0x4d')]=function(_0x2a7ead,_0x3a37d5){return db[_0x7558('0x44')][_0x7558('0x4d')](_0x2a7ead[_0x7558('0x4e')],{})['then'](respondWithResult(_0x3a37d5,0xc9))[_0x7558('0x4c')](handleError(_0x3a37d5,null));};exports[_0x7558('0x28')]=function(_0x4542cb,_0x2035c9){if(_0x4542cb[_0x7558('0x4e')]['id']){delete _0x4542cb[_0x7558('0x4e')]['id'];}return db[_0x7558('0x44')][_0x7558('0x4b')]({'where':{'id':_0x4542cb[_0x7558('0x4f')]['id']}})[_0x7558('0x29')](handleEntityNotFound(_0x2035c9,null))[_0x7558('0x29')](saveUpdates(_0x4542cb[_0x7558('0x4e')],null))[_0x7558('0x29')](respondWithResult(_0x2035c9,null))[_0x7558('0x4c')](handleError(_0x2035c9,null));};exports['destroy']=function(_0x59f192,_0x3da72d){return db[_0x7558('0x44')][_0x7558('0x4b')]({'where':{'id':_0x59f192[_0x7558('0x4f')]['id']}})[_0x7558('0x29')](handleEntityNotFound(_0x3da72d,null))['then'](removeEntity(_0x3da72d,null))[_0x7558('0x4c')](handleError(_0x3da72d,null));};exports['describe']=function(_0xed8343,_0x5a94a8){return db[_0x7558('0x44')]['describe']()[_0x7558('0x29')](respondWithResult(_0x5a94a8,null))[_0x7558('0x4c')](handleError(_0x5a94a8,null));};exports[_0x7558('0x50')]=function(_0x311fa4,_0x3fd326,_0x4bbbf2){return db[_0x7558('0x51')][_0x7558('0x25')]({'where':{'ChatGroupId':_0x311fa4[_0x7558('0x4f')]['id'],'ToId':_0x311fa4[_0x7558('0x52')]['id'],'read':![]}})[_0x7558('0x29')](function(_0x99a2f0){return{'id':_[_0x7558('0x53')](_0x311fa4[_0x7558('0x4f')]['id']),'count':_0x99a2f0};})[_0x7558('0x29')](respondWithResult(_0x3fd326,null))['catch'](handleError(_0x3fd326,null));};exports[_0x7558('0x54')]=function(_0x1a0ea1,_0x2f7c63,_0x29eb91){return db[_0x7558('0x44')]['find']({'where':{'id':_0x1a0ea1['params']['id']}})[_0x7558('0x29')](handleEntityNotFound(_0x2f7c63,null))[_0x7558('0x29')](function(_0x5a11ab){if(_0x5a11ab){return _0x5a11ab[_0x7558('0x54')](_0x1a0ea1['body'][_0x7558('0x55')],_[_0x7558('0x56')](_0x1a0ea1[_0x7558('0x4e')],[_0x7558('0x55'),'id'])||{});}})[_0x7558('0x29')](respondWithResult(_0x2f7c63,null))[_0x7558('0x4c')](handleError(_0x2f7c63,null));};exports['getMembers']=function(_0x49621f,_0x360ad6,_0x62e14e){var _0x3b8292={};var _0x34c360={};var _0x20286d;var _0x25482d;return db['ChatGroup'][_0x7558('0x57')]({'where':{'id':_0x49621f['params']['id']}})[_0x7558('0x29')](handleEntityNotFound(_0x360ad6,null))[_0x7558('0x29')](function(_0x37862f){if(_0x37862f){_0x20286d=_0x37862f;_0x34c360[_0x7558('0x35')]=_[_0x7558('0x37')](db[_0x7558('0x58')][_0x7558('0x31')]);_0x34c360[_0x7558('0x36')]=_[_0x7558('0x37')](_0x49621f[_0x7558('0x36')]);_0x34c360[_0x7558('0x38')]=_[_0x7558('0x39')](_0x34c360[_0x7558('0x35')],_0x34c360[_0x7558('0x36')]);_0x3b8292[_0x7558('0x3a')]=_[_0x7558('0x39')](_0x34c360[_0x7558('0x35')],qs['fields'](_0x49621f['query']['fields']));_0x3b8292[_0x7558('0x3a')]=_0x3b8292[_0x7558('0x3a')][_0x7558('0x4a')]?_0x3b8292[_0x7558('0x3a')]:_0x34c360[_0x7558('0x35')];_0x3b8292[_0x7558('0x3d')]=qs['sort'](_0x49621f[_0x7558('0x36')][_0x7558('0x3e')]);_0x3b8292[_0x7558('0x40')]=qs[_0x7558('0x38')](_[_0x7558('0x59')](_0x49621f[_0x7558('0x36')],_0x34c360[_0x7558('0x38')]));if(_0x49621f['query'][_0x7558('0x3f')]){_0x3b8292[_0x7558('0x40')]=_[_0x7558('0x41')](_0x3b8292['where'],{'$or':_[_0x7558('0x30')](_0x3b8292[_0x7558('0x3a')],function(_0x2505d9){var _0x521e3f={};_0x521e3f[_0x2505d9]={'$like':'%'+_0x49621f['query'][_0x7558('0x3f')]+'%'};return _0x521e3f;})});}_0x3b8292=_[_0x7558('0x41')]({},_0x3b8292,_0x49621f[_0x7558('0x43')]);return _0x20286d['getMembers'](_0x3b8292);}})[_0x7558('0x29')](function(_0x311215){if(_0x311215){_0x25482d=_0x311215[_0x7558('0x4a')];if(!_0x49621f[_0x7558('0x36')]['hasOwnProperty'](_0x7558('0x3c'))){_0x3b8292[_0x7558('0x24')]=qs[_0x7558('0x24')](_0x49621f[_0x7558('0x36')][_0x7558('0x24')]);_0x3b8292[_0x7558('0x22')]=qs[_0x7558('0x22')](_0x49621f['query'][_0x7558('0x22')]);}return _0x20286d[_0x7558('0x5a')](_0x3b8292);}})[_0x7558('0x29')](function(_0x133ed6){if(_0x133ed6){return _0x133ed6?{'count':_0x25482d,'rows':_0x133ed6}:null;}})[_0x7558('0x29')](respondWithResult(_0x360ad6,null))[_0x7558('0x4c')](handleError(_0x360ad6,null));};exports['removeMembers']=function(_0x568910,_0x47ba3b,_0x550d2e){return db[_0x7558('0x44')][_0x7558('0x4b')]({'where':{'id':_0x568910[_0x7558('0x4f')]['id']}})[_0x7558('0x29')](handleEntityNotFound(_0x47ba3b,null))[_0x7558('0x29')](function(_0x1588d5){if(_0x1588d5){return _0x1588d5[_0x7558('0x5b')](_0x568910[_0x7558('0x36')][_0x7558('0x55')]);}})[_0x7558('0x29')](respondWithStatusCode(_0x47ba3b,null))[_0x7558('0x4c')](handleError(_0x47ba3b,null));};exports[_0x7558('0x5c')]=function(_0xb5c6ee,_0x144c54,_0x2e5ef2){if(_0xb5c6ee['body']['id']){delete _0xb5c6ee[_0x7558('0x4e')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0xb5c6ee[_0x7558('0x4f')]['id']}})['then'](handleEntityNotFound(_0x144c54,null))[_0x7558('0x29')](function(_0x37f46a){if(_0x37f46a){_0xb5c6ee[_0x7558('0x4e')][_0x7558('0x5d')]=_0x37f46a['id'];return db[_0x7558('0x51')]['create'](_0xb5c6ee['body']);}})[_0x7558('0x29')](respondWithResult(_0x144c54,null))[_0x7558('0x4c')](handleError(_0x144c54,null));};exports[_0x7558('0x5e')]=function(_0x1d9426,_0x506d97,_0x58cd75){var _0x4974cb={};var _0x4652aa={};var _0x5c83d9;var _0x1c612c;return db[_0x7558('0x44')][_0x7558('0x57')]({'where':{'id':_0x1d9426[_0x7558('0x4f')]['id']}})[_0x7558('0x29')](handleEntityNotFound(_0x506d97,null))[_0x7558('0x29')](function(_0x7aa01a){if(_0x7aa01a){_0x5c83d9=_0x7aa01a;_0x4652aa[_0x7558('0x35')]=_[_0x7558('0x37')](db[_0x7558('0x51')][_0x7558('0x31')]);_0x4652aa[_0x7558('0x36')]=_[_0x7558('0x37')](_0x1d9426[_0x7558('0x36')]);_0x4652aa[_0x7558('0x38')]=_[_0x7558('0x39')](_0x4652aa[_0x7558('0x35')],_0x4652aa[_0x7558('0x36')]);_0x4974cb['attributes']=_[_0x7558('0x39')](_0x4652aa[_0x7558('0x35')],qs[_0x7558('0x3b')](_0x1d9426[_0x7558('0x36')]['fields']));_0x4974cb[_0x7558('0x3a')]=_0x4974cb[_0x7558('0x3a')][_0x7558('0x4a')]?_0x4974cb['attributes']:_0x4652aa[_0x7558('0x35')];_0x4974cb[_0x7558('0x3d')]=qs[_0x7558('0x3e')](_0x1d9426[_0x7558('0x36')]['sort']);_0x4974cb[_0x7558('0x40')]=qs[_0x7558('0x38')](_['pick'](_0x1d9426['query'],_0x4652aa[_0x7558('0x38')]));if(_0x1d9426[_0x7558('0x36')][_0x7558('0x3f')]){_0x4974cb[_0x7558('0x40')]=_[_0x7558('0x41')](_0x4974cb[_0x7558('0x40')],{'$or':_['map'](_0x4974cb[_0x7558('0x3a')],function(_0x113733){var _0x43d34={};_0x43d34[_0x113733]={'$like':'%'+_0x1d9426[_0x7558('0x36')]['filter']+'%'};return _0x43d34;})});}if(_0x1d9426[_0x7558('0x36')][_0x7558('0x5f')]){var _0x46dddc=_0x1d9426[_0x7558('0x36')][_0x7558('0x5f')][_0x7558('0x60')](',');var _0x56ba32={};_0x56ba32[_0x46dddc[0x0]]={'$gte':moment(_0x46dddc[0x1])[_0x7558('0x61')](_0x7558('0x62'))};_0x4974cb[_0x7558('0x40')]=_[_0x7558('0x41')](_0x4974cb[_0x7558('0x40')],_0x56ba32);}_0x4974cb=_['merge']({},_0x4974cb,_0x1d9426[_0x7558('0x43')]);return _0x5c83d9['getMessages'](_0x4974cb);}})[_0x7558('0x29')](function(_0x239dae){if(_0x239dae){_0x1c612c=_0x239dae[_0x7558('0x4a')];if(!_0x1d9426[_0x7558('0x36')]['hasOwnProperty'](_0x7558('0x3c'))){_0x4974cb[_0x7558('0x24')]=qs['limit'](_0x1d9426[_0x7558('0x36')][_0x7558('0x24')]);_0x4974cb[_0x7558('0x22')]=qs['offset'](_0x1d9426[_0x7558('0x36')][_0x7558('0x22')]);}return _0x5c83d9[_0x7558('0x5e')](_0x4974cb);}})[_0x7558('0x29')](function(_0x5c604e){if(_0x5c604e){return _0x5c604e?{'count':_0x1c612c,'rows':_0x5c604e}:null;}})[_0x7558('0x29')](respondWithResult(_0x506d97,null))['catch'](handleError(_0x506d97,null));}; \ No newline at end of file +var _0x1dfe=['$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','error','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','VIRTUAL','where','include','findAll','rows','catch','params','includeAll','options','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','getMessages'];(function(_0x38556b,_0x42c449){var _0x33d816=function(_0x4c1b63){while(--_0x4c1b63){_0x38556b['push'](_0x38556b['shift']());}};_0x33d816(++_0x42c449);}(_0x1dfe,0xc4));var _0xe1df=function(_0x116a55,_0x1aa758){_0x116a55=_0x116a55-0x0;var _0x2e43a2=_0x1dfe[_0x116a55];return _0x2e43a2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe1df('0x0'));var zipdir=require(_0xe1df('0x1'));var jsonpatch=require(_0xe1df('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe1df('0x3'));var Mustache=require(_0xe1df('0x4'));var util=require(_0xe1df('0x5'));var path=require(_0xe1df('0x6'));var sox=require(_0xe1df('0x7'));var csv=require(_0xe1df('0x8'));var ejs=require(_0xe1df('0x9'));var fs=require('fs');var fs_extra=require(_0xe1df('0xa'));var _=require(_0xe1df('0xb'));var squel=require(_0xe1df('0xc'));var crypto=require(_0xe1df('0xd'));var jsforce=require(_0xe1df('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe1df('0x8'));var querystring=require('querystring');var Papa=require(_0xe1df('0xf'));var Redis=require(_0xe1df('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe1df('0x11'));var as=require(_0xe1df('0x12'));var hardwareService=require(_0xe1df('0x13'));var logger=require('../../config/logger')(_0xe1df('0x14'));var utils=require(_0xe1df('0x15'));var config=require(_0xe1df('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe1df('0x17'))['db'];config['redis']=_[_0xe1df('0x18')](config[_0xe1df('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe1df('0x19')]));require(_0xe1df('0x1a'))[_0xe1df('0x1b')](socket);function respondWithStatusCode(_0x18c832,_0x383fb3){_0x383fb3=_0x383fb3||0xcc;return function(_0x304673){if(_0x304673){return _0x18c832[_0xe1df('0x1c')](_0x383fb3);}return _0x18c832[_0xe1df('0x1d')](_0x383fb3)['end']();};}function respondWithResult(_0x7cf0d4,_0x323fa6){_0x323fa6=_0x323fa6||0xc8;return function(_0x201efd){if(_0x201efd){return _0x7cf0d4[_0xe1df('0x1d')](_0x323fa6)[_0xe1df('0x1e')](_0x201efd);}};}function respondWithFilteredResult(_0x2679e9,_0x6c817e){return function(_0x522b4b){if(_0x522b4b){var _0x3344c1=typeof _0x6c817e[_0xe1df('0x1f')]===_0xe1df('0x20')&&typeof _0x6c817e[_0xe1df('0x21')]===_0xe1df('0x20');var _0xaff2a5=_0x522b4b['count'];var _0x19ecef=_0x3344c1?0x0:_0x6c817e[_0xe1df('0x1f')];var _0x1726f2=_0x3344c1?_0x522b4b[_0xe1df('0x22')]:_0x6c817e[_0xe1df('0x1f')]+_0x6c817e[_0xe1df('0x21')];var _0x4dd25d;if(_0x1726f2>=_0xaff2a5){_0x1726f2=_0xaff2a5;_0x4dd25d=0xc8;}else{_0x4dd25d=0xce;}_0x2679e9['status'](_0x4dd25d);return _0x2679e9[_0xe1df('0x23')](_0xe1df('0x24'),_0x19ecef+'-'+_0x1726f2+'/'+_0xaff2a5)[_0xe1df('0x1e')](_0x522b4b);}return null;};}function patchUpdates(_0x53a97c){return function(_0x12eb17){try{jsonpatch['apply'](_0x12eb17,_0x53a97c,!![]);}catch(_0x314b7e){return BPromise['reject'](_0x314b7e);}return _0x12eb17['save']();};}function saveUpdates(_0x3b008b,_0x36ef63){return function(_0x46b971){if(_0x46b971){return _0x46b971[_0xe1df('0x25')](_0x3b008b)[_0xe1df('0x26')](function(_0x567211){return _0x567211;});}return null;};}function removeEntity(_0x282549,_0x5f2eb2){return function(_0x5474e6){if(_0x5474e6){return _0x5474e6[_0xe1df('0x27')]()[_0xe1df('0x26')](function(){_0x282549[_0xe1df('0x1d')](0xcc)[_0xe1df('0x28')]();});}};}function handleEntityNotFound(_0x470acb,_0x2ccfe0){return function(_0x2bfa04){if(!_0x2bfa04){_0x470acb[_0xe1df('0x1c')](0x194);}return _0x2bfa04;};}function handleError(_0x427d86,_0x140429){_0x140429=_0x140429||0x1f4;return function(_0x1663f7){logger[_0xe1df('0x29')](_0x1663f7['stack']);if(_0x1663f7[_0xe1df('0x2a')]){delete _0x1663f7['name'];}_0x427d86[_0xe1df('0x1d')](_0x140429)[_0xe1df('0x2b')](_0x1663f7);};}exports[_0xe1df('0x2c')]=function(_0x43e9bf,_0x2d6508){var _0x378c00={},_0x215e98={},_0x561892={'count':0x0,'rows':[]};var _0x45e454=_[_0xe1df('0x2d')](db[_0xe1df('0x2e')][_0xe1df('0x2f')],function(_0x47fe5b){return{'name':_0x47fe5b[_0xe1df('0x30')],'type':_0x47fe5b[_0xe1df('0x31')][_0xe1df('0x32')]};});_0x215e98[_0xe1df('0x33')]=_[_0xe1df('0x2d')](_0x45e454,'name');_0x215e98[_0xe1df('0x34')]=_[_0xe1df('0x35')](_0x43e9bf[_0xe1df('0x34')]);_0x215e98['filters']=_[_0xe1df('0x36')](_0x215e98[_0xe1df('0x33')],_0x215e98[_0xe1df('0x34')]);_0x378c00[_0xe1df('0x37')]=_[_0xe1df('0x36')](_0x215e98[_0xe1df('0x33')],qs[_0xe1df('0x38')](_0x43e9bf[_0xe1df('0x34')][_0xe1df('0x38')]));_0x378c00['attributes']=_0x378c00[_0xe1df('0x37')][_0xe1df('0x39')]?_0x378c00[_0xe1df('0x37')]:_0x215e98[_0xe1df('0x33')];if(!_0x43e9bf[_0xe1df('0x34')][_0xe1df('0x3a')](_0xe1df('0x3b'))){_0x378c00['limit']=qs[_0xe1df('0x21')](_0x43e9bf[_0xe1df('0x34')]['limit']);_0x378c00[_0xe1df('0x1f')]=qs[_0xe1df('0x1f')](_0x43e9bf[_0xe1df('0x34')][_0xe1df('0x1f')]);}_0x378c00[_0xe1df('0x3c')]=qs[_0xe1df('0x3d')](_0x43e9bf['query'][_0xe1df('0x3d')]);_0x378c00['where']=qs[_0xe1df('0x3e')](_[_0xe1df('0x3f')](_0x43e9bf[_0xe1df('0x34')],_0x215e98[_0xe1df('0x3e')]),_0x45e454);if(_0x43e9bf['query'][_0xe1df('0x40')]){_0x378c00['where']=_[_0xe1df('0x41')](_0x378c00['where'],{'$or':_[_0xe1df('0x2d')](_0x45e454,function(_0x3d1893){if(_0x3d1893['type']!==_0xe1df('0x42')){var _0x3c43db={};_0x3c43db[_0x3d1893[_0xe1df('0x2a')]]={'$like':'%'+_0x43e9bf[_0xe1df('0x34')]['filter']+'%'};return _0x3c43db;}})});}_0x378c00=_[_0xe1df('0x41')]({},_0x378c00,_0x43e9bf['options']);var _0x5c69fb={'where':_0x378c00[_0xe1df('0x43')]};return db[_0xe1df('0x2e')]['count'](_0x5c69fb)[_0xe1df('0x26')](function(_0x153651){_0x561892[_0xe1df('0x22')]=_0x153651;if(_0x43e9bf[_0xe1df('0x34')]['includeAll']){_0x378c00[_0xe1df('0x44')]=[{'all':!![]}];}return db[_0xe1df('0x2e')][_0xe1df('0x45')](_0x378c00);})['then'](function(_0x1ebaa3){_0x561892[_0xe1df('0x46')]=_0x1ebaa3;return _0x561892;})[_0xe1df('0x26')](respondWithFilteredResult(_0x2d6508,_0x378c00))[_0xe1df('0x47')](handleError(_0x2d6508,null));};exports['show']=function(_0x2a6ea9,_0x479615){var _0x19ea30={'raw':!![],'where':{'id':_0x2a6ea9[_0xe1df('0x48')]['id']}},_0x583981={};_0x583981[_0xe1df('0x33')]=_[_0xe1df('0x35')](db[_0xe1df('0x2e')][_0xe1df('0x2f')]);_0x583981[_0xe1df('0x34')]=_[_0xe1df('0x35')](_0x2a6ea9['query']);_0x583981['filters']=_[_0xe1df('0x36')](_0x583981['model'],_0x583981[_0xe1df('0x34')]);_0x19ea30[_0xe1df('0x37')]=_[_0xe1df('0x36')](_0x583981['model'],qs[_0xe1df('0x38')](_0x2a6ea9['query'][_0xe1df('0x38')]));_0x19ea30[_0xe1df('0x37')]=_0x19ea30['attributes'][_0xe1df('0x39')]?_0x19ea30[_0xe1df('0x37')]:_0x583981[_0xe1df('0x33')];if(_0x2a6ea9[_0xe1df('0x34')][_0xe1df('0x49')]){_0x19ea30[_0xe1df('0x44')]=[{'all':!![]}];}_0x19ea30=_['merge']({},_0x19ea30,_0x2a6ea9[_0xe1df('0x4a')]);return db['ChatGroup'][_0xe1df('0x4b')](_0x19ea30)[_0xe1df('0x26')](handleEntityNotFound(_0x479615,null))[_0xe1df('0x26')](respondWithResult(_0x479615,null))['catch'](handleError(_0x479615,null));};exports[_0xe1df('0x4c')]=function(_0x93295b,_0x2eb509){return db[_0xe1df('0x2e')]['create'](_0x93295b['body'],{})[_0xe1df('0x26')](respondWithResult(_0x2eb509,0xc9))[_0xe1df('0x47')](handleError(_0x2eb509,null));};exports[_0xe1df('0x25')]=function(_0x3915a1,_0x53c801){if(_0x3915a1['body']['id']){delete _0x3915a1[_0xe1df('0x4d')]['id'];}return db[_0xe1df('0x2e')]['find']({'where':{'id':_0x3915a1[_0xe1df('0x48')]['id']}})[_0xe1df('0x26')](handleEntityNotFound(_0x53c801,null))[_0xe1df('0x26')](saveUpdates(_0x3915a1[_0xe1df('0x4d')],null))[_0xe1df('0x26')](respondWithResult(_0x53c801,null))[_0xe1df('0x47')](handleError(_0x53c801,null));};exports[_0xe1df('0x27')]=function(_0x52e8fe,_0x1107a3){return db['ChatGroup']['find']({'where':{'id':_0x52e8fe[_0xe1df('0x48')]['id']}})[_0xe1df('0x26')](handleEntityNotFound(_0x1107a3,null))['then'](removeEntity(_0x1107a3,null))[_0xe1df('0x47')](handleError(_0x1107a3,null));};exports[_0xe1df('0x4e')]=function(_0x4ec336,_0x178e7a){return db[_0xe1df('0x2e')][_0xe1df('0x4e')]()['then'](respondWithResult(_0x178e7a,null))[_0xe1df('0x47')](handleError(_0x178e7a,null));};exports[_0xe1df('0x4f')]=function(_0x1acc74,_0x12ad97,_0x255711){return db[_0xe1df('0x50')]['count']({'where':{'ChatGroupId':_0x1acc74[_0xe1df('0x48')]['id'],'ToId':_0x1acc74[_0xe1df('0x51')]['id'],'read':![]}})[_0xe1df('0x26')](function(_0x497a9a){return{'id':_[_0xe1df('0x52')](_0x1acc74['params']['id']),'count':_0x497a9a};})[_0xe1df('0x26')](respondWithResult(_0x12ad97,null))['catch'](handleError(_0x12ad97,null));};exports[_0xe1df('0x53')]=function(_0x381764,_0x3576b3,_0x26cf3e){return db[_0xe1df('0x2e')][_0xe1df('0x4b')]({'where':{'id':_0x381764['params']['id']}})['then'](handleEntityNotFound(_0x3576b3,null))[_0xe1df('0x26')](function(_0x29a273){if(_0x29a273){return _0x29a273[_0xe1df('0x53')](_0x381764[_0xe1df('0x4d')][_0xe1df('0x54')],_['omit'](_0x381764[_0xe1df('0x4d')],[_0xe1df('0x54'),'id'])||{});}})['then'](respondWithResult(_0x3576b3,null))[_0xe1df('0x47')](handleError(_0x3576b3,null));};exports[_0xe1df('0x55')]=function(_0x1ce0b5,_0x33f02b,_0x2f14ee){var _0x119b9e={};var _0x39062f={};var _0x320802;var _0x1a8c9d;return db[_0xe1df('0x2e')][_0xe1df('0x56')]({'where':{'id':_0x1ce0b5[_0xe1df('0x48')]['id']}})[_0xe1df('0x26')](handleEntityNotFound(_0x33f02b,null))[_0xe1df('0x26')](function(_0x45beab){if(_0x45beab){_0x320802=_0x45beab;_0x39062f['model']=_[_0xe1df('0x35')](db[_0xe1df('0x57')][_0xe1df('0x2f')]);_0x39062f[_0xe1df('0x34')]=_[_0xe1df('0x35')](_0x1ce0b5[_0xe1df('0x34')]);_0x39062f['filters']=_[_0xe1df('0x36')](_0x39062f[_0xe1df('0x33')],_0x39062f[_0xe1df('0x34')]);_0x119b9e[_0xe1df('0x37')]=_['intersection'](_0x39062f[_0xe1df('0x33')],qs[_0xe1df('0x38')](_0x1ce0b5['query'][_0xe1df('0x38')]));_0x119b9e[_0xe1df('0x37')]=_0x119b9e[_0xe1df('0x37')][_0xe1df('0x39')]?_0x119b9e[_0xe1df('0x37')]:_0x39062f[_0xe1df('0x33')];_0x119b9e[_0xe1df('0x3c')]=qs[_0xe1df('0x3d')](_0x1ce0b5[_0xe1df('0x34')]['sort']);_0x119b9e[_0xe1df('0x43')]=qs['filters'](_[_0xe1df('0x3f')](_0x1ce0b5[_0xe1df('0x34')],_0x39062f[_0xe1df('0x3e')]));if(_0x1ce0b5[_0xe1df('0x34')][_0xe1df('0x40')]){_0x119b9e['where']=_[_0xe1df('0x41')](_0x119b9e[_0xe1df('0x43')],{'$or':_['map'](_0x119b9e[_0xe1df('0x37')],function(_0x221f60){var _0x17e9d2={};_0x17e9d2[_0x221f60]={'$like':'%'+_0x1ce0b5['query']['filter']+'%'};return _0x17e9d2;})});}_0x119b9e=_[_0xe1df('0x41')]({},_0x119b9e,_0x1ce0b5[_0xe1df('0x4a')]);return _0x320802[_0xe1df('0x55')](_0x119b9e);}})[_0xe1df('0x26')](function(_0x9d04ad){if(_0x9d04ad){_0x1a8c9d=_0x9d04ad[_0xe1df('0x39')];if(!_0x1ce0b5[_0xe1df('0x34')][_0xe1df('0x3a')](_0xe1df('0x3b'))){_0x119b9e[_0xe1df('0x21')]=qs['limit'](_0x1ce0b5[_0xe1df('0x34')][_0xe1df('0x21')]);_0x119b9e['offset']=qs[_0xe1df('0x1f')](_0x1ce0b5[_0xe1df('0x34')][_0xe1df('0x1f')]);}return _0x320802[_0xe1df('0x55')](_0x119b9e);}})[_0xe1df('0x26')](function(_0x38e422){if(_0x38e422){return _0x38e422?{'count':_0x1a8c9d,'rows':_0x38e422}:null;}})[_0xe1df('0x26')](respondWithResult(_0x33f02b,null))['catch'](handleError(_0x33f02b,null));};exports['removeMembers']=function(_0x46cc0b,_0x4fc1d4,_0x35b510){return db[_0xe1df('0x2e')]['find']({'where':{'id':_0x46cc0b[_0xe1df('0x48')]['id']}})[_0xe1df('0x26')](handleEntityNotFound(_0x4fc1d4,null))[_0xe1df('0x26')](function(_0x239195){if(_0x239195){return _0x239195[_0xe1df('0x58')](_0x46cc0b[_0xe1df('0x34')]['ids']);}})[_0xe1df('0x26')](respondWithStatusCode(_0x4fc1d4,null))[_0xe1df('0x47')](handleError(_0x4fc1d4,null));};exports[_0xe1df('0x59')]=function(_0x8db110,_0x16a760,_0x570db6){if(_0x8db110[_0xe1df('0x4d')]['id']){delete _0x8db110[_0xe1df('0x4d')]['id'];}return db[_0xe1df('0x2e')][_0xe1df('0x4b')]({'where':{'id':_0x8db110['params']['id']}})[_0xe1df('0x26')](handleEntityNotFound(_0x16a760,null))[_0xe1df('0x26')](function(_0x3f3b91){if(_0x3f3b91){_0x8db110[_0xe1df('0x4d')][_0xe1df('0x5a')]=_0x3f3b91['id'];return db[_0xe1df('0x50')][_0xe1df('0x4c')](_0x8db110[_0xe1df('0x4d')]);}})[_0xe1df('0x26')](respondWithResult(_0x16a760,null))[_0xe1df('0x47')](handleError(_0x16a760,null));};exports[_0xe1df('0x5b')]=function(_0x19e7b1,_0x54b2a5,_0x31c070){var _0x3ad98a={};var _0x2d7327={};var _0x421a92;var _0x261b59;return db['ChatGroup'][_0xe1df('0x56')]({'where':{'id':_0x19e7b1[_0xe1df('0x48')]['id']}})[_0xe1df('0x26')](handleEntityNotFound(_0x54b2a5,null))[_0xe1df('0x26')](function(_0x3b212e){if(_0x3b212e){_0x421a92=_0x3b212e;_0x2d7327[_0xe1df('0x33')]=_[_0xe1df('0x35')](db[_0xe1df('0x50')]['rawAttributes']);_0x2d7327[_0xe1df('0x34')]=_[_0xe1df('0x35')](_0x19e7b1['query']);_0x2d7327['filters']=_[_0xe1df('0x36')](_0x2d7327[_0xe1df('0x33')],_0x2d7327[_0xe1df('0x34')]);_0x3ad98a[_0xe1df('0x37')]=_[_0xe1df('0x36')](_0x2d7327['model'],qs[_0xe1df('0x38')](_0x19e7b1[_0xe1df('0x34')]['fields']));_0x3ad98a['attributes']=_0x3ad98a[_0xe1df('0x37')][_0xe1df('0x39')]?_0x3ad98a['attributes']:_0x2d7327[_0xe1df('0x33')];_0x3ad98a[_0xe1df('0x3c')]=qs[_0xe1df('0x3d')](_0x19e7b1[_0xe1df('0x34')][_0xe1df('0x3d')]);_0x3ad98a[_0xe1df('0x43')]=qs[_0xe1df('0x3e')](_[_0xe1df('0x3f')](_0x19e7b1[_0xe1df('0x34')],_0x2d7327['filters']));if(_0x19e7b1['query'][_0xe1df('0x40')]){_0x3ad98a[_0xe1df('0x43')]=_['merge'](_0x3ad98a[_0xe1df('0x43')],{'$or':_[_0xe1df('0x2d')](_0x3ad98a[_0xe1df('0x37')],function(_0x23267d){var _0xe22714={};_0xe22714[_0x23267d]={'$like':'%'+_0x19e7b1[_0xe1df('0x34')]['filter']+'%'};return _0xe22714;})});}if(_0x19e7b1['query'][_0xe1df('0x5c')]){var _0x56c649=_0x19e7b1[_0xe1df('0x34')]['$gte'][_0xe1df('0x5d')](',');var _0x29b472={};_0x29b472[_0x56c649[0x0]]={'$gte':moment(_0x56c649[0x1])[_0xe1df('0x5e')](_0xe1df('0x5f'))};_0x3ad98a['where']=_['merge'](_0x3ad98a[_0xe1df('0x43')],_0x29b472);}_0x3ad98a=_[_0xe1df('0x41')]({},_0x3ad98a,_0x19e7b1[_0xe1df('0x4a')]);return _0x421a92['getMessages'](_0x3ad98a);}})['then'](function(_0x2d81c6){if(_0x2d81c6){_0x261b59=_0x2d81c6['length'];if(!_0x19e7b1['query'][_0xe1df('0x3a')](_0xe1df('0x3b'))){_0x3ad98a[_0xe1df('0x21')]=qs[_0xe1df('0x21')](_0x19e7b1[_0xe1df('0x34')]['limit']);_0x3ad98a[_0xe1df('0x1f')]=qs[_0xe1df('0x1f')](_0x19e7b1[_0xe1df('0x34')]['offset']);}return _0x421a92['getMessages'](_0x3ad98a);}})[_0xe1df('0x26')](function(_0xd00c63){if(_0xd00c63){return _0xd00c63?{'count':_0x261b59,'rows':_0xd00c63}:null;}})[_0xe1df('0x26')](respondWithResult(_0x54b2a5,null))['catch'](handleError(_0x54b2a5,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 31d5950..b3ffdc9 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 _0x6816=['ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x41982e,_0x4cb51f){var _0x12d51b=function(_0x287f84){while(--_0x287f84){_0x41982e['push'](_0x41982e['shift']());}};_0x12d51b(++_0x4cb51f);}(_0x6816,0x97));var _0x6681=function(_0x2f7a1f,_0x33aa81){_0x2f7a1f=_0x2f7a1f-0x0;var _0x15e97f=_0x6816[_0x2f7a1f];return _0x15e97f;};'use strict';var EventEmitter=require(_0x6681('0x0'));var ChatGroup=require(_0x6681('0x1'))['db'][_0x6681('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x6681('0x3')](0x0);var events={'afterCreate':_0x6681('0x4'),'afterUpdate':_0x6681('0x5'),'afterDestroy':_0x6681('0x6')};function emitEvent(_0x4ce185){return function(_0x242e33,_0x565331,_0x57eab7){ChatGroupEvents['emit'](_0x4ce185+':'+_0x242e33['id'],_0x242e33);ChatGroupEvents[_0x6681('0x7')](_0x4ce185,_0x242e33);_0x57eab7(null);};}for(var e in events){if(events[_0x6681('0x8')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0xc43c=['hook','exports','events','../../mysqldb','ChatGroup','remove','emit'];(function(_0x3509b9,_0x38bb75){var _0x11704f=function(_0x37a435){while(--_0x37a435){_0x3509b9['push'](_0x3509b9['shift']());}};_0x11704f(++_0x38bb75);}(_0xc43c,0xd4));var _0xcc43=function(_0x54fb0b,_0x5cb3b8){_0x54fb0b=_0x54fb0b-0x0;var _0x4dab1d=_0xc43c[_0x54fb0b];return _0x4dab1d;};'use strict';var EventEmitter=require(_0xcc43('0x0'));var ChatGroup=require(_0xcc43('0x1'))['db'][_0xcc43('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xcc43('0x3')};function emitEvent(_0x482ebc){return function(_0x484b53,_0x4c59cc,_0x37e84f){ChatGroupEvents[_0xcc43('0x4')](_0x482ebc+':'+_0x484b53['id'],_0x484b53);ChatGroupEvents[_0xcc43('0x4')](_0x482ebc,_0x484b53);_0x37e84f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xcc43('0x5')](e,emitEvent(event));}}module[_0xcc43('0x6')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 0c64ad5..94a50f9 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 _0x12ca=['rimraf','../../config/environment','./chatGroup.attributes','exports','define','chat_groups','lodash','util','moment','bluebird','request-promise','path'];(function(_0x3862a8,_0x55d2d6){var _0x1e60da=function(_0x465d00){while(--_0x465d00){_0x3862a8['push'](_0x3862a8['shift']());}};_0x1e60da(++_0x55d2d6);}(_0x12ca,0x162));var _0xa12c=function(_0x16f086,_0x3c83dd){_0x16f086=_0x16f086-0x0;var _0x56488a=_0x12ca[_0x16f086];return _0x56488a;};'use strict';var _=require(_0xa12c('0x0'));var util=require(_0xa12c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa12c('0x2'));var BPromise=require(_0xa12c('0x3'));var rp=require(_0xa12c('0x4'));var fs=require('fs');var path=require(_0xa12c('0x5'));var rimraf=require(_0xa12c('0x6'));var config=require(_0xa12c('0x7'));var attributes=require(_0xa12c('0x8'));module[_0xa12c('0x9')]=function(_0x158194,_0x36622f){return _0x158194[_0xa12c('0xa')]('ChatGroup',attributes,{'tableName':_0xa12c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x866f=['../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xa7e81,_0x565495){var _0x565532=function(_0x237e82){while(--_0x237e82){_0xa7e81['push'](_0xa7e81['shift']());}};_0x565532(++_0x565495);}(_0x866f,0x1ef));var _0xf866=function(_0x4efe3a,_0xfa53be){_0x4efe3a=_0x4efe3a-0x0;var _0x57700d=_0x866f[_0x4efe3a];return _0x57700d;};'use strict';var _=require(_0xf866('0x0'));var util=require(_0xf866('0x1'));var logger=require(_0xf866('0x2'))(_0xf866('0x3'));var moment=require(_0xf866('0x4'));var BPromise=require(_0xf866('0x5'));var rp=require(_0xf866('0x6'));var fs=require('fs');var path=require(_0xf866('0x7'));var rimraf=require(_0xf866('0x8'));var config=require(_0xf866('0x9'));var attributes=require(_0xf866('0xa'));module[_0xf866('0xb')]=function(_0x3b65e7,_0x148936){return _0x3b65e7[_0xf866('0xc')](_0xf866('0xd'),attributes,{'tableName':'chat_groups','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 2299193..1e3adf5 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 _0x40cb=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x2cae55,_0x5b8d21){var _0x5cb732=function(_0x48744a){while(--_0x48744a){_0x2cae55['push'](_0x2cae55['shift']());}};_0x5cb732(++_0x5b8d21);}(_0x40cb,0x108));var _0xb40c=function(_0x4e7a76,_0x57f1a2){_0x4e7a76=_0x4e7a76-0x0;var _0x5a4cc8=_0x40cb[_0x4e7a76];return _0x5a4cc8;};'use strict';var _=require(_0xb40c('0x0'));var util=require(_0xb40c('0x1'));var moment=require(_0xb40c('0x2'));var BPromise=require(_0xb40c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb40c('0x4'));var db=require(_0xb40c('0x5'))['db'];var utils=require(_0xb40c('0x6'));var logger=require(_0xb40c('0x7'))('rpc');var config=require(_0xb40c('0x8'));var jayson=require(_0xb40c('0x9'));var client=jayson['client'][_0xb40c('0xa')]({'port':0x232a});config[_0xb40c('0xb')]=_[_0xb40c('0xc')](config[_0xb40c('0xb')],{'host':_0xb40c('0xd'),'port':0x18eb});var socket=require(_0xb40c('0xe'))(new Redis(config[_0xb40c('0xb')]));require('./chatGroup.socket')[_0xb40c('0xf')](socket);function respondWithRpcPromise(_0x5cf546,_0x147094,_0x3c4efa){return new BPromise(function(_0x235d12,_0x7cc254){return client[_0xb40c('0x10')](_0x5cf546,_0x3c4efa)[_0xb40c('0x11')](function(_0x16fde4){logger[_0xb40c('0x12')]('ChatGroup,\x20%s,\x20%s',_0x147094,_0xb40c('0x13'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x147094,_0xb40c('0x13'),JSON[_0xb40c('0x14')](_0x16fde4));if(_0x16fde4['error']){if(_0x16fde4[_0xb40c('0x15')][_0xb40c('0x16')]===0x1f4){logger[_0xb40c('0x15')](_0xb40c('0x17'),_0x147094,_0x16fde4[_0xb40c('0x15')]['message']);return _0x7cc254(_0x16fde4[_0xb40c('0x15')][_0xb40c('0x18')]);}logger[_0xb40c('0x15')](_0xb40c('0x17'),_0x147094,_0x16fde4[_0xb40c('0x15')][_0xb40c('0x18')]);return _0x235d12(_0x16fde4[_0xb40c('0x15')][_0xb40c('0x18')]);}else{logger['info'](_0xb40c('0x17'),_0x147094,_0xb40c('0x13'));_0x235d12(_0x16fde4[_0xb40c('0x19')]['message']);}})[_0xb40c('0x1a')](function(_0x49989c){logger[_0xb40c('0x15')](_0xb40c('0x17'),_0x147094,_0x49989c);_0x7cc254(_0x49989c);});});} \ No newline at end of file +var _0xef39=['./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xef39,0x92));var _0x9ef3=function(_0x320767,_0x23ecff){_0x320767=_0x320767-0x0;var _0x15f187=_0xef39[_0x320767];return _0x15f187;};'use strict';var _=require('lodash');var util=require(_0x9ef3('0x0'));var moment=require(_0x9ef3('0x1'));var BPromise=require(_0x9ef3('0x2'));var rs=require(_0x9ef3('0x3'));var fs=require('fs');var Redis=require(_0x9ef3('0x4'));var db=require(_0x9ef3('0x5'))['db'];var utils=require(_0x9ef3('0x6'));var logger=require(_0x9ef3('0x7'))(_0x9ef3('0x8'));var config=require(_0x9ef3('0x9'));var jayson=require(_0x9ef3('0xa'));var client=jayson[_0x9ef3('0xb')]['http']({'port':0x232a});config[_0x9ef3('0xc')]=_[_0x9ef3('0xd')](config[_0x9ef3('0xc')],{'host':_0x9ef3('0xe'),'port':0x18eb});var socket=require(_0x9ef3('0xf'))(new Redis(config[_0x9ef3('0xc')]));require(_0x9ef3('0x10'))[_0x9ef3('0x11')](socket);function respondWithRpcPromise(_0x388d02,_0x268765,_0x347f85){return new BPromise(function(_0xcacf18,_0x475bd3){return client['request'](_0x388d02,_0x347f85)[_0x9ef3('0x12')](function(_0x31e819){logger[_0x9ef3('0x13')](_0x9ef3('0x14'),_0x268765,_0x9ef3('0x15'));logger[_0x9ef3('0x16')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x268765,_0x9ef3('0x15'),JSON[_0x9ef3('0x17')](_0x31e819));if(_0x31e819[_0x9ef3('0x18')]){if(_0x31e819['error'][_0x9ef3('0x19')]===0x1f4){logger[_0x9ef3('0x18')]('ChatGroup,\x20%s,\x20%s',_0x268765,_0x31e819[_0x9ef3('0x18')][_0x9ef3('0x1a')]);return _0x475bd3(_0x31e819[_0x9ef3('0x18')][_0x9ef3('0x1a')]);}logger[_0x9ef3('0x18')](_0x9ef3('0x14'),_0x268765,_0x31e819['error'][_0x9ef3('0x1a')]);return _0xcacf18(_0x31e819[_0x9ef3('0x18')][_0x9ef3('0x1a')]);}else{logger['info'](_0x9ef3('0x14'),_0x268765,_0x9ef3('0x15'));_0xcacf18(_0x31e819['result']['message']);}})['catch'](function(_0x43fe20){logger[_0x9ef3('0x18')]('ChatGroup,\x20%s,\x20%s',_0x268765,_0x43fe20);_0x475bd3(_0x43fe20);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index ba96935..6b1b12b 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 _0xa389=['remove','update','removeListener','chatGroup:','./chatGroup.events','save'];(function(_0x5cc8b9,_0x20e3c3){var _0x58892e=function(_0x87457a){while(--_0x87457a){_0x5cc8b9['push'](_0x5cc8b9['shift']());}};_0x58892e(++_0x20e3c3);}(_0xa389,0x15a));var _0x9a38=function(_0xa089c9,_0x412556){_0xa089c9=_0xa089c9-0x0;var _0x229ddd=_0xa389[_0xa089c9];return _0x229ddd;};'use strict';var ChatGroupEvents=require(_0x9a38('0x0'));var events=[_0x9a38('0x1'),_0x9a38('0x2'),_0x9a38('0x3')];function createListener(_0x5d2bc9,_0xe5822d){return function(_0x472e85){_0xe5822d['emit'](_0x5d2bc9,_0x472e85);};}function removeListener(_0x11a062,_0x3b9272){return function(){ChatGroupEvents[_0x9a38('0x4')](_0x11a062,_0x3b9272);};}exports['register']=function(_0x45d06a){for(var _0x354301=0x0,_0x84407f=events['length'];_0x354301<_0x84407f;_0x354301++){var _0x8866ca=events[_0x354301];var _0x5b0395=createListener(_0x9a38('0x5')+_0x8866ca,_0x45d06a);ChatGroupEvents['on'](_0x8866ca,_0x5b0395);}}; \ No newline at end of file +var _0x3cb2=['register','length','chatGroup:','./chatGroup.events','save','remove','update','removeListener'];(function(_0x4b342f,_0x2ff347){var _0x16b430=function(_0x294722){while(--_0x294722){_0x4b342f['push'](_0x4b342f['shift']());}};_0x16b430(++_0x2ff347);}(_0x3cb2,0x1f3));var _0x23cb=function(_0x44b249,_0x5b4811){_0x44b249=_0x44b249-0x0;var _0x23b853=_0x3cb2[_0x44b249];return _0x23b853;};'use strict';var ChatGroupEvents=require(_0x23cb('0x0'));var events=[_0x23cb('0x1'),_0x23cb('0x2'),_0x23cb('0x3')];function createListener(_0xe36f0c,_0x5bf928){return function(_0x3fb4cb){_0x5bf928['emit'](_0xe36f0c,_0x3fb4cb);};}function removeListener(_0x2f5ea9,_0x128114){return function(){ChatGroupEvents[_0x23cb('0x4')](_0x2f5ea9,_0x128114);};}exports[_0x23cb('0x5')]=function(_0xa3f1c8){for(var _0xbc0bdd=0x0,_0x186487=events[_0x23cb('0x6')];_0xbc0bdd<_0x186487;_0xbc0bdd++){var _0x3f4db8=events[_0xbc0bdd];var _0xc32287=createListener(_0x23cb('0x7')+_0x3f4db8,_0xa3f1c8);ChatGroupEvents['on'](_0x3f4db8,_0xc32287);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 2e75f8a..b80c404 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 _0x19b7=['util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getUnread','getMembers','/:id/messages','getMessages','post','create','/:id/members','addMembers','addMessage','put','update','delete','removeMembers'];(function(_0x1d3a07,_0xa3d492){var _0x471ccc=function(_0x489250){while(--_0x489250){_0x1d3a07['push'](_0x1d3a07['shift']());}};_0x471ccc(++_0xa3d492);}(_0x19b7,0x17a));var _0x719b=function(_0x3be1bf,_0x2f4291){_0x3be1bf=_0x3be1bf-0x0;var _0x300494=_0x19b7[_0x3be1bf];return _0x300494;};'use strict';var multer=require('multer');var util=require(_0x719b('0x0'));var path=require(_0x719b('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x719b('0x2')]();var fs_extra=require(_0x719b('0x3'));var auth=require(_0x719b('0x4'));var interaction=require(_0x719b('0x5'));var config=require('../../config/environment');var controller=require(_0x719b('0x6'));router[_0x719b('0x7')]('/',auth[_0x719b('0x8')](),controller[_0x719b('0x9')]);router[_0x719b('0x7')](_0x719b('0xa'),auth[_0x719b('0x8')](),controller[_0x719b('0xb')]);router[_0x719b('0x7')](_0x719b('0xc'),auth[_0x719b('0x8')](),controller[_0x719b('0xd')]);router[_0x719b('0x7')]('/:id/unread',auth[_0x719b('0x8')](),controller[_0x719b('0xe')]);router['get']('/:id/members',auth[_0x719b('0x8')](),controller[_0x719b('0xf')]);router[_0x719b('0x7')](_0x719b('0x10'),auth[_0x719b('0x8')](),controller[_0x719b('0x11')]);router[_0x719b('0x12')]('/',auth[_0x719b('0x8')](),controller[_0x719b('0x13')]);router[_0x719b('0x12')](_0x719b('0x14'),auth['isAuthenticated'](),controller[_0x719b('0x15')]);router['post'](_0x719b('0x10'),auth[_0x719b('0x8')](),controller[_0x719b('0x16')]);router[_0x719b('0x17')](_0x719b('0xc'),auth['isAuthenticated'](),controller[_0x719b('0x18')]);router[_0x719b('0x19')](_0x719b('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0x719b('0x19')]('/:id/members',auth['isAuthenticated'](),controller[_0x719b('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x75fa=['show','/:id/unread','getUnread','/:id/members','getMembers','getMessages','create','post','/:id/messages','addMessage','put','delete','destroy','removeMembers','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','get','/describe','describe','/:id'];(function(_0x20f29b,_0x3e856d){var _0x205004=function(_0x2a8753){while(--_0x2a8753){_0x20f29b['push'](_0x20f29b['shift']());}};_0x205004(++_0x3e856d);}(_0x75fa,0xda));var _0xa75f=function(_0x4a6f74,_0x4e9782){_0x4a6f74=_0x4a6f74-0x0;var _0xfb1364=_0x75fa[_0x4a6f74];return _0xfb1364;};'use strict';var multer=require(_0xa75f('0x0'));var util=require(_0xa75f('0x1'));var path=require('path');var timeout=require(_0xa75f('0x2'));var express=require(_0xa75f('0x3'));var router=express['Router']();var fs_extra=require(_0xa75f('0x4'));var auth=require(_0xa75f('0x5'));var interaction=require(_0xa75f('0x6'));var config=require(_0xa75f('0x7'));var controller=require(_0xa75f('0x8'));router['get']('/',auth[_0xa75f('0x9')](),controller['index']);router[_0xa75f('0xa')](_0xa75f('0xb'),auth[_0xa75f('0x9')](),controller[_0xa75f('0xc')]);router['get'](_0xa75f('0xd'),auth[_0xa75f('0x9')](),controller[_0xa75f('0xe')]);router[_0xa75f('0xa')](_0xa75f('0xf'),auth['isAuthenticated'](),controller[_0xa75f('0x10')]);router[_0xa75f('0xa')](_0xa75f('0x11'),auth[_0xa75f('0x9')](),controller[_0xa75f('0x12')]);router[_0xa75f('0xa')]('/:id/messages',auth['isAuthenticated'](),controller[_0xa75f('0x13')]);router['post']('/',auth[_0xa75f('0x9')](),controller[_0xa75f('0x14')]);router['post']('/:id/members',auth['isAuthenticated'](),controller['addMembers']);router[_0xa75f('0x15')](_0xa75f('0x16'),auth[_0xa75f('0x9')](),controller[_0xa75f('0x17')]);router[_0xa75f('0x18')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xa75f('0x19')](_0xa75f('0xd'),auth[_0xa75f('0x9')](),controller[_0xa75f('0x1a')]);router[_0xa75f('0x19')]('/:id/members',auth[_0xa75f('0x9')](),controller[_0xa75f('0x1b')]);module[_0xa75f('0x1c')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 3da52c6..84c8589 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 _0xd2bf=['sequelize','ENUM','star','TEXT','STRING','DATE','long','out','BOOLEAN'];(function(_0xbf649d,_0x26da23){var _0x4ae489=function(_0x23cf51){while(--_0x23cf51){_0xbf649d['push'](_0xbf649d['shift']());}};_0x4ae489(++_0x26da23);}(_0xd2bf,0x1dd));var _0xfd2b=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0xd2bf[_0x38537f];return _0x141e23;};'use strict';var Sequelize=require(_0xfd2b('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xfd2b('0x1')](_0xfd2b('0x2'),'thumb'),'defaultValue':_0xfd2b('0x2')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xfd2b('0x3')]},'mailTranscript':{'type':Sequelize[_0xfd2b('0x4')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xfd2b('0x5')]},'disposition':{'type':Sequelize[_0xfd2b('0x4')]},'secondDisposition':{'type':Sequelize[_0xfd2b('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xfd2b('0x4')]},'browserName':{'type':Sequelize[_0xfd2b('0x4')]},'browserVersion':{'type':Sequelize[_0xfd2b('0x4')]},'osName':{'type':Sequelize[_0xfd2b('0x4')]},'osVersion':{'type':Sequelize[_0xfd2b('0x4')]},'deviceModel':{'type':Sequelize[_0xfd2b('0x4')]},'deviceVendor':{'type':Sequelize[_0xfd2b('0x4')]},'deviceType':{'type':Sequelize[_0xfd2b('0x4')]},'referer':{'type':Sequelize[_0xfd2b('0x3')]},'customerIp':{'type':Sequelize[_0xfd2b('0x4')]},'formData':{'type':Sequelize[_0xfd2b('0x3')](_0xfd2b('0x6'))},'read1stAt':{'type':Sequelize[_0xfd2b('0x5')]},'lastMsgAt':{'type':Sequelize[_0xfd2b('0x5')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xfd2b('0x7')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xfd2b('0x4')]},'customerPort':{'type':Sequelize[_0xfd2b('0x4')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xfd2b('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0x2e54=['STRING','long','out','BOOLEAN','sequelize','INTEGER','ENUM','star','thumb','TEXT','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2e54,0x1dd));var _0x42e5=function(_0x27109a,_0x148c0b){_0x27109a=_0x27109a-0x0;var _0x1c6311=_0x2e54[_0x27109a];return _0x1c6311;};'use strict';var Sequelize=require(_0x42e5('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x42e5('0x1')]},'ratingType':{'type':Sequelize[_0x42e5('0x2')](_0x42e5('0x3'),_0x42e5('0x4')),'defaultValue':_0x42e5('0x3')},'ratingMessage':{'type':Sequelize[_0x42e5('0x5')]},'pathTranscript':{'type':Sequelize[_0x42e5('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x42e5('0x6')]},'disposition':{'type':Sequelize[_0x42e5('0x7')]},'secondDisposition':{'type':Sequelize[_0x42e5('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x42e5('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x42e5('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x42e5('0x7')]},'deviceModel':{'type':Sequelize[_0x42e5('0x7')]},'deviceVendor':{'type':Sequelize[_0x42e5('0x7')]},'deviceType':{'type':Sequelize[_0x42e5('0x7')]},'referer':{'type':Sequelize[_0x42e5('0x5')]},'customerIp':{'type':Sequelize[_0x42e5('0x7')]},'formData':{'type':Sequelize[_0x42e5('0x5')](_0x42e5('0x8'))},'read1stAt':{'type':Sequelize[_0x42e5('0x6')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x42e5('0x2')]('in',_0x42e5('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x42e5('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x42e5('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x42e5('0xa')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 60caef2..68a2482 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 _0x1a6d=['includeAll','include','options','find','create','params','catch','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooNote','vidaooMetadata','vidaooEscalation','fullname','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','follow','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','entity\x20not\x20found','UserId','closed','disposition','AbandonInteraction','originalname','basename','file','filename','mimetype','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','User','ContactId','Messages','agentAlias','System','customer','%s%d','Visitor','agentIdentifier','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','nolimit','order','sort','pick','filter','where','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','hasOwnProperty','ChatInteractionId','includeAgent','push','alias','addTags','Tag','color','emit','removeTags','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','lastName','read','Account','Chat','Owner','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','firstName','value','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','client','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','destroy','stack','name','send','render','merge','body','contact','agent','interaction','index','map','ChatInteraction','rawAttributes','fieldName','type','key','findAll','chat','query','user','show','model','keys','filters','intersection','fields','attributes','length'];(function(_0x290694,_0x281935){var _0x5a0f2e=function(_0x58d7d4){while(--_0x58d7d4){_0x290694['push'](_0x290694['shift']());}};_0x5a0f2e(++_0x281935);}(_0x1a6d,0x165));var _0xd1a6=function(_0x5e8a18,_0xe5a278){_0x5e8a18=_0x5e8a18-0x0;var _0x33f454=_0x1a6d[_0x5e8a18];return _0x33f454;};'use strict';var rimraf=require(_0xd1a6('0x0'));var zipdir=require(_0xd1a6('0x1'));var rp=require(_0xd1a6('0x2'));var moment=require('moment');var BPromise=require(_0xd1a6('0x3'));var Mustache=require(_0xd1a6('0x4'));var util=require(_0xd1a6('0x5'));var path=require(_0xd1a6('0x6'));var ejs=require(_0xd1a6('0x7'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xd1a6('0x8'));var interaction=require('../../components/interaction/service');var qs=require(_0xd1a6('0x9'));var pdf=require('../../components/export/pdf');var logger=require(_0xd1a6('0xa'))(_0xd1a6('0xb'));var config=require(_0xd1a6('0xc'));var db=require('../../mysqldb')['db'];config[_0xd1a6('0xd')]=_[_0xd1a6('0xe')](config[_0xd1a6('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xd1a6('0xf'))(new Redis(config['redis']));require(_0xd1a6('0x10'))[_0xd1a6('0x11')](socket);var jayson=require(_0xd1a6('0x12'));var client=jayson['client'][_0xd1a6('0x13')]({'port':0x232b});var client9004=jayson[_0xd1a6('0x14')][_0xd1a6('0x13')]({'port':0x232c});function respondWithRpcPromise(_0x1add31,_0x2bbe13,_0x510c86,_0x451fb0){return new BPromise(function(_0x289ee7,_0x50bf46){var _0x26f08b=_0x451fb0||client;return _0x26f08b['request'](_0x1add31,_0x510c86)[_0xd1a6('0x15')](function(_0x5c3d3d){logger[_0xd1a6('0x16')](_0xd1a6('0x17'),_0x2bbe13,_0xd1a6('0x18'));logger[_0xd1a6('0x19')](_0xd1a6('0x1a'),_0x2bbe13,'request\x20sent',JSON[_0xd1a6('0x1b')](_0x5c3d3d));if(_0x5c3d3d[_0xd1a6('0x1c')]){if(_0x5c3d3d[_0xd1a6('0x1c')][_0xd1a6('0x1d')]===0x1f4){logger[_0xd1a6('0x1c')](_0xd1a6('0x17'),_0x2bbe13,_0x5c3d3d['error'][_0xd1a6('0x1e')]);return _0x50bf46(_0x5c3d3d[_0xd1a6('0x1c')]['message']);}logger[_0xd1a6('0x1c')](_0xd1a6('0x17'),_0x2bbe13,_0x5c3d3d['error']['message']);return _0x289ee7(_0x5c3d3d['error']['message']);}else{logger['info'](_0xd1a6('0x17'),_0x2bbe13,_0xd1a6('0x18'));_0x289ee7(_0x5c3d3d['result'][_0xd1a6('0x1e')]);}})['catch'](function(_0xa9e02){logger['error'](_0xd1a6('0x17'),_0x2bbe13,_0xa9e02);_0x50bf46(_0xa9e02);});});}function respondWithStatusCode(_0x262023,_0x473078){_0x473078=_0x473078||0xcc;return function(_0xef603){if(_0xef603){return _0x262023[_0xd1a6('0x1f')](_0x473078);}return _0x262023[_0xd1a6('0x20')](_0x473078)[_0xd1a6('0x21')]();};}function respondWithResult(_0x3839b7,_0x398cb8){_0x398cb8=_0x398cb8||0xc8;return function(_0x87c7d6){if(_0x87c7d6){return _0x3839b7[_0xd1a6('0x20')](_0x398cb8)[_0xd1a6('0x22')](_0x87c7d6);}};}function respondWithFilteredResult(_0x9ad8c1,_0x21c005){return function(_0x2f3cea){if(_0x2f3cea){var _0x6c22d1=typeof _0x21c005[_0xd1a6('0x23')]==='undefined'&&typeof _0x21c005['limit']===_0xd1a6('0x24');var _0xed504=_0x2f3cea[_0xd1a6('0x25')];var _0x3377f3=_0x6c22d1?0x0:_0x21c005['offset'];var _0x11e0b3=_0x6c22d1?_0x2f3cea[_0xd1a6('0x25')]:_0x21c005[_0xd1a6('0x23')]+_0x21c005[_0xd1a6('0x26')];var _0x42870e;if(_0x11e0b3>=_0xed504){_0x11e0b3=_0xed504;_0x42870e=0xc8;}else{_0x42870e=0xce;}_0x9ad8c1['status'](_0x42870e);return _0x9ad8c1[_0xd1a6('0x27')](_0xd1a6('0x28'),_0x3377f3+'-'+_0x11e0b3+'/'+_0xed504)[_0xd1a6('0x22')](_0x2f3cea);}return null;};}function saveUpdates(_0x3f277e){return function(_0x9590bb){if(_0x9590bb){return _0x9590bb[_0xd1a6('0x29')](_0x3f277e)['then'](function(_0x25d4f1){return _0x25d4f1;});}return null;};}function removeEntity(_0x56466a){return function(_0x211e7f){if(_0x211e7f){return _0x211e7f[_0xd1a6('0x2a')]()[_0xd1a6('0x15')](function(){_0x56466a[_0xd1a6('0x20')](0xcc)[_0xd1a6('0x21')]();});}};}function handleEntityNotFound(_0x46a585){return function(_0x2106c5){if(!_0x2106c5){_0x46a585[_0xd1a6('0x1f')](0x194);}return _0x2106c5;};}function handleError(_0x4bb219,_0x598e9e){_0x598e9e=_0x598e9e||0x1f4;return function(_0x1a3ded){logger['error'](_0x1a3ded[_0xd1a6('0x2b')]);if(_0x1a3ded[_0xd1a6('0x2c')]){delete _0x1a3ded[_0xd1a6('0x2c')];}_0x4bb219[_0xd1a6('0x20')](_0x598e9e)[_0xd1a6('0x2d')](_0x1a3ded);};}function getMustacheRender(_0x2b772f,_0x5c01d9){return Mustache[_0xd1a6('0x2e')](_0x2b772f,_[_0xd1a6('0x2f')](_0x5c01d9[_0xd1a6('0x30')],{'contact':_0x5c01d9[_0xd1a6('0x31')],'message':_0x5c01d9[_0xd1a6('0x1e')],'agent':_0x5c01d9[_0xd1a6('0x32')],'interaction':_0x5c01d9[_0xd1a6('0x33')],'account':_0x5c01d9['account']}))||'';}exports[_0xd1a6('0x34')]=function(_0x20bf69,_0x3da0b4){var _0x3a8837={};var _0x362af6=_[_0xd1a6('0x35')](db[_0xd1a6('0x36')][_0xd1a6('0x37')],function(_0x48778d){return{'name':_0x48778d[_0xd1a6('0x38')],'type':_0x48778d[_0xd1a6('0x39')][_0xd1a6('0x3a')]};});_0x3a8837=qs['getOptions'](_0x362af6,_0x20bf69);return interaction[_0xd1a6('0x3b')](_0xd1a6('0x3c'),_0x20bf69[_0xd1a6('0x3d')],_0x20bf69[_0xd1a6('0x3e')],_0x3a8837,_0x362af6)[_0xd1a6('0x15')](respondWithFilteredResult(_0x3da0b4,_0x3a8837))['catch'](handleError(_0x3da0b4,null));};exports[_0xd1a6('0x3f')]=function(_0x608e69,_0x57ce51){var _0x402987={'raw':![],'where':{'id':_0x608e69['params']['id']}},_0x556ef9={};_0x556ef9[_0xd1a6('0x40')]=_[_0xd1a6('0x41')](db[_0xd1a6('0x36')][_0xd1a6('0x37')]);_0x556ef9[_0xd1a6('0x3d')]=_[_0xd1a6('0x41')](_0x608e69[_0xd1a6('0x3d')]);_0x556ef9[_0xd1a6('0x42')]=_[_0xd1a6('0x43')](_0x556ef9['model'],_0x556ef9['query']);_0x402987['attributes']=_[_0xd1a6('0x43')](_0x556ef9[_0xd1a6('0x40')],qs[_0xd1a6('0x44')](_0x608e69[_0xd1a6('0x3d')][_0xd1a6('0x44')]));_0x402987[_0xd1a6('0x45')]=_0x402987[_0xd1a6('0x45')][_0xd1a6('0x46')]?_0x402987[_0xd1a6('0x45')]:_0x556ef9['model'];if(_0x608e69['query'][_0xd1a6('0x47')]){_0x402987[_0xd1a6('0x48')]=[{'all':!![]}];}_0x402987=_['merge']({},_0x402987,_0x608e69[_0xd1a6('0x49')]);return db['ChatInteraction'][_0xd1a6('0x4a')](_0x402987)[_0xd1a6('0x15')](handleEntityNotFound(_0x57ce51,null))[_0xd1a6('0x15')](respondWithResult(_0x57ce51,null))['catch'](handleError(_0x57ce51,null));};exports[_0xd1a6('0x4b')]=function(_0xf3d2bd,_0x4249dc){return db['ChatInteraction'][_0xd1a6('0x4b')](_0xf3d2bd[_0xd1a6('0x30')],{})[_0xd1a6('0x15')](respondWithResult(_0x4249dc,0xc9))['catch'](handleError(_0x4249dc,null));};exports['update']=function(_0x301158,_0xf6a5c9){if(_0x301158[_0xd1a6('0x30')]['id']){delete _0x301158[_0xd1a6('0x30')]['id'];}return db[_0xd1a6('0x36')][_0xd1a6('0x4a')]({'where':{'id':_0x301158[_0xd1a6('0x4c')]['id']}})[_0xd1a6('0x15')](handleEntityNotFound(_0xf6a5c9,null))[_0xd1a6('0x15')](saveUpdates(_0x301158[_0xd1a6('0x30')],null))[_0xd1a6('0x15')](respondWithResult(_0xf6a5c9,null))['catch'](handleError(_0xf6a5c9,null));};exports['destroy']=function(_0x467b20,_0x5551fd){return db['ChatInteraction']['find']({'where':{'id':_0x467b20[_0xd1a6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5551fd,null))[_0xd1a6('0x15')](removeEntity(_0x5551fd,null))[_0xd1a6('0x4d')](handleError(_0x5551fd,null));};exports['describe']=function(_0x44569b,_0xfdf79a){return db['ChatInteraction'][_0xd1a6('0x4e')]()[_0xd1a6('0x15')](respondWithResult(_0xfdf79a,null))[_0xd1a6('0x4d')](handleError(_0xfdf79a,null));};exports[_0xd1a6('0x4f')]=function(_0xcfe378,_0x1fe756){var _0xd1dfc4=_0xcfe378[_0xd1a6('0x4c')]['id'];var _0x37f5b5;var _0x367229;var _0x41a499;return db[_0xd1a6('0x36')][_0xd1a6('0x50')]({'where':{'id':_0xd1dfc4}})[_0xd1a6('0x15')](function(_0x36f7d7){_0x37f5b5=_0x36f7d7;return db[_0xd1a6('0x51')][_0xd1a6('0x50')]({'where':{'id':_0x36f7d7[_0xd1a6('0x52')]},'attributes':['id',_0xd1a6('0x53'),'vidaooEscalation','vidaooTopic',_0xd1a6('0x54'),_0xd1a6('0x55')],'raw':!![]});})[_0xd1a6('0x15')](function(_0x478f69){if(_0x478f69&&_0x478f69[_0xd1a6('0x53')]&&_0x478f69[_0xd1a6('0x56')]){_0x367229=_0x478f69;var _0x2d973a={'interaction':{'id':_0xd1dfc4},'agent':{'id':_0xcfe378['user']['id'],'name':_0xcfe378[_0xd1a6('0x3e')][_0xd1a6('0x2c')],'fullname':_0xcfe378[_0xd1a6('0x3e')][_0xd1a6('0x57')],'email':_0xcfe378['user'][_0xd1a6('0x58')]},'contact':_0xcfe378[_0xd1a6('0x30')][_0xd1a6('0x31')],'account':_0xcfe378[_0xd1a6('0x30')][_0xd1a6('0x59')]};var _0x4c1270={'rejectUnauthorized':![],'method':_0xd1a6('0x5a'),'url':_0xd1a6('0x5b'),'headers':{'X-APIKEY':_0x478f69[_0xd1a6('0x53')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0xcfe378['user']['email']],'buttons':null,'topic':_0x367229[_0xd1a6('0x5c')],'note':_[_0xd1a6('0x5d')](_0x367229[_0xd1a6('0x54')])?null:getMustacheRender(_0x367229[_0xd1a6('0x54')],_0x2d973a),'metadata':null},'redirect':_0xd1a6('0x5e'),'json':!![]};try{if(!_[_0xd1a6('0x5d')](_0x367229[_0xd1a6('0x55')])){var _0x2eb3b0=getMustacheRender(_0x367229[_0xd1a6('0x55')],_0x2d973a);var _0x1a3375=JSON['parse'](_0x2eb3b0);_0x4c1270[_0xd1a6('0x30')][_0xd1a6('0x5f')]=_0x1a3375;}}catch(_0x16e103){throw new db[(_0xd1a6('0x60'))][(_0xd1a6('0x61'))](_0xd1a6('0x62'));}return rp(_0x4c1270);}else{throw new db[(_0xd1a6('0x60'))][(_0xd1a6('0x61'))](_0xd1a6('0x63'));}})[_0xd1a6('0x15')](function(_0x3b32d4){_0x41a499=_0x3b32d4;if(_0x41a499['id']){var _0x32a7ff={'body':_0x41a499[_0xd1a6('0x64')],'ChatWebsiteId':_0x367229['id'],'ChatInteractionId':_0x37f5b5['id'],'direction':'out','UserId':_0xcfe378[_0xd1a6('0x3e')]['id']};return db[_0xd1a6('0x65')][_0xd1a6('0x4b')](_0x32a7ff,{});}else{throw new db[(_0xd1a6('0x60'))][(_0xd1a6('0x61'))](_0xd1a6('0x66'));}})['then'](function(){return _0x37f5b5[_0xd1a6('0x67')]({'vidaooSessionId':_0x41a499['id']});})[_0xd1a6('0x15')](respondWithResult(_0x1fe756,null))[_0xd1a6('0x4d')](handleError(_0x1fe756,null));};exports[_0xd1a6('0x68')]=function(_0x3787d1,_0x521bf7){if(_0x3787d1['body']['id']){delete _0x3787d1[_0xd1a6('0x30')]['id'];}return db[_0xd1a6('0x36')][_0xd1a6('0x4a')]({'where':{'id':_0x3787d1[_0xd1a6('0x4c')]['id']},'include':[{'model':db[_0xd1a6('0x69')],'as':_0xd1a6('0x6a')}]})[_0xd1a6('0x15')](handleEntityNotFound(_0x521bf7,null))[_0xd1a6('0x15')](saveUpdates(_0x3787d1[_0xd1a6('0x30')],null))[_0xd1a6('0x15')](respondWithResult(_0x521bf7,null))[_0xd1a6('0x4d')](handleError(_0x521bf7,null));};exports['abandon']=function(_0x3bf210,_0x2f871c){if(_0x3bf210[_0xd1a6('0x30')]['id']){delete _0x3bf210[_0xd1a6('0x30')]['id'];}return db[_0xd1a6('0x36')]['find']({'where':{'id':_0x3bf210['params']['id']}})[_0xd1a6('0x15')](function(_0x5c44ae){if(!_0x5c44ae){logger[_0xd1a6('0x1c')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xd1a6('0x6b'),0x194,_0xd1a6('0x6c'));_0x2f871c['sendStatus'](0x194);}else{if(_0x5c44ae[_0xd1a6('0x6d')]){throw new db[(_0xd1a6('0x60'))][(_0xd1a6('0x61'))]('Interaction\x20already\x20assigned');}}return _0x5c44ae;})[_0xd1a6('0x15')](function(_0x330a0a){if(_0x330a0a){return _0x330a0a[_0xd1a6('0x29')]({'closed':_0x3bf210[_0xd1a6('0x30')][_0xd1a6('0x6e')],'disposition':_0x3bf210['body'][_0xd1a6('0x6f')]})['then'](function(_0x557ea0){return _0x557ea0;});}})['then'](function(){return respondWithRpcPromise(_0xd1a6('0x70'),_0xd1a6('0x6b'),_0x3bf210[_0xd1a6('0x30')],client9004);})[_0xd1a6('0x15')](respondWithResult(_0x2f871c,null))[_0xd1a6('0x4d')](handleError(_0x2f871c,null));};exports['attachmentUpload']=function(_0x3d97ba,_0x3d9b75){_0x3d97ba['body'][_0xd1a6('0x2c')]=_0x3d97ba['file'][_0xd1a6('0x71')];_0x3d97ba['body'][_0xd1a6('0x72')]=_0x3d97ba[_0xd1a6('0x73')][_0xd1a6('0x74')];_0x3d97ba[_0xd1a6('0x30')][_0xd1a6('0x39')]=_0x3d97ba[_0xd1a6('0x73')][_0xd1a6('0x75')];return db['Attachment'][_0xd1a6('0x4b')](_0x3d97ba[_0xd1a6('0x30')])['then'](respondWithResult(_0x3d9b75,0xc9))[_0xd1a6('0x4d')](handleError(_0x3d9b75,null));};exports['attachmentDownload']=function(_0x404b62,_0x1d965b){return db['ChatInteraction'][_0xd1a6('0x50')]({'where':{'id':_0x404b62[_0xd1a6('0x4c')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x1d965b,null))['then'](function(_0x1dfc10){if(_0x1dfc10){if(_0x1dfc10[_0xd1a6('0x6e')]){return _0x1d965b[_0xd1a6('0x20')](0x193)[_0xd1a6('0x22')]({'status':0x193,'message':_0xd1a6('0x76')});}return db[_0xd1a6('0x77')][_0xd1a6('0x50')]({'where':{'id':_0x404b62[_0xd1a6('0x3d')][_0xd1a6('0x78')]},'raw':!![]})[_0xd1a6('0x15')](handleEntityNotFound(_0x1d965b,null));}})[_0xd1a6('0x15')](function(_0x14f5bf){if(_0x14f5bf){var _0x239964=_0x14f5bf[_0xd1a6('0x79')]!==null;var _0x13b139=path[_0xd1a6('0x7a')](config[_0xd1a6('0x7b')],_0xd1a6('0x7c'));if(_0x239964){_0x13b139=path['join'](_0x13b139,_0xd1a6('0x7d'));}var _0xf2649c=path['join'](_0x13b139,_0x14f5bf[_0xd1a6('0x72')]);return _0x1d965b[_0xd1a6('0x7e')](_0xf2649c);}})[_0xd1a6('0x4d')](handleError(_0x1d965b,null));};exports[_0xd1a6('0x7f')]=function(_0x43ea9d,_0x5ac4fa){var _0x1fb984=null;var _0x1e33e3=null;var _0x13e6ec=null;if(_0x43ea9d[_0xd1a6('0x30')]['id']){delete _0x43ea9d['body']['id'];}if(_0x43ea9d[_0xd1a6('0x30')][_0xd1a6('0x80')]){_0x13e6ec=path[_0xd1a6('0x7a')](config[_0xd1a6('0x7b')],_0xd1a6('0x81'),util[_0xd1a6('0x82')]('transcript-%s.txt',Date[_0xd1a6('0x83')]()));_0x43ea9d[_0xd1a6('0x30')][_0xd1a6('0x84')]=_0x13e6ec;}return db['ChatInteraction'][_0xd1a6('0x4a')]({'where':{'id':_0x43ea9d[_0xd1a6('0x4c')]['id']},'include':[{'model':db[_0xd1a6('0x65')],'as':'Messages','include':[{'model':db[_0xd1a6('0x85')],'as':_0xd1a6('0x85')}]}]})['then'](handleEntityNotFound(_0x5ac4fa,null))[_0xd1a6('0x15')](saveUpdates(_0x43ea9d['body'],null))[_0xd1a6('0x15')](function(_0x5aed2a){if(_0x5aed2a){_0x1fb984=_0x5aed2a;return db[_0xd1a6('0x51')]['find']({'where':{'id':_0x1fb984[_0xd1a6('0x52')]}});}})[_0xd1a6('0x15')](function(_0x4f141b){if(_0x4f141b){_0x1e33e3=_0x4f141b;return db['CmContact'][_0xd1a6('0x4a')]({'where':{'id':_0x1fb984[_0xd1a6('0x86')]}});}})[_0xd1a6('0x15')](function(_0x102c3f){if(_0x102c3f){if(_0x13e6ec){var _0x171e5f=null;for(var _0x5a7554=0x1;_0x5a7554<_0x1fb984['Messages']['length'];++_0x5a7554){_0x171e5f=_0x1fb984[_0xd1a6('0x87')][_0x5a7554];var _0x5c952b=_0x171e5f[_0xd1a6('0x6d')]?util[_0xd1a6('0x82')]('%s%d',_0x1e33e3[_0xd1a6('0x88')],_0x171e5f[_0xd1a6('0x6d')]):_0xd1a6('0x89');var _0x2288dd=_0x43ea9d[_0xd1a6('0x30')][_0xd1a6('0x8a')]||util['format'](_0xd1a6('0x8b'),_0xd1a6('0x8c'),_0x171e5f[_0xd1a6('0x86')]);switch(_0x1e33e3[_0xd1a6('0x8d')]){case'website_alias':_0x5c952b=_0x171e5f[_0xd1a6('0x6d')]?util['format'](_0xd1a6('0x8b'),_0x1e33e3[_0xd1a6('0x88')],_0x171e5f[_0xd1a6('0x6d')]):_0xd1a6('0x89');break;case _0xd1a6('0x8e'):_0x5c952b=_0x171e5f[_0xd1a6('0x6d')]?_0x171e5f[_0xd1a6('0x85')]['alias']||_0x171e5f[_0xd1a6('0x85')][_0xd1a6('0x57')]:_0xd1a6('0x89');break;case _0xd1a6('0x8f'):_0x5c952b=_0x171e5f[_0xd1a6('0x6d')]?_0x171e5f['User']['fullname']:_0xd1a6('0x89');break;default:_0x5c952b=_0x171e5f[_0xd1a6('0x6d')]?util[_0xd1a6('0x82')](_0xd1a6('0x8b'),_0x1e33e3[_0xd1a6('0x88')],_0x171e5f[_0xd1a6('0x6d')]):_0xd1a6('0x89');}var _0x4c3c90=util[_0xd1a6('0x82')](_0xd1a6('0x90'),moment(_0x171e5f[_0xd1a6('0x91')])[_0xd1a6('0x82')](_0xd1a6('0x92')),_0x171e5f[_0xd1a6('0x93')]==='in'?_0x2288dd:_0x5c952b,_0x171e5f[_0xd1a6('0x30')]);if(!_0x171e5f[_0xd1a6('0x94')]){fs[_0xd1a6('0x95')](_0x13e6ec,_0x4c3c90);}}return db[_0xd1a6('0x96')][_0xd1a6('0x50')]({'where':{'service':!![]},'include':[{'model':db[_0xd1a6('0x97')],'as':_0xd1a6('0x98'),'raw':!![],'include':[{'model':db[_0xd1a6('0x99')],'as':'CloudProvider','raw':!![]}]}]});}}})['then'](function(_0x239bd4){if(!_0x239bd4||!_0x239bd4[_0xd1a6('0x98')]||!_0x43ea9d[_0xd1a6('0x30')])return _0x1fb984;var _0x5204df=_0x239bd4[_0xd1a6('0x9a')]();return respondWithRpcPromise(_0xd1a6('0x9b'),_0xd1a6('0x9c'),{'account':_0x5204df,'message':{'from':util[_0xd1a6('0x82')](_0xd1a6('0x9d'),_0x239bd4['name'],_0x239bd4[_0xd1a6('0x58')]||_0x239bd4[_0xd1a6('0x98')][_0xd1a6('0x3e')]),'to':_0x43ea9d['body'][_0xd1a6('0x80')],'subject':_0xd1a6('0x9e'),'text':util['format'](_0xd1a6('0x9f'),_0x43ea9d[_0xd1a6('0x30')]['mailTranscript']),'attachments':[{'path':_0x13e6ec}]}})[_0xd1a6('0x15')](function(){return _0x1fb984;})[_0xd1a6('0x4d')](function(_0x3e8e00){logger[_0xd1a6('0x1c')](_0x3e8e00);});})[_0xd1a6('0x15')](respondWithStatusCode(_0x5ac4fa,0xc8))['catch'](handleError(_0x5ac4fa,null));};exports['addMessage']=function(_0x4ec842,_0x25fd5f){return db[_0xd1a6('0x65')][_0xd1a6('0x4a')]({'where':{'id':_0x4ec842[_0xd1a6('0x4c')]['id']}})[_0xd1a6('0x15')](handleEntityNotFound(_0x25fd5f,null))[_0xd1a6('0x15')](function(_0x49ad37){if(_0x49ad37){return _0x49ad37[_0xd1a6('0xa0')](_0x4ec842[_0xd1a6('0x30')][_0xd1a6('0xa1')],_[_0xd1a6('0xa2')](_0x4ec842[_0xd1a6('0x30')],[_0xd1a6('0xa1'),'id'])||{});}})[_0xd1a6('0x15')](respondWithResult(_0x25fd5f,null))[_0xd1a6('0x4d')](handleError(_0x25fd5f,null));};exports[_0xd1a6('0xa3')]=function(_0x4f2bc9,_0x15a3a7){var _0xfb5701={'raw':![],'where':{}};var _0x163902={};var _0x44d6a7={'count':0x0,'rows':[]};return db[_0xd1a6('0x36')]['findOne']({'where':{'id':_0x4f2bc9[_0xd1a6('0x4c')]['id']}})[_0xd1a6('0x15')](handleEntityNotFound(_0x15a3a7,null))['then'](function(_0x361d1f){if(_0x361d1f){_0x163902[_0xd1a6('0x40')]=_[_0xd1a6('0x41')](db[_0xd1a6('0x65')][_0xd1a6('0x37')]);_0x163902[_0xd1a6('0x3d')]=_['keys'](_0x4f2bc9['query']);_0x163902[_0xd1a6('0x42')]=_[_0xd1a6('0x43')](_0x163902[_0xd1a6('0x40')],_0x163902[_0xd1a6('0x3d')]);_0xfb5701[_0xd1a6('0x45')]=_[_0xd1a6('0x43')](_0x163902[_0xd1a6('0x40')],qs[_0xd1a6('0x44')](_0x4f2bc9[_0xd1a6('0x3d')]['fields']));_0xfb5701[_0xd1a6('0x45')]=_0xfb5701[_0xd1a6('0x45')][_0xd1a6('0x46')]?_0xfb5701[_0xd1a6('0x45')]:_0x163902[_0xd1a6('0x40')];if(!_0x4f2bc9[_0xd1a6('0x3d')]['hasOwnProperty'](_0xd1a6('0xa4'))){_0xfb5701[_0xd1a6('0x26')]=qs[_0xd1a6('0x26')](_0x4f2bc9['query'][_0xd1a6('0x26')]);_0xfb5701[_0xd1a6('0x23')]=qs[_0xd1a6('0x23')](_0x4f2bc9['query'][_0xd1a6('0x23')]);}_0xfb5701[_0xd1a6('0xa5')]=qs[_0xd1a6('0xa6')](_0x4f2bc9[_0xd1a6('0x3d')][_0xd1a6('0xa6')]);_0xfb5701['where']=qs['filters'](_[_0xd1a6('0xa7')](_0x4f2bc9[_0xd1a6('0x3d')],_0x163902['filters']));_0xfb5701['where']['ChatInteractionId']=_0x361d1f['id'];if(_0x4f2bc9['query'][_0xd1a6('0xa8')]){_0xfb5701[_0xd1a6('0xa9')]=_[_0xd1a6('0x2f')](_0xfb5701['where'],{'$or':_[_0xd1a6('0x35')](_0xfb5701['attributes'],function(_0x3f23aa){var _0x290169={};_0x290169[_0x3f23aa]={'$like':'%'+_0x4f2bc9[_0xd1a6('0x3d')][_0xd1a6('0xa8')]+'%'};return _0x290169;})});}if(_0x4f2bc9[_0xd1a6('0x3d')][_0xd1a6('0xaa')]){var _0x23db8b=_0x4f2bc9[_0xd1a6('0x3d')][_0xd1a6('0xaa')]['split'](',');var _0x2c5543={};_0x2c5543[_0x23db8b[0x0]]={'$gte':moment(_0x23db8b[0x1])[_0xd1a6('0x82')](_0xd1a6('0xab'))};_0xfb5701[_0xd1a6('0xa9')]=_[_0xd1a6('0x2f')](_0xfb5701['where'],_0x2c5543);}_0xfb5701=_[_0xd1a6('0x2f')]({},_0xfb5701,_0x4f2bc9[_0xd1a6('0x49')]);return db['ChatMessage']['count']({'where':_0xfb5701[_0xd1a6('0xa9')]})['then'](function(_0x437208){_0x44d6a7[_0xd1a6('0x25')]=_0x437208;if(_0x4f2bc9[_0xd1a6('0x3d')][_0xd1a6('0x47')]){_0xfb5701[_0xd1a6('0x48')]=[{'all':!![]}];}return db[_0xd1a6('0x65')]['findAll'](_0xfb5701);})[_0xd1a6('0x15')](function(_0x244182){_0x44d6a7[_0xd1a6('0xac')]=_0x244182;return _0x44d6a7;});}})['then'](respondWithFilteredResult(_0x15a3a7,_0xfb5701))['catch'](handleError(_0x15a3a7,null));};exports[_0xd1a6('0xad')]=function(_0x580e74,_0x2eddec){var _0x494f1e={'where':{}},_0x50af6b={},_0x53c027={'count':0x0,'rows':[]};return db[_0xd1a6('0x36')][_0xd1a6('0x50')]({'where':{'id':_0x580e74[_0xd1a6('0x4c')]['id']}})[_0xd1a6('0x15')](handleEntityNotFound(_0x2eddec,null))[_0xd1a6('0x15')](function(_0x4cd03c){if(_0x4cd03c){_0x50af6b[_0xd1a6('0x40')]=_[_0xd1a6('0x41')](db[_0xd1a6('0x65')][_0xd1a6('0x37')]);_0x50af6b[_0xd1a6('0x3d')]=_[_0xd1a6('0x41')](_0x580e74[_0xd1a6('0x3d')]);_0x50af6b[_0xd1a6('0x42')]=_[_0xd1a6('0x43')](_0x50af6b[_0xd1a6('0x40')],_0x50af6b['query']);_0x494f1e[_0xd1a6('0x45')]=_[_0xd1a6('0x43')](_0x50af6b[_0xd1a6('0x40')],qs[_0xd1a6('0x44')](_0x580e74[_0xd1a6('0x3d')][_0xd1a6('0x44')]));_0x494f1e[_0xd1a6('0x45')]=_0x494f1e[_0xd1a6('0x45')][_0xd1a6('0x46')]?_0x494f1e[_0xd1a6('0x45')]:_0x50af6b[_0xd1a6('0x40')];if(!_0x580e74[_0xd1a6('0x3d')][_0xd1a6('0xae')]('nolimit')){_0x494f1e['limit']=qs[_0xd1a6('0x26')](_0x580e74[_0xd1a6('0x3d')][_0xd1a6('0x26')]);_0x494f1e[_0xd1a6('0x23')]=qs['offset'](_0x580e74['query'][_0xd1a6('0x23')]);}_0x494f1e[_0xd1a6('0xa5')]=qs[_0xd1a6('0xa6')](_0x580e74['query'][_0xd1a6('0xa6')]);_0x494f1e['where']=qs[_0xd1a6('0x42')](_['pick'](_0x580e74[_0xd1a6('0x3d')],_0x50af6b['filters']));_0x494f1e[_0xd1a6('0xa9')][_0xd1a6('0xaf')]=_0x4cd03c['id'];if(_0x580e74[_0xd1a6('0x3d')][_0xd1a6('0xa8')]){_0x494f1e['where']=_[_0xd1a6('0x2f')](_0x494f1e[_0xd1a6('0xa9')],{'$or':_[_0xd1a6('0x35')](_0x494f1e[_0xd1a6('0x45')],function(_0x1141af){var _0x47c453={};_0x47c453[_0x1141af]={'$like':'%'+_0x580e74[_0xd1a6('0x3d')]['filter']+'%'};return _0x47c453;})});}_0x494f1e[_0xd1a6('0xa9')][_0xd1a6('0x94')]=![];if(_0x580e74[_0xd1a6('0x3d')]['id']){_0x494f1e[_0xd1a6('0xa9')]['id']={'$gt':_0x580e74[_0xd1a6('0x3d')]['id']};}_0x494f1e=_['merge']({},_0x494f1e,_0x580e74[_0xd1a6('0x49')]);return db['ChatMessage'][_0xd1a6('0x25')]({'where':_0x494f1e['where']})[_0xd1a6('0x15')](function(_0x4d63f7){_0x53c027[_0xd1a6('0x25')]=_0x4d63f7;_0x494f1e[_0xd1a6('0x48')]=[];if(_0x580e74[_0xd1a6('0x3d')][_0xd1a6('0xb0')]){_0x494f1e[_0xd1a6('0x48')][_0xd1a6('0xb1')]({'model':db[_0xd1a6('0x85')],'as':_0xd1a6('0x85'),'attributes':['id',_0xd1a6('0x57'),_0xd1a6('0xb2')]});}if(_0x580e74[_0xd1a6('0x3d')]['includeAll']){_0x494f1e[_0xd1a6('0x48')]=[{'all':!![]}];}return db[_0xd1a6('0x65')][_0xd1a6('0x3b')](_0x494f1e);})[_0xd1a6('0x15')](function(_0x2c20b4){_0x53c027[_0xd1a6('0xac')]=_0x2c20b4;return _0x53c027;});}})[_0xd1a6('0x15')](respondWithFilteredResult(_0x2eddec,_0x494f1e))[_0xd1a6('0x4d')](handleError(_0x2eddec,null));};exports[_0xd1a6('0xb3')]=function(_0x51ddbe,_0x4c7168){return db[_0xd1a6('0x36')][_0xd1a6('0x4a')]({'where':{'id':_0x51ddbe[_0xd1a6('0x4c')]['id']}})[_0xd1a6('0x15')](handleEntityNotFound(_0x4c7168,null))[_0xd1a6('0x15')](function(_0x4c8b6a){if(_0x4c8b6a){return _0x4c8b6a['setTags'](_0x51ddbe[_0xd1a6('0x30')][_0xd1a6('0xa1')],_[_0xd1a6('0xa2')](_0x51ddbe[_0xd1a6('0x30')],['ids','id'])||{})['spread'](function(){return db[_0xd1a6('0xb4')][_0xd1a6('0x3b')]({'attributes':['id',_0xd1a6('0x2c'),_0xd1a6('0xb5')],'where':{'id':_0x51ddbe[_0xd1a6('0x30')][_0xd1a6('0xa1')]}});})[_0xd1a6('0x15')](function(_0x4e15ac){socket[_0xd1a6('0xb6')]('chatInteractionTags:save',{'id':Number(_0x51ddbe[_0xd1a6('0x4c')]['id']),'tags':_0x4e15ac||[]});return{'id':Number(_0x51ddbe[_0xd1a6('0x4c')]['id']),'tags':_0x4e15ac||[]};});}})[_0xd1a6('0x15')](respondWithResult(_0x4c7168,null))['catch'](handleError(_0x4c7168,null));};exports[_0xd1a6('0xb7')]=function(_0x2101fb,_0x40f126){return db[_0xd1a6('0x36')][_0xd1a6('0x4a')]({'where':{'id':_0x2101fb[_0xd1a6('0x4c')]['id']}})[_0xd1a6('0x15')](handleEntityNotFound(_0x40f126,null))[_0xd1a6('0x15')](function(_0x5df0c2){if(_0x5df0c2){return _0x5df0c2[_0xd1a6('0xb7')](_0x2101fb[_0xd1a6('0x3d')]['ids']);}})[_0xd1a6('0x15')](respondWithStatusCode(_0x40f126,null))[_0xd1a6('0x4d')](handleError(_0x40f126,null));};exports[_0xd1a6('0x7e')]=function(_0x3313ef,_0x381ad4){var _0x25f840=moment()[_0xd1a6('0xb8')]()[_0xd1a6('0xb9')]();var _0x5ae6f3=path['join'](config[_0xd1a6('0x7b')],_0xd1a6('0xba'),_0xd1a6('0xbb'),_0xd1a6('0xbc'));var _0x5b521f=path['join'](config['root'],_0xd1a6('0xba'),_0xd1a6('0xbb'),_0xd1a6('0xbd'));var _0x2d87e8=path['join'](_0x5ae6f3,_0x25f840);var _0x40af63=util[_0xd1a6('0x82')](_0xd1a6('0xbe'),_0x3313ef[_0xd1a6('0x4c')]['id'],_0x25f840);var _0x30a2b1=path['join'](_0x5ae6f3,_0x40af63);var _0x2119b6=[];_0x2119b6[_0xd1a6('0xb1')]({'model':db[_0xd1a6('0x85')],'as':_0xd1a6('0x85'),'attributes':['id',_0xd1a6('0x57')],'raw':!![]});_0x2119b6['push']({'model':db[_0xd1a6('0x69')],'as':_0xd1a6('0x6a'),'attributes':['id','firstName',_0xd1a6('0xbf')],'raw':!![]});if(_0x3313ef[_0xd1a6('0x3d')][_0xd1a6('0xbd')]){_0x2119b6['push']({'model':db[_0xd1a6('0x77')],'as':'Attachment','raw':!![]});}var _0x283e44=[{'model':db[_0xd1a6('0x65')],'as':'Messages','attributes':['id',_0xd1a6('0x30'),'createdAt',_0xd1a6('0x93'),_0xd1a6('0x94'),_0xd1a6('0xc0')],'include':_0x2119b6}];_0x283e44[_0xd1a6('0xb1')]({'model':db[_0xd1a6('0x51')],'as':_0xd1a6('0xc1'),'attributes':['id',_0xd1a6('0x2c')]});_0x283e44['push']({'model':db[_0xd1a6('0x85')],'as':'Owner','attributes':['id','fullname']});return db[_0xd1a6('0x36')][_0xd1a6('0x4a')]({'where':{'id':_0x3313ef[_0xd1a6('0x4c')]['id']},'include':_0x283e44})[_0xd1a6('0x15')](handleEntityNotFound(_0x381ad4,null))[_0xd1a6('0x15')](function(_0x519298){if(_0x519298){var _0x4d5ff2=_0x519298['get']({'plain':!![]});fs['mkdirSync'](_0x2d87e8);var _0x2e38ed={'channel':_0xd1a6('0xc2'),'account':_0x4d5ff2[_0xd1a6('0xc1')][_0xd1a6('0x2c')],'agent':_0x4d5ff2[_0xd1a6('0xc3')]?_0x4d5ff2['Owner'][_0xd1a6('0x57')]:_0xd1a6('0xc4'),'createdAt':moment(_0x4d5ff2[_0xd1a6('0x91')])[_0xd1a6('0x82')](_0xd1a6('0xab'))[_0xd1a6('0xb9')](),'closedAt':_0x4d5ff2[_0xd1a6('0x6e')]?moment(_0x4d5ff2[_0xd1a6('0xc5')])['format'](_0xd1a6('0xab'))['toString']():'','disposition':_0x4d5ff2['disposition'],'chatInfo':{'browser':_0x4d5ff2[_0xd1a6('0xc6')],'os':_0x4d5ff2[_0xd1a6('0xc7')],'referer':_0x4d5ff2[_0xd1a6('0xc8')],'customerIp':_0x4d5ff2[_0xd1a6('0xc9')],'customerPort':_0x4d5ff2['customerPort']?_0x4d5ff2[_0xd1a6('0xca')]:_0xd1a6('0xc4')},'messages':_(_0x4d5ff2[_0xd1a6('0x87')])[_0xd1a6('0xcb')]()['filter']({'secret':![]})[_0xd1a6('0x35')](function(_0x3b4859){if(_0x3b4859[_0xd1a6('0x77')]){var _0x2ba9f7=path[_0xd1a6('0x7a')](_0x5b521f,_0x3b4859[_0xd1a6('0x77')][_0xd1a6('0x72')]);if(fs[_0xd1a6('0xcc')](_0x2ba9f7)){fs[_0xd1a6('0xcd')](_0x2ba9f7)[_0xd1a6('0xce')](fs[_0xd1a6('0xcf')](path['join'](_0x2d87e8,_0x3b4859[_0xd1a6('0x77')][_0xd1a6('0x72')])));}}return{'date':moment(_0x3b4859[_0xd1a6('0x91')])[_0xd1a6('0x82')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x3b4859['direction']==='out'?_0x3b4859[_0xd1a6('0x85')]?_0x3b4859[_0xd1a6('0x85')][_0xd1a6('0x57')]:'System':_0x3b4859[_0xd1a6('0x6a')][_0xd1a6('0xd0')]+(_0x3b4859[_0xd1a6('0x6a')]['lastName']?'\x20'+_0x3b4859[_0xd1a6('0x6a')][_0xd1a6('0xbf')]:''),'body':_0x3b4859['Attachment']?_0x3b4859['Attachment'][_0xd1a6('0x72')]:_0x3b4859[_0xd1a6('0x30')],'direction':_0x3b4859[_0xd1a6('0x93')]==='out'?'A':'C','secret':_0x3b4859['secret'],'read':_0x3b4859[_0xd1a6('0xc0')],'attachment':_0x3b4859['Attachment']};})[_0xd1a6('0xd1')]()};return ejs['renderFile'](path[_0xd1a6('0x7a')](config[_0xd1a6('0x7b')],'server','views',_0xd1a6('0xd2')),{'interaction':_0x2e38ed})['then'](function(_0x3c9104){var _0x9ff2f8=path[_0xd1a6('0x7a')](_0x2d87e8,_0xd1a6('0xd3')+_0x4d5ff2['id']+'-'+_0x25f840+_0xd1a6('0xd4'));var _0x2052f9={'path':_0x9ff2f8,'channel':'Chat','interactionId':_0x4d5ff2['id']};return pdf[_0xd1a6('0xd5')](_0x3c9104,_0x2052f9);})[_0xd1a6('0x15')](function(){return new Promise(function(_0x5f31b8,_0xa4a442){zipdir(_0x2d87e8,{'saveTo':_0x30a2b1},function(_0x9283e2,_0x3edcc8){if(_0x9283e2)return _0xa4a442(_0x9283e2);return _0x5f31b8(_0x3edcc8);});})[_0xd1a6('0x15')](function(){return new BPromise(function(_0xefde55,_0x5a1863){rimraf(_0x2d87e8,function(_0x53141d){if(_0x53141d)_0x5a1863(_0x53141d);return _0xefde55();});});})[_0xd1a6('0x15')](function(){return _0x381ad4[_0xd1a6('0x7e')](_0x30a2b1,_0x40af63,function(_0xbfc61d){if(_0xbfc61d){logger[_0xd1a6('0x1c')]('err',_0xbfc61d);}else{fs['unlinkSync'](_0x30a2b1);}});});});}else{return _0x381ad4[_0xd1a6('0x1f')](0xc8);}})['catch'](handleError(_0x381ad4,null));}; \ No newline at end of file +var _0xb93c=['addTags','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','lastName','read','Account','Owner','get','mkdirSync','Chat','N.A.','toString','closedAt','browserName','osName','referer','customerIp','customerPort','tail','basename','existsSync','createReadStream','pipe','firstName','value','renderFile','views','downloadInteraction.ejs','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','bluebird','mustache','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','sendStatus','status','end','limit','undefined','count','update','destroy','stack','name','send','render','contact','interaction','index','map','rawAttributes','type','getOptions','findAll','chat','query','catch','show','params','model','keys','ChatInteraction','intersection','attributes','fields','length','includeAll','include','merge','find','create','body','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','user','fullname','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','follow','parse','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','entity\x20not\x20found','ValidationError','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','filename','Attachment','attachmentDownload','json','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','format','transcript-%s.txt','now','pathTranscript','User','ContactId','Messages','UserId','%s%d','agentAlias','customer','Visitor','agentIdentifier','System','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','getMessages','filters','hasOwnProperty','nolimit','offset','sort','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','getMyMessages','pick','includeAgent','push','rows'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xb93c,0x1d6));var _0xcb93=function(_0x25b439,_0xb20872){_0x25b439=_0x25b439-0x0;var _0xbf2210=_0xb93c[_0x25b439];return _0xbf2210;};'use strict';var rimraf=require(_0xcb93('0x0'));var zipdir=require(_0xcb93('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcb93('0x2'));var Mustache=require(_0xcb93('0x3'));var util=require(_0xcb93('0x4'));var path=require(_0xcb93('0x5'));var ejs=require(_0xcb93('0x6'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xcb93('0x7'));var interaction=require(_0xcb93('0x8'));var qs=require(_0xcb93('0x9'));var pdf=require(_0xcb93('0xa'));var logger=require(_0xcb93('0xb'))('api');var config=require(_0xcb93('0xc'));var db=require(_0xcb93('0xd'))['db'];config[_0xcb93('0xe')]=_['defaults'](config[_0xcb93('0xe')],{'host':_0xcb93('0xf'),'port':0x18eb});var socket=require(_0xcb93('0x10'))(new Redis(config['redis']));require(_0xcb93('0x11'))[_0xcb93('0x12')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xcb93('0x13')]({'port':0x232b});var client9004=jayson[_0xcb93('0x14')]['http']({'port':0x232c});function respondWithRpcPromise(_0x5b2444,_0x449644,_0x129293,_0x1f8eac){return new BPromise(function(_0x3451e9,_0x3e2293){var _0x2df83f=_0x1f8eac||client;return _0x2df83f[_0xcb93('0x15')](_0x5b2444,_0x129293)[_0xcb93('0x16')](function(_0xc7f68d){logger[_0xcb93('0x17')](_0xcb93('0x18'),_0x449644,'request\x20sent');logger['debug'](_0xcb93('0x19'),_0x449644,_0xcb93('0x1a'),JSON['stringify'](_0xc7f68d));if(_0xc7f68d[_0xcb93('0x1b')]){if(_0xc7f68d[_0xcb93('0x1b')][_0xcb93('0x1c')]===0x1f4){logger[_0xcb93('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0x449644,_0xc7f68d['error'][_0xcb93('0x1d')]);return _0x3e2293(_0xc7f68d[_0xcb93('0x1b')][_0xcb93('0x1d')]);}logger[_0xcb93('0x1b')](_0xcb93('0x18'),_0x449644,_0xc7f68d[_0xcb93('0x1b')]['message']);return _0x3451e9(_0xc7f68d[_0xcb93('0x1b')]['message']);}else{logger['info'](_0xcb93('0x18'),_0x449644,_0xcb93('0x1a'));_0x3451e9(_0xc7f68d[_0xcb93('0x1e')][_0xcb93('0x1d')]);}})['catch'](function(_0x54ad2d){logger[_0xcb93('0x1b')](_0xcb93('0x18'),_0x449644,_0x54ad2d);_0x3e2293(_0x54ad2d);});});}function respondWithStatusCode(_0x3240f4,_0x12d431){_0x12d431=_0x12d431||0xcc;return function(_0x21d078){if(_0x21d078){return _0x3240f4[_0xcb93('0x1f')](_0x12d431);}return _0x3240f4[_0xcb93('0x20')](_0x12d431)[_0xcb93('0x21')]();};}function respondWithResult(_0x63b45f,_0x3fd168){_0x3fd168=_0x3fd168||0xc8;return function(_0x4d486f){if(_0x4d486f){return _0x63b45f['status'](_0x3fd168)['json'](_0x4d486f);}};}function respondWithFilteredResult(_0x354bb0,_0x259199){return function(_0x5dfdc8){if(_0x5dfdc8){var _0x1ae357=typeof _0x259199['offset']==='undefined'&&typeof _0x259199[_0xcb93('0x22')]===_0xcb93('0x23');var _0x30e194=_0x5dfdc8[_0xcb93('0x24')];var _0x41fc39=_0x1ae357?0x0:_0x259199['offset'];var _0x74dbe9=_0x1ae357?_0x5dfdc8[_0xcb93('0x24')]:_0x259199['offset']+_0x259199[_0xcb93('0x22')];var _0x2ead24;if(_0x74dbe9>=_0x30e194){_0x74dbe9=_0x30e194;_0x2ead24=0xc8;}else{_0x2ead24=0xce;}_0x354bb0['status'](_0x2ead24);return _0x354bb0['set']('Content-Range',_0x41fc39+'-'+_0x74dbe9+'/'+_0x30e194)['json'](_0x5dfdc8);}return null;};}function saveUpdates(_0x4eef35){return function(_0x1afcb4){if(_0x1afcb4){return _0x1afcb4[_0xcb93('0x25')](_0x4eef35)[_0xcb93('0x16')](function(_0x1165d8){return _0x1165d8;});}return null;};}function removeEntity(_0x173718){return function(_0x8a778c){if(_0x8a778c){return _0x8a778c[_0xcb93('0x26')]()[_0xcb93('0x16')](function(){_0x173718['status'](0xcc)[_0xcb93('0x21')]();});}};}function handleEntityNotFound(_0x135b36){return function(_0x488c56){if(!_0x488c56){_0x135b36[_0xcb93('0x1f')](0x194);}return _0x488c56;};}function handleError(_0x5ee892,_0x5d0286){_0x5d0286=_0x5d0286||0x1f4;return function(_0x270380){logger['error'](_0x270380[_0xcb93('0x27')]);if(_0x270380[_0xcb93('0x28')]){delete _0x270380[_0xcb93('0x28')];}_0x5ee892[_0xcb93('0x20')](_0x5d0286)[_0xcb93('0x29')](_0x270380);};}function getMustacheRender(_0x24cd60,_0x5c1cb1){return Mustache[_0xcb93('0x2a')](_0x24cd60,_['merge'](_0x5c1cb1['body'],{'contact':_0x5c1cb1[_0xcb93('0x2b')],'message':_0x5c1cb1[_0xcb93('0x1d')],'agent':_0x5c1cb1['agent'],'interaction':_0x5c1cb1[_0xcb93('0x2c')],'account':_0x5c1cb1['account']}))||'';}exports[_0xcb93('0x2d')]=function(_0x27b5b2,_0x418b19){var _0x153e50={};var _0x269589=_[_0xcb93('0x2e')](db['ChatInteraction'][_0xcb93('0x2f')],function(_0x154f29){return{'name':_0x154f29['fieldName'],'type':_0x154f29[_0xcb93('0x30')]['key']};});_0x153e50=qs[_0xcb93('0x31')](_0x269589,_0x27b5b2);return interaction[_0xcb93('0x32')](_0xcb93('0x33'),_0x27b5b2[_0xcb93('0x34')],_0x27b5b2['user'],_0x153e50,_0x269589)[_0xcb93('0x16')](respondWithFilteredResult(_0x418b19,_0x153e50))[_0xcb93('0x35')](handleError(_0x418b19,null));};exports[_0xcb93('0x36')]=function(_0x241f51,_0x360661){var _0x580172={'raw':![],'where':{'id':_0x241f51[_0xcb93('0x37')]['id']}},_0x5b4fba={};_0x5b4fba[_0xcb93('0x38')]=_[_0xcb93('0x39')](db[_0xcb93('0x3a')][_0xcb93('0x2f')]);_0x5b4fba[_0xcb93('0x34')]=_[_0xcb93('0x39')](_0x241f51[_0xcb93('0x34')]);_0x5b4fba['filters']=_[_0xcb93('0x3b')](_0x5b4fba['model'],_0x5b4fba[_0xcb93('0x34')]);_0x580172[_0xcb93('0x3c')]=_['intersection'](_0x5b4fba[_0xcb93('0x38')],qs[_0xcb93('0x3d')](_0x241f51['query'][_0xcb93('0x3d')]));_0x580172['attributes']=_0x580172[_0xcb93('0x3c')][_0xcb93('0x3e')]?_0x580172[_0xcb93('0x3c')]:_0x5b4fba['model'];if(_0x241f51[_0xcb93('0x34')][_0xcb93('0x3f')]){_0x580172[_0xcb93('0x40')]=[{'all':!![]}];}_0x580172=_[_0xcb93('0x41')]({},_0x580172,_0x241f51['options']);return db['ChatInteraction'][_0xcb93('0x42')](_0x580172)['then'](handleEntityNotFound(_0x360661,null))['then'](respondWithResult(_0x360661,null))[_0xcb93('0x35')](handleError(_0x360661,null));};exports[_0xcb93('0x43')]=function(_0x359fd4,_0x4187b2){return db[_0xcb93('0x3a')][_0xcb93('0x43')](_0x359fd4['body'],{})[_0xcb93('0x16')](respondWithResult(_0x4187b2,0xc9))['catch'](handleError(_0x4187b2,null));};exports[_0xcb93('0x25')]=function(_0x304f14,_0x4a41eb){if(_0x304f14[_0xcb93('0x44')]['id']){delete _0x304f14[_0xcb93('0x44')]['id'];}return db[_0xcb93('0x3a')][_0xcb93('0x42')]({'where':{'id':_0x304f14['params']['id']}})[_0xcb93('0x16')](handleEntityNotFound(_0x4a41eb,null))[_0xcb93('0x16')](saveUpdates(_0x304f14[_0xcb93('0x44')],null))[_0xcb93('0x16')](respondWithResult(_0x4a41eb,null))[_0xcb93('0x35')](handleError(_0x4a41eb,null));};exports['destroy']=function(_0x40c2e3,_0xc2cb08){return db[_0xcb93('0x3a')]['find']({'where':{'id':_0x40c2e3['params']['id']}})['then'](handleEntityNotFound(_0xc2cb08,null))['then'](removeEntity(_0xc2cb08,null))[_0xcb93('0x35')](handleError(_0xc2cb08,null));};exports[_0xcb93('0x45')]=function(_0x325e03,_0x228872){return db[_0xcb93('0x3a')]['describe']()['then'](respondWithResult(_0x228872,null))['catch'](handleError(_0x228872,null));};exports[_0xcb93('0x46')]=function(_0x1f9b90,_0x26d00c){var _0x143ff4=_0x1f9b90[_0xcb93('0x37')]['id'];var _0xba435b;var _0xa8a9;var _0x3c63b3;return db[_0xcb93('0x3a')][_0xcb93('0x47')]({'where':{'id':_0x143ff4}})['then'](function(_0x4f11f8){_0xba435b=_0x4f11f8;return db[_0xcb93('0x48')][_0xcb93('0x47')]({'where':{'id':_0x4f11f8[_0xcb93('0x49')]},'attributes':['id','vidaooApiKey','vidaooEscalation',_0xcb93('0x4a'),_0xcb93('0x4b'),_0xcb93('0x4c')],'raw':!![]});})[_0xcb93('0x16')](function(_0x4d8723){if(_0x4d8723&&_0x4d8723[_0xcb93('0x4d')]&&_0x4d8723['vidaooEscalation']){_0xa8a9=_0x4d8723;var _0xc1fd02={'interaction':{'id':_0x143ff4},'agent':{'id':_0x1f9b90[_0xcb93('0x4e')]['id'],'name':_0x1f9b90[_0xcb93('0x4e')]['name'],'fullname':_0x1f9b90['user'][_0xcb93('0x4f')],'email':_0x1f9b90[_0xcb93('0x4e')]['email']},'contact':_0x1f9b90[_0xcb93('0x44')][_0xcb93('0x2b')],'account':_0x1f9b90['body'][_0xcb93('0x50')]};var _0x49067d={'rejectUnauthorized':![],'method':_0xcb93('0x51'),'url':_0xcb93('0x52'),'headers':{'X-APIKEY':_0x4d8723[_0xcb93('0x4d')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1f9b90[_0xcb93('0x4e')][_0xcb93('0x53')]],'buttons':null,'topic':_0xa8a9['vidaooTopic'],'note':_['isNull'](_0xa8a9[_0xcb93('0x4b')])?null:getMustacheRender(_0xa8a9[_0xcb93('0x4b')],_0xc1fd02),'metadata':null},'redirect':_0xcb93('0x54'),'json':!![]};try{if(!_['isNull'](_0xa8a9['vidaooMetadata'])){var _0x3ca3ab=getMustacheRender(_0xa8a9[_0xcb93('0x4c')],_0xc1fd02);var _0x2efd26=JSON[_0xcb93('0x55')](_0x3ca3ab);_0x49067d[_0xcb93('0x44')][_0xcb93('0x56')]=_0x2efd26;}}catch(_0x5d3b45){throw new db[(_0xcb93('0x57'))]['ValidationError'](_0xcb93('0x58'));}return rp(_0x49067d);}else{throw new db[(_0xcb93('0x57'))]['ValidationError'](_0xcb93('0x59'));}})[_0xcb93('0x16')](function(_0x78147){_0x3c63b3=_0x78147;if(_0x3c63b3['id']){var _0xc3363={'body':_0x3c63b3[_0xcb93('0x5a')],'ChatWebsiteId':_0xa8a9['id'],'ChatInteractionId':_0xba435b['id'],'direction':_0xcb93('0x5b'),'UserId':_0x1f9b90['user']['id']};return db[_0xcb93('0x5c')][_0xcb93('0x43')](_0xc3363,{});}else{throw new db['Sequelize']['ValidationError'](_0xcb93('0x5d'));}})['then'](function(){return _0xba435b[_0xcb93('0x5e')]({'vidaooSessionId':_0x3c63b3['id']});})['then'](respondWithResult(_0x26d00c,null))[_0xcb93('0x35')](handleError(_0x26d00c,null));};exports[_0xcb93('0x5f')]=function(_0x9a7246,_0x253dee){if(_0x9a7246[_0xcb93('0x44')]['id']){delete _0x9a7246[_0xcb93('0x44')]['id'];}return db[_0xcb93('0x3a')][_0xcb93('0x42')]({'where':{'id':_0x9a7246[_0xcb93('0x37')]['id']},'include':[{'model':db[_0xcb93('0x60')],'as':_0xcb93('0x61')}]})[_0xcb93('0x16')](handleEntityNotFound(_0x253dee,null))['then'](saveUpdates(_0x9a7246[_0xcb93('0x44')],null))[_0xcb93('0x16')](respondWithResult(_0x253dee,null))[_0xcb93('0x35')](handleError(_0x253dee,null));};exports[_0xcb93('0x62')]=function(_0x5b98f4,_0x185eb2){if(_0x5b98f4[_0xcb93('0x44')]['id']){delete _0x5b98f4[_0xcb93('0x44')]['id'];}return db[_0xcb93('0x3a')][_0xcb93('0x42')]({'where':{'id':_0x5b98f4[_0xcb93('0x37')]['id']}})[_0xcb93('0x16')](function(_0x189b51){if(!_0x189b51){logger[_0xcb93('0x1b')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xcb93('0x62'),0x194,_0xcb93('0x63'));_0x185eb2[_0xcb93('0x1f')](0x194);}else{if(_0x189b51['UserId']){throw new db[(_0xcb93('0x57'))][(_0xcb93('0x64'))](_0xcb93('0x65'));}}return _0x189b51;})['then'](function(_0x35ed4d){if(_0x35ed4d){return _0x35ed4d[_0xcb93('0x25')]({'closed':_0x5b98f4['body'][_0xcb93('0x66')],'disposition':_0x5b98f4['body'][_0xcb93('0x67')]})[_0xcb93('0x16')](function(_0x44e4ab){return _0x44e4ab;});}})[_0xcb93('0x16')](function(){return respondWithRpcPromise(_0xcb93('0x68'),_0xcb93('0x62'),_0x5b98f4[_0xcb93('0x44')],client9004);})[_0xcb93('0x16')](respondWithResult(_0x185eb2,null))[_0xcb93('0x35')](handleError(_0x185eb2,null));};exports[_0xcb93('0x69')]=function(_0x1aad8d,_0x1dce65){_0x1aad8d[_0xcb93('0x44')][_0xcb93('0x28')]=_0x1aad8d[_0xcb93('0x6a')][_0xcb93('0x6b')];_0x1aad8d[_0xcb93('0x44')]['basename']=_0x1aad8d[_0xcb93('0x6a')][_0xcb93('0x6c')];_0x1aad8d[_0xcb93('0x44')][_0xcb93('0x30')]=_0x1aad8d['file']['mimetype'];return db[_0xcb93('0x6d')][_0xcb93('0x43')](_0x1aad8d[_0xcb93('0x44')])[_0xcb93('0x16')](respondWithResult(_0x1dce65,0xc9))[_0xcb93('0x35')](handleError(_0x1dce65,null));};exports[_0xcb93('0x6e')]=function(_0xd7bb8b,_0x5b18d7){return db['ChatInteraction']['findOne']({'where':{'id':_0xd7bb8b[_0xcb93('0x37')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x5b18d7,null))['then'](function(_0x1dfa57){if(_0x1dfa57){if(_0x1dfa57[_0xcb93('0x66')]){return _0x5b18d7[_0xcb93('0x20')](0x193)[_0xcb93('0x6f')]({'status':0x193,'message':_0xcb93('0x70')});}return db[_0xcb93('0x6d')]['findOne']({'where':{'id':_0xd7bb8b[_0xcb93('0x34')][_0xcb93('0x71')]},'raw':!![]})['then'](handleEntityNotFound(_0x5b18d7,null));}})['then'](function(_0x401799){if(_0x401799){var _0x329260=_0x401799[_0xcb93('0x72')]!==null;var _0x68e720=path[_0xcb93('0x73')](config[_0xcb93('0x74')],_0xcb93('0x75'));if(_0x329260){_0x68e720=path[_0xcb93('0x73')](_0x68e720,_0xcb93('0x76'));}var _0x39cb32=path[_0xcb93('0x73')](_0x68e720,_0x401799['basename']);return _0x5b18d7[_0xcb93('0x77')](_0x39cb32);}})[_0xcb93('0x35')](handleError(_0x5b18d7,null));};exports[_0xcb93('0x78')]=function(_0x473eb0,_0x3b2f09){var _0xa51ae0=null;var _0x589dff=null;var _0x4c1e3d=null;if(_0x473eb0[_0xcb93('0x44')]['id']){delete _0x473eb0[_0xcb93('0x44')]['id'];}if(_0x473eb0[_0xcb93('0x44')][_0xcb93('0x79')]){_0x4c1e3d=path['join'](config[_0xcb93('0x74')],'server/files/chat/upload/',util[_0xcb93('0x7a')](_0xcb93('0x7b'),Date[_0xcb93('0x7c')]()));_0x473eb0[_0xcb93('0x44')][_0xcb93('0x7d')]=_0x4c1e3d;}return db[_0xcb93('0x3a')][_0xcb93('0x42')]({'where':{'id':_0x473eb0['params']['id']},'include':[{'model':db[_0xcb93('0x5c')],'as':'Messages','include':[{'model':db['User'],'as':_0xcb93('0x7e')}]}]})[_0xcb93('0x16')](handleEntityNotFound(_0x3b2f09,null))[_0xcb93('0x16')](saveUpdates(_0x473eb0[_0xcb93('0x44')],null))['then'](function(_0x586915){if(_0x586915){_0xa51ae0=_0x586915;return db[_0xcb93('0x48')][_0xcb93('0x42')]({'where':{'id':_0xa51ae0['ChatWebsiteId']}});}})[_0xcb93('0x16')](function(_0x4c2bf7){if(_0x4c2bf7){_0x589dff=_0x4c2bf7;return db[_0xcb93('0x60')][_0xcb93('0x42')]({'where':{'id':_0xa51ae0[_0xcb93('0x7f')]}});}})[_0xcb93('0x16')](function(_0x143068){if(_0x143068){if(_0x4c1e3d){var _0x244078=null;for(var _0xa0e0fd=0x1;_0xa0e0fd<_0xa51ae0[_0xcb93('0x80')]['length'];++_0xa0e0fd){_0x244078=_0xa51ae0[_0xcb93('0x80')][_0xa0e0fd];var _0x24cb91=_0x244078[_0xcb93('0x81')]?util[_0xcb93('0x7a')](_0xcb93('0x82'),_0x589dff[_0xcb93('0x83')],_0x244078[_0xcb93('0x81')]):'System';var _0x50b246=_0x473eb0[_0xcb93('0x44')][_0xcb93('0x84')]||util['format']('%s%d',_0xcb93('0x85'),_0x244078['ContactId']);switch(_0x589dff[_0xcb93('0x86')]){case'website_alias':_0x24cb91=_0x244078[_0xcb93('0x81')]?util[_0xcb93('0x7a')](_0xcb93('0x82'),_0x589dff[_0xcb93('0x83')],_0x244078['UserId']):_0xcb93('0x87');break;case _0xcb93('0x88'):_0x24cb91=_0x244078[_0xcb93('0x81')]?_0x244078[_0xcb93('0x7e')][_0xcb93('0x89')]||_0x244078[_0xcb93('0x7e')][_0xcb93('0x4f')]:_0xcb93('0x87');break;case'agent_fullname':_0x24cb91=_0x244078[_0xcb93('0x81')]?_0x244078[_0xcb93('0x7e')][_0xcb93('0x4f')]:_0xcb93('0x87');break;default:_0x24cb91=_0x244078['UserId']?util['format']('%s%d',_0x589dff[_0xcb93('0x83')],_0x244078[_0xcb93('0x81')]):_0xcb93('0x87');}var _0x1641e0=util['format'](_0xcb93('0x8a'),moment(_0x244078[_0xcb93('0x8b')])[_0xcb93('0x7a')](_0xcb93('0x8c')),_0x244078[_0xcb93('0x8d')]==='in'?_0x50b246:_0x24cb91,_0x244078['body']);if(!_0x244078[_0xcb93('0x8e')]){fs[_0xcb93('0x8f')](_0x4c1e3d,_0x1641e0);}}return db[_0xcb93('0x90')][_0xcb93('0x47')]({'where':{'service':!![]},'include':[{'model':db[_0xcb93('0x91')],'as':_0xcb93('0x92'),'raw':!![],'include':[{'model':db[_0xcb93('0x93')],'as':_0xcb93('0x93'),'raw':!![]}]}]});}}})[_0xcb93('0x16')](function(_0x5581ad){if(!_0x5581ad||!_0x5581ad[_0xcb93('0x92')]||!_0x473eb0[_0xcb93('0x44')])return _0xa51ae0;var _0x552726=_0x5581ad['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0xcb93('0x94'),{'account':_0x552726,'message':{'from':util[_0xcb93('0x7a')](_0xcb93('0x95'),_0x5581ad['name'],_0x5581ad[_0xcb93('0x53')]||_0x5581ad[_0xcb93('0x92')][_0xcb93('0x4e')]),'to':_0x473eb0[_0xcb93('0x44')]['mailTranscript'],'subject':_0xcb93('0x96'),'text':util[_0xcb93('0x7a')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x473eb0[_0xcb93('0x44')][_0xcb93('0x79')]),'attachments':[{'path':_0x4c1e3d}]}})[_0xcb93('0x16')](function(){return _0xa51ae0;})[_0xcb93('0x35')](function(_0x374c02){logger[_0xcb93('0x1b')](_0x374c02);});})['then'](respondWithStatusCode(_0x3b2f09,0xc8))[_0xcb93('0x35')](handleError(_0x3b2f09,null));};exports[_0xcb93('0x97')]=function(_0x4e6ffa,_0x3368d6){return db[_0xcb93('0x5c')][_0xcb93('0x42')]({'where':{'id':_0x4e6ffa[_0xcb93('0x37')]['id']}})[_0xcb93('0x16')](handleEntityNotFound(_0x3368d6,null))[_0xcb93('0x16')](function(_0x2c00ca){if(_0x2c00ca){return _0x2c00ca[_0xcb93('0x97')](_0x4e6ffa[_0xcb93('0x44')][_0xcb93('0x98')],_[_0xcb93('0x99')](_0x4e6ffa[_0xcb93('0x44')],[_0xcb93('0x98'),'id'])||{});}})['then'](respondWithResult(_0x3368d6,null))['catch'](handleError(_0x3368d6,null));};exports[_0xcb93('0x9a')]=function(_0x3a0e31,_0xe9e7f5){var _0x43b7a4={'raw':![],'where':{}};var _0x5c1673={};var _0x3378a0={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x3a0e31[_0xcb93('0x37')]['id']}})[_0xcb93('0x16')](handleEntityNotFound(_0xe9e7f5,null))['then'](function(_0x384bd4){if(_0x384bd4){_0x5c1673[_0xcb93('0x38')]=_[_0xcb93('0x39')](db[_0xcb93('0x5c')][_0xcb93('0x2f')]);_0x5c1673[_0xcb93('0x34')]=_['keys'](_0x3a0e31[_0xcb93('0x34')]);_0x5c1673[_0xcb93('0x9b')]=_[_0xcb93('0x3b')](_0x5c1673[_0xcb93('0x38')],_0x5c1673[_0xcb93('0x34')]);_0x43b7a4[_0xcb93('0x3c')]=_[_0xcb93('0x3b')](_0x5c1673['model'],qs[_0xcb93('0x3d')](_0x3a0e31[_0xcb93('0x34')][_0xcb93('0x3d')]));_0x43b7a4['attributes']=_0x43b7a4[_0xcb93('0x3c')][_0xcb93('0x3e')]?_0x43b7a4['attributes']:_0x5c1673[_0xcb93('0x38')];if(!_0x3a0e31[_0xcb93('0x34')][_0xcb93('0x9c')](_0xcb93('0x9d'))){_0x43b7a4[_0xcb93('0x22')]=qs['limit'](_0x3a0e31[_0xcb93('0x34')][_0xcb93('0x22')]);_0x43b7a4[_0xcb93('0x9e')]=qs['offset'](_0x3a0e31['query'][_0xcb93('0x9e')]);}_0x43b7a4['order']=qs[_0xcb93('0x9f')](_0x3a0e31[_0xcb93('0x34')][_0xcb93('0x9f')]);_0x43b7a4['where']=qs[_0xcb93('0x9b')](_['pick'](_0x3a0e31[_0xcb93('0x34')],_0x5c1673[_0xcb93('0x9b')]));_0x43b7a4[_0xcb93('0xa0')][_0xcb93('0xa1')]=_0x384bd4['id'];if(_0x3a0e31[_0xcb93('0x34')]['filter']){_0x43b7a4[_0xcb93('0xa0')]=_['merge'](_0x43b7a4[_0xcb93('0xa0')],{'$or':_[_0xcb93('0x2e')](_0x43b7a4[_0xcb93('0x3c')],function(_0x37de0c){var _0x4e86f2={};_0x4e86f2[_0x37de0c]={'$like':'%'+_0x3a0e31[_0xcb93('0x34')][_0xcb93('0xa2')]+'%'};return _0x4e86f2;})});}if(_0x3a0e31[_0xcb93('0x34')][_0xcb93('0xa3')]){var _0x54ca37=_0x3a0e31[_0xcb93('0x34')]['$gte'][_0xcb93('0xa4')](',');var _0x1f5de9={};_0x1f5de9[_0x54ca37[0x0]]={'$gte':moment(_0x54ca37[0x1])[_0xcb93('0x7a')](_0xcb93('0xa5'))};_0x43b7a4['where']=_[_0xcb93('0x41')](_0x43b7a4[_0xcb93('0xa0')],_0x1f5de9);}_0x43b7a4=_[_0xcb93('0x41')]({},_0x43b7a4,_0x3a0e31[_0xcb93('0xa6')]);return db[_0xcb93('0x5c')][_0xcb93('0x24')]({'where':_0x43b7a4['where']})[_0xcb93('0x16')](function(_0x594791){_0x3378a0[_0xcb93('0x24')]=_0x594791;if(_0x3a0e31[_0xcb93('0x34')][_0xcb93('0x3f')]){_0x43b7a4[_0xcb93('0x40')]=[{'all':!![]}];}return db[_0xcb93('0x5c')]['findAll'](_0x43b7a4);})['then'](function(_0x338bf7){_0x3378a0['rows']=_0x338bf7;return _0x3378a0;});}})[_0xcb93('0x16')](respondWithFilteredResult(_0xe9e7f5,_0x43b7a4))[_0xcb93('0x35')](handleError(_0xe9e7f5,null));};exports[_0xcb93('0xa7')]=function(_0x20afb8,_0x263f50){var _0x392f66={'where':{}},_0x3adc6b={},_0x4239e8={'count':0x0,'rows':[]};return db[_0xcb93('0x3a')][_0xcb93('0x47')]({'where':{'id':_0x20afb8[_0xcb93('0x37')]['id']}})[_0xcb93('0x16')](handleEntityNotFound(_0x263f50,null))[_0xcb93('0x16')](function(_0x3c300d){if(_0x3c300d){_0x3adc6b['model']=_[_0xcb93('0x39')](db[_0xcb93('0x5c')]['rawAttributes']);_0x3adc6b['query']=_['keys'](_0x20afb8[_0xcb93('0x34')]);_0x3adc6b[_0xcb93('0x9b')]=_[_0xcb93('0x3b')](_0x3adc6b[_0xcb93('0x38')],_0x3adc6b['query']);_0x392f66[_0xcb93('0x3c')]=_['intersection'](_0x3adc6b['model'],qs[_0xcb93('0x3d')](_0x20afb8['query'][_0xcb93('0x3d')]));_0x392f66['attributes']=_0x392f66['attributes'][_0xcb93('0x3e')]?_0x392f66['attributes']:_0x3adc6b['model'];if(!_0x20afb8[_0xcb93('0x34')][_0xcb93('0x9c')](_0xcb93('0x9d'))){_0x392f66['limit']=qs[_0xcb93('0x22')](_0x20afb8[_0xcb93('0x34')][_0xcb93('0x22')]);_0x392f66[_0xcb93('0x9e')]=qs['offset'](_0x20afb8[_0xcb93('0x34')][_0xcb93('0x9e')]);}_0x392f66['order']=qs[_0xcb93('0x9f')](_0x20afb8[_0xcb93('0x34')][_0xcb93('0x9f')]);_0x392f66[_0xcb93('0xa0')]=qs[_0xcb93('0x9b')](_[_0xcb93('0xa8')](_0x20afb8[_0xcb93('0x34')],_0x3adc6b[_0xcb93('0x9b')]));_0x392f66['where'][_0xcb93('0xa1')]=_0x3c300d['id'];if(_0x20afb8[_0xcb93('0x34')][_0xcb93('0xa2')]){_0x392f66[_0xcb93('0xa0')]=_[_0xcb93('0x41')](_0x392f66[_0xcb93('0xa0')],{'$or':_['map'](_0x392f66[_0xcb93('0x3c')],function(_0x36338e){var _0x51a102={};_0x51a102[_0x36338e]={'$like':'%'+_0x20afb8[_0xcb93('0x34')][_0xcb93('0xa2')]+'%'};return _0x51a102;})});}_0x392f66[_0xcb93('0xa0')][_0xcb93('0x8e')]=![];if(_0x20afb8[_0xcb93('0x34')]['id']){_0x392f66[_0xcb93('0xa0')]['id']={'$gt':_0x20afb8[_0xcb93('0x34')]['id']};}_0x392f66=_[_0xcb93('0x41')]({},_0x392f66,_0x20afb8[_0xcb93('0xa6')]);return db['ChatMessage'][_0xcb93('0x24')]({'where':_0x392f66[_0xcb93('0xa0')]})['then'](function(_0x4f1d20){_0x4239e8[_0xcb93('0x24')]=_0x4f1d20;_0x392f66[_0xcb93('0x40')]=[];if(_0x20afb8['query'][_0xcb93('0xa9')]){_0x392f66[_0xcb93('0x40')][_0xcb93('0xaa')]({'model':db[_0xcb93('0x7e')],'as':_0xcb93('0x7e'),'attributes':['id','fullname','alias']});}if(_0x20afb8[_0xcb93('0x34')]['includeAll']){_0x392f66[_0xcb93('0x40')]=[{'all':!![]}];}return db[_0xcb93('0x5c')]['findAll'](_0x392f66);})['then'](function(_0x40f639){_0x4239e8[_0xcb93('0xab')]=_0x40f639;return _0x4239e8;});}})[_0xcb93('0x16')](respondWithFilteredResult(_0x263f50,_0x392f66))['catch'](handleError(_0x263f50,null));};exports[_0xcb93('0xac')]=function(_0x409f8d,_0x4a5b3b){return db['ChatInteraction'][_0xcb93('0x42')]({'where':{'id':_0x409f8d[_0xcb93('0x37')]['id']}})[_0xcb93('0x16')](handleEntityNotFound(_0x4a5b3b,null))['then'](function(_0x4beb26){if(_0x4beb26){return _0x4beb26[_0xcb93('0xad')](_0x409f8d['body'][_0xcb93('0x98')],_[_0xcb93('0x99')](_0x409f8d[_0xcb93('0x44')],[_0xcb93('0x98'),'id'])||{})[_0xcb93('0xae')](function(){return db[_0xcb93('0xaf')]['findAll']({'attributes':['id',_0xcb93('0x28'),_0xcb93('0xb0')],'where':{'id':_0x409f8d[_0xcb93('0x44')][_0xcb93('0x98')]}});})[_0xcb93('0x16')](function(_0x2cc5b7){socket[_0xcb93('0xb1')](_0xcb93('0xb2'),{'id':Number(_0x409f8d[_0xcb93('0x37')]['id']),'tags':_0x2cc5b7||[]});return{'id':Number(_0x409f8d[_0xcb93('0x37')]['id']),'tags':_0x2cc5b7||[]};});}})[_0xcb93('0x16')](respondWithResult(_0x4a5b3b,null))['catch'](handleError(_0x4a5b3b,null));};exports['removeTags']=function(_0x3160a0,_0x53c3f4){return db[_0xcb93('0x3a')][_0xcb93('0x42')]({'where':{'id':_0x3160a0[_0xcb93('0x37')]['id']}})[_0xcb93('0x16')](handleEntityNotFound(_0x53c3f4,null))['then'](function(_0x2f3cc0){if(_0x2f3cc0){return _0x2f3cc0[_0xcb93('0xb3')](_0x3160a0['query'][_0xcb93('0x98')]);}})[_0xcb93('0x16')](respondWithStatusCode(_0x53c3f4,null))[_0xcb93('0x35')](handleError(_0x53c3f4,null));};exports[_0xcb93('0x77')]=function(_0x38ae4a,_0x2825e9){var _0x4ce2b4=moment()[_0xcb93('0xb4')]()['toString']();var _0x102dfc=path[_0xcb93('0x73')](config[_0xcb93('0x74')],_0xcb93('0xb5'),_0xcb93('0xb6'),_0xcb93('0xb7'));var _0x2d8f2a=path['join'](config['root'],'server',_0xcb93('0xb6'),_0xcb93('0xb8'));var _0x5962c1=path[_0xcb93('0x73')](_0x102dfc,_0x4ce2b4);var _0x5d62eb=util[_0xcb93('0x7a')](_0xcb93('0xb9'),_0x38ae4a[_0xcb93('0x37')]['id'],_0x4ce2b4);var _0x33168a=path[_0xcb93('0x73')](_0x102dfc,_0x5d62eb);var _0x174a75=[];_0x174a75[_0xcb93('0xaa')]({'model':db[_0xcb93('0x7e')],'as':_0xcb93('0x7e'),'attributes':['id',_0xcb93('0x4f')],'raw':!![]});_0x174a75[_0xcb93('0xaa')]({'model':db['CmContact'],'as':_0xcb93('0x61'),'attributes':['id','firstName',_0xcb93('0xba')],'raw':!![]});if(_0x38ae4a[_0xcb93('0x34')][_0xcb93('0xb8')]){_0x174a75['push']({'model':db[_0xcb93('0x6d')],'as':_0xcb93('0x6d'),'raw':!![]});}var _0x5e68dc=[{'model':db[_0xcb93('0x5c')],'as':'Messages','attributes':['id',_0xcb93('0x44'),_0xcb93('0x8b'),_0xcb93('0x8d'),_0xcb93('0x8e'),_0xcb93('0xbb')],'include':_0x174a75}];_0x5e68dc[_0xcb93('0xaa')]({'model':db[_0xcb93('0x48')],'as':_0xcb93('0xbc'),'attributes':['id',_0xcb93('0x28')]});_0x5e68dc[_0xcb93('0xaa')]({'model':db[_0xcb93('0x7e')],'as':_0xcb93('0xbd'),'attributes':['id',_0xcb93('0x4f')]});return db[_0xcb93('0x3a')][_0xcb93('0x42')]({'where':{'id':_0x38ae4a['params']['id']},'include':_0x5e68dc})['then'](handleEntityNotFound(_0x2825e9,null))[_0xcb93('0x16')](function(_0x9cb7e5){if(_0x9cb7e5){var _0x3a23fb=_0x9cb7e5[_0xcb93('0xbe')]({'plain':!![]});fs[_0xcb93('0xbf')](_0x5962c1);var _0x420e7c={'channel':_0xcb93('0xc0'),'account':_0x3a23fb['Account'][_0xcb93('0x28')],'agent':_0x3a23fb[_0xcb93('0xbd')]?_0x3a23fb['Owner'][_0xcb93('0x4f')]:_0xcb93('0xc1'),'createdAt':moment(_0x3a23fb[_0xcb93('0x8b')])[_0xcb93('0x7a')](_0xcb93('0xa5'))[_0xcb93('0xc2')](),'closedAt':_0x3a23fb[_0xcb93('0x66')]?moment(_0x3a23fb[_0xcb93('0xc3')])[_0xcb93('0x7a')](_0xcb93('0xa5'))[_0xcb93('0xc2')]():'','disposition':_0x3a23fb[_0xcb93('0x67')],'chatInfo':{'browser':_0x3a23fb[_0xcb93('0xc4')],'os':_0x3a23fb[_0xcb93('0xc5')],'referer':_0x3a23fb[_0xcb93('0xc6')],'customerIp':_0x3a23fb[_0xcb93('0xc7')],'customerPort':_0x3a23fb[_0xcb93('0xc8')]?_0x3a23fb[_0xcb93('0xc8')]:_0xcb93('0xc1')},'messages':_(_0x3a23fb[_0xcb93('0x80')])[_0xcb93('0xc9')]()['filter']({'secret':![]})['map'](function(_0x4b0e2f){if(_0x4b0e2f['Attachment']){var _0x1276f5=path['join'](_0x2d8f2a,_0x4b0e2f[_0xcb93('0x6d')][_0xcb93('0xca')]);if(fs[_0xcb93('0xcb')](_0x1276f5)){fs[_0xcb93('0xcc')](_0x1276f5)[_0xcb93('0xcd')](fs['createWriteStream'](path[_0xcb93('0x73')](_0x5962c1,_0x4b0e2f[_0xcb93('0x6d')]['basename'])));}}return{'date':moment(_0x4b0e2f[_0xcb93('0x8b')])[_0xcb93('0x7a')](_0xcb93('0xa5'))[_0xcb93('0xc2')](),'sender':_0x4b0e2f['direction']===_0xcb93('0x5b')?_0x4b0e2f[_0xcb93('0x7e')]?_0x4b0e2f[_0xcb93('0x7e')][_0xcb93('0x4f')]:_0xcb93('0x87'):_0x4b0e2f['Contact'][_0xcb93('0xce')]+(_0x4b0e2f[_0xcb93('0x61')][_0xcb93('0xba')]?'\x20'+_0x4b0e2f[_0xcb93('0x61')][_0xcb93('0xba')]:''),'body':_0x4b0e2f[_0xcb93('0x6d')]?_0x4b0e2f['Attachment'][_0xcb93('0xca')]:_0x4b0e2f['body'],'direction':_0x4b0e2f[_0xcb93('0x8d')]===_0xcb93('0x5b')?'A':'C','secret':_0x4b0e2f[_0xcb93('0x8e')],'read':_0x4b0e2f[_0xcb93('0xbb')],'attachment':_0x4b0e2f[_0xcb93('0x6d')]};})[_0xcb93('0xcf')]()};return ejs[_0xcb93('0xd0')](path[_0xcb93('0x73')](config[_0xcb93('0x74')],_0xcb93('0xb5'),_0xcb93('0xd1'),_0xcb93('0xd2')),{'interaction':_0x420e7c})['then'](function(_0x29bde6){var _0x3e033c=path[_0xcb93('0x73')](_0x5962c1,'transcript-'+_0x3a23fb['id']+'-'+_0x4ce2b4+'.pdf');var _0x31c44f={'path':_0x3e033c,'channel':_0xcb93('0xc0'),'interactionId':_0x3a23fb['id']};return pdf[_0xcb93('0xd3')](_0x29bde6,_0x31c44f);})[_0xcb93('0x16')](function(){return new Promise(function(_0x4113db,_0x6c7cad){zipdir(_0x5962c1,{'saveTo':_0x33168a},function(_0x4ec5b9,_0x57091b){if(_0x4ec5b9)return _0x6c7cad(_0x4ec5b9);return _0x4113db(_0x57091b);});})[_0xcb93('0x16')](function(){return new BPromise(function(_0x2d0132,_0x55feff){rimraf(_0x5962c1,function(_0x10d1e7){if(_0x10d1e7)_0x55feff(_0x10d1e7);return _0x2d0132();});});})[_0xcb93('0x16')](function(){return _0x2825e9[_0xcb93('0x77')](_0x33168a,_0x5d62eb,function(_0x48a876){if(_0x48a876){logger['error'](_0xcb93('0xd4'),_0x48a876);}else{fs[_0xcb93('0xd5')](_0x33168a);}});});});}else{return _0x2825e9[_0xcb93('0x1f')](0xc8);}})['catch'](handleError(_0x2825e9,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 2e3154f..4445fe6 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 _0x2545=['length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update','remove','then','setDataValue','Users','map','findAll','unreadMessages'];(function(_0x204dad,_0x1c422b){var _0x2ea8c5=function(_0x3b69a2){while(--_0x3b69a2){_0x204dad['push'](_0x204dad['shift']());}};_0x2ea8c5(++_0x1c422b);}(_0x2545,0x15c));var _0x5254=function(_0x45018e,_0x356d51){_0x45018e=_0x45018e-0x0;var _0x2fb96b=_0x2545[_0x45018e];return _0x2fb96b;};'use strict';var EventEmitter=require(_0x5254('0x0'));var ChatInteraction=require(_0x5254('0x1'))['db'][_0x5254('0x2')];var ChatMessage=require(_0x5254('0x1'))['db'][_0x5254('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x5254('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5254('0x5'),'afterDestroy':_0x5254('0x6')};function emitEvent(_0x2a7b6c){return function(_0x423ef5,_0x5716fc,_0x19bbe9){_0x423ef5['getUsers']({'attributes':['id'],'raw':!![]})[_0x5254('0x7')](function(_0xe52b4b){_0x423ef5[_0x5254('0x8')](_0x5254('0x9'),_0xe52b4b[_0x5254('0xa')](function(_0x589a3e){return{'id':_0x589a3e['id']};}));return ChatMessage[_0x5254('0xb')]({'where':{'ChatInteractionId':_0x423ef5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5254('0x7')](function(_0x3711d0){_0x423ef5[_0x5254('0x8')](_0x5254('0xc'),_0x3711d0[_0x5254('0xd')]);ChatInteractionEvents['emit'](_0x2a7b6c+':'+_0x423ef5['id'],_0x423ef5);ChatInteractionEvents[_0x5254('0xe')](_0x2a7b6c,_0x423ef5);_0x19bbe9(null);})[_0x5254('0xf')](_0x19bbe9(null));};}for(var e in events){if(events[_0x5254('0x10')](e)){var event=events[e];ChatInteraction[_0x5254('0x11')](e,emitEvent(event));}}module[_0x5254('0x12')]=ChatInteractionEvents; \ No newline at end of file +var _0x120a=['catch','hook','exports','../../mysqldb','ChatMessage','setMaxListeners','save','update','getUsers','then','Users','map','findAll','unreadMessages','length','emit'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x120a,0x123));var _0xa120=function(_0x5660d5,_0x235c27){_0x5660d5=_0x5660d5-0x0;var _0x2a144d=_0x120a[_0x5660d5];return _0x2a144d;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xa120('0x0'))['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db'][_0xa120('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xa120('0x2')](0x0);var events={'afterCreate':_0xa120('0x3'),'afterUpdate':_0xa120('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5880fe){return function(_0x1fe3de,_0xaec991,_0x1ede00){_0x1fe3de[_0xa120('0x5')]({'attributes':['id'],'raw':!![]})[_0xa120('0x6')](function(_0x29c572){_0x1fe3de['setDataValue'](_0xa120('0x7'),_0x29c572[_0xa120('0x8')](function(_0x5263e3){return{'id':_0x5263e3['id']};}));return ChatMessage[_0xa120('0x9')]({'where':{'ChatInteractionId':_0x1fe3de['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa120('0x6')](function(_0x1e2f49){_0x1fe3de['setDataValue'](_0xa120('0xa'),_0x1e2f49[_0xa120('0xb')]);ChatInteractionEvents['emit'](_0x5880fe+':'+_0x1fe3de['id'],_0x1fe3de);ChatInteractionEvents[_0xa120('0xc')](_0x5880fe,_0x1fe3de);_0x1ede00(null);})[_0xa120('0xd')](_0x1ede00(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xa120('0xe')](e,emitEvent(event));}}module[_0xa120('0xf')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index b58d197..76f7af6 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 _0xd8b7=['YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format'];(function(_0x31d0c4,_0x3b945c){var _0x3dcf14=function(_0x244a97){while(--_0x244a97){_0x31d0c4['push'](_0x31d0c4['shift']());}};_0x3dcf14(++_0x3b945c);}(_0xd8b7,0x16a));var _0x7d8b=function(_0x39de72,_0x4c4ca2){_0x39de72=_0x39de72-0x0;var _0x205c05=_0xd8b7[_0x39de72];return _0x205c05;};'use strict';var _=require(_0x7d8b('0x0'));var util=require(_0x7d8b('0x1'));var logger=require(_0x7d8b('0x2'))(_0x7d8b('0x3'));var moment=require(_0x7d8b('0x4'));var BPromise=require(_0x7d8b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d8b('0x6'));var rimraf=require(_0x7d8b('0x7'));var config=require(_0x7d8b('0x8'));var attributes=require(_0x7d8b('0x9'));module[_0x7d8b('0xa')]=function(_0x4433a9,_0x1539e2){return _0x4433a9[_0x7d8b('0xb')](_0x7d8b('0xc'),attributes,{'tableName':_0x7d8b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xe8172f,_0x481625,_0x458e53){if(_0xe8172f[_0x7d8b('0xe')](_0x7d8b('0xf'))){_0xe8172f[_0x7d8b('0x10')]=moment()[_0x7d8b('0x11')](_0x7d8b('0x12'));}_0x458e53(null,_0xe8172f);}},'charset':'utf8mb4','collate':_0x7d8b('0x13')});}; \ No newline at end of file +var _0x0621=['define','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','path','rimraf','./chatInteraction.attributes'];(function(_0x4e0c31,_0x208e9f){var _0x3fd7df=function(_0x5ee817){while(--_0x5ee817){_0x4e0c31['push'](_0x4e0c31['shift']());}};_0x3fd7df(++_0x208e9f);}(_0x0621,0xb9));var _0x1062=function(_0x15442a,_0x376922){_0x15442a=_0x15442a-0x0;var _0x177f81=_0x0621[_0x15442a];return _0x177f81;};'use strict';var _=require('lodash');var util=require(_0x1062('0x0'));var logger=require(_0x1062('0x1'))('api');var moment=require(_0x1062('0x2'));var BPromise=require(_0x1062('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1062('0x4'));var rimraf=require(_0x1062('0x5'));var config=require('../../config/environment');var attributes=require(_0x1062('0x6'));module['exports']=function(_0x21064e,_0x5d87c9){return _0x21064e[_0x1062('0x7')]('ChatInteraction',attributes,{'tableName':_0x1062('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x48147a,_0x27ecad,_0x5ac2b7){if(_0x48147a[_0x1062('0x9')](_0x1062('0xa'))){_0x48147a[_0x1062('0xb')]=moment()[_0x1062('0xc')](_0x1062('0xd'));}_0x5ac2b7(null,_0x48147a);}},'charset':_0x1062('0xe'),'collate':_0x1062('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index c07290c..c712e88 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 _0xa6d4=['ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateChatInteraction','ChatInteraction','body','options','where','limit','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','request','then','info'];(function(_0x5d0963,_0x271b3b){var _0x18fe83=function(_0x56dffd){while(--_0x56dffd){_0x5d0963['push'](_0x5d0963['shift']());}};_0x18fe83(++_0x271b3b);}(_0xa6d4,0x6b));var _0x4a6d=function(_0x502bea,_0x156e5b){_0x502bea=_0x502bea-0x0;var _0x2523ba=_0xa6d4[_0x502bea];return _0x2523ba;};'use strict';var _=require(_0x4a6d('0x0'));var util=require(_0x4a6d('0x1'));var moment=require(_0x4a6d('0x2'));var BPromise=require(_0x4a6d('0x3'));var rs=require(_0x4a6d('0x4'));var fs=require('fs');var Redis=require(_0x4a6d('0x5'));var db=require(_0x4a6d('0x6'))['db'];var utils=require(_0x4a6d('0x7'));var logger=require(_0x4a6d('0x8'))(_0x4a6d('0x9'));var config=require(_0x4a6d('0xa'));var jayson=require(_0x4a6d('0xb'));var client=jayson[_0x4a6d('0xc')][_0x4a6d('0xd')]({'port':0x232a});config[_0x4a6d('0xe')]=_[_0x4a6d('0xf')](config[_0x4a6d('0xe')],{'host':_0x4a6d('0x10'),'port':0x18eb});var socket=require(_0x4a6d('0x11'))(new Redis(config[_0x4a6d('0xe')]));require(_0x4a6d('0x12'))['register'](socket);function respondWithRpcPromise(_0x55e2fa,_0xa2687d,_0xe4cc14){return new BPromise(function(_0x10f614,_0x290de7){return client[_0x4a6d('0x13')](_0x55e2fa,_0xe4cc14)[_0x4a6d('0x14')](function(_0x51abe8){logger[_0x4a6d('0x15')](_0x4a6d('0x16'),_0xa2687d,_0x4a6d('0x17'));logger[_0x4a6d('0x18')](_0x4a6d('0x19'),_0xa2687d,_0x4a6d('0x17'),JSON[_0x4a6d('0x1a')](_0x51abe8));if(_0x51abe8[_0x4a6d('0x1b')]){if(_0x51abe8[_0x4a6d('0x1b')]['code']===0x1f4){logger[_0x4a6d('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0xa2687d,_0x51abe8[_0x4a6d('0x1b')][_0x4a6d('0x1c')]);return _0x290de7(_0x51abe8[_0x4a6d('0x1b')][_0x4a6d('0x1c')]);}logger[_0x4a6d('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0xa2687d,_0x51abe8[_0x4a6d('0x1b')][_0x4a6d('0x1c')]);return _0x10f614(_0x51abe8[_0x4a6d('0x1b')][_0x4a6d('0x1c')]);}else{logger[_0x4a6d('0x15')](_0x4a6d('0x16'),_0xa2687d,_0x4a6d('0x17'));_0x10f614(_0x51abe8['result'][_0x4a6d('0x1c')]);}})[_0x4a6d('0x1d')](function(_0x238f09){logger[_0x4a6d('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0xa2687d,_0x238f09);_0x290de7(_0x238f09);});});}exports[_0x4a6d('0x1e')]=function(_0x5f3ab1){var _0x2d6104=this;return new Promise(function(_0x5dbc16,_0x5b8f4d){return db[_0x4a6d('0x1f')]['update'](_0x5f3ab1[_0x4a6d('0x20')],{'raw':_0x5f3ab1[_0x4a6d('0x21')]?_0x5f3ab1['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f3ab1[_0x4a6d('0x21')]?_0x5f3ab1['options'][_0x4a6d('0x22')]||null:null,'attributes':_0x5f3ab1[_0x4a6d('0x21')]?_0x5f3ab1[_0x4a6d('0x21')]['attributes']||null:null,'limit':_0x5f3ab1[_0x4a6d('0x21')]?_0x5f3ab1['options'][_0x4a6d('0x23')]||null:null})['then'](function(_0xe6cc8){logger[_0x4a6d('0x15')]('UpdateChatInteraction',_0x5f3ab1);logger[_0x4a6d('0x18')](_0x4a6d('0x1e'),_0x5f3ab1,JSON[_0x4a6d('0x1a')](_0xe6cc8));_0x5dbc16(_0xe6cc8);})[_0x4a6d('0x1d')](function(_0x269279){logger[_0x4a6d('0x1b')](_0x4a6d('0x1e'),_0x269279[_0x4a6d('0x1c')],_0x5f3ab1);_0x5b8f4d(_0x2d6104['error'](0x1f4,_0x269279[_0x4a6d('0x1c')]));});});};exports[_0x4a6d('0x24')]=function(_0x1737fe){return new Promise(function(_0x480d82,_0x381261){return db['ChatInteraction'][_0x4a6d('0x25')]({'where':_0x1737fe['options']?_0x1737fe[_0x4a6d('0x21')][_0x4a6d('0x22')]||null:null})[_0x4a6d('0x14')](function(_0x99d2dc){if(_0x99d2dc){return _0x99d2dc[_0x4a6d('0x26')](_0x1737fe['body'][_0x4a6d('0x27')],_[_0x4a6d('0x28')](_0x1737fe['body'],[_0x4a6d('0x27'),'id'])||{});}})[_0x4a6d('0x29')](function(_0x4819e1){logger[_0x4a6d('0x15')](_0x4a6d('0x2a'),_0x1737fe);logger[_0x4a6d('0x18')](_0x4a6d('0x2a'),_0x1737fe,JSON[_0x4a6d('0x1a')](_0x4819e1));_0x480d82(_0x4819e1);})[_0x4a6d('0x1d')](function(_0x36ac0a){logger[_0x4a6d('0x1b')](_0x4a6d('0x2a'),_0x36ac0a[_0x4a6d('0x1c')],_0x1737fe);_0x381261(_this[_0x4a6d('0x1b')](0x1f4,_0x36ac0a[_0x4a6d('0x1c')]));});});}; \ No newline at end of file +var _0x892a=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ChatInteraction','update','body','options','raw','attributes','limit','UpdateChatInteraction','debug','AddTagsToChatInteraction','find','where','addTags','ids','spread','AddTags','lodash','util'];(function(_0xe4eb19,_0x22278e){var _0x102f90=function(_0x1542af){while(--_0x1542af){_0xe4eb19['push'](_0xe4eb19['shift']());}};_0x102f90(++_0x22278e);}(_0x892a,0x118));var _0xa892=function(_0x59e821,_0x86c723){_0x59e821=_0x59e821-0x0;var _0x5333f6=_0x892a[_0x59e821];return _0x5333f6;};'use strict';var _=require(_0xa892('0x0'));var util=require(_0xa892('0x1'));var moment=require(_0xa892('0x2'));var BPromise=require(_0xa892('0x3'));var rs=require(_0xa892('0x4'));var fs=require('fs');var Redis=require(_0xa892('0x5'));var db=require(_0xa892('0x6'))['db'];var utils=require(_0xa892('0x7'));var logger=require(_0xa892('0x8'))(_0xa892('0x9'));var config=require(_0xa892('0xa'));var jayson=require(_0xa892('0xb'));var client=jayson[_0xa892('0xc')][_0xa892('0xd')]({'port':0x232a});config[_0xa892('0xe')]=_[_0xa892('0xf')](config[_0xa892('0xe')],{'host':_0xa892('0x10'),'port':0x18eb});var socket=require(_0xa892('0x11'))(new Redis(config['redis']));require(_0xa892('0x12'))[_0xa892('0x13')](socket);function respondWithRpcPromise(_0x201297,_0x578820,_0x2e2ef4){return new BPromise(function(_0x246f84,_0x2270f7){return client[_0xa892('0x14')](_0x201297,_0x2e2ef4)[_0xa892('0x15')](function(_0x128bcc){logger[_0xa892('0x16')](_0xa892('0x17'),_0x578820,_0xa892('0x18'));logger['debug'](_0xa892('0x19'),_0x578820,_0xa892('0x18'),JSON[_0xa892('0x1a')](_0x128bcc));if(_0x128bcc[_0xa892('0x1b')]){if(_0x128bcc[_0xa892('0x1b')]['code']===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x578820,_0x128bcc[_0xa892('0x1b')][_0xa892('0x1c')]);return _0x2270f7(_0x128bcc['error'][_0xa892('0x1c')]);}logger[_0xa892('0x1b')](_0xa892('0x17'),_0x578820,_0x128bcc[_0xa892('0x1b')][_0xa892('0x1c')]);return _0x246f84(_0x128bcc['error'][_0xa892('0x1c')]);}else{logger[_0xa892('0x16')](_0xa892('0x17'),_0x578820,_0xa892('0x18'));_0x246f84(_0x128bcc[_0xa892('0x1d')]['message']);}})[_0xa892('0x1e')](function(_0x38e9b0){logger['error'](_0xa892('0x17'),_0x578820,_0x38e9b0);_0x2270f7(_0x38e9b0);});});}exports['UpdateChatInteraction']=function(_0x50379e){var _0x2b6ce7=this;return new Promise(function(_0x57ced8,_0x15412f){return db[_0xa892('0x1f')][_0xa892('0x20')](_0x50379e[_0xa892('0x21')],{'raw':_0x50379e[_0xa892('0x22')]?_0x50379e['options'][_0xa892('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50379e[_0xa892('0x22')]?_0x50379e[_0xa892('0x22')]['where']||null:null,'attributes':_0x50379e[_0xa892('0x22')]?_0x50379e[_0xa892('0x22')][_0xa892('0x24')]||null:null,'limit':_0x50379e['options']?_0x50379e[_0xa892('0x22')][_0xa892('0x25')]||null:null})[_0xa892('0x15')](function(_0x164c2d){logger['info'](_0xa892('0x26'),_0x50379e);logger[_0xa892('0x27')]('UpdateChatInteraction',_0x50379e,JSON[_0xa892('0x1a')](_0x164c2d));_0x57ced8(_0x164c2d);})['catch'](function(_0x3daee3){logger[_0xa892('0x1b')](_0xa892('0x26'),_0x3daee3['message'],_0x50379e);_0x15412f(_0x2b6ce7[_0xa892('0x1b')](0x1f4,_0x3daee3[_0xa892('0x1c')]));});});};exports[_0xa892('0x28')]=function(_0x2954c3){return new Promise(function(_0x1bad96,_0x1f825c){return db[_0xa892('0x1f')][_0xa892('0x29')]({'where':_0x2954c3['options']?_0x2954c3['options'][_0xa892('0x2a')]||null:null})[_0xa892('0x15')](function(_0x1a3c01){if(_0x1a3c01){return _0x1a3c01[_0xa892('0x2b')](_0x2954c3['body'][_0xa892('0x2c')],_['omit'](_0x2954c3[_0xa892('0x21')],[_0xa892('0x2c'),'id'])||{});}})[_0xa892('0x2d')](function(_0xff48c5){logger[_0xa892('0x16')](_0xa892('0x2e'),_0x2954c3);logger[_0xa892('0x27')]('AddTags',_0x2954c3,JSON[_0xa892('0x1a')](_0xff48c5));_0x1bad96(_0xff48c5);})[_0xa892('0x1e')](function(_0x629fab){logger['error'](_0xa892('0x2e'),_0x629fab[_0xa892('0x1c')],_0x2954c3);_0x1f825c(_this['error'](0x1f4,_0x629fab[_0xa892('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index c9f3556..6c2604e 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 _0xc800=['length','chatInteraction:','./chatInteraction.events','save','update','emit','removeListener'];(function(_0x728d21,_0x38b13a){var _0x3faf64=function(_0x242593){while(--_0x242593){_0x728d21['push'](_0x728d21['shift']());}};_0x3faf64(++_0x38b13a);}(_0xc800,0x1b4));var _0x0c80=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xc800[_0xb0f7c3];return _0x28ea68;};'use strict';var ChatInteractionEvents=require(_0x0c80('0x0'));var events=[_0x0c80('0x1'),'remove',_0x0c80('0x2')];function createListener(_0xf101b2,_0x367e2e){return function(_0x480abd){_0x367e2e[_0x0c80('0x3')](_0xf101b2,_0x480abd);};}function removeListener(_0x2f9122,_0x31633f){return function(){ChatInteractionEvents[_0x0c80('0x4')](_0x2f9122,_0x31633f);};}exports['register']=function(_0x299f3b){for(var _0x55ba02=0x0,_0x1beb3d=events[_0x0c80('0x5')];_0x55ba02<_0x1beb3d;_0x55ba02++){var _0x4e9988=events[_0x55ba02];var _0x4ca663=createListener(_0x0c80('0x6')+_0x4e9988,_0x299f3b);ChatInteractionEvents['on'](_0x4e9988,_0x4ca663);}}; \ No newline at end of file +var _0xe508=['chatInteraction:','./chatInteraction.events','save'];(function(_0xdd9a5f,_0x3ced93){var _0x3464b7=function(_0x35b534){while(--_0x35b534){_0xdd9a5f['push'](_0xdd9a5f['shift']());}};_0x3464b7(++_0x3ced93);}(_0xe508,0x67));var _0x8e50=function(_0x287de4,_0x1537ba){_0x287de4=_0x287de4-0x0;var _0x4e4d6c=_0xe508[_0x287de4];return _0x4e4d6c;};'use strict';var ChatInteractionEvents=require(_0x8e50('0x0'));var events=[_0x8e50('0x1'),'remove','update'];function createListener(_0x5b8f75,_0x4b2aa5){return function(_0x49f7d2){_0x4b2aa5['emit'](_0x5b8f75,_0x49f7d2);};}function removeListener(_0x2df7a1,_0x50dd7d){return function(){ChatInteractionEvents['removeListener'](_0x2df7a1,_0x50dd7d);};}exports['register']=function(_0x2d6ccd){for(var _0x40f1f9=0x0,_0x2073b4=events['length'];_0x40f1f9<_0x2073b4;_0x40f1f9++){var _0x340c44=events[_0x40f1f9];var _0x27c735=createListener(_0x8e50('0x2')+_0x340c44,_0x2d6ccd);ChatInteractionEvents['on'](_0x340c44,_0x27c735);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index e8e624e..702acdf 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 _0xae51=['../../components/interaction/service','./chatInteraction.controller','get','index','/describe','isAuthenticated','show','isChatInteractionAuthorized','/:id/messages','getMessages','/:id/my_messages','/:id/download','post','create','/:id/vidaoo','diskStorage','join','root','format','%s-%s','now','originalname','replace','single','attachmentUpload','addMessage','/:id/tags','tracked','chatinteraction:addtags','put','/:id','chat','chatinteraction:update','/:id/custom_update','abandon','/:id/close','close','chatinteraction:destroy','destroy','removeTags','express','Router','fs-extra','../../components/auth/service'];(function(_0x54e798,_0x59f8ba){var _0x11b0ec=function(_0x34d846){while(--_0x34d846){_0x54e798['push'](_0x54e798['shift']());}};_0x11b0ec(++_0x59f8ba);}(_0xae51,0x80));var _0x1ae5=function(_0x5254ca,_0x239f18){_0x5254ca=_0x5254ca-0x0;var _0x2b36e4=_0xae51[_0x5254ca];return _0x2b36e4;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1ae5('0x0'));var router=express[_0x1ae5('0x1')]();var fs_extra=require(_0x1ae5('0x2'));var auth=require(_0x1ae5('0x3'));var interaction=require(_0x1ae5('0x4'));var config=require('../../config/environment');var controller=require(_0x1ae5('0x5'));router[_0x1ae5('0x6')]('/',auth['isAuthenticated'](),controller[_0x1ae5('0x7')]);router[_0x1ae5('0x6')](_0x1ae5('0x8'),auth[_0x1ae5('0x9')](),controller['describe']);router[_0x1ae5('0x6')]('/:id',auth['isChatInteractionAuthorized'](),controller[_0x1ae5('0xa')]);router[_0x1ae5('0x6')]('/:id/attachment_download',auth[_0x1ae5('0xb')](),controller['attachmentDownload']);router[_0x1ae5('0x6')](_0x1ae5('0xc'),auth[_0x1ae5('0x9')](),controller[_0x1ae5('0xd')]);router[_0x1ae5('0x6')](_0x1ae5('0xe'),auth[_0x1ae5('0xb')](),controller['getMyMessages']);router[_0x1ae5('0x6')](_0x1ae5('0xf'),auth['isAuthenticated'](),controller['download']);router[_0x1ae5('0x10')]('/',auth['isAuthenticated'](),controller[_0x1ae5('0x11')]);router[_0x1ae5('0x10')](_0x1ae5('0x12'),auth[_0x1ae5('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x1ae5('0x13')]({'destination':function(_0x35e4cb,_0x51ead5,_0xa33610){_0xa33610(null,path[_0x1ae5('0x14')](config[_0x1ae5('0x15')],'server/files/attachments/'));},'filename':function(_0x26466a,_0x1ccb3f,_0x48e16c){_0x48e16c(null,util[_0x1ae5('0x16')](_0x1ae5('0x17'),Date[_0x1ae5('0x18')](),_0x1ccb3f[_0x1ae5('0x19')][_0x1ae5('0x1a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x1ae5('0x10')]('/:id/attachment_upload',upload[_0x1ae5('0x1b')]('file'),controller[_0x1ae5('0x1c')]);router[_0x1ae5('0x10')](_0x1ae5('0xc'),auth['isChatInteractionAuthorized'](),controller[_0x1ae5('0x1d')]);router[_0x1ae5('0x10')](_0x1ae5('0x1e'),auth[_0x1ae5('0x9')](),interaction[_0x1ae5('0x1f')]('chat',_0x1ae5('0x20')),controller['addTags']);router[_0x1ae5('0x21')](_0x1ae5('0x22'),auth[_0x1ae5('0x9')](),interaction[_0x1ae5('0x1f')](_0x1ae5('0x23'),_0x1ae5('0x24')),controller['update']);router[_0x1ae5('0x21')](_0x1ae5('0x25'),controller['customUpdate']);router[_0x1ae5('0x21')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0x1ae5('0x26')]);router[_0x1ae5('0x21')](_0x1ae5('0x27'),controller[_0x1ae5('0x28')]);router['delete'](_0x1ae5('0x22'),auth[_0x1ae5('0x9')](),interaction['tracked'](_0x1ae5('0x23'),_0x1ae5('0x29')),controller[_0x1ae5('0x2a')]);router['delete'](_0x1ae5('0x1e'),auth[_0x1ae5('0x9')](),controller[_0x1ae5('0x2b')]);module['exports']=router; \ No newline at end of file +var _0xeac8=['/:id/attachment_upload','file','attachmentUpload','/:id/tags','chat','chatinteraction:addtags','addTags','put','update','/:id/custom_update','/:id/abandon','abandon','/:id/close','close','delete','tracked','chatinteraction:destroy','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','/describe','isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','post','/:id/vidaoo','createVidaooSession','root','format','%s-%s','originalname','replace'];(function(_0x30d73b,_0x116e54){var _0x38ed37=function(_0x4c6272){while(--_0x4c6272){_0x30d73b['push'](_0x30d73b['shift']());}};_0x38ed37(++_0x116e54);}(_0xeac8,0x13f));var _0x8eac=function(_0x573a7f,_0x1452fa){_0x573a7f=_0x573a7f-0x0;var _0x420fee=_0xeac8[_0x573a7f];return _0x420fee;};'use strict';var multer=require(_0x8eac('0x0'));var util=require('util');var path=require(_0x8eac('0x1'));var timeout=require(_0x8eac('0x2'));var express=require(_0x8eac('0x3'));var router=express[_0x8eac('0x4')]();var fs_extra=require(_0x8eac('0x5'));var auth=require(_0x8eac('0x6'));var interaction=require(_0x8eac('0x7'));var config=require(_0x8eac('0x8'));var controller=require(_0x8eac('0x9'));router[_0x8eac('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8eac('0xa')](_0x8eac('0xb'),auth[_0x8eac('0xc')](),controller[_0x8eac('0xd')]);router['get'](_0x8eac('0xe'),auth[_0x8eac('0xf')](),controller[_0x8eac('0x10')]);router['get'](_0x8eac('0x11'),auth['isChatInteractionAuthorized'](),controller[_0x8eac('0x12')]);router[_0x8eac('0xa')](_0x8eac('0x13'),auth[_0x8eac('0xc')](),controller[_0x8eac('0x14')]);router[_0x8eac('0xa')](_0x8eac('0x15'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0x8eac('0xa')](_0x8eac('0x16'),auth['isAuthenticated'](),controller['download']);router[_0x8eac('0x17')]('/',auth[_0x8eac('0xc')](),controller['create']);router[_0x8eac('0x17')](_0x8eac('0x18'),auth[_0x8eac('0xc')](),controller[_0x8eac('0x19')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1b8786,_0x5ae9e2,_0x3cb9bf){_0x3cb9bf(null,path['join'](config[_0x8eac('0x1a')],'server/files/attachments/'));},'filename':function(_0x3dc412,_0x3ceb84,_0x5cf6f6){_0x5cf6f6(null,util[_0x8eac('0x1b')](_0x8eac('0x1c'),Date['now'](),_0x3ceb84[_0x8eac('0x1d')][_0x8eac('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8eac('0x17')](_0x8eac('0x1f'),upload['single'](_0x8eac('0x20')),controller[_0x8eac('0x21')]);router[_0x8eac('0x17')](_0x8eac('0x13'),auth[_0x8eac('0xf')](),controller['addMessage']);router[_0x8eac('0x17')](_0x8eac('0x22'),auth['isAuthenticated'](),interaction['tracked'](_0x8eac('0x23'),_0x8eac('0x24')),controller[_0x8eac('0x25')]);router[_0x8eac('0x26')](_0x8eac('0xe'),auth[_0x8eac('0xc')](),interaction['tracked']('chat','chatinteraction:update'),controller[_0x8eac('0x27')]);router['put'](_0x8eac('0x28'),controller['customUpdate']);router[_0x8eac('0x26')](_0x8eac('0x29'),auth[_0x8eac('0xf')](),controller[_0x8eac('0x2a')]);router[_0x8eac('0x26')](_0x8eac('0x2b'),controller[_0x8eac('0x2c')]);router[_0x8eac('0x2d')](_0x8eac('0xe'),auth[_0x8eac('0xc')](),interaction[_0x8eac('0x2e')](_0x8eac('0x23'),_0x8eac('0x2f')),controller[_0x8eac('0x30')]);router['delete'](_0x8eac('0x22'),auth[_0x8eac('0xc')](),controller['removeTags']);module[_0x8eac('0x31')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index c795ec6..2741a84 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 _0x5fbc=['exports','TEXT','medium','INTEGER'];(function(_0x933c87,_0x339eaf){var _0x108807=function(_0x4d72dd){while(--_0x4d72dd){_0x933c87['push'](_0x933c87['shift']());}};_0x108807(++_0x339eaf);}(_0x5fbc,0x6c));var _0xc5fb=function(_0x44c36d,_0x128397){_0x44c36d=_0x44c36d-0x0;var _0x2a7242=_0x5fbc[_0x44c36d];return _0x2a7242;};'use strict';var Sequelize=require('sequelize');module[_0xc5fb('0x0')]={'body':{'type':Sequelize[_0xc5fb('0x1')](_0xc5fb('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xc5fb('0x3')]}}; \ No newline at end of file +var _0x1075=['INTEGER','sequelize','exports','BOOLEAN'];(function(_0x11aede,_0xfca58a){var _0x3c08e8=function(_0x571efc){while(--_0x571efc){_0x11aede['push'](_0x11aede['shift']());}};_0x3c08e8(++_0xfca58a);}(_0x1075,0x151));var _0x5107=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x1075[_0x2261ce];return _0x524640;};'use strict';var Sequelize=require(_0x5107('0x0'));module[_0x5107('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x5107('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x5107('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 35c61e1..7ff7a02 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 _0x329c=['lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Agents','autoAssociation','isEmpty','filter','resourceId','push','ToId','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','offset','undefined','count','set','apply','reject','save','update','destroy','then','stack','name','send','index','ChatInternalMessage','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','get','messages'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x329c,0x94));var _0xc329=function(_0x1488cd,_0x25a893){_0x1488cd=_0x1488cd-0x0;var _0x63fa13=_0x329c[_0x1488cd];return _0x63fa13;};'use strict';var emlformat=require(_0xc329('0x0'));var rimraf=require(_0xc329('0x1'));var zipdir=require(_0xc329('0x2'));var jsonpatch=require(_0xc329('0x3'));var rp=require(_0xc329('0x4'));var moment=require(_0xc329('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc329('0x6'));var util=require(_0xc329('0x7'));var path=require(_0xc329('0x8'));var sox=require(_0xc329('0x9'));var csv=require(_0xc329('0xa'));var ejs=require(_0xc329('0xb'));var fs=require('fs');var fs_extra=require(_0xc329('0xc'));var _=require('lodash');var squel=require(_0xc329('0xd'));var crypto=require(_0xc329('0xe'));var jsforce=require(_0xc329('0xf'));var deskjs=require(_0xc329('0x10'));var toCsv=require(_0xc329('0xa'));var querystring=require(_0xc329('0x11'));var Papa=require(_0xc329('0x12'));var Redis=require(_0xc329('0x13'));var authService=require(_0xc329('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xc329('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc329('0x16'))(_0xc329('0x17'));var utils=require(_0xc329('0x18'));var config=require(_0xc329('0x19'));var licenseUtil=require(_0xc329('0x1a'));var db=require(_0xc329('0x1b'))['db'];config['redis']=_[_0xc329('0x1c')](config[_0xc329('0x1d')],{'host':_0xc329('0x1e'),'port':0x18eb});var socket=require(_0xc329('0x1f'))(new Redis(config['redis']));require(_0xc329('0x20'))[_0xc329('0x21')](socket);function respondWithStatusCode(_0x340361,_0xf98836){_0xf98836=_0xf98836||0xcc;return function(_0x265ce2){if(_0x265ce2){return _0x340361[_0xc329('0x22')](_0xf98836);}return _0x340361[_0xc329('0x23')](_0xf98836)['end']();};}function respondWithResult(_0x5007e7,_0x42dc94){_0x42dc94=_0x42dc94||0xc8;return function(_0x262c21){if(_0x262c21){return _0x5007e7['status'](_0x42dc94)[_0xc329('0x24')](_0x262c21);}};}function respondWithFilteredResult(_0x571949,_0x2a9e2e){return function(_0x5de765){if(_0x5de765){var _0x596ef8=typeof _0x2a9e2e[_0xc329('0x25')]===_0xc329('0x26')&&typeof _0x2a9e2e['limit']===_0xc329('0x26');var _0x2d6cdc=_0x5de765['count'];var _0x5babd5=_0x596ef8?0x0:_0x2a9e2e[_0xc329('0x25')];var _0x1fb331=_0x596ef8?_0x5de765[_0xc329('0x27')]:_0x2a9e2e[_0xc329('0x25')]+_0x2a9e2e['limit'];var _0x29d4d4;if(_0x1fb331>=_0x2d6cdc){_0x1fb331=_0x2d6cdc;_0x29d4d4=0xc8;}else{_0x29d4d4=0xce;}_0x571949[_0xc329('0x23')](_0x29d4d4);return _0x571949[_0xc329('0x28')]('Content-Range',_0x5babd5+'-'+_0x1fb331+'/'+_0x2d6cdc)[_0xc329('0x24')](_0x5de765);}return null;};}function patchUpdates(_0x513212){return function(_0x1524e4){try{jsonpatch[_0xc329('0x29')](_0x1524e4,_0x513212,!![]);}catch(_0x37e5aa){return BPromise[_0xc329('0x2a')](_0x37e5aa);}return _0x1524e4[_0xc329('0x2b')]();};}function saveUpdates(_0x40de67,_0x2c206e){return function(_0x3675cb){if(_0x3675cb){return _0x3675cb[_0xc329('0x2c')](_0x40de67)['then'](function(_0x2e8a18){return _0x2e8a18;});}return null;};}function removeEntity(_0x292c11,_0x2c4748){return function(_0x39ed1c){if(_0x39ed1c){return _0x39ed1c[_0xc329('0x2d')]()[_0xc329('0x2e')](function(){_0x292c11[_0xc329('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c0ad5,_0x3d3a76){return function(_0x395039){if(!_0x395039){_0x2c0ad5[_0xc329('0x22')](0x194);}return _0x395039;};}function handleError(_0x4d5314,_0x2672b9){_0x2672b9=_0x2672b9||0x1f4;return function(_0x3712d4){logger['error'](_0x3712d4[_0xc329('0x2f')]);if(_0x3712d4[_0xc329('0x30')]){delete _0x3712d4[_0xc329('0x30')];}_0x4d5314[_0xc329('0x23')](_0x2672b9)[_0xc329('0x31')](_0x3712d4);};}exports[_0xc329('0x32')]=function(_0x2ea22d,_0x3fbe95){var _0x4c75be={},_0x50860c={},_0x6956a4={'count':0x0,'rows':[]};var _0x1886f9=_['map'](db[_0xc329('0x33')][_0xc329('0x34')],function(_0x523fad){return{'name':_0x523fad[_0xc329('0x35')],'type':_0x523fad[_0xc329('0x36')][_0xc329('0x37')]};});_0x50860c['model']=_[_0xc329('0x38')](_0x1886f9,'name');_0x50860c[_0xc329('0x39')]=_[_0xc329('0x3a')](_0x2ea22d['query']);_0x50860c[_0xc329('0x3b')]=_[_0xc329('0x3c')](_0x50860c[_0xc329('0x3d')],_0x50860c[_0xc329('0x39')]);_0x4c75be[_0xc329('0x3e')]=_[_0xc329('0x3c')](_0x50860c[_0xc329('0x3d')],qs[_0xc329('0x3f')](_0x2ea22d[_0xc329('0x39')][_0xc329('0x3f')]));_0x4c75be[_0xc329('0x3e')]=_0x4c75be['attributes'][_0xc329('0x40')]?_0x4c75be[_0xc329('0x3e')]:_0x50860c[_0xc329('0x3d')];if(!_0x2ea22d[_0xc329('0x39')][_0xc329('0x41')](_0xc329('0x42'))){_0x4c75be[_0xc329('0x43')]=qs[_0xc329('0x43')](_0x2ea22d[_0xc329('0x39')][_0xc329('0x43')]);_0x4c75be['offset']=qs[_0xc329('0x25')](_0x2ea22d['query']['offset']);}_0x4c75be[_0xc329('0x44')]=qs[_0xc329('0x45')](_0x2ea22d['query']['sort']);_0x4c75be[_0xc329('0x46')]=qs[_0xc329('0x3b')](_[_0xc329('0x47')](_0x2ea22d[_0xc329('0x39')],_0x50860c[_0xc329('0x3b')]),_0x1886f9);if(_0x2ea22d[_0xc329('0x39')]['filter']){_0x4c75be[_0xc329('0x46')]=_[_0xc329('0x48')](_0x4c75be[_0xc329('0x46')],{'$or':_[_0xc329('0x38')](_0x1886f9,function(_0x52ab07){if(_0x52ab07[_0xc329('0x36')]!==_0xc329('0x49')){var _0x4ae6a4={};_0x4ae6a4[_0x52ab07['name']]={'$like':'%'+_0x2ea22d[_0xc329('0x39')]['filter']+'%'};return _0x4ae6a4;}})});}_0x4c75be=_[_0xc329('0x48')]({},_0x4c75be,_0x2ea22d[_0xc329('0x4a')]);var _0x32c9ff={'where':_0x4c75be[_0xc329('0x46')]};return db[_0xc329('0x33')][_0xc329('0x27')](_0x32c9ff)[_0xc329('0x2e')](function(_0xc75145){_0x6956a4[_0xc329('0x27')]=_0xc75145;if(_0x2ea22d[_0xc329('0x39')][_0xc329('0x4b')]){_0x4c75be[_0xc329('0x4c')]=[{'all':!![]}];}return db[_0xc329('0x33')][_0xc329('0x4d')](_0x4c75be);})[_0xc329('0x2e')](function(_0x12756f){_0x6956a4[_0xc329('0x4e')]=_0x12756f;return _0x6956a4;})['then'](respondWithFilteredResult(_0x3fbe95,_0x4c75be))[_0xc329('0x4f')](handleError(_0x3fbe95,null));};exports[_0xc329('0x50')]=function(_0x364eea,_0xfb9f8e){var _0x17afd9={'raw':!![],'where':{'id':_0x364eea[_0xc329('0x51')]['id']}},_0x59246b={};_0x59246b[_0xc329('0x3d')]=_[_0xc329('0x3a')](db[_0xc329('0x33')][_0xc329('0x34')]);_0x59246b[_0xc329('0x39')]=_['keys'](_0x364eea[_0xc329('0x39')]);_0x59246b['filters']=_[_0xc329('0x3c')](_0x59246b[_0xc329('0x3d')],_0x59246b[_0xc329('0x39')]);_0x17afd9[_0xc329('0x3e')]=_[_0xc329('0x3c')](_0x59246b['model'],qs[_0xc329('0x3f')](_0x364eea[_0xc329('0x39')]['fields']));_0x17afd9[_0xc329('0x3e')]=_0x17afd9[_0xc329('0x3e')][_0xc329('0x40')]?_0x17afd9[_0xc329('0x3e')]:_0x59246b['model'];if(_0x364eea['query'][_0xc329('0x4b')]){_0x17afd9['include']=[{'all':!![]}];}_0x17afd9=_[_0xc329('0x48')]({},_0x17afd9,_0x364eea[_0xc329('0x4a')]);return db[_0xc329('0x33')]['find'](_0x17afd9)[_0xc329('0x2e')](handleEntityNotFound(_0xfb9f8e,null))['then'](respondWithResult(_0xfb9f8e,null))[_0xc329('0x4f')](handleError(_0xfb9f8e,null));};exports[_0xc329('0x52')]=function(_0x117ca1,_0xd2daf4){return db['ChatInternalMessage'][_0xc329('0x52')](_0x117ca1[_0xc329('0x53')],{})['then'](respondWithResult(_0xd2daf4,0xc9))[_0xc329('0x4f')](handleError(_0xd2daf4,null));};exports[_0xc329('0x2c')]=function(_0xd54e9c,_0x2d3b0e){if(_0xd54e9c[_0xc329('0x53')]['id']){delete _0xd54e9c[_0xc329('0x53')]['id'];}return db[_0xc329('0x33')][_0xc329('0x54')]({'where':{'id':_0xd54e9c[_0xc329('0x51')]['id']}})[_0xc329('0x2e')](handleEntityNotFound(_0x2d3b0e,null))[_0xc329('0x2e')](saveUpdates(_0xd54e9c[_0xc329('0x53')],null))[_0xc329('0x2e')](respondWithResult(_0x2d3b0e,null))[_0xc329('0x4f')](handleError(_0x2d3b0e,null));};exports[_0xc329('0x2d')]=function(_0x1f87d8,_0x49abb7){return db[_0xc329('0x33')][_0xc329('0x54')]({'where':{'id':_0x1f87d8[_0xc329('0x51')]['id']}})['then'](handleEntityNotFound(_0x49abb7,null))['then'](removeEntity(_0x49abb7,null))[_0xc329('0x4f')](handleError(_0x49abb7,null));};exports[_0xc329('0x55')]=function(_0x11a9e1,_0x90f19f){return db['ChatInternalMessage']['describe']()[_0xc329('0x2e')](respondWithResult(_0x90f19f,null))[_0xc329('0x4f')](handleError(_0x90f19f,null));};function wrapUser(_0x55bf6a){return function(_0x3639a3){var _0x3fd1b9=_0x55bf6a[_0xc329('0x56')]({'plain':!![]});_0x3fd1b9[_0xc329('0x57')]=[];if(_0x3639a3){_0x3fd1b9[_0xc329('0x58')]=_0x3639a3[_0xc329('0x59')];_0x3fd1b9[_0xc329('0x5a')]=_0x3639a3;}else{_0x3fd1b9['lastMessageAt']=moment(0x0)[_0xc329('0x5b')](_0xc329('0x5c'));_0x3fd1b9[_0xc329('0x5a')]={};}return _0x3fd1b9;};}exports[_0xc329('0x5d')]=function(_0x362a6f,_0x4836ff,_0x59469a){var _0x27bf83=[];return db[_0xc329('0x5e')]['findAll']({'where':{'role':[_0xc329('0x5f'),'admin','user']},'attributes':['id','fullname',_0xc329('0x30'),'role',_0xc329('0x60'),_0xc329('0x61'),_0xc329('0x62'),_0xc329('0x63'),_0xc329('0x64'),_0xc329('0x65')],'order':qs[_0xc329('0x45')](_0xc329('0x66')),'include':[{'model':db[_0xc329('0x67')],'as':_0xc329('0x68'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})['then'](function(_0x293c88){if(_0x293c88){var _0x7950b4=_0x362a6f['user'][_0xc329('0x56')]({'plain':!![]});if(!_0x7950b4)throw new Error(_0xc329('0x69'));if(_0x7950b4[_0xc329('0x6a')]===_0xc329('0x6b')){return db[_0xc329('0x6c')][_0xc329('0x54')]({'where':{'name':_0xc329('0x6d'),'userProfileId':_0x7950b4['userProfileId']},'raw':!![]})[_0xc329('0x2e')](function(_0x4ccc32){if(_0x4ccc32){if(_0x4ccc32[_0xc329('0x6e')]===0x0){return db['UserProfileResource'][_0xc329('0x4d')]({'where':{'sectionId':_0x4ccc32['id']},'raw':!![]})[_0xc329('0x2e')](function(_0x45c84b){var _0x1b42e6=[];if(_[_0xc329('0x6f')](_0x45c84b)){_0x1b42e6=_[_0xc329('0x70')](_0x293c88,function(_0x36e993){if(_0x36e993['role']!==_0xc329('0x5f')){return _0x36e993;}});return _0x1b42e6;}else{for(var _0x14149e=0x0;_0x14149e<_0x293c88[_0xc329('0x40')];_0x14149e++){var _0x55558e=_0x293c88[_0x14149e];if(_0x55558e[_0xc329('0x6a')]==='agent'){var _0x2bcc50=_[_0xc329('0x54')](_0x45c84b,function(_0x3da61d){return _0x3da61d[_0xc329('0x71')]===_0x55558e['id'];});if(_0x2bcc50)_0x1b42e6[_0xc329('0x72')](_0x55558e);}else{_0x1b42e6[_0xc329('0x72')](_0x55558e);}}return _0x1b42e6;}});}else{return _0x293c88;}}else{var _0x36e1c5=_['filter'](_0x293c88,function(_0x377f4f){if(_0x377f4f[_0xc329('0x6a')]!==_0xc329('0x5f')){return _0x377f4f;}});return _0x36e1c5;}});}else{return _0x293c88;}}})[_0xc329('0x2e')](function(_0x1eb743){var _0x15c73e=[];if(_0x1eb743){_0x27bf83=_0x1eb743;for(var _0xc0a27e=0x0;_0xc0a27e<_0x1eb743[_0xc329('0x40')];_0xc0a27e+=0x1){_0x27bf83[_0xc0a27e]['messages']=[];_0x15c73e[_0xc329('0x72')](db[_0xc329('0x33')]['find']({'where':{'FromId':[_0x362a6f[_0xc329('0x6b')]['id'],_0x1eb743[_0xc0a27e]['id']],'ToId':[_0x362a6f[_0xc329('0x6b')]['id'],_0x1eb743[_0xc0a27e]['id']],'ChatGroupId':null},'attributes':['id',_0xc329('0x59'),'FromId',_0xc329('0x73'),'read',_0xc329('0x53')],'order':qs[_0xc329('0x45')](_0xc329('0x74')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xc329('0x2e')](wrapUser(_0x1eb743[_0xc0a27e])));}return BPromise[_0xc329('0x75')](_0x15c73e);}return[];})[_0xc329('0x2e')](function(_0x3ee13c){return{'rows':_0x3ee13c,'count':_0x3ee13c['length']};})[_0xc329('0x2e')](respondWithResult(_0x4836ff,null))[_0xc329('0x4f')](handleError(_0x4836ff,null));}; \ No newline at end of file +var _0xef29=['findAll','rows','catch','params','keys','intersection','options','find','body','describe','get','messages','lastMessageAt','format','lastMessage','getUsers','User','agent','admin','fullname','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','filter','resourceId','push','createdAt','FromId','-createdAt','all','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','send','map','rawAttributes','fieldName','type','key','name','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','ChatInternalMessage','includeAll','include'];(function(_0xa1e476,_0x3ad068){var _0x2bb454=function(_0x2b8865){while(--_0x2b8865){_0xa1e476['push'](_0xa1e476['shift']());}};_0x2bb454(++_0x3ad068);}(_0xef29,0x10b));var _0x9ef2=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xef29[_0x27af45];return _0x18df21;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9ef2('0x0'));var zipdir=require(_0x9ef2('0x1'));var jsonpatch=require(_0x9ef2('0x2'));var rp=require(_0x9ef2('0x3'));var moment=require('moment');var BPromise=require(_0x9ef2('0x4'));var Mustache=require(_0x9ef2('0x5'));var util=require(_0x9ef2('0x6'));var path=require(_0x9ef2('0x7'));var sox=require(_0x9ef2('0x8'));var csv=require(_0x9ef2('0x9'));var ejs=require(_0x9ef2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9ef2('0xb'));var crypto=require(_0x9ef2('0xc'));var jsforce=require(_0x9ef2('0xd'));var deskjs=require(_0x9ef2('0xe'));var toCsv=require(_0x9ef2('0x9'));var querystring=require(_0x9ef2('0xf'));var Papa=require(_0x9ef2('0x10'));var Redis=require(_0x9ef2('0x11'));var authService=require(_0x9ef2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x9ef2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9ef2('0x14'))(_0x9ef2('0x15'));var utils=require(_0x9ef2('0x16'));var config=require(_0x9ef2('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x9ef2('0x18')]=_[_0x9ef2('0x19')](config[_0x9ef2('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x9ef2('0x1a'))(new Redis(config[_0x9ef2('0x18')]));require(_0x9ef2('0x1b'))[_0x9ef2('0x1c')](socket);function respondWithStatusCode(_0x1517cc,_0x5c2f34){_0x5c2f34=_0x5c2f34||0xcc;return function(_0x1bdb2d){if(_0x1bdb2d){return _0x1517cc[_0x9ef2('0x1d')](_0x5c2f34);}return _0x1517cc[_0x9ef2('0x1e')](_0x5c2f34)[_0x9ef2('0x1f')]();};}function respondWithResult(_0x15fcf0,_0x9adba1){_0x9adba1=_0x9adba1||0xc8;return function(_0x2b6b98){if(_0x2b6b98){return _0x15fcf0['status'](_0x9adba1)[_0x9ef2('0x20')](_0x2b6b98);}};}function respondWithFilteredResult(_0xd2e79d,_0x418aac){return function(_0xaa7c3e){if(_0xaa7c3e){var _0x5af150=typeof _0x418aac[_0x9ef2('0x21')]===_0x9ef2('0x22')&&typeof _0x418aac['limit']===_0x9ef2('0x22');var _0x3a994a=_0xaa7c3e[_0x9ef2('0x23')];var _0x5ca0be=_0x5af150?0x0:_0x418aac[_0x9ef2('0x21')];var _0x41954e=_0x5af150?_0xaa7c3e[_0x9ef2('0x23')]:_0x418aac['offset']+_0x418aac[_0x9ef2('0x24')];var _0x21f8bf;if(_0x41954e>=_0x3a994a){_0x41954e=_0x3a994a;_0x21f8bf=0xc8;}else{_0x21f8bf=0xce;}_0xd2e79d[_0x9ef2('0x1e')](_0x21f8bf);return _0xd2e79d[_0x9ef2('0x25')](_0x9ef2('0x26'),_0x5ca0be+'-'+_0x41954e+'/'+_0x3a994a)['json'](_0xaa7c3e);}return null;};}function patchUpdates(_0x5c731b){return function(_0x2d9625){try{jsonpatch[_0x9ef2('0x27')](_0x2d9625,_0x5c731b,!![]);}catch(_0x5f0a2c){return BPromise[_0x9ef2('0x28')](_0x5f0a2c);}return _0x2d9625['save']();};}function saveUpdates(_0x237685,_0x14623c){return function(_0x2c9bc3){if(_0x2c9bc3){return _0x2c9bc3[_0x9ef2('0x29')](_0x237685)[_0x9ef2('0x2a')](function(_0x3a70db){return _0x3a70db;});}return null;};}function removeEntity(_0x75e1a5,_0x2381a7){return function(_0x5e9c46){if(_0x5e9c46){return _0x5e9c46[_0x9ef2('0x2b')]()[_0x9ef2('0x2a')](function(){_0x75e1a5[_0x9ef2('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1751aa,_0x158f46){return function(_0x148123){if(!_0x148123){_0x1751aa['sendStatus'](0x194);}return _0x148123;};}function handleError(_0x300548,_0x35f2e6){_0x35f2e6=_0x35f2e6||0x1f4;return function(_0x1b9378){logger[_0x9ef2('0x2c')](_0x1b9378[_0x9ef2('0x2d')]);if(_0x1b9378['name']){delete _0x1b9378['name'];}_0x300548[_0x9ef2('0x1e')](_0x35f2e6)[_0x9ef2('0x2e')](_0x1b9378);};}exports['index']=function(_0xf0e1af,_0x39b89a){var _0x138df1={},_0x1a865d={},_0x35351f={'count':0x0,'rows':[]};var _0x6d3109=_[_0x9ef2('0x2f')](db['ChatInternalMessage'][_0x9ef2('0x30')],function(_0x50630b){return{'name':_0x50630b[_0x9ef2('0x31')],'type':_0x50630b[_0x9ef2('0x32')][_0x9ef2('0x33')]};});_0x1a865d['model']=_[_0x9ef2('0x2f')](_0x6d3109,_0x9ef2('0x34'));_0x1a865d['query']=_['keys'](_0xf0e1af[_0x9ef2('0x35')]);_0x1a865d[_0x9ef2('0x36')]=_['intersection'](_0x1a865d[_0x9ef2('0x37')],_0x1a865d['query']);_0x138df1[_0x9ef2('0x38')]=_['intersection'](_0x1a865d[_0x9ef2('0x37')],qs['fields'](_0xf0e1af[_0x9ef2('0x35')][_0x9ef2('0x39')]));_0x138df1[_0x9ef2('0x38')]=_0x138df1[_0x9ef2('0x38')][_0x9ef2('0x3a')]?_0x138df1[_0x9ef2('0x38')]:_0x1a865d[_0x9ef2('0x37')];if(!_0xf0e1af['query'][_0x9ef2('0x3b')](_0x9ef2('0x3c'))){_0x138df1['limit']=qs[_0x9ef2('0x24')](_0xf0e1af[_0x9ef2('0x35')][_0x9ef2('0x24')]);_0x138df1[_0x9ef2('0x21')]=qs[_0x9ef2('0x21')](_0xf0e1af['query'][_0x9ef2('0x21')]);}_0x138df1[_0x9ef2('0x3d')]=qs[_0x9ef2('0x3e')](_0xf0e1af[_0x9ef2('0x35')][_0x9ef2('0x3e')]);_0x138df1['where']=qs[_0x9ef2('0x36')](_[_0x9ef2('0x3f')](_0xf0e1af[_0x9ef2('0x35')],_0x1a865d[_0x9ef2('0x36')]),_0x6d3109);if(_0xf0e1af['query']['filter']){_0x138df1[_0x9ef2('0x40')]=_['merge'](_0x138df1[_0x9ef2('0x40')],{'$or':_['map'](_0x6d3109,function(_0x3d099a){if(_0x3d099a[_0x9ef2('0x32')]!=='VIRTUAL'){var _0x2372fe={};_0x2372fe[_0x3d099a[_0x9ef2('0x34')]]={'$like':'%'+_0xf0e1af[_0x9ef2('0x35')]['filter']+'%'};return _0x2372fe;}})});}_0x138df1=_[_0x9ef2('0x41')]({},_0x138df1,_0xf0e1af['options']);var _0x5c5455={'where':_0x138df1[_0x9ef2('0x40')]};return db[_0x9ef2('0x42')][_0x9ef2('0x23')](_0x5c5455)['then'](function(_0x1f43f9){_0x35351f[_0x9ef2('0x23')]=_0x1f43f9;if(_0xf0e1af[_0x9ef2('0x35')][_0x9ef2('0x43')]){_0x138df1[_0x9ef2('0x44')]=[{'all':!![]}];}return db[_0x9ef2('0x42')][_0x9ef2('0x45')](_0x138df1);})[_0x9ef2('0x2a')](function(_0x32b55b){_0x35351f[_0x9ef2('0x46')]=_0x32b55b;return _0x35351f;})[_0x9ef2('0x2a')](respondWithFilteredResult(_0x39b89a,_0x138df1))[_0x9ef2('0x47')](handleError(_0x39b89a,null));};exports['show']=function(_0x4d0f9c,_0x55ca80){var _0x29b76e={'raw':!![],'where':{'id':_0x4d0f9c[_0x9ef2('0x48')]['id']}},_0x11d24f={};_0x11d24f['model']=_[_0x9ef2('0x49')](db['ChatInternalMessage'][_0x9ef2('0x30')]);_0x11d24f[_0x9ef2('0x35')]=_[_0x9ef2('0x49')](_0x4d0f9c[_0x9ef2('0x35')]);_0x11d24f['filters']=_['intersection'](_0x11d24f[_0x9ef2('0x37')],_0x11d24f[_0x9ef2('0x35')]);_0x29b76e[_0x9ef2('0x38')]=_[_0x9ef2('0x4a')](_0x11d24f['model'],qs['fields'](_0x4d0f9c[_0x9ef2('0x35')][_0x9ef2('0x39')]));_0x29b76e[_0x9ef2('0x38')]=_0x29b76e[_0x9ef2('0x38')][_0x9ef2('0x3a')]?_0x29b76e[_0x9ef2('0x38')]:_0x11d24f[_0x9ef2('0x37')];if(_0x4d0f9c['query'][_0x9ef2('0x43')]){_0x29b76e[_0x9ef2('0x44')]=[{'all':!![]}];}_0x29b76e=_[_0x9ef2('0x41')]({},_0x29b76e,_0x4d0f9c[_0x9ef2('0x4b')]);return db[_0x9ef2('0x42')][_0x9ef2('0x4c')](_0x29b76e)[_0x9ef2('0x2a')](handleEntityNotFound(_0x55ca80,null))[_0x9ef2('0x2a')](respondWithResult(_0x55ca80,null))[_0x9ef2('0x47')](handleError(_0x55ca80,null));};exports['create']=function(_0xe2c9da,_0x37ca91){return db[_0x9ef2('0x42')]['create'](_0xe2c9da[_0x9ef2('0x4d')],{})[_0x9ef2('0x2a')](respondWithResult(_0x37ca91,0xc9))[_0x9ef2('0x47')](handleError(_0x37ca91,null));};exports[_0x9ef2('0x29')]=function(_0x3da567,_0x41f570){if(_0x3da567[_0x9ef2('0x4d')]['id']){delete _0x3da567[_0x9ef2('0x4d')]['id'];}return db[_0x9ef2('0x42')]['find']({'where':{'id':_0x3da567[_0x9ef2('0x48')]['id']}})[_0x9ef2('0x2a')](handleEntityNotFound(_0x41f570,null))[_0x9ef2('0x2a')](saveUpdates(_0x3da567['body'],null))[_0x9ef2('0x2a')](respondWithResult(_0x41f570,null))['catch'](handleError(_0x41f570,null));};exports[_0x9ef2('0x2b')]=function(_0x4c10a0,_0x1c175d){return db['ChatInternalMessage'][_0x9ef2('0x4c')]({'where':{'id':_0x4c10a0[_0x9ef2('0x48')]['id']}})[_0x9ef2('0x2a')](handleEntityNotFound(_0x1c175d,null))['then'](removeEntity(_0x1c175d,null))['catch'](handleError(_0x1c175d,null));};exports[_0x9ef2('0x4e')]=function(_0x59a906,_0x4bd599){return db['ChatInternalMessage'][_0x9ef2('0x4e')]()['then'](respondWithResult(_0x4bd599,null))['catch'](handleError(_0x4bd599,null));};function wrapUser(_0x35821f){return function(_0x5359a2){var _0x3c248e=_0x35821f[_0x9ef2('0x4f')]({'plain':!![]});_0x3c248e[_0x9ef2('0x50')]=[];if(_0x5359a2){_0x3c248e[_0x9ef2('0x51')]=_0x5359a2['createdAt'];_0x3c248e['lastMessage']=_0x5359a2;}else{_0x3c248e[_0x9ef2('0x51')]=moment(0x0)[_0x9ef2('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x3c248e[_0x9ef2('0x53')]={};}return _0x3c248e;};}exports[_0x9ef2('0x54')]=function(_0x43328f,_0x519230,_0x551813){var _0x118fe8=[];return db[_0x9ef2('0x55')][_0x9ef2('0x45')]({'where':{'role':[_0x9ef2('0x56'),_0x9ef2('0x57'),'user']},'attributes':['id',_0x9ef2('0x58'),_0x9ef2('0x34'),'role','userpic',_0x9ef2('0x59'),_0x9ef2('0x5a'),_0x9ef2('0x5b'),_0x9ef2('0x5c'),_0x9ef2('0x5d')],'order':qs['sort'](_0x9ef2('0x5e')),'include':[{'model':db[_0x9ef2('0x5f')],'as':_0x9ef2('0x60'),'attributes':['id',_0x9ef2('0x34'),_0x9ef2('0x32')],'through':{'attributes':[]}}]})[_0x9ef2('0x2a')](function(_0xf57fc3){if(_0xf57fc3){var _0xe06194=_0x43328f[_0x9ef2('0x61')][_0x9ef2('0x4f')]({'plain':!![]});if(!_0xe06194)throw new Error(_0x9ef2('0x62'));if(_0xe06194[_0x9ef2('0x63')]===_0x9ef2('0x61')){return db[_0x9ef2('0x64')][_0x9ef2('0x4c')]({'where':{'name':'Agents','userProfileId':_0xe06194[_0x9ef2('0x65')]},'raw':!![]})['then'](function(_0x216e41){if(_0x216e41){if(_0x216e41[_0x9ef2('0x66')]===0x0){return db[_0x9ef2('0x67')][_0x9ef2('0x45')]({'where':{'sectionId':_0x216e41['id']},'raw':!![]})[_0x9ef2('0x2a')](function(_0x5787a7){var _0x45199a=[];if(_[_0x9ef2('0x68')](_0x5787a7)){_0x45199a=_[_0x9ef2('0x69')](_0xf57fc3,function(_0x456e66){if(_0x456e66[_0x9ef2('0x63')]!==_0x9ef2('0x56')){return _0x456e66;}});return _0x45199a;}else{for(var _0x45f339=0x0;_0x45f339<_0xf57fc3[_0x9ef2('0x3a')];_0x45f339++){var _0x17c51a=_0xf57fc3[_0x45f339];if(_0x17c51a[_0x9ef2('0x63')]===_0x9ef2('0x56')){var _0x1a7d8a=_[_0x9ef2('0x4c')](_0x5787a7,function(_0x2953c6){return _0x2953c6[_0x9ef2('0x6a')]===_0x17c51a['id'];});if(_0x1a7d8a)_0x45199a[_0x9ef2('0x6b')](_0x17c51a);}else{_0x45199a[_0x9ef2('0x6b')](_0x17c51a);}}return _0x45199a;}});}else{return _0xf57fc3;}}else{var _0x4efee3=_['filter'](_0xf57fc3,function(_0x42377c){if(_0x42377c['role']!==_0x9ef2('0x56')){return _0x42377c;}});return _0x4efee3;}});}else{return _0xf57fc3;}}})['then'](function(_0x494d05){var _0x313f13=[];if(_0x494d05){_0x118fe8=_0x494d05;for(var _0x2ce9bc=0x0;_0x2ce9bc<_0x494d05[_0x9ef2('0x3a')];_0x2ce9bc+=0x1){_0x118fe8[_0x2ce9bc]['messages']=[];_0x313f13[_0x9ef2('0x6b')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x43328f[_0x9ef2('0x61')]['id'],_0x494d05[_0x2ce9bc]['id']],'ToId':[_0x43328f['user']['id'],_0x494d05[_0x2ce9bc]['id']],'ChatGroupId':null},'attributes':['id',_0x9ef2('0x6c'),_0x9ef2('0x6d'),'ToId','read',_0x9ef2('0x4d')],'order':qs[_0x9ef2('0x3e')](_0x9ef2('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x9ef2('0x2a')](wrapUser(_0x494d05[_0x2ce9bc])));}return BPromise[_0x9ef2('0x6f')](_0x313f13);}return[];})['then'](function(_0x15ff1f){return{'rows':_0x15ff1f,'count':_0x15ff1f['length']};})['then'](respondWithResult(_0x519230,null))[_0x9ef2('0x47')](handleError(_0x519230,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index b691182..c34c78d 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 _0x08f1=['ChatInternalMessage','save','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x27530d,_0x46480a){var _0x59e561=function(_0x395fe9){while(--_0x395fe9){_0x27530d['push'](_0x27530d['shift']());}};_0x59e561(++_0x46480a);}(_0x08f1,0xd8));var _0x108f=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x08f1[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x108f('0x0'))['db'][_0x108f('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x108f('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1f8e08){return function(_0x5d3c09,_0x109bb7,_0xb13269){ChatInternalMessageEvents['emit'](_0x1f8e08+':'+_0x5d3c09['id'],_0x5d3c09);ChatInternalMessageEvents[_0x108f('0x3')](_0x1f8e08,_0x5d3c09);_0xb13269(null);};}for(var e in events){if(events[_0x108f('0x4')](e)){var event=events[e];ChatInternalMessage[_0x108f('0x5')](e,emitEvent(event));}}module[_0x108f('0x6')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x2243=['update','remove','emit','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2243,0x13b));var _0x3224=function(_0x44abf6,_0x545f56){_0x44abf6=_0x44abf6-0x0;var _0x17c73b=_0x2243[_0x44abf6];return _0x17c73b;};'use strict';var EventEmitter=require(_0x3224('0x0'));var ChatInternalMessage=require(_0x3224('0x1'))['db'][_0x3224('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x3224('0x3')](0x0);var events={'afterCreate':_0x3224('0x4'),'afterUpdate':_0x3224('0x5'),'afterDestroy':_0x3224('0x6')};function emitEvent(_0x6307a7){return function(_0x3f29b2,_0x3521ae,_0x30f2c2){ChatInternalMessageEvents[_0x3224('0x7')](_0x6307a7+':'+_0x3f29b2['id'],_0x3f29b2);ChatInternalMessageEvents[_0x3224('0x7')](_0x6307a7,_0x3f29b2);_0x30f2c2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x3224('0x8')](e,emitEvent(event));}}module[_0x3224('0x9')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index c715071..1648a82 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 _0x172c=['exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','../../config/environment'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x172c,0x172));var _0xc172=function(_0xb0de07,_0x3ca2a0){_0xb0de07=_0xb0de07-0x0;var _0x4633d8=_0x172c[_0xb0de07];return _0x4633d8;};'use strict';var _=require(_0xc172('0x0'));var util=require(_0xc172('0x1'));var logger=require(_0xc172('0x2'))(_0xc172('0x3'));var moment=require('moment');var BPromise=require(_0xc172('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc172('0x5'));var rimraf=require('rimraf');var config=require(_0xc172('0x6'));var attributes=require('./chatInternalMessage.attributes');module[_0xc172('0x7')]=function(_0x328680,_0x498731){return _0x328680[_0xc172('0x8')](_0xc172('0x9'),attributes,{'tableName':_0xc172('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc172('0xb'),'collate':_0xc172('0xc')});}; \ No newline at end of file +var _0xdd93=['path','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise'];(function(_0x17784a,_0x42fe44){var _0x41aded=function(_0x2e7319){while(--_0x2e7319){_0x17784a['push'](_0x17784a['shift']());}};_0x41aded(++_0x42fe44);}(_0xdd93,0x1be));var _0x3dd9=function(_0x221d0f,_0x37c51d){_0x221d0f=_0x221d0f-0x0;var _0x178f23=_0xdd93[_0x221d0f];return _0x178f23;};'use strict';var _=require('lodash');var util=require(_0x3dd9('0x0'));var logger=require(_0x3dd9('0x1'))(_0x3dd9('0x2'));var moment=require(_0x3dd9('0x3'));var BPromise=require('bluebird');var rp=require(_0x3dd9('0x4'));var fs=require('fs');var path=require(_0x3dd9('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3dd9('0x6'));module[_0x3dd9('0x7')]=function(_0x2141c6,_0x2e93f1){return _0x2141c6[_0x3dd9('0x8')]('ChatInternalMessage',attributes,{'tableName':_0x3dd9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3dd9('0xa')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index daf7a86..5892152 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 _0x87c3=['defaults','socket.io-emitter','./chatInternalMessage.socket','register','request','info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0x87c3,0x120));var _0x387c=function(_0xcbe6f1,_0x102de7){_0xcbe6f1=_0xcbe6f1-0x0;var _0xf556f3=_0x87c3[_0xcbe6f1];return _0xf556f3;};'use strict';var _=require(_0x387c('0x0'));var util=require(_0x387c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x387c('0x2'));var fs=require('fs');var Redis=require(_0x387c('0x3'));var db=require(_0x387c('0x4'))['db'];var utils=require(_0x387c('0x5'));var logger=require(_0x387c('0x6'))('rpc');var config=require(_0x387c('0x7'));var jayson=require(_0x387c('0x8'));var client=jayson[_0x387c('0x9')][_0x387c('0xa')]({'port':0x232a});config[_0x387c('0xb')]=_[_0x387c('0xc')](config[_0x387c('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x387c('0xd'))(new Redis(config[_0x387c('0xb')]));require(_0x387c('0xe'))[_0x387c('0xf')](socket);function respondWithRpcPromise(_0x3b2069,_0x316a63,_0x1cb216){return new BPromise(function(_0x1fdb04,_0x4e144a){return client[_0x387c('0x10')](_0x3b2069,_0x1cb216)['then'](function(_0x475ca8){logger[_0x387c('0x11')](_0x387c('0x12'),_0x316a63,'request\x20sent');logger['debug'](_0x387c('0x13'),_0x316a63,_0x387c('0x14'),JSON[_0x387c('0x15')](_0x475ca8));if(_0x475ca8['error']){if(_0x475ca8[_0x387c('0x16')]['code']===0x1f4){logger[_0x387c('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x316a63,_0x475ca8[_0x387c('0x16')][_0x387c('0x17')]);return _0x4e144a(_0x475ca8[_0x387c('0x16')][_0x387c('0x17')]);}logger[_0x387c('0x16')](_0x387c('0x12'),_0x316a63,_0x475ca8['error'][_0x387c('0x17')]);return _0x1fdb04(_0x475ca8[_0x387c('0x16')][_0x387c('0x17')]);}else{logger['info'](_0x387c('0x12'),_0x316a63,'request\x20sent');_0x1fdb04(_0x475ca8[_0x387c('0x18')][_0x387c('0x17')]);}})['catch'](function(_0x1a3d26){logger[_0x387c('0x16')](_0x387c('0x12'),_0x316a63,_0x1a3d26);_0x4e144a(_0x1a3d26);});});} \ No newline at end of file +var _0x2e8c=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x415260,_0x449c1c){var _0x407103=function(_0x5a4b32){while(--_0x5a4b32){_0x415260['push'](_0x415260['shift']());}};_0x407103(++_0x449c1c);}(_0x2e8c,0x119));var _0xc2e8=function(_0x3aeee9,_0x5aa444){_0x3aeee9=_0x3aeee9-0x0;var _0x2f06f8=_0x2e8c[_0x3aeee9];return _0x2f06f8;};'use strict';var _=require('lodash');var util=require(_0xc2e8('0x0'));var moment=require('moment');var BPromise=require(_0xc2e8('0x1'));var rs=require(_0xc2e8('0x2'));var fs=require('fs');var Redis=require(_0xc2e8('0x3'));var db=require(_0xc2e8('0x4'))['db'];var utils=require(_0xc2e8('0x5'));var logger=require(_0xc2e8('0x6'))(_0xc2e8('0x7'));var config=require(_0xc2e8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc2e8('0x9')][_0xc2e8('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xc2e8('0xb')],{'host':_0xc2e8('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc2e8('0xd'))['register'](socket);function respondWithRpcPromise(_0x25def9,_0x225453,_0x19299f){return new BPromise(function(_0x339057,_0x31f8da){return client[_0xc2e8('0xe')](_0x25def9,_0x19299f)[_0xc2e8('0xf')](function(_0x1504fb){logger[_0xc2e8('0x10')](_0xc2e8('0x11'),_0x225453,'request\x20sent');logger['debug'](_0xc2e8('0x12'),_0x225453,_0xc2e8('0x13'),JSON[_0xc2e8('0x14')](_0x1504fb));if(_0x1504fb[_0xc2e8('0x15')]){if(_0x1504fb[_0xc2e8('0x15')][_0xc2e8('0x16')]===0x1f4){logger[_0xc2e8('0x15')](_0xc2e8('0x11'),_0x225453,_0x1504fb[_0xc2e8('0x15')]['message']);return _0x31f8da(_0x1504fb[_0xc2e8('0x15')][_0xc2e8('0x17')]);}logger[_0xc2e8('0x15')](_0xc2e8('0x11'),_0x225453,_0x1504fb[_0xc2e8('0x15')][_0xc2e8('0x17')]);return _0x339057(_0x1504fb[_0xc2e8('0x15')][_0xc2e8('0x17')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x225453,_0xc2e8('0x13'));_0x339057(_0x1504fb[_0xc2e8('0x18')][_0xc2e8('0x17')]);}})[_0xc2e8('0x19')](function(_0xf37d9e){logger[_0xc2e8('0x15')](_0xc2e8('0x11'),_0x225453,_0xf37d9e);_0x31f8da(_0xf37d9e);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index a43cf78..b241ff8 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 _0xc075=['removeListener','register','chatInternalMessage:','save','remove','update'];(function(_0x4c4aa2,_0x2de77e){var _0x59a1e5=function(_0x5487c9){while(--_0x5487c9){_0x4c4aa2['push'](_0x4c4aa2['shift']());}};_0x59a1e5(++_0x2de77e);}(_0xc075,0x1b9));var _0x5c07=function(_0x27f7c9,_0x130349){_0x27f7c9=_0x27f7c9-0x0;var _0xae9b02=_0xc075[_0x27f7c9];return _0xae9b02;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x5c07('0x0'),_0x5c07('0x1'),_0x5c07('0x2')];function createListener(_0x27fb76,_0x4781b5){return function(_0x21ce27){_0x4781b5['emit'](_0x27fb76,_0x21ce27);};}function removeListener(_0x84c5cc,_0x3d7c5a){return function(){ChatInternalMessageEvents[_0x5c07('0x3')](_0x84c5cc,_0x3d7c5a);};}exports[_0x5c07('0x4')]=function(_0x57631e){for(var _0x5950ff=0x0,_0x5a6fa5=events['length'];_0x5950ff<_0x5a6fa5;_0x5950ff++){var _0x5e2e33=events[_0x5950ff];var _0x2f9729=createListener(_0x5c07('0x5')+_0x5e2e33,_0x57631e);ChatInternalMessageEvents['on'](_0x5e2e33,_0x2f9729);}}; \ No newline at end of file +var _0x25e7=['length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x53977f,_0x331344){var _0x3453fd=function(_0x32126e){while(--_0x32126e){_0x53977f['push'](_0x53977f['shift']());}};_0x3453fd(++_0x331344);}(_0x25e7,0x146));var _0x725e=function(_0x26b1b8,_0x35bfd4){_0x26b1b8=_0x26b1b8-0x0;var _0x401762=_0x25e7[_0x26b1b8];return _0x401762;};'use strict';var ChatInternalMessageEvents=require(_0x725e('0x0'));var events=[_0x725e('0x1'),_0x725e('0x2'),_0x725e('0x3')];function createListener(_0x5b00fd,_0x572f71){return function(_0x2f31ed){_0x572f71[_0x725e('0x4')](_0x5b00fd,_0x2f31ed);};}function removeListener(_0x524058,_0x1b2f6d){return function(){ChatInternalMessageEvents[_0x725e('0x5')](_0x524058,_0x1b2f6d);};}exports[_0x725e('0x6')]=function(_0x1b15e1){for(var _0x71ea10=0x0,_0x4f694c=events[_0x725e('0x7')];_0x71ea10<_0x4f694c;_0x71ea10++){var _0x257e7d=events[_0x71ea10];var _0x5c2b5f=createListener(_0x725e('0x8')+_0x257e7d,_0x1b15e1);ChatInternalMessageEvents['on'](_0x257e7d,_0x5c2b5f);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 5e8ff29..e1700ac 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 _0xbe8b=['fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/users','getUsers','show','post','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x4eb52d,_0x18b64d){var _0x3905b7=function(_0x545e64){while(--_0x545e64){_0x4eb52d['push'](_0x4eb52d['shift']());}};_0x3905b7(++_0x18b64d);}(_0xbe8b,0x10f));var _0xbbe8=function(_0x1b50a2,_0x1807a7){_0x1b50a2=_0x1b50a2-0x0;var _0x2611aa=_0xbe8b[_0x1b50a2];return _0x2611aa;};'use strict';var multer=require('multer');var util=require(_0xbbe8('0x0'));var path=require(_0xbbe8('0x1'));var timeout=require(_0xbbe8('0x2'));var express=require(_0xbbe8('0x3'));var router=express[_0xbbe8('0x4')]();var fs_extra=require(_0xbbe8('0x5'));var auth=require(_0xbbe8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbbe8('0x7'));var controller=require('./chatInternalMessage.controller');router['get']('/',auth[_0xbbe8('0x8')](),controller[_0xbbe8('0x9')]);router[_0xbbe8('0xa')](_0xbbe8('0xb'),auth[_0xbbe8('0x8')](),controller[_0xbbe8('0xc')]);router[_0xbbe8('0xa')](_0xbbe8('0xd'),auth[_0xbbe8('0x8')](),controller[_0xbbe8('0xe')]);router['get']('/:id',auth[_0xbbe8('0x8')](),controller[_0xbbe8('0xf')]);router[_0xbbe8('0x10')]('/',auth[_0xbbe8('0x8')](),controller['create']);router[_0xbbe8('0x11')](_0xbbe8('0x12'),controller[_0xbbe8('0x13')]);router[_0xbbe8('0x14')](_0xbbe8('0x12'),auth[_0xbbe8('0x8')](),controller[_0xbbe8('0x15')]);module[_0xbbe8('0x16')]=router; \ No newline at end of file +var _0xf468=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get','/describe','describe','/users','getUsers','/:id','show','post','create','put'];(function(_0x6d2de7,_0x32dd1a){var _0x10634d=function(_0x533295){while(--_0x533295){_0x6d2de7['push'](_0x6d2de7['shift']());}};_0x10634d(++_0x32dd1a);}(_0xf468,0xfe));var _0x8f46=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xf468[_0x3054be];return _0x3df150;};'use strict';var multer=require(_0x8f46('0x0'));var util=require('util');var path=require(_0x8f46('0x1'));var timeout=require(_0x8f46('0x2'));var express=require(_0x8f46('0x3'));var router=express[_0x8f46('0x4')]();var fs_extra=require(_0x8f46('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8f46('0x6'));var config=require(_0x8f46('0x7'));var controller=require(_0x8f46('0x8'));router['get']('/',auth[_0x8f46('0x9')](),controller[_0x8f46('0xa')]);router[_0x8f46('0xb')](_0x8f46('0xc'),auth[_0x8f46('0x9')](),controller[_0x8f46('0xd')]);router[_0x8f46('0xb')](_0x8f46('0xe'),auth[_0x8f46('0x9')](),controller[_0x8f46('0xf')]);router[_0x8f46('0xb')](_0x8f46('0x10'),auth[_0x8f46('0x9')](),controller[_0x8f46('0x11')]);router[_0x8f46('0x12')]('/',auth['isAuthenticated'](),controller[_0x8f46('0x13')]);router[_0x8f46('0x14')](_0x8f46('0x10'),controller[_0x8f46('0x15')]);router[_0x8f46('0x16')](_0x8f46('0x10'),auth[_0x8f46('0x9')](),controller[_0x8f46('0x17')]);module[_0x8f46('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 6194b91..e7cf77c 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 _0x6f59=['BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x3ef3e9,_0x2d74af){var _0x2d1967=function(_0x510e56){while(--_0x510e56){_0x3ef3e9['push'](_0x3ef3e9['shift']());}};_0x2d1967(++_0x2d74af);}(_0x6f59,0x1be));var _0x96f5=function(_0x26f81f,_0xff4b37){_0x26f81f=_0x26f81f-0x0;var _0x3e8d22=_0x6f59[_0x26f81f];return _0x3e8d22;};'use strict';var Sequelize=require(_0x96f5('0x0'));module[_0x96f5('0x1')]={'body':{'type':Sequelize[_0x96f5('0x2')](_0x96f5('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x96f5('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x96f5('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x96f5('0x5')]('in',_0x96f5('0x6')),'defaultValue':_0x96f5('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x96f5('0x7')]},'providerName':{'type':Sequelize[_0x96f5('0x8')]},'providerResponse':{'type':Sequelize[_0x96f5('0x2')]}}; \ No newline at end of file +var _0xad9f=['TEXT','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x2d7d07,_0x23a983){var _0x458d6e=function(_0x3512f0){while(--_0x3512f0){_0x2d7d07['push'](_0x2d7d07['shift']());}};_0x458d6e(++_0x23a983);}(_0xad9f,0x1be));var _0xfad9=function(_0x1d6a2a,_0x28c024){_0x1d6a2a=_0x1d6a2a-0x0;var _0x9bd8cd=_0xad9f[_0x1d6a2a];return _0x9bd8cd;};'use strict';var Sequelize=require(_0xfad9('0x0'));module[_0xfad9('0x1')]={'body':{'type':Sequelize[_0xfad9('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xfad9('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xfad9('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xfad9('0x4')]('in',_0xfad9('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xfad9('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xfad9('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 0496169..463bccb 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 _0x20df=['./chatMessage.socket','register','jayson/promise','client','http','request','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','stack','name','send','index','ChatMessage','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','filter','merge','where','VIRTUAL','includeAll','include','findAll','rows','show','params','fields','length','options','find','create','body','describe','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteractionId','isNil','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','ContactId','sequelize','Sequelize','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','parse','formData','chat-interactions','ChatInteraction','get','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SELECT','internal','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter'];(function(_0x3397cb,_0x22f07a){var _0x1d7d4c=function(_0x1fb619){while(--_0x1fb619){_0x3397cb['push'](_0x3397cb['shift']());}};_0x1d7d4c(++_0x22f07a);}(_0x20df,0x186));var _0xf20d=function(_0x34eb31,_0x8f0f70){_0x34eb31=_0x34eb31-0x0;var _0x254994=_0x20df[_0x34eb31];return _0x254994;};'use strict';var emlformat=require(_0xf20d('0x0'));var rimraf=require(_0xf20d('0x1'));var zipdir=require(_0xf20d('0x2'));var jsonpatch=require(_0xf20d('0x3'));var rp=require(_0xf20d('0x4'));var moment=require('moment');var BPromise=require(_0xf20d('0x5'));var Mustache=require(_0xf20d('0x6'));var util=require(_0xf20d('0x7'));var path=require(_0xf20d('0x8'));var sox=require(_0xf20d('0x9'));var csv=require(_0xf20d('0xa'));var ejs=require(_0xf20d('0xb'));var fs=require('fs');var fs_extra=require(_0xf20d('0xc'));var _=require(_0xf20d('0xd'));var squel=require(_0xf20d('0xe'));var crypto=require(_0xf20d('0xf'));var jsforce=require(_0xf20d('0x10'));var deskjs=require(_0xf20d('0x11'));var toCsv=require(_0xf20d('0xa'));var querystring=require(_0xf20d('0x12'));var Papa=require(_0xf20d('0x13'));var Redis=require(_0xf20d('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xf20d('0x15'));var as=require(_0xf20d('0x16'));var hardwareService=require(_0xf20d('0x17'));var logger=require(_0xf20d('0x18'))(_0xf20d('0x19'));var utils=require(_0xf20d('0x1a'));var config=require(_0xf20d('0x1b'));var licenseUtil=require(_0xf20d('0x1c'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xf20d('0x1d')](config[_0xf20d('0x1e')],{'host':_0xf20d('0x1f'),'port':0x18eb});var socket=require(_0xf20d('0x20'))(new Redis(config[_0xf20d('0x1e')]));require(_0xf20d('0x21'))[_0xf20d('0x22')](socket);var jayson=require(_0xf20d('0x23'));var client=jayson[_0xf20d('0x24')]['http']({'port':0x232c});var client9002=jayson[_0xf20d('0x24')][_0xf20d('0x25')]({'port':0x232a});function respondWithRpcPromise(_0x44820b,_0x2aca7a,_0x469f7b,_0x1b63fe){return new BPromise(function(_0x1848fc,_0x109278){var _0x4f1871=_0x1b63fe||client;return _0x4f1871[_0xf20d('0x26')](_0x44820b,_0x469f7b)['then'](function(_0x569f84){logger[_0xf20d('0x27')](_0xf20d('0x28'),_0x2aca7a,'request\x20sent');logger['debug'](_0xf20d('0x29'),_0x2aca7a,_0xf20d('0x2a'),JSON[_0xf20d('0x2b')](_0x569f84));if(_0x569f84[_0xf20d('0x2c')]){if(_0x569f84[_0xf20d('0x2c')][_0xf20d('0x2d')]===0x1f4){logger['error'](_0xf20d('0x28'),_0x2aca7a,_0x569f84['error'][_0xf20d('0x2e')]);return _0x109278(_0x569f84[_0xf20d('0x2c')][_0xf20d('0x2e')]);}logger[_0xf20d('0x2c')]('ChatMessage,\x20%s,\x20%s',_0x2aca7a,_0x569f84[_0xf20d('0x2c')][_0xf20d('0x2e')]);return _0x1848fc(_0x569f84[_0xf20d('0x2c')][_0xf20d('0x2e')]);}else{logger[_0xf20d('0x27')](_0xf20d('0x28'),_0x2aca7a,_0xf20d('0x2a'));_0x1848fc(_0x569f84[_0xf20d('0x2f')][_0xf20d('0x2e')]);}})[_0xf20d('0x30')](function(_0x572657){logger[_0xf20d('0x2c')](_0xf20d('0x28'),_0x2aca7a,_0x572657);_0x109278(_0x572657);});});}function respondWithStatusCode(_0x58cc23,_0x2f1103){_0x2f1103=_0x2f1103||0xcc;return function(_0x4dbbdb){if(_0x4dbbdb){return _0x58cc23['sendStatus'](_0x2f1103);}return _0x58cc23[_0xf20d('0x31')](_0x2f1103)[_0xf20d('0x32')]();};}function respondWithResult(_0x49e6ce,_0x40c1b4){_0x40c1b4=_0x40c1b4||0xc8;return function(_0x28cdc8){if(_0x28cdc8){return _0x49e6ce['status'](_0x40c1b4)['json'](_0x28cdc8);}};}function respondWithFilteredResult(_0x283ff9,_0x4f8f64){return function(_0x10fa76){if(_0x10fa76){var _0x332110=typeof _0x4f8f64['offset']===_0xf20d('0x33')&&typeof _0x4f8f64['limit']==='undefined';var _0x23d363=_0x10fa76[_0xf20d('0x34')];var _0x539b79=_0x332110?0x0:_0x4f8f64['offset'];var _0xdcbb36=_0x332110?_0x10fa76['count']:_0x4f8f64[_0xf20d('0x35')]+_0x4f8f64[_0xf20d('0x36')];var _0x4cfb06;if(_0xdcbb36>=_0x23d363){_0xdcbb36=_0x23d363;_0x4cfb06=0xc8;}else{_0x4cfb06=0xce;}_0x283ff9[_0xf20d('0x31')](_0x4cfb06);return _0x283ff9[_0xf20d('0x37')](_0xf20d('0x38'),_0x539b79+'-'+_0xdcbb36+'/'+_0x23d363)[_0xf20d('0x39')](_0x10fa76);}return null;};}function patchUpdates(_0x1b6ad9){return function(_0x47c450){try{jsonpatch[_0xf20d('0x3a')](_0x47c450,_0x1b6ad9,!![]);}catch(_0x18fdc9){return BPromise[_0xf20d('0x3b')](_0x18fdc9);}return _0x47c450[_0xf20d('0x3c')]();};}function saveUpdates(_0x461126,_0x52205a){return function(_0x18227f){if(_0x18227f){return _0x18227f[_0xf20d('0x3d')](_0x461126)['then'](function(_0x33abc5){return _0x33abc5;});}return null;};}function removeEntity(_0x53bf26,_0x23f854){return function(_0x3c8556){if(_0x3c8556){return _0x3c8556[_0xf20d('0x3e')]()[_0xf20d('0x3f')](function(){_0x53bf26[_0xf20d('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x456a82,_0x358145){return function(_0x3cb80d){if(!_0x3cb80d){_0x456a82['sendStatus'](0x194);}return _0x3cb80d;};}function handleError(_0x23231c,_0x8b6c38){_0x8b6c38=_0x8b6c38||0x1f4;return function(_0x588d26){logger[_0xf20d('0x2c')](_0x588d26[_0xf20d('0x40')]);if(_0x588d26['name']){delete _0x588d26[_0xf20d('0x41')];}_0x23231c[_0xf20d('0x31')](_0x8b6c38)[_0xf20d('0x42')](_0x588d26);};}exports[_0xf20d('0x43')]=function(_0x1ddebb,_0x1b167a){var _0x4f2eee={},_0x37f95a={},_0xcd380a={'count':0x0,'rows':[]};var _0x3daf4b=_['map'](db[_0xf20d('0x44')][_0xf20d('0x45')],function(_0x566f95){return{'name':_0x566f95[_0xf20d('0x46')],'type':_0x566f95[_0xf20d('0x47')]['key']};});_0x37f95a[_0xf20d('0x48')]=_[_0xf20d('0x49')](_0x3daf4b,_0xf20d('0x41'));_0x37f95a['query']=_[_0xf20d('0x4a')](_0x1ddebb[_0xf20d('0x4b')]);_0x37f95a[_0xf20d('0x4c')]=_[_0xf20d('0x4d')](_0x37f95a[_0xf20d('0x48')],_0x37f95a[_0xf20d('0x4b')]);_0x4f2eee[_0xf20d('0x4e')]=_[_0xf20d('0x4d')](_0x37f95a['model'],qs['fields'](_0x1ddebb['query']['fields']));_0x4f2eee[_0xf20d('0x4e')]=_0x4f2eee[_0xf20d('0x4e')]['length']?_0x4f2eee[_0xf20d('0x4e')]:_0x37f95a['model'];if(!_0x1ddebb[_0xf20d('0x4b')][_0xf20d('0x4f')](_0xf20d('0x50'))){_0x4f2eee[_0xf20d('0x36')]=qs[_0xf20d('0x36')](_0x1ddebb[_0xf20d('0x4b')]['limit']);_0x4f2eee[_0xf20d('0x35')]=qs[_0xf20d('0x35')](_0x1ddebb[_0xf20d('0x4b')][_0xf20d('0x35')]);}_0x4f2eee[_0xf20d('0x51')]=qs['sort'](_0x1ddebb['query']['sort']);_0x4f2eee['where']=qs[_0xf20d('0x4c')](_['pick'](_0x1ddebb[_0xf20d('0x4b')],_0x37f95a['filters']),_0x3daf4b);if(_0x1ddebb[_0xf20d('0x4b')][_0xf20d('0x52')]){_0x4f2eee['where']=_[_0xf20d('0x53')](_0x4f2eee[_0xf20d('0x54')],{'$or':_[_0xf20d('0x49')](_0x3daf4b,function(_0x4f66a5){if(_0x4f66a5[_0xf20d('0x47')]!==_0xf20d('0x55')){var _0x306142={};_0x306142[_0x4f66a5['name']]={'$like':'%'+_0x1ddebb[_0xf20d('0x4b')]['filter']+'%'};return _0x306142;}})});}_0x4f2eee=_[_0xf20d('0x53')]({},_0x4f2eee,_0x1ddebb['options']);var _0x4033fd={'where':_0x4f2eee[_0xf20d('0x54')]};return db['ChatMessage']['count'](_0x4033fd)[_0xf20d('0x3f')](function(_0x5d68e2){_0xcd380a['count']=_0x5d68e2;if(_0x1ddebb[_0xf20d('0x4b')][_0xf20d('0x56')]){_0x4f2eee[_0xf20d('0x57')]=[{'all':!![]}];}return db[_0xf20d('0x44')][_0xf20d('0x58')](_0x4f2eee);})[_0xf20d('0x3f')](function(_0x3485c9){_0xcd380a[_0xf20d('0x59')]=_0x3485c9;return _0xcd380a;})[_0xf20d('0x3f')](respondWithFilteredResult(_0x1b167a,_0x4f2eee))[_0xf20d('0x30')](handleError(_0x1b167a,null));};exports[_0xf20d('0x5a')]=function(_0x20f8ed,_0x40c0a6){var _0x2957e8={'raw':!![],'where':{'id':_0x20f8ed[_0xf20d('0x5b')]['id']}},_0x12477b={};_0x12477b[_0xf20d('0x48')]=_['keys'](db[_0xf20d('0x44')][_0xf20d('0x45')]);_0x12477b[_0xf20d('0x4b')]=_[_0xf20d('0x4a')](_0x20f8ed['query']);_0x12477b[_0xf20d('0x4c')]=_[_0xf20d('0x4d')](_0x12477b['model'],_0x12477b[_0xf20d('0x4b')]);_0x2957e8[_0xf20d('0x4e')]=_[_0xf20d('0x4d')](_0x12477b[_0xf20d('0x48')],qs[_0xf20d('0x5c')](_0x20f8ed[_0xf20d('0x4b')][_0xf20d('0x5c')]));_0x2957e8[_0xf20d('0x4e')]=_0x2957e8[_0xf20d('0x4e')][_0xf20d('0x5d')]?_0x2957e8[_0xf20d('0x4e')]:_0x12477b[_0xf20d('0x48')];if(_0x20f8ed['query'][_0xf20d('0x56')]){_0x2957e8[_0xf20d('0x57')]=[{'all':!![]}];}_0x2957e8=_[_0xf20d('0x53')]({},_0x2957e8,_0x20f8ed[_0xf20d('0x5e')]);return db[_0xf20d('0x44')][_0xf20d('0x5f')](_0x2957e8)['then'](handleEntityNotFound(_0x40c0a6,null))[_0xf20d('0x3f')](respondWithResult(_0x40c0a6,null))['catch'](handleError(_0x40c0a6,null));};exports['create']=function(_0x59f7e0,_0x383f9b){return db[_0xf20d('0x44')][_0xf20d('0x60')](_0x59f7e0['body'],{})[_0xf20d('0x3f')](respondWithResult(_0x383f9b,0xc9))[_0xf20d('0x30')](handleError(_0x383f9b,null));};exports[_0xf20d('0x3d')]=function(_0x48d74f,_0x2178b8){if(_0x48d74f[_0xf20d('0x61')]['id']){delete _0x48d74f[_0xf20d('0x61')]['id'];}return db[_0xf20d('0x44')][_0xf20d('0x5f')]({'where':{'id':_0x48d74f['params']['id']}})[_0xf20d('0x3f')](handleEntityNotFound(_0x2178b8,null))[_0xf20d('0x3f')](saveUpdates(_0x48d74f['body'],null))[_0xf20d('0x3f')](respondWithResult(_0x2178b8,null))['catch'](handleError(_0x2178b8,null));};exports['destroy']=function(_0x31efa0,_0x219136){return db[_0xf20d('0x44')][_0xf20d('0x5f')]({'where':{'id':_0x31efa0[_0xf20d('0x5b')]['id']}})[_0xf20d('0x3f')](handleEntityNotFound(_0x219136,null))['then'](removeEntity(_0x219136,null))[_0xf20d('0x30')](handleError(_0x219136,null));};exports[_0xf20d('0x62')]=function(_0x1a1a37,_0x43b58b){return db[_0xf20d('0x44')][_0xf20d('0x62')]()['then'](respondWithResult(_0x43b58b,null))[_0xf20d('0x30')](handleError(_0x43b58b,null));};var interaction_log=require(_0xf20d('0x18'))('chat-interactions');exports[_0xf20d('0x63')]=function(_0x4fa155,_0xd3b996,_0x95599d){var _0x3a6890={'agent':{},'channel':_0xf20d('0x64')};if(_0x4fa155['body']['id']){delete _0x4fa155[_0xf20d('0x61')]['id'];}_0x4fa155[_0xf20d('0x61')][_0xf20d('0x65')]=!![];_0x4fa155['body'][_0xf20d('0x66')]=moment()['format'](_0xf20d('0x67'));_0x4fa155[_0xf20d('0x61')][_0xf20d('0x68')]=_0x4fa155[_0xf20d('0x61')][_0xf20d('0x68')]||_0x4fa155[_0xf20d('0x69')]['id'];_0x3a6890[_0xf20d('0x6a')]['id']=_0x4fa155[_0xf20d('0x61')][_0xf20d('0x68')];return db[_0xf20d('0x44')][_0xf20d('0x5f')]({'where':{'id':_0x4fa155[_0xf20d('0x5b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xd3b996,null))[_0xf20d('0x3f')](saveUpdates(_0x4fa155['body'],null))[_0xf20d('0x3f')](function(_0x539397){if(_0x539397){_0x3a6890['message']=_0x539397['get']({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x539397[_0xf20d('0x6b')]}});}return null;})[_0xf20d('0x3f')](handleEntityNotFound(_0xd3b996,null))['then'](function(_0x3bfc98){if(_0x3bfc98){return _0x3bfc98[_0xf20d('0x3d')]({'UserId':_0x4fa155[_0xf20d('0x61')]['UserId'],'read1stAt':_[_0xf20d('0x6c')](_0x3bfc98['read1stAt'])?moment()[_0xf20d('0x6d')](_0xf20d('0x67')):undefined});}return null;})['then'](function(_0x1d60dc){if(_0x1d60dc){_0x3a6890[_0xf20d('0x6e')]=_0x1d60dc['get']({'plain':!![]});interaction_log['info'](_0xf20d('0x6f'),_0x4fa155[_0xf20d('0x69')]['id'],_0x4fa155[_0xf20d('0x69')][_0xf20d('0x41')],_0x4fa155[_0xf20d('0x69')][_0xf20d('0x70')],_0x3a6890[_0xf20d('0x6e')]['id'],_0x4fa155[_0xf20d('0x61')]?JSON[_0xf20d('0x2b')](_0x4fa155['body']):_0xf20d('0x71'));return respondWithRpcPromise(_0xf20d('0x72'),'acceptMessage',_0x3a6890);}return null;})[_0xf20d('0x3f')](function(_0x2d185a){var _0x11183f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2d185a[_0xf20d('0x2e')][_0xf20d('0x73')];return db[_0xf20d('0x74')][_0xf20d('0x4b')](_0x11183f,{'type':db[_0xf20d('0x75')]['QueryTypes']['SELECT'],'raw':!![]})[_0xf20d('0x3f')](function(_0x2bdef8){return _0x2bdef8;});})[_0xf20d('0x3f')](function(_0x4ffda8){if(_0x4ffda8){_0x3a6890[_0xf20d('0x2e')][_0xf20d('0x76')]=_0x4ffda8[0x0];if(!_0x4fa155['body'][_0xf20d('0x68')])return;return db[_0xf20d('0x77')][_0xf20d('0x5f')]({'where':{'id':_0x4fa155['body'][_0xf20d('0x68')],'role':_0xf20d('0x6a')},'attributes':['id',_0xf20d('0x41'),_0xf20d('0x78'),_0xf20d('0x79'),'internal'],'raw':!![]});}return null;})[_0xf20d('0x3f')](function(_0x150ec0){if(!_0x150ec0)return null;_0x3a6890['message'][_0xf20d('0x6a')]=_0x150ec0;return _0x3a6890;})[_0xf20d('0x3f')](function(_0x267976){if(_0x267976){if(_0x4fa155[_0xf20d('0x61')][_0xf20d('0x7a')]){_0x3a6890[_0xf20d('0x2e')][_0xf20d('0x7b')]=util[_0xf20d('0x6d')](_0xf20d('0x7c'),_0x4fa155[_0xf20d('0x69')][_0xf20d('0x41')]);_0x3a6890[_0xf20d('0x2e')][_0xf20d('0x7d')]=_0x3a6890[_0xf20d('0x7d')];_0x3a6890['message'][_0xf20d('0x7e')]=_0x3a6890['channel'];_0x3a6890[_0xf20d('0x2e')][_0xf20d('0x7f')]=_0xf20d('0x63');return respondWithRpcPromise(_0xf20d('0x80'),'EventManager',{'event':'acceptmessage','message':_[_0xf20d('0x53')](_0x3a6890[_0xf20d('0x2e')],JSON[_0xf20d('0x81')](_0x3a6890['interaction'][_0xf20d('0x82')]))},client9002)[_0xf20d('0x3f')](function(){return _0x3a6890;});}return _0x3a6890;}return null;})['then'](respondWithResult(_0xd3b996,null))[_0xf20d('0x30')](handleError(_0xd3b996,null));};var interaction_log=require(_0xf20d('0x18'))(_0xf20d('0x83'));exports[_0xf20d('0x3b')]=function(_0x3823f2,_0x543dc0,_0x47e399){var _0x2a40d0={'agent':{},'channel':_0xf20d('0x64')};if(_0x3823f2['body']['id']){delete _0x3823f2[_0xf20d('0x61')]['id'];}_0x3823f2['body'][_0xf20d('0x68')]=_0x3823f2[_0xf20d('0x61')][_0xf20d('0x68')]||_0x3823f2[_0xf20d('0x69')]['id'];_0x2a40d0[_0xf20d('0x6a')]['id']=_0x3823f2[_0xf20d('0x61')]['UserId'];return db[_0xf20d('0x44')][_0xf20d('0x5f')]({'where':{'id':_0x3823f2[_0xf20d('0x5b')]['id'],'UserId':null}})[_0xf20d('0x3f')](handleEntityNotFound(_0x543dc0,null))[_0xf20d('0x3f')](function(_0x2fd9f9){if(_0x2fd9f9){_0x2a40d0[_0xf20d('0x2e')]=_0x2fd9f9['get']({'plain':!![]});return db[_0xf20d('0x84')][_0xf20d('0x5f')]({'where':{'id':_0x2fd9f9[_0xf20d('0x6b')]}});}return null;})[_0xf20d('0x3f')](handleEntityNotFound(_0x543dc0,null))['then'](function(_0x3f26e6){if(_0x3f26e6){_0x2a40d0[_0xf20d('0x6e')]=_0x3f26e6[_0xf20d('0x85')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3823f2[_0xf20d('0x69')]['id'],_0x3823f2[_0xf20d('0x69')][_0xf20d('0x41')],_0x3823f2[_0xf20d('0x69')][_0xf20d('0x70')],_0x2a40d0[_0xf20d('0x6e')]['id'],_0x3823f2[_0xf20d('0x61')]?JSON['stringify'](_0x3823f2['body']):'null');return respondWithRpcPromise(_0xf20d('0x86'),_0xf20d('0x87'),_0x2a40d0);}return null;})['then'](function(_0x42fe4f){var _0x4b6fb9=_0xf20d('0x88')+_0x42fe4f[_0xf20d('0x2e')]['ContactId'];return db['sequelize'][_0xf20d('0x4b')](_0x4b6fb9,{'type':db[_0xf20d('0x75')][_0xf20d('0x89')][_0xf20d('0x8a')],'raw':!![]})[_0xf20d('0x3f')](function(_0x381e3b){return _0x381e3b;});})[_0xf20d('0x3f')](function(_0x1f34e6){if(_0x1f34e6){_0x2a40d0[_0xf20d('0x2e')][_0xf20d('0x76')]=_0x1f34e6[0x0];if(!_0x3823f2[_0xf20d('0x61')]['UserId'])return;return db[_0xf20d('0x77')][_0xf20d('0x5f')]({'where':{'id':_0x3823f2[_0xf20d('0x61')]['UserId'],'role':_0xf20d('0x6a')},'attributes':['id',_0xf20d('0x41'),_0xf20d('0x78'),_0xf20d('0x79'),_0xf20d('0x8b')],'raw':!![]});}return null;})[_0xf20d('0x3f')](function(_0x56d5d6){if(!_0x56d5d6)return null;_0x2a40d0[_0xf20d('0x2e')][_0xf20d('0x6a')]=_0x56d5d6;return _0x2a40d0;})[_0xf20d('0x3f')](function(_0x6e476a){if(_0x6e476a){_0x6e476a[_0xf20d('0x2e')][_0xf20d('0x7b')]=util[_0xf20d('0x6d')](_0xf20d('0x7c'),_0x3823f2[_0xf20d('0x69')][_0xf20d('0x41')]);_0x6e476a[_0xf20d('0x2e')][_0xf20d('0x7d')]=_0x2a40d0[_0xf20d('0x7d')];_0x6e476a['message'][_0xf20d('0x7e')]=_0x2a40d0[_0xf20d('0x7d')];_0x6e476a[_0xf20d('0x2e')][_0xf20d('0x7f')]=_0xf20d('0x3b');respondWithRpcPromise('EventManager',_0xf20d('0x80'),{'event':_0xf20d('0x8c'),'message':_['merge'](_0x2a40d0['message'],JSON[_0xf20d('0x81')](_0x2a40d0[_0xf20d('0x6e')][_0xf20d('0x82')]))},client9002);return _0x2a40d0;}return null;})[_0xf20d('0x3f')](respondWithResult(_0x543dc0,null))[_0xf20d('0x30')](handleError(_0x543dc0,null));}; \ No newline at end of file +var _0x769c=['[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','QueryTypes','interface','rejectmessage','formData','rimraf','fast-json-patch','request-promise','moment','sox','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','debug','error','code','ChatMessage,\x20%s,\x20%s','message','request\x20sent','result','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','destroy','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','where','merge','type','VIRTUAL','filter','options','ChatMessage','include','rows','catch','show','params','includeAll','find','create','body','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteractionId','isNil','role','interaction','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','agent','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','reject','ChatInteraction'];(function(_0x1275b7,_0x457830){var _0x38524b=function(_0x51df7e){while(--_0x51df7e){_0x1275b7['push'](_0x1275b7['shift']());}};_0x38524b(++_0x457830);}(_0x769c,0x18c));var _0xc769=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x769c[_0x178e48];return _0x440d7e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc769('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc769('0x1'));var rp=require(_0xc769('0x2'));var moment=require(_0xc769('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc769('0x4'));var csv=require('to-csv');var ejs=require(_0xc769('0x5'));var fs=require('fs');var fs_extra=require(_0xc769('0x6'));var _=require(_0xc769('0x7'));var squel=require(_0xc769('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc769('0x9'));var toCsv=require('to-csv');var querystring=require(_0xc769('0xa'));var Papa=require(_0xc769('0xb'));var Redis=require(_0xc769('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xc769('0xd'));var as=require(_0xc769('0xe'));var hardwareService=require(_0xc769('0xf'));var logger=require(_0xc769('0x10'))(_0xc769('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc769('0x12'));var db=require(_0xc769('0x13'))['db'];config[_0xc769('0x14')]=_[_0xc769('0x15')](config['redis'],{'host':_0xc769('0x16'),'port':0x18eb});var socket=require(_0xc769('0x17'))(new Redis(config[_0xc769('0x14')]));require('./chatMessage.socket')[_0xc769('0x18')](socket);var jayson=require(_0xc769('0x19'));var client=jayson[_0xc769('0x1a')][_0xc769('0x1b')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x605ad9,_0x41798d,_0x2bac4c,_0x2d3dc0){return new BPromise(function(_0x22cb7c,_0x51952d){var _0x536697=_0x2d3dc0||client;return _0x536697['request'](_0x605ad9,_0x2bac4c)[_0xc769('0x1c')](function(_0x182a9f){logger[_0xc769('0x1d')]('ChatMessage,\x20%s,\x20%s',_0x41798d,'request\x20sent');logger[_0xc769('0x1e')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x41798d,'request\x20sent',JSON['stringify'](_0x182a9f));if(_0x182a9f[_0xc769('0x1f')]){if(_0x182a9f[_0xc769('0x1f')][_0xc769('0x20')]===0x1f4){logger['error'](_0xc769('0x21'),_0x41798d,_0x182a9f['error'][_0xc769('0x22')]);return _0x51952d(_0x182a9f['error']['message']);}logger[_0xc769('0x1f')](_0xc769('0x21'),_0x41798d,_0x182a9f[_0xc769('0x1f')][_0xc769('0x22')]);return _0x22cb7c(_0x182a9f[_0xc769('0x1f')][_0xc769('0x22')]);}else{logger[_0xc769('0x1d')]('ChatMessage,\x20%s,\x20%s',_0x41798d,_0xc769('0x23'));_0x22cb7c(_0x182a9f[_0xc769('0x24')][_0xc769('0x22')]);}})['catch'](function(_0x38c1c7){logger[_0xc769('0x1f')](_0xc769('0x21'),_0x41798d,_0x38c1c7);_0x51952d(_0x38c1c7);});});}function respondWithStatusCode(_0x3295b4,_0x147345){_0x147345=_0x147345||0xcc;return function(_0x1a78a6){if(_0x1a78a6){return _0x3295b4[_0xc769('0x25')](_0x147345);}return _0x3295b4[_0xc769('0x26')](_0x147345)[_0xc769('0x27')]();};}function respondWithResult(_0x526197,_0x3eae0e){_0x3eae0e=_0x3eae0e||0xc8;return function(_0x191e10){if(_0x191e10){return _0x526197[_0xc769('0x26')](_0x3eae0e)[_0xc769('0x28')](_0x191e10);}};}function respondWithFilteredResult(_0x243543,_0x1d33e9){return function(_0x49a4e7){if(_0x49a4e7){var _0xf658bc=typeof _0x1d33e9['offset']===_0xc769('0x29')&&typeof _0x1d33e9[_0xc769('0x2a')]===_0xc769('0x29');var _0x7550ab=_0x49a4e7['count'];var _0x4f7173=_0xf658bc?0x0:_0x1d33e9['offset'];var _0x5dec21=_0xf658bc?_0x49a4e7[_0xc769('0x2b')]:_0x1d33e9[_0xc769('0x2c')]+_0x1d33e9[_0xc769('0x2a')];var _0x922806;if(_0x5dec21>=_0x7550ab){_0x5dec21=_0x7550ab;_0x922806=0xc8;}else{_0x922806=0xce;}_0x243543[_0xc769('0x26')](_0x922806);return _0x243543['set'](_0xc769('0x2d'),_0x4f7173+'-'+_0x5dec21+'/'+_0x7550ab)[_0xc769('0x28')](_0x49a4e7);}return null;};}function patchUpdates(_0x5eebec){return function(_0x4b0867){try{jsonpatch[_0xc769('0x2e')](_0x4b0867,_0x5eebec,!![]);}catch(_0x301cae){return BPromise['reject'](_0x301cae);}return _0x4b0867[_0xc769('0x2f')]();};}function saveUpdates(_0x218661,_0x1aea8d){return function(_0x5ce8df){if(_0x5ce8df){return _0x5ce8df[_0xc769('0x30')](_0x218661)[_0xc769('0x1c')](function(_0x32a7a3){return _0x32a7a3;});}return null;};}function removeEntity(_0x31106e,_0x12a19f){return function(_0x416eb5){if(_0x416eb5){return _0x416eb5[_0xc769('0x31')]()[_0xc769('0x1c')](function(){_0x31106e[_0xc769('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e2eb3,_0x3bc9e7){return function(_0x488791){if(!_0x488791){_0x3e2eb3[_0xc769('0x25')](0x194);}return _0x488791;};}function handleError(_0x353707,_0x3b741d){_0x3b741d=_0x3b741d||0x1f4;return function(_0x16d70e){logger[_0xc769('0x1f')](_0x16d70e[_0xc769('0x32')]);if(_0x16d70e[_0xc769('0x33')]){delete _0x16d70e[_0xc769('0x33')];}_0x353707[_0xc769('0x26')](_0x3b741d)['send'](_0x16d70e);};}exports[_0xc769('0x34')]=function(_0x17a2ab,_0xc4ca6d){var _0x30a8a9={},_0xcc7858={},_0x55d8bf={'count':0x0,'rows':[]};var _0x589941=_[_0xc769('0x35')](db['ChatMessage'][_0xc769('0x36')],function(_0x5f39a0){return{'name':_0x5f39a0[_0xc769('0x37')],'type':_0x5f39a0['type'][_0xc769('0x38')]};});_0xcc7858[_0xc769('0x39')]=_[_0xc769('0x35')](_0x589941,_0xc769('0x33'));_0xcc7858[_0xc769('0x3a')]=_[_0xc769('0x3b')](_0x17a2ab[_0xc769('0x3a')]);_0xcc7858[_0xc769('0x3c')]=_[_0xc769('0x3d')](_0xcc7858[_0xc769('0x39')],_0xcc7858[_0xc769('0x3a')]);_0x30a8a9[_0xc769('0x3e')]=_[_0xc769('0x3d')](_0xcc7858['model'],qs[_0xc769('0x3f')](_0x17a2ab[_0xc769('0x3a')][_0xc769('0x3f')]));_0x30a8a9['attributes']=_0x30a8a9['attributes']['length']?_0x30a8a9['attributes']:_0xcc7858[_0xc769('0x39')];if(!_0x17a2ab['query'][_0xc769('0x40')]('nolimit')){_0x30a8a9['limit']=qs[_0xc769('0x2a')](_0x17a2ab[_0xc769('0x3a')][_0xc769('0x2a')]);_0x30a8a9[_0xc769('0x2c')]=qs[_0xc769('0x2c')](_0x17a2ab['query'][_0xc769('0x2c')]);}_0x30a8a9[_0xc769('0x41')]=qs[_0xc769('0x42')](_0x17a2ab[_0xc769('0x3a')]['sort']);_0x30a8a9['where']=qs[_0xc769('0x3c')](_[_0xc769('0x43')](_0x17a2ab[_0xc769('0x3a')],_0xcc7858[_0xc769('0x3c')]),_0x589941);if(_0x17a2ab[_0xc769('0x3a')]['filter']){_0x30a8a9[_0xc769('0x44')]=_[_0xc769('0x45')](_0x30a8a9[_0xc769('0x44')],{'$or':_[_0xc769('0x35')](_0x589941,function(_0x304eaf){if(_0x304eaf[_0xc769('0x46')]!==_0xc769('0x47')){var _0x2334d4={};_0x2334d4[_0x304eaf[_0xc769('0x33')]]={'$like':'%'+_0x17a2ab['query'][_0xc769('0x48')]+'%'};return _0x2334d4;}})});}_0x30a8a9=_[_0xc769('0x45')]({},_0x30a8a9,_0x17a2ab[_0xc769('0x49')]);var _0x37c38b={'where':_0x30a8a9[_0xc769('0x44')]};return db[_0xc769('0x4a')][_0xc769('0x2b')](_0x37c38b)[_0xc769('0x1c')](function(_0x20b741){_0x55d8bf[_0xc769('0x2b')]=_0x20b741;if(_0x17a2ab[_0xc769('0x3a')]['includeAll']){_0x30a8a9[_0xc769('0x4b')]=[{'all':!![]}];}return db[_0xc769('0x4a')]['findAll'](_0x30a8a9);})['then'](function(_0xb6c01b){_0x55d8bf[_0xc769('0x4c')]=_0xb6c01b;return _0x55d8bf;})[_0xc769('0x1c')](respondWithFilteredResult(_0xc4ca6d,_0x30a8a9))[_0xc769('0x4d')](handleError(_0xc4ca6d,null));};exports[_0xc769('0x4e')]=function(_0xa9e8c2,_0x24a09e){var _0x587f62={'raw':!![],'where':{'id':_0xa9e8c2[_0xc769('0x4f')]['id']}},_0x1da1a6={};_0x1da1a6[_0xc769('0x39')]=_['keys'](db[_0xc769('0x4a')][_0xc769('0x36')]);_0x1da1a6['query']=_['keys'](_0xa9e8c2[_0xc769('0x3a')]);_0x1da1a6['filters']=_[_0xc769('0x3d')](_0x1da1a6[_0xc769('0x39')],_0x1da1a6[_0xc769('0x3a')]);_0x587f62[_0xc769('0x3e')]=_['intersection'](_0x1da1a6[_0xc769('0x39')],qs[_0xc769('0x3f')](_0xa9e8c2[_0xc769('0x3a')][_0xc769('0x3f')]));_0x587f62['attributes']=_0x587f62[_0xc769('0x3e')]['length']?_0x587f62['attributes']:_0x1da1a6[_0xc769('0x39')];if(_0xa9e8c2['query'][_0xc769('0x50')]){_0x587f62[_0xc769('0x4b')]=[{'all':!![]}];}_0x587f62=_['merge']({},_0x587f62,_0xa9e8c2[_0xc769('0x49')]);return db[_0xc769('0x4a')][_0xc769('0x51')](_0x587f62)[_0xc769('0x1c')](handleEntityNotFound(_0x24a09e,null))[_0xc769('0x1c')](respondWithResult(_0x24a09e,null))['catch'](handleError(_0x24a09e,null));};exports['create']=function(_0x3aae17,_0x24f0a8){return db[_0xc769('0x4a')][_0xc769('0x52')](_0x3aae17[_0xc769('0x53')],{})[_0xc769('0x1c')](respondWithResult(_0x24f0a8,0xc9))[_0xc769('0x4d')](handleError(_0x24f0a8,null));};exports[_0xc769('0x30')]=function(_0x25775a,_0x345ad5){if(_0x25775a[_0xc769('0x53')]['id']){delete _0x25775a[_0xc769('0x53')]['id'];}return db['ChatMessage'][_0xc769('0x51')]({'where':{'id':_0x25775a[_0xc769('0x4f')]['id']}})['then'](handleEntityNotFound(_0x345ad5,null))['then'](saveUpdates(_0x25775a[_0xc769('0x53')],null))['then'](respondWithResult(_0x345ad5,null))[_0xc769('0x4d')](handleError(_0x345ad5,null));};exports[_0xc769('0x31')]=function(_0x3083b6,_0x42c65b){return db[_0xc769('0x4a')][_0xc769('0x51')]({'where':{'id':_0x3083b6['params']['id']}})[_0xc769('0x1c')](handleEntityNotFound(_0x42c65b,null))[_0xc769('0x1c')](removeEntity(_0x42c65b,null))['catch'](handleError(_0x42c65b,null));};exports[_0xc769('0x54')]=function(_0x7c76c0,_0x2a1101){return db['ChatMessage'][_0xc769('0x54')]()['then'](respondWithResult(_0x2a1101,null))[_0xc769('0x4d')](handleError(_0x2a1101,null));};var interaction_log=require(_0xc769('0x10'))(_0xc769('0x55'));exports[_0xc769('0x56')]=function(_0x360e48,_0x6011c2,_0x160637){var _0x57caf3={'agent':{},'channel':_0xc769('0x57')};if(_0x360e48[_0xc769('0x53')]['id']){delete _0x360e48['body']['id'];}_0x360e48['body'][_0xc769('0x58')]=!![];_0x360e48[_0xc769('0x53')][_0xc769('0x59')]=moment()[_0xc769('0x5a')](_0xc769('0x5b'));_0x360e48[_0xc769('0x53')][_0xc769('0x5c')]=_0x360e48[_0xc769('0x53')][_0xc769('0x5c')]||_0x360e48[_0xc769('0x5d')]['id'];_0x57caf3['agent']['id']=_0x360e48['body'][_0xc769('0x5c')];return db[_0xc769('0x4a')][_0xc769('0x51')]({'where':{'id':_0x360e48['params']['id'],'UserId':null}})[_0xc769('0x1c')](handleEntityNotFound(_0x6011c2,null))[_0xc769('0x1c')](saveUpdates(_0x360e48['body'],null))['then'](function(_0x568e23){if(_0x568e23){_0x57caf3[_0xc769('0x22')]=_0x568e23[_0xc769('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0xc769('0x51')]({'where':{'id':_0x568e23[_0xc769('0x5f')]}});}return null;})[_0xc769('0x1c')](handleEntityNotFound(_0x6011c2,null))['then'](function(_0x237963){if(_0x237963){return _0x237963[_0xc769('0x30')]({'UserId':_0x360e48[_0xc769('0x53')][_0xc769('0x5c')],'read1stAt':_[_0xc769('0x60')](_0x237963['read1stAt'])?moment()[_0xc769('0x5a')](_0xc769('0x5b')):undefined});}return null;})[_0xc769('0x1c')](function(_0x3809c8){if(_0x3809c8){_0x57caf3['interaction']=_0x3809c8[_0xc769('0x5e')]({'plain':!![]});interaction_log[_0xc769('0x1d')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x360e48[_0xc769('0x5d')]['id'],_0x360e48[_0xc769('0x5d')]['name'],_0x360e48['user'][_0xc769('0x61')],_0x57caf3[_0xc769('0x62')]['id'],_0x360e48['body']?JSON[_0xc769('0x63')](_0x360e48['body']):_0xc769('0x64'));return respondWithRpcPromise(_0xc769('0x65'),_0xc769('0x66'),_0x57caf3);}return null;})[_0xc769('0x1c')](function(_0x1d835c){var _0x54adfe=_0xc769('0x67')+_0x1d835c[_0xc769('0x22')][_0xc769('0x68')];return db[_0xc769('0x69')][_0xc769('0x3a')](_0x54adfe,{'type':db[_0xc769('0x6a')]['QueryTypes'][_0xc769('0x6b')],'raw':!![]})['then'](function(_0x12337f){return _0x12337f;});})[_0xc769('0x1c')](function(_0x4b94f6){if(_0x4b94f6){_0x57caf3[_0xc769('0x22')][_0xc769('0x6c')]=_0x4b94f6[0x0];if(!_0x360e48[_0xc769('0x53')]['UserId'])return;return db[_0xc769('0x6d')][_0xc769('0x51')]({'where':{'id':_0x360e48[_0xc769('0x53')]['UserId'],'role':'agent'},'attributes':['id',_0xc769('0x33'),_0xc769('0x6e'),_0xc769('0x6f'),_0xc769('0x70')],'raw':!![]});}return null;})['then'](function(_0x127b18){if(!_0x127b18)return null;_0x57caf3[_0xc769('0x22')][_0xc769('0x71')]=_0x127b18;return _0x57caf3;})['then'](function(_0x20e86f){if(_0x20e86f){if(_0x360e48['body'][_0xc769('0x72')]){_0x57caf3['message']['interface']=util['format'](_0xc769('0x73'),_0x360e48[_0xc769('0x5d')]['name']);_0x57caf3[_0xc769('0x22')]['channel']=_0x57caf3[_0xc769('0x74')];_0x57caf3[_0xc769('0x22')][_0xc769('0x75')]=_0x57caf3['channel'];_0x57caf3[_0xc769('0x22')][_0xc769('0x76')]=_0xc769('0x56');return respondWithRpcPromise(_0xc769('0x77'),_0xc769('0x77'),{'event':_0xc769('0x78'),'message':_[_0xc769('0x45')](_0x57caf3[_0xc769('0x22')],JSON[_0xc769('0x79')](_0x57caf3['interaction']['formData']))},client9002)[_0xc769('0x1c')](function(){return _0x57caf3;});}return _0x57caf3;}return null;})[_0xc769('0x1c')](respondWithResult(_0x6011c2,null))['catch'](handleError(_0x6011c2,null));};var interaction_log=require(_0xc769('0x10'))('chat-interactions');exports[_0xc769('0x7a')]=function(_0x49190e,_0x4219dd,_0x348833){var _0x3eb2ae={'agent':{},'channel':'chat'};if(_0x49190e[_0xc769('0x53')]['id']){delete _0x49190e[_0xc769('0x53')]['id'];}_0x49190e[_0xc769('0x53')]['UserId']=_0x49190e[_0xc769('0x53')][_0xc769('0x5c')]||_0x49190e[_0xc769('0x5d')]['id'];_0x3eb2ae[_0xc769('0x71')]['id']=_0x49190e['body']['UserId'];return db[_0xc769('0x4a')]['find']({'where':{'id':_0x49190e[_0xc769('0x4f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4219dd,null))[_0xc769('0x1c')](function(_0x1bd26f){if(_0x1bd26f){_0x3eb2ae['message']=_0x1bd26f['get']({'plain':!![]});return db[_0xc769('0x7b')]['find']({'where':{'id':_0x1bd26f['ChatInteractionId']}});}return null;})[_0xc769('0x1c')](handleEntityNotFound(_0x4219dd,null))[_0xc769('0x1c')](function(_0x4491f6){if(_0x4491f6){_0x3eb2ae[_0xc769('0x62')]=_0x4491f6[_0xc769('0x5e')]({'plain':!![]});interaction_log[_0xc769('0x1d')](_0xc769('0x7c'),_0x49190e[_0xc769('0x5d')]['id'],_0x49190e[_0xc769('0x5d')][_0xc769('0x33')],_0x49190e[_0xc769('0x5d')]['role'],_0x3eb2ae['interaction']['id'],_0x49190e['body']?JSON[_0xc769('0x63')](_0x49190e[_0xc769('0x53')]):_0xc769('0x64'));return respondWithRpcPromise(_0xc769('0x7d'),'rejectMessage',_0x3eb2ae);}return null;})[_0xc769('0x1c')](function(_0x38695f){var _0x5b94ee='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x38695f['message'][_0xc769('0x68')];return db[_0xc769('0x69')][_0xc769('0x3a')](_0x5b94ee,{'type':db[_0xc769('0x6a')][_0xc769('0x7e')][_0xc769('0x6b')],'raw':!![]})[_0xc769('0x1c')](function(_0x218ec3){return _0x218ec3;});})[_0xc769('0x1c')](function(_0x4e2683){if(_0x4e2683){_0x3eb2ae[_0xc769('0x22')][_0xc769('0x6c')]=_0x4e2683[0x0];if(!_0x49190e['body'][_0xc769('0x5c')])return;return db['User'][_0xc769('0x51')]({'where':{'id':_0x49190e[_0xc769('0x53')][_0xc769('0x5c')],'role':_0xc769('0x71')},'attributes':['id',_0xc769('0x33'),_0xc769('0x6e'),_0xc769('0x6f'),'internal'],'raw':!![]});}return null;})[_0xc769('0x1c')](function(_0x4ef858){if(!_0x4ef858)return null;_0x3eb2ae[_0xc769('0x22')][_0xc769('0x71')]=_0x4ef858;return _0x3eb2ae;})[_0xc769('0x1c')](function(_0x4af016){if(_0x4af016){_0x4af016[_0xc769('0x22')][_0xc769('0x7f')]=util[_0xc769('0x5a')](_0xc769('0x73'),_0x49190e[_0xc769('0x5d')]['name']);_0x4af016[_0xc769('0x22')][_0xc769('0x74')]=_0x3eb2ae[_0xc769('0x74')];_0x4af016[_0xc769('0x22')][_0xc769('0x75')]=_0x3eb2ae[_0xc769('0x74')];_0x4af016['message'][_0xc769('0x76')]=_0xc769('0x7a');respondWithRpcPromise(_0xc769('0x77'),_0xc769('0x77'),{'event':_0xc769('0x80'),'message':_['merge'](_0x3eb2ae[_0xc769('0x22')],JSON[_0xc769('0x79')](_0x3eb2ae[_0xc769('0x62')][_0xc769('0x81')]))},client9002);return _0x3eb2ae;}return null;})[_0xc769('0x1c')](respondWithResult(_0x4219dd,null))[_0xc769('0x4d')](handleError(_0x4219dd,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index c103945..7ff87c6 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 _0x5d3b=['ChatMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4b33d1,_0x2414e1){var _0x9e7221=function(_0x476ecc){while(--_0x476ecc){_0x4b33d1['push'](_0x4b33d1['shift']());}};_0x9e7221(++_0x2414e1);}(_0x5d3b,0x6c));var _0xb5d3=function(_0x51912b,_0x58e080){_0x51912b=_0x51912b-0x0;var _0x4f1e68=_0x5d3b[_0x51912b];return _0x4f1e68;};'use strict';var EventEmitter=require(_0xb5d3('0x0'));var ChatMessage=require(_0xb5d3('0x1'))['db'][_0xb5d3('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xb5d3('0x3')](0x0);var events={'afterCreate':_0xb5d3('0x4'),'afterUpdate':_0xb5d3('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3a5b82){return function(_0xc5bcb1,_0x1e06f7,_0x59b5ee){ChatMessageEvents['emit'](_0x3a5b82+':'+_0xc5bcb1['id'],_0xc5bcb1);ChatMessageEvents[_0xb5d3('0x6')](_0x3a5b82,_0xc5bcb1);_0x59b5ee(null);};}for(var e in events){if(events[_0xb5d3('0x7')](e)){var event=events[e];ChatMessage[_0xb5d3('0x8')](e,emitEvent(event));}}module[_0xb5d3('0x9')]=ChatMessageEvents; \ No newline at end of file +var _0x908c=['events','../../mysqldb','setMaxListeners','save','update','emit','hook','exports'];(function(_0x42b886,_0x3985db){var _0x38d050=function(_0x319252){while(--_0x319252){_0x42b886['push'](_0x42b886['shift']());}};_0x38d050(++_0x3985db);}(_0x908c,0x140));var _0xc908=function(_0x158232,_0x319520){_0x158232=_0x158232-0x0;var _0x3796e1=_0x908c[_0x158232];return _0x3796e1;};'use strict';var EventEmitter=require(_0xc908('0x0'));var ChatMessage=require(_0xc908('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xc908('0x2')](0x0);var events={'afterCreate':_0xc908('0x3'),'afterUpdate':_0xc908('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3b4cbb){return function(_0xe52c7e,_0x453499,_0x43a0c9){ChatMessageEvents[_0xc908('0x5')](_0x3b4cbb+':'+_0xe52c7e['id'],_0xe52c7e);ChatMessageEvents[_0xc908('0x5')](_0x3b4cbb,_0xe52c7e);_0x43a0c9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xc908('0x6')](e,emitEvent(event));}}module[_0xc908('0x7')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 4866547..6177bd2 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 _0xf3ac=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci'];(function(_0x1ebb10,_0x156b3e){var _0x20d709=function(_0x4cc093){while(--_0x4cc093){_0x1ebb10['push'](_0x1ebb10['shift']());}};_0x20d709(++_0x156b3e);}(_0xf3ac,0x1b2));var _0xcf3a=function(_0x543f18,_0x27a5cd){_0x543f18=_0x543f18-0x0;var _0x28a6ca=_0xf3ac[_0x543f18];return _0x28a6ca;};'use strict';var _=require(_0xcf3a('0x0'));var util=require('util');var logger=require(_0xcf3a('0x1'))(_0xcf3a('0x2'));var moment=require(_0xcf3a('0x3'));var BPromise=require(_0xcf3a('0x4'));var rp=require(_0xcf3a('0x5'));var fs=require('fs');var path=require(_0xcf3a('0x6'));var rimraf=require(_0xcf3a('0x7'));var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module[_0xcf3a('0x8')]=function(_0x273488,_0x117b79){return _0x273488[_0xcf3a('0x9')](_0xcf3a('0xa'),attributes,{'tableName':_0xcf3a('0xb'),'paranoid':![],'indexes':[{'name':_0xcf3a('0xc'),'fields':[_0xcf3a('0xd')],'type':_0xcf3a('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x571fbc,_0x563338,_0x35f72c){var _0x4d0daf=_0x273488[_0xcf3a('0xf')];var _0x47304d=_0x571fbc[_0xcf3a('0x10')]({'plain':!![]});if(_0x47304d[_0xcf3a('0x11')]['toLowerCase']()==='in'||_0x47304d[_0xcf3a('0x11')][_0xcf3a('0x12')]()==='out'&&!_0x47304d[_0xcf3a('0x13')]&&!_[_0xcf3a('0x14')](_0x47304d[_0xcf3a('0x15')])){_0x4d0daf[_0xcf3a('0x16')][_0xcf3a('0x17')]({'where':{'id':_0x47304d[_0xcf3a('0x18')]}})[_0xcf3a('0x19')](function(_0x443c16){if(_0x443c16){_0x443c16['update']({'lastMsgAt':_0x47304d[_0xcf3a('0x1a')],'lastMsgDirection':_0x47304d[_0xcf3a('0x11')]['toLowerCase']()});}})[_0xcf3a('0x1b')](function(_0x5a033d){console[_0xcf3a('0x1c')](_0x5a033d);});}_0x35f72c();}},'charset':_0xcf3a('0x1d'),'collate':_0xcf3a('0x1e')});}; \ No newline at end of file +var _0xb247=['utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','body','models','get','direction','toLowerCase','out','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch','error'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xb247,0x107));var _0x7b24=function(_0x59f655,_0x1c12aa){_0x59f655=_0x59f655-0x0;var _0x1dbb6e=_0xb247[_0x59f655];return _0x1dbb6e;};'use strict';var _=require(_0x7b24('0x0'));var util=require(_0x7b24('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7b24('0x2'));var BPromise=require(_0x7b24('0x3'));var rp=require(_0x7b24('0x4'));var fs=require('fs');var path=require(_0x7b24('0x5'));var rimraf=require(_0x7b24('0x6'));var config=require(_0x7b24('0x7'));var attributes=require(_0x7b24('0x8'));module[_0x7b24('0x9')]=function(_0x1044d6,_0x1a4799){return _0x1044d6['define'](_0x7b24('0xa'),attributes,{'tableName':_0x7b24('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x7b24('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x447ffb,_0x3e7702,_0x391f31){var _0x414d80=_0x1044d6[_0x7b24('0xd')];var _0x240855=_0x447ffb[_0x7b24('0xe')]({'plain':!![]});if(_0x240855[_0x7b24('0xf')]['toLowerCase']()==='in'||_0x240855[_0x7b24('0xf')][_0x7b24('0x10')]()===_0x7b24('0x11')&&!_0x240855['secret']&&!_[_0x7b24('0x12')](_0x240855[_0x7b24('0x13')])){_0x414d80[_0x7b24('0x14')][_0x7b24('0x15')]({'where':{'id':_0x240855[_0x7b24('0x16')]}})[_0x7b24('0x17')](function(_0x2e2ef5){if(_0x2e2ef5){_0x2e2ef5['update']({'lastMsgAt':_0x240855[_0x7b24('0x18')],'lastMsgDirection':_0x240855[_0x7b24('0xf')][_0x7b24('0x10')]()});}})[_0x7b24('0x19')](function(_0x1b1093){console[_0x7b24('0x1a')](_0x1b1093);});}_0x391f31();}},'charset':_0x7b24('0x1b'),'collate':_0x7b24('0x1c')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index fb321c3..21d2214 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 _0x7958=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','./chatMessage.socket','register','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','CreateChatMessage','create','body','options','lodash'];(function(_0x395116,_0x36dfda){var _0xfb18ed=function(_0x515292){while(--_0x515292){_0x395116['push'](_0x395116['shift']());}};_0xfb18ed(++_0x36dfda);}(_0x7958,0x77));var _0x8795=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7958[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8795('0x0'));var util=require(_0x8795('0x1'));var moment=require(_0x8795('0x2'));var BPromise=require('bluebird');var rs=require(_0x8795('0x3'));var fs=require('fs');var Redis=require(_0x8795('0x4'));var db=require(_0x8795('0x5'))['db'];var utils=require(_0x8795('0x6'));var logger=require(_0x8795('0x7'))(_0x8795('0x8'));var config=require(_0x8795('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8795('0xa')]['http']({'port':0x232a});config[_0x8795('0xb')]=_[_0x8795('0xc')](config[_0x8795('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8795('0xd'))(new Redis(config[_0x8795('0xb')]));require(_0x8795('0xe'))[_0x8795('0xf')](socket);function respondWithRpcPromise(_0x599ddd,_0x21635b,_0x58bde6){return new BPromise(function(_0x3f9613,_0x15dec8){return client['request'](_0x599ddd,_0x58bde6)['then'](function(_0x5169ce){logger['info'](_0x8795('0x10'),_0x21635b,_0x8795('0x11'));logger[_0x8795('0x12')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x21635b,'request\x20sent',JSON[_0x8795('0x13')](_0x5169ce));if(_0x5169ce[_0x8795('0x14')]){if(_0x5169ce[_0x8795('0x14')][_0x8795('0x15')]===0x1f4){logger[_0x8795('0x14')]('ChatMessage,\x20%s,\x20%s',_0x21635b,_0x5169ce[_0x8795('0x14')]['message']);return _0x15dec8(_0x5169ce[_0x8795('0x14')][_0x8795('0x16')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x21635b,_0x5169ce[_0x8795('0x14')]['message']);return _0x3f9613(_0x5169ce['error'][_0x8795('0x16')]);}else{logger[_0x8795('0x17')](_0x8795('0x10'),_0x21635b,_0x8795('0x11'));_0x3f9613(_0x5169ce[_0x8795('0x18')][_0x8795('0x16')]);}})[_0x8795('0x19')](function(_0x5f09ce){logger[_0x8795('0x14')](_0x8795('0x10'),_0x21635b,_0x5f09ce);_0x15dec8(_0x5f09ce);});});}exports[_0x8795('0x1a')]=function(_0x14001f){var _0x1d2f17=this;return new Promise(function(_0x5cf8f2,_0x307cc8){return db['ChatMessage'][_0x8795('0x1b')](_0x14001f[_0x8795('0x1c')],{'raw':_0x14001f[_0x8795('0x1d')]?_0x14001f[_0x8795('0x1d')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4e7940){logger[_0x8795('0x17')](_0x8795('0x1a'),_0x14001f);logger['debug'](_0x8795('0x1a'),_0x14001f,JSON['stringify'](_0x4e7940));_0x5cf8f2(_0x4e7940);})[_0x8795('0x19')](function(_0x18baf2){logger[_0x8795('0x14')](_0x8795('0x1a'),_0x18baf2[_0x8795('0x16')],_0x14001f);_0x307cc8(_0x1d2f17[_0x8795('0x14')](0x1f4,_0x18baf2['message']));});});}; \ No newline at end of file +var _0xbbdb=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','redis','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','raw','CreateChatMessage','lodash'];(function(_0xac33a5,_0x528d90){var _0x1920e6=function(_0x429bb0){while(--_0x429bb0){_0xac33a5['push'](_0xac33a5['shift']());}};_0x1920e6(++_0x528d90);}(_0xbbdb,0x18b));var _0xbbbd=function(_0x4d394d,_0x40e7b3){_0x4d394d=_0x4d394d-0x0;var _0x4f0003=_0xbbdb[_0x4d394d];return _0x4f0003;};'use strict';var _=require(_0xbbbd('0x0'));var util=require(_0xbbbd('0x1'));var moment=require(_0xbbbd('0x2'));var BPromise=require('bluebird');var rs=require(_0xbbbd('0x3'));var fs=require('fs');var Redis=require(_0xbbbd('0x4'));var db=require(_0xbbbd('0x5'))['db'];var utils=require(_0xbbbd('0x6'));var logger=require(_0xbbbd('0x7'))(_0xbbbd('0x8'));var config=require(_0xbbbd('0x9'));var jayson=require(_0xbbbd('0xa'));var client=jayson[_0xbbbd('0xb')][_0xbbbd('0xc')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xbbbd('0xd'),'port':0x18eb});var socket=require(_0xbbbd('0xe'))(new Redis(config[_0xbbbd('0xf')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x378a89,_0x3680e4,_0x3d9c1e){return new BPromise(function(_0x5268f8,_0xbf6018){return client['request'](_0x378a89,_0x3d9c1e)[_0xbbbd('0x10')](function(_0x4fc869){logger[_0xbbbd('0x11')](_0xbbbd('0x12'),_0x3680e4,_0xbbbd('0x13'));logger[_0xbbbd('0x14')](_0xbbbd('0x15'),_0x3680e4,_0xbbbd('0x13'),JSON[_0xbbbd('0x16')](_0x4fc869));if(_0x4fc869[_0xbbbd('0x17')]){if(_0x4fc869['error'][_0xbbbd('0x18')]===0x1f4){logger[_0xbbbd('0x17')]('ChatMessage,\x20%s,\x20%s',_0x3680e4,_0x4fc869[_0xbbbd('0x17')][_0xbbbd('0x19')]);return _0xbf6018(_0x4fc869[_0xbbbd('0x17')]['message']);}logger[_0xbbbd('0x17')](_0xbbbd('0x12'),_0x3680e4,_0x4fc869[_0xbbbd('0x17')][_0xbbbd('0x19')]);return _0x5268f8(_0x4fc869[_0xbbbd('0x17')][_0xbbbd('0x19')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x3680e4,'request\x20sent');_0x5268f8(_0x4fc869[_0xbbbd('0x1a')]['message']);}})[_0xbbbd('0x1b')](function(_0x4b3adb){logger[_0xbbbd('0x17')](_0xbbbd('0x12'),_0x3680e4,_0x4b3adb);_0xbf6018(_0x4b3adb);});});}exports['CreateChatMessage']=function(_0x7c36e0){var _0x164364=this;return new Promise(function(_0x2ef309,_0x28f612){return db['ChatMessage'][_0xbbbd('0x1c')](_0x7c36e0[_0xbbbd('0x1d')],{'raw':_0x7c36e0[_0xbbbd('0x1e')]?_0x7c36e0['options'][_0xbbbd('0x1f')]===undefined?!![]:![]:!![]})[_0xbbbd('0x10')](function(_0xbad567){logger[_0xbbbd('0x11')]('CreateChatMessage',_0x7c36e0);logger[_0xbbbd('0x14')](_0xbbbd('0x20'),_0x7c36e0,JSON[_0xbbbd('0x16')](_0xbad567));_0x2ef309(_0xbad567);})['catch'](function(_0x273bd4){logger[_0xbbbd('0x17')](_0xbbbd('0x20'),_0x273bd4['message'],_0x7c36e0);_0x28f612(_0x164364[_0xbbbd('0x17')](0x1f4,_0x273bd4[_0xbbbd('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 316c121..00dd812 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 _0x3d6d=['update','emit','removeListener','length','./chatMessage.events','save','remove'];(function(_0x2749c9,_0x10db7c){var _0x4104cc=function(_0x26632a){while(--_0x26632a){_0x2749c9['push'](_0x2749c9['shift']());}};_0x4104cc(++_0x10db7c);}(_0x3d6d,0xb3));var _0xd3d6=function(_0x1569fc,_0x115095){_0x1569fc=_0x1569fc-0x0;var _0x277783=_0x3d6d[_0x1569fc];return _0x277783;};'use strict';var ChatMessageEvents=require(_0xd3d6('0x0'));var events=[_0xd3d6('0x1'),_0xd3d6('0x2'),_0xd3d6('0x3')];function createListener(_0x380c09,_0x1e1915){return function(_0x366f41){_0x1e1915[_0xd3d6('0x4')](_0x380c09,_0x366f41);};}function removeListener(_0x297bd6,_0x3d5e37){return function(){ChatMessageEvents[_0xd3d6('0x5')](_0x297bd6,_0x3d5e37);};}exports['register']=function(_0x5400f8){for(var _0x3f36=0x0,_0x1f02f5=events[_0xd3d6('0x6')];_0x3f36<_0x1f02f5;_0x3f36++){var _0x3c2a9b=events[_0x3f36];var _0x4356b7=createListener('chatMessage:'+_0x3c2a9b,_0x5400f8);ChatMessageEvents['on'](_0x3c2a9b,_0x4356b7);}}; \ No newline at end of file +var _0x7a59=['length','chatMessage:','./chatMessage.events','update','emit','removeListener','register'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7a59,0x16e));var _0x97a5=function(_0x1347f8,_0x233feb){_0x1347f8=_0x1347f8-0x0;var _0x218368=_0x7a59[_0x1347f8];return _0x218368;};'use strict';var ChatMessageEvents=require(_0x97a5('0x0'));var events=['save','remove',_0x97a5('0x1')];function createListener(_0xe6f28a,_0x23919f){return function(_0xdc5cf1){_0x23919f[_0x97a5('0x2')](_0xe6f28a,_0xdc5cf1);};}function removeListener(_0x5e2db0,_0x3ba155){return function(){ChatMessageEvents[_0x97a5('0x3')](_0x5e2db0,_0x3ba155);};}exports[_0x97a5('0x4')]=function(_0x48201b){for(var _0x438520=0x0,_0x52d32f=events[_0x97a5('0x5')];_0x438520<_0x52d32f;_0x438520++){var _0x2c0efa=events[_0x438520];var _0x27e8a6=createListener(_0x97a5('0x6')+_0x2c0efa,_0x48201b);ChatMessageEvents['on'](_0x2c0efa,_0x27e8a6);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 02ab121..aa63a12 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 _0xcbdd=['Router','fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chatmessage:create','create','put','/:id/accept','/:id/reject','reject','delete','exports','multer','util','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcbdd,0x18d));var _0xdcbd=function(_0xf663ea,_0xc1d693){_0xf663ea=_0xf663ea-0x0;var _0x4e9416=_0xcbdd[_0xf663ea];return _0x4e9416;};'use strict';var multer=require(_0xdcbd('0x0'));var util=require(_0xdcbd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdcbd('0x2'));var router=express[_0xdcbd('0x3')]();var fs_extra=require(_0xdcbd('0x4'));var auth=require(_0xdcbd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdcbd('0x6'));var controller=require(_0xdcbd('0x7'));router[_0xdcbd('0x8')]('/',auth[_0xdcbd('0x9')](),controller[_0xdcbd('0xa')]);router[_0xdcbd('0x8')](_0xdcbd('0xb'),auth[_0xdcbd('0x9')](),controller[_0xdcbd('0xc')]);router['get'](_0xdcbd('0xd'),auth[_0xdcbd('0x9')](),controller[_0xdcbd('0xe')]);router[_0xdcbd('0xf')]('/',auth[_0xdcbd('0x9')](),interaction[_0xdcbd('0x10')]('chat',_0xdcbd('0x11')),controller[_0xdcbd('0x12')]);router['put'](_0xdcbd('0xd'),controller['update']);router[_0xdcbd('0x13')](_0xdcbd('0x14'),auth[_0xdcbd('0x9')](),controller['accept']);router[_0xdcbd('0x13')](_0xdcbd('0x15'),auth[_0xdcbd('0x9')](),controller[_0xdcbd('0x16')]);router[_0xdcbd('0x17')](_0xdcbd('0xd'),auth[_0xdcbd('0x9')](),controller['destroy']);module[_0xdcbd('0x18')]=router; \ No newline at end of file +var _0xef69=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','chat','chatmessage:create','create','update','put','/:id/accept','accept','/:id/reject','delete'];(function(_0x413979,_0x5e8551){var _0x2a08fe=function(_0x51315b){while(--_0x51315b){_0x413979['push'](_0x413979['shift']());}};_0x2a08fe(++_0x5e8551);}(_0xef69,0x93));var _0x9ef6=function(_0x40df07,_0x2392d2){_0x40df07=_0x40df07-0x0;var _0x2050fe=_0xef69[_0x40df07];return _0x2050fe;};'use strict';var multer=require(_0x9ef6('0x0'));var util=require(_0x9ef6('0x1'));var path=require(_0x9ef6('0x2'));var timeout=require(_0x9ef6('0x3'));var express=require(_0x9ef6('0x4'));var router=express[_0x9ef6('0x5')]();var fs_extra=require(_0x9ef6('0x6'));var auth=require(_0x9ef6('0x7'));var interaction=require(_0x9ef6('0x8'));var config=require(_0x9ef6('0x9'));var controller=require('./chatMessage.controller');router[_0x9ef6('0xa')]('/',auth[_0x9ef6('0xb')](),controller[_0x9ef6('0xc')]);router[_0x9ef6('0xa')](_0x9ef6('0xd'),auth['isAuthenticated'](),controller[_0x9ef6('0xe')]);router[_0x9ef6('0xa')](_0x9ef6('0xf'),auth[_0x9ef6('0xb')](),controller['show']);router[_0x9ef6('0x10')]('/',auth[_0x9ef6('0xb')](),interaction[_0x9ef6('0x11')](_0x9ef6('0x12'),_0x9ef6('0x13')),controller[_0x9ef6('0x14')]);router['put'](_0x9ef6('0xf'),controller[_0x9ef6('0x15')]);router[_0x9ef6('0x16')](_0x9ef6('0x17'),auth[_0x9ef6('0xb')](),controller[_0x9ef6('0x18')]);router[_0x9ef6('0x16')](_0x9ef6('0x19'),auth[_0x9ef6('0xb')](),controller['reject']);router[_0x9ef6('0x1a')](_0x9ef6('0xf'),auth['isAuthenticated'](),controller[_0x9ef6('0x1b')]);module[_0x9ef6('0x1c')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 9458c31..1bf72bc 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['medium','TEXT','exports'];(function(_0x30ec2a,_0x1dc728){var _0x33ecec=function(_0x4d3760){while(--_0x4d3760){_0x30ec2a['push'](_0x30ec2a['shift']());}};_0x33ecec(++_0x1dc728);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5f66[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}}; \ No newline at end of file +var _0x5f66=['medium','TEXT','exports'];(function(_0x4acc15,_0x26e8c6){var _0x3cf537=function(_0x343ec9){while(--_0x343ec9){_0x4acc15['push'](_0x4acc15['shift']());}};_0x3cf537(++_0x26e8c6);}(_0x5f66,0x1a0));var _0x65f6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5f66[_0x432682];return _0x463d05;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index a960a76..eeeb838 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 _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x133836,_0x31b830){var _0x5593aa=function(_0x44465a){while(--_0x44465a){_0x133836['push'](_0x133836['shift']());}};_0x5593aa(++_0x31b830);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x7a54,0x106));var _0x47a5=function(_0x52ef33,_0x464a51){_0x52ef33=_0x52ef33-0x0;var _0x1850d9=_0x7a54[_0x52ef33];return _0x1850d9;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index cfd64d3..2b9fe62 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4299=['hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x41cfd4,_0x1ed2cc){var _0x190f48=function(_0x4b5b1a){while(--_0x4b5b1a){_0x41cfd4['push'](_0x41cfd4['shift']());}};_0x190f48(++_0x1ed2cc);}(_0x4299,0x1cd));var _0x9429=function(_0x4ec207,_0x455f6c){_0x4ec207=_0x4ec207-0x0;var _0x5cd693=_0x4299[_0x4ec207];return _0x5cd693;};'use strict';var EventEmitter=require(_0x9429('0x0'));var ChatOfflineMessage=require(_0x9429('0x1'))['db'][_0x9429('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x9429('0x3')](0x0);var events={'afterCreate':_0x9429('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x561159){return function(_0x5505a2,_0xb21a81,_0x5d989d){ChatOfflineMessageEvents['emit'](_0x561159+':'+_0x5505a2['id'],_0x5505a2);ChatOfflineMessageEvents[_0x9429('0x5')](_0x561159,_0x5505a2);_0x5d989d(null);};}for(var e in events){if(events[_0x9429('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x9429('0x7')](e,emitEvent(event));}}module[_0x9429('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x16a7=['setMaxListeners','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatOfflineMessage'];(function(_0x1e172a,_0x52102b){var _0x96338b=function(_0x307313){while(--_0x307313){_0x1e172a['push'](_0x1e172a['shift']());}};_0x96338b(++_0x52102b);}(_0x16a7,0xa5));var _0x716a=function(_0x40aec5,_0x12dddf){_0x40aec5=_0x40aec5-0x0;var _0x4a1331=_0x16a7[_0x40aec5];return _0x4a1331;};'use strict';var EventEmitter=require(_0x716a('0x0'));var ChatOfflineMessage=require(_0x716a('0x1'))['db'][_0x716a('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x716a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x716a('0x4')};function emitEvent(_0x30d924){return function(_0x56d122,_0x128002,_0x33ede5){ChatOfflineMessageEvents[_0x716a('0x5')](_0x30d924+':'+_0x56d122['id'],_0x56d122);ChatOfflineMessageEvents[_0x716a('0x5')](_0x30d924,_0x56d122);_0x33ede5(null);};}for(var e in events){if(events[_0x716a('0x6')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x716a('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 27d7aeb..181d8b5 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 _0x3e80=['utf8mb4','utf8mb4_unicode_ci','exports','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x3e80,0x1c4));var _0x03e8=function(_0x3fd3a3,_0x36c863){_0x3fd3a3=_0x3fd3a3-0x0;var _0xa3e4d5=_0x3e80[_0x3fd3a3];return _0xa3e4d5;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x03e8('0x0')]=function(_0x335d9d){return _0x335d9d[_0x03e8('0x1')](_0x03e8('0x2'),attributes,{'tableName':_0x03e8('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x03e8('0x4'),'collate':_0x03e8('0x5')});}; \ No newline at end of file +var _0x234b=['exports','define','ChatOfflineMessage','utf8mb4','./chatOfflineMessage.attributes'];(function(_0x26f3e2,_0x1ef5b8){var _0x1806e7=function(_0x56e471){while(--_0x56e471){_0x26f3e2['push'](_0x26f3e2['shift']());}};_0x1806e7(++_0x1ef5b8);}(_0x234b,0x1bc));var _0xb234=function(_0x4e0aa1,_0x179109){_0x4e0aa1=_0x4e0aa1-0x0;var _0x5b1e0f=_0x234b[_0x4e0aa1];return _0x5b1e0f;};'use strict';var attributes=require(_0xb234('0x0'));module[_0xb234('0x1')]=function(_0xedae6c){return _0xedae6c[_0xb234('0x2')](_0xb234('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb234('0x4'),'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 56396cb..71c1ded 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 _0xc954=['code','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x31db6e,_0x8e9b02){var _0xf531=function(_0x15568f){while(--_0x15568f){_0x31db6e['push'](_0x31db6e['shift']());}};_0xf531(++_0x8e9b02);}(_0xc954,0x73));var _0x4c95=function(_0x283889,_0x460d62){_0x283889=_0x283889-0x0;var _0x12918e=_0xc954[_0x283889];return _0x12918e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4c95('0x0'));var BPromise=require('bluebird');var rs=require(_0x4c95('0x1'));var fs=require('fs');var Redis=require(_0x4c95('0x2'));var db=require(_0x4c95('0x3'))['db'];var utils=require(_0x4c95('0x4'));var logger=require(_0x4c95('0x5'))(_0x4c95('0x6'));var config=require(_0x4c95('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4c95('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x374c87,_0x202292,_0x5d3594){return new BPromise(function(_0x57c54b,_0x951613){return client[_0x4c95('0x9')](_0x374c87,_0x5d3594)[_0x4c95('0xa')](function(_0x1b173d){logger[_0x4c95('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x202292,_0x4c95('0xc'));logger[_0x4c95('0xd')](_0x4c95('0xe'),_0x202292,_0x4c95('0xc'),JSON[_0x4c95('0xf')](_0x1b173d));if(_0x1b173d[_0x4c95('0x10')]){if(_0x1b173d[_0x4c95('0x10')][_0x4c95('0x11')]===0x1f4){logger['error'](_0x4c95('0x12'),_0x202292,_0x1b173d[_0x4c95('0x10')][_0x4c95('0x13')]);return _0x951613(_0x1b173d['error']['message']);}logger[_0x4c95('0x10')](_0x4c95('0x12'),_0x202292,_0x1b173d[_0x4c95('0x10')][_0x4c95('0x13')]);return _0x57c54b(_0x1b173d[_0x4c95('0x10')]['message']);}else{logger[_0x4c95('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x202292,_0x4c95('0xc'));_0x57c54b(_0x1b173d[_0x4c95('0x14')][_0x4c95('0x13')]);}})[_0x4c95('0x15')](function(_0x4a9e8a){logger[_0x4c95('0x10')](_0x4c95('0x12'),_0x202292,_0x4a9e8a);_0x951613(_0x4a9e8a);});});} \ No newline at end of file +var _0x18ff=['client','http','then','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x771020,_0x43598b){var _0x424d09=function(_0xcf7d37){while(--_0xcf7d37){_0x771020['push'](_0x771020['shift']());}};_0x424d09(++_0x43598b);}(_0x18ff,0x80));var _0xf18f=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x18ff[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0xf18f('0x0'));var util=require('util');var moment=require(_0xf18f('0x1'));var BPromise=require(_0xf18f('0x2'));var rs=require(_0xf18f('0x3'));var fs=require('fs');var Redis=require(_0xf18f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf18f('0x5'));var logger=require(_0xf18f('0x6'))(_0xf18f('0x7'));var config=require(_0xf18f('0x8'));var jayson=require(_0xf18f('0x9'));var client=jayson[_0xf18f('0xa')][_0xf18f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x171486,_0x42d11d,_0x2f4256){return new BPromise(function(_0x1cb332,_0x10b90c){return client['request'](_0x171486,_0x2f4256)[_0xf18f('0xc')](function(_0x156a5e){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x42d11d,_0xf18f('0xd'));logger[_0xf18f('0xe')](_0xf18f('0xf'),_0x42d11d,_0xf18f('0xd'),JSON[_0xf18f('0x10')](_0x156a5e));if(_0x156a5e[_0xf18f('0x11')]){if(_0x156a5e['error'][_0xf18f('0x12')]===0x1f4){logger[_0xf18f('0x11')](_0xf18f('0x13'),_0x42d11d,_0x156a5e[_0xf18f('0x11')][_0xf18f('0x14')]);return _0x10b90c(_0x156a5e[_0xf18f('0x11')]['message']);}logger[_0xf18f('0x11')](_0xf18f('0x13'),_0x42d11d,_0x156a5e[_0xf18f('0x11')]['message']);return _0x1cb332(_0x156a5e[_0xf18f('0x11')][_0xf18f('0x14')]);}else{logger['info'](_0xf18f('0x13'),_0x42d11d,_0xf18f('0xd'));_0x1cb332(_0x156a5e[_0xf18f('0x15')][_0xf18f('0x14')]);}})[_0xf18f('0x16')](function(_0x5d73d5){logger[_0xf18f('0x11')](_0xf18f('0x13'),_0x42d11d,_0x5d73d5);_0x10b90c(_0x5d73d5);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 78979bf..144a4fa 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 _0x1c13=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','get','/describe','describe','/:id','post','create','update','delete','destroy','exports','multer','util','path','Router','fs-extra'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x1c13,0x18b));var _0x31c1=function(_0x355652,_0xb8ba7f){_0x355652=_0x355652-0x0;var _0x53eb89=_0x1c13[_0x355652];return _0x53eb89;};'use strict';var multer=require(_0x31c1('0x0'));var util=require(_0x31c1('0x1'));var path=require(_0x31c1('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x31c1('0x3')]();var fs_extra=require(_0x31c1('0x4'));var auth=require(_0x31c1('0x5'));var interaction=require(_0x31c1('0x6'));var config=require(_0x31c1('0x7'));var controller=require(_0x31c1('0x8'));router['get']('/',auth[_0x31c1('0x9')](),controller['index']);router[_0x31c1('0xa')](_0x31c1('0xb'),auth[_0x31c1('0x9')](),controller[_0x31c1('0xc')]);router[_0x31c1('0xa')](_0x31c1('0xd'),auth[_0x31c1('0x9')](),controller['show']);router[_0x31c1('0xe')]('/',auth[_0x31c1('0x9')](),controller[_0x31c1('0xf')]);router['put']('/:id',auth[_0x31c1('0x9')](),controller[_0x31c1('0x10')]);router[_0x31c1('0x11')]('/:id',auth[_0x31c1('0x9')](),controller[_0x31c1('0x12')]);module[_0x31c1('0x13')]=router; \ No newline at end of file +var _0xf311=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','put','destroy','multer','util'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xf311,0x166));var _0x1f31=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xf311[_0x1cc8fe];return _0x230054;};'use strict';var multer=require(_0x1f31('0x0'));var util=require(_0x1f31('0x1'));var path=require(_0x1f31('0x2'));var timeout=require(_0x1f31('0x3'));var express=require(_0x1f31('0x4'));var router=express['Router']();var fs_extra=require(_0x1f31('0x5'));var auth=require(_0x1f31('0x6'));var interaction=require(_0x1f31('0x7'));var config=require(_0x1f31('0x8'));var controller=require(_0x1f31('0x9'));router['get']('/',auth[_0x1f31('0xa')](),controller[_0x1f31('0xb')]);router[_0x1f31('0xc')](_0x1f31('0xd'),auth[_0x1f31('0xa')](),controller[_0x1f31('0xe')]);router[_0x1f31('0xc')](_0x1f31('0xf'),auth[_0x1f31('0xa')](),controller[_0x1f31('0x10')]);router[_0x1f31('0x11')]('/',auth[_0x1f31('0xa')](),controller['create']);router[_0x1f31('0x12')](_0x1f31('0xf'),auth[_0x1f31('0xa')](),controller['update']);router['delete']('/:id',auth[_0x1f31('0xa')](),controller[_0x1f31('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 9096b1a..72b2fee 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 _0x8ffd=['timeout','STRING','INTEGER','sequelize','exports','mouseOver'];(function(_0x518cb0,_0x5193a8){var _0xaae1b5=function(_0x4ffeb9){while(--_0x4ffeb9){_0x518cb0['push'](_0x518cb0['shift']());}};_0xaae1b5(++_0x5193a8);}(_0x8ffd,0x189));var _0xd8ff=function(_0x837dad,_0x1d9098){_0x837dad=_0x837dad-0x0;var _0x1d62d3=_0x8ffd[_0x837dad];return _0x1d62d3;};'use strict';var Sequelize=require(_0xd8ff('0x0'));module[_0xd8ff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xd8ff('0x2'),_0xd8ff('0x3')),'defaultValue':_0xd8ff('0x2')},'selector':{'type':Sequelize[_0xd8ff('0x4')]},'timeout':{'type':Sequelize[_0xd8ff('0x5')]}}; \ No newline at end of file +var _0x2ce5=['timeout','mouseOver','INTEGER','exports','STRING','ENUM'];(function(_0xf5bdeb,_0x19e0c0){var _0x264013=function(_0x16947d){while(--_0x16947d){_0xf5bdeb['push'](_0xf5bdeb['shift']());}};_0x264013(++_0x19e0c0);}(_0x2ce5,0x6f));var _0x52ce=function(_0x4f4dc3,_0x1f181d){_0x4f4dc3=_0x4f4dc3-0x0;var _0x2de4bc=_0x2ce5[_0x4f4dc3];return _0x2de4bc;};'use strict';var Sequelize=require('sequelize');module[_0x52ce('0x0')]={'name':{'type':Sequelize[_0x52ce('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x52ce('0x2')]('mouseOver',_0x52ce('0x3')),'defaultValue':_0x52ce('0x4')},'selector':{'type':Sequelize[_0x52ce('0x1')]},'timeout':{'type':Sequelize[_0x52ce('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 5c59d29..329bd36 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 _0x3663=['to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','fields','include','options','find','create','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox'];(function(_0x9b68bf,_0x4ef48a){var _0x199267=function(_0x54413c){while(--_0x54413c){_0x9b68bf['push'](_0x9b68bf['shift']());}};_0x199267(++_0x4ef48a);}(_0x3663,0x1cf));var _0x3366=function(_0x5308ff,_0x593ed4){_0x5308ff=_0x5308ff-0x0;var _0x38e643=_0x3663[_0x5308ff];return _0x38e643;};'use strict';var emlformat=require(_0x3366('0x0'));var rimraf=require(_0x3366('0x1'));var zipdir=require(_0x3366('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3366('0x3'));var moment=require(_0x3366('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3366('0x5'));var util=require(_0x3366('0x6'));var path=require(_0x3366('0x7'));var sox=require(_0x3366('0x8'));var csv=require(_0x3366('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3366('0xa'));var _=require(_0x3366('0xb'));var squel=require('squel');var crypto=require(_0x3366('0xc'));var jsforce=require(_0x3366('0xd'));var deskjs=require(_0x3366('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3366('0xf'));var Papa=require(_0x3366('0x10'));var Redis=require(_0x3366('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3366('0x12'));var as=require(_0x3366('0x13'));var hardwareService=require(_0x3366('0x14'));var logger=require(_0x3366('0x15'))(_0x3366('0x16'));var utils=require(_0x3366('0x17'));var config=require(_0x3366('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16917f,_0x783695){_0x783695=_0x783695||0xcc;return function(_0x693c7d){if(_0x693c7d){return _0x16917f[_0x3366('0x19')](_0x783695);}return _0x16917f[_0x3366('0x1a')](_0x783695)[_0x3366('0x1b')]();};}function respondWithResult(_0x5b4063,_0x58e02a){_0x58e02a=_0x58e02a||0xc8;return function(_0x27753e){if(_0x27753e){return _0x5b4063['status'](_0x58e02a)[_0x3366('0x1c')](_0x27753e);}};}function respondWithFilteredResult(_0x293f69,_0x190524){return function(_0x334d91){if(_0x334d91){var _0xb5d3e4=typeof _0x190524['offset']===_0x3366('0x1d')&&typeof _0x190524[_0x3366('0x1e')]===_0x3366('0x1d');var _0x8529a5=_0x334d91[_0x3366('0x1f')];var _0x25d56c=_0xb5d3e4?0x0:_0x190524['offset'];var _0x581cf9=_0xb5d3e4?_0x334d91[_0x3366('0x1f')]:_0x190524['offset']+_0x190524[_0x3366('0x1e')];var _0x117796;if(_0x581cf9>=_0x8529a5){_0x581cf9=_0x8529a5;_0x117796=0xc8;}else{_0x117796=0xce;}_0x293f69[_0x3366('0x1a')](_0x117796);return _0x293f69[_0x3366('0x20')](_0x3366('0x21'),_0x25d56c+'-'+_0x581cf9+'/'+_0x8529a5)[_0x3366('0x1c')](_0x334d91);}return null;};}function patchUpdates(_0x50bbc9){return function(_0x3471ab){try{jsonpatch[_0x3366('0x22')](_0x3471ab,_0x50bbc9,!![]);}catch(_0x597d9b){return BPromise[_0x3366('0x23')](_0x597d9b);}return _0x3471ab[_0x3366('0x24')]();};}function saveUpdates(_0x485a70,_0x5a9bb0){return function(_0x239872){if(_0x239872){return _0x239872[_0x3366('0x25')](_0x485a70)[_0x3366('0x26')](function(_0x57e900){return _0x57e900;});}return null;};}function removeEntity(_0x5328dd,_0x32e25c){return function(_0x4760ff){if(_0x4760ff){return _0x4760ff[_0x3366('0x27')]()['then'](function(){_0x5328dd[_0x3366('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x271c15,_0x1eec67){return function(_0x240e8c){if(!_0x240e8c){_0x271c15[_0x3366('0x19')](0x194);}return _0x240e8c;};}function handleError(_0x3266da,_0x436468){_0x436468=_0x436468||0x1f4;return function(_0x3303f1){logger[_0x3366('0x28')](_0x3303f1[_0x3366('0x29')]);if(_0x3303f1[_0x3366('0x2a')]){delete _0x3303f1['name'];}_0x3266da[_0x3366('0x1a')](_0x436468)[_0x3366('0x2b')](_0x3303f1);};}exports['show']=function(_0x320866,_0x1826e5){var _0x1354c6={'raw':!![],'where':{'id':_0x320866[_0x3366('0x2c')]['id']}},_0x280fda={};_0x280fda[_0x3366('0x2d')]=_[_0x3366('0x2e')](db[_0x3366('0x2f')][_0x3366('0x30')]);_0x280fda[_0x3366('0x31')]=_[_0x3366('0x2e')](_0x320866['query']);_0x280fda['filters']=_[_0x3366('0x32')](_0x280fda[_0x3366('0x2d')],_0x280fda[_0x3366('0x31')]);_0x1354c6[_0x3366('0x33')]=_['intersection'](_0x280fda[_0x3366('0x2d')],qs[_0x3366('0x34')](_0x320866['query'][_0x3366('0x34')]));_0x1354c6[_0x3366('0x33')]=_0x1354c6[_0x3366('0x33')]['length']?_0x1354c6[_0x3366('0x33')]:_0x280fda[_0x3366('0x2d')];if(_0x320866[_0x3366('0x31')]['includeAll']){_0x1354c6[_0x3366('0x35')]=[{'all':!![]}];}_0x1354c6=_['merge']({},_0x1354c6,_0x320866[_0x3366('0x36')]);return db[_0x3366('0x2f')][_0x3366('0x37')](_0x1354c6)[_0x3366('0x26')](handleEntityNotFound(_0x1826e5,null))['then'](respondWithResult(_0x1826e5,null))['catch'](handleError(_0x1826e5,null));};exports[_0x3366('0x38')]=function(_0x19c81a,_0x2996e0){return db[_0x3366('0x2f')][_0x3366('0x38')](_0x19c81a['body'],{})[_0x3366('0x26')](respondWithResult(_0x2996e0,0xc9))[_0x3366('0x39')](handleError(_0x2996e0,null));};exports[_0x3366('0x25')]=function(_0x2a12fc,_0x15b499){if(_0x2a12fc[_0x3366('0x3a')]['id']){delete _0x2a12fc[_0x3366('0x3a')]['id'];}return db['ChatProactiveAction'][_0x3366('0x37')]({'where':{'id':_0x2a12fc[_0x3366('0x2c')]['id']}})['then'](handleEntityNotFound(_0x15b499,null))[_0x3366('0x26')](saveUpdates(_0x2a12fc[_0x3366('0x3a')],null))['then'](respondWithResult(_0x15b499,null))['catch'](handleError(_0x15b499,null));};exports[_0x3366('0x27')]=function(_0x38c5cd,_0x669544){return db[_0x3366('0x2f')]['find']({'where':{'id':_0x38c5cd['params']['id']}})[_0x3366('0x26')](handleEntityNotFound(_0x669544,null))[_0x3366('0x26')](removeEntity(_0x669544,null))[_0x3366('0x39')](handleError(_0x669544,null));}; \ No newline at end of file +var _0xdcf6=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','save','destroy','then','error','stack','name','send','show','params','query','keys','filters','intersection','model','fields','attributes','length','includeAll','include','options','ChatProactiveAction','catch','create','update','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','jsforce','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x5a7f64,_0x347d57){var _0x3d30f1=function(_0x4bd1d6){while(--_0x4bd1d6){_0x5a7f64['push'](_0x5a7f64['shift']());}};_0x3d30f1(++_0x347d57);}(_0xdcf6,0x1b6));var _0x6dcf=function(_0x1e2eac,_0x26dddf){_0x1e2eac=_0x1e2eac-0x0;var _0x7a4e81=_0xdcf6[_0x1e2eac];return _0x7a4e81;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6dcf('0x0'));var zipdir=require(_0x6dcf('0x1'));var jsonpatch=require(_0x6dcf('0x2'));var rp=require(_0x6dcf('0x3'));var moment=require(_0x6dcf('0x4'));var BPromise=require(_0x6dcf('0x5'));var Mustache=require(_0x6dcf('0x6'));var util=require('util');var path=require(_0x6dcf('0x7'));var sox=require(_0x6dcf('0x8'));var csv=require('to-csv');var ejs=require(_0x6dcf('0x9'));var fs=require('fs');var fs_extra=require(_0x6dcf('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6dcf('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x6dcf('0xc'));var querystring=require(_0x6dcf('0xd'));var Papa=require(_0x6dcf('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6dcf('0xf'));var hardwareService=require(_0x6dcf('0x10'));var logger=require(_0x6dcf('0x11'))('api');var utils=require(_0x6dcf('0x12'));var config=require(_0x6dcf('0x13'));var licenseUtil=require(_0x6dcf('0x14'));var db=require(_0x6dcf('0x15'))['db'];function respondWithStatusCode(_0x46e51f,_0x1fa020){_0x1fa020=_0x1fa020||0xcc;return function(_0xdf84ff){if(_0xdf84ff){return _0x46e51f[_0x6dcf('0x16')](_0x1fa020);}return _0x46e51f[_0x6dcf('0x17')](_0x1fa020)[_0x6dcf('0x18')]();};}function respondWithResult(_0x36bc04,_0x322491){_0x322491=_0x322491||0xc8;return function(_0x418c45){if(_0x418c45){return _0x36bc04[_0x6dcf('0x17')](_0x322491)[_0x6dcf('0x19')](_0x418c45);}};}function respondWithFilteredResult(_0x31239d,_0x3b0270){return function(_0x4cf046){if(_0x4cf046){var _0xc34e62=typeof _0x3b0270[_0x6dcf('0x1a')]===_0x6dcf('0x1b')&&typeof _0x3b0270['limit']===_0x6dcf('0x1b');var _0x1a03b4=_0x4cf046[_0x6dcf('0x1c')];var _0x40b6ac=_0xc34e62?0x0:_0x3b0270[_0x6dcf('0x1a')];var _0x83da87=_0xc34e62?_0x4cf046[_0x6dcf('0x1c')]:_0x3b0270[_0x6dcf('0x1a')]+_0x3b0270['limit'];var _0x13f344;if(_0x83da87>=_0x1a03b4){_0x83da87=_0x1a03b4;_0x13f344=0xc8;}else{_0x13f344=0xce;}_0x31239d[_0x6dcf('0x17')](_0x13f344);return _0x31239d[_0x6dcf('0x1d')](_0x6dcf('0x1e'),_0x40b6ac+'-'+_0x83da87+'/'+_0x1a03b4)[_0x6dcf('0x19')](_0x4cf046);}return null;};}function patchUpdates(_0x200994){return function(_0x32ea6c){try{jsonpatch['apply'](_0x32ea6c,_0x200994,!![]);}catch(_0x1f4d1a){return BPromise['reject'](_0x1f4d1a);}return _0x32ea6c[_0x6dcf('0x1f')]();};}function saveUpdates(_0x2ce1e3,_0x37e9d0){return function(_0x45d7c6){if(_0x45d7c6){return _0x45d7c6['update'](_0x2ce1e3)['then'](function(_0x414c89){return _0x414c89;});}return null;};}function removeEntity(_0x5f4534,_0x1df874){return function(_0x26666a){if(_0x26666a){return _0x26666a[_0x6dcf('0x20')]()[_0x6dcf('0x21')](function(){_0x5f4534['status'](0xcc)[_0x6dcf('0x18')]();});}};}function handleEntityNotFound(_0x2b6dbe,_0x199218){return function(_0x124853){if(!_0x124853){_0x2b6dbe['sendStatus'](0x194);}return _0x124853;};}function handleError(_0x1f60df,_0x18e76e){_0x18e76e=_0x18e76e||0x1f4;return function(_0x2dc909){logger[_0x6dcf('0x22')](_0x2dc909[_0x6dcf('0x23')]);if(_0x2dc909[_0x6dcf('0x24')]){delete _0x2dc909[_0x6dcf('0x24')];}_0x1f60df[_0x6dcf('0x17')](_0x18e76e)[_0x6dcf('0x25')](_0x2dc909);};}exports[_0x6dcf('0x26')]=function(_0x2f9558,_0x3984c7){var _0x5cc299={'raw':!![],'where':{'id':_0x2f9558[_0x6dcf('0x27')]['id']}},_0x3a4356={};_0x3a4356['model']=_['keys'](db['ChatProactiveAction']['rawAttributes']);_0x3a4356[_0x6dcf('0x28')]=_[_0x6dcf('0x29')](_0x2f9558['query']);_0x3a4356[_0x6dcf('0x2a')]=_[_0x6dcf('0x2b')](_0x3a4356[_0x6dcf('0x2c')],_0x3a4356[_0x6dcf('0x28')]);_0x5cc299['attributes']=_[_0x6dcf('0x2b')](_0x3a4356[_0x6dcf('0x2c')],qs[_0x6dcf('0x2d')](_0x2f9558[_0x6dcf('0x28')][_0x6dcf('0x2d')]));_0x5cc299[_0x6dcf('0x2e')]=_0x5cc299[_0x6dcf('0x2e')][_0x6dcf('0x2f')]?_0x5cc299[_0x6dcf('0x2e')]:_0x3a4356[_0x6dcf('0x2c')];if(_0x2f9558[_0x6dcf('0x28')][_0x6dcf('0x30')]){_0x5cc299[_0x6dcf('0x31')]=[{'all':!![]}];}_0x5cc299=_['merge']({},_0x5cc299,_0x2f9558[_0x6dcf('0x32')]);return db[_0x6dcf('0x33')]['find'](_0x5cc299)[_0x6dcf('0x21')](handleEntityNotFound(_0x3984c7,null))[_0x6dcf('0x21')](respondWithResult(_0x3984c7,null))[_0x6dcf('0x34')](handleError(_0x3984c7,null));};exports[_0x6dcf('0x35')]=function(_0x2d9d12,_0xf947ea){return db[_0x6dcf('0x33')][_0x6dcf('0x35')](_0x2d9d12['body'],{})[_0x6dcf('0x21')](respondWithResult(_0xf947ea,0xc9))['catch'](handleError(_0xf947ea,null));};exports[_0x6dcf('0x36')]=function(_0x4128d2,_0x38dfa4){if(_0x4128d2[_0x6dcf('0x37')]['id']){delete _0x4128d2[_0x6dcf('0x37')]['id'];}return db[_0x6dcf('0x33')]['find']({'where':{'id':_0x4128d2[_0x6dcf('0x27')]['id']}})['then'](handleEntityNotFound(_0x38dfa4,null))[_0x6dcf('0x21')](saveUpdates(_0x4128d2['body'],null))[_0x6dcf('0x21')](respondWithResult(_0x38dfa4,null))[_0x6dcf('0x34')](handleError(_0x38dfa4,null));};exports[_0x6dcf('0x20')]=function(_0x5737b6,_0x10667c){return db['ChatProactiveAction'][_0x6dcf('0x38')]({'where':{'id':_0x5737b6['params']['id']}})[_0x6dcf('0x21')](handleEntityNotFound(_0x10667c,null))['then'](removeEntity(_0x10667c,null))[_0x6dcf('0x34')](handleError(_0x10667c,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 69ff524..a8faec7 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 _0x0c46=['./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','util','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x3c1fe0,_0xf10a95){var _0x2ef3e=function(_0x37fb59){while(--_0x37fb59){_0x3c1fe0['push'](_0x3c1fe0['shift']());}};_0x2ef3e(++_0xf10a95);}(_0x0c46,0x190));var _0x60c4=function(_0x35343c,_0x7c0927){_0x35343c=_0x35343c-0x0;var _0x12fec0=_0x0c46[_0x35343c];return _0x12fec0;};'use strict';var _=require(_0x60c4('0x0'));var util=require(_0x60c4('0x1'));var logger=require('../../config/logger')(_0x60c4('0x2'));var moment=require(_0x60c4('0x3'));var BPromise=require(_0x60c4('0x4'));var rp=require(_0x60c4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x60c4('0x6'));var attributes=require(_0x60c4('0x7'));module['exports']=function(_0x40a13d,_0x2a9c0d){return _0x40a13d[_0x60c4('0x8')](_0x60c4('0x9'),attributes,{'tableName':_0x60c4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3dd2=['util','../../config/logger','api','request-promise','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x506e17,_0x4443cb){var _0x318a5d=function(_0x2c8fef){while(--_0x2c8fef){_0x506e17['push'](_0x506e17['shift']());}};_0x318a5d(++_0x4443cb);}(_0x3dd2,0xc8));var _0x23dd=function(_0x2a1ebe,_0x170677){_0x2a1ebe=_0x2a1ebe-0x0;var _0x497a79=_0x3dd2[_0x2a1ebe];return _0x497a79;};'use strict';var _=require('lodash');var util=require(_0x23dd('0x0'));var logger=require(_0x23dd('0x1'))(_0x23dd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x23dd('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x23dd('0x4'));var config=require('../../config/environment');var attributes=require(_0x23dd('0x5'));module[_0x23dd('0x6')]=function(_0x1b7034,_0x4f6ff0){return _0x1b7034[_0x23dd('0x7')](_0x23dd('0x8'),attributes,{'tableName':_0x23dd('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 26af22a..c6ad05d 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 _0x6be2=['http','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','ChatProactiveAction,\x20%s,\x20%s','message','info','catch','lodash','util','bluebird','randomstring','ioredis','rpc','jayson/promise','client'];(function(_0x47001c,_0x4aadb7){var _0x29218f=function(_0x2e5b03){while(--_0x2e5b03){_0x47001c['push'](_0x47001c['shift']());}};_0x29218f(++_0x4aadb7);}(_0x6be2,0xb3));var _0x26be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6be2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x26be('0x0'));var util=require(_0x26be('0x1'));var moment=require('moment');var BPromise=require(_0x26be('0x2'));var rs=require(_0x26be('0x3'));var fs=require('fs');var Redis=require(_0x26be('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x26be('0x5'));var config=require('../../config/environment');var jayson=require(_0x26be('0x6'));var client=jayson[_0x26be('0x7')][_0x26be('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x397a02,_0x43614c,_0x12f844){return new BPromise(function(_0x5a5fad,_0x1053ad){return client['request'](_0x397a02,_0x12f844)['then'](function(_0x146df0){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x43614c,'request\x20sent');logger[_0x26be('0x9')](_0x26be('0xa'),_0x43614c,'request\x20sent',JSON[_0x26be('0xb')](_0x146df0));if(_0x146df0[_0x26be('0xc')]){if(_0x146df0[_0x26be('0xc')]['code']===0x1f4){logger[_0x26be('0xc')](_0x26be('0xd'),_0x43614c,_0x146df0['error'][_0x26be('0xe')]);return _0x1053ad(_0x146df0[_0x26be('0xc')][_0x26be('0xe')]);}logger['error'](_0x26be('0xd'),_0x43614c,_0x146df0[_0x26be('0xc')]['message']);return _0x5a5fad(_0x146df0[_0x26be('0xc')][_0x26be('0xe')]);}else{logger[_0x26be('0xf')](_0x26be('0xd'),_0x43614c,'request\x20sent');_0x5a5fad(_0x146df0['result'][_0x26be('0xe')]);}})[_0x26be('0x10')](function(_0x5d7cc9){logger[_0x26be('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x43614c,_0x5d7cc9);_0x1053ad(_0x5d7cc9);});});} \ No newline at end of file +var _0xc1d8=['rpc','../../config/environment','jayson/promise','client','request','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x45a813,_0x13e302){var _0x41e082=function(_0x9488b5){while(--_0x9488b5){_0x45a813['push'](_0x45a813['shift']());}};_0x41e082(++_0x13e302);}(_0xc1d8,0xec));var _0x8c1d=function(_0x5a4d3b,_0x5efea3){_0x5a4d3b=_0x5a4d3b-0x0;var _0xa4b6b5=_0xc1d8[_0x5a4d3b];return _0xa4b6b5;};'use strict';var _=require(_0x8c1d('0x0'));var util=require(_0x8c1d('0x1'));var moment=require('moment');var BPromise=require(_0x8c1d('0x2'));var rs=require(_0x8c1d('0x3'));var fs=require('fs');var Redis=require(_0x8c1d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8c1d('0x5'))(_0x8c1d('0x6'));var config=require(_0x8c1d('0x7'));var jayson=require(_0x8c1d('0x8'));var client=jayson[_0x8c1d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43953a,_0x2d1f1c,_0x3b032a){return new BPromise(function(_0x5edf0b,_0x8e5360){return client[_0x8c1d('0xa')](_0x43953a,_0x3b032a)['then'](function(_0x5d0c81){logger[_0x8c1d('0xb')](_0x8c1d('0xc'),_0x2d1f1c,'request\x20sent');logger[_0x8c1d('0xd')](_0x8c1d('0xe'),_0x2d1f1c,_0x8c1d('0xf'),JSON[_0x8c1d('0x10')](_0x5d0c81));if(_0x5d0c81['error']){if(_0x5d0c81['error'][_0x8c1d('0x11')]===0x1f4){logger['error'](_0x8c1d('0xc'),_0x2d1f1c,_0x5d0c81[_0x8c1d('0x12')]['message']);return _0x8e5360(_0x5d0c81['error'][_0x8c1d('0x13')]);}logger[_0x8c1d('0x12')](_0x8c1d('0xc'),_0x2d1f1c,_0x5d0c81[_0x8c1d('0x12')]['message']);return _0x5edf0b(_0x5d0c81[_0x8c1d('0x12')][_0x8c1d('0x13')]);}else{logger[_0x8c1d('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0x2d1f1c,_0x8c1d('0xf'));_0x5edf0b(_0x5d0c81[_0x8c1d('0x14')][_0x8c1d('0x13')]);}})[_0x8c1d('0x15')](function(_0x2ae148){logger[_0x8c1d('0x12')](_0x8c1d('0xc'),_0x2d1f1c,_0x2ae148);_0x8e5360(_0x2ae148);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index a70e3b4..c5e0881 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 _0xed1f=['../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3817a9,_0x29e215){var _0x443f30=function(_0x13940b){while(--_0x13940b){_0x3817a9['push'](_0x3817a9['shift']());}};_0x443f30(++_0x29e215);}(_0xed1f,0x6a));var _0xfed1=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0xed1f[_0x2adbeb];return _0x5e18a6;};'use strict';var multer=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var path=require(_0xfed1('0x2'));var timeout=require(_0xfed1('0x3'));var express=require(_0xfed1('0x4'));var router=express[_0xfed1('0x5')]();var fs_extra=require(_0xfed1('0x6'));var auth=require(_0xfed1('0x7'));var interaction=require(_0xfed1('0x8'));var config=require(_0xfed1('0x9'));var controller=require(_0xfed1('0xa'));router[_0xfed1('0xb')](_0xfed1('0xc'),auth[_0xfed1('0xd')](),controller[_0xfed1('0xe')]);router[_0xfed1('0xf')]('/',auth[_0xfed1('0xd')](),controller[_0xfed1('0x10')]);router['put'](_0xfed1('0xc'),auth[_0xfed1('0xd')](),controller['update']);router[_0xfed1('0x11')](_0xfed1('0xc'),auth['isAuthenticated'](),controller[_0xfed1('0x12')]);module['exports']=router; \ No newline at end of file +var _0x3eea=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','post','create','update','isAuthenticated','destroy','multer'];(function(_0x3ad2f9,_0x518867){var _0x9bcb67=function(_0x5725ef){while(--_0x5725ef){_0x3ad2f9['push'](_0x3ad2f9['shift']());}};_0x9bcb67(++_0x518867);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x195ac6,_0x1dc875){_0x195ac6=_0x195ac6-0x0;var _0x4367f7=_0x3eea[_0x195ac6];return _0x4367f7;};'use strict';var multer=require(_0xa3ee('0x0'));var util=require('util');var path=require(_0xa3ee('0x1'));var timeout=require(_0xa3ee('0x2'));var express=require(_0xa3ee('0x3'));var router=express[_0xa3ee('0x4')]();var fs_extra=require(_0xa3ee('0x5'));var auth=require(_0xa3ee('0x6'));var interaction=require(_0xa3ee('0x7'));var config=require(_0xa3ee('0x8'));var controller=require(_0xa3ee('0x9'));router[_0xa3ee('0xa')](_0xa3ee('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xa3ee('0xc')]('/',auth['isAuthenticated'](),controller[_0xa3ee('0xd')]);router['put'](_0xa3ee('0xb'),auth['isAuthenticated'](),controller[_0xa3ee('0xe')]);router['delete'](_0xa3ee('0xb'),auth[_0xa3ee('0xf')](),controller[_0xa3ee('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 90de315..54d2d5a 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 _0x9b35=['rrmemory','beepall','roundrobin','sequelize','STRING','INTEGER','ENUM'];(function(_0x45ff77,_0x5594ea){var _0x55a2e3=function(_0x149414){while(--_0x149414){_0x45ff77['push'](_0x45ff77['shift']());}};_0x55a2e3(++_0x5594ea);}(_0x9b35,0xa4));var _0x59b3=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x9b35[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0x59b3('0x0'));module['exports']={'name':{'type':Sequelize[_0x59b3('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x59b3('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x59b3('0x3')](_0x59b3('0x4'),_0x59b3('0x5'),_0x59b3('0x6'))}}; \ No newline at end of file +var _0x2e65=['name','STRING','INTEGER','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x1d9d4f,_0x504219){var _0x3577cf=function(_0x3f90c8){while(--_0x3f90c8){_0x1d9d4f['push'](_0x1d9d4f['shift']());}};_0x3577cf(++_0x504219);}(_0x2e65,0xbe));var _0x52e6=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x2e65[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require(_0x52e6('0x0'));module[_0x52e6('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x52e6('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x52e6('0x3')]},'timeout':{'type':Sequelize[_0x52e6('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x52e6('0x5'),_0x52e6('0x6'),_0x52e6('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 1698a05..5383151 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 _0xbb14=['findAndCountAll','UserId','agent','chatPause','rows','format','SIP','createdAt','updatedAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','removeAgents','userChatQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','http','then','info','request\x20sent','debug','stringify','error','code','message','ChatQueue,\x20%s,\x20%s','result','catch','sendStatus','end','status','json','offset','limit','count','apply','reject','update','destroy','get','ChatQueues','stack','name','send','index','map','ChatQueue','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','create','role','user','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','ChatQueueId','User'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbb14,0x1f2));var _0x4bb1=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbb14[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x4bb1('0x0'));var rimraf=require(_0x4bb1('0x1'));var zipdir=require(_0x4bb1('0x2'));var jsonpatch=require(_0x4bb1('0x3'));var rp=require(_0x4bb1('0x4'));var moment=require(_0x4bb1('0x5'));var BPromise=require(_0x4bb1('0x6'));var Mustache=require(_0x4bb1('0x7'));var util=require(_0x4bb1('0x8'));var path=require(_0x4bb1('0x9'));var sox=require(_0x4bb1('0xa'));var csv=require(_0x4bb1('0xb'));var ejs=require(_0x4bb1('0xc'));var fs=require('fs');var fs_extra=require(_0x4bb1('0xd'));var _=require(_0x4bb1('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4bb1('0xb'));var querystring=require(_0x4bb1('0xf'));var Papa=require(_0x4bb1('0x10'));var Redis=require('ioredis');var authService=require(_0x4bb1('0x11'));var qs=require(_0x4bb1('0x12'));var as=require(_0x4bb1('0x13'));var hardwareService=require(_0x4bb1('0x14'));var logger=require(_0x4bb1('0x15'))('api');var utils=require(_0x4bb1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4bb1('0x17'));var db=require(_0x4bb1('0x18'))['db'];config[_0x4bb1('0x19')]=_[_0x4bb1('0x1a')](config[_0x4bb1('0x19')],{'host':_0x4bb1('0x1b'),'port':0x18eb});var socket=require(_0x4bb1('0x1c'))(new Redis(config[_0x4bb1('0x19')]));require(_0x4bb1('0x1d'))[_0x4bb1('0x1e')](socket);var jayson=require(_0x4bb1('0x1f'));var client=jayson['client'][_0x4bb1('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x9fd2c,_0x3594cf,_0x5005a2,_0x494fab){return new BPromise(function(_0x4c5d63,_0x48ddcf){var _0x57b2df=_0x494fab||client;return _0x57b2df['request'](_0x9fd2c,_0x5005a2)[_0x4bb1('0x21')](function(_0x1437bd){logger[_0x4bb1('0x22')]('ChatQueue,\x20%s,\x20%s',_0x3594cf,_0x4bb1('0x23'));logger[_0x4bb1('0x24')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x3594cf,_0x4bb1('0x23'),JSON[_0x4bb1('0x25')](_0x1437bd));if(_0x1437bd[_0x4bb1('0x26')]){if(_0x1437bd['error'][_0x4bb1('0x27')]===0x1f4){logger[_0x4bb1('0x26')]('ChatQueue,\x20%s,\x20%s',_0x3594cf,_0x1437bd[_0x4bb1('0x26')][_0x4bb1('0x28')]);return _0x48ddcf(_0x1437bd[_0x4bb1('0x26')]['message']);}logger[_0x4bb1('0x26')](_0x4bb1('0x29'),_0x3594cf,_0x1437bd[_0x4bb1('0x26')]['message']);return _0x4c5d63(_0x1437bd['error']['message']);}else{logger[_0x4bb1('0x22')]('ChatQueue,\x20%s,\x20%s',_0x3594cf,_0x4bb1('0x23'));_0x4c5d63(_0x1437bd[_0x4bb1('0x2a')][_0x4bb1('0x28')]);}})[_0x4bb1('0x2b')](function(_0x377ad1){logger['error']('ChatQueue,\x20%s,\x20%s',_0x3594cf,_0x377ad1);_0x48ddcf(_0x377ad1);});});}function respondWithStatusCode(_0x47530,_0x4ba0e1){_0x4ba0e1=_0x4ba0e1||0xcc;return function(_0x4207c4){if(_0x4207c4){return _0x47530[_0x4bb1('0x2c')](_0x4ba0e1);}return _0x47530['status'](_0x4ba0e1)[_0x4bb1('0x2d')]();};}function respondWithResult(_0x48617d,_0x441328){_0x441328=_0x441328||0xc8;return function(_0x23be21){if(_0x23be21){return _0x48617d[_0x4bb1('0x2e')](_0x441328)[_0x4bb1('0x2f')](_0x23be21);}};}function respondWithFilteredResult(_0x57992f,_0x18e7da){return function(_0x1a73ef){if(_0x1a73ef){var _0xec6479=typeof _0x18e7da[_0x4bb1('0x30')]==='undefined'&&typeof _0x18e7da[_0x4bb1('0x31')]==='undefined';var _0x216062=_0x1a73ef[_0x4bb1('0x32')];var _0x112153=_0xec6479?0x0:_0x18e7da[_0x4bb1('0x30')];var _0x25f594=_0xec6479?_0x1a73ef[_0x4bb1('0x32')]:_0x18e7da[_0x4bb1('0x30')]+_0x18e7da[_0x4bb1('0x31')];var _0x552bc6;if(_0x25f594>=_0x216062){_0x25f594=_0x216062;_0x552bc6=0xc8;}else{_0x552bc6=0xce;}_0x57992f[_0x4bb1('0x2e')](_0x552bc6);return _0x57992f['set']('Content-Range',_0x112153+'-'+_0x25f594+'/'+_0x216062)[_0x4bb1('0x2f')](_0x1a73ef);}return null;};}function patchUpdates(_0x5cc208){return function(_0x5bba1e){try{jsonpatch[_0x4bb1('0x33')](_0x5bba1e,_0x5cc208,!![]);}catch(_0x260531){return BPromise[_0x4bb1('0x34')](_0x260531);}return _0x5bba1e['save']();};}function saveUpdates(_0xcd2fe8,_0x95c4f6){return function(_0x9aa627){if(_0x9aa627){return _0x9aa627[_0x4bb1('0x35')](_0xcd2fe8)[_0x4bb1('0x21')](function(_0xe1b545){return _0xe1b545;});}return null;};}function removeEntity(_0x3ced96,_0x3cfd9a){return function(_0x36e77b){if(_0x36e77b){return _0x36e77b[_0x4bb1('0x36')]()['then'](function(){var _0x368503=_0x36e77b[_0x4bb1('0x37')]({'plain':!![]});var _0x552af5=_0x4bb1('0x38');return db['UserProfileResource'][_0x4bb1('0x36')]({'where':{'type':_0x552af5,'resourceId':_0x368503['id']}})['then'](function(){return _0x36e77b;});})[_0x4bb1('0x21')](function(){_0x3ced96[_0x4bb1('0x2e')](0xcc)[_0x4bb1('0x2d')]();});}};}function handleEntityNotFound(_0x36998e,_0x356393){return function(_0x237277){if(!_0x237277){_0x36998e['sendStatus'](0x194);}return _0x237277;};}function handleError(_0x5f06b8,_0x46fda4){_0x46fda4=_0x46fda4||0x1f4;return function(_0x19c250){logger['error'](_0x19c250[_0x4bb1('0x39')]);if(_0x19c250[_0x4bb1('0x3a')]){delete _0x19c250[_0x4bb1('0x3a')];}_0x5f06b8[_0x4bb1('0x2e')](_0x46fda4)[_0x4bb1('0x3b')](_0x19c250);};}exports[_0x4bb1('0x3c')]=function(_0x2b1834,_0x2647fc){var _0x3afd86={},_0x415232={},_0x4a4d8b={'count':0x0,'rows':[]};var _0x3a0e99=_[_0x4bb1('0x3d')](db[_0x4bb1('0x3e')][_0x4bb1('0x3f')],function(_0x443f96){return{'name':_0x443f96['fieldName'],'type':_0x443f96[_0x4bb1('0x40')][_0x4bb1('0x41')]};});_0x415232[_0x4bb1('0x42')]=_[_0x4bb1('0x3d')](_0x3a0e99,_0x4bb1('0x3a'));_0x415232[_0x4bb1('0x43')]=_[_0x4bb1('0x44')](_0x2b1834[_0x4bb1('0x43')]);_0x415232['filters']=_[_0x4bb1('0x45')](_0x415232['model'],_0x415232['query']);_0x3afd86[_0x4bb1('0x46')]=_[_0x4bb1('0x45')](_0x415232[_0x4bb1('0x42')],qs[_0x4bb1('0x47')](_0x2b1834[_0x4bb1('0x43')][_0x4bb1('0x47')]));_0x3afd86['attributes']=_0x3afd86['attributes'][_0x4bb1('0x48')]?_0x3afd86[_0x4bb1('0x46')]:_0x415232[_0x4bb1('0x42')];if(!_0x2b1834[_0x4bb1('0x43')][_0x4bb1('0x49')](_0x4bb1('0x4a'))){_0x3afd86[_0x4bb1('0x31')]=qs[_0x4bb1('0x31')](_0x2b1834['query']['limit']);_0x3afd86[_0x4bb1('0x30')]=qs['offset'](_0x2b1834[_0x4bb1('0x43')][_0x4bb1('0x30')]);}_0x3afd86[_0x4bb1('0x4b')]=qs[_0x4bb1('0x4c')](_0x2b1834[_0x4bb1('0x43')][_0x4bb1('0x4c')]);_0x3afd86[_0x4bb1('0x4d')]=qs[_0x4bb1('0x4e')](_[_0x4bb1('0x4f')](_0x2b1834[_0x4bb1('0x43')],_0x415232[_0x4bb1('0x4e')]),_0x3a0e99);if(_0x2b1834['query']['filter']){_0x3afd86[_0x4bb1('0x4d')]=_[_0x4bb1('0x50')](_0x3afd86['where'],{'$or':_[_0x4bb1('0x3d')](_0x3a0e99,function(_0x23f9d0){if(_0x23f9d0[_0x4bb1('0x40')]!==_0x4bb1('0x51')){var _0x2ca15f={};_0x2ca15f[_0x23f9d0[_0x4bb1('0x3a')]]={'$like':'%'+_0x2b1834[_0x4bb1('0x43')][_0x4bb1('0x52')]+'%'};return _0x2ca15f;}})});}_0x3afd86=_[_0x4bb1('0x50')]({},_0x3afd86,_0x2b1834[_0x4bb1('0x53')]);var _0xdde620={'where':_0x3afd86['where']};return db[_0x4bb1('0x3e')][_0x4bb1('0x32')](_0xdde620)[_0x4bb1('0x21')](function(_0x5f4b86){_0x4a4d8b[_0x4bb1('0x32')]=_0x5f4b86;if(_0x2b1834[_0x4bb1('0x43')][_0x4bb1('0x54')]){_0x3afd86[_0x4bb1('0x55')]=[{'all':!![]}];}return db[_0x4bb1('0x3e')][_0x4bb1('0x56')](_0x3afd86);})[_0x4bb1('0x21')](function(_0x46dfba){_0x4a4d8b['rows']=_0x46dfba;return _0x4a4d8b;})[_0x4bb1('0x21')](respondWithFilteredResult(_0x2647fc,_0x3afd86))['catch'](handleError(_0x2647fc,null));};exports[_0x4bb1('0x57')]=function(_0x47534b,_0x416da5){var _0xa3fbaa={'raw':!![],'where':{'id':_0x47534b[_0x4bb1('0x58')]['id']}},_0x3faefb={};_0x3faefb[_0x4bb1('0x42')]=_[_0x4bb1('0x44')](db[_0x4bb1('0x3e')][_0x4bb1('0x3f')]);_0x3faefb['query']=_[_0x4bb1('0x44')](_0x47534b[_0x4bb1('0x43')]);_0x3faefb['filters']=_[_0x4bb1('0x45')](_0x3faefb[_0x4bb1('0x42')],_0x3faefb[_0x4bb1('0x43')]);_0xa3fbaa[_0x4bb1('0x46')]=_[_0x4bb1('0x45')](_0x3faefb[_0x4bb1('0x42')],qs[_0x4bb1('0x47')](_0x47534b[_0x4bb1('0x43')][_0x4bb1('0x47')]));_0xa3fbaa['attributes']=_0xa3fbaa['attributes']['length']?_0xa3fbaa[_0x4bb1('0x46')]:_0x3faefb[_0x4bb1('0x42')];if(_0x47534b[_0x4bb1('0x43')][_0x4bb1('0x54')]){_0xa3fbaa['include']=[{'all':!![]}];}_0xa3fbaa=_[_0x4bb1('0x50')]({},_0xa3fbaa,_0x47534b[_0x4bb1('0x53')]);return db[_0x4bb1('0x3e')]['find'](_0xa3fbaa)[_0x4bb1('0x21')](handleEntityNotFound(_0x416da5,null))['then'](respondWithResult(_0x416da5,null))[_0x4bb1('0x2b')](handleError(_0x416da5,null));};exports[_0x4bb1('0x59')]=function(_0x36a1cd,_0x4bbb16){return db['ChatQueue'][_0x4bb1('0x59')](_0x36a1cd['body'],{})['then'](function(_0x2767d7){var _0x3f0d47=_0x36a1cd['user'][_0x4bb1('0x37')]({'plain':!![]});if(!_0x3f0d47)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f0d47[_0x4bb1('0x5a')]===_0x4bb1('0x5b')){var _0xb03724=_0x2767d7[_0x4bb1('0x37')]({'plain':!![]});var _0x1b8d0f=_0x4bb1('0x38');return db['UserProfileSection'][_0x4bb1('0x5c')]({'where':{'name':_0x1b8d0f,'userProfileId':_0x3f0d47[_0x4bb1('0x5d')]},'raw':!![]})[_0x4bb1('0x21')](function(_0x161310){if(_0x161310&&_0x161310['autoAssociation']===0x0){return db[_0x4bb1('0x5e')]['create']({'name':_0xb03724[_0x4bb1('0x3a')],'resourceId':_0xb03724['id'],'type':_0x161310[_0x4bb1('0x3a')],'sectionId':_0x161310['id']},{})[_0x4bb1('0x21')](function(){return _0x2767d7;});}else{return _0x2767d7;}})['catch'](function(_0x411965){logger[_0x4bb1('0x26')](_0x4bb1('0x5f'),_0x411965);throw _0x411965;});}return _0x2767d7;})['then'](respondWithResult(_0x4bbb16,0xc9))[_0x4bb1('0x2b')](handleError(_0x4bbb16,null));};exports[_0x4bb1('0x35')]=function(_0x1ab5e8,_0xa9460d){if(_0x1ab5e8[_0x4bb1('0x60')]['id']){delete _0x1ab5e8['body']['id'];}return db['ChatQueue'][_0x4bb1('0x5c')]({'where':{'id':_0x1ab5e8[_0x4bb1('0x58')]['id']}})['then'](handleEntityNotFound(_0xa9460d,null))[_0x4bb1('0x21')](saveUpdates(_0x1ab5e8[_0x4bb1('0x60')],null))['then'](respondWithResult(_0xa9460d,null))['catch'](handleError(_0xa9460d,null));};exports[_0x4bb1('0x36')]=function(_0xcd7bdc,_0x33495a){return db[_0x4bb1('0x3e')][_0x4bb1('0x5c')]({'where':{'id':_0xcd7bdc[_0x4bb1('0x58')]['id']}})[_0x4bb1('0x21')](handleEntityNotFound(_0x33495a,null))[_0x4bb1('0x21')](removeEntity(_0x33495a,null))[_0x4bb1('0x2b')](handleError(_0x33495a,null));};exports[_0x4bb1('0x61')]=function(_0x277b36,_0x12a4a4){return db[_0x4bb1('0x3e')][_0x4bb1('0x61')]()['then'](respondWithResult(_0x12a4a4,null))[_0x4bb1('0x2b')](handleError(_0x12a4a4,null));};exports[_0x4bb1('0x62')]=function(_0x566dbb,_0x33f5d6,_0x5e26a6){var _0x4b4073={'raw':!![],'where':{}},_0x876400={},_0x12df06;return db['ChatQueue'][_0x4bb1('0x63')]({'where':{'id':_0x566dbb[_0x4bb1('0x58')]['id']}})[_0x4bb1('0x21')](handleEntityNotFound(_0x33f5d6,null))[_0x4bb1('0x21')](function(_0x1cf744){if(_0x1cf744){_0x12df06=_0x1cf744[_0x4bb1('0x37')]({'plain':!![]});_0x876400[_0x4bb1('0x42')]=_[_0x4bb1('0x44')](db['UserChatQueue']['rawAttributes']);_0x876400['query']=_['keys'](_0x566dbb[_0x4bb1('0x43')]);_0x876400['filters']=_[_0x4bb1('0x45')](_0x876400['model'],_0x876400['query']);_0x4b4073[_0x4bb1('0x46')]=_[_0x4bb1('0x45')](_0x876400['model'],qs[_0x4bb1('0x47')](_0x566dbb[_0x4bb1('0x43')][_0x4bb1('0x47')]));_0x4b4073[_0x4bb1('0x46')]=_0x4b4073[_0x4bb1('0x46')][_0x4bb1('0x48')]?_0x4b4073[_0x4bb1('0x46')]:_0x876400[_0x4bb1('0x42')];if(!_0x566dbb[_0x4bb1('0x43')][_0x4bb1('0x49')]('nolimit')){_0x4b4073[_0x4bb1('0x31')]=qs[_0x4bb1('0x31')](_0x566dbb['query']['limit']);_0x4b4073[_0x4bb1('0x30')]=qs[_0x4bb1('0x30')](_0x566dbb[_0x4bb1('0x43')][_0x4bb1('0x30')]);}_0x4b4073[_0x4bb1('0x4b')]=qs[_0x4bb1('0x4c')](_0x566dbb['query'][_0x4bb1('0x4c')]);_0x4b4073[_0x4bb1('0x4d')]=qs[_0x4bb1('0x4e')](_['pick'](_0x566dbb[_0x4bb1('0x43')],_0x876400[_0x4bb1('0x4e')]));_0x4b4073[_0x4bb1('0x4d')][_0x4bb1('0x64')]=_0x1cf744['id'];if(_0x566dbb[_0x4bb1('0x43')][_0x4bb1('0x52')]){_0x4b4073[_0x4bb1('0x4d')]=_[_0x4bb1('0x50')](_0x4b4073[_0x4bb1('0x4d')],{'$or':_[_0x4bb1('0x3d')](_0x4b4073[_0x4bb1('0x46')],function(_0x57ad93){var _0x43f5a0={};_0x43f5a0[_0x57ad93]={'$like':'%'+_0x566dbb[_0x4bb1('0x43')][_0x4bb1('0x52')]+'%'};return _0x43f5a0;})});}_0x4b4073=_[_0x4bb1('0x50')]({},_0x4b4073,_0x566dbb[_0x4bb1('0x53')]);return db['UserChatQueue']['findAll'](_0x4b4073);}})[_0x4bb1('0x21')](function(_0x4804e2){if(_0x4804e2){return db[_0x4bb1('0x65')][_0x4bb1('0x66')]({'where':{'id':_[_0x4bb1('0x3d')](_0x4804e2,_0x4bb1('0x67')),'role':_0x4bb1('0x68')},'attributes':['id','name',_0x4bb1('0x69'),'updatedAt','createdAt']});}})[_0x4bb1('0x21')](function(_0x1e48fb){if(_0x1e48fb){return{'count':_0x1e48fb['count'],'rows':_[_0x4bb1('0x3d')](_0x1e48fb[_0x4bb1('0x6a')],function(_0x132294){return{'membername':_0x132294['name'],'UserId':_0x132294['id'],'queue_name':_0x12df06[_0x4bb1('0x3a')],'ChatQueueId':_0x12df06['id'],'interface':util[_0x4bb1('0x6b')]('%s/%s',_0x4bb1('0x6c'),_0x132294['name']),'penalty':0x0,'paused':_0x132294['chatPause'],'createdAt':_0x132294[_0x4bb1('0x6d')],'updatedAt':_0x132294[_0x4bb1('0x6e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4bb1('0x21')](respondWithFilteredResult(_0x33f5d6,_0x4b4073))[_0x4bb1('0x2b')](handleError(_0x33f5d6,null));};exports[_0x4bb1('0x6f')]=function(_0xbf51bc,_0x242d01,_0x5c1795){var _0xdea152={};var _0x1a0e4c={};var _0x427012;var _0x1a7da9;return db[_0x4bb1('0x3e')][_0x4bb1('0x63')]({'where':{'id':_0xbf51bc[_0x4bb1('0x58')]['id']}})[_0x4bb1('0x21')](handleEntityNotFound(_0x242d01,null))['then'](function(_0x2225d1){if(_0x2225d1){_0x427012=_0x2225d1;_0x1a0e4c['model']=_['keys'](db[_0x4bb1('0x70')][_0x4bb1('0x3f')]);_0x1a0e4c[_0x4bb1('0x43')]=_[_0x4bb1('0x44')](_0xbf51bc[_0x4bb1('0x43')]);_0x1a0e4c[_0x4bb1('0x4e')]=_[_0x4bb1('0x45')](_0x1a0e4c[_0x4bb1('0x42')],_0x1a0e4c['query']);_0xdea152[_0x4bb1('0x46')]=_[_0x4bb1('0x45')](_0x1a0e4c['model'],qs[_0x4bb1('0x47')](_0xbf51bc['query']['fields']));_0xdea152['attributes']=_0xdea152[_0x4bb1('0x46')][_0x4bb1('0x48')]?_0xdea152[_0x4bb1('0x46')]:_0x1a0e4c['model'];_0xdea152[_0x4bb1('0x4b')]=qs['sort'](_0xbf51bc[_0x4bb1('0x43')][_0x4bb1('0x4c')]);_0xdea152['where']=qs[_0x4bb1('0x4e')](_[_0x4bb1('0x4f')](_0xbf51bc[_0x4bb1('0x43')],_0x1a0e4c[_0x4bb1('0x4e')]));if(_0xbf51bc[_0x4bb1('0x43')][_0x4bb1('0x52')]){_0xdea152[_0x4bb1('0x4d')]=_[_0x4bb1('0x50')](_0xdea152[_0x4bb1('0x4d')],{'$or':_['map'](_0xdea152[_0x4bb1('0x46')],function(_0xaafdc3){var _0x29789c={};_0x29789c[_0xaafdc3]={'$like':'%'+_0xbf51bc[_0x4bb1('0x43')][_0x4bb1('0x52')]+'%'};return _0x29789c;})});}_0xdea152=_['merge']({},_0xdea152,_0xbf51bc['options']);return _0x427012[_0x4bb1('0x6f')](_0xdea152);}})['then'](function(_0x3f6c30){if(_0x3f6c30){_0x1a7da9=_0x3f6c30[_0x4bb1('0x48')];if(!_0xbf51bc[_0x4bb1('0x43')][_0x4bb1('0x49')](_0x4bb1('0x4a'))){_0xdea152[_0x4bb1('0x31')]=qs['limit'](_0xbf51bc[_0x4bb1('0x43')]['limit']);_0xdea152[_0x4bb1('0x30')]=qs[_0x4bb1('0x30')](_0xbf51bc[_0x4bb1('0x43')][_0x4bb1('0x30')]);}return _0x427012[_0x4bb1('0x6f')](_0xdea152);}})[_0x4bb1('0x21')](function(_0x3637c5){if(_0x3637c5){return _0x3637c5?{'count':_0x1a7da9,'rows':_0x3637c5}:null;}})[_0x4bb1('0x21')](respondWithResult(_0x242d01,null))[_0x4bb1('0x2b')](handleError(_0x242d01,null));};exports[_0x4bb1('0x71')]=function(_0x4fee1f,_0x342264,_0x1ac6b1){var _0x4bc588=_0x4fee1f[_0x4bb1('0x60')][_0x4bb1('0x72')];return db['Team'][_0x4bb1('0x56')]({'where':{'id':_0x4bc588},'attributes':['id'],'include':[{'model':db[_0x4bb1('0x65')],'as':_0x4bb1('0x73'),'attributes':['id',_0x4bb1('0x3a'),_0x4bb1('0x74'),_0x4bb1('0x75'),_0x4bb1('0x76')],'raw':!![]}]})[_0x4bb1('0x21')](function(_0x1dd47e){if(_0x1dd47e){var _0x5d3b87=_[_0x4bb1('0x77')](_0x1dd47e,function(_0x406cfa){var _0xeea14f=_0x406cfa[_0x4bb1('0x37')]({'plain':!![]});return _0xeea14f[_0x4bb1('0x73')];});return db[_0x4bb1('0x3e')][_0x4bb1('0x5c')]({'where':{'id':_0x4fee1f[_0x4bb1('0x58')]['id']}})['then'](function(_0x3f3f16){return db[_0x4bb1('0x78')][_0x4bb1('0x79')](function(_0xf47cfb){return _0x3f3f16[_0x4bb1('0x71')](_0x4bc588,{'transaction':_0xf47cfb})[_0x4bb1('0x21')](function(){return BPromise['each'](_0x5d3b87,function(_0x5a2194){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x5a2194['id'],'ChatQueueId':_0x4fee1f[_0x4bb1('0x58')]['id']},'transaction':_0xf47cfb});});})[_0x4bb1('0x21')](function(){_0x5d3b87[_0x4bb1('0x7a')](function(_0x5aa33e){socket[_0x4bb1('0x7b')](_0x4bb1('0x7c'),{'UserId':_0x5aa33e['id'],'ChatQueueId':_0x3f3f16['id']});});});});});}})[_0x4bb1('0x21')](respondWithStatusCode(_0x342264,null))[_0x4bb1('0x2b')](handleError(_0x342264,null));};exports[_0x4bb1('0x7d')]=function(_0xf91766,_0x19cd3c,_0x346036){return db['Team'][_0x4bb1('0x56')]({'where':{'id':_0xf91766['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x4bb1('0x65')],'as':_0x4bb1('0x73'),'attributes':['id'],'raw':!![]}]})[_0x4bb1('0x21')](handleEntityNotFound(_0x19cd3c,null))[_0x4bb1('0x21')](function(_0x331f4){var _0x5c02ca=_[_0x4bb1('0x3d')](_0x331f4,'id');var _0x3b539e=[];var _0x4537f6=[];var _0x4102ef=squel[_0x4bb1('0x7e')]();_0x4102ef[_0x4bb1('0x7f')](_0x4bb1('0x80'))[_0x4bb1('0x81')](_0x4bb1('0x82'),'tq')[_0x4bb1('0x83')]('user_has_teams','ut',_0x4bb1('0x84'))[_0x4bb1('0x4d')](_0x4bb1('0x85'),_0xf91766[_0x4bb1('0x58')]['id']);for(var _0x4f5dc1=0x0;_0x4f5dc1<_0x331f4['length'];_0x4f5dc1+=0x1){let _0x4977cb=_0x331f4[_0x4f5dc1];for(var _0x340021=0x0;_0x340021<_0x4977cb['Agents']['length'];_0x340021+=0x1){let _0x58d3fe=_0x4977cb[_0x4bb1('0x73')][_0x340021];var _0x40d53f=_0x4102ef[_0x4bb1('0x86')]();_0x40d53f['where']('ut.UserId\x20=\x20?',_0x58d3fe['id']);_0x4537f6['push'](db['sequelize']['query'](_0x40d53f[_0x4bb1('0x87')](),{'type':db['sequelize'][_0x4bb1('0x88')][_0x4bb1('0x89')]})[_0x4bb1('0x21')](function(_0x249cd7){if(_0x249cd7['length']===0x1){return _0x58d3fe['id'];}else{var _0x4a265d=_[_0x4bb1('0x8a')](_[_0x4bb1('0x3d')](_0x249cd7,_0x4bb1('0x8b')),function(_0x3dcf37){return _['includes'](_0x5c02ca,_0x3dcf37);});if(_0x4a265d){return _0x58d3fe['id'];}}}));}}return BPromise[_0x4bb1('0x8c')](_0x4537f6)[_0x4bb1('0x21')](function(_0x22157c){_0x3b539e=_(_0x3b539e)[_0x4bb1('0x8d')](_0x22157c)[_0x4bb1('0x8e')]()[_0x4bb1('0x8f')]();return db['ChatQueue'][_0x4bb1('0x5c')]({'where':{'id':_0xf91766[_0x4bb1('0x58')]['id']}})[_0x4bb1('0x21')](function(_0x25333e){return db[_0x4bb1('0x78')][_0x4bb1('0x79')](function(_0x3c208a){return _0x25333e[_0x4bb1('0x7d')](_0xf91766[_0x4bb1('0x43')]['ids'],{'transaction':_0x3c208a})[_0x4bb1('0x21')](function(){if(!_['isEmpty'](_0x3b539e)){return _0x25333e[_0x4bb1('0x90')](_0x3b539e,{'transaction':_0x3c208a});}})[_0x4bb1('0x21')](function(){_0x3b539e['forEach'](function(_0xdd1b83){socket[_0x4bb1('0x7b')](_0x4bb1('0x91'),{'UserId':_0xdd1b83,'ChatQueueId':_0x25333e['id']});});});});});});})[_0x4bb1('0x21')](respondWithStatusCode(_0x19cd3c,null))[_0x4bb1('0x2b')](handleError(_0x19cd3c,null));};exports[_0x4bb1('0x92')]=function(_0x49f9fb,_0x1965f8,_0x41bbbe){return db[_0x4bb1('0x3e')]['find']({'where':{'id':_0x49f9fb['params']['id']}})[_0x4bb1('0x21')](handleEntityNotFound(_0x1965f8,null))['then'](function(_0x1223c3){if(_0x1223c3){return _0x1223c3[_0x4bb1('0x92')](_0x49f9fb[_0x4bb1('0x60')]['ids'],_[_0x4bb1('0x93')](_0x49f9fb['body'],[_0x4bb1('0x72'),'id'])||{})[_0x4bb1('0x94')](function(_0x45b00c){for(var _0x136f41=0x0;_0x136f41<_0x49f9fb['body'][_0x4bb1('0x72')][_0x4bb1('0x48')];_0x136f41+=0x1){socket['emit'](_0x4bb1('0x7c'),{'UserId':Number(_0x49f9fb[_0x4bb1('0x60')][_0x4bb1('0x72')][_0x136f41]),'ChatQueueId':Number(_0x49f9fb['params']['id'])});}return _0x45b00c;});}})['then'](respondWithResult(_0x1965f8,null))[_0x4bb1('0x2b')](handleError(_0x1965f8,null));};exports[_0x4bb1('0x90')]=function(_0x1ab22b,_0x4c54e2,_0x1dbae4){return db['ChatQueue'][_0x4bb1('0x5c')]({'where':{'id':_0x1ab22b[_0x4bb1('0x58')]['id']}})[_0x4bb1('0x21')](handleEntityNotFound(_0x4c54e2,null))[_0x4bb1('0x21')](function(_0x2d56d8){if(_0x2d56d8){return _0x2d56d8['removeAgents'](_0x1ab22b['query'][_0x4bb1('0x72')])['then'](function(){if(_['isArray'](_0x1ab22b[_0x4bb1('0x43')][_0x4bb1('0x72')])){for(var _0xb1699=0x0;_0xb1699<_0x1ab22b[_0x4bb1('0x43')][_0x4bb1('0x72')][_0x4bb1('0x48')];_0xb1699+=0x1){socket[_0x4bb1('0x7b')](_0x4bb1('0x91'),{'UserId':Number(_0x1ab22b[_0x4bb1('0x43')][_0x4bb1('0x72')][_0xb1699]),'ChatQueueId':Number(_0x1ab22b[_0x4bb1('0x58')]['id'])});}}else{socket[_0x4bb1('0x7b')](_0x4bb1('0x91'),{'UserId':Number(_0x1ab22b[_0x4bb1('0x43')][_0x4bb1('0x72')]),'ChatQueueId':Number(_0x1ab22b['params']['id'])});}});}})[_0x4bb1('0x21')](respondWithStatusCode(_0x4c54e2,null))[_0x4bb1('0x2b')](handleError(_0x4c54e2,null));};exports[_0x4bb1('0x95')]=function(_0x42c700,_0x37b97f,_0x1647fb){var _0x5f48b3={};var _0x35ad3b={};var _0x5783be;var _0xc37547;return db['ChatQueue'][_0x4bb1('0x63')]({'where':{'id':_0x42c700[_0x4bb1('0x58')]['id']}})[_0x4bb1('0x21')](handleEntityNotFound(_0x37b97f,null))[_0x4bb1('0x21')](function(_0x483915){if(_0x483915){_0x5783be=_0x483915;_0x35ad3b['model']=_[_0x4bb1('0x44')](db[_0x4bb1('0x65')][_0x4bb1('0x3f')]);_0x35ad3b[_0x4bb1('0x43')]=_[_0x4bb1('0x44')](_0x42c700[_0x4bb1('0x43')]);_0x35ad3b[_0x4bb1('0x4e')]=_[_0x4bb1('0x45')](_0x35ad3b[_0x4bb1('0x42')],_0x35ad3b['query']);_0x5f48b3[_0x4bb1('0x46')]=_['intersection'](_0x35ad3b[_0x4bb1('0x42')],qs[_0x4bb1('0x47')](_0x42c700[_0x4bb1('0x43')][_0x4bb1('0x47')]));_0x5f48b3[_0x4bb1('0x46')]=_0x5f48b3['attributes'][_0x4bb1('0x48')]?_0x5f48b3['attributes']:_0x35ad3b[_0x4bb1('0x42')];_0x5f48b3[_0x4bb1('0x4b')]=qs[_0x4bb1('0x4c')](_0x42c700['query']['sort']);_0x5f48b3[_0x4bb1('0x4d')]=qs[_0x4bb1('0x4e')](_['pick'](_0x42c700['query'],_0x35ad3b['filters']));if(_0x42c700[_0x4bb1('0x43')]['filter']){_0x5f48b3[_0x4bb1('0x4d')]=_[_0x4bb1('0x50')](_0x5f48b3[_0x4bb1('0x4d')],{'$or':_[_0x4bb1('0x3d')](_0x5f48b3[_0x4bb1('0x46')],function(_0x38f78b){var _0x423638={};_0x423638[_0x38f78b]={'$like':'%'+_0x42c700[_0x4bb1('0x43')]['filter']+'%'};return _0x423638;})});}_0x5f48b3=_['merge']({},_0x5f48b3,_0x42c700[_0x4bb1('0x53')]);return _0x5783be[_0x4bb1('0x95')](_0x5f48b3);}})[_0x4bb1('0x21')](function(_0x4b254a){if(_0x4b254a){_0xc37547=_0x4b254a[_0x4bb1('0x48')];if(!_0x42c700[_0x4bb1('0x43')]['hasOwnProperty'](_0x4bb1('0x4a'))){_0x5f48b3['limit']=qs[_0x4bb1('0x31')](_0x42c700['query'][_0x4bb1('0x31')]);_0x5f48b3[_0x4bb1('0x30')]=qs[_0x4bb1('0x30')](_0x42c700[_0x4bb1('0x43')][_0x4bb1('0x30')]);}return _0x5783be[_0x4bb1('0x95')](_0x5f48b3);}})['then'](function(_0x55ce8d){if(_0x55ce8d){return _0x55ce8d?{'count':_0xc37547,'rows':_0x55ce8d}:null;}})[_0x4bb1('0x21')](respondWithResult(_0x37b97f,null))[_0x4bb1('0x2b')](handleError(_0x37b97f,null));}; \ No newline at end of file +var _0x0b47=['get','UserProfileSection','userProfileId','UserProfileResource','body','params','describe','getMembers','findOne','UserChatQueue','ChatQueueId','options','User','findAndCountAll','UserId','chatPause','updatedAt','format','SIP','createdAt','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','each','findOrCreate','forEach','emit','userChatQueue:save','ids','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','SELECT','includes','all','union','compact','value','transaction','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','update','destroy','ChatQueues','stack','name','map','ChatQueue','rawAttributes','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x0b47,0x15f));var _0x70b4=function(_0x5f0ac2,_0x282a89){_0x5f0ac2=_0x5f0ac2-0x0;var _0x375d41=_0x0b47[_0x5f0ac2];return _0x375d41;};'use strict';var emlformat=require(_0x70b4('0x0'));var rimraf=require(_0x70b4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x70b4('0x2'));var rp=require(_0x70b4('0x3'));var moment=require(_0x70b4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x70b4('0x5'));var util=require(_0x70b4('0x6'));var path=require(_0x70b4('0x7'));var sox=require(_0x70b4('0x8'));var csv=require('to-csv');var ejs=require(_0x70b4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x70b4('0xa'));var squel=require(_0x70b4('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x70b4('0xc'));var querystring=require(_0x70b4('0xd'));var Papa=require(_0x70b4('0xe'));var Redis=require(_0x70b4('0xf'));var authService=require(_0x70b4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x70b4('0x11'));var hardwareService=require(_0x70b4('0x12'));var logger=require(_0x70b4('0x13'))(_0x70b4('0x14'));var utils=require('../../config/utils');var config=require(_0x70b4('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x70b4('0x16')](config[_0x70b4('0x17')],{'host':_0x70b4('0x18'),'port':0x18eb});var socket=require(_0x70b4('0x19'))(new Redis(config['redis']));require('./chatQueue.socket')[_0x70b4('0x1a')](socket);var jayson=require(_0x70b4('0x1b'));var client=jayson[_0x70b4('0x1c')][_0x70b4('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x542d38,_0x1fe500,_0x5f34dc,_0x1616ae){return new BPromise(function(_0x46f3f1,_0x219224){var _0x4c65b1=_0x1616ae||client;return _0x4c65b1[_0x70b4('0x1e')](_0x542d38,_0x5f34dc)[_0x70b4('0x1f')](function(_0x36f1f){logger[_0x70b4('0x20')](_0x70b4('0x21'),_0x1fe500,_0x70b4('0x22'));logger[_0x70b4('0x23')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x1fe500,_0x70b4('0x22'),JSON[_0x70b4('0x24')](_0x36f1f));if(_0x36f1f[_0x70b4('0x25')]){if(_0x36f1f[_0x70b4('0x25')][_0x70b4('0x26')]===0x1f4){logger['error'](_0x70b4('0x21'),_0x1fe500,_0x36f1f[_0x70b4('0x25')][_0x70b4('0x27')]);return _0x219224(_0x36f1f['error'][_0x70b4('0x27')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x1fe500,_0x36f1f[_0x70b4('0x25')][_0x70b4('0x27')]);return _0x46f3f1(_0x36f1f[_0x70b4('0x25')]['message']);}else{logger[_0x70b4('0x20')](_0x70b4('0x21'),_0x1fe500,_0x70b4('0x22'));_0x46f3f1(_0x36f1f['result'][_0x70b4('0x27')]);}})['catch'](function(_0x21f478){logger[_0x70b4('0x25')]('ChatQueue,\x20%s,\x20%s',_0x1fe500,_0x21f478);_0x219224(_0x21f478);});});}function respondWithStatusCode(_0x4ccad5,_0x18dcac){_0x18dcac=_0x18dcac||0xcc;return function(_0x2ac7dd){if(_0x2ac7dd){return _0x4ccad5[_0x70b4('0x28')](_0x18dcac);}return _0x4ccad5[_0x70b4('0x29')](_0x18dcac)[_0x70b4('0x2a')]();};}function respondWithResult(_0x40d723,_0x202a77){_0x202a77=_0x202a77||0xc8;return function(_0x3e6796){if(_0x3e6796){return _0x40d723[_0x70b4('0x29')](_0x202a77)['json'](_0x3e6796);}};}function respondWithFilteredResult(_0x4d4bef,_0x3c4104){return function(_0x1d34f9){if(_0x1d34f9){var _0x1cab09=typeof _0x3c4104[_0x70b4('0x2b')]==='undefined'&&typeof _0x3c4104[_0x70b4('0x2c')]===_0x70b4('0x2d');var _0x3e04b4=_0x1d34f9[_0x70b4('0x2e')];var _0x16846b=_0x1cab09?0x0:_0x3c4104['offset'];var _0x20275c=_0x1cab09?_0x1d34f9[_0x70b4('0x2e')]:_0x3c4104['offset']+_0x3c4104['limit'];var _0x3f7b14;if(_0x20275c>=_0x3e04b4){_0x20275c=_0x3e04b4;_0x3f7b14=0xc8;}else{_0x3f7b14=0xce;}_0x4d4bef[_0x70b4('0x29')](_0x3f7b14);return _0x4d4bef[_0x70b4('0x2f')]('Content-Range',_0x16846b+'-'+_0x20275c+'/'+_0x3e04b4)[_0x70b4('0x30')](_0x1d34f9);}return null;};}function patchUpdates(_0x54d145){return function(_0xc2b6d2){try{jsonpatch[_0x70b4('0x31')](_0xc2b6d2,_0x54d145,!![]);}catch(_0x349859){return BPromise[_0x70b4('0x32')](_0x349859);}return _0xc2b6d2['save']();};}function saveUpdates(_0x51d269,_0x48a26a){return function(_0x2e6862){if(_0x2e6862){return _0x2e6862[_0x70b4('0x33')](_0x51d269)['then'](function(_0x21f255){return _0x21f255;});}return null;};}function removeEntity(_0x4f8f4a,_0x17f5b4){return function(_0x45925d){if(_0x45925d){return _0x45925d[_0x70b4('0x34')]()[_0x70b4('0x1f')](function(){var _0x843fca=_0x45925d['get']({'plain':!![]});var _0x5e541a=_0x70b4('0x35');return db['UserProfileResource'][_0x70b4('0x34')]({'where':{'type':_0x5e541a,'resourceId':_0x843fca['id']}})[_0x70b4('0x1f')](function(){return _0x45925d;});})[_0x70b4('0x1f')](function(){_0x4f8f4a[_0x70b4('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d5f3a,_0x3c8b7e){return function(_0x369920){if(!_0x369920){_0x5d5f3a['sendStatus'](0x194);}return _0x369920;};}function handleError(_0x3920db,_0x5d16d0){_0x5d16d0=_0x5d16d0||0x1f4;return function(_0x529f5){logger[_0x70b4('0x25')](_0x529f5[_0x70b4('0x36')]);if(_0x529f5[_0x70b4('0x37')]){delete _0x529f5[_0x70b4('0x37')];}_0x3920db[_0x70b4('0x29')](_0x5d16d0)['send'](_0x529f5);};}exports['index']=function(_0xe12663,_0x2f30ee){var _0x58affa={},_0x20c039={},_0xa45ad4={'count':0x0,'rows':[]};var _0xdad081=_[_0x70b4('0x38')](db[_0x70b4('0x39')][_0x70b4('0x3a')],function(_0x59f99b){return{'name':_0x59f99b['fieldName'],'type':_0x59f99b['type'][_0x70b4('0x3b')]};});_0x20c039[_0x70b4('0x3c')]=_[_0x70b4('0x38')](_0xdad081,_0x70b4('0x37'));_0x20c039[_0x70b4('0x3d')]=_['keys'](_0xe12663[_0x70b4('0x3d')]);_0x20c039[_0x70b4('0x3e')]=_['intersection'](_0x20c039[_0x70b4('0x3c')],_0x20c039[_0x70b4('0x3d')]);_0x58affa['attributes']=_[_0x70b4('0x3f')](_0x20c039[_0x70b4('0x3c')],qs[_0x70b4('0x40')](_0xe12663[_0x70b4('0x3d')]['fields']));_0x58affa[_0x70b4('0x41')]=_0x58affa[_0x70b4('0x41')][_0x70b4('0x42')]?_0x58affa[_0x70b4('0x41')]:_0x20c039['model'];if(!_0xe12663['query'][_0x70b4('0x43')](_0x70b4('0x44'))){_0x58affa[_0x70b4('0x2c')]=qs['limit'](_0xe12663['query']['limit']);_0x58affa['offset']=qs[_0x70b4('0x2b')](_0xe12663[_0x70b4('0x3d')][_0x70b4('0x2b')]);}_0x58affa[_0x70b4('0x45')]=qs[_0x70b4('0x46')](_0xe12663[_0x70b4('0x3d')]['sort']);_0x58affa[_0x70b4('0x47')]=qs['filters'](_[_0x70b4('0x48')](_0xe12663[_0x70b4('0x3d')],_0x20c039[_0x70b4('0x3e')]),_0xdad081);if(_0xe12663['query'][_0x70b4('0x49')]){_0x58affa['where']=_[_0x70b4('0x4a')](_0x58affa[_0x70b4('0x47')],{'$or':_[_0x70b4('0x38')](_0xdad081,function(_0x52cfcd){if(_0x52cfcd[_0x70b4('0x4b')]!==_0x70b4('0x4c')){var _0x4a45ed={};_0x4a45ed[_0x52cfcd[_0x70b4('0x37')]]={'$like':'%'+_0xe12663[_0x70b4('0x3d')][_0x70b4('0x49')]+'%'};return _0x4a45ed;}})});}_0x58affa=_[_0x70b4('0x4a')]({},_0x58affa,_0xe12663['options']);var _0x4c71ec={'where':_0x58affa[_0x70b4('0x47')]};return db['ChatQueue'][_0x70b4('0x2e')](_0x4c71ec)[_0x70b4('0x1f')](function(_0x37a7e5){_0xa45ad4[_0x70b4('0x2e')]=_0x37a7e5;if(_0xe12663[_0x70b4('0x3d')][_0x70b4('0x4d')]){_0x58affa[_0x70b4('0x4e')]=[{'all':!![]}];}return db['ChatQueue'][_0x70b4('0x4f')](_0x58affa);})[_0x70b4('0x1f')](function(_0x13be14){_0xa45ad4[_0x70b4('0x50')]=_0x13be14;return _0xa45ad4;})[_0x70b4('0x1f')](respondWithFilteredResult(_0x2f30ee,_0x58affa))[_0x70b4('0x51')](handleError(_0x2f30ee,null));};exports['show']=function(_0x3024a5,_0x137b79){var _0x48999a={'raw':!![],'where':{'id':_0x3024a5['params']['id']}},_0x31de51={};_0x31de51['model']=_[_0x70b4('0x52')](db[_0x70b4('0x39')][_0x70b4('0x3a')]);_0x31de51[_0x70b4('0x3d')]=_['keys'](_0x3024a5[_0x70b4('0x3d')]);_0x31de51[_0x70b4('0x3e')]=_['intersection'](_0x31de51[_0x70b4('0x3c')],_0x31de51[_0x70b4('0x3d')]);_0x48999a[_0x70b4('0x41')]=_[_0x70b4('0x3f')](_0x31de51[_0x70b4('0x3c')],qs['fields'](_0x3024a5[_0x70b4('0x3d')][_0x70b4('0x40')]));_0x48999a[_0x70b4('0x41')]=_0x48999a[_0x70b4('0x41')][_0x70b4('0x42')]?_0x48999a[_0x70b4('0x41')]:_0x31de51['model'];if(_0x3024a5['query'][_0x70b4('0x4d')]){_0x48999a[_0x70b4('0x4e')]=[{'all':!![]}];}_0x48999a=_[_0x70b4('0x4a')]({},_0x48999a,_0x3024a5['options']);return db[_0x70b4('0x39')][_0x70b4('0x53')](_0x48999a)[_0x70b4('0x1f')](handleEntityNotFound(_0x137b79,null))[_0x70b4('0x1f')](respondWithResult(_0x137b79,null))['catch'](handleError(_0x137b79,null));};exports[_0x70b4('0x54')]=function(_0x24268d,_0x164283){return db['ChatQueue']['create'](_0x24268d['body'],{})[_0x70b4('0x1f')](function(_0x5cc9f8){var _0x92a538=_0x24268d[_0x70b4('0x55')]['get']({'plain':!![]});if(!_0x92a538)throw new Error(_0x70b4('0x56'));if(_0x92a538['role']===_0x70b4('0x55')){var _0x348ba1=_0x5cc9f8[_0x70b4('0x57')]({'plain':!![]});var _0x545ccd=_0x70b4('0x35');return db[_0x70b4('0x58')]['find']({'where':{'name':_0x545ccd,'userProfileId':_0x92a538[_0x70b4('0x59')]},'raw':!![]})[_0x70b4('0x1f')](function(_0x577d53){if(_0x577d53&&_0x577d53['autoAssociation']===0x0){return db[_0x70b4('0x5a')][_0x70b4('0x54')]({'name':_0x348ba1[_0x70b4('0x37')],'resourceId':_0x348ba1['id'],'type':_0x577d53[_0x70b4('0x37')],'sectionId':_0x577d53['id']},{})['then'](function(){return _0x5cc9f8;});}else{return _0x5cc9f8;}})[_0x70b4('0x51')](function(_0x3afdfa){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3afdfa);throw _0x3afdfa;});}return _0x5cc9f8;})[_0x70b4('0x1f')](respondWithResult(_0x164283,0xc9))[_0x70b4('0x51')](handleError(_0x164283,null));};exports[_0x70b4('0x33')]=function(_0x10889d,_0x30424c){if(_0x10889d[_0x70b4('0x5b')]['id']){delete _0x10889d['body']['id'];}return db['ChatQueue']['find']({'where':{'id':_0x10889d['params']['id']}})[_0x70b4('0x1f')](handleEntityNotFound(_0x30424c,null))['then'](saveUpdates(_0x10889d[_0x70b4('0x5b')],null))['then'](respondWithResult(_0x30424c,null))[_0x70b4('0x51')](handleError(_0x30424c,null));};exports['destroy']=function(_0x1034e0,_0x27c1d5){return db[_0x70b4('0x39')][_0x70b4('0x53')]({'where':{'id':_0x1034e0[_0x70b4('0x5c')]['id']}})[_0x70b4('0x1f')](handleEntityNotFound(_0x27c1d5,null))[_0x70b4('0x1f')](removeEntity(_0x27c1d5,null))[_0x70b4('0x51')](handleError(_0x27c1d5,null));};exports[_0x70b4('0x5d')]=function(_0x402286,_0x3b2cf0){return db[_0x70b4('0x39')][_0x70b4('0x5d')]()[_0x70b4('0x1f')](respondWithResult(_0x3b2cf0,null))[_0x70b4('0x51')](handleError(_0x3b2cf0,null));};exports[_0x70b4('0x5e')]=function(_0x5b90b5,_0x310d9c,_0x461cc0){var _0x4adbd1={'raw':!![],'where':{}},_0x172fef={},_0x3340ea;return db['ChatQueue'][_0x70b4('0x5f')]({'where':{'id':_0x5b90b5['params']['id']}})[_0x70b4('0x1f')](handleEntityNotFound(_0x310d9c,null))[_0x70b4('0x1f')](function(_0x34109b){if(_0x34109b){_0x3340ea=_0x34109b['get']({'plain':!![]});_0x172fef[_0x70b4('0x3c')]=_[_0x70b4('0x52')](db[_0x70b4('0x60')][_0x70b4('0x3a')]);_0x172fef[_0x70b4('0x3d')]=_['keys'](_0x5b90b5[_0x70b4('0x3d')]);_0x172fef[_0x70b4('0x3e')]=_['intersection'](_0x172fef[_0x70b4('0x3c')],_0x172fef[_0x70b4('0x3d')]);_0x4adbd1['attributes']=_['intersection'](_0x172fef[_0x70b4('0x3c')],qs[_0x70b4('0x40')](_0x5b90b5[_0x70b4('0x3d')][_0x70b4('0x40')]));_0x4adbd1[_0x70b4('0x41')]=_0x4adbd1[_0x70b4('0x41')]['length']?_0x4adbd1[_0x70b4('0x41')]:_0x172fef[_0x70b4('0x3c')];if(!_0x5b90b5[_0x70b4('0x3d')][_0x70b4('0x43')](_0x70b4('0x44'))){_0x4adbd1[_0x70b4('0x2c')]=qs['limit'](_0x5b90b5['query']['limit']);_0x4adbd1[_0x70b4('0x2b')]=qs[_0x70b4('0x2b')](_0x5b90b5[_0x70b4('0x3d')][_0x70b4('0x2b')]);}_0x4adbd1[_0x70b4('0x45')]=qs[_0x70b4('0x46')](_0x5b90b5[_0x70b4('0x3d')][_0x70b4('0x46')]);_0x4adbd1[_0x70b4('0x47')]=qs[_0x70b4('0x3e')](_['pick'](_0x5b90b5[_0x70b4('0x3d')],_0x172fef[_0x70b4('0x3e')]));_0x4adbd1[_0x70b4('0x47')][_0x70b4('0x61')]=_0x34109b['id'];if(_0x5b90b5[_0x70b4('0x3d')][_0x70b4('0x49')]){_0x4adbd1['where']=_['merge'](_0x4adbd1[_0x70b4('0x47')],{'$or':_['map'](_0x4adbd1[_0x70b4('0x41')],function(_0x545c60){var _0x245231={};_0x245231[_0x545c60]={'$like':'%'+_0x5b90b5[_0x70b4('0x3d')][_0x70b4('0x49')]+'%'};return _0x245231;})});}_0x4adbd1=_[_0x70b4('0x4a')]({},_0x4adbd1,_0x5b90b5[_0x70b4('0x62')]);return db['UserChatQueue'][_0x70b4('0x4f')](_0x4adbd1);}})[_0x70b4('0x1f')](function(_0x1b3358){if(_0x1b3358){return db[_0x70b4('0x63')][_0x70b4('0x64')]({'where':{'id':_[_0x70b4('0x38')](_0x1b3358,_0x70b4('0x65')),'role':'agent'},'attributes':['id',_0x70b4('0x37'),_0x70b4('0x66'),_0x70b4('0x67'),'createdAt']});}})[_0x70b4('0x1f')](function(_0x2e3141){if(_0x2e3141){return{'count':_0x2e3141[_0x70b4('0x2e')],'rows':_[_0x70b4('0x38')](_0x2e3141[_0x70b4('0x50')],function(_0x6e4ef5){return{'membername':_0x6e4ef5['name'],'UserId':_0x6e4ef5['id'],'queue_name':_0x3340ea[_0x70b4('0x37')],'ChatQueueId':_0x3340ea['id'],'interface':util[_0x70b4('0x68')]('%s/%s',_0x70b4('0x69'),_0x6e4ef5['name']),'penalty':0x0,'paused':_0x6e4ef5[_0x70b4('0x66')],'createdAt':_0x6e4ef5[_0x70b4('0x6a')],'updatedAt':_0x6e4ef5[_0x70b4('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x70b4('0x1f')](respondWithFilteredResult(_0x310d9c,_0x4adbd1))[_0x70b4('0x51')](handleError(_0x310d9c,null));};exports[_0x70b4('0x6b')]=function(_0x256a2d,_0xd7b5fc,_0x7738d9){var _0x3c45a8={};var _0x1ebf40={};var _0x129445;var _0x24ea7d;return db['ChatQueue']['findOne']({'where':{'id':_0x256a2d['params']['id']}})[_0x70b4('0x1f')](handleEntityNotFound(_0xd7b5fc,null))[_0x70b4('0x1f')](function(_0x4dd7f3){if(_0x4dd7f3){_0x129445=_0x4dd7f3;_0x1ebf40[_0x70b4('0x3c')]=_['keys'](db[_0x70b4('0x6c')][_0x70b4('0x3a')]);_0x1ebf40[_0x70b4('0x3d')]=_[_0x70b4('0x52')](_0x256a2d['query']);_0x1ebf40['filters']=_[_0x70b4('0x3f')](_0x1ebf40[_0x70b4('0x3c')],_0x1ebf40[_0x70b4('0x3d')]);_0x3c45a8[_0x70b4('0x41')]=_[_0x70b4('0x3f')](_0x1ebf40[_0x70b4('0x3c')],qs[_0x70b4('0x40')](_0x256a2d['query'][_0x70b4('0x40')]));_0x3c45a8[_0x70b4('0x41')]=_0x3c45a8[_0x70b4('0x41')][_0x70b4('0x42')]?_0x3c45a8['attributes']:_0x1ebf40[_0x70b4('0x3c')];_0x3c45a8[_0x70b4('0x45')]=qs[_0x70b4('0x46')](_0x256a2d['query']['sort']);_0x3c45a8[_0x70b4('0x47')]=qs[_0x70b4('0x3e')](_[_0x70b4('0x48')](_0x256a2d['query'],_0x1ebf40[_0x70b4('0x3e')]));if(_0x256a2d['query']['filter']){_0x3c45a8['where']=_[_0x70b4('0x4a')](_0x3c45a8[_0x70b4('0x47')],{'$or':_[_0x70b4('0x38')](_0x3c45a8[_0x70b4('0x41')],function(_0x572e0a){var _0x3d3f81={};_0x3d3f81[_0x572e0a]={'$like':'%'+_0x256a2d['query']['filter']+'%'};return _0x3d3f81;})});}_0x3c45a8=_['merge']({},_0x3c45a8,_0x256a2d['options']);return _0x129445[_0x70b4('0x6b')](_0x3c45a8);}})[_0x70b4('0x1f')](function(_0xf498fb){if(_0xf498fb){_0x24ea7d=_0xf498fb[_0x70b4('0x42')];if(!_0x256a2d['query'][_0x70b4('0x43')]('nolimit')){_0x3c45a8[_0x70b4('0x2c')]=qs[_0x70b4('0x2c')](_0x256a2d[_0x70b4('0x3d')][_0x70b4('0x2c')]);_0x3c45a8['offset']=qs[_0x70b4('0x2b')](_0x256a2d[_0x70b4('0x3d')][_0x70b4('0x2b')]);}return _0x129445[_0x70b4('0x6b')](_0x3c45a8);}})[_0x70b4('0x1f')](function(_0x2592a3){if(_0x2592a3){return _0x2592a3?{'count':_0x24ea7d,'rows':_0x2592a3}:null;}})[_0x70b4('0x1f')](respondWithResult(_0xd7b5fc,null))['catch'](handleError(_0xd7b5fc,null));};exports[_0x70b4('0x6d')]=function(_0x3f7d99,_0x3ac704,_0x642f69){var _0x2ae933=_0x3f7d99['body']['ids'];return db[_0x70b4('0x6c')]['findAll']({'where':{'id':_0x2ae933},'attributes':['id'],'include':[{'model':db[_0x70b4('0x63')],'as':_0x70b4('0x6e'),'attributes':['id',_0x70b4('0x37'),_0x70b4('0x6f'),_0x70b4('0x70'),_0x70b4('0x71')],'raw':!![]}]})[_0x70b4('0x1f')](function(_0x13b45b){if(_0x13b45b){var _0x4db871=_[_0x70b4('0x72')](_0x13b45b,function(_0x2c80ca){var _0x290072=_0x2c80ca[_0x70b4('0x57')]({'plain':!![]});return _0x290072['Agents'];});return db[_0x70b4('0x39')]['find']({'where':{'id':_0x3f7d99[_0x70b4('0x5c')]['id']}})[_0x70b4('0x1f')](function(_0x58a721){return db['sequelize']['transaction'](function(_0x17d4c0){return _0x58a721[_0x70b4('0x6d')](_0x2ae933,{'transaction':_0x17d4c0})[_0x70b4('0x1f')](function(){return BPromise[_0x70b4('0x73')](_0x4db871,function(_0x42bd10){return db[_0x70b4('0x60')][_0x70b4('0x74')]({'where':{'UserId':_0x42bd10['id'],'ChatQueueId':_0x3f7d99[_0x70b4('0x5c')]['id']},'transaction':_0x17d4c0});});})['then'](function(){_0x4db871[_0x70b4('0x75')](function(_0x341f53){socket[_0x70b4('0x76')](_0x70b4('0x77'),{'UserId':_0x341f53['id'],'ChatQueueId':_0x58a721['id']});});});});});}})[_0x70b4('0x1f')](respondWithStatusCode(_0x3ac704,null))[_0x70b4('0x51')](handleError(_0x3ac704,null));};exports['removeTeams']=function(_0x29d201,_0x5e0aa7,_0xd56983){return db[_0x70b4('0x6c')][_0x70b4('0x4f')]({'where':{'id':_0x29d201[_0x70b4('0x3d')][_0x70b4('0x78')]},'attributes':['id'],'include':[{'model':db[_0x70b4('0x63')],'as':_0x70b4('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x70b4('0x1f')](handleEntityNotFound(_0x5e0aa7,null))[_0x70b4('0x1f')](function(_0x3359cd){var _0x1e32dc=_['map'](_0x3359cd,'id');var _0x41ee24=[];var _0x2230e7=[];var _0x18869e=squel['select']();_0x18869e[_0x70b4('0x79')](_0x70b4('0x7a'))[_0x70b4('0x7b')](_0x70b4('0x7c'),'tq')[_0x70b4('0x7d')](_0x70b4('0x7e'),'ut',_0x70b4('0x7f'))['where'](_0x70b4('0x80'),_0x29d201[_0x70b4('0x5c')]['id']);for(var _0x2dbf00=0x0;_0x2dbf00<_0x3359cd[_0x70b4('0x42')];_0x2dbf00+=0x1){let _0x2c0f38=_0x3359cd[_0x2dbf00];for(var _0xe5d47f=0x0;_0xe5d47f<_0x2c0f38[_0x70b4('0x6e')][_0x70b4('0x42')];_0xe5d47f+=0x1){let _0x3b27db=_0x2c0f38[_0x70b4('0x6e')][_0xe5d47f];var _0x4e792=_0x18869e[_0x70b4('0x81')]();_0x4e792['where'](_0x70b4('0x82'),_0x3b27db['id']);_0x2230e7['push'](db['sequelize'][_0x70b4('0x3d')](_0x4e792['toString'](),{'type':db[_0x70b4('0x83')]['QueryTypes'][_0x70b4('0x84')]})[_0x70b4('0x1f')](function(_0x1e0ffc){if(_0x1e0ffc[_0x70b4('0x42')]===0x1){return _0x3b27db['id'];}else{var _0x56b922=_['every'](_['map'](_0x1e0ffc,'TeamId'),function(_0x271efc){return _[_0x70b4('0x85')](_0x1e32dc,_0x271efc);});if(_0x56b922){return _0x3b27db['id'];}}}));}}return BPromise[_0x70b4('0x86')](_0x2230e7)['then'](function(_0x6a489){_0x41ee24=_(_0x41ee24)[_0x70b4('0x87')](_0x6a489)[_0x70b4('0x88')]()[_0x70b4('0x89')]();return db[_0x70b4('0x39')][_0x70b4('0x53')]({'where':{'id':_0x29d201[_0x70b4('0x5c')]['id']}})[_0x70b4('0x1f')](function(_0x1244c5){return db['sequelize'][_0x70b4('0x8a')](function(_0x33acb5){return _0x1244c5['removeTeams'](_0x29d201['query']['ids'],{'transaction':_0x33acb5})[_0x70b4('0x1f')](function(){if(!_['isEmpty'](_0x41ee24)){return _0x1244c5[_0x70b4('0x8b')](_0x41ee24,{'transaction':_0x33acb5});}})[_0x70b4('0x1f')](function(){_0x41ee24[_0x70b4('0x75')](function(_0xded0d5){socket[_0x70b4('0x76')](_0x70b4('0x8c'),{'UserId':_0xded0d5,'ChatQueueId':_0x1244c5['id']});});});});});});})['then'](respondWithStatusCode(_0x5e0aa7,null))[_0x70b4('0x51')](handleError(_0x5e0aa7,null));};exports[_0x70b4('0x8d')]=function(_0x364bd2,_0x59c702,_0x1e87ad){return db[_0x70b4('0x39')][_0x70b4('0x53')]({'where':{'id':_0x364bd2[_0x70b4('0x5c')]['id']}})[_0x70b4('0x1f')](handleEntityNotFound(_0x59c702,null))[_0x70b4('0x1f')](function(_0xec8b56){if(_0xec8b56){return _0xec8b56[_0x70b4('0x8d')](_0x364bd2[_0x70b4('0x5b')]['ids'],_[_0x70b4('0x8e')](_0x364bd2[_0x70b4('0x5b')],[_0x70b4('0x78'),'id'])||{})[_0x70b4('0x8f')](function(_0x3db22a){for(var _0x213ae3=0x0;_0x213ae3<_0x364bd2[_0x70b4('0x5b')]['ids'][_0x70b4('0x42')];_0x213ae3+=0x1){socket[_0x70b4('0x76')](_0x70b4('0x77'),{'UserId':Number(_0x364bd2[_0x70b4('0x5b')]['ids'][_0x213ae3]),'ChatQueueId':Number(_0x364bd2[_0x70b4('0x5c')]['id'])});}return _0x3db22a;});}})['then'](respondWithResult(_0x59c702,null))[_0x70b4('0x51')](handleError(_0x59c702,null));};exports[_0x70b4('0x8b')]=function(_0x4e969c,_0x631783,_0x434c2c){return db['ChatQueue'][_0x70b4('0x53')]({'where':{'id':_0x4e969c[_0x70b4('0x5c')]['id']}})[_0x70b4('0x1f')](handleEntityNotFound(_0x631783,null))[_0x70b4('0x1f')](function(_0x120a97){if(_0x120a97){return _0x120a97[_0x70b4('0x8b')](_0x4e969c['query'][_0x70b4('0x78')])[_0x70b4('0x1f')](function(){if(_[_0x70b4('0x90')](_0x4e969c['query'][_0x70b4('0x78')])){for(var _0x5b36f4=0x0;_0x5b36f4<_0x4e969c[_0x70b4('0x3d')]['ids'][_0x70b4('0x42')];_0x5b36f4+=0x1){socket[_0x70b4('0x76')](_0x70b4('0x8c'),{'UserId':Number(_0x4e969c[_0x70b4('0x3d')]['ids'][_0x5b36f4]),'ChatQueueId':Number(_0x4e969c[_0x70b4('0x5c')]['id'])});}}else{socket['emit'](_0x70b4('0x8c'),{'UserId':Number(_0x4e969c[_0x70b4('0x3d')][_0x70b4('0x78')]),'ChatQueueId':Number(_0x4e969c['params']['id'])});}});}})[_0x70b4('0x1f')](respondWithStatusCode(_0x631783,null))[_0x70b4('0x51')](handleError(_0x631783,null));};exports['getAgents']=function(_0x28212d,_0x524978,_0x3c8321){var _0x3c62fb={};var _0x56e186={};var _0x31dd6b;var _0x471249;return db['ChatQueue'][_0x70b4('0x5f')]({'where':{'id':_0x28212d[_0x70b4('0x5c')]['id']}})[_0x70b4('0x1f')](handleEntityNotFound(_0x524978,null))[_0x70b4('0x1f')](function(_0x167ef6){if(_0x167ef6){_0x31dd6b=_0x167ef6;_0x56e186[_0x70b4('0x3c')]=_[_0x70b4('0x52')](db['User'][_0x70b4('0x3a')]);_0x56e186[_0x70b4('0x3d')]=_['keys'](_0x28212d[_0x70b4('0x3d')]);_0x56e186[_0x70b4('0x3e')]=_[_0x70b4('0x3f')](_0x56e186[_0x70b4('0x3c')],_0x56e186[_0x70b4('0x3d')]);_0x3c62fb[_0x70b4('0x41')]=_[_0x70b4('0x3f')](_0x56e186['model'],qs[_0x70b4('0x40')](_0x28212d[_0x70b4('0x3d')][_0x70b4('0x40')]));_0x3c62fb[_0x70b4('0x41')]=_0x3c62fb[_0x70b4('0x41')][_0x70b4('0x42')]?_0x3c62fb['attributes']:_0x56e186[_0x70b4('0x3c')];_0x3c62fb[_0x70b4('0x45')]=qs[_0x70b4('0x46')](_0x28212d[_0x70b4('0x3d')]['sort']);_0x3c62fb['where']=qs[_0x70b4('0x3e')](_[_0x70b4('0x48')](_0x28212d[_0x70b4('0x3d')],_0x56e186[_0x70b4('0x3e')]));if(_0x28212d['query']['filter']){_0x3c62fb[_0x70b4('0x47')]=_[_0x70b4('0x4a')](_0x3c62fb['where'],{'$or':_[_0x70b4('0x38')](_0x3c62fb[_0x70b4('0x41')],function(_0x603c85){var _0x93cabc={};_0x93cabc[_0x603c85]={'$like':'%'+_0x28212d[_0x70b4('0x3d')][_0x70b4('0x49')]+'%'};return _0x93cabc;})});}_0x3c62fb=_['merge']({},_0x3c62fb,_0x28212d[_0x70b4('0x62')]);return _0x31dd6b[_0x70b4('0x91')](_0x3c62fb);}})[_0x70b4('0x1f')](function(_0xeba9bb){if(_0xeba9bb){_0x471249=_0xeba9bb['length'];if(!_0x28212d[_0x70b4('0x3d')][_0x70b4('0x43')](_0x70b4('0x44'))){_0x3c62fb[_0x70b4('0x2c')]=qs[_0x70b4('0x2c')](_0x28212d[_0x70b4('0x3d')][_0x70b4('0x2c')]);_0x3c62fb['offset']=qs[_0x70b4('0x2b')](_0x28212d[_0x70b4('0x3d')][_0x70b4('0x2b')]);}return _0x31dd6b['getAgents'](_0x3c62fb);}})['then'](function(_0x2bbce1){if(_0x2bbce1){return _0x2bbce1?{'count':_0x471249,'rows':_0x2bbce1}:null;}})[_0x70b4('0x1f')](respondWithResult(_0x524978,null))[_0x70b4('0x51')](handleError(_0x524978,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 21a845b..be14bb0 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 _0x45e4=['ChatQueue','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x399f57,_0x2a41b3){var _0x56098f=function(_0x5d056e){while(--_0x5d056e){_0x399f57['push'](_0x399f57['shift']());}};_0x56098f(++_0x2a41b3);}(_0x45e4,0x18e));var _0x445e=function(_0x3787a0,_0x57b733){_0x3787a0=_0x3787a0-0x0;var _0x4904f2=_0x45e4[_0x3787a0];return _0x4904f2;};'use strict';var EventEmitter=require(_0x445e('0x0'));var ChatQueue=require(_0x445e('0x1'))['db'][_0x445e('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x445e('0x3'),'afterUpdate':_0x445e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x18c8ab){return function(_0x50e99d,_0x343510,_0xe0b38d){ChatQueueEvents[_0x445e('0x5')](_0x18c8ab+':'+_0x50e99d['id'],_0x50e99d);ChatQueueEvents[_0x445e('0x5')](_0x18c8ab,_0x50e99d);_0xe0b38d(null);};}for(var e in events){if(events[_0x445e('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x445e('0x7')]=ChatQueueEvents; \ No newline at end of file +var _0x64b3=['events','../../mysqldb','ChatQueue','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x181233,_0x5dff39){var _0xaeda46=function(_0xe731fa){while(--_0xe731fa){_0x181233['push'](_0x181233['shift']());}};_0xaeda46(++_0x5dff39);}(_0x64b3,0xe6));var _0x364b=function(_0x16dc98,_0x350104){_0x16dc98=_0x16dc98-0x0;var _0x35a71b=_0x64b3[_0x16dc98];return _0x35a71b;};'use strict';var EventEmitter=require(_0x364b('0x0'));var ChatQueue=require(_0x364b('0x1'))['db'][_0x364b('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x364b('0x3'),'afterUpdate':_0x364b('0x4'),'afterDestroy':_0x364b('0x5')};function emitEvent(_0x52fd53){return function(_0x595507,_0x54a16d,_0x512cf0){ChatQueueEvents[_0x364b('0x6')](_0x52fd53+':'+_0x595507['id'],_0x595507);ChatQueueEvents[_0x364b('0x6')](_0x52fd53,_0x595507);_0x512cf0(null);};}for(var e in events){if(events[_0x364b('0x7')](e)){var event=events[e];ChatQueue[_0x364b('0x8')](e,emitEvent(event));}}module[_0x364b('0x9')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 0c20467..a29433f 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 _0x3426=['util','../../config/logger','bluebird','request-promise','path','rimraf','./chatQueue.attributes','define','ChatQueue','chat_queues','lodash'];(function(_0x188b63,_0x2ae3ed){var _0x4a18a1=function(_0x4d3589){while(--_0x4d3589){_0x188b63['push'](_0x188b63['shift']());}};_0x4a18a1(++_0x2ae3ed);}(_0x3426,0xd0));var _0x6342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3426[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6342('0x0'));var util=require(_0x6342('0x1'));var logger=require(_0x6342('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6342('0x3'));var rp=require(_0x6342('0x4'));var fs=require('fs');var path=require(_0x6342('0x5'));var rimraf=require(_0x6342('0x6'));var config=require('../../config/environment');var attributes=require(_0x6342('0x7'));module['exports']=function(_0x43e927,_0x145cb8){return _0x43e927[_0x6342('0x8')](_0x6342('0x9'),attributes,{'tableName':_0x6342('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f51=['bluebird','request-promise','../../config/environment','exports','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x3f51,0x1ea));var _0x13f5=function(_0xfc422b,_0x2f22ec){_0xfc422b=_0xfc422b-0x0;var _0x3e888f=_0x3f51[_0xfc422b];return _0x3e888f;};'use strict';var _=require(_0x13f5('0x0'));var util=require(_0x13f5('0x1'));var logger=require(_0x13f5('0x2'))(_0x13f5('0x3'));var moment=require(_0x13f5('0x4'));var BPromise=require(_0x13f5('0x5'));var rp=require(_0x13f5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x13f5('0x7'));var attributes=require('./chatQueue.attributes');module[_0x13f5('0x8')]=function(_0x151e95,_0x2780c8){return _0x151e95['define'](_0x13f5('0x9'),attributes,{'tableName':_0x13f5('0xa'),'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 0b804df..d3e3527 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 _0xae87=['ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','ChatQueue','options','raw','where','attributes','limit','include','map','model','info','GetChatQueue','stringify','ShowChatQueue','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xae87,0x1ce));var _0x7ae8=function(_0x2e3dfc,_0x454d6c){_0x2e3dfc=_0x2e3dfc-0x0;var _0x4b1245=_0xae87[_0x2e3dfc];return _0x4b1245;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7ae8('0x0'));var fs=require('fs');var Redis=require(_0x7ae8('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x7ae8('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x7ae8('0x3'));var jayson=require(_0x7ae8('0x4'));var client=jayson[_0x7ae8('0x5')][_0x7ae8('0x6')]({'port':0x232a});config['redis']=_[_0x7ae8('0x7')](config[_0x7ae8('0x8')],{'host':_0x7ae8('0x9'),'port':0x18eb});var socket=require(_0x7ae8('0xa'))(new Redis(config[_0x7ae8('0x8')]));require(_0x7ae8('0xb'))[_0x7ae8('0xc')](socket);function respondWithRpcPromise(_0x48d84d,_0x4a63d6,_0x2cc5f6){return new BPromise(function(_0x334ae7,_0x595760){return client[_0x7ae8('0xd')](_0x48d84d,_0x2cc5f6)['then'](function(_0x4077e5){logger['info'](_0x7ae8('0xe'),_0x4a63d6,'request\x20sent');logger[_0x7ae8('0xf')](_0x7ae8('0x10'),_0x4a63d6,_0x7ae8('0x11'),JSON['stringify'](_0x4077e5));if(_0x4077e5[_0x7ae8('0x12')]){if(_0x4077e5[_0x7ae8('0x12')]['code']===0x1f4){logger[_0x7ae8('0x12')](_0x7ae8('0xe'),_0x4a63d6,_0x4077e5[_0x7ae8('0x12')][_0x7ae8('0x13')]);return _0x595760(_0x4077e5[_0x7ae8('0x12')][_0x7ae8('0x13')]);}logger[_0x7ae8('0x12')](_0x7ae8('0xe'),_0x4a63d6,_0x4077e5[_0x7ae8('0x12')][_0x7ae8('0x13')]);return _0x334ae7(_0x4077e5[_0x7ae8('0x12')][_0x7ae8('0x13')]);}else{logger['info'](_0x7ae8('0xe'),_0x4a63d6,_0x7ae8('0x11'));_0x334ae7(_0x4077e5['result'][_0x7ae8('0x13')]);}})[_0x7ae8('0x14')](function(_0x408e0b){logger[_0x7ae8('0x12')]('ChatQueue,\x20%s,\x20%s',_0x4a63d6,_0x408e0b);_0x595760(_0x408e0b);});});}exports['GetChatQueue']=function(_0x483b24){var _0x62392=this;return new Promise(function(_0x105b56,_0x587d0a){return db[_0x7ae8('0x15')]['findAll']({'raw':_0x483b24[_0x7ae8('0x16')]?_0x483b24[_0x7ae8('0x16')][_0x7ae8('0x17')]===undefined?!![]:![]:!![],'where':_0x483b24[_0x7ae8('0x16')]?_0x483b24[_0x7ae8('0x16')][_0x7ae8('0x18')]||null:null,'attributes':_0x483b24[_0x7ae8('0x16')]?_0x483b24[_0x7ae8('0x16')][_0x7ae8('0x19')]||null:null,'limit':_0x483b24[_0x7ae8('0x16')]?_0x483b24[_0x7ae8('0x16')][_0x7ae8('0x1a')]||null:null,'include':_0x483b24[_0x7ae8('0x16')]?_0x483b24[_0x7ae8('0x16')][_0x7ae8('0x1b')]?_['map'](_0x483b24['options'][_0x7ae8('0x1b')],function(_0x5d2ae3){return{'model':db[_0x5d2ae3['model']],'as':_0x5d2ae3['as'],'attributes':_0x5d2ae3[_0x7ae8('0x19')],'include':_0x5d2ae3['include']?_[_0x7ae8('0x1c')](_0x5d2ae3[_0x7ae8('0x1b')],function(_0x4e00c2){return{'model':db[_0x4e00c2[_0x7ae8('0x1d')]],'as':_0x4e00c2['as'],'attributes':_0x4e00c2[_0x7ae8('0x19')],'include':_0x4e00c2[_0x7ae8('0x1b')]?_[_0x7ae8('0x1c')](_0x4e00c2[_0x7ae8('0x1b')],function(_0xae4253){return{'model':db[_0xae4253['model']],'as':_0xae4253['as'],'attributes':_0xae4253[_0x7ae8('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x34baf9){logger[_0x7ae8('0x1e')](_0x7ae8('0x1f'),_0x483b24);logger['debug'](_0x7ae8('0x1f'),_0x483b24,JSON[_0x7ae8('0x20')](_0x34baf9));_0x105b56(_0x34baf9);})[_0x7ae8('0x14')](function(_0x4f5bdf){logger[_0x7ae8('0x12')](_0x7ae8('0x1f'),_0x4f5bdf[_0x7ae8('0x13')],_0x483b24);_0x587d0a(_0x62392[_0x7ae8('0x12')](0x1f4,_0x4f5bdf[_0x7ae8('0x13')]));});});};exports[_0x7ae8('0x21')]=function(_0x63cc2c){var _0x4c86e8=this;return new Promise(function(_0x2be8b7,_0x222507){return db[_0x7ae8('0x15')]['find']({'raw':_0x63cc2c[_0x7ae8('0x16')]?_0x63cc2c[_0x7ae8('0x16')][_0x7ae8('0x17')]===undefined?!![]:![]:!![],'where':_0x63cc2c['options']?_0x63cc2c[_0x7ae8('0x16')]['where']||null:null,'attributes':_0x63cc2c['options']?_0x63cc2c['options'][_0x7ae8('0x19')]||null:null,'include':_0x63cc2c[_0x7ae8('0x16')]?_0x63cc2c['options'][_0x7ae8('0x1b')]?_[_0x7ae8('0x1c')](_0x63cc2c[_0x7ae8('0x16')][_0x7ae8('0x1b')],function(_0x5c4076){return{'model':db[_0x5c4076[_0x7ae8('0x1d')]],'as':_0x5c4076['as'],'attributes':_0x5c4076[_0x7ae8('0x19')],'include':_0x5c4076[_0x7ae8('0x1b')]?_['map'](_0x5c4076[_0x7ae8('0x1b')],function(_0x5bd982){return{'model':db[_0x5bd982[_0x7ae8('0x1d')]],'as':_0x5bd982['as'],'attributes':_0x5bd982[_0x7ae8('0x19')],'include':_0x5bd982[_0x7ae8('0x1b')]?_[_0x7ae8('0x1c')](_0x5bd982['include'],function(_0x2aa1b6){return{'model':db[_0x2aa1b6[_0x7ae8('0x1d')]],'as':_0x2aa1b6['as'],'attributes':_0x2aa1b6[_0x7ae8('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2257cc){logger['info']('ShowChatQueue',_0x63cc2c);logger[_0x7ae8('0xf')]('ShowChatQueue',_0x63cc2c,JSON['stringify'](_0x2257cc));_0x2be8b7(_0x2257cc);})[_0x7ae8('0x14')](function(_0x220285){logger['error'](_0x7ae8('0x21'),_0x220285[_0x7ae8('0x13')],_0x63cc2c);_0x222507(_0x4c86e8[_0x7ae8('0x12')](0x1f4,_0x220285['message']));});});}; \ No newline at end of file +var _0x1a4d=['client','http','redis','defaults','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','include','map','model','find','ShowChatQueue','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x20078c,_0x5c6581){var _0x16e664=function(_0x8466db){while(--_0x8466db){_0x20078c['push'](_0x20078c['shift']());}};_0x16e664(++_0x5c6581);}(_0x1a4d,0x12e));var _0xd1a4=function(_0x2b9ffe,_0x2ab212){_0x2b9ffe=_0x2b9ffe-0x0;var _0x2199fa=_0x1a4d[_0x2b9ffe];return _0x2199fa;};'use strict';var _=require(_0xd1a4('0x0'));var util=require(_0xd1a4('0x1'));var moment=require(_0xd1a4('0x2'));var BPromise=require(_0xd1a4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd1a4('0x4'));var db=require(_0xd1a4('0x5'))['db'];var utils=require(_0xd1a4('0x6'));var logger=require(_0xd1a4('0x7'))(_0xd1a4('0x8'));var config=require('../../config/environment');var jayson=require(_0xd1a4('0x9'));var client=jayson[_0xd1a4('0xa')][_0xd1a4('0xb')]({'port':0x232a});config[_0xd1a4('0xc')]=_[_0xd1a4('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd1a4('0xe'))(new Redis(config[_0xd1a4('0xc')]));require('./chatQueue.socket')[_0xd1a4('0xf')](socket);function respondWithRpcPromise(_0x2d80d5,_0x16ee11,_0x387175){return new BPromise(function(_0x34d3f3,_0x100018){return client[_0xd1a4('0x10')](_0x2d80d5,_0x387175)[_0xd1a4('0x11')](function(_0x2f50cf){logger[_0xd1a4('0x12')](_0xd1a4('0x13'),_0x16ee11,_0xd1a4('0x14'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x16ee11,_0xd1a4('0x14'),JSON[_0xd1a4('0x15')](_0x2f50cf));if(_0x2f50cf['error']){if(_0x2f50cf[_0xd1a4('0x16')]['code']===0x1f4){logger[_0xd1a4('0x16')]('ChatQueue,\x20%s,\x20%s',_0x16ee11,_0x2f50cf[_0xd1a4('0x16')][_0xd1a4('0x17')]);return _0x100018(_0x2f50cf[_0xd1a4('0x16')][_0xd1a4('0x17')]);}logger[_0xd1a4('0x16')](_0xd1a4('0x13'),_0x16ee11,_0x2f50cf['error'][_0xd1a4('0x17')]);return _0x34d3f3(_0x2f50cf[_0xd1a4('0x16')]['message']);}else{logger[_0xd1a4('0x12')](_0xd1a4('0x13'),_0x16ee11,_0xd1a4('0x14'));_0x34d3f3(_0x2f50cf[_0xd1a4('0x18')][_0xd1a4('0x17')]);}})[_0xd1a4('0x19')](function(_0x47393d){logger['error'](_0xd1a4('0x13'),_0x16ee11,_0x47393d);_0x100018(_0x47393d);});});}exports[_0xd1a4('0x1a')]=function(_0x5488b4){var _0x178d15=this;return new Promise(function(_0x43fdde,_0x3cc430){return db[_0xd1a4('0x1b')][_0xd1a4('0x1c')]({'raw':_0x5488b4[_0xd1a4('0x1d')]?_0x5488b4[_0xd1a4('0x1d')][_0xd1a4('0x1e')]===undefined?!![]:![]:!![],'where':_0x5488b4[_0xd1a4('0x1d')]?_0x5488b4[_0xd1a4('0x1d')][_0xd1a4('0x1f')]||null:null,'attributes':_0x5488b4['options']?_0x5488b4[_0xd1a4('0x1d')][_0xd1a4('0x20')]||null:null,'limit':_0x5488b4[_0xd1a4('0x1d')]?_0x5488b4[_0xd1a4('0x1d')]['limit']||null:null,'include':_0x5488b4[_0xd1a4('0x1d')]?_0x5488b4[_0xd1a4('0x1d')][_0xd1a4('0x21')]?_[_0xd1a4('0x22')](_0x5488b4[_0xd1a4('0x1d')]['include'],function(_0x31ef2f){return{'model':db[_0x31ef2f[_0xd1a4('0x23')]],'as':_0x31ef2f['as'],'attributes':_0x31ef2f['attributes'],'include':_0x31ef2f['include']?_[_0xd1a4('0x22')](_0x31ef2f[_0xd1a4('0x21')],function(_0x3f2df1){return{'model':db[_0x3f2df1[_0xd1a4('0x23')]],'as':_0x3f2df1['as'],'attributes':_0x3f2df1[_0xd1a4('0x20')],'include':_0x3f2df1['include']?_[_0xd1a4('0x22')](_0x3f2df1['include'],function(_0x43e949){return{'model':db[_0x43e949[_0xd1a4('0x23')]],'as':_0x43e949['as'],'attributes':_0x43e949['attributes']};}):[]};}):[]};}):[]:[]})[_0xd1a4('0x11')](function(_0x344b1c){logger[_0xd1a4('0x12')](_0xd1a4('0x1a'),_0x5488b4);logger['debug']('GetChatQueue',_0x5488b4,JSON[_0xd1a4('0x15')](_0x344b1c));_0x43fdde(_0x344b1c);})[_0xd1a4('0x19')](function(_0x2233de){logger[_0xd1a4('0x16')](_0xd1a4('0x1a'),_0x2233de[_0xd1a4('0x17')],_0x5488b4);_0x3cc430(_0x178d15[_0xd1a4('0x16')](0x1f4,_0x2233de['message']));});});};exports['ShowChatQueue']=function(_0x131fca){var _0x377509=this;return new Promise(function(_0x463960,_0x277add){return db[_0xd1a4('0x1b')][_0xd1a4('0x24')]({'raw':_0x131fca['options']?_0x131fca['options'][_0xd1a4('0x1e')]===undefined?!![]:![]:!![],'where':_0x131fca[_0xd1a4('0x1d')]?_0x131fca[_0xd1a4('0x1d')][_0xd1a4('0x1f')]||null:null,'attributes':_0x131fca[_0xd1a4('0x1d')]?_0x131fca[_0xd1a4('0x1d')][_0xd1a4('0x20')]||null:null,'include':_0x131fca[_0xd1a4('0x1d')]?_0x131fca[_0xd1a4('0x1d')][_0xd1a4('0x21')]?_['map'](_0x131fca[_0xd1a4('0x1d')][_0xd1a4('0x21')],function(_0x51e637){return{'model':db[_0x51e637['model']],'as':_0x51e637['as'],'attributes':_0x51e637[_0xd1a4('0x20')],'include':_0x51e637[_0xd1a4('0x21')]?_['map'](_0x51e637[_0xd1a4('0x21')],function(_0x1900a9){return{'model':db[_0x1900a9['model']],'as':_0x1900a9['as'],'attributes':_0x1900a9[_0xd1a4('0x20')],'include':_0x1900a9[_0xd1a4('0x21')]?_['map'](_0x1900a9[_0xd1a4('0x21')],function(_0xfbc862){return{'model':db[_0xfbc862[_0xd1a4('0x23')]],'as':_0xfbc862['as'],'attributes':_0xfbc862[_0xd1a4('0x20')]};}):[]};}):[]};}):[]:[]})[_0xd1a4('0x11')](function(_0x7a13a8){logger[_0xd1a4('0x12')](_0xd1a4('0x25'),_0x131fca);logger[_0xd1a4('0x26')](_0xd1a4('0x25'),_0x131fca,JSON[_0xd1a4('0x15')](_0x7a13a8));_0x463960(_0x7a13a8);})[_0xd1a4('0x19')](function(_0x29a7a2){logger[_0xd1a4('0x16')](_0xd1a4('0x25'),_0x29a7a2[_0xd1a4('0x17')],_0x131fca);_0x277add(_0x377509[_0xd1a4('0x16')](0x1f4,_0x29a7a2[_0xd1a4('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index b2f6d34..88a4abb 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 _0x6334=['length','chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x2c04dc,_0x258487){var _0x4569e4=function(_0x1e3d6b){while(--_0x1e3d6b){_0x2c04dc['push'](_0x2c04dc['shift']());}};_0x4569e4(++_0x258487);}(_0x6334,0x119));var _0x4633=function(_0xa4c85,_0x2b52a7){_0xa4c85=_0xa4c85-0x0;var _0x172c1f=_0x6334[_0xa4c85];return _0x172c1f;};'use strict';var ChatQueueEvents=require(_0x4633('0x0'));var events=[_0x4633('0x1'),_0x4633('0x2'),_0x4633('0x3')];function createListener(_0x1e53a0,_0x47254b){return function(_0x5109db){_0x47254b[_0x4633('0x4')](_0x1e53a0,_0x5109db);};}function removeListener(_0x205442,_0x2a2b3c){return function(){ChatQueueEvents[_0x4633('0x5')](_0x205442,_0x2a2b3c);};}exports[_0x4633('0x6')]=function(_0x6493dc){for(var _0x175e14=0x0,_0x4a8997=events[_0x4633('0x7')];_0x175e14<_0x4a8997;_0x175e14++){var _0x56891d=events[_0x175e14];var _0x21af74=createListener(_0x4633('0x8')+_0x56891d,_0x6493dc);ChatQueueEvents['on'](_0x56891d,_0x21af74);}}; \ No newline at end of file +var _0x222f=['./chatQueue.events','save','remove','update','emit','register'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x222f,0x1a4));var _0xf222=function(_0x3dd23c,_0x18c32f){_0x3dd23c=_0x3dd23c-0x0;var _0x520bf8=_0x222f[_0x3dd23c];return _0x520bf8;};'use strict';var ChatQueueEvents=require(_0xf222('0x0'));var events=[_0xf222('0x1'),_0xf222('0x2'),_0xf222('0x3')];function createListener(_0x4d09ec,_0x4b4237){return function(_0x195de1){_0x4b4237[_0xf222('0x4')](_0x4d09ec,_0x195de1);};}function removeListener(_0x307791,_0x7b187d){return function(){ChatQueueEvents['removeListener'](_0x307791,_0x7b187d);};}exports[_0xf222('0x5')]=function(_0x54a758){for(var _0x112e6d=0x0,_0x26f129=events['length'];_0x112e6d<_0x26f129;_0x112e6d++){var _0xf5a105=events[_0x112e6d];var _0x302d7a=createListener('chatQueue:'+_0xf5a105,_0x54a758);ChatQueueEvents['on'](_0xf5a105,_0x302d7a);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 4d0b38e..581980a 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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x2dd370,_0x171bde){var _0x73f7d0=function(_0x2b21a0){while(--_0x2b21a0){_0x2dd370['push'](_0x2dd370['shift']());}};_0x73f7d0(++_0x171bde);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x7411ef,_0x128867){var _0x14cb7c=function(_0x59d5fc){while(--_0x59d5fc){_0x7411ef['push'](_0x7411ef['shift']());}};_0x14cb7c(++_0x128867);}(_0x008c,0x188));var _0xc008=function(_0x384e63,_0x3cdb06){_0x384e63=_0x384e63-0x0;var _0x163527=_0x008c[_0x384e63];return _0x163527;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);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 47542d9..1bb8f12 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 _0x82c2=['STRING','DATE','moment','sequelize'];(function(_0x322576,_0x11756d){var _0x79fa5b=function(_0x435753){while(--_0x435753){_0x322576['push'](_0x322576['shift']());}};_0x79fa5b(++_0x11756d);}(_0x82c2,0x1e6));var _0x282c=function(_0x2d0d97,_0x2d9560){_0x2d0d97=_0x2d0d97-0x0;var _0xfb96e9=_0x82c2[_0x2d0d97];return _0xfb96e9;};'use strict';var moment=require(_0x282c('0x0'));var Sequelize=require(_0x282c('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x282c('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x282c('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x282c('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc018=['STRING','DATE','moment','exports'];(function(_0x4abb02,_0x38c859){var _0xf19f48=function(_0x297eca){while(--_0x297eca){_0x4abb02['push'](_0x4abb02['shift']());}};_0xf19f48(++_0x38c859);}(_0xc018,0xce));var _0x8c01=function(_0x1067f5,_0x219f12){_0x1067f5=_0x1067f5-0x0;var _0x391a4e=_0xc018[_0x1067f5];return _0x391a4e;};'use strict';var moment=require(_0x8c01('0x0'));var Sequelize=require('sequelize');module[_0x8c01('0x1')]={'uniqueid':{'type':Sequelize[_0x8c01('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x8c01('0x2')]},'joinAt':{'type':Sequelize[_0x8c01('0x3')]},'leaveAt':{'type':Sequelize[_0x8c01('0x3')]},'acceptAt':{'type':Sequelize[_0x8c01('0x3')]},'exitAt':{'type':Sequelize[_0x8c01('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 563a6bf..1010c17 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 _0xe574=['hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','options','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','ChatQueueReport','rawAttributes','fieldName','key','model','map','query','filters','intersection','fields','attributes','length'];(function(_0x4fca3e,_0x5dfadb){var _0x56bc36=function(_0x7194bc){while(--_0x7194bc){_0x4fca3e['push'](_0x4fca3e['shift']());}};_0x56bc36(++_0x5dfadb);}(_0xe574,0x100));var _0x4e57=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xe574[_0x46698a];return _0x356db0;};'use strict';var emlformat=require(_0x4e57('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4e57('0x1'));var jsonpatch=require(_0x4e57('0x2'));var rp=require(_0x4e57('0x3'));var moment=require(_0x4e57('0x4'));var BPromise=require(_0x4e57('0x5'));var Mustache=require(_0x4e57('0x6'));var util=require(_0x4e57('0x7'));var path=require(_0x4e57('0x8'));var sox=require(_0x4e57('0x9'));var csv=require(_0x4e57('0xa'));var ejs=require(_0x4e57('0xb'));var fs=require('fs');var fs_extra=require(_0x4e57('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4e57('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4e57('0xa'));var querystring=require(_0x4e57('0xe'));var Papa=require(_0x4e57('0xf'));var Redis=require(_0x4e57('0x10'));var authService=require(_0x4e57('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4e57('0x12'));var hardwareService=require(_0x4e57('0x13'));var logger=require(_0x4e57('0x14'))(_0x4e57('0x15'));var utils=require(_0x4e57('0x16'));var config=require(_0x4e57('0x17'));var licenseUtil=require(_0x4e57('0x18'));var db=require(_0x4e57('0x19'))['db'];function respondWithStatusCode(_0xed8cbc,_0x40c8c8){_0x40c8c8=_0x40c8c8||0xcc;return function(_0x330868){if(_0x330868){return _0xed8cbc[_0x4e57('0x1a')](_0x40c8c8);}return _0xed8cbc[_0x4e57('0x1b')](_0x40c8c8)[_0x4e57('0x1c')]();};}function respondWithResult(_0x28f876,_0x2e9fa8){_0x2e9fa8=_0x2e9fa8||0xc8;return function(_0x4f088a){if(_0x4f088a){return _0x28f876[_0x4e57('0x1b')](_0x2e9fa8)['json'](_0x4f088a);}};}function respondWithFilteredResult(_0x254285,_0x4af0a6){return function(_0x3401c4){if(_0x3401c4){var _0x214957=typeof _0x4af0a6['offset']===_0x4e57('0x1d')&&typeof _0x4af0a6[_0x4e57('0x1e')]===_0x4e57('0x1d');var _0xb06d8=_0x3401c4['count'];var _0x2ed980=_0x214957?0x0:_0x4af0a6[_0x4e57('0x1f')];var _0x3c2978=_0x214957?_0x3401c4[_0x4e57('0x20')]:_0x4af0a6[_0x4e57('0x1f')]+_0x4af0a6['limit'];var _0x182286;if(_0x3c2978>=_0xb06d8){_0x3c2978=_0xb06d8;_0x182286=0xc8;}else{_0x182286=0xce;}_0x254285[_0x4e57('0x1b')](_0x182286);return _0x254285[_0x4e57('0x21')](_0x4e57('0x22'),_0x2ed980+'-'+_0x3c2978+'/'+_0xb06d8)['json'](_0x3401c4);}return null;};}function patchUpdates(_0x372295){return function(_0x59df7a){try{jsonpatch[_0x4e57('0x23')](_0x59df7a,_0x372295,!![]);}catch(_0x5b6127){return BPromise[_0x4e57('0x24')](_0x5b6127);}return _0x59df7a[_0x4e57('0x25')]();};}function saveUpdates(_0x427c6b,_0x43c9a7){return function(_0x45f9cd){if(_0x45f9cd){return _0x45f9cd['update'](_0x427c6b)['then'](function(_0x17e309){return _0x17e309;});}return null;};}function removeEntity(_0x58d6ea,_0x315f7c){return function(_0x4cfa0e){if(_0x4cfa0e){return _0x4cfa0e[_0x4e57('0x26')]()[_0x4e57('0x27')](function(){_0x58d6ea[_0x4e57('0x1b')](0xcc)[_0x4e57('0x1c')]();});}};}function handleEntityNotFound(_0x29df93,_0xc75cb3){return function(_0x4fb5db){if(!_0x4fb5db){_0x29df93[_0x4e57('0x1a')](0x194);}return _0x4fb5db;};}function handleError(_0x316988,_0x503eaa){_0x503eaa=_0x503eaa||0x1f4;return function(_0x36b415){logger[_0x4e57('0x28')](_0x36b415[_0x4e57('0x29')]);if(_0x36b415[_0x4e57('0x2a')]){delete _0x36b415[_0x4e57('0x2a')];}_0x316988[_0x4e57('0x1b')](_0x503eaa)[_0x4e57('0x2b')](_0x36b415);};}exports['index']=function(_0x1a26f6,_0x431794){var _0x1da085={},_0x197bc1={},_0x27a22f={'count':0x0,'rows':[]};var _0x5d55b9=_['map'](db[_0x4e57('0x2c')][_0x4e57('0x2d')],function(_0x3ce391){return{'name':_0x3ce391[_0x4e57('0x2e')],'type':_0x3ce391['type'][_0x4e57('0x2f')]};});_0x197bc1[_0x4e57('0x30')]=_[_0x4e57('0x31')](_0x5d55b9,_0x4e57('0x2a'));_0x197bc1[_0x4e57('0x32')]=_['keys'](_0x1a26f6[_0x4e57('0x32')]);_0x197bc1[_0x4e57('0x33')]=_['intersection'](_0x197bc1[_0x4e57('0x30')],_0x197bc1['query']);_0x1da085['attributes']=_[_0x4e57('0x34')](_0x197bc1[_0x4e57('0x30')],qs[_0x4e57('0x35')](_0x1a26f6['query'][_0x4e57('0x35')]));_0x1da085['attributes']=_0x1da085[_0x4e57('0x36')][_0x4e57('0x37')]?_0x1da085[_0x4e57('0x36')]:_0x197bc1['model'];if(!_0x1a26f6[_0x4e57('0x32')][_0x4e57('0x38')](_0x4e57('0x39'))){_0x1da085[_0x4e57('0x1e')]=qs[_0x4e57('0x1e')](_0x1a26f6[_0x4e57('0x32')][_0x4e57('0x1e')]);_0x1da085[_0x4e57('0x1f')]=qs[_0x4e57('0x1f')](_0x1a26f6[_0x4e57('0x32')][_0x4e57('0x1f')]);}_0x1da085['order']=qs[_0x4e57('0x3a')](_0x1a26f6['query'][_0x4e57('0x3a')]);_0x1da085[_0x4e57('0x3b')]=qs[_0x4e57('0x33')](_[_0x4e57('0x3c')](_0x1a26f6['query'],_0x197bc1['filters']),_0x5d55b9);if(_0x1a26f6[_0x4e57('0x32')][_0x4e57('0x3d')]){_0x1da085[_0x4e57('0x3b')]=_[_0x4e57('0x3e')](_0x1da085[_0x4e57('0x3b')],{'$or':_[_0x4e57('0x31')](_0x5d55b9,function(_0x1ab62){if(_0x1ab62[_0x4e57('0x3f')]!==_0x4e57('0x40')){var _0x4ac448={};_0x4ac448[_0x1ab62[_0x4e57('0x2a')]]={'$like':'%'+_0x1a26f6['query'][_0x4e57('0x3d')]+'%'};return _0x4ac448;}})});}_0x1da085=_[_0x4e57('0x3e')]({},_0x1da085,_0x1a26f6['options']);var _0x1ff9e7={'where':_0x1da085[_0x4e57('0x3b')]};return db[_0x4e57('0x2c')][_0x4e57('0x20')](_0x1ff9e7)[_0x4e57('0x27')](function(_0x386d3a){_0x27a22f[_0x4e57('0x20')]=_0x386d3a;if(_0x1a26f6['query'][_0x4e57('0x41')]){_0x1da085[_0x4e57('0x42')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x4e57('0x43')](_0x1da085);})[_0x4e57('0x27')](function(_0x2ef995){_0x27a22f[_0x4e57('0x44')]=_0x2ef995;return _0x27a22f;})[_0x4e57('0x27')](respondWithFilteredResult(_0x431794,_0x1da085))[_0x4e57('0x45')](handleError(_0x431794,null));};exports['show']=function(_0x2e5e62,_0x3fd1b0){var _0x271551={'raw':!![],'where':{'id':_0x2e5e62[_0x4e57('0x46')]['id']}},_0x330da6={};_0x330da6[_0x4e57('0x30')]=_[_0x4e57('0x47')](db['ChatQueueReport'][_0x4e57('0x2d')]);_0x330da6[_0x4e57('0x32')]=_[_0x4e57('0x47')](_0x2e5e62[_0x4e57('0x32')]);_0x330da6[_0x4e57('0x33')]=_['intersection'](_0x330da6[_0x4e57('0x30')],_0x330da6[_0x4e57('0x32')]);_0x271551[_0x4e57('0x36')]=_[_0x4e57('0x34')](_0x330da6[_0x4e57('0x30')],qs[_0x4e57('0x35')](_0x2e5e62[_0x4e57('0x32')][_0x4e57('0x35')]));_0x271551[_0x4e57('0x36')]=_0x271551[_0x4e57('0x36')]['length']?_0x271551['attributes']:_0x330da6['model'];if(_0x2e5e62[_0x4e57('0x32')][_0x4e57('0x41')]){_0x271551[_0x4e57('0x42')]=[{'all':!![]}];}_0x271551=_[_0x4e57('0x3e')]({},_0x271551,_0x2e5e62[_0x4e57('0x48')]);return db[_0x4e57('0x2c')][_0x4e57('0x49')](_0x271551)[_0x4e57('0x27')](handleEntityNotFound(_0x3fd1b0,null))[_0x4e57('0x27')](respondWithResult(_0x3fd1b0,null))[_0x4e57('0x45')](handleError(_0x3fd1b0,null));};exports[_0x4e57('0x4a')]=function(_0xe5c591,_0x423986){return db['ChatQueueReport'][_0x4e57('0x4a')](_0xe5c591[_0x4e57('0x4b')],{})[_0x4e57('0x27')](respondWithResult(_0x423986,0xc9))[_0x4e57('0x45')](handleError(_0x423986,null));};exports[_0x4e57('0x4c')]=function(_0x41d476,_0x48869d){if(_0x41d476[_0x4e57('0x4b')]['id']){delete _0x41d476[_0x4e57('0x4b')]['id'];}return db[_0x4e57('0x2c')][_0x4e57('0x49')]({'where':{'id':_0x41d476[_0x4e57('0x46')]['id']}})[_0x4e57('0x27')](handleEntityNotFound(_0x48869d,null))[_0x4e57('0x27')](saveUpdates(_0x41d476[_0x4e57('0x4b')],null))['then'](respondWithResult(_0x48869d,null))[_0x4e57('0x45')](handleError(_0x48869d,null));};exports['destroy']=function(_0x3deb47,_0x328c2c){return db[_0x4e57('0x2c')]['find']({'where':{'id':_0x3deb47[_0x4e57('0x46')]['id']}})['then'](handleEntityNotFound(_0x328c2c,null))[_0x4e57('0x27')](removeEntity(_0x328c2c,null))[_0x4e57('0x45')](handleError(_0x328c2c,null));};exports[_0x4e57('0x4d')]=function(_0x139891,_0x12e2df){return db[_0x4e57('0x2c')][_0x4e57('0x4d')]()['then'](respondWithResult(_0x12e2df,null))['catch'](handleError(_0x12e2df,null));}; \ No newline at end of file +var _0x0f4d=['query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','merge','type','options','include','findAll','rows','catch','rawAttributes','find','create','body','params','describe','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','stack','name','send','index','map','ChatQueueReport','model'];(function(_0x557553,_0x39a87e){var _0x1649f4=function(_0x47132b){while(--_0x47132b){_0x557553['push'](_0x557553['shift']());}};_0x1649f4(++_0x39a87e);}(_0x0f4d,0x12c));var _0xd0f4=function(_0x3959c6,_0x4c5f77){_0x3959c6=_0x3959c6-0x0;var _0x1de322=_0x0f4d[_0x3959c6];return _0x1de322;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd0f4('0x0'));var rp=require('request-promise');var moment=require(_0xd0f4('0x1'));var BPromise=require(_0xd0f4('0x2'));var Mustache=require(_0xd0f4('0x3'));var util=require(_0xd0f4('0x4'));var path=require(_0xd0f4('0x5'));var sox=require(_0xd0f4('0x6'));var csv=require(_0xd0f4('0x7'));var ejs=require(_0xd0f4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd0f4('0x9'));var squel=require(_0xd0f4('0xa'));var crypto=require('crypto');var jsforce=require(_0xd0f4('0xb'));var deskjs=require(_0xd0f4('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd0f4('0xd'));var Papa=require(_0xd0f4('0xe'));var Redis=require('ioredis');var authService=require(_0xd0f4('0xf'));var qs=require(_0xd0f4('0x10'));var as=require(_0xd0f4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd0f4('0x12'));var utils=require(_0xd0f4('0x13'));var config=require(_0xd0f4('0x14'));var licenseUtil=require(_0xd0f4('0x15'));var db=require(_0xd0f4('0x16'))['db'];function respondWithStatusCode(_0x64232c,_0x134492){_0x134492=_0x134492||0xcc;return function(_0x5679a7){if(_0x5679a7){return _0x64232c[_0xd0f4('0x17')](_0x134492);}return _0x64232c[_0xd0f4('0x18')](_0x134492)['end']();};}function respondWithResult(_0x104d48,_0x536d71){_0x536d71=_0x536d71||0xc8;return function(_0x828792){if(_0x828792){return _0x104d48['status'](_0x536d71)[_0xd0f4('0x19')](_0x828792);}};}function respondWithFilteredResult(_0x4d5aef,_0x4afe4d){return function(_0x54b806){if(_0x54b806){var _0x45b32e=typeof _0x4afe4d[_0xd0f4('0x1a')]===_0xd0f4('0x1b')&&typeof _0x4afe4d[_0xd0f4('0x1c')]===_0xd0f4('0x1b');var _0x10acbe=_0x54b806[_0xd0f4('0x1d')];var _0x35be48=_0x45b32e?0x0:_0x4afe4d[_0xd0f4('0x1a')];var _0x5de07b=_0x45b32e?_0x54b806[_0xd0f4('0x1d')]:_0x4afe4d[_0xd0f4('0x1a')]+_0x4afe4d[_0xd0f4('0x1c')];var _0xa0662;if(_0x5de07b>=_0x10acbe){_0x5de07b=_0x10acbe;_0xa0662=0xc8;}else{_0xa0662=0xce;}_0x4d5aef['status'](_0xa0662);return _0x4d5aef[_0xd0f4('0x1e')](_0xd0f4('0x1f'),_0x35be48+'-'+_0x5de07b+'/'+_0x10acbe)[_0xd0f4('0x19')](_0x54b806);}return null;};}function patchUpdates(_0x208a6f){return function(_0x4e1689){try{jsonpatch[_0xd0f4('0x20')](_0x4e1689,_0x208a6f,!![]);}catch(_0xda1d14){return BPromise[_0xd0f4('0x21')](_0xda1d14);}return _0x4e1689[_0xd0f4('0x22')]();};}function saveUpdates(_0x14ba70,_0x2a1df0){return function(_0x25ee43){if(_0x25ee43){return _0x25ee43['update'](_0x14ba70)[_0xd0f4('0x23')](function(_0x327696){return _0x327696;});}return null;};}function removeEntity(_0x20e0c8,_0x299904){return function(_0x4d49c0){if(_0x4d49c0){return _0x4d49c0[_0xd0f4('0x24')]()['then'](function(){_0x20e0c8[_0xd0f4('0x18')](0xcc)[_0xd0f4('0x25')]();});}};}function handleEntityNotFound(_0x1cf493,_0x567eb4){return function(_0x42d944){if(!_0x42d944){_0x1cf493[_0xd0f4('0x17')](0x194);}return _0x42d944;};}function handleError(_0x459931,_0x1ed6e2){_0x1ed6e2=_0x1ed6e2||0x1f4;return function(_0x366af6){logger['error'](_0x366af6[_0xd0f4('0x26')]);if(_0x366af6[_0xd0f4('0x27')]){delete _0x366af6[_0xd0f4('0x27')];}_0x459931[_0xd0f4('0x18')](_0x1ed6e2)[_0xd0f4('0x28')](_0x366af6);};}exports[_0xd0f4('0x29')]=function(_0x1d3246,_0x33eb58){var _0x3cb97c={},_0x4cff90={},_0x42a44f={'count':0x0,'rows':[]};var _0x2df1ed=_[_0xd0f4('0x2a')](db[_0xd0f4('0x2b')]['rawAttributes'],function(_0x4058d7){return{'name':_0x4058d7['fieldName'],'type':_0x4058d7['type']['key']};});_0x4cff90[_0xd0f4('0x2c')]=_[_0xd0f4('0x2a')](_0x2df1ed,_0xd0f4('0x27'));_0x4cff90[_0xd0f4('0x2d')]=_[_0xd0f4('0x2e')](_0x1d3246[_0xd0f4('0x2d')]);_0x4cff90[_0xd0f4('0x2f')]=_[_0xd0f4('0x30')](_0x4cff90['model'],_0x4cff90[_0xd0f4('0x2d')]);_0x3cb97c['attributes']=_[_0xd0f4('0x30')](_0x4cff90[_0xd0f4('0x2c')],qs['fields'](_0x1d3246['query'][_0xd0f4('0x31')]));_0x3cb97c['attributes']=_0x3cb97c[_0xd0f4('0x32')][_0xd0f4('0x33')]?_0x3cb97c['attributes']:_0x4cff90[_0xd0f4('0x2c')];if(!_0x1d3246[_0xd0f4('0x2d')]['hasOwnProperty']('nolimit')){_0x3cb97c[_0xd0f4('0x1c')]=qs[_0xd0f4('0x1c')](_0x1d3246['query'][_0xd0f4('0x1c')]);_0x3cb97c['offset']=qs[_0xd0f4('0x1a')](_0x1d3246[_0xd0f4('0x2d')]['offset']);}_0x3cb97c[_0xd0f4('0x34')]=qs[_0xd0f4('0x35')](_0x1d3246[_0xd0f4('0x2d')][_0xd0f4('0x35')]);_0x3cb97c[_0xd0f4('0x36')]=qs['filters'](_[_0xd0f4('0x37')](_0x1d3246[_0xd0f4('0x2d')],_0x4cff90[_0xd0f4('0x2f')]),_0x2df1ed);if(_0x1d3246[_0xd0f4('0x2d')]['filter']){_0x3cb97c[_0xd0f4('0x36')]=_[_0xd0f4('0x38')](_0x3cb97c[_0xd0f4('0x36')],{'$or':_[_0xd0f4('0x2a')](_0x2df1ed,function(_0xd109a4){if(_0xd109a4[_0xd0f4('0x39')]!=='VIRTUAL'){var _0x269629={};_0x269629[_0xd109a4[_0xd0f4('0x27')]]={'$like':'%'+_0x1d3246[_0xd0f4('0x2d')]['filter']+'%'};return _0x269629;}})});}_0x3cb97c=_[_0xd0f4('0x38')]({},_0x3cb97c,_0x1d3246[_0xd0f4('0x3a')]);var _0x4bebe8={'where':_0x3cb97c[_0xd0f4('0x36')]};return db[_0xd0f4('0x2b')]['count'](_0x4bebe8)['then'](function(_0x3bb4ab){_0x42a44f[_0xd0f4('0x1d')]=_0x3bb4ab;if(_0x1d3246[_0xd0f4('0x2d')]['includeAll']){_0x3cb97c[_0xd0f4('0x3b')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xd0f4('0x3c')](_0x3cb97c);})['then'](function(_0x29439d){_0x42a44f[_0xd0f4('0x3d')]=_0x29439d;return _0x42a44f;})[_0xd0f4('0x23')](respondWithFilteredResult(_0x33eb58,_0x3cb97c))[_0xd0f4('0x3e')](handleError(_0x33eb58,null));};exports['show']=function(_0x10509e,_0x198e47){var _0xb02892={'raw':!![],'where':{'id':_0x10509e['params']['id']}},_0x4c8b9a={};_0x4c8b9a[_0xd0f4('0x2c')]=_[_0xd0f4('0x2e')](db[_0xd0f4('0x2b')][_0xd0f4('0x3f')]);_0x4c8b9a[_0xd0f4('0x2d')]=_[_0xd0f4('0x2e')](_0x10509e[_0xd0f4('0x2d')]);_0x4c8b9a[_0xd0f4('0x2f')]=_[_0xd0f4('0x30')](_0x4c8b9a[_0xd0f4('0x2c')],_0x4c8b9a[_0xd0f4('0x2d')]);_0xb02892[_0xd0f4('0x32')]=_['intersection'](_0x4c8b9a[_0xd0f4('0x2c')],qs[_0xd0f4('0x31')](_0x10509e['query'][_0xd0f4('0x31')]));_0xb02892[_0xd0f4('0x32')]=_0xb02892[_0xd0f4('0x32')][_0xd0f4('0x33')]?_0xb02892[_0xd0f4('0x32')]:_0x4c8b9a[_0xd0f4('0x2c')];if(_0x10509e[_0xd0f4('0x2d')]['includeAll']){_0xb02892[_0xd0f4('0x3b')]=[{'all':!![]}];}_0xb02892=_[_0xd0f4('0x38')]({},_0xb02892,_0x10509e[_0xd0f4('0x3a')]);return db['ChatQueueReport'][_0xd0f4('0x40')](_0xb02892)[_0xd0f4('0x23')](handleEntityNotFound(_0x198e47,null))[_0xd0f4('0x23')](respondWithResult(_0x198e47,null))[_0xd0f4('0x3e')](handleError(_0x198e47,null));};exports[_0xd0f4('0x41')]=function(_0x563759,_0x54bb8d){return db['ChatQueueReport'][_0xd0f4('0x41')](_0x563759[_0xd0f4('0x42')],{})[_0xd0f4('0x23')](respondWithResult(_0x54bb8d,0xc9))[_0xd0f4('0x3e')](handleError(_0x54bb8d,null));};exports['update']=function(_0x31db89,_0x1b1baa){if(_0x31db89['body']['id']){delete _0x31db89[_0xd0f4('0x42')]['id'];}return db[_0xd0f4('0x2b')][_0xd0f4('0x40')]({'where':{'id':_0x31db89[_0xd0f4('0x43')]['id']}})[_0xd0f4('0x23')](handleEntityNotFound(_0x1b1baa,null))[_0xd0f4('0x23')](saveUpdates(_0x31db89[_0xd0f4('0x42')],null))[_0xd0f4('0x23')](respondWithResult(_0x1b1baa,null))[_0xd0f4('0x3e')](handleError(_0x1b1baa,null));};exports[_0xd0f4('0x24')]=function(_0x431df3,_0x120c17){return db[_0xd0f4('0x2b')]['find']({'where':{'id':_0x431df3[_0xd0f4('0x43')]['id']}})[_0xd0f4('0x23')](handleEntityNotFound(_0x120c17,null))[_0xd0f4('0x23')](removeEntity(_0x120c17,null))['catch'](handleError(_0x120c17,null));};exports[_0xd0f4('0x44')]=function(_0x3f8bcc,_0x1d8543){return db['ChatQueueReport'][_0xd0f4('0x44')]()['then'](respondWithResult(_0x1d8543,null))[_0xd0f4('0x3e')](handleError(_0x1d8543,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 17ccc4c..0ab4498 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 _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0xb10b,0x12a));var _0xbb10=function(_0x3a8dc1,_0x2f03b8){_0x3a8dc1=_0x3a8dc1-0x0;var _0x4b3595=_0xb10b[_0x3a8dc1];return _0x4b3595;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x2f0057,_0x448b27){var _0x17f2c3=function(_0x12efc3){while(--_0x12efc3){_0x2f0057['push'](_0x2f0057['shift']());}};_0x17f2c3(++_0x448b27);}(_0xe706,0xa3));var _0x6e70=function(_0x4e294f,_0x14d4d9){_0x4e294f=_0x4e294f-0x0;var _0xb92bf7=_0xe706[_0x4e294f];return _0xb92bf7;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 660dac9..c9cf1c4 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 _0xc010=['attributes','UpdateChatQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','update','where'];(function(_0x3f3e42,_0x43128b){var _0x45c9d5=function(_0x39ccb9){while(--_0x39ccb9){_0x3f3e42['push'](_0x3f3e42['shift']());}};_0x45c9d5(++_0x43128b);}(_0xc010,0x195));var _0x0c01=function(_0x1e5523,_0x5245c5){_0x1e5523=_0x1e5523-0x0;var _0x2d97dd=_0xc010[_0x1e5523];return _0x2d97dd;};'use strict';var _=require(_0x0c01('0x0'));var util=require(_0x0c01('0x1'));var moment=require(_0x0c01('0x2'));var BPromise=require('bluebird');var rs=require(_0x0c01('0x3'));var fs=require('fs');var Redis=require(_0x0c01('0x4'));var db=require(_0x0c01('0x5'))['db'];var utils=require(_0x0c01('0x6'));var logger=require('../../config/logger')(_0x0c01('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0c01('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52630b,_0x1a764d,_0x3b8b7b){return new BPromise(function(_0xc68297,_0x1fda02){return client['request'](_0x52630b,_0x3b8b7b)[_0x0c01('0x9')](function(_0x37ce39){logger[_0x0c01('0xa')](_0x0c01('0xb'),_0x1a764d,'request\x20sent');logger[_0x0c01('0xc')](_0x0c01('0xd'),_0x1a764d,_0x0c01('0xe'),JSON[_0x0c01('0xf')](_0x37ce39));if(_0x37ce39[_0x0c01('0x10')]){if(_0x37ce39[_0x0c01('0x10')][_0x0c01('0x11')]===0x1f4){logger[_0x0c01('0x10')](_0x0c01('0xb'),_0x1a764d,_0x37ce39[_0x0c01('0x10')][_0x0c01('0x12')]);return _0x1fda02(_0x37ce39[_0x0c01('0x10')]['message']);}logger[_0x0c01('0x10')](_0x0c01('0xb'),_0x1a764d,_0x37ce39['error'][_0x0c01('0x12')]);return _0xc68297(_0x37ce39[_0x0c01('0x10')][_0x0c01('0x12')]);}else{logger[_0x0c01('0xa')](_0x0c01('0xb'),_0x1a764d,_0x0c01('0xe'));_0xc68297(_0x37ce39[_0x0c01('0x13')][_0x0c01('0x12')]);}})[_0x0c01('0x14')](function(_0x1b3c5c){logger[_0x0c01('0x10')](_0x0c01('0xb'),_0x1a764d,_0x1b3c5c);_0x1fda02(_0x1b3c5c);});});}exports[_0x0c01('0x15')]=function(_0x4ea859){var _0x5d0f05=this;return new Promise(function(_0x2996c6,_0xa2c656){return db[_0x0c01('0x16')][_0x0c01('0x17')](_0x4ea859[_0x0c01('0x18')],{'raw':_0x4ea859[_0x0c01('0x19')]?_0x4ea859[_0x0c01('0x19')][_0x0c01('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x6454a0){logger[_0x0c01('0xa')](_0x0c01('0x15'),_0x4ea859);logger[_0x0c01('0xc')]('CreateChatQueueReport',_0x4ea859,JSON[_0x0c01('0xf')](_0x6454a0));_0x2996c6(_0x6454a0);})[_0x0c01('0x14')](function(_0x1caa1a){logger[_0x0c01('0x10')](_0x0c01('0x15'),_0x1caa1a['message'],_0x4ea859);_0xa2c656(_0x5d0f05[_0x0c01('0x10')](0x1f4,_0x1caa1a[_0x0c01('0x12')]));});});};exports['UpdateChatQueueReport']=function(_0x30e578){var _0x589b33=this;return new Promise(function(_0x40cd1e,_0x3895d7){return db['ChatQueueReport'][_0x0c01('0x1b')](_0x30e578[_0x0c01('0x18')],{'raw':_0x30e578['options']?_0x30e578[_0x0c01('0x19')][_0x0c01('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30e578[_0x0c01('0x19')]?_0x30e578[_0x0c01('0x19')][_0x0c01('0x1c')]||null:null,'attributes':_0x30e578[_0x0c01('0x19')]?_0x30e578[_0x0c01('0x19')][_0x0c01('0x1d')]||null:null,'limit':_0x30e578[_0x0c01('0x19')]?_0x30e578[_0x0c01('0x19')]['limit']||null:null})[_0x0c01('0x9')](function(_0x481035){logger[_0x0c01('0xa')](_0x0c01('0x1e'),_0x30e578);logger['debug'](_0x0c01('0x1e'),_0x30e578,JSON['stringify'](_0x481035));_0x40cd1e(_0x481035);})[_0x0c01('0x14')](function(_0x38c914){logger['error'](_0x0c01('0x1e'),_0x38c914['message'],_0x30e578);_0x3895d7(_0x589b33['error'](0x1f4,_0x38c914[_0x0c01('0x12')]));});});}; \ No newline at end of file +var _0xa3af=['http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatQueueReport','create','body','options','raw','UpdateChatQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x288d33,_0x58ee36){var _0x1033bd=function(_0x2e22f1){while(--_0x2e22f1){_0x288d33['push'](_0x288d33['shift']());}};_0x1033bd(++_0x58ee36);}(_0xa3af,0x1ae));var _0xfa3a=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa3af[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xfa3a('0x0'));var util=require(_0xfa3a('0x1'));var moment=require(_0xfa3a('0x2'));var BPromise=require(_0xfa3a('0x3'));var rs=require(_0xfa3a('0x4'));var fs=require('fs');var Redis=require(_0xfa3a('0x5'));var db=require(_0xfa3a('0x6'))['db'];var utils=require(_0xfa3a('0x7'));var logger=require('../../config/logger')(_0xfa3a('0x8'));var config=require(_0xfa3a('0x9'));var jayson=require(_0xfa3a('0xa'));var client=jayson[_0xfa3a('0xb')][_0xfa3a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x292555,_0x124ff0,_0x488a7a){return new BPromise(function(_0x1e5a51,_0x1015bc){return client['request'](_0x292555,_0x488a7a)[_0xfa3a('0xd')](function(_0x4feb88){logger[_0xfa3a('0xe')](_0xfa3a('0xf'),_0x124ff0,_0xfa3a('0x10'));logger[_0xfa3a('0x11')](_0xfa3a('0x12'),_0x124ff0,_0xfa3a('0x10'),JSON[_0xfa3a('0x13')](_0x4feb88));if(_0x4feb88[_0xfa3a('0x14')]){if(_0x4feb88['error']['code']===0x1f4){logger[_0xfa3a('0x14')](_0xfa3a('0xf'),_0x124ff0,_0x4feb88[_0xfa3a('0x14')][_0xfa3a('0x15')]);return _0x1015bc(_0x4feb88[_0xfa3a('0x14')][_0xfa3a('0x15')]);}logger[_0xfa3a('0x14')]('ChatQueueReport,\x20%s,\x20%s',_0x124ff0,_0x4feb88[_0xfa3a('0x14')]['message']);return _0x1e5a51(_0x4feb88[_0xfa3a('0x14')]['message']);}else{logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x124ff0,_0xfa3a('0x10'));_0x1e5a51(_0x4feb88[_0xfa3a('0x16')][_0xfa3a('0x15')]);}})[_0xfa3a('0x17')](function(_0x303d49){logger['error'](_0xfa3a('0xf'),_0x124ff0,_0x303d49);_0x1015bc(_0x303d49);});});}exports[_0xfa3a('0x18')]=function(_0x4745b8){var _0x2085d8=this;return new Promise(function(_0x4d10be,_0x2e575f){return db['ChatQueueReport'][_0xfa3a('0x19')](_0x4745b8[_0xfa3a('0x1a')],{'raw':_0x4745b8[_0xfa3a('0x1b')]?_0x4745b8[_0xfa3a('0x1b')][_0xfa3a('0x1c')]===undefined?!![]:![]:!![]})[_0xfa3a('0xd')](function(_0x2f3cb0){logger['info'](_0xfa3a('0x18'),_0x4745b8);logger['debug'](_0xfa3a('0x18'),_0x4745b8,JSON[_0xfa3a('0x13')](_0x2f3cb0));_0x4d10be(_0x2f3cb0);})[_0xfa3a('0x17')](function(_0x4c0883){logger[_0xfa3a('0x14')]('CreateChatQueueReport',_0x4c0883[_0xfa3a('0x15')],_0x4745b8);_0x2e575f(_0x2085d8[_0xfa3a('0x14')](0x1f4,_0x4c0883[_0xfa3a('0x15')]));});});};exports[_0xfa3a('0x1d')]=function(_0x19a5a3){var _0x491169=this;return new Promise(function(_0xc269f3,_0x22afd1){return db['ChatQueueReport'][_0xfa3a('0x1e')](_0x19a5a3[_0xfa3a('0x1a')],{'raw':_0x19a5a3['options']?_0x19a5a3[_0xfa3a('0x1b')][_0xfa3a('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19a5a3[_0xfa3a('0x1b')]?_0x19a5a3[_0xfa3a('0x1b')][_0xfa3a('0x1f')]||null:null,'attributes':_0x19a5a3['options']?_0x19a5a3[_0xfa3a('0x1b')][_0xfa3a('0x20')]||null:null,'limit':_0x19a5a3[_0xfa3a('0x1b')]?_0x19a5a3[_0xfa3a('0x1b')][_0xfa3a('0x21')]||null:null})[_0xfa3a('0xd')](function(_0x42ebcd){logger[_0xfa3a('0xe')](_0xfa3a('0x1d'),_0x19a5a3);logger[_0xfa3a('0x11')](_0xfa3a('0x1d'),_0x19a5a3,JSON[_0xfa3a('0x13')](_0x42ebcd));_0xc269f3(_0x42ebcd);})['catch'](function(_0x17f79b){logger[_0xfa3a('0x14')](_0xfa3a('0x1d'),_0x17f79b[_0xfa3a('0x15')],_0x19a5a3);_0x22afd1(_0x491169[_0xfa3a('0x14')](0x1f4,_0x17f79b['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 9b0fa0d..affa7db 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 _0x9913=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','put'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x9913,0x1bd));var _0x3991=function(_0x3ee55a,_0x19aeea){_0x3ee55a=_0x3ee55a-0x0;var _0x581800=_0x9913[_0x3ee55a];return _0x581800;};'use strict';var multer=require('multer');var util=require(_0x3991('0x0'));var path=require(_0x3991('0x1'));var timeout=require(_0x3991('0x2'));var express=require(_0x3991('0x3'));var router=express[_0x3991('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3991('0x5'));var interaction=require(_0x3991('0x6'));var config=require(_0x3991('0x7'));var controller=require('./chatQueueReport.controller');router[_0x3991('0x8')]('/',auth[_0x3991('0x9')](),controller['index']);router['get'](_0x3991('0xa'),auth[_0x3991('0x9')](),controller[_0x3991('0xb')]);router[_0x3991('0x8')](_0x3991('0xc'),auth[_0x3991('0x9')](),controller[_0x3991('0xd')]);router[_0x3991('0xe')]('/',auth[_0x3991('0x9')](),controller[_0x3991('0xf')]);router[_0x3991('0x10')](_0x3991('0xc'),auth[_0x3991('0x9')](),controller[_0x3991('0x11')]);router[_0x3991('0x12')](_0x3991('0xc'),auth[_0x3991('0x9')](),controller[_0x3991('0x13')]);module[_0x3991('0x14')]=router; \ No newline at end of file +var _0xe394=['delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe394,0xea));var _0x4e39=function(_0x285d14,_0x4d9702){_0x285d14=_0x285d14-0x0;var _0x5ee1ba=_0xe394[_0x285d14];return _0x5ee1ba;};'use strict';var multer=require(_0x4e39('0x0'));var util=require(_0x4e39('0x1'));var path=require(_0x4e39('0x2'));var timeout=require(_0x4e39('0x3'));var express=require('express');var router=express[_0x4e39('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4e39('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4e39('0x6'));var controller=require(_0x4e39('0x7'));router[_0x4e39('0x8')]('/',auth[_0x4e39('0x9')](),controller[_0x4e39('0xa')]);router[_0x4e39('0x8')](_0x4e39('0xb'),auth[_0x4e39('0x9')](),controller[_0x4e39('0xc')]);router[_0x4e39('0x8')](_0x4e39('0xd'),auth[_0x4e39('0x9')](),controller[_0x4e39('0xe')]);router[_0x4e39('0xf')]('/',auth[_0x4e39('0x9')](),controller[_0x4e39('0x10')]);router['put'](_0x4e39('0xd'),auth['isAuthenticated'](),controller[_0x4e39('0x11')]);router[_0x4e39('0x12')](_0x4e39('0xd'),auth[_0x4e39('0x9')](),controller[_0x4e39('0x13')]);module[_0x4e39('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index d8303eb..954015f 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x2fbcd3,_0xbb2e27){var _0x201573=function(_0x4846b9){while(--_0x4846b9){_0x2fbcd3['push'](_0x2fbcd3['shift']());}};_0x201573(++_0xbb2e27);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x3af54c,_0x436158){var _0x4bc816=function(_0x44381e){while(--_0x44381e){_0x3af54c['push'](_0x3af54c['shift']());}};_0x4bc816(++_0x436158);}(_0x54ef,0x112));var _0xf54e=function(_0x48e7a7,_0x28c134){_0x48e7a7=_0x48e7a7-0x0;var _0x1f14ba=_0x54ef[_0x48e7a7];return _0x1f14ba;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 7922771..ce2b12d 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 _0x2317=['show','params','create','body','find','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x2317,0x16d));var _0x7231=function(_0x4f50f4,_0x2f182c){_0x4f50f4=_0x4f50f4-0x0;var _0x14dec0=_0x2317[_0x4f50f4];return _0x14dec0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7231('0x0'));var zipdir=require(_0x7231('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7231('0x2'));var moment=require(_0x7231('0x3'));var BPromise=require(_0x7231('0x4'));var Mustache=require('mustache');var util=require(_0x7231('0x5'));var path=require('path');var sox=require(_0x7231('0x6'));var csv=require(_0x7231('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7231('0x8'));var _=require(_0x7231('0x9'));var squel=require(_0x7231('0xa'));var crypto=require(_0x7231('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7231('0xc'));var toCsv=require(_0x7231('0x7'));var querystring=require(_0x7231('0xd'));var Papa=require(_0x7231('0xe'));var Redis=require('ioredis');var authService=require(_0x7231('0xf'));var qs=require(_0x7231('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7231('0x11'));var logger=require(_0x7231('0x12'))(_0x7231('0x13'));var utils=require(_0x7231('0x14'));var config=require(_0x7231('0x15'));var licenseUtil=require(_0x7231('0x16'));var db=require(_0x7231('0x17'))['db'];function respondWithStatusCode(_0x4e6e16,_0x9c2b05){_0x9c2b05=_0x9c2b05||0xcc;return function(_0x39a625){if(_0x39a625){return _0x4e6e16['sendStatus'](_0x9c2b05);}return _0x4e6e16['status'](_0x9c2b05)[_0x7231('0x18')]();};}function respondWithResult(_0x4124cb,_0x4d2e47){_0x4d2e47=_0x4d2e47||0xc8;return function(_0x2776e7){if(_0x2776e7){return _0x4124cb[_0x7231('0x19')](_0x4d2e47)[_0x7231('0x1a')](_0x2776e7);}};}function respondWithFilteredResult(_0x5a2baa,_0x1b36f4){return function(_0x11ae0c){if(_0x11ae0c){var _0x4a84b3=typeof _0x1b36f4[_0x7231('0x1b')]===_0x7231('0x1c')&&typeof _0x1b36f4['limit']===_0x7231('0x1c');var _0x3fd9d2=_0x11ae0c[_0x7231('0x1d')];var _0x1f8915=_0x4a84b3?0x0:_0x1b36f4[_0x7231('0x1b')];var _0x295b9d=_0x4a84b3?_0x11ae0c[_0x7231('0x1d')]:_0x1b36f4[_0x7231('0x1b')]+_0x1b36f4[_0x7231('0x1e')];var _0x275ba7;if(_0x295b9d>=_0x3fd9d2){_0x295b9d=_0x3fd9d2;_0x275ba7=0xc8;}else{_0x275ba7=0xce;}_0x5a2baa['status'](_0x275ba7);return _0x5a2baa[_0x7231('0x1f')]('Content-Range',_0x1f8915+'-'+_0x295b9d+'/'+_0x3fd9d2)[_0x7231('0x1a')](_0x11ae0c);}return null;};}function patchUpdates(_0x12c1fc){return function(_0x107610){try{jsonpatch[_0x7231('0x20')](_0x107610,_0x12c1fc,!![]);}catch(_0x1aab69){return BPromise[_0x7231('0x21')](_0x1aab69);}return _0x107610[_0x7231('0x22')]();};}function saveUpdates(_0x513497,_0x5ebd00){return function(_0x57f611){if(_0x57f611){return _0x57f611[_0x7231('0x23')](_0x513497)[_0x7231('0x24')](function(_0x1310cd){return _0x1310cd;});}return null;};}function removeEntity(_0x5165cb,_0x4984e0){return function(_0x173f4b){if(_0x173f4b){return _0x173f4b[_0x7231('0x25')]()['then'](function(){_0x5165cb[_0x7231('0x19')](0xcc)[_0x7231('0x18')]();});}};}function handleEntityNotFound(_0x5a1054,_0x1ff7f3){return function(_0x42be85){if(!_0x42be85){_0x5a1054[_0x7231('0x26')](0x194);}return _0x42be85;};}function handleError(_0x2e5639,_0x43e4c0){_0x43e4c0=_0x43e4c0||0x1f4;return function(_0x8172d2){logger[_0x7231('0x27')](_0x8172d2['stack']);if(_0x8172d2[_0x7231('0x28')]){delete _0x8172d2[_0x7231('0x28')];}_0x2e5639[_0x7231('0x19')](_0x43e4c0)[_0x7231('0x29')](_0x8172d2);};}exports[_0x7231('0x2a')]=function(_0xa7dc44,_0x4c0d9f){var _0x34aa62={},_0x51a0cd={},_0x3fb40e={'count':0x0,'rows':[]};var _0x3b6657=_[_0x7231('0x2b')](db[_0x7231('0x2c')][_0x7231('0x2d')],function(_0x3dd8f4){return{'name':_0x3dd8f4[_0x7231('0x2e')],'type':_0x3dd8f4['type'][_0x7231('0x2f')]};});_0x51a0cd[_0x7231('0x30')]=_[_0x7231('0x2b')](_0x3b6657,_0x7231('0x28'));_0x51a0cd[_0x7231('0x31')]=_[_0x7231('0x32')](_0xa7dc44[_0x7231('0x31')]);_0x51a0cd['filters']=_[_0x7231('0x33')](_0x51a0cd[_0x7231('0x30')],_0x51a0cd[_0x7231('0x31')]);_0x34aa62[_0x7231('0x34')]=_[_0x7231('0x33')](_0x51a0cd['model'],qs[_0x7231('0x35')](_0xa7dc44['query'][_0x7231('0x35')]));_0x34aa62[_0x7231('0x34')]=_0x34aa62[_0x7231('0x34')]['length']?_0x34aa62[_0x7231('0x34')]:_0x51a0cd['model'];if(!_0xa7dc44[_0x7231('0x31')][_0x7231('0x36')]('nolimit')){_0x34aa62[_0x7231('0x1e')]=qs[_0x7231('0x1e')](_0xa7dc44[_0x7231('0x31')]['limit']);_0x34aa62['offset']=qs['offset'](_0xa7dc44[_0x7231('0x31')]['offset']);}_0x34aa62[_0x7231('0x37')]=qs[_0x7231('0x38')](_0xa7dc44['query'][_0x7231('0x38')]);_0x34aa62[_0x7231('0x39')]=qs['filters'](_[_0x7231('0x3a')](_0xa7dc44['query'],_0x51a0cd['filters']),_0x3b6657);if(_0xa7dc44[_0x7231('0x31')]['filter']){_0x34aa62['where']=_[_0x7231('0x3b')](_0x34aa62[_0x7231('0x39')],{'$or':_[_0x7231('0x2b')](_0x3b6657,function(_0x589445){if(_0x589445['type']!==_0x7231('0x3c')){var _0x16980f={};_0x16980f[_0x589445[_0x7231('0x28')]]={'$like':'%'+_0xa7dc44[_0x7231('0x31')]['filter']+'%'};return _0x16980f;}})});}_0x34aa62=_['merge']({},_0x34aa62,_0xa7dc44[_0x7231('0x3d')]);var _0x83dc67={'where':_0x34aa62['where']};return db[_0x7231('0x2c')][_0x7231('0x1d')](_0x83dc67)[_0x7231('0x24')](function(_0x4b079a){_0x3fb40e[_0x7231('0x1d')]=_0x4b079a;if(_0xa7dc44[_0x7231('0x31')][_0x7231('0x3e')]){_0x34aa62[_0x7231('0x3f')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x7231('0x40')](_0x34aa62);})[_0x7231('0x24')](function(_0xb09b7){_0x3fb40e[_0x7231('0x41')]=_0xb09b7;return _0x3fb40e;})[_0x7231('0x24')](respondWithFilteredResult(_0x4c0d9f,_0x34aa62))[_0x7231('0x42')](handleError(_0x4c0d9f,null));};exports[_0x7231('0x43')]=function(_0x75611a,_0x388608){var _0x42222f={'raw':!![],'where':{'id':_0x75611a[_0x7231('0x44')]['id']}},_0x148cbe={};_0x148cbe[_0x7231('0x30')]=_[_0x7231('0x32')](db[_0x7231('0x2c')][_0x7231('0x2d')]);_0x148cbe[_0x7231('0x31')]=_['keys'](_0x75611a[_0x7231('0x31')]);_0x148cbe['filters']=_['intersection'](_0x148cbe[_0x7231('0x30')],_0x148cbe[_0x7231('0x31')]);_0x42222f[_0x7231('0x34')]=_[_0x7231('0x33')](_0x148cbe['model'],qs[_0x7231('0x35')](_0x75611a[_0x7231('0x31')][_0x7231('0x35')]));_0x42222f[_0x7231('0x34')]=_0x42222f[_0x7231('0x34')]['length']?_0x42222f[_0x7231('0x34')]:_0x148cbe['model'];if(_0x75611a[_0x7231('0x31')][_0x7231('0x3e')]){_0x42222f[_0x7231('0x3f')]=[{'all':!![]}];}_0x42222f=_[_0x7231('0x3b')]({},_0x42222f,_0x75611a[_0x7231('0x3d')]);return db[_0x7231('0x2c')]['find'](_0x42222f)['then'](handleEntityNotFound(_0x388608,null))['then'](respondWithResult(_0x388608,null))['catch'](handleError(_0x388608,null));};exports[_0x7231('0x45')]=function(_0x50f2a0,_0x3390b5){return db[_0x7231('0x2c')][_0x7231('0x45')](_0x50f2a0[_0x7231('0x46')],{})[_0x7231('0x24')](respondWithResult(_0x3390b5,0xc9))['catch'](handleError(_0x3390b5,null));};exports[_0x7231('0x23')]=function(_0x3fb2b3,_0x219270){if(_0x3fb2b3[_0x7231('0x46')]['id']){delete _0x3fb2b3[_0x7231('0x46')]['id'];}return db[_0x7231('0x2c')][_0x7231('0x47')]({'where':{'id':_0x3fb2b3[_0x7231('0x44')]['id']}})[_0x7231('0x24')](handleEntityNotFound(_0x219270,null))[_0x7231('0x24')](saveUpdates(_0x3fb2b3['body'],null))[_0x7231('0x24')](respondWithResult(_0x219270,null))[_0x7231('0x42')](handleError(_0x219270,null));};exports[_0x7231('0x25')]=function(_0x111b75,_0xfe3d6){return db[_0x7231('0x2c')][_0x7231('0x47')]({'where':{'id':_0x111b75[_0x7231('0x44')]['id']}})[_0x7231('0x24')](handleEntityNotFound(_0xfe3d6,null))[_0x7231('0x24')](removeEntity(_0xfe3d6,null))[_0x7231('0x42')](handleError(_0xfe3d6,null));};exports['describe']=function(_0x5b48e0,_0x3bb799){return db['ChatTransferReport']['describe']()[_0x7231('0x24')](respondWithResult(_0x3bb799,null))[_0x7231('0x42')](handleError(_0x3bb799,null));}; \ No newline at end of file +var _0xc4d8=['sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','describe','eml-format','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','name','index','map','ChatTransferReport','rawAttributes','fieldName','type','query','keys','filters','attributes','intersection','model','length','hasOwnProperty','nolimit','limit','order'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc4d8,0xa6));var _0x8c4d=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xc4d8[_0x2b7764];return _0x848dcb;};'use strict';var emlformat=require(_0x8c4d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8c4d('0x1'));var jsonpatch=require(_0x8c4d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8c4d('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8c4d('0x4'));var sox=require(_0x8c4d('0x5'));var csv=require(_0x8c4d('0x6'));var ejs=require(_0x8c4d('0x7'));var fs=require('fs');var fs_extra=require(_0x8c4d('0x8'));var _=require(_0x8c4d('0x9'));var squel=require(_0x8c4d('0xa'));var crypto=require(_0x8c4d('0xb'));var jsforce=require(_0x8c4d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8c4d('0x6'));var querystring=require(_0x8c4d('0xd'));var Papa=require(_0x8c4d('0xe'));var Redis=require(_0x8c4d('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8c4d('0x10'));var hardwareService=require(_0x8c4d('0x11'));var logger=require(_0x8c4d('0x12'))(_0x8c4d('0x13'));var utils=require(_0x8c4d('0x14'));var config=require(_0x8c4d('0x15'));var licenseUtil=require(_0x8c4d('0x16'));var db=require(_0x8c4d('0x17'))['db'];function respondWithStatusCode(_0x50de53,_0x21768d){_0x21768d=_0x21768d||0xcc;return function(_0x303bbc){if(_0x303bbc){return _0x50de53[_0x8c4d('0x18')](_0x21768d);}return _0x50de53[_0x8c4d('0x19')](_0x21768d)[_0x8c4d('0x1a')]();};}function respondWithResult(_0x207f67,_0x3d42f1){_0x3d42f1=_0x3d42f1||0xc8;return function(_0x220cfa){if(_0x220cfa){return _0x207f67['status'](_0x3d42f1)['json'](_0x220cfa);}};}function respondWithFilteredResult(_0x20ab4f,_0x1d410e){return function(_0x498e5d){if(_0x498e5d){var _0x355345=typeof _0x1d410e[_0x8c4d('0x1b')]===_0x8c4d('0x1c')&&typeof _0x1d410e['limit']===_0x8c4d('0x1c');var _0x3d082f=_0x498e5d[_0x8c4d('0x1d')];var _0x3a9321=_0x355345?0x0:_0x1d410e[_0x8c4d('0x1b')];var _0x59cc48=_0x355345?_0x498e5d[_0x8c4d('0x1d')]:_0x1d410e[_0x8c4d('0x1b')]+_0x1d410e['limit'];var _0x409568;if(_0x59cc48>=_0x3d082f){_0x59cc48=_0x3d082f;_0x409568=0xc8;}else{_0x409568=0xce;}_0x20ab4f[_0x8c4d('0x19')](_0x409568);return _0x20ab4f[_0x8c4d('0x1e')](_0x8c4d('0x1f'),_0x3a9321+'-'+_0x59cc48+'/'+_0x3d082f)[_0x8c4d('0x20')](_0x498e5d);}return null;};}function patchUpdates(_0x10ef16){return function(_0x17c206){try{jsonpatch[_0x8c4d('0x21')](_0x17c206,_0x10ef16,!![]);}catch(_0x17708c){return BPromise['reject'](_0x17708c);}return _0x17c206[_0x8c4d('0x22')]();};}function saveUpdates(_0x16ddc9,_0x33f0a2){return function(_0x663624){if(_0x663624){return _0x663624[_0x8c4d('0x23')](_0x16ddc9)[_0x8c4d('0x24')](function(_0x54d835){return _0x54d835;});}return null;};}function removeEntity(_0x3fd1e1,_0x10ea9b){return function(_0x52114f){if(_0x52114f){return _0x52114f[_0x8c4d('0x25')]()['then'](function(){_0x3fd1e1[_0x8c4d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a0d83,_0x292602){return function(_0x3f428b){if(!_0x3f428b){_0x2a0d83[_0x8c4d('0x18')](0x194);}return _0x3f428b;};}function handleError(_0x3dec4b,_0x10ed15){_0x10ed15=_0x10ed15||0x1f4;return function(_0x33d5f1){logger['error'](_0x33d5f1['stack']);if(_0x33d5f1[_0x8c4d('0x26')]){delete _0x33d5f1[_0x8c4d('0x26')];}_0x3dec4b[_0x8c4d('0x19')](_0x10ed15)['send'](_0x33d5f1);};}exports[_0x8c4d('0x27')]=function(_0x2c829b,_0x10ef81){var _0x5dfb6f={},_0x22f944={},_0x476266={'count':0x0,'rows':[]};var _0x2e4076=_[_0x8c4d('0x28')](db[_0x8c4d('0x29')][_0x8c4d('0x2a')],function(_0x5b35b6){return{'name':_0x5b35b6[_0x8c4d('0x2b')],'type':_0x5b35b6[_0x8c4d('0x2c')]['key']};});_0x22f944['model']=_['map'](_0x2e4076,_0x8c4d('0x26'));_0x22f944[_0x8c4d('0x2d')]=_[_0x8c4d('0x2e')](_0x2c829b[_0x8c4d('0x2d')]);_0x22f944[_0x8c4d('0x2f')]=_['intersection'](_0x22f944['model'],_0x22f944['query']);_0x5dfb6f[_0x8c4d('0x30')]=_[_0x8c4d('0x31')](_0x22f944[_0x8c4d('0x32')],qs['fields'](_0x2c829b[_0x8c4d('0x2d')]['fields']));_0x5dfb6f[_0x8c4d('0x30')]=_0x5dfb6f[_0x8c4d('0x30')][_0x8c4d('0x33')]?_0x5dfb6f[_0x8c4d('0x30')]:_0x22f944['model'];if(!_0x2c829b[_0x8c4d('0x2d')][_0x8c4d('0x34')](_0x8c4d('0x35'))){_0x5dfb6f[_0x8c4d('0x36')]=qs[_0x8c4d('0x36')](_0x2c829b[_0x8c4d('0x2d')][_0x8c4d('0x36')]);_0x5dfb6f[_0x8c4d('0x1b')]=qs['offset'](_0x2c829b[_0x8c4d('0x2d')]['offset']);}_0x5dfb6f[_0x8c4d('0x37')]=qs[_0x8c4d('0x38')](_0x2c829b[_0x8c4d('0x2d')][_0x8c4d('0x38')]);_0x5dfb6f[_0x8c4d('0x39')]=qs['filters'](_[_0x8c4d('0x3a')](_0x2c829b[_0x8c4d('0x2d')],_0x22f944[_0x8c4d('0x2f')]),_0x2e4076);if(_0x2c829b[_0x8c4d('0x2d')][_0x8c4d('0x3b')]){_0x5dfb6f[_0x8c4d('0x39')]=_[_0x8c4d('0x3c')](_0x5dfb6f[_0x8c4d('0x39')],{'$or':_[_0x8c4d('0x28')](_0x2e4076,function(_0x1b67b5){if(_0x1b67b5[_0x8c4d('0x2c')]!=='VIRTUAL'){var _0x3391d6={};_0x3391d6[_0x1b67b5[_0x8c4d('0x26')]]={'$like':'%'+_0x2c829b['query']['filter']+'%'};return _0x3391d6;}})});}_0x5dfb6f=_[_0x8c4d('0x3c')]({},_0x5dfb6f,_0x2c829b[_0x8c4d('0x3d')]);var _0x40d23c={'where':_0x5dfb6f[_0x8c4d('0x39')]};return db[_0x8c4d('0x29')][_0x8c4d('0x1d')](_0x40d23c)[_0x8c4d('0x24')](function(_0x1fa027){_0x476266['count']=_0x1fa027;if(_0x2c829b[_0x8c4d('0x2d')][_0x8c4d('0x3e')]){_0x5dfb6f[_0x8c4d('0x3f')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x8c4d('0x40')](_0x5dfb6f);})[_0x8c4d('0x24')](function(_0x5d930c){_0x476266[_0x8c4d('0x41')]=_0x5d930c;return _0x476266;})['then'](respondWithFilteredResult(_0x10ef81,_0x5dfb6f))[_0x8c4d('0x42')](handleError(_0x10ef81,null));};exports[_0x8c4d('0x43')]=function(_0xf30b0d,_0x22487e){var _0x5ed269={'raw':!![],'where':{'id':_0xf30b0d[_0x8c4d('0x44')]['id']}},_0x3d95fd={};_0x3d95fd[_0x8c4d('0x32')]=_[_0x8c4d('0x2e')](db['ChatTransferReport']['rawAttributes']);_0x3d95fd['query']=_[_0x8c4d('0x2e')](_0xf30b0d[_0x8c4d('0x2d')]);_0x3d95fd[_0x8c4d('0x2f')]=_['intersection'](_0x3d95fd['model'],_0x3d95fd[_0x8c4d('0x2d')]);_0x5ed269[_0x8c4d('0x30')]=_[_0x8c4d('0x31')](_0x3d95fd['model'],qs[_0x8c4d('0x45')](_0xf30b0d[_0x8c4d('0x2d')][_0x8c4d('0x45')]));_0x5ed269[_0x8c4d('0x30')]=_0x5ed269[_0x8c4d('0x30')]['length']?_0x5ed269[_0x8c4d('0x30')]:_0x3d95fd['model'];if(_0xf30b0d['query'][_0x8c4d('0x3e')]){_0x5ed269['include']=[{'all':!![]}];}_0x5ed269=_['merge']({},_0x5ed269,_0xf30b0d[_0x8c4d('0x3d')]);return db[_0x8c4d('0x29')][_0x8c4d('0x46')](_0x5ed269)[_0x8c4d('0x24')](handleEntityNotFound(_0x22487e,null))['then'](respondWithResult(_0x22487e,null))[_0x8c4d('0x42')](handleError(_0x22487e,null));};exports[_0x8c4d('0x47')]=function(_0x590c79,_0x44c0d8){return db[_0x8c4d('0x29')][_0x8c4d('0x47')](_0x590c79[_0x8c4d('0x48')],{})[_0x8c4d('0x24')](respondWithResult(_0x44c0d8,0xc9))['catch'](handleError(_0x44c0d8,null));};exports[_0x8c4d('0x23')]=function(_0x1b7801,_0x3018e2){if(_0x1b7801[_0x8c4d('0x48')]['id']){delete _0x1b7801['body']['id'];}return db[_0x8c4d('0x29')][_0x8c4d('0x46')]({'where':{'id':_0x1b7801[_0x8c4d('0x44')]['id']}})[_0x8c4d('0x24')](handleEntityNotFound(_0x3018e2,null))[_0x8c4d('0x24')](saveUpdates(_0x1b7801[_0x8c4d('0x48')],null))[_0x8c4d('0x24')](respondWithResult(_0x3018e2,null))[_0x8c4d('0x42')](handleError(_0x3018e2,null));};exports[_0x8c4d('0x25')]=function(_0xa4ec88,_0x396e8c){return db[_0x8c4d('0x29')][_0x8c4d('0x46')]({'where':{'id':_0xa4ec88[_0x8c4d('0x44')]['id']}})[_0x8c4d('0x24')](handleEntityNotFound(_0x396e8c,null))[_0x8c4d('0x24')](removeEntity(_0x396e8c,null))[_0x8c4d('0x42')](handleError(_0x396e8c,null));};exports[_0x8c4d('0x49')]=function(_0x1740fd,_0x3909b5){return db['ChatTransferReport'][_0x8c4d('0x49')]()[_0x8c4d('0x24')](respondWithResult(_0x3909b5,null))['catch'](handleError(_0x3909b5,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 744a9d8..8cf99c0 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 _0x9939=['./chatTransferReport.attributes','define','ChatTransferReport','uniqueid','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x203b4e,_0x6b878){var _0x1db370=function(_0x59dccc){while(--_0x59dccc){_0x203b4e['push'](_0x203b4e['shift']());}};_0x1db370(++_0x6b878);}(_0x9939,0x1b1));var _0x9993=function(_0x1357de,_0x143710){_0x1357de=_0x1357de-0x0;var _0x39cc24=_0x9939[_0x1357de];return _0x39cc24;};'use strict';var _=require('lodash');var util=require(_0x9993('0x0'));var logger=require(_0x9993('0x1'))('api');var moment=require(_0x9993('0x2'));var BPromise=require(_0x9993('0x3'));var rp=require(_0x9993('0x4'));var fs=require('fs');var path=require(_0x9993('0x5'));var rimraf=require(_0x9993('0x6'));var config=require('../../config/environment');var attributes=require(_0x9993('0x7'));module['exports']=function(_0x58862a,_0x473770){return _0x58862a[_0x9993('0x8')](_0x9993('0x9'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x9993('0xa'),'fields':[_0x9993('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc43e=['lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid'];(function(_0x28ae89,_0x17cdd4){var _0x24f0f5=function(_0x57e0f7){while(--_0x57e0f7){_0x28ae89['push'](_0x28ae89['shift']());}};_0x24f0f5(++_0x17cdd4);}(_0xc43e,0x198));var _0xec43=function(_0x664caf,_0x45d152){_0x664caf=_0x664caf-0x0;var _0xf3e813=_0xc43e[_0x664caf];return _0xf3e813;};'use strict';var _=require(_0xec43('0x0'));var util=require('util');var logger=require(_0xec43('0x1'))(_0xec43('0x2'));var moment=require(_0xec43('0x3'));var BPromise=require(_0xec43('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xec43('0x5'));var config=require(_0xec43('0x6'));var attributes=require(_0xec43('0x7'));module['exports']=function(_0x51a571,_0x2351e8){return _0x51a571[_0xec43('0x8')](_0xec43('0x9'),attributes,{'tableName':_0xec43('0xa'),'paranoid':![],'indexes':[{'name':_0xec43('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 9f04447..313ca06 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 _0x2665=['code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1fe2e9,_0x422e43){var _0x51e219=function(_0x42e14f){while(--_0x42e14f){_0x1fe2e9['push'](_0x1fe2e9['shift']());}};_0x51e219(++_0x422e43);}(_0x2665,0x174));var _0x5266=function(_0xe039d3,_0x4b6690){_0xe039d3=_0xe039d3-0x0;var _0x4e6a7c=_0x2665[_0xe039d3];return _0x4e6a7c;};'use strict';var _=require(_0x5266('0x0'));var util=require(_0x5266('0x1'));var moment=require(_0x5266('0x2'));var BPromise=require(_0x5266('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5266('0x4'));var db=require(_0x5266('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5266('0x6'))(_0x5266('0x7'));var config=require(_0x5266('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5266('0x9')][_0x5266('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1640ca,_0x5bd0e2,_0x42df46){return new BPromise(function(_0x5c26c4,_0x197a5b){return client[_0x5266('0xb')](_0x1640ca,_0x42df46)['then'](function(_0xf21174){logger[_0x5266('0xc')](_0x5266('0xd'),_0x5bd0e2,_0x5266('0xe'));logger[_0x5266('0xf')](_0x5266('0x10'),_0x5bd0e2,'request\x20sent',JSON[_0x5266('0x11')](_0xf21174));if(_0xf21174['error']){if(_0xf21174[_0x5266('0x12')][_0x5266('0x13')]===0x1f4){logger[_0x5266('0x12')](_0x5266('0xd'),_0x5bd0e2,_0xf21174[_0x5266('0x12')]['message']);return _0x197a5b(_0xf21174[_0x5266('0x12')][_0x5266('0x14')]);}logger[_0x5266('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x5bd0e2,_0xf21174[_0x5266('0x12')][_0x5266('0x14')]);return _0x5c26c4(_0xf21174[_0x5266('0x12')][_0x5266('0x14')]);}else{logger[_0x5266('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x5bd0e2,_0x5266('0xe'));_0x5c26c4(_0xf21174[_0x5266('0x15')][_0x5266('0x14')]);}})[_0x5266('0x16')](function(_0x110859){logger[_0x5266('0x12')](_0x5266('0xd'),_0x5bd0e2,_0x110859);_0x197a5b(_0x110859);});});} \ No newline at end of file +var _0x49a9=['client','http','request','then','request\x20sent','debug','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x49a9,0x1ab));var _0x949a=function(_0x1653c2,_0x5575bf){_0x1653c2=_0x1653c2-0x0;var _0x27bf07=_0x49a9[_0x1653c2];return _0x27bf07;};'use strict';var _=require(_0x949a('0x0'));var util=require(_0x949a('0x1'));var moment=require(_0x949a('0x2'));var BPromise=require(_0x949a('0x3'));var rs=require(_0x949a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x949a('0x5'))['db'];var utils=require(_0x949a('0x6'));var logger=require('../../config/logger')(_0x949a('0x7'));var config=require(_0x949a('0x8'));var jayson=require(_0x949a('0x9'));var client=jayson[_0x949a('0xa')][_0x949a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c342d,_0x4a5e7d,_0x3bb54f){return new BPromise(function(_0x3c478d,_0x31b117){return client[_0x949a('0xc')](_0x3c342d,_0x3bb54f)[_0x949a('0xd')](function(_0x3d497f){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x4a5e7d,_0x949a('0xe'));logger[_0x949a('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x4a5e7d,_0x949a('0xe'),JSON[_0x949a('0x10')](_0x3d497f));if(_0x3d497f[_0x949a('0x11')]){if(_0x3d497f[_0x949a('0x11')][_0x949a('0x12')]===0x1f4){logger['error'](_0x949a('0x13'),_0x4a5e7d,_0x3d497f[_0x949a('0x11')][_0x949a('0x14')]);return _0x31b117(_0x3d497f['error']['message']);}logger[_0x949a('0x11')](_0x949a('0x13'),_0x4a5e7d,_0x3d497f[_0x949a('0x11')][_0x949a('0x14')]);return _0x3c478d(_0x3d497f['error'][_0x949a('0x14')]);}else{logger[_0x949a('0x15')]('ChatTransferReport,\x20%s,\x20%s',_0x4a5e7d,_0x949a('0xe'));_0x3c478d(_0x3d497f[_0x949a('0x16')][_0x949a('0x14')]);}})['catch'](function(_0x5b811d){logger['error'](_0x949a('0x13'),_0x4a5e7d,_0x5b811d);_0x31b117(_0x5b811d);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 1f009ca..1f43169 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 _0xc465=['index','/describe','describe','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated'];(function(_0x1f1f44,_0xeffedd){var _0x28ca79=function(_0x37df70){while(--_0x37df70){_0x1f1f44['push'](_0x1f1f44['shift']());}};_0x28ca79(++_0xeffedd);}(_0xc465,0x115));var _0x5c46=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc465[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x5c46('0x0'));var util=require(_0x5c46('0x1'));var path=require('path');var timeout=require(_0x5c46('0x2'));var express=require(_0x5c46('0x3'));var router=express[_0x5c46('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5c46('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0x5c46('0x6')]('/',auth[_0x5c46('0x7')](),controller[_0x5c46('0x8')]);router[_0x5c46('0x6')](_0x5c46('0x9'),auth['isAuthenticated'](),controller[_0x5c46('0xa')]);router[_0x5c46('0x6')]('/:id',auth[_0x5c46('0x7')](),controller['show']);router[_0x5c46('0xb')]('/',auth[_0x5c46('0x7')](),controller[_0x5c46('0xc')]);router[_0x5c46('0xd')](_0x5c46('0xe'),auth[_0x5c46('0x7')](),controller[_0x5c46('0xf')]);router[_0x5c46('0x10')]('/:id',auth[_0x5c46('0x7')](),controller[_0x5c46('0x11')]);module[_0x5c46('0x12')]=router; \ No newline at end of file +var _0x83a7=['../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','show','post','create','/:id','update','delete','destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2052cc,_0x4f76dc){var _0x58609f=function(_0x28bdc9){while(--_0x28bdc9){_0x2052cc['push'](_0x2052cc['shift']());}};_0x58609f(++_0x4f76dc);}(_0x83a7,0x86));var _0x783a=function(_0x2a7b4d,_0x49ae71){_0x2a7b4d=_0x2a7b4d-0x0;var _0xf3f6d4=_0x83a7[_0x2a7b4d];return _0xf3f6d4;};'use strict';var multer=require('multer');var util=require(_0x783a('0x0'));var path=require(_0x783a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x783a('0x2')]();var fs_extra=require(_0x783a('0x3'));var auth=require(_0x783a('0x4'));var interaction=require(_0x783a('0x5'));var config=require(_0x783a('0x6'));var controller=require(_0x783a('0x7'));router[_0x783a('0x8')]('/',auth[_0x783a('0x9')](),controller[_0x783a('0xa')]);router[_0x783a('0x8')](_0x783a('0xb'),auth[_0x783a('0x9')](),controller['describe']);router['get']('/:id',auth[_0x783a('0x9')](),controller[_0x783a('0xc')]);router[_0x783a('0xd')]('/',auth[_0x783a('0x9')](),controller[_0x783a('0xe')]);router['put'](_0x783a('0xf'),auth[_0x783a('0x9')](),controller[_0x783a('0x10')]);router[_0x783a('0x11')](_0x783a('0xf'),auth['isAuthenticated'](),controller[_0x783a('0x12')]);module[_0x783a('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index e116141..865b655 100644 --- a/server/api/chatWebsite/chatWebsite.attributes.js +++ b/server/api/chatWebsite/chatWebsite.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xee5b=['rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','stringify','input','name','text','setDataValue','onlineForm','TEXT','textarea','Comments','getDataValue','offlineForm','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#ffffff','INTEGER','BOOLEAN','ENUM'];(function(_0x5a610e,_0x1ad168){var _0x396ee6=function(_0x4ecd3a){while(--_0x4ecd3a){_0x5a610e['push'](_0x5a610e['shift']());}};_0x396ee6(++_0x1ad168);}(_0xee5b,0x1f4));var _0xbee5=function(_0x52ffc0,_0x59f2a3){_0x52ffc0=_0x52ffc0-0x0;var _0x3afb5a=_0xee5b[_0x52ffc0];return _0x3afb5a;};'use strict';var Sequelize=require(_0xbee5('0x0'));var rs=require('randomstring');module[_0xbee5('0x1')]={'name':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbee5('0x3')},'description':{'type':Sequelize[_0xbee5('0x2')]},'mapKey':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x5')},'customerAlias':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbee5('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xbee5('0x9')](_0xbee5('0xa'),_0xbee5('0xb')),'defaultValue':_0xbee5('0xa')},'header_online':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xc')},'start_chat_button':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0xf')},'download_transcript':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x11')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x12')},'closingMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x13')},'closingMessageButton':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xe')},'skipMessageButton':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x14')},'conditionAgreement':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x15')},'ratingType':{'type':Sequelize[_0xbee5('0x9')](_0xbee5('0x16'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xbee5('0x17')]({'items':[{'type':_0xbee5('0x18'),'variable':null,'config':{'placeholder':_0xbee5('0x19'),'type':_0xbee5('0x1a'),'required':!![]},'props':{'title':_0xbee5('0x19'),'helpText':''}},{'type':_0xbee5('0x18'),'props':{'title':_0xbee5('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xbee5('0x4'),'type':_0xbee5('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON['parse'](this['getDataValue']('onlineForm')):{};},'set':function(_0x1af3de){return this[_0xbee5('0x1b')](_0xbee5('0x1c'),JSON[_0xbee5('0x17')](_0x1af3de));}},'offlineForm':{'type':Sequelize[_0xbee5('0x1d')],'defaultValue':function(){return JSON[_0xbee5('0x17')]({'items':[{'type':_0xbee5('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xbee5('0x4'),'type':_0xbee5('0x4')},'variable':null},{'type':_0xbee5('0x1e'),'config':{'placeholder':_0xbee5('0x1f')},'props':{'title':_0xbee5('0x1f'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xbee5('0x20')](_0xbee5('0x21'))?JSON[_0xbee5('0x22')](this[_0xbee5('0x20')](_0xbee5('0x21'))):{};},'set':function(_0x26abe3){return this[_0xbee5('0x1b')](_0xbee5('0x21'),JSON[_0xbee5('0x17')](_0x26abe3));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xbee5('0x23')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xbee5('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xbee5('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x24')},'waitingMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x14')},'sendUnmanaged':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'showAgentAvatar':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xbee5('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbee5('0x27');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xbee5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x28')},'verticalAlignment':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x29')},'messagesAlignment':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x2a')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x2c')},'systemAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbee5('0x7')],'comment':_0xbee5('0x2d')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xbee5('0x2e'),'set':function(_0x2819e2){if(!_0x2819e2)this[_0xbee5('0x1b')](_0xbee5('0x2f'),null);this[_0xbee5('0x1b')](_0xbee5('0x30'),_0x2819e2);}},'vidaooEscalation':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xbee5('0x2')]},'vidaooTopic':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x31')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xbee5('0x32');}},'vidaooMetadata':{'type':Sequelize[_0xbee5('0x1d')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xbee5('0x1d')]}}; \ No newline at end of file +var _0xa9e0=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','address','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','We\x20are\x20here!','Chat','Send','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','input','name','text','getDataValue','onlineForm','parse','setDataValue','stringify','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.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','bottom_right','#fafafa','System'];(function(_0x1ca15f,_0xb34700){var _0x313706=function(_0x3883c3){while(--_0x3883c3){_0x1ca15f['push'](_0x1ca15f['shift']());}};_0x313706(++_0xb34700);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var rs=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'mapKeyOffline':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'key':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x0a9e('0x6')},'customerAlias':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0a9e('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![],'defaultValue':_0x0a9e('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x0a9e('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x0a9e('0x4')]},'animation':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x0a9e('0xb')]('rounded','squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x0a9e('0xc')},'start_chat_button':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0xd')},'offline_chat_button':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0xe')},'header_offline':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x0a9e('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x0a9e('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x0a9e('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0a9e('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0a9e('0x13')},'noteTitle':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x14')},'closingMessageButton':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0xe')},'skipMessageButton':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x15')},'conditionAgreement':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x16')},'ratingType':{'type':Sequelize['ENUM'](_0x0a9e('0x17'),_0x0a9e('0x18')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x0a9e('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x0a9e('0x19'),'variable':null,'config':{'placeholder':_0x0a9e('0x1a'),'type':_0x0a9e('0x1b'),'required':!![]},'props':{'title':_0x0a9e('0x1a'),'helpText':''}},{'type':'input','props':{'title':_0x0a9e('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x0a9e('0x5'),'type':_0x0a9e('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x0a9e('0x1c')](_0x0a9e('0x1d'))?JSON[_0x0a9e('0x1e')](this[_0x0a9e('0x1c')]('onlineForm')):{};},'set':function(_0x59181e){return this[_0x0a9e('0x1f')](_0x0a9e('0x1d'),JSON[_0x0a9e('0x20')](_0x59181e));}},'offlineForm':{'type':Sequelize[_0x0a9e('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x0a9e('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x0a9e('0x5'),'type':'email'},'variable':null},{'type':_0x0a9e('0x21'),'config':{'placeholder':_0x0a9e('0x22')},'props':{'title':_0x0a9e('0x22'),'helpText':_0x0a9e('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0x0a9e('0x1c')](_0x0a9e('0x24'))?JSON[_0x0a9e('0x1e')](this[_0x0a9e('0x1c')]('offlineForm')):{};},'set':function(_0x3652a7){return this[_0x0a9e('0x1f')](_0x0a9e('0x24'),JSON[_0x0a9e('0x20')](_0x3652a7));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x0a9e('0x25')]();}},'autoclose':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x0a9e('0x4')]},'forwardOffline':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x0a9e('0x4')]},'waitingTitle':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x26')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0a9e('0x27')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x0a9e('0x28')},'offlineMessageBody':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x15')},'sendUnmanaged':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x0a9e('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x0a9e('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x0a9e('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x2a')},'verticalAlignment':{'type':Sequelize[_0x0a9e('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x0a9e('0x4')]},'customerAvatar':{'type':Sequelize[_0x0a9e('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x0a9e('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0a9e('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0a9e('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0a9e('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x2c')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x0a9e('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2b814e){if(!_0x2b814e)this[_0x0a9e('0x1f')](_0x0a9e('0x2e'),null);this[_0x0a9e('0x1f')]('mandatoryDisposition',_0x2b814e);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x0a9e('0x4')]},'vidaooTopic':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':function(){return _0x0a9e('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0x0a9e('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x0a9e('0x10')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 1ef9281..933ec37 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 _0x58cc=['browser','version','format','%s\x20%s','unknown','device','vendor','threadId','ChatInteraction','externalUrl','interaction','messageId','created','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','agent','forcedOwnership','Start','startRouting','EventManager','offline','files','CompanyId','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','ChatOfflineMessage','fromString','mimetype','server','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailAccount','CloudProvider','Smtp','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','originalname','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','ONLINE','OFFLINE','inspect','No\x20timezone','Interval','getProactiveActions','getLicense','virtual','License','increment','Intervals','push','all','some','remote','x-real-ip','alignment','verticalAlignment','labelText','textColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','priority','stack','finally','getApplications','addProactiveActions','chatProactiveAction','getFields','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','util','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','redis','defaults','localhost','./chatWebsite.socket','html-to-text','client','http','request','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','info','result','catch','json','offset','undefined','limit','count','set','update','then','destroy','ChatWebsites','end','sendStatus','name','status','send','index','mandatoryDispositionPause','ChatWebsite','fieldName','type','map','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','Pause','rawAttributes','intersection','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','file','filename','addCustomerAvatar','customerAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','user-agent','getResult','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','from','from\x20is\x20mandatory','Sequelize','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','Applications','List','account','applications','list','orderBy','asc','Contacts','ListId','CmContact','contact','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer'];(function(_0x2b45de,_0x2e5b2e){var _0x596120=function(_0x35c8b1){while(--_0x35c8b1){_0x2b45de['push'](_0x2b45de['shift']());}};_0x596120(++_0x2e5b2e);}(_0x58cc,0x83));var _0xc58c=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x58cc[_0x9aada2];return _0x196dff;};'use strict';var BPromise=require(_0xc58c('0x0'));var Mustache=require('mustache');var util=require(_0xc58c('0x1'));var path=require(_0xc58c('0x2'));var ejs=require(_0xc58c('0x3'));var fs=require('fs');var fs_extra=require(_0xc58c('0x4'));var _=require(_0xc58c('0x5'));var querystring=require(_0xc58c('0x6'));var Redis=require(_0xc58c('0x7'));var qs=require(_0xc58c('0x8'));var logger=require(_0xc58c('0x9'))(_0xc58c('0xa'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xc58c('0xb')]=_[_0xc58c('0xc')](config['redis'],{'host':_0xc58c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc58c('0xe'))['register'](socket);var htmlToText=require(_0xc58c('0xf'));var jayson=require('jayson/promise');var client=jayson[_0xc58c('0x10')][_0xc58c('0x11')]({'port':0x232c});var client9002=jayson[_0xc58c('0x10')][_0xc58c('0x11')]({'port':0x232a});var client9003=jayson['client'][_0xc58c('0x11')]({'port':0x232b});var client9001=jayson[_0xc58c('0x10')]['http']({'port':0x2329});function respondWithRpcPromise(_0xe5bed7,_0x28410e,_0x5a4e19,_0x152fa2){return new BPromise(function(_0x543fca,_0x196c73){var _0x57138a=_0x152fa2||client;return _0x57138a[_0xc58c('0x12')](_0xe5bed7,_0x5a4e19)['then'](function(_0x55d17c){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x28410e,_0xc58c('0x13'));logger[_0xc58c('0x14')](_0xc58c('0x15'),_0x28410e,_0xc58c('0x13'),JSON[_0xc58c('0x16')](_0x55d17c));if(_0x55d17c[_0xc58c('0x17')]){if(_0x55d17c[_0xc58c('0x17')][_0xc58c('0x18')]===0x1f4){logger['error'](_0xc58c('0x19'),_0x28410e,_0x55d17c[_0xc58c('0x17')][_0xc58c('0x1a')]);return _0x196c73(_0x55d17c['error'][_0xc58c('0x1a')]);}logger[_0xc58c('0x17')](_0xc58c('0x19'),_0x28410e,_0x55d17c['error'][_0xc58c('0x1a')]);return _0x543fca(_0x55d17c[_0xc58c('0x17')]['message']);}else{logger[_0xc58c('0x1b')](_0xc58c('0x19'),_0x28410e,_0xc58c('0x13'));_0x543fca(_0x55d17c[_0xc58c('0x1c')]['message']);}})[_0xc58c('0x1d')](function(_0x58fa8d){logger[_0xc58c('0x17')](_0xc58c('0x19'),_0x28410e,_0x58fa8d);_0x196c73(_0x58fa8d);});});}function respondWithStatusCode(_0x226523,_0x1f9fca){_0x1f9fca=_0x1f9fca||0xcc;return function(_0x17b999){if(_0x17b999){return _0x226523['sendStatus'](_0x1f9fca);}return _0x226523['status'](_0x1f9fca)['end']();};}function respondWithResult(_0x3c03d3,_0x35a353){_0x35a353=_0x35a353||0xc8;return function(_0x4476c3){if(_0x4476c3){return _0x3c03d3['status'](_0x35a353)[_0xc58c('0x1e')](_0x4476c3);}};}function respondWithFilteredResult(_0x339654,_0x4151c4){return function(_0x50c53a){if(_0x50c53a){var _0x19a767=typeof _0x4151c4[_0xc58c('0x1f')]===_0xc58c('0x20')&&typeof _0x4151c4[_0xc58c('0x21')]===_0xc58c('0x20');var _0x38a7bc=_0x50c53a[_0xc58c('0x22')];var _0x4755cf=_0x19a767?0x0:_0x4151c4['offset'];var _0x54aa48=_0x19a767?_0x50c53a[_0xc58c('0x22')]:_0x4151c4['offset']+_0x4151c4['limit'];var _0x514d18;if(_0x54aa48>=_0x38a7bc){_0x54aa48=_0x38a7bc;_0x514d18=0xc8;}else{_0x514d18=0xce;}_0x339654['status'](_0x514d18);return _0x339654[_0xc58c('0x23')]('Content-Range',_0x4755cf+'-'+_0x54aa48+'/'+_0x38a7bc)[_0xc58c('0x1e')](_0x50c53a);}return null;};}function saveUpdates(_0x55ea00){return function(_0x18231a){if(_0x18231a){return _0x18231a[_0xc58c('0x24')](_0x55ea00)[_0xc58c('0x25')](function(_0x30cd26){return _0x30cd26;});}return null;};}function removeEntity(_0x23a821){return function(_0x43b569){if(_0x43b569){return _0x43b569[_0xc58c('0x26')]()['then'](function(){var _0x1cea6e=_0x43b569['get']({'plain':!![]});var _0x1e9cbc=_0xc58c('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x1e9cbc,'resourceId':_0x1cea6e['id']}})[_0xc58c('0x25')](function(){return _0x43b569;});})['then'](function(){_0x23a821['status'](0xcc)[_0xc58c('0x28')]();});}};}function handleEntityNotFound(_0x134dc3){return function(_0x1fa655){if(!_0x1fa655){_0x134dc3[_0xc58c('0x29')](0x194);}return _0x1fa655;};}function handleError(_0x2f4627,_0x2f5744){_0x2f5744=_0x2f5744||0x1f4;return function(_0x3e448c){logger[_0xc58c('0x17')](_0x3e448c['stack']);if(_0x3e448c['name']){delete _0x3e448c[_0xc58c('0x2a')];}_0x2f4627[_0xc58c('0x2b')](_0x2f5744)[_0xc58c('0x2c')](_0x3e448c);};}exports[_0xc58c('0x2d')]=function(_0x47f635,_0x4b391d){var _0x883308={'include':[{'model':db['Pause'],'as':_0xc58c('0x2e')}]},_0x5922c5={},_0x48657d={'count':0x0,'rows':[]};var _0x1851a4=_['map'](db[_0xc58c('0x2f')]['rawAttributes'],function(_0x429d19){return{'name':_0x429d19[_0xc58c('0x30')],'type':_0x429d19[_0xc58c('0x31')]['key']};});_0x5922c5['model']=_[_0xc58c('0x32')](_0x1851a4,'name');_0x5922c5[_0xc58c('0x33')]=_[_0xc58c('0x34')](_0x47f635[_0xc58c('0x33')]);_0x5922c5[_0xc58c('0x35')]=_['intersection'](_0x5922c5[_0xc58c('0x36')],_0x5922c5[_0xc58c('0x33')]);_0x883308[_0xc58c('0x37')]=_['intersection'](_0x5922c5[_0xc58c('0x36')],qs['fields'](_0x47f635[_0xc58c('0x33')][_0xc58c('0x38')]));_0x883308['attributes']=_0x883308[_0xc58c('0x37')][_0xc58c('0x39')]?_0x883308[_0xc58c('0x37')]:_0x5922c5[_0xc58c('0x36')];if(!_0x47f635[_0xc58c('0x33')][_0xc58c('0x3a')](_0xc58c('0x3b'))){_0x883308[_0xc58c('0x21')]=qs[_0xc58c('0x21')](_0x47f635[_0xc58c('0x33')]['limit']);_0x883308['offset']=qs[_0xc58c('0x1f')](_0x47f635[_0xc58c('0x33')][_0xc58c('0x1f')]);}_0x883308[_0xc58c('0x3c')]=qs[_0xc58c('0x3d')](_0x47f635[_0xc58c('0x33')][_0xc58c('0x3d')]);_0x883308[_0xc58c('0x3e')]=qs[_0xc58c('0x35')](_[_0xc58c('0x3f')](_0x47f635['query'],_0x5922c5[_0xc58c('0x35')]),_0x1851a4);if(_0x47f635['query'][_0xc58c('0x40')]){_0x883308['where']=_[_0xc58c('0x41')](_0x883308[_0xc58c('0x3e')],{'$or':_['map'](_0x1851a4,function(_0x185957){if(_0x185957['type']!==_0xc58c('0x42')){var _0x5be269={};_0x5be269[_0x185957[_0xc58c('0x2a')]]={'$like':'%'+_0x47f635['query'][_0xc58c('0x40')]+'%'};return _0x5be269;}})});}_0x883308=_[_0xc58c('0x41')]({},_0x883308,_0x47f635[_0xc58c('0x43')]);var _0x39d8f6={'where':_0x883308[_0xc58c('0x3e')]};return db['ChatWebsite'][_0xc58c('0x22')](_0x39d8f6)[_0xc58c('0x25')](function(_0x42f5c7){_0x48657d[_0xc58c('0x22')]=_0x42f5c7;if(_0x47f635['query'][_0xc58c('0x44')]){_0x883308[_0xc58c('0x45')]=[{'all':!![]}];}return db[_0xc58c('0x2f')][_0xc58c('0x46')](_0x883308);})[_0xc58c('0x25')](function(_0x347203){_0x48657d[_0xc58c('0x47')]=_0x347203;return _0x48657d;})[_0xc58c('0x25')](respondWithFilteredResult(_0x4b391d,_0x883308))[_0xc58c('0x1d')](handleError(_0x4b391d,null));};exports['show']=function(_0x4ca937,_0x1f3837){var _0x2c0185={'raw':![],'where':{'id':_0x4ca937[_0xc58c('0x48')]['id']},'include':[{'model':db[_0xc58c('0x49')],'as':_0xc58c('0x2e')}]},_0x5804e6={};_0x5804e6[_0xc58c('0x36')]=_[_0xc58c('0x34')](db[_0xc58c('0x2f')][_0xc58c('0x4a')]);_0x5804e6[_0xc58c('0x33')]=_[_0xc58c('0x34')](_0x4ca937[_0xc58c('0x33')]);_0x5804e6[_0xc58c('0x35')]=_['intersection'](_0x5804e6['model'],_0x5804e6[_0xc58c('0x33')]);_0x2c0185[_0xc58c('0x37')]=_[_0xc58c('0x4b')](_0x5804e6['model'],qs['fields'](_0x4ca937['query'][_0xc58c('0x38')]));_0x2c0185[_0xc58c('0x37')]=_0x2c0185[_0xc58c('0x37')][_0xc58c('0x39')]?_0x2c0185[_0xc58c('0x37')]:_0x5804e6[_0xc58c('0x36')];if(_0x4ca937[_0xc58c('0x33')][_0xc58c('0x44')]){_0x2c0185[_0xc58c('0x45')]=[{'all':!![]}];}_0x2c0185=_[_0xc58c('0x41')]({},_0x2c0185,_0x4ca937[_0xc58c('0x43')]);return db['ChatWebsite'][_0xc58c('0x4c')](_0x2c0185)[_0xc58c('0x25')](handleEntityNotFound(_0x1f3837,null))['then'](respondWithResult(_0x1f3837,null))[_0xc58c('0x1d')](handleError(_0x1f3837,null));};exports[_0xc58c('0x4d')]=function(_0x1d3b8b,_0x4bf2e3){return db[_0xc58c('0x2f')][_0xc58c('0x4d')](_0x1d3b8b[_0xc58c('0x4e')],{})[_0xc58c('0x25')](function(_0x5ae996){var _0x5f7cf2=_0x1d3b8b[_0xc58c('0x4f')][_0xc58c('0x50')]({'plain':!![]});if(!_0x5f7cf2)throw new Error(_0xc58c('0x51'));if(_0x5f7cf2[_0xc58c('0x52')]===_0xc58c('0x4f')){var _0x3a06c7=_0x5ae996[_0xc58c('0x50')]({'plain':!![]});var _0x17d296='ChatWebsites';return db[_0xc58c('0x53')]['find']({'where':{'name':_0x17d296,'userProfileId':_0x5f7cf2[_0xc58c('0x54')]},'raw':!![]})[_0xc58c('0x25')](function(_0xb62311){if(_0xb62311&&_0xb62311['autoAssociation']===0x0){return db[_0xc58c('0x55')][_0xc58c('0x4d')]({'name':_0x3a06c7[_0xc58c('0x2a')],'resourceId':_0x3a06c7['id'],'type':_0xb62311[_0xc58c('0x2a')],'sectionId':_0xb62311['id']},{})[_0xc58c('0x25')](function(){return _0x5ae996;});}else{return _0x5ae996;}})[_0xc58c('0x1d')](function(_0x2dad39){logger[_0xc58c('0x17')](_0xc58c('0x56'),_0x2dad39);throw _0x2dad39;});}return _0x5ae996;})[_0xc58c('0x25')](respondWithResult(_0x4bf2e3,0xc9))['catch'](handleError(_0x4bf2e3,null));};exports['update']=function(_0x33bf16,_0x5b4eee){if(_0x33bf16[_0xc58c('0x4e')]['id']){delete _0x33bf16[_0xc58c('0x4e')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x33bf16[_0xc58c('0x48')]['id']},'include':[{'model':db[_0xc58c('0x49')],'as':_0xc58c('0x2e')}]})[_0xc58c('0x25')](handleEntityNotFound(_0x5b4eee,null))['then'](saveUpdates(_0x33bf16[_0xc58c('0x4e')],null))[_0xc58c('0x25')](respondWithResult(_0x5b4eee,null))[_0xc58c('0x1d')](handleError(_0x5b4eee,null));};exports['destroy']=function(_0x3382c4,_0x4770f7){return db[_0xc58c('0x2f')][_0xc58c('0x4c')]({'where':{'id':_0x3382c4[_0xc58c('0x48')]['id']}})['then'](handleEntityNotFound(_0x4770f7,null))['then'](removeEntity(_0x4770f7,null))['catch'](handleError(_0x4770f7,null));};exports['describe']=function(_0x1e3a47,_0x24b519){return db[_0xc58c('0x2f')][_0xc58c('0x57')]()['then'](respondWithResult(_0x24b519,null))['catch'](handleError(_0x24b519,null));};exports[_0xc58c('0x58')]=function(_0x4e9477,_0x140edb){if(_0x4e9477[_0xc58c('0x4e')]['id']){delete _0x4e9477[_0xc58c('0x4e')]['id'];}return db['ChatWebsite'][_0xc58c('0x4c')]({'where':{'id':_0x4e9477[_0xc58c('0x48')]['id']}})[_0xc58c('0x25')](handleEntityNotFound(_0x140edb,null))['then'](function(_0x419389){if(_0x419389){_0x4e9477[_0xc58c('0x4e')][_0xc58c('0x59')]=_0x419389['id'];return db[_0xc58c('0x5a')]['create'](_0x4e9477[_0xc58c('0x4e')]);}})[_0xc58c('0x25')](respondWithResult(_0x140edb,null))['catch'](handleError(_0x140edb,null));};exports[_0xc58c('0x5b')]=function(_0x577d3e,_0xab74db){var _0x455142={'raw':![],'where':{}};var _0x10813b={};var _0x4deada={'count':0x0,'rows':[]};return db[_0xc58c('0x2f')][_0xc58c('0x5c')]({'where':{'id':_0x577d3e[_0xc58c('0x48')]['id']}})[_0xc58c('0x25')](handleEntityNotFound(_0xab74db,null))['then'](function(_0x4438dc){if(_0x4438dc){_0x10813b[_0xc58c('0x36')]=_[_0xc58c('0x34')](db[_0xc58c('0x5a')][_0xc58c('0x4a')]);_0x10813b[_0xc58c('0x33')]=_['keys'](_0x577d3e[_0xc58c('0x33')]);_0x10813b[_0xc58c('0x35')]=_[_0xc58c('0x4b')](_0x10813b['model'],_0x10813b[_0xc58c('0x33')]);_0x455142[_0xc58c('0x37')]=_[_0xc58c('0x4b')](_0x10813b[_0xc58c('0x36')],qs[_0xc58c('0x38')](_0x577d3e[_0xc58c('0x33')]['fields']));_0x455142['attributes']=_0x455142[_0xc58c('0x37')][_0xc58c('0x39')]?_0x455142[_0xc58c('0x37')]:_0x10813b[_0xc58c('0x36')];if(!_0x577d3e['query'][_0xc58c('0x3a')](_0xc58c('0x3b'))){_0x455142[_0xc58c('0x21')]=qs[_0xc58c('0x21')](_0x577d3e[_0xc58c('0x33')][_0xc58c('0x21')]);_0x455142['offset']=qs[_0xc58c('0x1f')](_0x577d3e['query'][_0xc58c('0x1f')]);}_0x455142[_0xc58c('0x3c')]=qs['sort'](_0x577d3e['query'][_0xc58c('0x3d')]);_0x455142['where']=qs['filters'](_['pick'](_0x577d3e[_0xc58c('0x33')],_0x10813b[_0xc58c('0x35')]));_0x455142[_0xc58c('0x3e')]['ChatWebsiteId']=_0x4438dc['id'];if(_0x577d3e[_0xc58c('0x33')][_0xc58c('0x40')]){_0x455142[_0xc58c('0x3e')]=_[_0xc58c('0x41')](_0x455142['where'],{'$or':_['map'](_0x455142[_0xc58c('0x37')],function(_0x543bf8){var _0x1b4558={};_0x1b4558[_0x543bf8]={'$like':'%'+_0x577d3e[_0xc58c('0x33')][_0xc58c('0x40')]+'%'};return _0x1b4558;})});}_0x455142=_[_0xc58c('0x41')]({},_0x455142,_0x577d3e[_0xc58c('0x43')]);return db[_0xc58c('0x5a')][_0xc58c('0x22')]({'where':_0x455142[_0xc58c('0x3e')]})[_0xc58c('0x25')](function(_0x1dcb66){_0x4deada['count']=_0x1dcb66;if(_0x577d3e[_0xc58c('0x33')]['includeAll']){_0x455142[_0xc58c('0x45')]=[{'all':!![]}];}return db[_0xc58c('0x5a')][_0xc58c('0x46')](_0x455142);})[_0xc58c('0x25')](function(_0xf6c3b3){_0x4deada[_0xc58c('0x47')]=_0xf6c3b3;return _0x4deada;});}})[_0xc58c('0x25')](respondWithFilteredResult(_0xab74db,_0x455142))[_0xc58c('0x1d')](handleError(_0xab74db,null));};exports[_0xc58c('0x5d')]=function(_0x5c8f66,_0x63e188){return db['ChatWebsite'][_0xc58c('0x4c')]({'where':{'id':_0x5c8f66[_0xc58c('0x48')]['id']}})[_0xc58c('0x25')](handleEntityNotFound(_0x63e188,null))['then'](function(_0x263d6a){if(_0x263d6a){return _0x263d6a[_0xc58c('0x5d')](_0x5c8f66[_0xc58c('0x33')][_0xc58c('0x5e')]);}})['then'](respondWithStatusCode(_0x63e188,null))['catch'](handleError(_0x63e188,null));};exports[_0xc58c('0x5f')]=function(_0x410ea9,_0x514030){if(_0x410ea9[_0xc58c('0x4e')]['id']){delete _0x410ea9[_0xc58c('0x4e')]['id'];}return db[_0xc58c('0x2f')]['find']({'where':{'id':_0x410ea9[_0xc58c('0x48')]['id']}})[_0xc58c('0x25')](handleEntityNotFound(_0x514030,null))['then'](function(_0x1b0ea3){if(_0x1b0ea3){_0x410ea9[_0xc58c('0x4e')][_0xc58c('0x59')]=_0x1b0ea3['id'];return db['CannedAnswer'][_0xc58c('0x4d')](_0x410ea9[_0xc58c('0x4e')]);}})[_0xc58c('0x25')](respondWithResult(_0x514030,null))[_0xc58c('0x1d')](handleError(_0x514030,null));};exports['getAnswers']=function(_0x5bd2d5,_0x38fb9c){var _0x3af042={'raw':![],'where':{}};var _0x1a9ed6={};var _0xb366cb={'count':0x0,'rows':[]};return db[_0xc58c('0x2f')]['findOne']({'where':{'id':_0x5bd2d5[_0xc58c('0x48')]['id']}})[_0xc58c('0x25')](handleEntityNotFound(_0x38fb9c,null))[_0xc58c('0x25')](function(_0x48bcf8){if(_0x48bcf8){_0x1a9ed6[_0xc58c('0x36')]=_['keys'](db[_0xc58c('0x60')][_0xc58c('0x4a')]);_0x1a9ed6[_0xc58c('0x33')]=_[_0xc58c('0x34')](_0x5bd2d5[_0xc58c('0x33')]);_0x1a9ed6[_0xc58c('0x35')]=_[_0xc58c('0x4b')](_0x1a9ed6[_0xc58c('0x36')],_0x1a9ed6[_0xc58c('0x33')]);_0x3af042[_0xc58c('0x37')]=_[_0xc58c('0x4b')](_0x1a9ed6[_0xc58c('0x36')],qs['fields'](_0x5bd2d5[_0xc58c('0x33')][_0xc58c('0x38')]));_0x3af042[_0xc58c('0x37')]=_0x3af042[_0xc58c('0x37')][_0xc58c('0x39')]?_0x3af042[_0xc58c('0x37')]:_0x1a9ed6['model'];if(!_0x5bd2d5[_0xc58c('0x33')][_0xc58c('0x3a')](_0xc58c('0x3b'))){_0x3af042[_0xc58c('0x21')]=qs[_0xc58c('0x21')](_0x5bd2d5[_0xc58c('0x33')][_0xc58c('0x21')]);_0x3af042[_0xc58c('0x1f')]=qs[_0xc58c('0x1f')](_0x5bd2d5[_0xc58c('0x33')][_0xc58c('0x1f')]);}_0x3af042['order']=qs[_0xc58c('0x3d')](_0x5bd2d5['query'][_0xc58c('0x3d')]);_0x3af042[_0xc58c('0x3e')]=qs[_0xc58c('0x35')](_[_0xc58c('0x3f')](_0x5bd2d5[_0xc58c('0x33')],_0x1a9ed6[_0xc58c('0x35')]));_0x3af042[_0xc58c('0x3e')][_0xc58c('0x59')]=_0x48bcf8['id'];if(_0x5bd2d5[_0xc58c('0x33')][_0xc58c('0x40')]){_0x3af042['where']=_[_0xc58c('0x41')](_0x3af042[_0xc58c('0x3e')],{'$or':_['map'](_0x3af042[_0xc58c('0x37')],function(_0x43191d){var _0x3ce49d={};_0x3ce49d[_0x43191d]={'$like':'%'+_0x5bd2d5[_0xc58c('0x33')][_0xc58c('0x40')]+'%'};return _0x3ce49d;})});}_0x3af042=_['merge']({},_0x3af042,_0x5bd2d5[_0xc58c('0x43')]);return db[_0xc58c('0x60')][_0xc58c('0x22')]({'where':_0x3af042[_0xc58c('0x3e')]})[_0xc58c('0x25')](function(_0x61ad70){_0xb366cb[_0xc58c('0x22')]=_0x61ad70;if(_0x5bd2d5[_0xc58c('0x33')][_0xc58c('0x44')]){_0x3af042[_0xc58c('0x45')]=[{'all':!![]}];}return db[_0xc58c('0x60')][_0xc58c('0x46')](_0x3af042);})[_0xc58c('0x25')](function(_0x4d052d){_0xb366cb['rows']=_0x4d052d;return _0xb366cb;});}})['then'](respondWithFilteredResult(_0x38fb9c,_0x3af042))[_0xc58c('0x1d')](handleError(_0x38fb9c,null));};exports[_0xc58c('0x61')]=function(_0x1c4ee9,_0x5e11b0){return db[_0xc58c('0x2f')][_0xc58c('0x4c')]({'where':{'id':_0x1c4ee9[_0xc58c('0x48')]['id']}})[_0xc58c('0x25')](handleEntityNotFound(_0x5e11b0,null))[_0xc58c('0x25')](function(_0xb09f9){if(_0xb09f9){return _0xb09f9[_0xc58c('0x61')](_0x1c4ee9[_0xc58c('0x33')][_0xc58c('0x5e')]);}})[_0xc58c('0x25')](respondWithStatusCode(_0x5e11b0,null))[_0xc58c('0x1d')](handleError(_0x5e11b0,null));};exports['addLogo']=function(_0x244f6e,_0xab0869){_0x244f6e[_0xc58c('0x4e')]['sitepic']=_0x244f6e[_0xc58c('0x62')][_0xc58c('0x63')];return db[_0xc58c('0x2f')][_0xc58c('0x4c')]({'where':{'id':_0x244f6e[_0xc58c('0x48')]['id']}})['then'](handleEntityNotFound(_0xab0869,null))[_0xc58c('0x25')](saveUpdates(_0x244f6e[_0xc58c('0x4e')],null))[_0xc58c('0x25')](respondWithResult(_0xab0869,null))['catch'](handleError(_0xab0869,null));};exports['addAvatar']=function(_0x42f6f4,_0x2e5f7a){_0x42f6f4[_0xc58c('0x4e')]['agentAvatar']=_0x42f6f4['file']['filename'];return db[_0xc58c('0x2f')]['find']({'where':{'id':_0x42f6f4['params']['id']}})[_0xc58c('0x25')](handleEntityNotFound(_0x2e5f7a,null))[_0xc58c('0x25')](saveUpdates(_0x42f6f4[_0xc58c('0x4e')],null))[_0xc58c('0x25')](respondWithResult(_0x2e5f7a,null))[_0xc58c('0x1d')](handleError(_0x2e5f7a,null));};exports[_0xc58c('0x64')]=function(_0x1bd3b7,_0xe7b08f){_0x1bd3b7[_0xc58c('0x4e')][_0xc58c('0x65')]=_0x1bd3b7['file']['filename'];return db[_0xc58c('0x2f')][_0xc58c('0x4c')]({'where':{'id':_0x1bd3b7[_0xc58c('0x48')]['id']}})[_0xc58c('0x25')](handleEntityNotFound(_0xe7b08f,null))['then'](saveUpdates(_0x1bd3b7[_0xc58c('0x4e')],null))[_0xc58c('0x25')](respondWithResult(_0xe7b08f,null))[_0xc58c('0x1d')](handleError(_0xe7b08f,null));};exports['addSystemAvatar']=function(_0x448b16,_0x24758c){_0x448b16['body'][_0xc58c('0x66')]=_0x448b16[_0xc58c('0x62')]['filename'];return db[_0xc58c('0x2f')][_0xc58c('0x4c')]({'where':{'id':_0x448b16[_0xc58c('0x48')]['id']}})[_0xc58c('0x25')](handleEntityNotFound(_0x24758c,null))[_0xc58c('0x25')](saveUpdates(_0x448b16[_0xc58c('0x4e')],null))['then'](respondWithResult(_0x24758c,null))[_0xc58c('0x1d')](handleError(_0x24758c,null));};exports['getLogo']=function(_0x3ca2e1,_0x28617a){var _0x3954f0=path[_0xc58c('0x67')](config[_0xc58c('0x68')],_0xc58c('0x69'));var _0x332a19={'where':{'id':_0x3ca2e1[_0xc58c('0x48')]['id']},'attributes':['id',_0xc58c('0x6a')],'raw':!![]};var _0x489c2a=![];return require(_0xc58c('0x6b'))['getLicense']()[_0xc58c('0x25')](function(_0x1fd67d){if(_0x1fd67d){_0x489c2a=_0x1fd67d[_0xc58c('0x6c')];}})[_0xc58c('0x25')](function(){return db['ChatWebsite'][_0xc58c('0x4c')](_0x332a19);})[_0xc58c('0x25')](handleEntityNotFound(_0x28617a,null))[_0xc58c('0x25')](function(_0x4eff09){if(_0x4eff09){if(!_[_0xc58c('0x6d')](_0x4eff09[_0xc58c('0x6a')])){if(fs[_0xc58c('0x6e')](path['join'](config[_0xc58c('0x68')],'server/files/images/logos/',_0x4eff09[_0xc58c('0x6a')]))&&_0x489c2a){_0x3954f0=path[_0xc58c('0x67')](config[_0xc58c('0x68')],_0xc58c('0x6f'),_0x4eff09[_0xc58c('0x6a')]);}}return _0x28617a[_0xc58c('0x70')](_0x3954f0);}})['catch'](handleError(_0x28617a,null));};exports[_0xc58c('0x71')]=function(_0x4c73ed,_0x43a666){var _0x5b2012=path[_0xc58c('0x67')](config[_0xc58c('0x68')],_0xc58c('0x72'));var _0x5dc4d5={'where':{'id':_0x4c73ed['params']['id']},'attributes':['id',_0xc58c('0x73')],'raw':!![]};return db[_0xc58c('0x2f')][_0xc58c('0x4c')](_0x5dc4d5)[_0xc58c('0x25')](handleEntityNotFound(_0x43a666,null))[_0xc58c('0x25')](function(_0x25de5b){if(_0x25de5b){if(!_[_0xc58c('0x6d')](_0x25de5b[_0xc58c('0x73')])){if(fs[_0xc58c('0x6e')](path['join'](config[_0xc58c('0x68')],_0xc58c('0x74'),_0x25de5b['agentAvatar']))){_0x5b2012=path[_0xc58c('0x67')](config[_0xc58c('0x68')],'server/files/images/avatars/',_0x25de5b[_0xc58c('0x73')]);}}return _0x43a666[_0xc58c('0x70')](_0x5b2012);}})[_0xc58c('0x1d')](handleError(_0x43a666,null));};exports[_0xc58c('0x75')]=function(_0x2555c7,_0x575077){var _0x5929bc=path[_0xc58c('0x67')](config[_0xc58c('0x68')],_0xc58c('0x76'));var _0x320ef8={'where':{'id':_0x2555c7[_0xc58c('0x48')]['id']},'attributes':['id',_0xc58c('0x65'),_0xc58c('0x77')],'raw':!![]};return db['ChatWebsite'][_0xc58c('0x4c')](_0x320ef8)[_0xc58c('0x25')](handleEntityNotFound(_0x575077,null))['then'](function(_0x3b8f10){if(_0x3b8f10){if(!_['isNil'](_0x3b8f10[_0xc58c('0x65')])){if(fs['existsSync'](path[_0xc58c('0x67')](config[_0xc58c('0x68')],_0xc58c('0x74'),_0x3b8f10[_0xc58c('0x65')]))&&_0x3b8f10[_0xc58c('0x77')]){_0x5929bc=path['join'](config['root'],'server/files/images/avatars/',_0x3b8f10['customerAvatar']);}}return _0x575077[_0xc58c('0x70')](_0x5929bc);}})[_0xc58c('0x1d')](handleError(_0x575077,null));};exports[_0xc58c('0x78')]=function(_0x5f3950,_0x455889){var _0x107983=path[_0xc58c('0x67')](config['root'],_0xc58c('0x79'));var _0x1fa9cf={'where':{'id':_0x5f3950[_0xc58c('0x48')]['id']},'attributes':['id',_0xc58c('0x66')],'raw':!![]};return db[_0xc58c('0x2f')][_0xc58c('0x4c')](_0x1fa9cf)['then'](handleEntityNotFound(_0x455889,null))[_0xc58c('0x25')](function(_0x1e712b){if(_0x1e712b){if(!_[_0xc58c('0x6d')](_0x1e712b[_0xc58c('0x66')])){if(fs[_0xc58c('0x6e')](path[_0xc58c('0x67')](config[_0xc58c('0x68')],_0xc58c('0x74'),_0x1e712b[_0xc58c('0x66')]))){_0x107983=path[_0xc58c('0x67')](config[_0xc58c('0x68')],'server/files/images/avatars/',_0x1e712b['systemAvatar']);}}return _0x455889[_0xc58c('0x70')](_0x107983);}})[_0xc58c('0x1d')](handleError(_0x455889,null));};exports[_0xc58c('0x7a')]=function(_0x22f50d,_0x241908){var _0x1d8f02=require(_0xc58c('0x7b'));var _0x50bbc6=new _0x1d8f02();var _0x278644=_0x50bbc6[_0xc58c('0x7c')](_0x22f50d['headers'][_0xc58c('0x7d')])[_0xc58c('0x7e')]();var _0x205ac9={'body':_0x22f50d[_0xc58c('0x4e')],'channel':'chat'};var _0x5c5980=[];var _0x2d3561=[];var _0x5a6be2={};var _0x107989=![];return db['CmContact'][_0xc58c('0x57')]()['then'](function(_0x1a3879){if(!_0x1a3879){throw new db['Sequelize'][(_0xc58c('0x7f'))](_0xc58c('0x80'));}_0x5c5980=_[_0xc58c('0x81')](_[_0xc58c('0x34')](_0x1a3879),[_0xc58c('0x82'),_0xc58c('0x83')]);_0x2d3561=_[_0xc58c('0x81')](_[_0xc58c('0x34')](_0x1a3879),[_0xc58c('0x82'),'updatedAt','CompanyId','ListId']);if(_0x22f50d[_0xc58c('0x4e')]['id']){delete _0x22f50d['body']['id'];}if(_[_0xc58c('0x6d')](_0x22f50d['body'][_0xc58c('0x84')])){throw new db['Sequelize'][(_0xc58c('0x7f'))](_0xc58c('0x85'));}if(_[_0xc58c('0x6d')](_0x22f50d['body'][_0xc58c('0x4e')])||_0x22f50d[_0xc58c('0x4e')]['body']===''){throw new db[(_0xc58c('0x86'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x22f50d[_0xc58c('0x4e')][_0xc58c('0x87')])){throw new db[(_0xc58c('0x86'))]['ValidationError'](_0xc58c('0x88')+_0x2d3561);}if(!_[_0xc58c('0x89')](_0x2d3561,_0x22f50d[_0xc58c('0x4e')]['mapKey'])){throw new db[(_0xc58c('0x86'))][(_0xc58c('0x7f'))](_0xc58c('0x8a')+_0x2d3561);}_0x5a6be2[_0x22f50d[_0xc58c('0x4e')][_0xc58c('0x87')]]=_0x22f50d[_0xc58c('0x4e')][_0xc58c('0x84')];})[_0xc58c('0x25')](function(){return db[_0xc58c('0x2f')][_0xc58c('0x4c')]({'where':{'id':_0x22f50d[_0xc58c('0x48')]['id']},'include':[{'model':db[_0xc58c('0x8b')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x5a6be2,'limit':0x1,'order':[['updatedAt',_0xc58c('0x8c')]]}]},{'model':db['ChatApplication'],'as':_0xc58c('0x8d')}]});})[_0xc58c('0x25')](handleEntityNotFound(_0x241908,null))[_0xc58c('0x25')](function(_0x4cb444){if(_0x4cb444&&_0x4cb444[_0xc58c('0x8e')]){_0x205ac9[_0xc58c('0x8f')]=_0x4cb444;_0x205ac9[_0xc58c('0x90')]=_0x4cb444['Applications'];_0x205ac9[_0xc58c('0x91')]=_0x4cb444[_0xc58c('0x8e')];_0x205ac9['applications']=_[_0xc58c('0x92')](_0x205ac9[_0xc58c('0x90')],['priority'],[_0xc58c('0x93')]);if(_0x205ac9[_0xc58c('0x8f')][_0xc58c('0x8d')]){delete _0x205ac9['account']['Applications'];}if(_0x205ac9[_0xc58c('0x8f')]['List']&&_0x205ac9[_0xc58c('0x8f')][_0xc58c('0x8e')][_0xc58c('0x94')][_0xc58c('0x39')]){return _0x205ac9[_0xc58c('0x8f')]['List'][_0xc58c('0x94')][0x0];}var _0x26cd1f=_[_0xc58c('0xc')](_0x22f50d['body'],{'firstName':_0x22f50d[_0xc58c('0x4e')]['from'],'ListId':_0x4cb444[_0xc58c('0x95')]});_0x26cd1f[_0x22f50d[_0xc58c('0x4e')]['mapKey']]=_0x22f50d[_0xc58c('0x4e')][_0xc58c('0x84')];return db[_0xc58c('0x96')]['create'](_0x26cd1f,{'fields':_0x5c5980,'raw':!![]});}})[_0xc58c('0x25')](handleEntityNotFound(_0x241908,null))[_0xc58c('0x25')](function(_0x2422ba){_0x205ac9[_0xc58c('0x97')]=_0x2422ba;var _0x1d2a0a=_0x22f50d[_0xc58c('0x4e')][_0xc58c('0x98')];if(_0x22f50d[_0xc58c('0x99')][_0xc58c('0x9a')]){_0x1d2a0a=_0x22f50d[_0xc58c('0x99')][_0xc58c('0x9a')];}else if(_0x22f50d[_0xc58c('0x99')][_0xc58c('0x9b')]){_0x1d2a0a=_[_0xc58c('0x9c')](_0x22f50d[_0xc58c('0x99')][_0xc58c('0x9b')][_0xc58c('0x9d')](','));}if(_0x2422ba){var _0xf6e4cb={'ContactId':_0x2422ba['id'],'ChatWebsiteId':_0x22f50d[_0xc58c('0x48')]['id'],'from':(_0x2422ba[_0xc58c('0x9e')]||'')+'\x20'+(_0x2422ba[_0xc58c('0x9f')]||''),'customerIp':_0x1d2a0a,'customerPort':_0x22f50d[_0xc58c('0x99')][_0xc58c('0xa0')]?_0x22f50d['headers'][_0xc58c('0xa0')]:null,'referer':_0x22f50d['body'][_0xc58c('0xa1')],'browserName':_0x278644[_0xc58c('0xa2')][_0xc58c('0x2a')]&&_0x278644['browser'][_0xc58c('0xa3')]?util[_0xc58c('0xa4')](_0xc58c('0xa5'),_0x278644[_0xc58c('0xa2')][_0xc58c('0x2a')],_0x278644[_0xc58c('0xa2')][_0xc58c('0xa3')]):_0xc58c('0xa6'),'browserVersion':_0x278644[_0xc58c('0xa2')][_0xc58c('0xa3')]||_0xc58c('0xa6'),'osName':util['format'](_0xc58c('0xa5'),_0x278644['os'][_0xc58c('0x2a')],_0x278644['os']['version']),'osVersion':_0x278644['os']['version'],'deviceModel':_0x278644['device']['model']&&_0x278644[_0xc58c('0xa7')][_0xc58c('0xa8')]?util['format']('%s\x20%s\x20%s',_0x278644[_0xc58c('0xa7')][_0xc58c('0x36')],_0x278644[_0xc58c('0xa7')][_0xc58c('0xa8')],_0x278644[_0xc58c('0xa7')][_0xc58c('0x31')]):null,'deviceVendor':_0x278644['device'][_0xc58c('0xa8')],'deviceType':_0x278644[_0xc58c('0xa7')][_0xc58c('0x31')],'formData':JSON['stringify'](_0x22f50d[_0xc58c('0x4e')])};var _0x15ef6d={'ChatWebsiteId':_0x22f50d[_0xc58c('0x48')]['id'],'closed':![]};if(_0x22f50d[_0xc58c('0x4e')]['threadId']){_0x15ef6d[_0xc58c('0xa9')]=_0x22f50d[_0xc58c('0x4e')][_0xc58c('0xa9')];return db[_0xc58c('0xaa')][_0xc58c('0x4c')]({'where':_0x15ef6d})[_0xc58c('0x25')](function(_0x2e436f){if(_0x2e436f){return[_0x2e436f,![]];}_0xf6e4cb[_0xc58c('0xa9')]=_0x22f50d[_0xc58c('0x4e')]['threadId'];_0xf6e4cb['externalUrl']=_0x22f50d[_0xc58c('0x4e')][_0xc58c('0xab')];return db[_0xc58c('0xaa')][_0xc58c('0x4d')](_0xf6e4cb)[_0xc58c('0x25')](function(_0xbaae42){return[_0xbaae42,!![]];});});}_0x15ef6d['ContactId']=_0x2422ba['id'];if(_0x22f50d['body']['interaction']&&_0x22f50d[_0xc58c('0x4e')][_0xc58c('0xac')]['id']){_0x15ef6d['id']=_0x22f50d[_0xc58c('0x4e')][_0xc58c('0xac')]['id'];return db[_0xc58c('0xaa')][_0xc58c('0x4c')]({'where':_0x15ef6d})[_0xc58c('0x25')](function(_0x400014){if(_0x400014){return[_0x400014,![]];}return db[_0xc58c('0xaa')][_0xc58c('0x4d')](_0xf6e4cb)[_0xc58c('0x25')](function(_0x54d398){return[_0x54d398,!![]];});});}return db[_0xc58c('0xaa')][_0xc58c('0x4d')](_0xf6e4cb)[_0xc58c('0x25')](function(_0x1d43f6){return[_0x1d43f6,!![]];});}})['spread'](function(_0x449b98,_0x4cf237){if(_0x449b98){_0x107989=_0x4cf237;if(!_0x4cf237){var _0x4cc8f6={'from':(_0x205ac9[_0xc58c('0x97')][_0xc58c('0x9e')]||'')+'\x20'+(_0x205ac9[_0xc58c('0x97')]['lastName']||'')};if(_0x22f50d[_0xc58c('0x4e')][_0xc58c('0xa9')]&&_0x22f50d[_0xc58c('0x4e')]['messageId']&&_0x22f50d[_0xc58c('0x4e')][_0xc58c('0xa9')]!=_0x22f50d[_0xc58c('0x4e')][_0xc58c('0xad')]){_0x4cc8f6[_0xc58c('0xa9')]=_0x22f50d['body']['messageId'];}return _0x449b98[_0xc58c('0x24')](_0x4cc8f6);}else{return _0x449b98;}}})['then'](function(_0x43b6c6){_0x205ac9[_0xc58c('0xac')]=_0x43b6c6[_0xc58c('0x50')]({'plain':!![]});_0x205ac9[_0xc58c('0xac')][_0xc58c('0xae')]=_0x107989;if(_0x205ac9[_0xc58c('0xac')]['created']){if(_0x205ac9['account']['autoclose']){_0x205ac9[_0xc58c('0x90')]['push']({'id':0x0,'priority':_0x205ac9[_0xc58c('0x90')][_0xc58c('0x39')]+0x1,'app':'close','appdata':_0xc58c('0xaf'),'interval':_0xc58c('0xb0')});}}return db[_0xc58c('0xb1')][_0xc58c('0x4d')]({'body':_0x22f50d[_0xc58c('0x4e')][_0xc58c('0x4e')],'ChatWebsiteId':_0x22f50d[_0xc58c('0x48')]['id'],'ChatInteractionId':_0x43b6c6['id'],'direction':'in','ContactId':_0x205ac9['contact']['id'],'AttachmentId':_0x22f50d[_0xc58c('0x4e')]['AttachmentId']});})['then'](function(_0x34d13a){_0x205ac9['message']=_0x34d13a;if(_0x205ac9[_0xc58c('0xac')][_0xc58c('0xb2')]){return db[_0xc58c('0xb3')]['find']({'attributes':['id',_0xc58c('0x2a')],'where':{'id':_0x205ac9[_0xc58c('0xac')][_0xc58c('0xb2')]}})[_0xc58c('0x25')](function(_0x879140){if(_0x879140){_0x205ac9[_0xc58c('0x90')][_0xc58c('0xb4')]({'id':0x0,'priority':0x0,'app':_0xc58c('0xb5'),'appdata':_0x879140[_0xc58c('0x2a')]+','+(_0x205ac9[_0xc58c('0x8f')]['waitForTheAssignedAgent']||0xa),'interval':_0xc58c('0xb0')});_0x205ac9[_0xc58c('0xb6')]=!![];}return respondWithRpcPromise(_0xc58c('0xb7'),_0xc58c('0xb8'),_0x205ac9);});}return respondWithRpcPromise('Start',_0xc58c('0xb8'),_0x205ac9);})[_0xc58c('0x25')](function(_0x1c9b80){respondWithRpcPromise(_0xc58c('0xb9'),_0xc58c('0xb9'),{'event':'notify','message':_0x1c9b80},client9002);return _0x1c9b80;})[_0xc58c('0x25')](respondWithResult(_0x241908,null))[_0xc58c('0x1d')](handleError(_0x241908,null));};exports[_0xc58c('0xba')]=function(_0x1354e1,_0x1a7bbb){var _0x339a19,_0x51e9c3,_0x58e33e;var _0x2fb1cd=[];var _0xc3ffe3={};var _0x24b6a8=_0x1354e1[_0xc58c('0xbb')]||[];var _0x530792=[];var _0x8cad10;return db[_0xc58c('0x96')][_0xc58c('0x57')]()[_0xc58c('0x25')](function(_0x12bc87){if(!_0x12bc87){throw new db[(_0xc58c('0x86'))]['ValidationError'](_0xc58c('0x80'));}_0x2fb1cd=_[_0xc58c('0x81')](_[_0xc58c('0x34')](_0x12bc87),[_0xc58c('0x82'),_0xc58c('0x83'),_0xc58c('0xbc'),_0xc58c('0x95')]);if(_0x1354e1[_0xc58c('0x4e')]['id']){delete _0x1354e1[_0xc58c('0x4e')]['id'];}if(_[_0xc58c('0x6d')](_0x1354e1[_0xc58c('0x4e')]['from'])){throw _0x1a7bbb['status'](0x1f4)[_0xc58c('0x2c')](new db[(_0xc58c('0x86'))]['ValidationError'](_0xc58c('0x85')));}if(_[_0xc58c('0x6d')](_0x1354e1[_0xc58c('0x4e')][_0xc58c('0x4e')])||_0x1354e1[_0xc58c('0x4e')]['body']===''){throw _0x1a7bbb[_0xc58c('0x2b')](0x1f4)['send'](new db[(_0xc58c('0x86'))]['ValidationError'](_0xc58c('0xbd')));}if(_[_0xc58c('0x6d')](_0x1354e1[_0xc58c('0x4e')][_0xc58c('0xbe')])){throw _0x1a7bbb['status'](0x1f4)[_0xc58c('0x2c')](new db[(_0xc58c('0x86'))][(_0xc58c('0x7f'))](_0xc58c('0xbf')+_0x2fb1cd));}if(!_[_0xc58c('0x89')](_0x2fb1cd,_0x1354e1[_0xc58c('0x4e')][_0xc58c('0xbe')])){throw _0x1a7bbb[_0xc58c('0x2b')](0x1f4)[_0xc58c('0x2c')](new db[(_0xc58c('0x86'))][(_0xc58c('0x7f'))](_0xc58c('0xc0')+_0x2fb1cd));}_0xc3ffe3[_0x1354e1[_0xc58c('0x4e')][_0xc58c('0xbe')]]=_0x1354e1[_0xc58c('0x4e')]['from'];})[_0xc58c('0x25')](function(){return db[_0xc58c('0x2f')]['find']({'where':{'id':_0x1354e1[_0xc58c('0x48')]['id']},'include':[{'model':db[_0xc58c('0x8b')],'as':'List'},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0xc58c('0x25')](handleEntityNotFound(_0x1a7bbb,null))['then'](function(_0x21e9f2){if(_0x21e9f2&&_0x21e9f2[_0xc58c('0x8e')]){_0x51e9c3=_0x21e9f2;var _0x3ba555=_[_0xc58c('0xc')](_0x1354e1[_0xc58c('0x4e')],{'firstName':_0x1354e1['body']['from'],'phone':_0x1354e1[_0xc58c('0x4e')]['from'],'ListId':_0x21e9f2['ListId']});_0x3ba555[_0x1354e1[_0xc58c('0x4e')]['mapKeyOffline']]=_0x1354e1[_0xc58c('0x4e')]['from'];return db[_0xc58c('0x96')][_0xc58c('0xc1')]({'where':_0xc3ffe3,'defaults':_0x3ba555});}})[_0xc58c('0xc2')](function(_0x9b44d9){if(_0x9b44d9){_0x58e33e=_0x9b44d9;var _0x56b39a=fs[_0xc58c('0xc3')](path['join'](config[_0xc58c('0x68')],_0xc58c('0xc4')),'utf8');var _0x345e80=ejs[_0xc58c('0xc5')](_0x56b39a,{'body':_['toPairs'](_0x1354e1[_0xc58c('0x4e')][_0xc58c('0x4e')]),'bodyTitle':_0x51e9c3['offlineMessageBody']});return db[_0xc58c('0xc6')][_0xc58c('0x4d')]({'body':_0x345e80,'plainBody':htmlToText[_0xc58c('0xc7')](_0x345e80),'ContactId':_0x9b44d9['id'],'ChatWebsiteId':_0x51e9c3['id']});}})[_0xc58c('0x25')](function(_0x142621){_0x8cad10=_0x142621;if(_0x24b6a8['length']){var _0x53963c=_0x24b6a8[_0xc58c('0x32')](function(_0x26dbc9){return{'name':_0x26dbc9['originalname'],'basename':_0x26dbc9[_0xc58c('0x63')],'type':_0x26dbc9[_0xc58c('0xc8')],'ChatOfflineMessageId':_0x142621['id']};});_0x530792=_0x53963c['map'](_0x140a04=>{var _0x523a58={'filename':_0x140a04[_0xc58c('0x2a')],'path':path[_0xc58c('0x67')](config[_0xc58c('0x68')],_0xc58c('0xc9'),_0xc58c('0xbb'),'attachments',_0xc58c('0xca'),_0x140a04[_0xc58c('0xcb')])};return _0x523a58;});if(!_0x51e9c3[_0xc58c('0xcc')]){return db[_0xc58c('0xcd')][_0xc58c('0xce')](function(_0x38a882){return db[_0xc58c('0xcf')][_0xc58c('0xd0')](_0x53963c,{'transaction':_0x38a882});});}}})['then'](function(){if(_0x8cad10){_0x339a19=_0x8cad10;return db[_0xc58c('0xd1')][_0xc58c('0x5c')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0xc58c('0xd2')],'as':_0xc58c('0xd2'),'raw':!![]}]}]});}})[_0xc58c('0x25')](function(_0x530ece){if(_0x530ece&&_0x530ece[_0xc58c('0xd3')]&&_0x51e9c3[_0xc58c('0xd4')]&&_0x51e9c3[_0xc58c('0xd5')]){var _0xd3e36b=_0x530ece[_0xc58c('0xd6')]();return respondWithRpcPromise(_0xc58c('0xd7'),_0xc58c('0xd8'),{'account':_0xd3e36b,'message':{'from':util[_0xc58c('0xa4')](_0xc58c('0xd9'),_0x530ece[_0xc58c('0x2a')],_0x530ece[_0xc58c('0xda')]||_0x530ece[_0xc58c('0xd3')][_0xc58c('0x4f')]),'to':_0x51e9c3[_0xc58c('0xd5')],'subject':_0x51e9c3[_0xc58c('0xdb')],'html':_0x339a19['body'],'attachments':_0x530792}},client9003)[_0xc58c('0x25')](function(){return _0x339a19;})[_0xc58c('0x1d')](function(_0x2ada9f){logger['error'](_0x2ada9f);});}})['then'](function(){if(_0x51e9c3&&_0x51e9c3['openNewInteraction']&&_0x51e9c3[_0xc58c('0xdc')]){var _0x348de7=[];if(_0x24b6a8[_0xc58c('0x39')]){_0x348de7=_0x24b6a8[_0xc58c('0x32')](function(_0x428fe6){return{'name':_0x428fe6[_0xc58c('0xdd')],'basename':_0x428fe6[_0xc58c('0x63')],'type':_0x428fe6[_0xc58c('0xc8')],'ChatOfflineMessageId':_0x8cad10['id']};});}var _0x4916bd;if(!_[_0xc58c('0x6d')](_0x51e9c3[_0xc58c('0xde')])){var _0x2951e5=_[_0xc58c('0x32')](_0x1354e1['body'],function(_0x22e24a){return _0x22e24a;});var _0x4b5ae4=_[_0xc58c('0xdf')](_0x2951e5)[0x0];var _0x11f290=_[_0xc58c('0xe0')](_0x4b5ae4,function(_0x39ab92){return _0x39ab92;});_0x4916bd=_0x11f290[0x1][_0x51e9c3[_0xc58c('0xde')]];}var _0x553b89={'from':_0x58e33e['email'],'firstName':_0x58e33e[_0xc58c('0x9e')],'lastName':_0x58e33e['lastName'],'mapKey':_0xc58c('0xda'),'message':{'from':_0x58e33e[_0xc58c('0xda')],'to':_0x51e9c3[_0xc58c('0xd1')][_0xc58c('0xda')],'cc':'','subject':_[_0xc58c('0x6d')](_0x4916bd)?_0x51e9c3[_0xc58c('0xdb')]:_0x4916bd,'messageId':'','sentAt':new Date(),'attach':_0x348de7[_0xc58c('0x39')],'attachments':_0x348de7,'originChannel':_0xc58c('0xe1'),'ChatWebsiteId':_0x51e9c3['id'],'ChatOfflineMessageId':_0x339a19['id'],'originTo':_0x51e9c3['MailAccount'][_0xc58c('0xda')]},'body':_0x339a19[_0xc58c('0x4e')]};var _0x41332={'account':{'id':_0x51e9c3['MailAccountId']},'body':_0x553b89,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xc58c('0xe2'),'notifyMail',_0x41332,client9001)[_0xc58c('0x25')](function(){return _0x339a19;})[_0xc58c('0x1d')](function(_0x4b2508){logger['error'](_0x4b2508);});}return;})[_0xc58c('0x25')](function(){if(_0x339a19){return _0x339a19;}})[_0xc58c('0x25')](respondWithResult(_0x1a7bbb,null))['catch'](function(_0x4d889f){logger['error']('catch',_0x4d889f);for(var _0x572103 of _0x24b6a8){var _0x1af984=path[_0xc58c('0x67')](config[_0xc58c('0x68')],_0xc58c('0xc9'),'files','attachments','offline-chat',_0x572103[_0xc58c('0x63')]);fs_extra[_0xc58c('0xe3')](_0x1af984)[_0xc58c('0x1d')](function(_0x4c4b3b){logger[_0xc58c('0x17')](_0xc58c('0xe4'),_0x1af984,_0x4c4b3b);});}});};exports[_0xc58c('0xe5')]=function(_0x314cb1,_0x4f4528){return db[_0xc58c('0xaa')][_0xc58c('0x4c')]({'where':{'id':_0x314cb1[_0xc58c('0x48')]['id']}})[_0xc58c('0x25')](handleEntityNotFound(_0x4f4528,null))['then'](function(_0x13ac99){if(_0x13ac99){return _0x13ac99[_0xc58c('0xe5')](_0x314cb1[_0xc58c('0x4e')][_0xc58c('0x5e')],_['omit'](_0x314cb1[_0xc58c('0x4e')],['ids','id'])||{});}})[_0xc58c('0x25')](respondWithResult(_0x4f4528,null))[_0xc58c('0x1d')](handleError(_0x4f4528,null));};exports[_0xc58c('0xe6')]=function(_0x3407c3,_0x14afaf){var _0x5b52ee={'raw':![],'where':{}};var _0x4823fd={};var _0x100bf3={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xc58c('0x5c')]({'where':{'id':_0x3407c3[_0xc58c('0x48')]['id']}})[_0xc58c('0x25')](handleEntityNotFound(_0x14afaf,null))[_0xc58c('0x25')](function(_0x33f3b3){if(_0x33f3b3){_0x4823fd[_0xc58c('0x36')]=_[_0xc58c('0x34')](db[_0xc58c('0xaa')]['rawAttributes']);_0x4823fd[_0xc58c('0x33')]=_[_0xc58c('0x34')](_0x3407c3[_0xc58c('0x33')]);_0x4823fd[_0xc58c('0x35')]=_['intersection'](_0x4823fd['model'],_0x4823fd[_0xc58c('0x33')]);_0x5b52ee[_0xc58c('0x37')]=_['intersection'](_0x4823fd['model'],qs['fields'](_0x3407c3[_0xc58c('0x33')][_0xc58c('0x38')]));_0x5b52ee[_0xc58c('0x37')]=_0x5b52ee['attributes'][_0xc58c('0x39')]?_0x5b52ee[_0xc58c('0x37')]:_0x4823fd[_0xc58c('0x36')];if(!_0x3407c3[_0xc58c('0x33')][_0xc58c('0x3a')]('nolimit')){_0x5b52ee[_0xc58c('0x21')]=qs[_0xc58c('0x21')](_0x3407c3['query']['limit']);_0x5b52ee[_0xc58c('0x1f')]=qs[_0xc58c('0x1f')](_0x3407c3['query']['offset']);}_0x5b52ee[_0xc58c('0x3c')]=qs[_0xc58c('0x3d')](_0x3407c3[_0xc58c('0x33')]['sort']);_0x5b52ee['where']=qs[_0xc58c('0x35')](_[_0xc58c('0x3f')](_0x3407c3[_0xc58c('0x33')],_0x4823fd[_0xc58c('0x35')]));_0x5b52ee[_0xc58c('0x3e')][_0xc58c('0x59')]=_0x33f3b3['id'];if(_0x3407c3['query'][_0xc58c('0x40')]){_0x5b52ee['where']=_['merge'](_0x5b52ee[_0xc58c('0x3e')],{'$or':_[_0xc58c('0x32')](_0x5b52ee['attributes'],function(_0xfd3ac3){var _0x3635f0={};_0x3635f0[_0xfd3ac3]={'$like':'%'+_0x3407c3[_0xc58c('0x33')][_0xc58c('0x40')]+'%'};return _0x3635f0;})});}_0x5b52ee=_[_0xc58c('0x41')]({},_0x5b52ee,_0x3407c3['options']);return db[_0xc58c('0xaa')]['count']({'where':_0x5b52ee[_0xc58c('0x3e')]})[_0xc58c('0x25')](function(_0x466ce1){_0x100bf3[_0xc58c('0x22')]=_0x466ce1;if(_0x3407c3['query'][_0xc58c('0x44')]){_0x5b52ee[_0xc58c('0x45')]=[{'model':db[_0xc58c('0x96')],'as':_0xc58c('0xe7'),'required':![]},{'model':db[_0xc58c('0xb3')],'as':'Owner','attributes':[_0xc58c('0x2a'),'fullname',_0xc58c('0xe8')],'required':![]},{'model':db[_0xc58c('0xe9')],'as':_0xc58c('0xea'),'attributes':['id',_0xc58c('0x2a'),_0xc58c('0xeb')],'where':_0x3407c3[_0xc58c('0x33')]['tag']?{'id':_0x3407c3['query'][_0xc58c('0xec')]}:undefined,'required':_0x3407c3['query']['tag']?!![]:![]}];}return db[_0xc58c('0xaa')][_0xc58c('0x46')](_0x5b52ee);})[_0xc58c('0x25')](function(_0x30c0c1){_0x100bf3[_0xc58c('0x47')]=_0x30c0c1;return _0x100bf3;});}})[_0xc58c('0x25')](respondWithFilteredResult(_0x14afaf,_0x5b52ee))['catch'](handleError(_0x14afaf,null));};function iftimePromise(_0x3437fc,_0x2da6e9){return respondWithRpcPromise(_0xc58c('0xed'),_0xc58c('0xee'),{'command':_0x2da6e9[_0xc58c('0xef')]?util['format']('iftime\x20%s,%s',_0x3437fc['interval'],_0x2da6e9[_0xc58c('0xef')]):util[_0xc58c('0xa4')](_0xc58c('0xf0'),_0x3437fc['interval'])},client9002)[_0xc58c('0x25')](function(_0x361671){var _0x41502a=_0x361671&&_0x361671['indexOf'](_0xc58c('0xf1'))>=0x0?!![]:![];logger[_0xc58c('0x1b')](_0xc58c('0xf2'),_0x2da6e9['id'],_0x3437fc['id'],_0x3437fc[_0xc58c('0xf3')],_0x41502a?_0xc58c('0xf4'):_0xc58c('0xf5'),_0x2da6e9[_0xc58c('0xef')]?_0x2da6e9[_0xc58c('0xef')]:'No\x20timezone');return _0x41502a;})[_0xc58c('0x1d')](function(_0x4bffc9){logger[_0xc58c('0x17')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x2da6e9['id'],_0x3437fc['id'],_0x3437fc[_0xc58c('0xf3')],util[_0xc58c('0xf6')](_0x4bffc9,{'showHidden':![],'depth':null}),_0x2da6e9['timezone']?_0x2da6e9[_0xc58c('0xef')]:_0xc58c('0xf7'));return![];});}exports[_0xc58c('0xee')]=function(_0x4df53b,_0x3dbe8a){var _0x154a09=0x0;var _0x55cb76=0x0;var _0x3bbabf=![];var _0x33352c;var _0x277107;return db[_0xc58c('0x2f')][_0xc58c('0x4c')]({'where':{'id':_0x4df53b[_0xc58c('0x48')]['id']},'include':[{'model':db[_0xc58c('0xf8')],'as':_0xc58c('0xf8'),'include':[{'model':db[_0xc58c('0xf8')],'as':'Intervals','attributes':['id',_0xc58c('0xf3')],'raw':!![]}]}]})[_0xc58c('0x25')](handleEntityNotFound(_0x3dbe8a,null))[_0xc58c('0x25')](function(_0x5a0d70){if(_0x5a0d70){_0x33352c=_0x5a0d70;return _0x5a0d70[_0xc58c('0xf9')]({'raw':!![]});}})[_0xc58c('0x25')](function(_0x1fa820){if(_0x33352c){if(_0x1fa820){_0x277107=_0x1fa820;}}return require('../../config/license/util')[_0xc58c('0xfa')]();})[_0xc58c('0x25')](function(_0x589fd0){if(_0x589fd0){_0x55cb76=_0x589fd0[_0xc58c('0xfb')];_0x3bbabf=_0x589fd0[_0xc58c('0x6c')];}})[_0xc58c('0x25')](function(){return db[_0xc58c('0xaa')][_0xc58c('0x22')]({'where':{'closed':![]}});})[_0xc58c('0x25')](function(_0x45a4c8){_0x154a09=_0x45a4c8;if(_0x55cb76&&_0x45a4c8>_0x55cb76){return db[_0xc58c('0xfc')][_0xc58c('0x5c')]({'where':{'id':0x1}})[_0xc58c('0x25')](function(_0x1703d8){if(_0x1703d8){_0x1703d8[_0xc58c('0xfd')]('chatLicenseExceeded');}});}})[_0xc58c('0x25')](function(){if(_0x33352c['Interval']&&_0x33352c[_0xc58c('0xf8')]['Intervals']){var _0x41e08b=[];for(var _0x48e2a6=0x0;_0x48e2a6<_0x33352c['Interval'][_0xc58c('0xfe')][_0xc58c('0x39')];_0x48e2a6++){var _0x3c6407=_0x33352c[_0xc58c('0xf8')][_0xc58c('0xfe')][_0x48e2a6][_0xc58c('0x50')]({'plain':!![]});_0x41e08b[_0xc58c('0xff')](iftimePromise(_0x3c6407,_0x33352c));}return BPromise[_0xc58c('0x100')](_0x41e08b)[_0xc58c('0x25')](function(_0x45b3e0){return _[_0xc58c('0x101')](_0x45b3e0);});}else{return!![];}})[_0xc58c('0x25')](function(_0x2e1c44){var _0x186d7f=fs[_0xc58c('0xc3')](path[_0xc58c('0x67')](config[_0xc58c('0x68')],'server/files/chat/iframe.ejs'),'utf8');var _0x166c87={'remote':_0x33352c[_0xc58c('0x102')],'query':querystring[_0xc58c('0x16')](_[_0xc58c('0x41')](_0x33352c[_0xc58c('0x50')]({'plain':!![]}),{'customerIp':_0x4df53b[_0xc58c('0x99')][_0xc58c('0x9b')]||_0x4df53b['headers'][_0xc58c('0x103')]||_0x4df53b['connection']['remoteAddress']||_0x4df53b['ip'],'referer':_0x4df53b['headers'][_0xc58c('0xa1')],'openedInteractions':_0x154a09,'maxInteractions':_0x55cb76,'virtual':_0x3bbabf[_0xc58c('0xfb')],'online':_0x2e1c44,'custom':_0x3bbabf}))['replace'](/'/g,'\x5c\x27')};_0x3dbe8a[_0xc58c('0x2c')](ejs[_0xc58c('0xc5')](Mustache[_0xc58c('0xc5')](_0x186d7f,_0x166c87),{'proactiveActions':_0x277107,'alignment':_0x33352c[_0xc58c('0x104')],'verticalAlignment':_0x33352c[_0xc58c('0x105')],'div_color':_0x33352c[_0xc58c('0xeb')],'labelText':_0x33352c[_0xc58c('0x106')],'text_color':_0x33352c[_0xc58c('0x107')],'text_button_color':_0x33352c['textButtonColor'],'button_color':_0x33352c['color_button'],'background_color':_0x33352c[_0xc58c('0x108')],'hideWhenOffline':_0x33352c[_0xc58c('0x109')],'interval':_0x33352c[_0xc58c('0x10a')]}));})[_0xc58c('0x1d')](handleError(_0x3dbe8a,null));};exports[_0xc58c('0x10b')]=function(_0xcefbc4,_0x44f16d){var _0x5e1f06=_0xcefbc4[_0xc58c('0x48')]['id'];var _0x36fa02=_0xcefbc4[_0xc58c('0x4e')];var _0x5487ef=0xc8;var _0x1cc27a=null;return db[_0xc58c('0xcd')][_0xc58c('0xce')]({'isolationLevel':db['sequelize'][_0xc58c('0x10c')][_0xc58c('0x10d')][_0xc58c('0x10e')]},function(_0x514068){return db[_0xc58c('0x2f')][_0xc58c('0x5c')]({'where':{'id':_0x5e1f06},'transaction':_0x514068})[_0xc58c('0x25')](function(_0x3cec29){if(_0x3cec29){return db['ChatApplication'][_0xc58c('0x26')]({'where':{'ChatWebsiteId':_0x5e1f06},'transaction':_0x514068})[_0xc58c('0x25')](function(){var _0x1b1e7b=_[_0xc58c('0x32')](_0x36fa02,function(_0x578b7c){_0x578b7c[_0xc58c('0x59')]=_0x5e1f06;return _0x578b7c;});return db[_0xc58c('0x10f')][_0xc58c('0xd0')](_0x1b1e7b,{'transaction':_0x514068});});}else{_0x5487ef=0x194;_0x1cc27a=[];}});})['then'](function(){if(_0x5487ef!==0x194){return db[_0xc58c('0x10f')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x5e1f06},'order':_0xc58c('0x110')})['then'](function(_0x570f18){_0x1cc27a=_0x570f18;});}})['catch'](function(_0x49f714){_0x5487ef=0x1f4;logger['error'](_0x49f714[_0xc58c('0x111')]);if(_0x49f714[_0xc58c('0x2a')]){delete _0x49f714[_0xc58c('0x2a')];}_0x1cc27a=_0x49f714;})[_0xc58c('0x112')](function(){if(_0x1cc27a===null){_0x44f16d['sendStatus'](_0x5487ef);}else{if(_0x5487ef===0x1f4){_0x44f16d[_0xc58c('0x2b')](_0x5487ef)[_0xc58c('0x2c')](_0x1cc27a);}else{_0x44f16d['status'](_0x5487ef)[_0xc58c('0x1e')](_0x1cc27a);}}});};exports[_0xc58c('0x113')]=function(_0x379812,_0x489c6f){var _0x41f20f={};var _0x495f5e={};var _0x1b2a11;var _0x10ce93;return db[_0xc58c('0x2f')][_0xc58c('0x5c')]({'where':{'id':_0x379812[_0xc58c('0x48')]['id']}})[_0xc58c('0x25')](handleEntityNotFound(_0x489c6f,null))[_0xc58c('0x25')](function(_0x440c0b){if(_0x440c0b){_0x1b2a11=_0x440c0b;_0x495f5e[_0xc58c('0x36')]=_[_0xc58c('0x34')](db[_0xc58c('0x10f')][_0xc58c('0x4a')]);_0x495f5e[_0xc58c('0x33')]=_['keys'](_0x379812['query']);_0x495f5e[_0xc58c('0x35')]=_[_0xc58c('0x4b')](_0x495f5e[_0xc58c('0x36')],_0x495f5e[_0xc58c('0x33')]);_0x41f20f['attributes']=_[_0xc58c('0x4b')](_0x495f5e[_0xc58c('0x36')],qs[_0xc58c('0x38')](_0x379812[_0xc58c('0x33')][_0xc58c('0x38')]));_0x41f20f[_0xc58c('0x37')]=_0x41f20f[_0xc58c('0x37')][_0xc58c('0x39')]?_0x41f20f[_0xc58c('0x37')]:_0x495f5e['model'];_0x41f20f[_0xc58c('0x3c')]=qs['sort'](_0x379812[_0xc58c('0x33')][_0xc58c('0x3d')]);_0x41f20f[_0xc58c('0x3e')]=qs[_0xc58c('0x35')](_[_0xc58c('0x3f')](_0x379812[_0xc58c('0x33')],_0x495f5e[_0xc58c('0x35')]));if(_0x379812[_0xc58c('0x33')][_0xc58c('0x40')]){_0x41f20f['where']=_[_0xc58c('0x41')](_0x41f20f[_0xc58c('0x3e')],{'$or':_['map'](_0x41f20f[_0xc58c('0x37')],function(_0x244233){var _0x4cff20={};_0x4cff20[_0x244233]={'$like':'%'+_0x379812[_0xc58c('0x33')][_0xc58c('0x40')]+'%'};return _0x4cff20;})});}_0x41f20f=_['merge']({},_0x41f20f,_0x379812['options']);return _0x1b2a11['getApplications'](_0x41f20f);}})['then'](function(_0x2bc67e){if(_0x2bc67e){_0x10ce93=_0x2bc67e[_0xc58c('0x39')];if(!_0x379812[_0xc58c('0x33')]['hasOwnProperty'](_0xc58c('0x3b'))){_0x41f20f[_0xc58c('0x21')]=qs['limit'](_0x379812[_0xc58c('0x33')]['limit']);_0x41f20f['offset']=qs[_0xc58c('0x1f')](_0x379812['query']['offset']);}return _0x1b2a11['getApplications'](_0x41f20f);}})[_0xc58c('0x25')](function(_0x4e3ee3){if(_0x4e3ee3){return _0x4e3ee3?{'count':_0x10ce93,'rows':_0x4e3ee3}:null;}})[_0xc58c('0x25')](respondWithResult(_0x489c6f,null))['catch'](handleError(_0x489c6f,null));};exports[_0xc58c('0x114')]=function(_0x2ac574,_0x43f0c9){return db[_0xc58c('0x115')]['find']({'where':{'id':_0x2ac574[_0xc58c('0x48')]['id']}})[_0xc58c('0x25')](handleEntityNotFound(_0x43f0c9,null))['then'](function(_0x8ed22b){if(_0x8ed22b){return _0x8ed22b[_0xc58c('0x114')](_0x2ac574[_0xc58c('0x4e')][_0xc58c('0x5e')],_['omit'](_0x2ac574[_0xc58c('0x4e')],[_0xc58c('0x5e'),'id'])||{});}})['then'](respondWithResult(_0x43f0c9,null))[_0xc58c('0x1d')](handleError(_0x43f0c9,null));};exports[_0xc58c('0xf9')]=function(_0x33d2f6,_0x4f4bcb){var _0x473371={};var _0x2eba35={};var _0xc7a29f;var _0x4e61c0;return db[_0xc58c('0x2f')][_0xc58c('0x5c')]({'where':{'id':_0x33d2f6['params']['id']}})[_0xc58c('0x25')](handleEntityNotFound(_0x4f4bcb,null))['then'](function(_0x23234d){if(_0x23234d){_0xc7a29f=_0x23234d;_0x2eba35['model']=_['keys'](db['ChatProactiveAction'][_0xc58c('0x4a')]);_0x2eba35[_0xc58c('0x33')]=_['keys'](_0x33d2f6[_0xc58c('0x33')]);_0x2eba35['filters']=_[_0xc58c('0x4b')](_0x2eba35[_0xc58c('0x36')],_0x2eba35[_0xc58c('0x33')]);_0x473371[_0xc58c('0x37')]=_['intersection'](_0x2eba35[_0xc58c('0x36')],qs[_0xc58c('0x38')](_0x33d2f6['query'][_0xc58c('0x38')]));_0x473371[_0xc58c('0x37')]=_0x473371['attributes'][_0xc58c('0x39')]?_0x473371[_0xc58c('0x37')]:_0x2eba35[_0xc58c('0x36')];_0x473371[_0xc58c('0x3c')]=qs[_0xc58c('0x3d')](_0x33d2f6['query']['sort']);_0x473371['where']=qs['filters'](_[_0xc58c('0x3f')](_0x33d2f6[_0xc58c('0x33')],_0x2eba35[_0xc58c('0x35')]));if(_0x33d2f6[_0xc58c('0x33')]['filter']){_0x473371[_0xc58c('0x3e')]=_['merge'](_0x473371[_0xc58c('0x3e')],{'$or':_['map'](_0x473371['attributes'],function(_0x11147b){var _0x5cf3db={};_0x5cf3db[_0x11147b]={'$like':'%'+_0x33d2f6[_0xc58c('0x33')][_0xc58c('0x40')]+'%'};return _0x5cf3db;})});}_0x473371=_[_0xc58c('0x41')]({},_0x473371,_0x33d2f6[_0xc58c('0x43')]);return _0xc7a29f[_0xc58c('0xf9')](_0x473371);}})['then'](function(_0x306d15){if(_0x306d15){_0x4e61c0=_0x306d15[_0xc58c('0x39')];if(!_0x33d2f6[_0xc58c('0x33')][_0xc58c('0x3a')](_0xc58c('0x3b'))){_0x473371[_0xc58c('0x21')]=qs[_0xc58c('0x21')](_0x33d2f6['query'][_0xc58c('0x21')]);_0x473371[_0xc58c('0x1f')]=qs['offset'](_0x33d2f6[_0xc58c('0x33')][_0xc58c('0x1f')]);}return _0xc7a29f[_0xc58c('0xf9')](_0x473371);}})[_0xc58c('0x25')](function(_0x5f47ee){if(_0x5f47ee){return _0x5f47ee?{'count':_0x4e61c0,'rows':_0x5f47ee}:null;}})[_0xc58c('0x25')](respondWithResult(_0x4f4bcb,null))[_0xc58c('0x1d')](handleError(_0x4f4bcb,null));};exports[_0xc58c('0x116')]=function(_0x4cb409,_0x75797e){var _0x58eeaa=_0x4cb409[_0xc58c('0x33')]['online']===_0xc58c('0x117')?_0xc58c('0x118'):_0xc58c('0x119');return db[_0xc58c('0x2f')][_0xc58c('0x4c')]({'attributes':['id',_0x58eeaa],'where':{'id':_0x4cb409[_0xc58c('0x48')]['id']}})[_0xc58c('0x25')](handleEntityNotFound(_0x75797e,null))[_0xc58c('0x25')](function(_0x2c6aea){if(_0x2c6aea){var _0x83764d=_0x2c6aea[_0x58eeaa];var _0x33e1f6=_0x83764d&&_0x83764d['items']?_0x83764d[_0xc58c('0x11a')]:[];_0x75797e[_0xc58c('0x2c')]({'fromKey':_[_0xc58c('0x6d')](_0x83764d[_0xc58c('0x11b')])?undefined:_0x83764d['fromKey'],'count':_0x33e1f6['length'],'rows':_0x33e1f6});}})[_0xc58c('0x1d')](handleError(_0x75797e,null));};exports[_0xc58c('0x11c')]=function(_0xae2239,_0x2de5c4){var _0x5f3c85={'raw':![],'where':{}};var _0x29ade2={};var _0x2569b4={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0xae2239[_0xc58c('0x48')]['id']}})[_0xc58c('0x25')](handleEntityNotFound(_0x2de5c4,null))[_0xc58c('0x25')](function(_0x21b243){if(_0x21b243){_0x29ade2['model']=_[_0xc58c('0x34')](db[_0xc58c('0xc6')][_0xc58c('0x4a')]);_0x29ade2[_0xc58c('0x33')]=_[_0xc58c('0x34')](_0xae2239[_0xc58c('0x33')]);_0x29ade2[_0xc58c('0x35')]=_['intersection'](_0x29ade2[_0xc58c('0x36')],_0x29ade2[_0xc58c('0x33')]);_0x5f3c85['attributes']=_['intersection'](_0x29ade2[_0xc58c('0x36')],qs[_0xc58c('0x38')](_0xae2239['query']['fields']));_0x5f3c85['attributes']=_0x5f3c85[_0xc58c('0x37')][_0xc58c('0x39')]?_0x5f3c85['attributes']:_0x29ade2[_0xc58c('0x36')];if(!_0xae2239['query']['hasOwnProperty']('nolimit')){_0x5f3c85[_0xc58c('0x21')]=qs['limit'](_0xae2239['query'][_0xc58c('0x21')]);_0x5f3c85[_0xc58c('0x1f')]=qs[_0xc58c('0x1f')](_0xae2239[_0xc58c('0x33')][_0xc58c('0x1f')]);}_0x5f3c85[_0xc58c('0x3c')]=qs[_0xc58c('0x3d')](_0xae2239[_0xc58c('0x33')][_0xc58c('0x3d')]);_0x5f3c85[_0xc58c('0x3e')]=qs[_0xc58c('0x35')](_[_0xc58c('0x3f')](_0xae2239[_0xc58c('0x33')],_0x29ade2['filters']));_0x5f3c85[_0xc58c('0x3e')][_0xc58c('0x59')]=_0x21b243['id'];if(_0xae2239[_0xc58c('0x33')][_0xc58c('0x40')]){_0x5f3c85[_0xc58c('0x3e')]=_[_0xc58c('0x41')](_0x5f3c85[_0xc58c('0x3e')],{'$or':_[_0xc58c('0x32')](_0x5f3c85[_0xc58c('0x37')],function(_0x17db8f){var _0x3e7803={};_0x3e7803[_0x17db8f]={'$like':'%'+_0xae2239[_0xc58c('0x33')][_0xc58c('0x40')]+'%'};return _0x3e7803;})});}_0x5f3c85=_['merge']({},_0x5f3c85,_0xae2239['options']);return db[_0xc58c('0xc6')]['count']({'where':_0x5f3c85['where']})[_0xc58c('0x25')](function(_0x56eddc){_0x2569b4[_0xc58c('0x22')]=_0x56eddc;if(_0xae2239[_0xc58c('0x33')][_0xc58c('0x44')]){_0x5f3c85[_0xc58c('0x45')]=[{'all':!![]}];}else{_0x5f3c85[_0xc58c('0x45')]=[{'model':db['CmContact'],'as':_0xc58c('0xe7'),'required':![]},{'model':db[_0xc58c('0xcf')],'as':_0xc58c('0x11d'),'required':![]}];}return db[_0xc58c('0xc6')][_0xc58c('0x46')](_0x5f3c85);})[_0xc58c('0x25')](function(_0x12fcff){_0x2569b4[_0xc58c('0x47')]=_0x12fcff;return _0x2569b4;});}})['then'](respondWithFilteredResult(_0x2de5c4,_0x5f3c85))[_0xc58c('0x1d')](handleError(_0x2de5c4,null));};exports[_0xc58c('0x11e')]=function(_0x5d8f75,_0x19edd6){return db[_0xc58c('0x2f')]['find']({'where':{'id':_0x5d8f75[_0xc58c('0x48')]['id']}})[_0xc58c('0x25')](handleEntityNotFound(_0x19edd6,null))[_0xc58c('0x25')](function(_0x3dfe2f){if(_0x3dfe2f){return _0x3dfe2f[_0xc58c('0x11e')](_0x5d8f75[_0xc58c('0x4e')][_0xc58c('0x5e')],_['omit'](_0x5d8f75[_0xc58c('0x4e')],[_0xc58c('0x5e'),'id'])||{})['spread'](function(_0x421c2f){for(var _0x3f6855=0x0;_0x3f6855<_0x5d8f75[_0xc58c('0x4e')][_0xc58c('0x5e')]['length'];_0x3f6855+=0x1){socket[_0xc58c('0x11f')](_0xc58c('0x120'),{'UserId':Number(_0x5d8f75['body'][_0xc58c('0x5e')][_0x3f6855]),'ChatWebsiteId':Number(_0x5d8f75[_0xc58c('0x48')]['id'])});}return _0x421c2f;});}})['then'](respondWithResult(_0x19edd6,null))['catch'](handleError(_0x19edd6,null));};exports[_0xc58c('0x121')]=function(_0x36ee37,_0x5ca1c1){return db[_0xc58c('0x2f')][_0xc58c('0x4c')]({'where':{'id':_0x36ee37[_0xc58c('0x48')]['id']}})[_0xc58c('0x25')](handleEntityNotFound(_0x5ca1c1,null))['then'](function(_0x15f4ac){if(_0x15f4ac){return _0x15f4ac['removeAgents'](_0x36ee37[_0xc58c('0x33')]['ids'])['then'](function(){if(_[_0xc58c('0x122')](_0x36ee37['query'][_0xc58c('0x5e')])){for(var _0x4c78c7=0x0;_0x4c78c7<_0x36ee37['query']['ids'][_0xc58c('0x39')];_0x4c78c7+=0x1){socket[_0xc58c('0x11f')](_0xc58c('0x123'),{'UserId':Number(_0x36ee37['query'][_0xc58c('0x5e')][_0x4c78c7]),'ChatWebsiteId':Number(_0x36ee37[_0xc58c('0x48')]['id'])});}}else{socket['emit'](_0xc58c('0x123'),{'UserId':Number(_0x36ee37['query'][_0xc58c('0x5e')]),'ChatWebsiteId':Number(_0x36ee37[_0xc58c('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x5ca1c1,null))[_0xc58c('0x1d')](handleError(_0x5ca1c1,null));};exports['getAgents']=function(_0x2862dc,_0x364ce2){var _0x114f6f={};var _0x39818a={};var _0x2d0a35;var _0x4c956a;return db[_0xc58c('0x2f')]['findOne']({'where':{'id':_0x2862dc[_0xc58c('0x48')]['id']}})[_0xc58c('0x25')](handleEntityNotFound(_0x364ce2,null))[_0xc58c('0x25')](function(_0xae9756){if(_0xae9756){_0x2d0a35=_0xae9756;_0x39818a[_0xc58c('0x36')]=_['keys'](db[_0xc58c('0xb3')][_0xc58c('0x4a')]);_0x39818a['query']=_[_0xc58c('0x34')](_0x2862dc[_0xc58c('0x33')]);_0x39818a[_0xc58c('0x35')]=_[_0xc58c('0x4b')](_0x39818a[_0xc58c('0x36')],_0x39818a[_0xc58c('0x33')]);_0x114f6f[_0xc58c('0x37')]=_[_0xc58c('0x4b')](_0x39818a['model'],qs[_0xc58c('0x38')](_0x2862dc['query'][_0xc58c('0x38')]));_0x114f6f[_0xc58c('0x37')]=_0x114f6f[_0xc58c('0x37')][_0xc58c('0x39')]?_0x114f6f[_0xc58c('0x37')]:_0x39818a['model'];_0x114f6f[_0xc58c('0x3c')]=qs['sort'](_0x2862dc[_0xc58c('0x33')][_0xc58c('0x3d')]);_0x114f6f[_0xc58c('0x3e')]=qs[_0xc58c('0x35')](_[_0xc58c('0x3f')](_0x2862dc[_0xc58c('0x33')],_0x39818a[_0xc58c('0x35')]));if(_0x2862dc[_0xc58c('0x33')]['filter']){_0x114f6f['where']=_[_0xc58c('0x41')](_0x114f6f['where'],{'$or':_[_0xc58c('0x32')](_0x114f6f['attributes'],function(_0x2640ec){var _0xa1d24b={};_0xa1d24b[_0x2640ec]={'$like':'%'+_0x2862dc['query'][_0xc58c('0x40')]+'%'};return _0xa1d24b;})});}_0x114f6f=_['merge']({},_0x114f6f,_0x2862dc[_0xc58c('0x43')]);return _0x2d0a35[_0xc58c('0x124')](_0x114f6f);}})[_0xc58c('0x25')](function(_0x4c46cc){if(_0x4c46cc){_0x4c956a=_0x4c46cc['length'];if(!_0x2862dc[_0xc58c('0x33')][_0xc58c('0x3a')](_0xc58c('0x3b'))){_0x114f6f['limit']=qs[_0xc58c('0x21')](_0x2862dc[_0xc58c('0x33')][_0xc58c('0x21')]);_0x114f6f[_0xc58c('0x1f')]=qs[_0xc58c('0x1f')](_0x2862dc[_0xc58c('0x33')][_0xc58c('0x1f')]);}return _0x2d0a35[_0xc58c('0x124')](_0x114f6f);}})['then'](function(_0x1171b3){if(_0x1171b3){return _0x1171b3?{'count':_0x4c956a,'rows':_0x1171b3}:null;}})[_0xc58c('0x25')](respondWithResult(_0x364ce2,null))['catch'](handleError(_0x364ce2,null));}; \ No newline at end of file +var _0xdb88=['addAgents','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','mustache','util','ejs','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','json','offset','limit','undefined','count','status','set','Content-Range','destroy','get','UserProfileResource','end','stack','name','send','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','Pause','length','find','create','body','user','role','ChatWebsites','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','download','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','ChatApplication','Applications','account','applications','Contacts','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','contact','messageId','created','autoclose','push','close','*,*,*,*','ChatMessage','UserId','User','unshift','agent','forcedOwnership','Start','startRouting','EventManager','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','mapValues','Chat','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','hasOwnProperty','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s','interval','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','virtual','increment','chatLicenseExceeded','Intervals','all','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','transaction','Transaction','ISOLATION_LEVELS','findAndCountAll','priority','finally','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','ChatOfflineMessage','Attachment','Attachments'];(function(_0x4f939a,_0x5232ee){var _0xb1d4eb=function(_0x19821b){while(--_0x19821b){_0x4f939a['push'](_0x4f939a['shift']());}};_0xb1d4eb(++_0x5232ee);}(_0xdb88,0x130));var _0x8db8=function(_0x1ed406,_0x3b3184){_0x1ed406=_0x1ed406-0x0;var _0x359b38=_0xdb88[_0x1ed406];return _0x359b38;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x8db8('0x0'));var util=require(_0x8db8('0x1'));var path=require('path');var ejs=require(_0x8db8('0x2'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require(_0x8db8('0x3'));var Redis=require('ioredis');var qs=require(_0x8db8('0x4'));var logger=require(_0x8db8('0x5'))(_0x8db8('0x6'));var config=require(_0x8db8('0x7'));var db=require(_0x8db8('0x8'))['db'];config[_0x8db8('0x9')]=_[_0x8db8('0xa')](config['redis'],{'host':_0x8db8('0xb'),'port':0x18eb});var socket=require(_0x8db8('0xc'))(new Redis(config['redis']));require(_0x8db8('0xd'))[_0x8db8('0xe')](socket);var htmlToText=require(_0x8db8('0xf'));var jayson=require(_0x8db8('0x10'));var client=jayson[_0x8db8('0x11')][_0x8db8('0x12')]({'port':0x232c});var client9002=jayson[_0x8db8('0x11')]['http']({'port':0x232a});var client9003=jayson[_0x8db8('0x11')][_0x8db8('0x12')]({'port':0x232b});var client9001=jayson[_0x8db8('0x11')][_0x8db8('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x29eef4,_0x41864d,_0x5d5237,_0x49c214){return new BPromise(function(_0x38b2d4,_0x3955a3){var _0x4f1fd8=_0x49c214||client;return _0x4f1fd8[_0x8db8('0x13')](_0x29eef4,_0x5d5237)[_0x8db8('0x14')](function(_0x4e3cd0){logger[_0x8db8('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x41864d,_0x8db8('0x16'));logger['debug'](_0x8db8('0x17'),_0x41864d,'request\x20sent',JSON[_0x8db8('0x18')](_0x4e3cd0));if(_0x4e3cd0[_0x8db8('0x19')]){if(_0x4e3cd0[_0x8db8('0x19')][_0x8db8('0x1a')]===0x1f4){logger[_0x8db8('0x19')](_0x8db8('0x1b'),_0x41864d,_0x4e3cd0[_0x8db8('0x19')]['message']);return _0x3955a3(_0x4e3cd0[_0x8db8('0x19')][_0x8db8('0x1c')]);}logger[_0x8db8('0x19')](_0x8db8('0x1b'),_0x41864d,_0x4e3cd0[_0x8db8('0x19')][_0x8db8('0x1c')]);return _0x38b2d4(_0x4e3cd0[_0x8db8('0x19')][_0x8db8('0x1c')]);}else{logger[_0x8db8('0x15')](_0x8db8('0x1b'),_0x41864d,'request\x20sent');_0x38b2d4(_0x4e3cd0[_0x8db8('0x1d')][_0x8db8('0x1c')]);}})[_0x8db8('0x1e')](function(_0x4c6a46){logger[_0x8db8('0x19')](_0x8db8('0x1b'),_0x41864d,_0x4c6a46);_0x3955a3(_0x4c6a46);});});}function respondWithStatusCode(_0x512e41,_0x1707e2){_0x1707e2=_0x1707e2||0xcc;return function(_0x5f037d){if(_0x5f037d){return _0x512e41[_0x8db8('0x1f')](_0x1707e2);}return _0x512e41['status'](_0x1707e2)['end']();};}function respondWithResult(_0x3d75ac,_0x2ecc19){_0x2ecc19=_0x2ecc19||0xc8;return function(_0x46a697){if(_0x46a697){return _0x3d75ac['status'](_0x2ecc19)[_0x8db8('0x20')](_0x46a697);}};}function respondWithFilteredResult(_0x9bc78f,_0x1d51c3){return function(_0x39ecbd){if(_0x39ecbd){var _0x2d93a7=typeof _0x1d51c3[_0x8db8('0x21')]==='undefined'&&typeof _0x1d51c3[_0x8db8('0x22')]===_0x8db8('0x23');var _0x2986f2=_0x39ecbd[_0x8db8('0x24')];var _0x469bc0=_0x2d93a7?0x0:_0x1d51c3['offset'];var _0x268ff2=_0x2d93a7?_0x39ecbd[_0x8db8('0x24')]:_0x1d51c3['offset']+_0x1d51c3[_0x8db8('0x22')];var _0x5e6139;if(_0x268ff2>=_0x2986f2){_0x268ff2=_0x2986f2;_0x5e6139=0xc8;}else{_0x5e6139=0xce;}_0x9bc78f[_0x8db8('0x25')](_0x5e6139);return _0x9bc78f[_0x8db8('0x26')](_0x8db8('0x27'),_0x469bc0+'-'+_0x268ff2+'/'+_0x2986f2)[_0x8db8('0x20')](_0x39ecbd);}return null;};}function saveUpdates(_0xe638db){return function(_0x25e924){if(_0x25e924){return _0x25e924['update'](_0xe638db)[_0x8db8('0x14')](function(_0xda32ac){return _0xda32ac;});}return null;};}function removeEntity(_0x563bea){return function(_0x5c8a9c){if(_0x5c8a9c){return _0x5c8a9c[_0x8db8('0x28')]()[_0x8db8('0x14')](function(){var _0x42b332=_0x5c8a9c[_0x8db8('0x29')]({'plain':!![]});var _0x4a6398='ChatWebsites';return db[_0x8db8('0x2a')][_0x8db8('0x28')]({'where':{'type':_0x4a6398,'resourceId':_0x42b332['id']}})[_0x8db8('0x14')](function(){return _0x5c8a9c;});})[_0x8db8('0x14')](function(){_0x563bea[_0x8db8('0x25')](0xcc)[_0x8db8('0x2b')]();});}};}function handleEntityNotFound(_0x42ad17){return function(_0x2077d4){if(!_0x2077d4){_0x42ad17[_0x8db8('0x1f')](0x194);}return _0x2077d4;};}function handleError(_0x5e75b9,_0x1d1188){_0x1d1188=_0x1d1188||0x1f4;return function(_0x59596e){logger[_0x8db8('0x19')](_0x59596e[_0x8db8('0x2c')]);if(_0x59596e[_0x8db8('0x2d')]){delete _0x59596e[_0x8db8('0x2d')];}_0x5e75b9['status'](_0x1d1188)[_0x8db8('0x2e')](_0x59596e);};}exports[_0x8db8('0x2f')]=function(_0x189f54,_0x10174c){var _0x324b2d={'include':[{'model':db['Pause'],'as':_0x8db8('0x30')}]},_0x113325={},_0x4665a0={'count':0x0,'rows':[]};var _0x514d5e=_[_0x8db8('0x31')](db[_0x8db8('0x32')][_0x8db8('0x33')],function(_0xcfc482){return{'name':_0xcfc482[_0x8db8('0x34')],'type':_0xcfc482[_0x8db8('0x35')]['key']};});_0x113325[_0x8db8('0x36')]=_[_0x8db8('0x31')](_0x514d5e,_0x8db8('0x2d'));_0x113325['query']=_[_0x8db8('0x37')](_0x189f54[_0x8db8('0x38')]);_0x113325['filters']=_[_0x8db8('0x39')](_0x113325[_0x8db8('0x36')],_0x113325[_0x8db8('0x38')]);_0x324b2d[_0x8db8('0x3a')]=_[_0x8db8('0x39')](_0x113325[_0x8db8('0x36')],qs[_0x8db8('0x3b')](_0x189f54[_0x8db8('0x38')][_0x8db8('0x3b')]));_0x324b2d[_0x8db8('0x3a')]=_0x324b2d[_0x8db8('0x3a')]['length']?_0x324b2d[_0x8db8('0x3a')]:_0x113325['model'];if(!_0x189f54['query']['hasOwnProperty'](_0x8db8('0x3c'))){_0x324b2d[_0x8db8('0x22')]=qs[_0x8db8('0x22')](_0x189f54[_0x8db8('0x38')][_0x8db8('0x22')]);_0x324b2d[_0x8db8('0x21')]=qs['offset'](_0x189f54[_0x8db8('0x38')][_0x8db8('0x21')]);}_0x324b2d[_0x8db8('0x3d')]=qs[_0x8db8('0x3e')](_0x189f54['query'][_0x8db8('0x3e')]);_0x324b2d[_0x8db8('0x3f')]=qs[_0x8db8('0x40')](_[_0x8db8('0x41')](_0x189f54[_0x8db8('0x38')],_0x113325[_0x8db8('0x40')]),_0x514d5e);if(_0x189f54[_0x8db8('0x38')][_0x8db8('0x42')]){_0x324b2d[_0x8db8('0x3f')]=_[_0x8db8('0x43')](_0x324b2d[_0x8db8('0x3f')],{'$or':_[_0x8db8('0x31')](_0x514d5e,function(_0x15a051){if(_0x15a051[_0x8db8('0x35')]!==_0x8db8('0x44')){var _0x43fc1d={};_0x43fc1d[_0x15a051[_0x8db8('0x2d')]]={'$like':'%'+_0x189f54[_0x8db8('0x38')]['filter']+'%'};return _0x43fc1d;}})});}_0x324b2d=_[_0x8db8('0x43')]({},_0x324b2d,_0x189f54[_0x8db8('0x45')]);var _0x2afee9={'where':_0x324b2d[_0x8db8('0x3f')]};return db[_0x8db8('0x32')][_0x8db8('0x24')](_0x2afee9)[_0x8db8('0x14')](function(_0x3763b8){_0x4665a0[_0x8db8('0x24')]=_0x3763b8;if(_0x189f54['query'][_0x8db8('0x46')]){_0x324b2d[_0x8db8('0x47')]=[{'all':!![]}];}return db[_0x8db8('0x32')][_0x8db8('0x48')](_0x324b2d);})[_0x8db8('0x14')](function(_0x413642){_0x4665a0[_0x8db8('0x49')]=_0x413642;return _0x4665a0;})[_0x8db8('0x14')](respondWithFilteredResult(_0x10174c,_0x324b2d))[_0x8db8('0x1e')](handleError(_0x10174c,null));};exports[_0x8db8('0x4a')]=function(_0x519ce8,_0x313364){var _0x5eb8ed={'raw':![],'where':{'id':_0x519ce8[_0x8db8('0x4b')]['id']},'include':[{'model':db[_0x8db8('0x4c')],'as':_0x8db8('0x30')}]},_0x37c3b1={};_0x37c3b1[_0x8db8('0x36')]=_[_0x8db8('0x37')](db[_0x8db8('0x32')][_0x8db8('0x33')]);_0x37c3b1['query']=_[_0x8db8('0x37')](_0x519ce8[_0x8db8('0x38')]);_0x37c3b1[_0x8db8('0x40')]=_[_0x8db8('0x39')](_0x37c3b1['model'],_0x37c3b1[_0x8db8('0x38')]);_0x5eb8ed[_0x8db8('0x3a')]=_[_0x8db8('0x39')](_0x37c3b1['model'],qs[_0x8db8('0x3b')](_0x519ce8[_0x8db8('0x38')]['fields']));_0x5eb8ed['attributes']=_0x5eb8ed[_0x8db8('0x3a')][_0x8db8('0x4d')]?_0x5eb8ed[_0x8db8('0x3a')]:_0x37c3b1[_0x8db8('0x36')];if(_0x519ce8['query'][_0x8db8('0x46')]){_0x5eb8ed['include']=[{'all':!![]}];}_0x5eb8ed=_[_0x8db8('0x43')]({},_0x5eb8ed,_0x519ce8[_0x8db8('0x45')]);return db[_0x8db8('0x32')][_0x8db8('0x4e')](_0x5eb8ed)[_0x8db8('0x14')](handleEntityNotFound(_0x313364,null))['then'](respondWithResult(_0x313364,null))[_0x8db8('0x1e')](handleError(_0x313364,null));};exports['create']=function(_0x2d3385,_0x44752c){return db['ChatWebsite'][_0x8db8('0x4f')](_0x2d3385[_0x8db8('0x50')],{})['then'](function(_0x544cfb){var _0x3d72fb=_0x2d3385[_0x8db8('0x51')][_0x8db8('0x29')]({'plain':!![]});if(!_0x3d72fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d72fb[_0x8db8('0x52')]==='user'){var _0x125406=_0x544cfb[_0x8db8('0x29')]({'plain':!![]});var _0x23c12c=_0x8db8('0x53');return db[_0x8db8('0x54')][_0x8db8('0x4e')]({'where':{'name':_0x23c12c,'userProfileId':_0x3d72fb[_0x8db8('0x55')]},'raw':!![]})[_0x8db8('0x14')](function(_0x5c54b7){if(_0x5c54b7&&_0x5c54b7['autoAssociation']===0x0){return db[_0x8db8('0x2a')][_0x8db8('0x4f')]({'name':_0x125406[_0x8db8('0x2d')],'resourceId':_0x125406['id'],'type':_0x5c54b7[_0x8db8('0x2d')],'sectionId':_0x5c54b7['id']},{})[_0x8db8('0x14')](function(){return _0x544cfb;});}else{return _0x544cfb;}})['catch'](function(_0x131f70){logger[_0x8db8('0x19')](_0x8db8('0x56'),_0x131f70);throw _0x131f70;});}return _0x544cfb;})[_0x8db8('0x14')](respondWithResult(_0x44752c,0xc9))[_0x8db8('0x1e')](handleError(_0x44752c,null));};exports[_0x8db8('0x57')]=function(_0x3cf270,_0x15f8ef){if(_0x3cf270[_0x8db8('0x50')]['id']){delete _0x3cf270['body']['id'];}return db[_0x8db8('0x32')][_0x8db8('0x4e')]({'where':{'id':_0x3cf270[_0x8db8('0x4b')]['id']},'include':[{'model':db['Pause'],'as':_0x8db8('0x30')}]})[_0x8db8('0x14')](handleEntityNotFound(_0x15f8ef,null))[_0x8db8('0x14')](saveUpdates(_0x3cf270['body'],null))['then'](respondWithResult(_0x15f8ef,null))[_0x8db8('0x1e')](handleError(_0x15f8ef,null));};exports[_0x8db8('0x28')]=function(_0x21ef2f,_0x3d4594){return db[_0x8db8('0x32')][_0x8db8('0x4e')]({'where':{'id':_0x21ef2f[_0x8db8('0x4b')]['id']}})[_0x8db8('0x14')](handleEntityNotFound(_0x3d4594,null))['then'](removeEntity(_0x3d4594,null))['catch'](handleError(_0x3d4594,null));};exports[_0x8db8('0x58')]=function(_0x3e03bc,_0x44ca3f){return db[_0x8db8('0x32')][_0x8db8('0x58')]()['then'](respondWithResult(_0x44ca3f,null))[_0x8db8('0x1e')](handleError(_0x44ca3f,null));};exports['addDisposition']=function(_0x4ef25d,_0x29b1b3){if(_0x4ef25d[_0x8db8('0x50')]['id']){delete _0x4ef25d['body']['id'];}return db[_0x8db8('0x32')][_0x8db8('0x4e')]({'where':{'id':_0x4ef25d[_0x8db8('0x4b')]['id']}})[_0x8db8('0x14')](handleEntityNotFound(_0x29b1b3,null))[_0x8db8('0x14')](function(_0x23e296){if(_0x23e296){_0x4ef25d[_0x8db8('0x50')][_0x8db8('0x59')]=_0x23e296['id'];return db[_0x8db8('0x5a')][_0x8db8('0x4f')](_0x4ef25d[_0x8db8('0x50')]);}})[_0x8db8('0x14')](respondWithResult(_0x29b1b3,null))[_0x8db8('0x1e')](handleError(_0x29b1b3,null));};exports[_0x8db8('0x5b')]=function(_0x175bd7,_0x464832){var _0xae92ea={'raw':![],'where':{}};var _0x370dd0={};var _0x549b32={'count':0x0,'rows':[]};return db[_0x8db8('0x32')][_0x8db8('0x5c')]({'where':{'id':_0x175bd7[_0x8db8('0x4b')]['id']}})[_0x8db8('0x14')](handleEntityNotFound(_0x464832,null))[_0x8db8('0x14')](function(_0x2dbc66){if(_0x2dbc66){_0x370dd0[_0x8db8('0x36')]=_[_0x8db8('0x37')](db[_0x8db8('0x5a')][_0x8db8('0x33')]);_0x370dd0[_0x8db8('0x38')]=_[_0x8db8('0x37')](_0x175bd7[_0x8db8('0x38')]);_0x370dd0[_0x8db8('0x40')]=_[_0x8db8('0x39')](_0x370dd0[_0x8db8('0x36')],_0x370dd0[_0x8db8('0x38')]);_0xae92ea['attributes']=_[_0x8db8('0x39')](_0x370dd0[_0x8db8('0x36')],qs[_0x8db8('0x3b')](_0x175bd7['query']['fields']));_0xae92ea[_0x8db8('0x3a')]=_0xae92ea['attributes'][_0x8db8('0x4d')]?_0xae92ea[_0x8db8('0x3a')]:_0x370dd0[_0x8db8('0x36')];if(!_0x175bd7['query']['hasOwnProperty'](_0x8db8('0x3c'))){_0xae92ea['limit']=qs['limit'](_0x175bd7[_0x8db8('0x38')]['limit']);_0xae92ea[_0x8db8('0x21')]=qs[_0x8db8('0x21')](_0x175bd7['query']['offset']);}_0xae92ea[_0x8db8('0x3d')]=qs[_0x8db8('0x3e')](_0x175bd7[_0x8db8('0x38')]['sort']);_0xae92ea[_0x8db8('0x3f')]=qs[_0x8db8('0x40')](_[_0x8db8('0x41')](_0x175bd7['query'],_0x370dd0[_0x8db8('0x40')]));_0xae92ea[_0x8db8('0x3f')][_0x8db8('0x59')]=_0x2dbc66['id'];if(_0x175bd7[_0x8db8('0x38')][_0x8db8('0x42')]){_0xae92ea[_0x8db8('0x3f')]=_[_0x8db8('0x43')](_0xae92ea['where'],{'$or':_[_0x8db8('0x31')](_0xae92ea['attributes'],function(_0x506178){var _0x1294b8={};_0x1294b8[_0x506178]={'$like':'%'+_0x175bd7[_0x8db8('0x38')]['filter']+'%'};return _0x1294b8;})});}_0xae92ea=_[_0x8db8('0x43')]({},_0xae92ea,_0x175bd7[_0x8db8('0x45')]);return db[_0x8db8('0x5a')][_0x8db8('0x24')]({'where':_0xae92ea['where']})[_0x8db8('0x14')](function(_0x1aba2b){_0x549b32[_0x8db8('0x24')]=_0x1aba2b;if(_0x175bd7['query'][_0x8db8('0x46')]){_0xae92ea[_0x8db8('0x47')]=[{'all':!![]}];}return db[_0x8db8('0x5a')][_0x8db8('0x48')](_0xae92ea);})[_0x8db8('0x14')](function(_0xded30d){_0x549b32[_0x8db8('0x49')]=_0xded30d;return _0x549b32;});}})[_0x8db8('0x14')](respondWithFilteredResult(_0x464832,_0xae92ea))[_0x8db8('0x1e')](handleError(_0x464832,null));};exports[_0x8db8('0x5d')]=function(_0x5adf0b,_0x2c9ff3){return db[_0x8db8('0x32')][_0x8db8('0x4e')]({'where':{'id':_0x5adf0b['params']['id']}})['then'](handleEntityNotFound(_0x2c9ff3,null))[_0x8db8('0x14')](function(_0x315035){if(_0x315035){return _0x315035[_0x8db8('0x5d')](_0x5adf0b['query'][_0x8db8('0x5e')]);}})[_0x8db8('0x14')](respondWithStatusCode(_0x2c9ff3,null))['catch'](handleError(_0x2c9ff3,null));};exports[_0x8db8('0x5f')]=function(_0x27f240,_0x2bfe7e){if(_0x27f240[_0x8db8('0x50')]['id']){delete _0x27f240['body']['id'];}return db['ChatWebsite'][_0x8db8('0x4e')]({'where':{'id':_0x27f240['params']['id']}})[_0x8db8('0x14')](handleEntityNotFound(_0x2bfe7e,null))[_0x8db8('0x14')](function(_0x2df008){if(_0x2df008){_0x27f240['body'][_0x8db8('0x59')]=_0x2df008['id'];return db[_0x8db8('0x60')][_0x8db8('0x4f')](_0x27f240['body']);}})['then'](respondWithResult(_0x2bfe7e,null))['catch'](handleError(_0x2bfe7e,null));};exports['getAnswers']=function(_0x46c532,_0x35550e){var _0x371d0e={'raw':![],'where':{}};var _0x1ef44f={};var _0x5ec660={'count':0x0,'rows':[]};return db[_0x8db8('0x32')][_0x8db8('0x5c')]({'where':{'id':_0x46c532[_0x8db8('0x4b')]['id']}})[_0x8db8('0x14')](handleEntityNotFound(_0x35550e,null))['then'](function(_0x420109){if(_0x420109){_0x1ef44f[_0x8db8('0x36')]=_[_0x8db8('0x37')](db[_0x8db8('0x60')][_0x8db8('0x33')]);_0x1ef44f[_0x8db8('0x38')]=_[_0x8db8('0x37')](_0x46c532[_0x8db8('0x38')]);_0x1ef44f[_0x8db8('0x40')]=_[_0x8db8('0x39')](_0x1ef44f[_0x8db8('0x36')],_0x1ef44f[_0x8db8('0x38')]);_0x371d0e[_0x8db8('0x3a')]=_['intersection'](_0x1ef44f['model'],qs[_0x8db8('0x3b')](_0x46c532[_0x8db8('0x38')][_0x8db8('0x3b')]));_0x371d0e['attributes']=_0x371d0e[_0x8db8('0x3a')][_0x8db8('0x4d')]?_0x371d0e[_0x8db8('0x3a')]:_0x1ef44f[_0x8db8('0x36')];if(!_0x46c532[_0x8db8('0x38')]['hasOwnProperty']('nolimit')){_0x371d0e['limit']=qs['limit'](_0x46c532[_0x8db8('0x38')][_0x8db8('0x22')]);_0x371d0e[_0x8db8('0x21')]=qs['offset'](_0x46c532[_0x8db8('0x38')][_0x8db8('0x21')]);}_0x371d0e['order']=qs[_0x8db8('0x3e')](_0x46c532[_0x8db8('0x38')][_0x8db8('0x3e')]);_0x371d0e[_0x8db8('0x3f')]=qs['filters'](_['pick'](_0x46c532[_0x8db8('0x38')],_0x1ef44f[_0x8db8('0x40')]));_0x371d0e[_0x8db8('0x3f')][_0x8db8('0x59')]=_0x420109['id'];if(_0x46c532[_0x8db8('0x38')][_0x8db8('0x42')]){_0x371d0e[_0x8db8('0x3f')]=_[_0x8db8('0x43')](_0x371d0e[_0x8db8('0x3f')],{'$or':_['map'](_0x371d0e['attributes'],function(_0x142389){var _0x5a7e98={};_0x5a7e98[_0x142389]={'$like':'%'+_0x46c532[_0x8db8('0x38')][_0x8db8('0x42')]+'%'};return _0x5a7e98;})});}_0x371d0e=_['merge']({},_0x371d0e,_0x46c532[_0x8db8('0x45')]);return db[_0x8db8('0x60')]['count']({'where':_0x371d0e[_0x8db8('0x3f')]})['then'](function(_0x1a93a9){_0x5ec660[_0x8db8('0x24')]=_0x1a93a9;if(_0x46c532[_0x8db8('0x38')][_0x8db8('0x46')]){_0x371d0e['include']=[{'all':!![]}];}return db[_0x8db8('0x60')]['findAll'](_0x371d0e);})['then'](function(_0x42fcc8){_0x5ec660['rows']=_0x42fcc8;return _0x5ec660;});}})[_0x8db8('0x14')](respondWithFilteredResult(_0x35550e,_0x371d0e))['catch'](handleError(_0x35550e,null));};exports['removeAnswers']=function(_0x48201f,_0x5d0f39){return db['ChatWebsite'][_0x8db8('0x4e')]({'where':{'id':_0x48201f['params']['id']}})[_0x8db8('0x14')](handleEntityNotFound(_0x5d0f39,null))[_0x8db8('0x14')](function(_0x4e62b9){if(_0x4e62b9){return _0x4e62b9[_0x8db8('0x61')](_0x48201f[_0x8db8('0x38')]['ids']);}})[_0x8db8('0x14')](respondWithStatusCode(_0x5d0f39,null))[_0x8db8('0x1e')](handleError(_0x5d0f39,null));};exports[_0x8db8('0x62')]=function(_0x14da82,_0x519811){_0x14da82['body'][_0x8db8('0x63')]=_0x14da82[_0x8db8('0x64')]['filename'];return db[_0x8db8('0x32')][_0x8db8('0x4e')]({'where':{'id':_0x14da82[_0x8db8('0x4b')]['id']}})[_0x8db8('0x14')](handleEntityNotFound(_0x519811,null))[_0x8db8('0x14')](saveUpdates(_0x14da82['body'],null))[_0x8db8('0x14')](respondWithResult(_0x519811,null))[_0x8db8('0x1e')](handleError(_0x519811,null));};exports[_0x8db8('0x65')]=function(_0x506dad,_0x50c458){_0x506dad[_0x8db8('0x50')][_0x8db8('0x66')]=_0x506dad[_0x8db8('0x64')][_0x8db8('0x67')];return db[_0x8db8('0x32')][_0x8db8('0x4e')]({'where':{'id':_0x506dad[_0x8db8('0x4b')]['id']}})[_0x8db8('0x14')](handleEntityNotFound(_0x50c458,null))[_0x8db8('0x14')](saveUpdates(_0x506dad[_0x8db8('0x50')],null))['then'](respondWithResult(_0x50c458,null))['catch'](handleError(_0x50c458,null));};exports[_0x8db8('0x68')]=function(_0x3ac1dd,_0x24390a){_0x3ac1dd[_0x8db8('0x50')][_0x8db8('0x69')]=_0x3ac1dd[_0x8db8('0x64')][_0x8db8('0x67')];return db[_0x8db8('0x32')][_0x8db8('0x4e')]({'where':{'id':_0x3ac1dd[_0x8db8('0x4b')]['id']}})[_0x8db8('0x14')](handleEntityNotFound(_0x24390a,null))[_0x8db8('0x14')](saveUpdates(_0x3ac1dd[_0x8db8('0x50')],null))['then'](respondWithResult(_0x24390a,null))['catch'](handleError(_0x24390a,null));};exports[_0x8db8('0x6a')]=function(_0x2cd93f,_0x269e9d){_0x2cd93f[_0x8db8('0x50')][_0x8db8('0x6b')]=_0x2cd93f[_0x8db8('0x64')][_0x8db8('0x67')];return db[_0x8db8('0x32')][_0x8db8('0x4e')]({'where':{'id':_0x2cd93f['params']['id']}})[_0x8db8('0x14')](handleEntityNotFound(_0x269e9d,null))['then'](saveUpdates(_0x2cd93f[_0x8db8('0x50')],null))[_0x8db8('0x14')](respondWithResult(_0x269e9d,null))['catch'](handleError(_0x269e9d,null));};exports[_0x8db8('0x6c')]=function(_0xd28cff,_0x1bb106){var _0x3f42dc=path[_0x8db8('0x6d')](config[_0x8db8('0x6e')],_0x8db8('0x6f'));var _0x18ac1c={'where':{'id':_0xd28cff[_0x8db8('0x4b')]['id']},'attributes':['id',_0x8db8('0x63')],'raw':!![]};var _0x1f821d=![];return require(_0x8db8('0x70'))[_0x8db8('0x71')]()[_0x8db8('0x14')](function(_0x1af405){if(_0x1af405){_0x1f821d=_0x1af405[_0x8db8('0x72')];}})[_0x8db8('0x14')](function(){return db['ChatWebsite']['find'](_0x18ac1c);})[_0x8db8('0x14')](handleEntityNotFound(_0x1bb106,null))[_0x8db8('0x14')](function(_0x1df612){if(_0x1df612){if(!_[_0x8db8('0x73')](_0x1df612[_0x8db8('0x63')])){if(fs[_0x8db8('0x74')](path[_0x8db8('0x6d')](config[_0x8db8('0x6e')],'server/files/images/logos/',_0x1df612[_0x8db8('0x63')]))&&_0x1f821d){_0x3f42dc=path[_0x8db8('0x6d')](config[_0x8db8('0x6e')],'server/files/images/logos/',_0x1df612[_0x8db8('0x63')]);}}return _0x1bb106['download'](_0x3f42dc);}})[_0x8db8('0x1e')](handleError(_0x1bb106,null));};exports[_0x8db8('0x75')]=function(_0x29426d,_0xa79c03){var _0x2469d8=path[_0x8db8('0x6d')](config[_0x8db8('0x6e')],_0x8db8('0x76'));var _0x9a138a={'where':{'id':_0x29426d[_0x8db8('0x4b')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite'][_0x8db8('0x4e')](_0x9a138a)[_0x8db8('0x14')](handleEntityNotFound(_0xa79c03,null))['then'](function(_0x3dca51){if(_0x3dca51){if(!_[_0x8db8('0x73')](_0x3dca51['agentAvatar'])){if(fs[_0x8db8('0x74')](path['join'](config[_0x8db8('0x6e')],_0x8db8('0x77'),_0x3dca51[_0x8db8('0x66')]))){_0x2469d8=path[_0x8db8('0x6d')](config[_0x8db8('0x6e')],_0x8db8('0x77'),_0x3dca51[_0x8db8('0x66')]);}}return _0xa79c03['download'](_0x2469d8);}})[_0x8db8('0x1e')](handleError(_0xa79c03,null));};exports[_0x8db8('0x78')]=function(_0x1407a2,_0x56de8d){var _0x15478e=path[_0x8db8('0x6d')](config['root'],_0x8db8('0x79'));var _0x2efd4d={'where':{'id':_0x1407a2[_0x8db8('0x4b')]['id']},'attributes':['id',_0x8db8('0x69'),_0x8db8('0x7a')],'raw':!![]};return db[_0x8db8('0x32')][_0x8db8('0x4e')](_0x2efd4d)[_0x8db8('0x14')](handleEntityNotFound(_0x56de8d,null))[_0x8db8('0x14')](function(_0x3b6b92){if(_0x3b6b92){if(!_['isNil'](_0x3b6b92[_0x8db8('0x69')])){if(fs[_0x8db8('0x74')](path['join'](config['root'],_0x8db8('0x77'),_0x3b6b92['customerAvatar']))&&_0x3b6b92['showCustomerAvatar']){_0x15478e=path[_0x8db8('0x6d')](config[_0x8db8('0x6e')],_0x8db8('0x77'),_0x3b6b92[_0x8db8('0x69')]);}}return _0x56de8d[_0x8db8('0x7b')](_0x15478e);}})[_0x8db8('0x1e')](handleError(_0x56de8d,null));};exports['getSystemAvatar']=function(_0x58da71,_0xc78157){var _0x9e0c74=path[_0x8db8('0x6d')](config[_0x8db8('0x6e')],_0x8db8('0x7c'));var _0x1b5745={'where':{'id':_0x58da71[_0x8db8('0x4b')]['id']},'attributes':['id',_0x8db8('0x6b')],'raw':!![]};return db[_0x8db8('0x32')][_0x8db8('0x4e')](_0x1b5745)['then'](handleEntityNotFound(_0xc78157,null))[_0x8db8('0x14')](function(_0x4071e6){if(_0x4071e6){if(!_['isNil'](_0x4071e6[_0x8db8('0x6b')])){if(fs['existsSync'](path[_0x8db8('0x6d')](config[_0x8db8('0x6e')],'server/files/images/avatars/',_0x4071e6[_0x8db8('0x6b')]))){_0x9e0c74=path[_0x8db8('0x6d')](config[_0x8db8('0x6e')],_0x8db8('0x77'),_0x4071e6[_0x8db8('0x6b')]);}}return _0xc78157[_0x8db8('0x7b')](_0x9e0c74);}})[_0x8db8('0x1e')](handleError(_0xc78157,null));};exports[_0x8db8('0x7d')]=function(_0x187cdf,_0x52ed84){var _0x435e02=require(_0x8db8('0x7e'));var _0xa3af08=new _0x435e02();var _0x37afac=_0xa3af08[_0x8db8('0x7f')](_0x187cdf[_0x8db8('0x80')][_0x8db8('0x81')])[_0x8db8('0x82')]();var _0x3af4ad={'body':_0x187cdf[_0x8db8('0x50')],'channel':_0x8db8('0x83')};var _0x31ff7b=[];var _0x1a9583=[];var _0x43f087={};var _0x38897b=![];return db[_0x8db8('0x84')][_0x8db8('0x58')]()[_0x8db8('0x14')](function(_0x1f3db0){if(!_0x1f3db0){throw new db[(_0x8db8('0x85'))][(_0x8db8('0x86'))](_0x8db8('0x87'));}_0x31ff7b=_[_0x8db8('0x88')](_[_0x8db8('0x37')](_0x1f3db0),[_0x8db8('0x89'),_0x8db8('0x8a')]);_0x1a9583=_[_0x8db8('0x88')](_[_0x8db8('0x37')](_0x1f3db0),[_0x8db8('0x89'),_0x8db8('0x8a'),_0x8db8('0x8b'),_0x8db8('0x8c')]);if(_0x187cdf[_0x8db8('0x50')]['id']){delete _0x187cdf['body']['id'];}if(_[_0x8db8('0x73')](_0x187cdf['body'][_0x8db8('0x8d')])){throw new db[(_0x8db8('0x85'))][(_0x8db8('0x86'))](_0x8db8('0x8e'));}if(_[_0x8db8('0x73')](_0x187cdf[_0x8db8('0x50')][_0x8db8('0x50')])||_0x187cdf[_0x8db8('0x50')][_0x8db8('0x50')]===''){throw new db[(_0x8db8('0x85'))]['ValidationError'](_0x8db8('0x8f'));}if(_[_0x8db8('0x73')](_0x187cdf[_0x8db8('0x50')]['mapKey'])){throw new db[(_0x8db8('0x85'))][(_0x8db8('0x86'))](_0x8db8('0x90')+_0x1a9583);}if(!_[_0x8db8('0x91')](_0x1a9583,_0x187cdf['body'][_0x8db8('0x92')])){throw new db['Sequelize'][(_0x8db8('0x86'))](_0x8db8('0x93')+_0x1a9583);}_0x43f087[_0x187cdf[_0x8db8('0x50')][_0x8db8('0x92')]]=_0x187cdf[_0x8db8('0x50')][_0x8db8('0x8d')];})[_0x8db8('0x14')](function(){return db[_0x8db8('0x32')]['find']({'where':{'id':_0x187cdf['params']['id']},'include':[{'model':db[_0x8db8('0x94')],'as':_0x8db8('0x95'),'include':[{'model':db[_0x8db8('0x84')],'as':'Contacts','where':_0x43f087,'limit':0x1,'order':[[_0x8db8('0x8a'),_0x8db8('0x96')]]}]},{'model':db[_0x8db8('0x97')],'as':_0x8db8('0x98')}]});})[_0x8db8('0x14')](handleEntityNotFound(_0x52ed84,null))[_0x8db8('0x14')](function(_0x313863){if(_0x313863&&_0x313863[_0x8db8('0x95')]){_0x3af4ad[_0x8db8('0x99')]=_0x313863;_0x3af4ad[_0x8db8('0x9a')]=_0x313863[_0x8db8('0x98')];_0x3af4ad['list']=_0x313863[_0x8db8('0x95')];_0x3af4ad[_0x8db8('0x9a')]=_['orderBy'](_0x3af4ad[_0x8db8('0x9a')],['priority'],['asc']);if(_0x3af4ad['account']['Applications']){delete _0x3af4ad['account'][_0x8db8('0x98')];}if(_0x3af4ad['account'][_0x8db8('0x95')]&&_0x3af4ad[_0x8db8('0x99')][_0x8db8('0x95')][_0x8db8('0x9b')][_0x8db8('0x4d')]){return _0x3af4ad['account'][_0x8db8('0x95')][_0x8db8('0x9b')][0x0];}var _0x59cc10=_[_0x8db8('0xa')](_0x187cdf['body'],{'firstName':_0x187cdf[_0x8db8('0x50')][_0x8db8('0x8d')],'ListId':_0x313863['ListId']});_0x59cc10[_0x187cdf[_0x8db8('0x50')][_0x8db8('0x92')]]=_0x187cdf['body']['from'];return db[_0x8db8('0x84')][_0x8db8('0x4f')](_0x59cc10,{'fields':_0x31ff7b,'raw':!![]});}})[_0x8db8('0x14')](handleEntityNotFound(_0x52ed84,null))[_0x8db8('0x14')](function(_0x40a6f4){_0x3af4ad['contact']=_0x40a6f4;var _0x42b85d=_0x187cdf['body']['customerIp'];if(_0x187cdf[_0x8db8('0x80')]['cf-connecting-ip']){_0x42b85d=_0x187cdf[_0x8db8('0x80')][_0x8db8('0x9c')];}else if(_0x187cdf[_0x8db8('0x80')][_0x8db8('0x9d')]){_0x42b85d=_[_0x8db8('0x9e')](_0x187cdf['headers'][_0x8db8('0x9d')][_0x8db8('0x9f')](','));}if(_0x40a6f4){var _0x2865e9={'ContactId':_0x40a6f4['id'],'ChatWebsiteId':_0x187cdf['params']['id'],'from':(_0x40a6f4[_0x8db8('0xa0')]||'')+'\x20'+(_0x40a6f4[_0x8db8('0xa1')]||''),'customerIp':_0x42b85d,'customerPort':_0x187cdf[_0x8db8('0x80')][_0x8db8('0xa2')]?_0x187cdf[_0x8db8('0x80')]['x-real-port']:null,'referer':_0x187cdf[_0x8db8('0x50')][_0x8db8('0xa3')],'browserName':_0x37afac[_0x8db8('0xa4')]['name']&&_0x37afac[_0x8db8('0xa4')][_0x8db8('0xa5')]?util[_0x8db8('0xa6')](_0x8db8('0xa7'),_0x37afac[_0x8db8('0xa4')]['name'],_0x37afac[_0x8db8('0xa4')][_0x8db8('0xa5')]):_0x8db8('0xa8'),'browserVersion':_0x37afac['browser'][_0x8db8('0xa5')]||_0x8db8('0xa8'),'osName':util['format']('%s\x20%s',_0x37afac['os']['name'],_0x37afac['os']['version']),'osVersion':_0x37afac['os'][_0x8db8('0xa5')],'deviceModel':_0x37afac[_0x8db8('0xa9')][_0x8db8('0x36')]&&_0x37afac[_0x8db8('0xa9')][_0x8db8('0xaa')]?util[_0x8db8('0xa6')](_0x8db8('0xab'),_0x37afac[_0x8db8('0xa9')]['model'],_0x37afac[_0x8db8('0xa9')][_0x8db8('0xaa')],_0x37afac[_0x8db8('0xa9')][_0x8db8('0x35')]):null,'deviceVendor':_0x37afac[_0x8db8('0xa9')][_0x8db8('0xaa')],'deviceType':_0x37afac[_0x8db8('0xa9')]['type'],'formData':JSON['stringify'](_0x187cdf[_0x8db8('0x50')])};var _0x57eb95={'ChatWebsiteId':_0x187cdf[_0x8db8('0x4b')]['id'],'closed':![]};if(_0x187cdf['body'][_0x8db8('0xac')]){_0x57eb95[_0x8db8('0xac')]=_0x187cdf[_0x8db8('0x50')][_0x8db8('0xac')];return db[_0x8db8('0xad')]['find']({'where':_0x57eb95})[_0x8db8('0x14')](function(_0x505a6e){if(_0x505a6e){return[_0x505a6e,![]];}_0x2865e9['threadId']=_0x187cdf[_0x8db8('0x50')]['threadId'];_0x2865e9[_0x8db8('0xae')]=_0x187cdf['body'][_0x8db8('0xae')];return db['ChatInteraction'][_0x8db8('0x4f')](_0x2865e9)['then'](function(_0x270998){return[_0x270998,!![]];});});}_0x57eb95[_0x8db8('0xaf')]=_0x40a6f4['id'];if(_0x187cdf[_0x8db8('0x50')][_0x8db8('0xb0')]&&_0x187cdf[_0x8db8('0x50')][_0x8db8('0xb0')]['id']){_0x57eb95['id']=_0x187cdf[_0x8db8('0x50')]['interaction']['id'];return db['ChatInteraction']['find']({'where':_0x57eb95})['then'](function(_0x5e3deb){if(_0x5e3deb){return[_0x5e3deb,![]];}return db[_0x8db8('0xad')][_0x8db8('0x4f')](_0x2865e9)[_0x8db8('0x14')](function(_0x595711){return[_0x595711,!![]];});});}return db[_0x8db8('0xad')][_0x8db8('0x4f')](_0x2865e9)['then'](function(_0x13639a){return[_0x13639a,!![]];});}})['spread'](function(_0x4e2799,_0x27b729){if(_0x4e2799){_0x38897b=_0x27b729;if(!_0x27b729){var _0x4b2028={'from':(_0x3af4ad[_0x8db8('0xb1')]['firstName']||'')+'\x20'+(_0x3af4ad[_0x8db8('0xb1')][_0x8db8('0xa1')]||'')};if(_0x187cdf['body']['threadId']&&_0x187cdf[_0x8db8('0x50')][_0x8db8('0xb2')]&&_0x187cdf[_0x8db8('0x50')][_0x8db8('0xac')]!=_0x187cdf[_0x8db8('0x50')][_0x8db8('0xb2')]){_0x4b2028[_0x8db8('0xac')]=_0x187cdf['body'][_0x8db8('0xb2')];}return _0x4e2799['update'](_0x4b2028);}else{return _0x4e2799;}}})[_0x8db8('0x14')](function(_0xa89d7c){_0x3af4ad[_0x8db8('0xb0')]=_0xa89d7c['get']({'plain':!![]});_0x3af4ad['interaction'][_0x8db8('0xb3')]=_0x38897b;if(_0x3af4ad[_0x8db8('0xb0')][_0x8db8('0xb3')]){if(_0x3af4ad[_0x8db8('0x99')][_0x8db8('0xb4')]){_0x3af4ad[_0x8db8('0x9a')][_0x8db8('0xb5')]({'id':0x0,'priority':_0x3af4ad[_0x8db8('0x9a')][_0x8db8('0x4d')]+0x1,'app':_0x8db8('0xb6'),'appdata':'unmanaged','interval':_0x8db8('0xb7')});}}return db[_0x8db8('0xb8')][_0x8db8('0x4f')]({'body':_0x187cdf[_0x8db8('0x50')]['body'],'ChatWebsiteId':_0x187cdf[_0x8db8('0x4b')]['id'],'ChatInteractionId':_0xa89d7c['id'],'direction':'in','ContactId':_0x3af4ad[_0x8db8('0xb1')]['id'],'AttachmentId':_0x187cdf[_0x8db8('0x50')]['AttachmentId']});})[_0x8db8('0x14')](function(_0x5384e9){_0x3af4ad[_0x8db8('0x1c')]=_0x5384e9;if(_0x3af4ad[_0x8db8('0xb0')][_0x8db8('0xb9')]){return db[_0x8db8('0xba')]['find']({'attributes':['id',_0x8db8('0x2d')],'where':{'id':_0x3af4ad[_0x8db8('0xb0')][_0x8db8('0xb9')]}})[_0x8db8('0x14')](function(_0x51e810){if(_0x51e810){_0x3af4ad[_0x8db8('0x9a')][_0x8db8('0xbb')]({'id':0x0,'priority':0x0,'app':_0x8db8('0xbc'),'appdata':_0x51e810['name']+','+(_0x3af4ad[_0x8db8('0x99')]['waitForTheAssignedAgent']||0xa),'interval':_0x8db8('0xb7')});_0x3af4ad[_0x8db8('0xbd')]=!![];}return respondWithRpcPromise(_0x8db8('0xbe'),'startRouting',_0x3af4ad);});}return respondWithRpcPromise(_0x8db8('0xbe'),_0x8db8('0xbf'),_0x3af4ad);})[_0x8db8('0x14')](function(_0x1b9086){respondWithRpcPromise(_0x8db8('0xc0'),'EventManager',{'event':_0x8db8('0x7d'),'message':_0x1b9086},client9002);return _0x1b9086;})['then'](respondWithResult(_0x52ed84,null))[_0x8db8('0x1e')](handleError(_0x52ed84,null));};exports['offline']=function(_0x41a221,_0x3b2318){var _0x59909d,_0x47951f,_0x548bdf;var _0x1f1dbe=[];var _0x321daf={};var _0xe6353f=_0x41a221[_0x8db8('0xc1')]||[];var _0x7ba92c=[];var _0x64284c;return db[_0x8db8('0x84')][_0x8db8('0x58')]()[_0x8db8('0x14')](function(_0x5376bd){if(!_0x5376bd){throw new db[(_0x8db8('0x85'))][(_0x8db8('0x86'))]('no\x20available\x20attributes');}_0x1f1dbe=_[_0x8db8('0x88')](_['keys'](_0x5376bd),[_0x8db8('0x89'),'updatedAt',_0x8db8('0x8b'),_0x8db8('0x8c')]);if(_0x41a221[_0x8db8('0x50')]['id']){delete _0x41a221[_0x8db8('0x50')]['id'];}if(_[_0x8db8('0x73')](_0x41a221['body']['from'])){throw _0x3b2318['status'](0x1f4)[_0x8db8('0x2e')](new db[(_0x8db8('0x85'))]['ValidationError'](_0x8db8('0x8e')));}if(_[_0x8db8('0x73')](_0x41a221[_0x8db8('0x50')][_0x8db8('0x50')])||_0x41a221[_0x8db8('0x50')][_0x8db8('0x50')]===''){throw _0x3b2318[_0x8db8('0x25')](0x1f4)[_0x8db8('0x2e')](new db[(_0x8db8('0x85'))]['ValidationError'](_0x8db8('0x8f')));}if(_[_0x8db8('0x73')](_0x41a221[_0x8db8('0x50')][_0x8db8('0xc2')])){throw _0x3b2318[_0x8db8('0x25')](0x1f4)[_0x8db8('0x2e')](new db['Sequelize'][(_0x8db8('0x86'))](_0x8db8('0xc3')+_0x1f1dbe));}if(!_[_0x8db8('0x91')](_0x1f1dbe,_0x41a221['body'][_0x8db8('0xc2')])){throw _0x3b2318[_0x8db8('0x25')](0x1f4)['send'](new db[(_0x8db8('0x85'))][(_0x8db8('0x86'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1f1dbe));}_0x321daf[_0x41a221[_0x8db8('0x50')][_0x8db8('0xc2')]]=_0x41a221[_0x8db8('0x50')][_0x8db8('0x8d')];})[_0x8db8('0x14')](function(){return db['ChatWebsite'][_0x8db8('0x4e')]({'where':{'id':_0x41a221[_0x8db8('0x4b')]['id']},'include':[{'model':db[_0x8db8('0x94')],'as':'List'},{'model':db[_0x8db8('0xc4')],'as':_0x8db8('0xc4')}]});})['then'](handleEntityNotFound(_0x3b2318,null))[_0x8db8('0x14')](function(_0x5c8762){if(_0x5c8762&&_0x5c8762['List']){_0x47951f=_0x5c8762;var _0x89d487=_[_0x8db8('0xa')](_0x41a221[_0x8db8('0x50')],{'firstName':_0x41a221[_0x8db8('0x50')][_0x8db8('0x8d')],'phone':_0x41a221[_0x8db8('0x50')][_0x8db8('0x8d')],'ListId':_0x5c8762[_0x8db8('0x8c')]});_0x89d487[_0x41a221[_0x8db8('0x50')][_0x8db8('0xc2')]]=_0x41a221[_0x8db8('0x50')][_0x8db8('0x8d')];return db[_0x8db8('0x84')]['findOrCreate']({'where':_0x321daf,'defaults':_0x89d487});}})[_0x8db8('0xc5')](function(_0x3096b6){if(_0x3096b6){_0x548bdf=_0x3096b6;var _0x541e2f=fs[_0x8db8('0xc6')](path[_0x8db8('0x6d')](config[_0x8db8('0x6e')],_0x8db8('0xc7')),_0x8db8('0xc8'));var _0x1a1c17=ejs[_0x8db8('0xc9')](_0x541e2f,{'body':_['toPairs'](_0x41a221[_0x8db8('0x50')][_0x8db8('0x50')]),'bodyTitle':_0x47951f[_0x8db8('0xca')]});return db['ChatOfflineMessage']['create']({'body':_0x1a1c17,'plainBody':htmlToText[_0x8db8('0xcb')](_0x1a1c17),'ContactId':_0x3096b6['id'],'ChatWebsiteId':_0x47951f['id']});}})[_0x8db8('0x14')](function(_0x5b5918){_0x64284c=_0x5b5918;if(_0xe6353f[_0x8db8('0x4d')]){var _0x36433f=_0xe6353f[_0x8db8('0x31')](function(_0x2e6067){return{'name':_0x2e6067[_0x8db8('0xcc')],'basename':_0x2e6067['filename'],'type':_0x2e6067[_0x8db8('0xcd')],'ChatOfflineMessageId':_0x5b5918['id']};});_0x7ba92c=_0x36433f['map'](_0x5c1bed=>{var _0x1b23bc={'filename':_0x5c1bed[_0x8db8('0x2d')],'path':path[_0x8db8('0x6d')](config[_0x8db8('0x6e')],_0x8db8('0xce'),_0x8db8('0xc1'),_0x8db8('0xcf'),_0x8db8('0xd0'),_0x5c1bed[_0x8db8('0xd1')])};return _0x1b23bc;});if(!_0x47951f[_0x8db8('0xd2')]){return db[_0x8db8('0xd3')]['transaction'](function(_0x2287f0){return db['Attachment'][_0x8db8('0xd4')](_0x36433f,{'transaction':_0x2287f0});});}}})[_0x8db8('0x14')](function(){if(_0x64284c){_0x59909d=_0x64284c;return db[_0x8db8('0xc4')][_0x8db8('0x5c')]({'where':{'service':!![]},'include':[{'model':db[_0x8db8('0xd5')],'as':_0x8db8('0xd6'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x8db8('0xd7'),'raw':!![]}]}]});}})[_0x8db8('0x14')](function(_0x48e168){if(_0x48e168&&_0x48e168['Smtp']&&_0x47951f[_0x8db8('0xd8')]&&_0x47951f[_0x8db8('0xd9')]){var _0x32f62d=_0x48e168['getSmtpOptions']();return respondWithRpcPromise(_0x8db8('0xda'),_0x8db8('0xdb'),{'account':_0x32f62d,'message':{'from':util[_0x8db8('0xa6')](_0x8db8('0xdc'),_0x48e168[_0x8db8('0x2d')],_0x48e168[_0x8db8('0xdd')]||_0x48e168[_0x8db8('0xd6')][_0x8db8('0x51')]),'to':_0x47951f[_0x8db8('0xd9')],'subject':_0x47951f[_0x8db8('0xde')],'html':_0x59909d[_0x8db8('0x50')],'attachments':_0x7ba92c}},client9003)['then'](function(){return _0x59909d;})['catch'](function(_0xf99444){logger[_0x8db8('0x19')](_0xf99444);});}})[_0x8db8('0x14')](function(){if(_0x47951f&&_0x47951f['openNewInteraction']&&_0x47951f[_0x8db8('0xdf')]){var _0x2f622d=[];if(_0xe6353f[_0x8db8('0x4d')]){_0x2f622d=_0xe6353f[_0x8db8('0x31')](function(_0x11a952){return{'name':_0x11a952[_0x8db8('0xcc')],'basename':_0x11a952['filename'],'type':_0x11a952[_0x8db8('0xcd')],'ChatOfflineMessageId':_0x64284c['id']};});}var _0x1383f4;if(!_[_0x8db8('0x73')](_0x47951f[_0x8db8('0xe0')])){var _0x25891d=_['map'](_0x41a221[_0x8db8('0x50')],function(_0x78211){return _0x78211;});var _0x159b76=_['toPairsIn'](_0x25891d)[0x0];var _0x190d50=_[_0x8db8('0xe1')](_0x159b76,function(_0x5b8e75){return _0x5b8e75;});_0x1383f4=_0x190d50[0x1][_0x47951f[_0x8db8('0xe0')]];}var _0xd3841={'from':_0x548bdf[_0x8db8('0xdd')],'firstName':_0x548bdf[_0x8db8('0xa0')],'lastName':_0x548bdf[_0x8db8('0xa1')],'mapKey':'email','message':{'from':_0x548bdf[_0x8db8('0xdd')],'to':_0x47951f[_0x8db8('0xc4')]['email'],'cc':'','subject':_[_0x8db8('0x73')](_0x1383f4)?_0x47951f[_0x8db8('0xde')]:_0x1383f4,'messageId':'','sentAt':new Date(),'attach':_0x2f622d[_0x8db8('0x4d')],'attachments':_0x2f622d,'originChannel':_0x8db8('0xe2'),'ChatWebsiteId':_0x47951f['id'],'ChatOfflineMessageId':_0x59909d['id'],'originTo':_0x47951f[_0x8db8('0xc4')]['email']},'body':_0x59909d[_0x8db8('0x50')]};var _0x1d95b4={'account':{'id':_0x47951f[_0x8db8('0xdf')]},'body':_0xd3841,'log':_0x8db8('0xe3')};return respondWithRpcPromise('NotifyMailAccount',_0x8db8('0xe4'),_0x1d95b4,client9001)[_0x8db8('0x14')](function(){return _0x59909d;})[_0x8db8('0x1e')](function(_0x4641c9){logger[_0x8db8('0x19')](_0x4641c9);});}return;})[_0x8db8('0x14')](function(){if(_0x59909d){return _0x59909d;}})['then'](respondWithResult(_0x3b2318,null))[_0x8db8('0x1e')](function(_0x2b0d8d){logger['error']('catch',_0x2b0d8d);for(var _0x553c0f of _0xe6353f){var _0x3b06f4=path['join'](config['root'],_0x8db8('0xce'),_0x8db8('0xc1'),_0x8db8('0xcf'),_0x8db8('0xd0'),_0x553c0f[_0x8db8('0x67')]);fs_extra['remove'](_0x3b06f4)[_0x8db8('0x1e')](function(_0x4584c8){logger[_0x8db8('0x19')](_0x8db8('0xe5'),_0x3b06f4,_0x4584c8);});}});};exports[_0x8db8('0xe6')]=function(_0x49edfb,_0x59efa4){return db[_0x8db8('0xad')][_0x8db8('0x4e')]({'where':{'id':_0x49edfb['params']['id']}})['then'](handleEntityNotFound(_0x59efa4,null))[_0x8db8('0x14')](function(_0x19e4e3){if(_0x19e4e3){return _0x19e4e3['addInteraction'](_0x49edfb[_0x8db8('0x50')][_0x8db8('0x5e')],_[_0x8db8('0xe7')](_0x49edfb[_0x8db8('0x50')],[_0x8db8('0x5e'),'id'])||{});}})[_0x8db8('0x14')](respondWithResult(_0x59efa4,null))[_0x8db8('0x1e')](handleError(_0x59efa4,null));};exports[_0x8db8('0xe8')]=function(_0x7b8faf,_0x5d7f73){var _0x3a28a3={'raw':![],'where':{}};var _0x3a4fe4={};var _0x353c38={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8db8('0x5c')]({'where':{'id':_0x7b8faf[_0x8db8('0x4b')]['id']}})[_0x8db8('0x14')](handleEntityNotFound(_0x5d7f73,null))['then'](function(_0x257ca2){if(_0x257ca2){_0x3a4fe4['model']=_['keys'](db[_0x8db8('0xad')]['rawAttributes']);_0x3a4fe4[_0x8db8('0x38')]=_[_0x8db8('0x37')](_0x7b8faf['query']);_0x3a4fe4[_0x8db8('0x40')]=_[_0x8db8('0x39')](_0x3a4fe4[_0x8db8('0x36')],_0x3a4fe4[_0x8db8('0x38')]);_0x3a28a3['attributes']=_[_0x8db8('0x39')](_0x3a4fe4[_0x8db8('0x36')],qs[_0x8db8('0x3b')](_0x7b8faf[_0x8db8('0x38')][_0x8db8('0x3b')]));_0x3a28a3[_0x8db8('0x3a')]=_0x3a28a3['attributes']['length']?_0x3a28a3[_0x8db8('0x3a')]:_0x3a4fe4[_0x8db8('0x36')];if(!_0x7b8faf[_0x8db8('0x38')][_0x8db8('0xe9')](_0x8db8('0x3c'))){_0x3a28a3['limit']=qs[_0x8db8('0x22')](_0x7b8faf[_0x8db8('0x38')][_0x8db8('0x22')]);_0x3a28a3[_0x8db8('0x21')]=qs[_0x8db8('0x21')](_0x7b8faf[_0x8db8('0x38')][_0x8db8('0x21')]);}_0x3a28a3[_0x8db8('0x3d')]=qs[_0x8db8('0x3e')](_0x7b8faf[_0x8db8('0x38')][_0x8db8('0x3e')]);_0x3a28a3[_0x8db8('0x3f')]=qs[_0x8db8('0x40')](_['pick'](_0x7b8faf['query'],_0x3a4fe4[_0x8db8('0x40')]));_0x3a28a3[_0x8db8('0x3f')]['ChatWebsiteId']=_0x257ca2['id'];if(_0x7b8faf[_0x8db8('0x38')][_0x8db8('0x42')]){_0x3a28a3[_0x8db8('0x3f')]=_['merge'](_0x3a28a3[_0x8db8('0x3f')],{'$or':_[_0x8db8('0x31')](_0x3a28a3[_0x8db8('0x3a')],function(_0x3190fc){var _0x53479e={};_0x53479e[_0x3190fc]={'$like':'%'+_0x7b8faf['query']['filter']+'%'};return _0x53479e;})});}_0x3a28a3=_[_0x8db8('0x43')]({},_0x3a28a3,_0x7b8faf[_0x8db8('0x45')]);return db['ChatInteraction']['count']({'where':_0x3a28a3['where']})[_0x8db8('0x14')](function(_0x11ab22){_0x353c38[_0x8db8('0x24')]=_0x11ab22;if(_0x7b8faf[_0x8db8('0x38')]['includeAll']){_0x3a28a3[_0x8db8('0x47')]=[{'model':db['CmContact'],'as':_0x8db8('0xea'),'required':![]},{'model':db['User'],'as':_0x8db8('0xeb'),'attributes':[_0x8db8('0x2d'),_0x8db8('0xec'),_0x8db8('0xed')],'required':![]},{'model':db[_0x8db8('0xee')],'as':_0x8db8('0xef'),'attributes':['id',_0x8db8('0x2d'),_0x8db8('0xf0')],'where':_0x7b8faf[_0x8db8('0x38')][_0x8db8('0xf1')]?{'id':_0x7b8faf['query']['tag']}:undefined,'required':_0x7b8faf[_0x8db8('0x38')]['tag']?!![]:![]}];}return db[_0x8db8('0xad')][_0x8db8('0x48')](_0x3a28a3);})[_0x8db8('0x14')](function(_0x39157b){_0x353c38[_0x8db8('0x49')]=_0x39157b;return _0x353c38;});}})[_0x8db8('0x14')](respondWithFilteredResult(_0x5d7f73,_0x3a28a3))[_0x8db8('0x1e')](handleError(_0x5d7f73,null));};function iftimePromise(_0x1ebf96,_0x342964){return respondWithRpcPromise(_0x8db8('0xf2'),_0x8db8('0xf3'),{'command':_0x342964['timezone']?util[_0x8db8('0xa6')]('iftime\x20%s,%s',_0x1ebf96['interval'],_0x342964[_0x8db8('0xf4')]):util[_0x8db8('0xa6')](_0x8db8('0xf5'),_0x1ebf96[_0x8db8('0xf6')])},client9002)[_0x8db8('0x14')](function(_0x3b6533){var _0x3e02c8=_0x3b6533&&_0x3b6533[_0x8db8('0xf7')]('true')>=0x0?!![]:![];logger[_0x8db8('0x15')](_0x8db8('0xf8'),_0x342964['id'],_0x1ebf96['id'],_0x1ebf96[_0x8db8('0xf6')],_0x3e02c8?_0x8db8('0xf9'):_0x8db8('0xfa'),_0x342964[_0x8db8('0xf4')]?_0x342964[_0x8db8('0xf4')]:'No\x20timezone');return _0x3e02c8;})[_0x8db8('0x1e')](function(_0x2fe34c){logger['error']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x342964['id'],_0x1ebf96['id'],_0x1ebf96[_0x8db8('0xf6')],util['inspect'](_0x2fe34c,{'showHidden':![],'depth':null}),_0x342964[_0x8db8('0xf4')]?_0x342964[_0x8db8('0xf4')]:_0x8db8('0xfb'));return![];});}exports[_0x8db8('0xf3')]=function(_0xc1a01b,_0x21673c){var _0x1d0541=0x0;var _0x3b7219=0x0;var _0x2b037a=![];var _0x4dc9b7;var _0x957ff0;return db['ChatWebsite'][_0x8db8('0x4e')]({'where':{'id':_0xc1a01b[_0x8db8('0x4b')]['id']},'include':[{'model':db[_0x8db8('0xfc')],'as':'Interval','include':[{'model':db[_0x8db8('0xfc')],'as':'Intervals','attributes':['id',_0x8db8('0xf6')],'raw':!![]}]}]})[_0x8db8('0x14')](handleEntityNotFound(_0x21673c,null))[_0x8db8('0x14')](function(_0x337390){if(_0x337390){_0x4dc9b7=_0x337390;return _0x337390['getProactiveActions']({'raw':!![]});}})[_0x8db8('0x14')](function(_0x20df24){if(_0x4dc9b7){if(_0x20df24){_0x957ff0=_0x20df24;}}return require(_0x8db8('0x70'))['getLicense']();})[_0x8db8('0x14')](function(_0x4657b6){if(_0x4657b6){_0x3b7219=_0x4657b6[_0x8db8('0xfd')];_0x2b037a=_0x4657b6[_0x8db8('0x72')];}})['then'](function(){return db[_0x8db8('0xad')]['count']({'where':{'closed':![]}});})['then'](function(_0x10b38f){_0x1d0541=_0x10b38f;if(_0x3b7219&&_0x10b38f>_0x3b7219){return db['License']['findOne']({'where':{'id':0x1}})['then'](function(_0xd8414f){if(_0xd8414f){_0xd8414f[_0x8db8('0xfe')](_0x8db8('0xff'));}});}})[_0x8db8('0x14')](function(){if(_0x4dc9b7[_0x8db8('0xfc')]&&_0x4dc9b7[_0x8db8('0xfc')][_0x8db8('0x100')]){var _0x1d2e4a=[];for(var _0x449b88=0x0;_0x449b88<_0x4dc9b7[_0x8db8('0xfc')][_0x8db8('0x100')][_0x8db8('0x4d')];_0x449b88++){var _0x375c7e=_0x4dc9b7[_0x8db8('0xfc')][_0x8db8('0x100')][_0x449b88][_0x8db8('0x29')]({'plain':!![]});_0x1d2e4a['push'](iftimePromise(_0x375c7e,_0x4dc9b7));}return BPromise[_0x8db8('0x101')](_0x1d2e4a)[_0x8db8('0x14')](function(_0x16c09e){return _['some'](_0x16c09e);});}else{return!![];}})[_0x8db8('0x14')](function(_0x1d01aa){var _0x349c58=fs[_0x8db8('0xc6')](path[_0x8db8('0x6d')](config[_0x8db8('0x6e')],_0x8db8('0x102')),_0x8db8('0xc8'));var _0xaa7afd={'remote':_0x4dc9b7[_0x8db8('0x103')],'query':querystring[_0x8db8('0x18')](_['merge'](_0x4dc9b7[_0x8db8('0x29')]({'plain':!![]}),{'customerIp':_0xc1a01b[_0x8db8('0x80')][_0x8db8('0x9d')]||_0xc1a01b[_0x8db8('0x80')][_0x8db8('0x104')]||_0xc1a01b[_0x8db8('0x105')][_0x8db8('0x106')]||_0xc1a01b['ip'],'referer':_0xc1a01b[_0x8db8('0x80')][_0x8db8('0xa3')],'openedInteractions':_0x1d0541,'maxInteractions':_0x3b7219,'virtual':_0x2b037a[_0x8db8('0xfd')],'online':_0x1d01aa,'custom':_0x2b037a}))[_0x8db8('0x107')](/'/g,'\x5c\x27')};_0x21673c[_0x8db8('0x2e')](ejs[_0x8db8('0xc9')](Mustache[_0x8db8('0xc9')](_0x349c58,_0xaa7afd),{'proactiveActions':_0x957ff0,'alignment':_0x4dc9b7['alignment'],'verticalAlignment':_0x4dc9b7[_0x8db8('0x108')],'div_color':_0x4dc9b7[_0x8db8('0xf0')],'labelText':_0x4dc9b7[_0x8db8('0x109')],'text_color':_0x4dc9b7[_0x8db8('0x10a')],'text_button_color':_0x4dc9b7[_0x8db8('0x10b')],'button_color':_0x4dc9b7[_0x8db8('0x10c')],'background_color':_0x4dc9b7[_0x8db8('0x10d')],'hideWhenOffline':_0x4dc9b7[_0x8db8('0x10e')],'interval':_0x4dc9b7['IntervalId']}));})['catch'](handleError(_0x21673c,null));};exports['addApplications']=function(_0x3a381c,_0x4a9150){var _0x227943=_0x3a381c[_0x8db8('0x4b')]['id'];var _0x104dcc=_0x3a381c[_0x8db8('0x50')];var _0x2ca682=0xc8;var _0x563501=null;return db[_0x8db8('0xd3')][_0x8db8('0x10f')]({'isolationLevel':db['sequelize'][_0x8db8('0x110')][_0x8db8('0x111')]['READ_COMMITTED']},function(_0x278a48){return db[_0x8db8('0x32')][_0x8db8('0x5c')]({'where':{'id':_0x227943},'transaction':_0x278a48})[_0x8db8('0x14')](function(_0x295765){if(_0x295765){return db[_0x8db8('0x97')][_0x8db8('0x28')]({'where':{'ChatWebsiteId':_0x227943},'transaction':_0x278a48})[_0x8db8('0x14')](function(){var _0x5dbc33=_[_0x8db8('0x31')](_0x104dcc,function(_0x959556){_0x959556[_0x8db8('0x59')]=_0x227943;return _0x959556;});return db[_0x8db8('0x97')][_0x8db8('0xd4')](_0x5dbc33,{'transaction':_0x278a48});});}else{_0x2ca682=0x194;_0x563501=[];}});})[_0x8db8('0x14')](function(){if(_0x2ca682!==0x194){return db['ChatApplication'][_0x8db8('0x112')]({'where':{'ChatWebsiteId':_0x227943},'order':_0x8db8('0x113')})[_0x8db8('0x14')](function(_0x2835ec){_0x563501=_0x2835ec;});}})[_0x8db8('0x1e')](function(_0x1e49bc){_0x2ca682=0x1f4;logger[_0x8db8('0x19')](_0x1e49bc[_0x8db8('0x2c')]);if(_0x1e49bc[_0x8db8('0x2d')]){delete _0x1e49bc['name'];}_0x563501=_0x1e49bc;})[_0x8db8('0x114')](function(){if(_0x563501===null){_0x4a9150[_0x8db8('0x1f')](_0x2ca682);}else{if(_0x2ca682===0x1f4){_0x4a9150[_0x8db8('0x25')](_0x2ca682)[_0x8db8('0x2e')](_0x563501);}else{_0x4a9150[_0x8db8('0x25')](_0x2ca682)['json'](_0x563501);}}});};exports[_0x8db8('0x115')]=function(_0x1ddd76,_0x134aab){var _0x4ddf9c={};var _0x39decb={};var _0x2a6889;var _0x168597;return db[_0x8db8('0x32')][_0x8db8('0x5c')]({'where':{'id':_0x1ddd76[_0x8db8('0x4b')]['id']}})[_0x8db8('0x14')](handleEntityNotFound(_0x134aab,null))[_0x8db8('0x14')](function(_0x1a433e){if(_0x1a433e){_0x2a6889=_0x1a433e;_0x39decb[_0x8db8('0x36')]=_['keys'](db[_0x8db8('0x97')][_0x8db8('0x33')]);_0x39decb[_0x8db8('0x38')]=_[_0x8db8('0x37')](_0x1ddd76[_0x8db8('0x38')]);_0x39decb[_0x8db8('0x40')]=_[_0x8db8('0x39')](_0x39decb[_0x8db8('0x36')],_0x39decb[_0x8db8('0x38')]);_0x4ddf9c['attributes']=_[_0x8db8('0x39')](_0x39decb['model'],qs[_0x8db8('0x3b')](_0x1ddd76[_0x8db8('0x38')][_0x8db8('0x3b')]));_0x4ddf9c[_0x8db8('0x3a')]=_0x4ddf9c[_0x8db8('0x3a')]['length']?_0x4ddf9c[_0x8db8('0x3a')]:_0x39decb[_0x8db8('0x36')];_0x4ddf9c[_0x8db8('0x3d')]=qs[_0x8db8('0x3e')](_0x1ddd76[_0x8db8('0x38')][_0x8db8('0x3e')]);_0x4ddf9c[_0x8db8('0x3f')]=qs[_0x8db8('0x40')](_[_0x8db8('0x41')](_0x1ddd76[_0x8db8('0x38')],_0x39decb[_0x8db8('0x40')]));if(_0x1ddd76['query'][_0x8db8('0x42')]){_0x4ddf9c[_0x8db8('0x3f')]=_[_0x8db8('0x43')](_0x4ddf9c['where'],{'$or':_[_0x8db8('0x31')](_0x4ddf9c['attributes'],function(_0x31ce77){var _0x1cbc49={};_0x1cbc49[_0x31ce77]={'$like':'%'+_0x1ddd76['query'][_0x8db8('0x42')]+'%'};return _0x1cbc49;})});}_0x4ddf9c=_[_0x8db8('0x43')]({},_0x4ddf9c,_0x1ddd76[_0x8db8('0x45')]);return _0x2a6889[_0x8db8('0x115')](_0x4ddf9c);}})[_0x8db8('0x14')](function(_0x47d434){if(_0x47d434){_0x168597=_0x47d434['length'];if(!_0x1ddd76[_0x8db8('0x38')]['hasOwnProperty'](_0x8db8('0x3c'))){_0x4ddf9c[_0x8db8('0x22')]=qs[_0x8db8('0x22')](_0x1ddd76[_0x8db8('0x38')]['limit']);_0x4ddf9c['offset']=qs[_0x8db8('0x21')](_0x1ddd76[_0x8db8('0x38')]['offset']);}return _0x2a6889[_0x8db8('0x115')](_0x4ddf9c);}})[_0x8db8('0x14')](function(_0x5a60a6){if(_0x5a60a6){return _0x5a60a6?{'count':_0x168597,'rows':_0x5a60a6}:null;}})['then'](respondWithResult(_0x134aab,null))['catch'](handleError(_0x134aab,null));};exports[_0x8db8('0x116')]=function(_0x16fe20,_0x1663aa){return db[_0x8db8('0x117')]['find']({'where':{'id':_0x16fe20[_0x8db8('0x4b')]['id']}})[_0x8db8('0x14')](handleEntityNotFound(_0x1663aa,null))[_0x8db8('0x14')](function(_0x377372){if(_0x377372){return _0x377372['addProactiveActions'](_0x16fe20[_0x8db8('0x50')][_0x8db8('0x5e')],_[_0x8db8('0xe7')](_0x16fe20['body'],[_0x8db8('0x5e'),'id'])||{});}})[_0x8db8('0x14')](respondWithResult(_0x1663aa,null))[_0x8db8('0x1e')](handleError(_0x1663aa,null));};exports[_0x8db8('0x118')]=function(_0x51f472,_0x4ee428){var _0x5b1b65={};var _0x430f8c={};var _0x354109;var _0x347699;return db[_0x8db8('0x32')][_0x8db8('0x5c')]({'where':{'id':_0x51f472[_0x8db8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4ee428,null))[_0x8db8('0x14')](function(_0x19b98e){if(_0x19b98e){_0x354109=_0x19b98e;_0x430f8c[_0x8db8('0x36')]=_[_0x8db8('0x37')](db[_0x8db8('0x119')][_0x8db8('0x33')]);_0x430f8c['query']=_[_0x8db8('0x37')](_0x51f472[_0x8db8('0x38')]);_0x430f8c[_0x8db8('0x40')]=_[_0x8db8('0x39')](_0x430f8c['model'],_0x430f8c[_0x8db8('0x38')]);_0x5b1b65['attributes']=_[_0x8db8('0x39')](_0x430f8c[_0x8db8('0x36')],qs[_0x8db8('0x3b')](_0x51f472[_0x8db8('0x38')][_0x8db8('0x3b')]));_0x5b1b65[_0x8db8('0x3a')]=_0x5b1b65[_0x8db8('0x3a')][_0x8db8('0x4d')]?_0x5b1b65[_0x8db8('0x3a')]:_0x430f8c[_0x8db8('0x36')];_0x5b1b65[_0x8db8('0x3d')]=qs['sort'](_0x51f472[_0x8db8('0x38')][_0x8db8('0x3e')]);_0x5b1b65[_0x8db8('0x3f')]=qs[_0x8db8('0x40')](_['pick'](_0x51f472['query'],_0x430f8c[_0x8db8('0x40')]));if(_0x51f472[_0x8db8('0x38')][_0x8db8('0x42')]){_0x5b1b65[_0x8db8('0x3f')]=_[_0x8db8('0x43')](_0x5b1b65[_0x8db8('0x3f')],{'$or':_[_0x8db8('0x31')](_0x5b1b65[_0x8db8('0x3a')],function(_0x5e5882){var _0x3af31e={};_0x3af31e[_0x5e5882]={'$like':'%'+_0x51f472[_0x8db8('0x38')][_0x8db8('0x42')]+'%'};return _0x3af31e;})});}_0x5b1b65=_[_0x8db8('0x43')]({},_0x5b1b65,_0x51f472['options']);return _0x354109[_0x8db8('0x118')](_0x5b1b65);}})[_0x8db8('0x14')](function(_0x534075){if(_0x534075){_0x347699=_0x534075[_0x8db8('0x4d')];if(!_0x51f472[_0x8db8('0x38')][_0x8db8('0xe9')](_0x8db8('0x3c'))){_0x5b1b65[_0x8db8('0x22')]=qs[_0x8db8('0x22')](_0x51f472['query'][_0x8db8('0x22')]);_0x5b1b65[_0x8db8('0x21')]=qs[_0x8db8('0x21')](_0x51f472['query'][_0x8db8('0x21')]);}return _0x354109[_0x8db8('0x118')](_0x5b1b65);}})['then'](function(_0x35826f){if(_0x35826f){return _0x35826f?{'count':_0x347699,'rows':_0x35826f}:null;}})[_0x8db8('0x14')](respondWithResult(_0x4ee428,null))[_0x8db8('0x1e')](handleError(_0x4ee428,null));};exports[_0x8db8('0x11a')]=function(_0x18d38a,_0x169f36){var _0x4a6a85=_0x18d38a['query'][_0x8db8('0x11b')]===_0x8db8('0x11c')?_0x8db8('0x11d'):_0x8db8('0x11e');return db[_0x8db8('0x32')][_0x8db8('0x4e')]({'attributes':['id',_0x4a6a85],'where':{'id':_0x18d38a[_0x8db8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x169f36,null))[_0x8db8('0x14')](function(_0x4d1be4){if(_0x4d1be4){var _0x4534ef=_0x4d1be4[_0x4a6a85];var _0xbe8a6f=_0x4534ef&&_0x4534ef[_0x8db8('0x11f')]?_0x4534ef[_0x8db8('0x11f')]:[];_0x169f36[_0x8db8('0x2e')]({'fromKey':_['isNil'](_0x4534ef['fromKey'])?undefined:_0x4534ef[_0x8db8('0x120')],'count':_0xbe8a6f[_0x8db8('0x4d')],'rows':_0xbe8a6f});}})[_0x8db8('0x1e')](handleError(_0x169f36,null));};exports['getOfflineMessages']=function(_0x508c4f,_0x11f331){var _0x47c644={'raw':![],'where':{}};var _0x545b0c={};var _0x54d127={'count':0x0,'rows':[]};return db[_0x8db8('0x32')][_0x8db8('0x5c')]({'where':{'id':_0x508c4f[_0x8db8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x11f331,null))[_0x8db8('0x14')](function(_0x4c88e7){if(_0x4c88e7){_0x545b0c[_0x8db8('0x36')]=_[_0x8db8('0x37')](db[_0x8db8('0x121')][_0x8db8('0x33')]);_0x545b0c['query']=_[_0x8db8('0x37')](_0x508c4f[_0x8db8('0x38')]);_0x545b0c['filters']=_[_0x8db8('0x39')](_0x545b0c[_0x8db8('0x36')],_0x545b0c[_0x8db8('0x38')]);_0x47c644[_0x8db8('0x3a')]=_['intersection'](_0x545b0c[_0x8db8('0x36')],qs[_0x8db8('0x3b')](_0x508c4f[_0x8db8('0x38')][_0x8db8('0x3b')]));_0x47c644[_0x8db8('0x3a')]=_0x47c644[_0x8db8('0x3a')][_0x8db8('0x4d')]?_0x47c644[_0x8db8('0x3a')]:_0x545b0c['model'];if(!_0x508c4f['query'][_0x8db8('0xe9')](_0x8db8('0x3c'))){_0x47c644[_0x8db8('0x22')]=qs[_0x8db8('0x22')](_0x508c4f['query'][_0x8db8('0x22')]);_0x47c644[_0x8db8('0x21')]=qs[_0x8db8('0x21')](_0x508c4f[_0x8db8('0x38')][_0x8db8('0x21')]);}_0x47c644['order']=qs[_0x8db8('0x3e')](_0x508c4f[_0x8db8('0x38')][_0x8db8('0x3e')]);_0x47c644['where']=qs[_0x8db8('0x40')](_[_0x8db8('0x41')](_0x508c4f[_0x8db8('0x38')],_0x545b0c[_0x8db8('0x40')]));_0x47c644[_0x8db8('0x3f')][_0x8db8('0x59')]=_0x4c88e7['id'];if(_0x508c4f[_0x8db8('0x38')][_0x8db8('0x42')]){_0x47c644[_0x8db8('0x3f')]=_['merge'](_0x47c644[_0x8db8('0x3f')],{'$or':_[_0x8db8('0x31')](_0x47c644['attributes'],function(_0x4c68fe){var _0x5e7599={};_0x5e7599[_0x4c68fe]={'$like':'%'+_0x508c4f[_0x8db8('0x38')][_0x8db8('0x42')]+'%'};return _0x5e7599;})});}_0x47c644=_[_0x8db8('0x43')]({},_0x47c644,_0x508c4f[_0x8db8('0x45')]);return db[_0x8db8('0x121')][_0x8db8('0x24')]({'where':_0x47c644['where']})[_0x8db8('0x14')](function(_0x43457e){_0x54d127[_0x8db8('0x24')]=_0x43457e;if(_0x508c4f[_0x8db8('0x38')][_0x8db8('0x46')]){_0x47c644[_0x8db8('0x47')]=[{'all':!![]}];}else{_0x47c644['include']=[{'model':db[_0x8db8('0x84')],'as':'Contact','required':![]},{'model':db[_0x8db8('0x122')],'as':_0x8db8('0x123'),'required':![]}];}return db['ChatOfflineMessage'][_0x8db8('0x48')](_0x47c644);})['then'](function(_0x5f4676){_0x54d127[_0x8db8('0x49')]=_0x5f4676;return _0x54d127;});}})[_0x8db8('0x14')](respondWithFilteredResult(_0x11f331,_0x47c644))[_0x8db8('0x1e')](handleError(_0x11f331,null));};exports[_0x8db8('0x124')]=function(_0x58b511,_0x5678e5){return db['ChatWebsite'][_0x8db8('0x4e')]({'where':{'id':_0x58b511[_0x8db8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5678e5,null))[_0x8db8('0x14')](function(_0x2d8fab){if(_0x2d8fab){return _0x2d8fab[_0x8db8('0x124')](_0x58b511['body']['ids'],_[_0x8db8('0xe7')](_0x58b511[_0x8db8('0x50')],[_0x8db8('0x5e'),'id'])||{})[_0x8db8('0xc5')](function(_0x24876d){for(var _0x2f3942=0x0;_0x2f3942<_0x58b511[_0x8db8('0x50')][_0x8db8('0x5e')]['length'];_0x2f3942+=0x1){socket['emit']('userChatWebsite:save',{'UserId':Number(_0x58b511[_0x8db8('0x50')][_0x8db8('0x5e')][_0x2f3942]),'ChatWebsiteId':Number(_0x58b511['params']['id'])});}return _0x24876d;});}})[_0x8db8('0x14')](respondWithResult(_0x5678e5,null))['catch'](handleError(_0x5678e5,null));};exports[_0x8db8('0x125')]=function(_0x4d6d44,_0x2ac3cc){return db[_0x8db8('0x32')][_0x8db8('0x4e')]({'where':{'id':_0x4d6d44[_0x8db8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2ac3cc,null))[_0x8db8('0x14')](function(_0x3f287a){if(_0x3f287a){return _0x3f287a['removeAgents'](_0x4d6d44[_0x8db8('0x38')][_0x8db8('0x5e')])[_0x8db8('0x14')](function(){if(_[_0x8db8('0x126')](_0x4d6d44[_0x8db8('0x38')]['ids'])){for(var _0x3d3344=0x0;_0x3d3344<_0x4d6d44[_0x8db8('0x38')][_0x8db8('0x5e')][_0x8db8('0x4d')];_0x3d3344+=0x1){socket[_0x8db8('0x127')](_0x8db8('0x128'),{'UserId':Number(_0x4d6d44[_0x8db8('0x38')][_0x8db8('0x5e')][_0x3d3344]),'ChatWebsiteId':Number(_0x4d6d44[_0x8db8('0x4b')]['id'])});}}else{socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x4d6d44[_0x8db8('0x38')][_0x8db8('0x5e')]),'ChatWebsiteId':Number(_0x4d6d44[_0x8db8('0x4b')]['id'])});}});}})[_0x8db8('0x14')](respondWithStatusCode(_0x2ac3cc,null))[_0x8db8('0x1e')](handleError(_0x2ac3cc,null));};exports[_0x8db8('0x129')]=function(_0x1ecc90,_0x3285a6){var _0x35edad={};var _0x36fb2f={};var _0x4bd2a4;var _0x1cc223;return db['ChatWebsite'][_0x8db8('0x5c')]({'where':{'id':_0x1ecc90[_0x8db8('0x4b')]['id']}})[_0x8db8('0x14')](handleEntityNotFound(_0x3285a6,null))['then'](function(_0x3ac84d){if(_0x3ac84d){_0x4bd2a4=_0x3ac84d;_0x36fb2f[_0x8db8('0x36')]=_[_0x8db8('0x37')](db[_0x8db8('0xba')][_0x8db8('0x33')]);_0x36fb2f[_0x8db8('0x38')]=_[_0x8db8('0x37')](_0x1ecc90[_0x8db8('0x38')]);_0x36fb2f[_0x8db8('0x40')]=_['intersection'](_0x36fb2f[_0x8db8('0x36')],_0x36fb2f[_0x8db8('0x38')]);_0x35edad[_0x8db8('0x3a')]=_['intersection'](_0x36fb2f[_0x8db8('0x36')],qs[_0x8db8('0x3b')](_0x1ecc90[_0x8db8('0x38')][_0x8db8('0x3b')]));_0x35edad[_0x8db8('0x3a')]=_0x35edad[_0x8db8('0x3a')][_0x8db8('0x4d')]?_0x35edad[_0x8db8('0x3a')]:_0x36fb2f[_0x8db8('0x36')];_0x35edad[_0x8db8('0x3d')]=qs[_0x8db8('0x3e')](_0x1ecc90[_0x8db8('0x38')][_0x8db8('0x3e')]);_0x35edad['where']=qs[_0x8db8('0x40')](_['pick'](_0x1ecc90[_0x8db8('0x38')],_0x36fb2f[_0x8db8('0x40')]));if(_0x1ecc90['query'][_0x8db8('0x42')]){_0x35edad[_0x8db8('0x3f')]=_[_0x8db8('0x43')](_0x35edad[_0x8db8('0x3f')],{'$or':_['map'](_0x35edad['attributes'],function(_0x3df974){var _0x1228fa={};_0x1228fa[_0x3df974]={'$like':'%'+_0x1ecc90[_0x8db8('0x38')]['filter']+'%'};return _0x1228fa;})});}_0x35edad=_[_0x8db8('0x43')]({},_0x35edad,_0x1ecc90['options']);return _0x4bd2a4[_0x8db8('0x129')](_0x35edad);}})['then'](function(_0x93ac16){if(_0x93ac16){_0x1cc223=_0x93ac16[_0x8db8('0x4d')];if(!_0x1ecc90[_0x8db8('0x38')]['hasOwnProperty'](_0x8db8('0x3c'))){_0x35edad[_0x8db8('0x22')]=qs[_0x8db8('0x22')](_0x1ecc90[_0x8db8('0x38')][_0x8db8('0x22')]);_0x35edad[_0x8db8('0x21')]=qs[_0x8db8('0x21')](_0x1ecc90['query'][_0x8db8('0x21')]);}return _0x4bd2a4[_0x8db8('0x129')](_0x35edad);}})[_0x8db8('0x14')](function(_0x175c93){if(_0x175c93){return _0x175c93?{'count':_0x1cc223,'rows':_0x175c93}:null;}})[_0x8db8('0x14')](respondWithResult(_0x3285a6,null))[_0x8db8('0x1e')](handleError(_0x3285a6,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 57a9a9e..7ba59a0 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 _0x1247=['hook','exports','events','../../mysqldb','save','update','remove','emit','hasOwnProperty'];(function(_0xe84032,_0x2708b5){var _0x4e5e25=function(_0x176ec1){while(--_0x176ec1){_0xe84032['push'](_0xe84032['shift']());}};_0x4e5e25(++_0x2708b5);}(_0x1247,0xb6));var _0x7124=function(_0x12d951,_0x249808){_0x12d951=_0x12d951-0x0;var _0x44de17=_0x1247[_0x12d951];return _0x44de17;};'use strict';var EventEmitter=require(_0x7124('0x0'));var ChatWebsite=require(_0x7124('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7124('0x2'),'afterUpdate':_0x7124('0x3'),'afterDestroy':_0x7124('0x4')};function emitEvent(_0x5ebbfa){return function(_0x3bdce3,_0x3ab32e,_0x2dd15c){ChatWebsiteEvents[_0x7124('0x5')](_0x5ebbfa+':'+_0x3bdce3['id'],_0x3bdce3);ChatWebsiteEvents[_0x7124('0x5')](_0x5ebbfa,_0x3bdce3);_0x2dd15c(null);};}for(var e in events){if(events[_0x7124('0x6')](e)){var event=events[e];ChatWebsite[_0x7124('0x7')](e,emitEvent(event));}}module[_0x7124('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0xb717=['remove','emit','hook','exports','events','ChatWebsite','save','update'];(function(_0x4429e0,_0xee6f1f){var _0x51a5b3=function(_0x16eb11){while(--_0x16eb11){_0x4429e0['push'](_0x4429e0['shift']());}};_0x51a5b3(++_0xee6f1f);}(_0xb717,0x1b4));var _0x7b71=function(_0x31cd68,_0x1d3eca){_0x31cd68=_0x31cd68-0x0;var _0x3fe922=_0xb717[_0x31cd68];return _0x3fe922;};'use strict';var EventEmitter=require(_0x7b71('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x7b71('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7b71('0x2'),'afterUpdate':_0x7b71('0x3'),'afterDestroy':_0x7b71('0x4')};function emitEvent(_0x52c5dd){return function(_0x238319,_0x2e583f,_0x455c08){ChatWebsiteEvents[_0x7b71('0x5')](_0x52c5dd+':'+_0x238319['id'],_0x238319);ChatWebsiteEvents[_0x7b71('0x5')](_0x52c5dd,_0x238319);_0x455c08(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x7b71('0x6')](e,emitEvent(event));}}module[_0x7b71('0x7')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 3053c1c..5e07d6a 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 _0xb241=['ChatWebsite','chat_websites','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./chatWebsite.attributes','exports','define'];(function(_0x3526ab,_0x347e8c){var _0x387cde=function(_0x50d23f){while(--_0x50d23f){_0x3526ab['push'](_0x3526ab['shift']());}};_0x387cde(++_0x347e8c);}(_0xb241,0x13a));var _0x1b24=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xb241[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x1b24('0x0'));var util=require(_0x1b24('0x1'));var logger=require('../../config/logger')(_0x1b24('0x2'));var moment=require(_0x1b24('0x3'));var BPromise=require(_0x1b24('0x4'));var rp=require(_0x1b24('0x5'));var fs=require('fs');var path=require(_0x1b24('0x6'));var rimraf=require(_0x1b24('0x7'));var config=require('../../config/environment');var attributes=require(_0x1b24('0x8'));module[_0x1b24('0x9')]=function(_0x5a3f7d,_0x4833e5){return _0x5a3f7d[_0x1b24('0xa')](_0x1b24('0xb'),attributes,{'tableName':_0x1b24('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x484e=['bluebird','request-promise','path','../../config/environment','./chatWebsite.attributes','exports','define','chat_websites','lodash','util','../../config/logger','api','moment'];(function(_0x310057,_0x2c2686){var _0x33f873=function(_0x2da59a){while(--_0x2da59a){_0x310057['push'](_0x310057['shift']());}};_0x33f873(++_0x2c2686);}(_0x484e,0x1b5));var _0xe484=function(_0x5c2418,_0x38cebd){_0x5c2418=_0x5c2418-0x0;var _0x3ca79d=_0x484e[_0x5c2418];return _0x3ca79d;};'use strict';var _=require(_0xe484('0x0'));var util=require(_0xe484('0x1'));var logger=require(_0xe484('0x2'))(_0xe484('0x3'));var moment=require(_0xe484('0x4'));var BPromise=require(_0xe484('0x5'));var rp=require(_0xe484('0x6'));var fs=require('fs');var path=require(_0xe484('0x7'));var rimraf=require('rimraf');var config=require(_0xe484('0x8'));var attributes=require(_0xe484('0x9'));module[_0xe484('0xa')]=function(_0x2fcc02,_0x1bc091){return _0x2fcc02[_0xe484('0xb')]('ChatWebsite',attributes,{'tableName':_0xe484('0xc'),'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 3016c25..0469beb 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 _0xfb85=['client','redis','localhost','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x3cae69,_0x233c38){var _0x3128eb=function(_0x21d64e){while(--_0x21d64e){_0x3cae69['push'](_0x3cae69['shift']());}};_0x3128eb(++_0x233c38);}(_0xfb85,0xa7));var _0x5fb8=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xfb85[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0x5fb8('0x0'));var util=require(_0x5fb8('0x1'));var moment=require(_0x5fb8('0x2'));var BPromise=require('bluebird');var rs=require(_0x5fb8('0x3'));var fs=require('fs');var Redis=require(_0x5fb8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5fb8('0x5'));var logger=require(_0x5fb8('0x6'))('rpc');var config=require(_0x5fb8('0x7'));var jayson=require(_0x5fb8('0x8'));var client=jayson[_0x5fb8('0x9')]['http']({'port':0x232a});config[_0x5fb8('0xa')]=_['defaults'](config['redis'],{'host':_0x5fb8('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5fb8('0xa')]));require(_0x5fb8('0xc'))[_0x5fb8('0xd')](socket);function respondWithRpcPromise(_0x319921,_0x1b9cfa,_0x106df0){return new BPromise(function(_0x1d2467,_0x54fbf8){return client['request'](_0x319921,_0x106df0)[_0x5fb8('0xe')](function(_0x54e4a2){logger[_0x5fb8('0xf')](_0x5fb8('0x10'),_0x1b9cfa,'request\x20sent');logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1b9cfa,_0x5fb8('0x11'),JSON[_0x5fb8('0x12')](_0x54e4a2));if(_0x54e4a2[_0x5fb8('0x13')]){if(_0x54e4a2[_0x5fb8('0x13')]['code']===0x1f4){logger[_0x5fb8('0x13')](_0x5fb8('0x10'),_0x1b9cfa,_0x54e4a2['error'][_0x5fb8('0x14')]);return _0x54fbf8(_0x54e4a2['error'][_0x5fb8('0x14')]);}logger['error'](_0x5fb8('0x10'),_0x1b9cfa,_0x54e4a2[_0x5fb8('0x13')][_0x5fb8('0x14')]);return _0x1d2467(_0x54e4a2[_0x5fb8('0x13')][_0x5fb8('0x14')]);}else{logger[_0x5fb8('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x1b9cfa,'request\x20sent');_0x1d2467(_0x54e4a2[_0x5fb8('0x15')][_0x5fb8('0x14')]);}})['catch'](function(_0x585cc5){logger['error'](_0x5fb8('0x10'),_0x1b9cfa,_0x585cc5);_0x54fbf8(_0x585cc5);});});} \ No newline at end of file +var _0x9444=['code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4c217f,_0x82a1ae){var _0x4033b2=function(_0x4752cb){while(--_0x4752cb){_0x4c217f['push'](_0x4c217f['shift']());}};_0x4033b2(++_0x82a1ae);}(_0x9444,0x70));var _0x4944=function(_0x5027b1,_0x1409a5){_0x5027b1=_0x5027b1-0x0;var _0x4a46cf=_0x9444[_0x5027b1];return _0x4a46cf;};'use strict';var _=require(_0x4944('0x0'));var util=require(_0x4944('0x1'));var moment=require('moment');var BPromise=require(_0x4944('0x2'));var rs=require(_0x4944('0x3'));var fs=require('fs');var Redis=require(_0x4944('0x4'));var db=require(_0x4944('0x5'))['db'];var utils=require(_0x4944('0x6'));var logger=require(_0x4944('0x7'))(_0x4944('0x8'));var config=require(_0x4944('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4944('0xa')][_0x4944('0xb')]({'port':0x232a});config[_0x4944('0xc')]=_[_0x4944('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4944('0xe'))(new Redis(config['redis']));require(_0x4944('0xf'))[_0x4944('0x10')](socket);function respondWithRpcPromise(_0x201298,_0x85f5bc,_0x244f57){return new BPromise(function(_0x2ccaaa,_0x25b5a2){return client[_0x4944('0x11')](_0x201298,_0x244f57)['then'](function(_0x469e1c){logger[_0x4944('0x12')](_0x4944('0x13'),_0x85f5bc,_0x4944('0x14'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x85f5bc,_0x4944('0x14'),JSON[_0x4944('0x15')](_0x469e1c));if(_0x469e1c[_0x4944('0x16')]){if(_0x469e1c[_0x4944('0x16')][_0x4944('0x17')]===0x1f4){logger[_0x4944('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x85f5bc,_0x469e1c[_0x4944('0x16')][_0x4944('0x18')]);return _0x25b5a2(_0x469e1c['error'][_0x4944('0x18')]);}logger[_0x4944('0x16')](_0x4944('0x13'),_0x85f5bc,_0x469e1c['error'][_0x4944('0x18')]);return _0x2ccaaa(_0x469e1c['error'][_0x4944('0x18')]);}else{logger[_0x4944('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x85f5bc,_0x4944('0x14'));_0x2ccaaa(_0x469e1c[_0x4944('0x19')]['message']);}})[_0x4944('0x1a')](function(_0x560a39){logger[_0x4944('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x85f5bc,_0x560a39);_0x25b5a2(_0x560a39);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 97190ee..670bd6d 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 _0x0f44=['length','chatWebsite:','save','remove','update','emit','register'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x0f44,0x16e));var _0x40f4=function(_0x3d8d54,_0x701faf){_0x3d8d54=_0x3d8d54-0x0;var _0x2233a7=_0x0f44[_0x3d8d54];return _0x2233a7;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x40f4('0x0'),_0x40f4('0x1'),_0x40f4('0x2')];function createListener(_0x216041,_0x39fc3c){return function(_0x358f45){_0x39fc3c[_0x40f4('0x3')](_0x216041,_0x358f45);};}function removeListener(_0x5731c9,_0x11204d){return function(){ChatWebsiteEvents['removeListener'](_0x5731c9,_0x11204d);};}exports[_0x40f4('0x4')]=function(_0x53503d){for(var _0x42c321=0x0,_0x357bf8=events[_0x40f4('0x5')];_0x42c321<_0x357bf8;_0x42c321++){var _0x3cf9e4=events[_0x42c321];var _0x260d41=createListener(_0x40f4('0x6')+_0x3cf9e4,_0x53503d);ChatWebsiteEvents['on'](_0x3cf9e4,_0x260d41);}}; \ No newline at end of file +var _0xad8a=['length','chatWebsite:','save','remove','update','removeListener','register'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xad8a,0x80));var _0xaad8=function(_0x154e9c,_0x397f66){_0x154e9c=_0x154e9c-0x0;var _0x31c82a=_0xad8a[_0x154e9c];return _0x31c82a;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xaad8('0x0'),_0xaad8('0x1'),_0xaad8('0x2')];function createListener(_0x4cd3cc,_0x5a4120){return function(_0x5bda9e){_0x5a4120['emit'](_0x4cd3cc,_0x5bda9e);};}function removeListener(_0x1bc9fb,_0x3a7a88){return function(){ChatWebsiteEvents[_0xaad8('0x3')](_0x1bc9fb,_0x3a7a88);};}exports[_0xaad8('0x4')]=function(_0xa34477){for(var _0x15ec21=0x0,_0x1f722e=events[_0xaad8('0x5')];_0x15ec21<_0x1f722e;_0x15ec21++){var _0x560725=events[_0x15ec21];var _0x2c3a03=createListener(_0xaad8('0x6')+_0x560725,_0xa34477);ChatWebsiteEvents['on'](_0x560725,_0x2c3a03);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 289e6f5..a43cfe4 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 _0xb155=['addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','single','file','addLogo','server/files/images/avatars/','now','addAvatar','addCustomerAvatar','addSystemAvatar','notify','server/files','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatWebsite.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getFields','getOfflineMessages','/:id/users','getAgents','post','addDisposition'];(function(_0xc7b584,_0x51038d){var _0x19245d=function(_0x4d3108){while(--_0x4d3108){_0xc7b584['push'](_0xc7b584['shift']());}};_0x19245d(++_0x51038d);}(_0xb155,0x13f));var _0x5b15=function(_0x2d2258,_0x2ce510){_0x2d2258=_0x2d2258-0x0;var _0x18e155=_0xb155[_0x2d2258];return _0x18e155;};'use strict';var multer=require(_0x5b15('0x0'));var util=require('util');var path=require(_0x5b15('0x1'));var timeout=require(_0x5b15('0x2'));var express=require(_0x5b15('0x3'));var router=express[_0x5b15('0x4')]();var fs_extra=require(_0x5b15('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5b15('0x6'));var config=require('../../config/environment');var controller=require(_0x5b15('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x5b15('0x8')]);router[_0x5b15('0x9')](_0x5b15('0xa'),auth[_0x5b15('0xb')](),controller[_0x5b15('0xc')]);router[_0x5b15('0x9')](_0x5b15('0xd'),auth[_0x5b15('0xb')](),controller[_0x5b15('0xe')]);router[_0x5b15('0x9')](_0x5b15('0xf'),auth['isAuthenticated'](),controller[_0x5b15('0x10')]);router[_0x5b15('0x9')](_0x5b15('0x11'),auth[_0x5b15('0xb')](),controller[_0x5b15('0x12')]);router[_0x5b15('0x9')](_0x5b15('0x13'),controller['getLogo']);router[_0x5b15('0x9')](_0x5b15('0x14'),controller[_0x5b15('0x15')]);router[_0x5b15('0x9')](_0x5b15('0x16'),controller[_0x5b15('0x17')]);router[_0x5b15('0x9')](_0x5b15('0x18'),controller['getSystemAvatar']);router['get'](_0x5b15('0x19'),auth[_0x5b15('0xb')](),controller['getInteractions']);router['get']('/:id/snippet',controller[_0x5b15('0x1a')]);router[_0x5b15('0x9')](_0x5b15('0x1b'),auth[_0x5b15('0xb')](),controller[_0x5b15('0x1c')]);router[_0x5b15('0x9')](_0x5b15('0x1d'),auth[_0x5b15('0xb')](),controller['getProactiveActions']);router['get']('/:id/fields',controller[_0x5b15('0x1e')]);router[_0x5b15('0x9')]('/:id/offline_messages',auth['isAuthenticated'](),controller[_0x5b15('0x1f')]);router['get'](_0x5b15('0x20'),auth[_0x5b15('0xb')](),controller[_0x5b15('0x21')]);router[_0x5b15('0x22')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5b15('0x22')](_0x5b15('0xf'),auth[_0x5b15('0xb')](),controller[_0x5b15('0x23')]);router[_0x5b15('0x22')]('/:id/canned_answers',auth[_0x5b15('0xb')](),controller[_0x5b15('0x24')]);var upload=multer({'storage':multer[_0x5b15('0x25')]({'destination':function(_0x434bb3,_0x5f055a,_0x40a16e){_0x40a16e(null,path[_0x5b15('0x26')](config[_0x5b15('0x27')],_0x5b15('0x28')));},'filename':function(_0x3767a3,_0x129a28,_0x309b68){_0x309b68(null,util[_0x5b15('0x29')](_0x5b15('0x2a'),Date['now'](),_0x129a28[_0x5b15('0x2b')]));}})});router[_0x5b15('0x22')](_0x5b15('0x13'),upload[_0x5b15('0x2c')](_0x5b15('0x2d')),controller[_0x5b15('0x2e')]);var upload=multer({'storage':multer[_0x5b15('0x25')]({'destination':function(_0x596313,_0x53d58a,_0x1f8042){_0x1f8042(null,path[_0x5b15('0x26')](config['root'],_0x5b15('0x2f')));},'filename':function(_0xe9bce9,_0x3715a8,_0x3dc4d3){_0x3dc4d3(null,util['format'](_0x5b15('0x2a'),Date[_0x5b15('0x30')](),_0x3715a8['originalname']));}})});router[_0x5b15('0x22')](_0x5b15('0x14'),upload[_0x5b15('0x2c')]('file'),controller[_0x5b15('0x31')]);var upload=multer({'storage':multer[_0x5b15('0x25')]({'destination':function(_0x242ca6,_0x79f6fb,_0x5ea38b){_0x5ea38b(null,path[_0x5b15('0x26')](config['root'],_0x5b15('0x2f')));},'filename':function(_0x36cb51,_0x8bae30,_0x59670c){_0x59670c(null,util[_0x5b15('0x29')](_0x5b15('0x2a'),Date[_0x5b15('0x30')](),_0x8bae30[_0x5b15('0x2b')]));}})});router[_0x5b15('0x22')](_0x5b15('0x16'),upload['single']('file'),controller[_0x5b15('0x32')]);var upload=multer({'storage':multer[_0x5b15('0x25')]({'destination':function(_0x24c42d,_0x2cc96d,_0x554a4c){_0x554a4c(null,path[_0x5b15('0x26')](config['root'],_0x5b15('0x2f')));},'filename':function(_0x460de3,_0x4a2d02,_0x10705f){_0x10705f(null,util[_0x5b15('0x29')](_0x5b15('0x2a'),Date['now'](),_0x4a2d02[_0x5b15('0x2b')]));}})});router[_0x5b15('0x22')]('/:id/system_avatar',upload['single'](_0x5b15('0x2d')),controller[_0x5b15('0x33')]);router[_0x5b15('0x22')]('/:id/notify',controller[_0x5b15('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0x5b15('0x25')]({'destination':function(_0x322922,_0x41cf27,_0x25539c){const _0x41f1fd=path[_0x5b15('0x26')](config[_0x5b15('0x27')],_0x5b15('0x35'),'attachments','offline-chat');fs_extra[_0x5b15('0x36')](_0x41f1fd,function(){_0x25539c(null,_0x41f1fd);});},'filename':function(_0x29f359,_0x55d1cd,_0x397dc4){const _0x2187a5=_0x55d1cd['originalname'][_0x5b15('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3043f2=path[_0x5b15('0x38')](_0x2187a5);const _0x1acbbd=Date['now']()+'-'+_0x2187a5[_0x5b15('0x37')](_0x3043f2,'')+_0x3043f2;_0x397dc4(null,_0x1acbbd);}})});router[_0x5b15('0x22')](_0x5b15('0x39'),offlineUploadMulter[_0x5b15('0x3a')](),controller[_0x5b15('0x3b')]);router[_0x5b15('0x22')](_0x5b15('0x19'),auth[_0x5b15('0xb')](),controller[_0x5b15('0x3c')]);router[_0x5b15('0x22')]('/:id/applications',auth[_0x5b15('0xb')](),controller[_0x5b15('0x3d')]);router[_0x5b15('0x22')](_0x5b15('0x1d'),auth[_0x5b15('0xb')](),controller[_0x5b15('0x3e')]);router['post'](_0x5b15('0x20'),auth[_0x5b15('0xb')](),controller[_0x5b15('0x3f')]);router[_0x5b15('0x40')](_0x5b15('0xd'),auth[_0x5b15('0xb')](),controller['update']);router[_0x5b15('0x41')]('/:id',auth['isAuthenticated'](),controller[_0x5b15('0x42')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x5b15('0x43')]);router[_0x5b15('0x41')](_0x5b15('0x11'),auth['isAuthenticated'](),controller[_0x5b15('0x44')]);router[_0x5b15('0x41')](_0x5b15('0x20'),auth['isAuthenticated'](),controller[_0x5b15('0x45')]);module[_0x5b15('0x46')]=router; \ No newline at end of file +var _0xed39=['/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getInteractions','/:id/snippet','getSnippet','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','/:id/dispositions','addDisposition','/:id/canned_answers','addAnswer','join','format','%s-%s','now','file','addLogo','diskStorage','root','server/files/images/avatars/','originalname','addAvatar','single','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','/:id/interactions','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','getDispositions','getAnswers','/:id/logo'];(function(_0x380307,_0x440ccd){var _0x9ea14b=function(_0x51024c){while(--_0x51024c){_0x380307['push'](_0x380307['shift']());}};_0x9ea14b(++_0x440ccd);}(_0xed39,0x1e8));var _0x9ed3=function(_0x334ac1,_0x4320eb){_0x334ac1=_0x334ac1-0x0;var _0x47cbaa=_0xed39[_0x334ac1];return _0x47cbaa;};'use strict';var multer=require(_0x9ed3('0x0'));var util=require(_0x9ed3('0x1'));var path=require(_0x9ed3('0x2'));var timeout=require(_0x9ed3('0x3'));var express=require(_0x9ed3('0x4'));var router=express[_0x9ed3('0x5')]();var fs_extra=require(_0x9ed3('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9ed3('0x7'));router[_0x9ed3('0x8')]('/',auth[_0x9ed3('0x9')](),controller['index']);router[_0x9ed3('0x8')](_0x9ed3('0xa'),auth['isAuthenticated'](),controller[_0x9ed3('0xb')]);router[_0x9ed3('0x8')](_0x9ed3('0xc'),auth[_0x9ed3('0x9')](),controller['show']);router['get']('/:id/dispositions',auth[_0x9ed3('0x9')](),controller[_0x9ed3('0xd')]);router[_0x9ed3('0x8')]('/:id/canned_answers',auth[_0x9ed3('0x9')](),controller[_0x9ed3('0xe')]);router[_0x9ed3('0x8')](_0x9ed3('0xf'),controller['getLogo']);router[_0x9ed3('0x8')](_0x9ed3('0x10'),controller[_0x9ed3('0x11')]);router[_0x9ed3('0x8')](_0x9ed3('0x12'),controller[_0x9ed3('0x13')]);router[_0x9ed3('0x8')]('/:id/system_avatar',controller['getSystemAvatar']);router[_0x9ed3('0x8')]('/:id/interactions',auth[_0x9ed3('0x9')](),controller[_0x9ed3('0x14')]);router[_0x9ed3('0x8')](_0x9ed3('0x15'),controller[_0x9ed3('0x16')]);router[_0x9ed3('0x8')]('/:id/applications',auth[_0x9ed3('0x9')](),controller['getApplications']);router[_0x9ed3('0x8')](_0x9ed3('0x17'),auth[_0x9ed3('0x9')](),controller[_0x9ed3('0x18')]);router[_0x9ed3('0x8')](_0x9ed3('0x19'),controller[_0x9ed3('0x1a')]);router[_0x9ed3('0x8')](_0x9ed3('0x1b'),auth[_0x9ed3('0x9')](),controller[_0x9ed3('0x1c')]);router[_0x9ed3('0x8')](_0x9ed3('0x1d'),auth[_0x9ed3('0x9')](),controller[_0x9ed3('0x1e')]);router[_0x9ed3('0x1f')]('/',auth[_0x9ed3('0x9')](),controller['create']);router[_0x9ed3('0x1f')](_0x9ed3('0x20'),auth['isAuthenticated'](),controller[_0x9ed3('0x21')]);router[_0x9ed3('0x1f')](_0x9ed3('0x22'),auth[_0x9ed3('0x9')](),controller[_0x9ed3('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x301962,_0x4dcd5b,_0x12c8f2){_0x12c8f2(null,path[_0x9ed3('0x24')](config['root'],'server/files/images/logos/'));},'filename':function(_0x2743ac,_0x14c545,_0x3bcf7e){_0x3bcf7e(null,util[_0x9ed3('0x25')](_0x9ed3('0x26'),Date[_0x9ed3('0x27')](),_0x14c545['originalname']));}})});router[_0x9ed3('0x1f')](_0x9ed3('0xf'),upload['single'](_0x9ed3('0x28')),controller[_0x9ed3('0x29')]);var upload=multer({'storage':multer[_0x9ed3('0x2a')]({'destination':function(_0xb9d50b,_0x533da2,_0x56e580){_0x56e580(null,path[_0x9ed3('0x24')](config[_0x9ed3('0x2b')],_0x9ed3('0x2c')));},'filename':function(_0xecc0be,_0x51ede8,_0x1da400){_0x1da400(null,util['format']('%s-%s',Date[_0x9ed3('0x27')](),_0x51ede8[_0x9ed3('0x2d')]));}})});router['post'](_0x9ed3('0x10'),upload['single']('file'),controller[_0x9ed3('0x2e')]);var upload=multer({'storage':multer[_0x9ed3('0x2a')]({'destination':function(_0x195648,_0xc339af,_0xc6810a){_0xc6810a(null,path[_0x9ed3('0x24')](config[_0x9ed3('0x2b')],_0x9ed3('0x2c')));},'filename':function(_0x4b1e11,_0x29a9b4,_0x2d6ad9){_0x2d6ad9(null,util[_0x9ed3('0x25')]('%s-%s',Date[_0x9ed3('0x27')](),_0x29a9b4[_0x9ed3('0x2d')]));}})});router[_0x9ed3('0x1f')](_0x9ed3('0x12'),upload[_0x9ed3('0x2f')]('file'),controller[_0x9ed3('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x47c176,_0x58bcd7,_0xcfeb24){_0xcfeb24(null,path[_0x9ed3('0x24')](config['root'],_0x9ed3('0x2c')));},'filename':function(_0xf7e8f3,_0x587a81,_0x3f44a0){_0x3f44a0(null,util[_0x9ed3('0x25')](_0x9ed3('0x26'),Date['now'](),_0x587a81[_0x9ed3('0x2d')]));}})});router[_0x9ed3('0x1f')](_0x9ed3('0x31'),upload[_0x9ed3('0x2f')](_0x9ed3('0x28')),controller[_0x9ed3('0x32')]);router[_0x9ed3('0x1f')]('/:id/notify',controller[_0x9ed3('0x33')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x27acee,_0x1a96c1,_0x384188){const _0x26b6e7=path[_0x9ed3('0x24')](config[_0x9ed3('0x2b')],_0x9ed3('0x34'),_0x9ed3('0x35'),_0x9ed3('0x36'));fs_extra[_0x9ed3('0x37')](_0x26b6e7,function(){_0x384188(null,_0x26b6e7);});},'filename':function(_0x3fe9a7,_0x1d513a,_0x28f4f3){const _0x4607f4=_0x1d513a[_0x9ed3('0x2d')][_0x9ed3('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5ac908=path[_0x9ed3('0x39')](_0x4607f4);const _0x105ad7=Date[_0x9ed3('0x27')]()+'-'+_0x4607f4['replace'](_0x5ac908,'')+_0x5ac908;_0x28f4f3(null,_0x105ad7);}})});router[_0x9ed3('0x1f')](_0x9ed3('0x3a'),offlineUploadMulter[_0x9ed3('0x3b')](),controller[_0x9ed3('0x3c')]);router['post'](_0x9ed3('0x3d'),auth[_0x9ed3('0x9')](),controller['addInteraction']);router['post']('/:id/applications',auth[_0x9ed3('0x9')](),controller['addApplications']);router[_0x9ed3('0x1f')](_0x9ed3('0x17'),auth[_0x9ed3('0x9')](),controller[_0x9ed3('0x3e')]);router[_0x9ed3('0x1f')](_0x9ed3('0x1d'),auth['isAuthenticated'](),controller[_0x9ed3('0x3f')]);router[_0x9ed3('0x40')]('/:id',auth[_0x9ed3('0x9')](),controller[_0x9ed3('0x41')]);router[_0x9ed3('0x42')](_0x9ed3('0xc'),auth[_0x9ed3('0x9')](),controller[_0x9ed3('0x43')]);router[_0x9ed3('0x42')](_0x9ed3('0x20'),auth[_0x9ed3('0x9')](),controller[_0x9ed3('0x44')]);router[_0x9ed3('0x42')](_0x9ed3('0x22'),auth[_0x9ed3('0x9')](),controller[_0x9ed3('0x45')]);router[_0x9ed3('0x42')](_0x9ed3('0x1d'),auth[_0x9ed3('0x9')](),controller[_0x9ed3('0x46')]);module[_0x9ed3('0x47')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index f8a7327..513c69e 100644 --- a/server/api/client-side-logs.js +++ b/server/api/client-side-logs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3fa2=['beaver-logger/server','express','../components/auth/service','Router','env','app','Client-Side\x20logger\x20not\x20found!','isAuthenticated','exports'];(function(_0x44d6b8,_0xe7e065){var _0x18cbfa=function(_0x1704bc){while(--_0x1704bc){_0x44d6b8['push'](_0x44d6b8['shift']());}};_0x18cbfa(++_0xe7e065);}(_0x3fa2,0xfc));var _0x23fa=function(_0xdfe86a,_0x3173e3){_0xdfe86a=_0xdfe86a-0x0;var _0x425b8d=_0x3fa2[_0xdfe86a];return _0x425b8d;};var beaverLogger=require(_0x23fa('0x0'));var express=require(_0x23fa('0x1'));var auth=require(_0x23fa('0x2'));var config=require('../config/environment');var router=express[_0x23fa('0x3')]();var isProduction=config[_0x23fa('0x4')]==='production'||![];function clientSideLogs(_0x2af051,_0x3ad01b,_0x3df390){var _0x33d712=_0x2af051[_0x23fa('0x5')]['get']('client-side-logger');if(!_0x33d712){throw new Error(_0x23fa('0x6'));}return beaverLogger['expressEndpoint']({'uri':'/client-logs','logger':_0x33d712,'enableCors':!isProduction})(_0x2af051,_0x3ad01b,_0x3df390);}router['use'](auth[_0x23fa('0x7')](),clientSideLogs);module[_0x23fa('0x8')]=router; \ No newline at end of file +var _0x2dd2=['use','isAuthenticated','exports','beaver-logger/server','express','../config/environment','env','production','app','get','expressEndpoint','/client-logs'];(function(_0x42cd9d,_0x1caab6){var _0x37583f=function(_0x17ad85){while(--_0x17ad85){_0x42cd9d['push'](_0x42cd9d['shift']());}};_0x37583f(++_0x1caab6);}(_0x2dd2,0x1b3));var _0x22dd=function(_0x173ed9,_0x364f05){_0x173ed9=_0x173ed9-0x0;var _0x57985e=_0x2dd2[_0x173ed9];return _0x57985e;};var beaverLogger=require(_0x22dd('0x0'));var express=require(_0x22dd('0x1'));var auth=require('../components/auth/service');var config=require(_0x22dd('0x2'));var router=express['Router']();var isProduction=config[_0x22dd('0x3')]===_0x22dd('0x4')||![];function clientSideLogs(_0x2aa08d,_0x377e4d,_0x22ef4e){var _0x13ba6e=_0x2aa08d[_0x22dd('0x5')][_0x22dd('0x6')]('client-side-logger');if(!_0x13ba6e){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x22dd('0x7')]({'uri':_0x22dd('0x8'),'logger':_0x13ba6e,'enableCors':!isProduction})(_0x2aa08d,_0x377e4d,_0x22ef4e);}router[_0x22dd('0x9')](auth[_0x22dd('0xa')](),clientSideLogs);module[_0x22dd('0xb')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index f5dc9fb..24c00c2 100644 --- a/server/api/cloudProvider/cloudProvider.attributes.js +++ b/server/api/cloudProvider/cloudProvider.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x33a4=['STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','Google','MicrosoftAzure','ENUM','Outlook365'];(function(_0x22bb83,_0x22faee){var _0x5f5872=function(_0x3df72a){while(--_0x3df72a){_0x22bb83['push'](_0x22bb83['shift']());}};_0x5f5872(++_0x22faee);}(_0x33a4,0x16f));var _0x433a=function(_0xb319bc,_0x2ee748){_0xb319bc=_0xb319bc-0x0;var _0x377799=_0x33a4[_0xb319bc];return _0x377799;};'use strict';var Sequelize=require(_0x433a('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0x433a('0x1'),_0x433a('0x2')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x433a('0x3')](_0x433a('0x4'),'Dynamics365')},'data1':{'type':Sequelize[_0x433a('0x5')],'comment':_0x433a('0x6')},'data2':{'type':Sequelize[_0x433a('0x5')],'comment':_0x433a('0x7')},'data3':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x433a('0x5')],'comment':_0x433a('0x8')},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x433a('0x9')],'comment':_0x433a('0xa')},'data7':{'type':Sequelize[_0x433a('0x9')],'comment':_0x433a('0xb')}}; \ No newline at end of file +var _0x53fa=['Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','sequelize','exports','STRING','ENUM','MicrosoftAzure'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x53fa,0xc1));var _0xa53f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53fa[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa53f('0x0'));module[_0xa53f('0x1')]={'name':{'type':Sequelize[_0xa53f('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xa53f('0x3')]('AmazonAWS','Google',_0xa53f('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xa53f('0x3')](_0xa53f('0x5'),'Dynamics365')},'data1':{'type':Sequelize['STRING'],'comment':_0xa53f('0x6')},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0xa53f('0x2')],'comment':_0xa53f('0x7')},'data4':{'type':Sequelize[_0xa53f('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0xa53f('0x8')],'comment':_0xa53f('0x9')},'data6':{'type':Sequelize['TEXT'],'comment':_0xa53f('0xa')},'data7':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 6583000..2b1401c 100644 --- a/server/api/cloudProvider/cloudProvider.controller.js +++ b/server/api/cloudProvider/cloudProvider.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x998e=['decryptString','data3','catch','show','params','length','find','create','body','Name\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','from','base64','toString','ascii','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','startRefreshInterval','microsoftAuthorization:success','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','localhost','socket.io-emitter','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','update','destroy','error','stack','name','send','padEnd','slice','index','rawAttributes','fieldName','type','map','query','keys','filters','intersection','attributes','model','fields','nolimit','sort','pick','merge','where','VIRTUAL','filter','options','CloudProvider','then','includeAll','include','findAll','rows','service','MicrosoftAzure'];(function(_0x445855,_0x4dfecd){var _0x30970e=function(_0x24bec8){while(--_0x24bec8){_0x445855['push'](_0x445855['shift']());}};_0x30970e(++_0x4dfecd);}(_0x998e,0x157));var _0xe998=function(_0x3d5ca0,_0x2ecebb){_0x3d5ca0=_0x3d5ca0-0x0;var _0x415b48=_0x998e[_0x3d5ca0];return _0x415b48;};'use strict';var _=require(_0xe998('0x0'));var Redis=require(_0xe998('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xe998('0x2'));var config=require(_0xe998('0x3'));var logger=require(_0xe998('0x4'))(_0xe998('0x5'));var db=require(_0xe998('0x6'))['db'];var oauth=require(_0xe998('0x7'));config[_0xe998('0x8')]=_['defaults'](config[_0xe998('0x8')],{'host':_0xe998('0x9'),'port':0x18eb});var socket=require(_0xe998('0xa'))(new Redis(config[_0xe998('0x8')]));var redis=new Redis(config[_0xe998('0x8')]);function respondWithStatusCode(_0x5e7ac7,_0x51df09){_0x51df09=_0x51df09||0xcc;return function(_0x3e0ba0){if(_0x3e0ba0){return _0x5e7ac7[_0xe998('0xb')](_0x51df09);}return _0x5e7ac7['status'](_0x51df09)[_0xe998('0xc')]();};}function respondWithResult(_0x391df7,_0x30c7c3){_0x30c7c3=_0x30c7c3||0xc8;return function(_0x3e328b){if(_0x3e328b){return _0x391df7[_0xe998('0xd')](_0x30c7c3)[_0xe998('0xe')](_0x3e328b);}};}function respondWithFilteredResult(_0x20f4dd,_0x271f99){return function(_0x4ba480){if(_0x4ba480){var _0x30b0c5=typeof _0x271f99['offset']==='undefined'&&typeof _0x271f99[_0xe998('0xf')]===_0xe998('0x10');var _0x3e3997=_0x4ba480[_0xe998('0x11')];var _0x1c72e1=_0x30b0c5?0x0:_0x271f99['offset'];var _0x1e2dcc=_0x30b0c5?_0x4ba480[_0xe998('0x11')]:_0x271f99[_0xe998('0x12')]+_0x271f99[_0xe998('0xf')];var _0x5b115e;if(_0x1e2dcc>=_0x3e3997){_0x1e2dcc=_0x3e3997;_0x5b115e=0xc8;}else{_0x5b115e=0xce;}_0x20f4dd[_0xe998('0xd')](_0x5b115e);return _0x20f4dd[_0xe998('0x13')](_0xe998('0x14'),_0x1c72e1+'-'+_0x1e2dcc+'/'+_0x3e3997)[_0xe998('0xe')](_0x4ba480);}return null;};}function saveUpdates(_0x6731bc){return function(_0x313228){if(_0x313228){return _0x313228[_0xe998('0x15')](_0x6731bc)['then'](function(_0x38035d){return _0x38035d;});}return null;};}function removeEntity(_0x15de3e){return function(_0x17164a){if(_0x17164a){return _0x17164a[_0xe998('0x16')]()['then'](function(){_0x15de3e[_0xe998('0xd')](0xcc)[_0xe998('0xc')]();});}};}function handleEntityNotFound(_0x12272c){return function(_0x2ccfd9){if(!_0x2ccfd9){_0x12272c[_0xe998('0xb')](0x194);}return _0x2ccfd9;};}function handleError(_0x1c0fbe,_0xba60c4){_0xba60c4=_0xba60c4||0x1f4;return function(_0x5267e5){logger[_0xe998('0x17')](_0x5267e5[_0xe998('0x18')]);if(_0x5267e5[_0xe998('0x19')]){delete _0x5267e5[_0xe998('0x19')];}_0x1c0fbe['status'](_0xba60c4)[_0xe998('0x1a')](_0x5267e5);};}function maskClientSecret(_0x1886ba){return _[_0xe998('0x1b')](_0x1886ba[_0xe998('0x1c')](0x0,0x3),0x14,'*');}exports[_0xe998('0x1d')]=function(_0x5448c3,_0xe24189){var _0x110f78={},_0x4508f8={},_0x43c28a={'count':0x0,'rows':[]};var _0x9692ac=_['map'](db['CloudProvider'][_0xe998('0x1e')],function(_0x43fba9){return{'name':_0x43fba9[_0xe998('0x1f')],'type':_0x43fba9[_0xe998('0x20')]['key']};});_0x4508f8['model']=_[_0xe998('0x21')](_0x9692ac,'name');_0x4508f8[_0xe998('0x22')]=_[_0xe998('0x23')](_0x5448c3[_0xe998('0x22')]);_0x4508f8[_0xe998('0x24')]=_[_0xe998('0x25')](_0x4508f8['model'],_0x4508f8[_0xe998('0x22')]);_0x110f78[_0xe998('0x26')]=_[_0xe998('0x25')](_0x4508f8[_0xe998('0x27')],qs[_0xe998('0x28')](_0x5448c3[_0xe998('0x22')][_0xe998('0x28')]));_0x110f78[_0xe998('0x26')]=_0x110f78['attributes']['length']?_0x110f78[_0xe998('0x26')]:_0x4508f8[_0xe998('0x27')];if(!_0x5448c3[_0xe998('0x22')]['hasOwnProperty'](_0xe998('0x29'))){_0x110f78[_0xe998('0xf')]=qs[_0xe998('0xf')](_0x5448c3[_0xe998('0x22')][_0xe998('0xf')]);_0x110f78[_0xe998('0x12')]=qs[_0xe998('0x12')](_0x5448c3[_0xe998('0x22')][_0xe998('0x12')]);}_0x110f78['order']=qs['sort'](_0x5448c3[_0xe998('0x22')][_0xe998('0x2a')]);_0x110f78['where']=qs[_0xe998('0x24')](_[_0xe998('0x2b')](_0x5448c3[_0xe998('0x22')],_0x4508f8[_0xe998('0x24')]),_0x9692ac);if(_0x5448c3[_0xe998('0x22')]['filter']){_0x110f78['where']=_[_0xe998('0x2c')](_0x110f78[_0xe998('0x2d')],{'$or':_[_0xe998('0x21')](_0x9692ac,function(_0xa4f968){if(_0xa4f968[_0xe998('0x20')]!==_0xe998('0x2e')){var _0x571f79={};_0x571f79[_0xa4f968[_0xe998('0x19')]]={'$like':'%'+_0x5448c3[_0xe998('0x22')][_0xe998('0x2f')]+'%'};return _0x571f79;}})});}_0x110f78=_[_0xe998('0x2c')]({},_0x110f78,_0x5448c3[_0xe998('0x30')]);var _0x3dfd30={'where':_0x110f78['where']};return db[_0xe998('0x31')]['count'](_0x3dfd30)[_0xe998('0x32')](function(_0x232d01){_0x43c28a[_0xe998('0x11')]=_0x232d01;if(_0x5448c3[_0xe998('0x22')][_0xe998('0x33')]){_0x110f78[_0xe998('0x34')]=[{'all':!![]}];}return db[_0xe998('0x31')][_0xe998('0x35')](_0x110f78);})[_0xe998('0x32')](function(_0x486ac2){_0x43c28a[_0xe998('0x36')]=_[_0xe998('0x21')](_0x486ac2,function(_0x1e992c){if(_0x1e992c[_0xe998('0x37')]===_0xe998('0x38')){var _0xa443c1=encryptor[_0xe998('0x39')](_0x1e992c[_0xe998('0x3a')]);_0x1e992c[_0xe998('0x3a')]=maskClientSecret(_0xa443c1);}return _0x1e992c;});return _0x43c28a;})[_0xe998('0x32')](respondWithFilteredResult(_0xe24189,_0x110f78))[_0xe998('0x3b')](handleError(_0xe24189,null));};exports[_0xe998('0x3c')]=function(_0x301ae5,_0x29ef38){var _0x51b023={'raw':!![],'where':{'id':_0x301ae5[_0xe998('0x3d')]['id']}},_0xc05d4f={};_0xc05d4f[_0xe998('0x27')]=_[_0xe998('0x23')](db[_0xe998('0x31')][_0xe998('0x1e')]);_0xc05d4f[_0xe998('0x22')]=_[_0xe998('0x23')](_0x301ae5[_0xe998('0x22')]);_0xc05d4f[_0xe998('0x24')]=_[_0xe998('0x25')](_0xc05d4f[_0xe998('0x27')],_0xc05d4f[_0xe998('0x22')]);_0x51b023[_0xe998('0x26')]=_[_0xe998('0x25')](_0xc05d4f[_0xe998('0x27')],qs[_0xe998('0x28')](_0x301ae5[_0xe998('0x22')][_0xe998('0x28')]));_0x51b023[_0xe998('0x26')]=_0x51b023[_0xe998('0x26')][_0xe998('0x3e')]?_0x51b023[_0xe998('0x26')]:_0xc05d4f['model'];if(_0x301ae5[_0xe998('0x22')][_0xe998('0x33')]){_0x51b023['include']=[{'all':!![]}];}_0x51b023=_[_0xe998('0x2c')]({},_0x51b023,_0x301ae5[_0xe998('0x30')]);return db['CloudProvider'][_0xe998('0x3f')](_0x51b023)[_0xe998('0x32')](handleEntityNotFound(_0x29ef38,null))[_0xe998('0x32')](function(_0x4f72c1){if(_0x4f72c1[_0xe998('0x37')]===_0xe998('0x38')){var _0x494f07=encryptor[_0xe998('0x39')](_0x4f72c1[_0xe998('0x3a')]);_0x4f72c1['data3']=maskClientSecret(_0x494f07);}return _0x4f72c1;})[_0xe998('0x32')](respondWithResult(_0x29ef38,null))['catch'](handleError(_0x29ef38,null));};exports[_0xe998('0x40')]=function(_0x49e34f,_0x59e93e){if(!_0x49e34f[_0xe998('0x41')]['name'])throw new Error(_0xe998('0x42'));if(!_0x49e34f[_0xe998('0x41')][_0xe998('0x37')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x27b0e8=db['CloudProvider']['rawAttributes'][_0xe998('0x37')][_0xe998('0x43')];if(!_0x27b0e8['includes'](_0x49e34f['body'][_0xe998('0x37')]))throw new Error(_0xe998('0x44')+_0x27b0e8[_0xe998('0x45')](',\x20'));if(_0x49e34f['body'][_0xe998('0x37')]===_0xe998('0x38')&&_0x49e34f[_0xe998('0x41')]['data3']){_0x49e34f[_0xe998('0x41')][_0xe998('0x3a')]=encryptor['encryptString'](_0x49e34f['body']['data3']);}return db['CloudProvider'][_0xe998('0x40')](_0x49e34f[_0xe998('0x41')],{})[_0xe998('0x32')](respondWithResult(_0x59e93e,0xc9))[_0xe998('0x3b')](handleError(_0x59e93e,null));};exports[_0xe998('0x15')]=function(_0x28cd47,_0x432ce9){if(_0x28cd47[_0xe998('0x41')]['id']){delete _0x28cd47[_0xe998('0x41')]['id'];}return db[_0xe998('0x31')][_0xe998('0x3f')]({'where':{'id':_0x28cd47[_0xe998('0x3d')]['id']}})[_0xe998('0x32')](handleEntityNotFound(_0x432ce9,null))[_0xe998('0x32')](function(_0x19b7f9){if(_0x19b7f9[_0xe998('0x37')]===_0xe998('0x38')&&_0x28cd47[_0xe998('0x41')]['data3']){_0x28cd47[_0xe998('0x41')][_0xe998('0x3a')]=encryptor[_0xe998('0x46')](_0x28cd47[_0xe998('0x41')][_0xe998('0x3a')]);}return _0x19b7f9;})['then'](saveUpdates(_0x28cd47[_0xe998('0x41')],null))[_0xe998('0x32')](respondWithResult(_0x432ce9,null))[_0xe998('0x3b')](handleError(_0x432ce9,null));};exports[_0xe998('0x16')]=function(_0x395991,_0x414d6d){return db[_0xe998('0x31')][_0xe998('0x3f')]({'where':{'id':_0x395991[_0xe998('0x3d')]['id']}})[_0xe998('0x32')](handleEntityNotFound(_0x414d6d,null))[_0xe998('0x32')](removeEntity(_0x414d6d,null))['catch'](handleError(_0x414d6d,null));};exports[_0xe998('0x47')]=function(_0x1573be,_0x1b4420){return db[_0xe998('0x31')]['findOne']({'where':{'id':_0x1573be[_0xe998('0x3d')]['id']},'raw':!![]})[_0xe998('0x32')](function(_0x2da8ec){if(!_0x2da8ec)return _0x1b4420[_0xe998('0xb')](0x194);return{'url':oauth[_0xe998('0x48')](_0x2da8ec,_0x1573be[_0xe998('0x49')]['id'])};})[_0xe998('0x32')](respondWithResult(_0x1b4420,null))['catch'](handleError(_0x1b4420,null));};exports[_0xe998('0x4a')]=function(_0x27c27c,_0x6bb28){var _0xa89af9=_0x27c27c[_0xe998('0x41')];var _0x3ed810;var _0x25c8c4;if(_0xa89af9[_0xe998('0x17')])throw _0xa89af9;redis[_0xe998('0x4b')](_0xa89af9[_0xe998('0x4c')])[_0xe998('0x32')](function(_0x25cb1c){if(!_0x25cb1c)throw new Error(_0xe998('0x4d'));_0x3ed810=JSON['parse'](_0x25cb1c);var _0x2743c6=Buffer[_0xe998('0x4e')](_0xa89af9[_0xe998('0x4c')],_0xe998('0x4f'))[_0xe998('0x50')](_0xe998('0x51'));_0x25c8c4=JSON[_0xe998('0x52')](_0x2743c6);if(!oauth[_0xe998('0x53')](_0xa89af9[_0xe998('0x54')],_0x3ed810[_0xe998('0x55')]))throw new Error(_0xe998('0x56'));redis['del'](_0xa89af9[_0xe998('0x4c')]);return oauth[_0xe998('0x57')](_0xa89af9[_0xe998('0x58')],_0x3ed810);})[_0xe998('0x32')](function(_0x48f8f5){_0x3ed810[_0xe998('0x59')]=_0x48f8f5[_0xe998('0x5a')];_0x3ed810[_0xe998('0x5b')]=_0x48f8f5['refresh_token'];return db['CloudProvider'][_0xe998('0x15')]({'data5':_0x3ed810['data5'],'data6':_0x3ed810[_0xe998('0x5b')]},{'where':{'id':_0x3ed810['id']}});})[_0xe998('0x32')](function(){oauth[_0xe998('0x5c')](_0x3ed810);socket['emit'](_0xe998('0x5d'),{'id':_0x25c8c4['id']});return;})[_0xe998('0x32')](respondWithStatusCode(_0x6bb28,null))[_0xe998('0x3b')](function(_0x584320){if(_0x25c8c4){socket[_0xe998('0x5e')](_0xe998('0x5f'),{'id':_0x25c8c4['id']});}if(!_0x3ed810){logger['error'](_0xe998('0x60'),_0x584320);return _0x6bb28[_0xe998('0xd')](0x1f4)[_0xe998('0x1a')](_0x584320[_0xe998('0x61')]);}logger[_0xe998('0x17')](_0xe998('0x62'),_0x3ed810['id'],JSON[_0xe998('0x63')](_0x584320));});}; \ No newline at end of file +var _0x568d=['type','VIRTUAL','CloudProvider','includeAll','include','findAll','rows','MicrosoftAzure','decryptString','data3','catch','show','params','keys','options','find','service','create','body','Service\x20parameter\x20not\x20specified','values','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','from','state','ascii','isValidIdToken','id_token','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','lodash','ioredis','../../config/environment','../../config/logger','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','update','then','destroy','error','name','send','padEnd','slice','index','map','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','pick','filter','where','merge'];(function(_0x2f82b2,_0x56715d){var _0xf9ac6b=function(_0x57ea04){while(--_0x57ea04){_0x2f82b2['push'](_0x2f82b2['shift']());}};_0xf9ac6b(++_0x56715d);}(_0x568d,0x19b));var _0xd568=function(_0x5a3fd7,_0x5919da){_0x5a3fd7=_0x5a3fd7-0x0;var _0x572299=_0x568d[_0x5a3fd7];return _0x572299;};'use strict';var _=require(_0xd568('0x0'));var Redis=require(_0xd568('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require('../../components/encryptor');var config=require(_0xd568('0x2'));var logger=require(_0xd568('0x3'))('api');var db=require('../../mysqldb')['db'];var oauth=require(_0xd568('0x4'));config[_0xd568('0x5')]=_[_0xd568('0x6')](config['redis'],{'host':_0xd568('0x7'),'port':0x18eb});var socket=require(_0xd568('0x8'))(new Redis(config[_0xd568('0x5')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x147c96,_0x1174f4){_0x1174f4=_0x1174f4||0xcc;return function(_0x1ecacf){if(_0x1ecacf){return _0x147c96[_0xd568('0x9')](_0x1174f4);}return _0x147c96[_0xd568('0xa')](_0x1174f4)[_0xd568('0xb')]();};}function respondWithResult(_0x61caad,_0x43536a){_0x43536a=_0x43536a||0xc8;return function(_0x882b45){if(_0x882b45){return _0x61caad[_0xd568('0xa')](_0x43536a)['json'](_0x882b45);}};}function respondWithFilteredResult(_0x1be64a,_0x3f808a){return function(_0x44d904){if(_0x44d904){var _0x3ae3af=typeof _0x3f808a[_0xd568('0xc')]===_0xd568('0xd')&&typeof _0x3f808a['limit']===_0xd568('0xd');var _0x5ce0d4=_0x44d904[_0xd568('0xe')];var _0xfa00e2=_0x3ae3af?0x0:_0x3f808a[_0xd568('0xc')];var _0x2edc70=_0x3ae3af?_0x44d904['count']:_0x3f808a[_0xd568('0xc')]+_0x3f808a[_0xd568('0xf')];var _0x38b1e2;if(_0x2edc70>=_0x5ce0d4){_0x2edc70=_0x5ce0d4;_0x38b1e2=0xc8;}else{_0x38b1e2=0xce;}_0x1be64a[_0xd568('0xa')](_0x38b1e2);return _0x1be64a[_0xd568('0x10')](_0xd568('0x11'),_0xfa00e2+'-'+_0x2edc70+'/'+_0x5ce0d4)[_0xd568('0x12')](_0x44d904);}return null;};}function saveUpdates(_0x299589){return function(_0x2d6746){if(_0x2d6746){return _0x2d6746[_0xd568('0x13')](_0x299589)[_0xd568('0x14')](function(_0x185067){return _0x185067;});}return null;};}function removeEntity(_0x1a0256){return function(_0x30b193){if(_0x30b193){return _0x30b193[_0xd568('0x15')]()[_0xd568('0x14')](function(){_0x1a0256[_0xd568('0xa')](0xcc)[_0xd568('0xb')]();});}};}function handleEntityNotFound(_0x4200ea){return function(_0x22d94b){if(!_0x22d94b){_0x4200ea['sendStatus'](0x194);}return _0x22d94b;};}function handleError(_0x3823e1,_0x2e7bc6){_0x2e7bc6=_0x2e7bc6||0x1f4;return function(_0x576b2d){logger[_0xd568('0x16')](_0x576b2d['stack']);if(_0x576b2d['name']){delete _0x576b2d[_0xd568('0x17')];}_0x3823e1['status'](_0x2e7bc6)[_0xd568('0x18')](_0x576b2d);};}function maskClientSecret(_0x1e8859){return _[_0xd568('0x19')](_0x1e8859[_0xd568('0x1a')](0x0,0x3),0x14,'*');}exports[_0xd568('0x1b')]=function(_0x138095,_0x27f580){var _0x56e67f={},_0x4807c5={},_0x4556f0={'count':0x0,'rows':[]};var _0x28ac98=_[_0xd568('0x1c')](db['CloudProvider'][_0xd568('0x1d')],function(_0x3a10a3){return{'name':_0x3a10a3['fieldName'],'type':_0x3a10a3['type'][_0xd568('0x1e')]};});_0x4807c5[_0xd568('0x1f')]=_[_0xd568('0x1c')](_0x28ac98,'name');_0x4807c5[_0xd568('0x20')]=_['keys'](_0x138095[_0xd568('0x20')]);_0x4807c5[_0xd568('0x21')]=_[_0xd568('0x22')](_0x4807c5[_0xd568('0x1f')],_0x4807c5[_0xd568('0x20')]);_0x56e67f[_0xd568('0x23')]=_['intersection'](_0x4807c5['model'],qs['fields'](_0x138095[_0xd568('0x20')][_0xd568('0x24')]));_0x56e67f['attributes']=_0x56e67f[_0xd568('0x23')][_0xd568('0x25')]?_0x56e67f['attributes']:_0x4807c5[_0xd568('0x1f')];if(!_0x138095[_0xd568('0x20')]['hasOwnProperty'](_0xd568('0x26'))){_0x56e67f[_0xd568('0xf')]=qs['limit'](_0x138095[_0xd568('0x20')][_0xd568('0xf')]);_0x56e67f[_0xd568('0xc')]=qs[_0xd568('0xc')](_0x138095[_0xd568('0x20')][_0xd568('0xc')]);}_0x56e67f[_0xd568('0x27')]=qs['sort'](_0x138095[_0xd568('0x20')]['sort']);_0x56e67f['where']=qs[_0xd568('0x21')](_[_0xd568('0x28')](_0x138095['query'],_0x4807c5[_0xd568('0x21')]),_0x28ac98);if(_0x138095[_0xd568('0x20')][_0xd568('0x29')]){_0x56e67f[_0xd568('0x2a')]=_[_0xd568('0x2b')](_0x56e67f[_0xd568('0x2a')],{'$or':_['map'](_0x28ac98,function(_0x31a84b){if(_0x31a84b[_0xd568('0x2c')]!==_0xd568('0x2d')){var _0x47139c={};_0x47139c[_0x31a84b[_0xd568('0x17')]]={'$like':'%'+_0x138095['query']['filter']+'%'};return _0x47139c;}})});}_0x56e67f=_['merge']({},_0x56e67f,_0x138095['options']);var _0x184d8d={'where':_0x56e67f['where']};return db[_0xd568('0x2e')]['count'](_0x184d8d)[_0xd568('0x14')](function(_0x2d4c20){_0x4556f0[_0xd568('0xe')]=_0x2d4c20;if(_0x138095[_0xd568('0x20')][_0xd568('0x2f')]){_0x56e67f[_0xd568('0x30')]=[{'all':!![]}];}return db['CloudProvider'][_0xd568('0x31')](_0x56e67f);})[_0xd568('0x14')](function(_0xf8fb1b){_0x4556f0[_0xd568('0x32')]=_['map'](_0xf8fb1b,function(_0xbd135){if(_0xbd135['service']===_0xd568('0x33')){var _0x42d5aa=encryptor[_0xd568('0x34')](_0xbd135[_0xd568('0x35')]);_0xbd135[_0xd568('0x35')]=maskClientSecret(_0x42d5aa);}return _0xbd135;});return _0x4556f0;})[_0xd568('0x14')](respondWithFilteredResult(_0x27f580,_0x56e67f))[_0xd568('0x36')](handleError(_0x27f580,null));};exports[_0xd568('0x37')]=function(_0x1d0f5b,_0x45516c){var _0x50d205={'raw':!![],'where':{'id':_0x1d0f5b[_0xd568('0x38')]['id']}},_0x471edf={};_0x471edf['model']=_[_0xd568('0x39')](db[_0xd568('0x2e')]['rawAttributes']);_0x471edf['query']=_[_0xd568('0x39')](_0x1d0f5b[_0xd568('0x20')]);_0x471edf['filters']=_[_0xd568('0x22')](_0x471edf[_0xd568('0x1f')],_0x471edf[_0xd568('0x20')]);_0x50d205[_0xd568('0x23')]=_[_0xd568('0x22')](_0x471edf[_0xd568('0x1f')],qs[_0xd568('0x24')](_0x1d0f5b['query'][_0xd568('0x24')]));_0x50d205[_0xd568('0x23')]=_0x50d205[_0xd568('0x23')][_0xd568('0x25')]?_0x50d205[_0xd568('0x23')]:_0x471edf['model'];if(_0x1d0f5b[_0xd568('0x20')][_0xd568('0x2f')]){_0x50d205[_0xd568('0x30')]=[{'all':!![]}];}_0x50d205=_['merge']({},_0x50d205,_0x1d0f5b[_0xd568('0x3a')]);return db[_0xd568('0x2e')][_0xd568('0x3b')](_0x50d205)[_0xd568('0x14')](handleEntityNotFound(_0x45516c,null))['then'](function(_0x13413c){if(_0x13413c[_0xd568('0x3c')]===_0xd568('0x33')){var _0x436dbd=encryptor[_0xd568('0x34')](_0x13413c['data3']);_0x13413c[_0xd568('0x35')]=maskClientSecret(_0x436dbd);}return _0x13413c;})[_0xd568('0x14')](respondWithResult(_0x45516c,null))[_0xd568('0x36')](handleError(_0x45516c,null));};exports[_0xd568('0x3d')]=function(_0x5428d1,_0x459f92){if(!_0x5428d1[_0xd568('0x3e')][_0xd568('0x17')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x5428d1[_0xd568('0x3e')][_0xd568('0x3c')])throw new Error(_0xd568('0x3f'));var _0x3da31b=db[_0xd568('0x2e')][_0xd568('0x1d')][_0xd568('0x3c')][_0xd568('0x40')];if(!_0x3da31b['includes'](_0x5428d1[_0xd568('0x3e')][_0xd568('0x3c')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x3da31b['join'](',\x20'));if(_0x5428d1['body']['service']===_0xd568('0x33')&&_0x5428d1['body'][_0xd568('0x35')]){_0x5428d1[_0xd568('0x3e')][_0xd568('0x35')]=encryptor['encryptString'](_0x5428d1[_0xd568('0x3e')][_0xd568('0x35')]);}return db[_0xd568('0x2e')][_0xd568('0x3d')](_0x5428d1[_0xd568('0x3e')],{})['then'](respondWithResult(_0x459f92,0xc9))[_0xd568('0x36')](handleError(_0x459f92,null));};exports[_0xd568('0x13')]=function(_0x581e85,_0x95579e){if(_0x581e85[_0xd568('0x3e')]['id']){delete _0x581e85[_0xd568('0x3e')]['id'];}return db['CloudProvider'][_0xd568('0x3b')]({'where':{'id':_0x581e85[_0xd568('0x38')]['id']}})[_0xd568('0x14')](handleEntityNotFound(_0x95579e,null))['then'](function(_0x52fd6f){if(_0x52fd6f[_0xd568('0x3c')]===_0xd568('0x33')&&_0x581e85[_0xd568('0x3e')][_0xd568('0x35')]){_0x581e85['body'][_0xd568('0x35')]=encryptor[_0xd568('0x41')](_0x581e85[_0xd568('0x3e')][_0xd568('0x35')]);}return _0x52fd6f;})[_0xd568('0x14')](saveUpdates(_0x581e85[_0xd568('0x3e')],null))[_0xd568('0x14')](respondWithResult(_0x95579e,null))[_0xd568('0x36')](handleError(_0x95579e,null));};exports[_0xd568('0x15')]=function(_0x282a03,_0x477797){return db[_0xd568('0x2e')][_0xd568('0x3b')]({'where':{'id':_0x282a03[_0xd568('0x38')]['id']}})[_0xd568('0x14')](handleEntityNotFound(_0x477797,null))['then'](removeEntity(_0x477797,null))['catch'](handleError(_0x477797,null));};exports[_0xd568('0x42')]=function(_0x505e9b,_0x520c36){return db[_0xd568('0x2e')][_0xd568('0x43')]({'where':{'id':_0x505e9b[_0xd568('0x38')]['id']},'raw':!![]})[_0xd568('0x14')](function(_0x54ec67){if(!_0x54ec67)return _0x520c36[_0xd568('0x9')](0x194);return{'url':oauth[_0xd568('0x44')](_0x54ec67,_0x505e9b['user']['id'])};})[_0xd568('0x14')](respondWithResult(_0x520c36,null))['catch'](handleError(_0x520c36,null));};exports[_0xd568('0x45')]=function(_0x2b33cd,_0x188103){var _0x8e1d84=_0x2b33cd[_0xd568('0x3e')];var _0x19c8cb;var _0x3d9456;if(_0x8e1d84[_0xd568('0x16')])throw _0x8e1d84;redis[_0xd568('0x46')](_0x8e1d84['state'])[_0xd568('0x14')](function(_0x3d599f){if(!_0x3d599f)throw new Error(_0xd568('0x47'));_0x19c8cb=JSON[_0xd568('0x48')](_0x3d599f);var _0x2184b7=Buffer[_0xd568('0x49')](_0x8e1d84[_0xd568('0x4a')],'base64')['toString'](_0xd568('0x4b'));_0x3d9456=JSON[_0xd568('0x48')](_0x2184b7);if(!oauth[_0xd568('0x4c')](_0x8e1d84[_0xd568('0x4d')],_0x19c8cb['oauth2Claims']))throw new Error(_0xd568('0x4e'));redis[_0xd568('0x4f')](_0x8e1d84[_0xd568('0x4a')]);return oauth[_0xd568('0x50')](_0x8e1d84[_0xd568('0x51')],_0x19c8cb);})[_0xd568('0x14')](function(_0x47414c){_0x19c8cb[_0xd568('0x52')]=_0x47414c[_0xd568('0x53')];_0x19c8cb[_0xd568('0x54')]=_0x47414c[_0xd568('0x55')];return db['CloudProvider'][_0xd568('0x13')]({'data5':_0x19c8cb[_0xd568('0x52')],'data6':_0x19c8cb[_0xd568('0x54')]},{'where':{'id':_0x19c8cb['id']}});})[_0xd568('0x14')](function(){oauth[_0xd568('0x56')](_0x19c8cb);socket[_0xd568('0x57')]('microsoftAuthorization:success',{'id':_0x3d9456['id']});return;})[_0xd568('0x14')](respondWithStatusCode(_0x188103,null))[_0xd568('0x36')](function(_0x5ac4c7){if(_0x3d9456){socket[_0xd568('0x57')](_0xd568('0x58'),{'id':_0x3d9456['id']});}if(!_0x19c8cb){logger[_0xd568('0x16')](_0xd568('0x59'),_0x5ac4c7);return _0x188103[_0xd568('0xa')](0x1f4)[_0xd568('0x18')](_0x5ac4c7[_0xd568('0x5a')]);}logger[_0xd568('0x16')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x19c8cb['id'],JSON['stringify'](_0x5ac4c7));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index f65ffec..7591951 100644 --- a/server/api/cloudProvider/cloudProvider.model.js +++ b/server/api/cloudProvider/cloudProvider.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2bf9=['./cloudProvider.attributes','exports','define','CloudProvider','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xedbb78,_0xd3f36d){var _0x5f11cd=function(_0x356217){while(--_0x356217){_0xedbb78['push'](_0xedbb78['shift']());}};_0x5f11cd(++_0xd3f36d);}(_0x2bf9,0xd6));var _0x92bf=function(_0x2ea08a,_0x240f73){_0x2ea08a=_0x2ea08a-0x0;var _0x5401ad=_0x2bf9[_0x2ea08a];return _0x5401ad;};'use strict';var _=require(_0x92bf('0x0'));var util=require(_0x92bf('0x1'));var logger=require(_0x92bf('0x2'))(_0x92bf('0x3'));var moment=require(_0x92bf('0x4'));var BPromise=require(_0x92bf('0x5'));var rp=require(_0x92bf('0x6'));var fs=require('fs');var path=require(_0x92bf('0x7'));var rimraf=require(_0x92bf('0x8'));var config=require(_0x92bf('0x9'));var attributes=require(_0x92bf('0xa'));module[_0x92bf('0xb')]=function(_0x2a1ff0,_0x1c7ff1){return _0x2a1ff0[_0x92bf('0xc')](_0x92bf('0xd'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe9e6=['moment','request-promise','path','rimraf','define','CloudProvider','cloud_providers','lodash','util','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe9e6,0x11f));var _0x6e9e=function(_0x3a166a,_0x2018be){_0x3a166a=_0x3a166a-0x0;var _0x1b0279=_0xe9e6[_0x3a166a];return _0x1b0279;};'use strict';var _=require(_0x6e9e('0x0'));var util=require(_0x6e9e('0x1'));var logger=require('../../config/logger')(_0x6e9e('0x2'));var moment=require(_0x6e9e('0x3'));var BPromise=require('bluebird');var rp=require(_0x6e9e('0x4'));var fs=require('fs');var path=require(_0x6e9e('0x5'));var rimraf=require(_0x6e9e('0x6'));var config=require('../../config/environment');var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x12e7fa,_0x4fe547){return _0x12e7fa[_0x6e9e('0x7')](_0x6e9e('0x8'),attributes,{'tableName':_0x6e9e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index b28b4aa..3cf2917 100644 --- a/server/api/cloudProvider/cloudProvider.oauth.js +++ b/server/api/cloudProvider/cloudProvider.oauth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c0a=['openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','/.default','join','Outlook365','data7','replace','{TENANT_ID}','data2','code','id_token','from','toString','base64','randomBytes','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','scope','state','nonce','login','key','oauth2Claims','oauth2/','stringify','decode','iss','aud','isAfter','unix','exp','resolve','then','data3','CloudProvider','refresh_token','data6','decryptString','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','POST','intervals','bind','findAll','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','jsonwebtoken','request-promise','util','../../components/encryptor','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0'];(function(_0x13ca9f,_0x4ea82d){var _0x101873=function(_0xaba3ff){while(--_0xaba3ff){_0x13ca9f['push'](_0x13ca9f['shift']());}};_0x101873(++_0x4ea82d);}(_0x9c0a,0x1c3));var _0xa9c0=function(_0x4d07da,_0x231540){_0x4d07da=_0x4d07da-0x0;var _0x238bab=_0x9c0a[_0x4d07da];return _0x238bab;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require(_0xa9c0('0x0'));var moment=require('moment');var Redis=require('ioredis');var rp=require(_0xa9c0('0x1'));var util=require(_0xa9c0('0x2'));var encryptor=require(_0xa9c0('0x3'));var config=require('../../config/environment');var logger=require(_0xa9c0('0x4'))('api');var schedule=require(_0xa9c0('0x5'));var db=require(_0xa9c0('0x6'))['db'];config[_0xa9c0('0x7')]=_[_0xa9c0('0x8')](config[_0xa9c0('0x7')],{'host':_0xa9c0('0x9'),'port':0x18eb});var redis=new Redis(config[_0xa9c0('0x7')]);var MICROSOFT_AUTH_URL=_0xa9c0('0xa');var AZURE_AUTH_SCOPES={'Outlook365':[_0xa9c0('0xb'),_0xa9c0('0xc'),_0xa9c0('0xd'),_0xa9c0('0xe'),_0xa9c0('0xf'),_0xa9c0('0x10'),_0xa9c0('0x11')],'Dynamics365':[_0xa9c0('0xb'),_0xa9c0('0xe')]};var MICROSOFT_AUTH_ENDPOINT=_0xa9c0('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0xa9c0('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x165906){var _0x24e44f=_[_0xa9c0('0x14')](AZURE_AUTH_SCOPES[_0x165906[_0xa9c0('0x15')]]);if(_0x165906[_0xa9c0('0x15')]===_0xa9c0('0x16'))_0x24e44f[_0xa9c0('0x17')](_0x165906['data7']+_0xa9c0('0x18'));return _0x24e44f[_0xa9c0('0x19')]('\x20');}function getAccessTokenScope(_0x2dc62f){if(_0x2dc62f[_0xa9c0('0x15')]===_0xa9c0('0x1a'))return _0xa9c0('0xf');if(_0x2dc62f[_0xa9c0('0x15')]===_0xa9c0('0x16'))return _0x2dc62f[_0xa9c0('0x1b')]+_0xa9c0('0x18');}function generateMicrosoftAuthorizationUrl(_0x251739,_0x158af9){var _0x4aff9b=MICROSOFT_AUTH_URL[_0xa9c0('0x1c')](_0xa9c0('0x1d'),_0x251739[_0xa9c0('0x1e')]);var _0x56421c=[_0xa9c0('0x1f'),_0xa9c0('0x20')];var _0x19f62e=Buffer[_0xa9c0('0x21')](JSON['stringify']({'id':_0x158af9}))[_0xa9c0('0x22')](_0xa9c0('0x23'));var _0x3b6fab=crypto[_0xa9c0('0x24')](0x10)[_0xa9c0('0x22')](_0xa9c0('0x25'));var _0xafb0d5=getAuthorizationScopes(_0x251739);var _0x50c436=[{'key':_0xa9c0('0x26'),'value':_0x251739[_0xa9c0('0x27')]},{'key':_0xa9c0('0x28'),'value':encodeURIComponent(_0x56421c[_0xa9c0('0x19')]('\x20'))},{'key':_0xa9c0('0x29'),'value':_0x251739[_0xa9c0('0x2a')]},{'key':_0xa9c0('0x2b'),'value':_0xa9c0('0x2c')},{'key':_0xa9c0('0x2d'),'value':encodeURIComponent(_0xafb0d5)},{'key':_0xa9c0('0x2e'),'value':_0x19f62e},{'key':_0xa9c0('0x2f'),'value':_0x3b6fab},{'key':'prompt','value':_0xa9c0('0x30')}];var _0x3ea6db=_0x4aff9b+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xa9c0('0x14')](_0x50c436,function(_0x5a6bf9){return _0x5a6bf9[_0xa9c0('0x31')]+'='+_0x5a6bf9['value'];})[_0xa9c0('0x19')]('&');_0x251739[_0xa9c0('0x32')]={'issuer':_0x4aff9b[_0xa9c0('0x1c')](_0xa9c0('0x33'),''),'audience':_0x251739[_0xa9c0('0x27')],'state':_0x19f62e,'nonce':_0x3b6fab};redis['set'](_0x19f62e,JSON[_0xa9c0('0x34')](_0x251739));return _0x3ea6db;}function isValidIdToken(_0x280cc0,_0x424792){try{var _0x10b40f=jwt[_0xa9c0('0x35')](_0x280cc0,{'complete':!![]});var _0x5b98a3=_0x10b40f['payload'];if(_0x5b98a3[_0xa9c0('0x36')]!==_0x424792['issuer'])return![];if(_0x5b98a3[_0xa9c0('0x37')]!==_0x424792['audience'])return![];if(_0x5b98a3[_0xa9c0('0x2f')]!==_0x424792[_0xa9c0('0x2f')])return![];if(moment()[_0xa9c0('0x38')](moment[_0xa9c0('0x39')](_0x5b98a3[_0xa9c0('0x3a')])))return![];return!![];}catch(_0x2aa86d){throw _0x2aa86d;}}function refreshOauth2MicrosoftAccessToken(_0x4b9483){return Promise[_0xa9c0('0x3b')]()[_0xa9c0('0x3c')](function(){if(_0x4b9483[_0xa9c0('0x3d')])return _0x4b9483;return db[_0xa9c0('0x3e')]['findOne']({'where':{'id':_0x4b9483['id']},'raw':!![]});})[_0xa9c0('0x3c')](function(_0x53346e){var _0x4b20bb={'grant_type':_0xa9c0('0x3f'),'refresh_token':_0x53346e[_0xa9c0('0x40')],'scope':getAccessTokenScope(_0x53346e),'redirect_uri':_0x53346e['data4'],'client_id':_0x53346e['data1'],'client_secret':encryptor[_0xa9c0('0x41')](_0x53346e[_0xa9c0('0x3d')])};var _0x51ca69={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xa9c0('0x1c')](_0xa9c0('0x1d'),_0x53346e[_0xa9c0('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4b20bb,'json':!![]};return rp(_0x51ca69);})[_0xa9c0('0x3c')](function(_0x3acda2){_0x4b9483['data5']=_0x3acda2[_0xa9c0('0x42')];_0x4b9483[_0xa9c0('0x40')]=_0x3acda2['refresh_token'];return db[_0xa9c0('0x3e')][_0xa9c0('0x43')]({'data5':_0x4b9483['data5'],'data6':_0x4b9483[_0xa9c0('0x40')]},{'where':{'id':_0x4b9483['id']}});})[_0xa9c0('0x3c')](function(){return _0x4b9483;})[_0xa9c0('0x44')](function(_0x94ced3){logger[_0xa9c0('0x45')](_0xa9c0('0x46'),_0x4b9483['id'],_0x94ced3);});}function getOauth2MicrosoftAccessToken(_0x3dd803,_0x2dffdd){var _0x210ffc={'grant_type':'authorization_code','code':_0x3dd803,'scope':getAccessTokenScope(_0x2dffdd),'redirect_uri':_0x2dffdd['data4'],'client_id':_0x2dffdd[_0xa9c0('0x27')],'client_secret':encryptor[_0xa9c0('0x41')](_0x2dffdd[_0xa9c0('0x3d')])};var _0x605d1e={'method':_0xa9c0('0x47'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x2dffdd[_0xa9c0('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x210ffc,'json':!![]};return rp(_0x605d1e);}function startRefreshInterval(_0x505eed){var _0x2e4a4f=schedule[_0xa9c0('0x48')];if(_0x2e4a4f[_0x505eed['id']])clearInterval(_0x2e4a4f[_0x505eed['id']]);_0x2e4a4f[_0x505eed['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xa9c0('0x49')](this,{'id':_0x505eed['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xa9c0('0x48')]=_0x2e4a4f;}function startAllRefreshIntervals(){return db[_0xa9c0('0x3e')][_0xa9c0('0x4a')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xa9c0('0x3c')](function(_0x3e52bd){var _0x11ed7a=_0x3e52bd[_0xa9c0('0x14')](function(_0x3cc5f2){return refreshOauth2MicrosoftAccessToken(_0x3cc5f2)[_0xa9c0('0x3c')](function(_0x5511a5){startRefreshInterval(_0x5511a5);});});return Promise['all'](_0x11ed7a);})[_0xa9c0('0x44')](function(_0x3f4e08){var _0x399228=_0x3f4e08?util['inspect'](_0x3f4e08,{'showHidden':![],'depth':null}):'';logger[_0xa9c0('0x45')](_0xa9c0('0x4b'),_0x399228);});}module[_0xa9c0('0x4c')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x17af=['redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','replace','{TENANT_ID}','code','id_token','from','stringify','toString','hex','client_id','data1','response_type','data4','response_mode','scope','state','prompt','login','key','oauth2Claims','set','decode','payload','iss','issuer','aud','audience','nonce','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','data2','data5','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','findAll','all','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','jsonwebtoken','moment','ioredis','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb'];(function(_0x224ae5,_0x34c9da){var _0x1814a0=function(_0xcdca20){while(--_0xcdca20){_0x224ae5['push'](_0x224ae5['shift']());}};_0x1814a0(++_0x34c9da);}(_0x17af,0x98));var _0xf17a=function(_0x11b3f4,_0x371c17){_0x11b3f4=_0x11b3f4-0x0;var _0x47af1d=_0x17af[_0x11b3f4];return _0x47af1d;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require(_0xf17a('0x0'));var moment=require(_0xf17a('0x1'));var Redis=require(_0xf17a('0x2'));var rp=require('request-promise');var util=require(_0xf17a('0x3'));var encryptor=require(_0xf17a('0x4'));var config=require(_0xf17a('0x5'));var logger=require(_0xf17a('0x6'))(_0xf17a('0x7'));var schedule=require(_0xf17a('0x8'));var db=require(_0xf17a('0x9'))['db'];config[_0xf17a('0xa')]=_[_0xf17a('0xb')](config[_0xf17a('0xa')],{'host':_0xf17a('0xc'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0xf17a('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0xf17a('0xe'),_0xf17a('0xf'),_0xf17a('0x10'),_0xf17a('0x11'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0xf17a('0x12'),_0xf17a('0x13')],'Dynamics365':['openid','offline_access']};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0xf17a('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x573d78){var _0x54acb3=_[_0xf17a('0x15')](AZURE_AUTH_SCOPES[_0x573d78[_0xf17a('0x16')]]);if(_0x573d78['type']===_0xf17a('0x17'))_0x54acb3[_0xf17a('0x18')](_0x573d78[_0xf17a('0x19')]+_0xf17a('0x1a'));return _0x54acb3[_0xf17a('0x1b')]('\x20');}function getAccessTokenScope(_0x3b0877){if(_0x3b0877[_0xf17a('0x16')]===_0xf17a('0x1c'))return _0xf17a('0x1d');if(_0x3b0877[_0xf17a('0x16')]===_0xf17a('0x17'))return _0x3b0877[_0xf17a('0x19')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x494ca2,_0x106427){var _0x5dc95d=MICROSOFT_AUTH_URL[_0xf17a('0x1e')](_0xf17a('0x1f'),_0x494ca2['data2']);var _0x309777=[_0xf17a('0x20'),_0xf17a('0x21')];var _0x131cb1=Buffer[_0xf17a('0x22')](JSON[_0xf17a('0x23')]({'id':_0x106427}))[_0xf17a('0x24')]('base64');var _0x42f6b9=crypto['randomBytes'](0x10)[_0xf17a('0x24')](_0xf17a('0x25'));var _0x4ca904=getAuthorizationScopes(_0x494ca2);var _0x2553da=[{'key':_0xf17a('0x26'),'value':_0x494ca2[_0xf17a('0x27')]},{'key':_0xf17a('0x28'),'value':encodeURIComponent(_0x309777[_0xf17a('0x1b')]('\x20'))},{'key':'redirect_uri','value':_0x494ca2[_0xf17a('0x29')]},{'key':_0xf17a('0x2a'),'value':'form_post'},{'key':_0xf17a('0x2b'),'value':encodeURIComponent(_0x4ca904)},{'key':_0xf17a('0x2c'),'value':_0x131cb1},{'key':'nonce','value':_0x42f6b9},{'key':_0xf17a('0x2d'),'value':_0xf17a('0x2e')}];var _0x15f727=_0x5dc95d+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xf17a('0x15')](_0x2553da,function(_0x191140){return _0x191140[_0xf17a('0x2f')]+'='+_0x191140['value'];})['join']('&');_0x494ca2[_0xf17a('0x30')]={'issuer':_0x5dc95d['replace']('oauth2/',''),'audience':_0x494ca2[_0xf17a('0x27')],'state':_0x131cb1,'nonce':_0x42f6b9};redis[_0xf17a('0x31')](_0x131cb1,JSON[_0xf17a('0x23')](_0x494ca2));return _0x15f727;}function isValidIdToken(_0x3211d8,_0x39e8fa){try{var _0x2227b7=jwt[_0xf17a('0x32')](_0x3211d8,{'complete':!![]});var _0x55c76b=_0x2227b7[_0xf17a('0x33')];if(_0x55c76b[_0xf17a('0x34')]!==_0x39e8fa[_0xf17a('0x35')])return![];if(_0x55c76b[_0xf17a('0x36')]!==_0x39e8fa[_0xf17a('0x37')])return![];if(_0x55c76b['nonce']!==_0x39e8fa[_0xf17a('0x38')])return![];if(moment()[_0xf17a('0x39')](moment[_0xf17a('0x3a')](_0x55c76b[_0xf17a('0x3b')])))return![];return!![];}catch(_0x4f9fd7){throw _0x4f9fd7;}}function refreshOauth2MicrosoftAccessToken(_0x3cf672){return Promise[_0xf17a('0x3c')]()[_0xf17a('0x3d')](function(){if(_0x3cf672[_0xf17a('0x3e')])return _0x3cf672;return db[_0xf17a('0x3f')][_0xf17a('0x40')]({'where':{'id':_0x3cf672['id']},'raw':!![]});})[_0xf17a('0x3d')](function(_0x75a40f){var _0xd1ad4b={'grant_type':_0xf17a('0x41'),'refresh_token':_0x75a40f[_0xf17a('0x42')],'scope':getAccessTokenScope(_0x75a40f),'redirect_uri':_0x75a40f[_0xf17a('0x29')],'client_id':_0x75a40f[_0xf17a('0x27')],'client_secret':encryptor[_0xf17a('0x43')](_0x75a40f['data3'])};var _0x338a9b={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0xf17a('0x1f'),_0x75a40f[_0xf17a('0x44')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xd1ad4b,'json':!![]};return rp(_0x338a9b);})[_0xf17a('0x3d')](function(_0x4eaeeb){_0x3cf672[_0xf17a('0x45')]=_0x4eaeeb[_0xf17a('0x46')];_0x3cf672[_0xf17a('0x42')]=_0x4eaeeb[_0xf17a('0x41')];return db[_0xf17a('0x3f')][_0xf17a('0x47')]({'data5':_0x3cf672[_0xf17a('0x45')],'data6':_0x3cf672[_0xf17a('0x42')]},{'where':{'id':_0x3cf672['id']}});})[_0xf17a('0x3d')](function(){return _0x3cf672;})[_0xf17a('0x48')](function(_0x559065){logger[_0xf17a('0x49')](_0xf17a('0x4a'),_0x3cf672['id'],_0x559065);});}function getOauth2MicrosoftAccessToken(_0x3f634d,_0x1cb893){var _0x1b5e2c={'grant_type':_0xf17a('0x4b'),'code':_0x3f634d,'scope':getAccessTokenScope(_0x1cb893),'redirect_uri':_0x1cb893[_0xf17a('0x29')],'client_id':_0x1cb893[_0xf17a('0x27')],'client_secret':encryptor[_0xf17a('0x43')](_0x1cb893[_0xf17a('0x3e')])};var _0x244e45={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0xf17a('0x1f'),_0x1cb893['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1b5e2c,'json':!![]};return rp(_0x244e45);}function startRefreshInterval(_0x7267b7){var _0x524d72=schedule[_0xf17a('0x4c')];if(_0x524d72[_0x7267b7['id']])clearInterval(_0x524d72[_0x7267b7['id']]);_0x524d72[_0x7267b7['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xf17a('0x4d')](this,{'id':_0x7267b7['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xf17a('0x4c')]=_0x524d72;}function startAllRefreshIntervals(){return db[_0xf17a('0x3f')][_0xf17a('0x4e')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xf17a('0x3d')](function(_0xf3350b){var _0x194117=_0xf3350b[_0xf17a('0x15')](function(_0x1dec40){return refreshOauth2MicrosoftAccessToken(_0x1dec40)[_0xf17a('0x3d')](function(_0x9a561e){startRefreshInterval(_0x9a561e);});});return Promise[_0xf17a('0x4f')](_0x194117);})[_0xf17a('0x48')](function(_0xc2a0fd){var _0x30b823=_0xc2a0fd?util['inspect'](_0xc2a0fd,{'showHidden':![],'depth':null}):'';logger[_0xf17a('0x49')](_0xf17a('0x50'),_0x30b823);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 5adff4f..42df104 100644 --- a/server/api/cloudProvider/cloudProvider.rpc.js +++ b/server/api/cloudProvider/cloudProvider.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x18f3=['rpc','../../config/environment','jayson/promise','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','../../mysqldb','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x18f3,0x19f));var _0x318f=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x18f3[_0xd1d19a];return _0x52a79d;};'use strict';var _=require('lodash');var util=require(_0x318f('0x0'));var moment=require(_0x318f('0x1'));var BPromise=require(_0x318f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x318f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x318f('0x4'))(_0x318f('0x5'));var config=require(_0x318f('0x6'));var jayson=require(_0x318f('0x7'));var client=jayson['client'][_0x318f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3579e8,_0x49188c,_0x59abcf){return new BPromise(function(_0x4618c1,_0x547785){return client[_0x318f('0x9')](_0x3579e8,_0x59abcf)[_0x318f('0xa')](function(_0x1479df){logger[_0x318f('0xb')](_0x318f('0xc'),_0x49188c,_0x318f('0xd'));logger[_0x318f('0xe')](_0x318f('0xf'),_0x49188c,_0x318f('0xd'),JSON[_0x318f('0x10')](_0x1479df));if(_0x1479df[_0x318f('0x11')]){if(_0x1479df[_0x318f('0x11')][_0x318f('0x12')]===0x1f4){logger[_0x318f('0x11')](_0x318f('0xc'),_0x49188c,_0x1479df['error']['message']);return _0x547785(_0x1479df[_0x318f('0x11')][_0x318f('0x13')]);}logger[_0x318f('0x11')](_0x318f('0xc'),_0x49188c,_0x1479df[_0x318f('0x11')][_0x318f('0x13')]);return _0x4618c1(_0x1479df[_0x318f('0x11')]['message']);}else{logger[_0x318f('0xb')]('CloudProvider,\x20%s,\x20%s',_0x49188c,'request\x20sent');_0x4618c1(_0x1479df[_0x318f('0x14')][_0x318f('0x13')]);}})['catch'](function(_0x594af8){logger[_0x318f('0x11')]('CloudProvider,\x20%s,\x20%s',_0x49188c,_0x594af8);_0x547785(_0x594af8);});});} \ No newline at end of file +var _0xf3e2=['rpc','jayson/promise','client','http','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xf3e2,0x168));var _0x2f3e=function(_0x386984,_0x410210){_0x386984=_0x386984-0x0;var _0x214fc5=_0xf3e2[_0x386984];return _0x214fc5;};'use strict';var _=require(_0x2f3e('0x0'));var util=require(_0x2f3e('0x1'));var moment=require(_0x2f3e('0x2'));var BPromise=require(_0x2f3e('0x3'));var rs=require(_0x2f3e('0x4'));var fs=require('fs');var Redis=require(_0x2f3e('0x5'));var db=require(_0x2f3e('0x6'))['db'];var utils=require(_0x2f3e('0x7'));var logger=require('../../config/logger')(_0x2f3e('0x8'));var config=require('../../config/environment');var jayson=require(_0x2f3e('0x9'));var client=jayson[_0x2f3e('0xa')][_0x2f3e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x392f91,_0x3b556b,_0x1ac142){return new BPromise(function(_0x30f939,_0x46ec1b){return client['request'](_0x392f91,_0x1ac142)[_0x2f3e('0xc')](function(_0x4d7f7d){logger[_0x2f3e('0xd')](_0x2f3e('0xe'),_0x3b556b,_0x2f3e('0xf'));logger[_0x2f3e('0x10')](_0x2f3e('0x11'),_0x3b556b,_0x2f3e('0xf'),JSON[_0x2f3e('0x12')](_0x4d7f7d));if(_0x4d7f7d[_0x2f3e('0x13')]){if(_0x4d7f7d[_0x2f3e('0x13')][_0x2f3e('0x14')]===0x1f4){logger[_0x2f3e('0x13')](_0x2f3e('0xe'),_0x3b556b,_0x4d7f7d['error'][_0x2f3e('0x15')]);return _0x46ec1b(_0x4d7f7d['error'][_0x2f3e('0x15')]);}logger[_0x2f3e('0x13')]('CloudProvider,\x20%s,\x20%s',_0x3b556b,_0x4d7f7d['error'][_0x2f3e('0x15')]);return _0x30f939(_0x4d7f7d[_0x2f3e('0x13')][_0x2f3e('0x15')]);}else{logger[_0x2f3e('0xd')](_0x2f3e('0xe'),_0x3b556b,_0x2f3e('0xf'));_0x30f939(_0x4d7f7d['result'][_0x2f3e('0x15')]);}})[_0x2f3e('0x16')](function(_0x15398d){logger[_0x2f3e('0x13')]('CloudProvider,\x20%s,\x20%s',_0x3b556b,_0x15398d);_0x46ec1b(_0x15398d);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index f11d99d..76b4d02 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x141188,_0x5ca721){var _0x4f03f2=function(_0x37b3f5){while(--_0x37b3f5){_0x141188['push'](_0x141188['shift']());}};_0x4f03f2(++_0x5ca721);}(_0x5f66,0x1a0));var _0x65f6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5f66[_0x19e35c];return _0x3e1fe8;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=router; \ No newline at end of file +var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x7a54,0x106));var _0x47a5=function(_0x4f31c0,_0x18775c){_0x4f31c0=_0x4f31c0-0x0;var _0x2b4c25=_0x7a54[_0x4f31c0];return _0x2b4c25;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 650a000..9b08445 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 _0xc749=['name','exports','STRING'];(function(_0x48788f,_0x1559b8){var _0x6d06bf=function(_0x475165){while(--_0x475165){_0x48788f['push'](_0x48788f['shift']());}};_0x6d06bf(++_0x1559b8);}(_0xc749,0x1c0));var _0x9c74=function(_0x1c6355,_0x5d1571){_0x1c6355=_0x1c6355-0x0;var _0x422fb1=_0xc749[_0x1c6355];return _0x422fb1;};'use strict';var Sequelize=require('sequelize');module[_0x9c74('0x0')]={'name':{'type':Sequelize[_0x9c74('0x1')],'unique':_0x9c74('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x9c74('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x9c74('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9c74('0x1')]},'street':{'type':Sequelize[_0x9c74('0x1')]},'postalCode':{'type':Sequelize[_0x9c74('0x1')]},'city':{'type':Sequelize[_0x9c74('0x1')]},'country':{'type':Sequelize[_0x9c74('0x1')]},'email':{'type':Sequelize[_0x9c74('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x9c74('0x1')]},'sStreet':{'type':Sequelize[_0x9c74('0x1')]},'sPostalCode':{'type':Sequelize[_0x9c74('0x1')]},'sCity':{'type':Sequelize[_0x9c74('0x1')]},'sCountry':{'type':Sequelize[_0x9c74('0x1')]},'description':{'type':Sequelize[_0x9c74('0x1')]}}; \ No newline at end of file +var _0xeb9a=['STRING','sequelize','name'];(function(_0xc8d295,_0x40d855){var _0x5c9757=function(_0x4a26bf){while(--_0x4a26bf){_0xc8d295['push'](_0xc8d295['shift']());}};_0x5c9757(++_0x40d855);}(_0xeb9a,0x145));var _0xaeb9=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0xeb9a[_0x36ed3c];return _0x52a2e0;};'use strict';var Sequelize=require(_0xaeb9('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xaeb9('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xaeb9('0x2')]},'companyId':{'type':Sequelize[_0xaeb9('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xaeb9('0x2')]},'fax':{'type':Sequelize[_0xaeb9('0x2')]},'type':{'type':Sequelize[_0xaeb9('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xaeb9('0x2')]},'city':{'type':Sequelize[_0xaeb9('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xaeb9('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xaeb9('0x2')]},'sStreet':{'type':Sequelize[_0xaeb9('0x2')]},'sPostalCode':{'type':Sequelize[_0xaeb9('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xaeb9('0x2')]},'description':{'type':Sequelize[_0xaeb9('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 2fe3a19..691e2b0 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 _0x21cc=['mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','Companies','UserProfileResource','end','error','name','send','index','CmCompany','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','map','filter','include','rows','catch','show','params','rawAttributes','includeAll','options','find','create','get','role','user','UserProfileSection','userProfileId','autoAssociation','body','describe','addContacts','CmContact','ids','omit','findOne','merge','getContacts','request-promise','moment','bluebird'];(function(_0x4e0ccc,_0x5f2221){var _0x51c481=function(_0x4b7692){while(--_0x4b7692){_0x4e0ccc['push'](_0x4e0ccc['shift']());}};_0x51c481(++_0x5f2221);}(_0x21cc,0xff));var _0xc21c=function(_0x29a5d1,_0xae9143){_0x29a5d1=_0x29a5d1-0x0;var _0x5da2e0=_0x21cc[_0x29a5d1];return _0x5da2e0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc21c('0x0'));var moment=require(_0xc21c('0x1'));var BPromise=require(_0xc21c('0x2'));var Mustache=require(_0xc21c('0x3'));var util=require(_0xc21c('0x4'));var path=require(_0xc21c('0x5'));var sox=require('sox');var csv=require(_0xc21c('0x6'));var ejs=require(_0xc21c('0x7'));var fs=require('fs');var fs_extra=require(_0xc21c('0x8'));var _=require(_0xc21c('0x9'));var squel=require(_0xc21c('0xa'));var crypto=require('crypto');var jsforce=require(_0xc21c('0xb'));var deskjs=require(_0xc21c('0xc'));var toCsv=require(_0xc21c('0x6'));var querystring=require(_0xc21c('0xd'));var Papa=require(_0xc21c('0xe'));var Redis=require(_0xc21c('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc21c('0x10'));var logger=require('../../config/logger')(_0xc21c('0x11'));var utils=require(_0xc21c('0x12'));var config=require(_0xc21c('0x13'));var licenseUtil=require(_0xc21c('0x14'));var db=require(_0xc21c('0x15'))['db'];function respondWithStatusCode(_0x59e311,_0x108b44){_0x108b44=_0x108b44||0xcc;return function(_0x431692){if(_0x431692){return _0x59e311[_0xc21c('0x16')](_0x108b44);}return _0x59e311[_0xc21c('0x17')](_0x108b44)['end']();};}function respondWithResult(_0x48cfa2,_0x4e2b87){_0x4e2b87=_0x4e2b87||0xc8;return function(_0x6fb486){if(_0x6fb486){return _0x48cfa2[_0xc21c('0x17')](_0x4e2b87)[_0xc21c('0x18')](_0x6fb486);}};}function respondWithFilteredResult(_0xd194de,_0x5df515){return function(_0x350153){if(_0x350153){var _0x57e7c0=typeof _0x5df515[_0xc21c('0x19')]===_0xc21c('0x1a')&&typeof _0x5df515['limit']===_0xc21c('0x1a');var _0x58fd5e=_0x350153[_0xc21c('0x1b')];var _0xab564e=_0x57e7c0?0x0:_0x5df515[_0xc21c('0x19')];var _0x25fa33=_0x57e7c0?_0x350153[_0xc21c('0x1b')]:_0x5df515[_0xc21c('0x19')]+_0x5df515['limit'];var _0x14acb6;if(_0x25fa33>=_0x58fd5e){_0x25fa33=_0x58fd5e;_0x14acb6=0xc8;}else{_0x14acb6=0xce;}_0xd194de['status'](_0x14acb6);return _0xd194de[_0xc21c('0x1c')](_0xc21c('0x1d'),_0xab564e+'-'+_0x25fa33+'/'+_0x58fd5e)[_0xc21c('0x18')](_0x350153);}return null;};}function patchUpdates(_0x1a8cf3){return function(_0x18bb73){try{jsonpatch[_0xc21c('0x1e')](_0x18bb73,_0x1a8cf3,!![]);}catch(_0x1454cd){return BPromise[_0xc21c('0x1f')](_0x1454cd);}return _0x18bb73[_0xc21c('0x20')]();};}function saveUpdates(_0x27ae65,_0x4d1600){return function(_0x5f01af){if(_0x5f01af){return _0x5f01af[_0xc21c('0x21')](_0x27ae65)[_0xc21c('0x22')](function(_0x125bb0){return _0x125bb0;});}return null;};}function removeEntity(_0x1f54a6,_0x4dd6a7){return function(_0x23266e){if(_0x23266e){return _0x23266e[_0xc21c('0x23')]()[_0xc21c('0x22')](function(){var _0x30b7b3=_0x23266e['get']({'plain':!![]});var _0x4f3b89=_0xc21c('0x24');return db[_0xc21c('0x25')][_0xc21c('0x23')]({'where':{'type':_0x4f3b89,'resourceId':_0x30b7b3['id']}})[_0xc21c('0x22')](function(){return _0x23266e;});})['then'](function(){_0x1f54a6['status'](0xcc)[_0xc21c('0x26')]();});}};}function handleEntityNotFound(_0x1811d2,_0x3e1079){return function(_0x3d35a2){if(!_0x3d35a2){_0x1811d2[_0xc21c('0x16')](0x194);}return _0x3d35a2;};}function handleError(_0x5d4bc,_0x1ba24a){_0x1ba24a=_0x1ba24a||0x1f4;return function(_0x2de132){logger[_0xc21c('0x27')](_0x2de132['stack']);if(_0x2de132[_0xc21c('0x28')]){delete _0x2de132[_0xc21c('0x28')];}_0x5d4bc[_0xc21c('0x17')](_0x1ba24a)[_0xc21c('0x29')](_0x2de132);};}exports[_0xc21c('0x2a')]=function(_0x50f594,_0x2aa50f){var _0x11bda4={},_0x3aece0={},_0x4863b4={'count':0x0,'rows':[]};return db[_0xc21c('0x2b')]['describe']()[_0xc21c('0x22')](function(_0x59861d){_0x3aece0['model']=_[_0xc21c('0x2c')](_0x59861d);_0x3aece0['query']=_[_0xc21c('0x2c')](_0x50f594[_0xc21c('0x2d')]);_0x3aece0['filters']=_[_0xc21c('0x2e')](_0x3aece0[_0xc21c('0x2f')],_0x3aece0[_0xc21c('0x2d')]);_0x11bda4[_0xc21c('0x30')]=_[_0xc21c('0x2e')](_0x3aece0[_0xc21c('0x2f')],qs['fields'](_0x50f594['query'][_0xc21c('0x31')]));_0x11bda4[_0xc21c('0x30')]=_0x11bda4[_0xc21c('0x30')][_0xc21c('0x32')]?_0x11bda4[_0xc21c('0x30')]:_0x3aece0[_0xc21c('0x2f')];if(!_0x50f594[_0xc21c('0x2d')][_0xc21c('0x33')](_0xc21c('0x34'))){_0x11bda4['limit']=qs[_0xc21c('0x35')](_0x50f594['query'][_0xc21c('0x35')]);_0x11bda4[_0xc21c('0x19')]=qs[_0xc21c('0x19')](_0x50f594['query'][_0xc21c('0x19')]);}_0x11bda4[_0xc21c('0x36')]=qs['sort'](_0x50f594[_0xc21c('0x2d')][_0xc21c('0x37')]);_0x11bda4[_0xc21c('0x38')]=qs['filters'](_[_0xc21c('0x39')](_0x50f594[_0xc21c('0x2d')],_0x3aece0[_0xc21c('0x3a')]),_0x59861d);if(_0x50f594['query']['filter']){_0x11bda4[_0xc21c('0x38')]=_['merge'](_0x11bda4['where'],{'$or':_[_0xc21c('0x3b')](_0x11bda4[_0xc21c('0x30')],function(_0x363751){var _0x317592={};_0x317592[_0x363751]={'$like':'%'+_0x50f594[_0xc21c('0x2d')][_0xc21c('0x3c')]+'%'};return _0x317592;})});}_0x11bda4=_['merge']({},_0x11bda4,_0x50f594['options']);var _0x51c0a0={'where':_0x11bda4[_0xc21c('0x38')]};return db[_0xc21c('0x2b')]['count'](_0x51c0a0)[_0xc21c('0x22')](function(_0x13df1a){_0x4863b4[_0xc21c('0x1b')]=_0x13df1a;if(_0x50f594[_0xc21c('0x2d')]['includeAll']){_0x11bda4[_0xc21c('0x3d')]=[{'all':!![]}];}return db[_0xc21c('0x2b')]['findAll'](_0x11bda4);})[_0xc21c('0x22')](function(_0x1555fd){_0x4863b4[_0xc21c('0x3e')]=_0x1555fd;return _0x4863b4;})[_0xc21c('0x22')](respondWithFilteredResult(_0x2aa50f,_0x11bda4))[_0xc21c('0x3f')](handleError(_0x2aa50f,null));})['catch'](handleError(_0x2aa50f,null));};exports[_0xc21c('0x40')]=function(_0x16b8d5,_0xbdbcfd){var _0x4ed635={'raw':![],'where':{'id':_0x16b8d5[_0xc21c('0x41')]['id']}},_0x5c2287={};_0x5c2287['model']=_[_0xc21c('0x2c')](db[_0xc21c('0x2b')][_0xc21c('0x42')]);_0x5c2287['query']=_[_0xc21c('0x2c')](_0x16b8d5['query']);_0x5c2287[_0xc21c('0x3a')]=_[_0xc21c('0x2e')](_0x5c2287[_0xc21c('0x2f')],_0x5c2287['query']);_0x4ed635['attributes']=_['intersection'](_0x5c2287[_0xc21c('0x2f')],qs['fields'](_0x16b8d5['query'][_0xc21c('0x31')]));_0x4ed635['attributes']=_0x4ed635[_0xc21c('0x30')][_0xc21c('0x32')]?_0x4ed635[_0xc21c('0x30')]:_0x5c2287[_0xc21c('0x2f')];if(_0x16b8d5[_0xc21c('0x2d')][_0xc21c('0x43')]){_0x4ed635[_0xc21c('0x3d')]=[{'all':!![]}];}_0x4ed635=_['merge']({},_0x4ed635,_0x16b8d5[_0xc21c('0x44')]);return db[_0xc21c('0x2b')][_0xc21c('0x45')](_0x4ed635)[_0xc21c('0x22')](handleEntityNotFound(_0xbdbcfd,null))[_0xc21c('0x22')](respondWithResult(_0xbdbcfd,null))[_0xc21c('0x3f')](handleError(_0xbdbcfd,null));};exports[_0xc21c('0x46')]=function(_0x462a85,_0x38be16){return db[_0xc21c('0x2b')][_0xc21c('0x46')](_0x462a85['body'],{})[_0xc21c('0x22')](function(_0x12d196){var _0x86997b=_0x462a85['user'][_0xc21c('0x47')]({'plain':!![]});if(!_0x86997b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x86997b[_0xc21c('0x48')]===_0xc21c('0x49')){var _0x46af38=_0x12d196[_0xc21c('0x47')]({'plain':!![]});var _0x4aac40=_0xc21c('0x24');return db[_0xc21c('0x4a')][_0xc21c('0x45')]({'where':{'name':_0x4aac40,'userProfileId':_0x86997b[_0xc21c('0x4b')]},'raw':!![]})['then'](function(_0x52c160){if(_0x52c160&&_0x52c160[_0xc21c('0x4c')]===0x0){return db['UserProfileResource'][_0xc21c('0x46')]({'name':_0x46af38[_0xc21c('0x28')],'resourceId':_0x46af38['id'],'type':_0x52c160['name'],'sectionId':_0x52c160['id']},{})[_0xc21c('0x22')](function(){return _0x12d196;});}else{return _0x12d196;}})[_0xc21c('0x3f')](function(_0x1e4983){logger[_0xc21c('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e4983);throw _0x1e4983;});}return _0x12d196;})['then'](respondWithResult(_0x38be16,0xc9))[_0xc21c('0x3f')](handleError(_0x38be16,null));};exports[_0xc21c('0x21')]=function(_0x498764,_0x5739e1){if(_0x498764[_0xc21c('0x4d')]['id']){delete _0x498764['body']['id'];}return db[_0xc21c('0x2b')][_0xc21c('0x45')]({'where':{'id':_0x498764['params']['id']}})[_0xc21c('0x22')](handleEntityNotFound(_0x5739e1,null))[_0xc21c('0x22')](saveUpdates(_0x498764['body'],null))['then'](respondWithResult(_0x5739e1,null))[_0xc21c('0x3f')](handleError(_0x5739e1,null));};exports[_0xc21c('0x23')]=function(_0x457a90,_0x2cc479){return db[_0xc21c('0x2b')][_0xc21c('0x45')]({'where':{'id':_0x457a90['params']['id']}})[_0xc21c('0x22')](handleEntityNotFound(_0x2cc479,null))[_0xc21c('0x22')](removeEntity(_0x2cc479,null))['catch'](handleError(_0x2cc479,null));};exports[_0xc21c('0x4e')]=function(_0x5742b4,_0xb0dbc4){return db['CmCompany']['describe']()['then'](respondWithResult(_0xb0dbc4,null))[_0xc21c('0x3f')](handleError(_0xb0dbc4,null));};exports[_0xc21c('0x4f')]=function(_0x1eba0a,_0x5f0681,_0x3f95e7){return db[_0xc21c('0x50')][_0xc21c('0x45')]({'where':{'id':_0x1eba0a[_0xc21c('0x41')]['id']}})[_0xc21c('0x22')](handleEntityNotFound(_0x5f0681,null))[_0xc21c('0x22')](function(_0x3a6076){if(_0x3a6076){return _0x3a6076[_0xc21c('0x4f')](_0x1eba0a['body'][_0xc21c('0x51')],_[_0xc21c('0x52')](_0x1eba0a[_0xc21c('0x4d')],[_0xc21c('0x51'),'id'])||{});}})[_0xc21c('0x22')](respondWithResult(_0x5f0681,null))['catch'](handleError(_0x5f0681,null));};exports['getContacts']=function(_0x56a091,_0x204c56,_0x173f92){var _0x4bedf8={};var _0x5778eb={};var _0x11e396;var _0x3245b2;return db[_0xc21c('0x2b')][_0xc21c('0x53')]({'where':{'id':_0x56a091[_0xc21c('0x41')]['id']}})[_0xc21c('0x22')](handleEntityNotFound(_0x204c56,null))[_0xc21c('0x22')](function(_0x56f641){if(_0x56f641){_0x11e396=_0x56f641;_0x5778eb[_0xc21c('0x2f')]=_[_0xc21c('0x2c')](db[_0xc21c('0x50')]['rawAttributes']);_0x5778eb[_0xc21c('0x2d')]=_[_0xc21c('0x2c')](_0x56a091[_0xc21c('0x2d')]);_0x5778eb[_0xc21c('0x3a')]=_[_0xc21c('0x2e')](_0x5778eb[_0xc21c('0x2f')],_0x5778eb[_0xc21c('0x2d')]);_0x4bedf8['attributes']=_[_0xc21c('0x2e')](_0x5778eb[_0xc21c('0x2f')],qs[_0xc21c('0x31')](_0x56a091['query']['fields']));_0x4bedf8[_0xc21c('0x30')]=_0x4bedf8[_0xc21c('0x30')][_0xc21c('0x32')]?_0x4bedf8[_0xc21c('0x30')]:_0x5778eb[_0xc21c('0x2f')];_0x4bedf8[_0xc21c('0x36')]=qs['sort'](_0x56a091[_0xc21c('0x2d')][_0xc21c('0x37')]);_0x4bedf8[_0xc21c('0x38')]=qs['filters'](_[_0xc21c('0x39')](_0x56a091[_0xc21c('0x2d')],_0x5778eb['filters']));if(_0x56a091[_0xc21c('0x2d')][_0xc21c('0x3c')]){_0x4bedf8['where']=_[_0xc21c('0x54')](_0x4bedf8[_0xc21c('0x38')],{'$or':_['map'](_0x4bedf8[_0xc21c('0x30')],function(_0x55d3a3){var _0x523bc3={};_0x523bc3[_0x55d3a3]={'$like':'%'+_0x56a091['query'][_0xc21c('0x3c')]+'%'};return _0x523bc3;})});}_0x4bedf8=_[_0xc21c('0x54')]({},_0x4bedf8,_0x56a091[_0xc21c('0x44')]);return _0x11e396['getContacts'](_0x4bedf8);}})[_0xc21c('0x22')](function(_0x2693bb){if(_0x2693bb){_0x3245b2=_0x2693bb[_0xc21c('0x32')];if(!_0x56a091[_0xc21c('0x2d')]['hasOwnProperty'](_0xc21c('0x34'))){_0x4bedf8[_0xc21c('0x35')]=qs['limit'](_0x56a091[_0xc21c('0x2d')]['limit']);_0x4bedf8[_0xc21c('0x19')]=qs[_0xc21c('0x19')](_0x56a091[_0xc21c('0x2d')][_0xc21c('0x19')]);}return _0x11e396[_0xc21c('0x55')](_0x4bedf8);}})[_0xc21c('0x22')](function(_0x5bae0){if(_0x5bae0){return _0x5bae0?{'count':_0x3245b2,'rows':_0x5bae0}:null;}})['then'](respondWithResult(_0x204c56,null))[_0xc21c('0x3f')](handleError(_0x204c56,null));}; \ No newline at end of file +var _0xdbe0=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','offset','limit','undefined','count','set','json','apply','reject','save','update','then','destroy','get','Companies','sendStatus','error','stack','name','send','index','CmCompany','describe','keys','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','CmContact','addContacts','ids','getContacts','findOne','length','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','squel','jsforce','desk.js'];(function(_0x21d0c3,_0x16c71c){var _0x4df18e=function(_0x576bfe){while(--_0x576bfe){_0x21d0c3['push'](_0x21d0c3['shift']());}};_0x4df18e(++_0x16c71c);}(_0xdbe0,0xf7));var _0x0dbe=function(_0xf41c55,_0x1641ee){_0xf41c55=_0xf41c55-0x0;var _0x1231bc=_0xdbe0[_0xf41c55];return _0x1231bc;};'use strict';var emlformat=require(_0x0dbe('0x0'));var rimraf=require(_0x0dbe('0x1'));var zipdir=require(_0x0dbe('0x2'));var jsonpatch=require(_0x0dbe('0x3'));var rp=require(_0x0dbe('0x4'));var moment=require(_0x0dbe('0x5'));var BPromise=require(_0x0dbe('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0dbe('0x7'));var sox=require(_0x0dbe('0x8'));var csv=require(_0x0dbe('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0dbe('0xa'));var _=require('lodash');var squel=require(_0x0dbe('0xb'));var crypto=require('crypto');var jsforce=require(_0x0dbe('0xc'));var deskjs=require(_0x0dbe('0xd'));var toCsv=require(_0x0dbe('0x9'));var querystring=require(_0x0dbe('0xe'));var Papa=require(_0x0dbe('0xf'));var Redis=require(_0x0dbe('0x10'));var authService=require(_0x0dbe('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0dbe('0x12'));var hardwareService=require(_0x0dbe('0x13'));var logger=require(_0x0dbe('0x14'))(_0x0dbe('0x15'));var utils=require('../../config/utils');var config=require(_0x0dbe('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0dbe('0x17'))['db'];function respondWithStatusCode(_0x2f52af,_0x2fb56e){_0x2fb56e=_0x2fb56e||0xcc;return function(_0x5ab76b){if(_0x5ab76b){return _0x2f52af['sendStatus'](_0x2fb56e);}return _0x2f52af[_0x0dbe('0x18')](_0x2fb56e)['end']();};}function respondWithResult(_0x4e12e2,_0x4ed2e8){_0x4ed2e8=_0x4ed2e8||0xc8;return function(_0xeeb9c7){if(_0xeeb9c7){return _0x4e12e2[_0x0dbe('0x18')](_0x4ed2e8)['json'](_0xeeb9c7);}};}function respondWithFilteredResult(_0x2b5195,_0x28ebde){return function(_0x319cc2){if(_0x319cc2){var _0x466fee=typeof _0x28ebde[_0x0dbe('0x19')]==='undefined'&&typeof _0x28ebde[_0x0dbe('0x1a')]===_0x0dbe('0x1b');var _0x166e6c=_0x319cc2['count'];var _0x5c3aa2=_0x466fee?0x0:_0x28ebde[_0x0dbe('0x19')];var _0xa4bac2=_0x466fee?_0x319cc2[_0x0dbe('0x1c')]:_0x28ebde[_0x0dbe('0x19')]+_0x28ebde[_0x0dbe('0x1a')];var _0x7abdf5;if(_0xa4bac2>=_0x166e6c){_0xa4bac2=_0x166e6c;_0x7abdf5=0xc8;}else{_0x7abdf5=0xce;}_0x2b5195[_0x0dbe('0x18')](_0x7abdf5);return _0x2b5195[_0x0dbe('0x1d')]('Content-Range',_0x5c3aa2+'-'+_0xa4bac2+'/'+_0x166e6c)[_0x0dbe('0x1e')](_0x319cc2);}return null;};}function patchUpdates(_0x372f29){return function(_0x6435ba){try{jsonpatch[_0x0dbe('0x1f')](_0x6435ba,_0x372f29,!![]);}catch(_0x1df7db){return BPromise[_0x0dbe('0x20')](_0x1df7db);}return _0x6435ba[_0x0dbe('0x21')]();};}function saveUpdates(_0x58928a,_0x33a23e){return function(_0x320371){if(_0x320371){return _0x320371[_0x0dbe('0x22')](_0x58928a)[_0x0dbe('0x23')](function(_0x27deeb){return _0x27deeb;});}return null;};}function removeEntity(_0x5b4640,_0x5df93f){return function(_0x13d686){if(_0x13d686){return _0x13d686[_0x0dbe('0x24')]()['then'](function(){var _0x512d38=_0x13d686[_0x0dbe('0x25')]({'plain':!![]});var _0x1f10f3=_0x0dbe('0x26');return db['UserProfileResource'][_0x0dbe('0x24')]({'where':{'type':_0x1f10f3,'resourceId':_0x512d38['id']}})[_0x0dbe('0x23')](function(){return _0x13d686;});})[_0x0dbe('0x23')](function(){_0x5b4640[_0x0dbe('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xce792e,_0x3c19df){return function(_0x489b36){if(!_0x489b36){_0xce792e[_0x0dbe('0x27')](0x194);}return _0x489b36;};}function handleError(_0x31a227,_0x5cc04d){_0x5cc04d=_0x5cc04d||0x1f4;return function(_0x25ec9e){logger[_0x0dbe('0x28')](_0x25ec9e[_0x0dbe('0x29')]);if(_0x25ec9e[_0x0dbe('0x2a')]){delete _0x25ec9e[_0x0dbe('0x2a')];}_0x31a227['status'](_0x5cc04d)[_0x0dbe('0x2b')](_0x25ec9e);};}exports[_0x0dbe('0x2c')]=function(_0x120e95,_0x5ccc5b){var _0x44a5c9={},_0xa630ef={},_0x5f4090={'count':0x0,'rows':[]};return db[_0x0dbe('0x2d')][_0x0dbe('0x2e')]()['then'](function(_0x469e94){_0xa630ef['model']=_[_0x0dbe('0x2f')](_0x469e94);_0xa630ef[_0x0dbe('0x30')]=_['keys'](_0x120e95[_0x0dbe('0x30')]);_0xa630ef['filters']=_[_0x0dbe('0x31')](_0xa630ef[_0x0dbe('0x32')],_0xa630ef[_0x0dbe('0x30')]);_0x44a5c9[_0x0dbe('0x33')]=_[_0x0dbe('0x31')](_0xa630ef[_0x0dbe('0x32')],qs['fields'](_0x120e95[_0x0dbe('0x30')][_0x0dbe('0x34')]));_0x44a5c9[_0x0dbe('0x33')]=_0x44a5c9['attributes']['length']?_0x44a5c9[_0x0dbe('0x33')]:_0xa630ef[_0x0dbe('0x32')];if(!_0x120e95[_0x0dbe('0x30')][_0x0dbe('0x35')](_0x0dbe('0x36'))){_0x44a5c9['limit']=qs[_0x0dbe('0x1a')](_0x120e95[_0x0dbe('0x30')][_0x0dbe('0x1a')]);_0x44a5c9[_0x0dbe('0x19')]=qs['offset'](_0x120e95['query'][_0x0dbe('0x19')]);}_0x44a5c9[_0x0dbe('0x37')]=qs[_0x0dbe('0x38')](_0x120e95['query'][_0x0dbe('0x38')]);_0x44a5c9[_0x0dbe('0x39')]=qs[_0x0dbe('0x3a')](_[_0x0dbe('0x3b')](_0x120e95[_0x0dbe('0x30')],_0xa630ef[_0x0dbe('0x3a')]),_0x469e94);if(_0x120e95['query'][_0x0dbe('0x3c')]){_0x44a5c9[_0x0dbe('0x39')]=_[_0x0dbe('0x3d')](_0x44a5c9['where'],{'$or':_[_0x0dbe('0x3e')](_0x44a5c9[_0x0dbe('0x33')],function(_0x34e3ad){var _0x5203a7={};_0x5203a7[_0x34e3ad]={'$like':'%'+_0x120e95[_0x0dbe('0x30')][_0x0dbe('0x3c')]+'%'};return _0x5203a7;})});}_0x44a5c9=_[_0x0dbe('0x3d')]({},_0x44a5c9,_0x120e95['options']);var _0x4366dc={'where':_0x44a5c9[_0x0dbe('0x39')]};return db[_0x0dbe('0x2d')][_0x0dbe('0x1c')](_0x4366dc)[_0x0dbe('0x23')](function(_0x37288f){_0x5f4090['count']=_0x37288f;if(_0x120e95['query'][_0x0dbe('0x3f')]){_0x44a5c9[_0x0dbe('0x40')]=[{'all':!![]}];}return db[_0x0dbe('0x2d')][_0x0dbe('0x41')](_0x44a5c9);})[_0x0dbe('0x23')](function(_0x49d383){_0x5f4090[_0x0dbe('0x42')]=_0x49d383;return _0x5f4090;})[_0x0dbe('0x23')](respondWithFilteredResult(_0x5ccc5b,_0x44a5c9))[_0x0dbe('0x43')](handleError(_0x5ccc5b,null));})['catch'](handleError(_0x5ccc5b,null));};exports['show']=function(_0x160984,_0x7f2f81){var _0x1099fe={'raw':![],'where':{'id':_0x160984[_0x0dbe('0x44')]['id']}},_0x3421c1={};_0x3421c1['model']=_[_0x0dbe('0x2f')](db[_0x0dbe('0x2d')][_0x0dbe('0x45')]);_0x3421c1[_0x0dbe('0x30')]=_[_0x0dbe('0x2f')](_0x160984['query']);_0x3421c1[_0x0dbe('0x3a')]=_[_0x0dbe('0x31')](_0x3421c1[_0x0dbe('0x32')],_0x3421c1[_0x0dbe('0x30')]);_0x1099fe[_0x0dbe('0x33')]=_[_0x0dbe('0x31')](_0x3421c1[_0x0dbe('0x32')],qs['fields'](_0x160984[_0x0dbe('0x30')][_0x0dbe('0x34')]));_0x1099fe[_0x0dbe('0x33')]=_0x1099fe['attributes']['length']?_0x1099fe[_0x0dbe('0x33')]:_0x3421c1['model'];if(_0x160984[_0x0dbe('0x30')][_0x0dbe('0x3f')]){_0x1099fe[_0x0dbe('0x40')]=[{'all':!![]}];}_0x1099fe=_[_0x0dbe('0x3d')]({},_0x1099fe,_0x160984[_0x0dbe('0x46')]);return db['CmCompany'][_0x0dbe('0x47')](_0x1099fe)['then'](handleEntityNotFound(_0x7f2f81,null))[_0x0dbe('0x23')](respondWithResult(_0x7f2f81,null))[_0x0dbe('0x43')](handleError(_0x7f2f81,null));};exports[_0x0dbe('0x48')]=function(_0x42783a,_0x4ff7e8){return db[_0x0dbe('0x2d')][_0x0dbe('0x48')](_0x42783a['body'],{})[_0x0dbe('0x23')](function(_0x4566de){var _0x29d5e7=_0x42783a['user'][_0x0dbe('0x25')]({'plain':!![]});if(!_0x29d5e7)throw new Error(_0x0dbe('0x49'));if(_0x29d5e7['role']===_0x0dbe('0x4a')){var _0x20146a=_0x4566de[_0x0dbe('0x25')]({'plain':!![]});var _0x441b81='Companies';return db[_0x0dbe('0x4b')][_0x0dbe('0x47')]({'where':{'name':_0x441b81,'userProfileId':_0x29d5e7[_0x0dbe('0x4c')]},'raw':!![]})[_0x0dbe('0x23')](function(_0x3f52bb){if(_0x3f52bb&&_0x3f52bb[_0x0dbe('0x4d')]===0x0){return db[_0x0dbe('0x4e')][_0x0dbe('0x48')]({'name':_0x20146a['name'],'resourceId':_0x20146a['id'],'type':_0x3f52bb[_0x0dbe('0x2a')],'sectionId':_0x3f52bb['id']},{})[_0x0dbe('0x23')](function(){return _0x4566de;});}else{return _0x4566de;}})['catch'](function(_0x4fc1ac){logger[_0x0dbe('0x28')](_0x0dbe('0x4f'),_0x4fc1ac);throw _0x4fc1ac;});}return _0x4566de;})['then'](respondWithResult(_0x4ff7e8,0xc9))[_0x0dbe('0x43')](handleError(_0x4ff7e8,null));};exports[_0x0dbe('0x22')]=function(_0xace2b7,_0x3137c2){if(_0xace2b7[_0x0dbe('0x50')]['id']){delete _0xace2b7[_0x0dbe('0x50')]['id'];}return db[_0x0dbe('0x2d')][_0x0dbe('0x47')]({'where':{'id':_0xace2b7[_0x0dbe('0x44')]['id']}})[_0x0dbe('0x23')](handleEntityNotFound(_0x3137c2,null))['then'](saveUpdates(_0xace2b7[_0x0dbe('0x50')],null))[_0x0dbe('0x23')](respondWithResult(_0x3137c2,null))[_0x0dbe('0x43')](handleError(_0x3137c2,null));};exports[_0x0dbe('0x24')]=function(_0x326ea7,_0x2ae89f){return db[_0x0dbe('0x2d')]['find']({'where':{'id':_0x326ea7[_0x0dbe('0x44')]['id']}})[_0x0dbe('0x23')](handleEntityNotFound(_0x2ae89f,null))[_0x0dbe('0x23')](removeEntity(_0x2ae89f,null))['catch'](handleError(_0x2ae89f,null));};exports[_0x0dbe('0x2e')]=function(_0x28162b,_0x39902d){return db[_0x0dbe('0x2d')][_0x0dbe('0x2e')]()[_0x0dbe('0x23')](respondWithResult(_0x39902d,null))[_0x0dbe('0x43')](handleError(_0x39902d,null));};exports['addContacts']=function(_0x1c2bc4,_0x20ab05,_0x15fb0f){return db[_0x0dbe('0x51')][_0x0dbe('0x47')]({'where':{'id':_0x1c2bc4[_0x0dbe('0x44')]['id']}})[_0x0dbe('0x23')](handleEntityNotFound(_0x20ab05,null))['then'](function(_0x2a1b99){if(_0x2a1b99){return _0x2a1b99[_0x0dbe('0x52')](_0x1c2bc4[_0x0dbe('0x50')][_0x0dbe('0x53')],_['omit'](_0x1c2bc4['body'],[_0x0dbe('0x53'),'id'])||{});}})[_0x0dbe('0x23')](respondWithResult(_0x20ab05,null))[_0x0dbe('0x43')](handleError(_0x20ab05,null));};exports[_0x0dbe('0x54')]=function(_0x2de24f,_0x297232,_0x1552be){var _0x564655={};var _0x24b122={};var _0x1bbb00;var _0x150407;return db['CmCompany'][_0x0dbe('0x55')]({'where':{'id':_0x2de24f['params']['id']}})[_0x0dbe('0x23')](handleEntityNotFound(_0x297232,null))[_0x0dbe('0x23')](function(_0x756c44){if(_0x756c44){_0x1bbb00=_0x756c44;_0x24b122['model']=_[_0x0dbe('0x2f')](db['CmContact'][_0x0dbe('0x45')]);_0x24b122[_0x0dbe('0x30')]=_[_0x0dbe('0x2f')](_0x2de24f[_0x0dbe('0x30')]);_0x24b122[_0x0dbe('0x3a')]=_[_0x0dbe('0x31')](_0x24b122['model'],_0x24b122[_0x0dbe('0x30')]);_0x564655[_0x0dbe('0x33')]=_['intersection'](_0x24b122[_0x0dbe('0x32')],qs[_0x0dbe('0x34')](_0x2de24f['query'][_0x0dbe('0x34')]));_0x564655['attributes']=_0x564655[_0x0dbe('0x33')]['length']?_0x564655['attributes']:_0x24b122[_0x0dbe('0x32')];_0x564655[_0x0dbe('0x37')]=qs[_0x0dbe('0x38')](_0x2de24f['query'][_0x0dbe('0x38')]);_0x564655[_0x0dbe('0x39')]=qs[_0x0dbe('0x3a')](_['pick'](_0x2de24f[_0x0dbe('0x30')],_0x24b122[_0x0dbe('0x3a')]));if(_0x2de24f[_0x0dbe('0x30')][_0x0dbe('0x3c')]){_0x564655['where']=_[_0x0dbe('0x3d')](_0x564655[_0x0dbe('0x39')],{'$or':_[_0x0dbe('0x3e')](_0x564655[_0x0dbe('0x33')],function(_0x1dbda8){var _0xc0a0bb={};_0xc0a0bb[_0x1dbda8]={'$like':'%'+_0x2de24f['query'][_0x0dbe('0x3c')]+'%'};return _0xc0a0bb;})});}_0x564655=_[_0x0dbe('0x3d')]({},_0x564655,_0x2de24f[_0x0dbe('0x46')]);return _0x1bbb00[_0x0dbe('0x54')](_0x564655);}})[_0x0dbe('0x23')](function(_0x39b007){if(_0x39b007){_0x150407=_0x39b007[_0x0dbe('0x56')];if(!_0x2de24f['query'][_0x0dbe('0x35')]('nolimit')){_0x564655['limit']=qs['limit'](_0x2de24f[_0x0dbe('0x30')][_0x0dbe('0x1a')]);_0x564655[_0x0dbe('0x19')]=qs['offset'](_0x2de24f['query']['offset']);}return _0x1bbb00[_0x0dbe('0x54')](_0x564655);}})[_0x0dbe('0x23')](function(_0x54ab25){if(_0x54ab25){return _0x54ab25?{'count':_0x150407,'rows':_0x54ab25}:null;}})[_0x0dbe('0x23')](respondWithResult(_0x297232,null))[_0x0dbe('0x43')](handleError(_0x297232,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 084e931..436ceee 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 _0xf6d6=['cm_companies','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany'];(function(_0x2ca69c,_0x48a947){var _0x5bef30=function(_0x286ee8){while(--_0x286ee8){_0x2ca69c['push'](_0x2ca69c['shift']());}};_0x5bef30(++_0x48a947);}(_0xf6d6,0x187));var _0x6f6d=function(_0x373aff,_0x3503d0){_0x373aff=_0x373aff-0x0;var _0x3aefe5=_0xf6d6[_0x373aff];return _0x3aefe5;};'use strict';var _=require(_0x6f6d('0x0'));var util=require(_0x6f6d('0x1'));var logger=require(_0x6f6d('0x2'))(_0x6f6d('0x3'));var moment=require(_0x6f6d('0x4'));var BPromise=require(_0x6f6d('0x5'));var rp=require(_0x6f6d('0x6'));var fs=require('fs');var path=require(_0x6f6d('0x7'));var rimraf=require(_0x6f6d('0x8'));var config=require(_0x6f6d('0x9'));var attributes=require(_0x6f6d('0xa'));module[_0x6f6d('0xb')]=function(_0x3903ad,_0x55f2ce){return _0x3903ad[_0x6f6d('0xc')](_0x6f6d('0xd'),attributes,{'tableName':_0x6f6d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf472=['define','util','../../config/logger','api','moment','bluebird','path','rimraf','./cmCompany.attributes','exports'];(function(_0x45d48a,_0xc2538f){var _0x93e5d0=function(_0x2524f6){while(--_0x2524f6){_0x45d48a['push'](_0x45d48a['shift']());}};_0x93e5d0(++_0xc2538f);}(_0xf472,0x141));var _0x2f47=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf472[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x2f47('0x0'));var logger=require(_0x2f47('0x1'))(_0x2f47('0x2'));var moment=require(_0x2f47('0x3'));var BPromise=require(_0x2f47('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2f47('0x5'));var rimraf=require(_0x2f47('0x6'));var config=require('../../config/environment');var attributes=require(_0x2f47('0x7'));module[_0x2f47('0x8')]=function(_0x207b63,_0x30610e){return _0x207b63[_0x2f47('0x9')]('CmCompany',attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 2479209..04b21c5 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 _0x867b=['message','CmCompany,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','debug','request\x20sent','stringify','error','code'];(function(_0x51bcfd,_0x2cd90c){var _0x2c5c37=function(_0x2cf816){while(--_0x2cf816){_0x51bcfd['push'](_0x51bcfd['shift']());}};_0x2c5c37(++_0x2cd90c);}(_0x867b,0xa5));var _0xb867=function(_0x8a668f,_0x597efb){_0x8a668f=_0x8a668f-0x0;var _0x5673a9=_0x867b[_0x8a668f];return _0x5673a9;};'use strict';var _=require(_0xb867('0x0'));var util=require(_0xb867('0x1'));var moment=require(_0xb867('0x2'));var BPromise=require(_0xb867('0x3'));var rs=require(_0xb867('0x4'));var fs=require('fs');var Redis=require(_0xb867('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb867('0x6'));var logger=require(_0xb867('0x7'))(_0xb867('0x8'));var config=require(_0xb867('0x9'));var jayson=require(_0xb867('0xa'));var client=jayson[_0xb867('0xb')][_0xb867('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3fa55e,_0x22ee73,_0xbfc141){return new BPromise(function(_0x3964ac,_0x395b34){return client['request'](_0x3fa55e,_0xbfc141)['then'](function(_0x3355d2){logger[_0xb867('0xd')]('CmCompany,\x20%s,\x20%s',_0x22ee73,'request\x20sent');logger[_0xb867('0xe')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x22ee73,_0xb867('0xf'),JSON[_0xb867('0x10')](_0x3355d2));if(_0x3355d2[_0xb867('0x11')]){if(_0x3355d2[_0xb867('0x11')][_0xb867('0x12')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x22ee73,_0x3355d2[_0xb867('0x11')][_0xb867('0x13')]);return _0x395b34(_0x3355d2['error'][_0xb867('0x13')]);}logger[_0xb867('0x11')](_0xb867('0x14'),_0x22ee73,_0x3355d2['error'][_0xb867('0x13')]);return _0x3964ac(_0x3355d2[_0xb867('0x11')][_0xb867('0x13')]);}else{logger[_0xb867('0xd')]('CmCompany,\x20%s,\x20%s',_0x22ee73,_0xb867('0xf'));_0x3964ac(_0x3355d2[_0xb867('0x15')][_0xb867('0x13')]);}})[_0xb867('0x16')](function(_0xd45d60){logger[_0xb867('0x11')](_0xb867('0x14'),_0x22ee73,_0xd45d60);_0x395b34(_0xd45d60);});});} \ No newline at end of file +var _0xac56=['client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x36feba,_0x541932){var _0x358e41=function(_0x3dc247){while(--_0x3dc247){_0x36feba['push'](_0x36feba['shift']());}};_0x358e41(++_0x541932);}(_0xac56,0x186));var _0x6ac5=function(_0x2f8513,_0x26ee12){_0x2f8513=_0x2f8513-0x0;var _0x333a9b=_0xac56[_0x2f8513];return _0x333a9b;};'use strict';var _=require(_0x6ac5('0x0'));var util=require(_0x6ac5('0x1'));var moment=require('moment');var BPromise=require(_0x6ac5('0x2'));var rs=require(_0x6ac5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ac5('0x4'))['db'];var utils=require(_0x6ac5('0x5'));var logger=require(_0x6ac5('0x6'))(_0x6ac5('0x7'));var config=require(_0x6ac5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6ac5('0x9')][_0x6ac5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22583a,_0x3eadcc,_0x541a40){return new BPromise(function(_0x22d2f7,_0xe30db5){return client[_0x6ac5('0xb')](_0x22583a,_0x541a40)[_0x6ac5('0xc')](function(_0x5ae8be){logger[_0x6ac5('0xd')](_0x6ac5('0xe'),_0x3eadcc,_0x6ac5('0xf'));logger[_0x6ac5('0x10')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x3eadcc,_0x6ac5('0xf'),JSON['stringify'](_0x5ae8be));if(_0x5ae8be['error']){if(_0x5ae8be[_0x6ac5('0x11')][_0x6ac5('0x12')]===0x1f4){logger[_0x6ac5('0x11')](_0x6ac5('0xe'),_0x3eadcc,_0x5ae8be[_0x6ac5('0x11')][_0x6ac5('0x13')]);return _0xe30db5(_0x5ae8be[_0x6ac5('0x11')][_0x6ac5('0x13')]);}logger[_0x6ac5('0x11')](_0x6ac5('0xe'),_0x3eadcc,_0x5ae8be[_0x6ac5('0x11')][_0x6ac5('0x13')]);return _0x22d2f7(_0x5ae8be['error'][_0x6ac5('0x13')]);}else{logger[_0x6ac5('0xd')]('CmCompany,\x20%s,\x20%s',_0x3eadcc,_0x6ac5('0xf'));_0x22d2f7(_0x5ae8be['result'][_0x6ac5('0x13')]);}})[_0x6ac5('0x14')](function(_0x4226fe){logger['error'](_0x6ac5('0xe'),_0x3eadcc,_0x4226fe);_0xe30db5(_0x4226fe);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 8fe6c75..19eaf53 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 _0x7a33=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/contacts','getContacts','create','post','addContacts','put','update','delete','destroy','exports','multer','connect-timeout','express'];(function(_0x4c9375,_0xc0f09e){var _0x3e62af=function(_0x5531ec){while(--_0x5531ec){_0x4c9375['push'](_0x4c9375['shift']());}};_0x3e62af(++_0xc0f09e);}(_0x7a33,0x1d8));var _0x37a3=function(_0x59aced,_0x3ec5c2){_0x59aced=_0x59aced-0x0;var _0x523e1c=_0x7a33[_0x59aced];return _0x523e1c;};'use strict';var multer=require(_0x37a3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x37a3('0x1'));var express=require(_0x37a3('0x2'));var router=express[_0x37a3('0x3')]();var fs_extra=require(_0x37a3('0x4'));var auth=require(_0x37a3('0x5'));var interaction=require(_0x37a3('0x6'));var config=require(_0x37a3('0x7'));var controller=require(_0x37a3('0x8'));router['get']('/',auth[_0x37a3('0x9')](),controller[_0x37a3('0xa')]);router[_0x37a3('0xb')](_0x37a3('0xc'),auth[_0x37a3('0x9')](),controller[_0x37a3('0xd')]);router[_0x37a3('0xb')](_0x37a3('0xe'),auth[_0x37a3('0x9')](),controller['show']);router[_0x37a3('0xb')](_0x37a3('0xf'),auth['isAuthenticated'](),controller[_0x37a3('0x10')]);router['post']('/',auth[_0x37a3('0x9')](),controller[_0x37a3('0x11')]);router[_0x37a3('0x12')](_0x37a3('0xf'),auth[_0x37a3('0x9')](),controller[_0x37a3('0x13')]);router[_0x37a3('0x14')](_0x37a3('0xe'),auth[_0x37a3('0x9')](),controller[_0x37a3('0x15')]);router[_0x37a3('0x16')](_0x37a3('0xe'),auth[_0x37a3('0x9')](),controller[_0x37a3('0x17')]);module[_0x37a3('0x18')]=router; \ No newline at end of file +var _0x5010=['fs-extra','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','/:id','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x5010,0x102));var _0x0501=function(_0x31551d,_0x611664){_0x31551d=_0x31551d-0x0;var _0x45837e=_0x5010[_0x31551d];return _0x45837e;};'use strict';var multer=require(_0x0501('0x0'));var util=require(_0x0501('0x1'));var path=require(_0x0501('0x2'));var timeout=require(_0x0501('0x3'));var express=require(_0x0501('0x4'));var router=express[_0x0501('0x5')]();var fs_extra=require(_0x0501('0x6'));var auth=require(_0x0501('0x7'));var interaction=require(_0x0501('0x8'));var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0x0501('0x9')]('/',auth['isAuthenticated'](),controller[_0x0501('0xa')]);router[_0x0501('0x9')]('/describe',auth[_0x0501('0xb')](),controller['describe']);router['get'](_0x0501('0xc'),auth[_0x0501('0xb')](),controller['show']);router['get'](_0x0501('0xd'),auth['isAuthenticated'](),controller[_0x0501('0xe')]);router[_0x0501('0xf')]('/',auth[_0x0501('0xb')](),controller[_0x0501('0x10')]);router['post'](_0x0501('0xd'),auth['isAuthenticated'](),controller[_0x0501('0x11')]);router[_0x0501('0x12')](_0x0501('0xc'),auth['isAuthenticated'](),controller[_0x0501('0x13')]);router[_0x0501('0x14')](_0x0501('0xc'),auth[_0x0501('0xb')](),controller['destroy']);module[_0x0501('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index bac1689..840894d 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 _0x3728=['DATE','NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x469b7d,_0x4760f8){var _0xc78a4b=function(_0xd48e6c){while(--_0xd48e6c){_0x469b7d['push'](_0x469b7d['shift']());}};_0xc78a4b(++_0x4760f8);}(_0x3728,0x1cd));var _0x8372=function(_0x3e331b,_0x872e01){_0x3e331b=_0x3e331b-0x0;var _0x1813e6=_0x3728[_0x3e331b];return _0x1813e6;};'use strict';var _=require(_0x8372('0x0'));var Sequelize=require(_0x8372('0x1'));module[_0x8372('0x2')]={'firstName':{'type':Sequelize[_0x8372('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x8372('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x8372('0x3')]},'city':{'type':Sequelize[_0x8372('0x3')]},'country':{'type':Sequelize[_0x8372('0x3')]},'dateOfBirth':{'type':Sequelize[_0x8372('0x3')]},'description':{'type':Sequelize[_0x8372('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x8372('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x8372('0x3')]},'facebook':{'type':Sequelize[_0x8372('0x3')]},'fb_data':{'type':Sequelize[_0x8372('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x8372('0x3')]},'teams':{'type':Sequelize[_0x8372('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x8372('0x3')]},'wechat':{'type':Sequelize[_0x8372('0x3')]},'telegram':{'type':Sequelize[_0x8372('0x3')]},'UserId':{'type':Sequelize[_0x8372('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x8372('0x3')]},'priority':{'type':Sequelize[_0x8372('0x5')](0x2)[_0x8372('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x8372('0x7')],'defaultValue':Sequelize[_0x8372('0x8')]},'dialTimezone':{'type':Sequelize[_0x8372('0x3')]},'utcOffset':{'type':Sequelize[_0x8372('0x5')]}}; \ No newline at end of file +var _0x002c=['TEXT','INTEGER','UNSIGNED','DATE','NOW','sequelize','exports','STRING'];(function(_0x16629d,_0x492375){var _0x56ccee=function(_0xa982b7){while(--_0xa982b7){_0x16629d['push'](_0x16629d['shift']());}};_0x56ccee(++_0x492375);}(_0x002c,0x9d));var _0xc002=function(_0x1efa5c,_0x4deafb){_0x1efa5c=_0x1efa5c-0x0;var _0x4f8376=_0x002c[_0x1efa5c];return _0x4f8376;};'use strict';var _=require('lodash');var Sequelize=require(_0xc002('0x0'));module[_0xc002('0x1')]={'firstName':{'type':Sequelize[_0xc002('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xc002('0x2')]},'street':{'type':Sequelize[_0xc002('0x2')]},'postalCode':{'type':Sequelize[_0xc002('0x2')]},'city':{'type':Sequelize[_0xc002('0x2')]},'country':{'type':Sequelize[_0xc002('0x2')]},'dateOfBirth':{'type':Sequelize[_0xc002('0x2')]},'description':{'type':Sequelize[_0xc002('0x3')]},'phone':{'type':Sequelize[_0xc002('0x2')]},'mobile':{'type':Sequelize[_0xc002('0x2')]},'fax':{'type':Sequelize[_0xc002('0x2')]},'email':{'type':Sequelize[_0xc002('0x2')]},'url':{'type':Sequelize[_0xc002('0x2')]},'facebook':{'type':Sequelize[_0xc002('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xc002('0x2')]},'teams':{'type':Sequelize[_0xc002('0x2')]},'viber':{'type':Sequelize[_0xc002('0x2')]},'line':{'type':Sequelize[_0xc002('0x2')]},'wechat':{'type':Sequelize[_0xc002('0x2')]},'telegram':{'type':Sequelize[_0xc002('0x2')]},'UserId':{'type':Sequelize[_0xc002('0x4')]},'AdditionalPhones':{'type':Sequelize[_0xc002('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xc002('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xc002('0x6')],'defaultValue':Sequelize[_0xc002('0x7')]},'dialTimezone':{'type':Sequelize[_0xc002('0x2')]},'utcOffset':{'type':Sequelize[_0xc002('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 045f880..740d64f 100644 --- a/server/api/cmContact/cmContact.controller.js +++ b/server/api/cmContact/cmContact.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file +var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x1d6a82,_0x37c315){var _0x5834ac=function(_0x2402ba){while(--_0x2402ba){_0x1d6a82['push'](_0x1d6a82['shift']());}};_0x5834ac(++_0x37c315);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index f75dbde..7e40628 100644 --- a/server/api/cmContact/cmContact.events.js +++ b/server/api/cmContact/cmContact.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0c97=['CmContact','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0c97,0x174));var _0x70c9=function(_0x435044,_0x36ab8e){_0x435044=_0x435044-0x0;var _0x33d4c6=_0x0c97[_0x435044];return _0x33d4c6;};'use strict';var EventEmitter=require(_0x70c9('0x0'));var CmContact=require(_0x70c9('0x1'))['db'][_0x70c9('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x70c9('0x3')](0x0);var events={'afterCreate':_0x70c9('0x4'),'afterUpdate':_0x70c9('0x5'),'afterDestroy':_0x70c9('0x6')};function emitEvent(_0x385fcd){return function(_0x5da0e6,_0x4e6295,_0x17857f){CmContactEvents[_0x70c9('0x7')](_0x385fcd+':'+_0x5da0e6['id'],_0x5da0e6);CmContactEvents['emit'](_0x385fcd,_0x5da0e6);_0x17857f(null);};}for(var e in events){if(events[_0x70c9('0x8')](e)){var event=events[e];CmContact[_0x70c9('0x9')](e,emitEvent(event));}}module[_0x70c9('0xa')]=CmContactEvents; \ No newline at end of file +var _0xe984=['save','update','emit','hasOwnProperty','exports','events','../../mysqldb','CmContact','setMaxListeners'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0xe984,0x1f4));var _0x4e98=function(_0xe39824,_0xbdf61f){_0xe39824=_0xe39824-0x0;var _0x4bc31e=_0xe984[_0xe39824];return _0x4bc31e;};'use strict';var EventEmitter=require(_0x4e98('0x0'));var CmContact=require(_0x4e98('0x1'))['db'][_0x4e98('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x4e98('0x3')](0x0);var events={'afterCreate':_0x4e98('0x4'),'afterUpdate':_0x4e98('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1159ff){return function(_0x5c2b32,_0x2ba818,_0x1e03be){CmContactEvents[_0x4e98('0x6')](_0x1159ff+':'+_0x5c2b32['id'],_0x5c2b32);CmContactEvents[_0x4e98('0x6')](_0x1159ff,_0x5c2b32);_0x1e03be(null);};}for(var e in events){if(events[_0x4e98('0x7')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0x4e98('0x8')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 6f67d3b..e3ac6a2 100644 --- a/server/api/cmContact/cmContact.model.js +++ b/server/api/cmContact/cmContact.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e9a=['util','../../config/logger','moment','request-promise','path','../../config/environment/shared','./cmContact.attributes','exports','define','cm_contacts','phone','fti_cm_contacts','lastName','mobile','fax','utf8mb4','utf8mb4_unicode_ci','models','get','error','afterCreate','inspect','scheduledat','YYYY-MM-DD\x20HH:mm:ss','findOne','then','isNil','dialTimezone','timezones','utcOffset','add','minutes','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','ListId','priority','format','callbackUniqueid','catch','ret','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','create','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','VoiceQueue','outbound','dialCheckDuplicateType','Lists','length','findAll','CmHopperBlack','message','CmList','always','onlyIfOpen','BlackLists','List\x20not\x20found','destroy','ContactId','VoiceQueueId','push','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]'];(function(_0x172bd2,_0x1b01e4){var _0x2530ec=function(_0x46508e){while(--_0x46508e){_0x172bd2['push'](_0x172bd2['shift']());}};_0x2530ec(++_0x1b01e4);}(_0x6e9a,0x8c));var _0xa6e9=function(_0x52d303,_0x26f460){_0x52d303=_0x52d303-0x0;var _0x42d1c6=_0x6e9a[_0x52d303];return _0x42d1c6;};'use strict';var _=require('lodash');var util=require(_0xa6e9('0x0'));var logger=require(_0xa6e9('0x1'))('api');var moment=require(_0xa6e9('0x2'));var BPromise=require('bluebird');var rp=require(_0xa6e9('0x3'));var fs=require('fs');var path=require(_0xa6e9('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var shared=require(_0xa6e9('0x5'));var attributes=require(_0xa6e9('0x6'));module[_0xa6e9('0x7')]=function(_0x14e93b,_0x53efcc){return _0x14e93b[_0xa6e9('0x8')]('CmContact',attributes,{'tableName':_0xa6e9('0x9'),'paranoid':!![],'indexes':[{'name':_0xa6e9('0xa'),'fields':[_0xa6e9('0xa')]},{'name':_0xa6e9('0xb'),'fields':['firstName',_0xa6e9('0xc'),_0xa6e9('0xa'),_0xa6e9('0xd'),_0xa6e9('0xe'),'email'],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0xa6e9('0xf'),'collate':_0xa6e9('0x10'),'hooks':{'afterCreate':function(_0x2224ee,_0x4e8c6d,_0x361770){var _0x3ec6db=_0x14e93b[_0xa6e9('0x11')];var _0xf1eb76=_0x2224ee[_0xa6e9('0x12')]({'plain':!![]});function _0x42efb5(){return function(_0x28f430){logger[_0xa6e9('0x13')]('cmContact',_0xa6e9('0x14'),util[_0xa6e9('0x15')](_0x28f430,{'showHidden':![],'depth':null}));};}function _0x29ffeb(_0x5814b0,_0x420113){var _0x2a3ce2=_0x420113['scheduledat']?_0x420113[_0xa6e9('0x16')]:moment()['format'](_0xa6e9('0x17'));return new BPromise(function(_0x399005,_0xe5c305){if(_['isNil'](_0x420113['dialTimezone'])){_0x399005({'ret':_0x2a3ce2});}else{_0x3ec6db['VoiceQueue'][_0xa6e9('0x18')]({'where':{'id':_0x5814b0['id']}})[_0xa6e9('0x19')](function(_0xa1f5da){if(!_[_0xa6e9('0x1a')](_0xa1f5da)){var _0x437b00=_0xa1f5da[_0xa6e9('0x1b')];if(!_[_0xa6e9('0x1a')](_0x437b00)){var _0x4dd8d8=shared[_0xa6e9('0x1c')];var _0x24747e=_0x4dd8d8[_0x437b00];var _0x4a1e24=_0x4dd8d8[_0x420113['dialTimezone']];if(!_['isNil'](_0x24747e)&&!_['isNil'](_0x4a1e24)){var _0x341213=_0x24747e['utcOffset']-_0x4a1e24[_0xa6e9('0x1d')];_0x2a3ce2=_0x420113[_0xa6e9('0x16')]?_0x420113[_0xa6e9('0x16')]:moment();var _0x45ee04=moment(_0x2a3ce2)[_0xa6e9('0x1e')](_0x341213,_0xa6e9('0x1f'));_0x399005({'ret':_0x45ee04['format']('YYYY-MM-DD\x20HH:mm:ss')});}else _0x399005({'ret':_0x2a3ce2});}else _0x399005({'ret':_0x2a3ce2});}else{_0x399005({'ret':_0x2a3ce2});}});}});return 0xa;}var _0x16efbe=function(_0x3761f6){return new BPromise(function(_0x337122,_0x3ef32c){_0x29ffeb(_0x3761f6,_0xf1eb76)['then'](function(_0x2fc32a){_0xf1eb76['scheduledat']=_0x2fc32a['ret'];_0x3ec6db['CmHopper'][_0xa6e9('0x18')]({'where':{'phone':_0xf1eb76[_0xa6e9('0xa')],'VoiceQueueId':_0x3761f6['id']}})[_0xa6e9('0x19')](function(_0x11cdfb){if(!_[_0xa6e9('0x1a')](_0x11cdfb)){throw new Error(_0xa6e9('0x20')+_0xf1eb76[_0xa6e9('0xa')]+_0xa6e9('0x21')+_0x3761f6['id']);}return _0x3ec6db[_0xa6e9('0x22')]['create']({'phone':_0xf1eb76[_0xa6e9('0xa')],'ContactId':_0xf1eb76['id'],'ListId':_0xf1eb76[_0xa6e9('0x23')],'priority':_0xf1eb76[_0xa6e9('0x24')]?_0xf1eb76[_0xa6e9('0x24')]:0x2,'scheduledat':_0xf1eb76[_0xa6e9('0x16')]?_0xf1eb76[_0xa6e9('0x16')]:moment()[_0xa6e9('0x25')](_0xa6e9('0x17')),'callback':_0xf1eb76[_0xa6e9('0x26')]?!![]:![],'callbackuniqueid':_0xf1eb76[_0xa6e9('0x26')]?_0xf1eb76[_0xa6e9('0x26')]:undefined,'callbackat':_0xf1eb76[_0xa6e9('0x26')]?moment()[_0xa6e9('0x25')](_0xa6e9('0x17')):undefined,'VoiceQueueId':_0x3761f6['id']});})[_0xa6e9('0x27')](function(_0x178d05){_0x3ef32c(_0x178d05);});});});};var _0x3a0467=function(_0x3f92f1){return new BPromise(function(_0x3ee7d3,_0x56b0e4){_0x29ffeb(_0x3f92f1,_0xf1eb76)['then'](function(_0x5be65c){_0xf1eb76[_0xa6e9('0x16')]=_0x5be65c[_0xa6e9('0x28')];_0x3ec6db[_0xa6e9('0x22')][_0xa6e9('0x18')]({'where':{'phone':_0xf1eb76[_0xa6e9('0xa')],'VoiceQueueId':_0x3f92f1['id']}})[_0xa6e9('0x19')](function(_0x59714b){if(!_[_0xa6e9('0x1a')](_0x59714b)){throw new Error('cmContact,\x20afterCreate\x20'+_0xf1eb76[_0xa6e9('0xa')]+_0xa6e9('0x29')+_0x3f92f1['id']);}return _0x3ec6db[_0xa6e9('0x2a')][_0xa6e9('0x18')]({'where':{'calleridnum':_0xf1eb76[_0xa6e9('0xa')],'VoiceQueueId':_0x3f92f1['id']}});})[_0xa6e9('0x19')](function(_0x428c28){if(!_[_0xa6e9('0x1a')](_0x428c28)){throw new Error('cmContact,\x20afterCreate,\x20'+_0xf1eb76[_0xa6e9('0xa')]+_0xa6e9('0x2b')+_0x3f92f1['id']);}return _0x3ec6db[_0xa6e9('0x22')][_0xa6e9('0x2c')]({'phone':_0xf1eb76[_0xa6e9('0xa')],'ContactId':_0xf1eb76['id'],'ListId':_0xf1eb76['ListId'],'priority':_0xf1eb76[_0xa6e9('0x24')]?_0xf1eb76[_0xa6e9('0x24')]:0x2,'scheduledat':_0xf1eb76['scheduledat']?_0xf1eb76[_0xa6e9('0x16')]:moment()['format'](_0xa6e9('0x17')),'callback':_0xf1eb76[_0xa6e9('0x26')]?!![]:![],'callbackuniqueid':_0xf1eb76[_0xa6e9('0x26')]?_0xf1eb76[_0xa6e9('0x26')]:undefined,'callbackat':_0xf1eb76[_0xa6e9('0x26')]?moment()[_0xa6e9('0x25')](_0xa6e9('0x17')):undefined,'VoiceQueueId':_0x3f92f1['id']});})[_0xa6e9('0x27')](function(_0x1a5cf8){_0x56b0e4(_0x1a5cf8);});});});};function _0xc52de0(){return function(_0x49bdd0){logger[_0xa6e9('0x13')]('cmContact',_0xa6e9('0x14'),util[_0xa6e9('0x15')](_0x49bdd0,{'showHidden':![],'depth':null}));};}function _0x354768(_0x5378d2,_0x54e512){var _0x2d1113=_0x54e512[_0xa6e9('0x16')]?_0x54e512[_0xa6e9('0x16')]:moment()[_0xa6e9('0x25')](_0xa6e9('0x17'));return new BPromise(function(_0x9137e6,_0x4709c7){if(_['isNil'](_0x54e512[_0xa6e9('0x1b')])){_0x9137e6({'ret':_0x2d1113});}else{_0x3ec6db[_0xa6e9('0x2d')]['findOne']({'where':{'id':_0x5378d2['id']}})[_0xa6e9('0x19')](function(_0x255777){if(!_[_0xa6e9('0x1a')](_0x255777)){var _0x3d79a9=_0x255777['dialTimezone'];if(!_[_0xa6e9('0x1a')](_0x3d79a9)){var _0x390990=shared[_0xa6e9('0x1c')];var _0x1f2563=_0x390990[_0x3d79a9];var _0x21c116=_0x390990[_0x54e512['dialTimezone']];if(!_[_0xa6e9('0x1a')](_0x1f2563)&&!_[_0xa6e9('0x1a')](_0x21c116)){var _0x468718=_0x1f2563[_0xa6e9('0x1d')]-_0x21c116[_0xa6e9('0x1d')];_0x2d1113=_0x54e512[_0xa6e9('0x16')]?_0x54e512[_0xa6e9('0x16')]:moment();var _0x4de36d=moment(_0x2d1113)[_0xa6e9('0x1e')](_0x468718,_0xa6e9('0x1f'));_0x9137e6({'ret':_0x4de36d[_0xa6e9('0x25')](_0xa6e9('0x17'))});}else _0x9137e6({'ret':_0x2d1113});}else _0x9137e6({'ret':_0x2d1113});}else{_0x9137e6({'ret':_0x2d1113});}});}});return 0xa;}var _0x4e0199=function(_0x1450a3){return new BPromise(function(_0x54574d,_0x42b052){_0x354768(_0x1450a3,_0xf1eb76)[_0xa6e9('0x19')](function(_0x35726d){_0xf1eb76['scheduledat']=_0x35726d['ret'];_0x3ec6db[_0xa6e9('0x22')][_0xa6e9('0x18')]({'where':{'phone':_0xf1eb76[_0xa6e9('0xa')],'CampaignId':_0x1450a3['id']}})[_0xa6e9('0x19')](function(_0x58fdc3){if(!_[_0xa6e9('0x1a')](_0x58fdc3)){throw new Error(_0xa6e9('0x20')+_0xf1eb76[_0xa6e9('0xa')]+_0xa6e9('0x2e')+_0x1450a3['id']);}return _0x3ec6db['CmHopper'][_0xa6e9('0x2c')]({'phone':_0xf1eb76[_0xa6e9('0xa')],'ContactId':_0xf1eb76['id'],'ListId':_0xf1eb76[_0xa6e9('0x23')],'priority':_0xf1eb76[_0xa6e9('0x24')]?_0xf1eb76[_0xa6e9('0x24')]:0x2,'scheduledat':_0xf1eb76['scheduledat']?_0xf1eb76[_0xa6e9('0x16')]:moment()['format'](_0xa6e9('0x17')),'callback':_0xf1eb76[_0xa6e9('0x26')]?!![]:![],'callbackuniqueid':_0xf1eb76[_0xa6e9('0x26')]?_0xf1eb76['callbackUniqueid']:undefined,'callbackat':_0xf1eb76[_0xa6e9('0x26')]?moment()[_0xa6e9('0x25')](_0xa6e9('0x17')):undefined,'CampaignId':_0x1450a3['id']});})[_0xa6e9('0x27')](function(_0x3833dd){_0x42b052(_0x3833dd);});});});};var _0x31bc51=function(_0x939f21){return new BPromise(function(_0x5be881,_0xad595d){_0x354768(_0x939f21,_0xf1eb76)[_0xa6e9('0x19')](function(_0x1d11c1){_0xf1eb76[_0xa6e9('0x16')]=_0x1d11c1[_0xa6e9('0x28')];_0x3ec6db[_0xa6e9('0x22')][_0xa6e9('0x18')]({'where':{'phone':_0xf1eb76[_0xa6e9('0xa')],'CampaignId':_0x939f21['id']}})[_0xa6e9('0x19')](function(_0x3f316c){if(!_[_0xa6e9('0x1a')](_0x3f316c)){throw new Error(_0xa6e9('0x20')+_0xf1eb76[_0xa6e9('0xa')]+_0xa6e9('0x2f')+_0x939f21['id']);}return _0x3ec6db[_0xa6e9('0x2a')][_0xa6e9('0x18')]({'where':{'calleridnum':_0xf1eb76[_0xa6e9('0xa')],'CampaignId':_0x939f21['id']}});})[_0xa6e9('0x19')](function(_0x242ac5){if(!_['isNil'](_0x242ac5)){throw new Error(_0xa6e9('0x30')+_0xf1eb76[_0xa6e9('0xa')]+_0xa6e9('0x31')+_0x939f21['id']);}return _0x3ec6db[_0xa6e9('0x22')][_0xa6e9('0x2c')]({'phone':_0xf1eb76[_0xa6e9('0xa')],'ContactId':_0xf1eb76['id'],'ListId':_0xf1eb76['ListId'],'priority':_0xf1eb76[_0xa6e9('0x24')]?_0xf1eb76[_0xa6e9('0x24')]:0x2,'scheduledat':_0xf1eb76[_0xa6e9('0x16')]?_0xf1eb76[_0xa6e9('0x16')]:moment()['format'](_0xa6e9('0x17')),'callback':_0xf1eb76[_0xa6e9('0x26')]?!![]:![],'callbackuniqueid':_0xf1eb76[_0xa6e9('0x26')]?_0xf1eb76[_0xa6e9('0x26')]:undefined,'callbackat':_0xf1eb76[_0xa6e9('0x26')]?moment()[_0xa6e9('0x25')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x939f21['id']});})['catch'](function(_0x4ebd80){_0xad595d(_0x4ebd80);});});});};if(_0xf1eb76[_0xa6e9('0x23')]){_0x3ec6db[_0xa6e9('0x32')]['findAll']({'where':{'type':_0xa6e9('0x33')},'attributes':['id',_0xa6e9('0x34'),'dialTimezone'],'include':[{'model':_0x3ec6db['CmList'],'as':_0xa6e9('0x35'),'where':{'id':_0xf1eb76['ListId']}}]})[_0xa6e9('0x19')](function(_0x14523d){if(_0x14523d){var _0x3625f4=[];for(var _0x5af20d=0x0,_0x2a6cbf;_0x5af20d<_0x14523d[_0xa6e9('0x36')];_0x5af20d+=0x1){_0x2a6cbf=_0x14523d[_0x5af20d]['get']({'plain':!![]});switch(_0x2a6cbf[_0xa6e9('0x34')]){case'always':_0x3a0467(_0x2a6cbf)['catch'](_0x42efb5());break;case'onlyIfOpen':_0x16efbe(_0x2a6cbf)[_0xa6e9('0x27')](_0x42efb5());break;default:_0x354768(_0x2a6cbf,_0xf1eb76)['then'](function(_0x52e031){_0xf1eb76[_0xa6e9('0x16')]=_0x52e031[_0xa6e9('0x28')];_0x3ec6db[_0xa6e9('0x22')][_0xa6e9('0x2c')]({'phone':_0xf1eb76[_0xa6e9('0xa')],'ContactId':_0xf1eb76['id'],'ListId':_0xf1eb76[_0xa6e9('0x23')],'scheduledat':_0xf1eb76[_0xa6e9('0x16')]?_0xf1eb76[_0xa6e9('0x16')]:moment()[_0xa6e9('0x25')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0xf1eb76['priority']?_0xf1eb76[_0xa6e9('0x24')]:0x2,'callback':_0xf1eb76[_0xa6e9('0x26')]?!![]:![],'callbackuniqueid':_0xf1eb76['callbackUniqueid']?_0xf1eb76[_0xa6e9('0x26')]:undefined,'callbackat':_0xf1eb76[_0xa6e9('0x26')]?moment()[_0xa6e9('0x25')](_0xa6e9('0x17')):undefined,'VoiceQueueId':_0x2a6cbf['id']})['catch'](_0x42efb5());});}}}})[_0xa6e9('0x19')](function(){return _0x3ec6db['VoiceQueue'][_0xa6e9('0x37')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x3ec6db['CmList'],'as':'BlackLists','where':{'id':_0xf1eb76[_0xa6e9('0x23')]}}]})[_0xa6e9('0x19')](function(_0xfc3224){if(_0xfc3224){var _0x618724=[];for(var _0x5a8a0a=0x0,_0x2e59f1;_0x5a8a0a<_0xfc3224[_0xa6e9('0x36')];_0x5a8a0a+=0x1){_0x2e59f1=_0xfc3224[_0x5a8a0a][_0xa6e9('0x12')]({'plain':!![]});_0x3ec6db[_0xa6e9('0x38')][_0xa6e9('0x2c')]({'phone':_0xf1eb76[_0xa6e9('0xa')],'ContactId':_0xf1eb76['id'],'ListId':_0xf1eb76[_0xa6e9('0x23')],'VoiceQueueId':_0x2e59f1['id']})[_0xa6e9('0x27')](function(_0x2403e6){logger[_0xa6e9('0x13')]('cmContact,\x20%s,\x20%s',_0xa6e9('0x14'),_0x2403e6[_0xa6e9('0x39')]);});}}});})['then'](function(){return _0x3ec6db['Campaign'][_0xa6e9('0x37')]({'attributes':['id',_0xa6e9('0x34'),_0xa6e9('0x1b')],'include':[{'model':_0x3ec6db[_0xa6e9('0x3a')],'as':'Lists','where':{'id':_0xf1eb76[_0xa6e9('0x23')]}}]})['then'](function(_0x53b258){if(_0x53b258){var _0x2de547=[];for(var _0x5878b0=0x0,_0x3b64d5;_0x5878b0<_0x53b258[_0xa6e9('0x36')];_0x5878b0+=0x1){_0x3b64d5=_0x53b258[_0x5878b0][_0xa6e9('0x12')]({'plain':!![]});switch(_0x3b64d5[_0xa6e9('0x34')]){case _0xa6e9('0x3b'):_0x31bc51(_0x3b64d5)[_0xa6e9('0x27')](_0xc52de0());break;case _0xa6e9('0x3c'):_0x4e0199(_0x3b64d5)[_0xa6e9('0x27')](_0xc52de0());break;default:_0x3ec6db['CmHopper']['create']({'phone':_0xf1eb76[_0xa6e9('0xa')],'ContactId':_0xf1eb76['id'],'ListId':_0xf1eb76[_0xa6e9('0x23')],'scheduledat':_0xf1eb76['scheduledat']?_0xf1eb76[_0xa6e9('0x16')]:moment()[_0xa6e9('0x25')](_0xa6e9('0x17')),'priority':_0xf1eb76['priority']?_0xf1eb76[_0xa6e9('0x24')]:0x2,'callback':_0xf1eb76['callbackUniqueid']?!![]:![],'callbackuniqueid':_0xf1eb76[_0xa6e9('0x26')]?_0xf1eb76[_0xa6e9('0x26')]:undefined,'callbackat':_0xf1eb76[_0xa6e9('0x26')]?moment()[_0xa6e9('0x25')](_0xa6e9('0x17')):undefined,'CampaignId':_0x3b64d5['id']})[_0xa6e9('0x27')](_0xc52de0());}}}});})[_0xa6e9('0x19')](function(){return _0x3ec6db[_0xa6e9('0x2d')]['findAll']({'attributes':['id'],'include':[{'model':_0x3ec6db[_0xa6e9('0x3a')],'as':_0xa6e9('0x3d'),'where':{'id':_0xf1eb76[_0xa6e9('0x23')]}}]})[_0xa6e9('0x19')](function(_0x6f93c0){if(_0x6f93c0){var _0x14c5e4=[];for(var _0x19931a=0x0,_0xefdb71;_0x19931a<_0x6f93c0[_0xa6e9('0x36')];_0x19931a+=0x1){_0xefdb71=_0x6f93c0[_0x19931a][_0xa6e9('0x12')]({'plain':!![]});_0x3ec6db[_0xa6e9('0x38')][_0xa6e9('0x2c')]({'phone':_0xf1eb76[_0xa6e9('0xa')],'ContactId':_0xf1eb76['id'],'ListId':_0xf1eb76[_0xa6e9('0x23')],'CampaignId':_0xefdb71['id']})[_0xa6e9('0x27')](function(_0x39628c){logger[_0xa6e9('0x13')]('cmContact,\x20%s,\x20%s',_0xa6e9('0x14'),_0x39628c[_0xa6e9('0x39')]);});}}});})[_0xa6e9('0x19')](function(){_0x361770();})['catch'](function(_0x3dc656){logger['error']('cmContact,\x20%s,\x20%s',_0xa6e9('0x14'),_0x3dc656[_0xa6e9('0x39')]);_0x361770(_0x3dc656);});}else{_0x361770(new Error(_0xa6e9('0x3e')));}},'afterDestroy':function(_0x45e067,_0x3b494c,_0x3a36ec){var _0x50d671=_0x14e93b[_0xa6e9('0x11')];var _0x2abee0=_0x45e067[_0xa6e9('0x12')]({'plain':!![]});return _0x50d671[_0xa6e9('0x22')][_0xa6e9('0x37')]({'raw':!![],'where':{'ListId':_0x2abee0[_0xa6e9('0x23')],'ContactId':_0x2abee0['id']}})[_0xa6e9('0x19')](function(_0x1aaf97){if(!_['isEmpty'](_0x1aaf97)){var _0x19567e=[];for(var _0x32a645=0x0;_0x32a645<_0x1aaf97[_0xa6e9('0x36')];_0x32a645+=0x1){var _0x22e133=_0x50d671[_0xa6e9('0x22')][_0xa6e9('0x3f')]({'where':{'ListId':_0x1aaf97[_0x32a645][_0xa6e9('0x23')],'ContactId':_0x1aaf97[_0x32a645][_0xa6e9('0x40')],'VoiceQueueId':_0x1aaf97[_0x32a645][_0xa6e9('0x41')],'CampaignId':_0x1aaf97[_0x32a645]['CampaignId']}});_0x19567e[_0xa6e9('0x42')](_0x22e133);}return BPromise['all'](_0x19567e);}})['then'](function(_0x108d1f){logger[_0xa6e9('0x43')](_0xa6e9('0x44'),util[_0xa6e9('0x15')](_0x108d1f,{'showHidden':![],'depth':null}));_0x3a36ec();})[_0xa6e9('0x27')](function(_0x5ef0a9){logger[_0xa6e9('0x13')](_0xa6e9('0x45'),util[_0xa6e9('0x15')](_0x5ef0a9,{'showHidden':![],'depth':null}));_0x3a36ec(_0x5ef0a9);});}}});}; \ No newline at end of file +var _0x6cad=['CmHopperBlack','cmContact,\x20%s,\x20%s','BlackLists','length','message','List\x20not\x20found','destroy','ContactId','VoiceQueueId','push','all','[CmContact][afterDestroy][Error]','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','CmContact','fti_cm_contacts','firstName','lastName','phone','mobile','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','cmContact','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','utcOffset','add','ret','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','CmHopperFinal','catch','afterCreate','inspect','Campaign','timezones','minutes','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','findAll','CmList','Lists','dialCheckDuplicateType','always','onlyIfOpen','outbound'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6cad,0x128));var _0xd6ca=function(_0xa33fcd,_0x2efe96){_0xa33fcd=_0xa33fcd-0x0;var _0x2e0825=_0x6cad[_0xa33fcd];return _0x2e0825;};'use strict';var _=require(_0xd6ca('0x0'));var util=require('util');var logger=require(_0xd6ca('0x1'))(_0xd6ca('0x2'));var moment=require(_0xd6ca('0x3'));var BPromise=require(_0xd6ca('0x4'));var rp=require(_0xd6ca('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd6ca('0x6'));var config=require(_0xd6ca('0x7'));var shared=require(_0xd6ca('0x8'));var attributes=require(_0xd6ca('0x9'));module[_0xd6ca('0xa')]=function(_0x200916,_0x10b811){return _0x200916['define'](_0xd6ca('0xb'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':'phone','fields':['phone']},{'name':_0xd6ca('0xc'),'fields':[_0xd6ca('0xd'),_0xd6ca('0xe'),_0xd6ca('0xf'),_0xd6ca('0x10'),_0xd6ca('0x11'),_0xd6ca('0x12')],'type':_0xd6ca('0x13')}],'timestamps':!![],'charset':_0xd6ca('0x14'),'collate':_0xd6ca('0x15'),'hooks':{'afterCreate':function(_0x50117d,_0xb6d1e2,_0x4b516e){var _0x28f369=_0x200916[_0xd6ca('0x16')];var _0x22d313=_0x50117d[_0xd6ca('0x17')]({'plain':!![]});function _0x372697(){return function(_0x8212df){logger[_0xd6ca('0x18')](_0xd6ca('0x19'),'afterCreate',util['inspect'](_0x8212df,{'showHidden':![],'depth':null}));};}function _0x5247b1(_0xde0bc8,_0x2e112f){var _0x49405f=_0x2e112f[_0xd6ca('0x1a')]?_0x2e112f['scheduledat']:moment()[_0xd6ca('0x1b')](_0xd6ca('0x1c'));return new BPromise(function(_0x22fd62,_0x47f3e9){if(_[_0xd6ca('0x1d')](_0x2e112f[_0xd6ca('0x1e')])){_0x22fd62({'ret':_0x49405f});}else{_0x28f369[_0xd6ca('0x1f')][_0xd6ca('0x20')]({'where':{'id':_0xde0bc8['id']}})[_0xd6ca('0x21')](function(_0x315d19){if(!_[_0xd6ca('0x1d')](_0x315d19)){var _0x1c1e01=_0x315d19[_0xd6ca('0x1e')];if(!_[_0xd6ca('0x1d')](_0x1c1e01)){var _0x501af5=shared['timezones'];var _0x4e3dcf=_0x501af5[_0x1c1e01];var _0x4a3dd7=_0x501af5[_0x2e112f[_0xd6ca('0x1e')]];if(!_[_0xd6ca('0x1d')](_0x4e3dcf)&&!_[_0xd6ca('0x1d')](_0x4a3dd7)){var _0x47a4ae=_0x4e3dcf[_0xd6ca('0x22')]-_0x4a3dd7[_0xd6ca('0x22')];_0x49405f=_0x2e112f[_0xd6ca('0x1a')]?_0x2e112f[_0xd6ca('0x1a')]:moment();var _0x1d22d6=moment(_0x49405f)[_0xd6ca('0x23')](_0x47a4ae,'minutes');_0x22fd62({'ret':_0x1d22d6[_0xd6ca('0x1b')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x22fd62({'ret':_0x49405f});}else _0x22fd62({'ret':_0x49405f});}else{_0x22fd62({'ret':_0x49405f});}});}});return 0xa;}var _0x5511d5=function(_0x1fb5b7){return new BPromise(function(_0x493a31,_0x3bd8bd){_0x5247b1(_0x1fb5b7,_0x22d313)[_0xd6ca('0x21')](function(_0x521644){_0x22d313[_0xd6ca('0x1a')]=_0x521644[_0xd6ca('0x24')];_0x28f369[_0xd6ca('0x25')][_0xd6ca('0x20')]({'where':{'phone':_0x22d313['phone'],'VoiceQueueId':_0x1fb5b7['id']}})[_0xd6ca('0x21')](function(_0x5bd155){if(!_['isNil'](_0x5bd155)){throw new Error(_0xd6ca('0x26')+_0x22d313[_0xd6ca('0xf')]+_0xd6ca('0x27')+_0x1fb5b7['id']);}return _0x28f369[_0xd6ca('0x25')][_0xd6ca('0x28')]({'phone':_0x22d313[_0xd6ca('0xf')],'ContactId':_0x22d313['id'],'ListId':_0x22d313[_0xd6ca('0x29')],'priority':_0x22d313[_0xd6ca('0x2a')]?_0x22d313['priority']:0x2,'scheduledat':_0x22d313[_0xd6ca('0x1a')]?_0x22d313['scheduledat']:moment()[_0xd6ca('0x1b')](_0xd6ca('0x1c')),'callback':_0x22d313[_0xd6ca('0x2b')]?!![]:![],'callbackuniqueid':_0x22d313[_0xd6ca('0x2b')]?_0x22d313[_0xd6ca('0x2b')]:undefined,'callbackat':_0x22d313[_0xd6ca('0x2b')]?moment()[_0xd6ca('0x1b')](_0xd6ca('0x1c')):undefined,'VoiceQueueId':_0x1fb5b7['id']});})['catch'](function(_0x25ce50){_0x3bd8bd(_0x25ce50);});});});};var _0xa14897=function(_0x189a8a){return new BPromise(function(_0x3a0621,_0x12f704){_0x5247b1(_0x189a8a,_0x22d313)[_0xd6ca('0x21')](function(_0xe05816){_0x22d313[_0xd6ca('0x1a')]=_0xe05816['ret'];_0x28f369['CmHopper']['findOne']({'where':{'phone':_0x22d313['phone'],'VoiceQueueId':_0x189a8a['id']}})[_0xd6ca('0x21')](function(_0x3a03f3){if(!_[_0xd6ca('0x1d')](_0x3a03f3)){throw new Error('cmContact,\x20afterCreate\x20'+_0x22d313[_0xd6ca('0xf')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x189a8a['id']);}return _0x28f369[_0xd6ca('0x2c')][_0xd6ca('0x20')]({'where':{'calleridnum':_0x22d313['phone'],'VoiceQueueId':_0x189a8a['id']}});})[_0xd6ca('0x21')](function(_0x5929ab){if(!_[_0xd6ca('0x1d')](_0x5929ab)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x22d313[_0xd6ca('0xf')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x189a8a['id']);}return _0x28f369['CmHopper'][_0xd6ca('0x28')]({'phone':_0x22d313[_0xd6ca('0xf')],'ContactId':_0x22d313['id'],'ListId':_0x22d313[_0xd6ca('0x29')],'priority':_0x22d313['priority']?_0x22d313[_0xd6ca('0x2a')]:0x2,'scheduledat':_0x22d313[_0xd6ca('0x1a')]?_0x22d313['scheduledat']:moment()[_0xd6ca('0x1b')](_0xd6ca('0x1c')),'callback':_0x22d313[_0xd6ca('0x2b')]?!![]:![],'callbackuniqueid':_0x22d313['callbackUniqueid']?_0x22d313[_0xd6ca('0x2b')]:undefined,'callbackat':_0x22d313[_0xd6ca('0x2b')]?moment()[_0xd6ca('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x189a8a['id']});})[_0xd6ca('0x2d')](function(_0x10f816){_0x12f704(_0x10f816);});});});};function _0x4ee0d6(){return function(_0x392661){logger[_0xd6ca('0x18')](_0xd6ca('0x19'),_0xd6ca('0x2e'),util[_0xd6ca('0x2f')](_0x392661,{'showHidden':![],'depth':null}));};}function _0x3070ce(_0x4b70ce,_0x422daf){var _0x31f475=_0x422daf['scheduledat']?_0x422daf[_0xd6ca('0x1a')]:moment()[_0xd6ca('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x14923f,_0x5a17ba){if(_['isNil'](_0x422daf[_0xd6ca('0x1e')])){_0x14923f({'ret':_0x31f475});}else{_0x28f369[_0xd6ca('0x30')][_0xd6ca('0x20')]({'where':{'id':_0x4b70ce['id']}})['then'](function(_0x219661){if(!_[_0xd6ca('0x1d')](_0x219661)){var _0x3bc139=_0x219661[_0xd6ca('0x1e')];if(!_[_0xd6ca('0x1d')](_0x3bc139)){var _0x5851c9=shared[_0xd6ca('0x31')];var _0x318658=_0x5851c9[_0x3bc139];var _0x5787f2=_0x5851c9[_0x422daf['dialTimezone']];if(!_[_0xd6ca('0x1d')](_0x318658)&&!_[_0xd6ca('0x1d')](_0x5787f2)){var _0x490b34=_0x318658[_0xd6ca('0x22')]-_0x5787f2[_0xd6ca('0x22')];_0x31f475=_0x422daf['scheduledat']?_0x422daf['scheduledat']:moment();var _0x11f2d8=moment(_0x31f475)['add'](_0x490b34,_0xd6ca('0x32'));_0x14923f({'ret':_0x11f2d8['format'](_0xd6ca('0x1c'))});}else _0x14923f({'ret':_0x31f475});}else _0x14923f({'ret':_0x31f475});}else{_0x14923f({'ret':_0x31f475});}});}});return 0xa;}var _0x46b391=function(_0x121e27){return new BPromise(function(_0x3dfca7,_0x26044c){_0x3070ce(_0x121e27,_0x22d313)[_0xd6ca('0x21')](function(_0x1edfee){_0x22d313[_0xd6ca('0x1a')]=_0x1edfee[_0xd6ca('0x24')];_0x28f369[_0xd6ca('0x25')][_0xd6ca('0x20')]({'where':{'phone':_0x22d313[_0xd6ca('0xf')],'CampaignId':_0x121e27['id']}})[_0xd6ca('0x21')](function(_0x1a0598){if(!_[_0xd6ca('0x1d')](_0x1a0598)){throw new Error(_0xd6ca('0x26')+_0x22d313[_0xd6ca('0xf')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x121e27['id']);}return _0x28f369[_0xd6ca('0x25')][_0xd6ca('0x28')]({'phone':_0x22d313[_0xd6ca('0xf')],'ContactId':_0x22d313['id'],'ListId':_0x22d313['ListId'],'priority':_0x22d313[_0xd6ca('0x2a')]?_0x22d313[_0xd6ca('0x2a')]:0x2,'scheduledat':_0x22d313['scheduledat']?_0x22d313[_0xd6ca('0x1a')]:moment()['format'](_0xd6ca('0x1c')),'callback':_0x22d313[_0xd6ca('0x2b')]?!![]:![],'callbackuniqueid':_0x22d313[_0xd6ca('0x2b')]?_0x22d313[_0xd6ca('0x2b')]:undefined,'callbackat':_0x22d313[_0xd6ca('0x2b')]?moment()[_0xd6ca('0x1b')](_0xd6ca('0x1c')):undefined,'CampaignId':_0x121e27['id']});})[_0xd6ca('0x2d')](function(_0x59a6b2){_0x26044c(_0x59a6b2);});});});};var _0x3fbe8d=function(_0x2719e8){return new BPromise(function(_0x492866,_0x54f8a6){_0x3070ce(_0x2719e8,_0x22d313)['then'](function(_0x5e1980){_0x22d313[_0xd6ca('0x1a')]=_0x5e1980[_0xd6ca('0x24')];_0x28f369[_0xd6ca('0x25')][_0xd6ca('0x20')]({'where':{'phone':_0x22d313[_0xd6ca('0xf')],'CampaignId':_0x2719e8['id']}})[_0xd6ca('0x21')](function(_0x572ae6){if(!_[_0xd6ca('0x1d')](_0x572ae6)){throw new Error(_0xd6ca('0x26')+_0x22d313[_0xd6ca('0xf')]+_0xd6ca('0x33')+_0x2719e8['id']);}return _0x28f369[_0xd6ca('0x2c')][_0xd6ca('0x20')]({'where':{'calleridnum':_0x22d313['phone'],'CampaignId':_0x2719e8['id']}});})[_0xd6ca('0x21')](function(_0x1137a3){if(!_[_0xd6ca('0x1d')](_0x1137a3)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x22d313[_0xd6ca('0xf')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x2719e8['id']);}return _0x28f369[_0xd6ca('0x25')][_0xd6ca('0x28')]({'phone':_0x22d313[_0xd6ca('0xf')],'ContactId':_0x22d313['id'],'ListId':_0x22d313[_0xd6ca('0x29')],'priority':_0x22d313[_0xd6ca('0x2a')]?_0x22d313[_0xd6ca('0x2a')]:0x2,'scheduledat':_0x22d313[_0xd6ca('0x1a')]?_0x22d313['scheduledat']:moment()['format'](_0xd6ca('0x1c')),'callback':_0x22d313[_0xd6ca('0x2b')]?!![]:![],'callbackuniqueid':_0x22d313[_0xd6ca('0x2b')]?_0x22d313['callbackUniqueid']:undefined,'callbackat':_0x22d313[_0xd6ca('0x2b')]?moment()[_0xd6ca('0x1b')](_0xd6ca('0x1c')):undefined,'CampaignId':_0x2719e8['id']});})[_0xd6ca('0x2d')](function(_0x512a45){_0x54f8a6(_0x512a45);});});});};if(_0x22d313[_0xd6ca('0x29')]){_0x28f369[_0xd6ca('0x1f')][_0xd6ca('0x34')]({'where':{'type':'outbound'},'attributes':['id','dialCheckDuplicateType',_0xd6ca('0x1e')],'include':[{'model':_0x28f369[_0xd6ca('0x35')],'as':_0xd6ca('0x36'),'where':{'id':_0x22d313[_0xd6ca('0x29')]}}]})[_0xd6ca('0x21')](function(_0x1a6bc6){if(_0x1a6bc6){var _0x495db8=[];for(var _0x19f432=0x0,_0x5a73c2;_0x19f432<_0x1a6bc6['length'];_0x19f432+=0x1){_0x5a73c2=_0x1a6bc6[_0x19f432][_0xd6ca('0x17')]({'plain':!![]});switch(_0x5a73c2[_0xd6ca('0x37')]){case _0xd6ca('0x38'):_0xa14897(_0x5a73c2)['catch'](_0x372697());break;case _0xd6ca('0x39'):_0x5511d5(_0x5a73c2)[_0xd6ca('0x2d')](_0x372697());break;default:_0x3070ce(_0x5a73c2,_0x22d313)[_0xd6ca('0x21')](function(_0x1f4ea8){_0x22d313[_0xd6ca('0x1a')]=_0x1f4ea8['ret'];_0x28f369[_0xd6ca('0x25')][_0xd6ca('0x28')]({'phone':_0x22d313[_0xd6ca('0xf')],'ContactId':_0x22d313['id'],'ListId':_0x22d313[_0xd6ca('0x29')],'scheduledat':_0x22d313[_0xd6ca('0x1a')]?_0x22d313[_0xd6ca('0x1a')]:moment()[_0xd6ca('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x22d313[_0xd6ca('0x2a')]?_0x22d313['priority']:0x2,'callback':_0x22d313[_0xd6ca('0x2b')]?!![]:![],'callbackuniqueid':_0x22d313[_0xd6ca('0x2b')]?_0x22d313['callbackUniqueid']:undefined,'callbackat':_0x22d313[_0xd6ca('0x2b')]?moment()[_0xd6ca('0x1b')](_0xd6ca('0x1c')):undefined,'VoiceQueueId':_0x5a73c2['id']})[_0xd6ca('0x2d')](_0x372697());});}}}})[_0xd6ca('0x21')](function(){return _0x28f369[_0xd6ca('0x1f')][_0xd6ca('0x34')]({'where':{'type':_0xd6ca('0x3a')},'attributes':['id'],'include':[{'model':_0x28f369[_0xd6ca('0x35')],'as':'BlackLists','where':{'id':_0x22d313[_0xd6ca('0x29')]}}]})[_0xd6ca('0x21')](function(_0x13aaff){if(_0x13aaff){var _0x50f9fa=[];for(var _0x39ae9e=0x0,_0x48872c;_0x39ae9e<_0x13aaff['length'];_0x39ae9e+=0x1){_0x48872c=_0x13aaff[_0x39ae9e][_0xd6ca('0x17')]({'plain':!![]});_0x28f369[_0xd6ca('0x3b')]['create']({'phone':_0x22d313[_0xd6ca('0xf')],'ContactId':_0x22d313['id'],'ListId':_0x22d313['ListId'],'VoiceQueueId':_0x48872c['id']})['catch'](function(_0x2f72d8){logger[_0xd6ca('0x18')](_0xd6ca('0x3c'),_0xd6ca('0x2e'),_0x2f72d8['message']);});}}});})['then'](function(){return _0x28f369[_0xd6ca('0x30')]['findAll']({'attributes':['id',_0xd6ca('0x37'),_0xd6ca('0x1e')],'include':[{'model':_0x28f369[_0xd6ca('0x35')],'as':_0xd6ca('0x36'),'where':{'id':_0x22d313['ListId']}}]})[_0xd6ca('0x21')](function(_0x2211bb){if(_0x2211bb){var _0x16720f=[];for(var _0x4b848f=0x0,_0xe6f0a5;_0x4b848f<_0x2211bb['length'];_0x4b848f+=0x1){_0xe6f0a5=_0x2211bb[_0x4b848f][_0xd6ca('0x17')]({'plain':!![]});switch(_0xe6f0a5['dialCheckDuplicateType']){case'always':_0x3fbe8d(_0xe6f0a5)['catch'](_0x4ee0d6());break;case _0xd6ca('0x39'):_0x46b391(_0xe6f0a5)['catch'](_0x4ee0d6());break;default:_0x28f369[_0xd6ca('0x25')]['create']({'phone':_0x22d313[_0xd6ca('0xf')],'ContactId':_0x22d313['id'],'ListId':_0x22d313[_0xd6ca('0x29')],'scheduledat':_0x22d313[_0xd6ca('0x1a')]?_0x22d313[_0xd6ca('0x1a')]:moment()[_0xd6ca('0x1b')](_0xd6ca('0x1c')),'priority':_0x22d313[_0xd6ca('0x2a')]?_0x22d313[_0xd6ca('0x2a')]:0x2,'callback':_0x22d313[_0xd6ca('0x2b')]?!![]:![],'callbackuniqueid':_0x22d313[_0xd6ca('0x2b')]?_0x22d313[_0xd6ca('0x2b')]:undefined,'callbackat':_0x22d313[_0xd6ca('0x2b')]?moment()[_0xd6ca('0x1b')](_0xd6ca('0x1c')):undefined,'CampaignId':_0xe6f0a5['id']})[_0xd6ca('0x2d')](_0x4ee0d6());}}}});})[_0xd6ca('0x21')](function(){return _0x28f369[_0xd6ca('0x30')][_0xd6ca('0x34')]({'attributes':['id'],'include':[{'model':_0x28f369['CmList'],'as':_0xd6ca('0x3d'),'where':{'id':_0x22d313[_0xd6ca('0x29')]}}]})[_0xd6ca('0x21')](function(_0x251792){if(_0x251792){var _0x2b3e24=[];for(var _0x51eb5b=0x0,_0x401c02;_0x51eb5b<_0x251792[_0xd6ca('0x3e')];_0x51eb5b+=0x1){_0x401c02=_0x251792[_0x51eb5b][_0xd6ca('0x17')]({'plain':!![]});_0x28f369[_0xd6ca('0x3b')]['create']({'phone':_0x22d313[_0xd6ca('0xf')],'ContactId':_0x22d313['id'],'ListId':_0x22d313[_0xd6ca('0x29')],'CampaignId':_0x401c02['id']})['catch'](function(_0x1ae2c5){logger[_0xd6ca('0x18')](_0xd6ca('0x3c'),_0xd6ca('0x2e'),_0x1ae2c5[_0xd6ca('0x3f')]);});}}});})['then'](function(){_0x4b516e();})['catch'](function(_0x3a07d2){logger[_0xd6ca('0x18')](_0xd6ca('0x3c'),_0xd6ca('0x2e'),_0x3a07d2['message']);_0x4b516e(_0x3a07d2);});}else{_0x4b516e(new Error(_0xd6ca('0x40')));}},'afterDestroy':function(_0x317368,_0x22c53e,_0x5d3be2){var _0x1ee9d1=_0x200916[_0xd6ca('0x16')];var _0x44738e=_0x317368[_0xd6ca('0x17')]({'plain':!![]});return _0x1ee9d1['CmHopper'][_0xd6ca('0x34')]({'raw':!![],'where':{'ListId':_0x44738e[_0xd6ca('0x29')],'ContactId':_0x44738e['id']}})['then'](function(_0x78f0ea){if(!_['isEmpty'](_0x78f0ea)){var _0x191d9f=[];for(var _0x14105d=0x0;_0x14105d<_0x78f0ea[_0xd6ca('0x3e')];_0x14105d+=0x1){var _0x55546b=_0x1ee9d1[_0xd6ca('0x25')][_0xd6ca('0x41')]({'where':{'ListId':_0x78f0ea[_0x14105d]['ListId'],'ContactId':_0x78f0ea[_0x14105d][_0xd6ca('0x42')],'VoiceQueueId':_0x78f0ea[_0x14105d][_0xd6ca('0x43')],'CampaignId':_0x78f0ea[_0x14105d]['CampaignId']}});_0x191d9f[_0xd6ca('0x44')](_0x55546b);}return BPromise[_0xd6ca('0x45')](_0x191d9f);}})[_0xd6ca('0x21')](function(_0x119ad3){logger['info']('[CmContact][afterDestroy][Succesfull]',util[_0xd6ca('0x2f')](_0x119ad3,{'showHidden':![],'depth':null}));_0x5d3be2();})[_0xd6ca('0x2d')](function(_0x4156bd){logger[_0xd6ca('0x18')](_0xd6ca('0x46'),util[_0xd6ca('0x2f')](_0x4156bd,{'showHidden':![],'depth':null}));_0x5d3be2(_0x4156bd);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index f28111a..698756a 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x4c5d91,_0x4bfd08){var _0x7547ae=function(_0x10f25a){while(--_0x10f25a){_0x4c5d91['push'](_0x4c5d91['shift']());}};_0x7547ae(++_0x4bfd08);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index a2be862..adb7622 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.attributes.js +++ b/server/api/cmContactHasItem/cmContactHasItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x47d6=['INTEGER','STRING','PHONE','sequelize','exports'];(function(_0x417702,_0x5854fd){var _0x299b7f=function(_0x33c9b5){while(--_0x33c9b5){_0x417702['push'](_0x417702['shift']());}};_0x299b7f(++_0x5854fd);}(_0x47d6,0x1de));var _0x647d=function(_0x252b23,_0x159813){_0x252b23=_0x252b23-0x0;var _0x3c8c06=_0x47d6[_0x252b23];return _0x3c8c06;};'use strict';var Sequelize=require(_0x647d('0x0'));module[_0x647d('0x1')]={'CmContactId':{'type':Sequelize[_0x647d('0x2')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x647d('0x3')],'defaultValue':_0x647d('0x4')},'OrderBy':{'type':Sequelize[_0x647d('0x2')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file +var _0xa4ba=['INTEGER','STRING','PHONE','exports'];(function(_0x40f8e7,_0x15178f){var _0x4b13e5=function(_0x4fa29e){while(--_0x4fa29e){_0x40f8e7['push'](_0x40f8e7['shift']());}};_0x4b13e5(++_0x15178f);}(_0xa4ba,0x1b7));var _0xaa4b=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xa4ba[_0x8c43de];return _0xa6591b;};'use strict';var Sequelize=require('sequelize');module[_0xaa4b('0x0')]={'CmContactId':{'type':Sequelize[_0xaa4b('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0xaa4b('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xaa4b('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0xaa4b('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index 6c60591..dfd1e79 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.controller.js +++ b/server/api/cmContactHasItem/cmContactHasItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6baa=['model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','where','pick','filter','options','includeAll','findAll','catch','show','params','include','create','user','role','CmContactHasItems','find','userProfileId','autoAssociation','body','eml-format','rimraf','zip-dir','moment','bluebird','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','get','UserProfileResource','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','type','key'];(function(_0x42da97,_0x196659){var _0x3c47de=function(_0x366e23){while(--_0x366e23){_0x42da97['push'](_0x42da97['shift']());}};_0x3c47de(++_0x196659);}(_0x6baa,0x19d));var _0xa6ba=function(_0x2c338a,_0x16e7d6){_0x2c338a=_0x2c338a-0x0;var _0x1ee2fd=_0x6baa[_0x2c338a];return _0x1ee2fd;};'use strict';var emlformat=require(_0xa6ba('0x0'));var rimraf=require(_0xa6ba('0x1'));var zipdir=require(_0xa6ba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa6ba('0x3'));var BPromise=require(_0xa6ba('0x4'));var Mustache=require('mustache');var util=require(_0xa6ba('0x5'));var path=require('path');var sox=require(_0xa6ba('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa6ba('0x7'));var _=require(_0xa6ba('0x8'));var squel=require(_0xa6ba('0x9'));var crypto=require(_0xa6ba('0xa'));var jsforce=require(_0xa6ba('0xb'));var deskjs=require(_0xa6ba('0xc'));var toCsv=require(_0xa6ba('0xd'));var querystring=require('querystring');var Papa=require(_0xa6ba('0xe'));var Redis=require(_0xa6ba('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa6ba('0x10'));var as=require(_0xa6ba('0x11'));var hardwareService=require(_0xa6ba('0x12'));var logger=require('../../config/logger')(_0xa6ba('0x13'));var utils=require(_0xa6ba('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa6ba('0x15'));var db=require(_0xa6ba('0x16'))['db'];function respondWithStatusCode(_0x5bdb04,_0x1ed872){_0x1ed872=_0x1ed872||0xcc;return function(_0x410928){if(_0x410928){return _0x5bdb04[_0xa6ba('0x17')](_0x1ed872);}return _0x5bdb04[_0xa6ba('0x18')](_0x1ed872)[_0xa6ba('0x19')]();};}function respondWithResult(_0x3ada97,_0x5b83ff){_0x5b83ff=_0x5b83ff||0xc8;return function(_0x3718ea){if(_0x3718ea){return _0x3ada97[_0xa6ba('0x18')](_0x5b83ff)[_0xa6ba('0x1a')](_0x3718ea);}};}function respondWithFilteredResult(_0x2bae20,_0xaab06b){return function(_0xe76192){if(_0xe76192){var _0x1a282c=typeof _0xaab06b[_0xa6ba('0x1b')]==='undefined'&&typeof _0xaab06b[_0xa6ba('0x1c')]===_0xa6ba('0x1d');var _0x26318e=_0xe76192[_0xa6ba('0x1e')];var _0x44b64c=_0x1a282c?0x0:_0xaab06b[_0xa6ba('0x1b')];var _0x40e575=_0x1a282c?_0xe76192[_0xa6ba('0x1e')]:_0xaab06b[_0xa6ba('0x1b')]+_0xaab06b[_0xa6ba('0x1c')];var _0x3c4e6c;if(_0x40e575>=_0x26318e){_0x40e575=_0x26318e;_0x3c4e6c=0xc8;}else{_0x3c4e6c=0xce;}_0x2bae20[_0xa6ba('0x18')](_0x3c4e6c);return _0x2bae20[_0xa6ba('0x1f')]('Content-Range',_0x44b64c+'-'+_0x40e575+'/'+_0x26318e)[_0xa6ba('0x1a')](_0xe76192);}return null;};}function patchUpdates(_0x4c7e00){return function(_0x21055f){try{jsonpatch[_0xa6ba('0x20')](_0x21055f,_0x4c7e00,!![]);}catch(_0xed4575){return BPromise[_0xa6ba('0x21')](_0xed4575);}return _0x21055f[_0xa6ba('0x22')]();};}function saveUpdates(_0x211e0a,_0x1f8bc1){return function(_0x4ad119){if(_0x4ad119){return _0x4ad119[_0xa6ba('0x23')](_0x211e0a)[_0xa6ba('0x24')](function(_0x17d260){return _0x17d260;});}return null;};}function removeEntity(_0x32fa85,_0x477dd9){return function(_0xc61187){if(_0xc61187){return _0xc61187[_0xa6ba('0x25')]()[_0xa6ba('0x24')](function(){var _0x310d05=_0xc61187[_0xa6ba('0x26')]({'plain':!![]});var _0x4b33a2='CmContactHasItems';return db[_0xa6ba('0x27')][_0xa6ba('0x25')]({'where':{'type':_0x4b33a2,'resourceId':_0x310d05['id']}})[_0xa6ba('0x24')](function(){return _0xc61187;});})[_0xa6ba('0x24')](function(){_0x32fa85[_0xa6ba('0x18')](0xcc)[_0xa6ba('0x19')]();});}};}function handleEntityNotFound(_0x380526,_0x4a50ef){return function(_0x5e6dff){if(!_0x5e6dff){_0x380526[_0xa6ba('0x17')](0x194);}return _0x5e6dff;};}function handleError(_0xf85b9c,_0x586201){_0x586201=_0x586201||0x1f4;return function(_0x5358ab){logger['error'](_0x5358ab['stack']);if(_0x5358ab['name']){delete _0x5358ab[_0xa6ba('0x28')];}_0xf85b9c[_0xa6ba('0x18')](_0x586201)[_0xa6ba('0x29')](_0x5358ab);};}exports[_0xa6ba('0x2a')]=function(_0x1202b6,_0x5487a0){var _0x171033={},_0x440687={},_0xee006={'count':0x0,'rows':[]};var _0x5c377e=_[_0xa6ba('0x2b')](db[_0xa6ba('0x2c')][_0xa6ba('0x2d')],function(_0xcd9843){return{'name':_0xcd9843[_0xa6ba('0x2e')],'type':_0xcd9843[_0xa6ba('0x2f')][_0xa6ba('0x30')]};});_0x440687[_0xa6ba('0x31')]=_[_0xa6ba('0x2b')](_0x5c377e,_0xa6ba('0x28'));_0x440687[_0xa6ba('0x32')]=_[_0xa6ba('0x33')](_0x1202b6[_0xa6ba('0x32')]);_0x440687[_0xa6ba('0x34')]=_[_0xa6ba('0x35')](_0x440687['model'],_0x440687['query']);_0x171033['attributes']=_['intersection'](_0x440687[_0xa6ba('0x31')],qs[_0xa6ba('0x36')](_0x1202b6[_0xa6ba('0x32')][_0xa6ba('0x36')]));_0x171033[_0xa6ba('0x37')]=_0x171033[_0xa6ba('0x37')][_0xa6ba('0x38')]?_0x171033[_0xa6ba('0x37')]:_0x440687[_0xa6ba('0x31')];if(!_0x1202b6[_0xa6ba('0x32')][_0xa6ba('0x39')]('nolimit')){_0x171033[_0xa6ba('0x1c')]=qs[_0xa6ba('0x1c')](_0x1202b6[_0xa6ba('0x32')][_0xa6ba('0x1c')]);_0x171033['offset']=qs[_0xa6ba('0x1b')](_0x1202b6[_0xa6ba('0x32')][_0xa6ba('0x1b')]);}_0x171033[_0xa6ba('0x3a')]=qs['sort'](_0x1202b6[_0xa6ba('0x32')]['sort']);_0x171033[_0xa6ba('0x3b')]=qs[_0xa6ba('0x34')](_[_0xa6ba('0x3c')](_0x1202b6[_0xa6ba('0x32')],_0x440687['filters']),_0x5c377e);if(_0x1202b6[_0xa6ba('0x32')][_0xa6ba('0x3d')]){_0x171033[_0xa6ba('0x3b')]=_['merge'](_0x171033[_0xa6ba('0x3b')],{'$or':_[_0xa6ba('0x2b')](_0x5c377e,function(_0x45293f){if(_0x45293f['type']!=='VIRTUAL'){var _0x4dd5f8={};_0x4dd5f8[_0x45293f[_0xa6ba('0x28')]]={'$like':'%'+_0x1202b6[_0xa6ba('0x32')]['filter']+'%'};return _0x4dd5f8;}})});}_0x171033=_['merge']({},_0x171033,_0x1202b6[_0xa6ba('0x3e')]);var _0xc827c6={'where':_0x171033[_0xa6ba('0x3b')]};return db[_0xa6ba('0x2c')][_0xa6ba('0x1e')](_0xc827c6)[_0xa6ba('0x24')](function(_0x37a9d8){_0xee006['count']=_0x37a9d8;if(_0x1202b6[_0xa6ba('0x32')][_0xa6ba('0x3f')]){_0x171033['include']=[{'all':!![]}];}return db[_0xa6ba('0x2c')][_0xa6ba('0x40')](_0x171033);})[_0xa6ba('0x24')](function(_0x2b34ee){_0xee006['rows']=_0x2b34ee;return _0xee006;})['then'](respondWithFilteredResult(_0x5487a0,_0x171033))[_0xa6ba('0x41')](handleError(_0x5487a0,null));};exports[_0xa6ba('0x42')]=function(_0x59e048,_0x508ff1){var _0x2269ec={'raw':!![],'where':{'id':_0x59e048[_0xa6ba('0x43')]['id']}},_0xcd613f={};_0xcd613f[_0xa6ba('0x31')]=_[_0xa6ba('0x33')](db['CmContactHasItem'][_0xa6ba('0x2d')]);_0xcd613f['query']=_[_0xa6ba('0x33')](_0x59e048[_0xa6ba('0x32')]);_0xcd613f[_0xa6ba('0x34')]=_[_0xa6ba('0x35')](_0xcd613f[_0xa6ba('0x31')],_0xcd613f[_0xa6ba('0x32')]);_0x2269ec['attributes']=_[_0xa6ba('0x35')](_0xcd613f['model'],qs[_0xa6ba('0x36')](_0x59e048[_0xa6ba('0x32')][_0xa6ba('0x36')]));_0x2269ec[_0xa6ba('0x37')]=_0x2269ec['attributes'][_0xa6ba('0x38')]?_0x2269ec[_0xa6ba('0x37')]:_0xcd613f[_0xa6ba('0x31')];if(_0x59e048['query'][_0xa6ba('0x3f')]){_0x2269ec[_0xa6ba('0x44')]=[{'all':!![]}];}_0x2269ec=_['merge']({},_0x2269ec,_0x59e048['options']);return db[_0xa6ba('0x2c')]['find'](_0x2269ec)[_0xa6ba('0x24')](handleEntityNotFound(_0x508ff1,null))['then'](respondWithResult(_0x508ff1,null))[_0xa6ba('0x41')](handleError(_0x508ff1,null));};exports[_0xa6ba('0x45')]=function(_0x1d7f2a,_0x32e985){return db[_0xa6ba('0x2c')][_0xa6ba('0x45')](_0x1d7f2a['body'],{})[_0xa6ba('0x24')](function(_0x44b9b1){var _0x1bac0b=_0x1d7f2a[_0xa6ba('0x46')][_0xa6ba('0x26')]({'plain':!![]});if(!_0x1bac0b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1bac0b[_0xa6ba('0x47')]==='user'){var _0x59eb2a=_0x44b9b1['get']({'plain':!![]});var _0x566c01=_0xa6ba('0x48');return db['UserProfileSection'][_0xa6ba('0x49')]({'where':{'name':_0x566c01,'userProfileId':_0x1bac0b[_0xa6ba('0x4a')]},'raw':!![]})[_0xa6ba('0x24')](function(_0x1fdf41){if(_0x1fdf41&&_0x1fdf41[_0xa6ba('0x4b')]===0x0){return db[_0xa6ba('0x27')][_0xa6ba('0x45')]({'name':_0x59eb2a[_0xa6ba('0x28')],'resourceId':_0x59eb2a['id'],'type':_0x1fdf41[_0xa6ba('0x28')],'sectionId':_0x1fdf41['id']},{})['then'](function(){return _0x44b9b1;});}else{return _0x44b9b1;}})[_0xa6ba('0x41')](function(_0x4bbcf4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bbcf4);throw _0x4bbcf4;});}return _0x44b9b1;})[_0xa6ba('0x24')](respondWithResult(_0x32e985,0xc9))['catch'](handleError(_0x32e985,null));};exports[_0xa6ba('0x23')]=function(_0x7bd3aa,_0x4f166f){if(_0x7bd3aa[_0xa6ba('0x4c')]['id']){delete _0x7bd3aa[_0xa6ba('0x4c')]['id'];}return db[_0xa6ba('0x2c')][_0xa6ba('0x49')]({'where':{'id':_0x7bd3aa[_0xa6ba('0x43')]['id']}})[_0xa6ba('0x24')](handleEntityNotFound(_0x4f166f,null))[_0xa6ba('0x24')](saveUpdates(_0x7bd3aa[_0xa6ba('0x4c')],null))['then'](respondWithResult(_0x4f166f,null))[_0xa6ba('0x41')](handleError(_0x4f166f,null));};exports['destroy']=function(_0xdb76fd,_0x2f26c2){return db['CmContactHasItem'][_0xa6ba('0x49')]({'where':{'id':_0xdb76fd[_0xa6ba('0x43')]['id']}})[_0xa6ba('0x24')](handleEntityNotFound(_0x2f26c2,null))[_0xa6ba('0x24')](removeEntity(_0x2f26c2,null))[_0xa6ba('0x41')](handleError(_0x2f26c2,null));}; \ No newline at end of file +var _0xe0a9=['path','sox','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','get','CmContactHasItems','UserProfileResource','error','stack','name','send','index','map','CmContactHasItem','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util'];(function(_0x5c792f,_0x221502){var _0x2122f6=function(_0x38ca8f){while(--_0x38ca8f){_0x5c792f['push'](_0x5c792f['shift']());}};_0x2122f6(++_0x221502);}(_0xe0a9,0x136));var _0x9e0a=function(_0x1c6ba4,_0x4e2bfc){_0x1c6ba4=_0x1c6ba4-0x0;var _0x296923=_0xe0a9[_0x1c6ba4];return _0x296923;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9e0a('0x0'));var zipdir=require(_0x9e0a('0x1'));var jsonpatch=require(_0x9e0a('0x2'));var rp=require(_0x9e0a('0x3'));var moment=require('moment');var BPromise=require(_0x9e0a('0x4'));var Mustache=require('mustache');var util=require(_0x9e0a('0x5'));var path=require(_0x9e0a('0x6'));var sox=require(_0x9e0a('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9e0a('0x8'));var _=require(_0x9e0a('0x9'));var squel=require('squel');var crypto=require(_0x9e0a('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x9e0a('0xb'));var toCsv=require('to-csv');var querystring=require(_0x9e0a('0xc'));var Papa=require(_0x9e0a('0xd'));var Redis=require(_0x9e0a('0xe'));var authService=require(_0x9e0a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9e0a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9e0a('0x11'))(_0x9e0a('0x12'));var utils=require('../../config/utils');var config=require(_0x9e0a('0x13'));var licenseUtil=require(_0x9e0a('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x217173,_0x53bd36){_0x53bd36=_0x53bd36||0xcc;return function(_0x33ba76){if(_0x33ba76){return _0x217173[_0x9e0a('0x15')](_0x53bd36);}return _0x217173['status'](_0x53bd36)[_0x9e0a('0x16')]();};}function respondWithResult(_0x498eb9,_0x23cb99){_0x23cb99=_0x23cb99||0xc8;return function(_0xd55171){if(_0xd55171){return _0x498eb9[_0x9e0a('0x17')](_0x23cb99)[_0x9e0a('0x18')](_0xd55171);}};}function respondWithFilteredResult(_0x5d63a8,_0x5e3974){return function(_0x381ee7){if(_0x381ee7){var _0x2a3328=typeof _0x5e3974['offset']===_0x9e0a('0x19')&&typeof _0x5e3974[_0x9e0a('0x1a')]===_0x9e0a('0x19');var _0x3a01cd=_0x381ee7[_0x9e0a('0x1b')];var _0xeb0923=_0x2a3328?0x0:_0x5e3974[_0x9e0a('0x1c')];var _0x2e0232=_0x2a3328?_0x381ee7[_0x9e0a('0x1b')]:_0x5e3974[_0x9e0a('0x1c')]+_0x5e3974[_0x9e0a('0x1a')];var _0x1f054c;if(_0x2e0232>=_0x3a01cd){_0x2e0232=_0x3a01cd;_0x1f054c=0xc8;}else{_0x1f054c=0xce;}_0x5d63a8['status'](_0x1f054c);return _0x5d63a8[_0x9e0a('0x1d')](_0x9e0a('0x1e'),_0xeb0923+'-'+_0x2e0232+'/'+_0x3a01cd)[_0x9e0a('0x18')](_0x381ee7);}return null;};}function patchUpdates(_0x404eac){return function(_0x538099){try{jsonpatch['apply'](_0x538099,_0x404eac,!![]);}catch(_0x3fec35){return BPromise[_0x9e0a('0x1f')](_0x3fec35);}return _0x538099[_0x9e0a('0x20')]();};}function saveUpdates(_0x40c4dd,_0x10851a){return function(_0x481fa4){if(_0x481fa4){return _0x481fa4[_0x9e0a('0x21')](_0x40c4dd)[_0x9e0a('0x22')](function(_0x13cbf6){return _0x13cbf6;});}return null;};}function removeEntity(_0x29eb07,_0xaa09a9){return function(_0x123850){if(_0x123850){return _0x123850[_0x9e0a('0x23')]()[_0x9e0a('0x22')](function(){var _0x49e53d=_0x123850[_0x9e0a('0x24')]({'plain':!![]});var _0xe3820a=_0x9e0a('0x25');return db[_0x9e0a('0x26')][_0x9e0a('0x23')]({'where':{'type':_0xe3820a,'resourceId':_0x49e53d['id']}})[_0x9e0a('0x22')](function(){return _0x123850;});})['then'](function(){_0x29eb07['status'](0xcc)[_0x9e0a('0x16')]();});}};}function handleEntityNotFound(_0x25f125,_0x493e55){return function(_0x2b93e9){if(!_0x2b93e9){_0x25f125[_0x9e0a('0x15')](0x194);}return _0x2b93e9;};}function handleError(_0x537dfd,_0x187469){_0x187469=_0x187469||0x1f4;return function(_0x12bb0d){logger[_0x9e0a('0x27')](_0x12bb0d[_0x9e0a('0x28')]);if(_0x12bb0d[_0x9e0a('0x29')]){delete _0x12bb0d[_0x9e0a('0x29')];}_0x537dfd[_0x9e0a('0x17')](_0x187469)[_0x9e0a('0x2a')](_0x12bb0d);};}exports[_0x9e0a('0x2b')]=function(_0x312da3,_0x3697a3){var _0x5c1778={},_0x3d7479={},_0x365cde={'count':0x0,'rows':[]};var _0x52c24b=_[_0x9e0a('0x2c')](db[_0x9e0a('0x2d')]['rawAttributes'],function(_0x2e49bd){return{'name':_0x2e49bd[_0x9e0a('0x2e')],'type':_0x2e49bd[_0x9e0a('0x2f')][_0x9e0a('0x30')]};});_0x3d7479[_0x9e0a('0x31')]=_[_0x9e0a('0x2c')](_0x52c24b,_0x9e0a('0x29'));_0x3d7479[_0x9e0a('0x32')]=_[_0x9e0a('0x33')](_0x312da3[_0x9e0a('0x32')]);_0x3d7479[_0x9e0a('0x34')]=_[_0x9e0a('0x35')](_0x3d7479[_0x9e0a('0x31')],_0x3d7479[_0x9e0a('0x32')]);_0x5c1778['attributes']=_['intersection'](_0x3d7479['model'],qs['fields'](_0x312da3['query'][_0x9e0a('0x36')]));_0x5c1778['attributes']=_0x5c1778['attributes'][_0x9e0a('0x37')]?_0x5c1778[_0x9e0a('0x38')]:_0x3d7479[_0x9e0a('0x31')];if(!_0x312da3[_0x9e0a('0x32')]['hasOwnProperty']('nolimit')){_0x5c1778[_0x9e0a('0x1a')]=qs['limit'](_0x312da3['query'][_0x9e0a('0x1a')]);_0x5c1778[_0x9e0a('0x1c')]=qs['offset'](_0x312da3[_0x9e0a('0x32')][_0x9e0a('0x1c')]);}_0x5c1778['order']=qs['sort'](_0x312da3[_0x9e0a('0x32')]['sort']);_0x5c1778[_0x9e0a('0x39')]=qs[_0x9e0a('0x34')](_[_0x9e0a('0x3a')](_0x312da3[_0x9e0a('0x32')],_0x3d7479[_0x9e0a('0x34')]),_0x52c24b);if(_0x312da3[_0x9e0a('0x32')][_0x9e0a('0x3b')]){_0x5c1778[_0x9e0a('0x39')]=_[_0x9e0a('0x3c')](_0x5c1778[_0x9e0a('0x39')],{'$or':_[_0x9e0a('0x2c')](_0x52c24b,function(_0x1050ce){if(_0x1050ce[_0x9e0a('0x2f')]!==_0x9e0a('0x3d')){var _0x1848c6={};_0x1848c6[_0x1050ce[_0x9e0a('0x29')]]={'$like':'%'+_0x312da3[_0x9e0a('0x32')][_0x9e0a('0x3b')]+'%'};return _0x1848c6;}})});}_0x5c1778=_[_0x9e0a('0x3c')]({},_0x5c1778,_0x312da3[_0x9e0a('0x3e')]);var _0x323ffd={'where':_0x5c1778[_0x9e0a('0x39')]};return db[_0x9e0a('0x2d')][_0x9e0a('0x1b')](_0x323ffd)[_0x9e0a('0x22')](function(_0x5891f5){_0x365cde[_0x9e0a('0x1b')]=_0x5891f5;if(_0x312da3[_0x9e0a('0x32')][_0x9e0a('0x3f')]){_0x5c1778[_0x9e0a('0x40')]=[{'all':!![]}];}return db['CmContactHasItem']['findAll'](_0x5c1778);})[_0x9e0a('0x22')](function(_0x49a1fb){_0x365cde[_0x9e0a('0x41')]=_0x49a1fb;return _0x365cde;})[_0x9e0a('0x22')](respondWithFilteredResult(_0x3697a3,_0x5c1778))[_0x9e0a('0x42')](handleError(_0x3697a3,null));};exports[_0x9e0a('0x43')]=function(_0x1880c2,_0x524c63){var _0x272264={'raw':!![],'where':{'id':_0x1880c2[_0x9e0a('0x44')]['id']}},_0x33bbbc={};_0x33bbbc[_0x9e0a('0x31')]=_[_0x9e0a('0x33')](db[_0x9e0a('0x2d')][_0x9e0a('0x45')]);_0x33bbbc['query']=_[_0x9e0a('0x33')](_0x1880c2[_0x9e0a('0x32')]);_0x33bbbc['filters']=_[_0x9e0a('0x35')](_0x33bbbc[_0x9e0a('0x31')],_0x33bbbc[_0x9e0a('0x32')]);_0x272264[_0x9e0a('0x38')]=_['intersection'](_0x33bbbc[_0x9e0a('0x31')],qs[_0x9e0a('0x36')](_0x1880c2[_0x9e0a('0x32')][_0x9e0a('0x36')]));_0x272264['attributes']=_0x272264['attributes']['length']?_0x272264[_0x9e0a('0x38')]:_0x33bbbc[_0x9e0a('0x31')];if(_0x1880c2['query'][_0x9e0a('0x3f')]){_0x272264['include']=[{'all':!![]}];}_0x272264=_[_0x9e0a('0x3c')]({},_0x272264,_0x1880c2[_0x9e0a('0x3e')]);return db[_0x9e0a('0x2d')][_0x9e0a('0x46')](_0x272264)[_0x9e0a('0x22')](handleEntityNotFound(_0x524c63,null))[_0x9e0a('0x22')](respondWithResult(_0x524c63,null))[_0x9e0a('0x42')](handleError(_0x524c63,null));};exports['create']=function(_0x17efec,_0x1f2a66){return db['CmContactHasItem'][_0x9e0a('0x47')](_0x17efec[_0x9e0a('0x48')],{})[_0x9e0a('0x22')](function(_0x92d1bc){var _0x5bbd99=_0x17efec[_0x9e0a('0x49')][_0x9e0a('0x24')]({'plain':!![]});if(!_0x5bbd99)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5bbd99[_0x9e0a('0x4a')]===_0x9e0a('0x49')){var _0x21f08b=_0x92d1bc['get']({'plain':!![]});var _0x121db6='CmContactHasItems';return db[_0x9e0a('0x4b')][_0x9e0a('0x46')]({'where':{'name':_0x121db6,'userProfileId':_0x5bbd99[_0x9e0a('0x4c')]},'raw':!![]})[_0x9e0a('0x22')](function(_0x23b727){if(_0x23b727&&_0x23b727[_0x9e0a('0x4d')]===0x0){return db[_0x9e0a('0x26')][_0x9e0a('0x47')]({'name':_0x21f08b['name'],'resourceId':_0x21f08b['id'],'type':_0x23b727[_0x9e0a('0x29')],'sectionId':_0x23b727['id']},{})[_0x9e0a('0x22')](function(){return _0x92d1bc;});}else{return _0x92d1bc;}})['catch'](function(_0x238c22){logger[_0x9e0a('0x27')](_0x9e0a('0x4e'),_0x238c22);throw _0x238c22;});}return _0x92d1bc;})[_0x9e0a('0x22')](respondWithResult(_0x1f2a66,0xc9))['catch'](handleError(_0x1f2a66,null));};exports['update']=function(_0x4c8f83,_0x1e75cb){if(_0x4c8f83['body']['id']){delete _0x4c8f83[_0x9e0a('0x48')]['id'];}return db[_0x9e0a('0x2d')][_0x9e0a('0x46')]({'where':{'id':_0x4c8f83['params']['id']}})[_0x9e0a('0x22')](handleEntityNotFound(_0x1e75cb,null))[_0x9e0a('0x22')](saveUpdates(_0x4c8f83[_0x9e0a('0x48')],null))['then'](respondWithResult(_0x1e75cb,null))[_0x9e0a('0x42')](handleError(_0x1e75cb,null));};exports['destroy']=function(_0x2c6eb4,_0x4ebdd0){return db[_0x9e0a('0x2d')][_0x9e0a('0x46')]({'where':{'id':_0x2c6eb4[_0x9e0a('0x44')]['id']}})[_0x9e0a('0x22')](handleEntityNotFound(_0x4ebdd0,null))['then'](removeEntity(_0x4ebdd0,null))[_0x9e0a('0x42')](handleError(_0x4ebdd0,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 633e972..2e657d0 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.model.js +++ b/server/api/cmContactHasItem/cmContactHasItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9093=['../../config/logger','moment','path','../../config/environment','./cmContactHasItem.attributes','exports','define','CmContactHasItem','cm_contact_has_items','util'];(function(_0x146b09,_0x345cd3){var _0x4e9e36=function(_0x1d9749){while(--_0x1d9749){_0x146b09['push'](_0x146b09['shift']());}};_0x4e9e36(++_0x345cd3);}(_0x9093,0x77));var _0x3909=function(_0x171a31,_0x428330){_0x171a31=_0x171a31-0x0;var _0x36db6e=_0x9093[_0x171a31];return _0x36db6e;};'use strict';var _=require('lodash');var util=require(_0x3909('0x0'));var logger=require(_0x3909('0x1'))('api');var moment=require(_0x3909('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3909('0x3'));var rimraf=require('rimraf');var config=require(_0x3909('0x4'));var attributes=require(_0x3909('0x5'));module[_0x3909('0x6')]=function(_0x1881dc,_0x2e33a0){return _0x1881dc[_0x3909('0x7')](_0x3909('0x8'),attributes,{'tableName':_0x3909('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x43ef=['bluebird','path','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','define','CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x43ef,0x98));var _0xf43e=function(_0x53cb61,_0x358d87){_0x53cb61=_0x53cb61-0x0;var _0x339d0b=_0x43ef[_0x53cb61];return _0x339d0b;};'use strict';var _=require(_0xf43e('0x0'));var util=require(_0xf43e('0x1'));var logger=require(_0xf43e('0x2'))(_0xf43e('0x3'));var moment=require('moment');var BPromise=require(_0xf43e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf43e('0x5'));var rimraf=require(_0xf43e('0x6'));var config=require(_0xf43e('0x7'));var attributes=require(_0xf43e('0x8'));module[_0xf43e('0x9')]=function(_0x343066,_0x3b7c42){return _0x343066[_0xf43e('0xa')](_0xf43e('0xb'),attributes,{'tableName':_0xf43e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index 783e832..e198fca 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.rpc.js +++ b/server/api/cmContactHasItem/cmContactHasItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x50a9=['request','then','CmContactHasItem,\x20%s,\x20%s','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x50a9,0x1ad));var _0x950a=function(_0xcc22ef,_0x410e8d){_0xcc22ef=_0xcc22ef-0x0;var _0x3382f7=_0x50a9[_0xcc22ef];return _0x3382f7;};'use strict';var _=require(_0x950a('0x0'));var util=require(_0x950a('0x1'));var moment=require(_0x950a('0x2'));var BPromise=require(_0x950a('0x3'));var rs=require(_0x950a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x950a('0x5'));var logger=require(_0x950a('0x6'))(_0x950a('0x7'));var config=require(_0x950a('0x8'));var jayson=require(_0x950a('0x9'));var client=jayson['client'][_0x950a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12caee,_0x401b7d,_0x382ee7){return new BPromise(function(_0x3e2bbd,_0x18ee15){return client[_0x950a('0xb')](_0x12caee,_0x382ee7)[_0x950a('0xc')](function(_0x2dec28){logger['info'](_0x950a('0xd'),_0x401b7d,'request\x20sent');logger[_0x950a('0xe')](_0x950a('0xf'),_0x401b7d,_0x950a('0x10'),JSON['stringify'](_0x2dec28));if(_0x2dec28[_0x950a('0x11')]){if(_0x2dec28[_0x950a('0x11')][_0x950a('0x12')]===0x1f4){logger[_0x950a('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x401b7d,_0x2dec28[_0x950a('0x11')]['message']);return _0x18ee15(_0x2dec28['error']['message']);}logger[_0x950a('0x11')](_0x950a('0xd'),_0x401b7d,_0x2dec28[_0x950a('0x11')][_0x950a('0x13')]);return _0x3e2bbd(_0x2dec28[_0x950a('0x11')][_0x950a('0x13')]);}else{logger[_0x950a('0x14')]('CmContactHasItem,\x20%s,\x20%s',_0x401b7d,_0x950a('0x10'));_0x3e2bbd(_0x2dec28[_0x950a('0x15')][_0x950a('0x13')]);}})['catch'](function(_0x1a3aeb){logger[_0x950a('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x401b7d,_0x1a3aeb);_0x18ee15(_0x1a3aeb);});});} \ No newline at end of file +var _0xa6e8=['request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x4fb1b8,_0x32d98d){var _0x146c71=function(_0x4bb74e){while(--_0x4bb74e){_0x4fb1b8['push'](_0x4fb1b8['shift']());}};_0x146c71(++_0x32d98d);}(_0xa6e8,0x17d));var _0x8a6e=function(_0x29b8e7,_0x61a808){_0x29b8e7=_0x29b8e7-0x0;var _0x2dbb49=_0xa6e8[_0x29b8e7];return _0x2dbb49;};'use strict';var _=require(_0x8a6e('0x0'));var util=require(_0x8a6e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8a6e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a6e('0x3'))['db'];var utils=require(_0x8a6e('0x4'));var logger=require(_0x8a6e('0x5'))(_0x8a6e('0x6'));var config=require('../../config/environment');var jayson=require(_0x8a6e('0x7'));var client=jayson[_0x8a6e('0x8')][_0x8a6e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31824d,_0x1a1df1,_0x307a33){return new BPromise(function(_0x59d43b,_0x4f0dad){return client[_0x8a6e('0xa')](_0x31824d,_0x307a33)[_0x8a6e('0xb')](function(_0x397957){logger[_0x8a6e('0xc')](_0x8a6e('0xd'),_0x1a1df1,_0x8a6e('0xe'));logger[_0x8a6e('0xf')](_0x8a6e('0x10'),_0x1a1df1,'request\x20sent',JSON[_0x8a6e('0x11')](_0x397957));if(_0x397957[_0x8a6e('0x12')]){if(_0x397957[_0x8a6e('0x12')][_0x8a6e('0x13')]===0x1f4){logger[_0x8a6e('0x12')](_0x8a6e('0xd'),_0x1a1df1,_0x397957[_0x8a6e('0x12')][_0x8a6e('0x14')]);return _0x4f0dad(_0x397957[_0x8a6e('0x12')][_0x8a6e('0x14')]);}logger['error'](_0x8a6e('0xd'),_0x1a1df1,_0x397957[_0x8a6e('0x12')][_0x8a6e('0x14')]);return _0x59d43b(_0x397957[_0x8a6e('0x12')]['message']);}else{logger[_0x8a6e('0xc')]('CmContactHasItem,\x20%s,\x20%s',_0x1a1df1,'request\x20sent');_0x59d43b(_0x397957[_0x8a6e('0x15')]['message']);}})[_0x8a6e('0x16')](function(_0x3ee000){logger['error'](_0x8a6e('0xd'),_0x1a1df1,_0x3ee000);_0x4f0dad(_0x3ee000);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 019d1ce..99368ed 100644 --- a/server/api/cmContactHasItem/index.js +++ b/server/api/cmContactHasItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb49=['isAuthenticated','show','create','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xcb49,0x156));var _0x9cb4=function(_0xd158dc,_0x128608){_0xd158dc=_0xd158dc-0x0;var _0x12d25f=_0xcb49[_0xd158dc];return _0x12d25f;};'use strict';var multer=require(_0x9cb4('0x0'));var util=require('util');var path=require(_0x9cb4('0x1'));var timeout=require(_0x9cb4('0x2'));var express=require(_0x9cb4('0x3'));var router=express[_0x9cb4('0x4')]();var fs_extra=require(_0x9cb4('0x5'));var auth=require(_0x9cb4('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmContactHasItem.controller');router[_0x9cb4('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9cb4('0x7')]('/:id',auth[_0x9cb4('0x8')](),controller[_0x9cb4('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9cb4('0xa')]);router['put'](_0x9cb4('0xb'),auth[_0x9cb4('0x8')](),controller['update']);router['delete'](_0x9cb4('0xb'),auth[_0x9cb4('0x8')](),controller[_0x9cb4('0xc')]);module[_0x9cb4('0xd')]=router; \ No newline at end of file +var _0xffe2=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer'];(function(_0x1e6659,_0x1f860c){var _0x4d16e4=function(_0x21c05a){while(--_0x21c05a){_0x1e6659['push'](_0x1e6659['shift']());}};_0x4d16e4(++_0x1f860c);}(_0xffe2,0x167));var _0x2ffe=function(_0x276108,_0x4c8922){_0x276108=_0x276108-0x0;var _0x4fb626=_0xffe2[_0x276108];return _0x4fb626;};'use strict';var multer=require(_0x2ffe('0x0'));var util=require(_0x2ffe('0x1'));var path=require(_0x2ffe('0x2'));var timeout=require(_0x2ffe('0x3'));var express=require(_0x2ffe('0x4'));var router=express['Router']();var fs_extra=require(_0x2ffe('0x5'));var auth=require(_0x2ffe('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2ffe('0x7'));var controller=require(_0x2ffe('0x8'));router[_0x2ffe('0x9')]('/',auth[_0x2ffe('0xa')](),controller[_0x2ffe('0xb')]);router['get'](_0x2ffe('0xc'),auth[_0x2ffe('0xa')](),controller[_0x2ffe('0xd')]);router[_0x2ffe('0xe')]('/',auth[_0x2ffe('0xa')](),controller[_0x2ffe('0xf')]);router['put'](_0x2ffe('0xc'),auth[_0x2ffe('0xa')](),controller[_0x2ffe('0x10')]);router[_0x2ffe('0x11')]('/:id',auth[_0x2ffe('0xa')](),controller[_0x2ffe('0x12')]);module[_0x2ffe('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 4080517..d9e984c 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 _0xf3aa=['voice','lodash','getDataValue','alias','STRING','setDataValue','name','TEXT','long','parse','values','isArray','stringify','BOOLEAN','ENUM'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0xf3aa,0x11e));var _0xaf3a=function(_0x584f66,_0x39a037){_0x584f66=_0x584f66-0x0;var _0x3908b4=_0xf3aa[_0x584f66];return _0x3908b4;};'use strict';var Sequelize=require('sequelize');var _=require(_0xaf3a('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x225db6){return this[_0xaf3a('0x1')](_0xaf3a('0x2'));}},'alias':{'type':Sequelize[_0xaf3a('0x3')],'allowNull':![],'set':function(_0x384136){this[_0xaf3a('0x4')](_0xaf3a('0x2'),_0x384136?_0x384136:this[_0xaf3a('0x1')](_0xaf3a('0x5')));}},'type':{'type':Sequelize[_0xaf3a('0x3')],'allowNull':![]},'values':{'type':Sequelize[_0xaf3a('0x6')](_0xaf3a('0x7')),'get':function(){if(this[_0xaf3a('0x1')]('type')==='select'){return JSON[_0xaf3a('0x8')](this[_0xaf3a('0x1')](_0xaf3a('0x9')));}else{return this[_0xaf3a('0x1')](_0xaf3a('0x9'));}},'set':function(_0x33bcdf){if(Array[_0xaf3a('0xa')](_0x33bcdf)){this[_0xaf3a('0x4')](_0xaf3a('0x9'),JSON[_0xaf3a('0xb')](_0x33bcdf));}else{this[_0xaf3a('0x4')](_0xaf3a('0x9'),_0x33bcdf);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xaf3a('0xc')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xaf3a('0xd')](_0xaf3a('0xe'))}}; \ No newline at end of file +var _0x6e6f=['parse','values','isArray','BOOLEAN','ENUM','sequelize','exports','VIRTUAL','getDataValue','STRING','setDataValue','alias','TEXT','long'];(function(_0x2c9119,_0x3fa21f){var _0x4b92fa=function(_0x37b2ed){while(--_0x37b2ed){_0x2c9119['push'](_0x2c9119['shift']());}};_0x4b92fa(++_0x3fa21f);}(_0x6e6f,0x1d3));var _0xf6e6=function(_0x5e1f4b,_0x50b208){_0x5e1f4b=_0x5e1f4b-0x0;var _0x5ce7b4=_0x6e6f[_0x5e1f4b];return _0x5ce7b4;};'use strict';var Sequelize=require(_0xf6e6('0x0'));var _=require('lodash');module[_0xf6e6('0x1')]={'name':{'type':Sequelize[_0xf6e6('0x2')],'get':function(_0xc792aa){return this[_0xf6e6('0x3')]('alias');}},'alias':{'type':Sequelize[_0xf6e6('0x4')],'allowNull':![],'set':function(_0x25efde){this[_0xf6e6('0x5')](_0xf6e6('0x6'),_0x25efde?_0x25efde:this[_0xf6e6('0x3')]('name'));}},'type':{'type':Sequelize[_0xf6e6('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0xf6e6('0x7')](_0xf6e6('0x8')),'get':function(){if(this[_0xf6e6('0x3')]('type')==='select'){return JSON[_0xf6e6('0x9')](this['getDataValue'](_0xf6e6('0xa')));}else{return this[_0xf6e6('0x3')]('values');}},'set':function(_0x4da05a){if(Array[_0xf6e6('0xb')](_0x4da05a)){this[_0xf6e6('0x5')]('values',JSON['stringify'](_0x4da05a));}else{this[_0xf6e6('0x5')]('values',_0x4da05a);}}},'required':{'type':Sequelize[_0xf6e6('0xc')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xf6e6('0xc')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xf6e6('0xd')]('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 5acf416..e75b825 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 _0x48a5=['where','filters','pick','filter','merge','VIRTUAL','count','then','include','findAll','rows','catch','params','rawAttributes','includeAll','options','body','find','create','sequelize','transaction','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%d','eml-format','zip-dir','fast-json-patch','util','path','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','end','status','json','undefined','limit','offset','set','apply','reject','update','destroy','sendStatus','error','name','send','map','CmCustomField','fieldName','type','key','keys','query','model','attributes','intersection','fields','length','nolimit','order','sort'];(function(_0x4ddc9b,_0x560320){var _0x3e1314=function(_0x21f7c8){while(--_0x21f7c8){_0x4ddc9b['push'](_0x4ddc9b['shift']());}};_0x3e1314(++_0x560320);}(_0x48a5,0x1b0));var _0x548a=function(_0x55836a,_0x31cf6f){_0x55836a=_0x55836a-0x0;var _0x11abe0=_0x48a5[_0x55836a];return _0x11abe0;};'use strict';var emlformat=require(_0x548a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x548a('0x1'));var jsonpatch=require(_0x548a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x548a('0x3'));var path=require(_0x548a('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x548a('0x5'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x548a('0x6'));var jsforce=require(_0x548a('0x7'));var deskjs=require(_0x548a('0x8'));var toCsv=require(_0x548a('0x9'));var querystring=require(_0x548a('0xa'));var Papa=require('papaparse');var Redis=require(_0x548a('0xb'));var authService=require(_0x548a('0xc'));var qs=require(_0x548a('0xd'));var as=require(_0x548a('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x548a('0xf'))(_0x548a('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x548a('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5181e1,_0x2a0298){_0x2a0298=_0x2a0298||0xcc;return function(_0x401113){if(_0x401113){return _0x5181e1['sendStatus'](_0x2a0298);}return _0x5181e1['status'](_0x2a0298)[_0x548a('0x12')]();};}function respondWithResult(_0x4c9030,_0x15a9b6){_0x15a9b6=_0x15a9b6||0xc8;return function(_0x48b360){if(_0x48b360){return _0x4c9030[_0x548a('0x13')](_0x15a9b6)[_0x548a('0x14')](_0x48b360);}};}function respondWithFilteredResult(_0x1ae8de,_0x2b8156){return function(_0x57e485){if(_0x57e485){var _0x4318a7=typeof _0x2b8156['offset']===_0x548a('0x15')&&typeof _0x2b8156[_0x548a('0x16')]===_0x548a('0x15');var _0x115de1=_0x57e485['count'];var _0x117191=_0x4318a7?0x0:_0x2b8156['offset'];var _0x46ca8a=_0x4318a7?_0x57e485['count']:_0x2b8156[_0x548a('0x17')]+_0x2b8156[_0x548a('0x16')];var _0x4b7f5d;if(_0x46ca8a>=_0x115de1){_0x46ca8a=_0x115de1;_0x4b7f5d=0xc8;}else{_0x4b7f5d=0xce;}_0x1ae8de[_0x548a('0x13')](_0x4b7f5d);return _0x1ae8de[_0x548a('0x18')]('Content-Range',_0x117191+'-'+_0x46ca8a+'/'+_0x115de1)['json'](_0x57e485);}return null;};}function patchUpdates(_0x526025){return function(_0x4a319c){try{jsonpatch[_0x548a('0x19')](_0x4a319c,_0x526025,!![]);}catch(_0x33c810){return BPromise[_0x548a('0x1a')](_0x33c810);}return _0x4a319c['save']();};}function saveUpdates(_0x592785,_0x1b82aa){return function(_0x125b26){if(_0x125b26){return _0x125b26[_0x548a('0x1b')](_0x592785)['then'](function(_0x4e0153){return _0x4e0153;});}return null;};}function removeEntity(_0x41145c,_0x550818){return function(_0x49e88a){if(_0x49e88a){return _0x49e88a[_0x548a('0x1c')]()['then'](function(){_0x41145c[_0x548a('0x13')](0xcc)[_0x548a('0x12')]();});}};}function handleEntityNotFound(_0x5ddc1e,_0x5ed7b6){return function(_0x1313ed){if(!_0x1313ed){_0x5ddc1e[_0x548a('0x1d')](0x194);}return _0x1313ed;};}function handleError(_0x581aff,_0x35611e){_0x35611e=_0x35611e||0x1f4;return function(_0x130e73){logger[_0x548a('0x1e')](_0x130e73['stack']);if(_0x130e73[_0x548a('0x1f')]){delete _0x130e73[_0x548a('0x1f')];}_0x581aff[_0x548a('0x13')](_0x35611e)[_0x548a('0x20')](_0x130e73);};}exports['index']=function(_0x31e936,_0x37604f){var _0x72b40d={},_0x4e9da5={},_0xa4eca2={'count':0x0,'rows':[]};var _0x31ff90=_[_0x548a('0x21')](db[_0x548a('0x22')]['rawAttributes'],function(_0x1909d6){return{'name':_0x1909d6[_0x548a('0x23')],'type':_0x1909d6[_0x548a('0x24')][_0x548a('0x25')]};});_0x4e9da5['model']=_['differenceBy'](_[_0x548a('0x21')](_0x31ff90,_0x548a('0x1f')),[_0x548a('0x1f')]);_0x4e9da5['query']=_[_0x548a('0x26')](_0x31e936[_0x548a('0x27')]);_0x4e9da5['filters']=_['intersection'](_0x4e9da5[_0x548a('0x28')],_0x4e9da5[_0x548a('0x27')]);_0x72b40d[_0x548a('0x29')]=_[_0x548a('0x2a')](_0x4e9da5[_0x548a('0x28')],qs[_0x548a('0x2b')](_0x31e936[_0x548a('0x27')][_0x548a('0x2b')]));_0x72b40d['attributes']=_0x72b40d[_0x548a('0x29')][_0x548a('0x2c')]?_0x72b40d['attributes']:_0x4e9da5[_0x548a('0x28')];if(!_0x31e936[_0x548a('0x27')]['hasOwnProperty'](_0x548a('0x2d'))){_0x72b40d[_0x548a('0x16')]=qs['limit'](_0x31e936[_0x548a('0x27')][_0x548a('0x16')]);_0x72b40d['offset']=qs['offset'](_0x31e936['query']['offset']);}_0x72b40d[_0x548a('0x2e')]=qs['sort'](_0x31e936[_0x548a('0x27')][_0x548a('0x2f')]);_0x72b40d[_0x548a('0x30')]=qs[_0x548a('0x31')](_[_0x548a('0x32')](_0x31e936['query'],_0x4e9da5[_0x548a('0x31')]),_0x31ff90);if(_0x31e936[_0x548a('0x27')][_0x548a('0x33')]){_0x72b40d[_0x548a('0x30')]=_[_0x548a('0x34')](_0x72b40d[_0x548a('0x30')],{'$or':_['map'](_0x31ff90,function(_0x270378){if(_0x270378[_0x548a('0x24')]!==_0x548a('0x35')){var _0x3784de={};_0x3784de[_0x270378[_0x548a('0x1f')]]={'$like':'%'+_0x31e936[_0x548a('0x27')][_0x548a('0x33')]+'%'};return _0x3784de;}})});}_0x72b40d=_[_0x548a('0x34')]({},_0x72b40d,_0x31e936['options']);var _0x3d51fa={'where':_0x72b40d[_0x548a('0x30')]};return db[_0x548a('0x22')][_0x548a('0x36')](_0x3d51fa)[_0x548a('0x37')](function(_0x482c4f){_0xa4eca2[_0x548a('0x36')]=_0x482c4f;if(_0x31e936['query']['includeAll']){_0x72b40d[_0x548a('0x38')]=[{'all':!![]}];}return db[_0x548a('0x22')][_0x548a('0x39')](_0x72b40d);})['then'](function(_0x15d1d1){_0xa4eca2[_0x548a('0x3a')]=_0x15d1d1;return _0xa4eca2;})[_0x548a('0x37')](respondWithFilteredResult(_0x37604f,_0x72b40d))[_0x548a('0x3b')](handleError(_0x37604f,null));};exports['show']=function(_0x10398f,_0x5cebd0){var _0x302b9f={'raw':!![],'where':{'id':_0x10398f[_0x548a('0x3c')]['id']}},_0xf29010={};_0xf29010['model']=_[_0x548a('0x26')](db[_0x548a('0x22')][_0x548a('0x3d')]);_0xf29010[_0x548a('0x27')]=_[_0x548a('0x26')](_0x10398f[_0x548a('0x27')]);_0xf29010[_0x548a('0x31')]=_[_0x548a('0x2a')](_0xf29010[_0x548a('0x28')],_0xf29010[_0x548a('0x27')]);_0x302b9f[_0x548a('0x29')]=_[_0x548a('0x2a')](_0xf29010['model'],qs[_0x548a('0x2b')](_0x10398f[_0x548a('0x27')][_0x548a('0x2b')]));_0x302b9f[_0x548a('0x29')]=_0x302b9f[_0x548a('0x29')][_0x548a('0x2c')]?_0x302b9f['attributes']:_0xf29010[_0x548a('0x28')];if(_0x10398f[_0x548a('0x27')][_0x548a('0x3e')]){_0x302b9f[_0x548a('0x38')]=[{'all':!![]}];}_0x302b9f=_[_0x548a('0x34')]({},_0x302b9f,_0x10398f[_0x548a('0x3f')]);return db['CmCustomField']['find'](_0x302b9f)[_0x548a('0x37')](handleEntityNotFound(_0x5cebd0,null))[_0x548a('0x37')](respondWithResult(_0x5cebd0,null))[_0x548a('0x3b')](handleError(_0x5cebd0,null));};exports['update']=function(_0x38eb82,_0x1c9a1c){if(_0x38eb82['body']['id']){delete _0x38eb82[_0x548a('0x40')]['id'];}return db[_0x548a('0x22')][_0x548a('0x41')]({'where':{'id':_0x38eb82[_0x548a('0x3c')]['id']}})[_0x548a('0x37')](handleEntityNotFound(_0x1c9a1c,null))[_0x548a('0x37')](saveUpdates(_0x38eb82['body'],null))[_0x548a('0x37')](respondWithResult(_0x1c9a1c,null))[_0x548a('0x3b')](handleError(_0x1c9a1c,null));};exports[_0x548a('0x1c')]=function(_0x3228d5,_0x93701d){return db[_0x548a('0x22')]['find']({'where':{'id':_0x3228d5[_0x548a('0x3c')]['id']}})[_0x548a('0x37')](handleEntityNotFound(_0x93701d,null))[_0x548a('0x37')](removeEntity(_0x93701d,null))[_0x548a('0x3b')](handleError(_0x93701d,null));};exports[_0x548a('0x42')]=function(_0x502f3f,_0x317345){var _0x11c89b;return db[_0x548a('0x43')][_0x548a('0x44')](function(_0x1b094e){return db['CmCustomField'][_0x548a('0x42')](_0x502f3f[_0x548a('0x40')],{'transaction':_0x1b094e})[_0x548a('0x37')](function(_0x263df7){_0x11c89b=_0x263df7;var _0x116ada={'type':db['Sequelize']['TEXT'],'transaction':_0x1b094e};switch(_0x502f3f[_0x548a('0x40')][_0x548a('0x24')]){case'text':_0x116ada[_0x548a('0x24')]=db[_0x548a('0x45')][_0x548a('0x46')];break;case _0x548a('0x47'):_0x116ada['type']=db['Sequelize'][_0x548a('0x48')];break;case _0x548a('0x49'):_0x116ada[_0x548a('0x24')]=db[_0x548a('0x45')][_0x548a('0x4a')];_0x116ada[_0x548a('0x4b')]=![];break;default:}return db[_0x548a('0x43')][_0x548a('0x4c')][_0x548a('0x4d')](_0x548a('0x4e'),util['format'](_0x548a('0x4f'),_0x11c89b['id']),_0x116ada);})[_0x548a('0x37')](function(){return _0x11c89b;});})[_0x548a('0x37')](respondWithResult(_0x317345,0xc9))[_0x548a('0x3b')](handleError(_0x317345,null));}; \ No newline at end of file +var _0xdf9f=['addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','map','CmCustomField','rawAttributes','type','differenceBy','query','keys','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','params','find','update','body','destroy','create','sequelize','transaction','TEXT','text','number','Sequelize','INTEGER','BOOLEAN','defaultValue','queryInterface'];(function(_0x53ba56,_0x451f4f){var _0x32408f=function(_0x523f57){while(--_0x523f57){_0x53ba56['push'](_0x53ba56['shift']());}};_0x32408f(++_0x451f4f);}(_0xdf9f,0x10f));var _0xfdf9=function(_0x2c5eaf,_0x2911ca){_0x2c5eaf=_0x2c5eaf-0x0;var _0x461118=_0xdf9f[_0x2c5eaf];return _0x461118;};'use strict';var emlformat=require(_0xfdf9('0x0'));var rimraf=require(_0xfdf9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfdf9('0x2'));var Mustache=require(_0xfdf9('0x3'));var util=require('util');var path=require(_0xfdf9('0x4'));var sox=require('sox');var csv=require(_0xfdf9('0x5'));var ejs=require(_0xfdf9('0x6'));var fs=require('fs');var fs_extra=require(_0xfdf9('0x7'));var _=require(_0xfdf9('0x8'));var squel=require(_0xfdf9('0x9'));var crypto=require(_0xfdf9('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xfdf9('0xb'));var toCsv=require(_0xfdf9('0x5'));var querystring=require(_0xfdf9('0xc'));var Papa=require(_0xfdf9('0xd'));var Redis=require(_0xfdf9('0xe'));var authService=require(_0xfdf9('0xf'));var qs=require(_0xfdf9('0x10'));var as=require(_0xfdf9('0x11'));var hardwareService=require(_0xfdf9('0x12'));var logger=require(_0xfdf9('0x13'))(_0xfdf9('0x14'));var utils=require(_0xfdf9('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xfdf9('0x16'));var db=require(_0xfdf9('0x17'))['db'];function respondWithStatusCode(_0x285e84,_0x5a2536){_0x5a2536=_0x5a2536||0xcc;return function(_0x64c676){if(_0x64c676){return _0x285e84[_0xfdf9('0x18')](_0x5a2536);}return _0x285e84[_0xfdf9('0x19')](_0x5a2536)[_0xfdf9('0x1a')]();};}function respondWithResult(_0x130fd2,_0x342366){_0x342366=_0x342366||0xc8;return function(_0x4b2136){if(_0x4b2136){return _0x130fd2[_0xfdf9('0x19')](_0x342366)[_0xfdf9('0x1b')](_0x4b2136);}};}function respondWithFilteredResult(_0x4daa9d,_0x58be0a){return function(_0x358e9c){if(_0x358e9c){var _0xd303b6=typeof _0x58be0a['offset']===_0xfdf9('0x1c')&&typeof _0x58be0a[_0xfdf9('0x1d')]===_0xfdf9('0x1c');var _0x14a1c5=_0x358e9c['count'];var _0x3cfef9=_0xd303b6?0x0:_0x58be0a[_0xfdf9('0x1e')];var _0x581a5f=_0xd303b6?_0x358e9c[_0xfdf9('0x1f')]:_0x58be0a['offset']+_0x58be0a['limit'];var _0x3fa0b2;if(_0x581a5f>=_0x14a1c5){_0x581a5f=_0x14a1c5;_0x3fa0b2=0xc8;}else{_0x3fa0b2=0xce;}_0x4daa9d[_0xfdf9('0x19')](_0x3fa0b2);return _0x4daa9d[_0xfdf9('0x20')](_0xfdf9('0x21'),_0x3cfef9+'-'+_0x581a5f+'/'+_0x14a1c5)[_0xfdf9('0x1b')](_0x358e9c);}return null;};}function patchUpdates(_0x4024f1){return function(_0x4d9bd3){try{jsonpatch[_0xfdf9('0x22')](_0x4d9bd3,_0x4024f1,!![]);}catch(_0x7f179e){return BPromise[_0xfdf9('0x23')](_0x7f179e);}return _0x4d9bd3[_0xfdf9('0x24')]();};}function saveUpdates(_0xb55313,_0x20fab1){return function(_0x554761){if(_0x554761){return _0x554761['update'](_0xb55313)['then'](function(_0x553881){return _0x553881;});}return null;};}function removeEntity(_0x5a1679,_0x471f28){return function(_0x5d24b6){if(_0x5d24b6){return _0x5d24b6['destroy']()[_0xfdf9('0x25')](function(){_0x5a1679[_0xfdf9('0x19')](0xcc)[_0xfdf9('0x1a')]();});}};}function handleEntityNotFound(_0x2ee834,_0x5c3468){return function(_0x249ac8){if(!_0x249ac8){_0x2ee834[_0xfdf9('0x18')](0x194);}return _0x249ac8;};}function handleError(_0x95433e,_0x201d0d){_0x201d0d=_0x201d0d||0x1f4;return function(_0xc54335){logger[_0xfdf9('0x26')](_0xc54335[_0xfdf9('0x27')]);if(_0xc54335[_0xfdf9('0x28')]){delete _0xc54335['name'];}_0x95433e['status'](_0x201d0d)[_0xfdf9('0x29')](_0xc54335);};}exports['index']=function(_0x38bf2c,_0x30c3d4){var _0x372bf9={},_0x2de88={},_0x149f63={'count':0x0,'rows':[]};var _0x5ce6e3=_[_0xfdf9('0x2a')](db[_0xfdf9('0x2b')][_0xfdf9('0x2c')],function(_0x5da765){return{'name':_0x5da765['fieldName'],'type':_0x5da765[_0xfdf9('0x2d')]['key']};});_0x2de88['model']=_[_0xfdf9('0x2e')](_[_0xfdf9('0x2a')](_0x5ce6e3,_0xfdf9('0x28')),[_0xfdf9('0x28')]);_0x2de88[_0xfdf9('0x2f')]=_[_0xfdf9('0x30')](_0x38bf2c[_0xfdf9('0x2f')]);_0x2de88['filters']=_[_0xfdf9('0x31')](_0x2de88['model'],_0x2de88[_0xfdf9('0x2f')]);_0x372bf9['attributes']=_[_0xfdf9('0x31')](_0x2de88['model'],qs['fields'](_0x38bf2c[_0xfdf9('0x2f')][_0xfdf9('0x32')]));_0x372bf9[_0xfdf9('0x33')]=_0x372bf9['attributes'][_0xfdf9('0x34')]?_0x372bf9[_0xfdf9('0x33')]:_0x2de88[_0xfdf9('0x35')];if(!_0x38bf2c[_0xfdf9('0x2f')][_0xfdf9('0x36')](_0xfdf9('0x37'))){_0x372bf9[_0xfdf9('0x1d')]=qs[_0xfdf9('0x1d')](_0x38bf2c['query'][_0xfdf9('0x1d')]);_0x372bf9[_0xfdf9('0x1e')]=qs[_0xfdf9('0x1e')](_0x38bf2c[_0xfdf9('0x2f')][_0xfdf9('0x1e')]);}_0x372bf9[_0xfdf9('0x38')]=qs['sort'](_0x38bf2c[_0xfdf9('0x2f')][_0xfdf9('0x39')]);_0x372bf9[_0xfdf9('0x3a')]=qs[_0xfdf9('0x3b')](_[_0xfdf9('0x3c')](_0x38bf2c[_0xfdf9('0x2f')],_0x2de88[_0xfdf9('0x3b')]),_0x5ce6e3);if(_0x38bf2c[_0xfdf9('0x2f')]['filter']){_0x372bf9[_0xfdf9('0x3a')]=_[_0xfdf9('0x3d')](_0x372bf9[_0xfdf9('0x3a')],{'$or':_[_0xfdf9('0x2a')](_0x5ce6e3,function(_0x81497e){if(_0x81497e[_0xfdf9('0x2d')]!==_0xfdf9('0x3e')){var _0x23eccb={};_0x23eccb[_0x81497e[_0xfdf9('0x28')]]={'$like':'%'+_0x38bf2c[_0xfdf9('0x2f')][_0xfdf9('0x3f')]+'%'};return _0x23eccb;}})});}_0x372bf9=_['merge']({},_0x372bf9,_0x38bf2c[_0xfdf9('0x40')]);var _0x32c557={'where':_0x372bf9[_0xfdf9('0x3a')]};return db[_0xfdf9('0x2b')]['count'](_0x32c557)['then'](function(_0x1e5d57){_0x149f63['count']=_0x1e5d57;if(_0x38bf2c[_0xfdf9('0x2f')]['includeAll']){_0x372bf9[_0xfdf9('0x41')]=[{'all':!![]}];}return db[_0xfdf9('0x2b')][_0xfdf9('0x42')](_0x372bf9);})[_0xfdf9('0x25')](function(_0x3f085b){_0x149f63[_0xfdf9('0x43')]=_0x3f085b;return _0x149f63;})[_0xfdf9('0x25')](respondWithFilteredResult(_0x30c3d4,_0x372bf9))[_0xfdf9('0x44')](handleError(_0x30c3d4,null));};exports['show']=function(_0x24f0b5,_0x19733b){var _0x95f25e={'raw':!![],'where':{'id':_0x24f0b5[_0xfdf9('0x45')]['id']}},_0x3e954b={};_0x3e954b[_0xfdf9('0x35')]=_[_0xfdf9('0x30')](db[_0xfdf9('0x2b')][_0xfdf9('0x2c')]);_0x3e954b[_0xfdf9('0x2f')]=_[_0xfdf9('0x30')](_0x24f0b5[_0xfdf9('0x2f')]);_0x3e954b[_0xfdf9('0x3b')]=_[_0xfdf9('0x31')](_0x3e954b[_0xfdf9('0x35')],_0x3e954b[_0xfdf9('0x2f')]);_0x95f25e['attributes']=_[_0xfdf9('0x31')](_0x3e954b[_0xfdf9('0x35')],qs[_0xfdf9('0x32')](_0x24f0b5[_0xfdf9('0x2f')][_0xfdf9('0x32')]));_0x95f25e[_0xfdf9('0x33')]=_0x95f25e['attributes'][_0xfdf9('0x34')]?_0x95f25e['attributes']:_0x3e954b['model'];if(_0x24f0b5[_0xfdf9('0x2f')]['includeAll']){_0x95f25e['include']=[{'all':!![]}];}_0x95f25e=_[_0xfdf9('0x3d')]({},_0x95f25e,_0x24f0b5[_0xfdf9('0x40')]);return db[_0xfdf9('0x2b')][_0xfdf9('0x46')](_0x95f25e)[_0xfdf9('0x25')](handleEntityNotFound(_0x19733b,null))[_0xfdf9('0x25')](respondWithResult(_0x19733b,null))[_0xfdf9('0x44')](handleError(_0x19733b,null));};exports[_0xfdf9('0x47')]=function(_0x530491,_0x3edd58){if(_0x530491[_0xfdf9('0x48')]['id']){delete _0x530491[_0xfdf9('0x48')]['id'];}return db['CmCustomField'][_0xfdf9('0x46')]({'where':{'id':_0x530491[_0xfdf9('0x45')]['id']}})['then'](handleEntityNotFound(_0x3edd58,null))[_0xfdf9('0x25')](saveUpdates(_0x530491[_0xfdf9('0x48')],null))[_0xfdf9('0x25')](respondWithResult(_0x3edd58,null))[_0xfdf9('0x44')](handleError(_0x3edd58,null));};exports[_0xfdf9('0x49')]=function(_0x3a7bfe,_0x263713){return db['CmCustomField'][_0xfdf9('0x46')]({'where':{'id':_0x3a7bfe[_0xfdf9('0x45')]['id']}})[_0xfdf9('0x25')](handleEntityNotFound(_0x263713,null))[_0xfdf9('0x25')](removeEntity(_0x263713,null))[_0xfdf9('0x44')](handleError(_0x263713,null));};exports[_0xfdf9('0x4a')]=function(_0x38335f,_0x4c39d6){var _0x5ebd1b;return db[_0xfdf9('0x4b')][_0xfdf9('0x4c')](function(_0x411fbc){return db[_0xfdf9('0x2b')][_0xfdf9('0x4a')](_0x38335f[_0xfdf9('0x48')],{'transaction':_0x411fbc})[_0xfdf9('0x25')](function(_0x452337){_0x5ebd1b=_0x452337;var _0x2f216f={'type':db['Sequelize'][_0xfdf9('0x4d')],'transaction':_0x411fbc};switch(_0x38335f['body'][_0xfdf9('0x2d')]){case _0xfdf9('0x4e'):_0x2f216f[_0xfdf9('0x2d')]=db['Sequelize'][_0xfdf9('0x4d')];break;case _0xfdf9('0x4f'):_0x2f216f['type']=db[_0xfdf9('0x50')][_0xfdf9('0x51')];break;case'switch':_0x2f216f[_0xfdf9('0x2d')]=db['Sequelize'][_0xfdf9('0x52')];_0x2f216f[_0xfdf9('0x53')]=![];break;default:}return db['sequelize'][_0xfdf9('0x54')][_0xfdf9('0x55')](_0xfdf9('0x56'),util[_0xfdf9('0x57')](_0xfdf9('0x58'),_0x5ebd1b['id']),_0x2f216f);})[_0xfdf9('0x25')](function(){return _0x5ebd1b;});})['then'](respondWithResult(_0x4c39d6,0xc9))[_0xfdf9('0x44')](handleError(_0x4c39d6,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index ca8c23b..252fc3f 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 _0x0ab5=['request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','define','lodash','api'];(function(_0x505d8f,_0x3230f7){var _0x249abb=function(_0x4c0059){while(--_0x4c0059){_0x505d8f['push'](_0x505d8f['shift']());}};_0x249abb(++_0x3230f7);}(_0x0ab5,0xb6));var _0x50ab=function(_0x247ff9,_0x17eed5){_0x247ff9=_0x247ff9-0x0;var _0x1b995b=_0x0ab5[_0x247ff9];return _0x1b995b;};'use strict';var _=require(_0x50ab('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x50ab('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x50ab('0x2'));var fs=require('fs');var path=require(_0x50ab('0x3'));var rimraf=require(_0x50ab('0x4'));var config=require(_0x50ab('0x5'));var attributes=require(_0x50ab('0x6'));module['exports']=function(_0x46fcb6,_0x3d6f03){return _0x46fcb6[_0x50ab('0x7')]('CmCustomField',attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcf64=['moment','rimraf','../../config/environment','./cmCustomField.attributes','exports','CmCustomField','cm_custom_fields','lodash','util'];(function(_0x330263,_0x1760fe){var _0x29e615=function(_0x2c67cb){while(--_0x2c67cb){_0x330263['push'](_0x330263['shift']());}};_0x29e615(++_0x1760fe);}(_0xcf64,0x1db));var _0x4cf6=function(_0x5314b1,_0x5864a3){_0x5314b1=_0x5314b1-0x0;var _0x5f000f=_0xcf64[_0x5314b1];return _0x5f000f;};'use strict';var _=require(_0x4cf6('0x0'));var util=require(_0x4cf6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4cf6('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4cf6('0x3'));var config=require(_0x4cf6('0x4'));var attributes=require(_0x4cf6('0x5'));module[_0x4cf6('0x6')]=function(_0x68d02a,_0x56029f){return _0x68d02a['define'](_0x4cf6('0x7'),attributes,{'tableName':_0x4cf6('0x8'),'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 4c2bdf7..c9a6edd 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 _0xb6cb=['result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x24a19f,_0x23b39e){var _0x280557=function(_0x483f80){while(--_0x483f80){_0x24a19f['push'](_0x24a19f['shift']());}};_0x280557(++_0x23b39e);}(_0xb6cb,0x12e));var _0xbb6c=function(_0x53361f,_0x3b2cb6){_0x53361f=_0x53361f-0x0;var _0x279237=_0xb6cb[_0x53361f];return _0x279237;};'use strict';var _=require('lodash');var util=require(_0xbb6c('0x0'));var moment=require(_0xbb6c('0x1'));var BPromise=require('bluebird');var rs=require(_0xbb6c('0x2'));var fs=require('fs');var Redis=require(_0xbb6c('0x3'));var db=require(_0xbb6c('0x4'))['db'];var utils=require(_0xbb6c('0x5'));var logger=require(_0xbb6c('0x6'))(_0xbb6c('0x7'));var config=require(_0xbb6c('0x8'));var jayson=require(_0xbb6c('0x9'));var client=jayson[_0xbb6c('0xa')][_0xbb6c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4fff35,_0x8d2145,_0x3e41ff){return new BPromise(function(_0x2f7f4b,_0x1fabd8){return client[_0xbb6c('0xc')](_0x4fff35,_0x3e41ff)[_0xbb6c('0xd')](function(_0x46e2b8){logger[_0xbb6c('0xe')](_0xbb6c('0xf'),_0x8d2145,'request\x20sent');logger[_0xbb6c('0x10')](_0xbb6c('0x11'),_0x8d2145,_0xbb6c('0x12'),JSON[_0xbb6c('0x13')](_0x46e2b8));if(_0x46e2b8[_0xbb6c('0x14')]){if(_0x46e2b8[_0xbb6c('0x14')][_0xbb6c('0x15')]===0x1f4){logger[_0xbb6c('0x14')](_0xbb6c('0xf'),_0x8d2145,_0x46e2b8['error']['message']);return _0x1fabd8(_0x46e2b8[_0xbb6c('0x14')][_0xbb6c('0x16')]);}logger[_0xbb6c('0x14')](_0xbb6c('0xf'),_0x8d2145,_0x46e2b8[_0xbb6c('0x14')][_0xbb6c('0x16')]);return _0x2f7f4b(_0x46e2b8[_0xbb6c('0x14')][_0xbb6c('0x16')]);}else{logger[_0xbb6c('0xe')](_0xbb6c('0xf'),_0x8d2145,_0xbb6c('0x12'));_0x2f7f4b(_0x46e2b8[_0xbb6c('0x17')][_0xbb6c('0x16')]);}})[_0xbb6c('0x18')](function(_0x2814f4){logger[_0xbb6c('0x14')](_0xbb6c('0xf'),_0x8d2145,_0x2814f4);_0x1fabd8(_0x2814f4);});});} \ No newline at end of file +var _0x99a9=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x423d99,_0x1b62a1){var _0xbe570a=function(_0x2b4d3d){while(--_0x2b4d3d){_0x423d99['push'](_0x423d99['shift']());}};_0xbe570a(++_0x1b62a1);}(_0x99a9,0x1e2));var _0x999a=function(_0x21d90d,_0x1f8b7d){_0x21d90d=_0x21d90d-0x0;var _0x390aab=_0x99a9[_0x21d90d];return _0x390aab;};'use strict';var _=require(_0x999a('0x0'));var util=require(_0x999a('0x1'));var moment=require(_0x999a('0x2'));var BPromise=require(_0x999a('0x3'));var rs=require(_0x999a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x999a('0x5'));var logger=require(_0x999a('0x6'))(_0x999a('0x7'));var config=require('../../config/environment');var jayson=require(_0x999a('0x8'));var client=jayson[_0x999a('0x9')][_0x999a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fe9c7,_0x296810,_0x171894){return new BPromise(function(_0x3adbf3,_0x53b020){return client[_0x999a('0xb')](_0x1fe9c7,_0x171894)[_0x999a('0xc')](function(_0x5b6135){logger[_0x999a('0xd')](_0x999a('0xe'),_0x296810,_0x999a('0xf'));logger[_0x999a('0x10')](_0x999a('0x11'),_0x296810,_0x999a('0xf'),JSON[_0x999a('0x12')](_0x5b6135));if(_0x5b6135[_0x999a('0x13')]){if(_0x5b6135[_0x999a('0x13')]['code']===0x1f4){logger[_0x999a('0x13')](_0x999a('0xe'),_0x296810,_0x5b6135['error'][_0x999a('0x14')]);return _0x53b020(_0x5b6135['error']['message']);}logger['error'](_0x999a('0xe'),_0x296810,_0x5b6135['error'][_0x999a('0x14')]);return _0x3adbf3(_0x5b6135['error'][_0x999a('0x14')]);}else{logger['info'](_0x999a('0xe'),_0x296810,_0x999a('0xf'));_0x3adbf3(_0x5b6135[_0x999a('0x15')][_0x999a('0x14')]);}})[_0x999a('0x16')](function(_0x3499b6){logger['error'](_0x999a('0xe'),_0x296810,_0x3499b6);_0x53b020(_0x3499b6);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 541b46b..86d92e4 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 _0xb87c=['update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb87c,0x1d7));var _0xcb87=function(_0x429399,_0x141d01){_0x429399=_0x429399-0x0;var _0x389694=_0xb87c[_0x429399];return _0x389694;};'use strict';var multer=require('multer');var util=require(_0xcb87('0x0'));var path=require(_0xcb87('0x1'));var timeout=require(_0xcb87('0x2'));var express=require(_0xcb87('0x3'));var router=express[_0xcb87('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcb87('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcb87('0x6'));router[_0xcb87('0x7')]('/',auth[_0xcb87('0x8')](),controller[_0xcb87('0x9')]);router[_0xcb87('0x7')](_0xcb87('0xa'),auth['isAuthenticated'](),controller[_0xcb87('0xb')]);router[_0xcb87('0xc')]('/',auth[_0xcb87('0x8')](),controller[_0xcb87('0xd')]);router[_0xcb87('0xe')]('/:id',auth[_0xcb87('0x8')](),controller[_0xcb87('0xf')]);router[_0xcb87('0x10')](_0xcb87('0xa'),auth[_0xcb87('0x8')](),controller[_0xcb87('0x11')]);module['exports']=router; \ No newline at end of file +var _0x6347=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmCustomField.controller','get','/:id','isAuthenticated','show','post','put','delete','destroy','exports','multer','util'];(function(_0x29d1ba,_0x7a5223){var _0x3de575=function(_0x10560b){while(--_0x10560b){_0x29d1ba['push'](_0x29d1ba['shift']());}};_0x3de575(++_0x7a5223);}(_0x6347,0x1c9));var _0x7634=function(_0x12920e,_0x1dee6f){_0x12920e=_0x12920e-0x0;var _0x28e793=_0x6347[_0x12920e];return _0x28e793;};'use strict';var multer=require(_0x7634('0x0'));var util=require(_0x7634('0x1'));var path=require('path');var timeout=require(_0x7634('0x2'));var express=require(_0x7634('0x3'));var router=express[_0x7634('0x4')]();var fs_extra=require(_0x7634('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7634('0x6'));var config=require('../../config/environment');var controller=require(_0x7634('0x7'));router[_0x7634('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7634('0x8')](_0x7634('0x9'),auth[_0x7634('0xa')](),controller[_0x7634('0xb')]);router[_0x7634('0xc')]('/',auth[_0x7634('0xa')](),controller['create']);router[_0x7634('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x7634('0xe')](_0x7634('0x9'),auth[_0x7634('0xa')](),controller[_0x7634('0xf')]);module[_0x7634('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 897f412..e0358c7 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 _0xfb79=['sequelize','exports','STRING','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xfb79,0xa9));var _0x9fb7=function(_0x3e2040,_0x660381){_0x3e2040=_0x3e2040-0x0;var _0x38e3ec=_0xfb79[_0x3e2040];return _0x38e3ec;};'use strict';var moment=require(_0x9fb7('0x0'));var Sequelize=require(_0x9fb7('0x1'));module[_0x9fb7('0x2')]={'phone':{'type':Sequelize[_0x9fb7('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x9fb7('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x9fb7('0x5')](_0x9fb7('0x6'))},'countbusyretry':{'type':Sequelize[_0x9fb7('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9fb7('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x9fb7('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9fb7('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x9fb7('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x9fb7('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x9fb7('0x7')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x9fb7('0x7')],'unique':_0x9fb7('0x9')},'UserId':{'type':Sequelize[_0x9fb7('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x9fb7('0x7')],'unique':_0x9fb7('0x9')},'CampaignId':{'type':Sequelize[_0x9fb7('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x9fb7('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9fb7('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9fb7('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9fb7('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9fb7('0x7')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x9fb7('0x7')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x3932=['BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING'];(function(_0x54f0a0,_0x587cbe){var _0x598ad7=function(_0x47c6de){while(--_0x47c6de){_0x54f0a0['push'](_0x54f0a0['shift']());}};_0x598ad7(++_0x587cbe);}(_0x3932,0x15c));var _0x2393=function(_0x25f668,_0x58b234){_0x25f668=_0x25f668-0x0;var _0x3b00ba=_0x3932[_0x25f668];return _0x3b00ba;};'use strict';var moment=require(_0x2393('0x0'));var Sequelize=require(_0x2393('0x1'));module[_0x2393('0x2')]={'phone':{'type':Sequelize[_0x2393('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x2393('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x2393('0x5')],'defaultValue':moment()[_0x2393('0x6')](_0x2393('0x7'))},'countbusyretry':{'type':Sequelize[_0x2393('0x8')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2393('0x8')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x2393('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2393('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x2393('0x8')](0x2)[_0x2393('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x2393('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x2393('0x8')],'unique':_0x2393('0xa')},'ListId':{'type':Sequelize[_0x2393('0x8')],'unique':_0x2393('0xa')},'UserId':{'type':Sequelize[_0x2393('0x8')]},'VoiceQueueId':{'type':Sequelize[_0x2393('0x8')],'unique':_0x2393('0xa')},'CampaignId':{'type':Sequelize[_0x2393('0x8')]},'countnosuchnumberretry':{'type':Sequelize[_0x2393('0x8')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2393('0x8')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x2393('0x8')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2393('0x8')],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0x2393('0x5')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index f02f259..de2407b 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 _0x3937=['VoiceQueueId','Campaign','omit','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','ContactId','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','end','getPreview','CmContact','getVoiceQueues','outbound','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','direction','hopperIds','priority','scheduledAt','ASC','literal','isEmpty','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','VoiceQueue','Queue','dialActive','getPreviewRecall','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','sendStatus','getTimezones','timezones','utcOffset','getTimezone','moment','../../components/parsers/qs','../../config/logger','../../config/environment','status','json','offset','undefined','count','set','Content-Range','update','then','name','send','map','CmHopper','rawAttributes','fieldName','model','query','keys','concat','filters','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$iLike','$notILike','$overlap','$contains','$contained','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','catch','show','params','intersection','merge','find','create','body','describe','destroy','CampaignId'];(function(_0xfb3b3,_0x10db7a){var _0x36cae7=function(_0x183814){while(--_0x183814){_0xfb3b3['push'](_0xfb3b3['shift']());}};_0x36cae7(++_0x10db7a);}(_0x3937,0xbf));var _0x7393=function(_0x2b0740,_0x39c24f){_0x2b0740=_0x2b0740-0x0;var _0x1c1c37=_0x3937[_0x2b0740];return _0x1c1c37;};'use strict';var moment=require(_0x7393('0x0'));var _=require('lodash');var qs=require(_0x7393('0x1'));var logger=require(_0x7393('0x2'))('api');var shared=require(_0x7393('0x3'));var db=require('../../mysqldb')['db'];function respondWithResult(_0x224468,_0x4c9c71){_0x4c9c71=_0x4c9c71||0xc8;return function(_0x992b15){if(_0x992b15){return _0x224468[_0x7393('0x4')](_0x4c9c71)[_0x7393('0x5')](_0x992b15);}};}function respondWithFilteredResult(_0x1f538f,_0x15eabd){return function(_0x42bdd1){if(_0x42bdd1){var _0x3f0800=typeof _0x15eabd[_0x7393('0x6')]===_0x7393('0x7')&&typeof _0x15eabd['limit']==='undefined';var _0x287359=_0x42bdd1[_0x7393('0x8')];var _0x1cc3fd=_0x3f0800?0x0:_0x15eabd['offset'];var _0xab290c=_0x3f0800?_0x42bdd1['count']:_0x15eabd['offset']+_0x15eabd['limit'];var _0x497b6b;if(_0xab290c>=_0x287359){_0xab290c=_0x287359;_0x497b6b=0xc8;}else{_0x497b6b=0xce;}_0x1f538f[_0x7393('0x4')](_0x497b6b);return _0x1f538f[_0x7393('0x9')](_0x7393('0xa'),_0x1cc3fd+'-'+_0xab290c+'/'+_0x287359)['json'](_0x42bdd1);}return null;};}function saveUpdates(_0x79fc4e,_0x470f09){return function(_0x20fb41){if(_0x20fb41){return _0x20fb41[_0x7393('0xb')](_0x79fc4e)[_0x7393('0xc')](function(_0x1fe171){return _0x1fe171;});}return null;};}function handleEntityNotFound(_0x38eaad,_0x212f44){return function(_0x11030d){if(!_0x11030d){_0x38eaad['sendStatus'](0x194);}return _0x11030d;};}function handleError(_0x47b152,_0x414c37){_0x414c37=_0x414c37||0x1f4;return function(_0x5d0d2b){logger['error'](_0x5d0d2b['stack']);if(_0x5d0d2b[_0x7393('0xd')]){delete _0x5d0d2b['name'];}_0x47b152[_0x7393('0x4')](_0x414c37)[_0x7393('0xe')](_0x5d0d2b);};}exports['index']=function(_0x459abf,_0x5745cb){var _0x5694b6={},_0x31c8c2={},_0x344bc8={'count':0x0,'rows':[]};var _0x1b032c=_[_0x7393('0xf')](db[_0x7393('0x10')][_0x7393('0x11')],function(_0x21f712){return{'name':_0x21f712[_0x7393('0x12')],'type':_0x21f712['type']['key']};});_0x31c8c2[_0x7393('0x13')]=_[_0x7393('0xf')](_0x1b032c,_0x7393('0xd'));_0x31c8c2[_0x7393('0x14')]=_[_0x7393('0x15')](_0x459abf['query']);_0x31c8c2['filters']=_['intersection'](_0x31c8c2[_0x7393('0x13')],_0x31c8c2['query']);_0x31c8c2['filters']=_[_0x7393('0x16')](_0x31c8c2[_0x7393('0x17')],['$and',_0x7393('0x18'),_0x7393('0x19'),_0x7393('0x1a'),_0x7393('0x1b'),_0x7393('0x1c'),_0x7393('0x1d'),_0x7393('0x1e'),_0x7393('0x1f'),_0x7393('0x20'),_0x7393('0x21'),_0x7393('0x22'),_0x7393('0x23'),_0x7393('0x24'),'$notLike',_0x7393('0x25'),_0x7393('0x26'),_0x7393('0x24'),_0x7393('0x27'),_0x7393('0x28'),_0x7393('0x29'),'$any']);_0x5694b6[_0x7393('0x2a')]=_['intersection'](_0x31c8c2[_0x7393('0x13')],qs['fields'](_0x459abf[_0x7393('0x14')][_0x7393('0x2b')]));_0x5694b6[_0x7393('0x2a')]=_0x5694b6[_0x7393('0x2a')][_0x7393('0x2c')]?_0x5694b6[_0x7393('0x2a')]:_0x31c8c2[_0x7393('0x13')];if(!_0x459abf[_0x7393('0x14')][_0x7393('0x2d')](_0x7393('0x2e'))){_0x5694b6[_0x7393('0x2f')]=qs[_0x7393('0x2f')](_0x459abf['query']['limit']);_0x5694b6[_0x7393('0x6')]=qs['offset'](_0x459abf[_0x7393('0x14')]['offset']);}_0x5694b6[_0x7393('0x30')]=qs['sort'](_0x459abf[_0x7393('0x14')][_0x7393('0x31')]);_0x5694b6[_0x7393('0x32')]=qs[_0x7393('0x17')](_[_0x7393('0x33')](_0x459abf[_0x7393('0x14')],_0x31c8c2[_0x7393('0x17')]),_0x1b032c);if(_0x459abf[_0x7393('0x14')][_0x7393('0x34')]){_0x5694b6[_0x7393('0x32')]=_['merge'](_0x5694b6[_0x7393('0x32')],{'$or':_['map'](_0x1b032c,function(_0x1cfbba){if(_0x1cfbba['type']!==_0x7393('0x35')){var _0x461322={};_0x461322[_0x1cfbba[_0x7393('0xd')]]={'$like':'%'+_0x459abf[_0x7393('0x14')][_0x7393('0x34')]+'%'};return _0x461322;}})});}_0x5694b6=_['merge']({},_0x5694b6,_0x459abf[_0x7393('0x36')]);var _0x596f49={'where':_0x5694b6[_0x7393('0x32')]};return db[_0x7393('0x10')][_0x7393('0x8')](_0x596f49)[_0x7393('0xc')](function(_0x27f469){_0x344bc8['count']=_0x27f469;if(_0x459abf['query'][_0x7393('0x37')]){_0x5694b6[_0x7393('0x38')]=[{'all':!![]}];}return db[_0x7393('0x10')][_0x7393('0x39')](_0x5694b6);})['then'](function(_0x5d746e){_0x344bc8['rows']=_0x5d746e;return _0x344bc8;})[_0x7393('0xc')](respondWithFilteredResult(_0x5745cb,_0x5694b6))[_0x7393('0x3a')](handleError(_0x5745cb,null));};exports[_0x7393('0x3b')]=function(_0x4aa2ca,_0xeb60a7){var _0x406b35={'raw':!![],'where':{'id':_0x4aa2ca[_0x7393('0x3c')]['id']}},_0x146afb={};_0x146afb[_0x7393('0x13')]=_[_0x7393('0x15')](db[_0x7393('0x10')][_0x7393('0x11')]);_0x146afb[_0x7393('0x14')]=_[_0x7393('0x15')](_0x4aa2ca[_0x7393('0x14')]);_0x146afb[_0x7393('0x17')]=_[_0x7393('0x3d')](_0x146afb[_0x7393('0x13')],_0x146afb[_0x7393('0x14')]);_0x406b35[_0x7393('0x2a')]=_[_0x7393('0x3d')](_0x146afb[_0x7393('0x13')],qs['fields'](_0x4aa2ca[_0x7393('0x14')][_0x7393('0x2b')]));_0x406b35[_0x7393('0x2a')]=_0x406b35[_0x7393('0x2a')][_0x7393('0x2c')]?_0x406b35[_0x7393('0x2a')]:_0x146afb[_0x7393('0x13')];if(_0x4aa2ca[_0x7393('0x14')]['includeAll']){_0x406b35['include']=[{'all':!![]}];}_0x406b35=_[_0x7393('0x3e')]({},_0x406b35,_0x4aa2ca['options']);return db[_0x7393('0x10')][_0x7393('0x3f')](_0x406b35)[_0x7393('0xc')](handleEntityNotFound(_0xeb60a7,null))[_0x7393('0xc')](respondWithResult(_0xeb60a7,null))[_0x7393('0x3a')](handleError(_0xeb60a7,null));};exports[_0x7393('0x40')]=function(_0x585c89,_0x21570b){return db[_0x7393('0x10')][_0x7393('0x40')](_0x585c89[_0x7393('0x41')],{})[_0x7393('0xc')](respondWithResult(_0x21570b,0xc9))['catch'](handleError(_0x21570b,null));};exports['update']=function(_0x770871,_0x51a192){if(_0x770871[_0x7393('0x41')]['id']){delete _0x770871[_0x7393('0x41')]['id'];}return db[_0x7393('0x10')][_0x7393('0x3f')]({'where':{'id':_0x770871[_0x7393('0x3c')]['id']}})[_0x7393('0xc')](handleEntityNotFound(_0x51a192,null))[_0x7393('0xc')](saveUpdates(_0x770871[_0x7393('0x41')],null))[_0x7393('0xc')](respondWithResult(_0x51a192,null))[_0x7393('0x3a')](handleError(_0x51a192,null));};exports[_0x7393('0x42')]=function(_0x26c327,_0x3fdbe2){return db[_0x7393('0x10')][_0x7393('0x42')]()['then'](respondWithResult(_0x3fdbe2,null))[_0x7393('0x3a')](handleError(_0x3fdbe2,null));};exports[_0x7393('0x43')]=function(_0x27b796,_0x351ba9){var _0x47fdbb;var _0x103a90=_0x27b796[_0x7393('0x3c')]['id'];return db[_0x7393('0x10')][_0x7393('0x3f')]({'where':{'id':_0x27b796[_0x7393('0x3c')]['id']}})[_0x7393('0xc')](handleEntityNotFound(_0x351ba9,null))[_0x7393('0xc')](function(_0x8cac53){if(_0x8cac53){return _0x8cac53[_0x7393('0x43')]()['then'](function(_0xd3d01d){return _0xd3d01d;});}})[_0x7393('0xc')](function(_0x306ab7){_0x47fdbb=_0x306ab7;if(_0x306ab7){if(_0x306ab7['VoiceQueueId']||_0x306ab7[_0x7393('0x44')]){return db[_0x306ab7[_0x7393('0x45')]?'VoiceQueue':_0x7393('0x46')]['find']({'where':{'id':_0x306ab7[_0x7393('0x45')]?_0x306ab7['VoiceQueueId']:_0x306ab7[_0x7393('0x44')]},'attributes':['id',_0x7393('0xd')],'raw':!![]});}}})['then'](function(_0x1f18e6){var _0x695d5e={};if(_0x1f18e6){_[_0x7393('0x3e')](_0x695d5e,_[_0x7393('0x47')](_0x47fdbb['dataValues'],['createdAt','updatedAt','id']));_0x695d5e[_0x7393('0x48')]=0x15;_0x695d5e[_0x7393('0x49')]=_0x7393('0x4a');_0x695d5e[_0x7393('0x4b')]=_0x1f18e6[_0x7393('0xd')];_0x695d5e[_0x7393('0x4c')]=_0x27b796[_0x7393('0x4d')][_0x7393('0xd')];_0x695d5e[_0x7393('0x4e')]=_0x27b796[_0x7393('0x4d')]['id'];_0x695d5e[_0x7393('0x4a')]=!![];_0x695d5e[_0x7393('0x4f')]=moment()[_0x7393('0x50')](_0x7393('0x51'));_0x695d5e[_0x7393('0x52')]=_0x47fdbb[_0x7393('0x53')];_0x695d5e['campaigntype']=_0x47fdbb['VoiceQueueId']?_0x7393('0x54'):'ivr';return db['CmContact']['find']({'where':{'id':_0x695d5e[_0x7393('0x55')]},'attributes':['firstName',_0x7393('0x56')]})['then'](function(_0x57e868){if(!_[_0x7393('0x57')](_0x351ba9)&&!_['isNil'](_0x57e868[_0x7393('0x58')])){_0x695d5e['calleridname']=_0x57e868[_0x7393('0x58')];if(!_[_0x7393('0x57')](_0x57e868[_0x7393('0x56')])){_0x695d5e[_0x7393('0x59')]+='\x20'+_0x57e868['lastName'];}}})[_0x7393('0x5a')](function(){return db[_0x7393('0x5b')][_0x7393('0x40')](_0x695d5e);});}})['then'](function(_0xb9eadc){return db['CmHopperAdditionalPhone']['destroy']({'where':{'CmHopperId':_0x103a90}});})['then'](function(){return _0x351ba9[_0x7393('0x4')](0xcc)[_0x7393('0x5c')]();})[_0x7393('0x3a')](handleError(_0x351ba9,null));};exports[_0x7393('0x5d')]=function(_0x582e65,_0x4e3917){var _0x5995af=[];return db[_0x7393('0x5e')]['describe']()[_0x7393('0xc')](function(_0x118fac){_0x5995af=_[_0x7393('0x15')](_0x118fac);return _0x582e65[_0x7393('0x4d')][_0x7393('0x5f')]({'where':{'type':_0x7393('0x60'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x7393('0x61'),_0x7393('0x62')],'raw':!![]});})['then'](function(_0x383a73){if(_0x383a73&&_0x383a73[_0x7393('0x2c')]){return db[_0x7393('0x63')][_0x7393('0x64')](function(_0x406bb1){var _0x5a806b={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x7393('0x51'))},'VoiceQueueId':{'$in':_[_0x7393('0xf')](_0x383a73,'id')},'$or':[{'UserId':null},{'UserId':_0x582e65[_0x7393('0x4d')]['id']}]};var _0x577a34={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x383a73)[_0x7393('0x34')]([_0x7393('0x62'),0x0])['map']('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x582e65['user']['id']}]};var _0x50b132={'$or':[_0x5a806b,_0x577a34]};var _0x4b73a5=[];if(_0x582e65[_0x7393('0x41')][_0x7393('0x65')]&&_0x582e65[_0x7393('0x41')][_0x7393('0x65')]==='prev'){if(!_['isEmpty'](_0x582e65[_0x7393('0x41')][_0x7393('0x66')])){_0x50b132['id']={'$in':_0x582e65[_0x7393('0x41')][_0x7393('0x66')]};}_0x4b73a5=[[_0x7393('0x67'),'ASC'],[_0x7393('0x68'),_0x383a73[0x0][_0x7393('0x61')]===_0x7393('0x69')?'DESC':_0x7393('0x69')],db['sequelize'][_0x7393('0x6a')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id','DESC']];}else{if(!_[_0x7393('0x6b')](_0x582e65[_0x7393('0x41')][_0x7393('0x66')])){_0x50b132['id']={'$notIn':_0x582e65[_0x7393('0x41')][_0x7393('0x66')]};}_0x4b73a5=[[_0x7393('0x67'),'DESC'],['scheduledAt',_0x383a73[0x0][_0x7393('0x61')]],db[_0x7393('0x63')][_0x7393('0x6a')](_0x7393('0x6c')),['id','ASC']];}return db[_0x7393('0x10')][_0x7393('0x6d')]({'attributes':['id',_0x7393('0x6e'),'phone',_0x7393('0x6f')],'where':_0x50b132,'order':_0x4b73a5,'transaction':_0x406bb1,'lock':_0x406bb1[_0x7393('0x70')][_0x7393('0x71')],'include':[{'model':db[_0x7393('0x5e')],'as':_0x7393('0x72'),'attributes':_0x5995af,'include':[{'model':db[_0x7393('0x73')],'as':_0x7393('0x74'),'attributes':['id',_0x7393('0xd')]}]},{'model':db[_0x7393('0x75')],'as':_0x7393('0x76'),'attributes':['id','name']},{'model':db[_0x7393('0x77')],'as':_0x7393('0x78'),'attributes':['id',_0x7393('0xd'),_0x7393('0x79')]}]})['then'](function(_0x2c71da){if(_0x2c71da){return _0x2c71da[_0x7393('0xb')]({'UserId':_0x582e65[_0x7393('0x4d')]['id']},{'transaction':_0x406bb1});}});});}})[_0x7393('0xc')](handleEntityNotFound(_0x4e3917,null))[_0x7393('0xc')](respondWithResult(_0x4e3917,null))[_0x7393('0x3a')](handleError(_0x4e3917,null));};exports[_0x7393('0x7a')]=function(_0x4322d3,_0xa8c739,_0x923d80){var _0x52e070=[];var _0x5e4ad6=_0x4322d3['params']['id'];var _0x4530b8=_0x4322d3[_0x7393('0x4d')]['id'];return db['CmContact'][_0x7393('0x42')]()[_0x7393('0xc')](function(_0x32d9b4){_0x52e070=_[_0x7393('0x15')](_0x32d9b4);return db[_0x7393('0x63')][_0x7393('0x64')](function(_0x58d13b){const _0x194865={'id':_0x5e4ad6};return db[_0x7393('0x10')][_0x7393('0x6d')]({'attributes':['id',_0x7393('0x6e'),_0x7393('0x6f')],'where':_0x194865,'transaction':_0x58d13b,'lock':_0x58d13b[_0x7393('0x70')]['UPDATE'],'include':[{'model':db[_0x7393('0x5e')],'as':_0x7393('0x72'),'attributes':_0x52e070,'include':[{'model':db[_0x7393('0x73')],'as':'Company','attributes':['id',_0x7393('0xd')]}]},{'model':db[_0x7393('0x75')],'as':_0x7393('0x76'),'attributes':['id',_0x7393('0xd')]},{'model':db[_0x7393('0x77')],'as':_0x7393('0x78'),'attributes':['id',_0x7393('0xd'),_0x7393('0x79')]}]})[_0x7393('0xc')](function(_0x3f1453){if(_0x3f1453){return _0x3f1453[_0x7393('0xb')]({'UserId':_0x4530b8},{'transaction':_0x58d13b});}});});})[_0x7393('0xc')](handleEntityNotFound(_0xa8c739,null))[_0x7393('0xc')](respondWithResult(_0xa8c739,null))[_0x7393('0x3a')](handleError(_0xa8c739,null));};exports['getOpenContacts']=function(_0x3863f4,_0x3230c3){return _0x3863f4[_0x7393('0x4d')]['getVoiceQueues']({'where':{'type':_0x7393('0x60'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x7393('0xc')](function(_0x38486b){if(_0x38486b&&_0x38486b['length']){return db[_0x7393('0x10')][_0x7393('0x8')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x7393('0x50')](_0x7393('0x51'))},'VoiceQueueId':{'$in':_['map'](_0x38486b,'id')},'$or':[{'UserId':null},{'UserId':_0x3863f4[_0x7393('0x4d')]['id']}]}});}return 0x0;})['then'](function(_0x452771){if(!_[_0x7393('0x57')](_0x452771)&&_[_0x7393('0x7b')](_0x452771)){return _0x3230c3['status'](0xc8)['json']({'contacts':_0x452771});}else{logger['error'](_0x7393('0x7c'),'getOpenContacts',0x194,'entity\x20not\x20found');_0x3230c3[_0x7393('0x7d')](0x194);}})[_0x7393('0x3a')](handleError(_0x3230c3,null));};exports[_0x7393('0x7e')]=function(_0x45bd5b,_0x52111c){var _0x3b3d59=shared[_0x7393('0x7f')];var _0x1e41aa=[];_['map'](_0x3b3d59,function(_0x3341e8){_0x1e41aa['push']({'id':_0x3341e8[_0x7393('0xd')],'name':_0x3341e8[_0x7393('0xd')],'utcOffset':_0x3341e8[_0x7393('0x80')]});});return _0x52111c[_0x7393('0x4')](0xc8)[_0x7393('0x5')]({'tz':_0x1e41aa});};exports[_0x7393('0x81')]=function(_0x37b19e,_0x5e40c3){var _0x5f3d52=shared[_0x7393('0x7f')];var _0x2f8e5d={};if(!_['isNil'](_0x5f3d52[_0x37b19e[_0x7393('0x41')]['id']]))_0x2f8e5d=_0x5f3d52[_0x37b19e['body']['id']];return _0x5e40c3['status'](0xc8)[_0x7393('0x5')](_0x2f8e5d);}; \ No newline at end of file +var _0xaa7c=['$lte','$ne','$between','$notBetween','$in','$notIn','$like','$iLike','$overlap','$contained','$any','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','omit','dataValues','updatedAt','state','statedesc','campaign','membername','user','UserId','deleted','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','preview','dialPreviewAutoRecallMe','sequelize','transaction','direction','prev','isEmpty','hopperIds','priority','scheduledAt','dialOrderByScheduledAt','ASC','DESC','literal','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','CmList','List','dialActive','CmCompany','Company','isNumber','getOpenContacts','entity\x20not\x20found','sendStatus','timezones','getTimezone','moment','../../config/environment','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','update','then','error','name','send','index','map','CmHopper','rawAttributes','fieldName','key','model','query','keys','filters','intersection','concat','$and','$or','$gte','$lt'];(function(_0x9117ad,_0x386be4){var _0x540f0c=function(_0x4e117a){while(--_0x4e117a){_0x9117ad['push'](_0x9117ad['shift']());}};_0x540f0c(++_0x386be4);}(_0xaa7c,0x1ec));var _0xcaa7=function(_0x685f10,_0x3d4609){_0x685f10=_0x685f10-0x0;var _0x2f7d8e=_0xaa7c[_0x685f10];return _0x2f7d8e;};'use strict';var moment=require(_0xcaa7('0x0'));var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var shared=require(_0xcaa7('0x1'));var db=require(_0xcaa7('0x2'))['db'];function respondWithResult(_0x4f837e,_0xd4ca36){_0xd4ca36=_0xd4ca36||0xc8;return function(_0xc85ba0){if(_0xc85ba0){return _0x4f837e[_0xcaa7('0x3')](_0xd4ca36)[_0xcaa7('0x4')](_0xc85ba0);}};}function respondWithFilteredResult(_0x27e610,_0x5a3674){return function(_0x4b9df0){if(_0x4b9df0){var _0x5bd940=typeof _0x5a3674['offset']===_0xcaa7('0x5')&&typeof _0x5a3674[_0xcaa7('0x6')]===_0xcaa7('0x5');var _0x5d2ca8=_0x4b9df0[_0xcaa7('0x7')];var _0x1de70a=_0x5bd940?0x0:_0x5a3674[_0xcaa7('0x8')];var _0x38a42d=_0x5bd940?_0x4b9df0[_0xcaa7('0x7')]:_0x5a3674['offset']+_0x5a3674[_0xcaa7('0x6')];var _0x39d53a;if(_0x38a42d>=_0x5d2ca8){_0x38a42d=_0x5d2ca8;_0x39d53a=0xc8;}else{_0x39d53a=0xce;}_0x27e610[_0xcaa7('0x3')](_0x39d53a);return _0x27e610[_0xcaa7('0x9')](_0xcaa7('0xa'),_0x1de70a+'-'+_0x38a42d+'/'+_0x5d2ca8)[_0xcaa7('0x4')](_0x4b9df0);}return null;};}function saveUpdates(_0x563f57,_0x24d3b0){return function(_0x128cfb){if(_0x128cfb){return _0x128cfb[_0xcaa7('0xb')](_0x563f57)[_0xcaa7('0xc')](function(_0x2bbc71){return _0x2bbc71;});}return null;};}function handleEntityNotFound(_0x2eb4ff,_0x299490){return function(_0x4a1d5a){if(!_0x4a1d5a){_0x2eb4ff['sendStatus'](0x194);}return _0x4a1d5a;};}function handleError(_0x314b7c,_0x1c1286){_0x1c1286=_0x1c1286||0x1f4;return function(_0x1155fb){logger[_0xcaa7('0xd')](_0x1155fb['stack']);if(_0x1155fb[_0xcaa7('0xe')]){delete _0x1155fb[_0xcaa7('0xe')];}_0x314b7c[_0xcaa7('0x3')](_0x1c1286)[_0xcaa7('0xf')](_0x1155fb);};}exports[_0xcaa7('0x10')]=function(_0xc46e37,_0x20ede0){var _0x5c2a74={},_0x53e1cb={},_0x4309e0={'count':0x0,'rows':[]};var _0x4491d1=_[_0xcaa7('0x11')](db[_0xcaa7('0x12')][_0xcaa7('0x13')],function(_0x2a0416){return{'name':_0x2a0416[_0xcaa7('0x14')],'type':_0x2a0416['type'][_0xcaa7('0x15')]};});_0x53e1cb[_0xcaa7('0x16')]=_[_0xcaa7('0x11')](_0x4491d1,_0xcaa7('0xe'));_0x53e1cb[_0xcaa7('0x17')]=_[_0xcaa7('0x18')](_0xc46e37[_0xcaa7('0x17')]);_0x53e1cb[_0xcaa7('0x19')]=_[_0xcaa7('0x1a')](_0x53e1cb[_0xcaa7('0x16')],_0x53e1cb[_0xcaa7('0x17')]);_0x53e1cb[_0xcaa7('0x19')]=_[_0xcaa7('0x1b')](_0x53e1cb['filters'],[_0xcaa7('0x1c'),_0xcaa7('0x1d'),'$gt',_0xcaa7('0x1e'),_0xcaa7('0x1f'),_0xcaa7('0x20'),_0xcaa7('0x21'),'$eq','$not',_0xcaa7('0x22'),_0xcaa7('0x23'),_0xcaa7('0x24'),_0xcaa7('0x25'),_0xcaa7('0x26'),'$notLike',_0xcaa7('0x27'),'$notILike','$like',_0xcaa7('0x28'),'$contains',_0xcaa7('0x29'),_0xcaa7('0x2a')]);_0x5c2a74[_0xcaa7('0x2b')]=_[_0xcaa7('0x1a')](_0x53e1cb[_0xcaa7('0x16')],qs[_0xcaa7('0x2c')](_0xc46e37[_0xcaa7('0x17')][_0xcaa7('0x2c')]));_0x5c2a74['attributes']=_0x5c2a74[_0xcaa7('0x2b')][_0xcaa7('0x2d')]?_0x5c2a74[_0xcaa7('0x2b')]:_0x53e1cb[_0xcaa7('0x16')];if(!_0xc46e37[_0xcaa7('0x17')]['hasOwnProperty'](_0xcaa7('0x2e'))){_0x5c2a74[_0xcaa7('0x6')]=qs[_0xcaa7('0x6')](_0xc46e37[_0xcaa7('0x17')][_0xcaa7('0x6')]);_0x5c2a74['offset']=qs[_0xcaa7('0x8')](_0xc46e37['query'][_0xcaa7('0x8')]);}_0x5c2a74[_0xcaa7('0x2f')]=qs[_0xcaa7('0x30')](_0xc46e37['query'][_0xcaa7('0x30')]);_0x5c2a74[_0xcaa7('0x31')]=qs[_0xcaa7('0x19')](_[_0xcaa7('0x32')](_0xc46e37[_0xcaa7('0x17')],_0x53e1cb[_0xcaa7('0x19')]),_0x4491d1);if(_0xc46e37['query'][_0xcaa7('0x33')]){_0x5c2a74[_0xcaa7('0x31')]=_['merge'](_0x5c2a74[_0xcaa7('0x31')],{'$or':_[_0xcaa7('0x11')](_0x4491d1,function(_0x444add){if(_0x444add[_0xcaa7('0x34')]!=='VIRTUAL'){var _0x16af20={};_0x16af20[_0x444add[_0xcaa7('0xe')]]={'$like':'%'+_0xc46e37[_0xcaa7('0x17')][_0xcaa7('0x33')]+'%'};return _0x16af20;}})});}_0x5c2a74=_[_0xcaa7('0x35')]({},_0x5c2a74,_0xc46e37[_0xcaa7('0x36')]);var _0xcb5439={'where':_0x5c2a74[_0xcaa7('0x31')]};return db[_0xcaa7('0x12')][_0xcaa7('0x7')](_0xcb5439)[_0xcaa7('0xc')](function(_0x266d5f){_0x4309e0['count']=_0x266d5f;if(_0xc46e37[_0xcaa7('0x17')][_0xcaa7('0x37')]){_0x5c2a74[_0xcaa7('0x38')]=[{'all':!![]}];}return db[_0xcaa7('0x12')][_0xcaa7('0x39')](_0x5c2a74);})['then'](function(_0x3d3c13){_0x4309e0[_0xcaa7('0x3a')]=_0x3d3c13;return _0x4309e0;})[_0xcaa7('0xc')](respondWithFilteredResult(_0x20ede0,_0x5c2a74))['catch'](handleError(_0x20ede0,null));};exports[_0xcaa7('0x3b')]=function(_0x3016f1,_0x320b46){var _0x1138a6={'raw':!![],'where':{'id':_0x3016f1[_0xcaa7('0x3c')]['id']}},_0x569c5f={};_0x569c5f['model']=_[_0xcaa7('0x18')](db['CmHopper'][_0xcaa7('0x13')]);_0x569c5f['query']=_['keys'](_0x3016f1[_0xcaa7('0x17')]);_0x569c5f[_0xcaa7('0x19')]=_['intersection'](_0x569c5f[_0xcaa7('0x16')],_0x569c5f[_0xcaa7('0x17')]);_0x1138a6[_0xcaa7('0x2b')]=_[_0xcaa7('0x1a')](_0x569c5f[_0xcaa7('0x16')],qs[_0xcaa7('0x2c')](_0x3016f1[_0xcaa7('0x17')][_0xcaa7('0x2c')]));_0x1138a6['attributes']=_0x1138a6[_0xcaa7('0x2b')][_0xcaa7('0x2d')]?_0x1138a6[_0xcaa7('0x2b')]:_0x569c5f[_0xcaa7('0x16')];if(_0x3016f1[_0xcaa7('0x17')][_0xcaa7('0x37')]){_0x1138a6['include']=[{'all':!![]}];}_0x1138a6=_[_0xcaa7('0x35')]({},_0x1138a6,_0x3016f1[_0xcaa7('0x36')]);return db[_0xcaa7('0x12')][_0xcaa7('0x3d')](_0x1138a6)[_0xcaa7('0xc')](handleEntityNotFound(_0x320b46,null))['then'](respondWithResult(_0x320b46,null))[_0xcaa7('0x3e')](handleError(_0x320b46,null));};exports[_0xcaa7('0x3f')]=function(_0x33c748,_0x490b0d){return db[_0xcaa7('0x12')]['create'](_0x33c748[_0xcaa7('0x40')],{})[_0xcaa7('0xc')](respondWithResult(_0x490b0d,0xc9))[_0xcaa7('0x3e')](handleError(_0x490b0d,null));};exports[_0xcaa7('0xb')]=function(_0x94e72d,_0x208495){if(_0x94e72d[_0xcaa7('0x40')]['id']){delete _0x94e72d['body']['id'];}return db['CmHopper'][_0xcaa7('0x3d')]({'where':{'id':_0x94e72d['params']['id']}})[_0xcaa7('0xc')](handleEntityNotFound(_0x208495,null))['then'](saveUpdates(_0x94e72d[_0xcaa7('0x40')],null))['then'](respondWithResult(_0x208495,null))[_0xcaa7('0x3e')](handleError(_0x208495,null));};exports[_0xcaa7('0x41')]=function(_0x1304a1,_0x32ec2d){return db[_0xcaa7('0x12')][_0xcaa7('0x41')]()['then'](respondWithResult(_0x32ec2d,null))['catch'](handleError(_0x32ec2d,null));};exports[_0xcaa7('0x42')]=function(_0x3a5f1f,_0x4f162c){var _0x417aaa;var _0x8a94a8=_0x3a5f1f[_0xcaa7('0x3c')]['id'];return db[_0xcaa7('0x12')][_0xcaa7('0x3d')]({'where':{'id':_0x3a5f1f[_0xcaa7('0x3c')]['id']}})[_0xcaa7('0xc')](handleEntityNotFound(_0x4f162c,null))[_0xcaa7('0xc')](function(_0x30d75c){if(_0x30d75c){return _0x30d75c[_0xcaa7('0x42')]()[_0xcaa7('0xc')](function(_0x3cc7ae){return _0x3cc7ae;});}})[_0xcaa7('0xc')](function(_0x3e77a9){_0x417aaa=_0x3e77a9;if(_0x3e77a9){if(_0x3e77a9[_0xcaa7('0x43')]||_0x3e77a9[_0xcaa7('0x44')]){return db[_0x3e77a9['VoiceQueueId']?_0xcaa7('0x45'):'Campaign'][_0xcaa7('0x3d')]({'where':{'id':_0x3e77a9[_0xcaa7('0x43')]?_0x3e77a9[_0xcaa7('0x43')]:_0x3e77a9[_0xcaa7('0x44')]},'attributes':['id',_0xcaa7('0xe')],'raw':!![]});}}})[_0xcaa7('0xc')](function(_0x1a2e55){var _0x2a263e={};if(_0x1a2e55){_[_0xcaa7('0x35')](_0x2a263e,_[_0xcaa7('0x46')](_0x417aaa[_0xcaa7('0x47')],['createdAt',_0xcaa7('0x48'),'id']));_0x2a263e[_0xcaa7('0x49')]=0x15;_0x2a263e[_0xcaa7('0x4a')]='deleted';_0x2a263e[_0xcaa7('0x4b')]=_0x1a2e55['name'];_0x2a263e[_0xcaa7('0x4c')]=_0x3a5f1f[_0xcaa7('0x4d')][_0xcaa7('0xe')];_0x2a263e[_0xcaa7('0x4e')]=_0x3a5f1f['user']['id'];_0x2a263e[_0xcaa7('0x4f')]=!![];_0x2a263e[_0xcaa7('0x50')]=moment()[_0xcaa7('0x51')](_0xcaa7('0x52'));_0x2a263e[_0xcaa7('0x53')]=_0x417aaa[_0xcaa7('0x54')];_0x2a263e[_0xcaa7('0x55')]=_0x417aaa[_0xcaa7('0x43')]?'queue':_0xcaa7('0x56');return db[_0xcaa7('0x57')][_0xcaa7('0x3d')]({'where':{'id':_0x2a263e[_0xcaa7('0x58')]},'attributes':[_0xcaa7('0x59'),_0xcaa7('0x5a')]})['then'](function(_0xcf623b){if(!_[_0xcaa7('0x5b')](_0x4f162c)&&!_['isNil'](_0xcf623b[_0xcaa7('0x59')])){_0x2a263e[_0xcaa7('0x5c')]=_0xcf623b[_0xcaa7('0x59')];if(!_['isNil'](_0xcf623b[_0xcaa7('0x5a')])){_0x2a263e[_0xcaa7('0x5c')]+='\x20'+_0xcf623b['lastName'];}}})[_0xcaa7('0x5d')](function(){return db[_0xcaa7('0x5e')][_0xcaa7('0x3f')](_0x2a263e);});}})[_0xcaa7('0xc')](function(_0xa6be83){return db[_0xcaa7('0x5f')][_0xcaa7('0x42')]({'where':{'CmHopperId':_0x8a94a8}});})[_0xcaa7('0xc')](function(){return _0x4f162c[_0xcaa7('0x3')](0xcc)[_0xcaa7('0x60')]();})[_0xcaa7('0x3e')](handleError(_0x4f162c,null));};exports[_0xcaa7('0x61')]=function(_0x3a6793,_0x1b494a){var _0x2c2df3=[];return db[_0xcaa7('0x57')][_0xcaa7('0x41')]()[_0xcaa7('0xc')](function(_0x596c65){_0x2c2df3=_[_0xcaa7('0x18')](_0x596c65);return _0x3a6793['user'][_0xcaa7('0x62')]({'where':{'type':_0xcaa7('0x63'),'dialActive':!![],'dialMethod':_0xcaa7('0x64')},'attributes':['id','dialOrderByScheduledAt',_0xcaa7('0x65')],'raw':!![]});})[_0xcaa7('0xc')](function(_0x1cf62d){if(_0x1cf62d&&_0x1cf62d[_0xcaa7('0x2d')]){return db[_0xcaa7('0x66')][_0xcaa7('0x67')](function(_0x322423){var _0x188480={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xcaa7('0x51')](_0xcaa7('0x52'))},'VoiceQueueId':{'$in':_['map'](_0x1cf62d,'id')},'$or':[{'UserId':null},{'UserId':_0x3a6793[_0xcaa7('0x4d')]['id']}]};var _0x22a605={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x1cf62d)['filter'](['dialPreviewAutoRecallMe',0x0])[_0xcaa7('0x11')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x3a6793[_0xcaa7('0x4d')]['id']}]};var _0x53c13c={'$or':[_0x188480,_0x22a605]};var _0x3dfb2d=[];if(_0x3a6793['body'][_0xcaa7('0x68')]&&_0x3a6793[_0xcaa7('0x40')][_0xcaa7('0x68')]===_0xcaa7('0x69')){if(!_[_0xcaa7('0x6a')](_0x3a6793[_0xcaa7('0x40')][_0xcaa7('0x6b')])){_0x53c13c['id']={'$in':_0x3a6793[_0xcaa7('0x40')][_0xcaa7('0x6b')]};}_0x3dfb2d=[[_0xcaa7('0x6c'),'ASC'],[_0xcaa7('0x6d'),_0x1cf62d[0x0][_0xcaa7('0x6e')]===_0xcaa7('0x6f')?_0xcaa7('0x70'):_0xcaa7('0x6f')],db[_0xcaa7('0x66')][_0xcaa7('0x71')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xcaa7('0x70')]];}else{if(!_[_0xcaa7('0x6a')](_0x3a6793[_0xcaa7('0x40')][_0xcaa7('0x6b')])){_0x53c13c['id']={'$notIn':_0x3a6793[_0xcaa7('0x40')]['hopperIds']};}_0x3dfb2d=[[_0xcaa7('0x6c'),'DESC'],['scheduledAt',_0x1cf62d[0x0][_0xcaa7('0x6e')]],db[_0xcaa7('0x66')][_0xcaa7('0x71')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0xcaa7('0x6f')]];}return db['CmHopper'][_0xcaa7('0x72')]({'attributes':['id',_0xcaa7('0x73'),'phone',_0xcaa7('0x74')],'where':_0x53c13c,'order':_0x3dfb2d,'transaction':_0x322423,'lock':_0x322423[_0xcaa7('0x75')][_0xcaa7('0x76')],'include':[{'model':db[_0xcaa7('0x57')],'as':_0xcaa7('0x77'),'attributes':_0x2c2df3,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id',_0xcaa7('0xe')]}]},{'model':db[_0xcaa7('0x78')],'as':_0xcaa7('0x79'),'attributes':['id',_0xcaa7('0xe')]},{'model':db[_0xcaa7('0x45')],'as':'Queue','attributes':['id',_0xcaa7('0xe'),_0xcaa7('0x7a')]}]})['then'](function(_0x22841e){if(_0x22841e){return _0x22841e[_0xcaa7('0xb')]({'UserId':_0x3a6793[_0xcaa7('0x4d')]['id']},{'transaction':_0x322423});}});});}})[_0xcaa7('0xc')](handleEntityNotFound(_0x1b494a,null))[_0xcaa7('0xc')](respondWithResult(_0x1b494a,null))[_0xcaa7('0x3e')](handleError(_0x1b494a,null));};exports['getPreviewRecall']=function(_0x4af581,_0x3cbe09,_0x3ea57c){var _0x2b1e92=[];var _0x2381ce=_0x4af581['params']['id'];var _0x5c0380=_0x4af581[_0xcaa7('0x4d')]['id'];return db[_0xcaa7('0x57')][_0xcaa7('0x41')]()[_0xcaa7('0xc')](function(_0x30517b){_0x2b1e92=_['keys'](_0x30517b);return db[_0xcaa7('0x66')][_0xcaa7('0x67')](function(_0x273efe){const _0x2b4c26={'id':_0x2381ce};return db['CmHopper'][_0xcaa7('0x72')]({'attributes':['id',_0xcaa7('0x73'),_0xcaa7('0x74')],'where':_0x2b4c26,'transaction':_0x273efe,'lock':_0x273efe['LOCK'][_0xcaa7('0x76')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x2b1e92,'include':[{'model':db[_0xcaa7('0x7b')],'as':_0xcaa7('0x7c'),'attributes':['id',_0xcaa7('0xe')]}]},{'model':db[_0xcaa7('0x78')],'as':'List','attributes':['id',_0xcaa7('0xe')]},{'model':db[_0xcaa7('0x45')],'as':'Queue','attributes':['id',_0xcaa7('0xe'),_0xcaa7('0x7a')]}]})[_0xcaa7('0xc')](function(_0x5399d3){if(_0x5399d3){return _0x5399d3[_0xcaa7('0xb')]({'UserId':_0x5c0380},{'transaction':_0x273efe});}});});})[_0xcaa7('0xc')](handleEntityNotFound(_0x3cbe09,null))['then'](respondWithResult(_0x3cbe09,null))[_0xcaa7('0x3e')](handleError(_0x3cbe09,null));};exports['getOpenContacts']=function(_0xdc48b8,_0xa3fcb3){return _0xdc48b8['user'][_0xcaa7('0x62')]({'where':{'type':_0xcaa7('0x63'),'dialActive':!![],'dialMethod':_0xcaa7('0x64')},'attributes':['id'],'raw':!![]})['then'](function(_0x1499e9){if(_0x1499e9&&_0x1499e9[_0xcaa7('0x2d')]){return db[_0xcaa7('0x12')][_0xcaa7('0x7')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xcaa7('0x52'))},'VoiceQueueId':{'$in':_[_0xcaa7('0x11')](_0x1499e9,'id')},'$or':[{'UserId':null},{'UserId':_0xdc48b8[_0xcaa7('0x4d')]['id']}]}});}return 0x0;})['then'](function(_0x505d43){if(!_[_0xcaa7('0x5b')](_0x505d43)&&_[_0xcaa7('0x7d')](_0x505d43)){return _0xa3fcb3[_0xcaa7('0x3')](0xc8)[_0xcaa7('0x4')]({'contacts':_0x505d43});}else{logger[_0xcaa7('0xd')]('CmHopper,\x20%s,\x20%s,\x20%s',_0xcaa7('0x7e'),0x194,_0xcaa7('0x7f'));_0xa3fcb3[_0xcaa7('0x80')](0x194);}})[_0xcaa7('0x3e')](handleError(_0xa3fcb3,null));};exports['getTimezones']=function(_0x3e74be,_0x358643){var _0x332433=shared[_0xcaa7('0x81')];var _0x32c6bc=[];_[_0xcaa7('0x11')](_0x332433,function(_0x16559e){_0x32c6bc['push']({'id':_0x16559e[_0xcaa7('0xe')],'name':_0x16559e[_0xcaa7('0xe')],'utcOffset':_0x16559e['utcOffset']});});return _0x358643['status'](0xc8)[_0xcaa7('0x4')]({'tz':_0x32c6bc});};exports[_0xcaa7('0x82')]=function(_0x3797fc,_0x4dfb92){var _0x1a7f2a=shared[_0xcaa7('0x81')];var _0x28cfa4={};if(!_[_0xcaa7('0x5b')](_0x1a7f2a[_0x3797fc[_0xcaa7('0x40')]['id']]))_0x28cfa4=_0x1a7f2a[_0x3797fc[_0xcaa7('0x40')]['id']];return _0x4dfb92[_0xcaa7('0x3')](0xc8)[_0xcaa7('0x4')](_0x28cfa4);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index d86d9c4..10e8758 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 _0xeda8=['exports','define','cm_hopper','scheduledat','phone','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes'];(function(_0x2f0972,_0x2b7f19){var _0x1a67fc=function(_0x3954c2){while(--_0x3954c2){_0x2f0972['push'](_0x2f0972['shift']());}};_0x1a67fc(++_0x2b7f19);}(_0xeda8,0x104));var _0x8eda=function(_0x2911a3,_0x64544c){_0x2911a3=_0x2911a3-0x0;var _0x539773=_0xeda8[_0x2911a3];return _0x539773;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var logger=require('../../config/logger')(_0x8eda('0x2'));var moment=require(_0x8eda('0x3'));var BPromise=require(_0x8eda('0x4'));var rp=require(_0x8eda('0x5'));var fs=require('fs');var path=require(_0x8eda('0x6'));var rimraf=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var attributes=require(_0x8eda('0x9'));module[_0x8eda('0xa')]=function(_0x1f3556,_0x349361){return _0x1f3556[_0x8eda('0xb')]('CmHopper',attributes,{'tableName':_0x8eda('0xc'),'paranoid':![],'indexes':[{'name':_0x8eda('0xd'),'fields':[_0x8eda('0xd')]},{'name':_0x8eda('0xe'),'fields':['phone']},{'name':'priority','fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0x33af=['request-promise','path','rimraf','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','util','api','moment','bluebird'];(function(_0xc171df,_0x26c450){var _0x45a7ca=function(_0x379f36){while(--_0x379f36){_0xc171df['push'](_0xc171df['shift']());}};_0x45a7ca(++_0x26c450);}(_0x33af,0xec));var _0xf33a=function(_0x2ef644,_0x2ab0ff){_0x2ef644=_0x2ef644-0x0;var _0x11f00e=_0x33af[_0x2ef644];return _0x11f00e;};'use strict';var _=require('lodash');var util=require(_0xf33a('0x0'));var logger=require('../../config/logger')(_0xf33a('0x1'));var moment=require(_0xf33a('0x2'));var BPromise=require(_0xf33a('0x3'));var rp=require(_0xf33a('0x4'));var fs=require('fs');var path=require(_0xf33a('0x5'));var rimraf=require(_0xf33a('0x6'));var config=require('../../config/environment');var attributes=require(_0xf33a('0x7'));module[_0xf33a('0x8')]=function(_0x583e54,_0xc0dd13){return _0x583e54[_0xf33a('0x9')](_0xf33a('0xa'),attributes,{'tableName':_0xf33a('0xb'),'paranoid':![],'indexes':[{'name':_0xf33a('0xc'),'fields':[_0xf33a('0xc')]},{'name':'phone','fields':[_0xf33a('0xd')]},{'name':_0xf33a('0xe'),'fields':[_0xf33a('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 972cdc1..7dd8a23 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 _0xae1b=['include','map','model','then','info','debug','stringify','catch','error','message','CmHopper','find','raw','where','ShowCmHopper','CreateCmHopper','create','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','body','active','DestroyCmHopper','CmContact','sequelize','transaction','order','LOCK','UPDATE','Contact','keys','User','Agent','name','voicePause','UserId','push','includes','all','GetContactDialer','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','describe','GetCmHopperPreview','findOne','phone','DESC','getContactByPhone','ResetActiveCalls','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','CmList','List','CmHopperHandlePreviewRecallNotifications','util','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','findAll','options','attributes','limit'];(function(_0x948ee,_0x3be035){var _0x3466ff=function(_0x242e6f){while(--_0x242e6f){_0x948ee['push'](_0x948ee['shift']());}};_0x3466ff(++_0x3be035);}(_0xae1b,0x96));var _0xbae1=function(_0xeff426,_0x2989cd){_0xeff426=_0xeff426-0x0;var _0x2093df=_0xae1b[_0xeff426];return _0x2093df;};'use strict';var _=require('lodash');var util=require(_0xbae1('0x0'));var moment=require('moment');var BPromise=require(_0xbae1('0x1'));var db=require(_0xbae1('0x2'))['db'];var logger=require(_0xbae1('0x3'))(_0xbae1('0x4'));exports[_0xbae1('0x5')]=function(_0x3f091e){var _0x58b46c=this;return new Promise(function(_0x3a09f0,_0x3fef4c){return db['CmHopper'][_0xbae1('0x6')]({'raw':_0x3f091e['options']?_0x3f091e[_0xbae1('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0x3f091e[_0xbae1('0x7')]?_0x3f091e[_0xbae1('0x7')]['where']||null:null,'attributes':_0x3f091e[_0xbae1('0x7')]?_0x3f091e[_0xbae1('0x7')][_0xbae1('0x8')]||null:null,'limit':_0x3f091e[_0xbae1('0x7')]?_0x3f091e[_0xbae1('0x7')][_0xbae1('0x9')]||null:null,'include':_0x3f091e[_0xbae1('0x7')]?_0x3f091e[_0xbae1('0x7')][_0xbae1('0xa')]?_[_0xbae1('0xb')](_0x3f091e[_0xbae1('0x7')][_0xbae1('0xa')],function(_0x52c218){return{'model':db[_0x52c218['model']],'as':_0x52c218['as'],'attributes':_0x52c218['attributes'],'include':_0x52c218['include']?_[_0xbae1('0xb')](_0x52c218[_0xbae1('0xa')],function(_0x23383e){return{'model':db[_0x23383e[_0xbae1('0xc')]],'as':_0x23383e['as'],'attributes':_0x23383e[_0xbae1('0x8')],'include':_0x23383e['include']?_[_0xbae1('0xb')](_0x23383e[_0xbae1('0xa')],function(_0x3ccda9){return{'model':db[_0x3ccda9['model']],'as':_0x3ccda9['as'],'attributes':_0x3ccda9[_0xbae1('0x8')]};}):[]};}):[]};}):[]:[]})[_0xbae1('0xd')](function(_0x7322a2){logger[_0xbae1('0xe')](_0xbae1('0x5'),_0x3f091e);logger[_0xbae1('0xf')](_0xbae1('0x5'),_0x3f091e,JSON[_0xbae1('0x10')](_0x7322a2));_0x3a09f0(_0x7322a2);})[_0xbae1('0x11')](function(_0x19b91c){logger[_0xbae1('0x12')](_0xbae1('0x5'),_0x19b91c[_0xbae1('0x13')],_0x3f091e);_0x3fef4c(_0x58b46c[_0xbae1('0x12')](0x1f4,_0x19b91c[_0xbae1('0x13')]));});});};exports['ShowCmHopper']=function(_0x4297a6){var _0x2d6431=this;return new Promise(function(_0x14398d,_0x17a4b6){return db[_0xbae1('0x14')][_0xbae1('0x15')]({'raw':_0x4297a6[_0xbae1('0x7')]?_0x4297a6[_0xbae1('0x7')][_0xbae1('0x16')]===undefined?!![]:![]:!![],'where':_0x4297a6[_0xbae1('0x7')]?_0x4297a6[_0xbae1('0x7')][_0xbae1('0x17')]||null:null,'attributes':_0x4297a6[_0xbae1('0x7')]?_0x4297a6[_0xbae1('0x7')][_0xbae1('0x8')]||null:null,'include':_0x4297a6[_0xbae1('0x7')]?_0x4297a6['options'][_0xbae1('0xa')]?_[_0xbae1('0xb')](_0x4297a6['options']['include'],function(_0x30b28f){return{'model':db[_0x30b28f['model']],'as':_0x30b28f['as'],'attributes':_0x30b28f[_0xbae1('0x8')],'include':_0x30b28f[_0xbae1('0xa')]?_[_0xbae1('0xb')](_0x30b28f[_0xbae1('0xa')],function(_0x2f934b){return{'model':db[_0x2f934b[_0xbae1('0xc')]],'as':_0x2f934b['as'],'attributes':_0x2f934b['attributes'],'include':_0x2f934b[_0xbae1('0xa')]?_[_0xbae1('0xb')](_0x2f934b[_0xbae1('0xa')],function(_0x4d77e5){return{'model':db[_0x4d77e5['model']],'as':_0x4d77e5['as'],'attributes':_0x4d77e5[_0xbae1('0x8')]};}):[]};}):[]};}):[]:[]})[_0xbae1('0xd')](function(_0x9d58d7){logger[_0xbae1('0xe')](_0xbae1('0x18'),_0x4297a6);logger[_0xbae1('0xf')](_0xbae1('0x18'),_0x4297a6,JSON[_0xbae1('0x10')](_0x9d58d7));_0x14398d(_0x9d58d7);})[_0xbae1('0x11')](function(_0x37dfba){logger['error'](_0xbae1('0x18'),_0x37dfba['message'],_0x4297a6);_0x17a4b6(_0x2d6431['error'](0x1f4,_0x37dfba['message']));});});};exports[_0xbae1('0x19')]=function(_0x8fb483){var _0x1069d2=this;return new Promise(function(_0x1a45cb,_0x761114){return db[_0xbae1('0x14')][_0xbae1('0x1a')](_0x8fb483['body'],{'raw':_0x8fb483['options']?_0x8fb483[_0xbae1('0x7')][_0xbae1('0x16')]===undefined?!![]:![]:!![]})[_0xbae1('0xd')](function(_0x5ec1d3){logger[_0xbae1('0xe')](_0xbae1('0x19'),_0x8fb483);logger[_0xbae1('0xf')]('CreateCmHopper',_0x8fb483,JSON[_0xbae1('0x10')](_0x5ec1d3));_0x1a45cb(_0x5ec1d3);})[_0xbae1('0x11')](function(_0x21b985){logger[_0xbae1('0x12')](_0xbae1('0x19'),_0x21b985[_0xbae1('0x13')],_0x8fb483);_0x761114(_0x1069d2[_0xbae1('0x12')](0x1f4,_0x21b985[_0xbae1('0x13')]));});});};exports[_0xbae1('0x1b')]=function(_0x1ecb50){var _0x310d24=this;return new Promise(function(_0x47048a,_0x3f7072){return db[_0xbae1('0x14')][_0xbae1('0x1c')](_0x1ecb50['body'],{'raw':_0x1ecb50[_0xbae1('0x7')]?_0x1ecb50['options'][_0xbae1('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ecb50[_0xbae1('0x7')]?_0x1ecb50['options'][_0xbae1('0x17')]||null:null,'attributes':_0x1ecb50['options']?_0x1ecb50[_0xbae1('0x7')][_0xbae1('0x8')]||null:null,'limit':_0x1ecb50['options']?_0x1ecb50['options']['limit']||null:null})[_0xbae1('0xd')](function(_0x1b29e0){logger[_0xbae1('0xe')](_0xbae1('0x1b'),_0x1ecb50);logger[_0xbae1('0xe')](_0xbae1('0x1d'),JSON['stringify'](_0x1ecb50['options'][_0xbae1('0x17')]),_0x1ecb50[_0xbae1('0x1e')][_0xbae1('0x1f')]);logger[_0xbae1('0xf')]('UpdateCmHopper',_0x1ecb50,JSON[_0xbae1('0x10')](_0x1b29e0));_0x47048a(_0x1b29e0);})['catch'](function(_0xb6bcb0){logger[_0xbae1('0x12')](_0xbae1('0x1b'),_0xb6bcb0[_0xbae1('0x13')],_0x1ecb50);_0x3f7072(_0x310d24[_0xbae1('0x12')](0x1f4,_0xb6bcb0[_0xbae1('0x13')]));});});};exports[_0xbae1('0x20')]=function(_0x121d6d){var _0x213213=this;return new Promise(function(_0x453202,_0x232289){return db[_0xbae1('0x14')]['destroy']({'where':_0x121d6d[_0xbae1('0x7')]?_0x121d6d[_0xbae1('0x7')][_0xbae1('0x17')]||null:null})[_0xbae1('0xd')](function(_0xe63c51){logger[_0xbae1('0xe')](_0xbae1('0x20'),_0x121d6d);logger[_0xbae1('0xf')](_0xbae1('0x20'),_0x121d6d,JSON['stringify'](_0xe63c51));_0x453202(_0xe63c51);})['catch'](function(_0x1b74ad){logger[_0xbae1('0x12')](_0xbae1('0x20'),_0x1b74ad[_0xbae1('0x13')],_0x121d6d);_0x232289(_0x213213[_0xbae1('0x12')](0x1f4,_0x1b74ad[_0xbae1('0x13')]));});});};exports['GetContactDialer']=function(_0x40f64b){var _0xc50d3b=this;return new Promise(function(_0x1b33a7,_0x42b8fc){return db[_0xbae1('0x21')]['describe']()[_0xbae1('0xd')](function(_0x3138b4){return db[_0xbae1('0x22')][_0xbae1('0x23')](function(_0x3296bd){return db['CmHopper'][_0xbae1('0x6')]({'where':_0x40f64b[_0xbae1('0x7')]?_0x40f64b[_0xbae1('0x7')][_0xbae1('0x17')]||null:null,'attributes':_0x40f64b[_0xbae1('0x7')]?_0x40f64b['options'][_0xbae1('0x8')]||null:null,'limit':_0x40f64b['options']?_0x40f64b[_0xbae1('0x7')][_0xbae1('0x9')]||null:null,'order':_0x40f64b[_0xbae1('0x7')]?_0x40f64b['options'][_0xbae1('0x24')]||null:null,'transaction':_0x3296bd,'lock':_0x3296bd[_0xbae1('0x25')][_0xbae1('0x26')],'include':[{'model':db[_0xbae1('0x21')],'as':_0xbae1('0x27'),'attributes':_[_0xbae1('0x28')](_0x3138b4)},{'model':db[_0xbae1('0x29')],'as':_0xbae1('0x2a'),'attributes':['id',_0xbae1('0x2b'),_0xbae1('0x2c')]}]})[_0xbae1('0xd')](function(_0x31df2b){var _0x331490=[];var _0x30b3ed=[];for(var _0x4caae9=0x0;_0x4caae9<_0x31df2b['length'];_0x4caae9+=0x1){var _0x2dcfe=_0x31df2b[_0x4caae9][_0xbae1('0x2d')];if(_0x2dcfe===null){_0x331490[_0xbae1('0x2e')](_0x31df2b[_0x4caae9][_0xbae1('0x1c')](_0x40f64b[_0xbae1('0x1e')],{'transaction':_0x3296bd}));}else if(!_0x30b3ed[_0xbae1('0x2f')](_0x2dcfe)){_0x30b3ed[_0xbae1('0x2e')](_0x2dcfe);_0x331490[_0xbae1('0x2e')](_0x31df2b[_0x4caae9][_0xbae1('0x1c')](_0x40f64b['body'],{'transaction':_0x3296bd}));}}return BPromise[_0xbae1('0x30')](_0x331490);});})[_0xbae1('0xd')](function(_0x414bc5){logger[_0xbae1('0xe')](_0xbae1('0x31'),_0x40f64b);if(_0x414bc5[_0xbae1('0x32')]>0x0){logger['info'](_0xbae1('0x33'),_0x414bc5[0x0][_0xbae1('0x34')]['id'],_0x414bc5[0x0][_0xbae1('0x34')]['ContactId'],_0x414bc5[0x0]['dataValues']['active']);}logger[_0xbae1('0xf')](_0xbae1('0x31'),_0x40f64b,JSON[_0xbae1('0x10')](_0x414bc5));_0x1b33a7(_0x414bc5);})[_0xbae1('0x11')](function(_0x30c2e2){logger[_0xbae1('0x12')](_0xbae1('0x31'),_0x30c2e2['message'],_0x40f64b);_0x42b8fc(_0xc50d3b[_0xbae1('0x12')](0x1f4,_0x30c2e2[_0xbae1('0x13')]));});});});};exports[_0xbae1('0x35')]=function(_0x1b2963){var _0xd501a5=this;return new Promise(function(_0x28d9a5,_0x53f626){return db['sequelize'][_0xbae1('0x23')](function(_0x573913){return db['CmHopperFinal']['create'](_0x1b2963[_0xbae1('0x1e')],{'raw':_0x1b2963[_0xbae1('0x7')]?_0x1b2963[_0xbae1('0x7')]['raw']===undefined?!![]:![]:!![],'transaction':_0x573913})[_0xbae1('0xd')](function(){logger[_0xbae1('0xe')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xbae1('0x10')](_0x1b2963[_0xbae1('0x7')]['where']),_0x1b2963[_0xbae1('0x7')][_0xbae1('0x17')]['active']);return db[_0xbae1('0x14')]['destroy']({'where':_0x1b2963['options']?_0x1b2963['options'][_0xbae1('0x17')]||null:null,'transaction':_0x573913});});})[_0xbae1('0xd')](function(_0x35a9e0){logger[_0xbae1('0xe')]('MoveContactManagedDialer',_0x1b2963);logger[_0xbae1('0xf')](_0xbae1('0x35'),_0x1b2963,JSON[_0xbae1('0x10')](_0x35a9e0));_0x28d9a5(_0x35a9e0);})[_0xbae1('0x11')](function(_0x558900){logger[_0xbae1('0x12')]('MoveContactManagedDialer',_0x558900[_0xbae1('0x13')],_0x1b2963);_0x53f626(_0xd501a5[_0xbae1('0x12')](0x1f4,_0x558900['message']));});});};exports['CountReScheduled']=function(_0x4bd847){var _0x57ebfb=this;return new Promise(function(_0xc914e3,_0x36af55){return db[_0xbae1('0x14')][_0xbae1('0x6')]({'raw':_0x4bd847[_0xbae1('0x7')]?_0x4bd847['options'][_0xbae1('0x16')]===undefined?!![]:![]:!![],'where':_0x4bd847['options']?_0x4bd847[_0xbae1('0x7')][_0xbae1('0x17')]||null:null,'attributes':[[db[_0xbae1('0x22')]['fn'](_0xbae1('0x36'),db[_0xbae1('0x22')]['fn']('IF',db[_0xbae1('0x22')][_0xbae1('0x37')](_0xbae1('0x38')+util[_0xbae1('0x39')](_0xbae1('0x3a'),moment()[_0xbae1('0x39')](_0xbae1('0x3b')))+_0xbae1('0x3c')))),_0xbae1('0x3d')]]})[_0xbae1('0xd')](function(_0x269705){logger[_0xbae1('0xe')](_0xbae1('0x3e'),_0x4bd847);logger[_0xbae1('0xf')](_0xbae1('0x3e'),_0x4bd847,JSON[_0xbae1('0x10')](_0x269705));_0xc914e3(_0x269705);})['catch'](function(_0x55576f){logger[_0xbae1('0x12')](_0xbae1('0x3e'),_0x55576f[_0xbae1('0x13')],_0x4bd847);_0x36af55(_0x57ebfb['error'](0x1f4,_0x55576f[_0xbae1('0x13')]));});});};exports[_0xbae1('0x3f')]=function(_0x2e2bda){var _0x7145e3=this;return new Promise(function(_0x43c005,_0x134d95){return db[_0xbae1('0x21')][_0xbae1('0x40')]()[_0xbae1('0xd')](function(){return db[_0xbae1('0x22')][_0xbae1('0x23')](function(_0x273ca4){return db[_0xbae1('0x14')][_0xbae1('0x6')]({'where':_0x2e2bda['options']?_0x2e2bda['options'][_0xbae1('0x17')]||null:null,'attributes':_0x2e2bda[_0xbae1('0x7')]?_0x2e2bda[_0xbae1('0x7')][_0xbae1('0x8')]||null:null,'limit':0x1,'order':_0x2e2bda[_0xbae1('0x7')]?_0x2e2bda[_0xbae1('0x7')][_0xbae1('0x24')]||null:null,'group':db[_0xbae1('0x14')][_0xbae1('0x2d')],'transaction':_0x273ca4,'lock':_0x273ca4[_0xbae1('0x25')][_0xbae1('0x26')],'include':_0x2e2bda[_0xbae1('0x7')]?_0x2e2bda[_0xbae1('0x7')]['include']?_[_0xbae1('0xb')](_0x2e2bda[_0xbae1('0x7')][_0xbae1('0xa')],function(_0x4b6ae3){return{'model':db[_0x4b6ae3[_0xbae1('0xc')]],'as':_0x4b6ae3['as'],'attributes':_0x4b6ae3[_0xbae1('0x8')],'include':_0x4b6ae3['include']?_['map'](_0x4b6ae3[_0xbae1('0xa')],function(_0x143126){return{'model':db[_0x143126[_0xbae1('0xc')]],'as':_0x143126['as'],'attributes':_0x143126[_0xbae1('0x8')],'include':_0x143126[_0xbae1('0xa')]?_['map'](_0x143126[_0xbae1('0xa')],function(_0x8047da){return{'model':db[_0x8047da[_0xbae1('0xc')]],'as':_0x8047da['as'],'attributes':_0x8047da[_0xbae1('0x8')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b6f07){var _0x49a5c6=[];for(var _0x5781f6=0x0;_0x5781f6<_0x4b6f07[_0xbae1('0x32')];_0x5781f6+=0x1){_0x49a5c6[_0xbae1('0x2e')](_0x4b6f07[_0x5781f6]['update'](_0x2e2bda['body'],{'transaction':_0x273ca4}));}return BPromise[_0xbae1('0x30')](_0x49a5c6);});})[_0xbae1('0xd')](function(_0x228c1b){logger[_0xbae1('0xe')](_0xbae1('0x3f'),_0x2e2bda);logger[_0xbae1('0xf')](_0xbae1('0x3f'),_0x2e2bda,JSON[_0xbae1('0x10')](_0x228c1b));_0x43c005(_0x228c1b);})['catch'](function(_0x47b9d9){logger[_0xbae1('0x12')](_0xbae1('0x3f'),_0x47b9d9[_0xbae1('0x13')],_0x2e2bda);_0x134d95(_0x7145e3[_0xbae1('0x12')](0x1f4,_0x47b9d9[_0xbae1('0x13')]));});});});};exports[_0xbae1('0x41')]=function(_0x33a1ca){var _0x55460f=this;return new Promise(function(_0x209a63,_0x425b94){db['CmContact'][_0xbae1('0x40')]()[_0xbae1('0xd')](function(_0x197605){return db[_0xbae1('0x14')][_0xbae1('0x6')]({'raw':_0x33a1ca[_0xbae1('0x7')]?_0x33a1ca[_0xbae1('0x7')][_0xbae1('0x16')]===undefined?!![]:![]:!![],'where':_0x33a1ca['options']?_0x33a1ca[_0xbae1('0x7')][_0xbae1('0x17')]||null:null,'attributes':_0x33a1ca[_0xbae1('0x7')]?_0x33a1ca[_0xbae1('0x7')][_0xbae1('0x8')]||null:null,'limit':_0x33a1ca[_0xbae1('0x7')]?_0x33a1ca[_0xbae1('0x7')][_0xbae1('0x9')]||null:null,'include':_0x33a1ca['options']?_0x33a1ca['options'][_0xbae1('0xa')]?_[_0xbae1('0xb')](_0x33a1ca['options']['include'],function(_0x176c94){return{'model':db[_0x176c94[_0xbae1('0xc')]],'as':_0x176c94['as'],'attributes':_0x176c94['as']==='Contact'?_['keys'](_0x197605):_0x176c94[_0xbae1('0x8')],'include':_0x176c94[_0xbae1('0xa')]?_['map'](_0x176c94[_0xbae1('0xa')],function(_0x3f6c0){return{'model':db[_0x3f6c0['model']],'as':_0x3f6c0['as'],'attributes':_0x3f6c0[_0xbae1('0x8')],'include':_0x3f6c0[_0xbae1('0xa')]?_[_0xbae1('0xb')](_0x3f6c0['include'],function(_0x5674a3){return{'model':db[_0x5674a3[_0xbae1('0xc')]],'as':_0x5674a3['as'],'attributes':_0x5674a3[_0xbae1('0x8')]};}):[]};}):[]};}):[]:[]})[_0xbae1('0xd')](function(_0x47f33d){logger[_0xbae1('0xe')](_0xbae1('0x5'),_0x33a1ca);logger['debug'](_0xbae1('0x5'),_0x33a1ca,JSON[_0xbae1('0x10')](_0x47f33d));_0x209a63(_0x47f33d);})['catch'](function(_0x18318e){logger['error'](_0xbae1('0x5'),_0x18318e['message'],_0x33a1ca);_0x425b94(_0x55460f[_0xbae1('0x12')](0x1f4,_0x18318e[_0xbae1('0x13')]));});});});};exports['GetContactByPhone']=function(_0xc88a7f){var _0x3464ca=this;return new Promise(function(_0x343c78,_0x537f26){return db[_0xbae1('0x21')][_0xbae1('0x42')]({'raw':!![],'where':{'phone':_0xc88a7f[_0xbae1('0x7')][_0xbae1('0x17')][_0xbae1('0x43')]},'attributes':['id','dialTimezone'],'order':[['id',_0xbae1('0x44')]]})[_0xbae1('0xd')](function(_0x2f9c79){logger[_0xbae1('0xe')](_0xbae1('0x45'),_0xc88a7f);logger[_0xbae1('0xf')](_0xbae1('0x45'),_0xc88a7f,JSON[_0xbae1('0x10')](_0x2f9c79));_0x343c78(_0x2f9c79);})['catch'](function(_0x2649c4){logger[_0xbae1('0x12')](_0xbae1('0x45'),_0x2649c4[_0xbae1('0x13')],_0xc88a7f);_0x537f26(_0x3464ca['error'](0x1f4,_0x2649c4['message']));});});};exports['ResetActiveCalls']=function(_0x5be4f4){var _0xc73c6a=this;return new Promise(function(_0x22a3e3,_0x12c2db){return db[_0xbae1('0x22')][_0xbae1('0x23')](function(_0x260012){var _0x461f4a=_0x5be4f4[_0xbae1('0x7')]&&_0x5be4f4['options'][_0xbae1('0x17')]?_0x5be4f4[_0xbae1('0x7')]['where']:{};return db[_0xbae1('0x14')][_0xbae1('0x1c')](_0x5be4f4[_0xbae1('0x1e')],{'where':_0x461f4a,'transaction':_0x260012})['then'](function(_0x4cb2b9){logger[_0xbae1('0xe')](_0xbae1('0x46'),_0x5be4f4);logger['debug'](_0xbae1('0x46'),_0x5be4f4,JSON[_0xbae1('0x10')](_0x4cb2b9));_0x22a3e3(_0x4cb2b9);})['catch'](function(_0x5b1dde){logger['error'](_0xbae1('0x46'),_0x5b1dde['message'],_0x5be4f4);_0x12c2db(_0xc73c6a[_0xbae1('0x12')](0x1f4,_0x5b1dde[_0xbae1('0x13')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x50aa30){var _0x124e25=this;var _0x573e63=_0x50aa30[_0xbae1('0x1e')][_0xbae1('0x17')][_0xbae1('0x47')];var _0x56448e=_0x50aa30[_0xbae1('0x1e')][_0xbae1('0x17')][_0xbae1('0x48')];var _0x16df8d=_0x50aa30[_0xbae1('0x1e')]['where'][_0xbae1('0x49')];return new Promise(function(_0x46b37c,_0x191f53){return db['CmHopper']['findAll']({'where':{'voiceQueueId':{'$in':_0x573e63},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize']['literal'](_0xbae1('0x4a')+_0x56448e+_0xbae1('0x4b')),'$gt':db['sequelize']['literal'](_0xbae1('0x4c'))}},'UserId':{'$in':_0x16df8d}},'include':[{'model':db[_0xbae1('0x21')],'as':_0xbae1('0x27')},{'model':db[_0xbae1('0x29')],'as':_0xbae1('0x2a'),'attributes':['id',_0xbae1('0x2b'),_0xbae1('0x2c')]},{'model':db[_0xbae1('0x4d')],'as':_0xbae1('0x4e')}]})[_0xbae1('0xd')](function(_0x276323){if(_0x276323['length']>0x0){return db[_0xbae1('0x22')]['transaction'](function(_0x6644b1){return db[_0xbae1('0x14')][_0xbae1('0x1c')]({'recallmeNotifiedDate':db[_0xbae1('0x22')][_0xbae1('0x37')](_0xbae1('0x4c'))},{'where':{'id':{'$in':_[_0xbae1('0xb')](_0x276323,'id')}},'transaction':_0x6644b1})['then'](function(){_0x46b37c(_0x276323);})[_0xbae1('0x11')](function(_0xc24679){logger[_0xbae1('0x12')]('CmHopperHandlePreviewRecallNotifications',_0xc24679[_0xbae1('0x13')],_0x50aa30);_0x191f53(_0x124e25[_0xbae1('0x12')](0x1f4,_0xc24679[_0xbae1('0x13')]));});})[_0xbae1('0x11')](function(_0x5c4d8d){logger[_0xbae1('0x12')](_0xbae1('0x4f'),_0x5c4d8d['message'],_0x50aa30);_0x191f53(_0x124e25[_0xbae1('0x12')](0x1f4,_0x5c4d8d['message']));});}else{_0x46b37c(_0x276323);}});});}; \ No newline at end of file +var _0x01f5=['../../mysqldb','rpc','GetCmHopper','CmHopper','findAll','options','where','limit','include','map','model','attributes','then','info','debug','catch','error','message','ShowCmHopper','stringify','CreateCmHopper','create','body','raw','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','destroy','DestroyCmHopper','GetContactDialer','describe','order','LOCK','UPDATE','CmContact','Contact','keys','User','Agent','name','voicePause','length','UserId','push','includes','update','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','transaction','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','sequelize','COUNT','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','GetContactRecallMe','findOne','phone','dialTimezone','getContactByPhone','ResetActiveCalls','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','CmList','List','lodash','util','bluebird'];(function(_0x477c0c,_0x48b400){var _0x37d540=function(_0x2d95e2){while(--_0x2d95e2){_0x477c0c['push'](_0x477c0c['shift']());}};_0x37d540(++_0x48b400);}(_0x01f5,0x131));var _0x501f=function(_0x33d8e0,_0x2469f1){_0x33d8e0=_0x33d8e0-0x0;var _0x5895a5=_0x01f5[_0x33d8e0];return _0x5895a5;};'use strict';var _=require(_0x501f('0x0'));var util=require(_0x501f('0x1'));var moment=require('moment');var BPromise=require(_0x501f('0x2'));var db=require(_0x501f('0x3'))['db'];var logger=require('../../config/logger')(_0x501f('0x4'));exports[_0x501f('0x5')]=function(_0xbeea9a){var _0x545aed=this;return new Promise(function(_0x10ada4,_0xabc6ca){return db[_0x501f('0x6')][_0x501f('0x7')]({'raw':_0xbeea9a[_0x501f('0x8')]?_0xbeea9a[_0x501f('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0xbeea9a[_0x501f('0x8')]?_0xbeea9a[_0x501f('0x8')][_0x501f('0x9')]||null:null,'attributes':_0xbeea9a[_0x501f('0x8')]?_0xbeea9a[_0x501f('0x8')]['attributes']||null:null,'limit':_0xbeea9a['options']?_0xbeea9a[_0x501f('0x8')][_0x501f('0xa')]||null:null,'include':_0xbeea9a[_0x501f('0x8')]?_0xbeea9a['options'][_0x501f('0xb')]?_[_0x501f('0xc')](_0xbeea9a[_0x501f('0x8')][_0x501f('0xb')],function(_0x1cdfdc){return{'model':db[_0x1cdfdc[_0x501f('0xd')]],'as':_0x1cdfdc['as'],'attributes':_0x1cdfdc['attributes'],'include':_0x1cdfdc[_0x501f('0xb')]?_[_0x501f('0xc')](_0x1cdfdc[_0x501f('0xb')],function(_0x325d95){return{'model':db[_0x325d95[_0x501f('0xd')]],'as':_0x325d95['as'],'attributes':_0x325d95[_0x501f('0xe')],'include':_0x325d95['include']?_['map'](_0x325d95[_0x501f('0xb')],function(_0x35b694){return{'model':db[_0x35b694[_0x501f('0xd')]],'as':_0x35b694['as'],'attributes':_0x35b694[_0x501f('0xe')]};}):[]};}):[]};}):[]:[]})[_0x501f('0xf')](function(_0x294de2){logger[_0x501f('0x10')](_0x501f('0x5'),_0xbeea9a);logger[_0x501f('0x11')](_0x501f('0x5'),_0xbeea9a,JSON['stringify'](_0x294de2));_0x10ada4(_0x294de2);})[_0x501f('0x12')](function(_0x1bf60f){logger[_0x501f('0x13')]('GetCmHopper',_0x1bf60f[_0x501f('0x14')],_0xbeea9a);_0xabc6ca(_0x545aed[_0x501f('0x13')](0x1f4,_0x1bf60f['message']));});});};exports[_0x501f('0x15')]=function(_0xe0c9d7){var _0x529347=this;return new Promise(function(_0x14453e,_0x5df8ac){return db['CmHopper']['find']({'raw':_0xe0c9d7[_0x501f('0x8')]?_0xe0c9d7['options']['raw']===undefined?!![]:![]:!![],'where':_0xe0c9d7[_0x501f('0x8')]?_0xe0c9d7['options'][_0x501f('0x9')]||null:null,'attributes':_0xe0c9d7['options']?_0xe0c9d7[_0x501f('0x8')][_0x501f('0xe')]||null:null,'include':_0xe0c9d7[_0x501f('0x8')]?_0xe0c9d7[_0x501f('0x8')][_0x501f('0xb')]?_[_0x501f('0xc')](_0xe0c9d7[_0x501f('0x8')]['include'],function(_0x4753c1){return{'model':db[_0x4753c1['model']],'as':_0x4753c1['as'],'attributes':_0x4753c1[_0x501f('0xe')],'include':_0x4753c1[_0x501f('0xb')]?_[_0x501f('0xc')](_0x4753c1[_0x501f('0xb')],function(_0x3532f7){return{'model':db[_0x3532f7[_0x501f('0xd')]],'as':_0x3532f7['as'],'attributes':_0x3532f7[_0x501f('0xe')],'include':_0x3532f7[_0x501f('0xb')]?_[_0x501f('0xc')](_0x3532f7[_0x501f('0xb')],function(_0x2693c9){return{'model':db[_0x2693c9[_0x501f('0xd')]],'as':_0x2693c9['as'],'attributes':_0x2693c9[_0x501f('0xe')]};}):[]};}):[]};}):[]:[]})[_0x501f('0xf')](function(_0x5466f4){logger[_0x501f('0x10')](_0x501f('0x15'),_0xe0c9d7);logger[_0x501f('0x11')](_0x501f('0x15'),_0xe0c9d7,JSON[_0x501f('0x16')](_0x5466f4));_0x14453e(_0x5466f4);})[_0x501f('0x12')](function(_0x6a08e4){logger['error']('ShowCmHopper',_0x6a08e4[_0x501f('0x14')],_0xe0c9d7);_0x5df8ac(_0x529347['error'](0x1f4,_0x6a08e4[_0x501f('0x14')]));});});};exports[_0x501f('0x17')]=function(_0x444acb){var _0x3982ae=this;return new Promise(function(_0x1bb23d,_0x2fe689){return db[_0x501f('0x6')][_0x501f('0x18')](_0x444acb[_0x501f('0x19')],{'raw':_0x444acb[_0x501f('0x8')]?_0x444acb[_0x501f('0x8')][_0x501f('0x1a')]===undefined?!![]:![]:!![]})[_0x501f('0xf')](function(_0x17f882){logger[_0x501f('0x10')](_0x501f('0x17'),_0x444acb);logger[_0x501f('0x11')](_0x501f('0x17'),_0x444acb,JSON['stringify'](_0x17f882));_0x1bb23d(_0x17f882);})[_0x501f('0x12')](function(_0x459ab2){logger[_0x501f('0x13')](_0x501f('0x17'),_0x459ab2[_0x501f('0x14')],_0x444acb);_0x2fe689(_0x3982ae['error'](0x1f4,_0x459ab2[_0x501f('0x14')]));});});};exports['UpdateCmHopper']=function(_0x217f8d){var _0x47c68a=this;return new Promise(function(_0x15dd5f,_0x376769){return db[_0x501f('0x6')]['update'](_0x217f8d[_0x501f('0x19')],{'raw':_0x217f8d[_0x501f('0x8')]?_0x217f8d[_0x501f('0x8')][_0x501f('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x217f8d['options']?_0x217f8d['options'][_0x501f('0x9')]||null:null,'attributes':_0x217f8d[_0x501f('0x8')]?_0x217f8d[_0x501f('0x8')][_0x501f('0xe')]||null:null,'limit':_0x217f8d['options']?_0x217f8d[_0x501f('0x8')][_0x501f('0xa')]||null:null})[_0x501f('0xf')](function(_0x52baff){logger[_0x501f('0x10')](_0x501f('0x1b'),_0x217f8d);logger[_0x501f('0x10')](_0x501f('0x1c'),JSON[_0x501f('0x16')](_0x217f8d[_0x501f('0x8')][_0x501f('0x9')]),_0x217f8d['body'][_0x501f('0x1d')]);logger[_0x501f('0x11')](_0x501f('0x1b'),_0x217f8d,JSON[_0x501f('0x16')](_0x52baff));_0x15dd5f(_0x52baff);})[_0x501f('0x12')](function(_0x493765){logger[_0x501f('0x13')](_0x501f('0x1b'),_0x493765[_0x501f('0x14')],_0x217f8d);_0x376769(_0x47c68a[_0x501f('0x13')](0x1f4,_0x493765[_0x501f('0x14')]));});});};exports['DestroyCmHopper']=function(_0x38d426){var _0x4286f7=this;return new Promise(function(_0x3092fc,_0x21c0b1){return db[_0x501f('0x6')][_0x501f('0x1e')]({'where':_0x38d426['options']?_0x38d426['options'][_0x501f('0x9')]||null:null})['then'](function(_0x250946){logger['info'](_0x501f('0x1f'),_0x38d426);logger['debug'](_0x501f('0x1f'),_0x38d426,JSON[_0x501f('0x16')](_0x250946));_0x3092fc(_0x250946);})[_0x501f('0x12')](function(_0x5a05f7){logger[_0x501f('0x13')](_0x501f('0x1f'),_0x5a05f7[_0x501f('0x14')],_0x38d426);_0x21c0b1(_0x4286f7['error'](0x1f4,_0x5a05f7[_0x501f('0x14')]));});});};exports[_0x501f('0x20')]=function(_0x262173){var _0x40cc40=this;return new Promise(function(_0x241cfd,_0x3e9528){return db['CmContact'][_0x501f('0x21')]()[_0x501f('0xf')](function(_0x3034fb){return db['sequelize']['transaction'](function(_0x4501b0){return db[_0x501f('0x6')][_0x501f('0x7')]({'where':_0x262173[_0x501f('0x8')]?_0x262173[_0x501f('0x8')][_0x501f('0x9')]||null:null,'attributes':_0x262173[_0x501f('0x8')]?_0x262173['options'][_0x501f('0xe')]||null:null,'limit':_0x262173[_0x501f('0x8')]?_0x262173[_0x501f('0x8')][_0x501f('0xa')]||null:null,'order':_0x262173[_0x501f('0x8')]?_0x262173[_0x501f('0x8')][_0x501f('0x22')]||null:null,'transaction':_0x4501b0,'lock':_0x4501b0[_0x501f('0x23')][_0x501f('0x24')],'include':[{'model':db[_0x501f('0x25')],'as':_0x501f('0x26'),'attributes':_[_0x501f('0x27')](_0x3034fb)},{'model':db[_0x501f('0x28')],'as':_0x501f('0x29'),'attributes':['id',_0x501f('0x2a'),_0x501f('0x2b')]}]})['then'](function(_0x4de394){var _0x3b95f1=[];var _0x593b0c=[];for(var _0x3854c2=0x0;_0x3854c2<_0x4de394[_0x501f('0x2c')];_0x3854c2+=0x1){var _0x21b8d5=_0x4de394[_0x3854c2][_0x501f('0x2d')];if(_0x21b8d5===null){_0x3b95f1[_0x501f('0x2e')](_0x4de394[_0x3854c2]['update'](_0x262173[_0x501f('0x19')],{'transaction':_0x4501b0}));}else if(!_0x593b0c[_0x501f('0x2f')](_0x21b8d5)){_0x593b0c[_0x501f('0x2e')](_0x21b8d5);_0x3b95f1[_0x501f('0x2e')](_0x4de394[_0x3854c2][_0x501f('0x30')](_0x262173[_0x501f('0x19')],{'transaction':_0x4501b0}));}}return BPromise[_0x501f('0x31')](_0x3b95f1);});})[_0x501f('0xf')](function(_0x2bdf5b){logger['info']('GetContactDialer',_0x262173);if(_0x2bdf5b[_0x501f('0x2c')]>0x0){logger[_0x501f('0x10')](_0x501f('0x32'),_0x2bdf5b[0x0]['dataValues']['id'],_0x2bdf5b[0x0][_0x501f('0x33')][_0x501f('0x34')],_0x2bdf5b[0x0][_0x501f('0x33')]['active']);}logger[_0x501f('0x11')]('GetContactDialer',_0x262173,JSON['stringify'](_0x2bdf5b));_0x241cfd(_0x2bdf5b);})[_0x501f('0x12')](function(_0x5951f2){logger[_0x501f('0x13')](_0x501f('0x20'),_0x5951f2[_0x501f('0x14')],_0x262173);_0x3e9528(_0x40cc40[_0x501f('0x13')](0x1f4,_0x5951f2['message']));});});});};exports['MoveContactManagedDialer']=function(_0x4719dd){var _0x2a999f=this;return new Promise(function(_0xce0cec,_0x3d1816){return db['sequelize'][_0x501f('0x35')](function(_0x32cb55){return db[_0x501f('0x36')][_0x501f('0x18')](_0x4719dd[_0x501f('0x19')],{'raw':_0x4719dd['options']?_0x4719dd[_0x501f('0x8')][_0x501f('0x1a')]===undefined?!![]:![]:!![],'transaction':_0x32cb55})[_0x501f('0xf')](function(){logger[_0x501f('0x10')](_0x501f('0x37'),JSON[_0x501f('0x16')](_0x4719dd['options'][_0x501f('0x9')]),_0x4719dd[_0x501f('0x8')][_0x501f('0x9')][_0x501f('0x1d')]);return db['CmHopper'][_0x501f('0x1e')]({'where':_0x4719dd[_0x501f('0x8')]?_0x4719dd['options'][_0x501f('0x9')]||null:null,'transaction':_0x32cb55});});})[_0x501f('0xf')](function(_0x274e74){logger['info'](_0x501f('0x38'),_0x4719dd);logger['debug'](_0x501f('0x38'),_0x4719dd,JSON[_0x501f('0x16')](_0x274e74));_0xce0cec(_0x274e74);})['catch'](function(_0xfd78f2){logger['error'](_0x501f('0x38'),_0xfd78f2[_0x501f('0x14')],_0x4719dd);_0x3d1816(_0x2a999f['error'](0x1f4,_0xfd78f2[_0x501f('0x14')]));});});};exports[_0x501f('0x39')]=function(_0x2726ce){var _0x2e9787=this;return new Promise(function(_0x5028af,_0x45782c){return db['CmHopper']['findAll']({'raw':_0x2726ce[_0x501f('0x8')]?_0x2726ce[_0x501f('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x2726ce[_0x501f('0x8')]?_0x2726ce[_0x501f('0x8')][_0x501f('0x9')]||null:null,'attributes':[[db[_0x501f('0x3a')]['fn'](_0x501f('0x3b'),db['sequelize']['fn']('IF',db['sequelize'][_0x501f('0x3c')](_0x501f('0x3d')+util[_0x501f('0x3e')]('\x22%s\x22',moment()[_0x501f('0x3e')](_0x501f('0x3f')))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})[_0x501f('0xf')](function(_0x4cb6ce){logger[_0x501f('0x10')](_0x501f('0x39'),_0x2726ce);logger[_0x501f('0x11')]('CountReScheduled',_0x2726ce,JSON[_0x501f('0x16')](_0x4cb6ce));_0x5028af(_0x4cb6ce);})[_0x501f('0x12')](function(_0x18b0b4){logger[_0x501f('0x13')](_0x501f('0x39'),_0x18b0b4[_0x501f('0x14')],_0x2726ce);_0x45782c(_0x2e9787[_0x501f('0x13')](0x1f4,_0x18b0b4[_0x501f('0x14')]));});});};exports['GetContactRecallMe']=function(_0x5bf5f4){var _0x9a70a5=this;return new Promise(function(_0x53982c,_0x38d923){return db[_0x501f('0x25')][_0x501f('0x21')]()[_0x501f('0xf')](function(){return db[_0x501f('0x3a')]['transaction'](function(_0xcd9cdb){return db[_0x501f('0x6')][_0x501f('0x7')]({'where':_0x5bf5f4[_0x501f('0x8')]?_0x5bf5f4[_0x501f('0x8')][_0x501f('0x9')]||null:null,'attributes':_0x5bf5f4[_0x501f('0x8')]?_0x5bf5f4[_0x501f('0x8')][_0x501f('0xe')]||null:null,'limit':0x1,'order':_0x5bf5f4[_0x501f('0x8')]?_0x5bf5f4[_0x501f('0x8')][_0x501f('0x22')]||null:null,'group':db[_0x501f('0x6')][_0x501f('0x2d')],'transaction':_0xcd9cdb,'lock':_0xcd9cdb[_0x501f('0x23')][_0x501f('0x24')],'include':_0x5bf5f4[_0x501f('0x8')]?_0x5bf5f4[_0x501f('0x8')][_0x501f('0xb')]?_[_0x501f('0xc')](_0x5bf5f4['options'][_0x501f('0xb')],function(_0x11a01e){return{'model':db[_0x11a01e[_0x501f('0xd')]],'as':_0x11a01e['as'],'attributes':_0x11a01e[_0x501f('0xe')],'include':_0x11a01e[_0x501f('0xb')]?_[_0x501f('0xc')](_0x11a01e[_0x501f('0xb')],function(_0x3110bc){return{'model':db[_0x3110bc[_0x501f('0xd')]],'as':_0x3110bc['as'],'attributes':_0x3110bc['attributes'],'include':_0x3110bc[_0x501f('0xb')]?_['map'](_0x3110bc[_0x501f('0xb')],function(_0x4b7a5b){return{'model':db[_0x4b7a5b[_0x501f('0xd')]],'as':_0x4b7a5b['as'],'attributes':_0x4b7a5b[_0x501f('0xe')]};}):[]};}):[]};}):[]:[]})[_0x501f('0xf')](function(_0x127edf){var _0xc8adc4=[];for(var _0x3cf058=0x0;_0x3cf058<_0x127edf['length'];_0x3cf058+=0x1){_0xc8adc4[_0x501f('0x2e')](_0x127edf[_0x3cf058][_0x501f('0x30')](_0x5bf5f4[_0x501f('0x19')],{'transaction':_0xcd9cdb}));}return BPromise[_0x501f('0x31')](_0xc8adc4);});})[_0x501f('0xf')](function(_0x42cb36){logger[_0x501f('0x10')](_0x501f('0x40'),_0x5bf5f4);logger[_0x501f('0x11')](_0x501f('0x40'),_0x5bf5f4,JSON[_0x501f('0x16')](_0x42cb36));_0x53982c(_0x42cb36);})[_0x501f('0x12')](function(_0x36e961){logger['error'](_0x501f('0x40'),_0x36e961[_0x501f('0x14')],_0x5bf5f4);_0x38d923(_0x9a70a5[_0x501f('0x13')](0x1f4,_0x36e961['message']));});});});};exports['GetCmHopperPreview']=function(_0x53ba7f){var _0x355584=this;return new Promise(function(_0x2a9a2e,_0x3a87aa){db[_0x501f('0x25')][_0x501f('0x21')]()[_0x501f('0xf')](function(_0x295e12){return db[_0x501f('0x6')][_0x501f('0x7')]({'raw':_0x53ba7f[_0x501f('0x8')]?_0x53ba7f[_0x501f('0x8')][_0x501f('0x1a')]===undefined?!![]:![]:!![],'where':_0x53ba7f['options']?_0x53ba7f['options']['where']||null:null,'attributes':_0x53ba7f[_0x501f('0x8')]?_0x53ba7f[_0x501f('0x8')]['attributes']||null:null,'limit':_0x53ba7f[_0x501f('0x8')]?_0x53ba7f[_0x501f('0x8')]['limit']||null:null,'include':_0x53ba7f[_0x501f('0x8')]?_0x53ba7f[_0x501f('0x8')]['include']?_[_0x501f('0xc')](_0x53ba7f['options'][_0x501f('0xb')],function(_0xe5dbc){return{'model':db[_0xe5dbc[_0x501f('0xd')]],'as':_0xe5dbc['as'],'attributes':_0xe5dbc['as']===_0x501f('0x26')?_[_0x501f('0x27')](_0x295e12):_0xe5dbc[_0x501f('0xe')],'include':_0xe5dbc[_0x501f('0xb')]?_[_0x501f('0xc')](_0xe5dbc[_0x501f('0xb')],function(_0x2e107a){return{'model':db[_0x2e107a[_0x501f('0xd')]],'as':_0x2e107a['as'],'attributes':_0x2e107a[_0x501f('0xe')],'include':_0x2e107a[_0x501f('0xb')]?_[_0x501f('0xc')](_0x2e107a[_0x501f('0xb')],function(_0x1e1934){return{'model':db[_0x1e1934[_0x501f('0xd')]],'as':_0x1e1934['as'],'attributes':_0x1e1934['attributes']};}):[]};}):[]};}):[]:[]})[_0x501f('0xf')](function(_0x11b452){logger[_0x501f('0x10')](_0x501f('0x5'),_0x53ba7f);logger['debug'](_0x501f('0x5'),_0x53ba7f,JSON[_0x501f('0x16')](_0x11b452));_0x2a9a2e(_0x11b452);})['catch'](function(_0x2d13d7){logger[_0x501f('0x13')]('GetCmHopper',_0x2d13d7['message'],_0x53ba7f);_0x3a87aa(_0x355584[_0x501f('0x13')](0x1f4,_0x2d13d7[_0x501f('0x14')]));});});});};exports['GetContactByPhone']=function(_0x352d9c){var _0x315b84=this;return new Promise(function(_0x5d5a62,_0xd51e1d){return db['CmContact'][_0x501f('0x41')]({'raw':!![],'where':{'phone':_0x352d9c['options'][_0x501f('0x9')][_0x501f('0x42')]},'attributes':['id',_0x501f('0x43')],'order':[['id','DESC']]})[_0x501f('0xf')](function(_0x7b2a9f){logger['info'](_0x501f('0x44'),_0x352d9c);logger[_0x501f('0x11')](_0x501f('0x44'),_0x352d9c,JSON['stringify'](_0x7b2a9f));_0x5d5a62(_0x7b2a9f);})[_0x501f('0x12')](function(_0x368d3e){logger[_0x501f('0x13')](_0x501f('0x44'),_0x368d3e[_0x501f('0x14')],_0x352d9c);_0xd51e1d(_0x315b84['error'](0x1f4,_0x368d3e[_0x501f('0x14')]));});});};exports[_0x501f('0x45')]=function(_0x83bd0f){var _0x26b3f5=this;return new Promise(function(_0x4b7ccf,_0x5822a7){return db['sequelize'][_0x501f('0x35')](function(_0x52a6ce){var _0x30ceea=_0x83bd0f[_0x501f('0x8')]&&_0x83bd0f[_0x501f('0x8')][_0x501f('0x9')]?_0x83bd0f[_0x501f('0x8')]['where']:{};return db[_0x501f('0x6')][_0x501f('0x30')](_0x83bd0f[_0x501f('0x19')],{'where':_0x30ceea,'transaction':_0x52a6ce})['then'](function(_0x200cb4){logger[_0x501f('0x10')](_0x501f('0x45'),_0x83bd0f);logger['debug'](_0x501f('0x45'),_0x83bd0f,JSON[_0x501f('0x16')](_0x200cb4));_0x4b7ccf(_0x200cb4);})[_0x501f('0x12')](function(_0x3c50b4){logger['error'](_0x501f('0x45'),_0x3c50b4[_0x501f('0x14')],_0x83bd0f);_0x5822a7(_0x26b3f5[_0x501f('0x13')](0x1f4,_0x3c50b4[_0x501f('0x14')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x3142b3){var _0x25c511=this;var _0x401d70=_0x3142b3[_0x501f('0x19')]['where']['voiceQueueIds'];var _0x3845c3=_0x3142b3[_0x501f('0x19')]['where'][_0x501f('0x46')];var _0xdc92ac=_0x3142b3[_0x501f('0x19')]['where'][_0x501f('0x47')];return new Promise(function(_0x41c62a,_0x40b766){return db['CmHopper']['findAll']({'where':{'voiceQueueId':{'$in':_0x401d70},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x501f('0x3a')][_0x501f('0x3c')](_0x501f('0x48')+_0x3845c3+_0x501f('0x49')),'$gt':db[_0x501f('0x3a')][_0x501f('0x3c')](_0x501f('0x4a'))}},'UserId':{'$in':_0xdc92ac}},'include':[{'model':db[_0x501f('0x25')],'as':'Contact'},{'model':db[_0x501f('0x28')],'as':_0x501f('0x29'),'attributes':['id',_0x501f('0x2a'),'voicePause']},{'model':db[_0x501f('0x4b')],'as':_0x501f('0x4c')}]})[_0x501f('0xf')](function(_0x5b16f4){if(_0x5b16f4[_0x501f('0x2c')]>0x0){return db['sequelize']['transaction'](function(_0x2eb86f){return db['CmHopper'][_0x501f('0x30')]({'recallmeNotifiedDate':db[_0x501f('0x3a')]['literal'](_0x501f('0x4a'))},{'where':{'id':{'$in':_['map'](_0x5b16f4,'id')}},'transaction':_0x2eb86f})[_0x501f('0xf')](function(){_0x41c62a(_0x5b16f4);})['catch'](function(_0x2b2f4){logger['error']('CmHopperHandlePreviewRecallNotifications',_0x2b2f4[_0x501f('0x14')],_0x3142b3);_0x40b766(_0x25c511['error'](0x1f4,_0x2b2f4[_0x501f('0x14')]));});})[_0x501f('0x12')](function(_0x147641){logger[_0x501f('0x13')]('CmHopperHandlePreviewRecallNotifications',_0x147641[_0x501f('0x14')],_0x3142b3);_0x40b766(_0x25c511[_0x501f('0x13')](0x1f4,_0x147641['message']));});}else{_0x41c62a(_0x5b16f4);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index c1a46f4..4f4db80 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 _0x3c02=['Router','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','getTimezones','show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','/timezone','getTimezone','/:id','update','delete','destroy','exports'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0x3c02,0x159));var _0x23c0=function(_0x39385c,_0x540ea6){_0x39385c=_0x39385c-0x0;var _0x392094=_0x3c02[_0x39385c];return _0x392094;};'use strict';var express=require('express');var router=express[_0x23c0('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x23c0('0x1'));router[_0x23c0('0x2')]('/',auth[_0x23c0('0x3')](),controller[_0x23c0('0x4')]);router[_0x23c0('0x2')](_0x23c0('0x5'),auth[_0x23c0('0x3')](),controller[_0x23c0('0x6')]);router['get'](_0x23c0('0x7'),auth['isAuthenticated'](),controller['getOpenContacts']);router['get']('/timezones',auth['isAuthenticated'](),controller[_0x23c0('0x8')]);router[_0x23c0('0x2')]('/:id',auth[_0x23c0('0x3')](),controller[_0x23c0('0x9')]);router[_0x23c0('0x2')](_0x23c0('0xa'),auth['isAuthenticated'](),controller[_0x23c0('0xb')]);router[_0x23c0('0xc')]('/',auth[_0x23c0('0x3')](),controller[_0x23c0('0xd')]);router['post'](_0x23c0('0xe'),auth[_0x23c0('0x3')](),controller[_0x23c0('0xf')]);router[_0x23c0('0xc')](_0x23c0('0x10'),auth[_0x23c0('0x3')](),controller[_0x23c0('0x11')]);router['put'](_0x23c0('0x12'),auth['isAuthenticated'](),controller[_0x23c0('0x13')]);router[_0x23c0('0x14')](_0x23c0('0x12'),auth[_0x23c0('0x3')](),controller[_0x23c0('0x15')]);module[_0x23c0('0x16')]=router; \ No newline at end of file +var _0x62a1=['update','delete','destroy','exports','express','../../components/auth/service','get','isAuthenticated','index','describe','/timezones','/:id','show','getPreviewRecall','post','create','/preview','/timezone','getTimezone'];(function(_0x355fd4,_0x224a5f){var _0x242b66=function(_0x8ebd40){while(--_0x8ebd40){_0x355fd4['push'](_0x355fd4['shift']());}};_0x242b66(++_0x224a5f);}(_0x62a1,0x16d));var _0x162a=function(_0x540807,_0x1f3367){_0x540807=_0x540807-0x0;var _0xa3c6dc=_0x62a1[_0x540807];return _0xa3c6dc;};'use strict';var express=require(_0x162a('0x0'));var router=express['Router']();var auth=require(_0x162a('0x1'));var controller=require('./cmHopper.controller');router[_0x162a('0x2')]('/',auth[_0x162a('0x3')](),controller[_0x162a('0x4')]);router[_0x162a('0x2')]('/describe',auth[_0x162a('0x3')](),controller[_0x162a('0x5')]);router[_0x162a('0x2')]('/opencontacts',auth[_0x162a('0x3')](),controller['getOpenContacts']);router[_0x162a('0x2')](_0x162a('0x6'),auth[_0x162a('0x3')](),controller['getTimezones']);router['get'](_0x162a('0x7'),auth[_0x162a('0x3')](),controller[_0x162a('0x8')]);router[_0x162a('0x2')]('/:id/previewrecall',auth[_0x162a('0x3')](),controller[_0x162a('0x9')]);router[_0x162a('0xa')]('/',auth[_0x162a('0x3')](),controller[_0x162a('0xb')]);router[_0x162a('0xa')](_0x162a('0xc'),auth[_0x162a('0x3')](),controller['getPreview']);router[_0x162a('0xa')](_0x162a('0xd'),auth[_0x162a('0x3')](),controller[_0x162a('0xe')]);router['put']('/:id',auth[_0x162a('0x3')](),controller[_0x162a('0xf')]);router[_0x162a('0x10')]('/:id',auth[_0x162a('0x3')](),controller[_0x162a('0x11')]);module[_0x162a('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 1d281e7..6a7130f 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1df4=['YYYY-MM-DD\x20HH:mm:ss','moment','STRING','INTEGER','format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1df4,0x191));var _0x41df=function(_0x246959,_0x3790dd){_0x246959=_0x246959-0x0;var _0x2f850f=_0x1df4[_0x246959];return _0x2f850f;};'use strict';var moment=require(_0x41df('0x0'));var Sequelize=require('sequelize');module['exports']={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x41df('0x1')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x41df('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x41df('0x3')](_0x41df('0x4'))},'countbusyretry':{'type':Sequelize[_0x41df('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x41df('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x41df('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x41df('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x41df('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x41df('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x41df('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x79fc=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','INTEGER'];(function(_0x5531cb,_0x2c4a43){var _0x3a1983=function(_0x57b03c){while(--_0x57b03c){_0x5531cb['push'](_0x5531cb['shift']());}};_0x3a1983(++_0x2c4a43);}(_0x79fc,0xc3));var _0xc79f=function(_0x532412,_0x1b8cce){_0x532412=_0x532412-0x0;var _0x55da2c=_0x79fc[_0x532412];return _0x55da2c;};'use strict';var moment=require(_0xc79f('0x0'));var Sequelize=require(_0xc79f('0x1'));module['exports']={'CmHopperId':{'type':Sequelize[_0xc79f('0x2')]},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xc79f('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xc79f('0x3')],'defaultValue':moment()[_0xc79f('0x4')](_0xc79f('0x5'))},'countbusyretry':{'type':Sequelize[_0xc79f('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc79f('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xc79f('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc79f('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc79f('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc79f('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index 90ee8de..18d9fc0 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1dda=['filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','destroy','get','CmHopperAdditionalPhones','error','stack','name','index','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','map','query'];(function(_0x5f2619,_0xb112e){var _0x13c357=function(_0x3a7ef2){while(--_0x3a7ef2){_0x5f2619['push'](_0x5f2619['shift']());}};_0x13c357(++_0xb112e);}(_0x1dda,0x15a));var _0xa1dd=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x1dda[_0x3c4737];return _0x2bb926;};'use strict';var emlformat=require(_0xa1dd('0x0'));var rimraf=require(_0xa1dd('0x1'));var zipdir=require(_0xa1dd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa1dd('0x3'));var moment=require(_0xa1dd('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa1dd('0x5'));var path=require(_0xa1dd('0x6'));var sox=require(_0xa1dd('0x7'));var csv=require(_0xa1dd('0x8'));var ejs=require(_0xa1dd('0x9'));var fs=require('fs');var fs_extra=require(_0xa1dd('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa1dd('0xb'));var jsforce=require(_0xa1dd('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa1dd('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa1dd('0xd'));var authService=require(_0xa1dd('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa1dd('0xf'));var logger=require(_0xa1dd('0x10'))('api');var utils=require(_0xa1dd('0x11'));var config=require(_0xa1dd('0x12'));var licenseUtil=require(_0xa1dd('0x13'));var db=require(_0xa1dd('0x14'))['db'];function respondWithStatusCode(_0x3b21a1,_0x5a3579){_0x5a3579=_0x5a3579||0xcc;return function(_0x4d37b4){if(_0x4d37b4){return _0x3b21a1[_0xa1dd('0x15')](_0x5a3579);}return _0x3b21a1['status'](_0x5a3579)[_0xa1dd('0x16')]();};}function respondWithResult(_0x4ba5e6,_0x2cbdc4){_0x2cbdc4=_0x2cbdc4||0xc8;return function(_0x4a46e4){if(_0x4a46e4){return _0x4ba5e6[_0xa1dd('0x17')](_0x2cbdc4)['json'](_0x4a46e4);}};}function respondWithFilteredResult(_0x464281,_0x57a858){return function(_0x4cff77){if(_0x4cff77){var _0xe6e13e=typeof _0x57a858[_0xa1dd('0x18')]===_0xa1dd('0x19')&&typeof _0x57a858[_0xa1dd('0x1a')]==='undefined';var _0x5736ea=_0x4cff77[_0xa1dd('0x1b')];var _0x2a2854=_0xe6e13e?0x0:_0x57a858[_0xa1dd('0x18')];var _0x311770=_0xe6e13e?_0x4cff77[_0xa1dd('0x1b')]:_0x57a858[_0xa1dd('0x18')]+_0x57a858['limit'];var _0x950e52;if(_0x311770>=_0x5736ea){_0x311770=_0x5736ea;_0x950e52=0xc8;}else{_0x950e52=0xce;}_0x464281[_0xa1dd('0x17')](_0x950e52);return _0x464281['set'](_0xa1dd('0x1c'),_0x2a2854+'-'+_0x311770+'/'+_0x5736ea)[_0xa1dd('0x1d')](_0x4cff77);}return null;};}function patchUpdates(_0x91eba4){return function(_0x471708){try{jsonpatch['apply'](_0x471708,_0x91eba4,!![]);}catch(_0x1f3ba5){return BPromise[_0xa1dd('0x1e')](_0x1f3ba5);}return _0x471708[_0xa1dd('0x1f')]();};}function saveUpdates(_0x4d5903,_0x369f5b){return function(_0x5b1aa8){if(_0x5b1aa8){return _0x5b1aa8[_0xa1dd('0x20')](_0x4d5903)[_0xa1dd('0x21')](function(_0xbacee4){return _0xbacee4;});}return null;};}function removeEntity(_0xa22127,_0x1d5cc2){return function(_0x48c80f){if(_0x48c80f){return _0x48c80f[_0xa1dd('0x22')]()[_0xa1dd('0x21')](function(){var _0x4faf5f=_0x48c80f[_0xa1dd('0x23')]({'plain':!![]});var _0x5019e4=_0xa1dd('0x24');return db['UserProfileResource'][_0xa1dd('0x22')]({'where':{'type':_0x5019e4,'resourceId':_0x4faf5f['id']}})[_0xa1dd('0x21')](function(){return _0x48c80f;});})[_0xa1dd('0x21')](function(){_0xa22127[_0xa1dd('0x17')](0xcc)[_0xa1dd('0x16')]();});}};}function handleEntityNotFound(_0x506627,_0x468d9d){return function(_0x55e88a){if(!_0x55e88a){_0x506627['sendStatus'](0x194);}return _0x55e88a;};}function handleError(_0x5910d2,_0xf7d17f){_0xf7d17f=_0xf7d17f||0x1f4;return function(_0x10ffb8){logger[_0xa1dd('0x25')](_0x10ffb8[_0xa1dd('0x26')]);if(_0x10ffb8[_0xa1dd('0x27')]){delete _0x10ffb8[_0xa1dd('0x27')];}_0x5910d2['status'](_0xf7d17f)['send'](_0x10ffb8);};}exports[_0xa1dd('0x28')]=function(_0x77284c,_0x378d76){var _0x3f768c={},_0x27273a={},_0x5b07f={'count':0x0,'rows':[]};var _0x5c429a=_['map'](db[_0xa1dd('0x29')][_0xa1dd('0x2a')],function(_0x151cb9){return{'name':_0x151cb9[_0xa1dd('0x2b')],'type':_0x151cb9[_0xa1dd('0x2c')][_0xa1dd('0x2d')]};});_0x27273a[_0xa1dd('0x2e')]=_[_0xa1dd('0x2f')](_0x5c429a,_0xa1dd('0x27'));_0x27273a[_0xa1dd('0x30')]=_['keys'](_0x77284c['query']);_0x27273a[_0xa1dd('0x31')]=_[_0xa1dd('0x32')](_0x27273a[_0xa1dd('0x2e')],_0x27273a[_0xa1dd('0x30')]);_0x3f768c[_0xa1dd('0x33')]=_[_0xa1dd('0x32')](_0x27273a[_0xa1dd('0x2e')],qs[_0xa1dd('0x34')](_0x77284c[_0xa1dd('0x30')][_0xa1dd('0x34')]));_0x3f768c[_0xa1dd('0x33')]=_0x3f768c[_0xa1dd('0x33')]['length']?_0x3f768c[_0xa1dd('0x33')]:_0x27273a[_0xa1dd('0x2e')];if(!_0x77284c[_0xa1dd('0x30')][_0xa1dd('0x35')](_0xa1dd('0x36'))){_0x3f768c[_0xa1dd('0x1a')]=qs[_0xa1dd('0x1a')](_0x77284c[_0xa1dd('0x30')][_0xa1dd('0x1a')]);_0x3f768c[_0xa1dd('0x18')]=qs[_0xa1dd('0x18')](_0x77284c['query']['offset']);}_0x3f768c[_0xa1dd('0x37')]=qs[_0xa1dd('0x38')](_0x77284c[_0xa1dd('0x30')][_0xa1dd('0x38')]);_0x3f768c[_0xa1dd('0x39')]=qs[_0xa1dd('0x31')](_[_0xa1dd('0x3a')](_0x77284c[_0xa1dd('0x30')],_0x27273a['filters']),_0x5c429a);if(_0x77284c[_0xa1dd('0x30')][_0xa1dd('0x3b')]){_0x3f768c[_0xa1dd('0x39')]=_[_0xa1dd('0x3c')](_0x3f768c['where'],{'$or':_[_0xa1dd('0x2f')](_0x5c429a,function(_0x39a506){if(_0x39a506['type']!==_0xa1dd('0x3d')){var _0x3000c6={};_0x3000c6[_0x39a506[_0xa1dd('0x27')]]={'$like':'%'+_0x77284c['query'][_0xa1dd('0x3b')]+'%'};return _0x3000c6;}})});}_0x3f768c=_[_0xa1dd('0x3c')]({},_0x3f768c,_0x77284c[_0xa1dd('0x3e')]);var _0x42050f={'where':_0x3f768c['where']};return db[_0xa1dd('0x29')]['count'](_0x42050f)[_0xa1dd('0x21')](function(_0x38b79d){_0x5b07f['count']=_0x38b79d;if(_0x77284c[_0xa1dd('0x30')][_0xa1dd('0x3f')]){_0x3f768c[_0xa1dd('0x40')]=[{'all':!![]}];}return db[_0xa1dd('0x29')][_0xa1dd('0x41')](_0x3f768c);})[_0xa1dd('0x21')](function(_0xbcd7f3){_0x5b07f['rows']=_0xbcd7f3;return _0x5b07f;})['then'](respondWithFilteredResult(_0x378d76,_0x3f768c))[_0xa1dd('0x42')](handleError(_0x378d76,null));};exports[_0xa1dd('0x43')]=function(_0x3776e4,_0x53be1e){var _0x26ea31={'raw':!![],'where':{'id':_0x3776e4[_0xa1dd('0x44')]['id']}},_0x4b8ef7={};_0x4b8ef7[_0xa1dd('0x2e')]=_['keys'](db[_0xa1dd('0x29')][_0xa1dd('0x2a')]);_0x4b8ef7[_0xa1dd('0x30')]=_['keys'](_0x3776e4['query']);_0x4b8ef7['filters']=_[_0xa1dd('0x32')](_0x4b8ef7[_0xa1dd('0x2e')],_0x4b8ef7[_0xa1dd('0x30')]);_0x26ea31[_0xa1dd('0x33')]=_['intersection'](_0x4b8ef7[_0xa1dd('0x2e')],qs[_0xa1dd('0x34')](_0x3776e4[_0xa1dd('0x30')]['fields']));_0x26ea31[_0xa1dd('0x33')]=_0x26ea31[_0xa1dd('0x33')]['length']?_0x26ea31['attributes']:_0x4b8ef7['model'];if(_0x3776e4['query']['includeAll']){_0x26ea31[_0xa1dd('0x40')]=[{'all':!![]}];}_0x26ea31=_[_0xa1dd('0x3c')]({},_0x26ea31,_0x3776e4['options']);return db[_0xa1dd('0x29')][_0xa1dd('0x45')](_0x26ea31)[_0xa1dd('0x21')](handleEntityNotFound(_0x53be1e,null))['then'](respondWithResult(_0x53be1e,null))[_0xa1dd('0x42')](handleError(_0x53be1e,null));};exports[_0xa1dd('0x46')]=function(_0x26879d,_0x57c16c){return db['CmHopperAdditionalPhone'][_0xa1dd('0x46')](_0x26879d[_0xa1dd('0x47')],{})[_0xa1dd('0x21')](function(_0x24c850){var _0x41c0c4=_0x26879d['user'][_0xa1dd('0x23')]({'plain':!![]});if(!_0x41c0c4)throw new Error(_0xa1dd('0x48'));if(_0x41c0c4[_0xa1dd('0x49')]===_0xa1dd('0x4a')){var _0x4374ee=_0x24c850[_0xa1dd('0x23')]({'plain':!![]});var _0x56734c='CmHopperAdditionalPhones';return db['UserProfileSection'][_0xa1dd('0x45')]({'where':{'name':_0x56734c,'userProfileId':_0x41c0c4[_0xa1dd('0x4b')]},'raw':!![]})['then'](function(_0x416ad8){if(_0x416ad8&&_0x416ad8[_0xa1dd('0x4c')]===0x0){return db[_0xa1dd('0x4d')][_0xa1dd('0x46')]({'name':_0x4374ee[_0xa1dd('0x27')],'resourceId':_0x4374ee['id'],'type':_0x416ad8[_0xa1dd('0x27')],'sectionId':_0x416ad8['id']},{})[_0xa1dd('0x21')](function(){return _0x24c850;});}else{return _0x24c850;}})[_0xa1dd('0x42')](function(_0x74ca93){logger[_0xa1dd('0x25')](_0xa1dd('0x4e'),_0x74ca93);throw _0x74ca93;});}return _0x24c850;})[_0xa1dd('0x21')](respondWithResult(_0x57c16c,0xc9))[_0xa1dd('0x42')](handleError(_0x57c16c,null));};exports[_0xa1dd('0x20')]=function(_0x2177ca,_0x4d6587){if(_0x2177ca['body']['id']){delete _0x2177ca[_0xa1dd('0x47')]['id'];}return db[_0xa1dd('0x29')][_0xa1dd('0x45')]({'where':{'id':_0x2177ca[_0xa1dd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d6587,null))[_0xa1dd('0x21')](saveUpdates(_0x2177ca[_0xa1dd('0x47')],null))['then'](respondWithResult(_0x4d6587,null))[_0xa1dd('0x42')](handleError(_0x4d6587,null));};exports[_0xa1dd('0x22')]=function(_0x3aace0,_0x14e8e0){return db[_0xa1dd('0x29')]['find']({'where':{'id':_0x3aace0[_0xa1dd('0x44')]['id']}})['then'](handleEntityNotFound(_0x14e8e0,null))[_0xa1dd('0x21')](removeEntity(_0x14e8e0,null))['catch'](handleError(_0x14e8e0,null));}; \ No newline at end of file +var _0x720e=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','stack','name','send','index','map','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','CmHopperAdditionalPhone','includeAll','include','rows','catch','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x12e6e5,_0x39855b){var _0x4ef6ce=function(_0x3e06f3){while(--_0x3e06f3){_0x12e6e5['push'](_0x12e6e5['shift']());}};_0x4ef6ce(++_0x39855b);}(_0x720e,0x190));var _0xe720=function(_0x548d7d,_0x2d41fc){_0x548d7d=_0x548d7d-0x0;var _0xb1c878=_0x720e[_0x548d7d];return _0xb1c878;};'use strict';var emlformat=require(_0xe720('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe720('0x1'));var jsonpatch=require(_0xe720('0x2'));var rp=require('request-promise');var moment=require(_0xe720('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe720('0x4'));var util=require(_0xe720('0x5'));var path=require(_0xe720('0x6'));var sox=require(_0xe720('0x7'));var csv=require(_0xe720('0x8'));var ejs=require(_0xe720('0x9'));var fs=require('fs');var fs_extra=require(_0xe720('0xa'));var _=require('lodash');var squel=require(_0xe720('0xb'));var crypto=require(_0xe720('0xc'));var jsforce=require(_0xe720('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe720('0xe'));var Papa=require(_0xe720('0xf'));var Redis=require(_0xe720('0x10'));var authService=require(_0xe720('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe720('0x12'));var hardwareService=require(_0xe720('0x13'));var logger=require(_0xe720('0x14'))(_0xe720('0x15'));var utils=require(_0xe720('0x16'));var config=require(_0xe720('0x17'));var licenseUtil=require(_0xe720('0x18'));var db=require(_0xe720('0x19'))['db'];function respondWithStatusCode(_0x23f5c7,_0x42c529){_0x42c529=_0x42c529||0xcc;return function(_0x21622c){if(_0x21622c){return _0x23f5c7[_0xe720('0x1a')](_0x42c529);}return _0x23f5c7['status'](_0x42c529)[_0xe720('0x1b')]();};}function respondWithResult(_0x3ec407,_0x378040){_0x378040=_0x378040||0xc8;return function(_0x3410e9){if(_0x3410e9){return _0x3ec407[_0xe720('0x1c')](_0x378040)[_0xe720('0x1d')](_0x3410e9);}};}function respondWithFilteredResult(_0x30d41c,_0x7ee42){return function(_0xc04c23){if(_0xc04c23){var _0x16f35a=typeof _0x7ee42[_0xe720('0x1e')]===_0xe720('0x1f')&&typeof _0x7ee42[_0xe720('0x20')]==='undefined';var _0xd41296=_0xc04c23[_0xe720('0x21')];var _0x514e2b=_0x16f35a?0x0:_0x7ee42[_0xe720('0x1e')];var _0x5b6369=_0x16f35a?_0xc04c23[_0xe720('0x21')]:_0x7ee42['offset']+_0x7ee42[_0xe720('0x20')];var _0x2ac6bd;if(_0x5b6369>=_0xd41296){_0x5b6369=_0xd41296;_0x2ac6bd=0xc8;}else{_0x2ac6bd=0xce;}_0x30d41c['status'](_0x2ac6bd);return _0x30d41c[_0xe720('0x22')](_0xe720('0x23'),_0x514e2b+'-'+_0x5b6369+'/'+_0xd41296)[_0xe720('0x1d')](_0xc04c23);}return null;};}function patchUpdates(_0x512eff){return function(_0x1c1eab){try{jsonpatch[_0xe720('0x24')](_0x1c1eab,_0x512eff,!![]);}catch(_0x83a29f){return BPromise[_0xe720('0x25')](_0x83a29f);}return _0x1c1eab[_0xe720('0x26')]();};}function saveUpdates(_0x275e5c,_0x252648){return function(_0xdc5441){if(_0xdc5441){return _0xdc5441[_0xe720('0x27')](_0x275e5c)[_0xe720('0x28')](function(_0x3b4d02){return _0x3b4d02;});}return null;};}function removeEntity(_0x3b9e22,_0x331653){return function(_0x130fb1){if(_0x130fb1){return _0x130fb1[_0xe720('0x29')]()[_0xe720('0x28')](function(){var _0x466371=_0x130fb1[_0xe720('0x2a')]({'plain':!![]});var _0x5b43a0=_0xe720('0x2b');return db[_0xe720('0x2c')][_0xe720('0x29')]({'where':{'type':_0x5b43a0,'resourceId':_0x466371['id']}})[_0xe720('0x28')](function(){return _0x130fb1;});})[_0xe720('0x28')](function(){_0x3b9e22['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a15ca,_0x3bcffc){return function(_0x18a29d){if(!_0x18a29d){_0x5a15ca[_0xe720('0x1a')](0x194);}return _0x18a29d;};}function handleError(_0x3f392b,_0x191853){_0x191853=_0x191853||0x1f4;return function(_0x217710){logger['error'](_0x217710[_0xe720('0x2d')]);if(_0x217710['name']){delete _0x217710[_0xe720('0x2e')];}_0x3f392b[_0xe720('0x1c')](_0x191853)[_0xe720('0x2f')](_0x217710);};}exports[_0xe720('0x30')]=function(_0x1031e5,_0x16f736){var _0x14c766={},_0x4c68a2={},_0x3bd409={'count':0x0,'rows':[]};var _0x5daffc=_[_0xe720('0x31')](db['CmHopperAdditionalPhone']['rawAttributes'],function(_0x4cc074){return{'name':_0x4cc074['fieldName'],'type':_0x4cc074[_0xe720('0x32')][_0xe720('0x33')]};});_0x4c68a2['model']=_[_0xe720('0x31')](_0x5daffc,_0xe720('0x2e'));_0x4c68a2['query']=_[_0xe720('0x34')](_0x1031e5[_0xe720('0x35')]);_0x4c68a2['filters']=_[_0xe720('0x36')](_0x4c68a2[_0xe720('0x37')],_0x4c68a2[_0xe720('0x35')]);_0x14c766[_0xe720('0x38')]=_['intersection'](_0x4c68a2[_0xe720('0x37')],qs[_0xe720('0x39')](_0x1031e5[_0xe720('0x35')][_0xe720('0x39')]));_0x14c766[_0xe720('0x38')]=_0x14c766[_0xe720('0x38')][_0xe720('0x3a')]?_0x14c766[_0xe720('0x38')]:_0x4c68a2['model'];if(!_0x1031e5['query'][_0xe720('0x3b')](_0xe720('0x3c'))){_0x14c766['limit']=qs[_0xe720('0x20')](_0x1031e5[_0xe720('0x35')][_0xe720('0x20')]);_0x14c766[_0xe720('0x1e')]=qs['offset'](_0x1031e5['query'][_0xe720('0x1e')]);}_0x14c766[_0xe720('0x3d')]=qs[_0xe720('0x3e')](_0x1031e5[_0xe720('0x35')][_0xe720('0x3e')]);_0x14c766[_0xe720('0x3f')]=qs['filters'](_[_0xe720('0x40')](_0x1031e5[_0xe720('0x35')],_0x4c68a2['filters']),_0x5daffc);if(_0x1031e5['query'][_0xe720('0x41')]){_0x14c766[_0xe720('0x3f')]=_[_0xe720('0x42')](_0x14c766[_0xe720('0x3f')],{'$or':_[_0xe720('0x31')](_0x5daffc,function(_0x1ba612){if(_0x1ba612[_0xe720('0x32')]!=='VIRTUAL'){var _0x5027a2={};_0x5027a2[_0x1ba612[_0xe720('0x2e')]]={'$like':'%'+_0x1031e5[_0xe720('0x35')][_0xe720('0x41')]+'%'};return _0x5027a2;}})});}_0x14c766=_[_0xe720('0x42')]({},_0x14c766,_0x1031e5[_0xe720('0x43')]);var _0x313afc={'where':_0x14c766[_0xe720('0x3f')]};return db[_0xe720('0x44')]['count'](_0x313afc)['then'](function(_0x3faf12){_0x3bd409[_0xe720('0x21')]=_0x3faf12;if(_0x1031e5['query'][_0xe720('0x45')]){_0x14c766[_0xe720('0x46')]=[{'all':!![]}];}return db['CmHopperAdditionalPhone']['findAll'](_0x14c766);})[_0xe720('0x28')](function(_0x49a50d){_0x3bd409[_0xe720('0x47')]=_0x49a50d;return _0x3bd409;})[_0xe720('0x28')](respondWithFilteredResult(_0x16f736,_0x14c766))[_0xe720('0x48')](handleError(_0x16f736,null));};exports['show']=function(_0x4694f5,_0x4e5920){var _0x35ed20={'raw':!![],'where':{'id':_0x4694f5[_0xe720('0x49')]['id']}},_0x540523={};_0x540523['model']=_[_0xe720('0x34')](db['CmHopperAdditionalPhone'][_0xe720('0x4a')]);_0x540523['query']=_[_0xe720('0x34')](_0x4694f5['query']);_0x540523['filters']=_[_0xe720('0x36')](_0x540523[_0xe720('0x37')],_0x540523[_0xe720('0x35')]);_0x35ed20[_0xe720('0x38')]=_[_0xe720('0x36')](_0x540523[_0xe720('0x37')],qs['fields'](_0x4694f5['query'][_0xe720('0x39')]));_0x35ed20[_0xe720('0x38')]=_0x35ed20[_0xe720('0x38')][_0xe720('0x3a')]?_0x35ed20[_0xe720('0x38')]:_0x540523['model'];if(_0x4694f5['query'][_0xe720('0x45')]){_0x35ed20[_0xe720('0x46')]=[{'all':!![]}];}_0x35ed20=_[_0xe720('0x42')]({},_0x35ed20,_0x4694f5['options']);return db[_0xe720('0x44')][_0xe720('0x4b')](_0x35ed20)['then'](handleEntityNotFound(_0x4e5920,null))['then'](respondWithResult(_0x4e5920,null))[_0xe720('0x48')](handleError(_0x4e5920,null));};exports[_0xe720('0x4c')]=function(_0x343273,_0x294dc6){return db[_0xe720('0x44')][_0xe720('0x4c')](_0x343273[_0xe720('0x4d')],{})[_0xe720('0x28')](function(_0x5e3c76){var _0x30ac11=_0x343273[_0xe720('0x4e')]['get']({'plain':!![]});if(!_0x30ac11)throw new Error(_0xe720('0x4f'));if(_0x30ac11[_0xe720('0x50')]===_0xe720('0x4e')){var _0x582dda=_0x5e3c76[_0xe720('0x2a')]({'plain':!![]});var _0x5cdd63=_0xe720('0x2b');return db['UserProfileSection'][_0xe720('0x4b')]({'where':{'name':_0x5cdd63,'userProfileId':_0x30ac11[_0xe720('0x51')]},'raw':!![]})[_0xe720('0x28')](function(_0x3e12){if(_0x3e12&&_0x3e12[_0xe720('0x52')]===0x0){return db[_0xe720('0x2c')]['create']({'name':_0x582dda[_0xe720('0x2e')],'resourceId':_0x582dda['id'],'type':_0x3e12[_0xe720('0x2e')],'sectionId':_0x3e12['id']},{})[_0xe720('0x28')](function(){return _0x5e3c76;});}else{return _0x5e3c76;}})[_0xe720('0x48')](function(_0x1d3bae){logger[_0xe720('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1d3bae);throw _0x1d3bae;});}return _0x5e3c76;})['then'](respondWithResult(_0x294dc6,0xc9))['catch'](handleError(_0x294dc6,null));};exports['update']=function(_0x4f99e7,_0x39a45b){if(_0x4f99e7[_0xe720('0x4d')]['id']){delete _0x4f99e7['body']['id'];}return db[_0xe720('0x44')]['find']({'where':{'id':_0x4f99e7[_0xe720('0x49')]['id']}})[_0xe720('0x28')](handleEntityNotFound(_0x39a45b,null))[_0xe720('0x28')](saveUpdates(_0x4f99e7[_0xe720('0x4d')],null))[_0xe720('0x28')](respondWithResult(_0x39a45b,null))[_0xe720('0x48')](handleError(_0x39a45b,null));};exports[_0xe720('0x29')]=function(_0x5f372a,_0x2460e6){return db['CmHopperAdditionalPhone'][_0xe720('0x4b')]({'where':{'id':_0x5f372a[_0xe720('0x49')]['id']}})[_0xe720('0x28')](handleEntityNotFound(_0x2460e6,null))[_0xe720('0x28')](removeEntity(_0x2460e6,null))[_0xe720('0x48')](handleError(_0x2460e6,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 9effb9b..a8c35a9 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3768=['rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','util','api','moment','bluebird','request-promise','path'];(function(_0x55ff3e,_0x41077f){var _0x2709eb=function(_0x45563a){while(--_0x45563a){_0x55ff3e['push'](_0x55ff3e['shift']());}};_0x2709eb(++_0x41077f);}(_0x3768,0x10e));var _0x8376=function(_0x1d930e,_0x20d8b8){_0x1d930e=_0x1d930e-0x0;var _0x5bbd66=_0x3768[_0x1d930e];return _0x5bbd66;};'use strict';var _=require('lodash');var util=require(_0x8376('0x0'));var logger=require('../../config/logger')(_0x8376('0x1'));var moment=require(_0x8376('0x2'));var BPromise=require(_0x8376('0x3'));var rp=require(_0x8376('0x4'));var fs=require('fs');var path=require(_0x8376('0x5'));var rimraf=require(_0x8376('0x6'));var config=require(_0x8376('0x7'));var attributes=require(_0x8376('0x8'));module[_0x8376('0x9')]=function(_0xe47048,_0x5b778c){return _0xe47048[_0x8376('0xa')](_0x8376('0xb'),attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x42ee=['cm_hopper_additional_phones','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x23da44,_0x32da04){var _0x73e158=function(_0x3a1fb4){while(--_0x3a1fb4){_0x23da44['push'](_0x23da44['shift']());}};_0x73e158(++_0x32da04);}(_0x42ee,0x172));var _0xe42e=function(_0x4f5108,_0x46a54b){_0x4f5108=_0x4f5108-0x0;var _0x2d56ca=_0x42ee[_0x4f5108];return _0x2d56ca;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe42e('0x0'))(_0xe42e('0x1'));var moment=require(_0xe42e('0x2'));var BPromise=require('bluebird');var rp=require(_0xe42e('0x3'));var fs=require('fs');var path=require(_0xe42e('0x4'));var rimraf=require(_0xe42e('0x5'));var config=require(_0xe42e('0x6'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0xe42e('0x7')]=function(_0x4e9d8d,_0x26a667){return _0x4e9d8d['define']('CmHopperAdditionalPhone',attributes,{'tableName':_0xe42e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index 01f9a07..ade1575 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbcb3=['CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countmachineretry','entity','dialGlobalMaxRetry','countnoanswerretry','countabandonedretry','countagentrejectretry','catch','VerifyAdditionalPhones','SwapAdditionalPhones','CmHopper','duration','waitTime','isNil','scheduledat','add','minutes','phone','createdAt','sequelize','transaction','update','activateAdditionalPhone','field','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','then'];(function(_0x4de5bf,_0x1ef9a6){var _0x377021=function(_0x57e72f){while(--_0x57e72f){_0x4de5bf['push'](_0x4de5bf['shift']());}};_0x377021(++_0x1ef9a6);}(_0xbcb3,0x17a));var _0x3bcb=function(_0x1696a8,_0x23a370){_0x1696a8=_0x1696a8-0x0;var _0x2c36b5=_0xbcb3[_0x1696a8];return _0x2c36b5;};'use strict';var _=require(_0x3bcb('0x0'));var util=require(_0x3bcb('0x1'));var moment=require('moment');var BPromise=require(_0x3bcb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3bcb('0x3'));var db=require(_0x3bcb('0x4'))['db'];var utils=require(_0x3bcb('0x5'));var logger=require(_0x3bcb('0x6'))(_0x3bcb('0x7'));var config=require(_0x3bcb('0x8'));var jayson=require(_0x3bcb('0x9'));var client=jayson[_0x3bcb('0xa')][_0x3bcb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f57b7,_0x1fd9c8,_0x1f34b9){return new BPromise(function(_0x2c50b1,_0x272cf1){return client[_0x3bcb('0xc')](_0x4f57b7,_0x1f34b9)['then'](function(_0x493404){logger['info'](_0x3bcb('0xd'),_0x1fd9c8,_0x3bcb('0xe'));logger[_0x3bcb('0xf')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x1fd9c8,_0x3bcb('0xe'),JSON[_0x3bcb('0x10')](_0x493404));if(_0x493404[_0x3bcb('0x11')]){if(_0x493404[_0x3bcb('0x11')][_0x3bcb('0x12')]===0x1f4){logger[_0x3bcb('0x11')](_0x3bcb('0xd'),_0x1fd9c8,_0x493404['error']['message']);return _0x272cf1(_0x493404[_0x3bcb('0x11')][_0x3bcb('0x13')]);}logger[_0x3bcb('0x11')](_0x3bcb('0xd'),_0x1fd9c8,_0x493404['error'][_0x3bcb('0x13')]);return _0x2c50b1(_0x493404[_0x3bcb('0x11')]['message']);}else{logger[_0x3bcb('0x14')](_0x3bcb('0xd'),_0x1fd9c8,_0x3bcb('0xe'));_0x2c50b1(_0x493404['result'][_0x3bcb('0x13')]);}})['catch'](function(_0x21478c){logger[_0x3bcb('0x11')](_0x3bcb('0xd'),_0x1fd9c8,_0x21478c);_0x272cf1(_0x21478c);});});}exports['VerifyAdditionalPhones']=function(_0x40b604){var _0x1b28fc=this;return new Promise(function(_0x500446,_0xf577aa){return db['CmHopper'][_0x3bcb('0x15')]({'raw':!![],'where':{'ContactId':_0x40b604[_0x3bcb('0x16')][_0x3bcb('0x17')],'ListId':_0x40b604[_0x3bcb('0x16')][_0x3bcb('0x18')],'VoiceQueueId':_0x40b604[_0x3bcb('0x16')][_0x3bcb('0x19')]===undefined?null:_0x40b604[_0x3bcb('0x16')]['VoiceQueueId'],'CampaignId':_0x40b604[_0x3bcb('0x16')][_0x3bcb('0x1a')]===undefined?null:_0x40b604[_0x3bcb('0x16')][_0x3bcb('0x1a')]}})[_0x3bcb('0x1b')](function(_0x58a8f2){if(_0x58a8f2!=null){return db[_0x3bcb('0x1c')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x58a8f2['id'],'OrderBy':{'$gt':_0x58a8f2['OrderBy']}},'order':[[_0x3bcb('0x1d'),_0x3bcb('0x1e')]]})[_0x3bcb('0x1b')](function(_0x172f9b){var _0x3457a5=0x0;if(_0x172f9b){if(_0x172f9b[_0x3bcb('0x1f')]+_0x172f9b[_0x3bcb('0x20')]+_0x172f9b['countnoanswerretry']+_0x172f9b[_0x3bcb('0x21')]+_0x172f9b[_0x3bcb('0x22')]+_0x172f9b['countabandonedretry']+_0x172f9b[_0x3bcb('0x23')]+_0x172f9b['countagentrejectretry']<_0x40b604[_0x3bcb('0x24')][_0x3bcb('0x25')])_0x3457a5=0x1;_0x500446({'additional':_0x3457a5});}else{return db[_0x3bcb('0x1c')][_0x3bcb('0x15')]({'raw':!![],'where':{'CmHopperId':_0x58a8f2['id']},'order':[['OrderBy',_0x3bcb('0x1e')]]})[_0x3bcb('0x1b')](function(_0x5a1d09){var _0x46378a=0x0;if(_0x5a1d09){if(_0x5a1d09[_0x3bcb('0x1f')]+_0x5a1d09['countcongestionretry']+_0x5a1d09[_0x3bcb('0x26')]+_0x5a1d09[_0x3bcb('0x21')]+_0x5a1d09[_0x3bcb('0x22')]+_0x5a1d09[_0x3bcb('0x27')]+_0x5a1d09[_0x3bcb('0x23')]+_0x5a1d09[_0x3bcb('0x28')]<_0x40b604['entity']['dialGlobalMaxRetry'])_0x46378a=0x1;_0x500446({'additional':_0x46378a});}else{_0x500446({'additional':0x0});}})[_0x3bcb('0x29')](function(_0x286bb3){logger[_0x3bcb('0x11')](_0x3bcb('0x2a'),_0x286bb3[_0x3bcb('0x13')]);_0xf577aa(_0x1b28fc[_0x3bcb('0x11')](0x1f4,_0x286bb3['message']));});}})[_0x3bcb('0x29')](function(_0x2de613){logger[_0x3bcb('0x11')](_0x3bcb('0x2a'),_0x2de613[_0x3bcb('0x13')]);_0xf577aa(_0x1b28fc[_0x3bcb('0x11')](0x1f4,_0x2de613[_0x3bcb('0x13')]));});}else _0x500446({'additional':0x0});});});};exports[_0x3bcb('0x2b')]=function(_0x104dc5){var _0x5a32fc=this;return new Promise(function(_0x29fd18,_0x35489b){return db[_0x3bcb('0x2c')][_0x3bcb('0x15')]({'raw':!![],'where':{'ContactId':_0x104dc5[_0x3bcb('0x16')][_0x3bcb('0x17')],'ListId':_0x104dc5[_0x3bcb('0x16')][_0x3bcb('0x18')],'VoiceQueueId':_0x104dc5[_0x3bcb('0x16')][_0x3bcb('0x19')]===undefined?null:_0x104dc5[_0x3bcb('0x16')][_0x3bcb('0x19')],'CampaignId':_0x104dc5[_0x3bcb('0x16')][_0x3bcb('0x1a')]===undefined?null:_0x104dc5[_0x3bcb('0x16')]['CampaignId']}})[_0x3bcb('0x1b')](function(_0xa243a){if(_0xa243a!=null){return db['CmHopperAdditionalPhone'][_0x3bcb('0x15')]({'raw':!![],'where':{'CmHopperId':_0xa243a['id'],'OrderBy':{'$gte':_0xa243a[_0x3bcb('0x1d')]}},'order':[[_0x3bcb('0x1d'),_0x3bcb('0x1e')]]})[_0x3bcb('0x1b')](function(_0x3c6e16){if(_0x3c6e16)return activateAdditionalPhone(_0xa243a,_0x104dc5[_0x3bcb('0x16')],_0x3c6e16,_0x104dc5[_0x3bcb('0x2d')],_0x104dc5['waitTime'])[_0x3bcb('0x1b')](function(_0x4deee0){_0x29fd18(_0x4deee0);});else{return db[_0x3bcb('0x1c')][_0x3bcb('0x15')]({'raw':!![],'where':{'CmHopperId':_0xa243a['id']},'order':[[_0x3bcb('0x1d'),_0x3bcb('0x1e')]]})[_0x3bcb('0x1b')](function(_0x5e3c3b){if(_0x5e3c3b)return activateAdditionalPhone(_0xa243a,_0x104dc5[_0x3bcb('0x16')],_0x5e3c3b,_0x104dc5['duration'],_0x104dc5[_0x3bcb('0x2e')])[_0x3bcb('0x1b')](function(_0x57bf64){_0x29fd18(_0x57bf64);});else{_0x29fd18({'id':_0xa243a['id'],'phone':''});}})[_0x3bcb('0x29')](function(_0x5d8508){logger[_0x3bcb('0x11')]('VerifyAdditionalPhones',_0x5d8508['message']);_0x35489b(_0x5a32fc[_0x3bcb('0x11')](0x1f4,_0x5d8508[_0x3bcb('0x13')]));});}})[_0x3bcb('0x29')](function(_0x45ff7d){logger[_0x3bcb('0x11')]('VerifyAdditionalPhones',_0x45ff7d['message']);_0x35489b(_0x5a32fc[_0x3bcb('0x11')](0x1f4,_0x45ff7d[_0x3bcb('0x13')]));});}else _0x29fd18(0x1);});});};function activateAdditionalPhone(_0x4f604b,_0x57c921,_0x31464a,_0x8fc6f7,_0x3c3ea3){return new Promise(function(_0xcbe7ed,_0x230a7d){var _0x1dfe21;if(_[_0x3bcb('0x2f')](_0x31464a['scheduledat'])){_0x31464a[_0x3bcb('0x30')]=moment();}if(moment()>moment(_0x31464a[_0x3bcb('0x30')])){_0x1dfe21=moment()[_0x3bcb('0x31')](_0x3c3ea3||0x3,_0x3bcb('0x32'));}else{if(_0x31464a[_0x3bcb('0x1d')]==0x0){_0x1dfe21=moment(_0x31464a[_0x3bcb('0x30')]);}else{_0x1dfe21=moment()[_0x3bcb('0x31')](_0x3c3ea3||0x3,_0x3bcb('0x32'));}}if(_[_0x3bcb('0x2f')](_0x1dfe21)){_0x1dfe21=moment()[_0x3bcb('0x31')](_0x3c3ea3||0x3,'minutes');}var _0x52693d={'phone':_0x4f604b[_0x3bcb('0x33')],'active':0x0,'OrderBy':_[_0x3bcb('0x2f')](_0x4f604b[_0x3bcb('0x1d')])?0x0:_0x4f604b[_0x3bcb('0x1d')],'scheduledat':moment()['add'](_0x8fc6f7||0x1,_0x3bcb('0x32')),'countbusyretry':_0x57c921[_0x3bcb('0x1f')],'countcongestionretry':_0x57c921[_0x3bcb('0x20')],'countnoanswerretry':_0x57c921['countnoanswerretry'],'countnosuchnumberretry':_0x57c921[_0x3bcb('0x21')],'countdropretry':_0x57c921[_0x3bcb('0x22')],'countabandonedretry':_0x57c921[_0x3bcb('0x27')],'countmachineretry':_0x57c921[_0x3bcb('0x23')],'countagentrejectretry':_0x57c921[_0x3bcb('0x28')],'createdAt':_0x57c921[_0x3bcb('0x34')],'updatedAt':_0x57c921['updatedAt']};var _0x5026f6={'CmHopperId':_0x4f604b['id'],'phone':_0x31464a['phone'],'active':0x0,'OrderBy':_[_0x3bcb('0x2f')](_0x31464a['OrderBy'])?0x0:_0x31464a[_0x3bcb('0x1d')],'scheduledat':_0x1dfe21,'countbusyretry':_0x31464a[_0x3bcb('0x1f')],'countcongestionretry':_0x31464a[_0x3bcb('0x20')],'countnoanswerretry':_0x31464a[_0x3bcb('0x26')],'countnosuchnumberretry':_0x31464a[_0x3bcb('0x21')],'countdropretry':_0x31464a[_0x3bcb('0x22')],'countabandonedretry':_0x31464a[_0x3bcb('0x27')],'countmachineretry':_0x31464a['countmachineretry'],'countagentrejectretry':_0x31464a[_0x3bcb('0x28')],'createdAt':_0x31464a[_0x3bcb('0x34')],'updatedAt':_0x31464a['updatedAt']};return db[_0x3bcb('0x35')][_0x3bcb('0x36')](function(_0x4f5bae){return db[_0x3bcb('0x1c')][_0x3bcb('0x37')](_0x52693d,{'where':{'id':_0x31464a['id']}},{'transaction':_0x4f5bae})[_0x3bcb('0x1b')](function(){return db[_0x3bcb('0x2c')][_0x3bcb('0x37')](_0x5026f6,{'where':{'id':_0x4f604b['id']}},{'transaction':_0x4f5bae});});})['then'](function(_0x545e91){_0xcbe7ed({'id':_0x4f604b['id'],'phone':_0x31464a[_0x3bcb('0x33')]});})[_0x3bcb('0x29')](function(_0x55a1ca){logger['error'](_0x3bcb('0x38'),_0x55a1ca['message']);_0x230a7d({'error':_0x55a1ca[_0x3bcb('0x13')]});});});}exports['IncrementPreviewCounters']=function(_0x57b343){var _0xe4e35b=this;return new Promise(function(_0x5b7142,_0x3d8434){return db[_0x3bcb('0x2c')][_0x3bcb('0x37')](_0x57b343['body'][_0x3bcb('0x39')],{'where':{'id':_0x57b343[_0x3bcb('0x16')]['id']}})[_0x3bcb('0x1b')](function(_0x383267){_0x5b7142(_0x383267);})['catch'](function(_0x48ac52){logger[_0x3bcb('0x11')]('IncrementPreviewCounters',_0x48ac52[_0x3bcb('0x13')]);_0x3d8434(_0xe4e35b[_0x3bcb('0x11')](0x1f4,_0x48ac52['message']));});});}; \ No newline at end of file +var _0x6626=['request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countcongestionretry','countdropretry','countabandonedretry','countmachineretry','dialGlobalMaxRetry','countnoanswerretry','countnosuchnumberretry','entity','SwapAdditionalPhones','ListId','duration','waitTime','isNil','scheduledat','add','minutes','phone','countagentrejectretry','updatedAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x208e61,_0x13ea46){var _0x38870b=function(_0x3fc7ce){while(--_0x3fc7ce){_0x208e61['push'](_0x208e61['shift']());}};_0x38870b(++_0x13ea46);}(_0x6626,0x67));var _0x6662=function(_0x1d8b67,_0x1beaf7){_0x1d8b67=_0x1d8b67-0x0;var _0x2bb45f=_0x6626[_0x1d8b67];return _0x2bb45f;};'use strict';var _=require(_0x6662('0x0'));var util=require(_0x6662('0x1'));var moment=require(_0x6662('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6662('0x3'));var db=require(_0x6662('0x4'))['db'];var utils=require(_0x6662('0x5'));var logger=require(_0x6662('0x6'))(_0x6662('0x7'));var config=require(_0x6662('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x422ef4,_0x101540,_0x4da4cc){return new BPromise(function(_0xc9b97d,_0x6b0f62){return client[_0x6662('0x9')](_0x422ef4,_0x4da4cc)[_0x6662('0xa')](function(_0x23ad2e){logger[_0x6662('0xb')](_0x6662('0xc'),_0x101540,'request\x20sent');logger[_0x6662('0xd')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x101540,_0x6662('0xe'),JSON[_0x6662('0xf')](_0x23ad2e));if(_0x23ad2e[_0x6662('0x10')]){if(_0x23ad2e[_0x6662('0x10')][_0x6662('0x11')]===0x1f4){logger[_0x6662('0x10')](_0x6662('0xc'),_0x101540,_0x23ad2e[_0x6662('0x10')][_0x6662('0x12')]);return _0x6b0f62(_0x23ad2e[_0x6662('0x10')][_0x6662('0x12')]);}logger[_0x6662('0x10')](_0x6662('0xc'),_0x101540,_0x23ad2e[_0x6662('0x10')][_0x6662('0x12')]);return _0xc9b97d(_0x23ad2e[_0x6662('0x10')][_0x6662('0x12')]);}else{logger['info'](_0x6662('0xc'),_0x101540,_0x6662('0xe'));_0xc9b97d(_0x23ad2e[_0x6662('0x13')][_0x6662('0x12')]);}})[_0x6662('0x14')](function(_0x2e6a35){logger['error'](_0x6662('0xc'),_0x101540,_0x2e6a35);_0x6b0f62(_0x2e6a35);});});}exports[_0x6662('0x15')]=function(_0x53fb04){var _0x388ede=this;return new Promise(function(_0x343324,_0x229721){return db[_0x6662('0x16')][_0x6662('0x17')]({'raw':!![],'where':{'ContactId':_0x53fb04[_0x6662('0x18')][_0x6662('0x19')],'ListId':_0x53fb04[_0x6662('0x18')]['ListId'],'VoiceQueueId':_0x53fb04['body'][_0x6662('0x1a')]===undefined?null:_0x53fb04[_0x6662('0x18')][_0x6662('0x1a')],'CampaignId':_0x53fb04[_0x6662('0x18')][_0x6662('0x1b')]===undefined?null:_0x53fb04[_0x6662('0x18')]['CampaignId']}})['then'](function(_0x1f1d61){if(_0x1f1d61!=null){return db[_0x6662('0x1c')][_0x6662('0x17')]({'raw':!![],'where':{'CmHopperId':_0x1f1d61['id'],'OrderBy':{'$gt':_0x1f1d61['OrderBy']}},'order':[[_0x6662('0x1d'),_0x6662('0x1e')]]})[_0x6662('0xa')](function(_0xb9c9ff){var _0x2b474c=0x0;if(_0xb9c9ff){if(_0xb9c9ff[_0x6662('0x1f')]+_0xb9c9ff[_0x6662('0x20')]+_0xb9c9ff['countnoanswerretry']+_0xb9c9ff['countnosuchnumberretry']+_0xb9c9ff[_0x6662('0x21')]+_0xb9c9ff[_0x6662('0x22')]+_0xb9c9ff[_0x6662('0x23')]+_0xb9c9ff['countagentrejectretry']<_0x53fb04['entity'][_0x6662('0x24')])_0x2b474c=0x1;_0x343324({'additional':_0x2b474c});}else{return db[_0x6662('0x1c')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x1f1d61['id']},'order':[['OrderBy',_0x6662('0x1e')]]})[_0x6662('0xa')](function(_0x4beecf){var _0x35c2=0x0;if(_0x4beecf){if(_0x4beecf[_0x6662('0x1f')]+_0x4beecf['countcongestionretry']+_0x4beecf[_0x6662('0x25')]+_0x4beecf[_0x6662('0x26')]+_0x4beecf[_0x6662('0x21')]+_0x4beecf[_0x6662('0x22')]+_0x4beecf[_0x6662('0x23')]+_0x4beecf['countagentrejectretry']<_0x53fb04[_0x6662('0x27')][_0x6662('0x24')])_0x35c2=0x1;_0x343324({'additional':_0x35c2});}else{_0x343324({'additional':0x0});}})[_0x6662('0x14')](function(_0x1cda87){logger[_0x6662('0x10')](_0x6662('0x15'),_0x1cda87[_0x6662('0x12')]);_0x229721(_0x388ede[_0x6662('0x10')](0x1f4,_0x1cda87[_0x6662('0x12')]));});}})['catch'](function(_0x541076){logger[_0x6662('0x10')]('VerifyAdditionalPhones',_0x541076[_0x6662('0x12')]);_0x229721(_0x388ede[_0x6662('0x10')](0x1f4,_0x541076['message']));});}else _0x343324({'additional':0x0});});});};exports[_0x6662('0x28')]=function(_0x120d00){var _0x35891a=this;return new Promise(function(_0x4e0727,_0x186c63){return db[_0x6662('0x16')][_0x6662('0x17')]({'raw':!![],'where':{'ContactId':_0x120d00[_0x6662('0x18')][_0x6662('0x19')],'ListId':_0x120d00['body'][_0x6662('0x29')],'VoiceQueueId':_0x120d00[_0x6662('0x18')][_0x6662('0x1a')]===undefined?null:_0x120d00[_0x6662('0x18')][_0x6662('0x1a')],'CampaignId':_0x120d00['body'][_0x6662('0x1b')]===undefined?null:_0x120d00[_0x6662('0x18')][_0x6662('0x1b')]}})[_0x6662('0xa')](function(_0x2aa6f2){if(_0x2aa6f2!=null){return db[_0x6662('0x1c')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x2aa6f2['id'],'OrderBy':{'$gte':_0x2aa6f2[_0x6662('0x1d')]}},'order':[[_0x6662('0x1d'),_0x6662('0x1e')]]})[_0x6662('0xa')](function(_0x4f40e2){if(_0x4f40e2)return activateAdditionalPhone(_0x2aa6f2,_0x120d00[_0x6662('0x18')],_0x4f40e2,_0x120d00[_0x6662('0x2a')],_0x120d00[_0x6662('0x2b')])[_0x6662('0xa')](function(_0x57ae1a){_0x4e0727(_0x57ae1a);});else{return db[_0x6662('0x1c')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x2aa6f2['id']},'order':[['OrderBy','ASC']]})['then'](function(_0x2ef8e2){if(_0x2ef8e2)return activateAdditionalPhone(_0x2aa6f2,_0x120d00[_0x6662('0x18')],_0x2ef8e2,_0x120d00[_0x6662('0x2a')],_0x120d00[_0x6662('0x2b')])[_0x6662('0xa')](function(_0x4a6452){_0x4e0727(_0x4a6452);});else{_0x4e0727({'id':_0x2aa6f2['id'],'phone':''});}})[_0x6662('0x14')](function(_0x5268f4){logger[_0x6662('0x10')]('VerifyAdditionalPhones',_0x5268f4[_0x6662('0x12')]);_0x186c63(_0x35891a[_0x6662('0x10')](0x1f4,_0x5268f4['message']));});}})[_0x6662('0x14')](function(_0x67791a){logger['error'](_0x6662('0x15'),_0x67791a['message']);_0x186c63(_0x35891a[_0x6662('0x10')](0x1f4,_0x67791a['message']));});}else _0x4e0727(0x1);});});};function activateAdditionalPhone(_0x5a48e2,_0x2ee993,_0x112fb4,_0x327172,_0xa11dbf){return new Promise(function(_0x395e36,_0x254413){var _0x33e83e;if(_[_0x6662('0x2c')](_0x112fb4[_0x6662('0x2d')])){_0x112fb4['scheduledat']=moment();}if(moment()>moment(_0x112fb4[_0x6662('0x2d')])){_0x33e83e=moment()[_0x6662('0x2e')](_0xa11dbf||0x3,_0x6662('0x2f'));}else{if(_0x112fb4[_0x6662('0x1d')]==0x0){_0x33e83e=moment(_0x112fb4[_0x6662('0x2d')]);}else{_0x33e83e=moment()[_0x6662('0x2e')](_0xa11dbf||0x3,'minutes');}}if(_[_0x6662('0x2c')](_0x33e83e)){_0x33e83e=moment()[_0x6662('0x2e')](_0xa11dbf||0x3,_0x6662('0x2f'));}var _0x25b476={'phone':_0x5a48e2[_0x6662('0x30')],'active':0x0,'OrderBy':_[_0x6662('0x2c')](_0x5a48e2[_0x6662('0x1d')])?0x0:_0x5a48e2['OrderBy'],'scheduledat':moment()[_0x6662('0x2e')](_0x327172||0x1,_0x6662('0x2f')),'countbusyretry':_0x2ee993[_0x6662('0x1f')],'countcongestionretry':_0x2ee993[_0x6662('0x20')],'countnoanswerretry':_0x2ee993[_0x6662('0x25')],'countnosuchnumberretry':_0x2ee993[_0x6662('0x26')],'countdropretry':_0x2ee993[_0x6662('0x21')],'countabandonedretry':_0x2ee993[_0x6662('0x22')],'countmachineretry':_0x2ee993[_0x6662('0x23')],'countagentrejectretry':_0x2ee993[_0x6662('0x31')],'createdAt':_0x2ee993['createdAt'],'updatedAt':_0x2ee993[_0x6662('0x32')]};var _0x292651={'CmHopperId':_0x5a48e2['id'],'phone':_0x112fb4[_0x6662('0x30')],'active':0x0,'OrderBy':_[_0x6662('0x2c')](_0x112fb4['OrderBy'])?0x0:_0x112fb4[_0x6662('0x1d')],'scheduledat':_0x33e83e,'countbusyretry':_0x112fb4[_0x6662('0x1f')],'countcongestionretry':_0x112fb4[_0x6662('0x20')],'countnoanswerretry':_0x112fb4[_0x6662('0x25')],'countnosuchnumberretry':_0x112fb4[_0x6662('0x26')],'countdropretry':_0x112fb4[_0x6662('0x21')],'countabandonedretry':_0x112fb4[_0x6662('0x22')],'countmachineretry':_0x112fb4['countmachineretry'],'countagentrejectretry':_0x112fb4[_0x6662('0x31')],'createdAt':_0x112fb4['createdAt'],'updatedAt':_0x112fb4['updatedAt']};return db[_0x6662('0x33')][_0x6662('0x34')](function(_0xe958a3){return db[_0x6662('0x1c')][_0x6662('0x35')](_0x25b476,{'where':{'id':_0x112fb4['id']}},{'transaction':_0xe958a3})[_0x6662('0xa')](function(){return db['CmHopper'][_0x6662('0x35')](_0x292651,{'where':{'id':_0x5a48e2['id']}},{'transaction':_0xe958a3});});})[_0x6662('0xa')](function(_0x33b220){_0x395e36({'id':_0x5a48e2['id'],'phone':_0x112fb4['phone']});})['catch'](function(_0x2693b8){logger[_0x6662('0x10')](_0x6662('0x36'),_0x2693b8['message']);_0x254413({'error':_0x2693b8[_0x6662('0x12')]});});});}exports[_0x6662('0x37')]=function(_0x39593d){var _0x4dbd8d=this;return new Promise(function(_0x351fc2,_0x47b40c){return db[_0x6662('0x16')][_0x6662('0x35')](_0x39593d['body']['field'],{'where':{'id':_0x39593d[_0x6662('0x18')]['id']}})[_0x6662('0xa')](function(_0x2cb4af){_0x351fc2(_0x2cb4af);})[_0x6662('0x14')](function(_0x5e17a1){logger[_0x6662('0x10')](_0x6662('0x37'),_0x5e17a1[_0x6662('0x12')]);_0x47b40c(_0x4dbd8d[_0x6662('0x10')](0x1f4,_0x5e17a1[_0x6662('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index c3e30c0..82ee0c0 100644 --- a/server/api/cmHopperAdditionalPhone/index.js +++ b/server/api/cmHopperAdditionalPhone/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ad0=['put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x490f5b,_0x5aec79){var _0x31770a=function(_0x472c6c){while(--_0x472c6c){_0x490f5b['push'](_0x490f5b['shift']());}};_0x31770a(++_0x5aec79);}(_0x8ad0,0xb7));var _0x08ad=function(_0x2d8205,_0x399799){_0x2d8205=_0x2d8205-0x0;var _0x37b857=_0x8ad0[_0x2d8205];return _0x37b857;};'use strict';var multer=require(_0x08ad('0x0'));var util=require(_0x08ad('0x1'));var path=require(_0x08ad('0x2'));var timeout=require(_0x08ad('0x3'));var express=require(_0x08ad('0x4'));var router=express[_0x08ad('0x5')]();var fs_extra=require(_0x08ad('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x08ad('0x7'));var config=require(_0x08ad('0x8'));var controller=require(_0x08ad('0x9'));router[_0x08ad('0xa')]('/',auth[_0x08ad('0xb')](),controller[_0x08ad('0xc')]);router[_0x08ad('0xa')](_0x08ad('0xd'),auth[_0x08ad('0xb')](),controller[_0x08ad('0xe')]);router[_0x08ad('0xf')]('/',auth['isAuthenticated'](),controller[_0x08ad('0x10')]);router[_0x08ad('0x11')]('/:id',auth[_0x08ad('0xb')](),controller[_0x08ad('0x12')]);router['delete']('/:id',auth[_0x08ad('0xb')](),controller[_0x08ad('0x13')]);module['exports']=router; \ No newline at end of file +var _0xe129=['../../components/auth/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','post','create','put','update','/:id','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x40bcbd,_0x5f0169){var _0x831edf=function(_0x273673){while(--_0x273673){_0x40bcbd['push'](_0x40bcbd['shift']());}};_0x831edf(++_0x5f0169);}(_0xe129,0x94));var _0x9e12=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe129[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9e12('0x0'));var util=require(_0x9e12('0x1'));var path=require('path');var timeout=require(_0x9e12('0x2'));var express=require(_0x9e12('0x3'));var router=express['Router']();var fs_extra=require(_0x9e12('0x4'));var auth=require(_0x9e12('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9e12('0x6'));var controller=require(_0x9e12('0x7'));router[_0x9e12('0x8')]('/',auth[_0x9e12('0x9')](),controller[_0x9e12('0xa')]);router[_0x9e12('0x8')]('/:id',auth[_0x9e12('0x9')](),controller['show']);router[_0x9e12('0xb')]('/',auth['isAuthenticated'](),controller[_0x9e12('0xc')]);router[_0x9e12('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x9e12('0xe')]);router['delete'](_0x9e12('0xf'),auth[_0x9e12('0x9')](),controller['destroy']);module[_0x9e12('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index fb3a4fc..61442d8 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 _0x2cd0=['INTEGER','contactListQueue','moment','sequelize'];(function(_0x168d94,_0x4f900a){var _0x2dc741=function(_0x134dd9){while(--_0x134dd9){_0x168d94['push'](_0x168d94['shift']());}};_0x2dc741(++_0x4f900a);}(_0x2cd0,0x8a));var _0x02cd=function(_0x4670cb,_0x3ed3b8){_0x4670cb=_0x4670cb-0x0;var _0x2af1e6=_0x2cd0[_0x4670cb];return _0x2af1e6;};'use strict';var moment=require(_0x02cd('0x0'));var Sequelize=require(_0x02cd('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x02cd('0x2')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x02cd('0x3')},'VoiceQueueId':{'type':Sequelize[_0x02cd('0x2')],'unique':_0x02cd('0x3')}}; \ No newline at end of file +var _0xb7ae=['STRING','INTEGER','contactListQueue','moment','sequelize','exports'];(function(_0x408ba0,_0x2ee04){var _0x1a9cf2=function(_0x5c9245){while(--_0x5c9245){_0x408ba0['push'](_0x408ba0['shift']());}};_0x1a9cf2(++_0x2ee04);}(_0xb7ae,0xf3));var _0xeb7a=function(_0x293f96,_0x219fe1){_0x293f96=_0x293f96-0x0;var _0x379324=_0xb7ae[_0x293f96];return _0x379324;};'use strict';var moment=require(_0xeb7a('0x0'));var Sequelize=require(_0xeb7a('0x1'));module[_0xeb7a('0x2')]={'phone':{'type':Sequelize[_0xeb7a('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xeb7a('0x4')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xeb7a('0x4')],'unique':_0xeb7a('0x5')},'VoiceQueueId':{'type':Sequelize[_0xeb7a('0x4')],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 62c7231..361c45f 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 _0xbcc2=['filters','pick','merge','filter','CmHopperBlack','include','rows','catch','params','includeAll','find','body','describe','eml-format','zip-dir','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','limit','order','where'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xbcc2,0x93));var _0x2bcc=function(_0x318e1c,_0x24f110){_0x318e1c=_0x318e1c-0x0;var _0x2ae65a=_0xbcc2[_0x318e1c];return _0x2ae65a;};'use strict';var emlformat=require(_0x2bcc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2bcc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2bcc('0x2'));var moment=require(_0x2bcc('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2bcc('0x4'));var path=require(_0x2bcc('0x5'));var sox=require(_0x2bcc('0x6'));var csv=require(_0x2bcc('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2bcc('0x8'));var _=require(_0x2bcc('0x9'));var squel=require(_0x2bcc('0xa'));var crypto=require(_0x2bcc('0xb'));var jsforce=require(_0x2bcc('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2bcc('0x7'));var querystring=require(_0x2bcc('0xd'));var Papa=require(_0x2bcc('0xe'));var Redis=require(_0x2bcc('0xf'));var authService=require(_0x2bcc('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2bcc('0x11'));var hardwareService=require(_0x2bcc('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x2bcc('0x13'));var config=require(_0x2bcc('0x14'));var licenseUtil=require(_0x2bcc('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x332e98,_0x5d6a02){_0x5d6a02=_0x5d6a02||0xcc;return function(_0x27d8d6){if(_0x27d8d6){return _0x332e98[_0x2bcc('0x16')](_0x5d6a02);}return _0x332e98[_0x2bcc('0x17')](_0x5d6a02)[_0x2bcc('0x18')]();};}function respondWithResult(_0x4bbef2,_0x5cbd4b){_0x5cbd4b=_0x5cbd4b||0xc8;return function(_0x159e0d){if(_0x159e0d){return _0x4bbef2[_0x2bcc('0x17')](_0x5cbd4b)['json'](_0x159e0d);}};}function respondWithFilteredResult(_0x14fef7,_0x4777e4){return function(_0x2f9054){if(_0x2f9054){var _0x11f71a=typeof _0x4777e4[_0x2bcc('0x19')]===_0x2bcc('0x1a')&&typeof _0x4777e4['limit']===_0x2bcc('0x1a');var _0x391e09=_0x2f9054[_0x2bcc('0x1b')];var _0x5f6a59=_0x11f71a?0x0:_0x4777e4[_0x2bcc('0x19')];var _0x5dc187=_0x11f71a?_0x2f9054['count']:_0x4777e4['offset']+_0x4777e4['limit'];var _0x7c40e1;if(_0x5dc187>=_0x391e09){_0x5dc187=_0x391e09;_0x7c40e1=0xc8;}else{_0x7c40e1=0xce;}_0x14fef7[_0x2bcc('0x17')](_0x7c40e1);return _0x14fef7[_0x2bcc('0x1c')]('Content-Range',_0x5f6a59+'-'+_0x5dc187+'/'+_0x391e09)[_0x2bcc('0x1d')](_0x2f9054);}return null;};}function patchUpdates(_0x30d1c7){return function(_0x9e88a6){try{jsonpatch[_0x2bcc('0x1e')](_0x9e88a6,_0x30d1c7,!![]);}catch(_0x3101fe){return BPromise[_0x2bcc('0x1f')](_0x3101fe);}return _0x9e88a6[_0x2bcc('0x20')]();};}function saveUpdates(_0x2fcbc6,_0x50c261){return function(_0x3f2386){if(_0x3f2386){return _0x3f2386[_0x2bcc('0x21')](_0x2fcbc6)[_0x2bcc('0x22')](function(_0x18d736){return _0x18d736;});}return null;};}function removeEntity(_0x5f5bec,_0x561174){return function(_0x2a0066){if(_0x2a0066){return _0x2a0066[_0x2bcc('0x23')]()[_0x2bcc('0x22')](function(){_0x5f5bec[_0x2bcc('0x17')](0xcc)[_0x2bcc('0x18')]();});}};}function handleEntityNotFound(_0x52aa9d,_0x5e8fcb){return function(_0x53242b){if(!_0x53242b){_0x52aa9d[_0x2bcc('0x16')](0x194);}return _0x53242b;};}function handleError(_0x2bc45d,_0x284c39){_0x284c39=_0x284c39||0x1f4;return function(_0x3af8ef){logger[_0x2bcc('0x24')](_0x3af8ef[_0x2bcc('0x25')]);if(_0x3af8ef[_0x2bcc('0x26')]){delete _0x3af8ef[_0x2bcc('0x26')];}_0x2bc45d[_0x2bcc('0x17')](_0x284c39)[_0x2bcc('0x27')](_0x3af8ef);};}exports['index']=function(_0x3a8d11,_0x153515){var _0x47ff39={},_0x322bba={},_0x35641f={'count':0x0,'rows':[]};var _0x307e7f=_['map'](db['CmHopperBlack']['rawAttributes'],function(_0x452443){return{'name':_0x452443['fieldName'],'type':_0x452443[_0x2bcc('0x28')][_0x2bcc('0x29')]};});_0x322bba[_0x2bcc('0x2a')]=_[_0x2bcc('0x2b')](_0x307e7f,_0x2bcc('0x26'));_0x322bba[_0x2bcc('0x2c')]=_[_0x2bcc('0x2d')](_0x3a8d11[_0x2bcc('0x2c')]);_0x322bba['filters']=_[_0x2bcc('0x2e')](_0x322bba[_0x2bcc('0x2a')],_0x322bba[_0x2bcc('0x2c')]);_0x47ff39[_0x2bcc('0x2f')]=_['intersection'](_0x322bba[_0x2bcc('0x2a')],qs[_0x2bcc('0x30')](_0x3a8d11['query'][_0x2bcc('0x30')]));_0x47ff39[_0x2bcc('0x2f')]=_0x47ff39[_0x2bcc('0x2f')][_0x2bcc('0x31')]?_0x47ff39[_0x2bcc('0x2f')]:_0x322bba[_0x2bcc('0x2a')];if(!_0x3a8d11[_0x2bcc('0x2c')]['hasOwnProperty'](_0x2bcc('0x32'))){_0x47ff39['limit']=qs[_0x2bcc('0x33')](_0x3a8d11['query'][_0x2bcc('0x33')]);_0x47ff39[_0x2bcc('0x19')]=qs[_0x2bcc('0x19')](_0x3a8d11[_0x2bcc('0x2c')][_0x2bcc('0x19')]);}_0x47ff39[_0x2bcc('0x34')]=qs['sort'](_0x3a8d11[_0x2bcc('0x2c')]['sort']);_0x47ff39[_0x2bcc('0x35')]=qs[_0x2bcc('0x36')](_[_0x2bcc('0x37')](_0x3a8d11[_0x2bcc('0x2c')],_0x322bba['filters']),_0x307e7f);if(_0x3a8d11[_0x2bcc('0x2c')]['filter']){_0x47ff39[_0x2bcc('0x35')]=_[_0x2bcc('0x38')](_0x47ff39[_0x2bcc('0x35')],{'$or':_['map'](_0x307e7f,function(_0x293412){if(_0x293412[_0x2bcc('0x28')]!=='VIRTUAL'){var _0x5042fa={};_0x5042fa[_0x293412[_0x2bcc('0x26')]]={'$like':'%'+_0x3a8d11['query'][_0x2bcc('0x39')]+'%'};return _0x5042fa;}})});}_0x47ff39=_['merge']({},_0x47ff39,_0x3a8d11['options']);var _0x24a46d={'where':_0x47ff39[_0x2bcc('0x35')]};return db[_0x2bcc('0x3a')]['count'](_0x24a46d)[_0x2bcc('0x22')](function(_0x127d63){_0x35641f[_0x2bcc('0x1b')]=_0x127d63;if(_0x3a8d11['query']['includeAll']){_0x47ff39[_0x2bcc('0x3b')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x47ff39);})[_0x2bcc('0x22')](function(_0x1b261d){_0x35641f[_0x2bcc('0x3c')]=_0x1b261d;return _0x35641f;})[_0x2bcc('0x22')](respondWithFilteredResult(_0x153515,_0x47ff39))[_0x2bcc('0x3d')](handleError(_0x153515,null));};exports['show']=function(_0x24c5b4,_0x5932a8){var _0x1fa92f={'raw':!![],'where':{'id':_0x24c5b4[_0x2bcc('0x3e')]['id']}},_0x28b078={};_0x28b078[_0x2bcc('0x2a')]=_[_0x2bcc('0x2d')](db[_0x2bcc('0x3a')]['rawAttributes']);_0x28b078[_0x2bcc('0x2c')]=_[_0x2bcc('0x2d')](_0x24c5b4['query']);_0x28b078[_0x2bcc('0x36')]=_['intersection'](_0x28b078[_0x2bcc('0x2a')],_0x28b078[_0x2bcc('0x2c')]);_0x1fa92f['attributes']=_[_0x2bcc('0x2e')](_0x28b078[_0x2bcc('0x2a')],qs[_0x2bcc('0x30')](_0x24c5b4[_0x2bcc('0x2c')][_0x2bcc('0x30')]));_0x1fa92f['attributes']=_0x1fa92f[_0x2bcc('0x2f')][_0x2bcc('0x31')]?_0x1fa92f[_0x2bcc('0x2f')]:_0x28b078['model'];if(_0x24c5b4[_0x2bcc('0x2c')][_0x2bcc('0x3f')]){_0x1fa92f['include']=[{'all':!![]}];}_0x1fa92f=_['merge']({},_0x1fa92f,_0x24c5b4['options']);return db[_0x2bcc('0x3a')][_0x2bcc('0x40')](_0x1fa92f)[_0x2bcc('0x22')](handleEntityNotFound(_0x5932a8,null))['then'](respondWithResult(_0x5932a8,null))[_0x2bcc('0x3d')](handleError(_0x5932a8,null));};exports[_0x2bcc('0x21')]=function(_0x2c3931,_0x4dc876){if(_0x2c3931[_0x2bcc('0x41')]['id']){delete _0x2c3931[_0x2bcc('0x41')]['id'];}return db['CmHopperBlack']['find']({'where':{'id':_0x2c3931[_0x2bcc('0x3e')]['id']}})[_0x2bcc('0x22')](handleEntityNotFound(_0x4dc876,null))[_0x2bcc('0x22')](saveUpdates(_0x2c3931[_0x2bcc('0x41')],null))[_0x2bcc('0x22')](respondWithResult(_0x4dc876,null))[_0x2bcc('0x3d')](handleError(_0x4dc876,null));};exports[_0x2bcc('0x23')]=function(_0x467389,_0x508427){return db[_0x2bcc('0x3a')]['find']({'where':{'id':_0x467389[_0x2bcc('0x3e')]['id']}})[_0x2bcc('0x22')](handleEntityNotFound(_0x508427,null))[_0x2bcc('0x22')](removeEntity(_0x508427,null))[_0x2bcc('0x3d')](handleError(_0x508427,null));};exports[_0x2bcc('0x42')]=function(_0x29ed7d,_0xb5e70c){return db[_0x2bcc('0x3a')][_0x2bcc('0x42')]()[_0x2bcc('0x22')](respondWithResult(_0xb5e70c,null))[_0x2bcc('0x3d')](handleError(_0xb5e70c,null));}; \ No newline at end of file +var _0x8f9f=['fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','error','stack','name','send','index','CmHopperBlack','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','options','then','include','findAll','rows','catch','params','includeAll','find','body','destroy','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x291b35,_0x26b5cb){var _0x51e56e=function(_0x44fc6e){while(--_0x44fc6e){_0x291b35['push'](_0x291b35['shift']());}};_0x51e56e(++_0x26b5cb);}(_0x8f9f,0x1be));var _0xf8f9=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x8f9f[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require(_0xf8f9('0x0'));var rimraf=require(_0xf8f9('0x1'));var zipdir=require(_0xf8f9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf8f9('0x3'));var BPromise=require(_0xf8f9('0x4'));var Mustache=require(_0xf8f9('0x5'));var util=require(_0xf8f9('0x6'));var path=require('path');var sox=require(_0xf8f9('0x7'));var csv=require(_0xf8f9('0x8'));var ejs=require(_0xf8f9('0x9'));var fs=require('fs');var fs_extra=require(_0xf8f9('0xa'));var _=require(_0xf8f9('0xb'));var squel=require(_0xf8f9('0xc'));var crypto=require(_0xf8f9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf8f9('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf8f9('0xf'));var Papa=require(_0xf8f9('0x10'));var Redis=require(_0xf8f9('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf8f9('0x12'));var hardwareService=require(_0xf8f9('0x13'));var logger=require(_0xf8f9('0x14'))(_0xf8f9('0x15'));var utils=require(_0xf8f9('0x16'));var config=require(_0xf8f9('0x17'));var licenseUtil=require(_0xf8f9('0x18'));var db=require(_0xf8f9('0x19'))['db'];function respondWithStatusCode(_0x3027a3,_0x5e0b99){_0x5e0b99=_0x5e0b99||0xcc;return function(_0x331a91){if(_0x331a91){return _0x3027a3[_0xf8f9('0x1a')](_0x5e0b99);}return _0x3027a3['status'](_0x5e0b99)[_0xf8f9('0x1b')]();};}function respondWithResult(_0x5420c8,_0x416c4a){_0x416c4a=_0x416c4a||0xc8;return function(_0x3ccaf4){if(_0x3ccaf4){return _0x5420c8[_0xf8f9('0x1c')](_0x416c4a)[_0xf8f9('0x1d')](_0x3ccaf4);}};}function respondWithFilteredResult(_0x2506b9,_0x563040){return function(_0x4373cb){if(_0x4373cb){var _0x614ccc=typeof _0x563040['offset']===_0xf8f9('0x1e')&&typeof _0x563040[_0xf8f9('0x1f')]===_0xf8f9('0x1e');var _0x42c6da=_0x4373cb[_0xf8f9('0x20')];var _0x84b397=_0x614ccc?0x0:_0x563040[_0xf8f9('0x21')];var _0xa76755=_0x614ccc?_0x4373cb['count']:_0x563040[_0xf8f9('0x21')]+_0x563040[_0xf8f9('0x1f')];var _0x54b3b1;if(_0xa76755>=_0x42c6da){_0xa76755=_0x42c6da;_0x54b3b1=0xc8;}else{_0x54b3b1=0xce;}_0x2506b9[_0xf8f9('0x1c')](_0x54b3b1);return _0x2506b9['set'](_0xf8f9('0x22'),_0x84b397+'-'+_0xa76755+'/'+_0x42c6da)[_0xf8f9('0x1d')](_0x4373cb);}return null;};}function patchUpdates(_0x2cc627){return function(_0x3e2093){try{jsonpatch[_0xf8f9('0x23')](_0x3e2093,_0x2cc627,!![]);}catch(_0x383079){return BPromise[_0xf8f9('0x24')](_0x383079);}return _0x3e2093[_0xf8f9('0x25')]();};}function saveUpdates(_0x1390a9,_0x81cb13){return function(_0x2725da){if(_0x2725da){return _0x2725da[_0xf8f9('0x26')](_0x1390a9)['then'](function(_0x22ff8c){return _0x22ff8c;});}return null;};}function removeEntity(_0x1eeaeb,_0x472eb0){return function(_0x16538e){if(_0x16538e){return _0x16538e['destroy']()['then'](function(){_0x1eeaeb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5798df,_0x34f37b){return function(_0x58dd93){if(!_0x58dd93){_0x5798df[_0xf8f9('0x1a')](0x194);}return _0x58dd93;};}function handleError(_0x1d1dcb,_0x1c0dce){_0x1c0dce=_0x1c0dce||0x1f4;return function(_0x7756eb){logger[_0xf8f9('0x27')](_0x7756eb[_0xf8f9('0x28')]);if(_0x7756eb[_0xf8f9('0x29')]){delete _0x7756eb[_0xf8f9('0x29')];}_0x1d1dcb['status'](_0x1c0dce)[_0xf8f9('0x2a')](_0x7756eb);};}exports[_0xf8f9('0x2b')]=function(_0x4d56bb,_0x2318fe){var _0x145208={},_0x8af9e7={},_0x293381={'count':0x0,'rows':[]};var _0x3d9ff0=_['map'](db[_0xf8f9('0x2c')][_0xf8f9('0x2d')],function(_0x1725af){return{'name':_0x1725af['fieldName'],'type':_0x1725af['type'][_0xf8f9('0x2e')]};});_0x8af9e7[_0xf8f9('0x2f')]=_['map'](_0x3d9ff0,_0xf8f9('0x29'));_0x8af9e7[_0xf8f9('0x30')]=_[_0xf8f9('0x31')](_0x4d56bb['query']);_0x8af9e7['filters']=_[_0xf8f9('0x32')](_0x8af9e7['model'],_0x8af9e7['query']);_0x145208[_0xf8f9('0x33')]=_[_0xf8f9('0x32')](_0x8af9e7[_0xf8f9('0x2f')],qs[_0xf8f9('0x34')](_0x4d56bb[_0xf8f9('0x30')]['fields']));_0x145208['attributes']=_0x145208[_0xf8f9('0x33')][_0xf8f9('0x35')]?_0x145208[_0xf8f9('0x33')]:_0x8af9e7[_0xf8f9('0x2f')];if(!_0x4d56bb[_0xf8f9('0x30')][_0xf8f9('0x36')](_0xf8f9('0x37'))){_0x145208[_0xf8f9('0x1f')]=qs[_0xf8f9('0x1f')](_0x4d56bb[_0xf8f9('0x30')][_0xf8f9('0x1f')]);_0x145208[_0xf8f9('0x21')]=qs['offset'](_0x4d56bb[_0xf8f9('0x30')]['offset']);}_0x145208[_0xf8f9('0x38')]=qs[_0xf8f9('0x39')](_0x4d56bb[_0xf8f9('0x30')][_0xf8f9('0x39')]);_0x145208[_0xf8f9('0x3a')]=qs[_0xf8f9('0x3b')](_[_0xf8f9('0x3c')](_0x4d56bb['query'],_0x8af9e7[_0xf8f9('0x3b')]),_0x3d9ff0);if(_0x4d56bb[_0xf8f9('0x30')][_0xf8f9('0x3d')]){_0x145208['where']=_[_0xf8f9('0x3e')](_0x145208['where'],{'$or':_['map'](_0x3d9ff0,function(_0x317402){if(_0x317402[_0xf8f9('0x3f')]!=='VIRTUAL'){var _0x1e05e8={};_0x1e05e8[_0x317402[_0xf8f9('0x29')]]={'$like':'%'+_0x4d56bb[_0xf8f9('0x30')]['filter']+'%'};return _0x1e05e8;}})});}_0x145208=_[_0xf8f9('0x3e')]({},_0x145208,_0x4d56bb[_0xf8f9('0x40')]);var _0x396b83={'where':_0x145208['where']};return db[_0xf8f9('0x2c')][_0xf8f9('0x20')](_0x396b83)[_0xf8f9('0x41')](function(_0x15b87e){_0x293381[_0xf8f9('0x20')]=_0x15b87e;if(_0x4d56bb['query']['includeAll']){_0x145208[_0xf8f9('0x42')]=[{'all':!![]}];}return db[_0xf8f9('0x2c')][_0xf8f9('0x43')](_0x145208);})[_0xf8f9('0x41')](function(_0x2b67ba){_0x293381[_0xf8f9('0x44')]=_0x2b67ba;return _0x293381;})['then'](respondWithFilteredResult(_0x2318fe,_0x145208))[_0xf8f9('0x45')](handleError(_0x2318fe,null));};exports['show']=function(_0x328345,_0x199231){var _0x175dd1={'raw':!![],'where':{'id':_0x328345[_0xf8f9('0x46')]['id']}},_0x315888={};_0x315888[_0xf8f9('0x2f')]=_[_0xf8f9('0x31')](db[_0xf8f9('0x2c')][_0xf8f9('0x2d')]);_0x315888[_0xf8f9('0x30')]=_[_0xf8f9('0x31')](_0x328345[_0xf8f9('0x30')]);_0x315888[_0xf8f9('0x3b')]=_[_0xf8f9('0x32')](_0x315888[_0xf8f9('0x2f')],_0x315888[_0xf8f9('0x30')]);_0x175dd1[_0xf8f9('0x33')]=_[_0xf8f9('0x32')](_0x315888[_0xf8f9('0x2f')],qs['fields'](_0x328345['query'][_0xf8f9('0x34')]));_0x175dd1['attributes']=_0x175dd1['attributes'][_0xf8f9('0x35')]?_0x175dd1[_0xf8f9('0x33')]:_0x315888['model'];if(_0x328345[_0xf8f9('0x30')][_0xf8f9('0x47')]){_0x175dd1[_0xf8f9('0x42')]=[{'all':!![]}];}_0x175dd1=_[_0xf8f9('0x3e')]({},_0x175dd1,_0x328345['options']);return db[_0xf8f9('0x2c')][_0xf8f9('0x48')](_0x175dd1)['then'](handleEntityNotFound(_0x199231,null))[_0xf8f9('0x41')](respondWithResult(_0x199231,null))[_0xf8f9('0x45')](handleError(_0x199231,null));};exports[_0xf8f9('0x26')]=function(_0x327016,_0x5bcecf){if(_0x327016[_0xf8f9('0x49')]['id']){delete _0x327016[_0xf8f9('0x49')]['id'];}return db[_0xf8f9('0x2c')][_0xf8f9('0x48')]({'where':{'id':_0x327016[_0xf8f9('0x46')]['id']}})['then'](handleEntityNotFound(_0x5bcecf,null))[_0xf8f9('0x41')](saveUpdates(_0x327016[_0xf8f9('0x49')],null))[_0xf8f9('0x41')](respondWithResult(_0x5bcecf,null))[_0xf8f9('0x45')](handleError(_0x5bcecf,null));};exports[_0xf8f9('0x4a')]=function(_0x122a07,_0xd988bb){return db[_0xf8f9('0x2c')][_0xf8f9('0x48')]({'where':{'id':_0x122a07[_0xf8f9('0x46')]['id']}})[_0xf8f9('0x41')](handleEntityNotFound(_0xd988bb,null))[_0xf8f9('0x41')](removeEntity(_0xd988bb,null))[_0xf8f9('0x45')](handleError(_0xd988bb,null));};exports[_0xf8f9('0x4b')]=function(_0x2df8d6,_0x1792ae){return db[_0xf8f9('0x2c')][_0xf8f9('0x4b')]()[_0xf8f9('0x41')](respondWithResult(_0x1792ae,null))['catch'](handleError(_0x1792ae,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 3525c20..dccb7e4 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 _0x6ea3=['./cmHopperBlack.attributes','exports','CmHopperBlack','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x318f9a,_0x301ddf){var _0x250dae=function(_0x304831){while(--_0x304831){_0x318f9a['push'](_0x318f9a['shift']());}};_0x250dae(++_0x301ddf);}(_0x6ea3,0x12f));var _0x36ea=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0x6ea3[_0x4c440b];return _0x2d48cf;};'use strict';var _=require(_0x36ea('0x0'));var util=require(_0x36ea('0x1'));var logger=require(_0x36ea('0x2'))('api');var moment=require(_0x36ea('0x3'));var BPromise=require(_0x36ea('0x4'));var rp=require(_0x36ea('0x5'));var fs=require('fs');var path=require(_0x36ea('0x6'));var rimraf=require(_0x36ea('0x7'));var config=require(_0x36ea('0x8'));var attributes=require(_0x36ea('0x9'));module[_0x36ea('0xa')]=function(_0x2a968f,_0x2b6092){return _0x2a968f['define'](_0x36ea('0xb'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb495=['./cmHopperBlack.attributes','exports','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0xe27180,_0x56e592){var _0x1624c9=function(_0x2779df){while(--_0x2779df){_0xe27180['push'](_0xe27180['shift']());}};_0x1624c9(++_0x56e592);}(_0xb495,0x13c));var _0x5b49=function(_0x552e0e,_0x4fbc60){_0x552e0e=_0x552e0e-0x0;var _0x570e10=_0xb495[_0x552e0e];return _0x570e10;};'use strict';var _=require(_0x5b49('0x0'));var util=require(_0x5b49('0x1'));var logger=require(_0x5b49('0x2'))(_0x5b49('0x3'));var moment=require(_0x5b49('0x4'));var BPromise=require('bluebird');var rp=require(_0x5b49('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5b49('0x6'));var config=require(_0x5b49('0x7'));var attributes=require(_0x5b49('0x8'));module[_0x5b49('0x9')]=function(_0x268671,_0x568317){return _0x268671['define'](_0x5b49('0xa'),attributes,{'tableName':_0x5b49('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index c322a79..495b28a 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 _0x0d85=['code','message','result','GetCmHopperBlack','findAll','options','raw','attributes','limit','include','model','map','then','catch','UpdateCmHopperBlack','update','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x478e2f,_0xcc2041){var _0x4b088d=function(_0x1d262b){while(--_0x1d262b){_0x478e2f['push'](_0x478e2f['shift']());}};_0x4b088d(++_0xcc2041);}(_0x0d85,0x1c2));var _0x50d8=function(_0xe89364,_0x4ea57a){_0xe89364=_0xe89364-0x0;var _0x324d0f=_0x0d85[_0xe89364];return _0x324d0f;};'use strict';var _=require(_0x50d8('0x0'));var util=require(_0x50d8('0x1'));var moment=require(_0x50d8('0x2'));var BPromise=require(_0x50d8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x50d8('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x50d8('0x5'))(_0x50d8('0x6'));var config=require(_0x50d8('0x7'));var jayson=require(_0x50d8('0x8'));var client=jayson[_0x50d8('0x9')][_0x50d8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51e001,_0x7f0a27,_0x5f3d5e){return new BPromise(function(_0x420dcb,_0x30d11c){return client[_0x50d8('0xb')](_0x51e001,_0x5f3d5e)['then'](function(_0x56843f){logger[_0x50d8('0xc')](_0x50d8('0xd'),_0x7f0a27,_0x50d8('0xe'));logger[_0x50d8('0xf')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x7f0a27,_0x50d8('0xe'),JSON[_0x50d8('0x10')](_0x56843f));if(_0x56843f[_0x50d8('0x11')]){if(_0x56843f[_0x50d8('0x11')][_0x50d8('0x12')]===0x1f4){logger['error'](_0x50d8('0xd'),_0x7f0a27,_0x56843f[_0x50d8('0x11')][_0x50d8('0x13')]);return _0x30d11c(_0x56843f['error'][_0x50d8('0x13')]);}logger[_0x50d8('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x7f0a27,_0x56843f[_0x50d8('0x11')][_0x50d8('0x13')]);return _0x420dcb(_0x56843f[_0x50d8('0x11')][_0x50d8('0x13')]);}else{logger[_0x50d8('0xc')](_0x50d8('0xd'),_0x7f0a27,'request\x20sent');_0x420dcb(_0x56843f[_0x50d8('0x14')][_0x50d8('0x13')]);}})['catch'](function(_0x26e696){logger[_0x50d8('0x11')](_0x50d8('0xd'),_0x7f0a27,_0x26e696);_0x30d11c(_0x26e696);});});}exports[_0x50d8('0x15')]=function(_0x52233a){var _0x122c70=this;return new Promise(function(_0x23f840,_0x1c8ca8){return db['CmHopperBlack'][_0x50d8('0x16')]({'raw':_0x52233a['options']?_0x52233a[_0x50d8('0x17')][_0x50d8('0x18')]===undefined?!![]:![]:!![],'where':_0x52233a[_0x50d8('0x17')]?_0x52233a[_0x50d8('0x17')]['where']||null:null,'attributes':_0x52233a[_0x50d8('0x17')]?_0x52233a[_0x50d8('0x17')][_0x50d8('0x19')]||null:null,'limit':_0x52233a[_0x50d8('0x17')]?_0x52233a[_0x50d8('0x17')][_0x50d8('0x1a')]||null:null,'include':_0x52233a['options']?_0x52233a['options'][_0x50d8('0x1b')]?_['map'](_0x52233a[_0x50d8('0x17')][_0x50d8('0x1b')],function(_0x2ebbc8){return{'model':db[_0x2ebbc8[_0x50d8('0x1c')]],'as':_0x2ebbc8['as'],'attributes':_0x2ebbc8[_0x50d8('0x19')],'include':_0x2ebbc8[_0x50d8('0x1b')]?_['map'](_0x2ebbc8[_0x50d8('0x1b')],function(_0x592234){return{'model':db[_0x592234['model']],'as':_0x592234['as'],'attributes':_0x592234[_0x50d8('0x19')],'include':_0x592234[_0x50d8('0x1b')]?_[_0x50d8('0x1d')](_0x592234[_0x50d8('0x1b')],function(_0x2524de){return{'model':db[_0x2524de['model']],'as':_0x2524de['as'],'attributes':_0x2524de['attributes']};}):[]};}):[]};}):[]:[]})[_0x50d8('0x1e')](function(_0x3cd41f){logger[_0x50d8('0xc')](_0x50d8('0x15'),_0x52233a);logger[_0x50d8('0xf')](_0x50d8('0x15'),_0x52233a,JSON[_0x50d8('0x10')](_0x3cd41f));_0x23f840(_0x3cd41f);})[_0x50d8('0x1f')](function(_0x8bbe1d){logger[_0x50d8('0x11')](_0x50d8('0x15'),_0x8bbe1d['message'],_0x52233a);_0x1c8ca8(_0x122c70[_0x50d8('0x11')](0x1f4,_0x8bbe1d[_0x50d8('0x13')]));});});};exports[_0x50d8('0x20')]=function(_0x1f7e04){var _0x31db09=this;return new Promise(function(_0x158934,_0x5ed091){return db['CmHopperBlack'][_0x50d8('0x21')](_0x1f7e04['body'],{'raw':_0x1f7e04[_0x50d8('0x17')]?_0x1f7e04[_0x50d8('0x17')][_0x50d8('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f7e04[_0x50d8('0x17')]?_0x1f7e04[_0x50d8('0x17')]['where']||null:null,'attributes':_0x1f7e04[_0x50d8('0x17')]?_0x1f7e04[_0x50d8('0x17')][_0x50d8('0x19')]||null:null,'limit':_0x1f7e04[_0x50d8('0x17')]?_0x1f7e04['options'][_0x50d8('0x1a')]||null:null})['then'](function(_0x464808){logger[_0x50d8('0xc')](_0x50d8('0x20'),_0x1f7e04);logger['debug']('UpdateCmHopperBlack',_0x1f7e04,JSON['stringify'](_0x464808));_0x158934(_0x464808);})[_0x50d8('0x1f')](function(_0x165401){logger['error'](_0x50d8('0x20'),_0x165401[_0x50d8('0x13')],_0x1f7e04);_0x5ed091(_0x31db09['error'](0x1f4,_0x165401[_0x50d8('0x13')]));});});};exports[_0x50d8('0x22')]=function(_0x308f01){var _0x560759=this;return new Promise(function(_0x25ef4b,_0x41ecb4){return db['CmHopperBlack'][_0x50d8('0x23')]({'where':_0x308f01[_0x50d8('0x17')]?_0x308f01[_0x50d8('0x17')]['where']||null:null})[_0x50d8('0x1e')](function(_0x899f69){logger[_0x50d8('0xc')](_0x50d8('0x22'),_0x308f01);logger[_0x50d8('0xf')](_0x50d8('0x22'),_0x308f01,JSON['stringify'](_0x899f69));_0x25ef4b(_0x899f69);})[_0x50d8('0x1f')](function(_0x7ee651){logger[_0x50d8('0x11')]('DestroyCmHopperBlack',_0x7ee651['message'],_0x308f01);_0x41ecb4(_0x560759[_0x50d8('0x11')](0x1f4,_0x7ee651[_0x50d8('0x13')]));});});}; \ No newline at end of file +var _0xba2d=['attributes','then','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','limit','map','include','model'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xba2d,0x9f));var _0xdba2=function(_0x43c6db,_0x4f9d68){_0x43c6db=_0x43c6db-0x0;var _0x43890d=_0xba2d[_0x43c6db];return _0x43890d;};'use strict';var _=require(_0xdba2('0x0'));var util=require('util');var moment=require(_0xdba2('0x1'));var BPromise=require(_0xdba2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdba2('0x3'));var db=require(_0xdba2('0x4'))['db'];var utils=require(_0xdba2('0x5'));var logger=require('../../config/logger')(_0xdba2('0x6'));var config=require(_0xdba2('0x7'));var jayson=require(_0xdba2('0x8'));var client=jayson[_0xdba2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbc93c5,_0x2a224f,_0x440653){return new BPromise(function(_0x42f761,_0x529fce){return client[_0xdba2('0xa')](_0xbc93c5,_0x440653)['then'](function(_0x515618){logger[_0xdba2('0xb')](_0xdba2('0xc'),_0x2a224f,_0xdba2('0xd'));logger[_0xdba2('0xe')](_0xdba2('0xf'),_0x2a224f,_0xdba2('0xd'),JSON[_0xdba2('0x10')](_0x515618));if(_0x515618[_0xdba2('0x11')]){if(_0x515618[_0xdba2('0x11')][_0xdba2('0x12')]===0x1f4){logger[_0xdba2('0x11')](_0xdba2('0xc'),_0x2a224f,_0x515618[_0xdba2('0x11')][_0xdba2('0x13')]);return _0x529fce(_0x515618['error'][_0xdba2('0x13')]);}logger[_0xdba2('0x11')](_0xdba2('0xc'),_0x2a224f,_0x515618[_0xdba2('0x11')]['message']);return _0x42f761(_0x515618['error'][_0xdba2('0x13')]);}else{logger[_0xdba2('0xb')](_0xdba2('0xc'),_0x2a224f,_0xdba2('0xd'));_0x42f761(_0x515618['result'][_0xdba2('0x13')]);}})[_0xdba2('0x14')](function(_0x361f86){logger[_0xdba2('0x11')](_0xdba2('0xc'),_0x2a224f,_0x361f86);_0x529fce(_0x361f86);});});}exports[_0xdba2('0x15')]=function(_0x19816b){var _0x532a42=this;return new Promise(function(_0x2b52fb,_0x50c590){return db[_0xdba2('0x16')][_0xdba2('0x17')]({'raw':_0x19816b['options']?_0x19816b[_0xdba2('0x18')][_0xdba2('0x19')]===undefined?!![]:![]:!![],'where':_0x19816b[_0xdba2('0x18')]?_0x19816b[_0xdba2('0x18')][_0xdba2('0x1a')]||null:null,'attributes':_0x19816b[_0xdba2('0x18')]?_0x19816b[_0xdba2('0x18')]['attributes']||null:null,'limit':_0x19816b[_0xdba2('0x18')]?_0x19816b[_0xdba2('0x18')][_0xdba2('0x1b')]||null:null,'include':_0x19816b['options']?_0x19816b[_0xdba2('0x18')]['include']?_[_0xdba2('0x1c')](_0x19816b[_0xdba2('0x18')][_0xdba2('0x1d')],function(_0x3d7225){return{'model':db[_0x3d7225[_0xdba2('0x1e')]],'as':_0x3d7225['as'],'attributes':_0x3d7225[_0xdba2('0x1f')],'include':_0x3d7225[_0xdba2('0x1d')]?_[_0xdba2('0x1c')](_0x3d7225[_0xdba2('0x1d')],function(_0x41cf1c){return{'model':db[_0x41cf1c[_0xdba2('0x1e')]],'as':_0x41cf1c['as'],'attributes':_0x41cf1c['attributes'],'include':_0x41cf1c[_0xdba2('0x1d')]?_[_0xdba2('0x1c')](_0x41cf1c[_0xdba2('0x1d')],function(_0x1219b0){return{'model':db[_0x1219b0[_0xdba2('0x1e')]],'as':_0x1219b0['as'],'attributes':_0x1219b0[_0xdba2('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xdba2('0x20')](function(_0xc18cfb){logger['info'](_0xdba2('0x15'),_0x19816b);logger[_0xdba2('0xe')]('GetCmHopperBlack',_0x19816b,JSON['stringify'](_0xc18cfb));_0x2b52fb(_0xc18cfb);})[_0xdba2('0x14')](function(_0x3e04ba){logger[_0xdba2('0x11')](_0xdba2('0x15'),_0x3e04ba['message'],_0x19816b);_0x50c590(_0x532a42[_0xdba2('0x11')](0x1f4,_0x3e04ba[_0xdba2('0x13')]));});});};exports[_0xdba2('0x21')]=function(_0x34ef2e){var _0x449da8=this;return new Promise(function(_0x5dafa8,_0x51715f){return db[_0xdba2('0x16')][_0xdba2('0x22')](_0x34ef2e[_0xdba2('0x23')],{'raw':_0x34ef2e['options']?_0x34ef2e['options'][_0xdba2('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34ef2e['options']?_0x34ef2e['options'][_0xdba2('0x1a')]||null:null,'attributes':_0x34ef2e[_0xdba2('0x18')]?_0x34ef2e[_0xdba2('0x18')]['attributes']||null:null,'limit':_0x34ef2e['options']?_0x34ef2e[_0xdba2('0x18')][_0xdba2('0x1b')]||null:null})['then'](function(_0x4b5a81){logger['info']('UpdateCmHopperBlack',_0x34ef2e);logger[_0xdba2('0xe')]('UpdateCmHopperBlack',_0x34ef2e,JSON[_0xdba2('0x10')](_0x4b5a81));_0x5dafa8(_0x4b5a81);})['catch'](function(_0x3d2ce4){logger['error'](_0xdba2('0x21'),_0x3d2ce4[_0xdba2('0x13')],_0x34ef2e);_0x51715f(_0x449da8[_0xdba2('0x11')](0x1f4,_0x3d2ce4[_0xdba2('0x13')]));});});};exports[_0xdba2('0x24')]=function(_0x5af004){var _0x5d2ebc=this;return new Promise(function(_0x1de06b,_0x3c4bb4){return db[_0xdba2('0x16')][_0xdba2('0x25')]({'where':_0x5af004['options']?_0x5af004[_0xdba2('0x18')][_0xdba2('0x1a')]||null:null})['then'](function(_0x45a41f){logger[_0xdba2('0xb')](_0xdba2('0x24'),_0x5af004);logger['debug'](_0xdba2('0x24'),_0x5af004,JSON[_0xdba2('0x10')](_0x45a41f));_0x1de06b(_0x45a41f);})['catch'](function(_0x56427c){logger[_0xdba2('0x11')]('DestroyCmHopperBlack',_0x56427c[_0xdba2('0x13')],_0x5af004);_0x3c4bb4(_0x5d2ebc[_0xdba2('0x11')](0x1f4,_0x56427c['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 233bdc7..1591266 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 _0x741c=['get','isAuthenticated','index','/describe','/:id','show','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./cmHopperBlack.controller'];(function(_0x5c342b,_0x386463){var _0x480398=function(_0x2b0e23){while(--_0x2b0e23){_0x5c342b['push'](_0x5c342b['shift']());}};_0x480398(++_0x386463);}(_0x741c,0x196));var _0xc741=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x741c[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0xc741('0x0'));var util=require(_0xc741('0x1'));var path=require(_0xc741('0x2'));var timeout=require(_0xc741('0x3'));var express=require(_0xc741('0x4'));var router=express[_0xc741('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc741('0x6'));var config=require('../../config/environment');var controller=require(_0xc741('0x7'));router[_0xc741('0x8')]('/',auth[_0xc741('0x9')](),controller[_0xc741('0xa')]);router[_0xc741('0x8')](_0xc741('0xb'),auth[_0xc741('0x9')](),controller['describe']);router[_0xc741('0x8')](_0xc741('0xc'),auth['isAuthenticated'](),controller[_0xc741('0xd')]);router['put']('/:id',auth[_0xc741('0x9')](),controller[_0xc741('0xe')]);router[_0xc741('0xf')](_0xc741('0xc'),auth[_0xc741('0x9')](),controller[_0xc741('0x10')]);module[_0xc741('0x11')]=router; \ No newline at end of file +var _0x1623=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./cmHopperBlack.controller','isAuthenticated','index','/describe','describe','get','/:id','show','put','update','delete','destroy','exports'];(function(_0x45c417,_0x137216){var _0x3b32e8=function(_0x36f3a2){while(--_0x36f3a2){_0x45c417['push'](_0x45c417['shift']());}};_0x3b32e8(++_0x137216);}(_0x1623,0xab));var _0x3162=function(_0x9c2d5,_0x1986d3){_0x9c2d5=_0x9c2d5-0x0;var _0x47de9a=_0x1623[_0x9c2d5];return _0x47de9a;};'use strict';var multer=require(_0x3162('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3162('0x1'));var express=require(_0x3162('0x2'));var router=express[_0x3162('0x3')]();var fs_extra=require(_0x3162('0x4'));var auth=require(_0x3162('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3162('0x6'));router['get']('/',auth[_0x3162('0x7')](),controller[_0x3162('0x8')]);router['get'](_0x3162('0x9'),auth[_0x3162('0x7')](),controller[_0x3162('0xa')]);router[_0x3162('0xb')](_0x3162('0xc'),auth[_0x3162('0x7')](),controller[_0x3162('0xd')]);router[_0x3162('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x3162('0xf')]);router[_0x3162('0x10')](_0x3162('0xc'),auth[_0x3162('0x7')](),controller[_0x3162('0x11')]);module[_0x3162('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 187d5d3..9fa42fe 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 _0xf9b6=['exports','STRING','DATE','INTEGER','endtime','setDataValue','followuptime','seconds','BOOLEAN','sequelize','moment'];(function(_0x2b6b5a,_0x3483a2){var _0x5cd5f2=function(_0xee6dd6){while(--_0xee6dd6){_0x2b6b5a['push'](_0x2b6b5a['shift']());}};_0x5cd5f2(++_0x3483a2);}(_0xf9b6,0x1b6));var _0x6f9b=function(_0x197767,_0x400276){_0x197767=_0x197767-0x0;var _0x5422c6=_0xf9b6[_0x197767];return _0x5422c6;};'use strict';var Sequelize=require(_0x6f9b('0x0'));var moment=require(_0x6f9b('0x1'));module[_0x6f9b('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x6f9b('0x3')]},'scheduledat':{'type':Sequelize[_0x6f9b('0x4')]},'countbusyretry':{'type':Sequelize[_0x6f9b('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6f9b('0x5')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x6f9b('0x5')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x6f9b('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x6f9b('0x3')]},'originatecalleridname':{'type':Sequelize[_0x6f9b('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x6f9b('0x3')]},'starttime':{'type':Sequelize[_0x6f9b('0x4')]},'responsetime':{'type':Sequelize[_0x6f9b('0x4')]},'answertime':{'type':Sequelize[_0x6f9b('0x4')]},'droptime':{'type':Sequelize[_0x6f9b('0x4')]},'endtime':{'type':Sequelize[_0x6f9b('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x6f9b('0x5')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x6f9b('0x5')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x6f9b('0x3')]},'campaign':{'type':Sequelize[_0x6f9b('0x3')]},'campaigntype':{'type':Sequelize[_0x6f9b('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x6f9b('0x3')]},'disposition':{'type':Sequelize[_0x6f9b('0x3')]},'secondDisposition':{'type':Sequelize[_0x6f9b('0x3')]},'thirdDisposition':{'type':Sequelize[_0x6f9b('0x3')]},'dispositionat':{'type':Sequelize[_0x6f9b('0x4')],'set':function(_0x430413){var _0x5b0d25=this['getDataValue'](_0x6f9b('0x6'));if(_0x5b0d25&&_0x430413){this[_0x6f9b('0x7')](_0x6f9b('0x8'),moment(_0x430413)['diff'](moment(_0x5b0d25),_0x6f9b('0x9')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x6f9b('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x6f9b('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x6f9b('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6f9b('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6f9b('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x6f9b('0x4')]},'recallme':{'type':Sequelize[_0x6f9b('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6f9b('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6f9b('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6f9b('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0x86bb=['BOOLEAN','sequelize','moment','exports','INTEGER','DATE','STRING','getDataValue','endtime','setDataValue','followuptime','diff'];(function(_0x5eaa2a,_0x2426dc){var _0x3c333a=function(_0x25fa4b){while(--_0x25fa4b){_0x5eaa2a['push'](_0x5eaa2a['shift']());}};_0x3c333a(++_0x2426dc);}(_0x86bb,0x175));var _0xb86b=function(_0xc8bcf9,_0x30b65e){_0xc8bcf9=_0xc8bcf9-0x0;var _0x460138=_0x86bb[_0xc8bcf9];return _0x460138;};'use strict';var Sequelize=require(_0xb86b('0x0'));var moment=require(_0xb86b('0x1'));module[_0xb86b('0x2')]={'state':{'type':Sequelize[_0xb86b('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xb86b('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb86b('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xb86b('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xb86b('0x5')]},'originatecalleridnum':{'type':Sequelize[_0xb86b('0x5')]},'originatecalleridname':{'type':Sequelize[_0xb86b('0x5')]},'calleridnum':{'type':Sequelize[_0xb86b('0x5')]},'calleridname':{'type':Sequelize[_0xb86b('0x5')]},'starttime':{'type':Sequelize[_0xb86b('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xb86b('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xb86b('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb86b('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb86b('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb86b('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xb86b('0x5')]},'campaign':{'type':Sequelize[_0xb86b('0x5')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xb86b('0x5')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xb86b('0x5')]},'thirdDisposition':{'type':Sequelize[_0xb86b('0x5')]},'dispositionat':{'type':Sequelize[_0xb86b('0x4')],'set':function(_0x35edb5){var _0x5e7d5d=this[_0xb86b('0x6')](_0xb86b('0x7'));if(_0x5e7d5d&&_0x35edb5){this[_0xb86b('0x8')](_0xb86b('0x9'),moment(_0x35edb5)[_0xb86b('0xa')](moment(_0x5e7d5d),'seconds'));}}},'amd':{'type':Sequelize[_0xb86b('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0xb86b('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xb86b('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xb86b('0x4')]},'callback':{'type':Sequelize[_0xb86b('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb86b('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb86b('0x4')]},'deleted':{'type':Sequelize[_0xb86b('0x5')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xb86b('0x4')]},'recallme':{'type':Sequelize[_0xb86b('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xb86b('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0xb86b('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb86b('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb86b('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb86b('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 169a6f8..8b8f47a 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 _0xafc4=['../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','VIRTUAL','options','CmHopperFinal','includeAll','catch','show','params','describe','body','uniqueid','find','countContactsQueueCampaignHopperFinal','findAll','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','phone','scheduledAt','ListId','VoiceQueueId','createdAt','select','field','ANY_VALUE(calleridnum)','NOW()','ContactId','ANY_VALUE(VoiceQueueId)','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','Campaign','fromQuery','CampaignId','CampaignId\x20=\x20?','group','CmHopper','findOne','eml-format','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api'];(function(_0x2f81b4,_0x55155f){var _0xb3c04c=function(_0x16e5fd){while(--_0x16e5fd){_0x2f81b4['push'](_0x2f81b4['shift']());}};_0xb3c04c(++_0x55155f);}(_0xafc4,0x69));var _0x4afc=function(_0x2d1a03,_0x249e7b){_0x2d1a03=_0x2d1a03-0x0;var _0x3e7b7f=_0xafc4[_0x2d1a03];return _0x3e7b7f;};'use strict';var emlformat=require(_0x4afc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4afc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4afc('0x2'));var moment=require(_0x4afc('0x3'));var BPromise=require(_0x4afc('0x4'));var Mustache=require(_0x4afc('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4afc('0x6'));var ejs=require(_0x4afc('0x7'));var fs=require('fs');var fs_extra=require(_0x4afc('0x8'));var _=require(_0x4afc('0x9'));var squel=require(_0x4afc('0xa'));var crypto=require(_0x4afc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4afc('0xc'));var toCsv=require(_0x4afc('0x6'));var querystring=require(_0x4afc('0xd'));var Papa=require(_0x4afc('0xe'));var Redis=require(_0x4afc('0xf'));var authService=require(_0x4afc('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4afc('0x11'));var logger=require('../../config/logger')(_0x4afc('0x12'));var utils=require(_0x4afc('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4afc('0x14'));var db=require(_0x4afc('0x15'))['db'];function respondWithStatusCode(_0x2b191c,_0x2768bf){_0x2768bf=_0x2768bf||0xcc;return function(_0x1d8f98){if(_0x1d8f98){return _0x2b191c[_0x4afc('0x16')](_0x2768bf);}return _0x2b191c[_0x4afc('0x17')](_0x2768bf)[_0x4afc('0x18')]();};}function respondWithResult(_0x5effb4,_0x26f3f1){_0x26f3f1=_0x26f3f1||0xc8;return function(_0x429fd8){if(_0x429fd8){return _0x5effb4[_0x4afc('0x17')](_0x26f3f1)[_0x4afc('0x19')](_0x429fd8);}};}function respondWithFilteredResult(_0x5f2dc9,_0x4e32e8){return function(_0x2452ae){if(_0x2452ae){var _0x4f3127=typeof _0x4e32e8[_0x4afc('0x1a')]===_0x4afc('0x1b')&&typeof _0x4e32e8[_0x4afc('0x1c')]===_0x4afc('0x1b');var _0x3a306f=_0x2452ae[_0x4afc('0x1d')];var _0x22f809=_0x4f3127?0x0:_0x4e32e8[_0x4afc('0x1a')];var _0x16365f=_0x4f3127?_0x2452ae[_0x4afc('0x1d')]:_0x4e32e8[_0x4afc('0x1a')]+_0x4e32e8['limit'];var _0x1a8f49;if(_0x16365f>=_0x3a306f){_0x16365f=_0x3a306f;_0x1a8f49=0xc8;}else{_0x1a8f49=0xce;}_0x5f2dc9[_0x4afc('0x17')](_0x1a8f49);return _0x5f2dc9[_0x4afc('0x1e')](_0x4afc('0x1f'),_0x22f809+'-'+_0x16365f+'/'+_0x3a306f)['json'](_0x2452ae);}return null;};}function patchUpdates(_0x3bddc0){return function(_0x30eda3){try{jsonpatch[_0x4afc('0x20')](_0x30eda3,_0x3bddc0,!![]);}catch(_0x280587){return BPromise[_0x4afc('0x21')](_0x280587);}return _0x30eda3[_0x4afc('0x22')]();};}function saveUpdates(_0x3ad7a5,_0x573a75){return function(_0x5403e4){if(_0x5403e4){return _0x5403e4[_0x4afc('0x23')](_0x3ad7a5)['then'](function(_0x37debf){return _0x37debf;});}return null;};}function removeEntity(_0x4e9a48,_0x1aa676){return function(_0x2a0314){if(_0x2a0314){return _0x2a0314[_0x4afc('0x24')]()[_0x4afc('0x25')](function(){_0x4e9a48[_0x4afc('0x17')](0xcc)[_0x4afc('0x18')]();});}};}function handleEntityNotFound(_0x40a0db,_0x383a71){return function(_0x2bb837){if(!_0x2bb837){_0x40a0db[_0x4afc('0x16')](0x194);}return _0x2bb837;};}function handleError(_0x4e8273,_0x359c07){_0x359c07=_0x359c07||0x1f4;return function(_0x35f5b3){logger['error'](_0x35f5b3[_0x4afc('0x26')]);if(_0x35f5b3[_0x4afc('0x27')]){delete _0x35f5b3[_0x4afc('0x27')];}_0x4e8273['status'](_0x359c07)['send'](_0x35f5b3);};}exports['index']=function(_0x426e9d,_0x5db47e){var _0x5e4747={},_0xd26d2f={},_0x628e42={'count':0x0,'rows':[]};var _0x494fe7=_['map'](db['CmHopperFinal'][_0x4afc('0x28')],function(_0x34434a){return{'name':_0x34434a[_0x4afc('0x29')],'type':_0x34434a[_0x4afc('0x2a')][_0x4afc('0x2b')]};});_0xd26d2f[_0x4afc('0x2c')]=_['map'](_0x494fe7,_0x4afc('0x27'));_0xd26d2f[_0x4afc('0x2d')]=_[_0x4afc('0x2e')](_0x426e9d[_0x4afc('0x2d')]);_0xd26d2f[_0x4afc('0x2f')]=_[_0x4afc('0x30')](_0xd26d2f[_0x4afc('0x2c')],_0xd26d2f[_0x4afc('0x2d')]);_0x5e4747['attributes']=_[_0x4afc('0x30')](_0xd26d2f['model'],qs['fields'](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x31')]));_0x5e4747[_0x4afc('0x32')]=_0x5e4747[_0x4afc('0x32')][_0x4afc('0x33')]?_0x5e4747[_0x4afc('0x32')]:_0xd26d2f['model'];if(!_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x34')](_0x4afc('0x35'))){_0x5e4747[_0x4afc('0x1c')]=qs[_0x4afc('0x1c')](_0x426e9d[_0x4afc('0x2d')]['limit']);_0x5e4747[_0x4afc('0x1a')]=qs[_0x4afc('0x1a')](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x1a')]);}_0x5e4747['order']=qs['sort'](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x36')]);_0x5e4747[_0x4afc('0x37')]=qs['filters'](_['pick'](_0x426e9d[_0x4afc('0x2d')],_0xd26d2f['filters']),_0x494fe7);if(_0x426e9d['query'][_0x4afc('0x38')]){_0x5e4747[_0x4afc('0x37')]=_[_0x4afc('0x39')](_0x5e4747[_0x4afc('0x37')],{'$or':_[_0x4afc('0x3a')](_0x494fe7,function(_0x4420fb){if(_0x4420fb[_0x4afc('0x2a')]!==_0x4afc('0x3b')){var _0x3ccc5a={};_0x3ccc5a[_0x4420fb[_0x4afc('0x27')]]={'$like':'%'+_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x38')]+'%'};return _0x3ccc5a;}})});}_0x5e4747=_[_0x4afc('0x39')]({},_0x5e4747,_0x426e9d[_0x4afc('0x3c')]);var _0x46dd2a={'where':_0x5e4747['where']};return db[_0x4afc('0x3d')][_0x4afc('0x1d')](_0x46dd2a)[_0x4afc('0x25')](function(_0xe6db12){_0x628e42[_0x4afc('0x1d')]=_0xe6db12;if(_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x3e')]){_0x5e4747['include']=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x5e4747);})[_0x4afc('0x25')](function(_0x105c03){_0x628e42['rows']=_0x105c03;return _0x628e42;})[_0x4afc('0x25')](respondWithFilteredResult(_0x5db47e,_0x5e4747))[_0x4afc('0x3f')](handleError(_0x5db47e,null));};exports[_0x4afc('0x40')]=function(_0x397996,_0x545109){var _0x12b5db={'raw':!![],'where':{'id':_0x397996[_0x4afc('0x41')]['id']}},_0x45c9c3={};_0x45c9c3[_0x4afc('0x2c')]=_[_0x4afc('0x2e')](db[_0x4afc('0x3d')]['rawAttributes']);_0x45c9c3[_0x4afc('0x2d')]=_['keys'](_0x397996[_0x4afc('0x2d')]);_0x45c9c3[_0x4afc('0x2f')]=_[_0x4afc('0x30')](_0x45c9c3['model'],_0x45c9c3['query']);_0x12b5db[_0x4afc('0x32')]=_[_0x4afc('0x30')](_0x45c9c3[_0x4afc('0x2c')],qs[_0x4afc('0x31')](_0x397996[_0x4afc('0x2d')][_0x4afc('0x31')]));_0x12b5db[_0x4afc('0x32')]=_0x12b5db[_0x4afc('0x32')]['length']?_0x12b5db[_0x4afc('0x32')]:_0x45c9c3[_0x4afc('0x2c')];if(_0x397996['query'][_0x4afc('0x3e')]){_0x12b5db['include']=[{'all':!![]}];}_0x12b5db=_[_0x4afc('0x39')]({},_0x12b5db,_0x397996[_0x4afc('0x3c')]);return db[_0x4afc('0x3d')]['find'](_0x12b5db)[_0x4afc('0x25')](handleEntityNotFound(_0x545109,null))[_0x4afc('0x25')](respondWithResult(_0x545109,null))[_0x4afc('0x3f')](handleError(_0x545109,null));};exports[_0x4afc('0x42')]=function(_0x4772db,_0x19a0ac){return db['CmHopperFinal']['describe']()['then'](respondWithResult(_0x19a0ac,null))[_0x4afc('0x3f')](handleError(_0x19a0ac,null));};exports[_0x4afc('0x23')]=function(_0x42e274,_0x269c24){if(_0x42e274[_0x4afc('0x43')][_0x4afc('0x44')]){delete _0x42e274[_0x4afc('0x43')][_0x4afc('0x44')];}return db[_0x4afc('0x3d')][_0x4afc('0x45')]({'where':{'uniqueid':_0x42e274['params']['id']}})[_0x4afc('0x25')](handleEntityNotFound(_0x269c24,null))['then'](saveUpdates(_0x42e274['body'],null))[_0x4afc('0x25')](respondWithResult(_0x269c24,null))['catch'](handleError(_0x269c24,null));};exports[_0x4afc('0x46')]=function(_0x355198,_0x2fe2ae,_0x2cafc3){return db['CmHopperFinal'][_0x4afc('0x47')]({'raw':![],'where':{'VoiceQueueId':_0x355198['params']['id']},'attributes':[[db[_0x4afc('0x48')]['fn'](_0x4afc('0x49'),db[_0x4afc('0x48')]['fn']('IF',db[_0x4afc('0x48')][_0x4afc('0x4a')](_0x4afc('0x4b')))),_0x4afc('0x4c')],[db[_0x4afc('0x48')]['fn'](_0x4afc('0x49'),db[_0x4afc('0x48')]['fn']('IF',db[_0x4afc('0x48')][_0x4afc('0x4a')]('`state`\x20=\x203,\x201,\x20null'))),_0x4afc('0x4d')],[db[_0x4afc('0x48')]['fn'](_0x4afc('0x49'),db[_0x4afc('0x48')]['fn']('IF',db[_0x4afc('0x48')][_0x4afc('0x4a')](_0x4afc('0x4e')))),_0x4afc('0x4f')],[db[_0x4afc('0x48')]['fn'](_0x4afc('0x49'),db[_0x4afc('0x48')]['fn']('IF',db[_0x4afc('0x48')][_0x4afc('0x4a')]('`state`\x20=\x208,\x201,\x20null'))),_0x4afc('0x50')],[db['sequelize']['fn'](_0x4afc('0x49'),db[_0x4afc('0x48')]['fn']('IF',db[_0x4afc('0x48')][_0x4afc('0x4a')]('`state`\x20=\x2010\x20,\x201,\x20null'))),'dropContacts'],[db[_0x4afc('0x48')]['fn'](_0x4afc('0x49'),db['sequelize']['fn']('IF',db[_0x4afc('0x48')][_0x4afc('0x4a')](_0x4afc('0x51')))),_0x4afc('0x52')],[db[_0x4afc('0x48')]['fn'](_0x4afc('0x49'),db[_0x4afc('0x48')]['fn']('IF',db[_0x4afc('0x48')][_0x4afc('0x4a')](_0x4afc('0x53')))),_0x4afc('0x54')],[db[_0x4afc('0x48')]['fn'](_0x4afc('0x49'),db[_0x4afc('0x48')]['fn']('IF',db['sequelize'][_0x4afc('0x4a')](_0x4afc('0x55')))),_0x4afc('0x56')]]})[_0x4afc('0x25')](handleEntityNotFound(_0x2fe2ae,null))[_0x4afc('0x25')](respondWithResult(_0x2fe2ae,null))[_0x4afc('0x3f')](handleError(_0x2fe2ae,null));};exports[_0x4afc('0x57')]=function(_0x4985c6,_0x1771e8,_0x323c65){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x4985c6[_0x4afc('0x41')]['id']},'attributes':[[db[_0x4afc('0x48')]['fn'](_0x4afc('0x49'),db[_0x4afc('0x48')]['fn']('IF',db[_0x4afc('0x48')][_0x4afc('0x4a')](_0x4afc('0x4b')))),_0x4afc('0x4c')],[db[_0x4afc('0x48')]['fn'](_0x4afc('0x49'),db['sequelize']['fn']('IF',db['sequelize'][_0x4afc('0x4a')](_0x4afc('0x58')))),'noAnswerContacts'],[db[_0x4afc('0x48')]['fn'](_0x4afc('0x49'),db['sequelize']['fn']('IF',db['sequelize'][_0x4afc('0x4a')](_0x4afc('0x4e')))),_0x4afc('0x4f')],[db['sequelize']['fn'](_0x4afc('0x49'),db['sequelize']['fn']('IF',db['sequelize'][_0x4afc('0x4a')](_0x4afc('0x59')))),_0x4afc('0x50')],[db[_0x4afc('0x48')]['fn'](_0x4afc('0x49'),db[_0x4afc('0x48')]['fn']('IF',db[_0x4afc('0x48')][_0x4afc('0x4a')](_0x4afc('0x5a')))),'dropContacts'],[db[_0x4afc('0x48')]['fn'](_0x4afc('0x49'),db[_0x4afc('0x48')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x4afc('0x52')],[db[_0x4afc('0x48')]['fn'](_0x4afc('0x49'),db['sequelize']['fn']('IF',db[_0x4afc('0x48')]['literal']('`state`\x20=\x2022,\x201,\x20null'))),'reCallContacts'],[db[_0x4afc('0x48')]['fn'](_0x4afc('0x49'),db[_0x4afc('0x48')]['fn']('IF',db['sequelize'][_0x4afc('0x4a')](_0x4afc('0x55')))),_0x4afc('0x56')]]})['then'](handleEntityNotFound(_0x1771e8,null))[_0x4afc('0x25')](respondWithResult(_0x1771e8,null))[_0x4afc('0x3f')](handleError(_0x1771e8,null));};exports[_0x4afc('0x5b')]=function(_0x392252,_0x1f652a,_0x481263){return db['VoiceQueue'][_0x4afc('0x45')]({'where':{'id':_0x392252[_0x4afc('0x41')]['id']}})[_0x4afc('0x25')](handleEntityNotFound(_0x1f652a,null))['then'](function(_0x380c56){var _0x14a216;if(_0x380c56){_0x14a216=squel[_0x4afc('0x5c')]()[_0x4afc('0x5d')](_0x4afc('0x5e'))['fromQuery']([_0x4afc('0x5f'),_0x4afc('0x60'),'ContactId',_0x4afc('0x61'),_0x4afc('0x62'),_0x4afc('0x63'),'updatedAt'],squel[_0x4afc('0x64')]()[_0x4afc('0x65')](_0x4afc('0x66'),_0x4afc('0x5f'))[_0x4afc('0x65')](_0x4afc('0x67'),_0x4afc('0x60'))[_0x4afc('0x65')]('ANY_VALUE(ContactId)',_0x4afc('0x68'))['field']('ANY_VALUE(ListId)',_0x4afc('0x61'))[_0x4afc('0x65')](_0x4afc('0x69'),'VoiceQueueId')['field'](_0x4afc('0x67'),_0x4afc('0x63'))[_0x4afc('0x65')](_0x4afc('0x67'),_0x4afc('0x6a'))[_0x4afc('0x6b')](_0x4afc('0x6c'))[_0x4afc('0x37')](_0x4afc('0x6d'),_0x392252[_0x4afc('0x41')]['id'][_0x4afc('0x6e')]())[_0x4afc('0x37')](_0x4afc('0x6f'),_0x392252[_0x4afc('0x43')][_0x4afc('0x70')][_0x4afc('0x6e')]())['where'](_0x4afc('0x71'))[_0x4afc('0x37')](_0x4afc('0x72'),squel[_0x4afc('0x64')]()[_0x4afc('0x65')](_0x4afc('0x5f'))[_0x4afc('0x6b')](_0x4afc('0x5e'))[_0x4afc('0x37')]('VoiceQueueId\x20=\x20?',_0x392252[_0x4afc('0x41')]['id'][_0x4afc('0x6e')]()))[_0x4afc('0x37')](_0x4afc('0x72'),squel['select']()[_0x4afc('0x65')](_0x4afc('0x73'))[_0x4afc('0x6b')](_0x4afc('0x6c'))[_0x4afc('0x37')](_0x4afc('0x6d'),_0x392252[_0x4afc('0x41')]['id'][_0x4afc('0x6e')]())[_0x4afc('0x37')](_0x4afc('0x74')))['group'](_0x4afc('0x68')))[_0x4afc('0x6e')]();return db['sequelize'][_0x4afc('0x2d')](_0x14a216);}return[];})[_0x4afc('0x25')](respondWithResult(_0x1f652a,null))[_0x4afc('0x3f')](handleError(_0x1f652a,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x1c3d20,_0x3478aa,_0x24553b){return db[_0x4afc('0x75')]['find']({'where':{'id':_0x1c3d20[_0x4afc('0x41')]['id']}})[_0x4afc('0x25')](handleEntityNotFound(_0x3478aa,null))['then'](function(_0x2dc8a1){var _0x36f3ea;if(_0x2dc8a1){_0x36f3ea=squel[_0x4afc('0x5c')]()['into']('cm_hopper')[_0x4afc('0x76')]([_0x4afc('0x5f'),_0x4afc('0x60'),_0x4afc('0x68'),_0x4afc('0x61'),_0x4afc('0x77'),_0x4afc('0x63'),_0x4afc('0x6a')],squel[_0x4afc('0x64')]()[_0x4afc('0x65')](_0x4afc('0x66'),_0x4afc('0x5f'))[_0x4afc('0x65')](_0x4afc('0x67'),_0x4afc('0x60'))[_0x4afc('0x65')]('ANY_VALUE(ContactId)',_0x4afc('0x68'))[_0x4afc('0x65')]('ANY_VALUE(ListId)',_0x4afc('0x61'))['field']('ANY_VALUE(CampaignId)',_0x4afc('0x77'))['field']('NOW()',_0x4afc('0x63'))['field'](_0x4afc('0x67'),'updatedAt')[_0x4afc('0x6b')](_0x4afc('0x6c'))[_0x4afc('0x37')](_0x4afc('0x78'),_0x1c3d20[_0x4afc('0x41')]['id']['toString']())[_0x4afc('0x37')](_0x4afc('0x6f'),_0x1c3d20['body']['state'][_0x4afc('0x6e')]())[_0x4afc('0x37')](_0x4afc('0x71'))[_0x4afc('0x37')](_0x4afc('0x72'),squel['select']()[_0x4afc('0x65')](_0x4afc('0x5f'))[_0x4afc('0x6b')](_0x4afc('0x5e'))['where'](_0x4afc('0x78'),_0x1c3d20['params']['id'][_0x4afc('0x6e')]()))[_0x4afc('0x37')](_0x4afc('0x72'),squel[_0x4afc('0x64')]()[_0x4afc('0x65')](_0x4afc('0x73'))[_0x4afc('0x6b')](_0x4afc('0x6c'))[_0x4afc('0x37')](_0x4afc('0x78'),_0x1c3d20[_0x4afc('0x41')]['id']['toString']())[_0x4afc('0x37')]('state\x20=\x204'))[_0x4afc('0x79')]('ContactId'))['toString']();return db[_0x4afc('0x48')]['query'](_0x36f3ea);}return[];})['then'](respondWithResult(_0x3478aa,null))[_0x4afc('0x3f')](handleError(_0x3478aa,null));};exports['checkContactHopper']=function(_0x272e36,_0x24bf53,_0x5b1421){return db[_0x4afc('0x7a')][_0x4afc('0x7b')]({'where':{'VoiceQueueId':_0x272e36['body'][_0x4afc('0x62')],'CampaignId':_0x272e36[_0x4afc('0x43')][_0x4afc('0x77')],'ContactId':_0x272e36['body'][_0x4afc('0x68')]}})[_0x4afc('0x25')](handleEntityNotFound(_0x24bf53,null))[_0x4afc('0x25')](function(_0x16eb6d){if(_0x16eb6d){return _0x16eb6d;}return null;})[_0x4afc('0x25')](respondWithResult(_0x24bf53,null))[_0x4afc('0x3f')](handleError(_0x24bf53,null));}; \ No newline at end of file +var _0x524e=['destroy','name','send','index','map','rawAttributes','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','CmHopperFinal','then','includeAll','include','findAll','rows','catch','show','length','find','describe','body','uniqueid','params','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2022,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','VoiceQueueId','createdAt','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','updatedAt','from','cm_hopper_final','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','VoiceQueueId\x20=\x20?','group','Campaign','ContactId','ANY_VALUE(calleridnum)','CampaignId','CampaignId\x20=\x20?','state\x20=\x20?','calleridnum','CmHopper','findOne','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x524e,0x15e));var _0xe524=function(_0x11baf5,_0x39562d){_0x11baf5=_0x11baf5-0x0;var _0x1f9630=_0x524e[_0x11baf5];return _0x1f9630;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];function respondWithStatusCode(_0x5077c1,_0x4b0f51){_0x4b0f51=_0x4b0f51||0xcc;return function(_0xfdc2a5){if(_0xfdc2a5){return _0x5077c1[_0xe524('0x1c')](_0x4b0f51);}return _0x5077c1[_0xe524('0x1d')](_0x4b0f51)[_0xe524('0x1e')]();};}function respondWithResult(_0x20a852,_0x57c1b6){_0x57c1b6=_0x57c1b6||0xc8;return function(_0x12ff75){if(_0x12ff75){return _0x20a852['status'](_0x57c1b6)[_0xe524('0x1f')](_0x12ff75);}};}function respondWithFilteredResult(_0x1b0af6,_0x48165e){return function(_0x569660){if(_0x569660){var _0x488fce=typeof _0x48165e[_0xe524('0x20')]==='undefined'&&typeof _0x48165e[_0xe524('0x21')]==='undefined';var _0x5c8736=_0x569660['count'];var _0x3a4027=_0x488fce?0x0:_0x48165e['offset'];var _0x11b2a1=_0x488fce?_0x569660[_0xe524('0x22')]:_0x48165e[_0xe524('0x20')]+_0x48165e[_0xe524('0x21')];var _0x5d7b17;if(_0x11b2a1>=_0x5c8736){_0x11b2a1=_0x5c8736;_0x5d7b17=0xc8;}else{_0x5d7b17=0xce;}_0x1b0af6[_0xe524('0x1d')](_0x5d7b17);return _0x1b0af6[_0xe524('0x23')]('Content-Range',_0x3a4027+'-'+_0x11b2a1+'/'+_0x5c8736)[_0xe524('0x1f')](_0x569660);}return null;};}function patchUpdates(_0x309f85){return function(_0x43a4f9){try{jsonpatch[_0xe524('0x24')](_0x43a4f9,_0x309f85,!![]);}catch(_0x1c4194){return BPromise[_0xe524('0x25')](_0x1c4194);}return _0x43a4f9[_0xe524('0x26')]();};}function saveUpdates(_0x375219,_0x7dfe97){return function(_0x5c4d21){if(_0x5c4d21){return _0x5c4d21[_0xe524('0x27')](_0x375219)['then'](function(_0x577d1f){return _0x577d1f;});}return null;};}function removeEntity(_0x2d2f83,_0x23df5e){return function(_0x1ad106){if(_0x1ad106){return _0x1ad106[_0xe524('0x28')]()['then'](function(){_0x2d2f83[_0xe524('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17e245,_0xcf5db){return function(_0xd62772){if(!_0xd62772){_0x17e245[_0xe524('0x1c')](0x194);}return _0xd62772;};}function handleError(_0x4102d9,_0xfd5965){_0xfd5965=_0xfd5965||0x1f4;return function(_0x2141db){logger['error'](_0x2141db['stack']);if(_0x2141db[_0xe524('0x29')]){delete _0x2141db[_0xe524('0x29')];}_0x4102d9[_0xe524('0x1d')](_0xfd5965)[_0xe524('0x2a')](_0x2141db);};}exports[_0xe524('0x2b')]=function(_0x5405e4,_0x52f140){var _0x4b1ff={},_0x25e7a7={},_0x3aedd9={'count':0x0,'rows':[]};var _0x8070e4=_[_0xe524('0x2c')](db['CmHopperFinal'][_0xe524('0x2d')],function(_0x9a7e98){return{'name':_0x9a7e98['fieldName'],'type':_0x9a7e98['type'][_0xe524('0x2e')]};});_0x25e7a7[_0xe524('0x2f')]=_['map'](_0x8070e4,_0xe524('0x29'));_0x25e7a7['query']=_[_0xe524('0x30')](_0x5405e4['query']);_0x25e7a7[_0xe524('0x31')]=_[_0xe524('0x32')](_0x25e7a7[_0xe524('0x2f')],_0x25e7a7['query']);_0x4b1ff[_0xe524('0x33')]=_['intersection'](_0x25e7a7[_0xe524('0x2f')],qs[_0xe524('0x34')](_0x5405e4[_0xe524('0x35')]['fields']));_0x4b1ff[_0xe524('0x33')]=_0x4b1ff[_0xe524('0x33')]['length']?_0x4b1ff[_0xe524('0x33')]:_0x25e7a7[_0xe524('0x2f')];if(!_0x5405e4[_0xe524('0x35')][_0xe524('0x36')]('nolimit')){_0x4b1ff[_0xe524('0x21')]=qs[_0xe524('0x21')](_0x5405e4[_0xe524('0x35')][_0xe524('0x21')]);_0x4b1ff[_0xe524('0x20')]=qs[_0xe524('0x20')](_0x5405e4[_0xe524('0x35')][_0xe524('0x20')]);}_0x4b1ff['order']=qs[_0xe524('0x37')](_0x5405e4['query'][_0xe524('0x37')]);_0x4b1ff[_0xe524('0x38')]=qs['filters'](_[_0xe524('0x39')](_0x5405e4['query'],_0x25e7a7[_0xe524('0x31')]),_0x8070e4);if(_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]){_0x4b1ff[_0xe524('0x38')]=_[_0xe524('0x3b')](_0x4b1ff[_0xe524('0x38')],{'$or':_[_0xe524('0x2c')](_0x8070e4,function(_0x13762c){if(_0x13762c['type']!==_0xe524('0x3c')){var _0x940c05={};_0x940c05[_0x13762c[_0xe524('0x29')]]={'$like':'%'+_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]+'%'};return _0x940c05;}})});}_0x4b1ff=_[_0xe524('0x3b')]({},_0x4b1ff,_0x5405e4[_0xe524('0x3d')]);var _0x158d45={'where':_0x4b1ff['where']};return db[_0xe524('0x3e')][_0xe524('0x22')](_0x158d45)[_0xe524('0x3f')](function(_0x59781b){_0x3aedd9[_0xe524('0x22')]=_0x59781b;if(_0x5405e4['query'][_0xe524('0x40')]){_0x4b1ff[_0xe524('0x41')]=[{'all':!![]}];}return db[_0xe524('0x3e')][_0xe524('0x42')](_0x4b1ff);})[_0xe524('0x3f')](function(_0x4746cd){_0x3aedd9[_0xe524('0x43')]=_0x4746cd;return _0x3aedd9;})['then'](respondWithFilteredResult(_0x52f140,_0x4b1ff))[_0xe524('0x44')](handleError(_0x52f140,null));};exports[_0xe524('0x45')]=function(_0x13c54c,_0x376505){var _0x438962={'raw':!![],'where':{'id':_0x13c54c['params']['id']}},_0x1ae283={};_0x1ae283[_0xe524('0x2f')]=_[_0xe524('0x30')](db[_0xe524('0x3e')]['rawAttributes']);_0x1ae283[_0xe524('0x35')]=_['keys'](_0x13c54c['query']);_0x1ae283[_0xe524('0x31')]=_[_0xe524('0x32')](_0x1ae283['model'],_0x1ae283[_0xe524('0x35')]);_0x438962[_0xe524('0x33')]=_[_0xe524('0x32')](_0x1ae283[_0xe524('0x2f')],qs['fields'](_0x13c54c['query'][_0xe524('0x34')]));_0x438962[_0xe524('0x33')]=_0x438962['attributes'][_0xe524('0x46')]?_0x438962['attributes']:_0x1ae283[_0xe524('0x2f')];if(_0x13c54c[_0xe524('0x35')][_0xe524('0x40')]){_0x438962[_0xe524('0x41')]=[{'all':!![]}];}_0x438962=_[_0xe524('0x3b')]({},_0x438962,_0x13c54c[_0xe524('0x3d')]);return db[_0xe524('0x3e')][_0xe524('0x47')](_0x438962)[_0xe524('0x3f')](handleEntityNotFound(_0x376505,null))[_0xe524('0x3f')](respondWithResult(_0x376505,null))[_0xe524('0x44')](handleError(_0x376505,null));};exports[_0xe524('0x48')]=function(_0x3d7ab7,_0x33b1c8){return db[_0xe524('0x3e')]['describe']()[_0xe524('0x3f')](respondWithResult(_0x33b1c8,null))['catch'](handleError(_0x33b1c8,null));};exports['update']=function(_0x24f313,_0x59fe6b){if(_0x24f313[_0xe524('0x49')][_0xe524('0x4a')]){delete _0x24f313['body'][_0xe524('0x4a')];}return db['CmHopperFinal']['find']({'where':{'uniqueid':_0x24f313[_0xe524('0x4b')]['id']}})[_0xe524('0x3f')](handleEntityNotFound(_0x59fe6b,null))[_0xe524('0x3f')](saveUpdates(_0x24f313['body'],null))['then'](respondWithResult(_0x59fe6b,null))['catch'](handleError(_0x59fe6b,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x4f7a64,_0x5477ca,_0x45f504){return db[_0xe524('0x3e')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x4f7a64[_0xe524('0x4b')]['id']},'attributes':[[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')]['literal'](_0xe524('0x4e')))),_0xe524('0x4f')],[db[_0xe524('0x4c')]['fn']('COUNT',db[_0xe524('0x4c')]['fn']('IF',db['sequelize'][_0xe524('0x50')](_0xe524('0x51')))),_0xe524('0x52')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x53')))),_0xe524('0x54')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xe524('0x55')))),_0xe524('0x56')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x57')))),_0xe524('0x58')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db['sequelize']['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db['sequelize']['fn']('COUNT',db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x59')))),'reCallContacts'],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0xe524('0x3f')](handleEntityNotFound(_0x5477ca,null))['then'](respondWithResult(_0x5477ca,null))[_0xe524('0x44')](handleError(_0x5477ca,null));};exports[_0xe524('0x5a')]=function(_0x3f4201,_0x287ab8,_0x2b2a0e){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x3f4201[_0xe524('0x4b')]['id']},'attributes':[[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')]('`state`\x20=\x200,\x201,\x20null'))),_0xe524('0x4f')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db['sequelize']['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x51')))),'noAnswerContacts'],[db['sequelize']['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x53')))),'busyContacts'],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x55')))),_0xe524('0x56')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')]['literal'](_0xe524('0x57')))),_0xe524('0x58')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db['sequelize'][_0xe524('0x50')](_0xe524('0x5b')))),_0xe524('0x5c')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')]['literal'](_0xe524('0x59')))),_0xe524('0x5d')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db['sequelize']['fn']('IF',db[_0xe524('0x4c')]['literal'](_0xe524('0x5e')))),_0xe524('0x5f')]]})[_0xe524('0x3f')](handleEntityNotFound(_0x287ab8,null))['then'](respondWithResult(_0x287ab8,null))[_0xe524('0x44')](handleError(_0x287ab8,null));};exports[_0xe524('0x60')]=function(_0x43d125,_0x13905f,_0x4514d4){return db['VoiceQueue'][_0xe524('0x47')]({'where':{'id':_0x43d125[_0xe524('0x4b')]['id']}})[_0xe524('0x3f')](handleEntityNotFound(_0x13905f,null))[_0xe524('0x3f')](function(_0x109da1){var _0x57b6bb;if(_0x109da1){_0x57b6bb=squel[_0xe524('0x61')]()[_0xe524('0x62')](_0xe524('0x63'))[_0xe524('0x64')]([_0xe524('0x65'),_0xe524('0x66'),'ContactId',_0xe524('0x67'),_0xe524('0x68'),_0xe524('0x69'),'updatedAt'],squel[_0xe524('0x6a')]()[_0xe524('0x6b')]('ANY_VALUE(calleridnum)',_0xe524('0x65'))[_0xe524('0x6b')](_0xe524('0x6c'),_0xe524('0x66'))[_0xe524('0x6b')](_0xe524('0x6d'),'ContactId')[_0xe524('0x6b')](_0xe524('0x6e'),_0xe524('0x67'))[_0xe524('0x6b')](_0xe524('0x6f'),_0xe524('0x68'))[_0xe524('0x6b')](_0xe524('0x6c'),_0xe524('0x69'))[_0xe524('0x6b')](_0xe524('0x6c'),_0xe524('0x70'))[_0xe524('0x71')](_0xe524('0x72'))[_0xe524('0x38')]('VoiceQueueId\x20=\x20?',_0x43d125[_0xe524('0x4b')]['id'][_0xe524('0x73')]())[_0xe524('0x38')]('state\x20=\x20?',_0x43d125[_0xe524('0x49')][_0xe524('0x74')]['toString']())['where'](_0xe524('0x75'))['where'](_0xe524('0x76'),squel['select']()[_0xe524('0x6b')](_0xe524('0x65'))[_0xe524('0x71')](_0xe524('0x63'))['where']('VoiceQueueId\x20=\x20?',_0x43d125[_0xe524('0x4b')]['id'][_0xe524('0x73')]()))['where'](_0xe524('0x76'),squel[_0xe524('0x6a')]()[_0xe524('0x6b')]('calleridnum')[_0xe524('0x71')](_0xe524('0x72'))[_0xe524('0x38')](_0xe524('0x77'),_0x43d125[_0xe524('0x4b')]['id'][_0xe524('0x73')]())['where']('state\x20=\x204'))[_0xe524('0x78')]('ContactId'))[_0xe524('0x73')]();return db[_0xe524('0x4c')][_0xe524('0x35')](_0x57b6bb);}return[];})['then'](respondWithResult(_0x13905f,null))[_0xe524('0x44')](handleError(_0x13905f,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x1681c5,_0x41e693,_0xfc62e5){return db[_0xe524('0x79')][_0xe524('0x47')]({'where':{'id':_0x1681c5[_0xe524('0x4b')]['id']}})['then'](handleEntityNotFound(_0x41e693,null))[_0xe524('0x3f')](function(_0x35d0f4){var _0xa8334;if(_0x35d0f4){_0xa8334=squel['insert']()[_0xe524('0x62')](_0xe524('0x63'))['fromQuery']([_0xe524('0x65'),_0xe524('0x66'),_0xe524('0x7a'),_0xe524('0x67'),'CampaignId',_0xe524('0x69'),_0xe524('0x70')],squel[_0xe524('0x6a')]()['field'](_0xe524('0x7b'),'phone')[_0xe524('0x6b')](_0xe524('0x6c'),_0xe524('0x66'))['field'](_0xe524('0x6d'),_0xe524('0x7a'))[_0xe524('0x6b')]('ANY_VALUE(ListId)','ListId')[_0xe524('0x6b')]('ANY_VALUE(CampaignId)',_0xe524('0x7c'))['field'](_0xe524('0x6c'),_0xe524('0x69'))['field'](_0xe524('0x6c'),_0xe524('0x70'))['from']('cm_hopper_final')[_0xe524('0x38')](_0xe524('0x7d'),_0x1681c5[_0xe524('0x4b')]['id']['toString']())[_0xe524('0x38')](_0xe524('0x7e'),_0x1681c5[_0xe524('0x49')][_0xe524('0x74')][_0xe524('0x73')]())[_0xe524('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xe524('0x38')](_0xe524('0x76'),squel['select']()['field'](_0xe524('0x65'))[_0xe524('0x71')](_0xe524('0x63'))[_0xe524('0x38')]('CampaignId\x20=\x20?',_0x1681c5[_0xe524('0x4b')]['id'][_0xe524('0x73')]()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xe524('0x6a')]()[_0xe524('0x6b')](_0xe524('0x7f'))[_0xe524('0x71')](_0xe524('0x72'))[_0xe524('0x38')]('CampaignId\x20=\x20?',_0x1681c5['params']['id'][_0xe524('0x73')]())[_0xe524('0x38')]('state\x20=\x204'))['group'](_0xe524('0x7a')))[_0xe524('0x73')]();return db[_0xe524('0x4c')][_0xe524('0x35')](_0xa8334);}return[];})[_0xe524('0x3f')](respondWithResult(_0x41e693,null))[_0xe524('0x44')](handleError(_0x41e693,null));};exports['checkContactHopper']=function(_0x555801,_0x3e8668,_0x390093){return db[_0xe524('0x80')][_0xe524('0x81')]({'where':{'VoiceQueueId':_0x555801[_0xe524('0x49')][_0xe524('0x68')],'CampaignId':_0x555801[_0xe524('0x49')][_0xe524('0x7c')],'ContactId':_0x555801['body'][_0xe524('0x7a')]}})[_0xe524('0x3f')](handleEntityNotFound(_0x3e8668,null))[_0xe524('0x3f')](function(_0x5242b7){if(_0x5242b7){return _0x5242b7;}return null;})['then'](respondWithResult(_0x3e8668,null))[_0xe524('0x44')](handleError(_0x3e8668,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index cd30e3c..7990375 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 _0xd12b=['bluebird','request-promise','path','../../config/environment','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','moment'];(function(_0x394d0f,_0x15b6a5){var _0x59a66e=function(_0x439c89){while(--_0x439c89){_0x394d0f['push'](_0x394d0f['shift']());}};_0x59a66e(++_0x15b6a5);}(_0xd12b,0xe4));var _0xbd12=function(_0x4347ec,_0x41c4b8){_0x4347ec=_0x4347ec-0x0;var _0x4c8314=_0xd12b[_0x4347ec];return _0x4c8314;};'use strict';var _=require(_0xbd12('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xbd12('0x1'));var BPromise=require(_0xbd12('0x2'));var rp=require(_0xbd12('0x3'));var fs=require('fs');var path=require(_0xbd12('0x4'));var rimraf=require('rimraf');var config=require(_0xbd12('0x5'));var attributes=require('./cmHopperFinal.attributes');module['exports']=function(_0x148409,_0x408d6f){return _0x148409['define'](_0xbd12('0x6'),attributes,{'tableName':_0xbd12('0x7'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0xbd12('0x8')]},{'name':_0xbd12('0x9'),'fields':[_0xbd12('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x94e4=['./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','uniqueid','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment'];(function(_0x24851e,_0xc26dd0){var _0x48f0d6=function(_0x2bc3aa){while(--_0x2bc3aa){_0x24851e['push'](_0x24851e['shift']());}};_0x48f0d6(++_0xc26dd0);}(_0x94e4,0x199));var _0x494e=function(_0x302bcc,_0x5c5ff3){_0x302bcc=_0x302bcc-0x0;var _0x32a757=_0x94e4[_0x302bcc];return _0x32a757;};'use strict';var _=require(_0x494e('0x0'));var util=require(_0x494e('0x1'));var logger=require(_0x494e('0x2'))('api');var moment=require(_0x494e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x494e('0x4'));var rimraf=require(_0x494e('0x5'));var config=require(_0x494e('0x6'));var attributes=require(_0x494e('0x7'));module[_0x494e('0x8')]=function(_0x5237d0,_0x14f588){return _0x5237d0[_0x494e('0x9')](_0x494e('0xa'),attributes,{'tableName':_0x494e('0xb'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':['calleridnum']},{'name':_0x494e('0xc'),'fields':[_0x494e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index e620338..107099c 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0xb61075,_0x301d70){var _0x16bc8a=function(_0x459ada){while(--_0x459ada){_0xb61075['push'](_0xb61075['shift']());}};_0x16bc8a(++_0x301d70);}(_0x7a54,0x106));var _0x47a5=function(_0x4b20a4,_0x4670e5){_0x4b20a4=_0x4b20a4-0x0;var _0x36cd7b=_0x7a54[_0x4b20a4];return _0x36cd7b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x32666e,_0x3c4220){var _0x349f48=function(_0x1d67fc){while(--_0x1d67fc){_0x32666e['push'](_0x32666e['shift']());}};_0x349f48(++_0x3c4220);}(_0x7a54,0x106));var _0x47a5=function(_0x41c275,_0x57c4e4){_0x41c275=_0x41c275-0x0;var _0x31d2e1=_0x7a54[_0x41c275];return _0x31d2e1;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 37609be..5c67916 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 _0xf4b4=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/voice/queue/countAttributes/:id','post','/voice/queue/moveContacts/:id','/checkContactHopper','checkContactHopper','update','exports','util'];(function(_0x126a46,_0x2fcfcd){var _0xbe5786=function(_0x239a51){while(--_0x239a51){_0x126a46['push'](_0x126a46['shift']());}};_0xbe5786(++_0x2fcfcd);}(_0xf4b4,0x92));var _0x4f4b=function(_0x31ce3d,_0x581047){_0x31ce3d=_0x31ce3d-0x0;var _0x203d95=_0xf4b4[_0x31ce3d];return _0x203d95;};'use strict';var multer=require('multer');var util=require(_0x4f4b('0x0'));var path=require(_0x4f4b('0x1'));var timeout=require(_0x4f4b('0x2'));var express=require(_0x4f4b('0x3'));var router=express[_0x4f4b('0x4')]();var fs_extra=require(_0x4f4b('0x5'));var auth=require(_0x4f4b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4f4b('0x7'));var controller=require('./cmHopperFinal.controller');router[_0x4f4b('0x8')]('/',auth[_0x4f4b('0x9')](),controller[_0x4f4b('0xa')]);router[_0x4f4b('0x8')](_0x4f4b('0xb'),auth[_0x4f4b('0x9')](),controller['describe']);router[_0x4f4b('0x8')](_0x4f4b('0xc'),auth[_0x4f4b('0x9')](),controller[_0x4f4b('0xd')]);router[_0x4f4b('0x8')](_0x4f4b('0xe'),auth[_0x4f4b('0x9')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x4f4b('0x8')]('/campaign/countAttributes/:id',auth['isAuthenticated'](),controller['countContactsIvrCampaignHopperFinal']);router[_0x4f4b('0xf')](_0x4f4b('0x10'),auth['isAuthenticated'](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x4f4b('0xf')]('/voice/campaign/moveContacts/:id',auth[_0x4f4b('0x9')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x4f4b('0xf')](_0x4f4b('0x11'),auth[_0x4f4b('0x9')](),controller[_0x4f4b('0x12')]);router['put'](_0x4f4b('0xc'),auth[_0x4f4b('0x9')](),controller[_0x4f4b('0x13')]);module[_0x4f4b('0x14')]=router; \ No newline at end of file +var _0x916d=['/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmHopperFinal.controller','isAuthenticated','index','get','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal'];(function(_0x5d976c,_0x1bc8c9){var _0x187f43=function(_0x3a0535){while(--_0x3a0535){_0x5d976c['push'](_0x5d976c['shift']());}};_0x187f43(++_0x1bc8c9);}(_0x916d,0x11d));var _0xd916=function(_0x1b2146,_0x367229){_0x1b2146=_0x1b2146-0x0;var _0x5746f9=_0x916d[_0x1b2146];return _0x5746f9;};'use strict';var multer=require(_0xd916('0x0'));var util=require(_0xd916('0x1'));var path=require('path');var timeout=require(_0xd916('0x2'));var express=require(_0xd916('0x3'));var router=express[_0xd916('0x4')]();var fs_extra=require(_0xd916('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd916('0x6'));var config=require('../../config/environment');var controller=require(_0xd916('0x7'));router['get']('/',auth[_0xd916('0x8')](),controller[_0xd916('0x9')]);router[_0xd916('0xa')]('/describe',auth[_0xd916('0x8')](),controller['describe']);router[_0xd916('0xa')](_0xd916('0xb'),auth[_0xd916('0x8')](),controller[_0xd916('0xc')]);router[_0xd916('0xa')](_0xd916('0xd'),auth[_0xd916('0x8')](),controller[_0xd916('0xe')]);router['get'](_0xd916('0xf'),auth[_0xd916('0x8')](),controller[_0xd916('0x10')]);router[_0xd916('0x11')](_0xd916('0x12'),auth[_0xd916('0x8')](),controller[_0xd916('0x13')]);router[_0xd916('0x11')]('/voice/campaign/moveContacts/:id',auth[_0xd916('0x8')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xd916('0x11')](_0xd916('0x14'),auth[_0xd916('0x8')](),controller[_0xd916('0x15')]);router[_0xd916('0x16')](_0xd916('0xb'),auth[_0xd916('0x8')](),controller[_0xd916('0x17')]);module[_0xd916('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 2e6056a..75e174e 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 _0x0731=['BOOLEAN','sequelize','exports','INTEGER','STRING','DATE'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0731,0x175));var _0x1073=function(_0x5a38ec,_0xb93797){_0x5a38ec=_0x5a38ec-0x0;var _0x2d2a78=_0x0731[_0x5a38ec];return _0x2d2a78;};'use strict';var Sequelize=require(_0x1073('0x0'));module[_0x1073('0x1')]={'state':{'type':Sequelize[_0x1073('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x1073('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x1073('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1073('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1073('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x1073('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x1073('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x1073('0x3')]},'calleridname':{'type':Sequelize[_0x1073('0x3')]},'starttime':{'type':Sequelize[_0x1073('0x4')]},'responsetime':{'type':Sequelize[_0x1073('0x4')]},'answertime':{'type':Sequelize[_0x1073('0x4')]},'droptime':{'type':Sequelize[_0x1073('0x4')]},'endtime':{'type':Sequelize[_0x1073('0x4')]},'ringtime':{'type':Sequelize[_0x1073('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x1073('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x1073('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x1073('0x3')]},'campaign':{'type':Sequelize[_0x1073('0x3')]},'campaigntype':{'type':Sequelize[_0x1073('0x3')]},'membername':{'type':Sequelize[_0x1073('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x1073('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x1073('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1073('0x4')]},'recallme':{'type':Sequelize[_0x1073('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x1073('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x1073('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1073('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1073('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4796=['DATE','INTEGER','STRING','BOOLEAN','sequelize','exports'];(function(_0x54997e,_0x386cec){var _0x59fda4=function(_0x2260f8){while(--_0x2260f8){_0x54997e['push'](_0x54997e['shift']());}};_0x59fda4(++_0x386cec);}(_0x4796,0x70));var _0x6479=function(_0x19b4ca,_0x34b9f2){_0x19b4ca=_0x19b4ca-0x0;var _0x3a7368=_0x4796[_0x19b4ca];return _0x3a7368;};'use strict';var Sequelize=require(_0x6479('0x0'));module[_0x6479('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x6479('0x2')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6479('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6479('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x6479('0x4')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x6479('0x4')]},'calleridnum':{'type':Sequelize[_0x6479('0x4')]},'calleridname':{'type':Sequelize[_0x6479('0x4')]},'starttime':{'type':Sequelize[_0x6479('0x2')]},'responsetime':{'type':Sequelize[_0x6479('0x2')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x6479('0x2')]},'ringtime':{'type':Sequelize[_0x6479('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x6479('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x6479('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x6479('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x6479('0x4')]},'campaign':{'type':Sequelize[_0x6479('0x4')]},'campaigntype':{'type':Sequelize[_0x6479('0x4')]},'membername':{'type':Sequelize[_0x6479('0x4')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x6479('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x6479('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x6479('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6479('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x6479('0x2')]},'edited':{'type':Sequelize[_0x6479('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x6479('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6479('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6479('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6479('0x3')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 5763d87..56cf511 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 _0xc645=['include','findAll','rows','catch','show','params','keys','fields','options','find','create','describe','uniqueid','body','rimraf','zip-dir','request-promise','moment','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','CmHopperHistory','includeAll'];(function(_0x1bd323,_0x1c16ab){var _0x13097b=function(_0x4cc5de){while(--_0x4cc5de){_0x1bd323['push'](_0x1bd323['shift']());}};_0x13097b(++_0x1c16ab);}(_0xc645,0xae));var _0x5c64=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0xc645[_0x58e469];return _0x4c01c5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5c64('0x0'));var zipdir=require(_0x5c64('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c64('0x2'));var moment=require(_0x5c64('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5c64('0x4'));var util=require(_0x5c64('0x5'));var path=require('path');var sox=require(_0x5c64('0x6'));var csv=require('to-csv');var ejs=require(_0x5c64('0x7'));var fs=require('fs');var fs_extra=require(_0x5c64('0x8'));var _=require('lodash');var squel=require(_0x5c64('0x9'));var crypto=require(_0x5c64('0xa'));var jsforce=require(_0x5c64('0xb'));var deskjs=require(_0x5c64('0xc'));var toCsv=require(_0x5c64('0xd'));var querystring=require(_0x5c64('0xe'));var Papa=require(_0x5c64('0xf'));var Redis=require(_0x5c64('0x10'));var authService=require(_0x5c64('0x11'));var qs=require(_0x5c64('0x12'));var as=require(_0x5c64('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5c64('0x14'));var utils=require(_0x5c64('0x15'));var config=require(_0x5c64('0x16'));var licenseUtil=require(_0x5c64('0x17'));var db=require(_0x5c64('0x18'))['db'];function respondWithStatusCode(_0x296b21,_0x2cd963){_0x2cd963=_0x2cd963||0xcc;return function(_0x1899be){if(_0x1899be){return _0x296b21[_0x5c64('0x19')](_0x2cd963);}return _0x296b21['status'](_0x2cd963)[_0x5c64('0x1a')]();};}function respondWithResult(_0x30a0d8,_0xaf5246){_0xaf5246=_0xaf5246||0xc8;return function(_0x225fcd){if(_0x225fcd){return _0x30a0d8[_0x5c64('0x1b')](_0xaf5246)[_0x5c64('0x1c')](_0x225fcd);}};}function respondWithFilteredResult(_0x566ce,_0x137a93){return function(_0x26c76c){if(_0x26c76c){var _0x12c8cb=typeof _0x137a93[_0x5c64('0x1d')]===_0x5c64('0x1e')&&typeof _0x137a93[_0x5c64('0x1f')]===_0x5c64('0x1e');var _0x5bf7dc=_0x26c76c[_0x5c64('0x20')];var _0x29effa=_0x12c8cb?0x0:_0x137a93[_0x5c64('0x1d')];var _0x8f1be8=_0x12c8cb?_0x26c76c['count']:_0x137a93[_0x5c64('0x1d')]+_0x137a93[_0x5c64('0x1f')];var _0x149b73;if(_0x8f1be8>=_0x5bf7dc){_0x8f1be8=_0x5bf7dc;_0x149b73=0xc8;}else{_0x149b73=0xce;}_0x566ce[_0x5c64('0x1b')](_0x149b73);return _0x566ce[_0x5c64('0x21')](_0x5c64('0x22'),_0x29effa+'-'+_0x8f1be8+'/'+_0x5bf7dc)[_0x5c64('0x1c')](_0x26c76c);}return null;};}function patchUpdates(_0x11d4d2){return function(_0x31292e){try{jsonpatch[_0x5c64('0x23')](_0x31292e,_0x11d4d2,!![]);}catch(_0x32adbc){return BPromise[_0x5c64('0x24')](_0x32adbc);}return _0x31292e[_0x5c64('0x25')]();};}function saveUpdates(_0x4cf3cf,_0x1ac468){return function(_0x442809){if(_0x442809){return _0x442809[_0x5c64('0x26')](_0x4cf3cf)[_0x5c64('0x27')](function(_0x57b660){return _0x57b660;});}return null;};}function removeEntity(_0x353cfc,_0x1a0cec){return function(_0x10a2e0){if(_0x10a2e0){return _0x10a2e0[_0x5c64('0x28')]()['then'](function(){_0x353cfc[_0x5c64('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x142dc1,_0x1cd59f){return function(_0x32ab8b){if(!_0x32ab8b){_0x142dc1[_0x5c64('0x19')](0x194);}return _0x32ab8b;};}function handleError(_0x2ad23a,_0x510a95){_0x510a95=_0x510a95||0x1f4;return function(_0x2fa35a){logger[_0x5c64('0x29')](_0x2fa35a[_0x5c64('0x2a')]);if(_0x2fa35a[_0x5c64('0x2b')]){delete _0x2fa35a['name'];}_0x2ad23a[_0x5c64('0x1b')](_0x510a95)[_0x5c64('0x2c')](_0x2fa35a);};}exports[_0x5c64('0x2d')]=function(_0x345844,_0x52e2c8){var _0x507037={},_0x198f70={},_0x2e5b6d={'count':0x0,'rows':[]};var _0x544894=_[_0x5c64('0x2e')](db['CmHopperHistory'][_0x5c64('0x2f')],function(_0x40255b){return{'name':_0x40255b[_0x5c64('0x30')],'type':_0x40255b[_0x5c64('0x31')][_0x5c64('0x32')]};});_0x198f70[_0x5c64('0x33')]=_[_0x5c64('0x2e')](_0x544894,_0x5c64('0x2b'));_0x198f70['query']=_['keys'](_0x345844['query']);_0x198f70[_0x5c64('0x34')]=_[_0x5c64('0x35')](_0x198f70[_0x5c64('0x33')],_0x198f70[_0x5c64('0x36')]);_0x507037['attributes']=_[_0x5c64('0x35')](_0x198f70[_0x5c64('0x33')],qs['fields'](_0x345844['query']['fields']));_0x507037[_0x5c64('0x37')]=_0x507037[_0x5c64('0x37')][_0x5c64('0x38')]?_0x507037[_0x5c64('0x37')]:_0x198f70['model'];if(!_0x345844['query'][_0x5c64('0x39')]('nolimit')){_0x507037['limit']=qs[_0x5c64('0x1f')](_0x345844[_0x5c64('0x36')]['limit']);_0x507037[_0x5c64('0x1d')]=qs[_0x5c64('0x1d')](_0x345844[_0x5c64('0x36')][_0x5c64('0x1d')]);}_0x507037[_0x5c64('0x3a')]=qs[_0x5c64('0x3b')](_0x345844[_0x5c64('0x36')][_0x5c64('0x3b')]);_0x507037[_0x5c64('0x3c')]=qs[_0x5c64('0x34')](_['pick'](_0x345844[_0x5c64('0x36')],_0x198f70[_0x5c64('0x34')]),_0x544894);if(_0x345844[_0x5c64('0x36')][_0x5c64('0x3d')]){_0x507037[_0x5c64('0x3c')]=_['merge'](_0x507037[_0x5c64('0x3c')],{'$or':_['map'](_0x544894,function(_0x1d5c3c){if(_0x1d5c3c[_0x5c64('0x31')]!==_0x5c64('0x3e')){var _0x54a0f8={};_0x54a0f8[_0x1d5c3c[_0x5c64('0x2b')]]={'$like':'%'+_0x345844[_0x5c64('0x36')][_0x5c64('0x3d')]+'%'};return _0x54a0f8;}})});}_0x507037=_[_0x5c64('0x3f')]({},_0x507037,_0x345844['options']);var _0xee8ab7={'where':_0x507037[_0x5c64('0x3c')]};return db[_0x5c64('0x40')][_0x5c64('0x20')](_0xee8ab7)[_0x5c64('0x27')](function(_0x136fcc){_0x2e5b6d[_0x5c64('0x20')]=_0x136fcc;if(_0x345844[_0x5c64('0x36')][_0x5c64('0x41')]){_0x507037[_0x5c64('0x42')]=[{'all':!![]}];}return db[_0x5c64('0x40')][_0x5c64('0x43')](_0x507037);})['then'](function(_0x1f88c0){_0x2e5b6d[_0x5c64('0x44')]=_0x1f88c0;return _0x2e5b6d;})[_0x5c64('0x27')](respondWithFilteredResult(_0x52e2c8,_0x507037))[_0x5c64('0x45')](handleError(_0x52e2c8,null));};exports[_0x5c64('0x46')]=function(_0x2f6fff,_0x570984){var _0x3f5543={'raw':!![],'where':{'id':_0x2f6fff[_0x5c64('0x47')]['id']}},_0x25f5cf={};_0x25f5cf[_0x5c64('0x33')]=_[_0x5c64('0x48')](db[_0x5c64('0x40')]['rawAttributes']);_0x25f5cf[_0x5c64('0x36')]=_[_0x5c64('0x48')](_0x2f6fff[_0x5c64('0x36')]);_0x25f5cf[_0x5c64('0x34')]=_[_0x5c64('0x35')](_0x25f5cf['model'],_0x25f5cf[_0x5c64('0x36')]);_0x3f5543[_0x5c64('0x37')]=_[_0x5c64('0x35')](_0x25f5cf[_0x5c64('0x33')],qs[_0x5c64('0x49')](_0x2f6fff['query'][_0x5c64('0x49')]));_0x3f5543[_0x5c64('0x37')]=_0x3f5543['attributes'][_0x5c64('0x38')]?_0x3f5543[_0x5c64('0x37')]:_0x25f5cf['model'];if(_0x2f6fff[_0x5c64('0x36')]['includeAll']){_0x3f5543['include']=[{'all':!![]}];}_0x3f5543=_['merge']({},_0x3f5543,_0x2f6fff[_0x5c64('0x4a')]);return db['CmHopperHistory'][_0x5c64('0x4b')](_0x3f5543)[_0x5c64('0x27')](handleEntityNotFound(_0x570984,null))[_0x5c64('0x27')](respondWithResult(_0x570984,null))['catch'](handleError(_0x570984,null));};exports[_0x5c64('0x4c')]=function(_0x2f1219,_0x17015f){return db[_0x5c64('0x40')]['create'](_0x2f1219['body'],{})[_0x5c64('0x27')](respondWithResult(_0x17015f,0xc9))['catch'](handleError(_0x17015f,null));};exports[_0x5c64('0x4d')]=function(_0x5a0a6e,_0xf87480){return db['CmHopperHistory'][_0x5c64('0x4d')]()[_0x5c64('0x27')](respondWithResult(_0xf87480,null))['catch'](handleError(_0xf87480,null));};exports[_0x5c64('0x26')]=function(_0x41ba6c,_0x27cfef){if(_0x41ba6c['body'][_0x5c64('0x4e')]){delete _0x41ba6c[_0x5c64('0x4f')][_0x5c64('0x4e')];}return db[_0x5c64('0x40')]['find']({'where':{'uniqueid':_0x41ba6c[_0x5c64('0x47')]['id']}})[_0x5c64('0x27')](handleEntityNotFound(_0x27cfef,null))[_0x5c64('0x27')](saveUpdates(_0x41ba6c[_0x5c64('0x4f')],null))[_0x5c64('0x27')](respondWithResult(_0x27cfef,null))['catch'](handleError(_0x27cfef,null));}; \ No newline at end of file +var _0x6fa2=['json','undefined','count','offset','limit','set','apply','reject','save','update','then','destroy','end','error','name','send','index','map','CmHopperHistory','fieldName','type','model','query','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x61b3ab,_0x1fc298){var _0x57097f=function(_0x25970b){while(--_0x25970b){_0x61b3ab['push'](_0x61b3ab['shift']());}};_0x57097f(++_0x1fc298);}(_0x6fa2,0x1ac));var _0x26fa=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x6fa2[_0x465a0c];return _0x1e202e;};'use strict';var emlformat=require(_0x26fa('0x0'));var rimraf=require(_0x26fa('0x1'));var zipdir=require(_0x26fa('0x2'));var jsonpatch=require(_0x26fa('0x3'));var rp=require(_0x26fa('0x4'));var moment=require(_0x26fa('0x5'));var BPromise=require(_0x26fa('0x6'));var Mustache=require(_0x26fa('0x7'));var util=require(_0x26fa('0x8'));var path=require(_0x26fa('0x9'));var sox=require(_0x26fa('0xa'));var csv=require(_0x26fa('0xb'));var ejs=require(_0x26fa('0xc'));var fs=require('fs');var fs_extra=require(_0x26fa('0xd'));var _=require('lodash');var squel=require(_0x26fa('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x26fa('0xf'));var toCsv=require(_0x26fa('0xb'));var querystring=require(_0x26fa('0x10'));var Papa=require('papaparse');var Redis=require(_0x26fa('0x11'));var authService=require(_0x26fa('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x26fa('0x13'));var hardwareService=require(_0x26fa('0x14'));var logger=require(_0x26fa('0x15'))('api');var utils=require(_0x26fa('0x16'));var config=require(_0x26fa('0x17'));var licenseUtil=require(_0x26fa('0x18'));var db=require(_0x26fa('0x19'))['db'];function respondWithStatusCode(_0x1e3b79,_0x5bb1b6){_0x5bb1b6=_0x5bb1b6||0xcc;return function(_0x5204ae){if(_0x5204ae){return _0x1e3b79[_0x26fa('0x1a')](_0x5bb1b6);}return _0x1e3b79['status'](_0x5bb1b6)['end']();};}function respondWithResult(_0x1c1eac,_0x3d4677){_0x3d4677=_0x3d4677||0xc8;return function(_0x5d2316){if(_0x5d2316){return _0x1c1eac[_0x26fa('0x1b')](_0x3d4677)[_0x26fa('0x1c')](_0x5d2316);}};}function respondWithFilteredResult(_0x38d117,_0x5f178c){return function(_0x55c4bd){if(_0x55c4bd){var _0x2372f4=typeof _0x5f178c['offset']===_0x26fa('0x1d')&&typeof _0x5f178c['limit']===_0x26fa('0x1d');var _0x39194f=_0x55c4bd[_0x26fa('0x1e')];var _0x455aa8=_0x2372f4?0x0:_0x5f178c[_0x26fa('0x1f')];var _0x2fe244=_0x2372f4?_0x55c4bd[_0x26fa('0x1e')]:_0x5f178c[_0x26fa('0x1f')]+_0x5f178c[_0x26fa('0x20')];var _0xe822dd;if(_0x2fe244>=_0x39194f){_0x2fe244=_0x39194f;_0xe822dd=0xc8;}else{_0xe822dd=0xce;}_0x38d117['status'](_0xe822dd);return _0x38d117[_0x26fa('0x21')]('Content-Range',_0x455aa8+'-'+_0x2fe244+'/'+_0x39194f)[_0x26fa('0x1c')](_0x55c4bd);}return null;};}function patchUpdates(_0x4ed686){return function(_0x109b88){try{jsonpatch[_0x26fa('0x22')](_0x109b88,_0x4ed686,!![]);}catch(_0x7d837b){return BPromise[_0x26fa('0x23')](_0x7d837b);}return _0x109b88[_0x26fa('0x24')]();};}function saveUpdates(_0x24c5cf,_0x62cf21){return function(_0x31e900){if(_0x31e900){return _0x31e900[_0x26fa('0x25')](_0x24c5cf)[_0x26fa('0x26')](function(_0x3ec46b){return _0x3ec46b;});}return null;};}function removeEntity(_0x5ce5d0,_0xe49cd2){return function(_0x389b28){if(_0x389b28){return _0x389b28[_0x26fa('0x27')]()[_0x26fa('0x26')](function(){_0x5ce5d0[_0x26fa('0x1b')](0xcc)[_0x26fa('0x28')]();});}};}function handleEntityNotFound(_0x30c26d,_0xac0d0e){return function(_0x179bf1){if(!_0x179bf1){_0x30c26d[_0x26fa('0x1a')](0x194);}return _0x179bf1;};}function handleError(_0x24d64f,_0x596207){_0x596207=_0x596207||0x1f4;return function(_0x5546b6){logger[_0x26fa('0x29')](_0x5546b6['stack']);if(_0x5546b6['name']){delete _0x5546b6[_0x26fa('0x2a')];}_0x24d64f[_0x26fa('0x1b')](_0x596207)[_0x26fa('0x2b')](_0x5546b6);};}exports[_0x26fa('0x2c')]=function(_0x3d26d7,_0x1e9120){var _0x348264={},_0xe3b0a4={},_0x4bf72d={'count':0x0,'rows':[]};var _0x307111=_[_0x26fa('0x2d')](db[_0x26fa('0x2e')]['rawAttributes'],function(_0x298b7f){return{'name':_0x298b7f[_0x26fa('0x2f')],'type':_0x298b7f[_0x26fa('0x30')]['key']};});_0xe3b0a4[_0x26fa('0x31')]=_[_0x26fa('0x2d')](_0x307111,_0x26fa('0x2a'));_0xe3b0a4[_0x26fa('0x32')]=_['keys'](_0x3d26d7[_0x26fa('0x32')]);_0xe3b0a4['filters']=_[_0x26fa('0x33')](_0xe3b0a4[_0x26fa('0x31')],_0xe3b0a4[_0x26fa('0x32')]);_0x348264[_0x26fa('0x34')]=_[_0x26fa('0x33')](_0xe3b0a4[_0x26fa('0x31')],qs[_0x26fa('0x35')](_0x3d26d7['query'][_0x26fa('0x35')]));_0x348264[_0x26fa('0x34')]=_0x348264[_0x26fa('0x34')][_0x26fa('0x36')]?_0x348264['attributes']:_0xe3b0a4[_0x26fa('0x31')];if(!_0x3d26d7[_0x26fa('0x32')]['hasOwnProperty'](_0x26fa('0x37'))){_0x348264[_0x26fa('0x20')]=qs[_0x26fa('0x20')](_0x3d26d7[_0x26fa('0x32')][_0x26fa('0x20')]);_0x348264[_0x26fa('0x1f')]=qs[_0x26fa('0x1f')](_0x3d26d7[_0x26fa('0x32')][_0x26fa('0x1f')]);}_0x348264['order']=qs[_0x26fa('0x38')](_0x3d26d7['query'][_0x26fa('0x38')]);_0x348264[_0x26fa('0x39')]=qs[_0x26fa('0x3a')](_[_0x26fa('0x3b')](_0x3d26d7[_0x26fa('0x32')],_0xe3b0a4[_0x26fa('0x3a')]),_0x307111);if(_0x3d26d7[_0x26fa('0x32')][_0x26fa('0x3c')]){_0x348264[_0x26fa('0x39')]=_[_0x26fa('0x3d')](_0x348264['where'],{'$or':_[_0x26fa('0x2d')](_0x307111,function(_0x19a4e8){if(_0x19a4e8[_0x26fa('0x30')]!==_0x26fa('0x3e')){var _0x45e6dd={};_0x45e6dd[_0x19a4e8[_0x26fa('0x2a')]]={'$like':'%'+_0x3d26d7[_0x26fa('0x32')][_0x26fa('0x3c')]+'%'};return _0x45e6dd;}})});}_0x348264=_['merge']({},_0x348264,_0x3d26d7[_0x26fa('0x3f')]);var _0x253d40={'where':_0x348264[_0x26fa('0x39')]};return db[_0x26fa('0x2e')]['count'](_0x253d40)[_0x26fa('0x26')](function(_0x3d5f27){_0x4bf72d[_0x26fa('0x1e')]=_0x3d5f27;if(_0x3d26d7[_0x26fa('0x32')][_0x26fa('0x40')]){_0x348264[_0x26fa('0x41')]=[{'all':!![]}];}return db[_0x26fa('0x2e')][_0x26fa('0x42')](_0x348264);})[_0x26fa('0x26')](function(_0x441e5c){_0x4bf72d['rows']=_0x441e5c;return _0x4bf72d;})[_0x26fa('0x26')](respondWithFilteredResult(_0x1e9120,_0x348264))[_0x26fa('0x43')](handleError(_0x1e9120,null));};exports[_0x26fa('0x44')]=function(_0x3e1faa,_0x31cf63){var _0x43c77d={'raw':!![],'where':{'id':_0x3e1faa[_0x26fa('0x45')]['id']}},_0x19e90b={};_0x19e90b[_0x26fa('0x31')]=_[_0x26fa('0x46')](db[_0x26fa('0x2e')]['rawAttributes']);_0x19e90b[_0x26fa('0x32')]=_['keys'](_0x3e1faa[_0x26fa('0x32')]);_0x19e90b[_0x26fa('0x3a')]=_['intersection'](_0x19e90b[_0x26fa('0x31')],_0x19e90b[_0x26fa('0x32')]);_0x43c77d[_0x26fa('0x34')]=_[_0x26fa('0x33')](_0x19e90b[_0x26fa('0x31')],qs['fields'](_0x3e1faa[_0x26fa('0x32')][_0x26fa('0x35')]));_0x43c77d[_0x26fa('0x34')]=_0x43c77d[_0x26fa('0x34')]['length']?_0x43c77d[_0x26fa('0x34')]:_0x19e90b[_0x26fa('0x31')];if(_0x3e1faa[_0x26fa('0x32')][_0x26fa('0x40')]){_0x43c77d[_0x26fa('0x41')]=[{'all':!![]}];}_0x43c77d=_[_0x26fa('0x3d')]({},_0x43c77d,_0x3e1faa[_0x26fa('0x3f')]);return db[_0x26fa('0x2e')][_0x26fa('0x47')](_0x43c77d)[_0x26fa('0x26')](handleEntityNotFound(_0x31cf63,null))['then'](respondWithResult(_0x31cf63,null))[_0x26fa('0x43')](handleError(_0x31cf63,null));};exports['create']=function(_0x2f3ae5,_0x1ce1db){return db[_0x26fa('0x2e')][_0x26fa('0x48')](_0x2f3ae5[_0x26fa('0x49')],{})[_0x26fa('0x26')](respondWithResult(_0x1ce1db,0xc9))['catch'](handleError(_0x1ce1db,null));};exports[_0x26fa('0x4a')]=function(_0x34d272,_0x282501){return db[_0x26fa('0x2e')]['describe']()[_0x26fa('0x26')](respondWithResult(_0x282501,null))[_0x26fa('0x43')](handleError(_0x282501,null));};exports[_0x26fa('0x25')]=function(_0x50d2e3,_0x1a289f){if(_0x50d2e3[_0x26fa('0x49')]['uniqueid']){delete _0x50d2e3['body'][_0x26fa('0x4b')];}return db[_0x26fa('0x2e')]['find']({'where':{'uniqueid':_0x50d2e3[_0x26fa('0x45')]['id']}})[_0x26fa('0x26')](handleEntityNotFound(_0x1a289f,null))['then'](saveUpdates(_0x50d2e3[_0x26fa('0x49')],null))['then'](respondWithResult(_0x1a289f,null))['catch'](handleError(_0x1a289f,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 5cdad8b..26703cd 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 _0x3c91=['util','../../config/logger','bluebird','request-promise','path','../../config/environment','./cmHopperHistory.attributes','exports','cm_hopper_history','endtime','uniqueid','lodash'];(function(_0x1558ab,_0x39d1de){var _0x53b64a=function(_0x4771ed){while(--_0x4771ed){_0x1558ab['push'](_0x1558ab['shift']());}};_0x53b64a(++_0x39d1de);}(_0x3c91,0x1af));var _0x13c9=function(_0x784f54,_0x38b90a){_0x784f54=_0x784f54-0x0;var _0x13c865=_0x3c91[_0x784f54];return _0x13c865;};'use strict';var _=require(_0x13c9('0x0'));var util=require(_0x13c9('0x1'));var logger=require(_0x13c9('0x2'))('api');var moment=require('moment');var BPromise=require(_0x13c9('0x3'));var rp=require(_0x13c9('0x4'));var fs=require('fs');var path=require(_0x13c9('0x5'));var rimraf=require('rimraf');var config=require(_0x13c9('0x6'));var attributes=require(_0x13c9('0x7'));module[_0x13c9('0x8')]=function(_0x8eedb,_0x1c6771){return _0x8eedb['define']('CmHopperHistory',attributes,{'tableName':_0x13c9('0x9'),'paranoid':![],'indexes':[{'name':_0x13c9('0xa'),'fields':[_0x13c9('0xa')]},{'name':_0x13c9('0xb'),'fields':[_0x13c9('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdb7e=['moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb7e,0x11a));var _0xedb7=function(_0x2e54b9,_0x22cb9e){_0x2e54b9=_0x2e54b9-0x0;var _0x3f34e3=_0xdb7e[_0x2e54b9];return _0x3f34e3;};'use strict';var _=require(_0xedb7('0x0'));var util=require(_0xedb7('0x1'));var logger=require(_0xedb7('0x2'))('api');var moment=require(_0xedb7('0x3'));var BPromise=require(_0xedb7('0x4'));var rp=require(_0xedb7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xedb7('0x6'));var config=require(_0xedb7('0x7'));var attributes=require(_0xedb7('0x8'));module[_0xedb7('0x9')]=function(_0xea2925,_0x153a3a){return _0xea2925[_0xedb7('0xa')](_0xedb7('0xb'),attributes,{'tableName':_0xedb7('0xc'),'paranoid':![],'indexes':[{'name':_0xedb7('0xd'),'fields':['endtime']},{'name':_0xedb7('0xe'),'fields':[_0xedb7('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 9ac9579..6157b36 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 _0x6c4b=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','CmHopperHistory,\x20%s,\x20%s','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateCmHopperHistory','create','body','options','raw','catch','AvgHandleTime','CmHopperHistory','sequelize','COUNT','col','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','where','campaign','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','findAll','name','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','randomstring','ioredis'];(function(_0x27fb22,_0xab9f66){var _0x2046fc=function(_0x1a692c){while(--_0x1a692c){_0x27fb22['push'](_0x27fb22['shift']());}};_0x2046fc(++_0xab9f66);}(_0x6c4b,0x93));var _0xb6c4=function(_0x37b713,_0x248677){_0x37b713=_0x37b713-0x0;var _0xae950c=_0x6c4b[_0x37b713];return _0xae950c;};'use strict';var _=require(_0xb6c4('0x0'));var util=require(_0xb6c4('0x1'));var moment=require(_0xb6c4('0x2'));var BPromise=require('bluebird');var rs=require(_0xb6c4('0x3'));var fs=require('fs');var Redis=require(_0xb6c4('0x4'));var db=require(_0xb6c4('0x5'))['db'];var utils=require(_0xb6c4('0x6'));var logger=require(_0xb6c4('0x7'))(_0xb6c4('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb6c4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x109973,_0x38b222,_0x554935){return new BPromise(function(_0x312141,_0x19c12a){return client[_0xb6c4('0xa')](_0x109973,_0x554935)[_0xb6c4('0xb')](function(_0x131e11){logger[_0xb6c4('0xc')](_0xb6c4('0xd'),_0x38b222,'request\x20sent');logger[_0xb6c4('0xe')](_0xb6c4('0xf'),_0x38b222,_0xb6c4('0x10'),JSON[_0xb6c4('0x11')](_0x131e11));if(_0x131e11['error']){if(_0x131e11[_0xb6c4('0x12')][_0xb6c4('0x13')]===0x1f4){logger[_0xb6c4('0x12')](_0xb6c4('0xd'),_0x38b222,_0x131e11[_0xb6c4('0x12')][_0xb6c4('0x14')]);return _0x19c12a(_0x131e11[_0xb6c4('0x12')][_0xb6c4('0x14')]);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x38b222,_0x131e11[_0xb6c4('0x12')]['message']);return _0x312141(_0x131e11[_0xb6c4('0x12')][_0xb6c4('0x14')]);}else{logger[_0xb6c4('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x38b222,_0xb6c4('0x10'));_0x312141(_0x131e11[_0xb6c4('0x15')][_0xb6c4('0x14')]);}})['catch'](function(_0x417e00){logger[_0xb6c4('0x12')](_0xb6c4('0xd'),_0x38b222,_0x417e00);_0x19c12a(_0x417e00);});});}exports[_0xb6c4('0x16')]=function(_0x5566f7){var _0x1002cc=this;return new Promise(function(_0x36929e,_0x55eb35){return db['CmHopperHistory'][_0xb6c4('0x17')](_0x5566f7[_0xb6c4('0x18')],{'raw':_0x5566f7[_0xb6c4('0x19')]?_0x5566f7[_0xb6c4('0x19')][_0xb6c4('0x1a')]===undefined?!![]:![]:!![]})[_0xb6c4('0xb')](function(_0x5a61f7){logger['info'](_0xb6c4('0x16'),_0x5566f7);logger[_0xb6c4('0xe')](_0xb6c4('0x16'),_0x5566f7,JSON[_0xb6c4('0x11')](_0x5a61f7));_0x36929e(_0x5a61f7);})[_0xb6c4('0x1b')](function(_0x8f4a6f){logger[_0xb6c4('0x12')](_0xb6c4('0x16'),_0x8f4a6f[_0xb6c4('0x14')],_0x5566f7);_0x55eb35(_0x1002cc[_0xb6c4('0x12')](0x1f4,_0x8f4a6f[_0xb6c4('0x14')]));});});};exports[_0xb6c4('0x1c')]=function(_0x3341aa){var _0x5da94d=this;return new Promise(function(_0x13d288,_0x11a4ff){return db[_0xb6c4('0x1d')]['findAll']({'raw':_0x3341aa[_0xb6c4('0x19')]?_0x3341aa[_0xb6c4('0x19')][_0xb6c4('0x1a')]===undefined?!![]:![]:!![],'where':_0x3341aa[_0xb6c4('0x19')]?_0x3341aa[_0xb6c4('0x19')]['where']||null:null,'attributes':[[db[_0xb6c4('0x1e')]['fn'](_0xb6c4('0x1f'),db[_0xb6c4('0x1e')][_0xb6c4('0x20')]('id')),'predictiveIntervalTotalCalls'],[db[_0xb6c4('0x1e')]['fn']('COUNT',db[_0xb6c4('0x1e')]['fn']('IF',db['sequelize'][_0xb6c4('0x21')](_0xb6c4('0x22')))),_0xb6c4('0x23')],[db[_0xb6c4('0x1e')]['fn'](_0xb6c4('0x1f'),db[_0xb6c4('0x1e')]['fn']('IF',db[_0xb6c4('0x1e')][_0xb6c4('0x21')](_0xb6c4('0x24')))),_0xb6c4('0x25')],[db[_0xb6c4('0x1e')]['fn'](_0xb6c4('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0xb6c4('0x21')](_0xb6c4('0x26')))),_0xb6c4('0x27')],[db['sequelize']['fn']('AVG',db[_0xb6c4('0x1e')]['fn']('IF',db[_0xb6c4('0x1e')][_0xb6c4('0x21')](_0xb6c4('0x28')))),_0xb6c4('0x29')],[db[_0xb6c4('0x1e')]['fn'](_0xb6c4('0x2a'),db[_0xb6c4('0x1e')]['fn']('IF',db[_0xb6c4('0x1e')]['literal'](_0xb6c4('0x2b')))),_0xb6c4('0x2c')]]})[_0xb6c4('0xb')](function(_0x115edb){logger[_0xb6c4('0xc')](_0xb6c4('0x1c'),_0x3341aa);logger[_0xb6c4('0xe')](_0xb6c4('0x1c'),_0x3341aa,JSON[_0xb6c4('0x11')](_0x115edb));_0x13d288(_0x115edb);})[_0xb6c4('0x1b')](function(_0x2293c1){logger[_0xb6c4('0x12')](_0xb6c4('0x1c'),_0x2293c1['message'],_0x3341aa);_0x11a4ff(_0x5da94d['error'](0x1f4,_0x2293c1[_0xb6c4('0x14')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0xe56d55){var _0x4729f1=this;return new Promise(function(_0x1ed178,_0x386ce3){return db[_0xb6c4('0x1d')]['findAll']({'raw':_0xe56d55[_0xb6c4('0x19')]?_0xe56d55[_0xb6c4('0x19')][_0xb6c4('0x1a')]===undefined?!![]:![]:!![],'where':_0xe56d55[_0xb6c4('0x19')]?_0xe56d55[_0xb6c4('0x19')][_0xb6c4('0x2d')]||null:null,'attributes':[[_0xb6c4('0x2e'),'name'],[db[_0xb6c4('0x1e')]['fn'](_0xb6c4('0x1f'),db[_0xb6c4('0x1e')]['fn']('IF',db[_0xb6c4('0x1e')][_0xb6c4('0x21')]('`state`\x20=\x200,\x201,\x20null'))),_0xb6c4('0x2f')],[db[_0xb6c4('0x1e')]['fn'](_0xb6c4('0x1f'),db['sequelize']['fn']('IF',db[_0xb6c4('0x1e')][_0xb6c4('0x21')](_0xb6c4('0x30')))),_0xb6c4('0x31')],[db[_0xb6c4('0x1e')]['fn'](_0xb6c4('0x1f'),db[_0xb6c4('0x1e')]['fn']('IF',db['sequelize']['literal'](_0xb6c4('0x22')))),_0xb6c4('0x32')],[db[_0xb6c4('0x1e')]['fn'](_0xb6c4('0x1f'),db[_0xb6c4('0x1e')]['fn']('IF',db[_0xb6c4('0x1e')][_0xb6c4('0x21')](_0xb6c4('0x33')))),_0xb6c4('0x34')],[db[_0xb6c4('0x1e')]['fn'](_0xb6c4('0x1f'),db[_0xb6c4('0x1e')]['fn']('IF',db[_0xb6c4('0x1e')]['literal'](_0xb6c4('0x35')))),_0xb6c4('0x36')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb6c4('0x1e')][_0xb6c4('0x21')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xb6c4('0x37')],[db[_0xb6c4('0x1e')]['fn']('COUNT',db[_0xb6c4('0x1e')]['fn']('IF',db[_0xb6c4('0x1e')][_0xb6c4('0x21')](_0xb6c4('0x38')))),_0xb6c4('0x39')],[db[_0xb6c4('0x1e')]['fn']('COUNT',db[_0xb6c4('0x1e')]['fn']('IF',db[_0xb6c4('0x1e')]['literal'](_0xb6c4('0x3a')))),_0xb6c4('0x3b')],[db[_0xb6c4('0x1e')]['fn']('COUNT',db[_0xb6c4('0x1e')]['fn']('IF',db[_0xb6c4('0x1e')][_0xb6c4('0x21')](_0xb6c4('0x3c')))),_0xb6c4('0x3d')],[db['sequelize']['fn'](_0xb6c4('0x1f'),db[_0xb6c4('0x1e')]['fn']('IF',db[_0xb6c4('0x1e')][_0xb6c4('0x21')](_0xb6c4('0x3e')))),'outboundOriginateFailureCallsDay'],[db[_0xb6c4('0x1e')]['fn'](_0xb6c4('0x1f'),db[_0xb6c4('0x1e')]['fn']('IF',db[_0xb6c4('0x1e')][_0xb6c4('0x21')](_0xb6c4('0x3f')))),'outboundRejectCallsDay'],[db[_0xb6c4('0x1e')]['fn']('COUNT',db[_0xb6c4('0x1e')]['fn']('IF',db[_0xb6c4('0x1e')][_0xb6c4('0x21')](_0xb6c4('0x40')))),_0xb6c4('0x41')],[db[_0xb6c4('0x1e')]['fn'](_0xb6c4('0x1f'),db['sequelize']['fn']('IF',db[_0xb6c4('0x1e')]['literal'](_0xb6c4('0x42')))),_0xb6c4('0x43')],[db['sequelize']['fn'](_0xb6c4('0x1f'),db[_0xb6c4('0x1e')]['fn']('IF',db['sequelize'][_0xb6c4('0x21')](_0xb6c4('0x44')))),_0xb6c4('0x45')]],'group':[_0xb6c4('0x2e')]})[_0xb6c4('0xb')](function(_0xd8a683){logger[_0xb6c4('0xc')]('GetVoiceQueueHopperHistory',_0xe56d55);logger['debug']('GetVoiceQueueHopperHistory',_0xe56d55,JSON['stringify'](_0xd8a683));_0x1ed178(_0xd8a683);})[_0xb6c4('0x1b')](function(_0x11cd7e){logger[_0xb6c4('0x12')](_0xb6c4('0x46'),_0x11cd7e[_0xb6c4('0x14')],_0xe56d55);_0x386ce3(_0x4729f1['error'](0x1f4,_0x11cd7e['message']));});});};exports['GetCampaignHopperHistory']=function(_0x5be0b7){var _0x1bc23a=this;return new Promise(function(_0x5a5d39,_0x2bd156){return db[_0xb6c4('0x1d')][_0xb6c4('0x47')]({'raw':_0x5be0b7['options']?_0x5be0b7[_0xb6c4('0x19')][_0xb6c4('0x1a')]===undefined?!![]:![]:!![],'where':_0x5be0b7[_0xb6c4('0x19')]?_0x5be0b7['options']['where']||null:null,'attributes':[[_0xb6c4('0x2e'),_0xb6c4('0x48')],[db['sequelize']['fn'](_0xb6c4('0x1f'),db[_0xb6c4('0x1e')][_0xb6c4('0x20')]('id')),_0xb6c4('0x49')],[db[_0xb6c4('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb6c4('0x1e')]['literal'](_0xb6c4('0x22')))),_0xb6c4('0x4a')]],'group':['campaign']})[_0xb6c4('0xb')](function(_0x35046c){logger[_0xb6c4('0xc')](_0xb6c4('0x4b'),_0x5be0b7);logger[_0xb6c4('0xe')](_0xb6c4('0x4b'),_0x5be0b7,JSON[_0xb6c4('0x11')](_0x35046c));_0x5a5d39(_0x35046c);})[_0xb6c4('0x1b')](function(_0x371519){logger['error'](_0xb6c4('0x4b'),_0x371519['message'],_0x5be0b7);_0x2bd156(_0x1bc23a[_0xb6c4('0x12')](0x1f4,_0x371519[_0xb6c4('0x14')]));});});}; \ No newline at end of file +var _0x7aad=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','stringify','AvgHandleTime','findAll','COUNT','sequelize','col','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','then','GetVoiceQueueHopperHistory','where','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','moment','bluebird'];(function(_0x5cf20d,_0x4ffc0b){var _0x1c0ff0=function(_0x5c1511){while(--_0x5c1511){_0x5cf20d['push'](_0x5cf20d['shift']());}};_0x1c0ff0(++_0x4ffc0b);}(_0x7aad,0x160));var _0xd7aa=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x7aad[_0x3de8a4];return _0x4635cf;};'use strict';var _=require(_0xd7aa('0x0'));var util=require('util');var moment=require(_0xd7aa('0x1'));var BPromise=require(_0xd7aa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd7aa('0x3'));var db=require(_0xd7aa('0x4'))['db'];var utils=require(_0xd7aa('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xd7aa('0x6'));var jayson=require(_0xd7aa('0x7'));var client=jayson[_0xd7aa('0x8')][_0xd7aa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4df120,_0x59023c,_0x2613dd){return new BPromise(function(_0x4bc884,_0x1e4dea){return client[_0xd7aa('0xa')](_0x4df120,_0x2613dd)['then'](function(_0x31d416){logger[_0xd7aa('0xb')](_0xd7aa('0xc'),_0x59023c,_0xd7aa('0xd'));logger[_0xd7aa('0xe')](_0xd7aa('0xf'),_0x59023c,'request\x20sent',JSON['stringify'](_0x31d416));if(_0x31d416[_0xd7aa('0x10')]){if(_0x31d416[_0xd7aa('0x10')][_0xd7aa('0x11')]===0x1f4){logger[_0xd7aa('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x59023c,_0x31d416[_0xd7aa('0x10')][_0xd7aa('0x12')]);return _0x1e4dea(_0x31d416[_0xd7aa('0x10')][_0xd7aa('0x12')]);}logger[_0xd7aa('0x10')](_0xd7aa('0xc'),_0x59023c,_0x31d416['error'][_0xd7aa('0x12')]);return _0x4bc884(_0x31d416[_0xd7aa('0x10')][_0xd7aa('0x12')]);}else{logger[_0xd7aa('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0x59023c,_0xd7aa('0xd'));_0x4bc884(_0x31d416[_0xd7aa('0x13')][_0xd7aa('0x12')]);}})[_0xd7aa('0x14')](function(_0x3b23b7){logger[_0xd7aa('0x10')](_0xd7aa('0xc'),_0x59023c,_0x3b23b7);_0x1e4dea(_0x3b23b7);});});}exports[_0xd7aa('0x15')]=function(_0xf43135){var _0x34a232=this;return new Promise(function(_0x4d842,_0x5300b5){return db[_0xd7aa('0x16')][_0xd7aa('0x17')](_0xf43135[_0xd7aa('0x18')],{'raw':_0xf43135[_0xd7aa('0x19')]?_0xf43135[_0xd7aa('0x19')][_0xd7aa('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x5825a6){logger[_0xd7aa('0xb')]('CreateCmHopperHistory',_0xf43135);logger[_0xd7aa('0xe')](_0xd7aa('0x15'),_0xf43135,JSON[_0xd7aa('0x1b')](_0x5825a6));_0x4d842(_0x5825a6);})[_0xd7aa('0x14')](function(_0x3ff6e5){logger[_0xd7aa('0x10')]('CreateCmHopperHistory',_0x3ff6e5[_0xd7aa('0x12')],_0xf43135);_0x5300b5(_0x34a232[_0xd7aa('0x10')](0x1f4,_0x3ff6e5[_0xd7aa('0x12')]));});});};exports[_0xd7aa('0x1c')]=function(_0x5afc21){var _0x25f575=this;return new Promise(function(_0x11d594,_0x350fa6){return db[_0xd7aa('0x16')][_0xd7aa('0x1d')]({'raw':_0x5afc21[_0xd7aa('0x19')]?_0x5afc21[_0xd7aa('0x19')][_0xd7aa('0x1a')]===undefined?!![]:![]:!![],'where':_0x5afc21[_0xd7aa('0x19')]?_0x5afc21[_0xd7aa('0x19')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0xd7aa('0x1e'),db[_0xd7aa('0x1f')][_0xd7aa('0x20')]('id')),'predictiveIntervalTotalCalls'],[db[_0xd7aa('0x1f')]['fn'](_0xd7aa('0x1e'),db[_0xd7aa('0x1f')]['fn']('IF',db[_0xd7aa('0x1f')][_0xd7aa('0x21')](_0xd7aa('0x22')))),_0xd7aa('0x23')],[db[_0xd7aa('0x1f')]['fn'](_0xd7aa('0x1e'),db[_0xd7aa('0x1f')]['fn']('IF',db[_0xd7aa('0x1f')][_0xd7aa('0x21')](_0xd7aa('0x24')))),_0xd7aa('0x25')],[db[_0xd7aa('0x1f')]['fn'](_0xd7aa('0x1e'),db[_0xd7aa('0x1f')]['fn']('IF',db[_0xd7aa('0x1f')]['literal']('`state`\x20=\x2011,\x201,\x20null'))),_0xd7aa('0x26')],[db[_0xd7aa('0x1f')]['fn']('AVG',db[_0xd7aa('0x1f')]['fn']('IF',db[_0xd7aa('0x1f')][_0xd7aa('0x21')](_0xd7aa('0x27')))),_0xd7aa('0x28')],[db[_0xd7aa('0x1f')]['fn']('AVG',db['sequelize']['fn']('IF',db[_0xd7aa('0x1f')][_0xd7aa('0x21')](_0xd7aa('0x29')))),_0xd7aa('0x2a')]]})[_0xd7aa('0x2b')](function(_0x1e0dc6){logger[_0xd7aa('0xb')](_0xd7aa('0x1c'),_0x5afc21);logger['debug']('AvgHandleTime',_0x5afc21,JSON[_0xd7aa('0x1b')](_0x1e0dc6));_0x11d594(_0x1e0dc6);})[_0xd7aa('0x14')](function(_0x3d30c1){logger[_0xd7aa('0x10')](_0xd7aa('0x1c'),_0x3d30c1[_0xd7aa('0x12')],_0x5afc21);_0x350fa6(_0x25f575[_0xd7aa('0x10')](0x1f4,_0x3d30c1['message']));});});};exports[_0xd7aa('0x2c')]=function(_0x2a44a5){var _0x47135e=this;return new Promise(function(_0x3941c6,_0x58bdfa){return db[_0xd7aa('0x16')][_0xd7aa('0x1d')]({'raw':_0x2a44a5[_0xd7aa('0x19')]?_0x2a44a5['options'][_0xd7aa('0x1a')]===undefined?!![]:![]:!![],'where':_0x2a44a5[_0xd7aa('0x19')]?_0x2a44a5['options'][_0xd7aa('0x2d')]||null:null,'attributes':[[_0xd7aa('0x2e'),_0xd7aa('0x2f')],[db['sequelize']['fn'](_0xd7aa('0x1e'),db[_0xd7aa('0x1f')]['fn']('IF',db[_0xd7aa('0x1f')][_0xd7aa('0x21')](_0xd7aa('0x30')))),'outboundNoSuchCallsDay'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xd7aa('0x1f')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0xd7aa('0x31')],[db[_0xd7aa('0x1f')]['fn']('COUNT',db[_0xd7aa('0x1f')]['fn']('IF',db[_0xd7aa('0x1f')][_0xd7aa('0x21')](_0xd7aa('0x22')))),_0xd7aa('0x32')],[db[_0xd7aa('0x1f')]['fn']('COUNT',db[_0xd7aa('0x1f')]['fn']('IF',db[_0xd7aa('0x1f')][_0xd7aa('0x21')](_0xd7aa('0x33')))),'outboundBusyCallsDay'],[db['sequelize']['fn']('COUNT',db[_0xd7aa('0x1f')]['fn']('IF',db['sequelize'][_0xd7aa('0x21')](_0xd7aa('0x34')))),_0xd7aa('0x35')],[db['sequelize']['fn'](_0xd7aa('0x1e'),db[_0xd7aa('0x1f')]['fn']('IF',db[_0xd7aa('0x1f')]['literal'](_0xd7aa('0x36')))),_0xd7aa('0x37')],[db[_0xd7aa('0x1f')]['fn'](_0xd7aa('0x1e'),db[_0xd7aa('0x1f')]['fn']('IF',db[_0xd7aa('0x1f')][_0xd7aa('0x21')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'outboundDropCallsDayCallersExit'],[db[_0xd7aa('0x1f')]['fn']('COUNT',db[_0xd7aa('0x1f')]['fn']('IF',db[_0xd7aa('0x1f')][_0xd7aa('0x21')](_0xd7aa('0x38')))),_0xd7aa('0x39')],[db['sequelize']['fn']('COUNT',db[_0xd7aa('0x1f')]['fn']('IF',db['sequelize'][_0xd7aa('0x21')](_0xd7aa('0x3a')))),'outboundBlacklistCallsDay'],[db[_0xd7aa('0x1f')]['fn']('COUNT',db[_0xd7aa('0x1f')]['fn']('IF',db[_0xd7aa('0x1f')][_0xd7aa('0x21')](_0xd7aa('0x3b')))),_0xd7aa('0x3c')],[db[_0xd7aa('0x1f')]['fn'](_0xd7aa('0x1e'),db[_0xd7aa('0x1f')]['fn']('IF',db[_0xd7aa('0x1f')][_0xd7aa('0x21')](_0xd7aa('0x3d')))),_0xd7aa('0x3e')],[db[_0xd7aa('0x1f')]['fn'](_0xd7aa('0x1e'),db['sequelize']['fn']('IF',db[_0xd7aa('0x1f')][_0xd7aa('0x21')](_0xd7aa('0x3f')))),_0xd7aa('0x40')],[db[_0xd7aa('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xd7aa('0x1f')]['literal'](_0xd7aa('0x41')))),_0xd7aa('0x3e')],[db['sequelize']['fn'](_0xd7aa('0x1e'),db['sequelize']['fn']('IF',db[_0xd7aa('0x1f')]['literal'](_0xd7aa('0x42')))),_0xd7aa('0x43')]],'group':['campaign']})['then'](function(_0x5f01e7){logger['info']('GetVoiceQueueHopperHistory',_0x2a44a5);logger['debug'](_0xd7aa('0x2c'),_0x2a44a5,JSON[_0xd7aa('0x1b')](_0x5f01e7));_0x3941c6(_0x5f01e7);})[_0xd7aa('0x14')](function(_0x3e61cf){logger[_0xd7aa('0x10')]('GetVoiceQueueHopperHistory',_0x3e61cf[_0xd7aa('0x12')],_0x2a44a5);_0x58bdfa(_0x47135e['error'](0x1f4,_0x3e61cf[_0xd7aa('0x12')]));});});};exports['GetCampaignHopperHistory']=function(_0x1f186c){var _0x3e9465=this;return new Promise(function(_0x4bec5e,_0x56037a){return db[_0xd7aa('0x16')]['findAll']({'raw':_0x1f186c['options']?_0x1f186c[_0xd7aa('0x19')][_0xd7aa('0x1a')]===undefined?!![]:![]:!![],'where':_0x1f186c['options']?_0x1f186c[_0xd7aa('0x19')][_0xd7aa('0x2d')]||null:null,'attributes':[[_0xd7aa('0x2e'),_0xd7aa('0x2f')],[db[_0xd7aa('0x1f')]['fn'](_0xd7aa('0x1e'),db[_0xd7aa('0x1f')][_0xd7aa('0x20')]('id')),_0xd7aa('0x44')],[db['sequelize']['fn']('COUNT',db[_0xd7aa('0x1f')]['fn']('IF',db['sequelize']['literal'](_0xd7aa('0x22')))),_0xd7aa('0x45')]],'group':[_0xd7aa('0x2e')]})['then'](function(_0x284ce9){logger['info']('GetCampaignHopperHistory',_0x1f186c);logger[_0xd7aa('0xe')](_0xd7aa('0x46'),_0x1f186c,JSON[_0xd7aa('0x1b')](_0x284ce9));_0x4bec5e(_0x284ce9);})['catch'](function(_0x47dbb6){logger[_0xd7aa('0x10')](_0xd7aa('0x46'),_0x47dbb6[_0xd7aa('0x12')],_0x1f186c);_0x56037a(_0x3e9465[_0xd7aa('0x10')](0x1f4,_0x47dbb6[_0xd7aa('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 77deb6c..66de4bf 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 _0x641a=['path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','describe','/:id','show','post','put','update','exports','util'];(function(_0xcd29a1,_0x3c5c03){var _0x287370=function(_0x149cde){while(--_0x149cde){_0xcd29a1['push'](_0xcd29a1['shift']());}};_0x287370(++_0x3c5c03);}(_0x641a,0xba));var _0xa641=function(_0x148785,_0x195ee5){_0x148785=_0x148785-0x0;var _0x17a172=_0x641a[_0x148785];return _0x17a172;};'use strict';var multer=require('multer');var util=require(_0xa641('0x0'));var path=require(_0xa641('0x1'));var timeout=require(_0xa641('0x2'));var express=require('express');var router=express[_0xa641('0x3')]();var fs_extra=require(_0xa641('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa641('0x5'));var config=require(_0xa641('0x6'));var controller=require(_0xa641('0x7'));router[_0xa641('0x8')]('/',auth[_0xa641('0x9')](),controller['index']);router[_0xa641('0x8')]('/describe',auth[_0xa641('0x9')](),controller[_0xa641('0xa')]);router[_0xa641('0x8')](_0xa641('0xb'),auth[_0xa641('0x9')](),controller[_0xa641('0xc')]);router[_0xa641('0xd')]('/',auth[_0xa641('0x9')](),controller['create']);router[_0xa641('0xe')](_0xa641('0xb'),auth[_0xa641('0x9')](),controller[_0xa641('0xf')]);module[_0xa641('0x10')]=router; \ No newline at end of file +var _0x75ef=['get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller'];(function(_0x45911d,_0x25b782){var _0x387de2=function(_0x148819){while(--_0x148819){_0x45911d['push'](_0x45911d['shift']());}};_0x387de2(++_0x25b782);}(_0x75ef,0x1e5));var _0xf75e=function(_0x260850,_0xfad029){_0x260850=_0x260850-0x0;var _0x46c475=_0x75ef[_0x260850];return _0x46c475;};'use strict';var multer=require(_0xf75e('0x0'));var util=require('util');var path=require(_0xf75e('0x1'));var timeout=require('connect-timeout');var express=require(_0xf75e('0x2'));var router=express[_0xf75e('0x3')]();var fs_extra=require(_0xf75e('0x4'));var auth=require(_0xf75e('0x5'));var interaction=require(_0xf75e('0x6'));var config=require(_0xf75e('0x7'));var controller=require(_0xf75e('0x8'));router[_0xf75e('0x9')]('/',auth[_0xf75e('0xa')](),controller[_0xf75e('0xb')]);router[_0xf75e('0x9')](_0xf75e('0xc'),auth[_0xf75e('0xa')](),controller[_0xf75e('0xd')]);router[_0xf75e('0x9')](_0xf75e('0xe'),auth[_0xf75e('0xa')](),controller[_0xf75e('0xf')]);router[_0xf75e('0x10')]('/',auth[_0xf75e('0xa')](),controller[_0xf75e('0x11')]);router['put'](_0xf75e('0xe'),auth[_0xf75e('0xa')](),controller[_0xf75e('0x12')]);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 273b03a..c2c5e32 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 _0x97d5=['name','sequelize','exports','STRING'];(function(_0x101338,_0x87b799){var _0x491d4c=function(_0x321399){while(--_0x321399){_0x101338['push'](_0x101338['shift']());}};_0x491d4c(++_0x87b799);}(_0x97d5,0x199));var _0x597d=function(_0x5d96df,_0x1257c){_0x5d96df=_0x5d96df-0x0;var _0x427feb=_0x97d5[_0x5d96df];return _0x427feb;};'use strict';var Sequelize=require(_0x597d('0x0'));module[_0x597d('0x1')]={'name':{'type':Sequelize[_0x597d('0x2')],'unique':_0x597d('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x597d('0x2')]},'dialPrefix':{'type':Sequelize[_0x597d('0x2')]}}; \ No newline at end of file +var _0x0ef0=['sequelize','exports','name','STRING'];(function(_0x482f3c,_0x10c5ed){var _0xcd2a5=function(_0x56785f){while(--_0x56785f){_0x482f3c['push'](_0x482f3c['shift']());}};_0xcd2a5(++_0x10c5ed);}(_0x0ef0,0x80));var _0x00ef=function(_0x2b27a0,_0x2ee33){_0x2b27a0=_0x2b27a0-0x0;var _0x44ec6b=_0x0ef0[_0x2b27a0];return _0x44ec6b;};'use strict';var Sequelize=require(_0x00ef('0x0'));module[_0x00ef('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x00ef('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x00ef('0x3')]},'dialPrefix':{'type':Sequelize[_0x00ef('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index fd6a46b..332b7e6 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 _0x918a=['ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','redis','./cmList.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','get','Lists','UserProfileResource','error','stack','send','index','map','rawAttributes','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','CmList','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','describe','addDisposition','ListId','getDispositions','Disposition','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','success','errors','message','json','Malformed\x20request\x20syntax','CmCustomField','CustomFields','concat','format','cf_%d','getContactsCsv','ContactItemType','select','from','cm_contacts','distinct','customField_','alias','field','item','cm_contact_has_items','ItemTypeId\x20=\x20?','description','description_additionalPhone_','toString','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','addCustomField','findOne','sequelize','transaction','addCustomFields','Sequelize','TEXT','type','text','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','omit','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv'];(function(_0x5a5216,_0x58f544){var _0x1aa577=function(_0x1e0781){while(--_0x1e0781){_0x5a5216['push'](_0x5a5216['shift']());}};_0x1aa577(++_0x58f544);}(_0x918a,0x1cb));var _0xa918=function(_0x1072e3,_0x3f5dad){_0x1072e3=_0x1072e3-0x0;var _0x18679f=_0x918a[_0x1072e3];return _0x18679f;};'use strict';var emlformat=require(_0xa918('0x0'));var rimraf=require(_0xa918('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa918('0x2'));var moment=require(_0xa918('0x3'));var BPromise=require(_0xa918('0x4'));var Mustache=require(_0xa918('0x5'));var util=require(_0xa918('0x6'));var path=require(_0xa918('0x7'));var sox=require('sox');var csv=require(_0xa918('0x8'));var ejs=require(_0xa918('0x9'));var fs=require('fs');var fs_extra=require(_0xa918('0xa'));var _=require(_0xa918('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa918('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa918('0x8'));var querystring=require(_0xa918('0xd'));var Papa=require(_0xa918('0xe'));var Redis=require(_0xa918('0xf'));var authService=require(_0xa918('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa918('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa918('0x12'));var utils=require(_0xa918('0x13'));var config=require(_0xa918('0x14'));var licenseUtil=require(_0xa918('0x15'));var db=require('../../mysqldb')['db'];var csv_results;config[_0xa918('0x16')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa918('0x16')]));require(_0xa918('0x17'))[_0xa918('0x18')](socket);function respondWithStatusCode(_0x3df397,_0x1a4129){_0x1a4129=_0x1a4129||0xcc;return function(_0x1bb3e3){if(_0x1bb3e3){return _0x3df397[_0xa918('0x19')](_0x1a4129);}return _0x3df397[_0xa918('0x1a')](_0x1a4129)[_0xa918('0x1b')]();};}function respondWithResult(_0x53b878,_0x513d7d){_0x513d7d=_0x513d7d||0xc8;return function(_0x287e7f){if(_0x287e7f){return _0x53b878['status'](_0x513d7d)['json'](_0x287e7f);}};}function respondWithFilteredResult(_0x40bf2a,_0x481ea6){return function(_0xe63adb){if(_0xe63adb){var _0x59ee99=typeof _0x481ea6[_0xa918('0x1c')]===_0xa918('0x1d')&&typeof _0x481ea6['limit']===_0xa918('0x1d');var _0x5ba08a=_0xe63adb[_0xa918('0x1e')];var _0x2a27bf=_0x59ee99?0x0:_0x481ea6['offset'];var _0x5af058=_0x59ee99?_0xe63adb[_0xa918('0x1e')]:_0x481ea6[_0xa918('0x1c')]+_0x481ea6[_0xa918('0x1f')];var _0x281121;if(_0x5af058>=_0x5ba08a){_0x5af058=_0x5ba08a;_0x281121=0xc8;}else{_0x281121=0xce;}_0x40bf2a[_0xa918('0x1a')](_0x281121);return _0x40bf2a[_0xa918('0x20')](_0xa918('0x21'),_0x2a27bf+'-'+_0x5af058+'/'+_0x5ba08a)['json'](_0xe63adb);}return null;};}function patchUpdates(_0x5f1451){return function(_0x52631f){try{jsonpatch['apply'](_0x52631f,_0x5f1451,!![]);}catch(_0x4184bc){return BPromise[_0xa918('0x22')](_0x4184bc);}return _0x52631f[_0xa918('0x23')]();};}function saveUpdates(_0xc904cd,_0x22fc8b){return function(_0x49af71){if(_0x49af71){return _0x49af71[_0xa918('0x24')](_0xc904cd)[_0xa918('0x25')](function(_0x136c09){return _0x136c09;});}return null;};}function removeEntity(_0x20c2ab,_0x32a10f){return function(_0x4211a7){if(_0x4211a7){return _0x4211a7[_0xa918('0x26')]()[_0xa918('0x25')](function(){var _0x45858a=_0x4211a7[_0xa918('0x27')]({'plain':!![]});var _0x339aa1=_0xa918('0x28');return db[_0xa918('0x29')][_0xa918('0x26')]({'where':{'type':_0x339aa1,'resourceId':_0x45858a['id']}})[_0xa918('0x25')](function(){return _0x4211a7;});})[_0xa918('0x25')](function(){_0x20c2ab['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x40c7fa,_0x1c49c9){return function(_0x4f3d29){if(!_0x4f3d29){_0x40c7fa[_0xa918('0x19')](0x194);}return _0x4f3d29;};}function handleError(_0x4ae3db,_0x3268f7){_0x3268f7=_0x3268f7||0x1f4;return function(_0x41c3dc){logger[_0xa918('0x2a')](_0x41c3dc[_0xa918('0x2b')]);if(_0x41c3dc['name']){delete _0x41c3dc['name'];}_0x4ae3db['status'](_0x3268f7)[_0xa918('0x2c')](_0x41c3dc);};}exports[_0xa918('0x2d')]=function(_0xcbd43e,_0x66e951){var _0x626b35={},_0x26cc9a={},_0x144aaa={'count':0x0,'rows':[]};var _0x3854c1=_[_0xa918('0x2e')](db['CmList'][_0xa918('0x2f')],function(_0x327bf7){return{'name':_0x327bf7['fieldName'],'type':_0x327bf7['type']['key']};});_0x26cc9a['model']=_[_0xa918('0x2e')](_0x3854c1,_0xa918('0x30'));_0x26cc9a[_0xa918('0x31')]=_[_0xa918('0x32')](_0xcbd43e['query']);_0x26cc9a[_0xa918('0x33')]=_[_0xa918('0x34')](_0x26cc9a[_0xa918('0x35')],_0x26cc9a[_0xa918('0x31')]);_0x626b35[_0xa918('0x36')]=_[_0xa918('0x34')](_0x26cc9a['model'],qs[_0xa918('0x37')](_0xcbd43e[_0xa918('0x31')]['fields']));_0x626b35['attributes']=_0x626b35[_0xa918('0x36')][_0xa918('0x38')]?_0x626b35[_0xa918('0x36')]:_0x26cc9a[_0xa918('0x35')];if(!_0xcbd43e[_0xa918('0x31')][_0xa918('0x39')](_0xa918('0x3a'))){_0x626b35[_0xa918('0x1f')]=qs[_0xa918('0x1f')](_0xcbd43e[_0xa918('0x31')]['limit']);_0x626b35['offset']=qs[_0xa918('0x1c')](_0xcbd43e[_0xa918('0x31')][_0xa918('0x1c')]);}_0x626b35[_0xa918('0x3b')]=qs[_0xa918('0x3c')](_0xcbd43e['query']['sort']);_0x626b35[_0xa918('0x3d')]=qs[_0xa918('0x33')](_[_0xa918('0x3e')](_0xcbd43e[_0xa918('0x31')],_0x26cc9a[_0xa918('0x33')]),_0x3854c1);if(_0xcbd43e[_0xa918('0x31')]['filter']){_0x626b35[_0xa918('0x3d')]=_[_0xa918('0x3f')](_0x626b35[_0xa918('0x3d')],{'$or':_['map'](_0x3854c1,function(_0x3fca40){if(_0x3fca40['type']!==_0xa918('0x40')){var _0x449512={};_0x449512[_0x3fca40[_0xa918('0x30')]]={'$like':'%'+_0xcbd43e[_0xa918('0x31')][_0xa918('0x41')]+'%'};return _0x449512;}})});}_0x626b35=_[_0xa918('0x3f')]({},_0x626b35,_0xcbd43e[_0xa918('0x42')]);var _0x167d90={'where':_0x626b35[_0xa918('0x3d')]};return db[_0xa918('0x43')]['count'](_0x167d90)[_0xa918('0x25')](function(_0x24fff8){_0x144aaa[_0xa918('0x1e')]=_0x24fff8;if(_0xcbd43e[_0xa918('0x31')]['includeAll']){_0x626b35[_0xa918('0x44')]=[{'all':!![]}];}return db['CmList'][_0xa918('0x45')](_0x626b35);})[_0xa918('0x25')](function(_0x1e1b54){_0x144aaa[_0xa918('0x46')]=_0x1e1b54;return _0x144aaa;})['then'](respondWithFilteredResult(_0x66e951,_0x626b35))[_0xa918('0x47')](handleError(_0x66e951,null));};exports[_0xa918('0x48')]=function(_0x44c1d2,_0xab86f9){var _0x5efe55={'raw':![],'where':{'id':_0x44c1d2[_0xa918('0x49')]['id']}},_0x362557={};_0x362557[_0xa918('0x35')]=_[_0xa918('0x32')](db[_0xa918('0x43')][_0xa918('0x2f')]);_0x362557[_0xa918('0x31')]=_[_0xa918('0x32')](_0x44c1d2[_0xa918('0x31')]);_0x362557[_0xa918('0x33')]=_[_0xa918('0x34')](_0x362557[_0xa918('0x35')],_0x362557['query']);_0x5efe55[_0xa918('0x36')]=_[_0xa918('0x34')](_0x362557[_0xa918('0x35')],qs[_0xa918('0x37')](_0x44c1d2[_0xa918('0x31')]['fields']));_0x5efe55[_0xa918('0x36')]=_0x5efe55[_0xa918('0x36')]['length']?_0x5efe55['attributes']:_0x362557['model'];if(_0x44c1d2[_0xa918('0x31')][_0xa918('0x4a')]){_0x5efe55[_0xa918('0x44')]=[{'all':!![]}];}_0x5efe55=_[_0xa918('0x3f')]({},_0x5efe55,_0x44c1d2['options']);return db[_0xa918('0x43')][_0xa918('0x4b')](_0x5efe55)[_0xa918('0x25')](handleEntityNotFound(_0xab86f9,null))[_0xa918('0x25')](respondWithResult(_0xab86f9,null))['catch'](handleError(_0xab86f9,null));};exports[_0xa918('0x4c')]=function(_0x3aa365,_0x2d248b){return db[_0xa918('0x43')]['create'](_0x3aa365[_0xa918('0x4d')],{})[_0xa918('0x25')](function(_0x6aadc3){var _0x49292e=_0x3aa365[_0xa918('0x4e')][_0xa918('0x27')]({'plain':!![]});if(!_0x49292e)throw new Error(_0xa918('0x4f'));if(_0x49292e['role']===_0xa918('0x4e')){var _0x5cb2ad=_0x6aadc3[_0xa918('0x27')]({'plain':!![]});var _0xa12be6=_0xa918('0x28');return db['UserProfileSection'][_0xa918('0x4b')]({'where':{'name':_0xa12be6,'userProfileId':_0x49292e[_0xa918('0x50')]},'raw':!![]})[_0xa918('0x25')](function(_0xdc7da8){if(_0xdc7da8&&_0xdc7da8[_0xa918('0x51')]===0x0){return db[_0xa918('0x29')]['create']({'name':_0x5cb2ad[_0xa918('0x30')],'resourceId':_0x5cb2ad['id'],'type':_0xdc7da8[_0xa918('0x30')],'sectionId':_0xdc7da8['id']},{})['then'](function(){return _0x6aadc3;});}else{return _0x6aadc3;}})[_0xa918('0x47')](function(_0x2c0d51){logger[_0xa918('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c0d51);throw _0x2c0d51;});}return _0x6aadc3;})[_0xa918('0x25')](respondWithResult(_0x2d248b,0xc9))[_0xa918('0x47')](handleError(_0x2d248b,null));};exports[_0xa918('0x24')]=function(_0x11694e,_0x125fa9){if(_0x11694e[_0xa918('0x4d')]['id']){delete _0x11694e[_0xa918('0x4d')]['id'];}return db[_0xa918('0x43')]['find']({'where':{'id':_0x11694e[_0xa918('0x49')]['id']}})[_0xa918('0x25')](handleEntityNotFound(_0x125fa9,null))[_0xa918('0x25')](saveUpdates(_0x11694e['body'],null))[_0xa918('0x25')](respondWithResult(_0x125fa9,null))[_0xa918('0x47')](handleError(_0x125fa9,null));};exports['destroy']=function(_0x4a78a8,_0x17c45b){return db[_0xa918('0x43')]['find']({'where':{'id':_0x4a78a8[_0xa918('0x49')]['id']}})[_0xa918('0x25')](handleEntityNotFound(_0x17c45b,null))[_0xa918('0x25')](removeEntity(_0x17c45b,null))[_0xa918('0x47')](handleError(_0x17c45b,null));};exports[_0xa918('0x52')]=function(_0x1a67ef,_0x374922){return db[_0xa918('0x43')][_0xa918('0x52')]()[_0xa918('0x25')](respondWithResult(_0x374922,null))[_0xa918('0x47')](handleError(_0x374922,null));};exports[_0xa918('0x53')]=function(_0x361183,_0x42c19f,_0x18df4f){if(_0x361183[_0xa918('0x4d')]['id']){delete _0x361183[_0xa918('0x4d')]['id'];}return db['CmList']['find']({'where':{'id':_0x361183[_0xa918('0x49')]['id']}})[_0xa918('0x25')](handleEntityNotFound(_0x42c19f,null))[_0xa918('0x25')](function(_0x48f90c){if(_0x48f90c){_0x361183[_0xa918('0x4d')][_0xa918('0x54')]=_0x48f90c['id'];return db['Disposition'][_0xa918('0x4c')](_0x361183['body']);}})[_0xa918('0x25')](respondWithResult(_0x42c19f,null))[_0xa918('0x47')](handleError(_0x42c19f,null));};exports[_0xa918('0x55')]=function(_0x51f208,_0x401d19,_0x4b0a85){var _0xaf9bd6={'raw':![],'where':{}};var _0x28f9de={};var _0x28c09f={'count':0x0,'rows':[]};return db[_0xa918('0x43')]['findOne']({'where':{'id':_0x51f208[_0xa918('0x49')]['id']}})[_0xa918('0x25')](handleEntityNotFound(_0x401d19,null))['then'](function(_0x209a06){if(_0x209a06){_0x28f9de[_0xa918('0x35')]=_['keys'](db[_0xa918('0x56')][_0xa918('0x2f')]);_0x28f9de[_0xa918('0x31')]=_['keys'](_0x51f208[_0xa918('0x31')]);_0x28f9de[_0xa918('0x33')]=_[_0xa918('0x34')](_0x28f9de[_0xa918('0x35')],_0x28f9de[_0xa918('0x31')]);_0xaf9bd6['attributes']=_[_0xa918('0x34')](_0x28f9de[_0xa918('0x35')],qs['fields'](_0x51f208['query'][_0xa918('0x37')]));_0xaf9bd6['attributes']=_0xaf9bd6['attributes'][_0xa918('0x38')]?_0xaf9bd6[_0xa918('0x36')]:_0x28f9de[_0xa918('0x35')];if(!_0x51f208[_0xa918('0x31')][_0xa918('0x39')](_0xa918('0x3a'))){_0xaf9bd6['limit']=qs[_0xa918('0x1f')](_0x51f208['query'][_0xa918('0x1f')]);_0xaf9bd6[_0xa918('0x1c')]=qs['offset'](_0x51f208['query'][_0xa918('0x1c')]);}_0xaf9bd6['order']=qs[_0xa918('0x3c')](_0x51f208['query'][_0xa918('0x3c')]);_0xaf9bd6[_0xa918('0x3d')]=qs['filters'](_[_0xa918('0x3e')](_0x51f208[_0xa918('0x31')],_0x28f9de[_0xa918('0x33')]));_0xaf9bd6[_0xa918('0x3d')][_0xa918('0x54')]=_0x209a06['id'];if(_0x51f208[_0xa918('0x31')][_0xa918('0x41')]){_0xaf9bd6['where']=_[_0xa918('0x3f')](_0xaf9bd6['where'],{'$or':_[_0xa918('0x2e')](_0xaf9bd6[_0xa918('0x36')],function(_0x280dc3){var _0x491645={};_0x491645[_0x280dc3]={'$like':'%'+_0x51f208['query'][_0xa918('0x41')]+'%'};return _0x491645;})});}_0xaf9bd6=_[_0xa918('0x3f')]({},_0xaf9bd6,_0x51f208[_0xa918('0x42')]);return db[_0xa918('0x56')]['count']({'where':_0xaf9bd6['where']})['then'](function(_0x3f1ac5){_0x28c09f[_0xa918('0x1e')]=_0x3f1ac5;if(_0x51f208[_0xa918('0x31')][_0xa918('0x4a')]){_0xaf9bd6[_0xa918('0x44')]=[{'all':!![]}];}return db['Disposition'][_0xa918('0x45')](_0xaf9bd6);})[_0xa918('0x25')](function(_0x95e472){_0x28c09f[_0xa918('0x46')]=_0x95e472;return _0x28c09f;});}})[_0xa918('0x25')](respondWithFilteredResult(_0x401d19,_0xaf9bd6))[_0xa918('0x47')](handleError(_0x401d19,null));};exports[_0xa918('0x57')]=function(_0x4693af,_0x518983,_0x3b0343){return db[_0xa918('0x43')][_0xa918('0x4b')]({'where':{'id':_0x4693af[_0xa918('0x49')]['id']}})[_0xa918('0x25')](handleEntityNotFound(_0x518983,null))['then'](function(_0xb33648){if(_0xb33648){return _0xb33648['removeDispositions'](_0x4693af[_0xa918('0x31')][_0xa918('0x58')]);}})[_0xa918('0x25')](respondWithStatusCode(_0x518983,null))[_0xa918('0x47')](handleError(_0x518983,null));};exports[_0xa918('0x59')]=function(_0x9f0de5,_0x52246e,_0x20387b){return db[_0xa918('0x43')][_0xa918('0x4b')]({'where':{'id':_0x9f0de5[_0xa918('0x49')]['id']}})['then'](handleEntityNotFound(_0x52246e,null))['then'](function(_0x17bde1){if(_0x17bde1){var _0x3a1767=[];var _0x4a94e2={'success':[],'errors':[]};return db[_0xa918('0x5a')]['describe']()[_0xa918('0x25')](function(_0x41e0c1){if(_0x9f0de5[_0xa918('0x4d')][_0xa918('0x5b')]&&_[_0xa918('0x5c')](_0x9f0de5[_0xa918('0x4d')][_0xa918('0x5b')])){if(_0x9f0de5[_0xa918('0x4d')]['tags']['length']){_0x9f0de5[_0xa918('0x4d')][_0xa918('0x5b')]=_0x9f0de5[_0xa918('0x4d')][_0xa918('0x5b')][_0xa918('0x5d')](';')+';';}else{_0x9f0de5[_0xa918('0x4d')][_0xa918('0x5b')]=null;}}else{_0x9f0de5[_0xa918('0x4d')]['tags']=null;}if(_0x9f0de5['body']&&_['isArray'](_0x9f0de5['body'])){for(var _0xb930bb=0x0;_0xb930bb<_0x9f0de5['body'][_0xa918('0x38')];_0xb930bb+=0x1){_0x9f0de5[_0xa918('0x4d')][_0xb930bb][_0xa918('0x54')]=_0x9f0de5[_0xa918('0x49')]['id'];_0x3a1767[_0xa918('0x5e')](_0x9f0de5['body'][_0xb930bb]);}return BPromise[_0xa918('0x5f')](_0x3a1767,function(_0x4cb8d5){return db[_0xa918('0x5a')][_0xa918('0x4c')](_['omit'](_0x4cb8d5,[_0xa918('0x58'),'id'])||{},{'fields':_[_0xa918('0x32')](_0x41e0c1),'raw':!![]})[_0xa918('0x25')](function(_0x5ebb5f){_0x4a94e2[_0xa918('0x60')][_0xa918('0x5e')](_0x5ebb5f['dataValues']);})[_0xa918('0x47')](function(_0x36b9ae){_0x4a94e2[_0xa918('0x61')][_0xa918('0x5e')]({'data':_0x4cb8d5,'error':_0x36b9ae[_0xa918('0x62')]});});})[_0xa918('0x25')](function(_0x3e0fc8){return _0x4a94e2;})[_0xa918('0x47')](function(_0x40ea2b){return _0x40ea2b;});}else{_0x52246e[_0xa918('0x1a')](0x190)[_0xa918('0x63')]({'message':_0xa918('0x64')});}});}})[_0xa918('0x25')](respondWithResult(_0x52246e,null))[_0xa918('0x47')](handleError(_0x52246e,null));};exports['getContacts']=function(_0x505070,_0x513ce8,_0x66e704){var _0x309741;return db[_0xa918('0x43')]['find']({'where':{'id':_0x505070[_0xa918('0x49')]['id']},'include':[{'model':db[_0xa918('0x65')],'as':_0xa918('0x66')}]})['then'](handleEntityNotFound(_0x513ce8,null))[_0xa918('0x25')](function(_0x47da2a){if(_0x47da2a){_0x309741=_0x47da2a;return db[_0xa918('0x5a')][_0xa918('0x2f')];}})[_0xa918('0x25')](function(_0xb356ca){if(_0xb356ca){var _0x27c1e5={};var _0x473349={};_0x473349[_0xa918('0x35')]=_[_0xa918('0x67')](_['keys'](_0xb356ca),_['map'](_0x309741['CustomFields'],function(_0x57bdf0){return util[_0xa918('0x68')](_0xa918('0x69'),_0x57bdf0['id']);}));_0x473349[_0xa918('0x31')]=_[_0xa918('0x32')](_0x505070[_0xa918('0x31')]);_0x473349[_0xa918('0x33')]=_[_0xa918('0x34')](_0x473349[_0xa918('0x35')],_0x473349[_0xa918('0x31')]);_0x27c1e5[_0xa918('0x36')]=_[_0xa918('0x34')](_0x473349[_0xa918('0x35')],qs['fields'](_0x505070[_0xa918('0x31')][_0xa918('0x37')]));_0x27c1e5[_0xa918('0x36')]=_0x27c1e5[_0xa918('0x36')][_0xa918('0x38')]?_0x27c1e5['attributes']:_0x473349[_0xa918('0x35')];if(!_0x505070[_0xa918('0x31')][_0xa918('0x39')](_0xa918('0x3a'))){_0x27c1e5[_0xa918('0x1f')]=qs[_0xa918('0x1f')](_0x505070[_0xa918('0x31')]['limit']);_0x27c1e5[_0xa918('0x1c')]=qs[_0xa918('0x1c')](_0x505070[_0xa918('0x31')]['offset']);}_0x27c1e5[_0xa918('0x3b')]=qs['sort'](_0x505070[_0xa918('0x31')][_0xa918('0x3c')]);_0x27c1e5['where']=qs['filters'](_[_0xa918('0x3e')](_0x505070[_0xa918('0x31')],_0x473349[_0xa918('0x33')]));_0x27c1e5['raw']=!![];if(_0x505070['query'][_0xa918('0x41')]){_0x27c1e5[_0xa918('0x3d')]=_[_0xa918('0x3f')](_0x27c1e5['where'],{'$or':_[_0xa918('0x2e')](_0x27c1e5[_0xa918('0x36')],function(_0x5b9c76){var _0x510cb6={};_0x510cb6[_0x5b9c76]={'$like':'%'+_0x505070['query']['filter']+'%'};return _0x510cb6;})});}_0x27c1e5=_[_0xa918('0x3f')]({},_0x27c1e5,_0x505070[_0xa918('0x42')]);return _0x309741['getContacts'](_0x27c1e5);}})[_0xa918('0x25')](respondWithResult(_0x513ce8,null))[_0xa918('0x47')](handleError(_0x513ce8,null));};exports[_0xa918('0x6a')]=function(_0x4bdcdc,_0x28a9c0,_0x5ca0a5){var _0x21a777;var _0x39f867;var _0x28364a;var _0x562570=_0x4bdcdc[_0xa918('0x49')]['id'];csv_results=[];return db[_0xa918('0x6b')][_0xa918('0x45')]({'attributes':['id',_0xa918('0x30')],'raw':!![],'order':['OrderBy']})[_0xa918('0x25')](function(_0x4cc2e5){_0x21a777=_0x4cc2e5;var _0x52c797=_[_0xa918('0x32')](db[_0xa918('0x5a')][_0xa918('0x2f')]);return db[_0xa918('0x65')][_0xa918('0x45')]({'raw':!![],'attributes':['id','alias']})[_0xa918('0x25')](function(_0x194e64){_0x39f867=_0x194e64;var _0x3aeaca=squel[_0xa918('0x6c')]()[_0xa918('0x37')](_0x52c797)[_0xa918('0x6d')](_0xa918('0x6e'),'c')[_0xa918('0x3d')]('c.ListId\x20=\x20?',_0x562570)['where']('c.deletedAt\x20is\x20null')[_0xa918('0x6f')]();for(var _0x44085a=0x0;_0x44085a<_0x39f867[_0xa918('0x38')];_0x44085a++){_0x3aeaca['field']('c.cf_'+_0x39f867[_0x44085a]['id'],_0xa918('0x70')+_0x39f867[_0x44085a][_0xa918('0x71')]);}for(var _0x44085a=0x0;_0x44085a<_0x21a777[_0xa918('0x38')];_0x44085a++){_0x3aeaca[_0xa918('0x72')](squel[_0xa918('0x6c')]()[_0xa918('0x72')](_0xa918('0x73'))[_0xa918('0x6d')](_0xa918('0x74'))[_0xa918('0x3d')](_0xa918('0x75'),_0x21a777[_0x44085a]['id'])[_0xa918('0x3d')]('CmContactId\x20=\x20c.id'),'additionalPhone_'+_0x21a777[_0x44085a][_0xa918('0x30')]);_0x3aeaca[_0xa918('0x72')](squel[_0xa918('0x6c')]()[_0xa918('0x72')](_0xa918('0x76'))[_0xa918('0x6d')](_0xa918('0x74'))[_0xa918('0x3d')](_0xa918('0x75'),_0x21a777[_0x44085a]['id'])['where']('CmContactId\x20=\x20c.id'),_0xa918('0x77')+_0x21a777[_0x44085a][_0xa918('0x30')]);}var _0x7100e6=[];_0x7100e6[_0xa918('0x5e')](_0x3aeaca[_0xa918('0x78')]());BPromise[_0xa918('0x5f')](_0x7100e6,handleQuery)[_0xa918('0x25')](function(_0x17e12a){handleQuery(_0x3aeaca[_0xa918('0x78')]());var _0x351b1f=csv_results[0x0];if(!_[_0xa918('0x79')](_0x351b1f)){var _0x5cf22b=toCsv(_0x351b1f);var _0x573f88=Date['now']();fs[_0xa918('0x7a')](util[_0xa918('0x68')](_0xa918('0x7b'),_0x562570,_0x573f88),_0x5cf22b);_0x28a9c0[_0xa918('0x7c')]('Content-disposition',_0xa918('0x7d')+util[_0xa918('0x68')](_0xa918('0x7e'),_0x562570,_0x573f88));_0x28a9c0[_0xa918('0x7c')](_0xa918('0x7f'),_0xa918('0x80'));return _0x28a9c0['download'](util[_0xa918('0x68')](_0xa918('0x7b'),_0x562570,_0x573f88));}else{return _0x28a9c0[_0xa918('0x19')](0xcc);}});});});};exports[_0xa918('0x81')]=function(_0x2c655b,_0x2b2c4c,_0x168fa9){var _0x2b09b8;delete _0x2c655b['body']['id'];return db[_0xa918('0x43')][_0xa918('0x82')]({'where':{'id':_0x2c655b['params']['id']}})[_0xa918('0x25')](handleEntityNotFound(_0x2b2c4c,null))[_0xa918('0x25')](function(_0x386581){if(_0x386581){return db[_0xa918('0x83')][_0xa918('0x84')](function(_0x145f7e){return db[_0xa918('0x65')][_0xa918('0x4c')](_0x2c655b[_0xa918('0x4d')],{'transaction':_0x145f7e})['then'](function(_0x26c3d3){_0x2b09b8=_0x26c3d3;return _0x386581[_0xa918('0x85')](_0x26c3d3,{'transaction':_0x145f7e});})[_0xa918('0x25')](function(){var _0x4a41eb={'type':db[_0xa918('0x86')][_0xa918('0x87')],'transaction':_0x145f7e};switch(_0x2c655b[_0xa918('0x4d')][_0xa918('0x88')]){case _0xa918('0x89'):_0x4a41eb[_0xa918('0x88')]=db[_0xa918('0x86')]['TEXT'];break;case _0xa918('0x8a'):_0x4a41eb[_0xa918('0x88')]=db[_0xa918('0x86')][_0xa918('0x8b')];break;case _0xa918('0x8c'):_0x4a41eb[_0xa918('0x88')]=db[_0xa918('0x86')][_0xa918('0x8d')];_0x4a41eb[_0xa918('0x8e')]=![];break;default:}return db[_0xa918('0x83')]['queryInterface'][_0xa918('0x8f')]('cm_contacts',util[_0xa918('0x68')]('cf_%s',_0x2b09b8['id']),_0x4a41eb);})[_0xa918('0x25')](function(){return _0x2b09b8;});});}})[_0xa918('0x25')](respondWithResult(_0x2b2c4c,null))[_0xa918('0x47')](handleError(_0x2b2c4c,null));};exports[_0xa918('0x90')]=function(_0x2e5023,_0x245d14,_0x2636d3){var _0x3f8143={};var _0x4b8433={};var _0x48ce29;var _0x1bd244;return db[_0xa918('0x43')][_0xa918('0x82')]({'where':{'id':_0x2e5023['params']['id']}})[_0xa918('0x25')](handleEntityNotFound(_0x245d14,null))[_0xa918('0x25')](function(_0x232f2c){if(_0x232f2c){_0x48ce29=_0x232f2c;_0x4b8433[_0xa918('0x35')]=_['keys'](db['CmCustomField'][_0xa918('0x2f')]);_0x4b8433[_0xa918('0x31')]=_[_0xa918('0x32')](_0x2e5023[_0xa918('0x31')]);_0x4b8433[_0xa918('0x33')]=_['intersection'](_0x4b8433['model'],_0x4b8433[_0xa918('0x31')]);_0x3f8143[_0xa918('0x36')]=_[_0xa918('0x34')](_0x4b8433[_0xa918('0x35')],qs['fields'](_0x2e5023[_0xa918('0x31')]['fields']));_0x3f8143[_0xa918('0x36')]=_0x3f8143[_0xa918('0x36')][_0xa918('0x38')]?_0x3f8143['attributes']:_0x4b8433[_0xa918('0x35')];_0x3f8143['order']=qs[_0xa918('0x3c')](_0x2e5023[_0xa918('0x31')]['sort']);_0x3f8143['where']=qs['filters'](_[_0xa918('0x3e')](_0x2e5023[_0xa918('0x31')],_0x4b8433[_0xa918('0x33')]));_0x3f8143['where']=_[_0xa918('0x3f')](_0x3f8143[_0xa918('0x3d')],{'$or':[{'ListId':_0x232f2c['id']},{'ListId':null}]});if(_0x2e5023['query']['filter']){_0x3f8143[_0xa918('0x3d')]=_['merge'](_0x3f8143[_0xa918('0x3d')],{'$or':_[_0xa918('0x2e')](_0x3f8143['attributes'],function(_0x471038){var _0x583bd1={};_0x583bd1[_0x471038]={'$like':'%'+_0x2e5023[_0xa918('0x31')]['filter']+'%'};return _0x583bd1;})});}_0x3f8143=_[_0xa918('0x3f')]({},_0x3f8143,_0x2e5023[_0xa918('0x42')]);return db[_0xa918('0x65')][_0xa918('0x91')](_0x3f8143);}})[_0xa918('0x25')](respondWithResult(_0x245d14,null))[_0xa918('0x47')](handleError(_0x245d14,null));};exports[_0xa918('0x92')]=function(_0x2a3e80,_0x297794){return db[_0xa918('0x65')][_0xa918('0x91')]({'where':{'ListId':null}})[_0xa918('0x25')](handleEntityNotFound(_0x297794,null))['then'](function(_0x7f1c61){return _0x7f1c61;})[_0xa918('0x25')](respondWithResult(_0x297794,null))[_0xa918('0x47')](handleError(_0x297794,null));};exports['addAgents']=function(_0x385831,_0x3f8d74,_0x5e358f){return db['CmList'][_0xa918('0x4b')]({'where':{'id':_0x385831[_0xa918('0x49')]['id']}})[_0xa918('0x25')](handleEntityNotFound(_0x3f8d74,null))['then'](function(_0x414f07){if(_0x414f07){return _0x414f07[_0xa918('0x93')](_0x385831[_0xa918('0x4d')][_0xa918('0x58')],_[_0xa918('0x94')](_0x385831[_0xa918('0x4d')],['ids','id'])||{})[_0xa918('0x95')](function(_0x5a59bd){for(var _0x31a0d5=0x0;_0x31a0d5<_0x385831[_0xa918('0x4d')][_0xa918('0x58')]['length'];_0x31a0d5+=0x1){socket[_0xa918('0x96')](_0xa918('0x97'),{'UserId':Number(_0x385831[_0xa918('0x4d')][_0xa918('0x58')][_0x31a0d5]),'CmListId':Number(_0x385831[_0xa918('0x49')]['id'])});}return _0x5a59bd;});}})[_0xa918('0x25')](respondWithResult(_0x3f8d74,null))['catch'](handleError(_0x3f8d74,null));};exports[_0xa918('0x98')]=function(_0x1481b8,_0x58dd88,_0x71e1d8){return db['CmList'][_0xa918('0x4b')]({'where':{'id':_0x1481b8['params']['id']}})[_0xa918('0x25')](handleEntityNotFound(_0x58dd88,null))[_0xa918('0x25')](function(_0x53153){if(_0x53153){return _0x53153[_0xa918('0x98')](_0x1481b8[_0xa918('0x31')][_0xa918('0x58')])['then'](function(){if(_[_0xa918('0x5c')](_0x1481b8[_0xa918('0x31')][_0xa918('0x58')])){for(var _0x9c556b=0x0;_0x9c556b<_0x1481b8[_0xa918('0x31')][_0xa918('0x58')][_0xa918('0x38')];_0x9c556b+=0x1){socket[_0xa918('0x96')](_0xa918('0x99'),{'UserId':Number(_0x1481b8[_0xa918('0x31')][_0xa918('0x58')][_0x9c556b]),'CmListId':Number(_0x1481b8[_0xa918('0x49')]['id'])});}}else{socket[_0xa918('0x96')](_0xa918('0x99'),{'UserId':Number(_0x1481b8[_0xa918('0x31')][_0xa918('0x58')]),'CmListId':Number(_0x1481b8[_0xa918('0x49')]['id'])});}});}})[_0xa918('0x25')](respondWithStatusCode(_0x58dd88,null))['catch'](handleError(_0x58dd88,null));};exports[_0xa918('0x9a')]=function(_0x2fc330,_0x1692e6,_0x19a625){var _0x5b5aeb={};var _0x179295={};var _0x2dd4f5;var _0x419bb6;return db[_0xa918('0x43')][_0xa918('0x82')]({'where':{'id':_0x2fc330[_0xa918('0x49')]['id']}})[_0xa918('0x25')](handleEntityNotFound(_0x1692e6,null))['then'](function(_0x292f04){if(_0x292f04){_0x2dd4f5=_0x292f04;_0x179295[_0xa918('0x35')]=_[_0xa918('0x32')](db[_0xa918('0x9b')]['rawAttributes']);_0x179295[_0xa918('0x31')]=_[_0xa918('0x32')](_0x2fc330[_0xa918('0x31')]);_0x179295[_0xa918('0x33')]=_[_0xa918('0x34')](_0x179295[_0xa918('0x35')],_0x179295[_0xa918('0x31')]);_0x5b5aeb[_0xa918('0x36')]=_[_0xa918('0x34')](_0x179295['model'],qs[_0xa918('0x37')](_0x2fc330[_0xa918('0x31')][_0xa918('0x37')]));_0x5b5aeb['attributes']=_0x5b5aeb['attributes'][_0xa918('0x38')]?_0x5b5aeb['attributes']:_0x179295[_0xa918('0x35')];_0x5b5aeb['order']=qs[_0xa918('0x3c')](_0x2fc330[_0xa918('0x31')][_0xa918('0x3c')]);_0x5b5aeb['where']=qs[_0xa918('0x33')](_[_0xa918('0x3e')](_0x2fc330[_0xa918('0x31')],_0x179295[_0xa918('0x33')]));if(_0x2fc330['query'][_0xa918('0x41')]){_0x5b5aeb['where']=_['merge'](_0x5b5aeb[_0xa918('0x3d')],{'$or':_[_0xa918('0x2e')](_0x5b5aeb[_0xa918('0x36')],function(_0x1b160f){var _0x5c0453={};_0x5c0453[_0x1b160f]={'$like':'%'+_0x2fc330[_0xa918('0x31')][_0xa918('0x41')]+'%'};return _0x5c0453;})});}_0x5b5aeb=_['merge']({},_0x5b5aeb,_0x2fc330['options']);return _0x2dd4f5['getAgents'](_0x5b5aeb);}})[_0xa918('0x25')](function(_0x198709){if(_0x198709){_0x419bb6=_0x198709[_0xa918('0x38')];if(!_0x2fc330[_0xa918('0x31')][_0xa918('0x39')]('nolimit')){_0x5b5aeb['limit']=qs['limit'](_0x2fc330[_0xa918('0x31')][_0xa918('0x1f')]);_0x5b5aeb[_0xa918('0x1c')]=qs[_0xa918('0x1c')](_0x2fc330[_0xa918('0x31')]['offset']);}return _0x2dd4f5[_0xa918('0x9a')](_0x5b5aeb);}})[_0xa918('0x25')](function(_0x51ac79){if(_0x51ac79){return _0x51ac79?{'count':_0x419bb6,'rows':_0x51ac79}:null;}})[_0xa918('0x25')](respondWithResult(_0x1692e6,null))['catch'](handleError(_0x1692e6,null));};function handleQuery(_0x9a9929){logger['info'](_0x9a9929);return db['sequelize']['query'](_0x9a9929)['spread'](function(_0x13925f){csv_results[_0xa918('0x5e')](_0x13925f);})[_0xa918('0x47')](function(_0x46c30f){logger[_0xa918('0x2a')](_0x46c30f[_0xa918('0x62')]);});} \ No newline at end of file +var _0x7c39=['merge','options','includeAll','include','catch','show','params','keys','length','find','create','body','user','get','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','ListId','Disposition','getDispositions','nolimit','findAll','removeDispositions','ids','addContacts','CmContact','describe','isArray','tags','each','omit','dataValues','push','message','getContacts','CmCustomField','concat','CustomFields','cf_%d','raw','getContactsCsv','ContactItemType','OrderBy','from','cm_contacts','c.deletedAt\x20is\x20null','distinct','c.cf_','customField_','alias','select','field','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','toString','isEmpty','format','setHeader','Content-disposition','Content-type','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','findOne','sequelize','addCustomFields','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','removeAgents','emit','userCmList:remove','getAgents','User','info','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','register','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Lists','UserProfileResource','sendStatus','error','stack','name','send','index','CmList','rawAttributes','fieldName','type','model','map','filters','intersection','query','attributes','fields','hasOwnProperty','order','sort','pick','filter','where'];(function(_0x3360c8,_0x33a08a){var _0xf72c9c=function(_0x1dd036){while(--_0x1dd036){_0x3360c8['push'](_0x3360c8['shift']());}};_0xf72c9c(++_0x33a08a);}(_0x7c39,0xfc));var _0x97c3=function(_0x375c0d,_0x2fb174){_0x375c0d=_0x375c0d-0x0;var _0x59a02d=_0x7c39[_0x375c0d];return _0x59a02d;};'use strict';var emlformat=require(_0x97c3('0x0'));var rimraf=require(_0x97c3('0x1'));var zipdir=require(_0x97c3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x97c3('0x3'));var BPromise=require(_0x97c3('0x4'));var Mustache=require(_0x97c3('0x5'));var util=require(_0x97c3('0x6'));var path=require('path');var sox=require(_0x97c3('0x7'));var csv=require(_0x97c3('0x8'));var ejs=require(_0x97c3('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x97c3('0xa'));var squel=require(_0x97c3('0xb'));var crypto=require(_0x97c3('0xc'));var jsforce=require(_0x97c3('0xd'));var deskjs=require(_0x97c3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x97c3('0xf'));var Papa=require(_0x97c3('0x10'));var Redis=require('ioredis');var authService=require(_0x97c3('0x11'));var qs=require(_0x97c3('0x12'));var as=require(_0x97c3('0x13'));var hardwareService=require(_0x97c3('0x14'));var logger=require(_0x97c3('0x15'))(_0x97c3('0x16'));var utils=require(_0x97c3('0x17'));var config=require(_0x97c3('0x18'));var licenseUtil=require(_0x97c3('0x19'));var db=require('../../mysqldb')['db'];var csv_results;config[_0x97c3('0x1a')]=_['defaults'](config[_0x97c3('0x1a')],{'host':_0x97c3('0x1b'),'port':0x18eb});var socket=require(_0x97c3('0x1c'))(new Redis(config['redis']));require('./cmList.socket')[_0x97c3('0x1d')](socket);function respondWithStatusCode(_0x378941,_0x61f9c3){_0x61f9c3=_0x61f9c3||0xcc;return function(_0x4f5e73){if(_0x4f5e73){return _0x378941['sendStatus'](_0x61f9c3);}return _0x378941['status'](_0x61f9c3)[_0x97c3('0x1e')]();};}function respondWithResult(_0x566d88,_0x3122d2){_0x3122d2=_0x3122d2||0xc8;return function(_0x155b5a){if(_0x155b5a){return _0x566d88[_0x97c3('0x1f')](_0x3122d2)[_0x97c3('0x20')](_0x155b5a);}};}function respondWithFilteredResult(_0x2950a5,_0x2c9cf1){return function(_0x52b3a4){if(_0x52b3a4){var _0x193d36=typeof _0x2c9cf1[_0x97c3('0x21')]===_0x97c3('0x22')&&typeof _0x2c9cf1[_0x97c3('0x23')]==='undefined';var _0x59f3c4=_0x52b3a4[_0x97c3('0x24')];var _0x181309=_0x193d36?0x0:_0x2c9cf1[_0x97c3('0x21')];var _0x3c4ae7=_0x193d36?_0x52b3a4[_0x97c3('0x24')]:_0x2c9cf1[_0x97c3('0x21')]+_0x2c9cf1[_0x97c3('0x23')];var _0x15f186;if(_0x3c4ae7>=_0x59f3c4){_0x3c4ae7=_0x59f3c4;_0x15f186=0xc8;}else{_0x15f186=0xce;}_0x2950a5[_0x97c3('0x1f')](_0x15f186);return _0x2950a5[_0x97c3('0x25')](_0x97c3('0x26'),_0x181309+'-'+_0x3c4ae7+'/'+_0x59f3c4)['json'](_0x52b3a4);}return null;};}function patchUpdates(_0x47a49f){return function(_0x11a3ec){try{jsonpatch[_0x97c3('0x27')](_0x11a3ec,_0x47a49f,!![]);}catch(_0x2f20c1){return BPromise[_0x97c3('0x28')](_0x2f20c1);}return _0x11a3ec[_0x97c3('0x29')]();};}function saveUpdates(_0x5d9656,_0x345822){return function(_0x44a9b4){if(_0x44a9b4){return _0x44a9b4[_0x97c3('0x2a')](_0x5d9656)[_0x97c3('0x2b')](function(_0x17689c){return _0x17689c;});}return null;};}function removeEntity(_0x9695ff,_0x24002b){return function(_0x6c2c9e){if(_0x6c2c9e){return _0x6c2c9e[_0x97c3('0x2c')]()[_0x97c3('0x2b')](function(){var _0x3646cc=_0x6c2c9e['get']({'plain':!![]});var _0x3be85a=_0x97c3('0x2d');return db[_0x97c3('0x2e')][_0x97c3('0x2c')]({'where':{'type':_0x3be85a,'resourceId':_0x3646cc['id']}})['then'](function(){return _0x6c2c9e;});})[_0x97c3('0x2b')](function(){_0x9695ff[_0x97c3('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d7e99,_0x5da9bb){return function(_0x43fe06){if(!_0x43fe06){_0x4d7e99[_0x97c3('0x2f')](0x194);}return _0x43fe06;};}function handleError(_0x26b93f,_0x57f829){_0x57f829=_0x57f829||0x1f4;return function(_0x45f2d5){logger[_0x97c3('0x30')](_0x45f2d5[_0x97c3('0x31')]);if(_0x45f2d5[_0x97c3('0x32')]){delete _0x45f2d5[_0x97c3('0x32')];}_0x26b93f['status'](_0x57f829)[_0x97c3('0x33')](_0x45f2d5);};}exports[_0x97c3('0x34')]=function(_0x2d287b,_0x11a854){var _0xa1ceb5={},_0x2cafe4={},_0x281968={'count':0x0,'rows':[]};var _0x236d55=_['map'](db[_0x97c3('0x35')][_0x97c3('0x36')],function(_0x4a6af6){return{'name':_0x4a6af6[_0x97c3('0x37')],'type':_0x4a6af6[_0x97c3('0x38')]['key']};});_0x2cafe4[_0x97c3('0x39')]=_[_0x97c3('0x3a')](_0x236d55,_0x97c3('0x32'));_0x2cafe4['query']=_['keys'](_0x2d287b['query']);_0x2cafe4[_0x97c3('0x3b')]=_[_0x97c3('0x3c')](_0x2cafe4[_0x97c3('0x39')],_0x2cafe4[_0x97c3('0x3d')]);_0xa1ceb5[_0x97c3('0x3e')]=_[_0x97c3('0x3c')](_0x2cafe4[_0x97c3('0x39')],qs[_0x97c3('0x3f')](_0x2d287b[_0x97c3('0x3d')][_0x97c3('0x3f')]));_0xa1ceb5[_0x97c3('0x3e')]=_0xa1ceb5[_0x97c3('0x3e')]['length']?_0xa1ceb5[_0x97c3('0x3e')]:_0x2cafe4[_0x97c3('0x39')];if(!_0x2d287b[_0x97c3('0x3d')][_0x97c3('0x40')]('nolimit')){_0xa1ceb5[_0x97c3('0x23')]=qs[_0x97c3('0x23')](_0x2d287b[_0x97c3('0x3d')]['limit']);_0xa1ceb5[_0x97c3('0x21')]=qs[_0x97c3('0x21')](_0x2d287b[_0x97c3('0x3d')]['offset']);}_0xa1ceb5[_0x97c3('0x41')]=qs[_0x97c3('0x42')](_0x2d287b[_0x97c3('0x3d')][_0x97c3('0x42')]);_0xa1ceb5['where']=qs[_0x97c3('0x3b')](_[_0x97c3('0x43')](_0x2d287b[_0x97c3('0x3d')],_0x2cafe4['filters']),_0x236d55);if(_0x2d287b['query'][_0x97c3('0x44')]){_0xa1ceb5[_0x97c3('0x45')]=_[_0x97c3('0x46')](_0xa1ceb5[_0x97c3('0x45')],{'$or':_[_0x97c3('0x3a')](_0x236d55,function(_0x551fab){if(_0x551fab['type']!=='VIRTUAL'){var _0x4554c5={};_0x4554c5[_0x551fab[_0x97c3('0x32')]]={'$like':'%'+_0x2d287b['query'][_0x97c3('0x44')]+'%'};return _0x4554c5;}})});}_0xa1ceb5=_[_0x97c3('0x46')]({},_0xa1ceb5,_0x2d287b[_0x97c3('0x47')]);var _0xe737a6={'where':_0xa1ceb5[_0x97c3('0x45')]};return db['CmList'][_0x97c3('0x24')](_0xe737a6)[_0x97c3('0x2b')](function(_0x426bdf){_0x281968[_0x97c3('0x24')]=_0x426bdf;if(_0x2d287b[_0x97c3('0x3d')][_0x97c3('0x48')]){_0xa1ceb5[_0x97c3('0x49')]=[{'all':!![]}];}return db[_0x97c3('0x35')]['findAll'](_0xa1ceb5);})[_0x97c3('0x2b')](function(_0xd8981c){_0x281968['rows']=_0xd8981c;return _0x281968;})[_0x97c3('0x2b')](respondWithFilteredResult(_0x11a854,_0xa1ceb5))[_0x97c3('0x4a')](handleError(_0x11a854,null));};exports[_0x97c3('0x4b')]=function(_0x539698,_0x46752a){var _0x51fa62={'raw':![],'where':{'id':_0x539698[_0x97c3('0x4c')]['id']}},_0x24e6e3={};_0x24e6e3[_0x97c3('0x39')]=_[_0x97c3('0x4d')](db['CmList'][_0x97c3('0x36')]);_0x24e6e3[_0x97c3('0x3d')]=_[_0x97c3('0x4d')](_0x539698['query']);_0x24e6e3[_0x97c3('0x3b')]=_[_0x97c3('0x3c')](_0x24e6e3[_0x97c3('0x39')],_0x24e6e3[_0x97c3('0x3d')]);_0x51fa62[_0x97c3('0x3e')]=_[_0x97c3('0x3c')](_0x24e6e3['model'],qs[_0x97c3('0x3f')](_0x539698[_0x97c3('0x3d')][_0x97c3('0x3f')]));_0x51fa62['attributes']=_0x51fa62[_0x97c3('0x3e')][_0x97c3('0x4e')]?_0x51fa62['attributes']:_0x24e6e3[_0x97c3('0x39')];if(_0x539698[_0x97c3('0x3d')][_0x97c3('0x48')]){_0x51fa62[_0x97c3('0x49')]=[{'all':!![]}];}_0x51fa62=_[_0x97c3('0x46')]({},_0x51fa62,_0x539698['options']);return db['CmList'][_0x97c3('0x4f')](_0x51fa62)[_0x97c3('0x2b')](handleEntityNotFound(_0x46752a,null))[_0x97c3('0x2b')](respondWithResult(_0x46752a,null))[_0x97c3('0x4a')](handleError(_0x46752a,null));};exports[_0x97c3('0x50')]=function(_0x11ff39,_0x1ba4e9){return db['CmList'][_0x97c3('0x50')](_0x11ff39[_0x97c3('0x51')],{})[_0x97c3('0x2b')](function(_0x2855aa){var _0x28a3b6=_0x11ff39[_0x97c3('0x52')][_0x97c3('0x53')]({'plain':!![]});if(!_0x28a3b6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x28a3b6[_0x97c3('0x54')]===_0x97c3('0x52')){var _0x2a3f42=_0x2855aa[_0x97c3('0x53')]({'plain':!![]});var _0x389c38=_0x97c3('0x2d');return db['UserProfileSection']['find']({'where':{'name':_0x389c38,'userProfileId':_0x28a3b6['userProfileId']},'raw':!![]})['then'](function(_0x19ad2c){if(_0x19ad2c&&_0x19ad2c[_0x97c3('0x55')]===0x0){return db[_0x97c3('0x2e')][_0x97c3('0x50')]({'name':_0x2a3f42[_0x97c3('0x32')],'resourceId':_0x2a3f42['id'],'type':_0x19ad2c['name'],'sectionId':_0x19ad2c['id']},{})[_0x97c3('0x2b')](function(){return _0x2855aa;});}else{return _0x2855aa;}})['catch'](function(_0xed75ba){logger[_0x97c3('0x30')](_0x97c3('0x56'),_0xed75ba);throw _0xed75ba;});}return _0x2855aa;})[_0x97c3('0x2b')](respondWithResult(_0x1ba4e9,0xc9))['catch'](handleError(_0x1ba4e9,null));};exports[_0x97c3('0x2a')]=function(_0x97bae2,_0x554b89){if(_0x97bae2['body']['id']){delete _0x97bae2[_0x97c3('0x51')]['id'];}return db[_0x97c3('0x35')]['find']({'where':{'id':_0x97bae2[_0x97c3('0x4c')]['id']}})[_0x97c3('0x2b')](handleEntityNotFound(_0x554b89,null))[_0x97c3('0x2b')](saveUpdates(_0x97bae2[_0x97c3('0x51')],null))['then'](respondWithResult(_0x554b89,null))[_0x97c3('0x4a')](handleError(_0x554b89,null));};exports[_0x97c3('0x2c')]=function(_0x40ce89,_0xe0b805){return db[_0x97c3('0x35')][_0x97c3('0x4f')]({'where':{'id':_0x40ce89['params']['id']}})[_0x97c3('0x2b')](handleEntityNotFound(_0xe0b805,null))['then'](removeEntity(_0xe0b805,null))[_0x97c3('0x4a')](handleError(_0xe0b805,null));};exports['describe']=function(_0x29fd8b,_0x409cca){return db[_0x97c3('0x35')]['describe']()[_0x97c3('0x2b')](respondWithResult(_0x409cca,null))[_0x97c3('0x4a')](handleError(_0x409cca,null));};exports['addDisposition']=function(_0x3778ce,_0x1ab819,_0x28146c){if(_0x3778ce[_0x97c3('0x51')]['id']){delete _0x3778ce['body']['id'];}return db[_0x97c3('0x35')]['find']({'where':{'id':_0x3778ce[_0x97c3('0x4c')]['id']}})[_0x97c3('0x2b')](handleEntityNotFound(_0x1ab819,null))['then'](function(_0xcb56b4){if(_0xcb56b4){_0x3778ce[_0x97c3('0x51')][_0x97c3('0x57')]=_0xcb56b4['id'];return db[_0x97c3('0x58')][_0x97c3('0x50')](_0x3778ce[_0x97c3('0x51')]);}})[_0x97c3('0x2b')](respondWithResult(_0x1ab819,null))[_0x97c3('0x4a')](handleError(_0x1ab819,null));};exports[_0x97c3('0x59')]=function(_0x48349b,_0x54f239,_0x2720b3){var _0x4f63c9={'raw':![],'where':{}};var _0x211b6e={};var _0xda0b9b={'count':0x0,'rows':[]};return db[_0x97c3('0x35')]['findOne']({'where':{'id':_0x48349b[_0x97c3('0x4c')]['id']}})['then'](handleEntityNotFound(_0x54f239,null))['then'](function(_0x991cb6){if(_0x991cb6){_0x211b6e[_0x97c3('0x39')]=_['keys'](db['Disposition'][_0x97c3('0x36')]);_0x211b6e[_0x97c3('0x3d')]=_[_0x97c3('0x4d')](_0x48349b[_0x97c3('0x3d')]);_0x211b6e[_0x97c3('0x3b')]=_[_0x97c3('0x3c')](_0x211b6e[_0x97c3('0x39')],_0x211b6e[_0x97c3('0x3d')]);_0x4f63c9[_0x97c3('0x3e')]=_['intersection'](_0x211b6e[_0x97c3('0x39')],qs[_0x97c3('0x3f')](_0x48349b['query'][_0x97c3('0x3f')]));_0x4f63c9[_0x97c3('0x3e')]=_0x4f63c9['attributes'][_0x97c3('0x4e')]?_0x4f63c9[_0x97c3('0x3e')]:_0x211b6e[_0x97c3('0x39')];if(!_0x48349b['query'][_0x97c3('0x40')](_0x97c3('0x5a'))){_0x4f63c9[_0x97c3('0x23')]=qs[_0x97c3('0x23')](_0x48349b['query']['limit']);_0x4f63c9[_0x97c3('0x21')]=qs[_0x97c3('0x21')](_0x48349b[_0x97c3('0x3d')]['offset']);}_0x4f63c9[_0x97c3('0x41')]=qs['sort'](_0x48349b[_0x97c3('0x3d')][_0x97c3('0x42')]);_0x4f63c9[_0x97c3('0x45')]=qs[_0x97c3('0x3b')](_[_0x97c3('0x43')](_0x48349b[_0x97c3('0x3d')],_0x211b6e[_0x97c3('0x3b')]));_0x4f63c9['where'][_0x97c3('0x57')]=_0x991cb6['id'];if(_0x48349b[_0x97c3('0x3d')][_0x97c3('0x44')]){_0x4f63c9['where']=_[_0x97c3('0x46')](_0x4f63c9[_0x97c3('0x45')],{'$or':_[_0x97c3('0x3a')](_0x4f63c9[_0x97c3('0x3e')],function(_0x160be3){var _0x2f57e0={};_0x2f57e0[_0x160be3]={'$like':'%'+_0x48349b[_0x97c3('0x3d')][_0x97c3('0x44')]+'%'};return _0x2f57e0;})});}_0x4f63c9=_['merge']({},_0x4f63c9,_0x48349b[_0x97c3('0x47')]);return db[_0x97c3('0x58')][_0x97c3('0x24')]({'where':_0x4f63c9[_0x97c3('0x45')]})['then'](function(_0x4ebc92){_0xda0b9b[_0x97c3('0x24')]=_0x4ebc92;if(_0x48349b[_0x97c3('0x3d')][_0x97c3('0x48')]){_0x4f63c9[_0x97c3('0x49')]=[{'all':!![]}];}return db[_0x97c3('0x58')][_0x97c3('0x5b')](_0x4f63c9);})['then'](function(_0x5cab01){_0xda0b9b['rows']=_0x5cab01;return _0xda0b9b;});}})['then'](respondWithFilteredResult(_0x54f239,_0x4f63c9))['catch'](handleError(_0x54f239,null));};exports[_0x97c3('0x5c')]=function(_0xd57a33,_0x19cef4,_0x1a9a22){return db[_0x97c3('0x35')][_0x97c3('0x4f')]({'where':{'id':_0xd57a33[_0x97c3('0x4c')]['id']}})[_0x97c3('0x2b')](handleEntityNotFound(_0x19cef4,null))[_0x97c3('0x2b')](function(_0x4f154c){if(_0x4f154c){return _0x4f154c[_0x97c3('0x5c')](_0xd57a33[_0x97c3('0x3d')][_0x97c3('0x5d')]);}})[_0x97c3('0x2b')](respondWithStatusCode(_0x19cef4,null))[_0x97c3('0x4a')](handleError(_0x19cef4,null));};exports[_0x97c3('0x5e')]=function(_0x499ab1,_0x25aac9,_0x68d674){return db[_0x97c3('0x35')][_0x97c3('0x4f')]({'where':{'id':_0x499ab1[_0x97c3('0x4c')]['id']}})[_0x97c3('0x2b')](handleEntityNotFound(_0x25aac9,null))[_0x97c3('0x2b')](function(_0x4c4d62){if(_0x4c4d62){var _0x65a726=[];var _0x2f5db4={'success':[],'errors':[]};return db[_0x97c3('0x5f')][_0x97c3('0x60')]()[_0x97c3('0x2b')](function(_0x5b26e1){if(_0x499ab1[_0x97c3('0x51')]['tags']&&_[_0x97c3('0x61')](_0x499ab1[_0x97c3('0x51')][_0x97c3('0x62')])){if(_0x499ab1['body']['tags'][_0x97c3('0x4e')]){_0x499ab1['body'][_0x97c3('0x62')]=_0x499ab1[_0x97c3('0x51')]['tags']['join'](';')+';';}else{_0x499ab1[_0x97c3('0x51')][_0x97c3('0x62')]=null;}}else{_0x499ab1['body']['tags']=null;}if(_0x499ab1[_0x97c3('0x51')]&&_['isArray'](_0x499ab1[_0x97c3('0x51')])){for(var _0x285a3b=0x0;_0x285a3b<_0x499ab1[_0x97c3('0x51')][_0x97c3('0x4e')];_0x285a3b+=0x1){_0x499ab1[_0x97c3('0x51')][_0x285a3b][_0x97c3('0x57')]=_0x499ab1[_0x97c3('0x4c')]['id'];_0x65a726['push'](_0x499ab1[_0x97c3('0x51')][_0x285a3b]);}return BPromise[_0x97c3('0x63')](_0x65a726,function(_0x2e4d0c){return db[_0x97c3('0x5f')]['create'](_[_0x97c3('0x64')](_0x2e4d0c,[_0x97c3('0x5d'),'id'])||{},{'fields':_['keys'](_0x5b26e1),'raw':!![]})[_0x97c3('0x2b')](function(_0x57c8c4){_0x2f5db4['success']['push'](_0x57c8c4[_0x97c3('0x65')]);})['catch'](function(_0x345e6f){_0x2f5db4['errors'][_0x97c3('0x66')]({'data':_0x2e4d0c,'error':_0x345e6f[_0x97c3('0x67')]});});})[_0x97c3('0x2b')](function(_0x3b1fdb){return _0x2f5db4;})['catch'](function(_0x14d180){return _0x14d180;});}else{_0x25aac9[_0x97c3('0x1f')](0x190)['json']({'message':'Malformed\x20request\x20syntax'});}});}})[_0x97c3('0x2b')](respondWithResult(_0x25aac9,null))[_0x97c3('0x4a')](handleError(_0x25aac9,null));};exports[_0x97c3('0x68')]=function(_0x10431c,_0x43459d,_0x1fc765){var _0x150d11;return db['CmList']['find']({'where':{'id':_0x10431c[_0x97c3('0x4c')]['id']},'include':[{'model':db[_0x97c3('0x69')],'as':'CustomFields'}]})[_0x97c3('0x2b')](handleEntityNotFound(_0x43459d,null))[_0x97c3('0x2b')](function(_0x1a6caa){if(_0x1a6caa){_0x150d11=_0x1a6caa;return db[_0x97c3('0x5f')][_0x97c3('0x36')];}})[_0x97c3('0x2b')](function(_0x367ffb){if(_0x367ffb){var _0x42de72={};var _0x3d1aad={};_0x3d1aad[_0x97c3('0x39')]=_[_0x97c3('0x6a')](_[_0x97c3('0x4d')](_0x367ffb),_[_0x97c3('0x3a')](_0x150d11[_0x97c3('0x6b')],function(_0x3bb89c){return util['format'](_0x97c3('0x6c'),_0x3bb89c['id']);}));_0x3d1aad[_0x97c3('0x3d')]=_[_0x97c3('0x4d')](_0x10431c[_0x97c3('0x3d')]);_0x3d1aad[_0x97c3('0x3b')]=_[_0x97c3('0x3c')](_0x3d1aad[_0x97c3('0x39')],_0x3d1aad['query']);_0x42de72[_0x97c3('0x3e')]=_['intersection'](_0x3d1aad[_0x97c3('0x39')],qs['fields'](_0x10431c[_0x97c3('0x3d')]['fields']));_0x42de72[_0x97c3('0x3e')]=_0x42de72[_0x97c3('0x3e')][_0x97c3('0x4e')]?_0x42de72['attributes']:_0x3d1aad['model'];if(!_0x10431c[_0x97c3('0x3d')][_0x97c3('0x40')](_0x97c3('0x5a'))){_0x42de72[_0x97c3('0x23')]=qs[_0x97c3('0x23')](_0x10431c[_0x97c3('0x3d')][_0x97c3('0x23')]);_0x42de72[_0x97c3('0x21')]=qs[_0x97c3('0x21')](_0x10431c[_0x97c3('0x3d')][_0x97c3('0x21')]);}_0x42de72['order']=qs[_0x97c3('0x42')](_0x10431c[_0x97c3('0x3d')]['sort']);_0x42de72[_0x97c3('0x45')]=qs[_0x97c3('0x3b')](_['pick'](_0x10431c[_0x97c3('0x3d')],_0x3d1aad['filters']));_0x42de72[_0x97c3('0x6d')]=!![];if(_0x10431c['query'][_0x97c3('0x44')]){_0x42de72[_0x97c3('0x45')]=_[_0x97c3('0x46')](_0x42de72[_0x97c3('0x45')],{'$or':_[_0x97c3('0x3a')](_0x42de72[_0x97c3('0x3e')],function(_0x1a6e77){var _0x39c2cb={};_0x39c2cb[_0x1a6e77]={'$like':'%'+_0x10431c[_0x97c3('0x3d')]['filter']+'%'};return _0x39c2cb;})});}_0x42de72=_['merge']({},_0x42de72,_0x10431c['options']);return _0x150d11[_0x97c3('0x68')](_0x42de72);}})[_0x97c3('0x2b')](respondWithResult(_0x43459d,null))[_0x97c3('0x4a')](handleError(_0x43459d,null));};exports[_0x97c3('0x6e')]=function(_0x342fc5,_0x37ef2d,_0x1264f3){var _0x1acdb0;var _0x8079eb;var _0x5967a0;var _0x4b19e4=_0x342fc5[_0x97c3('0x4c')]['id'];csv_results=[];return db[_0x97c3('0x6f')][_0x97c3('0x5b')]({'attributes':['id',_0x97c3('0x32')],'raw':!![],'order':[_0x97c3('0x70')]})[_0x97c3('0x2b')](function(_0x205224){_0x1acdb0=_0x205224;var _0x2b0a8b=_['keys'](db[_0x97c3('0x5f')][_0x97c3('0x36')]);return db[_0x97c3('0x69')][_0x97c3('0x5b')]({'raw':!![],'attributes':['id','alias']})[_0x97c3('0x2b')](function(_0x593b38){_0x8079eb=_0x593b38;var _0x3dd564=squel['select']()[_0x97c3('0x3f')](_0x2b0a8b)[_0x97c3('0x71')](_0x97c3('0x72'),'c')[_0x97c3('0x45')]('c.ListId\x20=\x20?',_0x4b19e4)['where'](_0x97c3('0x73'))[_0x97c3('0x74')]();for(var _0x36e428=0x0;_0x36e428<_0x8079eb[_0x97c3('0x4e')];_0x36e428++){_0x3dd564['field'](_0x97c3('0x75')+_0x8079eb[_0x36e428]['id'],_0x97c3('0x76')+_0x8079eb[_0x36e428][_0x97c3('0x77')]);}for(var _0x36e428=0x0;_0x36e428<_0x1acdb0[_0x97c3('0x4e')];_0x36e428++){_0x3dd564['field'](squel[_0x97c3('0x78')]()[_0x97c3('0x79')]('item')[_0x97c3('0x71')](_0x97c3('0x7a'))[_0x97c3('0x45')](_0x97c3('0x7b'),_0x1acdb0[_0x36e428]['id'])[_0x97c3('0x45')](_0x97c3('0x7c')),_0x97c3('0x7d')+_0x1acdb0[_0x36e428][_0x97c3('0x32')]);_0x3dd564[_0x97c3('0x79')](squel[_0x97c3('0x78')]()[_0x97c3('0x79')](_0x97c3('0x7e'))[_0x97c3('0x71')]('cm_contact_has_items')[_0x97c3('0x45')](_0x97c3('0x7b'),_0x1acdb0[_0x36e428]['id'])[_0x97c3('0x45')](_0x97c3('0x7c')),_0x97c3('0x7f')+_0x1acdb0[_0x36e428][_0x97c3('0x32')]);}var _0x51294b=[];_0x51294b['push'](_0x3dd564['toString']());BPromise[_0x97c3('0x63')](_0x51294b,handleQuery)['then'](function(_0x4a484c){handleQuery(_0x3dd564[_0x97c3('0x80')]());var _0xb8e3c2=csv_results[0x0];if(!_[_0x97c3('0x81')](_0xb8e3c2)){var _0x5bf06f=toCsv(_0xb8e3c2);var _0x239bcf=Date['now']();fs['writeFileSync'](util[_0x97c3('0x82')]('/tmp/list_%d_%s.csv',_0x4b19e4,_0x239bcf),_0x5bf06f);_0x37ef2d[_0x97c3('0x83')](_0x97c3('0x84'),'attachment;\x20filename='+util['format']('list_%d_%s.csv',_0x4b19e4,_0x239bcf));_0x37ef2d[_0x97c3('0x83')](_0x97c3('0x85'),_0x97c3('0x86'));return _0x37ef2d[_0x97c3('0x87')](util[_0x97c3('0x82')](_0x97c3('0x88'),_0x4b19e4,_0x239bcf));}else{return _0x37ef2d[_0x97c3('0x2f')](0xcc);}});});});};exports[_0x97c3('0x89')]=function(_0x2b7e2e,_0x24e6ed,_0x2f1eb9){var _0x4daf89;delete _0x2b7e2e[_0x97c3('0x51')]['id'];return db[_0x97c3('0x35')][_0x97c3('0x8a')]({'where':{'id':_0x2b7e2e['params']['id']}})[_0x97c3('0x2b')](handleEntityNotFound(_0x24e6ed,null))['then'](function(_0x3304c0){if(_0x3304c0){return db[_0x97c3('0x8b')]['transaction'](function(_0x5978a2){return db[_0x97c3('0x69')]['create'](_0x2b7e2e[_0x97c3('0x51')],{'transaction':_0x5978a2})[_0x97c3('0x2b')](function(_0xfa3370){_0x4daf89=_0xfa3370;return _0x3304c0[_0x97c3('0x8c')](_0xfa3370,{'transaction':_0x5978a2});})[_0x97c3('0x2b')](function(){var _0x435730={'type':db[_0x97c3('0x8d')][_0x97c3('0x8e')],'transaction':_0x5978a2};switch(_0x2b7e2e[_0x97c3('0x51')][_0x97c3('0x38')]){case _0x97c3('0x8f'):_0x435730[_0x97c3('0x38')]=db[_0x97c3('0x8d')][_0x97c3('0x8e')];break;case _0x97c3('0x90'):_0x435730[_0x97c3('0x38')]=db[_0x97c3('0x8d')][_0x97c3('0x91')];break;case'switch':_0x435730['type']=db[_0x97c3('0x8d')][_0x97c3('0x92')];_0x435730['defaultValue']=![];break;default:}return db['sequelize'][_0x97c3('0x93')][_0x97c3('0x94')](_0x97c3('0x72'),util[_0x97c3('0x82')](_0x97c3('0x95'),_0x4daf89['id']),_0x435730);})[_0x97c3('0x2b')](function(){return _0x4daf89;});});}})[_0x97c3('0x2b')](respondWithResult(_0x24e6ed,null))[_0x97c3('0x4a')](handleError(_0x24e6ed,null));};exports[_0x97c3('0x96')]=function(_0x5c7f7f,_0x324d6d,_0x1b1f32){var _0x2d1bb0={};var _0x30f5d1={};var _0x2ca7da;var _0x50b94d;return db[_0x97c3('0x35')][_0x97c3('0x8a')]({'where':{'id':_0x5c7f7f[_0x97c3('0x4c')]['id']}})['then'](handleEntityNotFound(_0x324d6d,null))[_0x97c3('0x2b')](function(_0x383885){if(_0x383885){_0x2ca7da=_0x383885;_0x30f5d1['model']=_['keys'](db[_0x97c3('0x69')][_0x97c3('0x36')]);_0x30f5d1[_0x97c3('0x3d')]=_['keys'](_0x5c7f7f[_0x97c3('0x3d')]);_0x30f5d1[_0x97c3('0x3b')]=_[_0x97c3('0x3c')](_0x30f5d1['model'],_0x30f5d1[_0x97c3('0x3d')]);_0x2d1bb0[_0x97c3('0x3e')]=_['intersection'](_0x30f5d1[_0x97c3('0x39')],qs['fields'](_0x5c7f7f[_0x97c3('0x3d')][_0x97c3('0x3f')]));_0x2d1bb0[_0x97c3('0x3e')]=_0x2d1bb0[_0x97c3('0x3e')][_0x97c3('0x4e')]?_0x2d1bb0['attributes']:_0x30f5d1[_0x97c3('0x39')];_0x2d1bb0[_0x97c3('0x41')]=qs[_0x97c3('0x42')](_0x5c7f7f[_0x97c3('0x3d')][_0x97c3('0x42')]);_0x2d1bb0[_0x97c3('0x45')]=qs['filters'](_[_0x97c3('0x43')](_0x5c7f7f[_0x97c3('0x3d')],_0x30f5d1['filters']));_0x2d1bb0[_0x97c3('0x45')]=_[_0x97c3('0x46')](_0x2d1bb0[_0x97c3('0x45')],{'$or':[{'ListId':_0x383885['id']},{'ListId':null}]});if(_0x5c7f7f[_0x97c3('0x3d')][_0x97c3('0x44')]){_0x2d1bb0[_0x97c3('0x45')]=_[_0x97c3('0x46')](_0x2d1bb0[_0x97c3('0x45')],{'$or':_['map'](_0x2d1bb0[_0x97c3('0x3e')],function(_0x1dce6f){var _0x3c581b={};_0x3c581b[_0x1dce6f]={'$like':'%'+_0x5c7f7f[_0x97c3('0x3d')][_0x97c3('0x44')]+'%'};return _0x3c581b;})});}_0x2d1bb0=_[_0x97c3('0x46')]({},_0x2d1bb0,_0x5c7f7f[_0x97c3('0x47')]);return db['CmCustomField'][_0x97c3('0x97')](_0x2d1bb0);}})[_0x97c3('0x2b')](respondWithResult(_0x324d6d,null))[_0x97c3('0x4a')](handleError(_0x324d6d,null));};exports[_0x97c3('0x98')]=function(_0x5d93d8,_0x23a47b){return db[_0x97c3('0x69')][_0x97c3('0x97')]({'where':{'ListId':null}})[_0x97c3('0x2b')](handleEntityNotFound(_0x23a47b,null))[_0x97c3('0x2b')](function(_0x5d212c){return _0x5d212c;})[_0x97c3('0x2b')](respondWithResult(_0x23a47b,null))[_0x97c3('0x4a')](handleError(_0x23a47b,null));};exports[_0x97c3('0x99')]=function(_0xc6c5dd,_0x50e573,_0x10b3c6){return db[_0x97c3('0x35')]['find']({'where':{'id':_0xc6c5dd[_0x97c3('0x4c')]['id']}})[_0x97c3('0x2b')](handleEntityNotFound(_0x50e573,null))[_0x97c3('0x2b')](function(_0x3b634d){if(_0x3b634d){return _0x3b634d['addAgents'](_0xc6c5dd[_0x97c3('0x51')][_0x97c3('0x5d')],_['omit'](_0xc6c5dd[_0x97c3('0x51')],[_0x97c3('0x5d'),'id'])||{})[_0x97c3('0x9a')](function(_0x7cb4d2){for(var _0x275e43=0x0;_0x275e43<_0xc6c5dd[_0x97c3('0x51')][_0x97c3('0x5d')][_0x97c3('0x4e')];_0x275e43+=0x1){socket['emit']('userCmList:save',{'UserId':Number(_0xc6c5dd[_0x97c3('0x51')][_0x97c3('0x5d')][_0x275e43]),'CmListId':Number(_0xc6c5dd['params']['id'])});}return _0x7cb4d2;});}})[_0x97c3('0x2b')](respondWithResult(_0x50e573,null))[_0x97c3('0x4a')](handleError(_0x50e573,null));};exports[_0x97c3('0x9b')]=function(_0x3e89a5,_0x5a3728,_0x177d2b){return db[_0x97c3('0x35')][_0x97c3('0x4f')]({'where':{'id':_0x3e89a5[_0x97c3('0x4c')]['id']}})[_0x97c3('0x2b')](handleEntityNotFound(_0x5a3728,null))[_0x97c3('0x2b')](function(_0x18269f){if(_0x18269f){return _0x18269f[_0x97c3('0x9b')](_0x3e89a5[_0x97c3('0x3d')]['ids'])[_0x97c3('0x2b')](function(){if(_[_0x97c3('0x61')](_0x3e89a5[_0x97c3('0x3d')][_0x97c3('0x5d')])){for(var _0x4db8d0=0x0;_0x4db8d0<_0x3e89a5[_0x97c3('0x3d')][_0x97c3('0x5d')][_0x97c3('0x4e')];_0x4db8d0+=0x1){socket[_0x97c3('0x9c')](_0x97c3('0x9d'),{'UserId':Number(_0x3e89a5[_0x97c3('0x3d')]['ids'][_0x4db8d0]),'CmListId':Number(_0x3e89a5[_0x97c3('0x4c')]['id'])});}}else{socket[_0x97c3('0x9c')](_0x97c3('0x9d'),{'UserId':Number(_0x3e89a5[_0x97c3('0x3d')][_0x97c3('0x5d')]),'CmListId':Number(_0x3e89a5['params']['id'])});}});}})['then'](respondWithStatusCode(_0x5a3728,null))[_0x97c3('0x4a')](handleError(_0x5a3728,null));};exports[_0x97c3('0x9e')]=function(_0x3b67ff,_0x552bea,_0x5a2356){var _0x477015={};var _0x5ac45e={};var _0x51b852;var _0x2ca1e;return db[_0x97c3('0x35')]['findOne']({'where':{'id':_0x3b67ff[_0x97c3('0x4c')]['id']}})[_0x97c3('0x2b')](handleEntityNotFound(_0x552bea,null))[_0x97c3('0x2b')](function(_0x5d42ff){if(_0x5d42ff){_0x51b852=_0x5d42ff;_0x5ac45e['model']=_[_0x97c3('0x4d')](db[_0x97c3('0x9f')][_0x97c3('0x36')]);_0x5ac45e[_0x97c3('0x3d')]=_[_0x97c3('0x4d')](_0x3b67ff[_0x97c3('0x3d')]);_0x5ac45e['filters']=_[_0x97c3('0x3c')](_0x5ac45e[_0x97c3('0x39')],_0x5ac45e[_0x97c3('0x3d')]);_0x477015[_0x97c3('0x3e')]=_[_0x97c3('0x3c')](_0x5ac45e['model'],qs[_0x97c3('0x3f')](_0x3b67ff['query'][_0x97c3('0x3f')]));_0x477015[_0x97c3('0x3e')]=_0x477015['attributes'][_0x97c3('0x4e')]?_0x477015[_0x97c3('0x3e')]:_0x5ac45e[_0x97c3('0x39')];_0x477015[_0x97c3('0x41')]=qs[_0x97c3('0x42')](_0x3b67ff[_0x97c3('0x3d')][_0x97c3('0x42')]);_0x477015[_0x97c3('0x45')]=qs[_0x97c3('0x3b')](_[_0x97c3('0x43')](_0x3b67ff[_0x97c3('0x3d')],_0x5ac45e[_0x97c3('0x3b')]));if(_0x3b67ff[_0x97c3('0x3d')][_0x97c3('0x44')]){_0x477015['where']=_[_0x97c3('0x46')](_0x477015['where'],{'$or':_[_0x97c3('0x3a')](_0x477015[_0x97c3('0x3e')],function(_0x48771b){var _0x55f052={};_0x55f052[_0x48771b]={'$like':'%'+_0x3b67ff['query'][_0x97c3('0x44')]+'%'};return _0x55f052;})});}_0x477015=_['merge']({},_0x477015,_0x3b67ff['options']);return _0x51b852[_0x97c3('0x9e')](_0x477015);}})[_0x97c3('0x2b')](function(_0x37d8f2){if(_0x37d8f2){_0x2ca1e=_0x37d8f2[_0x97c3('0x4e')];if(!_0x3b67ff[_0x97c3('0x3d')][_0x97c3('0x40')](_0x97c3('0x5a'))){_0x477015[_0x97c3('0x23')]=qs[_0x97c3('0x23')](_0x3b67ff[_0x97c3('0x3d')][_0x97c3('0x23')]);_0x477015['offset']=qs['offset'](_0x3b67ff[_0x97c3('0x3d')][_0x97c3('0x21')]);}return _0x51b852[_0x97c3('0x9e')](_0x477015);}})[_0x97c3('0x2b')](function(_0x1572c2){if(_0x1572c2){return _0x1572c2?{'count':_0x2ca1e,'rows':_0x1572c2}:null;}})[_0x97c3('0x2b')](respondWithResult(_0x552bea,null))[_0x97c3('0x4a')](handleError(_0x552bea,null));};function handleQuery(_0x30fa13){logger[_0x97c3('0xa0')](_0x30fa13);return db['sequelize'][_0x97c3('0x3d')](_0x30fa13)[_0x97c3('0x9a')](function(_0x477dbe){csv_results[_0x97c3('0x66')](_0x477dbe);})[_0x97c3('0x4a')](function(_0x42240c){logger['error'](_0x42240c[_0x97c3('0x67')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 7668535..6e61bc2 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 _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x1d7037,_0x57dd95){var _0x4d6568=function(_0x5c64c5){while(--_0x5c64c5){_0x1d7037['push'](_0x1d7037['shift']());}};_0x4d6568(++_0x57dd95);}(_0x5fc3,0xa8));var _0x35fc=function(_0xf55e73,_0x3fecc5){_0xf55e73=_0xf55e73-0x0;var _0x116b99=_0x5fc3[_0xf55e73];return _0x116b99;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x65c50e,_0x1aa926){var _0x4573e7=function(_0x5bc049){while(--_0x5bc049){_0x65c50e['push'](_0x65c50e['shift']());}};_0x4573e7(++_0x1aa926);}(_0x55ca,0x126));var _0xa55c=function(_0x4347cd,_0x562582){_0x4347cd=_0x4347cd-0x0;var _0x40c6d7=_0x55ca[_0x4347cd];return _0x40c6d7;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 080b9a9..2bb8262 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 _0xfd28=['rimraf','./cmList.attributes','exports','define','util','../../config/logger','moment','request-promise','path'];(function(_0x4f6532,_0xd4b861){var _0x22d72e=function(_0xc314a2){while(--_0xc314a2){_0x4f6532['push'](_0x4f6532['shift']());}};_0x22d72e(++_0xd4b861);}(_0xfd28,0x148));var _0x8fd2=function(_0x507ac5,_0x33aaee){_0x507ac5=_0x507ac5-0x0;var _0x12c1bc=_0xfd28[_0x507ac5];return _0x12c1bc;};'use strict';var _=require('lodash');var util=require(_0x8fd2('0x0'));var logger=require(_0x8fd2('0x1'))('api');var moment=require(_0x8fd2('0x2'));var BPromise=require('bluebird');var rp=require(_0x8fd2('0x3'));var fs=require('fs');var path=require(_0x8fd2('0x4'));var rimraf=require(_0x8fd2('0x5'));var config=require('../../config/environment');var attributes=require(_0x8fd2('0x6'));module[_0x8fd2('0x7')]=function(_0x2ee87e,_0x36178a){return _0x2ee87e[_0x8fd2('0x8')]('CmList',attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0bb5=['define','CmList','cm_lists','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports'];(function(_0x3c28e7,_0x169024){var _0x557b3a=function(_0x42bf71){while(--_0x42bf71){_0x3c28e7['push'](_0x3c28e7['shift']());}};_0x557b3a(++_0x169024);}(_0x0bb5,0x148));var _0x50bb=function(_0x5dd485,_0x10a495){_0x5dd485=_0x5dd485-0x0;var _0x33993a=_0x0bb5[_0x5dd485];return _0x33993a;};'use strict';var _=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x50bb('0x2'));var BPromise=require(_0x50bb('0x3'));var rp=require(_0x50bb('0x4'));var fs=require('fs');var path=require(_0x50bb('0x5'));var rimraf=require(_0x50bb('0x6'));var config=require(_0x50bb('0x7'));var attributes=require(_0x50bb('0x8'));module[_0x50bb('0x9')]=function(_0x4e6093,_0x4a105c){return _0x4e6093[_0x50bb('0xa')](_0x50bb('0xb'),attributes,{'tableName':_0x50bb('0xc'),'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 9ba1e93..a52d8c5 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 _0x96aa=['then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','jayson/promise','client','http','redis','defaults','localhost','./cmList.socket','register'];(function(_0x121826,_0x5b5ede){var _0x209a5a=function(_0x390b14){while(--_0x390b14){_0x121826['push'](_0x121826['shift']());}};_0x209a5a(++_0x5b5ede);}(_0x96aa,0xa2));var _0xa96a=function(_0x4bdadb,_0x13d009){_0x4bdadb=_0x4bdadb-0x0;var _0x598597=_0x96aa[_0x4bdadb];return _0x598597;};'use strict';var _=require('lodash');var util=require(_0xa96a('0x0'));var moment=require(_0xa96a('0x1'));var BPromise=require('bluebird');var rs=require(_0xa96a('0x2'));var fs=require('fs');var Redis=require(_0xa96a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa96a('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa96a('0x5'));var client=jayson[_0xa96a('0x6')][_0xa96a('0x7')]({'port':0x232a});config[_0xa96a('0x8')]=_[_0xa96a('0x9')](config[_0xa96a('0x8')],{'host':_0xa96a('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa96a('0x8')]));require(_0xa96a('0xb'))[_0xa96a('0xc')](socket);function respondWithRpcPromise(_0x2bf90a,_0x3d408e,_0x26dbb8){return new BPromise(function(_0x5db1ca,_0x40a9ed){return client['request'](_0x2bf90a,_0x26dbb8)[_0xa96a('0xd')](function(_0x1b2182){logger[_0xa96a('0xe')](_0xa96a('0xf'),_0x3d408e,_0xa96a('0x10'));logger[_0xa96a('0x11')](_0xa96a('0x12'),_0x3d408e,_0xa96a('0x10'),JSON[_0xa96a('0x13')](_0x1b2182));if(_0x1b2182[_0xa96a('0x14')]){if(_0x1b2182['error'][_0xa96a('0x15')]===0x1f4){logger['error'](_0xa96a('0xf'),_0x3d408e,_0x1b2182[_0xa96a('0x14')][_0xa96a('0x16')]);return _0x40a9ed(_0x1b2182[_0xa96a('0x14')][_0xa96a('0x16')]);}logger[_0xa96a('0x14')]('CmList,\x20%s,\x20%s',_0x3d408e,_0x1b2182['error'][_0xa96a('0x16')]);return _0x5db1ca(_0x1b2182[_0xa96a('0x14')][_0xa96a('0x16')]);}else{logger['info'](_0xa96a('0xf'),_0x3d408e,_0xa96a('0x10'));_0x5db1ca(_0x1b2182[_0xa96a('0x17')]['message']);}})[_0xa96a('0x18')](function(_0x1f5bec){logger['error'](_0xa96a('0xf'),_0x3d408e,_0x1f5bec);_0x40a9ed(_0x1f5bec);});});} \ No newline at end of file +var _0x2717=['./cmList.socket','register','request','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','CmList,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter'];(function(_0x3ddbe8,_0x13d6a1){var _0x531882=function(_0x3245a0){while(--_0x3245a0){_0x3ddbe8['push'](_0x3ddbe8['shift']());}};_0x531882(++_0x13d6a1);}(_0x2717,0x1cd));var _0x7271=function(_0x1522e5,_0x257163){_0x1522e5=_0x1522e5-0x0;var _0x3f3d32=_0x2717[_0x1522e5];return _0x3f3d32;};'use strict';var _=require(_0x7271('0x0'));var util=require('util');var moment=require(_0x7271('0x1'));var BPromise=require(_0x7271('0x2'));var rs=require(_0x7271('0x3'));var fs=require('fs');var Redis=require(_0x7271('0x4'));var db=require(_0x7271('0x5'))['db'];var utils=require(_0x7271('0x6'));var logger=require(_0x7271('0x7'))('rpc');var config=require(_0x7271('0x8'));var jayson=require(_0x7271('0x9'));var client=jayson[_0x7271('0xa')][_0x7271('0xb')]({'port':0x232a});config[_0x7271('0xc')]=_[_0x7271('0xd')](config[_0x7271('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x7271('0xe'))(new Redis(config['redis']));require(_0x7271('0xf'))[_0x7271('0x10')](socket);function respondWithRpcPromise(_0x45d53f,_0x37c3d4,_0x2644ac){return new BPromise(function(_0x77530f,_0x33d738){return client[_0x7271('0x11')](_0x45d53f,_0x2644ac)['then'](function(_0x3ba1bd){logger['info']('CmList,\x20%s,\x20%s',_0x37c3d4,_0x7271('0x12'));logger[_0x7271('0x13')](_0x7271('0x14'),_0x37c3d4,_0x7271('0x12'),JSON[_0x7271('0x15')](_0x3ba1bd));if(_0x3ba1bd['error']){if(_0x3ba1bd['error']['code']===0x1f4){logger[_0x7271('0x16')](_0x7271('0x17'),_0x37c3d4,_0x3ba1bd[_0x7271('0x16')]['message']);return _0x33d738(_0x3ba1bd[_0x7271('0x16')][_0x7271('0x18')]);}logger[_0x7271('0x16')](_0x7271('0x17'),_0x37c3d4,_0x3ba1bd[_0x7271('0x16')][_0x7271('0x18')]);return _0x77530f(_0x3ba1bd[_0x7271('0x16')][_0x7271('0x18')]);}else{logger[_0x7271('0x19')]('CmList,\x20%s,\x20%s',_0x37c3d4,_0x7271('0x12'));_0x77530f(_0x3ba1bd[_0x7271('0x1a')][_0x7271('0x18')]);}})[_0x7271('0x1b')](function(_0x1b480c){logger[_0x7271('0x16')]('CmList,\x20%s,\x20%s',_0x37c3d4,_0x1b480c);_0x33d738(_0x1b480c);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 0a7bd13..8c0adde 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 _0xbc8d=['emit','register','length','cmList:','./cmList.events','remove','update'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0xbc8d,0x15b));var _0xdbc8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc8d[_0x3dd15e];return _0x231fd0;};'use strict';var CmListEvents=require(_0xdbc8('0x0'));var events=['save',_0xdbc8('0x1'),_0xdbc8('0x2')];function createListener(_0x47835e,_0xd1b1fd){return function(_0x547cf2){_0xd1b1fd[_0xdbc8('0x3')](_0x47835e,_0x547cf2);};}function removeListener(_0x172112,_0x2dd539){return function(){CmListEvents['removeListener'](_0x172112,_0x2dd539);};}exports[_0xdbc8('0x4')]=function(_0x10ede0){for(var _0x3ee39d=0x0,_0x47f72b=events[_0xdbc8('0x5')];_0x3ee39d<_0x47f72b;_0x3ee39d++){var _0x4e67e5=events[_0x3ee39d];var _0x26da2c=createListener(_0xdbc8('0x6')+_0x4e67e5,_0x10ede0);CmListEvents['on'](_0x4e67e5,_0x26da2c);}}; \ No newline at end of file +var _0xc9e1=['length','./cmList.events','save','remove','update','removeListener','register'];(function(_0x3db035,_0x45d488){var _0x148dde=function(_0x7be015){while(--_0x7be015){_0x3db035['push'](_0x3db035['shift']());}};_0x148dde(++_0x45d488);}(_0xc9e1,0x9b));var _0x1c9e=function(_0x1611cc,_0x3d4ce5){_0x1611cc=_0x1611cc-0x0;var _0x379497=_0xc9e1[_0x1611cc];return _0x379497;};'use strict';var CmListEvents=require(_0x1c9e('0x0'));var events=[_0x1c9e('0x1'),_0x1c9e('0x2'),_0x1c9e('0x3')];function createListener(_0x13859a,_0x35c409){return function(_0x11bcd7){_0x35c409['emit'](_0x13859a,_0x11bcd7);};}function removeListener(_0x28a22c,_0x3e8c66){return function(){CmListEvents[_0x1c9e('0x4')](_0x28a22c,_0x3e8c66);};}exports[_0x1c9e('0x5')]=function(_0x458cd6){for(var _0x240610=0x0,_0x58ed69=events[_0x1c9e('0x6')];_0x240610<_0x58ed69;_0x240610++){var _0x25c8d8=events[_0x240610];var _0x185d49=createListener('cmList:'+_0x25c8d8,_0x458cd6);CmListEvents['on'](_0x25c8d8,_0x185d49);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index e484e1d..c3fcc8a 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 _0xd3cf=['isAuthenticated','describe','get','/global_fields','/:id','show','/:id/dispositions','getDispositions','getContacts','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','/:id/contacts','addCustomField','addAgents','put','update','delete','removeDispositions','removeAgents','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller'];(function(_0x28c096,_0x148c62){var _0x2b3aa0=function(_0x4ba980){while(--_0x4ba980){_0x28c096['push'](_0x28c096['shift']());}};_0x2b3aa0(++_0x148c62);}(_0xd3cf,0x1e7));var _0xfd3c=function(_0x5d9afe,_0x41862b){_0x5d9afe=_0x5d9afe-0x0;var _0x107e9d=_0xd3cf[_0x5d9afe];return _0x107e9d;};'use strict';var multer=require('multer');var util=require(_0xfd3c('0x0'));var path=require('path');var timeout=require(_0xfd3c('0x1'));var express=require(_0xfd3c('0x2'));var router=express['Router']();var fs_extra=require(_0xfd3c('0x3'));var auth=require(_0xfd3c('0x4'));var interaction=require(_0xfd3c('0x5'));var config=require(_0xfd3c('0x6'));var controller=require(_0xfd3c('0x7'));router['get']('/',auth[_0xfd3c('0x8')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xfd3c('0x9')]);router[_0xfd3c('0xa')](_0xfd3c('0xb'),auth[_0xfd3c('0x8')](),controller['getGlobalCustomFields']);router[_0xfd3c('0xa')](_0xfd3c('0xc'),auth[_0xfd3c('0x8')](),controller[_0xfd3c('0xd')]);router[_0xfd3c('0xa')](_0xfd3c('0xe'),auth[_0xfd3c('0x8')](),controller[_0xfd3c('0xf')]);router[_0xfd3c('0xa')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xfd3c('0x10')]);router[_0xfd3c('0xa')]('/:id/contacts/csv',auth[_0xfd3c('0x8')](),controller[_0xfd3c('0x11')]);router[_0xfd3c('0xa')](_0xfd3c('0x12'),auth[_0xfd3c('0x8')](),controller[_0xfd3c('0x13')]);router[_0xfd3c('0xa')](_0xfd3c('0x14'),auth[_0xfd3c('0x8')](),controller[_0xfd3c('0x15')]);router[_0xfd3c('0x16')]('/',auth[_0xfd3c('0x8')](),controller[_0xfd3c('0x17')]);router[_0xfd3c('0x16')](_0xfd3c('0xe'),auth[_0xfd3c('0x8')](),controller[_0xfd3c('0x18')]);router[_0xfd3c('0x16')](_0xfd3c('0x19'),auth['isAuthenticated'](),controller['addContacts']);router[_0xfd3c('0x16')](_0xfd3c('0x12'),auth['isAuthenticated'](),controller[_0xfd3c('0x1a')]);router['post'](_0xfd3c('0x14'),auth['isAuthenticated'](),controller[_0xfd3c('0x1b')]);router[_0xfd3c('0x1c')]('/:id',auth[_0xfd3c('0x8')](),controller[_0xfd3c('0x1d')]);router[_0xfd3c('0x1e')](_0xfd3c('0xc'),auth[_0xfd3c('0x8')](),controller['destroy']);router['delete'](_0xfd3c('0xe'),auth['isAuthenticated'](),controller[_0xfd3c('0x1f')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xfd3c('0x20')]);module['exports']=router; \ No newline at end of file +var _0x3738=['/:id/contacts','getContacts','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addCustomField','addAgents','put','destroy','delete','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','/describe','describe','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions'];(function(_0x8dcf39,_0x28ab63){var _0x946cea=function(_0x34ed35){while(--_0x34ed35){_0x8dcf39['push'](_0x8dcf39['shift']());}};_0x946cea(++_0x28ab63);}(_0x3738,0x1e5));var _0x8373=function(_0x29c988,_0x343806){_0x29c988=_0x29c988-0x0;var _0x5c7a31=_0x3738[_0x29c988];return _0x5c7a31;};'use strict';var multer=require('multer');var util=require(_0x8373('0x0'));var path=require(_0x8373('0x1'));var timeout=require(_0x8373('0x2'));var express=require(_0x8373('0x3'));var router=express[_0x8373('0x4')]();var fs_extra=require(_0x8373('0x5'));var auth=require(_0x8373('0x6'));var interaction=require(_0x8373('0x7'));var config=require(_0x8373('0x8'));var controller=require(_0x8373('0x9'));router[_0x8373('0xa')]('/',auth[_0x8373('0xb')](),controller['index']);router[_0x8373('0xa')](_0x8373('0xc'),auth[_0x8373('0xb')](),controller[_0x8373('0xd')]);router[_0x8373('0xa')]('/global_fields',auth[_0x8373('0xb')](),controller[_0x8373('0xe')]);router[_0x8373('0xa')](_0x8373('0xf'),auth[_0x8373('0xb')](),controller[_0x8373('0x10')]);router[_0x8373('0xa')](_0x8373('0x11'),auth['isAuthenticated'](),controller[_0x8373('0x12')]);router['get'](_0x8373('0x13'),auth['isAuthenticated'](),controller[_0x8373('0x14')]);router[_0x8373('0xa')]('/:id/contacts/csv',auth[_0x8373('0xb')](),controller[_0x8373('0x15')]);router[_0x8373('0xa')](_0x8373('0x16'),auth['isAuthenticated'](),controller[_0x8373('0x17')]);router[_0x8373('0xa')](_0x8373('0x18'),auth['isAuthenticated'](),controller[_0x8373('0x19')]);router[_0x8373('0x1a')]('/',auth[_0x8373('0xb')](),controller[_0x8373('0x1b')]);router[_0x8373('0x1a')]('/:id/dispositions',auth[_0x8373('0xb')](),controller[_0x8373('0x1c')]);router[_0x8373('0x1a')](_0x8373('0x13'),auth['isAuthenticated'](),controller['addContacts']);router[_0x8373('0x1a')]('/:id/fields',auth[_0x8373('0xb')](),controller[_0x8373('0x1d')]);router[_0x8373('0x1a')](_0x8373('0x18'),auth['isAuthenticated'](),controller[_0x8373('0x1e')]);router[_0x8373('0x1f')](_0x8373('0xf'),auth[_0x8373('0xb')](),controller['update']);router['delete'](_0x8373('0xf'),auth['isAuthenticated'](),controller[_0x8373('0x20')]);router[_0x8373('0x21')](_0x8373('0x11'),auth[_0x8373('0xb')](),controller['removeDispositions']);router[_0x8373('0x21')](_0x8373('0x18'),auth[_0x8373('0xb')](),controller[_0x8373('0x22')]);module[_0x8373('0x23')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index ce91610..4934531 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 _0xe0fd=['sequelize','exports','field','STRING'];(function(_0x26d089,_0x3a341f){var _0x5477e9=function(_0x1817e0){while(--_0x1817e0){_0x26d089['push'](_0x26d089['shift']());}};_0x5477e9(++_0x3a341f);}(_0xe0fd,0xec));var _0xde0f=function(_0x1a78c5,_0x4baccc){_0x1a78c5=_0x1a78c5-0x0;var _0x5b9725=_0xe0fd[_0x1a78c5];return _0x5b9725;};'use strict';var Sequelize=require(_0xde0f('0x0'));module[_0xde0f('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x7570a0){return this['getDataValue'](_0xde0f('0x2'));}},'field':{'type':Sequelize[_0xde0f('0x3')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x0106=['field','STRING','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x316d81,_0x531e95){var _0x5ddccc=function(_0xe4747){while(--_0xe4747){_0x316d81['push'](_0x316d81['shift']());}};_0x5ddccc(++_0x531e95);}(_0x0106,0x176));var _0x6010=function(_0x42679b,_0x13e55e){_0x42679b=_0x42679b-0x0;var _0x3488f3=_0x0106[_0x42679b];return _0x3488f3;};'use strict';var Sequelize=require(_0x6010('0x0'));module[_0x6010('0x1')]={'name':{'type':Sequelize[_0x6010('0x2')],'get':function(_0x44b77d){return this[_0x6010('0x3')](_0x6010('0x4'));}},'field':{'type':Sequelize[_0x6010('0x5')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x6010('0x5')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index db4b580..1925e6d 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x13e96d,_0x14f37c){var _0x5cc834=function(_0x31f8b1){while(--_0x31f8b1){_0x13e96d['push'](_0x13e96d['shift']());}};_0x5cc834(++_0x14f37c);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x601a27,_0x1e9174){var _0x2df6bd=function(_0x350267){while(--_0x350267){_0x601a27['push'](_0x601a27['shift']());}};_0x2df6bd(++_0x1e9174);}(_0x7a54,0x106));var _0x47a5=function(_0x44c37b,_0x5d9588){_0x44c37b=_0x44c37b-0x0;var _0x20ce04=_0x7a54[_0x44c37b];return _0x20ce04;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 3c702a1..9943b1b 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 _0xb060=['../../config/environment','./condition.attributes','exports','define','tools_conditions','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xcb544,_0x8bfadd){var _0x5e2ec7=function(_0x422e31){while(--_0x422e31){_0xcb544['push'](_0xcb544['shift']());}};_0x5e2ec7(++_0x8bfadd);}(_0xb060,0x94));var _0x0b06=function(_0x4d8505,_0x377b6c){_0x4d8505=_0x4d8505-0x0;var _0x354c7c=_0xb060[_0x4d8505];return _0x354c7c;};'use strict';var _=require(_0x0b06('0x0'));var util=require(_0x0b06('0x1'));var logger=require('../../config/logger')(_0x0b06('0x2'));var moment=require(_0x0b06('0x3'));var BPromise=require(_0x0b06('0x4'));var rp=require(_0x0b06('0x5'));var fs=require('fs');var path=require(_0x0b06('0x6'));var rimraf=require(_0x0b06('0x7'));var config=require(_0x0b06('0x8'));var attributes=require(_0x0b06('0x9'));module[_0x0b06('0xa')]=function(_0xa3a8,_0xd0c7de){return _0xa3a8[_0x0b06('0xb')]('Condition',attributes,{'tableName':_0x0b06('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x986f=['util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','lodash'];(function(_0x1c13d6,_0x59f8d){var _0x5a89d9=function(_0x210463){while(--_0x210463){_0x1c13d6['push'](_0x1c13d6['shift']());}};_0x5a89d9(++_0x59f8d);}(_0x986f,0xbf));var _0xf986=function(_0x31b72e,_0x2fa534){_0x31b72e=_0x31b72e-0x0;var _0x2deb41=_0x986f[_0x31b72e];return _0x2deb41;};'use strict';var _=require(_0xf986('0x0'));var util=require(_0xf986('0x1'));var logger=require(_0xf986('0x2'))('api');var moment=require(_0xf986('0x3'));var BPromise=require(_0xf986('0x4'));var rp=require(_0xf986('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf986('0x6'));var attributes=require(_0xf986('0x7'));module[_0xf986('0x8')]=function(_0x5cce17,_0x4c8022){return _0x5cce17[_0xf986('0x9')](_0xf986('0xa'),attributes,{'tableName':_0xf986('0xb'),'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 74a522b..8d51356 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 _0xa220=['bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','info','request\x20sent','debug','stringify','error','code','Condition,\x20%s,\x20%s','message','result','catch','lodash','moment'];(function(_0x1431ba,_0x5cfd37){var _0x138f3b=function(_0x7822e6){while(--_0x7822e6){_0x1431ba['push'](_0x1431ba['shift']());}};_0x138f3b(++_0x5cfd37);}(_0xa220,0x116));var _0x0a22=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xa220[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x0a22('0x0'));var util=require('util');var moment=require(_0x0a22('0x1'));var BPromise=require(_0x0a22('0x2'));var rs=require(_0x0a22('0x3'));var fs=require('fs');var Redis=require(_0x0a22('0x4'));var db=require(_0x0a22('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0a22('0x6'));var config=require(_0x0a22('0x7'));var jayson=require(_0x0a22('0x8'));var client=jayson['client'][_0x0a22('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37eafe,_0x829cba,_0x19f44c){return new BPromise(function(_0x341274,_0x24f38b){return client['request'](_0x37eafe,_0x19f44c)['then'](function(_0x146488){logger[_0x0a22('0xa')]('Condition,\x20%s,\x20%s',_0x829cba,_0x0a22('0xb'));logger[_0x0a22('0xc')]('Condition,\x20%s,\x20%s,\x20%s',_0x829cba,_0x0a22('0xb'),JSON[_0x0a22('0xd')](_0x146488));if(_0x146488[_0x0a22('0xe')]){if(_0x146488['error'][_0x0a22('0xf')]===0x1f4){logger[_0x0a22('0xe')](_0x0a22('0x10'),_0x829cba,_0x146488[_0x0a22('0xe')]['message']);return _0x24f38b(_0x146488['error']['message']);}logger[_0x0a22('0xe')](_0x0a22('0x10'),_0x829cba,_0x146488[_0x0a22('0xe')][_0x0a22('0x11')]);return _0x341274(_0x146488['error']['message']);}else{logger[_0x0a22('0xa')](_0x0a22('0x10'),_0x829cba,'request\x20sent');_0x341274(_0x146488[_0x0a22('0x12')][_0x0a22('0x11')]);}})[_0x0a22('0x13')](function(_0x1b9f0e){logger['error'](_0x0a22('0x10'),_0x829cba,_0x1b9f0e);_0x24f38b(_0x1b9f0e);});});} \ No newline at end of file +var _0xfe30=['error','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3ceb2a,_0x48fef6){var _0x1c2d18=function(_0x3b7b15){while(--_0x3b7b15){_0x3ceb2a['push'](_0x3ceb2a['shift']());}};_0x1c2d18(++_0x48fef6);}(_0xfe30,0xe0));var _0x0fe3=function(_0x8eb9d,_0x320ee6){_0x8eb9d=_0x8eb9d-0x0;var _0x28c28=_0xfe30[_0x8eb9d];return _0x28c28;};'use strict';var _=require('lodash');var util=require(_0x0fe3('0x0'));var moment=require(_0x0fe3('0x1'));var BPromise=require('bluebird');var rs=require(_0x0fe3('0x2'));var fs=require('fs');var Redis=require(_0x0fe3('0x3'));var db=require(_0x0fe3('0x4'))['db'];var utils=require(_0x0fe3('0x5'));var logger=require(_0x0fe3('0x6'))(_0x0fe3('0x7'));var config=require(_0x0fe3('0x8'));var jayson=require(_0x0fe3('0x9'));var client=jayson['client'][_0x0fe3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12bbf3,_0x44ae2a,_0x18f1e1){return new BPromise(function(_0x2c2c48,_0x393696){return client[_0x0fe3('0xb')](_0x12bbf3,_0x18f1e1)[_0x0fe3('0xc')](function(_0x39b218){logger[_0x0fe3('0xd')](_0x0fe3('0xe'),_0x44ae2a,_0x0fe3('0xf'));logger['debug'](_0x0fe3('0x10'),_0x44ae2a,_0x0fe3('0xf'),JSON[_0x0fe3('0x11')](_0x39b218));if(_0x39b218[_0x0fe3('0x12')]){if(_0x39b218['error']['code']===0x1f4){logger[_0x0fe3('0x12')](_0x0fe3('0xe'),_0x44ae2a,_0x39b218['error'][_0x0fe3('0x13')]);return _0x393696(_0x39b218['error'][_0x0fe3('0x13')]);}logger[_0x0fe3('0x12')](_0x0fe3('0xe'),_0x44ae2a,_0x39b218[_0x0fe3('0x12')][_0x0fe3('0x13')]);return _0x2c2c48(_0x39b218[_0x0fe3('0x12')][_0x0fe3('0x13')]);}else{logger[_0x0fe3('0xd')](_0x0fe3('0xe'),_0x44ae2a,'request\x20sent');_0x2c2c48(_0x39b218[_0x0fe3('0x14')][_0x0fe3('0x13')]);}})[_0x0fe3('0x15')](function(_0x4511fc){logger[_0x0fe3('0x12')](_0x0fe3('0xe'),_0x44ae2a,_0x4511fc);_0x393696(_0x4511fc);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index a74c019..24c05c1 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 _0xbcd2=['/:id','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','isAuthenticated','update','delete'];(function(_0x103ff9,_0x576a4d){var _0x40693e=function(_0xd67bce){while(--_0xd67bce){_0x103ff9['push'](_0x103ff9['shift']());}};_0x40693e(++_0x576a4d);}(_0xbcd2,0x196));var _0x2bcd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbcd2[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2bcd('0x0'));var util=require('util');var path=require(_0x2bcd('0x1'));var timeout=require(_0x2bcd('0x2'));var express=require(_0x2bcd('0x3'));var router=express[_0x2bcd('0x4')]();var fs_extra=require(_0x2bcd('0x5'));var auth=require(_0x2bcd('0x6'));var interaction=require(_0x2bcd('0x7'));var config=require(_0x2bcd('0x8'));var controller=require(_0x2bcd('0x9'));router[_0x2bcd('0xa')]('/:id',auth[_0x2bcd('0xb')](),controller[_0x2bcd('0xc')]);router[_0x2bcd('0xd')](_0x2bcd('0xe'),auth[_0x2bcd('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x03d7=['express','fs-extra','../../components/auth/service','../../components/interaction/service','./condition.controller','put','/:id','update','delete','isAuthenticated','exports','multer','util','path'];(function(_0x2b37b5,_0x4f677b){var _0x36df6d=function(_0x501dc7){while(--_0x501dc7){_0x2b37b5['push'](_0x2b37b5['shift']());}};_0x36df6d(++_0x4f677b);}(_0x03d7,0xc1));var _0x703d=function(_0x26ce81,_0x55b3a1){_0x26ce81=_0x26ce81-0x0;var _0x265c92=_0x03d7[_0x26ce81];return _0x265c92;};'use strict';var multer=require(_0x703d('0x0'));var util=require(_0x703d('0x1'));var path=require(_0x703d('0x2'));var timeout=require('connect-timeout');var express=require(_0x703d('0x3'));var router=express['Router']();var fs_extra=require(_0x703d('0x4'));var auth=require(_0x703d('0x5'));var interaction=require(_0x703d('0x6'));var config=require('../../config/environment');var controller=require(_0x703d('0x7'));router[_0x703d('0x8')](_0x703d('0x9'),auth['isAuthenticated'](),controller[_0x703d('0xa')]);router[_0x703d('0xb')](_0x703d('0x9'),auth[_0x703d('0xc')](),controller['destroy']);module[_0x703d('0xd')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 0f5b729..f9ff5c4 100644 --- a/server/api/contactItemType/contactItemType.attributes.js +++ b/server/api/contactItemType/contactItemType.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4898=['INTEGER','sequelize','exports','STRING','name'];(function(_0x172ade,_0x362bfc){var _0x270a32=function(_0x52955d){while(--_0x52955d){_0x172ade['push'](_0x172ade['shift']());}};_0x270a32(++_0x362bfc);}(_0x4898,0x10a));var _0x8489=function(_0x252fa8,_0x293f30){_0x252fa8=_0x252fa8-0x0;var _0x5e3f1e=_0x4898[_0x252fa8];return _0x5e3f1e;};'use strict';var Sequelize=require(_0x8489('0x0'));module[_0x8489('0x1')]={'name':{'type':Sequelize[_0x8489('0x2')],'allowNull':![],'unique':_0x8489('0x3')},'OrderBy':{'type':Sequelize[_0x8489('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x8489('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x31a5=['STRING','INTEGER','sequelize','exports'];(function(_0x4fb74b,_0xe54efe){var _0xb85133=function(_0xa0e505){while(--_0xa0e505){_0x4fb74b['push'](_0x4fb74b['shift']());}};_0xb85133(++_0xe54efe);}(_0x31a5,0x186));var _0x531a=function(_0x427a41,_0x5a2dd5){_0x427a41=_0x427a41-0x0;var _0x17b824=_0x31a5[_0x427a41];return _0x17b824;};'use strict';var Sequelize=require(_0x531a('0x0'));module[_0x531a('0x1')]={'name':{'type':Sequelize[_0x531a('0x2')],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize[_0x531a('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x531a('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 31e8246..2c96b3b 100644 --- a/server/api/contactItemType/contactItemType.controller.js +++ b/server/api/contactItemType/contactItemType.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c7c=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','get','ContactItemTypes','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','ContactItemType','includeAll','include','findAll','rows','catch','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId'];(function(_0x4390dc,_0x35fbae){var _0x115339=function(_0x5b133c){while(--_0x5b133c){_0x4390dc['push'](_0x4390dc['shift']());}};_0x115339(++_0x35fbae);}(_0x1c7c,0x164));var _0xc1c7=function(_0x18c13e,_0x298998){_0x18c13e=_0x18c13e-0x0;var _0x402043=_0x1c7c[_0x18c13e];return _0x402043;};'use strict';var emlformat=require(_0xc1c7('0x0'));var rimraf=require(_0xc1c7('0x1'));var zipdir=require(_0xc1c7('0x2'));var jsonpatch=require(_0xc1c7('0x3'));var rp=require('request-promise');var moment=require(_0xc1c7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc1c7('0x5'));var util=require(_0xc1c7('0x6'));var path=require(_0xc1c7('0x7'));var sox=require(_0xc1c7('0x8'));var csv=require(_0xc1c7('0x9'));var ejs=require(_0xc1c7('0xa'));var fs=require('fs');var fs_extra=require(_0xc1c7('0xb'));var _=require(_0xc1c7('0xc'));var squel=require(_0xc1c7('0xd'));var crypto=require(_0xc1c7('0xe'));var jsforce=require(_0xc1c7('0xf'));var deskjs=require(_0xc1c7('0x10'));var toCsv=require(_0xc1c7('0x9'));var querystring=require(_0xc1c7('0x11'));var Papa=require(_0xc1c7('0x12'));var Redis=require(_0xc1c7('0x13'));var authService=require(_0xc1c7('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xc1c7('0x15'));var hardwareService=require(_0xc1c7('0x16'));var logger=require('../../config/logger')(_0xc1c7('0x17'));var utils=require(_0xc1c7('0x18'));var config=require(_0xc1c7('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xc1c7('0x1a'))['db'];function respondWithStatusCode(_0x44bf88,_0x376cab){_0x376cab=_0x376cab||0xcc;return function(_0x35feaa){if(_0x35feaa){return _0x44bf88[_0xc1c7('0x1b')](_0x376cab);}return _0x44bf88[_0xc1c7('0x1c')](_0x376cab)[_0xc1c7('0x1d')]();};}function respondWithResult(_0x1b57ab,_0xdfc7d9){_0xdfc7d9=_0xdfc7d9||0xc8;return function(_0x1b6905){if(_0x1b6905){return _0x1b57ab[_0xc1c7('0x1c')](_0xdfc7d9)[_0xc1c7('0x1e')](_0x1b6905);}};}function respondWithFilteredResult(_0x49576d,_0x3e1f0e){return function(_0x335600){if(_0x335600){var _0x21911c=typeof _0x3e1f0e['offset']===_0xc1c7('0x1f')&&typeof _0x3e1f0e[_0xc1c7('0x20')]===_0xc1c7('0x1f');var _0x39ac54=_0x335600[_0xc1c7('0x21')];var _0xb42702=_0x21911c?0x0:_0x3e1f0e[_0xc1c7('0x22')];var _0x2e93e5=_0x21911c?_0x335600['count']:_0x3e1f0e[_0xc1c7('0x22')]+_0x3e1f0e[_0xc1c7('0x20')];var _0x3ec66a;if(_0x2e93e5>=_0x39ac54){_0x2e93e5=_0x39ac54;_0x3ec66a=0xc8;}else{_0x3ec66a=0xce;}_0x49576d[_0xc1c7('0x1c')](_0x3ec66a);return _0x49576d['set'](_0xc1c7('0x23'),_0xb42702+'-'+_0x2e93e5+'/'+_0x39ac54)['json'](_0x335600);}return null;};}function patchUpdates(_0x5e7e4a){return function(_0x195c5f){try{jsonpatch['apply'](_0x195c5f,_0x5e7e4a,!![]);}catch(_0x5846f0){return BPromise[_0xc1c7('0x24')](_0x5846f0);}return _0x195c5f[_0xc1c7('0x25')]();};}function saveUpdates(_0x2f1b87,_0x4c6b34){return function(_0x813853){if(_0x813853){return _0x813853[_0xc1c7('0x26')](_0x2f1b87)[_0xc1c7('0x27')](function(_0x31a0e0){return _0x31a0e0;});}return null;};}function removeEntity(_0x2e64c4,_0x3a2483){return function(_0x3180fd){if(_0x3180fd){return _0x3180fd[_0xc1c7('0x28')]()[_0xc1c7('0x27')](function(){var _0x1540c1=_0x3180fd[_0xc1c7('0x29')]({'plain':!![]});var _0x363fbc=_0xc1c7('0x2a');return db[_0xc1c7('0x2b')][_0xc1c7('0x28')]({'where':{'type':_0x363fbc,'resourceId':_0x1540c1['id']}})[_0xc1c7('0x27')](function(){return _0x3180fd;});})['then'](function(){_0x2e64c4[_0xc1c7('0x1c')](0xcc)[_0xc1c7('0x1d')]();});}};}function handleEntityNotFound(_0x4e1721,_0x52a1d5){return function(_0x352f24){if(!_0x352f24){_0x4e1721['sendStatus'](0x194);}return _0x352f24;};}function handleError(_0x544fbb,_0x541f12){_0x541f12=_0x541f12||0x1f4;return function(_0x1b873c){logger[_0xc1c7('0x2c')](_0x1b873c[_0xc1c7('0x2d')]);if(_0x1b873c[_0xc1c7('0x2e')]){delete _0x1b873c['name'];}_0x544fbb['status'](_0x541f12)[_0xc1c7('0x2f')](_0x1b873c);};}exports[_0xc1c7('0x30')]=function(_0x9a0ab3,_0x3a786f){var _0x2e35f1={},_0x4968b0={},_0x50042f={'count':0x0,'rows':[]};var _0x125920=_[_0xc1c7('0x31')](db['ContactItemType'][_0xc1c7('0x32')],function(_0x3cf425){return{'name':_0x3cf425[_0xc1c7('0x33')],'type':_0x3cf425[_0xc1c7('0x34')][_0xc1c7('0x35')]};});_0x4968b0[_0xc1c7('0x36')]=_[_0xc1c7('0x31')](_0x125920,'name');_0x4968b0[_0xc1c7('0x37')]=_[_0xc1c7('0x38')](_0x9a0ab3[_0xc1c7('0x37')]);_0x4968b0[_0xc1c7('0x39')]=_[_0xc1c7('0x3a')](_0x4968b0[_0xc1c7('0x36')],_0x4968b0[_0xc1c7('0x37')]);_0x2e35f1[_0xc1c7('0x3b')]=_[_0xc1c7('0x3a')](_0x4968b0['model'],qs['fields'](_0x9a0ab3[_0xc1c7('0x37')][_0xc1c7('0x3c')]));_0x2e35f1[_0xc1c7('0x3b')]=_0x2e35f1[_0xc1c7('0x3b')][_0xc1c7('0x3d')]?_0x2e35f1[_0xc1c7('0x3b')]:_0x4968b0[_0xc1c7('0x36')];if(!_0x9a0ab3[_0xc1c7('0x37')][_0xc1c7('0x3e')](_0xc1c7('0x3f'))){_0x2e35f1[_0xc1c7('0x20')]=qs[_0xc1c7('0x20')](_0x9a0ab3[_0xc1c7('0x37')][_0xc1c7('0x20')]);_0x2e35f1[_0xc1c7('0x22')]=qs[_0xc1c7('0x22')](_0x9a0ab3[_0xc1c7('0x37')][_0xc1c7('0x22')]);}_0x2e35f1[_0xc1c7('0x40')]=qs[_0xc1c7('0x41')](_0x9a0ab3[_0xc1c7('0x37')]['sort']);_0x2e35f1['where']=qs['filters'](_[_0xc1c7('0x42')](_0x9a0ab3['query'],_0x4968b0['filters']),_0x125920);if(_0x9a0ab3[_0xc1c7('0x37')][_0xc1c7('0x43')]){_0x2e35f1[_0xc1c7('0x44')]=_[_0xc1c7('0x45')](_0x2e35f1['where'],{'$or':_[_0xc1c7('0x31')](_0x125920,function(_0x25e005){if(_0x25e005[_0xc1c7('0x34')]!==_0xc1c7('0x46')){var _0x1a395c={};_0x1a395c[_0x25e005[_0xc1c7('0x2e')]]={'$like':'%'+_0x9a0ab3[_0xc1c7('0x37')][_0xc1c7('0x43')]+'%'};return _0x1a395c;}})});}_0x2e35f1=_[_0xc1c7('0x45')]({},_0x2e35f1,_0x9a0ab3[_0xc1c7('0x47')]);var _0x955ba6={'where':_0x2e35f1[_0xc1c7('0x44')]};return db[_0xc1c7('0x48')]['count'](_0x955ba6)[_0xc1c7('0x27')](function(_0x412520){_0x50042f['count']=_0x412520;if(_0x9a0ab3[_0xc1c7('0x37')][_0xc1c7('0x49')]){_0x2e35f1[_0xc1c7('0x4a')]=[{'all':!![]}];}return db[_0xc1c7('0x48')][_0xc1c7('0x4b')](_0x2e35f1);})[_0xc1c7('0x27')](function(_0xd5e06a){_0x50042f[_0xc1c7('0x4c')]=_0xd5e06a;return _0x50042f;})[_0xc1c7('0x27')](respondWithFilteredResult(_0x3a786f,_0x2e35f1))[_0xc1c7('0x4d')](handleError(_0x3a786f,null));};exports['show']=function(_0x14b61f,_0x16fbf5){var _0x519665={'raw':!![],'where':{'id':_0x14b61f[_0xc1c7('0x4e')]['id']}},_0x4c6834={};_0x4c6834[_0xc1c7('0x36')]=_[_0xc1c7('0x38')](db[_0xc1c7('0x48')][_0xc1c7('0x32')]);_0x4c6834['query']=_[_0xc1c7('0x38')](_0x14b61f[_0xc1c7('0x37')]);_0x4c6834['filters']=_['intersection'](_0x4c6834['model'],_0x4c6834[_0xc1c7('0x37')]);_0x519665[_0xc1c7('0x3b')]=_[_0xc1c7('0x3a')](_0x4c6834['model'],qs[_0xc1c7('0x3c')](_0x14b61f[_0xc1c7('0x37')]['fields']));_0x519665[_0xc1c7('0x3b')]=_0x519665[_0xc1c7('0x3b')][_0xc1c7('0x3d')]?_0x519665[_0xc1c7('0x3b')]:_0x4c6834[_0xc1c7('0x36')];if(_0x14b61f[_0xc1c7('0x37')][_0xc1c7('0x49')]){_0x519665[_0xc1c7('0x4a')]=[{'all':!![]}];}_0x519665=_[_0xc1c7('0x45')]({},_0x519665,_0x14b61f[_0xc1c7('0x47')]);return db[_0xc1c7('0x48')][_0xc1c7('0x4f')](_0x519665)[_0xc1c7('0x27')](handleEntityNotFound(_0x16fbf5,null))[_0xc1c7('0x27')](respondWithResult(_0x16fbf5,null))[_0xc1c7('0x4d')](handleError(_0x16fbf5,null));};exports[_0xc1c7('0x50')]=function(_0x2967b7,_0x1addc8){return db['ContactItemType'][_0xc1c7('0x50')](_0x2967b7['body'],{})[_0xc1c7('0x27')](function(_0x23f42f){var _0x2840a3=_0x2967b7['user'][_0xc1c7('0x29')]({'plain':!![]});if(!_0x2840a3)throw new Error(_0xc1c7('0x51'));if(_0x2840a3['role']==='user'){var _0x5c96cc=_0x23f42f[_0xc1c7('0x29')]({'plain':!![]});var _0x415416='ContactItemTypes';return db[_0xc1c7('0x52')][_0xc1c7('0x4f')]({'where':{'name':_0x415416,'userProfileId':_0x2840a3[_0xc1c7('0x53')]},'raw':!![]})[_0xc1c7('0x27')](function(_0x37374c){if(_0x37374c&&_0x37374c[_0xc1c7('0x54')]===0x0){return db['UserProfileResource'][_0xc1c7('0x50')]({'name':_0x5c96cc['name'],'resourceId':_0x5c96cc['id'],'type':_0x37374c[_0xc1c7('0x2e')],'sectionId':_0x37374c['id']},{})[_0xc1c7('0x27')](function(){return _0x23f42f;});}else{return _0x23f42f;}})[_0xc1c7('0x4d')](function(_0x557cb6){logger[_0xc1c7('0x2c')](_0xc1c7('0x55'),_0x557cb6);throw _0x557cb6;});}return _0x23f42f;})[_0xc1c7('0x27')](respondWithResult(_0x1addc8,0xc9))[_0xc1c7('0x4d')](handleError(_0x1addc8,null));};exports[_0xc1c7('0x26')]=function(_0x45dfa2,_0x1dc39f){if(_0x45dfa2[_0xc1c7('0x56')]['id']){delete _0x45dfa2['body']['id'];}return db[_0xc1c7('0x48')][_0xc1c7('0x4f')]({'where':{'id':_0x45dfa2[_0xc1c7('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1dc39f,null))['then'](saveUpdates(_0x45dfa2[_0xc1c7('0x56')],null))[_0xc1c7('0x27')](respondWithResult(_0x1dc39f,null))[_0xc1c7('0x4d')](handleError(_0x1dc39f,null));};exports['destroy']=function(_0x1c636c,_0x48304a){return db[_0xc1c7('0x48')][_0xc1c7('0x4f')]({'where':{'id':_0x1c636c[_0xc1c7('0x4e')]['id']}})[_0xc1c7('0x27')](handleEntityNotFound(_0x48304a,null))[_0xc1c7('0x27')](db[_0xc1c7('0x57')][_0xc1c7('0x26')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x1c636c['params']['id']}}))[_0xc1c7('0x27')](removeEntity(_0x48304a,null))[_0xc1c7('0x4d')](handleError(_0x48304a,null));}; \ No newline at end of file +var _0x160f=['UserProfileSection','userProfileId','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','map','ContactItemType','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ContactItemTypes'];(function(_0x35debd,_0x32f9c6){var _0x33b636=function(_0x3b0480){while(--_0x3b0480){_0x35debd['push'](_0x35debd['shift']());}};_0x33b636(++_0x32f9c6);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf160('0x0'));var rimraf=require(_0xf160('0x1'));var zipdir=require(_0xf160('0x2'));var jsonpatch=require(_0xf160('0x3'));var rp=require('request-promise');var moment=require(_0xf160('0x4'));var BPromise=require(_0xf160('0x5'));var Mustache=require(_0xf160('0x6'));var util=require(_0xf160('0x7'));var path=require(_0xf160('0x8'));var sox=require(_0xf160('0x9'));var csv=require('to-csv');var ejs=require(_0xf160('0xa'));var fs=require('fs');var fs_extra=require(_0xf160('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf160('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf160('0xd'));var Papa=require(_0xf160('0xe'));var Redis=require(_0xf160('0xf'));var authService=require(_0xf160('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf160('0x11'));var logger=require(_0xf160('0x12'))(_0xf160('0x13'));var utils=require('../../config/utils');var config=require(_0xf160('0x14'));var licenseUtil=require(_0xf160('0x15'));var db=require(_0xf160('0x16'))['db'];function respondWithStatusCode(_0x3b09ea,_0x2d8854){_0x2d8854=_0x2d8854||0xcc;return function(_0x523af5){if(_0x523af5){return _0x3b09ea[_0xf160('0x17')](_0x2d8854);}return _0x3b09ea['status'](_0x2d8854)[_0xf160('0x18')]();};}function respondWithResult(_0x26951a,_0x12549a){_0x12549a=_0x12549a||0xc8;return function(_0x2bb6c7){if(_0x2bb6c7){return _0x26951a[_0xf160('0x19')](_0x12549a)[_0xf160('0x1a')](_0x2bb6c7);}};}function respondWithFilteredResult(_0x2643ba,_0x172337){return function(_0x1396ba){if(_0x1396ba){var _0x59ac02=typeof _0x172337[_0xf160('0x1b')]===_0xf160('0x1c')&&typeof _0x172337[_0xf160('0x1d')]===_0xf160('0x1c');var _0x51824b=_0x1396ba[_0xf160('0x1e')];var _0x4b8185=_0x59ac02?0x0:_0x172337[_0xf160('0x1b')];var _0x1cf6ba=_0x59ac02?_0x1396ba[_0xf160('0x1e')]:_0x172337[_0xf160('0x1b')]+_0x172337[_0xf160('0x1d')];var _0x205afa;if(_0x1cf6ba>=_0x51824b){_0x1cf6ba=_0x51824b;_0x205afa=0xc8;}else{_0x205afa=0xce;}_0x2643ba[_0xf160('0x19')](_0x205afa);return _0x2643ba[_0xf160('0x1f')](_0xf160('0x20'),_0x4b8185+'-'+_0x1cf6ba+'/'+_0x51824b)['json'](_0x1396ba);}return null;};}function patchUpdates(_0x40ccf0){return function(_0xa20d5a){try{jsonpatch[_0xf160('0x21')](_0xa20d5a,_0x40ccf0,!![]);}catch(_0x5ad173){return BPromise[_0xf160('0x22')](_0x5ad173);}return _0xa20d5a[_0xf160('0x23')]();};}function saveUpdates(_0x454e63,_0x36d0cb){return function(_0x2e03c8){if(_0x2e03c8){return _0x2e03c8[_0xf160('0x24')](_0x454e63)[_0xf160('0x25')](function(_0x5a72d1){return _0x5a72d1;});}return null;};}function removeEntity(_0x3d1f6c,_0x28bf27){return function(_0x305f6a){if(_0x305f6a){return _0x305f6a[_0xf160('0x26')]()['then'](function(){var _0x42458c=_0x305f6a[_0xf160('0x27')]({'plain':!![]});var _0x4a8003='ContactItemTypes';return db[_0xf160('0x28')][_0xf160('0x26')]({'where':{'type':_0x4a8003,'resourceId':_0x42458c['id']}})[_0xf160('0x25')](function(){return _0x305f6a;});})['then'](function(){_0x3d1f6c[_0xf160('0x19')](0xcc)[_0xf160('0x18')]();});}};}function handleEntityNotFound(_0x2851e8,_0x2e2b00){return function(_0x135e0f){if(!_0x135e0f){_0x2851e8[_0xf160('0x17')](0x194);}return _0x135e0f;};}function handleError(_0x5d0cc8,_0x4d7165){_0x4d7165=_0x4d7165||0x1f4;return function(_0x48145e){logger[_0xf160('0x29')](_0x48145e[_0xf160('0x2a')]);if(_0x48145e[_0xf160('0x2b')]){delete _0x48145e[_0xf160('0x2b')];}_0x5d0cc8[_0xf160('0x19')](_0x4d7165)['send'](_0x48145e);};}exports['index']=function(_0x329d6b,_0x558596){var _0x4ce478={},_0x22c2e3={},_0x3a35b3={'count':0x0,'rows':[]};var _0x5497f6=_[_0xf160('0x2c')](db[_0xf160('0x2d')]['rawAttributes'],function(_0x528dff){return{'name':_0x528dff['fieldName'],'type':_0x528dff['type'][_0xf160('0x2e')]};});_0x22c2e3[_0xf160('0x2f')]=_[_0xf160('0x2c')](_0x5497f6,_0xf160('0x2b'));_0x22c2e3[_0xf160('0x30')]=_[_0xf160('0x31')](_0x329d6b['query']);_0x22c2e3['filters']=_['intersection'](_0x22c2e3[_0xf160('0x2f')],_0x22c2e3['query']);_0x4ce478['attributes']=_[_0xf160('0x32')](_0x22c2e3[_0xf160('0x2f')],qs['fields'](_0x329d6b[_0xf160('0x30')][_0xf160('0x33')]));_0x4ce478[_0xf160('0x34')]=_0x4ce478[_0xf160('0x34')][_0xf160('0x35')]?_0x4ce478['attributes']:_0x22c2e3[_0xf160('0x2f')];if(!_0x329d6b[_0xf160('0x30')][_0xf160('0x36')]('nolimit')){_0x4ce478[_0xf160('0x1d')]=qs[_0xf160('0x1d')](_0x329d6b[_0xf160('0x30')][_0xf160('0x1d')]);_0x4ce478[_0xf160('0x1b')]=qs[_0xf160('0x1b')](_0x329d6b['query']['offset']);}_0x4ce478[_0xf160('0x37')]=qs[_0xf160('0x38')](_0x329d6b[_0xf160('0x30')][_0xf160('0x38')]);_0x4ce478[_0xf160('0x39')]=qs[_0xf160('0x3a')](_[_0xf160('0x3b')](_0x329d6b[_0xf160('0x30')],_0x22c2e3[_0xf160('0x3a')]),_0x5497f6);if(_0x329d6b[_0xf160('0x30')][_0xf160('0x3c')]){_0x4ce478[_0xf160('0x39')]=_[_0xf160('0x3d')](_0x4ce478[_0xf160('0x39')],{'$or':_[_0xf160('0x2c')](_0x5497f6,function(_0x256ce7){if(_0x256ce7[_0xf160('0x3e')]!==_0xf160('0x3f')){var _0x43f07f={};_0x43f07f[_0x256ce7[_0xf160('0x2b')]]={'$like':'%'+_0x329d6b[_0xf160('0x30')][_0xf160('0x3c')]+'%'};return _0x43f07f;}})});}_0x4ce478=_[_0xf160('0x3d')]({},_0x4ce478,_0x329d6b[_0xf160('0x40')]);var _0x494d76={'where':_0x4ce478[_0xf160('0x39')]};return db[_0xf160('0x2d')][_0xf160('0x1e')](_0x494d76)[_0xf160('0x25')](function(_0x3d273d){_0x3a35b3[_0xf160('0x1e')]=_0x3d273d;if(_0x329d6b[_0xf160('0x30')]['includeAll']){_0x4ce478[_0xf160('0x41')]=[{'all':!![]}];}return db['ContactItemType'][_0xf160('0x42')](_0x4ce478);})[_0xf160('0x25')](function(_0x530fc5){_0x3a35b3[_0xf160('0x43')]=_0x530fc5;return _0x3a35b3;})[_0xf160('0x25')](respondWithFilteredResult(_0x558596,_0x4ce478))[_0xf160('0x44')](handleError(_0x558596,null));};exports[_0xf160('0x45')]=function(_0x468600,_0x43d243){var _0x1154ed={'raw':!![],'where':{'id':_0x468600[_0xf160('0x46')]['id']}},_0x4f5eba={};_0x4f5eba[_0xf160('0x2f')]=_[_0xf160('0x31')](db[_0xf160('0x2d')][_0xf160('0x47')]);_0x4f5eba[_0xf160('0x30')]=_[_0xf160('0x31')](_0x468600[_0xf160('0x30')]);_0x4f5eba[_0xf160('0x3a')]=_[_0xf160('0x32')](_0x4f5eba[_0xf160('0x2f')],_0x4f5eba['query']);_0x1154ed['attributes']=_[_0xf160('0x32')](_0x4f5eba[_0xf160('0x2f')],qs[_0xf160('0x33')](_0x468600[_0xf160('0x30')][_0xf160('0x33')]));_0x1154ed[_0xf160('0x34')]=_0x1154ed['attributes'][_0xf160('0x35')]?_0x1154ed['attributes']:_0x4f5eba['model'];if(_0x468600[_0xf160('0x30')][_0xf160('0x48')]){_0x1154ed['include']=[{'all':!![]}];}_0x1154ed=_['merge']({},_0x1154ed,_0x468600[_0xf160('0x40')]);return db[_0xf160('0x2d')][_0xf160('0x49')](_0x1154ed)[_0xf160('0x25')](handleEntityNotFound(_0x43d243,null))['then'](respondWithResult(_0x43d243,null))['catch'](handleError(_0x43d243,null));};exports['create']=function(_0x50a97d,_0x406494){return db['ContactItemType'][_0xf160('0x4a')](_0x50a97d[_0xf160('0x4b')],{})[_0xf160('0x25')](function(_0x3bdfdb){var _0x4f2e23=_0x50a97d[_0xf160('0x4c')][_0xf160('0x27')]({'plain':!![]});if(!_0x4f2e23)throw new Error(_0xf160('0x4d'));if(_0x4f2e23['role']===_0xf160('0x4c')){var _0x40f855=_0x3bdfdb[_0xf160('0x27')]({'plain':!![]});var _0x5c3cee=_0xf160('0x4e');return db[_0xf160('0x4f')][_0xf160('0x49')]({'where':{'name':_0x5c3cee,'userProfileId':_0x4f2e23[_0xf160('0x50')]},'raw':!![]})[_0xf160('0x25')](function(_0x5d0fbb){if(_0x5d0fbb&&_0x5d0fbb['autoAssociation']===0x0){return db[_0xf160('0x28')]['create']({'name':_0x40f855[_0xf160('0x2b')],'resourceId':_0x40f855['id'],'type':_0x5d0fbb[_0xf160('0x2b')],'sectionId':_0x5d0fbb['id']},{})['then'](function(){return _0x3bdfdb;});}else{return _0x3bdfdb;}})['catch'](function(_0x321309){logger[_0xf160('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x321309);throw _0x321309;});}return _0x3bdfdb;})[_0xf160('0x25')](respondWithResult(_0x406494,0xc9))[_0xf160('0x44')](handleError(_0x406494,null));};exports[_0xf160('0x24')]=function(_0x405d7e,_0x5f3ded){if(_0x405d7e[_0xf160('0x4b')]['id']){delete _0x405d7e['body']['id'];}return db[_0xf160('0x2d')][_0xf160('0x49')]({'where':{'id':_0x405d7e[_0xf160('0x46')]['id']}})[_0xf160('0x25')](handleEntityNotFound(_0x5f3ded,null))[_0xf160('0x25')](saveUpdates(_0x405d7e['body'],null))[_0xf160('0x25')](respondWithResult(_0x5f3ded,null))['catch'](handleError(_0x5f3ded,null));};exports[_0xf160('0x26')]=function(_0x1229cd,_0x39628d){return db[_0xf160('0x2d')][_0xf160('0x49')]({'where':{'id':_0x1229cd[_0xf160('0x46')]['id']}})[_0xf160('0x25')](handleEntityNotFound(_0x39628d,null))[_0xf160('0x25')](db[_0xf160('0x51')][_0xf160('0x24')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x1229cd['params']['id']}}))['then'](removeEntity(_0x39628d,null))[_0xf160('0x44')](handleError(_0x39628d,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index ff20593..a66a023 100644 --- a/server/api/contactItemType/contactItemType.model.js +++ b/server/api/contactItemType/contactItemType.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x581a=['../../config/logger','request-promise','rimraf','../../config/environment','./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types'];(function(_0x1a379a,_0x2868e0){var _0x528c58=function(_0x25a00a){while(--_0x25a00a){_0x1a379a['push'](_0x1a379a['shift']());}};_0x528c58(++_0x2868e0);}(_0x581a,0x1b0));var _0xa581=function(_0x12bcf7,_0x56f6ae){_0x12bcf7=_0x12bcf7-0x0;var _0x108ba3=_0x581a[_0x12bcf7];return _0x108ba3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa581('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa581('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa581('0x2'));var config=require(_0xa581('0x3'));var attributes=require(_0xa581('0x4'));module[_0xa581('0x5')]=function(_0x442d4a,_0x533867){return _0x442d4a[_0xa581('0x6')](_0xa581('0x7'),attributes,{'tableName':_0xa581('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf65e=['api','bluebird','request-promise','path','./contactItemType.attributes','define','ContactItemType','lodash','../../config/logger'];(function(_0x587dd0,_0x273922){var _0x56f153=function(_0x27fb33){while(--_0x27fb33){_0x587dd0['push'](_0x587dd0['shift']());}};_0x56f153(++_0x273922);}(_0xf65e,0xfa));var _0xef65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf65e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xef65('0x0'));var util=require('util');var logger=require(_0xef65('0x1'))(_0xef65('0x2'));var moment=require('moment');var BPromise=require(_0xef65('0x3'));var rp=require(_0xef65('0x4'));var fs=require('fs');var path=require(_0xef65('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xef65('0x6'));module['exports']=function(_0x5b9d31,_0x33a59a){return _0x5b9d31[_0xef65('0x7')](_0xef65('0x8'),attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index 5a48cec..086a639 100644 --- a/server/api/contactItemType/contactItemType.rpc.js +++ b/server/api/contactItemType/contactItemType.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe73f=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','then','info','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','ContactItemType,\x20%s,\x20%s'];(function(_0x5ce313,_0x5a5942){var _0x1c5db4=function(_0x49bebd){while(--_0x49bebd){_0x5ce313['push'](_0x5ce313['shift']());}};_0x1c5db4(++_0x5a5942);}(_0xe73f,0x8f));var _0xfe73=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xe73f[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xfe73('0x0'));var util=require(_0xfe73('0x1'));var moment=require('moment');var BPromise=require(_0xfe73('0x2'));var rs=require(_0xfe73('0x3'));var fs=require('fs');var Redis=require(_0xfe73('0x4'));var db=require(_0xfe73('0x5'))['db'];var utils=require(_0xfe73('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xfe73('0x7'));var jayson=require(_0xfe73('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x33a13b,_0x2acd09,_0x55cd2b){return new BPromise(function(_0x22bb5c,_0x31c4f9){return client['request'](_0x33a13b,_0x55cd2b)[_0xfe73('0x9')](function(_0x536b67){logger[_0xfe73('0xa')]('ContactItemType,\x20%s,\x20%s',_0x2acd09,_0xfe73('0xb'));logger[_0xfe73('0xc')](_0xfe73('0xd'),_0x2acd09,'request\x20sent',JSON[_0xfe73('0xe')](_0x536b67));if(_0x536b67['error']){if(_0x536b67[_0xfe73('0xf')]['code']===0x1f4){logger[_0xfe73('0xf')](_0xfe73('0x10'),_0x2acd09,_0x536b67['error']['message']);return _0x31c4f9(_0x536b67[_0xfe73('0xf')]['message']);}logger[_0xfe73('0xf')]('ContactItemType,\x20%s,\x20%s',_0x2acd09,_0x536b67['error'][_0xfe73('0x11')]);return _0x22bb5c(_0x536b67['error'][_0xfe73('0x11')]);}else{logger[_0xfe73('0xa')]('ContactItemType,\x20%s,\x20%s',_0x2acd09,_0xfe73('0xb'));_0x22bb5c(_0x536b67[_0xfe73('0x12')]['message']);}})[_0xfe73('0x13')](function(_0x258a67){logger[_0xfe73('0xf')](_0xfe73('0x10'),_0x2acd09,_0x258a67);_0x31c4f9(_0x258a67);});});} \ No newline at end of file +var _0x3bf7=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','ContactItemType,\x20%s,\x20%s','debug','ContactItemType,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x1062e3,_0x49349e){var _0x92e616=function(_0x1ca4fe){while(--_0x1ca4fe){_0x1062e3['push'](_0x1062e3['shift']());}};_0x92e616(++_0x49349e);}(_0x3bf7,0xc3));var _0x73bf=function(_0x1ad47f,_0x12ced4){_0x1ad47f=_0x1ad47f-0x0;var _0x38ad0f=_0x3bf7[_0x1ad47f];return _0x38ad0f;};'use strict';var _=require(_0x73bf('0x0'));var util=require(_0x73bf('0x1'));var moment=require(_0x73bf('0x2'));var BPromise=require('bluebird');var rs=require(_0x73bf('0x3'));var fs=require('fs');var Redis=require(_0x73bf('0x4'));var db=require(_0x73bf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x73bf('0x6'))('rpc');var config=require(_0x73bf('0x7'));var jayson=require(_0x73bf('0x8'));var client=jayson[_0x73bf('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e8a25,_0x2c6ba4,_0x23013d){return new BPromise(function(_0x93d8f5,_0x4a9430){return client[_0x73bf('0xa')](_0x2e8a25,_0x23013d)[_0x73bf('0xb')](function(_0x411749){logger['info'](_0x73bf('0xc'),_0x2c6ba4,'request\x20sent');logger[_0x73bf('0xd')](_0x73bf('0xe'),_0x2c6ba4,_0x73bf('0xf'),JSON['stringify'](_0x411749));if(_0x411749['error']){if(_0x411749[_0x73bf('0x10')][_0x73bf('0x11')]===0x1f4){logger['error'](_0x73bf('0xc'),_0x2c6ba4,_0x411749[_0x73bf('0x10')][_0x73bf('0x12')]);return _0x4a9430(_0x411749[_0x73bf('0x10')][_0x73bf('0x12')]);}logger[_0x73bf('0x10')](_0x73bf('0xc'),_0x2c6ba4,_0x411749[_0x73bf('0x10')][_0x73bf('0x12')]);return _0x93d8f5(_0x411749[_0x73bf('0x10')]['message']);}else{logger[_0x73bf('0x13')](_0x73bf('0xc'),_0x2c6ba4,_0x73bf('0xf'));_0x93d8f5(_0x411749[_0x73bf('0x14')][_0x73bf('0x12')]);}})[_0x73bf('0x15')](function(_0x4b93bc){logger[_0x73bf('0x10')](_0x73bf('0xc'),_0x2c6ba4,_0x4b93bc);_0x4a9430(_0x4b93bc);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index ad5958a..76302db 100644 --- a/server/api/contactItemType/index.js +++ b/server/api/contactItemType/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2923=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','multer','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2923,0x196));var _0x3292=function(_0x574cbb,_0x25452d){_0x574cbb=_0x574cbb-0x0;var _0x38fa35=_0x2923[_0x574cbb];return _0x38fa35;};'use strict';var multer=require(_0x3292('0x0'));var util=require('util');var path=require(_0x3292('0x1'));var timeout=require('connect-timeout');var express=require(_0x3292('0x2'));var router=express['Router']();var fs_extra=require(_0x3292('0x3'));var auth=require(_0x3292('0x4'));var interaction=require(_0x3292('0x5'));var config=require(_0x3292('0x6'));var controller=require(_0x3292('0x7'));router[_0x3292('0x8')]('/',auth[_0x3292('0x9')](),controller[_0x3292('0xa')]);router['get'](_0x3292('0xb'),auth['isAuthenticated'](),controller[_0x3292('0xc')]);router['post']('/',auth[_0x3292('0x9')](),controller[_0x3292('0xd')]);router[_0x3292('0xe')](_0x3292('0xb'),auth[_0x3292('0x9')](),controller[_0x3292('0xf')]);router[_0x3292('0x10')](_0x3292('0xb'),auth[_0x3292('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1124=['../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x7faa06,_0x2e2a43){var _0x3924fa=function(_0x3f008b){while(--_0x3f008b){_0x7faa06['push'](_0x7faa06['shift']());}};_0x3924fa(++_0x2e2a43);}(_0x1124,0x111));var _0x4112=function(_0x2d9a47,_0x2dc9d6){_0x2d9a47=_0x2d9a47-0x0;var _0x4ac1d0=_0x1124[_0x2d9a47];return _0x4ac1d0;};'use strict';var multer=require(_0x4112('0x0'));var util=require(_0x4112('0x1'));var path=require('path');var timeout=require(_0x4112('0x2'));var express=require(_0x4112('0x3'));var router=express[_0x4112('0x4')]();var fs_extra=require(_0x4112('0x5'));var auth=require(_0x4112('0x6'));var interaction=require(_0x4112('0x7'));var config=require(_0x4112('0x8'));var controller=require(_0x4112('0x9'));router[_0x4112('0xa')]('/',auth[_0x4112('0xb')](),controller[_0x4112('0xc')]);router[_0x4112('0xa')](_0x4112('0xd'),auth[_0x4112('0xb')](),controller[_0x4112('0xe')]);router[_0x4112('0xf')]('/',auth['isAuthenticated'](),controller[_0x4112('0x10')]);router[_0x4112('0x11')]('/:id',auth[_0x4112('0xb')](),controller[_0x4112('0x12')]);router['delete']('/:id',auth[_0x4112('0xb')](),controller[_0x4112('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 1bf4f4d..ee32805 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 _0x757a=['exports','STRING'];(function(_0x57c263,_0x478905){var _0x3ffe69=function(_0x42902e){while(--_0x42902e){_0x57c263['push'](_0x57c263['shift']());}};_0x3ffe69(++_0x478905);}(_0x757a,0xde));var _0xa757=function(_0xee9a06,_0x118426){_0xee9a06=_0xee9a06-0x0;var _0xd30078=_0x757a[_0xee9a06];return _0xd30078;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb7e7=['STRING','sequelize'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0xb7e7,0x121));var _0x7b7e=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xb7e7[_0x122096];return _0x3d1966;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 9275078..a3d50cd 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 _0x74e3=['attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','attrSerie1','total','attrSerie2','attrSerie3','attrSmsAccounts','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','getItems','findOne','order','pick','filter','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','CustomDashboards','UserProfileResource','sendStatus','error','stack','name','send','index','map','Dashboard','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','iframe','attrUrl','attrs','value','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric'];(function(_0x56df69,_0x1c4bd3){var _0x40340c=function(_0x3c5724){while(--_0x3c5724){_0x56df69['push'](_0x56df69['shift']());}};_0x40340c(++_0x1c4bd3);}(_0x74e3,0x9c));var _0x374e=function(_0x4e9a9e,_0x583a24){_0x4e9a9e=_0x4e9a9e-0x0;var _0x53c489=_0x74e3[_0x4e9a9e];return _0x53c489;};'use strict';var emlformat=require(_0x374e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x374e('0x1'));var jsonpatch=require(_0x374e('0x2'));var rp=require(_0x374e('0x3'));var moment=require(_0x374e('0x4'));var BPromise=require(_0x374e('0x5'));var Mustache=require(_0x374e('0x6'));var util=require('util');var path=require('path');var sox=require(_0x374e('0x7'));var csv=require(_0x374e('0x8'));var ejs=require(_0x374e('0x9'));var fs=require('fs');var fs_extra=require(_0x374e('0xa'));var _=require(_0x374e('0xb'));var squel=require(_0x374e('0xc'));var crypto=require(_0x374e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x374e('0xe'));var toCsv=require(_0x374e('0x8'));var querystring=require(_0x374e('0xf'));var Papa=require(_0x374e('0x10'));var Redis=require('ioredis');var authService=require(_0x374e('0x11'));var qs=require(_0x374e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x374e('0x13'));var logger=require(_0x374e('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x374e('0x15'));var licenseUtil=require(_0x374e('0x16'));var db=require('../../mysqldb')['db'];config[_0x374e('0x17')]=_[_0x374e('0x18')](config[_0x374e('0x17')],{'host':_0x374e('0x19'),'port':0x18eb});var socket=require(_0x374e('0x1a'))(new Redis(config[_0x374e('0x17')]));require('./dashboard.socket')[_0x374e('0x1b')](socket);function respondWithStatusCode(_0x450157,_0x327432){_0x327432=_0x327432||0xcc;return function(_0x290a9c){if(_0x290a9c){return _0x450157['sendStatus'](_0x327432);}return _0x450157[_0x374e('0x1c')](_0x327432)[_0x374e('0x1d')]();};}function respondWithResult(_0x3223a3,_0x12b321){_0x12b321=_0x12b321||0xc8;return function(_0x2feeae){if(_0x2feeae){return _0x3223a3[_0x374e('0x1c')](_0x12b321)[_0x374e('0x1e')](_0x2feeae);}};}function respondWithFilteredResult(_0x4fe4fd,_0x148ccd){return function(_0x57f97f){if(_0x57f97f){var _0x23d5ff=typeof _0x148ccd['offset']===_0x374e('0x1f')&&typeof _0x148ccd[_0x374e('0x20')]==='undefined';var _0x28accb=_0x57f97f[_0x374e('0x21')];var _0x4cced6=_0x23d5ff?0x0:_0x148ccd[_0x374e('0x22')];var _0x4ff07f=_0x23d5ff?_0x57f97f[_0x374e('0x21')]:_0x148ccd[_0x374e('0x22')]+_0x148ccd[_0x374e('0x20')];var _0x3799bf;if(_0x4ff07f>=_0x28accb){_0x4ff07f=_0x28accb;_0x3799bf=0xc8;}else{_0x3799bf=0xce;}_0x4fe4fd[_0x374e('0x1c')](_0x3799bf);return _0x4fe4fd[_0x374e('0x23')](_0x374e('0x24'),_0x4cced6+'-'+_0x4ff07f+'/'+_0x28accb)[_0x374e('0x1e')](_0x57f97f);}return null;};}function patchUpdates(_0x1ffdb6){return function(_0x11616c){try{jsonpatch[_0x374e('0x25')](_0x11616c,_0x1ffdb6,!![]);}catch(_0x380003){return BPromise[_0x374e('0x26')](_0x380003);}return _0x11616c['save']();};}function saveUpdates(_0x1dccdc,_0x1f90c2){return function(_0x252f61){if(_0x252f61){return _0x252f61[_0x374e('0x27')](_0x1dccdc)[_0x374e('0x28')](function(_0x4edb3c){return _0x4edb3c;});}return null;};}function removeEntity(_0x409406,_0x56e376){return function(_0x4d3d9b){if(_0x4d3d9b){return _0x4d3d9b[_0x374e('0x29')]()['then'](function(){var _0x4169b3=_0x4d3d9b['get']({'plain':!![]});var _0x430ff0=_0x374e('0x2a');return db[_0x374e('0x2b')][_0x374e('0x29')]({'where':{'type':_0x430ff0,'resourceId':_0x4169b3['id']}})[_0x374e('0x28')](function(){return _0x4d3d9b;});})[_0x374e('0x28')](function(){_0x409406['status'](0xcc)[_0x374e('0x1d')]();});}};}function handleEntityNotFound(_0x4a578d,_0x1b4c39){return function(_0x2e7c55){if(!_0x2e7c55){_0x4a578d[_0x374e('0x2c')](0x194);}return _0x2e7c55;};}function handleError(_0x35831c,_0x411ea9){_0x411ea9=_0x411ea9||0x1f4;return function(_0x4b87f1){logger[_0x374e('0x2d')](_0x4b87f1[_0x374e('0x2e')]);if(_0x4b87f1[_0x374e('0x2f')]){delete _0x4b87f1[_0x374e('0x2f')];}_0x35831c[_0x374e('0x1c')](_0x411ea9)[_0x374e('0x30')](_0x4b87f1);};}exports[_0x374e('0x31')]=function(_0x19ca2a,_0x599172){var _0x28cc64={},_0x325a52={},_0x55622b={'count':0x0,'rows':[]};var _0x368c28=_[_0x374e('0x32')](db[_0x374e('0x33')][_0x374e('0x34')],function(_0x2760d1){return{'name':_0x2760d1['fieldName'],'type':_0x2760d1[_0x374e('0x35')][_0x374e('0x36')]};});_0x325a52[_0x374e('0x37')]=_[_0x374e('0x32')](_0x368c28,_0x374e('0x2f'));_0x325a52['query']=_[_0x374e('0x38')](_0x19ca2a[_0x374e('0x39')]);_0x325a52[_0x374e('0x3a')]=_[_0x374e('0x3b')](_0x325a52[_0x374e('0x37')],_0x325a52['query']);_0x28cc64[_0x374e('0x3c')]=_[_0x374e('0x3b')](_0x325a52['model'],qs[_0x374e('0x3d')](_0x19ca2a[_0x374e('0x39')][_0x374e('0x3d')]));_0x28cc64[_0x374e('0x3c')]=_0x28cc64[_0x374e('0x3c')][_0x374e('0x3e')]?_0x28cc64[_0x374e('0x3c')]:_0x325a52[_0x374e('0x37')];if(!_0x19ca2a[_0x374e('0x39')][_0x374e('0x3f')](_0x374e('0x40'))){_0x28cc64[_0x374e('0x20')]=qs['limit'](_0x19ca2a[_0x374e('0x39')]['limit']);_0x28cc64[_0x374e('0x22')]=qs[_0x374e('0x22')](_0x19ca2a[_0x374e('0x39')][_0x374e('0x22')]);}_0x28cc64['order']=qs[_0x374e('0x41')](_0x19ca2a[_0x374e('0x39')][_0x374e('0x41')]);_0x28cc64[_0x374e('0x42')]=qs[_0x374e('0x3a')](_['pick'](_0x19ca2a[_0x374e('0x39')],_0x325a52[_0x374e('0x3a')]),_0x368c28);if(_0x19ca2a[_0x374e('0x39')]['filter']){_0x28cc64['where']=_['merge'](_0x28cc64[_0x374e('0x42')],{'$or':_[_0x374e('0x32')](_0x368c28,function(_0x162ab7){if(_0x162ab7[_0x374e('0x35')]!==_0x374e('0x43')){var _0x4bb0b4={};_0x4bb0b4[_0x162ab7[_0x374e('0x2f')]]={'$like':'%'+_0x19ca2a[_0x374e('0x39')]['filter']+'%'};return _0x4bb0b4;}})});}_0x28cc64=_[_0x374e('0x44')]({},_0x28cc64,_0x19ca2a[_0x374e('0x45')]);var _0x17e415={'where':_0x28cc64[_0x374e('0x42')]};return db[_0x374e('0x33')]['count'](_0x17e415)[_0x374e('0x28')](function(_0x4a8c84){_0x55622b[_0x374e('0x21')]=_0x4a8c84;if(_0x19ca2a['query'][_0x374e('0x46')]){_0x28cc64[_0x374e('0x47')]=[{'all':!![]}];}return db[_0x374e('0x33')][_0x374e('0x48')](_0x28cc64);})['then'](function(_0x580d82){_0x55622b[_0x374e('0x49')]=_0x580d82;return _0x55622b;})[_0x374e('0x28')](respondWithFilteredResult(_0x599172,_0x28cc64))[_0x374e('0x4a')](handleError(_0x599172,null));};exports[_0x374e('0x4b')]=function(_0x273245,_0x7abf33){var _0x2b1146={'raw':![],'where':{'id':_0x273245[_0x374e('0x4c')]['id']}},_0x313e85={};_0x313e85[_0x374e('0x37')]=_[_0x374e('0x38')](db[_0x374e('0x33')][_0x374e('0x34')]);_0x313e85[_0x374e('0x39')]=_[_0x374e('0x38')](_0x273245[_0x374e('0x39')]);_0x313e85[_0x374e('0x3a')]=_[_0x374e('0x3b')](_0x313e85[_0x374e('0x37')],_0x313e85['query']);_0x2b1146[_0x374e('0x3c')]=_[_0x374e('0x3b')](_0x313e85[_0x374e('0x37')],qs[_0x374e('0x3d')](_0x273245[_0x374e('0x39')][_0x374e('0x3d')]));_0x2b1146[_0x374e('0x3c')]=_0x2b1146[_0x374e('0x3c')][_0x374e('0x3e')]?_0x2b1146['attributes']:_0x313e85[_0x374e('0x37')];if(_0x273245['query'][_0x374e('0x46')]){_0x2b1146['include']=[{'all':!![]}];}_0x2b1146=_[_0x374e('0x44')]({},_0x2b1146,_0x273245[_0x374e('0x45')]);return db[_0x374e('0x33')][_0x374e('0x4d')](_0x2b1146)[_0x374e('0x28')](handleEntityNotFound(_0x7abf33,null))[_0x374e('0x28')](respondWithResult(_0x7abf33,null))[_0x374e('0x4a')](handleError(_0x7abf33,null));};exports[_0x374e('0x4e')]=function(_0x2d5382,_0x5791dc){return db['Dashboard'][_0x374e('0x4e')](_0x2d5382[_0x374e('0x4f')],{})[_0x374e('0x28')](function(_0x53bf14){var _0x1a0eb8=_0x2d5382[_0x374e('0x50')][_0x374e('0x51')]({'plain':!![]});if(!_0x1a0eb8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1a0eb8[_0x374e('0x52')]===_0x374e('0x50')){var _0x1a1d7d=_0x53bf14['get']({'plain':!![]});var _0x4504da=_0x374e('0x2a');return db[_0x374e('0x53')][_0x374e('0x4d')]({'where':{'name':_0x4504da,'userProfileId':_0x1a0eb8[_0x374e('0x54')]},'raw':!![]})['then'](function(_0xb870f0){if(_0xb870f0&&_0xb870f0[_0x374e('0x55')]===0x0){return db[_0x374e('0x2b')]['create']({'name':_0x1a1d7d[_0x374e('0x2f')],'resourceId':_0x1a1d7d['id'],'type':_0xb870f0['name'],'sectionId':_0xb870f0['id']},{})[_0x374e('0x28')](function(){return _0x53bf14;});}else{return _0x53bf14;}})[_0x374e('0x4a')](function(_0x10d4d5){logger[_0x374e('0x2d')](_0x374e('0x56'),_0x10d4d5);throw _0x10d4d5;});}return _0x53bf14;})[_0x374e('0x28')](respondWithResult(_0x5791dc,0xc9))[_0x374e('0x4a')](handleError(_0x5791dc,null));};exports[_0x374e('0x57')]=function(_0x5b13c2,_0x444753){var _0x5f3f9b={'where':{'id':_0x5b13c2[_0x374e('0x4c')]['id']}},_0x5eca83={};_0x5eca83['model']=_['keys'](db[_0x374e('0x33')]['rawAttributes']);_0x5f3f9b['attributes']=_[_0x374e('0x3b')](_0x5eca83[_0x374e('0x37')],qs[_0x374e('0x3d')](_0x5b13c2[_0x374e('0x39')][_0x374e('0x3d')]));_0x5f3f9b['attributes']=_0x5f3f9b[_0x374e('0x3c')][_0x374e('0x3e')]?_0x5f3f9b['attributes']:_0x5eca83['model'];if(_0x5b13c2[_0x374e('0x39')][_0x374e('0x46')]){_0x5f3f9b['include']=[{'all':!![]}];}_0x5f3f9b=_['merge']({},_0x5f3f9b,_0x5b13c2[_0x374e('0x45')]);return db[_0x374e('0x33')][_0x374e('0x4d')](_0x5f3f9b)['then'](handleEntityNotFound(_0x444753,null))[_0x374e('0x28')](function(_0x1efcba){if(_0x1efcba){var _0x2781c4=_0x1efcba['get']({'plain':!![]});_0x2781c4=qs[_0x374e('0x58')](_0x2781c4,['id',_0x374e('0x59'),'updatedAt']);_0x5b13c2['body']=_['omit'](_0x5b13c2[_0x374e('0x4f')],['id',_0x374e('0x59'),_0x374e('0x5a')]);return db['Dashboard']['create'](_[_0x374e('0x44')](_0x2781c4,_0x5b13c2[_0x374e('0x4f')]),{'include':_0x5b13c2['query'][_0x374e('0x46')]?[{'all':!![]}]:undefined})[_0x374e('0x28')](function(_0x44f11b){var _0x9f867d=_0x5b13c2['user'][_0x374e('0x51')]({'plain':!![]});if(!_0x9f867d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x9f867d[_0x374e('0x52')]===_0x374e('0x50')){var _0x4f7687=_0x44f11b[_0x374e('0x51')]({'plain':!![]});var _0x3b6118=_0x374e('0x2a');return db['UserProfileSection'][_0x374e('0x4d')]({'where':{'name':_0x3b6118,'userProfileId':_0x9f867d[_0x374e('0x54')]},'raw':!![]})[_0x374e('0x28')](function(_0xee064e){if(_0xee064e&&_0xee064e[_0x374e('0x55')]===0x0){return db[_0x374e('0x2b')]['create']({'name':_0x4f7687['name'],'resourceId':_0x4f7687['id'],'type':_0xee064e[_0x374e('0x2f')],'sectionId':_0xee064e['id']},{})[_0x374e('0x28')](function(){return _0x44f11b;});}else{return _0x44f11b;}})[_0x374e('0x4a')](function(_0x25811c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x25811c);throw _0x25811c;});}return _0x44f11b;});}})[_0x374e('0x28')](respondWithResult(_0x444753,0xc9))[_0x374e('0x4a')](handleError(_0x444753,null));};exports['update']=function(_0x214feb,_0x136110){if(_0x214feb[_0x374e('0x4f')]['id']){delete _0x214feb[_0x374e('0x4f')]['id'];}return db[_0x374e('0x33')][_0x374e('0x4d')]({'where':{'id':_0x214feb[_0x374e('0x4c')]['id']}})[_0x374e('0x28')](handleEntityNotFound(_0x136110,null))['then'](saveUpdates(_0x214feb[_0x374e('0x4f')],null))[_0x374e('0x28')](respondWithResult(_0x136110,null))[_0x374e('0x4a')](handleError(_0x136110,null));};exports['destroy']=function(_0x26806f,_0x39d339){return db[_0x374e('0x33')][_0x374e('0x4d')]({'where':{'id':_0x26806f[_0x374e('0x4c')]['id']}})[_0x374e('0x28')](handleEntityNotFound(_0x39d339,null))[_0x374e('0x28')](removeEntity(_0x39d339,null))[_0x374e('0x4a')](handleError(_0x39d339,null));};function widgetAttributes(_0xcebfae){try{switch(_0xcebfae[_0x374e('0x35')]){case _0x374e('0x5b'):return[{'name':_0x374e('0x5c'),'value':_0xcebfae['attrUrl']||(_0xcebfae[_0x374e('0x5d')]&&_0xcebfae[_0x374e('0x5d')][0x0]?_0xcebfae[_0x374e('0x5d')][0x0][_0x374e('0x5e')]:undefined)||'https://'}];case'custom':return[{'name':_0x374e('0x5f'),'value':_0xcebfae[_0x374e('0x5f')]||(_0xcebfae[_0x374e('0x5d')]&&_0xcebfae['attrs'][0x0]?_0xcebfae[_0x374e('0x5d')][0x0][_0x374e('0x5e')]:undefined)||''}];case _0x374e('0x60'):return[{'name':_0x374e('0x61'),'value':_0xcebfae[_0x374e('0x61')]||(_0xcebfae[_0x374e('0x5d')]&&_0xcebfae['attrs'][0x0]?_0xcebfae[_0x374e('0x5d')][0x0]['value']:undefined)||_0x374e('0x62')},{'name':_0x374e('0x63'),'value':_0xcebfae[_0x374e('0x63')]||(_0xcebfae[_0x374e('0x5d')]&&_0xcebfae[_0x374e('0x5d')][0x1]?_0xcebfae['attrs'][0x1][_0x374e('0x5e')]:undefined)||_0x374e('0x64')},{'name':_0x374e('0x65'),'value':_0xcebfae[_0x374e('0x65')]||(_0xcebfae[_0x374e('0x5d')]&&_0xcebfae[_0x374e('0x5d')][0x2]?_0xcebfae[_0x374e('0x5d')][0x2][_0x374e('0x5e')]:undefined)||0xc}];case _0x374e('0x66'):return[{'name':_0x374e('0x67'),'value':_0xcebfae[_0x374e('0x67')]||(_0xcebfae['attrs']&&_0xcebfae[_0x374e('0x5d')][0x0]?_0xcebfae[_0x374e('0x5d')][0x0][_0x374e('0x5e')]:undefined)||'total'},{'name':_0x374e('0x68'),'value':_0xcebfae[_0x374e('0x68')]||(_0xcebfae[_0x374e('0x5d')]&&_0xcebfae[_0x374e('0x5d')][0x1]?_0xcebfae[_0x374e('0x5d')][0x1][_0x374e('0x5e')]:undefined)||[]},{'name':_0x374e('0x65'),'value':_0xcebfae[_0x374e('0x65')]||(_0xcebfae[_0x374e('0x5d')]&&_0xcebfae['attrs'][0x2]?_0xcebfae['attrs'][0x2][_0x374e('0x5e')]:undefined)||0x14},{'name':_0x374e('0x69'),'value':_0xcebfae[_0x374e('0x69')]||(_0xcebfae['attrs']&&_0xcebfae['attrs'][0x3]?_0xcebfae[_0x374e('0x5d')][0x3]['value']:undefined)||_0x374e('0x6a')},{'name':_0x374e('0x6b'),'value':_0xcebfae[_0x374e('0x6b')]||(_0xcebfae[_0x374e('0x5d')]&&_0xcebfae[_0x374e('0x5d')][0x4]?_0xcebfae[_0x374e('0x5d')][0x4][_0x374e('0x5e')]:undefined)||''},{'name':_0x374e('0x6c'),'value':_0xcebfae[_0x374e('0x6c')]||(_0xcebfae['attrs']&&_0xcebfae['attrs'][0x5]?_0xcebfae[_0x374e('0x5d')][0x5]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0xcebfae['attrSmsAccounts']||(_0xcebfae['attrs']&&_0xcebfae[_0x374e('0x5d')][0x6]?_0xcebfae[_0x374e('0x5d')][0x6][_0x374e('0x5e')]:undefined)||''},{'name':_0x374e('0x6d'),'value':_0xcebfae[_0x374e('0x6d')]||(_0xcebfae[_0x374e('0x5d')]&&_0xcebfae['attrs'][0x7]?_0xcebfae[_0x374e('0x5d')][0x7][_0x374e('0x5e')]:undefined)||''},{'name':_0x374e('0x6e'),'value':_0xcebfae[_0x374e('0x6e')]||(_0xcebfae[_0x374e('0x5d')]&&_0xcebfae[_0x374e('0x5d')][0x8]?_0xcebfae[_0x374e('0x5d')][0x8][_0x374e('0x5e')]:undefined)||''},{'name':_0x374e('0x6f'),'value':_0xcebfae[_0x374e('0x6f')]||(_0xcebfae[_0x374e('0x5d')]&&_0xcebfae[_0x374e('0x5d')][0x9]?_0xcebfae[_0x374e('0x5d')][0x9]['value']:undefined)||''}];case'multibar-chart':case'pie-chart':return[{'name':_0x374e('0x70'),'value':_0xcebfae[_0x374e('0x70')]||(_0xcebfae[_0x374e('0x5d')]&&_0xcebfae['attrs'][0x0]?_0xcebfae['attrs'][0x0]['value']:undefined)||_0x374e('0x71')},{'name':_0x374e('0x72'),'value':_0xcebfae[_0x374e('0x72')]||(_0xcebfae[_0x374e('0x5d')]&&_0xcebfae[_0x374e('0x5d')][0x1]?_0xcebfae[_0x374e('0x5d')][0x1][_0x374e('0x5e')]:undefined)||null},{'name':_0x374e('0x73'),'value':_0xcebfae['attrSerie3']||(_0xcebfae[_0x374e('0x5d')]&&_0xcebfae[_0x374e('0x5d')][0x2]?_0xcebfae[_0x374e('0x5d')][0x2][_0x374e('0x5e')]:undefined)||null},{'name':_0x374e('0x68'),'value':_0xcebfae[_0x374e('0x68')]||(_0xcebfae[_0x374e('0x5d')]&&_0xcebfae[_0x374e('0x5d')][0x3]?_0xcebfae[_0x374e('0x5d')][0x3][_0x374e('0x5e')]:undefined)||[]},{'name':_0x374e('0x69'),'value':_0xcebfae[_0x374e('0x69')]||(_0xcebfae['attrs']&&_0xcebfae[_0x374e('0x5d')][0x4]?_0xcebfae[_0x374e('0x5d')][0x4][_0x374e('0x5e')]:undefined)||_0x374e('0x6a')},{'name':_0x374e('0x6b'),'value':_0xcebfae['attrEmailAccounts']||(_0xcebfae['attrs']&&_0xcebfae[_0x374e('0x5d')][0x5]?_0xcebfae['attrs'][0x5]['value']:undefined)||''},{'name':_0x374e('0x6c'),'value':_0xcebfae[_0x374e('0x6c')]||(_0xcebfae[_0x374e('0x5d')]&&_0xcebfae['attrs'][0x6]?_0xcebfae[_0x374e('0x5d')][0x6][_0x374e('0x5e')]:undefined)||''},{'name':_0x374e('0x74'),'value':_0xcebfae[_0x374e('0x74')]||(_0xcebfae['attrs']&&_0xcebfae[_0x374e('0x5d')][0x7]?_0xcebfae[_0x374e('0x5d')][0x7][_0x374e('0x5e')]:undefined)||''},{'name':_0x374e('0x6d'),'value':_0xcebfae[_0x374e('0x6d')]||(_0xcebfae[_0x374e('0x5d')]&&_0xcebfae['attrs'][0x8]?_0xcebfae[_0x374e('0x5d')][0x8]['value']:undefined)||''},{'name':_0x374e('0x6e'),'value':_0xcebfae['attrWhatsappAccounts']||(_0xcebfae[_0x374e('0x5d')]&&_0xcebfae[_0x374e('0x5d')][0x9]?_0xcebfae[_0x374e('0x5d')][0x9][_0x374e('0x5e')]:undefined)||''},{'name':_0x374e('0x6f'),'value':_0xcebfae[_0x374e('0x6f')]||(_0xcebfae[_0x374e('0x5d')]&&_0xcebfae['attrs'][0xa]?_0xcebfae['attrs'][0xa]['value']:undefined)||''}];case _0x374e('0x75'):return[{'name':_0x374e('0x76'),'type':_0xcebfae[_0x374e('0x77')]||(_0xcebfae[_0x374e('0x5d')]&&_0xcebfae[_0x374e('0x5d')][0x0]?_0xcebfae[_0x374e('0x5d')][0x0]['type']:undefined)||null,'value':_0xcebfae[_0x374e('0x76')]||(_0xcebfae['attrs']&&_0xcebfae['attrs'][0x0]?_0xcebfae['attrs'][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0xcebfae[_0x374e('0x78')]||(_0xcebfae[_0x374e('0x5d')]&&_0xcebfae[_0x374e('0x5d')][0x1]?_0xcebfae[_0x374e('0x5d')][0x1][_0x374e('0x5e')]:undefined)||0x0}];default:return[];}}catch(_0x1040dd){logger[_0x374e('0x2d')](_0x374e('0x79'),JSON['stringify'](_0x1040dd));return[];}}exports[_0x374e('0x7a')]=function(_0x57a112,_0x4c177e,_0x367e0e){if(_0x57a112[_0x374e('0x4f')]['id']){delete _0x57a112[_0x374e('0x4f')]['id'];}return db[_0x374e('0x33')][_0x374e('0x4d')]({'where':{'id':_0x57a112[_0x374e('0x4c')]['id']}})[_0x374e('0x28')](handleEntityNotFound(_0x4c177e,null))[_0x374e('0x28')](function(_0x3701fe){if(_0x3701fe){_0x57a112['body'][_0x374e('0x7b')]=_0x3701fe['id'];_0x57a112['body'][_0x374e('0x5d')]=widgetAttributes(_0x57a112[_0x374e('0x4f')]);return db[_0x374e('0x7c')]['create'](_0x57a112['body']);}})[_0x374e('0x28')](respondWithResult(_0x4c177e,null))[_0x374e('0x4a')](handleError(_0x4c177e,null));};exports[_0x374e('0x7d')]=function(_0x3a3b09,_0x289013,_0x5cdee0){var _0x51ee42={};var _0x1c681e={};var _0x11ddd8;var _0x20051a;return db['Dashboard'][_0x374e('0x7e')]({'where':{'id':_0x3a3b09[_0x374e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x289013,null))[_0x374e('0x28')](function(_0x438308){if(_0x438308){_0x11ddd8=_0x438308;_0x1c681e[_0x374e('0x37')]=_['keys'](db[_0x374e('0x7c')][_0x374e('0x34')]);_0x1c681e[_0x374e('0x39')]=_[_0x374e('0x38')](_0x3a3b09[_0x374e('0x39')]);_0x1c681e[_0x374e('0x3a')]=_[_0x374e('0x3b')](_0x1c681e[_0x374e('0x37')],_0x1c681e[_0x374e('0x39')]);_0x51ee42[_0x374e('0x3c')]=_['intersection'](_0x1c681e['model'],qs['fields'](_0x3a3b09['query'][_0x374e('0x3d')]));_0x51ee42[_0x374e('0x3c')]=_0x51ee42[_0x374e('0x3c')][_0x374e('0x3e')]?_0x51ee42[_0x374e('0x3c')]:_0x1c681e[_0x374e('0x37')];_0x51ee42[_0x374e('0x7f')]=qs[_0x374e('0x41')](_0x3a3b09['query'][_0x374e('0x41')]);_0x51ee42[_0x374e('0x42')]=qs[_0x374e('0x3a')](_[_0x374e('0x80')](_0x3a3b09[_0x374e('0x39')],_0x1c681e[_0x374e('0x3a')]));if(_0x3a3b09['query'][_0x374e('0x81')]){_0x51ee42[_0x374e('0x42')]=_[_0x374e('0x44')](_0x51ee42[_0x374e('0x42')],{'$or':_[_0x374e('0x32')](_0x51ee42['attributes'],function(_0x4904d7){var _0x28919d={};_0x28919d[_0x4904d7]={'$like':'%'+_0x3a3b09[_0x374e('0x39')][_0x374e('0x81')]+'%'};return _0x28919d;})});}_0x51ee42=_[_0x374e('0x44')]({},_0x51ee42,_0x3a3b09['options']);return _0x11ddd8[_0x374e('0x7d')](_0x51ee42);}})[_0x374e('0x28')](function(_0x290d5e){if(_0x290d5e){_0x20051a=_0x290d5e[_0x374e('0x3e')];if(!_0x3a3b09[_0x374e('0x39')][_0x374e('0x3f')](_0x374e('0x40'))){_0x51ee42[_0x374e('0x20')]=qs[_0x374e('0x20')](_0x3a3b09[_0x374e('0x39')][_0x374e('0x20')]);_0x51ee42[_0x374e('0x22')]=qs[_0x374e('0x22')](_0x3a3b09[_0x374e('0x39')][_0x374e('0x22')]);}return _0x11ddd8[_0x374e('0x7d')](_0x51ee42);}})['then'](function(_0x17f364){if(_0x17f364){return _0x17f364?{'count':_0x20051a,'rows':_0x17f364}:null;}})['then'](respondWithResult(_0x289013,null))[_0x374e('0x4a')](handleError(_0x289013,null));}; \ No newline at end of file +var _0x1ac7=['crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','json','undefined','limit','count','offset','set','apply','reject','then','destroy','get','CustomDashboards','UserProfileResource','status','end','error','stack','name','send','map','Dashboard','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','include','find','catch','create','body','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','update','iframe','attrUrl','attrs','value','https://','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrEmailAccounts','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','getItems','findOne','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel'];(function(_0x5acfd3,_0x50089d){var _0x21566c=function(_0x243d3e){while(--_0x243d3e){_0x5acfd3['push'](_0x5acfd3['shift']());}};_0x21566c(++_0x50089d);}(_0x1ac7,0x16b));var _0x71ac=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x1ac7[_0x4b73a2];return _0x383c66;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x71ac('0x0'));var zipdir=require(_0x71ac('0x1'));var jsonpatch=require(_0x71ac('0x2'));var rp=require(_0x71ac('0x3'));var moment=require(_0x71ac('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x71ac('0x5'));var util=require(_0x71ac('0x6'));var path=require(_0x71ac('0x7'));var sox=require('sox');var csv=require(_0x71ac('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71ac('0x9'));var _=require(_0x71ac('0xa'));var squel=require(_0x71ac('0xb'));var crypto=require(_0x71ac('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x71ac('0x8'));var querystring=require('querystring');var Papa=require(_0x71ac('0xd'));var Redis=require(_0x71ac('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x71ac('0xf'));var as=require(_0x71ac('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x71ac('0x11'));var utils=require('../../config/utils');var config=require(_0x71ac('0x12'));var licenseUtil=require(_0x71ac('0x13'));var db=require(_0x71ac('0x14'))['db'];config[_0x71ac('0x15')]=_[_0x71ac('0x16')](config[_0x71ac('0x15')],{'host':_0x71ac('0x17'),'port':0x18eb});var socket=require(_0x71ac('0x18'))(new Redis(config[_0x71ac('0x15')]));require(_0x71ac('0x19'))['register'](socket);function respondWithStatusCode(_0x1aa10c,_0x3d3eef){_0x3d3eef=_0x3d3eef||0xcc;return function(_0x3e3696){if(_0x3e3696){return _0x1aa10c['sendStatus'](_0x3d3eef);}return _0x1aa10c['status'](_0x3d3eef)['end']();};}function respondWithResult(_0x2952af,_0x41e4e9){_0x41e4e9=_0x41e4e9||0xc8;return function(_0x426881){if(_0x426881){return _0x2952af['status'](_0x41e4e9)[_0x71ac('0x1a')](_0x426881);}};}function respondWithFilteredResult(_0x6878ad,_0x4c9b49){return function(_0x5c4f1b){if(_0x5c4f1b){var _0x2cc8c5=typeof _0x4c9b49['offset']===_0x71ac('0x1b')&&typeof _0x4c9b49[_0x71ac('0x1c')]===_0x71ac('0x1b');var _0x1551f2=_0x5c4f1b[_0x71ac('0x1d')];var _0x118be2=_0x2cc8c5?0x0:_0x4c9b49[_0x71ac('0x1e')];var _0x5c9856=_0x2cc8c5?_0x5c4f1b[_0x71ac('0x1d')]:_0x4c9b49[_0x71ac('0x1e')]+_0x4c9b49[_0x71ac('0x1c')];var _0x154f49;if(_0x5c9856>=_0x1551f2){_0x5c9856=_0x1551f2;_0x154f49=0xc8;}else{_0x154f49=0xce;}_0x6878ad['status'](_0x154f49);return _0x6878ad[_0x71ac('0x1f')]('Content-Range',_0x118be2+'-'+_0x5c9856+'/'+_0x1551f2)[_0x71ac('0x1a')](_0x5c4f1b);}return null;};}function patchUpdates(_0x14daee){return function(_0x2e2501){try{jsonpatch[_0x71ac('0x20')](_0x2e2501,_0x14daee,!![]);}catch(_0x20ad71){return BPromise[_0x71ac('0x21')](_0x20ad71);}return _0x2e2501['save']();};}function saveUpdates(_0x1131a5,_0x425c31){return function(_0x1193a7){if(_0x1193a7){return _0x1193a7['update'](_0x1131a5)[_0x71ac('0x22')](function(_0x14d43a){return _0x14d43a;});}return null;};}function removeEntity(_0x18c0bb,_0x1b4294){return function(_0x5e0d35){if(_0x5e0d35){return _0x5e0d35[_0x71ac('0x23')]()[_0x71ac('0x22')](function(){var _0x4f8c03=_0x5e0d35[_0x71ac('0x24')]({'plain':!![]});var _0x132ad7=_0x71ac('0x25');return db[_0x71ac('0x26')]['destroy']({'where':{'type':_0x132ad7,'resourceId':_0x4f8c03['id']}})[_0x71ac('0x22')](function(){return _0x5e0d35;});})[_0x71ac('0x22')](function(){_0x18c0bb[_0x71ac('0x27')](0xcc)[_0x71ac('0x28')]();});}};}function handleEntityNotFound(_0x5ec4f9,_0x293d89){return function(_0x275421){if(!_0x275421){_0x5ec4f9['sendStatus'](0x194);}return _0x275421;};}function handleError(_0x372876,_0x366eee){_0x366eee=_0x366eee||0x1f4;return function(_0x2c6804){logger[_0x71ac('0x29')](_0x2c6804[_0x71ac('0x2a')]);if(_0x2c6804[_0x71ac('0x2b')]){delete _0x2c6804[_0x71ac('0x2b')];}_0x372876[_0x71ac('0x27')](_0x366eee)[_0x71ac('0x2c')](_0x2c6804);};}exports['index']=function(_0xcc261d,_0x2c842c){var _0x34cd0e={},_0x54ac67={},_0x308d7c={'count':0x0,'rows':[]};var _0x262694=_[_0x71ac('0x2d')](db[_0x71ac('0x2e')][_0x71ac('0x2f')],function(_0x256d22){return{'name':_0x256d22[_0x71ac('0x30')],'type':_0x256d22['type'][_0x71ac('0x31')]};});_0x54ac67[_0x71ac('0x32')]=_[_0x71ac('0x2d')](_0x262694,_0x71ac('0x2b'));_0x54ac67['query']=_['keys'](_0xcc261d[_0x71ac('0x33')]);_0x54ac67[_0x71ac('0x34')]=_[_0x71ac('0x35')](_0x54ac67[_0x71ac('0x32')],_0x54ac67[_0x71ac('0x33')]);_0x34cd0e[_0x71ac('0x36')]=_['intersection'](_0x54ac67[_0x71ac('0x32')],qs[_0x71ac('0x37')](_0xcc261d[_0x71ac('0x33')][_0x71ac('0x37')]));_0x34cd0e[_0x71ac('0x36')]=_0x34cd0e[_0x71ac('0x36')][_0x71ac('0x38')]?_0x34cd0e[_0x71ac('0x36')]:_0x54ac67['model'];if(!_0xcc261d[_0x71ac('0x33')][_0x71ac('0x39')]('nolimit')){_0x34cd0e[_0x71ac('0x1c')]=qs['limit'](_0xcc261d['query'][_0x71ac('0x1c')]);_0x34cd0e[_0x71ac('0x1e')]=qs[_0x71ac('0x1e')](_0xcc261d[_0x71ac('0x33')][_0x71ac('0x1e')]);}_0x34cd0e[_0x71ac('0x3a')]=qs[_0x71ac('0x3b')](_0xcc261d['query'][_0x71ac('0x3b')]);_0x34cd0e['where']=qs[_0x71ac('0x34')](_[_0x71ac('0x3c')](_0xcc261d['query'],_0x54ac67[_0x71ac('0x34')]),_0x262694);if(_0xcc261d['query'][_0x71ac('0x3d')]){_0x34cd0e[_0x71ac('0x3e')]=_[_0x71ac('0x3f')](_0x34cd0e[_0x71ac('0x3e')],{'$or':_['map'](_0x262694,function(_0x60eceb){if(_0x60eceb[_0x71ac('0x40')]!==_0x71ac('0x41')){var _0x28bd2e={};_0x28bd2e[_0x60eceb[_0x71ac('0x2b')]]={'$like':'%'+_0xcc261d[_0x71ac('0x33')][_0x71ac('0x3d')]+'%'};return _0x28bd2e;}})});}_0x34cd0e=_['merge']({},_0x34cd0e,_0xcc261d[_0x71ac('0x42')]);var _0x3c7d3a={'where':_0x34cd0e[_0x71ac('0x3e')]};return db[_0x71ac('0x2e')][_0x71ac('0x1d')](_0x3c7d3a)[_0x71ac('0x22')](function(_0x398633){_0x308d7c[_0x71ac('0x1d')]=_0x398633;if(_0xcc261d['query'][_0x71ac('0x43')]){_0x34cd0e['include']=[{'all':!![]}];}return db[_0x71ac('0x2e')][_0x71ac('0x44')](_0x34cd0e);})[_0x71ac('0x22')](function(_0x1d045c){_0x308d7c[_0x71ac('0x45')]=_0x1d045c;return _0x308d7c;})[_0x71ac('0x22')](respondWithFilteredResult(_0x2c842c,_0x34cd0e))['catch'](handleError(_0x2c842c,null));};exports[_0x71ac('0x46')]=function(_0x473c40,_0x1bbc28){var _0x53428d={'raw':![],'where':{'id':_0x473c40[_0x71ac('0x47')]['id']}},_0x5e728d={};_0x5e728d['model']=_[_0x71ac('0x48')](db[_0x71ac('0x2e')][_0x71ac('0x2f')]);_0x5e728d[_0x71ac('0x33')]=_[_0x71ac('0x48')](_0x473c40[_0x71ac('0x33')]);_0x5e728d[_0x71ac('0x34')]=_[_0x71ac('0x35')](_0x5e728d['model'],_0x5e728d[_0x71ac('0x33')]);_0x53428d['attributes']=_['intersection'](_0x5e728d[_0x71ac('0x32')],qs[_0x71ac('0x37')](_0x473c40[_0x71ac('0x33')]['fields']));_0x53428d[_0x71ac('0x36')]=_0x53428d[_0x71ac('0x36')][_0x71ac('0x38')]?_0x53428d['attributes']:_0x5e728d[_0x71ac('0x32')];if(_0x473c40['query']['includeAll']){_0x53428d[_0x71ac('0x49')]=[{'all':!![]}];}_0x53428d=_['merge']({},_0x53428d,_0x473c40[_0x71ac('0x42')]);return db[_0x71ac('0x2e')][_0x71ac('0x4a')](_0x53428d)[_0x71ac('0x22')](handleEntityNotFound(_0x1bbc28,null))['then'](respondWithResult(_0x1bbc28,null))[_0x71ac('0x4b')](handleError(_0x1bbc28,null));};exports[_0x71ac('0x4c')]=function(_0x23baab,_0x45462e){return db[_0x71ac('0x2e')]['create'](_0x23baab[_0x71ac('0x4d')],{})[_0x71ac('0x22')](function(_0x226c0e){var _0xfb14a2=_0x23baab[_0x71ac('0x4e')][_0x71ac('0x24')]({'plain':!![]});if(!_0xfb14a2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfb14a2['role']===_0x71ac('0x4e')){var _0x2cd821=_0x226c0e[_0x71ac('0x24')]({'plain':!![]});var _0x596eaf=_0x71ac('0x25');return db[_0x71ac('0x4f')][_0x71ac('0x4a')]({'where':{'name':_0x596eaf,'userProfileId':_0xfb14a2['userProfileId']},'raw':!![]})['then'](function(_0x17c669){if(_0x17c669&&_0x17c669[_0x71ac('0x50')]===0x0){return db[_0x71ac('0x26')]['create']({'name':_0x2cd821[_0x71ac('0x2b')],'resourceId':_0x2cd821['id'],'type':_0x17c669[_0x71ac('0x2b')],'sectionId':_0x17c669['id']},{})[_0x71ac('0x22')](function(){return _0x226c0e;});}else{return _0x226c0e;}})[_0x71ac('0x4b')](function(_0x3cc5ae){logger['error'](_0x71ac('0x51'),_0x3cc5ae);throw _0x3cc5ae;});}return _0x226c0e;})[_0x71ac('0x22')](respondWithResult(_0x45462e,0xc9))[_0x71ac('0x4b')](handleError(_0x45462e,null));};exports[_0x71ac('0x52')]=function(_0x5bb2a8,_0x16e6de){var _0x19b8eb={'where':{'id':_0x5bb2a8[_0x71ac('0x47')]['id']}},_0x2bbc3a={};_0x2bbc3a[_0x71ac('0x32')]=_[_0x71ac('0x48')](db[_0x71ac('0x2e')][_0x71ac('0x2f')]);_0x19b8eb[_0x71ac('0x36')]=_[_0x71ac('0x35')](_0x2bbc3a[_0x71ac('0x32')],qs[_0x71ac('0x37')](_0x5bb2a8[_0x71ac('0x33')][_0x71ac('0x37')]));_0x19b8eb['attributes']=_0x19b8eb['attributes'][_0x71ac('0x38')]?_0x19b8eb['attributes']:_0x2bbc3a[_0x71ac('0x32')];if(_0x5bb2a8[_0x71ac('0x33')][_0x71ac('0x43')]){_0x19b8eb['include']=[{'all':!![]}];}_0x19b8eb=_['merge']({},_0x19b8eb,_0x5bb2a8[_0x71ac('0x42')]);return db[_0x71ac('0x2e')]['find'](_0x19b8eb)[_0x71ac('0x22')](handleEntityNotFound(_0x16e6de,null))[_0x71ac('0x22')](function(_0x25a262){if(_0x25a262){var _0xd3be7d=_0x25a262['get']({'plain':!![]});_0xd3be7d=qs[_0x71ac('0x53')](_0xd3be7d,['id',_0x71ac('0x54'),_0x71ac('0x55')]);_0x5bb2a8['body']=_['omit'](_0x5bb2a8[_0x71ac('0x4d')],['id','createdAt',_0x71ac('0x55')]);return db[_0x71ac('0x2e')][_0x71ac('0x4c')](_[_0x71ac('0x3f')](_0xd3be7d,_0x5bb2a8[_0x71ac('0x4d')]),{'include':_0x5bb2a8[_0x71ac('0x33')][_0x71ac('0x43')]?[{'all':!![]}]:undefined})[_0x71ac('0x22')](function(_0x348a57){var _0x13441c=_0x5bb2a8['user'][_0x71ac('0x24')]({'plain':!![]});if(!_0x13441c)throw new Error(_0x71ac('0x56'));if(_0x13441c['role']===_0x71ac('0x4e')){var _0x166e4d=_0x348a57[_0x71ac('0x24')]({'plain':!![]});var _0x519a4e=_0x71ac('0x25');return db[_0x71ac('0x4f')][_0x71ac('0x4a')]({'where':{'name':_0x519a4e,'userProfileId':_0x13441c[_0x71ac('0x57')]},'raw':!![]})[_0x71ac('0x22')](function(_0x2680ad){if(_0x2680ad&&_0x2680ad['autoAssociation']===0x0){return db[_0x71ac('0x26')]['create']({'name':_0x166e4d['name'],'resourceId':_0x166e4d['id'],'type':_0x2680ad['name'],'sectionId':_0x2680ad['id']},{})[_0x71ac('0x22')](function(){return _0x348a57;});}else{return _0x348a57;}})[_0x71ac('0x4b')](function(_0x4cd2f9){logger['error'](_0x71ac('0x51'),_0x4cd2f9);throw _0x4cd2f9;});}return _0x348a57;});}})[_0x71ac('0x22')](respondWithResult(_0x16e6de,0xc9))[_0x71ac('0x4b')](handleError(_0x16e6de,null));};exports[_0x71ac('0x58')]=function(_0xe9f5b4,_0x9530f1){if(_0xe9f5b4[_0x71ac('0x4d')]['id']){delete _0xe9f5b4[_0x71ac('0x4d')]['id'];}return db[_0x71ac('0x2e')][_0x71ac('0x4a')]({'where':{'id':_0xe9f5b4['params']['id']}})[_0x71ac('0x22')](handleEntityNotFound(_0x9530f1,null))[_0x71ac('0x22')](saveUpdates(_0xe9f5b4['body'],null))[_0x71ac('0x22')](respondWithResult(_0x9530f1,null))[_0x71ac('0x4b')](handleError(_0x9530f1,null));};exports[_0x71ac('0x23')]=function(_0x5eaf07,_0x23e414){return db[_0x71ac('0x2e')][_0x71ac('0x4a')]({'where':{'id':_0x5eaf07[_0x71ac('0x47')]['id']}})[_0x71ac('0x22')](handleEntityNotFound(_0x23e414,null))[_0x71ac('0x22')](removeEntity(_0x23e414,null))['catch'](handleError(_0x23e414,null));};function widgetAttributes(_0x401a69){try{switch(_0x401a69[_0x71ac('0x40')]){case _0x71ac('0x59'):return[{'name':_0x71ac('0x5a'),'value':_0x401a69[_0x71ac('0x5a')]||(_0x401a69[_0x71ac('0x5b')]&&_0x401a69['attrs'][0x0]?_0x401a69[_0x71ac('0x5b')][0x0][_0x71ac('0x5c')]:undefined)||_0x71ac('0x5d')}];case'custom':return[{'name':'attrPath','value':_0x401a69[_0x71ac('0x5e')]||(_0x401a69[_0x71ac('0x5b')]&&_0x401a69[_0x71ac('0x5b')][0x0]?_0x401a69[_0x71ac('0x5b')][0x0][_0x71ac('0x5c')]:undefined)||''}];case'clock':return[{'name':_0x71ac('0x5f'),'value':_0x401a69[_0x71ac('0x5f')]||(_0x401a69[_0x71ac('0x5b')]&&_0x401a69[_0x71ac('0x5b')][0x0]?_0x401a69[_0x71ac('0x5b')][0x0][_0x71ac('0x5c')]:undefined)||_0x71ac('0x60')},{'name':_0x71ac('0x61'),'value':_0x401a69[_0x71ac('0x61')]||(_0x401a69['attrs']&&_0x401a69[_0x71ac('0x5b')][0x1]?_0x401a69['attrs'][0x1][_0x71ac('0x5c')]:undefined)||'0.00'},{'name':_0x71ac('0x62'),'value':_0x401a69[_0x71ac('0x62')]||(_0x401a69[_0x71ac('0x5b')]&&_0x401a69[_0x71ac('0x5b')][0x2]?_0x401a69['attrs'][0x2][_0x71ac('0x5c')]:undefined)||0xc}];case _0x71ac('0x63'):return[{'name':_0x71ac('0x64'),'value':_0x401a69[_0x71ac('0x64')]||(_0x401a69['attrs']&&_0x401a69[_0x71ac('0x5b')][0x0]?_0x401a69['attrs'][0x0]['value']:undefined)||'total'},{'name':_0x71ac('0x65'),'value':_0x401a69['attrVoiceQueues']||(_0x401a69['attrs']&&_0x401a69['attrs'][0x1]?_0x401a69[_0x71ac('0x5b')][0x1][_0x71ac('0x5c')]:undefined)||[]},{'name':'attrFontSize','value':_0x401a69[_0x71ac('0x62')]||(_0x401a69[_0x71ac('0x5b')]&&_0x401a69[_0x71ac('0x5b')][0x2]?_0x401a69[_0x71ac('0x5b')][0x2]['value']:undefined)||0x14},{'name':_0x71ac('0x66'),'value':_0x401a69[_0x71ac('0x66')]||(_0x401a69[_0x71ac('0x5b')]&&_0x401a69['attrs'][0x3]?_0x401a69[_0x71ac('0x5b')][0x3]['value']:undefined)||_0x71ac('0x67')},{'name':'attrEmailAccounts','value':_0x401a69['attrEmailAccounts']||(_0x401a69[_0x71ac('0x5b')]&&_0x401a69[_0x71ac('0x5b')][0x4]?_0x401a69[_0x71ac('0x5b')][0x4][_0x71ac('0x5c')]:undefined)||''},{'name':_0x71ac('0x68'),'value':_0x401a69['attrFaxAccounts']||(_0x401a69[_0x71ac('0x5b')]&&_0x401a69[_0x71ac('0x5b')][0x5]?_0x401a69[_0x71ac('0x5b')][0x5][_0x71ac('0x5c')]:undefined)||''},{'name':_0x71ac('0x69'),'value':_0x401a69[_0x71ac('0x69')]||(_0x401a69['attrs']&&_0x401a69[_0x71ac('0x5b')][0x6]?_0x401a69[_0x71ac('0x5b')][0x6]['value']:undefined)||''},{'name':_0x71ac('0x6a'),'value':_0x401a69[_0x71ac('0x6a')]||(_0x401a69[_0x71ac('0x5b')]&&_0x401a69[_0x71ac('0x5b')][0x7]?_0x401a69['attrs'][0x7][_0x71ac('0x5c')]:undefined)||''},{'name':_0x71ac('0x6b'),'value':_0x401a69[_0x71ac('0x6b')]||(_0x401a69['attrs']&&_0x401a69[_0x71ac('0x5b')][0x8]?_0x401a69[_0x71ac('0x5b')][0x8][_0x71ac('0x5c')]:undefined)||''},{'name':_0x71ac('0x6c'),'value':_0x401a69[_0x71ac('0x6c')]||(_0x401a69[_0x71ac('0x5b')]&&_0x401a69[_0x71ac('0x5b')][0x9]?_0x401a69[_0x71ac('0x5b')][0x9]['value']:undefined)||''}];case _0x71ac('0x6d'):case _0x71ac('0x6e'):return[{'name':_0x71ac('0x6f'),'value':_0x401a69['attrSerie1']||(_0x401a69[_0x71ac('0x5b')]&&_0x401a69[_0x71ac('0x5b')][0x0]?_0x401a69[_0x71ac('0x5b')][0x0][_0x71ac('0x5c')]:undefined)||'total'},{'name':_0x71ac('0x70'),'value':_0x401a69[_0x71ac('0x70')]||(_0x401a69[_0x71ac('0x5b')]&&_0x401a69[_0x71ac('0x5b')][0x1]?_0x401a69[_0x71ac('0x5b')][0x1]['value']:undefined)||null},{'name':_0x71ac('0x71'),'value':_0x401a69[_0x71ac('0x71')]||(_0x401a69[_0x71ac('0x5b')]&&_0x401a69[_0x71ac('0x5b')][0x2]?_0x401a69[_0x71ac('0x5b')][0x2][_0x71ac('0x5c')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x401a69['attrVoiceQueues']||(_0x401a69['attrs']&&_0x401a69[_0x71ac('0x5b')][0x3]?_0x401a69[_0x71ac('0x5b')][0x3][_0x71ac('0x5c')]:undefined)||[]},{'name':_0x71ac('0x66'),'value':_0x401a69['attrChannel']||(_0x401a69['attrs']&&_0x401a69[_0x71ac('0x5b')][0x4]?_0x401a69[_0x71ac('0x5b')][0x4][_0x71ac('0x5c')]:undefined)||_0x71ac('0x67')},{'name':_0x71ac('0x72'),'value':_0x401a69['attrEmailAccounts']||(_0x401a69['attrs']&&_0x401a69[_0x71ac('0x5b')][0x5]?_0x401a69[_0x71ac('0x5b')][0x5][_0x71ac('0x5c')]:undefined)||''},{'name':_0x71ac('0x68'),'value':_0x401a69[_0x71ac('0x68')]||(_0x401a69['attrs']&&_0x401a69[_0x71ac('0x5b')][0x6]?_0x401a69[_0x71ac('0x5b')][0x6]['value']:undefined)||''},{'name':_0x71ac('0x69'),'value':_0x401a69[_0x71ac('0x69')]||(_0x401a69[_0x71ac('0x5b')]&&_0x401a69[_0x71ac('0x5b')][0x7]?_0x401a69[_0x71ac('0x5b')][0x7][_0x71ac('0x5c')]:undefined)||''},{'name':_0x71ac('0x6a'),'value':_0x401a69[_0x71ac('0x6a')]||(_0x401a69[_0x71ac('0x5b')]&&_0x401a69[_0x71ac('0x5b')][0x8]?_0x401a69[_0x71ac('0x5b')][0x8][_0x71ac('0x5c')]:undefined)||''},{'name':_0x71ac('0x6b'),'value':_0x401a69['attrWhatsappAccounts']||(_0x401a69['attrs']&&_0x401a69[_0x71ac('0x5b')][0x9]?_0x401a69[_0x71ac('0x5b')][0x9][_0x71ac('0x5c')]:undefined)||''},{'name':_0x71ac('0x6c'),'value':_0x401a69[_0x71ac('0x6c')]||(_0x401a69[_0x71ac('0x5b')]&&_0x401a69[_0x71ac('0x5b')][0xa]?_0x401a69[_0x71ac('0x5b')][0xa][_0x71ac('0x5c')]:undefined)||''}];case _0x71ac('0x73'):return[{'name':_0x71ac('0x74'),'type':_0x401a69[_0x71ac('0x75')]||(_0x401a69['attrs']&&_0x401a69[_0x71ac('0x5b')][0x0]?_0x401a69[_0x71ac('0x5b')][0x0][_0x71ac('0x40')]:undefined)||null,'value':_0x401a69[_0x71ac('0x74')]||(_0x401a69['attrs']&&_0x401a69['attrs'][0x0]?_0x401a69[_0x71ac('0x5b')][0x0][_0x71ac('0x5c')]:undefined)||null},{'name':'attrRefresh','value':_0x401a69[_0x71ac('0x76')]||(_0x401a69['attrs']&&_0x401a69[_0x71ac('0x5b')][0x1]?_0x401a69[_0x71ac('0x5b')][0x1][_0x71ac('0x5c')]:undefined)||0x0}];default:return[];}}catch(_0x3f61b8){logger[_0x71ac('0x29')](_0x71ac('0x77'),JSON['stringify'](_0x3f61b8));return[];}}exports[_0x71ac('0x78')]=function(_0x2bb6db,_0x6b1d78,_0xe3ba20){if(_0x2bb6db[_0x71ac('0x4d')]['id']){delete _0x2bb6db[_0x71ac('0x4d')]['id'];}return db[_0x71ac('0x2e')][_0x71ac('0x4a')]({'where':{'id':_0x2bb6db[_0x71ac('0x47')]['id']}})[_0x71ac('0x22')](handleEntityNotFound(_0x6b1d78,null))[_0x71ac('0x22')](function(_0x3e2b5f){if(_0x3e2b5f){_0x2bb6db['body'][_0x71ac('0x79')]=_0x3e2b5f['id'];_0x2bb6db['body'][_0x71ac('0x5b')]=widgetAttributes(_0x2bb6db['body']);return db['DashboardItem']['create'](_0x2bb6db[_0x71ac('0x4d')]);}})[_0x71ac('0x22')](respondWithResult(_0x6b1d78,null))[_0x71ac('0x4b')](handleError(_0x6b1d78,null));};exports[_0x71ac('0x7a')]=function(_0x1605a7,_0xc82d60,_0x1091bc){var _0x43f3ab={};var _0x25f85d={};var _0x5731f2;var _0xbe3a3;return db['Dashboard'][_0x71ac('0x7b')]({'where':{'id':_0x1605a7[_0x71ac('0x47')]['id']}})['then'](handleEntityNotFound(_0xc82d60,null))[_0x71ac('0x22')](function(_0x688066){if(_0x688066){_0x5731f2=_0x688066;_0x25f85d[_0x71ac('0x32')]=_[_0x71ac('0x48')](db['DashboardItem'][_0x71ac('0x2f')]);_0x25f85d[_0x71ac('0x33')]=_[_0x71ac('0x48')](_0x1605a7['query']);_0x25f85d[_0x71ac('0x34')]=_['intersection'](_0x25f85d[_0x71ac('0x32')],_0x25f85d[_0x71ac('0x33')]);_0x43f3ab[_0x71ac('0x36')]=_[_0x71ac('0x35')](_0x25f85d[_0x71ac('0x32')],qs[_0x71ac('0x37')](_0x1605a7['query'][_0x71ac('0x37')]));_0x43f3ab[_0x71ac('0x36')]=_0x43f3ab[_0x71ac('0x36')][_0x71ac('0x38')]?_0x43f3ab['attributes']:_0x25f85d[_0x71ac('0x32')];_0x43f3ab[_0x71ac('0x3a')]=qs[_0x71ac('0x3b')](_0x1605a7[_0x71ac('0x33')][_0x71ac('0x3b')]);_0x43f3ab[_0x71ac('0x3e')]=qs[_0x71ac('0x34')](_['pick'](_0x1605a7[_0x71ac('0x33')],_0x25f85d[_0x71ac('0x34')]));if(_0x1605a7['query'][_0x71ac('0x3d')]){_0x43f3ab[_0x71ac('0x3e')]=_[_0x71ac('0x3f')](_0x43f3ab[_0x71ac('0x3e')],{'$or':_[_0x71ac('0x2d')](_0x43f3ab['attributes'],function(_0x26bcac){var _0xb91666={};_0xb91666[_0x26bcac]={'$like':'%'+_0x1605a7[_0x71ac('0x33')][_0x71ac('0x3d')]+'%'};return _0xb91666;})});}_0x43f3ab=_[_0x71ac('0x3f')]({},_0x43f3ab,_0x1605a7[_0x71ac('0x42')]);return _0x5731f2[_0x71ac('0x7a')](_0x43f3ab);}})[_0x71ac('0x22')](function(_0x27e077){if(_0x27e077){_0xbe3a3=_0x27e077[_0x71ac('0x38')];if(!_0x1605a7[_0x71ac('0x33')]['hasOwnProperty'](_0x71ac('0x7c'))){_0x43f3ab[_0x71ac('0x1c')]=qs[_0x71ac('0x1c')](_0x1605a7['query']['limit']);_0x43f3ab[_0x71ac('0x1e')]=qs['offset'](_0x1605a7[_0x71ac('0x33')]['offset']);}return _0x5731f2[_0x71ac('0x7a')](_0x43f3ab);}})[_0x71ac('0x22')](function(_0x35fada){if(_0x35fada){return _0x35fada?{'count':_0xbe3a3,'rows':_0x35fada}:null;}})[_0x71ac('0x22')](respondWithResult(_0xc82d60,null))[_0x71ac('0x4b')](handleError(_0xc82d60,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index c4a5c6d..d14dffe 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 _0xb073=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x392d71,_0x271154){var _0x1e0396=function(_0x1da395){while(--_0x1da395){_0x392d71['push'](_0x392d71['shift']());}};_0x1e0396(++_0x271154);}(_0xb073,0x187));var _0x3b07=function(_0x30b825,_0x39d18a){_0x30b825=_0x30b825-0x0;var _0x3e2aab=_0xb073[_0x30b825];return _0x3e2aab;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x3b07('0x0'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x3b07('0x1')](0x0);var events={'afterCreate':_0x3b07('0x2'),'afterUpdate':_0x3b07('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3d1733){return function(_0x3112da,_0x31e382,_0x48cf22){DashboardEvents[_0x3b07('0x4')](_0x3d1733+':'+_0x3112da['id'],_0x3112da);DashboardEvents[_0x3b07('0x4')](_0x3d1733,_0x3112da);_0x48cf22(null);};}for(var e in events){if(events[_0x3b07('0x5')](e)){var event=events[e];Dashboard[_0x3b07('0x6')](e,emitEvent(event));}}module[_0x3b07('0x7')]=DashboardEvents; \ No newline at end of file +var _0x8a58=['hasOwnProperty','hook','exports','events','setMaxListeners','update','remove','emit'];(function(_0x19dd7a,_0x51de21){var _0x3feb6a=function(_0x4a3c84){while(--_0x4a3c84){_0x19dd7a['push'](_0x19dd7a['shift']());}};_0x3feb6a(++_0x51de21);}(_0x8a58,0x193));var _0x88a5=function(_0x2c883d,_0x476e83){_0x2c883d=_0x2c883d-0x0;var _0x26190f=_0x8a58[_0x2c883d];return _0x26190f;};'use strict';var EventEmitter=require(_0x88a5('0x0'));var Dashboard=require('../../mysqldb')['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x88a5('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x88a5('0x2'),'afterDestroy':_0x88a5('0x3')};function emitEvent(_0x5e1307){return function(_0x70fb8b,_0x269975,_0x23fd07){DashboardEvents[_0x88a5('0x4')](_0x5e1307+':'+_0x70fb8b['id'],_0x70fb8b);DashboardEvents[_0x88a5('0x4')](_0x5e1307,_0x70fb8b);_0x23fd07(null);};}for(var e in events){if(events[_0x88a5('0x5')](e)){var event=events[e];Dashboard[_0x88a5('0x6')](e,emitEvent(event));}}module[_0x88a5('0x7')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 85cdcee..36b8646 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 _0x20b4=['Dashboard','dashboards','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x4e93a9,_0x413f30){var _0x43013c=function(_0x3a0cf3){while(--_0x3a0cf3){_0x4e93a9['push'](_0x4e93a9['shift']());}};_0x43013c(++_0x413f30);}(_0x20b4,0x146));var _0x420b=function(_0x5a30fb,_0x206270){_0x5a30fb=_0x5a30fb-0x0;var _0x3b86aa=_0x20b4[_0x5a30fb];return _0x3b86aa;};'use strict';var _=require(_0x420b('0x0'));var util=require(_0x420b('0x1'));var logger=require(_0x420b('0x2'))(_0x420b('0x3'));var moment=require('moment');var BPromise=require(_0x420b('0x4'));var rp=require(_0x420b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x420b('0x6'));var config=require(_0x420b('0x7'));var attributes=require('./dashboard.attributes');module[_0x420b('0x8')]=function(_0x338bf6,_0x30fe9c){return _0x338bf6[_0x420b('0x9')](_0x420b('0xa'),attributes,{'tableName':_0x420b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xca99=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./dashboard.attributes','define','Dashboard','lodash','util'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xca99,0x1c6));var _0x9ca9=function(_0x55c72d,_0x5d7876){_0x55c72d=_0x55c72d-0x0;var _0x3b64b6=_0xca99[_0x55c72d];return _0x3b64b6;};'use strict';var _=require(_0x9ca9('0x0'));var util=require(_0x9ca9('0x1'));var logger=require(_0x9ca9('0x2'))(_0x9ca9('0x3'));var moment=require(_0x9ca9('0x4'));var BPromise=require(_0x9ca9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ca9('0x6'));var rimraf=require(_0x9ca9('0x7'));var config=require(_0x9ca9('0x8'));var attributes=require(_0x9ca9('0x9'));module['exports']=function(_0x4dd8b7,_0x4e5608){return _0x4dd8b7[_0x9ca9('0xa')](_0x9ca9('0xb'),attributes,{'tableName':'dashboards','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 a295b1e..8d2ecc9 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 _0x2daf=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash'];(function(_0x27efcf,_0x320952){var _0xdb0237=function(_0x2a7389){while(--_0x2a7389){_0x27efcf['push'](_0x27efcf['shift']());}};_0xdb0237(++_0x320952);}(_0x2daf,0x121));var _0xf2da=function(_0x2039ca,_0x228e70){_0x2039ca=_0x2039ca-0x0;var _0x37795e=_0x2daf[_0x2039ca];return _0x37795e;};'use strict';var _=require(_0xf2da('0x0'));var util=require(_0xf2da('0x1'));var moment=require(_0xf2da('0x2'));var BPromise=require(_0xf2da('0x3'));var rs=require(_0xf2da('0x4'));var fs=require('fs');var Redis=require(_0xf2da('0x5'));var db=require(_0xf2da('0x6'))['db'];var utils=require(_0xf2da('0x7'));var logger=require(_0xf2da('0x8'))(_0xf2da('0x9'));var config=require('../../config/environment');var jayson=require(_0xf2da('0xa'));var client=jayson['client'][_0xf2da('0xb')]({'port':0x232a});config[_0xf2da('0xc')]=_[_0xf2da('0xd')](config[_0xf2da('0xc')],{'host':_0xf2da('0xe'),'port':0x18eb});var socket=require(_0xf2da('0xf'))(new Redis(config[_0xf2da('0xc')]));require('./dashboard.socket')[_0xf2da('0x10')](socket);function respondWithRpcPromise(_0x5f9ef9,_0xfb2275,_0x1bbd3a){return new BPromise(function(_0x5105ab,_0x5e044e){return client[_0xf2da('0x11')](_0x5f9ef9,_0x1bbd3a)[_0xf2da('0x12')](function(_0x370d0d){logger[_0xf2da('0x13')](_0xf2da('0x14'),_0xfb2275,'request\x20sent');logger[_0xf2da('0x15')](_0xf2da('0x16'),_0xfb2275,_0xf2da('0x17'),JSON[_0xf2da('0x18')](_0x370d0d));if(_0x370d0d[_0xf2da('0x19')]){if(_0x370d0d[_0xf2da('0x19')]['code']===0x1f4){logger[_0xf2da('0x19')]('Dashboard,\x20%s,\x20%s',_0xfb2275,_0x370d0d[_0xf2da('0x19')][_0xf2da('0x1a')]);return _0x5e044e(_0x370d0d[_0xf2da('0x19')][_0xf2da('0x1a')]);}logger[_0xf2da('0x19')](_0xf2da('0x14'),_0xfb2275,_0x370d0d[_0xf2da('0x19')][_0xf2da('0x1a')]);return _0x5105ab(_0x370d0d[_0xf2da('0x19')][_0xf2da('0x1a')]);}else{logger[_0xf2da('0x13')]('Dashboard,\x20%s,\x20%s',_0xfb2275,_0xf2da('0x17'));_0x5105ab(_0x370d0d[_0xf2da('0x1b')][_0xf2da('0x1a')]);}})[_0xf2da('0x1c')](function(_0xe900d4){logger[_0xf2da('0x19')](_0xf2da('0x14'),_0xfb2275,_0xe900d4);_0x5e044e(_0xe900d4);});});} \ No newline at end of file +var _0x6909=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','request','then','info','Dashboard,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','util','bluebird','randomstring'];(function(_0x6bb814,_0x17196b){var _0x3c4bf6=function(_0x5bf6b9){while(--_0x5bf6b9){_0x6bb814['push'](_0x6bb814['shift']());}};_0x3c4bf6(++_0x17196b);}(_0x6909,0x1e3));var _0x9690=function(_0x41e3a8,_0xe4656d){_0x41e3a8=_0x41e3a8-0x0;var _0x540019=_0x6909[_0x41e3a8];return _0x540019;};'use strict';var _=require('lodash');var util=require(_0x9690('0x0'));var moment=require('moment');var BPromise=require(_0x9690('0x1'));var rs=require(_0x9690('0x2'));var fs=require('fs');var Redis=require(_0x9690('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9690('0x4'));var logger=require(_0x9690('0x5'))(_0x9690('0x6'));var config=require('../../config/environment');var jayson=require(_0x9690('0x7'));var client=jayson[_0x9690('0x8')][_0x9690('0x9')]({'port':0x232a});config[_0x9690('0xa')]=_[_0x9690('0xb')](config[_0x9690('0xa')],{'host':_0x9690('0xc'),'port':0x18eb});var socket=require(_0x9690('0xd'))(new Redis(config[_0x9690('0xa')]));require(_0x9690('0xe'))['register'](socket);function respondWithRpcPromise(_0x3c89e0,_0x2658c6,_0x24eae8){return new BPromise(function(_0x39847f,_0x12b229){return client[_0x9690('0xf')](_0x3c89e0,_0x24eae8)[_0x9690('0x10')](function(_0x201381){logger[_0x9690('0x11')](_0x9690('0x12'),_0x2658c6,'request\x20sent');logger[_0x9690('0x13')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x2658c6,'request\x20sent',JSON[_0x9690('0x14')](_0x201381));if(_0x201381[_0x9690('0x15')]){if(_0x201381[_0x9690('0x15')][_0x9690('0x16')]===0x1f4){logger[_0x9690('0x15')](_0x9690('0x12'),_0x2658c6,_0x201381[_0x9690('0x15')][_0x9690('0x17')]);return _0x12b229(_0x201381[_0x9690('0x15')][_0x9690('0x17')]);}logger[_0x9690('0x15')](_0x9690('0x12'),_0x2658c6,_0x201381[_0x9690('0x15')][_0x9690('0x17')]);return _0x39847f(_0x201381[_0x9690('0x15')][_0x9690('0x17')]);}else{logger['info'](_0x9690('0x12'),_0x2658c6,_0x9690('0x18'));_0x39847f(_0x201381[_0x9690('0x19')][_0x9690('0x17')]);}})[_0x9690('0x1a')](function(_0x3ad729){logger[_0x9690('0x15')]('Dashboard,\x20%s,\x20%s',_0x2658c6,_0x3ad729);_0x12b229(_0x3ad729);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 443e228..50ce19c 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 _0x408b=['register','length','dashboard:','./dashboard.events','remove','update','emit','removeListener'];(function(_0x1263d5,_0x5a1e64){var _0x29b1fa=function(_0x33b69a){while(--_0x33b69a){_0x1263d5['push'](_0x1263d5['shift']());}};_0x29b1fa(++_0x5a1e64);}(_0x408b,0x1c3));var _0xb408=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x408b[_0x4243a3];return _0x1b2a33;};'use strict';var DashboardEvents=require(_0xb408('0x0'));var events=['save',_0xb408('0x1'),_0xb408('0x2')];function createListener(_0x3bffda,_0x41b818){return function(_0x26b2ae){_0x41b818[_0xb408('0x3')](_0x3bffda,_0x26b2ae);};}function removeListener(_0x4a9475,_0x53f9b3){return function(){DashboardEvents[_0xb408('0x4')](_0x4a9475,_0x53f9b3);};}exports[_0xb408('0x5')]=function(_0x166bf7){for(var _0x393505=0x0,_0xf9fc34=events[_0xb408('0x6')];_0x393505<_0xf9fc34;_0x393505++){var _0x5c5899=events[_0x393505];var _0x5d2db4=createListener(_0xb408('0x7')+_0x5c5899,_0x166bf7);DashboardEvents['on'](_0x5c5899,_0x5d2db4);}}; \ No newline at end of file +var _0x7e68=['dashboard:','./dashboard.events','save','remove','update','emit','removeListener'];(function(_0x3ddb77,_0x1e6c1a){var _0x5f1e17=function(_0x399ea0){while(--_0x399ea0){_0x3ddb77['push'](_0x3ddb77['shift']());}};_0x5f1e17(++_0x1e6c1a);}(_0x7e68,0x1a5));var _0x87e6=function(_0x4cad0b,_0x100bbc){_0x4cad0b=_0x4cad0b-0x0;var _0x5403e4=_0x7e68[_0x4cad0b];return _0x5403e4;};'use strict';var DashboardEvents=require(_0x87e6('0x0'));var events=[_0x87e6('0x1'),_0x87e6('0x2'),_0x87e6('0x3')];function createListener(_0x37f3cb,_0x7b14dd){return function(_0x20d698){_0x7b14dd[_0x87e6('0x4')](_0x37f3cb,_0x20d698);};}function removeListener(_0x6458ad,_0x2c98a8){return function(){DashboardEvents[_0x87e6('0x5')](_0x6458ad,_0x2c98a8);};}exports['register']=function(_0x331177){for(var _0x343a78=0x0,_0x3fbc7f=events['length'];_0x343a78<_0x3fbc7f;_0x343a78++){var _0x466a3f=events[_0x343a78];var _0x510d11=createListener(_0x87e6('0x6')+_0x466a3f,_0x331177);DashboardEvents['on'](_0x466a3f,_0x510d11);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 4755903..4ecb892 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 _0xd581=['../../components/interaction/service','../../config/environment','./dashboard.controller','index','get','/:id','isAuthenticated','show','create','clone','post','/:id/items','addItem','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x30986c,_0x39ce58){var _0x57c209=function(_0x557c36){while(--_0x557c36){_0x30986c['push'](_0x30986c['shift']());}};_0x57c209(++_0x39ce58);}(_0xd581,0x1a2));var _0x1d58=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xd581[_0x4e676e];return _0x336a3c;};'use strict';var multer=require(_0x1d58('0x0'));var util=require(_0x1d58('0x1'));var path=require(_0x1d58('0x2'));var timeout=require(_0x1d58('0x3'));var express=require(_0x1d58('0x4'));var router=express[_0x1d58('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1d58('0x6'));var interaction=require(_0x1d58('0x7'));var config=require(_0x1d58('0x8'));var controller=require(_0x1d58('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1d58('0xa')]);router[_0x1d58('0xb')](_0x1d58('0xc'),auth[_0x1d58('0xd')](),controller[_0x1d58('0xe')]);router[_0x1d58('0xb')]('/:id/items',auth[_0x1d58('0xd')](),controller['getItems']);router['post']('/',auth[_0x1d58('0xd')](),controller[_0x1d58('0xf')]);router['post']('/:id/clone',auth[_0x1d58('0xd')](),controller[_0x1d58('0x10')]);router[_0x1d58('0x11')](_0x1d58('0x12'),auth[_0x1d58('0xd')](),controller[_0x1d58('0x13')]);router[_0x1d58('0x14')](_0x1d58('0xc'),auth[_0x1d58('0xd')](),controller[_0x1d58('0x15')]);router[_0x1d58('0x16')](_0x1d58('0xc'),auth[_0x1d58('0xd')](),controller[_0x1d58('0x17')]);module[_0x1d58('0x18')]=router; \ No newline at end of file +var _0x364f=['../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','show','/:id/items','getItems','create','post','/:id/clone','addItem','put','delete','/:id','destroy','exports','multer','util','path','express','Router'];(function(_0x4ad814,_0x4d7221){var _0x1a2140=function(_0x57e10a){while(--_0x57e10a){_0x4ad814['push'](_0x4ad814['shift']());}};_0x1a2140(++_0x4d7221);}(_0x364f,0xd7));var _0xf364=function(_0x46111d,_0x5d286b){_0x46111d=_0x46111d-0x0;var _0xe82586=_0x364f[_0x46111d];return _0xe82586;};'use strict';var multer=require(_0xf364('0x0'));var util=require(_0xf364('0x1'));var path=require(_0xf364('0x2'));var timeout=require('connect-timeout');var express=require(_0xf364('0x3'));var router=express[_0xf364('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf364('0x5'));var config=require(_0xf364('0x6'));var controller=require(_0xf364('0x7'));router[_0xf364('0x8')]('/',auth[_0xf364('0x9')](),controller['index']);router[_0xf364('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xf364('0xa')]);router[_0xf364('0x8')](_0xf364('0xb'),auth['isAuthenticated'](),controller[_0xf364('0xc')]);router['post']('/',auth[_0xf364('0x9')](),controller[_0xf364('0xd')]);router[_0xf364('0xe')](_0xf364('0xf'),auth[_0xf364('0x9')](),controller['clone']);router[_0xf364('0xe')](_0xf364('0xb'),auth[_0xf364('0x9')](),controller[_0xf364('0x10')]);router[_0xf364('0x11')]('/:id',auth[_0xf364('0x9')](),controller['update']);router[_0xf364('0x12')](_0xf364('0x13'),auth[_0xf364('0x9')](),controller[_0xf364('0x14')]);module[_0xf364('0x15')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 7b12e28..c2c4485 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 _0xe3da=['squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize'];(function(_0x340eee,_0x1e38da){var _0x35ee13=function(_0x724ecc){while(--_0x724ecc){_0x340eee['push'](_0x340eee['shift']());}};_0x35ee13(++_0x1e38da);}(_0xe3da,0x1cd));var _0xae3d=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xe3da[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xae3d('0x0'));var squel=require(_0xae3d('0x1'));var _=require(_0xae3d('0x2'));module[_0xae3d('0x3')]={'title':{'type':Sequelize[_0xae3d('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xae3d('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xae3d('0x5')](_0xae3d('0x6')),'get':function(){try{return JSON[_0xae3d('0x7')](this[_0xae3d('0x8')](_0xae3d('0x9')));}catch(_0x26282d){return[];}},'set':function(_0xa9a1a){try{this[_0xae3d('0xa')](_0xae3d('0x9'),JSON[_0xae3d('0xb')](_0xa9a1a));}catch(_0x583b98){this[_0xae3d('0xa')](_0xae3d('0x9'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xae3d('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xae3d('0xc')]},'col':{'type':Sequelize[_0xae3d('0xc')]},'background':{'type':Sequelize[_0xae3d('0x4')],'allowNull':![],'defaultValue':_0xae3d('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xae3d('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xae3d('0x4')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0xafc4=['TEXT','long','setDataValue','attrs','stringify','INTEGER','sequelize','lodash','STRING'];(function(_0x5d19b7,_0x257527){var _0x5cd6ab=function(_0x3240ad){while(--_0x3240ad){_0x5d19b7['push'](_0x5d19b7['shift']());}};_0x5cd6ab(++_0x257527);}(_0xafc4,0x69));var _0x4afc=function(_0x570691,_0x47de54){_0x570691=_0x570691-0x0;var _0x2498b5=_0xafc4[_0x570691];return _0x2498b5;};'use strict';var Sequelize=require(_0x4afc('0x0'));var squel=require('squel');var _=require(_0x4afc('0x1'));module['exports']={'title':{'type':Sequelize[_0x4afc('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4afc('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x4afc('0x3')](_0x4afc('0x4')),'get':function(){try{return JSON['parse'](this['getDataValue']('attrs'));}catch(_0x36cb50){return[];}},'set':function(_0x471d45){try{this[_0x4afc('0x5')](_0x4afc('0x6'),JSON[_0x4afc('0x7')](_0x471d45));}catch(_0xaf053d){this['setDataValue'](_0x4afc('0x6'),JSON[_0x4afc('0x7')]([]));}}},'sizeX':{'type':Sequelize[_0x4afc('0x8')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x4afc('0x8')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x4afc('0x8')]},'col':{'type':Sequelize[_0x4afc('0x8')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x4afc('0x2')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x4afc('0x2')]},'titleFontSize':{'type':Sequelize[_0x4afc('0x8')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 36680c5..fc23a15 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 _0x7374=['attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./dashboardItem.socket','register','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','show','params','model','DashboardItem','rawAttributes','query','keys','filters','intersection','fields','attributes','length','includeAll','include','merge','find','catch','type','iframe','attrUrl'];(function(_0x109b5a,_0x566e8c){var _0x29322b=function(_0x3cacf6){while(--_0x3cacf6){_0x109b5a['push'](_0x109b5a['shift']());}};_0x29322b(++_0x566e8c);}(_0x7374,0x1b9));var _0x4737=function(_0x12974b,_0x414fb6){_0x12974b=_0x12974b-0x0;var _0x1b41da=_0x7374[_0x12974b];return _0x1b41da;};'use strict';var emlformat=require(_0x4737('0x0'));var rimraf=require(_0x4737('0x1'));var zipdir=require(_0x4737('0x2'));var jsonpatch=require(_0x4737('0x3'));var rp=require(_0x4737('0x4'));var moment=require('moment');var BPromise=require(_0x4737('0x5'));var Mustache=require(_0x4737('0x6'));var util=require(_0x4737('0x7'));var path=require(_0x4737('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4737('0x9'));var fs=require('fs');var fs_extra=require(_0x4737('0xa'));var _=require(_0x4737('0xb'));var squel=require(_0x4737('0xc'));var crypto=require('crypto');var jsforce=require(_0x4737('0xd'));var deskjs=require(_0x4737('0xe'));var toCsv=require(_0x4737('0xf'));var querystring=require(_0x4737('0x10'));var Papa=require(_0x4737('0x11'));var Redis=require('ioredis');var authService=require(_0x4737('0x12'));var qs=require(_0x4737('0x13'));var as=require(_0x4737('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4737('0x15'));var utils=require(_0x4737('0x16'));var config=require(_0x4737('0x17'));var licenseUtil=require(_0x4737('0x18'));var db=require(_0x4737('0x19'))['db'];config[_0x4737('0x1a')]=_[_0x4737('0x1b')](config[_0x4737('0x1a')],{'host':_0x4737('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4737('0x1a')]));require(_0x4737('0x1d'))[_0x4737('0x1e')](socket);function respondWithStatusCode(_0xc7fceb,_0x3c07c0){_0x3c07c0=_0x3c07c0||0xcc;return function(_0x4f4e8a){if(_0x4f4e8a){return _0xc7fceb['sendStatus'](_0x3c07c0);}return _0xc7fceb[_0x4737('0x1f')](_0x3c07c0)['end']();};}function respondWithResult(_0x470ed4,_0xf96423){_0xf96423=_0xf96423||0xc8;return function(_0x5f415d){if(_0x5f415d){return _0x470ed4[_0x4737('0x1f')](_0xf96423)[_0x4737('0x20')](_0x5f415d);}};}function respondWithFilteredResult(_0xef032a,_0x51f125){return function(_0x2d2c32){if(_0x2d2c32){var _0x560265=typeof _0x51f125[_0x4737('0x21')]===_0x4737('0x22')&&typeof _0x51f125[_0x4737('0x23')]===_0x4737('0x22');var _0x1b2183=_0x2d2c32['count'];var _0x241ba7=_0x560265?0x0:_0x51f125[_0x4737('0x21')];var _0x6a2198=_0x560265?_0x2d2c32[_0x4737('0x24')]:_0x51f125['offset']+_0x51f125[_0x4737('0x23')];var _0x5d9ed4;if(_0x6a2198>=_0x1b2183){_0x6a2198=_0x1b2183;_0x5d9ed4=0xc8;}else{_0x5d9ed4=0xce;}_0xef032a[_0x4737('0x1f')](_0x5d9ed4);return _0xef032a[_0x4737('0x25')]('Content-Range',_0x241ba7+'-'+_0x6a2198+'/'+_0x1b2183)[_0x4737('0x20')](_0x2d2c32);}return null;};}function patchUpdates(_0x1c004f){return function(_0xa5e7dd){try{jsonpatch[_0x4737('0x26')](_0xa5e7dd,_0x1c004f,!![]);}catch(_0x56d82f){return BPromise[_0x4737('0x27')](_0x56d82f);}return _0xa5e7dd[_0x4737('0x28')]();};}function saveUpdates(_0x49eddf,_0x37382f){return function(_0x4805a0){if(_0x4805a0){return _0x4805a0[_0x4737('0x29')](_0x49eddf)[_0x4737('0x2a')](function(_0x3df6c5){return _0x3df6c5;});}return null;};}function removeEntity(_0x10685f,_0xe8e844){return function(_0x2a99fe){if(_0x2a99fe){return _0x2a99fe['destroy']()[_0x4737('0x2a')](function(){_0x10685f['status'](0xcc)[_0x4737('0x2b')]();});}};}function handleEntityNotFound(_0x4998ee,_0x29618d){return function(_0x149877){if(!_0x149877){_0x4998ee[_0x4737('0x2c')](0x194);}return _0x149877;};}function handleError(_0x5e1f13,_0x4f3e2d){_0x4f3e2d=_0x4f3e2d||0x1f4;return function(_0x2d7486){logger[_0x4737('0x2d')](_0x2d7486[_0x4737('0x2e')]);if(_0x2d7486[_0x4737('0x2f')]){delete _0x2d7486[_0x4737('0x2f')];}_0x5e1f13['status'](_0x4f3e2d)[_0x4737('0x30')](_0x2d7486);};}exports[_0x4737('0x31')]=function(_0x18343f,_0x31f2cd){var _0x3c912f={'raw':![],'where':{'id':_0x18343f[_0x4737('0x32')]['id']}},_0x2e1689={};_0x2e1689[_0x4737('0x33')]=_['keys'](db[_0x4737('0x34')][_0x4737('0x35')]);_0x2e1689[_0x4737('0x36')]=_[_0x4737('0x37')](_0x18343f[_0x4737('0x36')]);_0x2e1689[_0x4737('0x38')]=_[_0x4737('0x39')](_0x2e1689[_0x4737('0x33')],_0x2e1689[_0x4737('0x36')]);_0x3c912f['attributes']=_['intersection'](_0x2e1689[_0x4737('0x33')],qs[_0x4737('0x3a')](_0x18343f['query'][_0x4737('0x3a')]));_0x3c912f[_0x4737('0x3b')]=_0x3c912f[_0x4737('0x3b')][_0x4737('0x3c')]?_0x3c912f[_0x4737('0x3b')]:_0x2e1689[_0x4737('0x33')];if(_0x18343f[_0x4737('0x36')][_0x4737('0x3d')]){_0x3c912f[_0x4737('0x3e')]=[{'all':!![]}];}_0x3c912f=_[_0x4737('0x3f')]({},_0x3c912f,_0x18343f['options']);return db[_0x4737('0x34')][_0x4737('0x40')](_0x3c912f)[_0x4737('0x2a')](handleEntityNotFound(_0x31f2cd,null))[_0x4737('0x2a')](respondWithResult(_0x31f2cd,null))['catch'](handleError(_0x31f2cd,null));};exports['destroy']=function(_0x2dd95c,_0x5beb55){return db[_0x4737('0x34')][_0x4737('0x40')]({'where':{'id':_0x2dd95c['params']['id']}})[_0x4737('0x2a')](handleEntityNotFound(_0x5beb55,null))[_0x4737('0x2a')](removeEntity(_0x5beb55,null))[_0x4737('0x41')](handleError(_0x5beb55,null));};function widgetAttributes(_0x20a83f){try{switch(_0x20a83f[_0x4737('0x42')]){case _0x4737('0x43'):return[{'name':_0x4737('0x44'),'value':_0x20a83f['attrUrl']||(_0x20a83f[_0x4737('0x45')]&&_0x20a83f[_0x4737('0x45')][0x0]?_0x20a83f[_0x4737('0x45')][0x0][_0x4737('0x46')]:undefined)||_0x4737('0x47')}];case _0x4737('0x48'):return[{'name':'attrPath','value':_0x20a83f[_0x4737('0x49')]||(_0x20a83f[_0x4737('0x45')]&&_0x20a83f[_0x4737('0x45')][0x0]?_0x20a83f['attrs'][0x0]['value']:undefined)||''}];case _0x4737('0x4a'):return[{'name':_0x4737('0x4b'),'value':_0x20a83f['attrHourFormat']||(_0x20a83f[_0x4737('0x45')]&&_0x20a83f[_0x4737('0x45')][0x0]?_0x20a83f[_0x4737('0x45')][0x0][_0x4737('0x46')]:undefined)||_0x4737('0x4c')},{'name':_0x4737('0x4d'),'value':_0x20a83f[_0x4737('0x4d')]||(_0x20a83f[_0x4737('0x45')]&&_0x20a83f[_0x4737('0x45')][0x1]?_0x20a83f[_0x4737('0x45')][0x1][_0x4737('0x46')]:undefined)||_0x4737('0x4e')},{'name':_0x4737('0x4f'),'value':_0x20a83f[_0x4737('0x4f')]||(_0x20a83f['attrs']&&_0x20a83f[_0x4737('0x45')][0x2]?_0x20a83f[_0x4737('0x45')][0x2][_0x4737('0x46')]:undefined)||0xc}];case _0x4737('0x50'):return[{'name':_0x4737('0x51'),'value':_0x20a83f[_0x4737('0x51')]||(_0x20a83f[_0x4737('0x45')]&&_0x20a83f[_0x4737('0x45')][0x0]?_0x20a83f[_0x4737('0x45')][0x0]['value']:undefined)||_0x4737('0x52')},{'name':_0x4737('0x53'),'value':_0x20a83f[_0x4737('0x53')]||(_0x20a83f['attrs']&&_0x20a83f[_0x4737('0x45')][0x1]?_0x20a83f[_0x4737('0x45')][0x1][_0x4737('0x46')]:undefined)||[]},{'name':_0x4737('0x4f'),'value':_0x20a83f[_0x4737('0x4f')]||(_0x20a83f['attrs']&&_0x20a83f['attrs'][0x2]?_0x20a83f[_0x4737('0x45')][0x2][_0x4737('0x46')]:undefined)||0x14},{'name':_0x4737('0x54'),'value':_0x20a83f[_0x4737('0x54')]||(_0x20a83f[_0x4737('0x45')]&&_0x20a83f['attrs'][0x3]?_0x20a83f[_0x4737('0x45')][0x3][_0x4737('0x46')]:undefined)||_0x4737('0x55')},{'name':_0x4737('0x56'),'value':_0x20a83f[_0x4737('0x56')]||(_0x20a83f[_0x4737('0x45')]&&_0x20a83f[_0x4737('0x45')][0x4]?_0x20a83f['attrs'][0x4]['value']:undefined)||''},{'name':_0x4737('0x57'),'value':_0x20a83f[_0x4737('0x57')]||(_0x20a83f[_0x4737('0x45')]&&_0x20a83f['attrs'][0x5]?_0x20a83f[_0x4737('0x45')][0x5]['value']:undefined)||''},{'name':_0x4737('0x58'),'value':_0x20a83f[_0x4737('0x58')]||(_0x20a83f[_0x4737('0x45')]&&_0x20a83f[_0x4737('0x45')][0x6]?_0x20a83f[_0x4737('0x45')][0x6][_0x4737('0x46')]:undefined)||''},{'name':_0x4737('0x59'),'value':_0x20a83f[_0x4737('0x59')]||(_0x20a83f[_0x4737('0x45')]&&_0x20a83f['attrs'][0x7]?_0x20a83f[_0x4737('0x45')][0x7][_0x4737('0x46')]:undefined)||''},{'name':_0x4737('0x5a'),'value':_0x20a83f['attrWhatsappAccounts']||(_0x20a83f[_0x4737('0x45')]&&_0x20a83f[_0x4737('0x45')][0x8]?_0x20a83f[_0x4737('0x45')][0x8]['value']:undefined)||''},{'name':_0x4737('0x5b'),'value':_0x20a83f[_0x4737('0x5b')]||(_0x20a83f[_0x4737('0x45')]&&_0x20a83f[_0x4737('0x45')][0x9]?_0x20a83f[_0x4737('0x45')][0x9]['value']:undefined)||''}];case'multibar-chart':case _0x4737('0x5c'):return[{'name':_0x4737('0x5d'),'value':_0x20a83f[_0x4737('0x5d')]||(_0x20a83f[_0x4737('0x45')]&&_0x20a83f[_0x4737('0x45')][0x0]?_0x20a83f['attrs'][0x0][_0x4737('0x46')]:undefined)||'total'},{'name':_0x4737('0x5e'),'value':_0x20a83f[_0x4737('0x5e')]||(_0x20a83f[_0x4737('0x45')]&&_0x20a83f[_0x4737('0x45')][0x1]?_0x20a83f[_0x4737('0x45')][0x1][_0x4737('0x46')]:undefined)||null},{'name':'attrSerie3','value':_0x20a83f[_0x4737('0x5f')]||(_0x20a83f[_0x4737('0x45')]&&_0x20a83f['attrs'][0x2]?_0x20a83f[_0x4737('0x45')][0x2][_0x4737('0x46')]:undefined)||null},{'name':_0x4737('0x53'),'value':_0x20a83f['attrVoiceQueues']||(_0x20a83f[_0x4737('0x45')]&&_0x20a83f['attrs'][0x3]?_0x20a83f[_0x4737('0x45')][0x3][_0x4737('0x46')]:undefined)||[]},{'name':'attrChannel','value':_0x20a83f[_0x4737('0x54')]||(_0x20a83f[_0x4737('0x45')]&&_0x20a83f[_0x4737('0x45')][0x4]?_0x20a83f[_0x4737('0x45')][0x4][_0x4737('0x46')]:undefined)||_0x4737('0x55')},{'name':_0x4737('0x56'),'value':_0x20a83f['attrEmailAccounts']||(_0x20a83f[_0x4737('0x45')]&&_0x20a83f[_0x4737('0x45')][0x5]?_0x20a83f[_0x4737('0x45')][0x5][_0x4737('0x46')]:undefined)||''},{'name':_0x4737('0x57'),'value':_0x20a83f['attrFaxAccounts']||(_0x20a83f['attrs']&&_0x20a83f[_0x4737('0x45')][0x6]?_0x20a83f['attrs'][0x6]['value']:undefined)||''},{'name':_0x4737('0x58'),'value':_0x20a83f['attrSmsAccounts']||(_0x20a83f[_0x4737('0x45')]&&_0x20a83f[_0x4737('0x45')][0x7]?_0x20a83f[_0x4737('0x45')][0x7]['value']:undefined)||''},{'name':_0x4737('0x59'),'value':_0x20a83f['attrOpenchannelAccounts']||(_0x20a83f[_0x4737('0x45')]&&_0x20a83f[_0x4737('0x45')][0x8]?_0x20a83f[_0x4737('0x45')][0x8][_0x4737('0x46')]:undefined)||''},{'name':_0x4737('0x5a'),'value':_0x20a83f[_0x4737('0x5a')]||(_0x20a83f['attrs']&&_0x20a83f[_0x4737('0x45')][0x9]?_0x20a83f[_0x4737('0x45')][0x9][_0x4737('0x46')]:undefined)||''},{'name':_0x4737('0x5b'),'value':_0x20a83f['attrChatWebsites']||(_0x20a83f['attrs']&&_0x20a83f['attrs'][0xa]?_0x20a83f[_0x4737('0x45')][0xa][_0x4737('0x46')]:undefined)||''}];case _0x4737('0x60'):return[{'name':_0x4737('0x61'),'type':_0x20a83f[_0x4737('0x62')]||(_0x20a83f[_0x4737('0x45')]&&_0x20a83f[_0x4737('0x45')][0x0]?_0x20a83f[_0x4737('0x45')][0x0][_0x4737('0x42')]:undefined)||null,'value':_0x20a83f['attrReport']||(_0x20a83f['attrs']&&_0x20a83f[_0x4737('0x45')][0x0]?_0x20a83f['attrs'][0x0]['value']:undefined)||null},{'name':_0x4737('0x63'),'value':_0x20a83f[_0x4737('0x63')]||(_0x20a83f[_0x4737('0x45')]&&_0x20a83f[_0x4737('0x45')][0x1]?_0x20a83f[_0x4737('0x45')][0x1][_0x4737('0x46')]:undefined)||0x0}];default:return[];}}catch(_0x1380b2){logger[_0x4737('0x2d')]('widgetAttributes:\x20%s',JSON['stringify'](_0x1380b2));return[];}}exports[_0x4737('0x64')]=function(_0x3d8d6f,_0x5ed444){if(_0x3d8d6f['body']){_0x3d8d6f[_0x4737('0x65')]['attrs']=widgetAttributes(_0x3d8d6f[_0x4737('0x65')]);}return db[_0x4737('0x34')][_0x4737('0x64')](_0x3d8d6f['body'],{})['then'](respondWithResult(_0x5ed444,0xc9))[_0x4737('0x41')](handleError(_0x5ed444,null));};exports[_0x4737('0x29')]=function(_0x211931,_0x31a09b){if(_0x211931[_0x4737('0x65')]['id']){delete _0x211931[_0x4737('0x65')]['id'];}_0x211931[_0x4737('0x65')][_0x4737('0x45')]=widgetAttributes(_0x211931[_0x4737('0x65')]);return db[_0x4737('0x34')][_0x4737('0x40')]({'where':{'id':_0x211931['params']['id']}})[_0x4737('0x2a')](handleEntityNotFound(_0x31a09b,null))[_0x4737('0x2a')](saveUpdates(_0x211931['body'],null))['then'](respondWithResult(_0x31a09b,null))[_0x4737('0x41')](handleError(_0x31a09b,null));}; \ No newline at end of file +var _0x7e02=['attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','options','find','catch','DashboardItem','type','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts'];(function(_0x2f691e,_0x3ec328){var _0x1128bf=function(_0x149118){while(--_0x149118){_0x2f691e['push'](_0x2f691e['shift']());}};_0x1128bf(++_0x3ec328);}(_0x7e02,0x71));var _0x27e0=function(_0x4a9fb7,_0x4cbfd7){_0x4a9fb7=_0x4a9fb7-0x0;var _0x40b90e=_0x7e02[_0x4a9fb7];return _0x40b90e;};'use strict';var emlformat=require(_0x27e0('0x0'));var rimraf=require(_0x27e0('0x1'));var zipdir=require(_0x27e0('0x2'));var jsonpatch=require(_0x27e0('0x3'));var rp=require(_0x27e0('0x4'));var moment=require(_0x27e0('0x5'));var BPromise=require(_0x27e0('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x27e0('0x7'));var sox=require('sox');var csv=require(_0x27e0('0x8'));var ejs=require(_0x27e0('0x9'));var fs=require('fs');var fs_extra=require(_0x27e0('0xa'));var _=require(_0x27e0('0xb'));var squel=require(_0x27e0('0xc'));var crypto=require(_0x27e0('0xd'));var jsforce=require(_0x27e0('0xe'));var deskjs=require(_0x27e0('0xf'));var toCsv=require('to-csv');var querystring=require(_0x27e0('0x10'));var Papa=require('papaparse');var Redis=require(_0x27e0('0x11'));var authService=require(_0x27e0('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x27e0('0x13'));var hardwareService=require(_0x27e0('0x14'));var logger=require(_0x27e0('0x15'))(_0x27e0('0x16'));var utils=require(_0x27e0('0x17'));var config=require(_0x27e0('0x18'));var licenseUtil=require(_0x27e0('0x19'));var db=require(_0x27e0('0x1a'))['db'];config[_0x27e0('0x1b')]=_['defaults'](config[_0x27e0('0x1b')],{'host':_0x27e0('0x1c'),'port':0x18eb});var socket=require(_0x27e0('0x1d'))(new Redis(config['redis']));require(_0x27e0('0x1e'))[_0x27e0('0x1f')](socket);function respondWithStatusCode(_0x473128,_0x5153fe){_0x5153fe=_0x5153fe||0xcc;return function(_0x18e856){if(_0x18e856){return _0x473128[_0x27e0('0x20')](_0x5153fe);}return _0x473128[_0x27e0('0x21')](_0x5153fe)[_0x27e0('0x22')]();};}function respondWithResult(_0x5b1b6e,_0x50b776){_0x50b776=_0x50b776||0xc8;return function(_0xf18af0){if(_0xf18af0){return _0x5b1b6e[_0x27e0('0x21')](_0x50b776)[_0x27e0('0x23')](_0xf18af0);}};}function respondWithFilteredResult(_0x2111e,_0x5b0339){return function(_0x32597b){if(_0x32597b){var _0x20a4cc=typeof _0x5b0339[_0x27e0('0x24')]===_0x27e0('0x25')&&typeof _0x5b0339[_0x27e0('0x26')]===_0x27e0('0x25');var _0x4d9edc=_0x32597b[_0x27e0('0x27')];var _0x445a53=_0x20a4cc?0x0:_0x5b0339['offset'];var _0x1908d1=_0x20a4cc?_0x32597b[_0x27e0('0x27')]:_0x5b0339[_0x27e0('0x24')]+_0x5b0339[_0x27e0('0x26')];var _0x408d95;if(_0x1908d1>=_0x4d9edc){_0x1908d1=_0x4d9edc;_0x408d95=0xc8;}else{_0x408d95=0xce;}_0x2111e['status'](_0x408d95);return _0x2111e['set']('Content-Range',_0x445a53+'-'+_0x1908d1+'/'+_0x4d9edc)[_0x27e0('0x23')](_0x32597b);}return null;};}function patchUpdates(_0x11f4ca){return function(_0x53b7f0){try{jsonpatch[_0x27e0('0x28')](_0x53b7f0,_0x11f4ca,!![]);}catch(_0xee6318){return BPromise[_0x27e0('0x29')](_0xee6318);}return _0x53b7f0[_0x27e0('0x2a')]();};}function saveUpdates(_0xd857c2,_0x377c0e){return function(_0x57ef62){if(_0x57ef62){return _0x57ef62[_0x27e0('0x2b')](_0xd857c2)[_0x27e0('0x2c')](function(_0x3068c4){return _0x3068c4;});}return null;};}function removeEntity(_0x1e5060,_0x27dc43){return function(_0x470d2f){if(_0x470d2f){return _0x470d2f[_0x27e0('0x2d')]()[_0x27e0('0x2c')](function(){_0x1e5060['status'](0xcc)[_0x27e0('0x22')]();});}};}function handleEntityNotFound(_0x44b237,_0x20d1e3){return function(_0x7e00da){if(!_0x7e00da){_0x44b237[_0x27e0('0x20')](0x194);}return _0x7e00da;};}function handleError(_0x54bc21,_0x599404){_0x599404=_0x599404||0x1f4;return function(_0x29114d){logger[_0x27e0('0x2e')](_0x29114d[_0x27e0('0x2f')]);if(_0x29114d[_0x27e0('0x30')]){delete _0x29114d['name'];}_0x54bc21['status'](_0x599404)[_0x27e0('0x31')](_0x29114d);};}exports[_0x27e0('0x32')]=function(_0x5a28e6,_0x55d752){var _0x551794={'raw':![],'where':{'id':_0x5a28e6[_0x27e0('0x33')]['id']}},_0xdedb73={};_0xdedb73[_0x27e0('0x34')]=_[_0x27e0('0x35')](db['DashboardItem'][_0x27e0('0x36')]);_0xdedb73[_0x27e0('0x37')]=_[_0x27e0('0x35')](_0x5a28e6[_0x27e0('0x37')]);_0xdedb73[_0x27e0('0x38')]=_[_0x27e0('0x39')](_0xdedb73[_0x27e0('0x34')],_0xdedb73[_0x27e0('0x37')]);_0x551794[_0x27e0('0x3a')]=_[_0x27e0('0x39')](_0xdedb73['model'],qs[_0x27e0('0x3b')](_0x5a28e6[_0x27e0('0x37')]['fields']));_0x551794['attributes']=_0x551794[_0x27e0('0x3a')][_0x27e0('0x3c')]?_0x551794[_0x27e0('0x3a')]:_0xdedb73['model'];if(_0x5a28e6[_0x27e0('0x37')][_0x27e0('0x3d')]){_0x551794['include']=[{'all':!![]}];}_0x551794=_[_0x27e0('0x3e')]({},_0x551794,_0x5a28e6[_0x27e0('0x3f')]);return db['DashboardItem'][_0x27e0('0x40')](_0x551794)[_0x27e0('0x2c')](handleEntityNotFound(_0x55d752,null))['then'](respondWithResult(_0x55d752,null))[_0x27e0('0x41')](handleError(_0x55d752,null));};exports[_0x27e0('0x2d')]=function(_0x58fec0,_0x48312a){return db[_0x27e0('0x42')][_0x27e0('0x40')]({'where':{'id':_0x58fec0[_0x27e0('0x33')]['id']}})[_0x27e0('0x2c')](handleEntityNotFound(_0x48312a,null))['then'](removeEntity(_0x48312a,null))[_0x27e0('0x41')](handleError(_0x48312a,null));};function widgetAttributes(_0x55872a){try{switch(_0x55872a[_0x27e0('0x43')]){case _0x27e0('0x44'):return[{'name':_0x27e0('0x45'),'value':_0x55872a['attrUrl']||(_0x55872a[_0x27e0('0x46')]&&_0x55872a[_0x27e0('0x46')][0x0]?_0x55872a['attrs'][0x0]['value']:undefined)||_0x27e0('0x47')}];case _0x27e0('0x48'):return[{'name':_0x27e0('0x49'),'value':_0x55872a[_0x27e0('0x49')]||(_0x55872a['attrs']&&_0x55872a['attrs'][0x0]?_0x55872a['attrs'][0x0][_0x27e0('0x4a')]:undefined)||''}];case _0x27e0('0x4b'):return[{'name':'attrHourFormat','value':_0x55872a['attrHourFormat']||(_0x55872a['attrs']&&_0x55872a[_0x27e0('0x46')][0x0]?_0x55872a[_0x27e0('0x46')][0x0][_0x27e0('0x4a')]:undefined)||_0x27e0('0x4c')},{'name':_0x27e0('0x4d'),'value':_0x55872a[_0x27e0('0x4d')]||(_0x55872a[_0x27e0('0x46')]&&_0x55872a[_0x27e0('0x46')][0x1]?_0x55872a[_0x27e0('0x46')][0x1][_0x27e0('0x4a')]:undefined)||_0x27e0('0x4e')},{'name':_0x27e0('0x4f'),'value':_0x55872a[_0x27e0('0x4f')]||(_0x55872a[_0x27e0('0x46')]&&_0x55872a[_0x27e0('0x46')][0x2]?_0x55872a['attrs'][0x2]['value']:undefined)||0xc}];case _0x27e0('0x50'):return[{'name':_0x27e0('0x51'),'value':_0x55872a['attrMetric']||(_0x55872a['attrs']&&_0x55872a['attrs'][0x0]?_0x55872a[_0x27e0('0x46')][0x0][_0x27e0('0x4a')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x55872a[_0x27e0('0x52')]||(_0x55872a[_0x27e0('0x46')]&&_0x55872a[_0x27e0('0x46')][0x1]?_0x55872a[_0x27e0('0x46')][0x1][_0x27e0('0x4a')]:undefined)||[]},{'name':_0x27e0('0x4f'),'value':_0x55872a[_0x27e0('0x4f')]||(_0x55872a[_0x27e0('0x46')]&&_0x55872a[_0x27e0('0x46')][0x2]?_0x55872a[_0x27e0('0x46')][0x2][_0x27e0('0x4a')]:undefined)||0x14},{'name':_0x27e0('0x53'),'value':_0x55872a[_0x27e0('0x53')]||(_0x55872a[_0x27e0('0x46')]&&_0x55872a[_0x27e0('0x46')][0x3]?_0x55872a[_0x27e0('0x46')][0x3][_0x27e0('0x4a')]:undefined)||_0x27e0('0x54')},{'name':_0x27e0('0x55'),'value':_0x55872a[_0x27e0('0x55')]||(_0x55872a[_0x27e0('0x46')]&&_0x55872a[_0x27e0('0x46')][0x4]?_0x55872a[_0x27e0('0x46')][0x4][_0x27e0('0x4a')]:undefined)||''},{'name':_0x27e0('0x56'),'value':_0x55872a[_0x27e0('0x56')]||(_0x55872a[_0x27e0('0x46')]&&_0x55872a[_0x27e0('0x46')][0x5]?_0x55872a['attrs'][0x5]['value']:undefined)||''},{'name':_0x27e0('0x57'),'value':_0x55872a[_0x27e0('0x57')]||(_0x55872a['attrs']&&_0x55872a['attrs'][0x6]?_0x55872a[_0x27e0('0x46')][0x6][_0x27e0('0x4a')]:undefined)||''},{'name':_0x27e0('0x58'),'value':_0x55872a[_0x27e0('0x58')]||(_0x55872a[_0x27e0('0x46')]&&_0x55872a[_0x27e0('0x46')][0x7]?_0x55872a[_0x27e0('0x46')][0x7]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x55872a[_0x27e0('0x59')]||(_0x55872a[_0x27e0('0x46')]&&_0x55872a[_0x27e0('0x46')][0x8]?_0x55872a[_0x27e0('0x46')][0x8][_0x27e0('0x4a')]:undefined)||''},{'name':_0x27e0('0x5a'),'value':_0x55872a['attrChatWebsites']||(_0x55872a['attrs']&&_0x55872a[_0x27e0('0x46')][0x9]?_0x55872a[_0x27e0('0x46')][0x9][_0x27e0('0x4a')]:undefined)||''}];case _0x27e0('0x5b'):case'pie-chart':return[{'name':'attrSerie1','value':_0x55872a[_0x27e0('0x5c')]||(_0x55872a[_0x27e0('0x46')]&&_0x55872a['attrs'][0x0]?_0x55872a[_0x27e0('0x46')][0x0][_0x27e0('0x4a')]:undefined)||'total'},{'name':'attrSerie2','value':_0x55872a['attrSerie2']||(_0x55872a[_0x27e0('0x46')]&&_0x55872a[_0x27e0('0x46')][0x1]?_0x55872a[_0x27e0('0x46')][0x1]['value']:undefined)||null},{'name':_0x27e0('0x5d'),'value':_0x55872a[_0x27e0('0x5d')]||(_0x55872a[_0x27e0('0x46')]&&_0x55872a[_0x27e0('0x46')][0x2]?_0x55872a[_0x27e0('0x46')][0x2][_0x27e0('0x4a')]:undefined)||null},{'name':_0x27e0('0x52'),'value':_0x55872a[_0x27e0('0x52')]||(_0x55872a[_0x27e0('0x46')]&&_0x55872a[_0x27e0('0x46')][0x3]?_0x55872a[_0x27e0('0x46')][0x3]['value']:undefined)||[]},{'name':_0x27e0('0x53'),'value':_0x55872a[_0x27e0('0x53')]||(_0x55872a[_0x27e0('0x46')]&&_0x55872a[_0x27e0('0x46')][0x4]?_0x55872a['attrs'][0x4][_0x27e0('0x4a')]:undefined)||_0x27e0('0x54')},{'name':_0x27e0('0x55'),'value':_0x55872a[_0x27e0('0x55')]||(_0x55872a[_0x27e0('0x46')]&&_0x55872a[_0x27e0('0x46')][0x5]?_0x55872a['attrs'][0x5][_0x27e0('0x4a')]:undefined)||''},{'name':_0x27e0('0x56'),'value':_0x55872a[_0x27e0('0x56')]||(_0x55872a[_0x27e0('0x46')]&&_0x55872a[_0x27e0('0x46')][0x6]?_0x55872a['attrs'][0x6][_0x27e0('0x4a')]:undefined)||''},{'name':_0x27e0('0x57'),'value':_0x55872a['attrSmsAccounts']||(_0x55872a[_0x27e0('0x46')]&&_0x55872a[_0x27e0('0x46')][0x7]?_0x55872a[_0x27e0('0x46')][0x7][_0x27e0('0x4a')]:undefined)||''},{'name':_0x27e0('0x58'),'value':_0x55872a[_0x27e0('0x58')]||(_0x55872a[_0x27e0('0x46')]&&_0x55872a[_0x27e0('0x46')][0x8]?_0x55872a[_0x27e0('0x46')][0x8]['value']:undefined)||''},{'name':_0x27e0('0x59'),'value':_0x55872a[_0x27e0('0x59')]||(_0x55872a[_0x27e0('0x46')]&&_0x55872a['attrs'][0x9]?_0x55872a[_0x27e0('0x46')][0x9][_0x27e0('0x4a')]:undefined)||''},{'name':_0x27e0('0x5a'),'value':_0x55872a[_0x27e0('0x5a')]||(_0x55872a[_0x27e0('0x46')]&&_0x55872a[_0x27e0('0x46')][0xa]?_0x55872a[_0x27e0('0x46')][0xa][_0x27e0('0x4a')]:undefined)||''}];case _0x27e0('0x5e'):return[{'name':_0x27e0('0x5f'),'type':_0x55872a[_0x27e0('0x60')]||(_0x55872a[_0x27e0('0x46')]&&_0x55872a[_0x27e0('0x46')][0x0]?_0x55872a[_0x27e0('0x46')][0x0][_0x27e0('0x43')]:undefined)||null,'value':_0x55872a[_0x27e0('0x5f')]||(_0x55872a[_0x27e0('0x46')]&&_0x55872a[_0x27e0('0x46')][0x0]?_0x55872a[_0x27e0('0x46')][0x0][_0x27e0('0x4a')]:undefined)||null},{'name':_0x27e0('0x61'),'value':_0x55872a['attrRefresh']||(_0x55872a['attrs']&&_0x55872a[_0x27e0('0x46')][0x1]?_0x55872a[_0x27e0('0x46')][0x1][_0x27e0('0x4a')]:undefined)||0x0}];default:return[];}}catch(_0x4b598a){logger[_0x27e0('0x2e')]('widgetAttributes:\x20%s',JSON[_0x27e0('0x62')](_0x4b598a));return[];}}exports[_0x27e0('0x63')]=function(_0x5648bf,_0x3b8eec){if(_0x5648bf[_0x27e0('0x64')]){_0x5648bf[_0x27e0('0x64')][_0x27e0('0x46')]=widgetAttributes(_0x5648bf['body']);}return db[_0x27e0('0x42')][_0x27e0('0x63')](_0x5648bf[_0x27e0('0x64')],{})['then'](respondWithResult(_0x3b8eec,0xc9))[_0x27e0('0x41')](handleError(_0x3b8eec,null));};exports[_0x27e0('0x2b')]=function(_0x178973,_0x547996){if(_0x178973[_0x27e0('0x64')]['id']){delete _0x178973[_0x27e0('0x64')]['id'];}_0x178973['body'][_0x27e0('0x46')]=widgetAttributes(_0x178973[_0x27e0('0x64')]);return db[_0x27e0('0x42')][_0x27e0('0x40')]({'where':{'id':_0x178973[_0x27e0('0x33')]['id']}})[_0x27e0('0x2c')](handleEntityNotFound(_0x547996,null))[_0x27e0('0x2c')](saveUpdates(_0x178973[_0x27e0('0x64')],null))['then'](respondWithResult(_0x547996,null))[_0x27e0('0x41')](handleError(_0x547996,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 4c8dd8e..7129431 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 _0xb8a0=['DashboardItem','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x1ad212,_0x391f56){var _0x22531d=function(_0x344c46){while(--_0x344c46){_0x1ad212['push'](_0x1ad212['shift']());}};_0x22531d(++_0x391f56);}(_0xb8a0,0x1d5));var _0x0b8a=function(_0x271eaf,_0x34d889){_0x271eaf=_0x271eaf-0x0;var _0x1f3416=_0xb8a0[_0x271eaf];return _0x1f3416;};'use strict';var EventEmitter=require('events');var DashboardItem=require('../../mysqldb')['db'][_0x0b8a('0x0')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x0b8a('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0b8a('0x2'),'afterDestroy':'remove'};function emitEvent(_0x5d713c){return function(_0x4e1fbc,_0x512cef,_0x1b594f){DashboardItemEvents[_0x0b8a('0x3')](_0x5d713c+':'+_0x4e1fbc['id'],_0x4e1fbc);DashboardItemEvents[_0x0b8a('0x3')](_0x5d713c,_0x4e1fbc);_0x1b594f(null);};}for(var e in events){if(events[_0x0b8a('0x4')](e)){var event=events[e];DashboardItem[_0x0b8a('0x5')](e,emitEvent(event));}}module[_0x0b8a('0x6')]=DashboardItemEvents; \ No newline at end of file +var _0xab1a=['hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x999b85,_0x1edc2b){var _0x1d7124=function(_0x59cd29){while(--_0x59cd29){_0x999b85['push'](_0x999b85['shift']());}};_0x1d7124(++_0x1edc2b);}(_0xab1a,0xf4));var _0xaab1=function(_0x4f1da5,_0x4ced17){_0x4f1da5=_0x4f1da5-0x0;var _0xe972a8=_0xab1a[_0x4f1da5];return _0xe972a8;};'use strict';var EventEmitter=require(_0xaab1('0x0'));var DashboardItem=require(_0xaab1('0x1'))['db'][_0xaab1('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xaab1('0x3')](0x0);var events={'afterCreate':_0xaab1('0x4'),'afterUpdate':_0xaab1('0x5'),'afterDestroy':_0xaab1('0x6')};function emitEvent(_0xe000d5){return function(_0x23b501,_0x36d9ad,_0x2a7649){DashboardItemEvents[_0xaab1('0x7')](_0xe000d5+':'+_0x23b501['id'],_0x23b501);DashboardItemEvents['emit'](_0xe000d5,_0x23b501);_0x2a7649(null);};}for(var e in events){if(events[_0xaab1('0x8')](e)){var event=events[e];DashboardItem[_0xaab1('0x9')](e,emitEvent(event));}}module[_0xaab1('0xa')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index cb6e1d7..1b735fd 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 _0x1b9c=['moment','request-promise','rimraf','./dashboardItem.attributes','DashboardItem','dashboard_items','lodash','util','api'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1b9c,0x1ad));var _0xc1b9=function(_0x4056a7,_0x905b88){_0x4056a7=_0x4056a7-0x0;var _0x1217dc=_0x1b9c[_0x4056a7];return _0x1217dc;};'use strict';var _=require(_0xc1b9('0x0'));var util=require(_0xc1b9('0x1'));var logger=require('../../config/logger')(_0xc1b9('0x2'));var moment=require(_0xc1b9('0x3'));var BPromise=require('bluebird');var rp=require(_0xc1b9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc1b9('0x5'));var config=require('../../config/environment');var attributes=require(_0xc1b9('0x6'));module['exports']=function(_0x21e501,_0x56a1f5){return _0x21e501['define'](_0xc1b9('0x7'),attributes,{'tableName':_0xc1b9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6da3=['bluebird','request-promise','../../config/environment','exports','define','DashboardItem','dashboard_items','lodash','util','../../config/logger','moment'];(function(_0x3c6f3a,_0x1a0e79){var _0x122b3f=function(_0x1e3ef9){while(--_0x1e3ef9){_0x3c6f3a['push'](_0x3c6f3a['shift']());}};_0x122b3f(++_0x1a0e79);}(_0x6da3,0xf9));var _0x36da=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x6da3[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x36da('0x0'));var util=require(_0x36da('0x1'));var logger=require(_0x36da('0x2'))('api');var moment=require(_0x36da('0x3'));var BPromise=require(_0x36da('0x4'));var rp=require(_0x36da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x36da('0x6'));var attributes=require('./dashboardItem.attributes');module[_0x36da('0x7')]=function(_0x25c4fd,_0x3eb004){return _0x25c4fd[_0x36da('0x8')](_0x36da('0x9'),attributes,{'tableName':_0x36da('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 eba85eb..9527b7f 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 _0x5046=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5046,0x118));var _0x6504=function(_0x42de07,_0x310c87){_0x42de07=_0x42de07-0x0;var _0xf11222=_0x5046[_0x42de07];return _0xf11222;};'use strict';var _=require(_0x6504('0x0'));var util=require(_0x6504('0x1'));var moment=require(_0x6504('0x2'));var BPromise=require('bluebird');var rs=require(_0x6504('0x3'));var fs=require('fs');var Redis=require(_0x6504('0x4'));var db=require(_0x6504('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6504('0x6'))(_0x6504('0x7'));var config=require(_0x6504('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x6504('0x9')]=_[_0x6504('0xa')](config['redis'],{'host':_0x6504('0xb'),'port':0x18eb});var socket=require(_0x6504('0xc'))(new Redis(config[_0x6504('0x9')]));require(_0x6504('0xd'))[_0x6504('0xe')](socket);function respondWithRpcPromise(_0x35f76e,_0x5c8ff5,_0x399df5){return new BPromise(function(_0x4c942e,_0x35ebca){return client[_0x6504('0xf')](_0x35f76e,_0x399df5)[_0x6504('0x10')](function(_0x31c2b1){logger[_0x6504('0x11')](_0x6504('0x12'),_0x5c8ff5,'request\x20sent');logger[_0x6504('0x13')](_0x6504('0x14'),_0x5c8ff5,_0x6504('0x15'),JSON[_0x6504('0x16')](_0x31c2b1));if(_0x31c2b1[_0x6504('0x17')]){if(_0x31c2b1[_0x6504('0x17')][_0x6504('0x18')]===0x1f4){logger[_0x6504('0x17')]('DashboardItem,\x20%s,\x20%s',_0x5c8ff5,_0x31c2b1['error'][_0x6504('0x19')]);return _0x35ebca(_0x31c2b1[_0x6504('0x17')][_0x6504('0x19')]);}logger[_0x6504('0x17')](_0x6504('0x12'),_0x5c8ff5,_0x31c2b1[_0x6504('0x17')]['message']);return _0x4c942e(_0x31c2b1[_0x6504('0x17')][_0x6504('0x19')]);}else{logger[_0x6504('0x11')](_0x6504('0x12'),_0x5c8ff5,'request\x20sent');_0x4c942e(_0x31c2b1[_0x6504('0x1a')]['message']);}})[_0x6504('0x1b')](function(_0x17d9e9){logger[_0x6504('0x17')](_0x6504('0x12'),_0x5c8ff5,_0x17d9e9);_0x35ebca(_0x17d9e9);});});} \ No newline at end of file +var _0x9507=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./dashboardItem.socket','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s'];(function(_0x1fbc7d,_0xe5d4fd){var _0x494d81=function(_0x11adf6){while(--_0x11adf6){_0x1fbc7d['push'](_0x1fbc7d['shift']());}};_0x494d81(++_0xe5d4fd);}(_0x9507,0x101));var _0x7950=function(_0x44c82d,_0x1d878d){_0x44c82d=_0x44c82d-0x0;var _0x48e5fe=_0x9507[_0x44c82d];return _0x48e5fe;};'use strict';var _=require(_0x7950('0x0'));var util=require(_0x7950('0x1'));var moment=require(_0x7950('0x2'));var BPromise=require(_0x7950('0x3'));var rs=require(_0x7950('0x4'));var fs=require('fs');var Redis=require(_0x7950('0x5'));var db=require(_0x7950('0x6'))['db'];var utils=require(_0x7950('0x7'));var logger=require('../../config/logger')(_0x7950('0x8'));var config=require(_0x7950('0x9'));var jayson=require(_0x7950('0xa'));var client=jayson[_0x7950('0xb')][_0x7950('0xc')]({'port':0x232a});config[_0x7950('0xd')]=_[_0x7950('0xe')](config[_0x7950('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x7950('0xf'))(new Redis(config[_0x7950('0xd')]));require(_0x7950('0x10'))['register'](socket);function respondWithRpcPromise(_0x589ed2,_0x29a471,_0x46ec26){return new BPromise(function(_0x567f67,_0x182fbe){return client['request'](_0x589ed2,_0x46ec26)[_0x7950('0x11')](function(_0x41583e){logger[_0x7950('0x12')](_0x7950('0x13'),_0x29a471,_0x7950('0x14'));logger[_0x7950('0x15')](_0x7950('0x16'),_0x29a471,_0x7950('0x14'),JSON['stringify'](_0x41583e));if(_0x41583e['error']){if(_0x41583e[_0x7950('0x17')][_0x7950('0x18')]===0x1f4){logger['error'](_0x7950('0x13'),_0x29a471,_0x41583e['error'][_0x7950('0x19')]);return _0x182fbe(_0x41583e['error'][_0x7950('0x19')]);}logger['error'](_0x7950('0x13'),_0x29a471,_0x41583e[_0x7950('0x17')]['message']);return _0x567f67(_0x41583e[_0x7950('0x17')][_0x7950('0x19')]);}else{logger[_0x7950('0x12')](_0x7950('0x13'),_0x29a471,_0x7950('0x14'));_0x567f67(_0x41583e[_0x7950('0x1a')][_0x7950('0x19')]);}})[_0x7950('0x1b')](function(_0x82abdc){logger['error'](_0x7950('0x13'),_0x29a471,_0x82abdc);_0x182fbe(_0x82abdc);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index cb76be7..9c0258c 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 _0x80a1=['removeListener','register','length','dashboardItem:','save'];(function(_0x4cb819,_0x382986){var _0x33fb18=function(_0x211d5e){while(--_0x211d5e){_0x4cb819['push'](_0x4cb819['shift']());}};_0x33fb18(++_0x382986);}(_0x80a1,0xfe));var _0x180a=function(_0x418ad2,_0xeae93b){_0x418ad2=_0x418ad2-0x0;var _0x4f4fe5=_0x80a1[_0x418ad2];return _0x4f4fe5;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x180a('0x0'),'remove','update'];function createListener(_0x4ee659,_0x3def9b){return function(_0x54e6fd){_0x3def9b['emit'](_0x4ee659,_0x54e6fd);};}function removeListener(_0x770560,_0x59fe89){return function(){DashboardItemEvents[_0x180a('0x1')](_0x770560,_0x59fe89);};}exports[_0x180a('0x2')]=function(_0x17b504){for(var _0x2b7780=0x0,_0x2a5e85=events[_0x180a('0x3')];_0x2b7780<_0x2a5e85;_0x2b7780++){var _0x139cd8=events[_0x2b7780];var _0x2363fb=createListener(_0x180a('0x4')+_0x139cd8,_0x17b504);DashboardItemEvents['on'](_0x139cd8,_0x2363fb);}}; \ No newline at end of file +var _0xe640=['removeListener','register','dashboardItem:','./dashboardItem.events','remove','emit'];(function(_0x143bf8,_0x4d3c0f){var _0x23881f=function(_0x3198f0){while(--_0x3198f0){_0x143bf8['push'](_0x143bf8['shift']());}};_0x23881f(++_0x4d3c0f);}(_0xe640,0xc3));var _0x0e64=function(_0x2fba1f,_0x23431c){_0x2fba1f=_0x2fba1f-0x0;var _0x432727=_0xe640[_0x2fba1f];return _0x432727;};'use strict';var DashboardItemEvents=require(_0x0e64('0x0'));var events=['save',_0x0e64('0x1'),'update'];function createListener(_0x185f58,_0x2def68){return function(_0x39e809){_0x2def68[_0x0e64('0x2')](_0x185f58,_0x39e809);};}function removeListener(_0xb026e3,_0x227d52){return function(){DashboardItemEvents[_0x0e64('0x3')](_0xb026e3,_0x227d52);};}exports[_0x0e64('0x4')]=function(_0xafbd00){for(var _0x2872f7=0x0,_0x339041=events['length'];_0x2872f7<_0x339041;_0x2872f7++){var _0x564574=events[_0x2872f7];var _0x414529=createListener(_0x0e64('0x5')+_0x564574,_0xafbd00);DashboardItemEvents['on'](_0x564574,_0x414529);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 725d075..9e9bd3f 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 _0xd51a=['delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','/:id','show','post','isAuthenticated','put','update'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xd51a,0xb6));var _0xad51=function(_0x1abf8b,_0x4fb03d){_0x1abf8b=_0x1abf8b-0x0;var _0x746d07=_0xd51a[_0x1abf8b];return _0x746d07;};'use strict';var multer=require(_0xad51('0x0'));var util=require(_0xad51('0x1'));var path=require(_0xad51('0x2'));var timeout=require(_0xad51('0x3'));var express=require(_0xad51('0x4'));var router=express['Router']();var fs_extra=require(_0xad51('0x5'));var auth=require(_0xad51('0x6'));var interaction=require(_0xad51('0x7'));var config=require(_0xad51('0x8'));var controller=require(_0xad51('0x9'));router['get'](_0xad51('0xa'),auth['isAuthenticated'](),controller[_0xad51('0xb')]);router[_0xad51('0xc')]('/',auth[_0xad51('0xd')](),controller['create']);router[_0xad51('0xe')](_0xad51('0xa'),auth[_0xad51('0xd')](),controller[_0xad51('0xf')]);router[_0xad51('0x10')](_0xad51('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xad51('0x11')]=router; \ No newline at end of file +var _0xe558=['util','path','express','Router','fs-extra','../../components/interaction/service','./dashboardItem.controller','get','/:id','isAuthenticated','show','put','delete','destroy'];(function(_0x5a2b06,_0x254bbb){var _0x40e9b0=function(_0x30b869){while(--_0x30b869){_0x5a2b06['push'](_0x5a2b06['shift']());}};_0x40e9b0(++_0x254bbb);}(_0xe558,0x9a));var _0x8e55=function(_0x546907,_0x2cfdfb){_0x546907=_0x546907-0x0;var _0x436b7a=_0xe558[_0x546907];return _0x436b7a;};'use strict';var multer=require('multer');var util=require(_0x8e55('0x0'));var path=require(_0x8e55('0x1'));var timeout=require('connect-timeout');var express=require(_0x8e55('0x2'));var router=express[_0x8e55('0x3')]();var fs_extra=require(_0x8e55('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8e55('0x5'));var config=require('../../config/environment');var controller=require(_0x8e55('0x6'));router[_0x8e55('0x7')](_0x8e55('0x8'),auth[_0x8e55('0x9')](),controller[_0x8e55('0xa')]);router['post']('/',auth[_0x8e55('0x9')](),controller['create']);router[_0x8e55('0xb')](_0x8e55('0x8'),auth[_0x8e55('0x9')](),controller['update']);router[_0x8e55('0xc')]('/:id',auth[_0x8e55('0x9')](),controller[_0x8e55('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 8fef5f3..451079e 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 _0xa323=['ENUM','first','second','third','sequelize','STRING'];(function(_0x5c781a,_0x133f37){var _0x4bdb44=function(_0x188041){while(--_0x188041){_0x5c781a['push'](_0x5c781a['shift']());}};_0x4bdb44(++_0x133f37);}(_0xa323,0x1d2));var _0x3a32=function(_0xe6e3e2,_0x2b01da){_0xe6e3e2=_0xe6e3e2-0x0;var _0x126571=_0xa323[_0xe6e3e2];return _0x126571;};'use strict';var Sequelize=require(_0x3a32('0x0'));module['exports']={'name':{'type':Sequelize[_0x3a32('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x3a32('0x2')](_0x3a32('0x3'),_0x3a32('0x4'),_0x3a32('0x5')),'allowNull':![],'defaultValue':_0x3a32('0x3')},'description':{'type':Sequelize[_0x3a32('0x1')]}}; \ No newline at end of file +var _0x23af=['exports','STRING','first','second','third','sequelize'];(function(_0x251fe4,_0x3253d5){var _0x2c71de=function(_0xb798c8){while(--_0xb798c8){_0x251fe4['push'](_0x251fe4['shift']());}};_0x2c71de(++_0x3253d5);}(_0x23af,0xa7));var _0xf23a=function(_0x3d3817,_0x349782){_0x3d3817=_0x3d3817-0x0;var _0x22cdce=_0x23af[_0x3d3817];return _0x22cdce;};'use strict';var Sequelize=require(_0xf23a('0x0'));module[_0xf23a('0x1')]={'name':{'type':Sequelize[_0xf23a('0x2')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0xf23a('0x3'),_0xf23a('0x4'),_0xf23a('0x5')),'allowNull':![],'defaultValue':_0xf23a('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 9b6c77c..57d8f26 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 _0x2740=['length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','limit','undefined','offset','count','set','Content-Range','json','apply','save','update','destroy','Dispositions','UserProfileResource','then','end','sendStatus','error','name','send','index','map','Disposition','fieldName','type','key','model','query','keys','intersection','fields','attributes'];(function(_0x18b9b2,_0x4350ab){var _0x457fb5=function(_0x18fac6){while(--_0x18fac6){_0x18b9b2['push'](_0x18b9b2['shift']());}};_0x457fb5(++_0x4350ab);}(_0x2740,0x75));var _0x0274=function(_0x3774b0,_0x35b50f){_0x3774b0=_0x3774b0-0x0;var _0x427685=_0x2740[_0x3774b0];return _0x427685;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0274('0x0'));var zipdir=require(_0x0274('0x1'));var jsonpatch=require(_0x0274('0x2'));var rp=require(_0x0274('0x3'));var moment=require(_0x0274('0x4'));var BPromise=require(_0x0274('0x5'));var Mustache=require(_0x0274('0x6'));var util=require(_0x0274('0x7'));var path=require('path');var sox=require(_0x0274('0x8'));var csv=require(_0x0274('0x9'));var ejs=require(_0x0274('0xa'));var fs=require('fs');var fs_extra=require(_0x0274('0xb'));var _=require(_0x0274('0xc'));var squel=require(_0x0274('0xd'));var crypto=require(_0x0274('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0274('0xf'));var Papa=require(_0x0274('0x10'));var Redis=require(_0x0274('0x11'));var authService=require(_0x0274('0x12'));var qs=require(_0x0274('0x13'));var as=require(_0x0274('0x14'));var hardwareService=require(_0x0274('0x15'));var logger=require(_0x0274('0x16'))(_0x0274('0x17'));var utils=require(_0x0274('0x18'));var config=require(_0x0274('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x0274('0x1a'))['db'];function respondWithStatusCode(_0x4612fd,_0x481640){_0x481640=_0x481640||0xcc;return function(_0x2aff1d){if(_0x2aff1d){return _0x4612fd['sendStatus'](_0x481640);}return _0x4612fd['status'](_0x481640)['end']();};}function respondWithResult(_0x15cc95,_0x5c4266){_0x5c4266=_0x5c4266||0xc8;return function(_0x3f96ad){if(_0x3f96ad){return _0x15cc95[_0x0274('0x1b')](_0x5c4266)['json'](_0x3f96ad);}};}function respondWithFilteredResult(_0x43fe64,_0xa241bc){return function(_0x44dab8){if(_0x44dab8){var _0x33b092=typeof _0xa241bc['offset']==='undefined'&&typeof _0xa241bc[_0x0274('0x1c')]===_0x0274('0x1d');var _0xa7b13b=_0x44dab8['count'];var _0x4f9fbc=_0x33b092?0x0:_0xa241bc[_0x0274('0x1e')];var _0x597770=_0x33b092?_0x44dab8[_0x0274('0x1f')]:_0xa241bc[_0x0274('0x1e')]+_0xa241bc[_0x0274('0x1c')];var _0x4c9f4d;if(_0x597770>=_0xa7b13b){_0x597770=_0xa7b13b;_0x4c9f4d=0xc8;}else{_0x4c9f4d=0xce;}_0x43fe64[_0x0274('0x1b')](_0x4c9f4d);return _0x43fe64[_0x0274('0x20')](_0x0274('0x21'),_0x4f9fbc+'-'+_0x597770+'/'+_0xa7b13b)[_0x0274('0x22')](_0x44dab8);}return null;};}function patchUpdates(_0x20f20f){return function(_0x5f29d8){try{jsonpatch[_0x0274('0x23')](_0x5f29d8,_0x20f20f,!![]);}catch(_0xfe6b2d){return BPromise['reject'](_0xfe6b2d);}return _0x5f29d8[_0x0274('0x24')]();};}function saveUpdates(_0x355b5f,_0x8ea0c8){return function(_0x2a87e3){if(_0x2a87e3){return _0x2a87e3[_0x0274('0x25')](_0x355b5f)['then'](function(_0x563e72){return _0x563e72;});}return null;};}function removeEntity(_0x11574c,_0x228df3){return function(_0x1e7e4d){if(_0x1e7e4d){return _0x1e7e4d[_0x0274('0x26')]()['then'](function(){var _0x393cda=_0x1e7e4d['get']({'plain':!![]});var _0x566c9b=_0x0274('0x27');return db[_0x0274('0x28')]['destroy']({'where':{'type':_0x566c9b,'resourceId':_0x393cda['id']}})[_0x0274('0x29')](function(){return _0x1e7e4d;});})['then'](function(){_0x11574c['status'](0xcc)[_0x0274('0x2a')]();});}};}function handleEntityNotFound(_0x4c74e2,_0x55c6d2){return function(_0x2b7cea){if(!_0x2b7cea){_0x4c74e2[_0x0274('0x2b')](0x194);}return _0x2b7cea;};}function handleError(_0x485bd1,_0x1595bb){_0x1595bb=_0x1595bb||0x1f4;return function(_0x5aac29){logger[_0x0274('0x2c')](_0x5aac29['stack']);if(_0x5aac29[_0x0274('0x2d')]){delete _0x5aac29[_0x0274('0x2d')];}_0x485bd1[_0x0274('0x1b')](_0x1595bb)[_0x0274('0x2e')](_0x5aac29);};}exports[_0x0274('0x2f')]=function(_0x9aed6b,_0x359d41){var _0x5361c1={},_0x56f19f={},_0x227b0c={'count':0x0,'rows':[]};var _0x3e7f62=_[_0x0274('0x30')](db[_0x0274('0x31')]['rawAttributes'],function(_0x12050c){return{'name':_0x12050c[_0x0274('0x32')],'type':_0x12050c[_0x0274('0x33')][_0x0274('0x34')]};});_0x56f19f[_0x0274('0x35')]=_['map'](_0x3e7f62,'name');_0x56f19f[_0x0274('0x36')]=_[_0x0274('0x37')](_0x9aed6b[_0x0274('0x36')]);_0x56f19f['filters']=_[_0x0274('0x38')](_0x56f19f['model'],_0x56f19f[_0x0274('0x36')]);_0x5361c1['attributes']=_[_0x0274('0x38')](_0x56f19f[_0x0274('0x35')],qs[_0x0274('0x39')](_0x9aed6b[_0x0274('0x36')][_0x0274('0x39')]));_0x5361c1[_0x0274('0x3a')]=_0x5361c1[_0x0274('0x3a')][_0x0274('0x3b')]?_0x5361c1['attributes']:_0x56f19f[_0x0274('0x35')];if(!_0x9aed6b['query'][_0x0274('0x3c')](_0x0274('0x3d'))){_0x5361c1[_0x0274('0x1c')]=qs[_0x0274('0x1c')](_0x9aed6b[_0x0274('0x36')][_0x0274('0x1c')]);_0x5361c1[_0x0274('0x1e')]=qs[_0x0274('0x1e')](_0x9aed6b['query'][_0x0274('0x1e')]);}_0x5361c1[_0x0274('0x3e')]=qs[_0x0274('0x3f')](_0x9aed6b[_0x0274('0x36')][_0x0274('0x3f')]);_0x5361c1['where']=qs[_0x0274('0x40')](_['pick'](_0x9aed6b['query'],_0x56f19f[_0x0274('0x40')]),_0x3e7f62);if(_0x9aed6b['query'][_0x0274('0x41')]){_0x5361c1[_0x0274('0x42')]=_[_0x0274('0x43')](_0x5361c1[_0x0274('0x42')],{'$or':_[_0x0274('0x30')](_0x3e7f62,function(_0x30af83){if(_0x30af83[_0x0274('0x33')]!==_0x0274('0x44')){var _0x1eb1fa={};_0x1eb1fa[_0x30af83['name']]={'$like':'%'+_0x9aed6b['query'][_0x0274('0x41')]+'%'};return _0x1eb1fa;}})});}_0x5361c1=_[_0x0274('0x43')]({},_0x5361c1,_0x9aed6b['options']);var _0x4ffb08={'where':_0x5361c1[_0x0274('0x42')]};return db['Disposition'][_0x0274('0x1f')](_0x4ffb08)['then'](function(_0x186f6f){_0x227b0c[_0x0274('0x1f')]=_0x186f6f;if(_0x9aed6b[_0x0274('0x36')][_0x0274('0x45')]){_0x5361c1[_0x0274('0x46')]=[{'all':!![]}];}return db['Disposition'][_0x0274('0x47')](_0x5361c1);})['then'](function(_0x77dddc){_0x227b0c[_0x0274('0x48')]=_0x77dddc;return _0x227b0c;})[_0x0274('0x29')](respondWithFilteredResult(_0x359d41,_0x5361c1))[_0x0274('0x49')](handleError(_0x359d41,null));};exports[_0x0274('0x4a')]=function(_0x124e8e,_0x3f58db){var _0x58a1a0={'raw':!![],'where':{'id':_0x124e8e['params']['id']}},_0x3fc745={};_0x3fc745[_0x0274('0x35')]=_['keys'](db['Disposition'][_0x0274('0x4b')]);_0x3fc745[_0x0274('0x36')]=_[_0x0274('0x37')](_0x124e8e['query']);_0x3fc745[_0x0274('0x40')]=_[_0x0274('0x38')](_0x3fc745[_0x0274('0x35')],_0x3fc745['query']);_0x58a1a0['attributes']=_[_0x0274('0x38')](_0x3fc745['model'],qs[_0x0274('0x39')](_0x124e8e[_0x0274('0x36')][_0x0274('0x39')]));_0x58a1a0[_0x0274('0x3a')]=_0x58a1a0['attributes']['length']?_0x58a1a0[_0x0274('0x3a')]:_0x3fc745[_0x0274('0x35')];if(_0x124e8e[_0x0274('0x36')][_0x0274('0x45')]){_0x58a1a0['include']=[{'all':!![]}];}_0x58a1a0=_[_0x0274('0x43')]({},_0x58a1a0,_0x124e8e['options']);return db['Disposition'][_0x0274('0x4c')](_0x58a1a0)['then'](handleEntityNotFound(_0x3f58db,null))[_0x0274('0x29')](respondWithResult(_0x3f58db,null))[_0x0274('0x49')](handleError(_0x3f58db,null));};exports[_0x0274('0x4d')]=function(_0x1c10a3,_0x3fce84){return db[_0x0274('0x31')][_0x0274('0x4d')](_0x1c10a3[_0x0274('0x4e')],{})['then'](function(_0x32e4c2){var _0x26b3ca=_0x1c10a3['user']['get']({'plain':!![]});if(!_0x26b3ca)throw new Error(_0x0274('0x4f'));if(_0x26b3ca[_0x0274('0x50')]===_0x0274('0x51')){var _0x1c5466=_0x32e4c2[_0x0274('0x52')]({'plain':!![]});var _0x31739f=_0x0274('0x27');return db[_0x0274('0x53')][_0x0274('0x4c')]({'where':{'name':_0x31739f,'userProfileId':_0x26b3ca[_0x0274('0x54')]},'raw':!![]})['then'](function(_0x42021e){if(_0x42021e&&_0x42021e[_0x0274('0x55')]===0x0){return db[_0x0274('0x28')][_0x0274('0x4d')]({'name':_0x1c5466['name'],'resourceId':_0x1c5466['id'],'type':_0x42021e[_0x0274('0x2d')],'sectionId':_0x42021e['id']},{})[_0x0274('0x29')](function(){return _0x32e4c2;});}else{return _0x32e4c2;}})[_0x0274('0x49')](function(_0x34a90b){logger['error'](_0x0274('0x56'),_0x34a90b);throw _0x34a90b;});}return _0x32e4c2;})[_0x0274('0x29')](respondWithResult(_0x3fce84,0xc9))[_0x0274('0x49')](handleError(_0x3fce84,null));};exports['update']=function(_0x488afb,_0x2f414a){if(_0x488afb[_0x0274('0x4e')]['id']){delete _0x488afb[_0x0274('0x4e')]['id'];}return db[_0x0274('0x31')][_0x0274('0x4c')]({'where':{'id':_0x488afb[_0x0274('0x57')]['id']}})[_0x0274('0x29')](handleEntityNotFound(_0x2f414a,null))[_0x0274('0x29')](saveUpdates(_0x488afb['body'],null))[_0x0274('0x29')](respondWithResult(_0x2f414a,null))['catch'](handleError(_0x2f414a,null));};exports[_0x0274('0x26')]=function(_0x324f34,_0x335119){return db[_0x0274('0x31')][_0x0274('0x4c')]({'where':{'id':_0x324f34[_0x0274('0x57')]['id']}})[_0x0274('0x29')](handleEntityNotFound(_0x335119,null))[_0x0274('0x29')](removeEntity(_0x335119,null))['catch'](handleError(_0x335119,null));}; \ No newline at end of file +var _0xee80=['filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','Disposition','fields','length','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','catch','update','eml-format','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','save','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','model','map','query'];(function(_0xe8712b,_0x42aa8c){var _0xf5bcdc=function(_0x1f45fe){while(--_0x1f45fe){_0xe8712b['push'](_0xe8712b['shift']());}};_0xf5bcdc(++_0x42aa8c);}(_0xee80,0x1b0));var _0x0ee8=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0xee80[_0x1b6c6d];return _0x290d9d;};'use strict';var emlformat=require(_0x0ee8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0ee8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ee8('0x2'));var moment=require(_0x0ee8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0ee8('0x4'));var util=require('util');var path=require(_0x0ee8('0x5'));var sox=require('sox');var csv=require(_0x0ee8('0x6'));var ejs=require(_0x0ee8('0x7'));var fs=require('fs');var fs_extra=require(_0x0ee8('0x8'));var _=require(_0x0ee8('0x9'));var squel=require(_0x0ee8('0xa'));var crypto=require(_0x0ee8('0xb'));var jsforce=require(_0x0ee8('0xc'));var deskjs=require(_0x0ee8('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0ee8('0xe'));var Redis=require(_0x0ee8('0xf'));var authService=require(_0x0ee8('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0ee8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ee8('0x12'))(_0x0ee8('0x13'));var utils=require('../../config/utils');var config=require(_0x0ee8('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x0ee8('0x15'))['db'];function respondWithStatusCode(_0x735b5c,_0x342e37){_0x342e37=_0x342e37||0xcc;return function(_0xd30852){if(_0xd30852){return _0x735b5c[_0x0ee8('0x16')](_0x342e37);}return _0x735b5c['status'](_0x342e37)[_0x0ee8('0x17')]();};}function respondWithResult(_0x31a601,_0x516156){_0x516156=_0x516156||0xc8;return function(_0x1bfb91){if(_0x1bfb91){return _0x31a601['status'](_0x516156)[_0x0ee8('0x18')](_0x1bfb91);}};}function respondWithFilteredResult(_0x532097,_0x28ac56){return function(_0x1e23bd){if(_0x1e23bd){var _0x746b9f=typeof _0x28ac56[_0x0ee8('0x19')]===_0x0ee8('0x1a')&&typeof _0x28ac56[_0x0ee8('0x1b')]==='undefined';var _0x246112=_0x1e23bd['count'];var _0x234554=_0x746b9f?0x0:_0x28ac56[_0x0ee8('0x19')];var _0x5c42ac=_0x746b9f?_0x1e23bd[_0x0ee8('0x1c')]:_0x28ac56['offset']+_0x28ac56[_0x0ee8('0x1b')];var _0x2905fa;if(_0x5c42ac>=_0x246112){_0x5c42ac=_0x246112;_0x2905fa=0xc8;}else{_0x2905fa=0xce;}_0x532097[_0x0ee8('0x1d')](_0x2905fa);return _0x532097[_0x0ee8('0x1e')](_0x0ee8('0x1f'),_0x234554+'-'+_0x5c42ac+'/'+_0x246112)[_0x0ee8('0x18')](_0x1e23bd);}return null;};}function patchUpdates(_0x28ac31){return function(_0x444b2f){try{jsonpatch['apply'](_0x444b2f,_0x28ac31,!![]);}catch(_0x31958a){return BPromise['reject'](_0x31958a);}return _0x444b2f[_0x0ee8('0x20')]();};}function saveUpdates(_0x54a190,_0x12e00f){return function(_0x27e130){if(_0x27e130){return _0x27e130['update'](_0x54a190)[_0x0ee8('0x21')](function(_0x59b948){return _0x59b948;});}return null;};}function removeEntity(_0x42a1bc,_0x172a5b){return function(_0x1aff51){if(_0x1aff51){return _0x1aff51[_0x0ee8('0x22')]()[_0x0ee8('0x21')](function(){var _0x382478=_0x1aff51[_0x0ee8('0x23')]({'plain':!![]});var _0x5e00e3=_0x0ee8('0x24');return db[_0x0ee8('0x25')][_0x0ee8('0x22')]({'where':{'type':_0x5e00e3,'resourceId':_0x382478['id']}})[_0x0ee8('0x21')](function(){return _0x1aff51;});})['then'](function(){_0x42a1bc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xae7c35,_0x5c9375){return function(_0x1c13bb){if(!_0x1c13bb){_0xae7c35['sendStatus'](0x194);}return _0x1c13bb;};}function handleError(_0x2f7f1e,_0x21b883){_0x21b883=_0x21b883||0x1f4;return function(_0x78752e){logger[_0x0ee8('0x26')](_0x78752e[_0x0ee8('0x27')]);if(_0x78752e[_0x0ee8('0x28')]){delete _0x78752e[_0x0ee8('0x28')];}_0x2f7f1e[_0x0ee8('0x1d')](_0x21b883)[_0x0ee8('0x29')](_0x78752e);};}exports[_0x0ee8('0x2a')]=function(_0x34156a,_0x497304){var _0x4d229d={},_0x387b3c={},_0x4511bc={'count':0x0,'rows':[]};var _0x458c65=_['map'](db['Disposition'][_0x0ee8('0x2b')],function(_0x5e33dd){return{'name':_0x5e33dd[_0x0ee8('0x2c')],'type':_0x5e33dd['type']['key']};});_0x387b3c[_0x0ee8('0x2d')]=_[_0x0ee8('0x2e')](_0x458c65,_0x0ee8('0x28'));_0x387b3c[_0x0ee8('0x2f')]=_['keys'](_0x34156a[_0x0ee8('0x2f')]);_0x387b3c[_0x0ee8('0x30')]=_[_0x0ee8('0x31')](_0x387b3c['model'],_0x387b3c[_0x0ee8('0x2f')]);_0x4d229d[_0x0ee8('0x32')]=_[_0x0ee8('0x31')](_0x387b3c['model'],qs['fields'](_0x34156a[_0x0ee8('0x2f')]['fields']));_0x4d229d[_0x0ee8('0x32')]=_0x4d229d[_0x0ee8('0x32')]['length']?_0x4d229d[_0x0ee8('0x32')]:_0x387b3c[_0x0ee8('0x2d')];if(!_0x34156a[_0x0ee8('0x2f')][_0x0ee8('0x33')](_0x0ee8('0x34'))){_0x4d229d[_0x0ee8('0x1b')]=qs[_0x0ee8('0x1b')](_0x34156a[_0x0ee8('0x2f')][_0x0ee8('0x1b')]);_0x4d229d[_0x0ee8('0x19')]=qs[_0x0ee8('0x19')](_0x34156a['query'][_0x0ee8('0x19')]);}_0x4d229d[_0x0ee8('0x35')]=qs[_0x0ee8('0x36')](_0x34156a[_0x0ee8('0x2f')][_0x0ee8('0x36')]);_0x4d229d[_0x0ee8('0x37')]=qs[_0x0ee8('0x30')](_['pick'](_0x34156a[_0x0ee8('0x2f')],_0x387b3c[_0x0ee8('0x30')]),_0x458c65);if(_0x34156a[_0x0ee8('0x2f')][_0x0ee8('0x38')]){_0x4d229d[_0x0ee8('0x37')]=_[_0x0ee8('0x39')](_0x4d229d['where'],{'$or':_[_0x0ee8('0x2e')](_0x458c65,function(_0x263f30){if(_0x263f30['type']!==_0x0ee8('0x3a')){var _0x1f2f94={};_0x1f2f94[_0x263f30[_0x0ee8('0x28')]]={'$like':'%'+_0x34156a[_0x0ee8('0x2f')][_0x0ee8('0x38')]+'%'};return _0x1f2f94;}})});}_0x4d229d=_[_0x0ee8('0x39')]({},_0x4d229d,_0x34156a[_0x0ee8('0x3b')]);var _0x6dbe9={'where':_0x4d229d[_0x0ee8('0x37')]};return db['Disposition'][_0x0ee8('0x1c')](_0x6dbe9)[_0x0ee8('0x21')](function(_0x28265c){_0x4511bc[_0x0ee8('0x1c')]=_0x28265c;if(_0x34156a[_0x0ee8('0x2f')]['includeAll']){_0x4d229d[_0x0ee8('0x3c')]=[{'all':!![]}];}return db['Disposition'][_0x0ee8('0x3d')](_0x4d229d);})[_0x0ee8('0x21')](function(_0x1e38ae){_0x4511bc[_0x0ee8('0x3e')]=_0x1e38ae;return _0x4511bc;})[_0x0ee8('0x21')](respondWithFilteredResult(_0x497304,_0x4d229d))['catch'](handleError(_0x497304,null));};exports[_0x0ee8('0x3f')]=function(_0x17854b,_0x2882c6){var _0xe02f38={'raw':!![],'where':{'id':_0x17854b[_0x0ee8('0x40')]['id']}},_0x149926={};_0x149926[_0x0ee8('0x2d')]=_[_0x0ee8('0x41')](db[_0x0ee8('0x42')][_0x0ee8('0x2b')]);_0x149926['query']=_[_0x0ee8('0x41')](_0x17854b[_0x0ee8('0x2f')]);_0x149926[_0x0ee8('0x30')]=_[_0x0ee8('0x31')](_0x149926[_0x0ee8('0x2d')],_0x149926['query']);_0xe02f38[_0x0ee8('0x32')]=_[_0x0ee8('0x31')](_0x149926[_0x0ee8('0x2d')],qs[_0x0ee8('0x43')](_0x17854b['query']['fields']));_0xe02f38[_0x0ee8('0x32')]=_0xe02f38[_0x0ee8('0x32')][_0x0ee8('0x44')]?_0xe02f38[_0x0ee8('0x32')]:_0x149926[_0x0ee8('0x2d')];if(_0x17854b['query'][_0x0ee8('0x45')]){_0xe02f38[_0x0ee8('0x3c')]=[{'all':!![]}];}_0xe02f38=_['merge']({},_0xe02f38,_0x17854b[_0x0ee8('0x3b')]);return db['Disposition'][_0x0ee8('0x46')](_0xe02f38)[_0x0ee8('0x21')](handleEntityNotFound(_0x2882c6,null))[_0x0ee8('0x21')](respondWithResult(_0x2882c6,null))['catch'](handleError(_0x2882c6,null));};exports[_0x0ee8('0x47')]=function(_0x5c1f23,_0x36b6ec){return db[_0x0ee8('0x42')][_0x0ee8('0x47')](_0x5c1f23[_0x0ee8('0x48')],{})[_0x0ee8('0x21')](function(_0x473063){var _0x41e7a2=_0x5c1f23['user'][_0x0ee8('0x23')]({'plain':!![]});if(!_0x41e7a2)throw new Error(_0x0ee8('0x49'));if(_0x41e7a2['role']===_0x0ee8('0x4a')){var _0x2efda7=_0x473063['get']({'plain':!![]});var _0x593b23='Dispositions';return db[_0x0ee8('0x4b')][_0x0ee8('0x46')]({'where':{'name':_0x593b23,'userProfileId':_0x41e7a2[_0x0ee8('0x4c')]},'raw':!![]})[_0x0ee8('0x21')](function(_0x1cebe5){if(_0x1cebe5&&_0x1cebe5[_0x0ee8('0x4d')]===0x0){return db[_0x0ee8('0x25')][_0x0ee8('0x47')]({'name':_0x2efda7['name'],'resourceId':_0x2efda7['id'],'type':_0x1cebe5['name'],'sectionId':_0x1cebe5['id']},{})[_0x0ee8('0x21')](function(){return _0x473063;});}else{return _0x473063;}})[_0x0ee8('0x4e')](function(_0x3487e0){logger[_0x0ee8('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3487e0);throw _0x3487e0;});}return _0x473063;})['then'](respondWithResult(_0x36b6ec,0xc9))[_0x0ee8('0x4e')](handleError(_0x36b6ec,null));};exports[_0x0ee8('0x4f')]=function(_0x1c6f19,_0x451715){if(_0x1c6f19[_0x0ee8('0x48')]['id']){delete _0x1c6f19[_0x0ee8('0x48')]['id'];}return db[_0x0ee8('0x42')]['find']({'where':{'id':_0x1c6f19['params']['id']}})[_0x0ee8('0x21')](handleEntityNotFound(_0x451715,null))[_0x0ee8('0x21')](saveUpdates(_0x1c6f19['body'],null))['then'](respondWithResult(_0x451715,null))[_0x0ee8('0x4e')](handleError(_0x451715,null));};exports[_0x0ee8('0x22')]=function(_0x4aa711,_0x34beb3){return db[_0x0ee8('0x42')][_0x0ee8('0x46')]({'where':{'id':_0x4aa711[_0x0ee8('0x40')]['id']}})['then'](handleEntityNotFound(_0x34beb3,null))[_0x0ee8('0x21')](removeEntity(_0x34beb3,null))[_0x0ee8('0x4e')](handleError(_0x34beb3,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 1e0b69e..1185c22 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 _0x3544=['name_whatsapp','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax'];(function(_0x4aac83,_0x4a594d){var _0x592f30=function(_0x4e73dd){while(--_0x4e73dd){_0x4aac83['push'](_0x4aac83['shift']());}};_0x592f30(++_0x4a594d);}(_0x3544,0xc7));var _0x4354=function(_0x2e04ef,_0x31a596){_0x2e04ef=_0x2e04ef-0x0;var _0x5722b0=_0x3544[_0x2e04ef];return _0x5722b0;};'use strict';var _=require(_0x4354('0x0'));var util=require(_0x4354('0x1'));var logger=require(_0x4354('0x2'))(_0x4354('0x3'));var moment=require(_0x4354('0x4'));var BPromise=require('bluebird');var rp=require(_0x4354('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4354('0x6'));var config=require(_0x4354('0x7'));var attributes=require('./disposition.attributes');module[_0x4354('0x8')]=function(_0x1d7eaf,_0xc6ba9a){return _0x1d7eaf['define'](_0x4354('0x9'),attributes,{'tableName':_0x4354('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x4354('0xb'),'fields':[_0x4354('0xc'),_0x4354('0xd')]},{'unique':!![],'name':_0x4354('0xe'),'fields':[_0x4354('0xc'),_0x4354('0xf')]},{'unique':!![],'name':_0x4354('0x10'),'fields':[_0x4354('0xc'),_0x4354('0x11')]},{'unique':!![],'name':_0x4354('0x12'),'fields':[_0x4354('0xc'),_0x4354('0x13')]},{'unique':!![],'name':_0x4354('0x14'),'fields':['name','FaxAccountId']},{'unique':!![],'name':'name_openchannel','fields':[_0x4354('0xc'),'OpenchannelAccountId']},{'unique':!![],'name':_0x4354('0x15'),'fields':[_0x4354('0xc'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb54f=['WhatsappAccountId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./disposition.attributes','define','tools_dispositions','name_voice','name','ListId','ChatWebsiteId','name_mail','MailAccountId','name_sms','FaxAccountId','name_openchannel','name_whatsapp'];(function(_0x53f5cd,_0xe299c7){var _0x1fed19=function(_0x16667d){while(--_0x16667d){_0x53f5cd['push'](_0x53f5cd['shift']());}};_0x1fed19(++_0xe299c7);}(_0xb54f,0xfe));var _0xfb54=function(_0x37cbb4,_0x54cf4e){_0x37cbb4=_0x37cbb4-0x0;var _0x3b134a=_0xb54f[_0x37cbb4];return _0x3b134a;};'use strict';var _=require(_0xfb54('0x0'));var util=require(_0xfb54('0x1'));var logger=require(_0xfb54('0x2'))(_0xfb54('0x3'));var moment=require(_0xfb54('0x4'));var BPromise=require(_0xfb54('0x5'));var rp=require(_0xfb54('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb54('0x7'));var config=require(_0xfb54('0x8'));var attributes=require(_0xfb54('0x9'));module['exports']=function(_0xf07217,_0x4c3658){return _0xf07217[_0xfb54('0xa')]('Disposition',attributes,{'tableName':_0xfb54('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xfb54('0xc'),'fields':[_0xfb54('0xd'),_0xfb54('0xe')]},{'unique':!![],'name':'name_chat','fields':[_0xfb54('0xd'),_0xfb54('0xf')]},{'unique':!![],'name':_0xfb54('0x10'),'fields':[_0xfb54('0xd'),_0xfb54('0x11')]},{'unique':!![],'name':_0xfb54('0x12'),'fields':[_0xfb54('0xd'),'SmsAccountId']},{'unique':!![],'name':'name_fax','fields':[_0xfb54('0xd'),_0xfb54('0x13')]},{'unique':!![],'name':_0xfb54('0x14'),'fields':['name','OpenchannelAccountId']},{'unique':!![],'name':_0xfb54('0x15'),'fields':[_0xfb54('0xd'),_0xfb54('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 2af0ab1..60ca5d7 100644 --- a/server/api/disposition/disposition.rpc.js +++ b/server/api/disposition/disposition.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3b09fd,_0x55378c){var _0x37233f=function(_0xadbddd){while(--_0xadbddd){_0x3b09fd['push'](_0x3b09fd['shift']());}};_0x37233f(++_0x55378c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x51b5e7,_0x158c76){var _0x52b2a0=function(_0x508f30){while(--_0x508f30){_0x51b5e7['push'](_0x51b5e7['shift']());}};_0x52b2a0(++_0x158c76);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 887f259..74fa208 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 _0xfe2e=['exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./disposition.controller','isAuthenticated','get','/:id','show','post','put','update','delete','destroy'];(function(_0x2b4289,_0x11e0f2){var _0x229e83=function(_0x5233bb){while(--_0x5233bb){_0x2b4289['push'](_0x2b4289['shift']());}};_0x229e83(++_0x11e0f2);}(_0xfe2e,0xef));var _0xefe2=function(_0x3700f5,_0xea0b93){_0x3700f5=_0x3700f5-0x0;var _0x5db57c=_0xfe2e[_0x3700f5];return _0x5db57c;};'use strict';var multer=require(_0xefe2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xefe2('0x1'));var express=require(_0xefe2('0x2'));var router=express[_0xefe2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xefe2('0x4'));var config=require(_0xefe2('0x5'));var controller=require(_0xefe2('0x6'));router['get']('/',auth[_0xefe2('0x7')](),controller['index']);router[_0xefe2('0x8')](_0xefe2('0x9'),auth['isAuthenticated'](),controller[_0xefe2('0xa')]);router[_0xefe2('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xefe2('0xc')](_0xefe2('0x9'),auth['isAuthenticated'](),controller[_0xefe2('0xd')]);router[_0xefe2('0xe')]('/:id',auth[_0xefe2('0x7')](),controller[_0xefe2('0xf')]);module[_0xefe2('0x10')]=router; \ No newline at end of file +var _0x8537=['/:id','post','create','put','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x21c9bc,_0x4ca121){var _0x3a9411=function(_0x4ad02c){while(--_0x4ad02c){_0x21c9bc['push'](_0x21c9bc['shift']());}};_0x3a9411(++_0x4ca121);}(_0x8537,0xe3));var _0x7853=function(_0x408ac3,_0xfc5b46){_0x408ac3=_0x408ac3-0x0;var _0x32e72f=_0x8537[_0x408ac3];return _0x32e72f;};'use strict';var multer=require(_0x7853('0x0'));var util=require('util');var path=require(_0x7853('0x1'));var timeout=require(_0x7853('0x2'));var express=require(_0x7853('0x3'));var router=express[_0x7853('0x4')]();var fs_extra=require(_0x7853('0x5'));var auth=require(_0x7853('0x6'));var interaction=require(_0x7853('0x7'));var config=require(_0x7853('0x8'));var controller=require('./disposition.controller');router[_0x7853('0x9')]('/',auth[_0x7853('0xa')](),controller['index']);router[_0x7853('0x9')](_0x7853('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x7853('0xc')]('/',auth[_0x7853('0xa')](),controller[_0x7853('0xd')]);router[_0x7853('0xe')](_0x7853('0xb'),auth[_0x7853('0xa')](),controller['update']);router[_0x7853('0xf')](_0x7853('0xb'),auth[_0x7853('0xa')](),controller['destroy']);module[_0x7853('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index dfc192d..ab02d0c 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 _0xa80f=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','exports','ENUM','yes','STRING','localstationid','2400','4800','7200','12000','14400','9600','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x5048a0,_0x28a646){var _0x3852f1=function(_0x1f6f7e){while(--_0x1f6f7e){_0x5048a0['push'](_0x5048a0['shift']());}};_0x3852f1(++_0x28a646);}(_0xa80f,0x1d1));var _0xfa80=function(_0x3fb5f7,_0x3b234b){_0x3fb5f7=_0x3fb5f7-0x0;var _0x344db7=_0xa80f[_0x3fb5f7];return _0x344db7;};'use strict';var Sequelize=require('sequelize');module[_0xfa80('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0xfa80('0x1')](_0xfa80('0x2'),'no'),'defaultValue':_0xfa80('0x2')},'headerinfo':{'type':Sequelize[_0xfa80('0x3')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xfa80('0x3')],'unique':_0xfa80('0x4')},'minrate':{'type':Sequelize['ENUM'](_0xfa80('0x5'),_0xfa80('0x6'),_0xfa80('0x7'),'9600',_0xfa80('0x8'),_0xfa80('0x9')),'defaultValue':_0xfa80('0x6')},'maxrate':{'type':Sequelize[_0xfa80('0x1')]('2400',_0xfa80('0x6'),_0xfa80('0x7'),_0xfa80('0xa'),'12000','14400'),'defaultValue':'14400'},'modem':{'type':Sequelize[_0xfa80('0x3')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0xfa80('0x3')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xfa80('0x3')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xfa80('0x1')](_0xfa80('0xb'),_0xfa80('0xc'),_0xfa80('0xd'),_0xfa80('0xe')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0xfa80('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xfa80('0xf')],'defaultValue':function(){return _0xfa80('0x10');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfa80('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfa80('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfa80('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xfa80('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xfa80('0x11')],'defaultValue':![],'comment':_0xfa80('0x14'),'set':function(_0x16276d){if(!_0x16276d)this[_0xfa80('0x15')](_0xfa80('0x16'),null);this[_0xfa80('0x15')]('mandatoryDisposition',_0x16276d);}}}; \ No newline at end of file +var _0x7789=['KHOMP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','4800','7200','9600','12000','14400','2400','INTEGER','SIP','IAX','DADHI'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x7789,0x11a));var _0x9778=function(_0x385ac4,_0x95b82c){_0x385ac4=_0x385ac4-0x0;var _0x317730=_0x7789[_0x385ac4];return _0x317730;};'use strict';var Sequelize=require(_0x9778('0x0'));module[_0x9778('0x1')]={'name':{'type':Sequelize[_0x9778('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9778('0x2')]},'ecm':{'type':Sequelize[_0x9778('0x3')]('yes','no'),'defaultValue':_0x9778('0x4')},'headerinfo':{'type':Sequelize[_0x9778('0x2')],'defaultValue':_0x9778('0x5')},'localstationid':{'type':Sequelize[_0x9778('0x2')],'unique':_0x9778('0x6')},'minrate':{'type':Sequelize[_0x9778('0x3')]('2400',_0x9778('0x7'),_0x9778('0x8'),_0x9778('0x9'),_0x9778('0xa'),_0x9778('0xb')),'defaultValue':_0x9778('0x7')},'maxrate':{'type':Sequelize[_0x9778('0x3')](_0x9778('0xc'),_0x9778('0x7'),_0x9778('0x8'),_0x9778('0x9'),_0x9778('0xa'),_0x9778('0xb')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x9778('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x9778('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x9778('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x9778('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x9778('0xe'),_0x9778('0xf'),_0x9778('0x10'),_0x9778('0x11')),'defaultValue':_0x9778('0xe')},'key':{'type':Sequelize[_0x9778('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x9778('0x12')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x9778('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9778('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9778('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9778('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9778('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x9778('0x14')},'mandatoryDisposition':{'type':Sequelize[_0x9778('0x13')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x11f48e){if(!_0x11f48e)this[_0x9778('0x15')](_0x9778('0x16'),null);this['setDataValue']('mandatoryDisposition',_0x11f48e);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 6b56403..65c442f 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 _0xb543=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts','UserProfileSection','find','userProfileId','autoAssociation','body','describe','addDisposition','Disposition','getDispositions','findOne','order','FaxAccountId','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','addInteraction','FaxInteraction','omit','CmContact','Contact','User','Owner','internal','Tags','color','tag','sequelize','Transaction','ISOLATION_LEVELS','FaxApplication','bulkCreate','priority','finally','getApplications','context','from-voip-provider','exten','localstationid','system','description','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','headerinfo','maxrate','modem','t38timeout','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','transaction','VoiceExtension','createdAt','updatedAt','TrunkId','$gte','split','FaxMessage','CmList','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List','ListId','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','./faxAccount.socket','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','end','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','key','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','include','findAll','params','model','keys','length','includeAll','create','user'];(function(_0x50d6d6,_0x189c68){var _0x5d9bb4=function(_0x12ba37){while(--_0x12ba37){_0x50d6d6['push'](_0x50d6d6['shift']());}};_0x5d9bb4(++_0x189c68);}(_0xb543,0x129));var _0x3b54=function(_0x15cbfe,_0x2704af){_0x15cbfe=_0x15cbfe-0x0;var _0x3cab22=_0xb543[_0x15cbfe];return _0x3cab22;};'use strict';var emlformat=require(_0x3b54('0x0'));var rimraf=require(_0x3b54('0x1'));var zipdir=require(_0x3b54('0x2'));var jsonpatch=require(_0x3b54('0x3'));var rp=require(_0x3b54('0x4'));var moment=require(_0x3b54('0x5'));var BPromise=require(_0x3b54('0x6'));var Mustache=require(_0x3b54('0x7'));var util=require('util');var path=require(_0x3b54('0x8'));var sox=require(_0x3b54('0x9'));var csv=require(_0x3b54('0xa'));var ejs=require(_0x3b54('0xb'));var fs=require('fs');var fs_extra=require(_0x3b54('0xc'));var _=require(_0x3b54('0xd'));var squel=require(_0x3b54('0xe'));var crypto=require(_0x3b54('0xf'));var jsforce=require(_0x3b54('0x10'));var deskjs=require(_0x3b54('0x11'));var toCsv=require('to-csv');var querystring=require(_0x3b54('0x12'));var Papa=require(_0x3b54('0x13'));var Redis=require('ioredis');var authService=require(_0x3b54('0x14'));var qs=require(_0x3b54('0x15'));var as=require(_0x3b54('0x16'));var hardwareService=require(_0x3b54('0x17'));var logger=require(_0x3b54('0x18'))(_0x3b54('0x19'));var utils=require(_0x3b54('0x1a'));var config=require(_0x3b54('0x1b'));var licenseUtil=require(_0x3b54('0x1c'));var db=require(_0x3b54('0x1d'))['db'];config['redis']=_[_0x3b54('0x1e')](config[_0x3b54('0x1f')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3b54('0x20'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x3b54('0x21')][_0x3b54('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x1f591e,_0x27ce28,_0x5c1411,_0x3fa7d4){return new BPromise(function(_0x49c26e,_0x1ce3c1){var _0x174e20=_0x3fa7d4||client;return _0x174e20[_0x3b54('0x23')](_0x1f591e,_0x5c1411)[_0x3b54('0x24')](function(_0x101950){logger[_0x3b54('0x25')](_0x3b54('0x26'),_0x27ce28,'request\x20sent');logger[_0x3b54('0x27')](_0x3b54('0x28'),_0x27ce28,'request\x20sent',JSON[_0x3b54('0x29')](_0x101950));if(_0x101950['error']){if(_0x101950[_0x3b54('0x2a')][_0x3b54('0x2b')]===0x1f4){logger[_0x3b54('0x2a')](_0x3b54('0x26'),_0x27ce28,_0x101950[_0x3b54('0x2a')][_0x3b54('0x2c')]);return _0x1ce3c1(_0x101950['error']['message']);}logger[_0x3b54('0x2a')]('FaxAccount,\x20%s,\x20%s',_0x27ce28,_0x101950['error'][_0x3b54('0x2c')]);return _0x49c26e(_0x101950[_0x3b54('0x2a')]['message']);}else{logger[_0x3b54('0x25')]('FaxAccount,\x20%s,\x20%s',_0x27ce28,'request\x20sent');_0x49c26e(_0x101950[_0x3b54('0x2d')]['message']);}})[_0x3b54('0x2e')](function(_0x3afe87){logger[_0x3b54('0x2a')](_0x3b54('0x26'),_0x27ce28,_0x3afe87);_0x1ce3c1(_0x3afe87);});});}function respondWithStatusCode(_0x272fdc,_0x345de4){_0x345de4=_0x345de4||0xcc;return function(_0x325a70){if(_0x325a70){return _0x272fdc['sendStatus'](_0x345de4);}return _0x272fdc[_0x3b54('0x2f')](_0x345de4)['end']();};}function respondWithResult(_0x3895e7,_0x1ebd2d){_0x1ebd2d=_0x1ebd2d||0xc8;return function(_0x2753cf){if(_0x2753cf){return _0x3895e7[_0x3b54('0x2f')](_0x1ebd2d)[_0x3b54('0x30')](_0x2753cf);}};}function respondWithFilteredResult(_0xdb8327,_0x4c2568){return function(_0x167d1c){if(_0x167d1c){var _0x280a89=typeof _0x4c2568[_0x3b54('0x31')]===_0x3b54('0x32')&&typeof _0x4c2568['limit']==='undefined';var _0x54ed80=_0x167d1c[_0x3b54('0x33')];var _0x74eb92=_0x280a89?0x0:_0x4c2568[_0x3b54('0x31')];var _0x14735f=_0x280a89?_0x167d1c[_0x3b54('0x33')]:_0x4c2568[_0x3b54('0x31')]+_0x4c2568[_0x3b54('0x34')];var _0x5aa3a2;if(_0x14735f>=_0x54ed80){_0x14735f=_0x54ed80;_0x5aa3a2=0xc8;}else{_0x5aa3a2=0xce;}_0xdb8327[_0x3b54('0x2f')](_0x5aa3a2);return _0xdb8327[_0x3b54('0x35')](_0x3b54('0x36'),_0x74eb92+'-'+_0x14735f+'/'+_0x54ed80)[_0x3b54('0x30')](_0x167d1c);}return null;};}function patchUpdates(_0x5b538a){return function(_0x5575a2){try{jsonpatch[_0x3b54('0x37')](_0x5575a2,_0x5b538a,!![]);}catch(_0x4d12a5){return BPromise[_0x3b54('0x38')](_0x4d12a5);}return _0x5575a2[_0x3b54('0x39')]();};}function saveUpdates(_0x3e2811,_0xea8401){return function(_0x320d26){if(_0x320d26){return _0x320d26[_0x3b54('0x3a')](_0x3e2811)[_0x3b54('0x24')](function(_0xe82a39){return _0xe82a39;});}return null;};}function removeEntity(_0x3239f3,_0x1a4842){return function(_0x473bf3){if(_0x473bf3){return _0x473bf3[_0x3b54('0x3b')]()[_0x3b54('0x24')](function(){var _0x5edf3e=_0x473bf3[_0x3b54('0x3c')]({'plain':!![]});var _0x3d8ce7='FaxAccounts';return db[_0x3b54('0x3d')][_0x3b54('0x3b')]({'where':{'type':_0x3d8ce7,'resourceId':_0x5edf3e['id']}})[_0x3b54('0x24')](function(){return _0x473bf3;});})[_0x3b54('0x24')](function(){_0x3239f3[_0x3b54('0x2f')](0xcc)[_0x3b54('0x3e')]();});}};}function handleEntityNotFound(_0x32b986,_0x33385c){return function(_0x552236){if(!_0x552236){_0x32b986[_0x3b54('0x3f')](0x194);}return _0x552236;};}function handleError(_0x305a43,_0x8c9d68){_0x8c9d68=_0x8c9d68||0x1f4;return function(_0x4f6773){logger['error'](_0x4f6773[_0x3b54('0x40')]);if(_0x4f6773[_0x3b54('0x41')]){delete _0x4f6773[_0x3b54('0x41')];}_0x305a43[_0x3b54('0x2f')](_0x8c9d68)[_0x3b54('0x42')](_0x4f6773);};}exports[_0x3b54('0x43')]=function(_0x585481,_0x33e220){var _0x4c5560={'include':[{'model':db[_0x3b54('0x44')],'as':_0x3b54('0x45')}]},_0x28013d={},_0x252f14={'count':0x0,'rows':[]};var _0x314996=_['map'](db[_0x3b54('0x46')][_0x3b54('0x47')],function(_0x14ec88){return{'name':_0x14ec88[_0x3b54('0x48')],'type':_0x14ec88['type'][_0x3b54('0x49')]};});_0x28013d['model']=_[_0x3b54('0x4a')](_0x314996,_0x3b54('0x41'));_0x28013d[_0x3b54('0x4b')]=_['keys'](_0x585481[_0x3b54('0x4b')]);_0x28013d[_0x3b54('0x4c')]=_[_0x3b54('0x4d')](_0x28013d['model'],_0x28013d[_0x3b54('0x4b')]);_0x4c5560['attributes']=_['intersection'](_0x28013d['model'],qs[_0x3b54('0x4e')](_0x585481[_0x3b54('0x4b')][_0x3b54('0x4e')]));_0x4c5560[_0x3b54('0x4f')]=_0x4c5560[_0x3b54('0x4f')]['length']?_0x4c5560[_0x3b54('0x4f')]:_0x28013d['model'];if(!_0x585481['query'][_0x3b54('0x50')](_0x3b54('0x51'))){_0x4c5560[_0x3b54('0x34')]=qs[_0x3b54('0x34')](_0x585481['query'][_0x3b54('0x34')]);_0x4c5560['offset']=qs[_0x3b54('0x31')](_0x585481[_0x3b54('0x4b')][_0x3b54('0x31')]);}_0x4c5560['order']=qs[_0x3b54('0x52')](_0x585481['query']['sort']);_0x4c5560[_0x3b54('0x53')]=qs['filters'](_[_0x3b54('0x54')](_0x585481[_0x3b54('0x4b')],_0x28013d[_0x3b54('0x4c')]),_0x314996);if(_0x585481[_0x3b54('0x4b')]['filter']){_0x4c5560['where']=_[_0x3b54('0x55')](_0x4c5560[_0x3b54('0x53')],{'$or':_['map'](_0x314996,function(_0x5eafd5){if(_0x5eafd5[_0x3b54('0x56')]!==_0x3b54('0x57')){var _0x161085={};_0x161085[_0x5eafd5[_0x3b54('0x41')]]={'$like':'%'+_0x585481['query'][_0x3b54('0x58')]+'%'};return _0x161085;}})});}_0x4c5560=_[_0x3b54('0x55')]({},_0x4c5560,_0x585481[_0x3b54('0x59')]);var _0x2d1c7b={'where':_0x4c5560[_0x3b54('0x53')]};return db[_0x3b54('0x46')][_0x3b54('0x33')](_0x2d1c7b)[_0x3b54('0x24')](function(_0x4a79a2){_0x252f14[_0x3b54('0x33')]=_0x4a79a2;if(_0x585481[_0x3b54('0x4b')]['includeAll']){_0x4c5560[_0x3b54('0x5a')]=[{'all':!![]}];}return db['FaxAccount'][_0x3b54('0x5b')](_0x4c5560);})['then'](function(_0x548453){_0x252f14['rows']=_0x548453;return _0x252f14;})[_0x3b54('0x24')](respondWithFilteredResult(_0x33e220,_0x4c5560))[_0x3b54('0x2e')](handleError(_0x33e220,null));};exports['show']=function(_0x2ee3bc,_0x39cc16){var _0x2710fc={'raw':![],'where':{'id':_0x2ee3bc[_0x3b54('0x5c')]['id']},'include':[{'model':db[_0x3b54('0x44')],'as':_0x3b54('0x45')}]},_0x319a8e={};_0x319a8e[_0x3b54('0x5d')]=_[_0x3b54('0x5e')](db[_0x3b54('0x46')][_0x3b54('0x47')]);_0x319a8e['query']=_[_0x3b54('0x5e')](_0x2ee3bc[_0x3b54('0x4b')]);_0x319a8e[_0x3b54('0x4c')]=_[_0x3b54('0x4d')](_0x319a8e[_0x3b54('0x5d')],_0x319a8e[_0x3b54('0x4b')]);_0x2710fc['attributes']=_['intersection'](_0x319a8e[_0x3b54('0x5d')],qs[_0x3b54('0x4e')](_0x2ee3bc['query']['fields']));_0x2710fc[_0x3b54('0x4f')]=_0x2710fc['attributes'][_0x3b54('0x5f')]?_0x2710fc[_0x3b54('0x4f')]:_0x319a8e['model'];if(_0x2ee3bc[_0x3b54('0x4b')][_0x3b54('0x60')]){_0x2710fc[_0x3b54('0x5a')]=[{'all':!![]}];}_0x2710fc=_['merge']({},_0x2710fc,_0x2ee3bc['options']);return db[_0x3b54('0x46')]['find'](_0x2710fc)[_0x3b54('0x24')](handleEntityNotFound(_0x39cc16,null))[_0x3b54('0x24')](respondWithResult(_0x39cc16,null))[_0x3b54('0x2e')](handleError(_0x39cc16,null));};exports[_0x3b54('0x61')]=function(_0x3cf2b9,_0x38f82b){return db['FaxAccount'][_0x3b54('0x61')](_0x3cf2b9['body'],{})[_0x3b54('0x24')](function(_0x269f98){var _0x2862bb=_0x3cf2b9[_0x3b54('0x62')][_0x3b54('0x3c')]({'plain':!![]});if(!_0x2862bb)throw new Error(_0x3b54('0x63'));if(_0x2862bb[_0x3b54('0x64')]===_0x3b54('0x62')){var _0x21d409=_0x269f98[_0x3b54('0x3c')]({'plain':!![]});var _0x3571c8=_0x3b54('0x65');return db[_0x3b54('0x66')][_0x3b54('0x67')]({'where':{'name':_0x3571c8,'userProfileId':_0x2862bb[_0x3b54('0x68')]},'raw':!![]})[_0x3b54('0x24')](function(_0x2a9f6e){if(_0x2a9f6e&&_0x2a9f6e[_0x3b54('0x69')]===0x0){return db[_0x3b54('0x3d')][_0x3b54('0x61')]({'name':_0x21d409[_0x3b54('0x41')],'resourceId':_0x21d409['id'],'type':_0x2a9f6e[_0x3b54('0x41')],'sectionId':_0x2a9f6e['id']},{})[_0x3b54('0x24')](function(){return _0x269f98;});}else{return _0x269f98;}})[_0x3b54('0x2e')](function(_0x1bebba){logger[_0x3b54('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1bebba);throw _0x1bebba;});}return _0x269f98;})[_0x3b54('0x24')](respondWithResult(_0x38f82b,0xc9))['catch'](handleError(_0x38f82b,null));};exports[_0x3b54('0x3a')]=function(_0x3fea09,_0x4be803){if(_0x3fea09[_0x3b54('0x6a')]['id']){delete _0x3fea09[_0x3b54('0x6a')]['id'];}return db[_0x3b54('0x46')]['find']({'where':{'id':_0x3fea09[_0x3b54('0x5c')]['id']},'include':[{'model':db[_0x3b54('0x44')],'as':_0x3b54('0x45')}]})[_0x3b54('0x24')](handleEntityNotFound(_0x4be803,null))[_0x3b54('0x24')](saveUpdates(_0x3fea09[_0x3b54('0x6a')],null))['then'](respondWithResult(_0x4be803,null))[_0x3b54('0x2e')](handleError(_0x4be803,null));};exports['destroy']=function(_0x2a4516,_0x3bf04c){return db[_0x3b54('0x46')][_0x3b54('0x67')]({'where':{'id':_0x2a4516[_0x3b54('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3bf04c,null))[_0x3b54('0x24')](removeEntity(_0x3bf04c,null))[_0x3b54('0x2e')](handleError(_0x3bf04c,null));};exports[_0x3b54('0x6b')]=function(_0xa62ced,_0x59ab3f){return db[_0x3b54('0x46')][_0x3b54('0x6b')]()[_0x3b54('0x24')](respondWithResult(_0x59ab3f,null))[_0x3b54('0x2e')](handleError(_0x59ab3f,null));};exports[_0x3b54('0x6c')]=function(_0x326257,_0x44a250,_0x4a11ca){if(_0x326257[_0x3b54('0x6a')]['id']){delete _0x326257[_0x3b54('0x6a')]['id'];}return db['FaxAccount'][_0x3b54('0x67')]({'where':{'id':_0x326257[_0x3b54('0x5c')]['id']}})[_0x3b54('0x24')](handleEntityNotFound(_0x44a250,null))[_0x3b54('0x24')](function(_0x48068b){if(_0x48068b){_0x326257[_0x3b54('0x6a')]['FaxAccountId']=_0x48068b['id'];return db[_0x3b54('0x6d')][_0x3b54('0x61')](_0x326257[_0x3b54('0x6a')]);}})[_0x3b54('0x24')](respondWithResult(_0x44a250,null))[_0x3b54('0x2e')](handleError(_0x44a250,null));};exports[_0x3b54('0x6e')]=function(_0xff7dcf,_0x2d5f8a,_0x30b451){var _0x357dca={'raw':![],'where':{}};var _0x4f689e={};var _0x10aa03={'count':0x0,'rows':[]};return db['FaxAccount'][_0x3b54('0x6f')]({'where':{'id':_0xff7dcf['params']['id']}})[_0x3b54('0x24')](handleEntityNotFound(_0x2d5f8a,null))[_0x3b54('0x24')](function(_0x48d12e){if(_0x48d12e){_0x4f689e[_0x3b54('0x5d')]=_[_0x3b54('0x5e')](db['Disposition'][_0x3b54('0x47')]);_0x4f689e['query']=_[_0x3b54('0x5e')](_0xff7dcf[_0x3b54('0x4b')]);_0x4f689e[_0x3b54('0x4c')]=_[_0x3b54('0x4d')](_0x4f689e[_0x3b54('0x5d')],_0x4f689e['query']);_0x357dca[_0x3b54('0x4f')]=_['intersection'](_0x4f689e[_0x3b54('0x5d')],qs['fields'](_0xff7dcf['query'][_0x3b54('0x4e')]));_0x357dca[_0x3b54('0x4f')]=_0x357dca['attributes'][_0x3b54('0x5f')]?_0x357dca['attributes']:_0x4f689e['model'];if(!_0xff7dcf['query']['hasOwnProperty'](_0x3b54('0x51'))){_0x357dca['limit']=qs[_0x3b54('0x34')](_0xff7dcf[_0x3b54('0x4b')][_0x3b54('0x34')]);_0x357dca[_0x3b54('0x31')]=qs['offset'](_0xff7dcf[_0x3b54('0x4b')][_0x3b54('0x31')]);}_0x357dca[_0x3b54('0x70')]=qs['sort'](_0xff7dcf[_0x3b54('0x4b')]['sort']);_0x357dca['where']=qs[_0x3b54('0x4c')](_['pick'](_0xff7dcf[_0x3b54('0x4b')],_0x4f689e[_0x3b54('0x4c')]));_0x357dca[_0x3b54('0x53')][_0x3b54('0x71')]=_0x48d12e['id'];if(_0xff7dcf['query']['filter']){_0x357dca['where']=_[_0x3b54('0x55')](_0x357dca[_0x3b54('0x53')],{'$or':_['map'](_0x357dca['attributes'],function(_0x157300){var _0x548fcd={};_0x548fcd[_0x157300]={'$like':'%'+_0xff7dcf[_0x3b54('0x4b')][_0x3b54('0x58')]+'%'};return _0x548fcd;})});}_0x357dca=_['merge']({},_0x357dca,_0xff7dcf['options']);return db[_0x3b54('0x6d')][_0x3b54('0x33')]({'where':_0x357dca[_0x3b54('0x53')]})[_0x3b54('0x24')](function(_0xc941ea){_0x10aa03[_0x3b54('0x33')]=_0xc941ea;if(_0xff7dcf[_0x3b54('0x4b')][_0x3b54('0x60')]){_0x357dca[_0x3b54('0x5a')]=[{'all':!![]}];}return db[_0x3b54('0x6d')]['findAll'](_0x357dca);})[_0x3b54('0x24')](function(_0xeb2274){_0x10aa03[_0x3b54('0x72')]=_0xeb2274;return _0x10aa03;});}})[_0x3b54('0x24')](respondWithFilteredResult(_0x2d5f8a,_0x357dca))[_0x3b54('0x2e')](handleError(_0x2d5f8a,null));};exports[_0x3b54('0x73')]=function(_0x126491,_0x35198e,_0x40072f){return db[_0x3b54('0x46')][_0x3b54('0x67')]({'where':{'id':_0x126491[_0x3b54('0x5c')]['id']}})[_0x3b54('0x24')](handleEntityNotFound(_0x35198e,null))['then'](function(_0x31e6f9){if(_0x31e6f9){return _0x31e6f9[_0x3b54('0x73')](_0x126491[_0x3b54('0x4b')][_0x3b54('0x74')]);}})[_0x3b54('0x24')](respondWithStatusCode(_0x35198e,null))[_0x3b54('0x2e')](handleError(_0x35198e,null));};exports[_0x3b54('0x75')]=function(_0x30752b,_0x4a229c,_0x37c941){if(_0x30752b[_0x3b54('0x6a')]['id']){delete _0x30752b[_0x3b54('0x6a')]['id'];}return db[_0x3b54('0x46')][_0x3b54('0x67')]({'where':{'id':_0x30752b[_0x3b54('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4a229c,null))[_0x3b54('0x24')](function(_0x23332f){if(_0x23332f){_0x30752b[_0x3b54('0x6a')][_0x3b54('0x71')]=_0x23332f['id'];return db[_0x3b54('0x76')]['create'](_0x30752b[_0x3b54('0x6a')]);}})[_0x3b54('0x24')](respondWithResult(_0x4a229c,null))[_0x3b54('0x2e')](handleError(_0x4a229c,null));};exports[_0x3b54('0x77')]=function(_0x267065,_0xb2d311,_0x19ce64){var _0x1ab2cc={'raw':![],'where':{}};var _0x22a207={};var _0xd016e6={'count':0x0,'rows':[]};return db[_0x3b54('0x46')][_0x3b54('0x6f')]({'where':{'id':_0x267065[_0x3b54('0x5c')]['id']}})['then'](handleEntityNotFound(_0xb2d311,null))[_0x3b54('0x24')](function(_0x17bea0){if(_0x17bea0){_0x22a207[_0x3b54('0x5d')]=_['keys'](db[_0x3b54('0x76')][_0x3b54('0x47')]);_0x22a207['query']=_[_0x3b54('0x5e')](_0x267065['query']);_0x22a207[_0x3b54('0x4c')]=_[_0x3b54('0x4d')](_0x22a207[_0x3b54('0x5d')],_0x22a207['query']);_0x1ab2cc[_0x3b54('0x4f')]=_[_0x3b54('0x4d')](_0x22a207[_0x3b54('0x5d')],qs[_0x3b54('0x4e')](_0x267065[_0x3b54('0x4b')][_0x3b54('0x4e')]));_0x1ab2cc[_0x3b54('0x4f')]=_0x1ab2cc['attributes'][_0x3b54('0x5f')]?_0x1ab2cc[_0x3b54('0x4f')]:_0x22a207[_0x3b54('0x5d')];if(!_0x267065['query'][_0x3b54('0x50')](_0x3b54('0x51'))){_0x1ab2cc[_0x3b54('0x34')]=qs['limit'](_0x267065[_0x3b54('0x4b')]['limit']);_0x1ab2cc[_0x3b54('0x31')]=qs[_0x3b54('0x31')](_0x267065[_0x3b54('0x4b')]['offset']);}_0x1ab2cc[_0x3b54('0x70')]=qs[_0x3b54('0x52')](_0x267065[_0x3b54('0x4b')][_0x3b54('0x52')]);_0x1ab2cc[_0x3b54('0x53')]=qs[_0x3b54('0x4c')](_[_0x3b54('0x54')](_0x267065[_0x3b54('0x4b')],_0x22a207[_0x3b54('0x4c')]));_0x1ab2cc[_0x3b54('0x53')]['FaxAccountId']=_0x17bea0['id'];if(_0x267065[_0x3b54('0x4b')][_0x3b54('0x58')]){_0x1ab2cc[_0x3b54('0x53')]=_[_0x3b54('0x55')](_0x1ab2cc[_0x3b54('0x53')],{'$or':_[_0x3b54('0x4a')](_0x1ab2cc['attributes'],function(_0x2c8eec){var _0xaef16e={};_0xaef16e[_0x2c8eec]={'$like':'%'+_0x267065[_0x3b54('0x4b')][_0x3b54('0x58')]+'%'};return _0xaef16e;})});}_0x1ab2cc=_[_0x3b54('0x55')]({},_0x1ab2cc,_0x267065[_0x3b54('0x59')]);return db[_0x3b54('0x76')][_0x3b54('0x33')]({'where':_0x1ab2cc[_0x3b54('0x53')]})[_0x3b54('0x24')](function(_0x3913f9){_0xd016e6[_0x3b54('0x33')]=_0x3913f9;if(_0x267065['query'][_0x3b54('0x60')]){_0x1ab2cc[_0x3b54('0x5a')]=[{'all':!![]}];}return db[_0x3b54('0x76')]['findAll'](_0x1ab2cc);})['then'](function(_0x42b266){_0xd016e6['rows']=_0x42b266;return _0xd016e6;});}})['then'](respondWithFilteredResult(_0xb2d311,_0x1ab2cc))[_0x3b54('0x2e')](handleError(_0xb2d311,null));};exports['removeAnswers']=function(_0x478658,_0x34b90a,_0x1c4b17){return db['FaxAccount']['find']({'where':{'id':_0x478658[_0x3b54('0x5c')]['id']}})[_0x3b54('0x24')](handleEntityNotFound(_0x34b90a,null))[_0x3b54('0x24')](function(_0xcc680a){if(_0xcc680a){return _0xcc680a['removeAnswers'](_0x478658['query'][_0x3b54('0x74')]);}})[_0x3b54('0x24')](respondWithStatusCode(_0x34b90a,null))[_0x3b54('0x2e')](handleError(_0x34b90a,null));};exports[_0x3b54('0x78')]=function(_0x4c3737,_0x29043c,_0x432ce7){return db[_0x3b54('0x79')][_0x3b54('0x67')]({'where':{'id':_0x4c3737[_0x3b54('0x5c')]['id']}})['then'](handleEntityNotFound(_0x29043c,null))[_0x3b54('0x24')](function(_0x5dc56c){if(_0x5dc56c){return _0x5dc56c[_0x3b54('0x78')](_0x4c3737[_0x3b54('0x6a')][_0x3b54('0x74')],_[_0x3b54('0x7a')](_0x4c3737[_0x3b54('0x6a')],[_0x3b54('0x74'),'id'])||{});}})['then'](respondWithResult(_0x29043c,null))[_0x3b54('0x2e')](handleError(_0x29043c,null));};exports['getInteractions']=function(_0x503dfd,_0x191903,_0x13d61e){var _0x101f69={'raw':![],'where':{}};var _0x290ac1={};var _0x49fc27={'count':0x0,'rows':[]};return db[_0x3b54('0x46')][_0x3b54('0x6f')]({'where':{'id':_0x503dfd['params']['id']}})[_0x3b54('0x24')](handleEntityNotFound(_0x191903,null))[_0x3b54('0x24')](function(_0x215a68){if(_0x215a68){_0x290ac1['model']=_['keys'](db[_0x3b54('0x79')][_0x3b54('0x47')]);_0x290ac1[_0x3b54('0x4b')]=_[_0x3b54('0x5e')](_0x503dfd[_0x3b54('0x4b')]);_0x290ac1[_0x3b54('0x4c')]=_[_0x3b54('0x4d')](_0x290ac1[_0x3b54('0x5d')],_0x290ac1[_0x3b54('0x4b')]);_0x101f69[_0x3b54('0x4f')]=_[_0x3b54('0x4d')](_0x290ac1[_0x3b54('0x5d')],qs[_0x3b54('0x4e')](_0x503dfd[_0x3b54('0x4b')]['fields']));_0x101f69[_0x3b54('0x4f')]=_0x101f69['attributes'][_0x3b54('0x5f')]?_0x101f69[_0x3b54('0x4f')]:_0x290ac1[_0x3b54('0x5d')];if(!_0x503dfd[_0x3b54('0x4b')][_0x3b54('0x50')](_0x3b54('0x51'))){_0x101f69[_0x3b54('0x34')]=qs[_0x3b54('0x34')](_0x503dfd['query'][_0x3b54('0x34')]);_0x101f69[_0x3b54('0x31')]=qs[_0x3b54('0x31')](_0x503dfd['query'][_0x3b54('0x31')]);}_0x101f69[_0x3b54('0x70')]=qs['sort'](_0x503dfd[_0x3b54('0x4b')][_0x3b54('0x52')]);_0x101f69['where']=qs[_0x3b54('0x4c')](_[_0x3b54('0x54')](_0x503dfd[_0x3b54('0x4b')],_0x290ac1[_0x3b54('0x4c')]));_0x101f69[_0x3b54('0x53')][_0x3b54('0x71')]=_0x215a68['id'];if(_0x503dfd['query'][_0x3b54('0x58')]){_0x101f69[_0x3b54('0x53')]=_[_0x3b54('0x55')](_0x101f69[_0x3b54('0x53')],{'$or':_[_0x3b54('0x4a')](_0x101f69[_0x3b54('0x4f')],function(_0x2800a3){var _0x5b12d0={};_0x5b12d0[_0x2800a3]={'$like':'%'+_0x503dfd[_0x3b54('0x4b')]['filter']+'%'};return _0x5b12d0;})});}_0x101f69=_['merge']({},_0x101f69,_0x503dfd[_0x3b54('0x59')]);return db[_0x3b54('0x79')][_0x3b54('0x33')]({'where':_0x101f69[_0x3b54('0x53')]})[_0x3b54('0x24')](function(_0xcdab57){_0x49fc27[_0x3b54('0x33')]=_0xcdab57;if(_0x503dfd[_0x3b54('0x4b')][_0x3b54('0x60')]){_0x101f69[_0x3b54('0x5a')]=[{'model':db[_0x3b54('0x7b')],'as':_0x3b54('0x7c'),'required':![]},{'model':db[_0x3b54('0x7d')],'as':_0x3b54('0x7e'),'attributes':[_0x3b54('0x41'),'fullname',_0x3b54('0x7f')],'required':![]},{'model':db['Tag'],'as':_0x3b54('0x80'),'attributes':['id',_0x3b54('0x41'),_0x3b54('0x81')],'where':_0x503dfd['query'][_0x3b54('0x82')]?{'id':_0x503dfd[_0x3b54('0x4b')][_0x3b54('0x82')]}:undefined,'required':_0x503dfd[_0x3b54('0x4b')][_0x3b54('0x82')]?!![]:![]}];}return db[_0x3b54('0x79')][_0x3b54('0x5b')](_0x101f69);})[_0x3b54('0x24')](function(_0x20c2c0){_0x49fc27[_0x3b54('0x72')]=_0x20c2c0;return _0x49fc27;});}})[_0x3b54('0x24')](respondWithFilteredResult(_0x191903,_0x101f69))[_0x3b54('0x2e')](handleError(_0x191903,null));};exports['addApplications']=function(_0x20083c,_0x565fb9){var _0x4ad56a=_0x20083c[_0x3b54('0x5c')]['id'];var _0xeb775a=_0x20083c[_0x3b54('0x6a')];var _0x30a324=0xc8;var _0x226a47=null;return db[_0x3b54('0x83')]['transaction']({'isolationLevel':db['sequelize'][_0x3b54('0x84')][_0x3b54('0x85')]['READ_COMMITTED']},function(_0x44c5ec){return db[_0x3b54('0x46')][_0x3b54('0x6f')]({'where':{'id':_0x4ad56a},'transaction':_0x44c5ec})[_0x3b54('0x24')](function(_0x590b2c){if(_0x590b2c){return db[_0x3b54('0x86')][_0x3b54('0x3b')]({'where':{'FaxAccountId':_0x4ad56a},'transaction':_0x44c5ec})['then'](function(){var _0x124c05=_[_0x3b54('0x4a')](_0xeb775a,function(_0x405ce2){_0x405ce2[_0x3b54('0x71')]=_0x4ad56a;return _0x405ce2;});return db[_0x3b54('0x86')][_0x3b54('0x87')](_0x124c05,{'transaction':_0x44c5ec});});}else{_0x30a324=0x194;_0x226a47=[];}});})[_0x3b54('0x24')](function(){if(_0x30a324!==0x194){return db[_0x3b54('0x86')]['findAndCountAll']({'where':{'FaxAccountId':_0x4ad56a},'order':_0x3b54('0x88')})[_0x3b54('0x24')](function(_0x4e491e){_0x226a47=_0x4e491e;});}})['catch'](function(_0x19aef6){_0x30a324=0x1f4;logger['error'](_0x19aef6[_0x3b54('0x40')]);if(_0x19aef6[_0x3b54('0x41')]){delete _0x19aef6[_0x3b54('0x41')];}_0x226a47=_0x19aef6;})[_0x3b54('0x89')](function(){if(_0x226a47===null){_0x565fb9[_0x3b54('0x3f')](_0x30a324);}else{if(_0x30a324===0x1f4){_0x565fb9[_0x3b54('0x2f')](_0x30a324)[_0x3b54('0x42')](_0x226a47);}else{_0x565fb9['status'](_0x30a324)[_0x3b54('0x30')](_0x226a47);}}});};exports[_0x3b54('0x8a')]=function(_0x4f8d6b,_0x3a10bd,_0x5609be){var _0x586201={};var _0x4cd5a0={};var _0x1f8481;var _0x5c87d9;return db[_0x3b54('0x46')]['findOne']({'where':{'id':_0x4f8d6b['params']['id']}})[_0x3b54('0x24')](handleEntityNotFound(_0x3a10bd,null))[_0x3b54('0x24')](function(_0x3101f0){if(_0x3101f0){_0x1f8481=_0x3101f0;_0x4cd5a0['model']=_[_0x3b54('0x5e')](db[_0x3b54('0x86')]['rawAttributes']);_0x4cd5a0['query']=_[_0x3b54('0x5e')](_0x4f8d6b['query']);_0x4cd5a0['filters']=_['intersection'](_0x4cd5a0['model'],_0x4cd5a0[_0x3b54('0x4b')]);_0x586201[_0x3b54('0x4f')]=_['intersection'](_0x4cd5a0[_0x3b54('0x5d')],qs[_0x3b54('0x4e')](_0x4f8d6b[_0x3b54('0x4b')][_0x3b54('0x4e')]));_0x586201[_0x3b54('0x4f')]=_0x586201[_0x3b54('0x4f')][_0x3b54('0x5f')]?_0x586201[_0x3b54('0x4f')]:_0x4cd5a0[_0x3b54('0x5d')];_0x586201[_0x3b54('0x70')]=qs[_0x3b54('0x52')](_0x4f8d6b[_0x3b54('0x4b')]['sort']);_0x586201[_0x3b54('0x53')]=qs[_0x3b54('0x4c')](_[_0x3b54('0x54')](_0x4f8d6b[_0x3b54('0x4b')],_0x4cd5a0[_0x3b54('0x4c')]));if(_0x4f8d6b[_0x3b54('0x4b')][_0x3b54('0x58')]){_0x586201['where']=_[_0x3b54('0x55')](_0x586201[_0x3b54('0x53')],{'$or':_[_0x3b54('0x4a')](_0x586201['attributes'],function(_0x3d393c){var _0x606488={};_0x606488[_0x3d393c]={'$like':'%'+_0x4f8d6b[_0x3b54('0x4b')]['filter']+'%'};return _0x606488;})});}_0x586201=_[_0x3b54('0x55')]({},_0x586201,_0x4f8d6b[_0x3b54('0x59')]);return _0x1f8481[_0x3b54('0x8a')](_0x586201);}})[_0x3b54('0x24')](function(_0x1460bd){if(_0x1460bd){_0x5c87d9=_0x1460bd[_0x3b54('0x5f')];if(!_0x4f8d6b[_0x3b54('0x4b')][_0x3b54('0x50')](_0x3b54('0x51'))){_0x586201[_0x3b54('0x34')]=qs[_0x3b54('0x34')](_0x4f8d6b[_0x3b54('0x4b')]['limit']);_0x586201[_0x3b54('0x31')]=qs[_0x3b54('0x31')](_0x4f8d6b[_0x3b54('0x4b')][_0x3b54('0x31')]);}return _0x1f8481[_0x3b54('0x8a')](_0x586201);}})[_0x3b54('0x24')](function(_0x30c11a){if(_0x30c11a){return _0x30c11a?{'count':_0x5c87d9,'rows':_0x30c11a}:null;}})['then'](respondWithResult(_0x3a10bd,null))[_0x3b54('0x2e')](handleError(_0x3a10bd,null));};function Extension(_0x146895,_0x28a3f2,_0x33df3e,_0x4db6f4){this[_0x3b54('0x8b')]=_0x3b54('0x8c');this[_0x3b54('0x8d')]=_0x146895[_0x3b54('0x8e')];this['app']=_0x4db6f4;this[_0x3b54('0x56')]=_0x3b54('0x8f');this[_0x3b54('0x90')]='Fax\x20Extension';this[_0x3b54('0x71')]=_0x146895['id'];this['priority']=_0x28a3f2;this[_0x3b54('0x91')]=_0x33df3e;}function createExtensionsReciveFax(_0x5cb9e8){var _0x5ad7c4=0x1;var _0x1f1857=[];_0x1f1857[_0x3b54('0x92')](new Extension(_0x5cb9e8,_0x5ad7c4,'',_0x3b54('0x93')));_0x5ad7c4+=0x1;_0x1f1857['push'](new Extension(_0x5cb9e8,_0x5ad7c4,_0x3b54('0x94'),_0x3b54('0x95')));_0x5ad7c4+=0x1;for(var _0x27fbff in _0x5cb9e8){if(_0x5cb9e8[_0x3b54('0x50')](_0x27fbff)&&(_0x27fbff===_0x3b54('0x96')||_0x27fbff===_0x3b54('0x8e')||_0x27fbff===_0x3b54('0x97')||_0x27fbff==='faxdetect'||_0x27fbff===_0x3b54('0x98')||_0x27fbff===_0x3b54('0x99')||_0x27fbff==='minrate'||_0x27fbff===_0x3b54('0x9a')||_0x27fbff===_0x3b54('0x9b'))){_0x1f1857[_0x3b54('0x92')](new Extension(_0x5cb9e8,_0x5ad7c4,_0x3b54('0x9c')+_0x27fbff+')='+_0x5cb9e8[_0x27fbff],_0x3b54('0x95')));_0x5ad7c4+=0x1;}}_0x1f1857[_0x3b54('0x92')](new Extension(_0x5cb9e8,_0x5ad7c4,'6','Wait'));_0x5ad7c4+=0x1;_0x1f1857[_0x3b54('0x92')](new Extension(_0x5cb9e8,_0x5ad7c4,_0x3b54('0x9d'),'ReceiveFax'));_0x5ad7c4=0x0;return _0x1f1857;}exports[_0x3b54('0x9e')]=function(_0x215a49,_0x4b6a30,_0x10a4ca){var _0x37c8af;return db[_0x3b54('0x83')][_0x3b54('0x9f')](function(_0x24d9ae){return db['FaxAccount'][_0x3b54('0x61')](_0x215a49[_0x3b54('0x6a')],{'transaction':_0x24d9ae})['then'](function(_0x35af2f){_0x37c8af=_0x35af2f['get']({'plain':!![]});return db['VoiceExtension'][_0x3b54('0x87')](createExtensionsReciveFax(_0x37c8af),{'transaction':_0x24d9ae});});})[_0x3b54('0x24')](function(){return _0x37c8af;})[_0x3b54('0x24')](respondWithResult(_0x4b6a30,null))[_0x3b54('0x2e')](handleError(_0x4b6a30,null));};exports['updateAccountApplications']=function(_0x2eeb5b,_0x577325,_0x1d4c7b){var _0x3ec52e;return db[_0x3b54('0x83')][_0x3b54('0x9f')](function(_0x183cd4){return db[_0x3b54('0x46')][_0x3b54('0x3a')](_0x2eeb5b[_0x3b54('0x6a')],{'where':{'id':_0x2eeb5b[_0x3b54('0x6a')]['id']},'transaction':_0x183cd4})[_0x3b54('0x24')](function(_0x2dfbfd){return db[_0x3b54('0xa0')]['destroy']({'where':{'FaxAccountId':_0x2eeb5b[_0x3b54('0x6a')]['id']},'transaction':_0x183cd4})[_0x3b54('0x24')](function(_0x579df7){return db['VoiceExtension'][_0x3b54('0x87')](createExtensionsReciveFax(_[_0x3b54('0x7a')](_0x2eeb5b['body'],['tech',_0x3b54('0x49'),_0x3b54('0xa1'),_0x3b54('0xa2'),_0x3b54('0xa3'),'ListId'])),{'transaction':_0x183cd4});});});})[_0x3b54('0x24')](function(){return db[_0x3b54('0x46')]['findById'](_0x2eeb5b['body']['id']);})[_0x3b54('0x24')](respondWithResult(_0x577325,null))[_0x3b54('0x2e')](handleError(_0x577325,null));};exports['getMessages']=function(_0x2c7fa6,_0x2f6611,_0x3a8ce9){var _0x19569f={'raw':!![],'where':{}};var _0x574629={};var _0x2bb915={'count':0x0,'rows':[]};return db[_0x3b54('0x46')]['findOne']({'where':{'id':_0x2c7fa6[_0x3b54('0x5c')]['id']}})[_0x3b54('0x24')](handleEntityNotFound(_0x2f6611,null))[_0x3b54('0x24')](function(_0x5464af){if(_0x5464af){_0x574629[_0x3b54('0x5d')]=_[_0x3b54('0x5e')](db['FaxMessage'][_0x3b54('0x47')]);_0x574629[_0x3b54('0x4b')]=_[_0x3b54('0x5e')](_0x2c7fa6[_0x3b54('0x4b')]);_0x574629[_0x3b54('0x4c')]=_['intersection'](_0x574629[_0x3b54('0x5d')],_0x574629[_0x3b54('0x4b')]);_0x19569f[_0x3b54('0x4f')]=_[_0x3b54('0x4d')](_0x574629[_0x3b54('0x5d')],qs[_0x3b54('0x4e')](_0x2c7fa6[_0x3b54('0x4b')][_0x3b54('0x4e')]));_0x19569f['attributes']=_0x19569f['attributes'][_0x3b54('0x5f')]?_0x19569f[_0x3b54('0x4f')]:_0x574629['model'];if(!_0x2c7fa6[_0x3b54('0x4b')][_0x3b54('0x50')](_0x3b54('0x51'))){_0x19569f[_0x3b54('0x34')]=qs[_0x3b54('0x34')](_0x2c7fa6[_0x3b54('0x4b')]['limit']);_0x19569f[_0x3b54('0x31')]=qs[_0x3b54('0x31')](_0x2c7fa6[_0x3b54('0x4b')][_0x3b54('0x31')]);}_0x19569f['order']=qs['sort'](_0x2c7fa6[_0x3b54('0x4b')]['sort']);_0x19569f[_0x3b54('0x53')]=qs[_0x3b54('0x4c')](_[_0x3b54('0x54')](_0x2c7fa6['query'],_0x574629[_0x3b54('0x4c')]));_0x19569f[_0x3b54('0x53')][_0x3b54('0x71')]=_0x5464af['id'];if(_0x2c7fa6[_0x3b54('0x4b')]['filter']){_0x19569f[_0x3b54('0x53')]=_[_0x3b54('0x55')](_0x19569f[_0x3b54('0x53')],{'$or':_[_0x3b54('0x4a')](_0x19569f[_0x3b54('0x4f')],function(_0x4da7a7){var _0x172026={};_0x172026[_0x4da7a7]={'$like':'%'+_0x2c7fa6[_0x3b54('0x4b')]['filter']+'%'};return _0x172026;})});}if(_0x2c7fa6['query'][_0x3b54('0xa4')]){var _0x263a56=_0x2c7fa6['query']['$gte'][_0x3b54('0xa5')](',');var _0x4b26b5={};_0x4b26b5[_0x263a56[0x0]]={'$gte':moment(_0x263a56[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x19569f[_0x3b54('0x53')]=_[_0x3b54('0x55')](_0x19569f[_0x3b54('0x53')],_0x4b26b5);}_0x19569f=_[_0x3b54('0x55')]({},_0x19569f,_0x2c7fa6[_0x3b54('0x59')]);return db[_0x3b54('0xa6')][_0x3b54('0x33')]({'where':_0x19569f[_0x3b54('0x53')]})['then'](function(_0x361ff6){_0x2bb915[_0x3b54('0x33')]=_0x361ff6;if(_0x2c7fa6['query']['includeAll']){_0x19569f[_0x3b54('0x5a')]=[{'all':!![]}];}return db[_0x3b54('0xa6')][_0x3b54('0x5b')](_0x19569f);})['then'](function(_0x10cc82){_0x2bb915['rows']=_0x10cc82;return _0x2bb915;});}})['then'](respondWithFilteredResult(_0x2f6611,_0x19569f))[_0x3b54('0x2e')](handleError(_0x2f6611,null));};exports[_0x3b54('0x42')]=function(_0x524c01,_0xbe76b1,_0x3c5380){var _0xa0f92a,_0x3e8d69={},_0x53c3d1;if(_0x524c01['body']['to']){_0x53c3d1=_0x524c01['body']['to'][0x0];}return db[_0x3b54('0x46')][_0x3b54('0x67')]({'where':{'id':_0x524c01[_0x3b54('0x5c')]['id']},'include':[{'model':db[_0x3b54('0xa7')],'as':'List','include':[{'model':db[_0x3b54('0x7b')],'as':_0x3b54('0xa8'),'where':{'fax':_0x53c3d1},'limit':0x1,'order':[['updatedAt',_0x3b54('0xa9')]]}]}]})['then'](handleEntityNotFound(_0xbe76b1,null))[_0x3b54('0x24')](function(_0x2823a5){_0xa0f92a=_0x2823a5;if(_0x524c01[_0x3b54('0x6a')][_0x3b54('0xaa')]&&_0x524c01[_0x3b54('0x6a')][_0x3b54('0xaa')]['length']){for(var _0x121b4e=0x0;_0x121b4e<_0x524c01[_0x3b54('0x6a')][_0x3b54('0xaa')][_0x3b54('0x5f')];_0x121b4e+=0x1){_0x524c01['body'][_0x3b54('0xaa')][_0x121b4e]={'filename':_0x524c01[_0x3b54('0x6a')]['attachments'][_0x121b4e][_0x3b54('0x41')],'id':_0x524c01[_0x3b54('0x6a')][_0x3b54('0xaa')][_0x121b4e]['id'],'path':path[_0x3b54('0xab')](config[_0x3b54('0xac')],_0x3b54('0xad'),_0x524c01[_0x3b54('0x6a')][_0x3b54('0xaa')][_0x121b4e][_0x3b54('0xae')])};}}return respondWithRpcPromise(_0x3b54('0xaf'),'CheckAfterSend',{'FaxAccountId':_[_0x3b54('0xb0')](_0x524c01[_0x3b54('0x5c')]['id'])?undefined:_0x524c01[_0x3b54('0x5c')]['id'],'path':_[_0x3b54('0xb0')](_0x524c01[_0x3b54('0x6a')][_0x3b54('0xaa')][0x0][_0x3b54('0x8')])?undefined:_0x524c01['body'][_0x3b54('0xaa')][0x0][_0x3b54('0x8')],'fax':_[_0x3b54('0xb0')](_0x524c01[_0x3b54('0x6a')]['to'][0x0])?undefined:_0x524c01[_0x3b54('0x6a')]['to'][0x0]},client9002);})[_0x3b54('0x24')](function(){if(_0xa0f92a){if(_[_0x3b54('0xb0')](_0x524c01[_0x3b54('0x6a')][_0x3b54('0xb1')])){_0x524c01[_0x3b54('0x6a')][_0x3b54('0xb1')]=util['format'](_0x3b54('0xb2'),_0xa0f92a[_0x3b54('0x41')],_0xa0f92a[_0x3b54('0xb3')]);}if(_0xa0f92a[_0x3b54('0xb4')]){if(_0xa0f92a[_0x3b54('0xb4')]['Contacts'][_0x3b54('0x5f')]){return _0xa0f92a[_0x3b54('0xb4')][_0x3b54('0xa8')][0x0];}else{return db['CmContact']['create'](_['defaults'](_0x524c01[_0x3b54('0x6a')],{'firstName':_0x524c01[_0x3b54('0x6a')]['to'][0x0],'phone':_0x524c01[_0x3b54('0x6a')]['to'][0x0],'fax':_0x524c01['body']['to'][0x0],'ListId':_0xa0f92a[_0x3b54('0xb5')]}));}}else{throw new Error(_0x3b54('0xb6'));}}else{throw new Error(_0x3b54('0xb7'));}})[_0x3b54('0x24')](function(_0x2fa650){if(_0x2fa650){return db[_0x3b54('0x79')][_0x3b54('0x67')]({'where':{'ContactId':_0x2fa650['id'],'closed':![],'FaxAccountId':_0xa0f92a['id']}})[_0x3b54('0x24')](function(_0x23a1b2){if(_0x23a1b2){return[_0x23a1b2,![]];}return db[_0x3b54('0x79')][_0x3b54('0x61')]({'UserId':_0x524c01['user']['id'],'ContactId':_0x2fa650['id'],'FaxAccountId':_0xa0f92a['id'],'fax':_0x524c01['body']['to'][0x0],'firstMsgDirection':_0x3b54('0xb8'),'Messages':[_[_0x3b54('0x55')](_0x524c01[_0x3b54('0x6a')],{'read':![],'body':_0x524c01[_0x3b54('0x6a')][_0x3b54('0xaa')][0x0][_0x3b54('0xb9')],'FaxAccountId':_0xa0f92a['id'],'UserId':_0x524c01[_0x3b54('0x62')]['id'],'ContactId':_0x2fa650['id'],'AttachmentId':_0x524c01[_0x3b54('0x6a')][_0x3b54('0xaa')][0x0]['id']})]},{'include':[{'model':db[_0x3b54('0xa6')],'as':_0x3b54('0xba')}]})[_0x3b54('0x24')](function(_0x4f113e){return[_0x4f113e,!![]];});});}else{throw new Error(_0x3b54('0xbb'));}})[_0x3b54('0xbc')](function(_0x2d152f,_0x235a7a){if(_0x235a7a){return _0x2d152f;}return db[_0x3b54('0xa6')][_0x3b54('0x61')]({'direction':_0x3b54('0xb8'),'read':![],'body':_0x524c01[_0x3b54('0x6a')][_0x3b54('0xaa')][0x0]['filename'],'FaxAccountId':_0xa0f92a['id'],'FaxInteractionId':_0x2d152f['id'],'UserId':_0x524c01['user']['id'],'ContactId':_0x2d152f[_0x3b54('0xbd')],'AttachmentId':_0x524c01[_0x3b54('0x6a')]['attachments'][0x0]['id']})[_0x3b54('0x24')](function(_0x2cd360){_0x2d152f['dataValues'][_0x3b54('0xba')]=[];_0x2d152f[_0x3b54('0xbe')][_0x3b54('0xba')][_0x3b54('0x92')](_0x2cd360[_0x3b54('0xbe')]);return _0x2d152f;});})['then'](function(_0x2b744e){respondWithRpcPromise(_0x3b54('0xbf'),_0x3b54('0xbf'),{'FaxAccountId':_['isNil'](_0x524c01[_0x3b54('0x5c')]['id'])?undefined:_0x524c01[_0x3b54('0x5c')]['id'],'path':_[_0x3b54('0xb0')](_0x524c01[_0x3b54('0x6a')][_0x3b54('0xaa')][0x0][_0x3b54('0x8')])?undefined:_0x524c01['body'][_0x3b54('0xaa')][0x0][_0x3b54('0x8')],'fax':_[_0x3b54('0xb0')](_0x524c01[_0x3b54('0x6a')]['to'][0x0])?undefined:_0x524c01[_0x3b54('0x6a')]['to'][0x0],'AttachmentId':_0x524c01['body'][_0x3b54('0xaa')][0x0]['id']},client9002)[_0x3b54('0x24')](function(_0x54a216){logger['info'](_0x3b54('0xc0'),_0x54a216);})[_0x3b54('0x2e')](function(_0x167971){logger[_0x3b54('0x25')](_0x3b54('0xc0'),_0x167971);});return _0x2b744e;})[_0x3b54('0x24')](respondWithResult(_0xbe76b1,null))[_0x3b54('0x2e')](handleError(_0xbe76b1,null));};exports[_0x3b54('0xc1')]=function(_0x53e330,_0x1d8237,_0x5a291f){return db[_0x3b54('0x46')]['find']({'where':{'id':_0x53e330[_0x3b54('0x5c')]['id']}})[_0x3b54('0x24')](handleEntityNotFound(_0x1d8237,null))[_0x3b54('0x24')](function(_0x47bf5a){if(_0x47bf5a){return _0x47bf5a[_0x3b54('0xc1')](_0x53e330['body'][_0x3b54('0x74')],_[_0x3b54('0x7a')](_0x53e330[_0x3b54('0x6a')],[_0x3b54('0x74'),'id'])||{})[_0x3b54('0xbc')](function(_0x56955f){for(var _0x427698=0x0;_0x427698<_0x53e330[_0x3b54('0x6a')][_0x3b54('0x74')][_0x3b54('0x5f')];_0x427698+=0x1){socket[_0x3b54('0xc2')](_0x3b54('0xc3'),{'UserId':Number(_0x53e330['body'][_0x3b54('0x74')][_0x427698]),'FaxAccountId':Number(_0x53e330['params']['id'])});}return _0x56955f;});}})['then'](respondWithResult(_0x1d8237,null))[_0x3b54('0x2e')](handleError(_0x1d8237,null));};exports[_0x3b54('0xc4')]=function(_0x5f2c5a,_0x4060d6,_0x28b8f2){return db['FaxAccount']['find']({'where':{'id':_0x5f2c5a[_0x3b54('0x5c')]['id']}})[_0x3b54('0x24')](handleEntityNotFound(_0x4060d6,null))[_0x3b54('0x24')](function(_0x1a88c0){if(_0x1a88c0){return _0x1a88c0[_0x3b54('0xc4')](_0x5f2c5a[_0x3b54('0x4b')][_0x3b54('0x74')])[_0x3b54('0x24')](function(){if(_['isArray'](_0x5f2c5a['query']['ids'])){for(var _0x4d4860=0x0;_0x4d4860<_0x5f2c5a[_0x3b54('0x4b')][_0x3b54('0x74')][_0x3b54('0x5f')];_0x4d4860+=0x1){socket[_0x3b54('0xc2')]('userFaxAccount:remove',{'UserId':Number(_0x5f2c5a[_0x3b54('0x4b')][_0x3b54('0x74')][_0x4d4860]),'FaxAccountId':Number(_0x5f2c5a[_0x3b54('0x5c')]['id'])});}}else{socket[_0x3b54('0xc2')]('userFaxAccount:remove',{'UserId':Number(_0x5f2c5a[_0x3b54('0x4b')]['ids']),'FaxAccountId':Number(_0x5f2c5a['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4060d6,null))[_0x3b54('0x2e')](handleError(_0x4060d6,null));};exports[_0x3b54('0xc5')]=function(_0x545296,_0x494290,_0x340f84){var _0x15921f={};var _0x385954={};var _0x53c430;var _0x4fd98b;return db[_0x3b54('0x46')][_0x3b54('0x6f')]({'where':{'id':_0x545296[_0x3b54('0x5c')]['id']}})[_0x3b54('0x24')](handleEntityNotFound(_0x494290,null))[_0x3b54('0x24')](function(_0x4be5cd){if(_0x4be5cd){_0x53c430=_0x4be5cd;_0x385954['model']=_[_0x3b54('0x5e')](db[_0x3b54('0x7d')][_0x3b54('0x47')]);_0x385954['query']=_['keys'](_0x545296[_0x3b54('0x4b')]);_0x385954['filters']=_[_0x3b54('0x4d')](_0x385954[_0x3b54('0x5d')],_0x385954['query']);_0x15921f[_0x3b54('0x4f')]=_[_0x3b54('0x4d')](_0x385954[_0x3b54('0x5d')],qs[_0x3b54('0x4e')](_0x545296[_0x3b54('0x4b')][_0x3b54('0x4e')]));_0x15921f[_0x3b54('0x4f')]=_0x15921f[_0x3b54('0x4f')][_0x3b54('0x5f')]?_0x15921f[_0x3b54('0x4f')]:_0x385954[_0x3b54('0x5d')];_0x15921f[_0x3b54('0x70')]=qs['sort'](_0x545296[_0x3b54('0x4b')][_0x3b54('0x52')]);_0x15921f[_0x3b54('0x53')]=qs[_0x3b54('0x4c')](_['pick'](_0x545296[_0x3b54('0x4b')],_0x385954[_0x3b54('0x4c')]));if(_0x545296[_0x3b54('0x4b')][_0x3b54('0x58')]){_0x15921f[_0x3b54('0x53')]=_[_0x3b54('0x55')](_0x15921f['where'],{'$or':_[_0x3b54('0x4a')](_0x15921f['attributes'],function(_0x1070ad){var _0x37e59f={};_0x37e59f[_0x1070ad]={'$like':'%'+_0x545296[_0x3b54('0x4b')]['filter']+'%'};return _0x37e59f;})});}_0x15921f=_['merge']({},_0x15921f,_0x545296[_0x3b54('0x59')]);return _0x53c430[_0x3b54('0xc5')](_0x15921f);}})[_0x3b54('0x24')](function(_0x29d148){if(_0x29d148){_0x4fd98b=_0x29d148[_0x3b54('0x5f')];if(!_0x545296['query'][_0x3b54('0x50')]('nolimit')){_0x15921f[_0x3b54('0x34')]=qs['limit'](_0x545296['query'][_0x3b54('0x34')]);_0x15921f[_0x3b54('0x31')]=qs['offset'](_0x545296[_0x3b54('0x4b')]['offset']);}return _0x53c430['getAgents'](_0x15921f);}})[_0x3b54('0x24')](function(_0x3722ce){if(_0x3722ce){return _0x3722ce?{'count':_0x4fd98b,'rows':_0x3722ce}:null;}})[_0x3b54('0x24')](respondWithResult(_0x494290,null))['catch'](handleError(_0x494290,null));}; \ No newline at end of file +var _0xc338=['end','json','offset','undefined','limit','count','set','save','update','get','FaxAccounts','UserProfileResource','destroy','stack','name','send','mandatoryDispositionPause','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','type','options','FaxAccount','include','findAll','show','params','Pause','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','findOne','Disposition','nolimit','pick','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','finally','getApplications','context','exten','system','Fax\x20Extension','priority','appdata','push','CDR(type)=inbound-fax','Set','gateway','faxdetect','headerinfo','maxrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','transaction','updateAccountApplications','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','CmContact','attachments','server/files/attachments','basename','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','fax','List','Contacts','List\x20not\x20found','filename','Messages','Contact\x20not\x20found','spread','out','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','defaults','localhost','socket.io-emitter','redis','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxAccount,\x20%s,\x20%s','catch','sendStatus','status'];(function(_0x5b7f95,_0x3b90ae){var _0x4c7d80=function(_0x261c33){while(--_0x261c33){_0x5b7f95['push'](_0x5b7f95['shift']());}};_0x4c7d80(++_0x3b90ae);}(_0xc338,0x15a));var _0x8c33=function(_0x13b5d5,_0x18570e){_0x13b5d5=_0x13b5d5-0x0;var _0x51e969=_0xc338[_0x13b5d5];return _0x51e969;};'use strict';var emlformat=require(_0x8c33('0x0'));var rimraf=require(_0x8c33('0x1'));var zipdir=require(_0x8c33('0x2'));var jsonpatch=require(_0x8c33('0x3'));var rp=require(_0x8c33('0x4'));var moment=require(_0x8c33('0x5'));var BPromise=require(_0x8c33('0x6'));var Mustache=require(_0x8c33('0x7'));var util=require('util');var path=require(_0x8c33('0x8'));var sox=require('sox');var csv=require(_0x8c33('0x9'));var ejs=require(_0x8c33('0xa'));var fs=require('fs');var fs_extra=require(_0x8c33('0xb'));var _=require('lodash');var squel=require(_0x8c33('0xc'));var crypto=require('crypto');var jsforce=require(_0x8c33('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8c33('0x9'));var querystring=require(_0x8c33('0xe'));var Papa=require(_0x8c33('0xf'));var Redis=require(_0x8c33('0x10'));var authService=require(_0x8c33('0x11'));var qs=require(_0x8c33('0x12'));var as=require(_0x8c33('0x13'));var hardwareService=require(_0x8c33('0x14'));var logger=require(_0x8c33('0x15'))(_0x8c33('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8c33('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x8c33('0x18')](config['redis'],{'host':_0x8c33('0x19'),'port':0x18eb});var socket=require(_0x8c33('0x1a'))(new Redis(config[_0x8c33('0x1b')]));require('./faxAccount.socket')[_0x8c33('0x1c')](socket);var jayson=require(_0x8c33('0x1d'));var client=jayson[_0x8c33('0x1e')][_0x8c33('0x1f')]({'port':0x232c});var client9002=jayson[_0x8c33('0x1e')][_0x8c33('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x29a0e8,_0x40545e,_0x2412af,_0x495cf4){return new BPromise(function(_0x1e782d,_0xdc867c){var _0x563377=_0x495cf4||client;return _0x563377[_0x8c33('0x20')](_0x29a0e8,_0x2412af)[_0x8c33('0x21')](function(_0x45da17){logger[_0x8c33('0x22')]('FaxAccount,\x20%s,\x20%s',_0x40545e,_0x8c33('0x23'));logger[_0x8c33('0x24')](_0x8c33('0x25'),_0x40545e,_0x8c33('0x23'),JSON[_0x8c33('0x26')](_0x45da17));if(_0x45da17['error']){if(_0x45da17[_0x8c33('0x27')][_0x8c33('0x28')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x40545e,_0x45da17[_0x8c33('0x27')]['message']);return _0xdc867c(_0x45da17[_0x8c33('0x27')][_0x8c33('0x29')]);}logger['error'](_0x8c33('0x2a'),_0x40545e,_0x45da17[_0x8c33('0x27')][_0x8c33('0x29')]);return _0x1e782d(_0x45da17[_0x8c33('0x27')][_0x8c33('0x29')]);}else{logger[_0x8c33('0x22')](_0x8c33('0x2a'),_0x40545e,_0x8c33('0x23'));_0x1e782d(_0x45da17['result'][_0x8c33('0x29')]);}})[_0x8c33('0x2b')](function(_0x338c25){logger[_0x8c33('0x27')](_0x8c33('0x2a'),_0x40545e,_0x338c25);_0xdc867c(_0x338c25);});});}function respondWithStatusCode(_0x3529e4,_0x2c817b){_0x2c817b=_0x2c817b||0xcc;return function(_0x5e07fb){if(_0x5e07fb){return _0x3529e4[_0x8c33('0x2c')](_0x2c817b);}return _0x3529e4[_0x8c33('0x2d')](_0x2c817b)[_0x8c33('0x2e')]();};}function respondWithResult(_0x176978,_0x3d6d26){_0x3d6d26=_0x3d6d26||0xc8;return function(_0x2534dc){if(_0x2534dc){return _0x176978[_0x8c33('0x2d')](_0x3d6d26)[_0x8c33('0x2f')](_0x2534dc);}};}function respondWithFilteredResult(_0x396c97,_0x4964a9){return function(_0x560da7){if(_0x560da7){var _0x2aa073=typeof _0x4964a9[_0x8c33('0x30')]===_0x8c33('0x31')&&typeof _0x4964a9[_0x8c33('0x32')]===_0x8c33('0x31');var _0x527677=_0x560da7[_0x8c33('0x33')];var _0x193132=_0x2aa073?0x0:_0x4964a9[_0x8c33('0x30')];var _0x2be2a8=_0x2aa073?_0x560da7[_0x8c33('0x33')]:_0x4964a9[_0x8c33('0x30')]+_0x4964a9[_0x8c33('0x32')];var _0x1757e2;if(_0x2be2a8>=_0x527677){_0x2be2a8=_0x527677;_0x1757e2=0xc8;}else{_0x1757e2=0xce;}_0x396c97[_0x8c33('0x2d')](_0x1757e2);return _0x396c97[_0x8c33('0x34')]('Content-Range',_0x193132+'-'+_0x2be2a8+'/'+_0x527677)[_0x8c33('0x2f')](_0x560da7);}return null;};}function patchUpdates(_0x427b95){return function(_0x3f8b54){try{jsonpatch['apply'](_0x3f8b54,_0x427b95,!![]);}catch(_0x2eb7e7){return BPromise['reject'](_0x2eb7e7);}return _0x3f8b54[_0x8c33('0x35')]();};}function saveUpdates(_0x12aa0c,_0x562beb){return function(_0x39c138){if(_0x39c138){return _0x39c138[_0x8c33('0x36')](_0x12aa0c)['then'](function(_0xfa6faf){return _0xfa6faf;});}return null;};}function removeEntity(_0x17e801,_0x261c00){return function(_0x13ba3e){if(_0x13ba3e){return _0x13ba3e['destroy']()[_0x8c33('0x21')](function(){var _0x20a1be=_0x13ba3e[_0x8c33('0x37')]({'plain':!![]});var _0xdee9c3=_0x8c33('0x38');return db[_0x8c33('0x39')][_0x8c33('0x3a')]({'where':{'type':_0xdee9c3,'resourceId':_0x20a1be['id']}})[_0x8c33('0x21')](function(){return _0x13ba3e;});})[_0x8c33('0x21')](function(){_0x17e801['status'](0xcc)[_0x8c33('0x2e')]();});}};}function handleEntityNotFound(_0x2fa06d,_0x3d4d15){return function(_0x18ba58){if(!_0x18ba58){_0x2fa06d[_0x8c33('0x2c')](0x194);}return _0x18ba58;};}function handleError(_0x404be4,_0x196ab6){_0x196ab6=_0x196ab6||0x1f4;return function(_0x402a32){logger[_0x8c33('0x27')](_0x402a32[_0x8c33('0x3b')]);if(_0x402a32[_0x8c33('0x3c')]){delete _0x402a32['name'];}_0x404be4[_0x8c33('0x2d')](_0x196ab6)[_0x8c33('0x3d')](_0x402a32);};}exports['index']=function(_0x1caf32,_0x118598){var _0x27e9b8={'include':[{'model':db['Pause'],'as':_0x8c33('0x3e')}]},_0x394554={},_0x24fc52={'count':0x0,'rows':[]};var _0x5532f5=_[_0x8c33('0x3f')](db['FaxAccount'][_0x8c33('0x40')],function(_0x2138c3){return{'name':_0x2138c3[_0x8c33('0x41')],'type':_0x2138c3['type'][_0x8c33('0x42')]};});_0x394554[_0x8c33('0x43')]=_[_0x8c33('0x3f')](_0x5532f5,_0x8c33('0x3c'));_0x394554[_0x8c33('0x44')]=_[_0x8c33('0x45')](_0x1caf32[_0x8c33('0x44')]);_0x394554['filters']=_[_0x8c33('0x46')](_0x394554[_0x8c33('0x43')],_0x394554[_0x8c33('0x44')]);_0x27e9b8[_0x8c33('0x47')]=_['intersection'](_0x394554[_0x8c33('0x43')],qs[_0x8c33('0x48')](_0x1caf32[_0x8c33('0x44')]['fields']));_0x27e9b8[_0x8c33('0x47')]=_0x27e9b8[_0x8c33('0x47')][_0x8c33('0x49')]?_0x27e9b8[_0x8c33('0x47')]:_0x394554[_0x8c33('0x43')];if(!_0x1caf32[_0x8c33('0x44')][_0x8c33('0x4a')]('nolimit')){_0x27e9b8['limit']=qs[_0x8c33('0x32')](_0x1caf32['query']['limit']);_0x27e9b8[_0x8c33('0x30')]=qs['offset'](_0x1caf32[_0x8c33('0x44')][_0x8c33('0x30')]);}_0x27e9b8[_0x8c33('0x4b')]=qs[_0x8c33('0x4c')](_0x1caf32['query'][_0x8c33('0x4c')]);_0x27e9b8[_0x8c33('0x4d')]=qs[_0x8c33('0x4e')](_['pick'](_0x1caf32[_0x8c33('0x44')],_0x394554['filters']),_0x5532f5);if(_0x1caf32[_0x8c33('0x44')][_0x8c33('0x4f')]){_0x27e9b8['where']=_[_0x8c33('0x50')](_0x27e9b8['where'],{'$or':_['map'](_0x5532f5,function(_0x42bc61){if(_0x42bc61[_0x8c33('0x51')]!=='VIRTUAL'){var _0x4a66cf={};_0x4a66cf[_0x42bc61[_0x8c33('0x3c')]]={'$like':'%'+_0x1caf32[_0x8c33('0x44')][_0x8c33('0x4f')]+'%'};return _0x4a66cf;}})});}_0x27e9b8=_[_0x8c33('0x50')]({},_0x27e9b8,_0x1caf32[_0x8c33('0x52')]);var _0x57f6a8={'where':_0x27e9b8[_0x8c33('0x4d')]};return db[_0x8c33('0x53')][_0x8c33('0x33')](_0x57f6a8)['then'](function(_0x5574ab){_0x24fc52[_0x8c33('0x33')]=_0x5574ab;if(_0x1caf32[_0x8c33('0x44')]['includeAll']){_0x27e9b8[_0x8c33('0x54')]=[{'all':!![]}];}return db[_0x8c33('0x53')][_0x8c33('0x55')](_0x27e9b8);})[_0x8c33('0x21')](function(_0x1ec422){_0x24fc52['rows']=_0x1ec422;return _0x24fc52;})[_0x8c33('0x21')](respondWithFilteredResult(_0x118598,_0x27e9b8))[_0x8c33('0x2b')](handleError(_0x118598,null));};exports[_0x8c33('0x56')]=function(_0x3b7cd8,_0x3f8c83){var _0x2ba4be={'raw':![],'where':{'id':_0x3b7cd8[_0x8c33('0x57')]['id']},'include':[{'model':db[_0x8c33('0x58')],'as':_0x8c33('0x3e')}]},_0x5d2936={};_0x5d2936[_0x8c33('0x43')]=_['keys'](db['FaxAccount'][_0x8c33('0x40')]);_0x5d2936[_0x8c33('0x44')]=_['keys'](_0x3b7cd8[_0x8c33('0x44')]);_0x5d2936['filters']=_[_0x8c33('0x46')](_0x5d2936['model'],_0x5d2936[_0x8c33('0x44')]);_0x2ba4be['attributes']=_[_0x8c33('0x46')](_0x5d2936[_0x8c33('0x43')],qs[_0x8c33('0x48')](_0x3b7cd8[_0x8c33('0x44')]['fields']));_0x2ba4be['attributes']=_0x2ba4be[_0x8c33('0x47')][_0x8c33('0x49')]?_0x2ba4be[_0x8c33('0x47')]:_0x5d2936[_0x8c33('0x43')];if(_0x3b7cd8[_0x8c33('0x44')][_0x8c33('0x59')]){_0x2ba4be[_0x8c33('0x54')]=[{'all':!![]}];}_0x2ba4be=_[_0x8c33('0x50')]({},_0x2ba4be,_0x3b7cd8['options']);return db[_0x8c33('0x53')][_0x8c33('0x5a')](_0x2ba4be)[_0x8c33('0x21')](handleEntityNotFound(_0x3f8c83,null))['then'](respondWithResult(_0x3f8c83,null))[_0x8c33('0x2b')](handleError(_0x3f8c83,null));};exports['create']=function(_0x186647,_0x4955e4){return db[_0x8c33('0x53')][_0x8c33('0x5b')](_0x186647[_0x8c33('0x5c')],{})[_0x8c33('0x21')](function(_0x11639c){var _0xf85637=_0x186647[_0x8c33('0x5d')][_0x8c33('0x37')]({'plain':!![]});if(!_0xf85637)throw new Error(_0x8c33('0x5e'));if(_0xf85637[_0x8c33('0x5f')]===_0x8c33('0x5d')){var _0x4cbab9=_0x11639c['get']({'plain':!![]});var _0x17506d=_0x8c33('0x38');return db['UserProfileSection']['find']({'where':{'name':_0x17506d,'userProfileId':_0xf85637[_0x8c33('0x60')]},'raw':!![]})['then'](function(_0x346e3a){if(_0x346e3a&&_0x346e3a[_0x8c33('0x61')]===0x0){return db[_0x8c33('0x39')][_0x8c33('0x5b')]({'name':_0x4cbab9[_0x8c33('0x3c')],'resourceId':_0x4cbab9['id'],'type':_0x346e3a[_0x8c33('0x3c')],'sectionId':_0x346e3a['id']},{})['then'](function(){return _0x11639c;});}else{return _0x11639c;}})[_0x8c33('0x2b')](function(_0x2dae61){logger[_0x8c33('0x27')](_0x8c33('0x62'),_0x2dae61);throw _0x2dae61;});}return _0x11639c;})[_0x8c33('0x21')](respondWithResult(_0x4955e4,0xc9))[_0x8c33('0x2b')](handleError(_0x4955e4,null));};exports[_0x8c33('0x36')]=function(_0x209b52,_0x26cda4){if(_0x209b52[_0x8c33('0x5c')]['id']){delete _0x209b52['body']['id'];}return db[_0x8c33('0x53')]['find']({'where':{'id':_0x209b52[_0x8c33('0x57')]['id']},'include':[{'model':db[_0x8c33('0x58')],'as':_0x8c33('0x3e')}]})['then'](handleEntityNotFound(_0x26cda4,null))[_0x8c33('0x21')](saveUpdates(_0x209b52[_0x8c33('0x5c')],null))[_0x8c33('0x21')](respondWithResult(_0x26cda4,null))[_0x8c33('0x2b')](handleError(_0x26cda4,null));};exports[_0x8c33('0x3a')]=function(_0x27275f,_0x1bc345){return db['FaxAccount'][_0x8c33('0x5a')]({'where':{'id':_0x27275f['params']['id']}})[_0x8c33('0x21')](handleEntityNotFound(_0x1bc345,null))[_0x8c33('0x21')](removeEntity(_0x1bc345,null))[_0x8c33('0x2b')](handleError(_0x1bc345,null));};exports[_0x8c33('0x63')]=function(_0x20c84e,_0x5250a1){return db['FaxAccount']['describe']()[_0x8c33('0x21')](respondWithResult(_0x5250a1,null))[_0x8c33('0x2b')](handleError(_0x5250a1,null));};exports[_0x8c33('0x64')]=function(_0x2a3fa4,_0x1366d6,_0x156087){if(_0x2a3fa4['body']['id']){delete _0x2a3fa4['body']['id'];}return db[_0x8c33('0x53')][_0x8c33('0x5a')]({'where':{'id':_0x2a3fa4[_0x8c33('0x57')]['id']}})[_0x8c33('0x21')](handleEntityNotFound(_0x1366d6,null))[_0x8c33('0x21')](function(_0x5797de){if(_0x5797de){_0x2a3fa4['body'][_0x8c33('0x65')]=_0x5797de['id'];return db['Disposition'][_0x8c33('0x5b')](_0x2a3fa4['body']);}})[_0x8c33('0x21')](respondWithResult(_0x1366d6,null))['catch'](handleError(_0x1366d6,null));};exports['getDispositions']=function(_0x21835a,_0x46b802,_0x3e1d54){var _0x582d77={'raw':![],'where':{}};var _0x322176={};var _0x2d61df={'count':0x0,'rows':[]};return db[_0x8c33('0x53')][_0x8c33('0x66')]({'where':{'id':_0x21835a[_0x8c33('0x57')]['id']}})['then'](handleEntityNotFound(_0x46b802,null))['then'](function(_0x5d766a){if(_0x5d766a){_0x322176['model']=_[_0x8c33('0x45')](db[_0x8c33('0x67')][_0x8c33('0x40')]);_0x322176['query']=_[_0x8c33('0x45')](_0x21835a[_0x8c33('0x44')]);_0x322176[_0x8c33('0x4e')]=_[_0x8c33('0x46')](_0x322176[_0x8c33('0x43')],_0x322176['query']);_0x582d77['attributes']=_[_0x8c33('0x46')](_0x322176[_0x8c33('0x43')],qs[_0x8c33('0x48')](_0x21835a[_0x8c33('0x44')][_0x8c33('0x48')]));_0x582d77[_0x8c33('0x47')]=_0x582d77[_0x8c33('0x47')][_0x8c33('0x49')]?_0x582d77['attributes']:_0x322176[_0x8c33('0x43')];if(!_0x21835a[_0x8c33('0x44')][_0x8c33('0x4a')](_0x8c33('0x68'))){_0x582d77['limit']=qs['limit'](_0x21835a[_0x8c33('0x44')][_0x8c33('0x32')]);_0x582d77['offset']=qs['offset'](_0x21835a[_0x8c33('0x44')][_0x8c33('0x30')]);}_0x582d77['order']=qs['sort'](_0x21835a['query'][_0x8c33('0x4c')]);_0x582d77['where']=qs[_0x8c33('0x4e')](_[_0x8c33('0x69')](_0x21835a[_0x8c33('0x44')],_0x322176[_0x8c33('0x4e')]));_0x582d77[_0x8c33('0x4d')]['FaxAccountId']=_0x5d766a['id'];if(_0x21835a[_0x8c33('0x44')][_0x8c33('0x4f')]){_0x582d77[_0x8c33('0x4d')]=_['merge'](_0x582d77[_0x8c33('0x4d')],{'$or':_[_0x8c33('0x3f')](_0x582d77[_0x8c33('0x47')],function(_0x5c46b8){var _0x86bbc={};_0x86bbc[_0x5c46b8]={'$like':'%'+_0x21835a['query']['filter']+'%'};return _0x86bbc;})});}_0x582d77=_[_0x8c33('0x50')]({},_0x582d77,_0x21835a[_0x8c33('0x52')]);return db['Disposition'][_0x8c33('0x33')]({'where':_0x582d77[_0x8c33('0x4d')]})['then'](function(_0x3f104f){_0x2d61df[_0x8c33('0x33')]=_0x3f104f;if(_0x21835a['query'][_0x8c33('0x59')]){_0x582d77[_0x8c33('0x54')]=[{'all':!![]}];}return db[_0x8c33('0x67')][_0x8c33('0x55')](_0x582d77);})['then'](function(_0x4caf9f){_0x2d61df[_0x8c33('0x6a')]=_0x4caf9f;return _0x2d61df;});}})[_0x8c33('0x21')](respondWithFilteredResult(_0x46b802,_0x582d77))[_0x8c33('0x2b')](handleError(_0x46b802,null));};exports[_0x8c33('0x6b')]=function(_0x56ad99,_0x256e08,_0x473866){return db['FaxAccount']['find']({'where':{'id':_0x56ad99['params']['id']}})[_0x8c33('0x21')](handleEntityNotFound(_0x256e08,null))['then'](function(_0x5944fd){if(_0x5944fd){return _0x5944fd[_0x8c33('0x6b')](_0x56ad99[_0x8c33('0x44')][_0x8c33('0x6c')]);}})[_0x8c33('0x21')](respondWithStatusCode(_0x256e08,null))[_0x8c33('0x2b')](handleError(_0x256e08,null));};exports[_0x8c33('0x6d')]=function(_0x2ccab0,_0x5eb606,_0x1b3c93){if(_0x2ccab0['body']['id']){delete _0x2ccab0[_0x8c33('0x5c')]['id'];}return db['FaxAccount'][_0x8c33('0x5a')]({'where':{'id':_0x2ccab0[_0x8c33('0x57')]['id']}})[_0x8c33('0x21')](handleEntityNotFound(_0x5eb606,null))['then'](function(_0x149d45){if(_0x149d45){_0x2ccab0[_0x8c33('0x5c')][_0x8c33('0x65')]=_0x149d45['id'];return db[_0x8c33('0x6e')]['create'](_0x2ccab0['body']);}})[_0x8c33('0x21')](respondWithResult(_0x5eb606,null))['catch'](handleError(_0x5eb606,null));};exports[_0x8c33('0x6f')]=function(_0x5c0cb9,_0x44a193,_0x23a935){var _0x24a846={'raw':![],'where':{}};var _0x10c18f={};var _0x822268={'count':0x0,'rows':[]};return db[_0x8c33('0x53')][_0x8c33('0x66')]({'where':{'id':_0x5c0cb9['params']['id']}})['then'](handleEntityNotFound(_0x44a193,null))[_0x8c33('0x21')](function(_0x110c57){if(_0x110c57){_0x10c18f[_0x8c33('0x43')]=_['keys'](db['CannedAnswer'][_0x8c33('0x40')]);_0x10c18f[_0x8c33('0x44')]=_['keys'](_0x5c0cb9['query']);_0x10c18f[_0x8c33('0x4e')]=_[_0x8c33('0x46')](_0x10c18f['model'],_0x10c18f[_0x8c33('0x44')]);_0x24a846[_0x8c33('0x47')]=_['intersection'](_0x10c18f[_0x8c33('0x43')],qs[_0x8c33('0x48')](_0x5c0cb9[_0x8c33('0x44')][_0x8c33('0x48')]));_0x24a846['attributes']=_0x24a846[_0x8c33('0x47')]['length']?_0x24a846['attributes']:_0x10c18f[_0x8c33('0x43')];if(!_0x5c0cb9[_0x8c33('0x44')][_0x8c33('0x4a')]('nolimit')){_0x24a846[_0x8c33('0x32')]=qs['limit'](_0x5c0cb9[_0x8c33('0x44')][_0x8c33('0x32')]);_0x24a846['offset']=qs[_0x8c33('0x30')](_0x5c0cb9['query']['offset']);}_0x24a846[_0x8c33('0x4b')]=qs[_0x8c33('0x4c')](_0x5c0cb9[_0x8c33('0x44')][_0x8c33('0x4c')]);_0x24a846['where']=qs[_0x8c33('0x4e')](_[_0x8c33('0x69')](_0x5c0cb9['query'],_0x10c18f[_0x8c33('0x4e')]));_0x24a846[_0x8c33('0x4d')][_0x8c33('0x65')]=_0x110c57['id'];if(_0x5c0cb9[_0x8c33('0x44')][_0x8c33('0x4f')]){_0x24a846[_0x8c33('0x4d')]=_['merge'](_0x24a846['where'],{'$or':_[_0x8c33('0x3f')](_0x24a846[_0x8c33('0x47')],function(_0x268df2){var _0x1d5d43={};_0x1d5d43[_0x268df2]={'$like':'%'+_0x5c0cb9[_0x8c33('0x44')][_0x8c33('0x4f')]+'%'};return _0x1d5d43;})});}_0x24a846=_[_0x8c33('0x50')]({},_0x24a846,_0x5c0cb9[_0x8c33('0x52')]);return db[_0x8c33('0x6e')][_0x8c33('0x33')]({'where':_0x24a846[_0x8c33('0x4d')]})['then'](function(_0x38da09){_0x822268['count']=_0x38da09;if(_0x5c0cb9['query'][_0x8c33('0x59')]){_0x24a846[_0x8c33('0x54')]=[{'all':!![]}];}return db['CannedAnswer'][_0x8c33('0x55')](_0x24a846);})['then'](function(_0x4af8a3){_0x822268[_0x8c33('0x6a')]=_0x4af8a3;return _0x822268;});}})[_0x8c33('0x21')](respondWithFilteredResult(_0x44a193,_0x24a846))['catch'](handleError(_0x44a193,null));};exports[_0x8c33('0x70')]=function(_0x1d372c,_0x322605,_0x4c37ea){return db['FaxAccount'][_0x8c33('0x5a')]({'where':{'id':_0x1d372c[_0x8c33('0x57')]['id']}})['then'](handleEntityNotFound(_0x322605,null))['then'](function(_0x1f4ab6){if(_0x1f4ab6){return _0x1f4ab6[_0x8c33('0x70')](_0x1d372c[_0x8c33('0x44')][_0x8c33('0x6c')]);}})[_0x8c33('0x21')](respondWithStatusCode(_0x322605,null))[_0x8c33('0x2b')](handleError(_0x322605,null));};exports[_0x8c33('0x71')]=function(_0x2478e4,_0x2973fe,_0x1fa1bc){return db[_0x8c33('0x72')][_0x8c33('0x5a')]({'where':{'id':_0x2478e4[_0x8c33('0x57')]['id']}})[_0x8c33('0x21')](handleEntityNotFound(_0x2973fe,null))['then'](function(_0x408dea){if(_0x408dea){return _0x408dea[_0x8c33('0x71')](_0x2478e4[_0x8c33('0x5c')]['ids'],_[_0x8c33('0x73')](_0x2478e4[_0x8c33('0x5c')],['ids','id'])||{});}})[_0x8c33('0x21')](respondWithResult(_0x2973fe,null))['catch'](handleError(_0x2973fe,null));};exports[_0x8c33('0x74')]=function(_0x7182bb,_0xfd63ae,_0x560c05){var _0x223197={'raw':![],'where':{}};var _0xb1c3b8={};var _0x4e7fbf={'count':0x0,'rows':[]};return db[_0x8c33('0x53')][_0x8c33('0x66')]({'where':{'id':_0x7182bb[_0x8c33('0x57')]['id']}})[_0x8c33('0x21')](handleEntityNotFound(_0xfd63ae,null))[_0x8c33('0x21')](function(_0x5a0721){if(_0x5a0721){_0xb1c3b8['model']=_['keys'](db[_0x8c33('0x72')]['rawAttributes']);_0xb1c3b8[_0x8c33('0x44')]=_[_0x8c33('0x45')](_0x7182bb[_0x8c33('0x44')]);_0xb1c3b8[_0x8c33('0x4e')]=_[_0x8c33('0x46')](_0xb1c3b8[_0x8c33('0x43')],_0xb1c3b8['query']);_0x223197[_0x8c33('0x47')]=_[_0x8c33('0x46')](_0xb1c3b8[_0x8c33('0x43')],qs['fields'](_0x7182bb[_0x8c33('0x44')]['fields']));_0x223197[_0x8c33('0x47')]=_0x223197[_0x8c33('0x47')][_0x8c33('0x49')]?_0x223197[_0x8c33('0x47')]:_0xb1c3b8[_0x8c33('0x43')];if(!_0x7182bb[_0x8c33('0x44')]['hasOwnProperty']('nolimit')){_0x223197['limit']=qs['limit'](_0x7182bb[_0x8c33('0x44')][_0x8c33('0x32')]);_0x223197[_0x8c33('0x30')]=qs[_0x8c33('0x30')](_0x7182bb[_0x8c33('0x44')]['offset']);}_0x223197[_0x8c33('0x4b')]=qs[_0x8c33('0x4c')](_0x7182bb[_0x8c33('0x44')][_0x8c33('0x4c')]);_0x223197['where']=qs['filters'](_['pick'](_0x7182bb['query'],_0xb1c3b8['filters']));_0x223197[_0x8c33('0x4d')][_0x8c33('0x65')]=_0x5a0721['id'];if(_0x7182bb[_0x8c33('0x44')]['filter']){_0x223197[_0x8c33('0x4d')]=_[_0x8c33('0x50')](_0x223197[_0x8c33('0x4d')],{'$or':_[_0x8c33('0x3f')](_0x223197[_0x8c33('0x47')],function(_0x2d2e2b){var _0x25b5ae={};_0x25b5ae[_0x2d2e2b]={'$like':'%'+_0x7182bb['query'][_0x8c33('0x4f')]+'%'};return _0x25b5ae;})});}_0x223197=_[_0x8c33('0x50')]({},_0x223197,_0x7182bb[_0x8c33('0x52')]);return db[_0x8c33('0x72')]['count']({'where':_0x223197[_0x8c33('0x4d')]})['then'](function(_0x139228){_0x4e7fbf[_0x8c33('0x33')]=_0x139228;if(_0x7182bb['query']['includeAll']){_0x223197[_0x8c33('0x54')]=[{'model':db['CmContact'],'as':_0x8c33('0x75'),'required':![]},{'model':db['User'],'as':_0x8c33('0x76'),'attributes':[_0x8c33('0x3c'),_0x8c33('0x77'),_0x8c33('0x78')],'required':![]},{'model':db[_0x8c33('0x79')],'as':_0x8c33('0x7a'),'attributes':['id',_0x8c33('0x3c'),_0x8c33('0x7b')],'where':_0x7182bb[_0x8c33('0x44')][_0x8c33('0x7c')]?{'id':_0x7182bb[_0x8c33('0x44')][_0x8c33('0x7c')]}:undefined,'required':_0x7182bb[_0x8c33('0x44')][_0x8c33('0x7c')]?!![]:![]}];}return db[_0x8c33('0x72')][_0x8c33('0x55')](_0x223197);})[_0x8c33('0x21')](function(_0x9f1026){_0x4e7fbf['rows']=_0x9f1026;return _0x4e7fbf;});}})[_0x8c33('0x21')](respondWithFilteredResult(_0xfd63ae,_0x223197))[_0x8c33('0x2b')](handleError(_0xfd63ae,null));};exports[_0x8c33('0x7d')]=function(_0x1a5098,_0x50cfef){var _0x564d53=_0x1a5098[_0x8c33('0x57')]['id'];var _0x38e5dd=_0x1a5098[_0x8c33('0x5c')];var _0x2bb6a7=0xc8;var _0x3345d3=null;return db[_0x8c33('0x7e')]['transaction']({'isolationLevel':db[_0x8c33('0x7e')][_0x8c33('0x7f')][_0x8c33('0x80')][_0x8c33('0x81')]},function(_0x5723a0){return db[_0x8c33('0x53')][_0x8c33('0x66')]({'where':{'id':_0x564d53},'transaction':_0x5723a0})['then'](function(_0x41b034){if(_0x41b034){return db[_0x8c33('0x82')][_0x8c33('0x3a')]({'where':{'FaxAccountId':_0x564d53},'transaction':_0x5723a0})[_0x8c33('0x21')](function(){var _0x52ac2a=_['map'](_0x38e5dd,function(_0x29c94a){_0x29c94a[_0x8c33('0x65')]=_0x564d53;return _0x29c94a;});return db[_0x8c33('0x82')][_0x8c33('0x83')](_0x52ac2a,{'transaction':_0x5723a0});});}else{_0x2bb6a7=0x194;_0x3345d3=[];}});})['then'](function(){if(_0x2bb6a7!==0x194){return db[_0x8c33('0x82')][_0x8c33('0x84')]({'where':{'FaxAccountId':_0x564d53},'order':'priority'})['then'](function(_0xe71451){_0x3345d3=_0xe71451;});}})['catch'](function(_0xfc397){_0x2bb6a7=0x1f4;logger['error'](_0xfc397[_0x8c33('0x3b')]);if(_0xfc397['name']){delete _0xfc397['name'];}_0x3345d3=_0xfc397;})[_0x8c33('0x85')](function(){if(_0x3345d3===null){_0x50cfef[_0x8c33('0x2c')](_0x2bb6a7);}else{if(_0x2bb6a7===0x1f4){_0x50cfef[_0x8c33('0x2d')](_0x2bb6a7)[_0x8c33('0x3d')](_0x3345d3);}else{_0x50cfef[_0x8c33('0x2d')](_0x2bb6a7)[_0x8c33('0x2f')](_0x3345d3);}}});};exports[_0x8c33('0x86')]=function(_0x290f3a,_0xabbc17,_0x29519d){var _0x2bd946={};var _0x27de64={};var _0x56ed8f;var _0x3e5b7c;return db['FaxAccount']['findOne']({'where':{'id':_0x290f3a[_0x8c33('0x57')]['id']}})[_0x8c33('0x21')](handleEntityNotFound(_0xabbc17,null))[_0x8c33('0x21')](function(_0x20b97b){if(_0x20b97b){_0x56ed8f=_0x20b97b;_0x27de64[_0x8c33('0x43')]=_[_0x8c33('0x45')](db[_0x8c33('0x82')][_0x8c33('0x40')]);_0x27de64[_0x8c33('0x44')]=_[_0x8c33('0x45')](_0x290f3a['query']);_0x27de64['filters']=_[_0x8c33('0x46')](_0x27de64[_0x8c33('0x43')],_0x27de64[_0x8c33('0x44')]);_0x2bd946[_0x8c33('0x47')]=_[_0x8c33('0x46')](_0x27de64['model'],qs[_0x8c33('0x48')](_0x290f3a[_0x8c33('0x44')][_0x8c33('0x48')]));_0x2bd946[_0x8c33('0x47')]=_0x2bd946[_0x8c33('0x47')][_0x8c33('0x49')]?_0x2bd946['attributes']:_0x27de64[_0x8c33('0x43')];_0x2bd946['order']=qs[_0x8c33('0x4c')](_0x290f3a[_0x8c33('0x44')][_0x8c33('0x4c')]);_0x2bd946['where']=qs[_0x8c33('0x4e')](_[_0x8c33('0x69')](_0x290f3a[_0x8c33('0x44')],_0x27de64[_0x8c33('0x4e')]));if(_0x290f3a[_0x8c33('0x44')]['filter']){_0x2bd946[_0x8c33('0x4d')]=_['merge'](_0x2bd946[_0x8c33('0x4d')],{'$or':_[_0x8c33('0x3f')](_0x2bd946[_0x8c33('0x47')],function(_0x5e0156){var _0x191176={};_0x191176[_0x5e0156]={'$like':'%'+_0x290f3a['query'][_0x8c33('0x4f')]+'%'};return _0x191176;})});}_0x2bd946=_['merge']({},_0x2bd946,_0x290f3a[_0x8c33('0x52')]);return _0x56ed8f[_0x8c33('0x86')](_0x2bd946);}})['then'](function(_0x1347f4){if(_0x1347f4){_0x3e5b7c=_0x1347f4[_0x8c33('0x49')];if(!_0x290f3a[_0x8c33('0x44')][_0x8c33('0x4a')](_0x8c33('0x68'))){_0x2bd946[_0x8c33('0x32')]=qs['limit'](_0x290f3a[_0x8c33('0x44')][_0x8c33('0x32')]);_0x2bd946[_0x8c33('0x30')]=qs[_0x8c33('0x30')](_0x290f3a[_0x8c33('0x44')][_0x8c33('0x30')]);}return _0x56ed8f[_0x8c33('0x86')](_0x2bd946);}})[_0x8c33('0x21')](function(_0x57e16c){if(_0x57e16c){return _0x57e16c?{'count':_0x3e5b7c,'rows':_0x57e16c}:null;}})[_0x8c33('0x21')](respondWithResult(_0xabbc17,null))[_0x8c33('0x2b')](handleError(_0xabbc17,null));};function Extension(_0x5dead7,_0x51bae7,_0xf4d361,_0x22340f){this[_0x8c33('0x87')]='from-voip-provider';this[_0x8c33('0x88')]=_0x5dead7['localstationid'];this['app']=_0x22340f;this[_0x8c33('0x51')]=_0x8c33('0x89');this['description']=_0x8c33('0x8a');this[_0x8c33('0x65')]=_0x5dead7['id'];this[_0x8c33('0x8b')]=_0x51bae7;this[_0x8c33('0x8c')]=_0xf4d361;}function createExtensionsReciveFax(_0x3ed35c){var _0x3ffddc=0x1;var _0x4c054b=[];_0x4c054b['push'](new Extension(_0x3ed35c,_0x3ffddc,'','Answer'));_0x3ffddc+=0x1;_0x4c054b[_0x8c33('0x8d')](new Extension(_0x3ed35c,_0x3ffddc,_0x8c33('0x8e'),_0x8c33('0x8f')));_0x3ffddc+=0x1;for(var _0x1e1d87 in _0x3ed35c){if(_0x3ed35c['hasOwnProperty'](_0x1e1d87)&&(_0x1e1d87==='ecm'||_0x1e1d87==='localstationid'||_0x1e1d87===_0x8c33('0x90')||_0x1e1d87===_0x8c33('0x91')||_0x1e1d87===_0x8c33('0x92')||_0x1e1d87===_0x8c33('0x93')||_0x1e1d87==='minrate'||_0x1e1d87===_0x8c33('0x94')||_0x1e1d87===_0x8c33('0x95'))){_0x4c054b[_0x8c33('0x8d')](new Extension(_0x3ed35c,_0x3ffddc,_0x8c33('0x96')+_0x1e1d87+')='+_0x3ed35c[_0x1e1d87],_0x8c33('0x8f')));_0x3ffddc+=0x1;}}_0x4c054b[_0x8c33('0x8d')](new Extension(_0x3ed35c,_0x3ffddc,'6',_0x8c33('0x97')));_0x3ffddc+=0x1;_0x4c054b[_0x8c33('0x8d')](new Extension(_0x3ed35c,_0x3ffddc,_0x8c33('0x98'),_0x8c33('0x99')));_0x3ffddc=0x0;return _0x4c054b;}exports[_0x8c33('0x9a')]=function(_0x3a0139,_0x5b1215,_0x1d62f3){var _0x20c0d3;return db[_0x8c33('0x7e')][_0x8c33('0x9b')](function(_0x575c1a){return db['FaxAccount'][_0x8c33('0x5b')](_0x3a0139['body'],{'transaction':_0x575c1a})[_0x8c33('0x21')](function(_0x2bfa07){_0x20c0d3=_0x2bfa07[_0x8c33('0x37')]({'plain':!![]});return db['VoiceExtension'][_0x8c33('0x83')](createExtensionsReciveFax(_0x20c0d3),{'transaction':_0x575c1a});});})['then'](function(){return _0x20c0d3;})[_0x8c33('0x21')](respondWithResult(_0x5b1215,null))[_0x8c33('0x2b')](handleError(_0x5b1215,null));};exports[_0x8c33('0x9c')]=function(_0x19b173,_0x345feb,_0x5c6b06){var _0x1562c0;return db[_0x8c33('0x7e')]['transaction'](function(_0x4ea579){return db[_0x8c33('0x53')][_0x8c33('0x36')](_0x19b173[_0x8c33('0x5c')],{'where':{'id':_0x19b173[_0x8c33('0x5c')]['id']},'transaction':_0x4ea579})[_0x8c33('0x21')](function(_0x218700){return db['VoiceExtension'][_0x8c33('0x3a')]({'where':{'FaxAccountId':_0x19b173[_0x8c33('0x5c')]['id']},'transaction':_0x4ea579})['then'](function(_0x2a9c0c){return db['VoiceExtension'][_0x8c33('0x83')](createExtensionsReciveFax(_['omit'](_0x19b173['body'],['tech','key','createdAt','updatedAt',_0x8c33('0x9d'),_0x8c33('0x9e')])),{'transaction':_0x4ea579});});});})[_0x8c33('0x21')](function(){return db[_0x8c33('0x53')][_0x8c33('0x9f')](_0x19b173[_0x8c33('0x5c')]['id']);})[_0x8c33('0x21')](respondWithResult(_0x345feb,null))['catch'](handleError(_0x345feb,null));};exports[_0x8c33('0xa0')]=function(_0x1b4bac,_0x4a5459,_0x227e1f){var _0x3b01f3={'raw':!![],'where':{}};var _0x138aa7={};var _0x5a3451={'count':0x0,'rows':[]};return db[_0x8c33('0x53')]['findOne']({'where':{'id':_0x1b4bac[_0x8c33('0x57')]['id']}})[_0x8c33('0x21')](handleEntityNotFound(_0x4a5459,null))['then'](function(_0x2ab4dd){if(_0x2ab4dd){_0x138aa7['model']=_[_0x8c33('0x45')](db[_0x8c33('0xa1')][_0x8c33('0x40')]);_0x138aa7['query']=_[_0x8c33('0x45')](_0x1b4bac[_0x8c33('0x44')]);_0x138aa7[_0x8c33('0x4e')]=_[_0x8c33('0x46')](_0x138aa7['model'],_0x138aa7[_0x8c33('0x44')]);_0x3b01f3['attributes']=_[_0x8c33('0x46')](_0x138aa7[_0x8c33('0x43')],qs[_0x8c33('0x48')](_0x1b4bac['query']['fields']));_0x3b01f3['attributes']=_0x3b01f3['attributes']['length']?_0x3b01f3[_0x8c33('0x47')]:_0x138aa7[_0x8c33('0x43')];if(!_0x1b4bac[_0x8c33('0x44')][_0x8c33('0x4a')](_0x8c33('0x68'))){_0x3b01f3[_0x8c33('0x32')]=qs['limit'](_0x1b4bac[_0x8c33('0x44')][_0x8c33('0x32')]);_0x3b01f3[_0x8c33('0x30')]=qs[_0x8c33('0x30')](_0x1b4bac[_0x8c33('0x44')][_0x8c33('0x30')]);}_0x3b01f3[_0x8c33('0x4b')]=qs[_0x8c33('0x4c')](_0x1b4bac[_0x8c33('0x44')][_0x8c33('0x4c')]);_0x3b01f3['where']=qs['filters'](_['pick'](_0x1b4bac['query'],_0x138aa7['filters']));_0x3b01f3[_0x8c33('0x4d')][_0x8c33('0x65')]=_0x2ab4dd['id'];if(_0x1b4bac[_0x8c33('0x44')]['filter']){_0x3b01f3['where']=_[_0x8c33('0x50')](_0x3b01f3[_0x8c33('0x4d')],{'$or':_['map'](_0x3b01f3[_0x8c33('0x47')],function(_0x4f393f){var _0x44ee3b={};_0x44ee3b[_0x4f393f]={'$like':'%'+_0x1b4bac[_0x8c33('0x44')]['filter']+'%'};return _0x44ee3b;})});}if(_0x1b4bac[_0x8c33('0x44')][_0x8c33('0xa2')]){var _0x599743=_0x1b4bac[_0x8c33('0x44')][_0x8c33('0xa2')][_0x8c33('0xa3')](',');var _0x5f448a={};_0x5f448a[_0x599743[0x0]]={'$gte':moment(_0x599743[0x1])['format'](_0x8c33('0xa4'))};_0x3b01f3['where']=_['merge'](_0x3b01f3[_0x8c33('0x4d')],_0x5f448a);}_0x3b01f3=_[_0x8c33('0x50')]({},_0x3b01f3,_0x1b4bac['options']);return db[_0x8c33('0xa1')][_0x8c33('0x33')]({'where':_0x3b01f3[_0x8c33('0x4d')]})['then'](function(_0x3a8355){_0x5a3451[_0x8c33('0x33')]=_0x3a8355;if(_0x1b4bac[_0x8c33('0x44')][_0x8c33('0x59')]){_0x3b01f3['include']=[{'all':!![]}];}return db['FaxMessage'][_0x8c33('0x55')](_0x3b01f3);})['then'](function(_0x4f18be){_0x5a3451[_0x8c33('0x6a')]=_0x4f18be;return _0x5a3451;});}})[_0x8c33('0x21')](respondWithFilteredResult(_0x4a5459,_0x3b01f3))[_0x8c33('0x2b')](handleError(_0x4a5459,null));};exports[_0x8c33('0x3d')]=function(_0x28b779,_0x41d687,_0x55f248){var _0x5afc6c,_0x4197bb={},_0x182285;if(_0x28b779['body']['to']){_0x182285=_0x28b779[_0x8c33('0x5c')]['to'][0x0];}return db[_0x8c33('0x53')]['find']({'where':{'id':_0x28b779[_0x8c33('0x57')]['id']},'include':[{'model':db[_0x8c33('0xa5')],'as':'List','include':[{'model':db[_0x8c33('0xa6')],'as':'Contacts','where':{'fax':_0x182285},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x8c33('0x21')](handleEntityNotFound(_0x41d687,null))[_0x8c33('0x21')](function(_0x57f59e){_0x5afc6c=_0x57f59e;if(_0x28b779['body'][_0x8c33('0xa7')]&&_0x28b779['body']['attachments'][_0x8c33('0x49')]){for(var _0x535704=0x0;_0x535704<_0x28b779[_0x8c33('0x5c')][_0x8c33('0xa7')][_0x8c33('0x49')];_0x535704+=0x1){_0x28b779[_0x8c33('0x5c')][_0x8c33('0xa7')][_0x535704]={'filename':_0x28b779['body']['attachments'][_0x535704]['name'],'id':_0x28b779['body'][_0x8c33('0xa7')][_0x535704]['id'],'path':path['join'](config['root'],_0x8c33('0xa8'),_0x28b779[_0x8c33('0x5c')][_0x8c33('0xa7')][_0x535704][_0x8c33('0xa9')])};}}return respondWithRpcPromise(_0x8c33('0xaa'),_0x8c33('0xaa'),{'FaxAccountId':_['isNil'](_0x28b779[_0x8c33('0x57')]['id'])?undefined:_0x28b779[_0x8c33('0x57')]['id'],'path':_[_0x8c33('0xab')](_0x28b779['body'][_0x8c33('0xa7')][0x0]['path'])?undefined:_0x28b779[_0x8c33('0x5c')][_0x8c33('0xa7')][0x0][_0x8c33('0x8')],'fax':_[_0x8c33('0xab')](_0x28b779[_0x8c33('0x5c')]['to'][0x0])?undefined:_0x28b779[_0x8c33('0x5c')]['to'][0x0]},client9002);})['then'](function(){if(_0x5afc6c){if(_[_0x8c33('0xab')](_0x28b779['body'][_0x8c33('0xac')])){_0x28b779[_0x8c33('0x5c')][_0x8c33('0xac')]=util[_0x8c33('0xad')](_0x8c33('0xae'),_0x5afc6c[_0x8c33('0x3c')],_0x5afc6c[_0x8c33('0xaf')]);}if(_0x5afc6c[_0x8c33('0xb0')]){if(_0x5afc6c[_0x8c33('0xb0')][_0x8c33('0xb1')]['length']){return _0x5afc6c['List'][_0x8c33('0xb1')][0x0];}else{return db[_0x8c33('0xa6')]['create'](_[_0x8c33('0x18')](_0x28b779[_0x8c33('0x5c')],{'firstName':_0x28b779['body']['to'][0x0],'phone':_0x28b779['body']['to'][0x0],'fax':_0x28b779[_0x8c33('0x5c')]['to'][0x0],'ListId':_0x5afc6c[_0x8c33('0x9e')]}));}}else{throw new Error(_0x8c33('0xb2'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x8c33('0x21')](function(_0x1f1f24){if(_0x1f1f24){return db[_0x8c33('0x72')][_0x8c33('0x5a')]({'where':{'ContactId':_0x1f1f24['id'],'closed':![],'FaxAccountId':_0x5afc6c['id']}})[_0x8c33('0x21')](function(_0x395cbd){if(_0x395cbd){return[_0x395cbd,![]];}return db[_0x8c33('0x72')]['create']({'UserId':_0x28b779[_0x8c33('0x5d')]['id'],'ContactId':_0x1f1f24['id'],'FaxAccountId':_0x5afc6c['id'],'fax':_0x28b779[_0x8c33('0x5c')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x8c33('0x50')](_0x28b779['body'],{'read':![],'body':_0x28b779[_0x8c33('0x5c')][_0x8c33('0xa7')][0x0][_0x8c33('0xb3')],'FaxAccountId':_0x5afc6c['id'],'UserId':_0x28b779['user']['id'],'ContactId':_0x1f1f24['id'],'AttachmentId':_0x28b779[_0x8c33('0x5c')][_0x8c33('0xa7')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x8c33('0xb4')}]})[_0x8c33('0x21')](function(_0x5704ba){return[_0x5704ba,!![]];});});}else{throw new Error(_0x8c33('0xb5'));}})[_0x8c33('0xb6')](function(_0x38cc29,_0x189faf){if(_0x189faf){return _0x38cc29;}return db[_0x8c33('0xa1')][_0x8c33('0x5b')]({'direction':_0x8c33('0xb7'),'read':![],'body':_0x28b779['body']['attachments'][0x0][_0x8c33('0xb3')],'FaxAccountId':_0x5afc6c['id'],'FaxInteractionId':_0x38cc29['id'],'UserId':_0x28b779['user']['id'],'ContactId':_0x38cc29[_0x8c33('0xb8')],'AttachmentId':_0x28b779['body'][_0x8c33('0xa7')][0x0]['id']})[_0x8c33('0x21')](function(_0x1a5c46){_0x38cc29[_0x8c33('0xb9')][_0x8c33('0xb4')]=[];_0x38cc29[_0x8c33('0xb9')][_0x8c33('0xb4')][_0x8c33('0x8d')](_0x1a5c46['dataValues']);return _0x38cc29;});})[_0x8c33('0x21')](function(_0x201a85){respondWithRpcPromise(_0x8c33('0xba'),_0x8c33('0xba'),{'FaxAccountId':_['isNil'](_0x28b779['params']['id'])?undefined:_0x28b779[_0x8c33('0x57')]['id'],'path':_['isNil'](_0x28b779[_0x8c33('0x5c')]['attachments'][0x0][_0x8c33('0x8')])?undefined:_0x28b779[_0x8c33('0x5c')][_0x8c33('0xa7')][0x0][_0x8c33('0x8')],'fax':_[_0x8c33('0xab')](_0x28b779[_0x8c33('0x5c')]['to'][0x0])?undefined:_0x28b779[_0x8c33('0x5c')]['to'][0x0],'AttachmentId':_0x28b779[_0x8c33('0x5c')][_0x8c33('0xa7')][0x0]['id']},client9002)[_0x8c33('0x21')](function(_0x29fb33){logger[_0x8c33('0x22')](_0x8c33('0xbb'),_0x29fb33);})[_0x8c33('0x2b')](function(_0x99f135){logger['info'](_0x8c33('0xbb'),_0x99f135);});return _0x201a85;})[_0x8c33('0x21')](respondWithResult(_0x41d687,null))[_0x8c33('0x2b')](handleError(_0x41d687,null));};exports['addAgents']=function(_0x58e4d6,_0x42521c,_0x3443de){return db[_0x8c33('0x53')]['find']({'where':{'id':_0x58e4d6[_0x8c33('0x57')]['id']}})[_0x8c33('0x21')](handleEntityNotFound(_0x42521c,null))[_0x8c33('0x21')](function(_0x53dc52){if(_0x53dc52){return _0x53dc52[_0x8c33('0xbc')](_0x58e4d6[_0x8c33('0x5c')][_0x8c33('0x6c')],_[_0x8c33('0x73')](_0x58e4d6['body'],[_0x8c33('0x6c'),'id'])||{})['spread'](function(_0x2a1d63){for(var _0x32023b=0x0;_0x32023b<_0x58e4d6[_0x8c33('0x5c')][_0x8c33('0x6c')][_0x8c33('0x49')];_0x32023b+=0x1){socket[_0x8c33('0xbd')](_0x8c33('0xbe'),{'UserId':Number(_0x58e4d6[_0x8c33('0x5c')][_0x8c33('0x6c')][_0x32023b]),'FaxAccountId':Number(_0x58e4d6[_0x8c33('0x57')]['id'])});}return _0x2a1d63;});}})[_0x8c33('0x21')](respondWithResult(_0x42521c,null))[_0x8c33('0x2b')](handleError(_0x42521c,null));};exports[_0x8c33('0xbf')]=function(_0xd8824,_0x22a31a,_0x1dbc46){return db[_0x8c33('0x53')]['find']({'where':{'id':_0xd8824[_0x8c33('0x57')]['id']}})[_0x8c33('0x21')](handleEntityNotFound(_0x22a31a,null))[_0x8c33('0x21')](function(_0x4c87e7){if(_0x4c87e7){return _0x4c87e7[_0x8c33('0xbf')](_0xd8824['query'][_0x8c33('0x6c')])[_0x8c33('0x21')](function(){if(_[_0x8c33('0xc0')](_0xd8824[_0x8c33('0x44')][_0x8c33('0x6c')])){for(var _0x40ec88=0x0;_0x40ec88<_0xd8824['query'][_0x8c33('0x6c')][_0x8c33('0x49')];_0x40ec88+=0x1){socket[_0x8c33('0xbd')](_0x8c33('0xc1'),{'UserId':Number(_0xd8824['query'][_0x8c33('0x6c')][_0x40ec88]),'FaxAccountId':Number(_0xd8824[_0x8c33('0x57')]['id'])});}}else{socket[_0x8c33('0xbd')]('userFaxAccount:remove',{'UserId':Number(_0xd8824[_0x8c33('0x44')]['ids']),'FaxAccountId':Number(_0xd8824['params']['id'])});}});}})['then'](respondWithStatusCode(_0x22a31a,null))[_0x8c33('0x2b')](handleError(_0x22a31a,null));};exports[_0x8c33('0xc2')]=function(_0xb463a5,_0x2107b6,_0x3e6991){var _0x33a4b5={};var _0x17a91d={};var _0x285c8a;var _0x4188aa;return db['FaxAccount'][_0x8c33('0x66')]({'where':{'id':_0xb463a5['params']['id']}})['then'](handleEntityNotFound(_0x2107b6,null))[_0x8c33('0x21')](function(_0x45dbbc){if(_0x45dbbc){_0x285c8a=_0x45dbbc;_0x17a91d[_0x8c33('0x43')]=_[_0x8c33('0x45')](db[_0x8c33('0xc3')][_0x8c33('0x40')]);_0x17a91d[_0x8c33('0x44')]=_[_0x8c33('0x45')](_0xb463a5[_0x8c33('0x44')]);_0x17a91d[_0x8c33('0x4e')]=_['intersection'](_0x17a91d[_0x8c33('0x43')],_0x17a91d['query']);_0x33a4b5[_0x8c33('0x47')]=_[_0x8c33('0x46')](_0x17a91d[_0x8c33('0x43')],qs['fields'](_0xb463a5[_0x8c33('0x44')][_0x8c33('0x48')]));_0x33a4b5['attributes']=_0x33a4b5[_0x8c33('0x47')][_0x8c33('0x49')]?_0x33a4b5[_0x8c33('0x47')]:_0x17a91d[_0x8c33('0x43')];_0x33a4b5[_0x8c33('0x4b')]=qs[_0x8c33('0x4c')](_0xb463a5[_0x8c33('0x44')][_0x8c33('0x4c')]);_0x33a4b5[_0x8c33('0x4d')]=qs[_0x8c33('0x4e')](_[_0x8c33('0x69')](_0xb463a5['query'],_0x17a91d[_0x8c33('0x4e')]));if(_0xb463a5[_0x8c33('0x44')][_0x8c33('0x4f')]){_0x33a4b5['where']=_['merge'](_0x33a4b5[_0x8c33('0x4d')],{'$or':_[_0x8c33('0x3f')](_0x33a4b5[_0x8c33('0x47')],function(_0x381705){var _0x264b1e={};_0x264b1e[_0x381705]={'$like':'%'+_0xb463a5[_0x8c33('0x44')][_0x8c33('0x4f')]+'%'};return _0x264b1e;})});}_0x33a4b5=_['merge']({},_0x33a4b5,_0xb463a5[_0x8c33('0x52')]);return _0x285c8a[_0x8c33('0xc2')](_0x33a4b5);}})['then'](function(_0x133931){if(_0x133931){_0x4188aa=_0x133931[_0x8c33('0x49')];if(!_0xb463a5[_0x8c33('0x44')]['hasOwnProperty']('nolimit')){_0x33a4b5[_0x8c33('0x32')]=qs['limit'](_0xb463a5[_0x8c33('0x44')][_0x8c33('0x32')]);_0x33a4b5[_0x8c33('0x30')]=qs[_0x8c33('0x30')](_0xb463a5[_0x8c33('0x44')]['offset']);}return _0x285c8a[_0x8c33('0xc2')](_0x33a4b5);}})[_0x8c33('0x21')](function(_0x14268d){if(_0x14268d){return _0x14268d?{'count':_0x4188aa,'rows':_0x14268d}:null;}})[_0x8c33('0x21')](respondWithResult(_0x2107b6,null))['catch'](handleError(_0x2107b6,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 4311d83..0f5f820 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 _0x8e7e=['save','remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners'];(function(_0x30182f,_0x30ce41){var _0x5207db=function(_0x50a417){while(--_0x50a417){_0x30182f['push'](_0x30182f['shift']());}};_0x5207db(++_0x30ce41);}(_0x8e7e,0xf5));var _0xe8e7=function(_0x383b5d,_0x3497bb){_0x383b5d=_0x383b5d-0x0;var _0x5a2631=_0x8e7e[_0x383b5d];return _0x5a2631;};'use strict';var EventEmitter=require(_0xe8e7('0x0'));var FaxAccount=require(_0xe8e7('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xe8e7('0x2')](0x0);var events={'afterCreate':_0xe8e7('0x3'),'afterUpdate':'update','afterDestroy':_0xe8e7('0x4')};function emitEvent(_0x6e7bc7){return function(_0x41f029,_0x4f4825,_0x606725){FaxAccountEvents[_0xe8e7('0x5')](_0x6e7bc7+':'+_0x41f029['id'],_0x41f029);FaxAccountEvents['emit'](_0x6e7bc7,_0x41f029);_0x606725(null);};}for(var e in events){if(events[_0xe8e7('0x6')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0xe8e7('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0xfef9=['emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','remove'];(function(_0x171237,_0x35221c){var _0x409d89=function(_0x4b9502){while(--_0x4b9502){_0x171237['push'](_0x171237['shift']());}};_0x409d89(++_0x35221c);}(_0xfef9,0xd3));var _0x9fef=function(_0x5b083b,_0x145a9b){_0x5b083b=_0x5b083b-0x0;var _0x6c2225=_0xfef9[_0x5b083b];return _0x6c2225;};'use strict';var EventEmitter=require(_0x9fef('0x0'));var FaxAccount=require(_0x9fef('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x9fef('0x2')](0x0);var events={'afterCreate':_0x9fef('0x3'),'afterUpdate':'update','afterDestroy':_0x9fef('0x4')};function emitEvent(_0x59a4de){return function(_0x3af68f,_0x525f4a,_0xe0da14){FaxAccountEvents[_0x9fef('0x5')](_0x59a4de+':'+_0x3af68f['id'],_0x3af68f);FaxAccountEvents['emit'](_0x59a4de,_0x3af68f);_0xe0da14(null);};}for(var e in events){if(events[_0x9fef('0x6')](e)){var event=events[e];FaxAccount[_0x9fef('0x7')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 71ec1ad..7504511 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 _0x55a9=['bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','lodash','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x55a9,0x14d));var _0x955a=function(_0x3b752d,_0x2e9f6d){_0x3b752d=_0x3b752d-0x0;var _0x18f13b=_0x55a9[_0x3b752d];return _0x18f13b;};'use strict';var _=require(_0x955a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x955a('0x1'));var moment=require(_0x955a('0x2'));var BPromise=require(_0x955a('0x3'));var rp=require(_0x955a('0x4'));var fs=require('fs');var path=require(_0x955a('0x5'));var rimraf=require(_0x955a('0x6'));var config=require(_0x955a('0x7'));var attributes=require(_0x955a('0x8'));module[_0x955a('0x9')]=function(_0x16b44d,_0x51b532){return _0x16b44d[_0x955a('0xa')](_0x955a('0xb'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x72fd=['moment','bluebird','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','../../config/logger'];(function(_0x315c6e,_0x51d5ad){var _0x2169f4=function(_0x31f998){while(--_0x31f998){_0x315c6e['push'](_0x315c6e['shift']());}};_0x2169f4(++_0x51d5ad);}(_0x72fd,0x16a));var _0xd72f=function(_0x5b8de1,_0x2befca){_0x5b8de1=_0x5b8de1-0x0;var _0x21d90a=_0x72fd[_0x5b8de1];return _0x21d90a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd72f('0x0'))('api');var moment=require(_0xd72f('0x1'));var BPromise=require(_0xd72f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd72f('0x3'));var rimraf=require(_0xd72f('0x4'));var config=require(_0xd72f('0x5'));var attributes=require(_0xd72f('0x6'));module[_0xd72f('0x7')]=function(_0x57a27f,_0x53323b){return _0x57a27f[_0xd72f('0x8')](_0xd72f('0x9'),attributes,{'tableName':_0xd72f('0xa'),'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 7cbd03e..e9e46fe 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 _0x570a=['../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','debug','request\x20sent','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','include','map','model','fax','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','FaxApplication','Applications','get','list','applications','orderBy','asc','length','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','*,*,*,*','created','interaction','FaxMessage','ContactId','UserId','User','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5d7fc3,_0x227da){var _0x2e11c4=function(_0x130423){while(--_0x130423){_0x5d7fc3['push'](_0x5d7fc3['shift']());}};_0x2e11c4(++_0x227da);}(_0x570a,0x108));var _0xa570=function(_0x182fe0,_0x46d3a7){_0x182fe0=_0x182fe0-0x0;var _0x2d6ced=_0x570a[_0x182fe0];return _0x2d6ced;};'use strict';var _=require(_0xa570('0x0'));var util=require('util');var moment=require(_0xa570('0x1'));var BPromise=require(_0xa570('0x2'));var rs=require(_0xa570('0x3'));var fs=require('fs');var Redis=require(_0xa570('0x4'));var db=require(_0xa570('0x5'))['db'];var utils=require(_0xa570('0x6'));var logger=require(_0xa570('0x7'))(_0xa570('0x8'));var config=require(_0xa570('0x9'));var jayson=require(_0xa570('0xa'));var client=jayson[_0xa570('0xb')][_0xa570('0xc')]({'port':0x232c});config['redis']=_[_0xa570('0xd')](config[_0xa570('0xe')],{'host':_0xa570('0xf'),'port':0x18eb});var socket=require(_0xa570('0x10'))(new Redis(config['redis']));require(_0xa570('0x11'))[_0xa570('0x12')](socket);function respondWithRpcPromise(_0x380d42,_0x362488,_0x3b15fb){return new BPromise(function(_0x28ad6f,_0x6d2d6b){return client[_0xa570('0x13')](_0x380d42,_0x3b15fb)[_0xa570('0x14')](function(_0x2807bc){logger[_0xa570('0x15')]('FaxAccount,\x20%s,\x20%s',_0x362488,'request\x20sent');logger[_0xa570('0x16')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x362488,_0xa570('0x17'),JSON[_0xa570('0x18')](_0x2807bc));if(_0x2807bc[_0xa570('0x19')]){if(_0x2807bc[_0xa570('0x19')][_0xa570('0x1a')]===0x1f4){logger[_0xa570('0x19')](_0xa570('0x1b'),_0x362488,_0x2807bc['error'][_0xa570('0x1c')]);return _0x6d2d6b(_0x2807bc[_0xa570('0x19')][_0xa570('0x1c')]);}logger[_0xa570('0x19')]('FaxAccount,\x20%s,\x20%s',_0x362488,_0x2807bc[_0xa570('0x19')][_0xa570('0x1c')]);return _0x28ad6f(_0x2807bc[_0xa570('0x19')]['message']);}else{logger[_0xa570('0x15')](_0xa570('0x1b'),_0x362488,'request\x20sent');_0x28ad6f(_0x2807bc[_0xa570('0x1d')][_0xa570('0x1c')]);}})[_0xa570('0x1e')](function(_0x27ae1d){logger[_0xa570('0x19')](_0xa570('0x1b'),_0x362488,_0x27ae1d);_0x6d2d6b(_0x27ae1d);});});}exports[_0xa570('0x1f')]=function(_0x5cbfb5){var _0x1e10fe=this;return new Promise(function(_0x413de8,_0x37f748){return db[_0xa570('0x20')][_0xa570('0x21')]({'raw':_0x5cbfb5['options']?_0x5cbfb5[_0xa570('0x22')][_0xa570('0x23')]===undefined?!![]:![]:!![],'where':_0x5cbfb5['options']?_0x5cbfb5[_0xa570('0x22')][_0xa570('0x24')]||null:null,'attributes':_0x5cbfb5[_0xa570('0x22')]?_0x5cbfb5[_0xa570('0x22')][_0xa570('0x25')]||null:null,'limit':_0x5cbfb5[_0xa570('0x22')]?_0x5cbfb5[_0xa570('0x22')]['limit']||null:null,'include':_0x5cbfb5[_0xa570('0x22')]?_0x5cbfb5['options'][_0xa570('0x26')]?_[_0xa570('0x27')](_0x5cbfb5['options'][_0xa570('0x26')],function(_0x4a7c50){return{'model':db[_0x4a7c50[_0xa570('0x28')]],'as':_0x4a7c50['as'],'attributes':_0x4a7c50[_0xa570('0x25')],'include':_0x4a7c50[_0xa570('0x26')]?_[_0xa570('0x27')](_0x4a7c50[_0xa570('0x26')],function(_0x3d8d67){return{'model':db[_0x3d8d67[_0xa570('0x28')]],'as':_0x3d8d67['as'],'attributes':_0x3d8d67[_0xa570('0x25')],'include':_0x3d8d67['include']?_['map'](_0x3d8d67[_0xa570('0x26')],function(_0x1e9a04){return{'model':db[_0x1e9a04['model']],'as':_0x1e9a04['as'],'attributes':_0x1e9a04[_0xa570('0x25')]};}):[]};}):[]};}):[]:[]})[_0xa570('0x14')](function(_0x25d69e){logger[_0xa570('0x15')]('GetFaxAccount',_0x5cbfb5);logger[_0xa570('0x16')](_0xa570('0x1f'),_0x5cbfb5,JSON[_0xa570('0x18')](_0x25d69e));_0x413de8(_0x25d69e);})[_0xa570('0x1e')](function(_0x48dd19){logger['error'](_0xa570('0x1f'),_0x48dd19[_0xa570('0x1c')],_0x5cbfb5);_0x37f748(_0x1e10fe['error'](0x1f4,_0x48dd19['message']));});});};exports['NotifyFaxAccount']=function(_0x30ac59,_0x1e8907,_0x278d14){var _0x269e35=this;return new Promise(function(_0x4dc16d,_0x516297){var _0x663a20={'body':_0x30ac59['body'],'channel':_0xa570('0x29')};var _0x347c39=[];var _0x167601=[];var _0x2aa653={};return db[_0xa570('0x2a')]['describe']()[_0xa570('0x14')](function(_0x451c93){if(!_0x451c93){throw new db[(_0xa570('0x2b'))][(_0xa570('0x2c'))](_0xa570('0x2d'));}_0x347c39=_[_0xa570('0x2e')](_['keys'](_0x451c93),['createdAt',_0xa570('0x2f')]);_0x167601=_[_0xa570('0x2e')](_['keys'](_0x451c93),[_0xa570('0x30'),'updatedAt',_0xa570('0x31'),_0xa570('0x32')]);if(_0x30ac59[_0xa570('0x33')]['id']){delete _0x30ac59[_0xa570('0x33')]['id'];}if(_[_0xa570('0x34')](_0x30ac59[_0xa570('0x33')][_0xa570('0x35')])){throw new db[(_0xa570('0x2b'))][(_0xa570('0x2c'))](_0xa570('0x36'));}if(_['isNil'](_0x30ac59['body'][_0xa570('0x33')])||_0x30ac59[_0xa570('0x33')][_0xa570('0x33')]===''){throw new db[(_0xa570('0x2b'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa570('0x34')](_0x30ac59[_0xa570('0x33')][_0xa570('0x37')])){throw new db['Sequelize'][(_0xa570('0x2c'))](_0xa570('0x38')+_0x167601);}if(!_[_0xa570('0x39')](_0x167601,_0x30ac59[_0xa570('0x33')]['mapKey'])){throw new db[(_0xa570('0x2b'))][(_0xa570('0x2c'))](_0xa570('0x3a')+_0x167601);}_0x2aa653[_0x30ac59[_0xa570('0x33')][_0xa570('0x37')]]=_0x30ac59[_0xa570('0x33')][_0xa570('0x35')];})['then'](function(){return db[_0xa570('0x20')][_0xa570('0x3b')]({'where':{'id':_0x30ac59[_0xa570('0x3c')]['id']},'include':[{'model':db[_0xa570('0x3d')],'as':_0xa570('0x3e'),'include':[{'model':db['CmContact'],'as':_0xa570('0x3f'),'where':_0x2aa653,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xa570('0x40')],'as':_0xa570('0x41')}]});})[_0xa570('0x14')](function(_0x589e71){if(_0x589e71&&_0x589e71['List']){var _0x424d1f=_0x589e71[_0xa570('0x42')]({'plain':!![]});_0x663a20[_0xa570('0x3c')]=_0x424d1f;_0x663a20['applications']=_0x424d1f[_0xa570('0x41')];_0x663a20[_0xa570('0x43')]=_0x424d1f['List'];_0x663a20[_0xa570('0x44')]=_[_0xa570('0x45')](_0x663a20[_0xa570('0x44')],['priority'],[_0xa570('0x46')]);if(_0x663a20[_0xa570('0x3c')]['Applications']){delete _0x663a20[_0xa570('0x3c')][_0xa570('0x41')];}if(_0x663a20['account'][_0xa570('0x3e')]&&_0x663a20[_0xa570('0x3c')][_0xa570('0x3e')][_0xa570('0x3f')][_0xa570('0x47')]){return _0x663a20[_0xa570('0x3c')][_0xa570('0x3e')][_0xa570('0x3f')][0x0];}var _0x38163c=_['defaults'](_0x30ac59[_0xa570('0x33')],{'firstName':_0x30ac59[_0xa570('0x33')][_0xa570('0x35')],'ListId':_0x424d1f[_0xa570('0x32')]});_0x38163c[_0x30ac59['body'][_0xa570('0x37')]]=_0x30ac59[_0xa570('0x33')]['from'];return db[_0xa570('0x2a')]['create'](_0x38163c,{'fields':_0x347c39,'raw':!![]});}})['then'](function(_0x287ea9){_0x663a20[_0xa570('0x48')]=_0x287ea9;if(_0x287ea9){var _0x5652cc={'ContactId':_0x287ea9['id'],'FaxAccountId':_0x30ac59['account']['id'],'fax':_0x287ea9[_0xa570('0x29')]};return db[_0xa570('0x49')][_0xa570('0x3b')]({'where':{'ContactId':_0x287ea9['id'],'closed':![],'FaxAccountId':_0x30ac59['account']['id']}})[_0xa570('0x14')](function(_0x1714b1){if(_0x1714b1){return[_0x1714b1,![]];}return db[_0xa570('0x49')]['create'](_0x5652cc)[_0xa570('0x14')](function(_0xe1c883){return[_0xe1c883,!![]];});});}else{throw new Error(_0xa570('0x4a'));}})[_0xa570('0x4b')](function(_0x44d951,_0x2e7e1e){var _0x197193=_0x44d951[_0xa570('0x42')]({'plain':!![]});if(_0x2e7e1e){if(_0x663a20[_0xa570('0x3c')][_0xa570('0x4c')]){_0x663a20['applications'][_0xa570('0x4d')]({'id':0x0,'priority':_0x663a20['applications']['length']+0x1,'app':_0xa570('0x4e'),'appdata':'unmanaged','interval':_0xa570('0x4f')});}_0x197193[_0xa570('0x50')]=!![];}else{_0x197193['created']=![];}_0x663a20[_0xa570('0x51')]=_0x197193;return db[_0xa570('0x52')]['create']({'body':_0x30ac59['body'][_0xa570('0x33')],'FaxAccountId':_0x30ac59[_0xa570('0x3c')]['id'],'FaxInteractionId':_0x44d951['id'],'direction':'in','ContactId':_0x44d951[_0xa570('0x53')],'AttachmentId':_0x30ac59['body']['AttachmentId']});})[_0xa570('0x14')](function(_0x4eb6f2){_0x663a20[_0xa570('0x1c')]=_0x4eb6f2;if(_0x663a20[_0xa570('0x51')][_0xa570('0x54')]){return db[_0xa570('0x55')][_0xa570('0x3b')]({'attributes':['id',_0xa570('0x56')],'where':{'id':_0x663a20[_0xa570('0x51')][_0xa570('0x54')]}})[_0xa570('0x14')](function(_0x5c6037){if(_0x5c6037){_0x663a20[_0xa570('0x44')]['unshift']({'id':0x0,'priority':0x0,'app':_0xa570('0x57'),'appdata':_0x5c6037[_0xa570('0x56')]+','+(_0x663a20[_0xa570('0x3c')][_0xa570('0x58')]||0xa),'interval':_0xa570('0x4f')});}return respondWithRpcPromise(_0xa570('0x59'),_0xa570('0x5a'),_0x663a20);});}return respondWithRpcPromise('Start',_0xa570('0x5a'),_0x663a20);})[_0xa570('0x14')](function(_0x3c88d9){_0x4dc16d(_0x3c88d9);})[_0xa570('0x1e')](function(_0xa829c9){_0x516297(_0x269e35[_0xa570('0x19')](0x1f4,_0xa829c9[_0xa570('0x1c')]));});});}; \ No newline at end of file +var _0x30ea=['priority','asc','length','defaults','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','name','unshift','agent','Start','startRouting','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','code','error','message','result','catch','GetFaxAccount','FaxAccount','options','raw','where','limit','include','model','attributes','map','stringify','NotifyFaxAccount','body','fax','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','CmList','List','Contacts','get','account','applications','Applications','list','orderBy'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x30ea,0x1d6));var _0xa30e=function(_0x1106a6,_0x332de6){_0x1106a6=_0x1106a6-0x0;var _0x2af2b8=_0x30ea[_0x1106a6];return _0x2af2b8;};'use strict';var _=require('lodash');var util=require(_0xa30e('0x0'));var moment=require(_0xa30e('0x1'));var BPromise=require('bluebird');var rs=require(_0xa30e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa30e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa30e('0x4'))(_0xa30e('0x5'));var config=require('../../config/environment');var jayson=require(_0xa30e('0x6'));var client=jayson[_0xa30e('0x7')][_0xa30e('0x8')]({'port':0x232c});config[_0xa30e('0x9')]=_['defaults'](config[_0xa30e('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xa30e('0xa'))(new Redis(config[_0xa30e('0x9')]));require(_0xa30e('0xb'))[_0xa30e('0xc')](socket);function respondWithRpcPromise(_0x2288ed,_0x59d999,_0x3844af){return new BPromise(function(_0x6c9e02,_0x16405f){return client[_0xa30e('0xd')](_0x2288ed,_0x3844af)[_0xa30e('0xe')](function(_0x1f12c2){logger[_0xa30e('0xf')](_0xa30e('0x10'),_0x59d999,_0xa30e('0x11'));logger[_0xa30e('0x12')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x59d999,_0xa30e('0x11'),JSON['stringify'](_0x1f12c2));if(_0x1f12c2['error']){if(_0x1f12c2['error'][_0xa30e('0x13')]===0x1f4){logger[_0xa30e('0x14')](_0xa30e('0x10'),_0x59d999,_0x1f12c2[_0xa30e('0x14')][_0xa30e('0x15')]);return _0x16405f(_0x1f12c2[_0xa30e('0x14')][_0xa30e('0x15')]);}logger['error'](_0xa30e('0x10'),_0x59d999,_0x1f12c2[_0xa30e('0x14')]['message']);return _0x6c9e02(_0x1f12c2[_0xa30e('0x14')][_0xa30e('0x15')]);}else{logger[_0xa30e('0xf')]('FaxAccount,\x20%s,\x20%s',_0x59d999,_0xa30e('0x11'));_0x6c9e02(_0x1f12c2[_0xa30e('0x16')]['message']);}})[_0xa30e('0x17')](function(_0x2ea6d6){logger[_0xa30e('0x14')]('FaxAccount,\x20%s,\x20%s',_0x59d999,_0x2ea6d6);_0x16405f(_0x2ea6d6);});});}exports[_0xa30e('0x18')]=function(_0x5b7a4b){var _0x51c5bb=this;return new Promise(function(_0x32ebc0,_0x74b4ff){return db[_0xa30e('0x19')]['findAll']({'raw':_0x5b7a4b[_0xa30e('0x1a')]?_0x5b7a4b[_0xa30e('0x1a')][_0xa30e('0x1b')]===undefined?!![]:![]:!![],'where':_0x5b7a4b[_0xa30e('0x1a')]?_0x5b7a4b['options'][_0xa30e('0x1c')]||null:null,'attributes':_0x5b7a4b[_0xa30e('0x1a')]?_0x5b7a4b[_0xa30e('0x1a')]['attributes']||null:null,'limit':_0x5b7a4b['options']?_0x5b7a4b[_0xa30e('0x1a')][_0xa30e('0x1d')]||null:null,'include':_0x5b7a4b['options']?_0x5b7a4b[_0xa30e('0x1a')][_0xa30e('0x1e')]?_['map'](_0x5b7a4b[_0xa30e('0x1a')][_0xa30e('0x1e')],function(_0x544a46){return{'model':db[_0x544a46[_0xa30e('0x1f')]],'as':_0x544a46['as'],'attributes':_0x544a46[_0xa30e('0x20')],'include':_0x544a46[_0xa30e('0x1e')]?_[_0xa30e('0x21')](_0x544a46[_0xa30e('0x1e')],function(_0x4ec794){return{'model':db[_0x4ec794[_0xa30e('0x1f')]],'as':_0x4ec794['as'],'attributes':_0x4ec794[_0xa30e('0x20')],'include':_0x4ec794[_0xa30e('0x1e')]?_[_0xa30e('0x21')](_0x4ec794[_0xa30e('0x1e')],function(_0x3a3b8d){return{'model':db[_0x3a3b8d[_0xa30e('0x1f')]],'as':_0x3a3b8d['as'],'attributes':_0x3a3b8d[_0xa30e('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e1c13){logger[_0xa30e('0xf')]('GetFaxAccount',_0x5b7a4b);logger[_0xa30e('0x12')]('GetFaxAccount',_0x5b7a4b,JSON[_0xa30e('0x22')](_0x2e1c13));_0x32ebc0(_0x2e1c13);})[_0xa30e('0x17')](function(_0x4d93d4){logger[_0xa30e('0x14')](_0xa30e('0x18'),_0x4d93d4['message'],_0x5b7a4b);_0x74b4ff(_0x51c5bb[_0xa30e('0x14')](0x1f4,_0x4d93d4[_0xa30e('0x15')]));});});};exports[_0xa30e('0x23')]=function(_0x1f8887,_0x9a80cc,_0xdbbc3f){var _0x214f1e=this;return new Promise(function(_0xbe8e93,_0x3bd4f0){var _0x1dc2ae={'body':_0x1f8887[_0xa30e('0x24')],'channel':_0xa30e('0x25')};var _0x85cfe8=[];var _0x3a34b8=[];var _0x55f78e={};return db[_0xa30e('0x26')]['describe']()[_0xa30e('0xe')](function(_0x57beb3){if(!_0x57beb3){throw new db[(_0xa30e('0x27'))][(_0xa30e('0x28'))](_0xa30e('0x29'));}_0x85cfe8=_[_0xa30e('0x2a')](_[_0xa30e('0x2b')](_0x57beb3),['createdAt',_0xa30e('0x2c')]);_0x3a34b8=_['difference'](_[_0xa30e('0x2b')](_0x57beb3),['createdAt',_0xa30e('0x2c'),'CompanyId',_0xa30e('0x2d')]);if(_0x1f8887[_0xa30e('0x24')]['id']){delete _0x1f8887[_0xa30e('0x24')]['id'];}if(_[_0xa30e('0x2e')](_0x1f8887[_0xa30e('0x24')][_0xa30e('0x2f')])){throw new db['Sequelize'][(_0xa30e('0x28'))](_0xa30e('0x30'));}if(_[_0xa30e('0x2e')](_0x1f8887[_0xa30e('0x24')][_0xa30e('0x24')])||_0x1f8887['body'][_0xa30e('0x24')]===''){throw new db['Sequelize']['ValidationError'](_0xa30e('0x31'));}if(_[_0xa30e('0x2e')](_0x1f8887[_0xa30e('0x24')][_0xa30e('0x32')])){throw new db[(_0xa30e('0x27'))][(_0xa30e('0x28'))](_0xa30e('0x33')+_0x3a34b8);}if(!_[_0xa30e('0x34')](_0x3a34b8,_0x1f8887['body'][_0xa30e('0x32')])){throw new db[(_0xa30e('0x27'))][(_0xa30e('0x28'))](_0xa30e('0x35')+_0x3a34b8);}_0x55f78e[_0x1f8887[_0xa30e('0x24')][_0xa30e('0x32')]]=_0x1f8887[_0xa30e('0x24')][_0xa30e('0x2f')];})[_0xa30e('0xe')](function(){return db[_0xa30e('0x19')][_0xa30e('0x36')]({'where':{'id':_0x1f8887['account']['id']},'include':[{'model':db[_0xa30e('0x37')],'as':_0xa30e('0x38'),'include':[{'model':db['CmContact'],'as':_0xa30e('0x39'),'where':_0x55f78e,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['FaxApplication'],'as':'Applications'}]});})[_0xa30e('0xe')](function(_0x575fb0){if(_0x575fb0&&_0x575fb0[_0xa30e('0x38')]){var _0x2de280=_0x575fb0[_0xa30e('0x3a')]({'plain':!![]});_0x1dc2ae[_0xa30e('0x3b')]=_0x2de280;_0x1dc2ae[_0xa30e('0x3c')]=_0x2de280[_0xa30e('0x3d')];_0x1dc2ae[_0xa30e('0x3e')]=_0x2de280[_0xa30e('0x38')];_0x1dc2ae['applications']=_[_0xa30e('0x3f')](_0x1dc2ae[_0xa30e('0x3c')],[_0xa30e('0x40')],[_0xa30e('0x41')]);if(_0x1dc2ae[_0xa30e('0x3b')][_0xa30e('0x3d')]){delete _0x1dc2ae[_0xa30e('0x3b')][_0xa30e('0x3d')];}if(_0x1dc2ae[_0xa30e('0x3b')][_0xa30e('0x38')]&&_0x1dc2ae['account'][_0xa30e('0x38')][_0xa30e('0x39')][_0xa30e('0x42')]){return _0x1dc2ae[_0xa30e('0x3b')][_0xa30e('0x38')][_0xa30e('0x39')][0x0];}var _0x207eae=_[_0xa30e('0x43')](_0x1f8887[_0xa30e('0x24')],{'firstName':_0x1f8887[_0xa30e('0x24')][_0xa30e('0x2f')],'ListId':_0x2de280[_0xa30e('0x2d')]});_0x207eae[_0x1f8887[_0xa30e('0x24')][_0xa30e('0x32')]]=_0x1f8887[_0xa30e('0x24')]['from'];return db[_0xa30e('0x26')][_0xa30e('0x44')](_0x207eae,{'fields':_0x85cfe8,'raw':!![]});}})[_0xa30e('0xe')](function(_0x20b1df){_0x1dc2ae[_0xa30e('0x45')]=_0x20b1df;if(_0x20b1df){var _0x174bde={'ContactId':_0x20b1df['id'],'FaxAccountId':_0x1f8887[_0xa30e('0x3b')]['id'],'fax':_0x20b1df[_0xa30e('0x25')]};return db[_0xa30e('0x46')]['find']({'where':{'ContactId':_0x20b1df['id'],'closed':![],'FaxAccountId':_0x1f8887[_0xa30e('0x3b')]['id']}})[_0xa30e('0xe')](function(_0x1e0de3){if(_0x1e0de3){return[_0x1e0de3,![]];}return db[_0xa30e('0x46')][_0xa30e('0x44')](_0x174bde)[_0xa30e('0xe')](function(_0x1227d1){return[_0x1227d1,!![]];});});}else{throw new Error(_0xa30e('0x47'));}})[_0xa30e('0x48')](function(_0x1079fd,_0x4580bc){var _0x56a2a3=_0x1079fd['get']({'plain':!![]});if(_0x4580bc){if(_0x1dc2ae[_0xa30e('0x3b')][_0xa30e('0x49')]){_0x1dc2ae[_0xa30e('0x3c')][_0xa30e('0x4a')]({'id':0x0,'priority':_0x1dc2ae[_0xa30e('0x3c')]['length']+0x1,'app':_0xa30e('0x4b'),'appdata':_0xa30e('0x4c'),'interval':_0xa30e('0x4d')});}_0x56a2a3[_0xa30e('0x4e')]=!![];}else{_0x56a2a3[_0xa30e('0x4e')]=![];}_0x1dc2ae[_0xa30e('0x4f')]=_0x56a2a3;return db[_0xa30e('0x50')][_0xa30e('0x44')]({'body':_0x1f8887[_0xa30e('0x24')][_0xa30e('0x24')],'FaxAccountId':_0x1f8887[_0xa30e('0x3b')]['id'],'FaxInteractionId':_0x1079fd['id'],'direction':'in','ContactId':_0x1079fd[_0xa30e('0x51')],'AttachmentId':_0x1f8887[_0xa30e('0x24')][_0xa30e('0x52')]});})['then'](function(_0x5d451f){_0x1dc2ae[_0xa30e('0x15')]=_0x5d451f;if(_0x1dc2ae[_0xa30e('0x4f')][_0xa30e('0x53')]){return db['User'][_0xa30e('0x36')]({'attributes':['id',_0xa30e('0x54')],'where':{'id':_0x1dc2ae[_0xa30e('0x4f')][_0xa30e('0x53')]}})[_0xa30e('0xe')](function(_0x20cee1){if(_0x20cee1){_0x1dc2ae[_0xa30e('0x3c')][_0xa30e('0x55')]({'id':0x0,'priority':0x0,'app':_0xa30e('0x56'),'appdata':_0x20cee1['name']+','+(_0x1dc2ae[_0xa30e('0x3b')]['waitForTheAssignedAgent']||0xa),'interval':_0xa30e('0x4d')});}return respondWithRpcPromise(_0xa30e('0x57'),'startRouting',_0x1dc2ae);});}return respondWithRpcPromise(_0xa30e('0x57'),_0xa30e('0x58'),_0x1dc2ae);})['then'](function(_0x35ec24){_0xbe8e93(_0x35ec24);})[_0xa30e('0x17')](function(_0x2eccfe){_0x3bd4f0(_0x214f1e[_0xa30e('0x14')](0x1f4,_0x2eccfe['message']));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index f3701a3..909450c 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 _0x1311=['faxAccount:','./faxAccount.events','save','remove','update','emit','removeListener','register'];(function(_0x59b439,_0x14ae7b){var _0x521ea3=function(_0x5af627){while(--_0x5af627){_0x59b439['push'](_0x59b439['shift']());}};_0x521ea3(++_0x14ae7b);}(_0x1311,0x171));var _0x1131=function(_0x3fd172,_0x3b686b){_0x3fd172=_0x3fd172-0x0;var _0x223e78=_0x1311[_0x3fd172];return _0x223e78;};'use strict';var FaxAccountEvents=require(_0x1131('0x0'));var events=[_0x1131('0x1'),_0x1131('0x2'),_0x1131('0x3')];function createListener(_0x424a98,_0x202c93){return function(_0x1187c3){_0x202c93[_0x1131('0x4')](_0x424a98,_0x1187c3);};}function removeListener(_0x79dd5,_0x26cd02){return function(){FaxAccountEvents[_0x1131('0x5')](_0x79dd5,_0x26cd02);};}exports[_0x1131('0x6')]=function(_0x477459){for(var _0x195c30=0x0,_0x4ff0bc=events['length'];_0x195c30<_0x4ff0bc;_0x195c30++){var _0x108189=events[_0x195c30];var _0x1ffbbe=createListener(_0x1131('0x7')+_0x108189,_0x477459);FaxAccountEvents['on'](_0x108189,_0x1ffbbe);}}; \ No newline at end of file +var _0x18ee=['faxAccount:','remove','update','emit'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x18ee,0x1dd));var _0xe18e=function(_0x55e0ce,_0x153e58){_0x55e0ce=_0x55e0ce-0x0;var _0x5223b2=_0x18ee[_0x55e0ce];return _0x5223b2;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=['save',_0xe18e('0x0'),_0xe18e('0x1')];function createListener(_0x3357fc,_0x20fa86){return function(_0x5a76af){_0x20fa86[_0xe18e('0x2')](_0x3357fc,_0x5a76af);};}function removeListener(_0x236c29,_0x203947){return function(){FaxAccountEvents['removeListener'](_0x236c29,_0x203947);};}exports['register']=function(_0x451e1d){for(var _0x42a23f=0x0,_0x411b66=events['length'];_0x42a23f<_0x411b66;_0x42a23f++){var _0x25b22b=events[_0x42a23f];var _0x2b433d=createListener(_0xe18e('0x3')+_0x25b22b,_0x451e1d);FaxAccountEvents['on'](_0x25b22b,_0x2b433d);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 7a8396a..b87d0ea 100644 --- a/server/api/faxAccount/index.js +++ b/server/api/faxAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x23d102,_0x48c3c4){var _0x13ef8a=function(_0x1316e1){while(--_0x1316e1){_0x23d102['push'](_0x23d102['shift']());}};_0x13ef8a(++_0x48c3c4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x565292,_0x57eb92){var _0x521b61=function(_0x123434){while(--_0x123434){_0x565292['push'](_0x565292['shift']());}};_0x521b61(++_0x57eb92);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index be9395c..2487dc0 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 _0x7e74=['TEXT','*,*,*,*','exports','INTEGER','STRING','noop'];(function(_0x1c5ae6,_0x30f2bd){var _0x4623f3=function(_0x25d2dd){while(--_0x25d2dd){_0x1c5ae6['push'](_0x1c5ae6['shift']());}};_0x4623f3(++_0x30f2bd);}(_0x7e74,0x140));var _0x47e7=function(_0x2760e2,_0x2ba7f2){_0x2760e2=_0x2760e2-0x0;var _0x5e4d5b=_0x7e74[_0x2760e2];return _0x5e4d5b;};'use strict';var Sequelize=require('sequelize');module[_0x47e7('0x0')]={'priority':{'type':Sequelize[_0x47e7('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x47e7('0x2')],'allowNull':![],'defaultValue':_0x47e7('0x3')},'appdata':{'type':Sequelize[_0x47e7('0x4')]()},'description':{'type':Sequelize[_0x47e7('0x2')]},'interval':{'type':Sequelize[_0x47e7('0x2')],'defaultValue':_0x47e7('0x5')}}; \ No newline at end of file +var _0x40fd=['STRING','*,*,*,*','sequelize','INTEGER'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x40fd,0x17e));var _0xd40f=function(_0x3c1b2d,_0x23b1b9){_0x3c1b2d=_0x3c1b2d-0x0;var _0x412475=_0x40fd[_0x3c1b2d];return _0x412475;};'use strict';var Sequelize=require(_0xd40f('0x0'));module['exports']={'priority':{'type':Sequelize[_0xd40f('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xd40f('0x2')]},'interval':{'type':Sequelize[_0xd40f('0x2')],'defaultValue':_0xd40f('0x3')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index ac13511..ef8cdec 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 _0x0b3c=['count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','map','FaxApplication','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','show','keys','include','find','catch','create','body','update','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit'];(function(_0x36e730,_0x4a0648){var _0x2537a0=function(_0x3bc550){while(--_0x3bc550){_0x36e730['push'](_0x36e730['shift']());}};_0x2537a0(++_0x4a0648);}(_0x0b3c,0x1ea));var _0xc0b3=function(_0x5e37f6,_0x508bde){_0x5e37f6=_0x5e37f6-0x0;var _0x1a5c73=_0x0b3c[_0x5e37f6];return _0x1a5c73;};'use strict';var emlformat=require(_0xc0b3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc0b3('0x1'));var jsonpatch=require(_0xc0b3('0x2'));var rp=require(_0xc0b3('0x3'));var moment=require(_0xc0b3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc0b3('0x5'));var util=require(_0xc0b3('0x6'));var path=require(_0xc0b3('0x7'));var sox=require(_0xc0b3('0x8'));var csv=require(_0xc0b3('0x9'));var ejs=require(_0xc0b3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc0b3('0xb'));var squel=require(_0xc0b3('0xc'));var crypto=require(_0xc0b3('0xd'));var jsforce=require(_0xc0b3('0xe'));var deskjs=require(_0xc0b3('0xf'));var toCsv=require(_0xc0b3('0x9'));var querystring=require(_0xc0b3('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc0b3('0x11'));var as=require(_0xc0b3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc0b3('0x13'))(_0xc0b3('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc0b3('0x15'))['db'];function respondWithStatusCode(_0x42a8c5,_0x252a22){_0x252a22=_0x252a22||0xcc;return function(_0x35325c){if(_0x35325c){return _0x42a8c5[_0xc0b3('0x16')](_0x252a22);}return _0x42a8c5[_0xc0b3('0x17')](_0x252a22)[_0xc0b3('0x18')]();};}function respondWithResult(_0x46d691,_0x278348){_0x278348=_0x278348||0xc8;return function(_0x2a03dc){if(_0x2a03dc){return _0x46d691['status'](_0x278348)['json'](_0x2a03dc);}};}function respondWithFilteredResult(_0x2d5ee8,_0x4f7943){return function(_0x2c6192){if(_0x2c6192){var _0x19e5d4=typeof _0x4f7943[_0xc0b3('0x19')]===_0xc0b3('0x1a')&&typeof _0x4f7943[_0xc0b3('0x1b')]===_0xc0b3('0x1a');var _0x84da93=_0x2c6192['count'];var _0xa4484=_0x19e5d4?0x0:_0x4f7943[_0xc0b3('0x19')];var _0x3a6e8a=_0x19e5d4?_0x2c6192[_0xc0b3('0x1c')]:_0x4f7943[_0xc0b3('0x19')]+_0x4f7943['limit'];var _0x24f7e0;if(_0x3a6e8a>=_0x84da93){_0x3a6e8a=_0x84da93;_0x24f7e0=0xc8;}else{_0x24f7e0=0xce;}_0x2d5ee8[_0xc0b3('0x17')](_0x24f7e0);return _0x2d5ee8[_0xc0b3('0x1d')](_0xc0b3('0x1e'),_0xa4484+'-'+_0x3a6e8a+'/'+_0x84da93)[_0xc0b3('0x1f')](_0x2c6192);}return null;};}function patchUpdates(_0x3c7dc4){return function(_0x48ec19){try{jsonpatch[_0xc0b3('0x20')](_0x48ec19,_0x3c7dc4,!![]);}catch(_0x43038e){return BPromise[_0xc0b3('0x21')](_0x43038e);}return _0x48ec19[_0xc0b3('0x22')]();};}function saveUpdates(_0x118685,_0x3bf68e){return function(_0x1b1575){if(_0x1b1575){return _0x1b1575['update'](_0x118685)[_0xc0b3('0x23')](function(_0x108c57){return _0x108c57;});}return null;};}function removeEntity(_0x101d2b,_0xe1f700){return function(_0x20f89f){if(_0x20f89f){return _0x20f89f[_0xc0b3('0x24')]()[_0xc0b3('0x23')](function(){_0x101d2b[_0xc0b3('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x542329,_0x33bf11){return function(_0x2e7538){if(!_0x2e7538){_0x542329[_0xc0b3('0x16')](0x194);}return _0x2e7538;};}function handleError(_0x18fcd9,_0x187842){_0x187842=_0x187842||0x1f4;return function(_0x1a36a8){logger[_0xc0b3('0x25')](_0x1a36a8[_0xc0b3('0x26')]);if(_0x1a36a8[_0xc0b3('0x27')]){delete _0x1a36a8[_0xc0b3('0x27')];}_0x18fcd9[_0xc0b3('0x17')](_0x187842)[_0xc0b3('0x28')](_0x1a36a8);};}exports['index']=function(_0x4875d2,_0x47e942){var _0x159ef3={},_0x5cfc0e={},_0x457882={'count':0x0,'rows':[]};var _0x265618=_[_0xc0b3('0x29')](db[_0xc0b3('0x2a')][_0xc0b3('0x2b')],function(_0xc5a965){return{'name':_0xc5a965[_0xc0b3('0x2c')],'type':_0xc5a965[_0xc0b3('0x2d')][_0xc0b3('0x2e')]};});_0x5cfc0e['model']=_['map'](_0x265618,_0xc0b3('0x27'));_0x5cfc0e[_0xc0b3('0x2f')]=_['keys'](_0x4875d2[_0xc0b3('0x2f')]);_0x5cfc0e[_0xc0b3('0x30')]=_['intersection'](_0x5cfc0e[_0xc0b3('0x31')],_0x5cfc0e[_0xc0b3('0x2f')]);_0x159ef3[_0xc0b3('0x32')]=_[_0xc0b3('0x33')](_0x5cfc0e[_0xc0b3('0x31')],qs[_0xc0b3('0x34')](_0x4875d2[_0xc0b3('0x2f')][_0xc0b3('0x34')]));_0x159ef3[_0xc0b3('0x32')]=_0x159ef3[_0xc0b3('0x32')][_0xc0b3('0x35')]?_0x159ef3[_0xc0b3('0x32')]:_0x5cfc0e[_0xc0b3('0x31')];if(!_0x4875d2[_0xc0b3('0x2f')][_0xc0b3('0x36')](_0xc0b3('0x37'))){_0x159ef3[_0xc0b3('0x1b')]=qs[_0xc0b3('0x1b')](_0x4875d2['query']['limit']);_0x159ef3[_0xc0b3('0x19')]=qs[_0xc0b3('0x19')](_0x4875d2['query'][_0xc0b3('0x19')]);}_0x159ef3[_0xc0b3('0x38')]=qs[_0xc0b3('0x39')](_0x4875d2[_0xc0b3('0x2f')][_0xc0b3('0x39')]);_0x159ef3[_0xc0b3('0x3a')]=qs[_0xc0b3('0x30')](_[_0xc0b3('0x3b')](_0x4875d2[_0xc0b3('0x2f')],_0x5cfc0e[_0xc0b3('0x30')]),_0x265618);if(_0x4875d2[_0xc0b3('0x2f')]['filter']){_0x159ef3[_0xc0b3('0x3a')]=_['merge'](_0x159ef3[_0xc0b3('0x3a')],{'$or':_[_0xc0b3('0x29')](_0x265618,function(_0x17dd7a){if(_0x17dd7a[_0xc0b3('0x2d')]!==_0xc0b3('0x3c')){var _0x5d4c7b={};_0x5d4c7b[_0x17dd7a['name']]={'$like':'%'+_0x4875d2[_0xc0b3('0x2f')][_0xc0b3('0x3d')]+'%'};return _0x5d4c7b;}})});}_0x159ef3=_[_0xc0b3('0x3e')]({},_0x159ef3,_0x4875d2[_0xc0b3('0x3f')]);var _0x343c67={'where':_0x159ef3['where']};return db[_0xc0b3('0x2a')]['count'](_0x343c67)[_0xc0b3('0x23')](function(_0x1c8049){_0x457882[_0xc0b3('0x1c')]=_0x1c8049;if(_0x4875d2[_0xc0b3('0x2f')][_0xc0b3('0x40')]){_0x159ef3['include']=[{'all':!![]}];}return db[_0xc0b3('0x2a')]['findAll'](_0x159ef3);})['then'](function(_0xf6a602){_0x457882['rows']=_0xf6a602;return _0x457882;})[_0xc0b3('0x23')](respondWithFilteredResult(_0x47e942,_0x159ef3))['catch'](handleError(_0x47e942,null));};exports[_0xc0b3('0x41')]=function(_0x54b2bb,_0x2a8c05){var _0x23bed2={'raw':!![],'where':{'id':_0x54b2bb['params']['id']}},_0x12a880={};_0x12a880['model']=_['keys'](db[_0xc0b3('0x2a')][_0xc0b3('0x2b')]);_0x12a880[_0xc0b3('0x2f')]=_[_0xc0b3('0x42')](_0x54b2bb[_0xc0b3('0x2f')]);_0x12a880[_0xc0b3('0x30')]=_['intersection'](_0x12a880[_0xc0b3('0x31')],_0x12a880[_0xc0b3('0x2f')]);_0x23bed2[_0xc0b3('0x32')]=_[_0xc0b3('0x33')](_0x12a880['model'],qs[_0xc0b3('0x34')](_0x54b2bb[_0xc0b3('0x2f')]['fields']));_0x23bed2[_0xc0b3('0x32')]=_0x23bed2[_0xc0b3('0x32')]['length']?_0x23bed2['attributes']:_0x12a880[_0xc0b3('0x31')];if(_0x54b2bb[_0xc0b3('0x2f')][_0xc0b3('0x40')]){_0x23bed2[_0xc0b3('0x43')]=[{'all':!![]}];}_0x23bed2=_[_0xc0b3('0x3e')]({},_0x23bed2,_0x54b2bb['options']);return db[_0xc0b3('0x2a')][_0xc0b3('0x44')](_0x23bed2)[_0xc0b3('0x23')](handleEntityNotFound(_0x2a8c05,null))[_0xc0b3('0x23')](respondWithResult(_0x2a8c05,null))[_0xc0b3('0x45')](handleError(_0x2a8c05,null));};exports['create']=function(_0x3bd55d,_0x2a0664){return db[_0xc0b3('0x2a')][_0xc0b3('0x46')](_0x3bd55d[_0xc0b3('0x47')],{})['then'](respondWithResult(_0x2a0664,0xc9))['catch'](handleError(_0x2a0664,null));};exports[_0xc0b3('0x48')]=function(_0x371f70,_0x2e1794){if(_0x371f70['body']['id']){delete _0x371f70[_0xc0b3('0x47')]['id'];}return db[_0xc0b3('0x2a')][_0xc0b3('0x44')]({'where':{'id':_0x371f70[_0xc0b3('0x49')]['id']}})[_0xc0b3('0x23')](handleEntityNotFound(_0x2e1794,null))['then'](saveUpdates(_0x371f70[_0xc0b3('0x47')],null))['then'](respondWithResult(_0x2e1794,null))['catch'](handleError(_0x2e1794,null));};exports[_0xc0b3('0x24')]=function(_0xe39af0,_0x3ee556){return db[_0xc0b3('0x2a')]['find']({'where':{'id':_0xe39af0[_0xc0b3('0x49')]['id']}})['then'](handleEntityNotFound(_0x3ee556,null))[_0xc0b3('0x23')](removeEntity(_0x3ee556,null))[_0xc0b3('0x45')](handleError(_0x3ee556,null));}; \ No newline at end of file +var _0x5b39=['key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','length','find','create','body','params','eml-format','rimraf','zip-dir','request-promise','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','status','error','stack','name','send','index','FaxApplication','rawAttributes'];(function(_0x867414,_0x5f1ad1){var _0x33c789=function(_0x2bdbed){while(--_0x2bdbed){_0x867414['push'](_0x867414['shift']());}};_0x33c789(++_0x5f1ad1);}(_0x5b39,0xad));var _0x95b3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5b39[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x95b3('0x0'));var rimraf=require(_0x95b3('0x1'));var zipdir=require(_0x95b3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x95b3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x95b3('0x4'));var util=require(_0x95b3('0x5'));var path=require('path');var sox=require(_0x95b3('0x6'));var csv=require(_0x95b3('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x95b3('0x8'));var _=require(_0x95b3('0x9'));var squel=require(_0x95b3('0xa'));var crypto=require(_0x95b3('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x95b3('0xc'));var toCsv=require(_0x95b3('0x7'));var querystring=require('querystring');var Papa=require(_0x95b3('0xd'));var Redis=require(_0x95b3('0xe'));var authService=require(_0x95b3('0xf'));var qs=require(_0x95b3('0x10'));var as=require(_0x95b3('0x11'));var hardwareService=require(_0x95b3('0x12'));var logger=require(_0x95b3('0x13'))(_0x95b3('0x14'));var utils=require(_0x95b3('0x15'));var config=require(_0x95b3('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x95b3('0x17'))['db'];function respondWithStatusCode(_0x1bbd37,_0x4a3717){_0x4a3717=_0x4a3717||0xcc;return function(_0x1b923a){if(_0x1b923a){return _0x1bbd37[_0x95b3('0x18')](_0x4a3717);}return _0x1bbd37['status'](_0x4a3717)[_0x95b3('0x19')]();};}function respondWithResult(_0x20d5af,_0x5a7018){_0x5a7018=_0x5a7018||0xc8;return function(_0x754dca){if(_0x754dca){return _0x20d5af['status'](_0x5a7018)[_0x95b3('0x1a')](_0x754dca);}};}function respondWithFilteredResult(_0x4ee0f6,_0x171572){return function(_0x229d8c){if(_0x229d8c){var _0x45374d=typeof _0x171572[_0x95b3('0x1b')]===_0x95b3('0x1c')&&typeof _0x171572['limit']===_0x95b3('0x1c');var _0x50c8a7=_0x229d8c['count'];var _0x22e656=_0x45374d?0x0:_0x171572[_0x95b3('0x1b')];var _0x67a958=_0x45374d?_0x229d8c[_0x95b3('0x1d')]:_0x171572[_0x95b3('0x1b')]+_0x171572[_0x95b3('0x1e')];var _0x25abc3;if(_0x67a958>=_0x50c8a7){_0x67a958=_0x50c8a7;_0x25abc3=0xc8;}else{_0x25abc3=0xce;}_0x4ee0f6['status'](_0x25abc3);return _0x4ee0f6['set'](_0x95b3('0x1f'),_0x22e656+'-'+_0x67a958+'/'+_0x50c8a7)['json'](_0x229d8c);}return null;};}function patchUpdates(_0x2a7701){return function(_0x59f80b){try{jsonpatch[_0x95b3('0x20')](_0x59f80b,_0x2a7701,!![]);}catch(_0xc58e14){return BPromise[_0x95b3('0x21')](_0xc58e14);}return _0x59f80b[_0x95b3('0x22')]();};}function saveUpdates(_0x5ddb58,_0x342b01){return function(_0x13c858){if(_0x13c858){return _0x13c858[_0x95b3('0x23')](_0x5ddb58)[_0x95b3('0x24')](function(_0x2712ac){return _0x2712ac;});}return null;};}function removeEntity(_0x59c61f,_0x3c0b41){return function(_0x5b57e8){if(_0x5b57e8){return _0x5b57e8[_0x95b3('0x25')]()[_0x95b3('0x24')](function(){_0x59c61f[_0x95b3('0x26')](0xcc)[_0x95b3('0x19')]();});}};}function handleEntityNotFound(_0x4b7815,_0x2d9354){return function(_0x27eed7){if(!_0x27eed7){_0x4b7815[_0x95b3('0x18')](0x194);}return _0x27eed7;};}function handleError(_0x522b87,_0x170cf1){_0x170cf1=_0x170cf1||0x1f4;return function(_0x4acb58){logger[_0x95b3('0x27')](_0x4acb58[_0x95b3('0x28')]);if(_0x4acb58[_0x95b3('0x29')]){delete _0x4acb58[_0x95b3('0x29')];}_0x522b87[_0x95b3('0x26')](_0x170cf1)[_0x95b3('0x2a')](_0x4acb58);};}exports[_0x95b3('0x2b')]=function(_0x330013,_0x116431){var _0x98267e={},_0x2fb609={},_0x440440={'count':0x0,'rows':[]};var _0xa34d2f=_['map'](db[_0x95b3('0x2c')][_0x95b3('0x2d')],function(_0x48bdc4){return{'name':_0x48bdc4['fieldName'],'type':_0x48bdc4['type'][_0x95b3('0x2e')]};});_0x2fb609[_0x95b3('0x2f')]=_[_0x95b3('0x30')](_0xa34d2f,_0x95b3('0x29'));_0x2fb609[_0x95b3('0x31')]=_[_0x95b3('0x32')](_0x330013[_0x95b3('0x31')]);_0x2fb609['filters']=_[_0x95b3('0x33')](_0x2fb609[_0x95b3('0x2f')],_0x2fb609[_0x95b3('0x31')]);_0x98267e[_0x95b3('0x34')]=_[_0x95b3('0x33')](_0x2fb609['model'],qs[_0x95b3('0x35')](_0x330013[_0x95b3('0x31')][_0x95b3('0x35')]));_0x98267e['attributes']=_0x98267e[_0x95b3('0x34')]['length']?_0x98267e['attributes']:_0x2fb609[_0x95b3('0x2f')];if(!_0x330013[_0x95b3('0x31')][_0x95b3('0x36')](_0x95b3('0x37'))){_0x98267e[_0x95b3('0x1e')]=qs[_0x95b3('0x1e')](_0x330013[_0x95b3('0x31')]['limit']);_0x98267e['offset']=qs['offset'](_0x330013[_0x95b3('0x31')][_0x95b3('0x1b')]);}_0x98267e['order']=qs[_0x95b3('0x38')](_0x330013[_0x95b3('0x31')][_0x95b3('0x38')]);_0x98267e[_0x95b3('0x39')]=qs['filters'](_[_0x95b3('0x3a')](_0x330013['query'],_0x2fb609[_0x95b3('0x3b')]),_0xa34d2f);if(_0x330013[_0x95b3('0x31')][_0x95b3('0x3c')]){_0x98267e[_0x95b3('0x39')]=_[_0x95b3('0x3d')](_0x98267e[_0x95b3('0x39')],{'$or':_[_0x95b3('0x30')](_0xa34d2f,function(_0x145292){if(_0x145292['type']!==_0x95b3('0x3e')){var _0x51e5e3={};_0x51e5e3[_0x145292[_0x95b3('0x29')]]={'$like':'%'+_0x330013[_0x95b3('0x31')][_0x95b3('0x3c')]+'%'};return _0x51e5e3;}})});}_0x98267e=_[_0x95b3('0x3d')]({},_0x98267e,_0x330013[_0x95b3('0x3f')]);var _0x56540a={'where':_0x98267e['where']};return db[_0x95b3('0x2c')][_0x95b3('0x1d')](_0x56540a)[_0x95b3('0x24')](function(_0x19a097){_0x440440[_0x95b3('0x1d')]=_0x19a097;if(_0x330013['query'][_0x95b3('0x40')]){_0x98267e[_0x95b3('0x41')]=[{'all':!![]}];}return db['FaxApplication']['findAll'](_0x98267e);})[_0x95b3('0x24')](function(_0x3c3ff9){_0x440440[_0x95b3('0x42')]=_0x3c3ff9;return _0x440440;})[_0x95b3('0x24')](respondWithFilteredResult(_0x116431,_0x98267e))[_0x95b3('0x43')](handleError(_0x116431,null));};exports['show']=function(_0x36367c,_0xcd8d16){var _0x59e611={'raw':!![],'where':{'id':_0x36367c['params']['id']}},_0x55c15a={};_0x55c15a[_0x95b3('0x2f')]=_[_0x95b3('0x32')](db[_0x95b3('0x2c')]['rawAttributes']);_0x55c15a[_0x95b3('0x31')]=_[_0x95b3('0x32')](_0x36367c[_0x95b3('0x31')]);_0x55c15a[_0x95b3('0x3b')]=_[_0x95b3('0x33')](_0x55c15a[_0x95b3('0x2f')],_0x55c15a[_0x95b3('0x31')]);_0x59e611[_0x95b3('0x34')]=_['intersection'](_0x55c15a[_0x95b3('0x2f')],qs[_0x95b3('0x35')](_0x36367c[_0x95b3('0x31')][_0x95b3('0x35')]));_0x59e611[_0x95b3('0x34')]=_0x59e611['attributes'][_0x95b3('0x44')]?_0x59e611[_0x95b3('0x34')]:_0x55c15a[_0x95b3('0x2f')];if(_0x36367c['query'][_0x95b3('0x40')]){_0x59e611[_0x95b3('0x41')]=[{'all':!![]}];}_0x59e611=_[_0x95b3('0x3d')]({},_0x59e611,_0x36367c['options']);return db[_0x95b3('0x2c')][_0x95b3('0x45')](_0x59e611)[_0x95b3('0x24')](handleEntityNotFound(_0xcd8d16,null))['then'](respondWithResult(_0xcd8d16,null))[_0x95b3('0x43')](handleError(_0xcd8d16,null));};exports[_0x95b3('0x46')]=function(_0x2744b1,_0x29fcc9){return db[_0x95b3('0x2c')][_0x95b3('0x46')](_0x2744b1[_0x95b3('0x47')],{})[_0x95b3('0x24')](respondWithResult(_0x29fcc9,0xc9))['catch'](handleError(_0x29fcc9,null));};exports[_0x95b3('0x23')]=function(_0x3c1deb,_0x405620){if(_0x3c1deb['body']['id']){delete _0x3c1deb[_0x95b3('0x47')]['id'];}return db[_0x95b3('0x2c')]['find']({'where':{'id':_0x3c1deb[_0x95b3('0x48')]['id']}})['then'](handleEntityNotFound(_0x405620,null))[_0x95b3('0x24')](saveUpdates(_0x3c1deb[_0x95b3('0x47')],null))[_0x95b3('0x24')](respondWithResult(_0x405620,null))[_0x95b3('0x43')](handleError(_0x405620,null));};exports[_0x95b3('0x25')]=function(_0x15481a,_0x52e5a5){return db[_0x95b3('0x2c')]['find']({'where':{'id':_0x15481a[_0x95b3('0x48')]['id']}})['then'](handleEntityNotFound(_0x52e5a5,null))[_0x95b3('0x24')](removeEntity(_0x52e5a5,null))[_0x95b3('0x43')](handleError(_0x52e5a5,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index e67c7b0..ee15440 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 _0x5eca=['rimraf','../../config/environment','exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','moment','path'];(function(_0x4ef05c,_0x2dcee1){var _0x3ea9e8=function(_0x66c867){while(--_0x66c867){_0x4ef05c['push'](_0x4ef05c['shift']());}};_0x3ea9e8(++_0x2dcee1);}(_0x5eca,0x13c));var _0xa5ec=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5eca[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xa5ec('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xa5ec('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa5ec('0x2'));var rimraf=require(_0xa5ec('0x3'));var config=require(_0xa5ec('0x4'));var attributes=require('./faxApplication.attributes');module[_0xa5ec('0x5')]=function(_0xd7529,_0x459544){return _0xd7529[_0xa5ec('0x6')](_0xa5ec('0x7'),attributes,{'tableName':_0xa5ec('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa5ec('0x9'),'collate':_0xa5ec('0xa')});}; \ No newline at end of file +var _0x5990=['request-promise','path','rimraf','../../config/environment','exports','define','FaxApplication','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x5cc1ef,_0x67ceab){var _0x31b6b3=function(_0x32bb81){while(--_0x32bb81){_0x5cc1ef['push'](_0x5cc1ef['shift']());}};_0x31b6b3(++_0x67ceab);}(_0x5990,0x13f));var _0x0599=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5990[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x0599('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0599('0x1'));var fs=require('fs');var path=require(_0x0599('0x2'));var rimraf=require(_0x0599('0x3'));var config=require(_0x0599('0x4'));var attributes=require('./faxApplication.attributes');module[_0x0599('0x5')]=function(_0x5387ae,_0x459e74){return _0x5387ae[_0x0599('0x6')](_0x0599('0x7'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0599('0x8'),'collate':_0x0599('0x9')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 5bb53a8..15d4986 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 _0x176e=['then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request'];(function(_0x23793a,_0xdaecb2){var _0x3de9e7=function(_0x271397){while(--_0x271397){_0x23793a['push'](_0x23793a['shift']());}};_0x3de9e7(++_0xdaecb2);}(_0x176e,0x1d3));var _0xe176=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x176e[_0x13e741];return _0x3f8bb3;};'use strict';var _=require(_0xe176('0x0'));var util=require(_0xe176('0x1'));var moment=require(_0xe176('0x2'));var BPromise=require(_0xe176('0x3'));var rs=require(_0xe176('0x4'));var fs=require('fs');var Redis=require(_0xe176('0x5'));var db=require(_0xe176('0x6'))['db'];var utils=require(_0xe176('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xe176('0x8'));var jayson=require(_0xe176('0x9'));var client=jayson[_0xe176('0xa')][_0xe176('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x121d32,_0x5a3cc6,_0x2931d1){return new BPromise(function(_0x5ef9e3,_0x18bfc2){return client[_0xe176('0xc')](_0x121d32,_0x2931d1)[_0xe176('0xd')](function(_0x3c95ce){logger[_0xe176('0xe')](_0xe176('0xf'),_0x5a3cc6,_0xe176('0x10'));logger[_0xe176('0x11')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x5a3cc6,_0xe176('0x10'),JSON[_0xe176('0x12')](_0x3c95ce));if(_0x3c95ce[_0xe176('0x13')]){if(_0x3c95ce[_0xe176('0x13')][_0xe176('0x14')]===0x1f4){logger[_0xe176('0x13')](_0xe176('0xf'),_0x5a3cc6,_0x3c95ce['error'][_0xe176('0x15')]);return _0x18bfc2(_0x3c95ce[_0xe176('0x13')][_0xe176('0x15')]);}logger[_0xe176('0x13')]('FaxApplication,\x20%s,\x20%s',_0x5a3cc6,_0x3c95ce['error'][_0xe176('0x15')]);return _0x5ef9e3(_0x3c95ce[_0xe176('0x13')][_0xe176('0x15')]);}else{logger[_0xe176('0xe')](_0xe176('0xf'),_0x5a3cc6,_0xe176('0x10'));_0x5ef9e3(_0x3c95ce[_0xe176('0x16')][_0xe176('0x15')]);}})[_0xe176('0x17')](function(_0xf08e94){logger[_0xe176('0x13')]('FaxApplication,\x20%s,\x20%s',_0x5a3cc6,_0xf08e94);_0x18bfc2(_0xf08e94);});});}exports[_0xe176('0x18')]=function(_0x3534c3){var _0x460925=this;return new Promise(function(_0x51f351,_0x4b12dc){return db[_0xe176('0x19')][_0xe176('0x1a')](_0x3534c3[_0xe176('0x1b')],{'raw':_0x3534c3[_0xe176('0x1c')]?_0x3534c3[_0xe176('0x1c')][_0xe176('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3534c3[_0xe176('0x1c')]?_0x3534c3[_0xe176('0x1c')][_0xe176('0x1e')]||null:null,'attributes':_0x3534c3[_0xe176('0x1c')]?_0x3534c3[_0xe176('0x1c')]['attributes']||null:null,'limit':_0x3534c3[_0xe176('0x1c')]?_0x3534c3[_0xe176('0x1c')][_0xe176('0x1f')]||null:null})[_0xe176('0xd')](function(_0x1d6755){logger[_0xe176('0xe')](_0xe176('0x18'),_0x3534c3);logger['debug'](_0xe176('0x18'),_0x3534c3,JSON[_0xe176('0x12')](_0x1d6755));_0x51f351(_0x1d6755);})[_0xe176('0x17')](function(_0x4d36b8){logger['error'](_0xe176('0x18'),_0x4d36b8['message'],_0x3534c3);_0x4b12dc(_0x460925[_0xe176('0x13')](0x1f4,_0x4d36b8[_0xe176('0x15')]));});});}; \ No newline at end of file +var _0xf350=['request','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','attributes','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xf350,0x105));var _0x0f35=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf350[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x0f35('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0f35('0x1'));var rs=require(_0x0f35('0x2'));var fs=require('fs');var Redis=require(_0x0f35('0x3'));var db=require(_0x0f35('0x4'))['db'];var utils=require(_0x0f35('0x5'));var logger=require(_0x0f35('0x6'))(_0x0f35('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0f35('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2c61c4,_0x481712,_0x544342){return new BPromise(function(_0x2c716b,_0x49c0fe){return client[_0x0f35('0x9')](_0x2c61c4,_0x544342)['then'](function(_0x3d928d){logger[_0x0f35('0xa')](_0x0f35('0xb'),_0x481712,_0x0f35('0xc'));logger[_0x0f35('0xd')](_0x0f35('0xe'),_0x481712,_0x0f35('0xc'),JSON[_0x0f35('0xf')](_0x3d928d));if(_0x3d928d[_0x0f35('0x10')]){if(_0x3d928d['error'][_0x0f35('0x11')]===0x1f4){logger[_0x0f35('0x10')]('FaxApplication,\x20%s,\x20%s',_0x481712,_0x3d928d[_0x0f35('0x10')]['message']);return _0x49c0fe(_0x3d928d[_0x0f35('0x10')]['message']);}logger['error'](_0x0f35('0xb'),_0x481712,_0x3d928d[_0x0f35('0x10')][_0x0f35('0x12')]);return _0x2c716b(_0x3d928d['error'][_0x0f35('0x12')]);}else{logger[_0x0f35('0xa')](_0x0f35('0xb'),_0x481712,_0x0f35('0xc'));_0x2c716b(_0x3d928d[_0x0f35('0x13')][_0x0f35('0x12')]);}})[_0x0f35('0x14')](function(_0x1a2ffc){logger[_0x0f35('0x10')](_0x0f35('0xb'),_0x481712,_0x1a2ffc);_0x49c0fe(_0x1a2ffc);});});}exports[_0x0f35('0x15')]=function(_0x1bcf51){var _0x33bc51=this;return new Promise(function(_0x496ff9,_0xe0f0f1){return db[_0x0f35('0x16')][_0x0f35('0x17')](_0x1bcf51[_0x0f35('0x18')],{'raw':_0x1bcf51[_0x0f35('0x19')]?_0x1bcf51[_0x0f35('0x19')][_0x0f35('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bcf51[_0x0f35('0x19')]?_0x1bcf51[_0x0f35('0x19')][_0x0f35('0x1b')]||null:null,'attributes':_0x1bcf51[_0x0f35('0x19')]?_0x1bcf51[_0x0f35('0x19')][_0x0f35('0x1c')]||null:null,'limit':_0x1bcf51[_0x0f35('0x19')]?_0x1bcf51[_0x0f35('0x19')][_0x0f35('0x1d')]||null:null})['then'](function(_0x439c32){logger[_0x0f35('0xa')](_0x0f35('0x15'),_0x1bcf51);logger['debug']('UpdateFaxApplication',_0x1bcf51,JSON[_0x0f35('0xf')](_0x439c32));_0x496ff9(_0x439c32);})['catch'](function(_0xcfaa05){logger[_0x0f35('0x10')](_0x0f35('0x15'),_0xcfaa05['message'],_0x1bcf51);_0xe0f0f1(_0x33bc51[_0x0f35('0x10')](0x1f4,_0xcfaa05[_0x0f35('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 4d3e7c1..ad28a52 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 _0xed3c=['index','show','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./faxApplication.controller','get','isAuthenticated'];(function(_0xec7fe5,_0x5024d6){var _0x245072=function(_0x4c65bf){while(--_0x4c65bf){_0xec7fe5['push'](_0xec7fe5['shift']());}};_0x245072(++_0x5024d6);}(_0xed3c,0x1a6));var _0xced3=function(_0x57eebd,_0x561057){_0x57eebd=_0x57eebd-0x0;var _0x343a79=_0xed3c[_0x57eebd];return _0x343a79;};'use strict';var multer=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var path=require(_0xced3('0x2'));var timeout=require(_0xced3('0x3'));var express=require('express');var router=express[_0xced3('0x4')]();var fs_extra=require(_0xced3('0x5'));var auth=require(_0xced3('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xced3('0x7'));router[_0xced3('0x8')]('/',auth[_0xced3('0x9')](),controller[_0xced3('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xced3('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xced3('0xc')](_0xced3('0xd'),auth[_0xced3('0x9')](),controller[_0xced3('0xe')]);router[_0xced3('0xf')]('/:id',auth[_0xced3('0x9')](),controller[_0xced3('0x10')]);module[_0xced3('0x11')]=router; \ No newline at end of file +var _0xf4f4=['../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2d3ad2,_0x420b17){var _0x1ab681=function(_0x5c98fc){while(--_0x5c98fc){_0x2d3ad2['push'](_0x2d3ad2['shift']());}};_0x1ab681(++_0x420b17);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x3a5a8d,_0x22dac9){_0x3a5a8d=_0x3a5a8d-0x0;var _0x1b94b7=_0xf4f4[_0x3a5a8d];return _0x1b94b7;};'use strict';var multer=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var path=require('path');var timeout=require(_0x4f4f('0x2'));var express=require(_0x4f4f('0x3'));var router=express[_0x4f4f('0x4')]();var fs_extra=require(_0x4f4f('0x5'));var auth=require(_0x4f4f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4f4f('0x7'));var controller=require('./faxApplication.controller');router[_0x4f4f('0x8')]('/',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xa')]);router[_0x4f4f('0x8')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xc')]);router[_0x4f4f('0xd')]('/',auth['isAuthenticated'](),controller[_0x4f4f('0xe')]);router[_0x4f4f('0xf')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x10')]);router[_0x4f4f('0x11')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 2cd56e5..b4bc168 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 _0xddd3=['DATE','STRING','out','sequelize','BOOLEAN'];(function(_0x12e3f4,_0x4a3923){var _0x50d9b4=function(_0x2f0972){while(--_0x2f0972){_0x12e3f4['push'](_0x12e3f4['shift']());}};_0x50d9b4(++_0x4a3923);}(_0xddd3,0x99));var _0x3ddd=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xddd3[_0x32d457];return _0x338386;};'use strict';var Sequelize=require(_0x3ddd('0x0'));module['exports']={'closed':{'type':Sequelize[_0x3ddd('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3ddd('0x2')]},'disposition':{'type':Sequelize[_0x3ddd('0x3')]},'secondDisposition':{'type':Sequelize[_0x3ddd('0x3')]},'thirdDisposition':{'type':Sequelize[_0x3ddd('0x3')]},'note':{'type':Sequelize[_0x3ddd('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x3ddd('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x3ddd('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3ddd('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x3ddd('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x6b08=['STRING','ENUM','out','sequelize','exports','DATE'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x6b08,0x165));var _0x86b0=function(_0x301897,_0x209734){_0x301897=_0x301897-0x0;var _0x3394ee=_0x6b08[_0x301897];return _0x3394ee;};'use strict';var Sequelize=require(_0x86b0('0x0'));module[_0x86b0('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x86b0('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x86b0('0x3')]},'note':{'type':Sequelize[_0x86b0('0x3')]},'read1stAt':{'type':Sequelize[_0x86b0('0x2')]},'fax':{'type':Sequelize[_0x86b0('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x86b0('0x4')]('in',_0x86b0('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x86b0('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x86b0('0x4')]('in',_0x86b0('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 84bdc7d..cc2079a 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 _0x9b70=['then','destroy','error','name','send','index','map','FaxInteraction','rawAttributes','fieldName','type','key','findAll','fax','query','user','catch','params','model','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','update','describe','addMessage','FaxMessage','omit','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','pick','filter','$gte','split','format','include','addTags','setTags','ids','spread','Tag','color','removeTags','download','unix','toString','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','get','mkdirSync','basename','createReadStream','pipe','resolve','log','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x9b70,0x18b));var _0x09b7=function(_0x1c29b3,_0x442dd4){_0x1c29b3=_0x1c29b3-0x0;var _0x6485da=_0x9b70[_0x1c29b3];return _0x6485da;};'use strict';var rimraf=require(_0x09b7('0x0'));var zipdir=require(_0x09b7('0x1'));var moment=require(_0x09b7('0x2'));var BPromise=require(_0x09b7('0x3'));var util=require(_0x09b7('0x4'));var path=require(_0x09b7('0x5'));var fs=require('fs');var _=require(_0x09b7('0x6'));var Redis=require(_0x09b7('0x7'));var interaction=require(_0x09b7('0x8'));var qs=require(_0x09b7('0x9'));var logger=require(_0x09b7('0xa'))(_0x09b7('0xb'));var config=require(_0x09b7('0xc'));var db=require(_0x09b7('0xd'))['db'];config[_0x09b7('0xe')]=_[_0x09b7('0xf')](config[_0x09b7('0xe')],{'host':_0x09b7('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x09b7('0xe')]));require(_0x09b7('0x11'))[_0x09b7('0x12')](socket);function respondWithStatusCode(_0x2d10c5,_0x3da68b){_0x3da68b=_0x3da68b||0xcc;return function(_0xbe2e02){if(_0xbe2e02){return _0x2d10c5[_0x09b7('0x13')](_0x3da68b);}return _0x2d10c5['status'](_0x3da68b)[_0x09b7('0x14')]();};}function respondWithResult(_0x4b67d6,_0x25e920){_0x25e920=_0x25e920||0xc8;return function(_0x4803bd){if(_0x4803bd){return _0x4b67d6[_0x09b7('0x15')](_0x25e920)['json'](_0x4803bd);}};}function respondWithFilteredResult(_0xd3460d,_0x273e8e){return function(_0x327bfe){if(_0x327bfe){var _0x58bb54=typeof _0x273e8e[_0x09b7('0x16')]===_0x09b7('0x17')&&typeof _0x273e8e[_0x09b7('0x18')]===_0x09b7('0x17');var _0x490107=_0x327bfe[_0x09b7('0x19')];var _0x15480f=_0x58bb54?0x0:_0x273e8e['offset'];var _0x593947=_0x58bb54?_0x327bfe[_0x09b7('0x19')]:_0x273e8e[_0x09b7('0x16')]+_0x273e8e[_0x09b7('0x18')];var _0x1f524f;if(_0x593947>=_0x490107){_0x593947=_0x490107;_0x1f524f=0xc8;}else{_0x1f524f=0xce;}_0xd3460d[_0x09b7('0x15')](_0x1f524f);return _0xd3460d[_0x09b7('0x1a')](_0x09b7('0x1b'),_0x15480f+'-'+_0x593947+'/'+_0x490107)[_0x09b7('0x1c')](_0x327bfe);}return null;};}function saveUpdates(_0x504a0d){return function(_0x45aaf3){if(_0x45aaf3){return _0x45aaf3['update'](_0x504a0d)[_0x09b7('0x1d')](function(_0x33961a){return _0x33961a;});}return null;};}function removeEntity(_0x567354){return function(_0xfb5ef6){if(_0xfb5ef6){return _0xfb5ef6[_0x09b7('0x1e')]()[_0x09b7('0x1d')](function(){_0x567354[_0x09b7('0x15')](0xcc)[_0x09b7('0x14')]();});}};}function handleEntityNotFound(_0x1f88e9){return function(_0x54e8e5){if(!_0x54e8e5){_0x1f88e9[_0x09b7('0x13')](0x194);}return _0x54e8e5;};}function handleError(_0x3fdff7,_0x43f10a){_0x43f10a=_0x43f10a||0x1f4;return function(_0x40fede){logger[_0x09b7('0x1f')](_0x40fede['stack']);if(_0x40fede[_0x09b7('0x20')]){delete _0x40fede[_0x09b7('0x20')];}_0x3fdff7['status'](_0x43f10a)[_0x09b7('0x21')](_0x40fede);};}exports[_0x09b7('0x22')]=function(_0x230027,_0x385597){var _0x4939a1={};var _0x3d3c7e=_[_0x09b7('0x23')](db[_0x09b7('0x24')][_0x09b7('0x25')],function(_0x37d5c3){return{'name':_0x37d5c3[_0x09b7('0x26')],'type':_0x37d5c3[_0x09b7('0x27')][_0x09b7('0x28')]};});_0x4939a1=qs['getOptions'](_0x3d3c7e,_0x230027);return interaction[_0x09b7('0x29')](_0x09b7('0x2a'),_0x230027[_0x09b7('0x2b')],_0x230027[_0x09b7('0x2c')],_0x4939a1,_0x3d3c7e)[_0x09b7('0x1d')](respondWithFilteredResult(_0x385597,_0x4939a1))[_0x09b7('0x2d')](handleError(_0x385597,null));};exports['show']=function(_0x651b8c,_0x58ebbf){var _0x3cd168={'raw':![],'where':{'id':_0x651b8c[_0x09b7('0x2e')]['id']}},_0x2acc17={};_0x2acc17[_0x09b7('0x2f')]=_['keys'](db[_0x09b7('0x24')][_0x09b7('0x25')]);_0x2acc17[_0x09b7('0x2b')]=_['keys'](_0x651b8c['query']);_0x2acc17[_0x09b7('0x30')]=_[_0x09b7('0x31')](_0x2acc17[_0x09b7('0x2f')],_0x2acc17[_0x09b7('0x2b')]);_0x3cd168[_0x09b7('0x32')]=_[_0x09b7('0x31')](_0x2acc17[_0x09b7('0x2f')],qs[_0x09b7('0x33')](_0x651b8c['query']['fields']));_0x3cd168[_0x09b7('0x32')]=_0x3cd168[_0x09b7('0x32')][_0x09b7('0x34')]?_0x3cd168[_0x09b7('0x32')]:_0x2acc17[_0x09b7('0x2f')];if(_0x651b8c[_0x09b7('0x2b')][_0x09b7('0x35')]){_0x3cd168['include']=[{'all':!![]}];}_0x3cd168=_[_0x09b7('0x36')]({},_0x3cd168,_0x651b8c[_0x09b7('0x37')]);return db['FaxInteraction'][_0x09b7('0x38')](_0x3cd168)[_0x09b7('0x1d')](handleEntityNotFound(_0x58ebbf,null))[_0x09b7('0x1d')](respondWithResult(_0x58ebbf,null))[_0x09b7('0x2d')](handleError(_0x58ebbf,null));};exports[_0x09b7('0x39')]=function(_0x40894a,_0x2e1de4){return db[_0x09b7('0x24')][_0x09b7('0x39')](_0x40894a[_0x09b7('0x3a')],{})[_0x09b7('0x1d')](respondWithResult(_0x2e1de4,0xc9))[_0x09b7('0x2d')](handleError(_0x2e1de4,null));};exports[_0x09b7('0x3b')]=function(_0x3ab1ed,_0x2d4ff0){if(_0x3ab1ed['body']['id']){delete _0x3ab1ed[_0x09b7('0x3a')]['id'];}return db['FaxInteraction']['find']({'where':{'id':_0x3ab1ed['params']['id']}})['then'](handleEntityNotFound(_0x2d4ff0,null))[_0x09b7('0x1d')](saveUpdates(_0x3ab1ed['body'],null))[_0x09b7('0x1d')](respondWithResult(_0x2d4ff0,null))[_0x09b7('0x2d')](handleError(_0x2d4ff0,null));};exports[_0x09b7('0x1e')]=function(_0x318d3e,_0x5b0fac){return db[_0x09b7('0x24')]['find']({'where':{'id':_0x318d3e[_0x09b7('0x2e')]['id']}})[_0x09b7('0x1d')](handleEntityNotFound(_0x5b0fac,null))['then'](removeEntity(_0x5b0fac,null))[_0x09b7('0x2d')](handleError(_0x5b0fac,null));};exports[_0x09b7('0x3c')]=function(_0x227a18,_0x1707ed){return db[_0x09b7('0x24')]['describe']()['then'](respondWithResult(_0x1707ed,null))[_0x09b7('0x2d')](handleError(_0x1707ed,null));};exports[_0x09b7('0x3d')]=function(_0x2fe5e0,_0x291049){return db[_0x09b7('0x3e')][_0x09b7('0x38')]({'where':{'id':_0x2fe5e0[_0x09b7('0x2e')]['id']}})[_0x09b7('0x1d')](handleEntityNotFound(_0x291049,null))[_0x09b7('0x1d')](function(_0x305e11){if(_0x305e11){return _0x305e11[_0x09b7('0x3d')](_0x2fe5e0['body']['ids'],_[_0x09b7('0x3f')](_0x2fe5e0['body'],['ids','id'])||{});}})[_0x09b7('0x1d')](respondWithResult(_0x291049,null))[_0x09b7('0x2d')](handleError(_0x291049,null));};exports[_0x09b7('0x40')]=function(_0xb2fb66,_0x3efe8f){var _0x5e082e={'raw':![],'where':{}};var _0x52f4e6={};var _0x3a62d4={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x09b7('0x41')]({'where':{'id':_0xb2fb66[_0x09b7('0x2e')]['id']}})['then'](handleEntityNotFound(_0x3efe8f,null))[_0x09b7('0x1d')](function(_0xef0b05){if(_0xef0b05){_0x52f4e6[_0x09b7('0x2f')]=_['keys'](db[_0x09b7('0x3e')][_0x09b7('0x25')]);_0x52f4e6['query']=_['keys'](_0xb2fb66[_0x09b7('0x2b')]);_0x52f4e6[_0x09b7('0x30')]=_[_0x09b7('0x31')](_0x52f4e6['model'],_0x52f4e6[_0x09b7('0x2b')]);_0x5e082e[_0x09b7('0x32')]=_[_0x09b7('0x31')](_0x52f4e6[_0x09b7('0x2f')],qs['fields'](_0xb2fb66[_0x09b7('0x2b')]['fields']));_0x5e082e[_0x09b7('0x32')]=_0x5e082e['attributes'][_0x09b7('0x34')]?_0x5e082e['attributes']:_0x52f4e6[_0x09b7('0x2f')];if(!_0xb2fb66[_0x09b7('0x2b')][_0x09b7('0x42')](_0x09b7('0x43'))){_0x5e082e['limit']=qs[_0x09b7('0x18')](_0xb2fb66['query']['limit']);_0x5e082e[_0x09b7('0x16')]=qs['offset'](_0xb2fb66[_0x09b7('0x2b')][_0x09b7('0x16')]);}_0x5e082e[_0x09b7('0x44')]=qs['sort'](_0xb2fb66[_0x09b7('0x2b')][_0x09b7('0x45')]);_0x5e082e[_0x09b7('0x46')]=qs[_0x09b7('0x30')](_[_0x09b7('0x47')](_0xb2fb66['query'],_0x52f4e6[_0x09b7('0x30')]));_0x5e082e[_0x09b7('0x46')]['FaxInteractionId']=_0xef0b05['id'];if(_0xb2fb66[_0x09b7('0x2b')][_0x09b7('0x48')]){_0x5e082e[_0x09b7('0x46')]=_['merge'](_0x5e082e['where'],{'$or':_[_0x09b7('0x23')](_0x5e082e[_0x09b7('0x32')],function(_0x5e6b88){var _0x11d3c7={};_0x11d3c7[_0x5e6b88]={'$like':'%'+_0xb2fb66[_0x09b7('0x2b')]['filter']+'%'};return _0x11d3c7;})});}if(_0xb2fb66['query']['$gte']){var _0x44ca3b=_0xb2fb66[_0x09b7('0x2b')][_0x09b7('0x49')][_0x09b7('0x4a')](',');var _0x514847={};_0x514847[_0x44ca3b[0x0]]={'$gte':moment(_0x44ca3b[0x1])[_0x09b7('0x4b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5e082e['where']=_[_0x09b7('0x36')](_0x5e082e[_0x09b7('0x46')],_0x514847);}_0x5e082e=_[_0x09b7('0x36')]({},_0x5e082e,_0xb2fb66[_0x09b7('0x37')]);return db['FaxMessage']['count']({'where':_0x5e082e[_0x09b7('0x46')]})[_0x09b7('0x1d')](function(_0x136b33){_0x3a62d4[_0x09b7('0x19')]=_0x136b33;if(_0xb2fb66[_0x09b7('0x2b')][_0x09b7('0x35')]){_0x5e082e[_0x09b7('0x4c')]=[{'all':!![]}];}return db[_0x09b7('0x3e')][_0x09b7('0x29')](_0x5e082e);})[_0x09b7('0x1d')](function(_0x118eea){_0x3a62d4['rows']=_0x118eea;return _0x3a62d4;});}})[_0x09b7('0x1d')](respondWithFilteredResult(_0x3efe8f,_0x5e082e))[_0x09b7('0x2d')](handleError(_0x3efe8f,null));};exports[_0x09b7('0x4d')]=function(_0x25f9e1,_0x13de16){return db[_0x09b7('0x24')][_0x09b7('0x38')]({'where':{'id':_0x25f9e1['params']['id']}})[_0x09b7('0x1d')](handleEntityNotFound(_0x13de16,null))['then'](function(_0xce71f6){if(_0xce71f6){return _0xce71f6[_0x09b7('0x4e')](_0x25f9e1[_0x09b7('0x3a')][_0x09b7('0x4f')],_['omit'](_0x25f9e1['body'],[_0x09b7('0x4f'),'id'])||{})[_0x09b7('0x50')](function(){return db[_0x09b7('0x51')][_0x09b7('0x29')]({'attributes':['id','name',_0x09b7('0x52')],'where':{'id':_0x25f9e1[_0x09b7('0x3a')][_0x09b7('0x4f')]}});})['then'](function(_0xd19751){socket['emit']('faxInteractionTags:save',{'id':Number(_0x25f9e1[_0x09b7('0x2e')]['id']),'tags':_0xd19751||[]});return{'id':Number(_0x25f9e1[_0x09b7('0x2e')]['id']),'tags':_0xd19751||[]};});}})[_0x09b7('0x1d')](respondWithResult(_0x13de16,null))[_0x09b7('0x2d')](handleError(_0x13de16,null));};exports[_0x09b7('0x53')]=function(_0x5f67ac,_0x288e56){return db['FaxInteraction'][_0x09b7('0x38')]({'where':{'id':_0x5f67ac[_0x09b7('0x2e')]['id']}})[_0x09b7('0x1d')](handleEntityNotFound(_0x288e56,null))[_0x09b7('0x1d')](function(_0x42894b){if(_0x42894b){return _0x42894b[_0x09b7('0x53')](_0x5f67ac[_0x09b7('0x2b')]['ids']);}})[_0x09b7('0x1d')](respondWithStatusCode(_0x288e56,null))[_0x09b7('0x2d')](handleError(_0x288e56,null));};exports[_0x09b7('0x54')]=function(_0x43ffdc,_0x1a7ef9){var _0x601d43=moment()[_0x09b7('0x55')]()[_0x09b7('0x56')]();var _0x2f80f0=path[_0x09b7('0x57')](config[_0x09b7('0x58')],'server',_0x09b7('0x59'),_0x09b7('0x5a'));var _0x13c3c9=path[_0x09b7('0x57')](config[_0x09b7('0x58')],_0x09b7('0x5b'),_0x09b7('0x59'),_0x09b7('0x5c'));var _0x4cae34=path[_0x09b7('0x57')](_0x2f80f0,_0x601d43);var _0x28ec33=util[_0x09b7('0x4b')](_0x09b7('0x5d'),_0x43ffdc[_0x09b7('0x2e')]['id'],_0x601d43);var _0x2e080e=path[_0x09b7('0x57')](_0x2f80f0,_0x28ec33);var _0x5a5b51=[];_0x5a5b51[_0x09b7('0x5e')]({'model':db[_0x09b7('0x5f')],'as':_0x09b7('0x5f'),'raw':!![]});var _0x5a64ec=[{'model':db[_0x09b7('0x3e')],'as':_0x09b7('0x60'),'attributes':['id',_0x09b7('0x3a'),_0x09b7('0x61')],'include':_0x5a5b51}];return db[_0x09b7('0x24')][_0x09b7('0x38')]({'where':{'id':_0x43ffdc['params']['id']},'include':_0x5a64ec})[_0x09b7('0x1d')](handleEntityNotFound(_0x1a7ef9,null))['then'](function(_0x46f65f){if(_0x46f65f&&_0x46f65f['Messages']){var _0x38ed64=_0x46f65f[_0x09b7('0x62')]({'plain':!![]});fs[_0x09b7('0x63')](_0x4cae34);for(var _0x34a595=0x0;_0x34a595<_0x38ed64[_0x09b7('0x60')]['length'];_0x34a595++){var _0x278ae3=_0x38ed64['Messages'][_0x34a595]['Attachment'];if(_0x278ae3){var _0x1bf2be=path[_0x09b7('0x57')](_0x13c3c9,_0x278ae3[_0x09b7('0x64')]);if(fs['existsSync'](_0x1bf2be)){fs[_0x09b7('0x65')](_0x1bf2be)[_0x09b7('0x66')](fs['createWriteStream'](path[_0x09b7('0x57')](_0x4cae34,_0x278ae3[_0x09b7('0x64')])));}}}return BPromise[_0x09b7('0x67')]()[_0x09b7('0x1d')](function(){return new BPromise(function(_0x35d19c,_0x3488a2){zipdir(_0x4cae34,{'saveTo':_0x2e080e},function(_0x2edf93,_0x505f13){if(_0x2edf93)return _0x3488a2(_0x2edf93);return _0x35d19c(_0x505f13);});})['then'](function(){return new BPromise(function(_0x5b0131,_0x14f64d){rimraf(_0x4cae34,function(_0x3c1070){if(_0x3c1070)_0x14f64d(_0x3c1070);return _0x5b0131();});});})['then'](function(){return _0x1a7ef9[_0x09b7('0x54')](_0x2e080e,_0x28ec33,function(_0x171613){if(_0x171613){console[_0x09b7('0x68')]('err',_0x171613);}else{fs[_0x09b7('0x69')](_0x2e080e);}});});});}else{return _0x1a7ef9[_0x09b7('0x13')](0xc8);}})['catch'](handleError(_0x1a7ef9,null));}; \ No newline at end of file +var _0x8cb6=['sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','then','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','getOptions','findAll','query','catch','model','keys','FaxInteraction','filters','intersection','attributes','fields','includeAll','include','merge','options','find','create','body','update','params','describe','FaxMessage','ids','getMessages','findOne','length','hasOwnProperty','nolimit','order','sort','where','pick','FaxInteractionId','filter','map','$gte','split','format','rows','addTags','setTags','omit','spread','Tag','color','emit','removeTags','download','unix','root','server','files','join','attachments','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','mkdirSync','basename','createReadStream','pipe','createWriteStream','resolve','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','register'];(function(_0x526fca,_0x463b4f){var _0x4e7eb9=function(_0x4bdf46){while(--_0x4bdf46){_0x526fca['push'](_0x526fca['shift']());}};_0x4e7eb9(++_0x463b4f);}(_0x8cb6,0xc0));var _0x68cb=function(_0x1b3a09,_0x20c774){_0x1b3a09=_0x1b3a09-0x0;var _0x357bb8=_0x8cb6[_0x1b3a09];return _0x357bb8;};'use strict';var rimraf=require(_0x68cb('0x0'));var zipdir=require(_0x68cb('0x1'));var moment=require(_0x68cb('0x2'));var BPromise=require(_0x68cb('0x3'));var util=require(_0x68cb('0x4'));var path=require(_0x68cb('0x5'));var fs=require('fs');var _=require(_0x68cb('0x6'));var Redis=require(_0x68cb('0x7'));var interaction=require(_0x68cb('0x8'));var qs=require(_0x68cb('0x9'));var logger=require(_0x68cb('0xa'))(_0x68cb('0xb'));var config=require('../../config/environment');var db=require(_0x68cb('0xc'))['db'];config[_0x68cb('0xd')]=_[_0x68cb('0xe')](config[_0x68cb('0xd')],{'host':_0x68cb('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x68cb('0x10'))[_0x68cb('0x11')](socket);function respondWithStatusCode(_0x1d2037,_0x1400b3){_0x1400b3=_0x1400b3||0xcc;return function(_0x5c3a60){if(_0x5c3a60){return _0x1d2037[_0x68cb('0x12')](_0x1400b3);}return _0x1d2037[_0x68cb('0x13')](_0x1400b3)[_0x68cb('0x14')]();};}function respondWithResult(_0x2e1578,_0x2c9dad){_0x2c9dad=_0x2c9dad||0xc8;return function(_0x396465){if(_0x396465){return _0x2e1578[_0x68cb('0x13')](_0x2c9dad)[_0x68cb('0x15')](_0x396465);}};}function respondWithFilteredResult(_0x289360,_0x34a206){return function(_0x15dd0d){if(_0x15dd0d){var _0x583b80=typeof _0x34a206[_0x68cb('0x16')]===_0x68cb('0x17')&&typeof _0x34a206[_0x68cb('0x18')]===_0x68cb('0x17');var _0x552d99=_0x15dd0d[_0x68cb('0x19')];var _0x48b1a9=_0x583b80?0x0:_0x34a206[_0x68cb('0x16')];var _0x562a73=_0x583b80?_0x15dd0d['count']:_0x34a206[_0x68cb('0x16')]+_0x34a206[_0x68cb('0x18')];var _0x3f11f7;if(_0x562a73>=_0x552d99){_0x562a73=_0x552d99;_0x3f11f7=0xc8;}else{_0x3f11f7=0xce;}_0x289360[_0x68cb('0x13')](_0x3f11f7);return _0x289360['set'](_0x68cb('0x1a'),_0x48b1a9+'-'+_0x562a73+'/'+_0x552d99)[_0x68cb('0x15')](_0x15dd0d);}return null;};}function saveUpdates(_0x49bdf4){return function(_0x5efab3){if(_0x5efab3){return _0x5efab3['update'](_0x49bdf4)[_0x68cb('0x1b')](function(_0x31039d){return _0x31039d;});}return null;};}function removeEntity(_0x2c48f2){return function(_0x544180){if(_0x544180){return _0x544180[_0x68cb('0x1c')]()['then'](function(){_0x2c48f2[_0x68cb('0x13')](0xcc)[_0x68cb('0x14')]();});}};}function handleEntityNotFound(_0x28a38a){return function(_0x64bb62){if(!_0x64bb62){_0x28a38a[_0x68cb('0x12')](0x194);}return _0x64bb62;};}function handleError(_0x274aca,_0x2f3adf){_0x2f3adf=_0x2f3adf||0x1f4;return function(_0x19edce){logger['error'](_0x19edce[_0x68cb('0x1d')]);if(_0x19edce[_0x68cb('0x1e')]){delete _0x19edce['name'];}_0x274aca[_0x68cb('0x13')](_0x2f3adf)[_0x68cb('0x1f')](_0x19edce);};}exports[_0x68cb('0x20')]=function(_0x396d9c,_0x83d5b2){var _0x3aec8b={};var _0xbda71d=_['map'](db['FaxInteraction'][_0x68cb('0x21')],function(_0x16e27c){return{'name':_0x16e27c[_0x68cb('0x22')],'type':_0x16e27c[_0x68cb('0x23')][_0x68cb('0x24')]};});_0x3aec8b=qs[_0x68cb('0x25')](_0xbda71d,_0x396d9c);return interaction[_0x68cb('0x26')]('fax',_0x396d9c[_0x68cb('0x27')],_0x396d9c['user'],_0x3aec8b,_0xbda71d)[_0x68cb('0x1b')](respondWithFilteredResult(_0x83d5b2,_0x3aec8b))[_0x68cb('0x28')](handleError(_0x83d5b2,null));};exports['show']=function(_0x1b55db,_0x433f41){var _0x32d04d={'raw':![],'where':{'id':_0x1b55db['params']['id']}},_0x21e545={};_0x21e545[_0x68cb('0x29')]=_[_0x68cb('0x2a')](db[_0x68cb('0x2b')][_0x68cb('0x21')]);_0x21e545['query']=_['keys'](_0x1b55db[_0x68cb('0x27')]);_0x21e545[_0x68cb('0x2c')]=_[_0x68cb('0x2d')](_0x21e545[_0x68cb('0x29')],_0x21e545['query']);_0x32d04d[_0x68cb('0x2e')]=_[_0x68cb('0x2d')](_0x21e545['model'],qs[_0x68cb('0x2f')](_0x1b55db[_0x68cb('0x27')][_0x68cb('0x2f')]));_0x32d04d[_0x68cb('0x2e')]=_0x32d04d[_0x68cb('0x2e')]['length']?_0x32d04d[_0x68cb('0x2e')]:_0x21e545[_0x68cb('0x29')];if(_0x1b55db[_0x68cb('0x27')][_0x68cb('0x30')]){_0x32d04d[_0x68cb('0x31')]=[{'all':!![]}];}_0x32d04d=_[_0x68cb('0x32')]({},_0x32d04d,_0x1b55db[_0x68cb('0x33')]);return db[_0x68cb('0x2b')][_0x68cb('0x34')](_0x32d04d)[_0x68cb('0x1b')](handleEntityNotFound(_0x433f41,null))['then'](respondWithResult(_0x433f41,null))[_0x68cb('0x28')](handleError(_0x433f41,null));};exports[_0x68cb('0x35')]=function(_0x14e7a5,_0x4e286a){return db[_0x68cb('0x2b')][_0x68cb('0x35')](_0x14e7a5[_0x68cb('0x36')],{})[_0x68cb('0x1b')](respondWithResult(_0x4e286a,0xc9))[_0x68cb('0x28')](handleError(_0x4e286a,null));};exports[_0x68cb('0x37')]=function(_0x469238,_0x34633e){if(_0x469238[_0x68cb('0x36')]['id']){delete _0x469238[_0x68cb('0x36')]['id'];}return db[_0x68cb('0x2b')][_0x68cb('0x34')]({'where':{'id':_0x469238['params']['id']}})[_0x68cb('0x1b')](handleEntityNotFound(_0x34633e,null))[_0x68cb('0x1b')](saveUpdates(_0x469238[_0x68cb('0x36')],null))[_0x68cb('0x1b')](respondWithResult(_0x34633e,null))[_0x68cb('0x28')](handleError(_0x34633e,null));};exports[_0x68cb('0x1c')]=function(_0x4c75a6,_0x19da50){return db[_0x68cb('0x2b')][_0x68cb('0x34')]({'where':{'id':_0x4c75a6[_0x68cb('0x38')]['id']}})[_0x68cb('0x1b')](handleEntityNotFound(_0x19da50,null))[_0x68cb('0x1b')](removeEntity(_0x19da50,null))['catch'](handleError(_0x19da50,null));};exports[_0x68cb('0x39')]=function(_0x798dc2,_0x1dc9bd){return db[_0x68cb('0x2b')]['describe']()['then'](respondWithResult(_0x1dc9bd,null))[_0x68cb('0x28')](handleError(_0x1dc9bd,null));};exports['addMessage']=function(_0x317be6,_0x4dc622){return db[_0x68cb('0x3a')]['find']({'where':{'id':_0x317be6[_0x68cb('0x38')]['id']}})[_0x68cb('0x1b')](handleEntityNotFound(_0x4dc622,null))[_0x68cb('0x1b')](function(_0x2bcd92){if(_0x2bcd92){return _0x2bcd92['addMessage'](_0x317be6['body'][_0x68cb('0x3b')],_['omit'](_0x317be6[_0x68cb('0x36')],[_0x68cb('0x3b'),'id'])||{});}})['then'](respondWithResult(_0x4dc622,null))[_0x68cb('0x28')](handleError(_0x4dc622,null));};exports[_0x68cb('0x3c')]=function(_0x1a5953,_0x2d03fb){var _0x550c64={'raw':![],'where':{}};var _0x120363={};var _0x5e4045={'count':0x0,'rows':[]};return db[_0x68cb('0x2b')][_0x68cb('0x3d')]({'where':{'id':_0x1a5953[_0x68cb('0x38')]['id']}})[_0x68cb('0x1b')](handleEntityNotFound(_0x2d03fb,null))['then'](function(_0x41488e){if(_0x41488e){_0x120363['model']=_[_0x68cb('0x2a')](db[_0x68cb('0x3a')]['rawAttributes']);_0x120363[_0x68cb('0x27')]=_[_0x68cb('0x2a')](_0x1a5953[_0x68cb('0x27')]);_0x120363[_0x68cb('0x2c')]=_[_0x68cb('0x2d')](_0x120363[_0x68cb('0x29')],_0x120363[_0x68cb('0x27')]);_0x550c64['attributes']=_[_0x68cb('0x2d')](_0x120363[_0x68cb('0x29')],qs['fields'](_0x1a5953[_0x68cb('0x27')][_0x68cb('0x2f')]));_0x550c64['attributes']=_0x550c64['attributes'][_0x68cb('0x3e')]?_0x550c64['attributes']:_0x120363[_0x68cb('0x29')];if(!_0x1a5953[_0x68cb('0x27')][_0x68cb('0x3f')](_0x68cb('0x40'))){_0x550c64['limit']=qs[_0x68cb('0x18')](_0x1a5953[_0x68cb('0x27')]['limit']);_0x550c64['offset']=qs[_0x68cb('0x16')](_0x1a5953[_0x68cb('0x27')][_0x68cb('0x16')]);}_0x550c64[_0x68cb('0x41')]=qs['sort'](_0x1a5953['query'][_0x68cb('0x42')]);_0x550c64[_0x68cb('0x43')]=qs[_0x68cb('0x2c')](_[_0x68cb('0x44')](_0x1a5953['query'],_0x120363[_0x68cb('0x2c')]));_0x550c64[_0x68cb('0x43')][_0x68cb('0x45')]=_0x41488e['id'];if(_0x1a5953[_0x68cb('0x27')][_0x68cb('0x46')]){_0x550c64['where']=_[_0x68cb('0x32')](_0x550c64[_0x68cb('0x43')],{'$or':_[_0x68cb('0x47')](_0x550c64[_0x68cb('0x2e')],function(_0x44a0b7){var _0x3ca2c5={};_0x3ca2c5[_0x44a0b7]={'$like':'%'+_0x1a5953[_0x68cb('0x27')]['filter']+'%'};return _0x3ca2c5;})});}if(_0x1a5953[_0x68cb('0x27')][_0x68cb('0x48')]){var _0x4c8167=_0x1a5953[_0x68cb('0x27')][_0x68cb('0x48')][_0x68cb('0x49')](',');var _0x5b1e0d={};_0x5b1e0d[_0x4c8167[0x0]]={'$gte':moment(_0x4c8167[0x1])[_0x68cb('0x4a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x550c64[_0x68cb('0x43')]=_[_0x68cb('0x32')](_0x550c64[_0x68cb('0x43')],_0x5b1e0d);}_0x550c64=_[_0x68cb('0x32')]({},_0x550c64,_0x1a5953['options']);return db[_0x68cb('0x3a')]['count']({'where':_0x550c64[_0x68cb('0x43')]})[_0x68cb('0x1b')](function(_0x4ae9f4){_0x5e4045[_0x68cb('0x19')]=_0x4ae9f4;if(_0x1a5953[_0x68cb('0x27')][_0x68cb('0x30')]){_0x550c64[_0x68cb('0x31')]=[{'all':!![]}];}return db[_0x68cb('0x3a')]['findAll'](_0x550c64);})[_0x68cb('0x1b')](function(_0x59a299){_0x5e4045[_0x68cb('0x4b')]=_0x59a299;return _0x5e4045;});}})[_0x68cb('0x1b')](respondWithFilteredResult(_0x2d03fb,_0x550c64))[_0x68cb('0x28')](handleError(_0x2d03fb,null));};exports[_0x68cb('0x4c')]=function(_0x36fe8b,_0x1ce889){return db[_0x68cb('0x2b')]['find']({'where':{'id':_0x36fe8b['params']['id']}})[_0x68cb('0x1b')](handleEntityNotFound(_0x1ce889,null))['then'](function(_0x331aa3){if(_0x331aa3){return _0x331aa3[_0x68cb('0x4d')](_0x36fe8b[_0x68cb('0x36')]['ids'],_[_0x68cb('0x4e')](_0x36fe8b['body'],['ids','id'])||{})[_0x68cb('0x4f')](function(){return db[_0x68cb('0x50')][_0x68cb('0x26')]({'attributes':['id','name',_0x68cb('0x51')],'where':{'id':_0x36fe8b[_0x68cb('0x36')][_0x68cb('0x3b')]}});})[_0x68cb('0x1b')](function(_0x174002){socket[_0x68cb('0x52')]('faxInteractionTags:save',{'id':Number(_0x36fe8b['params']['id']),'tags':_0x174002||[]});return{'id':Number(_0x36fe8b[_0x68cb('0x38')]['id']),'tags':_0x174002||[]};});}})[_0x68cb('0x1b')](respondWithResult(_0x1ce889,null))[_0x68cb('0x28')](handleError(_0x1ce889,null));};exports['removeTags']=function(_0x1daa24,_0x3b4dd7){return db[_0x68cb('0x2b')][_0x68cb('0x34')]({'where':{'id':_0x1daa24[_0x68cb('0x38')]['id']}})['then'](handleEntityNotFound(_0x3b4dd7,null))[_0x68cb('0x1b')](function(_0xbe7dff){if(_0xbe7dff){return _0xbe7dff[_0x68cb('0x53')](_0x1daa24[_0x68cb('0x27')][_0x68cb('0x3b')]);}})['then'](respondWithStatusCode(_0x3b4dd7,null))[_0x68cb('0x28')](handleError(_0x3b4dd7,null));};exports[_0x68cb('0x54')]=function(_0xf32d3,_0x1b2f72){var _0xb0f8b1=moment()[_0x68cb('0x55')]()['toString']();var _0x504107=path['join'](config[_0x68cb('0x56')],_0x68cb('0x57'),_0x68cb('0x58'),'tmp');var _0x338ee5=path[_0x68cb('0x59')](config[_0x68cb('0x56')],_0x68cb('0x57'),'files',_0x68cb('0x5a'));var _0x542572=path[_0x68cb('0x59')](_0x504107,_0xb0f8b1);var _0xd9c8e2=util[_0x68cb('0x4a')](_0x68cb('0x5b'),_0xf32d3['params']['id'],_0xb0f8b1);var _0x332a68=path['join'](_0x504107,_0xd9c8e2);var _0x451d47=[];_0x451d47[_0x68cb('0x5c')]({'model':db[_0x68cb('0x5d')],'as':_0x68cb('0x5d'),'raw':!![]});var _0x39cb1b=[{'model':db[_0x68cb('0x3a')],'as':_0x68cb('0x5e'),'attributes':['id','body',_0x68cb('0x5f')],'include':_0x451d47}];return db[_0x68cb('0x2b')]['find']({'where':{'id':_0xf32d3[_0x68cb('0x38')]['id']},'include':_0x39cb1b})['then'](handleEntityNotFound(_0x1b2f72,null))[_0x68cb('0x1b')](function(_0x35d497){if(_0x35d497&&_0x35d497[_0x68cb('0x5e')]){var _0x26ef6f=_0x35d497['get']({'plain':!![]});fs[_0x68cb('0x60')](_0x542572);for(var _0x26aa1e=0x0;_0x26aa1e<_0x26ef6f['Messages'][_0x68cb('0x3e')];_0x26aa1e++){var _0x34af15=_0x26ef6f[_0x68cb('0x5e')][_0x26aa1e][_0x68cb('0x5d')];if(_0x34af15){var _0x1cc5d6=path[_0x68cb('0x59')](_0x338ee5,_0x34af15[_0x68cb('0x61')]);if(fs['existsSync'](_0x1cc5d6)){fs[_0x68cb('0x62')](_0x1cc5d6)[_0x68cb('0x63')](fs[_0x68cb('0x64')](path[_0x68cb('0x59')](_0x542572,_0x34af15[_0x68cb('0x61')])));}}}return BPromise[_0x68cb('0x65')]()[_0x68cb('0x1b')](function(){return new BPromise(function(_0x33c8fc,_0x5a0a74){zipdir(_0x542572,{'saveTo':_0x332a68},function(_0x1ded69,_0x20d157){if(_0x1ded69)return _0x5a0a74(_0x1ded69);return _0x33c8fc(_0x20d157);});})[_0x68cb('0x1b')](function(){return new BPromise(function(_0x593d93,_0x3f8e47){rimraf(_0x542572,function(_0x22f67b){if(_0x22f67b)_0x3f8e47(_0x22f67b);return _0x593d93();});});})[_0x68cb('0x1b')](function(){return _0x1b2f72['download'](_0x332a68,_0xd9c8e2,function(_0x1d40d9){if(_0x1d40d9){console[_0x68cb('0x66')](_0x68cb('0x67'),_0x1d40d9);}else{fs[_0x68cb('0x68')](_0x332a68);}});});});}else{return _0x1b2f72[_0x68cb('0x12')](0xc8);}})[_0x68cb('0x28')](handleError(_0x1b2f72,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 4ec49bc..b6e66e7 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 _0xc12c=['setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage'];(function(_0x4c14ac,_0x20d66b){var _0xed83f9=function(_0x2c71de){while(--_0x2c71de){_0x4c14ac['push'](_0x4c14ac['shift']());}};_0xed83f9(++_0x20d66b);}(_0xc12c,0xec));var _0xcc12=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0xc12c[_0x2cf2e9];return _0xd3670d;};'use strict';var EventEmitter=require(_0xcc12('0x0'));var FaxInteraction=require(_0xcc12('0x1'))['db'][_0xcc12('0x2')];var FaxMessage=require(_0xcc12('0x1'))['db'][_0xcc12('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xcc12('0x4')](0x0);var events={'afterCreate':_0xcc12('0x5'),'afterUpdate':_0xcc12('0x6'),'afterDestroy':_0xcc12('0x7')};function emitEvent(_0x2c00d0){return function(_0x16d4c6,_0x4fbff5,_0x1f7bf5){_0x16d4c6['getUsers']({'attributes':['id'],'raw':!![]})[_0xcc12('0x8')](function(_0x59651f){_0x16d4c6[_0xcc12('0x9')](_0xcc12('0xa'),_0x59651f[_0xcc12('0xb')](function(_0x1a5241){return{'id':_0x1a5241['id']};}));return FaxMessage[_0xcc12('0xc')]({'where':{'FaxInteractionId':_0x16d4c6['id'],'direction':'in','read':![]},'raw':!![]});})[_0xcc12('0x8')](function(_0x1da8c4){_0x16d4c6['setDataValue'](_0xcc12('0xd'),_0x1da8c4[_0xcc12('0xe')]);FaxInteractionEvents['emit'](_0x2c00d0+':'+_0x16d4c6['id'],_0x16d4c6);FaxInteractionEvents[_0xcc12('0xf')](_0x2c00d0,_0x16d4c6);_0x1f7bf5(null);})[_0xcc12('0x10')](_0x1f7bf5(null));};}for(var e in events){if(events[_0xcc12('0x11')](e)){var event=events[e];FaxInteraction[_0xcc12('0x12')](e,emitEvent(event));}}module[_0xcc12('0x13')]=FaxInteractionEvents; \ No newline at end of file +var _0x53ae=['update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hook','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x53ae,0x174));var _0xe53a=function(_0x2ae91b,_0xe465b3){_0x2ae91b=_0x2ae91b-0x0;var _0x2356cd=_0x53ae[_0x2ae91b];return _0x2356cd;};'use strict';var EventEmitter=require(_0xe53a('0x0'));var FaxInteraction=require(_0xe53a('0x1'))['db'][_0xe53a('0x2')];var FaxMessage=require(_0xe53a('0x1'))['db'][_0xe53a('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xe53a('0x4')](0x0);var events={'afterCreate':_0xe53a('0x5'),'afterUpdate':_0xe53a('0x6'),'afterDestroy':_0xe53a('0x7')};function emitEvent(_0x571a6b){return function(_0xbe966,_0x4c0ffd,_0x52da31){_0xbe966[_0xe53a('0x8')]({'attributes':['id'],'raw':!![]})[_0xe53a('0x9')](function(_0x21c955){_0xbe966[_0xe53a('0xa')](_0xe53a('0xb'),_0x21c955[_0xe53a('0xc')](function(_0xbbacaf){return{'id':_0xbbacaf['id']};}));return FaxMessage[_0xe53a('0xd')]({'where':{'FaxInteractionId':_0xbe966['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe53a('0x9')](function(_0x56b2b8){_0xbe966[_0xe53a('0xa')](_0xe53a('0xe'),_0x56b2b8['length']);FaxInteractionEvents[_0xe53a('0xf')](_0x571a6b+':'+_0xbe966['id'],_0xbe966);FaxInteractionEvents['emit'](_0x571a6b,_0xbe966);_0x52da31(null);})[_0xe53a('0x10')](_0x52da31(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0xe53a('0x11')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index d5c7659..41c159b 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 _0x5354=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','bluebird','request-promise','path','rimraf','exports','define','FaxInteraction','fax_interactions','closed'];(function(_0x1f1507,_0x18fdd8){var _0x2036e6=function(_0xd97c42){while(--_0xd97c42){_0x1f1507['push'](_0x1f1507['shift']());}};_0x2036e6(++_0x18fdd8);}(_0x5354,0x199));var _0x4535=function(_0x34d9d7,_0x35e020){_0x34d9d7=_0x34d9d7-0x0;var _0x18a009=_0x5354[_0x34d9d7];return _0x18a009;};'use strict';var _=require(_0x4535('0x0'));var util=require(_0x4535('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4535('0x2'));var rp=require(_0x4535('0x3'));var fs=require('fs');var path=require(_0x4535('0x4'));var rimraf=require(_0x4535('0x5'));var config=require('../../config/environment');var attributes=require('./faxInteraction.attributes');module[_0x4535('0x6')]=function(_0xa7fdb7,_0x3d2133){return _0xa7fdb7[_0x4535('0x7')](_0x4535('0x8'),attributes,{'tableName':_0x4535('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x424fa4,_0x238134,_0x4ae1b8){if(_0x424fa4['changed'](_0x4535('0xa'))){_0x424fa4[_0x4535('0xb')]=moment()[_0x4535('0xc')](_0x4535('0xd'));}_0x4ae1b8(null,_0x424fa4);}}});}; \ No newline at end of file +var _0xfa89=['changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','fax_interactions'];(function(_0x202962,_0x4baf03){var _0x4896a0=function(_0x10c05b){while(--_0x10c05b){_0x202962['push'](_0x202962['shift']());}};_0x4896a0(++_0x4baf03);}(_0xfa89,0x64));var _0x9fa8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfa89[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x9fa8('0x0'));var logger=require(_0x9fa8('0x1'))(_0x9fa8('0x2'));var moment=require(_0x9fa8('0x3'));var BPromise=require(_0x9fa8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9fa8('0x5'));var rimraf=require(_0x9fa8('0x6'));var config=require(_0x9fa8('0x7'));var attributes=require(_0x9fa8('0x8'));module[_0x9fa8('0x9')]=function(_0xff0d12,_0x318040){return _0xff0d12[_0x9fa8('0xa')]('FaxInteraction',attributes,{'tableName':_0x9fa8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xb30e0e,_0x1ec564,_0x48c17d){if(_0xb30e0e[_0x9fa8('0xc')]('closed')){_0xb30e0e[_0x9fa8('0xd')]=moment()[_0x9fa8('0xe')](_0x9fa8('0xf'));}_0x48c17d(null,_0xb30e0e);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 7ce8cc6..1259df7 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 _0xca50=['FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateFaxInteraction','update','options','attributes','catch','FaxInteraction','find','where','addTags','body','ids','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info'];(function(_0x5a5b8c,_0x504e9d){var _0x20c020=function(_0x2920c4){while(--_0x2920c4){_0x5a5b8c['push'](_0x5a5b8c['shift']());}};_0x20c020(++_0x504e9d);}(_0xca50,0xbe));var _0x0ca5=function(_0x4ac998,_0x5b814e){_0x4ac998=_0x4ac998-0x0;var _0x253a92=_0xca50[_0x4ac998];return _0x253a92;};'use strict';var _=require(_0x0ca5('0x0'));var util=require(_0x0ca5('0x1'));var moment=require(_0x0ca5('0x2'));var BPromise=require(_0x0ca5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ca5('0x4'));var db=require(_0x0ca5('0x5'))['db'];var utils=require(_0x0ca5('0x6'));var logger=require(_0x0ca5('0x7'))(_0x0ca5('0x8'));var config=require(_0x0ca5('0x9'));var jayson=require(_0x0ca5('0xa'));var client=jayson['client'][_0x0ca5('0xb')]({'port':0x232a});config[_0x0ca5('0xc')]=_[_0x0ca5('0xd')](config[_0x0ca5('0xc')],{'host':_0x0ca5('0xe'),'port':0x18eb});var socket=require(_0x0ca5('0xf'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0x0ca5('0x10')](socket);function respondWithRpcPromise(_0x28ab7d,_0x2b8b01,_0xf8b7d4){return new BPromise(function(_0x42f35e,_0x1869bc){return client[_0x0ca5('0x11')](_0x28ab7d,_0xf8b7d4)[_0x0ca5('0x12')](function(_0x1f5102){logger[_0x0ca5('0x13')](_0x0ca5('0x14'),_0x2b8b01,_0x0ca5('0x15'));logger[_0x0ca5('0x16')](_0x0ca5('0x17'),_0x2b8b01,_0x0ca5('0x15'),JSON[_0x0ca5('0x18')](_0x1f5102));if(_0x1f5102[_0x0ca5('0x19')]){if(_0x1f5102[_0x0ca5('0x19')][_0x0ca5('0x1a')]===0x1f4){logger[_0x0ca5('0x19')](_0x0ca5('0x14'),_0x2b8b01,_0x1f5102[_0x0ca5('0x19')][_0x0ca5('0x1b')]);return _0x1869bc(_0x1f5102[_0x0ca5('0x19')][_0x0ca5('0x1b')]);}logger[_0x0ca5('0x19')](_0x0ca5('0x14'),_0x2b8b01,_0x1f5102[_0x0ca5('0x19')]['message']);return _0x42f35e(_0x1f5102[_0x0ca5('0x19')]['message']);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x2b8b01,_0x0ca5('0x15'));_0x42f35e(_0x1f5102[_0x0ca5('0x1c')][_0x0ca5('0x1b')]);}})['catch'](function(_0x52a659){logger[_0x0ca5('0x19')](_0x0ca5('0x14'),_0x2b8b01,_0x52a659);_0x1869bc(_0x52a659);});});}exports[_0x0ca5('0x1d')]=function(_0x4b9327){var _0x9196b2=this;return new Promise(function(_0x2b5305,_0x22671e){return db['FaxInteraction'][_0x0ca5('0x1e')](_0x4b9327['body'],{'raw':_0x4b9327[_0x0ca5('0x1f')]?_0x4b9327[_0x0ca5('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b9327['options']?_0x4b9327[_0x0ca5('0x1f')]['where']||null:null,'attributes':_0x4b9327[_0x0ca5('0x1f')]?_0x4b9327[_0x0ca5('0x1f')][_0x0ca5('0x20')]||null:null,'limit':_0x4b9327[_0x0ca5('0x1f')]?_0x4b9327[_0x0ca5('0x1f')]['limit']||null:null})[_0x0ca5('0x12')](function(_0x3f8374){logger[_0x0ca5('0x13')](_0x0ca5('0x1d'),_0x4b9327);logger[_0x0ca5('0x16')](_0x0ca5('0x1d'),_0x4b9327,JSON[_0x0ca5('0x18')](_0x3f8374));_0x2b5305(_0x3f8374);})[_0x0ca5('0x21')](function(_0x155be6){logger[_0x0ca5('0x19')](_0x0ca5('0x1d'),_0x155be6[_0x0ca5('0x1b')],_0x4b9327);_0x22671e(_0x9196b2['error'](0x1f4,_0x155be6[_0x0ca5('0x1b')]));});});};exports['AddTagsToFaxInteraction']=function(_0x1d697f){return new Promise(function(_0x144860,_0xcb3472){return db[_0x0ca5('0x22')][_0x0ca5('0x23')]({'where':_0x1d697f[_0x0ca5('0x1f')]?_0x1d697f[_0x0ca5('0x1f')][_0x0ca5('0x24')]||null:null})[_0x0ca5('0x12')](function(_0x1069d1){if(_0x1069d1){return _0x1069d1[_0x0ca5('0x25')](_0x1d697f[_0x0ca5('0x26')][_0x0ca5('0x27')],_['omit'](_0x1d697f[_0x0ca5('0x26')],[_0x0ca5('0x27'),'id'])||{});}})[_0x0ca5('0x28')](function(_0x57db33){logger[_0x0ca5('0x13')](_0x0ca5('0x29'),_0x1d697f);logger[_0x0ca5('0x16')]('AddTags',_0x1d697f,JSON[_0x0ca5('0x18')](_0x57db33));_0x144860(_0x57db33);})['catch'](function(_0xe619f8){logger['error'](_0x0ca5('0x29'),_0xe619f8[_0x0ca5('0x1b')],_0x1d697f);_0xcb3472(_this[_0x0ca5('0x19')](0x1f4,_0xe619f8[_0x0ca5('0x1b')]));});});}; \ No newline at end of file +var _0x7937=['client','redis','localhost','./faxInteraction.socket','register','request','then','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxInteraction,\x20%s,\x20%s','message','result','catch','UpdateFaxInteraction','FaxInteraction','body','options','where','attributes','limit','AddTagsToFaxInteraction','ids','omit','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x705202,_0x5866d1){var _0x54e775=function(_0x4b48af){while(--_0x4b48af){_0x705202['push'](_0x705202['shift']());}};_0x54e775(++_0x5866d1);}(_0x7937,0x120));var _0x7793=function(_0x255c48,_0x2a4449){_0x255c48=_0x255c48-0x0;var _0xaebda3=_0x7937[_0x255c48];return _0xaebda3;};'use strict';var _=require(_0x7793('0x0'));var util=require(_0x7793('0x1'));var moment=require('moment');var BPromise=require(_0x7793('0x2'));var rs=require(_0x7793('0x3'));var fs=require('fs');var Redis=require(_0x7793('0x4'));var db=require(_0x7793('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7793('0x6'))(_0x7793('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7793('0x8')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x7793('0x9')],{'host':_0x7793('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7793('0xb'))[_0x7793('0xc')](socket);function respondWithRpcPromise(_0x225a1d,_0xeda776,_0x24ff0b){return new BPromise(function(_0x4ca730,_0x2a400b){return client[_0x7793('0xd')](_0x225a1d,_0x24ff0b)[_0x7793('0xe')](function(_0x510f75){logger[_0x7793('0xf')]('FaxInteraction,\x20%s,\x20%s',_0xeda776,_0x7793('0x10'));logger[_0x7793('0x11')](_0x7793('0x12'),_0xeda776,'request\x20sent',JSON[_0x7793('0x13')](_0x510f75));if(_0x510f75[_0x7793('0x14')]){if(_0x510f75[_0x7793('0x14')][_0x7793('0x15')]===0x1f4){logger['error'](_0x7793('0x16'),_0xeda776,_0x510f75[_0x7793('0x14')]['message']);return _0x2a400b(_0x510f75[_0x7793('0x14')]['message']);}logger[_0x7793('0x14')]('FaxInteraction,\x20%s,\x20%s',_0xeda776,_0x510f75['error'][_0x7793('0x17')]);return _0x4ca730(_0x510f75[_0x7793('0x14')][_0x7793('0x17')]);}else{logger[_0x7793('0xf')](_0x7793('0x16'),_0xeda776,_0x7793('0x10'));_0x4ca730(_0x510f75[_0x7793('0x18')][_0x7793('0x17')]);}})[_0x7793('0x19')](function(_0x31616d){logger[_0x7793('0x14')](_0x7793('0x16'),_0xeda776,_0x31616d);_0x2a400b(_0x31616d);});});}exports[_0x7793('0x1a')]=function(_0x2a80bd){var _0x152346=this;return new Promise(function(_0x5ae5cc,_0x5c877b){return db[_0x7793('0x1b')]['update'](_0x2a80bd[_0x7793('0x1c')],{'raw':_0x2a80bd[_0x7793('0x1d')]?_0x2a80bd[_0x7793('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a80bd[_0x7793('0x1d')]?_0x2a80bd[_0x7793('0x1d')][_0x7793('0x1e')]||null:null,'attributes':_0x2a80bd[_0x7793('0x1d')]?_0x2a80bd['options'][_0x7793('0x1f')]||null:null,'limit':_0x2a80bd[_0x7793('0x1d')]?_0x2a80bd[_0x7793('0x1d')][_0x7793('0x20')]||null:null})[_0x7793('0xe')](function(_0x20cd21){logger[_0x7793('0xf')]('UpdateFaxInteraction',_0x2a80bd);logger[_0x7793('0x11')](_0x7793('0x1a'),_0x2a80bd,JSON['stringify'](_0x20cd21));_0x5ae5cc(_0x20cd21);})[_0x7793('0x19')](function(_0x454a7b){logger[_0x7793('0x14')](_0x7793('0x1a'),_0x454a7b[_0x7793('0x17')],_0x2a80bd);_0x5c877b(_0x152346[_0x7793('0x14')](0x1f4,_0x454a7b['message']));});});};exports[_0x7793('0x21')]=function(_0x3f08b5){return new Promise(function(_0x5b2eff,_0x282dc4){return db[_0x7793('0x1b')]['find']({'where':_0x3f08b5[_0x7793('0x1d')]?_0x3f08b5[_0x7793('0x1d')]['where']||null:null})[_0x7793('0xe')](function(_0x266648){if(_0x266648){return _0x266648['addTags'](_0x3f08b5[_0x7793('0x1c')][_0x7793('0x22')],_[_0x7793('0x23')](_0x3f08b5[_0x7793('0x1c')],['ids','id'])||{});}})['spread'](function(_0x5ad2b2){logger[_0x7793('0xf')](_0x7793('0x24'),_0x3f08b5);logger[_0x7793('0x11')]('AddTags',_0x3f08b5,JSON[_0x7793('0x13')](_0x5ad2b2));_0x5b2eff(_0x5ad2b2);})[_0x7793('0x19')](function(_0x1f6a39){logger[_0x7793('0x14')](_0x7793('0x24'),_0x1f6a39[_0x7793('0x17')],_0x3f08b5);_0x282dc4(_this[_0x7793('0x14')](0x1f4,_0x1f6a39[_0x7793('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index bf30ff5..d012686 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 _0x1bc4=['remove','update','emit','removeListener','save'];(function(_0x42d525,_0x1247cb){var _0x7f0c3c=function(_0x5016f1){while(--_0x5016f1){_0x42d525['push'](_0x42d525['shift']());}};_0x7f0c3c(++_0x1247cb);}(_0x1bc4,0x1ee));var _0x41bc=function(_0x14ba8c,_0x55f284){_0x14ba8c=_0x14ba8c-0x0;var _0x59da74=_0x1bc4[_0x14ba8c];return _0x59da74;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x41bc('0x0'),_0x41bc('0x1'),_0x41bc('0x2')];function createListener(_0x3cbac8,_0x2978a1){return function(_0x1f70b7){_0x2978a1[_0x41bc('0x3')](_0x3cbac8,_0x1f70b7);};}function removeListener(_0x2da297,_0x132bf9){return function(){FaxInteractionEvents[_0x41bc('0x4')](_0x2da297,_0x132bf9);};}exports['register']=function(_0x59ebf5){for(var _0x79fdd4=0x0,_0x1dcce1=events['length'];_0x79fdd4<_0x1dcce1;_0x79fdd4++){var _0x369f68=events[_0x79fdd4];var _0x4efe06=createListener('faxInteraction:'+_0x369f68,_0x59ebf5);FaxInteractionEvents['on'](_0x369f68,_0x4efe06);}}; \ No newline at end of file +var _0x911c=['faxInteraction:','./faxInteraction.events','save','remove','update','emit','register','length'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x911c,0x169));var _0xc911=function(_0x3f465d,_0xbd2037){_0x3f465d=_0x3f465d-0x0;var _0x121ad1=_0x911c[_0x3f465d];return _0x121ad1;};'use strict';var FaxInteractionEvents=require(_0xc911('0x0'));var events=[_0xc911('0x1'),_0xc911('0x2'),_0xc911('0x3')];function createListener(_0x5d3dd2,_0x316db2){return function(_0xe1cd02){_0x316db2[_0xc911('0x4')](_0x5d3dd2,_0xe1cd02);};}function removeListener(_0x1c61ff,_0x25097d){return function(){FaxInteractionEvents['removeListener'](_0x1c61ff,_0x25097d);};}exports[_0xc911('0x5')]=function(_0x14a749){for(var _0x31ebba=0x0,_0x1797e1=events[_0xc911('0x6')];_0x31ebba<_0x1797e1;_0x31ebba++){var _0x55d7b0=events[_0x31ebba];var _0x2f78e6=createListener(_0xc911('0x7')+_0x55d7b0,_0x14a749);FaxInteractionEvents['on'](_0x55d7b0,_0x2f78e6);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 61de884..62ef41c 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 _0x1e79=['delete','faxinteraction:destroy','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','./faxInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','download','post','addMessage','/:id/tags','fax','faxinteraction:addtags','put','tracked','faxinteraction:update','update'];(function(_0x5ef9b,_0x27b3d8){var _0x1dc87d=function(_0x453c2b){while(--_0x453c2b){_0x5ef9b['push'](_0x5ef9b['shift']());}};_0x1dc87d(++_0x27b3d8);}(_0x1e79,0xff));var _0x91e7=function(_0x35169a,_0x509966){_0x35169a=_0x35169a-0x0;var _0x23eff3=_0x1e79[_0x35169a];return _0x23eff3;};'use strict';var multer=require(_0x91e7('0x0'));var util=require(_0x91e7('0x1'));var path=require(_0x91e7('0x2'));var timeout=require('connect-timeout');var express=require(_0x91e7('0x3'));var router=express[_0x91e7('0x4')]();var fs_extra=require(_0x91e7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x91e7('0x6'));var config=require('../../config/environment');var controller=require(_0x91e7('0x7'));router[_0x91e7('0x8')]('/',auth[_0x91e7('0x9')](),controller[_0x91e7('0xa')]);router[_0x91e7('0x8')](_0x91e7('0xb'),auth[_0x91e7('0x9')](),controller['describe']);router[_0x91e7('0x8')](_0x91e7('0xc'),auth['isAuthenticated'](),controller[_0x91e7('0xd')]);router[_0x91e7('0x8')](_0x91e7('0xe'),auth[_0x91e7('0x9')](),controller['getMessages']);router['get']('/:id/download',auth[_0x91e7('0x9')](),controller[_0x91e7('0xf')]);router[_0x91e7('0x10')]('/',auth[_0x91e7('0x9')](),controller['create']);router[_0x91e7('0x10')]('/:id/messages',auth[_0x91e7('0x9')](),controller[_0x91e7('0x11')]);router[_0x91e7('0x10')](_0x91e7('0x12'),auth[_0x91e7('0x9')](),interaction['tracked'](_0x91e7('0x13'),_0x91e7('0x14')),controller['addTags']);router[_0x91e7('0x15')]('/:id',auth[_0x91e7('0x9')](),interaction[_0x91e7('0x16')](_0x91e7('0x13'),_0x91e7('0x17')),controller[_0x91e7('0x18')]);router[_0x91e7('0x19')](_0x91e7('0xc'),auth[_0x91e7('0x9')](),interaction['tracked'](_0x91e7('0x13'),_0x91e7('0x1a')),controller[_0x91e7('0x1b')]);router[_0x91e7('0x19')](_0x91e7('0x12'),auth[_0x91e7('0x9')](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0xfdb0=['destroy','/:id/tags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','index','/describe','/:id','isAuthenticated','show','getMessages','download','create','/:id/messages','addMessage','faxinteraction:addtags','put','tracked','fax','faxinteraction:update','update','delete','faxinteraction:destroy'];(function(_0x528bac,_0x14c45c){var _0x1b0909=function(_0xe60840){while(--_0xe60840){_0x528bac['push'](_0x528bac['shift']());}};_0x1b0909(++_0x14c45c);}(_0xfdb0,0x10b));var _0x0fdb=function(_0x2baf98,_0x30c16b){_0x2baf98=_0x2baf98-0x0;var _0x4faf51=_0xfdb0[_0x2baf98];return _0x4faf51;};'use strict';var multer=require(_0x0fdb('0x0'));var util=require(_0x0fdb('0x1'));var path=require(_0x0fdb('0x2'));var timeout=require(_0x0fdb('0x3'));var express=require(_0x0fdb('0x4'));var router=express[_0x0fdb('0x5')]();var fs_extra=require(_0x0fdb('0x6'));var auth=require(_0x0fdb('0x7'));var interaction=require(_0x0fdb('0x8'));var config=require(_0x0fdb('0x9'));var controller=require(_0x0fdb('0xa'));router[_0x0fdb('0xb')]('/',auth['isAuthenticated'](),controller[_0x0fdb('0xc')]);router[_0x0fdb('0xb')](_0x0fdb('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x0fdb('0xb')](_0x0fdb('0xe'),auth[_0x0fdb('0xf')](),controller[_0x0fdb('0x10')]);router[_0x0fdb('0xb')]('/:id/messages',auth[_0x0fdb('0xf')](),controller[_0x0fdb('0x11')]);router[_0x0fdb('0xb')]('/:id/download',auth[_0x0fdb('0xf')](),controller[_0x0fdb('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0fdb('0x13')]);router['post'](_0x0fdb('0x14'),auth['isAuthenticated'](),controller[_0x0fdb('0x15')]);router['post']('/:id/tags',auth['isAuthenticated'](),interaction['tracked']('fax',_0x0fdb('0x16')),controller['addTags']);router[_0x0fdb('0x17')](_0x0fdb('0xe'),auth[_0x0fdb('0xf')](),interaction[_0x0fdb('0x18')](_0x0fdb('0x19'),_0x0fdb('0x1a')),controller[_0x0fdb('0x1b')]);router[_0x0fdb('0x1c')]('/:id',auth[_0x0fdb('0xf')](),interaction[_0x0fdb('0x18')]('fax',_0x0fdb('0x1d')),controller[_0x0fdb('0x1e')]);router['delete'](_0x0fdb('0x1f'),auth[_0x0fdb('0xf')](),controller['removeTags']);module[_0x0fdb('0x20')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 5331f48..d5536cb 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 _0xa4fb=['out','sequelize','exports','TEXT','medium'];(function(_0x5c64b2,_0x59a7e6){var _0x5bb7d6=function(_0x5e468e){while(--_0x5e468e){_0x5c64b2['push'](_0x5c64b2['shift']());}};_0x5bb7d6(++_0x59a7e6);}(_0xa4fb,0x150));var _0xba4f=function(_0x4207f4,_0x1f778b){_0x4207f4=_0x4207f4-0x0;var _0x29a621=_0xa4fb[_0x4207f4];return _0x29a621;};'use strict';var Sequelize=require(_0xba4f('0x0'));module[_0xba4f('0x1')]={'body':{'type':Sequelize[_0xba4f('0x2')](_0xba4f('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xba4f('0x4')),'defaultValue':_0xba4f('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xba4f('0x2')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x8388=['TEXT','medium','ENUM','out','DATE','sequelize','exports'];(function(_0x4a3e41,_0x58bd5e){var _0x15db0b=function(_0x4ff639){while(--_0x4ff639){_0x4a3e41['push'](_0x4a3e41['shift']());}};_0x15db0b(++_0x58bd5e);}(_0x8388,0x18d));var _0x8838=function(_0x5c1cdc,_0x322014){_0x5c1cdc=_0x5c1cdc-0x0;var _0x2e8317=_0x8388[_0x5c1cdc];return _0x2e8317;};'use strict';var Sequelize=require(_0x8838('0x0'));module[_0x8838('0x1')]={'body':{'type':Sequelize[_0x8838('0x2')](_0x8838('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x8838('0x4')]('in',_0x8838('0x5')),'defaultValue':_0x8838('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x8838('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x8838('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 5c0bb15..0dd65bb 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 _0x2bf3=['FaxAccountId','/var/opt/motion2/server/files/attachments/%s','download','join','root','files','Attachment','basename','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','http','client','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','FaxMessage,\x20%s,\x20%s','result','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','destroy','end','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','catch','show','params','body','find','describe','fax-interactions','accept','fax','readAt','format','UserId','agent','get','FaxInteraction','FaxInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','sequelize','contact','fullname','create','CmContact','findOne','AttachmentId','SendFax'];(function(_0x3625b3,_0x559991){var _0x59597b=function(_0x3b752a){while(--_0x3b752a){_0x3625b3['push'](_0x3625b3['shift']());}};_0x59597b(++_0x559991);}(_0x2bf3,0x1be));var _0x32bf=function(_0x5dafbe,_0x4fdfd4){_0x5dafbe=_0x5dafbe-0x0;var _0x302dae=_0x2bf3[_0x5dafbe];return _0x302dae;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x32bf('0x0'));var zipdir=require(_0x32bf('0x1'));var jsonpatch=require(_0x32bf('0x2'));var rp=require(_0x32bf('0x3'));var moment=require(_0x32bf('0x4'));var BPromise=require(_0x32bf('0x5'));var Mustache=require(_0x32bf('0x6'));var util=require(_0x32bf('0x7'));var path=require(_0x32bf('0x8'));var sox=require(_0x32bf('0x9'));var csv=require(_0x32bf('0xa'));var ejs=require(_0x32bf('0xb'));var fs=require('fs');var fs_extra=require(_0x32bf('0xc'));var _=require(_0x32bf('0xd'));var squel=require(_0x32bf('0xe'));var crypto=require(_0x32bf('0xf'));var jsforce=require(_0x32bf('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x32bf('0x11'));var Papa=require(_0x32bf('0x12'));var Redis=require(_0x32bf('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x32bf('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x32bf('0x15'))(_0x32bf('0x16'));var utils=require(_0x32bf('0x17'));var config=require(_0x32bf('0x18'));var licenseUtil=require(_0x32bf('0x19'));var db=require(_0x32bf('0x1a'))['db'];config['redis']=_['defaults'](config[_0x32bf('0x1b')],{'host':_0x32bf('0x1c'),'port':0x18eb});var socket=require(_0x32bf('0x1d'))(new Redis(config[_0x32bf('0x1b')]));require(_0x32bf('0x1e'))[_0x32bf('0x1f')](socket);var jayson=require(_0x32bf('0x20'));var client=jayson['client'][_0x32bf('0x21')]({'port':0x232c});var client9002=jayson[_0x32bf('0x22')][_0x32bf('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x2b4c70,_0x416a9f,_0x251123,_0x1a23ca){return new BPromise(function(_0x324bb2,_0x97969e){var _0x1eb20b=_0x1a23ca||client;return _0x1eb20b[_0x32bf('0x23')](_0x2b4c70,_0x251123)[_0x32bf('0x24')](function(_0x553937){logger[_0x32bf('0x25')]('FaxMessage,\x20%s,\x20%s',_0x416a9f,_0x32bf('0x26'));logger[_0x32bf('0x27')](_0x32bf('0x28'),_0x416a9f,_0x32bf('0x26'),JSON[_0x32bf('0x29')](_0x553937));if(_0x553937[_0x32bf('0x2a')]){if(_0x553937[_0x32bf('0x2a')]['code']===0x1f4){logger[_0x32bf('0x2a')]('FaxMessage,\x20%s,\x20%s',_0x416a9f,_0x553937[_0x32bf('0x2a')][_0x32bf('0x2b')]);return _0x97969e(_0x553937[_0x32bf('0x2a')]['message']);}logger[_0x32bf('0x2a')](_0x32bf('0x2c'),_0x416a9f,_0x553937[_0x32bf('0x2a')][_0x32bf('0x2b')]);return _0x324bb2(_0x553937[_0x32bf('0x2a')][_0x32bf('0x2b')]);}else{logger[_0x32bf('0x25')](_0x32bf('0x2c'),_0x416a9f,_0x32bf('0x26'));_0x324bb2(_0x553937[_0x32bf('0x2d')]['message']);}})['catch'](function(_0x203873){logger[_0x32bf('0x2a')](_0x32bf('0x2c'),_0x416a9f,_0x203873);_0x97969e(_0x203873);});});}function respondWithStatusCode(_0x3bd8f8,_0x39a147){_0x39a147=_0x39a147||0xcc;return function(_0x2df916){if(_0x2df916){return _0x3bd8f8[_0x32bf('0x2e')](_0x39a147);}return _0x3bd8f8[_0x32bf('0x2f')](_0x39a147)['end']();};}function respondWithResult(_0x5595ff,_0x3f9460){_0x3f9460=_0x3f9460||0xc8;return function(_0x559251){if(_0x559251){return _0x5595ff[_0x32bf('0x2f')](_0x3f9460)['json'](_0x559251);}};}function respondWithFilteredResult(_0x579aa5,_0x48a6d0){return function(_0x3f4729){if(_0x3f4729){var _0x229ecb=typeof _0x48a6d0[_0x32bf('0x30')]==='undefined'&&typeof _0x48a6d0[_0x32bf('0x31')]===_0x32bf('0x32');var _0x534858=_0x3f4729[_0x32bf('0x33')];var _0x5cab02=_0x229ecb?0x0:_0x48a6d0['offset'];var _0x41132e=_0x229ecb?_0x3f4729['count']:_0x48a6d0[_0x32bf('0x30')]+_0x48a6d0['limit'];var _0x3e9c31;if(_0x41132e>=_0x534858){_0x41132e=_0x534858;_0x3e9c31=0xc8;}else{_0x3e9c31=0xce;}_0x579aa5[_0x32bf('0x2f')](_0x3e9c31);return _0x579aa5[_0x32bf('0x34')](_0x32bf('0x35'),_0x5cab02+'-'+_0x41132e+'/'+_0x534858)[_0x32bf('0x36')](_0x3f4729);}return null;};}function patchUpdates(_0x50fead){return function(_0x5abe2d){try{jsonpatch['apply'](_0x5abe2d,_0x50fead,!![]);}catch(_0xe0f144){return BPromise[_0x32bf('0x37')](_0xe0f144);}return _0x5abe2d[_0x32bf('0x38')]();};}function saveUpdates(_0x554fcd,_0x3631b1){return function(_0x1da01a){if(_0x1da01a){return _0x1da01a[_0x32bf('0x39')](_0x554fcd)['then'](function(_0x47c8d0){return _0x47c8d0;});}return null;};}function removeEntity(_0x26d954,_0x4dbb59){return function(_0xbcdefd){if(_0xbcdefd){return _0xbcdefd[_0x32bf('0x3a')]()[_0x32bf('0x24')](function(){_0x26d954['status'](0xcc)[_0x32bf('0x3b')]();});}};}function handleEntityNotFound(_0x28ce41,_0x537482){return function(_0x273ccb){if(!_0x273ccb){_0x28ce41[_0x32bf('0x2e')](0x194);}return _0x273ccb;};}function handleError(_0xdb239b,_0x2f4087){_0x2f4087=_0x2f4087||0x1f4;return function(_0x31d52f){logger[_0x32bf('0x2a')](_0x31d52f['stack']);if(_0x31d52f['name']){delete _0x31d52f[_0x32bf('0x3c')];}_0xdb239b[_0x32bf('0x2f')](_0x2f4087)[_0x32bf('0x3d')](_0x31d52f);};}exports[_0x32bf('0x3e')]=function(_0x4dfc43,_0x2f36ff){var _0x5c6086={},_0xeb2d2a={},_0x29f9b8={'count':0x0,'rows':[]};var _0x568877=_[_0x32bf('0x3f')](db[_0x32bf('0x40')][_0x32bf('0x41')],function(_0x1be343){return{'name':_0x1be343[_0x32bf('0x42')],'type':_0x1be343[_0x32bf('0x43')][_0x32bf('0x44')]};});_0xeb2d2a[_0x32bf('0x45')]=_['map'](_0x568877,_0x32bf('0x3c'));_0xeb2d2a[_0x32bf('0x46')]=_[_0x32bf('0x47')](_0x4dfc43[_0x32bf('0x46')]);_0xeb2d2a['filters']=_[_0x32bf('0x48')](_0xeb2d2a[_0x32bf('0x45')],_0xeb2d2a[_0x32bf('0x46')]);_0x5c6086[_0x32bf('0x49')]=_[_0x32bf('0x48')](_0xeb2d2a['model'],qs[_0x32bf('0x4a')](_0x4dfc43[_0x32bf('0x46')]['fields']));_0x5c6086['attributes']=_0x5c6086[_0x32bf('0x49')][_0x32bf('0x4b')]?_0x5c6086[_0x32bf('0x49')]:_0xeb2d2a[_0x32bf('0x45')];if(!_0x4dfc43['query']['hasOwnProperty'](_0x32bf('0x4c'))){_0x5c6086['limit']=qs[_0x32bf('0x31')](_0x4dfc43[_0x32bf('0x46')][_0x32bf('0x31')]);_0x5c6086[_0x32bf('0x30')]=qs[_0x32bf('0x30')](_0x4dfc43[_0x32bf('0x46')]['offset']);}_0x5c6086[_0x32bf('0x4d')]=qs[_0x32bf('0x4e')](_0x4dfc43['query'][_0x32bf('0x4e')]);_0x5c6086[_0x32bf('0x4f')]=qs[_0x32bf('0x50')](_['pick'](_0x4dfc43['query'],_0xeb2d2a[_0x32bf('0x50')]),_0x568877);if(_0x4dfc43[_0x32bf('0x46')][_0x32bf('0x51')]){_0x5c6086[_0x32bf('0x4f')]=_[_0x32bf('0x52')](_0x5c6086[_0x32bf('0x4f')],{'$or':_[_0x32bf('0x3f')](_0x568877,function(_0x54a8b1){if(_0x54a8b1[_0x32bf('0x43')]!=='VIRTUAL'){var _0x3344f9={};_0x3344f9[_0x54a8b1[_0x32bf('0x3c')]]={'$like':'%'+_0x4dfc43[_0x32bf('0x46')][_0x32bf('0x51')]+'%'};return _0x3344f9;}})});}_0x5c6086=_[_0x32bf('0x52')]({},_0x5c6086,_0x4dfc43[_0x32bf('0x53')]);var _0x18ab9e={'where':_0x5c6086[_0x32bf('0x4f')]};return db[_0x32bf('0x40')][_0x32bf('0x33')](_0x18ab9e)['then'](function(_0x1c2dd1){_0x29f9b8[_0x32bf('0x33')]=_0x1c2dd1;if(_0x4dfc43[_0x32bf('0x46')][_0x32bf('0x54')]){_0x5c6086[_0x32bf('0x55')]=[{'all':!![]}];}return db[_0x32bf('0x40')][_0x32bf('0x56')](_0x5c6086);})['then'](function(_0x5ad8a3){_0x29f9b8['rows']=_0x5ad8a3;return _0x29f9b8;})[_0x32bf('0x24')](respondWithFilteredResult(_0x2f36ff,_0x5c6086))[_0x32bf('0x57')](handleError(_0x2f36ff,null));};exports[_0x32bf('0x58')]=function(_0x3808e9,_0x283be9){var _0x2beb13={'raw':!![],'where':{'id':_0x3808e9[_0x32bf('0x59')]['id']}},_0x280adc={};_0x280adc[_0x32bf('0x45')]=_[_0x32bf('0x47')](db[_0x32bf('0x40')]['rawAttributes']);_0x280adc[_0x32bf('0x46')]=_['keys'](_0x3808e9[_0x32bf('0x46')]);_0x280adc[_0x32bf('0x50')]=_[_0x32bf('0x48')](_0x280adc[_0x32bf('0x45')],_0x280adc[_0x32bf('0x46')]);_0x2beb13['attributes']=_['intersection'](_0x280adc[_0x32bf('0x45')],qs[_0x32bf('0x4a')](_0x3808e9['query'][_0x32bf('0x4a')]));_0x2beb13[_0x32bf('0x49')]=_0x2beb13['attributes']['length']?_0x2beb13['attributes']:_0x280adc['model'];if(_0x3808e9['query'][_0x32bf('0x54')]){_0x2beb13[_0x32bf('0x55')]=[{'all':!![]}];}_0x2beb13=_[_0x32bf('0x52')]({},_0x2beb13,_0x3808e9[_0x32bf('0x53')]);return db[_0x32bf('0x40')]['find'](_0x2beb13)[_0x32bf('0x24')](handleEntityNotFound(_0x283be9,null))[_0x32bf('0x24')](respondWithResult(_0x283be9,null))[_0x32bf('0x57')](handleError(_0x283be9,null));};exports[_0x32bf('0x39')]=function(_0x289b42,_0x5d4dd8){if(_0x289b42[_0x32bf('0x5a')]['id']){delete _0x289b42[_0x32bf('0x5a')]['id'];}return db[_0x32bf('0x40')][_0x32bf('0x5b')]({'where':{'id':_0x289b42[_0x32bf('0x59')]['id']}})[_0x32bf('0x24')](handleEntityNotFound(_0x5d4dd8,null))[_0x32bf('0x24')](saveUpdates(_0x289b42[_0x32bf('0x5a')],null))[_0x32bf('0x24')](respondWithResult(_0x5d4dd8,null))[_0x32bf('0x57')](handleError(_0x5d4dd8,null));};exports[_0x32bf('0x3a')]=function(_0x5178b8,_0x24e85b){return db[_0x32bf('0x40')]['find']({'where':{'id':_0x5178b8[_0x32bf('0x59')]['id']}})['then'](handleEntityNotFound(_0x24e85b,null))[_0x32bf('0x24')](removeEntity(_0x24e85b,null))['catch'](handleError(_0x24e85b,null));};exports[_0x32bf('0x5c')]=function(_0x40d770,_0x306366){return db[_0x32bf('0x40')]['describe']()[_0x32bf('0x24')](respondWithResult(_0x306366,null))[_0x32bf('0x57')](handleError(_0x306366,null));};var interaction_log=require(_0x32bf('0x15'))(_0x32bf('0x5d'));exports[_0x32bf('0x5e')]=function(_0xbe5ed5,_0x42a198,_0x29dc66){var _0x3e4640={'agent':{},'channel':_0x32bf('0x5f')};if(_0xbe5ed5[_0x32bf('0x5a')]['id']){delete _0xbe5ed5[_0x32bf('0x5a')]['id'];}_0xbe5ed5['body']['read']=!![];_0xbe5ed5['body'][_0x32bf('0x60')]=moment()[_0x32bf('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0xbe5ed5[_0x32bf('0x5a')]['UserId']=_0xbe5ed5[_0x32bf('0x5a')][_0x32bf('0x62')]||_0xbe5ed5['user']['id'];_0x3e4640[_0x32bf('0x63')]['id']=_0xbe5ed5[_0x32bf('0x5a')][_0x32bf('0x62')];return db[_0x32bf('0x40')]['find']({'where':{'id':_0xbe5ed5[_0x32bf('0x59')]['id'],'UserId':null}})[_0x32bf('0x24')](handleEntityNotFound(_0x42a198,null))['then'](saveUpdates(_0xbe5ed5['body'],null))[_0x32bf('0x24')](function(_0x2dbafa){if(_0x2dbafa){_0x3e4640['message']=_0x2dbafa[_0x32bf('0x64')]({'plain':!![]});return db[_0x32bf('0x65')][_0x32bf('0x5b')]({'where':{'id':_0x2dbafa[_0x32bf('0x66')]}});}return null;})[_0x32bf('0x24')](handleEntityNotFound(_0x42a198,null))[_0x32bf('0x24')](function(_0x5aac22){if(_0x5aac22){return _0x5aac22['update']({'UserId':_0xbe5ed5[_0x32bf('0x5a')]['UserId'],'read1stAt':_[_0x32bf('0x67')](_0x5aac22['read1stAt'])?moment()['format'](_0x32bf('0x68')):undefined});}return null;})[_0x32bf('0x24')](function(_0x4fa6b5){if(_0x4fa6b5){_0x3e4640[_0x32bf('0x69')]=_0x4fa6b5[_0x32bf('0x64')]({'plain':!![]});interaction_log[_0x32bf('0x25')](_0x32bf('0x6a'),_0xbe5ed5[_0x32bf('0x6b')]['id'],_0xbe5ed5[_0x32bf('0x6b')]['name'],_0xbe5ed5[_0x32bf('0x6b')]['role'],_0x3e4640[_0x32bf('0x69')]['id'],_0xbe5ed5[_0x32bf('0x5a')]?JSON['stringify'](_0xbe5ed5[_0x32bf('0x5a')]):_0x32bf('0x6c'));return respondWithRpcPromise('AcceptMessage',_0x32bf('0x6d'),_0x3e4640);}return null;})[_0x32bf('0x24')](function(_0x5e7715){var _0x32bfa1=_0x32bf('0x6e')+_0x5e7715[_0x32bf('0x2b')][_0x32bf('0x6f')];return db['sequelize'][_0x32bf('0x46')](_0x32bfa1,{'type':db[_0x32bf('0x70')][_0x32bf('0x71')][_0x32bf('0x72')],'raw':!![]})[_0x32bf('0x24')](function(_0x1efbcb){return _0x1efbcb;});})[_0x32bf('0x24')](function(_0x2bafa3){if(_0x2bafa3){_0x3e4640[_0x32bf('0x2b')]['contact']=_0x2bafa3[0x0];if(!_0xbe5ed5[_0x32bf('0x5a')][_0x32bf('0x62')])return;return db[_0x32bf('0x73')][_0x32bf('0x5b')]({'where':{'id':_0xbe5ed5[_0x32bf('0x5a')]['UserId'],'role':'agent'},'attributes':['id',_0x32bf('0x3c'),'fullname',_0x32bf('0x74'),_0x32bf('0x75')],'raw':!![]});}return null;})[_0x32bf('0x24')](function(_0x4798b8){if(!_0x4798b8)return null;_0x3e4640['message']['agent']=_0x4798b8;return _0x3e4640;})[_0x32bf('0x24')](function(_0xda6989){if(_0xda6989){if(_0xbe5ed5[_0x32bf('0x5a')][_0x32bf('0x76')]){_0x3e4640[_0x32bf('0x2b')][_0x32bf('0x77')]=util[_0x32bf('0x61')](_0x32bf('0x78'),_0xbe5ed5[_0x32bf('0x6b')]['name']);_0x3e4640[_0x32bf('0x2b')]['channel']=_0x3e4640[_0x32bf('0x79')];_0x3e4640[_0x32bf('0x2b')][_0x32bf('0x7a')]=_0x3e4640[_0x32bf('0x79')];_0x3e4640[_0x32bf('0x2b')][_0x32bf('0x7b')]=_0x32bf('0x5e');return respondWithRpcPromise(_0x32bf('0x7c'),_0x32bf('0x7c'),{'event':_0x32bf('0x7d'),'message':_0x3e4640['message']},client9002)['then'](function(){return _0x3e4640;});}return _0x3e4640;}return null;})[_0x32bf('0x24')](respondWithResult(_0x42a198,null))[_0x32bf('0x57')](handleError(_0x42a198,null));};var interaction_log=require(_0x32bf('0x15'))('fax-interactions');exports['reject']=function(_0x30079b,_0x3b672b,_0x3dd1b9){var _0x12c867={'agent':{},'channel':_0x32bf('0x5f')};if(_0x30079b['body']['id']){delete _0x30079b[_0x32bf('0x5a')]['id'];}_0x30079b['body'][_0x32bf('0x62')]=_0x30079b['body'][_0x32bf('0x62')]||_0x30079b[_0x32bf('0x6b')]['id'];_0x12c867[_0x32bf('0x63')]['id']=_0x30079b['body'][_0x32bf('0x62')];return db['FaxMessage'][_0x32bf('0x5b')]({'where':{'id':_0x30079b[_0x32bf('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3b672b,null))[_0x32bf('0x24')](function(_0x16adf8){if(_0x16adf8){_0x12c867['message']=_0x16adf8['get']({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x16adf8[_0x32bf('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x3b672b,null))[_0x32bf('0x24')](function(_0x4d6378){if(_0x4d6378){_0x12c867[_0x32bf('0x69')]=_0x4d6378['get']({'plain':!![]});interaction_log[_0x32bf('0x25')](_0x32bf('0x7e'),_0x30079b['user']['id'],_0x30079b['user']['name'],_0x30079b[_0x32bf('0x6b')][_0x32bf('0x7f')],_0x12c867[_0x32bf('0x69')]['id'],_0x30079b[_0x32bf('0x5a')]?JSON[_0x32bf('0x29')](_0x30079b[_0x32bf('0x5a')]):_0x32bf('0x6c'));return respondWithRpcPromise(_0x32bf('0x80'),_0x32bf('0x81'),_0x12c867);}return null;})[_0x32bf('0x24')](function(_0x32f22b){var _0x5d25bc=_0x32bf('0x6e')+_0x32f22b[_0x32bf('0x2b')][_0x32bf('0x6f')];return db[_0x32bf('0x82')][_0x32bf('0x46')](_0x5d25bc,{'type':db[_0x32bf('0x70')][_0x32bf('0x71')]['SELECT'],'raw':!![]})['then'](function(_0x10ce7a){return _0x10ce7a;});})[_0x32bf('0x24')](function(_0x450a47){if(_0x450a47){_0x12c867[_0x32bf('0x2b')][_0x32bf('0x83')]=_0x450a47[0x0];if(!_0x30079b[_0x32bf('0x5a')][_0x32bf('0x62')])return;return db[_0x32bf('0x73')]['find']({'where':{'id':_0x30079b['body']['UserId'],'role':_0x32bf('0x63')},'attributes':['id',_0x32bf('0x3c'),_0x32bf('0x84'),_0x32bf('0x74'),_0x32bf('0x75')],'raw':!![]});}return null;})['then'](function(_0x4f8b44){if(!_0x4f8b44)return null;_0x12c867['message'][_0x32bf('0x63')]=_0x4f8b44;return _0x12c867;})[_0x32bf('0x24')](function(_0x24d481){if(_0x24d481){_0x24d481[_0x32bf('0x2b')]['interface']=util[_0x32bf('0x61')]('SIP/%s',_0x30079b[_0x32bf('0x6b')][_0x32bf('0x3c')]);_0x24d481[_0x32bf('0x2b')][_0x32bf('0x79')]=_0x12c867[_0x32bf('0x79')];_0x24d481[_0x32bf('0x2b')][_0x32bf('0x7a')]=_0x12c867['channel'];_0x24d481['message'][_0x32bf('0x7b')]=_0x32bf('0x37');respondWithRpcPromise(_0x32bf('0x7c'),'EventManager',{'event':'rejectmessage','message':_0x24d481[_0x32bf('0x2b')]},client9002);return _0x12c867;}return null;})[_0x32bf('0x24')](respondWithResult(_0x3b672b,null))[_0x32bf('0x57')](handleError(_0x3b672b,null));};exports[_0x32bf('0x85')]=function(_0x23aeb2,_0xff0b73){var _0x3dd914;return db['FaxMessage'][_0x32bf('0x85')](_0x23aeb2['body'],{})[_0x32bf('0x24')](function(_0x229d10){_0x3dd914=_0x229d10;return db[_0x32bf('0x86')][_0x32bf('0x87')]({'where':{'id':_0x3dd914[_0x32bf('0x6f')]}});})[_0x32bf('0x24')](function(_0x1916d9){if(_['isNil'](_0x1916d9)){return;}else{_0x3dd914['fax']=_0x1916d9[_0x32bf('0x5f')];return db['Attachment']['findOne']({'where':{'id':_0x3dd914[_0x32bf('0x88')]}});}})[_0x32bf('0x24')](function(_0xeae2a3){return respondWithRpcPromise(_0x32bf('0x89'),_0x32bf('0x89'),{'FaxAccountId':_['isNil'](_0x23aeb2[_0x32bf('0x5a')])?undefined:_0x23aeb2[_0x32bf('0x5a')][_0x32bf('0x8a')],'path':_['isNil'](_0xeae2a3)?undefined:util[_0x32bf('0x61')](_0x32bf('0x8b'),_0xeae2a3['basename']),'fax':_[_0x32bf('0x67')](_0x3dd914[_0x32bf('0x5f')])?undefined:_0x3dd914[_0x32bf('0x5f')],'AttachmentId':_0x3dd914[_0x32bf('0x88')]},client9002);})[_0x32bf('0x24')](respondWithResult(_0xff0b73,0xc9))['catch'](handleError(_0xff0b73,null));};exports[_0x32bf('0x8c')]=function(_0x26a46b,_0x202b09){var _0x25ff45=path[_0x32bf('0x8d')](config[_0x32bf('0x8e')],'server',_0x32bf('0x8f'),'attachments');return db[_0x32bf('0x40')][_0x32bf('0x5b')]({'where':{'id':_0x26a46b[_0x32bf('0x59')]['id']},'include':[{'model':db['Attachment'],'as':_0x32bf('0x90')}]})[_0x32bf('0x24')](handleEntityNotFound(_0x202b09,null))[_0x32bf('0x24')](function(_0x5c9c50){if(_0x5c9c50){return _0x202b09['download'](path[_0x32bf('0x8d')](_0x25ff45,_0x5c9c50[_0x32bf('0x90')][_0x32bf('0x91')]));}})[_0x32bf('0x57')](handleError(_0x202b09,null));}; \ No newline at end of file +var _0x0f81=['rimraf','zip-dir','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/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxMessage.socket','register','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','sendStatus','status','offset','undefined','count','limit','Content-Range','json','save','update','destroy','end','send','map','FaxMessage','fieldName','type','key','name','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','filter','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','body','describe','fax-interactions','accept','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','role','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','User','agent','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','interaction','RejectMessage','Sequelize','QueryTypes','fullname','interface','reject','rejectmessage','create','CmContact','findOne','Attachment','basename','AttachmentId','join','root','server','files','attachments','download','eml-format'];(function(_0x397da2,_0x3b6d06){var _0x5c142e=function(_0x5a1995){while(--_0x5a1995){_0x397da2['push'](_0x397da2['shift']());}};_0x5c142e(++_0x3b6d06);}(_0x0f81,0x1a0));var _0x10f8=function(_0x542cac,_0x39d23d){_0x542cac=_0x542cac-0x0;var _0x36cde6=_0x0f81[_0x542cac];return _0x36cde6;};'use strict';var emlformat=require(_0x10f8('0x0'));var rimraf=require(_0x10f8('0x1'));var zipdir=require(_0x10f8('0x2'));var jsonpatch=require(_0x10f8('0x3'));var rp=require(_0x10f8('0x4'));var moment=require(_0x10f8('0x5'));var BPromise=require(_0x10f8('0x6'));var Mustache=require(_0x10f8('0x7'));var util=require('util');var path=require(_0x10f8('0x8'));var sox=require(_0x10f8('0x9'));var csv=require(_0x10f8('0xa'));var ejs=require(_0x10f8('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x10f8('0xc'));var squel=require(_0x10f8('0xd'));var crypto=require('crypto');var jsforce=require(_0x10f8('0xe'));var deskjs=require(_0x10f8('0xf'));var toCsv=require(_0x10f8('0xa'));var querystring=require(_0x10f8('0x10'));var Papa=require(_0x10f8('0x11'));var Redis=require(_0x10f8('0x12'));var authService=require(_0x10f8('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x10f8('0x14'));var hardwareService=require(_0x10f8('0x15'));var logger=require(_0x10f8('0x16'))(_0x10f8('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x10f8('0x18'));var db=require(_0x10f8('0x19'))['db'];config[_0x10f8('0x1a')]=_[_0x10f8('0x1b')](config[_0x10f8('0x1a')],{'host':_0x10f8('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x10f8('0x1a')]));require(_0x10f8('0x1d'))[_0x10f8('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x10f8('0x1f')][_0x10f8('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x1f830d,_0x37a245,_0x5f399a,_0x544fd3){return new BPromise(function(_0x3ec43a,_0xd307a6){var _0x373cf9=_0x544fd3||client;return _0x373cf9[_0x10f8('0x21')](_0x1f830d,_0x5f399a)[_0x10f8('0x22')](function(_0x360cf3){logger[_0x10f8('0x23')](_0x10f8('0x24'),_0x37a245,'request\x20sent');logger[_0x10f8('0x25')](_0x10f8('0x26'),_0x37a245,_0x10f8('0x27'),JSON['stringify'](_0x360cf3));if(_0x360cf3[_0x10f8('0x28')]){if(_0x360cf3['error']['code']===0x1f4){logger['error'](_0x10f8('0x24'),_0x37a245,_0x360cf3['error'][_0x10f8('0x29')]);return _0xd307a6(_0x360cf3['error'][_0x10f8('0x29')]);}logger[_0x10f8('0x28')](_0x10f8('0x24'),_0x37a245,_0x360cf3[_0x10f8('0x28')][_0x10f8('0x29')]);return _0x3ec43a(_0x360cf3[_0x10f8('0x28')][_0x10f8('0x29')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x37a245,_0x10f8('0x27'));_0x3ec43a(_0x360cf3[_0x10f8('0x2a')][_0x10f8('0x29')]);}})['catch'](function(_0x2d1ba3){logger[_0x10f8('0x28')](_0x10f8('0x24'),_0x37a245,_0x2d1ba3);_0xd307a6(_0x2d1ba3);});});}function respondWithStatusCode(_0x33754c,_0x5158c4){_0x5158c4=_0x5158c4||0xcc;return function(_0x2e8ee6){if(_0x2e8ee6){return _0x33754c[_0x10f8('0x2b')](_0x5158c4);}return _0x33754c[_0x10f8('0x2c')](_0x5158c4)['end']();};}function respondWithResult(_0x229ce6,_0x1db958){_0x1db958=_0x1db958||0xc8;return function(_0x4dc98d){if(_0x4dc98d){return _0x229ce6[_0x10f8('0x2c')](_0x1db958)['json'](_0x4dc98d);}};}function respondWithFilteredResult(_0x2f0f63,_0xe49a13){return function(_0x40ab58){if(_0x40ab58){var _0x39421d=typeof _0xe49a13[_0x10f8('0x2d')]===_0x10f8('0x2e')&&typeof _0xe49a13['limit']===_0x10f8('0x2e');var _0x4e7b6f=_0x40ab58['count'];var _0x5a70dd=_0x39421d?0x0:_0xe49a13[_0x10f8('0x2d')];var _0x521e47=_0x39421d?_0x40ab58[_0x10f8('0x2f')]:_0xe49a13[_0x10f8('0x2d')]+_0xe49a13[_0x10f8('0x30')];var _0x14a069;if(_0x521e47>=_0x4e7b6f){_0x521e47=_0x4e7b6f;_0x14a069=0xc8;}else{_0x14a069=0xce;}_0x2f0f63[_0x10f8('0x2c')](_0x14a069);return _0x2f0f63['set'](_0x10f8('0x31'),_0x5a70dd+'-'+_0x521e47+'/'+_0x4e7b6f)[_0x10f8('0x32')](_0x40ab58);}return null;};}function patchUpdates(_0x5a0e88){return function(_0x5f046b){try{jsonpatch['apply'](_0x5f046b,_0x5a0e88,!![]);}catch(_0x21d999){return BPromise['reject'](_0x21d999);}return _0x5f046b[_0x10f8('0x33')]();};}function saveUpdates(_0x2e3f7b,_0x57c088){return function(_0x3dec6d){if(_0x3dec6d){return _0x3dec6d[_0x10f8('0x34')](_0x2e3f7b)[_0x10f8('0x22')](function(_0x5ad6bc){return _0x5ad6bc;});}return null;};}function removeEntity(_0x3e15db,_0x16e1ae){return function(_0x1fa310){if(_0x1fa310){return _0x1fa310[_0x10f8('0x35')]()[_0x10f8('0x22')](function(){_0x3e15db[_0x10f8('0x2c')](0xcc)[_0x10f8('0x36')]();});}};}function handleEntityNotFound(_0x179316,_0x175b18){return function(_0x43f03d){if(!_0x43f03d){_0x179316[_0x10f8('0x2b')](0x194);}return _0x43f03d;};}function handleError(_0x7d2474,_0x3bf918){_0x3bf918=_0x3bf918||0x1f4;return function(_0x22e1fa){logger[_0x10f8('0x28')](_0x22e1fa['stack']);if(_0x22e1fa['name']){delete _0x22e1fa['name'];}_0x7d2474['status'](_0x3bf918)[_0x10f8('0x37')](_0x22e1fa);};}exports['index']=function(_0x1753dd,_0x565298){var _0x113cf7={},_0x5bbaeb={},_0x3e59ee={'count':0x0,'rows':[]};var _0x5efa21=_[_0x10f8('0x38')](db[_0x10f8('0x39')]['rawAttributes'],function(_0xc59c52){return{'name':_0xc59c52[_0x10f8('0x3a')],'type':_0xc59c52[_0x10f8('0x3b')][_0x10f8('0x3c')]};});_0x5bbaeb['model']=_['map'](_0x5efa21,_0x10f8('0x3d'));_0x5bbaeb[_0x10f8('0x3e')]=_[_0x10f8('0x3f')](_0x1753dd['query']);_0x5bbaeb[_0x10f8('0x40')]=_[_0x10f8('0x41')](_0x5bbaeb[_0x10f8('0x42')],_0x5bbaeb[_0x10f8('0x3e')]);_0x113cf7['attributes']=_[_0x10f8('0x41')](_0x5bbaeb[_0x10f8('0x42')],qs['fields'](_0x1753dd[_0x10f8('0x3e')][_0x10f8('0x43')]));_0x113cf7[_0x10f8('0x44')]=_0x113cf7['attributes'][_0x10f8('0x45')]?_0x113cf7[_0x10f8('0x44')]:_0x5bbaeb[_0x10f8('0x42')];if(!_0x1753dd['query'][_0x10f8('0x46')](_0x10f8('0x47'))){_0x113cf7[_0x10f8('0x30')]=qs[_0x10f8('0x30')](_0x1753dd['query']['limit']);_0x113cf7[_0x10f8('0x2d')]=qs[_0x10f8('0x2d')](_0x1753dd['query'][_0x10f8('0x2d')]);}_0x113cf7['order']=qs[_0x10f8('0x48')](_0x1753dd[_0x10f8('0x3e')][_0x10f8('0x48')]);_0x113cf7[_0x10f8('0x49')]=qs['filters'](_['pick'](_0x1753dd['query'],_0x5bbaeb[_0x10f8('0x40')]),_0x5efa21);if(_0x1753dd['query']['filter']){_0x113cf7[_0x10f8('0x49')]=_[_0x10f8('0x4a')](_0x113cf7['where'],{'$or':_[_0x10f8('0x38')](_0x5efa21,function(_0x4ec4f5){if(_0x4ec4f5['type']!=='VIRTUAL'){var _0x5234cb={};_0x5234cb[_0x4ec4f5[_0x10f8('0x3d')]]={'$like':'%'+_0x1753dd[_0x10f8('0x3e')][_0x10f8('0x4b')]+'%'};return _0x5234cb;}})});}_0x113cf7=_[_0x10f8('0x4a')]({},_0x113cf7,_0x1753dd[_0x10f8('0x4c')]);var _0x501e4e={'where':_0x113cf7[_0x10f8('0x49')]};return db[_0x10f8('0x39')]['count'](_0x501e4e)['then'](function(_0x23f889){_0x3e59ee[_0x10f8('0x2f')]=_0x23f889;if(_0x1753dd[_0x10f8('0x3e')][_0x10f8('0x4d')]){_0x113cf7[_0x10f8('0x4e')]=[{'all':!![]}];}return db[_0x10f8('0x39')][_0x10f8('0x4f')](_0x113cf7);})[_0x10f8('0x22')](function(_0x58bb88){_0x3e59ee[_0x10f8('0x50')]=_0x58bb88;return _0x3e59ee;})[_0x10f8('0x22')](respondWithFilteredResult(_0x565298,_0x113cf7))[_0x10f8('0x51')](handleError(_0x565298,null));};exports['show']=function(_0x478693,_0x5b2363){var _0x54101b={'raw':!![],'where':{'id':_0x478693[_0x10f8('0x52')]['id']}},_0x585b75={};_0x585b75[_0x10f8('0x42')]=_[_0x10f8('0x3f')](db[_0x10f8('0x39')][_0x10f8('0x53')]);_0x585b75[_0x10f8('0x3e')]=_[_0x10f8('0x3f')](_0x478693[_0x10f8('0x3e')]);_0x585b75[_0x10f8('0x40')]=_[_0x10f8('0x41')](_0x585b75['model'],_0x585b75[_0x10f8('0x3e')]);_0x54101b['attributes']=_[_0x10f8('0x41')](_0x585b75[_0x10f8('0x42')],qs[_0x10f8('0x43')](_0x478693[_0x10f8('0x3e')][_0x10f8('0x43')]));_0x54101b[_0x10f8('0x44')]=_0x54101b['attributes'][_0x10f8('0x45')]?_0x54101b['attributes']:_0x585b75[_0x10f8('0x42')];if(_0x478693[_0x10f8('0x3e')][_0x10f8('0x4d')]){_0x54101b[_0x10f8('0x4e')]=[{'all':!![]}];}_0x54101b=_['merge']({},_0x54101b,_0x478693[_0x10f8('0x4c')]);return db[_0x10f8('0x39')][_0x10f8('0x54')](_0x54101b)[_0x10f8('0x22')](handleEntityNotFound(_0x5b2363,null))[_0x10f8('0x22')](respondWithResult(_0x5b2363,null))[_0x10f8('0x51')](handleError(_0x5b2363,null));};exports[_0x10f8('0x34')]=function(_0x2fab08,_0x1e6889){if(_0x2fab08[_0x10f8('0x55')]['id']){delete _0x2fab08['body']['id'];}return db[_0x10f8('0x39')][_0x10f8('0x54')]({'where':{'id':_0x2fab08['params']['id']}})[_0x10f8('0x22')](handleEntityNotFound(_0x1e6889,null))['then'](saveUpdates(_0x2fab08['body'],null))[_0x10f8('0x22')](respondWithResult(_0x1e6889,null))[_0x10f8('0x51')](handleError(_0x1e6889,null));};exports['destroy']=function(_0x246fd0,_0x197a15){return db['FaxMessage']['find']({'where':{'id':_0x246fd0[_0x10f8('0x52')]['id']}})[_0x10f8('0x22')](handleEntityNotFound(_0x197a15,null))[_0x10f8('0x22')](removeEntity(_0x197a15,null))['catch'](handleError(_0x197a15,null));};exports[_0x10f8('0x56')]=function(_0x53f0db,_0x8972a8){return db[_0x10f8('0x39')][_0x10f8('0x56')]()[_0x10f8('0x22')](respondWithResult(_0x8972a8,null))['catch'](handleError(_0x8972a8,null));};var interaction_log=require(_0x10f8('0x16'))(_0x10f8('0x57'));exports[_0x10f8('0x58')]=function(_0x1e306c,_0x2a3e81,_0x51d5ca){var _0x2b7373={'agent':{},'channel':_0x10f8('0x59')};if(_0x1e306c[_0x10f8('0x55')]['id']){delete _0x1e306c[_0x10f8('0x55')]['id'];}_0x1e306c[_0x10f8('0x55')][_0x10f8('0x5a')]=!![];_0x1e306c[_0x10f8('0x55')]['readAt']=moment()[_0x10f8('0x5b')](_0x10f8('0x5c'));_0x1e306c[_0x10f8('0x55')][_0x10f8('0x5d')]=_0x1e306c['body'][_0x10f8('0x5d')]||_0x1e306c[_0x10f8('0x5e')]['id'];_0x2b7373['agent']['id']=_0x1e306c[_0x10f8('0x55')][_0x10f8('0x5d')];return db[_0x10f8('0x39')][_0x10f8('0x54')]({'where':{'id':_0x1e306c[_0x10f8('0x52')]['id'],'UserId':null}})[_0x10f8('0x22')](handleEntityNotFound(_0x2a3e81,null))[_0x10f8('0x22')](saveUpdates(_0x1e306c['body'],null))[_0x10f8('0x22')](function(_0x34f2a9){if(_0x34f2a9){_0x2b7373[_0x10f8('0x29')]=_0x34f2a9[_0x10f8('0x5f')]({'plain':!![]});return db[_0x10f8('0x60')][_0x10f8('0x54')]({'where':{'id':_0x34f2a9[_0x10f8('0x61')]}});}return null;})[_0x10f8('0x22')](handleEntityNotFound(_0x2a3e81,null))['then'](function(_0x2f0fb7){if(_0x2f0fb7){return _0x2f0fb7[_0x10f8('0x34')]({'UserId':_0x1e306c[_0x10f8('0x55')]['UserId'],'read1stAt':_[_0x10f8('0x62')](_0x2f0fb7[_0x10f8('0x63')])?moment()['format'](_0x10f8('0x5c')):undefined});}return null;})[_0x10f8('0x22')](function(_0x2784be){if(_0x2784be){_0x2b7373['interaction']=_0x2784be[_0x10f8('0x5f')]({'plain':!![]});interaction_log[_0x10f8('0x23')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1e306c[_0x10f8('0x5e')]['id'],_0x1e306c['user']['name'],_0x1e306c['user'][_0x10f8('0x64')],_0x2b7373['interaction']['id'],_0x1e306c[_0x10f8('0x55')]?JSON[_0x10f8('0x65')](_0x1e306c[_0x10f8('0x55')]):'null');return respondWithRpcPromise(_0x10f8('0x66'),_0x10f8('0x67'),_0x2b7373);}return null;})['then'](function(_0x14ce1c){var _0x3e8dd2=_0x10f8('0x68')+_0x14ce1c[_0x10f8('0x29')][_0x10f8('0x69')];return db[_0x10f8('0x6a')][_0x10f8('0x3e')](_0x3e8dd2,{'type':db['Sequelize']['QueryTypes'][_0x10f8('0x6b')],'raw':!![]})[_0x10f8('0x22')](function(_0x24b71c){return _0x24b71c;});})[_0x10f8('0x22')](function(_0x3aaf3d){if(_0x3aaf3d){_0x2b7373['message']['contact']=_0x3aaf3d[0x0];if(!_0x1e306c[_0x10f8('0x55')][_0x10f8('0x5d')])return;return db[_0x10f8('0x6c')][_0x10f8('0x54')]({'where':{'id':_0x1e306c[_0x10f8('0x55')][_0x10f8('0x5d')],'role':_0x10f8('0x6d')},'attributes':['id',_0x10f8('0x3d'),'fullname',_0x10f8('0x6e'),_0x10f8('0x6f')],'raw':!![]});}return null;})[_0x10f8('0x22')](function(_0x5621be){if(!_0x5621be)return null;_0x2b7373[_0x10f8('0x29')][_0x10f8('0x6d')]=_0x5621be;return _0x2b7373;})[_0x10f8('0x22')](function(_0x54405a){if(_0x54405a){if(_0x1e306c[_0x10f8('0x55')][_0x10f8('0x70')]){_0x2b7373[_0x10f8('0x29')]['interface']=util['format'](_0x10f8('0x71'),_0x1e306c[_0x10f8('0x5e')][_0x10f8('0x3d')]);_0x2b7373[_0x10f8('0x29')][_0x10f8('0x72')]=_0x2b7373['channel'];_0x2b7373['message'][_0x10f8('0x73')]=_0x2b7373['channel'];_0x2b7373[_0x10f8('0x29')][_0x10f8('0x74')]=_0x10f8('0x58');return respondWithRpcPromise(_0x10f8('0x75'),_0x10f8('0x75'),{'event':_0x10f8('0x76'),'message':_0x2b7373[_0x10f8('0x29')]},client9002)[_0x10f8('0x22')](function(){return _0x2b7373;});}return _0x2b7373;}return null;})['then'](respondWithResult(_0x2a3e81,null))[_0x10f8('0x51')](handleError(_0x2a3e81,null));};var interaction_log=require(_0x10f8('0x16'))(_0x10f8('0x57'));exports['reject']=function(_0xe0a7c2,_0x2a430f,_0x4de3e1){var _0x2a8a71={'agent':{},'channel':_0x10f8('0x59')};if(_0xe0a7c2[_0x10f8('0x55')]['id']){delete _0xe0a7c2[_0x10f8('0x55')]['id'];}_0xe0a7c2['body'][_0x10f8('0x5d')]=_0xe0a7c2[_0x10f8('0x55')][_0x10f8('0x5d')]||_0xe0a7c2['user']['id'];_0x2a8a71[_0x10f8('0x6d')]['id']=_0xe0a7c2[_0x10f8('0x55')][_0x10f8('0x5d')];return db['FaxMessage'][_0x10f8('0x54')]({'where':{'id':_0xe0a7c2[_0x10f8('0x52')]['id'],'UserId':null}})[_0x10f8('0x22')](handleEntityNotFound(_0x2a430f,null))[_0x10f8('0x22')](function(_0x16266b){if(_0x16266b){_0x2a8a71[_0x10f8('0x29')]=_0x16266b[_0x10f8('0x5f')]({'plain':!![]});return db['FaxInteraction'][_0x10f8('0x54')]({'where':{'id':_0x16266b['FaxInteractionId']}});}return null;})[_0x10f8('0x22')](handleEntityNotFound(_0x2a430f,null))[_0x10f8('0x22')](function(_0x47f262){if(_0x47f262){_0x2a8a71[_0x10f8('0x77')]=_0x47f262[_0x10f8('0x5f')]({'plain':!![]});interaction_log['info']('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xe0a7c2['user']['id'],_0xe0a7c2[_0x10f8('0x5e')]['name'],_0xe0a7c2['user'][_0x10f8('0x64')],_0x2a8a71[_0x10f8('0x77')]['id'],_0xe0a7c2[_0x10f8('0x55')]?JSON[_0x10f8('0x65')](_0xe0a7c2['body']):'null');return respondWithRpcPromise(_0x10f8('0x78'),'rejectMessage',_0x2a8a71);}return null;})[_0x10f8('0x22')](function(_0xd81370){var _0x1b8cf0=_0x10f8('0x68')+_0xd81370['message'][_0x10f8('0x69')];return db[_0x10f8('0x6a')][_0x10f8('0x3e')](_0x1b8cf0,{'type':db[_0x10f8('0x79')][_0x10f8('0x7a')][_0x10f8('0x6b')],'raw':!![]})[_0x10f8('0x22')](function(_0x217526){return _0x217526;});})[_0x10f8('0x22')](function(_0x2b502b){if(_0x2b502b){_0x2a8a71[_0x10f8('0x29')]['contact']=_0x2b502b[0x0];if(!_0xe0a7c2['body'][_0x10f8('0x5d')])return;return db['User'][_0x10f8('0x54')]({'where':{'id':_0xe0a7c2['body'][_0x10f8('0x5d')],'role':'agent'},'attributes':['id',_0x10f8('0x3d'),_0x10f8('0x7b'),_0x10f8('0x6e'),_0x10f8('0x6f')],'raw':!![]});}return null;})[_0x10f8('0x22')](function(_0x4a4ec2){if(!_0x4a4ec2)return null;_0x2a8a71['message'][_0x10f8('0x6d')]=_0x4a4ec2;return _0x2a8a71;})[_0x10f8('0x22')](function(_0x4b2f2b){if(_0x4b2f2b){_0x4b2f2b[_0x10f8('0x29')][_0x10f8('0x7c')]=util[_0x10f8('0x5b')](_0x10f8('0x71'),_0xe0a7c2[_0x10f8('0x5e')]['name']);_0x4b2f2b[_0x10f8('0x29')][_0x10f8('0x72')]=_0x2a8a71['channel'];_0x4b2f2b[_0x10f8('0x29')]['motionChannel']=_0x2a8a71[_0x10f8('0x72')];_0x4b2f2b['message'][_0x10f8('0x74')]=_0x10f8('0x7d');respondWithRpcPromise(_0x10f8('0x75'),'EventManager',{'event':_0x10f8('0x7e'),'message':_0x4b2f2b[_0x10f8('0x29')]},client9002);return _0x2a8a71;}return null;})[_0x10f8('0x22')](respondWithResult(_0x2a430f,null))[_0x10f8('0x51')](handleError(_0x2a430f,null));};exports[_0x10f8('0x7f')]=function(_0x4827d2,_0x2f01a2){var _0x2a3241;return db[_0x10f8('0x39')]['create'](_0x4827d2[_0x10f8('0x55')],{})[_0x10f8('0x22')](function(_0x3c35a0){_0x2a3241=_0x3c35a0;return db[_0x10f8('0x80')][_0x10f8('0x81')]({'where':{'id':_0x2a3241[_0x10f8('0x69')]}});})[_0x10f8('0x22')](function(_0x5662dd){if(_[_0x10f8('0x62')](_0x5662dd)){return;}else{_0x2a3241[_0x10f8('0x59')]=_0x5662dd[_0x10f8('0x59')];return db[_0x10f8('0x82')][_0x10f8('0x81')]({'where':{'id':_0x2a3241['AttachmentId']}});}})['then'](function(_0x50571e){return respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0x10f8('0x62')](_0x4827d2[_0x10f8('0x55')])?undefined:_0x4827d2['body']['FaxAccountId'],'path':_['isNil'](_0x50571e)?undefined:util['format']('/var/opt/motion2/server/files/attachments/%s',_0x50571e[_0x10f8('0x83')]),'fax':_['isNil'](_0x2a3241[_0x10f8('0x59')])?undefined:_0x2a3241[_0x10f8('0x59')],'AttachmentId':_0x2a3241[_0x10f8('0x84')]},client9002);})[_0x10f8('0x22')](respondWithResult(_0x2f01a2,0xc9))[_0x10f8('0x51')](handleError(_0x2f01a2,null));};exports['download']=function(_0x45dfaf,_0x5c48a4){var _0x498afb=path[_0x10f8('0x85')](config[_0x10f8('0x86')],_0x10f8('0x87'),_0x10f8('0x88'),_0x10f8('0x89'));return db['FaxMessage'][_0x10f8('0x54')]({'where':{'id':_0x45dfaf['params']['id']},'include':[{'model':db[_0x10f8('0x82')],'as':_0x10f8('0x82')}]})[_0x10f8('0x22')](handleEntityNotFound(_0x5c48a4,null))[_0x10f8('0x22')](function(_0x466345){if(_0x466345){return _0x5c48a4[_0x10f8('0x8a')](path[_0x10f8('0x85')](_0x498afb,_0x466345[_0x10f8('0x82')]['basename']));}})['catch'](handleError(_0x5c48a4,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index c46dfbb..ebaf7b6 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 _0x1b64=['setMaxListeners','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x3f20a5,_0x5bbeda){var _0x168ec6=function(_0x2a64f5){while(--_0x2a64f5){_0x3f20a5['push'](_0x3f20a5['shift']());}};_0x168ec6(++_0x5bbeda);}(_0x1b64,0x76));var _0x41b6=function(_0x286d6a,_0x145de8){_0x286d6a=_0x286d6a-0x0;var _0x377d1a=_0x1b64[_0x286d6a];return _0x377d1a;};'use strict';var EventEmitter=require(_0x41b6('0x0'));var FaxMessage=require(_0x41b6('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x41b6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3204fe){return function(_0x1f979b,_0xd38c24,_0x19f577){FaxMessageEvents['emit'](_0x3204fe+':'+_0x1f979b['id'],_0x1f979b);FaxMessageEvents[_0x41b6('0x3')](_0x3204fe,_0x1f979b);_0x19f577(null);};}for(var e in events){if(events[_0x41b6('0x4')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0xa6b0=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','save','update','remove'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x419e41,_0x2f484a){_0x419e41=_0x419e41-0x0;var _0x5a0bf1=_0xa6b0[_0x419e41];return _0x5a0bf1;};'use strict';var EventEmitter=require(_0x0a6b('0x0'));var FaxMessage=require(_0x0a6b('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0a6b('0x2'),'afterUpdate':_0x0a6b('0x3'),'afterDestroy':_0x0a6b('0x4')};function emitEvent(_0x4c9a84){return function(_0x29ff80,_0x33e8c3,_0x195697){FaxMessageEvents[_0x0a6b('0x5')](_0x4c9a84+':'+_0x29ff80['id'],_0x29ff80);FaxMessageEvents[_0x0a6b('0x5')](_0x4c9a84,_0x29ff80);_0x195697(null);};}for(var e in events){if(events[_0x0a6b('0x6')](e)){var event=events[e];FaxMessage[_0x0a6b('0x7')](e,emitEvent(event));}}module[_0x0a6b('0x8')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 0051068..794f7fb 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 _0x7ef4=['./faxMessage.attributes','exports','FaxMessage','fax_messages','body','FULLTEXT','get','direction','secret','UserId','then','createdAt','toLowerCase','catch','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xa85144,_0x147ad9){var _0x5b9bf9=function(_0x4328f6){while(--_0x4328f6){_0xa85144['push'](_0xa85144['shift']());}};_0x5b9bf9(++_0x147ad9);}(_0x7ef4,0x16e));var _0x47ef=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x7ef4[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x47ef('0x0'));var util=require('util');var logger=require(_0x47ef('0x1'))(_0x47ef('0x2'));var moment=require(_0x47ef('0x3'));var BPromise=require(_0x47ef('0x4'));var rp=require(_0x47ef('0x5'));var fs=require('fs');var path=require(_0x47ef('0x6'));var rimraf=require(_0x47ef('0x7'));var config=require(_0x47ef('0x8'));var attributes=require(_0x47ef('0x9'));module[_0x47ef('0xa')]=function(_0x558040,_0x5f11d7){return _0x558040['define'](_0x47ef('0xb'),attributes,{'tableName':_0x47ef('0xc'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x47ef('0xd')],'type':_0x47ef('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3310df,_0x9d1bed,_0x5f3425){var _0xfcf9b3=_0x558040['models'];var _0x25d135=_0x3310df[_0x47ef('0xf')]({'plain':!![]});if(_0x25d135[_0x47ef('0x10')]['toLowerCase']()==='in'||_0x25d135['direction']['toLowerCase']()==='out'&&!_0x25d135[_0x47ef('0x11')]&&!_['isNil'](_0x25d135[_0x47ef('0x12')])){_0xfcf9b3['FaxInteraction']['findOne']({'where':{'id':_0x25d135['FaxInteractionId']}})[_0x47ef('0x13')](function(_0x1bb198){if(_0x1bb198){_0x1bb198['update']({'lastMsgAt':_0x25d135[_0x47ef('0x14')],'lastMsgDirection':_0x25d135[_0x47ef('0x10')][_0x47ef('0x15')]()});}})[_0x47ef('0x16')](function(_0x25dc75){console['error'](_0x25dc75);});}_0x5f3425();}},'charset':_0x47ef('0x17'),'collate':_0x47ef('0x18')});}; \ No newline at end of file +var _0x480c=['direction','toLowerCase','out','secret','isNil','UserId','FaxInteractionId','then','createdAt','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fti_fax_messages','body','FULLTEXT','models'];(function(_0x2c67da,_0x22309f){var _0x5df1ea=function(_0x103e3a){while(--_0x103e3a){_0x2c67da['push'](_0x2c67da['shift']());}};_0x5df1ea(++_0x22309f);}(_0x480c,0x1b3));var _0xc480=function(_0x2d2e1d,_0x33f36e){_0x2d2e1d=_0x2d2e1d-0x0;var _0x20ffc2=_0x480c[_0x2d2e1d];return _0x20ffc2;};'use strict';var _=require(_0xc480('0x0'));var util=require('util');var logger=require(_0xc480('0x1'))(_0xc480('0x2'));var moment=require(_0xc480('0x3'));var BPromise=require('bluebird');var rp=require(_0xc480('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc480('0x5'));var config=require(_0xc480('0x6'));var attributes=require(_0xc480('0x7'));module[_0xc480('0x8')]=function(_0x71d592,_0x1ba5ea){return _0x71d592[_0xc480('0x9')](_0xc480('0xa'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0xc480('0xb'),'fields':[_0xc480('0xc')],'type':_0xc480('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x47c312,_0x115a07,_0x3b4122){var _0x35b6d7=_0x71d592[_0xc480('0xe')];var _0x192fa8=_0x47c312['get']({'plain':!![]});if(_0x192fa8[_0xc480('0xf')]['toLowerCase']()==='in'||_0x192fa8['direction'][_0xc480('0x10')]()===_0xc480('0x11')&&!_0x192fa8[_0xc480('0x12')]&&!_[_0xc480('0x13')](_0x192fa8[_0xc480('0x14')])){_0x35b6d7['FaxInteraction']['findOne']({'where':{'id':_0x192fa8[_0xc480('0x15')]}})[_0xc480('0x16')](function(_0x51784d){if(_0x51784d){_0x51784d['update']({'lastMsgAt':_0x192fa8[_0xc480('0x17')],'lastMsgDirection':_0x192fa8[_0xc480('0xf')][_0xc480('0x10')]()});}})['catch'](function(_0x2225cf){console['error'](_0x2225cf);});}_0x3b4122();}},'charset':'utf8mb4','collate':_0xc480('0x18')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 854cff8..bbc87d7 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 _0x2dae=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxMessage,\x20%s,\x20%s','result','catch','CreateFaxMessage','FaxMessage','create','body','options','debug','UpdateFaxMessage','update','raw','attributes'];(function(_0x1bc0ae,_0x439dfe){var _0x501104=function(_0x2ade0d){while(--_0x2ade0d){_0x1bc0ae['push'](_0x1bc0ae['shift']());}};_0x501104(++_0x439dfe);}(_0x2dae,0xc3));var _0xe2da=function(_0x30d87a,_0xf3a07f){_0x30d87a=_0x30d87a-0x0;var _0x48f64b=_0x2dae[_0x30d87a];return _0x48f64b;};'use strict';var _=require(_0xe2da('0x0'));var util=require('util');var moment=require(_0xe2da('0x1'));var BPromise=require(_0xe2da('0x2'));var rs=require(_0xe2da('0x3'));var fs=require('fs');var Redis=require(_0xe2da('0x4'));var db=require(_0xe2da('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe2da('0x6'))(_0xe2da('0x7'));var config=require(_0xe2da('0x8'));var jayson=require(_0xe2da('0x9'));var client=jayson['client'][_0xe2da('0xa')]({'port':0x232a});config[_0xe2da('0xb')]=_[_0xe2da('0xc')](config[_0xe2da('0xb')],{'host':_0xe2da('0xd'),'port':0x18eb});var socket=require(_0xe2da('0xe'))(new Redis(config[_0xe2da('0xb')]));require(_0xe2da('0xf'))[_0xe2da('0x10')](socket);function respondWithRpcPromise(_0x5a2fc5,_0x52e650,_0x3baaa8){return new BPromise(function(_0x104fb3,_0x17086c){return client[_0xe2da('0x11')](_0x5a2fc5,_0x3baaa8)[_0xe2da('0x12')](function(_0x1a29b9){logger[_0xe2da('0x13')]('FaxMessage,\x20%s,\x20%s',_0x52e650,_0xe2da('0x14'));logger['debug'](_0xe2da('0x15'),_0x52e650,_0xe2da('0x14'),JSON[_0xe2da('0x16')](_0x1a29b9));if(_0x1a29b9[_0xe2da('0x17')]){if(_0x1a29b9[_0xe2da('0x17')][_0xe2da('0x18')]===0x1f4){logger[_0xe2da('0x17')]('FaxMessage,\x20%s,\x20%s',_0x52e650,_0x1a29b9[_0xe2da('0x17')]['message']);return _0x17086c(_0x1a29b9['error'][_0xe2da('0x19')]);}logger[_0xe2da('0x17')](_0xe2da('0x1a'),_0x52e650,_0x1a29b9['error'][_0xe2da('0x19')]);return _0x104fb3(_0x1a29b9[_0xe2da('0x17')][_0xe2da('0x19')]);}else{logger[_0xe2da('0x13')]('FaxMessage,\x20%s,\x20%s',_0x52e650,_0xe2da('0x14'));_0x104fb3(_0x1a29b9[_0xe2da('0x1b')][_0xe2da('0x19')]);}})[_0xe2da('0x1c')](function(_0x329ffe){logger['error'](_0xe2da('0x1a'),_0x52e650,_0x329ffe);_0x17086c(_0x329ffe);});});}exports[_0xe2da('0x1d')]=function(_0x538d96){var _0x1a9324=this;return new Promise(function(_0x254b37,_0x332193){return db[_0xe2da('0x1e')][_0xe2da('0x1f')](_0x538d96[_0xe2da('0x20')],{'raw':_0x538d96['options']?_0x538d96[_0xe2da('0x21')]['raw']===undefined?!![]:![]:!![]})[_0xe2da('0x12')](function(_0x191d38){logger[_0xe2da('0x13')](_0xe2da('0x1d'),_0x538d96);logger[_0xe2da('0x22')](_0xe2da('0x1d'),_0x538d96,JSON[_0xe2da('0x16')](_0x191d38));_0x254b37(_0x191d38);})[_0xe2da('0x1c')](function(_0x5a08d6){logger[_0xe2da('0x17')](_0xe2da('0x1d'),_0x5a08d6[_0xe2da('0x19')],_0x538d96);_0x332193(_0x1a9324[_0xe2da('0x17')](0x1f4,_0x5a08d6[_0xe2da('0x19')]));});});};exports[_0xe2da('0x23')]=function(_0x124d93){var _0x56c37e=this;return new Promise(function(_0x2adc49,_0x3e23d7){return db[_0xe2da('0x1e')][_0xe2da('0x24')](_0x124d93[_0xe2da('0x20')],{'raw':_0x124d93[_0xe2da('0x21')]?_0x124d93[_0xe2da('0x21')][_0xe2da('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x124d93['options']?_0x124d93['options']['where']||null:null,'attributes':_0x124d93[_0xe2da('0x21')]?_0x124d93[_0xe2da('0x21')][_0xe2da('0x26')]||null:null,'limit':_0x124d93[_0xe2da('0x21')]?_0x124d93['options']['limit']||null:null})[_0xe2da('0x12')](function(_0x1ec8ca){logger[_0xe2da('0x13')](_0xe2da('0x23'),_0x124d93);logger[_0xe2da('0x22')](_0xe2da('0x23'),_0x124d93,JSON[_0xe2da('0x16')](_0x1ec8ca));_0x2adc49(_0x1ec8ca);})[_0xe2da('0x1c')](function(_0x461610){logger['error']('UpdateFaxMessage',_0x461610[_0xe2da('0x19')],_0x124d93);_0x3e23d7(_0x56c37e[_0xe2da('0x17')](0x1f4,_0x461610[_0xe2da('0x19')]));});});}; \ No newline at end of file +var _0xe14d=['code','message','result','catch','FaxMessage','create','body','options','raw','CreateFaxMessage','UpdateFaxMessage','update','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5d9895,_0x183b2a){var _0x7c752e=function(_0x3e667d){while(--_0x3e667d){_0x5d9895['push'](_0x5d9895['shift']());}};_0x7c752e(++_0x183b2a);}(_0xe14d,0x1ee));var _0xde14=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xe14d[_0x21aec3];return _0x288bbc;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var moment=require(_0xde14('0x2'));var BPromise=require(_0xde14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde14('0x4'));var db=require(_0xde14('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xde14('0x6'))(_0xde14('0x7'));var config=require(_0xde14('0x8'));var jayson=require(_0xde14('0x9'));var client=jayson[_0xde14('0xa')][_0xde14('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xde14('0xc')],{'host':_0xde14('0xd'),'port':0x18eb});var socket=require(_0xde14('0xe'))(new Redis(config[_0xde14('0xc')]));require(_0xde14('0xf'))[_0xde14('0x10')](socket);function respondWithRpcPromise(_0xa17e8,_0x1ce0a2,_0x4b2b15){return new BPromise(function(_0x1a7167,_0xe785fb){return client[_0xde14('0x11')](_0xa17e8,_0x4b2b15)[_0xde14('0x12')](function(_0x8e0e){logger[_0xde14('0x13')](_0xde14('0x14'),_0x1ce0a2,_0xde14('0x15'));logger[_0xde14('0x16')](_0xde14('0x17'),_0x1ce0a2,_0xde14('0x15'),JSON[_0xde14('0x18')](_0x8e0e));if(_0x8e0e[_0xde14('0x19')]){if(_0x8e0e[_0xde14('0x19')][_0xde14('0x1a')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x1ce0a2,_0x8e0e[_0xde14('0x19')][_0xde14('0x1b')]);return _0xe785fb(_0x8e0e[_0xde14('0x19')]['message']);}logger[_0xde14('0x19')](_0xde14('0x14'),_0x1ce0a2,_0x8e0e[_0xde14('0x19')][_0xde14('0x1b')]);return _0x1a7167(_0x8e0e[_0xde14('0x19')][_0xde14('0x1b')]);}else{logger[_0xde14('0x13')](_0xde14('0x14'),_0x1ce0a2,_0xde14('0x15'));_0x1a7167(_0x8e0e[_0xde14('0x1c')]['message']);}})[_0xde14('0x1d')](function(_0x3bfc59){logger[_0xde14('0x19')](_0xde14('0x14'),_0x1ce0a2,_0x3bfc59);_0xe785fb(_0x3bfc59);});});}exports['CreateFaxMessage']=function(_0x394de7){var _0x53e905=this;return new Promise(function(_0x45d101,_0x4c24a8){return db[_0xde14('0x1e')][_0xde14('0x1f')](_0x394de7[_0xde14('0x20')],{'raw':_0x394de7[_0xde14('0x21')]?_0x394de7[_0xde14('0x21')][_0xde14('0x22')]===undefined?!![]:![]:!![]})[_0xde14('0x12')](function(_0x2dd9e7){logger[_0xde14('0x13')](_0xde14('0x23'),_0x394de7);logger[_0xde14('0x16')](_0xde14('0x23'),_0x394de7,JSON[_0xde14('0x18')](_0x2dd9e7));_0x45d101(_0x2dd9e7);})['catch'](function(_0x42dd4f){logger[_0xde14('0x19')](_0xde14('0x23'),_0x42dd4f[_0xde14('0x1b')],_0x394de7);_0x4c24a8(_0x53e905[_0xde14('0x19')](0x1f4,_0x42dd4f[_0xde14('0x1b')]));});});};exports[_0xde14('0x24')]=function(_0x23c735){var _0x1618e1=this;return new Promise(function(_0x350a78,_0x4eff65){return db[_0xde14('0x1e')][_0xde14('0x25')](_0x23c735[_0xde14('0x20')],{'raw':_0x23c735[_0xde14('0x21')]?_0x23c735['options'][_0xde14('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23c735[_0xde14('0x21')]?_0x23c735[_0xde14('0x21')]['where']||null:null,'attributes':_0x23c735[_0xde14('0x21')]?_0x23c735['options'][_0xde14('0x26')]||null:null,'limit':_0x23c735[_0xde14('0x21')]?_0x23c735[_0xde14('0x21')][_0xde14('0x27')]||null:null})[_0xde14('0x12')](function(_0x237d3f){logger[_0xde14('0x13')](_0xde14('0x24'),_0x23c735);logger['debug'](_0xde14('0x24'),_0x23c735,JSON[_0xde14('0x18')](_0x237d3f));_0x350a78(_0x237d3f);})['catch'](function(_0xf25a9e){logger['error'](_0xde14('0x24'),_0xf25a9e[_0xde14('0x1b')],_0x23c735);_0x4eff65(_0x1618e1[_0xde14('0x19')](0x1f4,_0xf25a9e[_0xde14('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 57d8d64..be91a40 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 _0xed08=['faxMessage:','./faxMessage.events','save','remove','emit','removeListener','register'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xed08,0x1eb));var _0x8ed0=function(_0x4ae91b,_0x3ea1b9){_0x4ae91b=_0x4ae91b-0x0;var _0xb9685c=_0xed08[_0x4ae91b];return _0xb9685c;};'use strict';var FaxMessageEvents=require(_0x8ed0('0x0'));var events=[_0x8ed0('0x1'),_0x8ed0('0x2'),'update'];function createListener(_0x51dc47,_0x444f5d){return function(_0x47983d){_0x444f5d[_0x8ed0('0x3')](_0x51dc47,_0x47983d);};}function removeListener(_0x4c8a67,_0x5c92d3){return function(){FaxMessageEvents[_0x8ed0('0x4')](_0x4c8a67,_0x5c92d3);};}exports[_0x8ed0('0x5')]=function(_0x18971a){for(var _0x459700=0x0,_0x3f12d7=events['length'];_0x459700<_0x3f12d7;_0x459700++){var _0x4a5ca1=events[_0x459700];var _0x7a6e61=createListener(_0x8ed0('0x6')+_0x4a5ca1,_0x18971a);FaxMessageEvents['on'](_0x4a5ca1,_0x7a6e61);}}; \ No newline at end of file +var _0x0f17=['update','emit','removeListener','register','length','faxMessage:','./faxMessage.events','save'];(function(_0x2637ac,_0x377857){var _0x4a5758=function(_0x5d5043){while(--_0x5d5043){_0x2637ac['push'](_0x2637ac['shift']());}};_0x4a5758(++_0x377857);}(_0x0f17,0x116));var _0x70f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0f17[_0x3dd15e];return _0x231fd0;};'use strict';var FaxMessageEvents=require(_0x70f1('0x0'));var events=[_0x70f1('0x1'),'remove',_0x70f1('0x2')];function createListener(_0x68c633,_0x1ef6f2){return function(_0x47c304){_0x1ef6f2[_0x70f1('0x3')](_0x68c633,_0x47c304);};}function removeListener(_0x42e042,_0x507d95){return function(){FaxMessageEvents[_0x70f1('0x4')](_0x42e042,_0x507d95);};}exports[_0x70f1('0x5')]=function(_0x83f8f6){for(var _0x5e8028=0x0,_0x572286=events[_0x70f1('0x6')];_0x5e8028<_0x572286;_0x5e8028++){var _0x5bfc23=events[_0x5e8028];var _0x23898e=createListener(_0x70f1('0x7')+_0x5bfc23,_0x83f8f6);FaxMessageEvents['on'](_0x5bfc23,_0x23898e);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 408af12..2aad4b2 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 _0x41bb=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','describe','/:id','show','/:id/download','download','fax','faxmessage:create','create','put','update','/:id/accept','accept','reject','delete','destroy','multer','util','connect-timeout'];(function(_0x55690a,_0x3a9cb5){var _0x5caecc=function(_0x53a030){while(--_0x53a030){_0x55690a['push'](_0x55690a['shift']());}};_0x5caecc(++_0x3a9cb5);}(_0x41bb,0xc5));var _0xb41b=function(_0x3fcb65,_0x135d6f){_0x3fcb65=_0x3fcb65-0x0;var _0x17eed6=_0x41bb[_0x3fcb65];return _0x17eed6;};'use strict';var multer=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var path=require('path');var timeout=require(_0xb41b('0x2'));var express=require('express');var router=express[_0xb41b('0x3')]();var fs_extra=require(_0xb41b('0x4'));var auth=require(_0xb41b('0x5'));var interaction=require(_0xb41b('0x6'));var config=require('../../config/environment');var controller=require(_0xb41b('0x7'));router[_0xb41b('0x8')]('/',auth[_0xb41b('0x9')](),controller['index']);router['get']('/describe',auth[_0xb41b('0x9')](),controller[_0xb41b('0xa')]);router['get'](_0xb41b('0xb'),auth[_0xb41b('0x9')](),controller[_0xb41b('0xc')]);router[_0xb41b('0x8')](_0xb41b('0xd'),auth[_0xb41b('0x9')](),controller[_0xb41b('0xe')]);router['post']('/',auth[_0xb41b('0x9')](),interaction['tracked'](_0xb41b('0xf'),_0xb41b('0x10')),controller[_0xb41b('0x11')]);router[_0xb41b('0x12')](_0xb41b('0xb'),auth['isAuthenticated'](),controller[_0xb41b('0x13')]);router[_0xb41b('0x12')](_0xb41b('0x14'),auth[_0xb41b('0x9')](),controller[_0xb41b('0x15')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0xb41b('0x16')]);router[_0xb41b('0x17')](_0xb41b('0xb'),auth[_0xb41b('0x9')](),controller[_0xb41b('0x18')]);module['exports']=router; \ No newline at end of file +var _0x0102=['show','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','/:id','update','accept','/:id/reject','reject','exports','util','path','connect-timeout','express','./faxMessage.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x5f519b,_0x5b606f){var _0x2461e2=function(_0x510241){while(--_0x510241){_0x5f519b['push'](_0x5f519b['shift']());}};_0x2461e2(++_0x5b606f);}(_0x0102,0x186));var _0x2010=function(_0x2ddca2,_0x3e8af1){_0x2ddca2=_0x2ddca2-0x0;var _0x3bdf1a=_0x0102[_0x2ddca2];return _0x3bdf1a;};'use strict';var multer=require('multer');var util=require(_0x2010('0x0'));var path=require(_0x2010('0x1'));var timeout=require(_0x2010('0x2'));var express=require(_0x2010('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2010('0x4'));router[_0x2010('0x5')]('/',auth[_0x2010('0x6')](),controller[_0x2010('0x7')]);router['get'](_0x2010('0x8'),auth['isAuthenticated'](),controller[_0x2010('0x9')]);router[_0x2010('0x5')]('/:id',auth[_0x2010('0x6')](),controller[_0x2010('0xa')]);router[_0x2010('0x5')](_0x2010('0xb'),auth[_0x2010('0x6')](),controller[_0x2010('0xc')]);router[_0x2010('0xd')]('/',auth[_0x2010('0x6')](),interaction[_0x2010('0xe')](_0x2010('0xf'),_0x2010('0x10')),controller[_0x2010('0x11')]);router[_0x2010('0x12')](_0x2010('0x13'),auth[_0x2010('0x6')](),controller[_0x2010('0x14')]);router['put']('/:id/accept',auth[_0x2010('0x6')](),controller[_0x2010('0x15')]);router[_0x2010('0x12')](_0x2010('0x16'),auth[_0x2010('0x6')](),controller[_0x2010('0x17')]);router['delete'](_0x2010('0x13'),auth[_0x2010('0x6')](),controller['destroy']);module[_0x2010('0x18')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 21ef2f0..840065f 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 _0x752a=['INTEGER','exports','STRING','name','ENUM','rrmemory','beepall','roundrobin'];(function(_0x5556bf,_0xa83a80){var _0x3dea86=function(_0x55b671){while(--_0x55b671){_0x5556bf['push'](_0x5556bf['shift']());}};_0x3dea86(++_0xa83a80);}(_0x752a,0x109));var _0xa752=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x752a[_0x279d37];return _0x530173;};'use strict';var Sequelize=require('sequelize');module[_0xa752('0x0')]={'name':{'type':Sequelize[_0xa752('0x1')],'unique':_0xa752('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa752('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa752('0x3')](_0xa752('0x4'),_0xa752('0x5'),_0xa752('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xa752('0x7')],'defaultValue':0x0}}; \ No newline at end of file +var _0xde4e=['beepall','roundrobin','sequelize','exports','name','STRING','INTEGER','ENUM','rrmemory'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xde4e,0x18e));var _0xede4=function(_0x501ace,_0x5344a2){_0x501ace=_0x501ace-0x0;var _0x162715=_0xde4e[_0x501ace];return _0x162715;};'use strict';var Sequelize=require(_0xede4('0x0'));module[_0xede4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xede4('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xede4('0x3')]},'timeout':{'type':Sequelize[_0xede4('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xede4('0x5')](_0xede4('0x6'),_0xede4('0x7'),_0xede4('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xede4('0x4')],'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 992c917..0956da3 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 _0xec8c=['user','get','role','UserProfileSection','userProfileId','describe','getMembers','findOne','UserFaxQueue','order','pick','FaxQueueId','User','agent','updatedAt','createdAt','format','SIP','getTeams','ids','Team','Agents','online','interface','flatMap','sequelize','each','forEach','emit','userFaxQueue:save','removeTeams','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','transaction','isEmpty','removeAgents','userFaxQueue:remove','omit','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxQueue.socket','register','end','status','limit','undefined','count','offset','set','Content-Range','json','save','update','FaxQueues','UserProfileResource','destroy','then','sendStatus','error','stack','name','send','index','map','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','include','FaxQueue','findAll','rows','catch','show','params','rawAttributes','length','includeAll','find','create','body'];(function(_0xc009fe,_0x434456){var _0x4509c2=function(_0x1da635){while(--_0x1da635){_0xc009fe['push'](_0xc009fe['shift']());}};_0x4509c2(++_0x434456);}(_0xec8c,0x154));var _0xcec8=function(_0xae282f,_0x2d9368){_0xae282f=_0xae282f-0x0;var _0x5f46d4=_0xec8c[_0xae282f];return _0x5f46d4;};'use strict';var emlformat=require(_0xcec8('0x0'));var rimraf=require(_0xcec8('0x1'));var zipdir=require(_0xcec8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcec8('0x3'));var moment=require(_0xcec8('0x4'));var BPromise=require(_0xcec8('0x5'));var Mustache=require(_0xcec8('0x6'));var util=require('util');var path=require(_0xcec8('0x7'));var sox=require(_0xcec8('0x8'));var csv=require(_0xcec8('0x9'));var ejs=require(_0xcec8('0xa'));var fs=require('fs');var fs_extra=require(_0xcec8('0xb'));var _=require(_0xcec8('0xc'));var squel=require(_0xcec8('0xd'));var crypto=require(_0xcec8('0xe'));var jsforce=require(_0xcec8('0xf'));var deskjs=require(_0xcec8('0x10'));var toCsv=require('to-csv');var querystring=require(_0xcec8('0x11'));var Papa=require(_0xcec8('0x12'));var Redis=require(_0xcec8('0x13'));var authService=require(_0xcec8('0x14'));var qs=require(_0xcec8('0x15'));var as=require(_0xcec8('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcec8('0x17'))(_0xcec8('0x18'));var utils=require(_0xcec8('0x19'));var config=require(_0xcec8('0x1a'));var licenseUtil=require(_0xcec8('0x1b'));var db=require(_0xcec8('0x1c'))['db'];config[_0xcec8('0x1d')]=_['defaults'](config[_0xcec8('0x1d')],{'host':_0xcec8('0x1e'),'port':0x18eb});var socket=require(_0xcec8('0x1f'))(new Redis(config[_0xcec8('0x1d')]));require(_0xcec8('0x20'))[_0xcec8('0x21')](socket);function respondWithStatusCode(_0x107a00,_0x249496){_0x249496=_0x249496||0xcc;return function(_0x33d35c){if(_0x33d35c){return _0x107a00['sendStatus'](_0x249496);}return _0x107a00['status'](_0x249496)[_0xcec8('0x22')]();};}function respondWithResult(_0x15ed2,_0x85ce91){_0x85ce91=_0x85ce91||0xc8;return function(_0x5ea6e0){if(_0x5ea6e0){return _0x15ed2[_0xcec8('0x23')](_0x85ce91)['json'](_0x5ea6e0);}};}function respondWithFilteredResult(_0x6adef8,_0x49e6b9){return function(_0x433df8){if(_0x433df8){var _0x3be5ee=typeof _0x49e6b9['offset']==='undefined'&&typeof _0x49e6b9[_0xcec8('0x24')]===_0xcec8('0x25');var _0x1e15ae=_0x433df8[_0xcec8('0x26')];var _0x313b1b=_0x3be5ee?0x0:_0x49e6b9[_0xcec8('0x27')];var _0x46503c=_0x3be5ee?_0x433df8[_0xcec8('0x26')]:_0x49e6b9[_0xcec8('0x27')]+_0x49e6b9[_0xcec8('0x24')];var _0x25ac68;if(_0x46503c>=_0x1e15ae){_0x46503c=_0x1e15ae;_0x25ac68=0xc8;}else{_0x25ac68=0xce;}_0x6adef8[_0xcec8('0x23')](_0x25ac68);return _0x6adef8[_0xcec8('0x28')](_0xcec8('0x29'),_0x313b1b+'-'+_0x46503c+'/'+_0x1e15ae)[_0xcec8('0x2a')](_0x433df8);}return null;};}function patchUpdates(_0x447931){return function(_0x48784e){try{jsonpatch['apply'](_0x48784e,_0x447931,!![]);}catch(_0x5ff96a){return BPromise['reject'](_0x5ff96a);}return _0x48784e[_0xcec8('0x2b')]();};}function saveUpdates(_0x2b915f,_0x4f0fd8){return function(_0x572282){if(_0x572282){return _0x572282[_0xcec8('0x2c')](_0x2b915f)['then'](function(_0x4d14d6){return _0x4d14d6;});}return null;};}function removeEntity(_0x1a081f,_0x54db41){return function(_0x375e9d){if(_0x375e9d){return _0x375e9d['destroy']()['then'](function(){var _0x5ae976=_0x375e9d['get']({'plain':!![]});var _0x59574e=_0xcec8('0x2d');return db[_0xcec8('0x2e')][_0xcec8('0x2f')]({'where':{'type':_0x59574e,'resourceId':_0x5ae976['id']}})[_0xcec8('0x30')](function(){return _0x375e9d;});})['then'](function(){_0x1a081f['status'](0xcc)[_0xcec8('0x22')]();});}};}function handleEntityNotFound(_0x4c4b82,_0x33fdfd){return function(_0xa24d68){if(!_0xa24d68){_0x4c4b82[_0xcec8('0x31')](0x194);}return _0xa24d68;};}function handleError(_0x570603,_0x118597){_0x118597=_0x118597||0x1f4;return function(_0x554cab){logger[_0xcec8('0x32')](_0x554cab[_0xcec8('0x33')]);if(_0x554cab['name']){delete _0x554cab[_0xcec8('0x34')];}_0x570603['status'](_0x118597)[_0xcec8('0x35')](_0x554cab);};}exports[_0xcec8('0x36')]=function(_0x447a57,_0x3b2021){var _0x17db99={},_0x1e5deb={},_0x9bb834={'count':0x0,'rows':[]};var _0x14c053=_[_0xcec8('0x37')](db['FaxQueue']['rawAttributes'],function(_0x1f8147){return{'name':_0x1f8147['fieldName'],'type':_0x1f8147['type'][_0xcec8('0x38')]};});_0x1e5deb['model']=_[_0xcec8('0x37')](_0x14c053,_0xcec8('0x34'));_0x1e5deb[_0xcec8('0x39')]=_[_0xcec8('0x3a')](_0x447a57['query']);_0x1e5deb[_0xcec8('0x3b')]=_[_0xcec8('0x3c')](_0x1e5deb['model'],_0x1e5deb[_0xcec8('0x39')]);_0x17db99[_0xcec8('0x3d')]=_[_0xcec8('0x3c')](_0x1e5deb[_0xcec8('0x3e')],qs['fields'](_0x447a57[_0xcec8('0x39')][_0xcec8('0x3f')]));_0x17db99['attributes']=_0x17db99[_0xcec8('0x3d')]['length']?_0x17db99[_0xcec8('0x3d')]:_0x1e5deb['model'];if(!_0x447a57[_0xcec8('0x39')][_0xcec8('0x40')](_0xcec8('0x41'))){_0x17db99['limit']=qs['limit'](_0x447a57['query'][_0xcec8('0x24')]);_0x17db99['offset']=qs[_0xcec8('0x27')](_0x447a57[_0xcec8('0x39')][_0xcec8('0x27')]);}_0x17db99['order']=qs['sort'](_0x447a57[_0xcec8('0x39')][_0xcec8('0x42')]);_0x17db99[_0xcec8('0x43')]=qs['filters'](_['pick'](_0x447a57[_0xcec8('0x39')],_0x1e5deb['filters']),_0x14c053);if(_0x447a57['query'][_0xcec8('0x44')]){_0x17db99[_0xcec8('0x43')]=_[_0xcec8('0x45')](_0x17db99['where'],{'$or':_[_0xcec8('0x37')](_0x14c053,function(_0x67f671){if(_0x67f671[_0xcec8('0x46')]!==_0xcec8('0x47')){var _0x35448f={};_0x35448f[_0x67f671['name']]={'$like':'%'+_0x447a57['query'][_0xcec8('0x44')]+'%'};return _0x35448f;}})});}_0x17db99=_[_0xcec8('0x45')]({},_0x17db99,_0x447a57[_0xcec8('0x48')]);var _0x1eb1fb={'where':_0x17db99[_0xcec8('0x43')]};return db['FaxQueue']['count'](_0x1eb1fb)[_0xcec8('0x30')](function(_0x1f7fbb){_0x9bb834['count']=_0x1f7fbb;if(_0x447a57[_0xcec8('0x39')]['includeAll']){_0x17db99[_0xcec8('0x49')]=[{'all':!![]}];}return db[_0xcec8('0x4a')][_0xcec8('0x4b')](_0x17db99);})[_0xcec8('0x30')](function(_0x223b57){_0x9bb834[_0xcec8('0x4c')]=_0x223b57;return _0x9bb834;})[_0xcec8('0x30')](respondWithFilteredResult(_0x3b2021,_0x17db99))[_0xcec8('0x4d')](handleError(_0x3b2021,null));};exports[_0xcec8('0x4e')]=function(_0xd4d887,_0x29fd37){var _0xace3f4={'raw':!![],'where':{'id':_0xd4d887[_0xcec8('0x4f')]['id']}},_0x1e9637={};_0x1e9637[_0xcec8('0x3e')]=_[_0xcec8('0x3a')](db[_0xcec8('0x4a')][_0xcec8('0x50')]);_0x1e9637[_0xcec8('0x39')]=_['keys'](_0xd4d887[_0xcec8('0x39')]);_0x1e9637[_0xcec8('0x3b')]=_[_0xcec8('0x3c')](_0x1e9637['model'],_0x1e9637[_0xcec8('0x39')]);_0xace3f4[_0xcec8('0x3d')]=_[_0xcec8('0x3c')](_0x1e9637[_0xcec8('0x3e')],qs[_0xcec8('0x3f')](_0xd4d887['query']['fields']));_0xace3f4[_0xcec8('0x3d')]=_0xace3f4[_0xcec8('0x3d')][_0xcec8('0x51')]?_0xace3f4[_0xcec8('0x3d')]:_0x1e9637[_0xcec8('0x3e')];if(_0xd4d887[_0xcec8('0x39')][_0xcec8('0x52')]){_0xace3f4[_0xcec8('0x49')]=[{'all':!![]}];}_0xace3f4=_['merge']({},_0xace3f4,_0xd4d887['options']);return db['FaxQueue'][_0xcec8('0x53')](_0xace3f4)['then'](handleEntityNotFound(_0x29fd37,null))['then'](respondWithResult(_0x29fd37,null))[_0xcec8('0x4d')](handleError(_0x29fd37,null));};exports['create']=function(_0x3d204f,_0x329ea3){return db['FaxQueue'][_0xcec8('0x54')](_0x3d204f[_0xcec8('0x55')],{})[_0xcec8('0x30')](function(_0x3fc0c1){var _0x30a8cd=_0x3d204f[_0xcec8('0x56')][_0xcec8('0x57')]({'plain':!![]});if(!_0x30a8cd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30a8cd[_0xcec8('0x58')]===_0xcec8('0x56')){var _0x523803=_0x3fc0c1['get']({'plain':!![]});var _0x1f5366=_0xcec8('0x2d');return db[_0xcec8('0x59')][_0xcec8('0x53')]({'where':{'name':_0x1f5366,'userProfileId':_0x30a8cd[_0xcec8('0x5a')]},'raw':!![]})[_0xcec8('0x30')](function(_0x4e065e){if(_0x4e065e&&_0x4e065e['autoAssociation']===0x0){return db[_0xcec8('0x2e')]['create']({'name':_0x523803['name'],'resourceId':_0x523803['id'],'type':_0x4e065e[_0xcec8('0x34')],'sectionId':_0x4e065e['id']},{})['then'](function(){return _0x3fc0c1;});}else{return _0x3fc0c1;}})['catch'](function(_0xa2c89c){logger[_0xcec8('0x32')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa2c89c);throw _0xa2c89c;});}return _0x3fc0c1;})[_0xcec8('0x30')](respondWithResult(_0x329ea3,0xc9))[_0xcec8('0x4d')](handleError(_0x329ea3,null));};exports['update']=function(_0x9bc404,_0x5832f9){if(_0x9bc404[_0xcec8('0x55')]['id']){delete _0x9bc404[_0xcec8('0x55')]['id'];}return db[_0xcec8('0x4a')][_0xcec8('0x53')]({'where':{'id':_0x9bc404['params']['id']}})[_0xcec8('0x30')](handleEntityNotFound(_0x5832f9,null))[_0xcec8('0x30')](saveUpdates(_0x9bc404['body'],null))[_0xcec8('0x30')](respondWithResult(_0x5832f9,null))[_0xcec8('0x4d')](handleError(_0x5832f9,null));};exports[_0xcec8('0x2f')]=function(_0x3246a0,_0x32bf8e){return db['FaxQueue'][_0xcec8('0x53')]({'where':{'id':_0x3246a0[_0xcec8('0x4f')]['id']}})[_0xcec8('0x30')](handleEntityNotFound(_0x32bf8e,null))[_0xcec8('0x30')](removeEntity(_0x32bf8e,null))['catch'](handleError(_0x32bf8e,null));};exports[_0xcec8('0x5b')]=function(_0x2fed37,_0x2a1b9b){return db[_0xcec8('0x4a')]['describe']()[_0xcec8('0x30')](respondWithResult(_0x2a1b9b,null))[_0xcec8('0x4d')](handleError(_0x2a1b9b,null));};exports[_0xcec8('0x5c')]=function(_0x363616,_0x38cb76,_0x1ca8df){var _0x1804c3={'raw':!![],'where':{}},_0x5a119b={},_0xfcf426;return db[_0xcec8('0x4a')][_0xcec8('0x5d')]({'where':{'id':_0x363616[_0xcec8('0x4f')]['id']}})[_0xcec8('0x30')](handleEntityNotFound(_0x38cb76,null))['then'](function(_0x48975e){if(_0x48975e){_0xfcf426=_0x48975e['get']({'plain':!![]});_0x5a119b['model']=_['keys'](db[_0xcec8('0x5e')][_0xcec8('0x50')]);_0x5a119b[_0xcec8('0x39')]=_[_0xcec8('0x3a')](_0x363616[_0xcec8('0x39')]);_0x5a119b['filters']=_[_0xcec8('0x3c')](_0x5a119b[_0xcec8('0x3e')],_0x5a119b[_0xcec8('0x39')]);_0x1804c3[_0xcec8('0x3d')]=_['intersection'](_0x5a119b[_0xcec8('0x3e')],qs[_0xcec8('0x3f')](_0x363616['query'][_0xcec8('0x3f')]));_0x1804c3[_0xcec8('0x3d')]=_0x1804c3[_0xcec8('0x3d')][_0xcec8('0x51')]?_0x1804c3[_0xcec8('0x3d')]:_0x5a119b[_0xcec8('0x3e')];if(!_0x363616[_0xcec8('0x39')]['hasOwnProperty']('nolimit')){_0x1804c3['limit']=qs['limit'](_0x363616[_0xcec8('0x39')][_0xcec8('0x24')]);_0x1804c3[_0xcec8('0x27')]=qs[_0xcec8('0x27')](_0x363616['query'][_0xcec8('0x27')]);}_0x1804c3[_0xcec8('0x5f')]=qs[_0xcec8('0x42')](_0x363616[_0xcec8('0x39')][_0xcec8('0x42')]);_0x1804c3[_0xcec8('0x43')]=qs[_0xcec8('0x3b')](_[_0xcec8('0x60')](_0x363616[_0xcec8('0x39')],_0x5a119b['filters']));_0x1804c3[_0xcec8('0x43')][_0xcec8('0x61')]=_0x48975e['id'];if(_0x363616['query']['filter']){_0x1804c3[_0xcec8('0x43')]=_['merge'](_0x1804c3[_0xcec8('0x43')],{'$or':_[_0xcec8('0x37')](_0x1804c3[_0xcec8('0x3d')],function(_0x3d6ed4){var _0x517ba9={};_0x517ba9[_0x3d6ed4]={'$like':'%'+_0x363616[_0xcec8('0x39')][_0xcec8('0x44')]+'%'};return _0x517ba9;})});}_0x1804c3=_['merge']({},_0x1804c3,_0x363616['options']);return db[_0xcec8('0x5e')][_0xcec8('0x4b')](_0x1804c3);}})['then'](function(_0x4e0392){if(_0x4e0392){return db[_0xcec8('0x62')]['findAndCountAll']({'where':{'id':_[_0xcec8('0x37')](_0x4e0392,'UserId'),'role':_0xcec8('0x63')},'attributes':['id',_0xcec8('0x34'),'faxPause',_0xcec8('0x64'),_0xcec8('0x65')]});}})[_0xcec8('0x30')](function(_0x18171e){if(_0x18171e){return{'count':_0x18171e[_0xcec8('0x26')],'rows':_[_0xcec8('0x37')](_0x18171e[_0xcec8('0x4c')],function(_0xa53a67){return{'membername':_0xa53a67[_0xcec8('0x34')],'UserId':_0xa53a67['id'],'queue_name':_0xfcf426[_0xcec8('0x34')],'FaxQueueId':_0xfcf426['id'],'interface':util[_0xcec8('0x66')]('%s/%s',_0xcec8('0x67'),_0xa53a67[_0xcec8('0x34')]),'penalty':0x0,'paused':_0xa53a67['faxPause'],'createdAt':_0xa53a67[_0xcec8('0x65')],'updatedAt':_0xa53a67[_0xcec8('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xcec8('0x30')](respondWithFilteredResult(_0x38cb76,_0x1804c3))[_0xcec8('0x4d')](handleError(_0x38cb76,null));};exports[_0xcec8('0x68')]=function(_0x27cdc1,_0xea9dd3,_0x537f8a){var _0x331b4b={};var _0x42c3fe={};var _0xcf0cd6;var _0x4bef09;return db[_0xcec8('0x4a')][_0xcec8('0x5d')]({'where':{'id':_0x27cdc1[_0xcec8('0x4f')]['id']}})[_0xcec8('0x30')](handleEntityNotFound(_0xea9dd3,null))['then'](function(_0x3a0f97){if(_0x3a0f97){_0xcf0cd6=_0x3a0f97;_0x42c3fe[_0xcec8('0x3e')]=_[_0xcec8('0x3a')](db['Team']['rawAttributes']);_0x42c3fe[_0xcec8('0x39')]=_[_0xcec8('0x3a')](_0x27cdc1['query']);_0x42c3fe['filters']=_['intersection'](_0x42c3fe[_0xcec8('0x3e')],_0x42c3fe[_0xcec8('0x39')]);_0x331b4b['attributes']=_[_0xcec8('0x3c')](_0x42c3fe[_0xcec8('0x3e')],qs[_0xcec8('0x3f')](_0x27cdc1[_0xcec8('0x39')][_0xcec8('0x3f')]));_0x331b4b[_0xcec8('0x3d')]=_0x331b4b[_0xcec8('0x3d')][_0xcec8('0x51')]?_0x331b4b[_0xcec8('0x3d')]:_0x42c3fe[_0xcec8('0x3e')];_0x331b4b[_0xcec8('0x5f')]=qs['sort'](_0x27cdc1['query'][_0xcec8('0x42')]);_0x331b4b[_0xcec8('0x43')]=qs[_0xcec8('0x3b')](_[_0xcec8('0x60')](_0x27cdc1[_0xcec8('0x39')],_0x42c3fe[_0xcec8('0x3b')]));if(_0x27cdc1[_0xcec8('0x39')][_0xcec8('0x44')]){_0x331b4b['where']=_[_0xcec8('0x45')](_0x331b4b[_0xcec8('0x43')],{'$or':_[_0xcec8('0x37')](_0x331b4b[_0xcec8('0x3d')],function(_0x4df934){var _0x4ada75={};_0x4ada75[_0x4df934]={'$like':'%'+_0x27cdc1[_0xcec8('0x39')][_0xcec8('0x44')]+'%'};return _0x4ada75;})});}_0x331b4b=_[_0xcec8('0x45')]({},_0x331b4b,_0x27cdc1['options']);return _0xcf0cd6['getTeams'](_0x331b4b);}})[_0xcec8('0x30')](function(_0x242a98){if(_0x242a98){_0x4bef09=_0x242a98['length'];if(!_0x27cdc1[_0xcec8('0x39')]['hasOwnProperty']('nolimit')){_0x331b4b[_0xcec8('0x24')]=qs[_0xcec8('0x24')](_0x27cdc1['query'][_0xcec8('0x24')]);_0x331b4b[_0xcec8('0x27')]=qs[_0xcec8('0x27')](_0x27cdc1['query']['offset']);}return _0xcf0cd6[_0xcec8('0x68')](_0x331b4b);}})[_0xcec8('0x30')](function(_0x17c39a){if(_0x17c39a){return _0x17c39a?{'count':_0x4bef09,'rows':_0x17c39a}:null;}})[_0xcec8('0x30')](respondWithResult(_0xea9dd3,null))[_0xcec8('0x4d')](handleError(_0xea9dd3,null));};exports['addTeams']=function(_0x263ff8,_0x370277,_0x5c44f7){var _0x1cf67e=_0x263ff8[_0xcec8('0x55')][_0xcec8('0x69')];return db[_0xcec8('0x6a')][_0xcec8('0x4b')]({'where':{'id':_0x1cf67e},'attributes':['id'],'include':[{'model':db[_0xcec8('0x62')],'as':_0xcec8('0x6b'),'attributes':['id',_0xcec8('0x34'),_0xcec8('0x6c'),'voicePause',_0xcec8('0x6d')],'raw':!![]}]})['then'](function(_0x245dc9){if(_0x245dc9){var _0x1d20ac=_[_0xcec8('0x6e')](_0x245dc9,function(_0x342390){var _0x3ca605=_0x342390[_0xcec8('0x57')]({'plain':!![]});return _0x3ca605[_0xcec8('0x6b')];});return db['FaxQueue']['find']({'where':{'id':_0x263ff8[_0xcec8('0x4f')]['id']}})[_0xcec8('0x30')](function(_0x5a5fb6){return db[_0xcec8('0x6f')]['transaction'](function(_0x56b7a8){return _0x5a5fb6['addTeams'](_0x1cf67e,{'transaction':_0x56b7a8})[_0xcec8('0x30')](function(){return BPromise[_0xcec8('0x70')](_0x1d20ac,function(_0x79fa60){return db[_0xcec8('0x5e')]['findOrCreate']({'where':{'UserId':_0x79fa60['id'],'FaxQueueId':_0x263ff8['params']['id']},'transaction':_0x56b7a8});});})[_0xcec8('0x30')](function(){_0x1d20ac[_0xcec8('0x71')](function(_0x2218d8){socket[_0xcec8('0x72')](_0xcec8('0x73'),{'UserId':_0x2218d8['id'],'FaxQueueId':_0x5a5fb6['id']});});});});});}})['then'](respondWithStatusCode(_0x370277,null))['catch'](handleError(_0x370277,null));};exports[_0xcec8('0x74')]=function(_0x5c7ba1,_0x850e09,_0xa94e67){return db[_0xcec8('0x6a')]['findAll']({'where':{'id':_0x5c7ba1[_0xcec8('0x39')][_0xcec8('0x69')]},'attributes':['id'],'include':[{'model':db[_0xcec8('0x62')],'as':_0xcec8('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xcec8('0x30')](handleEntityNotFound(_0x850e09,null))[_0xcec8('0x30')](function(_0x2a28bd){var _0x3f0b72=_['map'](_0x2a28bd,'id');var _0x277bbe=[];var _0x10ff9e=[];var _0x35e2a2=squel['select']();_0x35e2a2[_0xcec8('0x75')](_0xcec8('0x76'))['from']('team_has_fax_queues','tq')[_0xcec8('0x77')](_0xcec8('0x78'),'ut',_0xcec8('0x79'))['where'](_0xcec8('0x7a'),_0x5c7ba1['params']['id']);for(var _0x4dc2e4=0x0;_0x4dc2e4<_0x2a28bd[_0xcec8('0x51')];_0x4dc2e4+=0x1){let _0x36f7d2=_0x2a28bd[_0x4dc2e4];for(var _0x564fc1=0x0;_0x564fc1<_0x36f7d2[_0xcec8('0x6b')][_0xcec8('0x51')];_0x564fc1+=0x1){let _0x4eb02e=_0x36f7d2[_0xcec8('0x6b')][_0x564fc1];var _0x101102=_0x35e2a2[_0xcec8('0x7b')]();_0x101102['where'](_0xcec8('0x7c'),_0x4eb02e['id']);_0x10ff9e[_0xcec8('0x7d')](db['sequelize']['query'](_0x101102[_0xcec8('0x7e')](),{'type':db['sequelize'][_0xcec8('0x7f')][_0xcec8('0x80')]})[_0xcec8('0x30')](function(_0x5989e9){if(_0x5989e9[_0xcec8('0x51')]===0x1){return _0x4eb02e['id'];}else{var _0x26e721=_[_0xcec8('0x81')](_[_0xcec8('0x37')](_0x5989e9,_0xcec8('0x82')),function(_0x22c0bd){return _[_0xcec8('0x83')](_0x3f0b72,_0x22c0bd);});if(_0x26e721){return _0x4eb02e['id'];}}}));}}return BPromise[_0xcec8('0x84')](_0x10ff9e)[_0xcec8('0x30')](function(_0x45955b){_0x277bbe=_(_0x277bbe)['union'](_0x45955b)[_0xcec8('0x85')]()[_0xcec8('0x86')]();return db[_0xcec8('0x4a')][_0xcec8('0x53')]({'where':{'id':_0x5c7ba1[_0xcec8('0x4f')]['id']}})[_0xcec8('0x30')](function(_0x5090d5){return db[_0xcec8('0x6f')][_0xcec8('0x87')](function(_0x4b456f){return _0x5090d5[_0xcec8('0x74')](_0x5c7ba1[_0xcec8('0x39')]['ids'],{'transaction':_0x4b456f})['then'](function(){if(!_[_0xcec8('0x88')](_0x277bbe)){return _0x5090d5[_0xcec8('0x89')](_0x277bbe,{'transaction':_0x4b456f});}})['then'](function(){_0x277bbe[_0xcec8('0x71')](function(_0x3273e7){socket[_0xcec8('0x72')](_0xcec8('0x8a'),{'UserId':_0x3273e7,'FaxQueueId':_0x5090d5['id']});});});});});});})[_0xcec8('0x30')](respondWithStatusCode(_0x850e09,null))[_0xcec8('0x4d')](handleError(_0x850e09,null));};exports['addAgents']=function(_0x49fe41,_0x130cd2,_0x207dc2){return db['FaxQueue'][_0xcec8('0x53')]({'where':{'id':_0x49fe41[_0xcec8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x130cd2,null))['then'](function(_0x4560e3){if(_0x4560e3){return _0x4560e3['addAgents'](_0x49fe41['body'][_0xcec8('0x69')],_[_0xcec8('0x8b')](_0x49fe41[_0xcec8('0x55')],[_0xcec8('0x69'),'id'])||{})['spread'](function(_0x2164f0){for(var _0x23709b=0x0;_0x23709b<_0x49fe41[_0xcec8('0x55')]['ids'][_0xcec8('0x51')];_0x23709b+=0x1){socket[_0xcec8('0x72')](_0xcec8('0x73'),{'UserId':Number(_0x49fe41[_0xcec8('0x55')]['ids'][_0x23709b]),'FaxQueueId':Number(_0x49fe41[_0xcec8('0x4f')]['id'])});}return _0x2164f0;});}})['then'](respondWithResult(_0x130cd2,null))[_0xcec8('0x4d')](handleError(_0x130cd2,null));};exports[_0xcec8('0x89')]=function(_0x1b00be,_0x5a0be7,_0xee8460){return db[_0xcec8('0x4a')][_0xcec8('0x53')]({'where':{'id':_0x1b00be['params']['id']}})[_0xcec8('0x30')](handleEntityNotFound(_0x5a0be7,null))[_0xcec8('0x30')](function(_0x5b2456){if(_0x5b2456){return _0x5b2456[_0xcec8('0x89')](_0x1b00be[_0xcec8('0x39')][_0xcec8('0x69')])['then'](function(){if(_[_0xcec8('0x8c')](_0x1b00be['query']['ids'])){for(var _0x3e97b7=0x0;_0x3e97b7<_0x1b00be[_0xcec8('0x39')][_0xcec8('0x69')][_0xcec8('0x51')];_0x3e97b7+=0x1){socket[_0xcec8('0x72')](_0xcec8('0x8a'),{'UserId':Number(_0x1b00be[_0xcec8('0x39')][_0xcec8('0x69')][_0x3e97b7]),'FaxQueueId':Number(_0x1b00be[_0xcec8('0x4f')]['id'])});}}else{socket[_0xcec8('0x72')](_0xcec8('0x8a'),{'UserId':Number(_0x1b00be[_0xcec8('0x39')][_0xcec8('0x69')]),'FaxQueueId':Number(_0x1b00be['params']['id'])});}});}})[_0xcec8('0x30')](respondWithStatusCode(_0x5a0be7,null))[_0xcec8('0x4d')](handleError(_0x5a0be7,null));};exports['getAgents']=function(_0x532815,_0x1ec35f,_0x5dfdd0){var _0x19d713={};var _0x54220d={};var _0x2f3d06;var _0x22fce2;return db[_0xcec8('0x4a')]['findOne']({'where':{'id':_0x532815[_0xcec8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1ec35f,null))[_0xcec8('0x30')](function(_0x2e0687){if(_0x2e0687){_0x2f3d06=_0x2e0687;_0x54220d['model']=_[_0xcec8('0x3a')](db['User'][_0xcec8('0x50')]);_0x54220d[_0xcec8('0x39')]=_[_0xcec8('0x3a')](_0x532815['query']);_0x54220d[_0xcec8('0x3b')]=_[_0xcec8('0x3c')](_0x54220d[_0xcec8('0x3e')],_0x54220d['query']);_0x19d713[_0xcec8('0x3d')]=_[_0xcec8('0x3c')](_0x54220d[_0xcec8('0x3e')],qs[_0xcec8('0x3f')](_0x532815[_0xcec8('0x39')][_0xcec8('0x3f')]));_0x19d713['attributes']=_0x19d713[_0xcec8('0x3d')][_0xcec8('0x51')]?_0x19d713[_0xcec8('0x3d')]:_0x54220d['model'];_0x19d713['order']=qs[_0xcec8('0x42')](_0x532815[_0xcec8('0x39')][_0xcec8('0x42')]);_0x19d713[_0xcec8('0x43')]=qs[_0xcec8('0x3b')](_[_0xcec8('0x60')](_0x532815[_0xcec8('0x39')],_0x54220d[_0xcec8('0x3b')]));if(_0x532815['query'][_0xcec8('0x44')]){_0x19d713[_0xcec8('0x43')]=_[_0xcec8('0x45')](_0x19d713[_0xcec8('0x43')],{'$or':_[_0xcec8('0x37')](_0x19d713[_0xcec8('0x3d')],function(_0x43ad73){var _0x5e54fc={};_0x5e54fc[_0x43ad73]={'$like':'%'+_0x532815[_0xcec8('0x39')]['filter']+'%'};return _0x5e54fc;})});}_0x19d713=_[_0xcec8('0x45')]({},_0x19d713,_0x532815['options']);return _0x2f3d06['getAgents'](_0x19d713);}})[_0xcec8('0x30')](function(_0x552c47){if(_0x552c47){_0x22fce2=_0x552c47['length'];if(!_0x532815['query'][_0xcec8('0x40')]('nolimit')){_0x19d713[_0xcec8('0x24')]=qs[_0xcec8('0x24')](_0x532815[_0xcec8('0x39')][_0xcec8('0x24')]);_0x19d713[_0xcec8('0x27')]=qs[_0xcec8('0x27')](_0x532815[_0xcec8('0x39')]['offset']);}return _0x2f3d06[_0xcec8('0x8d')](_0x19d713);}})[_0xcec8('0x30')](function(_0x3b771d){if(_0x3b771d){return _0x3b771d?{'count':_0x22fce2,'rows':_0x3b771d}:null;}})[_0xcec8('0x30')](respondWithResult(_0x1ec35f,null))[_0xcec8('0x4d')](handleError(_0x1ec35f,null));}; \ No newline at end of file +var _0x5b2e=['findAndCountAll','UserId','faxPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','order','addTeams','ids','User','online','voicePause','interface','Agents','each','findOrCreate','forEach','emit','userFaxQueue:save','select','field','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','transaction','removeTeams','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','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','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','get','UserProfileResource','error','stack','name','send','FaxQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','length','find','body','role','user','FaxQueues','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserFaxQueue','FaxQueueId'];(function(_0x3bf860,_0x38cf27){var _0xbb2fc9=function(_0x5b5a5e){while(--_0x5b5a5e){_0x3bf860['push'](_0x3bf860['shift']());}};_0xbb2fc9(++_0x38cf27);}(_0x5b2e,0x1d8));var _0xe5b2=function(_0x2f7365,_0x43a8f1){_0x2f7365=_0x2f7365-0x0;var _0x11ea17=_0x5b2e[_0x2f7365];return _0x11ea17;};'use strict';var emlformat=require(_0xe5b2('0x0'));var rimraf=require(_0xe5b2('0x1'));var zipdir=require(_0xe5b2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe5b2('0x3'));var moment=require(_0xe5b2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe5b2('0x5'));var util=require(_0xe5b2('0x6'));var path=require(_0xe5b2('0x7'));var sox=require(_0xe5b2('0x8'));var csv=require(_0xe5b2('0x9'));var ejs=require(_0xe5b2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe5b2('0xb'));var squel=require(_0xe5b2('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe5b2('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe5b2('0xe'));var Papa=require(_0xe5b2('0xf'));var Redis=require('ioredis');var authService=require(_0xe5b2('0x10'));var qs=require(_0xe5b2('0x11'));var as=require(_0xe5b2('0x12'));var hardwareService=require(_0xe5b2('0x13'));var logger=require(_0xe5b2('0x14'))(_0xe5b2('0x15'));var utils=require(_0xe5b2('0x16'));var config=require(_0xe5b2('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe5b2('0x18'))['db'];config[_0xe5b2('0x19')]=_[_0xe5b2('0x1a')](config['redis'],{'host':_0xe5b2('0x1b'),'port':0x18eb});var socket=require(_0xe5b2('0x1c'))(new Redis(config[_0xe5b2('0x19')]));require('./faxQueue.socket')[_0xe5b2('0x1d')](socket);function respondWithStatusCode(_0x1963e4,_0x661f3f){_0x661f3f=_0x661f3f||0xcc;return function(_0x385410){if(_0x385410){return _0x1963e4[_0xe5b2('0x1e')](_0x661f3f);}return _0x1963e4[_0xe5b2('0x1f')](_0x661f3f)[_0xe5b2('0x20')]();};}function respondWithResult(_0x3785b2,_0xd934a7){_0xd934a7=_0xd934a7||0xc8;return function(_0x32e98f){if(_0x32e98f){return _0x3785b2[_0xe5b2('0x1f')](_0xd934a7)[_0xe5b2('0x21')](_0x32e98f);}};}function respondWithFilteredResult(_0x478c65,_0x4d37ec){return function(_0x46ab94){if(_0x46ab94){var _0xffb3cf=typeof _0x4d37ec[_0xe5b2('0x22')]===_0xe5b2('0x23')&&typeof _0x4d37ec[_0xe5b2('0x24')]===_0xe5b2('0x23');var _0x3f57aa=_0x46ab94[_0xe5b2('0x25')];var _0xf3795=_0xffb3cf?0x0:_0x4d37ec[_0xe5b2('0x22')];var _0x25c88d=_0xffb3cf?_0x46ab94[_0xe5b2('0x25')]:_0x4d37ec[_0xe5b2('0x22')]+_0x4d37ec[_0xe5b2('0x24')];var _0x727f6a;if(_0x25c88d>=_0x3f57aa){_0x25c88d=_0x3f57aa;_0x727f6a=0xc8;}else{_0x727f6a=0xce;}_0x478c65[_0xe5b2('0x1f')](_0x727f6a);return _0x478c65[_0xe5b2('0x26')](_0xe5b2('0x27'),_0xf3795+'-'+_0x25c88d+'/'+_0x3f57aa)[_0xe5b2('0x21')](_0x46ab94);}return null;};}function patchUpdates(_0x67d773){return function(_0x3433bf){try{jsonpatch[_0xe5b2('0x28')](_0x3433bf,_0x67d773,!![]);}catch(_0x228b7d){return BPromise[_0xe5b2('0x29')](_0x228b7d);}return _0x3433bf['save']();};}function saveUpdates(_0x23f7e0,_0x597146){return function(_0x19db3e){if(_0x19db3e){return _0x19db3e['update'](_0x23f7e0)[_0xe5b2('0x2a')](function(_0x3d8167){return _0x3d8167;});}return null;};}function removeEntity(_0x55995f,_0x314b36){return function(_0x28b6d4){if(_0x28b6d4){return _0x28b6d4[_0xe5b2('0x2b')]()['then'](function(){var _0x4532f6=_0x28b6d4[_0xe5b2('0x2c')]({'plain':!![]});var _0x573d36='FaxQueues';return db[_0xe5b2('0x2d')][_0xe5b2('0x2b')]({'where':{'type':_0x573d36,'resourceId':_0x4532f6['id']}})[_0xe5b2('0x2a')](function(){return _0x28b6d4;});})[_0xe5b2('0x2a')](function(){_0x55995f[_0xe5b2('0x1f')](0xcc)[_0xe5b2('0x20')]();});}};}function handleEntityNotFound(_0x1a598c,_0x5c9b8d){return function(_0x1bae8f){if(!_0x1bae8f){_0x1a598c[_0xe5b2('0x1e')](0x194);}return _0x1bae8f;};}function handleError(_0x3b4f18,_0x5728de){_0x5728de=_0x5728de||0x1f4;return function(_0x160217){logger[_0xe5b2('0x2e')](_0x160217[_0xe5b2('0x2f')]);if(_0x160217[_0xe5b2('0x30')]){delete _0x160217[_0xe5b2('0x30')];}_0x3b4f18[_0xe5b2('0x1f')](_0x5728de)[_0xe5b2('0x31')](_0x160217);};}exports['index']=function(_0x354150,_0x4b7d62){var _0x392a70={},_0x4bc5b8={},_0x2da275={'count':0x0,'rows':[]};var _0x109ffb=_['map'](db[_0xe5b2('0x32')][_0xe5b2('0x33')],function(_0x2b3d06){return{'name':_0x2b3d06[_0xe5b2('0x34')],'type':_0x2b3d06['type'][_0xe5b2('0x35')]};});_0x4bc5b8[_0xe5b2('0x36')]=_['map'](_0x109ffb,_0xe5b2('0x30'));_0x4bc5b8[_0xe5b2('0x37')]=_[_0xe5b2('0x38')](_0x354150['query']);_0x4bc5b8[_0xe5b2('0x39')]=_[_0xe5b2('0x3a')](_0x4bc5b8[_0xe5b2('0x36')],_0x4bc5b8['query']);_0x392a70[_0xe5b2('0x3b')]=_['intersection'](_0x4bc5b8[_0xe5b2('0x36')],qs['fields'](_0x354150[_0xe5b2('0x37')]['fields']));_0x392a70[_0xe5b2('0x3b')]=_0x392a70[_0xe5b2('0x3b')]['length']?_0x392a70['attributes']:_0x4bc5b8['model'];if(!_0x354150['query'][_0xe5b2('0x3c')](_0xe5b2('0x3d'))){_0x392a70['limit']=qs[_0xe5b2('0x24')](_0x354150[_0xe5b2('0x37')]['limit']);_0x392a70[_0xe5b2('0x22')]=qs[_0xe5b2('0x22')](_0x354150[_0xe5b2('0x37')][_0xe5b2('0x22')]);}_0x392a70['order']=qs[_0xe5b2('0x3e')](_0x354150[_0xe5b2('0x37')][_0xe5b2('0x3e')]);_0x392a70[_0xe5b2('0x3f')]=qs[_0xe5b2('0x39')](_[_0xe5b2('0x40')](_0x354150[_0xe5b2('0x37')],_0x4bc5b8[_0xe5b2('0x39')]),_0x109ffb);if(_0x354150[_0xe5b2('0x37')][_0xe5b2('0x41')]){_0x392a70[_0xe5b2('0x3f')]=_[_0xe5b2('0x42')](_0x392a70[_0xe5b2('0x3f')],{'$or':_[_0xe5b2('0x43')](_0x109ffb,function(_0x4aa480){if(_0x4aa480['type']!==_0xe5b2('0x44')){var _0x407c80={};_0x407c80[_0x4aa480['name']]={'$like':'%'+_0x354150[_0xe5b2('0x37')]['filter']+'%'};return _0x407c80;}})});}_0x392a70=_[_0xe5b2('0x42')]({},_0x392a70,_0x354150[_0xe5b2('0x45')]);var _0x5d702b={'where':_0x392a70[_0xe5b2('0x3f')]};return db[_0xe5b2('0x32')][_0xe5b2('0x25')](_0x5d702b)['then'](function(_0x3a96fc){_0x2da275[_0xe5b2('0x25')]=_0x3a96fc;if(_0x354150[_0xe5b2('0x37')][_0xe5b2('0x46')]){_0x392a70[_0xe5b2('0x47')]=[{'all':!![]}];}return db[_0xe5b2('0x32')][_0xe5b2('0x48')](_0x392a70);})[_0xe5b2('0x2a')](function(_0x39ef00){_0x2da275[_0xe5b2('0x49')]=_0x39ef00;return _0x2da275;})['then'](respondWithFilteredResult(_0x4b7d62,_0x392a70))[_0xe5b2('0x4a')](handleError(_0x4b7d62,null));};exports[_0xe5b2('0x4b')]=function(_0x39a1c6,_0x1f5659){var _0x5c2df6={'raw':!![],'where':{'id':_0x39a1c6[_0xe5b2('0x4c')]['id']}},_0x3c2e41={};_0x3c2e41[_0xe5b2('0x36')]=_[_0xe5b2('0x38')](db[_0xe5b2('0x32')]['rawAttributes']);_0x3c2e41[_0xe5b2('0x37')]=_[_0xe5b2('0x38')](_0x39a1c6['query']);_0x3c2e41['filters']=_[_0xe5b2('0x3a')](_0x3c2e41['model'],_0x3c2e41[_0xe5b2('0x37')]);_0x5c2df6[_0xe5b2('0x3b')]=_[_0xe5b2('0x3a')](_0x3c2e41[_0xe5b2('0x36')],qs['fields'](_0x39a1c6[_0xe5b2('0x37')][_0xe5b2('0x4d')]));_0x5c2df6[_0xe5b2('0x3b')]=_0x5c2df6[_0xe5b2('0x3b')][_0xe5b2('0x4e')]?_0x5c2df6['attributes']:_0x3c2e41['model'];if(_0x39a1c6['query'][_0xe5b2('0x46')]){_0x5c2df6['include']=[{'all':!![]}];}_0x5c2df6=_[_0xe5b2('0x42')]({},_0x5c2df6,_0x39a1c6[_0xe5b2('0x45')]);return db['FaxQueue'][_0xe5b2('0x4f')](_0x5c2df6)[_0xe5b2('0x2a')](handleEntityNotFound(_0x1f5659,null))[_0xe5b2('0x2a')](respondWithResult(_0x1f5659,null))['catch'](handleError(_0x1f5659,null));};exports['create']=function(_0x1c97d9,_0x133afd){return db[_0xe5b2('0x32')]['create'](_0x1c97d9[_0xe5b2('0x50')],{})[_0xe5b2('0x2a')](function(_0x2a532d){var _0x533e28=_0x1c97d9['user'][_0xe5b2('0x2c')]({'plain':!![]});if(!_0x533e28)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x533e28[_0xe5b2('0x51')]===_0xe5b2('0x52')){var _0x41c4af=_0x2a532d[_0xe5b2('0x2c')]({'plain':!![]});var _0x1d9e09=_0xe5b2('0x53');return db['UserProfileSection'][_0xe5b2('0x4f')]({'where':{'name':_0x1d9e09,'userProfileId':_0x533e28['userProfileId']},'raw':!![]})[_0xe5b2('0x2a')](function(_0x3c1b23){if(_0x3c1b23&&_0x3c1b23[_0xe5b2('0x54')]===0x0){return db[_0xe5b2('0x2d')][_0xe5b2('0x55')]({'name':_0x41c4af['name'],'resourceId':_0x41c4af['id'],'type':_0x3c1b23[_0xe5b2('0x30')],'sectionId':_0x3c1b23['id']},{})['then'](function(){return _0x2a532d;});}else{return _0x2a532d;}})[_0xe5b2('0x4a')](function(_0x1339f0){logger[_0xe5b2('0x2e')](_0xe5b2('0x56'),_0x1339f0);throw _0x1339f0;});}return _0x2a532d;})[_0xe5b2('0x2a')](respondWithResult(_0x133afd,0xc9))[_0xe5b2('0x4a')](handleError(_0x133afd,null));};exports[_0xe5b2('0x57')]=function(_0x521ee8,_0x595a6c){if(_0x521ee8[_0xe5b2('0x50')]['id']){delete _0x521ee8[_0xe5b2('0x50')]['id'];}return db['FaxQueue'][_0xe5b2('0x4f')]({'where':{'id':_0x521ee8[_0xe5b2('0x4c')]['id']}})[_0xe5b2('0x2a')](handleEntityNotFound(_0x595a6c,null))[_0xe5b2('0x2a')](saveUpdates(_0x521ee8[_0xe5b2('0x50')],null))[_0xe5b2('0x2a')](respondWithResult(_0x595a6c,null))['catch'](handleError(_0x595a6c,null));};exports[_0xe5b2('0x2b')]=function(_0x5d8c38,_0x219a8f){return db[_0xe5b2('0x32')][_0xe5b2('0x4f')]({'where':{'id':_0x5d8c38[_0xe5b2('0x4c')]['id']}})[_0xe5b2('0x2a')](handleEntityNotFound(_0x219a8f,null))[_0xe5b2('0x2a')](removeEntity(_0x219a8f,null))[_0xe5b2('0x4a')](handleError(_0x219a8f,null));};exports[_0xe5b2('0x58')]=function(_0x5010c4,_0x1c46d4){return db[_0xe5b2('0x32')][_0xe5b2('0x58')]()[_0xe5b2('0x2a')](respondWithResult(_0x1c46d4,null))['catch'](handleError(_0x1c46d4,null));};exports['getMembers']=function(_0x2d2a07,_0x20d4df,_0x2b997e){var _0x14be2a={'raw':!![],'where':{}},_0x414fd9={},_0x57cf4b;return db['FaxQueue'][_0xe5b2('0x59')]({'where':{'id':_0x2d2a07[_0xe5b2('0x4c')]['id']}})[_0xe5b2('0x2a')](handleEntityNotFound(_0x20d4df,null))[_0xe5b2('0x2a')](function(_0x40e470){if(_0x40e470){_0x57cf4b=_0x40e470['get']({'plain':!![]});_0x414fd9[_0xe5b2('0x36')]=_['keys'](db[_0xe5b2('0x5a')][_0xe5b2('0x33')]);_0x414fd9['query']=_[_0xe5b2('0x38')](_0x2d2a07[_0xe5b2('0x37')]);_0x414fd9[_0xe5b2('0x39')]=_['intersection'](_0x414fd9['model'],_0x414fd9['query']);_0x14be2a[_0xe5b2('0x3b')]=_[_0xe5b2('0x3a')](_0x414fd9['model'],qs[_0xe5b2('0x4d')](_0x2d2a07[_0xe5b2('0x37')][_0xe5b2('0x4d')]));_0x14be2a['attributes']=_0x14be2a[_0xe5b2('0x3b')]['length']?_0x14be2a[_0xe5b2('0x3b')]:_0x414fd9[_0xe5b2('0x36')];if(!_0x2d2a07[_0xe5b2('0x37')][_0xe5b2('0x3c')](_0xe5b2('0x3d'))){_0x14be2a[_0xe5b2('0x24')]=qs[_0xe5b2('0x24')](_0x2d2a07[_0xe5b2('0x37')]['limit']);_0x14be2a['offset']=qs[_0xe5b2('0x22')](_0x2d2a07[_0xe5b2('0x37')][_0xe5b2('0x22')]);}_0x14be2a['order']=qs[_0xe5b2('0x3e')](_0x2d2a07[_0xe5b2('0x37')][_0xe5b2('0x3e')]);_0x14be2a['where']=qs[_0xe5b2('0x39')](_[_0xe5b2('0x40')](_0x2d2a07[_0xe5b2('0x37')],_0x414fd9[_0xe5b2('0x39')]));_0x14be2a[_0xe5b2('0x3f')][_0xe5b2('0x5b')]=_0x40e470['id'];if(_0x2d2a07[_0xe5b2('0x37')]['filter']){_0x14be2a[_0xe5b2('0x3f')]=_[_0xe5b2('0x42')](_0x14be2a[_0xe5b2('0x3f')],{'$or':_['map'](_0x14be2a[_0xe5b2('0x3b')],function(_0x297abf){var _0x37de56={};_0x37de56[_0x297abf]={'$like':'%'+_0x2d2a07['query'][_0xe5b2('0x41')]+'%'};return _0x37de56;})});}_0x14be2a=_[_0xe5b2('0x42')]({},_0x14be2a,_0x2d2a07[_0xe5b2('0x45')]);return db['UserFaxQueue'][_0xe5b2('0x48')](_0x14be2a);}})[_0xe5b2('0x2a')](function(_0x49103f){if(_0x49103f){return db['User'][_0xe5b2('0x5c')]({'where':{'id':_[_0xe5b2('0x43')](_0x49103f,_0xe5b2('0x5d')),'role':'agent'},'attributes':['id',_0xe5b2('0x30'),_0xe5b2('0x5e'),_0xe5b2('0x5f'),_0xe5b2('0x60')]});}})[_0xe5b2('0x2a')](function(_0x291c7d){if(_0x291c7d){return{'count':_0x291c7d[_0xe5b2('0x25')],'rows':_[_0xe5b2('0x43')](_0x291c7d[_0xe5b2('0x49')],function(_0x5e5047){return{'membername':_0x5e5047[_0xe5b2('0x30')],'UserId':_0x5e5047['id'],'queue_name':_0x57cf4b[_0xe5b2('0x30')],'FaxQueueId':_0x57cf4b['id'],'interface':util[_0xe5b2('0x61')](_0xe5b2('0x62'),'SIP',_0x5e5047[_0xe5b2('0x30')]),'penalty':0x0,'paused':_0x5e5047[_0xe5b2('0x5e')],'createdAt':_0x5e5047[_0xe5b2('0x60')],'updatedAt':_0x5e5047[_0xe5b2('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe5b2('0x2a')](respondWithFilteredResult(_0x20d4df,_0x14be2a))[_0xe5b2('0x4a')](handleError(_0x20d4df,null));};exports[_0xe5b2('0x63')]=function(_0xdfdcaa,_0x504cb3,_0x469ff6){var _0xa39bbd={};var _0x4b0ed3={};var _0x562cba;var _0x2a4111;return db[_0xe5b2('0x32')][_0xe5b2('0x59')]({'where':{'id':_0xdfdcaa[_0xe5b2('0x4c')]['id']}})['then'](handleEntityNotFound(_0x504cb3,null))['then'](function(_0xc3af44){if(_0xc3af44){_0x562cba=_0xc3af44;_0x4b0ed3['model']=_[_0xe5b2('0x38')](db[_0xe5b2('0x64')][_0xe5b2('0x33')]);_0x4b0ed3[_0xe5b2('0x37')]=_[_0xe5b2('0x38')](_0xdfdcaa['query']);_0x4b0ed3[_0xe5b2('0x39')]=_[_0xe5b2('0x3a')](_0x4b0ed3[_0xe5b2('0x36')],_0x4b0ed3[_0xe5b2('0x37')]);_0xa39bbd[_0xe5b2('0x3b')]=_[_0xe5b2('0x3a')](_0x4b0ed3[_0xe5b2('0x36')],qs[_0xe5b2('0x4d')](_0xdfdcaa[_0xe5b2('0x37')][_0xe5b2('0x4d')]));_0xa39bbd[_0xe5b2('0x3b')]=_0xa39bbd[_0xe5b2('0x3b')][_0xe5b2('0x4e')]?_0xa39bbd['attributes']:_0x4b0ed3[_0xe5b2('0x36')];_0xa39bbd[_0xe5b2('0x65')]=qs[_0xe5b2('0x3e')](_0xdfdcaa[_0xe5b2('0x37')][_0xe5b2('0x3e')]);_0xa39bbd['where']=qs['filters'](_[_0xe5b2('0x40')](_0xdfdcaa[_0xe5b2('0x37')],_0x4b0ed3[_0xe5b2('0x39')]));if(_0xdfdcaa[_0xe5b2('0x37')]['filter']){_0xa39bbd[_0xe5b2('0x3f')]=_[_0xe5b2('0x42')](_0xa39bbd[_0xe5b2('0x3f')],{'$or':_[_0xe5b2('0x43')](_0xa39bbd['attributes'],function(_0x4da7b1){var _0x104cf8={};_0x104cf8[_0x4da7b1]={'$like':'%'+_0xdfdcaa[_0xe5b2('0x37')][_0xe5b2('0x41')]+'%'};return _0x104cf8;})});}_0xa39bbd=_['merge']({},_0xa39bbd,_0xdfdcaa[_0xe5b2('0x45')]);return _0x562cba[_0xe5b2('0x63')](_0xa39bbd);}})[_0xe5b2('0x2a')](function(_0x21aa43){if(_0x21aa43){_0x2a4111=_0x21aa43['length'];if(!_0xdfdcaa[_0xe5b2('0x37')][_0xe5b2('0x3c')](_0xe5b2('0x3d'))){_0xa39bbd[_0xe5b2('0x24')]=qs['limit'](_0xdfdcaa[_0xe5b2('0x37')][_0xe5b2('0x24')]);_0xa39bbd[_0xe5b2('0x22')]=qs['offset'](_0xdfdcaa[_0xe5b2('0x37')]['offset']);}return _0x562cba[_0xe5b2('0x63')](_0xa39bbd);}})[_0xe5b2('0x2a')](function(_0x5898d7){if(_0x5898d7){return _0x5898d7?{'count':_0x2a4111,'rows':_0x5898d7}:null;}})[_0xe5b2('0x2a')](respondWithResult(_0x504cb3,null))[_0xe5b2('0x4a')](handleError(_0x504cb3,null));};exports[_0xe5b2('0x66')]=function(_0x1e224e,_0x584ff8,_0x102b5e){var _0x104cb9=_0x1e224e['body'][_0xe5b2('0x67')];return db[_0xe5b2('0x64')]['findAll']({'where':{'id':_0x104cb9},'attributes':['id'],'include':[{'model':db[_0xe5b2('0x68')],'as':'Agents','attributes':['id',_0xe5b2('0x30'),_0xe5b2('0x69'),_0xe5b2('0x6a'),_0xe5b2('0x6b')],'raw':!![]}]})['then'](function(_0x49102f){if(_0x49102f){var _0x3ad019=_['flatMap'](_0x49102f,function(_0x1aced2){var _0x7bea43=_0x1aced2[_0xe5b2('0x2c')]({'plain':!![]});return _0x7bea43[_0xe5b2('0x6c')];});return db[_0xe5b2('0x32')][_0xe5b2('0x4f')]({'where':{'id':_0x1e224e[_0xe5b2('0x4c')]['id']}})['then'](function(_0xc36681){return db['sequelize']['transaction'](function(_0x2a141b){return _0xc36681[_0xe5b2('0x66')](_0x104cb9,{'transaction':_0x2a141b})['then'](function(){return BPromise[_0xe5b2('0x6d')](_0x3ad019,function(_0x59beb6){return db['UserFaxQueue'][_0xe5b2('0x6e')]({'where':{'UserId':_0x59beb6['id'],'FaxQueueId':_0x1e224e[_0xe5b2('0x4c')]['id']},'transaction':_0x2a141b});});})[_0xe5b2('0x2a')](function(){_0x3ad019[_0xe5b2('0x6f')](function(_0x27bf68){socket[_0xe5b2('0x70')](_0xe5b2('0x71'),{'UserId':_0x27bf68['id'],'FaxQueueId':_0xc36681['id']});});});});});}})[_0xe5b2('0x2a')](respondWithStatusCode(_0x584ff8,null))[_0xe5b2('0x4a')](handleError(_0x584ff8,null));};exports['removeTeams']=function(_0x28964e,_0x2cb465,_0x29b1dd){return db[_0xe5b2('0x64')]['findAll']({'where':{'id':_0x28964e[_0xe5b2('0x37')][_0xe5b2('0x67')]},'attributes':['id'],'include':[{'model':db[_0xe5b2('0x68')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xe5b2('0x2a')](handleEntityNotFound(_0x2cb465,null))[_0xe5b2('0x2a')](function(_0x590806){var _0x34333b=_[_0xe5b2('0x43')](_0x590806,'id');var _0x5b437e=[];var _0x22479a=[];var _0x5ae454=squel[_0xe5b2('0x72')]();_0x5ae454[_0xe5b2('0x73')]('tq.TeamId')['from'](_0xe5b2('0x74'),'tq')[_0xe5b2('0x75')](_0xe5b2('0x76'),'ut',_0xe5b2('0x77'))['where']('FaxQueueId\x20=\x20?',_0x28964e['params']['id']);for(var _0x218142=0x0;_0x218142<_0x590806[_0xe5b2('0x4e')];_0x218142+=0x1){let _0x3c221e=_0x590806[_0x218142];for(var _0x365aaf=0x0;_0x365aaf<_0x3c221e[_0xe5b2('0x6c')][_0xe5b2('0x4e')];_0x365aaf+=0x1){let _0x2ac38f=_0x3c221e['Agents'][_0x365aaf];var _0x4a2c84=_0x5ae454[_0xe5b2('0x78')]();_0x4a2c84[_0xe5b2('0x3f')](_0xe5b2('0x79'),_0x2ac38f['id']);_0x22479a['push'](db[_0xe5b2('0x7a')][_0xe5b2('0x37')](_0x4a2c84[_0xe5b2('0x7b')](),{'type':db[_0xe5b2('0x7a')][_0xe5b2('0x7c')][_0xe5b2('0x7d')]})['then'](function(_0x5bad5b){if(_0x5bad5b[_0xe5b2('0x4e')]===0x1){return _0x2ac38f['id'];}else{var _0x10e228=_[_0xe5b2('0x7e')](_[_0xe5b2('0x43')](_0x5bad5b,_0xe5b2('0x7f')),function(_0x3fadfc){return _[_0xe5b2('0x80')](_0x34333b,_0x3fadfc);});if(_0x10e228){return _0x2ac38f['id'];}}}));}}return BPromise['all'](_0x22479a)['then'](function(_0x13a46a){_0x5b437e=_(_0x5b437e)[_0xe5b2('0x81')](_0x13a46a)[_0xe5b2('0x82')]()[_0xe5b2('0x83')]();return db[_0xe5b2('0x32')][_0xe5b2('0x4f')]({'where':{'id':_0x28964e[_0xe5b2('0x4c')]['id']}})[_0xe5b2('0x2a')](function(_0x364314){return db[_0xe5b2('0x7a')][_0xe5b2('0x84')](function(_0xfe3ad8){return _0x364314[_0xe5b2('0x85')](_0x28964e[_0xe5b2('0x37')][_0xe5b2('0x67')],{'transaction':_0xfe3ad8})[_0xe5b2('0x2a')](function(){if(!_[_0xe5b2('0x86')](_0x5b437e)){return _0x364314[_0xe5b2('0x87')](_0x5b437e,{'transaction':_0xfe3ad8});}})[_0xe5b2('0x2a')](function(){_0x5b437e['forEach'](function(_0x2d0c14){socket[_0xe5b2('0x70')](_0xe5b2('0x88'),{'UserId':_0x2d0c14,'FaxQueueId':_0x364314['id']});});});});});});})['then'](respondWithStatusCode(_0x2cb465,null))['catch'](handleError(_0x2cb465,null));};exports[_0xe5b2('0x89')]=function(_0x234132,_0x2452ca,_0x59de68){return db['FaxQueue']['find']({'where':{'id':_0x234132['params']['id']}})['then'](handleEntityNotFound(_0x2452ca,null))[_0xe5b2('0x2a')](function(_0x7c327a){if(_0x7c327a){return _0x7c327a[_0xe5b2('0x89')](_0x234132['body'][_0xe5b2('0x67')],_[_0xe5b2('0x8a')](_0x234132[_0xe5b2('0x50')],[_0xe5b2('0x67'),'id'])||{})[_0xe5b2('0x8b')](function(_0x2e17ae){for(var _0x20995c=0x0;_0x20995c<_0x234132[_0xe5b2('0x50')][_0xe5b2('0x67')][_0xe5b2('0x4e')];_0x20995c+=0x1){socket[_0xe5b2('0x70')](_0xe5b2('0x71'),{'UserId':Number(_0x234132[_0xe5b2('0x50')][_0xe5b2('0x67')][_0x20995c]),'FaxQueueId':Number(_0x234132[_0xe5b2('0x4c')]['id'])});}return _0x2e17ae;});}})['then'](respondWithResult(_0x2452ca,null))[_0xe5b2('0x4a')](handleError(_0x2452ca,null));};exports['removeAgents']=function(_0x33e851,_0x442dd1,_0x95f41d){return db['FaxQueue'][_0xe5b2('0x4f')]({'where':{'id':_0x33e851['params']['id']}})[_0xe5b2('0x2a')](handleEntityNotFound(_0x442dd1,null))['then'](function(_0x220615){if(_0x220615){return _0x220615[_0xe5b2('0x87')](_0x33e851['query'][_0xe5b2('0x67')])[_0xe5b2('0x2a')](function(){if(_['isArray'](_0x33e851[_0xe5b2('0x37')][_0xe5b2('0x67')])){for(var _0xd1e551=0x0;_0xd1e551<_0x33e851['query'][_0xe5b2('0x67')][_0xe5b2('0x4e')];_0xd1e551+=0x1){socket[_0xe5b2('0x70')](_0xe5b2('0x88'),{'UserId':Number(_0x33e851['query'][_0xe5b2('0x67')][_0xd1e551]),'FaxQueueId':Number(_0x33e851[_0xe5b2('0x4c')]['id'])});}}else{socket[_0xe5b2('0x70')]('userFaxQueue:remove',{'UserId':Number(_0x33e851[_0xe5b2('0x37')]['ids']),'FaxQueueId':Number(_0x33e851[_0xe5b2('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0x442dd1,null))[_0xe5b2('0x4a')](handleError(_0x442dd1,null));};exports['getAgents']=function(_0x124836,_0x41c131,_0x2648dd){var _0x492d51={};var _0x46f7b3={};var _0x198520;var _0xb40e21;return db[_0xe5b2('0x32')]['findOne']({'where':{'id':_0x124836[_0xe5b2('0x4c')]['id']}})['then'](handleEntityNotFound(_0x41c131,null))['then'](function(_0x59012b){if(_0x59012b){_0x198520=_0x59012b;_0x46f7b3[_0xe5b2('0x36')]=_[_0xe5b2('0x38')](db[_0xe5b2('0x68')]['rawAttributes']);_0x46f7b3[_0xe5b2('0x37')]=_['keys'](_0x124836[_0xe5b2('0x37')]);_0x46f7b3[_0xe5b2('0x39')]=_[_0xe5b2('0x3a')](_0x46f7b3[_0xe5b2('0x36')],_0x46f7b3[_0xe5b2('0x37')]);_0x492d51[_0xe5b2('0x3b')]=_[_0xe5b2('0x3a')](_0x46f7b3[_0xe5b2('0x36')],qs[_0xe5b2('0x4d')](_0x124836[_0xe5b2('0x37')][_0xe5b2('0x4d')]));_0x492d51['attributes']=_0x492d51[_0xe5b2('0x3b')]['length']?_0x492d51[_0xe5b2('0x3b')]:_0x46f7b3['model'];_0x492d51[_0xe5b2('0x65')]=qs[_0xe5b2('0x3e')](_0x124836[_0xe5b2('0x37')]['sort']);_0x492d51[_0xe5b2('0x3f')]=qs[_0xe5b2('0x39')](_[_0xe5b2('0x40')](_0x124836[_0xe5b2('0x37')],_0x46f7b3['filters']));if(_0x124836['query'][_0xe5b2('0x41')]){_0x492d51[_0xe5b2('0x3f')]=_[_0xe5b2('0x42')](_0x492d51[_0xe5b2('0x3f')],{'$or':_['map'](_0x492d51[_0xe5b2('0x3b')],function(_0x45eaa7){var _0x4a57cf={};_0x4a57cf[_0x45eaa7]={'$like':'%'+_0x124836[_0xe5b2('0x37')][_0xe5b2('0x41')]+'%'};return _0x4a57cf;})});}_0x492d51=_[_0xe5b2('0x42')]({},_0x492d51,_0x124836[_0xe5b2('0x45')]);return _0x198520[_0xe5b2('0x8c')](_0x492d51);}})[_0xe5b2('0x2a')](function(_0x3e7d89){if(_0x3e7d89){_0xb40e21=_0x3e7d89['length'];if(!_0x124836[_0xe5b2('0x37')][_0xe5b2('0x3c')](_0xe5b2('0x3d'))){_0x492d51['limit']=qs[_0xe5b2('0x24')](_0x124836[_0xe5b2('0x37')][_0xe5b2('0x24')]);_0x492d51[_0xe5b2('0x22')]=qs[_0xe5b2('0x22')](_0x124836[_0xe5b2('0x37')][_0xe5b2('0x22')]);}return _0x198520[_0xe5b2('0x8c')](_0x492d51);}})[_0xe5b2('0x2a')](function(_0x2de797){if(_0x2de797){return _0x2de797?{'count':_0xb40e21,'rows':_0x2de797}:null;}})['then'](respondWithResult(_0x41c131,null))[_0xe5b2('0x4a')](handleError(_0x41c131,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 2f6a929..1abb6fe 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 _0x7f28=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update'];(function(_0x2e12c5,_0xc4fdc5){var _0x3018a0=function(_0x22ba03){while(--_0x22ba03){_0x2e12c5['push'](_0x2e12c5['shift']());}};_0x3018a0(++_0xc4fdc5);}(_0x7f28,0x7c));var _0x87f2=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7f28[_0x17d9e3];return _0x14192d;};'use strict';var EventEmitter=require(_0x87f2('0x0'));var FaxQueue=require('../../mysqldb')['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x87f2('0x1')](0x0);var events={'afterCreate':_0x87f2('0x2'),'afterUpdate':_0x87f2('0x3'),'afterDestroy':'remove'};function emitEvent(_0x205972){return function(_0x47ffbb,_0x7cd18a,_0x2a5278){FaxQueueEvents[_0x87f2('0x4')](_0x205972+':'+_0x47ffbb['id'],_0x47ffbb);FaxQueueEvents[_0x87f2('0x4')](_0x205972,_0x47ffbb);_0x2a5278(null);};}for(var e in events){if(events[_0x87f2('0x5')](e)){var event=events[e];FaxQueue[_0x87f2('0x6')](e,emitEvent(event));}}module[_0x87f2('0x7')]=FaxQueueEvents; \ No newline at end of file +var _0x81c1=['emit','hook','exports','FaxQueue','setMaxListeners','save'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0x81c1,0x81));var _0x181c=function(_0x146450,_0x35c73d){_0x146450=_0x146450-0x0;var _0xe41b7e=_0x81c1[_0x146450];return _0xe41b7e;};'use strict';var EventEmitter=require('events');var FaxQueue=require('../../mysqldb')['db'][_0x181c('0x0')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x181c('0x1')](0x0);var events={'afterCreate':_0x181c('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xe8712e){return function(_0x5670fc,_0x177334,_0x50d3a1){FaxQueueEvents['emit'](_0xe8712e+':'+_0x5670fc['id'],_0x5670fc);FaxQueueEvents[_0x181c('0x3')](_0xe8712e,_0x5670fc);_0x50d3a1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x181c('0x4')](e,emitEvent(event));}}module[_0x181c('0x5')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 9e7aba8..0764276 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 _0x44ad=['./faxQueue.attributes','exports','define','FaxQueue','fax_queues','util','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x30d256,_0x49e591){var _0x3c5af1=function(_0x212fbb){while(--_0x212fbb){_0x30d256['push'](_0x30d256['shift']());}};_0x3c5af1(++_0x49e591);}(_0x44ad,0x19c));var _0xd44a=function(_0x579173,_0x45987c){_0x579173=_0x579173-0x0;var _0x2e173d=_0x44ad[_0x579173];return _0x2e173d;};'use strict';var _=require('lodash');var util=require(_0xd44a('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xd44a('0x1'));var BPromise=require(_0xd44a('0x2'));var rp=require(_0xd44a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd44a('0x4'));var config=require(_0xd44a('0x5'));var attributes=require(_0xd44a('0x6'));module[_0xd44a('0x7')]=function(_0x170073,_0x5aa70b){return _0x170073[_0xd44a('0x8')](_0xd44a('0x9'),attributes,{'tableName':_0xd44a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f68=['moment','bluebird','request-promise','path','./faxQueue.attributes','FaxQueue','lodash','../../config/logger','api'];(function(_0x488608,_0x5279de){var _0xf6df77=function(_0x15e9d6){while(--_0x15e9d6){_0x488608['push'](_0x488608['shift']());}};_0xf6df77(++_0x5279de);}(_0x2f68,0x1c8));var _0x82f6=function(_0x10c26b,_0x156116){_0x10c26b=_0x10c26b-0x0;var _0xd350b7=_0x2f68[_0x10c26b];return _0xd350b7;};'use strict';var _=require(_0x82f6('0x0'));var util=require('util');var logger=require(_0x82f6('0x1'))(_0x82f6('0x2'));var moment=require(_0x82f6('0x3'));var BPromise=require(_0x82f6('0x4'));var rp=require(_0x82f6('0x5'));var fs=require('fs');var path=require(_0x82f6('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x82f6('0x7'));module['exports']=function(_0x48677b,_0x57b45e){return _0x48677b['define'](_0x82f6('0x8'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index e82c467..2bdbbb0 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 _0x391a=['error','message','info','result','catch','FaxQueue','findAll','raw','options','where','attributes','limit','include','map','model','then','GetFaxQueue','find','ShowFaxQueue','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','defaults','redis','localhost','./faxQueue.socket','register','request','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x22c53b,_0x2aff3e){var _0x14e447=function(_0x3114e4){while(--_0x3114e4){_0x22c53b['push'](_0x22c53b['shift']());}};_0x14e447(++_0x2aff3e);}(_0x391a,0xaf));var _0xa391=function(_0x352bf9,_0x4a8fa0){_0x352bf9=_0x352bf9-0x0;var _0x6cb1ba=_0x391a[_0x352bf9];return _0x6cb1ba;};'use strict';var _=require(_0xa391('0x0'));var util=require('util');var moment=require(_0xa391('0x1'));var BPromise=require(_0xa391('0x2'));var rs=require(_0xa391('0x3'));var fs=require('fs');var Redis=require(_0xa391('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa391('0x5'));var logger=require('../../config/logger')(_0xa391('0x6'));var config=require('../../config/environment');var jayson=require(_0xa391('0x7'));var client=jayson['client'][_0xa391('0x8')]({'port':0x232a});config['redis']=_[_0xa391('0x9')](config[_0xa391('0xa')],{'host':_0xa391('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa391('0xa')]));require(_0xa391('0xc'))[_0xa391('0xd')](socket);function respondWithRpcPromise(_0x445732,_0x1f0de1,_0x40d42f){return new BPromise(function(_0x79463d,_0x28f274){return client[_0xa391('0xe')](_0x445732,_0x40d42f)['then'](function(_0xa46216){logger['info'](_0xa391('0xf'),_0x1f0de1,_0xa391('0x10'));logger[_0xa391('0x11')](_0xa391('0x12'),_0x1f0de1,'request\x20sent',JSON[_0xa391('0x13')](_0xa46216));if(_0xa46216[_0xa391('0x14')]){if(_0xa46216[_0xa391('0x14')]['code']===0x1f4){logger[_0xa391('0x14')](_0xa391('0xf'),_0x1f0de1,_0xa46216[_0xa391('0x14')][_0xa391('0x15')]);return _0x28f274(_0xa46216[_0xa391('0x14')][_0xa391('0x15')]);}logger[_0xa391('0x14')](_0xa391('0xf'),_0x1f0de1,_0xa46216[_0xa391('0x14')][_0xa391('0x15')]);return _0x79463d(_0xa46216[_0xa391('0x14')][_0xa391('0x15')]);}else{logger[_0xa391('0x16')]('FaxQueue,\x20%s,\x20%s',_0x1f0de1,_0xa391('0x10'));_0x79463d(_0xa46216[_0xa391('0x17')][_0xa391('0x15')]);}})[_0xa391('0x18')](function(_0x3cedfe){logger[_0xa391('0x14')](_0xa391('0xf'),_0x1f0de1,_0x3cedfe);_0x28f274(_0x3cedfe);});});}exports['GetFaxQueue']=function(_0xbf72ed){var _0x56fccd=this;return new Promise(function(_0x57d464,_0x16f773){return db[_0xa391('0x19')][_0xa391('0x1a')]({'raw':_0xbf72ed['options']?_0xbf72ed['options'][_0xa391('0x1b')]===undefined?!![]:![]:!![],'where':_0xbf72ed['options']?_0xbf72ed[_0xa391('0x1c')][_0xa391('0x1d')]||null:null,'attributes':_0xbf72ed[_0xa391('0x1c')]?_0xbf72ed['options'][_0xa391('0x1e')]||null:null,'limit':_0xbf72ed[_0xa391('0x1c')]?_0xbf72ed['options'][_0xa391('0x1f')]||null:null,'include':_0xbf72ed[_0xa391('0x1c')]?_0xbf72ed[_0xa391('0x1c')][_0xa391('0x20')]?_[_0xa391('0x21')](_0xbf72ed[_0xa391('0x1c')][_0xa391('0x20')],function(_0x1665aa){return{'model':db[_0x1665aa[_0xa391('0x22')]],'as':_0x1665aa['as'],'attributes':_0x1665aa[_0xa391('0x1e')],'include':_0x1665aa[_0xa391('0x20')]?_[_0xa391('0x21')](_0x1665aa[_0xa391('0x20')],function(_0x543a19){return{'model':db[_0x543a19[_0xa391('0x22')]],'as':_0x543a19['as'],'attributes':_0x543a19[_0xa391('0x1e')],'include':_0x543a19[_0xa391('0x20')]?_[_0xa391('0x21')](_0x543a19[_0xa391('0x20')],function(_0x186d33){return{'model':db[_0x186d33[_0xa391('0x22')]],'as':_0x186d33['as'],'attributes':_0x186d33[_0xa391('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa391('0x23')](function(_0x1d195e){logger[_0xa391('0x16')](_0xa391('0x24'),_0xbf72ed);logger[_0xa391('0x11')](_0xa391('0x24'),_0xbf72ed,JSON[_0xa391('0x13')](_0x1d195e));_0x57d464(_0x1d195e);})[_0xa391('0x18')](function(_0x6bbcf1){logger[_0xa391('0x14')](_0xa391('0x24'),_0x6bbcf1[_0xa391('0x15')],_0xbf72ed);_0x16f773(_0x56fccd['error'](0x1f4,_0x6bbcf1[_0xa391('0x15')]));});});};exports['ShowFaxQueue']=function(_0x112915){var _0x44f12c=this;return new Promise(function(_0x2175c7,_0x343287){return db[_0xa391('0x19')][_0xa391('0x25')]({'raw':_0x112915[_0xa391('0x1c')]?_0x112915['options'][_0xa391('0x1b')]===undefined?!![]:![]:!![],'where':_0x112915[_0xa391('0x1c')]?_0x112915[_0xa391('0x1c')][_0xa391('0x1d')]||null:null,'attributes':_0x112915['options']?_0x112915['options'][_0xa391('0x1e')]||null:null,'include':_0x112915[_0xa391('0x1c')]?_0x112915[_0xa391('0x1c')]['include']?_[_0xa391('0x21')](_0x112915[_0xa391('0x1c')][_0xa391('0x20')],function(_0x332f23){return{'model':db[_0x332f23[_0xa391('0x22')]],'as':_0x332f23['as'],'attributes':_0x332f23[_0xa391('0x1e')],'include':_0x332f23[_0xa391('0x20')]?_['map'](_0x332f23['include'],function(_0x5250b5){return{'model':db[_0x5250b5[_0xa391('0x22')]],'as':_0x5250b5['as'],'attributes':_0x5250b5[_0xa391('0x1e')],'include':_0x5250b5[_0xa391('0x20')]?_['map'](_0x5250b5[_0xa391('0x20')],function(_0x319533){return{'model':db[_0x319533[_0xa391('0x22')]],'as':_0x319533['as'],'attributes':_0x319533[_0xa391('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa391('0x23')](function(_0x47dbf7){logger[_0xa391('0x16')]('ShowFaxQueue',_0x112915);logger[_0xa391('0x11')](_0xa391('0x26'),_0x112915,JSON[_0xa391('0x13')](_0x47dbf7));_0x2175c7(_0x47dbf7);})[_0xa391('0x18')](function(_0x3e5446){logger[_0xa391('0x14')](_0xa391('0x26'),_0x3e5446[_0xa391('0x15')],_0x112915);_0x343287(_0x44f12c[_0xa391('0x14')](0x1f4,_0x3e5446[_0xa391('0x15')]));});});}; \ No newline at end of file +var _0xd79c=['attributes','model','catch','ShowFaxQueue','FaxQueue','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','result','GetFaxQueue','findAll','options','raw','limit','map','include'];(function(_0x473306,_0x586c74){var _0x475fe2=function(_0x1510d6){while(--_0x1510d6){_0x473306['push'](_0x473306['shift']());}};_0x475fe2(++_0x586c74);}(_0xd79c,0xaa));var _0xcd79=function(_0x328262,_0x5f0adb){_0x328262=_0x328262-0x0;var _0x1343c9=_0xd79c[_0x328262];return _0x1343c9;};'use strict';var _=require(_0xcd79('0x0'));var util=require('util');var moment=require(_0xcd79('0x1'));var BPromise=require(_0xcd79('0x2'));var rs=require(_0xcd79('0x3'));var fs=require('fs');var Redis=require(_0xcd79('0x4'));var db=require(_0xcd79('0x5'))['db'];var utils=require(_0xcd79('0x6'));var logger=require('../../config/logger')(_0xcd79('0x7'));var config=require(_0xcd79('0x8'));var jayson=require(_0xcd79('0x9'));var client=jayson[_0xcd79('0xa')]['http']({'port':0x232a});config[_0xcd79('0xb')]=_[_0xcd79('0xc')](config[_0xcd79('0xb')],{'host':_0xcd79('0xd'),'port':0x18eb});var socket=require(_0xcd79('0xe'))(new Redis(config[_0xcd79('0xb')]));require(_0xcd79('0xf'))[_0xcd79('0x10')](socket);function respondWithRpcPromise(_0x340994,_0x4ec4ec,_0x3578dc){return new BPromise(function(_0x5da804,_0x12c006){return client[_0xcd79('0x11')](_0x340994,_0x3578dc)[_0xcd79('0x12')](function(_0x496541){logger[_0xcd79('0x13')]('FaxQueue,\x20%s,\x20%s',_0x4ec4ec,_0xcd79('0x14'));logger[_0xcd79('0x15')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x4ec4ec,_0xcd79('0x14'),JSON[_0xcd79('0x16')](_0x496541));if(_0x496541[_0xcd79('0x17')]){if(_0x496541[_0xcd79('0x17')][_0xcd79('0x18')]===0x1f4){logger[_0xcd79('0x17')](_0xcd79('0x19'),_0x4ec4ec,_0x496541[_0xcd79('0x17')]['message']);return _0x12c006(_0x496541['error'][_0xcd79('0x1a')]);}logger['error'](_0xcd79('0x19'),_0x4ec4ec,_0x496541[_0xcd79('0x17')][_0xcd79('0x1a')]);return _0x5da804(_0x496541[_0xcd79('0x17')][_0xcd79('0x1a')]);}else{logger[_0xcd79('0x13')](_0xcd79('0x19'),_0x4ec4ec,_0xcd79('0x14'));_0x5da804(_0x496541[_0xcd79('0x1b')]['message']);}})['catch'](function(_0x3015ee){logger[_0xcd79('0x17')](_0xcd79('0x19'),_0x4ec4ec,_0x3015ee);_0x12c006(_0x3015ee);});});}exports[_0xcd79('0x1c')]=function(_0x5219a3){var _0x1c8407=this;return new Promise(function(_0x31f0ab,_0x2e8763){return db['FaxQueue'][_0xcd79('0x1d')]({'raw':_0x5219a3[_0xcd79('0x1e')]?_0x5219a3[_0xcd79('0x1e')][_0xcd79('0x1f')]===undefined?!![]:![]:!![],'where':_0x5219a3[_0xcd79('0x1e')]?_0x5219a3['options']['where']||null:null,'attributes':_0x5219a3[_0xcd79('0x1e')]?_0x5219a3['options']['attributes']||null:null,'limit':_0x5219a3[_0xcd79('0x1e')]?_0x5219a3[_0xcd79('0x1e')][_0xcd79('0x20')]||null:null,'include':_0x5219a3[_0xcd79('0x1e')]?_0x5219a3['options']['include']?_[_0xcd79('0x21')](_0x5219a3['options'][_0xcd79('0x22')],function(_0x27a3e9){return{'model':db[_0x27a3e9['model']],'as':_0x27a3e9['as'],'attributes':_0x27a3e9[_0xcd79('0x23')],'include':_0x27a3e9[_0xcd79('0x22')]?_[_0xcd79('0x21')](_0x27a3e9['include'],function(_0x5bf25f){return{'model':db[_0x5bf25f['model']],'as':_0x5bf25f['as'],'attributes':_0x5bf25f[_0xcd79('0x23')],'include':_0x5bf25f[_0xcd79('0x22')]?_[_0xcd79('0x21')](_0x5bf25f[_0xcd79('0x22')],function(_0x4d360c){return{'model':db[_0x4d360c[_0xcd79('0x24')]],'as':_0x4d360c['as'],'attributes':_0x4d360c[_0xcd79('0x23')]};}):[]};}):[]};}):[]:[]})[_0xcd79('0x12')](function(_0x10e4a9){logger['info'](_0xcd79('0x1c'),_0x5219a3);logger[_0xcd79('0x15')]('GetFaxQueue',_0x5219a3,JSON['stringify'](_0x10e4a9));_0x31f0ab(_0x10e4a9);})[_0xcd79('0x25')](function(_0x1ea448){logger[_0xcd79('0x17')](_0xcd79('0x1c'),_0x1ea448[_0xcd79('0x1a')],_0x5219a3);_0x2e8763(_0x1c8407[_0xcd79('0x17')](0x1f4,_0x1ea448[_0xcd79('0x1a')]));});});};exports[_0xcd79('0x26')]=function(_0x2b772d){var _0x3faa0b=this;return new Promise(function(_0x2fb7e0,_0x4ee184){return db[_0xcd79('0x27')]['find']({'raw':_0x2b772d[_0xcd79('0x1e')]?_0x2b772d[_0xcd79('0x1e')][_0xcd79('0x1f')]===undefined?!![]:![]:!![],'where':_0x2b772d[_0xcd79('0x1e')]?_0x2b772d['options'][_0xcd79('0x28')]||null:null,'attributes':_0x2b772d[_0xcd79('0x1e')]?_0x2b772d[_0xcd79('0x1e')][_0xcd79('0x23')]||null:null,'include':_0x2b772d['options']?_0x2b772d[_0xcd79('0x1e')][_0xcd79('0x22')]?_[_0xcd79('0x21')](_0x2b772d['options'][_0xcd79('0x22')],function(_0x5fa3ca){return{'model':db[_0x5fa3ca['model']],'as':_0x5fa3ca['as'],'attributes':_0x5fa3ca['attributes'],'include':_0x5fa3ca['include']?_[_0xcd79('0x21')](_0x5fa3ca[_0xcd79('0x22')],function(_0x3a8459){return{'model':db[_0x3a8459[_0xcd79('0x24')]],'as':_0x3a8459['as'],'attributes':_0x3a8459[_0xcd79('0x23')],'include':_0x3a8459[_0xcd79('0x22')]?_[_0xcd79('0x21')](_0x3a8459[_0xcd79('0x22')],function(_0x19448a){return{'model':db[_0x19448a[_0xcd79('0x24')]],'as':_0x19448a['as'],'attributes':_0x19448a[_0xcd79('0x23')]};}):[]};}):[]};}):[]:[]})[_0xcd79('0x12')](function(_0x5ec096){logger[_0xcd79('0x13')](_0xcd79('0x26'),_0x2b772d);logger['debug'](_0xcd79('0x26'),_0x2b772d,JSON[_0xcd79('0x16')](_0x5ec096));_0x2fb7e0(_0x5ec096);})[_0xcd79('0x25')](function(_0x5ef6e5){logger[_0xcd79('0x17')](_0xcd79('0x26'),_0x5ef6e5[_0xcd79('0x1a')],_0x2b772d);_0x4ee184(_0x3faa0b[_0xcd79('0x17')](0x1f4,_0x5ef6e5['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 4c83aa2..4597c2e 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 _0x5379=['remove','emit','length','./faxQueue.events','save'];(function(_0x16c7b5,_0x5551d3){var _0x22e909=function(_0x556407){while(--_0x556407){_0x16c7b5['push'](_0x16c7b5['shift']());}};_0x22e909(++_0x5551d3);}(_0x5379,0x1a2));var _0x9537=function(_0x48ccfd,_0x490074){_0x48ccfd=_0x48ccfd-0x0;var _0x1da69c=_0x5379[_0x48ccfd];return _0x1da69c;};'use strict';var FaxQueueEvents=require(_0x9537('0x0'));var events=[_0x9537('0x1'),_0x9537('0x2'),'update'];function createListener(_0x2e1f6f,_0x5a0662){return function(_0x449248){_0x5a0662[_0x9537('0x3')](_0x2e1f6f,_0x449248);};}function removeListener(_0x2bc830,_0x35ff2c){return function(){FaxQueueEvents['removeListener'](_0x2bc830,_0x35ff2c);};}exports['register']=function(_0x3ee12d){for(var _0x5a62f0=0x0,_0x227ac6=events[_0x9537('0x4')];_0x5a62f0<_0x227ac6;_0x5a62f0++){var _0x379123=events[_0x5a62f0];var _0x2b7054=createListener('faxQueue:'+_0x379123,_0x3ee12d);FaxQueueEvents['on'](_0x379123,_0x2b7054);}}; \ No newline at end of file +var _0x0cc6=['length','./faxQueue.events','save','remove','update','emit','register'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0cc6,0x158));var _0x60cc=function(_0x3fe042,_0x1106f7){_0x3fe042=_0x3fe042-0x0;var _0x7d4a1f=_0x0cc6[_0x3fe042];return _0x7d4a1f;};'use strict';var FaxQueueEvents=require(_0x60cc('0x0'));var events=[_0x60cc('0x1'),_0x60cc('0x2'),_0x60cc('0x3')];function createListener(_0x356e6f,_0x4e1b80){return function(_0x2a5596){_0x4e1b80[_0x60cc('0x4')](_0x356e6f,_0x2a5596);};}function removeListener(_0x1fab7f,_0xd4beb2){return function(){FaxQueueEvents['removeListener'](_0x1fab7f,_0xd4beb2);};}exports[_0x60cc('0x5')]=function(_0x585eb6){for(var _0x279505=0x0,_0xf1ef53=events[_0x60cc('0x6')];_0x279505<_0xf1ef53;_0x279505++){var _0x3fc0be=events[_0x279505];var _0x22088b=createListener('faxQueue:'+_0x3fc0be,_0x585eb6);FaxQueueEvents['on'](_0x3fc0be,_0x22088b);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 004f473..98381c6 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 _0x2b29=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','put','delete','removeTeams','removeAgents','exports','util','path','connect-timeout','express','fs-extra'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x2b29,0x163));var _0x92b2=function(_0x369fed,_0x7fc2a8){_0x369fed=_0x369fed-0x0;var _0x22900b=_0x2b29[_0x369fed];return _0x22900b;};'use strict';var multer=require('multer');var util=require(_0x92b2('0x0'));var path=require(_0x92b2('0x1'));var timeout=require(_0x92b2('0x2'));var express=require(_0x92b2('0x3'));var router=express['Router']();var fs_extra=require(_0x92b2('0x4'));var auth=require(_0x92b2('0x5'));var interaction=require(_0x92b2('0x6'));var config=require(_0x92b2('0x7'));var controller=require(_0x92b2('0x8'));router[_0x92b2('0x9')]('/',auth['isAuthenticated'](),controller[_0x92b2('0xa')]);router['get'](_0x92b2('0xb'),auth[_0x92b2('0xc')](),controller['describe']);router[_0x92b2('0x9')](_0x92b2('0xd'),auth[_0x92b2('0xc')](),controller[_0x92b2('0xe')]);router['get'](_0x92b2('0xf'),auth[_0x92b2('0xc')](),controller[_0x92b2('0x10')]);router[_0x92b2('0x9')](_0x92b2('0x11'),auth[_0x92b2('0xc')](),controller[_0x92b2('0x12')]);router['get'](_0x92b2('0x13'),auth[_0x92b2('0xc')](),controller[_0x92b2('0x14')]);router['post']('/',auth[_0x92b2('0xc')](),controller[_0x92b2('0x15')]);router[_0x92b2('0x16')](_0x92b2('0x11'),auth[_0x92b2('0xc')](),controller[_0x92b2('0x17')]);router['post'](_0x92b2('0x13'),auth['isAuthenticated'](),controller[_0x92b2('0x18')]);router[_0x92b2('0x19')](_0x92b2('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x92b2('0x1a')]('/:id',auth[_0x92b2('0xc')](),controller['destroy']);router[_0x92b2('0x1a')](_0x92b2('0x11'),auth[_0x92b2('0xc')](),controller[_0x92b2('0x1b')]);router[_0x92b2('0x1a')](_0x92b2('0x13'),auth[_0x92b2('0xc')](),controller[_0x92b2('0x1c')]);module[_0x92b2('0x1d')]=router; \ No newline at end of file +var _0xdb28=['../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xdb28,0x106));var _0x8db2=function(_0x5901d7,_0x3fc79c){_0x5901d7=_0x5901d7-0x0;var _0x3ce4d0=_0xdb28[_0x5901d7];return _0x3ce4d0;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./faxQueue.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getTeams']);router[_0x8db2('0x9')](_0x8db2('0x12'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8db2('0x14')](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x15')]);router[_0x8db2('0x14')](_0x8db2('0x12'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);router[_0x8db2('0x17')](_0x8db2('0xd'),auth['isAuthenticated'](),controller[_0x8db2('0x18')]);router[_0x8db2('0x19')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1a')]);router[_0x8db2('0x19')](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x1b')]);router['delete']('/:id/users',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1c')]);module[_0x8db2('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 062f976..b5d481a 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 _0x4012=['STRING','DATE','moment','sequelize','exports'];(function(_0x10050e,_0x30c010){var _0x184628=function(_0x53a359){while(--_0x53a359){_0x10050e['push'](_0x10050e['shift']());}};_0x184628(++_0x30c010);}(_0x4012,0x16a));var _0x2401=function(_0x287c0f,_0x403ecb){_0x287c0f=_0x287c0f-0x0;var _0x1908b7=_0x4012[_0x287c0f];return _0x1908b7;};'use strict';var moment=require(_0x2401('0x0'));var Sequelize=require(_0x2401('0x1'));module[_0x2401('0x2')]={'uniqueid':{'type':Sequelize[_0x2401('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x2401('0x3')]},'joinAt':{'type':Sequelize[_0x2401('0x4')]},'leaveAt':{'type':Sequelize[_0x2401('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x2401('0x4')]},'reason':{'type':Sequelize[_0x2401('0x3')]}}; \ No newline at end of file +var _0x1a57=['moment','STRING','DATE'];(function(_0x105354,_0x40d7a3){var _0x1e4e89=function(_0x2596f4){while(--_0x2596f4){_0x105354['push'](_0x105354['shift']());}};_0x1e4e89(++_0x40d7a3);}(_0x1a57,0x117));var _0x71a5=function(_0x30ffc1,_0x556cd6){_0x30ffc1=_0x30ffc1-0x0;var _0x586b40=_0x1a57[_0x30ffc1];return _0x586b40;};'use strict';var moment=require(_0x71a5('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x71a5('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x71a5('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x71a5('0x2')]},'acceptAt':{'type':Sequelize[_0x71a5('0x2')]},'exitAt':{'type':Sequelize[_0x71a5('0x2')]},'reason':{'type':Sequelize[_0x71a5('0x1')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index a54fb36..4cf704d 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 _0xfdb5=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','catch','create','body','update','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','to-csv','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','count','offset','limit','set','apply','reject','save','then','sendStatus','stack','name','index','map','FaxQueueReport','fieldName','type','key'];(function(_0x54b9b8,_0x3ab342){var _0x444071=function(_0x2a33b2){while(--_0x2a33b2){_0x54b9b8['push'](_0x54b9b8['shift']());}};_0x444071(++_0x3ab342);}(_0xfdb5,0x12f));var _0x5fdb=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0xfdb5[_0x725b8e];return _0x43ac45;};'use strict';var emlformat=require(_0x5fdb('0x0'));var rimraf=require(_0x5fdb('0x1'));var zipdir=require(_0x5fdb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5fdb('0x3'));var moment=require(_0x5fdb('0x4'));var BPromise=require(_0x5fdb('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5fdb('0x6'));var sox=require('sox');var csv=require(_0x5fdb('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5fdb('0x8'));var _=require(_0x5fdb('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5fdb('0xa'));var toCsv=require(_0x5fdb('0x7'));var querystring=require(_0x5fdb('0xb'));var Papa=require(_0x5fdb('0xc'));var Redis=require(_0x5fdb('0xd'));var authService=require(_0x5fdb('0xe'));var qs=require(_0x5fdb('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5fdb('0x10'));var logger=require('../../config/logger')(_0x5fdb('0x11'));var utils=require(_0x5fdb('0x12'));var config=require(_0x5fdb('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5fdb('0x14'))['db'];function respondWithStatusCode(_0x573f40,_0x27433e){_0x27433e=_0x27433e||0xcc;return function(_0x368750){if(_0x368750){return _0x573f40['sendStatus'](_0x27433e);}return _0x573f40[_0x5fdb('0x15')](_0x27433e)[_0x5fdb('0x16')]();};}function respondWithResult(_0x3a2e29,_0x59f815){_0x59f815=_0x59f815||0xc8;return function(_0x3d15a2){if(_0x3d15a2){return _0x3a2e29[_0x5fdb('0x15')](_0x59f815)[_0x5fdb('0x17')](_0x3d15a2);}};}function respondWithFilteredResult(_0xaf6b0e,_0x40c32d){return function(_0x2d620c){if(_0x2d620c){var _0x58ae27=typeof _0x40c32d['offset']===_0x5fdb('0x18')&&typeof _0x40c32d['limit']===_0x5fdb('0x18');var _0x148223=_0x2d620c[_0x5fdb('0x19')];var _0x47a10f=_0x58ae27?0x0:_0x40c32d[_0x5fdb('0x1a')];var _0xb8c99f=_0x58ae27?_0x2d620c[_0x5fdb('0x19')]:_0x40c32d[_0x5fdb('0x1a')]+_0x40c32d[_0x5fdb('0x1b')];var _0x30d7d1;if(_0xb8c99f>=_0x148223){_0xb8c99f=_0x148223;_0x30d7d1=0xc8;}else{_0x30d7d1=0xce;}_0xaf6b0e['status'](_0x30d7d1);return _0xaf6b0e[_0x5fdb('0x1c')]('Content-Range',_0x47a10f+'-'+_0xb8c99f+'/'+_0x148223)['json'](_0x2d620c);}return null;};}function patchUpdates(_0x8937c){return function(_0x2ab3a4){try{jsonpatch[_0x5fdb('0x1d')](_0x2ab3a4,_0x8937c,!![]);}catch(_0x571802){return BPromise[_0x5fdb('0x1e')](_0x571802);}return _0x2ab3a4[_0x5fdb('0x1f')]();};}function saveUpdates(_0x47e13a,_0x3e755a){return function(_0x170ad5){if(_0x170ad5){return _0x170ad5['update'](_0x47e13a)['then'](function(_0x4dc591){return _0x4dc591;});}return null;};}function removeEntity(_0x56997a,_0x15d2ec){return function(_0x573132){if(_0x573132){return _0x573132['destroy']()[_0x5fdb('0x20')](function(){_0x56997a[_0x5fdb('0x15')](0xcc)[_0x5fdb('0x16')]();});}};}function handleEntityNotFound(_0x49e795,_0x3b47f5){return function(_0x848e51){if(!_0x848e51){_0x49e795[_0x5fdb('0x21')](0x194);}return _0x848e51;};}function handleError(_0x2b043b,_0x5893a9){_0x5893a9=_0x5893a9||0x1f4;return function(_0x200eaf){logger['error'](_0x200eaf[_0x5fdb('0x22')]);if(_0x200eaf[_0x5fdb('0x23')]){delete _0x200eaf['name'];}_0x2b043b[_0x5fdb('0x15')](_0x5893a9)['send'](_0x200eaf);};}exports[_0x5fdb('0x24')]=function(_0x474217,_0x5bd442){var _0x57e93a={},_0xa5c0e2={},_0x1ed46f={'count':0x0,'rows':[]};var _0x3fa447=_[_0x5fdb('0x25')](db[_0x5fdb('0x26')]['rawAttributes'],function(_0x5b20ec){return{'name':_0x5b20ec[_0x5fdb('0x27')],'type':_0x5b20ec[_0x5fdb('0x28')][_0x5fdb('0x29')]};});_0xa5c0e2[_0x5fdb('0x2a')]=_[_0x5fdb('0x25')](_0x3fa447,_0x5fdb('0x23'));_0xa5c0e2[_0x5fdb('0x2b')]=_[_0x5fdb('0x2c')](_0x474217[_0x5fdb('0x2b')]);_0xa5c0e2[_0x5fdb('0x2d')]=_[_0x5fdb('0x2e')](_0xa5c0e2[_0x5fdb('0x2a')],_0xa5c0e2[_0x5fdb('0x2b')]);_0x57e93a[_0x5fdb('0x2f')]=_[_0x5fdb('0x2e')](_0xa5c0e2['model'],qs[_0x5fdb('0x30')](_0x474217[_0x5fdb('0x2b')][_0x5fdb('0x30')]));_0x57e93a[_0x5fdb('0x2f')]=_0x57e93a[_0x5fdb('0x2f')][_0x5fdb('0x31')]?_0x57e93a[_0x5fdb('0x2f')]:_0xa5c0e2[_0x5fdb('0x2a')];if(!_0x474217[_0x5fdb('0x2b')][_0x5fdb('0x32')]('nolimit')){_0x57e93a[_0x5fdb('0x1b')]=qs[_0x5fdb('0x1b')](_0x474217[_0x5fdb('0x2b')][_0x5fdb('0x1b')]);_0x57e93a[_0x5fdb('0x1a')]=qs[_0x5fdb('0x1a')](_0x474217['query']['offset']);}_0x57e93a[_0x5fdb('0x33')]=qs[_0x5fdb('0x34')](_0x474217[_0x5fdb('0x2b')][_0x5fdb('0x34')]);_0x57e93a[_0x5fdb('0x35')]=qs[_0x5fdb('0x2d')](_[_0x5fdb('0x36')](_0x474217['query'],_0xa5c0e2[_0x5fdb('0x2d')]),_0x3fa447);if(_0x474217[_0x5fdb('0x2b')][_0x5fdb('0x37')]){_0x57e93a[_0x5fdb('0x35')]=_[_0x5fdb('0x38')](_0x57e93a[_0x5fdb('0x35')],{'$or':_[_0x5fdb('0x25')](_0x3fa447,function(_0x47dd08){if(_0x47dd08[_0x5fdb('0x28')]!=='VIRTUAL'){var _0x594619={};_0x594619[_0x47dd08['name']]={'$like':'%'+_0x474217[_0x5fdb('0x2b')]['filter']+'%'};return _0x594619;}})});}_0x57e93a=_[_0x5fdb('0x38')]({},_0x57e93a,_0x474217[_0x5fdb('0x39')]);var _0x460eea={'where':_0x57e93a[_0x5fdb('0x35')]};return db['FaxQueueReport'][_0x5fdb('0x19')](_0x460eea)['then'](function(_0x186ff6){_0x1ed46f['count']=_0x186ff6;if(_0x474217[_0x5fdb('0x2b')][_0x5fdb('0x3a')]){_0x57e93a[_0x5fdb('0x3b')]=[{'all':!![]}];}return db[_0x5fdb('0x26')][_0x5fdb('0x3c')](_0x57e93a);})['then'](function(_0x3614c4){_0x1ed46f[_0x5fdb('0x3d')]=_0x3614c4;return _0x1ed46f;})[_0x5fdb('0x20')](respondWithFilteredResult(_0x5bd442,_0x57e93a))['catch'](handleError(_0x5bd442,null));};exports['show']=function(_0x3c656c,_0x28c673){var _0x5379c4={'raw':!![],'where':{'id':_0x3c656c[_0x5fdb('0x3e')]['id']}},_0x1004b5={};_0x1004b5['model']=_['keys'](db['FaxQueueReport']['rawAttributes']);_0x1004b5[_0x5fdb('0x2b')]=_['keys'](_0x3c656c[_0x5fdb('0x2b')]);_0x1004b5[_0x5fdb('0x2d')]=_[_0x5fdb('0x2e')](_0x1004b5['model'],_0x1004b5[_0x5fdb('0x2b')]);_0x5379c4[_0x5fdb('0x2f')]=_[_0x5fdb('0x2e')](_0x1004b5['model'],qs[_0x5fdb('0x30')](_0x3c656c[_0x5fdb('0x2b')][_0x5fdb('0x30')]));_0x5379c4[_0x5fdb('0x2f')]=_0x5379c4[_0x5fdb('0x2f')][_0x5fdb('0x31')]?_0x5379c4['attributes']:_0x1004b5[_0x5fdb('0x2a')];if(_0x3c656c[_0x5fdb('0x2b')][_0x5fdb('0x3a')]){_0x5379c4[_0x5fdb('0x3b')]=[{'all':!![]}];}_0x5379c4=_['merge']({},_0x5379c4,_0x3c656c[_0x5fdb('0x39')]);return db[_0x5fdb('0x26')]['find'](_0x5379c4)[_0x5fdb('0x20')](handleEntityNotFound(_0x28c673,null))['then'](respondWithResult(_0x28c673,null))[_0x5fdb('0x3f')](handleError(_0x28c673,null));};exports[_0x5fdb('0x40')]=function(_0x1930c9,_0x267da0){return db[_0x5fdb('0x26')]['create'](_0x1930c9[_0x5fdb('0x41')],{})[_0x5fdb('0x20')](respondWithResult(_0x267da0,0xc9))[_0x5fdb('0x3f')](handleError(_0x267da0,null));};exports[_0x5fdb('0x42')]=function(_0x1ddfb0,_0x49d1fb){if(_0x1ddfb0[_0x5fdb('0x41')]['id']){delete _0x1ddfb0[_0x5fdb('0x41')]['id'];}return db[_0x5fdb('0x26')][_0x5fdb('0x43')]({'where':{'id':_0x1ddfb0[_0x5fdb('0x3e')]['id']}})[_0x5fdb('0x20')](handleEntityNotFound(_0x49d1fb,null))[_0x5fdb('0x20')](saveUpdates(_0x1ddfb0[_0x5fdb('0x41')],null))[_0x5fdb('0x20')](respondWithResult(_0x49d1fb,null))[_0x5fdb('0x3f')](handleError(_0x49d1fb,null));};exports['destroy']=function(_0x2bc366,_0x17060f){return db[_0x5fdb('0x26')][_0x5fdb('0x43')]({'where':{'id':_0x2bc366['params']['id']}})[_0x5fdb('0x20')](handleEntityNotFound(_0x17060f,null))[_0x5fdb('0x20')](removeEntity(_0x17060f,null))[_0x5fdb('0x3f')](handleError(_0x17060f,null));};exports[_0x5fdb('0x44')]=function(_0x3f91c9,_0x3db72a){return db['FaxQueueReport']['describe']()[_0x5fdb('0x20')](respondWithResult(_0x3db72a,null))[_0x5fdb('0x3f')](handleError(_0x3db72a,null));}; \ No newline at end of file +var _0xe0c0=['intersection','fields','length','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','show','keys','find','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','error','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','key','model','query'];(function(_0x2ef8ad,_0x1d81cd){var _0x4fec0a=function(_0x2a583d){while(--_0x2a583d){_0x2ef8ad['push'](_0x2ef8ad['shift']());}};_0x4fec0a(++_0x1d81cd);}(_0xe0c0,0xa7));var _0x0e0c=function(_0x4c196e,_0x1822bc){_0x4c196e=_0x4c196e-0x0;var _0xcd22da=_0xe0c0[_0x4c196e];return _0xcd22da;};'use strict';var emlformat=require(_0x0e0c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0e0c('0x1'));var jsonpatch=require(_0x0e0c('0x2'));var rp=require(_0x0e0c('0x3'));var moment=require(_0x0e0c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0e0c('0x5'));var util=require(_0x0e0c('0x6'));var path=require(_0x0e0c('0x7'));var sox=require('sox');var csv=require(_0x0e0c('0x8'));var ejs=require(_0x0e0c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0e0c('0xa'));var squel=require(_0x0e0c('0xb'));var crypto=require(_0x0e0c('0xc'));var jsforce=require(_0x0e0c('0xd'));var deskjs=require(_0x0e0c('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0e0c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x0e0c('0x10'));var as=require(_0x0e0c('0x11'));var hardwareService=require(_0x0e0c('0x12'));var logger=require(_0x0e0c('0x13'))(_0x0e0c('0x14'));var utils=require(_0x0e0c('0x15'));var config=require(_0x0e0c('0x16'));var licenseUtil=require(_0x0e0c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x246fd6,_0x5c31c7){_0x5c31c7=_0x5c31c7||0xcc;return function(_0x5794fa){if(_0x5794fa){return _0x246fd6[_0x0e0c('0x18')](_0x5c31c7);}return _0x246fd6[_0x0e0c('0x19')](_0x5c31c7)[_0x0e0c('0x1a')]();};}function respondWithResult(_0x305042,_0x1b598b){_0x1b598b=_0x1b598b||0xc8;return function(_0x19f315){if(_0x19f315){return _0x305042['status'](_0x1b598b)[_0x0e0c('0x1b')](_0x19f315);}};}function respondWithFilteredResult(_0x27cbcd,_0x3b6d65){return function(_0x4ebe33){if(_0x4ebe33){var _0x368ba0=typeof _0x3b6d65[_0x0e0c('0x1c')]===_0x0e0c('0x1d')&&typeof _0x3b6d65[_0x0e0c('0x1e')]===_0x0e0c('0x1d');var _0x2b0cb6=_0x4ebe33[_0x0e0c('0x1f')];var _0x18f3ef=_0x368ba0?0x0:_0x3b6d65[_0x0e0c('0x1c')];var _0x562f2c=_0x368ba0?_0x4ebe33[_0x0e0c('0x1f')]:_0x3b6d65['offset']+_0x3b6d65['limit'];var _0x5518b6;if(_0x562f2c>=_0x2b0cb6){_0x562f2c=_0x2b0cb6;_0x5518b6=0xc8;}else{_0x5518b6=0xce;}_0x27cbcd[_0x0e0c('0x19')](_0x5518b6);return _0x27cbcd[_0x0e0c('0x20')](_0x0e0c('0x21'),_0x18f3ef+'-'+_0x562f2c+'/'+_0x2b0cb6)[_0x0e0c('0x1b')](_0x4ebe33);}return null;};}function patchUpdates(_0x26ad69){return function(_0x3cc1cc){try{jsonpatch['apply'](_0x3cc1cc,_0x26ad69,!![]);}catch(_0x177ec6){return BPromise['reject'](_0x177ec6);}return _0x3cc1cc[_0x0e0c('0x22')]();};}function saveUpdates(_0x4419e9,_0x58fa02){return function(_0x2d01e5){if(_0x2d01e5){return _0x2d01e5[_0x0e0c('0x23')](_0x4419e9)['then'](function(_0x3346aa){return _0x3346aa;});}return null;};}function removeEntity(_0x29ee52,_0x315b35){return function(_0x29ff87){if(_0x29ff87){return _0x29ff87[_0x0e0c('0x24')]()[_0x0e0c('0x25')](function(){_0x29ee52[_0x0e0c('0x19')](0xcc)[_0x0e0c('0x1a')]();});}};}function handleEntityNotFound(_0x426bf1,_0x3ae1b4){return function(_0x5a7519){if(!_0x5a7519){_0x426bf1[_0x0e0c('0x18')](0x194);}return _0x5a7519;};}function handleError(_0x429f6f,_0x48a33a){_0x48a33a=_0x48a33a||0x1f4;return function(_0x59f3e8){logger[_0x0e0c('0x26')](_0x59f3e8['stack']);if(_0x59f3e8[_0x0e0c('0x27')]){delete _0x59f3e8[_0x0e0c('0x27')];}_0x429f6f[_0x0e0c('0x19')](_0x48a33a)[_0x0e0c('0x28')](_0x59f3e8);};}exports[_0x0e0c('0x29')]=function(_0x15bb5a,_0x252143){var _0x2d1444={},_0x2c9c82={},_0x433f56={'count':0x0,'rows':[]};var _0xe5f2c5=_[_0x0e0c('0x2a')](db[_0x0e0c('0x2b')][_0x0e0c('0x2c')],function(_0x2c7d33){return{'name':_0x2c7d33[_0x0e0c('0x2d')],'type':_0x2c7d33['type'][_0x0e0c('0x2e')]};});_0x2c9c82[_0x0e0c('0x2f')]=_[_0x0e0c('0x2a')](_0xe5f2c5,_0x0e0c('0x27'));_0x2c9c82[_0x0e0c('0x30')]=_['keys'](_0x15bb5a[_0x0e0c('0x30')]);_0x2c9c82['filters']=_[_0x0e0c('0x31')](_0x2c9c82[_0x0e0c('0x2f')],_0x2c9c82['query']);_0x2d1444['attributes']=_['intersection'](_0x2c9c82['model'],qs[_0x0e0c('0x32')](_0x15bb5a[_0x0e0c('0x30')][_0x0e0c('0x32')]));_0x2d1444['attributes']=_0x2d1444['attributes'][_0x0e0c('0x33')]?_0x2d1444[_0x0e0c('0x34')]:_0x2c9c82['model'];if(!_0x15bb5a['query'][_0x0e0c('0x35')]('nolimit')){_0x2d1444[_0x0e0c('0x1e')]=qs[_0x0e0c('0x1e')](_0x15bb5a[_0x0e0c('0x30')][_0x0e0c('0x1e')]);_0x2d1444[_0x0e0c('0x1c')]=qs[_0x0e0c('0x1c')](_0x15bb5a[_0x0e0c('0x30')]['offset']);}_0x2d1444[_0x0e0c('0x36')]=qs[_0x0e0c('0x37')](_0x15bb5a[_0x0e0c('0x30')][_0x0e0c('0x37')]);_0x2d1444[_0x0e0c('0x38')]=qs[_0x0e0c('0x39')](_[_0x0e0c('0x3a')](_0x15bb5a[_0x0e0c('0x30')],_0x2c9c82['filters']),_0xe5f2c5);if(_0x15bb5a['query'][_0x0e0c('0x3b')]){_0x2d1444[_0x0e0c('0x38')]=_[_0x0e0c('0x3c')](_0x2d1444[_0x0e0c('0x38')],{'$or':_['map'](_0xe5f2c5,function(_0x1553d9){if(_0x1553d9['type']!=='VIRTUAL'){var _0x31fa4e={};_0x31fa4e[_0x1553d9[_0x0e0c('0x27')]]={'$like':'%'+_0x15bb5a[_0x0e0c('0x30')][_0x0e0c('0x3b')]+'%'};return _0x31fa4e;}})});}_0x2d1444=_[_0x0e0c('0x3c')]({},_0x2d1444,_0x15bb5a[_0x0e0c('0x3d')]);var _0x2cc92a={'where':_0x2d1444[_0x0e0c('0x38')]};return db[_0x0e0c('0x2b')][_0x0e0c('0x1f')](_0x2cc92a)['then'](function(_0x533314){_0x433f56[_0x0e0c('0x1f')]=_0x533314;if(_0x15bb5a['query'][_0x0e0c('0x3e')]){_0x2d1444[_0x0e0c('0x3f')]=[{'all':!![]}];}return db[_0x0e0c('0x2b')][_0x0e0c('0x40')](_0x2d1444);})[_0x0e0c('0x25')](function(_0x182985){_0x433f56['rows']=_0x182985;return _0x433f56;})[_0x0e0c('0x25')](respondWithFilteredResult(_0x252143,_0x2d1444))[_0x0e0c('0x41')](handleError(_0x252143,null));};exports[_0x0e0c('0x42')]=function(_0x1b0ea9,_0x23e8c9){var _0x44ebbd={'raw':!![],'where':{'id':_0x1b0ea9['params']['id']}},_0x15124c={};_0x15124c['model']=_[_0x0e0c('0x43')](db['FaxQueueReport']['rawAttributes']);_0x15124c['query']=_[_0x0e0c('0x43')](_0x1b0ea9[_0x0e0c('0x30')]);_0x15124c[_0x0e0c('0x39')]=_[_0x0e0c('0x31')](_0x15124c[_0x0e0c('0x2f')],_0x15124c[_0x0e0c('0x30')]);_0x44ebbd[_0x0e0c('0x34')]=_[_0x0e0c('0x31')](_0x15124c[_0x0e0c('0x2f')],qs[_0x0e0c('0x32')](_0x1b0ea9[_0x0e0c('0x30')][_0x0e0c('0x32')]));_0x44ebbd['attributes']=_0x44ebbd[_0x0e0c('0x34')][_0x0e0c('0x33')]?_0x44ebbd[_0x0e0c('0x34')]:_0x15124c[_0x0e0c('0x2f')];if(_0x1b0ea9['query'][_0x0e0c('0x3e')]){_0x44ebbd[_0x0e0c('0x3f')]=[{'all':!![]}];}_0x44ebbd=_[_0x0e0c('0x3c')]({},_0x44ebbd,_0x1b0ea9[_0x0e0c('0x3d')]);return db[_0x0e0c('0x2b')][_0x0e0c('0x44')](_0x44ebbd)[_0x0e0c('0x25')](handleEntityNotFound(_0x23e8c9,null))[_0x0e0c('0x25')](respondWithResult(_0x23e8c9,null))[_0x0e0c('0x41')](handleError(_0x23e8c9,null));};exports['create']=function(_0x39cb27,_0xcabc6a){return db['FaxQueueReport']['create'](_0x39cb27[_0x0e0c('0x45')],{})[_0x0e0c('0x25')](respondWithResult(_0xcabc6a,0xc9))[_0x0e0c('0x41')](handleError(_0xcabc6a,null));};exports['update']=function(_0x29c971,_0x472c78){if(_0x29c971[_0x0e0c('0x45')]['id']){delete _0x29c971[_0x0e0c('0x45')]['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0x29c971[_0x0e0c('0x46')]['id']}})[_0x0e0c('0x25')](handleEntityNotFound(_0x472c78,null))[_0x0e0c('0x25')](saveUpdates(_0x29c971[_0x0e0c('0x45')],null))[_0x0e0c('0x25')](respondWithResult(_0x472c78,null))['catch'](handleError(_0x472c78,null));};exports['destroy']=function(_0x6e907c,_0x58a1c7){return db[_0x0e0c('0x2b')][_0x0e0c('0x44')]({'where':{'id':_0x6e907c[_0x0e0c('0x46')]['id']}})[_0x0e0c('0x25')](handleEntityNotFound(_0x58a1c7,null))['then'](removeEntity(_0x58a1c7,null))[_0x0e0c('0x41')](handleError(_0x58a1c7,null));};exports['describe']=function(_0x1ad56a,_0x21ec4d){return db[_0x0e0c('0x2b')][_0x0e0c('0x47')]()[_0x0e0c('0x25')](respondWithResult(_0x21ec4d,null))[_0x0e0c('0x41')](handleError(_0x21ec4d,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index e9f5f64..a5ad5c5 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 _0xc4aa=['bluebird','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','../../config/logger','api','moment'];(function(_0x38067c,_0x3b8bdc){var _0x482bda=function(_0x15c304){while(--_0x15c304){_0x38067c['push'](_0x38067c['shift']());}};_0x482bda(++_0x3b8bdc);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xc4aa[_0x11005e];return _0x29338f;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','util'];(function(_0x15dbca,_0x1d7c3c){var _0x326533=function(_0x507ee2){while(--_0x507ee2){_0x15dbca['push'](_0x15dbca['shift']());}};_0x326533(++_0x1d7c3c);}(_0x814b,0x1a2));var _0xb814=function(_0x405385,_0x56f573){_0x405385=_0x405385-0x0;var _0x43837b=_0x814b[_0x405385];return _0x43837b;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index eca4acd..11d4a3e 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 _0x78ea=['request\x20sent','stringify','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','options','raw','update','body','where','attributes','limit','UpdateFaxQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x316923,_0x435111){var _0x1ce888=function(_0x59e97e){while(--_0x59e97e){_0x316923['push'](_0x316923['shift']());}};_0x1ce888(++_0x435111);}(_0x78ea,0x184));var _0xa78e=function(_0x22f9bf,_0x1f00d7){_0x22f9bf=_0x22f9bf-0x0;var _0x5ed31a=_0x78ea[_0x22f9bf];return _0x5ed31a;};'use strict';var _=require(_0xa78e('0x0'));var util=require('util');var moment=require(_0xa78e('0x1'));var BPromise=require(_0xa78e('0x2'));var rs=require(_0xa78e('0x3'));var fs=require('fs');var Redis=require(_0xa78e('0x4'));var db=require(_0xa78e('0x5'))['db'];var utils=require(_0xa78e('0x6'));var logger=require(_0xa78e('0x7'))(_0xa78e('0x8'));var config=require(_0xa78e('0x9'));var jayson=require(_0xa78e('0xa'));var client=jayson[_0xa78e('0xb')][_0xa78e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2daf6c,_0x12239e,_0x124982){return new BPromise(function(_0x25d000,_0x5f43b3){return client[_0xa78e('0xd')](_0x2daf6c,_0x124982)[_0xa78e('0xe')](function(_0xf8194e){logger[_0xa78e('0xf')](_0xa78e('0x10'),_0x12239e,'request\x20sent');logger[_0xa78e('0x11')](_0xa78e('0x12'),_0x12239e,_0xa78e('0x13'),JSON[_0xa78e('0x14')](_0xf8194e));if(_0xf8194e[_0xa78e('0x15')]){if(_0xf8194e['error'][_0xa78e('0x16')]===0x1f4){logger[_0xa78e('0x15')](_0xa78e('0x10'),_0x12239e,_0xf8194e[_0xa78e('0x15')]['message']);return _0x5f43b3(_0xf8194e[_0xa78e('0x15')][_0xa78e('0x17')]);}logger[_0xa78e('0x15')](_0xa78e('0x10'),_0x12239e,_0xf8194e[_0xa78e('0x15')][_0xa78e('0x17')]);return _0x25d000(_0xf8194e[_0xa78e('0x15')]['message']);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x12239e,_0xa78e('0x13'));_0x25d000(_0xf8194e[_0xa78e('0x18')][_0xa78e('0x17')]);}})[_0xa78e('0x19')](function(_0x162c81){logger[_0xa78e('0x15')](_0xa78e('0x10'),_0x12239e,_0x162c81);_0x5f43b3(_0x162c81);});});}exports[_0xa78e('0x1a')]=function(_0x17902f){var _0x3703a3=this;return new Promise(function(_0x9859a9,_0x21309d){return db[_0xa78e('0x1b')][_0xa78e('0x1c')](_0x17902f['body'],{'raw':_0x17902f[_0xa78e('0x1d')]?_0x17902f[_0xa78e('0x1d')][_0xa78e('0x1e')]===undefined?!![]:![]:!![]})[_0xa78e('0xe')](function(_0x4fda1c){logger['info']('CreateFaxQueueReport',_0x17902f);logger[_0xa78e('0x11')](_0xa78e('0x1a'),_0x17902f,JSON[_0xa78e('0x14')](_0x4fda1c));_0x9859a9(_0x4fda1c);})[_0xa78e('0x19')](function(_0x2bd29d){logger[_0xa78e('0x15')](_0xa78e('0x1a'),_0x2bd29d[_0xa78e('0x17')],_0x17902f);_0x21309d(_0x3703a3['error'](0x1f4,_0x2bd29d[_0xa78e('0x17')]));});});};exports['UpdateFaxQueueReport']=function(_0x5becf4){var _0x3576c9=this;return new Promise(function(_0x13f227,_0x2cb245){return db[_0xa78e('0x1b')][_0xa78e('0x1f')](_0x5becf4[_0xa78e('0x20')],{'raw':_0x5becf4[_0xa78e('0x1d')]?_0x5becf4[_0xa78e('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5becf4[_0xa78e('0x1d')]?_0x5becf4['options'][_0xa78e('0x21')]||null:null,'attributes':_0x5becf4[_0xa78e('0x1d')]?_0x5becf4[_0xa78e('0x1d')][_0xa78e('0x22')]||null:null,'limit':_0x5becf4[_0xa78e('0x1d')]?_0x5becf4[_0xa78e('0x1d')][_0xa78e('0x23')]||null:null})['then'](function(_0x1d86d5){logger[_0xa78e('0xf')]('UpdateFaxQueueReport',_0x5becf4);logger['debug'](_0xa78e('0x24'),_0x5becf4,JSON[_0xa78e('0x14')](_0x1d86d5));_0x13f227(_0x1d86d5);})['catch'](function(_0xf7ec1d){logger[_0xa78e('0x15')](_0xa78e('0x24'),_0xf7ec1d[_0xa78e('0x17')],_0x5becf4);_0x2cb245(_0x3576c9[_0xa78e('0x15')](0x1f4,_0xf7ec1d[_0xa78e('0x17')]));});});}; \ No newline at end of file +var _0xac6d=['../../config/environment','jayson/promise','client','http','request','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateFaxQueueReport','body','options','then','debug','FaxQueueReport','update','where','attributes','limit','UpdateFaxQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x3dd834,_0x53ea52){var _0x7614e8=function(_0x38bc27){while(--_0x38bc27){_0x3dd834['push'](_0x3dd834['shift']());}};_0x7614e8(++_0x53ea52);}(_0xac6d,0x119));var _0xdac6=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0xac6d[_0x363ef8];return _0x148822;};'use strict';var _=require(_0xdac6('0x0'));var util=require('util');var moment=require(_0xdac6('0x1'));var BPromise=require(_0xdac6('0x2'));var rs=require(_0xdac6('0x3'));var fs=require('fs');var Redis=require(_0xdac6('0x4'));var db=require(_0xdac6('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdac6('0x6'));var config=require(_0xdac6('0x7'));var jayson=require(_0xdac6('0x8'));var client=jayson[_0xdac6('0x9')][_0xdac6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ade27,_0x2635b9,_0xce63ae){return new BPromise(function(_0x2e60ee,_0x17cdcf){return client[_0xdac6('0xb')](_0x3ade27,_0xce63ae)['then'](function(_0x4bab69){logger[_0xdac6('0xc')](_0xdac6('0xd'),_0x2635b9,_0xdac6('0xe'));logger['debug'](_0xdac6('0xf'),_0x2635b9,'request\x20sent',JSON[_0xdac6('0x10')](_0x4bab69));if(_0x4bab69[_0xdac6('0x11')]){if(_0x4bab69['error'][_0xdac6('0x12')]===0x1f4){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x2635b9,_0x4bab69[_0xdac6('0x11')]['message']);return _0x17cdcf(_0x4bab69['error'][_0xdac6('0x13')]);}logger[_0xdac6('0x11')](_0xdac6('0xd'),_0x2635b9,_0x4bab69[_0xdac6('0x11')][_0xdac6('0x13')]);return _0x2e60ee(_0x4bab69[_0xdac6('0x11')]['message']);}else{logger[_0xdac6('0xc')](_0xdac6('0xd'),_0x2635b9,_0xdac6('0xe'));_0x2e60ee(_0x4bab69['result'][_0xdac6('0x13')]);}})[_0xdac6('0x14')](function(_0x2b1844){logger[_0xdac6('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x2635b9,_0x2b1844);_0x17cdcf(_0x2b1844);});});}exports[_0xdac6('0x15')]=function(_0x30ef07){var _0x4f5d22=this;return new Promise(function(_0x2f7aed,_0x355a1f){return db['FaxQueueReport']['create'](_0x30ef07[_0xdac6('0x16')],{'raw':_0x30ef07[_0xdac6('0x17')]?_0x30ef07[_0xdac6('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xdac6('0x18')](function(_0x3d9646){logger['info']('CreateFaxQueueReport',_0x30ef07);logger[_0xdac6('0x19')]('CreateFaxQueueReport',_0x30ef07,JSON[_0xdac6('0x10')](_0x3d9646));_0x2f7aed(_0x3d9646);})[_0xdac6('0x14')](function(_0x417dee){logger[_0xdac6('0x11')](_0xdac6('0x15'),_0x417dee['message'],_0x30ef07);_0x355a1f(_0x4f5d22[_0xdac6('0x11')](0x1f4,_0x417dee[_0xdac6('0x13')]));});});};exports['UpdateFaxQueueReport']=function(_0x351a22){var _0x2d4bf5=this;return new Promise(function(_0x3d8c46,_0x452e2b){return db[_0xdac6('0x1a')][_0xdac6('0x1b')](_0x351a22[_0xdac6('0x16')],{'raw':_0x351a22[_0xdac6('0x17')]?_0x351a22[_0xdac6('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x351a22['options']?_0x351a22[_0xdac6('0x17')][_0xdac6('0x1c')]||null:null,'attributes':_0x351a22[_0xdac6('0x17')]?_0x351a22[_0xdac6('0x17')][_0xdac6('0x1d')]||null:null,'limit':_0x351a22[_0xdac6('0x17')]?_0x351a22[_0xdac6('0x17')][_0xdac6('0x1e')]||null:null})[_0xdac6('0x18')](function(_0x45bdec){logger[_0xdac6('0xc')](_0xdac6('0x1f'),_0x351a22);logger['debug']('UpdateFaxQueueReport',_0x351a22,JSON[_0xdac6('0x10')](_0x45bdec));_0x3d8c46(_0x45bdec);})[_0xdac6('0x14')](function(_0x37383e){logger[_0xdac6('0x11')](_0xdac6('0x1f'),_0x37383e[_0xdac6('0x13')],_0x351a22);_0x452e2b(_0x2d4bf5['error'](0x1f4,_0x37383e[_0xdac6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 52fba3d..026466d 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 _0x8a64=['show','post','create','put','update','/:id','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe'];(function(_0x4bec28,_0x3138a9){var _0x36cd6e=function(_0x2d5659){while(--_0x2d5659){_0x4bec28['push'](_0x4bec28['shift']());}};_0x36cd6e(++_0x3138a9);}(_0x8a64,0x143));var _0x48a6=function(_0x45656e,_0x5d7a19){_0x45656e=_0x45656e-0x0;var _0x1499ac=_0x8a64[_0x45656e];return _0x1499ac;};'use strict';var multer=require('multer');var util=require(_0x48a6('0x0'));var path=require(_0x48a6('0x1'));var timeout=require('connect-timeout');var express=require(_0x48a6('0x2'));var router=express[_0x48a6('0x3')]();var fs_extra=require(_0x48a6('0x4'));var auth=require(_0x48a6('0x5'));var interaction=require(_0x48a6('0x6'));var config=require(_0x48a6('0x7'));var controller=require('./faxQueueReport.controller');router['get']('/',auth[_0x48a6('0x8')](),controller[_0x48a6('0x9')]);router[_0x48a6('0xa')](_0x48a6('0xb'),auth[_0x48a6('0x8')](),controller[_0x48a6('0xc')]);router['get']('/:id',auth[_0x48a6('0x8')](),controller[_0x48a6('0xd')]);router[_0x48a6('0xe')]('/',auth['isAuthenticated'](),controller[_0x48a6('0xf')]);router[_0x48a6('0x10')]('/:id',auth[_0x48a6('0x8')](),controller[_0x48a6('0x11')]);router['delete'](_0x48a6('0x12'),auth['isAuthenticated'](),controller[_0x48a6('0x13')]);module[_0x48a6('0x14')]=router; \ No newline at end of file +var _0x7aaf=['./faxQueueReport.controller','get','index','/describe','isAuthenticated','/:id','post','create','put','delete','destroy','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2b3804,_0x423aa4){var _0x5c9ef1=function(_0x49a085){while(--_0x49a085){_0x2b3804['push'](_0x2b3804['shift']());}};_0x5c9ef1(++_0x423aa4);}(_0x7aaf,0xad));var _0xf7aa=function(_0x1a0b4e,_0x513b0f){_0x1a0b4e=_0x1a0b4e-0x0;var _0x10e362=_0x7aaf[_0x1a0b4e];return _0x10e362;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf7aa('0x0'));var timeout=require(_0xf7aa('0x1'));var express=require(_0xf7aa('0x2'));var router=express['Router']();var fs_extra=require(_0xf7aa('0x3'));var auth=require(_0xf7aa('0x4'));var interaction=require(_0xf7aa('0x5'));var config=require(_0xf7aa('0x6'));var controller=require(_0xf7aa('0x7'));router[_0xf7aa('0x8')]('/',auth['isAuthenticated'](),controller[_0xf7aa('0x9')]);router[_0xf7aa('0x8')](_0xf7aa('0xa'),auth[_0xf7aa('0xb')](),controller['describe']);router['get'](_0xf7aa('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xf7aa('0xd')]('/',auth[_0xf7aa('0xb')](),controller[_0xf7aa('0xe')]);router[_0xf7aa('0xf')](_0xf7aa('0xc'),auth[_0xf7aa('0xb')](),controller['update']);router[_0xf7aa('0x10')](_0xf7aa('0xc'),auth[_0xf7aa('0xb')](),controller[_0xf7aa('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 2bec680..4daae01 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x1c6471,_0x29f86e){var _0x474a68=function(_0x2a14d4){while(--_0x2a14d4){_0x1c6471['push'](_0x1c6471['shift']());}};_0x474a68(++_0x29f86e);}(_0x34e8,0x12c));var _0x834e=function(_0x1b9de7,_0x1c5db2){_0x1b9de7=_0x1b9de7-0x0;var _0x2de3ae=_0x34e8[_0x1b9de7];return _0x2de3ae;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0xafa3b3,_0x419820){var _0x25fa7f=function(_0x547df6){while(--_0x547df6){_0xafa3b3['push'](_0xafa3b3['shift']());}};_0x25fa7f(++_0x419820);}(_0x34e8,0x12c));var _0x834e=function(_0x32b22e,_0x30591e){_0x32b22e=_0x32b22e-0x0;var _0x47c09a=_0x34e8[_0x32b22e];return _0x47c09a;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 25c82bb..2691ddc 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 _0xf02f=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','map','FaxTransferReport','type','key','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','keys','rawAttributes','find','catch','create','body','params','describe','eml-format','rimraf'];(function(_0x1bee7,_0x4219d6){var _0x14271e=function(_0x68b2e9){while(--_0x68b2e9){_0x1bee7['push'](_0x1bee7['shift']());}};_0x14271e(++_0x4219d6);}(_0xf02f,0x1c0));var _0xff02=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf02f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xff02('0x0'));var rimraf=require(_0xff02('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xff02('0x2'));var rp=require(_0xff02('0x3'));var moment=require(_0xff02('0x4'));var BPromise=require(_0xff02('0x5'));var Mustache=require(_0xff02('0x6'));var util=require(_0xff02('0x7'));var path=require(_0xff02('0x8'));var sox=require(_0xff02('0x9'));var csv=require('to-csv');var ejs=require(_0xff02('0xa'));var fs=require('fs');var fs_extra=require(_0xff02('0xb'));var _=require(_0xff02('0xc'));var squel=require(_0xff02('0xd'));var crypto=require(_0xff02('0xe'));var jsforce=require(_0xff02('0xf'));var deskjs=require(_0xff02('0x10'));var toCsv=require(_0xff02('0x11'));var querystring=require(_0xff02('0x12'));var Papa=require(_0xff02('0x13'));var Redis=require(_0xff02('0x14'));var authService=require(_0xff02('0x15'));var qs=require(_0xff02('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff02('0x17'));var logger=require(_0xff02('0x18'))('api');var utils=require(_0xff02('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xff02('0x1a'));var db=require(_0xff02('0x1b'))['db'];function respondWithStatusCode(_0x5457b1,_0x299077){_0x299077=_0x299077||0xcc;return function(_0x643248){if(_0x643248){return _0x5457b1[_0xff02('0x1c')](_0x299077);}return _0x5457b1[_0xff02('0x1d')](_0x299077)['end']();};}function respondWithResult(_0x3fa311,_0x39f198){_0x39f198=_0x39f198||0xc8;return function(_0x190622){if(_0x190622){return _0x3fa311[_0xff02('0x1d')](_0x39f198)[_0xff02('0x1e')](_0x190622);}};}function respondWithFilteredResult(_0x33e042,_0x76df37){return function(_0x50d2e0){if(_0x50d2e0){var _0x59c574=typeof _0x76df37['offset']===_0xff02('0x1f')&&typeof _0x76df37[_0xff02('0x20')]===_0xff02('0x1f');var _0x528346=_0x50d2e0[_0xff02('0x21')];var _0x2faa35=_0x59c574?0x0:_0x76df37['offset'];var _0xe7cc30=_0x59c574?_0x50d2e0[_0xff02('0x21')]:_0x76df37['offset']+_0x76df37[_0xff02('0x20')];var _0x45c871;if(_0xe7cc30>=_0x528346){_0xe7cc30=_0x528346;_0x45c871=0xc8;}else{_0x45c871=0xce;}_0x33e042['status'](_0x45c871);return _0x33e042[_0xff02('0x22')](_0xff02('0x23'),_0x2faa35+'-'+_0xe7cc30+'/'+_0x528346)[_0xff02('0x1e')](_0x50d2e0);}return null;};}function patchUpdates(_0xed6f33){return function(_0x5d6c9f){try{jsonpatch[_0xff02('0x24')](_0x5d6c9f,_0xed6f33,!![]);}catch(_0x25bcf6){return BPromise['reject'](_0x25bcf6);}return _0x5d6c9f[_0xff02('0x25')]();};}function saveUpdates(_0xcedd,_0x5cbb63){return function(_0x595c7d){if(_0x595c7d){return _0x595c7d[_0xff02('0x26')](_0xcedd)['then'](function(_0x50e0cb){return _0x50e0cb;});}return null;};}function removeEntity(_0x4bca30,_0x250f36){return function(_0x1da0af){if(_0x1da0af){return _0x1da0af[_0xff02('0x27')]()[_0xff02('0x28')](function(){_0x4bca30[_0xff02('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bdea6,_0x37f75d){return function(_0x45b819){if(!_0x45b819){_0x5bdea6[_0xff02('0x1c')](0x194);}return _0x45b819;};}function handleError(_0x1a2096,_0x3dca00){_0x3dca00=_0x3dca00||0x1f4;return function(_0x4b7d10){logger[_0xff02('0x29')](_0x4b7d10[_0xff02('0x2a')]);if(_0x4b7d10['name']){delete _0x4b7d10[_0xff02('0x2b')];}_0x1a2096['status'](_0x3dca00)[_0xff02('0x2c')](_0x4b7d10);};}exports['index']=function(_0x3f190f,_0x2e5e13){var _0x4caa40={},_0x5a0d11={},_0x1dc485={'count':0x0,'rows':[]};var _0x4e1763=_[_0xff02('0x2d')](db[_0xff02('0x2e')]['rawAttributes'],function(_0x5ccb6f){return{'name':_0x5ccb6f['fieldName'],'type':_0x5ccb6f[_0xff02('0x2f')][_0xff02('0x30')]};});_0x5a0d11[_0xff02('0x31')]=_[_0xff02('0x2d')](_0x4e1763,_0xff02('0x2b'));_0x5a0d11['query']=_['keys'](_0x3f190f[_0xff02('0x32')]);_0x5a0d11['filters']=_['intersection'](_0x5a0d11['model'],_0x5a0d11[_0xff02('0x32')]);_0x4caa40[_0xff02('0x33')]=_[_0xff02('0x34')](_0x5a0d11['model'],qs[_0xff02('0x35')](_0x3f190f[_0xff02('0x32')][_0xff02('0x35')]));_0x4caa40[_0xff02('0x33')]=_0x4caa40['attributes']['length']?_0x4caa40['attributes']:_0x5a0d11[_0xff02('0x31')];if(!_0x3f190f['query'][_0xff02('0x36')](_0xff02('0x37'))){_0x4caa40[_0xff02('0x20')]=qs[_0xff02('0x20')](_0x3f190f[_0xff02('0x32')][_0xff02('0x20')]);_0x4caa40['offset']=qs['offset'](_0x3f190f[_0xff02('0x32')]['offset']);}_0x4caa40[_0xff02('0x38')]=qs[_0xff02('0x39')](_0x3f190f['query'][_0xff02('0x39')]);_0x4caa40[_0xff02('0x3a')]=qs[_0xff02('0x3b')](_['pick'](_0x3f190f[_0xff02('0x32')],_0x5a0d11[_0xff02('0x3b')]),_0x4e1763);if(_0x3f190f[_0xff02('0x32')][_0xff02('0x3c')]){_0x4caa40['where']=_[_0xff02('0x3d')](_0x4caa40['where'],{'$or':_[_0xff02('0x2d')](_0x4e1763,function(_0x17bf6b){if(_0x17bf6b[_0xff02('0x2f')]!==_0xff02('0x3e')){var _0x5422d9={};_0x5422d9[_0x17bf6b[_0xff02('0x2b')]]={'$like':'%'+_0x3f190f[_0xff02('0x32')][_0xff02('0x3c')]+'%'};return _0x5422d9;}})});}_0x4caa40=_['merge']({},_0x4caa40,_0x3f190f[_0xff02('0x3f')]);var _0x5ade7b={'where':_0x4caa40[_0xff02('0x3a')]};return db[_0xff02('0x2e')]['count'](_0x5ade7b)[_0xff02('0x28')](function(_0x445181){_0x1dc485['count']=_0x445181;if(_0x3f190f[_0xff02('0x32')][_0xff02('0x40')]){_0x4caa40[_0xff02('0x41')]=[{'all':!![]}];}return db[_0xff02('0x2e')]['findAll'](_0x4caa40);})['then'](function(_0x2bfacd){_0x1dc485[_0xff02('0x42')]=_0x2bfacd;return _0x1dc485;})[_0xff02('0x28')](respondWithFilteredResult(_0x2e5e13,_0x4caa40))['catch'](handleError(_0x2e5e13,null));};exports['show']=function(_0x4b2e68,_0x5e0152){var _0x375ada={'raw':!![],'where':{'id':_0x4b2e68['params']['id']}},_0xb9e9d8={};_0xb9e9d8[_0xff02('0x31')]=_[_0xff02('0x43')](db[_0xff02('0x2e')][_0xff02('0x44')]);_0xb9e9d8[_0xff02('0x32')]=_[_0xff02('0x43')](_0x4b2e68[_0xff02('0x32')]);_0xb9e9d8[_0xff02('0x3b')]=_[_0xff02('0x34')](_0xb9e9d8['model'],_0xb9e9d8[_0xff02('0x32')]);_0x375ada[_0xff02('0x33')]=_[_0xff02('0x34')](_0xb9e9d8[_0xff02('0x31')],qs[_0xff02('0x35')](_0x4b2e68[_0xff02('0x32')][_0xff02('0x35')]));_0x375ada['attributes']=_0x375ada[_0xff02('0x33')]['length']?_0x375ada[_0xff02('0x33')]:_0xb9e9d8[_0xff02('0x31')];if(_0x4b2e68[_0xff02('0x32')]['includeAll']){_0x375ada[_0xff02('0x41')]=[{'all':!![]}];}_0x375ada=_[_0xff02('0x3d')]({},_0x375ada,_0x4b2e68[_0xff02('0x3f')]);return db['FaxTransferReport'][_0xff02('0x45')](_0x375ada)['then'](handleEntityNotFound(_0x5e0152,null))[_0xff02('0x28')](respondWithResult(_0x5e0152,null))[_0xff02('0x46')](handleError(_0x5e0152,null));};exports[_0xff02('0x47')]=function(_0x32b91b,_0x3ed758){return db[_0xff02('0x2e')][_0xff02('0x47')](_0x32b91b['body'],{})[_0xff02('0x28')](respondWithResult(_0x3ed758,0xc9))[_0xff02('0x46')](handleError(_0x3ed758,null));};exports[_0xff02('0x26')]=function(_0x5c2808,_0x4b4a15){if(_0x5c2808['body']['id']){delete _0x5c2808[_0xff02('0x48')]['id'];}return db[_0xff02('0x2e')][_0xff02('0x45')]({'where':{'id':_0x5c2808[_0xff02('0x49')]['id']}})[_0xff02('0x28')](handleEntityNotFound(_0x4b4a15,null))['then'](saveUpdates(_0x5c2808[_0xff02('0x48')],null))['then'](respondWithResult(_0x4b4a15,null))[_0xff02('0x46')](handleError(_0x4b4a15,null));};exports[_0xff02('0x27')]=function(_0x389797,_0xb0d91e){return db[_0xff02('0x2e')][_0xff02('0x45')]({'where':{'id':_0x389797[_0xff02('0x49')]['id']}})['then'](handleEntityNotFound(_0xb0d91e,null))[_0xff02('0x28')](removeEntity(_0xb0d91e,null))['catch'](handleError(_0xb0d91e,null));};exports[_0xff02('0x4a')]=function(_0x320ed3,_0x47f85c){return db[_0xff02('0x2e')][_0xff02('0x4a')]()[_0xff02('0x28')](respondWithResult(_0x47f85c,null))[_0xff02('0x46')](handleError(_0x47f85c,null));}; \ No newline at end of file +var _0x8a71=['error','stack','name','index','map','FaxTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','VIRTUAL','options','findAll','catch','params','includeAll','include','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus'];(function(_0x2bd9ab,_0x4cb4e2){var _0x33d34e=function(_0x1350e9){while(--_0x1350e9){_0x2bd9ab['push'](_0x2bd9ab['shift']());}};_0x33d34e(++_0x4cb4e2);}(_0x8a71,0x103));var _0x18a7=function(_0x4dc30b,_0x26e354){_0x4dc30b=_0x4dc30b-0x0;var _0x44a629=_0x8a71[_0x4dc30b];return _0x44a629;};'use strict';var emlformat=require(_0x18a7('0x0'));var rimraf=require(_0x18a7('0x1'));var zipdir=require(_0x18a7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x18a7('0x3'));var moment=require(_0x18a7('0x4'));var BPromise=require(_0x18a7('0x5'));var Mustache=require(_0x18a7('0x6'));var util=require(_0x18a7('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x18a7('0x8'));var ejs=require(_0x18a7('0x9'));var fs=require('fs');var fs_extra=require(_0x18a7('0xa'));var _=require(_0x18a7('0xb'));var squel=require(_0x18a7('0xc'));var crypto=require('crypto');var jsforce=require(_0x18a7('0xd'));var deskjs=require(_0x18a7('0xe'));var toCsv=require(_0x18a7('0x8'));var querystring=require('querystring');var Papa=require(_0x18a7('0xf'));var Redis=require('ioredis');var authService=require(_0x18a7('0x10'));var qs=require(_0x18a7('0x11'));var as=require(_0x18a7('0x12'));var hardwareService=require(_0x18a7('0x13'));var logger=require(_0x18a7('0x14'))('api');var utils=require(_0x18a7('0x15'));var config=require(_0x18a7('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x18a7('0x17'))['db'];function respondWithStatusCode(_0x5b9b5d,_0x351f78){_0x351f78=_0x351f78||0xcc;return function(_0x186b3a){if(_0x186b3a){return _0x5b9b5d['sendStatus'](_0x351f78);}return _0x5b9b5d[_0x18a7('0x18')](_0x351f78)[_0x18a7('0x19')]();};}function respondWithResult(_0x1ef364,_0x5e6e14){_0x5e6e14=_0x5e6e14||0xc8;return function(_0x58f735){if(_0x58f735){return _0x1ef364[_0x18a7('0x18')](_0x5e6e14)[_0x18a7('0x1a')](_0x58f735);}};}function respondWithFilteredResult(_0x495cdf,_0x13815c){return function(_0x1b0963){if(_0x1b0963){var _0x3ca425=typeof _0x13815c['offset']==='undefined'&&typeof _0x13815c[_0x18a7('0x1b')]==='undefined';var _0x777276=_0x1b0963['count'];var _0x221b0b=_0x3ca425?0x0:_0x13815c['offset'];var _0x7fb6ff=_0x3ca425?_0x1b0963[_0x18a7('0x1c')]:_0x13815c['offset']+_0x13815c[_0x18a7('0x1b')];var _0x34ffe2;if(_0x7fb6ff>=_0x777276){_0x7fb6ff=_0x777276;_0x34ffe2=0xc8;}else{_0x34ffe2=0xce;}_0x495cdf[_0x18a7('0x18')](_0x34ffe2);return _0x495cdf[_0x18a7('0x1d')](_0x18a7('0x1e'),_0x221b0b+'-'+_0x7fb6ff+'/'+_0x777276)[_0x18a7('0x1a')](_0x1b0963);}return null;};}function patchUpdates(_0x30ec9c){return function(_0x4e9dd3){try{jsonpatch[_0x18a7('0x1f')](_0x4e9dd3,_0x30ec9c,!![]);}catch(_0x46af71){return BPromise[_0x18a7('0x20')](_0x46af71);}return _0x4e9dd3['save']();};}function saveUpdates(_0x40bcca,_0x2f600c){return function(_0x48f22b){if(_0x48f22b){return _0x48f22b[_0x18a7('0x21')](_0x40bcca)[_0x18a7('0x22')](function(_0x7181ef){return _0x7181ef;});}return null;};}function removeEntity(_0x104ee8,_0x2932ed){return function(_0x1e1d1c){if(_0x1e1d1c){return _0x1e1d1c[_0x18a7('0x23')]()['then'](function(){_0x104ee8['status'](0xcc)[_0x18a7('0x19')]();});}};}function handleEntityNotFound(_0x1acead,_0x3de254){return function(_0xd5c91a){if(!_0xd5c91a){_0x1acead[_0x18a7('0x24')](0x194);}return _0xd5c91a;};}function handleError(_0x425e82,_0x2b2a67){_0x2b2a67=_0x2b2a67||0x1f4;return function(_0x2ee69c){logger[_0x18a7('0x25')](_0x2ee69c[_0x18a7('0x26')]);if(_0x2ee69c[_0x18a7('0x27')]){delete _0x2ee69c[_0x18a7('0x27')];}_0x425e82['status'](_0x2b2a67)['send'](_0x2ee69c);};}exports[_0x18a7('0x28')]=function(_0x2eaf26,_0x97b657){var _0x19554a={},_0x4cea74={},_0x1c595a={'count':0x0,'rows':[]};var _0x22e406=_[_0x18a7('0x29')](db[_0x18a7('0x2a')][_0x18a7('0x2b')],function(_0x15385b){return{'name':_0x15385b[_0x18a7('0x2c')],'type':_0x15385b[_0x18a7('0x2d')][_0x18a7('0x2e')]};});_0x4cea74['model']=_[_0x18a7('0x29')](_0x22e406,'name');_0x4cea74[_0x18a7('0x2f')]=_[_0x18a7('0x30')](_0x2eaf26[_0x18a7('0x2f')]);_0x4cea74[_0x18a7('0x31')]=_[_0x18a7('0x32')](_0x4cea74[_0x18a7('0x33')],_0x4cea74['query']);_0x19554a['attributes']=_[_0x18a7('0x32')](_0x4cea74['model'],qs['fields'](_0x2eaf26['query'][_0x18a7('0x34')]));_0x19554a[_0x18a7('0x35')]=_0x19554a[_0x18a7('0x35')][_0x18a7('0x36')]?_0x19554a[_0x18a7('0x35')]:_0x4cea74[_0x18a7('0x33')];if(!_0x2eaf26[_0x18a7('0x2f')][_0x18a7('0x37')](_0x18a7('0x38'))){_0x19554a[_0x18a7('0x1b')]=qs[_0x18a7('0x1b')](_0x2eaf26[_0x18a7('0x2f')][_0x18a7('0x1b')]);_0x19554a[_0x18a7('0x39')]=qs['offset'](_0x2eaf26[_0x18a7('0x2f')]['offset']);}_0x19554a[_0x18a7('0x3a')]=qs[_0x18a7('0x3b')](_0x2eaf26[_0x18a7('0x2f')]['sort']);_0x19554a[_0x18a7('0x3c')]=qs[_0x18a7('0x31')](_['pick'](_0x2eaf26[_0x18a7('0x2f')],_0x4cea74[_0x18a7('0x31')]),_0x22e406);if(_0x2eaf26[_0x18a7('0x2f')][_0x18a7('0x3d')]){_0x19554a[_0x18a7('0x3c')]=_[_0x18a7('0x3e')](_0x19554a[_0x18a7('0x3c')],{'$or':_[_0x18a7('0x29')](_0x22e406,function(_0x3421ca){if(_0x3421ca[_0x18a7('0x2d')]!==_0x18a7('0x3f')){var _0x3bdb17={};_0x3bdb17[_0x3421ca[_0x18a7('0x27')]]={'$like':'%'+_0x2eaf26[_0x18a7('0x2f')][_0x18a7('0x3d')]+'%'};return _0x3bdb17;}})});}_0x19554a=_[_0x18a7('0x3e')]({},_0x19554a,_0x2eaf26[_0x18a7('0x40')]);var _0x5988cd={'where':_0x19554a[_0x18a7('0x3c')]};return db['FaxTransferReport'][_0x18a7('0x1c')](_0x5988cd)[_0x18a7('0x22')](function(_0x430bce){_0x1c595a[_0x18a7('0x1c')]=_0x430bce;if(_0x2eaf26[_0x18a7('0x2f')]['includeAll']){_0x19554a['include']=[{'all':!![]}];}return db[_0x18a7('0x2a')][_0x18a7('0x41')](_0x19554a);})['then'](function(_0x1a203d){_0x1c595a['rows']=_0x1a203d;return _0x1c595a;})[_0x18a7('0x22')](respondWithFilteredResult(_0x97b657,_0x19554a))[_0x18a7('0x42')](handleError(_0x97b657,null));};exports['show']=function(_0x4a4e6d,_0x33137d){var _0x52a64e={'raw':!![],'where':{'id':_0x4a4e6d[_0x18a7('0x43')]['id']}},_0x3a9fb1={};_0x3a9fb1[_0x18a7('0x33')]=_[_0x18a7('0x30')](db[_0x18a7('0x2a')][_0x18a7('0x2b')]);_0x3a9fb1[_0x18a7('0x2f')]=_[_0x18a7('0x30')](_0x4a4e6d[_0x18a7('0x2f')]);_0x3a9fb1[_0x18a7('0x31')]=_[_0x18a7('0x32')](_0x3a9fb1[_0x18a7('0x33')],_0x3a9fb1[_0x18a7('0x2f')]);_0x52a64e[_0x18a7('0x35')]=_[_0x18a7('0x32')](_0x3a9fb1['model'],qs[_0x18a7('0x34')](_0x4a4e6d['query'][_0x18a7('0x34')]));_0x52a64e[_0x18a7('0x35')]=_0x52a64e['attributes']['length']?_0x52a64e['attributes']:_0x3a9fb1[_0x18a7('0x33')];if(_0x4a4e6d[_0x18a7('0x2f')][_0x18a7('0x44')]){_0x52a64e[_0x18a7('0x45')]=[{'all':!![]}];}_0x52a64e=_[_0x18a7('0x3e')]({},_0x52a64e,_0x4a4e6d[_0x18a7('0x40')]);return db['FaxTransferReport']['find'](_0x52a64e)[_0x18a7('0x22')](handleEntityNotFound(_0x33137d,null))[_0x18a7('0x22')](respondWithResult(_0x33137d,null))[_0x18a7('0x42')](handleError(_0x33137d,null));};exports[_0x18a7('0x46')]=function(_0x2398a8,_0x2a2de5){return db[_0x18a7('0x2a')][_0x18a7('0x46')](_0x2398a8[_0x18a7('0x47')],{})[_0x18a7('0x22')](respondWithResult(_0x2a2de5,0xc9))[_0x18a7('0x42')](handleError(_0x2a2de5,null));};exports[_0x18a7('0x21')]=function(_0x21f797,_0x2e1446){if(_0x21f797[_0x18a7('0x47')]['id']){delete _0x21f797[_0x18a7('0x47')]['id'];}return db[_0x18a7('0x2a')][_0x18a7('0x48')]({'where':{'id':_0x21f797['params']['id']}})[_0x18a7('0x22')](handleEntityNotFound(_0x2e1446,null))[_0x18a7('0x22')](saveUpdates(_0x21f797[_0x18a7('0x47')],null))[_0x18a7('0x22')](respondWithResult(_0x2e1446,null))[_0x18a7('0x42')](handleError(_0x2e1446,null));};exports[_0x18a7('0x23')]=function(_0xa60563,_0x176dfb){return db[_0x18a7('0x2a')][_0x18a7('0x48')]({'where':{'id':_0xa60563[_0x18a7('0x43')]['id']}})['then'](handleEntityNotFound(_0x176dfb,null))[_0x18a7('0x22')](removeEntity(_0x176dfb,null))['catch'](handleError(_0x176dfb,null));};exports[_0x18a7('0x49')]=function(_0x257c22,_0xeaa11f){return db[_0x18a7('0x2a')][_0x18a7('0x49')]()['then'](respondWithResult(_0xeaa11f,null))[_0x18a7('0x42')](handleError(_0xeaa11f,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 0eeb088..1bba211 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 _0xfbe8=['report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','define','FaxTransferReport'];(function(_0x5b565d,_0x55825b){var _0x2ba1ca=function(_0x39e61a){while(--_0x39e61a){_0x5b565d['push'](_0x5b565d['shift']());}};_0x2ba1ca(++_0x55825b);}(_0xfbe8,0x152));var _0x8fbe=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xfbe8[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0x8fbe('0x0'));var util=require(_0x8fbe('0x1'));var logger=require(_0x8fbe('0x2'))(_0x8fbe('0x3'));var moment=require(_0x8fbe('0x4'));var BPromise=require(_0x8fbe('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8fbe('0x6'));var rimraf=require(_0x8fbe('0x7'));var config=require('../../config/environment');var attributes=require('./faxTransferReport.attributes');module['exports']=function(_0x2035fa,_0x47a254){return _0x2035fa[_0x8fbe('0x8')](_0x8fbe('0x9'),attributes,{'tableName':_0x8fbe('0xa'),'paranoid':![],'indexes':[{'name':_0x8fbe('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2782=['../../config/environment','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x6ad243,_0x28332d){var _0x15a185=function(_0x52fa66){while(--_0x52fa66){_0x6ad243['push'](_0x6ad243['shift']());}};_0x15a185(++_0x28332d);}(_0x2782,0x17f));var _0x2278=function(_0x1af05b,_0x5134b5){_0x1af05b=_0x1af05b-0x0;var _0x5be7cc=_0x2782[_0x1af05b];return _0x5be7cc;};'use strict';var _=require(_0x2278('0x0'));var util=require(_0x2278('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2278('0x2'));var BPromise=require(_0x2278('0x3'));var rp=require(_0x2278('0x4'));var fs=require('fs');var path=require(_0x2278('0x5'));var rimraf=require(_0x2278('0x6'));var config=require(_0x2278('0x7'));var attributes=require('./faxTransferReport.attributes');module[_0x2278('0x8')]=function(_0x3be2fa,_0x3cd75d){return _0x3be2fa[_0x2278('0x9')](_0x2278('0xa'),attributes,{'tableName':_0x2278('0xb'),'paranoid':![],'indexes':[{'name':_0x2278('0xc'),'fields':[_0x2278('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 392b302..da8f2c7 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 _0x7786=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x29f46b,_0x29b6f4){var _0x22b7c2=function(_0x39731d){while(--_0x39731d){_0x29f46b['push'](_0x29f46b['shift']());}};_0x22b7c2(++_0x29b6f4);}(_0x7786,0x1a4));var _0x6778=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7786[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6778('0x0'));var util=require(_0x6778('0x1'));var moment=require(_0x6778('0x2'));var BPromise=require(_0x6778('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6778('0x4'));var db=require(_0x6778('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6778('0x6'))('rpc');var config=require(_0x6778('0x7'));var jayson=require(_0x6778('0x8'));var client=jayson['client'][_0x6778('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21abab,_0x43f3cc,_0x236c8d){return new BPromise(function(_0x995327,_0x478a7a){return client[_0x6778('0xa')](_0x21abab,_0x236c8d)[_0x6778('0xb')](function(_0x2c0626){logger[_0x6778('0xc')](_0x6778('0xd'),_0x43f3cc,_0x6778('0xe'));logger[_0x6778('0xf')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x43f3cc,'request\x20sent',JSON[_0x6778('0x10')](_0x2c0626));if(_0x2c0626[_0x6778('0x11')]){if(_0x2c0626[_0x6778('0x11')][_0x6778('0x12')]===0x1f4){logger[_0x6778('0x11')](_0x6778('0xd'),_0x43f3cc,_0x2c0626['error']['message']);return _0x478a7a(_0x2c0626[_0x6778('0x11')][_0x6778('0x13')]);}logger[_0x6778('0x11')](_0x6778('0xd'),_0x43f3cc,_0x2c0626['error'][_0x6778('0x13')]);return _0x995327(_0x2c0626[_0x6778('0x11')][_0x6778('0x13')]);}else{logger[_0x6778('0xc')](_0x6778('0xd'),_0x43f3cc,'request\x20sent');_0x995327(_0x2c0626[_0x6778('0x14')][_0x6778('0x13')]);}})[_0x6778('0x15')](function(_0x207783){logger[_0x6778('0x11')](_0x6778('0xd'),_0x43f3cc,_0x207783);_0x478a7a(_0x207783);});});} \ No newline at end of file +var _0x00d6=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x275b15,_0x3853e0){var _0x15aa5f=function(_0x51d060){while(--_0x51d060){_0x275b15['push'](_0x275b15['shift']());}};_0x15aa5f(++_0x3853e0);}(_0x00d6,0x173));var _0x600d=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x00d6[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x600d('0x0'));var util=require(_0x600d('0x1'));var moment=require(_0x600d('0x2'));var BPromise=require('bluebird');var rs=require(_0x600d('0x3'));var fs=require('fs');var Redis=require(_0x600d('0x4'));var db=require(_0x600d('0x5'))['db'];var utils=require(_0x600d('0x6'));var logger=require(_0x600d('0x7'))(_0x600d('0x8'));var config=require('../../config/environment');var jayson=require(_0x600d('0x9'));var client=jayson['client'][_0x600d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x559a4f,_0x477900,_0x13d9c3){return new BPromise(function(_0x211d2b,_0x52a6ac){return client[_0x600d('0xb')](_0x559a4f,_0x13d9c3)[_0x600d('0xc')](function(_0x275289){logger[_0x600d('0xd')](_0x600d('0xe'),_0x477900,_0x600d('0xf'));logger[_0x600d('0x10')](_0x600d('0x11'),_0x477900,'request\x20sent',JSON['stringify'](_0x275289));if(_0x275289[_0x600d('0x12')]){if(_0x275289[_0x600d('0x12')][_0x600d('0x13')]===0x1f4){logger[_0x600d('0x12')](_0x600d('0xe'),_0x477900,_0x275289['error'][_0x600d('0x14')]);return _0x52a6ac(_0x275289[_0x600d('0x12')][_0x600d('0x14')]);}logger[_0x600d('0x12')](_0x600d('0xe'),_0x477900,_0x275289['error'][_0x600d('0x14')]);return _0x211d2b(_0x275289[_0x600d('0x12')][_0x600d('0x14')]);}else{logger[_0x600d('0xd')]('FaxTransferReport,\x20%s,\x20%s',_0x477900,_0x600d('0xf'));_0x211d2b(_0x275289[_0x600d('0x15')][_0x600d('0x14')]);}})[_0x600d('0x16')](function(_0x2083b7){logger[_0x600d('0x12')](_0x600d('0xe'),_0x477900,_0x2083b7);_0x52a6ac(_0x2083b7);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 9ffeae0..f0d4d0a 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 _0xb33d=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','post','create','/:id','update'];(function(_0x9fc3f4,_0x13e220){var _0x5cff3e=function(_0xc30a94){while(--_0xc30a94){_0x9fc3f4['push'](_0x9fc3f4['shift']());}};_0x5cff3e(++_0x13e220);}(_0xb33d,0x10c));var _0xdb33=function(_0x212348,_0x55415c){_0x212348=_0x212348-0x0;var _0x1696e9=_0xb33d[_0x212348];return _0x1696e9;};'use strict';var multer=require(_0xdb33('0x0'));var util=require(_0xdb33('0x1'));var path=require(_0xdb33('0x2'));var timeout=require(_0xdb33('0x3'));var express=require(_0xdb33('0x4'));var router=express[_0xdb33('0x5')]();var fs_extra=require(_0xdb33('0x6'));var auth=require(_0xdb33('0x7'));var interaction=require(_0xdb33('0x8'));var config=require(_0xdb33('0x9'));var controller=require('./faxTransferReport.controller');router['get']('/',auth[_0xdb33('0xa')](),controller['index']);router['get']('/describe',auth[_0xdb33('0xa')](),controller['describe']);router[_0xdb33('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xdb33('0xc')]);router[_0xdb33('0xd')]('/',auth[_0xdb33('0xa')](),controller[_0xdb33('0xe')]);router['put'](_0xdb33('0xf'),auth[_0xdb33('0xa')](),controller[_0xdb33('0x10')]);router[_0xdb33('0x11')](_0xdb33('0xf'),auth[_0xdb33('0xa')](),controller['destroy']);module[_0xdb33('0x12')]=router; \ No newline at end of file +var _0x7a54=['/:id','post','create','put','update','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x3ae182,_0x435ba7){var _0x927c89=function(_0x52a753){while(--_0x52a753){_0x3ae182['push'](_0x3ae182['shift']());}};_0x927c89(++_0x435ba7);}(_0x7a54,0xba));var _0x47a5=function(_0x335f42,_0x2c6d8d){_0x335f42=_0x335f42-0x0;var _0x2083cb=_0x7a54[_0x335f42];return _0x2083cb;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require(_0x47a5('0x3'));var express=require(_0x47a5('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth[_0x47a5('0xa')](),controller[_0x47a5('0xb')]);router[_0x47a5('0x9')](_0x47a5('0xc'),auth[_0x47a5('0xa')](),controller[_0x47a5('0xd')]);router[_0x47a5('0x9')](_0x47a5('0xe'),auth[_0x47a5('0xa')](),controller['show']);router[_0x47a5('0xf')]('/',auth[_0x47a5('0xa')](),controller[_0x47a5('0x10')]);router[_0x47a5('0x11')](_0x47a5('0xe'),auth[_0x47a5('0xa')](),controller[_0x47a5('0x12')]);router['delete'](_0x47a5('0xe'),auth[_0x47a5('0xa')](),controller[_0x47a5('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index debb9d8..d4d3d52 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 _0x956f=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','util','path','express'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x956f,0x15b));var _0xf956=function(_0x4c6d6f,_0x291557){_0x4c6d6f=_0x4c6d6f-0x0;var _0x2d4478=_0x956f[_0x4c6d6f];return _0x2d4478;};'use strict';var multer=require('multer');var util=require(_0xf956('0x0'));var path=require(_0xf956('0x1'));var timeout=require('connect-timeout');var express=require(_0xf956('0x2'));var router=express[_0xf956('0x3')]();var fs_extra=require(_0xf956('0x4'));var auth=require(_0xf956('0x5'));var interaction=require(_0xf956('0x6'));var config=require(_0xf956('0x7'));var controller=require(_0xf956('0x8'));router['get']('/',auth[_0xf956('0x9')](),controller[_0xf956('0xa')]);router[_0xf956('0xb')](_0xf956('0xc'),auth[_0xf956('0x9')](),controller[_0xf956('0xd')]);router['get'](_0xf956('0xe'),auth[_0xf956('0x9')](),controller['getConfigurations']);router[_0xf956('0xb')](_0xf956('0xf'),auth[_0xf956('0x9')](),controller[_0xf956('0x10')]);router[_0xf956('0x11')]('/',auth['isAuthenticated'](),controller[_0xf956('0x12')]);router[_0xf956('0x11')](_0xf956('0xe'),auth[_0xf956('0x9')](),controller[_0xf956('0x13')]);router[_0xf956('0x14')](_0xf956('0xc'),auth[_0xf956('0x9')](),controller[_0xf956('0x15')]);router[_0xf956('0x16')](_0xf956('0xc'),auth[_0xf956('0x9')](),controller[_0xf956('0x17')]);module[_0xf956('0x18')]=router; \ No newline at end of file +var _0x0951=['exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','show','/:id/configurations','post','create','addConfiguration','put','/:id','update'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x0951,0x1cc));var _0x1095=function(_0x2dd02b,_0x574d83){_0x2dd02b=_0x2dd02b-0x0;var _0x117384=_0x0951[_0x2dd02b];return _0x117384;};'use strict';var multer=require(_0x1095('0x0'));var util=require('util');var path=require(_0x1095('0x1'));var timeout=require(_0x1095('0x2'));var express=require(_0x1095('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1095('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1095('0x5'));var controller=require('./intDeskAccount.controller');router[_0x1095('0x6')]('/',auth[_0x1095('0x7')](),controller['index']);router[_0x1095('0x6')]('/:id',auth[_0x1095('0x7')](),controller[_0x1095('0x8')]);router[_0x1095('0x6')](_0x1095('0x9'),auth[_0x1095('0x7')](),controller['getConfigurations']);router[_0x1095('0x6')]('/:id/fields',auth[_0x1095('0x7')](),controller['getFields']);router[_0x1095('0xa')]('/',auth[_0x1095('0x7')](),controller[_0x1095('0xb')]);router[_0x1095('0xa')](_0x1095('0x9'),auth[_0x1095('0x7')](),controller[_0x1095('0xc')]);router[_0x1095('0xd')](_0x1095('0xe'),auth[_0x1095('0x7')](),controller[_0x1095('0xf')]);router['delete'](_0x1095('0xe'),auth[_0x1095('0x7')](),controller['destroy']);module[_0x1095('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 894ed56..1e463b7 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 _0xa469=['newTab','integrationTab','sequelize','exports','STRING','basic'];(function(_0xf2ce29,_0x4b19e6){var _0x1db029=function(_0x1e6d50){while(--_0x1e6d50){_0xf2ce29['push'](_0xf2ce29['shift']());}};_0x1db029(++_0x4b19e6);}(_0xa469,0x7a));var _0x9a46=function(_0x4a0f6c,_0x2ca846){_0x4a0f6c=_0x4a0f6c-0x0;var _0x45c37f=_0xa469[_0x4a0f6c];return _0x45c37f;};'use strict';var Sequelize=require(_0x9a46('0x0'));module[_0x9a46('0x1')]={'name':{'type':Sequelize[_0x9a46('0x2')]},'description':{'type':Sequelize[_0x9a46('0x2')]},'username':{'type':Sequelize[_0x9a46('0x2')]},'remoteUri':{'type':Sequelize[_0x9a46('0x2')]},'authType':{'type':Sequelize['ENUM'](_0x9a46('0x3')),'defaultValue':_0x9a46('0x3')},'password':{'type':Sequelize[_0x9a46('0x2')]},'consumerKey':{'type':Sequelize[_0x9a46('0x2')]},'consumerSecret':{'type':Sequelize[_0x9a46('0x2')]},'token':{'type':Sequelize[_0x9a46('0x2')]},'tokenSecret':{'type':Sequelize[_0x9a46('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0x9a46('0x4')),'defaultValue':_0x9a46('0x5')}}; \ No newline at end of file +var _0x4176=['newTab','sequelize','exports','STRING','basic','ENUM','integrationTab'];(function(_0x33207e,_0x4f67c4){var _0x59b4c8=function(_0xf99cba){while(--_0xf99cba){_0x33207e['push'](_0x33207e['shift']());}};_0x59b4c8(++_0x4f67c4);}(_0x4176,0xf6));var _0x6417=function(_0x55ff3e,_0x41077f){_0x55ff3e=_0x55ff3e-0x0;var _0x2709eb=_0x4176[_0x55ff3e];return _0x2709eb;};'use strict';var Sequelize=require(_0x6417('0x0'));module[_0x6417('0x1')]={'name':{'type':Sequelize[_0x6417('0x2')]},'description':{'type':Sequelize[_0x6417('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize['ENUM'](_0x6417('0x3')),'defaultValue':_0x6417('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x6417('0x2')]},'token':{'type':Sequelize[_0x6417('0x2')]},'tokenSecret':{'type':Sequelize[_0x6417('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6417('0x4')](_0x6417('0x5'),_0x6417('0x6')),'defaultValue':_0x6417('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 2447365..2a806e1 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 _0x7b15=['body','getConfigurations','DeskConfiguration','merge','addConfiguration','findOne','Subjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','consumerSecret','token','substring','lastIndexOf','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','_embedded','entries','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','DeskAccount','type','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','filters','pick','filter','where','options','includeAll','include','findAll','rows','catch','show','params','keys','find'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x7b15,0x1cd));var _0x57b1=function(_0x5e732e,_0x374640){_0x5e732e=_0x5e732e-0x0;var _0xd2419b=_0x7b15[_0x5e732e];return _0xd2419b;};'use strict';var emlformat=require(_0x57b1('0x0'));var rimraf=require(_0x57b1('0x1'));var zipdir=require(_0x57b1('0x2'));var jsonpatch=require(_0x57b1('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x57b1('0x4'));var Mustache=require('mustache');var util=require(_0x57b1('0x5'));var path=require(_0x57b1('0x6'));var sox=require(_0x57b1('0x7'));var csv=require(_0x57b1('0x8'));var ejs=require(_0x57b1('0x9'));var fs=require('fs');var fs_extra=require(_0x57b1('0xa'));var _=require(_0x57b1('0xb'));var squel=require(_0x57b1('0xc'));var crypto=require('crypto');var jsforce=require(_0x57b1('0xd'));var deskjs=require(_0x57b1('0xe'));var toCsv=require(_0x57b1('0x8'));var querystring=require(_0x57b1('0xf'));var Papa=require(_0x57b1('0x10'));var Redis=require(_0x57b1('0x11'));var authService=require(_0x57b1('0x12'));var qs=require(_0x57b1('0x13'));var as=require(_0x57b1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x57b1('0x15'))(_0x57b1('0x16'));var utils=require('../../config/utils');var config=require(_0x57b1('0x17'));var licenseUtil=require(_0x57b1('0x18'));var db=require(_0x57b1('0x19'))['db'];var integrations=require(_0x57b1('0x1a'));function respondWithStatusCode(_0x121712,_0x47a660){_0x47a660=_0x47a660||0xcc;return function(_0x1f8ef3){if(_0x1f8ef3){return _0x121712[_0x57b1('0x1b')](_0x47a660);}return _0x121712[_0x57b1('0x1c')](_0x47a660)[_0x57b1('0x1d')]();};}function respondWithResult(_0x46046e,_0x31f933){_0x31f933=_0x31f933||0xc8;return function(_0x1cf523){if(_0x1cf523){return _0x46046e[_0x57b1('0x1c')](_0x31f933)[_0x57b1('0x1e')](_0x1cf523);}};}function respondWithFilteredResult(_0x202ab9,_0x3549da){return function(_0x3bd4c2){if(_0x3bd4c2){var _0x4ffade=typeof _0x3549da[_0x57b1('0x1f')]===_0x57b1('0x20')&&typeof _0x3549da[_0x57b1('0x21')]==='undefined';var _0x1b983c=_0x3bd4c2[_0x57b1('0x22')];var _0x160d75=_0x4ffade?0x0:_0x3549da[_0x57b1('0x1f')];var _0x6814d2=_0x4ffade?_0x3bd4c2['count']:_0x3549da[_0x57b1('0x1f')]+_0x3549da[_0x57b1('0x21')];var _0x1bafc0;if(_0x6814d2>=_0x1b983c){_0x6814d2=_0x1b983c;_0x1bafc0=0xc8;}else{_0x1bafc0=0xce;}_0x202ab9[_0x57b1('0x1c')](_0x1bafc0);return _0x202ab9[_0x57b1('0x23')](_0x57b1('0x24'),_0x160d75+'-'+_0x6814d2+'/'+_0x1b983c)[_0x57b1('0x1e')](_0x3bd4c2);}return null;};}function patchUpdates(_0x2d1051){return function(_0x28c592){try{jsonpatch[_0x57b1('0x25')](_0x28c592,_0x2d1051,!![]);}catch(_0x56331d){return BPromise[_0x57b1('0x26')](_0x56331d);}return _0x28c592[_0x57b1('0x27')]();};}function saveUpdates(_0x1296ac,_0x2c036e){return function(_0x448e44){if(_0x448e44){return _0x448e44[_0x57b1('0x28')](_0x1296ac)[_0x57b1('0x29')](function(_0x50de11){return _0x50de11;});}return null;};}function removeEntity(_0x4f30a1,_0x335e05){return function(_0x5095e1){if(_0x5095e1){return _0x5095e1[_0x57b1('0x2a')]()[_0x57b1('0x29')](function(){_0x4f30a1[_0x57b1('0x1c')](0xcc)[_0x57b1('0x1d')]();});}};}function handleEntityNotFound(_0x586f33,_0x226985){return function(_0x2ed225){if(!_0x2ed225){_0x586f33[_0x57b1('0x1b')](0x194);}return _0x2ed225;};}function handleError(_0x3a1cb2,_0x37e66f){_0x37e66f=_0x37e66f||0x1f4;return function(_0xb9fff9){logger[_0x57b1('0x2b')](_0xb9fff9[_0x57b1('0x2c')]);if(_0xb9fff9['name']){delete _0xb9fff9[_0x57b1('0x2d')];}_0x3a1cb2[_0x57b1('0x1c')](_0x37e66f)[_0x57b1('0x2e')](_0xb9fff9);};}exports[_0x57b1('0x2f')]=function(_0x3a4d8d,_0x2de990){var _0x5f71d1={},_0x39273c={},_0x368381={'count':0x0,'rows':[]};var _0x4adcff=_[_0x57b1('0x30')](db[_0x57b1('0x31')]['rawAttributes'],function(_0x5a1bee){return{'name':_0x5a1bee['fieldName'],'type':_0x5a1bee[_0x57b1('0x32')]['key']};});_0x39273c[_0x57b1('0x33')]=_[_0x57b1('0x30')](_0x4adcff,'name');_0x39273c[_0x57b1('0x34')]=_['keys'](_0x3a4d8d[_0x57b1('0x34')]);_0x39273c['filters']=_[_0x57b1('0x35')](_0x39273c[_0x57b1('0x33')],_0x39273c[_0x57b1('0x34')]);_0x5f71d1['attributes']=_[_0x57b1('0x35')](_0x39273c[_0x57b1('0x33')],qs[_0x57b1('0x36')](_0x3a4d8d['query'][_0x57b1('0x36')]));_0x5f71d1['attributes']=_0x5f71d1[_0x57b1('0x37')][_0x57b1('0x38')]?_0x5f71d1['attributes']:_0x39273c[_0x57b1('0x33')];if(!_0x3a4d8d[_0x57b1('0x34')][_0x57b1('0x39')]('nolimit')){_0x5f71d1['limit']=qs[_0x57b1('0x21')](_0x3a4d8d[_0x57b1('0x34')][_0x57b1('0x21')]);_0x5f71d1[_0x57b1('0x1f')]=qs['offset'](_0x3a4d8d['query'][_0x57b1('0x1f')]);}_0x5f71d1[_0x57b1('0x3a')]=qs[_0x57b1('0x3b')](_0x3a4d8d[_0x57b1('0x34')][_0x57b1('0x3b')]);_0x5f71d1['where']=qs[_0x57b1('0x3c')](_[_0x57b1('0x3d')](_0x3a4d8d[_0x57b1('0x34')],_0x39273c['filters']),_0x4adcff);if(_0x3a4d8d[_0x57b1('0x34')][_0x57b1('0x3e')]){_0x5f71d1[_0x57b1('0x3f')]=_['merge'](_0x5f71d1[_0x57b1('0x3f')],{'$or':_[_0x57b1('0x30')](_0x4adcff,function(_0x457daa){if(_0x457daa[_0x57b1('0x32')]!=='VIRTUAL'){var _0x2b15c5={};_0x2b15c5[_0x457daa[_0x57b1('0x2d')]]={'$like':'%'+_0x3a4d8d['query']['filter']+'%'};return _0x2b15c5;}})});}_0x5f71d1=_['merge']({},_0x5f71d1,_0x3a4d8d[_0x57b1('0x40')]);var _0x36fa95={'where':_0x5f71d1[_0x57b1('0x3f')]};return db[_0x57b1('0x31')]['count'](_0x36fa95)[_0x57b1('0x29')](function(_0xad6b3){_0x368381[_0x57b1('0x22')]=_0xad6b3;if(_0x3a4d8d['query'][_0x57b1('0x41')]){_0x5f71d1[_0x57b1('0x42')]=[{'all':!![]}];}return db[_0x57b1('0x31')][_0x57b1('0x43')](_0x5f71d1);})[_0x57b1('0x29')](function(_0x21d23c){_0x368381[_0x57b1('0x44')]=_0x21d23c;return _0x368381;})[_0x57b1('0x29')](respondWithFilteredResult(_0x2de990,_0x5f71d1))[_0x57b1('0x45')](handleError(_0x2de990,null));};exports[_0x57b1('0x46')]=function(_0x4dc38c,_0x2e177c){var _0x15129d={'raw':![],'where':{'id':_0x4dc38c[_0x57b1('0x47')]['id']}},_0x56f064={};_0x56f064['model']=_[_0x57b1('0x48')](db[_0x57b1('0x31')]['rawAttributes']);_0x56f064[_0x57b1('0x34')]=_[_0x57b1('0x48')](_0x4dc38c[_0x57b1('0x34')]);_0x56f064['filters']=_[_0x57b1('0x35')](_0x56f064['model'],_0x56f064['query']);_0x15129d[_0x57b1('0x37')]=_[_0x57b1('0x35')](_0x56f064[_0x57b1('0x33')],qs['fields'](_0x4dc38c[_0x57b1('0x34')][_0x57b1('0x36')]));_0x15129d[_0x57b1('0x37')]=_0x15129d[_0x57b1('0x37')][_0x57b1('0x38')]?_0x15129d[_0x57b1('0x37')]:_0x56f064[_0x57b1('0x33')];if(_0x4dc38c[_0x57b1('0x34')][_0x57b1('0x41')]){_0x15129d['include']=[{'all':!![]}];}_0x15129d=_['merge']({},_0x15129d,_0x4dc38c[_0x57b1('0x40')]);return db[_0x57b1('0x31')][_0x57b1('0x49')](_0x15129d)[_0x57b1('0x29')](handleEntityNotFound(_0x2e177c,null))[_0x57b1('0x29')](respondWithResult(_0x2e177c,null))[_0x57b1('0x45')](handleError(_0x2e177c,null));};exports['create']=function(_0x68a780,_0xf97dd7){return db[_0x57b1('0x31')]['create'](_0x68a780[_0x57b1('0x4a')],{})[_0x57b1('0x29')](respondWithResult(_0xf97dd7,0xc9))['catch'](handleError(_0xf97dd7,null));};exports['update']=function(_0x2c6f79,_0x4948b7){if(_0x2c6f79['body']['id']){delete _0x2c6f79[_0x57b1('0x4a')]['id'];}return db[_0x57b1('0x31')][_0x57b1('0x49')]({'where':{'id':_0x2c6f79[_0x57b1('0x47')]['id']}})['then'](handleEntityNotFound(_0x4948b7,null))['then'](saveUpdates(_0x2c6f79['body'],null))[_0x57b1('0x29')](respondWithResult(_0x4948b7,null))[_0x57b1('0x45')](handleError(_0x4948b7,null));};exports[_0x57b1('0x2a')]=function(_0x38202d,_0x4f8247){return db[_0x57b1('0x31')][_0x57b1('0x49')]({'where':{'id':_0x38202d[_0x57b1('0x47')]['id']}})['then'](handleEntityNotFound(_0x4f8247,null))[_0x57b1('0x29')](removeEntity(_0x4f8247,null))[_0x57b1('0x45')](handleError(_0x4f8247,null));};exports[_0x57b1('0x4b')]=function(_0x351e78,_0x190682,_0xb3e096){var _0x77e134={};var _0x2c8082={};var _0x1e58e2;var _0x4f5c42;return db['DeskAccount']['findOne']({'where':{'id':_0x351e78[_0x57b1('0x47')]['id']}})['then'](handleEntityNotFound(_0x190682,null))[_0x57b1('0x29')](function(_0x367a16){if(_0x367a16){_0x1e58e2=_0x367a16;_0x2c8082[_0x57b1('0x33')]=_['keys'](db[_0x57b1('0x4c')]['rawAttributes']);_0x2c8082['query']=_['keys'](_0x351e78[_0x57b1('0x34')]);_0x2c8082[_0x57b1('0x3c')]=_[_0x57b1('0x35')](_0x2c8082[_0x57b1('0x33')],_0x2c8082[_0x57b1('0x34')]);_0x77e134[_0x57b1('0x37')]=_[_0x57b1('0x35')](_0x2c8082['model'],qs[_0x57b1('0x36')](_0x351e78[_0x57b1('0x34')][_0x57b1('0x36')]));_0x77e134[_0x57b1('0x37')]=_0x77e134[_0x57b1('0x37')]['length']?_0x77e134['attributes']:_0x2c8082['model'];_0x77e134[_0x57b1('0x3a')]=qs[_0x57b1('0x3b')](_0x351e78['query']['sort']);_0x77e134[_0x57b1('0x3f')]=qs[_0x57b1('0x3c')](_[_0x57b1('0x3d')](_0x351e78[_0x57b1('0x34')],_0x2c8082[_0x57b1('0x3c')]));if(_0x351e78[_0x57b1('0x34')][_0x57b1('0x3e')]){_0x77e134[_0x57b1('0x3f')]=_[_0x57b1('0x4d')](_0x77e134[_0x57b1('0x3f')],{'$or':_['map'](_0x77e134['attributes'],function(_0x33581f){var _0x4cc5ee={};_0x4cc5ee[_0x33581f]={'$like':'%'+_0x351e78[_0x57b1('0x34')][_0x57b1('0x3e')]+'%'};return _0x4cc5ee;})});}_0x77e134=_[_0x57b1('0x4d')]({},_0x77e134,_0x351e78[_0x57b1('0x40')]);return _0x1e58e2[_0x57b1('0x4b')](_0x77e134);}})[_0x57b1('0x29')](function(_0x4aa498){if(_0x4aa498){_0x4f5c42=_0x4aa498[_0x57b1('0x38')];if(!_0x351e78[_0x57b1('0x34')][_0x57b1('0x39')]('nolimit')){_0x77e134[_0x57b1('0x21')]=qs[_0x57b1('0x21')](_0x351e78[_0x57b1('0x34')][_0x57b1('0x21')]);_0x77e134[_0x57b1('0x1f')]=qs[_0x57b1('0x1f')](_0x351e78['query'][_0x57b1('0x1f')]);}return _0x1e58e2[_0x57b1('0x4b')](_0x77e134);}})[_0x57b1('0x29')](function(_0x2ad7c8){if(_0x2ad7c8){return _0x2ad7c8?{'count':_0x4f5c42,'rows':_0x2ad7c8}:null;}})[_0x57b1('0x29')](respondWithResult(_0x190682,null))[_0x57b1('0x45')](handleError(_0x190682,null));};exports[_0x57b1('0x4e')]=function(_0xf4d072,_0x203ccf,_0x3aab33){if(_0xf4d072[_0x57b1('0x4a')]['id']){delete _0xf4d072[_0x57b1('0x4a')]['id'];}return db[_0x57b1('0x31')][_0x57b1('0x4f')]({'where':{'id':_0xf4d072[_0x57b1('0x47')]['id']}})[_0x57b1('0x29')](handleEntityNotFound(_0x203ccf,null))[_0x57b1('0x29')](function(_0x24876d){if(_0x24876d){_0xf4d072[_0x57b1('0x4a')]['AccountId']=_0x24876d['id'];_0xf4d072[_0x57b1('0x4a')][_0x57b1('0x50')]=integrations['getSubjects'](_0xf4d072[_0x57b1('0x4a')][_0x57b1('0x51')],_0xf4d072[_0x57b1('0x4a')][_0x57b1('0x32')]);_0xf4d072['body'][_0x57b1('0x52')]=integrations[_0x57b1('0x53')](_0xf4d072[_0x57b1('0x4a')][_0x57b1('0x51')],_0xf4d072['body'][_0x57b1('0x32')]);return db[_0x57b1('0x4c')]['create'](_0xf4d072[_0x57b1('0x4a')],{'include':[{'model':db[_0x57b1('0x54')],'as':_0x57b1('0x50')},{'model':db['DeskField'],'as':_0x57b1('0x52')}]});}return null;})[_0x57b1('0x29')](respondWithResult(_0x203ccf,null))[_0x57b1('0x45')](handleError(_0x203ccf,null));};exports[_0x57b1('0x55')]=function(_0x404e18,_0x55de6d,_0x3fe0e6){var _0xb9ce94=[{'name':_0x57b1('0x56'),'label':_0x57b1('0x56'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x10f7ee='';return db[_0x57b1('0x31')][_0x57b1('0x4f')]({'where':{'id':_0x404e18[_0x57b1('0x47')]['id']},'attributes':['id',_0x57b1('0x57'),_0x57b1('0x58'),_0x57b1('0x59'),'password','consumerKey',_0x57b1('0x5a'),_0x57b1('0x5b'),'tokenSecret']})['then'](handleEntityNotFound(_0x55de6d,null))[_0x57b1('0x29')](function(_0x597739){if(_0x597739){_0x10f7ee=_0x597739[_0x57b1('0x57')];var _0x3a345f=_0x10f7ee['slice'](-0x1);if(_0x3a345f==='/'){_0x10f7ee=_0x10f7ee[_0x57b1('0x5c')](0x0,_0x10f7ee[_0x57b1('0x5d')](_0x3a345f));}var _0x106593={'method':'GET','uri':util[_0x57b1('0x5e')](_0x57b1('0x5f'),_0x10f7ee),'headers':{'Content-Type':_0x57b1('0x60'),'Accept':_0x57b1('0x60')},'json':!![]};if(_0x597739[_0x57b1('0x58')]===_0x57b1('0x61')){_0x106593[_0x57b1('0x62')][_0x57b1('0x63')]=util[_0x57b1('0x5e')](_0x57b1('0x64'),new Buffer(util['format'](_0x57b1('0x65'),_0x597739['username'],_0x597739['password']))[_0x57b1('0x66')]('base64'));}return rp(_0x106593)[_0x57b1('0x29')](function(_0x1b9900){return _0xb9ce94['concat'](_[_0x57b1('0x30')](_0x1b9900[_0x57b1('0x67')][_0x57b1('0x68')],function(_0x373f33){return{'id':_0x373f33[_0x57b1('0x2d')],'name':_0x373f33[_0x57b1('0x2d')],'type':_0x373f33[_0x57b1('0x32')],'active':_0x373f33['active'],'label':_0x373f33['label'],'custom':!![]};}));});}})[_0x57b1('0x29')](function(_0x1311d5){return{'count':_0x1311d5[_0x57b1('0x38')],'rows':_0x1311d5};})[_0x57b1('0x29')](respondWithResult(_0x55de6d,null))[_0x57b1('0x45')](function(_0x287d34){var _0x4b1708=_0x404e18['query']['test']?0x1f4:_0x287d34[_0x57b1('0x69')]||0x1f4;logger[_0x57b1('0x2b')](_0x57b1('0x6a'),_0x57b1('0x55'),_0x4b1708,JSON['stringify'](_0x287d34));delete _0x287d34[_0x57b1('0x2d')];if(_0x4b1708===0x191){_0x4b1708=0x190;}_0x55de6d['status'](_0x4b1708)[_0x57b1('0x2e')](_0x404e18[_0x57b1('0x34')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x287d34[_0x57b1('0x69')]}:_0x287d34);});}; \ No newline at end of file +var _0xd91a=['sort','where','pick','filters','filter','merge','type','VIRTUAL','options','DeskAccount','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','DeskConfiguration','order','map','hasOwnProperty','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','getFields','priority','remoteUri','authType','username','password','consumerKey','token','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','concat','_embedded','entries','active','test','stringify','Wrong\x20credentials','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','index','rawAttributes','fieldName','key','keys','intersection','model','fields','query','attributes','length','nolimit'];(function(_0x28b0a4,_0x2ea758){var _0x105ce6=function(_0x6df20f){while(--_0x6df20f){_0x28b0a4['push'](_0x28b0a4['shift']());}};_0x105ce6(++_0x2ea758);}(_0xd91a,0x1f0));var _0xad91=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd91a[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xad91('0x0'));var zipdir=require(_0xad91('0x1'));var jsonpatch=require(_0xad91('0x2'));var rp=require(_0xad91('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xad91('0x4'));var util=require(_0xad91('0x5'));var path=require('path');var sox=require(_0xad91('0x6'));var csv=require(_0xad91('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xad91('0x8'));var _=require(_0xad91('0x9'));var squel=require(_0xad91('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xad91('0xb'));var toCsv=require(_0xad91('0x7'));var querystring=require(_0xad91('0xc'));var Papa=require(_0xad91('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xad91('0xe'));var as=require(_0xad91('0xf'));var hardwareService=require(_0xad91('0x10'));var logger=require(_0xad91('0x11'))('api');var utils=require(_0xad91('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xad91('0x13'));var db=require('../../mysqldb')['db'];var integrations=require(_0xad91('0x14'));function respondWithStatusCode(_0x4b3cd6,_0x569d1c){_0x569d1c=_0x569d1c||0xcc;return function(_0x15117d){if(_0x15117d){return _0x4b3cd6[_0xad91('0x15')](_0x569d1c);}return _0x4b3cd6[_0xad91('0x16')](_0x569d1c)[_0xad91('0x17')]();};}function respondWithResult(_0x414a88,_0x268604){_0x268604=_0x268604||0xc8;return function(_0x38786b){if(_0x38786b){return _0x414a88[_0xad91('0x16')](_0x268604)['json'](_0x38786b);}};}function respondWithFilteredResult(_0x320dd8,_0x6f34fc){return function(_0x5b2d3b){if(_0x5b2d3b){var _0x330b33=typeof _0x6f34fc[_0xad91('0x18')]===_0xad91('0x19')&&typeof _0x6f34fc[_0xad91('0x1a')]===_0xad91('0x19');var _0x37792f=_0x5b2d3b[_0xad91('0x1b')];var _0x1eeea7=_0x330b33?0x0:_0x6f34fc[_0xad91('0x18')];var _0x21bdc6=_0x330b33?_0x5b2d3b['count']:_0x6f34fc[_0xad91('0x18')]+_0x6f34fc['limit'];var _0x42204d;if(_0x21bdc6>=_0x37792f){_0x21bdc6=_0x37792f;_0x42204d=0xc8;}else{_0x42204d=0xce;}_0x320dd8[_0xad91('0x16')](_0x42204d);return _0x320dd8[_0xad91('0x1c')](_0xad91('0x1d'),_0x1eeea7+'-'+_0x21bdc6+'/'+_0x37792f)['json'](_0x5b2d3b);}return null;};}function patchUpdates(_0x32eea6){return function(_0x6df982){try{jsonpatch[_0xad91('0x1e')](_0x6df982,_0x32eea6,!![]);}catch(_0x28f7f5){return BPromise[_0xad91('0x1f')](_0x28f7f5);}return _0x6df982['save']();};}function saveUpdates(_0x5a6829,_0x584567){return function(_0x1a16aa){if(_0x1a16aa){return _0x1a16aa['update'](_0x5a6829)[_0xad91('0x20')](function(_0x6292f1){return _0x6292f1;});}return null;};}function removeEntity(_0x25613f,_0xddda5b){return function(_0x577b5b){if(_0x577b5b){return _0x577b5b[_0xad91('0x21')]()[_0xad91('0x20')](function(){_0x25613f['status'](0xcc)[_0xad91('0x17')]();});}};}function handleEntityNotFound(_0x321c12,_0x3cf5f8){return function(_0x5512c4){if(!_0x5512c4){_0x321c12[_0xad91('0x15')](0x194);}return _0x5512c4;};}function handleError(_0x10277c,_0x4d2669){_0x4d2669=_0x4d2669||0x1f4;return function(_0x3f6ca0){logger[_0xad91('0x22')](_0x3f6ca0[_0xad91('0x23')]);if(_0x3f6ca0[_0xad91('0x24')]){delete _0x3f6ca0[_0xad91('0x24')];}_0x10277c['status'](_0x4d2669)['send'](_0x3f6ca0);};}exports[_0xad91('0x25')]=function(_0x1f05ed,_0xd94858){var _0x21261c={},_0x58c99a={},_0x2828fa={'count':0x0,'rows':[]};var _0x498794=_['map'](db['DeskAccount'][_0xad91('0x26')],function(_0x278916){return{'name':_0x278916[_0xad91('0x27')],'type':_0x278916['type'][_0xad91('0x28')]};});_0x58c99a['model']=_['map'](_0x498794,_0xad91('0x24'));_0x58c99a['query']=_[_0xad91('0x29')](_0x1f05ed['query']);_0x58c99a['filters']=_[_0xad91('0x2a')](_0x58c99a[_0xad91('0x2b')],_0x58c99a['query']);_0x21261c['attributes']=_[_0xad91('0x2a')](_0x58c99a['model'],qs[_0xad91('0x2c')](_0x1f05ed[_0xad91('0x2d')][_0xad91('0x2c')]));_0x21261c['attributes']=_0x21261c[_0xad91('0x2e')][_0xad91('0x2f')]?_0x21261c['attributes']:_0x58c99a['model'];if(!_0x1f05ed[_0xad91('0x2d')]['hasOwnProperty'](_0xad91('0x30'))){_0x21261c['limit']=qs[_0xad91('0x1a')](_0x1f05ed[_0xad91('0x2d')]['limit']);_0x21261c['offset']=qs[_0xad91('0x18')](_0x1f05ed[_0xad91('0x2d')][_0xad91('0x18')]);}_0x21261c['order']=qs[_0xad91('0x31')](_0x1f05ed[_0xad91('0x2d')][_0xad91('0x31')]);_0x21261c[_0xad91('0x32')]=qs['filters'](_[_0xad91('0x33')](_0x1f05ed[_0xad91('0x2d')],_0x58c99a[_0xad91('0x34')]),_0x498794);if(_0x1f05ed[_0xad91('0x2d')][_0xad91('0x35')]){_0x21261c['where']=_[_0xad91('0x36')](_0x21261c[_0xad91('0x32')],{'$or':_['map'](_0x498794,function(_0x4ce6a5){if(_0x4ce6a5[_0xad91('0x37')]!==_0xad91('0x38')){var _0xdb24c1={};_0xdb24c1[_0x4ce6a5[_0xad91('0x24')]]={'$like':'%'+_0x1f05ed['query'][_0xad91('0x35')]+'%'};return _0xdb24c1;}})});}_0x21261c=_[_0xad91('0x36')]({},_0x21261c,_0x1f05ed[_0xad91('0x39')]);var _0x25a15a={'where':_0x21261c[_0xad91('0x32')]};return db[_0xad91('0x3a')][_0xad91('0x1b')](_0x25a15a)[_0xad91('0x20')](function(_0xed169d){_0x2828fa[_0xad91('0x1b')]=_0xed169d;if(_0x1f05ed[_0xad91('0x2d')][_0xad91('0x3b')]){_0x21261c[_0xad91('0x3c')]=[{'all':!![]}];}return db[_0xad91('0x3a')][_0xad91('0x3d')](_0x21261c);})[_0xad91('0x20')](function(_0x24bcdc){_0x2828fa[_0xad91('0x3e')]=_0x24bcdc;return _0x2828fa;})[_0xad91('0x20')](respondWithFilteredResult(_0xd94858,_0x21261c))[_0xad91('0x3f')](handleError(_0xd94858,null));};exports[_0xad91('0x40')]=function(_0x729f,_0x41eec5){var _0x1ef723={'raw':![],'where':{'id':_0x729f[_0xad91('0x41')]['id']}},_0x41add3={};_0x41add3[_0xad91('0x2b')]=_[_0xad91('0x29')](db[_0xad91('0x3a')]['rawAttributes']);_0x41add3['query']=_[_0xad91('0x29')](_0x729f['query']);_0x41add3[_0xad91('0x34')]=_['intersection'](_0x41add3[_0xad91('0x2b')],_0x41add3[_0xad91('0x2d')]);_0x1ef723[_0xad91('0x2e')]=_[_0xad91('0x2a')](_0x41add3['model'],qs['fields'](_0x729f['query'][_0xad91('0x2c')]));_0x1ef723[_0xad91('0x2e')]=_0x1ef723[_0xad91('0x2e')]['length']?_0x1ef723[_0xad91('0x2e')]:_0x41add3[_0xad91('0x2b')];if(_0x729f[_0xad91('0x2d')][_0xad91('0x3b')]){_0x1ef723['include']=[{'all':!![]}];}_0x1ef723=_[_0xad91('0x36')]({},_0x1ef723,_0x729f[_0xad91('0x39')]);return db[_0xad91('0x3a')][_0xad91('0x42')](_0x1ef723)[_0xad91('0x20')](handleEntityNotFound(_0x41eec5,null))[_0xad91('0x20')](respondWithResult(_0x41eec5,null))[_0xad91('0x3f')](handleError(_0x41eec5,null));};exports[_0xad91('0x43')]=function(_0x1aef91,_0x34456d){return db[_0xad91('0x3a')]['create'](_0x1aef91[_0xad91('0x44')],{})[_0xad91('0x20')](respondWithResult(_0x34456d,0xc9))['catch'](handleError(_0x34456d,null));};exports['update']=function(_0x3ccaed,_0x473fd6){if(_0x3ccaed[_0xad91('0x44')]['id']){delete _0x3ccaed['body']['id'];}return db['DeskAccount'][_0xad91('0x42')]({'where':{'id':_0x3ccaed[_0xad91('0x41')]['id']}})[_0xad91('0x20')](handleEntityNotFound(_0x473fd6,null))[_0xad91('0x20')](saveUpdates(_0x3ccaed[_0xad91('0x44')],null))[_0xad91('0x20')](respondWithResult(_0x473fd6,null))[_0xad91('0x3f')](handleError(_0x473fd6,null));};exports[_0xad91('0x21')]=function(_0x1fc17f,_0x3c7cf5){return db[_0xad91('0x3a')][_0xad91('0x42')]({'where':{'id':_0x1fc17f['params']['id']}})[_0xad91('0x20')](handleEntityNotFound(_0x3c7cf5,null))[_0xad91('0x20')](removeEntity(_0x3c7cf5,null))[_0xad91('0x3f')](handleError(_0x3c7cf5,null));};exports[_0xad91('0x45')]=function(_0x43914b,_0x1ab8a1,_0x32b0e7){var _0x438e53={};var _0x42ea35={};var _0x1ce8c4;var _0x5c5426;return db[_0xad91('0x3a')][_0xad91('0x46')]({'where':{'id':_0x43914b['params']['id']}})[_0xad91('0x20')](handleEntityNotFound(_0x1ab8a1,null))[_0xad91('0x20')](function(_0x336a76){if(_0x336a76){_0x1ce8c4=_0x336a76;_0x42ea35[_0xad91('0x2b')]=_[_0xad91('0x29')](db[_0xad91('0x47')][_0xad91('0x26')]);_0x42ea35[_0xad91('0x2d')]=_[_0xad91('0x29')](_0x43914b[_0xad91('0x2d')]);_0x42ea35[_0xad91('0x34')]=_[_0xad91('0x2a')](_0x42ea35['model'],_0x42ea35[_0xad91('0x2d')]);_0x438e53['attributes']=_[_0xad91('0x2a')](_0x42ea35['model'],qs[_0xad91('0x2c')](_0x43914b[_0xad91('0x2d')]['fields']));_0x438e53[_0xad91('0x2e')]=_0x438e53['attributes']['length']?_0x438e53[_0xad91('0x2e')]:_0x42ea35[_0xad91('0x2b')];_0x438e53[_0xad91('0x48')]=qs[_0xad91('0x31')](_0x43914b[_0xad91('0x2d')]['sort']);_0x438e53[_0xad91('0x32')]=qs['filters'](_[_0xad91('0x33')](_0x43914b['query'],_0x42ea35['filters']));if(_0x43914b['query']['filter']){_0x438e53[_0xad91('0x32')]=_[_0xad91('0x36')](_0x438e53[_0xad91('0x32')],{'$or':_[_0xad91('0x49')](_0x438e53[_0xad91('0x2e')],function(_0x573e0f){var _0x71196f={};_0x71196f[_0x573e0f]={'$like':'%'+_0x43914b[_0xad91('0x2d')][_0xad91('0x35')]+'%'};return _0x71196f;})});}_0x438e53=_[_0xad91('0x36')]({},_0x438e53,_0x43914b[_0xad91('0x39')]);return _0x1ce8c4[_0xad91('0x45')](_0x438e53);}})['then'](function(_0x432ac4){if(_0x432ac4){_0x5c5426=_0x432ac4['length'];if(!_0x43914b[_0xad91('0x2d')][_0xad91('0x4a')](_0xad91('0x30'))){_0x438e53[_0xad91('0x1a')]=qs[_0xad91('0x1a')](_0x43914b[_0xad91('0x2d')][_0xad91('0x1a')]);_0x438e53[_0xad91('0x18')]=qs[_0xad91('0x18')](_0x43914b['query'][_0xad91('0x18')]);}return _0x1ce8c4[_0xad91('0x45')](_0x438e53);}})[_0xad91('0x20')](function(_0x961f1){if(_0x961f1){return _0x961f1?{'count':_0x5c5426,'rows':_0x961f1}:null;}})[_0xad91('0x20')](respondWithResult(_0x1ab8a1,null))[_0xad91('0x3f')](handleError(_0x1ab8a1,null));};exports['addConfiguration']=function(_0x211b92,_0x18600c,_0x222b06){if(_0x211b92[_0xad91('0x44')]['id']){delete _0x211b92[_0xad91('0x44')]['id'];}return db['DeskAccount'][_0xad91('0x46')]({'where':{'id':_0x211b92[_0xad91('0x41')]['id']}})[_0xad91('0x20')](handleEntityNotFound(_0x18600c,null))[_0xad91('0x20')](function(_0x4822d9){if(_0x4822d9){_0x211b92[_0xad91('0x44')][_0xad91('0x4b')]=_0x4822d9['id'];_0x211b92[_0xad91('0x44')][_0xad91('0x4c')]=integrations[_0xad91('0x4d')](_0x211b92[_0xad91('0x44')][_0xad91('0x4e')],_0x211b92[_0xad91('0x44')][_0xad91('0x37')]);_0x211b92[_0xad91('0x44')][_0xad91('0x4f')]=integrations[_0xad91('0x50')](_0x211b92['body'][_0xad91('0x4e')],_0x211b92[_0xad91('0x44')][_0xad91('0x37')]);return db['DeskConfiguration'][_0xad91('0x43')](_0x211b92[_0xad91('0x44')],{'include':[{'model':db['DeskField'],'as':_0xad91('0x4c')},{'model':db['DeskField'],'as':_0xad91('0x4f')}]});}return null;})[_0xad91('0x20')](respondWithResult(_0x18600c,null))[_0xad91('0x3f')](handleError(_0x18600c,null));};exports[_0xad91('0x51')]=function(_0xf7daa0,_0x110120,_0x534545){var _0x10dad3=[{'name':_0xad91('0x52'),'label':_0xad91('0x52'),'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 _0x2bcb8='';return db[_0xad91('0x3a')][_0xad91('0x46')]({'where':{'id':_0xf7daa0['params']['id']},'attributes':['id',_0xad91('0x53'),_0xad91('0x54'),_0xad91('0x55'),_0xad91('0x56'),_0xad91('0x57'),'consumerSecret',_0xad91('0x58'),'tokenSecret']})[_0xad91('0x20')](handleEntityNotFound(_0x110120,null))[_0xad91('0x20')](function(_0x26b606){if(_0x26b606){_0x2bcb8=_0x26b606[_0xad91('0x53')];var _0x103f69=_0x2bcb8[_0xad91('0x59')](-0x1);if(_0x103f69==='/'){_0x2bcb8=_0x2bcb8[_0xad91('0x5a')](0x0,_0x2bcb8[_0xad91('0x5b')](_0x103f69));}var _0x4a06d3={'method':_0xad91('0x5c'),'uri':util[_0xad91('0x5d')](_0xad91('0x5e'),_0x2bcb8),'headers':{'Content-Type':_0xad91('0x5f'),'Accept':_0xad91('0x5f')},'json':!![]};if(_0x26b606[_0xad91('0x54')]===_0xad91('0x60')){_0x4a06d3[_0xad91('0x61')][_0xad91('0x62')]=util[_0xad91('0x5d')](_0xad91('0x63'),new Buffer(util[_0xad91('0x5d')](_0xad91('0x64'),_0x26b606[_0xad91('0x55')],_0x26b606[_0xad91('0x56')]))['toString']('base64'));}return rp(_0x4a06d3)[_0xad91('0x20')](function(_0x28cf85){return _0x10dad3[_0xad91('0x65')](_[_0xad91('0x49')](_0x28cf85[_0xad91('0x66')][_0xad91('0x67')],function(_0x32cfde){return{'id':_0x32cfde[_0xad91('0x24')],'name':_0x32cfde['name'],'type':_0x32cfde[_0xad91('0x37')],'active':_0x32cfde[_0xad91('0x68')],'label':_0x32cfde['label'],'custom':!![]};}));});}})[_0xad91('0x20')](function(_0x2328da){return{'count':_0x2328da[_0xad91('0x2f')],'rows':_0x2328da};})[_0xad91('0x20')](respondWithResult(_0x110120,null))[_0xad91('0x3f')](function(_0x578930){var _0x31858d=_0xf7daa0[_0xad91('0x2d')][_0xad91('0x69')]?0x1f4:_0x578930['statusCode']||0x1f4;logger[_0xad91('0x22')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x31858d,JSON[_0xad91('0x6a')](_0x578930));delete _0x578930[_0xad91('0x24')];if(_0x31858d===0x191){_0x31858d=0x190;}_0x110120[_0xad91('0x16')](_0x31858d)['send'](_0xf7daa0[_0xad91('0x2d')][_0xad91('0x69')]?{'message':_0xad91('0x6b'),'statusCode':_0x578930[_0xad91('0x6c')]}:_0x578930);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 280440c..d4a0753 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 _0xa8e1=['../../components/integrations/configuration','define','DeskAccount','int_desk_accounts','../../config/logger','api','bluebird','request-promise','path','./intDeskAccount.attributes'];(function(_0x2bd7ec,_0x12be21){var _0x322332=function(_0x53a105){while(--_0x53a105){_0x2bd7ec['push'](_0x2bd7ec['shift']());}};_0x322332(++_0x12be21);}(_0xa8e1,0x112));var _0x1a8e=function(_0x324e86,_0x81b1cb){_0x324e86=_0x324e86-0x0;var _0x592846=_0xa8e1[_0x324e86];return _0x592846;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1a8e('0x0'))(_0x1a8e('0x1'));var moment=require('moment');var BPromise=require(_0x1a8e('0x2'));var rp=require(_0x1a8e('0x3'));var fs=require('fs');var path=require(_0x1a8e('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1a8e('0x5'));var integrations=require(_0x1a8e('0x6'));module['exports']=function(_0x275088,_0x25afde){return _0x275088[_0x1a8e('0x7')](_0x1a8e('0x8'),attributes,{'tableName':_0x1a8e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a71=['../../config/logger','api','moment','bluebird','request-promise','path','./intDeskAccount.attributes','../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts','lodash','util'];(function(_0x5d8afd,_0xd7f769){var _0x336c61=function(_0x539e58){while(--_0x539e58){_0x5d8afd['push'](_0x5d8afd['shift']());}};_0x336c61(++_0xd7f769);}(_0x1a71,0xa7));var _0x11a7=function(_0x47707e,_0x58c7dc){_0x47707e=_0x47707e-0x0;var _0x37b727=_0x1a71[_0x47707e];return _0x37b727;};'use strict';var _=require(_0x11a7('0x0'));var util=require(_0x11a7('0x1'));var logger=require(_0x11a7('0x2'))(_0x11a7('0x3'));var moment=require(_0x11a7('0x4'));var BPromise=require(_0x11a7('0x5'));var rp=require(_0x11a7('0x6'));var fs=require('fs');var path=require(_0x11a7('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x11a7('0x8'));var integrations=require(_0x11a7('0x9'));module[_0x11a7('0xa')]=function(_0x5ed31b,_0x5e2d33){return _0x5ed31b['define'](_0x11a7('0xb'),attributes,{'tableName':_0x11a7('0xc'),'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 4bf9226..6da9e86 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 _0xb016=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','DeskAccount,\x20%s,\x20%s','message','GetDeskAccount','DeskAccount','raw','options','where','attributes','limit','include','model','stringify','catch','ShowDeskAccount','map','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4e0afa,_0x1bc833){var _0x3fe942=function(_0xa97961){while(--_0xa97961){_0x4e0afa['push'](_0x4e0afa['shift']());}};_0x3fe942(++_0x1bc833);}(_0xb016,0x191));var _0x6b01=function(_0xf2ddb4,_0x9589bf){_0xf2ddb4=_0xf2ddb4-0x0;var _0x2f2528=_0xb016[_0xf2ddb4];return _0x2f2528;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var moment=require(_0x6b01('0x2'));var BPromise=require(_0x6b01('0x3'));var rs=require(_0x6b01('0x4'));var fs=require('fs');var Redis=require(_0x6b01('0x5'));var db=require(_0x6b01('0x6'))['db'];var utils=require(_0x6b01('0x7'));var logger=require(_0x6b01('0x8'))(_0x6b01('0x9'));var config=require(_0x6b01('0xa'));var jayson=require(_0x6b01('0xb'));var client=jayson[_0x6b01('0xc')][_0x6b01('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5b18b6,_0x370e80,_0x5cfd1d){return new BPromise(function(_0x474e71,_0x1f291e){return client[_0x6b01('0xe')](_0x5b18b6,_0x5cfd1d)[_0x6b01('0xf')](function(_0x47632b){logger[_0x6b01('0x10')]('DeskAccount,\x20%s,\x20%s',_0x370e80,'request\x20sent');logger[_0x6b01('0x11')](_0x6b01('0x12'),_0x370e80,_0x6b01('0x13'),JSON['stringify'](_0x47632b));if(_0x47632b['error']){if(_0x47632b[_0x6b01('0x14')][_0x6b01('0x15')]===0x1f4){logger[_0x6b01('0x14')](_0x6b01('0x16'),_0x370e80,_0x47632b[_0x6b01('0x14')][_0x6b01('0x17')]);return _0x1f291e(_0x47632b[_0x6b01('0x14')][_0x6b01('0x17')]);}logger[_0x6b01('0x14')](_0x6b01('0x16'),_0x370e80,_0x47632b[_0x6b01('0x14')]['message']);return _0x474e71(_0x47632b[_0x6b01('0x14')][_0x6b01('0x17')]);}else{logger['info'](_0x6b01('0x16'),_0x370e80,_0x6b01('0x13'));_0x474e71(_0x47632b['result'][_0x6b01('0x17')]);}})['catch'](function(_0xc6e2de){logger[_0x6b01('0x14')](_0x6b01('0x16'),_0x370e80,_0xc6e2de);_0x1f291e(_0xc6e2de);});});}exports[_0x6b01('0x18')]=function(_0x40acd1){var _0x2a45d2=this;return new Promise(function(_0x36755c,_0x38c804){return db[_0x6b01('0x19')]['findAll']({'raw':_0x40acd1['options']?_0x40acd1['options'][_0x6b01('0x1a')]===undefined?!![]:![]:!![],'where':_0x40acd1[_0x6b01('0x1b')]?_0x40acd1['options'][_0x6b01('0x1c')]||null:null,'attributes':_0x40acd1[_0x6b01('0x1b')]?_0x40acd1[_0x6b01('0x1b')][_0x6b01('0x1d')]||null:null,'limit':_0x40acd1[_0x6b01('0x1b')]?_0x40acd1['options'][_0x6b01('0x1e')]||null:null,'include':_0x40acd1[_0x6b01('0x1b')]?_0x40acd1[_0x6b01('0x1b')][_0x6b01('0x1f')]?_['map'](_0x40acd1[_0x6b01('0x1b')][_0x6b01('0x1f')],function(_0x3211c9){return{'model':db[_0x3211c9['model']],'as':_0x3211c9['as'],'attributes':_0x3211c9['attributes'],'include':_0x3211c9[_0x6b01('0x1f')]?_['map'](_0x3211c9[_0x6b01('0x1f')],function(_0x50d1df){return{'model':db[_0x50d1df[_0x6b01('0x20')]],'as':_0x50d1df['as'],'attributes':_0x50d1df[_0x6b01('0x1d')],'include':_0x50d1df[_0x6b01('0x1f')]?_['map'](_0x50d1df['include'],function(_0x5e2c3c){return{'model':db[_0x5e2c3c[_0x6b01('0x20')]],'as':_0x5e2c3c['as'],'attributes':_0x5e2c3c['attributes']};}):[]};}):[]};}):[]:[]})[_0x6b01('0xf')](function(_0x11ce78){logger['info'](_0x6b01('0x18'),_0x40acd1);logger['debug'](_0x6b01('0x18'),_0x40acd1,JSON[_0x6b01('0x21')](_0x11ce78));_0x36755c(_0x11ce78);})[_0x6b01('0x22')](function(_0x47df63){logger['error'](_0x6b01('0x18'),_0x47df63[_0x6b01('0x17')],_0x40acd1);_0x38c804(_0x2a45d2[_0x6b01('0x14')](0x1f4,_0x47df63[_0x6b01('0x17')]));});});};exports[_0x6b01('0x23')]=function(_0x37cb4a){var _0x3f5842=this;return new Promise(function(_0x33b953,_0xa210f1){return db[_0x6b01('0x19')]['find']({'raw':_0x37cb4a[_0x6b01('0x1b')]?_0x37cb4a[_0x6b01('0x1b')][_0x6b01('0x1a')]===undefined?!![]:![]:!![],'where':_0x37cb4a[_0x6b01('0x1b')]?_0x37cb4a['options'][_0x6b01('0x1c')]||null:null,'attributes':_0x37cb4a[_0x6b01('0x1b')]?_0x37cb4a[_0x6b01('0x1b')][_0x6b01('0x1d')]||null:null,'include':_0x37cb4a[_0x6b01('0x1b')]?_0x37cb4a['options'][_0x6b01('0x1f')]?_[_0x6b01('0x24')](_0x37cb4a[_0x6b01('0x1b')][_0x6b01('0x1f')],function(_0x4ded08){return{'model':db[_0x4ded08[_0x6b01('0x20')]],'as':_0x4ded08['as'],'attributes':_0x4ded08[_0x6b01('0x1d')],'include':_0x4ded08['include']?_[_0x6b01('0x24')](_0x4ded08['include'],function(_0x58ae60){return{'model':db[_0x58ae60['model']],'as':_0x58ae60['as'],'attributes':_0x58ae60[_0x6b01('0x1d')],'include':_0x58ae60[_0x6b01('0x1f')]?_[_0x6b01('0x24')](_0x58ae60['include'],function(_0x492a29){return{'model':db[_0x492a29[_0x6b01('0x20')]],'as':_0x492a29['as'],'attributes':_0x492a29[_0x6b01('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6b01('0xf')](function(_0x59fc04){logger[_0x6b01('0x10')](_0x6b01('0x23'),_0x37cb4a);logger[_0x6b01('0x11')](_0x6b01('0x23'),_0x37cb4a,JSON[_0x6b01('0x21')](_0x59fc04));_0x33b953(_0x59fc04);})[_0x6b01('0x22')](function(_0x486711){logger['error'](_0x6b01('0x23'),_0x486711[_0x6b01('0x17')],_0x37cb4a);_0xa210f1(_0x3f5842[_0x6b01('0x14')](0x1f4,_0x486711[_0x6b01('0x17')]));});});}; \ No newline at end of file +var _0xdadd=['stringify','error','code','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','map','model','include','find','ShowDeskAccount','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x989619,_0x41b8c3){var _0x288239=function(_0x290ea4){while(--_0x290ea4){_0x989619['push'](_0x989619['shift']());}};_0x288239(++_0x41b8c3);}(_0xdadd,0x17d));var _0xddad=function(_0x37d4ac,_0x4e47d6){_0x37d4ac=_0x37d4ac-0x0;var _0x5e727a=_0xdadd[_0x37d4ac];return _0x5e727a;};'use strict';var _=require(_0xddad('0x0'));var util=require('util');var moment=require(_0xddad('0x1'));var BPromise=require('bluebird');var rs=require(_0xddad('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xddad('0x3'))['db'];var utils=require(_0xddad('0x4'));var logger=require('../../config/logger')(_0xddad('0x5'));var config=require('../../config/environment');var jayson=require(_0xddad('0x6'));var client=jayson[_0xddad('0x7')][_0xddad('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x155b4f,_0xd6248,_0x2ae6a3){return new BPromise(function(_0x234369,_0x315877){return client['request'](_0x155b4f,_0x2ae6a3)[_0xddad('0x9')](function(_0x5e0b7a){logger[_0xddad('0xa')](_0xddad('0xb'),_0xd6248,_0xddad('0xc'));logger[_0xddad('0xd')](_0xddad('0xe'),_0xd6248,'request\x20sent',JSON[_0xddad('0xf')](_0x5e0b7a));if(_0x5e0b7a[_0xddad('0x10')]){if(_0x5e0b7a[_0xddad('0x10')][_0xddad('0x11')]===0x1f4){logger[_0xddad('0x10')](_0xddad('0xb'),_0xd6248,_0x5e0b7a[_0xddad('0x10')][_0xddad('0x12')]);return _0x315877(_0x5e0b7a['error'][_0xddad('0x12')]);}logger[_0xddad('0x10')](_0xddad('0xb'),_0xd6248,_0x5e0b7a[_0xddad('0x10')]['message']);return _0x234369(_0x5e0b7a[_0xddad('0x10')][_0xddad('0x12')]);}else{logger[_0xddad('0xa')](_0xddad('0xb'),_0xd6248,_0xddad('0xc'));_0x234369(_0x5e0b7a[_0xddad('0x13')][_0xddad('0x12')]);}})[_0xddad('0x14')](function(_0x27b6b2){logger[_0xddad('0x10')]('DeskAccount,\x20%s,\x20%s',_0xd6248,_0x27b6b2);_0x315877(_0x27b6b2);});});}exports[_0xddad('0x15')]=function(_0x4342ff){var _0x1bed10=this;return new Promise(function(_0x5f39f2,_0x563074){return db[_0xddad('0x16')][_0xddad('0x17')]({'raw':_0x4342ff[_0xddad('0x18')]?_0x4342ff[_0xddad('0x18')][_0xddad('0x19')]===undefined?!![]:![]:!![],'where':_0x4342ff[_0xddad('0x18')]?_0x4342ff[_0xddad('0x18')][_0xddad('0x1a')]||null:null,'attributes':_0x4342ff[_0xddad('0x18')]?_0x4342ff[_0xddad('0x18')][_0xddad('0x1b')]||null:null,'limit':_0x4342ff['options']?_0x4342ff[_0xddad('0x18')]['limit']||null:null,'include':_0x4342ff[_0xddad('0x18')]?_0x4342ff[_0xddad('0x18')]['include']?_[_0xddad('0x1c')](_0x4342ff['options']['include'],function(_0x45e70b){return{'model':db[_0x45e70b[_0xddad('0x1d')]],'as':_0x45e70b['as'],'attributes':_0x45e70b[_0xddad('0x1b')],'include':_0x45e70b[_0xddad('0x1e')]?_['map'](_0x45e70b[_0xddad('0x1e')],function(_0x18d571){return{'model':db[_0x18d571['model']],'as':_0x18d571['as'],'attributes':_0x18d571[_0xddad('0x1b')],'include':_0x18d571[_0xddad('0x1e')]?_[_0xddad('0x1c')](_0x18d571['include'],function(_0x5801a8){return{'model':db[_0x5801a8[_0xddad('0x1d')]],'as':_0x5801a8['as'],'attributes':_0x5801a8[_0xddad('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xddad('0x9')](function(_0x20dc97){logger['info']('GetDeskAccount',_0x4342ff);logger['debug'](_0xddad('0x15'),_0x4342ff,JSON['stringify'](_0x20dc97));_0x5f39f2(_0x20dc97);})[_0xddad('0x14')](function(_0x12f2fd){logger[_0xddad('0x10')](_0xddad('0x15'),_0x12f2fd[_0xddad('0x12')],_0x4342ff);_0x563074(_0x1bed10[_0xddad('0x10')](0x1f4,_0x12f2fd[_0xddad('0x12')]));});});};exports['ShowDeskAccount']=function(_0x2fda6d){var _0x21ef91=this;return new Promise(function(_0x24edfe,_0x1e3a9d){return db[_0xddad('0x16')][_0xddad('0x1f')]({'raw':_0x2fda6d['options']?_0x2fda6d['options'][_0xddad('0x19')]===undefined?!![]:![]:!![],'where':_0x2fda6d[_0xddad('0x18')]?_0x2fda6d['options'][_0xddad('0x1a')]||null:null,'attributes':_0x2fda6d[_0xddad('0x18')]?_0x2fda6d[_0xddad('0x18')][_0xddad('0x1b')]||null:null,'include':_0x2fda6d[_0xddad('0x18')]?_0x2fda6d['options'][_0xddad('0x1e')]?_[_0xddad('0x1c')](_0x2fda6d[_0xddad('0x18')]['include'],function(_0x397d2d){return{'model':db[_0x397d2d['model']],'as':_0x397d2d['as'],'attributes':_0x397d2d['attributes'],'include':_0x397d2d[_0xddad('0x1e')]?_[_0xddad('0x1c')](_0x397d2d[_0xddad('0x1e')],function(_0x1311a3){return{'model':db[_0x1311a3['model']],'as':_0x1311a3['as'],'attributes':_0x1311a3[_0xddad('0x1b')],'include':_0x1311a3[_0xddad('0x1e')]?_[_0xddad('0x1c')](_0x1311a3[_0xddad('0x1e')],function(_0x551b59){return{'model':db[_0x551b59['model']],'as':_0x551b59['as'],'attributes':_0x551b59['attributes']};}):[]};}):[]};}):[]:[]})[_0xddad('0x9')](function(_0x30cf6d){logger[_0xddad('0xa')](_0xddad('0x20'),_0x2fda6d);logger[_0xddad('0xd')](_0xddad('0x20'),_0x2fda6d,JSON['stringify'](_0x30cf6d));_0x24edfe(_0x30cf6d);})[_0xddad('0x14')](function(_0x3b4339){logger[_0xddad('0x10')](_0xddad('0x20'),_0x3b4339[_0xddad('0x12')],_0x2fda6d);_0x1e3a9d(_0x21ef91['error'](0x1f4,_0x3b4339[_0xddad('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 9f114a9..2d693fe 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0xc2c41e,_0xabbd5a){var _0x2bbdad=function(_0x1ca48c){while(--_0x1ca48c){_0xc2c41e['push'](_0xc2c41e['shift']());}};_0x2bbdad(++_0xabbd5a);}(_0xedd9,0xfc));var _0x9edd=function(_0x2f60cb,_0x83c2d3){_0x2f60cb=_0x2f60cb-0x0;var _0x2da300=_0xedd9[_0x2f60cb];return _0x2da300;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file +var _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x17f5cb,_0x3139a9){var _0x539bf5=function(_0x4d4c65){while(--_0x4d4c65){_0x17f5cb['push'](_0x17f5cb['shift']());}};_0x539bf5(++_0x3139a9);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 914d2ff..2dd7aab 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 _0xeac5=['STRING'];(function(_0x5186e8,_0x1e70d6){var _0x98aa89=function(_0x568d17){while(--_0x568d17){_0x5186e8['push'](_0x5186e8['shift']());}};_0x98aa89(++_0x1e70d6);}(_0xeac5,0x117));var _0x5eac=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0xeac5[_0x363ef8];return _0x148822;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5eac('0x0')]},'description':{'type':Sequelize[_0x5eac('0x0')]}}; \ No newline at end of file +var _0xff8c=['exports','STRING','sequelize'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0xff8c,0x107));var _0xcff8=function(_0x115f14,_0x1242e8){_0x115f14=_0x115f14-0x0;var _0x1785ee=_0xff8c[_0x115f14];return _0x1785ee;};'use strict';var Sequelize=require(_0xcff8('0x0'));module[_0xcff8('0x1')]={'name':{'type':Sequelize[_0xcff8('0x2')]},'description':{'type':Sequelize[_0xcff8('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index a88615e..59c2374 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 _0x25be=['path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','offset','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','DeskConfiguration','findAll','rows','show','params','find','catch','create','body','getFields','findOne','DeskField','length','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x25be,0xa5));var _0xe25b=function(_0x108b7a,_0x341dc2){_0x108b7a=_0x108b7a-0x0;var _0x44d69d=_0x25be[_0x108b7a];return _0x44d69d;};'use strict';var emlformat=require(_0xe25b('0x0'));var rimraf=require(_0xe25b('0x1'));var zipdir=require(_0xe25b('0x2'));var jsonpatch=require(_0xe25b('0x3'));var rp=require(_0xe25b('0x4'));var moment=require(_0xe25b('0x5'));var BPromise=require(_0xe25b('0x6'));var Mustache=require(_0xe25b('0x7'));var util=require(_0xe25b('0x8'));var path=require(_0xe25b('0x9'));var sox=require('sox');var csv=require(_0xe25b('0xa'));var ejs=require(_0xe25b('0xb'));var fs=require('fs');var fs_extra=require(_0xe25b('0xc'));var _=require('lodash');var squel=require(_0xe25b('0xd'));var crypto=require('crypto');var jsforce=require(_0xe25b('0xe'));var deskjs=require(_0xe25b('0xf'));var toCsv=require(_0xe25b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe25b('0x10'));var authService=require(_0xe25b('0x11'));var qs=require(_0xe25b('0x12'));var as=require(_0xe25b('0x13'));var hardwareService=require(_0xe25b('0x14'));var logger=require('../../config/logger')(_0xe25b('0x15'));var utils=require(_0xe25b('0x16'));var config=require(_0xe25b('0x17'));var licenseUtil=require(_0xe25b('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42d058,_0x439163){_0x439163=_0x439163||0xcc;return function(_0x25c3a5){if(_0x25c3a5){return _0x42d058[_0xe25b('0x19')](_0x439163);}return _0x42d058[_0xe25b('0x1a')](_0x439163)[_0xe25b('0x1b')]();};}function respondWithResult(_0x5d93ae,_0xa19b0c){_0xa19b0c=_0xa19b0c||0xc8;return function(_0x41940e){if(_0x41940e){return _0x5d93ae[_0xe25b('0x1a')](_0xa19b0c)[_0xe25b('0x1c')](_0x41940e);}};}function respondWithFilteredResult(_0x442131,_0x236fa6){return function(_0x683e5a){if(_0x683e5a){var _0x5983d4=typeof _0x236fa6['offset']==='undefined'&&typeof _0x236fa6[_0xe25b('0x1d')]===_0xe25b('0x1e');var _0x905447=_0x683e5a['count'];var _0x51d6db=_0x5983d4?0x0:_0x236fa6[_0xe25b('0x1f')];var _0x1b5722=_0x5983d4?_0x683e5a[_0xe25b('0x20')]:_0x236fa6['offset']+_0x236fa6[_0xe25b('0x1d')];var _0x32d5c8;if(_0x1b5722>=_0x905447){_0x1b5722=_0x905447;_0x32d5c8=0xc8;}else{_0x32d5c8=0xce;}_0x442131[_0xe25b('0x1a')](_0x32d5c8);return _0x442131['set'](_0xe25b('0x21'),_0x51d6db+'-'+_0x1b5722+'/'+_0x905447)[_0xe25b('0x1c')](_0x683e5a);}return null;};}function patchUpdates(_0x1a943f){return function(_0x52eb26){try{jsonpatch[_0xe25b('0x22')](_0x52eb26,_0x1a943f,!![]);}catch(_0x3e9b29){return BPromise[_0xe25b('0x23')](_0x3e9b29);}return _0x52eb26[_0xe25b('0x24')]();};}function saveUpdates(_0x5cb553,_0x5f0c43){return function(_0x58513c){if(_0x58513c){return _0x58513c[_0xe25b('0x25')](_0x5cb553)[_0xe25b('0x26')](function(_0x86d884){return _0x86d884;});}return null;};}function removeEntity(_0x2d6a8f,_0x23bbc4){return function(_0xe2f690){if(_0xe2f690){return _0xe2f690[_0xe25b('0x27')]()[_0xe25b('0x26')](function(){_0x2d6a8f['status'](0xcc)[_0xe25b('0x1b')]();});}};}function handleEntityNotFound(_0x1f0e49,_0x187751){return function(_0x295ded){if(!_0x295ded){_0x1f0e49[_0xe25b('0x19')](0x194);}return _0x295ded;};}function handleError(_0x5295d4,_0xaf22a1){_0xaf22a1=_0xaf22a1||0x1f4;return function(_0x555ece){logger[_0xe25b('0x28')](_0x555ece[_0xe25b('0x29')]);if(_0x555ece['name']){delete _0x555ece[_0xe25b('0x2a')];}_0x5295d4[_0xe25b('0x1a')](_0xaf22a1)['send'](_0x555ece);};}exports[_0xe25b('0x2b')]=function(_0x5b4fd0,_0x24dbec){var _0x4f78d4={},_0x2ba53e={},_0x5a2851={'count':0x0,'rows':[]};var _0x27eb3b=_[_0xe25b('0x2c')](db['DeskConfiguration'][_0xe25b('0x2d')],function(_0x1c948a){return{'name':_0x1c948a[_0xe25b('0x2e')],'type':_0x1c948a[_0xe25b('0x2f')][_0xe25b('0x30')]};});_0x2ba53e[_0xe25b('0x31')]=_[_0xe25b('0x2c')](_0x27eb3b,_0xe25b('0x2a'));_0x2ba53e[_0xe25b('0x32')]=_[_0xe25b('0x33')](_0x5b4fd0['query']);_0x2ba53e['filters']=_[_0xe25b('0x34')](_0x2ba53e[_0xe25b('0x31')],_0x2ba53e['query']);_0x4f78d4['attributes']=_[_0xe25b('0x34')](_0x2ba53e['model'],qs[_0xe25b('0x35')](_0x5b4fd0[_0xe25b('0x32')][_0xe25b('0x35')]));_0x4f78d4['attributes']=_0x4f78d4[_0xe25b('0x36')]['length']?_0x4f78d4[_0xe25b('0x36')]:_0x2ba53e['model'];if(!_0x5b4fd0[_0xe25b('0x32')][_0xe25b('0x37')](_0xe25b('0x38'))){_0x4f78d4[_0xe25b('0x1d')]=qs[_0xe25b('0x1d')](_0x5b4fd0['query']['limit']);_0x4f78d4[_0xe25b('0x1f')]=qs['offset'](_0x5b4fd0[_0xe25b('0x32')][_0xe25b('0x1f')]);}_0x4f78d4[_0xe25b('0x39')]=qs[_0xe25b('0x3a')](_0x5b4fd0[_0xe25b('0x32')][_0xe25b('0x3a')]);_0x4f78d4[_0xe25b('0x3b')]=qs[_0xe25b('0x3c')](_[_0xe25b('0x3d')](_0x5b4fd0[_0xe25b('0x32')],_0x2ba53e[_0xe25b('0x3c')]),_0x27eb3b);if(_0x5b4fd0[_0xe25b('0x32')][_0xe25b('0x3e')]){_0x4f78d4['where']=_[_0xe25b('0x3f')](_0x4f78d4[_0xe25b('0x3b')],{'$or':_['map'](_0x27eb3b,function(_0x144f44){if(_0x144f44[_0xe25b('0x2f')]!==_0xe25b('0x40')){var _0x33d3f4={};_0x33d3f4[_0x144f44[_0xe25b('0x2a')]]={'$like':'%'+_0x5b4fd0[_0xe25b('0x32')][_0xe25b('0x3e')]+'%'};return _0x33d3f4;}})});}_0x4f78d4=_[_0xe25b('0x3f')]({},_0x4f78d4,_0x5b4fd0[_0xe25b('0x41')]);var _0x4ef84a={'where':_0x4f78d4[_0xe25b('0x3b')]};return db['DeskConfiguration'][_0xe25b('0x20')](_0x4ef84a)['then'](function(_0x5c4d5f){_0x5a2851[_0xe25b('0x20')]=_0x5c4d5f;if(_0x5b4fd0[_0xe25b('0x32')][_0xe25b('0x42')]){_0x4f78d4[_0xe25b('0x43')]=[{'all':!![]}];}return db[_0xe25b('0x44')][_0xe25b('0x45')](_0x4f78d4);})['then'](function(_0x47c669){_0x5a2851[_0xe25b('0x46')]=_0x47c669;return _0x5a2851;})[_0xe25b('0x26')](respondWithFilteredResult(_0x24dbec,_0x4f78d4))['catch'](handleError(_0x24dbec,null));};exports[_0xe25b('0x47')]=function(_0x20de66,_0x2ecc5e){var _0x3dc009={'raw':![],'where':{'id':_0x20de66[_0xe25b('0x48')]['id']}},_0x4d563a={};_0x4d563a[_0xe25b('0x31')]=_[_0xe25b('0x33')](db[_0xe25b('0x44')][_0xe25b('0x2d')]);_0x4d563a[_0xe25b('0x32')]=_['keys'](_0x20de66['query']);_0x4d563a[_0xe25b('0x3c')]=_[_0xe25b('0x34')](_0x4d563a['model'],_0x4d563a[_0xe25b('0x32')]);_0x3dc009[_0xe25b('0x36')]=_[_0xe25b('0x34')](_0x4d563a[_0xe25b('0x31')],qs['fields'](_0x20de66[_0xe25b('0x32')]['fields']));_0x3dc009[_0xe25b('0x36')]=_0x3dc009[_0xe25b('0x36')]['length']?_0x3dc009['attributes']:_0x4d563a[_0xe25b('0x31')];if(_0x20de66[_0xe25b('0x32')][_0xe25b('0x42')]){_0x3dc009[_0xe25b('0x43')]=[{'all':!![]}];}_0x3dc009=_[_0xe25b('0x3f')]({},_0x3dc009,_0x20de66[_0xe25b('0x41')]);return db['DeskConfiguration'][_0xe25b('0x49')](_0x3dc009)[_0xe25b('0x26')](handleEntityNotFound(_0x2ecc5e,null))[_0xe25b('0x26')](respondWithResult(_0x2ecc5e,null))[_0xe25b('0x4a')](handleError(_0x2ecc5e,null));};exports[_0xe25b('0x4b')]=function(_0x10e9a5,_0x5d9b1b){return db[_0xe25b('0x44')]['create'](_0x10e9a5[_0xe25b('0x4c')],{})[_0xe25b('0x26')](respondWithResult(_0x5d9b1b,0xc9))[_0xe25b('0x4a')](handleError(_0x5d9b1b,null));};exports[_0xe25b('0x25')]=function(_0x29c9e6,_0x17840a){if(_0x29c9e6[_0xe25b('0x4c')]['id']){delete _0x29c9e6['body']['id'];}return db[_0xe25b('0x44')][_0xe25b('0x49')]({'where':{'id':_0x29c9e6['params']['id']}})[_0xe25b('0x26')](handleEntityNotFound(_0x17840a,null))[_0xe25b('0x26')](saveUpdates(_0x29c9e6[_0xe25b('0x4c')],null))[_0xe25b('0x26')](respondWithResult(_0x17840a,null))[_0xe25b('0x4a')](handleError(_0x17840a,null));};exports['destroy']=function(_0x118def,_0x185dcc){return db[_0xe25b('0x44')][_0xe25b('0x49')]({'where':{'id':_0x118def[_0xe25b('0x48')]['id']}})[_0xe25b('0x26')](handleEntityNotFound(_0x185dcc,null))[_0xe25b('0x26')](removeEntity(_0x185dcc,null))[_0xe25b('0x4a')](handleError(_0x185dcc,null));};exports[_0xe25b('0x4d')]=function(_0x3803ee,_0x42191b,_0x127be4){var _0x570b16={};var _0x3056e2={};var _0x4c142d;var _0x504bfa;return db['DeskConfiguration'][_0xe25b('0x4e')]({'where':{'id':_0x3803ee[_0xe25b('0x48')]['id']}})[_0xe25b('0x26')](handleEntityNotFound(_0x42191b,null))[_0xe25b('0x26')](function(_0x11082b){if(_0x11082b){_0x4c142d=_0x11082b;_0x3056e2[_0xe25b('0x31')]=_['keys'](db[_0xe25b('0x4f')][_0xe25b('0x2d')]);_0x3056e2[_0xe25b('0x32')]=_['keys'](_0x3803ee[_0xe25b('0x32')]);_0x3056e2[_0xe25b('0x3c')]=_[_0xe25b('0x34')](_0x3056e2[_0xe25b('0x31')],_0x3056e2['query']);_0x570b16[_0xe25b('0x36')]=_['intersection'](_0x3056e2[_0xe25b('0x31')],qs[_0xe25b('0x35')](_0x3803ee['query'][_0xe25b('0x35')]));_0x570b16[_0xe25b('0x36')]=_0x570b16[_0xe25b('0x36')][_0xe25b('0x50')]?_0x570b16[_0xe25b('0x36')]:_0x3056e2['model'];_0x570b16['order']=qs[_0xe25b('0x3a')](_0x3803ee['query'][_0xe25b('0x3a')]);_0x570b16[_0xe25b('0x3b')]=qs[_0xe25b('0x3c')](_[_0xe25b('0x3d')](_0x3803ee[_0xe25b('0x32')],_0x3056e2[_0xe25b('0x3c')]));if(_0x3803ee[_0xe25b('0x32')][_0xe25b('0x3e')]){_0x570b16[_0xe25b('0x3b')]=_[_0xe25b('0x3f')](_0x570b16[_0xe25b('0x3b')],{'$or':_[_0xe25b('0x2c')](_0x570b16[_0xe25b('0x36')],function(_0x3479e9){var _0xdab4a={};_0xdab4a[_0x3479e9]={'$like':'%'+_0x3803ee['query'][_0xe25b('0x3e')]+'%'};return _0xdab4a;})});}_0x570b16=_['merge']({},_0x570b16,_0x3803ee[_0xe25b('0x41')]);return _0x4c142d['getFields'](_0x570b16);}})[_0xe25b('0x26')](function(_0xbda4f1){if(_0xbda4f1){_0x504bfa=_0xbda4f1[_0xe25b('0x50')];if(!_0x3803ee[_0xe25b('0x32')][_0xe25b('0x37')](_0xe25b('0x38'))){_0x570b16[_0xe25b('0x1d')]=qs[_0xe25b('0x1d')](_0x3803ee[_0xe25b('0x32')]['limit']);_0x570b16[_0xe25b('0x1f')]=qs[_0xe25b('0x1f')](_0x3803ee[_0xe25b('0x32')][_0xe25b('0x1f')]);}return _0x4c142d[_0xe25b('0x4d')](_0x570b16);}})[_0xe25b('0x26')](function(_0x4113fd){if(_0x4113fd){return _0x4113fd?{'count':_0x504bfa,'rows':_0x4113fd}:null;}})[_0xe25b('0x26')](respondWithResult(_0x42191b,null))[_0xe25b('0x4a')](handleError(_0x42191b,null));};exports[_0xe25b('0x51')]=function(_0x42782d,_0x24a1cc,_0x3dd9af){var _0x46b428={};var _0x1d5a84={};var _0xb58840;var _0x29b860;return db[_0xe25b('0x44')][_0xe25b('0x4e')]({'where':{'id':_0x42782d[_0xe25b('0x48')]['id']}})['then'](handleEntityNotFound(_0x24a1cc,null))['then'](function(_0x2221fe){if(_0x2221fe){_0xb58840=_0x2221fe;_0x1d5a84['model']=_[_0xe25b('0x33')](db[_0xe25b('0x4f')]['rawAttributes']);_0x1d5a84[_0xe25b('0x32')]=_['keys'](_0x42782d[_0xe25b('0x32')]);_0x1d5a84['filters']=_[_0xe25b('0x34')](_0x1d5a84[_0xe25b('0x31')],_0x1d5a84[_0xe25b('0x32')]);_0x46b428[_0xe25b('0x36')]=_[_0xe25b('0x34')](_0x1d5a84[_0xe25b('0x31')],qs[_0xe25b('0x35')](_0x42782d[_0xe25b('0x32')][_0xe25b('0x35')]));_0x46b428[_0xe25b('0x36')]=_0x46b428[_0xe25b('0x36')][_0xe25b('0x50')]?_0x46b428[_0xe25b('0x36')]:_0x1d5a84[_0xe25b('0x31')];_0x46b428[_0xe25b('0x39')]=qs[_0xe25b('0x3a')](_0x42782d[_0xe25b('0x32')][_0xe25b('0x3a')]);_0x46b428[_0xe25b('0x3b')]=qs[_0xe25b('0x3c')](_[_0xe25b('0x3d')](_0x42782d[_0xe25b('0x32')],_0x1d5a84[_0xe25b('0x3c')]));if(_0x42782d[_0xe25b('0x32')]['filter']){_0x46b428[_0xe25b('0x3b')]=_[_0xe25b('0x3f')](_0x46b428[_0xe25b('0x3b')],{'$or':_['map'](_0x46b428[_0xe25b('0x36')],function(_0x4e3d9a){var _0x176e40={};_0x176e40[_0x4e3d9a]={'$like':'%'+_0x42782d[_0xe25b('0x32')][_0xe25b('0x3e')]+'%'};return _0x176e40;})});}_0x46b428=_[_0xe25b('0x3f')]({},_0x46b428,_0x42782d['options']);return _0xb58840[_0xe25b('0x51')](_0x46b428);}})[_0xe25b('0x26')](function(_0x4cbe32){if(_0x4cbe32){_0x29b860=_0x4cbe32['length'];if(!_0x42782d[_0xe25b('0x32')]['hasOwnProperty']('nolimit')){_0x46b428[_0xe25b('0x1d')]=qs[_0xe25b('0x1d')](_0x42782d['query'][_0xe25b('0x1d')]);_0x46b428[_0xe25b('0x1f')]=qs[_0xe25b('0x1f')](_0x42782d['query'][_0xe25b('0x1f')]);}return _0xb58840[_0xe25b('0x51')](_0x46b428);}})['then'](function(_0x188c76){if(_0x188c76){return _0x188c76?{'count':_0x29b860,'rows':_0x188c76}:null;}})[_0xe25b('0x26')](respondWithResult(_0x24a1cc,null))[_0xe25b('0x4a')](handleError(_0x24a1cc,null));};exports[_0xe25b('0x52')]=function(_0x228bc4,_0x53dbe0,_0x12876c){var _0x2700cf={};var _0x1ff1a5={};var _0x41aca2;var _0x44aabc;return db[_0xe25b('0x44')]['findOne']({'where':{'id':_0x228bc4[_0xe25b('0x48')]['id']}})['then'](handleEntityNotFound(_0x53dbe0,null))[_0xe25b('0x26')](function(_0x4eb7a5){if(_0x4eb7a5){_0x41aca2=_0x4eb7a5;_0x1ff1a5[_0xe25b('0x31')]=_[_0xe25b('0x33')](db['DeskField']['rawAttributes']);_0x1ff1a5[_0xe25b('0x32')]=_[_0xe25b('0x33')](_0x228bc4[_0xe25b('0x32')]);_0x1ff1a5[_0xe25b('0x3c')]=_['intersection'](_0x1ff1a5[_0xe25b('0x31')],_0x1ff1a5['query']);_0x2700cf[_0xe25b('0x36')]=_[_0xe25b('0x34')](_0x1ff1a5[_0xe25b('0x31')],qs['fields'](_0x228bc4[_0xe25b('0x32')][_0xe25b('0x35')]));_0x2700cf['attributes']=_0x2700cf[_0xe25b('0x36')][_0xe25b('0x50')]?_0x2700cf['attributes']:_0x1ff1a5['model'];_0x2700cf[_0xe25b('0x39')]=qs['sort'](_0x228bc4[_0xe25b('0x32')][_0xe25b('0x3a')]);_0x2700cf[_0xe25b('0x3b')]=qs[_0xe25b('0x3c')](_[_0xe25b('0x3d')](_0x228bc4[_0xe25b('0x32')],_0x1ff1a5[_0xe25b('0x3c')]));if(_0x228bc4[_0xe25b('0x32')][_0xe25b('0x3e')]){_0x2700cf[_0xe25b('0x3b')]=_[_0xe25b('0x3f')](_0x2700cf[_0xe25b('0x3b')],{'$or':_['map'](_0x2700cf[_0xe25b('0x36')],function(_0x28a789){var _0x18e875={};_0x18e875[_0x28a789]={'$like':'%'+_0x228bc4[_0xe25b('0x32')][_0xe25b('0x3e')]+'%'};return _0x18e875;})});}_0x2700cf=_[_0xe25b('0x3f')]({},_0x2700cf,_0x228bc4['options']);return _0x41aca2[_0xe25b('0x52')](_0x2700cf);}})[_0xe25b('0x26')](function(_0x41fe1d){if(_0x41fe1d){_0x44aabc=_0x41fe1d['length'];if(!_0x228bc4[_0xe25b('0x32')][_0xe25b('0x37')](_0xe25b('0x38'))){_0x2700cf[_0xe25b('0x1d')]=qs['limit'](_0x228bc4[_0xe25b('0x32')]['limit']);_0x2700cf['offset']=qs[_0xe25b('0x1f')](_0x228bc4[_0xe25b('0x32')][_0xe25b('0x1f')]);}return _0x41aca2[_0xe25b('0x52')](_0x2700cf);}})[_0xe25b('0x26')](function(_0x455579){if(_0x455579){return _0x455579?{'count':_0x44aabc,'rows':_0x455579}:null;}})[_0xe25b('0x26')](respondWithResult(_0x53dbe0,null))['catch'](handleError(_0x53dbe0,null));};exports[_0xe25b('0x53')]=function(_0x265c76,_0x57ceb8,_0x1d457c){var _0x2e420c={};var _0x3c491d={};var _0x44b88e;var _0x45dbb7;return db[_0xe25b('0x44')]['findOne']({'where':{'id':_0x265c76[_0xe25b('0x48')]['id']}})['then'](handleEntityNotFound(_0x57ceb8,null))['then'](function(_0x101931){if(_0x101931){_0x44b88e=_0x101931;_0x3c491d[_0xe25b('0x31')]=_['keys'](db[_0xe25b('0x54')][_0xe25b('0x2d')]);_0x3c491d[_0xe25b('0x32')]=_['keys'](_0x265c76[_0xe25b('0x32')]);_0x3c491d['filters']=_[_0xe25b('0x34')](_0x3c491d[_0xe25b('0x31')],_0x3c491d[_0xe25b('0x32')]);_0x2e420c['attributes']=_[_0xe25b('0x34')](_0x3c491d[_0xe25b('0x31')],qs[_0xe25b('0x35')](_0x265c76['query'][_0xe25b('0x35')]));_0x2e420c[_0xe25b('0x36')]=_0x2e420c[_0xe25b('0x36')][_0xe25b('0x50')]?_0x2e420c[_0xe25b('0x36')]:_0x3c491d[_0xe25b('0x31')];_0x2e420c['order']=qs[_0xe25b('0x3a')](_0x265c76[_0xe25b('0x32')][_0xe25b('0x3a')]);_0x2e420c[_0xe25b('0x3b')]=qs[_0xe25b('0x3c')](_[_0xe25b('0x3d')](_0x265c76[_0xe25b('0x32')],_0x3c491d[_0xe25b('0x3c')]));if(_0x265c76['query'][_0xe25b('0x3e')]){_0x2e420c[_0xe25b('0x3b')]=_[_0xe25b('0x3f')](_0x2e420c[_0xe25b('0x3b')],{'$or':_['map'](_0x2e420c[_0xe25b('0x36')],function(_0x3a8797){var _0x5b11e1={};_0x5b11e1[_0x3a8797]={'$like':'%'+_0x265c76[_0xe25b('0x32')]['filter']+'%'};return _0x5b11e1;})});}_0x2e420c=_[_0xe25b('0x3f')]({},_0x2e420c,_0x265c76['options']);return _0x44b88e['getTags'](_0x2e420c);}})['then'](function(_0x6d0807){if(_0x6d0807){_0x45dbb7=_0x6d0807[_0xe25b('0x50')];if(!_0x265c76[_0xe25b('0x32')][_0xe25b('0x37')](_0xe25b('0x38'))){_0x2e420c['limit']=qs[_0xe25b('0x1d')](_0x265c76[_0xe25b('0x32')][_0xe25b('0x1d')]);_0x2e420c[_0xe25b('0x1f')]=qs[_0xe25b('0x1f')](_0x265c76['query'][_0xe25b('0x1f')]);}return _0x44b88e[_0xe25b('0x53')](_0x2e420c);}})[_0xe25b('0x26')](function(_0xce213d){if(_0xce213d){return _0xce213d?{'count':_0x45dbb7,'rows':_0xce213d}:null;}})[_0xe25b('0x26')](respondWithResult(_0x57ceb8,null))[_0xe25b('0x4a')](handleError(_0x57ceb8,null));};exports[_0xe25b('0x55')]=function(_0xab7b49,_0x49b98f,_0x2b6600){if(_0xab7b49[_0xe25b('0x4c')]['id']){delete _0xab7b49[_0xe25b('0x4c')]['id'];}return db[_0xe25b('0x44')][_0xe25b('0x4e')]({'where':{'id':_0xab7b49[_0xe25b('0x48')]['id']}})[_0xe25b('0x26')](handleEntityNotFound(_0x49b98f,null))[_0xe25b('0x26')](function(_0xb1effd){if(_0xb1effd){return _0xb1effd['setTags'](_0xab7b49[_0xe25b('0x4c')][_0xe25b('0x56')]||[]);}return null;})[_0xe25b('0x26')](respondWithResult(_0x49b98f,null))[_0xe25b('0x4a')](handleError(_0x49b98f,null));}; \ No newline at end of file +var _0xb7e1=['send','index','DeskConfiguration','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','merge','options','include','catch','show','params','rawAttributes','find','create','body','destroy','getFields','findOne','DeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','save','update','then','error','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb7e1,0x78));var _0x1b7e=function(_0x501e37,_0x4c2a34){_0x501e37=_0x501e37-0x0;var _0xa02689=_0xb7e1[_0x501e37];return _0xa02689;};'use strict';var emlformat=require(_0x1b7e('0x0'));var rimraf=require(_0x1b7e('0x1'));var zipdir=require(_0x1b7e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1b7e('0x3'));var moment=require('moment');var BPromise=require(_0x1b7e('0x4'));var Mustache=require(_0x1b7e('0x5'));var util=require(_0x1b7e('0x6'));var path=require(_0x1b7e('0x7'));var sox=require(_0x1b7e('0x8'));var csv=require(_0x1b7e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1b7e('0xa'));var jsforce=require(_0x1b7e('0xb'));var deskjs=require(_0x1b7e('0xc'));var toCsv=require(_0x1b7e('0x9'));var querystring=require(_0x1b7e('0xd'));var Papa=require(_0x1b7e('0xe'));var Redis=require(_0x1b7e('0xf'));var authService=require(_0x1b7e('0x10'));var qs=require(_0x1b7e('0x11'));var as=require(_0x1b7e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1b7e('0x13'))('api');var utils=require(_0x1b7e('0x14'));var config=require(_0x1b7e('0x15'));var licenseUtil=require(_0x1b7e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bf734,_0x5a7893){_0x5a7893=_0x5a7893||0xcc;return function(_0x9d3bb8){if(_0x9d3bb8){return _0x5bf734[_0x1b7e('0x17')](_0x5a7893);}return _0x5bf734['status'](_0x5a7893)[_0x1b7e('0x18')]();};}function respondWithResult(_0x3d8536,_0x43e508){_0x43e508=_0x43e508||0xc8;return function(_0x3ac28f){if(_0x3ac28f){return _0x3d8536['status'](_0x43e508)[_0x1b7e('0x19')](_0x3ac28f);}};}function respondWithFilteredResult(_0xca34b7,_0x206372){return function(_0x449ee2){if(_0x449ee2){var _0x579eb1=typeof _0x206372[_0x1b7e('0x1a')]===_0x1b7e('0x1b')&&typeof _0x206372[_0x1b7e('0x1c')]===_0x1b7e('0x1b');var _0x23e529=_0x449ee2[_0x1b7e('0x1d')];var _0x594428=_0x579eb1?0x0:_0x206372['offset'];var _0x3f90ec=_0x579eb1?_0x449ee2[_0x1b7e('0x1d')]:_0x206372['offset']+_0x206372[_0x1b7e('0x1c')];var _0x6db74a;if(_0x3f90ec>=_0x23e529){_0x3f90ec=_0x23e529;_0x6db74a=0xc8;}else{_0x6db74a=0xce;}_0xca34b7[_0x1b7e('0x1e')](_0x6db74a);return _0xca34b7[_0x1b7e('0x1f')]('Content-Range',_0x594428+'-'+_0x3f90ec+'/'+_0x23e529)[_0x1b7e('0x19')](_0x449ee2);}return null;};}function patchUpdates(_0x411dae){return function(_0x270365){try{jsonpatch[_0x1b7e('0x20')](_0x270365,_0x411dae,!![]);}catch(_0x49864c){return BPromise['reject'](_0x49864c);}return _0x270365[_0x1b7e('0x21')]();};}function saveUpdates(_0x52cd77,_0x54b728){return function(_0x30c668){if(_0x30c668){return _0x30c668[_0x1b7e('0x22')](_0x52cd77)['then'](function(_0x939b77){return _0x939b77;});}return null;};}function removeEntity(_0x190d1f,_0x1c136f){return function(_0x431776){if(_0x431776){return _0x431776['destroy']()[_0x1b7e('0x23')](function(){_0x190d1f[_0x1b7e('0x1e')](0xcc)[_0x1b7e('0x18')]();});}};}function handleEntityNotFound(_0x597a6f,_0x43ca13){return function(_0x5c9e21){if(!_0x5c9e21){_0x597a6f[_0x1b7e('0x17')](0x194);}return _0x5c9e21;};}function handleError(_0x541e83,_0x1048ed){_0x1048ed=_0x1048ed||0x1f4;return function(_0x160f97){logger[_0x1b7e('0x24')](_0x160f97['stack']);if(_0x160f97[_0x1b7e('0x25')]){delete _0x160f97[_0x1b7e('0x25')];}_0x541e83[_0x1b7e('0x1e')](_0x1048ed)[_0x1b7e('0x26')](_0x160f97);};}exports[_0x1b7e('0x27')]=function(_0x53bb9b,_0x4824da){var _0x54b85c={},_0x3de932={},_0x13e1d2={'count':0x0,'rows':[]};var _0x212e21=_['map'](db[_0x1b7e('0x28')]['rawAttributes'],function(_0x1f9df0){return{'name':_0x1f9df0[_0x1b7e('0x29')],'type':_0x1f9df0['type']['key']};});_0x3de932[_0x1b7e('0x2a')]=_[_0x1b7e('0x2b')](_0x212e21,'name');_0x3de932[_0x1b7e('0x2c')]=_[_0x1b7e('0x2d')](_0x53bb9b[_0x1b7e('0x2c')]);_0x3de932[_0x1b7e('0x2e')]=_[_0x1b7e('0x2f')](_0x3de932['model'],_0x3de932[_0x1b7e('0x2c')]);_0x54b85c[_0x1b7e('0x30')]=_['intersection'](_0x3de932['model'],qs[_0x1b7e('0x31')](_0x53bb9b[_0x1b7e('0x2c')]['fields']));_0x54b85c[_0x1b7e('0x30')]=_0x54b85c[_0x1b7e('0x30')][_0x1b7e('0x32')]?_0x54b85c[_0x1b7e('0x30')]:_0x3de932['model'];if(!_0x53bb9b[_0x1b7e('0x2c')][_0x1b7e('0x33')](_0x1b7e('0x34'))){_0x54b85c[_0x1b7e('0x1c')]=qs[_0x1b7e('0x1c')](_0x53bb9b[_0x1b7e('0x2c')][_0x1b7e('0x1c')]);_0x54b85c['offset']=qs[_0x1b7e('0x1a')](_0x53bb9b[_0x1b7e('0x2c')]['offset']);}_0x54b85c[_0x1b7e('0x35')]=qs[_0x1b7e('0x36')](_0x53bb9b['query']['sort']);_0x54b85c[_0x1b7e('0x37')]=qs[_0x1b7e('0x2e')](_[_0x1b7e('0x38')](_0x53bb9b[_0x1b7e('0x2c')],_0x3de932['filters']),_0x212e21);if(_0x53bb9b[_0x1b7e('0x2c')][_0x1b7e('0x39')]){_0x54b85c[_0x1b7e('0x37')]=_['merge'](_0x54b85c[_0x1b7e('0x37')],{'$or':_[_0x1b7e('0x2b')](_0x212e21,function(_0xa551f3){if(_0xa551f3[_0x1b7e('0x3a')]!=='VIRTUAL'){var _0x5103a3={};_0x5103a3[_0xa551f3['name']]={'$like':'%'+_0x53bb9b[_0x1b7e('0x2c')]['filter']+'%'};return _0x5103a3;}})});}_0x54b85c=_[_0x1b7e('0x3b')]({},_0x54b85c,_0x53bb9b[_0x1b7e('0x3c')]);var _0x131475={'where':_0x54b85c[_0x1b7e('0x37')]};return db[_0x1b7e('0x28')][_0x1b7e('0x1d')](_0x131475)[_0x1b7e('0x23')](function(_0x3b135b){_0x13e1d2[_0x1b7e('0x1d')]=_0x3b135b;if(_0x53bb9b[_0x1b7e('0x2c')]['includeAll']){_0x54b85c[_0x1b7e('0x3d')]=[{'all':!![]}];}return db[_0x1b7e('0x28')]['findAll'](_0x54b85c);})[_0x1b7e('0x23')](function(_0x3170b3){_0x13e1d2['rows']=_0x3170b3;return _0x13e1d2;})[_0x1b7e('0x23')](respondWithFilteredResult(_0x4824da,_0x54b85c))[_0x1b7e('0x3e')](handleError(_0x4824da,null));};exports[_0x1b7e('0x3f')]=function(_0x16b104,_0x48498a){var _0x427a09={'raw':![],'where':{'id':_0x16b104[_0x1b7e('0x40')]['id']}},_0x3ff231={};_0x3ff231[_0x1b7e('0x2a')]=_['keys'](db[_0x1b7e('0x28')][_0x1b7e('0x41')]);_0x3ff231['query']=_[_0x1b7e('0x2d')](_0x16b104[_0x1b7e('0x2c')]);_0x3ff231[_0x1b7e('0x2e')]=_[_0x1b7e('0x2f')](_0x3ff231['model'],_0x3ff231[_0x1b7e('0x2c')]);_0x427a09['attributes']=_[_0x1b7e('0x2f')](_0x3ff231[_0x1b7e('0x2a')],qs['fields'](_0x16b104[_0x1b7e('0x2c')][_0x1b7e('0x31')]));_0x427a09[_0x1b7e('0x30')]=_0x427a09[_0x1b7e('0x30')][_0x1b7e('0x32')]?_0x427a09['attributes']:_0x3ff231['model'];if(_0x16b104['query']['includeAll']){_0x427a09[_0x1b7e('0x3d')]=[{'all':!![]}];}_0x427a09=_['merge']({},_0x427a09,_0x16b104[_0x1b7e('0x3c')]);return db[_0x1b7e('0x28')][_0x1b7e('0x42')](_0x427a09)[_0x1b7e('0x23')](handleEntityNotFound(_0x48498a,null))[_0x1b7e('0x23')](respondWithResult(_0x48498a,null))[_0x1b7e('0x3e')](handleError(_0x48498a,null));};exports[_0x1b7e('0x43')]=function(_0x2e6221,_0x483b3e){return db[_0x1b7e('0x28')][_0x1b7e('0x43')](_0x2e6221[_0x1b7e('0x44')],{})['then'](respondWithResult(_0x483b3e,0xc9))['catch'](handleError(_0x483b3e,null));};exports[_0x1b7e('0x22')]=function(_0x562d3b,_0x259e51){if(_0x562d3b[_0x1b7e('0x44')]['id']){delete _0x562d3b[_0x1b7e('0x44')]['id'];}return db[_0x1b7e('0x28')][_0x1b7e('0x42')]({'where':{'id':_0x562d3b[_0x1b7e('0x40')]['id']}})[_0x1b7e('0x23')](handleEntityNotFound(_0x259e51,null))['then'](saveUpdates(_0x562d3b[_0x1b7e('0x44')],null))['then'](respondWithResult(_0x259e51,null))['catch'](handleError(_0x259e51,null));};exports[_0x1b7e('0x45')]=function(_0x17188d,_0xa5807a){return db[_0x1b7e('0x28')][_0x1b7e('0x42')]({'where':{'id':_0x17188d[_0x1b7e('0x40')]['id']}})[_0x1b7e('0x23')](handleEntityNotFound(_0xa5807a,null))[_0x1b7e('0x23')](removeEntity(_0xa5807a,null))['catch'](handleError(_0xa5807a,null));};exports[_0x1b7e('0x46')]=function(_0x2176e7,_0x4475e0,_0xa3ef3f){var _0x56dac8={};var _0x24d5ea={};var _0x24bb9a;var _0x372619;return db[_0x1b7e('0x28')][_0x1b7e('0x47')]({'where':{'id':_0x2176e7[_0x1b7e('0x40')]['id']}})[_0x1b7e('0x23')](handleEntityNotFound(_0x4475e0,null))[_0x1b7e('0x23')](function(_0x300982){if(_0x300982){_0x24bb9a=_0x300982;_0x24d5ea[_0x1b7e('0x2a')]=_['keys'](db[_0x1b7e('0x48')][_0x1b7e('0x41')]);_0x24d5ea[_0x1b7e('0x2c')]=_['keys'](_0x2176e7[_0x1b7e('0x2c')]);_0x24d5ea[_0x1b7e('0x2e')]=_['intersection'](_0x24d5ea[_0x1b7e('0x2a')],_0x24d5ea['query']);_0x56dac8['attributes']=_[_0x1b7e('0x2f')](_0x24d5ea[_0x1b7e('0x2a')],qs[_0x1b7e('0x31')](_0x2176e7[_0x1b7e('0x2c')][_0x1b7e('0x31')]));_0x56dac8['attributes']=_0x56dac8['attributes'][_0x1b7e('0x32')]?_0x56dac8[_0x1b7e('0x30')]:_0x24d5ea[_0x1b7e('0x2a')];_0x56dac8[_0x1b7e('0x35')]=qs[_0x1b7e('0x36')](_0x2176e7['query']['sort']);_0x56dac8[_0x1b7e('0x37')]=qs['filters'](_[_0x1b7e('0x38')](_0x2176e7[_0x1b7e('0x2c')],_0x24d5ea[_0x1b7e('0x2e')]));if(_0x2176e7['query'][_0x1b7e('0x39')]){_0x56dac8[_0x1b7e('0x37')]=_[_0x1b7e('0x3b')](_0x56dac8[_0x1b7e('0x37')],{'$or':_[_0x1b7e('0x2b')](_0x56dac8[_0x1b7e('0x30')],function(_0x457c8a){var _0xe2b614={};_0xe2b614[_0x457c8a]={'$like':'%'+_0x2176e7['query'][_0x1b7e('0x39')]+'%'};return _0xe2b614;})});}_0x56dac8=_[_0x1b7e('0x3b')]({},_0x56dac8,_0x2176e7[_0x1b7e('0x3c')]);return _0x24bb9a[_0x1b7e('0x46')](_0x56dac8);}})[_0x1b7e('0x23')](function(_0x2c400e){if(_0x2c400e){_0x372619=_0x2c400e['length'];if(!_0x2176e7[_0x1b7e('0x2c')][_0x1b7e('0x33')](_0x1b7e('0x34'))){_0x56dac8[_0x1b7e('0x1c')]=qs[_0x1b7e('0x1c')](_0x2176e7[_0x1b7e('0x2c')][_0x1b7e('0x1c')]);_0x56dac8['offset']=qs[_0x1b7e('0x1a')](_0x2176e7[_0x1b7e('0x2c')][_0x1b7e('0x1a')]);}return _0x24bb9a[_0x1b7e('0x46')](_0x56dac8);}})[_0x1b7e('0x23')](function(_0x4b9ec3){if(_0x4b9ec3){return _0x4b9ec3?{'count':_0x372619,'rows':_0x4b9ec3}:null;}})[_0x1b7e('0x23')](respondWithResult(_0x4475e0,null))[_0x1b7e('0x3e')](handleError(_0x4475e0,null));};exports[_0x1b7e('0x49')]=function(_0x3ea16f,_0x338e08,_0xe1935a){var _0x2d96dd={};var _0x245124={};var _0x3082e7;var _0x5710be;return db[_0x1b7e('0x28')][_0x1b7e('0x47')]({'where':{'id':_0x3ea16f[_0x1b7e('0x40')]['id']}})['then'](handleEntityNotFound(_0x338e08,null))[_0x1b7e('0x23')](function(_0x2d7f96){if(_0x2d7f96){_0x3082e7=_0x2d7f96;_0x245124[_0x1b7e('0x2a')]=_[_0x1b7e('0x2d')](db['DeskField'][_0x1b7e('0x41')]);_0x245124[_0x1b7e('0x2c')]=_[_0x1b7e('0x2d')](_0x3ea16f[_0x1b7e('0x2c')]);_0x245124[_0x1b7e('0x2e')]=_['intersection'](_0x245124['model'],_0x245124[_0x1b7e('0x2c')]);_0x2d96dd[_0x1b7e('0x30')]=_['intersection'](_0x245124['model'],qs[_0x1b7e('0x31')](_0x3ea16f[_0x1b7e('0x2c')][_0x1b7e('0x31')]));_0x2d96dd[_0x1b7e('0x30')]=_0x2d96dd[_0x1b7e('0x30')][_0x1b7e('0x32')]?_0x2d96dd[_0x1b7e('0x30')]:_0x245124[_0x1b7e('0x2a')];_0x2d96dd[_0x1b7e('0x35')]=qs[_0x1b7e('0x36')](_0x3ea16f[_0x1b7e('0x2c')][_0x1b7e('0x36')]);_0x2d96dd[_0x1b7e('0x37')]=qs[_0x1b7e('0x2e')](_[_0x1b7e('0x38')](_0x3ea16f[_0x1b7e('0x2c')],_0x245124[_0x1b7e('0x2e')]));if(_0x3ea16f[_0x1b7e('0x2c')][_0x1b7e('0x39')]){_0x2d96dd[_0x1b7e('0x37')]=_['merge'](_0x2d96dd[_0x1b7e('0x37')],{'$or':_[_0x1b7e('0x2b')](_0x2d96dd[_0x1b7e('0x30')],function(_0xda5128){var _0x1681d9={};_0x1681d9[_0xda5128]={'$like':'%'+_0x3ea16f[_0x1b7e('0x2c')][_0x1b7e('0x39')]+'%'};return _0x1681d9;})});}_0x2d96dd=_[_0x1b7e('0x3b')]({},_0x2d96dd,_0x3ea16f[_0x1b7e('0x3c')]);return _0x3082e7[_0x1b7e('0x49')](_0x2d96dd);}})[_0x1b7e('0x23')](function(_0xe9a89e){if(_0xe9a89e){_0x5710be=_0xe9a89e[_0x1b7e('0x32')];if(!_0x3ea16f[_0x1b7e('0x2c')]['hasOwnProperty']('nolimit')){_0x2d96dd['limit']=qs[_0x1b7e('0x1c')](_0x3ea16f[_0x1b7e('0x2c')][_0x1b7e('0x1c')]);_0x2d96dd['offset']=qs[_0x1b7e('0x1a')](_0x3ea16f[_0x1b7e('0x2c')][_0x1b7e('0x1a')]);}return _0x3082e7[_0x1b7e('0x49')](_0x2d96dd);}})['then'](function(_0x4812a0){if(_0x4812a0){return _0x4812a0?{'count':_0x5710be,'rows':_0x4812a0}:null;}})[_0x1b7e('0x23')](respondWithResult(_0x338e08,null))[_0x1b7e('0x3e')](handleError(_0x338e08,null));};exports[_0x1b7e('0x4a')]=function(_0x490340,_0x2b1148,_0x119ddf){var _0x1c46c9={};var _0x52bfc1={};var _0x22ae25;var _0x48ab3b;return db[_0x1b7e('0x28')][_0x1b7e('0x47')]({'where':{'id':_0x490340[_0x1b7e('0x40')]['id']}})['then'](handleEntityNotFound(_0x2b1148,null))[_0x1b7e('0x23')](function(_0x18cec6){if(_0x18cec6){_0x22ae25=_0x18cec6;_0x52bfc1[_0x1b7e('0x2a')]=_[_0x1b7e('0x2d')](db[_0x1b7e('0x48')][_0x1b7e('0x41')]);_0x52bfc1['query']=_[_0x1b7e('0x2d')](_0x490340[_0x1b7e('0x2c')]);_0x52bfc1[_0x1b7e('0x2e')]=_[_0x1b7e('0x2f')](_0x52bfc1[_0x1b7e('0x2a')],_0x52bfc1[_0x1b7e('0x2c')]);_0x1c46c9['attributes']=_['intersection'](_0x52bfc1['model'],qs[_0x1b7e('0x31')](_0x490340[_0x1b7e('0x2c')][_0x1b7e('0x31')]));_0x1c46c9['attributes']=_0x1c46c9[_0x1b7e('0x30')]['length']?_0x1c46c9[_0x1b7e('0x30')]:_0x52bfc1['model'];_0x1c46c9[_0x1b7e('0x35')]=qs[_0x1b7e('0x36')](_0x490340[_0x1b7e('0x2c')][_0x1b7e('0x36')]);_0x1c46c9[_0x1b7e('0x37')]=qs['filters'](_[_0x1b7e('0x38')](_0x490340['query'],_0x52bfc1['filters']));if(_0x490340[_0x1b7e('0x2c')][_0x1b7e('0x39')]){_0x1c46c9[_0x1b7e('0x37')]=_[_0x1b7e('0x3b')](_0x1c46c9[_0x1b7e('0x37')],{'$or':_[_0x1b7e('0x2b')](_0x1c46c9['attributes'],function(_0x15b515){var _0x32e04d={};_0x32e04d[_0x15b515]={'$like':'%'+_0x490340[_0x1b7e('0x2c')][_0x1b7e('0x39')]+'%'};return _0x32e04d;})});}_0x1c46c9=_[_0x1b7e('0x3b')]({},_0x1c46c9,_0x490340[_0x1b7e('0x3c')]);return _0x22ae25[_0x1b7e('0x4a')](_0x1c46c9);}})['then'](function(_0x1170c3){if(_0x1170c3){_0x48ab3b=_0x1170c3[_0x1b7e('0x32')];if(!_0x490340[_0x1b7e('0x2c')]['hasOwnProperty'](_0x1b7e('0x34'))){_0x1c46c9['limit']=qs[_0x1b7e('0x1c')](_0x490340['query'][_0x1b7e('0x1c')]);_0x1c46c9[_0x1b7e('0x1a')]=qs[_0x1b7e('0x1a')](_0x490340[_0x1b7e('0x2c')][_0x1b7e('0x1a')]);}return _0x22ae25[_0x1b7e('0x4a')](_0x1c46c9);}})[_0x1b7e('0x23')](function(_0x4172e9){if(_0x4172e9){return _0x4172e9?{'count':_0x48ab3b,'rows':_0x4172e9}:null;}})[_0x1b7e('0x23')](respondWithResult(_0x2b1148,null))[_0x1b7e('0x3e')](handleError(_0x2b1148,null));};exports[_0x1b7e('0x4b')]=function(_0x1993da,_0x3466e5,_0x565d96){var _0x259cb6={};var _0xc4af0={};var _0x15ed08;var _0xef62d;return db[_0x1b7e('0x28')][_0x1b7e('0x47')]({'where':{'id':_0x1993da[_0x1b7e('0x40')]['id']}})['then'](handleEntityNotFound(_0x3466e5,null))[_0x1b7e('0x23')](function(_0x58696b){if(_0x58696b){_0x15ed08=_0x58696b;_0xc4af0['model']=_['keys'](db[_0x1b7e('0x4c')]['rawAttributes']);_0xc4af0[_0x1b7e('0x2c')]=_[_0x1b7e('0x2d')](_0x1993da['query']);_0xc4af0['filters']=_[_0x1b7e('0x2f')](_0xc4af0[_0x1b7e('0x2a')],_0xc4af0[_0x1b7e('0x2c')]);_0x259cb6[_0x1b7e('0x30')]=_[_0x1b7e('0x2f')](_0xc4af0[_0x1b7e('0x2a')],qs[_0x1b7e('0x31')](_0x1993da[_0x1b7e('0x2c')][_0x1b7e('0x31')]));_0x259cb6[_0x1b7e('0x30')]=_0x259cb6['attributes'][_0x1b7e('0x32')]?_0x259cb6[_0x1b7e('0x30')]:_0xc4af0[_0x1b7e('0x2a')];_0x259cb6[_0x1b7e('0x35')]=qs[_0x1b7e('0x36')](_0x1993da[_0x1b7e('0x2c')][_0x1b7e('0x36')]);_0x259cb6['where']=qs['filters'](_[_0x1b7e('0x38')](_0x1993da['query'],_0xc4af0['filters']));if(_0x1993da[_0x1b7e('0x2c')]['filter']){_0x259cb6['where']=_[_0x1b7e('0x3b')](_0x259cb6[_0x1b7e('0x37')],{'$or':_[_0x1b7e('0x2b')](_0x259cb6[_0x1b7e('0x30')],function(_0x3a2359){var _0x5dae2f={};_0x5dae2f[_0x3a2359]={'$like':'%'+_0x1993da[_0x1b7e('0x2c')][_0x1b7e('0x39')]+'%'};return _0x5dae2f;})});}_0x259cb6=_[_0x1b7e('0x3b')]({},_0x259cb6,_0x1993da[_0x1b7e('0x3c')]);return _0x15ed08[_0x1b7e('0x4b')](_0x259cb6);}})[_0x1b7e('0x23')](function(_0x4f5ab3){if(_0x4f5ab3){_0xef62d=_0x4f5ab3[_0x1b7e('0x32')];if(!_0x1993da['query'][_0x1b7e('0x33')](_0x1b7e('0x34'))){_0x259cb6[_0x1b7e('0x1c')]=qs[_0x1b7e('0x1c')](_0x1993da[_0x1b7e('0x2c')][_0x1b7e('0x1c')]);_0x259cb6[_0x1b7e('0x1a')]=qs[_0x1b7e('0x1a')](_0x1993da['query'][_0x1b7e('0x1a')]);}return _0x15ed08[_0x1b7e('0x4b')](_0x259cb6);}})[_0x1b7e('0x23')](function(_0x107532){if(_0x107532){return _0x107532?{'count':_0xef62d,'rows':_0x107532}:null;}})[_0x1b7e('0x23')](respondWithResult(_0x3466e5,null))[_0x1b7e('0x3e')](handleError(_0x3466e5,null));};exports['setTags']=function(_0x3f82da,_0x38b1a9,_0x1dd387){if(_0x3f82da[_0x1b7e('0x44')]['id']){delete _0x3f82da[_0x1b7e('0x44')]['id'];}return db[_0x1b7e('0x28')][_0x1b7e('0x47')]({'where':{'id':_0x3f82da[_0x1b7e('0x40')]['id']}})[_0x1b7e('0x23')](handleEntityNotFound(_0x38b1a9,null))[_0x1b7e('0x23')](function(_0x13a1e3){if(_0x13a1e3){return _0x13a1e3[_0x1b7e('0x4d')](_0x3f82da['body'][_0x1b7e('0x4e')]||[]);}return null;})[_0x1b7e('0x23')](respondWithResult(_0x38b1a9,null))[_0x1b7e('0x3e')](handleError(_0x38b1a9,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 50e49a4..f04a475 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 _0xd5fd=['exports','define','DeskConfiguration','int_desk_configurations','lodash','util','api','moment','request-promise','path','../../config/environment','./intDeskConfiguration.attributes'];(function(_0x310504,_0x26ad95){var _0x5b36d0=function(_0x253f28){while(--_0x253f28){_0x310504['push'](_0x310504['shift']());}};_0x5b36d0(++_0x26ad95);}(_0xd5fd,0x1c0));var _0xdd5f=function(_0x10a4bd,_0x1fb723){_0x10a4bd=_0x10a4bd-0x0;var _0x3210f1=_0xd5fd[_0x10a4bd];return _0x3210f1;};'use strict';var _=require(_0xdd5f('0x0'));var util=require(_0xdd5f('0x1'));var logger=require('../../config/logger')(_0xdd5f('0x2'));var moment=require(_0xdd5f('0x3'));var BPromise=require('bluebird');var rp=require(_0xdd5f('0x4'));var fs=require('fs');var path=require(_0xdd5f('0x5'));var rimraf=require('rimraf');var config=require(_0xdd5f('0x6'));var attributes=require(_0xdd5f('0x7'));module[_0xdd5f('0x8')]=function(_0x44a2cd,_0x514eeb){return _0x44a2cd[_0xdd5f('0x9')](_0xdd5f('0xa'),attributes,{'tableName':_0xdd5f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfad1=['api','moment','bluebird','request-promise','path','../../config/environment','define','int_desk_configurations','lodash','../../config/logger'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0xfad1,0x12a));var _0x1fad=function(_0x578007,_0x2541aa){_0x578007=_0x578007-0x0;var _0x107f05=_0xfad1[_0x578007];return _0x107f05;};'use strict';var _=require(_0x1fad('0x0'));var util=require('util');var logger=require(_0x1fad('0x1'))(_0x1fad('0x2'));var moment=require(_0x1fad('0x3'));var BPromise=require(_0x1fad('0x4'));var rp=require(_0x1fad('0x5'));var fs=require('fs');var path=require(_0x1fad('0x6'));var rimraf=require('rimraf');var config=require(_0x1fad('0x7'));var attributes=require('./intDeskConfiguration.attributes');module['exports']=function(_0x2e85e1,_0x408aa9){return _0x2e85e1[_0x1fad('0x8')]('DeskConfiguration',attributes,{'tableName':_0x1fad('0x9'),'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 a9361a8..7530769 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 _0xbdbe=['error','DeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','stringify'];(function(_0x35c66e,_0xbe9058){var _0x3e035e=function(_0x4e850c){while(--_0x4e850c){_0x35c66e['push'](_0x35c66e['shift']());}};_0x3e035e(++_0xbe9058);}(_0xbdbe,0x1f3));var _0xebdb=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xbdbe[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require(_0xebdb('0x0'));var util=require('util');var moment=require(_0xebdb('0x1'));var BPromise=require('bluebird');var rs=require(_0xebdb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xebdb('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xebdb('0x4'))('rpc');var config=require(_0xebdb('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xebdb('0x6')][_0xebdb('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x16eacd,_0x454e31,_0x19ba0e){return new BPromise(function(_0x253968,_0x31e053){return client[_0xebdb('0x8')](_0x16eacd,_0x19ba0e)[_0xebdb('0x9')](function(_0x181c90){logger[_0xebdb('0xa')]('DeskConfiguration,\x20%s,\x20%s',_0x454e31,_0xebdb('0xb'));logger[_0xebdb('0xc')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x454e31,_0xebdb('0xb'),JSON[_0xebdb('0xd')](_0x181c90));if(_0x181c90[_0xebdb('0xe')]){if(_0x181c90[_0xebdb('0xe')]['code']===0x1f4){logger['error'](_0xebdb('0xf'),_0x454e31,_0x181c90[_0xebdb('0xe')][_0xebdb('0x10')]);return _0x31e053(_0x181c90[_0xebdb('0xe')]['message']);}logger[_0xebdb('0xe')](_0xebdb('0xf'),_0x454e31,_0x181c90[_0xebdb('0xe')][_0xebdb('0x10')]);return _0x253968(_0x181c90[_0xebdb('0xe')][_0xebdb('0x10')]);}else{logger[_0xebdb('0xa')](_0xebdb('0xf'),_0x454e31,_0xebdb('0xb'));_0x253968(_0x181c90[_0xebdb('0x11')]['message']);}})[_0xebdb('0x12')](function(_0x508ae3){logger['error'](_0xebdb('0xf'),_0x454e31,_0x508ae3);_0x31e053(_0x508ae3);});});} \ No newline at end of file +var _0x352e=['client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x59eefb,_0x2151ce){var _0x1a49e8=function(_0x5a758c){while(--_0x5a758c){_0x59eefb['push'](_0x59eefb['shift']());}};_0x1a49e8(++_0x2151ce);}(_0x352e,0x1a6));var _0xe352=function(_0xf13953,_0xdbcc30){_0xf13953=_0xf13953-0x0;var _0x4a9d9e=_0x352e[_0xf13953];return _0x4a9d9e;};'use strict';var _=require(_0xe352('0x0'));var util=require(_0xe352('0x1'));var moment=require(_0xe352('0x2'));var BPromise=require(_0xe352('0x3'));var rs=require(_0xe352('0x4'));var fs=require('fs');var Redis=require(_0xe352('0x5'));var db=require(_0xe352('0x6'))['db'];var utils=require(_0xe352('0x7'));var logger=require('../../config/logger')(_0xe352('0x8'));var config=require(_0xe352('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe352('0xa')][_0xe352('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32d7c6,_0x6549bb,_0x5b9266){return new BPromise(function(_0x2bd5e5,_0x3cfd5b){return client[_0xe352('0xc')](_0x32d7c6,_0x5b9266)[_0xe352('0xd')](function(_0x5b1b22){logger[_0xe352('0xe')](_0xe352('0xf'),_0x6549bb,_0xe352('0x10'));logger[_0xe352('0x11')](_0xe352('0x12'),_0x6549bb,_0xe352('0x10'),JSON['stringify'](_0x5b1b22));if(_0x5b1b22['error']){if(_0x5b1b22[_0xe352('0x13')][_0xe352('0x14')]===0x1f4){logger[_0xe352('0x13')](_0xe352('0xf'),_0x6549bb,_0x5b1b22[_0xe352('0x13')][_0xe352('0x15')]);return _0x3cfd5b(_0x5b1b22['error'][_0xe352('0x15')]);}logger[_0xe352('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x6549bb,_0x5b1b22[_0xe352('0x13')][_0xe352('0x15')]);return _0x2bd5e5(_0x5b1b22['error'][_0xe352('0x15')]);}else{logger[_0xe352('0xe')](_0xe352('0xf'),_0x6549bb,_0xe352('0x10'));_0x2bd5e5(_0x5b1b22[_0xe352('0x16')][_0xe352('0x15')]);}})[_0xe352('0x17')](function(_0x1fede5){logger['error'](_0xe352('0xf'),_0x6549bb,_0x1fede5);_0x3cfd5b(_0x1fede5);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index d4d5f4c..843873d 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 _0xfa89=['create','/:id','update','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','show','post'];(function(_0x1bcc92,_0x4929b8){var _0x88406a=function(_0x4670f8){while(--_0x4670f8){_0x1bcc92['push'](_0x1bcc92['shift']());}};_0x88406a(++_0x4929b8);}(_0xfa89,0x64));var _0x9fa8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfa89[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x9fa8('0x0'));var path=require(_0x9fa8('0x1'));var timeout=require(_0x9fa8('0x2'));var express=require(_0x9fa8('0x3'));var router=express[_0x9fa8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9fa8('0x5'));var interaction=require(_0x9fa8('0x6'));var config=require(_0x9fa8('0x7'));var controller=require(_0x9fa8('0x8'));router[_0x9fa8('0x9')]('/',auth[_0x9fa8('0xa')](),controller[_0x9fa8('0xb')]);router[_0x9fa8('0x9')]('/:id',auth[_0x9fa8('0xa')](),controller[_0x9fa8('0xc')]);router[_0x9fa8('0xd')]('/',auth['isAuthenticated'](),controller[_0x9fa8('0xe')]);router['put'](_0x9fa8('0xf'),auth[_0x9fa8('0xa')](),controller[_0x9fa8('0x10')]);router['delete']('/:id',auth[_0x9fa8('0xa')](),controller[_0x9fa8('0x11')]);module[_0x9fa8('0x12')]=router; \ No newline at end of file +var _0xd837=['put','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','/:id','show','post','create'];(function(_0x5976f8,_0x1265b7){var _0x179715=function(_0x2b2c4b){while(--_0x2b2c4b){_0x5976f8['push'](_0x5976f8['shift']());}};_0x179715(++_0x1265b7);}(_0xd837,0x1f2));var _0x7d83=function(_0x303c30,_0x16edcb){_0x303c30=_0x303c30-0x0;var _0x43161b=_0xd837[_0x303c30];return _0x43161b;};'use strict';var multer=require(_0x7d83('0x0'));var util=require('util');var path=require(_0x7d83('0x1'));var timeout=require(_0x7d83('0x2'));var express=require(_0x7d83('0x3'));var router=express['Router']();var fs_extra=require(_0x7d83('0x4'));var auth=require(_0x7d83('0x5'));var interaction=require(_0x7d83('0x6'));var config=require(_0x7d83('0x7'));var controller=require(_0x7d83('0x8'));router[_0x7d83('0x9')]('/',auth[_0x7d83('0xa')](),controller['index']);router[_0x7d83('0x9')](_0x7d83('0xb'),auth[_0x7d83('0xa')](),controller[_0x7d83('0xc')]);router[_0x7d83('0xd')]('/',auth[_0x7d83('0xa')](),controller[_0x7d83('0xe')]);router[_0x7d83('0xf')](_0x7d83('0xb'),auth[_0x7d83('0xa')](),controller[_0x7d83('0x10')]);router[_0x7d83('0x11')]('/:id',auth[_0x7d83('0xa')](),controller[_0x7d83('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index e923079..ee329a3 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 _0x838c=['ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN','exports'];(function(_0x4fdf04,_0x2d5d28){var _0x45f51a=function(_0x25e635){while(--_0x25e635){_0x4fdf04['push'](_0x4fdf04['shift']());}};_0x45f51a(++_0x2d5d28);}(_0x838c,0x13a));var _0xc838=function(_0xf73ebe,_0x25bb18){_0xf73ebe=_0xf73ebe-0x0;var _0x4bf22a=_0x838c[_0xf73ebe];return _0x4bf22a;};'use strict';var Sequelize=require('sequelize');module[_0xc838('0x0')]={'type':{'type':Sequelize[_0xc838('0x1')]('string',_0xc838('0x2'),_0xc838('0x3'),_0xc838('0x4'),_0xc838('0x5')),'defaultValue':_0xc838('0x6')},'content':{'type':Sequelize[_0xc838('0x7')]},'key':{'type':Sequelize[_0xc838('0x7')]},'keyType':{'type':Sequelize[_0xc838('0x1')](_0xc838('0x6'),_0xc838('0x2'),_0xc838('0x3'))},'keyContent':{'type':Sequelize[_0xc838('0x7')]},'idField':{'type':Sequelize[_0xc838('0x7')]},'nameField':{'type':Sequelize[_0xc838('0x7')]},'customField':{'type':Sequelize[_0xc838('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x26c4=['customVariable','keyValue','picklist','STRING','string','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0x5a5a79,_0x34feff){var _0x1b5e12=function(_0x16d9ee){while(--_0x16d9ee){_0x5a5a79['push'](_0x5a5a79['shift']());}};_0x1b5e12(++_0x34feff);}(_0x26c4,0x178));var _0x426c=function(_0x22993d,_0x4b014e){_0x22993d=_0x22993d-0x0;var _0xc65458=_0x26c4[_0x22993d];return _0xc65458;};'use strict';var Sequelize=require(_0x426c('0x0'));module[_0x426c('0x1')]={'type':{'type':Sequelize[_0x426c('0x2')]('string',_0x426c('0x3'),_0x426c('0x4'),_0x426c('0x5'),_0x426c('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x426c('0x7')]},'keyType':{'type':Sequelize[_0x426c('0x2')](_0x426c('0x8'),_0x426c('0x3'),_0x426c('0x4'))},'keyContent':{'type':Sequelize[_0x426c('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x426c('0x7')]},'customField':{'type':Sequelize[_0x426c('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x426c('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index f760fe4..af52319 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 _0xa267=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','apply','save','then','destroy','error','stack','name','map','DeskField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','include','findAll','rows','params','includeAll','find','create','catch','update','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x19c0e4,_0x1e8503){var _0x399c9d=function(_0x3b142b){while(--_0x3b142b){_0x19c0e4['push'](_0x19c0e4['shift']());}};_0x399c9d(++_0x1e8503);}(_0xa267,0xcb));var _0x7a26=function(_0x537b5e,_0x2fe8cc){_0x537b5e=_0x537b5e-0x0;var _0x8ae8c5=_0xa267[_0x537b5e];return _0x8ae8c5;};'use strict';var emlformat=require(_0x7a26('0x0'));var rimraf=require(_0x7a26('0x1'));var zipdir=require(_0x7a26('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7a26('0x3'));var moment=require(_0x7a26('0x4'));var BPromise=require(_0x7a26('0x5'));var Mustache=require(_0x7a26('0x6'));var util=require(_0x7a26('0x7'));var path=require(_0x7a26('0x8'));var sox=require(_0x7a26('0x9'));var csv=require(_0x7a26('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7a26('0xb'));var _=require(_0x7a26('0xc'));var squel=require(_0x7a26('0xd'));var crypto=require('crypto');var jsforce=require(_0x7a26('0xe'));var deskjs=require(_0x7a26('0xf'));var toCsv=require(_0x7a26('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7a26('0x10'));var authService=require(_0x7a26('0x11'));var qs=require(_0x7a26('0x12'));var as=require(_0x7a26('0x13'));var hardwareService=require(_0x7a26('0x14'));var logger=require(_0x7a26('0x15'))(_0x7a26('0x16'));var utils=require(_0x7a26('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x7a26('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7bbf04,_0x422a86){_0x422a86=_0x422a86||0xcc;return function(_0x135ad3){if(_0x135ad3){return _0x7bbf04[_0x7a26('0x19')](_0x422a86);}return _0x7bbf04[_0x7a26('0x1a')](_0x422a86)[_0x7a26('0x1b')]();};}function respondWithResult(_0x61a8a6,_0x4fa9ee){_0x4fa9ee=_0x4fa9ee||0xc8;return function(_0x2e4433){if(_0x2e4433){return _0x61a8a6[_0x7a26('0x1a')](_0x4fa9ee)[_0x7a26('0x1c')](_0x2e4433);}};}function respondWithFilteredResult(_0x219120,_0x19c1c0){return function(_0x2676d2){if(_0x2676d2){var _0x17db47=typeof _0x19c1c0[_0x7a26('0x1d')]==='undefined'&&typeof _0x19c1c0[_0x7a26('0x1e')]===_0x7a26('0x1f');var _0x4736cf=_0x2676d2['count'];var _0x4f4f8e=_0x17db47?0x0:_0x19c1c0[_0x7a26('0x1d')];var _0x18bc5f=_0x17db47?_0x2676d2['count']:_0x19c1c0['offset']+_0x19c1c0[_0x7a26('0x1e')];var _0x58cf05;if(_0x18bc5f>=_0x4736cf){_0x18bc5f=_0x4736cf;_0x58cf05=0xc8;}else{_0x58cf05=0xce;}_0x219120[_0x7a26('0x1a')](_0x58cf05);return _0x219120['set']('Content-Range',_0x4f4f8e+'-'+_0x18bc5f+'/'+_0x4736cf)[_0x7a26('0x1c')](_0x2676d2);}return null;};}function patchUpdates(_0x5019d9){return function(_0x1f5283){try{jsonpatch[_0x7a26('0x20')](_0x1f5283,_0x5019d9,!![]);}catch(_0x200680){return BPromise['reject'](_0x200680);}return _0x1f5283[_0x7a26('0x21')]();};}function saveUpdates(_0x3a37ce,_0x24d947){return function(_0x4da007){if(_0x4da007){return _0x4da007['update'](_0x3a37ce)[_0x7a26('0x22')](function(_0x14178e){return _0x14178e;});}return null;};}function removeEntity(_0xf6745,_0x4f94a7){return function(_0x2fcbee){if(_0x2fcbee){return _0x2fcbee[_0x7a26('0x23')]()[_0x7a26('0x22')](function(){_0xf6745[_0x7a26('0x1a')](0xcc)[_0x7a26('0x1b')]();});}};}function handleEntityNotFound(_0x1f0033,_0x5629af){return function(_0x40df4e){if(!_0x40df4e){_0x1f0033[_0x7a26('0x19')](0x194);}return _0x40df4e;};}function handleError(_0xcdb33e,_0x265e65){_0x265e65=_0x265e65||0x1f4;return function(_0x8829ab){logger[_0x7a26('0x24')](_0x8829ab[_0x7a26('0x25')]);if(_0x8829ab['name']){delete _0x8829ab[_0x7a26('0x26')];}_0xcdb33e['status'](_0x265e65)['send'](_0x8829ab);};}exports['index']=function(_0x1dbf1e,_0x259b62){var _0xf0a536={},_0x37334b={},_0x28a620={'count':0x0,'rows':[]};var _0x5387f2=_[_0x7a26('0x27')](db[_0x7a26('0x28')][_0x7a26('0x29')],function(_0x34104a){return{'name':_0x34104a[_0x7a26('0x2a')],'type':_0x34104a[_0x7a26('0x2b')][_0x7a26('0x2c')]};});_0x37334b['model']=_[_0x7a26('0x27')](_0x5387f2,_0x7a26('0x26'));_0x37334b[_0x7a26('0x2d')]=_[_0x7a26('0x2e')](_0x1dbf1e['query']);_0x37334b[_0x7a26('0x2f')]=_[_0x7a26('0x30')](_0x37334b[_0x7a26('0x31')],_0x37334b[_0x7a26('0x2d')]);_0xf0a536[_0x7a26('0x32')]=_[_0x7a26('0x30')](_0x37334b[_0x7a26('0x31')],qs[_0x7a26('0x33')](_0x1dbf1e['query'][_0x7a26('0x33')]));_0xf0a536[_0x7a26('0x32')]=_0xf0a536[_0x7a26('0x32')][_0x7a26('0x34')]?_0xf0a536[_0x7a26('0x32')]:_0x37334b[_0x7a26('0x31')];if(!_0x1dbf1e[_0x7a26('0x2d')][_0x7a26('0x35')](_0x7a26('0x36'))){_0xf0a536[_0x7a26('0x1e')]=qs['limit'](_0x1dbf1e[_0x7a26('0x2d')][_0x7a26('0x1e')]);_0xf0a536[_0x7a26('0x1d')]=qs[_0x7a26('0x1d')](_0x1dbf1e[_0x7a26('0x2d')][_0x7a26('0x1d')]);}_0xf0a536[_0x7a26('0x37')]=qs[_0x7a26('0x38')](_0x1dbf1e['query'][_0x7a26('0x38')]);_0xf0a536[_0x7a26('0x39')]=qs[_0x7a26('0x2f')](_['pick'](_0x1dbf1e['query'],_0x37334b['filters']),_0x5387f2);if(_0x1dbf1e['query'][_0x7a26('0x3a')]){_0xf0a536[_0x7a26('0x39')]=_[_0x7a26('0x3b')](_0xf0a536['where'],{'$or':_['map'](_0x5387f2,function(_0x111a30){if(_0x111a30['type']!==_0x7a26('0x3c')){var _0x282ab7={};_0x282ab7[_0x111a30[_0x7a26('0x26')]]={'$like':'%'+_0x1dbf1e[_0x7a26('0x2d')]['filter']+'%'};return _0x282ab7;}})});}_0xf0a536=_[_0x7a26('0x3b')]({},_0xf0a536,_0x1dbf1e[_0x7a26('0x3d')]);var _0x12cfc9={'where':_0xf0a536[_0x7a26('0x39')]};return db[_0x7a26('0x28')][_0x7a26('0x3e')](_0x12cfc9)[_0x7a26('0x22')](function(_0x55d15c){_0x28a620[_0x7a26('0x3e')]=_0x55d15c;if(_0x1dbf1e[_0x7a26('0x2d')]['includeAll']){_0xf0a536[_0x7a26('0x3f')]=[{'all':!![]}];}return db['DeskField'][_0x7a26('0x40')](_0xf0a536);})[_0x7a26('0x22')](function(_0x182234){_0x28a620[_0x7a26('0x41')]=_0x182234;return _0x28a620;})[_0x7a26('0x22')](respondWithFilteredResult(_0x259b62,_0xf0a536))['catch'](handleError(_0x259b62,null));};exports['show']=function(_0x2aa634,_0x2dca21){var _0x35dd6f={'raw':!![],'where':{'id':_0x2aa634[_0x7a26('0x42')]['id']}},_0x2d7942={};_0x2d7942[_0x7a26('0x31')]=_[_0x7a26('0x2e')](db[_0x7a26('0x28')]['rawAttributes']);_0x2d7942['query']=_[_0x7a26('0x2e')](_0x2aa634[_0x7a26('0x2d')]);_0x2d7942[_0x7a26('0x2f')]=_[_0x7a26('0x30')](_0x2d7942[_0x7a26('0x31')],_0x2d7942['query']);_0x35dd6f['attributes']=_[_0x7a26('0x30')](_0x2d7942[_0x7a26('0x31')],qs[_0x7a26('0x33')](_0x2aa634['query'][_0x7a26('0x33')]));_0x35dd6f[_0x7a26('0x32')]=_0x35dd6f[_0x7a26('0x32')][_0x7a26('0x34')]?_0x35dd6f[_0x7a26('0x32')]:_0x2d7942[_0x7a26('0x31')];if(_0x2aa634[_0x7a26('0x2d')][_0x7a26('0x43')]){_0x35dd6f[_0x7a26('0x3f')]=[{'all':!![]}];}_0x35dd6f=_[_0x7a26('0x3b')]({},_0x35dd6f,_0x2aa634['options']);return db['DeskField'][_0x7a26('0x44')](_0x35dd6f)['then'](handleEntityNotFound(_0x2dca21,null))[_0x7a26('0x22')](respondWithResult(_0x2dca21,null))['catch'](handleError(_0x2dca21,null));};exports['create']=function(_0x2e5ce,_0x446376){return db['DeskField'][_0x7a26('0x45')](_0x2e5ce['body'],{})[_0x7a26('0x22')](respondWithResult(_0x446376,0xc9))[_0x7a26('0x46')](handleError(_0x446376,null));};exports[_0x7a26('0x47')]=function(_0x1c3654,_0x2206cd){if(_0x1c3654['body']['id']){delete _0x1c3654['body']['id'];}return db[_0x7a26('0x28')][_0x7a26('0x44')]({'where':{'id':_0x1c3654[_0x7a26('0x42')]['id']}})[_0x7a26('0x22')](handleEntityNotFound(_0x2206cd,null))['then'](saveUpdates(_0x1c3654[_0x7a26('0x48')],null))[_0x7a26('0x22')](respondWithResult(_0x2206cd,null))['catch'](handleError(_0x2206cd,null));};exports[_0x7a26('0x23')]=function(_0x54ce85,_0x291e58){return db[_0x7a26('0x28')][_0x7a26('0x44')]({'where':{'id':_0x54ce85[_0x7a26('0x42')]['id']}})['then'](handleEntityNotFound(_0x291e58,null))[_0x7a26('0x22')](removeEntity(_0x291e58,null))[_0x7a26('0x46')](handleError(_0x291e58,null));}; \ No newline at end of file +var _0xe367=['../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','fields','include','find','create','body','catch','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x105e93,_0x7b0e7f){var _0xf9a11a=function(_0x4032d4){while(--_0x4032d4){_0x105e93['push'](_0x105e93['shift']());}};_0xf9a11a(++_0x7b0e7f);}(_0xe367,0x116));var _0x7e36=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xe367[_0x49b207];return _0x2dc8fa;};'use strict';var emlformat=require(_0x7e36('0x0'));var rimraf=require(_0x7e36('0x1'));var zipdir=require(_0x7e36('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7e36('0x3'));var moment=require(_0x7e36('0x4'));var BPromise=require(_0x7e36('0x5'));var Mustache=require(_0x7e36('0x6'));var util=require(_0x7e36('0x7'));var path=require(_0x7e36('0x8'));var sox=require(_0x7e36('0x9'));var csv=require(_0x7e36('0xa'));var ejs=require(_0x7e36('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7e36('0xc'));var crypto=require(_0x7e36('0xd'));var jsforce=require(_0x7e36('0xe'));var deskjs=require(_0x7e36('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7e36('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7e36('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7e36('0x12'));var hardwareService=require(_0x7e36('0x13'));var logger=require(_0x7e36('0x14'))(_0x7e36('0x15'));var utils=require(_0x7e36('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7e36('0x17'));var db=require(_0x7e36('0x18'))['db'];function respondWithStatusCode(_0x278595,_0xee1285){_0xee1285=_0xee1285||0xcc;return function(_0xb77081){if(_0xb77081){return _0x278595[_0x7e36('0x19')](_0xee1285);}return _0x278595[_0x7e36('0x1a')](_0xee1285)[_0x7e36('0x1b')]();};}function respondWithResult(_0x2347d8,_0x3caab1){_0x3caab1=_0x3caab1||0xc8;return function(_0x5535af){if(_0x5535af){return _0x2347d8[_0x7e36('0x1a')](_0x3caab1)[_0x7e36('0x1c')](_0x5535af);}};}function respondWithFilteredResult(_0x25e684,_0x5b8e38){return function(_0x34b95b){if(_0x34b95b){var _0x1c7d7a=typeof _0x5b8e38[_0x7e36('0x1d')]==='undefined'&&typeof _0x5b8e38[_0x7e36('0x1e')]==='undefined';var _0x2536cf=_0x34b95b['count'];var _0xf4aed1=_0x1c7d7a?0x0:_0x5b8e38['offset'];var _0x3c492e=_0x1c7d7a?_0x34b95b[_0x7e36('0x1f')]:_0x5b8e38[_0x7e36('0x1d')]+_0x5b8e38[_0x7e36('0x1e')];var _0x3d46a2;if(_0x3c492e>=_0x2536cf){_0x3c492e=_0x2536cf;_0x3d46a2=0xc8;}else{_0x3d46a2=0xce;}_0x25e684[_0x7e36('0x1a')](_0x3d46a2);return _0x25e684['set'](_0x7e36('0x20'),_0xf4aed1+'-'+_0x3c492e+'/'+_0x2536cf)[_0x7e36('0x1c')](_0x34b95b);}return null;};}function patchUpdates(_0x48bd1f){return function(_0x5c0b1c){try{jsonpatch[_0x7e36('0x21')](_0x5c0b1c,_0x48bd1f,!![]);}catch(_0x58c391){return BPromise[_0x7e36('0x22')](_0x58c391);}return _0x5c0b1c['save']();};}function saveUpdates(_0x5e3590,_0x296d32){return function(_0x20d96c){if(_0x20d96c){return _0x20d96c[_0x7e36('0x23')](_0x5e3590)[_0x7e36('0x24')](function(_0x435d1a){return _0x435d1a;});}return null;};}function removeEntity(_0x4faf43,_0x1af5f9){return function(_0x3ec65e){if(_0x3ec65e){return _0x3ec65e['destroy']()[_0x7e36('0x24')](function(){_0x4faf43[_0x7e36('0x1a')](0xcc)[_0x7e36('0x1b')]();});}};}function handleEntityNotFound(_0x1aed95,_0x58ac22){return function(_0x12e394){if(!_0x12e394){_0x1aed95[_0x7e36('0x19')](0x194);}return _0x12e394;};}function handleError(_0x5b92de,_0x3ae818){_0x3ae818=_0x3ae818||0x1f4;return function(_0x41840a){logger[_0x7e36('0x25')](_0x41840a[_0x7e36('0x26')]);if(_0x41840a[_0x7e36('0x27')]){delete _0x41840a[_0x7e36('0x27')];}_0x5b92de[_0x7e36('0x1a')](_0x3ae818)[_0x7e36('0x28')](_0x41840a);};}exports[_0x7e36('0x29')]=function(_0x20b511,_0x4dcb1e){var _0x22b1a6={},_0x555cdb={},_0x26f4f0={'count':0x0,'rows':[]};var _0x5ddf84=_[_0x7e36('0x2a')](db[_0x7e36('0x2b')][_0x7e36('0x2c')],function(_0x4c991f){return{'name':_0x4c991f[_0x7e36('0x2d')],'type':_0x4c991f[_0x7e36('0x2e')]['key']};});_0x555cdb[_0x7e36('0x2f')]=_[_0x7e36('0x2a')](_0x5ddf84,_0x7e36('0x27'));_0x555cdb[_0x7e36('0x30')]=_[_0x7e36('0x31')](_0x20b511[_0x7e36('0x30')]);_0x555cdb[_0x7e36('0x32')]=_['intersection'](_0x555cdb['model'],_0x555cdb[_0x7e36('0x30')]);_0x22b1a6[_0x7e36('0x33')]=_[_0x7e36('0x34')](_0x555cdb[_0x7e36('0x2f')],qs['fields'](_0x20b511[_0x7e36('0x30')]['fields']));_0x22b1a6[_0x7e36('0x33')]=_0x22b1a6[_0x7e36('0x33')][_0x7e36('0x35')]?_0x22b1a6['attributes']:_0x555cdb['model'];if(!_0x20b511[_0x7e36('0x30')]['hasOwnProperty'](_0x7e36('0x36'))){_0x22b1a6[_0x7e36('0x1e')]=qs['limit'](_0x20b511[_0x7e36('0x30')][_0x7e36('0x1e')]);_0x22b1a6['offset']=qs[_0x7e36('0x1d')](_0x20b511[_0x7e36('0x30')][_0x7e36('0x1d')]);}_0x22b1a6[_0x7e36('0x37')]=qs[_0x7e36('0x38')](_0x20b511[_0x7e36('0x30')][_0x7e36('0x38')]);_0x22b1a6[_0x7e36('0x39')]=qs[_0x7e36('0x32')](_[_0x7e36('0x3a')](_0x20b511['query'],_0x555cdb[_0x7e36('0x32')]),_0x5ddf84);if(_0x20b511['query'][_0x7e36('0x3b')]){_0x22b1a6[_0x7e36('0x39')]=_[_0x7e36('0x3c')](_0x22b1a6['where'],{'$or':_[_0x7e36('0x2a')](_0x5ddf84,function(_0x44c5f8){if(_0x44c5f8[_0x7e36('0x2e')]!==_0x7e36('0x3d')){var _0x1fd3f9={};_0x1fd3f9[_0x44c5f8[_0x7e36('0x27')]]={'$like':'%'+_0x20b511[_0x7e36('0x30')][_0x7e36('0x3b')]+'%'};return _0x1fd3f9;}})});}_0x22b1a6=_[_0x7e36('0x3c')]({},_0x22b1a6,_0x20b511[_0x7e36('0x3e')]);var _0x79454e={'where':_0x22b1a6['where']};return db[_0x7e36('0x2b')][_0x7e36('0x1f')](_0x79454e)['then'](function(_0x5d0f97){_0x26f4f0[_0x7e36('0x1f')]=_0x5d0f97;if(_0x20b511[_0x7e36('0x30')][_0x7e36('0x3f')]){_0x22b1a6['include']=[{'all':!![]}];}return db[_0x7e36('0x2b')][_0x7e36('0x40')](_0x22b1a6);})[_0x7e36('0x24')](function(_0x5f7d2e){_0x26f4f0[_0x7e36('0x41')]=_0x5f7d2e;return _0x26f4f0;})[_0x7e36('0x24')](respondWithFilteredResult(_0x4dcb1e,_0x22b1a6))['catch'](handleError(_0x4dcb1e,null));};exports[_0x7e36('0x42')]=function(_0x53cd6d,_0x2f721c){var _0x11d42b={'raw':!![],'where':{'id':_0x53cd6d[_0x7e36('0x43')]['id']}},_0x218c72={};_0x218c72['model']=_[_0x7e36('0x31')](db[_0x7e36('0x2b')][_0x7e36('0x2c')]);_0x218c72['query']=_['keys'](_0x53cd6d[_0x7e36('0x30')]);_0x218c72[_0x7e36('0x32')]=_['intersection'](_0x218c72['model'],_0x218c72[_0x7e36('0x30')]);_0x11d42b['attributes']=_[_0x7e36('0x34')](_0x218c72[_0x7e36('0x2f')],qs[_0x7e36('0x44')](_0x53cd6d[_0x7e36('0x30')][_0x7e36('0x44')]));_0x11d42b[_0x7e36('0x33')]=_0x11d42b[_0x7e36('0x33')][_0x7e36('0x35')]?_0x11d42b[_0x7e36('0x33')]:_0x218c72[_0x7e36('0x2f')];if(_0x53cd6d['query']['includeAll']){_0x11d42b[_0x7e36('0x45')]=[{'all':!![]}];}_0x11d42b=_[_0x7e36('0x3c')]({},_0x11d42b,_0x53cd6d[_0x7e36('0x3e')]);return db[_0x7e36('0x2b')][_0x7e36('0x46')](_0x11d42b)[_0x7e36('0x24')](handleEntityNotFound(_0x2f721c,null))[_0x7e36('0x24')](respondWithResult(_0x2f721c,null))['catch'](handleError(_0x2f721c,null));};exports[_0x7e36('0x47')]=function(_0x57dbb3,_0x37f6b4){return db[_0x7e36('0x2b')][_0x7e36('0x47')](_0x57dbb3[_0x7e36('0x48')],{})[_0x7e36('0x24')](respondWithResult(_0x37f6b4,0xc9))[_0x7e36('0x49')](handleError(_0x37f6b4,null));};exports[_0x7e36('0x23')]=function(_0x234fee,_0x44969e){if(_0x234fee[_0x7e36('0x48')]['id']){delete _0x234fee[_0x7e36('0x48')]['id'];}return db[_0x7e36('0x2b')]['find']({'where':{'id':_0x234fee['params']['id']}})[_0x7e36('0x24')](handleEntityNotFound(_0x44969e,null))[_0x7e36('0x24')](saveUpdates(_0x234fee['body'],null))[_0x7e36('0x24')](respondWithResult(_0x44969e,null))[_0x7e36('0x49')](handleError(_0x44969e,null));};exports[_0x7e36('0x4a')]=function(_0x14f32b,_0x14ca6e){return db['DeskField'][_0x7e36('0x46')]({'where':{'id':_0x14f32b[_0x7e36('0x43')]['id']}})[_0x7e36('0x24')](handleEntityNotFound(_0x14ca6e,null))[_0x7e36('0x24')](removeEntity(_0x14ca6e,null))[_0x7e36('0x49')](handleError(_0x14ca6e,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 707f959..3234e18 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 _0x749a=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','./intDeskField.attributes','define','int_desk_fields','desk_unique_index','FieldId'];(function(_0x210718,_0x247b55){var _0x541bfc=function(_0x5dbcad){while(--_0x5dbcad){_0x210718['push'](_0x210718['shift']());}};_0x541bfc(++_0x247b55);}(_0x749a,0xd8));var _0xa749=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x749a[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0xa749('0x0'));var logger=require(_0xa749('0x1'))(_0xa749('0x2'));var moment=require(_0xa749('0x3'));var BPromise=require(_0xa749('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa749('0x5'));var rimraf=require('rimraf');var config=require(_0xa749('0x6'));var attributes=require(_0xa749('0x7'));module['exports']=function(_0x377fae,_0x154ab5){return _0x377fae[_0xa749('0x8')]('DeskField',attributes,{'tableName':_0xa749('0x9'),'paranoid':![],'indexes':[{'name':_0xa749('0xa'),'fields':['idField',_0xa749('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x64ba=['int_desk_fields','desk_unique_index','idField','FieldId','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports'];(function(_0x55ccdb,_0x5b5362){var _0x238607=function(_0x8e5d7f){while(--_0x8e5d7f){_0x55ccdb['push'](_0x55ccdb['shift']());}};_0x238607(++_0x5b5362);}(_0x64ba,0x1a8));var _0xa64b=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x64ba[_0x4e676e];return _0x336a3c;};'use strict';var _=require('lodash');var util=require(_0xa64b('0x0'));var logger=require(_0xa64b('0x1'))(_0xa64b('0x2'));var moment=require('moment');var BPromise=require(_0xa64b('0x3'));var rp=require(_0xa64b('0x4'));var fs=require('fs');var path=require(_0xa64b('0x5'));var rimraf=require(_0xa64b('0x6'));var config=require(_0xa64b('0x7'));var attributes=require(_0xa64b('0x8'));module[_0xa64b('0x9')]=function(_0x5a08b4,_0x5a9523){return _0x5a08b4['define']('DeskField',attributes,{'tableName':_0xa64b('0xa'),'paranoid':![],'indexes':[{'name':_0xa64b('0xb'),'fields':[_0xa64b('0xc'),_0xa64b('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index dbdbc0a..1fcab60 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 _0xec28=['stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','DeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x410707,_0x2c8a58){var _0x3f37b1=function(_0x41b70b){while(--_0x41b70b){_0x410707['push'](_0x410707['shift']());}};_0x3f37b1(++_0x2c8a58);}(_0xec28,0x17b));var _0x8ec2=function(_0x5d71fb,_0x5b3f42){_0x5d71fb=_0x5d71fb-0x0;var _0x19bac8=_0xec28[_0x5d71fb];return _0x19bac8;};'use strict';var _=require(_0x8ec2('0x0'));var util=require(_0x8ec2('0x1'));var moment=require(_0x8ec2('0x2'));var BPromise=require(_0x8ec2('0x3'));var rs=require(_0x8ec2('0x4'));var fs=require('fs');var Redis=require(_0x8ec2('0x5'));var db=require(_0x8ec2('0x6'))['db'];var utils=require(_0x8ec2('0x7'));var logger=require(_0x8ec2('0x8'))(_0x8ec2('0x9'));var config=require(_0x8ec2('0xa'));var jayson=require(_0x8ec2('0xb'));var client=jayson[_0x8ec2('0xc')][_0x8ec2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5cf3d8,_0x424967,_0x4a51eb){return new BPromise(function(_0x29e42a,_0x4cd833){return client['request'](_0x5cf3d8,_0x4a51eb)['then'](function(_0x5195f8){logger[_0x8ec2('0xe')](_0x8ec2('0xf'),_0x424967,_0x8ec2('0x10'));logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0x424967,_0x8ec2('0x10'),JSON[_0x8ec2('0x11')](_0x5195f8));if(_0x5195f8[_0x8ec2('0x12')]){if(_0x5195f8[_0x8ec2('0x12')][_0x8ec2('0x13')]===0x1f4){logger['error'](_0x8ec2('0xf'),_0x424967,_0x5195f8[_0x8ec2('0x12')][_0x8ec2('0x14')]);return _0x4cd833(_0x5195f8['error']['message']);}logger[_0x8ec2('0x12')](_0x8ec2('0xf'),_0x424967,_0x5195f8[_0x8ec2('0x12')][_0x8ec2('0x14')]);return _0x29e42a(_0x5195f8['error'][_0x8ec2('0x14')]);}else{logger[_0x8ec2('0xe')](_0x8ec2('0xf'),_0x424967,_0x8ec2('0x10'));_0x29e42a(_0x5195f8[_0x8ec2('0x15')][_0x8ec2('0x14')]);}})['catch'](function(_0x37677d){logger['error'](_0x8ec2('0xf'),_0x424967,_0x37677d);_0x4cd833(_0x37677d);});});} \ No newline at end of file +var _0xc283=['request','then','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x2d9e27,_0x5965b2){var _0xd35381=function(_0x343d18){while(--_0x343d18){_0x2d9e27['push'](_0x2d9e27['shift']());}};_0xd35381(++_0x5965b2);}(_0xc283,0x11b));var _0x3c28=function(_0x117703,_0x1ead15){_0x117703=_0x117703-0x0;var _0x3f9e90=_0xc283[_0x117703];return _0x3f9e90;};'use strict';var _=require('lodash');var util=require(_0x3c28('0x0'));var moment=require(_0x3c28('0x1'));var BPromise=require('bluebird');var rs=require(_0x3c28('0x2'));var fs=require('fs');var Redis=require(_0x3c28('0x3'));var db=require(_0x3c28('0x4'))['db'];var utils=require(_0x3c28('0x5'));var logger=require(_0x3c28('0x6'))('rpc');var config=require(_0x3c28('0x7'));var jayson=require(_0x3c28('0x8'));var client=jayson[_0x3c28('0x9')][_0x3c28('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x277b8f,_0x34418b,_0x10e867){return new BPromise(function(_0x5a2ebd,_0x3515d3){return client[_0x3c28('0xb')](_0x277b8f,_0x10e867)[_0x3c28('0xc')](function(_0x4d8e28){logger['info'](_0x3c28('0xd'),_0x34418b,_0x3c28('0xe'));logger['debug'](_0x3c28('0xf'),_0x34418b,_0x3c28('0xe'),JSON['stringify'](_0x4d8e28));if(_0x4d8e28[_0x3c28('0x10')]){if(_0x4d8e28['error']['code']===0x1f4){logger[_0x3c28('0x10')](_0x3c28('0xd'),_0x34418b,_0x4d8e28[_0x3c28('0x10')][_0x3c28('0x11')]);return _0x3515d3(_0x4d8e28[_0x3c28('0x10')][_0x3c28('0x11')]);}logger[_0x3c28('0x10')](_0x3c28('0xd'),_0x34418b,_0x4d8e28[_0x3c28('0x10')][_0x3c28('0x11')]);return _0x5a2ebd(_0x4d8e28['error'][_0x3c28('0x11')]);}else{logger[_0x3c28('0x12')]('DeskField,\x20%s,\x20%s',_0x34418b,_0x3c28('0xe'));_0x5a2ebd(_0x4d8e28[_0x3c28('0x13')]['message']);}})[_0x3c28('0x14')](function(_0x2fd22e){logger[_0x3c28('0x10')](_0x3c28('0xd'),_0x34418b,_0x2fd22e);_0x3515d3(_0x2fd22e);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 032bed7..f990e2f 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 _0x1a5f=['/:id/configurations','addConfiguration','delete','destroy','exports','util','express','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','getConfigurations','getFields','post'];(function(_0x29a134,_0x194c27){var _0x136398=function(_0x1def82){while(--_0x1def82){_0x29a134['push'](_0x29a134['shift']());}};_0x136398(++_0x194c27);}(_0x1a5f,0x83));var _0xf1a5=function(_0x43dfe7,_0x31315c){_0x43dfe7=_0x43dfe7-0x0;var _0x5094f9=_0x1a5f[_0x43dfe7];return _0x5094f9;};'use strict';var multer=require('multer');var util=require(_0xf1a5('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf1a5('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf1a5('0x2'));var interaction=require(_0xf1a5('0x3'));var config=require('../../config/environment');var controller=require(_0xf1a5('0x4'));router[_0xf1a5('0x5')]('/',auth[_0xf1a5('0x6')](),controller[_0xf1a5('0x7')]);router[_0xf1a5('0x5')](_0xf1a5('0x8'),auth[_0xf1a5('0x6')](),controller[_0xf1a5('0x9')]);router[_0xf1a5('0x5')]('/:id/configurations',auth[_0xf1a5('0x6')](),controller[_0xf1a5('0xa')]);router[_0xf1a5('0x5')]('/:id/fields',auth[_0xf1a5('0x6')](),controller[_0xf1a5('0xb')]);router[_0xf1a5('0xc')]('/',auth[_0xf1a5('0x6')](),controller['create']);router[_0xf1a5('0xc')](_0xf1a5('0xd'),auth['isAuthenticated'](),controller[_0xf1a5('0xe')]);router['put'](_0xf1a5('0x8'),auth[_0xf1a5('0x6')](),controller['update']);router[_0xf1a5('0xf')](_0xf1a5('0x8'),auth[_0xf1a5('0x6')](),controller[_0xf1a5('0x10')]);module[_0xf1a5('0x11')]=router; \ No newline at end of file +var _0xd1ab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','update','delete','destroy','exports','multer','util'];(function(_0x4d3ddf,_0x4057ca){var _0x7755e0=function(_0x2e7577){while(--_0x2e7577){_0x4d3ddf['push'](_0x4d3ddf['shift']());}};_0x7755e0(++_0x4057ca);}(_0xd1ab,0x71));var _0xbd1a=function(_0x4b2d59,_0x2417cf){_0x4b2d59=_0x4b2d59-0x0;var _0xcc89a3=_0xd1ab[_0x4b2d59];return _0xcc89a3;};'use strict';var multer=require(_0xbd1a('0x0'));var util=require(_0xbd1a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbd1a('0x2'));var router=express[_0xbd1a('0x3')]();var fs_extra=require(_0xbd1a('0x4'));var auth=require(_0xbd1a('0x5'));var interaction=require(_0xbd1a('0x6'));var config=require('../../config/environment');var controller=require(_0xbd1a('0x7'));router[_0xbd1a('0x8')]('/',auth['isAuthenticated'](),controller[_0xbd1a('0x9')]);router['get'](_0xbd1a('0xa'),auth[_0xbd1a('0xb')](),controller[_0xbd1a('0xc')]);router[_0xbd1a('0x8')]('/:id/configurations',auth[_0xbd1a('0xb')](),controller['getConfigurations']);router[_0xbd1a('0x8')](_0xbd1a('0xd'),auth[_0xbd1a('0xb')](),controller[_0xbd1a('0xe')]);router[_0xbd1a('0xf')]('/',auth['isAuthenticated'](),controller[_0xbd1a('0x10')]);router['post'](_0xbd1a('0x11'),auth[_0xbd1a('0xb')](),controller[_0xbd1a('0x12')]);router['put']('/:id',auth[_0xbd1a('0xb')](),controller[_0xbd1a('0x13')]);router[_0xbd1a('0x14')](_0xbd1a('0xa'),auth[_0xbd1a('0xb')](),controller[_0xbd1a('0x15')]);module[_0xbd1a('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 852c662..17937ff 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 _0x3bd7=['STRING'];(function(_0x58220a,_0x3545b5){var _0x30e125=function(_0x4aafd){while(--_0x4aafd){_0x58220a['push'](_0x58220a['shift']());}};_0x30e125(++_0x3545b5);}(_0x3bd7,0x199));var _0x73bd=function(_0x3a94e1,_0x22e4fd){_0x3a94e1=_0x3a94e1-0x0;var _0x6a09d5=_0x3bd7[_0x3a94e1];return _0x6a09d5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x73bd('0x0')]},'username':{'type':Sequelize[_0x73bd('0x0')]},'password':{'type':Sequelize[_0x73bd('0x0')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x73bd('0x0')]},'clientId':{'type':Sequelize[_0x73bd('0x0')]},'clientSecret':{'type':Sequelize[_0x73bd('0x0')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x73bd('0x0')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xea81=['STRING','sequelize','exports'];(function(_0xa0a951,_0x15bddc){var _0x4d1edc=function(_0x8288d2){while(--_0x8288d2){_0xa0a951['push'](_0xa0a951['shift']());}};_0x4d1edc(++_0x15bddc);}(_0xea81,0x1ed));var _0x1ea8=function(_0x2c55d3,_0x51d183){_0x2c55d3=_0x2c55d3-0x0;var _0x4d069c=_0xea81[_0x2c55d3];return _0x4d069c;};'use strict';var Sequelize=require(_0x1ea8('0x0'));module[_0x1ea8('0x1')]={'name':{'type':Sequelize[_0x1ea8('0x2')]},'username':{'type':Sequelize[_0x1ea8('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x1ea8('0x2')]},'clientId':{'type':Sequelize[_0x1ea8('0x2')]},'clientSecret':{'type':Sequelize[_0x1ea8('0x2')]},'serverUrl':{'type':Sequelize[_0x1ea8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1ea8('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 537e179..774b3aa 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 _0x4ee3=['directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyname','createdon','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','exchangerate','followupby','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','productidname','productserialnumber','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statecode','subjectidname','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','clientId','clientSecret','modernAuthentication','CloudProvider','data5','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','stack','test','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','Value','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','DisplayName',')/Microsoft.Dynamics.CRM.','request-promise','util','lodash','../../config/logger','api','../../components/integrations/configuration','json','offset','undefined','count','limit','status','set','Content-Range','update','then','destroy','end','sendStatus','error','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','name','filter','options','Dynamics365Account','findAll','rows','catch','show','length','includeAll','include','find','create','body','params','getConfigurations','findOne','Dynamics365Configuration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','ticketType','incident','Incident','title','description','customerid','ownerid','caseorigincode','subject'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x4ee3,0x120));var _0x34ee=function(_0x1c6524,_0x5df076){_0x1c6524=_0x1c6524-0x0;var _0x12f4fd=_0x4ee3[_0x1c6524];return _0x12f4fd;};'use strict';var rp=require(_0x34ee('0x0'));var util=require(_0x34ee('0x1'));var _=require(_0x34ee('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x34ee('0x3'))(_0x34ee('0x4'));var db=require('../../mysqldb')['db'];var integrations=require(_0x34ee('0x5'));function respondWithResult(_0x393fe2,_0x56c5b3){_0x56c5b3=_0x56c5b3||0xc8;return function(_0x3ccca2){if(_0x3ccca2){return _0x393fe2['status'](_0x56c5b3)[_0x34ee('0x6')](_0x3ccca2);}};}function respondWithFilteredResult(_0x12abdb,_0x30f0c4){return function(_0x5b5c31){if(_0x5b5c31){var _0x1ee995=typeof _0x30f0c4[_0x34ee('0x7')]==='undefined'&&typeof _0x30f0c4['limit']===_0x34ee('0x8');var _0x377a36=_0x5b5c31[_0x34ee('0x9')];var _0x3836d4=_0x1ee995?0x0:_0x30f0c4[_0x34ee('0x7')];var _0x17696f=_0x1ee995?_0x5b5c31['count']:_0x30f0c4['offset']+_0x30f0c4[_0x34ee('0xa')];var _0x12169c;if(_0x17696f>=_0x377a36){_0x17696f=_0x377a36;_0x12169c=0xc8;}else{_0x12169c=0xce;}_0x12abdb[_0x34ee('0xb')](_0x12169c);return _0x12abdb[_0x34ee('0xc')](_0x34ee('0xd'),_0x3836d4+'-'+_0x17696f+'/'+_0x377a36)['json'](_0x5b5c31);}return null;};}function saveUpdates(_0x5987d0){return function(_0xb5bdc4){if(_0xb5bdc4){return _0xb5bdc4[_0x34ee('0xe')](_0x5987d0)[_0x34ee('0xf')](function(_0x329beb){return _0x329beb;});}return null;};}function removeEntity(_0x57a429){return function(_0x560214){if(_0x560214){return _0x560214[_0x34ee('0x10')]()[_0x34ee('0xf')](function(){_0x57a429[_0x34ee('0xb')](0xcc)[_0x34ee('0x11')]();});}};}function handleEntityNotFound(_0x365b6e){return function(_0x2cba9a){if(!_0x2cba9a){_0x365b6e[_0x34ee('0x12')](0x194);}return _0x2cba9a;};}function handleError(_0x5c989d,_0x4ad9d0){_0x4ad9d0=_0x4ad9d0||0x1f4;return function(_0x55839e){logger[_0x34ee('0x13')](_0x55839e['stack']);if(_0x55839e['name']){delete _0x55839e['name'];}_0x5c989d[_0x34ee('0xb')](_0x4ad9d0)[_0x34ee('0x14')](_0x55839e);};}exports['index']=function(_0x3277f5,_0xb154f3){var _0x4838fd={},_0x6f3f5={},_0x2081df={'count':0x0,'rows':[]};var _0x8b12ba=_[_0x34ee('0x15')](db['Dynamics365Account'][_0x34ee('0x16')],function(_0x2f118c){return{'name':_0x2f118c[_0x34ee('0x17')],'type':_0x2f118c[_0x34ee('0x18')]['key']};});_0x6f3f5[_0x34ee('0x19')]=_['map'](_0x8b12ba,'name');_0x6f3f5[_0x34ee('0x1a')]=_[_0x34ee('0x1b')](_0x3277f5[_0x34ee('0x1a')]);_0x6f3f5[_0x34ee('0x1c')]=_[_0x34ee('0x1d')](_0x6f3f5[_0x34ee('0x19')],_0x6f3f5[_0x34ee('0x1a')]);_0x4838fd['attributes']=_[_0x34ee('0x1d')](_0x6f3f5[_0x34ee('0x19')],qs[_0x34ee('0x1e')](_0x3277f5[_0x34ee('0x1a')]['fields']));_0x4838fd[_0x34ee('0x1f')]=_0x4838fd[_0x34ee('0x1f')]['length']?_0x4838fd[_0x34ee('0x1f')]:_0x6f3f5[_0x34ee('0x19')];if(!_0x3277f5['query'][_0x34ee('0x20')](_0x34ee('0x21'))){_0x4838fd['limit']=qs[_0x34ee('0xa')](_0x3277f5[_0x34ee('0x1a')][_0x34ee('0xa')]);_0x4838fd[_0x34ee('0x7')]=qs['offset'](_0x3277f5[_0x34ee('0x1a')][_0x34ee('0x7')]);}_0x4838fd[_0x34ee('0x22')]=qs[_0x34ee('0x23')](_0x3277f5[_0x34ee('0x1a')]['sort']);_0x4838fd[_0x34ee('0x24')]=qs[_0x34ee('0x1c')](_[_0x34ee('0x25')](_0x3277f5[_0x34ee('0x1a')],_0x6f3f5[_0x34ee('0x1c')]),_0x8b12ba);if(_0x3277f5['query']['filter']){_0x4838fd['where']=_[_0x34ee('0x26')](_0x4838fd[_0x34ee('0x24')],{'$or':_['map'](_0x8b12ba,function(_0x15d1f4){if(_0x15d1f4[_0x34ee('0x18')]!==_0x34ee('0x27')){var _0x5cf31b={};_0x5cf31b[_0x15d1f4[_0x34ee('0x28')]]={'$like':'%'+_0x3277f5[_0x34ee('0x1a')][_0x34ee('0x29')]+'%'};return _0x5cf31b;}})});}_0x4838fd=_[_0x34ee('0x26')]({},_0x4838fd,_0x3277f5[_0x34ee('0x2a')]);var _0x3307a8={'where':_0x4838fd[_0x34ee('0x24')]};return db[_0x34ee('0x2b')][_0x34ee('0x9')](_0x3307a8)['then'](function(_0x41f7ae){_0x2081df[_0x34ee('0x9')]=_0x41f7ae;if(_0x3277f5[_0x34ee('0x1a')]['includeAll']){_0x4838fd['include']=[{'all':!![]}];}return db[_0x34ee('0x2b')][_0x34ee('0x2c')](_0x4838fd);})[_0x34ee('0xf')](function(_0x5ab22d){_0x2081df[_0x34ee('0x2d')]=_0x5ab22d;return _0x2081df;})[_0x34ee('0xf')](respondWithFilteredResult(_0xb154f3,_0x4838fd))[_0x34ee('0x2e')](handleError(_0xb154f3,null));};exports[_0x34ee('0x2f')]=function(_0x3ee0ad,_0x413ae0){var _0x3f7ad7={'raw':![],'where':{'id':_0x3ee0ad['params']['id']}},_0x3ec94a={};_0x3ec94a[_0x34ee('0x19')]=_[_0x34ee('0x1b')](db[_0x34ee('0x2b')][_0x34ee('0x16')]);_0x3ec94a['query']=_[_0x34ee('0x1b')](_0x3ee0ad['query']);_0x3ec94a[_0x34ee('0x1c')]=_[_0x34ee('0x1d')](_0x3ec94a[_0x34ee('0x19')],_0x3ec94a[_0x34ee('0x1a')]);_0x3f7ad7[_0x34ee('0x1f')]=_[_0x34ee('0x1d')](_0x3ec94a[_0x34ee('0x19')],qs['fields'](_0x3ee0ad[_0x34ee('0x1a')]['fields']));_0x3f7ad7[_0x34ee('0x1f')]=_0x3f7ad7['attributes'][_0x34ee('0x30')]?_0x3f7ad7['attributes']:_0x3ec94a[_0x34ee('0x19')];if(_0x3ee0ad[_0x34ee('0x1a')][_0x34ee('0x31')]){_0x3f7ad7[_0x34ee('0x32')]=[{'all':!![]}];}_0x3f7ad7=_[_0x34ee('0x26')]({},_0x3f7ad7,_0x3ee0ad[_0x34ee('0x2a')]);return db[_0x34ee('0x2b')][_0x34ee('0x33')](_0x3f7ad7)['then'](handleEntityNotFound(_0x413ae0,null))['then'](respondWithResult(_0x413ae0,null))[_0x34ee('0x2e')](handleError(_0x413ae0,null));};exports[_0x34ee('0x34')]=function(_0x232dbf,_0x1614e6){return db[_0x34ee('0x2b')]['create'](_0x232dbf[_0x34ee('0x35')],{})[_0x34ee('0xf')](respondWithResult(_0x1614e6,0xc9))['catch'](handleError(_0x1614e6,null));};exports['update']=function(_0x1a6a68,_0x17cc98){if(_0x1a6a68[_0x34ee('0x35')]['id']){delete _0x1a6a68[_0x34ee('0x35')]['id'];}return db[_0x34ee('0x2b')][_0x34ee('0x33')]({'where':{'id':_0x1a6a68[_0x34ee('0x36')]['id']}})[_0x34ee('0xf')](handleEntityNotFound(_0x17cc98,null))[_0x34ee('0xf')](saveUpdates(_0x1a6a68[_0x34ee('0x35')],null))[_0x34ee('0xf')](respondWithResult(_0x17cc98,null))[_0x34ee('0x2e')](handleError(_0x17cc98,null));};exports[_0x34ee('0x10')]=function(_0x4c7caa,_0x37fa84){return db[_0x34ee('0x2b')][_0x34ee('0x33')]({'where':{'id':_0x4c7caa[_0x34ee('0x36')]['id']}})[_0x34ee('0xf')](handleEntityNotFound(_0x37fa84,null))[_0x34ee('0xf')](removeEntity(_0x37fa84,null))[_0x34ee('0x2e')](handleError(_0x37fa84,null));};exports[_0x34ee('0x37')]=function(_0x100f42,_0x1438e4){var _0x41b3e7={};var _0xc883b7={};var _0x2aa559;var _0x101d4d;return db[_0x34ee('0x2b')][_0x34ee('0x38')]({'where':{'id':_0x100f42[_0x34ee('0x36')]['id']}})[_0x34ee('0xf')](handleEntityNotFound(_0x1438e4,null))[_0x34ee('0xf')](function(_0x1f5799){if(_0x1f5799){_0x2aa559=_0x1f5799;_0xc883b7['model']=_[_0x34ee('0x1b')](db[_0x34ee('0x39')][_0x34ee('0x16')]);_0xc883b7[_0x34ee('0x1a')]=_[_0x34ee('0x1b')](_0x100f42['query']);_0xc883b7['filters']=_[_0x34ee('0x1d')](_0xc883b7[_0x34ee('0x19')],_0xc883b7[_0x34ee('0x1a')]);_0x41b3e7[_0x34ee('0x1f')]=_['intersection'](_0xc883b7[_0x34ee('0x19')],qs['fields'](_0x100f42[_0x34ee('0x1a')][_0x34ee('0x1e')]));_0x41b3e7[_0x34ee('0x1f')]=_0x41b3e7[_0x34ee('0x1f')]['length']?_0x41b3e7['attributes']:_0xc883b7['model'];_0x41b3e7[_0x34ee('0x22')]=qs['sort'](_0x100f42[_0x34ee('0x1a')][_0x34ee('0x23')]);_0x41b3e7[_0x34ee('0x24')]=qs['filters'](_[_0x34ee('0x25')](_0x100f42['query'],_0xc883b7[_0x34ee('0x1c')]));if(_0x100f42[_0x34ee('0x1a')][_0x34ee('0x29')]){_0x41b3e7[_0x34ee('0x24')]=_[_0x34ee('0x26')](_0x41b3e7['where'],{'$or':_[_0x34ee('0x15')](_0x41b3e7['attributes'],function(_0x3ad6c8){var _0x1083f3={};_0x1083f3[_0x3ad6c8]={'$like':'%'+_0x100f42[_0x34ee('0x1a')][_0x34ee('0x29')]+'%'};return _0x1083f3;})});}_0x41b3e7=_[_0x34ee('0x26')]({},_0x41b3e7,_0x100f42[_0x34ee('0x2a')]);return _0x2aa559[_0x34ee('0x37')](_0x41b3e7);}})[_0x34ee('0xf')](function(_0x265a3f){if(_0x265a3f){_0x101d4d=_0x265a3f[_0x34ee('0x30')];if(!_0x100f42[_0x34ee('0x1a')][_0x34ee('0x20')]('nolimit')){_0x41b3e7[_0x34ee('0xa')]=qs[_0x34ee('0xa')](_0x100f42[_0x34ee('0x1a')][_0x34ee('0xa')]);_0x41b3e7[_0x34ee('0x7')]=qs[_0x34ee('0x7')](_0x100f42[_0x34ee('0x1a')][_0x34ee('0x7')]);}return _0x2aa559[_0x34ee('0x37')](_0x41b3e7);}})[_0x34ee('0xf')](function(_0x71c685){if(_0x71c685){return _0x71c685?{'count':_0x101d4d,'rows':_0x71c685}:null;}})['then'](respondWithResult(_0x1438e4,null))[_0x34ee('0x2e')](handleError(_0x1438e4,null));};exports[_0x34ee('0x3a')]=function(_0x58333d,_0x1526d6){if(_0x58333d[_0x34ee('0x35')]['id']){delete _0x58333d['body']['id'];}return db['Dynamics365Account'][_0x34ee('0x38')]({'where':{'id':_0x58333d['params']['id']}})[_0x34ee('0xf')](handleEntityNotFound(_0x1526d6,null))[_0x34ee('0xf')](function(_0x9e1e16){if(_0x9e1e16){_0x58333d[_0x34ee('0x35')][_0x34ee('0x3b')]=_0x9e1e16['id'];_0x58333d[_0x34ee('0x35')][_0x34ee('0x3c')]=integrations[_0x34ee('0x3d')](_0x58333d[_0x34ee('0x35')][_0x34ee('0x3e')],_0x58333d[_0x34ee('0x35')]['type']);_0x58333d[_0x34ee('0x35')][_0x34ee('0x3f')]=integrations[_0x34ee('0x40')](_0x58333d['body']['channel'],_0x58333d[_0x34ee('0x35')]['type']);return db[_0x34ee('0x39')]['create'](_0x58333d[_0x34ee('0x35')],{'include':[{'model':db[_0x34ee('0x41')],'as':_0x34ee('0x3c')},{'model':db[_0x34ee('0x41')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x1526d6,null))[_0x34ee('0x2e')](handleError(_0x1526d6,null));};function sanitizeRemoteUri(_0x449c86){var _0x1e6cdd=_0x449c86[_0x34ee('0x42')](-0x1);if(_0x1e6cdd==='/')return _0x449c86[_0x34ee('0x43')](0x0,_0x449c86[_0x34ee('0x44')](_0x1e6cdd));return _0x449c86;}function getWebApiUrl(_0x465c05){return util[_0x34ee('0x45')](_0x34ee('0x46'),_0x465c05);}exports['getFields']=function(_0x442740,_0x38ec8e){var _0x1a5d4e=_0x442740['query'][_0x34ee('0x47')];var _0x3c4ef9=_0x1a5d4e===_0x34ee('0x48')?_0x34ee('0x49'):'PhoneCall';var _0x52b331='';var _0x3a2f3c='';var _0x3ce280='';var _0x7a32a6='';var _0x4ced77='';var _0x2c413f='';var _0x397d79='';var _0x24734f='';var _0x219e48=[_0x34ee('0x4a'),_0x34ee('0x4b'),_0x34ee('0x4c'),_0x34ee('0x4d'),_0x34ee('0x4e'),_0x34ee('0x4f'),'phonenumber','regardingobjectid',_0x34ee('0x50'),_0x34ee('0x51')];var _0x1322b3=['accountidname',_0x34ee('0x52'),_0x34ee('0x53'),_0x34ee('0x54'),_0x34ee('0x55'),_0x34ee('0x56'),_0x34ee('0x57'),'contractidname',_0x34ee('0x58'),'createdbyexternalpartyyominame',_0x34ee('0x59'),'createdbyyominame',_0x34ee('0x5a'),'createdonbehalfbyname',_0x34ee('0x5b'),_0x34ee('0x5c'),_0x34ee('0x5d'),_0x34ee('0x5e'),_0x34ee('0x5f'),'entitlementidname',_0x34ee('0x60'),_0x34ee('0x61'),'escalatedon',_0x34ee('0x62'),'firstresponsebykpiidname',_0x34ee('0x63'),_0x34ee('0x64'),'influencescore',_0x34ee('0x65'),_0x34ee('0x66'),_0x34ee('0x67'),_0x34ee('0x68'),_0x34ee('0x69'),_0x34ee('0x6a'),'modifiedbyyominame',_0x34ee('0x6b'),_0x34ee('0x6c'),_0x34ee('0x6d'),_0x34ee('0x6e'),_0x34ee('0x6f'),_0x34ee('0x70'),_0x34ee('0x71'),_0x34ee('0x72'),_0x34ee('0x73'),_0x34ee('0x74'),_0x34ee('0x75'),_0x34ee('0x76'),_0x34ee('0x77'),_0x34ee('0x78'),'prioritycodename',_0x34ee('0x79'),_0x34ee('0x7a'),'resolveby','resolvebykpiidname','responseby','responsiblecontactidname',_0x34ee('0x7b'),'sentimentvalue',_0x34ee('0x7c'),_0x34ee('0x7d'),_0x34ee('0x7e'),_0x34ee('0x7f'),'statuscode',_0x34ee('0x80'),'ticketnumber',_0x34ee('0x81'),'transactioncurrencyidname',_0x34ee('0x82'),_0x34ee('0x83'),_0x34ee('0x84')];var _0x1ce66d=_0x219e48[_0x34ee('0x85')](_0x1322b3);return db[_0x34ee('0x2b')]['findOne']({'where':{'id':_0x442740[_0x34ee('0x36')]['id']},'attributes':['id',_0x34ee('0x86'),_0x34ee('0x87'),'remoteUri','tenantId',_0x34ee('0x88'),_0x34ee('0x89'),_0x34ee('0x8a')],'include':[{'model':db[_0x34ee('0x8b')],'as':'CloudProvider','attributes':['id',_0x34ee('0x8c'),'data7']}]})[_0x34ee('0xf')](handleEntityNotFound(_0x38ec8e,null))[_0x34ee('0xf')](function(_0x160704){if(_0x160704){if(_0x160704['modernAuthentication']){_0x160704['access_token']=_0x160704[_0x34ee('0x8b')]['data5'];_0x24734f=sanitizeRemoteUri(_0x160704['CloudProvider']['data7']);_0x397d79=getWebApiUrl(_0x24734f);return _0x160704;}_0x24734f=sanitizeRemoteUri(_0x160704['remoteUri']);_0x397d79=getWebApiUrl(_0x24734f);var _0x3bcf7a={'method':_0x34ee('0x8d'),'uri':_0x34ee('0x8e')+_0x160704[_0x34ee('0x8f')]+_0x34ee('0x90'),'form':{'client_id':_0x160704[_0x34ee('0x88')],'resource':_0x24734f,'username':_0x160704['username'],'password':_0x160704[_0x34ee('0x87')],'grant_type':_0x34ee('0x87'),'client_secret':_0x160704['clientSecret']},'json':!![]};return rp(_0x3bcf7a);}})[_0x34ee('0xf')](function(_0x17cd86){_0x2c413f=_0x17cd86[_0x34ee('0x91')];var _0x3981f2={'method':_0x34ee('0x92'),'uri':encodeURI(_0x397d79+_0x34ee('0x93')+_0x3c4ef9+'\x27'),'headers':{'Authorization':_0x34ee('0x94')+_0x2c413f,'If-None-Match':null,'OData-Version':_0x34ee('0x95')},'json':!![]};return rp(_0x3981f2);})['then'](function(_0xd66dce){var _0x4b8559=_0xd66dce[_0x34ee('0x96')][0x0];var _0xb732f3=_0x4b8559[_0x34ee('0x97')];var _0x4bb719={'method':_0x34ee('0x92'),'uri':_0x397d79+_0x34ee('0x98')+_0xb732f3+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':'Bearer\x20'+_0x2c413f,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4bb719);})[_0x34ee('0xf')](function(_0x321b25){_0x52b331=_0x321b25;_0x3a2f3c=_0x52b331['Attributes'];_0x3a2f3c=_[_0x34ee('0x99')](_0x3a2f3c,function(_0x185963){return!_0x1ce66d[_0x34ee('0x9a')](_0x185963[_0x34ee('0x9b')]);});var _0x1b2db8=[];var _0x337171=[];_0x3a2f3c[_0x34ee('0x9c')](function(_0x5d8ec2){if(_0x5d8ec2[_0x34ee('0x9d')]){var _0x47272f=_0x5d8ec2[_0x34ee('0x9d')][_0x34ee('0x43')](_0x5d8ec2['@odata.type'][_0x34ee('0x44')]('.')+0x1);if(_0x47272f===_0x34ee('0x9e')){_0x1b2db8[_0x34ee('0x9f')](getSelectList(_0x397d79,_0x1a5d4e,_0x337171,_0x52b331[_0x34ee('0x97')],_0x5d8ec2[_0x34ee('0x97')],_0x2c413f));}}});return Promise[_0x34ee('0xa0')](_0x1b2db8);})[_0x34ee('0xf')](function(_0x4b934b){_0x3ce280=_0x4b934b[0x0];var _0x4206d5=[];var _0x192fdc=[];_0x3a2f3c['forEach'](function(_0x2d8e34){if(!_[_0x34ee('0xa1')](_0x2d8e34[_0x34ee('0x9d')])){var _0x347f85=_0x2d8e34[_0x34ee('0x9d')][_0x34ee('0x43')](_0x2d8e34[_0x34ee('0x9d')][_0x34ee('0x44')]('.')+0x1);if(_0x347f85==='BooleanAttributeMetadata'){_0x4206d5[_0x34ee('0x9f')](getBooleanList(_0x397d79,_0x1a5d4e,_0x192fdc,_0x52b331[_0x34ee('0x97')],_0x2d8e34[_0x34ee('0x97')],_0x2c413f));}}});return Promise[_0x34ee('0xa0')](_0x4206d5);})[_0x34ee('0xf')](function(_0x1f2c7a){_0x7a32a6=_0x1f2c7a[0x0];var _0x431951=[];var _0x2ef22e=[];_0x3a2f3c[_0x34ee('0x9c')](function(_0x513840){if(_0x513840[_0x34ee('0x9d')]){var _0x1dce77=_0x513840[_0x34ee('0x9d')][_0x34ee('0x43')](_0x513840['@odata.type']['lastIndexOf']('.')+0x1);if(_0x1dce77===_0x34ee('0xa2')||_0x1dce77===_0x34ee('0xa3')||_0x1dce77===_0x34ee('0xa4')||_0x1dce77==='IntegerAttributeMetadata'||_0x1dce77===_0x34ee('0xa5')||_0x1dce77==='DateTimeAttributeMetadata'||_0x1dce77===_0x34ee('0xa6')||_0x1dce77==='EntityNameAttributeMetadata'||_0x1dce77===_0x34ee('0xa7')||_0x1dce77===_0x34ee('0xa8')){_0x431951[_0x34ee('0x9f')](getInputList(_0x397d79,_0x1a5d4e,_0x1dce77,_0x2ef22e,_0x52b331[_0x34ee('0x97')],_0x513840[_0x34ee('0x97')],_0x2c413f));}}});return Promise[_0x34ee('0xa0')](_0x431951);})['then'](function(_0x385380){_0x4ced77=_0x385380[0x0];var _0x31b754=_0x3ce280['concat'](_0x7a32a6)[_0x34ee('0x85')](_0x4ced77);var _0x2c9e17={'count':_0x31b754[_0x34ee('0x30')],'rows':_0x31b754};return _0x2c9e17;})['then'](respondWithResult(_0x38ec8e,null))['catch'](function(_0x432efd){var _0x11c952=_0x442740[_0x34ee('0x1a')]['test']?0x1f4:_0x432efd[_0x34ee('0xa9')]||0x1f4;logger[_0x34ee('0x13')](_0x432efd[_0x34ee('0xaa')]);delete _0x432efd['name'];if(_0x11c952===0x191){_0x11c952=0x190;}_0x38ec8e[_0x34ee('0xb')](_0x11c952)['send'](_0x442740[_0x34ee('0x1a')][_0x34ee('0xab')]?{'message':_0x34ee('0xac'),'statusCode':_0x432efd[_0x34ee('0xa9')]}:_0x432efd);});};function getSelectList(_0x38108e,_0x23c4b5,_0x1306ff,_0x501c68,_0x3ace58,_0x4ba3a0){var _0x2a1851={'method':_0x34ee('0x92'),'uri':_0x38108e+_0x34ee('0x98')+_0x501c68+_0x34ee('0xad')+_0x3ace58+_0x34ee('0xae')+_0x34ee('0xaf'),'headers':{'Authorization':'Bearer\x20'+_0x4ba3a0,'If-None-Match':null,'OData-Version':_0x34ee('0x95')},'json':!![]};return rp(_0x2a1851)[_0x34ee('0xf')](function(_0xf32ce4){var _0xbd92e2=[];var _0x46d2ef=_0xf32ce4[_0x34ee('0xb0')][_0x34ee('0xb1')];_0x46d2ef[_0x34ee('0x9c')](function(_0x3bb533){_0xbd92e2['push']({'name':_0x3bb533[_0x34ee('0xb2')]['UserLocalizedLabel'][_0x34ee('0xb2')],'value':String(_0x3bb533[_0x34ee('0xb3')])});});var _0x4ed8c9={'id':_0x23c4b5+'_'+_0xf32ce4[_0x34ee('0x9b')],'name':_0xf32ce4['DisplayName'][_0x34ee('0xb4')][_0x34ee('0xb2')],'custom':![],'options':_0xbd92e2};_0x1306ff[_0x34ee('0x9f')](_0x4ed8c9);return _0x1306ff;});}function getBooleanList(_0x534cb2,_0x2bd2d7,_0x3d88b8,_0x6d0a2a,_0x2a343f,_0x177159){var _0x235f0b={'method':_0x34ee('0x92'),'uri':_0x534cb2+_0x34ee('0x98')+_0x6d0a2a+')/Attributes('+_0x2a343f+_0x34ee('0xb5'),'headers':{'Authorization':_0x34ee('0x94')+_0x177159,'If-None-Match':null,'OData-Version':_0x34ee('0x95')},'json':!![]};return rp(_0x235f0b)[_0x34ee('0xf')](function(_0x282701){var _0x5475f3=[];_0x5475f3[_0x34ee('0x9f')]({'name':_0x282701['OptionSet']['TrueOption']['Label'][_0x34ee('0xb4')][_0x34ee('0xb2')],'value':'true'},{'name':_0x282701['OptionSet']['FalseOption']['Label'][_0x34ee('0xb4')][_0x34ee('0xb2')],'value':'false'});var _0x54b1bd={'id':_0x2bd2d7+'_'+_0x282701[_0x34ee('0x9b')],'name':_0x282701[_0x34ee('0xb6')][_0x34ee('0xb4')]['Label'],'custom':![],'options':_0x5475f3};_0x3d88b8[_0x34ee('0x9f')](_0x54b1bd);return _0x3d88b8;});}function getInputList(_0x20ba45,_0x402090,_0x1c7554,_0x18bc48,_0x3a909a,_0x315a3f,_0x1cf75a){var _0x4a9ee4={'method':_0x34ee('0x92'),'uri':_0x20ba45+_0x34ee('0x98')+_0x3a909a+_0x34ee('0xad')+_0x315a3f+_0x34ee('0xb7')+_0x1c7554+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x34ee('0x94')+_0x1cf75a,'If-None-Match':null,'OData-Version':_0x34ee('0x95')},'json':!![]};return rp(_0x4a9ee4)[_0x34ee('0xf')](function(_0x758b84){var _0x5d7ac4={'id':_0x402090+'_'+_0x758b84[_0x34ee('0x9b')],'name':_0x758b84[_0x34ee('0xb6')][_0x34ee('0xb4')]?_0x758b84[_0x34ee('0xb6')][_0x34ee('0xb4')][_0x34ee('0xb2')]:_0x758b84[_0x34ee('0x9b')],'custom':![],'options':[]};_0x18bc48[_0x34ee('0x9f')](_0x5d7ac4);return _0x18bc48;});} \ No newline at end of file +var _0x0845=['prioritycodename','productidname','productserialnumber','resolvebykpiidname','responseby','sentimentvalue','slainvokedidname','slaname','statecode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','username','password','remoteUri','clientId','modernAuthentication','CloudProvider','data7','access_token','data5','https://login.microsoftonline.com/','tenantId','clientSecret','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','remove','includes','LogicalName','@odata.type','substring','PicklistAttributeMetadata','push','all','forEach','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','test','statusCode','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','UserLocalizedLabel','Value','DisplayName','FalseOption',')/Attributes(','../../components/parsers/qs','../../components/integrations/configuration','json','offset','undefined','limit','count','status','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','keys','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','includeAll','include','findAll','catch','show','find','create','body','getConfigurations','findOne','params','Dynamics365Configuration','options','addConfiguration','AccountId','Subjects','Descriptions','channel','Dynamics365Field','slice','lastIndexOf','format','%s/api/data/v9.0/','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','accountidname','accountidyominame','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','emailaddress','entityimage_timestamp','entityimage_url','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridname','owneridtype','parentcaseidname','primarycontactidname','primarycontactidyominame'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0845,0x1ae));var _0x5084=function(_0x20278c,_0x275c86){_0x20278c=_0x20278c-0x0;var _0x485e93=_0x0845[_0x20278c];return _0x485e93;};'use strict';var rp=require('request-promise');var util=require('util');var _=require('lodash');var qs=require(_0x5084('0x0'));var logger=require('../../config/logger')('api');var db=require('../../mysqldb')['db'];var integrations=require(_0x5084('0x1'));function respondWithResult(_0x253078,_0x3bc348){_0x3bc348=_0x3bc348||0xc8;return function(_0xd4f266){if(_0xd4f266){return _0x253078['status'](_0x3bc348)[_0x5084('0x2')](_0xd4f266);}};}function respondWithFilteredResult(_0x591a86,_0x44b335){return function(_0x582b1a){if(_0x582b1a){var _0xe689e5=typeof _0x44b335[_0x5084('0x3')]===_0x5084('0x4')&&typeof _0x44b335[_0x5084('0x5')]==='undefined';var _0x397af0=_0x582b1a[_0x5084('0x6')];var _0x114954=_0xe689e5?0x0:_0x44b335[_0x5084('0x3')];var _0x2a3145=_0xe689e5?_0x582b1a[_0x5084('0x6')]:_0x44b335[_0x5084('0x3')]+_0x44b335[_0x5084('0x5')];var _0x307d3e;if(_0x2a3145>=_0x397af0){_0x2a3145=_0x397af0;_0x307d3e=0xc8;}else{_0x307d3e=0xce;}_0x591a86[_0x5084('0x7')](_0x307d3e);return _0x591a86[_0x5084('0x8')](_0x5084('0x9'),_0x114954+'-'+_0x2a3145+'/'+_0x397af0)[_0x5084('0x2')](_0x582b1a);}return null;};}function saveUpdates(_0x100533){return function(_0x45df4c){if(_0x45df4c){return _0x45df4c[_0x5084('0xa')](_0x100533)[_0x5084('0xb')](function(_0x3ac8bf){return _0x3ac8bf;});}return null;};}function removeEntity(_0x232a6f){return function(_0x424f13){if(_0x424f13){return _0x424f13[_0x5084('0xc')]()[_0x5084('0xb')](function(){_0x232a6f[_0x5084('0x7')](0xcc)[_0x5084('0xd')]();});}};}function handleEntityNotFound(_0x5ce4ed){return function(_0x9535a1){if(!_0x9535a1){_0x5ce4ed[_0x5084('0xe')](0x194);}return _0x9535a1;};}function handleError(_0x2d627a,_0x134bd6){_0x134bd6=_0x134bd6||0x1f4;return function(_0x323976){logger[_0x5084('0xf')](_0x323976[_0x5084('0x10')]);if(_0x323976[_0x5084('0x11')]){delete _0x323976['name'];}_0x2d627a['status'](_0x134bd6)[_0x5084('0x12')](_0x323976);};}exports[_0x5084('0x13')]=function(_0x3ff2c3,_0x2133ce){var _0x46da2c={},_0x5b7137={},_0x3e2bfa={'count':0x0,'rows':[]};var _0x19fe1c=_[_0x5084('0x14')](db[_0x5084('0x15')][_0x5084('0x16')],function(_0x1ed482){return{'name':_0x1ed482[_0x5084('0x17')],'type':_0x1ed482[_0x5084('0x18')][_0x5084('0x19')]};});_0x5b7137['model']=_[_0x5084('0x14')](_0x19fe1c,_0x5084('0x11'));_0x5b7137['query']=_[_0x5084('0x1a')](_0x3ff2c3[_0x5084('0x1b')]);_0x5b7137[_0x5084('0x1c')]=_['intersection'](_0x5b7137['model'],_0x5b7137[_0x5084('0x1b')]);_0x46da2c[_0x5084('0x1d')]=_[_0x5084('0x1e')](_0x5b7137[_0x5084('0x1f')],qs[_0x5084('0x20')](_0x3ff2c3[_0x5084('0x1b')][_0x5084('0x20')]));_0x46da2c['attributes']=_0x46da2c['attributes'][_0x5084('0x21')]?_0x46da2c['attributes']:_0x5b7137[_0x5084('0x1f')];if(!_0x3ff2c3['query'][_0x5084('0x22')](_0x5084('0x23'))){_0x46da2c[_0x5084('0x5')]=qs[_0x5084('0x5')](_0x3ff2c3[_0x5084('0x1b')][_0x5084('0x5')]);_0x46da2c[_0x5084('0x3')]=qs[_0x5084('0x3')](_0x3ff2c3[_0x5084('0x1b')][_0x5084('0x3')]);}_0x46da2c[_0x5084('0x24')]=qs[_0x5084('0x25')](_0x3ff2c3[_0x5084('0x1b')]['sort']);_0x46da2c[_0x5084('0x26')]=qs[_0x5084('0x1c')](_[_0x5084('0x27')](_0x3ff2c3['query'],_0x5b7137['filters']),_0x19fe1c);if(_0x3ff2c3[_0x5084('0x1b')]['filter']){_0x46da2c[_0x5084('0x26')]=_[_0x5084('0x28')](_0x46da2c[_0x5084('0x26')],{'$or':_[_0x5084('0x14')](_0x19fe1c,function(_0x19344f){if(_0x19344f[_0x5084('0x18')]!=='VIRTUAL'){var _0x9382b6={};_0x9382b6[_0x19344f[_0x5084('0x11')]]={'$like':'%'+_0x3ff2c3[_0x5084('0x1b')][_0x5084('0x29')]+'%'};return _0x9382b6;}})});}_0x46da2c=_[_0x5084('0x28')]({},_0x46da2c,_0x3ff2c3['options']);var _0x97b5fa={'where':_0x46da2c['where']};return db['Dynamics365Account'][_0x5084('0x6')](_0x97b5fa)[_0x5084('0xb')](function(_0x458278){_0x3e2bfa[_0x5084('0x6')]=_0x458278;if(_0x3ff2c3[_0x5084('0x1b')][_0x5084('0x2a')]){_0x46da2c[_0x5084('0x2b')]=[{'all':!![]}];}return db[_0x5084('0x15')][_0x5084('0x2c')](_0x46da2c);})[_0x5084('0xb')](function(_0x5b881c){_0x3e2bfa['rows']=_0x5b881c;return _0x3e2bfa;})[_0x5084('0xb')](respondWithFilteredResult(_0x2133ce,_0x46da2c))[_0x5084('0x2d')](handleError(_0x2133ce,null));};exports[_0x5084('0x2e')]=function(_0x5bcba8,_0x4e6d82){var _0x11e627={'raw':![],'where':{'id':_0x5bcba8['params']['id']}},_0x5b4562={};_0x5b4562[_0x5084('0x1f')]=_['keys'](db[_0x5084('0x15')][_0x5084('0x16')]);_0x5b4562['query']=_[_0x5084('0x1a')](_0x5bcba8[_0x5084('0x1b')]);_0x5b4562[_0x5084('0x1c')]=_[_0x5084('0x1e')](_0x5b4562[_0x5084('0x1f')],_0x5b4562[_0x5084('0x1b')]);_0x11e627[_0x5084('0x1d')]=_[_0x5084('0x1e')](_0x5b4562[_0x5084('0x1f')],qs[_0x5084('0x20')](_0x5bcba8[_0x5084('0x1b')][_0x5084('0x20')]));_0x11e627['attributes']=_0x11e627[_0x5084('0x1d')][_0x5084('0x21')]?_0x11e627[_0x5084('0x1d')]:_0x5b4562[_0x5084('0x1f')];if(_0x5bcba8['query'][_0x5084('0x2a')]){_0x11e627['include']=[{'all':!![]}];}_0x11e627=_['merge']({},_0x11e627,_0x5bcba8['options']);return db[_0x5084('0x15')][_0x5084('0x2f')](_0x11e627)[_0x5084('0xb')](handleEntityNotFound(_0x4e6d82,null))[_0x5084('0xb')](respondWithResult(_0x4e6d82,null))[_0x5084('0x2d')](handleError(_0x4e6d82,null));};exports[_0x5084('0x30')]=function(_0x55b449,_0x15bf1f){return db['Dynamics365Account'][_0x5084('0x30')](_0x55b449[_0x5084('0x31')],{})[_0x5084('0xb')](respondWithResult(_0x15bf1f,0xc9))[_0x5084('0x2d')](handleError(_0x15bf1f,null));};exports['update']=function(_0x80b7e5,_0xdf878c){if(_0x80b7e5[_0x5084('0x31')]['id']){delete _0x80b7e5[_0x5084('0x31')]['id'];}return db[_0x5084('0x15')][_0x5084('0x2f')]({'where':{'id':_0x80b7e5['params']['id']}})[_0x5084('0xb')](handleEntityNotFound(_0xdf878c,null))[_0x5084('0xb')](saveUpdates(_0x80b7e5[_0x5084('0x31')],null))[_0x5084('0xb')](respondWithResult(_0xdf878c,null))['catch'](handleError(_0xdf878c,null));};exports[_0x5084('0xc')]=function(_0x44df7a,_0x12e47f){return db[_0x5084('0x15')]['find']({'where':{'id':_0x44df7a['params']['id']}})['then'](handleEntityNotFound(_0x12e47f,null))[_0x5084('0xb')](removeEntity(_0x12e47f,null))[_0x5084('0x2d')](handleError(_0x12e47f,null));};exports[_0x5084('0x32')]=function(_0x668054,_0x8b5509){var _0x455cd7={};var _0x4e0c95={};var _0x2e1575;var _0x2f9949;return db[_0x5084('0x15')][_0x5084('0x33')]({'where':{'id':_0x668054[_0x5084('0x34')]['id']}})[_0x5084('0xb')](handleEntityNotFound(_0x8b5509,null))[_0x5084('0xb')](function(_0x3fb7f2){if(_0x3fb7f2){_0x2e1575=_0x3fb7f2;_0x4e0c95[_0x5084('0x1f')]=_[_0x5084('0x1a')](db[_0x5084('0x35')][_0x5084('0x16')]);_0x4e0c95[_0x5084('0x1b')]=_[_0x5084('0x1a')](_0x668054[_0x5084('0x1b')]);_0x4e0c95[_0x5084('0x1c')]=_[_0x5084('0x1e')](_0x4e0c95[_0x5084('0x1f')],_0x4e0c95[_0x5084('0x1b')]);_0x455cd7['attributes']=_['intersection'](_0x4e0c95[_0x5084('0x1f')],qs[_0x5084('0x20')](_0x668054[_0x5084('0x1b')]['fields']));_0x455cd7[_0x5084('0x1d')]=_0x455cd7['attributes'][_0x5084('0x21')]?_0x455cd7[_0x5084('0x1d')]:_0x4e0c95[_0x5084('0x1f')];_0x455cd7[_0x5084('0x24')]=qs['sort'](_0x668054[_0x5084('0x1b')][_0x5084('0x25')]);_0x455cd7[_0x5084('0x26')]=qs[_0x5084('0x1c')](_[_0x5084('0x27')](_0x668054['query'],_0x4e0c95[_0x5084('0x1c')]));if(_0x668054[_0x5084('0x1b')][_0x5084('0x29')]){_0x455cd7[_0x5084('0x26')]=_['merge'](_0x455cd7[_0x5084('0x26')],{'$or':_[_0x5084('0x14')](_0x455cd7['attributes'],function(_0x3f69c5){var _0x5bda22={};_0x5bda22[_0x3f69c5]={'$like':'%'+_0x668054[_0x5084('0x1b')][_0x5084('0x29')]+'%'};return _0x5bda22;})});}_0x455cd7=_['merge']({},_0x455cd7,_0x668054[_0x5084('0x36')]);return _0x2e1575['getConfigurations'](_0x455cd7);}})[_0x5084('0xb')](function(_0x1b7310){if(_0x1b7310){_0x2f9949=_0x1b7310[_0x5084('0x21')];if(!_0x668054[_0x5084('0x1b')][_0x5084('0x22')]('nolimit')){_0x455cd7['limit']=qs[_0x5084('0x5')](_0x668054[_0x5084('0x1b')][_0x5084('0x5')]);_0x455cd7['offset']=qs[_0x5084('0x3')](_0x668054[_0x5084('0x1b')][_0x5084('0x3')]);}return _0x2e1575[_0x5084('0x32')](_0x455cd7);}})['then'](function(_0x420502){if(_0x420502){return _0x420502?{'count':_0x2f9949,'rows':_0x420502}:null;}})[_0x5084('0xb')](respondWithResult(_0x8b5509,null))[_0x5084('0x2d')](handleError(_0x8b5509,null));};exports[_0x5084('0x37')]=function(_0x5640fd,_0x395201){if(_0x5640fd[_0x5084('0x31')]['id']){delete _0x5640fd[_0x5084('0x31')]['id'];}return db[_0x5084('0x15')][_0x5084('0x33')]({'where':{'id':_0x5640fd[_0x5084('0x34')]['id']}})['then'](handleEntityNotFound(_0x395201,null))['then'](function(_0x2b16e5){if(_0x2b16e5){_0x5640fd[_0x5084('0x31')][_0x5084('0x38')]=_0x2b16e5['id'];_0x5640fd[_0x5084('0x31')][_0x5084('0x39')]=integrations['getSubjects'](_0x5640fd[_0x5084('0x31')]['channel'],_0x5640fd[_0x5084('0x31')]['type']);_0x5640fd[_0x5084('0x31')][_0x5084('0x3a')]=integrations['getDescriptions'](_0x5640fd[_0x5084('0x31')][_0x5084('0x3b')],_0x5640fd[_0x5084('0x31')][_0x5084('0x18')]);return db[_0x5084('0x35')][_0x5084('0x30')](_0x5640fd['body'],{'include':[{'model':db[_0x5084('0x3c')],'as':_0x5084('0x39')},{'model':db[_0x5084('0x3c')],'as':_0x5084('0x3a')}]});}return null;})[_0x5084('0xb')](respondWithResult(_0x395201,null))[_0x5084('0x2d')](handleError(_0x395201,null));};function sanitizeRemoteUri(_0x29911b){var _0x329d24=_0x29911b[_0x5084('0x3d')](-0x1);if(_0x329d24==='/')return _0x29911b['substring'](0x0,_0x29911b[_0x5084('0x3e')](_0x329d24));return _0x29911b;}function getWebApiUrl(_0x2c8d81){return util[_0x5084('0x3f')](_0x5084('0x40'),_0x2c8d81);}exports['getFields']=function(_0x1dbf0e,_0x1fa50c){var _0x4c7ff3=_0x1dbf0e[_0x5084('0x1b')][_0x5084('0x41')];var _0x5c31f6=_0x4c7ff3===_0x5084('0x42')?_0x5084('0x43'):_0x5084('0x44');var _0x5ef349='';var _0x178950='';var _0xa17fc6='';var _0x385178='';var _0x3960d4='';var _0x579fbd='';var _0x294c30='';var _0xec36cc='';var _0xb197fe=[_0x5084('0x45'),_0x5084('0x46'),_0x5084('0x47'),_0x5084('0x48'),_0x5084('0x49'),_0x5084('0x4a'),_0x5084('0x4b'),_0x5084('0x4c'),_0x5084('0x4d'),'phonecall_activity_parties'];var _0x1f8a2a=[_0x5084('0x4e'),_0x5084('0x4f'),'actualserviceunits',_0x5084('0x50'),_0x5084('0x51'),_0x5084('0x52'),'contractdetailidname',_0x5084('0x53'),_0x5084('0x54'),_0x5084('0x55'),_0x5084('0x56'),_0x5084('0x57'),_0x5084('0x58'),_0x5084('0x59'),_0x5084('0x5a'),_0x5084('0x5b'),_0x5084('0x5c'),'customeridyominame',_0x5084('0x5d'),'entitlementidname',_0x5084('0x5e'),_0x5084('0x5f'),'escalatedon',_0x5084('0x60'),_0x5084('0x61'),_0x5084('0x62'),_0x5084('0x63'),_0x5084('0x64'),'kbarticleidname',_0x5084('0x65'),'masteridname','modifiedbyexternalpartyname',_0x5084('0x66'),_0x5084('0x67'),_0x5084('0x68'),_0x5084('0x69'),_0x5084('0x6a'),'modifiedonbehalfbyyominame',_0x5084('0x6b'),_0x5084('0x6c'),_0x5084('0x6d'),_0x5084('0x6e'),'overriddencreatedon',_0x5084('0x6f'),_0x5084('0x70'),'owneridyominame',_0x5084('0x71'),_0x5084('0x72'),_0x5084('0x73'),_0x5084('0x74'),_0x5084('0x75'),_0x5084('0x76'),'resolveby',_0x5084('0x77'),_0x5084('0x78'),'responsiblecontactidname','responsiblecontactidyominame',_0x5084('0x79'),_0x5084('0x7a'),_0x5084('0x7b'),'socialprofileidname',_0x5084('0x7c'),'statuscode','subjectidname',_0x5084('0x7d'),_0x5084('0x7e'),_0x5084('0x7f'),_0x5084('0x80'),_0x5084('0x81'),_0x5084('0x82')];var _0x467439=_0xb197fe['concat'](_0x1f8a2a);return db[_0x5084('0x15')][_0x5084('0x33')]({'where':{'id':_0x1dbf0e['params']['id']},'attributes':['id',_0x5084('0x83'),_0x5084('0x84'),_0x5084('0x85'),'tenantId',_0x5084('0x86'),'clientSecret',_0x5084('0x87')],'include':[{'model':db[_0x5084('0x88')],'as':'CloudProvider','attributes':['id','data5',_0x5084('0x89')]}]})[_0x5084('0xb')](handleEntityNotFound(_0x1fa50c,null))['then'](function(_0x116c99){if(_0x116c99){if(_0x116c99[_0x5084('0x87')]){_0x116c99[_0x5084('0x8a')]=_0x116c99[_0x5084('0x88')][_0x5084('0x8b')];_0xec36cc=sanitizeRemoteUri(_0x116c99[_0x5084('0x88')][_0x5084('0x89')]);_0x294c30=getWebApiUrl(_0xec36cc);return _0x116c99;}_0xec36cc=sanitizeRemoteUri(_0x116c99[_0x5084('0x85')]);_0x294c30=getWebApiUrl(_0xec36cc);var _0x238fab={'method':'POST','uri':_0x5084('0x8c')+_0x116c99[_0x5084('0x8d')]+'/oauth2/token','form':{'client_id':_0x116c99[_0x5084('0x86')],'resource':_0xec36cc,'username':_0x116c99[_0x5084('0x83')],'password':_0x116c99['password'],'grant_type':'password','client_secret':_0x116c99[_0x5084('0x8e')]},'json':!![]};return rp(_0x238fab);}})[_0x5084('0xb')](function(_0x23c5ef){_0x579fbd=_0x23c5ef[_0x5084('0x8a')];var _0x403665={'method':'GET','uri':encodeURI(_0x294c30+_0x5084('0x8f')+_0x5c31f6+'\x27'),'headers':{'Authorization':_0x5084('0x90')+_0x579fbd,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x403665);})[_0x5084('0xb')](function(_0x5ede3b){var _0xb42086=_0x5ede3b[_0x5084('0x91')][0x0];var _0x443f7b=_0xb42086[_0x5084('0x92')];var _0x3cddb5={'method':_0x5084('0x93'),'uri':_0x294c30+_0x5084('0x94')+_0x443f7b+_0x5084('0x95'),'headers':{'Authorization':_0x5084('0x90')+_0x579fbd,'If-None-Match':null,'OData-Version':_0x5084('0x96')},'json':!![]};return rp(_0x3cddb5);})['then'](function(_0x100069){_0x5ef349=_0x100069;_0x178950=_0x5ef349[_0x5084('0x97')];_0x178950=_[_0x5084('0x98')](_0x178950,function(_0x2226e0){return!_0x467439[_0x5084('0x99')](_0x2226e0[_0x5084('0x9a')]);});var _0x363c9c=[];var _0x20a41a=[];_0x178950['forEach'](function(_0x23e918){if(_0x23e918[_0x5084('0x9b')]){var _0x34f386=_0x23e918[_0x5084('0x9b')][_0x5084('0x9c')](_0x23e918[_0x5084('0x9b')][_0x5084('0x3e')]('.')+0x1);if(_0x34f386===_0x5084('0x9d')){_0x363c9c[_0x5084('0x9e')](getSelectList(_0x294c30,_0x4c7ff3,_0x20a41a,_0x5ef349['MetadataId'],_0x23e918[_0x5084('0x92')],_0x579fbd));}}});return Promise[_0x5084('0x9f')](_0x363c9c);})[_0x5084('0xb')](function(_0x1911e3){_0xa17fc6=_0x1911e3[0x0];var _0x5bf487=[];var _0x2594bb=[];_0x178950[_0x5084('0xa0')](function(_0x59ff26){if(!_[_0x5084('0xa1')](_0x59ff26[_0x5084('0x9b')])){var _0x37cfca=_0x59ff26[_0x5084('0x9b')][_0x5084('0x9c')](_0x59ff26[_0x5084('0x9b')][_0x5084('0x3e')]('.')+0x1);if(_0x37cfca===_0x5084('0xa2')){_0x5bf487[_0x5084('0x9e')](getBooleanList(_0x294c30,_0x4c7ff3,_0x2594bb,_0x5ef349['MetadataId'],_0x59ff26['MetadataId'],_0x579fbd));}}});return Promise[_0x5084('0x9f')](_0x5bf487);})[_0x5084('0xb')](function(_0x593113){_0x385178=_0x593113[0x0];var _0xc8b991=[];var _0x12b788=[];_0x178950[_0x5084('0xa0')](function(_0x4d2d13){if(_0x4d2d13[_0x5084('0x9b')]){var _0x5c1a1a=_0x4d2d13[_0x5084('0x9b')][_0x5084('0x9c')](_0x4d2d13['@odata.type'][_0x5084('0x3e')]('.')+0x1);if(_0x5c1a1a===_0x5084('0xa3')||_0x5c1a1a===_0x5084('0xa4')||_0x5c1a1a===_0x5084('0xa5')||_0x5c1a1a==='IntegerAttributeMetadata'||_0x5c1a1a===_0x5084('0xa6')||_0x5c1a1a===_0x5084('0xa7')||_0x5c1a1a===_0x5084('0xa8')||_0x5c1a1a==='EntityNameAttributeMetadata'||_0x5c1a1a===_0x5084('0xa9')||_0x5c1a1a===_0x5084('0xaa')){_0xc8b991['push'](getInputList(_0x294c30,_0x4c7ff3,_0x5c1a1a,_0x12b788,_0x5ef349[_0x5084('0x92')],_0x4d2d13[_0x5084('0x92')],_0x579fbd));}}});return Promise[_0x5084('0x9f')](_0xc8b991);})[_0x5084('0xb')](function(_0x21e395){_0x3960d4=_0x21e395[0x0];var _0x4c2333=_0xa17fc6[_0x5084('0xab')](_0x385178)[_0x5084('0xab')](_0x3960d4);var _0x4a6ce9={'count':_0x4c2333[_0x5084('0x21')],'rows':_0x4c2333};return _0x4a6ce9;})[_0x5084('0xb')](respondWithResult(_0x1fa50c,null))[_0x5084('0x2d')](function(_0x465b65){var _0x3dbfa3=_0x1dbf0e[_0x5084('0x1b')][_0x5084('0xac')]?0x1f4:_0x465b65[_0x5084('0xad')]||0x1f4;logger[_0x5084('0xf')](_0x465b65['stack']);delete _0x465b65[_0x5084('0x11')];if(_0x3dbfa3===0x191){_0x3dbfa3=0x190;}_0x1fa50c['status'](_0x3dbfa3)[_0x5084('0x12')](_0x1dbf0e[_0x5084('0x1b')][_0x5084('0xac')]?{'message':'Wrong\x20credentials','statusCode':_0x465b65[_0x5084('0xad')]}:_0x465b65);});};function getSelectList(_0xa7cb98,_0x24c179,_0x4e5d26,_0x73dcc9,_0x1e16c8,_0x3939b3){var _0x467922={'method':_0x5084('0x93'),'uri':_0xa7cb98+_0x5084('0x94')+_0x73dcc9+')/Attributes('+_0x1e16c8+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x5084('0xae'),'headers':{'Authorization':_0x5084('0x90')+_0x3939b3,'If-None-Match':null,'OData-Version':_0x5084('0x96')},'json':!![]};return rp(_0x467922)[_0x5084('0xb')](function(_0x227202){var _0x290752=[];var _0x131058=_0x227202[_0x5084('0xaf')]['Options'];_0x131058[_0x5084('0xa0')](function(_0x24759a){_0x290752[_0x5084('0x9e')]({'name':_0x24759a[_0x5084('0xb0')][_0x5084('0xb1')][_0x5084('0xb0')],'value':String(_0x24759a[_0x5084('0xb2')])});});var _0x1e3cb2={'id':_0x24c179+'_'+_0x227202['LogicalName'],'name':_0x227202[_0x5084('0xb3')]['UserLocalizedLabel'][_0x5084('0xb0')],'custom':![],'options':_0x290752};_0x4e5d26['push'](_0x1e3cb2);return _0x4e5d26;});}function getBooleanList(_0x4fd022,_0x44d267,_0x188aca,_0x9f8e63,_0x3c50b8,_0x48dcd2){var _0x44d435={'method':'GET','uri':_0x4fd022+_0x5084('0x94')+_0x9f8e63+')/Attributes('+_0x3c50b8+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':'Bearer\x20'+_0x48dcd2,'If-None-Match':null,'OData-Version':_0x5084('0x96')},'json':!![]};return rp(_0x44d435)[_0x5084('0xb')](function(_0x18e551){var _0x53db26=[];_0x53db26[_0x5084('0x9e')]({'name':_0x18e551[_0x5084('0xaf')]['TrueOption'][_0x5084('0xb0')][_0x5084('0xb1')][_0x5084('0xb0')],'value':'true'},{'name':_0x18e551['OptionSet'][_0x5084('0xb4')]['Label'][_0x5084('0xb1')]['Label'],'value':'false'});var _0x3173bd={'id':_0x44d267+'_'+_0x18e551[_0x5084('0x9a')],'name':_0x18e551[_0x5084('0xb3')]['UserLocalizedLabel'][_0x5084('0xb0')],'custom':![],'options':_0x53db26};_0x188aca['push'](_0x3173bd);return _0x188aca;});}function getInputList(_0x225f39,_0x4160a2,_0x277025,_0x5c8d73,_0x305e92,_0x3ae271,_0x2abfb3){var _0xf80421={'method':_0x5084('0x93'),'uri':_0x225f39+_0x5084('0x94')+_0x305e92+_0x5084('0xb5')+_0x3ae271+')/Microsoft.Dynamics.CRM.'+_0x277025+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x5084('0x90')+_0x2abfb3,'If-None-Match':null,'OData-Version':_0x5084('0x96')},'json':!![]};return rp(_0xf80421)['then'](function(_0xbf70a7){var _0x26cd4d={'id':_0x4160a2+'_'+_0xbf70a7[_0x5084('0x9a')],'name':_0xbf70a7['DisplayName']['UserLocalizedLabel']?_0xbf70a7[_0x5084('0xb3')][_0x5084('0xb1')][_0x5084('0xb0')]:_0xbf70a7['LogicalName'],'custom':![],'options':[]};_0x5c8d73[_0x5084('0x9e')](_0x26cd4d);return _0x5c8d73;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 178ca24..1a48a35 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 _0xa9e0=['define','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x5a4b12,_0x371b3d){var _0x5513c9=function(_0x5967a7){while(--_0x5967a7){_0x5a4b12['push'](_0x5a4b12['shift']());}};_0x5513c9(++_0x371b3d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));var integrations=require(_0x0a9e('0x8'));module['exports']=function(_0x219af0,_0x441e3a){return _0x219af0[_0x0a9e('0x9')]('Dynamics365Account',attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x16cbbf,_0x3dedfe){var _0xed2ac=function(_0x25b703){while(--_0x25b703){_0x16cbbf['push'](_0x16cbbf['shift']());}};_0xed2ac(++_0x3dedfe);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 26addee..a22c371 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 _0xd711=['request','then','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','include','map','model','ShowDynamics365Account','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x342817,_0x2cc215){var _0xa17e4d=function(_0x252a0e){while(--_0x252a0e){_0x342817['push'](_0x342817['shift']());}};_0xa17e4d(++_0x2cc215);}(_0xd711,0xd6));var _0x1d71=function(_0x1fbd07,_0x449642){_0x1fbd07=_0x1fbd07-0x0;var _0x48cb90=_0xd711[_0x1fbd07];return _0x48cb90;};'use strict';var _=require(_0x1d71('0x0'));var util=require(_0x1d71('0x1'));var moment=require(_0x1d71('0x2'));var BPromise=require(_0x1d71('0x3'));var rs=require(_0x1d71('0x4'));var fs=require('fs');var Redis=require(_0x1d71('0x5'));var db=require(_0x1d71('0x6'))['db'];var utils=require(_0x1d71('0x7'));var logger=require(_0x1d71('0x8'))(_0x1d71('0x9'));var config=require(_0x1d71('0xa'));var jayson=require(_0x1d71('0xb'));var client=jayson[_0x1d71('0xc')][_0x1d71('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2c9166,_0x3d9f14,_0x31a0e9){return new BPromise(function(_0x3bf0d6,_0x2666ac){return client[_0x1d71('0xe')](_0x2c9166,_0x31a0e9)[_0x1d71('0xf')](function(_0x428ba4){logger['info'](_0x1d71('0x10'),_0x3d9f14,'request\x20sent');logger[_0x1d71('0x11')](_0x1d71('0x12'),_0x3d9f14,_0x1d71('0x13'),JSON[_0x1d71('0x14')](_0x428ba4));if(_0x428ba4[_0x1d71('0x15')]){if(_0x428ba4[_0x1d71('0x15')][_0x1d71('0x16')]===0x1f4){logger[_0x1d71('0x15')](_0x1d71('0x10'),_0x3d9f14,_0x428ba4[_0x1d71('0x15')][_0x1d71('0x17')]);return _0x2666ac(_0x428ba4[_0x1d71('0x15')]['message']);}logger[_0x1d71('0x15')](_0x1d71('0x10'),_0x3d9f14,_0x428ba4[_0x1d71('0x15')]['message']);return _0x3bf0d6(_0x428ba4[_0x1d71('0x15')][_0x1d71('0x17')]);}else{logger['info'](_0x1d71('0x10'),_0x3d9f14,'request\x20sent');_0x3bf0d6(_0x428ba4[_0x1d71('0x18')][_0x1d71('0x17')]);}})[_0x1d71('0x19')](function(_0x2fc5cc){logger['error'](_0x1d71('0x10'),_0x3d9f14,_0x2fc5cc);_0x2666ac(_0x2fc5cc);});});}exports[_0x1d71('0x1a')]=function(_0x39ec23){var _0x5e5540=this;return new Promise(function(_0xb6b42,_0x4d1bf3){return db[_0x1d71('0x1b')][_0x1d71('0x1c')]({'raw':_0x39ec23[_0x1d71('0x1d')]?_0x39ec23[_0x1d71('0x1d')][_0x1d71('0x1e')]===undefined?!![]:![]:!![],'where':_0x39ec23[_0x1d71('0x1d')]?_0x39ec23[_0x1d71('0x1d')][_0x1d71('0x1f')]||null:null,'attributes':_0x39ec23[_0x1d71('0x1d')]?_0x39ec23['options'][_0x1d71('0x20')]||null:null,'limit':_0x39ec23['options']?_0x39ec23['options']['limit']||null:null,'include':_0x39ec23[_0x1d71('0x1d')]?_0x39ec23[_0x1d71('0x1d')][_0x1d71('0x21')]?_[_0x1d71('0x22')](_0x39ec23['options'][_0x1d71('0x21')],function(_0x4e0544){return{'model':db[_0x4e0544['model']],'as':_0x4e0544['as'],'attributes':_0x4e0544[_0x1d71('0x20')],'include':_0x4e0544[_0x1d71('0x21')]?_['map'](_0x4e0544['include'],function(_0x41ea1d){return{'model':db[_0x41ea1d[_0x1d71('0x23')]],'as':_0x41ea1d['as'],'attributes':_0x41ea1d[_0x1d71('0x20')],'include':_0x41ea1d['include']?_[_0x1d71('0x22')](_0x41ea1d['include'],function(_0x1469be){return{'model':db[_0x1469be['model']],'as':_0x1469be['as'],'attributes':_0x1469be[_0x1d71('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4419ce){logger['info']('GetDynamics365Account',_0x39ec23);logger[_0x1d71('0x11')](_0x1d71('0x1a'),_0x39ec23,JSON['stringify'](_0x4419ce));_0xb6b42(_0x4419ce);})[_0x1d71('0x19')](function(_0xc1cff3){logger['error'](_0x1d71('0x1a'),_0xc1cff3[_0x1d71('0x17')],_0x39ec23);_0x4d1bf3(_0x5e5540[_0x1d71('0x15')](0x1f4,_0xc1cff3[_0x1d71('0x17')]));});});};exports[_0x1d71('0x24')]=function(_0x1414bf){var _0x28975f=this;return new Promise(function(_0x2adc87,_0x38d35b){return db[_0x1d71('0x1b')][_0x1d71('0x25')]({'raw':_0x1414bf[_0x1d71('0x1d')]?_0x1414bf[_0x1d71('0x1d')][_0x1d71('0x1e')]===undefined?!![]:![]:!![],'where':_0x1414bf['options']?_0x1414bf[_0x1d71('0x1d')]['where']||null:null,'attributes':_0x1414bf[_0x1d71('0x1d')]?_0x1414bf[_0x1d71('0x1d')][_0x1d71('0x20')]||null:null,'include':_0x1414bf[_0x1d71('0x1d')]?_0x1414bf[_0x1d71('0x1d')][_0x1d71('0x21')]?_[_0x1d71('0x22')](_0x1414bf[_0x1d71('0x1d')][_0x1d71('0x21')],function(_0x28c98c){return{'model':db[_0x28c98c[_0x1d71('0x23')]],'as':_0x28c98c['as'],'attributes':_0x28c98c[_0x1d71('0x20')],'include':_0x28c98c[_0x1d71('0x21')]?_['map'](_0x28c98c[_0x1d71('0x21')],function(_0xb14224){return{'model':db[_0xb14224['model']],'as':_0xb14224['as'],'attributes':_0xb14224[_0x1d71('0x20')],'include':_0xb14224[_0x1d71('0x21')]?_[_0x1d71('0x22')](_0xb14224['include'],function(_0x14ba2b){return{'model':db[_0x14ba2b['model']],'as':_0x14ba2b['as'],'attributes':_0x14ba2b['attributes']};}):[]};}):[]};}):[]:[]})[_0x1d71('0xf')](function(_0x2325c6){logger['info'](_0x1d71('0x24'),_0x1414bf);logger[_0x1d71('0x11')]('ShowDynamics365Account',_0x1414bf,JSON[_0x1d71('0x14')](_0x2325c6));_0x2adc87(_0x2325c6);})[_0x1d71('0x19')](function(_0x5286b8){logger['error']('ShowDynamics365Account',_0x5286b8['message'],_0x1414bf);_0x38d35b(_0x28975f[_0x1d71('0x15')](0x1f4,_0x5286b8[_0x1d71('0x17')]));});});}; \ No newline at end of file +var _0x294e=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','limit','include','model','attributes','map','catch','find','ShowDynamics365Account','lodash'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0x294e,0xfb));var _0xe294=function(_0x131ff0,_0x449b2c){_0x131ff0=_0x131ff0-0x0;var _0x54aead=_0x294e[_0x131ff0];return _0x54aead;};'use strict';var _=require(_0xe294('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe294('0x1'));var fs=require('fs');var Redis=require(_0xe294('0x2'));var db=require(_0xe294('0x3'))['db'];var utils=require(_0xe294('0x4'));var logger=require('../../config/logger')(_0xe294('0x5'));var config=require(_0xe294('0x6'));var jayson=require(_0xe294('0x7'));var client=jayson[_0xe294('0x8')][_0xe294('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x175c6e,_0xf54d65,_0x62a883){return new BPromise(function(_0x2a66ab,_0x7bfb61){return client[_0xe294('0xa')](_0x175c6e,_0x62a883)[_0xe294('0xb')](function(_0x5a7997){logger[_0xe294('0xc')](_0xe294('0xd'),_0xf54d65,'request\x20sent');logger[_0xe294('0xe')](_0xe294('0xf'),_0xf54d65,_0xe294('0x10'),JSON[_0xe294('0x11')](_0x5a7997));if(_0x5a7997[_0xe294('0x12')]){if(_0x5a7997[_0xe294('0x12')][_0xe294('0x13')]===0x1f4){logger[_0xe294('0x12')](_0xe294('0xd'),_0xf54d65,_0x5a7997['error'][_0xe294('0x14')]);return _0x7bfb61(_0x5a7997[_0xe294('0x12')]['message']);}logger['error'](_0xe294('0xd'),_0xf54d65,_0x5a7997[_0xe294('0x12')]['message']);return _0x2a66ab(_0x5a7997[_0xe294('0x12')][_0xe294('0x14')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0xf54d65,_0xe294('0x10'));_0x2a66ab(_0x5a7997[_0xe294('0x15')]['message']);}})['catch'](function(_0x479bd6){logger[_0xe294('0x12')](_0xe294('0xd'),_0xf54d65,_0x479bd6);_0x7bfb61(_0x479bd6);});});}exports[_0xe294('0x16')]=function(_0x59c679){var _0x107521=this;return new Promise(function(_0x4f6cac,_0x40a198){return db[_0xe294('0x17')][_0xe294('0x18')]({'raw':_0x59c679[_0xe294('0x19')]?_0x59c679[_0xe294('0x19')][_0xe294('0x1a')]===undefined?!![]:![]:!![],'where':_0x59c679[_0xe294('0x19')]?_0x59c679[_0xe294('0x19')][_0xe294('0x1b')]||null:null,'attributes':_0x59c679['options']?_0x59c679[_0xe294('0x19')]['attributes']||null:null,'limit':_0x59c679[_0xe294('0x19')]?_0x59c679[_0xe294('0x19')][_0xe294('0x1c')]||null:null,'include':_0x59c679[_0xe294('0x19')]?_0x59c679[_0xe294('0x19')][_0xe294('0x1d')]?_['map'](_0x59c679['options'][_0xe294('0x1d')],function(_0x4dba4a){return{'model':db[_0x4dba4a[_0xe294('0x1e')]],'as':_0x4dba4a['as'],'attributes':_0x4dba4a[_0xe294('0x1f')],'include':_0x4dba4a[_0xe294('0x1d')]?_[_0xe294('0x20')](_0x4dba4a[_0xe294('0x1d')],function(_0x5b593c){return{'model':db[_0x5b593c[_0xe294('0x1e')]],'as':_0x5b593c['as'],'attributes':_0x5b593c[_0xe294('0x1f')],'include':_0x5b593c[_0xe294('0x1d')]?_['map'](_0x5b593c['include'],function(_0x1862ab){return{'model':db[_0x1862ab[_0xe294('0x1e')]],'as':_0x1862ab['as'],'attributes':_0x1862ab['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x42086c){logger[_0xe294('0xc')]('GetDynamics365Account',_0x59c679);logger[_0xe294('0xe')](_0xe294('0x16'),_0x59c679,JSON[_0xe294('0x11')](_0x42086c));_0x4f6cac(_0x42086c);})[_0xe294('0x21')](function(_0x2d4095){logger[_0xe294('0x12')](_0xe294('0x16'),_0x2d4095[_0xe294('0x14')],_0x59c679);_0x40a198(_0x107521[_0xe294('0x12')](0x1f4,_0x2d4095['message']));});});};exports['ShowDynamics365Account']=function(_0x5ba7ae){var _0x54e658=this;return new Promise(function(_0x535969,_0x11f8d8){return db['Dynamics365Account'][_0xe294('0x22')]({'raw':_0x5ba7ae['options']?_0x5ba7ae['options']['raw']===undefined?!![]:![]:!![],'where':_0x5ba7ae['options']?_0x5ba7ae[_0xe294('0x19')][_0xe294('0x1b')]||null:null,'attributes':_0x5ba7ae[_0xe294('0x19')]?_0x5ba7ae['options'][_0xe294('0x1f')]||null:null,'include':_0x5ba7ae[_0xe294('0x19')]?_0x5ba7ae[_0xe294('0x19')]['include']?_[_0xe294('0x20')](_0x5ba7ae[_0xe294('0x19')][_0xe294('0x1d')],function(_0x52be41){return{'model':db[_0x52be41[_0xe294('0x1e')]],'as':_0x52be41['as'],'attributes':_0x52be41[_0xe294('0x1f')],'include':_0x52be41['include']?_['map'](_0x52be41['include'],function(_0x4f9ed6){return{'model':db[_0x4f9ed6['model']],'as':_0x4f9ed6['as'],'attributes':_0x4f9ed6['attributes'],'include':_0x4f9ed6[_0xe294('0x1d')]?_[_0xe294('0x20')](_0x4f9ed6[_0xe294('0x1d')],function(_0xafbbcb){return{'model':db[_0xafbbcb[_0xe294('0x1e')]],'as':_0xafbbcb['as'],'attributes':_0xafbbcb[_0xe294('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe294('0xb')](function(_0x21f110){logger[_0xe294('0xc')](_0xe294('0x23'),_0x5ba7ae);logger[_0xe294('0xe')]('ShowDynamics365Account',_0x5ba7ae,JSON[_0xe294('0x11')](_0x21f110));_0x535969(_0x21f110);})['catch'](function(_0xdbb0b8){logger[_0xe294('0x12')](_0xe294('0x23'),_0xdbb0b8[_0xe294('0x14')],_0x5ba7ae);_0x11f8d8(_0x54e658[_0xe294('0x12')](0x1f4,_0xdbb0b8['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index d2dfe00..d647cc1 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 _0x2f61=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x508c0a,_0x1bcd5e){var _0x1c19b7=function(_0x21300d){while(--_0x21300d){_0x508c0a['push'](_0x508c0a['shift']());}};_0x1c19b7(++_0x1bcd5e);}(_0x2f61,0x15c));var _0x12f6=function(_0x2d39d3,_0x5eefcf){_0x2d39d3=_0x2d39d3-0x0;var _0x508a5f=_0x2f61[_0x2d39d3];return _0x508a5f;};'use strict';var multer=require(_0x12f6('0x0'));var util=require(_0x12f6('0x1'));var path=require('path');var timeout=require(_0x12f6('0x2'));var express=require(_0x12f6('0x3'));var router=express[_0x12f6('0x4')]();var fs_extra=require(_0x12f6('0x5'));var auth=require(_0x12f6('0x6'));var interaction=require(_0x12f6('0x7'));var config=require(_0x12f6('0x8'));var controller=require(_0x12f6('0x9'));router[_0x12f6('0xa')]('/',auth[_0x12f6('0xb')](),controller[_0x12f6('0xc')]);router[_0x12f6('0xa')](_0x12f6('0xd'),auth[_0x12f6('0xb')](),controller[_0x12f6('0xe')]);router[_0x12f6('0xa')](_0x12f6('0xf'),auth[_0x12f6('0xb')](),controller[_0x12f6('0x10')]);router['get'](_0x12f6('0x11'),auth[_0x12f6('0xb')](),controller[_0x12f6('0x12')]);router['get']('/:id/descriptions',auth[_0x12f6('0xb')](),controller[_0x12f6('0x13')]);router[_0x12f6('0x14')]('/',auth['isAuthenticated'](),controller[_0x12f6('0x15')]);router[_0x12f6('0x16')](_0x12f6('0xd'),auth[_0x12f6('0xb')](),controller[_0x12f6('0x17')]);router[_0x12f6('0x18')](_0x12f6('0xd'),auth[_0x12f6('0xb')](),controller[_0x12f6('0x19')]);module[_0x12f6('0x1a')]=router; \ No newline at end of file +var _0xbd5f=['../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','/:id','update','delete','destroy','exports','multer','util','path','express','fs-extra'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0xbd5f,0x1c7));var _0xfbd5=function(_0x18ebf5,_0x2cd5c6){_0x18ebf5=_0x18ebf5-0x0;var _0x27471a=_0xbd5f[_0x18ebf5];return _0x27471a;};'use strict';var multer=require(_0xfbd5('0x0'));var util=require(_0xfbd5('0x1'));var path=require(_0xfbd5('0x2'));var timeout=require('connect-timeout');var express=require(_0xfbd5('0x3'));var router=express['Router']();var fs_extra=require(_0xfbd5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfbd5('0x5'));var config=require(_0xfbd5('0x6'));var controller=require(_0xfbd5('0x7'));router[_0xfbd5('0x8')]('/',auth[_0xfbd5('0x9')](),controller[_0xfbd5('0xa')]);router[_0xfbd5('0x8')]('/:id',auth[_0xfbd5('0x9')](),controller['show']);router['get'](_0xfbd5('0xb'),auth['isAuthenticated'](),controller[_0xfbd5('0xc')]);router[_0xfbd5('0x8')](_0xfbd5('0xd'),auth['isAuthenticated'](),controller['getSubjects']);router['get'](_0xfbd5('0xe'),auth[_0xfbd5('0x9')](),controller[_0xfbd5('0xf')]);router[_0xfbd5('0x10')]('/',auth[_0xfbd5('0x9')](),controller[_0xfbd5('0x11')]);router['put'](_0xfbd5('0x12'),auth['isAuthenticated'](),controller[_0xfbd5('0x13')]);router[_0xfbd5('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xfbd5('0x15')]);module[_0xfbd5('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index b893617..117976e 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 _0x49db=['sequelize','exports','STRING','ENUM','incident','phonecall','contact'];(function(_0x40ccbc,_0x957b1e){var _0x1c9f5d=function(_0x81429){while(--_0x81429){_0x40ccbc['push'](_0x40ccbc['shift']());}};_0x1c9f5d(++_0x957b1e);}(_0x49db,0xcb));var _0xb49d=function(_0x4aa01f,_0x57502d){_0x4aa01f=_0x4aa01f-0x0;var _0x5ab703=_0x49db[_0x4aa01f];return _0x5ab703;};'use strict';var Sequelize=require(_0xb49d('0x0'));module[_0xb49d('0x1')]={'name':{'type':Sequelize[_0xb49d('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xb49d('0x3')](_0xb49d('0x4'),_0xb49d('0x5')),'defaultValue':_0xb49d('0x4')},'moduleCreate':{'type':Sequelize[_0xb49d('0x3')](_0xb49d('0x6'),'nothing'),'defaultValue':_0xb49d('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xb49d('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xdcb3=['STRING','phonecall','incident','contact','nothing','BOOLEAN','sequelize','exports'];(function(_0x343ca5,_0x549cce){var _0x62236=function(_0x20fa26){while(--_0x20fa26){_0x343ca5['push'](_0x343ca5['shift']());}};_0x62236(++_0x549cce);}(_0xdcb3,0x19e));var _0x3dcb=function(_0x56922c,_0x347c88){_0x56922c=_0x56922c-0x0;var _0xf896d7=_0xdcb3[_0x56922c];return _0xf896d7;};'use strict';var Sequelize=require(_0x3dcb('0x0'));module[_0x3dcb('0x1')]={'name':{'type':Sequelize[_0x3dcb('0x2')]},'description':{'type':Sequelize[_0x3dcb('0x2')]},'ticketType':{'type':Sequelize['ENUM']('incident',_0x3dcb('0x3')),'defaultValue':_0x3dcb('0x4')},'moduleCreate':{'type':Sequelize['ENUM'](_0x3dcb('0x5'),_0x3dcb('0x6')),'defaultValue':_0x3dcb('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x3dcb('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x3dcb('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 23ac314..99febb1 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 _0xce5b=['sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','map','Dynamics365Configuration','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','find','create','body','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xce5b,0x96));var _0xbce5=function(_0x5cd5e8,_0x12b67c){_0x5cd5e8=_0x5cd5e8-0x0;var _0x43a012=_0xce5b[_0x5cd5e8];return _0x43a012;};'use strict';var emlformat=require(_0xbce5('0x0'));var rimraf=require(_0xbce5('0x1'));var zipdir=require(_0xbce5('0x2'));var jsonpatch=require(_0xbce5('0x3'));var rp=require(_0xbce5('0x4'));var moment=require(_0xbce5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbce5('0x6'));var util=require(_0xbce5('0x7'));var path=require('path');var sox=require(_0xbce5('0x8'));var csv=require(_0xbce5('0x9'));var ejs=require(_0xbce5('0xa'));var fs=require('fs');var fs_extra=require(_0xbce5('0xb'));var _=require('lodash');var squel=require(_0xbce5('0xc'));var crypto=require('crypto');var jsforce=require(_0xbce5('0xd'));var deskjs=require(_0xbce5('0xe'));var toCsv=require(_0xbce5('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbce5('0xf'));var authService=require(_0xbce5('0x10'));var qs=require(_0xbce5('0x11'));var as=require(_0xbce5('0x12'));var hardwareService=require(_0xbce5('0x13'));var logger=require(_0xbce5('0x14'))(_0xbce5('0x15'));var utils=require(_0xbce5('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5de690,_0x3e1d6b){_0x3e1d6b=_0x3e1d6b||0xcc;return function(_0x4ea1b6){if(_0x4ea1b6){return _0x5de690[_0xbce5('0x17')](_0x3e1d6b);}return _0x5de690[_0xbce5('0x18')](_0x3e1d6b)['end']();};}function respondWithResult(_0x312f2d,_0x89ceb1){_0x89ceb1=_0x89ceb1||0xc8;return function(_0x3b4773){if(_0x3b4773){return _0x312f2d[_0xbce5('0x18')](_0x89ceb1)[_0xbce5('0x19')](_0x3b4773);}};}function respondWithFilteredResult(_0x3765f9,_0x45c6e0){return function(_0xa3a127){if(_0xa3a127){var _0x14031c=typeof _0x45c6e0[_0xbce5('0x1a')]===_0xbce5('0x1b')&&typeof _0x45c6e0['limit']==='undefined';var _0x4867a0=_0xa3a127[_0xbce5('0x1c')];var _0x6e69e4=_0x14031c?0x0:_0x45c6e0[_0xbce5('0x1a')];var _0x5cf51c=_0x14031c?_0xa3a127[_0xbce5('0x1c')]:_0x45c6e0[_0xbce5('0x1a')]+_0x45c6e0[_0xbce5('0x1d')];var _0x4033f4;if(_0x5cf51c>=_0x4867a0){_0x5cf51c=_0x4867a0;_0x4033f4=0xc8;}else{_0x4033f4=0xce;}_0x3765f9[_0xbce5('0x18')](_0x4033f4);return _0x3765f9[_0xbce5('0x1e')](_0xbce5('0x1f'),_0x6e69e4+'-'+_0x5cf51c+'/'+_0x4867a0)[_0xbce5('0x19')](_0xa3a127);}return null;};}function patchUpdates(_0x46b3b2){return function(_0x1292bb){try{jsonpatch[_0xbce5('0x20')](_0x1292bb,_0x46b3b2,!![]);}catch(_0x5f2bb0){return BPromise[_0xbce5('0x21')](_0x5f2bb0);}return _0x1292bb['save']();};}function saveUpdates(_0x3f6aa2,_0x3eac4d){return function(_0x522d1c){if(_0x522d1c){return _0x522d1c[_0xbce5('0x22')](_0x3f6aa2)[_0xbce5('0x23')](function(_0x32f79b){return _0x32f79b;});}return null;};}function removeEntity(_0x4874b7,_0x16a5c1){return function(_0x2231e7){if(_0x2231e7){return _0x2231e7[_0xbce5('0x24')]()[_0xbce5('0x23')](function(){_0x4874b7[_0xbce5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dab56,_0x21d57d){return function(_0x53e17e){if(!_0x53e17e){_0x1dab56[_0xbce5('0x17')](0x194);}return _0x53e17e;};}function handleError(_0x2ffbef,_0x59c6f8){_0x59c6f8=_0x59c6f8||0x1f4;return function(_0x15f2d4){logger[_0xbce5('0x25')](_0x15f2d4[_0xbce5('0x26')]);if(_0x15f2d4[_0xbce5('0x27')]){delete _0x15f2d4['name'];}_0x2ffbef[_0xbce5('0x18')](_0x59c6f8)['send'](_0x15f2d4);};}exports['index']=function(_0x1c6136,_0x51412f){var _0x3358b8={},_0x4bb9c4={},_0x3e0526={'count':0x0,'rows':[]};var _0x38a486=_[_0xbce5('0x28')](db[_0xbce5('0x29')]['rawAttributes'],function(_0x323b3f){return{'name':_0x323b3f[_0xbce5('0x2a')],'type':_0x323b3f[_0xbce5('0x2b')][_0xbce5('0x2c')]};});_0x4bb9c4[_0xbce5('0x2d')]=_[_0xbce5('0x28')](_0x38a486,'name');_0x4bb9c4[_0xbce5('0x2e')]=_['keys'](_0x1c6136['query']);_0x4bb9c4[_0xbce5('0x2f')]=_[_0xbce5('0x30')](_0x4bb9c4[_0xbce5('0x2d')],_0x4bb9c4['query']);_0x3358b8[_0xbce5('0x31')]=_[_0xbce5('0x30')](_0x4bb9c4[_0xbce5('0x2d')],qs[_0xbce5('0x32')](_0x1c6136[_0xbce5('0x2e')]['fields']));_0x3358b8[_0xbce5('0x31')]=_0x3358b8[_0xbce5('0x31')][_0xbce5('0x33')]?_0x3358b8[_0xbce5('0x31')]:_0x4bb9c4[_0xbce5('0x2d')];if(!_0x1c6136['query'][_0xbce5('0x34')](_0xbce5('0x35'))){_0x3358b8[_0xbce5('0x1d')]=qs[_0xbce5('0x1d')](_0x1c6136[_0xbce5('0x2e')]['limit']);_0x3358b8[_0xbce5('0x1a')]=qs[_0xbce5('0x1a')](_0x1c6136[_0xbce5('0x2e')][_0xbce5('0x1a')]);}_0x3358b8[_0xbce5('0x36')]=qs[_0xbce5('0x37')](_0x1c6136[_0xbce5('0x2e')][_0xbce5('0x37')]);_0x3358b8[_0xbce5('0x38')]=qs[_0xbce5('0x2f')](_[_0xbce5('0x39')](_0x1c6136[_0xbce5('0x2e')],_0x4bb9c4[_0xbce5('0x2f')]),_0x38a486);if(_0x1c6136[_0xbce5('0x2e')][_0xbce5('0x3a')]){_0x3358b8[_0xbce5('0x38')]=_[_0xbce5('0x3b')](_0x3358b8[_0xbce5('0x38')],{'$or':_['map'](_0x38a486,function(_0x2dff13){if(_0x2dff13['type']!==_0xbce5('0x3c')){var _0x40827d={};_0x40827d[_0x2dff13['name']]={'$like':'%'+_0x1c6136[_0xbce5('0x2e')][_0xbce5('0x3a')]+'%'};return _0x40827d;}})});}_0x3358b8=_[_0xbce5('0x3b')]({},_0x3358b8,_0x1c6136[_0xbce5('0x3d')]);var _0x3b04db={'where':_0x3358b8[_0xbce5('0x38')]};return db[_0xbce5('0x29')][_0xbce5('0x1c')](_0x3b04db)[_0xbce5('0x23')](function(_0x2ce22e){_0x3e0526['count']=_0x2ce22e;if(_0x1c6136[_0xbce5('0x2e')][_0xbce5('0x3e')]){_0x3358b8['include']=[{'all':!![]}];}return db[_0xbce5('0x29')][_0xbce5('0x3f')](_0x3358b8);})[_0xbce5('0x23')](function(_0x5a80e3){_0x3e0526[_0xbce5('0x40')]=_0x5a80e3;return _0x3e0526;})[_0xbce5('0x23')](respondWithFilteredResult(_0x51412f,_0x3358b8))[_0xbce5('0x41')](handleError(_0x51412f,null));};exports[_0xbce5('0x42')]=function(_0xdf91b5,_0x1e8bfa){var _0x2a5c64={'raw':![],'where':{'id':_0xdf91b5[_0xbce5('0x43')]['id']}},_0x5a98d1={};_0x5a98d1[_0xbce5('0x2d')]=_[_0xbce5('0x44')](db[_0xbce5('0x29')][_0xbce5('0x45')]);_0x5a98d1[_0xbce5('0x2e')]=_[_0xbce5('0x44')](_0xdf91b5[_0xbce5('0x2e')]);_0x5a98d1['filters']=_[_0xbce5('0x30')](_0x5a98d1[_0xbce5('0x2d')],_0x5a98d1[_0xbce5('0x2e')]);_0x2a5c64['attributes']=_[_0xbce5('0x30')](_0x5a98d1[_0xbce5('0x2d')],qs[_0xbce5('0x32')](_0xdf91b5['query'][_0xbce5('0x32')]));_0x2a5c64[_0xbce5('0x31')]=_0x2a5c64[_0xbce5('0x31')][_0xbce5('0x33')]?_0x2a5c64[_0xbce5('0x31')]:_0x5a98d1[_0xbce5('0x2d')];if(_0xdf91b5[_0xbce5('0x2e')]['includeAll']){_0x2a5c64[_0xbce5('0x46')]=[{'all':!![]}];}_0x2a5c64=_[_0xbce5('0x3b')]({},_0x2a5c64,_0xdf91b5['options']);return db['Dynamics365Configuration'][_0xbce5('0x47')](_0x2a5c64)[_0xbce5('0x23')](handleEntityNotFound(_0x1e8bfa,null))['then'](respondWithResult(_0x1e8bfa,null))['catch'](handleError(_0x1e8bfa,null));};exports[_0xbce5('0x48')]=function(_0xb9ee3c,_0x3b17bf){return db[_0xbce5('0x29')]['create'](_0xb9ee3c[_0xbce5('0x49')],{})[_0xbce5('0x23')](respondWithResult(_0x3b17bf,0xc9))[_0xbce5('0x41')](handleError(_0x3b17bf,null));};exports['update']=function(_0x5b6098,_0x21214a){if(_0x5b6098['body']['id']){delete _0x5b6098['body']['id'];}return db[_0xbce5('0x29')][_0xbce5('0x47')]({'where':{'id':_0x5b6098[_0xbce5('0x43')]['id']}})[_0xbce5('0x23')](handleEntityNotFound(_0x21214a,null))[_0xbce5('0x23')](saveUpdates(_0x5b6098[_0xbce5('0x49')],null))['then'](respondWithResult(_0x21214a,null))['catch'](handleError(_0x21214a,null));};exports[_0xbce5('0x24')]=function(_0x20517e,_0x3798fd){return db['Dynamics365Configuration'][_0xbce5('0x47')]({'where':{'id':_0x20517e['params']['id']}})['then'](handleEntityNotFound(_0x3798fd,null))[_0xbce5('0x23')](removeEntity(_0x3798fd,null))[_0xbce5('0x41')](handleError(_0x3798fd,null));};exports[_0xbce5('0x4a')]=function(_0x31ef86,_0xe21e42,_0x607f69){var _0x5b8461={};var _0x431fd0={};var _0x1462d0;var _0x2f0aba;return db['Dynamics365Configuration'][_0xbce5('0x4b')]({'where':{'id':_0x31ef86[_0xbce5('0x43')]['id']}})['then'](handleEntityNotFound(_0xe21e42,null))['then'](function(_0x3527ad){if(_0x3527ad){_0x1462d0=_0x3527ad;_0x431fd0[_0xbce5('0x2d')]=_[_0xbce5('0x44')](db[_0xbce5('0x4c')]['rawAttributes']);_0x431fd0[_0xbce5('0x2e')]=_['keys'](_0x31ef86['query']);_0x431fd0[_0xbce5('0x2f')]=_[_0xbce5('0x30')](_0x431fd0['model'],_0x431fd0['query']);_0x5b8461['attributes']=_[_0xbce5('0x30')](_0x431fd0['model'],qs[_0xbce5('0x32')](_0x31ef86[_0xbce5('0x2e')][_0xbce5('0x32')]));_0x5b8461[_0xbce5('0x31')]=_0x5b8461['attributes'][_0xbce5('0x33')]?_0x5b8461[_0xbce5('0x31')]:_0x431fd0[_0xbce5('0x2d')];_0x5b8461[_0xbce5('0x36')]=qs[_0xbce5('0x37')](_0x31ef86[_0xbce5('0x2e')]['sort']);_0x5b8461['where']=qs[_0xbce5('0x2f')](_[_0xbce5('0x39')](_0x31ef86[_0xbce5('0x2e')],_0x431fd0[_0xbce5('0x2f')]));if(_0x31ef86[_0xbce5('0x2e')][_0xbce5('0x3a')]){_0x5b8461[_0xbce5('0x38')]=_[_0xbce5('0x3b')](_0x5b8461[_0xbce5('0x38')],{'$or':_[_0xbce5('0x28')](_0x5b8461['attributes'],function(_0xdff911){var _0x39762b={};_0x39762b[_0xdff911]={'$like':'%'+_0x31ef86[_0xbce5('0x2e')][_0xbce5('0x3a')]+'%'};return _0x39762b;})});}_0x5b8461=_[_0xbce5('0x3b')]({},_0x5b8461,_0x31ef86[_0xbce5('0x3d')]);return _0x1462d0['getFields'](_0x5b8461);}})[_0xbce5('0x23')](function(_0x1fc88a){if(_0x1fc88a){_0x2f0aba=_0x1fc88a[_0xbce5('0x33')];if(!_0x31ef86[_0xbce5('0x2e')]['hasOwnProperty']('nolimit')){_0x5b8461[_0xbce5('0x1d')]=qs[_0xbce5('0x1d')](_0x31ef86[_0xbce5('0x2e')]['limit']);_0x5b8461[_0xbce5('0x1a')]=qs[_0xbce5('0x1a')](_0x31ef86[_0xbce5('0x2e')][_0xbce5('0x1a')]);}return _0x1462d0[_0xbce5('0x4a')](_0x5b8461);}})['then'](function(_0x30ee82){if(_0x30ee82){return _0x30ee82?{'count':_0x2f0aba,'rows':_0x30ee82}:null;}})[_0xbce5('0x23')](respondWithResult(_0xe21e42,null))[_0xbce5('0x41')](handleError(_0xe21e42,null));};exports[_0xbce5('0x4d')]=function(_0x525ecc,_0x2974ae,_0x4ab3a2){var _0x232527={};var _0x2a9192={};var _0x7039fd;var _0x254ddc;return db[_0xbce5('0x29')]['findOne']({'where':{'id':_0x525ecc[_0xbce5('0x43')]['id']}})['then'](handleEntityNotFound(_0x2974ae,null))['then'](function(_0x26e871){if(_0x26e871){_0x7039fd=_0x26e871;_0x2a9192[_0xbce5('0x2d')]=_[_0xbce5('0x44')](db['Dynamics365Field']['rawAttributes']);_0x2a9192[_0xbce5('0x2e')]=_[_0xbce5('0x44')](_0x525ecc['query']);_0x2a9192[_0xbce5('0x2f')]=_['intersection'](_0x2a9192[_0xbce5('0x2d')],_0x2a9192[_0xbce5('0x2e')]);_0x232527[_0xbce5('0x31')]=_['intersection'](_0x2a9192[_0xbce5('0x2d')],qs[_0xbce5('0x32')](_0x525ecc['query'][_0xbce5('0x32')]));_0x232527['attributes']=_0x232527[_0xbce5('0x31')][_0xbce5('0x33')]?_0x232527[_0xbce5('0x31')]:_0x2a9192[_0xbce5('0x2d')];_0x232527[_0xbce5('0x36')]=qs[_0xbce5('0x37')](_0x525ecc['query'][_0xbce5('0x37')]);_0x232527['where']=qs['filters'](_[_0xbce5('0x39')](_0x525ecc[_0xbce5('0x2e')],_0x2a9192[_0xbce5('0x2f')]));if(_0x525ecc[_0xbce5('0x2e')]['filter']){_0x232527[_0xbce5('0x38')]=_[_0xbce5('0x3b')](_0x232527['where'],{'$or':_[_0xbce5('0x28')](_0x232527[_0xbce5('0x31')],function(_0x4f18ea){var _0x1fdaae={};_0x1fdaae[_0x4f18ea]={'$like':'%'+_0x525ecc[_0xbce5('0x2e')]['filter']+'%'};return _0x1fdaae;})});}_0x232527=_[_0xbce5('0x3b')]({},_0x232527,_0x525ecc[_0xbce5('0x3d')]);return _0x7039fd[_0xbce5('0x4d')](_0x232527);}})[_0xbce5('0x23')](function(_0xd29bae){if(_0xd29bae){_0x254ddc=_0xd29bae[_0xbce5('0x33')];if(!_0x525ecc[_0xbce5('0x2e')][_0xbce5('0x34')](_0xbce5('0x35'))){_0x232527['limit']=qs[_0xbce5('0x1d')](_0x525ecc[_0xbce5('0x2e')]['limit']);_0x232527['offset']=qs['offset'](_0x525ecc[_0xbce5('0x2e')][_0xbce5('0x1a')]);}return _0x7039fd['getSubjects'](_0x232527);}})['then'](function(_0x58b631){if(_0x58b631){return _0x58b631?{'count':_0x254ddc,'rows':_0x58b631}:null;}})[_0xbce5('0x23')](respondWithResult(_0x2974ae,null))['catch'](handleError(_0x2974ae,null));};exports[_0xbce5('0x4e')]=function(_0x2c0f82,_0x1f9ea4,_0x3629e1){var _0x4cab4b={};var _0x966706={};var _0x1b7ba7;var _0x2a4a39;return db[_0xbce5('0x29')][_0xbce5('0x4b')]({'where':{'id':_0x2c0f82['params']['id']}})[_0xbce5('0x23')](handleEntityNotFound(_0x1f9ea4,null))['then'](function(_0x2b3787){if(_0x2b3787){_0x1b7ba7=_0x2b3787;_0x966706[_0xbce5('0x2d')]=_[_0xbce5('0x44')](db[_0xbce5('0x4c')]['rawAttributes']);_0x966706[_0xbce5('0x2e')]=_[_0xbce5('0x44')](_0x2c0f82[_0xbce5('0x2e')]);_0x966706[_0xbce5('0x2f')]=_[_0xbce5('0x30')](_0x966706[_0xbce5('0x2d')],_0x966706[_0xbce5('0x2e')]);_0x4cab4b[_0xbce5('0x31')]=_['intersection'](_0x966706[_0xbce5('0x2d')],qs[_0xbce5('0x32')](_0x2c0f82[_0xbce5('0x2e')]['fields']));_0x4cab4b[_0xbce5('0x31')]=_0x4cab4b['attributes'][_0xbce5('0x33')]?_0x4cab4b[_0xbce5('0x31')]:_0x966706[_0xbce5('0x2d')];_0x4cab4b[_0xbce5('0x36')]=qs[_0xbce5('0x37')](_0x2c0f82[_0xbce5('0x2e')][_0xbce5('0x37')]);_0x4cab4b[_0xbce5('0x38')]=qs[_0xbce5('0x2f')](_[_0xbce5('0x39')](_0x2c0f82['query'],_0x966706[_0xbce5('0x2f')]));if(_0x2c0f82[_0xbce5('0x2e')]['filter']){_0x4cab4b[_0xbce5('0x38')]=_[_0xbce5('0x3b')](_0x4cab4b[_0xbce5('0x38')],{'$or':_['map'](_0x4cab4b['attributes'],function(_0x3ce2b7){var _0x4d6472={};_0x4d6472[_0x3ce2b7]={'$like':'%'+_0x2c0f82['query'][_0xbce5('0x3a')]+'%'};return _0x4d6472;})});}_0x4cab4b=_[_0xbce5('0x3b')]({},_0x4cab4b,_0x2c0f82[_0xbce5('0x3d')]);return _0x1b7ba7[_0xbce5('0x4e')](_0x4cab4b);}})[_0xbce5('0x23')](function(_0x22cbf5){if(_0x22cbf5){_0x2a4a39=_0x22cbf5[_0xbce5('0x33')];if(!_0x2c0f82['query'][_0xbce5('0x34')](_0xbce5('0x35'))){_0x4cab4b[_0xbce5('0x1d')]=qs[_0xbce5('0x1d')](_0x2c0f82[_0xbce5('0x2e')][_0xbce5('0x1d')]);_0x4cab4b['offset']=qs[_0xbce5('0x1a')](_0x2c0f82['query'][_0xbce5('0x1a')]);}return _0x1b7ba7[_0xbce5('0x4e')](_0x4cab4b);}})[_0xbce5('0x23')](function(_0x30bdd3){if(_0x30bdd3){return _0x30bdd3?{'count':_0x2a4a39,'rows':_0x30bdd3}:null;}})[_0xbce5('0x23')](respondWithResult(_0x1f9ea4,null))['catch'](handleError(_0x1f9ea4,null));}; \ No newline at end of file +var _0x6426=['VIRTUAL','filter','options','include','findAll','rows','catch','show','params','find','create','body','getFields','Dynamics365Field','rawAttributes','getSubjects','getDescriptions','findOne','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','Dynamics365Configuration','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filters','where','merge'];(function(_0x556bca,_0x573fb9){var _0x16c8fd=function(_0x469625){while(--_0x469625){_0x556bca['push'](_0x556bca['shift']());}};_0x16c8fd(++_0x573fb9);}(_0x6426,0xb0));var _0x6642=function(_0x13717f,_0x27cd0b){_0x13717f=_0x13717f-0x0;var _0x300e62=_0x6426[_0x13717f];return _0x300e62;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6642('0x0'));var jsonpatch=require(_0x6642('0x1'));var rp=require(_0x6642('0x2'));var moment=require(_0x6642('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6642('0x4'));var path=require(_0x6642('0x5'));var sox=require('sox');var csv=require(_0x6642('0x6'));var ejs=require(_0x6642('0x7'));var fs=require('fs');var fs_extra=require(_0x6642('0x8'));var _=require(_0x6642('0x9'));var squel=require(_0x6642('0xa'));var crypto=require(_0x6642('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6642('0x6'));var querystring=require('querystring');var Papa=require(_0x6642('0xc'));var Redis=require(_0x6642('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x6642('0xe'));var as=require(_0x6642('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6642('0x10'))(_0x6642('0x11'));var utils=require(_0x6642('0x12'));var config=require(_0x6642('0x13'));var licenseUtil=require(_0x6642('0x14'));var db=require(_0x6642('0x15'))['db'];function respondWithStatusCode(_0x1c4c49,_0x5eedff){_0x5eedff=_0x5eedff||0xcc;return function(_0x211235){if(_0x211235){return _0x1c4c49[_0x6642('0x16')](_0x5eedff);}return _0x1c4c49['status'](_0x5eedff)['end']();};}function respondWithResult(_0xd8ef32,_0x5dc4f0){_0x5dc4f0=_0x5dc4f0||0xc8;return function(_0x129dce){if(_0x129dce){return _0xd8ef32[_0x6642('0x17')](_0x5dc4f0)[_0x6642('0x18')](_0x129dce);}};}function respondWithFilteredResult(_0x339eea,_0x133b40){return function(_0x43bbec){if(_0x43bbec){var _0x44e275=typeof _0x133b40[_0x6642('0x19')]===_0x6642('0x1a')&&typeof _0x133b40[_0x6642('0x1b')]===_0x6642('0x1a');var _0x51b36a=_0x43bbec[_0x6642('0x1c')];var _0x47caa8=_0x44e275?0x0:_0x133b40[_0x6642('0x19')];var _0x5d1c76=_0x44e275?_0x43bbec[_0x6642('0x1c')]:_0x133b40[_0x6642('0x19')]+_0x133b40['limit'];var _0x548de1;if(_0x5d1c76>=_0x51b36a){_0x5d1c76=_0x51b36a;_0x548de1=0xc8;}else{_0x548de1=0xce;}_0x339eea[_0x6642('0x17')](_0x548de1);return _0x339eea[_0x6642('0x1d')](_0x6642('0x1e'),_0x47caa8+'-'+_0x5d1c76+'/'+_0x51b36a)[_0x6642('0x18')](_0x43bbec);}return null;};}function patchUpdates(_0x1c667a){return function(_0x184782){try{jsonpatch['apply'](_0x184782,_0x1c667a,!![]);}catch(_0x47a54a){return BPromise['reject'](_0x47a54a);}return _0x184782[_0x6642('0x1f')]();};}function saveUpdates(_0xf692ae,_0x2b2e54){return function(_0x5f4b77){if(_0x5f4b77){return _0x5f4b77[_0x6642('0x20')](_0xf692ae)[_0x6642('0x21')](function(_0x3ca9e9){return _0x3ca9e9;});}return null;};}function removeEntity(_0x253fb0,_0x4c25a9){return function(_0x25e048){if(_0x25e048){return _0x25e048[_0x6642('0x22')]()['then'](function(){_0x253fb0[_0x6642('0x17')](0xcc)[_0x6642('0x23')]();});}};}function handleEntityNotFound(_0x1edc7e,_0x23d8bc){return function(_0x13bf0e){if(!_0x13bf0e){_0x1edc7e['sendStatus'](0x194);}return _0x13bf0e;};}function handleError(_0x443377,_0x4ee0e7){_0x4ee0e7=_0x4ee0e7||0x1f4;return function(_0x369cae){logger[_0x6642('0x24')](_0x369cae[_0x6642('0x25')]);if(_0x369cae[_0x6642('0x26')]){delete _0x369cae['name'];}_0x443377[_0x6642('0x17')](_0x4ee0e7)[_0x6642('0x27')](_0x369cae);};}exports[_0x6642('0x28')]=function(_0x9b4046,_0x45c35d){var _0x37053a={},_0x1fc4c1={},_0x1325f1={'count':0x0,'rows':[]};var _0x5435dc=_[_0x6642('0x29')](db[_0x6642('0x2a')]['rawAttributes'],function(_0x5928f8){return{'name':_0x5928f8[_0x6642('0x2b')],'type':_0x5928f8[_0x6642('0x2c')][_0x6642('0x2d')]};});_0x1fc4c1['model']=_[_0x6642('0x29')](_0x5435dc,_0x6642('0x26'));_0x1fc4c1[_0x6642('0x2e')]=_[_0x6642('0x2f')](_0x9b4046[_0x6642('0x2e')]);_0x1fc4c1['filters']=_[_0x6642('0x30')](_0x1fc4c1[_0x6642('0x31')],_0x1fc4c1[_0x6642('0x2e')]);_0x37053a['attributes']=_[_0x6642('0x30')](_0x1fc4c1[_0x6642('0x31')],qs[_0x6642('0x32')](_0x9b4046[_0x6642('0x2e')][_0x6642('0x32')]));_0x37053a[_0x6642('0x33')]=_0x37053a['attributes'][_0x6642('0x34')]?_0x37053a[_0x6642('0x33')]:_0x1fc4c1[_0x6642('0x31')];if(!_0x9b4046['query'][_0x6642('0x35')](_0x6642('0x36'))){_0x37053a[_0x6642('0x1b')]=qs['limit'](_0x9b4046[_0x6642('0x2e')]['limit']);_0x37053a['offset']=qs[_0x6642('0x19')](_0x9b4046[_0x6642('0x2e')][_0x6642('0x19')]);}_0x37053a[_0x6642('0x37')]=qs[_0x6642('0x38')](_0x9b4046[_0x6642('0x2e')][_0x6642('0x38')]);_0x37053a['where']=qs['filters'](_[_0x6642('0x39')](_0x9b4046['query'],_0x1fc4c1[_0x6642('0x3a')]),_0x5435dc);if(_0x9b4046[_0x6642('0x2e')]['filter']){_0x37053a[_0x6642('0x3b')]=_[_0x6642('0x3c')](_0x37053a[_0x6642('0x3b')],{'$or':_[_0x6642('0x29')](_0x5435dc,function(_0x24ffa9){if(_0x24ffa9[_0x6642('0x2c')]!==_0x6642('0x3d')){var _0x195379={};_0x195379[_0x24ffa9[_0x6642('0x26')]]={'$like':'%'+_0x9b4046[_0x6642('0x2e')][_0x6642('0x3e')]+'%'};return _0x195379;}})});}_0x37053a=_[_0x6642('0x3c')]({},_0x37053a,_0x9b4046[_0x6642('0x3f')]);var _0x2ef03a={'where':_0x37053a[_0x6642('0x3b')]};return db[_0x6642('0x2a')][_0x6642('0x1c')](_0x2ef03a)[_0x6642('0x21')](function(_0x44fe0d){_0x1325f1[_0x6642('0x1c')]=_0x44fe0d;if(_0x9b4046[_0x6642('0x2e')]['includeAll']){_0x37053a[_0x6642('0x40')]=[{'all':!![]}];}return db[_0x6642('0x2a')][_0x6642('0x41')](_0x37053a);})[_0x6642('0x21')](function(_0x2a4bbc){_0x1325f1[_0x6642('0x42')]=_0x2a4bbc;return _0x1325f1;})['then'](respondWithFilteredResult(_0x45c35d,_0x37053a))[_0x6642('0x43')](handleError(_0x45c35d,null));};exports[_0x6642('0x44')]=function(_0x4cff18,_0x364c99){var _0xccf4b4={'raw':![],'where':{'id':_0x4cff18[_0x6642('0x45')]['id']}},_0x5a61bc={};_0x5a61bc[_0x6642('0x31')]=_[_0x6642('0x2f')](db['Dynamics365Configuration']['rawAttributes']);_0x5a61bc[_0x6642('0x2e')]=_['keys'](_0x4cff18[_0x6642('0x2e')]);_0x5a61bc['filters']=_[_0x6642('0x30')](_0x5a61bc['model'],_0x5a61bc[_0x6642('0x2e')]);_0xccf4b4[_0x6642('0x33')]=_[_0x6642('0x30')](_0x5a61bc[_0x6642('0x31')],qs[_0x6642('0x32')](_0x4cff18[_0x6642('0x2e')][_0x6642('0x32')]));_0xccf4b4[_0x6642('0x33')]=_0xccf4b4[_0x6642('0x33')][_0x6642('0x34')]?_0xccf4b4['attributes']:_0x5a61bc[_0x6642('0x31')];if(_0x4cff18[_0x6642('0x2e')]['includeAll']){_0xccf4b4[_0x6642('0x40')]=[{'all':!![]}];}_0xccf4b4=_[_0x6642('0x3c')]({},_0xccf4b4,_0x4cff18[_0x6642('0x3f')]);return db[_0x6642('0x2a')][_0x6642('0x46')](_0xccf4b4)['then'](handleEntityNotFound(_0x364c99,null))['then'](respondWithResult(_0x364c99,null))['catch'](handleError(_0x364c99,null));};exports['create']=function(_0x3728ea,_0x2140bd){return db[_0x6642('0x2a')][_0x6642('0x47')](_0x3728ea['body'],{})['then'](respondWithResult(_0x2140bd,0xc9))[_0x6642('0x43')](handleError(_0x2140bd,null));};exports[_0x6642('0x20')]=function(_0x4af0af,_0x3a8ef1){if(_0x4af0af['body']['id']){delete _0x4af0af['body']['id'];}return db[_0x6642('0x2a')][_0x6642('0x46')]({'where':{'id':_0x4af0af[_0x6642('0x45')]['id']}})[_0x6642('0x21')](handleEntityNotFound(_0x3a8ef1,null))[_0x6642('0x21')](saveUpdates(_0x4af0af[_0x6642('0x48')],null))[_0x6642('0x21')](respondWithResult(_0x3a8ef1,null))[_0x6642('0x43')](handleError(_0x3a8ef1,null));};exports['destroy']=function(_0x13bc4b,_0x3f1745){return db['Dynamics365Configuration'][_0x6642('0x46')]({'where':{'id':_0x13bc4b[_0x6642('0x45')]['id']}})[_0x6642('0x21')](handleEntityNotFound(_0x3f1745,null))[_0x6642('0x21')](removeEntity(_0x3f1745,null))[_0x6642('0x43')](handleError(_0x3f1745,null));};exports[_0x6642('0x49')]=function(_0x2324c8,_0x2937f9,_0x1a3dc8){var _0x197375={};var _0x229e55={};var _0x175f50;var _0x2887ea;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x2324c8[_0x6642('0x45')]['id']}})[_0x6642('0x21')](handleEntityNotFound(_0x2937f9,null))[_0x6642('0x21')](function(_0x6c0ec0){if(_0x6c0ec0){_0x175f50=_0x6c0ec0;_0x229e55[_0x6642('0x31')]=_[_0x6642('0x2f')](db[_0x6642('0x4a')][_0x6642('0x4b')]);_0x229e55[_0x6642('0x2e')]=_['keys'](_0x2324c8[_0x6642('0x2e')]);_0x229e55[_0x6642('0x3a')]=_[_0x6642('0x30')](_0x229e55[_0x6642('0x31')],_0x229e55['query']);_0x197375[_0x6642('0x33')]=_[_0x6642('0x30')](_0x229e55[_0x6642('0x31')],qs[_0x6642('0x32')](_0x2324c8[_0x6642('0x2e')][_0x6642('0x32')]));_0x197375[_0x6642('0x33')]=_0x197375[_0x6642('0x33')][_0x6642('0x34')]?_0x197375[_0x6642('0x33')]:_0x229e55[_0x6642('0x31')];_0x197375[_0x6642('0x37')]=qs[_0x6642('0x38')](_0x2324c8[_0x6642('0x2e')]['sort']);_0x197375['where']=qs[_0x6642('0x3a')](_['pick'](_0x2324c8[_0x6642('0x2e')],_0x229e55['filters']));if(_0x2324c8[_0x6642('0x2e')][_0x6642('0x3e')]){_0x197375[_0x6642('0x3b')]=_[_0x6642('0x3c')](_0x197375[_0x6642('0x3b')],{'$or':_[_0x6642('0x29')](_0x197375[_0x6642('0x33')],function(_0x37e7f4){var _0x1aa16f={};_0x1aa16f[_0x37e7f4]={'$like':'%'+_0x2324c8['query']['filter']+'%'};return _0x1aa16f;})});}_0x197375=_[_0x6642('0x3c')]({},_0x197375,_0x2324c8[_0x6642('0x3f')]);return _0x175f50[_0x6642('0x49')](_0x197375);}})[_0x6642('0x21')](function(_0x7b9716){if(_0x7b9716){_0x2887ea=_0x7b9716[_0x6642('0x34')];if(!_0x2324c8['query'][_0x6642('0x35')](_0x6642('0x36'))){_0x197375['limit']=qs[_0x6642('0x1b')](_0x2324c8[_0x6642('0x2e')][_0x6642('0x1b')]);_0x197375['offset']=qs[_0x6642('0x19')](_0x2324c8[_0x6642('0x2e')][_0x6642('0x19')]);}return _0x175f50['getFields'](_0x197375);}})[_0x6642('0x21')](function(_0x3ebbaf){if(_0x3ebbaf){return _0x3ebbaf?{'count':_0x2887ea,'rows':_0x3ebbaf}:null;}})[_0x6642('0x21')](respondWithResult(_0x2937f9,null))[_0x6642('0x43')](handleError(_0x2937f9,null));};exports[_0x6642('0x4c')]=function(_0x13fde5,_0x65b481,_0x1cdf2e){var _0x418878={};var _0x357ff1={};var _0x1c65d3;var _0xf19e22;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x13fde5[_0x6642('0x45')]['id']}})['then'](handleEntityNotFound(_0x65b481,null))[_0x6642('0x21')](function(_0x83c207){if(_0x83c207){_0x1c65d3=_0x83c207;_0x357ff1[_0x6642('0x31')]=_[_0x6642('0x2f')](db[_0x6642('0x4a')][_0x6642('0x4b')]);_0x357ff1['query']=_[_0x6642('0x2f')](_0x13fde5['query']);_0x357ff1[_0x6642('0x3a')]=_[_0x6642('0x30')](_0x357ff1[_0x6642('0x31')],_0x357ff1[_0x6642('0x2e')]);_0x418878['attributes']=_[_0x6642('0x30')](_0x357ff1[_0x6642('0x31')],qs[_0x6642('0x32')](_0x13fde5['query']['fields']));_0x418878['attributes']=_0x418878[_0x6642('0x33')][_0x6642('0x34')]?_0x418878[_0x6642('0x33')]:_0x357ff1[_0x6642('0x31')];_0x418878[_0x6642('0x37')]=qs[_0x6642('0x38')](_0x13fde5['query'][_0x6642('0x38')]);_0x418878[_0x6642('0x3b')]=qs[_0x6642('0x3a')](_[_0x6642('0x39')](_0x13fde5[_0x6642('0x2e')],_0x357ff1[_0x6642('0x3a')]));if(_0x13fde5[_0x6642('0x2e')][_0x6642('0x3e')]){_0x418878[_0x6642('0x3b')]=_[_0x6642('0x3c')](_0x418878[_0x6642('0x3b')],{'$or':_[_0x6642('0x29')](_0x418878['attributes'],function(_0x168a29){var _0xa417e9={};_0xa417e9[_0x168a29]={'$like':'%'+_0x13fde5[_0x6642('0x2e')]['filter']+'%'};return _0xa417e9;})});}_0x418878=_[_0x6642('0x3c')]({},_0x418878,_0x13fde5[_0x6642('0x3f')]);return _0x1c65d3[_0x6642('0x4c')](_0x418878);}})[_0x6642('0x21')](function(_0x30af47){if(_0x30af47){_0xf19e22=_0x30af47[_0x6642('0x34')];if(!_0x13fde5[_0x6642('0x2e')][_0x6642('0x35')](_0x6642('0x36'))){_0x418878[_0x6642('0x1b')]=qs[_0x6642('0x1b')](_0x13fde5[_0x6642('0x2e')][_0x6642('0x1b')]);_0x418878[_0x6642('0x19')]=qs[_0x6642('0x19')](_0x13fde5[_0x6642('0x2e')][_0x6642('0x19')]);}return _0x1c65d3['getSubjects'](_0x418878);}})[_0x6642('0x21')](function(_0x4d2685){if(_0x4d2685){return _0x4d2685?{'count':_0xf19e22,'rows':_0x4d2685}:null;}})['then'](respondWithResult(_0x65b481,null))[_0x6642('0x43')](handleError(_0x65b481,null));};exports[_0x6642('0x4d')]=function(_0x1677c3,_0x405b9b,_0x319dd2){var _0x18841d={};var _0x30bcd0={};var _0x468d09;var _0x19a484;return db[_0x6642('0x2a')][_0x6642('0x4e')]({'where':{'id':_0x1677c3[_0x6642('0x45')]['id']}})[_0x6642('0x21')](handleEntityNotFound(_0x405b9b,null))[_0x6642('0x21')](function(_0x48af10){if(_0x48af10){_0x468d09=_0x48af10;_0x30bcd0[_0x6642('0x31')]=_['keys'](db[_0x6642('0x4a')][_0x6642('0x4b')]);_0x30bcd0[_0x6642('0x2e')]=_[_0x6642('0x2f')](_0x1677c3['query']);_0x30bcd0[_0x6642('0x3a')]=_[_0x6642('0x30')](_0x30bcd0[_0x6642('0x31')],_0x30bcd0[_0x6642('0x2e')]);_0x18841d[_0x6642('0x33')]=_[_0x6642('0x30')](_0x30bcd0['model'],qs[_0x6642('0x32')](_0x1677c3[_0x6642('0x2e')][_0x6642('0x32')]));_0x18841d[_0x6642('0x33')]=_0x18841d[_0x6642('0x33')]['length']?_0x18841d[_0x6642('0x33')]:_0x30bcd0[_0x6642('0x31')];_0x18841d[_0x6642('0x37')]=qs[_0x6642('0x38')](_0x1677c3[_0x6642('0x2e')][_0x6642('0x38')]);_0x18841d[_0x6642('0x3b')]=qs['filters'](_['pick'](_0x1677c3[_0x6642('0x2e')],_0x30bcd0['filters']));if(_0x1677c3['query'][_0x6642('0x3e')]){_0x18841d[_0x6642('0x3b')]=_[_0x6642('0x3c')](_0x18841d[_0x6642('0x3b')],{'$or':_[_0x6642('0x29')](_0x18841d['attributes'],function(_0x4b9440){var _0x715927={};_0x715927[_0x4b9440]={'$like':'%'+_0x1677c3[_0x6642('0x2e')][_0x6642('0x3e')]+'%'};return _0x715927;})});}_0x18841d=_[_0x6642('0x3c')]({},_0x18841d,_0x1677c3[_0x6642('0x3f')]);return _0x468d09['getDescriptions'](_0x18841d);}})[_0x6642('0x21')](function(_0x4ead27){if(_0x4ead27){_0x19a484=_0x4ead27[_0x6642('0x34')];if(!_0x1677c3[_0x6642('0x2e')]['hasOwnProperty'](_0x6642('0x36'))){_0x18841d[_0x6642('0x1b')]=qs[_0x6642('0x1b')](_0x1677c3[_0x6642('0x2e')][_0x6642('0x1b')]);_0x18841d[_0x6642('0x19')]=qs[_0x6642('0x19')](_0x1677c3[_0x6642('0x2e')][_0x6642('0x19')]);}return _0x468d09[_0x6642('0x4d')](_0x18841d);}})[_0x6642('0x21')](function(_0x1c6113){if(_0x1c6113){return _0x1c6113?{'count':_0x19a484,'rows':_0x1c6113}:null;}})[_0x6642('0x21')](respondWithResult(_0x405b9b,null))[_0x6642('0x43')](handleError(_0x405b9b,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 3ed719f..bed5a32 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 _0xdace=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0x2d14b3,_0x3f4c9f){var _0x5b236c=function(_0x142f83){while(--_0x142f83){_0x2d14b3['push'](_0x2d14b3['shift']());}};_0x5b236c(++_0x3f4c9f);}(_0xdace,0xc5));var _0xedac=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xdace[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var logger=require(_0xedac('0x1'))(_0xedac('0x2'));var moment=require(_0xedac('0x3'));var BPromise=require('bluebird');var rp=require(_0xedac('0x4'));var fs=require('fs');var path=require(_0xedac('0x5'));var rimraf=require(_0xedac('0x6'));var config=require(_0xedac('0x7'));var attributes=require('./intDynamics365Configuration.attributes');module[_0xedac('0x8')]=function(_0x1cba89,_0x39328a){return _0x1cba89['define'](_0xedac('0x9'),attributes,{'tableName':_0xedac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb43b=['rimraf','../../config/environment','./intDynamics365Configuration.attributes','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','api','moment','bluebird','path'];(function(_0x500a5a,_0x455b3d){var _0x3d6b81=function(_0x51f91e){while(--_0x51f91e){_0x500a5a['push'](_0x500a5a['shift']());}};_0x3d6b81(++_0x455b3d);}(_0xb43b,0x1b2));var _0xbb43=function(_0x27f047,_0x5674c9){_0x27f047=_0x27f047-0x0;var _0x2fe97a=_0xb43b[_0x27f047];return _0x2fe97a;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var moment=require(_0xbb43('0x3'));var BPromise=require(_0xbb43('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb43('0x5'));var rimraf=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var attributes=require(_0xbb43('0x8'));module['exports']=function(_0x491fb9,_0x378df5){return _0x491fb9['define'](_0xbb43('0x9'),attributes,{'tableName':_0xbb43('0xa'),'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 06f5ecc..e4914ee 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 _0xf3e4=['result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x262cc4,_0x1da89f){var _0x1edbff=function(_0x1ed6b5){while(--_0x1ed6b5){_0x262cc4['push'](_0x262cc4['shift']());}};_0x1edbff(++_0x1da89f);}(_0xf3e4,0xfe));var _0x4f3e=function(_0x36d4a4,_0x48b901){_0x36d4a4=_0x36d4a4-0x0;var _0x532f54=_0xf3e4[_0x36d4a4];return _0x532f54;};'use strict';var _=require(_0x4f3e('0x0'));var util=require('util');var moment=require(_0x4f3e('0x1'));var BPromise=require(_0x4f3e('0x2'));var rs=require(_0x4f3e('0x3'));var fs=require('fs');var Redis=require(_0x4f3e('0x4'));var db=require(_0x4f3e('0x5'))['db'];var utils=require(_0x4f3e('0x6'));var logger=require(_0x4f3e('0x7'))(_0x4f3e('0x8'));var config=require(_0x4f3e('0x9'));var jayson=require(_0x4f3e('0xa'));var client=jayson[_0x4f3e('0xb')][_0x4f3e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x921275,_0x45a319,_0x4e46eb){return new BPromise(function(_0x2aff77,_0x554940){return client[_0x4f3e('0xd')](_0x921275,_0x4e46eb)[_0x4f3e('0xe')](function(_0x2c2999){logger['info'](_0x4f3e('0xf'),_0x45a319,'request\x20sent');logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x45a319,_0x4f3e('0x10'),JSON[_0x4f3e('0x11')](_0x2c2999));if(_0x2c2999[_0x4f3e('0x12')]){if(_0x2c2999[_0x4f3e('0x12')][_0x4f3e('0x13')]===0x1f4){logger[_0x4f3e('0x12')](_0x4f3e('0xf'),_0x45a319,_0x2c2999[_0x4f3e('0x12')][_0x4f3e('0x14')]);return _0x554940(_0x2c2999['error'][_0x4f3e('0x14')]);}logger[_0x4f3e('0x12')](_0x4f3e('0xf'),_0x45a319,_0x2c2999[_0x4f3e('0x12')][_0x4f3e('0x14')]);return _0x2aff77(_0x2c2999[_0x4f3e('0x12')]['message']);}else{logger[_0x4f3e('0x15')](_0x4f3e('0xf'),_0x45a319,_0x4f3e('0x10'));_0x2aff77(_0x2c2999[_0x4f3e('0x16')][_0x4f3e('0x14')]);}})['catch'](function(_0x3c0f3d){logger[_0x4f3e('0x12')](_0x4f3e('0xf'),_0x45a319,_0x3c0f3d);_0x554940(_0x3c0f3d);});});} \ No newline at end of file +var _0xa36c=['http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','client'];(function(_0x51149a,_0x3e2829){var _0x4af506=function(_0x32d039){while(--_0x32d039){_0x51149a['push'](_0x51149a['shift']());}};_0x4af506(++_0x3e2829);}(_0xa36c,0x6b));var _0xca36=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa36c[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xca36('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xca36('0x1'));var rs=require(_0xca36('0x2'));var fs=require('fs');var Redis=require(_0xca36('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xca36('0x4'))(_0xca36('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xca36('0x6')][_0xca36('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x49754a,_0x4c643a,_0xd58d8c){return new BPromise(function(_0x3dc4a1,_0x66fe89){return client[_0xca36('0x8')](_0x49754a,_0xd58d8c)[_0xca36('0x9')](function(_0xa923fb){logger[_0xca36('0xa')](_0xca36('0xb'),_0x4c643a,_0xca36('0xc'));logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x4c643a,_0xca36('0xc'),JSON[_0xca36('0xd')](_0xa923fb));if(_0xa923fb[_0xca36('0xe')]){if(_0xa923fb[_0xca36('0xe')][_0xca36('0xf')]===0x1f4){logger[_0xca36('0xe')](_0xca36('0xb'),_0x4c643a,_0xa923fb[_0xca36('0xe')][_0xca36('0x10')]);return _0x66fe89(_0xa923fb['error'][_0xca36('0x10')]);}logger[_0xca36('0xe')](_0xca36('0xb'),_0x4c643a,_0xa923fb['error']['message']);return _0x3dc4a1(_0xa923fb[_0xca36('0xe')]['message']);}else{logger[_0xca36('0xa')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4c643a,_0xca36('0xc'));_0x3dc4a1(_0xa923fb[_0xca36('0x11')][_0xca36('0x10')]);}})[_0xca36('0x12')](function(_0x37de56){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x4c643a,_0x37de56);_0x66fe89(_0x37de56);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 8ed5ab1..63ae387 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 _0xfd4e=['get','index','/:id','isAuthenticated','show','post','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfd4e,0x195));var _0xefd4=function(_0x374559,_0x2be7f7){_0x374559=_0x374559-0x0;var _0x3d38dc=_0xfd4e[_0x374559];return _0x3d38dc;};'use strict';var multer=require(_0xefd4('0x0'));var util=require(_0xefd4('0x1'));var path=require(_0xefd4('0x2'));var timeout=require(_0xefd4('0x3'));var express=require(_0xefd4('0x4'));var router=express['Router']();var fs_extra=require(_0xefd4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xefd4('0x6'));var config=require(_0xefd4('0x7'));var controller=require(_0xefd4('0x8'));router[_0xefd4('0x9')]('/',auth['isAuthenticated'](),controller[_0xefd4('0xa')]);router[_0xefd4('0x9')](_0xefd4('0xb'),auth[_0xefd4('0xc')](),controller[_0xefd4('0xd')]);router[_0xefd4('0xe')]('/',auth[_0xefd4('0xc')](),controller['create']);router['put'](_0xefd4('0xb'),auth[_0xefd4('0xc')](),controller[_0xefd4('0xf')]);router[_0xefd4('0x10')](_0xefd4('0xb'),auth['isAuthenticated'](),controller[_0xefd4('0x11')]);module['exports']=router; \ No newline at end of file +var _0x1399=['put','update','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0x1399,0xcc));var _0x9139=function(_0x4bf8fd,_0x543507){_0x4bf8fd=_0x4bf8fd-0x0;var _0x44ebc8=_0x1399[_0x4bf8fd];return _0x44ebc8;};'use strict';var multer=require(_0x9139('0x0'));var util=require(_0x9139('0x1'));var path=require(_0x9139('0x2'));var timeout=require('connect-timeout');var express=require(_0x9139('0x3'));var router=express['Router']();var fs_extra=require(_0x9139('0x4'));var auth=require(_0x9139('0x5'));var interaction=require(_0x9139('0x6'));var config=require(_0x9139('0x7'));var controller=require(_0x9139('0x8'));router[_0x9139('0x9')]('/',auth[_0x9139('0xa')](),controller[_0x9139('0xb')]);router[_0x9139('0x9')](_0x9139('0xc'),auth[_0x9139('0xa')](),controller[_0x9139('0xd')]);router[_0x9139('0xe')]('/',auth[_0x9139('0xa')](),controller[_0x9139('0xf')]);router[_0x9139('0x10')](_0x9139('0xc'),auth[_0x9139('0xa')](),controller[_0x9139('0x11')]);router['delete'](_0x9139('0xc'),auth['isAuthenticated'](),controller[_0x9139('0x12')]);module[_0x9139('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index e537fa4..5f37e66 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 _0xbf1b=['STRING','sequelize','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x4d6ac0,_0x201628){var _0x5296c4=function(_0x3d0b3d){while(--_0x3d0b3d){_0x4d6ac0['push'](_0x4d6ac0['shift']());}};_0x5296c4(++_0x201628);}(_0xbf1b,0x139));var _0xbbf1=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbf1b[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require(_0xbbf1('0x0'));module['exports']={'type':{'type':Sequelize[_0xbbf1('0x1')](_0xbbf1('0x2'),_0xbbf1('0x3'),_0xbbf1('0x4'),_0xbbf1('0x5'),_0xbbf1('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xbbf1('0x7')]},'key':{'type':Sequelize[_0xbbf1('0x7')]},'keyType':{'type':Sequelize[_0xbbf1('0x1')]('string',_0xbbf1('0x3'),_0xbbf1('0x4'))},'keyContent':{'type':Sequelize[_0xbbf1('0x7')]},'idField':{'type':Sequelize[_0xbbf1('0x7')]},'nameField':{'type':Sequelize[_0xbbf1('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbbf1('0x7')]}}; \ No newline at end of file +var _0xd4fd=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0xd4fd,0xba));var _0xdd4f=function(_0x550061,_0x39e542){_0x550061=_0x550061-0x0;var _0x5dcf7f=_0xd4fd[_0x550061];return _0x5dcf7f;};'use strict';var Sequelize=require(_0xdd4f('0x0'));module[_0xdd4f('0x1')]={'type':{'type':Sequelize[_0xdd4f('0x2')](_0xdd4f('0x3'),_0xdd4f('0x4'),_0xdd4f('0x5'),_0xdd4f('0x6'),_0xdd4f('0x7')),'defaultValue':_0xdd4f('0x3')},'content':{'type':Sequelize[_0xdd4f('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xdd4f('0x2')](_0xdd4f('0x3'),_0xdd4f('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xdd4f('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xdd4f('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdd4f('0x8')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index de7c549..ce48d53 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 _0x9905=['keys','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','findAll','rows','catch','show','params','options','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','limit','count','offset','set','json','apply','save','then','destroy','end','error','stack','name','index','Dynamics365Field','rawAttributes','key'];(function(_0x54e612,_0xcf670f){var _0x43dbd7=function(_0x39306b){while(--_0x39306b){_0x54e612['push'](_0x54e612['shift']());}};_0x43dbd7(++_0xcf670f);}(_0x9905,0xe9));var _0x5990=function(_0x3f716b,_0x3c46a4){_0x3f716b=_0x3f716b-0x0;var _0x13bcba=_0x9905[_0x3f716b];return _0x13bcba;};'use strict';var emlformat=require(_0x5990('0x0'));var rimraf=require(_0x5990('0x1'));var zipdir=require(_0x5990('0x2'));var jsonpatch=require(_0x5990('0x3'));var rp=require(_0x5990('0x4'));var moment=require(_0x5990('0x5'));var BPromise=require(_0x5990('0x6'));var Mustache=require(_0x5990('0x7'));var util=require(_0x5990('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5990('0x9'));var fs=require('fs');var fs_extra=require(_0x5990('0xa'));var _=require(_0x5990('0xb'));var squel=require('squel');var crypto=require(_0x5990('0xc'));var jsforce=require(_0x5990('0xd'));var deskjs=require(_0x5990('0xe'));var toCsv=require(_0x5990('0xf'));var querystring=require(_0x5990('0x10'));var Papa=require('papaparse');var Redis=require(_0x5990('0x11'));var authService=require(_0x5990('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5990('0x13'))(_0x5990('0x14'));var utils=require('../../config/utils');var config=require(_0x5990('0x15'));var licenseUtil=require(_0x5990('0x16'));var db=require(_0x5990('0x17'))['db'];function respondWithStatusCode(_0x442bb3,_0x4b16ce){_0x4b16ce=_0x4b16ce||0xcc;return function(_0x569316){if(_0x569316){return _0x442bb3['sendStatus'](_0x4b16ce);}return _0x442bb3[_0x5990('0x18')](_0x4b16ce)['end']();};}function respondWithResult(_0x145591,_0x22ebf7){_0x22ebf7=_0x22ebf7||0xc8;return function(_0x304742){if(_0x304742){return _0x145591[_0x5990('0x18')](_0x22ebf7)['json'](_0x304742);}};}function respondWithFilteredResult(_0x1e143f,_0x328922){return function(_0x3d1491){if(_0x3d1491){var _0x427339=typeof _0x328922['offset']===_0x5990('0x19')&&typeof _0x328922[_0x5990('0x1a')]===_0x5990('0x19');var _0x10fce2=_0x3d1491[_0x5990('0x1b')];var _0x19b9fc=_0x427339?0x0:_0x328922['offset'];var _0x29d749=_0x427339?_0x3d1491[_0x5990('0x1b')]:_0x328922[_0x5990('0x1c')]+_0x328922['limit'];var _0xc1c9b;if(_0x29d749>=_0x10fce2){_0x29d749=_0x10fce2;_0xc1c9b=0xc8;}else{_0xc1c9b=0xce;}_0x1e143f['status'](_0xc1c9b);return _0x1e143f[_0x5990('0x1d')]('Content-Range',_0x19b9fc+'-'+_0x29d749+'/'+_0x10fce2)[_0x5990('0x1e')](_0x3d1491);}return null;};}function patchUpdates(_0x5393b9){return function(_0x19c13e){try{jsonpatch[_0x5990('0x1f')](_0x19c13e,_0x5393b9,!![]);}catch(_0x22b618){return BPromise['reject'](_0x22b618);}return _0x19c13e[_0x5990('0x20')]();};}function saveUpdates(_0x653c9d,_0x427631){return function(_0x48cea9){if(_0x48cea9){return _0x48cea9['update'](_0x653c9d)[_0x5990('0x21')](function(_0x1d8dd6){return _0x1d8dd6;});}return null;};}function removeEntity(_0x24564f,_0x4a7962){return function(_0x40c5f3){if(_0x40c5f3){return _0x40c5f3[_0x5990('0x22')]()[_0x5990('0x21')](function(){_0x24564f[_0x5990('0x18')](0xcc)[_0x5990('0x23')]();});}};}function handleEntityNotFound(_0x32125b,_0x1a9bef){return function(_0x321956){if(!_0x321956){_0x32125b['sendStatus'](0x194);}return _0x321956;};}function handleError(_0x1cd6df,_0x2d25ef){_0x2d25ef=_0x2d25ef||0x1f4;return function(_0x3dc31d){logger[_0x5990('0x24')](_0x3dc31d[_0x5990('0x25')]);if(_0x3dc31d[_0x5990('0x26')]){delete _0x3dc31d[_0x5990('0x26')];}_0x1cd6df[_0x5990('0x18')](_0x2d25ef)['send'](_0x3dc31d);};}exports[_0x5990('0x27')]=function(_0x27c2ab,_0x223778){var _0xe7ec9c={},_0x3188a0={},_0x45a2d8={'count':0x0,'rows':[]};var _0x10f82b=_['map'](db[_0x5990('0x28')][_0x5990('0x29')],function(_0x968bc){return{'name':_0x968bc['fieldName'],'type':_0x968bc['type'][_0x5990('0x2a')]};});_0x3188a0['model']=_['map'](_0x10f82b,_0x5990('0x26'));_0x3188a0['query']=_[_0x5990('0x2b')](_0x27c2ab[_0x5990('0x2c')]);_0x3188a0[_0x5990('0x2d')]=_['intersection'](_0x3188a0[_0x5990('0x2e')],_0x3188a0[_0x5990('0x2c')]);_0xe7ec9c[_0x5990('0x2f')]=_[_0x5990('0x30')](_0x3188a0[_0x5990('0x2e')],qs[_0x5990('0x31')](_0x27c2ab[_0x5990('0x2c')][_0x5990('0x31')]));_0xe7ec9c[_0x5990('0x2f')]=_0xe7ec9c[_0x5990('0x2f')][_0x5990('0x32')]?_0xe7ec9c['attributes']:_0x3188a0[_0x5990('0x2e')];if(!_0x27c2ab[_0x5990('0x2c')]['hasOwnProperty'](_0x5990('0x33'))){_0xe7ec9c['limit']=qs[_0x5990('0x1a')](_0x27c2ab[_0x5990('0x2c')][_0x5990('0x1a')]);_0xe7ec9c['offset']=qs[_0x5990('0x1c')](_0x27c2ab[_0x5990('0x2c')][_0x5990('0x1c')]);}_0xe7ec9c[_0x5990('0x34')]=qs[_0x5990('0x35')](_0x27c2ab[_0x5990('0x2c')][_0x5990('0x35')]);_0xe7ec9c[_0x5990('0x36')]=qs['filters'](_[_0x5990('0x37')](_0x27c2ab[_0x5990('0x2c')],_0x3188a0['filters']),_0x10f82b);if(_0x27c2ab[_0x5990('0x2c')][_0x5990('0x38')]){_0xe7ec9c[_0x5990('0x36')]=_['merge'](_0xe7ec9c[_0x5990('0x36')],{'$or':_['map'](_0x10f82b,function(_0x11c920){if(_0x11c920[_0x5990('0x39')]!==_0x5990('0x3a')){var _0xbd2d4={};_0xbd2d4[_0x11c920[_0x5990('0x26')]]={'$like':'%'+_0x27c2ab[_0x5990('0x2c')][_0x5990('0x38')]+'%'};return _0xbd2d4;}})});}_0xe7ec9c=_[_0x5990('0x3b')]({},_0xe7ec9c,_0x27c2ab['options']);var _0x21cf90={'where':_0xe7ec9c['where']};return db['Dynamics365Field'][_0x5990('0x1b')](_0x21cf90)[_0x5990('0x21')](function(_0x5c3c97){_0x45a2d8[_0x5990('0x1b')]=_0x5c3c97;if(_0x27c2ab[_0x5990('0x2c')]['includeAll']){_0xe7ec9c['include']=[{'all':!![]}];}return db[_0x5990('0x28')][_0x5990('0x3c')](_0xe7ec9c);})[_0x5990('0x21')](function(_0x5efc60){_0x45a2d8[_0x5990('0x3d')]=_0x5efc60;return _0x45a2d8;})[_0x5990('0x21')](respondWithFilteredResult(_0x223778,_0xe7ec9c))[_0x5990('0x3e')](handleError(_0x223778,null));};exports[_0x5990('0x3f')]=function(_0x43b895,_0xa05afd){var _0x50a4cc={'raw':!![],'where':{'id':_0x43b895[_0x5990('0x40')]['id']}},_0xb56bd6={};_0xb56bd6[_0x5990('0x2e')]=_[_0x5990('0x2b')](db[_0x5990('0x28')][_0x5990('0x29')]);_0xb56bd6[_0x5990('0x2c')]=_[_0x5990('0x2b')](_0x43b895[_0x5990('0x2c')]);_0xb56bd6[_0x5990('0x2d')]=_['intersection'](_0xb56bd6[_0x5990('0x2e')],_0xb56bd6['query']);_0x50a4cc[_0x5990('0x2f')]=_['intersection'](_0xb56bd6[_0x5990('0x2e')],qs[_0x5990('0x31')](_0x43b895[_0x5990('0x2c')][_0x5990('0x31')]));_0x50a4cc[_0x5990('0x2f')]=_0x50a4cc[_0x5990('0x2f')]['length']?_0x50a4cc[_0x5990('0x2f')]:_0xb56bd6[_0x5990('0x2e')];if(_0x43b895['query']['includeAll']){_0x50a4cc['include']=[{'all':!![]}];}_0x50a4cc=_[_0x5990('0x3b')]({},_0x50a4cc,_0x43b895[_0x5990('0x41')]);return db['Dynamics365Field']['find'](_0x50a4cc)[_0x5990('0x21')](handleEntityNotFound(_0xa05afd,null))[_0x5990('0x21')](respondWithResult(_0xa05afd,null))[_0x5990('0x3e')](handleError(_0xa05afd,null));};exports[_0x5990('0x42')]=function(_0x52df62,_0x556360){return db[_0x5990('0x28')]['create'](_0x52df62[_0x5990('0x43')],{})[_0x5990('0x21')](respondWithResult(_0x556360,0xc9))[_0x5990('0x3e')](handleError(_0x556360,null));};exports[_0x5990('0x44')]=function(_0x4c6c28,_0x373c5c){if(_0x4c6c28[_0x5990('0x43')]['id']){delete _0x4c6c28[_0x5990('0x43')]['id'];}return db['Dynamics365Field']['find']({'where':{'id':_0x4c6c28[_0x5990('0x40')]['id']}})['then'](handleEntityNotFound(_0x373c5c,null))[_0x5990('0x21')](saveUpdates(_0x4c6c28[_0x5990('0x43')],null))[_0x5990('0x21')](respondWithResult(_0x373c5c,null))['catch'](handleError(_0x373c5c,null));};exports[_0x5990('0x22')]=function(_0x316a69,_0x8281dd){return db[_0x5990('0x28')]['find']({'where':{'id':_0x316a69['params']['id']}})[_0x5990('0x21')](handleEntityNotFound(_0x8281dd,null))[_0x5990('0x21')](removeEntity(_0x8281dd,null))[_0x5990('0x3e')](handleError(_0x8281dd,null));}; \ No newline at end of file +var _0x4b44=['fieldName','type','key','query','intersection','attributes','model','fields','length','hasOwnProperty','sort','filters','pick','filter','merge','where','VIRTUAL','options','Dynamics365Field','findAll','rows','catch','params','keys','includeAll','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map'];(function(_0x1cab6a,_0xbeed47){var _0x47e382=function(_0x21128d){while(--_0x21128d){_0x1cab6a['push'](_0x1cab6a['shift']());}};_0x47e382(++_0xbeed47);}(_0x4b44,0xb1));var _0x44b4=function(_0x4463e6,_0x3a30ad){_0x4463e6=_0x4463e6-0x0;var _0x57d128=_0x4b44[_0x4463e6];return _0x57d128;};'use strict';var emlformat=require(_0x44b4('0x0'));var rimraf=require(_0x44b4('0x1'));var zipdir=require(_0x44b4('0x2'));var jsonpatch=require(_0x44b4('0x3'));var rp=require(_0x44b4('0x4'));var moment=require('moment');var BPromise=require(_0x44b4('0x5'));var Mustache=require('mustache');var util=require(_0x44b4('0x6'));var path=require(_0x44b4('0x7'));var sox=require(_0x44b4('0x8'));var csv=require(_0x44b4('0x9'));var ejs=require(_0x44b4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x44b4('0xb'));var squel=require(_0x44b4('0xc'));var crypto=require(_0x44b4('0xd'));var jsforce=require(_0x44b4('0xe'));var deskjs=require(_0x44b4('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x44b4('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x44b4('0x11'));var as=require(_0x44b4('0x12'));var hardwareService=require(_0x44b4('0x13'));var logger=require(_0x44b4('0x14'))(_0x44b4('0x15'));var utils=require(_0x44b4('0x16'));var config=require(_0x44b4('0x17'));var licenseUtil=require(_0x44b4('0x18'));var db=require(_0x44b4('0x19'))['db'];function respondWithStatusCode(_0x2542c1,_0x500bbb){_0x500bbb=_0x500bbb||0xcc;return function(_0x4aaa5e){if(_0x4aaa5e){return _0x2542c1[_0x44b4('0x1a')](_0x500bbb);}return _0x2542c1['status'](_0x500bbb)[_0x44b4('0x1b')]();};}function respondWithResult(_0x5ed898,_0x1e8b02){_0x1e8b02=_0x1e8b02||0xc8;return function(_0x4e6d32){if(_0x4e6d32){return _0x5ed898[_0x44b4('0x1c')](_0x1e8b02)[_0x44b4('0x1d')](_0x4e6d32);}};}function respondWithFilteredResult(_0x1e7c9f,_0x275f02){return function(_0x208f20){if(_0x208f20){var _0x594e28=typeof _0x275f02[_0x44b4('0x1e')]===_0x44b4('0x1f')&&typeof _0x275f02['limit']===_0x44b4('0x1f');var _0x5f4d5f=_0x208f20[_0x44b4('0x20')];var _0x10eff0=_0x594e28?0x0:_0x275f02[_0x44b4('0x1e')];var _0x2e6eeb=_0x594e28?_0x208f20[_0x44b4('0x20')]:_0x275f02['offset']+_0x275f02[_0x44b4('0x21')];var _0x19360b;if(_0x2e6eeb>=_0x5f4d5f){_0x2e6eeb=_0x5f4d5f;_0x19360b=0xc8;}else{_0x19360b=0xce;}_0x1e7c9f[_0x44b4('0x1c')](_0x19360b);return _0x1e7c9f['set'](_0x44b4('0x22'),_0x10eff0+'-'+_0x2e6eeb+'/'+_0x5f4d5f)[_0x44b4('0x1d')](_0x208f20);}return null;};}function patchUpdates(_0xfcf374){return function(_0x2805d2){try{jsonpatch[_0x44b4('0x23')](_0x2805d2,_0xfcf374,!![]);}catch(_0x409990){return BPromise[_0x44b4('0x24')](_0x409990);}return _0x2805d2['save']();};}function saveUpdates(_0xda2af0,_0x28f975){return function(_0x5635d7){if(_0x5635d7){return _0x5635d7[_0x44b4('0x25')](_0xda2af0)[_0x44b4('0x26')](function(_0x1dd2aa){return _0x1dd2aa;});}return null;};}function removeEntity(_0x4641f1,_0xcb86c4){return function(_0x54419d){if(_0x54419d){return _0x54419d[_0x44b4('0x27')]()['then'](function(){_0x4641f1[_0x44b4('0x1c')](0xcc)[_0x44b4('0x1b')]();});}};}function handleEntityNotFound(_0x9efcd2,_0x24affc){return function(_0x4b340c){if(!_0x4b340c){_0x9efcd2['sendStatus'](0x194);}return _0x4b340c;};}function handleError(_0x5264b9,_0x348656){_0x348656=_0x348656||0x1f4;return function(_0x5cc497){logger[_0x44b4('0x28')](_0x5cc497[_0x44b4('0x29')]);if(_0x5cc497['name']){delete _0x5cc497[_0x44b4('0x2a')];}_0x5264b9[_0x44b4('0x1c')](_0x348656)[_0x44b4('0x2b')](_0x5cc497);};}exports['index']=function(_0xa5630c,_0x2eef7a){var _0x4fb34b={},_0xd0e21d={},_0x4a11da={'count':0x0,'rows':[]};var _0x8e89a0=_[_0x44b4('0x2c')](db['Dynamics365Field']['rawAttributes'],function(_0x9da1cf){return{'name':_0x9da1cf[_0x44b4('0x2d')],'type':_0x9da1cf[_0x44b4('0x2e')][_0x44b4('0x2f')]};});_0xd0e21d['model']=_['map'](_0x8e89a0,_0x44b4('0x2a'));_0xd0e21d[_0x44b4('0x30')]=_['keys'](_0xa5630c[_0x44b4('0x30')]);_0xd0e21d['filters']=_[_0x44b4('0x31')](_0xd0e21d['model'],_0xd0e21d[_0x44b4('0x30')]);_0x4fb34b[_0x44b4('0x32')]=_['intersection'](_0xd0e21d[_0x44b4('0x33')],qs[_0x44b4('0x34')](_0xa5630c['query'][_0x44b4('0x34')]));_0x4fb34b[_0x44b4('0x32')]=_0x4fb34b[_0x44b4('0x32')][_0x44b4('0x35')]?_0x4fb34b[_0x44b4('0x32')]:_0xd0e21d['model'];if(!_0xa5630c['query'][_0x44b4('0x36')]('nolimit')){_0x4fb34b[_0x44b4('0x21')]=qs[_0x44b4('0x21')](_0xa5630c[_0x44b4('0x30')][_0x44b4('0x21')]);_0x4fb34b[_0x44b4('0x1e')]=qs[_0x44b4('0x1e')](_0xa5630c[_0x44b4('0x30')][_0x44b4('0x1e')]);}_0x4fb34b['order']=qs[_0x44b4('0x37')](_0xa5630c[_0x44b4('0x30')][_0x44b4('0x37')]);_0x4fb34b['where']=qs[_0x44b4('0x38')](_[_0x44b4('0x39')](_0xa5630c[_0x44b4('0x30')],_0xd0e21d[_0x44b4('0x38')]),_0x8e89a0);if(_0xa5630c[_0x44b4('0x30')][_0x44b4('0x3a')]){_0x4fb34b['where']=_[_0x44b4('0x3b')](_0x4fb34b[_0x44b4('0x3c')],{'$or':_[_0x44b4('0x2c')](_0x8e89a0,function(_0x28388b){if(_0x28388b[_0x44b4('0x2e')]!==_0x44b4('0x3d')){var _0x53f9ea={};_0x53f9ea[_0x28388b['name']]={'$like':'%'+_0xa5630c['query']['filter']+'%'};return _0x53f9ea;}})});}_0x4fb34b=_[_0x44b4('0x3b')]({},_0x4fb34b,_0xa5630c[_0x44b4('0x3e')]);var _0x375cb1={'where':_0x4fb34b[_0x44b4('0x3c')]};return db[_0x44b4('0x3f')][_0x44b4('0x20')](_0x375cb1)[_0x44b4('0x26')](function(_0x11fc17){_0x4a11da[_0x44b4('0x20')]=_0x11fc17;if(_0xa5630c[_0x44b4('0x30')]['includeAll']){_0x4fb34b['include']=[{'all':!![]}];}return db[_0x44b4('0x3f')][_0x44b4('0x40')](_0x4fb34b);})[_0x44b4('0x26')](function(_0x46fe1f){_0x4a11da[_0x44b4('0x41')]=_0x46fe1f;return _0x4a11da;})[_0x44b4('0x26')](respondWithFilteredResult(_0x2eef7a,_0x4fb34b))[_0x44b4('0x42')](handleError(_0x2eef7a,null));};exports['show']=function(_0x5c97b0,_0x272318){var _0xce18f1={'raw':!![],'where':{'id':_0x5c97b0[_0x44b4('0x43')]['id']}},_0x42969f={};_0x42969f[_0x44b4('0x33')]=_[_0x44b4('0x44')](db[_0x44b4('0x3f')]['rawAttributes']);_0x42969f[_0x44b4('0x30')]=_['keys'](_0x5c97b0[_0x44b4('0x30')]);_0x42969f[_0x44b4('0x38')]=_[_0x44b4('0x31')](_0x42969f[_0x44b4('0x33')],_0x42969f[_0x44b4('0x30')]);_0xce18f1[_0x44b4('0x32')]=_[_0x44b4('0x31')](_0x42969f['model'],qs['fields'](_0x5c97b0['query'][_0x44b4('0x34')]));_0xce18f1[_0x44b4('0x32')]=_0xce18f1[_0x44b4('0x32')][_0x44b4('0x35')]?_0xce18f1[_0x44b4('0x32')]:_0x42969f[_0x44b4('0x33')];if(_0x5c97b0[_0x44b4('0x30')][_0x44b4('0x45')]){_0xce18f1[_0x44b4('0x46')]=[{'all':!![]}];}_0xce18f1=_[_0x44b4('0x3b')]({},_0xce18f1,_0x5c97b0[_0x44b4('0x3e')]);return db[_0x44b4('0x3f')][_0x44b4('0x47')](_0xce18f1)[_0x44b4('0x26')](handleEntityNotFound(_0x272318,null))[_0x44b4('0x26')](respondWithResult(_0x272318,null))[_0x44b4('0x42')](handleError(_0x272318,null));};exports[_0x44b4('0x48')]=function(_0x109877,_0x4f684f){return db[_0x44b4('0x3f')][_0x44b4('0x48')](_0x109877[_0x44b4('0x49')],{})[_0x44b4('0x26')](respondWithResult(_0x4f684f,0xc9))['catch'](handleError(_0x4f684f,null));};exports[_0x44b4('0x25')]=function(_0x3414a1,_0xb8d883){if(_0x3414a1[_0x44b4('0x49')]['id']){delete _0x3414a1['body']['id'];}return db[_0x44b4('0x3f')][_0x44b4('0x47')]({'where':{'id':_0x3414a1['params']['id']}})[_0x44b4('0x26')](handleEntityNotFound(_0xb8d883,null))['then'](saveUpdates(_0x3414a1[_0x44b4('0x49')],null))[_0x44b4('0x26')](respondWithResult(_0xb8d883,null))['catch'](handleError(_0xb8d883,null));};exports[_0x44b4('0x27')]=function(_0x2bdac1,_0x5d2db9){return db[_0x44b4('0x3f')]['find']({'where':{'id':_0x2bdac1[_0x44b4('0x43')]['id']}})[_0x44b4('0x26')](handleEntityNotFound(_0x5d2db9,null))[_0x44b4('0x26')](removeEntity(_0x5d2db9,null))[_0x44b4('0x42')](handleError(_0x5d2db9,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 6e76b5a..c110e8e 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 _0x5045=['idField','FieldId','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','int_dynamics365_fields'];(function(_0x173324,_0x1e0bb3){var _0x24787b=function(_0x5d6168){while(--_0x5d6168){_0x173324['push'](_0x173324['shift']());}};_0x24787b(++_0x1e0bb3);}(_0x5045,0x9e));var _0x5504=function(_0x2e0a99,_0x1297c3){_0x2e0a99=_0x2e0a99-0x0;var _0x599fae=_0x5045[_0x2e0a99];return _0x599fae;};'use strict';var _=require(_0x5504('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5504('0x1'));var moment=require(_0x5504('0x2'));var BPromise=require('bluebird');var rp=require(_0x5504('0x3'));var fs=require('fs');var path=require(_0x5504('0x4'));var rimraf=require(_0x5504('0x5'));var config=require(_0x5504('0x6'));var attributes=require(_0x5504('0x7'));module[_0x5504('0x8')]=function(_0x40c87a,_0x52e5bc){return _0x40c87a[_0x5504('0x9')]('Dynamics365Field',attributes,{'tableName':_0x5504('0xa'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x5504('0xb'),_0x5504('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x456a=['Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define'];(function(_0x56132e,_0x4c7c32){var _0x52c2c9=function(_0x53f152){while(--_0x53f152){_0x56132e['push'](_0x56132e['shift']());}};_0x52c2c9(++_0x4c7c32);}(_0x456a,0x8d));var _0xa456=function(_0x4e4bbf,_0x47a29b){_0x4e4bbf=_0x4e4bbf-0x0;var _0x412ae4=_0x456a[_0x4e4bbf];return _0x412ae4;};'use strict';var _=require(_0xa456('0x0'));var util=require('util');var logger=require(_0xa456('0x1'))(_0xa456('0x2'));var moment=require(_0xa456('0x3'));var BPromise=require(_0xa456('0x4'));var rp=require(_0xa456('0x5'));var fs=require('fs');var path=require(_0xa456('0x6'));var rimraf=require(_0xa456('0x7'));var config=require(_0xa456('0x8'));var attributes=require(_0xa456('0x9'));module[_0xa456('0xa')]=function(_0xd45574,_0x14a675){return _0xd45574[_0xa456('0xb')](_0xa456('0xc'),attributes,{'tableName':_0xa456('0xd'),'paranoid':![],'indexes':[{'name':_0xa456('0xe'),'fields':[_0xa456('0xf'),_0xa456('0x10')],'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 e7856c4..7e14f08 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 _0xc470=['code','message','info','request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','Dynamics365Field,\x20%s,\x20%s','debug','stringify','error'];(function(_0x5d66ce,_0xb8ede4){var _0x4aa6da=function(_0x3a4734){while(--_0x3a4734){_0x5d66ce['push'](_0x5d66ce['shift']());}};_0x4aa6da(++_0xb8ede4);}(_0xc470,0x148));var _0x0c47=function(_0x5d7463,_0x3dbc4a){_0x5d7463=_0x5d7463-0x0;var _0x316d29=_0xc470[_0x5d7463];return _0x316d29;};'use strict';var _=require(_0x0c47('0x0'));var util=require(_0x0c47('0x1'));var moment=require(_0x0c47('0x2'));var BPromise=require(_0x0c47('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0c47('0x4'));var db=require(_0x0c47('0x5'))['db'];var utils=require(_0x0c47('0x6'));var logger=require(_0x0c47('0x7'))(_0x0c47('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0c47('0x9')][_0x0c47('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x839ae1,_0x4eae2d,_0x181e31){return new BPromise(function(_0x2c1790,_0x55720c){return client[_0x0c47('0xb')](_0x839ae1,_0x181e31)[_0x0c47('0xc')](function(_0x217049){logger['info'](_0x0c47('0xd'),_0x4eae2d,'request\x20sent');logger[_0x0c47('0xe')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x4eae2d,'request\x20sent',JSON[_0x0c47('0xf')](_0x217049));if(_0x217049[_0x0c47('0x10')]){if(_0x217049[_0x0c47('0x10')][_0x0c47('0x11')]===0x1f4){logger['error'](_0x0c47('0xd'),_0x4eae2d,_0x217049[_0x0c47('0x10')][_0x0c47('0x12')]);return _0x55720c(_0x217049['error']['message']);}logger[_0x0c47('0x10')](_0x0c47('0xd'),_0x4eae2d,_0x217049[_0x0c47('0x10')][_0x0c47('0x12')]);return _0x2c1790(_0x217049[_0x0c47('0x10')][_0x0c47('0x12')]);}else{logger[_0x0c47('0x13')](_0x0c47('0xd'),_0x4eae2d,_0x0c47('0x14'));_0x2c1790(_0x217049[_0x0c47('0x15')][_0x0c47('0x12')]);}})[_0x0c47('0x16')](function(_0x2f6b62){logger[_0x0c47('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x4eae2d,_0x2f6b62);_0x55720c(_0x2f6b62);});});} \ No newline at end of file +var _0x1d48=['Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x1d48,0xd7));var _0x81d4=function(_0x47b58d,_0x42c4b0){_0x47b58d=_0x47b58d-0x0;var _0x2b7c11=_0x1d48[_0x47b58d];return _0x2b7c11;};'use strict';var _=require(_0x81d4('0x0'));var util=require(_0x81d4('0x1'));var moment=require(_0x81d4('0x2'));var BPromise=require(_0x81d4('0x3'));var rs=require(_0x81d4('0x4'));var fs=require('fs');var Redis=require(_0x81d4('0x5'));var db=require(_0x81d4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x81d4('0x7'))(_0x81d4('0x8'));var config=require(_0x81d4('0x9'));var jayson=require(_0x81d4('0xa'));var client=jayson[_0x81d4('0xb')][_0x81d4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x34350d,_0x629b62,_0x4e3494){return new BPromise(function(_0x3cefa9,_0x537984){return client[_0x81d4('0xd')](_0x34350d,_0x4e3494)[_0x81d4('0xe')](function(_0x937cec){logger['info'](_0x81d4('0xf'),_0x629b62,_0x81d4('0x10'));logger['debug'](_0x81d4('0x11'),_0x629b62,_0x81d4('0x10'),JSON[_0x81d4('0x12')](_0x937cec));if(_0x937cec['error']){if(_0x937cec[_0x81d4('0x13')]['code']===0x1f4){logger[_0x81d4('0x13')](_0x81d4('0xf'),_0x629b62,_0x937cec[_0x81d4('0x13')][_0x81d4('0x14')]);return _0x537984(_0x937cec[_0x81d4('0x13')][_0x81d4('0x14')]);}logger[_0x81d4('0x13')](_0x81d4('0xf'),_0x629b62,_0x937cec[_0x81d4('0x13')][_0x81d4('0x14')]);return _0x3cefa9(_0x937cec[_0x81d4('0x13')][_0x81d4('0x14')]);}else{logger['info'](_0x81d4('0xf'),_0x629b62,_0x81d4('0x10'));_0x3cefa9(_0x937cec[_0x81d4('0x15')]['message']);}})[_0x81d4('0x16')](function(_0x2b1259){logger[_0x81d4('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x629b62,_0x2b1259);_0x537984(_0x2b1259);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 8ea7569..bfacd2d 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 _0x7397=['/:id','show','/:id/configurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x480f3c,_0x160e0f){var _0x84201b=function(_0x1cb91a){while(--_0x1cb91a){_0x480f3c['push'](_0x480f3c['shift']());}};_0x84201b(++_0x160e0f);}(_0x7397,0xe4));var _0x7739=function(_0x1ab5c6,_0x2a95a7){_0x1ab5c6=_0x1ab5c6-0x0;var _0x150316=_0x7397[_0x1ab5c6];return _0x150316;};'use strict';var multer=require(_0x7739('0x0'));var util=require(_0x7739('0x1'));var path=require(_0x7739('0x2'));var timeout=require('connect-timeout');var express=require(_0x7739('0x3'));var router=express[_0x7739('0x4')]();var fs_extra=require(_0x7739('0x5'));var auth=require(_0x7739('0x6'));var interaction=require(_0x7739('0x7'));var config=require(_0x7739('0x8'));var controller=require('./intFreshdeskAccount.controller');router[_0x7739('0x9')]('/',auth[_0x7739('0xa')](),controller[_0x7739('0xb')]);router[_0x7739('0x9')](_0x7739('0xc'),auth[_0x7739('0xa')](),controller[_0x7739('0xd')]);router[_0x7739('0x9')](_0x7739('0xe'),auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0x7739('0xf'),auth['isAuthenticated'](),controller[_0x7739('0x10')]);router[_0x7739('0x11')]('/',auth[_0x7739('0xa')](),controller['create']);router[_0x7739('0x11')](_0x7739('0xe'),auth[_0x7739('0xa')](),controller[_0x7739('0x12')]);router[_0x7739('0x13')](_0x7739('0xc'),auth[_0x7739('0xa')](),controller[_0x7739('0x14')]);router[_0x7739('0x15')]('/:id',auth[_0x7739('0xa')](),controller[_0x7739('0x16')]);module[_0x7739('0x17')]=router; \ No newline at end of file +var _0xe88a=['connect-timeout','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','put','update','delete','destroy','multer','path'];(function(_0x55821d,_0x27a22e){var _0x58ea8a=function(_0x5bdd3d){while(--_0x5bdd3d){_0x55821d['push'](_0x55821d['shift']());}};_0x58ea8a(++_0x27a22e);}(_0xe88a,0x1b3));var _0xae88=function(_0x351539,_0x1fc580){_0x351539=_0x351539-0x0;var _0x232553=_0xe88a[_0x351539];return _0x232553;};'use strict';var multer=require(_0xae88('0x0'));var util=require('util');var path=require(_0xae88('0x1'));var timeout=require(_0xae88('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xae88('0x3'));var auth=require(_0xae88('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xae88('0x5'));var controller=require('./intFreshdeskAccount.controller');router[_0xae88('0x6')]('/',auth[_0xae88('0x7')](),controller[_0xae88('0x8')]);router['get'](_0xae88('0x9'),auth['isAuthenticated'](),controller[_0xae88('0xa')]);router[_0xae88('0x6')](_0xae88('0xb'),auth[_0xae88('0x7')](),controller['getConfigurations']);router[_0xae88('0x6')](_0xae88('0xc'),auth[_0xae88('0x7')](),controller[_0xae88('0xd')]);router[_0xae88('0xe')]('/',auth[_0xae88('0x7')](),controller['create']);router[_0xae88('0xe')](_0xae88('0xb'),auth[_0xae88('0x7')](),controller['addConfiguration']);router[_0xae88('0xf')]('/:id',auth[_0xae88('0x7')](),controller[_0xae88('0x10')]);router[_0xae88('0x11')](_0xae88('0x9'),auth['isAuthenticated'](),controller[_0xae88('0x12')]);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 c35b092..bebc5c7 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 _0x2272=['sequelize','exports','STRING','remoteUri'];(function(_0x210b46,_0x52a05f){var _0x203df2=function(_0x3421ea){while(--_0x3421ea){_0x210b46['push'](_0x210b46['shift']());}};_0x203df2(++_0x52a05f);}(_0x2272,0xd8));var _0x2227=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2272[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x2227('0x0'));module[_0x2227('0x1')]={'name':{'type':Sequelize[_0x2227('0x2')]},'description':{'type':Sequelize[_0x2227('0x2')]},'username':{'type':Sequelize[_0x2227('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x2227('0x2')]},'remoteUri':{'type':Sequelize[_0x2227('0x2')],'unique':_0x2227('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x7708=['sequelize','exports','STRING','remoteUri'];(function(_0x3b90eb,_0x22666b){var _0x4c4d31=function(_0x1b6d5e){while(--_0x1b6d5e){_0x3b90eb['push'](_0x3b90eb['shift']());}};_0x4c4d31(++_0x22666b);}(_0x7708,0x188));var _0x8770=function(_0xaf29da,_0x117f5a){_0xaf29da=_0xaf29da-0x0;var _0x295c51=_0x7708[_0xaf29da];return _0x295c51;};'use strict';var Sequelize=require(_0x8770('0x0'));module[_0x8770('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8770('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x8770('0x3')},'serverUrl':{'type':Sequelize[_0x8770('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 489918d..6be4597 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 _0x0439=['moment','bluebird','util','path','sox','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','sendStatus','stack','name','index','map','FreshdeskAccount','fieldName','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','options','includeAll','show','params','rawAttributes','length','include','find','catch','create','body','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','FreshdeskField','Descriptions','getFields','remoteUri','substring','lastIndexOf','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','apiKey','toString','requester','agent','description','priority','group','source','ticket_type','remove','includes','default','custom_text','custom_dropdown','label','choices','test','error','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x0439,0xdd));var _0x9043=function(_0x5a361d,_0x259dfc){_0x5a361d=_0x5a361d-0x0;var _0x24a315=_0x0439[_0x5a361d];return _0x24a315;};'use strict';var emlformat=require(_0x9043('0x0'));var rimraf=require(_0x9043('0x1'));var zipdir=require(_0x9043('0x2'));var jsonpatch=require(_0x9043('0x3'));var rp=require(_0x9043('0x4'));var moment=require(_0x9043('0x5'));var BPromise=require(_0x9043('0x6'));var Mustache=require('mustache');var util=require(_0x9043('0x7'));var path=require(_0x9043('0x8'));var sox=require(_0x9043('0x9'));var csv=require('to-csv');var ejs=require(_0x9043('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9043('0xb'));var crypto=require(_0x9043('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9043('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9043('0xe'));var Papa=require(_0x9043('0xf'));var Redis=require('ioredis');var authService=require(_0x9043('0x10'));var qs=require(_0x9043('0x11'));var as=require(_0x9043('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9043('0x13'));var utils=require(_0x9043('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9043('0x15'));var db=require(_0x9043('0x16'))['db'];var integrations=require(_0x9043('0x17'));function respondWithStatusCode(_0x2bf58d,_0xcd2bf1){_0xcd2bf1=_0xcd2bf1||0xcc;return function(_0x39941f){if(_0x39941f){return _0x2bf58d['sendStatus'](_0xcd2bf1);}return _0x2bf58d[_0x9043('0x18')](_0xcd2bf1)[_0x9043('0x19')]();};}function respondWithResult(_0x48b142,_0x18f916){_0x18f916=_0x18f916||0xc8;return function(_0xe65772){if(_0xe65772){return _0x48b142['status'](_0x18f916)[_0x9043('0x1a')](_0xe65772);}};}function respondWithFilteredResult(_0x1c2473,_0x3aaee1){return function(_0x2b3c2d){if(_0x2b3c2d){var _0x1691e9=typeof _0x3aaee1[_0x9043('0x1b')]===_0x9043('0x1c')&&typeof _0x3aaee1[_0x9043('0x1d')]===_0x9043('0x1c');var _0x1700aa=_0x2b3c2d['count'];var _0x584fd9=_0x1691e9?0x0:_0x3aaee1['offset'];var _0x2612f8=_0x1691e9?_0x2b3c2d[_0x9043('0x1e')]:_0x3aaee1[_0x9043('0x1b')]+_0x3aaee1[_0x9043('0x1d')];var _0x5a5a15;if(_0x2612f8>=_0x1700aa){_0x2612f8=_0x1700aa;_0x5a5a15=0xc8;}else{_0x5a5a15=0xce;}_0x1c2473[_0x9043('0x18')](_0x5a5a15);return _0x1c2473['set']('Content-Range',_0x584fd9+'-'+_0x2612f8+'/'+_0x1700aa)[_0x9043('0x1a')](_0x2b3c2d);}return null;};}function patchUpdates(_0x3572d5){return function(_0x180c66){try{jsonpatch[_0x9043('0x1f')](_0x180c66,_0x3572d5,!![]);}catch(_0x427067){return BPromise[_0x9043('0x20')](_0x427067);}return _0x180c66[_0x9043('0x21')]();};}function saveUpdates(_0x366695,_0x5a3f7a){return function(_0x187ad5){if(_0x187ad5){return _0x187ad5[_0x9043('0x22')](_0x366695)[_0x9043('0x23')](function(_0x5506bf){return _0x5506bf;});}return null;};}function removeEntity(_0x18727f,_0x3c4fa4){return function(_0x214038){if(_0x214038){return _0x214038[_0x9043('0x24')]()[_0x9043('0x23')](function(){_0x18727f['status'](0xcc)[_0x9043('0x19')]();});}};}function handleEntityNotFound(_0xca0bb1,_0x6d23af){return function(_0x342d5e){if(!_0x342d5e){_0xca0bb1[_0x9043('0x25')](0x194);}return _0x342d5e;};}function handleError(_0x13e8dd,_0x5f4975){_0x5f4975=_0x5f4975||0x1f4;return function(_0x25128c){logger['error'](_0x25128c[_0x9043('0x26')]);if(_0x25128c[_0x9043('0x27')]){delete _0x25128c[_0x9043('0x27')];}_0x13e8dd[_0x9043('0x18')](_0x5f4975)['send'](_0x25128c);};}exports[_0x9043('0x28')]=function(_0x2e12b1,_0x14cf80){var _0x228d7f={},_0x37ecc2={},_0x590357={'count':0x0,'rows':[]};var _0x352934=_[_0x9043('0x29')](db[_0x9043('0x2a')]['rawAttributes'],function(_0x37ebc2){return{'name':_0x37ebc2[_0x9043('0x2b')],'type':_0x37ebc2['type'][_0x9043('0x2c')]};});_0x37ecc2[_0x9043('0x2d')]=_['map'](_0x352934,_0x9043('0x27'));_0x37ecc2[_0x9043('0x2e')]=_[_0x9043('0x2f')](_0x2e12b1[_0x9043('0x2e')]);_0x37ecc2['filters']=_[_0x9043('0x30')](_0x37ecc2[_0x9043('0x2d')],_0x37ecc2['query']);_0x228d7f['attributes']=_[_0x9043('0x30')](_0x37ecc2[_0x9043('0x2d')],qs[_0x9043('0x31')](_0x2e12b1[_0x9043('0x2e')][_0x9043('0x31')]));_0x228d7f[_0x9043('0x32')]=_0x228d7f['attributes']['length']?_0x228d7f[_0x9043('0x32')]:_0x37ecc2[_0x9043('0x2d')];if(!_0x2e12b1[_0x9043('0x2e')][_0x9043('0x33')](_0x9043('0x34'))){_0x228d7f[_0x9043('0x1d')]=qs[_0x9043('0x1d')](_0x2e12b1['query'][_0x9043('0x1d')]);_0x228d7f['offset']=qs[_0x9043('0x1b')](_0x2e12b1['query'][_0x9043('0x1b')]);}_0x228d7f[_0x9043('0x35')]=qs['sort'](_0x2e12b1['query'][_0x9043('0x36')]);_0x228d7f[_0x9043('0x37')]=qs[_0x9043('0x38')](_[_0x9043('0x39')](_0x2e12b1[_0x9043('0x2e')],_0x37ecc2[_0x9043('0x38')]),_0x352934);if(_0x2e12b1[_0x9043('0x2e')][_0x9043('0x3a')]){_0x228d7f[_0x9043('0x37')]=_[_0x9043('0x3b')](_0x228d7f[_0x9043('0x37')],{'$or':_[_0x9043('0x29')](_0x352934,function(_0x4a0f7b){if(_0x4a0f7b[_0x9043('0x3c')]!=='VIRTUAL'){var _0x2cc232={};_0x2cc232[_0x4a0f7b[_0x9043('0x27')]]={'$like':'%'+_0x2e12b1['query'][_0x9043('0x3a')]+'%'};return _0x2cc232;}})});}_0x228d7f=_[_0x9043('0x3b')]({},_0x228d7f,_0x2e12b1[_0x9043('0x3d')]);var _0x4ae0a5={'where':_0x228d7f[_0x9043('0x37')]};return db[_0x9043('0x2a')][_0x9043('0x1e')](_0x4ae0a5)[_0x9043('0x23')](function(_0x28415c){_0x590357[_0x9043('0x1e')]=_0x28415c;if(_0x2e12b1[_0x9043('0x2e')][_0x9043('0x3e')]){_0x228d7f['include']=[{'all':!![]}];}return db[_0x9043('0x2a')]['findAll'](_0x228d7f);})['then'](function(_0x74f17d){_0x590357['rows']=_0x74f17d;return _0x590357;})[_0x9043('0x23')](respondWithFilteredResult(_0x14cf80,_0x228d7f))['catch'](handleError(_0x14cf80,null));};exports[_0x9043('0x3f')]=function(_0x3a75e0,_0x2c479d){var _0x38028b={'raw':![],'where':{'id':_0x3a75e0[_0x9043('0x40')]['id']}},_0x38ea9e={};_0x38ea9e['model']=_[_0x9043('0x2f')](db[_0x9043('0x2a')][_0x9043('0x41')]);_0x38ea9e['query']=_[_0x9043('0x2f')](_0x3a75e0[_0x9043('0x2e')]);_0x38ea9e['filters']=_[_0x9043('0x30')](_0x38ea9e['model'],_0x38ea9e[_0x9043('0x2e')]);_0x38028b[_0x9043('0x32')]=_['intersection'](_0x38ea9e['model'],qs[_0x9043('0x31')](_0x3a75e0[_0x9043('0x2e')][_0x9043('0x31')]));_0x38028b[_0x9043('0x32')]=_0x38028b['attributes'][_0x9043('0x42')]?_0x38028b[_0x9043('0x32')]:_0x38ea9e['model'];if(_0x3a75e0['query'][_0x9043('0x3e')]){_0x38028b[_0x9043('0x43')]=[{'all':!![]}];}_0x38028b=_['merge']({},_0x38028b,_0x3a75e0[_0x9043('0x3d')]);return db[_0x9043('0x2a')][_0x9043('0x44')](_0x38028b)[_0x9043('0x23')](handleEntityNotFound(_0x2c479d,null))['then'](respondWithResult(_0x2c479d,null))[_0x9043('0x45')](handleError(_0x2c479d,null));};exports[_0x9043('0x46')]=function(_0x5d7e24,_0x4c02e7){return db[_0x9043('0x2a')][_0x9043('0x46')](_0x5d7e24[_0x9043('0x47')],{})[_0x9043('0x23')](respondWithResult(_0x4c02e7,0xc9))[_0x9043('0x45')](handleError(_0x4c02e7,null));};exports[_0x9043('0x22')]=function(_0x370821,_0x3d7c69){if(_0x370821[_0x9043('0x47')]['id']){delete _0x370821[_0x9043('0x47')]['id'];}return db[_0x9043('0x2a')][_0x9043('0x44')]({'where':{'id':_0x370821[_0x9043('0x40')]['id']}})['then'](handleEntityNotFound(_0x3d7c69,null))[_0x9043('0x23')](saveUpdates(_0x370821[_0x9043('0x47')],null))['then'](respondWithResult(_0x3d7c69,null))[_0x9043('0x45')](handleError(_0x3d7c69,null));};exports[_0x9043('0x24')]=function(_0x385fb6,_0x4bded2){return db['FreshdeskAccount'][_0x9043('0x44')]({'where':{'id':_0x385fb6[_0x9043('0x40')]['id']}})[_0x9043('0x23')](handleEntityNotFound(_0x4bded2,null))[_0x9043('0x23')](removeEntity(_0x4bded2,null))['catch'](handleError(_0x4bded2,null));};exports[_0x9043('0x48')]=function(_0x425205,_0x185298,_0x592b04){var _0x554771={};var _0x333e7e={};var _0x4b9470;var _0x599e17;return db[_0x9043('0x2a')][_0x9043('0x49')]({'where':{'id':_0x425205[_0x9043('0x40')]['id']}})[_0x9043('0x23')](handleEntityNotFound(_0x185298,null))[_0x9043('0x23')](function(_0x3736b5){if(_0x3736b5){_0x4b9470=_0x3736b5;_0x333e7e[_0x9043('0x2d')]=_[_0x9043('0x2f')](db[_0x9043('0x4a')][_0x9043('0x41')]);_0x333e7e[_0x9043('0x2e')]=_[_0x9043('0x2f')](_0x425205[_0x9043('0x2e')]);_0x333e7e[_0x9043('0x38')]=_[_0x9043('0x30')](_0x333e7e['model'],_0x333e7e['query']);_0x554771[_0x9043('0x32')]=_[_0x9043('0x30')](_0x333e7e['model'],qs[_0x9043('0x31')](_0x425205['query'][_0x9043('0x31')]));_0x554771[_0x9043('0x32')]=_0x554771[_0x9043('0x32')][_0x9043('0x42')]?_0x554771[_0x9043('0x32')]:_0x333e7e[_0x9043('0x2d')];_0x554771[_0x9043('0x35')]=qs[_0x9043('0x36')](_0x425205[_0x9043('0x2e')][_0x9043('0x36')]);_0x554771[_0x9043('0x37')]=qs['filters'](_[_0x9043('0x39')](_0x425205[_0x9043('0x2e')],_0x333e7e[_0x9043('0x38')]));if(_0x425205[_0x9043('0x2e')]['filter']){_0x554771[_0x9043('0x37')]=_[_0x9043('0x3b')](_0x554771[_0x9043('0x37')],{'$or':_[_0x9043('0x29')](_0x554771[_0x9043('0x32')],function(_0x53c8f3){var _0x1a23f0={};_0x1a23f0[_0x53c8f3]={'$like':'%'+_0x425205[_0x9043('0x2e')]['filter']+'%'};return _0x1a23f0;})});}_0x554771=_[_0x9043('0x3b')]({},_0x554771,_0x425205[_0x9043('0x3d')]);return _0x4b9470[_0x9043('0x48')](_0x554771);}})[_0x9043('0x23')](function(_0x32a29e){if(_0x32a29e){_0x599e17=_0x32a29e[_0x9043('0x42')];if(!_0x425205['query']['hasOwnProperty']('nolimit')){_0x554771['limit']=qs[_0x9043('0x1d')](_0x425205['query'][_0x9043('0x1d')]);_0x554771[_0x9043('0x1b')]=qs[_0x9043('0x1b')](_0x425205['query'][_0x9043('0x1b')]);}return _0x4b9470[_0x9043('0x48')](_0x554771);}})[_0x9043('0x23')](function(_0x17b984){if(_0x17b984){return _0x17b984?{'count':_0x599e17,'rows':_0x17b984}:null;}})[_0x9043('0x23')](respondWithResult(_0x185298,null))[_0x9043('0x45')](handleError(_0x185298,null));};exports[_0x9043('0x4b')]=function(_0x2b5e62,_0x30d254,_0x59c14c){if(_0x2b5e62[_0x9043('0x47')]['id']){delete _0x2b5e62[_0x9043('0x47')]['id'];}return db[_0x9043('0x2a')][_0x9043('0x49')]({'where':{'id':_0x2b5e62[_0x9043('0x40')]['id']}})[_0x9043('0x23')](handleEntityNotFound(_0x30d254,null))[_0x9043('0x23')](function(_0x4cf266){if(_0x4cf266){_0x2b5e62['body'][_0x9043('0x4c')]=_0x4cf266['id'];_0x2b5e62['body'][_0x9043('0x4d')]=integrations[_0x9043('0x4e')](_0x2b5e62['body']['channel'],_0x2b5e62['body'][_0x9043('0x3c')]);_0x2b5e62[_0x9043('0x47')]['Descriptions']=integrations[_0x9043('0x4f')](_0x2b5e62[_0x9043('0x47')]['channel'],_0x2b5e62['body']['type']);return db[_0x9043('0x4a')][_0x9043('0x46')](_0x2b5e62['body'],{'include':[{'model':db['FreshdeskField'],'as':_0x9043('0x4d')},{'model':db[_0x9043('0x50')],'as':_0x9043('0x51')}]});}return null;})[_0x9043('0x23')](respondWithResult(_0x30d254,null))[_0x9043('0x45')](handleError(_0x30d254,null));};exports[_0x9043('0x52')]=function(_0x12241f,_0x187394,_0x32a82b){var _0x1696bc='';return db['FreshdeskAccount'][_0x9043('0x49')]({'where':{'id':_0x12241f[_0x9043('0x40')]['id']},'attributes':['id',_0x9043('0x53'),'apiKey']})['then'](handleEntityNotFound(_0x187394,null))[_0x9043('0x23')](function(_0x45a557){if(_0x45a557){_0x1696bc=_0x45a557[_0x9043('0x53')];var _0x488840=_0x1696bc['slice'](-0x1);if(_0x488840==='/'){_0x1696bc=_0x1696bc[_0x9043('0x54')](0x0,_0x1696bc[_0x9043('0x55')](_0x488840));}return rp({'method':'GET','uri':util[_0x9043('0x56')](_0x9043('0x57'),_0x1696bc,_0x9043('0x58')),'headers':{'Authorization':util[_0x9043('0x56')](_0x9043('0x59'),new Buffer(util['format'](_0x9043('0x5a'),_0x45a557[_0x9043('0x5b')]))[_0x9043('0x5c')]('base64'))},'json':!![]});}})[_0x9043('0x23')](function(_0x3f5449){if(_0x3f5449){var _0x69aea=[_0x9043('0x5d'),'subject',_0x9043('0x5e'),_0x9043('0x5f'),'status',_0x9043('0x60'),_0x9043('0x61'),_0x9043('0x62'),_0x9043('0x63'),_0x9043('0x61'),'company'];_[_0x9043('0x64')](_0x3f5449,function(_0x1bdf9d){return _0x69aea[_0x9043('0x65')](_0x1bdf9d['name'])||!_0x1bdf9d[_0x9043('0x66')]&&_0x1bdf9d['type']!==_0x9043('0x67')&&_0x1bdf9d['type']!==_0x9043('0x68');});return{'count':_0x3f5449[_0x9043('0x42')],'rows':_[_0x9043('0x29')](_0x3f5449,function(_0x23b0d7){return{'id':_0x23b0d7['name'],'name':_0x23b0d7[_0x9043('0x69')],'custom':!_0x23b0d7['default'],'options':_0x23b0d7[_0x9043('0x6a')]?_[_0x9043('0x29')](_0x23b0d7[_0x9043('0x6a')],function(_0x1ab59){return{'name':_['capitalize'](_0x1ab59),'value':_0x1ab59};}):[]};})};}})[_0x9043('0x23')](respondWithResult(_0x187394,null))[_0x9043('0x45')](function(_0xd2c3b0){var _0x3e3512=_0x12241f[_0x9043('0x2e')][_0x9043('0x6b')]?0x1f4:_0xd2c3b0['statusCode']||0x1f4;logger[_0x9043('0x6c')](_0x9043('0x6d'),_0x9043('0x52'),_0x3e3512,JSON['stringify'](_0xd2c3b0));delete _0xd2c3b0[_0x9043('0x27')];if(_0x3e3512===0x191){_0x3e3512=0x190;}_0x187394[_0x9043('0x18')](_0x3e3512)[_0x9043('0x6e')](_0x12241f[_0x9043('0x2e')][_0x9043('0x6b')]?{'message':_0x9043('0x6f'),'statusCode':_0xd2c3b0[_0x9043('0x70')]}:_0xd2c3b0);});}; \ No newline at end of file +var _0xb4e6=['includeAll','include','catch','params','find','create','body','FreshdeskConfiguration','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','GET','%s/%s','format','Basic\x20%s','%s:X','toString','base64','agent','description','priority','group','source','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','label','capitalize','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','count','limit','status','Content-Range','save','update','then','destroy','error','name','send','index','map','FreshdeskAccount','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options'];(function(_0xfa5c38,_0x27dda8){var _0x3d54bd=function(_0x1afa13){while(--_0x1afa13){_0xfa5c38['push'](_0xfa5c38['shift']());}};_0x3d54bd(++_0x27dda8);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x5447aa,_0x3afc00){_0x5447aa=_0x5447aa-0x0;var _0xb21e53=_0xb4e6[_0x5447aa];return _0xb21e53;};'use strict';var emlformat=require(_0x6b4e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6b4e('0x1'));var jsonpatch=require(_0x6b4e('0x2'));var rp=require(_0x6b4e('0x3'));var moment=require(_0x6b4e('0x4'));var BPromise=require(_0x6b4e('0x5'));var Mustache=require(_0x6b4e('0x6'));var util=require(_0x6b4e('0x7'));var path=require('path');var sox=require(_0x6b4e('0x8'));var csv=require(_0x6b4e('0x9'));var ejs=require(_0x6b4e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6b4e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6b4e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b4e('0xd'));var Papa=require(_0x6b4e('0xe'));var Redis=require(_0x6b4e('0xf'));var authService=require(_0x6b4e('0x10'));var qs=require(_0x6b4e('0x11'));var as=require(_0x6b4e('0x12'));var hardwareService=require(_0x6b4e('0x13'));var logger=require('../../config/logger')(_0x6b4e('0x14'));var utils=require(_0x6b4e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6b4e('0x16'));var db=require(_0x6b4e('0x17'))['db'];var integrations=require(_0x6b4e('0x18'));function respondWithStatusCode(_0x2b2ce0,_0x9f8f6c){_0x9f8f6c=_0x9f8f6c||0xcc;return function(_0xa3d358){if(_0xa3d358){return _0x2b2ce0[_0x6b4e('0x19')](_0x9f8f6c);}return _0x2b2ce0['status'](_0x9f8f6c)[_0x6b4e('0x1a')]();};}function respondWithResult(_0x29bdee,_0x4788cf){_0x4788cf=_0x4788cf||0xc8;return function(_0x29a6df){if(_0x29a6df){return _0x29bdee['status'](_0x4788cf)[_0x6b4e('0x1b')](_0x29a6df);}};}function respondWithFilteredResult(_0x2195c1,_0x3ba513){return function(_0x42e265){if(_0x42e265){var _0x28c3ba=typeof _0x3ba513[_0x6b4e('0x1c')]==='undefined'&&typeof _0x3ba513['limit']===_0x6b4e('0x1d');var _0x1beb73=_0x42e265[_0x6b4e('0x1e')];var _0x39c1b8=_0x28c3ba?0x0:_0x3ba513[_0x6b4e('0x1c')];var _0x1a585d=_0x28c3ba?_0x42e265[_0x6b4e('0x1e')]:_0x3ba513[_0x6b4e('0x1c')]+_0x3ba513[_0x6b4e('0x1f')];var _0x20a178;if(_0x1a585d>=_0x1beb73){_0x1a585d=_0x1beb73;_0x20a178=0xc8;}else{_0x20a178=0xce;}_0x2195c1[_0x6b4e('0x20')](_0x20a178);return _0x2195c1['set'](_0x6b4e('0x21'),_0x39c1b8+'-'+_0x1a585d+'/'+_0x1beb73)[_0x6b4e('0x1b')](_0x42e265);}return null;};}function patchUpdates(_0x31fb9d){return function(_0xd81d99){try{jsonpatch['apply'](_0xd81d99,_0x31fb9d,!![]);}catch(_0x1b48b5){return BPromise['reject'](_0x1b48b5);}return _0xd81d99[_0x6b4e('0x22')]();};}function saveUpdates(_0x163dea,_0x165a99){return function(_0x4344b7){if(_0x4344b7){return _0x4344b7[_0x6b4e('0x23')](_0x163dea)[_0x6b4e('0x24')](function(_0x3e636f){return _0x3e636f;});}return null;};}function removeEntity(_0x5c33be,_0x2e36db){return function(_0x4a8ac4){if(_0x4a8ac4){return _0x4a8ac4[_0x6b4e('0x25')]()[_0x6b4e('0x24')](function(){_0x5c33be[_0x6b4e('0x20')](0xcc)[_0x6b4e('0x1a')]();});}};}function handleEntityNotFound(_0x4ec9cc,_0xec7d35){return function(_0x3f72d7){if(!_0x3f72d7){_0x4ec9cc['sendStatus'](0x194);}return _0x3f72d7;};}function handleError(_0x32102f,_0x381ff0){_0x381ff0=_0x381ff0||0x1f4;return function(_0x3513b2){logger[_0x6b4e('0x26')](_0x3513b2['stack']);if(_0x3513b2[_0x6b4e('0x27')]){delete _0x3513b2[_0x6b4e('0x27')];}_0x32102f['status'](_0x381ff0)[_0x6b4e('0x28')](_0x3513b2);};}exports[_0x6b4e('0x29')]=function(_0x2f1129,_0x143de5){var _0x4a6c90={},_0x445278={},_0x4007b6={'count':0x0,'rows':[]};var _0x47ab11=_[_0x6b4e('0x2a')](db[_0x6b4e('0x2b')][_0x6b4e('0x2c')],function(_0x53c242){return{'name':_0x53c242['fieldName'],'type':_0x53c242[_0x6b4e('0x2d')][_0x6b4e('0x2e')]};});_0x445278[_0x6b4e('0x2f')]=_['map'](_0x47ab11,_0x6b4e('0x27'));_0x445278[_0x6b4e('0x30')]=_[_0x6b4e('0x31')](_0x2f1129['query']);_0x445278['filters']=_[_0x6b4e('0x32')](_0x445278['model'],_0x445278[_0x6b4e('0x30')]);_0x4a6c90[_0x6b4e('0x33')]=_['intersection'](_0x445278[_0x6b4e('0x2f')],qs[_0x6b4e('0x34')](_0x2f1129[_0x6b4e('0x30')][_0x6b4e('0x34')]));_0x4a6c90['attributes']=_0x4a6c90['attributes'][_0x6b4e('0x35')]?_0x4a6c90[_0x6b4e('0x33')]:_0x445278[_0x6b4e('0x2f')];if(!_0x2f1129[_0x6b4e('0x30')][_0x6b4e('0x36')](_0x6b4e('0x37'))){_0x4a6c90[_0x6b4e('0x1f')]=qs[_0x6b4e('0x1f')](_0x2f1129[_0x6b4e('0x30')][_0x6b4e('0x1f')]);_0x4a6c90[_0x6b4e('0x1c')]=qs[_0x6b4e('0x1c')](_0x2f1129[_0x6b4e('0x30')]['offset']);}_0x4a6c90[_0x6b4e('0x38')]=qs[_0x6b4e('0x39')](_0x2f1129[_0x6b4e('0x30')]['sort']);_0x4a6c90[_0x6b4e('0x3a')]=qs['filters'](_[_0x6b4e('0x3b')](_0x2f1129[_0x6b4e('0x30')],_0x445278[_0x6b4e('0x3c')]),_0x47ab11);if(_0x2f1129['query']['filter']){_0x4a6c90[_0x6b4e('0x3a')]=_[_0x6b4e('0x3d')](_0x4a6c90['where'],{'$or':_['map'](_0x47ab11,function(_0x2362e1){if(_0x2362e1[_0x6b4e('0x2d')]!==_0x6b4e('0x3e')){var _0x39097d={};_0x39097d[_0x2362e1[_0x6b4e('0x27')]]={'$like':'%'+_0x2f1129[_0x6b4e('0x30')][_0x6b4e('0x3f')]+'%'};return _0x39097d;}})});}_0x4a6c90=_[_0x6b4e('0x3d')]({},_0x4a6c90,_0x2f1129[_0x6b4e('0x40')]);var _0x2b61c4={'where':_0x4a6c90[_0x6b4e('0x3a')]};return db['FreshdeskAccount'][_0x6b4e('0x1e')](_0x2b61c4)[_0x6b4e('0x24')](function(_0x5d5d55){_0x4007b6[_0x6b4e('0x1e')]=_0x5d5d55;if(_0x2f1129[_0x6b4e('0x30')][_0x6b4e('0x41')]){_0x4a6c90[_0x6b4e('0x42')]=[{'all':!![]}];}return db[_0x6b4e('0x2b')]['findAll'](_0x4a6c90);})['then'](function(_0x210691){_0x4007b6['rows']=_0x210691;return _0x4007b6;})[_0x6b4e('0x24')](respondWithFilteredResult(_0x143de5,_0x4a6c90))[_0x6b4e('0x43')](handleError(_0x143de5,null));};exports['show']=function(_0xf70c24,_0x50f0e7){var _0x3dec0f={'raw':![],'where':{'id':_0xf70c24[_0x6b4e('0x44')]['id']}},_0x4fbd96={};_0x4fbd96[_0x6b4e('0x2f')]=_[_0x6b4e('0x31')](db[_0x6b4e('0x2b')]['rawAttributes']);_0x4fbd96[_0x6b4e('0x30')]=_[_0x6b4e('0x31')](_0xf70c24[_0x6b4e('0x30')]);_0x4fbd96['filters']=_[_0x6b4e('0x32')](_0x4fbd96[_0x6b4e('0x2f')],_0x4fbd96[_0x6b4e('0x30')]);_0x3dec0f[_0x6b4e('0x33')]=_[_0x6b4e('0x32')](_0x4fbd96[_0x6b4e('0x2f')],qs[_0x6b4e('0x34')](_0xf70c24[_0x6b4e('0x30')][_0x6b4e('0x34')]));_0x3dec0f['attributes']=_0x3dec0f[_0x6b4e('0x33')][_0x6b4e('0x35')]?_0x3dec0f[_0x6b4e('0x33')]:_0x4fbd96[_0x6b4e('0x2f')];if(_0xf70c24[_0x6b4e('0x30')]['includeAll']){_0x3dec0f[_0x6b4e('0x42')]=[{'all':!![]}];}_0x3dec0f=_['merge']({},_0x3dec0f,_0xf70c24[_0x6b4e('0x40')]);return db[_0x6b4e('0x2b')][_0x6b4e('0x45')](_0x3dec0f)[_0x6b4e('0x24')](handleEntityNotFound(_0x50f0e7,null))['then'](respondWithResult(_0x50f0e7,null))[_0x6b4e('0x43')](handleError(_0x50f0e7,null));};exports[_0x6b4e('0x46')]=function(_0x1d0eb3,_0x5b9da3){return db[_0x6b4e('0x2b')][_0x6b4e('0x46')](_0x1d0eb3[_0x6b4e('0x47')],{})[_0x6b4e('0x24')](respondWithResult(_0x5b9da3,0xc9))[_0x6b4e('0x43')](handleError(_0x5b9da3,null));};exports[_0x6b4e('0x23')]=function(_0x289dfa,_0x3e7186){if(_0x289dfa[_0x6b4e('0x47')]['id']){delete _0x289dfa[_0x6b4e('0x47')]['id'];}return db['FreshdeskAccount'][_0x6b4e('0x45')]({'where':{'id':_0x289dfa[_0x6b4e('0x44')]['id']}})[_0x6b4e('0x24')](handleEntityNotFound(_0x3e7186,null))['then'](saveUpdates(_0x289dfa[_0x6b4e('0x47')],null))[_0x6b4e('0x24')](respondWithResult(_0x3e7186,null))[_0x6b4e('0x43')](handleError(_0x3e7186,null));};exports[_0x6b4e('0x25')]=function(_0x73c6be,_0x104c2a){return db[_0x6b4e('0x2b')][_0x6b4e('0x45')]({'where':{'id':_0x73c6be[_0x6b4e('0x44')]['id']}})[_0x6b4e('0x24')](handleEntityNotFound(_0x104c2a,null))[_0x6b4e('0x24')](removeEntity(_0x104c2a,null))['catch'](handleError(_0x104c2a,null));};exports['getConfigurations']=function(_0x2e67cd,_0x2d5eda,_0x51cf0c){var _0x43fb95={};var _0x542e98={};var _0x1450de;var _0x31071f;return db[_0x6b4e('0x2b')]['findOne']({'where':{'id':_0x2e67cd[_0x6b4e('0x44')]['id']}})[_0x6b4e('0x24')](handleEntityNotFound(_0x2d5eda,null))[_0x6b4e('0x24')](function(_0x282c4d){if(_0x282c4d){_0x1450de=_0x282c4d;_0x542e98[_0x6b4e('0x2f')]=_['keys'](db[_0x6b4e('0x48')]['rawAttributes']);_0x542e98[_0x6b4e('0x30')]=_[_0x6b4e('0x31')](_0x2e67cd['query']);_0x542e98[_0x6b4e('0x3c')]=_['intersection'](_0x542e98[_0x6b4e('0x2f')],_0x542e98[_0x6b4e('0x30')]);_0x43fb95[_0x6b4e('0x33')]=_[_0x6b4e('0x32')](_0x542e98[_0x6b4e('0x2f')],qs['fields'](_0x2e67cd[_0x6b4e('0x30')][_0x6b4e('0x34')]));_0x43fb95[_0x6b4e('0x33')]=_0x43fb95['attributes']['length']?_0x43fb95[_0x6b4e('0x33')]:_0x542e98[_0x6b4e('0x2f')];_0x43fb95['order']=qs[_0x6b4e('0x39')](_0x2e67cd[_0x6b4e('0x30')][_0x6b4e('0x39')]);_0x43fb95[_0x6b4e('0x3a')]=qs[_0x6b4e('0x3c')](_['pick'](_0x2e67cd['query'],_0x542e98[_0x6b4e('0x3c')]));if(_0x2e67cd[_0x6b4e('0x30')][_0x6b4e('0x3f')]){_0x43fb95[_0x6b4e('0x3a')]=_[_0x6b4e('0x3d')](_0x43fb95[_0x6b4e('0x3a')],{'$or':_[_0x6b4e('0x2a')](_0x43fb95[_0x6b4e('0x33')],function(_0x3ef6a8){var _0x5bedab={};_0x5bedab[_0x3ef6a8]={'$like':'%'+_0x2e67cd[_0x6b4e('0x30')][_0x6b4e('0x3f')]+'%'};return _0x5bedab;})});}_0x43fb95=_[_0x6b4e('0x3d')]({},_0x43fb95,_0x2e67cd['options']);return _0x1450de['getConfigurations'](_0x43fb95);}})[_0x6b4e('0x24')](function(_0x38b1a6){if(_0x38b1a6){_0x31071f=_0x38b1a6[_0x6b4e('0x35')];if(!_0x2e67cd[_0x6b4e('0x30')][_0x6b4e('0x36')]('nolimit')){_0x43fb95[_0x6b4e('0x1f')]=qs[_0x6b4e('0x1f')](_0x2e67cd[_0x6b4e('0x30')]['limit']);_0x43fb95[_0x6b4e('0x1c')]=qs[_0x6b4e('0x1c')](_0x2e67cd[_0x6b4e('0x30')]['offset']);}return _0x1450de[_0x6b4e('0x49')](_0x43fb95);}})[_0x6b4e('0x24')](function(_0x56b2f3){if(_0x56b2f3){return _0x56b2f3?{'count':_0x31071f,'rows':_0x56b2f3}:null;}})[_0x6b4e('0x24')](respondWithResult(_0x2d5eda,null))[_0x6b4e('0x43')](handleError(_0x2d5eda,null));};exports[_0x6b4e('0x4a')]=function(_0x1d42f9,_0x348177,_0x28ed36){if(_0x1d42f9[_0x6b4e('0x47')]['id']){delete _0x1d42f9['body']['id'];}return db[_0x6b4e('0x2b')][_0x6b4e('0x4b')]({'where':{'id':_0x1d42f9[_0x6b4e('0x44')]['id']}})[_0x6b4e('0x24')](handleEntityNotFound(_0x348177,null))[_0x6b4e('0x24')](function(_0x5ab4b8){if(_0x5ab4b8){_0x1d42f9[_0x6b4e('0x47')][_0x6b4e('0x4c')]=_0x5ab4b8['id'];_0x1d42f9[_0x6b4e('0x47')][_0x6b4e('0x4d')]=integrations[_0x6b4e('0x4e')](_0x1d42f9['body'][_0x6b4e('0x4f')],_0x1d42f9['body'][_0x6b4e('0x2d')]);_0x1d42f9[_0x6b4e('0x47')][_0x6b4e('0x50')]=integrations[_0x6b4e('0x51')](_0x1d42f9['body'][_0x6b4e('0x4f')],_0x1d42f9[_0x6b4e('0x47')][_0x6b4e('0x2d')]);return db[_0x6b4e('0x48')][_0x6b4e('0x46')](_0x1d42f9[_0x6b4e('0x47')],{'include':[{'model':db[_0x6b4e('0x52')],'as':'Subjects'},{'model':db['FreshdeskField'],'as':'Descriptions'}]});}return null;})[_0x6b4e('0x24')](respondWithResult(_0x348177,null))[_0x6b4e('0x43')](handleError(_0x348177,null));};exports[_0x6b4e('0x53')]=function(_0x166e94,_0x15d6d1,_0x381045){var _0x5882b8='';return db['FreshdeskAccount'][_0x6b4e('0x4b')]({'where':{'id':_0x166e94[_0x6b4e('0x44')]['id']},'attributes':['id',_0x6b4e('0x54'),_0x6b4e('0x55')]})['then'](handleEntityNotFound(_0x15d6d1,null))[_0x6b4e('0x24')](function(_0x573c11){if(_0x573c11){_0x5882b8=_0x573c11[_0x6b4e('0x54')];var _0x1a9870=_0x5882b8[_0x6b4e('0x56')](-0x1);if(_0x1a9870==='/'){_0x5882b8=_0x5882b8[_0x6b4e('0x57')](0x0,_0x5882b8['lastIndexOf'](_0x1a9870));}return rp({'method':_0x6b4e('0x58'),'uri':util['format'](_0x6b4e('0x59'),_0x5882b8,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x6b4e('0x5a')](_0x6b4e('0x5b'),new Buffer(util['format'](_0x6b4e('0x5c'),_0x573c11['apiKey']))[_0x6b4e('0x5d')](_0x6b4e('0x5e')))},'json':!![]});}})[_0x6b4e('0x24')](function(_0x29a432){if(_0x29a432){var _0x53c912=['requester','subject',_0x6b4e('0x5f'),_0x6b4e('0x60'),'status',_0x6b4e('0x61'),_0x6b4e('0x62'),_0x6b4e('0x63'),_0x6b4e('0x64'),_0x6b4e('0x62'),_0x6b4e('0x65')];_[_0x6b4e('0x66')](_0x29a432,function(_0x24e893){return _0x53c912[_0x6b4e('0x67')](_0x24e893[_0x6b4e('0x27')])||!_0x24e893[_0x6b4e('0x68')]&&_0x24e893['type']!==_0x6b4e('0x69')&&_0x24e893[_0x6b4e('0x2d')]!==_0x6b4e('0x6a');});return{'count':_0x29a432[_0x6b4e('0x35')],'rows':_[_0x6b4e('0x2a')](_0x29a432,function(_0x4085ca){return{'id':_0x4085ca[_0x6b4e('0x27')],'name':_0x4085ca[_0x6b4e('0x6b')],'custom':!_0x4085ca[_0x6b4e('0x68')],'options':_0x4085ca['choices']?_['map'](_0x4085ca['choices'],function(_0x5d8bb1){return{'name':_[_0x6b4e('0x6c')](_0x5d8bb1),'value':_0x5d8bb1};}):[]};})};}})[_0x6b4e('0x24')](respondWithResult(_0x15d6d1,null))[_0x6b4e('0x43')](function(_0x1b835f){var _0x4e7b0f=_0x166e94[_0x6b4e('0x30')][_0x6b4e('0x6d')]?0x1f4:_0x1b835f['statusCode']||0x1f4;logger[_0x6b4e('0x26')](_0x6b4e('0x6e'),_0x6b4e('0x53'),_0x4e7b0f,JSON[_0x6b4e('0x6f')](_0x1b835f));delete _0x1b835f['name'];if(_0x4e7b0f===0x191){_0x4e7b0f=0x190;}_0x15d6d1[_0x6b4e('0x20')](_0x4e7b0f)[_0x6b4e('0x28')](_0x166e94['query']['test']?{'message':_0x6b4e('0x70'),'statusCode':_0x1b835f['statusCode']}:_0x1b835f);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index dc74874..8628113 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 _0x4f34=['moment','bluebird','request-promise','path','rimraf','./intFreshdeskAccount.attributes','define','lodash','../../config/logger','api'];(function(_0x1ceee9,_0x57f8a9){var _0x3a50f5=function(_0x37ddad){while(--_0x37ddad){_0x1ceee9['push'](_0x1ceee9['shift']());}};_0x3a50f5(++_0x57f8a9);}(_0x4f34,0xb1));var _0x44f3=function(_0x527fba,_0x51af72){_0x527fba=_0x527fba-0x0;var _0x546244=_0x4f34[_0x527fba];return _0x546244;};'use strict';var _=require(_0x44f3('0x0'));var util=require('util');var logger=require(_0x44f3('0x1'))(_0x44f3('0x2'));var moment=require(_0x44f3('0x3'));var BPromise=require(_0x44f3('0x4'));var rp=require(_0x44f3('0x5'));var fs=require('fs');var path=require(_0x44f3('0x6'));var rimraf=require(_0x44f3('0x7'));var config=require('../../config/environment');var attributes=require(_0x44f3('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x44f088,_0x7bc05a){return _0x44f088[_0x44f3('0x9')]('FreshdeskAccount',attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0aa1=['../../components/integrations/configuration','exports','define','FreshdeskAccount','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intFreshdeskAccount.attributes'];(function(_0x37c9ea,_0x4421c8){var _0x186ae1=function(_0x3e6d87){while(--_0x3e6d87){_0x37c9ea['push'](_0x37c9ea['shift']());}};_0x186ae1(++_0x4421c8);}(_0x0aa1,0x160));var _0x10aa=function(_0x3f1c83,_0x56add5){_0x3f1c83=_0x3f1c83-0x0;var _0x590b3a=_0x0aa1[_0x3f1c83];return _0x590b3a;};'use strict';var _=require('lodash');var util=require(_0x10aa('0x0'));var logger=require(_0x10aa('0x1'))(_0x10aa('0x2'));var moment=require(_0x10aa('0x3'));var BPromise=require(_0x10aa('0x4'));var rp=require(_0x10aa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x10aa('0x6'));var config=require('../../config/environment');var attributes=require(_0x10aa('0x7'));var integrations=require(_0x10aa('0x8'));module[_0x10aa('0x9')]=function(_0x1a2699,_0x3e4900){return _0x1a2699[_0x10aa('0xa')](_0x10aa('0xb'),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 1aca9ea..69d2a2f 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 _0xbd5b=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','options','raw','where','attributes','limit','include','map','model','debug','ShowFreshdeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x453cdd,_0x498e15){var _0x1ef503=function(_0xba0802){while(--_0xba0802){_0x453cdd['push'](_0x453cdd['shift']());}};_0x1ef503(++_0x498e15);}(_0xbd5b,0x1e8));var _0xbbd5=function(_0x3fa7d3,_0x37f83c){_0x3fa7d3=_0x3fa7d3-0x0;var _0x4c51bd=_0xbd5b[_0x3fa7d3];return _0x4c51bd;};'use strict';var _=require(_0xbbd5('0x0'));var util=require(_0xbbd5('0x1'));var moment=require(_0xbbd5('0x2'));var BPromise=require(_0xbbd5('0x3'));var rs=require(_0xbbd5('0x4'));var fs=require('fs');var Redis=require(_0xbbd5('0x5'));var db=require(_0xbbd5('0x6'))['db'];var utils=require(_0xbbd5('0x7'));var logger=require(_0xbbd5('0x8'))(_0xbbd5('0x9'));var config=require(_0xbbd5('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xbbd5('0xb')][_0xbbd5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3606b8,_0x29d611,_0x1004dd){return new BPromise(function(_0x85bd7e,_0x3c42fb){return client[_0xbbd5('0xd')](_0x3606b8,_0x1004dd)[_0xbbd5('0xe')](function(_0x4b5503){logger[_0xbbd5('0xf')](_0xbbd5('0x10'),_0x29d611,'request\x20sent');logger['debug'](_0xbbd5('0x11'),_0x29d611,_0xbbd5('0x12'),JSON[_0xbbd5('0x13')](_0x4b5503));if(_0x4b5503[_0xbbd5('0x14')]){if(_0x4b5503['error'][_0xbbd5('0x15')]===0x1f4){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x29d611,_0x4b5503[_0xbbd5('0x14')][_0xbbd5('0x16')]);return _0x3c42fb(_0x4b5503[_0xbbd5('0x14')][_0xbbd5('0x16')]);}logger[_0xbbd5('0x14')](_0xbbd5('0x10'),_0x29d611,_0x4b5503[_0xbbd5('0x14')][_0xbbd5('0x16')]);return _0x85bd7e(_0x4b5503[_0xbbd5('0x14')][_0xbbd5('0x16')]);}else{logger['info'](_0xbbd5('0x10'),_0x29d611,_0xbbd5('0x12'));_0x85bd7e(_0x4b5503[_0xbbd5('0x17')][_0xbbd5('0x16')]);}})[_0xbbd5('0x18')](function(_0x109c4e){logger[_0xbbd5('0x14')](_0xbbd5('0x10'),_0x29d611,_0x109c4e);_0x3c42fb(_0x109c4e);});});}exports[_0xbbd5('0x19')]=function(_0x3584c5){var _0x1b3a25=this;return new Promise(function(_0x3c1003,_0x48ee7d){return db[_0xbbd5('0x1a')]['findAll']({'raw':_0x3584c5[_0xbbd5('0x1b')]?_0x3584c5['options'][_0xbbd5('0x1c')]===undefined?!![]:![]:!![],'where':_0x3584c5[_0xbbd5('0x1b')]?_0x3584c5[_0xbbd5('0x1b')][_0xbbd5('0x1d')]||null:null,'attributes':_0x3584c5['options']?_0x3584c5[_0xbbd5('0x1b')][_0xbbd5('0x1e')]||null:null,'limit':_0x3584c5[_0xbbd5('0x1b')]?_0x3584c5[_0xbbd5('0x1b')][_0xbbd5('0x1f')]||null:null,'include':_0x3584c5[_0xbbd5('0x1b')]?_0x3584c5[_0xbbd5('0x1b')][_0xbbd5('0x20')]?_[_0xbbd5('0x21')](_0x3584c5[_0xbbd5('0x1b')][_0xbbd5('0x20')],function(_0x41a675){return{'model':db[_0x41a675[_0xbbd5('0x22')]],'as':_0x41a675['as'],'attributes':_0x41a675[_0xbbd5('0x1e')],'include':_0x41a675[_0xbbd5('0x20')]?_[_0xbbd5('0x21')](_0x41a675[_0xbbd5('0x20')],function(_0x5f3bb1){return{'model':db[_0x5f3bb1['model']],'as':_0x5f3bb1['as'],'attributes':_0x5f3bb1[_0xbbd5('0x1e')],'include':_0x5f3bb1['include']?_[_0xbbd5('0x21')](_0x5f3bb1[_0xbbd5('0x20')],function(_0x17bb21){return{'model':db[_0x17bb21[_0xbbd5('0x22')]],'as':_0x17bb21['as'],'attributes':_0x17bb21[_0xbbd5('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xbbd5('0xe')](function(_0x344ac2){logger[_0xbbd5('0xf')](_0xbbd5('0x19'),_0x3584c5);logger[_0xbbd5('0x23')](_0xbbd5('0x19'),_0x3584c5,JSON['stringify'](_0x344ac2));_0x3c1003(_0x344ac2);})[_0xbbd5('0x18')](function(_0x1e806f){logger[_0xbbd5('0x14')](_0xbbd5('0x19'),_0x1e806f['message'],_0x3584c5);_0x48ee7d(_0x1b3a25[_0xbbd5('0x14')](0x1f4,_0x1e806f[_0xbbd5('0x16')]));});});};exports[_0xbbd5('0x24')]=function(_0x5193bb){var _0x55ae71=this;return new Promise(function(_0x4ecf55,_0x85277e){return db[_0xbbd5('0x1a')][_0xbbd5('0x25')]({'raw':_0x5193bb[_0xbbd5('0x1b')]?_0x5193bb[_0xbbd5('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5193bb[_0xbbd5('0x1b')]?_0x5193bb[_0xbbd5('0x1b')][_0xbbd5('0x1d')]||null:null,'attributes':_0x5193bb[_0xbbd5('0x1b')]?_0x5193bb[_0xbbd5('0x1b')][_0xbbd5('0x1e')]||null:null,'include':_0x5193bb[_0xbbd5('0x1b')]?_0x5193bb[_0xbbd5('0x1b')][_0xbbd5('0x20')]?_[_0xbbd5('0x21')](_0x5193bb[_0xbbd5('0x1b')][_0xbbd5('0x20')],function(_0xdc4d5){return{'model':db[_0xdc4d5[_0xbbd5('0x22')]],'as':_0xdc4d5['as'],'attributes':_0xdc4d5[_0xbbd5('0x1e')],'include':_0xdc4d5[_0xbbd5('0x20')]?_[_0xbbd5('0x21')](_0xdc4d5[_0xbbd5('0x20')],function(_0x342f31){return{'model':db[_0x342f31[_0xbbd5('0x22')]],'as':_0x342f31['as'],'attributes':_0x342f31[_0xbbd5('0x1e')],'include':_0x342f31[_0xbbd5('0x20')]?_[_0xbbd5('0x21')](_0x342f31[_0xbbd5('0x20')],function(_0x1d64f1){return{'model':db[_0x1d64f1[_0xbbd5('0x22')]],'as':_0x1d64f1['as'],'attributes':_0x1d64f1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x48dd78){logger[_0xbbd5('0xf')](_0xbbd5('0x24'),_0x5193bb);logger[_0xbbd5('0x23')](_0xbbd5('0x24'),_0x5193bb,JSON['stringify'](_0x48dd78));_0x4ecf55(_0x48dd78);})['catch'](function(_0x10f683){logger[_0xbbd5('0x14')]('ShowFreshdeskAccount',_0x10f683[_0xbbd5('0x16')],_0x5193bb);_0x85277e(_0x55ae71[_0xbbd5('0x14')](0x1f4,_0x10f683[_0xbbd5('0x16')]));});});}; \ No newline at end of file +var _0xed3e=['attributes','debug','find','ShowFreshdeskAccount','lodash','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetFreshdeskAccount','findAll','options','raw','where','limit','include','map','model'];(function(_0x2b0490,_0x4fea71){var _0x13d2a3=function(_0x230659){while(--_0x230659){_0x2b0490['push'](_0x2b0490['shift']());}};_0x13d2a3(++_0x4fea71);}(_0xed3e,0x1c4));var _0xeed3=function(_0x350e1b,_0x1039de){_0x350e1b=_0x350e1b-0x0;var _0x38c66b=_0xed3e[_0x350e1b];return _0x38c66b;};'use strict';var _=require(_0xeed3('0x0'));var util=require('util');var moment=require(_0xeed3('0x1'));var BPromise=require('bluebird');var rs=require(_0xeed3('0x2'));var fs=require('fs');var Redis=require(_0xeed3('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xeed3('0x4'))(_0xeed3('0x5'));var config=require('../../config/environment');var jayson=require(_0xeed3('0x6'));var client=jayson[_0xeed3('0x7')][_0xeed3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51e429,_0x409c8f,_0x566c0d){return new BPromise(function(_0x28b600,_0x2323fc){return client[_0xeed3('0x9')](_0x51e429,_0x566c0d)['then'](function(_0x4a85d0){logger['info'](_0xeed3('0xa'),_0x409c8f,_0xeed3('0xb'));logger['debug'](_0xeed3('0xc'),_0x409c8f,_0xeed3('0xb'),JSON[_0xeed3('0xd')](_0x4a85d0));if(_0x4a85d0[_0xeed3('0xe')]){if(_0x4a85d0['error'][_0xeed3('0xf')]===0x1f4){logger[_0xeed3('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x409c8f,_0x4a85d0[_0xeed3('0xe')][_0xeed3('0x10')]);return _0x2323fc(_0x4a85d0[_0xeed3('0xe')][_0xeed3('0x10')]);}logger[_0xeed3('0xe')](_0xeed3('0xa'),_0x409c8f,_0x4a85d0[_0xeed3('0xe')][_0xeed3('0x10')]);return _0x28b600(_0x4a85d0[_0xeed3('0xe')][_0xeed3('0x10')]);}else{logger[_0xeed3('0x11')](_0xeed3('0xa'),_0x409c8f,_0xeed3('0xb'));_0x28b600(_0x4a85d0['result'][_0xeed3('0x10')]);}})[_0xeed3('0x12')](function(_0x54f194){logger[_0xeed3('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x409c8f,_0x54f194);_0x2323fc(_0x54f194);});});}exports[_0xeed3('0x13')]=function(_0x4ed45a){var _0x3fb3a3=this;return new Promise(function(_0x30f598,_0x35f518){return db['FreshdeskAccount'][_0xeed3('0x14')]({'raw':_0x4ed45a[_0xeed3('0x15')]?_0x4ed45a[_0xeed3('0x15')][_0xeed3('0x16')]===undefined?!![]:![]:!![],'where':_0x4ed45a[_0xeed3('0x15')]?_0x4ed45a['options'][_0xeed3('0x17')]||null:null,'attributes':_0x4ed45a['options']?_0x4ed45a[_0xeed3('0x15')]['attributes']||null:null,'limit':_0x4ed45a['options']?_0x4ed45a['options'][_0xeed3('0x18')]||null:null,'include':_0x4ed45a[_0xeed3('0x15')]?_0x4ed45a[_0xeed3('0x15')][_0xeed3('0x19')]?_[_0xeed3('0x1a')](_0x4ed45a[_0xeed3('0x15')][_0xeed3('0x19')],function(_0x485a98){return{'model':db[_0x485a98[_0xeed3('0x1b')]],'as':_0x485a98['as'],'attributes':_0x485a98[_0xeed3('0x1c')],'include':_0x485a98[_0xeed3('0x19')]?_[_0xeed3('0x1a')](_0x485a98['include'],function(_0x20a7bf){return{'model':db[_0x20a7bf[_0xeed3('0x1b')]],'as':_0x20a7bf['as'],'attributes':_0x20a7bf['attributes'],'include':_0x20a7bf[_0xeed3('0x19')]?_[_0xeed3('0x1a')](_0x20a7bf['include'],function(_0x5691ac){return{'model':db[_0x5691ac[_0xeed3('0x1b')]],'as':_0x5691ac['as'],'attributes':_0x5691ac[_0xeed3('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4152ac){logger[_0xeed3('0x11')](_0xeed3('0x13'),_0x4ed45a);logger[_0xeed3('0x1d')](_0xeed3('0x13'),_0x4ed45a,JSON[_0xeed3('0xd')](_0x4152ac));_0x30f598(_0x4152ac);})[_0xeed3('0x12')](function(_0xba31a2){logger[_0xeed3('0xe')](_0xeed3('0x13'),_0xba31a2[_0xeed3('0x10')],_0x4ed45a);_0x35f518(_0x3fb3a3['error'](0x1f4,_0xba31a2[_0xeed3('0x10')]));});});};exports['ShowFreshdeskAccount']=function(_0x2d32df){var _0x59de40=this;return new Promise(function(_0x3ae13d,_0x3aa816){return db['FreshdeskAccount'][_0xeed3('0x1e')]({'raw':_0x2d32df['options']?_0x2d32df[_0xeed3('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x2d32df[_0xeed3('0x15')]?_0x2d32df[_0xeed3('0x15')]['where']||null:null,'attributes':_0x2d32df[_0xeed3('0x15')]?_0x2d32df[_0xeed3('0x15')][_0xeed3('0x1c')]||null:null,'include':_0x2d32df['options']?_0x2d32df[_0xeed3('0x15')]['include']?_[_0xeed3('0x1a')](_0x2d32df[_0xeed3('0x15')][_0xeed3('0x19')],function(_0x4ecebf){return{'model':db[_0x4ecebf[_0xeed3('0x1b')]],'as':_0x4ecebf['as'],'attributes':_0x4ecebf[_0xeed3('0x1c')],'include':_0x4ecebf[_0xeed3('0x19')]?_[_0xeed3('0x1a')](_0x4ecebf['include'],function(_0x4a3eac){return{'model':db[_0x4a3eac[_0xeed3('0x1b')]],'as':_0x4a3eac['as'],'attributes':_0x4a3eac[_0xeed3('0x1c')],'include':_0x4a3eac['include']?_['map'](_0x4a3eac[_0xeed3('0x19')],function(_0x4e75c4){return{'model':db[_0x4e75c4[_0xeed3('0x1b')]],'as':_0x4e75c4['as'],'attributes':_0x4e75c4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5bd9ce){logger[_0xeed3('0x11')](_0xeed3('0x1f'),_0x2d32df);logger[_0xeed3('0x1d')](_0xeed3('0x1f'),_0x2d32df,JSON[_0xeed3('0xd')](_0x5bd9ce));_0x3ae13d(_0x5bd9ce);})[_0xeed3('0x12')](function(_0x58e597){logger['error'](_0xeed3('0x1f'),_0x58e597[_0xeed3('0x10')],_0x2d32df);_0x3aa816(_0x59de40[_0xeed3('0xe')](0x1f4,_0x58e597[_0xeed3('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index f6f2ef0..b977aed 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 _0x1fdd=['../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','index','/:id','show','get','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','create','post','setTags','put','delete','destroy','exports','multer','util','path','express'];(function(_0x2184a6,_0x252355){var _0x5ab826=function(_0x1cbec7){while(--_0x1cbec7){_0x2184a6['push'](_0x2184a6['shift']());}};_0x5ab826(++_0x252355);}(_0x1fdd,0x14c));var _0xd1fd=function(_0x5168d6,_0x6a7c30){_0x5168d6=_0x5168d6-0x0;var _0x1e9398=_0x1fdd[_0x5168d6];return _0x1e9398;};'use strict';var multer=require(_0xd1fd('0x0'));var util=require(_0xd1fd('0x1'));var path=require(_0xd1fd('0x2'));var timeout=require('connect-timeout');var express=require(_0xd1fd('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd1fd('0x4'));var interaction=require(_0xd1fd('0x5'));var config=require('../../config/environment');var controller=require(_0xd1fd('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xd1fd('0x7')]);router['get'](_0xd1fd('0x8'),auth['isAuthenticated'](),controller[_0xd1fd('0x9')]);router[_0xd1fd('0xa')]('/:id/fields',auth[_0xd1fd('0xb')](),controller[_0xd1fd('0xc')]);router['get'](_0xd1fd('0xd'),auth[_0xd1fd('0xb')](),controller[_0xd1fd('0xe')]);router[_0xd1fd('0xa')](_0xd1fd('0xf'),auth[_0xd1fd('0xb')](),controller['getDescriptions']);router['get'](_0xd1fd('0x10'),auth['isAuthenticated'](),controller['getTags']);router['post']('/',auth['isAuthenticated'](),controller[_0xd1fd('0x11')]);router[_0xd1fd('0x12')](_0xd1fd('0x10'),auth[_0xd1fd('0xb')](),controller[_0xd1fd('0x13')]);router[_0xd1fd('0x14')](_0xd1fd('0x8'),auth[_0xd1fd('0xb')](),controller['update']);router[_0xd1fd('0x15')](_0xd1fd('0x8'),auth[_0xd1fd('0xb')](),controller[_0xd1fd('0x16')]);module[_0xd1fd('0x17')]=router; \ No newline at end of file +var _0xca51=['getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','destroy','exports','util','fs-extra','../../components/interaction/service','get','isAuthenticated','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x3b267b,_0x4e98ef){var _0x1929b3=function(_0x537023){while(--_0x537023){_0x3b267b['push'](_0x3b267b['shift']());}};_0x1929b3(++_0x4e98ef);}(_0xca51,0xd1));var _0x1ca5=function(_0x4ef5cd,_0x51d0ea){_0x4ef5cd=_0x4ef5cd-0x0;var _0x30a49e=_0xca51[_0x4ef5cd];return _0x30a49e;};'use strict';var multer=require('multer');var util=require(_0x1ca5('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x1ca5('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x1ca5('0x2'));var config=require('../../config/environment');var controller=require('./intFreshdeskConfiguration.controller');router[_0x1ca5('0x3')]('/',auth[_0x1ca5('0x4')](),controller['index']);router['get'](_0x1ca5('0x5'),auth[_0x1ca5('0x4')](),controller[_0x1ca5('0x6')]);router[_0x1ca5('0x3')]('/:id/fields',auth[_0x1ca5('0x4')](),controller[_0x1ca5('0x7')]);router[_0x1ca5('0x3')](_0x1ca5('0x8'),auth['isAuthenticated'](),controller[_0x1ca5('0x9')]);router[_0x1ca5('0x3')](_0x1ca5('0xa'),auth[_0x1ca5('0x4')](),controller[_0x1ca5('0xb')]);router[_0x1ca5('0x3')](_0x1ca5('0xc'),auth[_0x1ca5('0x4')](),controller[_0x1ca5('0xd')]);router[_0x1ca5('0xe')]('/',auth[_0x1ca5('0x4')](),controller[_0x1ca5('0xf')]);router[_0x1ca5('0xe')]('/:id/tags',auth[_0x1ca5('0x4')](),controller[_0x1ca5('0x10')]);router[_0x1ca5('0x11')](_0x1ca5('0x5'),auth['isAuthenticated'](),controller[_0x1ca5('0x12')]);router[_0x1ca5('0x13')](_0x1ca5('0x5'),auth[_0x1ca5('0x4')](),controller[_0x1ca5('0x14')]);module[_0x1ca5('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 992aed2..5e8cd5d 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 _0xab15=['sequelize','exports','STRING'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xab15,0x129));var _0x5ab1=function(_0x2c8926,_0x5c285c){_0x2c8926=_0x2c8926-0x0;var _0x3a6967=_0xab15[_0x2c8926];return _0x3a6967;};'use strict';var Sequelize=require(_0x5ab1('0x0'));module[_0x5ab1('0x1')]={'name':{'type':Sequelize[_0x5ab1('0x2')]},'description':{'type':Sequelize[_0x5ab1('0x2')]}}; \ No newline at end of file +var _0xd3e5=['exports','STRING'];(function(_0x3b01ad,_0x1d1dc3){var _0x295965=function(_0x74c40){while(--_0x74c40){_0x3b01ad['push'](_0x3b01ad['shift']());}};_0x295965(++_0x1d1dc3);}(_0xd3e5,0x102));var _0x5d3e=function(_0x533377,_0x5e5c63){_0x533377=_0x533377-0x0;var _0x5d0689=_0xd3e5[_0x533377];return _0x5d0689;};'use strict';var Sequelize=require('sequelize');module[_0x5d3e('0x0')]={'name':{'type':Sequelize[_0x5d3e('0x1')]},'description':{'type':Sequelize[_0x5d3e('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 74b03ad..d5f4dc6 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 _0xff55=['type','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','sort','pick','where','VIRTUAL','filter','merge','then','include','rows','catch','show','params','intersection','length','includeAll','options','create','body','find','getFields','findOne','order','FreshdeskField','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','send','map','FreshdeskConfiguration','rawAttributes','fieldName'];(function(_0x46111d,_0x5d286b){var _0xe82586=function(_0x39551b){while(--_0x39551b){_0x46111d['push'](_0x46111d['shift']());}};_0xe82586(++_0x5d286b);}(_0xff55,0x1d8));var _0x5ff5=function(_0x4c8303,_0x450ba6){_0x4c8303=_0x4c8303-0x0;var _0x230c9d=_0xff55[_0x4c8303];return _0x230c9d;};'use strict';var emlformat=require(_0x5ff5('0x0'));var rimraf=require(_0x5ff5('0x1'));var zipdir=require(_0x5ff5('0x2'));var jsonpatch=require(_0x5ff5('0x3'));var rp=require(_0x5ff5('0x4'));var moment=require('moment');var BPromise=require(_0x5ff5('0x5'));var Mustache=require(_0x5ff5('0x6'));var util=require(_0x5ff5('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5ff5('0x8'));var ejs=require(_0x5ff5('0x9'));var fs=require('fs');var fs_extra=require(_0x5ff5('0xa'));var _=require(_0x5ff5('0xb'));var squel=require(_0x5ff5('0xc'));var crypto=require(_0x5ff5('0xd'));var jsforce=require(_0x5ff5('0xe'));var deskjs=require(_0x5ff5('0xf'));var toCsv=require(_0x5ff5('0x8'));var querystring=require(_0x5ff5('0x10'));var Papa=require(_0x5ff5('0x11'));var Redis=require('ioredis');var authService=require(_0x5ff5('0x12'));var qs=require(_0x5ff5('0x13'));var as=require(_0x5ff5('0x14'));var hardwareService=require(_0x5ff5('0x15'));var logger=require(_0x5ff5('0x16'))(_0x5ff5('0x17'));var utils=require(_0x5ff5('0x18'));var config=require(_0x5ff5('0x19'));var licenseUtil=require(_0x5ff5('0x1a'));var db=require(_0x5ff5('0x1b'))['db'];function respondWithStatusCode(_0x4aacbc,_0x1a0412){_0x1a0412=_0x1a0412||0xcc;return function(_0x271f6d){if(_0x271f6d){return _0x4aacbc[_0x5ff5('0x1c')](_0x1a0412);}return _0x4aacbc[_0x5ff5('0x1d')](_0x1a0412)['end']();};}function respondWithResult(_0x44f2d7,_0x525ec9){_0x525ec9=_0x525ec9||0xc8;return function(_0x5b280a){if(_0x5b280a){return _0x44f2d7[_0x5ff5('0x1d')](_0x525ec9)[_0x5ff5('0x1e')](_0x5b280a);}};}function respondWithFilteredResult(_0x4b4452,_0x45d146){return function(_0x28b5b9){if(_0x28b5b9){var _0x2b1821=typeof _0x45d146[_0x5ff5('0x1f')]===_0x5ff5('0x20')&&typeof _0x45d146[_0x5ff5('0x21')]==='undefined';var _0xd5b1de=_0x28b5b9['count'];var _0x5f2326=_0x2b1821?0x0:_0x45d146[_0x5ff5('0x1f')];var _0x53314d=_0x2b1821?_0x28b5b9[_0x5ff5('0x22')]:_0x45d146[_0x5ff5('0x1f')]+_0x45d146[_0x5ff5('0x21')];var _0x4ba77c;if(_0x53314d>=_0xd5b1de){_0x53314d=_0xd5b1de;_0x4ba77c=0xc8;}else{_0x4ba77c=0xce;}_0x4b4452[_0x5ff5('0x1d')](_0x4ba77c);return _0x4b4452['set'](_0x5ff5('0x23'),_0x5f2326+'-'+_0x53314d+'/'+_0xd5b1de)[_0x5ff5('0x1e')](_0x28b5b9);}return null;};}function patchUpdates(_0x489475){return function(_0x1b5305){try{jsonpatch[_0x5ff5('0x24')](_0x1b5305,_0x489475,!![]);}catch(_0x1bff19){return BPromise[_0x5ff5('0x25')](_0x1bff19);}return _0x1b5305[_0x5ff5('0x26')]();};}function saveUpdates(_0x410d3c,_0x3c839e){return function(_0x1b3ae6){if(_0x1b3ae6){return _0x1b3ae6[_0x5ff5('0x27')](_0x410d3c)['then'](function(_0x1f0fdd){return _0x1f0fdd;});}return null;};}function removeEntity(_0x52f1c6,_0x23cb9d){return function(_0x30f9c0){if(_0x30f9c0){return _0x30f9c0[_0x5ff5('0x28')]()['then'](function(){_0x52f1c6[_0x5ff5('0x1d')](0xcc)[_0x5ff5('0x29')]();});}};}function handleEntityNotFound(_0xec4de8,_0x1c3225){return function(_0x36488f){if(!_0x36488f){_0xec4de8['sendStatus'](0x194);}return _0x36488f;};}function handleError(_0x541911,_0x3b1198){_0x3b1198=_0x3b1198||0x1f4;return function(_0x4565f1){logger[_0x5ff5('0x2a')](_0x4565f1[_0x5ff5('0x2b')]);if(_0x4565f1[_0x5ff5('0x2c')]){delete _0x4565f1[_0x5ff5('0x2c')];}_0x541911[_0x5ff5('0x1d')](_0x3b1198)[_0x5ff5('0x2d')](_0x4565f1);};}exports['index']=function(_0x3073b0,_0x4b8173){var _0x32b60d={},_0x7c2fdf={},_0x330e03={'count':0x0,'rows':[]};var _0x372d08=_[_0x5ff5('0x2e')](db[_0x5ff5('0x2f')][_0x5ff5('0x30')],function(_0x35ed9f){return{'name':_0x35ed9f[_0x5ff5('0x31')],'type':_0x35ed9f[_0x5ff5('0x32')]['key']};});_0x7c2fdf[_0x5ff5('0x33')]=_[_0x5ff5('0x2e')](_0x372d08,'name');_0x7c2fdf['query']=_[_0x5ff5('0x34')](_0x3073b0[_0x5ff5('0x35')]);_0x7c2fdf[_0x5ff5('0x36')]=_['intersection'](_0x7c2fdf[_0x5ff5('0x33')],_0x7c2fdf['query']);_0x32b60d[_0x5ff5('0x37')]=_['intersection'](_0x7c2fdf[_0x5ff5('0x33')],qs[_0x5ff5('0x38')](_0x3073b0[_0x5ff5('0x35')][_0x5ff5('0x38')]));_0x32b60d[_0x5ff5('0x37')]=_0x32b60d[_0x5ff5('0x37')]['length']?_0x32b60d['attributes']:_0x7c2fdf['model'];if(!_0x3073b0['query'][_0x5ff5('0x39')](_0x5ff5('0x3a'))){_0x32b60d[_0x5ff5('0x21')]=qs[_0x5ff5('0x21')](_0x3073b0[_0x5ff5('0x35')][_0x5ff5('0x21')]);_0x32b60d[_0x5ff5('0x1f')]=qs[_0x5ff5('0x1f')](_0x3073b0['query'][_0x5ff5('0x1f')]);}_0x32b60d['order']=qs[_0x5ff5('0x3b')](_0x3073b0[_0x5ff5('0x35')]['sort']);_0x32b60d['where']=qs[_0x5ff5('0x36')](_[_0x5ff5('0x3c')](_0x3073b0[_0x5ff5('0x35')],_0x7c2fdf[_0x5ff5('0x36')]),_0x372d08);if(_0x3073b0[_0x5ff5('0x35')]['filter']){_0x32b60d[_0x5ff5('0x3d')]=_['merge'](_0x32b60d[_0x5ff5('0x3d')],{'$or':_[_0x5ff5('0x2e')](_0x372d08,function(_0x55a4d2){if(_0x55a4d2[_0x5ff5('0x32')]!==_0x5ff5('0x3e')){var _0x3cbfff={};_0x3cbfff[_0x55a4d2[_0x5ff5('0x2c')]]={'$like':'%'+_0x3073b0[_0x5ff5('0x35')][_0x5ff5('0x3f')]+'%'};return _0x3cbfff;}})});}_0x32b60d=_[_0x5ff5('0x40')]({},_0x32b60d,_0x3073b0['options']);var _0x354135={'where':_0x32b60d['where']};return db[_0x5ff5('0x2f')][_0x5ff5('0x22')](_0x354135)[_0x5ff5('0x41')](function(_0x533ef0){_0x330e03[_0x5ff5('0x22')]=_0x533ef0;if(_0x3073b0['query']['includeAll']){_0x32b60d[_0x5ff5('0x42')]=[{'all':!![]}];}return db[_0x5ff5('0x2f')]['findAll'](_0x32b60d);})[_0x5ff5('0x41')](function(_0x363baf){_0x330e03[_0x5ff5('0x43')]=_0x363baf;return _0x330e03;})[_0x5ff5('0x41')](respondWithFilteredResult(_0x4b8173,_0x32b60d))[_0x5ff5('0x44')](handleError(_0x4b8173,null));};exports[_0x5ff5('0x45')]=function(_0x2e8e7e,_0x4d94b1){var _0x182282={'raw':![],'where':{'id':_0x2e8e7e[_0x5ff5('0x46')]['id']}},_0x41339a={};_0x41339a[_0x5ff5('0x33')]=_[_0x5ff5('0x34')](db[_0x5ff5('0x2f')][_0x5ff5('0x30')]);_0x41339a['query']=_[_0x5ff5('0x34')](_0x2e8e7e[_0x5ff5('0x35')]);_0x41339a[_0x5ff5('0x36')]=_[_0x5ff5('0x47')](_0x41339a[_0x5ff5('0x33')],_0x41339a[_0x5ff5('0x35')]);_0x182282[_0x5ff5('0x37')]=_[_0x5ff5('0x47')](_0x41339a[_0x5ff5('0x33')],qs[_0x5ff5('0x38')](_0x2e8e7e[_0x5ff5('0x35')][_0x5ff5('0x38')]));_0x182282['attributes']=_0x182282['attributes'][_0x5ff5('0x48')]?_0x182282[_0x5ff5('0x37')]:_0x41339a['model'];if(_0x2e8e7e['query'][_0x5ff5('0x49')]){_0x182282[_0x5ff5('0x42')]=[{'all':!![]}];}_0x182282=_[_0x5ff5('0x40')]({},_0x182282,_0x2e8e7e[_0x5ff5('0x4a')]);return db[_0x5ff5('0x2f')]['find'](_0x182282)[_0x5ff5('0x41')](handleEntityNotFound(_0x4d94b1,null))[_0x5ff5('0x41')](respondWithResult(_0x4d94b1,null))[_0x5ff5('0x44')](handleError(_0x4d94b1,null));};exports[_0x5ff5('0x4b')]=function(_0x3ec906,_0x9f60da){return db[_0x5ff5('0x2f')][_0x5ff5('0x4b')](_0x3ec906[_0x5ff5('0x4c')],{})['then'](respondWithResult(_0x9f60da,0xc9))[_0x5ff5('0x44')](handleError(_0x9f60da,null));};exports['update']=function(_0x3f25cb,_0x1097f8){if(_0x3f25cb[_0x5ff5('0x4c')]['id']){delete _0x3f25cb[_0x5ff5('0x4c')]['id'];}return db[_0x5ff5('0x2f')][_0x5ff5('0x4d')]({'where':{'id':_0x3f25cb[_0x5ff5('0x46')]['id']}})[_0x5ff5('0x41')](handleEntityNotFound(_0x1097f8,null))[_0x5ff5('0x41')](saveUpdates(_0x3f25cb[_0x5ff5('0x4c')],null))['then'](respondWithResult(_0x1097f8,null))[_0x5ff5('0x44')](handleError(_0x1097f8,null));};exports['destroy']=function(_0x2e785c,_0x3f48f3){return db[_0x5ff5('0x2f')]['find']({'where':{'id':_0x2e785c[_0x5ff5('0x46')]['id']}})[_0x5ff5('0x41')](handleEntityNotFound(_0x3f48f3,null))[_0x5ff5('0x41')](removeEntity(_0x3f48f3,null))[_0x5ff5('0x44')](handleError(_0x3f48f3,null));};exports[_0x5ff5('0x4e')]=function(_0x4bd1e7,_0x5580ef,_0x42c09d){var _0x398bd2={};var _0x14faab={};var _0x5e124d;var _0x24823f;return db['FreshdeskConfiguration'][_0x5ff5('0x4f')]({'where':{'id':_0x4bd1e7[_0x5ff5('0x46')]['id']}})[_0x5ff5('0x41')](handleEntityNotFound(_0x5580ef,null))[_0x5ff5('0x41')](function(_0x470461){if(_0x470461){_0x5e124d=_0x470461;_0x14faab[_0x5ff5('0x33')]=_[_0x5ff5('0x34')](db['FreshdeskField']['rawAttributes']);_0x14faab['query']=_['keys'](_0x4bd1e7[_0x5ff5('0x35')]);_0x14faab['filters']=_[_0x5ff5('0x47')](_0x14faab[_0x5ff5('0x33')],_0x14faab[_0x5ff5('0x35')]);_0x398bd2['attributes']=_[_0x5ff5('0x47')](_0x14faab[_0x5ff5('0x33')],qs[_0x5ff5('0x38')](_0x4bd1e7[_0x5ff5('0x35')][_0x5ff5('0x38')]));_0x398bd2[_0x5ff5('0x37')]=_0x398bd2[_0x5ff5('0x37')][_0x5ff5('0x48')]?_0x398bd2[_0x5ff5('0x37')]:_0x14faab[_0x5ff5('0x33')];_0x398bd2[_0x5ff5('0x50')]=qs[_0x5ff5('0x3b')](_0x4bd1e7[_0x5ff5('0x35')][_0x5ff5('0x3b')]);_0x398bd2[_0x5ff5('0x3d')]=qs[_0x5ff5('0x36')](_[_0x5ff5('0x3c')](_0x4bd1e7['query'],_0x14faab[_0x5ff5('0x36')]));if(_0x4bd1e7[_0x5ff5('0x35')][_0x5ff5('0x3f')]){_0x398bd2[_0x5ff5('0x3d')]=_[_0x5ff5('0x40')](_0x398bd2[_0x5ff5('0x3d')],{'$or':_[_0x5ff5('0x2e')](_0x398bd2[_0x5ff5('0x37')],function(_0x199b9e){var _0xe51de4={};_0xe51de4[_0x199b9e]={'$like':'%'+_0x4bd1e7[_0x5ff5('0x35')][_0x5ff5('0x3f')]+'%'};return _0xe51de4;})});}_0x398bd2=_[_0x5ff5('0x40')]({},_0x398bd2,_0x4bd1e7[_0x5ff5('0x4a')]);return _0x5e124d[_0x5ff5('0x4e')](_0x398bd2);}})['then'](function(_0x13cd59){if(_0x13cd59){_0x24823f=_0x13cd59[_0x5ff5('0x48')];if(!_0x4bd1e7[_0x5ff5('0x35')]['hasOwnProperty'](_0x5ff5('0x3a'))){_0x398bd2['limit']=qs[_0x5ff5('0x21')](_0x4bd1e7['query'][_0x5ff5('0x21')]);_0x398bd2[_0x5ff5('0x1f')]=qs['offset'](_0x4bd1e7[_0x5ff5('0x35')]['offset']);}return _0x5e124d['getFields'](_0x398bd2);}})['then'](function(_0xe221ca){if(_0xe221ca){return _0xe221ca?{'count':_0x24823f,'rows':_0xe221ca}:null;}})[_0x5ff5('0x41')](respondWithResult(_0x5580ef,null))[_0x5ff5('0x44')](handleError(_0x5580ef,null));};exports['getSubjects']=function(_0x1313d3,_0x27642a,_0x382bea){var _0x29a554={};var _0x11f210={};var _0x5104a1;var _0xea9237;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x1313d3['params']['id']}})[_0x5ff5('0x41')](handleEntityNotFound(_0x27642a,null))[_0x5ff5('0x41')](function(_0x38e15d){if(_0x38e15d){_0x5104a1=_0x38e15d;_0x11f210[_0x5ff5('0x33')]=_[_0x5ff5('0x34')](db[_0x5ff5('0x51')][_0x5ff5('0x30')]);_0x11f210['query']=_['keys'](_0x1313d3['query']);_0x11f210[_0x5ff5('0x36')]=_[_0x5ff5('0x47')](_0x11f210[_0x5ff5('0x33')],_0x11f210['query']);_0x29a554[_0x5ff5('0x37')]=_[_0x5ff5('0x47')](_0x11f210[_0x5ff5('0x33')],qs[_0x5ff5('0x38')](_0x1313d3[_0x5ff5('0x35')][_0x5ff5('0x38')]));_0x29a554[_0x5ff5('0x37')]=_0x29a554[_0x5ff5('0x37')]['length']?_0x29a554[_0x5ff5('0x37')]:_0x11f210['model'];_0x29a554[_0x5ff5('0x50')]=qs[_0x5ff5('0x3b')](_0x1313d3[_0x5ff5('0x35')][_0x5ff5('0x3b')]);_0x29a554[_0x5ff5('0x3d')]=qs['filters'](_[_0x5ff5('0x3c')](_0x1313d3[_0x5ff5('0x35')],_0x11f210[_0x5ff5('0x36')]));if(_0x1313d3[_0x5ff5('0x35')][_0x5ff5('0x3f')]){_0x29a554[_0x5ff5('0x3d')]=_[_0x5ff5('0x40')](_0x29a554['where'],{'$or':_['map'](_0x29a554['attributes'],function(_0x359162){var _0x321829={};_0x321829[_0x359162]={'$like':'%'+_0x1313d3['query'][_0x5ff5('0x3f')]+'%'};return _0x321829;})});}_0x29a554=_[_0x5ff5('0x40')]({},_0x29a554,_0x1313d3['options']);return _0x5104a1[_0x5ff5('0x52')](_0x29a554);}})[_0x5ff5('0x41')](function(_0x1974dc){if(_0x1974dc){_0xea9237=_0x1974dc['length'];if(!_0x1313d3[_0x5ff5('0x35')][_0x5ff5('0x39')](_0x5ff5('0x3a'))){_0x29a554[_0x5ff5('0x21')]=qs['limit'](_0x1313d3['query']['limit']);_0x29a554['offset']=qs['offset'](_0x1313d3[_0x5ff5('0x35')]['offset']);}return _0x5104a1[_0x5ff5('0x52')](_0x29a554);}})[_0x5ff5('0x41')](function(_0x389f60){if(_0x389f60){return _0x389f60?{'count':_0xea9237,'rows':_0x389f60}:null;}})[_0x5ff5('0x41')](respondWithResult(_0x27642a,null))[_0x5ff5('0x44')](handleError(_0x27642a,null));};exports[_0x5ff5('0x53')]=function(_0x36b363,_0x5241a3,_0x343e55){var _0x4fe556={};var _0x58d915={};var _0x4fbc59;var _0x1df6b9;return db[_0x5ff5('0x2f')][_0x5ff5('0x4f')]({'where':{'id':_0x36b363[_0x5ff5('0x46')]['id']}})['then'](handleEntityNotFound(_0x5241a3,null))[_0x5ff5('0x41')](function(_0x2c5915){if(_0x2c5915){_0x4fbc59=_0x2c5915;_0x58d915[_0x5ff5('0x33')]=_[_0x5ff5('0x34')](db[_0x5ff5('0x51')]['rawAttributes']);_0x58d915['query']=_[_0x5ff5('0x34')](_0x36b363[_0x5ff5('0x35')]);_0x58d915['filters']=_[_0x5ff5('0x47')](_0x58d915[_0x5ff5('0x33')],_0x58d915[_0x5ff5('0x35')]);_0x4fe556[_0x5ff5('0x37')]=_[_0x5ff5('0x47')](_0x58d915[_0x5ff5('0x33')],qs['fields'](_0x36b363[_0x5ff5('0x35')][_0x5ff5('0x38')]));_0x4fe556[_0x5ff5('0x37')]=_0x4fe556['attributes'][_0x5ff5('0x48')]?_0x4fe556[_0x5ff5('0x37')]:_0x58d915[_0x5ff5('0x33')];_0x4fe556[_0x5ff5('0x50')]=qs[_0x5ff5('0x3b')](_0x36b363['query'][_0x5ff5('0x3b')]);_0x4fe556[_0x5ff5('0x3d')]=qs[_0x5ff5('0x36')](_[_0x5ff5('0x3c')](_0x36b363['query'],_0x58d915[_0x5ff5('0x36')]));if(_0x36b363[_0x5ff5('0x35')][_0x5ff5('0x3f')]){_0x4fe556[_0x5ff5('0x3d')]=_[_0x5ff5('0x40')](_0x4fe556['where'],{'$or':_[_0x5ff5('0x2e')](_0x4fe556[_0x5ff5('0x37')],function(_0x4401a4){var _0x35f089={};_0x35f089[_0x4401a4]={'$like':'%'+_0x36b363['query'][_0x5ff5('0x3f')]+'%'};return _0x35f089;})});}_0x4fe556=_[_0x5ff5('0x40')]({},_0x4fe556,_0x36b363['options']);return _0x4fbc59[_0x5ff5('0x53')](_0x4fe556);}})[_0x5ff5('0x41')](function(_0x3f1cd1){if(_0x3f1cd1){_0x1df6b9=_0x3f1cd1['length'];if(!_0x36b363[_0x5ff5('0x35')]['hasOwnProperty'](_0x5ff5('0x3a'))){_0x4fe556[_0x5ff5('0x21')]=qs['limit'](_0x36b363[_0x5ff5('0x35')]['limit']);_0x4fe556[_0x5ff5('0x1f')]=qs['offset'](_0x36b363[_0x5ff5('0x35')][_0x5ff5('0x1f')]);}return _0x4fbc59[_0x5ff5('0x53')](_0x4fe556);}})[_0x5ff5('0x41')](function(_0x14ff84){if(_0x14ff84){return _0x14ff84?{'count':_0x1df6b9,'rows':_0x14ff84}:null;}})['then'](respondWithResult(_0x5241a3,null))[_0x5ff5('0x44')](handleError(_0x5241a3,null));};exports['getTags']=function(_0x11c042,_0xbb0bcd,_0x2afd8b){var _0x4ead04={};var _0x1fea3d={};var _0xce9b27;var _0x1c25bf;return db[_0x5ff5('0x2f')][_0x5ff5('0x4f')]({'where':{'id':_0x11c042[_0x5ff5('0x46')]['id']}})['then'](handleEntityNotFound(_0xbb0bcd,null))[_0x5ff5('0x41')](function(_0x3e4b8a){if(_0x3e4b8a){_0xce9b27=_0x3e4b8a;_0x1fea3d[_0x5ff5('0x33')]=_[_0x5ff5('0x34')](db['Tag'][_0x5ff5('0x30')]);_0x1fea3d[_0x5ff5('0x35')]=_['keys'](_0x11c042[_0x5ff5('0x35')]);_0x1fea3d[_0x5ff5('0x36')]=_[_0x5ff5('0x47')](_0x1fea3d[_0x5ff5('0x33')],_0x1fea3d[_0x5ff5('0x35')]);_0x4ead04[_0x5ff5('0x37')]=_[_0x5ff5('0x47')](_0x1fea3d['model'],qs[_0x5ff5('0x38')](_0x11c042[_0x5ff5('0x35')][_0x5ff5('0x38')]));_0x4ead04[_0x5ff5('0x37')]=_0x4ead04[_0x5ff5('0x37')][_0x5ff5('0x48')]?_0x4ead04[_0x5ff5('0x37')]:_0x1fea3d[_0x5ff5('0x33')];_0x4ead04[_0x5ff5('0x50')]=qs[_0x5ff5('0x3b')](_0x11c042[_0x5ff5('0x35')][_0x5ff5('0x3b')]);_0x4ead04[_0x5ff5('0x3d')]=qs[_0x5ff5('0x36')](_[_0x5ff5('0x3c')](_0x11c042[_0x5ff5('0x35')],_0x1fea3d[_0x5ff5('0x36')]));if(_0x11c042[_0x5ff5('0x35')]['filter']){_0x4ead04['where']=_['merge'](_0x4ead04[_0x5ff5('0x3d')],{'$or':_[_0x5ff5('0x2e')](_0x4ead04[_0x5ff5('0x37')],function(_0x53192c){var _0x2bcee4={};_0x2bcee4[_0x53192c]={'$like':'%'+_0x11c042[_0x5ff5('0x35')][_0x5ff5('0x3f')]+'%'};return _0x2bcee4;})});}_0x4ead04=_[_0x5ff5('0x40')]({},_0x4ead04,_0x11c042['options']);return _0xce9b27[_0x5ff5('0x54')](_0x4ead04);}})[_0x5ff5('0x41')](function(_0x20e8f1){if(_0x20e8f1){_0x1c25bf=_0x20e8f1['length'];if(!_0x11c042[_0x5ff5('0x35')][_0x5ff5('0x39')]('nolimit')){_0x4ead04['limit']=qs[_0x5ff5('0x21')](_0x11c042[_0x5ff5('0x35')][_0x5ff5('0x21')]);_0x4ead04[_0x5ff5('0x1f')]=qs[_0x5ff5('0x1f')](_0x11c042[_0x5ff5('0x35')][_0x5ff5('0x1f')]);}return _0xce9b27['getTags'](_0x4ead04);}})[_0x5ff5('0x41')](function(_0x89cb1f){if(_0x89cb1f){return _0x89cb1f?{'count':_0x1c25bf,'rows':_0x89cb1f}:null;}})[_0x5ff5('0x41')](respondWithResult(_0xbb0bcd,null))['catch'](handleError(_0xbb0bcd,null));};exports[_0x5ff5('0x55')]=function(_0x34d978,_0x1633e,_0x31456f){if(_0x34d978[_0x5ff5('0x4c')]['id']){delete _0x34d978[_0x5ff5('0x4c')]['id'];}return db[_0x5ff5('0x2f')][_0x5ff5('0x4f')]({'where':{'id':_0x34d978[_0x5ff5('0x46')]['id']}})[_0x5ff5('0x41')](handleEntityNotFound(_0x1633e,null))['then'](function(_0x192f80){if(_0x192f80){return _0x192f80[_0x5ff5('0x55')](_0x34d978[_0x5ff5('0x4c')][_0x5ff5('0x56')]||[]);}return null;})[_0x5ff5('0x41')](respondWithResult(_0x1633e,null))[_0x5ff5('0x44')](handleError(_0x1633e,null));}; \ No newline at end of file +var _0x8b77=['getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','filter','merge','type','VIRTUAL','options','where','findAll','rows','catch','show','params','find','create','body','getFields','findOne','FreshdeskField','nolimit','pick'];(function(_0x52d8d3,_0x32e28b){var _0x46d478=function(_0x22dab6){while(--_0x22dab6){_0x52d8d3['push'](_0x52d8d3['shift']());}};_0x46d478(++_0x32e28b);}(_0x8b77,0xf9));var _0x78b7=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x8b77[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x78b7('0x0'));var rimraf=require(_0x78b7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x78b7('0x2'));var moment=require(_0x78b7('0x3'));var BPromise=require(_0x78b7('0x4'));var Mustache=require(_0x78b7('0x5'));var util=require(_0x78b7('0x6'));var path=require('path');var sox=require(_0x78b7('0x7'));var csv=require(_0x78b7('0x8'));var ejs=require(_0x78b7('0x9'));var fs=require('fs');var fs_extra=require(_0x78b7('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x78b7('0xb'));var jsforce=require(_0x78b7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x78b7('0x8'));var querystring=require(_0x78b7('0xd'));var Papa=require(_0x78b7('0xe'));var Redis=require(_0x78b7('0xf'));var authService=require(_0x78b7('0x10'));var qs=require(_0x78b7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x78b7('0x12'));var logger=require(_0x78b7('0x13'))(_0x78b7('0x14'));var utils=require('../../config/utils');var config=require(_0x78b7('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43384d,_0x4132b9){_0x4132b9=_0x4132b9||0xcc;return function(_0xeb71de){if(_0xeb71de){return _0x43384d[_0x78b7('0x16')](_0x4132b9);}return _0x43384d[_0x78b7('0x17')](_0x4132b9)[_0x78b7('0x18')]();};}function respondWithResult(_0x2e126c,_0x1087b0){_0x1087b0=_0x1087b0||0xc8;return function(_0x5454c4){if(_0x5454c4){return _0x2e126c[_0x78b7('0x17')](_0x1087b0)[_0x78b7('0x19')](_0x5454c4);}};}function respondWithFilteredResult(_0x178c62,_0x1811c8){return function(_0x47174b){if(_0x47174b){var _0x12e9b2=typeof _0x1811c8[_0x78b7('0x1a')]==='undefined'&&typeof _0x1811c8[_0x78b7('0x1b')]===_0x78b7('0x1c');var _0x120739=_0x47174b[_0x78b7('0x1d')];var _0x25f78c=_0x12e9b2?0x0:_0x1811c8[_0x78b7('0x1a')];var _0x2110ba=_0x12e9b2?_0x47174b[_0x78b7('0x1d')]:_0x1811c8[_0x78b7('0x1a')]+_0x1811c8[_0x78b7('0x1b')];var _0x4090e6;if(_0x2110ba>=_0x120739){_0x2110ba=_0x120739;_0x4090e6=0xc8;}else{_0x4090e6=0xce;}_0x178c62['status'](_0x4090e6);return _0x178c62[_0x78b7('0x1e')](_0x78b7('0x1f'),_0x25f78c+'-'+_0x2110ba+'/'+_0x120739)[_0x78b7('0x19')](_0x47174b);}return null;};}function patchUpdates(_0xe33ef9){return function(_0x12d715){try{jsonpatch[_0x78b7('0x20')](_0x12d715,_0xe33ef9,!![]);}catch(_0x2fb550){return BPromise[_0x78b7('0x21')](_0x2fb550);}return _0x12d715[_0x78b7('0x22')]();};}function saveUpdates(_0x50772b,_0x411c56){return function(_0xca9486){if(_0xca9486){return _0xca9486[_0x78b7('0x23')](_0x50772b)['then'](function(_0x4c4b89){return _0x4c4b89;});}return null;};}function removeEntity(_0x13f28d,_0x24e649){return function(_0x273a78){if(_0x273a78){return _0x273a78[_0x78b7('0x24')]()[_0x78b7('0x25')](function(){_0x13f28d['status'](0xcc)[_0x78b7('0x18')]();});}};}function handleEntityNotFound(_0x3716a3,_0x4b1152){return function(_0x1cbb38){if(!_0x1cbb38){_0x3716a3[_0x78b7('0x16')](0x194);}return _0x1cbb38;};}function handleError(_0xceaf7d,_0x17160d){_0x17160d=_0x17160d||0x1f4;return function(_0x10afe9){logger['error'](_0x10afe9['stack']);if(_0x10afe9[_0x78b7('0x26')]){delete _0x10afe9[_0x78b7('0x26')];}_0xceaf7d['status'](_0x17160d)[_0x78b7('0x27')](_0x10afe9);};}exports[_0x78b7('0x28')]=function(_0x4543de,_0x32b778){var _0xd9d77e={},_0x1a911d={},_0x753a1a={'count':0x0,'rows':[]};var _0x3d420f=_[_0x78b7('0x29')](db[_0x78b7('0x2a')][_0x78b7('0x2b')],function(_0x546bc2){return{'name':_0x546bc2[_0x78b7('0x2c')],'type':_0x546bc2['type']['key']};});_0x1a911d[_0x78b7('0x2d')]=_[_0x78b7('0x29')](_0x3d420f,_0x78b7('0x26'));_0x1a911d[_0x78b7('0x2e')]=_[_0x78b7('0x2f')](_0x4543de[_0x78b7('0x2e')]);_0x1a911d[_0x78b7('0x30')]=_['intersection'](_0x1a911d['model'],_0x1a911d[_0x78b7('0x2e')]);_0xd9d77e[_0x78b7('0x31')]=_[_0x78b7('0x32')](_0x1a911d[_0x78b7('0x2d')],qs[_0x78b7('0x33')](_0x4543de[_0x78b7('0x2e')][_0x78b7('0x33')]));_0xd9d77e[_0x78b7('0x31')]=_0xd9d77e[_0x78b7('0x31')][_0x78b7('0x34')]?_0xd9d77e[_0x78b7('0x31')]:_0x1a911d['model'];if(!_0x4543de[_0x78b7('0x2e')][_0x78b7('0x35')]('nolimit')){_0xd9d77e['limit']=qs[_0x78b7('0x1b')](_0x4543de[_0x78b7('0x2e')]['limit']);_0xd9d77e[_0x78b7('0x1a')]=qs[_0x78b7('0x1a')](_0x4543de[_0x78b7('0x2e')]['offset']);}_0xd9d77e[_0x78b7('0x36')]=qs[_0x78b7('0x37')](_0x4543de[_0x78b7('0x2e')][_0x78b7('0x37')]);_0xd9d77e['where']=qs[_0x78b7('0x30')](_['pick'](_0x4543de[_0x78b7('0x2e')],_0x1a911d['filters']),_0x3d420f);if(_0x4543de[_0x78b7('0x2e')][_0x78b7('0x38')]){_0xd9d77e['where']=_[_0x78b7('0x39')](_0xd9d77e['where'],{'$or':_[_0x78b7('0x29')](_0x3d420f,function(_0x5f0e0a){if(_0x5f0e0a[_0x78b7('0x3a')]!==_0x78b7('0x3b')){var _0x5caa33={};_0x5caa33[_0x5f0e0a['name']]={'$like':'%'+_0x4543de[_0x78b7('0x2e')][_0x78b7('0x38')]+'%'};return _0x5caa33;}})});}_0xd9d77e=_['merge']({},_0xd9d77e,_0x4543de[_0x78b7('0x3c')]);var _0x4cee55={'where':_0xd9d77e[_0x78b7('0x3d')]};return db[_0x78b7('0x2a')][_0x78b7('0x1d')](_0x4cee55)[_0x78b7('0x25')](function(_0x315afe){_0x753a1a[_0x78b7('0x1d')]=_0x315afe;if(_0x4543de[_0x78b7('0x2e')]['includeAll']){_0xd9d77e['include']=[{'all':!![]}];}return db[_0x78b7('0x2a')][_0x78b7('0x3e')](_0xd9d77e);})[_0x78b7('0x25')](function(_0x1bc051){_0x753a1a[_0x78b7('0x3f')]=_0x1bc051;return _0x753a1a;})[_0x78b7('0x25')](respondWithFilteredResult(_0x32b778,_0xd9d77e))[_0x78b7('0x40')](handleError(_0x32b778,null));};exports[_0x78b7('0x41')]=function(_0x5a172f,_0x3ccb1a){var _0x17ab39={'raw':![],'where':{'id':_0x5a172f[_0x78b7('0x42')]['id']}},_0x4aea0a={};_0x4aea0a['model']=_[_0x78b7('0x2f')](db[_0x78b7('0x2a')][_0x78b7('0x2b')]);_0x4aea0a[_0x78b7('0x2e')]=_[_0x78b7('0x2f')](_0x5a172f[_0x78b7('0x2e')]);_0x4aea0a[_0x78b7('0x30')]=_[_0x78b7('0x32')](_0x4aea0a[_0x78b7('0x2d')],_0x4aea0a[_0x78b7('0x2e')]);_0x17ab39[_0x78b7('0x31')]=_[_0x78b7('0x32')](_0x4aea0a[_0x78b7('0x2d')],qs[_0x78b7('0x33')](_0x5a172f[_0x78b7('0x2e')][_0x78b7('0x33')]));_0x17ab39['attributes']=_0x17ab39[_0x78b7('0x31')]['length']?_0x17ab39[_0x78b7('0x31')]:_0x4aea0a[_0x78b7('0x2d')];if(_0x5a172f['query']['includeAll']){_0x17ab39['include']=[{'all':!![]}];}_0x17ab39=_[_0x78b7('0x39')]({},_0x17ab39,_0x5a172f[_0x78b7('0x3c')]);return db['FreshdeskConfiguration'][_0x78b7('0x43')](_0x17ab39)[_0x78b7('0x25')](handleEntityNotFound(_0x3ccb1a,null))[_0x78b7('0x25')](respondWithResult(_0x3ccb1a,null))[_0x78b7('0x40')](handleError(_0x3ccb1a,null));};exports[_0x78b7('0x44')]=function(_0x2c551d,_0x529629){return db[_0x78b7('0x2a')][_0x78b7('0x44')](_0x2c551d[_0x78b7('0x45')],{})['then'](respondWithResult(_0x529629,0xc9))[_0x78b7('0x40')](handleError(_0x529629,null));};exports[_0x78b7('0x23')]=function(_0x3b1813,_0x3a95a1){if(_0x3b1813[_0x78b7('0x45')]['id']){delete _0x3b1813[_0x78b7('0x45')]['id'];}return db['FreshdeskConfiguration'][_0x78b7('0x43')]({'where':{'id':_0x3b1813[_0x78b7('0x42')]['id']}})[_0x78b7('0x25')](handleEntityNotFound(_0x3a95a1,null))[_0x78b7('0x25')](saveUpdates(_0x3b1813[_0x78b7('0x45')],null))[_0x78b7('0x25')](respondWithResult(_0x3a95a1,null))[_0x78b7('0x40')](handleError(_0x3a95a1,null));};exports[_0x78b7('0x24')]=function(_0x13e45b,_0x4823ac){return db[_0x78b7('0x2a')][_0x78b7('0x43')]({'where':{'id':_0x13e45b[_0x78b7('0x42')]['id']}})['then'](handleEntityNotFound(_0x4823ac,null))[_0x78b7('0x25')](removeEntity(_0x4823ac,null))[_0x78b7('0x40')](handleError(_0x4823ac,null));};exports[_0x78b7('0x46')]=function(_0x37248f,_0xb7dff6,_0x1942a9){var _0x252265={};var _0x1c8667={};var _0x6a2881;var _0x19712e;return db['FreshdeskConfiguration'][_0x78b7('0x47')]({'where':{'id':_0x37248f[_0x78b7('0x42')]['id']}})['then'](handleEntityNotFound(_0xb7dff6,null))[_0x78b7('0x25')](function(_0x1bf080){if(_0x1bf080){_0x6a2881=_0x1bf080;_0x1c8667[_0x78b7('0x2d')]=_[_0x78b7('0x2f')](db[_0x78b7('0x48')][_0x78b7('0x2b')]);_0x1c8667[_0x78b7('0x2e')]=_[_0x78b7('0x2f')](_0x37248f[_0x78b7('0x2e')]);_0x1c8667[_0x78b7('0x30')]=_[_0x78b7('0x32')](_0x1c8667[_0x78b7('0x2d')],_0x1c8667[_0x78b7('0x2e')]);_0x252265[_0x78b7('0x31')]=_['intersection'](_0x1c8667['model'],qs['fields'](_0x37248f[_0x78b7('0x2e')][_0x78b7('0x33')]));_0x252265[_0x78b7('0x31')]=_0x252265[_0x78b7('0x31')][_0x78b7('0x34')]?_0x252265['attributes']:_0x1c8667[_0x78b7('0x2d')];_0x252265[_0x78b7('0x36')]=qs['sort'](_0x37248f['query'][_0x78b7('0x37')]);_0x252265[_0x78b7('0x3d')]=qs['filters'](_['pick'](_0x37248f['query'],_0x1c8667['filters']));if(_0x37248f['query']['filter']){_0x252265[_0x78b7('0x3d')]=_[_0x78b7('0x39')](_0x252265[_0x78b7('0x3d')],{'$or':_['map'](_0x252265['attributes'],function(_0x478224){var _0x1180f6={};_0x1180f6[_0x478224]={'$like':'%'+_0x37248f['query'][_0x78b7('0x38')]+'%'};return _0x1180f6;})});}_0x252265=_[_0x78b7('0x39')]({},_0x252265,_0x37248f[_0x78b7('0x3c')]);return _0x6a2881['getFields'](_0x252265);}})[_0x78b7('0x25')](function(_0x1a57bd){if(_0x1a57bd){_0x19712e=_0x1a57bd[_0x78b7('0x34')];if(!_0x37248f['query']['hasOwnProperty'](_0x78b7('0x49'))){_0x252265[_0x78b7('0x1b')]=qs[_0x78b7('0x1b')](_0x37248f[_0x78b7('0x2e')][_0x78b7('0x1b')]);_0x252265[_0x78b7('0x1a')]=qs[_0x78b7('0x1a')](_0x37248f[_0x78b7('0x2e')][_0x78b7('0x1a')]);}return _0x6a2881['getFields'](_0x252265);}})['then'](function(_0x269409){if(_0x269409){return _0x269409?{'count':_0x19712e,'rows':_0x269409}:null;}})[_0x78b7('0x25')](respondWithResult(_0xb7dff6,null))[_0x78b7('0x40')](handleError(_0xb7dff6,null));};exports['getSubjects']=function(_0x138a54,_0x3ff393,_0x39ea16){var _0x1a0f2c={};var _0x24e9f7={};var _0x4adf0e;var _0xd3a63d;return db[_0x78b7('0x2a')][_0x78b7('0x47')]({'where':{'id':_0x138a54[_0x78b7('0x42')]['id']}})[_0x78b7('0x25')](handleEntityNotFound(_0x3ff393,null))[_0x78b7('0x25')](function(_0x356dc){if(_0x356dc){_0x4adf0e=_0x356dc;_0x24e9f7['model']=_[_0x78b7('0x2f')](db[_0x78b7('0x48')]['rawAttributes']);_0x24e9f7[_0x78b7('0x2e')]=_[_0x78b7('0x2f')](_0x138a54[_0x78b7('0x2e')]);_0x24e9f7[_0x78b7('0x30')]=_[_0x78b7('0x32')](_0x24e9f7[_0x78b7('0x2d')],_0x24e9f7[_0x78b7('0x2e')]);_0x1a0f2c[_0x78b7('0x31')]=_[_0x78b7('0x32')](_0x24e9f7[_0x78b7('0x2d')],qs[_0x78b7('0x33')](_0x138a54[_0x78b7('0x2e')][_0x78b7('0x33')]));_0x1a0f2c[_0x78b7('0x31')]=_0x1a0f2c[_0x78b7('0x31')][_0x78b7('0x34')]?_0x1a0f2c[_0x78b7('0x31')]:_0x24e9f7[_0x78b7('0x2d')];_0x1a0f2c[_0x78b7('0x36')]=qs[_0x78b7('0x37')](_0x138a54[_0x78b7('0x2e')]['sort']);_0x1a0f2c[_0x78b7('0x3d')]=qs['filters'](_[_0x78b7('0x4a')](_0x138a54[_0x78b7('0x2e')],_0x24e9f7[_0x78b7('0x30')]));if(_0x138a54[_0x78b7('0x2e')]['filter']){_0x1a0f2c[_0x78b7('0x3d')]=_[_0x78b7('0x39')](_0x1a0f2c['where'],{'$or':_['map'](_0x1a0f2c[_0x78b7('0x31')],function(_0x1bbd96){var _0xa032f4={};_0xa032f4[_0x1bbd96]={'$like':'%'+_0x138a54[_0x78b7('0x2e')]['filter']+'%'};return _0xa032f4;})});}_0x1a0f2c=_[_0x78b7('0x39')]({},_0x1a0f2c,_0x138a54['options']);return _0x4adf0e[_0x78b7('0x4b')](_0x1a0f2c);}})[_0x78b7('0x25')](function(_0x1ff796){if(_0x1ff796){_0xd3a63d=_0x1ff796[_0x78b7('0x34')];if(!_0x138a54[_0x78b7('0x2e')]['hasOwnProperty'](_0x78b7('0x49'))){_0x1a0f2c[_0x78b7('0x1b')]=qs[_0x78b7('0x1b')](_0x138a54[_0x78b7('0x2e')][_0x78b7('0x1b')]);_0x1a0f2c[_0x78b7('0x1a')]=qs[_0x78b7('0x1a')](_0x138a54[_0x78b7('0x2e')]['offset']);}return _0x4adf0e[_0x78b7('0x4b')](_0x1a0f2c);}})['then'](function(_0xc26aa2){if(_0xc26aa2){return _0xc26aa2?{'count':_0xd3a63d,'rows':_0xc26aa2}:null;}})[_0x78b7('0x25')](respondWithResult(_0x3ff393,null))['catch'](handleError(_0x3ff393,null));};exports['getDescriptions']=function(_0x1e85b2,_0x54027d,_0x151942){var _0xc125d1={};var _0x55c954={};var _0x981355;var _0x101e5b;return db[_0x78b7('0x2a')][_0x78b7('0x47')]({'where':{'id':_0x1e85b2['params']['id']}})[_0x78b7('0x25')](handleEntityNotFound(_0x54027d,null))[_0x78b7('0x25')](function(_0x232289){if(_0x232289){_0x981355=_0x232289;_0x55c954[_0x78b7('0x2d')]=_[_0x78b7('0x2f')](db[_0x78b7('0x48')][_0x78b7('0x2b')]);_0x55c954[_0x78b7('0x2e')]=_['keys'](_0x1e85b2[_0x78b7('0x2e')]);_0x55c954[_0x78b7('0x30')]=_[_0x78b7('0x32')](_0x55c954[_0x78b7('0x2d')],_0x55c954['query']);_0xc125d1[_0x78b7('0x31')]=_['intersection'](_0x55c954[_0x78b7('0x2d')],qs['fields'](_0x1e85b2['query']['fields']));_0xc125d1[_0x78b7('0x31')]=_0xc125d1[_0x78b7('0x31')][_0x78b7('0x34')]?_0xc125d1[_0x78b7('0x31')]:_0x55c954['model'];_0xc125d1[_0x78b7('0x36')]=qs['sort'](_0x1e85b2[_0x78b7('0x2e')][_0x78b7('0x37')]);_0xc125d1[_0x78b7('0x3d')]=qs[_0x78b7('0x30')](_[_0x78b7('0x4a')](_0x1e85b2[_0x78b7('0x2e')],_0x55c954[_0x78b7('0x30')]));if(_0x1e85b2[_0x78b7('0x2e')][_0x78b7('0x38')]){_0xc125d1[_0x78b7('0x3d')]=_['merge'](_0xc125d1[_0x78b7('0x3d')],{'$or':_[_0x78b7('0x29')](_0xc125d1[_0x78b7('0x31')],function(_0x129291){var _0x8dfa45={};_0x8dfa45[_0x129291]={'$like':'%'+_0x1e85b2['query'][_0x78b7('0x38')]+'%'};return _0x8dfa45;})});}_0xc125d1=_[_0x78b7('0x39')]({},_0xc125d1,_0x1e85b2[_0x78b7('0x3c')]);return _0x981355[_0x78b7('0x4c')](_0xc125d1);}})['then'](function(_0x54524c){if(_0x54524c){_0x101e5b=_0x54524c[_0x78b7('0x34')];if(!_0x1e85b2[_0x78b7('0x2e')][_0x78b7('0x35')](_0x78b7('0x49'))){_0xc125d1[_0x78b7('0x1b')]=qs['limit'](_0x1e85b2[_0x78b7('0x2e')][_0x78b7('0x1b')]);_0xc125d1[_0x78b7('0x1a')]=qs['offset'](_0x1e85b2[_0x78b7('0x2e')][_0x78b7('0x1a')]);}return _0x981355[_0x78b7('0x4c')](_0xc125d1);}})['then'](function(_0x111663){if(_0x111663){return _0x111663?{'count':_0x101e5b,'rows':_0x111663}:null;}})[_0x78b7('0x25')](respondWithResult(_0x54027d,null))[_0x78b7('0x40')](handleError(_0x54027d,null));};exports[_0x78b7('0x4d')]=function(_0x1a26e7,_0x3b90d5,_0x49bc5c){var _0x2b88b3={};var _0x107711={};var _0x51811f;var _0x290e52;return db[_0x78b7('0x2a')]['findOne']({'where':{'id':_0x1a26e7[_0x78b7('0x42')]['id']}})[_0x78b7('0x25')](handleEntityNotFound(_0x3b90d5,null))['then'](function(_0x4bd1be){if(_0x4bd1be){_0x51811f=_0x4bd1be;_0x107711[_0x78b7('0x2d')]=_['keys'](db[_0x78b7('0x4e')][_0x78b7('0x2b')]);_0x107711['query']=_[_0x78b7('0x2f')](_0x1a26e7[_0x78b7('0x2e')]);_0x107711[_0x78b7('0x30')]=_[_0x78b7('0x32')](_0x107711[_0x78b7('0x2d')],_0x107711[_0x78b7('0x2e')]);_0x2b88b3['attributes']=_[_0x78b7('0x32')](_0x107711['model'],qs['fields'](_0x1a26e7[_0x78b7('0x2e')][_0x78b7('0x33')]));_0x2b88b3['attributes']=_0x2b88b3[_0x78b7('0x31')][_0x78b7('0x34')]?_0x2b88b3['attributes']:_0x107711['model'];_0x2b88b3[_0x78b7('0x36')]=qs[_0x78b7('0x37')](_0x1a26e7['query'][_0x78b7('0x37')]);_0x2b88b3[_0x78b7('0x3d')]=qs['filters'](_[_0x78b7('0x4a')](_0x1a26e7[_0x78b7('0x2e')],_0x107711[_0x78b7('0x30')]));if(_0x1a26e7[_0x78b7('0x2e')][_0x78b7('0x38')]){_0x2b88b3[_0x78b7('0x3d')]=_[_0x78b7('0x39')](_0x2b88b3[_0x78b7('0x3d')],{'$or':_[_0x78b7('0x29')](_0x2b88b3[_0x78b7('0x31')],function(_0x68ce1c){var _0x31b154={};_0x31b154[_0x68ce1c]={'$like':'%'+_0x1a26e7[_0x78b7('0x2e')][_0x78b7('0x38')]+'%'};return _0x31b154;})});}_0x2b88b3=_[_0x78b7('0x39')]({},_0x2b88b3,_0x1a26e7['options']);return _0x51811f['getTags'](_0x2b88b3);}})[_0x78b7('0x25')](function(_0xfc85a7){if(_0xfc85a7){_0x290e52=_0xfc85a7['length'];if(!_0x1a26e7[_0x78b7('0x2e')][_0x78b7('0x35')](_0x78b7('0x49'))){_0x2b88b3[_0x78b7('0x1b')]=qs[_0x78b7('0x1b')](_0x1a26e7[_0x78b7('0x2e')][_0x78b7('0x1b')]);_0x2b88b3['offset']=qs[_0x78b7('0x1a')](_0x1a26e7[_0x78b7('0x2e')]['offset']);}return _0x51811f[_0x78b7('0x4d')](_0x2b88b3);}})[_0x78b7('0x25')](function(_0x7f8dd4){if(_0x7f8dd4){return _0x7f8dd4?{'count':_0x290e52,'rows':_0x7f8dd4}:null;}})[_0x78b7('0x25')](respondWithResult(_0x3b90d5,null))['catch'](handleError(_0x3b90d5,null));};exports[_0x78b7('0x4f')]=function(_0x13f32b,_0x5a8405,_0x2b87b2){if(_0x13f32b[_0x78b7('0x45')]['id']){delete _0x13f32b[_0x78b7('0x45')]['id'];}return db[_0x78b7('0x2a')][_0x78b7('0x47')]({'where':{'id':_0x13f32b[_0x78b7('0x42')]['id']}})[_0x78b7('0x25')](handleEntityNotFound(_0x5a8405,null))['then'](function(_0x115ef6){if(_0x115ef6){return _0x115ef6[_0x78b7('0x4f')](_0x13f32b[_0x78b7('0x45')][_0x78b7('0x50')]||[]);}return null;})['then'](respondWithResult(_0x5a8405,null))[_0x78b7('0x40')](handleError(_0x5a8405,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 3225ad0..56686ad 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 _0x21dd=['bluebird','request-promise','path','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x5709ba,_0x3351cd){var _0x5ae8a2=function(_0x3b9c8d){while(--_0x3b9c8d){_0x5709ba['push'](_0x5709ba['shift']());}};_0x5ae8a2(++_0x3351cd);}(_0x21dd,0x1b5));var _0xd21d=function(_0x3503b1,_0x36c827){_0x3503b1=_0x3503b1-0x0;var _0x27d413=_0x21dd[_0x3503b1];return _0x27d413;};'use strict';var _=require(_0xd21d('0x0'));var util=require(_0xd21d('0x1'));var logger=require(_0xd21d('0x2'))(_0xd21d('0x3'));var moment=require(_0xd21d('0x4'));var BPromise=require(_0xd21d('0x5'));var rp=require(_0xd21d('0x6'));var fs=require('fs');var path=require(_0xd21d('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd21d('0x8'));module[_0xd21d('0x9')]=function(_0x543c42,_0x3f814d){return _0x543c42[_0xd21d('0xa')](_0xd21d('0xb'),attributes,{'tableName':_0xd21d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9b49=['exports','lodash','../../config/logger','api','moment','path','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9b49,0x12e));var _0x99b4=function(_0x718f1f,_0x2e2338){_0x718f1f=_0x718f1f-0x0;var _0x48b289=_0x9b49[_0x718f1f];return _0x48b289;};'use strict';var _=require(_0x99b4('0x0'));var util=require('util');var logger=require(_0x99b4('0x1'))(_0x99b4('0x2'));var moment=require(_0x99b4('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x99b4('0x4'));var rimraf=require('rimraf');var config=require(_0x99b4('0x5'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x99b4('0x6')]=function(_0x3c2a19,_0x5f43c4){return _0x3c2a19['define']('FreshdeskConfiguration',attributes,{'tableName':'int_freshdesk_configurations','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 0358e56..0eaf540 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 _0x8868=['client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8868,0x70));var _0x8886=function(_0x4d78f7,_0x199bc9){_0x4d78f7=_0x4d78f7-0x0;var _0x2dfa52=_0x8868[_0x4d78f7];return _0x2dfa52;};'use strict';var _=require(_0x8886('0x0'));var util=require('util');var moment=require(_0x8886('0x1'));var BPromise=require(_0x8886('0x2'));var rs=require(_0x8886('0x3'));var fs=require('fs');var Redis=require(_0x8886('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8886('0x5'))('rpc');var config=require(_0x8886('0x6'));var jayson=require(_0x8886('0x7'));var client=jayson[_0x8886('0x8')][_0x8886('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d86f6,_0x5a89bc,_0x341090){return new BPromise(function(_0xe0b9c,_0x260a7e){return client[_0x8886('0xa')](_0x2d86f6,_0x341090)[_0x8886('0xb')](function(_0x34992a){logger[_0x8886('0xc')](_0x8886('0xd'),_0x5a89bc,_0x8886('0xe'));logger[_0x8886('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5a89bc,'request\x20sent',JSON['stringify'](_0x34992a));if(_0x34992a[_0x8886('0x10')]){if(_0x34992a[_0x8886('0x10')]['code']===0x1f4){logger['error'](_0x8886('0xd'),_0x5a89bc,_0x34992a['error'][_0x8886('0x11')]);return _0x260a7e(_0x34992a[_0x8886('0x10')]['message']);}logger[_0x8886('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5a89bc,_0x34992a[_0x8886('0x10')][_0x8886('0x11')]);return _0xe0b9c(_0x34992a[_0x8886('0x10')][_0x8886('0x11')]);}else{logger[_0x8886('0xc')](_0x8886('0xd'),_0x5a89bc,_0x8886('0xe'));_0xe0b9c(_0x34992a[_0x8886('0x12')][_0x8886('0x11')]);}})[_0x8886('0x13')](function(_0x468696){logger[_0x8886('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5a89bc,_0x468696);_0x260a7e(_0x468696);});});} \ No newline at end of file +var _0xecaf=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x1005e1,_0x3a4bd0){var _0x1c53ca=function(_0x2cbbf1){while(--_0x2cbbf1){_0x1005e1['push'](_0x1005e1['shift']());}};_0x1c53ca(++_0x3a4bd0);}(_0xecaf,0x177));var _0xfeca=function(_0x171321,_0x500859){_0x171321=_0x171321-0x0;var _0x535236=_0xecaf[_0x171321];return _0x535236;};'use strict';var _=require(_0xfeca('0x0'));var util=require(_0xfeca('0x1'));var moment=require('moment');var BPromise=require(_0xfeca('0x2'));var rs=require(_0xfeca('0x3'));var fs=require('fs');var Redis=require(_0xfeca('0x4'));var db=require(_0xfeca('0x5'))['db'];var utils=require(_0xfeca('0x6'));var logger=require(_0xfeca('0x7'))(_0xfeca('0x8'));var config=require(_0xfeca('0x9'));var jayson=require(_0xfeca('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x368edb,_0x7f8f98,_0x3129c7){return new BPromise(function(_0x22e115,_0x3118d4){return client[_0xfeca('0xb')](_0x368edb,_0x3129c7)[_0xfeca('0xc')](function(_0x37df60){logger['info'](_0xfeca('0xd'),_0x7f8f98,_0xfeca('0xe'));logger['debug']('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x7f8f98,_0xfeca('0xe'),JSON[_0xfeca('0xf')](_0x37df60));if(_0x37df60['error']){if(_0x37df60[_0xfeca('0x10')][_0xfeca('0x11')]===0x1f4){logger[_0xfeca('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x7f8f98,_0x37df60[_0xfeca('0x10')][_0xfeca('0x12')]);return _0x3118d4(_0x37df60['error'][_0xfeca('0x12')]);}logger[_0xfeca('0x10')](_0xfeca('0xd'),_0x7f8f98,_0x37df60[_0xfeca('0x10')]['message']);return _0x22e115(_0x37df60[_0xfeca('0x10')][_0xfeca('0x12')]);}else{logger[_0xfeca('0x13')](_0xfeca('0xd'),_0x7f8f98,_0xfeca('0xe'));_0x22e115(_0x37df60[_0xfeca('0x14')][_0xfeca('0x12')]);}})[_0xfeca('0x15')](function(_0x3748d5){logger[_0xfeca('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x7f8f98,_0x3748d5);_0x3118d4(_0x3748d5);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 3c62522..d4b014d 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 _0x44d0=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4d5d28,_0x26bd9b){var _0x2026b1=function(_0x1fe42c){while(--_0x1fe42c){_0x4d5d28['push'](_0x4d5d28['shift']());}};_0x2026b1(++_0x26bd9b);}(_0x44d0,0x19d));var _0x044d=function(_0x464ed8,_0x1eec3a){_0x464ed8=_0x464ed8-0x0;var _0x5c253c=_0x44d0[_0x464ed8];return _0x5c253c;};'use strict';var multer=require(_0x044d('0x0'));var util=require(_0x044d('0x1'));var path=require(_0x044d('0x2'));var timeout=require(_0x044d('0x3'));var express=require(_0x044d('0x4'));var router=express[_0x044d('0x5')]();var fs_extra=require(_0x044d('0x6'));var auth=require(_0x044d('0x7'));var interaction=require(_0x044d('0x8'));var config=require(_0x044d('0x9'));var controller=require('./intFreshdeskField.controller');router[_0x044d('0xa')]('/',auth['isAuthenticated'](),controller[_0x044d('0xb')]);router[_0x044d('0xa')](_0x044d('0xc'),auth[_0x044d('0xd')](),controller[_0x044d('0xe')]);router[_0x044d('0xf')]('/',auth[_0x044d('0xd')](),controller[_0x044d('0x10')]);router[_0x044d('0x11')](_0x044d('0xc'),auth[_0x044d('0xd')](),controller['update']);router['delete'](_0x044d('0xc'),auth[_0x044d('0xd')](),controller[_0x044d('0x12')]);module[_0x044d('0x13')]=router; \ No newline at end of file +var _0x6a33=['destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','show','post','create','/:id','update','delete'];(function(_0x4bbaba,_0x15097c){var _0x34ff2b=function(_0x190d49){while(--_0x190d49){_0x4bbaba['push'](_0x4bbaba['shift']());}};_0x34ff2b(++_0x15097c);}(_0x6a33,0x158));var _0x36a3=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x6a33[_0x710815];return _0x5b3b89;};'use strict';var multer=require(_0x36a3('0x0'));var util=require('util');var path=require(_0x36a3('0x1'));var timeout=require(_0x36a3('0x2'));var express=require('express');var router=express[_0x36a3('0x3')]();var fs_extra=require(_0x36a3('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x36a3('0x5'));var controller=require(_0x36a3('0x6'));router[_0x36a3('0x7')]('/',auth[_0x36a3('0x8')](),controller[_0x36a3('0x9')]);router['get']('/:id',auth[_0x36a3('0x8')](),controller[_0x36a3('0xa')]);router[_0x36a3('0xb')]('/',auth[_0x36a3('0x8')](),controller[_0x36a3('0xc')]);router['put'](_0x36a3('0xd'),auth[_0x36a3('0x8')](),controller[_0x36a3('0xe')]);router[_0x36a3('0xf')](_0x36a3('0xd'),auth[_0x36a3('0x8')](),controller[_0x36a3('0x10')]);module[_0x36a3('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index cfb3be9..60a5a27 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 _0x6108=['picklist','STRING','BOOLEAN','exports','string','variable','customVariable','keyValue'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x6108,0x8b));var _0x8610=function(_0x2d4899,_0x4f72dc){_0x2d4899=_0x2d4899-0x0;var _0x593c1f=_0x6108[_0x2d4899];return _0x593c1f;};'use strict';var Sequelize=require('sequelize');module[_0x8610('0x0')]={'type':{'type':Sequelize['ENUM'](_0x8610('0x1'),_0x8610('0x2'),_0x8610('0x3'),_0x8610('0x4'),_0x8610('0x5')),'defaultValue':_0x8610('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8610('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x8610('0x1'),_0x8610('0x2'),_0x8610('0x3'))},'keyContent':{'type':Sequelize[_0x8610('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x8610('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1d11=['picklist','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue'];(function(_0x145594,_0x79a712){var _0x48e289=function(_0x14bfc5){while(--_0x14bfc5){_0x145594['push'](_0x145594['shift']());}};_0x48e289(++_0x79a712);}(_0x1d11,0x126));var _0x11d1=function(_0x235bd4,_0x4e773e){_0x235bd4=_0x235bd4-0x0;var _0x51fe32=_0x1d11[_0x235bd4];return _0x51fe32;};'use strict';var Sequelize=require(_0x11d1('0x0'));module[_0x11d1('0x1')]={'type':{'type':Sequelize[_0x11d1('0x2')](_0x11d1('0x3'),_0x11d1('0x4'),'customVariable',_0x11d1('0x5'),_0x11d1('0x6')),'defaultValue':_0x11d1('0x3')},'content':{'type':Sequelize[_0x11d1('0x7')]},'key':{'type':Sequelize[_0x11d1('0x7')]},'keyType':{'type':Sequelize[_0x11d1('0x2')](_0x11d1('0x3'),'variable',_0x11d1('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x11d1('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index a065ddf..83b40da 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 _0x0427=['attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','FreshdeskField','rows','catch','show','keys','includeAll','find','create','body','update','params','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','reject','save','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','fields'];(function(_0x1d2aad,_0x302640){var _0x5e1c91=function(_0xd968ee){while(--_0xd968ee){_0x1d2aad['push'](_0x1d2aad['shift']());}};_0x5e1c91(++_0x302640);}(_0x0427,0x137));var _0x7042=function(_0x507563,_0x26ac0a){_0x507563=_0x507563-0x0;var _0x19aa4c=_0x0427[_0x507563];return _0x19aa4c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7042('0x0'));var jsonpatch=require(_0x7042('0x1'));var rp=require('request-promise');var moment=require(_0x7042('0x2'));var BPromise=require(_0x7042('0x3'));var Mustache=require(_0x7042('0x4'));var util=require(_0x7042('0x5'));var path=require(_0x7042('0x6'));var sox=require(_0x7042('0x7'));var csv=require(_0x7042('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7042('0x9'));var _=require(_0x7042('0xa'));var squel=require(_0x7042('0xb'));var crypto=require(_0x7042('0xc'));var jsforce=require(_0x7042('0xd'));var deskjs=require(_0x7042('0xe'));var toCsv=require(_0x7042('0x8'));var querystring=require(_0x7042('0xf'));var Papa=require(_0x7042('0x10'));var Redis=require('ioredis');var authService=require(_0x7042('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7042('0x12'));var utils=require('../../config/utils');var config=require(_0x7042('0x13'));var licenseUtil=require(_0x7042('0x14'));var db=require(_0x7042('0x15'))['db'];function respondWithStatusCode(_0x5629f2,_0x5c06f0){_0x5c06f0=_0x5c06f0||0xcc;return function(_0x292c4a){if(_0x292c4a){return _0x5629f2[_0x7042('0x16')](_0x5c06f0);}return _0x5629f2[_0x7042('0x17')](_0x5c06f0)[_0x7042('0x18')]();};}function respondWithResult(_0x25dfe5,_0xee4c2){_0xee4c2=_0xee4c2||0xc8;return function(_0x5def25){if(_0x5def25){return _0x25dfe5[_0x7042('0x17')](_0xee4c2)[_0x7042('0x19')](_0x5def25);}};}function respondWithFilteredResult(_0x6ed505,_0x5c1ef0){return function(_0x4c68c4){if(_0x4c68c4){var _0xc7e44e=typeof _0x5c1ef0['offset']===_0x7042('0x1a')&&typeof _0x5c1ef0['limit']==='undefined';var _0x28add7=_0x4c68c4[_0x7042('0x1b')];var _0x1e69aa=_0xc7e44e?0x0:_0x5c1ef0[_0x7042('0x1c')];var _0x6e18fb=_0xc7e44e?_0x4c68c4['count']:_0x5c1ef0[_0x7042('0x1c')]+_0x5c1ef0[_0x7042('0x1d')];var _0x34fda6;if(_0x6e18fb>=_0x28add7){_0x6e18fb=_0x28add7;_0x34fda6=0xc8;}else{_0x34fda6=0xce;}_0x6ed505[_0x7042('0x17')](_0x34fda6);return _0x6ed505[_0x7042('0x1e')]('Content-Range',_0x1e69aa+'-'+_0x6e18fb+'/'+_0x28add7)[_0x7042('0x19')](_0x4c68c4);}return null;};}function patchUpdates(_0x580f84){return function(_0x363f3c){try{jsonpatch['apply'](_0x363f3c,_0x580f84,!![]);}catch(_0x3b8203){return BPromise[_0x7042('0x1f')](_0x3b8203);}return _0x363f3c[_0x7042('0x20')]();};}function saveUpdates(_0x456dfc,_0x484c82){return function(_0x5a224b){if(_0x5a224b){return _0x5a224b['update'](_0x456dfc)[_0x7042('0x21')](function(_0x30a722){return _0x30a722;});}return null;};}function removeEntity(_0x3af8bc,_0x1949fe){return function(_0x48d529){if(_0x48d529){return _0x48d529[_0x7042('0x22')]()[_0x7042('0x21')](function(){_0x3af8bc[_0x7042('0x17')](0xcc)[_0x7042('0x18')]();});}};}function handleEntityNotFound(_0x459ff6,_0x54445b){return function(_0xc5fed3){if(!_0xc5fed3){_0x459ff6[_0x7042('0x16')](0x194);}return _0xc5fed3;};}function handleError(_0xf3c3f9,_0x1a05d1){_0x1a05d1=_0x1a05d1||0x1f4;return function(_0x2e4dbe){logger[_0x7042('0x23')](_0x2e4dbe[_0x7042('0x24')]);if(_0x2e4dbe[_0x7042('0x25')]){delete _0x2e4dbe[_0x7042('0x25')];}_0xf3c3f9[_0x7042('0x17')](_0x1a05d1)[_0x7042('0x26')](_0x2e4dbe);};}exports[_0x7042('0x27')]=function(_0x88c156,_0x1b6a29){var _0x101b89={},_0x3203f3={},_0x477972={'count':0x0,'rows':[]};var _0xa7461d=_[_0x7042('0x28')](db['FreshdeskField']['rawAttributes'],function(_0x37cf52){return{'name':_0x37cf52[_0x7042('0x29')],'type':_0x37cf52[_0x7042('0x2a')][_0x7042('0x2b')]};});_0x3203f3[_0x7042('0x2c')]=_[_0x7042('0x28')](_0xa7461d,_0x7042('0x25'));_0x3203f3['query']=_['keys'](_0x88c156[_0x7042('0x2d')]);_0x3203f3[_0x7042('0x2e')]=_['intersection'](_0x3203f3[_0x7042('0x2c')],_0x3203f3[_0x7042('0x2d')]);_0x101b89['attributes']=_[_0x7042('0x2f')](_0x3203f3[_0x7042('0x2c')],qs[_0x7042('0x30')](_0x88c156[_0x7042('0x2d')][_0x7042('0x30')]));_0x101b89['attributes']=_0x101b89[_0x7042('0x31')]['length']?_0x101b89['attributes']:_0x3203f3[_0x7042('0x2c')];if(!_0x88c156['query'][_0x7042('0x32')](_0x7042('0x33'))){_0x101b89['limit']=qs[_0x7042('0x1d')](_0x88c156['query'][_0x7042('0x1d')]);_0x101b89[_0x7042('0x1c')]=qs[_0x7042('0x1c')](_0x88c156[_0x7042('0x2d')][_0x7042('0x1c')]);}_0x101b89[_0x7042('0x34')]=qs[_0x7042('0x35')](_0x88c156[_0x7042('0x2d')][_0x7042('0x35')]);_0x101b89['where']=qs[_0x7042('0x2e')](_[_0x7042('0x36')](_0x88c156[_0x7042('0x2d')],_0x3203f3['filters']),_0xa7461d);if(_0x88c156['query'][_0x7042('0x37')]){_0x101b89[_0x7042('0x38')]=_['merge'](_0x101b89[_0x7042('0x38')],{'$or':_[_0x7042('0x28')](_0xa7461d,function(_0x349198){if(_0x349198[_0x7042('0x2a')]!==_0x7042('0x39')){var _0x3abd08={};_0x3abd08[_0x349198[_0x7042('0x25')]]={'$like':'%'+_0x88c156[_0x7042('0x2d')][_0x7042('0x37')]+'%'};return _0x3abd08;}})});}_0x101b89=_[_0x7042('0x3a')]({},_0x101b89,_0x88c156[_0x7042('0x3b')]);var _0x4232c2={'where':_0x101b89[_0x7042('0x38')]};return db['FreshdeskField']['count'](_0x4232c2)[_0x7042('0x21')](function(_0x43f372){_0x477972[_0x7042('0x1b')]=_0x43f372;if(_0x88c156[_0x7042('0x2d')]['includeAll']){_0x101b89[_0x7042('0x3c')]=[{'all':!![]}];}return db[_0x7042('0x3d')]['findAll'](_0x101b89);})['then'](function(_0x1f8e68){_0x477972[_0x7042('0x3e')]=_0x1f8e68;return _0x477972;})[_0x7042('0x21')](respondWithFilteredResult(_0x1b6a29,_0x101b89))[_0x7042('0x3f')](handleError(_0x1b6a29,null));};exports[_0x7042('0x40')]=function(_0x4a4e90,_0x5de476){var _0x2c8d2a={'raw':!![],'where':{'id':_0x4a4e90['params']['id']}},_0x3897fc={};_0x3897fc[_0x7042('0x2c')]=_[_0x7042('0x41')](db[_0x7042('0x3d')]['rawAttributes']);_0x3897fc['query']=_[_0x7042('0x41')](_0x4a4e90[_0x7042('0x2d')]);_0x3897fc[_0x7042('0x2e')]=_['intersection'](_0x3897fc[_0x7042('0x2c')],_0x3897fc[_0x7042('0x2d')]);_0x2c8d2a['attributes']=_[_0x7042('0x2f')](_0x3897fc[_0x7042('0x2c')],qs[_0x7042('0x30')](_0x4a4e90[_0x7042('0x2d')][_0x7042('0x30')]));_0x2c8d2a[_0x7042('0x31')]=_0x2c8d2a[_0x7042('0x31')]['length']?_0x2c8d2a[_0x7042('0x31')]:_0x3897fc[_0x7042('0x2c')];if(_0x4a4e90['query'][_0x7042('0x42')]){_0x2c8d2a[_0x7042('0x3c')]=[{'all':!![]}];}_0x2c8d2a=_[_0x7042('0x3a')]({},_0x2c8d2a,_0x4a4e90[_0x7042('0x3b')]);return db[_0x7042('0x3d')][_0x7042('0x43')](_0x2c8d2a)['then'](handleEntityNotFound(_0x5de476,null))['then'](respondWithResult(_0x5de476,null))['catch'](handleError(_0x5de476,null));};exports[_0x7042('0x44')]=function(_0x55ecfe,_0x4821d3){return db[_0x7042('0x3d')]['create'](_0x55ecfe[_0x7042('0x45')],{})[_0x7042('0x21')](respondWithResult(_0x4821d3,0xc9))[_0x7042('0x3f')](handleError(_0x4821d3,null));};exports[_0x7042('0x46')]=function(_0x1a22d5,_0x11e7ce){if(_0x1a22d5[_0x7042('0x45')]['id']){delete _0x1a22d5[_0x7042('0x45')]['id'];}return db[_0x7042('0x3d')][_0x7042('0x43')]({'where':{'id':_0x1a22d5[_0x7042('0x47')]['id']}})[_0x7042('0x21')](handleEntityNotFound(_0x11e7ce,null))[_0x7042('0x21')](saveUpdates(_0x1a22d5['body'],null))[_0x7042('0x21')](respondWithResult(_0x11e7ce,null))[_0x7042('0x3f')](handleError(_0x11e7ce,null));};exports[_0x7042('0x22')]=function(_0x81b898,_0x3fcf0e){return db[_0x7042('0x3d')][_0x7042('0x43')]({'where':{'id':_0x81b898[_0x7042('0x47')]['id']}})[_0x7042('0x21')](handleEntityNotFound(_0x3fcf0e,null))[_0x7042('0x21')](removeEntity(_0x3fcf0e,null))[_0x7042('0x3f')](handleError(_0x3fcf0e,null));}; \ No newline at end of file +var _0xaa88=['model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','update','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','stack','name','send','map','FreshdeskField','fieldName','key'];(function(_0x3236fd,_0x40454b){var _0x25a96d=function(_0x2dd90f){while(--_0x2dd90f){_0x3236fd['push'](_0x3236fd['shift']());}};_0x25a96d(++_0x40454b);}(_0xaa88,0x137));var _0x8aa8=function(_0x3e32a8,_0x255953){_0x3e32a8=_0x3e32a8-0x0;var _0x2997b0=_0xaa88[_0x3e32a8];return _0x2997b0;};'use strict';var emlformat=require(_0x8aa8('0x0'));var rimraf=require(_0x8aa8('0x1'));var zipdir=require(_0x8aa8('0x2'));var jsonpatch=require(_0x8aa8('0x3'));var rp=require('request-promise');var moment=require(_0x8aa8('0x4'));var BPromise=require(_0x8aa8('0x5'));var Mustache=require(_0x8aa8('0x6'));var util=require(_0x8aa8('0x7'));var path=require(_0x8aa8('0x8'));var sox=require(_0x8aa8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8aa8('0xa'));var _=require('lodash');var squel=require(_0x8aa8('0xb'));var crypto=require(_0x8aa8('0xc'));var jsforce=require(_0x8aa8('0xd'));var deskjs=require(_0x8aa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8aa8('0xf'));var Papa=require(_0x8aa8('0x10'));var Redis=require(_0x8aa8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8aa8('0x12'));var as=require(_0x8aa8('0x13'));var hardwareService=require(_0x8aa8('0x14'));var logger=require(_0x8aa8('0x15'))('api');var utils=require(_0x8aa8('0x16'));var config=require(_0x8aa8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8aa8('0x18'))['db'];function respondWithStatusCode(_0xa691d6,_0x28132f){_0x28132f=_0x28132f||0xcc;return function(_0x535aa0){if(_0x535aa0){return _0xa691d6[_0x8aa8('0x19')](_0x28132f);}return _0xa691d6[_0x8aa8('0x1a')](_0x28132f)[_0x8aa8('0x1b')]();};}function respondWithResult(_0x4b686e,_0x391642){_0x391642=_0x391642||0xc8;return function(_0x4af534){if(_0x4af534){return _0x4b686e['status'](_0x391642)[_0x8aa8('0x1c')](_0x4af534);}};}function respondWithFilteredResult(_0x200662,_0xae81a0){return function(_0xa6c2af){if(_0xa6c2af){var _0x42a6a4=typeof _0xae81a0[_0x8aa8('0x1d')]===_0x8aa8('0x1e')&&typeof _0xae81a0[_0x8aa8('0x1f')]===_0x8aa8('0x1e');var _0x4e8ce3=_0xa6c2af['count'];var _0x2c1b9a=_0x42a6a4?0x0:_0xae81a0['offset'];var _0x557adc=_0x42a6a4?_0xa6c2af[_0x8aa8('0x20')]:_0xae81a0['offset']+_0xae81a0[_0x8aa8('0x1f')];var _0x41092b;if(_0x557adc>=_0x4e8ce3){_0x557adc=_0x4e8ce3;_0x41092b=0xc8;}else{_0x41092b=0xce;}_0x200662[_0x8aa8('0x1a')](_0x41092b);return _0x200662[_0x8aa8('0x21')]('Content-Range',_0x2c1b9a+'-'+_0x557adc+'/'+_0x4e8ce3)[_0x8aa8('0x1c')](_0xa6c2af);}return null;};}function patchUpdates(_0x36c445){return function(_0x2825fd){try{jsonpatch[_0x8aa8('0x22')](_0x2825fd,_0x36c445,!![]);}catch(_0x4c754e){return BPromise[_0x8aa8('0x23')](_0x4c754e);}return _0x2825fd['save']();};}function saveUpdates(_0x26cf63,_0x4cc455){return function(_0x1fdadd){if(_0x1fdadd){return _0x1fdadd['update'](_0x26cf63)[_0x8aa8('0x24')](function(_0x557e4e){return _0x557e4e;});}return null;};}function removeEntity(_0x65945b,_0x40adb5){return function(_0x3ca7dc){if(_0x3ca7dc){return _0x3ca7dc['destroy']()[_0x8aa8('0x24')](function(){_0x65945b[_0x8aa8('0x1a')](0xcc)[_0x8aa8('0x1b')]();});}};}function handleEntityNotFound(_0x547a7b,_0x57acd2){return function(_0x2d1508){if(!_0x2d1508){_0x547a7b[_0x8aa8('0x19')](0x194);}return _0x2d1508;};}function handleError(_0x2f91f3,_0x3a3c7a){_0x3a3c7a=_0x3a3c7a||0x1f4;return function(_0x24143e){logger['error'](_0x24143e[_0x8aa8('0x25')]);if(_0x24143e['name']){delete _0x24143e[_0x8aa8('0x26')];}_0x2f91f3[_0x8aa8('0x1a')](_0x3a3c7a)[_0x8aa8('0x27')](_0x24143e);};}exports['index']=function(_0x4c5c5c,_0x10810d){var _0x5e96c9={},_0x385208={},_0x14be8b={'count':0x0,'rows':[]};var _0x39e892=_[_0x8aa8('0x28')](db[_0x8aa8('0x29')]['rawAttributes'],function(_0x267f4c){return{'name':_0x267f4c[_0x8aa8('0x2a')],'type':_0x267f4c['type'][_0x8aa8('0x2b')]};});_0x385208[_0x8aa8('0x2c')]=_[_0x8aa8('0x28')](_0x39e892,'name');_0x385208[_0x8aa8('0x2d')]=_[_0x8aa8('0x2e')](_0x4c5c5c[_0x8aa8('0x2d')]);_0x385208[_0x8aa8('0x2f')]=_[_0x8aa8('0x30')](_0x385208[_0x8aa8('0x2c')],_0x385208[_0x8aa8('0x2d')]);_0x5e96c9[_0x8aa8('0x31')]=_[_0x8aa8('0x30')](_0x385208[_0x8aa8('0x2c')],qs[_0x8aa8('0x32')](_0x4c5c5c['query']['fields']));_0x5e96c9[_0x8aa8('0x31')]=_0x5e96c9[_0x8aa8('0x31')][_0x8aa8('0x33')]?_0x5e96c9[_0x8aa8('0x31')]:_0x385208[_0x8aa8('0x2c')];if(!_0x4c5c5c[_0x8aa8('0x2d')]['hasOwnProperty']('nolimit')){_0x5e96c9[_0x8aa8('0x1f')]=qs['limit'](_0x4c5c5c[_0x8aa8('0x2d')][_0x8aa8('0x1f')]);_0x5e96c9[_0x8aa8('0x1d')]=qs['offset'](_0x4c5c5c[_0x8aa8('0x2d')][_0x8aa8('0x1d')]);}_0x5e96c9[_0x8aa8('0x34')]=qs['sort'](_0x4c5c5c['query'][_0x8aa8('0x35')]);_0x5e96c9[_0x8aa8('0x36')]=qs['filters'](_[_0x8aa8('0x37')](_0x4c5c5c[_0x8aa8('0x2d')],_0x385208['filters']),_0x39e892);if(_0x4c5c5c[_0x8aa8('0x2d')]['filter']){_0x5e96c9['where']=_[_0x8aa8('0x38')](_0x5e96c9['where'],{'$or':_[_0x8aa8('0x28')](_0x39e892,function(_0x944927){if(_0x944927[_0x8aa8('0x39')]!==_0x8aa8('0x3a')){var _0x4ce5e9={};_0x4ce5e9[_0x944927[_0x8aa8('0x26')]]={'$like':'%'+_0x4c5c5c[_0x8aa8('0x2d')]['filter']+'%'};return _0x4ce5e9;}})});}_0x5e96c9=_[_0x8aa8('0x38')]({},_0x5e96c9,_0x4c5c5c[_0x8aa8('0x3b')]);var _0x5ea57a={'where':_0x5e96c9[_0x8aa8('0x36')]};return db[_0x8aa8('0x29')][_0x8aa8('0x20')](_0x5ea57a)[_0x8aa8('0x24')](function(_0x189d53){_0x14be8b[_0x8aa8('0x20')]=_0x189d53;if(_0x4c5c5c[_0x8aa8('0x2d')][_0x8aa8('0x3c')]){_0x5e96c9[_0x8aa8('0x3d')]=[{'all':!![]}];}return db[_0x8aa8('0x29')][_0x8aa8('0x3e')](_0x5e96c9);})[_0x8aa8('0x24')](function(_0x17c730){_0x14be8b[_0x8aa8('0x3f')]=_0x17c730;return _0x14be8b;})[_0x8aa8('0x24')](respondWithFilteredResult(_0x10810d,_0x5e96c9))[_0x8aa8('0x40')](handleError(_0x10810d,null));};exports['show']=function(_0x1aade0,_0x5cdba4){var _0x4833c0={'raw':!![],'where':{'id':_0x1aade0[_0x8aa8('0x41')]['id']}},_0x572132={};_0x572132['model']=_['keys'](db[_0x8aa8('0x29')]['rawAttributes']);_0x572132[_0x8aa8('0x2d')]=_['keys'](_0x1aade0['query']);_0x572132[_0x8aa8('0x2f')]=_[_0x8aa8('0x30')](_0x572132[_0x8aa8('0x2c')],_0x572132[_0x8aa8('0x2d')]);_0x4833c0[_0x8aa8('0x31')]=_[_0x8aa8('0x30')](_0x572132[_0x8aa8('0x2c')],qs['fields'](_0x1aade0[_0x8aa8('0x2d')]['fields']));_0x4833c0[_0x8aa8('0x31')]=_0x4833c0[_0x8aa8('0x31')][_0x8aa8('0x33')]?_0x4833c0[_0x8aa8('0x31')]:_0x572132[_0x8aa8('0x2c')];if(_0x1aade0[_0x8aa8('0x2d')]['includeAll']){_0x4833c0['include']=[{'all':!![]}];}_0x4833c0=_[_0x8aa8('0x38')]({},_0x4833c0,_0x1aade0[_0x8aa8('0x3b')]);return db['FreshdeskField'][_0x8aa8('0x42')](_0x4833c0)[_0x8aa8('0x24')](handleEntityNotFound(_0x5cdba4,null))[_0x8aa8('0x24')](respondWithResult(_0x5cdba4,null))['catch'](handleError(_0x5cdba4,null));};exports['create']=function(_0x52c130,_0x4e05e7){return db[_0x8aa8('0x29')][_0x8aa8('0x43')](_0x52c130['body'],{})[_0x8aa8('0x24')](respondWithResult(_0x4e05e7,0xc9))[_0x8aa8('0x40')](handleError(_0x4e05e7,null));};exports[_0x8aa8('0x44')]=function(_0x1aa1b6,_0x20384a){if(_0x1aa1b6[_0x8aa8('0x45')]['id']){delete _0x1aa1b6['body']['id'];}return db['FreshdeskField'][_0x8aa8('0x42')]({'where':{'id':_0x1aa1b6['params']['id']}})[_0x8aa8('0x24')](handleEntityNotFound(_0x20384a,null))['then'](saveUpdates(_0x1aa1b6[_0x8aa8('0x45')],null))[_0x8aa8('0x24')](respondWithResult(_0x20384a,null))[_0x8aa8('0x40')](handleError(_0x20384a,null));};exports[_0x8aa8('0x46')]=function(_0x36de37,_0x22b35d){return db[_0x8aa8('0x29')][_0x8aa8('0x42')]({'where':{'id':_0x36de37[_0x8aa8('0x41')]['id']}})[_0x8aa8('0x24')](handleEntityNotFound(_0x22b35d,null))[_0x8aa8('0x24')](removeEntity(_0x22b35d,null))[_0x8aa8('0x40')](handleError(_0x22b35d,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 93aff9d..c6ad3a0 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 _0x7564=['freshdesk_unique_index','idField','lodash','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','define','FreshdeskField','int_freshdesk_fields'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0x7564,0xaa));var _0x4756=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0x7564[_0x58afd5];return _0x3e503b;};'use strict';var _=require(_0x4756('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4756('0x1'));var BPromise=require('bluebird');var rp=require(_0x4756('0x2'));var fs=require('fs');var path=require(_0x4756('0x3'));var rimraf=require(_0x4756('0x4'));var config=require(_0x4756('0x5'));var attributes=require(_0x4756('0x6'));module['exports']=function(_0x2ea0e6,_0x5bd7fd){return _0x2ea0e6[_0x4756('0x7')](_0x4756('0x8'),attributes,{'tableName':_0x4756('0x9'),'paranoid':![],'indexes':[{'name':_0x4756('0xa'),'fields':[_0x4756('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1445=['request-promise','path','../../config/environment','exports','define','FreshdeskField','freshdesk_unique_index','idField','FieldId','lodash','util','api','moment','bluebird'];(function(_0x2cd311,_0x2ebe00){var _0x4fcbb2=function(_0x163eef){while(--_0x163eef){_0x2cd311['push'](_0x2cd311['shift']());}};_0x4fcbb2(++_0x2ebe00);}(_0x1445,0xa3));var _0x5144=function(_0x55be62,_0x1c4d2a){_0x55be62=_0x55be62-0x0;var _0x2a0f80=_0x1445[_0x55be62];return _0x2a0f80;};'use strict';var _=require(_0x5144('0x0'));var util=require(_0x5144('0x1'));var logger=require('../../config/logger')(_0x5144('0x2'));var moment=require(_0x5144('0x3'));var BPromise=require(_0x5144('0x4'));var rp=require(_0x5144('0x5'));var fs=require('fs');var path=require(_0x5144('0x6'));var rimraf=require('rimraf');var config=require(_0x5144('0x7'));var attributes=require('./intFreshdeskField.attributes');module[_0x5144('0x8')]=function(_0x3b268e,_0x214f9e){return _0x3b268e[_0x5144('0x9')](_0x5144('0xa'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x5144('0xb'),'fields':[_0x5144('0xc'),_0x5144('0xd')],'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 c4f6416..bbcd2fa 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 _0x722f=['../../config/logger','../../config/environment','jayson/promise','client','http','request','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','randomstring','../../config/utils'];(function(_0x4eafed,_0x26e2bc){var _0x159c85=function(_0x6f129f){while(--_0x6f129f){_0x4eafed['push'](_0x4eafed['shift']());}};_0x159c85(++_0x26e2bc);}(_0x722f,0x1a0));var _0xf722=function(_0x3f0d07,_0x3d5cc4){_0x3f0d07=_0x3f0d07-0x0;var _0x3e3074=_0x722f[_0x3f0d07];return _0x3e3074;};'use strict';var _=require(_0xf722('0x0'));var util=require('util');var moment=require(_0xf722('0x1'));var BPromise=require('bluebird');var rs=require(_0xf722('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf722('0x3'));var logger=require(_0xf722('0x4'))('rpc');var config=require(_0xf722('0x5'));var jayson=require(_0xf722('0x6'));var client=jayson[_0xf722('0x7')][_0xf722('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1ca2a6,_0x710c5b,_0x12f987){return new BPromise(function(_0x140c89,_0xdd03ed){return client[_0xf722('0x9')](_0x1ca2a6,_0x12f987)['then'](function(_0xaea2ef){logger[_0xf722('0xa')](_0xf722('0xb'),_0x710c5b,_0xf722('0xc'));logger[_0xf722('0xd')](_0xf722('0xe'),_0x710c5b,_0xf722('0xc'),JSON[_0xf722('0xf')](_0xaea2ef));if(_0xaea2ef[_0xf722('0x10')]){if(_0xaea2ef[_0xf722('0x10')]['code']===0x1f4){logger[_0xf722('0x10')](_0xf722('0xb'),_0x710c5b,_0xaea2ef[_0xf722('0x10')]['message']);return _0xdd03ed(_0xaea2ef['error'][_0xf722('0x11')]);}logger[_0xf722('0x10')](_0xf722('0xb'),_0x710c5b,_0xaea2ef[_0xf722('0x10')][_0xf722('0x11')]);return _0x140c89(_0xaea2ef[_0xf722('0x10')][_0xf722('0x11')]);}else{logger[_0xf722('0xa')]('FreshdeskField,\x20%s,\x20%s',_0x710c5b,_0xf722('0xc'));_0x140c89(_0xaea2ef[_0xf722('0x12')][_0xf722('0x11')]);}})[_0xf722('0x13')](function(_0xc97d73){logger[_0xf722('0x10')](_0xf722('0xb'),_0x710c5b,_0xc97d73);_0xdd03ed(_0xc97d73);});});} \ No newline at end of file +var _0xc5c0=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','FreshdeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x30b0c7,_0xeaab01){var _0x5b6152=function(_0x3d947c){while(--_0x3d947c){_0x30b0c7['push'](_0x30b0c7['shift']());}};_0x5b6152(++_0xeaab01);}(_0xc5c0,0x6c));var _0x0c5c=function(_0x1f198b,_0x351cb9){_0x1f198b=_0x1f198b-0x0;var _0x37b264=_0xc5c0[_0x1f198b];return _0x37b264;};'use strict';var _=require(_0x0c5c('0x0'));var util=require(_0x0c5c('0x1'));var moment=require(_0x0c5c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0c5c('0x3'));var db=require(_0x0c5c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0c5c('0x5'))(_0x0c5c('0x6'));var config=require(_0x0c5c('0x7'));var jayson=require(_0x0c5c('0x8'));var client=jayson[_0x0c5c('0x9')][_0x0c5c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x465ff0,_0x58e41c,_0x1709fd){return new BPromise(function(_0x1d1386,_0x52592e){return client[_0x0c5c('0xb')](_0x465ff0,_0x1709fd)[_0x0c5c('0xc')](function(_0x4145aa){logger[_0x0c5c('0xd')]('FreshdeskField,\x20%s,\x20%s',_0x58e41c,_0x0c5c('0xe'));logger[_0x0c5c('0xf')](_0x0c5c('0x10'),_0x58e41c,_0x0c5c('0xe'),JSON[_0x0c5c('0x11')](_0x4145aa));if(_0x4145aa['error']){if(_0x4145aa[_0x0c5c('0x12')]['code']===0x1f4){logger[_0x0c5c('0x12')](_0x0c5c('0x13'),_0x58e41c,_0x4145aa[_0x0c5c('0x12')][_0x0c5c('0x14')]);return _0x52592e(_0x4145aa[_0x0c5c('0x12')][_0x0c5c('0x14')]);}logger[_0x0c5c('0x12')](_0x0c5c('0x13'),_0x58e41c,_0x4145aa[_0x0c5c('0x12')][_0x0c5c('0x14')]);return _0x1d1386(_0x4145aa['error'][_0x0c5c('0x14')]);}else{logger['info']('FreshdeskField,\x20%s,\x20%s',_0x58e41c,_0x0c5c('0xe'));_0x1d1386(_0x4145aa[_0x0c5c('0x15')]['message']);}})[_0x0c5c('0x16')](function(_0x5c0be8){logger[_0x0c5c('0x12')](_0x0c5c('0x13'),_0x58e41c,_0x5c0be8);_0x52592e(_0x5c0be8);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 8e168f2..ca4858f 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 _0xeffd=['/:id','show','getConfigurations','getFields','post','create','/:id/configurations','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0xeffd,0x6b));var _0xdeff=function(_0x2670f1,_0x315a01){_0x2670f1=_0x2670f1-0x0;var _0x1ed78d=_0xeffd[_0x2670f1];return _0x1ed78d;};'use strict';var multer=require(_0xdeff('0x0'));var util=require('util');var path=require(_0xdeff('0x1'));var timeout=require(_0xdeff('0x2'));var express=require(_0xdeff('0x3'));var router=express[_0xdeff('0x4')]();var fs_extra=require(_0xdeff('0x5'));var auth=require(_0xdeff('0x6'));var interaction=require(_0xdeff('0x7'));var config=require(_0xdeff('0x8'));var controller=require(_0xdeff('0x9'));router[_0xdeff('0xa')]('/',auth[_0xdeff('0xb')](),controller[_0xdeff('0xc')]);router[_0xdeff('0xa')](_0xdeff('0xd'),auth[_0xdeff('0xb')](),controller[_0xdeff('0xe')]);router[_0xdeff('0xa')]('/:id/configurations',auth[_0xdeff('0xb')](),controller[_0xdeff('0xf')]);router[_0xdeff('0xa')]('/:id/fields',auth[_0xdeff('0xb')](),controller[_0xdeff('0x10')]);router[_0xdeff('0x11')]('/',auth[_0xdeff('0xb')](),controller[_0xdeff('0x12')]);router[_0xdeff('0x11')](_0xdeff('0x13'),auth[_0xdeff('0xb')](),controller['addConfiguration']);router[_0xdeff('0x14')](_0xdeff('0xd'),auth['isAuthenticated'](),controller[_0xdeff('0x15')]);router['delete']('/:id',auth[_0xdeff('0xb')](),controller[_0xdeff('0x16')]);module[_0xdeff('0x17')]=router; \ No newline at end of file +var _0x5eb8=['./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5f2e1e,_0x459f88){var _0x2637d8=function(_0x3676ea){while(--_0x3676ea){_0x5f2e1e['push'](_0x5f2e1e['shift']());}};_0x2637d8(++_0x459f88);}(_0x5eb8,0xb0));var _0x85eb=function(_0x3a6e4b,_0x118cd9){_0x3a6e4b=_0x3a6e4b-0x0;var _0x36572d=_0x5eb8[_0x3a6e4b];return _0x36572d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['get'](_0x85eb('0xe'),auth['isAuthenticated'](),controller[_0x85eb('0xf')]);router[_0x85eb('0x9')](_0x85eb('0x10'),auth[_0x85eb('0xa')](),controller[_0x85eb('0x11')]);router[_0x85eb('0x12')]('/',auth[_0x85eb('0xa')](),controller['create']);router[_0x85eb('0x12')](_0x85eb('0xe'),auth['isAuthenticated'](),controller[_0x85eb('0x13')]);router[_0x85eb('0x14')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller['update']);router['delete'](_0x85eb('0xc'),auth['isAuthenticated'](),controller[_0x85eb('0x15')]);module[_0x85eb('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 7f8ead8..f59dcdb 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 _0xd943=['exports','STRING','username','remoteUri','sequelize'];(function(_0x1e1350,_0x54a677){var _0x3786a9=function(_0x617bed){while(--_0x617bed){_0x1e1350['push'](_0x1e1350['shift']());}};_0x3786a9(++_0x54a677);}(_0xd943,0x15d));var _0x3d94=function(_0x3275cd,_0x2e0a27){_0x3275cd=_0x3275cd-0x0;var _0x6a764d=_0xd943[_0x3275cd];return _0x6a764d;};'use strict';var Sequelize=require(_0x3d94('0x0'));module[_0x3d94('0x1')]={'name':{'type':Sequelize[_0x3d94('0x2')]},'description':{'type':Sequelize[_0x3d94('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x3d94('0x3')},'apiKey':{'type':Sequelize[_0x3d94('0x2')]},'remoteUri':{'type':Sequelize[_0x3d94('0x2')],'unique':_0x3d94('0x4')},'serverUrl':{'type':Sequelize[_0x3d94('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x4e2e=['username','remoteUri','exports','STRING'];(function(_0x24ee50,_0x179e56){var _0x50e0d6=function(_0x47a085){while(--_0x47a085){_0x24ee50['push'](_0x24ee50['shift']());}};_0x50e0d6(++_0x179e56);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x44c9af,_0x28a1ca){_0x44c9af=_0x44c9af-0x0;var _0x9483e9=_0x4e2e[_0x44c9af];return _0x9483e9;};'use strict';var Sequelize=require('sequelize');module[_0xe4e2('0x0')]={'name':{'type':Sequelize[_0xe4e2('0x1')]},'description':{'type':Sequelize[_0xe4e2('0x1')]},'username':{'type':Sequelize[_0xe4e2('0x1')],'unique':_0xe4e2('0x2')},'apiKey':{'type':Sequelize[_0xe4e2('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xe4e2('0x3')},'serverUrl':{'type':Sequelize[_0xe4e2('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index f40d00e..83ed470 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 _0x1589=['Token\x20token=','Requested\x20Resource\x20not\x20Found','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','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/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','error','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','then','includeAll','include','rows','catch','show','params','find','create','body','getConfigurations','FreshsalesConfiguration','pick','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','apiKey','remoteUri','slice','substring','format','%s%s'];(function(_0x30f030,_0xd03b7a){var _0xf7614f=function(_0x261cac){while(--_0x261cac){_0x30f030['push'](_0x30f030['shift']());}};_0xf7614f(++_0xd03b7a);}(_0x1589,0xd2));var _0x9158=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x1589[_0x5a95fa];return _0x1a61b8;};'use strict';var emlformat=require(_0x9158('0x0'));var rimraf=require(_0x9158('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9158('0x2'));var rp=require(_0x9158('0x3'));var moment=require('moment');var BPromise=require(_0x9158('0x4'));var Mustache=require(_0x9158('0x5'));var util=require(_0x9158('0x6'));var path=require(_0x9158('0x7'));var sox=require(_0x9158('0x8'));var csv=require(_0x9158('0x9'));var ejs=require(_0x9158('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9158('0xb'));var squel=require(_0x9158('0xc'));var crypto=require(_0x9158('0xd'));var jsforce=require(_0x9158('0xe'));var deskjs=require(_0x9158('0xf'));var toCsv=require(_0x9158('0x9'));var querystring=require('querystring');var Papa=require(_0x9158('0x10'));var Redis=require('ioredis');var authService=require(_0x9158('0x11'));var qs=require(_0x9158('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9158('0x13'));var logger=require(_0x9158('0x14'))(_0x9158('0x15'));var utils=require(_0x9158('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9158('0x17'));var db=require(_0x9158('0x18'))['db'];var integrations=require(_0x9158('0x19'));function respondWithStatusCode(_0x3babdb,_0x42e22c){_0x42e22c=_0x42e22c||0xcc;return function(_0x364da8){if(_0x364da8){return _0x3babdb[_0x9158('0x1a')](_0x42e22c);}return _0x3babdb['status'](_0x42e22c)[_0x9158('0x1b')]();};}function respondWithResult(_0x28a3e0,_0x3a0591){_0x3a0591=_0x3a0591||0xc8;return function(_0x2e46bf){if(_0x2e46bf){return _0x28a3e0[_0x9158('0x1c')](_0x3a0591)[_0x9158('0x1d')](_0x2e46bf);}};}function respondWithFilteredResult(_0x413e77,_0x396e2a){return function(_0x5970e7){if(_0x5970e7){var _0x1b6ad4=typeof _0x396e2a['offset']===_0x9158('0x1e')&&typeof _0x396e2a[_0x9158('0x1f')]===_0x9158('0x1e');var _0x339b56=_0x5970e7[_0x9158('0x20')];var _0x377941=_0x1b6ad4?0x0:_0x396e2a[_0x9158('0x21')];var _0xd62dc0=_0x1b6ad4?_0x5970e7['count']:_0x396e2a[_0x9158('0x21')]+_0x396e2a[_0x9158('0x1f')];var _0x5141f9;if(_0xd62dc0>=_0x339b56){_0xd62dc0=_0x339b56;_0x5141f9=0xc8;}else{_0x5141f9=0xce;}_0x413e77[_0x9158('0x1c')](_0x5141f9);return _0x413e77[_0x9158('0x22')](_0x9158('0x23'),_0x377941+'-'+_0xd62dc0+'/'+_0x339b56)[_0x9158('0x1d')](_0x5970e7);}return null;};}function patchUpdates(_0x24e750){return function(_0xcdc2cc){try{jsonpatch['apply'](_0xcdc2cc,_0x24e750,!![]);}catch(_0x51850b){return BPromise[_0x9158('0x24')](_0x51850b);}return _0xcdc2cc[_0x9158('0x25')]();};}function saveUpdates(_0x32988b,_0x4a02ec){return function(_0x162879){if(_0x162879){return _0x162879[_0x9158('0x26')](_0x32988b)['then'](function(_0x417ee5){return _0x417ee5;});}return null;};}function removeEntity(_0x5f1ad5,_0x55f798){return function(_0x452053){if(_0x452053){return _0x452053[_0x9158('0x27')]()['then'](function(){_0x5f1ad5['status'](0xcc)[_0x9158('0x1b')]();});}};}function handleEntityNotFound(_0x4b2fd5,_0x30bbb5){return function(_0x2a4ed1){if(!_0x2a4ed1){_0x4b2fd5[_0x9158('0x1a')](0x194);}return _0x2a4ed1;};}function handleError(_0x574c3d,_0x42af55){_0x42af55=_0x42af55||0x1f4;return function(_0x5d7fb3){logger[_0x9158('0x28')](_0x5d7fb3['stack']);if(_0x5d7fb3['name']){delete _0x5d7fb3[_0x9158('0x29')];}_0x574c3d['status'](_0x42af55)[_0x9158('0x2a')](_0x5d7fb3);};}exports[_0x9158('0x2b')]=function(_0xe6f990,_0x3729f7){var _0xf20449={},_0x4911a7={},_0x3a9d47={'count':0x0,'rows':[]};var _0xe5fc3=_[_0x9158('0x2c')](db[_0x9158('0x2d')][_0x9158('0x2e')],function(_0xf2e558){return{'name':_0xf2e558[_0x9158('0x2f')],'type':_0xf2e558[_0x9158('0x30')][_0x9158('0x31')]};});_0x4911a7[_0x9158('0x32')]=_[_0x9158('0x2c')](_0xe5fc3,'name');_0x4911a7['query']=_[_0x9158('0x33')](_0xe6f990['query']);_0x4911a7[_0x9158('0x34')]=_[_0x9158('0x35')](_0x4911a7[_0x9158('0x32')],_0x4911a7[_0x9158('0x36')]);_0xf20449['attributes']=_['intersection'](_0x4911a7[_0x9158('0x32')],qs[_0x9158('0x37')](_0xe6f990[_0x9158('0x36')][_0x9158('0x37')]));_0xf20449[_0x9158('0x38')]=_0xf20449[_0x9158('0x38')][_0x9158('0x39')]?_0xf20449[_0x9158('0x38')]:_0x4911a7[_0x9158('0x32')];if(!_0xe6f990[_0x9158('0x36')][_0x9158('0x3a')](_0x9158('0x3b'))){_0xf20449[_0x9158('0x1f')]=qs[_0x9158('0x1f')](_0xe6f990['query'][_0x9158('0x1f')]);_0xf20449[_0x9158('0x21')]=qs[_0x9158('0x21')](_0xe6f990[_0x9158('0x36')][_0x9158('0x21')]);}_0xf20449[_0x9158('0x3c')]=qs[_0x9158('0x3d')](_0xe6f990[_0x9158('0x36')]['sort']);_0xf20449[_0x9158('0x3e')]=qs[_0x9158('0x34')](_['pick'](_0xe6f990[_0x9158('0x36')],_0x4911a7['filters']),_0xe5fc3);if(_0xe6f990[_0x9158('0x36')]['filter']){_0xf20449[_0x9158('0x3e')]=_['merge'](_0xf20449[_0x9158('0x3e')],{'$or':_['map'](_0xe5fc3,function(_0x4c26f8){if(_0x4c26f8[_0x9158('0x30')]!==_0x9158('0x3f')){var _0x33cbb9={};_0x33cbb9[_0x4c26f8['name']]={'$like':'%'+_0xe6f990[_0x9158('0x36')][_0x9158('0x40')]+'%'};return _0x33cbb9;}})});}_0xf20449=_[_0x9158('0x41')]({},_0xf20449,_0xe6f990[_0x9158('0x42')]);var _0x39c234={'where':_0xf20449[_0x9158('0x3e')]};return db[_0x9158('0x2d')][_0x9158('0x20')](_0x39c234)[_0x9158('0x43')](function(_0x294d07){_0x3a9d47[_0x9158('0x20')]=_0x294d07;if(_0xe6f990[_0x9158('0x36')][_0x9158('0x44')]){_0xf20449[_0x9158('0x45')]=[{'all':!![]}];}return db[_0x9158('0x2d')]['findAll'](_0xf20449);})[_0x9158('0x43')](function(_0x1ae6c9){_0x3a9d47[_0x9158('0x46')]=_0x1ae6c9;return _0x3a9d47;})[_0x9158('0x43')](respondWithFilteredResult(_0x3729f7,_0xf20449))[_0x9158('0x47')](handleError(_0x3729f7,null));};exports[_0x9158('0x48')]=function(_0x2e20de,_0x432c80){var _0x4135b6={'raw':![],'where':{'id':_0x2e20de[_0x9158('0x49')]['id']}},_0x3b4ed8={};_0x3b4ed8[_0x9158('0x32')]=_[_0x9158('0x33')](db['FreshsalesAccount']['rawAttributes']);_0x3b4ed8[_0x9158('0x36')]=_[_0x9158('0x33')](_0x2e20de[_0x9158('0x36')]);_0x3b4ed8[_0x9158('0x34')]=_[_0x9158('0x35')](_0x3b4ed8[_0x9158('0x32')],_0x3b4ed8[_0x9158('0x36')]);_0x4135b6['attributes']=_[_0x9158('0x35')](_0x3b4ed8[_0x9158('0x32')],qs[_0x9158('0x37')](_0x2e20de[_0x9158('0x36')][_0x9158('0x37')]));_0x4135b6[_0x9158('0x38')]=_0x4135b6[_0x9158('0x38')][_0x9158('0x39')]?_0x4135b6[_0x9158('0x38')]:_0x3b4ed8[_0x9158('0x32')];if(_0x2e20de['query'][_0x9158('0x44')]){_0x4135b6[_0x9158('0x45')]=[{'all':!![]}];}_0x4135b6=_['merge']({},_0x4135b6,_0x2e20de[_0x9158('0x42')]);return db['FreshsalesAccount'][_0x9158('0x4a')](_0x4135b6)[_0x9158('0x43')](handleEntityNotFound(_0x432c80,null))[_0x9158('0x43')](respondWithResult(_0x432c80,null))[_0x9158('0x47')](handleError(_0x432c80,null));};exports[_0x9158('0x4b')]=function(_0x17c206,_0x5f103e){return db[_0x9158('0x2d')]['create'](_0x17c206['body'],{})[_0x9158('0x43')](respondWithResult(_0x5f103e,0xc9))[_0x9158('0x47')](handleError(_0x5f103e,null));};exports['update']=function(_0x21514d,_0x10fe8a){if(_0x21514d[_0x9158('0x4c')]['id']){delete _0x21514d[_0x9158('0x4c')]['id'];}return db['FreshsalesAccount'][_0x9158('0x4a')]({'where':{'id':_0x21514d[_0x9158('0x49')]['id']}})[_0x9158('0x43')](handleEntityNotFound(_0x10fe8a,null))[_0x9158('0x43')](saveUpdates(_0x21514d[_0x9158('0x4c')],null))[_0x9158('0x43')](respondWithResult(_0x10fe8a,null))[_0x9158('0x47')](handleError(_0x10fe8a,null));};exports[_0x9158('0x27')]=function(_0x1c2b51,_0x479117){return db[_0x9158('0x2d')][_0x9158('0x4a')]({'where':{'id':_0x1c2b51[_0x9158('0x49')]['id']}})['then'](handleEntityNotFound(_0x479117,null))['then'](removeEntity(_0x479117,null))[_0x9158('0x47')](handleError(_0x479117,null));};exports[_0x9158('0x4d')]=function(_0x220e9d,_0x43a3d3,_0x5a7af6){var _0x2d328e={};var _0x1cf062={};var _0x4f3382;var _0x53cfcd;return db[_0x9158('0x2d')]['findOne']({'where':{'id':_0x220e9d[_0x9158('0x49')]['id']}})[_0x9158('0x43')](handleEntityNotFound(_0x43a3d3,null))['then'](function(_0x2d6da2){if(_0x2d6da2){_0x4f3382=_0x2d6da2;_0x1cf062[_0x9158('0x32')]=_[_0x9158('0x33')](db[_0x9158('0x4e')][_0x9158('0x2e')]);_0x1cf062['query']=_[_0x9158('0x33')](_0x220e9d[_0x9158('0x36')]);_0x1cf062['filters']=_[_0x9158('0x35')](_0x1cf062[_0x9158('0x32')],_0x1cf062[_0x9158('0x36')]);_0x2d328e[_0x9158('0x38')]=_[_0x9158('0x35')](_0x1cf062[_0x9158('0x32')],qs[_0x9158('0x37')](_0x220e9d[_0x9158('0x36')]['fields']));_0x2d328e[_0x9158('0x38')]=_0x2d328e[_0x9158('0x38')][_0x9158('0x39')]?_0x2d328e[_0x9158('0x38')]:_0x1cf062[_0x9158('0x32')];_0x2d328e[_0x9158('0x3c')]=qs[_0x9158('0x3d')](_0x220e9d[_0x9158('0x36')][_0x9158('0x3d')]);_0x2d328e['where']=qs[_0x9158('0x34')](_[_0x9158('0x4f')](_0x220e9d[_0x9158('0x36')],_0x1cf062[_0x9158('0x34')]));if(_0x220e9d[_0x9158('0x36')]['filter']){_0x2d328e[_0x9158('0x3e')]=_[_0x9158('0x41')](_0x2d328e[_0x9158('0x3e')],{'$or':_[_0x9158('0x2c')](_0x2d328e[_0x9158('0x38')],function(_0x5e8e74){var _0x254ee3={};_0x254ee3[_0x5e8e74]={'$like':'%'+_0x220e9d[_0x9158('0x36')]['filter']+'%'};return _0x254ee3;})});}_0x2d328e=_[_0x9158('0x41')]({},_0x2d328e,_0x220e9d[_0x9158('0x42')]);return _0x4f3382[_0x9158('0x4d')](_0x2d328e);}})['then'](function(_0x173578){if(_0x173578){_0x53cfcd=_0x173578['length'];if(!_0x220e9d['query'][_0x9158('0x3a')](_0x9158('0x3b'))){_0x2d328e['limit']=qs[_0x9158('0x1f')](_0x220e9d[_0x9158('0x36')][_0x9158('0x1f')]);_0x2d328e['offset']=qs['offset'](_0x220e9d['query'][_0x9158('0x21')]);}return _0x4f3382[_0x9158('0x4d')](_0x2d328e);}})[_0x9158('0x43')](function(_0x318c15){if(_0x318c15){return _0x318c15?{'count':_0x53cfcd,'rows':_0x318c15}:null;}})[_0x9158('0x43')](respondWithResult(_0x43a3d3,null))[_0x9158('0x47')](handleError(_0x43a3d3,null));};exports[_0x9158('0x50')]=function(_0x12e55f,_0x9571d7,_0x338443){if(_0x12e55f[_0x9158('0x4c')]['id']){delete _0x12e55f['body']['id'];}return db[_0x9158('0x2d')][_0x9158('0x51')]({'where':{'id':_0x12e55f[_0x9158('0x49')]['id']}})[_0x9158('0x43')](handleEntityNotFound(_0x9571d7,null))[_0x9158('0x43')](function(_0x460e2b){if(_0x460e2b){_0x12e55f[_0x9158('0x4c')][_0x9158('0x52')]=_0x460e2b['id'];_0x12e55f[_0x9158('0x4c')]['Subjects']=integrations[_0x9158('0x53')](_0x12e55f[_0x9158('0x4c')][_0x9158('0x54')],_0x12e55f[_0x9158('0x4c')]['type']);_0x12e55f[_0x9158('0x4c')][_0x9158('0x55')]=integrations[_0x9158('0x56')](_0x12e55f[_0x9158('0x4c')][_0x9158('0x54')],_0x12e55f['body'][_0x9158('0x30')]);return db[_0x9158('0x4e')]['create'](_0x12e55f[_0x9158('0x4c')],{'include':[{'model':db[_0x9158('0x57')],'as':'Subjects'},{'model':db[_0x9158('0x57')],'as':_0x9158('0x55')}]});}return null;})[_0x9158('0x43')](respondWithResult(_0x9571d7,null))[_0x9158('0x47')](handleError(_0x9571d7,null));};exports[_0x9158('0x58')]=function(_0x10b0bd,_0x5784d0,_0x4c6f88){var _0x47b3aa='';var _0x44e301='';return db['FreshsalesAccount'][_0x9158('0x51')]({'where':{'id':_0x10b0bd[_0x9158('0x49')]['id']},'attributes':['id',_0x9158('0x59'),'remoteUri',_0x9158('0x5a')]})[_0x9158('0x43')](handleEntityNotFound(_0x5784d0,null))[_0x9158('0x43')](function(_0x2ab93e){if(_0x2ab93e){_0x44e301=_0x2ab93e[_0x9158('0x59')];_0x47b3aa=_0x2ab93e[_0x9158('0x5b')];var _0x594877=_0x2ab93e['remoteUri'][_0x9158('0x5c')](-0x1);if(_0x594877==='/'){_0x47b3aa=_0x47b3aa[_0x9158('0x5d')](0x0,_0x47b3aa['lastIndexOf'](_0x594877));}return rp({'method':'GET','uri':util[_0x9158('0x5e')](_0x9158('0x5f'),_0x47b3aa,'/api/selector/owners'),'headers':{'Authorization':_0x9158('0x60')+_0x2ab93e[_0x9158('0x5a')]},'json':!![]});}})['then'](function(_0x5a7f4a){if(_0x5a7f4a){var _0x29b075=_0x5a7f4a['users'];var _0x5a41aa=![];var _0x4a56fb=null;for(_0x4a56fb=0x0;_0x4a56fb<_0x29b075[_0x9158('0x39')];_0x4a56fb++){if(_0x29b075[_0x4a56fb]['email']===_0x44e301){_0x5a41aa=!![];}}if(_0x5a41aa){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x9158('0x61')});}}})[_0x9158('0x43')](respondWithResult(_0x5784d0,null))[_0x9158('0x47')](function(_0x4a537e){var _0x508f02=_0x10b0bd[_0x9158('0x36')][_0x9158('0x62')]?0x1f4:_0x4a537e[_0x9158('0x63')]||0x1f4;logger[_0x9158('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0x9158('0x58'),_0x508f02,JSON[_0x9158('0x64')](_0x4a537e));delete _0x4a537e[_0x9158('0x29')];if(_0x508f02===0x191){_0x508f02=0x190;}_0x5784d0[_0x9158('0x1c')](_0x508f02)['send'](_0x10b0bd[_0x9158('0x36')][_0x9158('0x62')]?{'message':_0x9158('0x65'),'statusCode':_0x4a537e[_0x9158('0x63')]}:_0x4a537e);});}; \ No newline at end of file +var _0x540a=['filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','find','create','body','catch','params','getConfigurations','findOne','FreshsalesConfiguration','order','pick','nolimit','addConfiguration','AccountId','channel','Descriptions','getDescriptions','Subjects','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','name','send','index','map','FreshsalesAccount','fieldName','type','key','query','keys'];(function(_0x46d048,_0x59203e){var _0x81f4e=function(_0x5a706e){while(--_0x5a706e){_0x46d048['push'](_0x46d048['shift']());}};_0x81f4e(++_0x59203e);}(_0x540a,0x95));var _0xa540=function(_0x5f5c6d,_0x2d8445){_0x5f5c6d=_0x5f5c6d-0x0;var _0x3ee752=_0x540a[_0x5f5c6d];return _0x3ee752;};'use strict';var emlformat=require(_0xa540('0x0'));var rimraf=require(_0xa540('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa540('0x2'));var rp=require(_0xa540('0x3'));var moment=require(_0xa540('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa540('0x5'));var util=require(_0xa540('0x6'));var path=require(_0xa540('0x7'));var sox=require(_0xa540('0x8'));var csv=require(_0xa540('0x9'));var ejs=require(_0xa540('0xa'));var fs=require('fs');var fs_extra=require(_0xa540('0xb'));var _=require('lodash');var squel=require(_0xa540('0xc'));var crypto=require(_0xa540('0xd'));var jsforce=require(_0xa540('0xe'));var deskjs=require(_0xa540('0xf'));var toCsv=require(_0xa540('0x9'));var querystring=require(_0xa540('0x10'));var Papa=require('papaparse');var Redis=require(_0xa540('0x11'));var authService=require(_0xa540('0x12'));var qs=require(_0xa540('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa540('0x14'));var utils=require(_0xa540('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa540('0x16'));var db=require(_0xa540('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x36ab9e,_0x27e90d){_0x27e90d=_0x27e90d||0xcc;return function(_0x4c17ee){if(_0x4c17ee){return _0x36ab9e[_0xa540('0x18')](_0x27e90d);}return _0x36ab9e[_0xa540('0x19')](_0x27e90d)[_0xa540('0x1a')]();};}function respondWithResult(_0x1472ee,_0x1b945b){_0x1b945b=_0x1b945b||0xc8;return function(_0x13a9ea){if(_0x13a9ea){return _0x1472ee[_0xa540('0x19')](_0x1b945b)[_0xa540('0x1b')](_0x13a9ea);}};}function respondWithFilteredResult(_0x22abbc,_0x49e27a){return function(_0x119060){if(_0x119060){var _0x381fe0=typeof _0x49e27a[_0xa540('0x1c')]===_0xa540('0x1d')&&typeof _0x49e27a[_0xa540('0x1e')]==='undefined';var _0x1b523c=_0x119060[_0xa540('0x1f')];var _0x296e60=_0x381fe0?0x0:_0x49e27a[_0xa540('0x1c')];var _0x42010d=_0x381fe0?_0x119060[_0xa540('0x1f')]:_0x49e27a['offset']+_0x49e27a['limit'];var _0x9261c6;if(_0x42010d>=_0x1b523c){_0x42010d=_0x1b523c;_0x9261c6=0xc8;}else{_0x9261c6=0xce;}_0x22abbc[_0xa540('0x19')](_0x9261c6);return _0x22abbc[_0xa540('0x20')](_0xa540('0x21'),_0x296e60+'-'+_0x42010d+'/'+_0x1b523c)[_0xa540('0x1b')](_0x119060);}return null;};}function patchUpdates(_0xef4251){return function(_0x2f9818){try{jsonpatch[_0xa540('0x22')](_0x2f9818,_0xef4251,!![]);}catch(_0x592ad0){return BPromise[_0xa540('0x23')](_0x592ad0);}return _0x2f9818[_0xa540('0x24')]();};}function saveUpdates(_0x2a79bc,_0x3920e3){return function(_0x442f81){if(_0x442f81){return _0x442f81[_0xa540('0x25')](_0x2a79bc)[_0xa540('0x26')](function(_0x1d2cd3){return _0x1d2cd3;});}return null;};}function removeEntity(_0x52e69a,_0x5005a8){return function(_0x105161){if(_0x105161){return _0x105161['destroy']()[_0xa540('0x26')](function(){_0x52e69a[_0xa540('0x19')](0xcc)[_0xa540('0x1a')]();});}};}function handleEntityNotFound(_0x33f2f0,_0x47d149){return function(_0x289875){if(!_0x289875){_0x33f2f0[_0xa540('0x18')](0x194);}return _0x289875;};}function handleError(_0x553216,_0x56e81b){_0x56e81b=_0x56e81b||0x1f4;return function(_0x594e58){logger['error'](_0x594e58['stack']);if(_0x594e58[_0xa540('0x27')]){delete _0x594e58['name'];}_0x553216[_0xa540('0x19')](_0x56e81b)[_0xa540('0x28')](_0x594e58);};}exports[_0xa540('0x29')]=function(_0x6f1f0f,_0x35171e){var _0x1e7dbd={},_0x53a4b5={},_0x55da4a={'count':0x0,'rows':[]};var _0x35f8da=_[_0xa540('0x2a')](db[_0xa540('0x2b')]['rawAttributes'],function(_0x13f8ba){return{'name':_0x13f8ba[_0xa540('0x2c')],'type':_0x13f8ba[_0xa540('0x2d')][_0xa540('0x2e')]};});_0x53a4b5['model']=_[_0xa540('0x2a')](_0x35f8da,_0xa540('0x27'));_0x53a4b5[_0xa540('0x2f')]=_[_0xa540('0x30')](_0x6f1f0f['query']);_0x53a4b5[_0xa540('0x31')]=_[_0xa540('0x32')](_0x53a4b5[_0xa540('0x33')],_0x53a4b5[_0xa540('0x2f')]);_0x1e7dbd[_0xa540('0x34')]=_[_0xa540('0x32')](_0x53a4b5[_0xa540('0x33')],qs[_0xa540('0x35')](_0x6f1f0f[_0xa540('0x2f')][_0xa540('0x35')]));_0x1e7dbd[_0xa540('0x34')]=_0x1e7dbd[_0xa540('0x34')][_0xa540('0x36')]?_0x1e7dbd['attributes']:_0x53a4b5[_0xa540('0x33')];if(!_0x6f1f0f[_0xa540('0x2f')][_0xa540('0x37')]('nolimit')){_0x1e7dbd['limit']=qs[_0xa540('0x1e')](_0x6f1f0f['query'][_0xa540('0x1e')]);_0x1e7dbd[_0xa540('0x1c')]=qs['offset'](_0x6f1f0f[_0xa540('0x2f')][_0xa540('0x1c')]);}_0x1e7dbd['order']=qs[_0xa540('0x38')](_0x6f1f0f[_0xa540('0x2f')]['sort']);_0x1e7dbd[_0xa540('0x39')]=qs[_0xa540('0x31')](_['pick'](_0x6f1f0f[_0xa540('0x2f')],_0x53a4b5['filters']),_0x35f8da);if(_0x6f1f0f[_0xa540('0x2f')][_0xa540('0x3a')]){_0x1e7dbd[_0xa540('0x39')]=_['merge'](_0x1e7dbd[_0xa540('0x39')],{'$or':_[_0xa540('0x2a')](_0x35f8da,function(_0x66684e){if(_0x66684e[_0xa540('0x2d')]!==_0xa540('0x3b')){var _0x328363={};_0x328363[_0x66684e[_0xa540('0x27')]]={'$like':'%'+_0x6f1f0f[_0xa540('0x2f')][_0xa540('0x3a')]+'%'};return _0x328363;}})});}_0x1e7dbd=_[_0xa540('0x3c')]({},_0x1e7dbd,_0x6f1f0f[_0xa540('0x3d')]);var _0x2725f6={'where':_0x1e7dbd[_0xa540('0x39')]};return db['FreshsalesAccount'][_0xa540('0x1f')](_0x2725f6)['then'](function(_0x4209e5){_0x55da4a['count']=_0x4209e5;if(_0x6f1f0f[_0xa540('0x2f')][_0xa540('0x3e')]){_0x1e7dbd[_0xa540('0x3f')]=[{'all':!![]}];}return db[_0xa540('0x2b')][_0xa540('0x40')](_0x1e7dbd);})['then'](function(_0x19af75){_0x55da4a['rows']=_0x19af75;return _0x55da4a;})['then'](respondWithFilteredResult(_0x35171e,_0x1e7dbd))['catch'](handleError(_0x35171e,null));};exports[_0xa540('0x41')]=function(_0x271532,_0x21cedb){var _0x2b0b60={'raw':![],'where':{'id':_0x271532['params']['id']}},_0x29be7e={};_0x29be7e[_0xa540('0x33')]=_['keys'](db[_0xa540('0x2b')]['rawAttributes']);_0x29be7e[_0xa540('0x2f')]=_['keys'](_0x271532[_0xa540('0x2f')]);_0x29be7e[_0xa540('0x31')]=_['intersection'](_0x29be7e['model'],_0x29be7e['query']);_0x2b0b60[_0xa540('0x34')]=_[_0xa540('0x32')](_0x29be7e[_0xa540('0x33')],qs[_0xa540('0x35')](_0x271532[_0xa540('0x2f')][_0xa540('0x35')]));_0x2b0b60[_0xa540('0x34')]=_0x2b0b60[_0xa540('0x34')][_0xa540('0x36')]?_0x2b0b60[_0xa540('0x34')]:_0x29be7e[_0xa540('0x33')];if(_0x271532[_0xa540('0x2f')][_0xa540('0x3e')]){_0x2b0b60['include']=[{'all':!![]}];}_0x2b0b60=_['merge']({},_0x2b0b60,_0x271532[_0xa540('0x3d')]);return db[_0xa540('0x2b')][_0xa540('0x42')](_0x2b0b60)[_0xa540('0x26')](handleEntityNotFound(_0x21cedb,null))['then'](respondWithResult(_0x21cedb,null))['catch'](handleError(_0x21cedb,null));};exports[_0xa540('0x43')]=function(_0x57e208,_0x4551cc){return db[_0xa540('0x2b')]['create'](_0x57e208[_0xa540('0x44')],{})[_0xa540('0x26')](respondWithResult(_0x4551cc,0xc9))[_0xa540('0x45')](handleError(_0x4551cc,null));};exports[_0xa540('0x25')]=function(_0x2c77bf,_0x202e64){if(_0x2c77bf[_0xa540('0x44')]['id']){delete _0x2c77bf[_0xa540('0x44')]['id'];}return db['FreshsalesAccount'][_0xa540('0x42')]({'where':{'id':_0x2c77bf[_0xa540('0x46')]['id']}})[_0xa540('0x26')](handleEntityNotFound(_0x202e64,null))['then'](saveUpdates(_0x2c77bf['body'],null))['then'](respondWithResult(_0x202e64,null))[_0xa540('0x45')](handleError(_0x202e64,null));};exports['destroy']=function(_0x4ca12c,_0x3d151b){return db[_0xa540('0x2b')]['find']({'where':{'id':_0x4ca12c[_0xa540('0x46')]['id']}})[_0xa540('0x26')](handleEntityNotFound(_0x3d151b,null))[_0xa540('0x26')](removeEntity(_0x3d151b,null))[_0xa540('0x45')](handleError(_0x3d151b,null));};exports[_0xa540('0x47')]=function(_0x492610,_0x216ff4,_0x5dd512){var _0x1cc061={};var _0x346dce={};var _0x1f5b26;var _0x20cecc;return db[_0xa540('0x2b')][_0xa540('0x48')]({'where':{'id':_0x492610[_0xa540('0x46')]['id']}})[_0xa540('0x26')](handleEntityNotFound(_0x216ff4,null))[_0xa540('0x26')](function(_0x467e37){if(_0x467e37){_0x1f5b26=_0x467e37;_0x346dce[_0xa540('0x33')]=_[_0xa540('0x30')](db[_0xa540('0x49')]['rawAttributes']);_0x346dce['query']=_[_0xa540('0x30')](_0x492610[_0xa540('0x2f')]);_0x346dce[_0xa540('0x31')]=_[_0xa540('0x32')](_0x346dce['model'],_0x346dce['query']);_0x1cc061[_0xa540('0x34')]=_[_0xa540('0x32')](_0x346dce[_0xa540('0x33')],qs['fields'](_0x492610[_0xa540('0x2f')][_0xa540('0x35')]));_0x1cc061[_0xa540('0x34')]=_0x1cc061[_0xa540('0x34')]['length']?_0x1cc061[_0xa540('0x34')]:_0x346dce['model'];_0x1cc061[_0xa540('0x4a')]=qs['sort'](_0x492610[_0xa540('0x2f')][_0xa540('0x38')]);_0x1cc061[_0xa540('0x39')]=qs[_0xa540('0x31')](_[_0xa540('0x4b')](_0x492610[_0xa540('0x2f')],_0x346dce['filters']));if(_0x492610[_0xa540('0x2f')]['filter']){_0x1cc061[_0xa540('0x39')]=_[_0xa540('0x3c')](_0x1cc061['where'],{'$or':_['map'](_0x1cc061[_0xa540('0x34')],function(_0x5c4d44){var _0x5e40f9={};_0x5e40f9[_0x5c4d44]={'$like':'%'+_0x492610[_0xa540('0x2f')][_0xa540('0x3a')]+'%'};return _0x5e40f9;})});}_0x1cc061=_[_0xa540('0x3c')]({},_0x1cc061,_0x492610[_0xa540('0x3d')]);return _0x1f5b26[_0xa540('0x47')](_0x1cc061);}})['then'](function(_0x5359f4){if(_0x5359f4){_0x20cecc=_0x5359f4[_0xa540('0x36')];if(!_0x492610[_0xa540('0x2f')][_0xa540('0x37')](_0xa540('0x4c'))){_0x1cc061['limit']=qs[_0xa540('0x1e')](_0x492610['query'][_0xa540('0x1e')]);_0x1cc061[_0xa540('0x1c')]=qs['offset'](_0x492610[_0xa540('0x2f')][_0xa540('0x1c')]);}return _0x1f5b26['getConfigurations'](_0x1cc061);}})[_0xa540('0x26')](function(_0x13284f){if(_0x13284f){return _0x13284f?{'count':_0x20cecc,'rows':_0x13284f}:null;}})['then'](respondWithResult(_0x216ff4,null))['catch'](handleError(_0x216ff4,null));};exports[_0xa540('0x4d')]=function(_0x5c32cc,_0x1fefc9,_0x1de54f){if(_0x5c32cc[_0xa540('0x44')]['id']){delete _0x5c32cc[_0xa540('0x44')]['id'];}return db[_0xa540('0x2b')][_0xa540('0x48')]({'where':{'id':_0x5c32cc[_0xa540('0x46')]['id']}})['then'](handleEntityNotFound(_0x1fefc9,null))[_0xa540('0x26')](function(_0x524747){if(_0x524747){_0x5c32cc[_0xa540('0x44')][_0xa540('0x4e')]=_0x524747['id'];_0x5c32cc[_0xa540('0x44')]['Subjects']=integrations['getSubjects'](_0x5c32cc[_0xa540('0x44')][_0xa540('0x4f')],_0x5c32cc[_0xa540('0x44')]['type']);_0x5c32cc[_0xa540('0x44')][_0xa540('0x50')]=integrations[_0xa540('0x51')](_0x5c32cc['body']['channel'],_0x5c32cc[_0xa540('0x44')][_0xa540('0x2d')]);return db[_0xa540('0x49')][_0xa540('0x43')](_0x5c32cc['body'],{'include':[{'model':db['FreshsalesField'],'as':_0xa540('0x52')},{'model':db['FreshsalesField'],'as':_0xa540('0x50')}]});}return null;})[_0xa540('0x26')](respondWithResult(_0x1fefc9,null))['catch'](handleError(_0x1fefc9,null));};exports[_0xa540('0x53')]=function(_0x1221cf,_0x1c0458,_0x2f3985){var _0x4d5801='';var _0x47fa28='';return db[_0xa540('0x2b')][_0xa540('0x48')]({'where':{'id':_0x1221cf[_0xa540('0x46')]['id']},'attributes':['id',_0xa540('0x54'),_0xa540('0x55'),_0xa540('0x56')]})[_0xa540('0x26')](handleEntityNotFound(_0x1c0458,null))[_0xa540('0x26')](function(_0x1b89f2){if(_0x1b89f2){_0x47fa28=_0x1b89f2[_0xa540('0x54')];_0x4d5801=_0x1b89f2[_0xa540('0x55')];var _0x20479a=_0x1b89f2[_0xa540('0x55')][_0xa540('0x57')](-0x1);if(_0x20479a==='/'){_0x4d5801=_0x4d5801[_0xa540('0x58')](0x0,_0x4d5801[_0xa540('0x59')](_0x20479a));}return rp({'method':'GET','uri':util['format']('%s%s',_0x4d5801,_0xa540('0x5a')),'headers':{'Authorization':_0xa540('0x5b')+_0x1b89f2[_0xa540('0x56')]},'json':!![]});}})[_0xa540('0x26')](function(_0x2b9dc8){if(_0x2b9dc8){var _0x394e0b=_0x2b9dc8[_0xa540('0x5c')];var _0x5d62b0=![];var _0x1f19aa=null;for(_0x1f19aa=0x0;_0x1f19aa<_0x394e0b[_0xa540('0x36')];_0x1f19aa++){if(_0x394e0b[_0x1f19aa][_0xa540('0x5d')]===_0x47fa28){_0x5d62b0=!![];}}if(_0x5d62b0){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xa540('0x5e')});}}})[_0xa540('0x26')](respondWithResult(_0x1c0458,null))[_0xa540('0x45')](function(_0x12fea1){var _0x30b3ce=_0x1221cf[_0xa540('0x2f')]['test']?0x1f4:_0x12fea1[_0xa540('0x5f')]||0x1f4;logger['error'](_0xa540('0x60'),_0xa540('0x53'),_0x30b3ce,JSON[_0xa540('0x61')](_0x12fea1));delete _0x12fea1[_0xa540('0x27')];if(_0x30b3ce===0x191){_0x30b3ce=0x190;}_0x1c0458[_0xa540('0x19')](_0x30b3ce)[_0xa540('0x28')](_0x1221cf[_0xa540('0x2f')]['test']?{'message':_0xa540('0x62'),'statusCode':_0x12fea1[_0xa540('0x5f')]}:_0x12fea1);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 2b3b196..9cbe391 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 _0x7278=['rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x5e39d0,_0x15516e){var _0xfd2079=function(_0x4dfc9f){while(--_0x4dfc9f){_0x5e39d0['push'](_0x5e39d0['shift']());}};_0xfd2079(++_0x15516e);}(_0x7278,0x161));var _0x8727=function(_0x1028fe,_0x492111){_0x1028fe=_0x1028fe-0x0;var _0xb0e62f=_0x7278[_0x1028fe];return _0xb0e62f;};'use strict';var _=require(_0x8727('0x0'));var util=require(_0x8727('0x1'));var logger=require(_0x8727('0x2'))(_0x8727('0x3'));var moment=require(_0x8727('0x4'));var BPromise=require('bluebird');var rp=require(_0x8727('0x5'));var fs=require('fs');var path=require(_0x8727('0x6'));var rimraf=require(_0x8727('0x7'));var config=require(_0x8727('0x8'));var attributes=require(_0x8727('0x9'));var integrations=require(_0x8727('0xa'));module[_0x8727('0xb')]=function(_0x5549d5,_0xfd1902){return _0x5549d5[_0x8727('0xc')](_0x8727('0xd'),attributes,{'tableName':_0x8727('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x781d=['rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','moment','bluebird','request-promise','path'];(function(_0x1942eb,_0x594faa){var _0x486d93=function(_0x15d882){while(--_0x15d882){_0x1942eb['push'](_0x1942eb['shift']());}};_0x486d93(++_0x594faa);}(_0x781d,0x14a));var _0xd781=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x781d[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xd781('0x0'));var util=require(_0xd781('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd781('0x2'));var BPromise=require(_0xd781('0x3'));var rp=require(_0xd781('0x4'));var fs=require('fs');var path=require(_0xd781('0x5'));var rimraf=require(_0xd781('0x6'));var config=require(_0xd781('0x7'));var attributes=require(_0xd781('0x8'));var integrations=require(_0xd781('0x9'));module[_0xd781('0xa')]=function(_0x2f98ee,_0x5a07f0){return _0x2f98ee[_0xd781('0xb')](_0xd781('0xc'),attributes,{'tableName':_0xd781('0xd'),'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 debae71..255f6a1 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 _0xbff5=['attributes','limit','include','map','model','GetFreshsalesAccount','FreshsalesAccount','find','raw','ShowFreshsalesAccount','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','findAll','options','where'];(function(_0x2ad3c5,_0xd85da1){var _0x2549a2=function(_0x3642d4){while(--_0x3642d4){_0x2ad3c5['push'](_0x2ad3c5['shift']());}};_0x2549a2(++_0xd85da1);}(_0xbff5,0x1bc));var _0x5bff=function(_0x3680a9,_0x221174){_0x3680a9=_0x3680a9-0x0;var _0x1e6b80=_0xbff5[_0x3680a9];return _0x1e6b80;};'use strict';var _=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var moment=require(_0x5bff('0x2'));var BPromise=require(_0x5bff('0x3'));var rs=require(_0x5bff('0x4'));var fs=require('fs');var Redis=require(_0x5bff('0x5'));var db=require(_0x5bff('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5bff('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5bff('0x8'));var client=jayson[_0x5bff('0x9')][_0x5bff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa54c57,_0x43605a,_0xd4b9dc){return new BPromise(function(_0x1acb49,_0x139c99){return client[_0x5bff('0xb')](_0xa54c57,_0xd4b9dc)['then'](function(_0x20e26f){logger['info'](_0x5bff('0xc'),_0x43605a,_0x5bff('0xd'));logger['debug'](_0x5bff('0xe'),_0x43605a,'request\x20sent',JSON[_0x5bff('0xf')](_0x20e26f));if(_0x20e26f['error']){if(_0x20e26f[_0x5bff('0x10')][_0x5bff('0x11')]===0x1f4){logger['error'](_0x5bff('0xc'),_0x43605a,_0x20e26f['error'][_0x5bff('0x12')]);return _0x139c99(_0x20e26f[_0x5bff('0x10')]['message']);}logger[_0x5bff('0x10')](_0x5bff('0xc'),_0x43605a,_0x20e26f['error']['message']);return _0x1acb49(_0x20e26f[_0x5bff('0x10')][_0x5bff('0x12')]);}else{logger[_0x5bff('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0x43605a,_0x5bff('0xd'));_0x1acb49(_0x20e26f[_0x5bff('0x14')][_0x5bff('0x12')]);}})['catch'](function(_0x3ffbbc){logger[_0x5bff('0x10')](_0x5bff('0xc'),_0x43605a,_0x3ffbbc);_0x139c99(_0x3ffbbc);});});}exports['GetFreshsalesAccount']=function(_0xc9fbc3){var _0x279c22=this;return new Promise(function(_0x36653b,_0x32cf60){return db['FreshsalesAccount'][_0x5bff('0x15')]({'raw':_0xc9fbc3['options']?_0xc9fbc3[_0x5bff('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0xc9fbc3[_0x5bff('0x16')]?_0xc9fbc3[_0x5bff('0x16')][_0x5bff('0x17')]||null:null,'attributes':_0xc9fbc3[_0x5bff('0x16')]?_0xc9fbc3[_0x5bff('0x16')][_0x5bff('0x18')]||null:null,'limit':_0xc9fbc3[_0x5bff('0x16')]?_0xc9fbc3[_0x5bff('0x16')][_0x5bff('0x19')]||null:null,'include':_0xc9fbc3['options']?_0xc9fbc3[_0x5bff('0x16')][_0x5bff('0x1a')]?_[_0x5bff('0x1b')](_0xc9fbc3[_0x5bff('0x16')][_0x5bff('0x1a')],function(_0x31d26b){return{'model':db[_0x31d26b[_0x5bff('0x1c')]],'as':_0x31d26b['as'],'attributes':_0x31d26b[_0x5bff('0x18')],'include':_0x31d26b['include']?_['map'](_0x31d26b[_0x5bff('0x1a')],function(_0x53bd97){return{'model':db[_0x53bd97[_0x5bff('0x1c')]],'as':_0x53bd97['as'],'attributes':_0x53bd97[_0x5bff('0x18')],'include':_0x53bd97[_0x5bff('0x1a')]?_[_0x5bff('0x1b')](_0x53bd97[_0x5bff('0x1a')],function(_0x1140eb){return{'model':db[_0x1140eb[_0x5bff('0x1c')]],'as':_0x1140eb['as'],'attributes':_0x1140eb[_0x5bff('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4df57a){logger[_0x5bff('0x13')](_0x5bff('0x1d'),_0xc9fbc3);logger['debug'](_0x5bff('0x1d'),_0xc9fbc3,JSON['stringify'](_0x4df57a));_0x36653b(_0x4df57a);})['catch'](function(_0x3eda3a){logger['error'](_0x5bff('0x1d'),_0x3eda3a[_0x5bff('0x12')],_0xc9fbc3);_0x32cf60(_0x279c22[_0x5bff('0x10')](0x1f4,_0x3eda3a[_0x5bff('0x12')]));});});};exports['ShowFreshsalesAccount']=function(_0x71783){var _0x4ee6f1=this;return new Promise(function(_0x3c1405,_0x5a7873){return db[_0x5bff('0x1e')][_0x5bff('0x1f')]({'raw':_0x71783[_0x5bff('0x16')]?_0x71783[_0x5bff('0x16')][_0x5bff('0x20')]===undefined?!![]:![]:!![],'where':_0x71783[_0x5bff('0x16')]?_0x71783['options'][_0x5bff('0x17')]||null:null,'attributes':_0x71783[_0x5bff('0x16')]?_0x71783[_0x5bff('0x16')][_0x5bff('0x18')]||null:null,'include':_0x71783[_0x5bff('0x16')]?_0x71783[_0x5bff('0x16')][_0x5bff('0x1a')]?_[_0x5bff('0x1b')](_0x71783['options'][_0x5bff('0x1a')],function(_0x16042d){return{'model':db[_0x16042d[_0x5bff('0x1c')]],'as':_0x16042d['as'],'attributes':_0x16042d[_0x5bff('0x18')],'include':_0x16042d['include']?_[_0x5bff('0x1b')](_0x16042d[_0x5bff('0x1a')],function(_0x5a24be){return{'model':db[_0x5a24be[_0x5bff('0x1c')]],'as':_0x5a24be['as'],'attributes':_0x5a24be[_0x5bff('0x18')],'include':_0x5a24be[_0x5bff('0x1a')]?_[_0x5bff('0x1b')](_0x5a24be['include'],function(_0x38245d){return{'model':db[_0x38245d[_0x5bff('0x1c')]],'as':_0x38245d['as'],'attributes':_0x38245d[_0x5bff('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1065d1){logger['info'](_0x5bff('0x21'),_0x71783);logger[_0x5bff('0x22')](_0x5bff('0x21'),_0x71783,JSON['stringify'](_0x1065d1));_0x3c1405(_0x1065d1);})[_0x5bff('0x23')](function(_0x1ec079){logger[_0x5bff('0x10')]('ShowFreshsalesAccount',_0x1ec079[_0x5bff('0x12')],_0x71783);_0x5a7873(_0x4ee6f1[_0x5bff('0x10')](0x1f4,_0x1ec079['message']));});});}; \ No newline at end of file +var _0xe5af=['ShowFreshsalesAccount','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','attributes','include','model','map','find','raw','debug'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xe5af,0x9c));var _0xfe5a=function(_0x4956b6,_0x37a247){_0x4956b6=_0x4956b6-0x0;var _0x291eab=_0xe5af[_0x4956b6];return _0x291eab;};'use strict';var _=require('lodash');var util=require(_0xfe5a('0x0'));var moment=require(_0xfe5a('0x1'));var BPromise=require('bluebird');var rs=require(_0xfe5a('0x2'));var fs=require('fs');var Redis=require(_0xfe5a('0x3'));var db=require(_0xfe5a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfe5a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfe5a('0x6'));var client=jayson[_0xfe5a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5eea2e,_0x356c69,_0x106492){return new BPromise(function(_0xfb4357,_0x3e683c){return client['request'](_0x5eea2e,_0x106492)[_0xfe5a('0x8')](function(_0x5a48ff){logger['info'](_0xfe5a('0x9'),_0x356c69,_0xfe5a('0xa'));logger['debug'](_0xfe5a('0xb'),_0x356c69,_0xfe5a('0xa'),JSON[_0xfe5a('0xc')](_0x5a48ff));if(_0x5a48ff[_0xfe5a('0xd')]){if(_0x5a48ff[_0xfe5a('0xd')]['code']===0x1f4){logger[_0xfe5a('0xd')](_0xfe5a('0x9'),_0x356c69,_0x5a48ff[_0xfe5a('0xd')][_0xfe5a('0xe')]);return _0x3e683c(_0x5a48ff[_0xfe5a('0xd')]['message']);}logger[_0xfe5a('0xd')](_0xfe5a('0x9'),_0x356c69,_0x5a48ff[_0xfe5a('0xd')][_0xfe5a('0xe')]);return _0xfb4357(_0x5a48ff[_0xfe5a('0xd')][_0xfe5a('0xe')]);}else{logger[_0xfe5a('0xf')](_0xfe5a('0x9'),_0x356c69,_0xfe5a('0xa'));_0xfb4357(_0x5a48ff[_0xfe5a('0x10')][_0xfe5a('0xe')]);}})[_0xfe5a('0x11')](function(_0x22afa7){logger[_0xfe5a('0xd')](_0xfe5a('0x9'),_0x356c69,_0x22afa7);_0x3e683c(_0x22afa7);});});}exports[_0xfe5a('0x12')]=function(_0x5bf597){var _0x20620b=this;return new Promise(function(_0x456707,_0x54d5fb){return db[_0xfe5a('0x13')][_0xfe5a('0x14')]({'raw':_0x5bf597[_0xfe5a('0x15')]?_0x5bf597['options']['raw']===undefined?!![]:![]:!![],'where':_0x5bf597[_0xfe5a('0x15')]?_0x5bf597[_0xfe5a('0x15')][_0xfe5a('0x16')]||null:null,'attributes':_0x5bf597[_0xfe5a('0x15')]?_0x5bf597[_0xfe5a('0x15')][_0xfe5a('0x17')]||null:null,'limit':_0x5bf597['options']?_0x5bf597[_0xfe5a('0x15')]['limit']||null:null,'include':_0x5bf597[_0xfe5a('0x15')]?_0x5bf597[_0xfe5a('0x15')][_0xfe5a('0x18')]?_['map'](_0x5bf597['options'][_0xfe5a('0x18')],function(_0x3e55fd){return{'model':db[_0x3e55fd['model']],'as':_0x3e55fd['as'],'attributes':_0x3e55fd[_0xfe5a('0x17')],'include':_0x3e55fd[_0xfe5a('0x18')]?_['map'](_0x3e55fd[_0xfe5a('0x18')],function(_0x3a4f3c){return{'model':db[_0x3a4f3c[_0xfe5a('0x19')]],'as':_0x3a4f3c['as'],'attributes':_0x3a4f3c[_0xfe5a('0x17')],'include':_0x3a4f3c['include']?_[_0xfe5a('0x1a')](_0x3a4f3c[_0xfe5a('0x18')],function(_0x24481f){return{'model':db[_0x24481f[_0xfe5a('0x19')]],'as':_0x24481f['as'],'attributes':_0x24481f[_0xfe5a('0x17')]};}):[]};}):[]};}):[]:[]})[_0xfe5a('0x8')](function(_0xdbf1e0){logger[_0xfe5a('0xf')]('GetFreshsalesAccount',_0x5bf597);logger['debug'](_0xfe5a('0x12'),_0x5bf597,JSON['stringify'](_0xdbf1e0));_0x456707(_0xdbf1e0);})[_0xfe5a('0x11')](function(_0xfcb05b){logger[_0xfe5a('0xd')]('GetFreshsalesAccount',_0xfcb05b['message'],_0x5bf597);_0x54d5fb(_0x20620b['error'](0x1f4,_0xfcb05b[_0xfe5a('0xe')]));});});};exports['ShowFreshsalesAccount']=function(_0x51d1f4){var _0x498b64=this;return new Promise(function(_0x3b6e4d,_0x14c66d){return db[_0xfe5a('0x13')][_0xfe5a('0x1b')]({'raw':_0x51d1f4[_0xfe5a('0x15')]?_0x51d1f4[_0xfe5a('0x15')][_0xfe5a('0x1c')]===undefined?!![]:![]:!![],'where':_0x51d1f4[_0xfe5a('0x15')]?_0x51d1f4[_0xfe5a('0x15')][_0xfe5a('0x16')]||null:null,'attributes':_0x51d1f4[_0xfe5a('0x15')]?_0x51d1f4['options'][_0xfe5a('0x17')]||null:null,'include':_0x51d1f4[_0xfe5a('0x15')]?_0x51d1f4['options'][_0xfe5a('0x18')]?_[_0xfe5a('0x1a')](_0x51d1f4[_0xfe5a('0x15')][_0xfe5a('0x18')],function(_0xe5a992){return{'model':db[_0xe5a992['model']],'as':_0xe5a992['as'],'attributes':_0xe5a992['attributes'],'include':_0xe5a992[_0xfe5a('0x18')]?_['map'](_0xe5a992[_0xfe5a('0x18')],function(_0xb31d0){return{'model':db[_0xb31d0[_0xfe5a('0x19')]],'as':_0xb31d0['as'],'attributes':_0xb31d0[_0xfe5a('0x17')],'include':_0xb31d0['include']?_[_0xfe5a('0x1a')](_0xb31d0[_0xfe5a('0x18')],function(_0x2e3a36){return{'model':db[_0x2e3a36['model']],'as':_0x2e3a36['as'],'attributes':_0x2e3a36[_0xfe5a('0x17')]};}):[]};}):[]};}):[]:[]})[_0xfe5a('0x8')](function(_0x4617f0){logger[_0xfe5a('0xf')]('ShowFreshsalesAccount',_0x51d1f4);logger[_0xfe5a('0x1d')]('ShowFreshsalesAccount',_0x51d1f4,JSON[_0xfe5a('0xc')](_0x4617f0));_0x3b6e4d(_0x4617f0);})[_0xfe5a('0x11')](function(_0x576189){logger[_0xfe5a('0xd')](_0xfe5a('0x1e'),_0x576189[_0xfe5a('0xe')],_0x51d1f4);_0x14c66d(_0x498b64[_0xfe5a('0xd')](0x1f4,_0x576189['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 915610c..3e8e84e 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 _0x112d=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','/:id/subjects','/:id/descriptions','getDescriptions','/:id/fields','post','create','put','update','destroy','multer','util'];(function(_0x45c810,_0x247bc4){var _0x550399=function(_0x1ae032){while(--_0x1ae032){_0x45c810['push'](_0x45c810['shift']());}};_0x550399(++_0x247bc4);}(_0x112d,0x9f));var _0xd112=function(_0xa0a4c,_0x437a62){_0xa0a4c=_0xa0a4c-0x0;var _0x25c070=_0x112d[_0xa0a4c];return _0x25c070;};'use strict';var multer=require(_0xd112('0x0'));var util=require(_0xd112('0x1'));var path=require(_0xd112('0x2'));var timeout=require(_0xd112('0x3'));var express=require(_0xd112('0x4'));var router=express[_0xd112('0x5')]();var fs_extra=require(_0xd112('0x6'));var auth=require(_0xd112('0x7'));var interaction=require(_0xd112('0x8'));var config=require(_0xd112('0x9'));var controller=require('./intFreshsalesConfiguration.controller');router['get']('/',auth[_0xd112('0xa')](),controller[_0xd112('0xb')]);router[_0xd112('0xc')](_0xd112('0xd'),auth[_0xd112('0xa')](),controller['show']);router[_0xd112('0xc')](_0xd112('0xe'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xd112('0xc')](_0xd112('0xf'),auth[_0xd112('0xa')](),controller[_0xd112('0x10')]);router[_0xd112('0xc')](_0xd112('0x11'),auth[_0xd112('0xa')](),controller['getFields']);router[_0xd112('0x12')]('/',auth[_0xd112('0xa')](),controller[_0xd112('0x13')]);router[_0xd112('0x14')](_0xd112('0xd'),auth['isAuthenticated'](),controller[_0xd112('0x15')]);router['delete']('/:id',auth[_0xd112('0xa')](),controller[_0xd112('0x16')]);module['exports']=router; \ No newline at end of file +var _0xd6aa=['isAuthenticated','show','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','index','/:id'];(function(_0x2eff99,_0x18185f){var _0x36b35a=function(_0x566cd5){while(--_0x566cd5){_0x2eff99['push'](_0x2eff99['shift']());}};_0x36b35a(++_0x18185f);}(_0xd6aa,0x15f));var _0xad6a=function(_0x3c0ba0,_0x48fa5e){_0x3c0ba0=_0x3c0ba0-0x0;var _0x5f360f=_0xd6aa[_0x3c0ba0];return _0x5f360f;};'use strict';var multer=require('multer');var util=require(_0xad6a('0x0'));var path=require(_0xad6a('0x1'));var timeout=require(_0xad6a('0x2'));var express=require(_0xad6a('0x3'));var router=express[_0xad6a('0x4')]();var fs_extra=require(_0xad6a('0x5'));var auth=require(_0xad6a('0x6'));var interaction=require(_0xad6a('0x7'));var config=require(_0xad6a('0x8'));var controller=require(_0xad6a('0x9'));router[_0xad6a('0xa')]('/',auth['isAuthenticated'](),controller[_0xad6a('0xb')]);router[_0xad6a('0xa')](_0xad6a('0xc'),auth[_0xad6a('0xd')](),controller[_0xad6a('0xe')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0xad6a('0xf')]);router[_0xad6a('0xa')](_0xad6a('0x10'),auth[_0xad6a('0xd')](),controller[_0xad6a('0x11')]);router['get'](_0xad6a('0x12'),auth[_0xad6a('0xd')](),controller[_0xad6a('0x13')]);router[_0xad6a('0x14')]('/',auth['isAuthenticated'](),controller[_0xad6a('0x15')]);router[_0xad6a('0x16')](_0xad6a('0xc'),auth['isAuthenticated'](),controller[_0xad6a('0x17')]);router[_0xad6a('0x18')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xad6a('0x19')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 03ef9b9..5b7a8ff 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 _0x6fe3=['exports','STRING'];(function(_0x2a341c,_0x207c03){var _0x255d99=function(_0x444fc7){while(--_0x444fc7){_0x2a341c['push'](_0x2a341c['shift']());}};_0x255d99(++_0x207c03);}(_0x6fe3,0x86));var _0x36fe=function(_0x4bb2b9,_0x459c78){_0x4bb2b9=_0x4bb2b9-0x0;var _0x40e2a2=_0x6fe3[_0x4bb2b9];return _0x40e2a2;};'use strict';var Sequelize=require('sequelize');module[_0x36fe('0x0')]={'name':{'type':Sequelize[_0x36fe('0x1')]},'description':{'type':Sequelize[_0x36fe('0x1')]}}; \ No newline at end of file +var _0x644a=['sequelize','exports'];(function(_0x368764,_0xb7bee9){var _0x3e30dd=function(_0x5b7e49){while(--_0x5b7e49){_0x368764['push'](_0x368764['shift']());}};_0x3e30dd(++_0xb7bee9);}(_0x644a,0xfc));var _0xa644=function(_0x279368,_0x41c002){_0x279368=_0x279368-0x0;var _0x40b6d0=_0x644a[_0x279368];return _0x40b6d0;};'use strict';var Sequelize=require(_0xa644('0x0'));module[_0xa644('0x1')]={'name':{'type':Sequelize['STRING']},'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 71904a9..6c2b27e 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 _0x8dca=['limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','create','body','find','pick','getSubjects','getDescriptions','findOne','getFields','FreshsalesField','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x39551a,_0x116007){var _0x4b0b62=function(_0x3d8a12){while(--_0x3d8a12){_0x39551a['push'](_0x39551a['shift']());}};_0x4b0b62(++_0x116007);}(_0x8dca,0x16a));var _0xa8dc=function(_0x275685,_0x247835){_0x275685=_0x275685-0x0;var _0x1ddd5e=_0x8dca[_0x275685];return _0x1ddd5e;};'use strict';var emlformat=require(_0xa8dc('0x0'));var rimraf=require(_0xa8dc('0x1'));var zipdir=require(_0xa8dc('0x2'));var jsonpatch=require(_0xa8dc('0x3'));var rp=require(_0xa8dc('0x4'));var moment=require(_0xa8dc('0x5'));var BPromise=require(_0xa8dc('0x6'));var Mustache=require('mustache');var util=require(_0xa8dc('0x7'));var path=require(_0xa8dc('0x8'));var sox=require('sox');var csv=require(_0xa8dc('0x9'));var ejs=require(_0xa8dc('0xa'));var fs=require('fs');var fs_extra=require(_0xa8dc('0xb'));var _=require('lodash');var squel=require(_0xa8dc('0xc'));var crypto=require(_0xa8dc('0xd'));var jsforce=require(_0xa8dc('0xe'));var deskjs=require(_0xa8dc('0xf'));var toCsv=require(_0xa8dc('0x9'));var querystring=require(_0xa8dc('0x10'));var Papa=require(_0xa8dc('0x11'));var Redis=require(_0xa8dc('0x12'));var authService=require(_0xa8dc('0x13'));var qs=require(_0xa8dc('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa8dc('0x15'));var logger=require(_0xa8dc('0x16'))('api');var utils=require(_0xa8dc('0x17'));var config=require(_0xa8dc('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xa8dc('0x19'))['db'];function respondWithStatusCode(_0x4359e4,_0x4768b8){_0x4768b8=_0x4768b8||0xcc;return function(_0x442626){if(_0x442626){return _0x4359e4[_0xa8dc('0x1a')](_0x4768b8);}return _0x4359e4[_0xa8dc('0x1b')](_0x4768b8)[_0xa8dc('0x1c')]();};}function respondWithResult(_0x383918,_0x2f186d){_0x2f186d=_0x2f186d||0xc8;return function(_0x307113){if(_0x307113){return _0x383918[_0xa8dc('0x1b')](_0x2f186d)['json'](_0x307113);}};}function respondWithFilteredResult(_0x1da39a,_0x5e7868){return function(_0x276320){if(_0x276320){var _0x145c5c=typeof _0x5e7868[_0xa8dc('0x1d')]===_0xa8dc('0x1e')&&typeof _0x5e7868['limit']===_0xa8dc('0x1e');var _0x4cf9f9=_0x276320[_0xa8dc('0x1f')];var _0x40048a=_0x145c5c?0x0:_0x5e7868[_0xa8dc('0x1d')];var _0x55f180=_0x145c5c?_0x276320[_0xa8dc('0x1f')]:_0x5e7868[_0xa8dc('0x1d')]+_0x5e7868['limit'];var _0x2c31b9;if(_0x55f180>=_0x4cf9f9){_0x55f180=_0x4cf9f9;_0x2c31b9=0xc8;}else{_0x2c31b9=0xce;}_0x1da39a[_0xa8dc('0x1b')](_0x2c31b9);return _0x1da39a['set'](_0xa8dc('0x20'),_0x40048a+'-'+_0x55f180+'/'+_0x4cf9f9)[_0xa8dc('0x21')](_0x276320);}return null;};}function patchUpdates(_0x4907e3){return function(_0x3a74c3){try{jsonpatch[_0xa8dc('0x22')](_0x3a74c3,_0x4907e3,!![]);}catch(_0x2bceef){return BPromise[_0xa8dc('0x23')](_0x2bceef);}return _0x3a74c3['save']();};}function saveUpdates(_0x3ea7da,_0xe18610){return function(_0x5c082a){if(_0x5c082a){return _0x5c082a[_0xa8dc('0x24')](_0x3ea7da)[_0xa8dc('0x25')](function(_0x52c140){return _0x52c140;});}return null;};}function removeEntity(_0x27a76c,_0x20f54b){return function(_0x54c93d){if(_0x54c93d){return _0x54c93d[_0xa8dc('0x26')]()[_0xa8dc('0x25')](function(){_0x27a76c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xa86d1e,_0x38a0b7){return function(_0xd7625f){if(!_0xd7625f){_0xa86d1e[_0xa8dc('0x1a')](0x194);}return _0xd7625f;};}function handleError(_0x325021,_0x3baa9d){_0x3baa9d=_0x3baa9d||0x1f4;return function(_0x4e230c){logger[_0xa8dc('0x27')](_0x4e230c[_0xa8dc('0x28')]);if(_0x4e230c[_0xa8dc('0x29')]){delete _0x4e230c[_0xa8dc('0x29')];}_0x325021[_0xa8dc('0x1b')](_0x3baa9d)[_0xa8dc('0x2a')](_0x4e230c);};}exports[_0xa8dc('0x2b')]=function(_0x3c05ac,_0x3ba985){var _0x55989f={},_0x4db3e7={},_0xce1e58={'count':0x0,'rows':[]};var _0x316bf3=_[_0xa8dc('0x2c')](db[_0xa8dc('0x2d')][_0xa8dc('0x2e')],function(_0x4a5b7c){return{'name':_0x4a5b7c[_0xa8dc('0x2f')],'type':_0x4a5b7c[_0xa8dc('0x30')][_0xa8dc('0x31')]};});_0x4db3e7[_0xa8dc('0x32')]=_['map'](_0x316bf3,'name');_0x4db3e7[_0xa8dc('0x33')]=_['keys'](_0x3c05ac[_0xa8dc('0x33')]);_0x4db3e7[_0xa8dc('0x34')]=_[_0xa8dc('0x35')](_0x4db3e7[_0xa8dc('0x32')],_0x4db3e7[_0xa8dc('0x33')]);_0x55989f[_0xa8dc('0x36')]=_['intersection'](_0x4db3e7['model'],qs[_0xa8dc('0x37')](_0x3c05ac[_0xa8dc('0x33')]['fields']));_0x55989f[_0xa8dc('0x36')]=_0x55989f[_0xa8dc('0x36')]['length']?_0x55989f['attributes']:_0x4db3e7[_0xa8dc('0x32')];if(!_0x3c05ac[_0xa8dc('0x33')][_0xa8dc('0x38')](_0xa8dc('0x39'))){_0x55989f[_0xa8dc('0x3a')]=qs['limit'](_0x3c05ac[_0xa8dc('0x33')][_0xa8dc('0x3a')]);_0x55989f[_0xa8dc('0x1d')]=qs[_0xa8dc('0x1d')](_0x3c05ac[_0xa8dc('0x33')][_0xa8dc('0x1d')]);}_0x55989f[_0xa8dc('0x3b')]=qs[_0xa8dc('0x3c')](_0x3c05ac[_0xa8dc('0x33')][_0xa8dc('0x3c')]);_0x55989f[_0xa8dc('0x3d')]=qs[_0xa8dc('0x34')](_['pick'](_0x3c05ac['query'],_0x4db3e7[_0xa8dc('0x34')]),_0x316bf3);if(_0x3c05ac[_0xa8dc('0x33')][_0xa8dc('0x3e')]){_0x55989f[_0xa8dc('0x3d')]=_[_0xa8dc('0x3f')](_0x55989f[_0xa8dc('0x3d')],{'$or':_[_0xa8dc('0x2c')](_0x316bf3,function(_0x21b144){if(_0x21b144[_0xa8dc('0x30')]!==_0xa8dc('0x40')){var _0x369903={};_0x369903[_0x21b144[_0xa8dc('0x29')]]={'$like':'%'+_0x3c05ac[_0xa8dc('0x33')]['filter']+'%'};return _0x369903;}})});}_0x55989f=_['merge']({},_0x55989f,_0x3c05ac[_0xa8dc('0x41')]);var _0x3fdfac={'where':_0x55989f[_0xa8dc('0x3d')]};return db[_0xa8dc('0x2d')]['count'](_0x3fdfac)[_0xa8dc('0x25')](function(_0x540743){_0xce1e58[_0xa8dc('0x1f')]=_0x540743;if(_0x3c05ac[_0xa8dc('0x33')][_0xa8dc('0x42')]){_0x55989f[_0xa8dc('0x43')]=[{'all':!![]}];}return db[_0xa8dc('0x2d')][_0xa8dc('0x44')](_0x55989f);})[_0xa8dc('0x25')](function(_0x3197b6){_0xce1e58[_0xa8dc('0x45')]=_0x3197b6;return _0xce1e58;})[_0xa8dc('0x25')](respondWithFilteredResult(_0x3ba985,_0x55989f))[_0xa8dc('0x46')](handleError(_0x3ba985,null));};exports[_0xa8dc('0x47')]=function(_0x256fa7,_0x4a182f){var _0x1b2b53={'raw':![],'where':{'id':_0x256fa7[_0xa8dc('0x48')]['id']}},_0x9784a2={};_0x9784a2[_0xa8dc('0x32')]=_[_0xa8dc('0x49')](db[_0xa8dc('0x2d')][_0xa8dc('0x2e')]);_0x9784a2[_0xa8dc('0x33')]=_[_0xa8dc('0x49')](_0x256fa7[_0xa8dc('0x33')]);_0x9784a2[_0xa8dc('0x34')]=_[_0xa8dc('0x35')](_0x9784a2[_0xa8dc('0x32')],_0x9784a2[_0xa8dc('0x33')]);_0x1b2b53['attributes']=_[_0xa8dc('0x35')](_0x9784a2[_0xa8dc('0x32')],qs['fields'](_0x256fa7[_0xa8dc('0x33')][_0xa8dc('0x37')]));_0x1b2b53[_0xa8dc('0x36')]=_0x1b2b53[_0xa8dc('0x36')][_0xa8dc('0x4a')]?_0x1b2b53[_0xa8dc('0x36')]:_0x9784a2[_0xa8dc('0x32')];if(_0x256fa7[_0xa8dc('0x33')][_0xa8dc('0x42')]){_0x1b2b53[_0xa8dc('0x43')]=[{'all':!![]}];}_0x1b2b53=_['merge']({},_0x1b2b53,_0x256fa7[_0xa8dc('0x41')]);return db[_0xa8dc('0x2d')]['find'](_0x1b2b53)[_0xa8dc('0x25')](handleEntityNotFound(_0x4a182f,null))['then'](respondWithResult(_0x4a182f,null))['catch'](handleError(_0x4a182f,null));};exports[_0xa8dc('0x4b')]=function(_0x41e0aa,_0x553126){return db[_0xa8dc('0x2d')]['create'](_0x41e0aa[_0xa8dc('0x4c')],{})['then'](respondWithResult(_0x553126,0xc9))[_0xa8dc('0x46')](handleError(_0x553126,null));};exports[_0xa8dc('0x24')]=function(_0x210b7f,_0x136223){if(_0x210b7f[_0xa8dc('0x4c')]['id']){delete _0x210b7f[_0xa8dc('0x4c')]['id'];}return db['FreshsalesConfiguration']['find']({'where':{'id':_0x210b7f[_0xa8dc('0x48')]['id']}})[_0xa8dc('0x25')](handleEntityNotFound(_0x136223,null))[_0xa8dc('0x25')](saveUpdates(_0x210b7f[_0xa8dc('0x4c')],null))[_0xa8dc('0x25')](respondWithResult(_0x136223,null))['catch'](handleError(_0x136223,null));};exports[_0xa8dc('0x26')]=function(_0x5a2649,_0x241ef7){return db['FreshsalesConfiguration'][_0xa8dc('0x4d')]({'where':{'id':_0x5a2649[_0xa8dc('0x48')]['id']}})['then'](handleEntityNotFound(_0x241ef7,null))[_0xa8dc('0x25')](removeEntity(_0x241ef7,null))[_0xa8dc('0x46')](handleError(_0x241ef7,null));};exports['getSubjects']=function(_0x199e2b,_0x720038,_0x269170){var _0x248102={};var _0x5cec32={};var _0x50b167;var _0x695128;return db[_0xa8dc('0x2d')]['findOne']({'where':{'id':_0x199e2b[_0xa8dc('0x48')]['id']}})['then'](handleEntityNotFound(_0x720038,null))['then'](function(_0x55134c){if(_0x55134c){_0x50b167=_0x55134c;_0x5cec32[_0xa8dc('0x32')]=_['keys'](db['FreshsalesField'][_0xa8dc('0x2e')]);_0x5cec32[_0xa8dc('0x33')]=_['keys'](_0x199e2b[_0xa8dc('0x33')]);_0x5cec32[_0xa8dc('0x34')]=_['intersection'](_0x5cec32[_0xa8dc('0x32')],_0x5cec32[_0xa8dc('0x33')]);_0x248102[_0xa8dc('0x36')]=_[_0xa8dc('0x35')](_0x5cec32[_0xa8dc('0x32')],qs[_0xa8dc('0x37')](_0x199e2b[_0xa8dc('0x33')][_0xa8dc('0x37')]));_0x248102['attributes']=_0x248102[_0xa8dc('0x36')]['length']?_0x248102['attributes']:_0x5cec32[_0xa8dc('0x32')];_0x248102[_0xa8dc('0x3b')]=qs[_0xa8dc('0x3c')](_0x199e2b[_0xa8dc('0x33')][_0xa8dc('0x3c')]);_0x248102[_0xa8dc('0x3d')]=qs[_0xa8dc('0x34')](_[_0xa8dc('0x4e')](_0x199e2b['query'],_0x5cec32['filters']));if(_0x199e2b['query'][_0xa8dc('0x3e')]){_0x248102[_0xa8dc('0x3d')]=_[_0xa8dc('0x3f')](_0x248102[_0xa8dc('0x3d')],{'$or':_[_0xa8dc('0x2c')](_0x248102[_0xa8dc('0x36')],function(_0x2b7457){var _0x280b87={};_0x280b87[_0x2b7457]={'$like':'%'+_0x199e2b[_0xa8dc('0x33')][_0xa8dc('0x3e')]+'%'};return _0x280b87;})});}_0x248102=_[_0xa8dc('0x3f')]({},_0x248102,_0x199e2b[_0xa8dc('0x41')]);return _0x50b167[_0xa8dc('0x4f')](_0x248102);}})[_0xa8dc('0x25')](function(_0x2a9f0a){if(_0x2a9f0a){_0x695128=_0x2a9f0a[_0xa8dc('0x4a')];if(!_0x199e2b['query'][_0xa8dc('0x38')]('nolimit')){_0x248102[_0xa8dc('0x3a')]=qs[_0xa8dc('0x3a')](_0x199e2b[_0xa8dc('0x33')][_0xa8dc('0x3a')]);_0x248102[_0xa8dc('0x1d')]=qs[_0xa8dc('0x1d')](_0x199e2b[_0xa8dc('0x33')][_0xa8dc('0x1d')]);}return _0x50b167[_0xa8dc('0x4f')](_0x248102);}})['then'](function(_0xe237d6){if(_0xe237d6){return _0xe237d6?{'count':_0x695128,'rows':_0xe237d6}:null;}})[_0xa8dc('0x25')](respondWithResult(_0x720038,null))[_0xa8dc('0x46')](handleError(_0x720038,null));};exports[_0xa8dc('0x50')]=function(_0x283485,_0x179180,_0x279648){var _0x536b22={};var _0x1ec73d={};var _0x3b0204;var _0x21e563;return db[_0xa8dc('0x2d')][_0xa8dc('0x51')]({'where':{'id':_0x283485[_0xa8dc('0x48')]['id']}})[_0xa8dc('0x25')](handleEntityNotFound(_0x179180,null))[_0xa8dc('0x25')](function(_0x4631b2){if(_0x4631b2){_0x3b0204=_0x4631b2;_0x1ec73d[_0xa8dc('0x32')]=_[_0xa8dc('0x49')](db['FreshsalesField'][_0xa8dc('0x2e')]);_0x1ec73d[_0xa8dc('0x33')]=_['keys'](_0x283485[_0xa8dc('0x33')]);_0x1ec73d[_0xa8dc('0x34')]=_[_0xa8dc('0x35')](_0x1ec73d[_0xa8dc('0x32')],_0x1ec73d[_0xa8dc('0x33')]);_0x536b22['attributes']=_[_0xa8dc('0x35')](_0x1ec73d[_0xa8dc('0x32')],qs[_0xa8dc('0x37')](_0x283485[_0xa8dc('0x33')][_0xa8dc('0x37')]));_0x536b22[_0xa8dc('0x36')]=_0x536b22['attributes']['length']?_0x536b22[_0xa8dc('0x36')]:_0x1ec73d[_0xa8dc('0x32')];_0x536b22[_0xa8dc('0x3b')]=qs['sort'](_0x283485[_0xa8dc('0x33')][_0xa8dc('0x3c')]);_0x536b22['where']=qs[_0xa8dc('0x34')](_[_0xa8dc('0x4e')](_0x283485[_0xa8dc('0x33')],_0x1ec73d['filters']));if(_0x283485[_0xa8dc('0x33')]['filter']){_0x536b22[_0xa8dc('0x3d')]=_[_0xa8dc('0x3f')](_0x536b22[_0xa8dc('0x3d')],{'$or':_[_0xa8dc('0x2c')](_0x536b22[_0xa8dc('0x36')],function(_0x1fd07b){var _0x3f23b1={};_0x3f23b1[_0x1fd07b]={'$like':'%'+_0x283485['query'][_0xa8dc('0x3e')]+'%'};return _0x3f23b1;})});}_0x536b22=_[_0xa8dc('0x3f')]({},_0x536b22,_0x283485[_0xa8dc('0x41')]);return _0x3b0204['getDescriptions'](_0x536b22);}})['then'](function(_0x1284be){if(_0x1284be){_0x21e563=_0x1284be[_0xa8dc('0x4a')];if(!_0x283485['query'][_0xa8dc('0x38')](_0xa8dc('0x39'))){_0x536b22[_0xa8dc('0x3a')]=qs[_0xa8dc('0x3a')](_0x283485[_0xa8dc('0x33')][_0xa8dc('0x3a')]);_0x536b22[_0xa8dc('0x1d')]=qs[_0xa8dc('0x1d')](_0x283485['query'][_0xa8dc('0x1d')]);}return _0x3b0204[_0xa8dc('0x50')](_0x536b22);}})[_0xa8dc('0x25')](function(_0x50568a){if(_0x50568a){return _0x50568a?{'count':_0x21e563,'rows':_0x50568a}:null;}})[_0xa8dc('0x25')](respondWithResult(_0x179180,null))[_0xa8dc('0x46')](handleError(_0x179180,null));};exports[_0xa8dc('0x52')]=function(_0x55352c,_0x5af952,_0x53d7e9){var _0x386998={};var _0x7fc779={};var _0x53a4ff;var _0x250cb9;return db[_0xa8dc('0x2d')][_0xa8dc('0x51')]({'where':{'id':_0x55352c[_0xa8dc('0x48')]['id']}})[_0xa8dc('0x25')](handleEntityNotFound(_0x5af952,null))[_0xa8dc('0x25')](function(_0x39b648){if(_0x39b648){_0x53a4ff=_0x39b648;_0x7fc779[_0xa8dc('0x32')]=_[_0xa8dc('0x49')](db[_0xa8dc('0x53')][_0xa8dc('0x2e')]);_0x7fc779[_0xa8dc('0x33')]=_[_0xa8dc('0x49')](_0x55352c['query']);_0x7fc779[_0xa8dc('0x34')]=_[_0xa8dc('0x35')](_0x7fc779[_0xa8dc('0x32')],_0x7fc779[_0xa8dc('0x33')]);_0x386998[_0xa8dc('0x36')]=_['intersection'](_0x7fc779[_0xa8dc('0x32')],qs[_0xa8dc('0x37')](_0x55352c[_0xa8dc('0x33')][_0xa8dc('0x37')]));_0x386998['attributes']=_0x386998[_0xa8dc('0x36')][_0xa8dc('0x4a')]?_0x386998[_0xa8dc('0x36')]:_0x7fc779['model'];_0x386998['order']=qs[_0xa8dc('0x3c')](_0x55352c[_0xa8dc('0x33')]['sort']);_0x386998[_0xa8dc('0x3d')]=qs[_0xa8dc('0x34')](_[_0xa8dc('0x4e')](_0x55352c[_0xa8dc('0x33')],_0x7fc779['filters']));if(_0x55352c['query'][_0xa8dc('0x3e')]){_0x386998[_0xa8dc('0x3d')]=_[_0xa8dc('0x3f')](_0x386998[_0xa8dc('0x3d')],{'$or':_[_0xa8dc('0x2c')](_0x386998[_0xa8dc('0x36')],function(_0xb251d5){var _0x476cca={};_0x476cca[_0xb251d5]={'$like':'%'+_0x55352c[_0xa8dc('0x33')]['filter']+'%'};return _0x476cca;})});}_0x386998=_[_0xa8dc('0x3f')]({},_0x386998,_0x55352c[_0xa8dc('0x41')]);return _0x53a4ff['getFields'](_0x386998);}})[_0xa8dc('0x25')](function(_0x49a448){if(_0x49a448){_0x250cb9=_0x49a448[_0xa8dc('0x4a')];if(!_0x55352c[_0xa8dc('0x33')][_0xa8dc('0x38')](_0xa8dc('0x39'))){_0x386998[_0xa8dc('0x3a')]=qs['limit'](_0x55352c[_0xa8dc('0x33')][_0xa8dc('0x3a')]);_0x386998[_0xa8dc('0x1d')]=qs[_0xa8dc('0x1d')](_0x55352c[_0xa8dc('0x33')]['offset']);}return _0x53a4ff['getFields'](_0x386998);}})[_0xa8dc('0x25')](function(_0x4f9646){if(_0x4f9646){return _0x4f9646?{'count':_0x250cb9,'rows':_0x4f9646}:null;}})['then'](respondWithResult(_0x5af952,null))[_0xa8dc('0x46')](handleError(_0x5af952,null));}; \ No newline at end of file +var _0x3e1d=['filters','intersection','model','attributes','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','fields','length','options','create','body','find','getSubjects','findOne','FreshsalesField','order','getDescriptions','nolimit','getFields','eml-format','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','query','keys'];(function(_0x1a7de4,_0x36fae9){var _0x123307=function(_0x33653f){while(--_0x33653f){_0x1a7de4['push'](_0x1a7de4['shift']());}};_0x123307(++_0x36fae9);}(_0x3e1d,0x70));var _0xd3e1=function(_0x2feb53,_0x264ef7){_0x2feb53=_0x2feb53-0x0;var _0x5700ee=_0x3e1d[_0x2feb53];return _0x5700ee;};'use strict';var emlformat=require(_0xd3e1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd3e1('0x1'));var jsonpatch=require(_0xd3e1('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd3e1('0x3'));var util=require(_0xd3e1('0x4'));var path=require(_0xd3e1('0x5'));var sox=require(_0xd3e1('0x6'));var csv=require(_0xd3e1('0x7'));var ejs=require(_0xd3e1('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd3e1('0x9'));var squel=require(_0xd3e1('0xa'));var crypto=require(_0xd3e1('0xb'));var jsforce=require(_0xd3e1('0xc'));var deskjs=require(_0xd3e1('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd3e1('0xe'));var authService=require(_0xd3e1('0xf'));var qs=require(_0xd3e1('0x10'));var as=require(_0xd3e1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd3e1('0x12'))(_0xd3e1('0x13'));var utils=require('../../config/utils');var config=require(_0xd3e1('0x14'));var licenseUtil=require(_0xd3e1('0x15'));var db=require(_0xd3e1('0x16'))['db'];function respondWithStatusCode(_0x2f1336,_0x30d7f0){_0x30d7f0=_0x30d7f0||0xcc;return function(_0x465d51){if(_0x465d51){return _0x2f1336[_0xd3e1('0x17')](_0x30d7f0);}return _0x2f1336[_0xd3e1('0x18')](_0x30d7f0)[_0xd3e1('0x19')]();};}function respondWithResult(_0x2273ca,_0x17d7d7){_0x17d7d7=_0x17d7d7||0xc8;return function(_0x284eb7){if(_0x284eb7){return _0x2273ca['status'](_0x17d7d7)[_0xd3e1('0x1a')](_0x284eb7);}};}function respondWithFilteredResult(_0xa48cf8,_0x5115a6){return function(_0x373656){if(_0x373656){var _0x47fded=typeof _0x5115a6[_0xd3e1('0x1b')]===_0xd3e1('0x1c')&&typeof _0x5115a6[_0xd3e1('0x1d')]===_0xd3e1('0x1c');var _0x570527=_0x373656[_0xd3e1('0x1e')];var _0x2d1940=_0x47fded?0x0:_0x5115a6[_0xd3e1('0x1b')];var _0x18c2a8=_0x47fded?_0x373656[_0xd3e1('0x1e')]:_0x5115a6[_0xd3e1('0x1b')]+_0x5115a6[_0xd3e1('0x1d')];var _0x271cf8;if(_0x18c2a8>=_0x570527){_0x18c2a8=_0x570527;_0x271cf8=0xc8;}else{_0x271cf8=0xce;}_0xa48cf8['status'](_0x271cf8);return _0xa48cf8['set'](_0xd3e1('0x1f'),_0x2d1940+'-'+_0x18c2a8+'/'+_0x570527)[_0xd3e1('0x1a')](_0x373656);}return null;};}function patchUpdates(_0x707e7c){return function(_0x2b51d4){try{jsonpatch[_0xd3e1('0x20')](_0x2b51d4,_0x707e7c,!![]);}catch(_0x33ded7){return BPromise[_0xd3e1('0x21')](_0x33ded7);}return _0x2b51d4[_0xd3e1('0x22')]();};}function saveUpdates(_0xbf998d,_0x22de6e){return function(_0x7583d){if(_0x7583d){return _0x7583d[_0xd3e1('0x23')](_0xbf998d)[_0xd3e1('0x24')](function(_0x4857f9){return _0x4857f9;});}return null;};}function removeEntity(_0xf2179,_0x1233e4){return function(_0x2167e5){if(_0x2167e5){return _0x2167e5[_0xd3e1('0x25')]()[_0xd3e1('0x24')](function(){_0xf2179[_0xd3e1('0x18')](0xcc)[_0xd3e1('0x19')]();});}};}function handleEntityNotFound(_0x514aea,_0x4fa098){return function(_0x55ed16){if(!_0x55ed16){_0x514aea[_0xd3e1('0x17')](0x194);}return _0x55ed16;};}function handleError(_0x2ce1be,_0x50747a){_0x50747a=_0x50747a||0x1f4;return function(_0x394104){logger[_0xd3e1('0x26')](_0x394104[_0xd3e1('0x27')]);if(_0x394104[_0xd3e1('0x28')]){delete _0x394104[_0xd3e1('0x28')];}_0x2ce1be[_0xd3e1('0x18')](_0x50747a)[_0xd3e1('0x29')](_0x394104);};}exports[_0xd3e1('0x2a')]=function(_0x2285f2,_0x9f510a){var _0x56371f={},_0x467968={},_0x2ce67c={'count':0x0,'rows':[]};var _0x54b2a2=_[_0xd3e1('0x2b')](db[_0xd3e1('0x2c')][_0xd3e1('0x2d')],function(_0x4b4d7d){return{'name':_0x4b4d7d[_0xd3e1('0x2e')],'type':_0x4b4d7d[_0xd3e1('0x2f')]['key']};});_0x467968['model']=_[_0xd3e1('0x2b')](_0x54b2a2,_0xd3e1('0x28'));_0x467968[_0xd3e1('0x30')]=_[_0xd3e1('0x31')](_0x2285f2[_0xd3e1('0x30')]);_0x467968[_0xd3e1('0x32')]=_[_0xd3e1('0x33')](_0x467968[_0xd3e1('0x34')],_0x467968[_0xd3e1('0x30')]);_0x56371f['attributes']=_[_0xd3e1('0x33')](_0x467968[_0xd3e1('0x34')],qs['fields'](_0x2285f2['query']['fields']));_0x56371f[_0xd3e1('0x35')]=_0x56371f[_0xd3e1('0x35')]['length']?_0x56371f['attributes']:_0x467968[_0xd3e1('0x34')];if(!_0x2285f2[_0xd3e1('0x30')][_0xd3e1('0x36')]('nolimit')){_0x56371f[_0xd3e1('0x1d')]=qs[_0xd3e1('0x1d')](_0x2285f2[_0xd3e1('0x30')][_0xd3e1('0x1d')]);_0x56371f[_0xd3e1('0x1b')]=qs['offset'](_0x2285f2[_0xd3e1('0x30')][_0xd3e1('0x1b')]);}_0x56371f['order']=qs[_0xd3e1('0x37')](_0x2285f2[_0xd3e1('0x30')]['sort']);_0x56371f['where']=qs['filters'](_[_0xd3e1('0x38')](_0x2285f2[_0xd3e1('0x30')],_0x467968[_0xd3e1('0x32')]),_0x54b2a2);if(_0x2285f2['query'][_0xd3e1('0x39')]){_0x56371f[_0xd3e1('0x3a')]=_[_0xd3e1('0x3b')](_0x56371f['where'],{'$or':_['map'](_0x54b2a2,function(_0x2d5861){if(_0x2d5861[_0xd3e1('0x2f')]!==_0xd3e1('0x3c')){var _0x1ba9d7={};_0x1ba9d7[_0x2d5861[_0xd3e1('0x28')]]={'$like':'%'+_0x2285f2[_0xd3e1('0x30')][_0xd3e1('0x39')]+'%'};return _0x1ba9d7;}})});}_0x56371f=_[_0xd3e1('0x3b')]({},_0x56371f,_0x2285f2['options']);var _0x4852ef={'where':_0x56371f[_0xd3e1('0x3a')]};return db[_0xd3e1('0x2c')]['count'](_0x4852ef)[_0xd3e1('0x24')](function(_0x1f8f53){_0x2ce67c[_0xd3e1('0x1e')]=_0x1f8f53;if(_0x2285f2['query'][_0xd3e1('0x3d')]){_0x56371f[_0xd3e1('0x3e')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0xd3e1('0x3f')](_0x56371f);})['then'](function(_0x5446da){_0x2ce67c[_0xd3e1('0x40')]=_0x5446da;return _0x2ce67c;})['then'](respondWithFilteredResult(_0x9f510a,_0x56371f))[_0xd3e1('0x41')](handleError(_0x9f510a,null));};exports[_0xd3e1('0x42')]=function(_0x3936de,_0x2eeb8b){var _0x2d1397={'raw':![],'where':{'id':_0x3936de[_0xd3e1('0x43')]['id']}},_0x4ed43d={};_0x4ed43d[_0xd3e1('0x34')]=_['keys'](db[_0xd3e1('0x2c')][_0xd3e1('0x2d')]);_0x4ed43d['query']=_[_0xd3e1('0x31')](_0x3936de[_0xd3e1('0x30')]);_0x4ed43d['filters']=_[_0xd3e1('0x33')](_0x4ed43d[_0xd3e1('0x34')],_0x4ed43d['query']);_0x2d1397[_0xd3e1('0x35')]=_[_0xd3e1('0x33')](_0x4ed43d[_0xd3e1('0x34')],qs[_0xd3e1('0x44')](_0x3936de[_0xd3e1('0x30')]['fields']));_0x2d1397[_0xd3e1('0x35')]=_0x2d1397[_0xd3e1('0x35')][_0xd3e1('0x45')]?_0x2d1397[_0xd3e1('0x35')]:_0x4ed43d[_0xd3e1('0x34')];if(_0x3936de[_0xd3e1('0x30')][_0xd3e1('0x3d')]){_0x2d1397[_0xd3e1('0x3e')]=[{'all':!![]}];}_0x2d1397=_[_0xd3e1('0x3b')]({},_0x2d1397,_0x3936de[_0xd3e1('0x46')]);return db['FreshsalesConfiguration']['find'](_0x2d1397)[_0xd3e1('0x24')](handleEntityNotFound(_0x2eeb8b,null))[_0xd3e1('0x24')](respondWithResult(_0x2eeb8b,null))[_0xd3e1('0x41')](handleError(_0x2eeb8b,null));};exports[_0xd3e1('0x47')]=function(_0x1ac7ea,_0x357d1f){return db['FreshsalesConfiguration']['create'](_0x1ac7ea[_0xd3e1('0x48')],{})[_0xd3e1('0x24')](respondWithResult(_0x357d1f,0xc9))[_0xd3e1('0x41')](handleError(_0x357d1f,null));};exports[_0xd3e1('0x23')]=function(_0x3ae04f,_0x3efbb9){if(_0x3ae04f['body']['id']){delete _0x3ae04f[_0xd3e1('0x48')]['id'];}return db[_0xd3e1('0x2c')][_0xd3e1('0x49')]({'where':{'id':_0x3ae04f[_0xd3e1('0x43')]['id']}})[_0xd3e1('0x24')](handleEntityNotFound(_0x3efbb9,null))[_0xd3e1('0x24')](saveUpdates(_0x3ae04f[_0xd3e1('0x48')],null))['then'](respondWithResult(_0x3efbb9,null))[_0xd3e1('0x41')](handleError(_0x3efbb9,null));};exports[_0xd3e1('0x25')]=function(_0xcfa747,_0x8eb2f){return db[_0xd3e1('0x2c')][_0xd3e1('0x49')]({'where':{'id':_0xcfa747[_0xd3e1('0x43')]['id']}})[_0xd3e1('0x24')](handleEntityNotFound(_0x8eb2f,null))[_0xd3e1('0x24')](removeEntity(_0x8eb2f,null))[_0xd3e1('0x41')](handleError(_0x8eb2f,null));};exports[_0xd3e1('0x4a')]=function(_0x25aee9,_0xd46d77,_0x45c71b){var _0x60b30e={};var _0x3f5193={};var _0x3fe84d;var _0x2bc6b6;return db[_0xd3e1('0x2c')][_0xd3e1('0x4b')]({'where':{'id':_0x25aee9[_0xd3e1('0x43')]['id']}})[_0xd3e1('0x24')](handleEntityNotFound(_0xd46d77,null))[_0xd3e1('0x24')](function(_0x4a5181){if(_0x4a5181){_0x3fe84d=_0x4a5181;_0x3f5193['model']=_[_0xd3e1('0x31')](db[_0xd3e1('0x4c')][_0xd3e1('0x2d')]);_0x3f5193['query']=_[_0xd3e1('0x31')](_0x25aee9[_0xd3e1('0x30')]);_0x3f5193[_0xd3e1('0x32')]=_[_0xd3e1('0x33')](_0x3f5193[_0xd3e1('0x34')],_0x3f5193[_0xd3e1('0x30')]);_0x60b30e['attributes']=_[_0xd3e1('0x33')](_0x3f5193['model'],qs[_0xd3e1('0x44')](_0x25aee9[_0xd3e1('0x30')]['fields']));_0x60b30e[_0xd3e1('0x35')]=_0x60b30e['attributes']['length']?_0x60b30e[_0xd3e1('0x35')]:_0x3f5193['model'];_0x60b30e['order']=qs[_0xd3e1('0x37')](_0x25aee9[_0xd3e1('0x30')][_0xd3e1('0x37')]);_0x60b30e['where']=qs[_0xd3e1('0x32')](_['pick'](_0x25aee9['query'],_0x3f5193[_0xd3e1('0x32')]));if(_0x25aee9[_0xd3e1('0x30')][_0xd3e1('0x39')]){_0x60b30e['where']=_[_0xd3e1('0x3b')](_0x60b30e[_0xd3e1('0x3a')],{'$or':_[_0xd3e1('0x2b')](_0x60b30e['attributes'],function(_0x513d4d){var _0x41a77a={};_0x41a77a[_0x513d4d]={'$like':'%'+_0x25aee9[_0xd3e1('0x30')][_0xd3e1('0x39')]+'%'};return _0x41a77a;})});}_0x60b30e=_['merge']({},_0x60b30e,_0x25aee9[_0xd3e1('0x46')]);return _0x3fe84d[_0xd3e1('0x4a')](_0x60b30e);}})['then'](function(_0x27036b){if(_0x27036b){_0x2bc6b6=_0x27036b['length'];if(!_0x25aee9['query'][_0xd3e1('0x36')]('nolimit')){_0x60b30e[_0xd3e1('0x1d')]=qs[_0xd3e1('0x1d')](_0x25aee9['query'][_0xd3e1('0x1d')]);_0x60b30e[_0xd3e1('0x1b')]=qs[_0xd3e1('0x1b')](_0x25aee9[_0xd3e1('0x30')][_0xd3e1('0x1b')]);}return _0x3fe84d[_0xd3e1('0x4a')](_0x60b30e);}})[_0xd3e1('0x24')](function(_0x45e24d){if(_0x45e24d){return _0x45e24d?{'count':_0x2bc6b6,'rows':_0x45e24d}:null;}})[_0xd3e1('0x24')](respondWithResult(_0xd46d77,null))[_0xd3e1('0x41')](handleError(_0xd46d77,null));};exports['getDescriptions']=function(_0x456a8d,_0x57f7f6,_0x21a927){var _0x2e507f={};var _0x54fe5f={};var _0x25dcc8;var _0x4aec78;return db['FreshsalesConfiguration'][_0xd3e1('0x4b')]({'where':{'id':_0x456a8d[_0xd3e1('0x43')]['id']}})['then'](handleEntityNotFound(_0x57f7f6,null))[_0xd3e1('0x24')](function(_0x8380fc){if(_0x8380fc){_0x25dcc8=_0x8380fc;_0x54fe5f[_0xd3e1('0x34')]=_[_0xd3e1('0x31')](db[_0xd3e1('0x4c')][_0xd3e1('0x2d')]);_0x54fe5f['query']=_[_0xd3e1('0x31')](_0x456a8d['query']);_0x54fe5f['filters']=_[_0xd3e1('0x33')](_0x54fe5f['model'],_0x54fe5f['query']);_0x2e507f['attributes']=_[_0xd3e1('0x33')](_0x54fe5f['model'],qs[_0xd3e1('0x44')](_0x456a8d[_0xd3e1('0x30')][_0xd3e1('0x44')]));_0x2e507f[_0xd3e1('0x35')]=_0x2e507f[_0xd3e1('0x35')]['length']?_0x2e507f[_0xd3e1('0x35')]:_0x54fe5f[_0xd3e1('0x34')];_0x2e507f[_0xd3e1('0x4d')]=qs[_0xd3e1('0x37')](_0x456a8d['query'][_0xd3e1('0x37')]);_0x2e507f[_0xd3e1('0x3a')]=qs[_0xd3e1('0x32')](_[_0xd3e1('0x38')](_0x456a8d[_0xd3e1('0x30')],_0x54fe5f[_0xd3e1('0x32')]));if(_0x456a8d['query'][_0xd3e1('0x39')]){_0x2e507f[_0xd3e1('0x3a')]=_[_0xd3e1('0x3b')](_0x2e507f[_0xd3e1('0x3a')],{'$or':_[_0xd3e1('0x2b')](_0x2e507f['attributes'],function(_0x4c085d){var _0x227eeb={};_0x227eeb[_0x4c085d]={'$like':'%'+_0x456a8d[_0xd3e1('0x30')][_0xd3e1('0x39')]+'%'};return _0x227eeb;})});}_0x2e507f=_[_0xd3e1('0x3b')]({},_0x2e507f,_0x456a8d[_0xd3e1('0x46')]);return _0x25dcc8[_0xd3e1('0x4e')](_0x2e507f);}})[_0xd3e1('0x24')](function(_0x26c273){if(_0x26c273){_0x4aec78=_0x26c273['length'];if(!_0x456a8d['query'][_0xd3e1('0x36')](_0xd3e1('0x4f'))){_0x2e507f[_0xd3e1('0x1d')]=qs[_0xd3e1('0x1d')](_0x456a8d[_0xd3e1('0x30')][_0xd3e1('0x1d')]);_0x2e507f['offset']=qs[_0xd3e1('0x1b')](_0x456a8d[_0xd3e1('0x30')]['offset']);}return _0x25dcc8[_0xd3e1('0x4e')](_0x2e507f);}})[_0xd3e1('0x24')](function(_0x286ddd){if(_0x286ddd){return _0x286ddd?{'count':_0x4aec78,'rows':_0x286ddd}:null;}})[_0xd3e1('0x24')](respondWithResult(_0x57f7f6,null))['catch'](handleError(_0x57f7f6,null));};exports[_0xd3e1('0x50')]=function(_0x47ffb9,_0xc68fd7,_0x57c023){var _0x4eeef2={};var _0x481178={};var _0x2d2ceb;var _0x46b9e8;return db['FreshsalesConfiguration'][_0xd3e1('0x4b')]({'where':{'id':_0x47ffb9['params']['id']}})[_0xd3e1('0x24')](handleEntityNotFound(_0xc68fd7,null))['then'](function(_0x5785cd){if(_0x5785cd){_0x2d2ceb=_0x5785cd;_0x481178[_0xd3e1('0x34')]=_[_0xd3e1('0x31')](db[_0xd3e1('0x4c')][_0xd3e1('0x2d')]);_0x481178['query']=_[_0xd3e1('0x31')](_0x47ffb9[_0xd3e1('0x30')]);_0x481178[_0xd3e1('0x32')]=_['intersection'](_0x481178[_0xd3e1('0x34')],_0x481178[_0xd3e1('0x30')]);_0x4eeef2[_0xd3e1('0x35')]=_[_0xd3e1('0x33')](_0x481178['model'],qs[_0xd3e1('0x44')](_0x47ffb9['query'][_0xd3e1('0x44')]));_0x4eeef2[_0xd3e1('0x35')]=_0x4eeef2[_0xd3e1('0x35')][_0xd3e1('0x45')]?_0x4eeef2[_0xd3e1('0x35')]:_0x481178[_0xd3e1('0x34')];_0x4eeef2['order']=qs[_0xd3e1('0x37')](_0x47ffb9[_0xd3e1('0x30')][_0xd3e1('0x37')]);_0x4eeef2[_0xd3e1('0x3a')]=qs[_0xd3e1('0x32')](_['pick'](_0x47ffb9['query'],_0x481178[_0xd3e1('0x32')]));if(_0x47ffb9[_0xd3e1('0x30')][_0xd3e1('0x39')]){_0x4eeef2[_0xd3e1('0x3a')]=_[_0xd3e1('0x3b')](_0x4eeef2[_0xd3e1('0x3a')],{'$or':_[_0xd3e1('0x2b')](_0x4eeef2[_0xd3e1('0x35')],function(_0x3f9447){var _0x5a26a9={};_0x5a26a9[_0x3f9447]={'$like':'%'+_0x47ffb9[_0xd3e1('0x30')]['filter']+'%'};return _0x5a26a9;})});}_0x4eeef2=_[_0xd3e1('0x3b')]({},_0x4eeef2,_0x47ffb9[_0xd3e1('0x46')]);return _0x2d2ceb[_0xd3e1('0x50')](_0x4eeef2);}})[_0xd3e1('0x24')](function(_0x2b86c9){if(_0x2b86c9){_0x46b9e8=_0x2b86c9[_0xd3e1('0x45')];if(!_0x47ffb9[_0xd3e1('0x30')][_0xd3e1('0x36')](_0xd3e1('0x4f'))){_0x4eeef2[_0xd3e1('0x1d')]=qs[_0xd3e1('0x1d')](_0x47ffb9['query']['limit']);_0x4eeef2[_0xd3e1('0x1b')]=qs[_0xd3e1('0x1b')](_0x47ffb9['query'][_0xd3e1('0x1b')]);}return _0x2d2ceb[_0xd3e1('0x50')](_0x4eeef2);}})[_0xd3e1('0x24')](function(_0x22caa6){if(_0x22caa6){return _0x22caa6?{'count':_0x46b9e8,'rows':_0x22caa6}:null;}})[_0xd3e1('0x24')](respondWithResult(_0xc68fd7,null))[_0xd3e1('0x41')](handleError(_0xc68fd7,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 1be89d5..e8dbef6 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 _0x9be5=['bluebird','request-promise','path','rimraf','../../config/environment','exports','FreshsalesConfiguration','int_freshsales_configurations','../../config/logger','api'];(function(_0x52acce,_0x49814f){var _0x4ace51=function(_0x506fb3){while(--_0x506fb3){_0x52acce['push'](_0x52acce['shift']());}};_0x4ace51(++_0x49814f);}(_0x9be5,0x116));var _0x59be=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x9be5[_0x13b8f3];return _0x1a6d06;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x59be('0x0'))(_0x59be('0x1'));var moment=require('moment');var BPromise=require(_0x59be('0x2'));var rp=require(_0x59be('0x3'));var fs=require('fs');var path=require(_0x59be('0x4'));var rimraf=require(_0x59be('0x5'));var config=require(_0x59be('0x6'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x59be('0x7')]=function(_0xa98b75,_0xa83eb7){return _0xa98b75['define'](_0x59be('0x8'),attributes,{'tableName':_0x59be('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c61=['rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','int_freshsales_configurations','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0xc59823,_0x5b49bd){var _0x30a5d4=function(_0xd878d3){while(--_0xd878d3){_0xc59823['push'](_0xc59823['shift']());}};_0x30a5d4(++_0x5b49bd);}(_0x9c61,0x19d));var _0x19c6=function(_0x3412e0,_0x5c4e4f){_0x3412e0=_0x3412e0-0x0;var _0x479b68=_0x9c61[_0x3412e0];return _0x479b68;};'use strict';var _=require(_0x19c6('0x0'));var util=require(_0x19c6('0x1'));var logger=require(_0x19c6('0x2'))(_0x19c6('0x3'));var moment=require(_0x19c6('0x4'));var BPromise=require(_0x19c6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x19c6('0x6'));var rimraf=require(_0x19c6('0x7'));var config=require(_0x19c6('0x8'));var attributes=require(_0x19c6('0x9'));module[_0x19c6('0xa')]=function(_0x2e5619,_0x5551e3){return _0x2e5619['define']('FreshsalesConfiguration',attributes,{'tableName':_0x19c6('0xb'),'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 833e78c..f6e9ad8 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 _0xb440=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','info','catch','lodash'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xb440,0xbf));var _0x0b44=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb440[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0b44('0x0'));var util=require(_0x0b44('0x1'));var moment=require(_0x0b44('0x2'));var BPromise=require('bluebird');var rs=require(_0x0b44('0x3'));var fs=require('fs');var Redis=require(_0x0b44('0x4'));var db=require(_0x0b44('0x5'))['db'];var utils=require(_0x0b44('0x6'));var logger=require(_0x0b44('0x7'))(_0x0b44('0x8'));var config=require(_0x0b44('0x9'));var jayson=require(_0x0b44('0xa'));var client=jayson[_0x0b44('0xb')][_0x0b44('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2e81c7,_0x36ec71,_0x23e6aa){return new BPromise(function(_0x5dba63,_0x38bb78){return client[_0x0b44('0xd')](_0x2e81c7,_0x23e6aa)[_0x0b44('0xe')](function(_0x228068){logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x36ec71,_0x0b44('0xf'));logger['debug'](_0x0b44('0x10'),_0x36ec71,'request\x20sent',JSON[_0x0b44('0x11')](_0x228068));if(_0x228068[_0x0b44('0x12')]){if(_0x228068[_0x0b44('0x12')][_0x0b44('0x13')]===0x1f4){logger['error'](_0x0b44('0x14'),_0x36ec71,_0x228068['error'][_0x0b44('0x15')]);return _0x38bb78(_0x228068[_0x0b44('0x12')]['message']);}logger[_0x0b44('0x12')](_0x0b44('0x14'),_0x36ec71,_0x228068[_0x0b44('0x12')][_0x0b44('0x15')]);return _0x5dba63(_0x228068[_0x0b44('0x12')][_0x0b44('0x15')]);}else{logger[_0x0b44('0x16')](_0x0b44('0x14'),_0x36ec71,_0x0b44('0xf'));_0x5dba63(_0x228068['result'][_0x0b44('0x15')]);}})[_0x0b44('0x17')](function(_0x172bef){logger[_0x0b44('0x12')](_0x0b44('0x14'),_0x36ec71,_0x172bef);_0x38bb78(_0x172bef);});});} \ No newline at end of file +var _0xeb31=['stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x5f5b7b,_0x1932fa){var _0x2890dd=function(_0x503b48){while(--_0x503b48){_0x5f5b7b['push'](_0x5f5b7b['shift']());}};_0x2890dd(++_0x1932fa);}(_0xeb31,0xeb));var _0x1eb3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeb31[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1eb3('0x0'));var util=require(_0x1eb3('0x1'));var moment=require(_0x1eb3('0x2'));var BPromise=require(_0x1eb3('0x3'));var rs=require(_0x1eb3('0x4'));var fs=require('fs');var Redis=require(_0x1eb3('0x5'));var db=require(_0x1eb3('0x6'))['db'];var utils=require(_0x1eb3('0x7'));var logger=require(_0x1eb3('0x8'))('rpc');var config=require(_0x1eb3('0x9'));var jayson=require(_0x1eb3('0xa'));var client=jayson[_0x1eb3('0xb')][_0x1eb3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3f8984,_0x53c658,_0x2d46a5){return new BPromise(function(_0x206f19,_0x3b20c5){return client['request'](_0x3f8984,_0x2d46a5)['then'](function(_0x3b88fc){logger[_0x1eb3('0xd')](_0x1eb3('0xe'),_0x53c658,_0x1eb3('0xf'));logger[_0x1eb3('0x10')](_0x1eb3('0x11'),_0x53c658,_0x1eb3('0xf'),JSON[_0x1eb3('0x12')](_0x3b88fc));if(_0x3b88fc[_0x1eb3('0x13')]){if(_0x3b88fc[_0x1eb3('0x13')][_0x1eb3('0x14')]===0x1f4){logger[_0x1eb3('0x13')](_0x1eb3('0xe'),_0x53c658,_0x3b88fc[_0x1eb3('0x13')][_0x1eb3('0x15')]);return _0x3b20c5(_0x3b88fc[_0x1eb3('0x13')][_0x1eb3('0x15')]);}logger[_0x1eb3('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x53c658,_0x3b88fc[_0x1eb3('0x13')][_0x1eb3('0x15')]);return _0x206f19(_0x3b88fc[_0x1eb3('0x13')]['message']);}else{logger[_0x1eb3('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x53c658,_0x1eb3('0xf'));_0x206f19(_0x3b88fc[_0x1eb3('0x16')][_0x1eb3('0x15')]);}})['catch'](function(_0x367582){logger[_0x1eb3('0x13')](_0x1eb3('0xe'),_0x53c658,_0x367582);_0x3b20c5(_0x367582);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 4077c83..d443054 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 _0x0dba=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x6b2a0d,_0x59a537){var _0x53f9d6=function(_0x17927d){while(--_0x17927d){_0x6b2a0d['push'](_0x6b2a0d['shift']());}};_0x53f9d6(++_0x59a537);}(_0x0dba,0x136));var _0xa0db=function(_0xeac0b3,_0x2a5529){_0xeac0b3=_0xeac0b3-0x0;var _0x5d3f79=_0x0dba[_0xeac0b3];return _0x5d3f79;};'use strict';var multer=require(_0xa0db('0x0'));var util=require(_0xa0db('0x1'));var path=require(_0xa0db('0x2'));var timeout=require(_0xa0db('0x3'));var express=require(_0xa0db('0x4'));var router=express[_0xa0db('0x5')]();var fs_extra=require(_0xa0db('0x6'));var auth=require(_0xa0db('0x7'));var interaction=require(_0xa0db('0x8'));var config=require(_0xa0db('0x9'));var controller=require(_0xa0db('0xa'));router[_0xa0db('0xb')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa0db('0xc'),auth[_0xa0db('0xd')](),controller[_0xa0db('0xe')]);router['post']('/',auth[_0xa0db('0xd')](),controller[_0xa0db('0xf')]);router[_0xa0db('0x10')](_0xa0db('0xc'),auth['isAuthenticated'](),controller[_0xa0db('0x11')]);router[_0xa0db('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xa0db('0x13')]);module[_0xa0db('0x14')]=router; \ No newline at end of file +var _0xf6fb=['isAuthenticated','index','/:id','show','create','put','destroy','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./intFreshsalesField.controller','get'];(function(_0x3f13fb,_0x38a934){var _0x4f14f2=function(_0x130412){while(--_0x130412){_0x3f13fb['push'](_0x3f13fb['shift']());}};_0x4f14f2(++_0x38a934);}(_0xf6fb,0x111));var _0xbf6f=function(_0x2f5075,_0x45e223){_0x2f5075=_0x2f5075-0x0;var _0x4d88b8=_0xf6fb[_0x2f5075];return _0x4d88b8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbf6f('0x0'));var timeout=require(_0xbf6f('0x1'));var express=require('express');var router=express[_0xbf6f('0x2')]();var fs_extra=require(_0xbf6f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xbf6f('0x4'));var config=require('../../config/environment');var controller=require(_0xbf6f('0x5'));router[_0xbf6f('0x6')]('/',auth[_0xbf6f('0x7')](),controller[_0xbf6f('0x8')]);router[_0xbf6f('0x6')](_0xbf6f('0x9'),auth[_0xbf6f('0x7')](),controller[_0xbf6f('0xa')]);router['post']('/',auth[_0xbf6f('0x7')](),controller[_0xbf6f('0xb')]);router[_0xbf6f('0xc')](_0xbf6f('0x9'),auth[_0xbf6f('0x7')](),controller['update']);router['delete'](_0xbf6f('0x9'),auth[_0xbf6f('0x7')](),controller[_0xbf6f('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 0b8a97b..1e279d5 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 _0x5be4=['string','STRING','BOOLEAN','exports','ENUM','variable','customVariable','keyValue','picklist'];(function(_0x15f59b,_0x1c27db){var _0xb6595e=function(_0x33e275){while(--_0x33e275){_0x15f59b['push'](_0x15f59b['shift']());}};_0xb6595e(++_0x1c27db);}(_0x5be4,0x78));var _0x45be=function(_0x1a0975,_0x1e57ff){_0x1a0975=_0x1a0975-0x0;var _0x4b2888=_0x5be4[_0x1a0975];return _0x4b2888;};'use strict';var Sequelize=require('sequelize');module[_0x45be('0x0')]={'type':{'type':Sequelize[_0x45be('0x1')]('string',_0x45be('0x2'),_0x45be('0x3'),_0x45be('0x4'),_0x45be('0x5')),'defaultValue':_0x45be('0x6')},'content':{'type':Sequelize[_0x45be('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x45be('0x1')]('string',_0x45be('0x2'),_0x45be('0x3'))},'keyContent':{'type':Sequelize[_0x45be('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x45be('0x7')]},'customField':{'type':Sequelize[_0x45be('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x45be('0x7')]}}; \ No newline at end of file +var _0x8be5=['string','variable','customVariable','keyValue','ENUM','STRING','BOOLEAN','exports'];(function(_0x1f6f84,_0x2bab55){var _0x177f40=function(_0x384ab4){while(--_0x384ab4){_0x1f6f84['push'](_0x1f6f84['shift']());}};_0x177f40(++_0x2bab55);}(_0x8be5,0x157));var _0x58be=function(_0x34360e,_0x1009d6){_0x34360e=_0x34360e-0x0;var _0x4c19c7=_0x8be5[_0x34360e];return _0x4c19c7;};'use strict';var Sequelize=require('sequelize');module[_0x58be('0x0')]={'type':{'type':Sequelize['ENUM'](_0x58be('0x1'),_0x58be('0x2'),_0x58be('0x3'),_0x58be('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x58be('0x5')](_0x58be('0x1'),_0x58be('0x2'),_0x58be('0x3'))},'keyContent':{'type':Sequelize[_0x58be('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x58be('0x6')]},'customField':{'type':Sequelize[_0x58be('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x58be('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index cc70c92..9b22a97 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 _0xc9ba=['fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','FreshsalesField','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','count','offset','limit','Content-Range','json','update','then','destroy','error','name','send','index','map','rawAttributes'];(function(_0x1ccba5,_0x448932){var _0x57cf95=function(_0x1f0561){while(--_0x1f0561){_0x1ccba5['push'](_0x1ccba5['shift']());}};_0x57cf95(++_0x448932);}(_0xc9ba,0x1cf));var _0xac9b=function(_0x4235b3,_0x4295b9){_0x4235b3=_0x4235b3-0x0;var _0x5a6cc9=_0xc9ba[_0x4235b3];return _0x5a6cc9;};'use strict';var emlformat=require(_0xac9b('0x0'));var rimraf=require(_0xac9b('0x1'));var zipdir=require(_0xac9b('0x2'));var jsonpatch=require(_0xac9b('0x3'));var rp=require(_0xac9b('0x4'));var moment=require(_0xac9b('0x5'));var BPromise=require(_0xac9b('0x6'));var Mustache=require('mustache');var util=require(_0xac9b('0x7'));var path=require('path');var sox=require(_0xac9b('0x8'));var csv=require(_0xac9b('0x9'));var ejs=require(_0xac9b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xac9b('0xb'));var squel=require('squel');var crypto=require(_0xac9b('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac9b('0x9'));var querystring=require(_0xac9b('0xd'));var Papa=require('papaparse');var Redis=require(_0xac9b('0xe'));var authService=require(_0xac9b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xac9b('0x10'));var hardwareService=require(_0xac9b('0x11'));var logger=require(_0xac9b('0x12'))(_0xac9b('0x13'));var utils=require('../../config/utils');var config=require(_0xac9b('0x14'));var licenseUtil=require(_0xac9b('0x15'));var db=require(_0xac9b('0x16'))['db'];function respondWithStatusCode(_0x2649bf,_0x11f4c4){_0x11f4c4=_0x11f4c4||0xcc;return function(_0x5e1c70){if(_0x5e1c70){return _0x2649bf[_0xac9b('0x17')](_0x11f4c4);}return _0x2649bf['status'](_0x11f4c4)[_0xac9b('0x18')]();};}function respondWithResult(_0x10df5b,_0x33f4ef){_0x33f4ef=_0x33f4ef||0xc8;return function(_0x4b14dd){if(_0x4b14dd){return _0x10df5b[_0xac9b('0x19')](_0x33f4ef)['json'](_0x4b14dd);}};}function respondWithFilteredResult(_0x6ac6ce,_0x2df71b){return function(_0x224ce9){if(_0x224ce9){var _0x26f5b1=typeof _0x2df71b['offset']===_0xac9b('0x1a')&&typeof _0x2df71b['limit']===_0xac9b('0x1a');var _0x59f892=_0x224ce9[_0xac9b('0x1b')];var _0x5715ce=_0x26f5b1?0x0:_0x2df71b[_0xac9b('0x1c')];var _0x3125ce=_0x26f5b1?_0x224ce9[_0xac9b('0x1b')]:_0x2df71b['offset']+_0x2df71b[_0xac9b('0x1d')];var _0x274cb3;if(_0x3125ce>=_0x59f892){_0x3125ce=_0x59f892;_0x274cb3=0xc8;}else{_0x274cb3=0xce;}_0x6ac6ce[_0xac9b('0x19')](_0x274cb3);return _0x6ac6ce['set'](_0xac9b('0x1e'),_0x5715ce+'-'+_0x3125ce+'/'+_0x59f892)[_0xac9b('0x1f')](_0x224ce9);}return null;};}function patchUpdates(_0x58c8b9){return function(_0x29f31b){try{jsonpatch['apply'](_0x29f31b,_0x58c8b9,!![]);}catch(_0x17c5fd){return BPromise['reject'](_0x17c5fd);}return _0x29f31b['save']();};}function saveUpdates(_0x19e9c1,_0x263401){return function(_0x19763d){if(_0x19763d){return _0x19763d[_0xac9b('0x20')](_0x19e9c1)[_0xac9b('0x21')](function(_0x11e5e2){return _0x11e5e2;});}return null;};}function removeEntity(_0x2da380,_0x4ad283){return function(_0x4c3c6e){if(_0x4c3c6e){return _0x4c3c6e[_0xac9b('0x22')]()[_0xac9b('0x21')](function(){_0x2da380[_0xac9b('0x19')](0xcc)[_0xac9b('0x18')]();});}};}function handleEntityNotFound(_0x39e8d3,_0x36a2db){return function(_0x41ea81){if(!_0x41ea81){_0x39e8d3[_0xac9b('0x17')](0x194);}return _0x41ea81;};}function handleError(_0x237e2b,_0x70bad9){_0x70bad9=_0x70bad9||0x1f4;return function(_0x14ed4d){logger[_0xac9b('0x23')](_0x14ed4d['stack']);if(_0x14ed4d[_0xac9b('0x24')]){delete _0x14ed4d['name'];}_0x237e2b[_0xac9b('0x19')](_0x70bad9)[_0xac9b('0x25')](_0x14ed4d);};}exports[_0xac9b('0x26')]=function(_0x569dd9,_0x5538e9){var _0x3097c9={},_0x164919={},_0x3784e5={'count':0x0,'rows':[]};var _0x44e8e8=_[_0xac9b('0x27')](db['FreshsalesField'][_0xac9b('0x28')],function(_0x55ae37){return{'name':_0x55ae37[_0xac9b('0x29')],'type':_0x55ae37['type'][_0xac9b('0x2a')]};});_0x164919['model']=_[_0xac9b('0x27')](_0x44e8e8,_0xac9b('0x24'));_0x164919['query']=_[_0xac9b('0x2b')](_0x569dd9[_0xac9b('0x2c')]);_0x164919[_0xac9b('0x2d')]=_[_0xac9b('0x2e')](_0x164919[_0xac9b('0x2f')],_0x164919[_0xac9b('0x2c')]);_0x3097c9[_0xac9b('0x30')]=_[_0xac9b('0x2e')](_0x164919[_0xac9b('0x2f')],qs[_0xac9b('0x31')](_0x569dd9[_0xac9b('0x2c')][_0xac9b('0x31')]));_0x3097c9['attributes']=_0x3097c9[_0xac9b('0x30')][_0xac9b('0x32')]?_0x3097c9['attributes']:_0x164919[_0xac9b('0x2f')];if(!_0x569dd9[_0xac9b('0x2c')][_0xac9b('0x33')](_0xac9b('0x34'))){_0x3097c9[_0xac9b('0x1d')]=qs[_0xac9b('0x1d')](_0x569dd9[_0xac9b('0x2c')][_0xac9b('0x1d')]);_0x3097c9[_0xac9b('0x1c')]=qs[_0xac9b('0x1c')](_0x569dd9['query'][_0xac9b('0x1c')]);}_0x3097c9[_0xac9b('0x35')]=qs['sort'](_0x569dd9['query'][_0xac9b('0x36')]);_0x3097c9[_0xac9b('0x37')]=qs['filters'](_[_0xac9b('0x38')](_0x569dd9['query'],_0x164919[_0xac9b('0x2d')]),_0x44e8e8);if(_0x569dd9[_0xac9b('0x2c')][_0xac9b('0x39')]){_0x3097c9[_0xac9b('0x37')]=_[_0xac9b('0x3a')](_0x3097c9['where'],{'$or':_[_0xac9b('0x27')](_0x44e8e8,function(_0x296833){if(_0x296833[_0xac9b('0x3b')]!=='VIRTUAL'){var _0x1ddb6f={};_0x1ddb6f[_0x296833[_0xac9b('0x24')]]={'$like':'%'+_0x569dd9[_0xac9b('0x2c')][_0xac9b('0x39')]+'%'};return _0x1ddb6f;}})});}_0x3097c9=_['merge']({},_0x3097c9,_0x569dd9[_0xac9b('0x3c')]);var _0x3f7996={'where':_0x3097c9[_0xac9b('0x37')]};return db[_0xac9b('0x3d')]['count'](_0x3f7996)[_0xac9b('0x21')](function(_0x683de4){_0x3784e5['count']=_0x683de4;if(_0x569dd9[_0xac9b('0x2c')]['includeAll']){_0x3097c9[_0xac9b('0x3e')]=[{'all':!![]}];}return db[_0xac9b('0x3d')][_0xac9b('0x3f')](_0x3097c9);})[_0xac9b('0x21')](function(_0x3d144e){_0x3784e5[_0xac9b('0x40')]=_0x3d144e;return _0x3784e5;})[_0xac9b('0x21')](respondWithFilteredResult(_0x5538e9,_0x3097c9))[_0xac9b('0x41')](handleError(_0x5538e9,null));};exports[_0xac9b('0x42')]=function(_0x3a1d61,_0x3bee2e){var _0x1070e4={'raw':!![],'where':{'id':_0x3a1d61[_0xac9b('0x43')]['id']}},_0x1fcac4={};_0x1fcac4[_0xac9b('0x2f')]=_['keys'](db['FreshsalesField'][_0xac9b('0x28')]);_0x1fcac4[_0xac9b('0x2c')]=_[_0xac9b('0x2b')](_0x3a1d61[_0xac9b('0x2c')]);_0x1fcac4['filters']=_[_0xac9b('0x2e')](_0x1fcac4[_0xac9b('0x2f')],_0x1fcac4[_0xac9b('0x2c')]);_0x1070e4[_0xac9b('0x30')]=_[_0xac9b('0x2e')](_0x1fcac4[_0xac9b('0x2f')],qs['fields'](_0x3a1d61[_0xac9b('0x2c')]['fields']));_0x1070e4[_0xac9b('0x30')]=_0x1070e4['attributes'][_0xac9b('0x32')]?_0x1070e4[_0xac9b('0x30')]:_0x1fcac4[_0xac9b('0x2f')];if(_0x3a1d61[_0xac9b('0x2c')][_0xac9b('0x44')]){_0x1070e4[_0xac9b('0x3e')]=[{'all':!![]}];}_0x1070e4=_[_0xac9b('0x3a')]({},_0x1070e4,_0x3a1d61[_0xac9b('0x3c')]);return db['FreshsalesField'][_0xac9b('0x45')](_0x1070e4)[_0xac9b('0x21')](handleEntityNotFound(_0x3bee2e,null))[_0xac9b('0x21')](respondWithResult(_0x3bee2e,null))[_0xac9b('0x41')](handleError(_0x3bee2e,null));};exports[_0xac9b('0x46')]=function(_0x2561b8,_0x2e0c42){return db[_0xac9b('0x3d')]['create'](_0x2561b8[_0xac9b('0x47')],{})[_0xac9b('0x21')](respondWithResult(_0x2e0c42,0xc9))[_0xac9b('0x41')](handleError(_0x2e0c42,null));};exports[_0xac9b('0x20')]=function(_0xedda19,_0x354069){if(_0xedda19[_0xac9b('0x47')]['id']){delete _0xedda19[_0xac9b('0x47')]['id'];}return db['FreshsalesField'][_0xac9b('0x45')]({'where':{'id':_0xedda19[_0xac9b('0x43')]['id']}})['then'](handleEntityNotFound(_0x354069,null))[_0xac9b('0x21')](saveUpdates(_0xedda19['body'],null))['then'](respondWithResult(_0x354069,null))['catch'](handleError(_0x354069,null));};exports['destroy']=function(_0x2a2d2d,_0x28b52a){return db[_0xac9b('0x3d')][_0xac9b('0x45')]({'where':{'id':_0x2a2d2d[_0xac9b('0x43')]['id']}})['then'](handleEntityNotFound(_0x28b52a,null))[_0xac9b('0x21')](removeEntity(_0x28b52a,null))['catch'](handleError(_0x28b52a,null));}; \ No newline at end of file +var _0x63cc=['rows','catch','params','length','find','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','FreshsalesField','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0xda6ad1,_0x5f09e3){var _0xedc3a5=function(_0x5459d7){while(--_0x5459d7){_0xda6ad1['push'](_0xda6ad1['shift']());}};_0xedc3a5(++_0x5f09e3);}(_0x63cc,0xa2));var _0xc63c=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x63cc[_0x2aec52];return _0x3b8835;};'use strict';var emlformat=require(_0xc63c('0x0'));var rimraf=require(_0xc63c('0x1'));var zipdir=require(_0xc63c('0x2'));var jsonpatch=require(_0xc63c('0x3'));var rp=require(_0xc63c('0x4'));var moment=require(_0xc63c('0x5'));var BPromise=require(_0xc63c('0x6'));var Mustache=require(_0xc63c('0x7'));var util=require(_0xc63c('0x8'));var path=require(_0xc63c('0x9'));var sox=require(_0xc63c('0xa'));var csv=require('to-csv');var ejs=require(_0xc63c('0xb'));var fs=require('fs');var fs_extra=require(_0xc63c('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc63c('0xd'));var deskjs=require(_0xc63c('0xe'));var toCsv=require(_0xc63c('0xf'));var querystring=require(_0xc63c('0x10'));var Papa=require(_0xc63c('0x11'));var Redis=require(_0xc63c('0x12'));var authService=require(_0xc63c('0x13'));var qs=require(_0xc63c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc63c('0x15'))('api');var utils=require(_0xc63c('0x16'));var config=require(_0xc63c('0x17'));var licenseUtil=require(_0xc63c('0x18'));var db=require(_0xc63c('0x19'))['db'];function respondWithStatusCode(_0xbee303,_0x3fe3c5){_0x3fe3c5=_0x3fe3c5||0xcc;return function(_0x4b8a27){if(_0x4b8a27){return _0xbee303[_0xc63c('0x1a')](_0x3fe3c5);}return _0xbee303['status'](_0x3fe3c5)[_0xc63c('0x1b')]();};}function respondWithResult(_0x42ee09,_0x28006b){_0x28006b=_0x28006b||0xc8;return function(_0x49f7ff){if(_0x49f7ff){return _0x42ee09[_0xc63c('0x1c')](_0x28006b)[_0xc63c('0x1d')](_0x49f7ff);}};}function respondWithFilteredResult(_0xb0d57e,_0x426027){return function(_0x5c218f){if(_0x5c218f){var _0x561557=typeof _0x426027[_0xc63c('0x1e')]===_0xc63c('0x1f')&&typeof _0x426027[_0xc63c('0x20')]===_0xc63c('0x1f');var _0x2fcae5=_0x5c218f[_0xc63c('0x21')];var _0x125dda=_0x561557?0x0:_0x426027[_0xc63c('0x1e')];var _0x70c4b9=_0x561557?_0x5c218f[_0xc63c('0x21')]:_0x426027['offset']+_0x426027[_0xc63c('0x20')];var _0x3caf21;if(_0x70c4b9>=_0x2fcae5){_0x70c4b9=_0x2fcae5;_0x3caf21=0xc8;}else{_0x3caf21=0xce;}_0xb0d57e[_0xc63c('0x1c')](_0x3caf21);return _0xb0d57e[_0xc63c('0x22')](_0xc63c('0x23'),_0x125dda+'-'+_0x70c4b9+'/'+_0x2fcae5)['json'](_0x5c218f);}return null;};}function patchUpdates(_0x4d8a1d){return function(_0x385aea){try{jsonpatch[_0xc63c('0x24')](_0x385aea,_0x4d8a1d,!![]);}catch(_0x5025bf){return BPromise[_0xc63c('0x25')](_0x5025bf);}return _0x385aea[_0xc63c('0x26')]();};}function saveUpdates(_0x53d1b7,_0xf2730){return function(_0x2f86f5){if(_0x2f86f5){return _0x2f86f5['update'](_0x53d1b7)[_0xc63c('0x27')](function(_0x3170c6){return _0x3170c6;});}return null;};}function removeEntity(_0xbddef2,_0x397447){return function(_0x13b6ad){if(_0x13b6ad){return _0x13b6ad[_0xc63c('0x28')]()[_0xc63c('0x27')](function(){_0xbddef2[_0xc63c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38bc6e,_0x2293da){return function(_0x2bef9f){if(!_0x2bef9f){_0x38bc6e['sendStatus'](0x194);}return _0x2bef9f;};}function handleError(_0x1ac0f1,_0x5a7e7d){_0x5a7e7d=_0x5a7e7d||0x1f4;return function(_0x12108f){logger[_0xc63c('0x29')](_0x12108f[_0xc63c('0x2a')]);if(_0x12108f[_0xc63c('0x2b')]){delete _0x12108f['name'];}_0x1ac0f1['status'](_0x5a7e7d)[_0xc63c('0x2c')](_0x12108f);};}exports[_0xc63c('0x2d')]=function(_0x2ca766,_0x222319){var _0x1a99cc={},_0x286d36={},_0x1b710b={'count':0x0,'rows':[]};var _0xcacff6=_[_0xc63c('0x2e')](db[_0xc63c('0x2f')][_0xc63c('0x30')],function(_0x20f5c0){return{'name':_0x20f5c0['fieldName'],'type':_0x20f5c0[_0xc63c('0x31')][_0xc63c('0x32')]};});_0x286d36[_0xc63c('0x33')]=_['map'](_0xcacff6,_0xc63c('0x2b'));_0x286d36['query']=_[_0xc63c('0x34')](_0x2ca766[_0xc63c('0x35')]);_0x286d36[_0xc63c('0x36')]=_[_0xc63c('0x37')](_0x286d36[_0xc63c('0x33')],_0x286d36['query']);_0x1a99cc[_0xc63c('0x38')]=_[_0xc63c('0x37')](_0x286d36[_0xc63c('0x33')],qs[_0xc63c('0x39')](_0x2ca766[_0xc63c('0x35')][_0xc63c('0x39')]));_0x1a99cc[_0xc63c('0x38')]=_0x1a99cc['attributes']['length']?_0x1a99cc[_0xc63c('0x38')]:_0x286d36[_0xc63c('0x33')];if(!_0x2ca766[_0xc63c('0x35')]['hasOwnProperty'](_0xc63c('0x3a'))){_0x1a99cc[_0xc63c('0x20')]=qs[_0xc63c('0x20')](_0x2ca766[_0xc63c('0x35')][_0xc63c('0x20')]);_0x1a99cc[_0xc63c('0x1e')]=qs[_0xc63c('0x1e')](_0x2ca766[_0xc63c('0x35')][_0xc63c('0x1e')]);}_0x1a99cc[_0xc63c('0x3b')]=qs[_0xc63c('0x3c')](_0x2ca766[_0xc63c('0x35')][_0xc63c('0x3c')]);_0x1a99cc[_0xc63c('0x3d')]=qs[_0xc63c('0x36')](_['pick'](_0x2ca766[_0xc63c('0x35')],_0x286d36[_0xc63c('0x36')]),_0xcacff6);if(_0x2ca766[_0xc63c('0x35')][_0xc63c('0x3e')]){_0x1a99cc['where']=_[_0xc63c('0x3f')](_0x1a99cc['where'],{'$or':_['map'](_0xcacff6,function(_0x553d28){if(_0x553d28[_0xc63c('0x31')]!==_0xc63c('0x40')){var _0x265ea3={};_0x265ea3[_0x553d28[_0xc63c('0x2b')]]={'$like':'%'+_0x2ca766[_0xc63c('0x35')]['filter']+'%'};return _0x265ea3;}})});}_0x1a99cc=_[_0xc63c('0x3f')]({},_0x1a99cc,_0x2ca766[_0xc63c('0x41')]);var _0x56ff87={'where':_0x1a99cc['where']};return db[_0xc63c('0x2f')][_0xc63c('0x21')](_0x56ff87)[_0xc63c('0x27')](function(_0x33cbf4){_0x1b710b[_0xc63c('0x21')]=_0x33cbf4;if(_0x2ca766[_0xc63c('0x35')][_0xc63c('0x42')]){_0x1a99cc[_0xc63c('0x43')]=[{'all':!![]}];}return db['FreshsalesField'][_0xc63c('0x44')](_0x1a99cc);})[_0xc63c('0x27')](function(_0x53861f){_0x1b710b[_0xc63c('0x45')]=_0x53861f;return _0x1b710b;})['then'](respondWithFilteredResult(_0x222319,_0x1a99cc))[_0xc63c('0x46')](handleError(_0x222319,null));};exports['show']=function(_0x246e23,_0xe4f25f){var _0x296d9c={'raw':!![],'where':{'id':_0x246e23[_0xc63c('0x47')]['id']}},_0x62eb94={};_0x62eb94[_0xc63c('0x33')]=_[_0xc63c('0x34')](db['FreshsalesField'][_0xc63c('0x30')]);_0x62eb94[_0xc63c('0x35')]=_['keys'](_0x246e23[_0xc63c('0x35')]);_0x62eb94['filters']=_['intersection'](_0x62eb94[_0xc63c('0x33')],_0x62eb94[_0xc63c('0x35')]);_0x296d9c[_0xc63c('0x38')]=_[_0xc63c('0x37')](_0x62eb94['model'],qs[_0xc63c('0x39')](_0x246e23['query'][_0xc63c('0x39')]));_0x296d9c['attributes']=_0x296d9c[_0xc63c('0x38')][_0xc63c('0x48')]?_0x296d9c[_0xc63c('0x38')]:_0x62eb94['model'];if(_0x246e23[_0xc63c('0x35')][_0xc63c('0x42')]){_0x296d9c[_0xc63c('0x43')]=[{'all':!![]}];}_0x296d9c=_['merge']({},_0x296d9c,_0x246e23[_0xc63c('0x41')]);return db[_0xc63c('0x2f')][_0xc63c('0x49')](_0x296d9c)[_0xc63c('0x27')](handleEntityNotFound(_0xe4f25f,null))['then'](respondWithResult(_0xe4f25f,null))[_0xc63c('0x46')](handleError(_0xe4f25f,null));};exports[_0xc63c('0x4a')]=function(_0x19eadf,_0x10530b){return db[_0xc63c('0x2f')][_0xc63c('0x4a')](_0x19eadf['body'],{})[_0xc63c('0x27')](respondWithResult(_0x10530b,0xc9))[_0xc63c('0x46')](handleError(_0x10530b,null));};exports[_0xc63c('0x4b')]=function(_0x4b621e,_0x137ac7){if(_0x4b621e[_0xc63c('0x4c')]['id']){delete _0x4b621e[_0xc63c('0x4c')]['id'];}return db[_0xc63c('0x2f')][_0xc63c('0x49')]({'where':{'id':_0x4b621e['params']['id']}})[_0xc63c('0x27')](handleEntityNotFound(_0x137ac7,null))[_0xc63c('0x27')](saveUpdates(_0x4b621e[_0xc63c('0x4c')],null))[_0xc63c('0x27')](respondWithResult(_0x137ac7,null))[_0xc63c('0x46')](handleError(_0x137ac7,null));};exports['destroy']=function(_0x21ab6f,_0x1e0054){return db['FreshsalesField'][_0xc63c('0x49')]({'where':{'id':_0x21ab6f[_0xc63c('0x47')]['id']}})[_0xc63c('0x27')](handleEntityNotFound(_0x1e0054,null))[_0xc63c('0x27')](removeEntity(_0x1e0054,null))['catch'](handleError(_0x1e0054,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 39e5255..044ba3c 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 _0x9e6d=['api','moment','request-promise','path','rimraf','../../config/environment','exports','FreshsalesField','int_freshsales_fields','freshsales_unique_index','FieldId','lodash','../../config/logger'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x9e6d,0x1d2));var _0xd9e6=function(_0x53cf74,_0x3ce45a){_0x53cf74=_0x53cf74-0x0;var _0x52cfae=_0x9e6d[_0x53cf74];return _0x52cfae;};'use strict';var _=require(_0xd9e6('0x0'));var util=require('util');var logger=require(_0xd9e6('0x1'))(_0xd9e6('0x2'));var moment=require(_0xd9e6('0x3'));var BPromise=require('bluebird');var rp=require(_0xd9e6('0x4'));var fs=require('fs');var path=require(_0xd9e6('0x5'));var rimraf=require(_0xd9e6('0x6'));var config=require(_0xd9e6('0x7'));var attributes=require('./intFreshsalesField.attributes');module[_0xd9e6('0x8')]=function(_0x167f8f,_0x525209){return _0x167f8f['define'](_0xd9e6('0x9'),attributes,{'tableName':_0xd9e6('0xa'),'paranoid':![],'indexes':[{'name':_0xd9e6('0xb'),'fields':['idField',_0xd9e6('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8f1a=['bluebird','request-promise','path','./intFreshsalesField.attributes','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x3141fb,_0x5a131d){var _0x4893e2=function(_0x27afa0){while(--_0x27afa0){_0x3141fb['push'](_0x3141fb['shift']());}};_0x4893e2(++_0x5a131d);}(_0x8f1a,0xcd));var _0xa8f1=function(_0x825ab5,_0x1131ff){_0x825ab5=_0x825ab5-0x0;var _0x2aa11e=_0x8f1a[_0x825ab5];return _0x2aa11e;};'use strict';var _=require(_0xa8f1('0x0'));var util=require(_0xa8f1('0x1'));var logger=require(_0xa8f1('0x2'))(_0xa8f1('0x3'));var moment=require(_0xa8f1('0x4'));var BPromise=require(_0xa8f1('0x5'));var rp=require(_0xa8f1('0x6'));var fs=require('fs');var path=require(_0xa8f1('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa8f1('0x8'));module['exports']=function(_0x1b067d,_0x3d62e4){return _0x1b067d['define'](_0xa8f1('0x9'),attributes,{'tableName':_0xa8f1('0xa'),'paranoid':![],'indexes':[{'name':_0xa8f1('0xb'),'fields':[_0xa8f1('0xc'),_0xa8f1('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 53f2ca4..76cc57c 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 _0x0295=['client','http','then','info','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','FreshsalesField,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3e1224,_0x321e91){var _0x19dc4b=function(_0x39e292){while(--_0x39e292){_0x3e1224['push'](_0x3e1224['shift']());}};_0x19dc4b(++_0x321e91);}(_0x0295,0x1f0));var _0x5029=function(_0x950c48,_0x3acdaf){_0x950c48=_0x950c48-0x0;var _0x20398c=_0x0295[_0x950c48];return _0x20398c;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5029('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5029('0x2'))['db'];var utils=require(_0x5029('0x3'));var logger=require(_0x5029('0x4'))(_0x5029('0x5'));var config=require(_0x5029('0x6'));var jayson=require(_0x5029('0x7'));var client=jayson[_0x5029('0x8')][_0x5029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3cd,_0x502a62,_0x54978f){return new BPromise(function(_0x4ee867,_0xf4459b){return client['request'](_0x5b3cd,_0x54978f)[_0x5029('0xa')](function(_0x5bccfc){logger[_0x5029('0xb')]('FreshsalesField,\x20%s,\x20%s',_0x502a62,_0x5029('0xc'));logger[_0x5029('0xd')](_0x5029('0xe'),_0x502a62,'request\x20sent',JSON[_0x5029('0xf')](_0x5bccfc));if(_0x5bccfc[_0x5029('0x10')]){if(_0x5bccfc[_0x5029('0x10')]['code']===0x1f4){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc['error']['message']);return _0xf4459b(_0x5bccfc['error']['message']);}logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);return _0x4ee867(_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);}else{logger[_0x5029('0xb')](_0x5029('0x11'),_0x502a62,_0x5029('0xc'));_0x4ee867(_0x5bccfc[_0x5029('0x13')][_0x5029('0x12')]);}})[_0x5029('0x14')](function(_0x3786b5){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x3786b5);_0xf4459b(_0x3786b5);});});} \ No newline at end of file +var _0xc1c6=['lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch'];(function(_0x5b0112,_0x484916){var _0x1499dd=function(_0x156b4a){while(--_0x156b4a){_0x5b0112['push'](_0x5b0112['shift']());}};_0x1499dd(++_0x484916);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x2d87bb,_0x7a8459){_0x2d87bb=_0x2d87bb-0x0;var _0x1d27c6=_0xc1c6[_0x2d87bb];return _0x1d27c6;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var moment=require(_0x6c1c('0x2'));var BPromise=require('bluebird');var rs=require(_0x6c1c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c1c('0x4'))['db'];var utils=require(_0x6c1c('0x5'));var logger=require(_0x6c1c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6c1c('0x7'));var client=jayson['client'][_0x6c1c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x582bec,_0xe510ca,_0x2eb1ba){return new BPromise(function(_0x38369d,_0x2cec58){return client['request'](_0x582bec,_0x2eb1ba)[_0x6c1c('0x9')](function(_0x3ca985){logger['info'](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));logger[_0x6c1c('0xc')](_0x6c1c('0xd'),_0xe510ca,'request\x20sent',JSON[_0x6c1c('0xe')](_0x3ca985));if(_0x3ca985[_0x6c1c('0xf')]){if(_0x3ca985[_0x6c1c('0xf')]['code']===0x1f4){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')]['message']);return _0x2cec58(_0x3ca985[_0x6c1c('0xf')]['message']);}logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);return _0x38369d(_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);}else{logger[_0x6c1c('0x11')](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));_0x38369d(_0x3ca985['result'][_0x6c1c('0x10')]);}})[_0x6c1c('0x12')](function(_0x5214ee){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x5214ee);_0x2cec58(_0x5214ee);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index bc329da..7a4c3d0 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x2a8cab,_0x4c5398){var _0x3c01da=function(_0x372a7b){while(--_0x372a7b){_0x2a8cab['push'](_0x2a8cab['shift']());}};_0x3c01da(++_0x4c5398);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x167f43,_0x31d368){var _0x5613e4=function(_0x24ed9d){while(--_0x24ed9d){_0x167f43['push'](_0x167f43['shift']());}};_0x5613e4(++_0x31d368);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 68b4651..b0297b6 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 _0x0bf7=['sequelize','STRING','username','integrationTab','newTab'];(function(_0x4088d3,_0x3622f1){var _0xe9ab96=function(_0x4e4382){while(--_0x4e4382){_0x4088d3['push'](_0x4088d3['shift']());}};_0xe9ab96(++_0x3622f1);}(_0x0bf7,0x14a));var _0x70bf=function(_0x5a7d8f,_0x1aefac){_0x5a7d8f=_0x5a7d8f-0x0;var _0x27249d=_0x0bf7[_0x5a7d8f];return _0x27249d;};'use strict';var Sequelize=require(_0x70bf('0x0'));module['exports']={'name':{'type':Sequelize[_0x70bf('0x1')]},'description':{'type':Sequelize[_0x70bf('0x1')]},'username':{'type':Sequelize[_0x70bf('0x1')],'unique':_0x70bf('0x2')},'remoteUri':{'type':Sequelize[_0x70bf('0x1')]},'password':{'type':Sequelize[_0x70bf('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x70bf('0x1')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x70bf('0x3'),_0x70bf('0x4')),'defaultValue':_0x70bf('0x3')}}; \ No newline at end of file +var _0x2fc0=['exports','STRING','username','ENUM','integrationTab','newTab'];(function(_0x519055,_0x10e614){var _0x1803ad=function(_0x3e5187){while(--_0x3e5187){_0x519055['push'](_0x519055['shift']());}};_0x1803ad(++_0x10e614);}(_0x2fc0,0x192));var _0x02fc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2fc0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x02fc('0x0')]={'name':{'type':Sequelize[_0x02fc('0x1')]},'description':{'type':Sequelize[_0x02fc('0x1')]},'username':{'type':Sequelize[_0x02fc('0x1')],'unique':_0x02fc('0x2')},'remoteUri':{'type':Sequelize[_0x02fc('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x02fc('0x1')]},'clientSecret':{'type':Sequelize[_0x02fc('0x1')]},'securityToken':{'type':Sequelize[_0x02fc('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x02fc('0x3')](_0x02fc('0x4'),_0x02fc('0x5')),'defaultValue':_0x02fc('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 259f9b0..10c6978 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 _0x65ef=['findOne','SalesforceConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Task','remoteUri','clientSecret','username','securityToken','substring','Connection','login','concat','isNil','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','Subject','Description','string','picklist','boolean','email','textarea','phone','remove','includes','custom','picklistValues','label','True','true','false','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../components/integrations/configuration','sendStatus','end','undefined','limit','count','offset','status','set','Content-Range','apply','reject','save','update','then','destroy','name','send','map','SalesforceAccount','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','find','create','body','getConfigurations'];(function(_0x225529,_0x5686b7){var _0x26cbed=function(_0x9aaf35){while(--_0x9aaf35){_0x225529['push'](_0x225529['shift']());}};_0x26cbed(++_0x5686b7);}(_0x65ef,0x1f0));var _0xf65e=function(_0x56af8f,_0x45b72d){_0x56af8f=_0x56af8f-0x0;var _0x3bf32a=_0x65ef[_0x56af8f];return _0x3bf32a;};'use strict';var emlformat=require(_0xf65e('0x0'));var rimraf=require(_0xf65e('0x1'));var zipdir=require(_0xf65e('0x2'));var jsonpatch=require(_0xf65e('0x3'));var rp=require('request-promise');var moment=require(_0xf65e('0x4'));var BPromise=require(_0xf65e('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xf65e('0x6'));var csv=require('to-csv');var ejs=require(_0xf65e('0x7'));var fs=require('fs');var fs_extra=require(_0xf65e('0x8'));var _=require('lodash');var squel=require(_0xf65e('0x9'));var crypto=require('crypto');var jsforce=require(_0xf65e('0xa'));var deskjs=require(_0xf65e('0xb'));var toCsv=require(_0xf65e('0xc'));var querystring=require('querystring');var Papa=require(_0xf65e('0xd'));var Redis=require(_0xf65e('0xe'));var authService=require(_0xf65e('0xf'));var qs=require(_0xf65e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf65e('0x11'))(_0xf65e('0x12'));var utils=require('../../config/utils');var config=require(_0xf65e('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xf65e('0x14'));function respondWithStatusCode(_0x5afbe7,_0x26f9da){_0x26f9da=_0x26f9da||0xcc;return function(_0x1410f8){if(_0x1410f8){return _0x5afbe7[_0xf65e('0x15')](_0x26f9da);}return _0x5afbe7['status'](_0x26f9da)[_0xf65e('0x16')]();};}function respondWithResult(_0x1dd5b9,_0x23cb63){_0x23cb63=_0x23cb63||0xc8;return function(_0x46af50){if(_0x46af50){return _0x1dd5b9['status'](_0x23cb63)['json'](_0x46af50);}};}function respondWithFilteredResult(_0xf6a286,_0x38f9f2){return function(_0x5021e1){if(_0x5021e1){var _0x16fc08=typeof _0x38f9f2['offset']===_0xf65e('0x17')&&typeof _0x38f9f2[_0xf65e('0x18')]==='undefined';var _0x146e41=_0x5021e1[_0xf65e('0x19')];var _0x468753=_0x16fc08?0x0:_0x38f9f2[_0xf65e('0x1a')];var _0x3b8e50=_0x16fc08?_0x5021e1['count']:_0x38f9f2[_0xf65e('0x1a')]+_0x38f9f2['limit'];var _0x4fe30c;if(_0x3b8e50>=_0x146e41){_0x3b8e50=_0x146e41;_0x4fe30c=0xc8;}else{_0x4fe30c=0xce;}_0xf6a286[_0xf65e('0x1b')](_0x4fe30c);return _0xf6a286[_0xf65e('0x1c')](_0xf65e('0x1d'),_0x468753+'-'+_0x3b8e50+'/'+_0x146e41)['json'](_0x5021e1);}return null;};}function patchUpdates(_0x162795){return function(_0x123e97){try{jsonpatch[_0xf65e('0x1e')](_0x123e97,_0x162795,!![]);}catch(_0x3be760){return BPromise[_0xf65e('0x1f')](_0x3be760);}return _0x123e97[_0xf65e('0x20')]();};}function saveUpdates(_0x470c2a,_0x2096a4){return function(_0x72ebaa){if(_0x72ebaa){return _0x72ebaa[_0xf65e('0x21')](_0x470c2a)[_0xf65e('0x22')](function(_0x4616b0){return _0x4616b0;});}return null;};}function removeEntity(_0x5ef901,_0xc1b670){return function(_0x4dc495){if(_0x4dc495){return _0x4dc495[_0xf65e('0x23')]()[_0xf65e('0x22')](function(){_0x5ef901[_0xf65e('0x1b')](0xcc)[_0xf65e('0x16')]();});}};}function handleEntityNotFound(_0xfbebf7,_0x7934e7){return function(_0x20ffc7){if(!_0x20ffc7){_0xfbebf7[_0xf65e('0x15')](0x194);}return _0x20ffc7;};}function handleError(_0x477380,_0x3853b5){_0x3853b5=_0x3853b5||0x1f4;return function(_0x33a914){logger['error'](_0x33a914['stack']);if(_0x33a914['name']){delete _0x33a914[_0xf65e('0x24')];}_0x477380['status'](_0x3853b5)[_0xf65e('0x25')](_0x33a914);};}exports['index']=function(_0x2dcf83,_0x39e8e6){var _0xe98d86={},_0x4378a4={},_0x2a3eea={'count':0x0,'rows':[]};var _0x49ee74=_[_0xf65e('0x26')](db[_0xf65e('0x27')][_0xf65e('0x28')],function(_0x20c57f){return{'name':_0x20c57f['fieldName'],'type':_0x20c57f[_0xf65e('0x29')][_0xf65e('0x2a')]};});_0x4378a4[_0xf65e('0x2b')]=_['map'](_0x49ee74,'name');_0x4378a4[_0xf65e('0x2c')]=_[_0xf65e('0x2d')](_0x2dcf83[_0xf65e('0x2c')]);_0x4378a4[_0xf65e('0x2e')]=_['intersection'](_0x4378a4[_0xf65e('0x2b')],_0x4378a4['query']);_0xe98d86[_0xf65e('0x2f')]=_[_0xf65e('0x30')](_0x4378a4[_0xf65e('0x2b')],qs[_0xf65e('0x31')](_0x2dcf83['query'][_0xf65e('0x31')]));_0xe98d86[_0xf65e('0x2f')]=_0xe98d86[_0xf65e('0x2f')][_0xf65e('0x32')]?_0xe98d86[_0xf65e('0x2f')]:_0x4378a4[_0xf65e('0x2b')];if(!_0x2dcf83[_0xf65e('0x2c')][_0xf65e('0x33')](_0xf65e('0x34'))){_0xe98d86[_0xf65e('0x18')]=qs[_0xf65e('0x18')](_0x2dcf83[_0xf65e('0x2c')][_0xf65e('0x18')]);_0xe98d86[_0xf65e('0x1a')]=qs[_0xf65e('0x1a')](_0x2dcf83[_0xf65e('0x2c')]['offset']);}_0xe98d86['order']=qs[_0xf65e('0x35')](_0x2dcf83['query'][_0xf65e('0x35')]);_0xe98d86[_0xf65e('0x36')]=qs[_0xf65e('0x2e')](_[_0xf65e('0x37')](_0x2dcf83[_0xf65e('0x2c')],_0x4378a4['filters']),_0x49ee74);if(_0x2dcf83['query'][_0xf65e('0x38')]){_0xe98d86['where']=_[_0xf65e('0x39')](_0xe98d86[_0xf65e('0x36')],{'$or':_[_0xf65e('0x26')](_0x49ee74,function(_0x1d1d16){if(_0x1d1d16[_0xf65e('0x29')]!==_0xf65e('0x3a')){var _0x5a2f1a={};_0x5a2f1a[_0x1d1d16['name']]={'$like':'%'+_0x2dcf83['query'][_0xf65e('0x38')]+'%'};return _0x5a2f1a;}})});}_0xe98d86=_[_0xf65e('0x39')]({},_0xe98d86,_0x2dcf83[_0xf65e('0x3b')]);var _0x33da20={'where':_0xe98d86[_0xf65e('0x36')]};return db['SalesforceAccount'][_0xf65e('0x19')](_0x33da20)[_0xf65e('0x22')](function(_0x2ddec1){_0x2a3eea[_0xf65e('0x19')]=_0x2ddec1;if(_0x2dcf83['query'][_0xf65e('0x3c')]){_0xe98d86['include']=[{'all':!![]}];}return db[_0xf65e('0x27')]['findAll'](_0xe98d86);})[_0xf65e('0x22')](function(_0x372f5d){_0x2a3eea[_0xf65e('0x3d')]=_0x372f5d;return _0x2a3eea;})[_0xf65e('0x22')](respondWithFilteredResult(_0x39e8e6,_0xe98d86))[_0xf65e('0x3e')](handleError(_0x39e8e6,null));};exports[_0xf65e('0x3f')]=function(_0x4d5885,_0x51e301){var _0x218cd8={'raw':![],'where':{'id':_0x4d5885[_0xf65e('0x40')]['id']}},_0x2850ab={};_0x2850ab[_0xf65e('0x2b')]=_[_0xf65e('0x2d')](db[_0xf65e('0x27')][_0xf65e('0x28')]);_0x2850ab[_0xf65e('0x2c')]=_[_0xf65e('0x2d')](_0x4d5885[_0xf65e('0x2c')]);_0x2850ab[_0xf65e('0x2e')]=_[_0xf65e('0x30')](_0x2850ab['model'],_0x2850ab[_0xf65e('0x2c')]);_0x218cd8[_0xf65e('0x2f')]=_['intersection'](_0x2850ab[_0xf65e('0x2b')],qs[_0xf65e('0x31')](_0x4d5885[_0xf65e('0x2c')]['fields']));_0x218cd8[_0xf65e('0x2f')]=_0x218cd8[_0xf65e('0x2f')][_0xf65e('0x32')]?_0x218cd8['attributes']:_0x2850ab[_0xf65e('0x2b')];if(_0x4d5885[_0xf65e('0x2c')][_0xf65e('0x3c')]){_0x218cd8['include']=[{'all':!![]}];}_0x218cd8=_[_0xf65e('0x39')]({},_0x218cd8,_0x4d5885[_0xf65e('0x3b')]);return db[_0xf65e('0x27')][_0xf65e('0x41')](_0x218cd8)['then'](handleEntityNotFound(_0x51e301,null))[_0xf65e('0x22')](respondWithResult(_0x51e301,null))['catch'](handleError(_0x51e301,null));};exports[_0xf65e('0x42')]=function(_0x3abd86,_0x1c304c){return db[_0xf65e('0x27')][_0xf65e('0x42')](_0x3abd86[_0xf65e('0x43')],{})[_0xf65e('0x22')](respondWithResult(_0x1c304c,0xc9))[_0xf65e('0x3e')](handleError(_0x1c304c,null));};exports[_0xf65e('0x21')]=function(_0x3cf508,_0x3568e9){if(_0x3cf508['body']['id']){delete _0x3cf508['body']['id'];}return db[_0xf65e('0x27')][_0xf65e('0x41')]({'where':{'id':_0x3cf508[_0xf65e('0x40')]['id']}})[_0xf65e('0x22')](handleEntityNotFound(_0x3568e9,null))[_0xf65e('0x22')](saveUpdates(_0x3cf508[_0xf65e('0x43')],null))[_0xf65e('0x22')](respondWithResult(_0x3568e9,null))[_0xf65e('0x3e')](handleError(_0x3568e9,null));};exports[_0xf65e('0x23')]=function(_0x2e7dcf,_0x301c05){return db['SalesforceAccount'][_0xf65e('0x41')]({'where':{'id':_0x2e7dcf[_0xf65e('0x40')]['id']}})[_0xf65e('0x22')](handleEntityNotFound(_0x301c05,null))[_0xf65e('0x22')](removeEntity(_0x301c05,null))[_0xf65e('0x3e')](handleError(_0x301c05,null));};exports[_0xf65e('0x44')]=function(_0x4eb9cb,_0x122cce,_0x5de6aa){var _0xb407ba={};var _0x411784={};var _0x4e2e97;var _0x48d93d;return db[_0xf65e('0x27')][_0xf65e('0x45')]({'where':{'id':_0x4eb9cb['params']['id']}})['then'](handleEntityNotFound(_0x122cce,null))['then'](function(_0x13c0be){if(_0x13c0be){_0x4e2e97=_0x13c0be;_0x411784[_0xf65e('0x2b')]=_[_0xf65e('0x2d')](db[_0xf65e('0x46')][_0xf65e('0x28')]);_0x411784[_0xf65e('0x2c')]=_[_0xf65e('0x2d')](_0x4eb9cb[_0xf65e('0x2c')]);_0x411784['filters']=_[_0xf65e('0x30')](_0x411784['model'],_0x411784[_0xf65e('0x2c')]);_0xb407ba[_0xf65e('0x2f')]=_[_0xf65e('0x30')](_0x411784[_0xf65e('0x2b')],qs[_0xf65e('0x31')](_0x4eb9cb[_0xf65e('0x2c')][_0xf65e('0x31')]));_0xb407ba[_0xf65e('0x2f')]=_0xb407ba['attributes']['length']?_0xb407ba['attributes']:_0x411784[_0xf65e('0x2b')];_0xb407ba['order']=qs['sort'](_0x4eb9cb[_0xf65e('0x2c')][_0xf65e('0x35')]);_0xb407ba['where']=qs[_0xf65e('0x2e')](_[_0xf65e('0x37')](_0x4eb9cb[_0xf65e('0x2c')],_0x411784['filters']));if(_0x4eb9cb[_0xf65e('0x2c')][_0xf65e('0x38')]){_0xb407ba[_0xf65e('0x36')]=_[_0xf65e('0x39')](_0xb407ba['where'],{'$or':_[_0xf65e('0x26')](_0xb407ba[_0xf65e('0x2f')],function(_0x1e4040){var _0x2ef5e2={};_0x2ef5e2[_0x1e4040]={'$like':'%'+_0x4eb9cb[_0xf65e('0x2c')][_0xf65e('0x38')]+'%'};return _0x2ef5e2;})});}_0xb407ba=_['merge']({},_0xb407ba,_0x4eb9cb[_0xf65e('0x3b')]);return _0x4e2e97['getConfigurations'](_0xb407ba);}})['then'](function(_0x460f58){if(_0x460f58){_0x48d93d=_0x460f58['length'];if(!_0x4eb9cb[_0xf65e('0x2c')][_0xf65e('0x33')](_0xf65e('0x34'))){_0xb407ba['limit']=qs[_0xf65e('0x18')](_0x4eb9cb[_0xf65e('0x2c')][_0xf65e('0x18')]);_0xb407ba[_0xf65e('0x1a')]=qs[_0xf65e('0x1a')](_0x4eb9cb[_0xf65e('0x2c')][_0xf65e('0x1a')]);}return _0x4e2e97[_0xf65e('0x44')](_0xb407ba);}})[_0xf65e('0x22')](function(_0x33e7c7){if(_0x33e7c7){return _0x33e7c7?{'count':_0x48d93d,'rows':_0x33e7c7}:null;}})['then'](respondWithResult(_0x122cce,null))[_0xf65e('0x3e')](handleError(_0x122cce,null));};exports['addConfiguration']=function(_0x36875b,_0x45b4ab,_0xcf2b9c){if(_0x36875b[_0xf65e('0x43')]['id']){delete _0x36875b[_0xf65e('0x43')]['id'];}return db['SalesforceAccount'][_0xf65e('0x45')]({'where':{'id':_0x36875b[_0xf65e('0x40')]['id']}})[_0xf65e('0x22')](handleEntityNotFound(_0x45b4ab,null))[_0xf65e('0x22')](function(_0x3effa3){if(_0x3effa3){_0x36875b['body'][_0xf65e('0x47')]=_0x3effa3['id'];_0x36875b[_0xf65e('0x43')][_0xf65e('0x48')]=integrations[_0xf65e('0x49')](_0x36875b['body'][_0xf65e('0x4a')],_0x36875b['body'][_0xf65e('0x29')]);_0x36875b[_0xf65e('0x43')][_0xf65e('0x4b')]=integrations[_0xf65e('0x4c')](_0x36875b['body'][_0xf65e('0x4a')],_0x36875b['body'][_0xf65e('0x29')]);return db[_0xf65e('0x46')]['create'](_0x36875b[_0xf65e('0x43')],{'include':[{'model':db['SalesforceField'],'as':_0xf65e('0x48')},{'model':db['SalesforceField'],'as':_0xf65e('0x4b')}]});}return null;})[_0xf65e('0x22')](respondWithResult(_0x45b4ab,null))[_0xf65e('0x3e')](handleError(_0x45b4ab,null));};exports['getFields']=function(_0x393c18,_0x2ac64d,_0x40fad1){var _0x3ec5cb;var _0x445ece='';var _0x2d8d6f=_0xf65e('0x4d');return db[_0xf65e('0x27')][_0xf65e('0x45')]({'where':{'id':_0x393c18['params']['id']},'attributes':['id',_0xf65e('0x4e'),'clientId',_0xf65e('0x4f'),_0xf65e('0x50'),'password',_0xf65e('0x51')]})[_0xf65e('0x22')](handleEntityNotFound(_0x2ac64d,null))['then'](function(_0x5ed59e){if(_0x5ed59e){_0x445ece=_0x5ed59e[_0xf65e('0x4e')];var _0x3b8534=_0x445ece['slice'](-0x1);if(_0x3b8534==='/'){_0x445ece=_0x445ece[_0xf65e('0x52')](0x0,_0x445ece['lastIndexOf'](_0x3b8534));}_0x3ec5cb=new jsforce[(_0xf65e('0x53'))]({'oauth2':{'loginUrl':_0x445ece,'clientId':_0x5ed59e['clientId'],'clientSecret':_0x5ed59e[_0xf65e('0x4f')]}});return _0x3ec5cb[_0xf65e('0x54')](_0x5ed59e[_0xf65e('0x50')],_0x5ed59e['password'][_0xf65e('0x55')](_0x5ed59e[_0xf65e('0x51')]));}})['then'](function(_0x40ae6a){if(_0x40ae6a){if(!_[_0xf65e('0x56')](_0x393c18[_0xf65e('0x2c')][_0xf65e('0x57')])){_0x2d8d6f=_0x393c18['query'][_0xf65e('0x57')];}return _0x3ec5cb[_0xf65e('0x58')](_0x2d8d6f)['describe']();}})[_0xf65e('0x22')](function(_0x4ddc93){var _0x5d2c1a=[_0xf65e('0x59'),_0xf65e('0x5a'),_0xf65e('0x5b'),'IsRecurrence',_0xf65e('0x5c'),_0xf65e('0x5d')];var _0x5781b2=[_0xf65e('0x5e'),'int',_0xf65e('0x5f'),_0xf65e('0x60'),_0xf65e('0x61'),_0xf65e('0x62'),_0xf65e('0x63')];if(_0x4ddc93){_[_0xf65e('0x64')](_0x4ddc93[_0xf65e('0x31')],function(_0x10258e){return _0x5d2c1a[_0xf65e('0x65')](_0x10258e[_0xf65e('0x24')])||!_0x5781b2['includes'](_0x10258e[_0xf65e('0x29')]);});return{'count':_0x4ddc93[_0xf65e('0x31')][_0xf65e('0x32')],'rows':_['map'](_0x4ddc93[_0xf65e('0x31')],function(_0x1a5dc2){return{'id':_0x1a5dc2[_0xf65e('0x24')],'name':_0x1a5dc2['label'],'custom':_0x1a5dc2[_0xf65e('0x66')],'options':_0x1a5dc2['picklistValues'][_0xf65e('0x32')]>0x0?_[_0xf65e('0x26')](_0x1a5dc2[_0xf65e('0x67')],function(_0x34d478){return{'name':_0x34d478[_0xf65e('0x68')],'value':_0x34d478['value']};}):_0x1a5dc2[_0xf65e('0x29')]==_0xf65e('0x60')?[{'name':_0xf65e('0x69'),'value':_0xf65e('0x6a')},{'name':'False','value':_0xf65e('0x6b')}]:[]};})};}})[_0xf65e('0x22')](respondWithResult(_0x2ac64d,null))[_0xf65e('0x3e')](function(_0x23fe4b){var _0x10b007=_0x393c18['query']['test']?0x1f4:_0x23fe4b['statusCode']||0x1f4;logger['error'](_0xf65e('0x6c'),'getFields',_0x10b007,JSON[_0xf65e('0x6d')](_0x23fe4b));delete _0x23fe4b[_0xf65e('0x24')];if(_0x10b007===0x191){_0x10b007=0x190;}_0x2ac64d[_0xf65e('0x1b')](_0x10b007)[_0xf65e('0x25')](_0x393c18[_0xf65e('0x2c')][_0xf65e('0x6e')]?{'message':_0xf65e('0x6f'),'statusCode':_0x23fe4b[_0xf65e('0x70')]}:_0x23fe4b);});}; \ No newline at end of file +var _0xa573=['addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','username','password','slice','substring','lastIndexOf','Connection','clientId','clientSecret','login','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Description','string','int','picklist','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','value','true','False','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','jsforce','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','end','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','model','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','SalesforceConfiguration','options','length','hasOwnProperty'];(function(_0x3101ec,_0x12e8ce){var _0x1a51cf=function(_0x15f104){while(--_0x15f104){_0x3101ec['push'](_0x3101ec['shift']());}};_0x1a51cf(++_0x12e8ce);}(_0xa573,0x12f));var _0x3a57=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa573[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3a57('0x0'));var rimraf=require(_0x3a57('0x1'));var zipdir=require(_0x3a57('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3a57('0x3'));var moment=require('moment');var BPromise=require(_0x3a57('0x4'));var Mustache=require(_0x3a57('0x5'));var util=require('util');var path=require(_0x3a57('0x6'));var sox=require(_0x3a57('0x7'));var csv=require(_0x3a57('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3a57('0x9'));var _=require(_0x3a57('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3a57('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3a57('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3a57('0xd'))(_0x3a57('0xe'));var utils=require(_0x3a57('0xf'));var config=require(_0x3a57('0x10'));var licenseUtil=require(_0x3a57('0x11'));var db=require(_0x3a57('0x12'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4a96f8,_0x5a0487){_0x5a0487=_0x5a0487||0xcc;return function(_0x53d715){if(_0x53d715){return _0x4a96f8[_0x3a57('0x13')](_0x5a0487);}return _0x4a96f8[_0x3a57('0x14')](_0x5a0487)['end']();};}function respondWithResult(_0xe33514,_0x21f174){_0x21f174=_0x21f174||0xc8;return function(_0x120d1b){if(_0x120d1b){return _0xe33514[_0x3a57('0x14')](_0x21f174)[_0x3a57('0x15')](_0x120d1b);}};}function respondWithFilteredResult(_0x540c32,_0x245c8e){return function(_0x3866d3){if(_0x3866d3){var _0xb8c0a9=typeof _0x245c8e[_0x3a57('0x16')]===_0x3a57('0x17')&&typeof _0x245c8e['limit']==='undefined';var _0x3266e9=_0x3866d3['count'];var _0x262385=_0xb8c0a9?0x0:_0x245c8e[_0x3a57('0x16')];var _0x572ba2=_0xb8c0a9?_0x3866d3[_0x3a57('0x18')]:_0x245c8e[_0x3a57('0x16')]+_0x245c8e[_0x3a57('0x19')];var _0x1336cb;if(_0x572ba2>=_0x3266e9){_0x572ba2=_0x3266e9;_0x1336cb=0xc8;}else{_0x1336cb=0xce;}_0x540c32[_0x3a57('0x14')](_0x1336cb);return _0x540c32[_0x3a57('0x1a')](_0x3a57('0x1b'),_0x262385+'-'+_0x572ba2+'/'+_0x3266e9)[_0x3a57('0x15')](_0x3866d3);}return null;};}function patchUpdates(_0x57523e){return function(_0x27cc68){try{jsonpatch['apply'](_0x27cc68,_0x57523e,!![]);}catch(_0x24d17e){return BPromise[_0x3a57('0x1c')](_0x24d17e);}return _0x27cc68[_0x3a57('0x1d')]();};}function saveUpdates(_0x30bed1,_0x395950){return function(_0x404c1c){if(_0x404c1c){return _0x404c1c[_0x3a57('0x1e')](_0x30bed1)['then'](function(_0x3aa822){return _0x3aa822;});}return null;};}function removeEntity(_0x3c0dec,_0x52b25e){return function(_0x35fe55){if(_0x35fe55){return _0x35fe55[_0x3a57('0x1f')]()[_0x3a57('0x20')](function(){_0x3c0dec[_0x3a57('0x14')](0xcc)[_0x3a57('0x21')]();});}};}function handleEntityNotFound(_0x2b6adc,_0x3ae834){return function(_0x825c8c){if(!_0x825c8c){_0x2b6adc[_0x3a57('0x13')](0x194);}return _0x825c8c;};}function handleError(_0x357701,_0x1d03e1){_0x1d03e1=_0x1d03e1||0x1f4;return function(_0x5c23c9){logger['error'](_0x5c23c9[_0x3a57('0x22')]);if(_0x5c23c9[_0x3a57('0x23')]){delete _0x5c23c9[_0x3a57('0x23')];}_0x357701[_0x3a57('0x14')](_0x1d03e1)[_0x3a57('0x24')](_0x5c23c9);};}exports[_0x3a57('0x25')]=function(_0x23fab4,_0xd0805){var _0x15074d={},_0x54ee97={},_0x590b43={'count':0x0,'rows':[]};var _0x1e1567=_[_0x3a57('0x26')](db[_0x3a57('0x27')][_0x3a57('0x28')],function(_0x1da1f8){return{'name':_0x1da1f8[_0x3a57('0x29')],'type':_0x1da1f8[_0x3a57('0x2a')][_0x3a57('0x2b')]};});_0x54ee97['model']=_['map'](_0x1e1567,_0x3a57('0x23'));_0x54ee97[_0x3a57('0x2c')]=_[_0x3a57('0x2d')](_0x23fab4[_0x3a57('0x2c')]);_0x54ee97[_0x3a57('0x2e')]=_['intersection'](_0x54ee97['model'],_0x54ee97[_0x3a57('0x2c')]);_0x15074d[_0x3a57('0x2f')]=_[_0x3a57('0x30')](_0x54ee97[_0x3a57('0x31')],qs[_0x3a57('0x32')](_0x23fab4[_0x3a57('0x2c')]['fields']));_0x15074d[_0x3a57('0x2f')]=_0x15074d[_0x3a57('0x2f')]['length']?_0x15074d['attributes']:_0x54ee97[_0x3a57('0x31')];if(!_0x23fab4[_0x3a57('0x2c')]['hasOwnProperty'](_0x3a57('0x33'))){_0x15074d[_0x3a57('0x19')]=qs['limit'](_0x23fab4[_0x3a57('0x2c')][_0x3a57('0x19')]);_0x15074d[_0x3a57('0x16')]=qs[_0x3a57('0x16')](_0x23fab4[_0x3a57('0x2c')]['offset']);}_0x15074d[_0x3a57('0x34')]=qs[_0x3a57('0x35')](_0x23fab4[_0x3a57('0x2c')][_0x3a57('0x35')]);_0x15074d[_0x3a57('0x36')]=qs[_0x3a57('0x2e')](_[_0x3a57('0x37')](_0x23fab4[_0x3a57('0x2c')],_0x54ee97[_0x3a57('0x2e')]),_0x1e1567);if(_0x23fab4['query']['filter']){_0x15074d[_0x3a57('0x36')]=_[_0x3a57('0x38')](_0x15074d[_0x3a57('0x36')],{'$or':_[_0x3a57('0x26')](_0x1e1567,function(_0x58da30){if(_0x58da30[_0x3a57('0x2a')]!==_0x3a57('0x39')){var _0x17fc24={};_0x17fc24[_0x58da30[_0x3a57('0x23')]]={'$like':'%'+_0x23fab4[_0x3a57('0x2c')][_0x3a57('0x3a')]+'%'};return _0x17fc24;}})});}_0x15074d=_[_0x3a57('0x38')]({},_0x15074d,_0x23fab4['options']);var _0x520aea={'where':_0x15074d[_0x3a57('0x36')]};return db[_0x3a57('0x27')][_0x3a57('0x18')](_0x520aea)[_0x3a57('0x20')](function(_0x31c7de){_0x590b43[_0x3a57('0x18')]=_0x31c7de;if(_0x23fab4[_0x3a57('0x2c')][_0x3a57('0x3b')]){_0x15074d[_0x3a57('0x3c')]=[{'all':!![]}];}return db['SalesforceAccount'][_0x3a57('0x3d')](_0x15074d);})[_0x3a57('0x20')](function(_0x247f24){_0x590b43[_0x3a57('0x3e')]=_0x247f24;return _0x590b43;})['then'](respondWithFilteredResult(_0xd0805,_0x15074d))[_0x3a57('0x3f')](handleError(_0xd0805,null));};exports[_0x3a57('0x40')]=function(_0x3ca143,_0x455d3b){var _0x135843={'raw':![],'where':{'id':_0x3ca143[_0x3a57('0x41')]['id']}},_0x20ef52={};_0x20ef52[_0x3a57('0x31')]=_['keys'](db[_0x3a57('0x27')][_0x3a57('0x28')]);_0x20ef52[_0x3a57('0x2c')]=_[_0x3a57('0x2d')](_0x3ca143['query']);_0x20ef52[_0x3a57('0x2e')]=_['intersection'](_0x20ef52[_0x3a57('0x31')],_0x20ef52[_0x3a57('0x2c')]);_0x135843[_0x3a57('0x2f')]=_['intersection'](_0x20ef52[_0x3a57('0x31')],qs['fields'](_0x3ca143[_0x3a57('0x2c')]['fields']));_0x135843['attributes']=_0x135843['attributes']['length']?_0x135843[_0x3a57('0x2f')]:_0x20ef52[_0x3a57('0x31')];if(_0x3ca143[_0x3a57('0x2c')][_0x3a57('0x3b')]){_0x135843[_0x3a57('0x3c')]=[{'all':!![]}];}_0x135843=_[_0x3a57('0x38')]({},_0x135843,_0x3ca143['options']);return db[_0x3a57('0x27')][_0x3a57('0x42')](_0x135843)[_0x3a57('0x20')](handleEntityNotFound(_0x455d3b,null))[_0x3a57('0x20')](respondWithResult(_0x455d3b,null))[_0x3a57('0x3f')](handleError(_0x455d3b,null));};exports['create']=function(_0x5b3254,_0x2fc7cb){return db[_0x3a57('0x27')][_0x3a57('0x43')](_0x5b3254[_0x3a57('0x44')],{})[_0x3a57('0x20')](respondWithResult(_0x2fc7cb,0xc9))[_0x3a57('0x3f')](handleError(_0x2fc7cb,null));};exports[_0x3a57('0x1e')]=function(_0x337e03,_0x1364e2){if(_0x337e03[_0x3a57('0x44')]['id']){delete _0x337e03[_0x3a57('0x44')]['id'];}return db['SalesforceAccount'][_0x3a57('0x42')]({'where':{'id':_0x337e03[_0x3a57('0x41')]['id']}})[_0x3a57('0x20')](handleEntityNotFound(_0x1364e2,null))[_0x3a57('0x20')](saveUpdates(_0x337e03[_0x3a57('0x44')],null))['then'](respondWithResult(_0x1364e2,null))[_0x3a57('0x3f')](handleError(_0x1364e2,null));};exports[_0x3a57('0x1f')]=function(_0x4ac795,_0x529a93){return db[_0x3a57('0x27')][_0x3a57('0x42')]({'where':{'id':_0x4ac795[_0x3a57('0x41')]['id']}})[_0x3a57('0x20')](handleEntityNotFound(_0x529a93,null))[_0x3a57('0x20')](removeEntity(_0x529a93,null))['catch'](handleError(_0x529a93,null));};exports[_0x3a57('0x45')]=function(_0x3140b9,_0x1b4ecc,_0x6ec3ec){var _0x3470c8={};var _0x42faab={};var _0x481dc2;var _0x4a0d09;return db[_0x3a57('0x27')][_0x3a57('0x46')]({'where':{'id':_0x3140b9[_0x3a57('0x41')]['id']}})['then'](handleEntityNotFound(_0x1b4ecc,null))[_0x3a57('0x20')](function(_0x43571b){if(_0x43571b){_0x481dc2=_0x43571b;_0x42faab[_0x3a57('0x31')]=_[_0x3a57('0x2d')](db[_0x3a57('0x47')]['rawAttributes']);_0x42faab[_0x3a57('0x2c')]=_['keys'](_0x3140b9[_0x3a57('0x2c')]);_0x42faab[_0x3a57('0x2e')]=_[_0x3a57('0x30')](_0x42faab[_0x3a57('0x31')],_0x42faab[_0x3a57('0x2c')]);_0x3470c8[_0x3a57('0x2f')]=_[_0x3a57('0x30')](_0x42faab[_0x3a57('0x31')],qs['fields'](_0x3140b9[_0x3a57('0x2c')][_0x3a57('0x32')]));_0x3470c8[_0x3a57('0x2f')]=_0x3470c8[_0x3a57('0x2f')]['length']?_0x3470c8[_0x3a57('0x2f')]:_0x42faab['model'];_0x3470c8[_0x3a57('0x34')]=qs[_0x3a57('0x35')](_0x3140b9[_0x3a57('0x2c')][_0x3a57('0x35')]);_0x3470c8[_0x3a57('0x36')]=qs[_0x3a57('0x2e')](_[_0x3a57('0x37')](_0x3140b9[_0x3a57('0x2c')],_0x42faab['filters']));if(_0x3140b9[_0x3a57('0x2c')][_0x3a57('0x3a')]){_0x3470c8[_0x3a57('0x36')]=_['merge'](_0x3470c8[_0x3a57('0x36')],{'$or':_[_0x3a57('0x26')](_0x3470c8[_0x3a57('0x2f')],function(_0x1e4049){var _0x547cab={};_0x547cab[_0x1e4049]={'$like':'%'+_0x3140b9[_0x3a57('0x2c')]['filter']+'%'};return _0x547cab;})});}_0x3470c8=_[_0x3a57('0x38')]({},_0x3470c8,_0x3140b9[_0x3a57('0x48')]);return _0x481dc2[_0x3a57('0x45')](_0x3470c8);}})[_0x3a57('0x20')](function(_0x123eca){if(_0x123eca){_0x4a0d09=_0x123eca[_0x3a57('0x49')];if(!_0x3140b9[_0x3a57('0x2c')][_0x3a57('0x4a')](_0x3a57('0x33'))){_0x3470c8[_0x3a57('0x19')]=qs['limit'](_0x3140b9[_0x3a57('0x2c')][_0x3a57('0x19')]);_0x3470c8[_0x3a57('0x16')]=qs[_0x3a57('0x16')](_0x3140b9[_0x3a57('0x2c')][_0x3a57('0x16')]);}return _0x481dc2['getConfigurations'](_0x3470c8);}})['then'](function(_0x654f70){if(_0x654f70){return _0x654f70?{'count':_0x4a0d09,'rows':_0x654f70}:null;}})[_0x3a57('0x20')](respondWithResult(_0x1b4ecc,null))[_0x3a57('0x3f')](handleError(_0x1b4ecc,null));};exports[_0x3a57('0x4b')]=function(_0x40210d,_0x313c64,_0x16ef89){if(_0x40210d[_0x3a57('0x44')]['id']){delete _0x40210d[_0x3a57('0x44')]['id'];}return db[_0x3a57('0x27')][_0x3a57('0x46')]({'where':{'id':_0x40210d[_0x3a57('0x41')]['id']}})[_0x3a57('0x20')](handleEntityNotFound(_0x313c64,null))[_0x3a57('0x20')](function(_0x4bb226){if(_0x4bb226){_0x40210d[_0x3a57('0x44')][_0x3a57('0x4c')]=_0x4bb226['id'];_0x40210d[_0x3a57('0x44')][_0x3a57('0x4d')]=integrations[_0x3a57('0x4e')](_0x40210d[_0x3a57('0x44')][_0x3a57('0x4f')],_0x40210d[_0x3a57('0x44')][_0x3a57('0x2a')]);_0x40210d[_0x3a57('0x44')][_0x3a57('0x50')]=integrations[_0x3a57('0x51')](_0x40210d[_0x3a57('0x44')][_0x3a57('0x4f')],_0x40210d['body'][_0x3a57('0x2a')]);return db['SalesforceConfiguration'][_0x3a57('0x43')](_0x40210d[_0x3a57('0x44')],{'include':[{'model':db[_0x3a57('0x52')],'as':_0x3a57('0x4d')},{'model':db['SalesforceField'],'as':_0x3a57('0x50')}]});}return null;})[_0x3a57('0x20')](respondWithResult(_0x313c64,null))[_0x3a57('0x3f')](handleError(_0x313c64,null));};exports[_0x3a57('0x53')]=function(_0x4ab178,_0x411d08,_0x3e6973){var _0x485946;var _0x4b5153='';var _0x1e442e=_0x3a57('0x54');return db[_0x3a57('0x27')][_0x3a57('0x46')]({'where':{'id':_0x4ab178[_0x3a57('0x41')]['id']},'attributes':['id',_0x3a57('0x55'),'clientId','clientSecret',_0x3a57('0x56'),_0x3a57('0x57'),'securityToken']})['then'](handleEntityNotFound(_0x411d08,null))[_0x3a57('0x20')](function(_0x2e01b0){if(_0x2e01b0){_0x4b5153=_0x2e01b0[_0x3a57('0x55')];var _0x1f18d9=_0x4b5153[_0x3a57('0x58')](-0x1);if(_0x1f18d9==='/'){_0x4b5153=_0x4b5153[_0x3a57('0x59')](0x0,_0x4b5153[_0x3a57('0x5a')](_0x1f18d9));}_0x485946=new jsforce[(_0x3a57('0x5b'))]({'oauth2':{'loginUrl':_0x4b5153,'clientId':_0x2e01b0[_0x3a57('0x5c')],'clientSecret':_0x2e01b0[_0x3a57('0x5d')]}});return _0x485946[_0x3a57('0x5e')](_0x2e01b0[_0x3a57('0x56')],_0x2e01b0['password'][_0x3a57('0x5f')](_0x2e01b0['securityToken']));}})[_0x3a57('0x20')](function(_0x16a82){if(_0x16a82){if(!_[_0x3a57('0x60')](_0x4ab178['query'][_0x3a57('0x61')])){_0x1e442e=_0x4ab178['query'][_0x3a57('0x61')];}return _0x485946[_0x3a57('0x62')](_0x1e442e)[_0x3a57('0x63')]();}})[_0x3a57('0x20')](function(_0x9a9b28){var _0x313131=[_0x3a57('0x64'),_0x3a57('0x65'),_0x3a57('0x66'),_0x3a57('0x67'),'Subject',_0x3a57('0x68')];var _0x2583e2=[_0x3a57('0x69'),_0x3a57('0x6a'),_0x3a57('0x6b'),_0x3a57('0x6c'),_0x3a57('0x6d'),_0x3a57('0x6e'),_0x3a57('0x6f')];if(_0x9a9b28){_[_0x3a57('0x70')](_0x9a9b28[_0x3a57('0x32')],function(_0x2e9724){return _0x313131[_0x3a57('0x71')](_0x2e9724[_0x3a57('0x23')])||!_0x2583e2[_0x3a57('0x71')](_0x2e9724[_0x3a57('0x2a')]);});return{'count':_0x9a9b28['fields']['length'],'rows':_[_0x3a57('0x26')](_0x9a9b28[_0x3a57('0x32')],function(_0x2a1f25){return{'id':_0x2a1f25['name'],'name':_0x2a1f25[_0x3a57('0x72')],'custom':_0x2a1f25[_0x3a57('0x73')],'options':_0x2a1f25[_0x3a57('0x74')][_0x3a57('0x49')]>0x0?_[_0x3a57('0x26')](_0x2a1f25[_0x3a57('0x74')],function(_0x10e0b7){return{'name':_0x10e0b7[_0x3a57('0x72')],'value':_0x10e0b7[_0x3a57('0x75')]};}):_0x2a1f25['type']==_0x3a57('0x6c')?[{'name':'True','value':_0x3a57('0x76')},{'name':_0x3a57('0x77'),'value':'false'}]:[]};})};}})[_0x3a57('0x20')](respondWithResult(_0x411d08,null))[_0x3a57('0x3f')](function(_0x25e4f8){var _0x5932a7=_0x4ab178[_0x3a57('0x2c')][_0x3a57('0x78')]?0x1f4:_0x25e4f8[_0x3a57('0x79')]||0x1f4;logger[_0x3a57('0x7a')](_0x3a57('0x7b'),_0x3a57('0x53'),_0x5932a7,JSON[_0x3a57('0x7c')](_0x25e4f8));delete _0x25e4f8['name'];if(_0x5932a7===0x191){_0x5932a7=0x190;}_0x411d08[_0x3a57('0x14')](_0x5932a7)[_0x3a57('0x24')](_0x4ab178[_0x3a57('0x2c')]['test']?{'message':_0x3a57('0x7d'),'statusCode':_0x25e4f8['statusCode']}:_0x25e4f8);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 1b7e93a..8bbc224 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 _0xb973=['../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes'];(function(_0x15539f,_0x2dae2f){var _0x902220=function(_0x155714){while(--_0x155714){_0x15539f['push'](_0x15539f['shift']());}};_0x902220(++_0x2dae2f);}(_0xb973,0xc9));var _0x3b97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb973[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3b97('0x0'));var util=require('util');var logger=require(_0x3b97('0x1'))(_0x3b97('0x2'));var moment=require('moment');var BPromise=require(_0x3b97('0x3'));var rp=require(_0x3b97('0x4'));var fs=require('fs');var path=require(_0x3b97('0x5'));var rimraf=require(_0x3b97('0x6'));var config=require(_0x3b97('0x7'));var attributes=require(_0x3b97('0x8'));var integrations=require(_0x3b97('0x9'));module[_0x3b97('0xa')]=function(_0x5ee30a,_0x2e3692){return _0x5ee30a[_0x3b97('0xb')](_0x3b97('0xc'),attributes,{'tableName':_0x3b97('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa190=['api','moment','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger'];(function(_0x1d6535,_0xc25ce6){var _0x2d21ce=function(_0x50ca83){while(--_0x50ca83){_0x1d6535['push'](_0x1d6535['shift']());}};_0x2d21ce(++_0xc25ce6);}(_0xa190,0x176));var _0x0a19=function(_0x432df4,_0x5f0745){_0x432df4=_0x432df4-0x0;var _0x54817f=_0xa190[_0x432df4];return _0x54817f;};'use strict';var _=require(_0x0a19('0x0'));var util=require(_0x0a19('0x1'));var logger=require(_0x0a19('0x2'))(_0x0a19('0x3'));var moment=require(_0x0a19('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a19('0x5'));var rimraf=require(_0x0a19('0x6'));var config=require(_0x0a19('0x7'));var attributes=require(_0x0a19('0x8'));var integrations=require(_0x0a19('0x9'));module['exports']=function(_0x2ba083,_0x4f20bd){return _0x2ba083[_0x0a19('0xa')](_0x0a19('0xb'),attributes,{'tableName':_0x0a19('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index d093886..abd32a5 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 _0xbd41=['error','code','SalesforceAccount,\x20%s,\x20%s','message','info','SalesforceAccount','findAll','options','raw','where','limit','include','map','model','attributes','GetSalesforceAccount','stringify','ShowSalesforceAccount','find','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug'];(function(_0x38a9cb,_0xfd8b2b){var _0xfa7687=function(_0x8b1b6){while(--_0x8b1b6){_0x38a9cb['push'](_0x38a9cb['shift']());}};_0xfa7687(++_0xfd8b2b);}(_0xbd41,0x124));var _0x1bd4=function(_0x24fe48,_0x10e97e){_0x24fe48=_0x24fe48-0x0;var _0x51e7d5=_0xbd41[_0x24fe48];return _0x51e7d5;};'use strict';var _=require(_0x1bd4('0x0'));var util=require('util');var moment=require(_0x1bd4('0x1'));var BPromise=require(_0x1bd4('0x2'));var rs=require(_0x1bd4('0x3'));var fs=require('fs');var Redis=require(_0x1bd4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1bd4('0x5'));var logger=require('../../config/logger')(_0x1bd4('0x6'));var config=require(_0x1bd4('0x7'));var jayson=require(_0x1bd4('0x8'));var client=jayson[_0x1bd4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46c7ad,_0x361537,_0x49daba){return new BPromise(function(_0x563512,_0x56e1f1){return client[_0x1bd4('0xa')](_0x46c7ad,_0x49daba)[_0x1bd4('0xb')](function(_0x45a768){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x361537,_0x1bd4('0xc'));logger[_0x1bd4('0xd')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x361537,_0x1bd4('0xc'),JSON['stringify'](_0x45a768));if(_0x45a768[_0x1bd4('0xe')]){if(_0x45a768['error'][_0x1bd4('0xf')]===0x1f4){logger[_0x1bd4('0xe')](_0x1bd4('0x10'),_0x361537,_0x45a768[_0x1bd4('0xe')][_0x1bd4('0x11')]);return _0x56e1f1(_0x45a768[_0x1bd4('0xe')][_0x1bd4('0x11')]);}logger[_0x1bd4('0xe')](_0x1bd4('0x10'),_0x361537,_0x45a768[_0x1bd4('0xe')]['message']);return _0x563512(_0x45a768[_0x1bd4('0xe')][_0x1bd4('0x11')]);}else{logger[_0x1bd4('0x12')](_0x1bd4('0x10'),_0x361537,_0x1bd4('0xc'));_0x563512(_0x45a768['result'][_0x1bd4('0x11')]);}})['catch'](function(_0x53c750){logger[_0x1bd4('0xe')](_0x1bd4('0x10'),_0x361537,_0x53c750);_0x56e1f1(_0x53c750);});});}exports['GetSalesforceAccount']=function(_0x4e4024){var _0x1c628e=this;return new Promise(function(_0x3a891a,_0x8465aa){return db[_0x1bd4('0x13')][_0x1bd4('0x14')]({'raw':_0x4e4024[_0x1bd4('0x15')]?_0x4e4024[_0x1bd4('0x15')][_0x1bd4('0x16')]===undefined?!![]:![]:!![],'where':_0x4e4024[_0x1bd4('0x15')]?_0x4e4024[_0x1bd4('0x15')][_0x1bd4('0x17')]||null:null,'attributes':_0x4e4024[_0x1bd4('0x15')]?_0x4e4024[_0x1bd4('0x15')]['attributes']||null:null,'limit':_0x4e4024[_0x1bd4('0x15')]?_0x4e4024[_0x1bd4('0x15')][_0x1bd4('0x18')]||null:null,'include':_0x4e4024[_0x1bd4('0x15')]?_0x4e4024[_0x1bd4('0x15')][_0x1bd4('0x19')]?_[_0x1bd4('0x1a')](_0x4e4024[_0x1bd4('0x15')]['include'],function(_0xe93229){return{'model':db[_0xe93229[_0x1bd4('0x1b')]],'as':_0xe93229['as'],'attributes':_0xe93229[_0x1bd4('0x1c')],'include':_0xe93229['include']?_[_0x1bd4('0x1a')](_0xe93229[_0x1bd4('0x19')],function(_0x49d95a){return{'model':db[_0x49d95a['model']],'as':_0x49d95a['as'],'attributes':_0x49d95a[_0x1bd4('0x1c')],'include':_0x49d95a[_0x1bd4('0x19')]?_[_0x1bd4('0x1a')](_0x49d95a[_0x1bd4('0x19')],function(_0x195f41){return{'model':db[_0x195f41[_0x1bd4('0x1b')]],'as':_0x195f41['as'],'attributes':_0x195f41[_0x1bd4('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1bd4('0xb')](function(_0x44929b){logger['info']('GetSalesforceAccount',_0x4e4024);logger['debug'](_0x1bd4('0x1d'),_0x4e4024,JSON[_0x1bd4('0x1e')](_0x44929b));_0x3a891a(_0x44929b);})['catch'](function(_0x4e6a18){logger['error'](_0x1bd4('0x1d'),_0x4e6a18[_0x1bd4('0x11')],_0x4e4024);_0x8465aa(_0x1c628e[_0x1bd4('0xe')](0x1f4,_0x4e6a18[_0x1bd4('0x11')]));});});};exports[_0x1bd4('0x1f')]=function(_0x52e47d){var _0x3fda13=this;return new Promise(function(_0x44af01,_0x14c9b2){return db[_0x1bd4('0x13')][_0x1bd4('0x20')]({'raw':_0x52e47d['options']?_0x52e47d['options'][_0x1bd4('0x16')]===undefined?!![]:![]:!![],'where':_0x52e47d[_0x1bd4('0x15')]?_0x52e47d[_0x1bd4('0x15')][_0x1bd4('0x17')]||null:null,'attributes':_0x52e47d[_0x1bd4('0x15')]?_0x52e47d[_0x1bd4('0x15')][_0x1bd4('0x1c')]||null:null,'include':_0x52e47d[_0x1bd4('0x15')]?_0x52e47d['options'][_0x1bd4('0x19')]?_['map'](_0x52e47d[_0x1bd4('0x15')]['include'],function(_0x40f04a){return{'model':db[_0x40f04a['model']],'as':_0x40f04a['as'],'attributes':_0x40f04a[_0x1bd4('0x1c')],'include':_0x40f04a['include']?_['map'](_0x40f04a[_0x1bd4('0x19')],function(_0x5eb776){return{'model':db[_0x5eb776[_0x1bd4('0x1b')]],'as':_0x5eb776['as'],'attributes':_0x5eb776[_0x1bd4('0x1c')],'include':_0x5eb776['include']?_[_0x1bd4('0x1a')](_0x5eb776['include'],function(_0x4c50e4){return{'model':db[_0x4c50e4[_0x1bd4('0x1b')]],'as':_0x4c50e4['as'],'attributes':_0x4c50e4[_0x1bd4('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1bd4('0xb')](function(_0x15fa2c){logger[_0x1bd4('0x12')](_0x1bd4('0x1f'),_0x52e47d);logger[_0x1bd4('0xd')](_0x1bd4('0x1f'),_0x52e47d,JSON['stringify'](_0x15fa2c));_0x44af01(_0x15fa2c);})[_0x1bd4('0x21')](function(_0x280a4c){logger['error']('ShowSalesforceAccount',_0x280a4c[_0x1bd4('0x11')],_0x52e47d);_0x14c9b2(_0x3fda13[_0x1bd4('0xe')](0x1f4,_0x280a4c[_0x1bd4('0x11')]));});});}; \ No newline at end of file +var _0x94aa=['ShowSalesforceAccount','find','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','attributes','limit','include','model','map'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x94aa,0x65));var _0xa94a=function(_0x1ac9c6,_0x558e55){_0x1ac9c6=_0x1ac9c6-0x0;var _0x5a9e41=_0x94aa[_0x1ac9c6];return _0x5a9e41;};'use strict';var _=require(_0xa94a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa94a('0x1'));var fs=require('fs');var Redis=require(_0xa94a('0x2'));var db=require(_0xa94a('0x3'))['db'];var utils=require(_0xa94a('0x4'));var logger=require(_0xa94a('0x5'))('rpc');var config=require(_0xa94a('0x6'));var jayson=require(_0xa94a('0x7'));var client=jayson[_0xa94a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x514dff,_0x48e78d,_0x4dc20f){return new BPromise(function(_0x5d65c3,_0x45869c){return client[_0xa94a('0x9')](_0x514dff,_0x4dc20f)['then'](function(_0x5ec4ef){logger['info'](_0xa94a('0xa'),_0x48e78d,_0xa94a('0xb'));logger[_0xa94a('0xc')](_0xa94a('0xd'),_0x48e78d,_0xa94a('0xb'),JSON[_0xa94a('0xe')](_0x5ec4ef));if(_0x5ec4ef['error']){if(_0x5ec4ef[_0xa94a('0xf')][_0xa94a('0x10')]===0x1f4){logger[_0xa94a('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0x48e78d,_0x5ec4ef[_0xa94a('0xf')][_0xa94a('0x11')]);return _0x45869c(_0x5ec4ef[_0xa94a('0xf')][_0xa94a('0x11')]);}logger['error'](_0xa94a('0xa'),_0x48e78d,_0x5ec4ef[_0xa94a('0xf')][_0xa94a('0x11')]);return _0x5d65c3(_0x5ec4ef['error'][_0xa94a('0x11')]);}else{logger[_0xa94a('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x48e78d,'request\x20sent');_0x5d65c3(_0x5ec4ef[_0xa94a('0x13')][_0xa94a('0x11')]);}})[_0xa94a('0x14')](function(_0x1e707){logger[_0xa94a('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0x48e78d,_0x1e707);_0x45869c(_0x1e707);});});}exports[_0xa94a('0x15')]=function(_0x4c8470){var _0x192ca3=this;return new Promise(function(_0x34b883,_0xe653ab){return db[_0xa94a('0x16')][_0xa94a('0x17')]({'raw':_0x4c8470[_0xa94a('0x18')]?_0x4c8470[_0xa94a('0x18')][_0xa94a('0x19')]===undefined?!![]:![]:!![],'where':_0x4c8470[_0xa94a('0x18')]?_0x4c8470['options']['where']||null:null,'attributes':_0x4c8470[_0xa94a('0x18')]?_0x4c8470['options'][_0xa94a('0x1a')]||null:null,'limit':_0x4c8470['options']?_0x4c8470[_0xa94a('0x18')][_0xa94a('0x1b')]||null:null,'include':_0x4c8470[_0xa94a('0x18')]?_0x4c8470[_0xa94a('0x18')][_0xa94a('0x1c')]?_['map'](_0x4c8470[_0xa94a('0x18')][_0xa94a('0x1c')],function(_0x17bf09){return{'model':db[_0x17bf09[_0xa94a('0x1d')]],'as':_0x17bf09['as'],'attributes':_0x17bf09[_0xa94a('0x1a')],'include':_0x17bf09[_0xa94a('0x1c')]?_[_0xa94a('0x1e')](_0x17bf09[_0xa94a('0x1c')],function(_0x269db2){return{'model':db[_0x269db2[_0xa94a('0x1d')]],'as':_0x269db2['as'],'attributes':_0x269db2[_0xa94a('0x1a')],'include':_0x269db2[_0xa94a('0x1c')]?_[_0xa94a('0x1e')](_0x269db2[_0xa94a('0x1c')],function(_0x4a0f6c){return{'model':db[_0x4a0f6c[_0xa94a('0x1d')]],'as':_0x4a0f6c['as'],'attributes':_0x4a0f6c[_0xa94a('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4589f5){logger[_0xa94a('0x12')](_0xa94a('0x15'),_0x4c8470);logger[_0xa94a('0xc')](_0xa94a('0x15'),_0x4c8470,JSON[_0xa94a('0xe')](_0x4589f5));_0x34b883(_0x4589f5);})[_0xa94a('0x14')](function(_0x25aaeb){logger[_0xa94a('0xf')]('GetSalesforceAccount',_0x25aaeb['message'],_0x4c8470);_0xe653ab(_0x192ca3[_0xa94a('0xf')](0x1f4,_0x25aaeb[_0xa94a('0x11')]));});});};exports[_0xa94a('0x1f')]=function(_0x80028d){var _0x1003c6=this;return new Promise(function(_0x1114d7,_0x526d79){return db['SalesforceAccount'][_0xa94a('0x20')]({'raw':_0x80028d['options']?_0x80028d[_0xa94a('0x18')][_0xa94a('0x19')]===undefined?!![]:![]:!![],'where':_0x80028d[_0xa94a('0x18')]?_0x80028d[_0xa94a('0x18')]['where']||null:null,'attributes':_0x80028d[_0xa94a('0x18')]?_0x80028d[_0xa94a('0x18')][_0xa94a('0x1a')]||null:null,'include':_0x80028d[_0xa94a('0x18')]?_0x80028d[_0xa94a('0x18')][_0xa94a('0x1c')]?_[_0xa94a('0x1e')](_0x80028d['options'][_0xa94a('0x1c')],function(_0x14288a){return{'model':db[_0x14288a['model']],'as':_0x14288a['as'],'attributes':_0x14288a[_0xa94a('0x1a')],'include':_0x14288a['include']?_[_0xa94a('0x1e')](_0x14288a[_0xa94a('0x1c')],function(_0x5ba9a9){return{'model':db[_0x5ba9a9[_0xa94a('0x1d')]],'as':_0x5ba9a9['as'],'attributes':_0x5ba9a9[_0xa94a('0x1a')],'include':_0x5ba9a9[_0xa94a('0x1c')]?_[_0xa94a('0x1e')](_0x5ba9a9[_0xa94a('0x1c')],function(_0x548cc4){return{'model':db[_0x548cc4[_0xa94a('0x1d')]],'as':_0x548cc4['as'],'attributes':_0x548cc4[_0xa94a('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x10657e){logger[_0xa94a('0x12')](_0xa94a('0x1f'),_0x80028d);logger[_0xa94a('0xc')]('ShowSalesforceAccount',_0x80028d,JSON['stringify'](_0x10657e));_0x1114d7(_0x10657e);})[_0xa94a('0x14')](function(_0x28e15b){logger[_0xa94a('0xf')](_0xa94a('0x1f'),_0x28e15b['message'],_0x80028d);_0x526d79(_0x1003c6[_0xa94a('0xf')](0x1f4,_0x28e15b[_0xa94a('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 4ade30c..7071e1e 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x36e3de,_0x4d33ac){var _0x123c26=function(_0x12f24b){while(--_0x12f24b){_0x36e3de['push'](_0x36e3de['shift']());}};_0x123c26(++_0x4d33ac);}(_0x5f66,0x1a0));var _0x65f6=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5f66[_0x297fd3];return _0x2af381;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file +var _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x4f8ea7,_0x238bfc){var _0x137264=function(_0x41903f){while(--_0x41903f){_0x4f8ea7['push'](_0x4f8ea7['shift']());}};_0x137264(++_0x238bfc);}(_0xadb5,0xad));var _0x5adb=function(_0x18f7e1,_0xd3e7b){_0x18f7e1=_0x18f7e1-0x0;var _0x2c7c3d=_0xadb5[_0x18f7e1];return _0x2c7c3d;};'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 fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 1229fa5..bd00245 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 _0x80db=['sequelize','exports','STRING','ENUM','Case','Task','contact_lead','contact','lead','account_contact_lead','account','nothing'];(function(_0xf8799,_0x2b46e4){var _0x52c87c=function(_0x49a697){while(--_0x49a697){_0xf8799['push'](_0xf8799['shift']());}};_0x52c87c(++_0x2b46e4);}(_0x80db,0x174));var _0xb80d=function(_0x4c4d3b,_0x1a4351){_0x4c4d3b=_0x4c4d3b-0x0;var _0xce3799=_0x80db[_0x4c4d3b];return _0xce3799;};'use strict';var Sequelize=require(_0xb80d('0x0'));module[_0xb80d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb80d('0x2')]},'ticketType':{'type':Sequelize[_0xb80d('0x3')]('Task',_0xb80d('0x4')),'defaultValue':_0xb80d('0x5')},'moduleSearch':{'type':Sequelize[_0xb80d('0x3')](_0xb80d('0x6'),_0xb80d('0x7'),_0xb80d('0x8'),_0xb80d('0x9'),_0xb80d('0xa')),'defaultValue':_0xb80d('0x6')},'moduleCreate':{'type':Sequelize['ENUM'](_0xb80d('0xb'),_0xb80d('0x7'),_0xb80d('0x8'),_0xb80d('0xa')),'defaultValue':_0xb80d('0x8')},'leadId':{'type':Sequelize[_0xb80d('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0xb80d('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7bd5=['account_contact_lead','account','contact_lead','nothing','sequelize','STRING','ENUM','Task','lead'];(function(_0x230900,_0x70eb6e){var _0x59b13b=function(_0x23ebad){while(--_0x23ebad){_0x230900['push'](_0x230900['shift']());}};_0x59b13b(++_0x70eb6e);}(_0x7bd5,0x1e1));var _0x57bd=function(_0xdda9e2,_0xc4426b){_0xdda9e2=_0xdda9e2-0x0;var _0x51a688=_0x7bd5[_0xdda9e2];return _0x51a688;};'use strict';var Sequelize=require(_0x57bd('0x0'));module['exports']={'name':{'type':Sequelize[_0x57bd('0x1')]},'description':{'type':Sequelize[_0x57bd('0x1')]},'ticketType':{'type':Sequelize[_0x57bd('0x2')](_0x57bd('0x3'),'Case'),'defaultValue':_0x57bd('0x3')},'moduleSearch':{'type':Sequelize[_0x57bd('0x2')]('contact_lead','contact',_0x57bd('0x4'),_0x57bd('0x5'),_0x57bd('0x6')),'defaultValue':_0x57bd('0x7')},'moduleCreate':{'type':Sequelize[_0x57bd('0x2')](_0x57bd('0x8'),'contact',_0x57bd('0x4'),_0x57bd('0x6')),'defaultValue':_0x57bd('0x4')},'leadId':{'type':Sequelize[_0x57bd('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x57bd('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x57bd('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x57bd('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 166cb23..676ecf7 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 _0xb2e6=['update','then','destroy','error','name','send','index','SalesforceConfiguration','fieldName','type','key','map','keys','filters','model','attributes','intersection','fields','length','query','hasOwnProperty','sort','pick','filter','where','merge','options','includeAll','include','rows','show','params','find','catch','create','body','findOne','SalesforceField','order','getFields','nolimit','getSubjects','rawAttributes','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save'];(function(_0x4c5613,_0x2a18f2){var _0x2689da=function(_0x52a5b9){while(--_0x52a5b9){_0x4c5613['push'](_0x4c5613['shift']());}};_0x2689da(++_0x2a18f2);}(_0xb2e6,0x1c6));var _0x6b2e=function(_0x450e6d,_0x51123b){_0x450e6d=_0x450e6d-0x0;var _0x3c30bf=_0xb2e6[_0x450e6d];return _0x3c30bf;};'use strict';var emlformat=require(_0x6b2e('0x0'));var rimraf=require(_0x6b2e('0x1'));var zipdir=require(_0x6b2e('0x2'));var jsonpatch=require(_0x6b2e('0x3'));var rp=require('request-promise');var moment=require(_0x6b2e('0x4'));var BPromise=require(_0x6b2e('0x5'));var Mustache=require(_0x6b2e('0x6'));var util=require('util');var path=require(_0x6b2e('0x7'));var sox=require(_0x6b2e('0x8'));var csv=require(_0x6b2e('0x9'));var ejs=require(_0x6b2e('0xa'));var fs=require('fs');var fs_extra=require(_0x6b2e('0xb'));var _=require(_0x6b2e('0xc'));var squel=require(_0x6b2e('0xd'));var crypto=require('crypto');var jsforce=require(_0x6b2e('0xe'));var deskjs=require(_0x6b2e('0xf'));var toCsv=require(_0x6b2e('0x9'));var querystring=require(_0x6b2e('0x10'));var Papa=require(_0x6b2e('0x11'));var Redis=require(_0x6b2e('0x12'));var authService=require(_0x6b2e('0x13'));var qs=require(_0x6b2e('0x14'));var as=require(_0x6b2e('0x15'));var hardwareService=require(_0x6b2e('0x16'));var logger=require('../../config/logger')(_0x6b2e('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6b2e('0x18'));var db=require(_0x6b2e('0x19'))['db'];function respondWithStatusCode(_0x5e40d6,_0x7b3dc2){_0x7b3dc2=_0x7b3dc2||0xcc;return function(_0x2d36f0){if(_0x2d36f0){return _0x5e40d6[_0x6b2e('0x1a')](_0x7b3dc2);}return _0x5e40d6[_0x6b2e('0x1b')](_0x7b3dc2)[_0x6b2e('0x1c')]();};}function respondWithResult(_0x1f2ee0,_0x129796){_0x129796=_0x129796||0xc8;return function(_0xd2afd8){if(_0xd2afd8){return _0x1f2ee0[_0x6b2e('0x1b')](_0x129796)['json'](_0xd2afd8);}};}function respondWithFilteredResult(_0x1684b8,_0x427e20){return function(_0x591d4a){if(_0x591d4a){var _0x57df02=typeof _0x427e20[_0x6b2e('0x1d')]===_0x6b2e('0x1e')&&typeof _0x427e20[_0x6b2e('0x1f')]==='undefined';var _0x281196=_0x591d4a[_0x6b2e('0x20')];var _0x21fce0=_0x57df02?0x0:_0x427e20[_0x6b2e('0x1d')];var _0x1f8ecb=_0x57df02?_0x591d4a[_0x6b2e('0x20')]:_0x427e20['offset']+_0x427e20[_0x6b2e('0x1f')];var _0x9887ef;if(_0x1f8ecb>=_0x281196){_0x1f8ecb=_0x281196;_0x9887ef=0xc8;}else{_0x9887ef=0xce;}_0x1684b8[_0x6b2e('0x1b')](_0x9887ef);return _0x1684b8['set'](_0x6b2e('0x21'),_0x21fce0+'-'+_0x1f8ecb+'/'+_0x281196)[_0x6b2e('0x22')](_0x591d4a);}return null;};}function patchUpdates(_0x17e70b){return function(_0x5ebc88){try{jsonpatch[_0x6b2e('0x23')](_0x5ebc88,_0x17e70b,!![]);}catch(_0x51eee3){return BPromise[_0x6b2e('0x24')](_0x51eee3);}return _0x5ebc88[_0x6b2e('0x25')]();};}function saveUpdates(_0x222241,_0x3d0fb7){return function(_0x1ef40e){if(_0x1ef40e){return _0x1ef40e[_0x6b2e('0x26')](_0x222241)[_0x6b2e('0x27')](function(_0x48784a){return _0x48784a;});}return null;};}function removeEntity(_0x1c2715,_0x2fc125){return function(_0x4d46bb){if(_0x4d46bb){return _0x4d46bb[_0x6b2e('0x28')]()[_0x6b2e('0x27')](function(){_0x1c2715['status'](0xcc)[_0x6b2e('0x1c')]();});}};}function handleEntityNotFound(_0x51428f,_0x39bfe5){return function(_0x1c577c){if(!_0x1c577c){_0x51428f['sendStatus'](0x194);}return _0x1c577c;};}function handleError(_0x5a7f8f,_0x5e37b2){_0x5e37b2=_0x5e37b2||0x1f4;return function(_0x4bf2bb){logger[_0x6b2e('0x29')](_0x4bf2bb['stack']);if(_0x4bf2bb[_0x6b2e('0x2a')]){delete _0x4bf2bb[_0x6b2e('0x2a')];}_0x5a7f8f['status'](_0x5e37b2)[_0x6b2e('0x2b')](_0x4bf2bb);};}exports[_0x6b2e('0x2c')]=function(_0x1e7c5a,_0x454d79){var _0x2d05f7={},_0x488ad4={},_0xe5a5b={'count':0x0,'rows':[]};var _0x1e5a78=_['map'](db[_0x6b2e('0x2d')]['rawAttributes'],function(_0x5b1d27){return{'name':_0x5b1d27[_0x6b2e('0x2e')],'type':_0x5b1d27[_0x6b2e('0x2f')][_0x6b2e('0x30')]};});_0x488ad4['model']=_[_0x6b2e('0x31')](_0x1e5a78,_0x6b2e('0x2a'));_0x488ad4['query']=_[_0x6b2e('0x32')](_0x1e7c5a['query']);_0x488ad4[_0x6b2e('0x33')]=_['intersection'](_0x488ad4[_0x6b2e('0x34')],_0x488ad4['query']);_0x2d05f7[_0x6b2e('0x35')]=_[_0x6b2e('0x36')](_0x488ad4[_0x6b2e('0x34')],qs['fields'](_0x1e7c5a['query'][_0x6b2e('0x37')]));_0x2d05f7['attributes']=_0x2d05f7['attributes'][_0x6b2e('0x38')]?_0x2d05f7[_0x6b2e('0x35')]:_0x488ad4[_0x6b2e('0x34')];if(!_0x1e7c5a[_0x6b2e('0x39')][_0x6b2e('0x3a')]('nolimit')){_0x2d05f7[_0x6b2e('0x1f')]=qs[_0x6b2e('0x1f')](_0x1e7c5a[_0x6b2e('0x39')]['limit']);_0x2d05f7['offset']=qs[_0x6b2e('0x1d')](_0x1e7c5a[_0x6b2e('0x39')][_0x6b2e('0x1d')]);}_0x2d05f7['order']=qs[_0x6b2e('0x3b')](_0x1e7c5a[_0x6b2e('0x39')][_0x6b2e('0x3b')]);_0x2d05f7['where']=qs['filters'](_[_0x6b2e('0x3c')](_0x1e7c5a[_0x6b2e('0x39')],_0x488ad4[_0x6b2e('0x33')]),_0x1e5a78);if(_0x1e7c5a['query'][_0x6b2e('0x3d')]){_0x2d05f7[_0x6b2e('0x3e')]=_[_0x6b2e('0x3f')](_0x2d05f7[_0x6b2e('0x3e')],{'$or':_[_0x6b2e('0x31')](_0x1e5a78,function(_0x1b7062){if(_0x1b7062[_0x6b2e('0x2f')]!=='VIRTUAL'){var _0x1a68b7={};_0x1a68b7[_0x1b7062[_0x6b2e('0x2a')]]={'$like':'%'+_0x1e7c5a[_0x6b2e('0x39')][_0x6b2e('0x3d')]+'%'};return _0x1a68b7;}})});}_0x2d05f7=_['merge']({},_0x2d05f7,_0x1e7c5a[_0x6b2e('0x40')]);var _0x139be4={'where':_0x2d05f7[_0x6b2e('0x3e')]};return db[_0x6b2e('0x2d')][_0x6b2e('0x20')](_0x139be4)[_0x6b2e('0x27')](function(_0xb93adf){_0xe5a5b[_0x6b2e('0x20')]=_0xb93adf;if(_0x1e7c5a[_0x6b2e('0x39')][_0x6b2e('0x41')]){_0x2d05f7[_0x6b2e('0x42')]=[{'all':!![]}];}return db['SalesforceConfiguration']['findAll'](_0x2d05f7);})[_0x6b2e('0x27')](function(_0x3b8090){_0xe5a5b[_0x6b2e('0x43')]=_0x3b8090;return _0xe5a5b;})[_0x6b2e('0x27')](respondWithFilteredResult(_0x454d79,_0x2d05f7))['catch'](handleError(_0x454d79,null));};exports[_0x6b2e('0x44')]=function(_0x459c4a,_0xb6290d){var _0x535d4c={'raw':![],'where':{'id':_0x459c4a[_0x6b2e('0x45')]['id']}},_0x4b6d5d={};_0x4b6d5d['model']=_[_0x6b2e('0x32')](db[_0x6b2e('0x2d')]['rawAttributes']);_0x4b6d5d['query']=_['keys'](_0x459c4a['query']);_0x4b6d5d[_0x6b2e('0x33')]=_[_0x6b2e('0x36')](_0x4b6d5d[_0x6b2e('0x34')],_0x4b6d5d[_0x6b2e('0x39')]);_0x535d4c[_0x6b2e('0x35')]=_[_0x6b2e('0x36')](_0x4b6d5d[_0x6b2e('0x34')],qs['fields'](_0x459c4a[_0x6b2e('0x39')][_0x6b2e('0x37')]));_0x535d4c[_0x6b2e('0x35')]=_0x535d4c[_0x6b2e('0x35')]['length']?_0x535d4c['attributes']:_0x4b6d5d[_0x6b2e('0x34')];if(_0x459c4a[_0x6b2e('0x39')][_0x6b2e('0x41')]){_0x535d4c[_0x6b2e('0x42')]=[{'all':!![]}];}_0x535d4c=_[_0x6b2e('0x3f')]({},_0x535d4c,_0x459c4a[_0x6b2e('0x40')]);return db['SalesforceConfiguration'][_0x6b2e('0x46')](_0x535d4c)[_0x6b2e('0x27')](handleEntityNotFound(_0xb6290d,null))[_0x6b2e('0x27')](respondWithResult(_0xb6290d,null))[_0x6b2e('0x47')](handleError(_0xb6290d,null));};exports[_0x6b2e('0x48')]=function(_0x151102,_0x2d62b1){return db[_0x6b2e('0x2d')][_0x6b2e('0x48')](_0x151102['body'],{})[_0x6b2e('0x27')](respondWithResult(_0x2d62b1,0xc9))['catch'](handleError(_0x2d62b1,null));};exports[_0x6b2e('0x26')]=function(_0x3bf41b,_0x3b4f54){if(_0x3bf41b[_0x6b2e('0x49')]['id']){delete _0x3bf41b[_0x6b2e('0x49')]['id'];}return db['SalesforceConfiguration']['find']({'where':{'id':_0x3bf41b[_0x6b2e('0x45')]['id']}})['then'](handleEntityNotFound(_0x3b4f54,null))[_0x6b2e('0x27')](saveUpdates(_0x3bf41b[_0x6b2e('0x49')],null))[_0x6b2e('0x27')](respondWithResult(_0x3b4f54,null))[_0x6b2e('0x47')](handleError(_0x3b4f54,null));};exports[_0x6b2e('0x28')]=function(_0x4d33e2,_0x2fc921){return db[_0x6b2e('0x2d')][_0x6b2e('0x46')]({'where':{'id':_0x4d33e2[_0x6b2e('0x45')]['id']}})[_0x6b2e('0x27')](handleEntityNotFound(_0x2fc921,null))[_0x6b2e('0x27')](removeEntity(_0x2fc921,null))[_0x6b2e('0x47')](handleError(_0x2fc921,null));};exports['getFields']=function(_0x49751c,_0x21b541,_0x34bdef){var _0x1bed6a={};var _0x148988={};var _0x42a027;var _0x27f128;return db['SalesforceConfiguration'][_0x6b2e('0x4a')]({'where':{'id':_0x49751c[_0x6b2e('0x45')]['id']}})[_0x6b2e('0x27')](handleEntityNotFound(_0x21b541,null))[_0x6b2e('0x27')](function(_0x546a29){if(_0x546a29){_0x42a027=_0x546a29;_0x148988[_0x6b2e('0x34')]=_[_0x6b2e('0x32')](db[_0x6b2e('0x4b')]['rawAttributes']);_0x148988[_0x6b2e('0x39')]=_[_0x6b2e('0x32')](_0x49751c[_0x6b2e('0x39')]);_0x148988[_0x6b2e('0x33')]=_['intersection'](_0x148988['model'],_0x148988[_0x6b2e('0x39')]);_0x1bed6a[_0x6b2e('0x35')]=_[_0x6b2e('0x36')](_0x148988[_0x6b2e('0x34')],qs[_0x6b2e('0x37')](_0x49751c[_0x6b2e('0x39')]['fields']));_0x1bed6a[_0x6b2e('0x35')]=_0x1bed6a[_0x6b2e('0x35')][_0x6b2e('0x38')]?_0x1bed6a['attributes']:_0x148988['model'];_0x1bed6a[_0x6b2e('0x4c')]=qs[_0x6b2e('0x3b')](_0x49751c[_0x6b2e('0x39')][_0x6b2e('0x3b')]);_0x1bed6a[_0x6b2e('0x3e')]=qs['filters'](_['pick'](_0x49751c[_0x6b2e('0x39')],_0x148988[_0x6b2e('0x33')]));if(_0x49751c['query'][_0x6b2e('0x3d')]){_0x1bed6a[_0x6b2e('0x3e')]=_[_0x6b2e('0x3f')](_0x1bed6a[_0x6b2e('0x3e')],{'$or':_[_0x6b2e('0x31')](_0x1bed6a[_0x6b2e('0x35')],function(_0x5b718d){var _0x30dd84={};_0x30dd84[_0x5b718d]={'$like':'%'+_0x49751c[_0x6b2e('0x39')][_0x6b2e('0x3d')]+'%'};return _0x30dd84;})});}_0x1bed6a=_[_0x6b2e('0x3f')]({},_0x1bed6a,_0x49751c[_0x6b2e('0x40')]);return _0x42a027[_0x6b2e('0x4d')](_0x1bed6a);}})[_0x6b2e('0x27')](function(_0x4715aa){if(_0x4715aa){_0x27f128=_0x4715aa['length'];if(!_0x49751c[_0x6b2e('0x39')][_0x6b2e('0x3a')](_0x6b2e('0x4e'))){_0x1bed6a[_0x6b2e('0x1f')]=qs['limit'](_0x49751c[_0x6b2e('0x39')][_0x6b2e('0x1f')]);_0x1bed6a['offset']=qs['offset'](_0x49751c[_0x6b2e('0x39')][_0x6b2e('0x1d')]);}return _0x42a027[_0x6b2e('0x4d')](_0x1bed6a);}})[_0x6b2e('0x27')](function(_0x42ebdd){if(_0x42ebdd){return _0x42ebdd?{'count':_0x27f128,'rows':_0x42ebdd}:null;}})[_0x6b2e('0x27')](respondWithResult(_0x21b541,null))[_0x6b2e('0x47')](handleError(_0x21b541,null));};exports[_0x6b2e('0x4f')]=function(_0x1f1624,_0x8f9c06,_0x10e40b){var _0x47a7dc={};var _0x1da919={};var _0x554bbd;var _0x3fa57e;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x1f1624['params']['id']}})[_0x6b2e('0x27')](handleEntityNotFound(_0x8f9c06,null))['then'](function(_0x5dac0d){if(_0x5dac0d){_0x554bbd=_0x5dac0d;_0x1da919[_0x6b2e('0x34')]=_[_0x6b2e('0x32')](db[_0x6b2e('0x4b')][_0x6b2e('0x50')]);_0x1da919[_0x6b2e('0x39')]=_[_0x6b2e('0x32')](_0x1f1624['query']);_0x1da919[_0x6b2e('0x33')]=_[_0x6b2e('0x36')](_0x1da919[_0x6b2e('0x34')],_0x1da919[_0x6b2e('0x39')]);_0x47a7dc['attributes']=_[_0x6b2e('0x36')](_0x1da919[_0x6b2e('0x34')],qs[_0x6b2e('0x37')](_0x1f1624[_0x6b2e('0x39')][_0x6b2e('0x37')]));_0x47a7dc[_0x6b2e('0x35')]=_0x47a7dc['attributes'][_0x6b2e('0x38')]?_0x47a7dc[_0x6b2e('0x35')]:_0x1da919[_0x6b2e('0x34')];_0x47a7dc['order']=qs[_0x6b2e('0x3b')](_0x1f1624[_0x6b2e('0x39')][_0x6b2e('0x3b')]);_0x47a7dc[_0x6b2e('0x3e')]=qs[_0x6b2e('0x33')](_[_0x6b2e('0x3c')](_0x1f1624[_0x6b2e('0x39')],_0x1da919['filters']));if(_0x1f1624[_0x6b2e('0x39')][_0x6b2e('0x3d')]){_0x47a7dc['where']=_[_0x6b2e('0x3f')](_0x47a7dc[_0x6b2e('0x3e')],{'$or':_[_0x6b2e('0x31')](_0x47a7dc['attributes'],function(_0x5a865f){var _0x38a0b4={};_0x38a0b4[_0x5a865f]={'$like':'%'+_0x1f1624[_0x6b2e('0x39')][_0x6b2e('0x3d')]+'%'};return _0x38a0b4;})});}_0x47a7dc=_[_0x6b2e('0x3f')]({},_0x47a7dc,_0x1f1624[_0x6b2e('0x40')]);return _0x554bbd[_0x6b2e('0x4f')](_0x47a7dc);}})[_0x6b2e('0x27')](function(_0x10be2d){if(_0x10be2d){_0x3fa57e=_0x10be2d['length'];if(!_0x1f1624[_0x6b2e('0x39')]['hasOwnProperty']('nolimit')){_0x47a7dc[_0x6b2e('0x1f')]=qs[_0x6b2e('0x1f')](_0x1f1624[_0x6b2e('0x39')][_0x6b2e('0x1f')]);_0x47a7dc['offset']=qs['offset'](_0x1f1624[_0x6b2e('0x39')][_0x6b2e('0x1d')]);}return _0x554bbd['getSubjects'](_0x47a7dc);}})[_0x6b2e('0x27')](function(_0x430449){if(_0x430449){return _0x430449?{'count':_0x3fa57e,'rows':_0x430449}:null;}})[_0x6b2e('0x27')](respondWithResult(_0x8f9c06,null))['catch'](handleError(_0x8f9c06,null));};exports[_0x6b2e('0x51')]=function(_0x2aa65e,_0xff7024,_0x35747e){var _0x45101f={};var _0x2b611e={};var _0x571a2b;var _0x511f17;return db[_0x6b2e('0x2d')]['findOne']({'where':{'id':_0x2aa65e[_0x6b2e('0x45')]['id']}})[_0x6b2e('0x27')](handleEntityNotFound(_0xff7024,null))[_0x6b2e('0x27')](function(_0x4c329f){if(_0x4c329f){_0x571a2b=_0x4c329f;_0x2b611e[_0x6b2e('0x34')]=_[_0x6b2e('0x32')](db['SalesforceField']['rawAttributes']);_0x2b611e[_0x6b2e('0x39')]=_[_0x6b2e('0x32')](_0x2aa65e[_0x6b2e('0x39')]);_0x2b611e[_0x6b2e('0x33')]=_['intersection'](_0x2b611e[_0x6b2e('0x34')],_0x2b611e['query']);_0x45101f[_0x6b2e('0x35')]=_[_0x6b2e('0x36')](_0x2b611e[_0x6b2e('0x34')],qs[_0x6b2e('0x37')](_0x2aa65e['query'][_0x6b2e('0x37')]));_0x45101f[_0x6b2e('0x35')]=_0x45101f['attributes']['length']?_0x45101f[_0x6b2e('0x35')]:_0x2b611e[_0x6b2e('0x34')];_0x45101f['order']=qs[_0x6b2e('0x3b')](_0x2aa65e[_0x6b2e('0x39')][_0x6b2e('0x3b')]);_0x45101f[_0x6b2e('0x3e')]=qs[_0x6b2e('0x33')](_[_0x6b2e('0x3c')](_0x2aa65e[_0x6b2e('0x39')],_0x2b611e[_0x6b2e('0x33')]));if(_0x2aa65e['query'][_0x6b2e('0x3d')]){_0x45101f[_0x6b2e('0x3e')]=_[_0x6b2e('0x3f')](_0x45101f[_0x6b2e('0x3e')],{'$or':_[_0x6b2e('0x31')](_0x45101f[_0x6b2e('0x35')],function(_0x25c340){var _0x5dfcd9={};_0x5dfcd9[_0x25c340]={'$like':'%'+_0x2aa65e['query'][_0x6b2e('0x3d')]+'%'};return _0x5dfcd9;})});}_0x45101f=_[_0x6b2e('0x3f')]({},_0x45101f,_0x2aa65e[_0x6b2e('0x40')]);return _0x571a2b[_0x6b2e('0x51')](_0x45101f);}})[_0x6b2e('0x27')](function(_0x4ade0e){if(_0x4ade0e){_0x511f17=_0x4ade0e[_0x6b2e('0x38')];if(!_0x2aa65e[_0x6b2e('0x39')][_0x6b2e('0x3a')]('nolimit')){_0x45101f['limit']=qs[_0x6b2e('0x1f')](_0x2aa65e[_0x6b2e('0x39')][_0x6b2e('0x1f')]);_0x45101f[_0x6b2e('0x1d')]=qs[_0x6b2e('0x1d')](_0x2aa65e[_0x6b2e('0x39')][_0x6b2e('0x1d')]);}return _0x571a2b[_0x6b2e('0x51')](_0x45101f);}})[_0x6b2e('0x27')](function(_0x3bbc9e){if(_0x3bbc9e){return _0x3bbc9e?{'count':_0x511f17,'rows':_0x3bbc9e}:null;}})[_0x6b2e('0x27')](respondWithResult(_0xff7024,null))[_0x6b2e('0x47')](handleError(_0xff7024,null));}; \ No newline at end of file +var _0xbccb=['catch','keys','rawAttributes','includeAll','find','create','body','params','findOne','filter','getFields','SalesforceField','getSubjects','map','getDescriptions','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','SalesforceConfiguration','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','options','findAll','rows'];(function(_0x5a112b,_0xf4c5cb){var _0xa9d1e1=function(_0x2bdd3){while(--_0x2bdd3){_0x5a112b['push'](_0x5a112b['shift']());}};_0xa9d1e1(++_0xf4c5cb);}(_0xbccb,0x157));var _0xbbcc=function(_0x126fb9,_0x122c59){_0x126fb9=_0x126fb9-0x0;var _0xc8a3b1=_0xbccb[_0x126fb9];return _0xc8a3b1;};'use strict';var emlformat=require(_0xbbcc('0x0'));var rimraf=require(_0xbbcc('0x1'));var zipdir=require(_0xbbcc('0x2'));var jsonpatch=require(_0xbbcc('0x3'));var rp=require('request-promise');var moment=require(_0xbbcc('0x4'));var BPromise=require(_0xbbcc('0x5'));var Mustache=require(_0xbbcc('0x6'));var util=require(_0xbbcc('0x7'));var path=require(_0xbbcc('0x8'));var sox=require(_0xbbcc('0x9'));var csv=require(_0xbbcc('0xa'));var ejs=require(_0xbbcc('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbbcc('0xc'));var squel=require(_0xbbcc('0xd'));var crypto=require(_0xbbcc('0xe'));var jsforce=require(_0xbbcc('0xf'));var deskjs=require(_0xbbcc('0x10'));var toCsv=require(_0xbbcc('0xa'));var querystring=require(_0xbbcc('0x11'));var Papa=require(_0xbbcc('0x12'));var Redis=require(_0xbbcc('0x13'));var authService=require(_0xbbcc('0x14'));var qs=require(_0xbbcc('0x15'));var as=require(_0xbbcc('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbbcc('0x17'))(_0xbbcc('0x18'));var utils=require(_0xbbcc('0x19'));var config=require(_0xbbcc('0x1a'));var licenseUtil=require(_0xbbcc('0x1b'));var db=require(_0xbbcc('0x1c'))['db'];function respondWithStatusCode(_0x1558f3,_0x39de34){_0x39de34=_0x39de34||0xcc;return function(_0xcc65b9){if(_0xcc65b9){return _0x1558f3[_0xbbcc('0x1d')](_0x39de34);}return _0x1558f3[_0xbbcc('0x1e')](_0x39de34)['end']();};}function respondWithResult(_0x1166ba,_0x240ee7){_0x240ee7=_0x240ee7||0xc8;return function(_0x1d1b2f){if(_0x1d1b2f){return _0x1166ba[_0xbbcc('0x1e')](_0x240ee7)['json'](_0x1d1b2f);}};}function respondWithFilteredResult(_0x44761e,_0x5acb78){return function(_0x26dccc){if(_0x26dccc){var _0x45226a=typeof _0x5acb78['offset']===_0xbbcc('0x1f')&&typeof _0x5acb78['limit']==='undefined';var _0x5e5573=_0x26dccc[_0xbbcc('0x20')];var _0x1456ac=_0x45226a?0x0:_0x5acb78[_0xbbcc('0x21')];var _0x2e8f29=_0x45226a?_0x26dccc[_0xbbcc('0x20')]:_0x5acb78[_0xbbcc('0x21')]+_0x5acb78['limit'];var _0x56a5c8;if(_0x2e8f29>=_0x5e5573){_0x2e8f29=_0x5e5573;_0x56a5c8=0xc8;}else{_0x56a5c8=0xce;}_0x44761e['status'](_0x56a5c8);return _0x44761e['set'](_0xbbcc('0x22'),_0x1456ac+'-'+_0x2e8f29+'/'+_0x5e5573)[_0xbbcc('0x23')](_0x26dccc);}return null;};}function patchUpdates(_0x439fb5){return function(_0x478f9c){try{jsonpatch['apply'](_0x478f9c,_0x439fb5,!![]);}catch(_0x3a2a8d){return BPromise[_0xbbcc('0x24')](_0x3a2a8d);}return _0x478f9c[_0xbbcc('0x25')]();};}function saveUpdates(_0x5a2aaf,_0x534985){return function(_0x89004c){if(_0x89004c){return _0x89004c[_0xbbcc('0x26')](_0x5a2aaf)[_0xbbcc('0x27')](function(_0x3af889){return _0x3af889;});}return null;};}function removeEntity(_0x489299,_0x1d6342){return function(_0x1d5d0e){if(_0x1d5d0e){return _0x1d5d0e[_0xbbcc('0x28')]()['then'](function(){_0x489299[_0xbbcc('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5107c3,_0x4f5dd1){return function(_0x3213af){if(!_0x3213af){_0x5107c3[_0xbbcc('0x1d')](0x194);}return _0x3213af;};}function handleError(_0x4c2f77,_0x2e4ea1){_0x2e4ea1=_0x2e4ea1||0x1f4;return function(_0x49b7ed){logger[_0xbbcc('0x29')](_0x49b7ed[_0xbbcc('0x2a')]);if(_0x49b7ed[_0xbbcc('0x2b')]){delete _0x49b7ed['name'];}_0x4c2f77['status'](_0x2e4ea1)[_0xbbcc('0x2c')](_0x49b7ed);};}exports['index']=function(_0x9e8a83,_0x5a8d4c){var _0x45e50e={},_0x5203c5={},_0x392deb={'count':0x0,'rows':[]};var _0x43e2ff=_['map'](db[_0xbbcc('0x2d')]['rawAttributes'],function(_0x38be0a){return{'name':_0x38be0a[_0xbbcc('0x2e')],'type':_0x38be0a[_0xbbcc('0x2f')]['key']};});_0x5203c5[_0xbbcc('0x30')]=_['map'](_0x43e2ff,_0xbbcc('0x2b'));_0x5203c5[_0xbbcc('0x31')]=_['keys'](_0x9e8a83[_0xbbcc('0x31')]);_0x5203c5[_0xbbcc('0x32')]=_[_0xbbcc('0x33')](_0x5203c5['model'],_0x5203c5[_0xbbcc('0x31')]);_0x45e50e[_0xbbcc('0x34')]=_[_0xbbcc('0x33')](_0x5203c5[_0xbbcc('0x30')],qs[_0xbbcc('0x35')](_0x9e8a83[_0xbbcc('0x31')][_0xbbcc('0x35')]));_0x45e50e[_0xbbcc('0x34')]=_0x45e50e[_0xbbcc('0x34')][_0xbbcc('0x36')]?_0x45e50e[_0xbbcc('0x34')]:_0x5203c5[_0xbbcc('0x30')];if(!_0x9e8a83[_0xbbcc('0x31')][_0xbbcc('0x37')](_0xbbcc('0x38'))){_0x45e50e[_0xbbcc('0x39')]=qs['limit'](_0x9e8a83[_0xbbcc('0x31')][_0xbbcc('0x39')]);_0x45e50e[_0xbbcc('0x21')]=qs['offset'](_0x9e8a83[_0xbbcc('0x31')][_0xbbcc('0x21')]);}_0x45e50e[_0xbbcc('0x3a')]=qs[_0xbbcc('0x3b')](_0x9e8a83[_0xbbcc('0x31')][_0xbbcc('0x3b')]);_0x45e50e[_0xbbcc('0x3c')]=qs[_0xbbcc('0x32')](_[_0xbbcc('0x3d')](_0x9e8a83[_0xbbcc('0x31')],_0x5203c5[_0xbbcc('0x32')]),_0x43e2ff);if(_0x9e8a83['query']['filter']){_0x45e50e[_0xbbcc('0x3c')]=_[_0xbbcc('0x3e')](_0x45e50e[_0xbbcc('0x3c')],{'$or':_['map'](_0x43e2ff,function(_0x453324){if(_0x453324['type']!==_0xbbcc('0x3f')){var _0x2af399={};_0x2af399[_0x453324[_0xbbcc('0x2b')]]={'$like':'%'+_0x9e8a83['query']['filter']+'%'};return _0x2af399;}})});}_0x45e50e=_[_0xbbcc('0x3e')]({},_0x45e50e,_0x9e8a83[_0xbbcc('0x40')]);var _0x44b6ac={'where':_0x45e50e[_0xbbcc('0x3c')]};return db['SalesforceConfiguration'][_0xbbcc('0x20')](_0x44b6ac)[_0xbbcc('0x27')](function(_0xfd51f0){_0x392deb[_0xbbcc('0x20')]=_0xfd51f0;if(_0x9e8a83[_0xbbcc('0x31')]['includeAll']){_0x45e50e['include']=[{'all':!![]}];}return db['SalesforceConfiguration'][_0xbbcc('0x41')](_0x45e50e);})[_0xbbcc('0x27')](function(_0xa51757){_0x392deb[_0xbbcc('0x42')]=_0xa51757;return _0x392deb;})['then'](respondWithFilteredResult(_0x5a8d4c,_0x45e50e))[_0xbbcc('0x43')](handleError(_0x5a8d4c,null));};exports['show']=function(_0x7424c8,_0x2dc8f1){var _0x21e16c={'raw':![],'where':{'id':_0x7424c8['params']['id']}},_0xed0ad4={};_0xed0ad4[_0xbbcc('0x30')]=_[_0xbbcc('0x44')](db[_0xbbcc('0x2d')][_0xbbcc('0x45')]);_0xed0ad4[_0xbbcc('0x31')]=_[_0xbbcc('0x44')](_0x7424c8[_0xbbcc('0x31')]);_0xed0ad4[_0xbbcc('0x32')]=_['intersection'](_0xed0ad4[_0xbbcc('0x30')],_0xed0ad4[_0xbbcc('0x31')]);_0x21e16c[_0xbbcc('0x34')]=_[_0xbbcc('0x33')](_0xed0ad4['model'],qs[_0xbbcc('0x35')](_0x7424c8[_0xbbcc('0x31')]['fields']));_0x21e16c[_0xbbcc('0x34')]=_0x21e16c[_0xbbcc('0x34')][_0xbbcc('0x36')]?_0x21e16c['attributes']:_0xed0ad4[_0xbbcc('0x30')];if(_0x7424c8['query'][_0xbbcc('0x46')]){_0x21e16c['include']=[{'all':!![]}];}_0x21e16c=_[_0xbbcc('0x3e')]({},_0x21e16c,_0x7424c8[_0xbbcc('0x40')]);return db['SalesforceConfiguration'][_0xbbcc('0x47')](_0x21e16c)['then'](handleEntityNotFound(_0x2dc8f1,null))[_0xbbcc('0x27')](respondWithResult(_0x2dc8f1,null))[_0xbbcc('0x43')](handleError(_0x2dc8f1,null));};exports[_0xbbcc('0x48')]=function(_0x3b832b,_0x27ef0b){return db['SalesforceConfiguration'][_0xbbcc('0x48')](_0x3b832b['body'],{})['then'](respondWithResult(_0x27ef0b,0xc9))['catch'](handleError(_0x27ef0b,null));};exports['update']=function(_0x287cef,_0x4dc2de){if(_0x287cef['body']['id']){delete _0x287cef[_0xbbcc('0x49')]['id'];}return db[_0xbbcc('0x2d')][_0xbbcc('0x47')]({'where':{'id':_0x287cef[_0xbbcc('0x4a')]['id']}})[_0xbbcc('0x27')](handleEntityNotFound(_0x4dc2de,null))[_0xbbcc('0x27')](saveUpdates(_0x287cef[_0xbbcc('0x49')],null))['then'](respondWithResult(_0x4dc2de,null))['catch'](handleError(_0x4dc2de,null));};exports['destroy']=function(_0x5b1be1,_0x2c5d34){return db[_0xbbcc('0x2d')][_0xbbcc('0x47')]({'where':{'id':_0x5b1be1['params']['id']}})[_0xbbcc('0x27')](handleEntityNotFound(_0x2c5d34,null))[_0xbbcc('0x27')](removeEntity(_0x2c5d34,null))[_0xbbcc('0x43')](handleError(_0x2c5d34,null));};exports['getFields']=function(_0x498bf3,_0x4ed035,_0x534c41){var _0x49f623={};var _0x299307={};var _0x212a0c;var _0x47b412;return db[_0xbbcc('0x2d')][_0xbbcc('0x4b')]({'where':{'id':_0x498bf3[_0xbbcc('0x4a')]['id']}})[_0xbbcc('0x27')](handleEntityNotFound(_0x4ed035,null))['then'](function(_0x264435){if(_0x264435){_0x212a0c=_0x264435;_0x299307[_0xbbcc('0x30')]=_[_0xbbcc('0x44')](db['SalesforceField']['rawAttributes']);_0x299307[_0xbbcc('0x31')]=_[_0xbbcc('0x44')](_0x498bf3['query']);_0x299307['filters']=_[_0xbbcc('0x33')](_0x299307[_0xbbcc('0x30')],_0x299307[_0xbbcc('0x31')]);_0x49f623[_0xbbcc('0x34')]=_['intersection'](_0x299307[_0xbbcc('0x30')],qs['fields'](_0x498bf3['query'][_0xbbcc('0x35')]));_0x49f623['attributes']=_0x49f623[_0xbbcc('0x34')][_0xbbcc('0x36')]?_0x49f623[_0xbbcc('0x34')]:_0x299307[_0xbbcc('0x30')];_0x49f623['order']=qs[_0xbbcc('0x3b')](_0x498bf3['query'][_0xbbcc('0x3b')]);_0x49f623[_0xbbcc('0x3c')]=qs['filters'](_[_0xbbcc('0x3d')](_0x498bf3[_0xbbcc('0x31')],_0x299307[_0xbbcc('0x32')]));if(_0x498bf3['query'][_0xbbcc('0x4c')]){_0x49f623[_0xbbcc('0x3c')]=_[_0xbbcc('0x3e')](_0x49f623['where'],{'$or':_['map'](_0x49f623[_0xbbcc('0x34')],function(_0x5962c5){var _0x183918={};_0x183918[_0x5962c5]={'$like':'%'+_0x498bf3[_0xbbcc('0x31')][_0xbbcc('0x4c')]+'%'};return _0x183918;})});}_0x49f623=_['merge']({},_0x49f623,_0x498bf3[_0xbbcc('0x40')]);return _0x212a0c['getFields'](_0x49f623);}})[_0xbbcc('0x27')](function(_0x1ab37e){if(_0x1ab37e){_0x47b412=_0x1ab37e[_0xbbcc('0x36')];if(!_0x498bf3[_0xbbcc('0x31')][_0xbbcc('0x37')]('nolimit')){_0x49f623[_0xbbcc('0x39')]=qs['limit'](_0x498bf3[_0xbbcc('0x31')][_0xbbcc('0x39')]);_0x49f623[_0xbbcc('0x21')]=qs[_0xbbcc('0x21')](_0x498bf3[_0xbbcc('0x31')][_0xbbcc('0x21')]);}return _0x212a0c[_0xbbcc('0x4d')](_0x49f623);}})[_0xbbcc('0x27')](function(_0x2a7820){if(_0x2a7820){return _0x2a7820?{'count':_0x47b412,'rows':_0x2a7820}:null;}})[_0xbbcc('0x27')](respondWithResult(_0x4ed035,null))[_0xbbcc('0x43')](handleError(_0x4ed035,null));};exports['getSubjects']=function(_0x5c97ee,_0x274188,_0x1a9813){var _0x6c5f8e={};var _0xdfaff1={};var _0x1a95ff;var _0x19d7cc;return db[_0xbbcc('0x2d')][_0xbbcc('0x4b')]({'where':{'id':_0x5c97ee['params']['id']}})[_0xbbcc('0x27')](handleEntityNotFound(_0x274188,null))[_0xbbcc('0x27')](function(_0x4c3146){if(_0x4c3146){_0x1a95ff=_0x4c3146;_0xdfaff1['model']=_[_0xbbcc('0x44')](db[_0xbbcc('0x4e')][_0xbbcc('0x45')]);_0xdfaff1['query']=_[_0xbbcc('0x44')](_0x5c97ee['query']);_0xdfaff1['filters']=_[_0xbbcc('0x33')](_0xdfaff1[_0xbbcc('0x30')],_0xdfaff1[_0xbbcc('0x31')]);_0x6c5f8e[_0xbbcc('0x34')]=_['intersection'](_0xdfaff1[_0xbbcc('0x30')],qs[_0xbbcc('0x35')](_0x5c97ee['query'][_0xbbcc('0x35')]));_0x6c5f8e[_0xbbcc('0x34')]=_0x6c5f8e[_0xbbcc('0x34')][_0xbbcc('0x36')]?_0x6c5f8e[_0xbbcc('0x34')]:_0xdfaff1[_0xbbcc('0x30')];_0x6c5f8e[_0xbbcc('0x3a')]=qs[_0xbbcc('0x3b')](_0x5c97ee[_0xbbcc('0x31')][_0xbbcc('0x3b')]);_0x6c5f8e[_0xbbcc('0x3c')]=qs[_0xbbcc('0x32')](_['pick'](_0x5c97ee[_0xbbcc('0x31')],_0xdfaff1['filters']));if(_0x5c97ee[_0xbbcc('0x31')][_0xbbcc('0x4c')]){_0x6c5f8e['where']=_[_0xbbcc('0x3e')](_0x6c5f8e[_0xbbcc('0x3c')],{'$or':_['map'](_0x6c5f8e['attributes'],function(_0x1958c0){var _0x37b67e={};_0x37b67e[_0x1958c0]={'$like':'%'+_0x5c97ee[_0xbbcc('0x31')][_0xbbcc('0x4c')]+'%'};return _0x37b67e;})});}_0x6c5f8e=_['merge']({},_0x6c5f8e,_0x5c97ee[_0xbbcc('0x40')]);return _0x1a95ff[_0xbbcc('0x4f')](_0x6c5f8e);}})['then'](function(_0x2174c1){if(_0x2174c1){_0x19d7cc=_0x2174c1[_0xbbcc('0x36')];if(!_0x5c97ee[_0xbbcc('0x31')]['hasOwnProperty']('nolimit')){_0x6c5f8e[_0xbbcc('0x39')]=qs['limit'](_0x5c97ee[_0xbbcc('0x31')][_0xbbcc('0x39')]);_0x6c5f8e['offset']=qs[_0xbbcc('0x21')](_0x5c97ee[_0xbbcc('0x31')]['offset']);}return _0x1a95ff['getSubjects'](_0x6c5f8e);}})['then'](function(_0x6cb6ae){if(_0x6cb6ae){return _0x6cb6ae?{'count':_0x19d7cc,'rows':_0x6cb6ae}:null;}})[_0xbbcc('0x27')](respondWithResult(_0x274188,null))[_0xbbcc('0x43')](handleError(_0x274188,null));};exports['getDescriptions']=function(_0x14c8fb,_0x4f4686,_0x5107b2){var _0x18df7b={};var _0x3ecedd={};var _0x92fbb1;var _0x37f351;return db[_0xbbcc('0x2d')]['findOne']({'where':{'id':_0x14c8fb[_0xbbcc('0x4a')]['id']}})[_0xbbcc('0x27')](handleEntityNotFound(_0x4f4686,null))[_0xbbcc('0x27')](function(_0xf0e70a){if(_0xf0e70a){_0x92fbb1=_0xf0e70a;_0x3ecedd[_0xbbcc('0x30')]=_['keys'](db['SalesforceField'][_0xbbcc('0x45')]);_0x3ecedd['query']=_[_0xbbcc('0x44')](_0x14c8fb[_0xbbcc('0x31')]);_0x3ecedd[_0xbbcc('0x32')]=_[_0xbbcc('0x33')](_0x3ecedd[_0xbbcc('0x30')],_0x3ecedd[_0xbbcc('0x31')]);_0x18df7b[_0xbbcc('0x34')]=_[_0xbbcc('0x33')](_0x3ecedd[_0xbbcc('0x30')],qs['fields'](_0x14c8fb['query'][_0xbbcc('0x35')]));_0x18df7b[_0xbbcc('0x34')]=_0x18df7b[_0xbbcc('0x34')][_0xbbcc('0x36')]?_0x18df7b['attributes']:_0x3ecedd[_0xbbcc('0x30')];_0x18df7b[_0xbbcc('0x3a')]=qs[_0xbbcc('0x3b')](_0x14c8fb[_0xbbcc('0x31')][_0xbbcc('0x3b')]);_0x18df7b[_0xbbcc('0x3c')]=qs[_0xbbcc('0x32')](_[_0xbbcc('0x3d')](_0x14c8fb[_0xbbcc('0x31')],_0x3ecedd[_0xbbcc('0x32')]));if(_0x14c8fb[_0xbbcc('0x31')][_0xbbcc('0x4c')]){_0x18df7b[_0xbbcc('0x3c')]=_[_0xbbcc('0x3e')](_0x18df7b['where'],{'$or':_[_0xbbcc('0x50')](_0x18df7b[_0xbbcc('0x34')],function(_0x4c8193){var _0x2c8d28={};_0x2c8d28[_0x4c8193]={'$like':'%'+_0x14c8fb[_0xbbcc('0x31')][_0xbbcc('0x4c')]+'%'};return _0x2c8d28;})});}_0x18df7b=_['merge']({},_0x18df7b,_0x14c8fb[_0xbbcc('0x40')]);return _0x92fbb1['getDescriptions'](_0x18df7b);}})[_0xbbcc('0x27')](function(_0x462e5c){if(_0x462e5c){_0x37f351=_0x462e5c[_0xbbcc('0x36')];if(!_0x14c8fb['query']['hasOwnProperty'](_0xbbcc('0x38'))){_0x18df7b['limit']=qs[_0xbbcc('0x39')](_0x14c8fb[_0xbbcc('0x31')]['limit']);_0x18df7b[_0xbbcc('0x21')]=qs['offset'](_0x14c8fb[_0xbbcc('0x31')]['offset']);}return _0x92fbb1[_0xbbcc('0x51')](_0x18df7b);}})[_0xbbcc('0x27')](function(_0xf36739){if(_0xf36739){return _0xf36739?{'count':_0x37f351,'rows':_0xf36739}:null;}})[_0xbbcc('0x27')](respondWithResult(_0x4f4686,null))[_0xbbcc('0x43')](handleError(_0x4f4686,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index cae59a4..a4d6b12 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 _0x4e7e=['moment','path','rimraf','exports','define','lodash','util','../../config/logger','api'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x4e7e,0x1a3));var _0xe4e7=function(_0x5a1fe7,_0x31d39e){_0x5a1fe7=_0x5a1fe7-0x0;var _0x47931e=_0x4e7e[_0x5a1fe7];return _0x47931e;};'use strict';var _=require(_0xe4e7('0x0'));var util=require(_0xe4e7('0x1'));var logger=require(_0xe4e7('0x2'))(_0xe4e7('0x3'));var moment=require(_0xe4e7('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe4e7('0x5'));var rimraf=require(_0xe4e7('0x6'));var config=require('../../config/environment');var attributes=require('./intSalesforceConfiguration.attributes');module[_0xe4e7('0x7')]=function(_0x148044,_0x508fcc){return _0x148044[_0xe4e7('0x8')]('SalesforceConfiguration',attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe7ba=['define','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intSalesforceConfiguration.attributes','exports'];(function(_0xced5d5,_0xf63f4c){var _0x8ab032=function(_0x3402cd){while(--_0x3402cd){_0xced5d5['push'](_0xced5d5['shift']());}};_0x8ab032(++_0xf63f4c);}(_0xe7ba,0x7a));var _0xae7b=function(_0x4d479c,_0x374518){_0x4d479c=_0x4d479c-0x0;var _0x322f7f=_0xe7ba[_0x4d479c];return _0x322f7f;};'use strict';var _=require(_0xae7b('0x0'));var util=require(_0xae7b('0x1'));var logger=require(_0xae7b('0x2'))(_0xae7b('0x3'));var moment=require(_0xae7b('0x4'));var BPromise=require(_0xae7b('0x5'));var rp=require(_0xae7b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xae7b('0x7'));var attributes=require(_0xae7b('0x8'));module[_0xae7b('0x9')]=function(_0x29b8d3,_0x1e3bad){return _0x29b8d3[_0xae7b('0xa')]('SalesforceConfiguration',attributes,{'tableName':_0xae7b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 95c79a4..907ea61 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 _0x72f4=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x494195,_0x511d20){var _0x271ece=function(_0x1a568d){while(--_0x1a568d){_0x494195['push'](_0x494195['shift']());}};_0x271ece(++_0x511d20);}(_0x72f4,0xec));var _0x472f=function(_0x765f5e,_0x1069a9){_0x765f5e=_0x765f5e-0x0;var _0x3aac76=_0x72f4[_0x765f5e];return _0x3aac76;};'use strict';var _=require(_0x472f('0x0'));var util=require(_0x472f('0x1'));var moment=require(_0x472f('0x2'));var BPromise=require(_0x472f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x472f('0x4'));var db=require(_0x472f('0x5'))['db'];var utils=require(_0x472f('0x6'));var logger=require(_0x472f('0x7'))('rpc');var config=require(_0x472f('0x8'));var jayson=require(_0x472f('0x9'));var client=jayson[_0x472f('0xa')][_0x472f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x43f41b,_0x1ccd27,_0x4252a3){return new BPromise(function(_0x1fe15a,_0xd889d8){return client[_0x472f('0xc')](_0x43f41b,_0x4252a3)[_0x472f('0xd')](function(_0x237d01){logger['info'](_0x472f('0xe'),_0x1ccd27,_0x472f('0xf'));logger[_0x472f('0x10')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x1ccd27,_0x472f('0xf'),JSON['stringify'](_0x237d01));if(_0x237d01[_0x472f('0x11')]){if(_0x237d01['error'][_0x472f('0x12')]===0x1f4){logger[_0x472f('0x11')](_0x472f('0xe'),_0x1ccd27,_0x237d01[_0x472f('0x11')][_0x472f('0x13')]);return _0xd889d8(_0x237d01[_0x472f('0x11')][_0x472f('0x13')]);}logger[_0x472f('0x11')](_0x472f('0xe'),_0x1ccd27,_0x237d01[_0x472f('0x11')][_0x472f('0x13')]);return _0x1fe15a(_0x237d01[_0x472f('0x11')][_0x472f('0x13')]);}else{logger[_0x472f('0x14')](_0x472f('0xe'),_0x1ccd27,_0x472f('0xf'));_0x1fe15a(_0x237d01[_0x472f('0x15')][_0x472f('0x13')]);}})['catch'](function(_0x385304){logger[_0x472f('0x11')](_0x472f('0xe'),_0x1ccd27,_0x385304);_0xd889d8(_0x385304);});});} \ No newline at end of file +var _0x015d=['request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x1fd70f,_0x457341){var _0x55d7da=function(_0x56baec){while(--_0x56baec){_0x1fd70f['push'](_0x1fd70f['shift']());}};_0x55d7da(++_0x457341);}(_0x015d,0xfe));var _0xd015=function(_0x209ec9,_0x30378c){_0x209ec9=_0x209ec9-0x0;var _0x129b1b=_0x015d[_0x209ec9];return _0x129b1b;};'use strict';var _=require(_0xd015('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd015('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd015('0x2'));var db=require(_0xd015('0x3'))['db'];var utils=require(_0xd015('0x4'));var logger=require(_0xd015('0x5'))('rpc');var config=require(_0xd015('0x6'));var jayson=require(_0xd015('0x7'));var client=jayson[_0xd015('0x8')][_0xd015('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x504a6a,_0x23717d,_0x249a66){return new BPromise(function(_0x46e06e,_0x153373){return client[_0xd015('0xa')](_0x504a6a,_0x249a66)[_0xd015('0xb')](function(_0x38cdf6){logger[_0xd015('0xc')](_0xd015('0xd'),_0x23717d,_0xd015('0xe'));logger[_0xd015('0xf')](_0xd015('0x10'),_0x23717d,_0xd015('0xe'),JSON['stringify'](_0x38cdf6));if(_0x38cdf6['error']){if(_0x38cdf6[_0xd015('0x11')][_0xd015('0x12')]===0x1f4){logger[_0xd015('0x11')](_0xd015('0xd'),_0x23717d,_0x38cdf6[_0xd015('0x11')][_0xd015('0x13')]);return _0x153373(_0x38cdf6[_0xd015('0x11')]['message']);}logger[_0xd015('0x11')](_0xd015('0xd'),_0x23717d,_0x38cdf6['error'][_0xd015('0x13')]);return _0x46e06e(_0x38cdf6[_0xd015('0x11')][_0xd015('0x13')]);}else{logger[_0xd015('0xc')](_0xd015('0xd'),_0x23717d,'request\x20sent');_0x46e06e(_0x38cdf6[_0xd015('0x14')]['message']);}})[_0xd015('0x15')](function(_0x3df847){logger[_0xd015('0x11')](_0xd015('0xd'),_0x23717d,_0x3df847);_0x153373(_0x3df847);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index d9ed58e..281e3e5 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 _0xae84=['../../config/environment','./intSalesforceField.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xae84,0x91));var _0x4ae8=function(_0x571a6b,_0x58eb63){_0x571a6b=_0x571a6b-0x0;var _0x5a2632=_0xae84[_0x571a6b];return _0x5a2632;};'use strict';var multer=require(_0x4ae8('0x0'));var util=require(_0x4ae8('0x1'));var path=require(_0x4ae8('0x2'));var timeout=require(_0x4ae8('0x3'));var express=require(_0x4ae8('0x4'));var router=express['Router']();var fs_extra=require(_0x4ae8('0x5'));var auth=require(_0x4ae8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4ae8('0x7'));var controller=require(_0x4ae8('0x8'));router[_0x4ae8('0x9')]('/',auth[_0x4ae8('0xa')](),controller['index']);router['get']('/:id',auth[_0x4ae8('0xa')](),controller[_0x4ae8('0xb')]);router[_0x4ae8('0xc')]('/',auth['isAuthenticated'](),controller[_0x4ae8('0xd')]);router[_0x4ae8('0xe')](_0x4ae8('0xf'),auth[_0x4ae8('0xa')](),controller[_0x4ae8('0x10')]);router[_0x4ae8('0x11')](_0x4ae8('0xf'),auth[_0x4ae8('0xa')](),controller[_0x4ae8('0x12')]);module['exports']=router; \ No newline at end of file +var _0xb64d=['destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x318dd1,_0x5a31){var _0x634382=function(_0x1cc2b9){while(--_0x1cc2b9){_0x318dd1['push'](_0x318dd1['shift']());}};_0x634382(++_0x5a31);}(_0xb64d,0xad));var _0xdb64=function(_0x3dff0d,_0x4d59ff){_0x3dff0d=_0x3dff0d-0x0;var _0x352383=_0xb64d[_0x3dff0d];return _0x352383;};'use strict';var multer=require(_0xdb64('0x0'));var util=require(_0xdb64('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdb64('0x2'));var router=express[_0xdb64('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdb64('0x4'));var interaction=require(_0xdb64('0x5'));var config=require(_0xdb64('0x6'));var controller=require('./intSalesforceField.controller');router[_0xdb64('0x7')]('/',auth[_0xdb64('0x8')](),controller[_0xdb64('0x9')]);router[_0xdb64('0x7')](_0xdb64('0xa'),auth[_0xdb64('0x8')](),controller[_0xdb64('0xb')]);router[_0xdb64('0xc')]('/',auth[_0xdb64('0x8')](),controller[_0xdb64('0xd')]);router[_0xdb64('0xe')](_0xdb64('0xa'),auth['isAuthenticated'](),controller[_0xdb64('0xf')]);router[_0xdb64('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xdb64('0x11')]);module[_0xdb64('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index fa30e6c..d3cf039 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 _0x581f=['keyValue','picklist','STRING','sequelize','string','variable','customVariable'];(function(_0x284b8e,_0x3d89a3){var _0x1dbc8c=function(_0x1d82a8){while(--_0x1d82a8){_0x284b8e['push'](_0x284b8e['shift']());}};_0x1dbc8c(++_0x3d89a3);}(_0x581f,0xc7));var _0xf581=function(_0x126283,_0x1e116a){_0x126283=_0x126283-0x0;var _0x4b536d=_0x581f[_0x126283];return _0x4b536d;};'use strict';var Sequelize=require(_0xf581('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xf581('0x1'),_0xf581('0x2'),_0xf581('0x3'),_0xf581('0x4'),_0xf581('0x5')),'defaultValue':_0xf581('0x1')},'content':{'type':Sequelize[_0xf581('0x6')]},'key':{'type':Sequelize[_0xf581('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0xf581('0x2'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf581('0x6')]},'variableName':{'type':Sequelize[_0xf581('0x6')]}}; \ No newline at end of file +var _0x29c4=['sequelize','exports','ENUM','string','variable','STRING','customVariable'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x29c4,0xf5));var _0x429c=function(_0xd74b25,_0x5db5da){_0xd74b25=_0xd74b25-0x0;var _0x2533b8=_0x29c4[_0xd74b25];return _0x2533b8;};'use strict';var Sequelize=require(_0x429c('0x0'));module[_0x429c('0x1')]={'type':{'type':Sequelize[_0x429c('0x2')](_0x429c('0x3'),_0x429c('0x4'),'customVariable','keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x429c('0x5')]},'key':{'type':Sequelize[_0x429c('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x429c('0x3'),_0x429c('0x4'),_0x429c('0x6'))},'keyContent':{'type':Sequelize[_0x429c('0x5')]},'idField':{'type':Sequelize[_0x429c('0x5')]},'variableName':{'type':Sequelize[_0x429c('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 0798668..da84e43 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 _0x1b06=['map','SalesforceField','rawAttributes','fieldName','query','keys','intersection','attributes','model','fields','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','includeAll','findAll','rows','params','length','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','name','send','index'];(function(_0x4de586,_0x183427){var _0x46baf5=function(_0x1157f0){while(--_0x1157f0){_0x4de586['push'](_0x4de586['shift']());}};_0x46baf5(++_0x183427);}(_0x1b06,0x1ea));var _0x61b0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1b06[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x61b0('0x0'));var rimraf=require(_0x61b0('0x1'));var zipdir=require(_0x61b0('0x2'));var jsonpatch=require(_0x61b0('0x3'));var rp=require(_0x61b0('0x4'));var moment=require(_0x61b0('0x5'));var BPromise=require(_0x61b0('0x6'));var Mustache=require(_0x61b0('0x7'));var util=require(_0x61b0('0x8'));var path=require(_0x61b0('0x9'));var sox=require(_0x61b0('0xa'));var csv=require(_0x61b0('0xb'));var ejs=require(_0x61b0('0xc'));var fs=require('fs');var fs_extra=require(_0x61b0('0xd'));var _=require(_0x61b0('0xe'));var squel=require(_0x61b0('0xf'));var crypto=require(_0x61b0('0x10'));var jsforce=require(_0x61b0('0x11'));var deskjs=require(_0x61b0('0x12'));var toCsv=require(_0x61b0('0xb'));var querystring=require(_0x61b0('0x13'));var Papa=require(_0x61b0('0x14'));var Redis=require(_0x61b0('0x15'));var authService=require(_0x61b0('0x16'));var qs=require(_0x61b0('0x17'));var as=require(_0x61b0('0x18'));var hardwareService=require(_0x61b0('0x19'));var logger=require('../../config/logger')(_0x61b0('0x1a'));var utils=require(_0x61b0('0x1b'));var config=require(_0x61b0('0x1c'));var licenseUtil=require('../../config/license/util');var db=require(_0x61b0('0x1d'))['db'];function respondWithStatusCode(_0x6628fa,_0x123cf5){_0x123cf5=_0x123cf5||0xcc;return function(_0x58ebf7){if(_0x58ebf7){return _0x6628fa['sendStatus'](_0x123cf5);}return _0x6628fa[_0x61b0('0x1e')](_0x123cf5)[_0x61b0('0x1f')]();};}function respondWithResult(_0x1befc9,_0x12b4d4){_0x12b4d4=_0x12b4d4||0xc8;return function(_0x233d41){if(_0x233d41){return _0x1befc9['status'](_0x12b4d4)[_0x61b0('0x20')](_0x233d41);}};}function respondWithFilteredResult(_0x23ec65,_0x1e84c5){return function(_0x2992f2){if(_0x2992f2){var _0x2d7459=typeof _0x1e84c5[_0x61b0('0x21')]===_0x61b0('0x22')&&typeof _0x1e84c5[_0x61b0('0x23')]===_0x61b0('0x22');var _0x5c623e=_0x2992f2[_0x61b0('0x24')];var _0x1982dc=_0x2d7459?0x0:_0x1e84c5[_0x61b0('0x21')];var _0x174647=_0x2d7459?_0x2992f2[_0x61b0('0x24')]:_0x1e84c5[_0x61b0('0x21')]+_0x1e84c5['limit'];var _0x3ddd64;if(_0x174647>=_0x5c623e){_0x174647=_0x5c623e;_0x3ddd64=0xc8;}else{_0x3ddd64=0xce;}_0x23ec65[_0x61b0('0x1e')](_0x3ddd64);return _0x23ec65[_0x61b0('0x25')](_0x61b0('0x26'),_0x1982dc+'-'+_0x174647+'/'+_0x5c623e)[_0x61b0('0x20')](_0x2992f2);}return null;};}function patchUpdates(_0x57afd6){return function(_0x4795db){try{jsonpatch['apply'](_0x4795db,_0x57afd6,!![]);}catch(_0x4dd326){return BPromise[_0x61b0('0x27')](_0x4dd326);}return _0x4795db[_0x61b0('0x28')]();};}function saveUpdates(_0x52d6b7,_0x161c6d){return function(_0x407d59){if(_0x407d59){return _0x407d59[_0x61b0('0x29')](_0x52d6b7)[_0x61b0('0x2a')](function(_0x3ffa4f){return _0x3ffa4f;});}return null;};}function removeEntity(_0x25bef2,_0x4e1ec4){return function(_0x58f2e5){if(_0x58f2e5){return _0x58f2e5[_0x61b0('0x2b')]()[_0x61b0('0x2a')](function(){_0x25bef2[_0x61b0('0x1e')](0xcc)[_0x61b0('0x1f')]();});}};}function handleEntityNotFound(_0x3c91ef,_0x36df2a){return function(_0x34ad35){if(!_0x34ad35){_0x3c91ef[_0x61b0('0x2c')](0x194);}return _0x34ad35;};}function handleError(_0x2ab499,_0x3139fc){_0x3139fc=_0x3139fc||0x1f4;return function(_0x2ad24d){logger[_0x61b0('0x2d')](_0x2ad24d['stack']);if(_0x2ad24d['name']){delete _0x2ad24d[_0x61b0('0x2e')];}_0x2ab499['status'](_0x3139fc)[_0x61b0('0x2f')](_0x2ad24d);};}exports[_0x61b0('0x30')]=function(_0x1076b8,_0x4ce89a){var _0x23a29f={},_0x225235={},_0x1b062c={'count':0x0,'rows':[]};var _0x1aab80=_[_0x61b0('0x31')](db[_0x61b0('0x32')][_0x61b0('0x33')],function(_0x21362a){return{'name':_0x21362a[_0x61b0('0x34')],'type':_0x21362a['type']['key']};});_0x225235['model']=_[_0x61b0('0x31')](_0x1aab80,_0x61b0('0x2e'));_0x225235[_0x61b0('0x35')]=_[_0x61b0('0x36')](_0x1076b8[_0x61b0('0x35')]);_0x225235['filters']=_[_0x61b0('0x37')](_0x225235['model'],_0x225235[_0x61b0('0x35')]);_0x23a29f[_0x61b0('0x38')]=_[_0x61b0('0x37')](_0x225235[_0x61b0('0x39')],qs[_0x61b0('0x3a')](_0x1076b8[_0x61b0('0x35')][_0x61b0('0x3a')]));_0x23a29f['attributes']=_0x23a29f[_0x61b0('0x38')]['length']?_0x23a29f['attributes']:_0x225235[_0x61b0('0x39')];if(!_0x1076b8['query']['hasOwnProperty'](_0x61b0('0x3b'))){_0x23a29f[_0x61b0('0x23')]=qs[_0x61b0('0x23')](_0x1076b8[_0x61b0('0x35')][_0x61b0('0x23')]);_0x23a29f[_0x61b0('0x21')]=qs[_0x61b0('0x21')](_0x1076b8[_0x61b0('0x35')]['offset']);}_0x23a29f[_0x61b0('0x3c')]=qs[_0x61b0('0x3d')](_0x1076b8[_0x61b0('0x35')][_0x61b0('0x3d')]);_0x23a29f[_0x61b0('0x3e')]=qs[_0x61b0('0x3f')](_['pick'](_0x1076b8['query'],_0x225235[_0x61b0('0x3f')]),_0x1aab80);if(_0x1076b8[_0x61b0('0x35')][_0x61b0('0x40')]){_0x23a29f[_0x61b0('0x3e')]=_[_0x61b0('0x41')](_0x23a29f[_0x61b0('0x3e')],{'$or':_[_0x61b0('0x31')](_0x1aab80,function(_0x3ce722){if(_0x3ce722[_0x61b0('0x42')]!==_0x61b0('0x43')){var _0x4192f1={};_0x4192f1[_0x3ce722[_0x61b0('0x2e')]]={'$like':'%'+_0x1076b8['query'][_0x61b0('0x40')]+'%'};return _0x4192f1;}})});}_0x23a29f=_[_0x61b0('0x41')]({},_0x23a29f,_0x1076b8['options']);var _0x5e3bdf={'where':_0x23a29f['where']};return db[_0x61b0('0x32')][_0x61b0('0x24')](_0x5e3bdf)['then'](function(_0x2d8e42){_0x1b062c[_0x61b0('0x24')]=_0x2d8e42;if(_0x1076b8[_0x61b0('0x35')][_0x61b0('0x44')]){_0x23a29f['include']=[{'all':!![]}];}return db[_0x61b0('0x32')][_0x61b0('0x45')](_0x23a29f);})[_0x61b0('0x2a')](function(_0x592ccc){_0x1b062c[_0x61b0('0x46')]=_0x592ccc;return _0x1b062c;})[_0x61b0('0x2a')](respondWithFilteredResult(_0x4ce89a,_0x23a29f))['catch'](handleError(_0x4ce89a,null));};exports['show']=function(_0x3d6311,_0xf9d607){var _0x397e6a={'raw':!![],'where':{'id':_0x3d6311[_0x61b0('0x47')]['id']}},_0xa6d6b7={};_0xa6d6b7[_0x61b0('0x39')]=_[_0x61b0('0x36')](db[_0x61b0('0x32')]['rawAttributes']);_0xa6d6b7['query']=_[_0x61b0('0x36')](_0x3d6311[_0x61b0('0x35')]);_0xa6d6b7[_0x61b0('0x3f')]=_[_0x61b0('0x37')](_0xa6d6b7[_0x61b0('0x39')],_0xa6d6b7[_0x61b0('0x35')]);_0x397e6a[_0x61b0('0x38')]=_[_0x61b0('0x37')](_0xa6d6b7[_0x61b0('0x39')],qs['fields'](_0x3d6311['query']['fields']));_0x397e6a[_0x61b0('0x38')]=_0x397e6a['attributes'][_0x61b0('0x48')]?_0x397e6a[_0x61b0('0x38')]:_0xa6d6b7['model'];if(_0x3d6311['query'][_0x61b0('0x44')]){_0x397e6a['include']=[{'all':!![]}];}_0x397e6a=_[_0x61b0('0x41')]({},_0x397e6a,_0x3d6311['options']);return db[_0x61b0('0x32')][_0x61b0('0x49')](_0x397e6a)[_0x61b0('0x2a')](handleEntityNotFound(_0xf9d607,null))['then'](respondWithResult(_0xf9d607,null))[_0x61b0('0x4a')](handleError(_0xf9d607,null));};exports[_0x61b0('0x4b')]=function(_0xaccc79,_0x1c6b88){return db[_0x61b0('0x32')]['create'](_0xaccc79[_0x61b0('0x4c')],{})[_0x61b0('0x2a')](respondWithResult(_0x1c6b88,0xc9))[_0x61b0('0x4a')](handleError(_0x1c6b88,null));};exports[_0x61b0('0x29')]=function(_0x484b17,_0x416035){if(_0x484b17[_0x61b0('0x4c')]['id']){delete _0x484b17['body']['id'];}return db[_0x61b0('0x32')][_0x61b0('0x49')]({'where':{'id':_0x484b17[_0x61b0('0x47')]['id']}})[_0x61b0('0x2a')](handleEntityNotFound(_0x416035,null))[_0x61b0('0x2a')](saveUpdates(_0x484b17[_0x61b0('0x4c')],null))[_0x61b0('0x2a')](respondWithResult(_0x416035,null))[_0x61b0('0x4a')](handleError(_0x416035,null));};exports[_0x61b0('0x2b')]=function(_0x5a5b43,_0x2ddc6e){return db[_0x61b0('0x32')][_0x61b0('0x49')]({'where':{'id':_0x5a5b43[_0x61b0('0x47')]['id']}})[_0x61b0('0x2a')](handleEntityNotFound(_0x2ddc6e,null))[_0x61b0('0x2a')](removeEntity(_0x2ddc6e,null))['catch'](handleError(_0x2ddc6e,null));}; \ No newline at end of file +var _0x80df=['update','find','rimraf','fast-json-patch','bluebird','util','path','to-csv','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','destroy','then','sendStatus','error','stack','name','send','SalesforceField','rawAttributes','type','key','model','map','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','include','findAll','catch','params','intersection','includeAll','create','body'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x80df,0xd7));var _0xf80d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x80df[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf80d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf80d('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf80d('0x2'));var Mustache=require('mustache');var util=require(_0xf80d('0x3'));var path=require(_0xf80d('0x4'));var sox=require('sox');var csv=require(_0xf80d('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf80d('0x6'));var _=require('lodash');var squel=require(_0xf80d('0x7'));var crypto=require('crypto');var jsforce=require(_0xf80d('0x8'));var deskjs=require(_0xf80d('0x9'));var toCsv=require(_0xf80d('0x5'));var querystring=require(_0xf80d('0xa'));var Papa=require('papaparse');var Redis=require(_0xf80d('0xb'));var authService=require(_0xf80d('0xc'));var qs=require(_0xf80d('0xd'));var as=require(_0xf80d('0xe'));var hardwareService=require(_0xf80d('0xf'));var logger=require(_0xf80d('0x10'))(_0xf80d('0x11'));var utils=require(_0xf80d('0x12'));var config=require(_0xf80d('0x13'));var licenseUtil=require(_0xf80d('0x14'));var db=require(_0xf80d('0x15'))['db'];function respondWithStatusCode(_0x3b8f76,_0x21a6b2){_0x21a6b2=_0x21a6b2||0xcc;return function(_0x7372d0){if(_0x7372d0){return _0x3b8f76['sendStatus'](_0x21a6b2);}return _0x3b8f76[_0xf80d('0x16')](_0x21a6b2)[_0xf80d('0x17')]();};}function respondWithResult(_0x363cac,_0x74b93){_0x74b93=_0x74b93||0xc8;return function(_0x318176){if(_0x318176){return _0x363cac[_0xf80d('0x16')](_0x74b93)[_0xf80d('0x18')](_0x318176);}};}function respondWithFilteredResult(_0x4577b3,_0x5ccd84){return function(_0x2b9c33){if(_0x2b9c33){var _0x19521d=typeof _0x5ccd84['offset']===_0xf80d('0x19')&&typeof _0x5ccd84['limit']===_0xf80d('0x19');var _0x297b2c=_0x2b9c33[_0xf80d('0x1a')];var _0x5235be=_0x19521d?0x0:_0x5ccd84[_0xf80d('0x1b')];var _0x30a88b=_0x19521d?_0x2b9c33['count']:_0x5ccd84[_0xf80d('0x1b')]+_0x5ccd84[_0xf80d('0x1c')];var _0x3fa6b5;if(_0x30a88b>=_0x297b2c){_0x30a88b=_0x297b2c;_0x3fa6b5=0xc8;}else{_0x3fa6b5=0xce;}_0x4577b3[_0xf80d('0x16')](_0x3fa6b5);return _0x4577b3[_0xf80d('0x1d')](_0xf80d('0x1e'),_0x5235be+'-'+_0x30a88b+'/'+_0x297b2c)[_0xf80d('0x18')](_0x2b9c33);}return null;};}function patchUpdates(_0x1b7a99){return function(_0x1b49a8){try{jsonpatch[_0xf80d('0x1f')](_0x1b49a8,_0x1b7a99,!![]);}catch(_0x4da168){return BPromise['reject'](_0x4da168);}return _0x1b49a8[_0xf80d('0x20')]();};}function saveUpdates(_0x4231de,_0xbd2c18){return function(_0x290977){if(_0x290977){return _0x290977['update'](_0x4231de)['then'](function(_0x2eb684){return _0x2eb684;});}return null;};}function removeEntity(_0x3ec388,_0x15df32){return function(_0x5f336c){if(_0x5f336c){return _0x5f336c[_0xf80d('0x21')]()[_0xf80d('0x22')](function(){_0x3ec388[_0xf80d('0x16')](0xcc)[_0xf80d('0x17')]();});}};}function handleEntityNotFound(_0x28bdbc,_0x4a1cfb){return function(_0x33dca7){if(!_0x33dca7){_0x28bdbc[_0xf80d('0x23')](0x194);}return _0x33dca7;};}function handleError(_0x45090c,_0x2d395b){_0x2d395b=_0x2d395b||0x1f4;return function(_0x198011){logger[_0xf80d('0x24')](_0x198011[_0xf80d('0x25')]);if(_0x198011[_0xf80d('0x26')]){delete _0x198011[_0xf80d('0x26')];}_0x45090c[_0xf80d('0x16')](_0x2d395b)[_0xf80d('0x27')](_0x198011);};}exports['index']=function(_0x2dbafd,_0x34812c){var _0x15e27d={},_0x548ee9={},_0x2c855f={'count':0x0,'rows':[]};var _0x52f83f=_['map'](db[_0xf80d('0x28')][_0xf80d('0x29')],function(_0x51ca71){return{'name':_0x51ca71['fieldName'],'type':_0x51ca71[_0xf80d('0x2a')][_0xf80d('0x2b')]};});_0x548ee9[_0xf80d('0x2c')]=_[_0xf80d('0x2d')](_0x52f83f,'name');_0x548ee9[_0xf80d('0x2e')]=_[_0xf80d('0x2f')](_0x2dbafd[_0xf80d('0x2e')]);_0x548ee9['filters']=_['intersection'](_0x548ee9[_0xf80d('0x2c')],_0x548ee9[_0xf80d('0x2e')]);_0x15e27d[_0xf80d('0x30')]=_['intersection'](_0x548ee9['model'],qs[_0xf80d('0x31')](_0x2dbafd[_0xf80d('0x2e')]['fields']));_0x15e27d[_0xf80d('0x30')]=_0x15e27d[_0xf80d('0x30')][_0xf80d('0x32')]?_0x15e27d[_0xf80d('0x30')]:_0x548ee9[_0xf80d('0x2c')];if(!_0x2dbafd[_0xf80d('0x2e')][_0xf80d('0x33')](_0xf80d('0x34'))){_0x15e27d[_0xf80d('0x1c')]=qs[_0xf80d('0x1c')](_0x2dbafd[_0xf80d('0x2e')][_0xf80d('0x1c')]);_0x15e27d['offset']=qs[_0xf80d('0x1b')](_0x2dbafd['query']['offset']);}_0x15e27d[_0xf80d('0x35')]=qs[_0xf80d('0x36')](_0x2dbafd[_0xf80d('0x2e')][_0xf80d('0x36')]);_0x15e27d[_0xf80d('0x37')]=qs['filters'](_[_0xf80d('0x38')](_0x2dbafd[_0xf80d('0x2e')],_0x548ee9[_0xf80d('0x39')]),_0x52f83f);if(_0x2dbafd['query'][_0xf80d('0x3a')]){_0x15e27d[_0xf80d('0x37')]=_[_0xf80d('0x3b')](_0x15e27d[_0xf80d('0x37')],{'$or':_[_0xf80d('0x2d')](_0x52f83f,function(_0x103e48){if(_0x103e48['type']!=='VIRTUAL'){var _0x1e2fbc={};_0x1e2fbc[_0x103e48[_0xf80d('0x26')]]={'$like':'%'+_0x2dbafd[_0xf80d('0x2e')][_0xf80d('0x3a')]+'%'};return _0x1e2fbc;}})});}_0x15e27d=_[_0xf80d('0x3b')]({},_0x15e27d,_0x2dbafd[_0xf80d('0x3c')]);var _0x2bc51e={'where':_0x15e27d[_0xf80d('0x37')]};return db[_0xf80d('0x28')][_0xf80d('0x1a')](_0x2bc51e)['then'](function(_0x2d65ba){_0x2c855f['count']=_0x2d65ba;if(_0x2dbafd['query']['includeAll']){_0x15e27d[_0xf80d('0x3d')]=[{'all':!![]}];}return db[_0xf80d('0x28')][_0xf80d('0x3e')](_0x15e27d);})['then'](function(_0x66475){_0x2c855f['rows']=_0x66475;return _0x2c855f;})[_0xf80d('0x22')](respondWithFilteredResult(_0x34812c,_0x15e27d))[_0xf80d('0x3f')](handleError(_0x34812c,null));};exports['show']=function(_0x54fd63,_0x1806d9){var _0x40b57e={'raw':!![],'where':{'id':_0x54fd63[_0xf80d('0x40')]['id']}},_0x3bec39={};_0x3bec39[_0xf80d('0x2c')]=_[_0xf80d('0x2f')](db[_0xf80d('0x28')]['rawAttributes']);_0x3bec39[_0xf80d('0x2e')]=_[_0xf80d('0x2f')](_0x54fd63['query']);_0x3bec39[_0xf80d('0x39')]=_[_0xf80d('0x41')](_0x3bec39[_0xf80d('0x2c')],_0x3bec39[_0xf80d('0x2e')]);_0x40b57e[_0xf80d('0x30')]=_[_0xf80d('0x41')](_0x3bec39[_0xf80d('0x2c')],qs[_0xf80d('0x31')](_0x54fd63[_0xf80d('0x2e')][_0xf80d('0x31')]));_0x40b57e['attributes']=_0x40b57e[_0xf80d('0x30')][_0xf80d('0x32')]?_0x40b57e[_0xf80d('0x30')]:_0x3bec39[_0xf80d('0x2c')];if(_0x54fd63[_0xf80d('0x2e')][_0xf80d('0x42')]){_0x40b57e[_0xf80d('0x3d')]=[{'all':!![]}];}_0x40b57e=_['merge']({},_0x40b57e,_0x54fd63[_0xf80d('0x3c')]);return db['SalesforceField']['find'](_0x40b57e)[_0xf80d('0x22')](handleEntityNotFound(_0x1806d9,null))[_0xf80d('0x22')](respondWithResult(_0x1806d9,null))[_0xf80d('0x3f')](handleError(_0x1806d9,null));};exports[_0xf80d('0x43')]=function(_0x29d5f9,_0x5c6f7a){return db[_0xf80d('0x28')]['create'](_0x29d5f9[_0xf80d('0x44')],{})[_0xf80d('0x22')](respondWithResult(_0x5c6f7a,0xc9))['catch'](handleError(_0x5c6f7a,null));};exports[_0xf80d('0x45')]=function(_0xfe23d1,_0x56325a){if(_0xfe23d1[_0xf80d('0x44')]['id']){delete _0xfe23d1[_0xf80d('0x44')]['id'];}return db['SalesforceField'][_0xf80d('0x46')]({'where':{'id':_0xfe23d1['params']['id']}})['then'](handleEntityNotFound(_0x56325a,null))['then'](saveUpdates(_0xfe23d1[_0xf80d('0x44')],null))['then'](respondWithResult(_0x56325a,null))[_0xf80d('0x3f')](handleError(_0x56325a,null));};exports[_0xf80d('0x21')]=function(_0x5d7393,_0x31b570){return db[_0xf80d('0x28')]['find']({'where':{'id':_0x5d7393[_0xf80d('0x40')]['id']}})[_0xf80d('0x22')](handleEntityNotFound(_0x31b570,null))[_0xf80d('0x22')](removeEntity(_0x31b570,null))[_0xf80d('0x3f')](handleError(_0x31b570,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 5ad14b1..528b431 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 _0x44d8=['./intSalesforceField.attributes','exports','SalesforceField','salesforce_unique_index','idField','FieldId','util','../../config/logger','moment','path','../../config/environment'];(function(_0x155d7e,_0x8966ae){var _0x307fd1=function(_0x69681d){while(--_0x69681d){_0x155d7e['push'](_0x155d7e['shift']());}};_0x307fd1(++_0x8966ae);}(_0x44d8,0x145));var _0x844d=function(_0x529ce5,_0x3f21f9){_0x529ce5=_0x529ce5-0x0;var _0x1e00e0=_0x44d8[_0x529ce5];return _0x1e00e0;};'use strict';var _=require('lodash');var util=require(_0x844d('0x0'));var logger=require(_0x844d('0x1'))('api');var moment=require(_0x844d('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x844d('0x3'));var rimraf=require('rimraf');var config=require(_0x844d('0x4'));var attributes=require(_0x844d('0x5'));module[_0x844d('0x6')]=function(_0xb648df,_0x2cf952){return _0xb648df['define'](_0x844d('0x7'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x844d('0x8'),'fields':[_0x844d('0x9'),_0x844d('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3729=['./intSalesforceField.attributes','exports','define','SalesforceField','salesforce_unique_index','FieldId','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x4c5b15,_0x27f857){var _0x2637ab=function(_0x425498){while(--_0x425498){_0x4c5b15['push'](_0x4c5b15['shift']());}};_0x2637ab(++_0x27f857);}(_0x3729,0xcc));var _0x9372=function(_0x528fb3,_0x311f05){_0x528fb3=_0x528fb3-0x0;var _0x5bb5f2=_0x3729[_0x528fb3];return _0x5bb5f2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9372('0x0'))('api');var moment=require(_0x9372('0x1'));var BPromise=require(_0x9372('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9372('0x3'));var rimraf=require(_0x9372('0x4'));var config=require('../../config/environment');var attributes=require(_0x9372('0x5'));module[_0x9372('0x6')]=function(_0x45e32d,_0x4a110c){return _0x45e32d[_0x9372('0x7')](_0x9372('0x8'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x9372('0x9'),'fields':['idField',_0x9372('0xa')],'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 7ba1f5d..21a89ed 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 _0x4e96=['then','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','request'];(function(_0x286ea,_0x23a4cc){var _0x3d5b62=function(_0x343f44){while(--_0x343f44){_0x286ea['push'](_0x286ea['shift']());}};_0x3d5b62(++_0x23a4cc);}(_0x4e96,0x16b));var _0x64e9=function(_0x1ee0bc,_0x7249cf){_0x1ee0bc=_0x1ee0bc-0x0;var _0x214e6a=_0x4e96[_0x1ee0bc];return _0x214e6a;};'use strict';var _=require(_0x64e9('0x0'));var util=require(_0x64e9('0x1'));var moment=require(_0x64e9('0x2'));var BPromise=require(_0x64e9('0x3'));var rs=require(_0x64e9('0x4'));var fs=require('fs');var Redis=require(_0x64e9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x64e9('0x6'));var logger=require('../../config/logger')(_0x64e9('0x7'));var config=require('../../config/environment');var jayson=require(_0x64e9('0x8'));var client=jayson[_0x64e9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x81eb89,_0x512ebf,_0x4d22c5){return new BPromise(function(_0x72eda0,_0x2eebc0){return client[_0x64e9('0xa')](_0x81eb89,_0x4d22c5)[_0x64e9('0xb')](function(_0xe19926){logger['info'](_0x64e9('0xc'),_0x512ebf,'request\x20sent');logger[_0x64e9('0xd')](_0x64e9('0xe'),_0x512ebf,'request\x20sent',JSON['stringify'](_0xe19926));if(_0xe19926[_0x64e9('0xf')]){if(_0xe19926[_0x64e9('0xf')]['code']===0x1f4){logger['error']('SalesforceField,\x20%s,\x20%s',_0x512ebf,_0xe19926['error']['message']);return _0x2eebc0(_0xe19926['error'][_0x64e9('0x10')]);}logger[_0x64e9('0xf')](_0x64e9('0xc'),_0x512ebf,_0xe19926[_0x64e9('0xf')][_0x64e9('0x10')]);return _0x72eda0(_0xe19926['error'][_0x64e9('0x10')]);}else{logger['info'](_0x64e9('0xc'),_0x512ebf,'request\x20sent');_0x72eda0(_0xe19926['result'][_0x64e9('0x10')]);}})['catch'](function(_0x465157){logger[_0x64e9('0xf')](_0x64e9('0xc'),_0x512ebf,_0x465157);_0x2eebc0(_0x465157);});});} \ No newline at end of file +var _0x22de=['then','info','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','error','SalesforceField,\x20%s,\x20%s','message','result','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x45fa89,_0x24dc48){var _0x130d9e=function(_0x5b46bb){while(--_0x5b46bb){_0x45fa89['push'](_0x45fa89['shift']());}};_0x130d9e(++_0x24dc48);}(_0x22de,0x1d5));var _0xe22d=function(_0x6eb910,_0x26898f){_0x6eb910=_0x6eb910-0x0;var _0x3fad42=_0x22de[_0x6eb910];return _0x3fad42;};'use strict';var _=require('lodash');var util=require(_0xe22d('0x0'));var moment=require(_0xe22d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe22d('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe22d('0x3'));var logger=require(_0xe22d('0x4'))(_0xe22d('0x5'));var config=require(_0xe22d('0x6'));var jayson=require(_0xe22d('0x7'));var client=jayson[_0xe22d('0x8')][_0xe22d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x567bf7,_0x33aa74,_0x349213){return new BPromise(function(_0x558ca7,_0xa1541c){return client[_0xe22d('0xa')](_0x567bf7,_0x349213)[_0xe22d('0xb')](function(_0x3d0872){logger[_0xe22d('0xc')]('SalesforceField,\x20%s,\x20%s',_0x33aa74,'request\x20sent');logger[_0xe22d('0xd')](_0xe22d('0xe'),_0x33aa74,_0xe22d('0xf'),JSON['stringify'](_0x3d0872));if(_0x3d0872[_0xe22d('0x10')]){if(_0x3d0872[_0xe22d('0x10')]['code']===0x1f4){logger['error'](_0xe22d('0x11'),_0x33aa74,_0x3d0872[_0xe22d('0x10')][_0xe22d('0x12')]);return _0xa1541c(_0x3d0872[_0xe22d('0x10')][_0xe22d('0x12')]);}logger[_0xe22d('0x10')](_0xe22d('0x11'),_0x33aa74,_0x3d0872['error'][_0xe22d('0x12')]);return _0x558ca7(_0x3d0872[_0xe22d('0x10')][_0xe22d('0x12')]);}else{logger[_0xe22d('0xc')]('SalesforceField,\x20%s,\x20%s',_0x33aa74,_0xe22d('0xf'));_0x558ca7(_0x3d0872[_0xe22d('0x13')]['message']);}})['catch'](function(_0x2577fa){logger[_0xe22d('0x10')](_0xe22d('0x11'),_0x33aa74,_0x2577fa);_0xa1541c(_0x2577fa);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index f0c5dd9..0b25de9 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 _0x2632=['addConfiguration','put','exports','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','get','getFields','create','post'];(function(_0x11e1a6,_0x4fef55){var _0x801d48=function(_0x48077f){while(--_0x48077f){_0x11e1a6['push'](_0x11e1a6['shift']());}};_0x801d48(++_0x4fef55);}(_0x2632,0xae));var _0x2263=function(_0x50b628,_0x46e878){_0x50b628=_0x50b628-0x0;var _0x41d9dc=_0x2632[_0x50b628];return _0x41d9dc;};'use strict';var multer=require('multer');var util=require(_0x2263('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2263('0x1'));var router=express['Router']();var fs_extra=require(_0x2263('0x2'));var auth=require(_0x2263('0x3'));var interaction=require(_0x2263('0x4'));var config=require(_0x2263('0x5'));var controller=require(_0x2263('0x6'));router['get']('/',auth[_0x2263('0x7')](),controller[_0x2263('0x8')]);router['get'](_0x2263('0x9'),auth['isAuthenticated'](),controller['show']);router['get'](_0x2263('0xa'),auth[_0x2263('0x7')](),controller[_0x2263('0xb')]);router[_0x2263('0xc')]('/:id/fields',auth[_0x2263('0x7')](),controller[_0x2263('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2263('0xe')]);router[_0x2263('0xf')](_0x2263('0xa'),auth[_0x2263('0x7')](),controller[_0x2263('0x10')]);router[_0x2263('0x11')](_0x2263('0x9'),auth[_0x2263('0x7')](),controller['update']);router['delete'](_0x2263('0x9'),auth[_0x2263('0x7')](),controller['destroy']);module[_0x2263('0x12')]=router; \ No newline at end of file +var _0xadf7=['/:id','show','get','/:id/configurations','/:id/fields','post','addConfiguration','put','delete','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xadf7,0xb5));var _0x7adf=function(_0x13f92d,_0x8e69d7){_0x13f92d=_0x13f92d-0x0;var _0x51f31b=_0xadf7[_0x13f92d];return _0x51f31b;};'use strict';var multer=require(_0x7adf('0x0'));var util=require('util');var path=require(_0x7adf('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7adf('0x2')]();var fs_extra=require(_0x7adf('0x3'));var auth=require(_0x7adf('0x4'));var interaction=require(_0x7adf('0x5'));var config=require(_0x7adf('0x6'));var controller=require(_0x7adf('0x7'));router['get']('/',auth[_0x7adf('0x8')](),controller['index']);router['get'](_0x7adf('0x9'),auth[_0x7adf('0x8')](),controller[_0x7adf('0xa')]);router[_0x7adf('0xb')](_0x7adf('0xc'),auth[_0x7adf('0x8')](),controller['getConfigurations']);router[_0x7adf('0xb')](_0x7adf('0xd'),auth[_0x7adf('0x8')](),controller['getFields']);router[_0x7adf('0xe')]('/',auth[_0x7adf('0x8')](),controller['create']);router[_0x7adf('0xe')](_0x7adf('0xc'),auth['isAuthenticated'](),controller[_0x7adf('0xf')]);router[_0x7adf('0x10')](_0x7adf('0x9'),auth[_0x7adf('0x8')](),controller['update']);router[_0x7adf('0x11')](_0x7adf('0x9'),auth[_0x7adf('0x8')](),controller['destroy']);module[_0x7adf('0x12')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 71678e6..124eb2f 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 _0xe406=['STRING','remoteUri','sequelize','exports'];(function(_0x1d50f2,_0x3c3ec6){var _0x3769b8=function(_0x50926a){while(--_0x50926a){_0x1d50f2['push'](_0x1d50f2['shift']());}};_0x3769b8(++_0x3c3ec6);}(_0xe406,0x66));var _0x6e40=function(_0x4b8972,_0x3278d4){_0x4b8972=_0x4b8972-0x0;var _0x5ea151=_0xe406[_0x4b8972];return _0x5ea151;};'use strict';var Sequelize=require(_0x6e40('0x0'));module[_0x6e40('0x1')]={'name':{'type':Sequelize[_0x6e40('0x2')]},'description':{'type':Sequelize[_0x6e40('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0x6e40('0x2')]},'email':{'type':Sequelize[_0x6e40('0x2')]},'remoteUri':{'type':Sequelize[_0x6e40('0x2')],'unique':_0x6e40('0x3')},'serverUrl':{'type':Sequelize[_0x6e40('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x54af=['remoteUri','sequelize','exports','STRING','username'];(function(_0x4cc05b,_0x1ce43b){var _0x19d7b9=function(_0x1422ee){while(--_0x1422ee){_0x4cc05b['push'](_0x4cc05b['shift']());}};_0x19d7b9(++_0x1ce43b);}(_0x54af,0x1b4));var _0xf54a=function(_0x150cfa,_0x3f1764){_0x150cfa=_0x150cfa-0x0;var _0x4a0ed2=_0x54af[_0x150cfa];return _0x4a0ed2;};'use strict';var Sequelize=require(_0xf54a('0x0'));module[_0xf54a('0x1')]={'name':{'type':Sequelize[_0xf54a('0x2')]},'description':{'type':Sequelize[_0xf54a('0x2')]},'username':{'type':Sequelize[_0xf54a('0x2')],'unique':_0xf54a('0x3')},'password':{'type':Sequelize[_0xf54a('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xf54a('0x2')],'unique':_0xf54a('0x4')},'serverUrl':{'type':Sequelize[_0xf54a('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index e9c84b8..b10b473 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 _0x4e04=['status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','end','sendStatus','stack','name','index','map','ServicenowAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','ServicenowConfiguration','getConfigurations','nolimit','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','ServicenowField','Descriptions','getFields','made_sla','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','watch_list','upon_reject','child_incidents','hold_reason','approval_history','resolved_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','work_notes_list','business_service','sys_domain_path','rfc','time_worked','expected_start','opened_at','group_list','reopened_time','resolved_at','caller_id','approval_set','work_notes','correlation_display','work_start','assignment_group','business_stc','additional_assignee_list','calendar_duration','sys_class_name','close_notes','closed_by','parent_incident','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','sla_due','comments_and_work_notes','due_date','sys_tags','escalation','upon_approval','correlation_id','location','username','password','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','remove','includes','label','push','all','log','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','concat','statusCode','error','send','test','Wrong\x20credentials','boolean','True','False','false','sys_choice?sysparm_query=name=incident^element=','forEach','value','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x4e04,0x158));var _0x44e0=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x4e04[_0x411add];return _0x238242;};'use strict';var emlformat=require(_0x44e0('0x0'));var rimraf=require(_0x44e0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x44e0('0x2'));var rp=require(_0x44e0('0x3'));var moment=require(_0x44e0('0x4'));var BPromise=require(_0x44e0('0x5'));var Mustache=require('mustache');var util=require(_0x44e0('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x44e0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x44e0('0x8'));var crypto=require(_0x44e0('0x9'));var jsforce=require(_0x44e0('0xa'));var deskjs=require(_0x44e0('0xb'));var toCsv=require(_0x44e0('0x7'));var querystring=require(_0x44e0('0xc'));var Papa=require(_0x44e0('0xd'));var Redis=require(_0x44e0('0xe'));var authService=require(_0x44e0('0xf'));var qs=require(_0x44e0('0x10'));var as=require(_0x44e0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x44e0('0x12'))(_0x44e0('0x13'));var utils=require(_0x44e0('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x44e0('0x15'));var db=require(_0x44e0('0x16'))['db'];var integrations=require(_0x44e0('0x17'));function respondWithStatusCode(_0x93f7a1,_0x4449ce){_0x4449ce=_0x4449ce||0xcc;return function(_0x42444d){if(_0x42444d){return _0x93f7a1['sendStatus'](_0x4449ce);}return _0x93f7a1[_0x44e0('0x18')](_0x4449ce)['end']();};}function respondWithResult(_0x13a33d,_0x1596d1){_0x1596d1=_0x1596d1||0xc8;return function(_0x52e364){if(_0x52e364){return _0x13a33d[_0x44e0('0x18')](_0x1596d1)[_0x44e0('0x19')](_0x52e364);}};}function respondWithFilteredResult(_0x3d961c,_0x4e62d3){return function(_0x4f0ccc){if(_0x4f0ccc){var _0x542b6c=typeof _0x4e62d3[_0x44e0('0x1a')]===_0x44e0('0x1b')&&typeof _0x4e62d3[_0x44e0('0x1c')]===_0x44e0('0x1b');var _0x518141=_0x4f0ccc[_0x44e0('0x1d')];var _0x502e3c=_0x542b6c?0x0:_0x4e62d3[_0x44e0('0x1a')];var _0x18326d=_0x542b6c?_0x4f0ccc['count']:_0x4e62d3[_0x44e0('0x1a')]+_0x4e62d3[_0x44e0('0x1c')];var _0x1a1a6b;if(_0x18326d>=_0x518141){_0x18326d=_0x518141;_0x1a1a6b=0xc8;}else{_0x1a1a6b=0xce;}_0x3d961c['status'](_0x1a1a6b);return _0x3d961c[_0x44e0('0x1e')](_0x44e0('0x1f'),_0x502e3c+'-'+_0x18326d+'/'+_0x518141)[_0x44e0('0x19')](_0x4f0ccc);}return null;};}function patchUpdates(_0x41567e){return function(_0x293296){try{jsonpatch[_0x44e0('0x20')](_0x293296,_0x41567e,!![]);}catch(_0x15aee3){return BPromise[_0x44e0('0x21')](_0x15aee3);}return _0x293296[_0x44e0('0x22')]();};}function saveUpdates(_0xe7838a,_0xdfa4b5){return function(_0x591370){if(_0x591370){return _0x591370['update'](_0xe7838a)[_0x44e0('0x23')](function(_0x53d4e4){return _0x53d4e4;});}return null;};}function removeEntity(_0x2cffc9,_0x23d445){return function(_0x4dec84){if(_0x4dec84){return _0x4dec84['destroy']()['then'](function(){_0x2cffc9[_0x44e0('0x18')](0xcc)[_0x44e0('0x24')]();});}};}function handleEntityNotFound(_0x419acd,_0x20cc6c){return function(_0x2980ef){if(!_0x2980ef){_0x419acd[_0x44e0('0x25')](0x194);}return _0x2980ef;};}function handleError(_0x412dd2,_0x37d1c5){_0x37d1c5=_0x37d1c5||0x1f4;return function(_0x2c5bbf){logger['error'](_0x2c5bbf[_0x44e0('0x26')]);if(_0x2c5bbf['name']){delete _0x2c5bbf[_0x44e0('0x27')];}_0x412dd2[_0x44e0('0x18')](_0x37d1c5)['send'](_0x2c5bbf);};}exports[_0x44e0('0x28')]=function(_0x2093d9,_0x1d2503){var _0x5244ae={},_0x42a6e5={},_0x25248c={'count':0x0,'rows':[]};var _0x14704c=_[_0x44e0('0x29')](db[_0x44e0('0x2a')][_0x44e0('0x2b')],function(_0x45a617){return{'name':_0x45a617['fieldName'],'type':_0x45a617[_0x44e0('0x2c')][_0x44e0('0x2d')]};});_0x42a6e5[_0x44e0('0x2e')]=_[_0x44e0('0x29')](_0x14704c,_0x44e0('0x27'));_0x42a6e5[_0x44e0('0x2f')]=_[_0x44e0('0x30')](_0x2093d9['query']);_0x42a6e5[_0x44e0('0x31')]=_[_0x44e0('0x32')](_0x42a6e5[_0x44e0('0x2e')],_0x42a6e5[_0x44e0('0x2f')]);_0x5244ae[_0x44e0('0x33')]=_['intersection'](_0x42a6e5['model'],qs['fields'](_0x2093d9[_0x44e0('0x2f')][_0x44e0('0x34')]));_0x5244ae[_0x44e0('0x33')]=_0x5244ae['attributes'][_0x44e0('0x35')]?_0x5244ae[_0x44e0('0x33')]:_0x42a6e5[_0x44e0('0x2e')];if(!_0x2093d9[_0x44e0('0x2f')][_0x44e0('0x36')]('nolimit')){_0x5244ae['limit']=qs[_0x44e0('0x1c')](_0x2093d9[_0x44e0('0x2f')][_0x44e0('0x1c')]);_0x5244ae[_0x44e0('0x1a')]=qs[_0x44e0('0x1a')](_0x2093d9[_0x44e0('0x2f')]['offset']);}_0x5244ae[_0x44e0('0x37')]=qs[_0x44e0('0x38')](_0x2093d9[_0x44e0('0x2f')][_0x44e0('0x38')]);_0x5244ae[_0x44e0('0x39')]=qs[_0x44e0('0x31')](_[_0x44e0('0x3a')](_0x2093d9[_0x44e0('0x2f')],_0x42a6e5[_0x44e0('0x31')]),_0x14704c);if(_0x2093d9[_0x44e0('0x2f')][_0x44e0('0x3b')]){_0x5244ae[_0x44e0('0x39')]=_['merge'](_0x5244ae[_0x44e0('0x39')],{'$or':_[_0x44e0('0x29')](_0x14704c,function(_0x2dfdaa){if(_0x2dfdaa[_0x44e0('0x2c')]!==_0x44e0('0x3c')){var _0x1a10bc={};_0x1a10bc[_0x2dfdaa[_0x44e0('0x27')]]={'$like':'%'+_0x2093d9[_0x44e0('0x2f')][_0x44e0('0x3b')]+'%'};return _0x1a10bc;}})});}_0x5244ae=_[_0x44e0('0x3d')]({},_0x5244ae,_0x2093d9[_0x44e0('0x3e')]);var _0x51d4ac={'where':_0x5244ae[_0x44e0('0x39')]};return db['ServicenowAccount'][_0x44e0('0x1d')](_0x51d4ac)[_0x44e0('0x23')](function(_0x3027b6){_0x25248c['count']=_0x3027b6;if(_0x2093d9['query'][_0x44e0('0x3f')]){_0x5244ae[_0x44e0('0x40')]=[{'all':!![]}];}return db[_0x44e0('0x2a')][_0x44e0('0x41')](_0x5244ae);})[_0x44e0('0x23')](function(_0x4f0db2){_0x25248c[_0x44e0('0x42')]=_0x4f0db2;return _0x25248c;})[_0x44e0('0x23')](respondWithFilteredResult(_0x1d2503,_0x5244ae))[_0x44e0('0x43')](handleError(_0x1d2503,null));};exports[_0x44e0('0x44')]=function(_0x2fac50,_0x26f7e7){var _0xb3c1ab={'raw':![],'where':{'id':_0x2fac50[_0x44e0('0x45')]['id']}},_0x280829={};_0x280829[_0x44e0('0x2e')]=_[_0x44e0('0x30')](db[_0x44e0('0x2a')]['rawAttributes']);_0x280829[_0x44e0('0x2f')]=_[_0x44e0('0x30')](_0x2fac50[_0x44e0('0x2f')]);_0x280829['filters']=_[_0x44e0('0x32')](_0x280829[_0x44e0('0x2e')],_0x280829[_0x44e0('0x2f')]);_0xb3c1ab['attributes']=_[_0x44e0('0x32')](_0x280829['model'],qs[_0x44e0('0x34')](_0x2fac50['query'][_0x44e0('0x34')]));_0xb3c1ab[_0x44e0('0x33')]=_0xb3c1ab[_0x44e0('0x33')][_0x44e0('0x35')]?_0xb3c1ab[_0x44e0('0x33')]:_0x280829[_0x44e0('0x2e')];if(_0x2fac50[_0x44e0('0x2f')]['includeAll']){_0xb3c1ab[_0x44e0('0x40')]=[{'all':!![]}];}_0xb3c1ab=_[_0x44e0('0x3d')]({},_0xb3c1ab,_0x2fac50[_0x44e0('0x3e')]);return db[_0x44e0('0x2a')][_0x44e0('0x46')](_0xb3c1ab)[_0x44e0('0x23')](handleEntityNotFound(_0x26f7e7,null))[_0x44e0('0x23')](respondWithResult(_0x26f7e7,null))[_0x44e0('0x43')](handleError(_0x26f7e7,null));};exports[_0x44e0('0x47')]=function(_0x692cbe,_0x496562){return db[_0x44e0('0x2a')][_0x44e0('0x47')](_0x692cbe[_0x44e0('0x48')],{})[_0x44e0('0x23')](respondWithResult(_0x496562,0xc9))['catch'](handleError(_0x496562,null));};exports['update']=function(_0x519966,_0x1c625f){if(_0x519966[_0x44e0('0x48')]['id']){delete _0x519966[_0x44e0('0x48')]['id'];}return db['ServicenowAccount'][_0x44e0('0x46')]({'where':{'id':_0x519966[_0x44e0('0x45')]['id']}})['then'](handleEntityNotFound(_0x1c625f,null))[_0x44e0('0x23')](saveUpdates(_0x519966[_0x44e0('0x48')],null))['then'](respondWithResult(_0x1c625f,null))[_0x44e0('0x43')](handleError(_0x1c625f,null));};exports[_0x44e0('0x49')]=function(_0x549048,_0x10c0d6){return db['ServicenowAccount'][_0x44e0('0x46')]({'where':{'id':_0x549048[_0x44e0('0x45')]['id']}})[_0x44e0('0x23')](handleEntityNotFound(_0x10c0d6,null))[_0x44e0('0x23')](removeEntity(_0x10c0d6,null))[_0x44e0('0x43')](handleError(_0x10c0d6,null));};exports['getConfigurations']=function(_0x3767f5,_0x100821,_0x1925f8){var _0x4364fa={};var _0x5727e6={};var _0x394c39;var _0x3dd083;return db[_0x44e0('0x2a')]['findOne']({'where':{'id':_0x3767f5[_0x44e0('0x45')]['id']}})['then'](handleEntityNotFound(_0x100821,null))['then'](function(_0x20eaff){if(_0x20eaff){_0x394c39=_0x20eaff;_0x5727e6[_0x44e0('0x2e')]=_['keys'](db[_0x44e0('0x4a')][_0x44e0('0x2b')]);_0x5727e6[_0x44e0('0x2f')]=_[_0x44e0('0x30')](_0x3767f5[_0x44e0('0x2f')]);_0x5727e6[_0x44e0('0x31')]=_[_0x44e0('0x32')](_0x5727e6[_0x44e0('0x2e')],_0x5727e6[_0x44e0('0x2f')]);_0x4364fa[_0x44e0('0x33')]=_[_0x44e0('0x32')](_0x5727e6[_0x44e0('0x2e')],qs[_0x44e0('0x34')](_0x3767f5[_0x44e0('0x2f')][_0x44e0('0x34')]));_0x4364fa[_0x44e0('0x33')]=_0x4364fa['attributes']['length']?_0x4364fa[_0x44e0('0x33')]:_0x5727e6['model'];_0x4364fa[_0x44e0('0x37')]=qs[_0x44e0('0x38')](_0x3767f5['query'][_0x44e0('0x38')]);_0x4364fa[_0x44e0('0x39')]=qs[_0x44e0('0x31')](_[_0x44e0('0x3a')](_0x3767f5[_0x44e0('0x2f')],_0x5727e6[_0x44e0('0x31')]));if(_0x3767f5[_0x44e0('0x2f')][_0x44e0('0x3b')]){_0x4364fa[_0x44e0('0x39')]=_[_0x44e0('0x3d')](_0x4364fa['where'],{'$or':_['map'](_0x4364fa['attributes'],function(_0x43aa1b){var _0x19ddfe={};_0x19ddfe[_0x43aa1b]={'$like':'%'+_0x3767f5[_0x44e0('0x2f')][_0x44e0('0x3b')]+'%'};return _0x19ddfe;})});}_0x4364fa=_[_0x44e0('0x3d')]({},_0x4364fa,_0x3767f5[_0x44e0('0x3e')]);return _0x394c39[_0x44e0('0x4b')](_0x4364fa);}})[_0x44e0('0x23')](function(_0x2832fd){if(_0x2832fd){_0x3dd083=_0x2832fd[_0x44e0('0x35')];if(!_0x3767f5[_0x44e0('0x2f')][_0x44e0('0x36')](_0x44e0('0x4c'))){_0x4364fa['limit']=qs[_0x44e0('0x1c')](_0x3767f5[_0x44e0('0x2f')][_0x44e0('0x1c')]);_0x4364fa[_0x44e0('0x1a')]=qs[_0x44e0('0x1a')](_0x3767f5[_0x44e0('0x2f')][_0x44e0('0x1a')]);}return _0x394c39[_0x44e0('0x4b')](_0x4364fa);}})['then'](function(_0x3c5a84){if(_0x3c5a84){return _0x3c5a84?{'count':_0x3dd083,'rows':_0x3c5a84}:null;}})[_0x44e0('0x23')](respondWithResult(_0x100821,null))['catch'](handleError(_0x100821,null));};exports['addConfiguration']=function(_0x4c3b7,_0x35e448,_0x14206a){if(_0x4c3b7[_0x44e0('0x48')]['id']){delete _0x4c3b7[_0x44e0('0x48')]['id'];}return db[_0x44e0('0x2a')][_0x44e0('0x4d')]({'where':{'id':_0x4c3b7[_0x44e0('0x45')]['id']}})[_0x44e0('0x23')](handleEntityNotFound(_0x35e448,null))[_0x44e0('0x23')](function(_0x14476e){if(_0x14476e){_0x4c3b7[_0x44e0('0x48')][_0x44e0('0x4e')]=_0x14476e['id'];_0x4c3b7[_0x44e0('0x48')][_0x44e0('0x4f')]=integrations[_0x44e0('0x50')](_0x4c3b7[_0x44e0('0x48')][_0x44e0('0x51')],_0x4c3b7[_0x44e0('0x48')][_0x44e0('0x2c')]);_0x4c3b7[_0x44e0('0x48')]['Descriptions']=integrations[_0x44e0('0x52')](_0x4c3b7[_0x44e0('0x48')][_0x44e0('0x51')],_0x4c3b7[_0x44e0('0x48')]['type']);return db[_0x44e0('0x4a')][_0x44e0('0x47')](_0x4c3b7[_0x44e0('0x48')],{'include':[{'model':db[_0x44e0('0x53')],'as':'Subjects'},{'model':db[_0x44e0('0x53')],'as':_0x44e0('0x54')}]});}return null;})[_0x44e0('0x23')](respondWithResult(_0x35e448,null))['catch'](handleError(_0x35e448,null));};exports[_0x44e0('0x55')]=function(_0x3e42c1,_0x4df1a1,_0x5c293e){var _0x4b637c=[_0x44e0('0x56'),'hold_reason',_0x44e0('0x57'),_0x44e0('0x58'),_0x44e0('0x59'),_0x44e0('0x5a'),_0x44e0('0x5b'),_0x44e0('0x5c'),_0x44e0('0x5d')];var _0x2b8a11=[_0x44e0('0x5e'),'made_sla','caused_by',_0x44e0('0x5f'),_0x44e0('0x60'),'sys_updated_on',_0x44e0('0x61'),_0x44e0('0x62'),_0x44e0('0x63'),'number',_0x44e0('0x64'),'sys_updated_by',_0x44e0('0x65'),_0x44e0('0x66'),_0x44e0('0x67'),_0x44e0('0x68'),_0x44e0('0x69'),_0x44e0('0x6a'),_0x44e0('0x57'),'order',_0x44e0('0x6b'),_0x44e0('0x6c'),_0x44e0('0x6d'),_0x44e0('0x6e'),_0x44e0('0x6f'),'active',_0x44e0('0x70'),_0x44e0('0x71'),'priority',_0x44e0('0x72'),_0x44e0('0x73'),_0x44e0('0x74'),_0x44e0('0x75'),_0x44e0('0x76'),'business_duration',_0x44e0('0x77'),'work_end',_0x44e0('0x78'),_0x44e0('0x79'),_0x44e0('0x7a'),_0x44e0('0x7b'),_0x44e0('0x58'),_0x44e0('0x7c'),'short_description','close_code',_0x44e0('0x7d'),'delivery_task',_0x44e0('0x7e'),_0x44e0('0x7f'),_0x44e0('0x80'),_0x44e0('0x81'),'description',_0x44e0('0x82'),_0x44e0('0x5a'),_0x44e0('0x83'),_0x44e0('0x84'),_0x44e0('0x85'),'follow_up',_0x44e0('0x86'),'sys_id',_0x44e0('0x87'),_0x44e0('0x88'),_0x44e0('0x5b'),_0x44e0('0x89'),_0x44e0('0x8a'),_0x44e0('0x8b'),_0x44e0('0x8c'),_0x44e0('0x8d'),'assigned_to','severity','comments',_0x44e0('0x8e'),'approval',_0x44e0('0x8f'),_0x44e0('0x90'),'sys_mod_count','reopen_count',_0x44e0('0x91'),_0x44e0('0x92'),_0x44e0('0x93'),_0x44e0('0x94'),_0x44e0('0x95'),_0x44e0('0x5d')];var _0x549906='';var _0x44189b='';var _0x5976bf=[];var _0x2fb6f2='';var _0x29f9b0='';var _0x935742=[];var _0x40d418='';var _0x222500='';var _0x1823a9={};var _0x3e4050='';return db[_0x44e0('0x2a')][_0x44e0('0x4d')]({'where':{'id':_0x3e42c1['params']['id']},'attributes':['id',_0x44e0('0x96'),_0x44e0('0x97'),'email',_0x44e0('0x98'),'serverUrl']})['then'](handleEntityNotFound(_0x4df1a1,null))[_0x44e0('0x23')](function(_0x265b1c){if(_0x265b1c){_0x3e4050=_0x265b1c[_0x44e0('0x98')];var _0xf374de=_0x3e4050[_0x44e0('0x99')](-0x1);if(_0xf374de==='/'){_0x3e4050=_0x3e4050[_0x44e0('0x9a')](0x0,_0x3e4050[_0x44e0('0x9b')](_0xf374de));}_0x222500=util[_0x44e0('0x9c')](_0x44e0('0x9d'),_0x3e4050);_0x40d418=util[_0x44e0('0x9c')]('%s/api/now/table/',_0x3e4050);_0x1823a9={'user':_0x265b1c[_0x44e0('0x96')],'pass':_0x265b1c[_0x44e0('0x97')]};var _0x20c891={'method':_0x44e0('0x9e'),'uri':_0x222500+_0x44e0('0x9f'),'auth':_0x1823a9,'json':!![]};return rp(_0x20c891);}})[_0x44e0('0x23')](function(_0x589dc4){if(_0x589dc4[_0x44e0('0xa0')]['length']>0x0){_0x549906=_0x589dc4['result'];}console['log'](_0x44e0('0xa1'),_0x549906);_0x935742=[];_0x44189b=Object['assign']([],_0x549906);_[_0x44e0('0xa2')](_0x44189b,function(_0x570d90){return!_0x4b637c[_0x44e0('0xa3')](_0x570d90[_0x44e0('0x27')]);});_0x44189b['forEach'](function(_0x42b0d2){var _0x32b3c2=createFieldObject(_0x40d418,_0x1823a9,_0x42b0d2['internalType'],_0x42b0d2[_0x44e0('0x27')],_0x42b0d2[_0x44e0('0xa4')],![]);_0x935742[_0x44e0('0xa5')](_0x32b3c2);});return Promise[_0x44e0('0xa6')](_0x935742);})[_0x44e0('0x23')](function(_0x5badaa){_0x5976bf=_0x5badaa;_0x2fb6f2=Object['assign']([],_0x549906);console[_0x44e0('0xa7')](_0x44e0('0xa8'),_0x549906);_[_0x44e0('0xa2')](_0x2fb6f2,function(_0x5ce4fa){return _0x2b8a11[_0x44e0('0xa3')](_0x5ce4fa[_0x44e0('0x27')]);});console[_0x44e0('0xa7')](_0x44e0('0xa9'),_0x2fb6f2);_0x935742=[];_0x2fb6f2['forEach'](function(_0x2c7157){var _0x6413e3=createFieldObject(_0x40d418,_0x1823a9,_0x2c7157[_0x44e0('0xaa')],_0x2c7157[_0x44e0('0x27')],_0x2c7157['label'],!![]);_0x935742[_0x44e0('0xa5')](_0x6413e3);});return Promise[_0x44e0('0xa6')](_0x935742);})[_0x44e0('0x23')](function(_0x333989){_0x29f9b0=_0x333989;var _0x1abfff=_0x5976bf[_0x44e0('0xab')](_0x29f9b0);return{'count':_0x1abfff[_0x44e0('0x35')],'rows':_0x1abfff};})[_0x44e0('0x23')](respondWithResult(_0x4df1a1,null))[_0x44e0('0x43')](function(_0x561e47){console[_0x44e0('0xa7')]('ServiceNow\x20error:\x20'+_0x561e47);var _0x4981eb=_0x3e42c1['query']['test']?0x1f4:_0x561e47[_0x44e0('0xac')]||0x1f4;logger[_0x44e0('0xad')](_0x561e47[_0x44e0('0x26')]);delete _0x561e47[_0x44e0('0x27')];if(_0x4981eb===0x191){_0x4981eb=0x190;}_0x4df1a1[_0x44e0('0x18')](_0x4981eb)[_0x44e0('0xae')](_0x3e42c1[_0x44e0('0x2f')][_0x44e0('0xaf')]?{'message':_0x44e0('0xb0'),'statusCode':_0x561e47[_0x44e0('0xac')]}:_0x561e47);});};function createFieldObject(_0x1e894f,_0xa94a75,_0x3cb354,_0x4a9e3c,_0x306b64,_0x2b0ea8){return new Promise(function(_0x2cd9e9,_0x3cb316){var _0xf4b4c={'id':_0x4a9e3c,'name':_0x306b64,'custom':_0x2b0ea8};if(_0x3cb354===_0x44e0('0xb1')){_0xf4b4c[_0x44e0('0x3e')]=[{'name':_0x44e0('0xb2'),'value':'true'},{'name':_0x44e0('0xb3'),'value':_0x44e0('0xb4')}];_0x2cd9e9(_0xf4b4c);}else{var _0x1ca115={'method':_0x44e0('0x9e'),'uri':_0x1e894f+_0x44e0('0xb5')+_0x4a9e3c,'auth':_0xa94a75,'json':!![]};return rp(_0x1ca115)['then'](function(_0x4ef89e){var _0x5d02a1=[];if(_0x4ef89e[_0x44e0('0xa0')]['length']>0x0){_0x4ef89e[_0x44e0('0xa0')][_0x44e0('0xb6')](function(_0x166cfa){if(_0x166cfa['inactive']===_0x44e0('0xb4')){var _0x4f61a6={'name':_0x166cfa['label'],'value':_0x166cfa[_0x44e0('0xb7')]};_0x5d02a1[_0x44e0('0xa5')](_0x4f61a6);}});}_0xf4b4c[_0x44e0('0x3e')]=_0x5d02a1;if(_0xf4b4c[_0x44e0('0x3e')]['length']>0x0){_0x2cd9e9(_0xf4b4c);}else{if(_0x2b0ea8==![]){_0x2cd9e9();}else{_0x2cd9e9(_0xf4b4c);}}});}});} \ No newline at end of file +var _0x0008=['map','ServicenowAccount','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','create','body','find','getConfigurations','findOne','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowConfiguration','ServicenowField','getFields','made_sla','hold_reason','subcategory','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','resolved_by','user_input','sys_created_on','sys_domain','state','knowledge','calendar_stc','cmdb_ci','delivery_plan','impact','active','priority','sys_domain_path','time_worked','expected_start','opened_at','business_duration','group_list','reopened_time','resolved_at','approval_set','close_code','correlation_display','delivery_task','work_start','business_stc','additional_assignee_list','sys_class_name','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','assigned_to','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','upon_approval','correlation_id','location','username','password','email','remoteUri','serverUrl','slice','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','forEach','internalType','push','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','all','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0008,0x8a));var _0x8000=function(_0x50890a,_0x3f4250){_0x50890a=_0x50890a-0x0;var _0x4579b6=_0x0008[_0x50890a];return _0x4579b6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8000('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8000('0x1'));var BPromise=require(_0x8000('0x2'));var Mustache=require(_0x8000('0x3'));var util=require(_0x8000('0x4'));var path=require(_0x8000('0x5'));var sox=require(_0x8000('0x6'));var csv=require(_0x8000('0x7'));var ejs=require(_0x8000('0x8'));var fs=require('fs');var fs_extra=require(_0x8000('0x9'));var _=require('lodash');var squel=require(_0x8000('0xa'));var crypto=require(_0x8000('0xb'));var jsforce=require(_0x8000('0xc'));var deskjs=require(_0x8000('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8000('0xe'));var Redis=require(_0x8000('0xf'));var authService=require(_0x8000('0x10'));var qs=require(_0x8000('0x11'));var as=require(_0x8000('0x12'));var hardwareService=require(_0x8000('0x13'));var logger=require(_0x8000('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8000('0x15'));var db=require(_0x8000('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x38c280,_0x204be3){_0x204be3=_0x204be3||0xcc;return function(_0x3843f2){if(_0x3843f2){return _0x38c280[_0x8000('0x17')](_0x204be3);}return _0x38c280[_0x8000('0x18')](_0x204be3)[_0x8000('0x19')]();};}function respondWithResult(_0x370040,_0x3e7194){_0x3e7194=_0x3e7194||0xc8;return function(_0x3ce636){if(_0x3ce636){return _0x370040[_0x8000('0x18')](_0x3e7194)[_0x8000('0x1a')](_0x3ce636);}};}function respondWithFilteredResult(_0x1bfed9,_0x2d6d8d){return function(_0x3e8a7d){if(_0x3e8a7d){var _0x42c03f=typeof _0x2d6d8d['offset']===_0x8000('0x1b')&&typeof _0x2d6d8d[_0x8000('0x1c')]===_0x8000('0x1b');var _0x16e92d=_0x3e8a7d['count'];var _0x503f11=_0x42c03f?0x0:_0x2d6d8d['offset'];var _0x243c51=_0x42c03f?_0x3e8a7d[_0x8000('0x1d')]:_0x2d6d8d[_0x8000('0x1e')]+_0x2d6d8d[_0x8000('0x1c')];var _0x15c63a;if(_0x243c51>=_0x16e92d){_0x243c51=_0x16e92d;_0x15c63a=0xc8;}else{_0x15c63a=0xce;}_0x1bfed9[_0x8000('0x18')](_0x15c63a);return _0x1bfed9['set'](_0x8000('0x1f'),_0x503f11+'-'+_0x243c51+'/'+_0x16e92d)[_0x8000('0x1a')](_0x3e8a7d);}return null;};}function patchUpdates(_0x3718a6){return function(_0x3d57a8){try{jsonpatch['apply'](_0x3d57a8,_0x3718a6,!![]);}catch(_0x1d331d){return BPromise[_0x8000('0x20')](_0x1d331d);}return _0x3d57a8[_0x8000('0x21')]();};}function saveUpdates(_0x38066a,_0x17cee9){return function(_0x101f9c){if(_0x101f9c){return _0x101f9c[_0x8000('0x22')](_0x38066a)[_0x8000('0x23')](function(_0x2d0783){return _0x2d0783;});}return null;};}function removeEntity(_0x598f47,_0x30e29d){return function(_0x2405e6){if(_0x2405e6){return _0x2405e6[_0x8000('0x24')]()[_0x8000('0x23')](function(){_0x598f47[_0x8000('0x18')](0xcc)[_0x8000('0x19')]();});}};}function handleEntityNotFound(_0x4be5f3,_0xfe6606){return function(_0x1838b6){if(!_0x1838b6){_0x4be5f3['sendStatus'](0x194);}return _0x1838b6;};}function handleError(_0x52b1eb,_0xc45202){_0xc45202=_0xc45202||0x1f4;return function(_0x746bc){logger[_0x8000('0x25')](_0x746bc[_0x8000('0x26')]);if(_0x746bc[_0x8000('0x27')]){delete _0x746bc[_0x8000('0x27')];}_0x52b1eb[_0x8000('0x18')](_0xc45202)[_0x8000('0x28')](_0x746bc);};}exports[_0x8000('0x29')]=function(_0x25c81f,_0x331776){var _0x185625={},_0xa255db={},_0xb036d3={'count':0x0,'rows':[]};var _0x16123f=_[_0x8000('0x2a')](db[_0x8000('0x2b')][_0x8000('0x2c')],function(_0x56d0d9){return{'name':_0x56d0d9[_0x8000('0x2d')],'type':_0x56d0d9['type']['key']};});_0xa255db[_0x8000('0x2e')]=_[_0x8000('0x2a')](_0x16123f,_0x8000('0x27'));_0xa255db['query']=_[_0x8000('0x2f')](_0x25c81f[_0x8000('0x30')]);_0xa255db[_0x8000('0x31')]=_[_0x8000('0x32')](_0xa255db[_0x8000('0x2e')],_0xa255db['query']);_0x185625[_0x8000('0x33')]=_[_0x8000('0x32')](_0xa255db[_0x8000('0x2e')],qs[_0x8000('0x34')](_0x25c81f[_0x8000('0x30')][_0x8000('0x34')]));_0x185625[_0x8000('0x33')]=_0x185625['attributes'][_0x8000('0x35')]?_0x185625[_0x8000('0x33')]:_0xa255db[_0x8000('0x2e')];if(!_0x25c81f[_0x8000('0x30')][_0x8000('0x36')]('nolimit')){_0x185625[_0x8000('0x1c')]=qs[_0x8000('0x1c')](_0x25c81f['query']['limit']);_0x185625[_0x8000('0x1e')]=qs[_0x8000('0x1e')](_0x25c81f[_0x8000('0x30')][_0x8000('0x1e')]);}_0x185625[_0x8000('0x37')]=qs[_0x8000('0x38')](_0x25c81f[_0x8000('0x30')][_0x8000('0x38')]);_0x185625[_0x8000('0x39')]=qs[_0x8000('0x31')](_[_0x8000('0x3a')](_0x25c81f['query'],_0xa255db['filters']),_0x16123f);if(_0x25c81f['query'][_0x8000('0x3b')]){_0x185625[_0x8000('0x39')]=_['merge'](_0x185625[_0x8000('0x39')],{'$or':_[_0x8000('0x2a')](_0x16123f,function(_0x9d731e){if(_0x9d731e[_0x8000('0x3c')]!==_0x8000('0x3d')){var _0x5451d2={};_0x5451d2[_0x9d731e[_0x8000('0x27')]]={'$like':'%'+_0x25c81f[_0x8000('0x30')][_0x8000('0x3b')]+'%'};return _0x5451d2;}})});}_0x185625=_[_0x8000('0x3e')]({},_0x185625,_0x25c81f[_0x8000('0x3f')]);var _0x2610a1={'where':_0x185625['where']};return db['ServicenowAccount'][_0x8000('0x1d')](_0x2610a1)[_0x8000('0x23')](function(_0x461782){_0xb036d3[_0x8000('0x1d')]=_0x461782;if(_0x25c81f[_0x8000('0x30')]['includeAll']){_0x185625[_0x8000('0x40')]=[{'all':!![]}];}return db[_0x8000('0x2b')][_0x8000('0x41')](_0x185625);})[_0x8000('0x23')](function(_0x363034){_0xb036d3[_0x8000('0x42')]=_0x363034;return _0xb036d3;})['then'](respondWithFilteredResult(_0x331776,_0x185625))[_0x8000('0x43')](handleError(_0x331776,null));};exports[_0x8000('0x44')]=function(_0x59c382,_0x3d8b66){var _0x238281={'raw':![],'where':{'id':_0x59c382[_0x8000('0x45')]['id']}},_0x22b3c7={};_0x22b3c7[_0x8000('0x2e')]=_[_0x8000('0x2f')](db['ServicenowAccount'][_0x8000('0x2c')]);_0x22b3c7[_0x8000('0x30')]=_[_0x8000('0x2f')](_0x59c382[_0x8000('0x30')]);_0x22b3c7[_0x8000('0x31')]=_[_0x8000('0x32')](_0x22b3c7[_0x8000('0x2e')],_0x22b3c7[_0x8000('0x30')]);_0x238281[_0x8000('0x33')]=_[_0x8000('0x32')](_0x22b3c7['model'],qs[_0x8000('0x34')](_0x59c382[_0x8000('0x30')]['fields']));_0x238281[_0x8000('0x33')]=_0x238281['attributes'][_0x8000('0x35')]?_0x238281[_0x8000('0x33')]:_0x22b3c7[_0x8000('0x2e')];if(_0x59c382[_0x8000('0x30')]['includeAll']){_0x238281[_0x8000('0x40')]=[{'all':!![]}];}_0x238281=_[_0x8000('0x3e')]({},_0x238281,_0x59c382[_0x8000('0x3f')]);return db['ServicenowAccount']['find'](_0x238281)[_0x8000('0x23')](handleEntityNotFound(_0x3d8b66,null))[_0x8000('0x23')](respondWithResult(_0x3d8b66,null))[_0x8000('0x43')](handleError(_0x3d8b66,null));};exports['create']=function(_0x5b0f82,_0x4e9237){return db[_0x8000('0x2b')][_0x8000('0x46')](_0x5b0f82['body'],{})[_0x8000('0x23')](respondWithResult(_0x4e9237,0xc9))[_0x8000('0x43')](handleError(_0x4e9237,null));};exports['update']=function(_0x1d9aa1,_0x144d1d){if(_0x1d9aa1['body']['id']){delete _0x1d9aa1[_0x8000('0x47')]['id'];}return db[_0x8000('0x2b')][_0x8000('0x48')]({'where':{'id':_0x1d9aa1['params']['id']}})[_0x8000('0x23')](handleEntityNotFound(_0x144d1d,null))[_0x8000('0x23')](saveUpdates(_0x1d9aa1[_0x8000('0x47')],null))[_0x8000('0x23')](respondWithResult(_0x144d1d,null))[_0x8000('0x43')](handleError(_0x144d1d,null));};exports['destroy']=function(_0x4ecfc8,_0x9ce06a){return db[_0x8000('0x2b')][_0x8000('0x48')]({'where':{'id':_0x4ecfc8[_0x8000('0x45')]['id']}})['then'](handleEntityNotFound(_0x9ce06a,null))[_0x8000('0x23')](removeEntity(_0x9ce06a,null))[_0x8000('0x43')](handleError(_0x9ce06a,null));};exports[_0x8000('0x49')]=function(_0x1efd45,_0x15c04a,_0x50f7fa){var _0xab4328={};var _0x3899c3={};var _0x14062e;var _0x51bd37;return db[_0x8000('0x2b')][_0x8000('0x4a')]({'where':{'id':_0x1efd45[_0x8000('0x45')]['id']}})['then'](handleEntityNotFound(_0x15c04a,null))['then'](function(_0x5a3a6f){if(_0x5a3a6f){_0x14062e=_0x5a3a6f;_0x3899c3[_0x8000('0x2e')]=_[_0x8000('0x2f')](db['ServicenowConfiguration'][_0x8000('0x2c')]);_0x3899c3[_0x8000('0x30')]=_[_0x8000('0x2f')](_0x1efd45[_0x8000('0x30')]);_0x3899c3[_0x8000('0x31')]=_[_0x8000('0x32')](_0x3899c3[_0x8000('0x2e')],_0x3899c3[_0x8000('0x30')]);_0xab4328[_0x8000('0x33')]=_[_0x8000('0x32')](_0x3899c3[_0x8000('0x2e')],qs[_0x8000('0x34')](_0x1efd45['query'][_0x8000('0x34')]));_0xab4328[_0x8000('0x33')]=_0xab4328[_0x8000('0x33')][_0x8000('0x35')]?_0xab4328['attributes']:_0x3899c3[_0x8000('0x2e')];_0xab4328[_0x8000('0x37')]=qs[_0x8000('0x38')](_0x1efd45[_0x8000('0x30')][_0x8000('0x38')]);_0xab4328['where']=qs[_0x8000('0x31')](_[_0x8000('0x3a')](_0x1efd45[_0x8000('0x30')],_0x3899c3[_0x8000('0x31')]));if(_0x1efd45[_0x8000('0x30')][_0x8000('0x3b')]){_0xab4328[_0x8000('0x39')]=_[_0x8000('0x3e')](_0xab4328[_0x8000('0x39')],{'$or':_[_0x8000('0x2a')](_0xab4328['attributes'],function(_0x305623){var _0x18f09a={};_0x18f09a[_0x305623]={'$like':'%'+_0x1efd45[_0x8000('0x30')]['filter']+'%'};return _0x18f09a;})});}_0xab4328=_[_0x8000('0x3e')]({},_0xab4328,_0x1efd45['options']);return _0x14062e['getConfigurations'](_0xab4328);}})[_0x8000('0x23')](function(_0x27ab8d){if(_0x27ab8d){_0x51bd37=_0x27ab8d[_0x8000('0x35')];if(!_0x1efd45[_0x8000('0x30')][_0x8000('0x36')](_0x8000('0x4b'))){_0xab4328[_0x8000('0x1c')]=qs[_0x8000('0x1c')](_0x1efd45[_0x8000('0x30')][_0x8000('0x1c')]);_0xab4328[_0x8000('0x1e')]=qs[_0x8000('0x1e')](_0x1efd45[_0x8000('0x30')]['offset']);}return _0x14062e['getConfigurations'](_0xab4328);}})[_0x8000('0x23')](function(_0x3ff834){if(_0x3ff834){return _0x3ff834?{'count':_0x51bd37,'rows':_0x3ff834}:null;}})[_0x8000('0x23')](respondWithResult(_0x15c04a,null))[_0x8000('0x43')](handleError(_0x15c04a,null));};exports['addConfiguration']=function(_0x3d0dc5,_0x8e29ce,_0x48d784){if(_0x3d0dc5[_0x8000('0x47')]['id']){delete _0x3d0dc5[_0x8000('0x47')]['id'];}return db['ServicenowAccount']['findOne']({'where':{'id':_0x3d0dc5[_0x8000('0x45')]['id']}})[_0x8000('0x23')](handleEntityNotFound(_0x8e29ce,null))[_0x8000('0x23')](function(_0x20c691){if(_0x20c691){_0x3d0dc5[_0x8000('0x47')][_0x8000('0x4c')]=_0x20c691['id'];_0x3d0dc5['body'][_0x8000('0x4d')]=integrations[_0x8000('0x4e')](_0x3d0dc5['body'][_0x8000('0x4f')],_0x3d0dc5[_0x8000('0x47')][_0x8000('0x3c')]);_0x3d0dc5[_0x8000('0x47')][_0x8000('0x50')]=integrations[_0x8000('0x51')](_0x3d0dc5[_0x8000('0x47')][_0x8000('0x4f')],_0x3d0dc5[_0x8000('0x47')][_0x8000('0x3c')]);return db[_0x8000('0x52')][_0x8000('0x46')](_0x3d0dc5[_0x8000('0x47')],{'include':[{'model':db['ServicenowField'],'as':_0x8000('0x4d')},{'model':db[_0x8000('0x53')],'as':_0x8000('0x50')}]});}return null;})[_0x8000('0x23')](respondWithResult(_0x8e29ce,null))[_0x8000('0x43')](handleError(_0x8e29ce,null));};exports[_0x8000('0x54')]=function(_0x1b0357,_0x24ece8,_0x410013){var _0x4a904f=[_0x8000('0x55'),_0x8000('0x56'),'knowledge',_0x8000('0x57'),'close_code',_0x8000('0x58'),_0x8000('0x59'),_0x8000('0x5a'),_0x8000('0x5b')];var _0x387f9b=[_0x8000('0x5c'),'made_sla',_0x8000('0x5d'),_0x8000('0x5e'),_0x8000('0x5f'),_0x8000('0x60'),_0x8000('0x61'),_0x8000('0x56'),'approval_history','number',_0x8000('0x62'),'sys_updated_by','opened_by',_0x8000('0x63'),_0x8000('0x64'),_0x8000('0x65'),_0x8000('0x66'),'sys_created_by',_0x8000('0x67'),_0x8000('0x37'),_0x8000('0x68'),'closed_at',_0x8000('0x69'),_0x8000('0x6a'),_0x8000('0x6b'),_0x8000('0x6c'),'work_notes_list','business_service',_0x8000('0x6d'),_0x8000('0x6e'),'rfc',_0x8000('0x6f'),_0x8000('0x70'),_0x8000('0x71'),_0x8000('0x72'),_0x8000('0x73'),'work_end',_0x8000('0x74'),_0x8000('0x75'),'caller_id',_0x8000('0x76'),_0x8000('0x57'),'work_notes','short_description',_0x8000('0x77'),_0x8000('0x78'),_0x8000('0x79'),_0x8000('0x7a'),'assignment_group',_0x8000('0x7b'),_0x8000('0x7c'),'description','calendar_duration',_0x8000('0x58'),_0x8000('0x7d'),'close_notes',_0x8000('0x7e'),_0x8000('0x7f'),_0x8000('0x80'),_0x8000('0x81'),_0x8000('0x82'),_0x8000('0x83'),'incident_state',_0x8000('0x84'),_0x8000('0x85'),_0x8000('0x86'),_0x8000('0x87'),'activity_due',_0x8000('0x88'),'severity','comments','sla_due','approval',_0x8000('0x89'),_0x8000('0x8a'),_0x8000('0x8b'),_0x8000('0x8c'),_0x8000('0x8d'),'escalation',_0x8000('0x8e'),_0x8000('0x8f'),_0x8000('0x90'),_0x8000('0x5b')];var _0x4356a5='';var _0x35c448='';var _0x33e6be=[];var _0x521af4='';var _0x247568='';var _0x4172cb=[];var _0x36a9f3='';var _0x31d041='';var _0x166f1a={};var _0x3ac5aa='';return db['ServicenowAccount']['findOne']({'where':{'id':_0x1b0357[_0x8000('0x45')]['id']},'attributes':['id',_0x8000('0x91'),_0x8000('0x92'),_0x8000('0x93'),_0x8000('0x94'),_0x8000('0x95')]})[_0x8000('0x23')](handleEntityNotFound(_0x24ece8,null))[_0x8000('0x23')](function(_0x34716e){if(_0x34716e){_0x3ac5aa=_0x34716e['remoteUri'];var _0x34d14b=_0x3ac5aa[_0x8000('0x96')](-0x1);if(_0x34d14b==='/'){_0x3ac5aa=_0x3ac5aa['substring'](0x0,_0x3ac5aa[_0x8000('0x97')](_0x34d14b));}_0x31d041=util[_0x8000('0x98')](_0x8000('0x99'),_0x3ac5aa);_0x36a9f3=util[_0x8000('0x98')](_0x8000('0x9a'),_0x3ac5aa);_0x166f1a={'user':_0x34716e[_0x8000('0x91')],'pass':_0x34716e[_0x8000('0x92')]};var _0x95ed36={'method':_0x8000('0x9b'),'uri':_0x31d041+_0x8000('0x9c'),'auth':_0x166f1a,'json':!![]};return rp(_0x95ed36);}})['then'](function(_0xb10e2b){if(_0xb10e2b[_0x8000('0x9d')][_0x8000('0x35')]>0x0){_0x4356a5=_0xb10e2b[_0x8000('0x9d')];}console[_0x8000('0x9e')](_0x8000('0x9f'),_0x4356a5);_0x4172cb=[];_0x35c448=Object[_0x8000('0xa0')]([],_0x4356a5);_[_0x8000('0xa1')](_0x35c448,function(_0x463757){return!_0x4a904f[_0x8000('0xa2')](_0x463757[_0x8000('0x27')]);});_0x35c448[_0x8000('0xa3')](function(_0xdd66f3){var _0x1a599e=createFieldObject(_0x36a9f3,_0x166f1a,_0xdd66f3[_0x8000('0xa4')],_0xdd66f3['name'],_0xdd66f3['label'],![]);_0x4172cb[_0x8000('0xa5')](_0x1a599e);});return Promise['all'](_0x4172cb);})[_0x8000('0x23')](function(_0x347778){_0x33e6be=_0x347778;_0x521af4=Object[_0x8000('0xa0')]([],_0x4356a5);console[_0x8000('0x9e')]('TCL:\x20_object',_0x4356a5);_['remove'](_0x521af4,function(_0x16edf1){return _0x387f9b[_0x8000('0xa2')](_0x16edf1['name']);});console[_0x8000('0x9e')](_0x8000('0xa6'),_0x521af4);_0x4172cb=[];_0x521af4[_0x8000('0xa3')](function(_0x140115){var _0x5b3957=createFieldObject(_0x36a9f3,_0x166f1a,_0x140115[_0x8000('0xa4')],_0x140115[_0x8000('0x27')],_0x140115[_0x8000('0xa7')],!![]);_0x4172cb[_0x8000('0xa5')](_0x5b3957);});return Promise[_0x8000('0xa8')](_0x4172cb);})[_0x8000('0x23')](function(_0x5ca0f6){_0x247568=_0x5ca0f6;var _0x357dc0=_0x33e6be[_0x8000('0xa9')](_0x247568);return{'count':_0x357dc0[_0x8000('0x35')],'rows':_0x357dc0};})['then'](respondWithResult(_0x24ece8,null))[_0x8000('0x43')](function(_0x874a32){console[_0x8000('0x9e')](_0x8000('0xaa')+_0x874a32);var _0x500243=_0x1b0357[_0x8000('0x30')][_0x8000('0xab')]?0x1f4:_0x874a32[_0x8000('0xac')]||0x1f4;logger[_0x8000('0x25')](_0x874a32[_0x8000('0x26')]);delete _0x874a32[_0x8000('0x27')];if(_0x500243===0x191){_0x500243=0x190;}_0x24ece8[_0x8000('0x18')](_0x500243)[_0x8000('0x28')](_0x1b0357[_0x8000('0x30')][_0x8000('0xab')]?{'message':_0x8000('0xad'),'statusCode':_0x874a32[_0x8000('0xac')]}:_0x874a32);});};function createFieldObject(_0x3a38f3,_0x98096b,_0x58c79c,_0x1b373f,_0x488e42,_0x582f67){return new Promise(function(_0xc6b02,_0x21c066){var _0xc25839={'id':_0x1b373f,'name':_0x488e42,'custom':_0x582f67};if(_0x58c79c===_0x8000('0xae')){_0xc25839[_0x8000('0x3f')]=[{'name':_0x8000('0xaf'),'value':_0x8000('0xb0')},{'name':_0x8000('0xb1'),'value':_0x8000('0xb2')}];_0xc6b02(_0xc25839);}else{var _0x2b47de={'method':_0x8000('0x9b'),'uri':_0x3a38f3+_0x8000('0xb3')+_0x1b373f,'auth':_0x98096b,'json':!![]};return rp(_0x2b47de)['then'](function(_0x411fd1){var _0x2a2176=[];if(_0x411fd1[_0x8000('0x9d')]['length']>0x0){_0x411fd1[_0x8000('0x9d')][_0x8000('0xa3')](function(_0x1d37cd){if(_0x1d37cd['inactive']==='false'){var _0x34bf9e={'name':_0x1d37cd['label'],'value':_0x1d37cd['value']};_0x2a2176[_0x8000('0xa5')](_0x34bf9e);}});}_0xc25839[_0x8000('0x3f')]=_0x2a2176;if(_0xc25839['options'][_0x8000('0x35')]>0x0){_0xc6b02(_0xc25839);}else{if(_0x582f67==![]){_0xc6b02();}else{_0xc6b02(_0xc25839);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 3aebe64..c0b7908 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 _0xd8fb=['../../components/integrations/configuration','define','int_servicenow_accounts','lodash','util','../../config/logger','api','path','rimraf','./intServicenowAccount.attributes'];(function(_0x13e82c,_0x372a39){var _0x54556a=function(_0x6c4801){while(--_0x6c4801){_0x13e82c['push'](_0x13e82c['shift']());}};_0x54556a(++_0x372a39);}(_0xd8fb,0x99));var _0xbd8f=function(_0x2f647d,_0x4e94df){_0x2f647d=_0x2f647d-0x0;var _0x3f201b=_0xd8fb[_0x2f647d];return _0x3f201b;};'use strict';var _=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var logger=require(_0xbd8f('0x2'))(_0xbd8f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd8f('0x4'));var rimraf=require(_0xbd8f('0x5'));var config=require('../../config/environment');var attributes=require(_0xbd8f('0x6'));var integrations=require(_0xbd8f('0x7'));module['exports']=function(_0x33d541,_0x4e97cf){return _0x33d541[_0xbd8f('0x8')]('ServicenowAccount',attributes,{'tableName':_0xbd8f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7dfd=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount'];(function(_0x2ada12,_0x582fdb){var _0x14763c=function(_0x104c2f){while(--_0x104c2f){_0x2ada12['push'](_0x2ada12['shift']());}};_0x14763c(++_0x582fdb);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var logger=require(_0xd7df('0x2'))(_0xd7df('0x3'));var moment=require(_0xd7df('0x4'));var BPromise=require(_0xd7df('0x5'));var rp=require(_0xd7df('0x6'));var fs=require('fs');var path=require(_0xd7df('0x7'));var rimraf=require(_0xd7df('0x8'));var config=require(_0xd7df('0x9'));var attributes=require(_0xd7df('0xa'));var integrations=require(_0xd7df('0xb'));module[_0xd7df('0xc')]=function(_0x39ce98,_0x354ea7){return _0x39ce98[_0xd7df('0xd')](_0xd7df('0xe'),attributes,{'tableName':'int_servicenow_accounts','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 b945cb3..58a3548 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 _0x3b2e=['error','message','ServicenowAccount,\x20%s,\x20%s','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','limit','include','map','model','attributes','stringify','find','ShowServicenowAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x128734,_0x2ddc92){var _0x49b9ec=function(_0x4d8aa9){while(--_0x4d8aa9){_0x128734['push'](_0x128734['shift']());}};_0x49b9ec(++_0x2ddc92);}(_0x3b2e,0xc6));var _0xe3b2=function(_0x5bb0ba,_0x3a1803){_0x5bb0ba=_0x5bb0ba-0x0;var _0x551a4e=_0x3b2e[_0x5bb0ba];return _0x551a4e;};'use strict';var _=require(_0xe3b2('0x0'));var util=require(_0xe3b2('0x1'));var moment=require(_0xe3b2('0x2'));var BPromise=require(_0xe3b2('0x3'));var rs=require(_0xe3b2('0x4'));var fs=require('fs');var Redis=require(_0xe3b2('0x5'));var db=require(_0xe3b2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe3b2('0x7'))(_0xe3b2('0x8'));var config=require(_0xe3b2('0x9'));var jayson=require(_0xe3b2('0xa'));var client=jayson[_0xe3b2('0xb')][_0xe3b2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47ac1d,_0x2f3276,_0x443b49){return new BPromise(function(_0x3c26dd,_0x485a42){return client['request'](_0x47ac1d,_0x443b49)[_0xe3b2('0xd')](function(_0x79ddf3){logger[_0xe3b2('0xe')]('ServicenowAccount,\x20%s,\x20%s',_0x2f3276,'request\x20sent');logger[_0xe3b2('0xf')](_0xe3b2('0x10'),_0x2f3276,_0xe3b2('0x11'),JSON['stringify'](_0x79ddf3));if(_0x79ddf3[_0xe3b2('0x12')]){if(_0x79ddf3['error']['code']===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x2f3276,_0x79ddf3[_0xe3b2('0x12')]['message']);return _0x485a42(_0x79ddf3[_0xe3b2('0x12')][_0xe3b2('0x13')]);}logger[_0xe3b2('0x12')](_0xe3b2('0x14'),_0x2f3276,_0x79ddf3['error']['message']);return _0x3c26dd(_0x79ddf3[_0xe3b2('0x12')][_0xe3b2('0x13')]);}else{logger['info'](_0xe3b2('0x14'),_0x2f3276,_0xe3b2('0x11'));_0x3c26dd(_0x79ddf3['result'][_0xe3b2('0x13')]);}})[_0xe3b2('0x15')](function(_0x325add){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x2f3276,_0x325add);_0x485a42(_0x325add);});});}exports[_0xe3b2('0x16')]=function(_0x3c66e2){var _0xb12ac0=this;return new Promise(function(_0x105e60,_0x37f90c){return db[_0xe3b2('0x17')][_0xe3b2('0x18')]({'raw':_0x3c66e2[_0xe3b2('0x19')]?_0x3c66e2['options'][_0xe3b2('0x1a')]===undefined?!![]:![]:!![],'where':_0x3c66e2[_0xe3b2('0x19')]?_0x3c66e2[_0xe3b2('0x19')][_0xe3b2('0x1b')]||null:null,'attributes':_0x3c66e2[_0xe3b2('0x19')]?_0x3c66e2[_0xe3b2('0x19')]['attributes']||null:null,'limit':_0x3c66e2[_0xe3b2('0x19')]?_0x3c66e2['options'][_0xe3b2('0x1c')]||null:null,'include':_0x3c66e2[_0xe3b2('0x19')]?_0x3c66e2[_0xe3b2('0x19')][_0xe3b2('0x1d')]?_[_0xe3b2('0x1e')](_0x3c66e2[_0xe3b2('0x19')][_0xe3b2('0x1d')],function(_0x5ca8ba){return{'model':db[_0x5ca8ba[_0xe3b2('0x1f')]],'as':_0x5ca8ba['as'],'attributes':_0x5ca8ba[_0xe3b2('0x20')],'include':_0x5ca8ba[_0xe3b2('0x1d')]?_[_0xe3b2('0x1e')](_0x5ca8ba['include'],function(_0x5b8657){return{'model':db[_0x5b8657[_0xe3b2('0x1f')]],'as':_0x5b8657['as'],'attributes':_0x5b8657['attributes'],'include':_0x5b8657[_0xe3b2('0x1d')]?_[_0xe3b2('0x1e')](_0x5b8657[_0xe3b2('0x1d')],function(_0x40829e){return{'model':db[_0x40829e[_0xe3b2('0x1f')]],'as':_0x40829e['as'],'attributes':_0x40829e[_0xe3b2('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe3b2('0xd')](function(_0x32dbc8){logger[_0xe3b2('0xe')](_0xe3b2('0x16'),_0x3c66e2);logger[_0xe3b2('0xf')](_0xe3b2('0x16'),_0x3c66e2,JSON[_0xe3b2('0x21')](_0x32dbc8));_0x105e60(_0x32dbc8);})['catch'](function(_0x1df506){logger['error'](_0xe3b2('0x16'),_0x1df506['message'],_0x3c66e2);_0x37f90c(_0xb12ac0[_0xe3b2('0x12')](0x1f4,_0x1df506['message']));});});};exports['ShowServicenowAccount']=function(_0xfbf7f){var _0x25592c=this;return new Promise(function(_0x199d4d,_0x249d53){return db[_0xe3b2('0x17')][_0xe3b2('0x22')]({'raw':_0xfbf7f[_0xe3b2('0x19')]?_0xfbf7f[_0xe3b2('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xfbf7f[_0xe3b2('0x19')]?_0xfbf7f[_0xe3b2('0x19')][_0xe3b2('0x1b')]||null:null,'attributes':_0xfbf7f['options']?_0xfbf7f[_0xe3b2('0x19')][_0xe3b2('0x20')]||null:null,'include':_0xfbf7f['options']?_0xfbf7f[_0xe3b2('0x19')][_0xe3b2('0x1d')]?_[_0xe3b2('0x1e')](_0xfbf7f[_0xe3b2('0x19')][_0xe3b2('0x1d')],function(_0xac329f){return{'model':db[_0xac329f[_0xe3b2('0x1f')]],'as':_0xac329f['as'],'attributes':_0xac329f[_0xe3b2('0x20')],'include':_0xac329f['include']?_[_0xe3b2('0x1e')](_0xac329f[_0xe3b2('0x1d')],function(_0x5ecd39){return{'model':db[_0x5ecd39[_0xe3b2('0x1f')]],'as':_0x5ecd39['as'],'attributes':_0x5ecd39[_0xe3b2('0x20')],'include':_0x5ecd39[_0xe3b2('0x1d')]?_[_0xe3b2('0x1e')](_0x5ecd39[_0xe3b2('0x1d')],function(_0x2d5668){return{'model':db[_0x2d5668[_0xe3b2('0x1f')]],'as':_0x2d5668['as'],'attributes':_0x2d5668[_0xe3b2('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe3b2('0xd')](function(_0x3b21d1){logger['info'](_0xe3b2('0x23'),_0xfbf7f);logger[_0xe3b2('0xf')]('ShowServicenowAccount',_0xfbf7f,JSON[_0xe3b2('0x21')](_0x3b21d1));_0x199d4d(_0x3b21d1);})[_0xe3b2('0x15')](function(_0x587347){logger['error'](_0xe3b2('0x23'),_0x587347[_0xe3b2('0x13')],_0xfbf7f);_0x249d53(_0x25592c[_0xe3b2('0x12')](0x1f4,_0x587347[_0xe3b2('0x13')]));});});}; \ No newline at end of file +var _0x1da3=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','GetServicenowAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','stringify','catch','ShowServicenowAccount','find'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x1da3,0x118));var _0x31da=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x1da3[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0x31da('0x0'));var moment=require(_0x31da('0x1'));var BPromise=require(_0x31da('0x2'));var rs=require(_0x31da('0x3'));var fs=require('fs');var Redis=require(_0x31da('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x31da('0x5'));var logger=require(_0x31da('0x6'))(_0x31da('0x7'));var config=require(_0x31da('0x8'));var jayson=require(_0x31da('0x9'));var client=jayson['client'][_0x31da('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f7d9e,_0x4c0741,_0x2d556b){return new BPromise(function(_0x54a46d,_0x85d762){return client[_0x31da('0xb')](_0x2f7d9e,_0x2d556b)['then'](function(_0xf3c8a3){logger[_0x31da('0xc')](_0x31da('0xd'),_0x4c0741,_0x31da('0xe'));logger[_0x31da('0xf')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x4c0741,'request\x20sent',JSON['stringify'](_0xf3c8a3));if(_0xf3c8a3['error']){if(_0xf3c8a3[_0x31da('0x10')][_0x31da('0x11')]===0x1f4){logger['error'](_0x31da('0xd'),_0x4c0741,_0xf3c8a3['error'][_0x31da('0x12')]);return _0x85d762(_0xf3c8a3[_0x31da('0x10')][_0x31da('0x12')]);}logger['error'](_0x31da('0xd'),_0x4c0741,_0xf3c8a3[_0x31da('0x10')]['message']);return _0x54a46d(_0xf3c8a3[_0x31da('0x10')]['message']);}else{logger['info'](_0x31da('0xd'),_0x4c0741,'request\x20sent');_0x54a46d(_0xf3c8a3[_0x31da('0x13')][_0x31da('0x12')]);}})['catch'](function(_0x335e9a){logger[_0x31da('0x10')](_0x31da('0xd'),_0x4c0741,_0x335e9a);_0x85d762(_0x335e9a);});});}exports[_0x31da('0x14')]=function(_0x42297a){var _0x433532=this;return new Promise(function(_0x57ab38,_0x2da445){return db['ServicenowAccount'][_0x31da('0x15')]({'raw':_0x42297a['options']?_0x42297a[_0x31da('0x16')][_0x31da('0x17')]===undefined?!![]:![]:!![],'where':_0x42297a[_0x31da('0x16')]?_0x42297a[_0x31da('0x16')][_0x31da('0x18')]||null:null,'attributes':_0x42297a[_0x31da('0x16')]?_0x42297a[_0x31da('0x16')][_0x31da('0x19')]||null:null,'limit':_0x42297a[_0x31da('0x16')]?_0x42297a[_0x31da('0x16')][_0x31da('0x1a')]||null:null,'include':_0x42297a['options']?_0x42297a[_0x31da('0x16')][_0x31da('0x1b')]?_[_0x31da('0x1c')](_0x42297a[_0x31da('0x16')][_0x31da('0x1b')],function(_0x2dc881){return{'model':db[_0x2dc881['model']],'as':_0x2dc881['as'],'attributes':_0x2dc881[_0x31da('0x19')],'include':_0x2dc881[_0x31da('0x1b')]?_[_0x31da('0x1c')](_0x2dc881[_0x31da('0x1b')],function(_0x46a28f){return{'model':db[_0x46a28f[_0x31da('0x1d')]],'as':_0x46a28f['as'],'attributes':_0x46a28f[_0x31da('0x19')],'include':_0x46a28f[_0x31da('0x1b')]?_[_0x31da('0x1c')](_0x46a28f[_0x31da('0x1b')],function(_0x50cf00){return{'model':db[_0x50cf00[_0x31da('0x1d')]],'as':_0x50cf00['as'],'attributes':_0x50cf00[_0x31da('0x19')]};}):[]};}):[]};}):[]:[]})[_0x31da('0x1e')](function(_0x1b2f2a){logger['info'](_0x31da('0x14'),_0x42297a);logger[_0x31da('0xf')](_0x31da('0x14'),_0x42297a,JSON[_0x31da('0x1f')](_0x1b2f2a));_0x57ab38(_0x1b2f2a);})[_0x31da('0x20')](function(_0x375ce9){logger['error']('GetServicenowAccount',_0x375ce9[_0x31da('0x12')],_0x42297a);_0x2da445(_0x433532[_0x31da('0x10')](0x1f4,_0x375ce9['message']));});});};exports[_0x31da('0x21')]=function(_0x175877){var _0x87de65=this;return new Promise(function(_0x1a3eab,_0x517bda){return db['ServicenowAccount'][_0x31da('0x22')]({'raw':_0x175877[_0x31da('0x16')]?_0x175877['options'][_0x31da('0x17')]===undefined?!![]:![]:!![],'where':_0x175877['options']?_0x175877[_0x31da('0x16')][_0x31da('0x18')]||null:null,'attributes':_0x175877[_0x31da('0x16')]?_0x175877[_0x31da('0x16')][_0x31da('0x19')]||null:null,'include':_0x175877['options']?_0x175877[_0x31da('0x16')][_0x31da('0x1b')]?_[_0x31da('0x1c')](_0x175877[_0x31da('0x16')][_0x31da('0x1b')],function(_0x338a6a){return{'model':db[_0x338a6a['model']],'as':_0x338a6a['as'],'attributes':_0x338a6a['attributes'],'include':_0x338a6a[_0x31da('0x1b')]?_[_0x31da('0x1c')](_0x338a6a[_0x31da('0x1b')],function(_0x39bf53){return{'model':db[_0x39bf53[_0x31da('0x1d')]],'as':_0x39bf53['as'],'attributes':_0x39bf53[_0x31da('0x19')],'include':_0x39bf53[_0x31da('0x1b')]?_[_0x31da('0x1c')](_0x39bf53[_0x31da('0x1b')],function(_0x3f099d){return{'model':db[_0x3f099d[_0x31da('0x1d')]],'as':_0x3f099d['as'],'attributes':_0x3f099d[_0x31da('0x19')]};}):[]};}):[]};}):[]:[]})[_0x31da('0x1e')](function(_0x1ca0c7){logger[_0x31da('0xc')]('ShowServicenowAccount',_0x175877);logger[_0x31da('0xf')](_0x31da('0x21'),_0x175877,JSON['stringify'](_0x1ca0c7));_0x1a3eab(_0x1ca0c7);})[_0x31da('0x20')](function(_0x51210d){logger['error'](_0x31da('0x21'),_0x51210d['message'],_0x175877);_0x517bda(_0x87de65[_0x31da('0x10')](0x1f4,_0x51210d[_0x31da('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 9b1c432..6cc0a8a 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 _0xc432=['put','update','delete','destroy','exports','multer','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','getSubjects','/:id/descriptions','getDescriptions','create'];(function(_0x417e0a,_0x446db8){var _0x223dab=function(_0x56978c){while(--_0x56978c){_0x417e0a['push'](_0x417e0a['shift']());}};_0x223dab(++_0x446db8);}(_0xc432,0x101));var _0x2c43=function(_0xa29c50,_0x4ebeaa){_0xa29c50=_0xa29c50-0x0;var _0x11437c=_0xc432[_0xa29c50];return _0x11437c;};'use strict';var multer=require(_0x2c43('0x0'));var util=require('util');var path=require(_0x2c43('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2c43('0x2')]();var fs_extra=require(_0x2c43('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2c43('0x4'));var config=require(_0x2c43('0x5'));var controller=require(_0x2c43('0x6'));router[_0x2c43('0x7')]('/',auth[_0x2c43('0x8')](),controller[_0x2c43('0x9')]);router[_0x2c43('0x7')](_0x2c43('0xa'),auth[_0x2c43('0x8')](),controller[_0x2c43('0xb')]);router[_0x2c43('0x7')]('/:id/fields',auth[_0x2c43('0x8')](),controller['getFields']);router[_0x2c43('0x7')]('/:id/subjects',auth[_0x2c43('0x8')](),controller[_0x2c43('0xc')]);router[_0x2c43('0x7')](_0x2c43('0xd'),auth['isAuthenticated'](),controller[_0x2c43('0xe')]);router['post']('/',auth[_0x2c43('0x8')](),controller[_0x2c43('0xf')]);router[_0x2c43('0x10')](_0x2c43('0xa'),auth['isAuthenticated'](),controller[_0x2c43('0x11')]);router[_0x2c43('0x12')](_0x2c43('0xa'),auth['isAuthenticated'](),controller[_0x2c43('0x13')]);module[_0x2c43('0x14')]=router; \ No newline at end of file +var _0xc97d=['exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','destroy'];(function(_0x25e29b,_0x2fa90e){var _0x13838e=function(_0x2eeb43){while(--_0x2eeb43){_0x25e29b['push'](_0x25e29b['shift']());}};_0x13838e(++_0x2fa90e);}(_0xc97d,0x121));var _0xdc97=function(_0xaa4461,_0x2aac25){_0xaa4461=_0xaa4461-0x0;var _0x4f5ff8=_0xc97d[_0xaa4461];return _0x4f5ff8;};'use strict';var multer=require('multer');var util=require(_0xdc97('0x0'));var path=require(_0xdc97('0x1'));var timeout=require('connect-timeout');var express=require(_0xdc97('0x2'));var router=express[_0xdc97('0x3')]();var fs_extra=require(_0xdc97('0x4'));var auth=require(_0xdc97('0x5'));var interaction=require(_0xdc97('0x6'));var config=require(_0xdc97('0x7'));var controller=require(_0xdc97('0x8'));router[_0xdc97('0x9')]('/',auth[_0xdc97('0xa')](),controller[_0xdc97('0xb')]);router[_0xdc97('0x9')](_0xdc97('0xc'),auth[_0xdc97('0xa')](),controller['show']);router[_0xdc97('0x9')](_0xdc97('0xd'),auth['isAuthenticated'](),controller[_0xdc97('0xe')]);router[_0xdc97('0x9')](_0xdc97('0xf'),auth[_0xdc97('0xa')](),controller[_0xdc97('0x10')]);router[_0xdc97('0x9')]('/:id/descriptions',auth[_0xdc97('0xa')](),controller[_0xdc97('0x11')]);router[_0xdc97('0x12')]('/',auth[_0xdc97('0xa')](),controller[_0xdc97('0x13')]);router[_0xdc97('0x14')](_0xdc97('0xc'),auth[_0xdc97('0xa')](),controller[_0xdc97('0x15')]);router['delete']('/:id',auth[_0xdc97('0xa')](),controller[_0xdc97('0x16')]);module[_0xdc97('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index a1fb3fb..d96d285 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 _0x0c77=['sequelize','exports','STRING'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x0c77,0x153));var _0x70c7=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x0c77[_0x311c35];return _0x5cc50c;};'use strict';var Sequelize=require(_0x70c7('0x0'));module[_0x70c7('0x1')]={'name':{'type':Sequelize[_0x70c7('0x2')]},'description':{'type':Sequelize[_0x70c7('0x2')]}}; \ No newline at end of file +var _0x23e7=['STRING'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x23e7,0x1f2));var _0x723e=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x23e7[_0x33032e];return _0x13316b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x723e('0x0')]},'description':{'type':Sequelize[_0x723e('0x0')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index b651e21..91cdf97 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 _0xb944=['query','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','attributes','length','find','create','body','catch','findOne','ServicenowField','getFields','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','save','update','then','destroy','stack','name','index','map','ServicenowConfiguration','type','key','model'];(function(_0x4677ae,_0x4d0463){var _0x30e80e=function(_0x5556d1){while(--_0x5556d1){_0x4677ae['push'](_0x4677ae['shift']());}};_0x30e80e(++_0x4d0463);}(_0xb944,0x70));var _0x4b94=function(_0x25ec49,_0x22739c){_0x25ec49=_0x25ec49-0x0;var _0x9b9e03=_0xb944[_0x25ec49];return _0x9b9e03;};'use strict';var emlformat=require(_0x4b94('0x0'));var rimraf=require(_0x4b94('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4b94('0x2'));var rp=require(_0x4b94('0x3'));var moment=require(_0x4b94('0x4'));var BPromise=require(_0x4b94('0x5'));var Mustache=require(_0x4b94('0x6'));var util=require('util');var path=require(_0x4b94('0x7'));var sox=require(_0x4b94('0x8'));var csv=require(_0x4b94('0x9'));var ejs=require(_0x4b94('0xa'));var fs=require('fs');var fs_extra=require(_0x4b94('0xb'));var _=require(_0x4b94('0xc'));var squel=require('squel');var crypto=require(_0x4b94('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4b94('0xe'));var toCsv=require(_0x4b94('0x9'));var querystring=require('querystring');var Papa=require(_0x4b94('0xf'));var Redis=require(_0x4b94('0x10'));var authService=require(_0x4b94('0x11'));var qs=require(_0x4b94('0x12'));var as=require(_0x4b94('0x13'));var hardwareService=require(_0x4b94('0x14'));var logger=require(_0x4b94('0x15'))('api');var utils=require(_0x4b94('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4b94('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48c36c,_0x376cf6){_0x376cf6=_0x376cf6||0xcc;return function(_0x5dc754){if(_0x5dc754){return _0x48c36c[_0x4b94('0x18')](_0x376cf6);}return _0x48c36c[_0x4b94('0x19')](_0x376cf6)[_0x4b94('0x1a')]();};}function respondWithResult(_0x35a356,_0x4fa295){_0x4fa295=_0x4fa295||0xc8;return function(_0x4d9551){if(_0x4d9551){return _0x35a356[_0x4b94('0x19')](_0x4fa295)[_0x4b94('0x1b')](_0x4d9551);}};}function respondWithFilteredResult(_0x196300,_0x5ebbf2){return function(_0x5e9ba9){if(_0x5e9ba9){var _0x28f908=typeof _0x5ebbf2[_0x4b94('0x1c')]==='undefined'&&typeof _0x5ebbf2[_0x4b94('0x1d')]===_0x4b94('0x1e');var _0x1b2755=_0x5e9ba9[_0x4b94('0x1f')];var _0x4cc2ec=_0x28f908?0x0:_0x5ebbf2[_0x4b94('0x1c')];var _0x2c33a5=_0x28f908?_0x5e9ba9[_0x4b94('0x1f')]:_0x5ebbf2['offset']+_0x5ebbf2[_0x4b94('0x1d')];var _0x3278ea;if(_0x2c33a5>=_0x1b2755){_0x2c33a5=_0x1b2755;_0x3278ea=0xc8;}else{_0x3278ea=0xce;}_0x196300[_0x4b94('0x19')](_0x3278ea);return _0x196300['set']('Content-Range',_0x4cc2ec+'-'+_0x2c33a5+'/'+_0x1b2755)[_0x4b94('0x1b')](_0x5e9ba9);}return null;};}function patchUpdates(_0x15ff11){return function(_0x5c7623){try{jsonpatch[_0x4b94('0x20')](_0x5c7623,_0x15ff11,!![]);}catch(_0x5a6fd9){return BPromise[_0x4b94('0x21')](_0x5a6fd9);}return _0x5c7623[_0x4b94('0x22')]();};}function saveUpdates(_0x2346b9,_0x9993a6){return function(_0x66538f){if(_0x66538f){return _0x66538f[_0x4b94('0x23')](_0x2346b9)[_0x4b94('0x24')](function(_0x576032){return _0x576032;});}return null;};}function removeEntity(_0x4d6845,_0x21c46a){return function(_0x371bdb){if(_0x371bdb){return _0x371bdb[_0x4b94('0x25')]()['then'](function(){_0x4d6845[_0x4b94('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3978c0,_0x54d22f){return function(_0x501fca){if(!_0x501fca){_0x3978c0['sendStatus'](0x194);}return _0x501fca;};}function handleError(_0x39c77c,_0x4bd202){_0x4bd202=_0x4bd202||0x1f4;return function(_0x433673){logger['error'](_0x433673[_0x4b94('0x26')]);if(_0x433673[_0x4b94('0x27')]){delete _0x433673[_0x4b94('0x27')];}_0x39c77c['status'](_0x4bd202)['send'](_0x433673);};}exports[_0x4b94('0x28')]=function(_0x47ecc5,_0x57465e){var _0x1274bf={},_0x56164b={},_0x1932ad={'count':0x0,'rows':[]};var _0x5d18c6=_[_0x4b94('0x29')](db[_0x4b94('0x2a')]['rawAttributes'],function(_0x38ee5c){return{'name':_0x38ee5c['fieldName'],'type':_0x38ee5c[_0x4b94('0x2b')][_0x4b94('0x2c')]};});_0x56164b[_0x4b94('0x2d')]=_[_0x4b94('0x29')](_0x5d18c6,_0x4b94('0x27'));_0x56164b[_0x4b94('0x2e')]=_['keys'](_0x47ecc5[_0x4b94('0x2e')]);_0x56164b['filters']=_['intersection'](_0x56164b[_0x4b94('0x2d')],_0x56164b[_0x4b94('0x2e')]);_0x1274bf['attributes']=_[_0x4b94('0x2f')](_0x56164b['model'],qs[_0x4b94('0x30')](_0x47ecc5[_0x4b94('0x2e')][_0x4b94('0x30')]));_0x1274bf['attributes']=_0x1274bf['attributes']['length']?_0x1274bf['attributes']:_0x56164b[_0x4b94('0x2d')];if(!_0x47ecc5[_0x4b94('0x2e')][_0x4b94('0x31')](_0x4b94('0x32'))){_0x1274bf[_0x4b94('0x1d')]=qs[_0x4b94('0x1d')](_0x47ecc5[_0x4b94('0x2e')][_0x4b94('0x1d')]);_0x1274bf[_0x4b94('0x1c')]=qs[_0x4b94('0x1c')](_0x47ecc5[_0x4b94('0x2e')]['offset']);}_0x1274bf[_0x4b94('0x33')]=qs['sort'](_0x47ecc5[_0x4b94('0x2e')][_0x4b94('0x34')]);_0x1274bf[_0x4b94('0x35')]=qs['filters'](_[_0x4b94('0x36')](_0x47ecc5[_0x4b94('0x2e')],_0x56164b[_0x4b94('0x37')]),_0x5d18c6);if(_0x47ecc5[_0x4b94('0x2e')][_0x4b94('0x38')]){_0x1274bf[_0x4b94('0x35')]=_[_0x4b94('0x39')](_0x1274bf[_0x4b94('0x35')],{'$or':_[_0x4b94('0x29')](_0x5d18c6,function(_0xcc980a){if(_0xcc980a['type']!==_0x4b94('0x3a')){var _0x54d79c={};_0x54d79c[_0xcc980a[_0x4b94('0x27')]]={'$like':'%'+_0x47ecc5[_0x4b94('0x2e')][_0x4b94('0x38')]+'%'};return _0x54d79c;}})});}_0x1274bf=_[_0x4b94('0x39')]({},_0x1274bf,_0x47ecc5[_0x4b94('0x3b')]);var _0x305f77={'where':_0x1274bf[_0x4b94('0x35')]};return db['ServicenowConfiguration'][_0x4b94('0x1f')](_0x305f77)[_0x4b94('0x24')](function(_0x22de4d){_0x1932ad['count']=_0x22de4d;if(_0x47ecc5[_0x4b94('0x2e')][_0x4b94('0x3c')]){_0x1274bf[_0x4b94('0x3d')]=[{'all':!![]}];}return db[_0x4b94('0x2a')][_0x4b94('0x3e')](_0x1274bf);})[_0x4b94('0x24')](function(_0x47b88a){_0x1932ad[_0x4b94('0x3f')]=_0x47b88a;return _0x1932ad;})['then'](respondWithFilteredResult(_0x57465e,_0x1274bf))['catch'](handleError(_0x57465e,null));};exports[_0x4b94('0x40')]=function(_0xb0dc71,_0x2ac58c){var _0x260167={'raw':![],'where':{'id':_0xb0dc71[_0x4b94('0x41')]['id']}},_0x27abc9={};_0x27abc9[_0x4b94('0x2d')]=_[_0x4b94('0x42')](db['ServicenowConfiguration'][_0x4b94('0x43')]);_0x27abc9[_0x4b94('0x2e')]=_[_0x4b94('0x42')](_0xb0dc71[_0x4b94('0x2e')]);_0x27abc9['filters']=_['intersection'](_0x27abc9[_0x4b94('0x2d')],_0x27abc9['query']);_0x260167[_0x4b94('0x44')]=_[_0x4b94('0x2f')](_0x27abc9[_0x4b94('0x2d')],qs[_0x4b94('0x30')](_0xb0dc71[_0x4b94('0x2e')]['fields']));_0x260167[_0x4b94('0x44')]=_0x260167[_0x4b94('0x44')][_0x4b94('0x45')]?_0x260167['attributes']:_0x27abc9[_0x4b94('0x2d')];if(_0xb0dc71[_0x4b94('0x2e')][_0x4b94('0x3c')]){_0x260167[_0x4b94('0x3d')]=[{'all':!![]}];}_0x260167=_[_0x4b94('0x39')]({},_0x260167,_0xb0dc71[_0x4b94('0x3b')]);return db['ServicenowConfiguration'][_0x4b94('0x46')](_0x260167)['then'](handleEntityNotFound(_0x2ac58c,null))[_0x4b94('0x24')](respondWithResult(_0x2ac58c,null))['catch'](handleError(_0x2ac58c,null));};exports[_0x4b94('0x47')]=function(_0x3e98a1,_0x4160c5){return db['ServicenowConfiguration'][_0x4b94('0x47')](_0x3e98a1[_0x4b94('0x48')],{})[_0x4b94('0x24')](respondWithResult(_0x4160c5,0xc9))['catch'](handleError(_0x4160c5,null));};exports[_0x4b94('0x23')]=function(_0x816ffa,_0x2812b7){if(_0x816ffa[_0x4b94('0x48')]['id']){delete _0x816ffa[_0x4b94('0x48')]['id'];}return db[_0x4b94('0x2a')][_0x4b94('0x46')]({'where':{'id':_0x816ffa[_0x4b94('0x41')]['id']}})[_0x4b94('0x24')](handleEntityNotFound(_0x2812b7,null))[_0x4b94('0x24')](saveUpdates(_0x816ffa[_0x4b94('0x48')],null))[_0x4b94('0x24')](respondWithResult(_0x2812b7,null))[_0x4b94('0x49')](handleError(_0x2812b7,null));};exports[_0x4b94('0x25')]=function(_0x3d003d,_0x46a6b4){return db['ServicenowConfiguration'][_0x4b94('0x46')]({'where':{'id':_0x3d003d['params']['id']}})[_0x4b94('0x24')](handleEntityNotFound(_0x46a6b4,null))[_0x4b94('0x24')](removeEntity(_0x46a6b4,null))[_0x4b94('0x49')](handleError(_0x46a6b4,null));};exports['getFields']=function(_0x4fdbe0,_0x12b729,_0x577295){var _0x164832={};var _0x377335={};var _0x34450f;var _0x5a2de3;return db[_0x4b94('0x2a')][_0x4b94('0x4a')]({'where':{'id':_0x4fdbe0[_0x4b94('0x41')]['id']}})[_0x4b94('0x24')](handleEntityNotFound(_0x12b729,null))[_0x4b94('0x24')](function(_0x13e7b2){if(_0x13e7b2){_0x34450f=_0x13e7b2;_0x377335[_0x4b94('0x2d')]=_[_0x4b94('0x42')](db[_0x4b94('0x4b')][_0x4b94('0x43')]);_0x377335[_0x4b94('0x2e')]=_[_0x4b94('0x42')](_0x4fdbe0[_0x4b94('0x2e')]);_0x377335[_0x4b94('0x37')]=_['intersection'](_0x377335[_0x4b94('0x2d')],_0x377335['query']);_0x164832[_0x4b94('0x44')]=_[_0x4b94('0x2f')](_0x377335['model'],qs[_0x4b94('0x30')](_0x4fdbe0[_0x4b94('0x2e')][_0x4b94('0x30')]));_0x164832['attributes']=_0x164832[_0x4b94('0x44')][_0x4b94('0x45')]?_0x164832[_0x4b94('0x44')]:_0x377335[_0x4b94('0x2d')];_0x164832['order']=qs[_0x4b94('0x34')](_0x4fdbe0['query'][_0x4b94('0x34')]);_0x164832[_0x4b94('0x35')]=qs['filters'](_['pick'](_0x4fdbe0[_0x4b94('0x2e')],_0x377335['filters']));if(_0x4fdbe0[_0x4b94('0x2e')][_0x4b94('0x38')]){_0x164832[_0x4b94('0x35')]=_[_0x4b94('0x39')](_0x164832[_0x4b94('0x35')],{'$or':_['map'](_0x164832[_0x4b94('0x44')],function(_0x1c0874){var _0x589c31={};_0x589c31[_0x1c0874]={'$like':'%'+_0x4fdbe0['query'][_0x4b94('0x38')]+'%'};return _0x589c31;})});}_0x164832=_[_0x4b94('0x39')]({},_0x164832,_0x4fdbe0[_0x4b94('0x3b')]);return _0x34450f[_0x4b94('0x4c')](_0x164832);}})[_0x4b94('0x24')](function(_0x3283b3){if(_0x3283b3){_0x5a2de3=_0x3283b3['length'];if(!_0x4fdbe0['query'][_0x4b94('0x31')]('nolimit')){_0x164832[_0x4b94('0x1d')]=qs['limit'](_0x4fdbe0[_0x4b94('0x2e')][_0x4b94('0x1d')]);_0x164832[_0x4b94('0x1c')]=qs[_0x4b94('0x1c')](_0x4fdbe0[_0x4b94('0x2e')][_0x4b94('0x1c')]);}return _0x34450f['getFields'](_0x164832);}})['then'](function(_0x4703b1){if(_0x4703b1){return _0x4703b1?{'count':_0x5a2de3,'rows':_0x4703b1}:null;}})['then'](respondWithResult(_0x12b729,null))[_0x4b94('0x49')](handleError(_0x12b729,null));};exports[_0x4b94('0x4d')]=function(_0x35e6a2,_0x3250d9,_0x1e37df){var _0x5cda1a={};var _0x4e9a14={};var _0x453fff;var _0x1e4d10;return db[_0x4b94('0x2a')][_0x4b94('0x4a')]({'where':{'id':_0x35e6a2[_0x4b94('0x41')]['id']}})[_0x4b94('0x24')](handleEntityNotFound(_0x3250d9,null))['then'](function(_0x35b822){if(_0x35b822){_0x453fff=_0x35b822;_0x4e9a14[_0x4b94('0x2d')]=_['keys'](db[_0x4b94('0x4b')]['rawAttributes']);_0x4e9a14['query']=_[_0x4b94('0x42')](_0x35e6a2[_0x4b94('0x2e')]);_0x4e9a14[_0x4b94('0x37')]=_[_0x4b94('0x2f')](_0x4e9a14['model'],_0x4e9a14[_0x4b94('0x2e')]);_0x5cda1a[_0x4b94('0x44')]=_[_0x4b94('0x2f')](_0x4e9a14[_0x4b94('0x2d')],qs['fields'](_0x35e6a2[_0x4b94('0x2e')]['fields']));_0x5cda1a[_0x4b94('0x44')]=_0x5cda1a[_0x4b94('0x44')][_0x4b94('0x45')]?_0x5cda1a['attributes']:_0x4e9a14[_0x4b94('0x2d')];_0x5cda1a[_0x4b94('0x33')]=qs[_0x4b94('0x34')](_0x35e6a2[_0x4b94('0x2e')]['sort']);_0x5cda1a['where']=qs['filters'](_[_0x4b94('0x36')](_0x35e6a2[_0x4b94('0x2e')],_0x4e9a14[_0x4b94('0x37')]));if(_0x35e6a2[_0x4b94('0x2e')]['filter']){_0x5cda1a[_0x4b94('0x35')]=_[_0x4b94('0x39')](_0x5cda1a[_0x4b94('0x35')],{'$or':_[_0x4b94('0x29')](_0x5cda1a[_0x4b94('0x44')],function(_0x3702f1){var _0x541bad={};_0x541bad[_0x3702f1]={'$like':'%'+_0x35e6a2[_0x4b94('0x2e')][_0x4b94('0x38')]+'%'};return _0x541bad;})});}_0x5cda1a=_[_0x4b94('0x39')]({},_0x5cda1a,_0x35e6a2[_0x4b94('0x3b')]);return _0x453fff['getSubjects'](_0x5cda1a);}})['then'](function(_0x56f8ee){if(_0x56f8ee){_0x1e4d10=_0x56f8ee[_0x4b94('0x45')];if(!_0x35e6a2['query'][_0x4b94('0x31')](_0x4b94('0x32'))){_0x5cda1a['limit']=qs[_0x4b94('0x1d')](_0x35e6a2[_0x4b94('0x2e')][_0x4b94('0x1d')]);_0x5cda1a[_0x4b94('0x1c')]=qs[_0x4b94('0x1c')](_0x35e6a2[_0x4b94('0x2e')][_0x4b94('0x1c')]);}return _0x453fff[_0x4b94('0x4d')](_0x5cda1a);}})[_0x4b94('0x24')](function(_0x5c5676){if(_0x5c5676){return _0x5c5676?{'count':_0x1e4d10,'rows':_0x5c5676}:null;}})[_0x4b94('0x24')](respondWithResult(_0x3250d9,null))[_0x4b94('0x49')](handleError(_0x3250d9,null));};exports[_0x4b94('0x4e')]=function(_0x51d470,_0x2e9fa4,_0x2638cc){var _0x53ca8d={};var _0x15a8db={};var _0x1a3401;var _0xf21a92;return db[_0x4b94('0x2a')][_0x4b94('0x4a')]({'where':{'id':_0x51d470[_0x4b94('0x41')]['id']}})[_0x4b94('0x24')](handleEntityNotFound(_0x2e9fa4,null))[_0x4b94('0x24')](function(_0x476e40){if(_0x476e40){_0x1a3401=_0x476e40;_0x15a8db['model']=_[_0x4b94('0x42')](db[_0x4b94('0x4b')][_0x4b94('0x43')]);_0x15a8db[_0x4b94('0x2e')]=_[_0x4b94('0x42')](_0x51d470[_0x4b94('0x2e')]);_0x15a8db[_0x4b94('0x37')]=_['intersection'](_0x15a8db['model'],_0x15a8db[_0x4b94('0x2e')]);_0x53ca8d[_0x4b94('0x44')]=_['intersection'](_0x15a8db[_0x4b94('0x2d')],qs[_0x4b94('0x30')](_0x51d470[_0x4b94('0x2e')][_0x4b94('0x30')]));_0x53ca8d['attributes']=_0x53ca8d[_0x4b94('0x44')]['length']?_0x53ca8d[_0x4b94('0x44')]:_0x15a8db[_0x4b94('0x2d')];_0x53ca8d['order']=qs[_0x4b94('0x34')](_0x51d470[_0x4b94('0x2e')][_0x4b94('0x34')]);_0x53ca8d['where']=qs['filters'](_[_0x4b94('0x36')](_0x51d470[_0x4b94('0x2e')],_0x15a8db[_0x4b94('0x37')]));if(_0x51d470[_0x4b94('0x2e')][_0x4b94('0x38')]){_0x53ca8d[_0x4b94('0x35')]=_[_0x4b94('0x39')](_0x53ca8d[_0x4b94('0x35')],{'$or':_['map'](_0x53ca8d[_0x4b94('0x44')],function(_0x55e648){var _0xcbccb9={};_0xcbccb9[_0x55e648]={'$like':'%'+_0x51d470[_0x4b94('0x2e')][_0x4b94('0x38')]+'%'};return _0xcbccb9;})});}_0x53ca8d=_['merge']({},_0x53ca8d,_0x51d470[_0x4b94('0x3b')]);return _0x1a3401[_0x4b94('0x4e')](_0x53ca8d);}})['then'](function(_0x4b45a5){if(_0x4b45a5){_0xf21a92=_0x4b45a5[_0x4b94('0x45')];if(!_0x51d470[_0x4b94('0x2e')][_0x4b94('0x31')]('nolimit')){_0x53ca8d[_0x4b94('0x1d')]=qs['limit'](_0x51d470[_0x4b94('0x2e')][_0x4b94('0x1d')]);_0x53ca8d[_0x4b94('0x1c')]=qs[_0x4b94('0x1c')](_0x51d470['query'][_0x4b94('0x1c')]);}return _0x1a3401['getDescriptions'](_0x53ca8d);}})[_0x4b94('0x24')](function(_0x5ae6da){if(_0x5ae6da){return _0x5ae6da?{'count':_0xf21a92,'rows':_0x5ae6da}:null;}})['then'](respondWithResult(_0x2e9fa4,null))[_0x4b94('0x49')](handleError(_0x2e9fa4,null));}; \ No newline at end of file +var _0x2218=['find','create','body','params','getFields','findOne','ServicenowField','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','destroy','error','stack','name','index','map','ServicenowConfiguration','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','then','rows','catch','show','rawAttributes','length'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x2218,0x194));var _0x8221=function(_0x507ac5,_0x33aaee){_0x507ac5=_0x507ac5-0x0;var _0x12c1bc=_0x2218[_0x507ac5];return _0x12c1bc;};'use strict';var emlformat=require(_0x8221('0x0'));var rimraf=require(_0x8221('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8221('0x2'));var rp=require(_0x8221('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8221('0x4'));var util=require('util');var path=require('path');var sox=require(_0x8221('0x5'));var csv=require(_0x8221('0x6'));var ejs=require(_0x8221('0x7'));var fs=require('fs');var fs_extra=require(_0x8221('0x8'));var _=require(_0x8221('0x9'));var squel=require(_0x8221('0xa'));var crypto=require(_0x8221('0xb'));var jsforce=require(_0x8221('0xc'));var deskjs=require(_0x8221('0xd'));var toCsv=require(_0x8221('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8221('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8221('0xf'));var as=require(_0x8221('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8221('0x11'))(_0x8221('0x12'));var utils=require('../../config/utils');var config=require(_0x8221('0x13'));var licenseUtil=require(_0x8221('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ad203,_0x3d6a60){_0x3d6a60=_0x3d6a60||0xcc;return function(_0xacd52d){if(_0xacd52d){return _0x4ad203[_0x8221('0x15')](_0x3d6a60);}return _0x4ad203[_0x8221('0x16')](_0x3d6a60)[_0x8221('0x17')]();};}function respondWithResult(_0x4056a0,_0x4fda0b){_0x4fda0b=_0x4fda0b||0xc8;return function(_0x5f4138){if(_0x5f4138){return _0x4056a0[_0x8221('0x16')](_0x4fda0b)['json'](_0x5f4138);}};}function respondWithFilteredResult(_0x5e1273,_0xfefa25){return function(_0x484763){if(_0x484763){var _0x4dbe36=typeof _0xfefa25[_0x8221('0x18')]===_0x8221('0x19')&&typeof _0xfefa25[_0x8221('0x1a')]===_0x8221('0x19');var _0x147010=_0x484763[_0x8221('0x1b')];var _0x20252b=_0x4dbe36?0x0:_0xfefa25[_0x8221('0x18')];var _0x1c9779=_0x4dbe36?_0x484763['count']:_0xfefa25[_0x8221('0x18')]+_0xfefa25[_0x8221('0x1a')];var _0x27bab5;if(_0x1c9779>=_0x147010){_0x1c9779=_0x147010;_0x27bab5=0xc8;}else{_0x27bab5=0xce;}_0x5e1273['status'](_0x27bab5);return _0x5e1273[_0x8221('0x1c')](_0x8221('0x1d'),_0x20252b+'-'+_0x1c9779+'/'+_0x147010)[_0x8221('0x1e')](_0x484763);}return null;};}function patchUpdates(_0x20084f){return function(_0x2735b3){try{jsonpatch[_0x8221('0x1f')](_0x2735b3,_0x20084f,!![]);}catch(_0x51afa8){return BPromise['reject'](_0x51afa8);}return _0x2735b3[_0x8221('0x20')]();};}function saveUpdates(_0x4c448e,_0x98eb69){return function(_0xece7c7){if(_0xece7c7){return _0xece7c7[_0x8221('0x21')](_0x4c448e)['then'](function(_0x4edeaf){return _0x4edeaf;});}return null;};}function removeEntity(_0x12a1dc,_0x160348){return function(_0x2e73a2){if(_0x2e73a2){return _0x2e73a2[_0x8221('0x22')]()['then'](function(){_0x12a1dc[_0x8221('0x16')](0xcc)[_0x8221('0x17')]();});}};}function handleEntityNotFound(_0x2f2b1f,_0x3f637c){return function(_0x8b2e27){if(!_0x8b2e27){_0x2f2b1f[_0x8221('0x15')](0x194);}return _0x8b2e27;};}function handleError(_0x726b8f,_0xbdd350){_0xbdd350=_0xbdd350||0x1f4;return function(_0x476d3d){logger[_0x8221('0x23')](_0x476d3d[_0x8221('0x24')]);if(_0x476d3d['name']){delete _0x476d3d[_0x8221('0x25')];}_0x726b8f[_0x8221('0x16')](_0xbdd350)['send'](_0x476d3d);};}exports[_0x8221('0x26')]=function(_0x548bb7,_0x3025e4){var _0x51245f={},_0x33184a={},_0x1937c9={'count':0x0,'rows':[]};var _0xca4393=_[_0x8221('0x27')](db[_0x8221('0x28')]['rawAttributes'],function(_0x853eec){return{'name':_0x853eec[_0x8221('0x29')],'type':_0x853eec[_0x8221('0x2a')][_0x8221('0x2b')]};});_0x33184a[_0x8221('0x2c')]=_[_0x8221('0x27')](_0xca4393,'name');_0x33184a[_0x8221('0x2d')]=_[_0x8221('0x2e')](_0x548bb7[_0x8221('0x2d')]);_0x33184a['filters']=_[_0x8221('0x2f')](_0x33184a[_0x8221('0x2c')],_0x33184a[_0x8221('0x2d')]);_0x51245f[_0x8221('0x30')]=_['intersection'](_0x33184a[_0x8221('0x2c')],qs[_0x8221('0x31')](_0x548bb7[_0x8221('0x2d')][_0x8221('0x31')]));_0x51245f['attributes']=_0x51245f['attributes']['length']?_0x51245f[_0x8221('0x30')]:_0x33184a['model'];if(!_0x548bb7[_0x8221('0x2d')][_0x8221('0x32')](_0x8221('0x33'))){_0x51245f[_0x8221('0x1a')]=qs['limit'](_0x548bb7[_0x8221('0x2d')][_0x8221('0x1a')]);_0x51245f[_0x8221('0x18')]=qs[_0x8221('0x18')](_0x548bb7[_0x8221('0x2d')][_0x8221('0x18')]);}_0x51245f[_0x8221('0x34')]=qs[_0x8221('0x35')](_0x548bb7[_0x8221('0x2d')][_0x8221('0x35')]);_0x51245f[_0x8221('0x36')]=qs['filters'](_[_0x8221('0x37')](_0x548bb7[_0x8221('0x2d')],_0x33184a[_0x8221('0x38')]),_0xca4393);if(_0x548bb7['query'][_0x8221('0x39')]){_0x51245f[_0x8221('0x36')]=_[_0x8221('0x3a')](_0x51245f[_0x8221('0x36')],{'$or':_['map'](_0xca4393,function(_0x45ef4c){if(_0x45ef4c['type']!==_0x8221('0x3b')){var _0x4cb26e={};_0x4cb26e[_0x45ef4c[_0x8221('0x25')]]={'$like':'%'+_0x548bb7[_0x8221('0x2d')][_0x8221('0x39')]+'%'};return _0x4cb26e;}})});}_0x51245f=_[_0x8221('0x3a')]({},_0x51245f,_0x548bb7[_0x8221('0x3c')]);var _0x269486={'where':_0x51245f[_0x8221('0x36')]};return db['ServicenowConfiguration'][_0x8221('0x1b')](_0x269486)['then'](function(_0x49915c){_0x1937c9[_0x8221('0x1b')]=_0x49915c;if(_0x548bb7[_0x8221('0x2d')][_0x8221('0x3d')]){_0x51245f[_0x8221('0x3e')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x8221('0x3f')](_0x51245f);})[_0x8221('0x40')](function(_0x455a42){_0x1937c9[_0x8221('0x41')]=_0x455a42;return _0x1937c9;})[_0x8221('0x40')](respondWithFilteredResult(_0x3025e4,_0x51245f))[_0x8221('0x42')](handleError(_0x3025e4,null));};exports[_0x8221('0x43')]=function(_0x13e50d,_0xd9822e){var _0x5ca95a={'raw':![],'where':{'id':_0x13e50d['params']['id']}},_0x1f357c={};_0x1f357c[_0x8221('0x2c')]=_[_0x8221('0x2e')](db[_0x8221('0x28')][_0x8221('0x44')]);_0x1f357c['query']=_[_0x8221('0x2e')](_0x13e50d[_0x8221('0x2d')]);_0x1f357c[_0x8221('0x38')]=_[_0x8221('0x2f')](_0x1f357c['model'],_0x1f357c['query']);_0x5ca95a[_0x8221('0x30')]=_['intersection'](_0x1f357c[_0x8221('0x2c')],qs['fields'](_0x13e50d[_0x8221('0x2d')][_0x8221('0x31')]));_0x5ca95a[_0x8221('0x30')]=_0x5ca95a[_0x8221('0x30')][_0x8221('0x45')]?_0x5ca95a['attributes']:_0x1f357c[_0x8221('0x2c')];if(_0x13e50d[_0x8221('0x2d')][_0x8221('0x3d')]){_0x5ca95a[_0x8221('0x3e')]=[{'all':!![]}];}_0x5ca95a=_[_0x8221('0x3a')]({},_0x5ca95a,_0x13e50d[_0x8221('0x3c')]);return db[_0x8221('0x28')][_0x8221('0x46')](_0x5ca95a)[_0x8221('0x40')](handleEntityNotFound(_0xd9822e,null))[_0x8221('0x40')](respondWithResult(_0xd9822e,null))['catch'](handleError(_0xd9822e,null));};exports[_0x8221('0x47')]=function(_0x6f027f,_0x686408){return db[_0x8221('0x28')][_0x8221('0x47')](_0x6f027f['body'],{})[_0x8221('0x40')](respondWithResult(_0x686408,0xc9))['catch'](handleError(_0x686408,null));};exports[_0x8221('0x21')]=function(_0xcd0fcc,_0x4065a3){if(_0xcd0fcc[_0x8221('0x48')]['id']){delete _0xcd0fcc[_0x8221('0x48')]['id'];}return db[_0x8221('0x28')][_0x8221('0x46')]({'where':{'id':_0xcd0fcc[_0x8221('0x49')]['id']}})[_0x8221('0x40')](handleEntityNotFound(_0x4065a3,null))[_0x8221('0x40')](saveUpdates(_0xcd0fcc[_0x8221('0x48')],null))[_0x8221('0x40')](respondWithResult(_0x4065a3,null))['catch'](handleError(_0x4065a3,null));};exports[_0x8221('0x22')]=function(_0x48a904,_0x3c0a3d){return db[_0x8221('0x28')][_0x8221('0x46')]({'where':{'id':_0x48a904[_0x8221('0x49')]['id']}})[_0x8221('0x40')](handleEntityNotFound(_0x3c0a3d,null))[_0x8221('0x40')](removeEntity(_0x3c0a3d,null))[_0x8221('0x42')](handleError(_0x3c0a3d,null));};exports[_0x8221('0x4a')]=function(_0x49d41b,_0x250350,_0x3eb8c4){var _0xf3484d={};var _0x570270={};var _0x4165b1;var _0x3554bc;return db['ServicenowConfiguration'][_0x8221('0x4b')]({'where':{'id':_0x49d41b[_0x8221('0x49')]['id']}})[_0x8221('0x40')](handleEntityNotFound(_0x250350,null))[_0x8221('0x40')](function(_0x1d3af4){if(_0x1d3af4){_0x4165b1=_0x1d3af4;_0x570270[_0x8221('0x2c')]=_[_0x8221('0x2e')](db[_0x8221('0x4c')][_0x8221('0x44')]);_0x570270[_0x8221('0x2d')]=_[_0x8221('0x2e')](_0x49d41b[_0x8221('0x2d')]);_0x570270[_0x8221('0x38')]=_[_0x8221('0x2f')](_0x570270[_0x8221('0x2c')],_0x570270['query']);_0xf3484d[_0x8221('0x30')]=_[_0x8221('0x2f')](_0x570270[_0x8221('0x2c')],qs[_0x8221('0x31')](_0x49d41b['query'][_0x8221('0x31')]));_0xf3484d[_0x8221('0x30')]=_0xf3484d[_0x8221('0x30')][_0x8221('0x45')]?_0xf3484d[_0x8221('0x30')]:_0x570270[_0x8221('0x2c')];_0xf3484d[_0x8221('0x34')]=qs[_0x8221('0x35')](_0x49d41b[_0x8221('0x2d')][_0x8221('0x35')]);_0xf3484d[_0x8221('0x36')]=qs['filters'](_['pick'](_0x49d41b[_0x8221('0x2d')],_0x570270[_0x8221('0x38')]));if(_0x49d41b[_0x8221('0x2d')]['filter']){_0xf3484d[_0x8221('0x36')]=_[_0x8221('0x3a')](_0xf3484d[_0x8221('0x36')],{'$or':_['map'](_0xf3484d['attributes'],function(_0x447b6a){var _0x55cc65={};_0x55cc65[_0x447b6a]={'$like':'%'+_0x49d41b[_0x8221('0x2d')]['filter']+'%'};return _0x55cc65;})});}_0xf3484d=_[_0x8221('0x3a')]({},_0xf3484d,_0x49d41b[_0x8221('0x3c')]);return _0x4165b1[_0x8221('0x4a')](_0xf3484d);}})['then'](function(_0x34ee29){if(_0x34ee29){_0x3554bc=_0x34ee29[_0x8221('0x45')];if(!_0x49d41b[_0x8221('0x2d')][_0x8221('0x32')](_0x8221('0x33'))){_0xf3484d[_0x8221('0x1a')]=qs[_0x8221('0x1a')](_0x49d41b[_0x8221('0x2d')]['limit']);_0xf3484d[_0x8221('0x18')]=qs[_0x8221('0x18')](_0x49d41b[_0x8221('0x2d')]['offset']);}return _0x4165b1['getFields'](_0xf3484d);}})[_0x8221('0x40')](function(_0xeab05d){if(_0xeab05d){return _0xeab05d?{'count':_0x3554bc,'rows':_0xeab05d}:null;}})[_0x8221('0x40')](respondWithResult(_0x250350,null))[_0x8221('0x42')](handleError(_0x250350,null));};exports[_0x8221('0x4d')]=function(_0xda6d72,_0x52356c,_0x35a0d6){var _0x16633b={};var _0x1c43c8={};var _0x2f057;var _0x3e1995;return db[_0x8221('0x28')]['findOne']({'where':{'id':_0xda6d72[_0x8221('0x49')]['id']}})[_0x8221('0x40')](handleEntityNotFound(_0x52356c,null))[_0x8221('0x40')](function(_0x451641){if(_0x451641){_0x2f057=_0x451641;_0x1c43c8['model']=_[_0x8221('0x2e')](db[_0x8221('0x4c')]['rawAttributes']);_0x1c43c8[_0x8221('0x2d')]=_['keys'](_0xda6d72[_0x8221('0x2d')]);_0x1c43c8[_0x8221('0x38')]=_['intersection'](_0x1c43c8[_0x8221('0x2c')],_0x1c43c8[_0x8221('0x2d')]);_0x16633b[_0x8221('0x30')]=_['intersection'](_0x1c43c8['model'],qs[_0x8221('0x31')](_0xda6d72['query'][_0x8221('0x31')]));_0x16633b[_0x8221('0x30')]=_0x16633b[_0x8221('0x30')][_0x8221('0x45')]?_0x16633b[_0x8221('0x30')]:_0x1c43c8[_0x8221('0x2c')];_0x16633b[_0x8221('0x34')]=qs[_0x8221('0x35')](_0xda6d72['query'][_0x8221('0x35')]);_0x16633b['where']=qs[_0x8221('0x38')](_[_0x8221('0x37')](_0xda6d72[_0x8221('0x2d')],_0x1c43c8[_0x8221('0x38')]));if(_0xda6d72[_0x8221('0x2d')][_0x8221('0x39')]){_0x16633b['where']=_[_0x8221('0x3a')](_0x16633b[_0x8221('0x36')],{'$or':_[_0x8221('0x27')](_0x16633b['attributes'],function(_0x395d56){var _0x3c0428={};_0x3c0428[_0x395d56]={'$like':'%'+_0xda6d72[_0x8221('0x2d')][_0x8221('0x39')]+'%'};return _0x3c0428;})});}_0x16633b=_[_0x8221('0x3a')]({},_0x16633b,_0xda6d72[_0x8221('0x3c')]);return _0x2f057[_0x8221('0x4d')](_0x16633b);}})['then'](function(_0x196494){if(_0x196494){_0x3e1995=_0x196494[_0x8221('0x45')];if(!_0xda6d72[_0x8221('0x2d')]['hasOwnProperty']('nolimit')){_0x16633b[_0x8221('0x1a')]=qs['limit'](_0xda6d72[_0x8221('0x2d')][_0x8221('0x1a')]);_0x16633b[_0x8221('0x18')]=qs[_0x8221('0x18')](_0xda6d72['query'][_0x8221('0x18')]);}return _0x2f057[_0x8221('0x4d')](_0x16633b);}})['then'](function(_0x33710e){if(_0x33710e){return _0x33710e?{'count':_0x3e1995,'rows':_0x33710e}:null;}})['then'](respondWithResult(_0x52356c,null))[_0x8221('0x42')](handleError(_0x52356c,null));};exports[_0x8221('0x4e')]=function(_0x51df2b,_0x233aaa,_0x4d1075){var _0x5fc711={};var _0x1f3777={};var _0x1529b4;var _0x431835;return db[_0x8221('0x28')]['findOne']({'where':{'id':_0x51df2b[_0x8221('0x49')]['id']}})[_0x8221('0x40')](handleEntityNotFound(_0x233aaa,null))[_0x8221('0x40')](function(_0x18a063){if(_0x18a063){_0x1529b4=_0x18a063;_0x1f3777['model']=_[_0x8221('0x2e')](db[_0x8221('0x4c')][_0x8221('0x44')]);_0x1f3777[_0x8221('0x2d')]=_['keys'](_0x51df2b[_0x8221('0x2d')]);_0x1f3777['filters']=_[_0x8221('0x2f')](_0x1f3777['model'],_0x1f3777[_0x8221('0x2d')]);_0x5fc711[_0x8221('0x30')]=_[_0x8221('0x2f')](_0x1f3777[_0x8221('0x2c')],qs[_0x8221('0x31')](_0x51df2b[_0x8221('0x2d')][_0x8221('0x31')]));_0x5fc711[_0x8221('0x30')]=_0x5fc711[_0x8221('0x30')][_0x8221('0x45')]?_0x5fc711[_0x8221('0x30')]:_0x1f3777[_0x8221('0x2c')];_0x5fc711[_0x8221('0x34')]=qs['sort'](_0x51df2b['query'][_0x8221('0x35')]);_0x5fc711[_0x8221('0x36')]=qs[_0x8221('0x38')](_['pick'](_0x51df2b[_0x8221('0x2d')],_0x1f3777[_0x8221('0x38')]));if(_0x51df2b[_0x8221('0x2d')][_0x8221('0x39')]){_0x5fc711['where']=_[_0x8221('0x3a')](_0x5fc711[_0x8221('0x36')],{'$or':_[_0x8221('0x27')](_0x5fc711[_0x8221('0x30')],function(_0x5cb4c0){var _0x503237={};_0x503237[_0x5cb4c0]={'$like':'%'+_0x51df2b[_0x8221('0x2d')][_0x8221('0x39')]+'%'};return _0x503237;})});}_0x5fc711=_[_0x8221('0x3a')]({},_0x5fc711,_0x51df2b[_0x8221('0x3c')]);return _0x1529b4[_0x8221('0x4e')](_0x5fc711);}})[_0x8221('0x40')](function(_0x1e931b){if(_0x1e931b){_0x431835=_0x1e931b[_0x8221('0x45')];if(!_0x51df2b[_0x8221('0x2d')][_0x8221('0x32')](_0x8221('0x33'))){_0x5fc711[_0x8221('0x1a')]=qs[_0x8221('0x1a')](_0x51df2b[_0x8221('0x2d')][_0x8221('0x1a')]);_0x5fc711['offset']=qs['offset'](_0x51df2b[_0x8221('0x2d')][_0x8221('0x18')]);}return _0x1529b4[_0x8221('0x4e')](_0x5fc711);}})[_0x8221('0x40')](function(_0x4c30e4){if(_0x4c30e4){return _0x4c30e4?{'count':_0x431835,'rows':_0x4c30e4}:null;}})[_0x8221('0x40')](respondWithResult(_0x233aaa,null))[_0x8221('0x42')](handleError(_0x233aaa,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index f835b51..aae1dd2 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 _0xb09d=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash'];(function(_0x40288c,_0x3e6aea){var _0x110c89=function(_0x1b6c0e){while(--_0x1b6c0e){_0x40288c['push'](_0x40288c['shift']());}};_0x110c89(++_0x3e6aea);}(_0xb09d,0xed));var _0xdb09=function(_0x2b07ef,_0x4052c6){_0x2b07ef=_0x2b07ef-0x0;var _0x3bad2f=_0xb09d[_0x2b07ef];return _0x3bad2f;};'use strict';var _=require(_0xdb09('0x0'));var util=require(_0xdb09('0x1'));var logger=require(_0xdb09('0x2'))(_0xdb09('0x3'));var moment=require(_0xdb09('0x4'));var BPromise=require(_0xdb09('0x5'));var rp=require(_0xdb09('0x6'));var fs=require('fs');var path=require(_0xdb09('0x7'));var rimraf=require('rimraf');var config=require(_0xdb09('0x8'));var attributes=require(_0xdb09('0x9'));module[_0xdb09('0xa')]=function(_0xd2e98f,_0x181d74){return _0xd2e98f[_0xdb09('0xb')](_0xdb09('0xc'),attributes,{'tableName':_0xdb09('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd7d1=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x8397fa,_0x3b6c41){_0x8397fa=_0x8397fa-0x0;var _0x40299b=_0xd7d1[_0x8397fa];return _0x40299b;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var logger=require(_0x1d7d('0x2'))(_0x1d7d('0x3'));var moment=require(_0x1d7d('0x4'));var BPromise=require(_0x1d7d('0x5'));var rp=require(_0x1d7d('0x6'));var fs=require('fs');var path=require(_0x1d7d('0x7'));var rimraf=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var attributes=require(_0x1d7d('0xa'));module[_0x1d7d('0xb')]=function(_0x14b2b9,_0x5a8cf3){return _0x14b2b9[_0x1d7d('0xc')](_0x1d7d('0xd'),attributes,{'tableName':_0x1d7d('0xe'),'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 94c3681..15fe75c 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 _0x2842=['error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x14c145,_0x4d6c50){var _0x4ee1bd=function(_0x5c4a06){while(--_0x5c4a06){_0x14c145['push'](_0x14c145['shift']());}};_0x4ee1bd(++_0x4d6c50);}(_0x2842,0x1ba));var _0x2284=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x2842[_0x618414];return _0x21c19a;};'use strict';var _=require('lodash');var util=require(_0x2284('0x0'));var moment=require(_0x2284('0x1'));var BPromise=require(_0x2284('0x2'));var rs=require(_0x2284('0x3'));var fs=require('fs');var Redis=require(_0x2284('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2284('0x5'));var logger=require(_0x2284('0x6'))('rpc');var config=require(_0x2284('0x7'));var jayson=require(_0x2284('0x8'));var client=jayson[_0x2284('0x9')][_0x2284('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x155877,_0x2f43bf,_0x4f9375){return new BPromise(function(_0x302710,_0x4eac24){return client[_0x2284('0xb')](_0x155877,_0x4f9375)[_0x2284('0xc')](function(_0x2da66e){logger['info'](_0x2284('0xd'),_0x2f43bf,'request\x20sent');logger[_0x2284('0xe')](_0x2284('0xf'),_0x2f43bf,_0x2284('0x10'),JSON[_0x2284('0x11')](_0x2da66e));if(_0x2da66e[_0x2284('0x12')]){if(_0x2da66e[_0x2284('0x12')][_0x2284('0x13')]===0x1f4){logger['error'](_0x2284('0xd'),_0x2f43bf,_0x2da66e['error'][_0x2284('0x14')]);return _0x4eac24(_0x2da66e[_0x2284('0x12')][_0x2284('0x14')]);}logger[_0x2284('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2f43bf,_0x2da66e[_0x2284('0x12')][_0x2284('0x14')]);return _0x302710(_0x2da66e['error'][_0x2284('0x14')]);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x2f43bf,_0x2284('0x10'));_0x302710(_0x2da66e[_0x2284('0x15')][_0x2284('0x14')]);}})[_0x2284('0x16')](function(_0x138f8c){logger['error'](_0x2284('0xd'),_0x2f43bf,_0x138f8c);_0x4eac24(_0x138f8c);});});} \ No newline at end of file +var _0xaf6a=['result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x5a1e03,_0x34d5c5){var _0x265f27=function(_0x416707){while(--_0x416707){_0x5a1e03['push'](_0x5a1e03['shift']());}};_0x265f27(++_0x34d5c5);}(_0xaf6a,0x1e4));var _0xaaf6=function(_0x1ba57f,_0xb81938){_0x1ba57f=_0x1ba57f-0x0;var _0x5a7f02=_0xaf6a[_0x1ba57f];return _0x5a7f02;};'use strict';var _=require(_0xaaf6('0x0'));var util=require(_0xaaf6('0x1'));var moment=require(_0xaaf6('0x2'));var BPromise=require(_0xaaf6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaaf6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xaaf6('0x5'));var logger=require(_0xaaf6('0x6'))(_0xaaf6('0x7'));var config=require('../../config/environment');var jayson=require(_0xaaf6('0x8'));var client=jayson[_0xaaf6('0x9')][_0xaaf6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18fad8,_0x5e1447,_0x5f444c){return new BPromise(function(_0x48362d,_0x1d01b7){return client['request'](_0x18fad8,_0x5f444c)[_0xaaf6('0xb')](function(_0x22fadf){logger[_0xaaf6('0xc')](_0xaaf6('0xd'),_0x5e1447,_0xaaf6('0xe'));logger[_0xaaf6('0xf')](_0xaaf6('0x10'),_0x5e1447,_0xaaf6('0xe'),JSON['stringify'](_0x22fadf));if(_0x22fadf[_0xaaf6('0x11')]){if(_0x22fadf[_0xaaf6('0x11')][_0xaaf6('0x12')]===0x1f4){logger[_0xaaf6('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5e1447,_0x22fadf[_0xaaf6('0x11')][_0xaaf6('0x13')]);return _0x1d01b7(_0x22fadf[_0xaaf6('0x11')][_0xaaf6('0x13')]);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x5e1447,_0x22fadf['error'][_0xaaf6('0x13')]);return _0x48362d(_0x22fadf['error'][_0xaaf6('0x13')]);}else{logger[_0xaaf6('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5e1447,_0xaaf6('0xe'));_0x48362d(_0x22fadf[_0xaaf6('0x14')][_0xaaf6('0x13')]);}})['catch'](function(_0x3204d6){logger[_0xaaf6('0x11')](_0xaaf6('0xd'),_0x5e1447,_0x3204d6);_0x1d01b7(_0x3204d6);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index f758ea4..491b623 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 _0x6762=['../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x59cbb5,_0x257877){var _0x45e501=function(_0x31d154){while(--_0x31d154){_0x59cbb5['push'](_0x59cbb5['shift']());}};_0x45e501(++_0x257877);}(_0x6762,0x1ad));var _0x2676=function(_0x2b9b3a,_0x5a81bc){_0x2b9b3a=_0x2b9b3a-0x0;var _0x393639=_0x6762[_0x2b9b3a];return _0x393639;};'use strict';var multer=require(_0x2676('0x0'));var util=require(_0x2676('0x1'));var path=require(_0x2676('0x2'));var timeout=require('connect-timeout');var express=require(_0x2676('0x3'));var router=express[_0x2676('0x4')]();var fs_extra=require(_0x2676('0x5'));var auth=require(_0x2676('0x6'));var interaction=require(_0x2676('0x7'));var config=require(_0x2676('0x8'));var controller=require('./intServicenowField.controller');router[_0x2676('0x9')]('/',auth[_0x2676('0xa')](),controller['index']);router[_0x2676('0x9')](_0x2676('0xb'),auth[_0x2676('0xa')](),controller[_0x2676('0xc')]);router[_0x2676('0xd')]('/',auth['isAuthenticated'](),controller[_0x2676('0xe')]);router[_0x2676('0xf')](_0x2676('0xb'),auth[_0x2676('0xa')](),controller[_0x2676('0x10')]);router[_0x2676('0x11')]('/:id',auth[_0x2676('0xa')](),controller['destroy']);module[_0x2676('0x12')]=router; \ No newline at end of file +var _0xe6ae=['put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowField.controller','get','index','/:id','post','isAuthenticated','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe6ae,0x193));var _0xee6a=function(_0x407144,_0x93cb7a){_0x407144=_0x407144-0x0;var _0x3798d1=_0xe6ae[_0x407144];return _0x3798d1;};'use strict';var multer=require(_0xee6a('0x0'));var util=require(_0xee6a('0x1'));var path=require('path');var timeout=require(_0xee6a('0x2'));var express=require(_0xee6a('0x3'));var router=express[_0xee6a('0x4')]();var fs_extra=require(_0xee6a('0x5'));var auth=require(_0xee6a('0x6'));var interaction=require(_0xee6a('0x7'));var config=require('../../config/environment');var controller=require(_0xee6a('0x8'));router[_0xee6a('0x9')]('/',auth['isAuthenticated'](),controller[_0xee6a('0xa')]);router[_0xee6a('0x9')](_0xee6a('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xee6a('0xc')]('/',auth[_0xee6a('0xd')](),controller[_0xee6a('0xe')]);router[_0xee6a('0xf')]('/:id',auth[_0xee6a('0xd')](),controller[_0xee6a('0x10')]);router['delete'](_0xee6a('0xb'),auth[_0xee6a('0xd')](),controller[_0xee6a('0x11')]);module[_0xee6a('0x12')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index e680c0f..531e980 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 _0xa934=['STRING','sequelize','exports','ENUM','variable','keyValue','picklist','string'];(function(_0x5e49e4,_0x23fa81){var _0x376049=function(_0xa1402d){while(--_0xa1402d){_0x5e49e4['push'](_0x5e49e4['shift']());}};_0x376049(++_0x23fa81);}(_0xa934,0xf1));var _0x4a93=function(_0x1db4a3,_0x441f78){_0x1db4a3=_0x1db4a3-0x0;var _0x489b47=_0xa934[_0x1db4a3];return _0x489b47;};'use strict';var Sequelize=require(_0x4a93('0x0'));module[_0x4a93('0x1')]={'type':{'type':Sequelize[_0x4a93('0x2')]('string',_0x4a93('0x3'),'customVariable',_0x4a93('0x4'),_0x4a93('0x5')),'defaultValue':_0x4a93('0x6')},'content':{'type':Sequelize[_0x4a93('0x7')]},'key':{'type':Sequelize[_0x4a93('0x7')]},'keyType':{'type':Sequelize[_0x4a93('0x2')]('string','variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4a93('0x7')]},'nameField':{'type':Sequelize[_0x4a93('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4a93('0x7')]}}; \ No newline at end of file +var _0x0d54=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x34967e,_0x11f483){var _0x406971=function(_0xc805e3){while(--_0xc805e3){_0x34967e['push'](_0x34967e['shift']());}};_0x406971(++_0x11f483);}(_0x0d54,0x11a));var _0x40d5=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0x0d54[_0x432fca];return _0x3adba4;};'use strict';var Sequelize=require(_0x40d5('0x0'));module[_0x40d5('0x1')]={'type':{'type':Sequelize[_0x40d5('0x2')](_0x40d5('0x3'),_0x40d5('0x4'),_0x40d5('0x5'),_0x40d5('0x6'),_0x40d5('0x7')),'defaultValue':_0x40d5('0x3')},'content':{'type':Sequelize[_0x40d5('0x8')]},'key':{'type':Sequelize[_0x40d5('0x8')]},'keyType':{'type':Sequelize[_0x40d5('0x2')]('string',_0x40d5('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x40d5('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x40d5('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 6fa9fb9..57ef047 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 _0x6ae1=['save','then','destroy','sendStatus','name','status','send','index','ServicenowField','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject'];(function(_0x47c901,_0x16799f){var _0x5f15c8=function(_0x2b4c7b){while(--_0x2b4c7b){_0x47c901['push'](_0x47c901['shift']());}};_0x5f15c8(++_0x16799f);}(_0x6ae1,0x1e5));var _0x16ae=function(_0x4d1ce1,_0x1b1ce9){_0x4d1ce1=_0x4d1ce1-0x0;var _0x51b93e=_0x6ae1[_0x4d1ce1];return _0x51b93e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x16ae('0x0'));var jsonpatch=require(_0x16ae('0x1'));var rp=require(_0x16ae('0x2'));var moment=require(_0x16ae('0x3'));var BPromise=require(_0x16ae('0x4'));var Mustache=require(_0x16ae('0x5'));var util=require(_0x16ae('0x6'));var path=require(_0x16ae('0x7'));var sox=require('sox');var csv=require(_0x16ae('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x16ae('0x9'));var squel=require('squel');var crypto=require(_0x16ae('0xa'));var jsforce=require(_0x16ae('0xb'));var deskjs=require(_0x16ae('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x16ae('0xd'));var Redis=require(_0x16ae('0xe'));var authService=require(_0x16ae('0xf'));var qs=require(_0x16ae('0x10'));var as=require(_0x16ae('0x11'));var hardwareService=require(_0x16ae('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x16ae('0x13'));var config=require(_0x16ae('0x14'));var licenseUtil=require(_0x16ae('0x15'));var db=require(_0x16ae('0x16'))['db'];function respondWithStatusCode(_0x41c5f8,_0x566ce0){_0x566ce0=_0x566ce0||0xcc;return function(_0x364e63){if(_0x364e63){return _0x41c5f8['sendStatus'](_0x566ce0);}return _0x41c5f8['status'](_0x566ce0)[_0x16ae('0x17')]();};}function respondWithResult(_0x2d94c7,_0x382572){_0x382572=_0x382572||0xc8;return function(_0x2000f7){if(_0x2000f7){return _0x2d94c7['status'](_0x382572)[_0x16ae('0x18')](_0x2000f7);}};}function respondWithFilteredResult(_0x1fd1b2,_0x9ba0b9){return function(_0x11a09a){if(_0x11a09a){var _0xb01941=typeof _0x9ba0b9['offset']===_0x16ae('0x19')&&typeof _0x9ba0b9[_0x16ae('0x1a')]===_0x16ae('0x19');var _0x1d975c=_0x11a09a[_0x16ae('0x1b')];var _0x4a6aa5=_0xb01941?0x0:_0x9ba0b9[_0x16ae('0x1c')];var _0x512379=_0xb01941?_0x11a09a[_0x16ae('0x1b')]:_0x9ba0b9['offset']+_0x9ba0b9[_0x16ae('0x1a')];var _0x48a450;if(_0x512379>=_0x1d975c){_0x512379=_0x1d975c;_0x48a450=0xc8;}else{_0x48a450=0xce;}_0x1fd1b2['status'](_0x48a450);return _0x1fd1b2[_0x16ae('0x1d')](_0x16ae('0x1e'),_0x4a6aa5+'-'+_0x512379+'/'+_0x1d975c)['json'](_0x11a09a);}return null;};}function patchUpdates(_0x54316b){return function(_0x2cadb7){try{jsonpatch[_0x16ae('0x1f')](_0x2cadb7,_0x54316b,!![]);}catch(_0x232157){return BPromise[_0x16ae('0x20')](_0x232157);}return _0x2cadb7[_0x16ae('0x21')]();};}function saveUpdates(_0x8e87f3,_0x5737e0){return function(_0x5a3703){if(_0x5a3703){return _0x5a3703['update'](_0x8e87f3)[_0x16ae('0x22')](function(_0x3e91e1){return _0x3e91e1;});}return null;};}function removeEntity(_0x45ff6c,_0x3e4c04){return function(_0xd83571){if(_0xd83571){return _0xd83571[_0x16ae('0x23')]()['then'](function(){_0x45ff6c['status'](0xcc)[_0x16ae('0x17')]();});}};}function handleEntityNotFound(_0x3fafee,_0x14d198){return function(_0x46d703){if(!_0x46d703){_0x3fafee[_0x16ae('0x24')](0x194);}return _0x46d703;};}function handleError(_0x17faa8,_0x5e0a5f){_0x5e0a5f=_0x5e0a5f||0x1f4;return function(_0x1e1cbc){logger['error'](_0x1e1cbc['stack']);if(_0x1e1cbc[_0x16ae('0x25')]){delete _0x1e1cbc['name'];}_0x17faa8[_0x16ae('0x26')](_0x5e0a5f)[_0x16ae('0x27')](_0x1e1cbc);};}exports[_0x16ae('0x28')]=function(_0xbaae37,_0x25e604){var _0x452e60={},_0x54d720={},_0x57b257={'count':0x0,'rows':[]};var _0x336bfe=_['map'](db[_0x16ae('0x29')][_0x16ae('0x2a')],function(_0x445464){return{'name':_0x445464[_0x16ae('0x2b')],'type':_0x445464[_0x16ae('0x2c')][_0x16ae('0x2d')]};});_0x54d720[_0x16ae('0x2e')]=_[_0x16ae('0x2f')](_0x336bfe,_0x16ae('0x25'));_0x54d720[_0x16ae('0x30')]=_[_0x16ae('0x31')](_0xbaae37[_0x16ae('0x30')]);_0x54d720[_0x16ae('0x32')]=_[_0x16ae('0x33')](_0x54d720['model'],_0x54d720[_0x16ae('0x30')]);_0x452e60[_0x16ae('0x34')]=_[_0x16ae('0x33')](_0x54d720[_0x16ae('0x2e')],qs[_0x16ae('0x35')](_0xbaae37['query'][_0x16ae('0x35')]));_0x452e60[_0x16ae('0x34')]=_0x452e60[_0x16ae('0x34')]['length']?_0x452e60[_0x16ae('0x34')]:_0x54d720[_0x16ae('0x2e')];if(!_0xbaae37['query']['hasOwnProperty'](_0x16ae('0x36'))){_0x452e60[_0x16ae('0x1a')]=qs[_0x16ae('0x1a')](_0xbaae37[_0x16ae('0x30')][_0x16ae('0x1a')]);_0x452e60[_0x16ae('0x1c')]=qs[_0x16ae('0x1c')](_0xbaae37[_0x16ae('0x30')][_0x16ae('0x1c')]);}_0x452e60[_0x16ae('0x37')]=qs[_0x16ae('0x38')](_0xbaae37[_0x16ae('0x30')][_0x16ae('0x38')]);_0x452e60[_0x16ae('0x39')]=qs[_0x16ae('0x32')](_[_0x16ae('0x3a')](_0xbaae37[_0x16ae('0x30')],_0x54d720['filters']),_0x336bfe);if(_0xbaae37['query']['filter']){_0x452e60[_0x16ae('0x39')]=_[_0x16ae('0x3b')](_0x452e60[_0x16ae('0x39')],{'$or':_[_0x16ae('0x2f')](_0x336bfe,function(_0x43f1c3){if(_0x43f1c3['type']!==_0x16ae('0x3c')){var _0xb7f795={};_0xb7f795[_0x43f1c3['name']]={'$like':'%'+_0xbaae37[_0x16ae('0x30')][_0x16ae('0x3d')]+'%'};return _0xb7f795;}})});}_0x452e60=_[_0x16ae('0x3b')]({},_0x452e60,_0xbaae37[_0x16ae('0x3e')]);var _0x2ff4f9={'where':_0x452e60[_0x16ae('0x39')]};return db['ServicenowField'][_0x16ae('0x1b')](_0x2ff4f9)[_0x16ae('0x22')](function(_0xa88156){_0x57b257[_0x16ae('0x1b')]=_0xa88156;if(_0xbaae37[_0x16ae('0x30')][_0x16ae('0x3f')]){_0x452e60[_0x16ae('0x40')]=[{'all':!![]}];}return db[_0x16ae('0x29')][_0x16ae('0x41')](_0x452e60);})['then'](function(_0x4a4109){_0x57b257[_0x16ae('0x42')]=_0x4a4109;return _0x57b257;})[_0x16ae('0x22')](respondWithFilteredResult(_0x25e604,_0x452e60))[_0x16ae('0x43')](handleError(_0x25e604,null));};exports[_0x16ae('0x44')]=function(_0x250434,_0x534945){var _0x8c6d28={'raw':!![],'where':{'id':_0x250434['params']['id']}},_0x429785={};_0x429785[_0x16ae('0x2e')]=_[_0x16ae('0x31')](db[_0x16ae('0x29')][_0x16ae('0x2a')]);_0x429785[_0x16ae('0x30')]=_[_0x16ae('0x31')](_0x250434[_0x16ae('0x30')]);_0x429785[_0x16ae('0x32')]=_[_0x16ae('0x33')](_0x429785[_0x16ae('0x2e')],_0x429785[_0x16ae('0x30')]);_0x8c6d28['attributes']=_[_0x16ae('0x33')](_0x429785[_0x16ae('0x2e')],qs['fields'](_0x250434[_0x16ae('0x30')]['fields']));_0x8c6d28[_0x16ae('0x34')]=_0x8c6d28[_0x16ae('0x34')][_0x16ae('0x45')]?_0x8c6d28[_0x16ae('0x34')]:_0x429785[_0x16ae('0x2e')];if(_0x250434[_0x16ae('0x30')][_0x16ae('0x3f')]){_0x8c6d28[_0x16ae('0x40')]=[{'all':!![]}];}_0x8c6d28=_[_0x16ae('0x3b')]({},_0x8c6d28,_0x250434[_0x16ae('0x3e')]);return db[_0x16ae('0x29')][_0x16ae('0x46')](_0x8c6d28)[_0x16ae('0x22')](handleEntityNotFound(_0x534945,null))[_0x16ae('0x22')](respondWithResult(_0x534945,null))[_0x16ae('0x43')](handleError(_0x534945,null));};exports[_0x16ae('0x47')]=function(_0x24ecb9,_0x3d698a){return db[_0x16ae('0x29')]['create'](_0x24ecb9[_0x16ae('0x48')],{})['then'](respondWithResult(_0x3d698a,0xc9))[_0x16ae('0x43')](handleError(_0x3d698a,null));};exports['update']=function(_0x5b9f9f,_0xbfbd07){if(_0x5b9f9f['body']['id']){delete _0x5b9f9f['body']['id'];}return db[_0x16ae('0x29')]['find']({'where':{'id':_0x5b9f9f['params']['id']}})[_0x16ae('0x22')](handleEntityNotFound(_0xbfbd07,null))[_0x16ae('0x22')](saveUpdates(_0x5b9f9f['body'],null))[_0x16ae('0x22')](respondWithResult(_0xbfbd07,null))[_0x16ae('0x43')](handleError(_0xbfbd07,null));};exports[_0x16ae('0x23')]=function(_0x5bf236,_0x680efd){return db['ServicenowField'][_0x16ae('0x46')]({'where':{'id':_0x5bf236[_0x16ae('0x49')]['id']}})[_0x16ae('0x22')](handleEntityNotFound(_0x680efd,null))[_0x16ae('0x22')](removeEntity(_0x680efd,null))[_0x16ae('0x43')](handleError(_0x680efd,null));}; \ No newline at end of file +var _0x04b9=['save','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','ServicenowField','findAll','catch','show','params','includeAll','include','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','end','status','json','limit','undefined','count','offset','Content-Range','apply','reject'];(function(_0x138287,_0x3731c3){var _0x59aa05=function(_0x104d69){while(--_0x104d69){_0x138287['push'](_0x138287['shift']());}};_0x59aa05(++_0x3731c3);}(_0x04b9,0xfc));var _0x904b=function(_0x408eb1,_0x46e892){_0x408eb1=_0x408eb1-0x0;var _0x554531=_0x04b9[_0x408eb1];return _0x554531;};'use strict';var emlformat=require(_0x904b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x904b('0x1'));var jsonpatch=require(_0x904b('0x2'));var rp=require(_0x904b('0x3'));var moment=require(_0x904b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x904b('0x5'));var path=require(_0x904b('0x6'));var sox=require(_0x904b('0x7'));var csv=require(_0x904b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x904b('0x9'));var squel=require(_0x904b('0xa'));var crypto=require(_0x904b('0xb'));var jsforce=require(_0x904b('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x904b('0xd'));var Papa=require('papaparse');var Redis=require(_0x904b('0xe'));var authService=require(_0x904b('0xf'));var qs=require(_0x904b('0x10'));var as=require(_0x904b('0x11'));var hardwareService=require(_0x904b('0x12'));var logger=require(_0x904b('0x13'))(_0x904b('0x14'));var utils=require('../../config/utils');var config=require(_0x904b('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53cafd,_0x58a345){_0x58a345=_0x58a345||0xcc;return function(_0x1035c2){if(_0x1035c2){return _0x53cafd['sendStatus'](_0x58a345);}return _0x53cafd['status'](_0x58a345)[_0x904b('0x16')]();};}function respondWithResult(_0x13f25c,_0x4ca948){_0x4ca948=_0x4ca948||0xc8;return function(_0x2fc6b9){if(_0x2fc6b9){return _0x13f25c[_0x904b('0x17')](_0x4ca948)[_0x904b('0x18')](_0x2fc6b9);}};}function respondWithFilteredResult(_0x1cc906,_0x48d44f){return function(_0x1d9dfc){if(_0x1d9dfc){var _0x56cd66=typeof _0x48d44f['offset']==='undefined'&&typeof _0x48d44f[_0x904b('0x19')]===_0x904b('0x1a');var _0x4c2864=_0x1d9dfc[_0x904b('0x1b')];var _0x35c895=_0x56cd66?0x0:_0x48d44f[_0x904b('0x1c')];var _0x5a7e29=_0x56cd66?_0x1d9dfc[_0x904b('0x1b')]:_0x48d44f['offset']+_0x48d44f['limit'];var _0x2d6527;if(_0x5a7e29>=_0x4c2864){_0x5a7e29=_0x4c2864;_0x2d6527=0xc8;}else{_0x2d6527=0xce;}_0x1cc906[_0x904b('0x17')](_0x2d6527);return _0x1cc906['set'](_0x904b('0x1d'),_0x35c895+'-'+_0x5a7e29+'/'+_0x4c2864)[_0x904b('0x18')](_0x1d9dfc);}return null;};}function patchUpdates(_0x18ac22){return function(_0x33b141){try{jsonpatch[_0x904b('0x1e')](_0x33b141,_0x18ac22,!![]);}catch(_0x49aaf1){return BPromise[_0x904b('0x1f')](_0x49aaf1);}return _0x33b141[_0x904b('0x20')]();};}function saveUpdates(_0x23e50f,_0x3e7b69){return function(_0x4f2700){if(_0x4f2700){return _0x4f2700[_0x904b('0x21')](_0x23e50f)[_0x904b('0x22')](function(_0xe6fa38){return _0xe6fa38;});}return null;};}function removeEntity(_0x1bd898,_0x2912f0){return function(_0x5a6c95){if(_0x5a6c95){return _0x5a6c95[_0x904b('0x23')]()[_0x904b('0x22')](function(){_0x1bd898[_0x904b('0x17')](0xcc)[_0x904b('0x16')]();});}};}function handleEntityNotFound(_0xa95c8d,_0x1cbf33){return function(_0x404907){if(!_0x404907){_0xa95c8d[_0x904b('0x24')](0x194);}return _0x404907;};}function handleError(_0x362b1a,_0x507310){_0x507310=_0x507310||0x1f4;return function(_0x4ecf6d){logger[_0x904b('0x25')](_0x4ecf6d[_0x904b('0x26')]);if(_0x4ecf6d[_0x904b('0x27')]){delete _0x4ecf6d[_0x904b('0x27')];}_0x362b1a[_0x904b('0x17')](_0x507310)[_0x904b('0x28')](_0x4ecf6d);};}exports[_0x904b('0x29')]=function(_0xeff840,_0x44f96f){var _0x288590={},_0xc7af54={},_0x2ec83c={'count':0x0,'rows':[]};var _0x506172=_['map'](db['ServicenowField'][_0x904b('0x2a')],function(_0x15cf5e){return{'name':_0x15cf5e[_0x904b('0x2b')],'type':_0x15cf5e[_0x904b('0x2c')]['key']};});_0xc7af54[_0x904b('0x2d')]=_[_0x904b('0x2e')](_0x506172,'name');_0xc7af54[_0x904b('0x2f')]=_[_0x904b('0x30')](_0xeff840[_0x904b('0x2f')]);_0xc7af54[_0x904b('0x31')]=_[_0x904b('0x32')](_0xc7af54[_0x904b('0x2d')],_0xc7af54[_0x904b('0x2f')]);_0x288590[_0x904b('0x33')]=_[_0x904b('0x32')](_0xc7af54[_0x904b('0x2d')],qs[_0x904b('0x34')](_0xeff840[_0x904b('0x2f')]['fields']));_0x288590[_0x904b('0x33')]=_0x288590[_0x904b('0x33')][_0x904b('0x35')]?_0x288590[_0x904b('0x33')]:_0xc7af54[_0x904b('0x2d')];if(!_0xeff840[_0x904b('0x2f')]['hasOwnProperty'](_0x904b('0x36'))){_0x288590[_0x904b('0x19')]=qs[_0x904b('0x19')](_0xeff840['query'][_0x904b('0x19')]);_0x288590[_0x904b('0x1c')]=qs['offset'](_0xeff840[_0x904b('0x2f')][_0x904b('0x1c')]);}_0x288590['order']=qs[_0x904b('0x37')](_0xeff840[_0x904b('0x2f')]['sort']);_0x288590[_0x904b('0x38')]=qs[_0x904b('0x31')](_[_0x904b('0x39')](_0xeff840[_0x904b('0x2f')],_0xc7af54['filters']),_0x506172);if(_0xeff840[_0x904b('0x2f')]['filter']){_0x288590[_0x904b('0x38')]=_[_0x904b('0x3a')](_0x288590['where'],{'$or':_[_0x904b('0x2e')](_0x506172,function(_0x428dac){if(_0x428dac[_0x904b('0x2c')]!==_0x904b('0x3b')){var _0x48f53b={};_0x48f53b[_0x428dac[_0x904b('0x27')]]={'$like':'%'+_0xeff840[_0x904b('0x2f')][_0x904b('0x3c')]+'%'};return _0x48f53b;}})});}_0x288590=_[_0x904b('0x3a')]({},_0x288590,_0xeff840['options']);var _0x516f8b={'where':_0x288590[_0x904b('0x38')]};return db[_0x904b('0x3d')][_0x904b('0x1b')](_0x516f8b)[_0x904b('0x22')](function(_0x4cd8fd){_0x2ec83c['count']=_0x4cd8fd;if(_0xeff840[_0x904b('0x2f')]['includeAll']){_0x288590['include']=[{'all':!![]}];}return db[_0x904b('0x3d')][_0x904b('0x3e')](_0x288590);})[_0x904b('0x22')](function(_0x50f50e){_0x2ec83c['rows']=_0x50f50e;return _0x2ec83c;})[_0x904b('0x22')](respondWithFilteredResult(_0x44f96f,_0x288590))[_0x904b('0x3f')](handleError(_0x44f96f,null));};exports[_0x904b('0x40')]=function(_0x526964,_0x4ea1bc){var _0x281f57={'raw':!![],'where':{'id':_0x526964[_0x904b('0x41')]['id']}},_0x3a33b0={};_0x3a33b0[_0x904b('0x2d')]=_[_0x904b('0x30')](db[_0x904b('0x3d')]['rawAttributes']);_0x3a33b0['query']=_['keys'](_0x526964[_0x904b('0x2f')]);_0x3a33b0['filters']=_[_0x904b('0x32')](_0x3a33b0['model'],_0x3a33b0[_0x904b('0x2f')]);_0x281f57[_0x904b('0x33')]=_[_0x904b('0x32')](_0x3a33b0[_0x904b('0x2d')],qs[_0x904b('0x34')](_0x526964[_0x904b('0x2f')][_0x904b('0x34')]));_0x281f57[_0x904b('0x33')]=_0x281f57['attributes']['length']?_0x281f57[_0x904b('0x33')]:_0x3a33b0[_0x904b('0x2d')];if(_0x526964[_0x904b('0x2f')][_0x904b('0x42')]){_0x281f57[_0x904b('0x43')]=[{'all':!![]}];}_0x281f57=_[_0x904b('0x3a')]({},_0x281f57,_0x526964['options']);return db[_0x904b('0x3d')][_0x904b('0x44')](_0x281f57)['then'](handleEntityNotFound(_0x4ea1bc,null))[_0x904b('0x22')](respondWithResult(_0x4ea1bc,null))[_0x904b('0x3f')](handleError(_0x4ea1bc,null));};exports[_0x904b('0x45')]=function(_0x362ab7,_0x15c186){return db[_0x904b('0x3d')]['create'](_0x362ab7[_0x904b('0x46')],{})[_0x904b('0x22')](respondWithResult(_0x15c186,0xc9))[_0x904b('0x3f')](handleError(_0x15c186,null));};exports[_0x904b('0x21')]=function(_0x3f2140,_0x4e6950){if(_0x3f2140[_0x904b('0x46')]['id']){delete _0x3f2140[_0x904b('0x46')]['id'];}return db[_0x904b('0x3d')][_0x904b('0x44')]({'where':{'id':_0x3f2140[_0x904b('0x41')]['id']}})[_0x904b('0x22')](handleEntityNotFound(_0x4e6950,null))[_0x904b('0x22')](saveUpdates(_0x3f2140[_0x904b('0x46')],null))[_0x904b('0x22')](respondWithResult(_0x4e6950,null))[_0x904b('0x3f')](handleError(_0x4e6950,null));};exports[_0x904b('0x23')]=function(_0x3aceb3,_0x1c062e){return db[_0x904b('0x3d')][_0x904b('0x44')]({'where':{'id':_0x3aceb3[_0x904b('0x41')]['id']}})['then'](handleEntityNotFound(_0x1c062e,null))[_0x904b('0x22')](removeEntity(_0x1c062e,null))[_0x904b('0x3f')](handleError(_0x1c062e,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 5964423..33a955c 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 _0xa8cd=['api','moment','bluebird','request-promise','path','rimraf','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','idField','util'];(function(_0x46d232,_0x5ac7e5){var _0x52da0f=function(_0x4972f6){while(--_0x4972f6){_0x46d232['push'](_0x46d232['shift']());}};_0x52da0f(++_0x5ac7e5);}(_0xa8cd,0x1ac));var _0xda8c=function(_0x41c381,_0x1176bd){_0x41c381=_0x41c381-0x0;var _0x427981=_0xa8cd[_0x41c381];return _0x427981;};'use strict';var _=require('lodash');var util=require(_0xda8c('0x0'));var logger=require('../../config/logger')(_0xda8c('0x1'));var moment=require(_0xda8c('0x2'));var BPromise=require(_0xda8c('0x3'));var rp=require(_0xda8c('0x4'));var fs=require('fs');var path=require(_0xda8c('0x5'));var rimraf=require(_0xda8c('0x6'));var config=require('../../config/environment');var attributes=require(_0xda8c('0x7'));module[_0xda8c('0x8')]=function(_0x347b46,_0x4f4ba7){return _0x347b46[_0xda8c('0x9')](_0xda8c('0xa'),attributes,{'tableName':_0xda8c('0xb'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xda8c('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1abd=['request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3ff2f9,_0x544ba1){var _0x3b0913=function(_0x554288){while(--_0x554288){_0x3ff2f9['push'](_0x3ff2f9['shift']());}};_0x3b0913(++_0x544ba1);}(_0x1abd,0x1e0));var _0xd1ab=function(_0xd5bb22,_0x5cfccb){_0xd5bb22=_0xd5bb22-0x0;var _0x2d105a=_0x1abd[_0xd5bb22];return _0x2d105a;};'use strict';var _=require(_0xd1ab('0x0'));var util=require(_0xd1ab('0x1'));var logger=require(_0xd1ab('0x2'))(_0xd1ab('0x3'));var moment=require(_0xd1ab('0x4'));var BPromise=require(_0xd1ab('0x5'));var rp=require(_0xd1ab('0x6'));var fs=require('fs');var path=require(_0xd1ab('0x7'));var rimraf=require(_0xd1ab('0x8'));var config=require(_0xd1ab('0x9'));var attributes=require(_0xd1ab('0xa'));module[_0xd1ab('0xb')]=function(_0x4678ae,_0x93fa2){return _0x4678ae[_0xd1ab('0xc')](_0xd1ab('0xd'),attributes,{'tableName':_0xd1ab('0xe'),'paranoid':![],'indexes':[{'name':_0xd1ab('0xf'),'fields':[_0xd1ab('0x10'),_0xd1ab('0x11')],'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 974c639..7df31c7 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 _0x9ffd=['ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug'];(function(_0x46709b,_0x48d0ea){var _0x24ee56=function(_0x179e85){while(--_0x179e85){_0x46709b['push'](_0x46709b['shift']());}};_0x24ee56(++_0x48d0ea);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x415e88,_0x456823){_0x415e88=_0x415e88-0x0;var _0x159b01=_0x9ffd[_0x415e88];return _0x159b01;};'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']('ServicenowField,\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')]('ServicenowField,\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')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});} \ No newline at end of file +var _0xa9e0=['http','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\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(_0xc35c5,_0x26a75b){var _0x4d7b6b=function(_0x30de03){while(--_0x30de03){_0xc35c5['push'](_0xc35c5['shift']());}};_0x4d7b6b(++_0x26a75b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 747ded2..a232cd2 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x5c7f4a,_0x1c866a){var _0x45dd32=function(_0x50c2b1){while(--_0x50c2b1){_0x5c7f4a['push'](_0x5c7f4a['shift']());}};_0x45dd32(++_0x1c866a);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x656161,_0x16080b){var _0x8c7036=function(_0xeeb3dd){while(--_0xeeb3dd){_0x656161['push'](_0x656161['shift']());}};_0x8c7036(++_0x16080b);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 3b99eb8..e993854 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x33d30f,_0x4110d5){var _0x1d0892=function(_0x3602ce){while(--_0x3602ce){_0x33d30f['push'](_0x33d30f['shift']());}};_0x1d0892(++_0x4110d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x195a86,_0xb708b){var _0x57cd85=function(_0x4f0c19){while(--_0x4f0c19){_0x195a86['push'](_0x195a86['shift']());}};_0x57cd85(++_0xb708b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index d361a79..26f0cff 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 _0x045f=['SugarcrmAccount','rawAttributes','fieldName','key','map','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','pick','addConfiguration','AccountId','channel','type','SugarcrmConfiguration','Subjects','Descriptions','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','slice','substring','lastIndexOf','POST','format','/service/v4_1/rest.php','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','%s%s','get_module_fields','values','module_fields','remove','includes','label','endsWith','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','test','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','index'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x045f,0xce));var _0xf045=function(_0x293866,_0x33ab3e){_0x293866=_0x293866-0x0;var _0x4b33c8=_0x045f[_0x293866];return _0x4b33c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf045('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf045('0x1'));var rp=require(_0xf045('0x2'));var moment=require('moment');var BPromise=require(_0xf045('0x3'));var Mustache=require(_0xf045('0x4'));var util=require(_0xf045('0x5'));var path=require(_0xf045('0x6'));var sox=require(_0xf045('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf045('0x8'));var squel=require(_0xf045('0x9'));var crypto=require(_0xf045('0xa'));var jsforce=require(_0xf045('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf045('0xc'));var querystring=require(_0xf045('0xd'));var Papa=require(_0xf045('0xe'));var Redis=require('ioredis');var authService=require(_0xf045('0xf'));var qs=require(_0xf045('0x10'));var as=require(_0xf045('0x11'));var hardwareService=require(_0xf045('0x12'));var logger=require(_0xf045('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf045('0x14'));var db=require(_0xf045('0x15'))['db'];var integrations=require(_0xf045('0x16'));function respondWithStatusCode(_0x560a8f,_0x2dc02b){_0x2dc02b=_0x2dc02b||0xcc;return function(_0x46fc86){if(_0x46fc86){return _0x560a8f[_0xf045('0x17')](_0x2dc02b);}return _0x560a8f[_0xf045('0x18')](_0x2dc02b)['end']();};}function respondWithResult(_0x1d5d46,_0x2075d8){_0x2075d8=_0x2075d8||0xc8;return function(_0x13a8a6){if(_0x13a8a6){return _0x1d5d46['status'](_0x2075d8)[_0xf045('0x19')](_0x13a8a6);}};}function respondWithFilteredResult(_0x105f93,_0x3b2bbc){return function(_0x57286e){if(_0x57286e){var _0x16c28c=typeof _0x3b2bbc['offset']==='undefined'&&typeof _0x3b2bbc['limit']===_0xf045('0x1a');var _0x20e073=_0x57286e[_0xf045('0x1b')];var _0x20f694=_0x16c28c?0x0:_0x3b2bbc[_0xf045('0x1c')];var _0x114c16=_0x16c28c?_0x57286e[_0xf045('0x1b')]:_0x3b2bbc[_0xf045('0x1c')]+_0x3b2bbc['limit'];var _0x1e28b3;if(_0x114c16>=_0x20e073){_0x114c16=_0x20e073;_0x1e28b3=0xc8;}else{_0x1e28b3=0xce;}_0x105f93['status'](_0x1e28b3);return _0x105f93['set'](_0xf045('0x1d'),_0x20f694+'-'+_0x114c16+'/'+_0x20e073)[_0xf045('0x19')](_0x57286e);}return null;};}function patchUpdates(_0x5e71ec){return function(_0x464b07){try{jsonpatch[_0xf045('0x1e')](_0x464b07,_0x5e71ec,!![]);}catch(_0x30fb75){return BPromise[_0xf045('0x1f')](_0x30fb75);}return _0x464b07[_0xf045('0x20')]();};}function saveUpdates(_0x33c887,_0x1c2956){return function(_0x1ee45e){if(_0x1ee45e){return _0x1ee45e[_0xf045('0x21')](_0x33c887)[_0xf045('0x22')](function(_0x5ed5c1){return _0x5ed5c1;});}return null;};}function removeEntity(_0x1c8698,_0x26ea50){return function(_0xba7979){if(_0xba7979){return _0xba7979[_0xf045('0x23')]()[_0xf045('0x22')](function(){_0x1c8698[_0xf045('0x18')](0xcc)[_0xf045('0x24')]();});}};}function handleEntityNotFound(_0x1533dd,_0x83e07c){return function(_0x2ddd80){if(!_0x2ddd80){_0x1533dd[_0xf045('0x17')](0x194);}return _0x2ddd80;};}function handleError(_0x5a6a18,_0x3828cc){_0x3828cc=_0x3828cc||0x1f4;return function(_0x1017c1){logger[_0xf045('0x25')](_0x1017c1[_0xf045('0x26')]);if(_0x1017c1['name']){delete _0x1017c1['name'];}_0x5a6a18[_0xf045('0x18')](_0x3828cc)['send'](_0x1017c1);};}exports[_0xf045('0x27')]=function(_0x34e5f0,_0x403022){var _0x53d97b={},_0x5789b4={},_0x36413f={'count':0x0,'rows':[]};var _0x3e4ae2=_['map'](db[_0xf045('0x28')][_0xf045('0x29')],function(_0x28c7f9){return{'name':_0x28c7f9[_0xf045('0x2a')],'type':_0x28c7f9['type'][_0xf045('0x2b')]};});_0x5789b4['model']=_[_0xf045('0x2c')](_0x3e4ae2,_0xf045('0x2d'));_0x5789b4[_0xf045('0x2e')]=_[_0xf045('0x2f')](_0x34e5f0[_0xf045('0x2e')]);_0x5789b4[_0xf045('0x30')]=_[_0xf045('0x31')](_0x5789b4[_0xf045('0x32')],_0x5789b4['query']);_0x53d97b[_0xf045('0x33')]=_[_0xf045('0x31')](_0x5789b4['model'],qs[_0xf045('0x34')](_0x34e5f0[_0xf045('0x2e')][_0xf045('0x34')]));_0x53d97b[_0xf045('0x33')]=_0x53d97b[_0xf045('0x33')][_0xf045('0x35')]?_0x53d97b[_0xf045('0x33')]:_0x5789b4[_0xf045('0x32')];if(!_0x34e5f0[_0xf045('0x2e')][_0xf045('0x36')](_0xf045('0x37'))){_0x53d97b[_0xf045('0x38')]=qs[_0xf045('0x38')](_0x34e5f0[_0xf045('0x2e')][_0xf045('0x38')]);_0x53d97b['offset']=qs[_0xf045('0x1c')](_0x34e5f0[_0xf045('0x2e')][_0xf045('0x1c')]);}_0x53d97b[_0xf045('0x39')]=qs[_0xf045('0x3a')](_0x34e5f0['query'][_0xf045('0x3a')]);_0x53d97b[_0xf045('0x3b')]=qs['filters'](_['pick'](_0x34e5f0['query'],_0x5789b4[_0xf045('0x30')]),_0x3e4ae2);if(_0x34e5f0[_0xf045('0x2e')][_0xf045('0x3c')]){_0x53d97b[_0xf045('0x3b')]=_['merge'](_0x53d97b[_0xf045('0x3b')],{'$or':_['map'](_0x3e4ae2,function(_0x1802e7){if(_0x1802e7['type']!==_0xf045('0x3d')){var _0x9c0cba={};_0x9c0cba[_0x1802e7[_0xf045('0x2d')]]={'$like':'%'+_0x34e5f0[_0xf045('0x2e')][_0xf045('0x3c')]+'%'};return _0x9c0cba;}})});}_0x53d97b=_[_0xf045('0x3e')]({},_0x53d97b,_0x34e5f0[_0xf045('0x3f')]);var _0x44b524={'where':_0x53d97b[_0xf045('0x3b')]};return db[_0xf045('0x28')]['count'](_0x44b524)[_0xf045('0x22')](function(_0x136be8){_0x36413f[_0xf045('0x1b')]=_0x136be8;if(_0x34e5f0[_0xf045('0x2e')][_0xf045('0x40')]){_0x53d97b[_0xf045('0x41')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0xf045('0x42')](_0x53d97b);})[_0xf045('0x22')](function(_0x49dffb){_0x36413f[_0xf045('0x43')]=_0x49dffb;return _0x36413f;})[_0xf045('0x22')](respondWithFilteredResult(_0x403022,_0x53d97b))[_0xf045('0x44')](handleError(_0x403022,null));};exports[_0xf045('0x45')]=function(_0x35d868,_0x43942a){var _0x569205={'raw':![],'where':{'id':_0x35d868[_0xf045('0x46')]['id']}},_0x2d8df0={};_0x2d8df0['model']=_['keys'](db['SugarcrmAccount']['rawAttributes']);_0x2d8df0[_0xf045('0x2e')]=_['keys'](_0x35d868[_0xf045('0x2e')]);_0x2d8df0[_0xf045('0x30')]=_[_0xf045('0x31')](_0x2d8df0[_0xf045('0x32')],_0x2d8df0['query']);_0x569205[_0xf045('0x33')]=_['intersection'](_0x2d8df0[_0xf045('0x32')],qs[_0xf045('0x34')](_0x35d868['query'][_0xf045('0x34')]));_0x569205['attributes']=_0x569205['attributes'][_0xf045('0x35')]?_0x569205['attributes']:_0x2d8df0[_0xf045('0x32')];if(_0x35d868[_0xf045('0x2e')]['includeAll']){_0x569205[_0xf045('0x41')]=[{'all':!![]}];}_0x569205=_[_0xf045('0x3e')]({},_0x569205,_0x35d868[_0xf045('0x3f')]);return db[_0xf045('0x28')][_0xf045('0x47')](_0x569205)[_0xf045('0x22')](handleEntityNotFound(_0x43942a,null))['then'](respondWithResult(_0x43942a,null))['catch'](handleError(_0x43942a,null));};exports[_0xf045('0x48')]=function(_0x112b7d,_0xb6d1e8){return db[_0xf045('0x28')]['create'](_0x112b7d[_0xf045('0x49')],{})[_0xf045('0x22')](respondWithResult(_0xb6d1e8,0xc9))[_0xf045('0x44')](handleError(_0xb6d1e8,null));};exports['update']=function(_0x334f15,_0x251294){if(_0x334f15[_0xf045('0x49')]['id']){delete _0x334f15['body']['id'];}return db[_0xf045('0x28')][_0xf045('0x47')]({'where':{'id':_0x334f15[_0xf045('0x46')]['id']}})[_0xf045('0x22')](handleEntityNotFound(_0x251294,null))[_0xf045('0x22')](saveUpdates(_0x334f15[_0xf045('0x49')],null))[_0xf045('0x22')](respondWithResult(_0x251294,null))[_0xf045('0x44')](handleError(_0x251294,null));};exports[_0xf045('0x23')]=function(_0x342817,_0x1091a1){return db['SugarcrmAccount'][_0xf045('0x47')]({'where':{'id':_0x342817[_0xf045('0x46')]['id']}})[_0xf045('0x22')](handleEntityNotFound(_0x1091a1,null))[_0xf045('0x22')](removeEntity(_0x1091a1,null))[_0xf045('0x44')](handleError(_0x1091a1,null));};exports[_0xf045('0x4a')]=function(_0x30a7a3,_0x454ccb,_0x5849d8){var _0x466a95={};var _0x1483dd={};var _0xbdd014;var _0x2ce4f0;return db[_0xf045('0x28')][_0xf045('0x4b')]({'where':{'id':_0x30a7a3[_0xf045('0x46')]['id']}})['then'](handleEntityNotFound(_0x454ccb,null))[_0xf045('0x22')](function(_0xd7cdb7){if(_0xd7cdb7){_0xbdd014=_0xd7cdb7;_0x1483dd[_0xf045('0x32')]=_['keys'](db['SugarcrmConfiguration'][_0xf045('0x29')]);_0x1483dd['query']=_['keys'](_0x30a7a3[_0xf045('0x2e')]);_0x1483dd['filters']=_[_0xf045('0x31')](_0x1483dd[_0xf045('0x32')],_0x1483dd[_0xf045('0x2e')]);_0x466a95[_0xf045('0x33')]=_[_0xf045('0x31')](_0x1483dd['model'],qs[_0xf045('0x34')](_0x30a7a3[_0xf045('0x2e')][_0xf045('0x34')]));_0x466a95[_0xf045('0x33')]=_0x466a95[_0xf045('0x33')]['length']?_0x466a95[_0xf045('0x33')]:_0x1483dd['model'];_0x466a95[_0xf045('0x39')]=qs[_0xf045('0x3a')](_0x30a7a3[_0xf045('0x2e')][_0xf045('0x3a')]);_0x466a95['where']=qs[_0xf045('0x30')](_[_0xf045('0x4c')](_0x30a7a3[_0xf045('0x2e')],_0x1483dd['filters']));if(_0x30a7a3[_0xf045('0x2e')]['filter']){_0x466a95[_0xf045('0x3b')]=_[_0xf045('0x3e')](_0x466a95['where'],{'$or':_[_0xf045('0x2c')](_0x466a95[_0xf045('0x33')],function(_0x4c3682){var _0x37fb3e={};_0x37fb3e[_0x4c3682]={'$like':'%'+_0x30a7a3[_0xf045('0x2e')][_0xf045('0x3c')]+'%'};return _0x37fb3e;})});}_0x466a95=_['merge']({},_0x466a95,_0x30a7a3[_0xf045('0x3f')]);return _0xbdd014['getConfigurations'](_0x466a95);}})[_0xf045('0x22')](function(_0x58b839){if(_0x58b839){_0x2ce4f0=_0x58b839[_0xf045('0x35')];if(!_0x30a7a3['query']['hasOwnProperty'](_0xf045('0x37'))){_0x466a95[_0xf045('0x38')]=qs[_0xf045('0x38')](_0x30a7a3[_0xf045('0x2e')][_0xf045('0x38')]);_0x466a95[_0xf045('0x1c')]=qs[_0xf045('0x1c')](_0x30a7a3[_0xf045('0x2e')][_0xf045('0x1c')]);}return _0xbdd014[_0xf045('0x4a')](_0x466a95);}})[_0xf045('0x22')](function(_0x421cda){if(_0x421cda){return _0x421cda?{'count':_0x2ce4f0,'rows':_0x421cda}:null;}})[_0xf045('0x22')](respondWithResult(_0x454ccb,null))[_0xf045('0x44')](handleError(_0x454ccb,null));};exports[_0xf045('0x4d')]=function(_0x1a2bda,_0x5226f5,_0x46b7e1){if(_0x1a2bda[_0xf045('0x49')]['id']){delete _0x1a2bda[_0xf045('0x49')]['id'];}return db[_0xf045('0x28')][_0xf045('0x4b')]({'where':{'id':_0x1a2bda[_0xf045('0x46')]['id']}})[_0xf045('0x22')](handleEntityNotFound(_0x5226f5,null))[_0xf045('0x22')](function(_0x4d2074){if(_0x4d2074){_0x1a2bda[_0xf045('0x49')][_0xf045('0x4e')]=_0x4d2074['id'];_0x1a2bda[_0xf045('0x49')]['Subjects']=integrations['getSubjects'](_0x1a2bda[_0xf045('0x49')][_0xf045('0x4f')],_0x1a2bda[_0xf045('0x49')][_0xf045('0x50')]);_0x1a2bda[_0xf045('0x49')]['Descriptions']=integrations['getDescriptions'](_0x1a2bda[_0xf045('0x49')]['channel'],_0x1a2bda[_0xf045('0x49')][_0xf045('0x50')]);return db[_0xf045('0x51')][_0xf045('0x48')](_0x1a2bda[_0xf045('0x49')],{'include':[{'model':db['SugarcrmField'],'as':_0xf045('0x52')},{'model':db['SugarcrmField'],'as':_0xf045('0x53')}]});}return null;})['then'](respondWithResult(_0x5226f5,null))[_0xf045('0x44')](handleError(_0x5226f5,null));};exports[_0xf045('0x54')]=function(_0x4a14ef,_0x309b3f,_0x2ae5a0){var _0x2a1ce5='';var _0x4d2c58=['id',_0xf045('0x2d'),_0xf045('0x55'),_0xf045('0x56'),_0xf045('0x57'),_0xf045('0x58'),_0xf045('0x59'),_0xf045('0x5a'),_0xf045('0x5b'),_0xf045('0x5c'),_0xf045('0x5d'),_0xf045('0x5e')];return db['SugarcrmAccount']['findOne']({'where':{'id':_0x4a14ef[_0xf045('0x46')]['id']},'attributes':['id',_0xf045('0x5f'),_0xf045('0x60'),'remoteUri']})[_0xf045('0x22')](handleEntityNotFound(_0x309b3f,null))[_0xf045('0x22')](function(_0x5e6d68){if(_0x5e6d68){_0x2a1ce5=_0x5e6d68['remoteUri'];var _0x4e4c14=_0x2a1ce5[_0xf045('0x61')](-0x1);if(_0x4e4c14==='/'){_0x2a1ce5=_0x2a1ce5[_0xf045('0x62')](0x0,_0x2a1ce5[_0xf045('0x63')](_0x4e4c14));}return rp({'method':_0xf045('0x64'),'uri':util[_0xf045('0x65')]('%s%s',_0x2a1ce5,_0xf045('0x66')),'json':!![],'form':{'method':'login','input_type':_0xf045('0x67'),'response_type':_0xf045('0x67'),'rest_data':JSON[_0xf045('0x68')]({'user_auth':{'user_name':_0x5e6d68[_0xf045('0x5f')],'password':_0x5e6d68[_0xf045('0x60')],'encryption':_0xf045('0x69')},'application':_0xf045('0x6a')})}});}})[_0xf045('0x22')](function(_0x2336b6){if(_0x2336b6&&_0x2336b6[_0xf045('0x2d')]!==_0xf045('0x6b')&&_0x2336b6['name']!==_0xf045('0x6c')){return rp({'method':'POST','uri':util[_0xf045('0x65')](_0xf045('0x6d'),_0x2a1ce5,_0xf045('0x66')),'json':!![],'form':{'method':_0xf045('0x6e'),'input_type':'JSON','response_type':_0xf045('0x67'),'rest_data':JSON[_0xf045('0x68')]({'session':_0x2336b6['id'],'module_name':'Calls'})}})[_0xf045('0x22')](function(_0x33bf41){if(_0x33bf41){var _0x1f994c=_[_0xf045('0x6f')](_0x33bf41[_0xf045('0x70')]);_[_0xf045('0x71')](_0x1f994c,function(_0x5958e9){return _0x4d2c58[_0xf045('0x72')](_0x5958e9[_0xf045('0x2d')]);});return{'count':_0x1f994c[_0xf045('0x35')],'rows':_[_0xf045('0x2c')](_0x1f994c,function(_0x5d8311){return{'id':_0x5d8311['name'],'name':_0x5d8311[_0xf045('0x73')],'custom':_[_0xf045('0x74')](_0x5d8311[_0xf045('0x2d')],'_c')?!![]:![],'options':_0x5d8311[_0xf045('0x3f')]?_[_0xf045('0x2c')](_[_0xf045('0x6f')](_0x5d8311['options']),function(_0x4341a7){return{'name':_0x4341a7[_0xf045('0x75')],'value':_0x4341a7[_0xf045('0x2d')]};}):[]};})};}})['then'](respondWithResult(_0x309b3f,null))['catch'](function(_0x5f3d8f){var _0x386ec8=_0x4a14ef[_0xf045('0x2e')]['test']?0x1f4:_0x5f3d8f[_0xf045('0x76')]||0x1f4;logger['error'](_0xf045('0x77'),_0xf045('0x54'),_0x386ec8,JSON[_0xf045('0x68')](_0x5f3d8f));delete _0x5f3d8f[_0xf045('0x2d')];if(_0x386ec8===0x191){_0x386ec8=0x190;}_0x309b3f[_0xf045('0x18')](_0x386ec8)[_0xf045('0x78')](_0x4a14ef['query'][_0xf045('0x79')]?{'message':_0xf045('0x7a'),'statusCode':_0x5f3d8f[_0xf045('0x76')]}:_0x5f3d8f);});}else{var _0x549a53=0x1f4;_0x309b3f['status'](_0x549a53)[_0xf045('0x78')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0xf749=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','limit','count','offset','Content-Range','reject','save','update','then','sendStatus','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','find','create','body','destroy','getConfigurations','findOne','SugarcrmConfiguration','filter','nolimit','addConfiguration','Subjects','getSubjects','channel','Descriptions','SugarcrmField','getFields','created_by','duration_hours','parent_id','parent_type','parent_name','direction','password','remoteUri','lastIndexOf','format','%s%s','/service/v4_1/rest.php','login','JSON','username','PLAIN','Invalid\x20Login','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith','options','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0x2909c7,_0x574f1c){var _0x2a11fd=function(_0x29c111){while(--_0x29c111){_0x2909c7['push'](_0x2909c7['shift']());}};_0x2a11fd(++_0x574f1c);}(_0xf749,0xd8));var _0x9f74=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xf749[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9f74('0x0'));var zipdir=require(_0x9f74('0x1'));var jsonpatch=require(_0x9f74('0x2'));var rp=require(_0x9f74('0x3'));var moment=require(_0x9f74('0x4'));var BPromise=require(_0x9f74('0x5'));var Mustache=require(_0x9f74('0x6'));var util=require('util');var path=require(_0x9f74('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9f74('0x8'));var crypto=require(_0x9f74('0x9'));var jsforce=require(_0x9f74('0xa'));var deskjs=require(_0x9f74('0xb'));var toCsv=require(_0x9f74('0xc'));var querystring=require(_0x9f74('0xd'));var Papa=require(_0x9f74('0xe'));var Redis=require(_0x9f74('0xf'));var authService=require(_0x9f74('0x10'));var qs=require(_0x9f74('0x11'));var as=require(_0x9f74('0x12'));var hardwareService=require(_0x9f74('0x13'));var logger=require('../../config/logger')(_0x9f74('0x14'));var utils=require(_0x9f74('0x15'));var config=require(_0x9f74('0x16'));var licenseUtil=require(_0x9f74('0x17'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1b0b89,_0x86e9df){_0x86e9df=_0x86e9df||0xcc;return function(_0x10a433){if(_0x10a433){return _0x1b0b89['sendStatus'](_0x86e9df);}return _0x1b0b89[_0x9f74('0x18')](_0x86e9df)[_0x9f74('0x19')]();};}function respondWithResult(_0x5e1f13,_0x4cd44d){_0x4cd44d=_0x4cd44d||0xc8;return function(_0x46f9d2){if(_0x46f9d2){return _0x5e1f13[_0x9f74('0x18')](_0x4cd44d)[_0x9f74('0x1a')](_0x46f9d2);}};}function respondWithFilteredResult(_0xbc3783,_0x524e1e){return function(_0xe236cf){if(_0xe236cf){var _0xa9ab5c=typeof _0x524e1e['offset']==='undefined'&&typeof _0x524e1e[_0x9f74('0x1b')]==='undefined';var _0x1f029d=_0xe236cf[_0x9f74('0x1c')];var _0x2d0468=_0xa9ab5c?0x0:_0x524e1e['offset'];var _0x42d102=_0xa9ab5c?_0xe236cf['count']:_0x524e1e[_0x9f74('0x1d')]+_0x524e1e[_0x9f74('0x1b')];var _0x1e5ac1;if(_0x42d102>=_0x1f029d){_0x42d102=_0x1f029d;_0x1e5ac1=0xc8;}else{_0x1e5ac1=0xce;}_0xbc3783[_0x9f74('0x18')](_0x1e5ac1);return _0xbc3783['set'](_0x9f74('0x1e'),_0x2d0468+'-'+_0x42d102+'/'+_0x1f029d)['json'](_0xe236cf);}return null;};}function patchUpdates(_0x2ad03e){return function(_0x507fad){try{jsonpatch['apply'](_0x507fad,_0x2ad03e,!![]);}catch(_0x51e731){return BPromise[_0x9f74('0x1f')](_0x51e731);}return _0x507fad[_0x9f74('0x20')]();};}function saveUpdates(_0x1be722,_0x227ba5){return function(_0x409489){if(_0x409489){return _0x409489[_0x9f74('0x21')](_0x1be722)[_0x9f74('0x22')](function(_0x46c985){return _0x46c985;});}return null;};}function removeEntity(_0x5df6b9,_0x4e1ebe){return function(_0xd6f065){if(_0xd6f065){return _0xd6f065['destroy']()[_0x9f74('0x22')](function(){_0x5df6b9['status'](0xcc)[_0x9f74('0x19')]();});}};}function handleEntityNotFound(_0x1f80aa,_0x3b3565){return function(_0x114584){if(!_0x114584){_0x1f80aa[_0x9f74('0x23')](0x194);}return _0x114584;};}function handleError(_0x1474d5,_0x2902e8){_0x2902e8=_0x2902e8||0x1f4;return function(_0x4696b6){logger[_0x9f74('0x24')](_0x4696b6[_0x9f74('0x25')]);if(_0x4696b6[_0x9f74('0x26')]){delete _0x4696b6[_0x9f74('0x26')];}_0x1474d5['status'](_0x2902e8)[_0x9f74('0x27')](_0x4696b6);};}exports[_0x9f74('0x28')]=function(_0xb20f40,_0x29b2db){var _0x249d51={},_0x13a4df={},_0xf59efe={'count':0x0,'rows':[]};var _0x1e1cff=_[_0x9f74('0x29')](db[_0x9f74('0x2a')][_0x9f74('0x2b')],function(_0x37a4f3){return{'name':_0x37a4f3['fieldName'],'type':_0x37a4f3['type'][_0x9f74('0x2c')]};});_0x13a4df[_0x9f74('0x2d')]=_[_0x9f74('0x29')](_0x1e1cff,_0x9f74('0x26'));_0x13a4df[_0x9f74('0x2e')]=_[_0x9f74('0x2f')](_0xb20f40['query']);_0x13a4df[_0x9f74('0x30')]=_[_0x9f74('0x31')](_0x13a4df[_0x9f74('0x2d')],_0x13a4df[_0x9f74('0x2e')]);_0x249d51[_0x9f74('0x32')]=_[_0x9f74('0x31')](_0x13a4df[_0x9f74('0x2d')],qs[_0x9f74('0x33')](_0xb20f40[_0x9f74('0x2e')]['fields']));_0x249d51['attributes']=_0x249d51[_0x9f74('0x32')][_0x9f74('0x34')]?_0x249d51[_0x9f74('0x32')]:_0x13a4df['model'];if(!_0xb20f40['query'][_0x9f74('0x35')]('nolimit')){_0x249d51[_0x9f74('0x1b')]=qs['limit'](_0xb20f40['query'][_0x9f74('0x1b')]);_0x249d51[_0x9f74('0x1d')]=qs['offset'](_0xb20f40[_0x9f74('0x2e')][_0x9f74('0x1d')]);}_0x249d51[_0x9f74('0x36')]=qs['sort'](_0xb20f40[_0x9f74('0x2e')][_0x9f74('0x37')]);_0x249d51[_0x9f74('0x38')]=qs[_0x9f74('0x30')](_[_0x9f74('0x39')](_0xb20f40['query'],_0x13a4df[_0x9f74('0x30')]),_0x1e1cff);if(_0xb20f40[_0x9f74('0x2e')]['filter']){_0x249d51[_0x9f74('0x38')]=_[_0x9f74('0x3a')](_0x249d51[_0x9f74('0x38')],{'$or':_[_0x9f74('0x29')](_0x1e1cff,function(_0x378f66){if(_0x378f66[_0x9f74('0x3b')]!==_0x9f74('0x3c')){var _0x26427f={};_0x26427f[_0x378f66['name']]={'$like':'%'+_0xb20f40['query']['filter']+'%'};return _0x26427f;}})});}_0x249d51=_[_0x9f74('0x3a')]({},_0x249d51,_0xb20f40['options']);var _0x2d051a={'where':_0x249d51[_0x9f74('0x38')]};return db['SugarcrmAccount']['count'](_0x2d051a)['then'](function(_0x59d81d){_0xf59efe[_0x9f74('0x1c')]=_0x59d81d;if(_0xb20f40['query']['includeAll']){_0x249d51[_0x9f74('0x3d')]=[{'all':!![]}];}return db[_0x9f74('0x2a')][_0x9f74('0x3e')](_0x249d51);})[_0x9f74('0x22')](function(_0x5a56e5){_0xf59efe[_0x9f74('0x3f')]=_0x5a56e5;return _0xf59efe;})[_0x9f74('0x22')](respondWithFilteredResult(_0x29b2db,_0x249d51))[_0x9f74('0x40')](handleError(_0x29b2db,null));};exports[_0x9f74('0x41')]=function(_0x295dc9,_0x58da13){var _0x3f6882={'raw':![],'where':{'id':_0x295dc9[_0x9f74('0x42')]['id']}},_0xb77989={};_0xb77989['model']=_['keys'](db[_0x9f74('0x2a')]['rawAttributes']);_0xb77989[_0x9f74('0x2e')]=_['keys'](_0x295dc9['query']);_0xb77989['filters']=_[_0x9f74('0x31')](_0xb77989['model'],_0xb77989[_0x9f74('0x2e')]);_0x3f6882[_0x9f74('0x32')]=_[_0x9f74('0x31')](_0xb77989[_0x9f74('0x2d')],qs[_0x9f74('0x33')](_0x295dc9[_0x9f74('0x2e')][_0x9f74('0x33')]));_0x3f6882[_0x9f74('0x32')]=_0x3f6882[_0x9f74('0x32')][_0x9f74('0x34')]?_0x3f6882['attributes']:_0xb77989[_0x9f74('0x2d')];if(_0x295dc9[_0x9f74('0x2e')][_0x9f74('0x43')]){_0x3f6882[_0x9f74('0x3d')]=[{'all':!![]}];}_0x3f6882=_[_0x9f74('0x3a')]({},_0x3f6882,_0x295dc9['options']);return db['SugarcrmAccount'][_0x9f74('0x44')](_0x3f6882)[_0x9f74('0x22')](handleEntityNotFound(_0x58da13,null))[_0x9f74('0x22')](respondWithResult(_0x58da13,null))[_0x9f74('0x40')](handleError(_0x58da13,null));};exports[_0x9f74('0x45')]=function(_0x4ba64e,_0x57e042){return db[_0x9f74('0x2a')][_0x9f74('0x45')](_0x4ba64e[_0x9f74('0x46')],{})[_0x9f74('0x22')](respondWithResult(_0x57e042,0xc9))[_0x9f74('0x40')](handleError(_0x57e042,null));};exports[_0x9f74('0x21')]=function(_0x39638e,_0x4691ec){if(_0x39638e[_0x9f74('0x46')]['id']){delete _0x39638e[_0x9f74('0x46')]['id'];}return db[_0x9f74('0x2a')][_0x9f74('0x44')]({'where':{'id':_0x39638e['params']['id']}})['then'](handleEntityNotFound(_0x4691ec,null))[_0x9f74('0x22')](saveUpdates(_0x39638e[_0x9f74('0x46')],null))['then'](respondWithResult(_0x4691ec,null))['catch'](handleError(_0x4691ec,null));};exports[_0x9f74('0x47')]=function(_0x516737,_0x3a9672){return db[_0x9f74('0x2a')][_0x9f74('0x44')]({'where':{'id':_0x516737[_0x9f74('0x42')]['id']}})['then'](handleEntityNotFound(_0x3a9672,null))['then'](removeEntity(_0x3a9672,null))[_0x9f74('0x40')](handleError(_0x3a9672,null));};exports[_0x9f74('0x48')]=function(_0x521f83,_0xa77ebe,_0x33011d){var _0x4fdb45={};var _0x2243f8={};var _0xddef92;var _0x2d1fc9;return db[_0x9f74('0x2a')][_0x9f74('0x49')]({'where':{'id':_0x521f83[_0x9f74('0x42')]['id']}})[_0x9f74('0x22')](handleEntityNotFound(_0xa77ebe,null))[_0x9f74('0x22')](function(_0x2a031f){if(_0x2a031f){_0xddef92=_0x2a031f;_0x2243f8[_0x9f74('0x2d')]=_[_0x9f74('0x2f')](db[_0x9f74('0x4a')][_0x9f74('0x2b')]);_0x2243f8['query']=_['keys'](_0x521f83[_0x9f74('0x2e')]);_0x2243f8[_0x9f74('0x30')]=_['intersection'](_0x2243f8[_0x9f74('0x2d')],_0x2243f8['query']);_0x4fdb45[_0x9f74('0x32')]=_[_0x9f74('0x31')](_0x2243f8[_0x9f74('0x2d')],qs[_0x9f74('0x33')](_0x521f83[_0x9f74('0x2e')][_0x9f74('0x33')]));_0x4fdb45['attributes']=_0x4fdb45['attributes'][_0x9f74('0x34')]?_0x4fdb45[_0x9f74('0x32')]:_0x2243f8[_0x9f74('0x2d')];_0x4fdb45[_0x9f74('0x36')]=qs['sort'](_0x521f83[_0x9f74('0x2e')][_0x9f74('0x37')]);_0x4fdb45['where']=qs[_0x9f74('0x30')](_[_0x9f74('0x39')](_0x521f83[_0x9f74('0x2e')],_0x2243f8[_0x9f74('0x30')]));if(_0x521f83['query'][_0x9f74('0x4b')]){_0x4fdb45[_0x9f74('0x38')]=_[_0x9f74('0x3a')](_0x4fdb45['where'],{'$or':_['map'](_0x4fdb45['attributes'],function(_0x26f296){var _0x3c106d={};_0x3c106d[_0x26f296]={'$like':'%'+_0x521f83['query'][_0x9f74('0x4b')]+'%'};return _0x3c106d;})});}_0x4fdb45=_[_0x9f74('0x3a')]({},_0x4fdb45,_0x521f83['options']);return _0xddef92['getConfigurations'](_0x4fdb45);}})[_0x9f74('0x22')](function(_0x53e611){if(_0x53e611){_0x2d1fc9=_0x53e611[_0x9f74('0x34')];if(!_0x521f83[_0x9f74('0x2e')][_0x9f74('0x35')](_0x9f74('0x4c'))){_0x4fdb45[_0x9f74('0x1b')]=qs[_0x9f74('0x1b')](_0x521f83[_0x9f74('0x2e')][_0x9f74('0x1b')]);_0x4fdb45[_0x9f74('0x1d')]=qs[_0x9f74('0x1d')](_0x521f83[_0x9f74('0x2e')][_0x9f74('0x1d')]);}return _0xddef92[_0x9f74('0x48')](_0x4fdb45);}})[_0x9f74('0x22')](function(_0x39584e){if(_0x39584e){return _0x39584e?{'count':_0x2d1fc9,'rows':_0x39584e}:null;}})[_0x9f74('0x22')](respondWithResult(_0xa77ebe,null))['catch'](handleError(_0xa77ebe,null));};exports[_0x9f74('0x4d')]=function(_0x140532,_0x5d1989,_0x2d4e84){if(_0x140532[_0x9f74('0x46')]['id']){delete _0x140532[_0x9f74('0x46')]['id'];}return db[_0x9f74('0x2a')][_0x9f74('0x49')]({'where':{'id':_0x140532[_0x9f74('0x42')]['id']}})[_0x9f74('0x22')](handleEntityNotFound(_0x5d1989,null))['then'](function(_0x450abf){if(_0x450abf){_0x140532[_0x9f74('0x46')]['AccountId']=_0x450abf['id'];_0x140532[_0x9f74('0x46')][_0x9f74('0x4e')]=integrations[_0x9f74('0x4f')](_0x140532[_0x9f74('0x46')][_0x9f74('0x50')],_0x140532[_0x9f74('0x46')][_0x9f74('0x3b')]);_0x140532[_0x9f74('0x46')][_0x9f74('0x51')]=integrations['getDescriptions'](_0x140532[_0x9f74('0x46')][_0x9f74('0x50')],_0x140532[_0x9f74('0x46')][_0x9f74('0x3b')]);return db[_0x9f74('0x4a')][_0x9f74('0x45')](_0x140532[_0x9f74('0x46')],{'include':[{'model':db['SugarcrmField'],'as':_0x9f74('0x4e')},{'model':db[_0x9f74('0x52')],'as':_0x9f74('0x51')}]});}return null;})['then'](respondWithResult(_0x5d1989,null))[_0x9f74('0x40')](handleError(_0x5d1989,null));};exports[_0x9f74('0x53')]=function(_0x141790,_0xd17ef7,_0x51880d){var _0x38776b='';var _0x36ee3a=['id','name','assigned_user_id',_0x9f74('0x54'),'description','date_start',_0x9f74('0x55'),'duration_minutes',_0x9f74('0x56'),_0x9f74('0x57'),_0x9f74('0x58'),_0x9f74('0x59')];return db['SugarcrmAccount']['findOne']({'where':{'id':_0x141790[_0x9f74('0x42')]['id']},'attributes':['id','username',_0x9f74('0x5a'),_0x9f74('0x5b')]})[_0x9f74('0x22')](handleEntityNotFound(_0xd17ef7,null))[_0x9f74('0x22')](function(_0x3f8b4b){if(_0x3f8b4b){_0x38776b=_0x3f8b4b[_0x9f74('0x5b')];var _0x1e5715=_0x38776b['slice'](-0x1);if(_0x1e5715==='/'){_0x38776b=_0x38776b['substring'](0x0,_0x38776b[_0x9f74('0x5c')](_0x1e5715));}return rp({'method':'POST','uri':util[_0x9f74('0x5d')](_0x9f74('0x5e'),_0x38776b,_0x9f74('0x5f')),'json':!![],'form':{'method':_0x9f74('0x60'),'input_type':_0x9f74('0x61'),'response_type':_0x9f74('0x61'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x3f8b4b[_0x9f74('0x62')],'password':_0x3f8b4b['password'],'encryption':_0x9f74('0x63')},'application':'xCALLY\x20Motion\x20Integration'})}});}})['then'](function(_0x2195d1){if(_0x2195d1&&_0x2195d1[_0x9f74('0x26')]!==_0x9f74('0x64')&&_0x2195d1['name']!=='Password\x20Expired'){return rp({'method':'POST','uri':util[_0x9f74('0x5d')](_0x9f74('0x5e'),_0x38776b,_0x9f74('0x5f')),'json':!![],'form':{'method':_0x9f74('0x65'),'input_type':_0x9f74('0x61'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x2195d1['id'],'module_name':_0x9f74('0x66')})}})[_0x9f74('0x22')](function(_0x4d3723){if(_0x4d3723){var _0x2325ef=_[_0x9f74('0x67')](_0x4d3723[_0x9f74('0x68')]);_[_0x9f74('0x69')](_0x2325ef,function(_0x47e1f2){return _0x36ee3a[_0x9f74('0x6a')](_0x47e1f2['name']);});return{'count':_0x2325ef[_0x9f74('0x34')],'rows':_['map'](_0x2325ef,function(_0x17315c){return{'id':_0x17315c[_0x9f74('0x26')],'name':_0x17315c[_0x9f74('0x6b')],'custom':_[_0x9f74('0x6c')](_0x17315c[_0x9f74('0x26')],'_c')?!![]:![],'options':_0x17315c[_0x9f74('0x6d')]?_[_0x9f74('0x29')](_['values'](_0x17315c[_0x9f74('0x6d')]),function(_0x2e5c93){return{'name':_0x2e5c93[_0x9f74('0x6e')],'value':_0x2e5c93['name']};}):[]};})};}})[_0x9f74('0x22')](respondWithResult(_0xd17ef7,null))[_0x9f74('0x40')](function(_0x91de8){var _0x1c9c05=_0x141790[_0x9f74('0x2e')][_0x9f74('0x6f')]?0x1f4:_0x91de8[_0x9f74('0x70')]||0x1f4;logger[_0x9f74('0x24')](_0x9f74('0x71'),_0x9f74('0x53'),_0x1c9c05,JSON[_0x9f74('0x72')](_0x91de8));delete _0x91de8[_0x9f74('0x26')];if(_0x1c9c05===0x191){_0x1c9c05=0x190;}_0xd17ef7[_0x9f74('0x18')](_0x1c9c05)['send'](_0x141790['query'][_0x9f74('0x6f')]?{'message':_0x9f74('0x73'),'statusCode':_0x91de8[_0x9f74('0x70')]}:_0x91de8);});}else{var _0x5607f7=0x1f4;_0xd17ef7[_0x9f74('0x18')](_0x5607f7)[_0x9f74('0x27')]({'message':_0x9f74('0x73'),'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 d3c41a8..4fa7354 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 _0x4ab2=['./intSugarcrmAccount.attributes','exports','define','SugarcrmAccount','int_sugarcrm_accounts','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x53199f,_0x1dac3a){var _0x1f9609=function(_0x452065){while(--_0x452065){_0x53199f['push'](_0x53199f['shift']());}};_0x1f9609(++_0x1dac3a);}(_0x4ab2,0xbb));var _0x24ab=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x4ab2[_0x413feb];return _0x40ee88;};'use strict';var _=require('lodash');var util=require(_0x24ab('0x0'));var logger=require(_0x24ab('0x1'))(_0x24ab('0x2'));var moment=require(_0x24ab('0x3'));var BPromise=require('bluebird');var rp=require(_0x24ab('0x4'));var fs=require('fs');var path=require(_0x24ab('0x5'));var rimraf=require(_0x24ab('0x6'));var config=require(_0x24ab('0x7'));var attributes=require(_0x24ab('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x24ab('0x9')]=function(_0x430050,_0x2232bb){return _0x430050[_0x24ab('0xa')](_0x24ab('0xb'),attributes,{'tableName':_0x24ab('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4e2=['bluebird','request-promise','../../config/environment','../../components/integrations/configuration','exports','define','lodash','util','../../config/logger','api','moment'];(function(_0x1686d0,_0x3e135f){var _0x59930a=function(_0x4899c2){while(--_0x4899c2){_0x1686d0['push'](_0x1686d0['shift']());}};_0x59930a(++_0x3e135f);}(_0xc4e2,0xe2));var _0x2c4e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xc4e2[_0x3054be];return _0x3df150;};'use strict';var _=require(_0x2c4e('0x0'));var util=require(_0x2c4e('0x1'));var logger=require(_0x2c4e('0x2'))(_0x2c4e('0x3'));var moment=require(_0x2c4e('0x4'));var BPromise=require(_0x2c4e('0x5'));var rp=require(_0x2c4e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2c4e('0x7'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x2c4e('0x8'));module[_0x2c4e('0x9')]=function(_0x4541d7,_0x5533df){return _0x4541d7[_0x2c4e('0xa')]('SugarcrmAccount',attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 48526a9..0fcd038 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 _0xa624=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','include','model','map','then','ShowSugarcrmAccount','find','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x23fa90,_0x26dd37){var _0x28c37c=function(_0x58ef48){while(--_0x58ef48){_0x23fa90['push'](_0x23fa90['shift']());}};_0x28c37c(++_0x26dd37);}(_0xa624,0x19f));var _0x4a62=function(_0x207811,_0x3420a6){_0x207811=_0x207811-0x0;var _0x170d56=_0xa624[_0x207811];return _0x170d56;};'use strict';var _=require('lodash');var util=require(_0x4a62('0x0'));var moment=require('moment');var BPromise=require(_0x4a62('0x1'));var rs=require(_0x4a62('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a62('0x3'))['db'];var utils=require(_0x4a62('0x4'));var logger=require(_0x4a62('0x5'))(_0x4a62('0x6'));var config=require(_0x4a62('0x7'));var jayson=require(_0x4a62('0x8'));var client=jayson[_0x4a62('0x9')][_0x4a62('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1eee83,_0x317394,_0x109aa0){return new BPromise(function(_0x37f80f,_0x9001a0){return client[_0x4a62('0xb')](_0x1eee83,_0x109aa0)['then'](function(_0x11dad5){logger[_0x4a62('0xc')](_0x4a62('0xd'),_0x317394,_0x4a62('0xe'));logger[_0x4a62('0xf')](_0x4a62('0x10'),_0x317394,_0x4a62('0xe'),JSON[_0x4a62('0x11')](_0x11dad5));if(_0x11dad5[_0x4a62('0x12')]){if(_0x11dad5[_0x4a62('0x12')][_0x4a62('0x13')]===0x1f4){logger[_0x4a62('0x12')](_0x4a62('0xd'),_0x317394,_0x11dad5[_0x4a62('0x12')][_0x4a62('0x14')]);return _0x9001a0(_0x11dad5[_0x4a62('0x12')][_0x4a62('0x14')]);}logger[_0x4a62('0x12')](_0x4a62('0xd'),_0x317394,_0x11dad5[_0x4a62('0x12')][_0x4a62('0x14')]);return _0x37f80f(_0x11dad5[_0x4a62('0x12')][_0x4a62('0x14')]);}else{logger[_0x4a62('0xc')](_0x4a62('0xd'),_0x317394,_0x4a62('0xe'));_0x37f80f(_0x11dad5['result'][_0x4a62('0x14')]);}})[_0x4a62('0x15')](function(_0x18ecc3){logger[_0x4a62('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x317394,_0x18ecc3);_0x9001a0(_0x18ecc3);});});}exports[_0x4a62('0x16')]=function(_0xc89f58){var _0x2d9408=this;return new Promise(function(_0xb72354,_0x4e5a1f){return db[_0x4a62('0x17')][_0x4a62('0x18')]({'raw':_0xc89f58[_0x4a62('0x19')]?_0xc89f58[_0x4a62('0x19')][_0x4a62('0x1a')]===undefined?!![]:![]:!![],'where':_0xc89f58['options']?_0xc89f58[_0x4a62('0x19')][_0x4a62('0x1b')]||null:null,'attributes':_0xc89f58[_0x4a62('0x19')]?_0xc89f58[_0x4a62('0x19')][_0x4a62('0x1c')]||null:null,'limit':_0xc89f58['options']?_0xc89f58['options']['limit']||null:null,'include':_0xc89f58[_0x4a62('0x19')]?_0xc89f58[_0x4a62('0x19')][_0x4a62('0x1d')]?_['map'](_0xc89f58['options'][_0x4a62('0x1d')],function(_0x395d2a){return{'model':db[_0x395d2a[_0x4a62('0x1e')]],'as':_0x395d2a['as'],'attributes':_0x395d2a[_0x4a62('0x1c')],'include':_0x395d2a[_0x4a62('0x1d')]?_[_0x4a62('0x1f')](_0x395d2a[_0x4a62('0x1d')],function(_0x27470f){return{'model':db[_0x27470f[_0x4a62('0x1e')]],'as':_0x27470f['as'],'attributes':_0x27470f[_0x4a62('0x1c')],'include':_0x27470f[_0x4a62('0x1d')]?_['map'](_0x27470f['include'],function(_0x168281){return{'model':db[_0x168281['model']],'as':_0x168281['as'],'attributes':_0x168281[_0x4a62('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4a62('0x20')](function(_0x4cb23b){logger[_0x4a62('0xc')](_0x4a62('0x16'),_0xc89f58);logger[_0x4a62('0xf')](_0x4a62('0x16'),_0xc89f58,JSON[_0x4a62('0x11')](_0x4cb23b));_0xb72354(_0x4cb23b);})[_0x4a62('0x15')](function(_0x5edc62){logger[_0x4a62('0x12')]('GetSugarcrmAccount',_0x5edc62[_0x4a62('0x14')],_0xc89f58);_0x4e5a1f(_0x2d9408[_0x4a62('0x12')](0x1f4,_0x5edc62['message']));});});};exports[_0x4a62('0x21')]=function(_0xf7f04f){var _0x2350bd=this;return new Promise(function(_0x5f0606,_0x3b63ac){return db[_0x4a62('0x17')][_0x4a62('0x22')]({'raw':_0xf7f04f[_0x4a62('0x19')]?_0xf7f04f['options'][_0x4a62('0x1a')]===undefined?!![]:![]:!![],'where':_0xf7f04f[_0x4a62('0x19')]?_0xf7f04f[_0x4a62('0x19')][_0x4a62('0x1b')]||null:null,'attributes':_0xf7f04f[_0x4a62('0x19')]?_0xf7f04f[_0x4a62('0x19')][_0x4a62('0x1c')]||null:null,'include':_0xf7f04f[_0x4a62('0x19')]?_0xf7f04f[_0x4a62('0x19')][_0x4a62('0x1d')]?_[_0x4a62('0x1f')](_0xf7f04f[_0x4a62('0x19')]['include'],function(_0x25c6d4){return{'model':db[_0x25c6d4[_0x4a62('0x1e')]],'as':_0x25c6d4['as'],'attributes':_0x25c6d4[_0x4a62('0x1c')],'include':_0x25c6d4['include']?_['map'](_0x25c6d4[_0x4a62('0x1d')],function(_0x32db16){return{'model':db[_0x32db16[_0x4a62('0x1e')]],'as':_0x32db16['as'],'attributes':_0x32db16[_0x4a62('0x1c')],'include':_0x32db16[_0x4a62('0x1d')]?_[_0x4a62('0x1f')](_0x32db16['include'],function(_0x55ddac){return{'model':db[_0x55ddac[_0x4a62('0x1e')]],'as':_0x55ddac['as'],'attributes':_0x55ddac[_0x4a62('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4a62('0x20')](function(_0x225afd){logger[_0x4a62('0xc')](_0x4a62('0x21'),_0xf7f04f);logger[_0x4a62('0xf')](_0x4a62('0x21'),_0xf7f04f,JSON['stringify'](_0x225afd));_0x5f0606(_0x225afd);})['catch'](function(_0x5f0e7c){logger[_0x4a62('0x12')](_0x4a62('0x21'),_0x5f0e7c[_0x4a62('0x14')],_0xf7f04f);_0x3b63ac(_0x2350bd['error'](0x1f4,_0x5f0e7c['message']));});});}; \ No newline at end of file +var _0x96c4=['catch','GetSugarcrmAccount','SugarcrmAccount','findAll','raw','options','where','attributes','limit','include','model','map','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message'];(function(_0x3a1cdc,_0x550069){var _0xabc0e0=function(_0x16e4eb){while(--_0x16e4eb){_0x3a1cdc['push'](_0x3a1cdc['shift']());}};_0xabc0e0(++_0x550069);}(_0x96c4,0x1b1));var _0x496c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x96c4[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x496c('0x0'));var util=require(_0x496c('0x1'));var moment=require(_0x496c('0x2'));var BPromise=require(_0x496c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x496c('0x4'));var db=require(_0x496c('0x5'))['db'];var utils=require(_0x496c('0x6'));var logger=require(_0x496c('0x7'))(_0x496c('0x8'));var config=require(_0x496c('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x496c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a42fc,_0x46f9b4,_0xf862fb){return new BPromise(function(_0x4cd34b,_0x5570c8){return client[_0x496c('0xb')](_0x5a42fc,_0xf862fb)[_0x496c('0xc')](function(_0x873cbf){logger[_0x496c('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x46f9b4,_0x496c('0xe'));logger[_0x496c('0xf')](_0x496c('0x10'),_0x46f9b4,_0x496c('0xe'),JSON[_0x496c('0x11')](_0x873cbf));if(_0x873cbf[_0x496c('0x12')]){if(_0x873cbf[_0x496c('0x12')][_0x496c('0x13')]===0x1f4){logger[_0x496c('0x12')](_0x496c('0x14'),_0x46f9b4,_0x873cbf[_0x496c('0x12')][_0x496c('0x15')]);return _0x5570c8(_0x873cbf[_0x496c('0x12')][_0x496c('0x15')]);}logger['error'](_0x496c('0x14'),_0x46f9b4,_0x873cbf[_0x496c('0x12')][_0x496c('0x15')]);return _0x4cd34b(_0x873cbf[_0x496c('0x12')][_0x496c('0x15')]);}else{logger[_0x496c('0xd')](_0x496c('0x14'),_0x46f9b4,'request\x20sent');_0x4cd34b(_0x873cbf['result'][_0x496c('0x15')]);}})[_0x496c('0x16')](function(_0x1ec4c5){logger[_0x496c('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x46f9b4,_0x1ec4c5);_0x5570c8(_0x1ec4c5);});});}exports[_0x496c('0x17')]=function(_0x5e3141){var _0x42489a=this;return new Promise(function(_0x2071db,_0x26f68a){return db[_0x496c('0x18')][_0x496c('0x19')]({'raw':_0x5e3141['options']?_0x5e3141['options'][_0x496c('0x1a')]===undefined?!![]:![]:!![],'where':_0x5e3141[_0x496c('0x1b')]?_0x5e3141['options'][_0x496c('0x1c')]||null:null,'attributes':_0x5e3141['options']?_0x5e3141[_0x496c('0x1b')][_0x496c('0x1d')]||null:null,'limit':_0x5e3141[_0x496c('0x1b')]?_0x5e3141['options'][_0x496c('0x1e')]||null:null,'include':_0x5e3141['options']?_0x5e3141['options'][_0x496c('0x1f')]?_['map'](_0x5e3141[_0x496c('0x1b')][_0x496c('0x1f')],function(_0x52bd60){return{'model':db[_0x52bd60[_0x496c('0x20')]],'as':_0x52bd60['as'],'attributes':_0x52bd60[_0x496c('0x1d')],'include':_0x52bd60[_0x496c('0x1f')]?_[_0x496c('0x21')](_0x52bd60[_0x496c('0x1f')],function(_0x2d74e9){return{'model':db[_0x2d74e9['model']],'as':_0x2d74e9['as'],'attributes':_0x2d74e9[_0x496c('0x1d')],'include':_0x2d74e9[_0x496c('0x1f')]?_['map'](_0x2d74e9[_0x496c('0x1f')],function(_0x440aab){return{'model':db[_0x440aab['model']],'as':_0x440aab['as'],'attributes':_0x440aab[_0x496c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x496c('0xc')](function(_0xd72613){logger['info'](_0x496c('0x17'),_0x5e3141);logger[_0x496c('0xf')](_0x496c('0x17'),_0x5e3141,JSON[_0x496c('0x11')](_0xd72613));_0x2071db(_0xd72613);})[_0x496c('0x16')](function(_0x5e6154){logger[_0x496c('0x12')]('GetSugarcrmAccount',_0x5e6154[_0x496c('0x15')],_0x5e3141);_0x26f68a(_0x42489a[_0x496c('0x12')](0x1f4,_0x5e6154['message']));});});};exports['ShowSugarcrmAccount']=function(_0x286e98){var _0x267243=this;return new Promise(function(_0x33cd84,_0x435a12){return db[_0x496c('0x18')][_0x496c('0x22')]({'raw':_0x286e98[_0x496c('0x1b')]?_0x286e98[_0x496c('0x1b')][_0x496c('0x1a')]===undefined?!![]:![]:!![],'where':_0x286e98[_0x496c('0x1b')]?_0x286e98[_0x496c('0x1b')][_0x496c('0x1c')]||null:null,'attributes':_0x286e98[_0x496c('0x1b')]?_0x286e98['options'][_0x496c('0x1d')]||null:null,'include':_0x286e98[_0x496c('0x1b')]?_0x286e98['options'][_0x496c('0x1f')]?_['map'](_0x286e98[_0x496c('0x1b')][_0x496c('0x1f')],function(_0x4d9e62){return{'model':db[_0x4d9e62['model']],'as':_0x4d9e62['as'],'attributes':_0x4d9e62[_0x496c('0x1d')],'include':_0x4d9e62[_0x496c('0x1f')]?_['map'](_0x4d9e62[_0x496c('0x1f')],function(_0x4ef720){return{'model':db[_0x4ef720[_0x496c('0x20')]],'as':_0x4ef720['as'],'attributes':_0x4ef720['attributes'],'include':_0x4ef720['include']?_[_0x496c('0x21')](_0x4ef720['include'],function(_0x1d3e5d){return{'model':db[_0x1d3e5d[_0x496c('0x20')]],'as':_0x1d3e5d['as'],'attributes':_0x1d3e5d[_0x496c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x496c('0xc')](function(_0x19b8f2){logger[_0x496c('0xd')]('ShowSugarcrmAccount',_0x286e98);logger[_0x496c('0xf')]('ShowSugarcrmAccount',_0x286e98,JSON[_0x496c('0x11')](_0x19b8f2));_0x33cd84(_0x19b8f2);})[_0x496c('0x16')](function(_0x1d8115){logger[_0x496c('0x12')]('ShowSugarcrmAccount',_0x1d8115[_0x496c('0x15')],_0x286e98);_0x435a12(_0x267243[_0x496c('0x12')](0x1f4,_0x1d8115[_0x496c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 68cad0f..10c7380 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 _0x0185=['../../config/environment','./intSugarcrmConfiguration.controller','get','index','show','isAuthenticated','getFields','/:id/subjects','/:id/descriptions','post','create','put','/:id','update','delete','destroy','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4b8e7f,_0x2ff93f){var _0x5e7a9c=function(_0x16d2f5){while(--_0x16d2f5){_0x4b8e7f['push'](_0x4b8e7f['shift']());}};_0x5e7a9c(++_0x2ff93f);}(_0x0185,0x10c));var _0x5018=function(_0x1e6e4e,_0x2b1b09){_0x1e6e4e=_0x1e6e4e-0x0;var _0x3d746b=_0x0185[_0x1e6e4e];return _0x3d746b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x5018('0x0'));var express=require(_0x5018('0x1'));var router=express[_0x5018('0x2')]();var fs_extra=require(_0x5018('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5018('0x4'));var config=require(_0x5018('0x5'));var controller=require(_0x5018('0x6'));router[_0x5018('0x7')]('/',auth['isAuthenticated'](),controller[_0x5018('0x8')]);router[_0x5018('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x5018('0x9')]);router['get']('/:id/fields',auth[_0x5018('0xa')](),controller[_0x5018('0xb')]);router[_0x5018('0x7')](_0x5018('0xc'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x5018('0x7')](_0x5018('0xd'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x5018('0xe')]('/',auth['isAuthenticated'](),controller[_0x5018('0xf')]);router[_0x5018('0x10')](_0x5018('0x11'),auth[_0x5018('0xa')](),controller[_0x5018('0x12')]);router[_0x5018('0x13')](_0x5018('0x11'),auth[_0x5018('0xa')](),controller[_0x5018('0x14')]);module['exports']=router; \ No newline at end of file +var _0x4c0b=['exports','util','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete'];(function(_0x1a0612,_0x4cd240){var _0x2ff5ee=function(_0x312a14){while(--_0x312a14){_0x1a0612['push'](_0x1a0612['shift']());}};_0x2ff5ee(++_0x4cd240);}(_0x4c0b,0x1c9));var _0xb4c0=function(_0x54c150,_0x1f3a82){_0x54c150=_0x54c150-0x0;var _0x2de401=_0x4c0b[_0x54c150];return _0x2de401;};'use strict';var multer=require('multer');var util=require(_0xb4c0('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb4c0('0x1')]();var fs_extra=require(_0xb4c0('0x2'));var auth=require(_0xb4c0('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xb4c0('0x4'));var controller=require(_0xb4c0('0x5'));router[_0xb4c0('0x6')]('/',auth['isAuthenticated'](),controller[_0xb4c0('0x7')]);router[_0xb4c0('0x6')](_0xb4c0('0x8'),auth[_0xb4c0('0x9')](),controller['show']);router[_0xb4c0('0x6')](_0xb4c0('0xa'),auth[_0xb4c0('0x9')](),controller['getFields']);router[_0xb4c0('0x6')]('/:id/subjects',auth[_0xb4c0('0x9')](),controller[_0xb4c0('0xb')]);router[_0xb4c0('0x6')](_0xb4c0('0xc'),auth[_0xb4c0('0x9')](),controller[_0xb4c0('0xd')]);router[_0xb4c0('0xe')]('/',auth['isAuthenticated'](),controller[_0xb4c0('0xf')]);router['put'](_0xb4c0('0x8'),auth[_0xb4c0('0x9')](),controller[_0xb4c0('0x10')]);router[_0xb4c0('0x11')](_0xb4c0('0x8'),auth[_0xb4c0('0x9')](),controller['destroy']);module[_0xb4c0('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 20a5b00..a200509 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 _0x99c1=['sequelize','exports','STRING'];(function(_0x351af1,_0x2770f7){var _0x2aaafd=function(_0x149d25){while(--_0x149d25){_0x351af1['push'](_0x351af1['shift']());}};_0x2aaafd(++_0x2770f7);}(_0x99c1,0xc0));var _0x199c=function(_0x1710ff,_0x23cb01){_0x1710ff=_0x1710ff-0x0;var _0x256e70=_0x99c1[_0x1710ff];return _0x256e70;};'use strict';var Sequelize=require(_0x199c('0x0'));module[_0x199c('0x1')]={'name':{'type':Sequelize[_0x199c('0x2')]},'description':{'type':Sequelize[_0x199c('0x2')]}}; \ No newline at end of file +var _0x43c8=['sequelize','exports','STRING'];(function(_0xf39eb9,_0x19fce4){var _0x2148e4=function(_0x1007b9){while(--_0x1007b9){_0xf39eb9['push'](_0xf39eb9['shift']());}};_0x2148e4(++_0x19fce4);}(_0x43c8,0x168));var _0x843c=function(_0x187cc6,_0x24223a){_0x187cc6=_0x187cc6-0x0;var _0x572d1c=_0x43c8[_0x187cc6];return _0x572d1c;};'use strict';var Sequelize=require(_0x843c('0x0'));module[_0x843c('0x1')]={'name':{'type':Sequelize[_0x843c('0x2')]},'description':{'type':Sequelize[_0x843c('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 9b35d5c..5085ee2 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 _0x47d1=['fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','create','body','find','params','getFields','SugarcrmField','hasOwnProperty','getSubjects','findOne','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes'];(function(_0x312bad,_0x553026){var _0x3bdaf6=function(_0x30e75b){while(--_0x30e75b){_0x312bad['push'](_0x312bad['shift']());}};_0x3bdaf6(++_0x553026);}(_0x47d1,0x112));var _0x147d=function(_0x1f5108,_0x10738e){_0x1f5108=_0x1f5108-0x0;var _0x2d3d2d=_0x47d1[_0x1f5108];return _0x2d3d2d;};'use strict';var emlformat=require(_0x147d('0x0'));var rimraf=require(_0x147d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x147d('0x2'));var rp=require(_0x147d('0x3'));var moment=require(_0x147d('0x4'));var BPromise=require(_0x147d('0x5'));var Mustache=require(_0x147d('0x6'));var util=require('util');var path=require(_0x147d('0x7'));var sox=require(_0x147d('0x8'));var csv=require(_0x147d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x147d('0xa'));var _=require(_0x147d('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x147d('0xc'));var deskjs=require(_0x147d('0xd'));var toCsv=require(_0x147d('0x9'));var querystring=require(_0x147d('0xe'));var Papa=require('papaparse');var Redis=require(_0x147d('0xf'));var authService=require(_0x147d('0x10'));var qs=require(_0x147d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x147d('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x147d('0x13'));var config=require(_0x147d('0x14'));var licenseUtil=require(_0x147d('0x15'));var db=require(_0x147d('0x16'))['db'];function respondWithStatusCode(_0x19e479,_0x6d676b){_0x6d676b=_0x6d676b||0xcc;return function(_0x2c4bd7){if(_0x2c4bd7){return _0x19e479['sendStatus'](_0x6d676b);}return _0x19e479['status'](_0x6d676b)[_0x147d('0x17')]();};}function respondWithResult(_0x9c61df,_0x4bb0c5){_0x4bb0c5=_0x4bb0c5||0xc8;return function(_0x5eb3ae){if(_0x5eb3ae){return _0x9c61df[_0x147d('0x18')](_0x4bb0c5)[_0x147d('0x19')](_0x5eb3ae);}};}function respondWithFilteredResult(_0x2395fb,_0x163d6e){return function(_0x31fda3){if(_0x31fda3){var _0x1c4cb3=typeof _0x163d6e[_0x147d('0x1a')]==='undefined'&&typeof _0x163d6e['limit']===_0x147d('0x1b');var _0x284ab0=_0x31fda3[_0x147d('0x1c')];var _0x18c554=_0x1c4cb3?0x0:_0x163d6e[_0x147d('0x1a')];var _0xfcffc8=_0x1c4cb3?_0x31fda3['count']:_0x163d6e['offset']+_0x163d6e[_0x147d('0x1d')];var _0x39a279;if(_0xfcffc8>=_0x284ab0){_0xfcffc8=_0x284ab0;_0x39a279=0xc8;}else{_0x39a279=0xce;}_0x2395fb['status'](_0x39a279);return _0x2395fb[_0x147d('0x1e')](_0x147d('0x1f'),_0x18c554+'-'+_0xfcffc8+'/'+_0x284ab0)[_0x147d('0x19')](_0x31fda3);}return null;};}function patchUpdates(_0x24449a){return function(_0x458bab){try{jsonpatch[_0x147d('0x20')](_0x458bab,_0x24449a,!![]);}catch(_0x5a588f){return BPromise[_0x147d('0x21')](_0x5a588f);}return _0x458bab['save']();};}function saveUpdates(_0x53f790,_0x2adf31){return function(_0x3992fb){if(_0x3992fb){return _0x3992fb[_0x147d('0x22')](_0x53f790)[_0x147d('0x23')](function(_0x2a095c){return _0x2a095c;});}return null;};}function removeEntity(_0xdc15bd,_0x3829d3){return function(_0xc79e53){if(_0xc79e53){return _0xc79e53[_0x147d('0x24')]()['then'](function(){_0xdc15bd[_0x147d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf3096d,_0x4b29a8){return function(_0x4dd35e){if(!_0x4dd35e){_0xf3096d[_0x147d('0x25')](0x194);}return _0x4dd35e;};}function handleError(_0x6909ec,_0x307503){_0x307503=_0x307503||0x1f4;return function(_0x42b444){logger[_0x147d('0x26')](_0x42b444[_0x147d('0x27')]);if(_0x42b444['name']){delete _0x42b444[_0x147d('0x28')];}_0x6909ec['status'](_0x307503)[_0x147d('0x29')](_0x42b444);};}exports[_0x147d('0x2a')]=function(_0x515563,_0x271643){var _0x476abf={},_0x36b216={},_0x7a96e3={'count':0x0,'rows':[]};var _0x47268d=_[_0x147d('0x2b')](db[_0x147d('0x2c')][_0x147d('0x2d')],function(_0x4669ac){return{'name':_0x4669ac[_0x147d('0x2e')],'type':_0x4669ac[_0x147d('0x2f')][_0x147d('0x30')]};});_0x36b216[_0x147d('0x31')]=_['map'](_0x47268d,'name');_0x36b216[_0x147d('0x32')]=_[_0x147d('0x33')](_0x515563['query']);_0x36b216[_0x147d('0x34')]=_[_0x147d('0x35')](_0x36b216[_0x147d('0x31')],_0x36b216[_0x147d('0x32')]);_0x476abf['attributes']=_[_0x147d('0x35')](_0x36b216[_0x147d('0x31')],qs[_0x147d('0x36')](_0x515563[_0x147d('0x32')]['fields']));_0x476abf[_0x147d('0x37')]=_0x476abf[_0x147d('0x37')][_0x147d('0x38')]?_0x476abf[_0x147d('0x37')]:_0x36b216[_0x147d('0x31')];if(!_0x515563[_0x147d('0x32')]['hasOwnProperty'](_0x147d('0x39'))){_0x476abf[_0x147d('0x1d')]=qs[_0x147d('0x1d')](_0x515563[_0x147d('0x32')][_0x147d('0x1d')]);_0x476abf['offset']=qs['offset'](_0x515563[_0x147d('0x32')][_0x147d('0x1a')]);}_0x476abf[_0x147d('0x3a')]=qs['sort'](_0x515563[_0x147d('0x32')][_0x147d('0x3b')]);_0x476abf[_0x147d('0x3c')]=qs['filters'](_[_0x147d('0x3d')](_0x515563[_0x147d('0x32')],_0x36b216['filters']),_0x47268d);if(_0x515563['query'][_0x147d('0x3e')]){_0x476abf['where']=_[_0x147d('0x3f')](_0x476abf[_0x147d('0x3c')],{'$or':_[_0x147d('0x2b')](_0x47268d,function(_0x14f99e){if(_0x14f99e['type']!==_0x147d('0x40')){var _0x120357={};_0x120357[_0x14f99e[_0x147d('0x28')]]={'$like':'%'+_0x515563[_0x147d('0x32')][_0x147d('0x3e')]+'%'};return _0x120357;}})});}_0x476abf=_[_0x147d('0x3f')]({},_0x476abf,_0x515563[_0x147d('0x41')]);var _0x61bc4f={'where':_0x476abf[_0x147d('0x3c')]};return db[_0x147d('0x2c')][_0x147d('0x1c')](_0x61bc4f)[_0x147d('0x23')](function(_0x3b40d9){_0x7a96e3['count']=_0x3b40d9;if(_0x515563[_0x147d('0x32')][_0x147d('0x42')]){_0x476abf['include']=[{'all':!![]}];}return db[_0x147d('0x2c')][_0x147d('0x43')](_0x476abf);})[_0x147d('0x23')](function(_0x324b55){_0x7a96e3['rows']=_0x324b55;return _0x7a96e3;})['then'](respondWithFilteredResult(_0x271643,_0x476abf))[_0x147d('0x44')](handleError(_0x271643,null));};exports[_0x147d('0x45')]=function(_0x50278b,_0x216851){var _0x40ba41={'raw':![],'where':{'id':_0x50278b['params']['id']}},_0x4692a7={};_0x4692a7['model']=_[_0x147d('0x33')](db[_0x147d('0x2c')]['rawAttributes']);_0x4692a7[_0x147d('0x32')]=_['keys'](_0x50278b['query']);_0x4692a7[_0x147d('0x34')]=_[_0x147d('0x35')](_0x4692a7['model'],_0x4692a7[_0x147d('0x32')]);_0x40ba41[_0x147d('0x37')]=_['intersection'](_0x4692a7[_0x147d('0x31')],qs[_0x147d('0x36')](_0x50278b[_0x147d('0x32')]['fields']));_0x40ba41[_0x147d('0x37')]=_0x40ba41['attributes'][_0x147d('0x38')]?_0x40ba41[_0x147d('0x37')]:_0x4692a7[_0x147d('0x31')];if(_0x50278b[_0x147d('0x32')]['includeAll']){_0x40ba41['include']=[{'all':!![]}];}_0x40ba41=_[_0x147d('0x3f')]({},_0x40ba41,_0x50278b[_0x147d('0x41')]);return db[_0x147d('0x2c')]['find'](_0x40ba41)[_0x147d('0x23')](handleEntityNotFound(_0x216851,null))[_0x147d('0x23')](respondWithResult(_0x216851,null))['catch'](handleError(_0x216851,null));};exports['create']=function(_0x5616db,_0x3e145a){return db[_0x147d('0x2c')][_0x147d('0x46')](_0x5616db[_0x147d('0x47')],{})[_0x147d('0x23')](respondWithResult(_0x3e145a,0xc9))[_0x147d('0x44')](handleError(_0x3e145a,null));};exports[_0x147d('0x22')]=function(_0x283663,_0x28b24e){if(_0x283663[_0x147d('0x47')]['id']){delete _0x283663['body']['id'];}return db['SugarcrmConfiguration']['find']({'where':{'id':_0x283663['params']['id']}})[_0x147d('0x23')](handleEntityNotFound(_0x28b24e,null))[_0x147d('0x23')](saveUpdates(_0x283663['body'],null))[_0x147d('0x23')](respondWithResult(_0x28b24e,null))[_0x147d('0x44')](handleError(_0x28b24e,null));};exports[_0x147d('0x24')]=function(_0x14a200,_0x145627){return db[_0x147d('0x2c')][_0x147d('0x48')]({'where':{'id':_0x14a200[_0x147d('0x49')]['id']}})[_0x147d('0x23')](handleEntityNotFound(_0x145627,null))[_0x147d('0x23')](removeEntity(_0x145627,null))[_0x147d('0x44')](handleError(_0x145627,null));};exports[_0x147d('0x4a')]=function(_0x3e60d7,_0x42434f,_0x41bafb){var _0xb8e0e8={};var _0x10a537={};var _0xcf05fb;var _0x40b960;return db[_0x147d('0x2c')]['findOne']({'where':{'id':_0x3e60d7[_0x147d('0x49')]['id']}})[_0x147d('0x23')](handleEntityNotFound(_0x42434f,null))[_0x147d('0x23')](function(_0x7fa2cc){if(_0x7fa2cc){_0xcf05fb=_0x7fa2cc;_0x10a537[_0x147d('0x31')]=_[_0x147d('0x33')](db[_0x147d('0x4b')][_0x147d('0x2d')]);_0x10a537[_0x147d('0x32')]=_[_0x147d('0x33')](_0x3e60d7['query']);_0x10a537[_0x147d('0x34')]=_[_0x147d('0x35')](_0x10a537[_0x147d('0x31')],_0x10a537[_0x147d('0x32')]);_0xb8e0e8['attributes']=_[_0x147d('0x35')](_0x10a537[_0x147d('0x31')],qs['fields'](_0x3e60d7[_0x147d('0x32')][_0x147d('0x36')]));_0xb8e0e8['attributes']=_0xb8e0e8[_0x147d('0x37')][_0x147d('0x38')]?_0xb8e0e8[_0x147d('0x37')]:_0x10a537[_0x147d('0x31')];_0xb8e0e8['order']=qs['sort'](_0x3e60d7[_0x147d('0x32')][_0x147d('0x3b')]);_0xb8e0e8['where']=qs['filters'](_['pick'](_0x3e60d7['query'],_0x10a537[_0x147d('0x34')]));if(_0x3e60d7[_0x147d('0x32')][_0x147d('0x3e')]){_0xb8e0e8[_0x147d('0x3c')]=_[_0x147d('0x3f')](_0xb8e0e8[_0x147d('0x3c')],{'$or':_[_0x147d('0x2b')](_0xb8e0e8[_0x147d('0x37')],function(_0x4a9e59){var _0x3016fd={};_0x3016fd[_0x4a9e59]={'$like':'%'+_0x3e60d7[_0x147d('0x32')][_0x147d('0x3e')]+'%'};return _0x3016fd;})});}_0xb8e0e8=_[_0x147d('0x3f')]({},_0xb8e0e8,_0x3e60d7[_0x147d('0x41')]);return _0xcf05fb[_0x147d('0x4a')](_0xb8e0e8);}})[_0x147d('0x23')](function(_0x102627){if(_0x102627){_0x40b960=_0x102627[_0x147d('0x38')];if(!_0x3e60d7[_0x147d('0x32')][_0x147d('0x4c')](_0x147d('0x39'))){_0xb8e0e8[_0x147d('0x1d')]=qs[_0x147d('0x1d')](_0x3e60d7['query'][_0x147d('0x1d')]);_0xb8e0e8[_0x147d('0x1a')]=qs['offset'](_0x3e60d7[_0x147d('0x32')][_0x147d('0x1a')]);}return _0xcf05fb[_0x147d('0x4a')](_0xb8e0e8);}})[_0x147d('0x23')](function(_0x3413b4){if(_0x3413b4){return _0x3413b4?{'count':_0x40b960,'rows':_0x3413b4}:null;}})[_0x147d('0x23')](respondWithResult(_0x42434f,null))[_0x147d('0x44')](handleError(_0x42434f,null));};exports[_0x147d('0x4d')]=function(_0x98877,_0xb97daf,_0x4c3b15){var _0x16f01a={};var _0x877b9f={};var _0x36bc91;var _0x287a8f;return db['SugarcrmConfiguration'][_0x147d('0x4e')]({'where':{'id':_0x98877[_0x147d('0x49')]['id']}})[_0x147d('0x23')](handleEntityNotFound(_0xb97daf,null))[_0x147d('0x23')](function(_0x53b217){if(_0x53b217){_0x36bc91=_0x53b217;_0x877b9f[_0x147d('0x31')]=_[_0x147d('0x33')](db['SugarcrmField'][_0x147d('0x2d')]);_0x877b9f[_0x147d('0x32')]=_['keys'](_0x98877[_0x147d('0x32')]);_0x877b9f[_0x147d('0x34')]=_[_0x147d('0x35')](_0x877b9f[_0x147d('0x31')],_0x877b9f['query']);_0x16f01a[_0x147d('0x37')]=_[_0x147d('0x35')](_0x877b9f[_0x147d('0x31')],qs[_0x147d('0x36')](_0x98877['query'][_0x147d('0x36')]));_0x16f01a[_0x147d('0x37')]=_0x16f01a[_0x147d('0x37')]['length']?_0x16f01a[_0x147d('0x37')]:_0x877b9f[_0x147d('0x31')];_0x16f01a[_0x147d('0x3a')]=qs[_0x147d('0x3b')](_0x98877[_0x147d('0x32')][_0x147d('0x3b')]);_0x16f01a[_0x147d('0x3c')]=qs['filters'](_[_0x147d('0x3d')](_0x98877[_0x147d('0x32')],_0x877b9f['filters']));if(_0x98877[_0x147d('0x32')][_0x147d('0x3e')]){_0x16f01a['where']=_[_0x147d('0x3f')](_0x16f01a[_0x147d('0x3c')],{'$or':_['map'](_0x16f01a['attributes'],function(_0x2236de){var _0x591917={};_0x591917[_0x2236de]={'$like':'%'+_0x98877['query']['filter']+'%'};return _0x591917;})});}_0x16f01a=_[_0x147d('0x3f')]({},_0x16f01a,_0x98877[_0x147d('0x41')]);return _0x36bc91[_0x147d('0x4d')](_0x16f01a);}})[_0x147d('0x23')](function(_0xa08323){if(_0xa08323){_0x287a8f=_0xa08323[_0x147d('0x38')];if(!_0x98877[_0x147d('0x32')][_0x147d('0x4c')](_0x147d('0x39'))){_0x16f01a[_0x147d('0x1d')]=qs[_0x147d('0x1d')](_0x98877[_0x147d('0x32')]['limit']);_0x16f01a[_0x147d('0x1a')]=qs[_0x147d('0x1a')](_0x98877['query'][_0x147d('0x1a')]);}return _0x36bc91[_0x147d('0x4d')](_0x16f01a);}})[_0x147d('0x23')](function(_0x5987e4){if(_0x5987e4){return _0x5987e4?{'count':_0x287a8f,'rows':_0x5987e4}:null;}})[_0x147d('0x23')](respondWithResult(_0xb97daf,null))[_0x147d('0x44')](handleError(_0xb97daf,null));};exports[_0x147d('0x4f')]=function(_0xe5d357,_0x3e84f2,_0x3f05cb){var _0x165cfa={};var _0x476e32={};var _0x5dd3a0;var _0x34dea2;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0xe5d357[_0x147d('0x49')]['id']}})[_0x147d('0x23')](handleEntityNotFound(_0x3e84f2,null))[_0x147d('0x23')](function(_0x5004e6){if(_0x5004e6){_0x5dd3a0=_0x5004e6;_0x476e32[_0x147d('0x31')]=_['keys'](db['SugarcrmField'][_0x147d('0x2d')]);_0x476e32['query']=_[_0x147d('0x33')](_0xe5d357[_0x147d('0x32')]);_0x476e32[_0x147d('0x34')]=_['intersection'](_0x476e32[_0x147d('0x31')],_0x476e32['query']);_0x165cfa[_0x147d('0x37')]=_['intersection'](_0x476e32[_0x147d('0x31')],qs[_0x147d('0x36')](_0xe5d357[_0x147d('0x32')][_0x147d('0x36')]));_0x165cfa[_0x147d('0x37')]=_0x165cfa[_0x147d('0x37')][_0x147d('0x38')]?_0x165cfa[_0x147d('0x37')]:_0x476e32['model'];_0x165cfa[_0x147d('0x3a')]=qs[_0x147d('0x3b')](_0xe5d357[_0x147d('0x32')][_0x147d('0x3b')]);_0x165cfa[_0x147d('0x3c')]=qs['filters'](_[_0x147d('0x3d')](_0xe5d357['query'],_0x476e32[_0x147d('0x34')]));if(_0xe5d357['query'][_0x147d('0x3e')]){_0x165cfa[_0x147d('0x3c')]=_[_0x147d('0x3f')](_0x165cfa['where'],{'$or':_['map'](_0x165cfa[_0x147d('0x37')],function(_0x2c863c){var _0x28705c={};_0x28705c[_0x2c863c]={'$like':'%'+_0xe5d357[_0x147d('0x32')][_0x147d('0x3e')]+'%'};return _0x28705c;})});}_0x165cfa=_[_0x147d('0x3f')]({},_0x165cfa,_0xe5d357[_0x147d('0x41')]);return _0x5dd3a0[_0x147d('0x4f')](_0x165cfa);}})[_0x147d('0x23')](function(_0x1a251b){if(_0x1a251b){_0x34dea2=_0x1a251b[_0x147d('0x38')];if(!_0xe5d357['query'][_0x147d('0x4c')](_0x147d('0x39'))){_0x165cfa[_0x147d('0x1d')]=qs[_0x147d('0x1d')](_0xe5d357[_0x147d('0x32')]['limit']);_0x165cfa[_0x147d('0x1a')]=qs[_0x147d('0x1a')](_0xe5d357['query']['offset']);}return _0x5dd3a0[_0x147d('0x4f')](_0x165cfa);}})[_0x147d('0x23')](function(_0x24fc48){if(_0x24fc48){return _0x24fc48?{'count':_0x34dea2,'rows':_0x24fc48}:null;}})[_0x147d('0x23')](respondWithResult(_0x3e84f2,null))[_0x147d('0x44')](handleError(_0x3e84f2,null));}; \ No newline at end of file +var _0x49fe=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','SugarcrmConfiguration','findAll','rows','catch','params','include','create','body','find','findOne','SugarcrmField','getFields','getSubjects','getDescriptions','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x85287e,_0x22e3df){var _0x218496=function(_0x526b3f){while(--_0x526b3f){_0x85287e['push'](_0x85287e['shift']());}};_0x218496(++_0x22e3df);}(_0x49fe,0x157));var _0xe49f=function(_0x5a3beb,_0x3517bc){_0x5a3beb=_0x5a3beb-0x0;var _0x57cd57=_0x49fe[_0x5a3beb];return _0x57cd57;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe49f('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe49f('0x1'));var moment=require(_0xe49f('0x2'));var BPromise=require(_0xe49f('0x3'));var Mustache=require(_0xe49f('0x4'));var util=require(_0xe49f('0x5'));var path=require(_0xe49f('0x6'));var sox=require(_0xe49f('0x7'));var csv=require(_0xe49f('0x8'));var ejs=require(_0xe49f('0x9'));var fs=require('fs');var fs_extra=require(_0xe49f('0xa'));var _=require(_0xe49f('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe49f('0xc'));var deskjs=require(_0xe49f('0xd'));var toCsv=require(_0xe49f('0x8'));var querystring=require(_0xe49f('0xe'));var Papa=require(_0xe49f('0xf'));var Redis=require(_0xe49f('0x10'));var authService=require(_0xe49f('0x11'));var qs=require(_0xe49f('0x12'));var as=require(_0xe49f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe49f('0x14'))(_0xe49f('0x15'));var utils=require(_0xe49f('0x16'));var config=require(_0xe49f('0x17'));var licenseUtil=require(_0xe49f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x57c575,_0x41780c){_0x41780c=_0x41780c||0xcc;return function(_0x48dd89){if(_0x48dd89){return _0x57c575['sendStatus'](_0x41780c);}return _0x57c575[_0xe49f('0x19')](_0x41780c)[_0xe49f('0x1a')]();};}function respondWithResult(_0xf3bb3d,_0x38fc8a){_0x38fc8a=_0x38fc8a||0xc8;return function(_0x2307ab){if(_0x2307ab){return _0xf3bb3d[_0xe49f('0x19')](_0x38fc8a)[_0xe49f('0x1b')](_0x2307ab);}};}function respondWithFilteredResult(_0x5045e3,_0x3f403e){return function(_0x32692f){if(_0x32692f){var _0xebb356=typeof _0x3f403e[_0xe49f('0x1c')]==='undefined'&&typeof _0x3f403e[_0xe49f('0x1d')]===_0xe49f('0x1e');var _0x2c0c55=_0x32692f[_0xe49f('0x1f')];var _0x378dae=_0xebb356?0x0:_0x3f403e['offset'];var _0x43a800=_0xebb356?_0x32692f[_0xe49f('0x1f')]:_0x3f403e[_0xe49f('0x1c')]+_0x3f403e['limit'];var _0x508bcc;if(_0x43a800>=_0x2c0c55){_0x43a800=_0x2c0c55;_0x508bcc=0xc8;}else{_0x508bcc=0xce;}_0x5045e3[_0xe49f('0x19')](_0x508bcc);return _0x5045e3[_0xe49f('0x20')](_0xe49f('0x21'),_0x378dae+'-'+_0x43a800+'/'+_0x2c0c55)[_0xe49f('0x1b')](_0x32692f);}return null;};}function patchUpdates(_0x2ec974){return function(_0x469559){try{jsonpatch[_0xe49f('0x22')](_0x469559,_0x2ec974,!![]);}catch(_0x3bfcad){return BPromise[_0xe49f('0x23')](_0x3bfcad);}return _0x469559['save']();};}function saveUpdates(_0x40dc88,_0x27b95c){return function(_0x218ea1){if(_0x218ea1){return _0x218ea1[_0xe49f('0x24')](_0x40dc88)[_0xe49f('0x25')](function(_0x1e2e12){return _0x1e2e12;});}return null;};}function removeEntity(_0x2ff127,_0x11d6d6){return function(_0x54f15a){if(_0x54f15a){return _0x54f15a[_0xe49f('0x26')]()[_0xe49f('0x25')](function(){_0x2ff127['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f41f6,_0x323cea){return function(_0x26b15d){if(!_0x26b15d){_0x3f41f6[_0xe49f('0x27')](0x194);}return _0x26b15d;};}function handleError(_0x160c37,_0x450355){_0x450355=_0x450355||0x1f4;return function(_0x2ebad6){logger[_0xe49f('0x28')](_0x2ebad6[_0xe49f('0x29')]);if(_0x2ebad6['name']){delete _0x2ebad6[_0xe49f('0x2a')];}_0x160c37['status'](_0x450355)[_0xe49f('0x2b')](_0x2ebad6);};}exports[_0xe49f('0x2c')]=function(_0x16b4be,_0x366762){var _0x3f25e0={},_0x14af1d={},_0x1fb9fd={'count':0x0,'rows':[]};var _0xa5621=_[_0xe49f('0x2d')](db['SugarcrmConfiguration'][_0xe49f('0x2e')],function(_0x2a3fba){return{'name':_0x2a3fba['fieldName'],'type':_0x2a3fba[_0xe49f('0x2f')][_0xe49f('0x30')]};});_0x14af1d[_0xe49f('0x31')]=_[_0xe49f('0x2d')](_0xa5621,_0xe49f('0x2a'));_0x14af1d[_0xe49f('0x32')]=_[_0xe49f('0x33')](_0x16b4be[_0xe49f('0x32')]);_0x14af1d[_0xe49f('0x34')]=_[_0xe49f('0x35')](_0x14af1d[_0xe49f('0x31')],_0x14af1d[_0xe49f('0x32')]);_0x3f25e0[_0xe49f('0x36')]=_[_0xe49f('0x35')](_0x14af1d[_0xe49f('0x31')],qs['fields'](_0x16b4be['query'][_0xe49f('0x37')]));_0x3f25e0[_0xe49f('0x36')]=_0x3f25e0[_0xe49f('0x36')][_0xe49f('0x38')]?_0x3f25e0[_0xe49f('0x36')]:_0x14af1d[_0xe49f('0x31')];if(!_0x16b4be[_0xe49f('0x32')][_0xe49f('0x39')](_0xe49f('0x3a'))){_0x3f25e0['limit']=qs[_0xe49f('0x1d')](_0x16b4be[_0xe49f('0x32')][_0xe49f('0x1d')]);_0x3f25e0['offset']=qs['offset'](_0x16b4be[_0xe49f('0x32')][_0xe49f('0x1c')]);}_0x3f25e0[_0xe49f('0x3b')]=qs[_0xe49f('0x3c')](_0x16b4be[_0xe49f('0x32')][_0xe49f('0x3c')]);_0x3f25e0[_0xe49f('0x3d')]=qs['filters'](_[_0xe49f('0x3e')](_0x16b4be[_0xe49f('0x32')],_0x14af1d[_0xe49f('0x34')]),_0xa5621);if(_0x16b4be[_0xe49f('0x32')][_0xe49f('0x3f')]){_0x3f25e0[_0xe49f('0x3d')]=_[_0xe49f('0x40')](_0x3f25e0[_0xe49f('0x3d')],{'$or':_[_0xe49f('0x2d')](_0xa5621,function(_0x2a26bf){if(_0x2a26bf['type']!=='VIRTUAL'){var _0xeb75b3={};_0xeb75b3[_0x2a26bf[_0xe49f('0x2a')]]={'$like':'%'+_0x16b4be[_0xe49f('0x32')]['filter']+'%'};return _0xeb75b3;}})});}_0x3f25e0=_['merge']({},_0x3f25e0,_0x16b4be[_0xe49f('0x41')]);var _0x1115ac={'where':_0x3f25e0[_0xe49f('0x3d')]};return db[_0xe49f('0x42')][_0xe49f('0x1f')](_0x1115ac)[_0xe49f('0x25')](function(_0x1c0233){_0x1fb9fd[_0xe49f('0x1f')]=_0x1c0233;if(_0x16b4be[_0xe49f('0x32')]['includeAll']){_0x3f25e0['include']=[{'all':!![]}];}return db[_0xe49f('0x42')][_0xe49f('0x43')](_0x3f25e0);})[_0xe49f('0x25')](function(_0x45fbd9){_0x1fb9fd[_0xe49f('0x44')]=_0x45fbd9;return _0x1fb9fd;})[_0xe49f('0x25')](respondWithFilteredResult(_0x366762,_0x3f25e0))[_0xe49f('0x45')](handleError(_0x366762,null));};exports['show']=function(_0x2949a2,_0x29ed26){var _0x26fa72={'raw':![],'where':{'id':_0x2949a2[_0xe49f('0x46')]['id']}},_0x4c0876={};_0x4c0876['model']=_[_0xe49f('0x33')](db['SugarcrmConfiguration'][_0xe49f('0x2e')]);_0x4c0876[_0xe49f('0x32')]=_[_0xe49f('0x33')](_0x2949a2[_0xe49f('0x32')]);_0x4c0876[_0xe49f('0x34')]=_['intersection'](_0x4c0876[_0xe49f('0x31')],_0x4c0876[_0xe49f('0x32')]);_0x26fa72[_0xe49f('0x36')]=_['intersection'](_0x4c0876[_0xe49f('0x31')],qs[_0xe49f('0x37')](_0x2949a2[_0xe49f('0x32')][_0xe49f('0x37')]));_0x26fa72['attributes']=_0x26fa72[_0xe49f('0x36')][_0xe49f('0x38')]?_0x26fa72[_0xe49f('0x36')]:_0x4c0876[_0xe49f('0x31')];if(_0x2949a2[_0xe49f('0x32')]['includeAll']){_0x26fa72[_0xe49f('0x47')]=[{'all':!![]}];}_0x26fa72=_[_0xe49f('0x40')]({},_0x26fa72,_0x2949a2[_0xe49f('0x41')]);return db[_0xe49f('0x42')]['find'](_0x26fa72)[_0xe49f('0x25')](handleEntityNotFound(_0x29ed26,null))[_0xe49f('0x25')](respondWithResult(_0x29ed26,null))['catch'](handleError(_0x29ed26,null));};exports[_0xe49f('0x48')]=function(_0xb6ee3,_0x5edb3b){return db[_0xe49f('0x42')]['create'](_0xb6ee3['body'],{})[_0xe49f('0x25')](respondWithResult(_0x5edb3b,0xc9))['catch'](handleError(_0x5edb3b,null));};exports[_0xe49f('0x24')]=function(_0x58a22f,_0x2613b4){if(_0x58a22f[_0xe49f('0x49')]['id']){delete _0x58a22f['body']['id'];}return db['SugarcrmConfiguration'][_0xe49f('0x4a')]({'where':{'id':_0x58a22f[_0xe49f('0x46')]['id']}})[_0xe49f('0x25')](handleEntityNotFound(_0x2613b4,null))[_0xe49f('0x25')](saveUpdates(_0x58a22f[_0xe49f('0x49')],null))[_0xe49f('0x25')](respondWithResult(_0x2613b4,null))['catch'](handleError(_0x2613b4,null));};exports['destroy']=function(_0x7f152e,_0x31426a){return db[_0xe49f('0x42')][_0xe49f('0x4a')]({'where':{'id':_0x7f152e[_0xe49f('0x46')]['id']}})[_0xe49f('0x25')](handleEntityNotFound(_0x31426a,null))['then'](removeEntity(_0x31426a,null))[_0xe49f('0x45')](handleError(_0x31426a,null));};exports['getFields']=function(_0x95ca9c,_0x196e17,_0x2d95cd){var _0x28a6fa={};var _0x19e9dc={};var _0x54d471;var _0x238e67;return db[_0xe49f('0x42')][_0xe49f('0x4b')]({'where':{'id':_0x95ca9c[_0xe49f('0x46')]['id']}})['then'](handleEntityNotFound(_0x196e17,null))[_0xe49f('0x25')](function(_0x3af858){if(_0x3af858){_0x54d471=_0x3af858;_0x19e9dc[_0xe49f('0x31')]=_[_0xe49f('0x33')](db[_0xe49f('0x4c')][_0xe49f('0x2e')]);_0x19e9dc[_0xe49f('0x32')]=_['keys'](_0x95ca9c[_0xe49f('0x32')]);_0x19e9dc['filters']=_[_0xe49f('0x35')](_0x19e9dc['model'],_0x19e9dc['query']);_0x28a6fa['attributes']=_[_0xe49f('0x35')](_0x19e9dc[_0xe49f('0x31')],qs[_0xe49f('0x37')](_0x95ca9c[_0xe49f('0x32')][_0xe49f('0x37')]));_0x28a6fa[_0xe49f('0x36')]=_0x28a6fa[_0xe49f('0x36')]['length']?_0x28a6fa[_0xe49f('0x36')]:_0x19e9dc[_0xe49f('0x31')];_0x28a6fa[_0xe49f('0x3b')]=qs[_0xe49f('0x3c')](_0x95ca9c[_0xe49f('0x32')]['sort']);_0x28a6fa[_0xe49f('0x3d')]=qs[_0xe49f('0x34')](_[_0xe49f('0x3e')](_0x95ca9c[_0xe49f('0x32')],_0x19e9dc[_0xe49f('0x34')]));if(_0x95ca9c[_0xe49f('0x32')][_0xe49f('0x3f')]){_0x28a6fa[_0xe49f('0x3d')]=_[_0xe49f('0x40')](_0x28a6fa[_0xe49f('0x3d')],{'$or':_[_0xe49f('0x2d')](_0x28a6fa[_0xe49f('0x36')],function(_0x26f958){var _0x5b273e={};_0x5b273e[_0x26f958]={'$like':'%'+_0x95ca9c[_0xe49f('0x32')][_0xe49f('0x3f')]+'%'};return _0x5b273e;})});}_0x28a6fa=_['merge']({},_0x28a6fa,_0x95ca9c['options']);return _0x54d471[_0xe49f('0x4d')](_0x28a6fa);}})[_0xe49f('0x25')](function(_0x3933c2){if(_0x3933c2){_0x238e67=_0x3933c2[_0xe49f('0x38')];if(!_0x95ca9c[_0xe49f('0x32')][_0xe49f('0x39')](_0xe49f('0x3a'))){_0x28a6fa[_0xe49f('0x1d')]=qs[_0xe49f('0x1d')](_0x95ca9c[_0xe49f('0x32')][_0xe49f('0x1d')]);_0x28a6fa[_0xe49f('0x1c')]=qs['offset'](_0x95ca9c['query'][_0xe49f('0x1c')]);}return _0x54d471[_0xe49f('0x4d')](_0x28a6fa);}})[_0xe49f('0x25')](function(_0x2b9062){if(_0x2b9062){return _0x2b9062?{'count':_0x238e67,'rows':_0x2b9062}:null;}})[_0xe49f('0x25')](respondWithResult(_0x196e17,null))[_0xe49f('0x45')](handleError(_0x196e17,null));};exports[_0xe49f('0x4e')]=function(_0xe97abf,_0x56e476,_0x349c91){var _0x5c165d={};var _0x1e2841={};var _0x30e211;var _0x5d86d;return db['SugarcrmConfiguration'][_0xe49f('0x4b')]({'where':{'id':_0xe97abf['params']['id']}})[_0xe49f('0x25')](handleEntityNotFound(_0x56e476,null))[_0xe49f('0x25')](function(_0x5502a1){if(_0x5502a1){_0x30e211=_0x5502a1;_0x1e2841[_0xe49f('0x31')]=_['keys'](db[_0xe49f('0x4c')][_0xe49f('0x2e')]);_0x1e2841[_0xe49f('0x32')]=_[_0xe49f('0x33')](_0xe97abf[_0xe49f('0x32')]);_0x1e2841['filters']=_[_0xe49f('0x35')](_0x1e2841[_0xe49f('0x31')],_0x1e2841[_0xe49f('0x32')]);_0x5c165d[_0xe49f('0x36')]=_['intersection'](_0x1e2841[_0xe49f('0x31')],qs[_0xe49f('0x37')](_0xe97abf[_0xe49f('0x32')]['fields']));_0x5c165d[_0xe49f('0x36')]=_0x5c165d[_0xe49f('0x36')][_0xe49f('0x38')]?_0x5c165d[_0xe49f('0x36')]:_0x1e2841[_0xe49f('0x31')];_0x5c165d[_0xe49f('0x3b')]=qs[_0xe49f('0x3c')](_0xe97abf[_0xe49f('0x32')][_0xe49f('0x3c')]);_0x5c165d['where']=qs[_0xe49f('0x34')](_['pick'](_0xe97abf[_0xe49f('0x32')],_0x1e2841[_0xe49f('0x34')]));if(_0xe97abf[_0xe49f('0x32')][_0xe49f('0x3f')]){_0x5c165d['where']=_[_0xe49f('0x40')](_0x5c165d['where'],{'$or':_[_0xe49f('0x2d')](_0x5c165d['attributes'],function(_0x449aba){var _0x1c2224={};_0x1c2224[_0x449aba]={'$like':'%'+_0xe97abf[_0xe49f('0x32')]['filter']+'%'};return _0x1c2224;})});}_0x5c165d=_[_0xe49f('0x40')]({},_0x5c165d,_0xe97abf['options']);return _0x30e211[_0xe49f('0x4e')](_0x5c165d);}})[_0xe49f('0x25')](function(_0x51a283){if(_0x51a283){_0x5d86d=_0x51a283['length'];if(!_0xe97abf['query']['hasOwnProperty'](_0xe49f('0x3a'))){_0x5c165d[_0xe49f('0x1d')]=qs[_0xe49f('0x1d')](_0xe97abf['query'][_0xe49f('0x1d')]);_0x5c165d[_0xe49f('0x1c')]=qs[_0xe49f('0x1c')](_0xe97abf['query'][_0xe49f('0x1c')]);}return _0x30e211[_0xe49f('0x4e')](_0x5c165d);}})[_0xe49f('0x25')](function(_0x1fc40f){if(_0x1fc40f){return _0x1fc40f?{'count':_0x5d86d,'rows':_0x1fc40f}:null;}})[_0xe49f('0x25')](respondWithResult(_0x56e476,null))[_0xe49f('0x45')](handleError(_0x56e476,null));};exports['getDescriptions']=function(_0x2d2454,_0x1cd32f,_0x442b8e){var _0x31634b={};var _0x5206ea={};var _0x2d671e;var _0x330da5;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x2d2454['params']['id']}})[_0xe49f('0x25')](handleEntityNotFound(_0x1cd32f,null))[_0xe49f('0x25')](function(_0x2c4a83){if(_0x2c4a83){_0x2d671e=_0x2c4a83;_0x5206ea[_0xe49f('0x31')]=_[_0xe49f('0x33')](db['SugarcrmField'][_0xe49f('0x2e')]);_0x5206ea['query']=_['keys'](_0x2d2454['query']);_0x5206ea['filters']=_[_0xe49f('0x35')](_0x5206ea[_0xe49f('0x31')],_0x5206ea[_0xe49f('0x32')]);_0x31634b['attributes']=_[_0xe49f('0x35')](_0x5206ea[_0xe49f('0x31')],qs['fields'](_0x2d2454['query']['fields']));_0x31634b[_0xe49f('0x36')]=_0x31634b['attributes'][_0xe49f('0x38')]?_0x31634b[_0xe49f('0x36')]:_0x5206ea[_0xe49f('0x31')];_0x31634b[_0xe49f('0x3b')]=qs[_0xe49f('0x3c')](_0x2d2454[_0xe49f('0x32')][_0xe49f('0x3c')]);_0x31634b['where']=qs[_0xe49f('0x34')](_[_0xe49f('0x3e')](_0x2d2454[_0xe49f('0x32')],_0x5206ea[_0xe49f('0x34')]));if(_0x2d2454[_0xe49f('0x32')][_0xe49f('0x3f')]){_0x31634b['where']=_[_0xe49f('0x40')](_0x31634b[_0xe49f('0x3d')],{'$or':_[_0xe49f('0x2d')](_0x31634b['attributes'],function(_0x9ae6d0){var _0x41c741={};_0x41c741[_0x9ae6d0]={'$like':'%'+_0x2d2454['query'][_0xe49f('0x3f')]+'%'};return _0x41c741;})});}_0x31634b=_['merge']({},_0x31634b,_0x2d2454[_0xe49f('0x41')]);return _0x2d671e[_0xe49f('0x4f')](_0x31634b);}})['then'](function(_0x5b9bf3){if(_0x5b9bf3){_0x330da5=_0x5b9bf3['length'];if(!_0x2d2454[_0xe49f('0x32')][_0xe49f('0x39')](_0xe49f('0x3a'))){_0x31634b[_0xe49f('0x1d')]=qs[_0xe49f('0x1d')](_0x2d2454[_0xe49f('0x32')]['limit']);_0x31634b['offset']=qs[_0xe49f('0x1c')](_0x2d2454[_0xe49f('0x32')][_0xe49f('0x1c')]);}return _0x2d671e[_0xe49f('0x4f')](_0x31634b);}})[_0xe49f('0x25')](function(_0x2d652b){if(_0x2d652b){return _0x2d652b?{'count':_0x330da5,'rows':_0x2d652b}:null;}})['then'](respondWithResult(_0x1cd32f,null))[_0xe49f('0x45')](handleError(_0x1cd32f,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 57cd6eb..24e0c8b 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 _0x94c5=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','int_sugarcrm_configurations','lodash'];(function(_0x5a186f,_0x29a83a){var _0x18a9b2=function(_0x1811e6){while(--_0x1811e6){_0x5a186f['push'](_0x5a186f['shift']());}};_0x18a9b2(++_0x29a83a);}(_0x94c5,0xb3));var _0x594c=function(_0x38f4ef,_0x1f0323){_0x38f4ef=_0x38f4ef-0x0;var _0x1fc26e=_0x94c5[_0x38f4ef];return _0x1fc26e;};'use strict';var _=require(_0x594c('0x0'));var util=require('util');var logger=require(_0x594c('0x1'))(_0x594c('0x2'));var moment=require(_0x594c('0x3'));var BPromise=require('bluebird');var rp=require(_0x594c('0x4'));var fs=require('fs');var path=require(_0x594c('0x5'));var rimraf=require(_0x594c('0x6'));var config=require(_0x594c('0x7'));var attributes=require(_0x594c('0x8'));module[_0x594c('0x9')]=function(_0xbefc8b,_0x32b406){return _0xbefc8b[_0x594c('0xa')]('SugarcrmConfiguration',attributes,{'tableName':_0x594c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5425=['util','api','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','SugarcrmConfiguration','int_sugarcrm_configurations','lodash'];(function(_0x4ff008,_0x17ca98){var _0x329638=function(_0x1f43b9){while(--_0x1f43b9){_0x4ff008['push'](_0x4ff008['shift']());}};_0x329638(++_0x17ca98);}(_0x5425,0x77));var _0x5542=function(_0x33fff1,_0x1fe95b){_0x33fff1=_0x33fff1-0x0;var _0x5b3313=_0x5425[_0x33fff1];return _0x5b3313;};'use strict';var _=require(_0x5542('0x0'));var util=require(_0x5542('0x1'));var logger=require('../../config/logger')(_0x5542('0x2'));var moment=require('moment');var BPromise=require(_0x5542('0x3'));var rp=require(_0x5542('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5542('0x5'));var config=require(_0x5542('0x6'));var attributes=require(_0x5542('0x7'));module['exports']=function(_0x418e55,_0x44530a){return _0x418e55['define'](_0x5542('0x8'),attributes,{'tableName':_0x5542('0x9'),'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 9bfe448..d189665 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 _0xb3cd=['../../config/environment','jayson/promise','client','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x23355d,_0x1e5b93){var _0xf766e9=function(_0x2828c2){while(--_0x2828c2){_0x23355d['push'](_0x23355d['shift']());}};_0xf766e9(++_0x1e5b93);}(_0xb3cd,0x1ae));var _0xdb3c=function(_0x54b458,_0x4da21b){_0x54b458=_0x54b458-0x0;var _0x18d704=_0xb3cd[_0x54b458];return _0x18d704;};'use strict';var _=require(_0xdb3c('0x0'));var util=require(_0xdb3c('0x1'));var moment=require(_0xdb3c('0x2'));var BPromise=require(_0xdb3c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdb3c('0x4'));var db=require(_0xdb3c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdb3c('0x6'))('rpc');var config=require(_0xdb3c('0x7'));var jayson=require(_0xdb3c('0x8'));var client=jayson[_0xdb3c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x508d14,_0x145e5b,_0x2af8f9){return new BPromise(function(_0x29962d,_0x55ad2d){return client[_0xdb3c('0xa')](_0x508d14,_0x2af8f9)[_0xdb3c('0xb')](function(_0x161ea0){logger[_0xdb3c('0xc')](_0xdb3c('0xd'),_0x145e5b,_0xdb3c('0xe'));logger[_0xdb3c('0xf')](_0xdb3c('0x10'),_0x145e5b,_0xdb3c('0xe'),JSON[_0xdb3c('0x11')](_0x161ea0));if(_0x161ea0[_0xdb3c('0x12')]){if(_0x161ea0['error'][_0xdb3c('0x13')]===0x1f4){logger[_0xdb3c('0x12')](_0xdb3c('0xd'),_0x145e5b,_0x161ea0[_0xdb3c('0x12')]['message']);return _0x55ad2d(_0x161ea0[_0xdb3c('0x12')][_0xdb3c('0x14')]);}logger[_0xdb3c('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x145e5b,_0x161ea0[_0xdb3c('0x12')][_0xdb3c('0x14')]);return _0x29962d(_0x161ea0[_0xdb3c('0x12')][_0xdb3c('0x14')]);}else{logger[_0xdb3c('0xc')](_0xdb3c('0xd'),_0x145e5b,'request\x20sent');_0x29962d(_0x161ea0[_0xdb3c('0x15')]['message']);}})[_0xdb3c('0x16')](function(_0x49a98d){logger[_0xdb3c('0x12')](_0xdb3c('0xd'),_0x145e5b,_0x49a98d);_0x55ad2d(_0x49a98d);});});} \ No newline at end of file +var _0xf0e1=['then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xf0e1,0x1ac));var _0x1f0e=function(_0x13ed69,_0x229161){_0x13ed69=_0x13ed69-0x0;var _0x50c72e=_0xf0e1[_0x13ed69];return _0x50c72e;};'use strict';var _=require(_0x1f0e('0x0'));var util=require(_0x1f0e('0x1'));var moment=require('moment');var BPromise=require(_0x1f0e('0x2'));var rs=require(_0x1f0e('0x3'));var fs=require('fs');var Redis=require(_0x1f0e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1f0e('0x5'))(_0x1f0e('0x6'));var config=require(_0x1f0e('0x7'));var jayson=require(_0x1f0e('0x8'));var client=jayson[_0x1f0e('0x9')][_0x1f0e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7642de,_0x21975a,_0x2d4b1e){return new BPromise(function(_0x83f238,_0x35ba8b){return client[_0x1f0e('0xb')](_0x7642de,_0x2d4b1e)[_0x1f0e('0xc')](function(_0xe5153d){logger[_0x1f0e('0xd')](_0x1f0e('0xe'),_0x21975a,_0x1f0e('0xf'));logger['debug'](_0x1f0e('0x10'),_0x21975a,_0x1f0e('0xf'),JSON['stringify'](_0xe5153d));if(_0xe5153d[_0x1f0e('0x11')]){if(_0xe5153d['error'][_0x1f0e('0x12')]===0x1f4){logger[_0x1f0e('0x11')](_0x1f0e('0xe'),_0x21975a,_0xe5153d[_0x1f0e('0x11')]['message']);return _0x35ba8b(_0xe5153d[_0x1f0e('0x11')]['message']);}logger[_0x1f0e('0x11')](_0x1f0e('0xe'),_0x21975a,_0xe5153d[_0x1f0e('0x11')][_0x1f0e('0x13')]);return _0x83f238(_0xe5153d[_0x1f0e('0x11')][_0x1f0e('0x13')]);}else{logger[_0x1f0e('0xd')](_0x1f0e('0xe'),_0x21975a,_0x1f0e('0xf'));_0x83f238(_0xe5153d[_0x1f0e('0x14')][_0x1f0e('0x13')]);}})[_0x1f0e('0x15')](function(_0xbe199b){logger[_0x1f0e('0x11')](_0x1f0e('0xe'),_0x21975a,_0xbe199b);_0x35ba8b(_0xbe199b);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 4252fff..591b3a4 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 _0xe0ee=['../../components/interaction/service','./intSugarcrmField.controller','get','isAuthenticated','index','show','post','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4c7d8b,_0x572388){var _0x187158=function(_0x5e956d){while(--_0x5e956d){_0x4c7d8b['push'](_0x4c7d8b['shift']());}};_0x187158(++_0x572388);}(_0xe0ee,0xe9));var _0xee0e=function(_0x3c6125,_0x3b2a9c){_0x3c6125=_0x3c6125-0x0;var _0x2f47b8=_0xe0ee[_0x3c6125];return _0x2f47b8;};'use strict';var multer=require(_0xee0e('0x0'));var util=require(_0xee0e('0x1'));var path=require(_0xee0e('0x2'));var timeout=require(_0xee0e('0x3'));var express=require(_0xee0e('0x4'));var router=express[_0xee0e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xee0e('0x6'));var interaction=require(_0xee0e('0x7'));var config=require('../../config/environment');var controller=require(_0xee0e('0x8'));router[_0xee0e('0x9')]('/',auth[_0xee0e('0xa')](),controller[_0xee0e('0xb')]);router['get']('/:id',auth[_0xee0e('0xa')](),controller[_0xee0e('0xc')]);router[_0xee0e('0xd')]('/',auth[_0xee0e('0xa')](),controller[_0xee0e('0xe')]);router['put'](_0xee0e('0xf'),auth[_0xee0e('0xa')](),controller[_0xee0e('0x10')]);router[_0xee0e('0x11')](_0xee0e('0xf'),auth[_0xee0e('0xa')](),controller[_0xee0e('0x12')]);module[_0xee0e('0x13')]=router; \ No newline at end of file +var _0x05f6=['delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmField.controller','get','isAuthenticated','index','show','create','put','/:id','update'];(function(_0x5044ab,_0x387de1){var _0x19b4c1=function(_0x29a992){while(--_0x29a992){_0x5044ab['push'](_0x5044ab['shift']());}};_0x19b4c1(++_0x387de1);}(_0x05f6,0x146));var _0x605f=function(_0x539b8b,_0x3de140){_0x539b8b=_0x539b8b-0x0;var _0x149b8f=_0x05f6[_0x539b8b];return _0x149b8f;};'use strict';var multer=require(_0x605f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x605f('0x1'));var express=require(_0x605f('0x2'));var router=express[_0x605f('0x3')]();var fs_extra=require(_0x605f('0x4'));var auth=require(_0x605f('0x5'));var interaction=require(_0x605f('0x6'));var config=require('../../config/environment');var controller=require(_0x605f('0x7'));router[_0x605f('0x8')]('/',auth[_0x605f('0x9')](),controller[_0x605f('0xa')]);router[_0x605f('0x8')]('/:id',auth[_0x605f('0x9')](),controller[_0x605f('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x605f('0xc')]);router[_0x605f('0xd')](_0x605f('0xe'),auth[_0x605f('0x9')](),controller[_0x605f('0xf')]);router[_0x605f('0x10')](_0x605f('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x605f('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index f3a1424..22b9df8 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 _0x270f=['sequelize','exports','ENUM','string','variable','customVariable','STRING','BOOLEAN'];(function(_0x385e92,_0xb98f63){var _0x13f730=function(_0x898ed0){while(--_0x898ed0){_0x385e92['push'](_0x385e92['shift']());}};_0x13f730(++_0xb98f63);}(_0x270f,0x190));var _0xf270=function(_0x4fc421,_0x94e88){_0x4fc421=_0x4fc421-0x0;var _0x8c6d63=_0x270f[_0x4fc421];return _0x8c6d63;};'use strict';var Sequelize=require(_0xf270('0x0'));module[_0xf270('0x1')]={'type':{'type':Sequelize[_0xf270('0x2')](_0xf270('0x3'),_0xf270('0x4'),_0xf270('0x5'),'keyValue','picklist'),'defaultValue':_0xf270('0x3')},'content':{'type':Sequelize[_0xf270('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xf270('0x2')]('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0xf270('0x6')]},'idField':{'type':Sequelize[_0xf270('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xf270('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf270('0x6')]}}; \ No newline at end of file +var _0xd2d6=['customVariable','picklist','STRING','sequelize','ENUM','string','variable'];(function(_0x460d22,_0x88b144){var _0x34514d=function(_0x40b860){while(--_0x40b860){_0x460d22['push'](_0x460d22['shift']());}};_0x34514d(++_0x88b144);}(_0xd2d6,0xc0));var _0x6d2d=function(_0x4c9e01,_0x30c03f){_0x4c9e01=_0x4c9e01-0x0;var _0x58634d=_0xd2d6[_0x4c9e01];return _0x58634d;};'use strict';var Sequelize=require(_0x6d2d('0x0'));module['exports']={'type':{'type':Sequelize[_0x6d2d('0x1')](_0x6d2d('0x2'),_0x6d2d('0x3'),_0x6d2d('0x4'),'keyValue',_0x6d2d('0x5')),'defaultValue':_0x6d2d('0x2')},'content':{'type':Sequelize[_0x6d2d('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x6d2d('0x2'),_0x6d2d('0x3'),_0x6d2d('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x6d2d('0x6')]},'nameField':{'type':Sequelize[_0x6d2d('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6d2d('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 38e105e..7c3eec4 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 _0xae9a=['json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xae9a,0x1ec));var _0xaae9=function(_0x19df8e,_0xc8482){_0x19df8e=_0x19df8e-0x0;var _0x378598=_0xae9a[_0x19df8e];return _0x378598;};'use strict';var emlformat=require(_0xaae9('0x0'));var rimraf=require(_0xaae9('0x1'));var zipdir=require(_0xaae9('0x2'));var jsonpatch=require(_0xaae9('0x3'));var rp=require(_0xaae9('0x4'));var moment=require(_0xaae9('0x5'));var BPromise=require(_0xaae9('0x6'));var Mustache=require('mustache');var util=require(_0xaae9('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xaae9('0x8'));var ejs=require(_0xaae9('0x9'));var fs=require('fs');var fs_extra=require(_0xaae9('0xa'));var _=require(_0xaae9('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xaae9('0xc'));var deskjs=require(_0xaae9('0xd'));var toCsv=require(_0xaae9('0x8'));var querystring=require(_0xaae9('0xe'));var Papa=require(_0xaae9('0xf'));var Redis=require(_0xaae9('0x10'));var authService=require(_0xaae9('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xaae9('0x12'));var hardwareService=require(_0xaae9('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaae9('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xaae9('0x15'));var db=require(_0xaae9('0x16'))['db'];function respondWithStatusCode(_0x9d8758,_0x5ba0a6){_0x5ba0a6=_0x5ba0a6||0xcc;return function(_0xf2abe9){if(_0xf2abe9){return _0x9d8758[_0xaae9('0x17')](_0x5ba0a6);}return _0x9d8758[_0xaae9('0x18')](_0x5ba0a6)[_0xaae9('0x19')]();};}function respondWithResult(_0x131f2a,_0x480092){_0x480092=_0x480092||0xc8;return function(_0x4f919d){if(_0x4f919d){return _0x131f2a['status'](_0x480092)[_0xaae9('0x1a')](_0x4f919d);}};}function respondWithFilteredResult(_0x1296a9,_0x4b1564){return function(_0x15cfc3){if(_0x15cfc3){var _0x317ac2=typeof _0x4b1564['offset']===_0xaae9('0x1b')&&typeof _0x4b1564[_0xaae9('0x1c')]===_0xaae9('0x1b');var _0x28ca5f=_0x15cfc3[_0xaae9('0x1d')];var _0x18d50b=_0x317ac2?0x0:_0x4b1564[_0xaae9('0x1e')];var _0x50da43=_0x317ac2?_0x15cfc3['count']:_0x4b1564[_0xaae9('0x1e')]+_0x4b1564[_0xaae9('0x1c')];var _0x4bf874;if(_0x50da43>=_0x28ca5f){_0x50da43=_0x28ca5f;_0x4bf874=0xc8;}else{_0x4bf874=0xce;}_0x1296a9[_0xaae9('0x18')](_0x4bf874);return _0x1296a9[_0xaae9('0x1f')](_0xaae9('0x20'),_0x18d50b+'-'+_0x50da43+'/'+_0x28ca5f)[_0xaae9('0x1a')](_0x15cfc3);}return null;};}function patchUpdates(_0x5268a0){return function(_0x1ddc6c){try{jsonpatch['apply'](_0x1ddc6c,_0x5268a0,!![]);}catch(_0x2823fd){return BPromise[_0xaae9('0x21')](_0x2823fd);}return _0x1ddc6c[_0xaae9('0x22')]();};}function saveUpdates(_0x5102b7,_0x5bcbbb){return function(_0x294f3b){if(_0x294f3b){return _0x294f3b[_0xaae9('0x23')](_0x5102b7)[_0xaae9('0x24')](function(_0x38f1ef){return _0x38f1ef;});}return null;};}function removeEntity(_0x4837be,_0x549e16){return function(_0x105956){if(_0x105956){return _0x105956[_0xaae9('0x25')]()[_0xaae9('0x24')](function(){_0x4837be['status'](0xcc)[_0xaae9('0x19')]();});}};}function handleEntityNotFound(_0x3decf1,_0x4ae8ec){return function(_0x83ae18){if(!_0x83ae18){_0x3decf1['sendStatus'](0x194);}return _0x83ae18;};}function handleError(_0x5f12f3,_0x5510f8){_0x5510f8=_0x5510f8||0x1f4;return function(_0x572981){logger['error'](_0x572981[_0xaae9('0x26')]);if(_0x572981[_0xaae9('0x27')]){delete _0x572981[_0xaae9('0x27')];}_0x5f12f3[_0xaae9('0x18')](_0x5510f8)[_0xaae9('0x28')](_0x572981);};}exports[_0xaae9('0x29')]=function(_0x3f5691,_0x38a1fc){var _0x1ccb3f={},_0x209ed7={},_0x5ad926={'count':0x0,'rows':[]};var _0xadf5fa=_[_0xaae9('0x2a')](db[_0xaae9('0x2b')][_0xaae9('0x2c')],function(_0x4de96b){return{'name':_0x4de96b[_0xaae9('0x2d')],'type':_0x4de96b[_0xaae9('0x2e')][_0xaae9('0x2f')]};});_0x209ed7[_0xaae9('0x30')]=_[_0xaae9('0x2a')](_0xadf5fa,_0xaae9('0x27'));_0x209ed7[_0xaae9('0x31')]=_[_0xaae9('0x32')](_0x3f5691[_0xaae9('0x31')]);_0x209ed7[_0xaae9('0x33')]=_['intersection'](_0x209ed7['model'],_0x209ed7[_0xaae9('0x31')]);_0x1ccb3f[_0xaae9('0x34')]=_[_0xaae9('0x35')](_0x209ed7[_0xaae9('0x30')],qs[_0xaae9('0x36')](_0x3f5691[_0xaae9('0x31')][_0xaae9('0x36')]));_0x1ccb3f[_0xaae9('0x34')]=_0x1ccb3f['attributes'][_0xaae9('0x37')]?_0x1ccb3f[_0xaae9('0x34')]:_0x209ed7[_0xaae9('0x30')];if(!_0x3f5691[_0xaae9('0x31')]['hasOwnProperty'](_0xaae9('0x38'))){_0x1ccb3f[_0xaae9('0x1c')]=qs[_0xaae9('0x1c')](_0x3f5691[_0xaae9('0x31')][_0xaae9('0x1c')]);_0x1ccb3f[_0xaae9('0x1e')]=qs[_0xaae9('0x1e')](_0x3f5691[_0xaae9('0x31')][_0xaae9('0x1e')]);}_0x1ccb3f[_0xaae9('0x39')]=qs[_0xaae9('0x3a')](_0x3f5691['query'][_0xaae9('0x3a')]);_0x1ccb3f[_0xaae9('0x3b')]=qs[_0xaae9('0x33')](_['pick'](_0x3f5691[_0xaae9('0x31')],_0x209ed7[_0xaae9('0x33')]),_0xadf5fa);if(_0x3f5691[_0xaae9('0x31')][_0xaae9('0x3c')]){_0x1ccb3f['where']=_[_0xaae9('0x3d')](_0x1ccb3f[_0xaae9('0x3b')],{'$or':_[_0xaae9('0x2a')](_0xadf5fa,function(_0xbbc097){if(_0xbbc097[_0xaae9('0x2e')]!==_0xaae9('0x3e')){var _0x254ce8={};_0x254ce8[_0xbbc097['name']]={'$like':'%'+_0x3f5691[_0xaae9('0x31')][_0xaae9('0x3c')]+'%'};return _0x254ce8;}})});}_0x1ccb3f=_[_0xaae9('0x3d')]({},_0x1ccb3f,_0x3f5691[_0xaae9('0x3f')]);var _0x297ea6={'where':_0x1ccb3f['where']};return db[_0xaae9('0x2b')][_0xaae9('0x1d')](_0x297ea6)[_0xaae9('0x24')](function(_0x22b4be){_0x5ad926[_0xaae9('0x1d')]=_0x22b4be;if(_0x3f5691[_0xaae9('0x31')][_0xaae9('0x40')]){_0x1ccb3f[_0xaae9('0x41')]=[{'all':!![]}];}return db[_0xaae9('0x2b')][_0xaae9('0x42')](_0x1ccb3f);})[_0xaae9('0x24')](function(_0x2177d0){_0x5ad926[_0xaae9('0x43')]=_0x2177d0;return _0x5ad926;})[_0xaae9('0x24')](respondWithFilteredResult(_0x38a1fc,_0x1ccb3f))[_0xaae9('0x44')](handleError(_0x38a1fc,null));};exports[_0xaae9('0x45')]=function(_0x462664,_0xc55ed3){var _0x582c1b={'raw':!![],'where':{'id':_0x462664[_0xaae9('0x46')]['id']}},_0x355873={};_0x355873['model']=_[_0xaae9('0x32')](db[_0xaae9('0x2b')][_0xaae9('0x2c')]);_0x355873[_0xaae9('0x31')]=_[_0xaae9('0x32')](_0x462664[_0xaae9('0x31')]);_0x355873[_0xaae9('0x33')]=_[_0xaae9('0x35')](_0x355873[_0xaae9('0x30')],_0x355873[_0xaae9('0x31')]);_0x582c1b[_0xaae9('0x34')]=_[_0xaae9('0x35')](_0x355873[_0xaae9('0x30')],qs['fields'](_0x462664[_0xaae9('0x31')][_0xaae9('0x36')]));_0x582c1b[_0xaae9('0x34')]=_0x582c1b[_0xaae9('0x34')][_0xaae9('0x37')]?_0x582c1b[_0xaae9('0x34')]:_0x355873[_0xaae9('0x30')];if(_0x462664[_0xaae9('0x31')][_0xaae9('0x40')]){_0x582c1b['include']=[{'all':!![]}];}_0x582c1b=_[_0xaae9('0x3d')]({},_0x582c1b,_0x462664['options']);return db[_0xaae9('0x2b')][_0xaae9('0x47')](_0x582c1b)['then'](handleEntityNotFound(_0xc55ed3,null))[_0xaae9('0x24')](respondWithResult(_0xc55ed3,null))['catch'](handleError(_0xc55ed3,null));};exports[_0xaae9('0x48')]=function(_0x141ea2,_0x781be0){return db[_0xaae9('0x2b')]['create'](_0x141ea2[_0xaae9('0x49')],{})[_0xaae9('0x24')](respondWithResult(_0x781be0,0xc9))[_0xaae9('0x44')](handleError(_0x781be0,null));};exports[_0xaae9('0x23')]=function(_0x42a4f0,_0x395fdf){if(_0x42a4f0[_0xaae9('0x49')]['id']){delete _0x42a4f0[_0xaae9('0x49')]['id'];}return db[_0xaae9('0x2b')][_0xaae9('0x47')]({'where':{'id':_0x42a4f0['params']['id']}})[_0xaae9('0x24')](handleEntityNotFound(_0x395fdf,null))[_0xaae9('0x24')](saveUpdates(_0x42a4f0[_0xaae9('0x49')],null))[_0xaae9('0x24')](respondWithResult(_0x395fdf,null))[_0xaae9('0x44')](handleError(_0x395fdf,null));};exports[_0xaae9('0x25')]=function(_0x479e5c,_0x416622){return db[_0xaae9('0x2b')][_0xaae9('0x47')]({'where':{'id':_0x479e5c[_0xaae9('0x46')]['id']}})['then'](handleEntityNotFound(_0x416622,null))[_0xaae9('0x24')](removeEntity(_0x416622,null))[_0xaae9('0x44')](handleError(_0x416622,null));}; \ No newline at end of file +var _0x7f20=['save','update','error','stack','name','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','SugarcrmField','includeAll','include','findAll','rows','then','catch','show','params','find','create','body','eml-format','rimraf','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x7f20,0x1e2));var _0x07f2=function(_0x6116df,_0x395faf){_0x6116df=_0x6116df-0x0;var _0x3c6942=_0x7f20[_0x6116df];return _0x3c6942;};'use strict';var emlformat=require(_0x07f2('0x0'));var rimraf=require(_0x07f2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x07f2('0x2'));var Mustache=require(_0x07f2('0x3'));var util=require(_0x07f2('0x4'));var path=require(_0x07f2('0x5'));var sox=require(_0x07f2('0x6'));var csv=require('to-csv');var ejs=require(_0x07f2('0x7'));var fs=require('fs');var fs_extra=require(_0x07f2('0x8'));var _=require(_0x07f2('0x9'));var squel=require(_0x07f2('0xa'));var crypto=require(_0x07f2('0xb'));var jsforce=require(_0x07f2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x07f2('0xd'));var querystring=require(_0x07f2('0xe'));var Papa=require('papaparse');var Redis=require(_0x07f2('0xf'));var authService=require(_0x07f2('0x10'));var qs=require(_0x07f2('0x11'));var as=require(_0x07f2('0x12'));var hardwareService=require(_0x07f2('0x13'));var logger=require(_0x07f2('0x14'))(_0x07f2('0x15'));var utils=require(_0x07f2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x07f2('0x17'));var db=require(_0x07f2('0x18'))['db'];function respondWithStatusCode(_0x4e4bbb,_0x57ec7d){_0x57ec7d=_0x57ec7d||0xcc;return function(_0x2cc113){if(_0x2cc113){return _0x4e4bbb[_0x07f2('0x19')](_0x57ec7d);}return _0x4e4bbb[_0x07f2('0x1a')](_0x57ec7d)[_0x07f2('0x1b')]();};}function respondWithResult(_0x4cc09e,_0x39781f){_0x39781f=_0x39781f||0xc8;return function(_0xe09a99){if(_0xe09a99){return _0x4cc09e[_0x07f2('0x1a')](_0x39781f)[_0x07f2('0x1c')](_0xe09a99);}};}function respondWithFilteredResult(_0x5defe1,_0x1b1d32){return function(_0x5b108f){if(_0x5b108f){var _0x52dad2=typeof _0x1b1d32[_0x07f2('0x1d')]===_0x07f2('0x1e')&&typeof _0x1b1d32[_0x07f2('0x1f')]===_0x07f2('0x1e');var _0x50ef4b=_0x5b108f[_0x07f2('0x20')];var _0x21b01f=_0x52dad2?0x0:_0x1b1d32[_0x07f2('0x1d')];var _0x2f8ddd=_0x52dad2?_0x5b108f[_0x07f2('0x20')]:_0x1b1d32['offset']+_0x1b1d32[_0x07f2('0x1f')];var _0x475e9d;if(_0x2f8ddd>=_0x50ef4b){_0x2f8ddd=_0x50ef4b;_0x475e9d=0xc8;}else{_0x475e9d=0xce;}_0x5defe1[_0x07f2('0x1a')](_0x475e9d);return _0x5defe1[_0x07f2('0x21')](_0x07f2('0x22'),_0x21b01f+'-'+_0x2f8ddd+'/'+_0x50ef4b)[_0x07f2('0x1c')](_0x5b108f);}return null;};}function patchUpdates(_0x1238f1){return function(_0x17a8cd){try{jsonpatch[_0x07f2('0x23')](_0x17a8cd,_0x1238f1,!![]);}catch(_0x390d1f){return BPromise['reject'](_0x390d1f);}return _0x17a8cd[_0x07f2('0x24')]();};}function saveUpdates(_0x538c4d,_0x45ef4a){return function(_0x4f5151){if(_0x4f5151){return _0x4f5151[_0x07f2('0x25')](_0x538c4d)['then'](function(_0x32adcb){return _0x32adcb;});}return null;};}function removeEntity(_0x240dc8,_0x25f11a){return function(_0x22e9c0){if(_0x22e9c0){return _0x22e9c0['destroy']()['then'](function(){_0x240dc8[_0x07f2('0x1a')](0xcc)[_0x07f2('0x1b')]();});}};}function handleEntityNotFound(_0x316dab,_0x1e8cb0){return function(_0x4ee38c){if(!_0x4ee38c){_0x316dab[_0x07f2('0x19')](0x194);}return _0x4ee38c;};}function handleError(_0x41f16c,_0x2436b2){_0x2436b2=_0x2436b2||0x1f4;return function(_0xc22771){logger[_0x07f2('0x26')](_0xc22771[_0x07f2('0x27')]);if(_0xc22771[_0x07f2('0x28')]){delete _0xc22771['name'];}_0x41f16c[_0x07f2('0x1a')](_0x2436b2)['send'](_0xc22771);};}exports[_0x07f2('0x29')]=function(_0x1d8f2c,_0x352930){var _0x5bb7c7={},_0x393047={},_0x254581={'count':0x0,'rows':[]};var _0x1ffcb1=_[_0x07f2('0x2a')](db['SugarcrmField'][_0x07f2('0x2b')],function(_0xa57e3){return{'name':_0xa57e3['fieldName'],'type':_0xa57e3[_0x07f2('0x2c')]['key']};});_0x393047[_0x07f2('0x2d')]=_[_0x07f2('0x2a')](_0x1ffcb1,_0x07f2('0x28'));_0x393047[_0x07f2('0x2e')]=_[_0x07f2('0x2f')](_0x1d8f2c['query']);_0x393047[_0x07f2('0x30')]=_[_0x07f2('0x31')](_0x393047[_0x07f2('0x2d')],_0x393047['query']);_0x5bb7c7[_0x07f2('0x32')]=_[_0x07f2('0x31')](_0x393047['model'],qs[_0x07f2('0x33')](_0x1d8f2c[_0x07f2('0x2e')][_0x07f2('0x33')]));_0x5bb7c7[_0x07f2('0x32')]=_0x5bb7c7[_0x07f2('0x32')][_0x07f2('0x34')]?_0x5bb7c7[_0x07f2('0x32')]:_0x393047['model'];if(!_0x1d8f2c[_0x07f2('0x2e')][_0x07f2('0x35')]('nolimit')){_0x5bb7c7[_0x07f2('0x1f')]=qs[_0x07f2('0x1f')](_0x1d8f2c['query'][_0x07f2('0x1f')]);_0x5bb7c7['offset']=qs['offset'](_0x1d8f2c['query']['offset']);}_0x5bb7c7[_0x07f2('0x36')]=qs[_0x07f2('0x37')](_0x1d8f2c[_0x07f2('0x2e')][_0x07f2('0x37')]);_0x5bb7c7['where']=qs[_0x07f2('0x30')](_[_0x07f2('0x38')](_0x1d8f2c[_0x07f2('0x2e')],_0x393047[_0x07f2('0x30')]),_0x1ffcb1);if(_0x1d8f2c['query'][_0x07f2('0x39')]){_0x5bb7c7[_0x07f2('0x3a')]=_[_0x07f2('0x3b')](_0x5bb7c7[_0x07f2('0x3a')],{'$or':_[_0x07f2('0x2a')](_0x1ffcb1,function(_0x5e057b){if(_0x5e057b['type']!==_0x07f2('0x3c')){var _0x2f1cf5={};_0x2f1cf5[_0x5e057b['name']]={'$like':'%'+_0x1d8f2c['query'][_0x07f2('0x39')]+'%'};return _0x2f1cf5;}})});}_0x5bb7c7=_[_0x07f2('0x3b')]({},_0x5bb7c7,_0x1d8f2c[_0x07f2('0x3d')]);var _0x217d49={'where':_0x5bb7c7[_0x07f2('0x3a')]};return db[_0x07f2('0x3e')][_0x07f2('0x20')](_0x217d49)['then'](function(_0x3885c2){_0x254581[_0x07f2('0x20')]=_0x3885c2;if(_0x1d8f2c[_0x07f2('0x2e')][_0x07f2('0x3f')]){_0x5bb7c7[_0x07f2('0x40')]=[{'all':!![]}];}return db['SugarcrmField'][_0x07f2('0x41')](_0x5bb7c7);})['then'](function(_0x5da73b){_0x254581[_0x07f2('0x42')]=_0x5da73b;return _0x254581;})[_0x07f2('0x43')](respondWithFilteredResult(_0x352930,_0x5bb7c7))[_0x07f2('0x44')](handleError(_0x352930,null));};exports[_0x07f2('0x45')]=function(_0x4a93ec,_0x2b2da3){var _0x4a196d={'raw':!![],'where':{'id':_0x4a93ec[_0x07f2('0x46')]['id']}},_0xee186f={};_0xee186f['model']=_[_0x07f2('0x2f')](db[_0x07f2('0x3e')]['rawAttributes']);_0xee186f['query']=_[_0x07f2('0x2f')](_0x4a93ec['query']);_0xee186f[_0x07f2('0x30')]=_[_0x07f2('0x31')](_0xee186f['model'],_0xee186f[_0x07f2('0x2e')]);_0x4a196d['attributes']=_[_0x07f2('0x31')](_0xee186f[_0x07f2('0x2d')],qs[_0x07f2('0x33')](_0x4a93ec[_0x07f2('0x2e')]['fields']));_0x4a196d[_0x07f2('0x32')]=_0x4a196d[_0x07f2('0x32')]['length']?_0x4a196d[_0x07f2('0x32')]:_0xee186f[_0x07f2('0x2d')];if(_0x4a93ec[_0x07f2('0x2e')][_0x07f2('0x3f')]){_0x4a196d['include']=[{'all':!![]}];}_0x4a196d=_['merge']({},_0x4a196d,_0x4a93ec[_0x07f2('0x3d')]);return db[_0x07f2('0x3e')][_0x07f2('0x47')](_0x4a196d)['then'](handleEntityNotFound(_0x2b2da3,null))[_0x07f2('0x43')](respondWithResult(_0x2b2da3,null))['catch'](handleError(_0x2b2da3,null));};exports['create']=function(_0x2ffece,_0x59ab57){return db[_0x07f2('0x3e')][_0x07f2('0x48')](_0x2ffece['body'],{})['then'](respondWithResult(_0x59ab57,0xc9))[_0x07f2('0x44')](handleError(_0x59ab57,null));};exports[_0x07f2('0x25')]=function(_0xe72ea4,_0x3eb571){if(_0xe72ea4[_0x07f2('0x49')]['id']){delete _0xe72ea4[_0x07f2('0x49')]['id'];}return db['SugarcrmField'][_0x07f2('0x47')]({'where':{'id':_0xe72ea4[_0x07f2('0x46')]['id']}})[_0x07f2('0x43')](handleEntityNotFound(_0x3eb571,null))['then'](saveUpdates(_0xe72ea4[_0x07f2('0x49')],null))[_0x07f2('0x43')](respondWithResult(_0x3eb571,null))['catch'](handleError(_0x3eb571,null));};exports['destroy']=function(_0x3fe04e,_0x5ba048){return db['SugarcrmField'][_0x07f2('0x47')]({'where':{'id':_0x3fe04e[_0x07f2('0x46')]['id']}})[_0x07f2('0x43')](handleEntityNotFound(_0x5ba048,null))[_0x07f2('0x43')](removeEntity(_0x5ba048,null))[_0x07f2('0x44')](handleError(_0x5ba048,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 3751c58..430247d 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 _0x5628=['api','bluebird','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x490ebb,_0x5c7170){var _0x1a6d58=function(_0x14d4d2){while(--_0x14d4d2){_0x490ebb['push'](_0x490ebb['shift']());}};_0x1a6d58(++_0x5c7170);}(_0x5628,0x11a));var _0x8562=function(_0x4ec13d,_0x4cb103){_0x4ec13d=_0x4ec13d-0x0;var _0x52c76d=_0x5628[_0x4ec13d];return _0x52c76d;};'use strict';var _=require(_0x8562('0x0'));var util=require(_0x8562('0x1'));var logger=require(_0x8562('0x2'))(_0x8562('0x3'));var moment=require('moment');var BPromise=require(_0x8562('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8562('0x5'));var rimraf=require(_0x8562('0x6'));var config=require(_0x8562('0x7'));var attributes=require(_0x8562('0x8'));module[_0x8562('0x9')]=function(_0x142cc7,_0x53bfd5){return _0x142cc7[_0x8562('0xa')](_0x8562('0xb'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x8562('0xc'),'fields':[_0x8562('0xd'),_0x8562('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x307b=['api','moment','bluebird','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','sugarcrm_unique_index','idField','FieldId','util'];(function(_0x717854,_0x1a4e2f){var _0x406def=function(_0xdfef62){while(--_0xdfef62){_0x717854['push'](_0x717854['shift']());}};_0x406def(++_0x1a4e2f);}(_0x307b,0x6b));var _0xb307=function(_0x3f49bd,_0x242247){_0x3f49bd=_0x3f49bd-0x0;var _0x2c238b=_0x307b[_0x3f49bd];return _0x2c238b;};'use strict';var _=require('lodash');var util=require(_0xb307('0x0'));var logger=require('../../config/logger')(_0xb307('0x1'));var moment=require(_0xb307('0x2'));var BPromise=require(_0xb307('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb307('0x4'));var attributes=require(_0xb307('0x5'));module[_0xb307('0x6')]=function(_0x5601a5,_0x1f9a28){return _0x5601a5[_0xb307('0x7')](_0xb307('0x8'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0xb307('0x9'),'fields':[_0xb307('0xa'),_0xb307('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 c01c0cc..4860667 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 _0x1b1c=['debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SugarcrmField,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent'];(function(_0x5cc831,_0x3822e1){var _0x1ff956=function(_0x33e1cc){while(--_0x33e1cc){_0x5cc831['push'](_0x5cc831['shift']());}};_0x1ff956(++_0x3822e1);}(_0x1b1c,0x1e5));var _0xc1b1=function(_0x15a25a,_0x19c429){_0x15a25a=_0x15a25a-0x0;var _0x1d25f8=_0x1b1c[_0x15a25a];return _0x1d25f8;};'use strict';var _=require(_0xc1b1('0x0'));var util=require(_0xc1b1('0x1'));var moment=require(_0xc1b1('0x2'));var BPromise=require(_0xc1b1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1b1('0x4'));var db=require(_0xc1b1('0x5'))['db'];var utils=require(_0xc1b1('0x6'));var logger=require('../../config/logger')(_0xc1b1('0x7'));var config=require(_0xc1b1('0x8'));var jayson=require(_0xc1b1('0x9'));var client=jayson[_0xc1b1('0xa')][_0xc1b1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23ebca,_0x19ff30,_0x2725b9){return new BPromise(function(_0xa21f92,_0x55f05c){return client[_0xc1b1('0xc')](_0x23ebca,_0x2725b9)[_0xc1b1('0xd')](function(_0x4910ab){logger['info']('SugarcrmField,\x20%s,\x20%s',_0x19ff30,_0xc1b1('0xe'));logger[_0xc1b1('0xf')](_0xc1b1('0x10'),_0x19ff30,_0xc1b1('0xe'),JSON[_0xc1b1('0x11')](_0x4910ab));if(_0x4910ab[_0xc1b1('0x12')]){if(_0x4910ab[_0xc1b1('0x12')][_0xc1b1('0x13')]===0x1f4){logger[_0xc1b1('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x19ff30,_0x4910ab[_0xc1b1('0x12')][_0xc1b1('0x14')]);return _0x55f05c(_0x4910ab['error'][_0xc1b1('0x14')]);}logger['error'](_0xc1b1('0x15'),_0x19ff30,_0x4910ab['error'][_0xc1b1('0x14')]);return _0xa21f92(_0x4910ab[_0xc1b1('0x12')]['message']);}else{logger[_0xc1b1('0x16')](_0xc1b1('0x15'),_0x19ff30,_0xc1b1('0xe'));_0xa21f92(_0x4910ab[_0xc1b1('0x17')][_0xc1b1('0x14')]);}})[_0xc1b1('0x18')](function(_0x2b98b9){logger[_0xc1b1('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x19ff30,_0x2b98b9);_0x55f05c(_0x2b98b9);});});} \ No newline at end of file +var _0x91bf=['info','request\x20sent','stringify','error','code','SugarcrmField,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then'];(function(_0x48a043,_0x2dc464){var _0x508d99=function(_0x5817f4){while(--_0x5817f4){_0x48a043['push'](_0x48a043['shift']());}};_0x508d99(++_0x2dc464);}(_0x91bf,0x1ec));var _0xf91b=function(_0x2f7b32,_0x4aea26){_0x2f7b32=_0x2f7b32-0x0;var _0x17470e=_0x91bf[_0x2f7b32];return _0x17470e;};'use strict';var _=require(_0xf91b('0x0'));var util=require(_0xf91b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf91b('0x2'));var fs=require('fs');var Redis=require(_0xf91b('0x3'));var db=require(_0xf91b('0x4'))['db'];var utils=require(_0xf91b('0x5'));var logger=require(_0xf91b('0x6'))(_0xf91b('0x7'));var config=require(_0xf91b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf91b('0x9')][_0xf91b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x200ce4,_0x1e6e70,_0x2cfac7){return new BPromise(function(_0x244d89,_0x1921a6){return client['request'](_0x200ce4,_0x2cfac7)[_0xf91b('0xb')](function(_0x302d2b){logger[_0xf91b('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x1e6e70,_0xf91b('0xd'));logger['debug']('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x1e6e70,'request\x20sent',JSON[_0xf91b('0xe')](_0x302d2b));if(_0x302d2b[_0xf91b('0xf')]){if(_0x302d2b[_0xf91b('0xf')][_0xf91b('0x10')]===0x1f4){logger[_0xf91b('0xf')](_0xf91b('0x11'),_0x1e6e70,_0x302d2b[_0xf91b('0xf')][_0xf91b('0x12')]);return _0x1921a6(_0x302d2b['error'][_0xf91b('0x12')]);}logger['error']('SugarcrmField,\x20%s,\x20%s',_0x1e6e70,_0x302d2b[_0xf91b('0xf')]['message']);return _0x244d89(_0x302d2b[_0xf91b('0xf')][_0xf91b('0x12')]);}else{logger[_0xf91b('0xc')](_0xf91b('0x11'),_0x1e6e70,_0xf91b('0xd'));_0x244d89(_0x302d2b[_0xf91b('0x13')]['message']);}})[_0xf91b('0x14')](function(_0x116d1d){logger[_0xf91b('0xf')](_0xf91b('0x11'),_0x1e6e70,_0x116d1d);_0x1921a6(_0x116d1d);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 89c858c..90409cc 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 _0xb32d=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer'];(function(_0xe4936,_0x3cd5c0){var _0x254fee=function(_0x3a2b9f){while(--_0x3a2b9f){_0xe4936['push'](_0xe4936['shift']());}};_0x254fee(++_0x3cd5c0);}(_0xb32d,0x1da));var _0xdb32=function(_0x279229,_0x1d69d9){_0x279229=_0x279229-0x0;var _0x195ca7=_0xb32d[_0x279229];return _0x195ca7;};'use strict';var multer=require(_0xdb32('0x0'));var util=require(_0xdb32('0x1'));var path=require(_0xdb32('0x2'));var timeout=require(_0xdb32('0x3'));var express=require(_0xdb32('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdb32('0x5'));var interaction=require(_0xdb32('0x6'));var config=require('../../config/environment');var controller=require(_0xdb32('0x7'));router[_0xdb32('0x8')]('/',auth[_0xdb32('0x9')](),controller[_0xdb32('0xa')]);router[_0xdb32('0x8')](_0xdb32('0xb'),auth['isAuthenticated'](),controller[_0xdb32('0xc')]);router[_0xdb32('0x8')](_0xdb32('0xd'),auth[_0xdb32('0x9')](),controller[_0xdb32('0xe')]);router[_0xdb32('0x8')](_0xdb32('0xf'),auth[_0xdb32('0x9')](),controller[_0xdb32('0x10')]);router[_0xdb32('0x11')]('/',auth[_0xdb32('0x9')](),controller[_0xdb32('0x12')]);router[_0xdb32('0x11')](_0xdb32('0xd'),auth[_0xdb32('0x9')](),controller[_0xdb32('0x13')]);router[_0xdb32('0x14')](_0xdb32('0xb'),auth[_0xdb32('0x9')](),controller[_0xdb32('0x15')]);router[_0xdb32('0x16')]('/:id',auth[_0xdb32('0x9')](),controller[_0xdb32('0x17')]);module[_0xdb32('0x18')]=router; \ No newline at end of file +var _0x6364=['put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create'];(function(_0x2e6dbf,_0x57dd06){var _0x2680e5=function(_0x4018f4){while(--_0x4018f4){_0x2e6dbf['push'](_0x2e6dbf['shift']());}};_0x2680e5(++_0x57dd06);}(_0x6364,0x8f));var _0x4636=function(_0x53e944,_0x251fef){_0x53e944=_0x53e944-0x0;var _0x45e1e2=_0x6364[_0x53e944];return _0x45e1e2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4636('0x0'));var timeout=require(_0x4636('0x1'));var express=require(_0x4636('0x2'));var router=express[_0x4636('0x3')]();var fs_extra=require(_0x4636('0x4'));var auth=require(_0x4636('0x5'));var interaction=require(_0x4636('0x6'));var config=require(_0x4636('0x7'));var controller=require('./intVtigerAccount.controller');router[_0x4636('0x8')]('/',auth[_0x4636('0x9')](),controller[_0x4636('0xa')]);router[_0x4636('0x8')](_0x4636('0xb'),auth['isAuthenticated'](),controller[_0x4636('0xc')]);router[_0x4636('0x8')](_0x4636('0xd'),auth[_0x4636('0x9')](),controller['getConfigurations']);router[_0x4636('0x8')](_0x4636('0xe'),auth[_0x4636('0x9')](),controller[_0x4636('0xf')]);router[_0x4636('0x10')]('/',auth['isAuthenticated'](),controller[_0x4636('0x11')]);router[_0x4636('0x10')](_0x4636('0xd'),auth[_0x4636('0x9')](),controller['addConfiguration']);router[_0x4636('0x12')](_0x4636('0xb'),auth[_0x4636('0x9')](),controller[_0x4636('0x13')]);router[_0x4636('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x4636('0x15')]);module[_0x4636('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 07e94c7..06aa7d0 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 _0x0731=['HelpDesk','exports','STRING'];(function(_0x5ca5bc,_0x5b8a9d){var _0x26ca86=function(_0x1ad9a6){while(--_0x1ad9a6){_0x5ca5bc['push'](_0x5ca5bc['shift']());}};_0x26ca86(++_0x5b8a9d);}(_0x0731,0x1c6));var _0x1073=function(_0x25aa32,_0x4969f2){_0x25aa32=_0x25aa32-0x0;var _0x42d67f=_0x0731[_0x25aa32];return _0x42d67f;};'use strict';var Sequelize=require('sequelize');module[_0x1073('0x0')]={'name':{'type':Sequelize[_0x1073('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1073('0x1')]},'username':{'type':Sequelize[_0x1073('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x1073('0x1')],'allowNull':![],'defaultValue':_0x1073('0x2')},'remoteUri':{'type':Sequelize[_0x1073('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x1073('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x1073('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xd1cb=['STRING','sequelize','exports'];(function(_0x424357,_0x9ebe3e){var _0x29c68e=function(_0x663b5d){while(--_0x663b5d){_0x424357['push'](_0x424357['shift']());}};_0x29c68e(++_0x9ebe3e);}(_0xd1cb,0x142));var _0xbd1c=function(_0x50cc89,_0x5cef49){_0x50cc89=_0x50cc89-0x0;var _0x449d06=_0xd1cb[_0x50cc89];return _0x449d06;};'use strict';var Sequelize=require(_0xbd1c('0x0'));module[_0xbd1c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xbd1c('0x2')]},'username':{'type':Sequelize[_0xbd1c('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xbd1c('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xbd1c('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xbd1c('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xbd1c('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index c8802ef..ea1172b 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 _0xbd10=['keys','rawAttributes','fields','options','find','create','body','catch','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','getFields','username','description','moduleName','remoteUri','serverUrl','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','POST','login','result','token','success','describe','sessionName','autogenerated','reference','remove','includes','editable','false','label','cf_','picklist','picklistValues','value','vTiger\x20error:\x20','test','statusCode','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','error','name','send','index','map','VtigerAccount','type','key','query','filters','model','attributes','intersection','length','sort','pick','filter','where','merge','VIRTUAL','then','includeAll','include','rows','show','params'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xbd10,0xa6));var _0x0bd1=function(_0x970f02,_0x3569b6){_0x970f02=_0x970f02-0x0;var _0x4385dc=_0xbd10[_0x970f02];return _0x4385dc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0bd1('0x0'));var jsonpatch=require(_0x0bd1('0x1'));var rp=require(_0x0bd1('0x2'));var moment=require(_0x0bd1('0x3'));var BPromise=require(_0x0bd1('0x4'));var Mustache=require(_0x0bd1('0x5'));var util=require(_0x0bd1('0x6'));var path=require(_0x0bd1('0x7'));var sox=require(_0x0bd1('0x8'));var csv=require(_0x0bd1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0bd1('0xa'));var squel=require(_0x0bd1('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0bd1('0x9'));var querystring=require(_0x0bd1('0xc'));var Papa=require(_0x0bd1('0xd'));var Redis=require(_0x0bd1('0xe'));var authService=require(_0x0bd1('0xf'));var qs=require(_0x0bd1('0x10'));var as=require(_0x0bd1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x0bd1('0x12'));var config=require(_0x0bd1('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x0bd1('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1f3b5c,_0x497a05){_0x497a05=_0x497a05||0xcc;return function(_0x28ad20){if(_0x28ad20){return _0x1f3b5c['sendStatus'](_0x497a05);}return _0x1f3b5c[_0x0bd1('0x15')](_0x497a05)[_0x0bd1('0x16')]();};}function respondWithResult(_0x3f2c76,_0x355ab8){_0x355ab8=_0x355ab8||0xc8;return function(_0x9d5076){if(_0x9d5076){return _0x3f2c76[_0x0bd1('0x15')](_0x355ab8)[_0x0bd1('0x17')](_0x9d5076);}};}function respondWithFilteredResult(_0x5a7691,_0x74a9f){return function(_0x46cc82){if(_0x46cc82){var _0x9f88e=typeof _0x74a9f[_0x0bd1('0x18')]===_0x0bd1('0x19')&&typeof _0x74a9f[_0x0bd1('0x1a')]===_0x0bd1('0x19');var _0x212866=_0x46cc82['count'];var _0x1aa447=_0x9f88e?0x0:_0x74a9f[_0x0bd1('0x18')];var _0x1fef27=_0x9f88e?_0x46cc82[_0x0bd1('0x1b')]:_0x74a9f[_0x0bd1('0x18')]+_0x74a9f[_0x0bd1('0x1a')];var _0x51d830;if(_0x1fef27>=_0x212866){_0x1fef27=_0x212866;_0x51d830=0xc8;}else{_0x51d830=0xce;}_0x5a7691[_0x0bd1('0x15')](_0x51d830);return _0x5a7691[_0x0bd1('0x1c')](_0x0bd1('0x1d'),_0x1aa447+'-'+_0x1fef27+'/'+_0x212866)[_0x0bd1('0x17')](_0x46cc82);}return null;};}function patchUpdates(_0x438701){return function(_0x549579){try{jsonpatch['apply'](_0x549579,_0x438701,!![]);}catch(_0x85cf69){return BPromise[_0x0bd1('0x1e')](_0x85cf69);}return _0x549579[_0x0bd1('0x1f')]();};}function saveUpdates(_0x2f65a5,_0x32ec49){return function(_0x1b2485){if(_0x1b2485){return _0x1b2485[_0x0bd1('0x20')](_0x2f65a5)['then'](function(_0x216d6f){return _0x216d6f;});}return null;};}function removeEntity(_0x33b3c5,_0x4149a9){return function(_0x2680c6){if(_0x2680c6){return _0x2680c6[_0x0bd1('0x21')]()['then'](function(){_0x33b3c5[_0x0bd1('0x15')](0xcc)[_0x0bd1('0x16')]();});}};}function handleEntityNotFound(_0x4e2a98,_0x189f01){return function(_0x1a2799){if(!_0x1a2799){_0x4e2a98['sendStatus'](0x194);}return _0x1a2799;};}function handleError(_0x4c1485,_0x4d3662){_0x4d3662=_0x4d3662||0x1f4;return function(_0x26319d){logger[_0x0bd1('0x22')](_0x26319d['stack']);if(_0x26319d[_0x0bd1('0x23')]){delete _0x26319d[_0x0bd1('0x23')];}_0x4c1485[_0x0bd1('0x15')](_0x4d3662)[_0x0bd1('0x24')](_0x26319d);};}exports[_0x0bd1('0x25')]=function(_0x4db869,_0x134789){var _0x367130={},_0xe68746={},_0x43f243={'count':0x0,'rows':[]};var _0x3311d4=_[_0x0bd1('0x26')](db[_0x0bd1('0x27')]['rawAttributes'],function(_0x2b3dda){return{'name':_0x2b3dda['fieldName'],'type':_0x2b3dda[_0x0bd1('0x28')][_0x0bd1('0x29')]};});_0xe68746['model']=_[_0x0bd1('0x26')](_0x3311d4,'name');_0xe68746['query']=_['keys'](_0x4db869[_0x0bd1('0x2a')]);_0xe68746[_0x0bd1('0x2b')]=_['intersection'](_0xe68746[_0x0bd1('0x2c')],_0xe68746['query']);_0x367130[_0x0bd1('0x2d')]=_[_0x0bd1('0x2e')](_0xe68746[_0x0bd1('0x2c')],qs['fields'](_0x4db869[_0x0bd1('0x2a')]['fields']));_0x367130[_0x0bd1('0x2d')]=_0x367130[_0x0bd1('0x2d')][_0x0bd1('0x2f')]?_0x367130[_0x0bd1('0x2d')]:_0xe68746[_0x0bd1('0x2c')];if(!_0x4db869[_0x0bd1('0x2a')]['hasOwnProperty']('nolimit')){_0x367130['limit']=qs[_0x0bd1('0x1a')](_0x4db869[_0x0bd1('0x2a')][_0x0bd1('0x1a')]);_0x367130[_0x0bd1('0x18')]=qs[_0x0bd1('0x18')](_0x4db869['query'][_0x0bd1('0x18')]);}_0x367130['order']=qs[_0x0bd1('0x30')](_0x4db869[_0x0bd1('0x2a')][_0x0bd1('0x30')]);_0x367130['where']=qs['filters'](_[_0x0bd1('0x31')](_0x4db869[_0x0bd1('0x2a')],_0xe68746[_0x0bd1('0x2b')]),_0x3311d4);if(_0x4db869['query'][_0x0bd1('0x32')]){_0x367130[_0x0bd1('0x33')]=_[_0x0bd1('0x34')](_0x367130[_0x0bd1('0x33')],{'$or':_[_0x0bd1('0x26')](_0x3311d4,function(_0x1755b5){if(_0x1755b5[_0x0bd1('0x28')]!==_0x0bd1('0x35')){var _0x320ab4={};_0x320ab4[_0x1755b5[_0x0bd1('0x23')]]={'$like':'%'+_0x4db869[_0x0bd1('0x2a')]['filter']+'%'};return _0x320ab4;}})});}_0x367130=_[_0x0bd1('0x34')]({},_0x367130,_0x4db869['options']);var _0x549d43={'where':_0x367130[_0x0bd1('0x33')]};return db[_0x0bd1('0x27')][_0x0bd1('0x1b')](_0x549d43)[_0x0bd1('0x36')](function(_0x2c6c6e){_0x43f243[_0x0bd1('0x1b')]=_0x2c6c6e;if(_0x4db869[_0x0bd1('0x2a')][_0x0bd1('0x37')]){_0x367130[_0x0bd1('0x38')]=[{'all':!![]}];}return db[_0x0bd1('0x27')]['findAll'](_0x367130);})['then'](function(_0x5e30b6){_0x43f243[_0x0bd1('0x39')]=_0x5e30b6;return _0x43f243;})[_0x0bd1('0x36')](respondWithFilteredResult(_0x134789,_0x367130))['catch'](handleError(_0x134789,null));};exports[_0x0bd1('0x3a')]=function(_0x52a96e,_0x5ab7f0){var _0x58c81a={'raw':![],'where':{'id':_0x52a96e[_0x0bd1('0x3b')]['id']}},_0x3067d3={};_0x3067d3[_0x0bd1('0x2c')]=_[_0x0bd1('0x3c')](db[_0x0bd1('0x27')][_0x0bd1('0x3d')]);_0x3067d3[_0x0bd1('0x2a')]=_[_0x0bd1('0x3c')](_0x52a96e[_0x0bd1('0x2a')]);_0x3067d3[_0x0bd1('0x2b')]=_[_0x0bd1('0x2e')](_0x3067d3['model'],_0x3067d3[_0x0bd1('0x2a')]);_0x58c81a['attributes']=_[_0x0bd1('0x2e')](_0x3067d3['model'],qs[_0x0bd1('0x3e')](_0x52a96e[_0x0bd1('0x2a')][_0x0bd1('0x3e')]));_0x58c81a[_0x0bd1('0x2d')]=_0x58c81a[_0x0bd1('0x2d')]['length']?_0x58c81a[_0x0bd1('0x2d')]:_0x3067d3['model'];if(_0x52a96e[_0x0bd1('0x2a')]['includeAll']){_0x58c81a[_0x0bd1('0x38')]=[{'all':!![]}];}_0x58c81a=_[_0x0bd1('0x34')]({},_0x58c81a,_0x52a96e[_0x0bd1('0x3f')]);return db[_0x0bd1('0x27')][_0x0bd1('0x40')](_0x58c81a)['then'](handleEntityNotFound(_0x5ab7f0,null))['then'](respondWithResult(_0x5ab7f0,null))['catch'](handleError(_0x5ab7f0,null));};exports[_0x0bd1('0x41')]=function(_0x53b671,_0x4f78b9){return db['VtigerAccount'][_0x0bd1('0x41')](_0x53b671[_0x0bd1('0x42')],{})[_0x0bd1('0x36')](respondWithResult(_0x4f78b9,0xc9))[_0x0bd1('0x43')](handleError(_0x4f78b9,null));};exports['update']=function(_0x48d14b,_0x357e10){if(_0x48d14b[_0x0bd1('0x42')]['id']){delete _0x48d14b[_0x0bd1('0x42')]['id'];}return db['VtigerAccount'][_0x0bd1('0x40')]({'where':{'id':_0x48d14b[_0x0bd1('0x3b')]['id']}})[_0x0bd1('0x36')](handleEntityNotFound(_0x357e10,null))[_0x0bd1('0x36')](saveUpdates(_0x48d14b['body'],null))[_0x0bd1('0x36')](respondWithResult(_0x357e10,null))[_0x0bd1('0x43')](handleError(_0x357e10,null));};exports[_0x0bd1('0x21')]=function(_0x40f7b3,_0xefdc3b){return db[_0x0bd1('0x27')][_0x0bd1('0x40')]({'where':{'id':_0x40f7b3[_0x0bd1('0x3b')]['id']}})[_0x0bd1('0x36')](handleEntityNotFound(_0xefdc3b,null))[_0x0bd1('0x36')](removeEntity(_0xefdc3b,null))[_0x0bd1('0x43')](handleError(_0xefdc3b,null));};exports[_0x0bd1('0x44')]=function(_0x63b4c2,_0x3d7bf9,_0x5a2f73){var _0x35926c={};var _0x4c2052={};var _0xfcf3ed;var _0x19267f;return db[_0x0bd1('0x27')][_0x0bd1('0x45')]({'where':{'id':_0x63b4c2[_0x0bd1('0x3b')]['id']}})['then'](handleEntityNotFound(_0x3d7bf9,null))[_0x0bd1('0x36')](function(_0x556384){if(_0x556384){_0xfcf3ed=_0x556384;_0x4c2052[_0x0bd1('0x2c')]=_[_0x0bd1('0x3c')](db['VtigerConfiguration']['rawAttributes']);_0x4c2052['query']=_[_0x0bd1('0x3c')](_0x63b4c2[_0x0bd1('0x2a')]);_0x4c2052[_0x0bd1('0x2b')]=_['intersection'](_0x4c2052[_0x0bd1('0x2c')],_0x4c2052[_0x0bd1('0x2a')]);_0x35926c[_0x0bd1('0x2d')]=_[_0x0bd1('0x2e')](_0x4c2052[_0x0bd1('0x2c')],qs[_0x0bd1('0x3e')](_0x63b4c2[_0x0bd1('0x2a')][_0x0bd1('0x3e')]));_0x35926c['attributes']=_0x35926c['attributes']['length']?_0x35926c[_0x0bd1('0x2d')]:_0x4c2052[_0x0bd1('0x2c')];_0x35926c['order']=qs[_0x0bd1('0x30')](_0x63b4c2[_0x0bd1('0x2a')][_0x0bd1('0x30')]);_0x35926c[_0x0bd1('0x33')]=qs['filters'](_[_0x0bd1('0x31')](_0x63b4c2[_0x0bd1('0x2a')],_0x4c2052['filters']));if(_0x63b4c2[_0x0bd1('0x2a')][_0x0bd1('0x32')]){_0x35926c[_0x0bd1('0x33')]=_[_0x0bd1('0x34')](_0x35926c[_0x0bd1('0x33')],{'$or':_[_0x0bd1('0x26')](_0x35926c[_0x0bd1('0x2d')],function(_0x2e1f5a){var _0x358970={};_0x358970[_0x2e1f5a]={'$like':'%'+_0x63b4c2[_0x0bd1('0x2a')][_0x0bd1('0x32')]+'%'};return _0x358970;})});}_0x35926c=_['merge']({},_0x35926c,_0x63b4c2[_0x0bd1('0x3f')]);return _0xfcf3ed[_0x0bd1('0x44')](_0x35926c);}})['then'](function(_0x424f00){if(_0x424f00){_0x19267f=_0x424f00['length'];if(!_0x63b4c2[_0x0bd1('0x2a')]['hasOwnProperty']('nolimit')){_0x35926c[_0x0bd1('0x1a')]=qs[_0x0bd1('0x1a')](_0x63b4c2[_0x0bd1('0x2a')][_0x0bd1('0x1a')]);_0x35926c[_0x0bd1('0x18')]=qs['offset'](_0x63b4c2[_0x0bd1('0x2a')]['offset']);}return _0xfcf3ed[_0x0bd1('0x44')](_0x35926c);}})[_0x0bd1('0x36')](function(_0x54267d){if(_0x54267d){return _0x54267d?{'count':_0x19267f,'rows':_0x54267d}:null;}})[_0x0bd1('0x36')](respondWithResult(_0x3d7bf9,null))[_0x0bd1('0x43')](handleError(_0x3d7bf9,null));};exports[_0x0bd1('0x46')]=function(_0x2cae6c,_0x50c2f6,_0x7d9b89){if(_0x2cae6c[_0x0bd1('0x42')]['id']){delete _0x2cae6c['body']['id'];}return db['VtigerAccount'][_0x0bd1('0x45')]({'where':{'id':_0x2cae6c[_0x0bd1('0x3b')]['id']}})[_0x0bd1('0x36')](handleEntityNotFound(_0x50c2f6,null))[_0x0bd1('0x36')](function(_0x13bde2){if(_0x13bde2){_0x2cae6c[_0x0bd1('0x42')][_0x0bd1('0x47')]=_0x13bde2['id'];_0x2cae6c['body'][_0x0bd1('0x48')]=integrations[_0x0bd1('0x49')](_0x2cae6c[_0x0bd1('0x42')][_0x0bd1('0x4a')],_0x2cae6c[_0x0bd1('0x42')]['type']);_0x2cae6c['body'][_0x0bd1('0x4b')]=integrations[_0x0bd1('0x4c')](_0x2cae6c[_0x0bd1('0x42')]['channel'],_0x2cae6c[_0x0bd1('0x42')][_0x0bd1('0x28')]);return db[_0x0bd1('0x4d')][_0x0bd1('0x41')](_0x2cae6c[_0x0bd1('0x42')],{'include':[{'model':db[_0x0bd1('0x4e')],'as':_0x0bd1('0x48')},{'model':db[_0x0bd1('0x4e')],'as':_0x0bd1('0x4b')}]});}return null;})[_0x0bd1('0x36')](respondWithResult(_0x50c2f6,null))[_0x0bd1('0x43')](handleError(_0x50c2f6,null));};var md5=require('md5');exports[_0x0bd1('0x4f')]=function(_0x25015b,_0x24ffcb,_0xfaae37){var _0x5146b0=null;var _0x1aa16f=null;var _0x43fac5=null;var _0x2dac1d=null;var _0x5baccc='';return db[_0x0bd1('0x27')][_0x0bd1('0x45')]({'where':{'id':_0x25015b[_0x0bd1('0x3b')]['id']},'attributes':['id',_0x0bd1('0x23'),_0x0bd1('0x50'),_0x0bd1('0x51'),_0x0bd1('0x52'),_0x0bd1('0x53'),_0x0bd1('0x54'),'accessKey']})[_0x0bd1('0x36')](handleEntityNotFound(_0x24ffcb,null))[_0x0bd1('0x36')](function(_0x1428fa){if(_0x1428fa){_0x5146b0=_0x1428fa['username'];_0x1aa16f=_0x1428fa['accessKey'];_0x43fac5=_0x1428fa['moduleName'];_0x5baccc=_0x1428fa[_0x0bd1('0x53')];var _0x25f2f9=_0x5baccc['slice'](-0x1);if(_0x25f2f9==='/'){_0x5baccc=_0x5baccc[_0x0bd1('0x55')](0x0,_0x5baccc[_0x0bd1('0x56')](_0x25f2f9));}_0x2dac1d=util[_0x0bd1('0x57')](_0x0bd1('0x58'),_0x5baccc);var _0x268a05={'method':_0x0bd1('0x59'),'uri':_0x2dac1d,'qs':{'operation':_0x0bd1('0x5a'),'username':_0x1428fa[_0x0bd1('0x50')]},'json':!![]};return rp(_0x268a05);}})[_0x0bd1('0x36')](function(_0x1fa885){if(_0x1fa885['success']){var _0x48a4c7={'method':_0x0bd1('0x5b'),'uri':_0x2dac1d,'form':{'operation':_0x0bd1('0x5c'),'username':_0x5146b0,'accessKey':md5(_0x1fa885[_0x0bd1('0x5d')][_0x0bd1('0x5e')]+_0x1aa16f)},'json':!![]};return rp(_0x48a4c7);}})[_0x0bd1('0x36')](function(_0x474296){if(_0x474296[_0x0bd1('0x5f')]){var _0x58cff1={'method':_0x0bd1('0x59'),'uri':_0x2dac1d,'qs':{'operation':_0x0bd1('0x60'),'username':_0x5146b0,'sessionName':_0x474296[_0x0bd1('0x5d')][_0x0bd1('0x61')],'elementType':_0x43fac5},'json':!![]};return rp(_0x58cff1);}})[_0x0bd1('0x36')](function(_0x7a7b43){if(_0x7a7b43[_0x0bd1('0x5f')]){var _0xed90c2=[_0x0bd1('0x62'),_0x0bd1('0x63'),'owner'];_[_0x0bd1('0x64')](_0x7a7b43[_0x0bd1('0x5d')]['fields'],function(_0x5d5962){return _0xed90c2[_0x0bd1('0x65')](_0x5d5962['type']['name']);});_['remove'](_0x7a7b43[_0x0bd1('0x5d')][_0x0bd1('0x3e')],function(_0x3c4321){return _0x3c4321[_0x0bd1('0x66')]===_0x0bd1('0x67');});return{'count':_0x7a7b43[_0x0bd1('0x5d')][_0x0bd1('0x3e')][_0x0bd1('0x2f')],'rows':_[_0x0bd1('0x26')](_0x7a7b43[_0x0bd1('0x5d')][_0x0bd1('0x3e')],function(_0xc613b7){return{'id':_0xc613b7['name'],'name':_0xc613b7[_0x0bd1('0x68')],'custom':_['startsWith'](_0xc613b7[_0x0bd1('0x23')],_0x0bd1('0x69'))?!![]:![],'options':_0xc613b7[_0x0bd1('0x28')][_0x0bd1('0x23')]===_0x0bd1('0x6a')&&_0xc613b7[_0x0bd1('0x28')][_0x0bd1('0x6b')]['length']>0x0?_[_0x0bd1('0x26')](_0xc613b7[_0x0bd1('0x28')][_0x0bd1('0x6b')],function(_0x225232){return{'name':_0x225232['label'],'value':_0x225232[_0x0bd1('0x6c')]};}):[]};})};}})[_0x0bd1('0x36')](respondWithResult(_0x24ffcb,null))[_0x0bd1('0x43')](function(_0x5123fe){console['log'](_0x0bd1('0x6d')+_0x5123fe);var _0x2549f3=_0x25015b[_0x0bd1('0x2a')][_0x0bd1('0x6e')]?0x1f4:_0x5123fe[_0x0bd1('0x6f')]||0x1f4;logger[_0x0bd1('0x22')]('getFields,\x20%s,\x20%s,\x20%s',_0x0bd1('0x4f'),_0x2549f3,JSON['stringify'](_0x5123fe));delete _0x5123fe['name'];if(_0x2549f3===0x191){_0x2549f3=0x190;}_0x24ffcb['status'](_0x2549f3)[_0x0bd1('0x24')](_0x25015b[_0x0bd1('0x2a')]['test']?{'message':_0x0bd1('0x70'),'statusCode':_0x5123fe['statusCode']}:_0x5123fe);});}; \ No newline at end of file +var _0xf073=['rows','catch','show','params','fields','include','find','create','body','getConfigurations','findOne','VtigerConfiguration','addConfiguration','AccountId','Subjects','getDescriptions','channel','VtigerField','Descriptions','md5','getFields','description','moduleName','remoteUri','serverUrl','accessKey','username','slice','lastIndexOf','format','%s/webservice.php','getchallenge','POST','login','result','token','success','GET','sessionName','autogenerated','owner','remove','includes','editable','label','cf_','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VtigerAccount','includeAll','findAll'];(function(_0x5930cd,_0x422a74){var _0x436c54=function(_0x175599){while(--_0x175599){_0x5930cd['push'](_0x5930cd['shift']());}};_0x436c54(++_0x422a74);}(_0xf073,0x1a9));var _0x3f07=function(_0x179e09,_0xdaf985){_0x179e09=_0x179e09-0x0;var _0x3b883a=_0xf073[_0x179e09];return _0x3b883a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3f07('0x0'));var zipdir=require(_0x3f07('0x1'));var jsonpatch=require(_0x3f07('0x2'));var rp=require(_0x3f07('0x3'));var moment=require(_0x3f07('0x4'));var BPromise=require(_0x3f07('0x5'));var Mustache=require(_0x3f07('0x6'));var util=require(_0x3f07('0x7'));var path=require(_0x3f07('0x8'));var sox=require(_0x3f07('0x9'));var csv=require('to-csv');var ejs=require(_0x3f07('0xa'));var fs=require('fs');var fs_extra=require(_0x3f07('0xb'));var _=require(_0x3f07('0xc'));var squel=require(_0x3f07('0xd'));var crypto=require(_0x3f07('0xe'));var jsforce=require(_0x3f07('0xf'));var deskjs=require(_0x3f07('0x10'));var toCsv=require(_0x3f07('0x11'));var querystring=require(_0x3f07('0x12'));var Papa=require('papaparse');var Redis=require(_0x3f07('0x13'));var authService=require(_0x3f07('0x14'));var qs=require(_0x3f07('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3f07('0x16'));var logger=require(_0x3f07('0x17'))(_0x3f07('0x18'));var utils=require('../../config/utils');var config=require(_0x3f07('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x3f07('0x1a'))['db'];var integrations=require(_0x3f07('0x1b'));function respondWithStatusCode(_0x3ba65b,_0x2df314){_0x2df314=_0x2df314||0xcc;return function(_0x1c4827){if(_0x1c4827){return _0x3ba65b[_0x3f07('0x1c')](_0x2df314);}return _0x3ba65b[_0x3f07('0x1d')](_0x2df314)[_0x3f07('0x1e')]();};}function respondWithResult(_0x3deabb,_0xc1dfbc){_0xc1dfbc=_0xc1dfbc||0xc8;return function(_0x316f3b){if(_0x316f3b){return _0x3deabb['status'](_0xc1dfbc)[_0x3f07('0x1f')](_0x316f3b);}};}function respondWithFilteredResult(_0x5b519f,_0xbf2cc2){return function(_0x3d1ead){if(_0x3d1ead){var _0x13cbd4=typeof _0xbf2cc2[_0x3f07('0x20')]===_0x3f07('0x21')&&typeof _0xbf2cc2[_0x3f07('0x22')]===_0x3f07('0x21');var _0x3c30ee=_0x3d1ead[_0x3f07('0x23')];var _0x5a5852=_0x13cbd4?0x0:_0xbf2cc2[_0x3f07('0x20')];var _0x3cfcea=_0x13cbd4?_0x3d1ead[_0x3f07('0x23')]:_0xbf2cc2[_0x3f07('0x20')]+_0xbf2cc2['limit'];var _0x42fb90;if(_0x3cfcea>=_0x3c30ee){_0x3cfcea=_0x3c30ee;_0x42fb90=0xc8;}else{_0x42fb90=0xce;}_0x5b519f['status'](_0x42fb90);return _0x5b519f[_0x3f07('0x24')](_0x3f07('0x25'),_0x5a5852+'-'+_0x3cfcea+'/'+_0x3c30ee)[_0x3f07('0x1f')](_0x3d1ead);}return null;};}function patchUpdates(_0x4075b9){return function(_0x590c20){try{jsonpatch['apply'](_0x590c20,_0x4075b9,!![]);}catch(_0x4a3843){return BPromise[_0x3f07('0x26')](_0x4a3843);}return _0x590c20[_0x3f07('0x27')]();};}function saveUpdates(_0x519fb2,_0x119dc1){return function(_0x3948f5){if(_0x3948f5){return _0x3948f5[_0x3f07('0x28')](_0x519fb2)[_0x3f07('0x29')](function(_0x171e99){return _0x171e99;});}return null;};}function removeEntity(_0x2b97ba,_0x3b37cd){return function(_0xdae670){if(_0xdae670){return _0xdae670[_0x3f07('0x2a')]()[_0x3f07('0x29')](function(){_0x2b97ba['status'](0xcc)[_0x3f07('0x1e')]();});}};}function handleEntityNotFound(_0x955741,_0x435fa7){return function(_0x13e1e9){if(!_0x13e1e9){_0x955741[_0x3f07('0x1c')](0x194);}return _0x13e1e9;};}function handleError(_0x3a3423,_0x1583db){_0x1583db=_0x1583db||0x1f4;return function(_0xba02db){logger[_0x3f07('0x2b')](_0xba02db['stack']);if(_0xba02db[_0x3f07('0x2c')]){delete _0xba02db['name'];}_0x3a3423[_0x3f07('0x1d')](_0x1583db)[_0x3f07('0x2d')](_0xba02db);};}exports['index']=function(_0x4b1e98,_0x5d39ef){var _0x1308ef={},_0x42b1be={},_0x469250={'count':0x0,'rows':[]};var _0x1e6e03=_[_0x3f07('0x2e')](db['VtigerAccount'][_0x3f07('0x2f')],function(_0x36445b){return{'name':_0x36445b[_0x3f07('0x30')],'type':_0x36445b[_0x3f07('0x31')][_0x3f07('0x32')]};});_0x42b1be[_0x3f07('0x33')]=_[_0x3f07('0x2e')](_0x1e6e03,_0x3f07('0x2c'));_0x42b1be[_0x3f07('0x34')]=_[_0x3f07('0x35')](_0x4b1e98[_0x3f07('0x34')]);_0x42b1be[_0x3f07('0x36')]=_['intersection'](_0x42b1be['model'],_0x42b1be[_0x3f07('0x34')]);_0x1308ef[_0x3f07('0x37')]=_[_0x3f07('0x38')](_0x42b1be[_0x3f07('0x33')],qs['fields'](_0x4b1e98[_0x3f07('0x34')]['fields']));_0x1308ef['attributes']=_0x1308ef[_0x3f07('0x37')][_0x3f07('0x39')]?_0x1308ef[_0x3f07('0x37')]:_0x42b1be['model'];if(!_0x4b1e98[_0x3f07('0x34')][_0x3f07('0x3a')](_0x3f07('0x3b'))){_0x1308ef[_0x3f07('0x22')]=qs[_0x3f07('0x22')](_0x4b1e98[_0x3f07('0x34')][_0x3f07('0x22')]);_0x1308ef[_0x3f07('0x20')]=qs[_0x3f07('0x20')](_0x4b1e98[_0x3f07('0x34')]['offset']);}_0x1308ef[_0x3f07('0x3c')]=qs['sort'](_0x4b1e98['query'][_0x3f07('0x3d')]);_0x1308ef[_0x3f07('0x3e')]=qs[_0x3f07('0x36')](_[_0x3f07('0x3f')](_0x4b1e98[_0x3f07('0x34')],_0x42b1be[_0x3f07('0x36')]),_0x1e6e03);if(_0x4b1e98['query'][_0x3f07('0x40')]){_0x1308ef[_0x3f07('0x3e')]=_[_0x3f07('0x41')](_0x1308ef[_0x3f07('0x3e')],{'$or':_[_0x3f07('0x2e')](_0x1e6e03,function(_0x18088e){if(_0x18088e[_0x3f07('0x31')]!==_0x3f07('0x42')){var _0x1b88ea={};_0x1b88ea[_0x18088e[_0x3f07('0x2c')]]={'$like':'%'+_0x4b1e98[_0x3f07('0x34')][_0x3f07('0x40')]+'%'};return _0x1b88ea;}})});}_0x1308ef=_['merge']({},_0x1308ef,_0x4b1e98[_0x3f07('0x43')]);var _0x352ed9={'where':_0x1308ef['where']};return db[_0x3f07('0x44')][_0x3f07('0x23')](_0x352ed9)[_0x3f07('0x29')](function(_0x35b8a3){_0x469250['count']=_0x35b8a3;if(_0x4b1e98[_0x3f07('0x34')][_0x3f07('0x45')]){_0x1308ef['include']=[{'all':!![]}];}return db[_0x3f07('0x44')][_0x3f07('0x46')](_0x1308ef);})[_0x3f07('0x29')](function(_0x412022){_0x469250[_0x3f07('0x47')]=_0x412022;return _0x469250;})[_0x3f07('0x29')](respondWithFilteredResult(_0x5d39ef,_0x1308ef))[_0x3f07('0x48')](handleError(_0x5d39ef,null));};exports[_0x3f07('0x49')]=function(_0x213523,_0x1865aa){var _0x3df711={'raw':![],'where':{'id':_0x213523[_0x3f07('0x4a')]['id']}},_0x2e0356={};_0x2e0356[_0x3f07('0x33')]=_[_0x3f07('0x35')](db[_0x3f07('0x44')][_0x3f07('0x2f')]);_0x2e0356[_0x3f07('0x34')]=_[_0x3f07('0x35')](_0x213523[_0x3f07('0x34')]);_0x2e0356[_0x3f07('0x36')]=_['intersection'](_0x2e0356[_0x3f07('0x33')],_0x2e0356['query']);_0x3df711[_0x3f07('0x37')]=_['intersection'](_0x2e0356[_0x3f07('0x33')],qs[_0x3f07('0x4b')](_0x213523[_0x3f07('0x34')]['fields']));_0x3df711[_0x3f07('0x37')]=_0x3df711[_0x3f07('0x37')][_0x3f07('0x39')]?_0x3df711[_0x3f07('0x37')]:_0x2e0356[_0x3f07('0x33')];if(_0x213523[_0x3f07('0x34')][_0x3f07('0x45')]){_0x3df711[_0x3f07('0x4c')]=[{'all':!![]}];}_0x3df711=_['merge']({},_0x3df711,_0x213523[_0x3f07('0x43')]);return db[_0x3f07('0x44')][_0x3f07('0x4d')](_0x3df711)[_0x3f07('0x29')](handleEntityNotFound(_0x1865aa,null))[_0x3f07('0x29')](respondWithResult(_0x1865aa,null))[_0x3f07('0x48')](handleError(_0x1865aa,null));};exports[_0x3f07('0x4e')]=function(_0x3aeb3b,_0x874f05){return db[_0x3f07('0x44')]['create'](_0x3aeb3b[_0x3f07('0x4f')],{})[_0x3f07('0x29')](respondWithResult(_0x874f05,0xc9))[_0x3f07('0x48')](handleError(_0x874f05,null));};exports[_0x3f07('0x28')]=function(_0x1df533,_0x19c268){if(_0x1df533[_0x3f07('0x4f')]['id']){delete _0x1df533[_0x3f07('0x4f')]['id'];}return db[_0x3f07('0x44')][_0x3f07('0x4d')]({'where':{'id':_0x1df533[_0x3f07('0x4a')]['id']}})[_0x3f07('0x29')](handleEntityNotFound(_0x19c268,null))[_0x3f07('0x29')](saveUpdates(_0x1df533[_0x3f07('0x4f')],null))['then'](respondWithResult(_0x19c268,null))[_0x3f07('0x48')](handleError(_0x19c268,null));};exports[_0x3f07('0x2a')]=function(_0x581b8b,_0xced566){return db[_0x3f07('0x44')][_0x3f07('0x4d')]({'where':{'id':_0x581b8b['params']['id']}})[_0x3f07('0x29')](handleEntityNotFound(_0xced566,null))['then'](removeEntity(_0xced566,null))[_0x3f07('0x48')](handleError(_0xced566,null));};exports[_0x3f07('0x50')]=function(_0x3c9ddf,_0x3a0547,_0x5ae4eb){var _0x16c10a={};var _0x30ed1b={};var _0x463ca5;var _0x3b73a6;return db[_0x3f07('0x44')][_0x3f07('0x51')]({'where':{'id':_0x3c9ddf['params']['id']}})[_0x3f07('0x29')](handleEntityNotFound(_0x3a0547,null))[_0x3f07('0x29')](function(_0x2e4c16){if(_0x2e4c16){_0x463ca5=_0x2e4c16;_0x30ed1b[_0x3f07('0x33')]=_[_0x3f07('0x35')](db[_0x3f07('0x52')]['rawAttributes']);_0x30ed1b['query']=_[_0x3f07('0x35')](_0x3c9ddf['query']);_0x30ed1b['filters']=_[_0x3f07('0x38')](_0x30ed1b[_0x3f07('0x33')],_0x30ed1b[_0x3f07('0x34')]);_0x16c10a[_0x3f07('0x37')]=_[_0x3f07('0x38')](_0x30ed1b[_0x3f07('0x33')],qs[_0x3f07('0x4b')](_0x3c9ddf[_0x3f07('0x34')][_0x3f07('0x4b')]));_0x16c10a['attributes']=_0x16c10a[_0x3f07('0x37')]['length']?_0x16c10a['attributes']:_0x30ed1b['model'];_0x16c10a[_0x3f07('0x3c')]=qs[_0x3f07('0x3d')](_0x3c9ddf[_0x3f07('0x34')][_0x3f07('0x3d')]);_0x16c10a[_0x3f07('0x3e')]=qs[_0x3f07('0x36')](_[_0x3f07('0x3f')](_0x3c9ddf['query'],_0x30ed1b['filters']));if(_0x3c9ddf[_0x3f07('0x34')]['filter']){_0x16c10a[_0x3f07('0x3e')]=_[_0x3f07('0x41')](_0x16c10a[_0x3f07('0x3e')],{'$or':_[_0x3f07('0x2e')](_0x16c10a[_0x3f07('0x37')],function(_0x233e0c){var _0x8f4646={};_0x8f4646[_0x233e0c]={'$like':'%'+_0x3c9ddf['query'][_0x3f07('0x40')]+'%'};return _0x8f4646;})});}_0x16c10a=_[_0x3f07('0x41')]({},_0x16c10a,_0x3c9ddf[_0x3f07('0x43')]);return _0x463ca5[_0x3f07('0x50')](_0x16c10a);}})[_0x3f07('0x29')](function(_0x4b1a00){if(_0x4b1a00){_0x3b73a6=_0x4b1a00[_0x3f07('0x39')];if(!_0x3c9ddf[_0x3f07('0x34')][_0x3f07('0x3a')](_0x3f07('0x3b'))){_0x16c10a[_0x3f07('0x22')]=qs['limit'](_0x3c9ddf[_0x3f07('0x34')][_0x3f07('0x22')]);_0x16c10a[_0x3f07('0x20')]=qs[_0x3f07('0x20')](_0x3c9ddf[_0x3f07('0x34')][_0x3f07('0x20')]);}return _0x463ca5[_0x3f07('0x50')](_0x16c10a);}})[_0x3f07('0x29')](function(_0x301562){if(_0x301562){return _0x301562?{'count':_0x3b73a6,'rows':_0x301562}:null;}})[_0x3f07('0x29')](respondWithResult(_0x3a0547,null))[_0x3f07('0x48')](handleError(_0x3a0547,null));};exports[_0x3f07('0x53')]=function(_0x32fc5a,_0x3cea09,_0x4fb813){if(_0x32fc5a[_0x3f07('0x4f')]['id']){delete _0x32fc5a['body']['id'];}return db['VtigerAccount']['findOne']({'where':{'id':_0x32fc5a[_0x3f07('0x4a')]['id']}})[_0x3f07('0x29')](handleEntityNotFound(_0x3cea09,null))[_0x3f07('0x29')](function(_0x2841c8){if(_0x2841c8){_0x32fc5a[_0x3f07('0x4f')][_0x3f07('0x54')]=_0x2841c8['id'];_0x32fc5a[_0x3f07('0x4f')][_0x3f07('0x55')]=integrations['getSubjects'](_0x32fc5a[_0x3f07('0x4f')]['channel'],_0x32fc5a[_0x3f07('0x4f')][_0x3f07('0x31')]);_0x32fc5a[_0x3f07('0x4f')]['Descriptions']=integrations[_0x3f07('0x56')](_0x32fc5a[_0x3f07('0x4f')][_0x3f07('0x57')],_0x32fc5a['body'][_0x3f07('0x31')]);return db[_0x3f07('0x52')][_0x3f07('0x4e')](_0x32fc5a[_0x3f07('0x4f')],{'include':[{'model':db[_0x3f07('0x58')],'as':_0x3f07('0x55')},{'model':db[_0x3f07('0x58')],'as':_0x3f07('0x59')}]});}return null;})[_0x3f07('0x29')](respondWithResult(_0x3cea09,null))[_0x3f07('0x48')](handleError(_0x3cea09,null));};var md5=require(_0x3f07('0x5a'));exports[_0x3f07('0x5b')]=function(_0x237a95,_0x596d90,_0x574db7){var _0x40d7c1=null;var _0x415c64=null;var _0x388198=null;var _0x136bbd=null;var _0x38b013='';return db['VtigerAccount'][_0x3f07('0x51')]({'where':{'id':_0x237a95['params']['id']},'attributes':['id',_0x3f07('0x2c'),'username',_0x3f07('0x5c'),_0x3f07('0x5d'),_0x3f07('0x5e'),_0x3f07('0x5f'),_0x3f07('0x60')]})[_0x3f07('0x29')](handleEntityNotFound(_0x596d90,null))[_0x3f07('0x29')](function(_0x1c5c26){if(_0x1c5c26){_0x40d7c1=_0x1c5c26[_0x3f07('0x61')];_0x415c64=_0x1c5c26[_0x3f07('0x60')];_0x388198=_0x1c5c26[_0x3f07('0x5d')];_0x38b013=_0x1c5c26[_0x3f07('0x5e')];var _0x55ade0=_0x38b013[_0x3f07('0x62')](-0x1);if(_0x55ade0==='/'){_0x38b013=_0x38b013['substring'](0x0,_0x38b013[_0x3f07('0x63')](_0x55ade0));}_0x136bbd=util[_0x3f07('0x64')](_0x3f07('0x65'),_0x38b013);var _0xfbb5ad={'method':'GET','uri':_0x136bbd,'qs':{'operation':_0x3f07('0x66'),'username':_0x1c5c26[_0x3f07('0x61')]},'json':!![]};return rp(_0xfbb5ad);}})[_0x3f07('0x29')](function(_0x36b9a8){if(_0x36b9a8['success']){var _0x5c6520={'method':_0x3f07('0x67'),'uri':_0x136bbd,'form':{'operation':_0x3f07('0x68'),'username':_0x40d7c1,'accessKey':md5(_0x36b9a8[_0x3f07('0x69')][_0x3f07('0x6a')]+_0x415c64)},'json':!![]};return rp(_0x5c6520);}})[_0x3f07('0x29')](function(_0x2aa1d4){if(_0x2aa1d4[_0x3f07('0x6b')]){var _0x6545f6={'method':_0x3f07('0x6c'),'uri':_0x136bbd,'qs':{'operation':'describe','username':_0x40d7c1,'sessionName':_0x2aa1d4[_0x3f07('0x69')][_0x3f07('0x6d')],'elementType':_0x388198},'json':!![]};return rp(_0x6545f6);}})[_0x3f07('0x29')](function(_0x3b5804){if(_0x3b5804[_0x3f07('0x6b')]){var _0x326a29=[_0x3f07('0x6e'),'reference',_0x3f07('0x6f')];_[_0x3f07('0x70')](_0x3b5804[_0x3f07('0x69')]['fields'],function(_0x552b56){return _0x326a29[_0x3f07('0x71')](_0x552b56['type'][_0x3f07('0x2c')]);});_[_0x3f07('0x70')](_0x3b5804['result'][_0x3f07('0x4b')],function(_0x1df28c){return _0x1df28c[_0x3f07('0x72')]==='false';});return{'count':_0x3b5804['result'][_0x3f07('0x4b')][_0x3f07('0x39')],'rows':_[_0x3f07('0x2e')](_0x3b5804[_0x3f07('0x69')][_0x3f07('0x4b')],function(_0x3a721f){return{'id':_0x3a721f[_0x3f07('0x2c')],'name':_0x3a721f[_0x3f07('0x73')],'custom':_['startsWith'](_0x3a721f['name'],_0x3f07('0x74'))?!![]:![],'options':_0x3a721f[_0x3f07('0x31')][_0x3f07('0x2c')]==='picklist'&&_0x3a721f[_0x3f07('0x31')][_0x3f07('0x75')][_0x3f07('0x39')]>0x0?_['map'](_0x3a721f['type'][_0x3f07('0x75')],function(_0x577b80){return{'name':_0x577b80[_0x3f07('0x73')],'value':_0x577b80[_0x3f07('0x76')]};}):[]};})};}})[_0x3f07('0x29')](respondWithResult(_0x596d90,null))[_0x3f07('0x48')](function(_0x11cacd){console[_0x3f07('0x77')](_0x3f07('0x78')+_0x11cacd);var _0x491079=_0x237a95[_0x3f07('0x34')][_0x3f07('0x79')]?0x1f4:_0x11cacd[_0x3f07('0x7a')]||0x1f4;logger[_0x3f07('0x2b')]('getFields,\x20%s,\x20%s,\x20%s',_0x3f07('0x5b'),_0x491079,JSON['stringify'](_0x11cacd));delete _0x11cacd['name'];if(_0x491079===0x191){_0x491079=0x190;}_0x596d90[_0x3f07('0x1d')](_0x491079)[_0x3f07('0x2d')](_0x237a95[_0x3f07('0x34')]['test']?{'message':_0x3f07('0x7b'),'statusCode':_0x11cacd[_0x3f07('0x7a')]}:_0x11cacd);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index ae4ef83..7280d72 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 _0xcaa1=['../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x102b0c,_0x33dee4){var _0x9b15ca=function(_0x42d504){while(--_0x42d504){_0x102b0c['push'](_0x102b0c['shift']());}};_0x9b15ca(++_0x33dee4);}(_0xcaa1,0x1c5));var _0x1caa=function(_0xd1fdbc,_0x3b33af){_0xd1fdbc=_0xd1fdbc-0x0;var _0x346cc9=_0xcaa1[_0xd1fdbc];return _0x346cc9;};'use strict';var _=require(_0x1caa('0x0'));var util=require(_0x1caa('0x1'));var logger=require(_0x1caa('0x2'))(_0x1caa('0x3'));var moment=require(_0x1caa('0x4'));var BPromise=require(_0x1caa('0x5'));var rp=require(_0x1caa('0x6'));var fs=require('fs');var path=require(_0x1caa('0x7'));var rimraf=require('rimraf');var config=require(_0x1caa('0x8'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x1caa('0x9'));module[_0x1caa('0xa')]=function(_0x27fdb7,_0x2df8cc){return _0x27fdb7[_0x1caa('0xb')](_0x1caa('0xc'),attributes,{'tableName':_0x1caa('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xafe8=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts'];(function(_0x2bc1fe,_0x45da98){var _0x1a47a5=function(_0x2e5053){while(--_0x2e5053){_0x2bc1fe['push'](_0x2bc1fe['shift']());}};_0x1a47a5(++_0x45da98);}(_0xafe8,0x6c));var _0x8afe=function(_0x217ff6,_0x36f75d){_0x217ff6=_0x217ff6-0x0;var _0x417c93=_0xafe8[_0x217ff6];return _0x417c93;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8afe('0x0'))(_0x8afe('0x1'));var moment=require('moment');var BPromise=require(_0x8afe('0x2'));var rp=require(_0x8afe('0x3'));var fs=require('fs');var path=require(_0x8afe('0x4'));var rimraf=require(_0x8afe('0x5'));var config=require(_0x8afe('0x6'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x8afe('0x7'));module[_0x8afe('0x8')]=function(_0x17c8bc,_0x18c9d1){return _0x17c8bc[_0x8afe('0x9')](_0x8afe('0xa'),attributes,{'tableName':_0x8afe('0xb'),'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 7340b47..f348325 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 _0x4cf8=['info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','GetVtigerAccount','options','raw','attributes','include','map','model','ShowVtigerAccount','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x567fff,_0xd8acd8){_0x567fff=_0x567fff-0x0;var _0x465a37=_0x4cf8[_0x567fff];return _0x465a37;};'use strict';var _=require(_0x84cf('0x0'));var util=require(_0x84cf('0x1'));var moment=require(_0x84cf('0x2'));var BPromise=require(_0x84cf('0x3'));var rs=require(_0x84cf('0x4'));var fs=require('fs');var Redis=require(_0x84cf('0x5'));var db=require(_0x84cf('0x6'))['db'];var utils=require(_0x84cf('0x7'));var logger=require(_0x84cf('0x8'))(_0x84cf('0x9'));var config=require(_0x84cf('0xa'));var jayson=require(_0x84cf('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x455345,_0x56c5cc,_0x15ba85){return new BPromise(function(_0x2c11b0,_0x51b84c){return client[_0x84cf('0xc')](_0x455345,_0x15ba85)[_0x84cf('0xd')](function(_0x489063){logger[_0x84cf('0xe')](_0x84cf('0xf'),_0x56c5cc,_0x84cf('0x10'));logger[_0x84cf('0x11')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x56c5cc,_0x84cf('0x10'),JSON[_0x84cf('0x12')](_0x489063));if(_0x489063['error']){if(_0x489063['error'][_0x84cf('0x13')]===0x1f4){logger[_0x84cf('0x14')](_0x84cf('0xf'),_0x56c5cc,_0x489063[_0x84cf('0x14')][_0x84cf('0x15')]);return _0x51b84c(_0x489063[_0x84cf('0x14')][_0x84cf('0x15')]);}logger[_0x84cf('0x14')](_0x84cf('0xf'),_0x56c5cc,_0x489063[_0x84cf('0x14')][_0x84cf('0x15')]);return _0x2c11b0(_0x489063[_0x84cf('0x14')][_0x84cf('0x15')]);}else{logger[_0x84cf('0xe')](_0x84cf('0xf'),_0x56c5cc,_0x84cf('0x10'));_0x2c11b0(_0x489063[_0x84cf('0x16')][_0x84cf('0x15')]);}})[_0x84cf('0x17')](function(_0x5b8ac8){logger[_0x84cf('0x14')](_0x84cf('0xf'),_0x56c5cc,_0x5b8ac8);_0x51b84c(_0x5b8ac8);});});}exports[_0x84cf('0x18')]=function(_0x1abe2d){var _0x1dad1a=this;return new Promise(function(_0x13ba16,_0xe6b5b6){return db['VtigerAccount']['findAll']({'raw':_0x1abe2d[_0x84cf('0x19')]?_0x1abe2d[_0x84cf('0x19')][_0x84cf('0x1a')]===undefined?!![]:![]:!![],'where':_0x1abe2d[_0x84cf('0x19')]?_0x1abe2d[_0x84cf('0x19')]['where']||null:null,'attributes':_0x1abe2d[_0x84cf('0x19')]?_0x1abe2d[_0x84cf('0x19')][_0x84cf('0x1b')]||null:null,'limit':_0x1abe2d[_0x84cf('0x19')]?_0x1abe2d[_0x84cf('0x19')]['limit']||null:null,'include':_0x1abe2d[_0x84cf('0x19')]?_0x1abe2d[_0x84cf('0x19')][_0x84cf('0x1c')]?_[_0x84cf('0x1d')](_0x1abe2d[_0x84cf('0x19')][_0x84cf('0x1c')],function(_0x7feb4){return{'model':db[_0x7feb4['model']],'as':_0x7feb4['as'],'attributes':_0x7feb4[_0x84cf('0x1b')],'include':_0x7feb4[_0x84cf('0x1c')]?_[_0x84cf('0x1d')](_0x7feb4[_0x84cf('0x1c')],function(_0x1d220a){return{'model':db[_0x1d220a[_0x84cf('0x1e')]],'as':_0x1d220a['as'],'attributes':_0x1d220a[_0x84cf('0x1b')],'include':_0x1d220a[_0x84cf('0x1c')]?_[_0x84cf('0x1d')](_0x1d220a[_0x84cf('0x1c')],function(_0x5179c1){return{'model':db[_0x5179c1[_0x84cf('0x1e')]],'as':_0x5179c1['as'],'attributes':_0x5179c1[_0x84cf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x84cf('0xd')](function(_0x41a5db){logger['info'](_0x84cf('0x18'),_0x1abe2d);logger['debug'](_0x84cf('0x18'),_0x1abe2d,JSON[_0x84cf('0x12')](_0x41a5db));_0x13ba16(_0x41a5db);})[_0x84cf('0x17')](function(_0xc15298){logger[_0x84cf('0x14')](_0x84cf('0x18'),_0xc15298[_0x84cf('0x15')],_0x1abe2d);_0xe6b5b6(_0x1dad1a[_0x84cf('0x14')](0x1f4,_0xc15298[_0x84cf('0x15')]));});});};exports[_0x84cf('0x1f')]=function(_0x31dbf5){var _0x308f8f=this;return new Promise(function(_0x18243d,_0x44f16e){return db['VtigerAccount']['find']({'raw':_0x31dbf5[_0x84cf('0x19')]?_0x31dbf5[_0x84cf('0x19')][_0x84cf('0x1a')]===undefined?!![]:![]:!![],'where':_0x31dbf5[_0x84cf('0x19')]?_0x31dbf5[_0x84cf('0x19')][_0x84cf('0x20')]||null:null,'attributes':_0x31dbf5[_0x84cf('0x19')]?_0x31dbf5[_0x84cf('0x19')]['attributes']||null:null,'include':_0x31dbf5[_0x84cf('0x19')]?_0x31dbf5[_0x84cf('0x19')]['include']?_[_0x84cf('0x1d')](_0x31dbf5['options'][_0x84cf('0x1c')],function(_0x3ea5b9){return{'model':db[_0x3ea5b9[_0x84cf('0x1e')]],'as':_0x3ea5b9['as'],'attributes':_0x3ea5b9[_0x84cf('0x1b')],'include':_0x3ea5b9[_0x84cf('0x1c')]?_['map'](_0x3ea5b9[_0x84cf('0x1c')],function(_0x48309d){return{'model':db[_0x48309d['model']],'as':_0x48309d['as'],'attributes':_0x48309d[_0x84cf('0x1b')],'include':_0x48309d[_0x84cf('0x1c')]?_['map'](_0x48309d[_0x84cf('0x1c')],function(_0x263372){return{'model':db[_0x263372[_0x84cf('0x1e')]],'as':_0x263372['as'],'attributes':_0x263372[_0x84cf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x84cf('0xd')](function(_0x300f94){logger['info'](_0x84cf('0x1f'),_0x31dbf5);logger[_0x84cf('0x11')](_0x84cf('0x1f'),_0x31dbf5,JSON[_0x84cf('0x12')](_0x300f94));_0x18243d(_0x300f94);})[_0x84cf('0x17')](function(_0x2a8992){logger['error'](_0x84cf('0x1f'),_0x2a8992['message'],_0x31dbf5);_0x44f16e(_0x308f8f[_0x84cf('0x14')](0x1f4,_0x2a8992[_0x84cf('0x15')]));});});}; \ No newline at end of file +var _0xeb74=['attributes','model','stringify','ShowVtigerAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','limit','include','map'];(function(_0x21f3f8,_0x566bab){var _0x558255=function(_0x19b74e){while(--_0x19b74e){_0x21f3f8['push'](_0x21f3f8['shift']());}};_0x558255(++_0x566bab);}(_0xeb74,0xe3));var _0x4eb7=function(_0x356bbd,_0x5f3563){_0x356bbd=_0x356bbd-0x0;var _0x1e08d4=_0xeb74[_0x356bbd];return _0x1e08d4;};'use strict';var _=require(_0x4eb7('0x0'));var util=require(_0x4eb7('0x1'));var moment=require(_0x4eb7('0x2'));var BPromise=require(_0x4eb7('0x3'));var rs=require(_0x4eb7('0x4'));var fs=require('fs');var Redis=require(_0x4eb7('0x5'));var db=require(_0x4eb7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4eb7('0x7'))(_0x4eb7('0x8'));var config=require(_0x4eb7('0x9'));var jayson=require(_0x4eb7('0xa'));var client=jayson[_0x4eb7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3986cd,_0x54859c,_0xcac7c5){return new BPromise(function(_0x2cffe7,_0x588a1c){return client['request'](_0x3986cd,_0xcac7c5)[_0x4eb7('0xc')](function(_0x2f8296){logger['info'](_0x4eb7('0xd'),_0x54859c,'request\x20sent');logger[_0x4eb7('0xe')](_0x4eb7('0xf'),_0x54859c,_0x4eb7('0x10'),JSON['stringify'](_0x2f8296));if(_0x2f8296[_0x4eb7('0x11')]){if(_0x2f8296[_0x4eb7('0x11')][_0x4eb7('0x12')]===0x1f4){logger[_0x4eb7('0x11')](_0x4eb7('0xd'),_0x54859c,_0x2f8296[_0x4eb7('0x11')][_0x4eb7('0x13')]);return _0x588a1c(_0x2f8296['error']['message']);}logger['error'](_0x4eb7('0xd'),_0x54859c,_0x2f8296['error'][_0x4eb7('0x13')]);return _0x2cffe7(_0x2f8296[_0x4eb7('0x11')][_0x4eb7('0x13')]);}else{logger[_0x4eb7('0x14')](_0x4eb7('0xd'),_0x54859c,_0x4eb7('0x10'));_0x2cffe7(_0x2f8296[_0x4eb7('0x15')][_0x4eb7('0x13')]);}})[_0x4eb7('0x16')](function(_0x17377f){logger['error'](_0x4eb7('0xd'),_0x54859c,_0x17377f);_0x588a1c(_0x17377f);});});}exports[_0x4eb7('0x17')]=function(_0x3b6d41){var _0xf14478=this;return new Promise(function(_0x302e16,_0x44f1b9){return db[_0x4eb7('0x18')][_0x4eb7('0x19')]({'raw':_0x3b6d41['options']?_0x3b6d41[_0x4eb7('0x1a')][_0x4eb7('0x1b')]===undefined?!![]:![]:!![],'where':_0x3b6d41[_0x4eb7('0x1a')]?_0x3b6d41[_0x4eb7('0x1a')][_0x4eb7('0x1c')]||null:null,'attributes':_0x3b6d41[_0x4eb7('0x1a')]?_0x3b6d41[_0x4eb7('0x1a')]['attributes']||null:null,'limit':_0x3b6d41[_0x4eb7('0x1a')]?_0x3b6d41[_0x4eb7('0x1a')][_0x4eb7('0x1d')]||null:null,'include':_0x3b6d41[_0x4eb7('0x1a')]?_0x3b6d41[_0x4eb7('0x1a')][_0x4eb7('0x1e')]?_[_0x4eb7('0x1f')](_0x3b6d41[_0x4eb7('0x1a')][_0x4eb7('0x1e')],function(_0x13e871){return{'model':db[_0x13e871['model']],'as':_0x13e871['as'],'attributes':_0x13e871[_0x4eb7('0x20')],'include':_0x13e871[_0x4eb7('0x1e')]?_[_0x4eb7('0x1f')](_0x13e871[_0x4eb7('0x1e')],function(_0x3e0da2){return{'model':db[_0x3e0da2[_0x4eb7('0x21')]],'as':_0x3e0da2['as'],'attributes':_0x3e0da2[_0x4eb7('0x20')],'include':_0x3e0da2[_0x4eb7('0x1e')]?_[_0x4eb7('0x1f')](_0x3e0da2[_0x4eb7('0x1e')],function(_0xf83c11){return{'model':db[_0xf83c11[_0x4eb7('0x21')]],'as':_0xf83c11['as'],'attributes':_0xf83c11[_0x4eb7('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4eb7('0xc')](function(_0x433794){logger[_0x4eb7('0x14')](_0x4eb7('0x17'),_0x3b6d41);logger[_0x4eb7('0xe')](_0x4eb7('0x17'),_0x3b6d41,JSON[_0x4eb7('0x22')](_0x433794));_0x302e16(_0x433794);})[_0x4eb7('0x16')](function(_0x17030a){logger[_0x4eb7('0x11')]('GetVtigerAccount',_0x17030a[_0x4eb7('0x13')],_0x3b6d41);_0x44f1b9(_0xf14478['error'](0x1f4,_0x17030a[_0x4eb7('0x13')]));});});};exports[_0x4eb7('0x23')]=function(_0xc5aa21){var _0x1fe298=this;return new Promise(function(_0x468195,_0x1cec8e){return db[_0x4eb7('0x18')][_0x4eb7('0x24')]({'raw':_0xc5aa21[_0x4eb7('0x1a')]?_0xc5aa21['options'][_0x4eb7('0x1b')]===undefined?!![]:![]:!![],'where':_0xc5aa21['options']?_0xc5aa21[_0x4eb7('0x1a')][_0x4eb7('0x1c')]||null:null,'attributes':_0xc5aa21['options']?_0xc5aa21['options'][_0x4eb7('0x20')]||null:null,'include':_0xc5aa21[_0x4eb7('0x1a')]?_0xc5aa21[_0x4eb7('0x1a')][_0x4eb7('0x1e')]?_['map'](_0xc5aa21[_0x4eb7('0x1a')][_0x4eb7('0x1e')],function(_0xcc9bb4){return{'model':db[_0xcc9bb4[_0x4eb7('0x21')]],'as':_0xcc9bb4['as'],'attributes':_0xcc9bb4[_0x4eb7('0x20')],'include':_0xcc9bb4['include']?_[_0x4eb7('0x1f')](_0xcc9bb4[_0x4eb7('0x1e')],function(_0x31cc6d){return{'model':db[_0x31cc6d['model']],'as':_0x31cc6d['as'],'attributes':_0x31cc6d[_0x4eb7('0x20')],'include':_0x31cc6d[_0x4eb7('0x1e')]?_[_0x4eb7('0x1f')](_0x31cc6d['include'],function(_0x70f2b2){return{'model':db[_0x70f2b2['model']],'as':_0x70f2b2['as'],'attributes':_0x70f2b2[_0x4eb7('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4eb7('0xc')](function(_0x392fa3){logger[_0x4eb7('0x14')]('ShowVtigerAccount',_0xc5aa21);logger[_0x4eb7('0xe')](_0x4eb7('0x23'),_0xc5aa21,JSON[_0x4eb7('0x22')](_0x392fa3));_0x468195(_0x392fa3);})[_0x4eb7('0x16')](function(_0x4f0cce){logger['error']('ShowVtigerAccount',_0x4f0cce[_0x4eb7('0x13')],_0xc5aa21);_0x1cec8e(_0x1fe298[_0x4eb7('0x11')](0x1f4,_0x4f0cce[_0x4eb7('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 07c4873..6ddbe1c 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 _0xc8db=['delete','destroy','multer','util','express','Router','../../components/interaction/service','./intVtigerConfiguration.controller','index','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update'];(function(_0x5a106d,_0x2080a3){var _0x53d8ba=function(_0x1d0775){while(--_0x1d0775){_0x5a106d['push'](_0x5a106d['shift']());}};_0x53d8ba(++_0x2080a3);}(_0xc8db,0x116));var _0xbc8d=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xc8db[_0x46e363];return _0x3fb059;};'use strict';var multer=require(_0xbc8d('0x0'));var util=require(_0xbc8d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbc8d('0x2'));var router=express[_0xbc8d('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbc8d('0x4'));var config=require('../../config/environment');var controller=require(_0xbc8d('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xbc8d('0x6')]);router[_0xbc8d('0x7')](_0xbc8d('0x8'),auth[_0xbc8d('0x9')](),controller[_0xbc8d('0xa')]);router['get'](_0xbc8d('0xb'),auth[_0xbc8d('0x9')](),controller[_0xbc8d('0xc')]);router[_0xbc8d('0x7')](_0xbc8d('0xd'),auth['isAuthenticated'](),controller[_0xbc8d('0xe')]);router[_0xbc8d('0x7')](_0xbc8d('0xf'),auth[_0xbc8d('0x9')](),controller[_0xbc8d('0x10')]);router[_0xbc8d('0x11')]('/',auth['isAuthenticated'](),controller[_0xbc8d('0x12')]);router[_0xbc8d('0x13')]('/:id',auth[_0xbc8d('0x9')](),controller[_0xbc8d('0x14')]);router[_0xbc8d('0x15')](_0xbc8d('0x8'),auth[_0xbc8d('0x9')](),controller[_0xbc8d('0x16')]);module['exports']=router; \ No newline at end of file +var _0xdf7b=['update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intVtigerConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','getDescriptions','post','create'];(function(_0x2ab76b,_0x176579){var _0x201126=function(_0x11d8c8){while(--_0x11d8c8){_0x2ab76b['push'](_0x2ab76b['shift']());}};_0x201126(++_0x176579);}(_0xdf7b,0x1bb));var _0xbdf7=function(_0x57a670,_0x30e402){_0x57a670=_0x57a670-0x0;var _0x41ce21=_0xdf7b[_0x57a670];return _0x41ce21;};'use strict';var multer=require(_0xbdf7('0x0'));var util=require(_0xbdf7('0x1'));var path=require(_0xbdf7('0x2'));var timeout=require(_0xbdf7('0x3'));var express=require(_0xbdf7('0x4'));var router=express[_0xbdf7('0x5')]();var fs_extra=require(_0xbdf7('0x6'));var auth=require(_0xbdf7('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbdf7('0x8'));router['get']('/',auth[_0xbdf7('0x9')](),controller[_0xbdf7('0xa')]);router[_0xbdf7('0xb')](_0xbdf7('0xc'),auth['isAuthenticated'](),controller[_0xbdf7('0xd')]);router[_0xbdf7('0xb')](_0xbdf7('0xe'),auth[_0xbdf7('0x9')](),controller[_0xbdf7('0xf')]);router[_0xbdf7('0xb')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0xbdf7('0x9')](),controller[_0xbdf7('0x10')]);router[_0xbdf7('0x11')]('/',auth[_0xbdf7('0x9')](),controller[_0xbdf7('0x12')]);router['put'](_0xbdf7('0xc'),auth[_0xbdf7('0x9')](),controller[_0xbdf7('0x13')]);router[_0xbdf7('0x14')](_0xbdf7('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index c80b6fb..4302691 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 _0x0ea6=['STRING','exports'];(function(_0x2c1114,_0x2a5c50){var _0x2b877c=function(_0x4f356d){while(--_0x4f356d){_0x2c1114['push'](_0x2c1114['shift']());}};_0x2b877c(++_0x2a5c50);}(_0x0ea6,0x13b));var _0x60ea=function(_0x3b150c,_0x2f93f8){_0x3b150c=_0x3b150c-0x0;var _0x5cd414=_0x0ea6[_0x3b150c];return _0x5cd414;};'use strict';var Sequelize=require('sequelize');module[_0x60ea('0x0')]={'name':{'type':Sequelize[_0x60ea('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcf40=['exports','STRING','sequelize'];(function(_0x2a21c0,_0x3e5b42){var _0x469aa0=function(_0x3af97f){while(--_0x3af97f){_0x2a21c0['push'](_0x2a21c0['shift']());}};_0x469aa0(++_0x3e5b42);}(_0xcf40,0xc2));var _0x0cf4=function(_0x4ea030,_0x4c8f79){_0x4ea030=_0x4ea030-0x0;var _0x11eec8=_0xcf40[_0x4ea030];return _0x11eec8;};'use strict';var Sequelize=require(_0x0cf4('0x0'));module[_0x0cf4('0x1')]={'name':{'type':Sequelize[_0x0cf4('0x2')]},'description':{'type':Sequelize[_0x0cf4('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 2087c4b..ebcecb5 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 _0xd5f9=['query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','show','params','keys','include','catch','create','body','find','findOne','VtigerField','getFields','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','VtigerConfiguration','rawAttributes','fieldName','type','model','map'];(function(_0x2086f5,_0x3ecd12){var _0x50ceb4=function(_0x215089){while(--_0x215089){_0x2086f5['push'](_0x2086f5['shift']());}};_0x50ceb4(++_0x3ecd12);}(_0xd5f9,0xbb));var _0x9d5f=function(_0x591e93,_0x2cdfb6){_0x591e93=_0x591e93-0x0;var _0x369ab0=_0xd5f9[_0x591e93];return _0x369ab0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9d5f('0x0'));var zipdir=require(_0x9d5f('0x1'));var jsonpatch=require(_0x9d5f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9d5f('0x3'));var Mustache=require(_0x9d5f('0x4'));var util=require('util');var path=require(_0x9d5f('0x5'));var sox=require(_0x9d5f('0x6'));var csv=require(_0x9d5f('0x7'));var ejs=require(_0x9d5f('0x8'));var fs=require('fs');var fs_extra=require(_0x9d5f('0x9'));var _=require('lodash');var squel=require(_0x9d5f('0xa'));var crypto=require(_0x9d5f('0xb'));var jsforce=require(_0x9d5f('0xc'));var deskjs=require(_0x9d5f('0xd'));var toCsv=require(_0x9d5f('0x7'));var querystring=require(_0x9d5f('0xe'));var Papa=require(_0x9d5f('0xf'));var Redis=require(_0x9d5f('0x10'));var authService=require(_0x9d5f('0x11'));var qs=require(_0x9d5f('0x12'));var as=require(_0x9d5f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9d5f('0x14'))(_0x9d5f('0x15'));var utils=require(_0x9d5f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9d5f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2eda94,_0x227f5c){_0x227f5c=_0x227f5c||0xcc;return function(_0x451299){if(_0x451299){return _0x2eda94[_0x9d5f('0x18')](_0x227f5c);}return _0x2eda94[_0x9d5f('0x19')](_0x227f5c)['end']();};}function respondWithResult(_0x6365fc,_0x40d9fb){_0x40d9fb=_0x40d9fb||0xc8;return function(_0x2a7007){if(_0x2a7007){return _0x6365fc[_0x9d5f('0x19')](_0x40d9fb)[_0x9d5f('0x1a')](_0x2a7007);}};}function respondWithFilteredResult(_0x561cd0,_0x3a73e8){return function(_0x16dc14){if(_0x16dc14){var _0x49c76f=typeof _0x3a73e8[_0x9d5f('0x1b')]===_0x9d5f('0x1c')&&typeof _0x3a73e8['limit']==='undefined';var _0x1f5c81=_0x16dc14['count'];var _0x704aa7=_0x49c76f?0x0:_0x3a73e8[_0x9d5f('0x1b')];var _0x1b7132=_0x49c76f?_0x16dc14['count']:_0x3a73e8['offset']+_0x3a73e8[_0x9d5f('0x1d')];var _0x182013;if(_0x1b7132>=_0x1f5c81){_0x1b7132=_0x1f5c81;_0x182013=0xc8;}else{_0x182013=0xce;}_0x561cd0['status'](_0x182013);return _0x561cd0[_0x9d5f('0x1e')](_0x9d5f('0x1f'),_0x704aa7+'-'+_0x1b7132+'/'+_0x1f5c81)['json'](_0x16dc14);}return null;};}function patchUpdates(_0x2fbda1){return function(_0x20dd0d){try{jsonpatch['apply'](_0x20dd0d,_0x2fbda1,!![]);}catch(_0x1fe297){return BPromise[_0x9d5f('0x20')](_0x1fe297);}return _0x20dd0d['save']();};}function saveUpdates(_0x4db5f4,_0xfaa522){return function(_0x559e3c){if(_0x559e3c){return _0x559e3c[_0x9d5f('0x21')](_0x4db5f4)[_0x9d5f('0x22')](function(_0x3b0c47){return _0x3b0c47;});}return null;};}function removeEntity(_0x4c303b,_0xccba37){return function(_0x4ff87e){if(_0x4ff87e){return _0x4ff87e[_0x9d5f('0x23')]()[_0x9d5f('0x22')](function(){_0x4c303b[_0x9d5f('0x19')](0xcc)[_0x9d5f('0x24')]();});}};}function handleEntityNotFound(_0x4bd6ae,_0x30f50e){return function(_0xeea573){if(!_0xeea573){_0x4bd6ae[_0x9d5f('0x18')](0x194);}return _0xeea573;};}function handleError(_0x4a5441,_0x28806b){_0x28806b=_0x28806b||0x1f4;return function(_0x443118){logger[_0x9d5f('0x25')](_0x443118[_0x9d5f('0x26')]);if(_0x443118[_0x9d5f('0x27')]){delete _0x443118['name'];}_0x4a5441[_0x9d5f('0x19')](_0x28806b)[_0x9d5f('0x28')](_0x443118);};}exports['index']=function(_0x3e2e17,_0x5a78ca){var _0x289543={},_0x1d72ab={},_0x151af3={'count':0x0,'rows':[]};var _0x3c7722=_['map'](db[_0x9d5f('0x29')][_0x9d5f('0x2a')],function(_0x2f64ec){return{'name':_0x2f64ec[_0x9d5f('0x2b')],'type':_0x2f64ec[_0x9d5f('0x2c')]['key']};});_0x1d72ab[_0x9d5f('0x2d')]=_[_0x9d5f('0x2e')](_0x3c7722,_0x9d5f('0x27'));_0x1d72ab[_0x9d5f('0x2f')]=_['keys'](_0x3e2e17[_0x9d5f('0x2f')]);_0x1d72ab[_0x9d5f('0x30')]=_[_0x9d5f('0x31')](_0x1d72ab['model'],_0x1d72ab[_0x9d5f('0x2f')]);_0x289543['attributes']=_[_0x9d5f('0x31')](_0x1d72ab[_0x9d5f('0x2d')],qs[_0x9d5f('0x32')](_0x3e2e17[_0x9d5f('0x2f')][_0x9d5f('0x32')]));_0x289543[_0x9d5f('0x33')]=_0x289543[_0x9d5f('0x33')][_0x9d5f('0x34')]?_0x289543[_0x9d5f('0x33')]:_0x1d72ab[_0x9d5f('0x2d')];if(!_0x3e2e17[_0x9d5f('0x2f')][_0x9d5f('0x35')](_0x9d5f('0x36'))){_0x289543[_0x9d5f('0x1d')]=qs['limit'](_0x3e2e17['query'][_0x9d5f('0x1d')]);_0x289543[_0x9d5f('0x1b')]=qs[_0x9d5f('0x1b')](_0x3e2e17[_0x9d5f('0x2f')][_0x9d5f('0x1b')]);}_0x289543[_0x9d5f('0x37')]=qs[_0x9d5f('0x38')](_0x3e2e17[_0x9d5f('0x2f')][_0x9d5f('0x38')]);_0x289543[_0x9d5f('0x39')]=qs[_0x9d5f('0x30')](_[_0x9d5f('0x3a')](_0x3e2e17[_0x9d5f('0x2f')],_0x1d72ab[_0x9d5f('0x30')]),_0x3c7722);if(_0x3e2e17['query'][_0x9d5f('0x3b')]){_0x289543[_0x9d5f('0x39')]=_[_0x9d5f('0x3c')](_0x289543['where'],{'$or':_[_0x9d5f('0x2e')](_0x3c7722,function(_0x2175ea){if(_0x2175ea[_0x9d5f('0x2c')]!==_0x9d5f('0x3d')){var _0x55ee89={};_0x55ee89[_0x2175ea['name']]={'$like':'%'+_0x3e2e17['query']['filter']+'%'};return _0x55ee89;}})});}_0x289543=_[_0x9d5f('0x3c')]({},_0x289543,_0x3e2e17[_0x9d5f('0x3e')]);var _0x2a31bb={'where':_0x289543[_0x9d5f('0x39')]};return db[_0x9d5f('0x29')][_0x9d5f('0x3f')](_0x2a31bb)[_0x9d5f('0x22')](function(_0x4bd0c6){_0x151af3[_0x9d5f('0x3f')]=_0x4bd0c6;if(_0x3e2e17[_0x9d5f('0x2f')][_0x9d5f('0x40')]){_0x289543['include']=[{'all':!![]}];}return db['VtigerConfiguration']['findAll'](_0x289543);})[_0x9d5f('0x22')](function(_0x231290){_0x151af3['rows']=_0x231290;return _0x151af3;})[_0x9d5f('0x22')](respondWithFilteredResult(_0x5a78ca,_0x289543))['catch'](handleError(_0x5a78ca,null));};exports[_0x9d5f('0x41')]=function(_0x1f0d12,_0x470a8c){var _0x564ba6={'raw':![],'where':{'id':_0x1f0d12[_0x9d5f('0x42')]['id']}},_0x116949={};_0x116949['model']=_['keys'](db[_0x9d5f('0x29')][_0x9d5f('0x2a')]);_0x116949[_0x9d5f('0x2f')]=_[_0x9d5f('0x43')](_0x1f0d12[_0x9d5f('0x2f')]);_0x116949[_0x9d5f('0x30')]=_['intersection'](_0x116949[_0x9d5f('0x2d')],_0x116949[_0x9d5f('0x2f')]);_0x564ba6['attributes']=_[_0x9d5f('0x31')](_0x116949['model'],qs[_0x9d5f('0x32')](_0x1f0d12[_0x9d5f('0x2f')]['fields']));_0x564ba6[_0x9d5f('0x33')]=_0x564ba6[_0x9d5f('0x33')][_0x9d5f('0x34')]?_0x564ba6[_0x9d5f('0x33')]:_0x116949['model'];if(_0x1f0d12['query'][_0x9d5f('0x40')]){_0x564ba6[_0x9d5f('0x44')]=[{'all':!![]}];}_0x564ba6=_[_0x9d5f('0x3c')]({},_0x564ba6,_0x1f0d12['options']);return db[_0x9d5f('0x29')]['find'](_0x564ba6)['then'](handleEntityNotFound(_0x470a8c,null))[_0x9d5f('0x22')](respondWithResult(_0x470a8c,null))[_0x9d5f('0x45')](handleError(_0x470a8c,null));};exports['create']=function(_0x521400,_0xb836a6){return db[_0x9d5f('0x29')][_0x9d5f('0x46')](_0x521400['body'],{})[_0x9d5f('0x22')](respondWithResult(_0xb836a6,0xc9))[_0x9d5f('0x45')](handleError(_0xb836a6,null));};exports['update']=function(_0x2657f2,_0x49c5df){if(_0x2657f2[_0x9d5f('0x47')]['id']){delete _0x2657f2[_0x9d5f('0x47')]['id'];}return db['VtigerConfiguration'][_0x9d5f('0x48')]({'where':{'id':_0x2657f2[_0x9d5f('0x42')]['id']}})['then'](handleEntityNotFound(_0x49c5df,null))[_0x9d5f('0x22')](saveUpdates(_0x2657f2[_0x9d5f('0x47')],null))['then'](respondWithResult(_0x49c5df,null))['catch'](handleError(_0x49c5df,null));};exports[_0x9d5f('0x23')]=function(_0x3ae848,_0x496293){return db[_0x9d5f('0x29')][_0x9d5f('0x48')]({'where':{'id':_0x3ae848[_0x9d5f('0x42')]['id']}})[_0x9d5f('0x22')](handleEntityNotFound(_0x496293,null))[_0x9d5f('0x22')](removeEntity(_0x496293,null))[_0x9d5f('0x45')](handleError(_0x496293,null));};exports['getFields']=function(_0x4a61e4,_0x53f718,_0x16869c){var _0xb09950={};var _0x5bf3f9={};var _0x4c0202;var _0x4d31ab;return db[_0x9d5f('0x29')][_0x9d5f('0x49')]({'where':{'id':_0x4a61e4[_0x9d5f('0x42')]['id']}})[_0x9d5f('0x22')](handleEntityNotFound(_0x53f718,null))[_0x9d5f('0x22')](function(_0x451ab9){if(_0x451ab9){_0x4c0202=_0x451ab9;_0x5bf3f9[_0x9d5f('0x2d')]=_[_0x9d5f('0x43')](db[_0x9d5f('0x4a')][_0x9d5f('0x2a')]);_0x5bf3f9[_0x9d5f('0x2f')]=_[_0x9d5f('0x43')](_0x4a61e4[_0x9d5f('0x2f')]);_0x5bf3f9[_0x9d5f('0x30')]=_[_0x9d5f('0x31')](_0x5bf3f9['model'],_0x5bf3f9['query']);_0xb09950[_0x9d5f('0x33')]=_[_0x9d5f('0x31')](_0x5bf3f9[_0x9d5f('0x2d')],qs['fields'](_0x4a61e4[_0x9d5f('0x2f')][_0x9d5f('0x32')]));_0xb09950[_0x9d5f('0x33')]=_0xb09950['attributes'][_0x9d5f('0x34')]?_0xb09950[_0x9d5f('0x33')]:_0x5bf3f9[_0x9d5f('0x2d')];_0xb09950[_0x9d5f('0x37')]=qs[_0x9d5f('0x38')](_0x4a61e4[_0x9d5f('0x2f')][_0x9d5f('0x38')]);_0xb09950[_0x9d5f('0x39')]=qs[_0x9d5f('0x30')](_[_0x9d5f('0x3a')](_0x4a61e4[_0x9d5f('0x2f')],_0x5bf3f9[_0x9d5f('0x30')]));if(_0x4a61e4[_0x9d5f('0x2f')]['filter']){_0xb09950[_0x9d5f('0x39')]=_['merge'](_0xb09950[_0x9d5f('0x39')],{'$or':_[_0x9d5f('0x2e')](_0xb09950['attributes'],function(_0x1c7663){var _0x4d7229={};_0x4d7229[_0x1c7663]={'$like':'%'+_0x4a61e4[_0x9d5f('0x2f')][_0x9d5f('0x3b')]+'%'};return _0x4d7229;})});}_0xb09950=_['merge']({},_0xb09950,_0x4a61e4[_0x9d5f('0x3e')]);return _0x4c0202[_0x9d5f('0x4b')](_0xb09950);}})[_0x9d5f('0x22')](function(_0x3dc9b8){if(_0x3dc9b8){_0x4d31ab=_0x3dc9b8[_0x9d5f('0x34')];if(!_0x4a61e4[_0x9d5f('0x2f')]['hasOwnProperty']('nolimit')){_0xb09950['limit']=qs[_0x9d5f('0x1d')](_0x4a61e4[_0x9d5f('0x2f')]['limit']);_0xb09950[_0x9d5f('0x1b')]=qs['offset'](_0x4a61e4[_0x9d5f('0x2f')][_0x9d5f('0x1b')]);}return _0x4c0202[_0x9d5f('0x4b')](_0xb09950);}})[_0x9d5f('0x22')](function(_0x4b9592){if(_0x4b9592){return _0x4b9592?{'count':_0x4d31ab,'rows':_0x4b9592}:null;}})[_0x9d5f('0x22')](respondWithResult(_0x53f718,null))[_0x9d5f('0x45')](handleError(_0x53f718,null));};exports[_0x9d5f('0x4c')]=function(_0x250d62,_0x558374,_0x278d15){var _0xac180a={};var _0x751b1c={};var _0x5dcfdc;var _0x100c77;return db[_0x9d5f('0x29')][_0x9d5f('0x49')]({'where':{'id':_0x250d62['params']['id']}})['then'](handleEntityNotFound(_0x558374,null))['then'](function(_0x12bf01){if(_0x12bf01){_0x5dcfdc=_0x12bf01;_0x751b1c['model']=_[_0x9d5f('0x43')](db['VtigerField'][_0x9d5f('0x2a')]);_0x751b1c[_0x9d5f('0x2f')]=_[_0x9d5f('0x43')](_0x250d62[_0x9d5f('0x2f')]);_0x751b1c[_0x9d5f('0x30')]=_[_0x9d5f('0x31')](_0x751b1c[_0x9d5f('0x2d')],_0x751b1c[_0x9d5f('0x2f')]);_0xac180a[_0x9d5f('0x33')]=_[_0x9d5f('0x31')](_0x751b1c[_0x9d5f('0x2d')],qs[_0x9d5f('0x32')](_0x250d62[_0x9d5f('0x2f')]['fields']));_0xac180a[_0x9d5f('0x33')]=_0xac180a[_0x9d5f('0x33')][_0x9d5f('0x34')]?_0xac180a['attributes']:_0x751b1c[_0x9d5f('0x2d')];_0xac180a[_0x9d5f('0x37')]=qs[_0x9d5f('0x38')](_0x250d62['query'][_0x9d5f('0x38')]);_0xac180a['where']=qs[_0x9d5f('0x30')](_[_0x9d5f('0x3a')](_0x250d62[_0x9d5f('0x2f')],_0x751b1c[_0x9d5f('0x30')]));if(_0x250d62['query'][_0x9d5f('0x3b')]){_0xac180a[_0x9d5f('0x39')]=_[_0x9d5f('0x3c')](_0xac180a[_0x9d5f('0x39')],{'$or':_['map'](_0xac180a['attributes'],function(_0x3e5d00){var _0x2e945d={};_0x2e945d[_0x3e5d00]={'$like':'%'+_0x250d62[_0x9d5f('0x2f')][_0x9d5f('0x3b')]+'%'};return _0x2e945d;})});}_0xac180a=_[_0x9d5f('0x3c')]({},_0xac180a,_0x250d62['options']);return _0x5dcfdc[_0x9d5f('0x4c')](_0xac180a);}})[_0x9d5f('0x22')](function(_0xafcbc9){if(_0xafcbc9){_0x100c77=_0xafcbc9[_0x9d5f('0x34')];if(!_0x250d62[_0x9d5f('0x2f')][_0x9d5f('0x35')](_0x9d5f('0x36'))){_0xac180a[_0x9d5f('0x1d')]=qs[_0x9d5f('0x1d')](_0x250d62[_0x9d5f('0x2f')][_0x9d5f('0x1d')]);_0xac180a[_0x9d5f('0x1b')]=qs['offset'](_0x250d62[_0x9d5f('0x2f')]['offset']);}return _0x5dcfdc[_0x9d5f('0x4c')](_0xac180a);}})[_0x9d5f('0x22')](function(_0xadc955){if(_0xadc955){return _0xadc955?{'count':_0x100c77,'rows':_0xadc955}:null;}})['then'](respondWithResult(_0x558374,null))[_0x9d5f('0x45')](handleError(_0x558374,null));};exports[_0x9d5f('0x4d')]=function(_0x294804,_0xcbfcfa,_0x3f5af6){var _0x48955a={};var _0x21d9b0={};var _0x234efb;var _0x30fb94;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x294804[_0x9d5f('0x42')]['id']}})[_0x9d5f('0x22')](handleEntityNotFound(_0xcbfcfa,null))['then'](function(_0x233fed){if(_0x233fed){_0x234efb=_0x233fed;_0x21d9b0[_0x9d5f('0x2d')]=_[_0x9d5f('0x43')](db[_0x9d5f('0x4a')][_0x9d5f('0x2a')]);_0x21d9b0['query']=_[_0x9d5f('0x43')](_0x294804[_0x9d5f('0x2f')]);_0x21d9b0[_0x9d5f('0x30')]=_[_0x9d5f('0x31')](_0x21d9b0[_0x9d5f('0x2d')],_0x21d9b0[_0x9d5f('0x2f')]);_0x48955a['attributes']=_[_0x9d5f('0x31')](_0x21d9b0[_0x9d5f('0x2d')],qs[_0x9d5f('0x32')](_0x294804[_0x9d5f('0x2f')][_0x9d5f('0x32')]));_0x48955a[_0x9d5f('0x33')]=_0x48955a['attributes'][_0x9d5f('0x34')]?_0x48955a[_0x9d5f('0x33')]:_0x21d9b0[_0x9d5f('0x2d')];_0x48955a[_0x9d5f('0x37')]=qs[_0x9d5f('0x38')](_0x294804[_0x9d5f('0x2f')][_0x9d5f('0x38')]);_0x48955a[_0x9d5f('0x39')]=qs[_0x9d5f('0x30')](_[_0x9d5f('0x3a')](_0x294804[_0x9d5f('0x2f')],_0x21d9b0[_0x9d5f('0x30')]));if(_0x294804[_0x9d5f('0x2f')]['filter']){_0x48955a[_0x9d5f('0x39')]=_[_0x9d5f('0x3c')](_0x48955a[_0x9d5f('0x39')],{'$or':_[_0x9d5f('0x2e')](_0x48955a['attributes'],function(_0x3ca50a){var _0x3b94ac={};_0x3b94ac[_0x3ca50a]={'$like':'%'+_0x294804['query'][_0x9d5f('0x3b')]+'%'};return _0x3b94ac;})});}_0x48955a=_[_0x9d5f('0x3c')]({},_0x48955a,_0x294804[_0x9d5f('0x3e')]);return _0x234efb['getDescriptions'](_0x48955a);}})[_0x9d5f('0x22')](function(_0x4d9fc5){if(_0x4d9fc5){_0x30fb94=_0x4d9fc5[_0x9d5f('0x34')];if(!_0x294804[_0x9d5f('0x2f')]['hasOwnProperty'](_0x9d5f('0x36'))){_0x48955a[_0x9d5f('0x1d')]=qs['limit'](_0x294804[_0x9d5f('0x2f')][_0x9d5f('0x1d')]);_0x48955a[_0x9d5f('0x1b')]=qs[_0x9d5f('0x1b')](_0x294804[_0x9d5f('0x2f')][_0x9d5f('0x1b')]);}return _0x234efb[_0x9d5f('0x4d')](_0x48955a);}})[_0x9d5f('0x22')](function(_0x3a0e7e){if(_0x3a0e7e){return _0x3a0e7e?{'count':_0x30fb94,'rows':_0x3a0e7e}:null;}})['then'](respondWithResult(_0xcbfcfa,null))[_0x9d5f('0x45')](handleError(_0xcbfcfa,null));}; \ No newline at end of file +var _0xff16=['undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','limit','sort','filters','pick','merge','where','VIRTUAL','filter','options','include','rows','catch','show','fields','includeAll','find','create','body','params','getFields','findOne','VtigerField','order','getSubjects','getDescriptions','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x4baee9,_0x41475b){var _0x455226=function(_0x3356e3){while(--_0x3356e3){_0x4baee9['push'](_0x4baee9['shift']());}};_0x455226(++_0x41475b);}(_0xff16,0xd0));var _0x6ff1=function(_0x49513a,_0x29a93){_0x49513a=_0x49513a-0x0;var _0x39d388=_0xff16[_0x49513a];return _0x39d388;};'use strict';var emlformat=require(_0x6ff1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6ff1('0x1'));var moment=require(_0x6ff1('0x2'));var BPromise=require(_0x6ff1('0x3'));var Mustache=require(_0x6ff1('0x4'));var util=require(_0x6ff1('0x5'));var path=require(_0x6ff1('0x6'));var sox=require(_0x6ff1('0x7'));var csv=require('to-csv');var ejs=require(_0x6ff1('0x8'));var fs=require('fs');var fs_extra=require(_0x6ff1('0x9'));var _=require(_0x6ff1('0xa'));var squel=require('squel');var crypto=require(_0x6ff1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6ff1('0xc'));var toCsv=require(_0x6ff1('0xd'));var querystring=require(_0x6ff1('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6ff1('0xf'));var as=require(_0x6ff1('0x10'));var hardwareService=require(_0x6ff1('0x11'));var logger=require('../../config/logger')(_0x6ff1('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6ff1('0x13'));var db=require(_0x6ff1('0x14'))['db'];function respondWithStatusCode(_0x491a00,_0xc54f94){_0xc54f94=_0xc54f94||0xcc;return function(_0x203ec2){if(_0x203ec2){return _0x491a00[_0x6ff1('0x15')](_0xc54f94);}return _0x491a00[_0x6ff1('0x16')](_0xc54f94)[_0x6ff1('0x17')]();};}function respondWithResult(_0x44e38a,_0x3dc15c){_0x3dc15c=_0x3dc15c||0xc8;return function(_0xb258e1){if(_0xb258e1){return _0x44e38a['status'](_0x3dc15c)[_0x6ff1('0x18')](_0xb258e1);}};}function respondWithFilteredResult(_0x4ce6cc,_0x4e6756){return function(_0x9b40a3){if(_0x9b40a3){var _0xa62b99=typeof _0x4e6756[_0x6ff1('0x19')]===_0x6ff1('0x1a')&&typeof _0x4e6756['limit']==='undefined';var _0x452234=_0x9b40a3[_0x6ff1('0x1b')];var _0x5a9db9=_0xa62b99?0x0:_0x4e6756['offset'];var _0x1149b4=_0xa62b99?_0x9b40a3[_0x6ff1('0x1b')]:_0x4e6756['offset']+_0x4e6756['limit'];var _0x5f1b4a;if(_0x1149b4>=_0x452234){_0x1149b4=_0x452234;_0x5f1b4a=0xc8;}else{_0x5f1b4a=0xce;}_0x4ce6cc[_0x6ff1('0x16')](_0x5f1b4a);return _0x4ce6cc[_0x6ff1('0x1c')](_0x6ff1('0x1d'),_0x5a9db9+'-'+_0x1149b4+'/'+_0x452234)[_0x6ff1('0x18')](_0x9b40a3);}return null;};}function patchUpdates(_0x38d1b1){return function(_0xbece33){try{jsonpatch['apply'](_0xbece33,_0x38d1b1,!![]);}catch(_0x4a8f7b){return BPromise[_0x6ff1('0x1e')](_0x4a8f7b);}return _0xbece33[_0x6ff1('0x1f')]();};}function saveUpdates(_0x22d5c2,_0x976c16){return function(_0x26d51a){if(_0x26d51a){return _0x26d51a[_0x6ff1('0x20')](_0x22d5c2)[_0x6ff1('0x21')](function(_0x4721e8){return _0x4721e8;});}return null;};}function removeEntity(_0xda6845,_0x51d43a){return function(_0x5f3c60){if(_0x5f3c60){return _0x5f3c60[_0x6ff1('0x22')]()['then'](function(){_0xda6845[_0x6ff1('0x16')](0xcc)[_0x6ff1('0x17')]();});}};}function handleEntityNotFound(_0x2325b7,_0x339d1d){return function(_0x2e6252){if(!_0x2e6252){_0x2325b7[_0x6ff1('0x15')](0x194);}return _0x2e6252;};}function handleError(_0xeae259,_0x21d9df){_0x21d9df=_0x21d9df||0x1f4;return function(_0x2171a7){logger[_0x6ff1('0x23')](_0x2171a7[_0x6ff1('0x24')]);if(_0x2171a7[_0x6ff1('0x25')]){delete _0x2171a7[_0x6ff1('0x25')];}_0xeae259[_0x6ff1('0x16')](_0x21d9df)[_0x6ff1('0x26')](_0x2171a7);};}exports['index']=function(_0x235e6a,_0x3b597d){var _0x43f1d9={},_0xd79c39={},_0x19c0e2={'count':0x0,'rows':[]};var _0x3f0b64=_[_0x6ff1('0x27')](db[_0x6ff1('0x28')][_0x6ff1('0x29')],function(_0x1b20ac){return{'name':_0x1b20ac[_0x6ff1('0x2a')],'type':_0x1b20ac[_0x6ff1('0x2b')][_0x6ff1('0x2c')]};});_0xd79c39[_0x6ff1('0x2d')]=_[_0x6ff1('0x27')](_0x3f0b64,_0x6ff1('0x25'));_0xd79c39[_0x6ff1('0x2e')]=_[_0x6ff1('0x2f')](_0x235e6a[_0x6ff1('0x2e')]);_0xd79c39['filters']=_['intersection'](_0xd79c39[_0x6ff1('0x2d')],_0xd79c39[_0x6ff1('0x2e')]);_0x43f1d9['attributes']=_[_0x6ff1('0x30')](_0xd79c39[_0x6ff1('0x2d')],qs['fields'](_0x235e6a[_0x6ff1('0x2e')]['fields']));_0x43f1d9[_0x6ff1('0x31')]=_0x43f1d9[_0x6ff1('0x31')][_0x6ff1('0x32')]?_0x43f1d9[_0x6ff1('0x31')]:_0xd79c39['model'];if(!_0x235e6a['query'][_0x6ff1('0x33')](_0x6ff1('0x34'))){_0x43f1d9[_0x6ff1('0x35')]=qs[_0x6ff1('0x35')](_0x235e6a[_0x6ff1('0x2e')][_0x6ff1('0x35')]);_0x43f1d9['offset']=qs[_0x6ff1('0x19')](_0x235e6a[_0x6ff1('0x2e')]['offset']);}_0x43f1d9['order']=qs[_0x6ff1('0x36')](_0x235e6a['query'][_0x6ff1('0x36')]);_0x43f1d9['where']=qs[_0x6ff1('0x37')](_[_0x6ff1('0x38')](_0x235e6a[_0x6ff1('0x2e')],_0xd79c39[_0x6ff1('0x37')]),_0x3f0b64);if(_0x235e6a[_0x6ff1('0x2e')]['filter']){_0x43f1d9['where']=_[_0x6ff1('0x39')](_0x43f1d9[_0x6ff1('0x3a')],{'$or':_[_0x6ff1('0x27')](_0x3f0b64,function(_0x2545ab){if(_0x2545ab[_0x6ff1('0x2b')]!==_0x6ff1('0x3b')){var _0x4175b1={};_0x4175b1[_0x2545ab[_0x6ff1('0x25')]]={'$like':'%'+_0x235e6a[_0x6ff1('0x2e')][_0x6ff1('0x3c')]+'%'};return _0x4175b1;}})});}_0x43f1d9=_[_0x6ff1('0x39')]({},_0x43f1d9,_0x235e6a[_0x6ff1('0x3d')]);var _0x50c987={'where':_0x43f1d9['where']};return db[_0x6ff1('0x28')]['count'](_0x50c987)[_0x6ff1('0x21')](function(_0x6740dc){_0x19c0e2[_0x6ff1('0x1b')]=_0x6740dc;if(_0x235e6a[_0x6ff1('0x2e')]['includeAll']){_0x43f1d9[_0x6ff1('0x3e')]=[{'all':!![]}];}return db[_0x6ff1('0x28')]['findAll'](_0x43f1d9);})[_0x6ff1('0x21')](function(_0x4d8a84){_0x19c0e2[_0x6ff1('0x3f')]=_0x4d8a84;return _0x19c0e2;})[_0x6ff1('0x21')](respondWithFilteredResult(_0x3b597d,_0x43f1d9))[_0x6ff1('0x40')](handleError(_0x3b597d,null));};exports[_0x6ff1('0x41')]=function(_0x2bd1e3,_0x5884a1){var _0x1a6fa2={'raw':![],'where':{'id':_0x2bd1e3['params']['id']}},_0x5a5dcb={};_0x5a5dcb[_0x6ff1('0x2d')]=_[_0x6ff1('0x2f')](db[_0x6ff1('0x28')][_0x6ff1('0x29')]);_0x5a5dcb[_0x6ff1('0x2e')]=_['keys'](_0x2bd1e3['query']);_0x5a5dcb['filters']=_[_0x6ff1('0x30')](_0x5a5dcb[_0x6ff1('0x2d')],_0x5a5dcb['query']);_0x1a6fa2[_0x6ff1('0x31')]=_[_0x6ff1('0x30')](_0x5a5dcb[_0x6ff1('0x2d')],qs[_0x6ff1('0x42')](_0x2bd1e3[_0x6ff1('0x2e')][_0x6ff1('0x42')]));_0x1a6fa2[_0x6ff1('0x31')]=_0x1a6fa2[_0x6ff1('0x31')]['length']?_0x1a6fa2['attributes']:_0x5a5dcb[_0x6ff1('0x2d')];if(_0x2bd1e3['query'][_0x6ff1('0x43')]){_0x1a6fa2[_0x6ff1('0x3e')]=[{'all':!![]}];}_0x1a6fa2=_[_0x6ff1('0x39')]({},_0x1a6fa2,_0x2bd1e3['options']);return db[_0x6ff1('0x28')][_0x6ff1('0x44')](_0x1a6fa2)[_0x6ff1('0x21')](handleEntityNotFound(_0x5884a1,null))[_0x6ff1('0x21')](respondWithResult(_0x5884a1,null))[_0x6ff1('0x40')](handleError(_0x5884a1,null));};exports['create']=function(_0x499327,_0x3b598d){return db[_0x6ff1('0x28')][_0x6ff1('0x45')](_0x499327[_0x6ff1('0x46')],{})[_0x6ff1('0x21')](respondWithResult(_0x3b598d,0xc9))[_0x6ff1('0x40')](handleError(_0x3b598d,null));};exports[_0x6ff1('0x20')]=function(_0x59144c,_0x318cea){if(_0x59144c[_0x6ff1('0x46')]['id']){delete _0x59144c[_0x6ff1('0x46')]['id'];}return db[_0x6ff1('0x28')][_0x6ff1('0x44')]({'where':{'id':_0x59144c[_0x6ff1('0x47')]['id']}})[_0x6ff1('0x21')](handleEntityNotFound(_0x318cea,null))[_0x6ff1('0x21')](saveUpdates(_0x59144c['body'],null))[_0x6ff1('0x21')](respondWithResult(_0x318cea,null))[_0x6ff1('0x40')](handleError(_0x318cea,null));};exports[_0x6ff1('0x22')]=function(_0x318782,_0x3fd0a9){return db[_0x6ff1('0x28')][_0x6ff1('0x44')]({'where':{'id':_0x318782[_0x6ff1('0x47')]['id']}})[_0x6ff1('0x21')](handleEntityNotFound(_0x3fd0a9,null))[_0x6ff1('0x21')](removeEntity(_0x3fd0a9,null))['catch'](handleError(_0x3fd0a9,null));};exports[_0x6ff1('0x48')]=function(_0x2298d9,_0x523c5f,_0x569b86){var _0x5e9c08={};var _0x36d402={};var _0x3b8c9e;var _0x2c5a6d;return db[_0x6ff1('0x28')][_0x6ff1('0x49')]({'where':{'id':_0x2298d9[_0x6ff1('0x47')]['id']}})[_0x6ff1('0x21')](handleEntityNotFound(_0x523c5f,null))[_0x6ff1('0x21')](function(_0x183d56){if(_0x183d56){_0x3b8c9e=_0x183d56;_0x36d402['model']=_[_0x6ff1('0x2f')](db[_0x6ff1('0x4a')][_0x6ff1('0x29')]);_0x36d402[_0x6ff1('0x2e')]=_['keys'](_0x2298d9[_0x6ff1('0x2e')]);_0x36d402['filters']=_[_0x6ff1('0x30')](_0x36d402['model'],_0x36d402[_0x6ff1('0x2e')]);_0x5e9c08[_0x6ff1('0x31')]=_['intersection'](_0x36d402[_0x6ff1('0x2d')],qs[_0x6ff1('0x42')](_0x2298d9[_0x6ff1('0x2e')][_0x6ff1('0x42')]));_0x5e9c08[_0x6ff1('0x31')]=_0x5e9c08[_0x6ff1('0x31')]['length']?_0x5e9c08[_0x6ff1('0x31')]:_0x36d402[_0x6ff1('0x2d')];_0x5e9c08[_0x6ff1('0x4b')]=qs['sort'](_0x2298d9[_0x6ff1('0x2e')]['sort']);_0x5e9c08[_0x6ff1('0x3a')]=qs[_0x6ff1('0x37')](_[_0x6ff1('0x38')](_0x2298d9[_0x6ff1('0x2e')],_0x36d402['filters']));if(_0x2298d9['query'][_0x6ff1('0x3c')]){_0x5e9c08[_0x6ff1('0x3a')]=_['merge'](_0x5e9c08['where'],{'$or':_[_0x6ff1('0x27')](_0x5e9c08[_0x6ff1('0x31')],function(_0x2457a1){var _0x59daed={};_0x59daed[_0x2457a1]={'$like':'%'+_0x2298d9[_0x6ff1('0x2e')][_0x6ff1('0x3c')]+'%'};return _0x59daed;})});}_0x5e9c08=_['merge']({},_0x5e9c08,_0x2298d9[_0x6ff1('0x3d')]);return _0x3b8c9e[_0x6ff1('0x48')](_0x5e9c08);}})[_0x6ff1('0x21')](function(_0x2fce28){if(_0x2fce28){_0x2c5a6d=_0x2fce28[_0x6ff1('0x32')];if(!_0x2298d9[_0x6ff1('0x2e')][_0x6ff1('0x33')](_0x6ff1('0x34'))){_0x5e9c08[_0x6ff1('0x35')]=qs[_0x6ff1('0x35')](_0x2298d9['query'][_0x6ff1('0x35')]);_0x5e9c08[_0x6ff1('0x19')]=qs[_0x6ff1('0x19')](_0x2298d9[_0x6ff1('0x2e')][_0x6ff1('0x19')]);}return _0x3b8c9e[_0x6ff1('0x48')](_0x5e9c08);}})[_0x6ff1('0x21')](function(_0x5af119){if(_0x5af119){return _0x5af119?{'count':_0x2c5a6d,'rows':_0x5af119}:null;}})[_0x6ff1('0x21')](respondWithResult(_0x523c5f,null))[_0x6ff1('0x40')](handleError(_0x523c5f,null));};exports[_0x6ff1('0x4c')]=function(_0x33284a,_0x4eca98,_0x193ee9){var _0x81f727={};var _0x36ee9d={};var _0x43f503;var _0x27625c;return db[_0x6ff1('0x28')][_0x6ff1('0x49')]({'where':{'id':_0x33284a[_0x6ff1('0x47')]['id']}})[_0x6ff1('0x21')](handleEntityNotFound(_0x4eca98,null))[_0x6ff1('0x21')](function(_0x3e10b2){if(_0x3e10b2){_0x43f503=_0x3e10b2;_0x36ee9d[_0x6ff1('0x2d')]=_['keys'](db[_0x6ff1('0x4a')][_0x6ff1('0x29')]);_0x36ee9d[_0x6ff1('0x2e')]=_[_0x6ff1('0x2f')](_0x33284a[_0x6ff1('0x2e')]);_0x36ee9d['filters']=_[_0x6ff1('0x30')](_0x36ee9d[_0x6ff1('0x2d')],_0x36ee9d[_0x6ff1('0x2e')]);_0x81f727[_0x6ff1('0x31')]=_[_0x6ff1('0x30')](_0x36ee9d[_0x6ff1('0x2d')],qs['fields'](_0x33284a[_0x6ff1('0x2e')][_0x6ff1('0x42')]));_0x81f727[_0x6ff1('0x31')]=_0x81f727[_0x6ff1('0x31')][_0x6ff1('0x32')]?_0x81f727[_0x6ff1('0x31')]:_0x36ee9d[_0x6ff1('0x2d')];_0x81f727[_0x6ff1('0x4b')]=qs[_0x6ff1('0x36')](_0x33284a[_0x6ff1('0x2e')][_0x6ff1('0x36')]);_0x81f727[_0x6ff1('0x3a')]=qs[_0x6ff1('0x37')](_['pick'](_0x33284a[_0x6ff1('0x2e')],_0x36ee9d[_0x6ff1('0x37')]));if(_0x33284a[_0x6ff1('0x2e')][_0x6ff1('0x3c')]){_0x81f727[_0x6ff1('0x3a')]=_['merge'](_0x81f727[_0x6ff1('0x3a')],{'$or':_[_0x6ff1('0x27')](_0x81f727['attributes'],function(_0x523bf6){var _0x47ba02={};_0x47ba02[_0x523bf6]={'$like':'%'+_0x33284a[_0x6ff1('0x2e')][_0x6ff1('0x3c')]+'%'};return _0x47ba02;})});}_0x81f727=_['merge']({},_0x81f727,_0x33284a[_0x6ff1('0x3d')]);return _0x43f503['getSubjects'](_0x81f727);}})[_0x6ff1('0x21')](function(_0x5c8a43){if(_0x5c8a43){_0x27625c=_0x5c8a43['length'];if(!_0x33284a[_0x6ff1('0x2e')][_0x6ff1('0x33')]('nolimit')){_0x81f727['limit']=qs[_0x6ff1('0x35')](_0x33284a[_0x6ff1('0x2e')][_0x6ff1('0x35')]);_0x81f727['offset']=qs[_0x6ff1('0x19')](_0x33284a[_0x6ff1('0x2e')][_0x6ff1('0x19')]);}return _0x43f503['getSubjects'](_0x81f727);}})[_0x6ff1('0x21')](function(_0x50ddfd){if(_0x50ddfd){return _0x50ddfd?{'count':_0x27625c,'rows':_0x50ddfd}:null;}})[_0x6ff1('0x21')](respondWithResult(_0x4eca98,null))[_0x6ff1('0x40')](handleError(_0x4eca98,null));};exports[_0x6ff1('0x4d')]=function(_0x2bf43b,_0xd6163c,_0x1594c4){var _0x1f0d3a={};var _0x835c36={};var _0xb9a7a0;var _0x4a1af4;return db[_0x6ff1('0x28')][_0x6ff1('0x49')]({'where':{'id':_0x2bf43b[_0x6ff1('0x47')]['id']}})[_0x6ff1('0x21')](handleEntityNotFound(_0xd6163c,null))[_0x6ff1('0x21')](function(_0x25903b){if(_0x25903b){_0xb9a7a0=_0x25903b;_0x835c36['model']=_[_0x6ff1('0x2f')](db['VtigerField'][_0x6ff1('0x29')]);_0x835c36['query']=_[_0x6ff1('0x2f')](_0x2bf43b[_0x6ff1('0x2e')]);_0x835c36['filters']=_['intersection'](_0x835c36['model'],_0x835c36[_0x6ff1('0x2e')]);_0x1f0d3a[_0x6ff1('0x31')]=_[_0x6ff1('0x30')](_0x835c36[_0x6ff1('0x2d')],qs[_0x6ff1('0x42')](_0x2bf43b[_0x6ff1('0x2e')][_0x6ff1('0x42')]));_0x1f0d3a[_0x6ff1('0x31')]=_0x1f0d3a[_0x6ff1('0x31')]['length']?_0x1f0d3a[_0x6ff1('0x31')]:_0x835c36[_0x6ff1('0x2d')];_0x1f0d3a[_0x6ff1('0x4b')]=qs[_0x6ff1('0x36')](_0x2bf43b[_0x6ff1('0x2e')][_0x6ff1('0x36')]);_0x1f0d3a['where']=qs[_0x6ff1('0x37')](_['pick'](_0x2bf43b[_0x6ff1('0x2e')],_0x835c36['filters']));if(_0x2bf43b[_0x6ff1('0x2e')][_0x6ff1('0x3c')]){_0x1f0d3a[_0x6ff1('0x3a')]=_[_0x6ff1('0x39')](_0x1f0d3a[_0x6ff1('0x3a')],{'$or':_['map'](_0x1f0d3a[_0x6ff1('0x31')],function(_0x28c185){var _0xf4fa7b={};_0xf4fa7b[_0x28c185]={'$like':'%'+_0x2bf43b[_0x6ff1('0x2e')]['filter']+'%'};return _0xf4fa7b;})});}_0x1f0d3a=_[_0x6ff1('0x39')]({},_0x1f0d3a,_0x2bf43b[_0x6ff1('0x3d')]);return _0xb9a7a0['getDescriptions'](_0x1f0d3a);}})[_0x6ff1('0x21')](function(_0x2289fb){if(_0x2289fb){_0x4a1af4=_0x2289fb['length'];if(!_0x2bf43b[_0x6ff1('0x2e')][_0x6ff1('0x33')]('nolimit')){_0x1f0d3a['limit']=qs[_0x6ff1('0x35')](_0x2bf43b['query'][_0x6ff1('0x35')]);_0x1f0d3a[_0x6ff1('0x19')]=qs[_0x6ff1('0x19')](_0x2bf43b[_0x6ff1('0x2e')][_0x6ff1('0x19')]);}return _0xb9a7a0['getDescriptions'](_0x1f0d3a);}})['then'](function(_0x4593e2){if(_0x4593e2){return _0x4593e2?{'count':_0x4a1af4,'rows':_0x4593e2}:null;}})[_0x6ff1('0x21')](respondWithResult(_0xd6163c,null))['catch'](handleError(_0xd6163c,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 2820314..b73e52c 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 _0x253a=['../../config/environment','./intVtigerConfiguration.attributes','define','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x141760,_0x37d1ba){var _0x3d1a59=function(_0x3e084b){while(--_0x3e084b){_0x141760['push'](_0x141760['shift']());}};_0x3d1a59(++_0x37d1ba);}(_0x253a,0x108));var _0xa253=function(_0x368c10,_0x96e159){_0x368c10=_0x368c10-0x0;var _0xd1453e=_0x253a[_0x368c10];return _0xd1453e;};'use strict';var _=require(_0xa253('0x0'));var util=require(_0xa253('0x1'));var logger=require(_0xa253('0x2'))(_0xa253('0x3'));var moment=require(_0xa253('0x4'));var BPromise=require(_0xa253('0x5'));var rp=require(_0xa253('0x6'));var fs=require('fs');var path=require(_0xa253('0x7'));var rimraf=require(_0xa253('0x8'));var config=require(_0xa253('0x9'));var attributes=require(_0xa253('0xa'));module['exports']=function(_0x46a3e7,_0x114992){return _0x46a3e7[_0xa253('0xb')]('VtigerConfiguration',attributes,{'tableName':_0xa253('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd7e5=['util','../../config/logger','api','moment','path','rimraf','./intVtigerConfiguration.attributes','exports','define','lodash'];(function(_0x57928b,_0x29a111){var _0x49aad6=function(_0x34a268){while(--_0x34a268){_0x57928b['push'](_0x57928b['shift']());}};_0x49aad6(++_0x29a111);}(_0xd7e5,0x12b));var _0x5d7e=function(_0x2ac514,_0x414b91){_0x2ac514=_0x2ac514-0x0;var _0x2ac185=_0xd7e5[_0x2ac514];return _0x2ac185;};'use strict';var _=require(_0x5d7e('0x0'));var util=require(_0x5d7e('0x1'));var logger=require(_0x5d7e('0x2'))(_0x5d7e('0x3'));var moment=require(_0x5d7e('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5d7e('0x5'));var rimraf=require(_0x5d7e('0x6'));var config=require('../../config/environment');var attributes=require(_0x5d7e('0x7'));module[_0x5d7e('0x8')]=function(_0x3cc268,_0x2bbee4){return _0x3cc268[_0x5d7e('0x9')]('VtigerConfiguration',attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index af0870b..7990195 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 _0x607e=['info','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message'];(function(_0x2dee97,_0xe901d3){var _0x3859d3=function(_0x5605fe){while(--_0x5605fe){_0x2dee97['push'](_0x2dee97['shift']());}};_0x3859d3(++_0xe901d3);}(_0x607e,0x81));var _0xe607=function(_0x26d701,_0x95f242){_0x26d701=_0x26d701-0x0;var _0x25bb5d=_0x607e[_0x26d701];return _0x25bb5d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe607('0x0'));var BPromise=require(_0xe607('0x1'));var rs=require(_0xe607('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe607('0x3'))['db'];var utils=require(_0xe607('0x4'));var logger=require('../../config/logger')(_0xe607('0x5'));var config=require('../../config/environment');var jayson=require(_0xe607('0x6'));var client=jayson[_0xe607('0x7')][_0xe607('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x419d9d,_0x5c0074,_0x4ce004){return new BPromise(function(_0x284e9f,_0x2e5284){return client[_0xe607('0x9')](_0x419d9d,_0x4ce004)['then'](function(_0x2172f5){logger['info'](_0xe607('0xa'),_0x5c0074,'request\x20sent');logger[_0xe607('0xb')](_0xe607('0xc'),_0x5c0074,_0xe607('0xd'),JSON[_0xe607('0xe')](_0x2172f5));if(_0x2172f5['error']){if(_0x2172f5['error'][_0xe607('0xf')]===0x1f4){logger[_0xe607('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0x5c0074,_0x2172f5[_0xe607('0x10')][_0xe607('0x11')]);return _0x2e5284(_0x2172f5[_0xe607('0x10')][_0xe607('0x11')]);}logger[_0xe607('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0x5c0074,_0x2172f5[_0xe607('0x10')]['message']);return _0x284e9f(_0x2172f5['error']['message']);}else{logger[_0xe607('0x12')](_0xe607('0xa'),_0x5c0074,_0xe607('0xd'));_0x284e9f(_0x2172f5[_0xe607('0x13')][_0xe607('0x11')]);}})[_0xe607('0x14')](function(_0x5c9ad1){logger[_0xe607('0x10')](_0xe607('0xa'),_0x5c0074,_0x5c9ad1);_0x2e5284(_0x5c9ad1);});});} \ No newline at end of file +var _0x626f=['jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x626f,0x1c7));var _0xf626=function(_0x16bef2,_0x4e0e36){_0x16bef2=_0x16bef2-0x0;var _0x4a08d3=_0x626f[_0x16bef2];return _0x4a08d3;};'use strict';var _=require('lodash');var util=require(_0xf626('0x0'));var moment=require(_0xf626('0x1'));var BPromise=require(_0xf626('0x2'));var rs=require(_0xf626('0x3'));var fs=require('fs');var Redis=require(_0xf626('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf626('0x5'));var logger=require('../../config/logger')(_0xf626('0x6'));var config=require('../../config/environment');var jayson=require(_0xf626('0x7'));var client=jayson[_0xf626('0x8')][_0xf626('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x594353,_0x43d21a,_0x2a1d92){return new BPromise(function(_0xd64de1,_0x22f862){return client[_0xf626('0xa')](_0x594353,_0x2a1d92)[_0xf626('0xb')](function(_0x195dec){logger[_0xf626('0xc')](_0xf626('0xd'),_0x43d21a,_0xf626('0xe'));logger[_0xf626('0xf')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x43d21a,_0xf626('0xe'),JSON['stringify'](_0x195dec));if(_0x195dec[_0xf626('0x10')]){if(_0x195dec[_0xf626('0x10')][_0xf626('0x11')]===0x1f4){logger[_0xf626('0x10')](_0xf626('0xd'),_0x43d21a,_0x195dec[_0xf626('0x10')]['message']);return _0x22f862(_0x195dec[_0xf626('0x10')]['message']);}logger[_0xf626('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0x43d21a,_0x195dec[_0xf626('0x10')][_0xf626('0x12')]);return _0xd64de1(_0x195dec[_0xf626('0x10')][_0xf626('0x12')]);}else{logger['info'](_0xf626('0xd'),_0x43d21a,_0xf626('0xe'));_0xd64de1(_0x195dec[_0xf626('0x13')]['message']);}})[_0xf626('0x14')](function(_0xab794){logger[_0xf626('0x10')](_0xf626('0xd'),_0x43d21a,_0xab794);_0x22f862(_0xab794);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 3954ddc..5152fad 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 _0x4077=['../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x393436,_0x2100f4){var _0x1a54a4=function(_0x2318f3){while(--_0x2318f3){_0x393436['push'](_0x393436['shift']());}};_0x1a54a4(++_0x2100f4);}(_0x4077,0x133));var _0x7407=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4077[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7407('0x0'));var util=require(_0x7407('0x1'));var path=require(_0x7407('0x2'));var timeout=require('connect-timeout');var express=require(_0x7407('0x3'));var router=express[_0x7407('0x4')]();var fs_extra=require(_0x7407('0x5'));var auth=require(_0x7407('0x6'));var interaction=require(_0x7407('0x7'));var config=require(_0x7407('0x8'));var controller=require(_0x7407('0x9'));router[_0x7407('0xa')]('/',auth[_0x7407('0xb')](),controller[_0x7407('0xc')]);router[_0x7407('0xa')](_0x7407('0xd'),auth[_0x7407('0xb')](),controller[_0x7407('0xe')]);router[_0x7407('0xf')]('/',auth['isAuthenticated'](),controller[_0x7407('0x10')]);router[_0x7407('0x11')](_0x7407('0xd'),auth[_0x7407('0xb')](),controller[_0x7407('0x12')]);router['delete']('/:id',auth[_0x7407('0xb')](),controller[_0x7407('0x13')]);module[_0x7407('0x14')]=router; \ No newline at end of file +var _0xfba7=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','create','put','update','destroy'];(function(_0x488e67,_0x3fe10c){var _0x1b7ccd=function(_0x3bfbc5){while(--_0x3bfbc5){_0x488e67['push'](_0x488e67['shift']());}};_0x1b7ccd(++_0x3fe10c);}(_0xfba7,0x190));var _0x7fba=function(_0x11f0a5,_0x3e0a91){_0x11f0a5=_0x11f0a5-0x0;var _0x4dac6f=_0xfba7[_0x11f0a5];return _0x4dac6f;};'use strict';var multer=require(_0x7fba('0x0'));var util=require(_0x7fba('0x1'));var path=require('path');var timeout=require(_0x7fba('0x2'));var express=require(_0x7fba('0x3'));var router=express[_0x7fba('0x4')]();var fs_extra=require(_0x7fba('0x5'));var auth=require(_0x7fba('0x6'));var interaction=require(_0x7fba('0x7'));var config=require('../../config/environment');var controller=require(_0x7fba('0x8'));router[_0x7fba('0x9')]('/',auth[_0x7fba('0xa')](),controller[_0x7fba('0xb')]);router['get'](_0x7fba('0xc'),auth[_0x7fba('0xa')](),controller[_0x7fba('0xd')]);router['post']('/',auth[_0x7fba('0xa')](),controller[_0x7fba('0xe')]);router[_0x7fba('0xf')]('/:id',auth[_0x7fba('0xa')](),controller[_0x7fba('0x10')]);router['delete'](_0x7fba('0xc'),auth[_0x7fba('0xa')](),controller[_0x7fba('0x11')]);module[_0x7fba('0x12')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 321bf5b..cd89653 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 _0xc161=['customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM','string','variable'];(function(_0x58d052,_0xb0b2c5){var _0x3b3d0d=function(_0x17da5f){while(--_0x17da5f){_0x58d052['push'](_0x58d052['shift']());}};_0x3b3d0d(++_0xb0b2c5);}(_0xc161,0x199));var _0x1c16=function(_0xe261ee,_0x2a2183){_0xe261ee=_0xe261ee-0x0;var _0x1e06b3=_0xc161[_0xe261ee];return _0x1e06b3;};'use strict';var Sequelize=require(_0x1c16('0x0'));module[_0x1c16('0x1')]={'type':{'type':Sequelize[_0x1c16('0x2')](_0x1c16('0x3'),_0x1c16('0x4'),_0x1c16('0x5'),_0x1c16('0x6'),_0x1c16('0x7')),'defaultValue':_0x1c16('0x3')},'content':{'type':Sequelize[_0x1c16('0x8')]},'key':{'type':Sequelize[_0x1c16('0x8')]},'keyType':{'type':Sequelize[_0x1c16('0x2')]('string',_0x1c16('0x4'),_0x1c16('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1c16('0x8')]},'nameField':{'type':Sequelize[_0x1c16('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7381=['variable','BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','picklist','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7381,0x142));var _0x1738=function(_0x4e198a,_0x5a6bad){_0x4e198a=_0x4e198a-0x0;var _0xb84bfe=_0x7381[_0x4e198a];return _0xb84bfe;};'use strict';var Sequelize=require(_0x1738('0x0'));module[_0x1738('0x1')]={'type':{'type':Sequelize[_0x1738('0x2')](_0x1738('0x3'),'variable',_0x1738('0x4'),_0x1738('0x5'),_0x1738('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x1738('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1738('0x2')](_0x1738('0x3'),_0x1738('0x8'),'customVariable')},'keyContent':{'type':Sequelize[_0x1738('0x7')]},'idField':{'type':Sequelize[_0x1738('0x7')]},'nameField':{'type':Sequelize[_0x1738('0x7')]},'customField':{'type':Sequelize[_0x1738('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1738('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 9785975..8c59111 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 _0xa926=['then','destroy','sendStatus','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','include','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','save'];(function(_0x12a28e,_0x26cc74){var _0x31c1f6=function(_0x3aa8f2){while(--_0x3aa8f2){_0x12a28e['push'](_0x12a28e['shift']());}};_0x31c1f6(++_0x26cc74);}(_0xa926,0x1bd));var _0x6a92=function(_0x282e37,_0x5a4e42){_0x282e37=_0x282e37-0x0;var _0xf3c3f8=_0xa926[_0x282e37];return _0xf3c3f8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6a92('0x0'));var zipdir=require(_0x6a92('0x1'));var jsonpatch=require(_0x6a92('0x2'));var rp=require(_0x6a92('0x3'));var moment=require(_0x6a92('0x4'));var BPromise=require(_0x6a92('0x5'));var Mustache=require(_0x6a92('0x6'));var util=require('util');var path=require(_0x6a92('0x7'));var sox=require(_0x6a92('0x8'));var csv=require(_0x6a92('0x9'));var ejs=require(_0x6a92('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6a92('0xb'));var squel=require('squel');var crypto=require(_0x6a92('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6a92('0x9'));var querystring=require(_0x6a92('0xd'));var Papa=require(_0x6a92('0xe'));var Redis=require(_0x6a92('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6a92('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6a92('0x11'))('api');var utils=require(_0x6a92('0x12'));var config=require(_0x6a92('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x6a92('0x14'))['db'];function respondWithStatusCode(_0x4582fc,_0x4fe02d){_0x4fe02d=_0x4fe02d||0xcc;return function(_0x3c0820){if(_0x3c0820){return _0x4582fc['sendStatus'](_0x4fe02d);}return _0x4582fc[_0x6a92('0x15')](_0x4fe02d)[_0x6a92('0x16')]();};}function respondWithResult(_0x5481bb,_0x1081dd){_0x1081dd=_0x1081dd||0xc8;return function(_0x3ca0f2){if(_0x3ca0f2){return _0x5481bb[_0x6a92('0x15')](_0x1081dd)[_0x6a92('0x17')](_0x3ca0f2);}};}function respondWithFilteredResult(_0x14b5dd,_0x2b5977){return function(_0x2a179c){if(_0x2a179c){var _0x20248c=typeof _0x2b5977[_0x6a92('0x18')]===_0x6a92('0x19')&&typeof _0x2b5977[_0x6a92('0x1a')]===_0x6a92('0x19');var _0x499761=_0x2a179c[_0x6a92('0x1b')];var _0x5b93d0=_0x20248c?0x0:_0x2b5977[_0x6a92('0x18')];var _0x12c1ca=_0x20248c?_0x2a179c[_0x6a92('0x1b')]:_0x2b5977[_0x6a92('0x18')]+_0x2b5977[_0x6a92('0x1a')];var _0x18e874;if(_0x12c1ca>=_0x499761){_0x12c1ca=_0x499761;_0x18e874=0xc8;}else{_0x18e874=0xce;}_0x14b5dd['status'](_0x18e874);return _0x14b5dd[_0x6a92('0x1c')]('Content-Range',_0x5b93d0+'-'+_0x12c1ca+'/'+_0x499761)[_0x6a92('0x17')](_0x2a179c);}return null;};}function patchUpdates(_0x142e1c){return function(_0x5bcbe9){try{jsonpatch[_0x6a92('0x1d')](_0x5bcbe9,_0x142e1c,!![]);}catch(_0x2b2d70){return BPromise['reject'](_0x2b2d70);}return _0x5bcbe9[_0x6a92('0x1e')]();};}function saveUpdates(_0x45566f,_0x1ed20b){return function(_0x37245f){if(_0x37245f){return _0x37245f['update'](_0x45566f)[_0x6a92('0x1f')](function(_0x47b26b){return _0x47b26b;});}return null;};}function removeEntity(_0x3fee64,_0x5d2d96){return function(_0x5662e6){if(_0x5662e6){return _0x5662e6[_0x6a92('0x20')]()[_0x6a92('0x1f')](function(){_0x3fee64[_0x6a92('0x15')](0xcc)[_0x6a92('0x16')]();});}};}function handleEntityNotFound(_0x1340af,_0x21dec7){return function(_0xa9b98f){if(!_0xa9b98f){_0x1340af[_0x6a92('0x21')](0x194);}return _0xa9b98f;};}function handleError(_0x1659f8,_0x234d90){_0x234d90=_0x234d90||0x1f4;return function(_0x65f5aa){logger['error'](_0x65f5aa[_0x6a92('0x22')]);if(_0x65f5aa[_0x6a92('0x23')]){delete _0x65f5aa[_0x6a92('0x23')];}_0x1659f8[_0x6a92('0x15')](_0x234d90)[_0x6a92('0x24')](_0x65f5aa);};}exports[_0x6a92('0x25')]=function(_0x4150b5,_0x2fa9b1){var _0x31c968={},_0x41c95f={},_0x3a2b41={'count':0x0,'rows':[]};var _0x576b13=_[_0x6a92('0x26')](db[_0x6a92('0x27')][_0x6a92('0x28')],function(_0x4af16a){return{'name':_0x4af16a[_0x6a92('0x29')],'type':_0x4af16a[_0x6a92('0x2a')][_0x6a92('0x2b')]};});_0x41c95f[_0x6a92('0x2c')]=_[_0x6a92('0x26')](_0x576b13,_0x6a92('0x23'));_0x41c95f[_0x6a92('0x2d')]=_[_0x6a92('0x2e')](_0x4150b5[_0x6a92('0x2d')]);_0x41c95f['filters']=_[_0x6a92('0x2f')](_0x41c95f[_0x6a92('0x2c')],_0x41c95f['query']);_0x31c968[_0x6a92('0x30')]=_[_0x6a92('0x2f')](_0x41c95f[_0x6a92('0x2c')],qs[_0x6a92('0x31')](_0x4150b5[_0x6a92('0x2d')][_0x6a92('0x31')]));_0x31c968[_0x6a92('0x30')]=_0x31c968[_0x6a92('0x30')][_0x6a92('0x32')]?_0x31c968[_0x6a92('0x30')]:_0x41c95f['model'];if(!_0x4150b5[_0x6a92('0x2d')]['hasOwnProperty']('nolimit')){_0x31c968[_0x6a92('0x1a')]=qs[_0x6a92('0x1a')](_0x4150b5['query'][_0x6a92('0x1a')]);_0x31c968[_0x6a92('0x18')]=qs[_0x6a92('0x18')](_0x4150b5[_0x6a92('0x2d')][_0x6a92('0x18')]);}_0x31c968[_0x6a92('0x33')]=qs[_0x6a92('0x34')](_0x4150b5['query'][_0x6a92('0x34')]);_0x31c968[_0x6a92('0x35')]=qs[_0x6a92('0x36')](_['pick'](_0x4150b5['query'],_0x41c95f['filters']),_0x576b13);if(_0x4150b5['query'][_0x6a92('0x37')]){_0x31c968[_0x6a92('0x35')]=_[_0x6a92('0x38')](_0x31c968[_0x6a92('0x35')],{'$or':_[_0x6a92('0x26')](_0x576b13,function(_0x184504){if(_0x184504[_0x6a92('0x2a')]!==_0x6a92('0x39')){var _0x4ee691={};_0x4ee691[_0x184504[_0x6a92('0x23')]]={'$like':'%'+_0x4150b5[_0x6a92('0x2d')][_0x6a92('0x37')]+'%'};return _0x4ee691;}})});}_0x31c968=_[_0x6a92('0x38')]({},_0x31c968,_0x4150b5[_0x6a92('0x3a')]);var _0x148458={'where':_0x31c968[_0x6a92('0x35')]};return db[_0x6a92('0x27')][_0x6a92('0x1b')](_0x148458)[_0x6a92('0x1f')](function(_0xd38375){_0x3a2b41[_0x6a92('0x1b')]=_0xd38375;if(_0x4150b5[_0x6a92('0x2d')][_0x6a92('0x3b')]){_0x31c968['include']=[{'all':!![]}];}return db['VtigerField']['findAll'](_0x31c968);})[_0x6a92('0x1f')](function(_0x1c201d){_0x3a2b41[_0x6a92('0x3c')]=_0x1c201d;return _0x3a2b41;})[_0x6a92('0x1f')](respondWithFilteredResult(_0x2fa9b1,_0x31c968))[_0x6a92('0x3d')](handleError(_0x2fa9b1,null));};exports[_0x6a92('0x3e')]=function(_0x2c2ea8,_0x5acfeb){var _0x6acd60={'raw':!![],'where':{'id':_0x2c2ea8[_0x6a92('0x3f')]['id']}},_0x27ab88={};_0x27ab88['model']=_[_0x6a92('0x2e')](db[_0x6a92('0x27')][_0x6a92('0x28')]);_0x27ab88[_0x6a92('0x2d')]=_['keys'](_0x2c2ea8[_0x6a92('0x2d')]);_0x27ab88[_0x6a92('0x36')]=_[_0x6a92('0x2f')](_0x27ab88[_0x6a92('0x2c')],_0x27ab88[_0x6a92('0x2d')]);_0x6acd60[_0x6a92('0x30')]=_[_0x6a92('0x2f')](_0x27ab88['model'],qs['fields'](_0x2c2ea8[_0x6a92('0x2d')][_0x6a92('0x31')]));_0x6acd60[_0x6a92('0x30')]=_0x6acd60[_0x6a92('0x30')][_0x6a92('0x32')]?_0x6acd60[_0x6a92('0x30')]:_0x27ab88[_0x6a92('0x2c')];if(_0x2c2ea8['query'][_0x6a92('0x3b')]){_0x6acd60[_0x6a92('0x40')]=[{'all':!![]}];}_0x6acd60=_[_0x6a92('0x38')]({},_0x6acd60,_0x2c2ea8[_0x6a92('0x3a')]);return db[_0x6a92('0x27')]['find'](_0x6acd60)[_0x6a92('0x1f')](handleEntityNotFound(_0x5acfeb,null))[_0x6a92('0x1f')](respondWithResult(_0x5acfeb,null))['catch'](handleError(_0x5acfeb,null));};exports[_0x6a92('0x41')]=function(_0x1d3aae,_0x4c1a12){return db[_0x6a92('0x27')]['create'](_0x1d3aae[_0x6a92('0x42')],{})['then'](respondWithResult(_0x4c1a12,0xc9))[_0x6a92('0x3d')](handleError(_0x4c1a12,null));};exports[_0x6a92('0x43')]=function(_0x56731f,_0x4db662){if(_0x56731f[_0x6a92('0x42')]['id']){delete _0x56731f[_0x6a92('0x42')]['id'];}return db[_0x6a92('0x27')]['find']({'where':{'id':_0x56731f['params']['id']}})['then'](handleEntityNotFound(_0x4db662,null))[_0x6a92('0x1f')](saveUpdates(_0x56731f[_0x6a92('0x42')],null))[_0x6a92('0x1f')](respondWithResult(_0x4db662,null))[_0x6a92('0x3d')](handleError(_0x4db662,null));};exports[_0x6a92('0x20')]=function(_0x30228c,_0xc4325a){return db[_0x6a92('0x27')]['find']({'where':{'id':_0x30228c[_0x6a92('0x3f')]['id']}})[_0x6a92('0x1f')](handleEntityNotFound(_0xc4325a,null))[_0x6a92('0x1f')](removeEntity(_0xc4325a,null))[_0x6a92('0x3d')](handleError(_0xc4325a,null));}; \ No newline at end of file +var _0xffe4=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','VtigerField','includeAll','findAll','catch','show','params','length','include','options','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','end','error','stack','name','send','index','map'];(function(_0x5f8000,_0x4a56b1){var _0xc8f261=function(_0x53e032){while(--_0x53e032){_0x5f8000['push'](_0x5f8000['shift']());}};_0xc8f261(++_0x4a56b1);}(_0xffe4,0x1a7));var _0x4ffe=function(_0x433238,_0x17f1e5){_0x433238=_0x433238-0x0;var _0x309153=_0xffe4[_0x433238];return _0x309153;};'use strict';var emlformat=require(_0x4ffe('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4ffe('0x1'));var jsonpatch=require(_0x4ffe('0x2'));var rp=require(_0x4ffe('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4ffe('0x4'));var util=require(_0x4ffe('0x5'));var path=require(_0x4ffe('0x6'));var sox=require(_0x4ffe('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4ffe('0x8'));var _=require(_0x4ffe('0x9'));var squel=require(_0x4ffe('0xa'));var crypto=require(_0x4ffe('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4ffe('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4ffe('0xd'));var Papa=require(_0x4ffe('0xe'));var Redis=require(_0x4ffe('0xf'));var authService=require(_0x4ffe('0x10'));var qs=require(_0x4ffe('0x11'));var as=require(_0x4ffe('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4ffe('0x13'))(_0x4ffe('0x14'));var utils=require(_0x4ffe('0x15'));var config=require(_0x4ffe('0x16'));var licenseUtil=require(_0x4ffe('0x17'));var db=require(_0x4ffe('0x18'))['db'];function respondWithStatusCode(_0x1bf53b,_0x3a27a6){_0x3a27a6=_0x3a27a6||0xcc;return function(_0x367795){if(_0x367795){return _0x1bf53b[_0x4ffe('0x19')](_0x3a27a6);}return _0x1bf53b[_0x4ffe('0x1a')](_0x3a27a6)['end']();};}function respondWithResult(_0x389458,_0x542c84){_0x542c84=_0x542c84||0xc8;return function(_0x17f3b1){if(_0x17f3b1){return _0x389458['status'](_0x542c84)['json'](_0x17f3b1);}};}function respondWithFilteredResult(_0x3cef3c,_0x1357ce){return function(_0x18e7af){if(_0x18e7af){var _0x7dbd61=typeof _0x1357ce['offset']===_0x4ffe('0x1b')&&typeof _0x1357ce[_0x4ffe('0x1c')]===_0x4ffe('0x1b');var _0x40e70f=_0x18e7af[_0x4ffe('0x1d')];var _0x5a27b4=_0x7dbd61?0x0:_0x1357ce[_0x4ffe('0x1e')];var _0x1f4bc6=_0x7dbd61?_0x18e7af[_0x4ffe('0x1d')]:_0x1357ce[_0x4ffe('0x1e')]+_0x1357ce[_0x4ffe('0x1c')];var _0x211727;if(_0x1f4bc6>=_0x40e70f){_0x1f4bc6=_0x40e70f;_0x211727=0xc8;}else{_0x211727=0xce;}_0x3cef3c[_0x4ffe('0x1a')](_0x211727);return _0x3cef3c[_0x4ffe('0x1f')](_0x4ffe('0x20'),_0x5a27b4+'-'+_0x1f4bc6+'/'+_0x40e70f)[_0x4ffe('0x21')](_0x18e7af);}return null;};}function patchUpdates(_0x3e0508){return function(_0x420635){try{jsonpatch[_0x4ffe('0x22')](_0x420635,_0x3e0508,!![]);}catch(_0x331d65){return BPromise[_0x4ffe('0x23')](_0x331d65);}return _0x420635['save']();};}function saveUpdates(_0x233353,_0x5bc7bb){return function(_0x378c42){if(_0x378c42){return _0x378c42[_0x4ffe('0x24')](_0x233353)[_0x4ffe('0x25')](function(_0x54e864){return _0x54e864;});}return null;};}function removeEntity(_0x321105,_0x5472db){return function(_0x21abbe){if(_0x21abbe){return _0x21abbe['destroy']()[_0x4ffe('0x25')](function(){_0x321105[_0x4ffe('0x1a')](0xcc)[_0x4ffe('0x26')]();});}};}function handleEntityNotFound(_0x1c01e5,_0x27d4c1){return function(_0x157626){if(!_0x157626){_0x1c01e5[_0x4ffe('0x19')](0x194);}return _0x157626;};}function handleError(_0x5a9495,_0x31c080){_0x31c080=_0x31c080||0x1f4;return function(_0x19accf){logger[_0x4ffe('0x27')](_0x19accf[_0x4ffe('0x28')]);if(_0x19accf['name']){delete _0x19accf[_0x4ffe('0x29')];}_0x5a9495['status'](_0x31c080)[_0x4ffe('0x2a')](_0x19accf);};}exports[_0x4ffe('0x2b')]=function(_0x572aaf,_0x388474){var _0x4e8fa5={},_0x3e7625={},_0x23c151={'count':0x0,'rows':[]};var _0x4b35b2=_[_0x4ffe('0x2c')](db['VtigerField'][_0x4ffe('0x2d')],function(_0x236888){return{'name':_0x236888[_0x4ffe('0x2e')],'type':_0x236888[_0x4ffe('0x2f')][_0x4ffe('0x30')]};});_0x3e7625[_0x4ffe('0x31')]=_[_0x4ffe('0x2c')](_0x4b35b2,'name');_0x3e7625[_0x4ffe('0x32')]=_[_0x4ffe('0x33')](_0x572aaf[_0x4ffe('0x32')]);_0x3e7625[_0x4ffe('0x34')]=_['intersection'](_0x3e7625['model'],_0x3e7625['query']);_0x4e8fa5['attributes']=_[_0x4ffe('0x35')](_0x3e7625[_0x4ffe('0x31')],qs['fields'](_0x572aaf[_0x4ffe('0x32')][_0x4ffe('0x36')]));_0x4e8fa5[_0x4ffe('0x37')]=_0x4e8fa5[_0x4ffe('0x37')]['length']?_0x4e8fa5[_0x4ffe('0x37')]:_0x3e7625[_0x4ffe('0x31')];if(!_0x572aaf['query'][_0x4ffe('0x38')](_0x4ffe('0x39'))){_0x4e8fa5[_0x4ffe('0x1c')]=qs[_0x4ffe('0x1c')](_0x572aaf[_0x4ffe('0x32')][_0x4ffe('0x1c')]);_0x4e8fa5[_0x4ffe('0x1e')]=qs[_0x4ffe('0x1e')](_0x572aaf[_0x4ffe('0x32')][_0x4ffe('0x1e')]);}_0x4e8fa5[_0x4ffe('0x3a')]=qs[_0x4ffe('0x3b')](_0x572aaf[_0x4ffe('0x32')][_0x4ffe('0x3b')]);_0x4e8fa5[_0x4ffe('0x3c')]=qs[_0x4ffe('0x34')](_[_0x4ffe('0x3d')](_0x572aaf[_0x4ffe('0x32')],_0x3e7625[_0x4ffe('0x34')]),_0x4b35b2);if(_0x572aaf[_0x4ffe('0x32')][_0x4ffe('0x3e')]){_0x4e8fa5[_0x4ffe('0x3c')]=_[_0x4ffe('0x3f')](_0x4e8fa5[_0x4ffe('0x3c')],{'$or':_[_0x4ffe('0x2c')](_0x4b35b2,function(_0x448afe){if(_0x448afe[_0x4ffe('0x2f')]!==_0x4ffe('0x40')){var _0x46a81e={};_0x46a81e[_0x448afe[_0x4ffe('0x29')]]={'$like':'%'+_0x572aaf[_0x4ffe('0x32')]['filter']+'%'};return _0x46a81e;}})});}_0x4e8fa5=_[_0x4ffe('0x3f')]({},_0x4e8fa5,_0x572aaf['options']);var _0x9e7fca={'where':_0x4e8fa5[_0x4ffe('0x3c')]};return db[_0x4ffe('0x41')][_0x4ffe('0x1d')](_0x9e7fca)[_0x4ffe('0x25')](function(_0x6a49fa){_0x23c151[_0x4ffe('0x1d')]=_0x6a49fa;if(_0x572aaf[_0x4ffe('0x32')][_0x4ffe('0x42')]){_0x4e8fa5['include']=[{'all':!![]}];}return db['VtigerField'][_0x4ffe('0x43')](_0x4e8fa5);})[_0x4ffe('0x25')](function(_0x458ff3){_0x23c151['rows']=_0x458ff3;return _0x23c151;})[_0x4ffe('0x25')](respondWithFilteredResult(_0x388474,_0x4e8fa5))[_0x4ffe('0x44')](handleError(_0x388474,null));};exports[_0x4ffe('0x45')]=function(_0x5b03e4,_0x208df2){var _0x3a771f={'raw':!![],'where':{'id':_0x5b03e4[_0x4ffe('0x46')]['id']}},_0x3ec0e1={};_0x3ec0e1[_0x4ffe('0x31')]=_[_0x4ffe('0x33')](db['VtigerField'][_0x4ffe('0x2d')]);_0x3ec0e1[_0x4ffe('0x32')]=_[_0x4ffe('0x33')](_0x5b03e4[_0x4ffe('0x32')]);_0x3ec0e1[_0x4ffe('0x34')]=_['intersection'](_0x3ec0e1['model'],_0x3ec0e1[_0x4ffe('0x32')]);_0x3a771f[_0x4ffe('0x37')]=_[_0x4ffe('0x35')](_0x3ec0e1[_0x4ffe('0x31')],qs[_0x4ffe('0x36')](_0x5b03e4[_0x4ffe('0x32')][_0x4ffe('0x36')]));_0x3a771f[_0x4ffe('0x37')]=_0x3a771f['attributes'][_0x4ffe('0x47')]?_0x3a771f[_0x4ffe('0x37')]:_0x3ec0e1[_0x4ffe('0x31')];if(_0x5b03e4[_0x4ffe('0x32')]['includeAll']){_0x3a771f[_0x4ffe('0x48')]=[{'all':!![]}];}_0x3a771f=_[_0x4ffe('0x3f')]({},_0x3a771f,_0x5b03e4[_0x4ffe('0x49')]);return db[_0x4ffe('0x41')][_0x4ffe('0x4a')](_0x3a771f)[_0x4ffe('0x25')](handleEntityNotFound(_0x208df2,null))[_0x4ffe('0x25')](respondWithResult(_0x208df2,null))['catch'](handleError(_0x208df2,null));};exports[_0x4ffe('0x4b')]=function(_0x50d9e1,_0x179daa){return db['VtigerField'][_0x4ffe('0x4b')](_0x50d9e1[_0x4ffe('0x4c')],{})['then'](respondWithResult(_0x179daa,0xc9))[_0x4ffe('0x44')](handleError(_0x179daa,null));};exports[_0x4ffe('0x24')]=function(_0xa1edce,_0x2af988){if(_0xa1edce[_0x4ffe('0x4c')]['id']){delete _0xa1edce['body']['id'];}return db[_0x4ffe('0x41')][_0x4ffe('0x4a')]({'where':{'id':_0xa1edce['params']['id']}})['then'](handleEntityNotFound(_0x2af988,null))[_0x4ffe('0x25')](saveUpdates(_0xa1edce[_0x4ffe('0x4c')],null))[_0x4ffe('0x25')](respondWithResult(_0x2af988,null))[_0x4ffe('0x44')](handleError(_0x2af988,null));};exports[_0x4ffe('0x4d')]=function(_0x580dbf,_0x4399fd){return db[_0x4ffe('0x41')][_0x4ffe('0x4a')]({'where':{'id':_0x580dbf[_0x4ffe('0x46')]['id']}})[_0x4ffe('0x25')](handleEntityNotFound(_0x4399fd,null))[_0x4ffe('0x25')](removeEntity(_0x4399fd,null))[_0x4ffe('0x44')](handleError(_0x4399fd,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 022e5c0..a9fdf73 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 _0x5700=['define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./intVtigerField.attributes','exports'];(function(_0xea35d1,_0x302471){var _0x1d7a7c=function(_0x1bc101){while(--_0x1bc101){_0xea35d1['push'](_0xea35d1['shift']());}};_0x1d7a7c(++_0x302471);}(_0x5700,0x18c));var _0x0570=function(_0x518b8c,_0xbd3aa3){_0x518b8c=_0x518b8c-0x0;var _0x472db3=_0x5700[_0x518b8c];return _0x472db3;};'use strict';var _=require(_0x0570('0x0'));var util=require('util');var logger=require(_0x0570('0x1'))(_0x0570('0x2'));var moment=require('moment');var BPromise=require(_0x0570('0x3'));var rp=require(_0x0570('0x4'));var fs=require('fs');var path=require(_0x0570('0x5'));var rimraf=require(_0x0570('0x6'));var config=require('../../config/environment');var attributes=require(_0x0570('0x7'));module[_0x0570('0x8')]=function(_0x21341e,_0x51f3ca){return _0x21341e[_0x0570('0x9')](_0x0570('0xa'),attributes,{'tableName':_0x0570('0xb'),'paranoid':![],'indexes':[{'name':_0x0570('0xc'),'fields':[_0x0570('0xd'),_0x0570('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xce74=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xce74,0x193));var _0x4ce7=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xce74[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x4ce7('0x0'));var util=require(_0x4ce7('0x1'));var logger=require(_0x4ce7('0x2'))(_0x4ce7('0x3'));var moment=require(_0x4ce7('0x4'));var BPromise=require('bluebird');var rp=require(_0x4ce7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4ce7('0x6'));var config=require(_0x4ce7('0x7'));var attributes=require('./intVtigerField.attributes');module[_0x4ce7('0x8')]=function(_0x40bd4a,_0x466342){return _0x40bd4a[_0x4ce7('0x9')](_0x4ce7('0xa'),attributes,{'tableName':_0x4ce7('0xb'),'paranoid':![],'indexes':[{'name':_0x4ce7('0xc'),'fields':[_0x4ce7('0xd'),_0x4ce7('0xe')],'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 aa2a146..719e062 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 _0x63a9=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','then','info','VtigerField,\x20%s,\x20%s'];(function(_0x156d98,_0x200673){var _0x2ff265=function(_0x2a94ba){while(--_0x2a94ba){_0x156d98['push'](_0x156d98['shift']());}};_0x2ff265(++_0x200673);}(_0x63a9,0xff));var _0x963a=function(_0x4239fe,_0x1cd5b){_0x4239fe=_0x4239fe-0x0;var _0x2caf2b=_0x63a9[_0x4239fe];return _0x2caf2b;};'use strict';var _=require(_0x963a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x963a('0x1'));var rs=require(_0x963a('0x2'));var fs=require('fs');var Redis=require(_0x963a('0x3'));var db=require(_0x963a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x963a('0x5'));var config=require(_0x963a('0x6'));var jayson=require(_0x963a('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x35b180,_0x26caa7,_0x4a742c){return new BPromise(function(_0xcc6ecd,_0x402962){return client['request'](_0x35b180,_0x4a742c)[_0x963a('0x8')](function(_0x3bfdbe){logger[_0x963a('0x9')](_0x963a('0xa'),_0x26caa7,_0x963a('0xb'));logger[_0x963a('0xc')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x26caa7,_0x963a('0xb'),JSON[_0x963a('0xd')](_0x3bfdbe));if(_0x3bfdbe[_0x963a('0xe')]){if(_0x3bfdbe[_0x963a('0xe')][_0x963a('0xf')]===0x1f4){logger[_0x963a('0xe')](_0x963a('0xa'),_0x26caa7,_0x3bfdbe['error'][_0x963a('0x10')]);return _0x402962(_0x3bfdbe[_0x963a('0xe')][_0x963a('0x10')]);}logger[_0x963a('0xe')]('VtigerField,\x20%s,\x20%s',_0x26caa7,_0x3bfdbe[_0x963a('0xe')]['message']);return _0xcc6ecd(_0x3bfdbe[_0x963a('0xe')][_0x963a('0x10')]);}else{logger[_0x963a('0x9')](_0x963a('0xa'),_0x26caa7,_0x963a('0xb'));_0xcc6ecd(_0x3bfdbe[_0x963a('0x11')][_0x963a('0x10')]);}})[_0x963a('0x12')](function(_0x4f68ea){logger[_0x963a('0xe')](_0x963a('0xa'),_0x26caa7,_0x4f68ea);_0x402962(_0x4f68ea);});});} \ No newline at end of file +var _0x4127=['client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5ace84,_0x1ceb07){var _0x52acc6=function(_0xe11d74){while(--_0xe11d74){_0x5ace84['push'](_0x5ace84['shift']());}};_0x52acc6(++_0x1ceb07);}(_0x4127,0xc9));var _0x7412=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4127[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7412('0x0'));var util=require(_0x7412('0x1'));var moment=require('moment');var BPromise=require(_0x7412('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7412('0x3'))['db'];var utils=require(_0x7412('0x4'));var logger=require(_0x7412('0x5'))(_0x7412('0x6'));var config=require(_0x7412('0x7'));var jayson=require(_0x7412('0x8'));var client=jayson[_0x7412('0x9')][_0x7412('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbca320,_0x3eb88a,_0x51f3f0){return new BPromise(function(_0x23eaed,_0xe5ae93){return client[_0x7412('0xb')](_0xbca320,_0x51f3f0)[_0x7412('0xc')](function(_0x25cb6e){logger[_0x7412('0xd')](_0x7412('0xe'),_0x3eb88a,_0x7412('0xf'));logger[_0x7412('0x10')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x3eb88a,'request\x20sent',JSON[_0x7412('0x11')](_0x25cb6e));if(_0x25cb6e[_0x7412('0x12')]){if(_0x25cb6e[_0x7412('0x12')]['code']===0x1f4){logger[_0x7412('0x12')](_0x7412('0xe'),_0x3eb88a,_0x25cb6e[_0x7412('0x12')][_0x7412('0x13')]);return _0xe5ae93(_0x25cb6e[_0x7412('0x12')][_0x7412('0x13')]);}logger['error'](_0x7412('0xe'),_0x3eb88a,_0x25cb6e[_0x7412('0x12')][_0x7412('0x13')]);return _0x23eaed(_0x25cb6e[_0x7412('0x12')][_0x7412('0x13')]);}else{logger[_0x7412('0xd')]('VtigerField,\x20%s,\x20%s',_0x3eb88a,_0x7412('0xf'));_0x23eaed(_0x25cb6e['result']['message']);}})[_0x7412('0x14')](function(_0xbaa636){logger[_0x7412('0x12')](_0x7412('0xe'),_0x3eb88a,_0xbaa636);_0xe5ae93(_0xbaa636);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 6d48dd0..e22ee8e 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 _0xf3dc=['put','update','exports','path','connect-timeout','express','Router','../../config/environment','./intZendeskAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x117927,_0x7fcc81){var _0x18eddb=function(_0x3c39b5){while(--_0x3c39b5){_0x117927['push'](_0x117927['shift']());}};_0x18eddb(++_0x7fcc81);}(_0xf3dc,0x1a5));var _0xcf3d=function(_0x21c0de,_0x4a9720){_0x21c0de=_0x21c0de-0x0;var _0x32229e=_0xf3dc[_0x21c0de];return _0x32229e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcf3d('0x0'));var timeout=require(_0xcf3d('0x1'));var express=require(_0xcf3d('0x2'));var router=express[_0xcf3d('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcf3d('0x4'));var controller=require(_0xcf3d('0x5'));router[_0xcf3d('0x6')]('/',auth['isAuthenticated'](),controller[_0xcf3d('0x7')]);router[_0xcf3d('0x6')](_0xcf3d('0x8'),auth[_0xcf3d('0x9')](),controller['show']);router['get'](_0xcf3d('0xa'),auth[_0xcf3d('0x9')](),controller['getConfigurations']);router['get'](_0xcf3d('0xb'),auth[_0xcf3d('0x9')](),controller[_0xcf3d('0xc')]);router[_0xcf3d('0xd')]('/',auth[_0xcf3d('0x9')](),controller[_0xcf3d('0xe')]);router[_0xcf3d('0xd')](_0xcf3d('0xa'),auth[_0xcf3d('0x9')](),controller[_0xcf3d('0xf')]);router[_0xcf3d('0x10')](_0xcf3d('0x8'),auth[_0xcf3d('0x9')](),controller[_0xcf3d('0x11')]);router['delete'](_0xcf3d('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0xcf3d('0x12')]=router; \ No newline at end of file +var _0x8c46=['show','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','update','destroy','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id'];(function(_0x31c19c,_0xbe4b70){var _0x1a87f7=function(_0x23cf92){while(--_0x23cf92){_0x31c19c['push'](_0x31c19c['shift']());}};_0x1a87f7(++_0xbe4b70);}(_0x8c46,0x171));var _0x68c4=function(_0x3a11ce,_0x3b203e){_0x3a11ce=_0x3a11ce-0x0;var _0x159267=_0x8c46[_0x3a11ce];return _0x159267;};'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 fs_extra=require(_0x68c4('0x2'));var auth=require(_0x68c4('0x3'));var interaction=require(_0x68c4('0x4'));var config=require(_0x68c4('0x5'));var controller=require(_0x68c4('0x6'));router[_0x68c4('0x7')]('/',auth[_0x68c4('0x8')](),controller[_0x68c4('0x9')]);router[_0x68c4('0x7')](_0x68c4('0xa'),auth['isAuthenticated'](),controller[_0x68c4('0xb')]);router[_0x68c4('0x7')](_0x68c4('0xc'),auth['isAuthenticated'](),controller[_0x68c4('0xd')]);router[_0x68c4('0x7')](_0x68c4('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0x68c4('0xf')]('/',auth[_0x68c4('0x8')](),controller['create']);router['post'](_0x68c4('0xc'),auth[_0x68c4('0x8')](),controller[_0x68c4('0x10')]);router['put'](_0x68c4('0xa'),auth[_0x68c4('0x8')](),controller[_0x68c4('0x11')]);router['delete'](_0x68c4('0xa'),auth[_0x68c4('0x8')](),controller[_0x68c4('0x12')]);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 d7e39e9..dfcf66f 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 _0x16ce=['password','integrationTab','newTab','exports','STRING','username','ENUM','token'];(function(_0x253547,_0x592e03){var _0x5db91d=function(_0x5d9e71){while(--_0x5d9e71){_0x253547['push'](_0x253547['shift']());}};_0x5db91d(++_0x592e03);}(_0x16ce,0xfb));var _0xe16c=function(_0x4a141d,_0x33d737){_0x4a141d=_0x4a141d-0x0;var _0x37bb38=_0x16ce[_0x4a141d];return _0x37bb38;};'use strict';var Sequelize=require('sequelize');module[_0xe16c('0x0')]={'name':{'type':Sequelize[_0xe16c('0x1')]},'description':{'type':Sequelize[_0xe16c('0x1')]},'username':{'type':Sequelize[_0xe16c('0x1')],'unique':_0xe16c('0x2')},'password':{'type':Sequelize[_0xe16c('0x1')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0xe16c('0x3')]('password',_0xe16c('0x4')),'defaultValue':_0xe16c('0x5')},'serverUrl':{'type':Sequelize[_0xe16c('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xe16c('0x3')](_0xe16c('0x6'),_0xe16c('0x7')),'defaultValue':_0xe16c('0x6')}}; \ No newline at end of file +var _0x1a37=['remoteUri','password','ENUM','integrationTab','sequelize','exports','STRING','username'];(function(_0x26f87f,_0x557c8b){var _0x4f6b74=function(_0x703623){while(--_0x703623){_0x26f87f['push'](_0x26f87f['shift']());}};_0x4f6b74(++_0x557c8b);}(_0x1a37,0xb4));var _0x71a3=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x1a37[_0x381589];return _0x2a075d;};'use strict';var Sequelize=require(_0x71a3('0x0'));module[_0x71a3('0x1')]={'name':{'type':Sequelize[_0x71a3('0x2')]},'description':{'type':Sequelize[_0x71a3('0x2')]},'username':{'type':Sequelize[_0x71a3('0x2')],'unique':_0x71a3('0x3')},'password':{'type':Sequelize[_0x71a3('0x2')]},'token':{'type':Sequelize[_0x71a3('0x2')]},'remoteUri':{'type':Sequelize[_0x71a3('0x2')],'unique':_0x71a3('0x4')},'authType':{'type':Sequelize['ENUM'](_0x71a3('0x5'),'token'),'defaultValue':_0x71a3('0x5')},'serverUrl':{'type':Sequelize[_0x71a3('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x71a3('0x6')](_0x71a3('0x7'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 4ff3af4..042f3e7 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 _0x2f68=['find','create','body','catch','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskConfiguration','ZendeskField','getFields','password','token','authType','remoteUri','substring','lastIndexOf','GET','format','%s/%s','Basic\x20%s','%s:%s','username','toString','Sequelize','Unknown\x20authentication\x20type','subject','description','group','ticket_fields','includes','position','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','send','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','then','stack','name','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys'];(function(_0x5dcfa7,_0x1890b9){var _0xe2da2c=function(_0x4d1eae){while(--_0x4d1eae){_0x5dcfa7['push'](_0x5dcfa7['shift']());}};_0xe2da2c(++_0x1890b9);}(_0x2f68,0x9a));var _0x82f6=function(_0x193027,_0x107357){_0x193027=_0x193027-0x0;var _0x1fbc25=_0x2f68[_0x193027];return _0x1fbc25;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x82f6('0x0'));var zipdir=require(_0x82f6('0x1'));var jsonpatch=require(_0x82f6('0x2'));var rp=require(_0x82f6('0x3'));var moment=require('moment');var BPromise=require(_0x82f6('0x4'));var Mustache=require('mustache');var util=require(_0x82f6('0x5'));var path=require(_0x82f6('0x6'));var sox=require('sox');var csv=require(_0x82f6('0x7'));var ejs=require(_0x82f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x82f6('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x82f6('0xa'));var toCsv=require(_0x82f6('0x7'));var querystring=require(_0x82f6('0xb'));var Papa=require('papaparse');var Redis=require(_0x82f6('0xc'));var authService=require(_0x82f6('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x82f6('0xe'));var hardwareService=require(_0x82f6('0xf'));var logger=require(_0x82f6('0x10'))(_0x82f6('0x11'));var utils=require(_0x82f6('0x12'));var config=require(_0x82f6('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x82f6('0x14'))['db'];var integrations=require(_0x82f6('0x15'));function respondWithStatusCode(_0x4cc967,_0x194da7){_0x194da7=_0x194da7||0xcc;return function(_0x1f8bf5){if(_0x1f8bf5){return _0x4cc967[_0x82f6('0x16')](_0x194da7);}return _0x4cc967[_0x82f6('0x17')](_0x194da7)[_0x82f6('0x18')]();};}function respondWithResult(_0xa00275,_0x115c7b){_0x115c7b=_0x115c7b||0xc8;return function(_0x171815){if(_0x171815){return _0xa00275[_0x82f6('0x17')](_0x115c7b)['json'](_0x171815);}};}function respondWithFilteredResult(_0x389949,_0x5d0827){return function(_0x249222){if(_0x249222){var _0x1d0263=typeof _0x5d0827[_0x82f6('0x19')]===_0x82f6('0x1a')&&typeof _0x5d0827[_0x82f6('0x1b')]===_0x82f6('0x1a');var _0x326378=_0x249222[_0x82f6('0x1c')];var _0x4072f0=_0x1d0263?0x0:_0x5d0827[_0x82f6('0x19')];var _0x1c79f9=_0x1d0263?_0x249222[_0x82f6('0x1c')]:_0x5d0827[_0x82f6('0x19')]+_0x5d0827[_0x82f6('0x1b')];var _0x3a8269;if(_0x1c79f9>=_0x326378){_0x1c79f9=_0x326378;_0x3a8269=0xc8;}else{_0x3a8269=0xce;}_0x389949['status'](_0x3a8269);return _0x389949[_0x82f6('0x1d')](_0x82f6('0x1e'),_0x4072f0+'-'+_0x1c79f9+'/'+_0x326378)['json'](_0x249222);}return null;};}function patchUpdates(_0x2b03ad){return function(_0x4b9f0){try{jsonpatch[_0x82f6('0x1f')](_0x4b9f0,_0x2b03ad,!![]);}catch(_0x25cae6){return BPromise['reject'](_0x25cae6);}return _0x4b9f0[_0x82f6('0x20')]();};}function saveUpdates(_0x4beccf,_0x8668bb){return function(_0x2a0ce6){if(_0x2a0ce6){return _0x2a0ce6['update'](_0x4beccf)['then'](function(_0x3af5f7){return _0x3af5f7;});}return null;};}function removeEntity(_0x1d96d5,_0x4c57c5){return function(_0x5a5059){if(_0x5a5059){return _0x5a5059[_0x82f6('0x21')]()[_0x82f6('0x22')](function(){_0x1d96d5['status'](0xcc)[_0x82f6('0x18')]();});}};}function handleEntityNotFound(_0x304e83,_0x5037f8){return function(_0x57ac0d){if(!_0x57ac0d){_0x304e83[_0x82f6('0x16')](0x194);}return _0x57ac0d;};}function handleError(_0x5187d0,_0x469b6b){_0x469b6b=_0x469b6b||0x1f4;return function(_0x5a6d69){logger['error'](_0x5a6d69[_0x82f6('0x23')]);if(_0x5a6d69[_0x82f6('0x24')]){delete _0x5a6d69[_0x82f6('0x24')];}_0x5187d0[_0x82f6('0x17')](_0x469b6b)['send'](_0x5a6d69);};}exports[_0x82f6('0x25')]=function(_0x1fb461,_0x14a309){var _0x400137={},_0x271c28={},_0x328707={'count':0x0,'rows':[]};var _0x27e473=_[_0x82f6('0x26')](db[_0x82f6('0x27')][_0x82f6('0x28')],function(_0x3c9419){return{'name':_0x3c9419[_0x82f6('0x29')],'type':_0x3c9419[_0x82f6('0x2a')][_0x82f6('0x2b')]};});_0x271c28['model']=_[_0x82f6('0x26')](_0x27e473,_0x82f6('0x24'));_0x271c28[_0x82f6('0x2c')]=_['keys'](_0x1fb461[_0x82f6('0x2c')]);_0x271c28[_0x82f6('0x2d')]=_[_0x82f6('0x2e')](_0x271c28[_0x82f6('0x2f')],_0x271c28[_0x82f6('0x2c')]);_0x400137[_0x82f6('0x30')]=_[_0x82f6('0x2e')](_0x271c28[_0x82f6('0x2f')],qs[_0x82f6('0x31')](_0x1fb461[_0x82f6('0x2c')][_0x82f6('0x31')]));_0x400137[_0x82f6('0x30')]=_0x400137[_0x82f6('0x30')][_0x82f6('0x32')]?_0x400137['attributes']:_0x271c28[_0x82f6('0x2f')];if(!_0x1fb461[_0x82f6('0x2c')][_0x82f6('0x33')](_0x82f6('0x34'))){_0x400137[_0x82f6('0x1b')]=qs[_0x82f6('0x1b')](_0x1fb461[_0x82f6('0x2c')][_0x82f6('0x1b')]);_0x400137[_0x82f6('0x19')]=qs[_0x82f6('0x19')](_0x1fb461[_0x82f6('0x2c')][_0x82f6('0x19')]);}_0x400137[_0x82f6('0x35')]=qs[_0x82f6('0x36')](_0x1fb461['query'][_0x82f6('0x36')]);_0x400137['where']=qs['filters'](_[_0x82f6('0x37')](_0x1fb461[_0x82f6('0x2c')],_0x271c28['filters']),_0x27e473);if(_0x1fb461[_0x82f6('0x2c')][_0x82f6('0x38')]){_0x400137[_0x82f6('0x39')]=_['merge'](_0x400137[_0x82f6('0x39')],{'$or':_['map'](_0x27e473,function(_0x2be8cf){if(_0x2be8cf['type']!==_0x82f6('0x3a')){var _0x47ef9e={};_0x47ef9e[_0x2be8cf[_0x82f6('0x24')]]={'$like':'%'+_0x1fb461[_0x82f6('0x2c')]['filter']+'%'};return _0x47ef9e;}})});}_0x400137=_[_0x82f6('0x3b')]({},_0x400137,_0x1fb461[_0x82f6('0x3c')]);var _0x3e7c53={'where':_0x400137[_0x82f6('0x39')]};return db['ZendeskAccount'][_0x82f6('0x1c')](_0x3e7c53)[_0x82f6('0x22')](function(_0x23ea04){_0x328707[_0x82f6('0x1c')]=_0x23ea04;if(_0x1fb461['query'][_0x82f6('0x3d')]){_0x400137[_0x82f6('0x3e')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x82f6('0x3f')](_0x400137);})[_0x82f6('0x22')](function(_0x2d7509){_0x328707[_0x82f6('0x40')]=_0x2d7509;return _0x328707;})[_0x82f6('0x22')](respondWithFilteredResult(_0x14a309,_0x400137))['catch'](handleError(_0x14a309,null));};exports[_0x82f6('0x41')]=function(_0x5786ce,_0x139614){var _0x38e82d={'raw':![],'where':{'id':_0x5786ce[_0x82f6('0x42')]['id']}},_0x32d6b5={};_0x32d6b5[_0x82f6('0x2f')]=_[_0x82f6('0x43')](db[_0x82f6('0x27')]['rawAttributes']);_0x32d6b5[_0x82f6('0x2c')]=_[_0x82f6('0x43')](_0x5786ce[_0x82f6('0x2c')]);_0x32d6b5[_0x82f6('0x2d')]=_['intersection'](_0x32d6b5[_0x82f6('0x2f')],_0x32d6b5['query']);_0x38e82d[_0x82f6('0x30')]=_[_0x82f6('0x2e')](_0x32d6b5[_0x82f6('0x2f')],qs[_0x82f6('0x31')](_0x5786ce[_0x82f6('0x2c')][_0x82f6('0x31')]));_0x38e82d['attributes']=_0x38e82d[_0x82f6('0x30')][_0x82f6('0x32')]?_0x38e82d[_0x82f6('0x30')]:_0x32d6b5[_0x82f6('0x2f')];if(_0x5786ce[_0x82f6('0x2c')][_0x82f6('0x3d')]){_0x38e82d[_0x82f6('0x3e')]=[{'all':!![]}];}_0x38e82d=_[_0x82f6('0x3b')]({},_0x38e82d,_0x5786ce['options']);return db[_0x82f6('0x27')][_0x82f6('0x44')](_0x38e82d)['then'](handleEntityNotFound(_0x139614,null))[_0x82f6('0x22')](respondWithResult(_0x139614,null))['catch'](handleError(_0x139614,null));};exports[_0x82f6('0x45')]=function(_0x5e3321,_0x227ab8){return db[_0x82f6('0x27')][_0x82f6('0x45')](_0x5e3321[_0x82f6('0x46')],{})[_0x82f6('0x22')](respondWithResult(_0x227ab8,0xc9))[_0x82f6('0x47')](handleError(_0x227ab8,null));};exports['update']=function(_0x3cb1f0,_0xdc77ca){if(_0x3cb1f0['body']['id']){delete _0x3cb1f0['body']['id'];}return db[_0x82f6('0x27')][_0x82f6('0x44')]({'where':{'id':_0x3cb1f0[_0x82f6('0x42')]['id']}})['then'](handleEntityNotFound(_0xdc77ca,null))[_0x82f6('0x22')](saveUpdates(_0x3cb1f0[_0x82f6('0x46')],null))[_0x82f6('0x22')](respondWithResult(_0xdc77ca,null))[_0x82f6('0x47')](handleError(_0xdc77ca,null));};exports['destroy']=function(_0x495400,_0x1695ea){return db[_0x82f6('0x27')][_0x82f6('0x44')]({'where':{'id':_0x495400['params']['id']}})[_0x82f6('0x22')](handleEntityNotFound(_0x1695ea,null))[_0x82f6('0x22')](removeEntity(_0x1695ea,null))['catch'](handleError(_0x1695ea,null));};exports['getConfigurations']=function(_0x4fa2ca,_0x2e6b03,_0x4a63a6){var _0x259d83={};var _0x57c023={};var _0x33c359;var _0x4f69de;return db[_0x82f6('0x27')]['findOne']({'where':{'id':_0x4fa2ca[_0x82f6('0x42')]['id']}})[_0x82f6('0x22')](handleEntityNotFound(_0x2e6b03,null))[_0x82f6('0x22')](function(_0x1633cf){if(_0x1633cf){_0x33c359=_0x1633cf;_0x57c023[_0x82f6('0x2f')]=_[_0x82f6('0x43')](db['ZendeskConfiguration'][_0x82f6('0x28')]);_0x57c023[_0x82f6('0x2c')]=_[_0x82f6('0x43')](_0x4fa2ca['query']);_0x57c023['filters']=_[_0x82f6('0x2e')](_0x57c023[_0x82f6('0x2f')],_0x57c023[_0x82f6('0x2c')]);_0x259d83[_0x82f6('0x30')]=_['intersection'](_0x57c023[_0x82f6('0x2f')],qs[_0x82f6('0x31')](_0x4fa2ca[_0x82f6('0x2c')]['fields']));_0x259d83['attributes']=_0x259d83['attributes'][_0x82f6('0x32')]?_0x259d83[_0x82f6('0x30')]:_0x57c023[_0x82f6('0x2f')];_0x259d83[_0x82f6('0x35')]=qs[_0x82f6('0x36')](_0x4fa2ca[_0x82f6('0x2c')][_0x82f6('0x36')]);_0x259d83[_0x82f6('0x39')]=qs['filters'](_[_0x82f6('0x37')](_0x4fa2ca[_0x82f6('0x2c')],_0x57c023[_0x82f6('0x2d')]));if(_0x4fa2ca[_0x82f6('0x2c')]['filter']){_0x259d83['where']=_[_0x82f6('0x3b')](_0x259d83[_0x82f6('0x39')],{'$or':_['map'](_0x259d83[_0x82f6('0x30')],function(_0xa12f6e){var _0x404d09={};_0x404d09[_0xa12f6e]={'$like':'%'+_0x4fa2ca['query'][_0x82f6('0x38')]+'%'};return _0x404d09;})});}_0x259d83=_[_0x82f6('0x3b')]({},_0x259d83,_0x4fa2ca[_0x82f6('0x3c')]);return _0x33c359[_0x82f6('0x48')](_0x259d83);}})[_0x82f6('0x22')](function(_0x41da7f){if(_0x41da7f){_0x4f69de=_0x41da7f['length'];if(!_0x4fa2ca[_0x82f6('0x2c')][_0x82f6('0x33')](_0x82f6('0x34'))){_0x259d83[_0x82f6('0x1b')]=qs[_0x82f6('0x1b')](_0x4fa2ca['query'][_0x82f6('0x1b')]);_0x259d83[_0x82f6('0x19')]=qs[_0x82f6('0x19')](_0x4fa2ca[_0x82f6('0x2c')][_0x82f6('0x19')]);}return _0x33c359[_0x82f6('0x48')](_0x259d83);}})[_0x82f6('0x22')](function(_0x17389a){if(_0x17389a){return _0x17389a?{'count':_0x4f69de,'rows':_0x17389a}:null;}})['then'](respondWithResult(_0x2e6b03,null))[_0x82f6('0x47')](handleError(_0x2e6b03,null));};exports['addConfiguration']=function(_0x3f0337,_0x85ea2e,_0x4e51a6){if(_0x3f0337[_0x82f6('0x46')]['id']){delete _0x3f0337[_0x82f6('0x46')]['id'];}return db[_0x82f6('0x27')]['findOne']({'where':{'id':_0x3f0337['params']['id']}})[_0x82f6('0x22')](handleEntityNotFound(_0x85ea2e,null))[_0x82f6('0x22')](function(_0x58b96b){if(_0x58b96b){_0x3f0337['body'][_0x82f6('0x49')]=_0x58b96b['id'];_0x3f0337[_0x82f6('0x46')][_0x82f6('0x4a')]=integrations[_0x82f6('0x4b')](_0x3f0337[_0x82f6('0x46')][_0x82f6('0x4c')],_0x3f0337[_0x82f6('0x46')][_0x82f6('0x2a')]);_0x3f0337[_0x82f6('0x46')][_0x82f6('0x4d')]=integrations[_0x82f6('0x4e')](_0x3f0337[_0x82f6('0x46')]['channel'],_0x3f0337[_0x82f6('0x46')][_0x82f6('0x2a')]);return db[_0x82f6('0x4f')][_0x82f6('0x45')](_0x3f0337[_0x82f6('0x46')],{'include':[{'model':db['ZendeskField'],'as':_0x82f6('0x4a')},{'model':db[_0x82f6('0x50')],'as':_0x82f6('0x4d')}]});}return null;})['then'](respondWithResult(_0x85ea2e,null))[_0x82f6('0x47')](handleError(_0x85ea2e,null));};exports[_0x82f6('0x51')]=function(_0x17924d,_0x27a79c,_0xeec407){var _0x39a4b3='';return db[_0x82f6('0x27')]['findOne']({'where':{'id':_0x17924d[_0x82f6('0x42')]['id']},'attributes':['id','username',_0x82f6('0x52'),_0x82f6('0x53'),_0x82f6('0x54'),_0x82f6('0x55')]})[_0x82f6('0x22')](handleEntityNotFound(_0x27a79c,null))[_0x82f6('0x22')](function(_0x2d8721){if(_0x2d8721){_0x39a4b3=_0x2d8721[_0x82f6('0x55')];var _0x30b903=_0x39a4b3['slice'](-0x1);if(_0x30b903==='/'){_0x39a4b3=_0x39a4b3[_0x82f6('0x56')](0x0,_0x39a4b3[_0x82f6('0x57')](_0x30b903));}var _0x33cc55={'method':_0x82f6('0x58'),'uri':util[_0x82f6('0x59')](_0x82f6('0x5a'),_0x39a4b3,'ticket_fields'),'json':!![]};switch(_0x2d8721[_0x82f6('0x54')]){case _0x82f6('0x52'):_0x33cc55['headers']={'Authorization':util['format'](_0x82f6('0x5b'),new Buffer(util[_0x82f6('0x59')](_0x82f6('0x5c'),_0x2d8721[_0x82f6('0x5d')],_0x2d8721[_0x82f6('0x52')]))[_0x82f6('0x5e')]('base64'))};break;case _0x82f6('0x53'):_0x33cc55['headers']={'Authorization':util[_0x82f6('0x59')]('Basic\x20%s',new Buffer(util[_0x82f6('0x59')]('%s/token:%s',_0x2d8721[_0x82f6('0x5d')],_0x2d8721[_0x82f6('0x53')]))[_0x82f6('0x5e')]('base64'))};break;default:throw new db[(_0x82f6('0x5f'))]['ValidationError'](_0x82f6('0x60'));}return rp(_0x33cc55);}})[_0x82f6('0x22')](function(_0x3e69f6){if(_0x3e69f6){var _0x4d1bfd=[_0x82f6('0x61'),_0x82f6('0x62'),_0x82f6('0x63'),'assignee'];_['remove'](_0x3e69f6[_0x82f6('0x64')],function(_0x30327a){return _0x4d1bfd[_0x82f6('0x65')](_0x30327a[_0x82f6('0x2a')]);});return{'count':_0x3e69f6[_0x82f6('0x64')][_0x82f6('0x32')],'rows':_[_0x82f6('0x26')](_0x3e69f6[_0x82f6('0x64')],function(_0x4df767){return{'id':_0x4df767['id'],'name':_0x4df767[_0x82f6('0x66')]>0x7?_0x4df767[_0x82f6('0x67')]:_0x4df767['type'],'custom':_0x4df767[_0x82f6('0x66')]>0x7?!![]:![],'options':_0x4df767[_0x82f6('0x68')]?_0x4df767[_0x82f6('0x68')]:_0x4df767['custom_field_options']?_0x4df767[_0x82f6('0x69')]:[]};})};}})[_0x82f6('0x22')](respondWithResult(_0x27a79c,null))[_0x82f6('0x47')](function(_0x2cc906){var _0x50ab5c=_0x17924d[_0x82f6('0x2c')][_0x82f6('0x6a')]?0x1f4:_0x2cc906[_0x82f6('0x6b')]||0x1f4;logger[_0x82f6('0x6c')](_0x82f6('0x6d'),_0x82f6('0x51'),_0x50ab5c,JSON['stringify'](_0x2cc906));delete _0x2cc906[_0x82f6('0x24')];if(_0x50ab5c===0x191){_0x50ab5c=0x190;}_0x27a79c[_0x82f6('0x17')](_0x50ab5c)[_0x82f6('0x6e')](_0x17924d[_0x82f6('0x2c')][_0x82f6('0x6a')]?{'message':'Wrong\x20credentials','statusCode':_0x2cc906[_0x82f6('0x6b')]}:_0x2cc906);});}; \ No newline at end of file +var _0x4483=['fields','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','options','ZendeskAccount','includeAll','include','findAll','then','rows','catch','params','rawAttributes','length','merge','find','create','body','update','getConfigurations','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','authType','remoteUri','slice','lastIndexOf','format','%s/%s','password','headers','Basic\x20%s','%s:%s','toString','base64','token','%s/token:%s','Sequelize','ValidationError','subject','description','group','assignee','ticket_fields','includes','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','destroy','end','error','stack','name','send','index','map','fieldName','type','query','keys','filters','intersection','model','attributes'];(function(_0x80f51a,_0x32e95e){var _0x327148=function(_0x16f788){while(--_0x16f788){_0x80f51a['push'](_0x80f51a['shift']());}};_0x327148(++_0x32e95e);}(_0x4483,0x1a3));var _0x3448=function(_0x55c675,_0x42af13){_0x55c675=_0x55c675-0x0;var _0x26d5ba=_0x4483[_0x55c675];return _0x26d5ba;};'use strict';var emlformat=require(_0x3448('0x0'));var rimraf=require(_0x3448('0x1'));var zipdir=require(_0x3448('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3448('0x3'));var moment=require(_0x3448('0x4'));var BPromise=require(_0x3448('0x5'));var Mustache=require(_0x3448('0x6'));var util=require(_0x3448('0x7'));var path=require('path');var sox=require(_0x3448('0x8'));var csv=require(_0x3448('0x9'));var ejs=require(_0x3448('0xa'));var fs=require('fs');var fs_extra=require(_0x3448('0xb'));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 licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x3448('0x1b'));function respondWithStatusCode(_0x38fbb1,_0x5f52bd){_0x5f52bd=_0x5f52bd||0xcc;return function(_0x2661e1){if(_0x2661e1){return _0x38fbb1[_0x3448('0x1c')](_0x5f52bd);}return _0x38fbb1[_0x3448('0x1d')](_0x5f52bd)['end']();};}function respondWithResult(_0x14104c,_0x2952a6){_0x2952a6=_0x2952a6||0xc8;return function(_0x4daf3e){if(_0x4daf3e){return _0x14104c[_0x3448('0x1d')](_0x2952a6)[_0x3448('0x1e')](_0x4daf3e);}};}function respondWithFilteredResult(_0x46784f,_0x4fc70f){return function(_0x472518){if(_0x472518){var _0x28f5b9=typeof _0x4fc70f[_0x3448('0x1f')]===_0x3448('0x20')&&typeof _0x4fc70f[_0x3448('0x21')]===_0x3448('0x20');var _0x247d1a=_0x472518[_0x3448('0x22')];var _0x4a348c=_0x28f5b9?0x0:_0x4fc70f[_0x3448('0x1f')];var _0x5b410d=_0x28f5b9?_0x472518['count']:_0x4fc70f['offset']+_0x4fc70f[_0x3448('0x21')];var _0x278736;if(_0x5b410d>=_0x247d1a){_0x5b410d=_0x247d1a;_0x278736=0xc8;}else{_0x278736=0xce;}_0x46784f[_0x3448('0x1d')](_0x278736);return _0x46784f['set'](_0x3448('0x23'),_0x4a348c+'-'+_0x5b410d+'/'+_0x247d1a)[_0x3448('0x1e')](_0x472518);}return null;};}function patchUpdates(_0x317de6){return function(_0x18608e){try{jsonpatch[_0x3448('0x24')](_0x18608e,_0x317de6,!![]);}catch(_0x715c3){return BPromise['reject'](_0x715c3);}return _0x18608e['save']();};}function saveUpdates(_0x4e6716,_0x1b3d5a){return function(_0x200f72){if(_0x200f72){return _0x200f72['update'](_0x4e6716)['then'](function(_0x2dcd40){return _0x2dcd40;});}return null;};}function removeEntity(_0x4371d6,_0x22ad5c){return function(_0x4368c7){if(_0x4368c7){return _0x4368c7[_0x3448('0x25')]()['then'](function(){_0x4371d6[_0x3448('0x1d')](0xcc)[_0x3448('0x26')]();});}};}function handleEntityNotFound(_0x114244,_0x2088de){return function(_0x951811){if(!_0x951811){_0x114244['sendStatus'](0x194);}return _0x951811;};}function handleError(_0x329947,_0x393081){_0x393081=_0x393081||0x1f4;return function(_0x52c163){logger[_0x3448('0x27')](_0x52c163[_0x3448('0x28')]);if(_0x52c163[_0x3448('0x29')]){delete _0x52c163[_0x3448('0x29')];}_0x329947[_0x3448('0x1d')](_0x393081)[_0x3448('0x2a')](_0x52c163);};}exports[_0x3448('0x2b')]=function(_0x95714e,_0x5911b8){var _0x3307dc={},_0x450704={},_0xcfdc5={'count':0x0,'rows':[]};var _0x52c09d=_[_0x3448('0x2c')](db['ZendeskAccount']['rawAttributes'],function(_0x493898){return{'name':_0x493898[_0x3448('0x2d')],'type':_0x493898[_0x3448('0x2e')]['key']};});_0x450704['model']=_[_0x3448('0x2c')](_0x52c09d,_0x3448('0x29'));_0x450704[_0x3448('0x2f')]=_[_0x3448('0x30')](_0x95714e['query']);_0x450704[_0x3448('0x31')]=_[_0x3448('0x32')](_0x450704[_0x3448('0x33')],_0x450704['query']);_0x3307dc[_0x3448('0x34')]=_[_0x3448('0x32')](_0x450704['model'],qs['fields'](_0x95714e[_0x3448('0x2f')][_0x3448('0x35')]));_0x3307dc[_0x3448('0x34')]=_0x3307dc[_0x3448('0x34')]['length']?_0x3307dc[_0x3448('0x34')]:_0x450704[_0x3448('0x33')];if(!_0x95714e[_0x3448('0x2f')][_0x3448('0x36')]('nolimit')){_0x3307dc[_0x3448('0x21')]=qs[_0x3448('0x21')](_0x95714e['query'][_0x3448('0x21')]);_0x3307dc[_0x3448('0x1f')]=qs[_0x3448('0x1f')](_0x95714e[_0x3448('0x2f')][_0x3448('0x1f')]);}_0x3307dc[_0x3448('0x37')]=qs[_0x3448('0x38')](_0x95714e[_0x3448('0x2f')][_0x3448('0x38')]);_0x3307dc['where']=qs['filters'](_[_0x3448('0x39')](_0x95714e['query'],_0x450704[_0x3448('0x31')]),_0x52c09d);if(_0x95714e[_0x3448('0x2f')][_0x3448('0x3a')]){_0x3307dc[_0x3448('0x3b')]=_['merge'](_0x3307dc[_0x3448('0x3b')],{'$or':_[_0x3448('0x2c')](_0x52c09d,function(_0x495d7){if(_0x495d7[_0x3448('0x2e')]!==_0x3448('0x3c')){var _0x249131={};_0x249131[_0x495d7[_0x3448('0x29')]]={'$like':'%'+_0x95714e[_0x3448('0x2f')][_0x3448('0x3a')]+'%'};return _0x249131;}})});}_0x3307dc=_['merge']({},_0x3307dc,_0x95714e[_0x3448('0x3d')]);var _0x3c92e2={'where':_0x3307dc[_0x3448('0x3b')]};return db[_0x3448('0x3e')][_0x3448('0x22')](_0x3c92e2)['then'](function(_0x18b297){_0xcfdc5[_0x3448('0x22')]=_0x18b297;if(_0x95714e[_0x3448('0x2f')][_0x3448('0x3f')]){_0x3307dc[_0x3448('0x40')]=[{'all':!![]}];}return db[_0x3448('0x3e')][_0x3448('0x41')](_0x3307dc);})[_0x3448('0x42')](function(_0x4a8f80){_0xcfdc5[_0x3448('0x43')]=_0x4a8f80;return _0xcfdc5;})[_0x3448('0x42')](respondWithFilteredResult(_0x5911b8,_0x3307dc))[_0x3448('0x44')](handleError(_0x5911b8,null));};exports['show']=function(_0x2465ff,_0x1d2a7c){var _0x21f989={'raw':![],'where':{'id':_0x2465ff[_0x3448('0x45')]['id']}},_0x26d6b8={};_0x26d6b8[_0x3448('0x33')]=_[_0x3448('0x30')](db['ZendeskAccount'][_0x3448('0x46')]);_0x26d6b8[_0x3448('0x2f')]=_[_0x3448('0x30')](_0x2465ff[_0x3448('0x2f')]);_0x26d6b8[_0x3448('0x31')]=_[_0x3448('0x32')](_0x26d6b8['model'],_0x26d6b8[_0x3448('0x2f')]);_0x21f989['attributes']=_['intersection'](_0x26d6b8[_0x3448('0x33')],qs[_0x3448('0x35')](_0x2465ff['query'][_0x3448('0x35')]));_0x21f989[_0x3448('0x34')]=_0x21f989['attributes'][_0x3448('0x47')]?_0x21f989[_0x3448('0x34')]:_0x26d6b8['model'];if(_0x2465ff[_0x3448('0x2f')][_0x3448('0x3f')]){_0x21f989[_0x3448('0x40')]=[{'all':!![]}];}_0x21f989=_[_0x3448('0x48')]({},_0x21f989,_0x2465ff[_0x3448('0x3d')]);return db[_0x3448('0x3e')][_0x3448('0x49')](_0x21f989)['then'](handleEntityNotFound(_0x1d2a7c,null))['then'](respondWithResult(_0x1d2a7c,null))[_0x3448('0x44')](handleError(_0x1d2a7c,null));};exports[_0x3448('0x4a')]=function(_0x1b82e7,_0x3f48e3){return db['ZendeskAccount'][_0x3448('0x4a')](_0x1b82e7[_0x3448('0x4b')],{})[_0x3448('0x42')](respondWithResult(_0x3f48e3,0xc9))[_0x3448('0x44')](handleError(_0x3f48e3,null));};exports[_0x3448('0x4c')]=function(_0x5d942b,_0x3edd60){if(_0x5d942b['body']['id']){delete _0x5d942b[_0x3448('0x4b')]['id'];}return db[_0x3448('0x3e')]['find']({'where':{'id':_0x5d942b[_0x3448('0x45')]['id']}})[_0x3448('0x42')](handleEntityNotFound(_0x3edd60,null))[_0x3448('0x42')](saveUpdates(_0x5d942b[_0x3448('0x4b')],null))[_0x3448('0x42')](respondWithResult(_0x3edd60,null))[_0x3448('0x44')](handleError(_0x3edd60,null));};exports[_0x3448('0x25')]=function(_0x53236c,_0x23dbda){return db[_0x3448('0x3e')]['find']({'where':{'id':_0x53236c['params']['id']}})[_0x3448('0x42')](handleEntityNotFound(_0x23dbda,null))[_0x3448('0x42')](removeEntity(_0x23dbda,null))['catch'](handleError(_0x23dbda,null));};exports['getConfigurations']=function(_0x371e8a,_0xb6c293,_0x2f795d){var _0x430e74={};var _0x176e60={};var _0x39db50;var _0x2aea70;return db['ZendeskAccount']['findOne']({'where':{'id':_0x371e8a['params']['id']}})[_0x3448('0x42')](handleEntityNotFound(_0xb6c293,null))[_0x3448('0x42')](function(_0x5cf3fe){if(_0x5cf3fe){_0x39db50=_0x5cf3fe;_0x176e60[_0x3448('0x33')]=_[_0x3448('0x30')](db['ZendeskConfiguration'][_0x3448('0x46')]);_0x176e60[_0x3448('0x2f')]=_['keys'](_0x371e8a[_0x3448('0x2f')]);_0x176e60[_0x3448('0x31')]=_[_0x3448('0x32')](_0x176e60[_0x3448('0x33')],_0x176e60[_0x3448('0x2f')]);_0x430e74[_0x3448('0x34')]=_[_0x3448('0x32')](_0x176e60[_0x3448('0x33')],qs[_0x3448('0x35')](_0x371e8a['query'][_0x3448('0x35')]));_0x430e74['attributes']=_0x430e74[_0x3448('0x34')][_0x3448('0x47')]?_0x430e74[_0x3448('0x34')]:_0x176e60[_0x3448('0x33')];_0x430e74[_0x3448('0x37')]=qs[_0x3448('0x38')](_0x371e8a['query'][_0x3448('0x38')]);_0x430e74['where']=qs[_0x3448('0x31')](_[_0x3448('0x39')](_0x371e8a[_0x3448('0x2f')],_0x176e60[_0x3448('0x31')]));if(_0x371e8a[_0x3448('0x2f')]['filter']){_0x430e74['where']=_[_0x3448('0x48')](_0x430e74[_0x3448('0x3b')],{'$or':_[_0x3448('0x2c')](_0x430e74['attributes'],function(_0x7c00fe){var _0x3eb57b={};_0x3eb57b[_0x7c00fe]={'$like':'%'+_0x371e8a[_0x3448('0x2f')][_0x3448('0x3a')]+'%'};return _0x3eb57b;})});}_0x430e74=_[_0x3448('0x48')]({},_0x430e74,_0x371e8a[_0x3448('0x3d')]);return _0x39db50[_0x3448('0x4d')](_0x430e74);}})[_0x3448('0x42')](function(_0x36a151){if(_0x36a151){_0x2aea70=_0x36a151[_0x3448('0x47')];if(!_0x371e8a[_0x3448('0x2f')][_0x3448('0x36')](_0x3448('0x4e'))){_0x430e74[_0x3448('0x21')]=qs[_0x3448('0x21')](_0x371e8a[_0x3448('0x2f')][_0x3448('0x21')]);_0x430e74[_0x3448('0x1f')]=qs['offset'](_0x371e8a[_0x3448('0x2f')]['offset']);}return _0x39db50[_0x3448('0x4d')](_0x430e74);}})['then'](function(_0x1f1e3c){if(_0x1f1e3c){return _0x1f1e3c?{'count':_0x2aea70,'rows':_0x1f1e3c}:null;}})[_0x3448('0x42')](respondWithResult(_0xb6c293,null))['catch'](handleError(_0xb6c293,null));};exports[_0x3448('0x4f')]=function(_0x2f6517,_0x54cddd,_0x4f6902){if(_0x2f6517[_0x3448('0x4b')]['id']){delete _0x2f6517['body']['id'];}return db['ZendeskAccount'][_0x3448('0x50')]({'where':{'id':_0x2f6517[_0x3448('0x45')]['id']}})['then'](handleEntityNotFound(_0x54cddd,null))['then'](function(_0x1385b9){if(_0x1385b9){_0x2f6517[_0x3448('0x4b')][_0x3448('0x51')]=_0x1385b9['id'];_0x2f6517[_0x3448('0x4b')][_0x3448('0x52')]=integrations[_0x3448('0x53')](_0x2f6517[_0x3448('0x4b')][_0x3448('0x54')],_0x2f6517[_0x3448('0x4b')][_0x3448('0x2e')]);_0x2f6517[_0x3448('0x4b')][_0x3448('0x55')]=integrations[_0x3448('0x56')](_0x2f6517[_0x3448('0x4b')]['channel'],_0x2f6517[_0x3448('0x4b')][_0x3448('0x2e')]);return db['ZendeskConfiguration'][_0x3448('0x4a')](_0x2f6517[_0x3448('0x4b')],{'include':[{'model':db['ZendeskField'],'as':_0x3448('0x52')},{'model':db[_0x3448('0x57')],'as':_0x3448('0x55')}]});}return null;})['then'](respondWithResult(_0x54cddd,null))['catch'](handleError(_0x54cddd,null));};exports[_0x3448('0x58')]=function(_0x489b70,_0x31dfc5,_0x42c146){var _0x5d952a='';return db['ZendeskAccount'][_0x3448('0x50')]({'where':{'id':_0x489b70[_0x3448('0x45')]['id']},'attributes':['id',_0x3448('0x59'),'password','token',_0x3448('0x5a'),_0x3448('0x5b')]})[_0x3448('0x42')](handleEntityNotFound(_0x31dfc5,null))[_0x3448('0x42')](function(_0x29dd31){if(_0x29dd31){_0x5d952a=_0x29dd31[_0x3448('0x5b')];var _0x526f38=_0x5d952a[_0x3448('0x5c')](-0x1);if(_0x526f38==='/'){_0x5d952a=_0x5d952a['substring'](0x0,_0x5d952a[_0x3448('0x5d')](_0x526f38));}var _0x2cca2f={'method':'GET','uri':util[_0x3448('0x5e')](_0x3448('0x5f'),_0x5d952a,'ticket_fields'),'json':!![]};switch(_0x29dd31['authType']){case _0x3448('0x60'):_0x2cca2f[_0x3448('0x61')]={'Authorization':util[_0x3448('0x5e')](_0x3448('0x62'),new Buffer(util[_0x3448('0x5e')](_0x3448('0x63'),_0x29dd31[_0x3448('0x59')],_0x29dd31[_0x3448('0x60')]))[_0x3448('0x64')](_0x3448('0x65')))};break;case _0x3448('0x66'):_0x2cca2f[_0x3448('0x61')]={'Authorization':util[_0x3448('0x5e')](_0x3448('0x62'),new Buffer(util[_0x3448('0x5e')](_0x3448('0x67'),_0x29dd31['username'],_0x29dd31['token']))[_0x3448('0x64')]('base64'))};break;default:throw new db[(_0x3448('0x68'))][(_0x3448('0x69'))]('Unknown\x20authentication\x20type');}return rp(_0x2cca2f);}})[_0x3448('0x42')](function(_0x5f4352){if(_0x5f4352){var _0x15d898=[_0x3448('0x6a'),_0x3448('0x6b'),_0x3448('0x6c'),_0x3448('0x6d')];_['remove'](_0x5f4352[_0x3448('0x6e')],function(_0x2e2b73){return _0x15d898[_0x3448('0x6f')](_0x2e2b73['type']);});return{'count':_0x5f4352[_0x3448('0x6e')][_0x3448('0x47')],'rows':_[_0x3448('0x2c')](_0x5f4352['ticket_fields'],function(_0xdb5d71){return{'id':_0xdb5d71['id'],'name':_0xdb5d71['position']>0x7?_0xdb5d71['title']:_0xdb5d71[_0x3448('0x2e')],'custom':_0xdb5d71['position']>0x7?!![]:![],'options':_0xdb5d71[_0x3448('0x70')]?_0xdb5d71['system_field_options']:_0xdb5d71[_0x3448('0x71')]?_0xdb5d71[_0x3448('0x71')]:[]};})};}})['then'](respondWithResult(_0x31dfc5,null))['catch'](function(_0x2a3e76){var _0x287e21=_0x489b70['query'][_0x3448('0x72')]?0x1f4:_0x2a3e76[_0x3448('0x73')]||0x1f4;logger['error'](_0x3448('0x74'),_0x3448('0x58'),_0x287e21,JSON[_0x3448('0x75')](_0x2a3e76));delete _0x2a3e76[_0x3448('0x29')];if(_0x287e21===0x191){_0x287e21=0x190;}_0x31dfc5['status'](_0x287e21)[_0x3448('0x2a')](_0x489b70['query'][_0x3448('0x72')]?{'message':'Wrong\x20credentials','statusCode':_0x2a3e76[_0x3448('0x73')]}:_0x2a3e76);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 7042fdb..b3bc2f5 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 _0xc44a=['../../config/logger','api','moment','bluebird','path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','ZendeskAccount','int_zendesk_accounts','lodash','util'];(function(_0x5385d2,_0x1c98bc){var _0x22a863=function(_0x4983f1){while(--_0x4983f1){_0x5385d2['push'](_0x5385d2['shift']());}};_0x22a863(++_0x1c98bc);}(_0xc44a,0xc1));var _0xac44=function(_0x365be9,_0x3c88b9){_0x365be9=_0x365be9-0x0;var _0x185c12=_0xc44a[_0x365be9];return _0x185c12;};'use strict';var _=require(_0xac44('0x0'));var util=require(_0xac44('0x1'));var logger=require(_0xac44('0x2'))(_0xac44('0x3'));var moment=require(_0xac44('0x4'));var BPromise=require(_0xac44('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xac44('0x6'));var rimraf=require('rimraf');var config=require(_0xac44('0x7'));var attributes=require(_0xac44('0x8'));var integrations=require(_0xac44('0x9'));module[_0xac44('0xa')]=function(_0x5d348a,_0x56b3f9){return _0x5d348a['define'](_0xac44('0xb'),attributes,{'tableName':_0xac44('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d9f=['api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','lodash'];(function(_0x218e54,_0x52f7e5){var _0x41eca6=function(_0x2cdb8c){while(--_0x2cdb8c){_0x218e54['push'](_0x218e54['shift']());}};_0x41eca6(++_0x52f7e5);}(_0x9d9f,0x1cd));var _0xf9d9=function(_0xe434c,_0x15a63d){_0xe434c=_0xe434c-0x0;var _0x5a267c=_0x9d9f[_0xe434c];return _0x5a267c;};'use strict';var _=require(_0xf9d9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf9d9('0x1'));var moment=require('moment');var BPromise=require(_0xf9d9('0x2'));var rp=require(_0xf9d9('0x3'));var fs=require('fs');var path=require(_0xf9d9('0x4'));var rimraf=require(_0xf9d9('0x5'));var config=require(_0xf9d9('0x6'));var attributes=require(_0xf9d9('0x7'));var integrations=require(_0xf9d9('0x8'));module[_0xf9d9('0x9')]=function(_0x150856,_0x53a094){return _0x150856[_0xf9d9('0xa')]('ZendeskAccount',attributes,{'tableName':'int_zendesk_accounts','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 ebaee90..49980ff 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 _0xf6c3=['error','code','message','info','result','GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes','map','model','include','catch','raw','stringify','ShowZendeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','client','http','request','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x1ef801,_0x44eead){var _0x1911f0=function(_0x54de34){while(--_0x54de34){_0x1ef801['push'](_0x1ef801['shift']());}};_0x1911f0(++_0x44eead);}(_0xf6c3,0x9a));var _0x3f6c=function(_0x414c9e,_0x1d48d7){_0x414c9e=_0x414c9e-0x0;var _0x580657=_0xf6c3[_0x414c9e];return _0x580657;};'use strict';var _=require(_0x3f6c('0x0'));var util=require(_0x3f6c('0x1'));var moment=require(_0x3f6c('0x2'));var BPromise=require(_0x3f6c('0x3'));var rs=require(_0x3f6c('0x4'));var fs=require('fs');var Redis=require(_0x3f6c('0x5'));var db=require(_0x3f6c('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3f6c('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3f6c('0x8')][_0x3f6c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd636e5,_0x4bc959,_0x434e3f){return new BPromise(function(_0x371a74,_0x34ca9b){return client[_0x3f6c('0xa')](_0xd636e5,_0x434e3f)[_0x3f6c('0xb')](function(_0x51c469){logger['info'](_0x3f6c('0xc'),_0x4bc959,_0x3f6c('0xd'));logger[_0x3f6c('0xe')](_0x3f6c('0xf'),_0x4bc959,_0x3f6c('0xd'),JSON['stringify'](_0x51c469));if(_0x51c469[_0x3f6c('0x10')]){if(_0x51c469['error'][_0x3f6c('0x11')]===0x1f4){logger['error'](_0x3f6c('0xc'),_0x4bc959,_0x51c469[_0x3f6c('0x10')][_0x3f6c('0x12')]);return _0x34ca9b(_0x51c469[_0x3f6c('0x10')][_0x3f6c('0x12')]);}logger[_0x3f6c('0x10')](_0x3f6c('0xc'),_0x4bc959,_0x51c469[_0x3f6c('0x10')][_0x3f6c('0x12')]);return _0x371a74(_0x51c469[_0x3f6c('0x10')]['message']);}else{logger[_0x3f6c('0x13')](_0x3f6c('0xc'),_0x4bc959,_0x3f6c('0xd'));_0x371a74(_0x51c469[_0x3f6c('0x14')][_0x3f6c('0x12')]);}})['catch'](function(_0x25d5ce){logger[_0x3f6c('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x4bc959,_0x25d5ce);_0x34ca9b(_0x25d5ce);});});}exports[_0x3f6c('0x15')]=function(_0x139530){var _0x31d53c=this;return new Promise(function(_0x3fd187,_0x31ceb5){return db[_0x3f6c('0x16')][_0x3f6c('0x17')]({'raw':_0x139530[_0x3f6c('0x18')]?_0x139530['options']['raw']===undefined?!![]:![]:!![],'where':_0x139530[_0x3f6c('0x18')]?_0x139530[_0x3f6c('0x18')][_0x3f6c('0x19')]||null:null,'attributes':_0x139530[_0x3f6c('0x18')]?_0x139530[_0x3f6c('0x18')][_0x3f6c('0x1a')]||null:null,'limit':_0x139530[_0x3f6c('0x18')]?_0x139530['options']['limit']||null:null,'include':_0x139530[_0x3f6c('0x18')]?_0x139530[_0x3f6c('0x18')]['include']?_[_0x3f6c('0x1b')](_0x139530[_0x3f6c('0x18')]['include'],function(_0x33b750){return{'model':db[_0x33b750['model']],'as':_0x33b750['as'],'attributes':_0x33b750[_0x3f6c('0x1a')],'include':_0x33b750['include']?_[_0x3f6c('0x1b')](_0x33b750['include'],function(_0x37266b){return{'model':db[_0x37266b[_0x3f6c('0x1c')]],'as':_0x37266b['as'],'attributes':_0x37266b[_0x3f6c('0x1a')],'include':_0x37266b[_0x3f6c('0x1d')]?_[_0x3f6c('0x1b')](_0x37266b[_0x3f6c('0x1d')],function(_0x41398b){return{'model':db[_0x41398b['model']],'as':_0x41398b['as'],'attributes':_0x41398b[_0x3f6c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3f6c('0xb')](function(_0xe55e6d){logger[_0x3f6c('0x13')](_0x3f6c('0x15'),_0x139530);logger[_0x3f6c('0xe')]('GetZendeskAccount',_0x139530,JSON['stringify'](_0xe55e6d));_0x3fd187(_0xe55e6d);})[_0x3f6c('0x1e')](function(_0x5cc3a8){logger[_0x3f6c('0x10')](_0x3f6c('0x15'),_0x5cc3a8[_0x3f6c('0x12')],_0x139530);_0x31ceb5(_0x31d53c['error'](0x1f4,_0x5cc3a8[_0x3f6c('0x12')]));});});};exports['ShowZendeskAccount']=function(_0x3ecf4d){var _0x68d30c=this;return new Promise(function(_0x3aadc3,_0x1c339f){return db[_0x3f6c('0x16')]['find']({'raw':_0x3ecf4d['options']?_0x3ecf4d[_0x3f6c('0x18')][_0x3f6c('0x1f')]===undefined?!![]:![]:!![],'where':_0x3ecf4d[_0x3f6c('0x18')]?_0x3ecf4d[_0x3f6c('0x18')][_0x3f6c('0x19')]||null:null,'attributes':_0x3ecf4d[_0x3f6c('0x18')]?_0x3ecf4d['options'][_0x3f6c('0x1a')]||null:null,'include':_0x3ecf4d['options']?_0x3ecf4d[_0x3f6c('0x18')][_0x3f6c('0x1d')]?_[_0x3f6c('0x1b')](_0x3ecf4d['options'][_0x3f6c('0x1d')],function(_0x4b726e){return{'model':db[_0x4b726e['model']],'as':_0x4b726e['as'],'attributes':_0x4b726e[_0x3f6c('0x1a')],'include':_0x4b726e[_0x3f6c('0x1d')]?_[_0x3f6c('0x1b')](_0x4b726e['include'],function(_0x18a6b6){return{'model':db[_0x18a6b6['model']],'as':_0x18a6b6['as'],'attributes':_0x18a6b6[_0x3f6c('0x1a')],'include':_0x18a6b6['include']?_[_0x3f6c('0x1b')](_0x18a6b6[_0x3f6c('0x1d')],function(_0x4d5343){return{'model':db[_0x4d5343[_0x3f6c('0x1c')]],'as':_0x4d5343['as'],'attributes':_0x4d5343['attributes']};}):[]};}):[]};}):[]:[]})[_0x3f6c('0xb')](function(_0x3cf153){logger[_0x3f6c('0x13')]('ShowZendeskAccount',_0x3ecf4d);logger['debug']('ShowZendeskAccount',_0x3ecf4d,JSON[_0x3f6c('0x20')](_0x3cf153));_0x3aadc3(_0x3cf153);})[_0x3f6c('0x1e')](function(_0x1833b9){logger[_0x3f6c('0x10')](_0x3f6c('0x21'),_0x1833b9[_0x3f6c('0x12')],_0x3ecf4d);_0x1c339f(_0x68d30c[_0x3f6c('0x10')](0x1f4,_0x1833b9[_0x3f6c('0x12')]));});});}; \ No newline at end of file +var _0x021d=['rpc','jayson/promise','client','http','request','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','limit','map','model','attributes','include','find','then','ShowZendeskAccount','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x262583,_0x4795f2){var _0x3fb797=function(_0x521915){while(--_0x521915){_0x262583['push'](_0x262583['shift']());}};_0x3fb797(++_0x4795f2);}(_0x021d,0xa4));var _0xd021=function(_0x4e9d87,_0x591fd0){_0x4e9d87=_0x4e9d87-0x0;var _0x2d5fc6=_0x021d[_0x4e9d87];return _0x2d5fc6;};'use strict';var _=require(_0xd021('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd021('0x1'));var rs=require(_0xd021('0x2'));var fs=require('fs');var Redis=require(_0xd021('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd021('0x4'));var logger=require(_0xd021('0x5'))(_0xd021('0x6'));var config=require('../../config/environment');var jayson=require(_0xd021('0x7'));var client=jayson[_0xd021('0x8')][_0xd021('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3df9e9,_0x53ee0c,_0x1b8a91){return new BPromise(function(_0x12c14a,_0x15bee2){return client[_0xd021('0xa')](_0x3df9e9,_0x1b8a91)['then'](function(_0x26d827){logger[_0xd021('0xb')](_0xd021('0xc'),_0x53ee0c,'request\x20sent');logger[_0xd021('0xd')](_0xd021('0xe'),_0x53ee0c,_0xd021('0xf'),JSON[_0xd021('0x10')](_0x26d827));if(_0x26d827[_0xd021('0x11')]){if(_0x26d827['error']['code']===0x1f4){logger[_0xd021('0x11')](_0xd021('0xc'),_0x53ee0c,_0x26d827[_0xd021('0x11')][_0xd021('0x12')]);return _0x15bee2(_0x26d827[_0xd021('0x11')][_0xd021('0x12')]);}logger[_0xd021('0x11')](_0xd021('0xc'),_0x53ee0c,_0x26d827[_0xd021('0x11')][_0xd021('0x12')]);return _0x12c14a(_0x26d827[_0xd021('0x11')][_0xd021('0x12')]);}else{logger[_0xd021('0xb')](_0xd021('0xc'),_0x53ee0c,_0xd021('0xf'));_0x12c14a(_0x26d827[_0xd021('0x13')][_0xd021('0x12')]);}})[_0xd021('0x14')](function(_0x378938){logger[_0xd021('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x53ee0c,_0x378938);_0x15bee2(_0x378938);});});}exports[_0xd021('0x15')]=function(_0x1e230a){var _0x2d96b6=this;return new Promise(function(_0x1f37f4,_0x5694d7){return db[_0xd021('0x16')][_0xd021('0x17')]({'raw':_0x1e230a[_0xd021('0x18')]?_0x1e230a[_0xd021('0x18')][_0xd021('0x19')]===undefined?!![]:![]:!![],'where':_0x1e230a[_0xd021('0x18')]?_0x1e230a[_0xd021('0x18')]['where']||null:null,'attributes':_0x1e230a[_0xd021('0x18')]?_0x1e230a[_0xd021('0x18')]['attributes']||null:null,'limit':_0x1e230a['options']?_0x1e230a[_0xd021('0x18')][_0xd021('0x1a')]||null:null,'include':_0x1e230a[_0xd021('0x18')]?_0x1e230a[_0xd021('0x18')]['include']?_[_0xd021('0x1b')](_0x1e230a[_0xd021('0x18')]['include'],function(_0x3d0a2b){return{'model':db[_0x3d0a2b[_0xd021('0x1c')]],'as':_0x3d0a2b['as'],'attributes':_0x3d0a2b[_0xd021('0x1d')],'include':_0x3d0a2b[_0xd021('0x1e')]?_[_0xd021('0x1b')](_0x3d0a2b['include'],function(_0x482bd8){return{'model':db[_0x482bd8[_0xd021('0x1c')]],'as':_0x482bd8['as'],'attributes':_0x482bd8[_0xd021('0x1d')],'include':_0x482bd8[_0xd021('0x1e')]?_[_0xd021('0x1b')](_0x482bd8[_0xd021('0x1e')],function(_0x20ec0b){return{'model':db[_0x20ec0b[_0xd021('0x1c')]],'as':_0x20ec0b['as'],'attributes':_0x20ec0b[_0xd021('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a7446){logger[_0xd021('0xb')]('GetZendeskAccount',_0x1e230a);logger['debug'](_0xd021('0x15'),_0x1e230a,JSON[_0xd021('0x10')](_0x1a7446));_0x1f37f4(_0x1a7446);})[_0xd021('0x14')](function(_0x3104de){logger[_0xd021('0x11')](_0xd021('0x15'),_0x3104de[_0xd021('0x12')],_0x1e230a);_0x5694d7(_0x2d96b6[_0xd021('0x11')](0x1f4,_0x3104de[_0xd021('0x12')]));});});};exports['ShowZendeskAccount']=function(_0x47c44c){var _0x2884bc=this;return new Promise(function(_0x433d54,_0x2ba43c){return db[_0xd021('0x16')][_0xd021('0x1f')]({'raw':_0x47c44c[_0xd021('0x18')]?_0x47c44c[_0xd021('0x18')][_0xd021('0x19')]===undefined?!![]:![]:!![],'where':_0x47c44c[_0xd021('0x18')]?_0x47c44c[_0xd021('0x18')]['where']||null:null,'attributes':_0x47c44c['options']?_0x47c44c[_0xd021('0x18')]['attributes']||null:null,'include':_0x47c44c[_0xd021('0x18')]?_0x47c44c[_0xd021('0x18')][_0xd021('0x1e')]?_[_0xd021('0x1b')](_0x47c44c[_0xd021('0x18')][_0xd021('0x1e')],function(_0x4befff){return{'model':db[_0x4befff[_0xd021('0x1c')]],'as':_0x4befff['as'],'attributes':_0x4befff[_0xd021('0x1d')],'include':_0x4befff[_0xd021('0x1e')]?_[_0xd021('0x1b')](_0x4befff[_0xd021('0x1e')],function(_0x25203a){return{'model':db[_0x25203a[_0xd021('0x1c')]],'as':_0x25203a['as'],'attributes':_0x25203a[_0xd021('0x1d')],'include':_0x25203a[_0xd021('0x1e')]?_[_0xd021('0x1b')](_0x25203a[_0xd021('0x1e')],function(_0x5cf36e){return{'model':db[_0x5cf36e[_0xd021('0x1c')]],'as':_0x5cf36e['as'],'attributes':_0x5cf36e[_0xd021('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd021('0x20')](function(_0x36af58){logger['info'](_0xd021('0x21'),_0x47c44c);logger[_0xd021('0xd')](_0xd021('0x21'),_0x47c44c,JSON[_0xd021('0x10')](_0x36af58));_0x433d54(_0x36af58);})[_0xd021('0x14')](function(_0x4f48b7){logger[_0xd021('0x11')]('ShowZendeskAccount',_0x4f48b7['message'],_0x47c44c);_0x2ba43c(_0x2884bc[_0xd021('0x11')](0x1f4,_0x4f48b7['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 7ba3dc8..4435dc3 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 _0xf4eb=['put','update','delete','/:id','destroy','exports','multer','Router','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','create','post','setTags'];(function(_0x37076c,_0x1df79d){var _0x264a9f=function(_0x12337a){while(--_0x12337a){_0x37076c['push'](_0x37076c['shift']());}};_0x264a9f(++_0x1df79d);}(_0xf4eb,0xec));var _0xbf4e=function(_0x147429,_0x435f48){_0x147429=_0x147429-0x0;var _0x32c15b=_0xf4eb[_0x147429];return _0x32c15b;};'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 fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var controller=require(_0xbf4e('0x4'));router[_0xbf4e('0x5')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x5')]('/:id',auth[_0xbf4e('0x6')](),controller['show']);router['get'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0x5')](_0xbf4e('0xa'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xb')]);router['get']('/:id/descriptions',auth[_0xbf4e('0x6')](),controller['getDescriptions']);router[_0xbf4e('0x5')](_0xbf4e('0xc'),auth['isAuthenticated'](),controller[_0xbf4e('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbf4e('0xe')]);router[_0xbf4e('0xf')](_0xbf4e('0xc'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x10')]);router[_0xbf4e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xbf4e('0x12')]);router[_0xbf4e('0x13')](_0xbf4e('0x14'),auth['isAuthenticated'](),controller[_0xbf4e('0x15')]);module[_0xbf4e('0x16')]=router; \ No newline at end of file +var _0xa571=['util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','put','update','exports','multer'];(function(_0x183aa4,_0x5a3435){var _0x424da1=function(_0x3a0d62){while(--_0x3a0d62){_0x183aa4['push'](_0x183aa4['shift']());}};_0x424da1(++_0x5a3435);}(_0xa571,0x107));var _0x1a57=function(_0x4f9171,_0x5431d7){_0x4f9171=_0x4f9171-0x0;var _0xa7c96a=_0xa571[_0x4f9171];return _0xa7c96a;};'use strict';var multer=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var path=require(_0x1a57('0x2'));var timeout=require(_0x1a57('0x3'));var express=require('express');var router=express[_0x1a57('0x4')]();var fs_extra=require(_0x1a57('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1a57('0x6'));var controller=require('./intZendeskConfiguration.controller');router[_0x1a57('0x7')]('/',auth[_0x1a57('0x8')](),controller[_0x1a57('0x9')]);router[_0x1a57('0x7')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller['show']);router[_0x1a57('0x7')](_0x1a57('0xb'),auth[_0x1a57('0x8')](),controller['getFields']);router[_0x1a57('0x7')](_0x1a57('0xc'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xd')]);router[_0x1a57('0x7')](_0x1a57('0xe'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xf')]);router['get']('/:id/tags',auth[_0x1a57('0x8')](),controller[_0x1a57('0x10')]);router[_0x1a57('0x11')]('/',auth['isAuthenticated'](),controller[_0x1a57('0x12')]);router[_0x1a57('0x11')]('/:id/tags',auth[_0x1a57('0x8')](),controller['setTags']);router[_0x1a57('0x13')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller[_0x1a57('0x14')]);router['delete'](_0x1a57('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x1a57('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index d408f6a..ecbba18 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 _0x3d4e=['STRING','sequelize','exports'];(function(_0x2675da,_0x5a250e){var _0x5e6153=function(_0xf93114){while(--_0xf93114){_0x2675da['push'](_0x2675da['shift']());}};_0x5e6153(++_0x5a250e);}(_0x3d4e,0x17e));var _0xe3d4=function(_0x2cdab5,_0x15768c){_0x2cdab5=_0x2cdab5-0x0;var _0x4153d0=_0x3d4e[_0x2cdab5];return _0x4153d0;};'use strict';var Sequelize=require(_0xe3d4('0x0'));module[_0xe3d4('0x1')]={'name':{'type':Sequelize[_0xe3d4('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc8b9=['STRING','exports'];(function(_0x353abb,_0x194c80){var _0x43c9c5=function(_0x456b74){while(--_0x456b74){_0x353abb['push'](_0x353abb['shift']());}};_0x43c9c5(++_0x194c80);}(_0xc8b9,0x11d));var _0x9c8b=function(_0x5334be,_0x14966e){_0x5334be=_0x5334be-0x0;var _0x46ba51=_0xc8b9[_0x5334be];return _0x46ba51;};'use strict';var Sequelize=require('sequelize');module[_0x9c8b('0x0')]={'name':{'type':Sequelize[_0x9c8b('0x1')]},'description':{'type':Sequelize[_0x9c8b('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 6f5f93c..2d14f2c 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 _0xbd30=['Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','update','then','error','stack','name','send','index','map','ZendeskConfiguration','fieldName','type','key','model','keys','intersection','query','attributes','hasOwnProperty','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','rows','catch','show','params','fields','length','includeAll','find','create','body','getFields','findOne','ZendeskField','order','nolimit','rawAttributes','getSubjects','getDescriptions','getTags'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbd30,0x14f));var _0x0bd3=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xbd30[_0x16b9ed];return _0x66b1f8;};'use strict';var emlformat=require(_0x0bd3('0x0'));var rimraf=require(_0x0bd3('0x1'));var zipdir=require(_0x0bd3('0x2'));var jsonpatch=require(_0x0bd3('0x3'));var rp=require('request-promise');var moment=require(_0x0bd3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0bd3('0x5'));var util=require(_0x0bd3('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0bd3('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0bd3('0x8'));var _=require(_0x0bd3('0x9'));var squel=require(_0x0bd3('0xa'));var crypto=require(_0x0bd3('0xb'));var jsforce=require(_0x0bd3('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0bd3('0xd'));var Redis=require(_0x0bd3('0xe'));var authService=require(_0x0bd3('0xf'));var qs=require(_0x0bd3('0x10'));var as=require(_0x0bd3('0x11'));var hardwareService=require(_0x0bd3('0x12'));var logger=require(_0x0bd3('0x13'))(_0x0bd3('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0bd3('0x15'));var db=require(_0x0bd3('0x16'))['db'];function respondWithStatusCode(_0x53b224,_0x558a52){_0x558a52=_0x558a52||0xcc;return function(_0x31493d){if(_0x31493d){return _0x53b224[_0x0bd3('0x17')](_0x558a52);}return _0x53b224['status'](_0x558a52)[_0x0bd3('0x18')]();};}function respondWithResult(_0x1877a3,_0x2a7e4c){_0x2a7e4c=_0x2a7e4c||0xc8;return function(_0x42590c){if(_0x42590c){return _0x1877a3[_0x0bd3('0x19')](_0x2a7e4c)[_0x0bd3('0x1a')](_0x42590c);}};}function respondWithFilteredResult(_0xb2b706,_0x50614d){return function(_0x31d753){if(_0x31d753){var _0x49b87d=typeof _0x50614d['offset']===_0x0bd3('0x1b')&&typeof _0x50614d[_0x0bd3('0x1c')]===_0x0bd3('0x1b');var _0x458bec=_0x31d753[_0x0bd3('0x1d')];var _0x5c3ad8=_0x49b87d?0x0:_0x50614d[_0x0bd3('0x1e')];var _0x207977=_0x49b87d?_0x31d753[_0x0bd3('0x1d')]:_0x50614d[_0x0bd3('0x1e')]+_0x50614d[_0x0bd3('0x1c')];var _0x25f52c;if(_0x207977>=_0x458bec){_0x207977=_0x458bec;_0x25f52c=0xc8;}else{_0x25f52c=0xce;}_0xb2b706[_0x0bd3('0x19')](_0x25f52c);return _0xb2b706[_0x0bd3('0x1f')]('Content-Range',_0x5c3ad8+'-'+_0x207977+'/'+_0x458bec)[_0x0bd3('0x1a')](_0x31d753);}return null;};}function patchUpdates(_0x29ca68){return function(_0x326a1f){try{jsonpatch[_0x0bd3('0x20')](_0x326a1f,_0x29ca68,!![]);}catch(_0x105ac6){return BPromise[_0x0bd3('0x21')](_0x105ac6);}return _0x326a1f['save']();};}function saveUpdates(_0x2f5de8,_0x5057f7){return function(_0x4a7054){if(_0x4a7054){return _0x4a7054[_0x0bd3('0x22')](_0x2f5de8)[_0x0bd3('0x23')](function(_0x4191e7){return _0x4191e7;});}return null;};}function removeEntity(_0x10f64c,_0xa8bbe1){return function(_0x3bf3d1){if(_0x3bf3d1){return _0x3bf3d1['destroy']()['then'](function(){_0x10f64c[_0x0bd3('0x19')](0xcc)[_0x0bd3('0x18')]();});}};}function handleEntityNotFound(_0x9407fe,_0x4c6bd8){return function(_0x29029c){if(!_0x29029c){_0x9407fe[_0x0bd3('0x17')](0x194);}return _0x29029c;};}function handleError(_0x40c5ec,_0x448aa2){_0x448aa2=_0x448aa2||0x1f4;return function(_0xac6ab8){logger[_0x0bd3('0x24')](_0xac6ab8[_0x0bd3('0x25')]);if(_0xac6ab8[_0x0bd3('0x26')]){delete _0xac6ab8[_0x0bd3('0x26')];}_0x40c5ec['status'](_0x448aa2)[_0x0bd3('0x27')](_0xac6ab8);};}exports[_0x0bd3('0x28')]=function(_0xd049eb,_0xce3141){var _0x48c4d0={},_0x1a2d39={},_0x1d81d2={'count':0x0,'rows':[]};var _0x3df9fc=_[_0x0bd3('0x29')](db[_0x0bd3('0x2a')]['rawAttributes'],function(_0x428e9d){return{'name':_0x428e9d[_0x0bd3('0x2b')],'type':_0x428e9d[_0x0bd3('0x2c')][_0x0bd3('0x2d')]};});_0x1a2d39[_0x0bd3('0x2e')]=_[_0x0bd3('0x29')](_0x3df9fc,_0x0bd3('0x26'));_0x1a2d39['query']=_[_0x0bd3('0x2f')](_0xd049eb['query']);_0x1a2d39['filters']=_[_0x0bd3('0x30')](_0x1a2d39[_0x0bd3('0x2e')],_0x1a2d39[_0x0bd3('0x31')]);_0x48c4d0[_0x0bd3('0x32')]=_[_0x0bd3('0x30')](_0x1a2d39[_0x0bd3('0x2e')],qs['fields'](_0xd049eb['query']['fields']));_0x48c4d0[_0x0bd3('0x32')]=_0x48c4d0[_0x0bd3('0x32')]['length']?_0x48c4d0[_0x0bd3('0x32')]:_0x1a2d39[_0x0bd3('0x2e')];if(!_0xd049eb[_0x0bd3('0x31')][_0x0bd3('0x33')]('nolimit')){_0x48c4d0[_0x0bd3('0x1c')]=qs[_0x0bd3('0x1c')](_0xd049eb[_0x0bd3('0x31')][_0x0bd3('0x1c')]);_0x48c4d0[_0x0bd3('0x1e')]=qs[_0x0bd3('0x1e')](_0xd049eb[_0x0bd3('0x31')][_0x0bd3('0x1e')]);}_0x48c4d0['order']=qs[_0x0bd3('0x34')](_0xd049eb[_0x0bd3('0x31')][_0x0bd3('0x34')]);_0x48c4d0[_0x0bd3('0x35')]=qs['filters'](_[_0x0bd3('0x36')](_0xd049eb[_0x0bd3('0x31')],_0x1a2d39[_0x0bd3('0x37')]),_0x3df9fc);if(_0xd049eb[_0x0bd3('0x31')][_0x0bd3('0x38')]){_0x48c4d0[_0x0bd3('0x35')]=_[_0x0bd3('0x39')](_0x48c4d0[_0x0bd3('0x35')],{'$or':_[_0x0bd3('0x29')](_0x3df9fc,function(_0x502f4e){if(_0x502f4e[_0x0bd3('0x2c')]!==_0x0bd3('0x3a')){var _0x200e03={};_0x200e03[_0x502f4e['name']]={'$like':'%'+_0xd049eb[_0x0bd3('0x31')][_0x0bd3('0x38')]+'%'};return _0x200e03;}})});}_0x48c4d0=_[_0x0bd3('0x39')]({},_0x48c4d0,_0xd049eb[_0x0bd3('0x3b')]);var _0x1e46c1={'where':_0x48c4d0[_0x0bd3('0x35')]};return db[_0x0bd3('0x2a')][_0x0bd3('0x1d')](_0x1e46c1)[_0x0bd3('0x23')](function(_0x529172){_0x1d81d2[_0x0bd3('0x1d')]=_0x529172;if(_0xd049eb[_0x0bd3('0x31')]['includeAll']){_0x48c4d0[_0x0bd3('0x3c')]=[{'all':!![]}];}return db[_0x0bd3('0x2a')]['findAll'](_0x48c4d0);})[_0x0bd3('0x23')](function(_0x2f5bb5){_0x1d81d2[_0x0bd3('0x3d')]=_0x2f5bb5;return _0x1d81d2;})[_0x0bd3('0x23')](respondWithFilteredResult(_0xce3141,_0x48c4d0))[_0x0bd3('0x3e')](handleError(_0xce3141,null));};exports[_0x0bd3('0x3f')]=function(_0x354102,_0x1726dd){var _0x18104e={'raw':![],'where':{'id':_0x354102[_0x0bd3('0x40')]['id']}},_0x240376={};_0x240376['model']=_[_0x0bd3('0x2f')](db[_0x0bd3('0x2a')]['rawAttributes']);_0x240376[_0x0bd3('0x31')]=_[_0x0bd3('0x2f')](_0x354102['query']);_0x240376[_0x0bd3('0x37')]=_[_0x0bd3('0x30')](_0x240376[_0x0bd3('0x2e')],_0x240376[_0x0bd3('0x31')]);_0x18104e[_0x0bd3('0x32')]=_[_0x0bd3('0x30')](_0x240376['model'],qs[_0x0bd3('0x41')](_0x354102['query']['fields']));_0x18104e[_0x0bd3('0x32')]=_0x18104e[_0x0bd3('0x32')][_0x0bd3('0x42')]?_0x18104e['attributes']:_0x240376[_0x0bd3('0x2e')];if(_0x354102[_0x0bd3('0x31')][_0x0bd3('0x43')]){_0x18104e[_0x0bd3('0x3c')]=[{'all':!![]}];}_0x18104e=_[_0x0bd3('0x39')]({},_0x18104e,_0x354102['options']);return db['ZendeskConfiguration'][_0x0bd3('0x44')](_0x18104e)[_0x0bd3('0x23')](handleEntityNotFound(_0x1726dd,null))[_0x0bd3('0x23')](respondWithResult(_0x1726dd,null))['catch'](handleError(_0x1726dd,null));};exports[_0x0bd3('0x45')]=function(_0x2696fe,_0x1a39fc){return db[_0x0bd3('0x2a')]['create'](_0x2696fe[_0x0bd3('0x46')],{})[_0x0bd3('0x23')](respondWithResult(_0x1a39fc,0xc9))[_0x0bd3('0x3e')](handleError(_0x1a39fc,null));};exports['update']=function(_0x36a265,_0x26227c){if(_0x36a265[_0x0bd3('0x46')]['id']){delete _0x36a265[_0x0bd3('0x46')]['id'];}return db[_0x0bd3('0x2a')]['find']({'where':{'id':_0x36a265[_0x0bd3('0x40')]['id']}})['then'](handleEntityNotFound(_0x26227c,null))[_0x0bd3('0x23')](saveUpdates(_0x36a265[_0x0bd3('0x46')],null))[_0x0bd3('0x23')](respondWithResult(_0x26227c,null))['catch'](handleError(_0x26227c,null));};exports['destroy']=function(_0x5560d5,_0x1159d0){return db['ZendeskConfiguration'][_0x0bd3('0x44')]({'where':{'id':_0x5560d5[_0x0bd3('0x40')]['id']}})[_0x0bd3('0x23')](handleEntityNotFound(_0x1159d0,null))['then'](removeEntity(_0x1159d0,null))[_0x0bd3('0x3e')](handleError(_0x1159d0,null));};exports[_0x0bd3('0x47')]=function(_0x4a9a34,_0x5b149e,_0x28d76f){var _0x1ceefd={};var _0x4b11b3={};var _0x35a4ff;var _0x2f96b1;return db[_0x0bd3('0x2a')][_0x0bd3('0x48')]({'where':{'id':_0x4a9a34['params']['id']}})[_0x0bd3('0x23')](handleEntityNotFound(_0x5b149e,null))['then'](function(_0x5e688e){if(_0x5e688e){_0x35a4ff=_0x5e688e;_0x4b11b3[_0x0bd3('0x2e')]=_[_0x0bd3('0x2f')](db[_0x0bd3('0x49')]['rawAttributes']);_0x4b11b3[_0x0bd3('0x31')]=_['keys'](_0x4a9a34[_0x0bd3('0x31')]);_0x4b11b3['filters']=_[_0x0bd3('0x30')](_0x4b11b3[_0x0bd3('0x2e')],_0x4b11b3[_0x0bd3('0x31')]);_0x1ceefd[_0x0bd3('0x32')]=_[_0x0bd3('0x30')](_0x4b11b3[_0x0bd3('0x2e')],qs[_0x0bd3('0x41')](_0x4a9a34['query'][_0x0bd3('0x41')]));_0x1ceefd[_0x0bd3('0x32')]=_0x1ceefd[_0x0bd3('0x32')][_0x0bd3('0x42')]?_0x1ceefd[_0x0bd3('0x32')]:_0x4b11b3[_0x0bd3('0x2e')];_0x1ceefd[_0x0bd3('0x4a')]=qs[_0x0bd3('0x34')](_0x4a9a34[_0x0bd3('0x31')]['sort']);_0x1ceefd[_0x0bd3('0x35')]=qs[_0x0bd3('0x37')](_[_0x0bd3('0x36')](_0x4a9a34[_0x0bd3('0x31')],_0x4b11b3['filters']));if(_0x4a9a34[_0x0bd3('0x31')][_0x0bd3('0x38')]){_0x1ceefd[_0x0bd3('0x35')]=_[_0x0bd3('0x39')](_0x1ceefd['where'],{'$or':_[_0x0bd3('0x29')](_0x1ceefd[_0x0bd3('0x32')],function(_0x174c13){var _0x18240a={};_0x18240a[_0x174c13]={'$like':'%'+_0x4a9a34[_0x0bd3('0x31')][_0x0bd3('0x38')]+'%'};return _0x18240a;})});}_0x1ceefd=_[_0x0bd3('0x39')]({},_0x1ceefd,_0x4a9a34['options']);return _0x35a4ff['getFields'](_0x1ceefd);}})[_0x0bd3('0x23')](function(_0x3b774e){if(_0x3b774e){_0x2f96b1=_0x3b774e['length'];if(!_0x4a9a34['query'][_0x0bd3('0x33')](_0x0bd3('0x4b'))){_0x1ceefd[_0x0bd3('0x1c')]=qs[_0x0bd3('0x1c')](_0x4a9a34[_0x0bd3('0x31')][_0x0bd3('0x1c')]);_0x1ceefd[_0x0bd3('0x1e')]=qs['offset'](_0x4a9a34[_0x0bd3('0x31')][_0x0bd3('0x1e')]);}return _0x35a4ff[_0x0bd3('0x47')](_0x1ceefd);}})[_0x0bd3('0x23')](function(_0x237834){if(_0x237834){return _0x237834?{'count':_0x2f96b1,'rows':_0x237834}:null;}})[_0x0bd3('0x23')](respondWithResult(_0x5b149e,null))[_0x0bd3('0x3e')](handleError(_0x5b149e,null));};exports['getSubjects']=function(_0x4b4a8c,_0x12ccad,_0x31b7be){var _0x29a6cb={};var _0x376ec2={};var _0x59f142;var _0x184dd9;return db[_0x0bd3('0x2a')][_0x0bd3('0x48')]({'where':{'id':_0x4b4a8c[_0x0bd3('0x40')]['id']}})[_0x0bd3('0x23')](handleEntityNotFound(_0x12ccad,null))[_0x0bd3('0x23')](function(_0x1ac76b){if(_0x1ac76b){_0x59f142=_0x1ac76b;_0x376ec2[_0x0bd3('0x2e')]=_[_0x0bd3('0x2f')](db[_0x0bd3('0x49')][_0x0bd3('0x4c')]);_0x376ec2[_0x0bd3('0x31')]=_['keys'](_0x4b4a8c['query']);_0x376ec2[_0x0bd3('0x37')]=_['intersection'](_0x376ec2['model'],_0x376ec2[_0x0bd3('0x31')]);_0x29a6cb[_0x0bd3('0x32')]=_['intersection'](_0x376ec2[_0x0bd3('0x2e')],qs[_0x0bd3('0x41')](_0x4b4a8c[_0x0bd3('0x31')][_0x0bd3('0x41')]));_0x29a6cb[_0x0bd3('0x32')]=_0x29a6cb[_0x0bd3('0x32')]['length']?_0x29a6cb[_0x0bd3('0x32')]:_0x376ec2[_0x0bd3('0x2e')];_0x29a6cb[_0x0bd3('0x4a')]=qs[_0x0bd3('0x34')](_0x4b4a8c[_0x0bd3('0x31')][_0x0bd3('0x34')]);_0x29a6cb['where']=qs['filters'](_[_0x0bd3('0x36')](_0x4b4a8c[_0x0bd3('0x31')],_0x376ec2['filters']));if(_0x4b4a8c[_0x0bd3('0x31')]['filter']){_0x29a6cb[_0x0bd3('0x35')]=_[_0x0bd3('0x39')](_0x29a6cb['where'],{'$or':_[_0x0bd3('0x29')](_0x29a6cb[_0x0bd3('0x32')],function(_0x5f23e6){var _0x123297={};_0x123297[_0x5f23e6]={'$like':'%'+_0x4b4a8c[_0x0bd3('0x31')]['filter']+'%'};return _0x123297;})});}_0x29a6cb=_[_0x0bd3('0x39')]({},_0x29a6cb,_0x4b4a8c[_0x0bd3('0x3b')]);return _0x59f142[_0x0bd3('0x4d')](_0x29a6cb);}})[_0x0bd3('0x23')](function(_0x43f1c5){if(_0x43f1c5){_0x184dd9=_0x43f1c5['length'];if(!_0x4b4a8c[_0x0bd3('0x31')]['hasOwnProperty'](_0x0bd3('0x4b'))){_0x29a6cb['limit']=qs[_0x0bd3('0x1c')](_0x4b4a8c[_0x0bd3('0x31')][_0x0bd3('0x1c')]);_0x29a6cb[_0x0bd3('0x1e')]=qs[_0x0bd3('0x1e')](_0x4b4a8c[_0x0bd3('0x31')][_0x0bd3('0x1e')]);}return _0x59f142[_0x0bd3('0x4d')](_0x29a6cb);}})[_0x0bd3('0x23')](function(_0x43a997){if(_0x43a997){return _0x43a997?{'count':_0x184dd9,'rows':_0x43a997}:null;}})['then'](respondWithResult(_0x12ccad,null))[_0x0bd3('0x3e')](handleError(_0x12ccad,null));};exports[_0x0bd3('0x4e')]=function(_0x50229b,_0x56b7d3,_0x2aa0ff){var _0x415ae8={};var _0x57e42e={};var _0x158f41;var _0x5e1769;return db[_0x0bd3('0x2a')][_0x0bd3('0x48')]({'where':{'id':_0x50229b[_0x0bd3('0x40')]['id']}})[_0x0bd3('0x23')](handleEntityNotFound(_0x56b7d3,null))[_0x0bd3('0x23')](function(_0x105199){if(_0x105199){_0x158f41=_0x105199;_0x57e42e['model']=_[_0x0bd3('0x2f')](db[_0x0bd3('0x49')]['rawAttributes']);_0x57e42e['query']=_[_0x0bd3('0x2f')](_0x50229b['query']);_0x57e42e[_0x0bd3('0x37')]=_['intersection'](_0x57e42e[_0x0bd3('0x2e')],_0x57e42e[_0x0bd3('0x31')]);_0x415ae8[_0x0bd3('0x32')]=_[_0x0bd3('0x30')](_0x57e42e['model'],qs[_0x0bd3('0x41')](_0x50229b['query']['fields']));_0x415ae8[_0x0bd3('0x32')]=_0x415ae8[_0x0bd3('0x32')][_0x0bd3('0x42')]?_0x415ae8[_0x0bd3('0x32')]:_0x57e42e[_0x0bd3('0x2e')];_0x415ae8[_0x0bd3('0x4a')]=qs[_0x0bd3('0x34')](_0x50229b['query'][_0x0bd3('0x34')]);_0x415ae8['where']=qs[_0x0bd3('0x37')](_['pick'](_0x50229b[_0x0bd3('0x31')],_0x57e42e[_0x0bd3('0x37')]));if(_0x50229b[_0x0bd3('0x31')]['filter']){_0x415ae8['where']=_[_0x0bd3('0x39')](_0x415ae8['where'],{'$or':_[_0x0bd3('0x29')](_0x415ae8[_0x0bd3('0x32')],function(_0x2a1e96){var _0x5405b2={};_0x5405b2[_0x2a1e96]={'$like':'%'+_0x50229b[_0x0bd3('0x31')][_0x0bd3('0x38')]+'%'};return _0x5405b2;})});}_0x415ae8=_[_0x0bd3('0x39')]({},_0x415ae8,_0x50229b[_0x0bd3('0x3b')]);return _0x158f41['getDescriptions'](_0x415ae8);}})[_0x0bd3('0x23')](function(_0x2f0ad8){if(_0x2f0ad8){_0x5e1769=_0x2f0ad8[_0x0bd3('0x42')];if(!_0x50229b['query'][_0x0bd3('0x33')](_0x0bd3('0x4b'))){_0x415ae8[_0x0bd3('0x1c')]=qs[_0x0bd3('0x1c')](_0x50229b[_0x0bd3('0x31')][_0x0bd3('0x1c')]);_0x415ae8[_0x0bd3('0x1e')]=qs[_0x0bd3('0x1e')](_0x50229b[_0x0bd3('0x31')][_0x0bd3('0x1e')]);}return _0x158f41['getDescriptions'](_0x415ae8);}})[_0x0bd3('0x23')](function(_0x2e6cbd){if(_0x2e6cbd){return _0x2e6cbd?{'count':_0x5e1769,'rows':_0x2e6cbd}:null;}})[_0x0bd3('0x23')](respondWithResult(_0x56b7d3,null))['catch'](handleError(_0x56b7d3,null));};exports[_0x0bd3('0x4f')]=function(_0x5c5145,_0x5f1dbd,_0x2142a6){var _0x2b7cf7={};var _0x2414d7={};var _0x400781;var _0x46d22d;return db[_0x0bd3('0x2a')][_0x0bd3('0x48')]({'where':{'id':_0x5c5145['params']['id']}})['then'](handleEntityNotFound(_0x5f1dbd,null))[_0x0bd3('0x23')](function(_0x50ea37){if(_0x50ea37){_0x400781=_0x50ea37;_0x2414d7[_0x0bd3('0x2e')]=_[_0x0bd3('0x2f')](db[_0x0bd3('0x50')][_0x0bd3('0x4c')]);_0x2414d7[_0x0bd3('0x31')]=_[_0x0bd3('0x2f')](_0x5c5145['query']);_0x2414d7[_0x0bd3('0x37')]=_[_0x0bd3('0x30')](_0x2414d7['model'],_0x2414d7[_0x0bd3('0x31')]);_0x2b7cf7[_0x0bd3('0x32')]=_[_0x0bd3('0x30')](_0x2414d7[_0x0bd3('0x2e')],qs[_0x0bd3('0x41')](_0x5c5145['query'][_0x0bd3('0x41')]));_0x2b7cf7['attributes']=_0x2b7cf7['attributes']['length']?_0x2b7cf7[_0x0bd3('0x32')]:_0x2414d7[_0x0bd3('0x2e')];_0x2b7cf7[_0x0bd3('0x4a')]=qs[_0x0bd3('0x34')](_0x5c5145[_0x0bd3('0x31')][_0x0bd3('0x34')]);_0x2b7cf7[_0x0bd3('0x35')]=qs['filters'](_[_0x0bd3('0x36')](_0x5c5145[_0x0bd3('0x31')],_0x2414d7[_0x0bd3('0x37')]));if(_0x5c5145[_0x0bd3('0x31')]['filter']){_0x2b7cf7[_0x0bd3('0x35')]=_['merge'](_0x2b7cf7[_0x0bd3('0x35')],{'$or':_[_0x0bd3('0x29')](_0x2b7cf7[_0x0bd3('0x32')],function(_0x2fc6c5){var _0x4fffec={};_0x4fffec[_0x2fc6c5]={'$like':'%'+_0x5c5145[_0x0bd3('0x31')][_0x0bd3('0x38')]+'%'};return _0x4fffec;})});}_0x2b7cf7=_['merge']({},_0x2b7cf7,_0x5c5145[_0x0bd3('0x3b')]);return _0x400781[_0x0bd3('0x4f')](_0x2b7cf7);}})[_0x0bd3('0x23')](function(_0x2af2d1){if(_0x2af2d1){_0x46d22d=_0x2af2d1[_0x0bd3('0x42')];if(!_0x5c5145[_0x0bd3('0x31')][_0x0bd3('0x33')](_0x0bd3('0x4b'))){_0x2b7cf7['limit']=qs[_0x0bd3('0x1c')](_0x5c5145[_0x0bd3('0x31')][_0x0bd3('0x1c')]);_0x2b7cf7[_0x0bd3('0x1e')]=qs[_0x0bd3('0x1e')](_0x5c5145['query'][_0x0bd3('0x1e')]);}return _0x400781['getTags'](_0x2b7cf7);}})['then'](function(_0xf98909){if(_0xf98909){return _0xf98909?{'count':_0x46d22d,'rows':_0xf98909}:null;}})[_0x0bd3('0x23')](respondWithResult(_0x5f1dbd,null))[_0x0bd3('0x3e')](handleError(_0x5f1dbd,null));};exports['setTags']=function(_0x271b46,_0x2c5244,_0x27830a){if(_0x271b46['body']['id']){delete _0x271b46[_0x0bd3('0x46')]['id'];}return db[_0x0bd3('0x2a')][_0x0bd3('0x48')]({'where':{'id':_0x271b46[_0x0bd3('0x40')]['id']}})[_0x0bd3('0x23')](handleEntityNotFound(_0x2c5244,null))[_0x0bd3('0x23')](function(_0x4a21e8){if(_0x4a21e8){return _0x4a21e8[_0x0bd3('0x51')](_0x271b46[_0x0bd3('0x46')][_0x0bd3('0x52')]||[]);}return null;})['then'](respondWithResult(_0x2c5244,null))[_0x0bd3('0x3e')](handleError(_0x2c5244,null));}; \ No newline at end of file +var _0x550c=['query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','catch','create','body','findOne','ZendeskField','getFields','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','name','send','index','map','ZendeskConfiguration','fieldName','type','key','model'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x550c,0x16f));var _0xc550=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x550c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc550('0x0'));var rimraf=require(_0xc550('0x1'));var zipdir=require(_0xc550('0x2'));var jsonpatch=require(_0xc550('0x3'));var rp=require('request-promise');var moment=require(_0xc550('0x4'));var BPromise=require(_0xc550('0x5'));var Mustache=require(_0xc550('0x6'));var util=require('util');var path=require('path');var sox=require(_0xc550('0x7'));var csv=require(_0xc550('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc550('0x9'));var squel=require(_0xc550('0xa'));var crypto=require(_0xc550('0xb'));var jsforce=require(_0xc550('0xc'));var deskjs=require(_0xc550('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc550('0xe'));var Papa=require('papaparse');var Redis=require(_0xc550('0xf'));var authService=require(_0xc550('0x10'));var qs=require(_0xc550('0x11'));var as=require(_0xc550('0x12'));var hardwareService=require(_0xc550('0x13'));var logger=require(_0xc550('0x14'))(_0xc550('0x15'));var utils=require('../../config/utils');var config=require(_0xc550('0x16'));var licenseUtil=require(_0xc550('0x17'));var db=require(_0xc550('0x18'))['db'];function respondWithStatusCode(_0x36567e,_0x25a1fc){_0x25a1fc=_0x25a1fc||0xcc;return function(_0x3e1b72){if(_0x3e1b72){return _0x36567e['sendStatus'](_0x25a1fc);}return _0x36567e['status'](_0x25a1fc)[_0xc550('0x19')]();};}function respondWithResult(_0x4979cd,_0x9c855d){_0x9c855d=_0x9c855d||0xc8;return function(_0x4bcfb1){if(_0x4bcfb1){return _0x4979cd[_0xc550('0x1a')](_0x9c855d)[_0xc550('0x1b')](_0x4bcfb1);}};}function respondWithFilteredResult(_0x545f6b,_0x4ba2c0){return function(_0x492683){if(_0x492683){var _0x84e217=typeof _0x4ba2c0['offset']==='undefined'&&typeof _0x4ba2c0[_0xc550('0x1c')]===_0xc550('0x1d');var _0x5cf576=_0x492683[_0xc550('0x1e')];var _0x1b378c=_0x84e217?0x0:_0x4ba2c0[_0xc550('0x1f')];var _0x4b65d7=_0x84e217?_0x492683[_0xc550('0x1e')]:_0x4ba2c0['offset']+_0x4ba2c0[_0xc550('0x1c')];var _0x3fc028;if(_0x4b65d7>=_0x5cf576){_0x4b65d7=_0x5cf576;_0x3fc028=0xc8;}else{_0x3fc028=0xce;}_0x545f6b['status'](_0x3fc028);return _0x545f6b[_0xc550('0x20')](_0xc550('0x21'),_0x1b378c+'-'+_0x4b65d7+'/'+_0x5cf576)[_0xc550('0x1b')](_0x492683);}return null;};}function patchUpdates(_0x598b23){return function(_0x213d20){try{jsonpatch[_0xc550('0x22')](_0x213d20,_0x598b23,!![]);}catch(_0x58c460){return BPromise[_0xc550('0x23')](_0x58c460);}return _0x213d20[_0xc550('0x24')]();};}function saveUpdates(_0x5bc4c8,_0x140eb0){return function(_0x42a6e1){if(_0x42a6e1){return _0x42a6e1[_0xc550('0x25')](_0x5bc4c8)[_0xc550('0x26')](function(_0x41da6e){return _0x41da6e;});}return null;};}function removeEntity(_0x3c18ce,_0x1eb571){return function(_0x2bd36d){if(_0x2bd36d){return _0x2bd36d['destroy']()[_0xc550('0x26')](function(){_0x3c18ce[_0xc550('0x1a')](0xcc)[_0xc550('0x19')]();});}};}function handleEntityNotFound(_0x4f578d,_0x11ae67){return function(_0x2056d9){if(!_0x2056d9){_0x4f578d['sendStatus'](0x194);}return _0x2056d9;};}function handleError(_0x3951be,_0x1909a7){_0x1909a7=_0x1909a7||0x1f4;return function(_0x10a1a1){logger['error'](_0x10a1a1['stack']);if(_0x10a1a1[_0xc550('0x27')]){delete _0x10a1a1['name'];}_0x3951be['status'](_0x1909a7)[_0xc550('0x28')](_0x10a1a1);};}exports[_0xc550('0x29')]=function(_0x308954,_0x402e7d){var _0x64a884={},_0x4dda0d={},_0x22bd4b={'count':0x0,'rows':[]};var _0xb78cc6=_[_0xc550('0x2a')](db[_0xc550('0x2b')]['rawAttributes'],function(_0x499e46){return{'name':_0x499e46[_0xc550('0x2c')],'type':_0x499e46[_0xc550('0x2d')][_0xc550('0x2e')]};});_0x4dda0d[_0xc550('0x2f')]=_[_0xc550('0x2a')](_0xb78cc6,_0xc550('0x27'));_0x4dda0d[_0xc550('0x30')]=_['keys'](_0x308954[_0xc550('0x30')]);_0x4dda0d['filters']=_[_0xc550('0x31')](_0x4dda0d[_0xc550('0x2f')],_0x4dda0d[_0xc550('0x30')]);_0x64a884[_0xc550('0x32')]=_[_0xc550('0x31')](_0x4dda0d['model'],qs['fields'](_0x308954[_0xc550('0x30')][_0xc550('0x33')]));_0x64a884[_0xc550('0x32')]=_0x64a884[_0xc550('0x32')][_0xc550('0x34')]?_0x64a884[_0xc550('0x32')]:_0x4dda0d[_0xc550('0x2f')];if(!_0x308954[_0xc550('0x30')]['hasOwnProperty'](_0xc550('0x35'))){_0x64a884[_0xc550('0x1c')]=qs['limit'](_0x308954['query'][_0xc550('0x1c')]);_0x64a884[_0xc550('0x1f')]=qs[_0xc550('0x1f')](_0x308954[_0xc550('0x30')][_0xc550('0x1f')]);}_0x64a884[_0xc550('0x36')]=qs['sort'](_0x308954[_0xc550('0x30')][_0xc550('0x37')]);_0x64a884[_0xc550('0x38')]=qs[_0xc550('0x39')](_[_0xc550('0x3a')](_0x308954[_0xc550('0x30')],_0x4dda0d['filters']),_0xb78cc6);if(_0x308954[_0xc550('0x30')]['filter']){_0x64a884[_0xc550('0x38')]=_['merge'](_0x64a884[_0xc550('0x38')],{'$or':_['map'](_0xb78cc6,function(_0x4110d1){if(_0x4110d1[_0xc550('0x2d')]!==_0xc550('0x3b')){var _0x1ad150={};_0x1ad150[_0x4110d1[_0xc550('0x27')]]={'$like':'%'+_0x308954[_0xc550('0x30')][_0xc550('0x3c')]+'%'};return _0x1ad150;}})});}_0x64a884=_[_0xc550('0x3d')]({},_0x64a884,_0x308954[_0xc550('0x3e')]);var _0x424cfc={'where':_0x64a884[_0xc550('0x38')]};return db[_0xc550('0x2b')]['count'](_0x424cfc)[_0xc550('0x26')](function(_0xcdb7d8){_0x22bd4b['count']=_0xcdb7d8;if(_0x308954[_0xc550('0x30')]['includeAll']){_0x64a884[_0xc550('0x3f')]=[{'all':!![]}];}return db[_0xc550('0x2b')][_0xc550('0x40')](_0x64a884);})[_0xc550('0x26')](function(_0xf73aba){_0x22bd4b[_0xc550('0x41')]=_0xf73aba;return _0x22bd4b;})['then'](respondWithFilteredResult(_0x402e7d,_0x64a884))['catch'](handleError(_0x402e7d,null));};exports[_0xc550('0x42')]=function(_0x30a63d,_0x4ae538){var _0x1b1da6={'raw':![],'where':{'id':_0x30a63d[_0xc550('0x43')]['id']}},_0x2fab72={};_0x2fab72[_0xc550('0x2f')]=_[_0xc550('0x44')](db['ZendeskConfiguration'][_0xc550('0x45')]);_0x2fab72[_0xc550('0x30')]=_[_0xc550('0x44')](_0x30a63d[_0xc550('0x30')]);_0x2fab72['filters']=_[_0xc550('0x31')](_0x2fab72[_0xc550('0x2f')],_0x2fab72[_0xc550('0x30')]);_0x1b1da6['attributes']=_[_0xc550('0x31')](_0x2fab72['model'],qs['fields'](_0x30a63d[_0xc550('0x30')][_0xc550('0x33')]));_0x1b1da6['attributes']=_0x1b1da6['attributes'][_0xc550('0x34')]?_0x1b1da6[_0xc550('0x32')]:_0x2fab72[_0xc550('0x2f')];if(_0x30a63d['query'][_0xc550('0x46')]){_0x1b1da6[_0xc550('0x3f')]=[{'all':!![]}];}_0x1b1da6=_['merge']({},_0x1b1da6,_0x30a63d[_0xc550('0x3e')]);return db[_0xc550('0x2b')]['find'](_0x1b1da6)[_0xc550('0x26')](handleEntityNotFound(_0x4ae538,null))[_0xc550('0x26')](respondWithResult(_0x4ae538,null))[_0xc550('0x47')](handleError(_0x4ae538,null));};exports['create']=function(_0x27f669,_0x4f187d){return db['ZendeskConfiguration'][_0xc550('0x48')](_0x27f669[_0xc550('0x49')],{})[_0xc550('0x26')](respondWithResult(_0x4f187d,0xc9))['catch'](handleError(_0x4f187d,null));};exports[_0xc550('0x25')]=function(_0x4539eb,_0x26b2f7){if(_0x4539eb[_0xc550('0x49')]['id']){delete _0x4539eb[_0xc550('0x49')]['id'];}return db['ZendeskConfiguration']['find']({'where':{'id':_0x4539eb[_0xc550('0x43')]['id']}})[_0xc550('0x26')](handleEntityNotFound(_0x26b2f7,null))[_0xc550('0x26')](saveUpdates(_0x4539eb[_0xc550('0x49')],null))['then'](respondWithResult(_0x26b2f7,null))['catch'](handleError(_0x26b2f7,null));};exports['destroy']=function(_0x2083a6,_0x4982e4){return db[_0xc550('0x2b')]['find']({'where':{'id':_0x2083a6[_0xc550('0x43')]['id']}})[_0xc550('0x26')](handleEntityNotFound(_0x4982e4,null))['then'](removeEntity(_0x4982e4,null))['catch'](handleError(_0x4982e4,null));};exports['getFields']=function(_0x2deecb,_0x4ded7d,_0x2cf1e7){var _0x4a130a={};var _0x1c7a4a={};var _0x4dcc81;var _0x118ece;return db[_0xc550('0x2b')][_0xc550('0x4a')]({'where':{'id':_0x2deecb[_0xc550('0x43')]['id']}})[_0xc550('0x26')](handleEntityNotFound(_0x4ded7d,null))[_0xc550('0x26')](function(_0x135715){if(_0x135715){_0x4dcc81=_0x135715;_0x1c7a4a[_0xc550('0x2f')]=_[_0xc550('0x44')](db[_0xc550('0x4b')][_0xc550('0x45')]);_0x1c7a4a['query']=_[_0xc550('0x44')](_0x2deecb[_0xc550('0x30')]);_0x1c7a4a[_0xc550('0x39')]=_[_0xc550('0x31')](_0x1c7a4a['model'],_0x1c7a4a[_0xc550('0x30')]);_0x4a130a[_0xc550('0x32')]=_[_0xc550('0x31')](_0x1c7a4a['model'],qs[_0xc550('0x33')](_0x2deecb[_0xc550('0x30')][_0xc550('0x33')]));_0x4a130a[_0xc550('0x32')]=_0x4a130a[_0xc550('0x32')]['length']?_0x4a130a[_0xc550('0x32')]:_0x1c7a4a[_0xc550('0x2f')];_0x4a130a['order']=qs[_0xc550('0x37')](_0x2deecb['query'][_0xc550('0x37')]);_0x4a130a[_0xc550('0x38')]=qs[_0xc550('0x39')](_['pick'](_0x2deecb[_0xc550('0x30')],_0x1c7a4a[_0xc550('0x39')]));if(_0x2deecb[_0xc550('0x30')][_0xc550('0x3c')]){_0x4a130a[_0xc550('0x38')]=_[_0xc550('0x3d')](_0x4a130a[_0xc550('0x38')],{'$or':_[_0xc550('0x2a')](_0x4a130a[_0xc550('0x32')],function(_0x57494e){var _0x41e6a4={};_0x41e6a4[_0x57494e]={'$like':'%'+_0x2deecb[_0xc550('0x30')][_0xc550('0x3c')]+'%'};return _0x41e6a4;})});}_0x4a130a=_[_0xc550('0x3d')]({},_0x4a130a,_0x2deecb[_0xc550('0x3e')]);return _0x4dcc81[_0xc550('0x4c')](_0x4a130a);}})[_0xc550('0x26')](function(_0x50b5db){if(_0x50b5db){_0x118ece=_0x50b5db[_0xc550('0x34')];if(!_0x2deecb['query'][_0xc550('0x4d')](_0xc550('0x35'))){_0x4a130a[_0xc550('0x1c')]=qs[_0xc550('0x1c')](_0x2deecb['query'][_0xc550('0x1c')]);_0x4a130a[_0xc550('0x1f')]=qs['offset'](_0x2deecb['query'][_0xc550('0x1f')]);}return _0x4dcc81['getFields'](_0x4a130a);}})[_0xc550('0x26')](function(_0x42f9b4){if(_0x42f9b4){return _0x42f9b4?{'count':_0x118ece,'rows':_0x42f9b4}:null;}})[_0xc550('0x26')](respondWithResult(_0x4ded7d,null))[_0xc550('0x47')](handleError(_0x4ded7d,null));};exports[_0xc550('0x4e')]=function(_0x51f311,_0x3be6f6,_0x43bd0d){var _0x20313a={};var _0xb4d081={};var _0x10c1bc;var _0x276c6f;return db['ZendeskConfiguration'][_0xc550('0x4a')]({'where':{'id':_0x51f311[_0xc550('0x43')]['id']}})[_0xc550('0x26')](handleEntityNotFound(_0x3be6f6,null))[_0xc550('0x26')](function(_0x4f7cd2){if(_0x4f7cd2){_0x10c1bc=_0x4f7cd2;_0xb4d081[_0xc550('0x2f')]=_[_0xc550('0x44')](db[_0xc550('0x4b')]['rawAttributes']);_0xb4d081[_0xc550('0x30')]=_['keys'](_0x51f311[_0xc550('0x30')]);_0xb4d081[_0xc550('0x39')]=_[_0xc550('0x31')](_0xb4d081[_0xc550('0x2f')],_0xb4d081[_0xc550('0x30')]);_0x20313a[_0xc550('0x32')]=_[_0xc550('0x31')](_0xb4d081[_0xc550('0x2f')],qs[_0xc550('0x33')](_0x51f311['query']['fields']));_0x20313a[_0xc550('0x32')]=_0x20313a[_0xc550('0x32')][_0xc550('0x34')]?_0x20313a[_0xc550('0x32')]:_0xb4d081[_0xc550('0x2f')];_0x20313a[_0xc550('0x36')]=qs[_0xc550('0x37')](_0x51f311[_0xc550('0x30')][_0xc550('0x37')]);_0x20313a['where']=qs[_0xc550('0x39')](_[_0xc550('0x3a')](_0x51f311[_0xc550('0x30')],_0xb4d081[_0xc550('0x39')]));if(_0x51f311[_0xc550('0x30')][_0xc550('0x3c')]){_0x20313a[_0xc550('0x38')]=_[_0xc550('0x3d')](_0x20313a[_0xc550('0x38')],{'$or':_['map'](_0x20313a[_0xc550('0x32')],function(_0x2e596d){var _0x45b9d2={};_0x45b9d2[_0x2e596d]={'$like':'%'+_0x51f311['query'][_0xc550('0x3c')]+'%'};return _0x45b9d2;})});}_0x20313a=_[_0xc550('0x3d')]({},_0x20313a,_0x51f311['options']);return _0x10c1bc['getSubjects'](_0x20313a);}})[_0xc550('0x26')](function(_0x4d269d){if(_0x4d269d){_0x276c6f=_0x4d269d[_0xc550('0x34')];if(!_0x51f311[_0xc550('0x30')][_0xc550('0x4d')](_0xc550('0x35'))){_0x20313a[_0xc550('0x1c')]=qs[_0xc550('0x1c')](_0x51f311[_0xc550('0x30')][_0xc550('0x1c')]);_0x20313a['offset']=qs[_0xc550('0x1f')](_0x51f311['query'][_0xc550('0x1f')]);}return _0x10c1bc[_0xc550('0x4e')](_0x20313a);}})[_0xc550('0x26')](function(_0x6ce34){if(_0x6ce34){return _0x6ce34?{'count':_0x276c6f,'rows':_0x6ce34}:null;}})['then'](respondWithResult(_0x3be6f6,null))['catch'](handleError(_0x3be6f6,null));};exports[_0xc550('0x4f')]=function(_0x5cdd1e,_0x3f5dc5,_0x2558ad){var _0x1f09ee={};var _0xc28df5={};var _0x262221;var _0x751a58;return db[_0xc550('0x2b')][_0xc550('0x4a')]({'where':{'id':_0x5cdd1e['params']['id']}})['then'](handleEntityNotFound(_0x3f5dc5,null))['then'](function(_0x38a0e8){if(_0x38a0e8){_0x262221=_0x38a0e8;_0xc28df5[_0xc550('0x2f')]=_['keys'](db[_0xc550('0x4b')][_0xc550('0x45')]);_0xc28df5[_0xc550('0x30')]=_[_0xc550('0x44')](_0x5cdd1e[_0xc550('0x30')]);_0xc28df5[_0xc550('0x39')]=_[_0xc550('0x31')](_0xc28df5[_0xc550('0x2f')],_0xc28df5[_0xc550('0x30')]);_0x1f09ee[_0xc550('0x32')]=_['intersection'](_0xc28df5[_0xc550('0x2f')],qs[_0xc550('0x33')](_0x5cdd1e['query']['fields']));_0x1f09ee[_0xc550('0x32')]=_0x1f09ee[_0xc550('0x32')]['length']?_0x1f09ee[_0xc550('0x32')]:_0xc28df5[_0xc550('0x2f')];_0x1f09ee['order']=qs['sort'](_0x5cdd1e[_0xc550('0x30')][_0xc550('0x37')]);_0x1f09ee[_0xc550('0x38')]=qs[_0xc550('0x39')](_[_0xc550('0x3a')](_0x5cdd1e['query'],_0xc28df5[_0xc550('0x39')]));if(_0x5cdd1e[_0xc550('0x30')][_0xc550('0x3c')]){_0x1f09ee[_0xc550('0x38')]=_[_0xc550('0x3d')](_0x1f09ee[_0xc550('0x38')],{'$or':_['map'](_0x1f09ee[_0xc550('0x32')],function(_0x41ccff){var _0x1d998d={};_0x1d998d[_0x41ccff]={'$like':'%'+_0x5cdd1e['query'][_0xc550('0x3c')]+'%'};return _0x1d998d;})});}_0x1f09ee=_[_0xc550('0x3d')]({},_0x1f09ee,_0x5cdd1e['options']);return _0x262221['getDescriptions'](_0x1f09ee);}})[_0xc550('0x26')](function(_0x5135ad){if(_0x5135ad){_0x751a58=_0x5135ad[_0xc550('0x34')];if(!_0x5cdd1e[_0xc550('0x30')][_0xc550('0x4d')]('nolimit')){_0x1f09ee[_0xc550('0x1c')]=qs[_0xc550('0x1c')](_0x5cdd1e[_0xc550('0x30')][_0xc550('0x1c')]);_0x1f09ee[_0xc550('0x1f')]=qs[_0xc550('0x1f')](_0x5cdd1e[_0xc550('0x30')]['offset']);}return _0x262221[_0xc550('0x4f')](_0x1f09ee);}})[_0xc550('0x26')](function(_0x48d63b){if(_0x48d63b){return _0x48d63b?{'count':_0x751a58,'rows':_0x48d63b}:null;}})[_0xc550('0x26')](respondWithResult(_0x3f5dc5,null))[_0xc550('0x47')](handleError(_0x3f5dc5,null));};exports[_0xc550('0x50')]=function(_0x994362,_0x4d3d5f,_0x4412db){var _0x57eaa5={};var _0x47d5de={};var _0x328fc5;var _0x42bba5;return db[_0xc550('0x2b')][_0xc550('0x4a')]({'where':{'id':_0x994362[_0xc550('0x43')]['id']}})[_0xc550('0x26')](handleEntityNotFound(_0x4d3d5f,null))['then'](function(_0x2aa8f6){if(_0x2aa8f6){_0x328fc5=_0x2aa8f6;_0x47d5de[_0xc550('0x2f')]=_[_0xc550('0x44')](db[_0xc550('0x51')][_0xc550('0x45')]);_0x47d5de[_0xc550('0x30')]=_['keys'](_0x994362[_0xc550('0x30')]);_0x47d5de[_0xc550('0x39')]=_[_0xc550('0x31')](_0x47d5de[_0xc550('0x2f')],_0x47d5de['query']);_0x57eaa5[_0xc550('0x32')]=_[_0xc550('0x31')](_0x47d5de[_0xc550('0x2f')],qs[_0xc550('0x33')](_0x994362[_0xc550('0x30')][_0xc550('0x33')]));_0x57eaa5[_0xc550('0x32')]=_0x57eaa5[_0xc550('0x32')]['length']?_0x57eaa5['attributes']:_0x47d5de[_0xc550('0x2f')];_0x57eaa5[_0xc550('0x36')]=qs[_0xc550('0x37')](_0x994362[_0xc550('0x30')][_0xc550('0x37')]);_0x57eaa5[_0xc550('0x38')]=qs['filters'](_[_0xc550('0x3a')](_0x994362[_0xc550('0x30')],_0x47d5de[_0xc550('0x39')]));if(_0x994362[_0xc550('0x30')][_0xc550('0x3c')]){_0x57eaa5[_0xc550('0x38')]=_[_0xc550('0x3d')](_0x57eaa5[_0xc550('0x38')],{'$or':_[_0xc550('0x2a')](_0x57eaa5[_0xc550('0x32')],function(_0x4a6eae){var _0x18610a={};_0x18610a[_0x4a6eae]={'$like':'%'+_0x994362[_0xc550('0x30')]['filter']+'%'};return _0x18610a;})});}_0x57eaa5=_['merge']({},_0x57eaa5,_0x994362[_0xc550('0x3e')]);return _0x328fc5['getTags'](_0x57eaa5);}})[_0xc550('0x26')](function(_0x5dd550){if(_0x5dd550){_0x42bba5=_0x5dd550['length'];if(!_0x994362[_0xc550('0x30')][_0xc550('0x4d')]('nolimit')){_0x57eaa5['limit']=qs[_0xc550('0x1c')](_0x994362['query'][_0xc550('0x1c')]);_0x57eaa5[_0xc550('0x1f')]=qs[_0xc550('0x1f')](_0x994362[_0xc550('0x30')][_0xc550('0x1f')]);}return _0x328fc5[_0xc550('0x50')](_0x57eaa5);}})[_0xc550('0x26')](function(_0x3610ad){if(_0x3610ad){return _0x3610ad?{'count':_0x42bba5,'rows':_0x3610ad}:null;}})[_0xc550('0x26')](respondWithResult(_0x4d3d5f,null))[_0xc550('0x47')](handleError(_0x4d3d5f,null));};exports['setTags']=function(_0x42c22c,_0x1a3dd6,_0x3fd16c){if(_0x42c22c['body']['id']){delete _0x42c22c['body']['id'];}return db[_0xc550('0x2b')]['findOne']({'where':{'id':_0x42c22c[_0xc550('0x43')]['id']}})[_0xc550('0x26')](handleEntityNotFound(_0x1a3dd6,null))[_0xc550('0x26')](function(_0x3ec01e){if(_0x3ec01e){return _0x3ec01e['setTags'](_0x42c22c['body'][_0xc550('0x52')]||[]);}return null;})[_0xc550('0x26')](respondWithResult(_0x1a3dd6,null))[_0xc550('0x47')](handleError(_0x1a3dd6,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 24608fe..fe97257 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 _0x4b17=['int_zendesk_configurations','lodash','../../config/logger','moment','bluebird','path','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration'];(function(_0x4da15e,_0x337626){var _0x5d8e83=function(_0x222fd4){while(--_0x222fd4){_0x4da15e['push'](_0x4da15e['shift']());}};_0x5d8e83(++_0x337626);}(_0x4b17,0x10f));var _0x74b1=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x4b17[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x74b1('0x0'));var util=require('util');var logger=require(_0x74b1('0x1'))('api');var moment=require(_0x74b1('0x2'));var BPromise=require(_0x74b1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x74b1('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x74b1('0x5'));module[_0x74b1('0x6')]=function(_0x379dcc,_0x3873a6){return _0x379dcc[_0x74b1('0x7')](_0x74b1('0x8'),attributes,{'tableName':_0x74b1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda2d=['./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','util','../../config/logger','api','moment','bluebird','../../config/environment'];(function(_0x52994f,_0x3fa50e){var _0x287ede=function(_0x23cc9e){while(--_0x23cc9e){_0x52994f['push'](_0x52994f['shift']());}};_0x287ede(++_0x3fa50e);}(_0xda2d,0x102));var _0xdda2=function(_0x598977,_0x1d4e3){_0x598977=_0x598977-0x0;var _0x480e0f=_0xda2d[_0x598977];return _0x480e0f;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var logger=require(_0xdda2('0x1'))(_0xdda2('0x2'));var moment=require(_0xdda2('0x3'));var BPromise=require(_0xdda2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdda2('0x5'));var attributes=require(_0xdda2('0x6'));module[_0xdda2('0x7')]=function(_0x39f6c9,_0xc256bc){return _0x39f6c9[_0xdda2('0x8')](_0xdda2('0x9'),attributes,{'tableName':_0xdda2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index eba5734..d6408de 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 _0xb264=['ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ZendeskConfiguration,\x20%s,\x20%s','debug'];(function(_0x3ee0be,_0x7f764a){var _0x556295=function(_0x1a8d8b){while(--_0x1a8d8b){_0x3ee0be['push'](_0x3ee0be['shift']());}};_0x556295(++_0x7f764a);}(_0xb264,0x169));var _0x4b26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb264[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x4b26('0x0'));var moment=require(_0x4b26('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b26('0x2'))['db'];var utils=require(_0x4b26('0x3'));var logger=require(_0x4b26('0x4'))(_0x4b26('0x5'));var config=require(_0x4b26('0x6'));var jayson=require(_0x4b26('0x7'));var client=jayson[_0x4b26('0x8')][_0x4b26('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11b724,_0x28de59,_0x166979){return new BPromise(function(_0x13891b,_0x72e39a){return client[_0x4b26('0xa')](_0x11b724,_0x166979)['then'](function(_0x10fa60){logger['info'](_0x4b26('0xb'),_0x28de59,'request\x20sent');logger[_0x4b26('0xc')](_0x4b26('0xd'),_0x28de59,_0x4b26('0xe'),JSON[_0x4b26('0xf')](_0x10fa60));if(_0x10fa60[_0x4b26('0x10')]){if(_0x10fa60[_0x4b26('0x10')][_0x4b26('0x11')]===0x1f4){logger[_0x4b26('0x10')](_0x4b26('0xb'),_0x28de59,_0x10fa60[_0x4b26('0x10')][_0x4b26('0x12')]);return _0x72e39a(_0x10fa60[_0x4b26('0x10')][_0x4b26('0x12')]);}logger[_0x4b26('0x10')](_0x4b26('0xb'),_0x28de59,_0x10fa60[_0x4b26('0x10')]['message']);return _0x13891b(_0x10fa60['error'][_0x4b26('0x12')]);}else{logger[_0x4b26('0x13')](_0x4b26('0xb'),_0x28de59,_0x4b26('0xe'));_0x13891b(_0x10fa60[_0x4b26('0x14')][_0x4b26('0x12')]);}})[_0x4b26('0x15')](function(_0x2a115a){logger[_0x4b26('0x10')](_0x4b26('0xb'),_0x28de59,_0x2a115a);_0x72e39a(_0x2a115a);});});} \ No newline at end of file +var _0x6f1f=['jayson/promise','client','then','info','request\x20sent','error','ZendeskConfiguration,\x20%s,\x20%s','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x25bca6,_0xe415ea){var _0x3f8d02=function(_0x3e581b){while(--_0x3e581b){_0x25bca6['push'](_0x25bca6['shift']());}};_0x3f8d02(++_0xe415ea);}(_0x6f1f,0x1c3));var _0xf6f1=function(_0x188065,_0x3223ad){_0x188065=_0x188065-0x0;var _0x10ffd2=_0x6f1f[_0x188065];return _0x10ffd2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf6f1('0x0'));var BPromise=require(_0xf6f1('0x1'));var rs=require(_0xf6f1('0x2'));var fs=require('fs');var Redis=require(_0xf6f1('0x3'));var db=require(_0xf6f1('0x4'))['db'];var utils=require(_0xf6f1('0x5'));var logger=require(_0xf6f1('0x6'))('rpc');var config=require(_0xf6f1('0x7'));var jayson=require(_0xf6f1('0x8'));var client=jayson[_0xf6f1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2392d4,_0x3d4e4f,_0x2f8f68){return new BPromise(function(_0x5b750c,_0x4404d4){return client['request'](_0x2392d4,_0x2f8f68)[_0xf6f1('0xa')](function(_0x2f6072){logger[_0xf6f1('0xb')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3d4e4f,'request\x20sent');logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x3d4e4f,_0xf6f1('0xc'),JSON['stringify'](_0x2f6072));if(_0x2f6072[_0xf6f1('0xd')]){if(_0x2f6072['error']['code']===0x1f4){logger['error'](_0xf6f1('0xe'),_0x3d4e4f,_0x2f6072['error']['message']);return _0x4404d4(_0x2f6072[_0xf6f1('0xd')][_0xf6f1('0xf')]);}logger['error'](_0xf6f1('0xe'),_0x3d4e4f,_0x2f6072[_0xf6f1('0xd')][_0xf6f1('0xf')]);return _0x5b750c(_0x2f6072[_0xf6f1('0xd')]['message']);}else{logger[_0xf6f1('0xb')](_0xf6f1('0xe'),_0x3d4e4f,'request\x20sent');_0x5b750c(_0x2f6072['result'][_0xf6f1('0xf')]);}})[_0xf6f1('0x10')](function(_0x2c6df9){logger[_0xf6f1('0xd')](_0xf6f1('0xe'),_0x3d4e4f,_0x2c6df9);_0x4404d4(_0x2c6df9);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 9fd0df2..466ebfa 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 _0x3b5e=['show','post','isAuthenticated','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id'];(function(_0x40c760,_0x156f78){var _0x3fa39a=function(_0x23034d){while(--_0x23034d){_0x40c760['push'](_0x40c760['shift']());}};_0x3fa39a(++_0x156f78);}(_0x3b5e,0x119));var _0xe3b5=function(_0xb40f40,_0x41708a){_0xb40f40=_0xb40f40-0x0;var _0x55c108=_0x3b5e[_0xb40f40];return _0x55c108;};'use strict';var multer=require(_0xe3b5('0x0'));var util=require(_0xe3b5('0x1'));var path=require(_0xe3b5('0x2'));var timeout=require(_0xe3b5('0x3'));var express=require(_0xe3b5('0x4'));var router=express[_0xe3b5('0x5')]();var fs_extra=require(_0xe3b5('0x6'));var auth=require(_0xe3b5('0x7'));var interaction=require(_0xe3b5('0x8'));var config=require(_0xe3b5('0x9'));var controller=require('./intZendeskField.controller');router[_0xe3b5('0xa')]('/',auth['isAuthenticated'](),controller[_0xe3b5('0xb')]);router[_0xe3b5('0xa')](_0xe3b5('0xc'),auth['isAuthenticated'](),controller[_0xe3b5('0xd')]);router[_0xe3b5('0xe')]('/',auth[_0xe3b5('0xf')](),controller[_0xe3b5('0x10')]);router[_0xe3b5('0x11')]('/:id',auth[_0xe3b5('0xf')](),controller[_0xe3b5('0x12')]);router[_0xe3b5('0x13')](_0xe3b5('0xc'),auth[_0xe3b5('0xf')](),controller[_0xe3b5('0x14')]);module['exports']=router; \ No newline at end of file +var _0x2037=['../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x47bf78,_0x1ff8d2){var _0x159fb6=function(_0x21fb08){while(--_0x21fb08){_0x47bf78['push'](_0x47bf78['shift']());}};_0x159fb6(++_0x1ff8d2);}(_0x2037,0xca));var _0x7203=function(_0x499210,_0x325b29){_0x499210=_0x499210-0x0;var _0x2e153d=_0x2037[_0x499210];return _0x2e153d;};'use strict';var multer=require(_0x7203('0x0'));var util=require(_0x7203('0x1'));var path=require(_0x7203('0x2'));var timeout=require(_0x7203('0x3'));var express=require('express');var router=express[_0x7203('0x4')]();var fs_extra=require(_0x7203('0x5'));var auth=require(_0x7203('0x6'));var interaction=require(_0x7203('0x7'));var config=require(_0x7203('0x8'));var controller=require(_0x7203('0x9'));router[_0x7203('0xa')]('/',auth[_0x7203('0xb')](),controller[_0x7203('0xc')]);router[_0x7203('0xa')](_0x7203('0xd'),auth[_0x7203('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x7203('0xe')]);router['put'](_0x7203('0xd'),auth[_0x7203('0xb')](),controller[_0x7203('0xf')]);router[_0x7203('0x10')]('/:id',auth[_0x7203('0xb')](),controller[_0x7203('0x11')]);module[_0x7203('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 2d39f59..dd89f5f 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 _0x9a99=['sequelize','ENUM','customVariable','keyValue','picklist','string','STRING','variable','BOOLEAN'];(function(_0x102402,_0x4eaaf8){var _0x321b44=function(_0x198c94){while(--_0x198c94){_0x102402['push'](_0x102402['shift']());}};_0x321b44(++_0x4eaaf8);}(_0x9a99,0xa2));var _0x99a9=function(_0x491494,_0x370d47){_0x491494=_0x491494-0x0;var _0x36c702=_0x9a99[_0x491494];return _0x36c702;};'use strict';var Sequelize=require(_0x99a9('0x0'));module['exports']={'type':{'type':Sequelize[_0x99a9('0x1')]('string','variable',_0x99a9('0x2'),_0x99a9('0x3'),_0x99a9('0x4')),'defaultValue':_0x99a9('0x5')},'content':{'type':Sequelize[_0x99a9('0x6')]},'key':{'type':Sequelize[_0x99a9('0x6')]},'keyType':{'type':Sequelize[_0x99a9('0x1')](_0x99a9('0x5'),_0x99a9('0x7'),_0x99a9('0x2'))},'keyContent':{'type':Sequelize[_0x99a9('0x6')]},'idField':{'type':Sequelize[_0x99a9('0x6')]},'nameField':{'type':Sequelize[_0x99a9('0x6')]},'customField':{'type':Sequelize[_0x99a9('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x99a9('0x6')]}}; \ No newline at end of file +var _0xbad6=['sequelize','exports','customVariable','keyValue','picklist','STRING','ENUM','string','variable'];(function(_0x2b90dc,_0x10b832){var _0x4794a6=function(_0x3720ca){while(--_0x3720ca){_0x2b90dc['push'](_0x2b90dc['shift']());}};_0x4794a6(++_0x10b832);}(_0xbad6,0x129));var _0x6bad=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbad6[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x6bad('0x0'));module[_0x6bad('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0x6bad('0x2'),_0x6bad('0x3'),_0x6bad('0x4')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6bad('0x5')]},'keyType':{'type':Sequelize[_0x6bad('0x6')](_0x6bad('0x7'),_0x6bad('0x8'),'customVariable')},'keyContent':{'type':Sequelize[_0x6bad('0x5')]},'idField':{'type':Sequelize[_0x6bad('0x5')]},'nameField':{'type':Sequelize[_0x6bad('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6bad('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 1028216..4c226ac 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 _0x275c=['type','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','params','include','find','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','Content-Range','apply','update','then','error','name','send','index','map','ZendeskField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x11975f,_0x30c91f){var _0x18bce7=function(_0x3cc63f){while(--_0x3cc63f){_0x11975f['push'](_0x11975f['shift']());}};_0x18bce7(++_0x30c91f);}(_0x275c,0x1d0));var _0xc275=function(_0x503dce,_0xd25926){_0x503dce=_0x503dce-0x0;var _0x256b73=_0x275c[_0x503dce];return _0x256b73;};'use strict';var emlformat=require(_0xc275('0x0'));var rimraf=require(_0xc275('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc275('0x2'));var rp=require(_0xc275('0x3'));var moment=require(_0xc275('0x4'));var BPromise=require(_0xc275('0x5'));var Mustache=require('mustache');var util=require(_0xc275('0x6'));var path=require(_0xc275('0x7'));var sox=require(_0xc275('0x8'));var csv=require(_0xc275('0x9'));var ejs=require(_0xc275('0xa'));var fs=require('fs');var fs_extra=require(_0xc275('0xb'));var _=require(_0xc275('0xc'));var squel=require('squel');var crypto=require(_0xc275('0xd'));var jsforce=require(_0xc275('0xe'));var deskjs=require(_0xc275('0xf'));var toCsv=require(_0xc275('0x9'));var querystring=require(_0xc275('0x10'));var Papa=require(_0xc275('0x11'));var Redis=require(_0xc275('0x12'));var authService=require(_0xc275('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc275('0x14'));var hardwareService=require(_0xc275('0x15'));var logger=require(_0xc275('0x16'))(_0xc275('0x17'));var utils=require(_0xc275('0x18'));var config=require(_0xc275('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49c3c1,_0x371bc9){_0x371bc9=_0x371bc9||0xcc;return function(_0x45a272){if(_0x45a272){return _0x49c3c1[_0xc275('0x1a')](_0x371bc9);}return _0x49c3c1[_0xc275('0x1b')](_0x371bc9)['end']();};}function respondWithResult(_0x48a0af,_0x3ec27f){_0x3ec27f=_0x3ec27f||0xc8;return function(_0xcd5f57){if(_0xcd5f57){return _0x48a0af[_0xc275('0x1b')](_0x3ec27f)[_0xc275('0x1c')](_0xcd5f57);}};}function respondWithFilteredResult(_0x38fad2,_0x27080d){return function(_0x44774a){if(_0x44774a){var _0x19a96d=typeof _0x27080d[_0xc275('0x1d')]===_0xc275('0x1e')&&typeof _0x27080d[_0xc275('0x1f')]===_0xc275('0x1e');var _0x4f1bd4=_0x44774a['count'];var _0x43657b=_0x19a96d?0x0:_0x27080d[_0xc275('0x1d')];var _0x51c567=_0x19a96d?_0x44774a['count']:_0x27080d[_0xc275('0x1d')]+_0x27080d['limit'];var _0x53ce5a;if(_0x51c567>=_0x4f1bd4){_0x51c567=_0x4f1bd4;_0x53ce5a=0xc8;}else{_0x53ce5a=0xce;}_0x38fad2['status'](_0x53ce5a);return _0x38fad2['set'](_0xc275('0x20'),_0x43657b+'-'+_0x51c567+'/'+_0x4f1bd4)[_0xc275('0x1c')](_0x44774a);}return null;};}function patchUpdates(_0x3ea4c5){return function(_0x299e35){try{jsonpatch[_0xc275('0x21')](_0x299e35,_0x3ea4c5,!![]);}catch(_0xc80ac6){return BPromise['reject'](_0xc80ac6);}return _0x299e35['save']();};}function saveUpdates(_0x26de0b,_0x70d97d){return function(_0x1b29a4){if(_0x1b29a4){return _0x1b29a4[_0xc275('0x22')](_0x26de0b)[_0xc275('0x23')](function(_0x31c8d0){return _0x31c8d0;});}return null;};}function removeEntity(_0x2f3098,_0x9a64c5){return function(_0x2913d7){if(_0x2913d7){return _0x2913d7['destroy']()[_0xc275('0x23')](function(){_0x2f3098[_0xc275('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45d3d4,_0x400c64){return function(_0x3060d9){if(!_0x3060d9){_0x45d3d4[_0xc275('0x1a')](0x194);}return _0x3060d9;};}function handleError(_0x552bd1,_0x16ed9a){_0x16ed9a=_0x16ed9a||0x1f4;return function(_0x4354f){logger[_0xc275('0x24')](_0x4354f['stack']);if(_0x4354f[_0xc275('0x25')]){delete _0x4354f['name'];}_0x552bd1[_0xc275('0x1b')](_0x16ed9a)[_0xc275('0x26')](_0x4354f);};}exports[_0xc275('0x27')]=function(_0x262d3c,_0x318eef){var _0x3070b7={},_0x5cfe54={},_0x40b109={'count':0x0,'rows':[]};var _0x7ef860=_[_0xc275('0x28')](db[_0xc275('0x29')][_0xc275('0x2a')],function(_0x3086a0){return{'name':_0x3086a0[_0xc275('0x2b')],'type':_0x3086a0['type'][_0xc275('0x2c')]};});_0x5cfe54[_0xc275('0x2d')]=_[_0xc275('0x28')](_0x7ef860,'name');_0x5cfe54[_0xc275('0x2e')]=_[_0xc275('0x2f')](_0x262d3c['query']);_0x5cfe54[_0xc275('0x30')]=_[_0xc275('0x31')](_0x5cfe54[_0xc275('0x2d')],_0x5cfe54[_0xc275('0x2e')]);_0x3070b7['attributes']=_[_0xc275('0x31')](_0x5cfe54[_0xc275('0x2d')],qs[_0xc275('0x32')](_0x262d3c[_0xc275('0x2e')][_0xc275('0x32')]));_0x3070b7[_0xc275('0x33')]=_0x3070b7['attributes'][_0xc275('0x34')]?_0x3070b7['attributes']:_0x5cfe54[_0xc275('0x2d')];if(!_0x262d3c[_0xc275('0x2e')][_0xc275('0x35')](_0xc275('0x36'))){_0x3070b7[_0xc275('0x1f')]=qs[_0xc275('0x1f')](_0x262d3c[_0xc275('0x2e')][_0xc275('0x1f')]);_0x3070b7['offset']=qs['offset'](_0x262d3c['query']['offset']);}_0x3070b7[_0xc275('0x37')]=qs[_0xc275('0x38')](_0x262d3c[_0xc275('0x2e')]['sort']);_0x3070b7[_0xc275('0x39')]=qs[_0xc275('0x30')](_[_0xc275('0x3a')](_0x262d3c[_0xc275('0x2e')],_0x5cfe54['filters']),_0x7ef860);if(_0x262d3c[_0xc275('0x2e')][_0xc275('0x3b')]){_0x3070b7[_0xc275('0x39')]=_[_0xc275('0x3c')](_0x3070b7['where'],{'$or':_[_0xc275('0x28')](_0x7ef860,function(_0x1d152e){if(_0x1d152e[_0xc275('0x3d')]!==_0xc275('0x3e')){var _0x40102f={};_0x40102f[_0x1d152e[_0xc275('0x25')]]={'$like':'%'+_0x262d3c[_0xc275('0x2e')][_0xc275('0x3b')]+'%'};return _0x40102f;}})});}_0x3070b7=_['merge']({},_0x3070b7,_0x262d3c[_0xc275('0x3f')]);var _0x16229f={'where':_0x3070b7[_0xc275('0x39')]};return db[_0xc275('0x29')]['count'](_0x16229f)[_0xc275('0x23')](function(_0x23a39a){_0x40b109[_0xc275('0x40')]=_0x23a39a;if(_0x262d3c[_0xc275('0x2e')][_0xc275('0x41')]){_0x3070b7['include']=[{'all':!![]}];}return db[_0xc275('0x29')][_0xc275('0x42')](_0x3070b7);})[_0xc275('0x23')](function(_0x491da4){_0x40b109[_0xc275('0x43')]=_0x491da4;return _0x40b109;})[_0xc275('0x23')](respondWithFilteredResult(_0x318eef,_0x3070b7))[_0xc275('0x44')](handleError(_0x318eef,null));};exports[_0xc275('0x45')]=function(_0x5307f5,_0x45601a){var _0x158063={'raw':!![],'where':{'id':_0x5307f5[_0xc275('0x46')]['id']}},_0x81b0ea={};_0x81b0ea['model']=_[_0xc275('0x2f')](db[_0xc275('0x29')]['rawAttributes']);_0x81b0ea[_0xc275('0x2e')]=_[_0xc275('0x2f')](_0x5307f5['query']);_0x81b0ea[_0xc275('0x30')]=_[_0xc275('0x31')](_0x81b0ea[_0xc275('0x2d')],_0x81b0ea['query']);_0x158063[_0xc275('0x33')]=_['intersection'](_0x81b0ea[_0xc275('0x2d')],qs['fields'](_0x5307f5[_0xc275('0x2e')][_0xc275('0x32')]));_0x158063[_0xc275('0x33')]=_0x158063[_0xc275('0x33')][_0xc275('0x34')]?_0x158063[_0xc275('0x33')]:_0x81b0ea['model'];if(_0x5307f5['query']['includeAll']){_0x158063[_0xc275('0x47')]=[{'all':!![]}];}_0x158063=_[_0xc275('0x3c')]({},_0x158063,_0x5307f5[_0xc275('0x3f')]);return db[_0xc275('0x29')][_0xc275('0x48')](_0x158063)[_0xc275('0x23')](handleEntityNotFound(_0x45601a,null))[_0xc275('0x23')](respondWithResult(_0x45601a,null))[_0xc275('0x44')](handleError(_0x45601a,null));};exports['create']=function(_0x398756,_0x4e2b83){return db[_0xc275('0x29')]['create'](_0x398756['body'],{})[_0xc275('0x23')](respondWithResult(_0x4e2b83,0xc9))[_0xc275('0x44')](handleError(_0x4e2b83,null));};exports[_0xc275('0x22')]=function(_0x11d25e,_0x7baaea){if(_0x11d25e[_0xc275('0x49')]['id']){delete _0x11d25e[_0xc275('0x49')]['id'];}return db[_0xc275('0x29')][_0xc275('0x48')]({'where':{'id':_0x11d25e[_0xc275('0x46')]['id']}})[_0xc275('0x23')](handleEntityNotFound(_0x7baaea,null))[_0xc275('0x23')](saveUpdates(_0x11d25e[_0xc275('0x49')],null))[_0xc275('0x23')](respondWithResult(_0x7baaea,null))['catch'](handleError(_0x7baaea,null));};exports[_0xc275('0x4a')]=function(_0xd1f2a4,_0x406626){return db[_0xc275('0x29')][_0xc275('0x48')]({'where':{'id':_0xd1f2a4[_0xc275('0x46')]['id']}})[_0xc275('0x23')](handleEntityNotFound(_0x406626,null))[_0xc275('0x23')](removeEntity(_0x406626,null))[_0xc275('0x44')](handleError(_0x406626,null));}; \ No newline at end of file +var _0x26ef=['fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','catch','show','params','keys','includeAll','options','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','reject','save','update','then','destroy','error','name','index','map','ZendeskField','rawAttributes'];(function(_0xbe48c2,_0x3db103){var _0x39a679=function(_0x195d37){while(--_0x195d37){_0xbe48c2['push'](_0xbe48c2['shift']());}};_0x39a679(++_0x3db103);}(_0x26ef,0x13e));var _0xf26e=function(_0xfecc9c,_0x3e5766){_0xfecc9c=_0xfecc9c-0x0;var _0x11e3d4=_0x26ef[_0xfecc9c];return _0x11e3d4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf26e('0x0'));var zipdir=require(_0xf26e('0x1'));var jsonpatch=require(_0xf26e('0x2'));var rp=require(_0xf26e('0x3'));var moment=require('moment');var BPromise=require(_0xf26e('0x4'));var Mustache=require(_0xf26e('0x5'));var util=require(_0xf26e('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xf26e('0x7'));var ejs=require(_0xf26e('0x8'));var fs=require('fs');var fs_extra=require(_0xf26e('0x9'));var _=require(_0xf26e('0xa'));var squel=require(_0xf26e('0xb'));var crypto=require(_0xf26e('0xc'));var jsforce=require(_0xf26e('0xd'));var deskjs=require(_0xf26e('0xe'));var toCsv=require(_0xf26e('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf26e('0xf'));var authService=require(_0xf26e('0x10'));var qs=require(_0xf26e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf26e('0x12'));var logger=require(_0xf26e('0x13'))(_0xf26e('0x14'));var utils=require('../../config/utils');var config=require(_0xf26e('0x15'));var licenseUtil=require(_0xf26e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36731c,_0xb0062d){_0xb0062d=_0xb0062d||0xcc;return function(_0xdae6d1){if(_0xdae6d1){return _0x36731c[_0xf26e('0x17')](_0xb0062d);}return _0x36731c['status'](_0xb0062d)[_0xf26e('0x18')]();};}function respondWithResult(_0x22a6e1,_0x20371c){_0x20371c=_0x20371c||0xc8;return function(_0xaf5f6d){if(_0xaf5f6d){return _0x22a6e1[_0xf26e('0x19')](_0x20371c)[_0xf26e('0x1a')](_0xaf5f6d);}};}function respondWithFilteredResult(_0x30f36b,_0x17e94d){return function(_0xcb1324){if(_0xcb1324){var _0x165943=typeof _0x17e94d[_0xf26e('0x1b')]===_0xf26e('0x1c')&&typeof _0x17e94d[_0xf26e('0x1d')]==='undefined';var _0x5bafce=_0xcb1324[_0xf26e('0x1e')];var _0x2841ac=_0x165943?0x0:_0x17e94d['offset'];var _0x2c45ac=_0x165943?_0xcb1324[_0xf26e('0x1e')]:_0x17e94d[_0xf26e('0x1b')]+_0x17e94d[_0xf26e('0x1d')];var _0x36db05;if(_0x2c45ac>=_0x5bafce){_0x2c45ac=_0x5bafce;_0x36db05=0xc8;}else{_0x36db05=0xce;}_0x30f36b[_0xf26e('0x19')](_0x36db05);return _0x30f36b['set']('Content-Range',_0x2841ac+'-'+_0x2c45ac+'/'+_0x5bafce)[_0xf26e('0x1a')](_0xcb1324);}return null;};}function patchUpdates(_0x403227){return function(_0x5d14db){try{jsonpatch['apply'](_0x5d14db,_0x403227,!![]);}catch(_0x5d46a5){return BPromise[_0xf26e('0x1f')](_0x5d46a5);}return _0x5d14db[_0xf26e('0x20')]();};}function saveUpdates(_0x475da6,_0x11c487){return function(_0x13e5e9){if(_0x13e5e9){return _0x13e5e9[_0xf26e('0x21')](_0x475da6)[_0xf26e('0x22')](function(_0x40c9d5){return _0x40c9d5;});}return null;};}function removeEntity(_0x572623,_0x208827){return function(_0x5581ff){if(_0x5581ff){return _0x5581ff[_0xf26e('0x23')]()['then'](function(){_0x572623[_0xf26e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x419f8a,_0x5d4e64){return function(_0x39cff4){if(!_0x39cff4){_0x419f8a[_0xf26e('0x17')](0x194);}return _0x39cff4;};}function handleError(_0x3996db,_0x231c9f){_0x231c9f=_0x231c9f||0x1f4;return function(_0x421d2d){logger[_0xf26e('0x24')](_0x421d2d['stack']);if(_0x421d2d[_0xf26e('0x25')]){delete _0x421d2d[_0xf26e('0x25')];}_0x3996db[_0xf26e('0x19')](_0x231c9f)['send'](_0x421d2d);};}exports[_0xf26e('0x26')]=function(_0x3dba98,_0x3215ba){var _0xc4b4e4={},_0x36c5e0={},_0x356602={'count':0x0,'rows':[]};var _0x5cf275=_[_0xf26e('0x27')](db[_0xf26e('0x28')][_0xf26e('0x29')],function(_0x5acb6d){return{'name':_0x5acb6d[_0xf26e('0x2a')],'type':_0x5acb6d[_0xf26e('0x2b')][_0xf26e('0x2c')]};});_0x36c5e0[_0xf26e('0x2d')]=_[_0xf26e('0x27')](_0x5cf275,'name');_0x36c5e0[_0xf26e('0x2e')]=_['keys'](_0x3dba98[_0xf26e('0x2e')]);_0x36c5e0[_0xf26e('0x2f')]=_[_0xf26e('0x30')](_0x36c5e0[_0xf26e('0x2d')],_0x36c5e0['query']);_0xc4b4e4[_0xf26e('0x31')]=_[_0xf26e('0x30')](_0x36c5e0[_0xf26e('0x2d')],qs[_0xf26e('0x32')](_0x3dba98['query'][_0xf26e('0x32')]));_0xc4b4e4['attributes']=_0xc4b4e4[_0xf26e('0x31')][_0xf26e('0x33')]?_0xc4b4e4[_0xf26e('0x31')]:_0x36c5e0[_0xf26e('0x2d')];if(!_0x3dba98[_0xf26e('0x2e')][_0xf26e('0x34')](_0xf26e('0x35'))){_0xc4b4e4['limit']=qs[_0xf26e('0x1d')](_0x3dba98[_0xf26e('0x2e')][_0xf26e('0x1d')]);_0xc4b4e4[_0xf26e('0x1b')]=qs[_0xf26e('0x1b')](_0x3dba98[_0xf26e('0x2e')][_0xf26e('0x1b')]);}_0xc4b4e4[_0xf26e('0x36')]=qs[_0xf26e('0x37')](_0x3dba98['query'][_0xf26e('0x37')]);_0xc4b4e4[_0xf26e('0x38')]=qs['filters'](_[_0xf26e('0x39')](_0x3dba98[_0xf26e('0x2e')],_0x36c5e0[_0xf26e('0x2f')]),_0x5cf275);if(_0x3dba98['query'][_0xf26e('0x3a')]){_0xc4b4e4[_0xf26e('0x38')]=_[_0xf26e('0x3b')](_0xc4b4e4['where'],{'$or':_['map'](_0x5cf275,function(_0x20fc77){if(_0x20fc77[_0xf26e('0x2b')]!==_0xf26e('0x3c')){var _0x1c30e1={};_0x1c30e1[_0x20fc77['name']]={'$like':'%'+_0x3dba98[_0xf26e('0x2e')]['filter']+'%'};return _0x1c30e1;}})});}_0xc4b4e4=_['merge']({},_0xc4b4e4,_0x3dba98['options']);var _0x477fb9={'where':_0xc4b4e4[_0xf26e('0x38')]};return db['ZendeskField'][_0xf26e('0x1e')](_0x477fb9)[_0xf26e('0x22')](function(_0x1200b8){_0x356602[_0xf26e('0x1e')]=_0x1200b8;if(_0x3dba98[_0xf26e('0x2e')]['includeAll']){_0xc4b4e4[_0xf26e('0x3d')]=[{'all':!![]}];}return db[_0xf26e('0x28')][_0xf26e('0x3e')](_0xc4b4e4);})[_0xf26e('0x22')](function(_0x302000){_0x356602['rows']=_0x302000;return _0x356602;})['then'](respondWithFilteredResult(_0x3215ba,_0xc4b4e4))[_0xf26e('0x3f')](handleError(_0x3215ba,null));};exports[_0xf26e('0x40')]=function(_0x26ee1a,_0x5d2e08){var _0x560b6e={'raw':!![],'where':{'id':_0x26ee1a[_0xf26e('0x41')]['id']}},_0x5dc3c3={};_0x5dc3c3['model']=_[_0xf26e('0x42')](db[_0xf26e('0x28')][_0xf26e('0x29')]);_0x5dc3c3[_0xf26e('0x2e')]=_[_0xf26e('0x42')](_0x26ee1a[_0xf26e('0x2e')]);_0x5dc3c3['filters']=_['intersection'](_0x5dc3c3[_0xf26e('0x2d')],_0x5dc3c3[_0xf26e('0x2e')]);_0x560b6e['attributes']=_[_0xf26e('0x30')](_0x5dc3c3[_0xf26e('0x2d')],qs[_0xf26e('0x32')](_0x26ee1a[_0xf26e('0x2e')][_0xf26e('0x32')]));_0x560b6e[_0xf26e('0x31')]=_0x560b6e[_0xf26e('0x31')]['length']?_0x560b6e[_0xf26e('0x31')]:_0x5dc3c3[_0xf26e('0x2d')];if(_0x26ee1a[_0xf26e('0x2e')][_0xf26e('0x43')]){_0x560b6e[_0xf26e('0x3d')]=[{'all':!![]}];}_0x560b6e=_[_0xf26e('0x3b')]({},_0x560b6e,_0x26ee1a[_0xf26e('0x44')]);return db[_0xf26e('0x28')][_0xf26e('0x45')](_0x560b6e)['then'](handleEntityNotFound(_0x5d2e08,null))[_0xf26e('0x22')](respondWithResult(_0x5d2e08,null))[_0xf26e('0x3f')](handleError(_0x5d2e08,null));};exports[_0xf26e('0x46')]=function(_0x34ceb1,_0x201090){return db[_0xf26e('0x28')][_0xf26e('0x46')](_0x34ceb1[_0xf26e('0x47')],{})[_0xf26e('0x22')](respondWithResult(_0x201090,0xc9))[_0xf26e('0x3f')](handleError(_0x201090,null));};exports[_0xf26e('0x21')]=function(_0x5f25aa,_0xf4a5b5){if(_0x5f25aa[_0xf26e('0x47')]['id']){delete _0x5f25aa[_0xf26e('0x47')]['id'];}return db['ZendeskField']['find']({'where':{'id':_0x5f25aa['params']['id']}})[_0xf26e('0x22')](handleEntityNotFound(_0xf4a5b5,null))[_0xf26e('0x22')](saveUpdates(_0x5f25aa[_0xf26e('0x47')],null))[_0xf26e('0x22')](respondWithResult(_0xf4a5b5,null))[_0xf26e('0x3f')](handleError(_0xf4a5b5,null));};exports['destroy']=function(_0x202dd3,_0x52bf8b){return db[_0xf26e('0x28')]['find']({'where':{'id':_0x202dd3[_0xf26e('0x41')]['id']}})['then'](handleEntityNotFound(_0x52bf8b,null))[_0xf26e('0x22')](removeEntity(_0x52bf8b,null))[_0xf26e('0x3f')](handleError(_0x52bf8b,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index e8038ce..2090189 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 _0xf5b4=['rimraf','../../config/environment','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','FieldId','util','api','moment','request-promise','path'];(function(_0x5e12a6,_0x3ad058){var _0x3f720a=function(_0x1d9cd2){while(--_0x1d9cd2){_0x5e12a6['push'](_0x5e12a6['shift']());}};_0x3f720a(++_0x3ad058);}(_0xf5b4,0xd8));var _0x4f5b=function(_0x3bf925,_0x4dd8e4){_0x3bf925=_0x3bf925-0x0;var _0x2128a1=_0xf5b4[_0x3bf925];return _0x2128a1;};'use strict';var _=require('lodash');var util=require(_0x4f5b('0x0'));var logger=require('../../config/logger')(_0x4f5b('0x1'));var moment=require(_0x4f5b('0x2'));var BPromise=require('bluebird');var rp=require(_0x4f5b('0x3'));var fs=require('fs');var path=require(_0x4f5b('0x4'));var rimraf=require(_0x4f5b('0x5'));var config=require(_0x4f5b('0x6'));var attributes=require('./intZendeskField.attributes');module[_0x4f5b('0x7')]=function(_0x5c390b,_0xe52514){return _0x5c390b[_0x4f5b('0x8')](_0x4f5b('0x9'),attributes,{'tableName':_0x4f5b('0xa'),'paranoid':![],'indexes':[{'name':_0x4f5b('0xb'),'fields':['idField',_0x4f5b('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6d6c=['request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','zendesk_unique_index','idField','FieldId','lodash','../../config/logger','api','bluebird'];(function(_0x34c553,_0x3e7dfc){var _0x1357d2=function(_0x3b509f){while(--_0x3b509f){_0x34c553['push'](_0x34c553['shift']());}};_0x1357d2(++_0x3e7dfc);}(_0x6d6c,0x1a0));var _0xc6d6=function(_0x340380,_0x4bd2a8){_0x340380=_0x340380-0x0;var _0x49ce1c=_0x6d6c[_0x340380];return _0x49ce1c;};'use strict';var _=require(_0xc6d6('0x0'));var util=require('util');var logger=require(_0xc6d6('0x1'))(_0xc6d6('0x2'));var moment=require('moment');var BPromise=require(_0xc6d6('0x3'));var rp=require(_0xc6d6('0x4'));var fs=require('fs');var path=require(_0xc6d6('0x5'));var rimraf=require(_0xc6d6('0x6'));var config=require(_0xc6d6('0x7'));var attributes=require(_0xc6d6('0x8'));module[_0xc6d6('0x9')]=function(_0x27ee85,_0x2c6569){return _0x27ee85[_0xc6d6('0xa')](_0xc6d6('0xb'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0xc6d6('0xc'),'fields':[_0xc6d6('0xd'),_0xc6d6('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 6693057..b4ef3b1 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 _0xfb40=['../../mysqldb','../../config/logger','client','http','request','then','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','moment','bluebird','randomstring'];(function(_0x205f00,_0x2658bb){var _0xb6d986=function(_0x2d4672){while(--_0x2d4672){_0x205f00['push'](_0x205f00['shift']());}};_0xb6d986(++_0x2658bb);}(_0xfb40,0x153));var _0x0fb4=function(_0xc47df0,_0x5e2003){_0xc47df0=_0xc47df0-0x0;var _0x51bbbd=_0xfb40[_0xc47df0];return _0x51bbbd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0fb4('0x0'));var BPromise=require(_0x0fb4('0x1'));var rs=require(_0x0fb4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0fb4('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0fb4('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0fb4('0x5')][_0x0fb4('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5df13b,_0x2a97d6,_0x4606ed){return new BPromise(function(_0x21713a,_0x3dd297){return client[_0x0fb4('0x7')](_0x5df13b,_0x4606ed)[_0x0fb4('0x8')](function(_0x3ac218){logger['info'](_0x0fb4('0x9'),_0x2a97d6,_0x0fb4('0xa'));logger[_0x0fb4('0xb')](_0x0fb4('0xc'),_0x2a97d6,_0x0fb4('0xa'),JSON[_0x0fb4('0xd')](_0x3ac218));if(_0x3ac218['error']){if(_0x3ac218[_0x0fb4('0xe')][_0x0fb4('0xf')]===0x1f4){logger[_0x0fb4('0xe')](_0x0fb4('0x9'),_0x2a97d6,_0x3ac218[_0x0fb4('0xe')][_0x0fb4('0x10')]);return _0x3dd297(_0x3ac218[_0x0fb4('0xe')][_0x0fb4('0x10')]);}logger[_0x0fb4('0xe')](_0x0fb4('0x9'),_0x2a97d6,_0x3ac218[_0x0fb4('0xe')][_0x0fb4('0x10')]);return _0x21713a(_0x3ac218[_0x0fb4('0xe')][_0x0fb4('0x10')]);}else{logger[_0x0fb4('0x11')](_0x0fb4('0x9'),_0x2a97d6,_0x0fb4('0xa'));_0x21713a(_0x3ac218['result'][_0x0fb4('0x10')]);}})[_0x0fb4('0x12')](function(_0x223fc5){logger[_0x0fb4('0xe')]('ZendeskField,\x20%s,\x20%s',_0x2a97d6,_0x223fc5);_0x3dd297(_0x223fc5);});});} \ No newline at end of file +var _0x304a=['client','then','info','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x304a,0xbd));var _0xa304=function(_0x2757db,_0x365a75){_0x2757db=_0x2757db-0x0;var _0x41122c=_0x304a[_0x2757db];return _0x41122c;};'use strict';var _=require('lodash');var util=require(_0xa304('0x0'));var moment=require('moment');var BPromise=require(_0xa304('0x1'));var rs=require(_0xa304('0x2'));var fs=require('fs');var Redis=require(_0xa304('0x3'));var db=require(_0xa304('0x4'))['db'];var utils=require(_0xa304('0x5'));var logger=require(_0xa304('0x6'))(_0xa304('0x7'));var config=require('../../config/environment');var jayson=require(_0xa304('0x8'));var client=jayson[_0xa304('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b5862,_0x168cbb,_0x5b396e){return new BPromise(function(_0x527fde,_0x29ceb6){return client['request'](_0x3b5862,_0x5b396e)[_0xa304('0xa')](function(_0x484205){logger[_0xa304('0xb')](_0xa304('0xc'),_0x168cbb,'request\x20sent');logger[_0xa304('0xd')](_0xa304('0xe'),_0x168cbb,_0xa304('0xf'),JSON[_0xa304('0x10')](_0x484205));if(_0x484205['error']){if(_0x484205[_0xa304('0x11')][_0xa304('0x12')]===0x1f4){logger[_0xa304('0x11')](_0xa304('0xc'),_0x168cbb,_0x484205[_0xa304('0x11')][_0xa304('0x13')]);return _0x29ceb6(_0x484205[_0xa304('0x11')][_0xa304('0x13')]);}logger[_0xa304('0x11')](_0xa304('0xc'),_0x168cbb,_0x484205[_0xa304('0x11')]['message']);return _0x527fde(_0x484205['error'][_0xa304('0x13')]);}else{logger[_0xa304('0xb')](_0xa304('0xc'),_0x168cbb,_0xa304('0xf'));_0x527fde(_0x484205[_0xa304('0x14')]['message']);}})[_0xa304('0x15')](function(_0x206adf){logger[_0xa304('0x11')](_0xa304('0xc'),_0x168cbb,_0x206adf);_0x29ceb6(_0x206adf);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 00804f5..8879003 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 _0x9fc6=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','index','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','/:id','update','delete','multer','util','path','connect-timeout','express','Router'];(function(_0x1daaa9,_0x220393){var _0x1dd221=function(_0x492c61){while(--_0x492c61){_0x1daaa9['push'](_0x1daaa9['shift']());}};_0x1dd221(++_0x220393);}(_0x9fc6,0xf4));var _0x69fc=function(_0x490be3,_0xf0fca3){_0x490be3=_0x490be3-0x0;var _0x3f5140=_0x9fc6[_0x490be3];return _0x3f5140;};'use strict';var multer=require(_0x69fc('0x0'));var util=require(_0x69fc('0x1'));var path=require(_0x69fc('0x2'));var timeout=require(_0x69fc('0x3'));var express=require(_0x69fc('0x4'));var router=express[_0x69fc('0x5')]();var fs_extra=require(_0x69fc('0x6'));var auth=require(_0x69fc('0x7'));var interaction=require(_0x69fc('0x8'));var config=require(_0x69fc('0x9'));var controller=require(_0x69fc('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x69fc('0xb')]);router[_0x69fc('0xc')]('/:id',auth[_0x69fc('0xd')](),controller[_0x69fc('0xe')]);router['get'](_0x69fc('0xf'),auth[_0x69fc('0xd')](),controller[_0x69fc('0x10')]);router[_0x69fc('0xc')](_0x69fc('0x11'),auth['isAuthenticated'](),controller[_0x69fc('0x12')]);router[_0x69fc('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x69fc('0x13')]('/:id/configurations',auth[_0x69fc('0xd')](),controller[_0x69fc('0x14')]);router[_0x69fc('0x15')](_0x69fc('0x16'),auth[_0x69fc('0xd')](),controller[_0x69fc('0x17')]);router[_0x69fc('0x18')](_0x69fc('0x16'),auth[_0x69fc('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xebdc=['exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intZohoAccount.controller','index','/:id','show','/:id/configurations','getConfigurations','get','getFields','post','isAuthenticated','addConfiguration','put','update','delete'];(function(_0x2e9782,_0xe29fa2){var _0x174ed2=function(_0x4a7610){while(--_0x4a7610){_0x2e9782['push'](_0x2e9782['shift']());}};_0x174ed2(++_0xe29fa2);}(_0xebdc,0x166));var _0xcebd=function(_0x169cd1,_0x12b9ca){_0x169cd1=_0x169cd1-0x0;var _0x4993f2=_0xebdc[_0x169cd1];return _0x4993f2;};'use strict';var multer=require('multer');var util=require(_0xcebd('0x0'));var path=require('path');var timeout=require(_0xcebd('0x1'));var express=require(_0xcebd('0x2'));var router=express[_0xcebd('0x3')]();var fs_extra=require(_0xcebd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcebd('0x5'));var config=require('../../config/environment');var controller=require(_0xcebd('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xcebd('0x7')]);router['get'](_0xcebd('0x8'),auth['isAuthenticated'](),controller[_0xcebd('0x9')]);router['get'](_0xcebd('0xa'),auth['isAuthenticated'](),controller[_0xcebd('0xb')]);router[_0xcebd('0xc')]('/:id/fields',auth['isAuthenticated'](),controller[_0xcebd('0xd')]);router[_0xcebd('0xe')]('/',auth[_0xcebd('0xf')](),controller['create']);router[_0xcebd('0xe')](_0xcebd('0xa'),auth['isAuthenticated'](),controller[_0xcebd('0x10')]);router[_0xcebd('0x11')](_0xcebd('0x8'),auth[_0xcebd('0xf')](),controller[_0xcebd('0x12')]);router[_0xcebd('0x13')](_0xcebd('0x8'),auth[_0xcebd('0xf')](),controller['destroy']);module[_0xcebd('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 082343d..b42a75e 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 _0xb4e6=['sequelize','STRING'];(function(_0x37d046,_0x4f2e79){var _0x4aa0ef=function(_0x193abe){while(--_0x193abe){_0x37d046['push'](_0x37d046['shift']());}};_0x4aa0ef(++_0x4f2e79);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xb4e6[_0x5bd426];return _0x23a7eb;};'use strict';var Sequelize=require(_0x6b4e('0x0'));module['exports']={'name':{'type':Sequelize[_0x6b4e('0x1')]},'description':{'type':Sequelize[_0x6b4e('0x1')]},'host':{'type':Sequelize[_0x6b4e('0x1')]},'zone':{'type':Sequelize[_0x6b4e('0x1')]},'clientId':{'type':Sequelize[_0x6b4e('0x1')]},'clientSecret':{'type':Sequelize[_0x6b4e('0x1')]},'serverUrl':{'type':Sequelize[_0x6b4e('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x6b4e('0x1')]}}; \ No newline at end of file +var _0x34e8=['sequelize','exports','STRING'];(function(_0x7aeeb5,_0x37c8c2){var _0x581310=function(_0x5f5d67){while(--_0x5f5d67){_0x7aeeb5['push'](_0x7aeeb5['shift']());}};_0x581310(++_0x37c8c2);}(_0x34e8,0x12c));var _0x834e=function(_0x156f23,_0x1ee036){_0x156f23=_0x156f23-0x0;var _0x1cc03a=_0x34e8[_0x156f23];return _0x1cc03a;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'name':{'type':Sequelize[_0x834e('0x2')]},'description':{'type':Sequelize[_0x834e('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x834e('0x2')]},'clientId':{'type':Sequelize[_0x834e('0x2')]},'clientSecret':{'type':Sequelize[_0x834e('0x2')]},'serverUrl':{'type':Sequelize[_0x834e('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x834e('0x2')]},'refreshToken':{'type':Sequelize[_0x834e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 3517514..f82120f 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 _0xc491=['includes','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','save','update','then','name','send','index','map','ZohoAccount','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','include','findAll','params','length','includeAll','options','find','create','body','catch','destroy','getConfigurations','findOne','keys','ZohoConfiguration','rawAttributes','nolimit','addConfiguration','AccountId','getSubjects','Descriptions','channel','ZohoField','Subjects','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','getFields','host','zone','serverUrl','code','com','slice','lastIndexOf','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','error','message','Owner','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type'];(function(_0x45e406,_0x27ba8f){var _0x15281a=function(_0x149f8b){while(--_0x149f8b){_0x45e406['push'](_0x45e406['shift']());}};_0x15281a(++_0x27ba8f);}(_0xc491,0x186));var _0x1c49=function(_0x74745d,_0x177606){_0x74745d=_0x74745d-0x0;var _0x174ab3=_0xc491[_0x74745d];return _0x174ab3;};'use strict';var emlformat=require(_0x1c49('0x0'));var rimraf=require(_0x1c49('0x1'));var zipdir=require(_0x1c49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1c49('0x3'));var util=require(_0x1c49('0x4'));var path=require(_0x1c49('0x5'));var sox=require(_0x1c49('0x6'));var csv=require(_0x1c49('0x7'));var ejs=require(_0x1c49('0x8'));var fs=require('fs');var fs_extra=require(_0x1c49('0x9'));var _=require(_0x1c49('0xa'));var squel=require(_0x1c49('0xb'));var crypto=require(_0x1c49('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1c49('0xd'));var toCsv=require(_0x1c49('0x7'));var querystring=require('querystring');var Papa=require(_0x1c49('0xe'));var Redis=require(_0x1c49('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1c49('0x10'));var as=require(_0x1c49('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1c49('0x12'))('api');var utils=require(_0x1c49('0x13'));var config=require(_0x1c49('0x14'));var licenseUtil=require(_0x1c49('0x15'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xa02708,_0x5d5b0b){_0x5d5b0b=_0x5d5b0b||0xcc;return function(_0x965d82){if(_0x965d82){return _0xa02708[_0x1c49('0x16')](_0x5d5b0b);}return _0xa02708['status'](_0x5d5b0b)[_0x1c49('0x17')]();};}function respondWithResult(_0x4ca570,_0x5d4a13){_0x5d4a13=_0x5d4a13||0xc8;return function(_0x4b927c){if(_0x4b927c){return _0x4ca570[_0x1c49('0x18')](_0x5d4a13)[_0x1c49('0x19')](_0x4b927c);}};}function respondWithFilteredResult(_0xf73754,_0x4452c2){return function(_0x4fc190){if(_0x4fc190){var _0x578282=typeof _0x4452c2[_0x1c49('0x1a')]===_0x1c49('0x1b')&&typeof _0x4452c2['limit']==='undefined';var _0x31f9bc=_0x4fc190[_0x1c49('0x1c')];var _0x4047f0=_0x578282?0x0:_0x4452c2[_0x1c49('0x1a')];var _0x523b51=_0x578282?_0x4fc190[_0x1c49('0x1c')]:_0x4452c2['offset']+_0x4452c2[_0x1c49('0x1d')];var _0x4fd744;if(_0x523b51>=_0x31f9bc){_0x523b51=_0x31f9bc;_0x4fd744=0xc8;}else{_0x4fd744=0xce;}_0xf73754[_0x1c49('0x18')](_0x4fd744);return _0xf73754[_0x1c49('0x1e')]('Content-Range',_0x4047f0+'-'+_0x523b51+'/'+_0x31f9bc)[_0x1c49('0x19')](_0x4fc190);}return null;};}function patchUpdates(_0x50e583){return function(_0x33fb1b){try{jsonpatch[_0x1c49('0x1f')](_0x33fb1b,_0x50e583,!![]);}catch(_0x4f6370){return BPromise['reject'](_0x4f6370);}return _0x33fb1b[_0x1c49('0x20')]();};}function saveUpdates(_0x260d4f,_0x57a2de){return function(_0x103cd7){if(_0x103cd7){return _0x103cd7[_0x1c49('0x21')](_0x260d4f)[_0x1c49('0x22')](function(_0x1f2fa8){return _0x1f2fa8;});}return null;};}function removeEntity(_0x3ff8aa,_0x2b95d3){return function(_0x252ba6){if(_0x252ba6){return _0x252ba6['destroy']()['then'](function(){_0x3ff8aa[_0x1c49('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfe61f5,_0x4f6d35){return function(_0x53d363){if(!_0x53d363){_0xfe61f5[_0x1c49('0x16')](0x194);}return _0x53d363;};}function handleError(_0x56dfe1,_0x38e836){_0x38e836=_0x38e836||0x1f4;return function(_0x1d169c){logger['error'](_0x1d169c['stack']);if(_0x1d169c[_0x1c49('0x23')]){delete _0x1d169c['name'];}_0x56dfe1[_0x1c49('0x18')](_0x38e836)[_0x1c49('0x24')](_0x1d169c);};}exports[_0x1c49('0x25')]=function(_0x2e413e,_0x4da476){var _0x8ca102={},_0x454ba8={},_0x57a61b={'count':0x0,'rows':[]};var _0x1beed3=_[_0x1c49('0x26')](db[_0x1c49('0x27')]['rawAttributes'],function(_0x301345){return{'name':_0x301345['fieldName'],'type':_0x301345['type'][_0x1c49('0x28')]};});_0x454ba8[_0x1c49('0x29')]=_[_0x1c49('0x26')](_0x1beed3,'name');_0x454ba8[_0x1c49('0x2a')]=_['keys'](_0x2e413e[_0x1c49('0x2a')]);_0x454ba8[_0x1c49('0x2b')]=_[_0x1c49('0x2c')](_0x454ba8[_0x1c49('0x29')],_0x454ba8[_0x1c49('0x2a')]);_0x8ca102['attributes']=_[_0x1c49('0x2c')](_0x454ba8[_0x1c49('0x29')],qs[_0x1c49('0x2d')](_0x2e413e['query'][_0x1c49('0x2d')]));_0x8ca102['attributes']=_0x8ca102[_0x1c49('0x2e')]['length']?_0x8ca102[_0x1c49('0x2e')]:_0x454ba8[_0x1c49('0x29')];if(!_0x2e413e[_0x1c49('0x2a')][_0x1c49('0x2f')]('nolimit')){_0x8ca102[_0x1c49('0x1d')]=qs[_0x1c49('0x1d')](_0x2e413e[_0x1c49('0x2a')][_0x1c49('0x1d')]);_0x8ca102[_0x1c49('0x1a')]=qs[_0x1c49('0x1a')](_0x2e413e['query']['offset']);}_0x8ca102['order']=qs[_0x1c49('0x30')](_0x2e413e[_0x1c49('0x2a')][_0x1c49('0x30')]);_0x8ca102[_0x1c49('0x31')]=qs[_0x1c49('0x2b')](_[_0x1c49('0x32')](_0x2e413e[_0x1c49('0x2a')],_0x454ba8[_0x1c49('0x2b')]),_0x1beed3);if(_0x2e413e[_0x1c49('0x2a')][_0x1c49('0x33')]){_0x8ca102[_0x1c49('0x31')]=_[_0x1c49('0x34')](_0x8ca102[_0x1c49('0x31')],{'$or':_['map'](_0x1beed3,function(_0x5ce85f){if(_0x5ce85f[_0x1c49('0x35')]!==_0x1c49('0x36')){var _0x45e044={};_0x45e044[_0x5ce85f[_0x1c49('0x23')]]={'$like':'%'+_0x2e413e['query'][_0x1c49('0x33')]+'%'};return _0x45e044;}})});}_0x8ca102=_[_0x1c49('0x34')]({},_0x8ca102,_0x2e413e['options']);var _0x192e55={'where':_0x8ca102[_0x1c49('0x31')]};return db[_0x1c49('0x27')]['count'](_0x192e55)[_0x1c49('0x22')](function(_0x3c0f33){_0x57a61b[_0x1c49('0x1c')]=_0x3c0f33;if(_0x2e413e[_0x1c49('0x2a')]['includeAll']){_0x8ca102[_0x1c49('0x37')]=[{'all':!![]}];}return db[_0x1c49('0x27')][_0x1c49('0x38')](_0x8ca102);})[_0x1c49('0x22')](function(_0x4d554c){_0x57a61b['rows']=_0x4d554c;return _0x57a61b;})[_0x1c49('0x22')](respondWithFilteredResult(_0x4da476,_0x8ca102))['catch'](handleError(_0x4da476,null));};exports['show']=function(_0x2083c8,_0x51a117){var _0x5b77d2={'raw':![],'where':{'id':_0x2083c8[_0x1c49('0x39')]['id']}},_0x2597b6={};_0x2597b6[_0x1c49('0x29')]=_['keys'](db[_0x1c49('0x27')]['rawAttributes']);_0x2597b6['query']=_['keys'](_0x2083c8[_0x1c49('0x2a')]);_0x2597b6[_0x1c49('0x2b')]=_[_0x1c49('0x2c')](_0x2597b6[_0x1c49('0x29')],_0x2597b6[_0x1c49('0x2a')]);_0x5b77d2[_0x1c49('0x2e')]=_[_0x1c49('0x2c')](_0x2597b6[_0x1c49('0x29')],qs[_0x1c49('0x2d')](_0x2083c8[_0x1c49('0x2a')]['fields']));_0x5b77d2['attributes']=_0x5b77d2[_0x1c49('0x2e')][_0x1c49('0x3a')]?_0x5b77d2[_0x1c49('0x2e')]:_0x2597b6[_0x1c49('0x29')];if(_0x2083c8['query'][_0x1c49('0x3b')]){_0x5b77d2[_0x1c49('0x37')]=[{'all':!![]}];}_0x5b77d2=_[_0x1c49('0x34')]({},_0x5b77d2,_0x2083c8[_0x1c49('0x3c')]);return db['ZohoAccount'][_0x1c49('0x3d')](_0x5b77d2)[_0x1c49('0x22')](handleEntityNotFound(_0x51a117,null))[_0x1c49('0x22')](respondWithResult(_0x51a117,null))['catch'](handleError(_0x51a117,null));};exports[_0x1c49('0x3e')]=function(_0x1c77ce,_0x527173){return db[_0x1c49('0x27')]['create'](_0x1c77ce[_0x1c49('0x3f')],{})[_0x1c49('0x22')](respondWithResult(_0x527173,0xc9))['catch'](handleError(_0x527173,null));};exports['update']=function(_0x3099b7,_0x334e3d){if(_0x3099b7['body']['id']){delete _0x3099b7[_0x1c49('0x3f')]['id'];}return db['ZohoAccount']['find']({'where':{'id':_0x3099b7[_0x1c49('0x39')]['id']}})['then'](handleEntityNotFound(_0x334e3d,null))[_0x1c49('0x22')](saveUpdates(_0x3099b7[_0x1c49('0x3f')],null))[_0x1c49('0x22')](respondWithResult(_0x334e3d,null))[_0x1c49('0x40')](handleError(_0x334e3d,null));};exports[_0x1c49('0x41')]=function(_0x46efdc,_0x185603){return db['ZohoAccount'][_0x1c49('0x3d')]({'where':{'id':_0x46efdc['params']['id']}})[_0x1c49('0x22')](handleEntityNotFound(_0x185603,null))[_0x1c49('0x22')](removeEntity(_0x185603,null))['catch'](handleError(_0x185603,null));};exports[_0x1c49('0x42')]=function(_0x57261e,_0x2eefd9,_0x303e45){var _0x5c5d9f={};var _0x585e11={};var _0x4c30a8;var _0x5e8fdd;return db['ZohoAccount'][_0x1c49('0x43')]({'where':{'id':_0x57261e[_0x1c49('0x39')]['id']}})['then'](handleEntityNotFound(_0x2eefd9,null))[_0x1c49('0x22')](function(_0x2904a0){if(_0x2904a0){_0x4c30a8=_0x2904a0;_0x585e11[_0x1c49('0x29')]=_[_0x1c49('0x44')](db[_0x1c49('0x45')][_0x1c49('0x46')]);_0x585e11[_0x1c49('0x2a')]=_[_0x1c49('0x44')](_0x57261e['query']);_0x585e11[_0x1c49('0x2b')]=_['intersection'](_0x585e11[_0x1c49('0x29')],_0x585e11[_0x1c49('0x2a')]);_0x5c5d9f[_0x1c49('0x2e')]=_[_0x1c49('0x2c')](_0x585e11['model'],qs['fields'](_0x57261e[_0x1c49('0x2a')]['fields']));_0x5c5d9f[_0x1c49('0x2e')]=_0x5c5d9f[_0x1c49('0x2e')][_0x1c49('0x3a')]?_0x5c5d9f[_0x1c49('0x2e')]:_0x585e11[_0x1c49('0x29')];_0x5c5d9f['order']=qs[_0x1c49('0x30')](_0x57261e[_0x1c49('0x2a')][_0x1c49('0x30')]);_0x5c5d9f[_0x1c49('0x31')]=qs[_0x1c49('0x2b')](_[_0x1c49('0x32')](_0x57261e['query'],_0x585e11['filters']));if(_0x57261e[_0x1c49('0x2a')]['filter']){_0x5c5d9f[_0x1c49('0x31')]=_[_0x1c49('0x34')](_0x5c5d9f[_0x1c49('0x31')],{'$or':_[_0x1c49('0x26')](_0x5c5d9f[_0x1c49('0x2e')],function(_0x3aa442){var _0x42b3c5={};_0x42b3c5[_0x3aa442]={'$like':'%'+_0x57261e[_0x1c49('0x2a')][_0x1c49('0x33')]+'%'};return _0x42b3c5;})});}_0x5c5d9f=_['merge']({},_0x5c5d9f,_0x57261e[_0x1c49('0x3c')]);return _0x4c30a8[_0x1c49('0x42')](_0x5c5d9f);}})[_0x1c49('0x22')](function(_0x144021){if(_0x144021){_0x5e8fdd=_0x144021[_0x1c49('0x3a')];if(!_0x57261e[_0x1c49('0x2a')]['hasOwnProperty'](_0x1c49('0x47'))){_0x5c5d9f[_0x1c49('0x1d')]=qs[_0x1c49('0x1d')](_0x57261e[_0x1c49('0x2a')][_0x1c49('0x1d')]);_0x5c5d9f[_0x1c49('0x1a')]=qs[_0x1c49('0x1a')](_0x57261e[_0x1c49('0x2a')][_0x1c49('0x1a')]);}return _0x4c30a8[_0x1c49('0x42')](_0x5c5d9f);}})[_0x1c49('0x22')](function(_0x538e3f){if(_0x538e3f){return _0x538e3f?{'count':_0x5e8fdd,'rows':_0x538e3f}:null;}})['then'](respondWithResult(_0x2eefd9,null))[_0x1c49('0x40')](handleError(_0x2eefd9,null));};exports[_0x1c49('0x48')]=function(_0x2c9bf7,_0x11beb2,_0x179fee){if(_0x2c9bf7[_0x1c49('0x3f')]['id']){delete _0x2c9bf7['body']['id'];}return db[_0x1c49('0x27')][_0x1c49('0x43')]({'where':{'id':_0x2c9bf7[_0x1c49('0x39')]['id']}})['then'](handleEntityNotFound(_0x11beb2,null))['then'](function(_0x753bc6){if(_0x753bc6){_0x2c9bf7[_0x1c49('0x3f')][_0x1c49('0x49')]=_0x753bc6['id'];_0x2c9bf7['body']['Subjects']=integrations[_0x1c49('0x4a')](_0x2c9bf7[_0x1c49('0x3f')]['channel'],_0x2c9bf7[_0x1c49('0x3f')][_0x1c49('0x35')]);_0x2c9bf7[_0x1c49('0x3f')][_0x1c49('0x4b')]=integrations['getDescriptions'](_0x2c9bf7[_0x1c49('0x3f')][_0x1c49('0x4c')],_0x2c9bf7[_0x1c49('0x3f')][_0x1c49('0x35')]);return db[_0x1c49('0x45')][_0x1c49('0x3e')](_0x2c9bf7[_0x1c49('0x3f')],{'include':[{'model':db[_0x1c49('0x4d')],'as':_0x1c49('0x4e')},{'model':db[_0x1c49('0x4d')],'as':_0x1c49('0x4b')}]});}return null;})[_0x1c49('0x22')](respondWithResult(_0x11beb2,null))[_0x1c49('0x40')](handleError(_0x11beb2,null));};function getAccessToken(_0x189961){return new Promise(function(_0x548ef1,_0x48c84a){var _0x1d9f08;switch(_0x189961['zone']){case'US':_0x1d9f08=_0x1c49('0x4f');break;case'AU':_0x1d9f08=_0x1c49('0x50');break;case'EU':_0x1d9f08=_0x1c49('0x51');break;case'IN':_0x1d9f08=_0x1c49('0x52');break;case'CN':_0x1d9f08=_0x1c49('0x53');break;default:_0x1d9f08=_0x1c49('0x51');break;}var _0x28577c={'method':_0x1c49('0x54'),'uri':_0x1d9f08+_0x1c49('0x55'),'qs':{'refresh_token':_0x189961[_0x1c49('0x56')],'client_id':_0x189961[_0x1c49('0x57')],'client_secret':_0x189961[_0x1c49('0x58')],'grant_type':_0x1c49('0x59')},'json':!![]};return rp(_0x28577c)['then'](function(_0x2e84e5){if(_0x2e84e5[_0x1c49('0x5a')]){_0x548ef1(_0x2e84e5[_0x1c49('0x5a')]);}else{_0x48c84a('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})['catch'](function(_0x45afb6){_0x48c84a(_0x45afb6);});});}exports[_0x1c49('0x5b')]=function(_0x196ab1,_0x45673a,_0x98d897){var _0x57f3ee,_0x698c63,_0x450537,_0x533e41,_0x5eaafd;return db[_0x1c49('0x27')]['findOne']({'where':{'id':_0x196ab1[_0x1c49('0x39')]['id']},'attributes':['id',_0x1c49('0x5c'),_0x1c49('0x5d'),_0x1c49('0x57'),_0x1c49('0x58'),_0x1c49('0x5e'),_0x1c49('0x5f'),_0x1c49('0x56')]})[_0x1c49('0x22')](handleEntityNotFound(_0x45673a,null))[_0x1c49('0x22')](function(_0x4f5601){_0x5eaafd=_0x4f5601;_0x57f3ee=_0x5eaafd[_0x1c49('0x5c')];_0x698c63=_0x57f3ee==='zoho.eu'?'eu':_0x1c49('0x60');_0x450537=_0x5eaafd[_0x1c49('0x5e')];var _0x4a8bc7=_0x450537[_0x1c49('0x61')](-0x1);if(_0x4a8bc7==='/'||_0x4a8bc7==='\x5c'||_0x4a8bc7===':'){_0x450537=_0x450537['substring'](0x0,_0x450537[_0x1c49('0x62')](_0x4a8bc7));}if(!_0x5eaafd[_0x1c49('0x56')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x5eaafd);})[_0x1c49('0x22')](function(_0x4560a2){if(_0x4560a2){return rp({'method':_0x1c49('0x63'),'uri':util[_0x1c49('0x64')](_0x1c49('0x65'),_0x698c63),'qs':{'module':_0x1c49('0x66')},'headers':{'Authorization':_0x1c49('0x67')+_0x4560a2},'json':!![]});}})[_0x1c49('0x22')](function(_0x2aac){if(_0x2aac){if(_0x2aac[_0x1c49('0x68')]&&_0x2aac[_0x1c49('0x68')]['error']){throw new Error(_0x2aac['response'][_0x1c49('0x69')][_0x1c49('0x6a')]);}var _0x3361e9=[];var _0x4ecd6f=[];var _0x38f54c=[_0x1c49('0x6b'),'Subject',_0x1c49('0x6c'),_0x1c49('0x6d'),_0x1c49('0x6e'),_0x1c49('0x6f'),_0x1c49('0x70'),_0x1c49('0x71')];_0x4ecd6f=_['remove'](_0x2aac[_0x1c49('0x2d')],function(_0x208d8f){return _0x38f54c[_0x1c49('0x72')](_0x208d8f['api_name']);});for(var _0x430553=0x0;_0x430553<_0x4ecd6f[_0x1c49('0x3a')];_0x430553++){if(_0x4ecd6f[_0x430553][_0x1c49('0x73')]===![]){_0x3361e9[_0x1c49('0x74')]({'id':_0x4ecd6f[_0x430553]['id'],'name':_0x4ecd6f[_0x430553][_0x1c49('0x75')],'custom':_0x4ecd6f[_0x430553][_0x1c49('0x76')],'options':_0x4ecd6f[_0x430553][_0x1c49('0x77')]===_0x1c49('0x78')&&_0x4ecd6f[_0x430553][_0x1c49('0x79')][_0x1c49('0x3a')]>-0x1?_[_0x1c49('0x26')](_0x4ecd6f[_0x430553]['pick_list_values'],function(_0x3fd15f){return{'name':_0x3fd15f,'value':_0x3fd15f};}):[]});}}return{'count':_0x3361e9[_0x1c49('0x3a')],'rows':_0x3361e9};}else{return{'count':0x0,'rows':[]};}})[_0x1c49('0x22')](respondWithResult(_0x45673a,null))[_0x1c49('0x40')](function(_0x34621d){var _0x277b8c=_0x196ab1[_0x1c49('0x2a')][_0x1c49('0x7a')]?0x1f4:_0x34621d['statusCode']||0x1f4;logger['error'](_0x1c49('0x7b'),_0x1c49('0x5b'),_0x277b8c,JSON[_0x1c49('0x7c')](_0x34621d));delete _0x34621d[_0x1c49('0x23')];if(_0x277b8c===0x191){_0x277b8c=0x190;}_0x45673a[_0x1c49('0x18')](_0x277b8c)[_0x1c49('0x24')](_0x196ab1[_0x1c49('0x2a')]['test']?{'message':_0x1c49('0x7d'),'statusCode':_0x34621d['statusCode']}:_0x34621d);});}; \ No newline at end of file +var _0x2829=['https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientSecret','serverUrl','code','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','statusCode','test','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','error','name','send','map','ZohoAccount','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','include','rows','show','keys','find','create','catch','body','params','destroy','getConfigurations','findOne','ZohoConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.eu'];(function(_0x363273,_0x3aa3f5){var _0x6f465=function(_0x372bf5){while(--_0x372bf5){_0x363273['push'](_0x363273['shift']());}};_0x6f465(++_0x3aa3f5);}(_0x2829,0x126));var _0x9282=function(_0x477f4e,_0x43c9ce){_0x477f4e=_0x477f4e-0x0;var _0x4db8e9=_0x2829[_0x477f4e];return _0x4db8e9;};'use strict';var emlformat=require(_0x9282('0x0'));var rimraf=require(_0x9282('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9282('0x2'));var moment=require('moment');var BPromise=require(_0x9282('0x3'));var Mustache=require(_0x9282('0x4'));var util=require(_0x9282('0x5'));var path=require('path');var sox=require(_0x9282('0x6'));var csv=require(_0x9282('0x7'));var ejs=require(_0x9282('0x8'));var fs=require('fs');var fs_extra=require(_0x9282('0x9'));var _=require(_0x9282('0xa'));var squel=require('squel');var crypto=require(_0x9282('0xb'));var jsforce=require(_0x9282('0xc'));var deskjs=require(_0x9282('0xd'));var toCsv=require(_0x9282('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9282('0xe'));var authService=require(_0x9282('0xf'));var qs=require(_0x9282('0x10'));var as=require(_0x9282('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9282('0x12'))(_0x9282('0x13'));var utils=require(_0x9282('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9282('0x15'))['db'];var integrations=require(_0x9282('0x16'));function respondWithStatusCode(_0x8c4e72,_0x3d2383){_0x3d2383=_0x3d2383||0xcc;return function(_0xb4f9f9){if(_0xb4f9f9){return _0x8c4e72[_0x9282('0x17')](_0x3d2383);}return _0x8c4e72[_0x9282('0x18')](_0x3d2383)[_0x9282('0x19')]();};}function respondWithResult(_0x3de5fa,_0x413752){_0x413752=_0x413752||0xc8;return function(_0x43d85f){if(_0x43d85f){return _0x3de5fa[_0x9282('0x18')](_0x413752)[_0x9282('0x1a')](_0x43d85f);}};}function respondWithFilteredResult(_0x5b1ba6,_0x171d41){return function(_0x4718dc){if(_0x4718dc){var _0x3b28eb=typeof _0x171d41[_0x9282('0x1b')]===_0x9282('0x1c')&&typeof _0x171d41[_0x9282('0x1d')]===_0x9282('0x1c');var _0x2340d7=_0x4718dc[_0x9282('0x1e')];var _0x4c8f4c=_0x3b28eb?0x0:_0x171d41[_0x9282('0x1b')];var _0x545d80=_0x3b28eb?_0x4718dc[_0x9282('0x1e')]:_0x171d41['offset']+_0x171d41['limit'];var _0x148331;if(_0x545d80>=_0x2340d7){_0x545d80=_0x2340d7;_0x148331=0xc8;}else{_0x148331=0xce;}_0x5b1ba6['status'](_0x148331);return _0x5b1ba6[_0x9282('0x1f')](_0x9282('0x20'),_0x4c8f4c+'-'+_0x545d80+'/'+_0x2340d7)[_0x9282('0x1a')](_0x4718dc);}return null;};}function patchUpdates(_0x5c6efe){return function(_0x571fc0){try{jsonpatch['apply'](_0x571fc0,_0x5c6efe,!![]);}catch(_0x1f051f){return BPromise['reject'](_0x1f051f);}return _0x571fc0[_0x9282('0x21')]();};}function saveUpdates(_0x58ba05,_0x24107f){return function(_0x1b9c97){if(_0x1b9c97){return _0x1b9c97[_0x9282('0x22')](_0x58ba05)[_0x9282('0x23')](function(_0x3140b){return _0x3140b;});}return null;};}function removeEntity(_0x7cb944,_0x24dc7d){return function(_0x2b310d){if(_0x2b310d){return _0x2b310d['destroy']()[_0x9282('0x23')](function(){_0x7cb944[_0x9282('0x18')](0xcc)[_0x9282('0x19')]();});}};}function handleEntityNotFound(_0xdcb1d7,_0x467ca6){return function(_0x1c3f29){if(!_0x1c3f29){_0xdcb1d7['sendStatus'](0x194);}return _0x1c3f29;};}function handleError(_0x48720c,_0x2a1278){_0x2a1278=_0x2a1278||0x1f4;return function(_0x77e650){logger[_0x9282('0x24')](_0x77e650['stack']);if(_0x77e650[_0x9282('0x25')]){delete _0x77e650[_0x9282('0x25')];}_0x48720c[_0x9282('0x18')](_0x2a1278)[_0x9282('0x26')](_0x77e650);};}exports['index']=function(_0x56a97a,_0x2af2d6){var _0x22d387={},_0x438058={},_0xd2c165={'count':0x0,'rows':[]};var _0x421860=_[_0x9282('0x27')](db[_0x9282('0x28')][_0x9282('0x29')],function(_0x36c528){return{'name':_0x36c528['fieldName'],'type':_0x36c528['type'][_0x9282('0x2a')]};});_0x438058[_0x9282('0x2b')]=_[_0x9282('0x27')](_0x421860,_0x9282('0x25'));_0x438058[_0x9282('0x2c')]=_['keys'](_0x56a97a[_0x9282('0x2c')]);_0x438058[_0x9282('0x2d')]=_[_0x9282('0x2e')](_0x438058[_0x9282('0x2b')],_0x438058[_0x9282('0x2c')]);_0x22d387[_0x9282('0x2f')]=_['intersection'](_0x438058[_0x9282('0x2b')],qs['fields'](_0x56a97a[_0x9282('0x2c')][_0x9282('0x30')]));_0x22d387[_0x9282('0x2f')]=_0x22d387[_0x9282('0x2f')][_0x9282('0x31')]?_0x22d387['attributes']:_0x438058['model'];if(!_0x56a97a[_0x9282('0x2c')][_0x9282('0x32')](_0x9282('0x33'))){_0x22d387[_0x9282('0x1d')]=qs[_0x9282('0x1d')](_0x56a97a['query'][_0x9282('0x1d')]);_0x22d387['offset']=qs[_0x9282('0x1b')](_0x56a97a['query'][_0x9282('0x1b')]);}_0x22d387[_0x9282('0x34')]=qs[_0x9282('0x35')](_0x56a97a[_0x9282('0x2c')]['sort']);_0x22d387[_0x9282('0x36')]=qs['filters'](_['pick'](_0x56a97a[_0x9282('0x2c')],_0x438058[_0x9282('0x2d')]),_0x421860);if(_0x56a97a[_0x9282('0x2c')][_0x9282('0x37')]){_0x22d387[_0x9282('0x36')]=_[_0x9282('0x38')](_0x22d387[_0x9282('0x36')],{'$or':_[_0x9282('0x27')](_0x421860,function(_0xf4a9fd){if(_0xf4a9fd[_0x9282('0x39')]!=='VIRTUAL'){var _0x326fe8={};_0x326fe8[_0xf4a9fd[_0x9282('0x25')]]={'$like':'%'+_0x56a97a['query'][_0x9282('0x37')]+'%'};return _0x326fe8;}})});}_0x22d387=_['merge']({},_0x22d387,_0x56a97a[_0x9282('0x3a')]);var _0x5abf0b={'where':_0x22d387[_0x9282('0x36')]};return db[_0x9282('0x28')]['count'](_0x5abf0b)[_0x9282('0x23')](function(_0x5bb1a2){_0xd2c165[_0x9282('0x1e')]=_0x5bb1a2;if(_0x56a97a[_0x9282('0x2c')]['includeAll']){_0x22d387[_0x9282('0x3b')]=[{'all':!![]}];}return db['ZohoAccount']['findAll'](_0x22d387);})[_0x9282('0x23')](function(_0xd5e483){_0xd2c165[_0x9282('0x3c')]=_0xd5e483;return _0xd2c165;})[_0x9282('0x23')](respondWithFilteredResult(_0x2af2d6,_0x22d387))['catch'](handleError(_0x2af2d6,null));};exports[_0x9282('0x3d')]=function(_0x18511c,_0x2dc213){var _0x27d013={'raw':![],'where':{'id':_0x18511c['params']['id']}},_0x3e9c02={};_0x3e9c02['model']=_[_0x9282('0x3e')](db['ZohoAccount'][_0x9282('0x29')]);_0x3e9c02[_0x9282('0x2c')]=_[_0x9282('0x3e')](_0x18511c[_0x9282('0x2c')]);_0x3e9c02['filters']=_[_0x9282('0x2e')](_0x3e9c02[_0x9282('0x2b')],_0x3e9c02[_0x9282('0x2c')]);_0x27d013[_0x9282('0x2f')]=_[_0x9282('0x2e')](_0x3e9c02['model'],qs[_0x9282('0x30')](_0x18511c[_0x9282('0x2c')][_0x9282('0x30')]));_0x27d013['attributes']=_0x27d013[_0x9282('0x2f')]['length']?_0x27d013['attributes']:_0x3e9c02['model'];if(_0x18511c[_0x9282('0x2c')]['includeAll']){_0x27d013[_0x9282('0x3b')]=[{'all':!![]}];}_0x27d013=_[_0x9282('0x38')]({},_0x27d013,_0x18511c[_0x9282('0x3a')]);return db[_0x9282('0x28')][_0x9282('0x3f')](_0x27d013)[_0x9282('0x23')](handleEntityNotFound(_0x2dc213,null))['then'](respondWithResult(_0x2dc213,null))['catch'](handleError(_0x2dc213,null));};exports[_0x9282('0x40')]=function(_0x10a3da,_0x4f0d7e){return db[_0x9282('0x28')][_0x9282('0x40')](_0x10a3da['body'],{})[_0x9282('0x23')](respondWithResult(_0x4f0d7e,0xc9))[_0x9282('0x41')](handleError(_0x4f0d7e,null));};exports['update']=function(_0x48480b,_0x1063fa){if(_0x48480b[_0x9282('0x42')]['id']){delete _0x48480b[_0x9282('0x42')]['id'];}return db[_0x9282('0x28')][_0x9282('0x3f')]({'where':{'id':_0x48480b[_0x9282('0x43')]['id']}})[_0x9282('0x23')](handleEntityNotFound(_0x1063fa,null))['then'](saveUpdates(_0x48480b[_0x9282('0x42')],null))[_0x9282('0x23')](respondWithResult(_0x1063fa,null))['catch'](handleError(_0x1063fa,null));};exports[_0x9282('0x44')]=function(_0x45dbab,_0x1a58b6){return db[_0x9282('0x28')][_0x9282('0x3f')]({'where':{'id':_0x45dbab[_0x9282('0x43')]['id']}})['then'](handleEntityNotFound(_0x1a58b6,null))[_0x9282('0x23')](removeEntity(_0x1a58b6,null))[_0x9282('0x41')](handleError(_0x1a58b6,null));};exports[_0x9282('0x45')]=function(_0x323b71,_0x35b901,_0x3223ad){var _0x8d30a7={};var _0x36130a={};var _0x3492b7;var _0x23f767;return db[_0x9282('0x28')][_0x9282('0x46')]({'where':{'id':_0x323b71['params']['id']}})[_0x9282('0x23')](handleEntityNotFound(_0x35b901,null))['then'](function(_0x454197){if(_0x454197){_0x3492b7=_0x454197;_0x36130a['model']=_[_0x9282('0x3e')](db[_0x9282('0x47')]['rawAttributes']);_0x36130a['query']=_[_0x9282('0x3e')](_0x323b71['query']);_0x36130a['filters']=_['intersection'](_0x36130a[_0x9282('0x2b')],_0x36130a['query']);_0x8d30a7['attributes']=_[_0x9282('0x2e')](_0x36130a[_0x9282('0x2b')],qs[_0x9282('0x30')](_0x323b71[_0x9282('0x2c')][_0x9282('0x30')]));_0x8d30a7[_0x9282('0x2f')]=_0x8d30a7['attributes'][_0x9282('0x31')]?_0x8d30a7[_0x9282('0x2f')]:_0x36130a[_0x9282('0x2b')];_0x8d30a7[_0x9282('0x34')]=qs[_0x9282('0x35')](_0x323b71[_0x9282('0x2c')][_0x9282('0x35')]);_0x8d30a7['where']=qs[_0x9282('0x2d')](_[_0x9282('0x48')](_0x323b71[_0x9282('0x2c')],_0x36130a[_0x9282('0x2d')]));if(_0x323b71[_0x9282('0x2c')][_0x9282('0x37')]){_0x8d30a7[_0x9282('0x36')]=_[_0x9282('0x38')](_0x8d30a7[_0x9282('0x36')],{'$or':_[_0x9282('0x27')](_0x8d30a7[_0x9282('0x2f')],function(_0x22665e){var _0x1edad2={};_0x1edad2[_0x22665e]={'$like':'%'+_0x323b71[_0x9282('0x2c')][_0x9282('0x37')]+'%'};return _0x1edad2;})});}_0x8d30a7=_[_0x9282('0x38')]({},_0x8d30a7,_0x323b71[_0x9282('0x3a')]);return _0x3492b7[_0x9282('0x45')](_0x8d30a7);}})[_0x9282('0x23')](function(_0x3a8a7d){if(_0x3a8a7d){_0x23f767=_0x3a8a7d[_0x9282('0x31')];if(!_0x323b71['query'][_0x9282('0x32')]('nolimit')){_0x8d30a7[_0x9282('0x1d')]=qs[_0x9282('0x1d')](_0x323b71[_0x9282('0x2c')][_0x9282('0x1d')]);_0x8d30a7[_0x9282('0x1b')]=qs['offset'](_0x323b71[_0x9282('0x2c')][_0x9282('0x1b')]);}return _0x3492b7[_0x9282('0x45')](_0x8d30a7);}})[_0x9282('0x23')](function(_0x487f05){if(_0x487f05){return _0x487f05?{'count':_0x23f767,'rows':_0x487f05}:null;}})[_0x9282('0x23')](respondWithResult(_0x35b901,null))['catch'](handleError(_0x35b901,null));};exports[_0x9282('0x49')]=function(_0x34ba61,_0x552862,_0x18b3eb){if(_0x34ba61[_0x9282('0x42')]['id']){delete _0x34ba61[_0x9282('0x42')]['id'];}return db[_0x9282('0x28')][_0x9282('0x46')]({'where':{'id':_0x34ba61[_0x9282('0x43')]['id']}})[_0x9282('0x23')](handleEntityNotFound(_0x552862,null))[_0x9282('0x23')](function(_0x106a57){if(_0x106a57){_0x34ba61[_0x9282('0x42')][_0x9282('0x4a')]=_0x106a57['id'];_0x34ba61[_0x9282('0x42')][_0x9282('0x4b')]=integrations[_0x9282('0x4c')](_0x34ba61[_0x9282('0x42')][_0x9282('0x4d')],_0x34ba61[_0x9282('0x42')][_0x9282('0x39')]);_0x34ba61[_0x9282('0x42')][_0x9282('0x4e')]=integrations[_0x9282('0x4f')](_0x34ba61[_0x9282('0x42')][_0x9282('0x4d')],_0x34ba61['body'][_0x9282('0x39')]);return db['ZohoConfiguration'][_0x9282('0x40')](_0x34ba61[_0x9282('0x42')],{'include':[{'model':db[_0x9282('0x50')],'as':_0x9282('0x4b')},{'model':db[_0x9282('0x50')],'as':_0x9282('0x4e')}]});}return null;})[_0x9282('0x23')](respondWithResult(_0x552862,null))['catch'](handleError(_0x552862,null));};function getAccessToken(_0x3e4487){return new Promise(function(_0x4bebe9,_0x2a7f60){var _0x5117af;switch(_0x3e4487[_0x9282('0x51')]){case'US':_0x5117af=_0x9282('0x52');break;case'AU':_0x5117af='https://accounts.zoho.com.au';break;case'EU':_0x5117af=_0x9282('0x53');break;case'IN':_0x5117af=_0x9282('0x54');break;case'CN':_0x5117af=_0x9282('0x55');break;default:_0x5117af=_0x9282('0x53');break;}var _0x56bd21={'method':_0x9282('0x56'),'uri':_0x5117af+_0x9282('0x57'),'qs':{'refresh_token':_0x3e4487[_0x9282('0x58')],'client_id':_0x3e4487[_0x9282('0x59')],'client_secret':_0x3e4487['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0x56bd21)[_0x9282('0x23')](function(_0x2cb143){if(_0x2cb143[_0x9282('0x5a')]){_0x4bebe9(_0x2cb143[_0x9282('0x5a')]);}else{_0x2a7f60(_0x9282('0x5b'));}})['catch'](function(_0x4e8894){_0x2a7f60(_0x4e8894);});});}exports[_0x9282('0x5c')]=function(_0x3b1556,_0x39e8d9,_0x2b77eb){var _0x1594f0,_0x417e79,_0x1570ba,_0x21a92f,_0x530d67;return db[_0x9282('0x28')][_0x9282('0x46')]({'where':{'id':_0x3b1556[_0x9282('0x43')]['id']},'attributes':['id',_0x9282('0x5d'),_0x9282('0x51'),_0x9282('0x59'),_0x9282('0x5e'),_0x9282('0x5f'),_0x9282('0x60'),_0x9282('0x58')]})[_0x9282('0x23')](handleEntityNotFound(_0x39e8d9,null))[_0x9282('0x23')](function(_0x143d8e){_0x530d67=_0x143d8e;_0x1594f0=_0x530d67[_0x9282('0x5d')];_0x417e79=_0x1594f0==='zoho.eu'?'eu':_0x9282('0x61');_0x1570ba=_0x530d67['serverUrl'];var _0x3254c0=_0x1570ba[_0x9282('0x62')](-0x1);if(_0x3254c0==='/'||_0x3254c0==='\x5c'||_0x3254c0===':'){_0x1570ba=_0x1570ba[_0x9282('0x63')](0x0,_0x1570ba[_0x9282('0x64')](_0x3254c0));}if(!_0x530d67['refreshToken']){throw new Error(_0x9282('0x65'));}return getAccessToken(_0x530d67);})[_0x9282('0x23')](function(_0x2cf4dd){if(_0x2cf4dd){return rp({'method':_0x9282('0x66'),'uri':util['format'](_0x9282('0x67'),_0x417e79),'qs':{'module':_0x9282('0x68')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2cf4dd},'json':!![]});}})[_0x9282('0x23')](function(_0x19c2e){if(_0x19c2e){if(_0x19c2e['response']&&_0x19c2e['response']['error']){throw new Error(_0x19c2e[_0x9282('0x69')][_0x9282('0x24')][_0x9282('0x6a')]);}var _0x3b9b4d=[];var _0x18580c=[];var _0x1c108d=[_0x9282('0x6b'),_0x9282('0x6c'),_0x9282('0x6d'),_0x9282('0x6e'),_0x9282('0x6f'),_0x9282('0x70'),_0x9282('0x71'),_0x9282('0x72')];_0x18580c=_['remove'](_0x19c2e[_0x9282('0x30')],function(_0xaf8a3c){return _0x1c108d[_0x9282('0x73')](_0xaf8a3c[_0x9282('0x74')]);});for(var _0x1eb6b0=0x0;_0x1eb6b0<_0x18580c[_0x9282('0x31')];_0x1eb6b0++){if(_0x18580c[_0x1eb6b0][_0x9282('0x75')]===![]){_0x3b9b4d[_0x9282('0x76')]({'id':_0x18580c[_0x1eb6b0]['id'],'name':_0x18580c[_0x1eb6b0][_0x9282('0x77')],'custom':_0x18580c[_0x1eb6b0][_0x9282('0x78')],'options':_0x18580c[_0x1eb6b0][_0x9282('0x79')]===_0x9282('0x7a')&&_0x18580c[_0x1eb6b0][_0x9282('0x7b')][_0x9282('0x31')]>-0x1?_[_0x9282('0x27')](_0x18580c[_0x1eb6b0][_0x9282('0x7b')],function(_0xd5ca1d){return{'name':_0xd5ca1d,'value':_0xd5ca1d};}):[]});}}return{'count':_0x3b9b4d[_0x9282('0x31')],'rows':_0x3b9b4d};}else{return{'count':0x0,'rows':[]};}})[_0x9282('0x23')](respondWithResult(_0x39e8d9,null))[_0x9282('0x41')](function(_0x1f6f4d){var _0x14cc39=_0x3b1556[_0x9282('0x2c')]['test']?0x1f4:_0x1f6f4d[_0x9282('0x7c')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x9282('0x5c'),_0x14cc39,JSON['stringify'](_0x1f6f4d));delete _0x1f6f4d[_0x9282('0x25')];if(_0x14cc39===0x191){_0x14cc39=0x190;}_0x39e8d9[_0x9282('0x18')](_0x14cc39)[_0x9282('0x26')](_0x3b1556[_0x9282('0x2c')][_0x9282('0x7d')]?{'message':'Wrong\x20credentials','statusCode':_0x1f6f4d[_0x9282('0x7c')]}:_0x1f6f4d);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index c75365a..3b1fc14 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 _0x483f=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','int_zoho_accounts','changed','zone','serverUrl','code','host','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.in','POST','clientId','clientSecret','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','slice','substring','https://accounts.zoho.com.cn','authorization_code','catch','util'];(function(_0x150642,_0x51849b){var _0xefb79a=function(_0x378cef){while(--_0x378cef){_0x150642['push'](_0x150642['shift']());}};_0xefb79a(++_0x51849b);}(_0x483f,0x185));var _0xf483=function(_0x2981b7,_0x10873b){_0x2981b7=_0x2981b7-0x0;var _0x4f7fa8=_0x483f[_0x2981b7];return _0x4f7fa8;};'use strict';var _=require('lodash');var util=require(_0xf483('0x0'));var logger=require(_0xf483('0x1'))(_0xf483('0x2'));var moment=require('moment');var BPromise=require(_0xf483('0x3'));var rp=require(_0xf483('0x4'));var fs=require('fs');var path=require(_0xf483('0x5'));var rimraf=require('rimraf');var config=require(_0xf483('0x6'));var attributes=require(_0xf483('0x7'));var integrations=require(_0xf483('0x8'));module['exports']=function(_0x30834d,_0x586977){return _0x30834d[_0xf483('0x9')]('ZohoAccount',attributes,{'tableName':_0xf483('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2ec2de,_0x258dbf,_0xfa47b9){if(_0x2ec2de[_0xf483('0xb')](_0xf483('0xc'))||_0x2ec2de[_0xf483('0xb')](_0xf483('0xd'))||_0x2ec2de[_0xf483('0xb')]('clientId')||_0x2ec2de[_0xf483('0xb')]('clientSecret')||_0x2ec2de['changed'](_0xf483('0xe'))||_0x2ec2de[_0xf483('0xb')](_0xf483('0xf'))){var _0x55bed6,_0x5067cf;_0x55bed6=_0x2ec2de['serverUrl'];var _0x1561ec=_0x55bed6['slice'](-0x1);if(_0x1561ec==='/'||_0x1561ec==='\x5c'||_0x1561ec===':'){_0x55bed6=_0x55bed6['substring'](0x0,_0x55bed6[_0xf483('0x10')](_0x1561ec));}switch(_0x2ec2de['zone']){case'US':_0x5067cf=_0xf483('0x11');break;case'AU':_0x5067cf='https://accounts.zoho.com.au';break;case'IN':_0x5067cf=_0xf483('0x12');break;case'CN':_0x5067cf='https://accounts.zoho.com.cn';break;default:_0x5067cf='https://accounts.zoho.eu';break;}var _0x4f6b8a={'method':_0xf483('0x13'),'uri':_0x5067cf+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x2ec2de[_0xf483('0x14')],'client_secret':_0x2ec2de[_0xf483('0x15')],'redirect_uri':_0x2ec2de['serverUrl'],'code':_0x2ec2de['code']},'headers':{'Content-Type':_0xf483('0x16')}};return rp(_0x4f6b8a)[_0xf483('0x17')](function(_0x1dd931){var _0x16d0ef=JSON[_0xf483('0x18')](_0x1dd931);if(_0x16d0ef[_0xf483('0x19')]){_0x2ec2de[_0xf483('0x1a')]=_0x16d0ef[_0xf483('0x19')];logger[_0xf483('0x1b')](util[_0xf483('0x1c')](_0xf483('0x1d'),_0x2ec2de[_0xf483('0x1e')],_0x2ec2de['id']));}else{logger[_0xf483('0x1f')](util[_0xf483('0x1c')](_0xf483('0x20'),_0x2ec2de[_0xf483('0x1e')],_0x2ec2de['id']),util[_0xf483('0x21')](_0x16d0ef,{'showHidden':![],'depth':null}));}return _0xfa47b9(null,_0x258dbf);})['catch'](function(_0x514ec7){logger[_0xf483('0x1f')](util[_0xf483('0x1c')](_0xf483('0x20'),_0x2ec2de[_0xf483('0x1e')],_0x2ec2de['id']),util[_0xf483('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0xfa47b9(_0x514ec7);});}else{return _0xfa47b9(null,_0x258dbf);}},'beforeUpdate':function(_0x17a99b,_0x375782,_0x2c015e){if(_0x17a99b[_0xf483('0xb')](_0xf483('0xc'))||_0x17a99b[_0xf483('0xb')](_0xf483('0xd'))||_0x17a99b[_0xf483('0xb')](_0xf483('0x14'))||_0x17a99b[_0xf483('0xb')]('clientSecret')||_0x17a99b[_0xf483('0xb')](_0xf483('0xe'))||_0x17a99b[_0xf483('0xb')](_0xf483('0xf'))){var _0x1175da,_0x263367;_0x1175da=_0x17a99b[_0xf483('0xd')];var _0x18caad=_0x1175da[_0xf483('0x22')](-0x1);if(_0x18caad==='/'||_0x18caad==='\x5c'||_0x18caad===':'){_0x1175da=_0x1175da[_0xf483('0x23')](0x0,_0x1175da[_0xf483('0x10')](_0x18caad));}switch(_0x17a99b[_0xf483('0xc')]){case'US':_0x263367=_0xf483('0x11');break;case'AU':_0x263367='https://accounts.zoho.com.au';break;case'IN':_0x263367=_0xf483('0x12');break;case'CN':_0x263367=_0xf483('0x24');break;default:_0x263367='https://accounts.zoho.eu';break;}var _0x9e952f={'method':_0xf483('0x13'),'uri':_0x263367+'/oauth/v2/token','form':{'grant_type':_0xf483('0x25'),'client_id':_0x17a99b[_0xf483('0x14')],'client_secret':_0x17a99b[_0xf483('0x15')],'redirect_uri':_0x17a99b[_0xf483('0xd')],'code':_0x17a99b[_0xf483('0xe')]},'headers':{'Content-Type':_0xf483('0x16')}};return rp(_0x9e952f)['then'](function(_0x12d73d){var _0x4aeb88=JSON[_0xf483('0x18')](_0x12d73d);if(_0x4aeb88[_0xf483('0x19')]){_0x17a99b['refreshToken']=_0x4aeb88[_0xf483('0x19')];logger[_0xf483('0x1b')](util[_0xf483('0x1c')](_0xf483('0x1d'),_0x17a99b['name'],_0x17a99b['id']));}else{logger[_0xf483('0x1f')](util[_0xf483('0x1c')](_0xf483('0x20'),_0x17a99b[_0xf483('0x1e')],_0x17a99b['id']),util[_0xf483('0x21')](_0x4aeb88,{'showHidden':![],'depth':null}));}return _0x2c015e(null,_0x375782);})[_0xf483('0x26')](function(_0x221d15){logger[_0xf483('0x1f')](util[_0xf483('0x1c')](_0xf483('0x20'),_0x17a99b['name'],_0x17a99b['id']),util[_0xf483('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x2c015e(_0x221d15);});}else{return _0x2c015e(null,_0x375782);}}}});}; \ No newline at end of file +var _0xcf70=['/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','slice','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','zone','changed','clientId','clientSecret','code','host','serverUrl','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xcf70,0xcb));var _0x0cf7=function(_0x339092,_0x256845){_0x339092=_0x339092-0x0;var _0x65377f=_0xcf70[_0x339092];return _0x65377f;};'use strict';var _=require(_0x0cf7('0x0'));var util=require(_0x0cf7('0x1'));var logger=require(_0x0cf7('0x2'))(_0x0cf7('0x3'));var moment=require(_0x0cf7('0x4'));var BPromise=require(_0x0cf7('0x5'));var rp=require(_0x0cf7('0x6'));var fs=require('fs');var path=require(_0x0cf7('0x7'));var rimraf=require(_0x0cf7('0x8'));var config=require(_0x0cf7('0x9'));var attributes=require(_0x0cf7('0xa'));var integrations=require(_0x0cf7('0xb'));module['exports']=function(_0x43b9b3,_0x1f44b8){return _0x43b9b3[_0x0cf7('0xc')](_0x0cf7('0xd'),attributes,{'tableName':_0x0cf7('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x39d391,_0x3d5157,_0x532608){if(_0x39d391['changed'](_0x0cf7('0xf'))||_0x39d391[_0x0cf7('0x10')]('serverUrl')||_0x39d391[_0x0cf7('0x10')](_0x0cf7('0x11'))||_0x39d391[_0x0cf7('0x10')](_0x0cf7('0x12'))||_0x39d391[_0x0cf7('0x10')](_0x0cf7('0x13'))||_0x39d391[_0x0cf7('0x10')](_0x0cf7('0x14'))){var _0x359fdf,_0x425f76;_0x359fdf=_0x39d391[_0x0cf7('0x15')];var _0x15b367=_0x359fdf['slice'](-0x1);if(_0x15b367==='/'||_0x15b367==='\x5c'||_0x15b367===':'){_0x359fdf=_0x359fdf[_0x0cf7('0x16')](0x0,_0x359fdf[_0x0cf7('0x17')](_0x15b367));}switch(_0x39d391[_0x0cf7('0xf')]){case'US':_0x425f76=_0x0cf7('0x18');break;case'AU':_0x425f76=_0x0cf7('0x19');break;case'IN':_0x425f76='https://accounts.zoho.in';break;case'CN':_0x425f76='https://accounts.zoho.com.cn';break;default:_0x425f76=_0x0cf7('0x1a');break;}var _0x3cfebd={'method':'POST','uri':_0x425f76+_0x0cf7('0x1b'),'form':{'grant_type':_0x0cf7('0x1c'),'client_id':_0x39d391[_0x0cf7('0x11')],'client_secret':_0x39d391['clientSecret'],'redirect_uri':_0x39d391[_0x0cf7('0x15')],'code':_0x39d391[_0x0cf7('0x13')]},'headers':{'Content-Type':_0x0cf7('0x1d')}};return rp(_0x3cfebd)[_0x0cf7('0x1e')](function(_0xdd309f){var _0x49223e=JSON[_0x0cf7('0x1f')](_0xdd309f);if(_0x49223e[_0x0cf7('0x20')]){_0x39d391[_0x0cf7('0x21')]=_0x49223e['refresh_token'];logger[_0x0cf7('0x22')](util[_0x0cf7('0x23')](_0x0cf7('0x24'),_0x39d391[_0x0cf7('0x25')],_0x39d391['id']));}else{logger[_0x0cf7('0x26')](util[_0x0cf7('0x23')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x39d391[_0x0cf7('0x25')],_0x39d391['id']),util[_0x0cf7('0x27')](_0x49223e,{'showHidden':![],'depth':null}));}return _0x532608(null,_0x3d5157);})[_0x0cf7('0x28')](function(_0x5b66bc){logger[_0x0cf7('0x26')](util[_0x0cf7('0x23')](_0x0cf7('0x29'),_0x39d391[_0x0cf7('0x25')],_0x39d391['id']),util[_0x0cf7('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x532608(_0x5b66bc);});}else{return _0x532608(null,_0x3d5157);}},'beforeUpdate':function(_0x574f0f,_0x372fd1,_0x478c78){if(_0x574f0f[_0x0cf7('0x10')](_0x0cf7('0xf'))||_0x574f0f[_0x0cf7('0x10')](_0x0cf7('0x15'))||_0x574f0f[_0x0cf7('0x10')]('clientId')||_0x574f0f['changed'](_0x0cf7('0x12'))||_0x574f0f[_0x0cf7('0x10')](_0x0cf7('0x13'))||_0x574f0f['changed'](_0x0cf7('0x14'))){var _0x3ceae8,_0x323b31;_0x3ceae8=_0x574f0f[_0x0cf7('0x15')];var _0x528e45=_0x3ceae8[_0x0cf7('0x2a')](-0x1);if(_0x528e45==='/'||_0x528e45==='\x5c'||_0x528e45===':'){_0x3ceae8=_0x3ceae8[_0x0cf7('0x16')](0x0,_0x3ceae8[_0x0cf7('0x17')](_0x528e45));}switch(_0x574f0f[_0x0cf7('0xf')]){case'US':_0x323b31=_0x0cf7('0x18');break;case'AU':_0x323b31=_0x0cf7('0x19');break;case'IN':_0x323b31=_0x0cf7('0x2b');break;case'CN':_0x323b31=_0x0cf7('0x2c');break;default:_0x323b31=_0x0cf7('0x1a');break;}var _0x2cf776={'method':_0x0cf7('0x2d'),'uri':_0x323b31+_0x0cf7('0x1b'),'form':{'grant_type':_0x0cf7('0x1c'),'client_id':_0x574f0f['clientId'],'client_secret':_0x574f0f[_0x0cf7('0x12')],'redirect_uri':_0x574f0f[_0x0cf7('0x15')],'code':_0x574f0f[_0x0cf7('0x13')]},'headers':{'Content-Type':_0x0cf7('0x1d')}};return rp(_0x2cf776)['then'](function(_0x2864d2){var _0x50a7e2=JSON['parse'](_0x2864d2);if(_0x50a7e2[_0x0cf7('0x20')]){_0x574f0f['refreshToken']=_0x50a7e2[_0x0cf7('0x20')];logger[_0x0cf7('0x22')](util['format'](_0x0cf7('0x24'),_0x574f0f[_0x0cf7('0x25')],_0x574f0f['id']));}else{logger[_0x0cf7('0x26')](util[_0x0cf7('0x23')](_0x0cf7('0x29'),_0x574f0f[_0x0cf7('0x25')],_0x574f0f['id']),util[_0x0cf7('0x27')](_0x50a7e2,{'showHidden':![],'depth':null}));}return _0x478c78(null,_0x372fd1);})[_0x0cf7('0x28')](function(_0x5dd534){logger[_0x0cf7('0x26')](util[_0x0cf7('0x23')](_0x0cf7('0x29'),_0x574f0f[_0x0cf7('0x25')],_0x574f0f['id']),util[_0x0cf7('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x478c78(_0x5dd534);});}else{return _0x478c78(null,_0x372fd1);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 63e287f..84f1c31 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 _0xfbbb=['jayson/promise','http','request','then','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','ZohoAccount,\x20%s,\x20%s','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','where','attributes','limit','include','map','model','stringify','find','raw','ShowZohoAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5805d7,_0x3d584a){var _0x170fe4=function(_0x3b9b73){while(--_0x3b9b73){_0x5805d7['push'](_0x5805d7['shift']());}};_0x170fe4(++_0x3d584a);}(_0xfbbb,0x1b3));var _0xbfbb=function(_0x532972,_0x23f2da){_0x532972=_0x532972-0x0;var _0x308435=_0xfbbb[_0x532972];return _0x308435;};'use strict';var _=require(_0xbfbb('0x0'));var util=require(_0xbfbb('0x1'));var moment=require(_0xbfbb('0x2'));var BPromise=require(_0xbfbb('0x3'));var rs=require(_0xbfbb('0x4'));var fs=require('fs');var Redis=require(_0xbfbb('0x5'));var db=require(_0xbfbb('0x6'))['db'];var utils=require(_0xbfbb('0x7'));var logger=require(_0xbfbb('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbfbb('0x9'));var client=jayson['client'][_0xbfbb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16c6cc,_0x16a41c,_0x5a69b3){return new BPromise(function(_0x1f2c31,_0x3260a7){return client[_0xbfbb('0xb')](_0x16c6cc,_0x5a69b3)[_0xbfbb('0xc')](function(_0x1baefa){logger[_0xbfbb('0xd')]('ZohoAccount,\x20%s,\x20%s',_0x16a41c,_0xbfbb('0xe'));logger[_0xbfbb('0xf')](_0xbfbb('0x10'),_0x16a41c,_0xbfbb('0xe'),JSON['stringify'](_0x1baefa));if(_0x1baefa[_0xbfbb('0x11')]){if(_0x1baefa[_0xbfbb('0x11')][_0xbfbb('0x12')]===0x1f4){logger[_0xbfbb('0x11')](_0xbfbb('0x13'),_0x16a41c,_0x1baefa[_0xbfbb('0x11')][_0xbfbb('0x14')]);return _0x3260a7(_0x1baefa[_0xbfbb('0x11')]['message']);}logger[_0xbfbb('0x11')](_0xbfbb('0x13'),_0x16a41c,_0x1baefa[_0xbfbb('0x11')][_0xbfbb('0x14')]);return _0x1f2c31(_0x1baefa[_0xbfbb('0x11')]['message']);}else{logger[_0xbfbb('0xd')](_0xbfbb('0x13'),_0x16a41c,_0xbfbb('0xe'));_0x1f2c31(_0x1baefa[_0xbfbb('0x15')][_0xbfbb('0x14')]);}})[_0xbfbb('0x16')](function(_0x2f49e5){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x16a41c,_0x2f49e5);_0x3260a7(_0x2f49e5);});});}exports[_0xbfbb('0x17')]=function(_0x4be5df){var _0xc18041=this;return new Promise(function(_0x4834a9,_0x20337e){return db[_0xbfbb('0x18')][_0xbfbb('0x19')]({'raw':_0x4be5df[_0xbfbb('0x1a')]?_0x4be5df[_0xbfbb('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x4be5df[_0xbfbb('0x1a')]?_0x4be5df['options'][_0xbfbb('0x1b')]||null:null,'attributes':_0x4be5df[_0xbfbb('0x1a')]?_0x4be5df[_0xbfbb('0x1a')][_0xbfbb('0x1c')]||null:null,'limit':_0x4be5df[_0xbfbb('0x1a')]?_0x4be5df[_0xbfbb('0x1a')][_0xbfbb('0x1d')]||null:null,'include':_0x4be5df[_0xbfbb('0x1a')]?_0x4be5df['options'][_0xbfbb('0x1e')]?_[_0xbfbb('0x1f')](_0x4be5df['options'][_0xbfbb('0x1e')],function(_0x15e362){return{'model':db[_0x15e362[_0xbfbb('0x20')]],'as':_0x15e362['as'],'attributes':_0x15e362[_0xbfbb('0x1c')],'include':_0x15e362['include']?_[_0xbfbb('0x1f')](_0x15e362['include'],function(_0x151342){return{'model':db[_0x151342[_0xbfbb('0x20')]],'as':_0x151342['as'],'attributes':_0x151342[_0xbfbb('0x1c')],'include':_0x151342[_0xbfbb('0x1e')]?_[_0xbfbb('0x1f')](_0x151342[_0xbfbb('0x1e')],function(_0x190640){return{'model':db[_0x190640[_0xbfbb('0x20')]],'as':_0x190640['as'],'attributes':_0x190640[_0xbfbb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xbfbb('0xc')](function(_0x217750){logger[_0xbfbb('0xd')](_0xbfbb('0x17'),_0x4be5df);logger[_0xbfbb('0xf')]('GetZohoAccount',_0x4be5df,JSON[_0xbfbb('0x21')](_0x217750));_0x4834a9(_0x217750);})[_0xbfbb('0x16')](function(_0x21f507){logger[_0xbfbb('0x11')]('GetZohoAccount',_0x21f507[_0xbfbb('0x14')],_0x4be5df);_0x20337e(_0xc18041[_0xbfbb('0x11')](0x1f4,_0x21f507[_0xbfbb('0x14')]));});});};exports['ShowZohoAccount']=function(_0x1a5afe){var _0x37976b=this;return new Promise(function(_0x1e59db,_0x1d5f19){return db[_0xbfbb('0x18')][_0xbfbb('0x22')]({'raw':_0x1a5afe[_0xbfbb('0x1a')]?_0x1a5afe[_0xbfbb('0x1a')][_0xbfbb('0x23')]===undefined?!![]:![]:!![],'where':_0x1a5afe['options']?_0x1a5afe['options'][_0xbfbb('0x1b')]||null:null,'attributes':_0x1a5afe[_0xbfbb('0x1a')]?_0x1a5afe[_0xbfbb('0x1a')]['attributes']||null:null,'include':_0x1a5afe[_0xbfbb('0x1a')]?_0x1a5afe[_0xbfbb('0x1a')][_0xbfbb('0x1e')]?_[_0xbfbb('0x1f')](_0x1a5afe['options'][_0xbfbb('0x1e')],function(_0x222476){return{'model':db[_0x222476['model']],'as':_0x222476['as'],'attributes':_0x222476[_0xbfbb('0x1c')],'include':_0x222476[_0xbfbb('0x1e')]?_[_0xbfbb('0x1f')](_0x222476['include'],function(_0x4cf704){return{'model':db[_0x4cf704[_0xbfbb('0x20')]],'as':_0x4cf704['as'],'attributes':_0x4cf704[_0xbfbb('0x1c')],'include':_0x4cf704['include']?_[_0xbfbb('0x1f')](_0x4cf704[_0xbfbb('0x1e')],function(_0x49a9c9){return{'model':db[_0x49a9c9[_0xbfbb('0x20')]],'as':_0x49a9c9['as'],'attributes':_0x49a9c9['attributes']};}):[]};}):[]};}):[]:[]})[_0xbfbb('0xc')](function(_0x4afe98){logger[_0xbfbb('0xd')]('ShowZohoAccount',_0x1a5afe);logger[_0xbfbb('0xf')](_0xbfbb('0x24'),_0x1a5afe,JSON[_0xbfbb('0x21')](_0x4afe98));_0x1e59db(_0x4afe98);})[_0xbfbb('0x16')](function(_0x132f32){logger[_0xbfbb('0x11')]('ShowZohoAccount',_0x132f32[_0xbfbb('0x14')],_0x1a5afe);_0x1d5f19(_0x37976b[_0xbfbb('0x11')](0x1f4,_0x132f32[_0xbfbb('0x14')]));});});}; \ No newline at end of file +var _0xd0da=['ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetZohoAccount','ZohoAccount','options','raw','where','include','map','model','attributes','ShowZohoAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x9f0a1e,_0x3b9694){var _0x6d06ec=function(_0x310f39){while(--_0x310f39){_0x9f0a1e['push'](_0x9f0a1e['shift']());}};_0x6d06ec(++_0x3b9694);}(_0xd0da,0x1b1));var _0xad0d=function(_0x3cec8c,_0x3f6c1d){_0x3cec8c=_0x3cec8c-0x0;var _0x38032e=_0xd0da[_0x3cec8c];return _0x38032e;};'use strict';var _=require(_0xad0d('0x0'));var util=require(_0xad0d('0x1'));var moment=require(_0xad0d('0x2'));var BPromise=require(_0xad0d('0x3'));var rs=require(_0xad0d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad0d('0x5'))['db'];var utils=require(_0xad0d('0x6'));var logger=require(_0xad0d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xad0d('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xc14f42,_0xa95863,_0xcc6f55){return new BPromise(function(_0xc7e517,_0x5b99a9){return client[_0xad0d('0x9')](_0xc14f42,_0xcc6f55)[_0xad0d('0xa')](function(_0x40e717){logger[_0xad0d('0xb')](_0xad0d('0xc'),_0xa95863,_0xad0d('0xd'));logger[_0xad0d('0xe')](_0xad0d('0xf'),_0xa95863,_0xad0d('0xd'),JSON[_0xad0d('0x10')](_0x40e717));if(_0x40e717[_0xad0d('0x11')]){if(_0x40e717[_0xad0d('0x11')][_0xad0d('0x12')]===0x1f4){logger['error'](_0xad0d('0xc'),_0xa95863,_0x40e717[_0xad0d('0x11')]['message']);return _0x5b99a9(_0x40e717[_0xad0d('0x11')][_0xad0d('0x13')]);}logger['error'](_0xad0d('0xc'),_0xa95863,_0x40e717[_0xad0d('0x11')]['message']);return _0xc7e517(_0x40e717[_0xad0d('0x11')][_0xad0d('0x13')]);}else{logger['info'](_0xad0d('0xc'),_0xa95863,'request\x20sent');_0xc7e517(_0x40e717['result'][_0xad0d('0x13')]);}})[_0xad0d('0x14')](function(_0x1cde0d){logger['error'](_0xad0d('0xc'),_0xa95863,_0x1cde0d);_0x5b99a9(_0x1cde0d);});});}exports[_0xad0d('0x15')]=function(_0x5862bd){var _0xb6c032=this;return new Promise(function(_0x49891e,_0x5c0634){return db[_0xad0d('0x16')]['findAll']({'raw':_0x5862bd[_0xad0d('0x17')]?_0x5862bd[_0xad0d('0x17')][_0xad0d('0x18')]===undefined?!![]:![]:!![],'where':_0x5862bd['options']?_0x5862bd['options'][_0xad0d('0x19')]||null:null,'attributes':_0x5862bd[_0xad0d('0x17')]?_0x5862bd[_0xad0d('0x17')]['attributes']||null:null,'limit':_0x5862bd['options']?_0x5862bd[_0xad0d('0x17')]['limit']||null:null,'include':_0x5862bd[_0xad0d('0x17')]?_0x5862bd[_0xad0d('0x17')][_0xad0d('0x1a')]?_[_0xad0d('0x1b')](_0x5862bd[_0xad0d('0x17')][_0xad0d('0x1a')],function(_0x59efec){return{'model':db[_0x59efec[_0xad0d('0x1c')]],'as':_0x59efec['as'],'attributes':_0x59efec[_0xad0d('0x1d')],'include':_0x59efec['include']?_['map'](_0x59efec[_0xad0d('0x1a')],function(_0x3e510e){return{'model':db[_0x3e510e[_0xad0d('0x1c')]],'as':_0x3e510e['as'],'attributes':_0x3e510e['attributes'],'include':_0x3e510e[_0xad0d('0x1a')]?_['map'](_0x3e510e[_0xad0d('0x1a')],function(_0xddf172){return{'model':db[_0xddf172['model']],'as':_0xddf172['as'],'attributes':_0xddf172['attributes']};}):[]};}):[]};}):[]:[]})[_0xad0d('0xa')](function(_0x434221){logger[_0xad0d('0xb')]('GetZohoAccount',_0x5862bd);logger[_0xad0d('0xe')](_0xad0d('0x15'),_0x5862bd,JSON[_0xad0d('0x10')](_0x434221));_0x49891e(_0x434221);})['catch'](function(_0x17a8e4){logger[_0xad0d('0x11')]('GetZohoAccount',_0x17a8e4[_0xad0d('0x13')],_0x5862bd);_0x5c0634(_0xb6c032[_0xad0d('0x11')](0x1f4,_0x17a8e4[_0xad0d('0x13')]));});});};exports[_0xad0d('0x1e')]=function(_0x185b9e){var _0x36c0f9=this;return new Promise(function(_0x299752,_0x4372e3){return db[_0xad0d('0x16')][_0xad0d('0x1f')]({'raw':_0x185b9e[_0xad0d('0x17')]?_0x185b9e['options'][_0xad0d('0x18')]===undefined?!![]:![]:!![],'where':_0x185b9e['options']?_0x185b9e[_0xad0d('0x17')][_0xad0d('0x19')]||null:null,'attributes':_0x185b9e[_0xad0d('0x17')]?_0x185b9e[_0xad0d('0x17')]['attributes']||null:null,'include':_0x185b9e[_0xad0d('0x17')]?_0x185b9e[_0xad0d('0x17')]['include']?_[_0xad0d('0x1b')](_0x185b9e[_0xad0d('0x17')][_0xad0d('0x1a')],function(_0x24418e){return{'model':db[_0x24418e[_0xad0d('0x1c')]],'as':_0x24418e['as'],'attributes':_0x24418e['attributes'],'include':_0x24418e[_0xad0d('0x1a')]?_[_0xad0d('0x1b')](_0x24418e[_0xad0d('0x1a')],function(_0x1adf56){return{'model':db[_0x1adf56['model']],'as':_0x1adf56['as'],'attributes':_0x1adf56[_0xad0d('0x1d')],'include':_0x1adf56['include']?_[_0xad0d('0x1b')](_0x1adf56[_0xad0d('0x1a')],function(_0xf762ac){return{'model':db[_0xf762ac['model']],'as':_0xf762ac['as'],'attributes':_0xf762ac[_0xad0d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xad0d('0xa')](function(_0x172192){logger[_0xad0d('0xb')](_0xad0d('0x1e'),_0x185b9e);logger[_0xad0d('0xe')](_0xad0d('0x1e'),_0x185b9e,JSON[_0xad0d('0x10')](_0x172192));_0x299752(_0x172192);})['catch'](function(_0x351217){logger[_0xad0d('0x11')](_0xad0d('0x1e'),_0x351217[_0xad0d('0x13')],_0x185b9e);_0x4372e3(_0x36c0f9['error'](0x1f4,_0x351217[_0xad0d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index cfbe4df..61f7682 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 _0x2b77=['/:id/descriptions','getDescriptions','post','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects'];(function(_0x505088,_0x23a321){var _0x3eb2c9=function(_0x2fcf8d){while(--_0x2fcf8d){_0x505088['push'](_0x505088['shift']());}};_0x3eb2c9(++_0x23a321);}(_0x2b77,0x126));var _0x72b7=function(_0x3e6b83,_0x1c9e7e){_0x3e6b83=_0x3e6b83-0x0;var _0x28a190=_0x2b77[_0x3e6b83];return _0x28a190;};'use strict';var multer=require(_0x72b7('0x0'));var util=require(_0x72b7('0x1'));var path=require('path');var timeout=require(_0x72b7('0x2'));var express=require(_0x72b7('0x3'));var router=express[_0x72b7('0x4')]();var fs_extra=require(_0x72b7('0x5'));var auth=require(_0x72b7('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x72b7('0x7'));router[_0x72b7('0x8')]('/',auth[_0x72b7('0x9')](),controller[_0x72b7('0xa')]);router[_0x72b7('0x8')](_0x72b7('0xb'),auth[_0x72b7('0x9')](),controller[_0x72b7('0xc')]);router[_0x72b7('0x8')]('/:id/fields',auth[_0x72b7('0x9')](),controller['getFields']);router['get'](_0x72b7('0xd'),auth[_0x72b7('0x9')](),controller['getSubjects']);router[_0x72b7('0x8')](_0x72b7('0xe'),auth[_0x72b7('0x9')](),controller[_0x72b7('0xf')]);router[_0x72b7('0x10')]('/',auth[_0x72b7('0x9')](),controller[_0x72b7('0x11')]);router[_0x72b7('0x12')]('/:id',auth[_0x72b7('0x9')](),controller[_0x72b7('0x13')]);router[_0x72b7('0x14')](_0x72b7('0xb'),auth[_0x72b7('0x9')](),controller['destroy']);module[_0x72b7('0x15')]=router; \ No newline at end of file +var _0x79dc=['../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2548f3,_0x10da06){var _0x31062d=function(_0x18a5ce){while(--_0x18a5ce){_0x2548f3['push'](_0x2548f3['shift']());}};_0x31062d(++_0x10da06);}(_0x79dc,0xd9));var _0xc79d=function(_0x2f7a41,_0x3f4f95){_0x2f7a41=_0x2f7a41-0x0;var _0x45acc=_0x79dc[_0x2f7a41];return _0x45acc;};'use strict';var multer=require(_0xc79d('0x0'));var util=require(_0xc79d('0x1'));var path=require(_0xc79d('0x2'));var timeout=require(_0xc79d('0x3'));var express=require(_0xc79d('0x4'));var router=express[_0xc79d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc79d('0x6'));var interaction=require(_0xc79d('0x7'));var config=require(_0xc79d('0x8'));var controller=require(_0xc79d('0x9'));router[_0xc79d('0xa')]('/',auth[_0xc79d('0xb')](),controller[_0xc79d('0xc')]);router[_0xc79d('0xa')]('/:id',auth[_0xc79d('0xb')](),controller[_0xc79d('0xd')]);router[_0xc79d('0xa')](_0xc79d('0xe'),auth['isAuthenticated'](),controller[_0xc79d('0xf')]);router[_0xc79d('0xa')](_0xc79d('0x10'),auth['isAuthenticated'](),controller[_0xc79d('0x11')]);router[_0xc79d('0xa')](_0xc79d('0x12'),auth[_0xc79d('0xb')](),controller[_0xc79d('0x13')]);router[_0xc79d('0x14')]('/',auth[_0xc79d('0xb')](),controller[_0xc79d('0x15')]);router[_0xc79d('0x16')]('/:id',auth[_0xc79d('0xb')](),controller[_0xc79d('0x17')]);router[_0xc79d('0x18')](_0xc79d('0x19'),auth[_0xc79d('0xb')](),controller[_0xc79d('0x1a')]);module[_0xc79d('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 84a01b4..577634f 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 _0x76cb=['lead','ENUM','contact','sequelize','exports','STRING','nothing'];(function(_0x1b7e79,_0x161ca9){var _0x48217d=function(_0x2917e6){while(--_0x2917e6){_0x1b7e79['push'](_0x1b7e79['shift']());}};_0x48217d(++_0x161ca9);}(_0x76cb,0x129));var _0xb76c=function(_0x2ec5b9,_0x56e0a3){_0x2ec5b9=_0x2ec5b9-0x0;var _0x10dcea=_0x76cb[_0x2ec5b9];return _0x10dcea;};'use strict';var Sequelize=require(_0xb76c('0x0'));module[_0xb76c('0x1')]={'name':{'type':Sequelize[_0xb76c('0x2')]},'moduleCreate':{'type':Sequelize['ENUM']('lead','contact',_0xb76c('0x3')),'defaultValue':_0xb76c('0x4')},'moduleSearch':{'type':Sequelize[_0xb76c('0x5')]('contact_lead',_0xb76c('0x6'),_0xb76c('0x4')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xb76c('0x2')]}}; \ No newline at end of file +var _0x77ec=['exports','STRING','ENUM','lead','contact','nothing','contact_lead','sequelize'];(function(_0xb006a6,_0x20a9e6){var _0x46521c=function(_0x532b5c){while(--_0x532b5c){_0xb006a6['push'](_0xb006a6['shift']());}};_0x46521c(++_0x20a9e6);}(_0x77ec,0x1cf));var _0xc77e=function(_0xeda26c,_0x58c4ec){_0xeda26c=_0xeda26c-0x0;var _0x313e4d=_0x77ec[_0xeda26c];return _0x313e4d;};'use strict';var Sequelize=require(_0xc77e('0x0'));module[_0xc77e('0x1')]={'name':{'type':Sequelize[_0xc77e('0x2')]},'moduleCreate':{'type':Sequelize[_0xc77e('0x3')](_0xc77e('0x4'),_0xc77e('0x5'),_0xc77e('0x6')),'defaultValue':_0xc77e('0x4')},'moduleSearch':{'type':Sequelize[_0xc77e('0x3')](_0xc77e('0x7'),'contact','lead'),'defaultValue':_0xc77e('0x7')},'description':{'type':Sequelize[_0xc77e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index c6c91d4..ca6827e 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 _0x70bf=['save','update','then','destroy','name','send','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','filter','options','count','includeAll','include','rows','catch','show','params','create','body','find','getFields','findOne','ZohoField','getSubjects','getDescriptions','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply'];(function(_0xff0a5b,_0x4d6813){var _0x3ca6cd=function(_0x228129){while(--_0x228129){_0xff0a5b['push'](_0xff0a5b['shift']());}};_0x3ca6cd(++_0x4d6813);}(_0x70bf,0xcd));var _0xf70b=function(_0x1d4611,_0x31e791){_0x1d4611=_0x1d4611-0x0;var _0x8873f2=_0x70bf[_0x1d4611];return _0x8873f2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf70b('0x0'));var jsonpatch=require(_0xf70b('0x1'));var rp=require('request-promise');var moment=require(_0xf70b('0x2'));var BPromise=require(_0xf70b('0x3'));var Mustache=require(_0xf70b('0x4'));var util=require(_0xf70b('0x5'));var path=require(_0xf70b('0x6'));var sox=require('sox');var csv=require(_0xf70b('0x7'));var ejs=require(_0xf70b('0x8'));var fs=require('fs');var fs_extra=require(_0xf70b('0x9'));var _=require(_0xf70b('0xa'));var squel=require(_0xf70b('0xb'));var crypto=require(_0xf70b('0xc'));var jsforce=require(_0xf70b('0xd'));var deskjs=require(_0xf70b('0xe'));var toCsv=require(_0xf70b('0x7'));var querystring=require(_0xf70b('0xf'));var Papa=require(_0xf70b('0x10'));var Redis=require(_0xf70b('0x11'));var authService=require(_0xf70b('0x12'));var qs=require(_0xf70b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf70b('0x14'));var logger=require(_0xf70b('0x15'))(_0xf70b('0x16'));var utils=require(_0xf70b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xf70b('0x18'));var db=require(_0xf70b('0x19'))['db'];function respondWithStatusCode(_0x4e4744,_0x31bb4b){_0x31bb4b=_0x31bb4b||0xcc;return function(_0x256451){if(_0x256451){return _0x4e4744[_0xf70b('0x1a')](_0x31bb4b);}return _0x4e4744['status'](_0x31bb4b)['end']();};}function respondWithResult(_0x2ef3b6,_0x174ebe){_0x174ebe=_0x174ebe||0xc8;return function(_0x154716){if(_0x154716){return _0x2ef3b6[_0xf70b('0x1b')](_0x174ebe)[_0xf70b('0x1c')](_0x154716);}};}function respondWithFilteredResult(_0x1c236d,_0x448fe6){return function(_0x15e7d1){if(_0x15e7d1){var _0x10d592=typeof _0x448fe6[_0xf70b('0x1d')]===_0xf70b('0x1e')&&typeof _0x448fe6[_0xf70b('0x1f')]===_0xf70b('0x1e');var _0x5a596d=_0x15e7d1['count'];var _0x14ab6b=_0x10d592?0x0:_0x448fe6['offset'];var _0x1a1235=_0x10d592?_0x15e7d1['count']:_0x448fe6[_0xf70b('0x1d')]+_0x448fe6[_0xf70b('0x1f')];var _0x1edccf;if(_0x1a1235>=_0x5a596d){_0x1a1235=_0x5a596d;_0x1edccf=0xc8;}else{_0x1edccf=0xce;}_0x1c236d['status'](_0x1edccf);return _0x1c236d[_0xf70b('0x20')](_0xf70b('0x21'),_0x14ab6b+'-'+_0x1a1235+'/'+_0x5a596d)[_0xf70b('0x1c')](_0x15e7d1);}return null;};}function patchUpdates(_0x43371e){return function(_0x5f3e4a){try{jsonpatch[_0xf70b('0x22')](_0x5f3e4a,_0x43371e,!![]);}catch(_0x1c5f1c){return BPromise['reject'](_0x1c5f1c);}return _0x5f3e4a[_0xf70b('0x23')]();};}function saveUpdates(_0x316838,_0x5f1814){return function(_0x1aecd3){if(_0x1aecd3){return _0x1aecd3[_0xf70b('0x24')](_0x316838)[_0xf70b('0x25')](function(_0x1cb294){return _0x1cb294;});}return null;};}function removeEntity(_0x1a3cf5,_0x3eed9f){return function(_0x5af2cd){if(_0x5af2cd){return _0x5af2cd[_0xf70b('0x26')]()[_0xf70b('0x25')](function(){_0x1a3cf5[_0xf70b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3487b7,_0x533dd1){return function(_0x23a0eb){if(!_0x23a0eb){_0x3487b7[_0xf70b('0x1a')](0x194);}return _0x23a0eb;};}function handleError(_0x5a274f,_0x4ae4e0){_0x4ae4e0=_0x4ae4e0||0x1f4;return function(_0x1dd8a4){logger['error'](_0x1dd8a4['stack']);if(_0x1dd8a4[_0xf70b('0x27')]){delete _0x1dd8a4[_0xf70b('0x27')];}_0x5a274f[_0xf70b('0x1b')](_0x4ae4e0)[_0xf70b('0x28')](_0x1dd8a4);};}exports['index']=function(_0xfeab53,_0x18d9a1){var _0x4a2b5e={},_0x9bdb8f={},_0x385822={'count':0x0,'rows':[]};var _0x4ad2ba=_['map'](db[_0xf70b('0x29')][_0xf70b('0x2a')],function(_0x10680a){return{'name':_0x10680a[_0xf70b('0x2b')],'type':_0x10680a[_0xf70b('0x2c')][_0xf70b('0x2d')]};});_0x9bdb8f[_0xf70b('0x2e')]=_['map'](_0x4ad2ba,'name');_0x9bdb8f[_0xf70b('0x2f')]=_[_0xf70b('0x30')](_0xfeab53[_0xf70b('0x2f')]);_0x9bdb8f[_0xf70b('0x31')]=_[_0xf70b('0x32')](_0x9bdb8f[_0xf70b('0x2e')],_0x9bdb8f[_0xf70b('0x2f')]);_0x4a2b5e['attributes']=_[_0xf70b('0x32')](_0x9bdb8f['model'],qs[_0xf70b('0x33')](_0xfeab53[_0xf70b('0x2f')]['fields']));_0x4a2b5e['attributes']=_0x4a2b5e['attributes'][_0xf70b('0x34')]?_0x4a2b5e[_0xf70b('0x35')]:_0x9bdb8f[_0xf70b('0x2e')];if(!_0xfeab53[_0xf70b('0x2f')][_0xf70b('0x36')](_0xf70b('0x37'))){_0x4a2b5e[_0xf70b('0x1f')]=qs[_0xf70b('0x1f')](_0xfeab53[_0xf70b('0x2f')][_0xf70b('0x1f')]);_0x4a2b5e['offset']=qs[_0xf70b('0x1d')](_0xfeab53['query'][_0xf70b('0x1d')]);}_0x4a2b5e[_0xf70b('0x38')]=qs[_0xf70b('0x39')](_0xfeab53[_0xf70b('0x2f')][_0xf70b('0x39')]);_0x4a2b5e[_0xf70b('0x3a')]=qs[_0xf70b('0x31')](_[_0xf70b('0x3b')](_0xfeab53[_0xf70b('0x2f')],_0x9bdb8f['filters']),_0x4ad2ba);if(_0xfeab53['query']['filter']){_0x4a2b5e['where']=_[_0xf70b('0x3c')](_0x4a2b5e[_0xf70b('0x3a')],{'$or':_[_0xf70b('0x3d')](_0x4ad2ba,function(_0x5cbee3){if(_0x5cbee3[_0xf70b('0x2c')]!==_0xf70b('0x3e')){var _0x5f45c2={};_0x5f45c2[_0x5cbee3[_0xf70b('0x27')]]={'$like':'%'+_0xfeab53[_0xf70b('0x2f')][_0xf70b('0x3f')]+'%'};return _0x5f45c2;}})});}_0x4a2b5e=_['merge']({},_0x4a2b5e,_0xfeab53[_0xf70b('0x40')]);var _0x370180={'where':_0x4a2b5e[_0xf70b('0x3a')]};return db[_0xf70b('0x29')][_0xf70b('0x41')](_0x370180)[_0xf70b('0x25')](function(_0x46a9a4){_0x385822[_0xf70b('0x41')]=_0x46a9a4;if(_0xfeab53[_0xf70b('0x2f')][_0xf70b('0x42')]){_0x4a2b5e[_0xf70b('0x43')]=[{'all':!![]}];}return db[_0xf70b('0x29')]['findAll'](_0x4a2b5e);})[_0xf70b('0x25')](function(_0x3723f2){_0x385822[_0xf70b('0x44')]=_0x3723f2;return _0x385822;})[_0xf70b('0x25')](respondWithFilteredResult(_0x18d9a1,_0x4a2b5e))[_0xf70b('0x45')](handleError(_0x18d9a1,null));};exports[_0xf70b('0x46')]=function(_0x4d16f2,_0x4962b1){var _0xbda940={'raw':![],'where':{'id':_0x4d16f2[_0xf70b('0x47')]['id']}},_0xc31d6d={};_0xc31d6d['model']=_[_0xf70b('0x30')](db[_0xf70b('0x29')][_0xf70b('0x2a')]);_0xc31d6d[_0xf70b('0x2f')]=_[_0xf70b('0x30')](_0x4d16f2[_0xf70b('0x2f')]);_0xc31d6d[_0xf70b('0x31')]=_[_0xf70b('0x32')](_0xc31d6d[_0xf70b('0x2e')],_0xc31d6d['query']);_0xbda940[_0xf70b('0x35')]=_['intersection'](_0xc31d6d[_0xf70b('0x2e')],qs[_0xf70b('0x33')](_0x4d16f2[_0xf70b('0x2f')][_0xf70b('0x33')]));_0xbda940[_0xf70b('0x35')]=_0xbda940[_0xf70b('0x35')][_0xf70b('0x34')]?_0xbda940[_0xf70b('0x35')]:_0xc31d6d['model'];if(_0x4d16f2[_0xf70b('0x2f')][_0xf70b('0x42')]){_0xbda940[_0xf70b('0x43')]=[{'all':!![]}];}_0xbda940=_[_0xf70b('0x3c')]({},_0xbda940,_0x4d16f2['options']);return db[_0xf70b('0x29')]['find'](_0xbda940)['then'](handleEntityNotFound(_0x4962b1,null))[_0xf70b('0x25')](respondWithResult(_0x4962b1,null))[_0xf70b('0x45')](handleError(_0x4962b1,null));};exports[_0xf70b('0x48')]=function(_0x1fe327,_0x23c0e7){return db[_0xf70b('0x29')]['create'](_0x1fe327[_0xf70b('0x49')],{})[_0xf70b('0x25')](respondWithResult(_0x23c0e7,0xc9))[_0xf70b('0x45')](handleError(_0x23c0e7,null));};exports['update']=function(_0x13107c,_0x3323f7){if(_0x13107c[_0xf70b('0x49')]['id']){delete _0x13107c[_0xf70b('0x49')]['id'];}return db['ZohoConfiguration'][_0xf70b('0x4a')]({'where':{'id':_0x13107c[_0xf70b('0x47')]['id']}})['then'](handleEntityNotFound(_0x3323f7,null))['then'](saveUpdates(_0x13107c[_0xf70b('0x49')],null))['then'](respondWithResult(_0x3323f7,null))[_0xf70b('0x45')](handleError(_0x3323f7,null));};exports[_0xf70b('0x26')]=function(_0x15bbd8,_0x441899){return db[_0xf70b('0x29')]['find']({'where':{'id':_0x15bbd8[_0xf70b('0x47')]['id']}})['then'](handleEntityNotFound(_0x441899,null))[_0xf70b('0x25')](removeEntity(_0x441899,null))[_0xf70b('0x45')](handleError(_0x441899,null));};exports[_0xf70b('0x4b')]=function(_0xa49dc4,_0xffa20b,_0x360191){var _0x40e016={};var _0x44e9ba={};var _0xb21298;var _0x257795;return db[_0xf70b('0x29')][_0xf70b('0x4c')]({'where':{'id':_0xa49dc4[_0xf70b('0x47')]['id']}})[_0xf70b('0x25')](handleEntityNotFound(_0xffa20b,null))[_0xf70b('0x25')](function(_0x11ce88){if(_0x11ce88){_0xb21298=_0x11ce88;_0x44e9ba[_0xf70b('0x2e')]=_[_0xf70b('0x30')](db[_0xf70b('0x4d')][_0xf70b('0x2a')]);_0x44e9ba[_0xf70b('0x2f')]=_[_0xf70b('0x30')](_0xa49dc4['query']);_0x44e9ba[_0xf70b('0x31')]=_['intersection'](_0x44e9ba[_0xf70b('0x2e')],_0x44e9ba[_0xf70b('0x2f')]);_0x40e016[_0xf70b('0x35')]=_[_0xf70b('0x32')](_0x44e9ba[_0xf70b('0x2e')],qs[_0xf70b('0x33')](_0xa49dc4['query'][_0xf70b('0x33')]));_0x40e016[_0xf70b('0x35')]=_0x40e016[_0xf70b('0x35')]['length']?_0x40e016[_0xf70b('0x35')]:_0x44e9ba[_0xf70b('0x2e')];_0x40e016[_0xf70b('0x38')]=qs[_0xf70b('0x39')](_0xa49dc4[_0xf70b('0x2f')]['sort']);_0x40e016[_0xf70b('0x3a')]=qs[_0xf70b('0x31')](_[_0xf70b('0x3b')](_0xa49dc4[_0xf70b('0x2f')],_0x44e9ba['filters']));if(_0xa49dc4[_0xf70b('0x2f')][_0xf70b('0x3f')]){_0x40e016[_0xf70b('0x3a')]=_[_0xf70b('0x3c')](_0x40e016[_0xf70b('0x3a')],{'$or':_['map'](_0x40e016[_0xf70b('0x35')],function(_0x361537){var _0x2bd873={};_0x2bd873[_0x361537]={'$like':'%'+_0xa49dc4[_0xf70b('0x2f')][_0xf70b('0x3f')]+'%'};return _0x2bd873;})});}_0x40e016=_[_0xf70b('0x3c')]({},_0x40e016,_0xa49dc4[_0xf70b('0x40')]);return _0xb21298[_0xf70b('0x4b')](_0x40e016);}})[_0xf70b('0x25')](function(_0x223da7){if(_0x223da7){_0x257795=_0x223da7[_0xf70b('0x34')];if(!_0xa49dc4[_0xf70b('0x2f')][_0xf70b('0x36')](_0xf70b('0x37'))){_0x40e016[_0xf70b('0x1f')]=qs[_0xf70b('0x1f')](_0xa49dc4[_0xf70b('0x2f')][_0xf70b('0x1f')]);_0x40e016['offset']=qs[_0xf70b('0x1d')](_0xa49dc4[_0xf70b('0x2f')][_0xf70b('0x1d')]);}return _0xb21298[_0xf70b('0x4b')](_0x40e016);}})[_0xf70b('0x25')](function(_0x1f1ad2){if(_0x1f1ad2){return _0x1f1ad2?{'count':_0x257795,'rows':_0x1f1ad2}:null;}})[_0xf70b('0x25')](respondWithResult(_0xffa20b,null))['catch'](handleError(_0xffa20b,null));};exports[_0xf70b('0x4e')]=function(_0x4615d5,_0x4bb4c0,_0x48983c){var _0x3154c4={};var _0x49056f={};var _0x1520a3;var _0x3a0da6;return db[_0xf70b('0x29')]['findOne']({'where':{'id':_0x4615d5['params']['id']}})[_0xf70b('0x25')](handleEntityNotFound(_0x4bb4c0,null))[_0xf70b('0x25')](function(_0x2dc833){if(_0x2dc833){_0x1520a3=_0x2dc833;_0x49056f[_0xf70b('0x2e')]=_['keys'](db['ZohoField'][_0xf70b('0x2a')]);_0x49056f[_0xf70b('0x2f')]=_[_0xf70b('0x30')](_0x4615d5['query']);_0x49056f['filters']=_[_0xf70b('0x32')](_0x49056f['model'],_0x49056f['query']);_0x3154c4['attributes']=_[_0xf70b('0x32')](_0x49056f[_0xf70b('0x2e')],qs[_0xf70b('0x33')](_0x4615d5[_0xf70b('0x2f')][_0xf70b('0x33')]));_0x3154c4[_0xf70b('0x35')]=_0x3154c4['attributes']['length']?_0x3154c4[_0xf70b('0x35')]:_0x49056f[_0xf70b('0x2e')];_0x3154c4[_0xf70b('0x38')]=qs['sort'](_0x4615d5['query'][_0xf70b('0x39')]);_0x3154c4['where']=qs['filters'](_[_0xf70b('0x3b')](_0x4615d5['query'],_0x49056f['filters']));if(_0x4615d5[_0xf70b('0x2f')][_0xf70b('0x3f')]){_0x3154c4['where']=_[_0xf70b('0x3c')](_0x3154c4[_0xf70b('0x3a')],{'$or':_[_0xf70b('0x3d')](_0x3154c4['attributes'],function(_0x471b96){var _0xd18f16={};_0xd18f16[_0x471b96]={'$like':'%'+_0x4615d5[_0xf70b('0x2f')]['filter']+'%'};return _0xd18f16;})});}_0x3154c4=_['merge']({},_0x3154c4,_0x4615d5['options']);return _0x1520a3[_0xf70b('0x4e')](_0x3154c4);}})[_0xf70b('0x25')](function(_0x22523e){if(_0x22523e){_0x3a0da6=_0x22523e['length'];if(!_0x4615d5[_0xf70b('0x2f')][_0xf70b('0x36')](_0xf70b('0x37'))){_0x3154c4['limit']=qs[_0xf70b('0x1f')](_0x4615d5[_0xf70b('0x2f')]['limit']);_0x3154c4[_0xf70b('0x1d')]=qs[_0xf70b('0x1d')](_0x4615d5[_0xf70b('0x2f')][_0xf70b('0x1d')]);}return _0x1520a3[_0xf70b('0x4e')](_0x3154c4);}})[_0xf70b('0x25')](function(_0x3e360e){if(_0x3e360e){return _0x3e360e?{'count':_0x3a0da6,'rows':_0x3e360e}:null;}})[_0xf70b('0x25')](respondWithResult(_0x4bb4c0,null))[_0xf70b('0x45')](handleError(_0x4bb4c0,null));};exports[_0xf70b('0x4f')]=function(_0x2f0e61,_0x33ce9b,_0x48cd98){var _0x56d260={};var _0x57820a={};var _0x17091;var _0x427d23;return db[_0xf70b('0x29')][_0xf70b('0x4c')]({'where':{'id':_0x2f0e61[_0xf70b('0x47')]['id']}})[_0xf70b('0x25')](handleEntityNotFound(_0x33ce9b,null))[_0xf70b('0x25')](function(_0x2cbcd1){if(_0x2cbcd1){_0x17091=_0x2cbcd1;_0x57820a[_0xf70b('0x2e')]=_[_0xf70b('0x30')](db[_0xf70b('0x4d')][_0xf70b('0x2a')]);_0x57820a[_0xf70b('0x2f')]=_[_0xf70b('0x30')](_0x2f0e61[_0xf70b('0x2f')]);_0x57820a[_0xf70b('0x31')]=_[_0xf70b('0x32')](_0x57820a['model'],_0x57820a['query']);_0x56d260[_0xf70b('0x35')]=_[_0xf70b('0x32')](_0x57820a[_0xf70b('0x2e')],qs[_0xf70b('0x33')](_0x2f0e61['query'][_0xf70b('0x33')]));_0x56d260['attributes']=_0x56d260[_0xf70b('0x35')][_0xf70b('0x34')]?_0x56d260[_0xf70b('0x35')]:_0x57820a[_0xf70b('0x2e')];_0x56d260['order']=qs[_0xf70b('0x39')](_0x2f0e61['query'][_0xf70b('0x39')]);_0x56d260[_0xf70b('0x3a')]=qs[_0xf70b('0x31')](_['pick'](_0x2f0e61[_0xf70b('0x2f')],_0x57820a[_0xf70b('0x31')]));if(_0x2f0e61['query']['filter']){_0x56d260['where']=_[_0xf70b('0x3c')](_0x56d260['where'],{'$or':_[_0xf70b('0x3d')](_0x56d260[_0xf70b('0x35')],function(_0x58f941){var _0x2ebb04={};_0x2ebb04[_0x58f941]={'$like':'%'+_0x2f0e61[_0xf70b('0x2f')][_0xf70b('0x3f')]+'%'};return _0x2ebb04;})});}_0x56d260=_[_0xf70b('0x3c')]({},_0x56d260,_0x2f0e61[_0xf70b('0x40')]);return _0x17091['getDescriptions'](_0x56d260);}})[_0xf70b('0x25')](function(_0x1dc411){if(_0x1dc411){_0x427d23=_0x1dc411[_0xf70b('0x34')];if(!_0x2f0e61['query']['hasOwnProperty']('nolimit')){_0x56d260['limit']=qs[_0xf70b('0x1f')](_0x2f0e61[_0xf70b('0x2f')][_0xf70b('0x1f')]);_0x56d260[_0xf70b('0x1d')]=qs[_0xf70b('0x1d')](_0x2f0e61[_0xf70b('0x2f')]['offset']);}return _0x17091[_0xf70b('0x4f')](_0x56d260);}})[_0xf70b('0x25')](function(_0x78038){if(_0x78038){return _0x78038?{'count':_0x427d23,'rows':_0x78038}:null;}})[_0xf70b('0x25')](respondWithResult(_0x33ce9b,null))['catch'](handleError(_0x33ce9b,null));}; \ No newline at end of file +var _0x9c93=['Content-Range','json','apply','reject','update','then','sendStatus','error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','includeAll','include','findAll','catch','show','params','fields','options','find','create','body','destroy','getFields','findOne','ZohoField','filter','getSubjects','getDescriptions','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set'];(function(_0x14ad92,_0x3b4315){var _0x41ceae=function(_0x252cd1){while(--_0x252cd1){_0x14ad92['push'](_0x14ad92['shift']());}};_0x41ceae(++_0x3b4315);}(_0x9c93,0x1c7));var _0x39c9=function(_0x32c57d,_0x4b455a){_0x32c57d=_0x32c57d-0x0;var _0x353d7f=_0x9c93[_0x32c57d];return _0x353d7f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x39c9('0x0'));var jsonpatch=require(_0x39c9('0x1'));var rp=require('request-promise');var moment=require(_0x39c9('0x2'));var BPromise=require(_0x39c9('0x3'));var Mustache=require(_0x39c9('0x4'));var util=require(_0x39c9('0x5'));var path=require(_0x39c9('0x6'));var sox=require(_0x39c9('0x7'));var csv=require(_0x39c9('0x8'));var ejs=require(_0x39c9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x39c9('0xa'));var crypto=require(_0x39c9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x39c9('0xc'));var toCsv=require(_0x39c9('0x8'));var querystring=require(_0x39c9('0xd'));var Papa=require(_0x39c9('0xe'));var Redis=require(_0x39c9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x39c9('0x10'));var as=require(_0x39c9('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x39c9('0x12'))(_0x39c9('0x13'));var utils=require(_0x39c9('0x14'));var config=require(_0x39c9('0x15'));var licenseUtil=require(_0x39c9('0x16'));var db=require(_0x39c9('0x17'))['db'];function respondWithStatusCode(_0x2fa467,_0x459a8d){_0x459a8d=_0x459a8d||0xcc;return function(_0x34b909){if(_0x34b909){return _0x2fa467['sendStatus'](_0x459a8d);}return _0x2fa467[_0x39c9('0x18')](_0x459a8d)[_0x39c9('0x19')]();};}function respondWithResult(_0x3d93ed,_0x51cc54){_0x51cc54=_0x51cc54||0xc8;return function(_0x1c3fd1){if(_0x1c3fd1){return _0x3d93ed[_0x39c9('0x18')](_0x51cc54)['json'](_0x1c3fd1);}};}function respondWithFilteredResult(_0xfdffbb,_0x4610a7){return function(_0x4f1e9a){if(_0x4f1e9a){var _0x58f4e9=typeof _0x4610a7['offset']===_0x39c9('0x1a')&&typeof _0x4610a7[_0x39c9('0x1b')]===_0x39c9('0x1a');var _0x20be3b=_0x4f1e9a[_0x39c9('0x1c')];var _0x3abdf4=_0x58f4e9?0x0:_0x4610a7[_0x39c9('0x1d')];var _0xfbb582=_0x58f4e9?_0x4f1e9a[_0x39c9('0x1c')]:_0x4610a7[_0x39c9('0x1d')]+_0x4610a7[_0x39c9('0x1b')];var _0x1e0da6;if(_0xfbb582>=_0x20be3b){_0xfbb582=_0x20be3b;_0x1e0da6=0xc8;}else{_0x1e0da6=0xce;}_0xfdffbb[_0x39c9('0x18')](_0x1e0da6);return _0xfdffbb[_0x39c9('0x1e')](_0x39c9('0x1f'),_0x3abdf4+'-'+_0xfbb582+'/'+_0x20be3b)[_0x39c9('0x20')](_0x4f1e9a);}return null;};}function patchUpdates(_0x571d9d){return function(_0x27bc39){try{jsonpatch[_0x39c9('0x21')](_0x27bc39,_0x571d9d,!![]);}catch(_0x4d02a6){return BPromise[_0x39c9('0x22')](_0x4d02a6);}return _0x27bc39['save']();};}function saveUpdates(_0x3c0251,_0x2bf1a1){return function(_0x1b5b31){if(_0x1b5b31){return _0x1b5b31[_0x39c9('0x23')](_0x3c0251)[_0x39c9('0x24')](function(_0x464738){return _0x464738;});}return null;};}function removeEntity(_0x164394,_0x3f81f9){return function(_0x3a9986){if(_0x3a9986){return _0x3a9986['destroy']()[_0x39c9('0x24')](function(){_0x164394[_0x39c9('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x589e37,_0x276a12){return function(_0x593203){if(!_0x593203){_0x589e37[_0x39c9('0x25')](0x194);}return _0x593203;};}function handleError(_0x22b07b,_0xb61ef8){_0xb61ef8=_0xb61ef8||0x1f4;return function(_0x3dba7e){logger[_0x39c9('0x26')](_0x3dba7e[_0x39c9('0x27')]);if(_0x3dba7e[_0x39c9('0x28')]){delete _0x3dba7e['name'];}_0x22b07b[_0x39c9('0x18')](_0xb61ef8)[_0x39c9('0x29')](_0x3dba7e);};}exports[_0x39c9('0x2a')]=function(_0x216024,_0x48c3f9){var _0x231433={},_0x1901d6={},_0x2af959={'count':0x0,'rows':[]};var _0x7f32bf=_[_0x39c9('0x2b')](db[_0x39c9('0x2c')][_0x39c9('0x2d')],function(_0x588a24){return{'name':_0x588a24[_0x39c9('0x2e')],'type':_0x588a24[_0x39c9('0x2f')][_0x39c9('0x30')]};});_0x1901d6[_0x39c9('0x31')]=_[_0x39c9('0x2b')](_0x7f32bf,'name');_0x1901d6[_0x39c9('0x32')]=_[_0x39c9('0x33')](_0x216024[_0x39c9('0x32')]);_0x1901d6[_0x39c9('0x34')]=_[_0x39c9('0x35')](_0x1901d6['model'],_0x1901d6[_0x39c9('0x32')]);_0x231433[_0x39c9('0x36')]=_[_0x39c9('0x35')](_0x1901d6[_0x39c9('0x31')],qs['fields'](_0x216024['query']['fields']));_0x231433[_0x39c9('0x36')]=_0x231433[_0x39c9('0x36')][_0x39c9('0x37')]?_0x231433['attributes']:_0x1901d6['model'];if(!_0x216024[_0x39c9('0x32')][_0x39c9('0x38')](_0x39c9('0x39'))){_0x231433[_0x39c9('0x1b')]=qs[_0x39c9('0x1b')](_0x216024[_0x39c9('0x32')]['limit']);_0x231433[_0x39c9('0x1d')]=qs[_0x39c9('0x1d')](_0x216024[_0x39c9('0x32')][_0x39c9('0x1d')]);}_0x231433[_0x39c9('0x3a')]=qs[_0x39c9('0x3b')](_0x216024['query'][_0x39c9('0x3b')]);_0x231433['where']=qs['filters'](_[_0x39c9('0x3c')](_0x216024[_0x39c9('0x32')],_0x1901d6[_0x39c9('0x34')]),_0x7f32bf);if(_0x216024[_0x39c9('0x32')]['filter']){_0x231433[_0x39c9('0x3d')]=_[_0x39c9('0x3e')](_0x231433['where'],{'$or':_[_0x39c9('0x2b')](_0x7f32bf,function(_0x3701fa){if(_0x3701fa[_0x39c9('0x2f')]!=='VIRTUAL'){var _0x4481a2={};_0x4481a2[_0x3701fa[_0x39c9('0x28')]]={'$like':'%'+_0x216024[_0x39c9('0x32')]['filter']+'%'};return _0x4481a2;}})});}_0x231433=_[_0x39c9('0x3e')]({},_0x231433,_0x216024['options']);var _0x1b429b={'where':_0x231433[_0x39c9('0x3d')]};return db[_0x39c9('0x2c')][_0x39c9('0x1c')](_0x1b429b)[_0x39c9('0x24')](function(_0xb2a2ea){_0x2af959[_0x39c9('0x1c')]=_0xb2a2ea;if(_0x216024[_0x39c9('0x32')][_0x39c9('0x3f')]){_0x231433[_0x39c9('0x40')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0x39c9('0x41')](_0x231433);})[_0x39c9('0x24')](function(_0x1f6659){_0x2af959['rows']=_0x1f6659;return _0x2af959;})[_0x39c9('0x24')](respondWithFilteredResult(_0x48c3f9,_0x231433))[_0x39c9('0x42')](handleError(_0x48c3f9,null));};exports[_0x39c9('0x43')]=function(_0x490d81,_0x1a04d3){var _0x5ebd53={'raw':![],'where':{'id':_0x490d81[_0x39c9('0x44')]['id']}},_0x29cb1b={};_0x29cb1b[_0x39c9('0x31')]=_[_0x39c9('0x33')](db[_0x39c9('0x2c')]['rawAttributes']);_0x29cb1b[_0x39c9('0x32')]=_[_0x39c9('0x33')](_0x490d81[_0x39c9('0x32')]);_0x29cb1b['filters']=_['intersection'](_0x29cb1b[_0x39c9('0x31')],_0x29cb1b[_0x39c9('0x32')]);_0x5ebd53[_0x39c9('0x36')]=_[_0x39c9('0x35')](_0x29cb1b[_0x39c9('0x31')],qs[_0x39c9('0x45')](_0x490d81[_0x39c9('0x32')][_0x39c9('0x45')]));_0x5ebd53['attributes']=_0x5ebd53['attributes']['length']?_0x5ebd53['attributes']:_0x29cb1b['model'];if(_0x490d81[_0x39c9('0x32')][_0x39c9('0x3f')]){_0x5ebd53['include']=[{'all':!![]}];}_0x5ebd53=_[_0x39c9('0x3e')]({},_0x5ebd53,_0x490d81[_0x39c9('0x46')]);return db[_0x39c9('0x2c')][_0x39c9('0x47')](_0x5ebd53)[_0x39c9('0x24')](handleEntityNotFound(_0x1a04d3,null))[_0x39c9('0x24')](respondWithResult(_0x1a04d3,null))[_0x39c9('0x42')](handleError(_0x1a04d3,null));};exports[_0x39c9('0x48')]=function(_0x44196b,_0x27ac03){return db[_0x39c9('0x2c')][_0x39c9('0x48')](_0x44196b['body'],{})[_0x39c9('0x24')](respondWithResult(_0x27ac03,0xc9))[_0x39c9('0x42')](handleError(_0x27ac03,null));};exports[_0x39c9('0x23')]=function(_0x1aad7f,_0x2a190b){if(_0x1aad7f[_0x39c9('0x49')]['id']){delete _0x1aad7f[_0x39c9('0x49')]['id'];}return db[_0x39c9('0x2c')][_0x39c9('0x47')]({'where':{'id':_0x1aad7f[_0x39c9('0x44')]['id']}})[_0x39c9('0x24')](handleEntityNotFound(_0x2a190b,null))[_0x39c9('0x24')](saveUpdates(_0x1aad7f[_0x39c9('0x49')],null))[_0x39c9('0x24')](respondWithResult(_0x2a190b,null))[_0x39c9('0x42')](handleError(_0x2a190b,null));};exports[_0x39c9('0x4a')]=function(_0x4f6434,_0x130d6e){return db[_0x39c9('0x2c')][_0x39c9('0x47')]({'where':{'id':_0x4f6434[_0x39c9('0x44')]['id']}})[_0x39c9('0x24')](handleEntityNotFound(_0x130d6e,null))[_0x39c9('0x24')](removeEntity(_0x130d6e,null))['catch'](handleError(_0x130d6e,null));};exports[_0x39c9('0x4b')]=function(_0x5b4a4f,_0xef5ed3,_0x1c5456){var _0x5edfce={};var _0x21c711={};var _0x50661a;var _0x1d83c5;return db['ZohoConfiguration'][_0x39c9('0x4c')]({'where':{'id':_0x5b4a4f['params']['id']}})[_0x39c9('0x24')](handleEntityNotFound(_0xef5ed3,null))[_0x39c9('0x24')](function(_0x114084){if(_0x114084){_0x50661a=_0x114084;_0x21c711[_0x39c9('0x31')]=_[_0x39c9('0x33')](db[_0x39c9('0x4d')]['rawAttributes']);_0x21c711[_0x39c9('0x32')]=_[_0x39c9('0x33')](_0x5b4a4f[_0x39c9('0x32')]);_0x21c711[_0x39c9('0x34')]=_[_0x39c9('0x35')](_0x21c711[_0x39c9('0x31')],_0x21c711[_0x39c9('0x32')]);_0x5edfce[_0x39c9('0x36')]=_[_0x39c9('0x35')](_0x21c711[_0x39c9('0x31')],qs[_0x39c9('0x45')](_0x5b4a4f[_0x39c9('0x32')]['fields']));_0x5edfce[_0x39c9('0x36')]=_0x5edfce[_0x39c9('0x36')][_0x39c9('0x37')]?_0x5edfce['attributes']:_0x21c711['model'];_0x5edfce['order']=qs[_0x39c9('0x3b')](_0x5b4a4f[_0x39c9('0x32')][_0x39c9('0x3b')]);_0x5edfce[_0x39c9('0x3d')]=qs['filters'](_['pick'](_0x5b4a4f['query'],_0x21c711[_0x39c9('0x34')]));if(_0x5b4a4f[_0x39c9('0x32')][_0x39c9('0x4e')]){_0x5edfce[_0x39c9('0x3d')]=_['merge'](_0x5edfce[_0x39c9('0x3d')],{'$or':_['map'](_0x5edfce[_0x39c9('0x36')],function(_0x56982e){var _0x5cbdc0={};_0x5cbdc0[_0x56982e]={'$like':'%'+_0x5b4a4f['query']['filter']+'%'};return _0x5cbdc0;})});}_0x5edfce=_[_0x39c9('0x3e')]({},_0x5edfce,_0x5b4a4f[_0x39c9('0x46')]);return _0x50661a[_0x39c9('0x4b')](_0x5edfce);}})[_0x39c9('0x24')](function(_0x9efb36){if(_0x9efb36){_0x1d83c5=_0x9efb36[_0x39c9('0x37')];if(!_0x5b4a4f[_0x39c9('0x32')][_0x39c9('0x38')](_0x39c9('0x39'))){_0x5edfce[_0x39c9('0x1b')]=qs[_0x39c9('0x1b')](_0x5b4a4f[_0x39c9('0x32')][_0x39c9('0x1b')]);_0x5edfce[_0x39c9('0x1d')]=qs['offset'](_0x5b4a4f[_0x39c9('0x32')][_0x39c9('0x1d')]);}return _0x50661a[_0x39c9('0x4b')](_0x5edfce);}})[_0x39c9('0x24')](function(_0x73f88a){if(_0x73f88a){return _0x73f88a?{'count':_0x1d83c5,'rows':_0x73f88a}:null;}})[_0x39c9('0x24')](respondWithResult(_0xef5ed3,null))['catch'](handleError(_0xef5ed3,null));};exports['getSubjects']=function(_0x44cc72,_0x488316,_0xd70210){var _0x27d66d={};var _0x1e43c5={};var _0xb3d8d;var _0x4159be;return db[_0x39c9('0x2c')][_0x39c9('0x4c')]({'where':{'id':_0x44cc72[_0x39c9('0x44')]['id']}})[_0x39c9('0x24')](handleEntityNotFound(_0x488316,null))['then'](function(_0x708f8a){if(_0x708f8a){_0xb3d8d=_0x708f8a;_0x1e43c5[_0x39c9('0x31')]=_['keys'](db[_0x39c9('0x4d')][_0x39c9('0x2d')]);_0x1e43c5[_0x39c9('0x32')]=_['keys'](_0x44cc72[_0x39c9('0x32')]);_0x1e43c5[_0x39c9('0x34')]=_[_0x39c9('0x35')](_0x1e43c5[_0x39c9('0x31')],_0x1e43c5[_0x39c9('0x32')]);_0x27d66d['attributes']=_[_0x39c9('0x35')](_0x1e43c5[_0x39c9('0x31')],qs[_0x39c9('0x45')](_0x44cc72[_0x39c9('0x32')][_0x39c9('0x45')]));_0x27d66d[_0x39c9('0x36')]=_0x27d66d['attributes']['length']?_0x27d66d[_0x39c9('0x36')]:_0x1e43c5[_0x39c9('0x31')];_0x27d66d[_0x39c9('0x3a')]=qs[_0x39c9('0x3b')](_0x44cc72[_0x39c9('0x32')][_0x39c9('0x3b')]);_0x27d66d[_0x39c9('0x3d')]=qs[_0x39c9('0x34')](_[_0x39c9('0x3c')](_0x44cc72[_0x39c9('0x32')],_0x1e43c5[_0x39c9('0x34')]));if(_0x44cc72['query'][_0x39c9('0x4e')]){_0x27d66d[_0x39c9('0x3d')]=_[_0x39c9('0x3e')](_0x27d66d[_0x39c9('0x3d')],{'$or':_[_0x39c9('0x2b')](_0x27d66d[_0x39c9('0x36')],function(_0x4a219e){var _0x142547={};_0x142547[_0x4a219e]={'$like':'%'+_0x44cc72[_0x39c9('0x32')][_0x39c9('0x4e')]+'%'};return _0x142547;})});}_0x27d66d=_[_0x39c9('0x3e')]({},_0x27d66d,_0x44cc72[_0x39c9('0x46')]);return _0xb3d8d[_0x39c9('0x4f')](_0x27d66d);}})[_0x39c9('0x24')](function(_0x5da183){if(_0x5da183){_0x4159be=_0x5da183[_0x39c9('0x37')];if(!_0x44cc72[_0x39c9('0x32')][_0x39c9('0x38')](_0x39c9('0x39'))){_0x27d66d['limit']=qs[_0x39c9('0x1b')](_0x44cc72['query'][_0x39c9('0x1b')]);_0x27d66d[_0x39c9('0x1d')]=qs['offset'](_0x44cc72['query'][_0x39c9('0x1d')]);}return _0xb3d8d[_0x39c9('0x4f')](_0x27d66d);}})[_0x39c9('0x24')](function(_0x54cea7){if(_0x54cea7){return _0x54cea7?{'count':_0x4159be,'rows':_0x54cea7}:null;}})[_0x39c9('0x24')](respondWithResult(_0x488316,null))['catch'](handleError(_0x488316,null));};exports['getDescriptions']=function(_0x41ba50,_0x5b02b1,_0x178830){var _0x1ba275={};var _0x22cbc5={};var _0x59c83d;var _0x2bb0dc;return db[_0x39c9('0x2c')][_0x39c9('0x4c')]({'where':{'id':_0x41ba50['params']['id']}})[_0x39c9('0x24')](handleEntityNotFound(_0x5b02b1,null))['then'](function(_0x41a6de){if(_0x41a6de){_0x59c83d=_0x41a6de;_0x22cbc5[_0x39c9('0x31')]=_['keys'](db['ZohoField']['rawAttributes']);_0x22cbc5[_0x39c9('0x32')]=_[_0x39c9('0x33')](_0x41ba50['query']);_0x22cbc5[_0x39c9('0x34')]=_[_0x39c9('0x35')](_0x22cbc5[_0x39c9('0x31')],_0x22cbc5[_0x39c9('0x32')]);_0x1ba275['attributes']=_[_0x39c9('0x35')](_0x22cbc5['model'],qs[_0x39c9('0x45')](_0x41ba50[_0x39c9('0x32')][_0x39c9('0x45')]));_0x1ba275[_0x39c9('0x36')]=_0x1ba275[_0x39c9('0x36')][_0x39c9('0x37')]?_0x1ba275[_0x39c9('0x36')]:_0x22cbc5[_0x39c9('0x31')];_0x1ba275[_0x39c9('0x3a')]=qs[_0x39c9('0x3b')](_0x41ba50[_0x39c9('0x32')][_0x39c9('0x3b')]);_0x1ba275[_0x39c9('0x3d')]=qs[_0x39c9('0x34')](_[_0x39c9('0x3c')](_0x41ba50[_0x39c9('0x32')],_0x22cbc5[_0x39c9('0x34')]));if(_0x41ba50['query'][_0x39c9('0x4e')]){_0x1ba275[_0x39c9('0x3d')]=_['merge'](_0x1ba275[_0x39c9('0x3d')],{'$or':_[_0x39c9('0x2b')](_0x1ba275['attributes'],function(_0x974e61){var _0x6ad31a={};_0x6ad31a[_0x974e61]={'$like':'%'+_0x41ba50['query'][_0x39c9('0x4e')]+'%'};return _0x6ad31a;})});}_0x1ba275=_[_0x39c9('0x3e')]({},_0x1ba275,_0x41ba50[_0x39c9('0x46')]);return _0x59c83d[_0x39c9('0x50')](_0x1ba275);}})['then'](function(_0x32fa4d){if(_0x32fa4d){_0x2bb0dc=_0x32fa4d['length'];if(!_0x41ba50[_0x39c9('0x32')][_0x39c9('0x38')](_0x39c9('0x39'))){_0x1ba275['limit']=qs[_0x39c9('0x1b')](_0x41ba50[_0x39c9('0x32')][_0x39c9('0x1b')]);_0x1ba275[_0x39c9('0x1d')]=qs['offset'](_0x41ba50['query']['offset']);}return _0x59c83d[_0x39c9('0x50')](_0x1ba275);}})[_0x39c9('0x24')](function(_0x169d0c){if(_0x169d0c){return _0x169d0c?{'count':_0x2bb0dc,'rows':_0x169d0c}:null;}})[_0x39c9('0x24')](respondWithResult(_0x5b02b1,null))['catch'](handleError(_0x5b02b1,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 9b45381..da863bf 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 _0xf03b=['define','ZohoConfiguration','int_zoho_configurations','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xf03b,0xb9));var _0xbf03=function(_0x454d04,_0x2d75fc){_0x454d04=_0x454d04-0x0;var _0x52a8c0=_0xf03b[_0x454d04];return _0x52a8c0;};'use strict';var _=require('lodash');var util=require(_0xbf03('0x0'));var logger=require(_0xbf03('0x1'))(_0xbf03('0x2'));var moment=require(_0xbf03('0x3'));var BPromise=require(_0xbf03('0x4'));var rp=require(_0xbf03('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf03('0x6'));var config=require(_0xbf03('0x7'));var attributes=require(_0xbf03('0x8'));module[_0xbf03('0x9')]=function(_0x310f24,_0x4a19ac){return _0x310f24[_0xbf03('0xa')](_0xbf03('0xb'),attributes,{'tableName':_0xbf03('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6770=['bluebird','request-promise','path','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','lodash','util','../../config/logger','api'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x6770,0x68));var _0x0677=function(_0x4cf973,_0x48f000){_0x4cf973=_0x4cf973-0x0;var _0xd12801=_0x6770[_0x4cf973];return _0xd12801;};'use strict';var _=require(_0x0677('0x0'));var util=require(_0x0677('0x1'));var logger=require(_0x0677('0x2'))(_0x0677('0x3'));var moment=require('moment');var BPromise=require(_0x0677('0x4'));var rp=require(_0x0677('0x5'));var fs=require('fs');var path=require(_0x0677('0x6'));var rimraf=require('rimraf');var config=require(_0x0677('0x7'));var attributes=require(_0x0677('0x8'));module[_0x0677('0x9')]=function(_0x5e64e9,_0x5edb4f){return _0x5e64e9[_0x0677('0xa')](_0x0677('0xb'),attributes,{'tableName':'int_zoho_configurations','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 4b3b20c..fc8d25d 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 _0x6ebf=['debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x28c18b,_0x439e94){var _0x2f0a76=function(_0x5e7181){while(--_0x5e7181){_0x28c18b['push'](_0x28c18b['shift']());}};_0x2f0a76(++_0x439e94);}(_0x6ebf,0x1cf));var _0xf6eb=function(_0x2c1114,_0x2a5c50){_0x2c1114=_0x2c1114-0x0;var _0x2b877c=_0x6ebf[_0x2c1114];return _0x2b877c;};'use strict';var _=require(_0xf6eb('0x0'));var util=require(_0xf6eb('0x1'));var moment=require(_0xf6eb('0x2'));var BPromise=require(_0xf6eb('0x3'));var rs=require(_0xf6eb('0x4'));var fs=require('fs');var Redis=require(_0xf6eb('0x5'));var db=require(_0xf6eb('0x6'))['db'];var utils=require(_0xf6eb('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf6eb('0x8'));var jayson=require(_0xf6eb('0x9'));var client=jayson[_0xf6eb('0xa')][_0xf6eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3588ff,_0x5ec89c,_0x49aeb9){return new BPromise(function(_0x51d23a,_0x3e97ae){return client[_0xf6eb('0xc')](_0x3588ff,_0x49aeb9)[_0xf6eb('0xd')](function(_0x1963c7){logger[_0xf6eb('0xe')](_0xf6eb('0xf'),_0x5ec89c,_0xf6eb('0x10'));logger[_0xf6eb('0x11')](_0xf6eb('0x12'),_0x5ec89c,_0xf6eb('0x10'),JSON[_0xf6eb('0x13')](_0x1963c7));if(_0x1963c7[_0xf6eb('0x14')]){if(_0x1963c7[_0xf6eb('0x14')][_0xf6eb('0x15')]===0x1f4){logger[_0xf6eb('0x14')](_0xf6eb('0xf'),_0x5ec89c,_0x1963c7[_0xf6eb('0x14')][_0xf6eb('0x16')]);return _0x3e97ae(_0x1963c7[_0xf6eb('0x14')][_0xf6eb('0x16')]);}logger[_0xf6eb('0x14')]('ZohoConfiguration,\x20%s,\x20%s',_0x5ec89c,_0x1963c7[_0xf6eb('0x14')][_0xf6eb('0x16')]);return _0x51d23a(_0x1963c7['error']['message']);}else{logger[_0xf6eb('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x5ec89c,_0xf6eb('0x10'));_0x51d23a(_0x1963c7[_0xf6eb('0x17')][_0xf6eb('0x16')]);}})['catch'](function(_0x4441a8){logger[_0xf6eb('0x14')](_0xf6eb('0xf'),_0x5ec89c,_0x4441a8);_0x3e97ae(_0x4441a8);});});} \ No newline at end of file +var _0x5932=['debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s'];(function(_0x36273c,_0x2659d1){var _0x408f4e=function(_0x5c6a7a){while(--_0x5c6a7a){_0x36273c['push'](_0x36273c['shift']());}};_0x408f4e(++_0x2659d1);}(_0x5932,0xa7));var _0x2593=function(_0x125544,_0x332d9e){_0x125544=_0x125544-0x0;var _0x45276d=_0x5932[_0x125544];return _0x45276d;};'use strict';var _=require(_0x2593('0x0'));var util=require('util');var moment=require(_0x2593('0x1'));var BPromise=require(_0x2593('0x2'));var rs=require(_0x2593('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2593('0x4'))['db'];var utils=require(_0x2593('0x5'));var logger=require(_0x2593('0x6'))('rpc');var config=require(_0x2593('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2593('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d43fc,_0x5bcad5,_0x2868f8){return new BPromise(function(_0x10fae7,_0x207c97){return client[_0x2593('0x9')](_0x2d43fc,_0x2868f8)[_0x2593('0xa')](function(_0x1970a4){logger[_0x2593('0xb')](_0x2593('0xc'),_0x5bcad5,'request\x20sent');logger[_0x2593('0xd')](_0x2593('0xe'),_0x5bcad5,_0x2593('0xf'),JSON['stringify'](_0x1970a4));if(_0x1970a4['error']){if(_0x1970a4['error'][_0x2593('0x10')]===0x1f4){logger[_0x2593('0x11')](_0x2593('0xc'),_0x5bcad5,_0x1970a4[_0x2593('0x11')][_0x2593('0x12')]);return _0x207c97(_0x1970a4[_0x2593('0x11')][_0x2593('0x12')]);}logger[_0x2593('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x5bcad5,_0x1970a4[_0x2593('0x11')][_0x2593('0x12')]);return _0x10fae7(_0x1970a4[_0x2593('0x11')][_0x2593('0x12')]);}else{logger['info'](_0x2593('0xc'),_0x5bcad5,_0x2593('0xf'));_0x10fae7(_0x1970a4[_0x2593('0x13')][_0x2593('0x12')]);}})['catch'](function(_0x57e00e){logger['error'](_0x2593('0xc'),_0x5bcad5,_0x57e00e);_0x207c97(_0x57e00e);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index bedf309..cc62386 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 _0x86ec=['../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x444f63,_0x5db1d1){var _0x19aaf6=function(_0x51d664){while(--_0x51d664){_0x444f63['push'](_0x444f63['shift']());}};_0x19aaf6(++_0x5db1d1);}(_0x86ec,0x19c));var _0xc86e=function(_0x4b5bbf,_0x99ff1c){_0x4b5bbf=_0x4b5bbf-0x0;var _0x2f58ea=_0x86ec[_0x4b5bbf];return _0x2f58ea;};'use strict';var multer=require(_0xc86e('0x0'));var util=require(_0xc86e('0x1'));var path=require('path');var timeout=require(_0xc86e('0x2'));var express=require(_0xc86e('0x3'));var router=express[_0xc86e('0x4')]();var fs_extra=require(_0xc86e('0x5'));var auth=require(_0xc86e('0x6'));var interaction=require(_0xc86e('0x7'));var config=require(_0xc86e('0x8'));var controller=require('./intZohoField.controller');router[_0xc86e('0x9')]('/',auth[_0xc86e('0xa')](),controller[_0xc86e('0xb')]);router[_0xc86e('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xc86e('0xc')]);router[_0xc86e('0xd')]('/',auth[_0xc86e('0xa')](),controller[_0xc86e('0xe')]);router[_0xc86e('0xf')](_0xc86e('0x10'),auth[_0xc86e('0xa')](),controller[_0xc86e('0x11')]);router[_0xc86e('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xc86e('0x13')]);module['exports']=router; \ No newline at end of file +var _0x0ad5=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intZohoField.controller','index','/:id','show','post','create','put','isAuthenticated','update','delete','destroy','exports','multer'];(function(_0x2a2e72,_0x1de962){var _0x3cfb4a=function(_0x3d435c){while(--_0x3d435c){_0x2a2e72['push'](_0x2a2e72['shift']());}};_0x3cfb4a(++_0x1de962);}(_0x0ad5,0x1cb));var _0x50ad=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x0ad5[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0x50ad('0x0'));var util=require(_0x50ad('0x1'));var path=require(_0x50ad('0x2'));var timeout=require(_0x50ad('0x3'));var express=require(_0x50ad('0x4'));var router=express[_0x50ad('0x5')]();var fs_extra=require(_0x50ad('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x50ad('0x7'));var config=require('../../config/environment');var controller=require(_0x50ad('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x50ad('0x9')]);router['get'](_0x50ad('0xa'),auth['isAuthenticated'](),controller[_0x50ad('0xb')]);router[_0x50ad('0xc')]('/',auth['isAuthenticated'](),controller[_0x50ad('0xd')]);router[_0x50ad('0xe')](_0x50ad('0xa'),auth[_0x50ad('0xf')](),controller[_0x50ad('0x10')]);router[_0x50ad('0x11')](_0x50ad('0xa'),auth['isAuthenticated'](),controller[_0x50ad('0x12')]);module[_0x50ad('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index cc42f16..8a42303 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 _0x7a63=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM'];(function(_0x5f38c6,_0xfbdbb2){var _0x40d504=function(_0x128dd6){while(--_0x128dd6){_0x5f38c6['push'](_0x5f38c6['shift']());}};_0x40d504(++_0xfbdbb2);}(_0x7a63,0x73));var _0x37a6=function(_0x4fe8a3,_0x5e5623){_0x4fe8a3=_0x4fe8a3-0x0;var _0x20c570=_0x7a63[_0x4fe8a3];return _0x20c570;};'use strict';var Sequelize=require('sequelize');module[_0x37a6('0x0')]={'type':{'type':Sequelize[_0x37a6('0x1')](_0x37a6('0x2'),_0x37a6('0x3'),_0x37a6('0x4'),_0x37a6('0x5'),_0x37a6('0x6')),'defaultValue':_0x37a6('0x2')},'content':{'type':Sequelize[_0x37a6('0x7')]},'key':{'type':Sequelize[_0x37a6('0x7')]},'keyType':{'type':Sequelize[_0x37a6('0x1')](_0x37a6('0x2'),_0x37a6('0x3'),_0x37a6('0x4'))},'keyContent':{'type':Sequelize[_0x37a6('0x7')]},'idField':{'type':Sequelize[_0x37a6('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x37a6('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x37a6('0x7')]}}; \ No newline at end of file +var _0x997a=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x495e8b,_0x2b8d5d){var _0x4e0188=function(_0x5a3b56){while(--_0x5a3b56){_0x495e8b['push'](_0x495e8b['shift']());}};_0x4e0188(++_0x2b8d5d);}(_0x997a,0x10b));var _0xa997=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x997a[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0xa997('0x0'));module[_0xa997('0x1')]={'type':{'type':Sequelize[_0xa997('0x2')](_0xa997('0x3'),_0xa997('0x4'),_0xa997('0x5'),_0xa997('0x6'),_0xa997('0x7')),'defaultValue':_0xa997('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa997('0x8')]},'keyType':{'type':Sequelize[_0xa997('0x2')](_0xa997('0x3'),'variable',_0xa997('0x5'))},'keyContent':{'type':Sequelize[_0xa997('0x8')]},'idField':{'type':Sequelize[_0xa997('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xa997('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa997('0x8')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index c801c2c..e3e97f2 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 _0xc7d1=['order','sort','where','filter','merge','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','destroy','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','apply','update','then','stack','name','send','index','map','ZohoField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x3c0c33,_0x5210cc){var _0x475fa1=function(_0x5ca256){while(--_0x5ca256){_0x3c0c33['push'](_0x3c0c33['shift']());}};_0x475fa1(++_0x5210cc);}(_0xc7d1,0xa4));var _0x1c7d=function(_0x45c4af,_0x428d92){_0x45c4af=_0x45c4af-0x0;var _0x214d48=_0xc7d1[_0x45c4af];return _0x214d48;};'use strict';var emlformat=require(_0x1c7d('0x0'));var rimraf=require(_0x1c7d('0x1'));var zipdir=require(_0x1c7d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1c7d('0x3'));var BPromise=require(_0x1c7d('0x4'));var Mustache=require(_0x1c7d('0x5'));var util=require('util');var path=require(_0x1c7d('0x6'));var sox=require(_0x1c7d('0x7'));var csv=require(_0x1c7d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1c7d('0x9'));var squel=require(_0x1c7d('0xa'));var crypto=require('crypto');var jsforce=require(_0x1c7d('0xb'));var deskjs=require(_0x1c7d('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1c7d('0xd'));var Papa=require(_0x1c7d('0xe'));var Redis=require(_0x1c7d('0xf'));var authService=require(_0x1c7d('0x10'));var qs=require(_0x1c7d('0x11'));var as=require(_0x1c7d('0x12'));var hardwareService=require(_0x1c7d('0x13'));var logger=require(_0x1c7d('0x14'))(_0x1c7d('0x15'));var utils=require(_0x1c7d('0x16'));var config=require(_0x1c7d('0x17'));var licenseUtil=require(_0x1c7d('0x18'));var db=require(_0x1c7d('0x19'))['db'];function respondWithStatusCode(_0x5c5742,_0x3d7357){_0x3d7357=_0x3d7357||0xcc;return function(_0x3935a2){if(_0x3935a2){return _0x5c5742[_0x1c7d('0x1a')](_0x3d7357);}return _0x5c5742[_0x1c7d('0x1b')](_0x3d7357)['end']();};}function respondWithResult(_0x35b5cb,_0x354347){_0x354347=_0x354347||0xc8;return function(_0x577a26){if(_0x577a26){return _0x35b5cb[_0x1c7d('0x1b')](_0x354347)[_0x1c7d('0x1c')](_0x577a26);}};}function respondWithFilteredResult(_0x4e130c,_0x2fa89e){return function(_0x54f507){if(_0x54f507){var _0x45eeda=typeof _0x2fa89e[_0x1c7d('0x1d')]==='undefined'&&typeof _0x2fa89e[_0x1c7d('0x1e')]===_0x1c7d('0x1f');var _0x563044=_0x54f507[_0x1c7d('0x20')];var _0x125377=_0x45eeda?0x0:_0x2fa89e[_0x1c7d('0x1d')];var _0x1d89c4=_0x45eeda?_0x54f507[_0x1c7d('0x20')]:_0x2fa89e[_0x1c7d('0x1d')]+_0x2fa89e['limit'];var _0x19866e;if(_0x1d89c4>=_0x563044){_0x1d89c4=_0x563044;_0x19866e=0xc8;}else{_0x19866e=0xce;}_0x4e130c[_0x1c7d('0x1b')](_0x19866e);return _0x4e130c[_0x1c7d('0x21')]('Content-Range',_0x125377+'-'+_0x1d89c4+'/'+_0x563044)['json'](_0x54f507);}return null;};}function patchUpdates(_0x51cadf){return function(_0x2056af){try{jsonpatch[_0x1c7d('0x22')](_0x2056af,_0x51cadf,!![]);}catch(_0x13b976){return BPromise['reject'](_0x13b976);}return _0x2056af['save']();};}function saveUpdates(_0x583839,_0x1c64f8){return function(_0x1d8f34){if(_0x1d8f34){return _0x1d8f34[_0x1c7d('0x23')](_0x583839)['then'](function(_0x4a7091){return _0x4a7091;});}return null;};}function removeEntity(_0x5056f7,_0x5da772){return function(_0x1c81e5){if(_0x1c81e5){return _0x1c81e5['destroy']()[_0x1c7d('0x24')](function(){_0x5056f7[_0x1c7d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22eec3,_0x5f412a){return function(_0x1f78c4){if(!_0x1f78c4){_0x22eec3[_0x1c7d('0x1a')](0x194);}return _0x1f78c4;};}function handleError(_0xd4cf11,_0x51a79f){_0x51a79f=_0x51a79f||0x1f4;return function(_0x54e20f){logger['error'](_0x54e20f[_0x1c7d('0x25')]);if(_0x54e20f[_0x1c7d('0x26')]){delete _0x54e20f[_0x1c7d('0x26')];}_0xd4cf11[_0x1c7d('0x1b')](_0x51a79f)[_0x1c7d('0x27')](_0x54e20f);};}exports[_0x1c7d('0x28')]=function(_0xe887c,_0x1deec1){var _0x324cb6={},_0x41fe91={},_0x317af0={'count':0x0,'rows':[]};var _0x862b3e=_[_0x1c7d('0x29')](db[_0x1c7d('0x2a')]['rawAttributes'],function(_0x831a6a){return{'name':_0x831a6a[_0x1c7d('0x2b')],'type':_0x831a6a[_0x1c7d('0x2c')][_0x1c7d('0x2d')]};});_0x41fe91[_0x1c7d('0x2e')]=_['map'](_0x862b3e,_0x1c7d('0x26'));_0x41fe91[_0x1c7d('0x2f')]=_[_0x1c7d('0x30')](_0xe887c[_0x1c7d('0x2f')]);_0x41fe91[_0x1c7d('0x31')]=_[_0x1c7d('0x32')](_0x41fe91[_0x1c7d('0x2e')],_0x41fe91[_0x1c7d('0x2f')]);_0x324cb6[_0x1c7d('0x33')]=_['intersection'](_0x41fe91['model'],qs[_0x1c7d('0x34')](_0xe887c[_0x1c7d('0x2f')][_0x1c7d('0x34')]));_0x324cb6[_0x1c7d('0x33')]=_0x324cb6[_0x1c7d('0x33')]['length']?_0x324cb6[_0x1c7d('0x33')]:_0x41fe91[_0x1c7d('0x2e')];if(!_0xe887c[_0x1c7d('0x2f')][_0x1c7d('0x35')](_0x1c7d('0x36'))){_0x324cb6['limit']=qs[_0x1c7d('0x1e')](_0xe887c[_0x1c7d('0x2f')][_0x1c7d('0x1e')]);_0x324cb6[_0x1c7d('0x1d')]=qs[_0x1c7d('0x1d')](_0xe887c[_0x1c7d('0x2f')]['offset']);}_0x324cb6[_0x1c7d('0x37')]=qs[_0x1c7d('0x38')](_0xe887c[_0x1c7d('0x2f')]['sort']);_0x324cb6[_0x1c7d('0x39')]=qs[_0x1c7d('0x31')](_['pick'](_0xe887c[_0x1c7d('0x2f')],_0x41fe91[_0x1c7d('0x31')]),_0x862b3e);if(_0xe887c[_0x1c7d('0x2f')][_0x1c7d('0x3a')]){_0x324cb6[_0x1c7d('0x39')]=_[_0x1c7d('0x3b')](_0x324cb6[_0x1c7d('0x39')],{'$or':_[_0x1c7d('0x29')](_0x862b3e,function(_0x34fefd){if(_0x34fefd[_0x1c7d('0x2c')]!=='VIRTUAL'){var _0x3e7684={};_0x3e7684[_0x34fefd[_0x1c7d('0x26')]]={'$like':'%'+_0xe887c['query'][_0x1c7d('0x3a')]+'%'};return _0x3e7684;}})});}_0x324cb6=_['merge']({},_0x324cb6,_0xe887c[_0x1c7d('0x3c')]);var _0x46586d={'where':_0x324cb6[_0x1c7d('0x39')]};return db[_0x1c7d('0x2a')][_0x1c7d('0x20')](_0x46586d)[_0x1c7d('0x24')](function(_0x276196){_0x317af0[_0x1c7d('0x20')]=_0x276196;if(_0xe887c[_0x1c7d('0x2f')][_0x1c7d('0x3d')]){_0x324cb6['include']=[{'all':!![]}];}return db[_0x1c7d('0x2a')][_0x1c7d('0x3e')](_0x324cb6);})[_0x1c7d('0x24')](function(_0x4c592b){_0x317af0[_0x1c7d('0x3f')]=_0x4c592b;return _0x317af0;})[_0x1c7d('0x24')](respondWithFilteredResult(_0x1deec1,_0x324cb6))[_0x1c7d('0x40')](handleError(_0x1deec1,null));};exports[_0x1c7d('0x41')]=function(_0x295aef,_0x5ba6a4){var _0x17b79f={'raw':!![],'where':{'id':_0x295aef[_0x1c7d('0x42')]['id']}},_0x3bdce7={};_0x3bdce7[_0x1c7d('0x2e')]=_[_0x1c7d('0x30')](db[_0x1c7d('0x2a')]['rawAttributes']);_0x3bdce7[_0x1c7d('0x2f')]=_[_0x1c7d('0x30')](_0x295aef['query']);_0x3bdce7[_0x1c7d('0x31')]=_[_0x1c7d('0x32')](_0x3bdce7[_0x1c7d('0x2e')],_0x3bdce7[_0x1c7d('0x2f')]);_0x17b79f[_0x1c7d('0x33')]=_[_0x1c7d('0x32')](_0x3bdce7['model'],qs[_0x1c7d('0x34')](_0x295aef[_0x1c7d('0x2f')][_0x1c7d('0x34')]));_0x17b79f[_0x1c7d('0x33')]=_0x17b79f[_0x1c7d('0x33')][_0x1c7d('0x43')]?_0x17b79f[_0x1c7d('0x33')]:_0x3bdce7[_0x1c7d('0x2e')];if(_0x295aef[_0x1c7d('0x2f')][_0x1c7d('0x3d')]){_0x17b79f[_0x1c7d('0x44')]=[{'all':!![]}];}_0x17b79f=_[_0x1c7d('0x3b')]({},_0x17b79f,_0x295aef['options']);return db[_0x1c7d('0x2a')][_0x1c7d('0x45')](_0x17b79f)[_0x1c7d('0x24')](handleEntityNotFound(_0x5ba6a4,null))[_0x1c7d('0x24')](respondWithResult(_0x5ba6a4,null))['catch'](handleError(_0x5ba6a4,null));};exports['create']=function(_0x4006c2,_0x426880){return db[_0x1c7d('0x2a')][_0x1c7d('0x46')](_0x4006c2[_0x1c7d('0x47')],{})[_0x1c7d('0x24')](respondWithResult(_0x426880,0xc9))[_0x1c7d('0x40')](handleError(_0x426880,null));};exports[_0x1c7d('0x23')]=function(_0x7e2c1,_0xc6f1ca){if(_0x7e2c1[_0x1c7d('0x47')]['id']){delete _0x7e2c1[_0x1c7d('0x47')]['id'];}return db['ZohoField']['find']({'where':{'id':_0x7e2c1[_0x1c7d('0x42')]['id']}})[_0x1c7d('0x24')](handleEntityNotFound(_0xc6f1ca,null))[_0x1c7d('0x24')](saveUpdates(_0x7e2c1[_0x1c7d('0x47')],null))[_0x1c7d('0x24')](respondWithResult(_0xc6f1ca,null))[_0x1c7d('0x40')](handleError(_0xc6f1ca,null));};exports[_0x1c7d('0x48')]=function(_0x2c2898,_0x1c6623){return db[_0x1c7d('0x2a')][_0x1c7d('0x45')]({'where':{'id':_0x2c2898['params']['id']}})[_0x1c7d('0x24')](handleEntityNotFound(_0x1c6623,null))[_0x1c7d('0x24')](removeEntity(_0x1c6623,null))[_0x1c7d('0x40')](handleError(_0x1c6623,null));}; \ No newline at end of file +var _0xd0e4=['lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','then','stack','name','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','ZohoField','include','findAll','catch','show','keys','options','find','create','body','update','params','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox'];(function(_0x515228,_0xba4d2e){var _0x9c403c=function(_0x2a01c2){while(--_0x2a01c2){_0x515228['push'](_0x515228['shift']());}};_0x9c403c(++_0xba4d2e);}(_0xd0e4,0x1d3));var _0x4d0e=function(_0x457d00,_0x4cc70c){_0x457d00=_0x457d00-0x0;var _0x5a87f6=_0xd0e4[_0x457d00];return _0x5a87f6;};'use strict';var emlformat=require(_0x4d0e('0x0'));var rimraf=require(_0x4d0e('0x1'));var zipdir=require(_0x4d0e('0x2'));var jsonpatch=require(_0x4d0e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4d0e('0x4'));var Mustache=require(_0x4d0e('0x5'));var util=require(_0x4d0e('0x6'));var path=require(_0x4d0e('0x7'));var sox=require(_0x4d0e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d0e('0x9'));var squel=require(_0x4d0e('0xa'));var crypto=require('crypto');var jsforce=require(_0x4d0e('0xb'));var deskjs=require(_0x4d0e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4d0e('0xd'));var Redis=require('ioredis');var authService=require(_0x4d0e('0xe'));var qs=require(_0x4d0e('0xf'));var as=require(_0x4d0e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4d0e('0x11'))(_0x4d0e('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4d0e('0x13'));var db=require(_0x4d0e('0x14'))['db'];function respondWithStatusCode(_0x2d8006,_0x181c6a){_0x181c6a=_0x181c6a||0xcc;return function(_0x43594b){if(_0x43594b){return _0x2d8006[_0x4d0e('0x15')](_0x181c6a);}return _0x2d8006[_0x4d0e('0x16')](_0x181c6a)[_0x4d0e('0x17')]();};}function respondWithResult(_0x2139e8,_0x4fcf8d){_0x4fcf8d=_0x4fcf8d||0xc8;return function(_0x8f0fde){if(_0x8f0fde){return _0x2139e8[_0x4d0e('0x16')](_0x4fcf8d)[_0x4d0e('0x18')](_0x8f0fde);}};}function respondWithFilteredResult(_0x53d5d1,_0x3d0a15){return function(_0x4f077f){if(_0x4f077f){var _0x12efdb=typeof _0x3d0a15[_0x4d0e('0x19')]===_0x4d0e('0x1a')&&typeof _0x3d0a15[_0x4d0e('0x1b')]===_0x4d0e('0x1a');var _0x2ee85a=_0x4f077f[_0x4d0e('0x1c')];var _0x501c6b=_0x12efdb?0x0:_0x3d0a15[_0x4d0e('0x19')];var _0x2ea57f=_0x12efdb?_0x4f077f[_0x4d0e('0x1c')]:_0x3d0a15['offset']+_0x3d0a15[_0x4d0e('0x1b')];var _0x2846d1;if(_0x2ea57f>=_0x2ee85a){_0x2ea57f=_0x2ee85a;_0x2846d1=0xc8;}else{_0x2846d1=0xce;}_0x53d5d1[_0x4d0e('0x16')](_0x2846d1);return _0x53d5d1[_0x4d0e('0x1d')](_0x4d0e('0x1e'),_0x501c6b+'-'+_0x2ea57f+'/'+_0x2ee85a)[_0x4d0e('0x18')](_0x4f077f);}return null;};}function patchUpdates(_0x3dc65b){return function(_0x1d6e52){try{jsonpatch[_0x4d0e('0x1f')](_0x1d6e52,_0x3dc65b,!![]);}catch(_0x240a4c){return BPromise[_0x4d0e('0x20')](_0x240a4c);}return _0x1d6e52['save']();};}function saveUpdates(_0x5df7df,_0x18ecb5){return function(_0x1a1a3d){if(_0x1a1a3d){return _0x1a1a3d['update'](_0x5df7df)['then'](function(_0x3ee308){return _0x3ee308;});}return null;};}function removeEntity(_0x1e1ad2,_0x3092e1){return function(_0x13e74f){if(_0x13e74f){return _0x13e74f[_0x4d0e('0x21')]()[_0x4d0e('0x22')](function(){_0x1e1ad2[_0x4d0e('0x16')](0xcc)[_0x4d0e('0x17')]();});}};}function handleEntityNotFound(_0x3411dd,_0x557e6a){return function(_0x35f58a){if(!_0x35f58a){_0x3411dd[_0x4d0e('0x15')](0x194);}return _0x35f58a;};}function handleError(_0x1a237f,_0x128d38){_0x128d38=_0x128d38||0x1f4;return function(_0x25043b){logger['error'](_0x25043b[_0x4d0e('0x23')]);if(_0x25043b[_0x4d0e('0x24')]){delete _0x25043b['name'];}_0x1a237f[_0x4d0e('0x16')](_0x128d38)['send'](_0x25043b);};}exports['index']=function(_0x2127b4,_0x1073c6){var _0x427582={},_0x372a87={},_0x17f7c2={'count':0x0,'rows':[]};var _0x7e551d=_[_0x4d0e('0x25')](db['ZohoField'][_0x4d0e('0x26')],function(_0x488e21){return{'name':_0x488e21['fieldName'],'type':_0x488e21[_0x4d0e('0x27')][_0x4d0e('0x28')]};});_0x372a87[_0x4d0e('0x29')]=_[_0x4d0e('0x25')](_0x7e551d,_0x4d0e('0x24'));_0x372a87[_0x4d0e('0x2a')]=_['keys'](_0x2127b4[_0x4d0e('0x2a')]);_0x372a87[_0x4d0e('0x2b')]=_[_0x4d0e('0x2c')](_0x372a87[_0x4d0e('0x29')],_0x372a87['query']);_0x427582[_0x4d0e('0x2d')]=_[_0x4d0e('0x2c')](_0x372a87[_0x4d0e('0x29')],qs[_0x4d0e('0x2e')](_0x2127b4[_0x4d0e('0x2a')][_0x4d0e('0x2e')]));_0x427582[_0x4d0e('0x2d')]=_0x427582['attributes'][_0x4d0e('0x2f')]?_0x427582[_0x4d0e('0x2d')]:_0x372a87['model'];if(!_0x2127b4[_0x4d0e('0x2a')][_0x4d0e('0x30')](_0x4d0e('0x31'))){_0x427582[_0x4d0e('0x1b')]=qs[_0x4d0e('0x1b')](_0x2127b4[_0x4d0e('0x2a')][_0x4d0e('0x1b')]);_0x427582[_0x4d0e('0x19')]=qs[_0x4d0e('0x19')](_0x2127b4[_0x4d0e('0x2a')][_0x4d0e('0x19')]);}_0x427582[_0x4d0e('0x32')]=qs[_0x4d0e('0x33')](_0x2127b4[_0x4d0e('0x2a')][_0x4d0e('0x33')]);_0x427582[_0x4d0e('0x34')]=qs['filters'](_['pick'](_0x2127b4[_0x4d0e('0x2a')],_0x372a87[_0x4d0e('0x2b')]),_0x7e551d);if(_0x2127b4[_0x4d0e('0x2a')][_0x4d0e('0x35')]){_0x427582[_0x4d0e('0x34')]=_[_0x4d0e('0x36')](_0x427582[_0x4d0e('0x34')],{'$or':_['map'](_0x7e551d,function(_0x10e4ea){if(_0x10e4ea[_0x4d0e('0x27')]!==_0x4d0e('0x37')){var _0x5b763e={};_0x5b763e[_0x10e4ea[_0x4d0e('0x24')]]={'$like':'%'+_0x2127b4[_0x4d0e('0x2a')]['filter']+'%'};return _0x5b763e;}})});}_0x427582=_[_0x4d0e('0x36')]({},_0x427582,_0x2127b4['options']);var _0x28aedf={'where':_0x427582['where']};return db[_0x4d0e('0x38')][_0x4d0e('0x1c')](_0x28aedf)['then'](function(_0x2903ea){_0x17f7c2[_0x4d0e('0x1c')]=_0x2903ea;if(_0x2127b4[_0x4d0e('0x2a')]['includeAll']){_0x427582[_0x4d0e('0x39')]=[{'all':!![]}];}return db['ZohoField'][_0x4d0e('0x3a')](_0x427582);})[_0x4d0e('0x22')](function(_0x193115){_0x17f7c2['rows']=_0x193115;return _0x17f7c2;})['then'](respondWithFilteredResult(_0x1073c6,_0x427582))[_0x4d0e('0x3b')](handleError(_0x1073c6,null));};exports[_0x4d0e('0x3c')]=function(_0x18dd56,_0x4d9fa8){var _0xfb47ff={'raw':!![],'where':{'id':_0x18dd56['params']['id']}},_0x1a7b57={};_0x1a7b57[_0x4d0e('0x29')]=_[_0x4d0e('0x3d')](db[_0x4d0e('0x38')]['rawAttributes']);_0x1a7b57[_0x4d0e('0x2a')]=_['keys'](_0x18dd56[_0x4d0e('0x2a')]);_0x1a7b57['filters']=_[_0x4d0e('0x2c')](_0x1a7b57[_0x4d0e('0x29')],_0x1a7b57[_0x4d0e('0x2a')]);_0xfb47ff[_0x4d0e('0x2d')]=_[_0x4d0e('0x2c')](_0x1a7b57[_0x4d0e('0x29')],qs[_0x4d0e('0x2e')](_0x18dd56[_0x4d0e('0x2a')][_0x4d0e('0x2e')]));_0xfb47ff[_0x4d0e('0x2d')]=_0xfb47ff[_0x4d0e('0x2d')][_0x4d0e('0x2f')]?_0xfb47ff[_0x4d0e('0x2d')]:_0x1a7b57[_0x4d0e('0x29')];if(_0x18dd56[_0x4d0e('0x2a')]['includeAll']){_0xfb47ff['include']=[{'all':!![]}];}_0xfb47ff=_[_0x4d0e('0x36')]({},_0xfb47ff,_0x18dd56[_0x4d0e('0x3e')]);return db[_0x4d0e('0x38')][_0x4d0e('0x3f')](_0xfb47ff)[_0x4d0e('0x22')](handleEntityNotFound(_0x4d9fa8,null))[_0x4d0e('0x22')](respondWithResult(_0x4d9fa8,null))[_0x4d0e('0x3b')](handleError(_0x4d9fa8,null));};exports[_0x4d0e('0x40')]=function(_0x2a8bd9,_0x639d65){return db[_0x4d0e('0x38')]['create'](_0x2a8bd9[_0x4d0e('0x41')],{})[_0x4d0e('0x22')](respondWithResult(_0x639d65,0xc9))[_0x4d0e('0x3b')](handleError(_0x639d65,null));};exports[_0x4d0e('0x42')]=function(_0x194335,_0x55ef78){if(_0x194335[_0x4d0e('0x41')]['id']){delete _0x194335[_0x4d0e('0x41')]['id'];}return db[_0x4d0e('0x38')][_0x4d0e('0x3f')]({'where':{'id':_0x194335[_0x4d0e('0x43')]['id']}})[_0x4d0e('0x22')](handleEntityNotFound(_0x55ef78,null))['then'](saveUpdates(_0x194335[_0x4d0e('0x41')],null))['then'](respondWithResult(_0x55ef78,null))[_0x4d0e('0x3b')](handleError(_0x55ef78,null));};exports[_0x4d0e('0x21')]=function(_0x28c938,_0xe25cb9){return db['ZohoField'][_0x4d0e('0x3f')]({'where':{'id':_0x28c938[_0x4d0e('0x43')]['id']}})[_0x4d0e('0x22')](handleEntityNotFound(_0xe25cb9,null))[_0x4d0e('0x22')](removeEntity(_0xe25cb9,null))[_0x4d0e('0x3b')](handleError(_0xe25cb9,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 86a8236..13c9309 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 _0x0295=['rimraf','../../config/environment','./intZohoField.attributes','exports','define','idField','lodash','api','request-promise','path'];(function(_0x15ee53,_0x50ee0a){var _0x25fc9f=function(_0x5cd6f1){while(--_0x5cd6f1){_0x15ee53['push'](_0x15ee53['shift']());}};_0x25fc9f(++_0x50ee0a);}(_0x0295,0x1f0));var _0x5029=function(_0x29c8c4,_0x2cdf25){_0x29c8c4=_0x29c8c4-0x0;var _0xf11b18=_0x0295[_0x29c8c4];return _0xf11b18;};'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')]('ZohoField',attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x5029('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x896e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','FieldId','lodash','util','../../config/logger','api'];(function(_0x184d15,_0x156b5d){var _0x4989da=function(_0x5ea4f0){while(--_0x5ea4f0){_0x184d15['push'](_0x184d15['shift']());}};_0x4989da(++_0x156b5d);}(_0x896e,0x1e9));var _0xe896=function(_0x848182,_0x1f8c34){_0x848182=_0x848182-0x0;var _0x377ff6=_0x896e[_0x848182];return _0x377ff6;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var logger=require(_0xe896('0x2'))(_0xe896('0x3'));var moment=require(_0xe896('0x4'));var BPromise=require(_0xe896('0x5'));var rp=require(_0xe896('0x6'));var fs=require('fs');var path=require(_0xe896('0x7'));var rimraf=require(_0xe896('0x8'));var config=require(_0xe896('0x9'));var attributes=require(_0xe896('0xa'));module[_0xe896('0xb')]=function(_0x52ac80,_0x24c430){return _0x52ac80[_0xe896('0xc')](_0xe896('0xd'),attributes,{'tableName':_0xe896('0xe'),'paranoid':![],'indexes':[{'name':_0xe896('0xf'),'fields':['idField',_0xe896('0x10')],'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 6b60c7d..7a1a495 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 _0x8438=['../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','code','ZohoField,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5f3f06,_0x153d38){var _0xb37f1=function(_0x534d2f){while(--_0x534d2f){_0x5f3f06['push'](_0x5f3f06['shift']());}};_0xb37f1(++_0x153d38);}(_0x8438,0x19e));var _0x8843=function(_0x4dddbc,_0xe5596){_0x4dddbc=_0x4dddbc-0x0;var _0x4f9617=_0x8438[_0x4dddbc];return _0x4f9617;};'use strict';var _=require('lodash');var util=require(_0x8843('0x0'));var moment=require(_0x8843('0x1'));var BPromise=require(_0x8843('0x2'));var rs=require(_0x8843('0x3'));var fs=require('fs');var Redis=require(_0x8843('0x4'));var db=require(_0x8843('0x5'))['db'];var utils=require(_0x8843('0x6'));var logger=require('../../config/logger')(_0x8843('0x7'));var config=require(_0x8843('0x8'));var jayson=require(_0x8843('0x9'));var client=jayson['client'][_0x8843('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51e64f,_0x33e330,_0x2a0cf9){return new BPromise(function(_0x5a25e,_0x54eddb){return client['request'](_0x51e64f,_0x2a0cf9)[_0x8843('0xb')](function(_0x569e04){logger[_0x8843('0xc')]('ZohoField,\x20%s,\x20%s',_0x33e330,_0x8843('0xd'));logger[_0x8843('0xe')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x33e330,'request\x20sent',JSON['stringify'](_0x569e04));if(_0x569e04['error']){if(_0x569e04['error'][_0x8843('0xf')]===0x1f4){logger['error'](_0x8843('0x10'),_0x33e330,_0x569e04[_0x8843('0x11')][_0x8843('0x12')]);return _0x54eddb(_0x569e04[_0x8843('0x11')][_0x8843('0x12')]);}logger[_0x8843('0x11')](_0x8843('0x10'),_0x33e330,_0x569e04['error']['message']);return _0x5a25e(_0x569e04['error'][_0x8843('0x12')]);}else{logger[_0x8843('0xc')](_0x8843('0x10'),_0x33e330,_0x8843('0xd'));_0x5a25e(_0x569e04[_0x8843('0x13')][_0x8843('0x12')]);}})[_0x8843('0x14')](function(_0x3663ad){logger['error'](_0x8843('0x10'),_0x33e330,_0x3663ad);_0x54eddb(_0x3663ad);});});} \ No newline at end of file +var _0x4abb=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4687e0,_0x1a89da){var _0x1db59c=function(_0x3933bf){while(--_0x3933bf){_0x4687e0['push'](_0x4687e0['shift']());}};_0x1db59c(++_0x1a89da);}(_0x4abb,0xc8));var _0xb4ab=function(_0x5bf81d,_0xcea823){_0x5bf81d=_0x5bf81d-0x0;var _0x536f79=_0x4abb[_0x5bf81d];return _0x536f79;};'use strict';var _=require(_0xb4ab('0x0'));var util=require(_0xb4ab('0x1'));var moment=require(_0xb4ab('0x2'));var BPromise=require(_0xb4ab('0x3'));var rs=require(_0xb4ab('0x4'));var fs=require('fs');var Redis=require(_0xb4ab('0x5'));var db=require(_0xb4ab('0x6'))['db'];var utils=require(_0xb4ab('0x7'));var logger=require(_0xb4ab('0x8'))(_0xb4ab('0x9'));var config=require(_0xb4ab('0xa'));var jayson=require(_0xb4ab('0xb'));var client=jayson[_0xb4ab('0xc')][_0xb4ab('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3a17da,_0x243c5d,_0x3f106b){return new BPromise(function(_0x47c03a,_0x34f5bb){return client[_0xb4ab('0xe')](_0x3a17da,_0x3f106b)['then'](function(_0x14f752){logger[_0xb4ab('0xf')](_0xb4ab('0x10'),_0x243c5d,_0xb4ab('0x11'));logger[_0xb4ab('0x12')](_0xb4ab('0x13'),_0x243c5d,_0xb4ab('0x11'),JSON[_0xb4ab('0x14')](_0x14f752));if(_0x14f752[_0xb4ab('0x15')]){if(_0x14f752['error'][_0xb4ab('0x16')]===0x1f4){logger[_0xb4ab('0x15')](_0xb4ab('0x10'),_0x243c5d,_0x14f752['error'][_0xb4ab('0x17')]);return _0x34f5bb(_0x14f752[_0xb4ab('0x15')][_0xb4ab('0x17')]);}logger[_0xb4ab('0x15')](_0xb4ab('0x10'),_0x243c5d,_0x14f752['error'][_0xb4ab('0x17')]);return _0x47c03a(_0x14f752[_0xb4ab('0x15')]['message']);}else{logger[_0xb4ab('0xf')](_0xb4ab('0x10'),_0x243c5d,_0xb4ab('0x11'));_0x47c03a(_0x14f752[_0xb4ab('0x18')][_0xb4ab('0x17')]);}})[_0xb4ab('0x19')](function(_0x2b4fd6){logger[_0xb4ab('0x15')](_0xb4ab('0x10'),_0x243c5d,_0x2b4fd6);_0x34f5bb(_0x2b4fd6);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 2294be2..5c12185 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x24d110,_0x162b41){var _0x322f93=function(_0xac7358){while(--_0xac7358){_0x24d110['push'](_0x24d110['shift']());}};_0x322f93(++_0x162b41);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2a3bad,_0x227f4e){var _0x4bd6ea=function(_0x2968e5){while(--_0x2968e5){_0x2a3bad['push'](_0x2a3bad['shift']());}};_0x4bd6ea(++_0x227f4e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 10e1acb..48945dc 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 _0xbc9b=['STRING','state','sequelize','exports','unique_name_and_version'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xbc9b,0x1d3));var _0xbbc9=function(_0x172e5f,_0x4f38f1){_0x172e5f=_0x172e5f-0x0;var _0x338e29=_0xbc9b[_0x172e5f];return _0x338e29;};'use strict';var Sequelize=require(_0xbbc9('0x0'));module[_0xbbc9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbbc9('0x2')},'version':{'type':Sequelize[_0xbbc9('0x3')],'allowNull':![],'unique':_0xbbc9('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0xbbc9('0x3')]},'path':{'type':Sequelize[_0xbbc9('0x3')]},'type':{'type':Sequelize[_0xbbc9('0x3')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0xbbc9('0x3')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize['STRING'],'unique':_0xbbc9('0x4')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0xbbc9('0x3')]},'remoteUri':{'type':Sequelize[_0xbbc9('0x3')]},'link':{'type':Sequelize[_0xbbc9('0x3')],'defaultValue':'#'}}; \ No newline at end of file +var _0x7abb=['unique_name_and_version','app.js','INTEGER','BOOLEAN','state','sequelize','exports','STRING'];(function(_0x29632e,_0x5ecba4){var _0x426e04=function(_0x4eb357){while(--_0x4eb357){_0x29632e['push'](_0x29632e['shift']());}};_0x426e04(++_0x5ecba4);}(_0x7abb,0xe5));var _0xb7ab=function(_0x39a10e,_0x4f0375){_0x39a10e=_0x39a10e-0x0;var _0x46caae=_0x7abb[_0x39a10e];return _0x46caae;};'use strict';var Sequelize=require(_0xb7ab('0x0'));module[_0xb7ab('0x1')]={'name':{'type':Sequelize[_0xb7ab('0x2')],'allowNull':![],'unique':_0xb7ab('0x3')},'version':{'type':Sequelize[_0xb7ab('0x2')],'allowNull':![],'unique':_0xb7ab('0x3')},'main':{'type':Sequelize[_0xb7ab('0x2')],'defaultValue':_0xb7ab('0x4')},'filename':{'type':Sequelize[_0xb7ab('0x2')]},'path':{'type':Sequelize[_0xb7ab('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0xb7ab('0x5')]},'active':{'type':Sequelize[_0xb7ab('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0xb7ab('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0xb7ab('0x2')],'unique':_0xb7ab('0x7')},'description':{'type':Sequelize[_0xb7ab('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xb7ab('0x2')]},'link':{'type':Sequelize[_0xb7ab('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 650c062..1684f07 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 _0x7096=['offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','params','Integration','find','catch','create','body','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end'];(function(_0x2a1e6a,_0x493d4b){var _0x1b790b=function(_0x1ff971){while(--_0x1ff971){_0x2a1e6a['push'](_0x2a1e6a['shift']());}};_0x1b790b(++_0x493d4b);}(_0x7096,0x10c));var _0x6709=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x7096[_0x2b5eae];return _0x5f3ac9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6709('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6709('0x1'));var rp=require('request-promise');var moment=require(_0x6709('0x2'));var BPromise=require(_0x6709('0x3'));var Mustache=require(_0x6709('0x4'));var util=require(_0x6709('0x5'));var path=require(_0x6709('0x6'));var sox=require(_0x6709('0x7'));var csv=require(_0x6709('0x8'));var ejs=require(_0x6709('0x9'));var fs=require('fs');var fs_extra=require(_0x6709('0xa'));var _=require(_0x6709('0xb'));var squel=require(_0x6709('0xc'));var crypto=require(_0x6709('0xd'));var jsforce=require(_0x6709('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6709('0xf'));var Papa=require(_0x6709('0x10'));var Redis=require(_0x6709('0x11'));var authService=require(_0x6709('0x12'));var qs=require(_0x6709('0x13'));var as=require(_0x6709('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6709('0x15'));var utils=require(_0x6709('0x16'));var config=require(_0x6709('0x17'));var licenseUtil=require(_0x6709('0x18'));var db=require(_0x6709('0x19'))['db'];function respondWithStatusCode(_0x288f51,_0x1d56a5){_0x1d56a5=_0x1d56a5||0xcc;return function(_0x1ac547){if(_0x1ac547){return _0x288f51['sendStatus'](_0x1d56a5);}return _0x288f51[_0x6709('0x1a')](_0x1d56a5)[_0x6709('0x1b')]();};}function respondWithResult(_0x4d5255,_0x3706e1){_0x3706e1=_0x3706e1||0xc8;return function(_0x4e4587){if(_0x4e4587){return _0x4d5255[_0x6709('0x1a')](_0x3706e1)['json'](_0x4e4587);}};}function respondWithFilteredResult(_0x41af1f,_0x4bc059){return function(_0x149233){if(_0x149233){var _0x28866a=typeof _0x4bc059[_0x6709('0x1c')]===_0x6709('0x1d')&&typeof _0x4bc059['limit']==='undefined';var _0x5c4f94=_0x149233[_0x6709('0x1e')];var _0x235a54=_0x28866a?0x0:_0x4bc059['offset'];var _0x9c1fd8=_0x28866a?_0x149233[_0x6709('0x1e')]:_0x4bc059[_0x6709('0x1c')]+_0x4bc059['limit'];var _0x13cf04;if(_0x9c1fd8>=_0x5c4f94){_0x9c1fd8=_0x5c4f94;_0x13cf04=0xc8;}else{_0x13cf04=0xce;}_0x41af1f[_0x6709('0x1a')](_0x13cf04);return _0x41af1f[_0x6709('0x1f')](_0x6709('0x20'),_0x235a54+'-'+_0x9c1fd8+'/'+_0x5c4f94)['json'](_0x149233);}return null;};}function patchUpdates(_0x3c4971){return function(_0x1edac3){try{jsonpatch[_0x6709('0x21')](_0x1edac3,_0x3c4971,!![]);}catch(_0x3cf882){return BPromise[_0x6709('0x22')](_0x3cf882);}return _0x1edac3[_0x6709('0x23')]();};}function saveUpdates(_0x45921e,_0x17763d){return function(_0x386224){if(_0x386224){return _0x386224[_0x6709('0x24')](_0x45921e)[_0x6709('0x25')](function(_0xa36371){return _0xa36371;});}return null;};}function removeEntity(_0x5cf48b,_0x29f25f){return function(_0x81138e){if(_0x81138e){return _0x81138e[_0x6709('0x26')]()['then'](function(){_0x5cf48b[_0x6709('0x1a')](0xcc)[_0x6709('0x1b')]();});}};}function handleEntityNotFound(_0x20a347,_0x44b465){return function(_0x588e00){if(!_0x588e00){_0x20a347[_0x6709('0x27')](0x194);}return _0x588e00;};}function handleError(_0x3076fe,_0x50f7d6){_0x50f7d6=_0x50f7d6||0x1f4;return function(_0x585073){logger[_0x6709('0x28')](_0x585073['stack']);if(_0x585073[_0x6709('0x29')]){delete _0x585073[_0x6709('0x29')];}_0x3076fe['status'](_0x50f7d6)[_0x6709('0x2a')](_0x585073);};}exports['index']=function(_0x46a325,_0x3cd555){var _0x5b6906={},_0x137137={},_0x4e6989={'count':0x0,'rows':[]};var _0xe066d8=_[_0x6709('0x2b')](db['Integration'][_0x6709('0x2c')],function(_0x5deff5){return{'name':_0x5deff5[_0x6709('0x2d')],'type':_0x5deff5[_0x6709('0x2e')]['key']};});_0x137137['model']=_[_0x6709('0x2b')](_0xe066d8,_0x6709('0x29'));_0x137137[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x46a325[_0x6709('0x2f')]);_0x137137[_0x6709('0x31')]=_[_0x6709('0x32')](_0x137137[_0x6709('0x33')],_0x137137[_0x6709('0x2f')]);_0x5b6906['attributes']=_[_0x6709('0x32')](_0x137137[_0x6709('0x33')],qs[_0x6709('0x34')](_0x46a325[_0x6709('0x2f')]['fields']));_0x5b6906[_0x6709('0x35')]=_0x5b6906[_0x6709('0x35')][_0x6709('0x36')]?_0x5b6906[_0x6709('0x35')]:_0x137137['model'];if(!_0x46a325[_0x6709('0x2f')][_0x6709('0x37')]('nolimit')){_0x5b6906[_0x6709('0x38')]=qs[_0x6709('0x38')](_0x46a325['query'][_0x6709('0x38')]);_0x5b6906[_0x6709('0x1c')]=qs[_0x6709('0x1c')](_0x46a325[_0x6709('0x2f')][_0x6709('0x1c')]);}_0x5b6906[_0x6709('0x39')]=qs[_0x6709('0x3a')](_0x46a325['query'][_0x6709('0x3a')]);_0x5b6906[_0x6709('0x3b')]=qs['filters'](_[_0x6709('0x3c')](_0x46a325[_0x6709('0x2f')],_0x137137[_0x6709('0x31')]),_0xe066d8);if(_0x46a325[_0x6709('0x2f')][_0x6709('0x3d')]){_0x5b6906[_0x6709('0x3b')]=_['merge'](_0x5b6906[_0x6709('0x3b')],{'$or':_['map'](_0xe066d8,function(_0x31e05a){if(_0x31e05a[_0x6709('0x2e')]!==_0x6709('0x3e')){var _0x48492f={};_0x48492f[_0x31e05a[_0x6709('0x29')]]={'$like':'%'+_0x46a325[_0x6709('0x2f')][_0x6709('0x3d')]+'%'};return _0x48492f;}})});}_0x5b6906=_[_0x6709('0x3f')]({},_0x5b6906,_0x46a325[_0x6709('0x40')]);var _0x1030ee={'where':_0x5b6906[_0x6709('0x3b')]};return db['Integration'][_0x6709('0x1e')](_0x1030ee)[_0x6709('0x25')](function(_0x50fbcd){_0x4e6989[_0x6709('0x1e')]=_0x50fbcd;if(_0x46a325[_0x6709('0x2f')][_0x6709('0x41')]){_0x5b6906[_0x6709('0x42')]=[{'all':!![]}];}return db['Integration']['findAll'](_0x5b6906);})[_0x6709('0x25')](function(_0x3f0da1){_0x4e6989[_0x6709('0x43')]=_0x3f0da1;return _0x4e6989;})[_0x6709('0x25')](respondWithFilteredResult(_0x3cd555,_0x5b6906))['catch'](handleError(_0x3cd555,null));};exports['show']=function(_0x5af1fb,_0x3d4237){var _0x293577={'raw':![],'where':{'id':_0x5af1fb[_0x6709('0x44')]['id']}},_0x54f74e={};_0x54f74e[_0x6709('0x33')]=_['keys'](db['Integration'][_0x6709('0x2c')]);_0x54f74e[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x5af1fb[_0x6709('0x2f')]);_0x54f74e[_0x6709('0x31')]=_['intersection'](_0x54f74e[_0x6709('0x33')],_0x54f74e['query']);_0x293577[_0x6709('0x35')]=_[_0x6709('0x32')](_0x54f74e[_0x6709('0x33')],qs['fields'](_0x5af1fb[_0x6709('0x2f')]['fields']));_0x293577['attributes']=_0x293577[_0x6709('0x35')][_0x6709('0x36')]?_0x293577[_0x6709('0x35')]:_0x54f74e[_0x6709('0x33')];if(_0x5af1fb[_0x6709('0x2f')][_0x6709('0x41')]){_0x293577[_0x6709('0x42')]=[{'all':!![]}];}_0x293577=_[_0x6709('0x3f')]({},_0x293577,_0x5af1fb[_0x6709('0x40')]);return db[_0x6709('0x45')][_0x6709('0x46')](_0x293577)[_0x6709('0x25')](handleEntityNotFound(_0x3d4237,null))[_0x6709('0x25')](respondWithResult(_0x3d4237,null))[_0x6709('0x47')](handleError(_0x3d4237,null));};exports[_0x6709('0x48')]=function(_0x4f82a0,_0xfbb810){return db['Integration']['create'](_0x4f82a0[_0x6709('0x49')],{})[_0x6709('0x25')](respondWithResult(_0xfbb810,0xc9))[_0x6709('0x47')](handleError(_0xfbb810,null));};exports[_0x6709('0x24')]=function(_0x22363b,_0x2b05dc){if(_0x22363b[_0x6709('0x49')]['id']){delete _0x22363b[_0x6709('0x49')]['id'];}return db['Integration'][_0x6709('0x46')]({'where':{'id':_0x22363b[_0x6709('0x44')]['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x2b05dc,null))[_0x6709('0x25')](saveUpdates(_0x22363b['body'],null))[_0x6709('0x25')](respondWithResult(_0x2b05dc,null))['catch'](handleError(_0x2b05dc,null));};exports[_0x6709('0x26')]=function(_0x34a950,_0x2a563b){return db[_0x6709('0x45')][_0x6709('0x46')]({'where':{'id':_0x34a950['params']['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x2a563b,null))[_0x6709('0x25')](removeEntity(_0x2a563b,null))[_0x6709('0x47')](handleError(_0x2a563b,null));}; \ No newline at end of file +var _0x4819=['bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','map','Integration','rawAttributes','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','count','includeAll','include','catch','show','keys','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4819,0xcd));var _0x9481=function(_0x27a900,_0x1cc305){_0x27a900=_0x27a900-0x0;var _0xea9b1f=_0x4819[_0x27a900];return _0xea9b1f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9481('0x0'));var zipdir=require(_0x9481('0x1'));var jsonpatch=require(_0x9481('0x2'));var rp=require(_0x9481('0x3'));var moment=require(_0x9481('0x4'));var BPromise=require(_0x9481('0x5'));var Mustache=require(_0x9481('0x6'));var util=require(_0x9481('0x7'));var path=require(_0x9481('0x8'));var sox=require(_0x9481('0x9'));var csv=require('to-csv');var ejs=require(_0x9481('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9481('0xb'));var crypto=require(_0x9481('0xc'));var jsforce=require(_0x9481('0xd'));var deskjs=require(_0x9481('0xe'));var toCsv=require(_0x9481('0xf'));var querystring=require('querystring');var Papa=require(_0x9481('0x10'));var Redis=require('ioredis');var authService=require(_0x9481('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9481('0x12'));var hardwareService=require(_0x9481('0x13'));var logger=require(_0x9481('0x14'))(_0x9481('0x15'));var utils=require(_0x9481('0x16'));var config=require(_0x9481('0x17'));var licenseUtil=require(_0x9481('0x18'));var db=require(_0x9481('0x19'))['db'];function respondWithStatusCode(_0xed8e9,_0x499b87){_0x499b87=_0x499b87||0xcc;return function(_0x5aac02){if(_0x5aac02){return _0xed8e9[_0x9481('0x1a')](_0x499b87);}return _0xed8e9[_0x9481('0x1b')](_0x499b87)[_0x9481('0x1c')]();};}function respondWithResult(_0x28fcb6,_0x3d23c2){_0x3d23c2=_0x3d23c2||0xc8;return function(_0xc7a0b5){if(_0xc7a0b5){return _0x28fcb6[_0x9481('0x1b')](_0x3d23c2)['json'](_0xc7a0b5);}};}function respondWithFilteredResult(_0x4220f1,_0x7a7ee){return function(_0x5b1fe6){if(_0x5b1fe6){var _0x2266d5=typeof _0x7a7ee['offset']===_0x9481('0x1d')&&typeof _0x7a7ee[_0x9481('0x1e')]===_0x9481('0x1d');var _0x2bb2a4=_0x5b1fe6['count'];var _0x5eda66=_0x2266d5?0x0:_0x7a7ee[_0x9481('0x1f')];var _0x50a559=_0x2266d5?_0x5b1fe6['count']:_0x7a7ee[_0x9481('0x1f')]+_0x7a7ee[_0x9481('0x1e')];var _0x18c6f5;if(_0x50a559>=_0x2bb2a4){_0x50a559=_0x2bb2a4;_0x18c6f5=0xc8;}else{_0x18c6f5=0xce;}_0x4220f1[_0x9481('0x1b')](_0x18c6f5);return _0x4220f1[_0x9481('0x20')](_0x9481('0x21'),_0x5eda66+'-'+_0x50a559+'/'+_0x2bb2a4)['json'](_0x5b1fe6);}return null;};}function patchUpdates(_0x2cf1aa){return function(_0x272a84){try{jsonpatch[_0x9481('0x22')](_0x272a84,_0x2cf1aa,!![]);}catch(_0x615e02){return BPromise[_0x9481('0x23')](_0x615e02);}return _0x272a84['save']();};}function saveUpdates(_0x215dd7,_0x294908){return function(_0x572599){if(_0x572599){return _0x572599[_0x9481('0x24')](_0x215dd7)[_0x9481('0x25')](function(_0x352b3a){return _0x352b3a;});}return null;};}function removeEntity(_0x1809d2,_0x2dc02e){return function(_0x49ecfa){if(_0x49ecfa){return _0x49ecfa[_0x9481('0x26')]()[_0x9481('0x25')](function(){_0x1809d2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x12b0c3,_0x299e28){return function(_0x550fce){if(!_0x550fce){_0x12b0c3[_0x9481('0x1a')](0x194);}return _0x550fce;};}function handleError(_0x20ff9a,_0xeff0a5){_0xeff0a5=_0xeff0a5||0x1f4;return function(_0x28ae1b){logger['error'](_0x28ae1b[_0x9481('0x27')]);if(_0x28ae1b[_0x9481('0x28')]){delete _0x28ae1b[_0x9481('0x28')];}_0x20ff9a['status'](_0xeff0a5)[_0x9481('0x29')](_0x28ae1b);};}exports['index']=function(_0x2e1eff,_0xe153ab){var _0x22ab26={},_0x13ef93={},_0x2e5e63={'count':0x0,'rows':[]};var _0x53560d=_[_0x9481('0x2a')](db[_0x9481('0x2b')][_0x9481('0x2c')],function(_0x4895a0){return{'name':_0x4895a0['fieldName'],'type':_0x4895a0[_0x9481('0x2d')][_0x9481('0x2e')]};});_0x13ef93[_0x9481('0x2f')]=_[_0x9481('0x2a')](_0x53560d,'name');_0x13ef93['query']=_['keys'](_0x2e1eff[_0x9481('0x30')]);_0x13ef93['filters']=_[_0x9481('0x31')](_0x13ef93['model'],_0x13ef93[_0x9481('0x30')]);_0x22ab26[_0x9481('0x32')]=_[_0x9481('0x31')](_0x13ef93[_0x9481('0x2f')],qs[_0x9481('0x33')](_0x2e1eff['query'][_0x9481('0x33')]));_0x22ab26[_0x9481('0x32')]=_0x22ab26[_0x9481('0x32')]['length']?_0x22ab26[_0x9481('0x32')]:_0x13ef93[_0x9481('0x2f')];if(!_0x2e1eff[_0x9481('0x30')][_0x9481('0x34')](_0x9481('0x35'))){_0x22ab26[_0x9481('0x1e')]=qs['limit'](_0x2e1eff[_0x9481('0x30')]['limit']);_0x22ab26[_0x9481('0x1f')]=qs[_0x9481('0x1f')](_0x2e1eff[_0x9481('0x30')][_0x9481('0x1f')]);}_0x22ab26[_0x9481('0x36')]=qs[_0x9481('0x37')](_0x2e1eff['query'][_0x9481('0x37')]);_0x22ab26[_0x9481('0x38')]=qs['filters'](_['pick'](_0x2e1eff[_0x9481('0x30')],_0x13ef93['filters']),_0x53560d);if(_0x2e1eff[_0x9481('0x30')][_0x9481('0x39')]){_0x22ab26[_0x9481('0x38')]=_[_0x9481('0x3a')](_0x22ab26['where'],{'$or':_[_0x9481('0x2a')](_0x53560d,function(_0x590d50){if(_0x590d50[_0x9481('0x2d')]!=='VIRTUAL'){var _0x2ce972={};_0x2ce972[_0x590d50['name']]={'$like':'%'+_0x2e1eff[_0x9481('0x30')][_0x9481('0x39')]+'%'};return _0x2ce972;}})});}_0x22ab26=_[_0x9481('0x3a')]({},_0x22ab26,_0x2e1eff[_0x9481('0x3b')]);var _0x97dc3e={'where':_0x22ab26[_0x9481('0x38')]};return db[_0x9481('0x2b')]['count'](_0x97dc3e)[_0x9481('0x25')](function(_0x3857e8){_0x2e5e63[_0x9481('0x3c')]=_0x3857e8;if(_0x2e1eff[_0x9481('0x30')][_0x9481('0x3d')]){_0x22ab26[_0x9481('0x3e')]=[{'all':!![]}];}return db[_0x9481('0x2b')]['findAll'](_0x22ab26);})[_0x9481('0x25')](function(_0x1872ff){_0x2e5e63['rows']=_0x1872ff;return _0x2e5e63;})[_0x9481('0x25')](respondWithFilteredResult(_0xe153ab,_0x22ab26))[_0x9481('0x3f')](handleError(_0xe153ab,null));};exports[_0x9481('0x40')]=function(_0x3eb9ee,_0x29a8e9){var _0x5a8ffd={'raw':![],'where':{'id':_0x3eb9ee['params']['id']}},_0x304791={};_0x304791[_0x9481('0x2f')]=_[_0x9481('0x41')](db['Integration']['rawAttributes']);_0x304791[_0x9481('0x30')]=_[_0x9481('0x41')](_0x3eb9ee[_0x9481('0x30')]);_0x304791['filters']=_[_0x9481('0x31')](_0x304791[_0x9481('0x2f')],_0x304791['query']);_0x5a8ffd['attributes']=_[_0x9481('0x31')](_0x304791['model'],qs[_0x9481('0x33')](_0x3eb9ee[_0x9481('0x30')][_0x9481('0x33')]));_0x5a8ffd[_0x9481('0x32')]=_0x5a8ffd[_0x9481('0x32')]['length']?_0x5a8ffd[_0x9481('0x32')]:_0x304791[_0x9481('0x2f')];if(_0x3eb9ee['query'][_0x9481('0x3d')]){_0x5a8ffd[_0x9481('0x3e')]=[{'all':!![]}];}_0x5a8ffd=_[_0x9481('0x3a')]({},_0x5a8ffd,_0x3eb9ee[_0x9481('0x3b')]);return db[_0x9481('0x2b')][_0x9481('0x42')](_0x5a8ffd)[_0x9481('0x25')](handleEntityNotFound(_0x29a8e9,null))[_0x9481('0x25')](respondWithResult(_0x29a8e9,null))[_0x9481('0x3f')](handleError(_0x29a8e9,null));};exports['create']=function(_0xd36133,_0x5d3a06){return db['Integration'][_0x9481('0x43')](_0xd36133['body'],{})[_0x9481('0x25')](respondWithResult(_0x5d3a06,0xc9))[_0x9481('0x3f')](handleError(_0x5d3a06,null));};exports['update']=function(_0x277e2a,_0x1044a2){if(_0x277e2a[_0x9481('0x44')]['id']){delete _0x277e2a[_0x9481('0x44')]['id'];}return db[_0x9481('0x2b')][_0x9481('0x42')]({'where':{'id':_0x277e2a['params']['id']}})['then'](handleEntityNotFound(_0x1044a2,null))[_0x9481('0x25')](saveUpdates(_0x277e2a[_0x9481('0x44')],null))[_0x9481('0x25')](respondWithResult(_0x1044a2,null))[_0x9481('0x3f')](handleError(_0x1044a2,null));};exports[_0x9481('0x26')]=function(_0x353aab,_0x1c070c){return db[_0x9481('0x2b')]['find']({'where':{'id':_0x353aab[_0x9481('0x45')]['id']}})[_0x9481('0x25')](handleEntityNotFound(_0x1c070c,null))[_0x9481('0x25')](removeEntity(_0x1c070c,null))[_0x9481('0x3f')](handleError(_0x1c070c,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 3b32fb9..ffd2ec2 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 _0xcde2=['lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','exports','Integration','integrations'];(function(_0x192551,_0x160221){var _0x533857=function(_0x5047d3){while(--_0x5047d3){_0x192551['push'](_0x192551['shift']());}};_0x533857(++_0x160221);}(_0xcde2,0xd1));var _0x2cde=function(_0x357504,_0x49830d){_0x357504=_0x357504-0x0;var _0x389327=_0xcde2[_0x357504];return _0x389327;};'use strict';var _=require(_0x2cde('0x0'));var util=require(_0x2cde('0x1'));var logger=require('../../config/logger')(_0x2cde('0x2'));var moment=require(_0x2cde('0x3'));var BPromise=require(_0x2cde('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2cde('0x5'));var rimraf=require(_0x2cde('0x6'));var config=require(_0x2cde('0x7'));var attributes=require('./integration.attributes');module[_0x2cde('0x8')]=function(_0x14efba,_0x35d070){return _0x14efba['define'](_0x2cde('0x9'),attributes,{'tableName':_0x2cde('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d77=['moment','bluebird','path','rimraf','./integration.attributes','exports','define','util','api'];(function(_0x35f1de,_0x4dda19){var _0x4b66d6=function(_0x4ff6c5){while(--_0x4ff6c5){_0x35f1de['push'](_0x35f1de['shift']());}};_0x4b66d6(++_0x4dda19);}(_0x2d77,0x139));var _0x72d7=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x2d77[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0x72d7('0x0'));var logger=require('../../config/logger')(_0x72d7('0x1'));var moment=require(_0x72d7('0x2'));var BPromise=require(_0x72d7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x72d7('0x4'));var rimraf=require(_0x72d7('0x5'));var config=require('../../config/environment');var attributes=require(_0x72d7('0x6'));module[_0x72d7('0x7')]=function(_0x1e7f52,_0x2620a3){return _0x1e7f52[_0x72d7('0x8')]('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 2d30c58..145c417 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 _0x57ca=['client','http','request','info','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','error','code','Integration,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x4553d6,_0x28320c){var _0x2bcfb1=function(_0x44ad36){while(--_0x44ad36){_0x4553d6['push'](_0x4553d6['shift']());}};_0x2bcfb1(++_0x28320c);}(_0x57ca,0x108));var _0xa57c=function(_0x25408e,_0x457e2d){_0x25408e=_0x25408e-0x0;var _0xd3099d=_0x57ca[_0x25408e];return _0xd3099d;};'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')]('Integration,\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')]('Integration,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});} \ No newline at end of file +var _0xef0f=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x32d450,_0x216505){var _0x101dd4=function(_0x40e83c){while(--_0x40e83c){_0x32d450['push'](_0x32d450['shift']());}};_0x101dd4(++_0x216505);}(_0xef0f,0x168));var _0xfef0=function(_0x5224c5,_0x18ef01){_0x5224c5=_0x5224c5-0x0;var _0x1935cf=_0xef0f[_0x5224c5];return _0x1935cf;};'use strict';var _=require(_0xfef0('0x0'));var util=require('util');var moment=require(_0xfef0('0x1'));var BPromise=require(_0xfef0('0x2'));var rs=require(_0xfef0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfef0('0x4'))['db'];var utils=require(_0xfef0('0x5'));var logger=require(_0xfef0('0x6'))('rpc');var config=require(_0xfef0('0x7'));var jayson=require(_0xfef0('0x8'));var client=jayson[_0xfef0('0x9')][_0xfef0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xad43e,_0x11dfd7,_0x5130bd){return new BPromise(function(_0x41ec94,_0x58cf6d){return client[_0xfef0('0xb')](_0xad43e,_0x5130bd)[_0xfef0('0xc')](function(_0x3a81cc){logger[_0xfef0('0xd')](_0xfef0('0xe'),_0x11dfd7,_0xfef0('0xf'));logger[_0xfef0('0x10')](_0xfef0('0x11'),_0x11dfd7,_0xfef0('0xf'),JSON[_0xfef0('0x12')](_0x3a81cc));if(_0x3a81cc[_0xfef0('0x13')]){if(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x14')]===0x1f4){logger[_0xfef0('0x13')]('Integration,\x20%s,\x20%s',_0x11dfd7,_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);return _0x58cf6d(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);}logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x3a81cc[_0xfef0('0x13')]['message']);return _0x41ec94(_0x3a81cc[_0xfef0('0x13')]['message']);}else{logger['info']('Integration,\x20%s,\x20%s',_0x11dfd7,_0xfef0('0xf'));_0x41ec94(_0x3a81cc[_0xfef0('0x16')][_0xfef0('0x15')]);}})[_0xfef0('0x17')](function(_0x2a96d9){logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x2a96d9);_0x58cf6d(_0x2a96d9);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 6e3dd6f..7d8794c 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 _0x4137=['show','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','/:id'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x4137,0xf8));var _0x7413=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x4137[_0x178e48];return _0x440d7e;};'use strict';var multer=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var path=require(_0x7413('0x2'));var timeout=require(_0x7413('0x3'));var express=require(_0x7413('0x4'));var router=express[_0x7413('0x5')]();var fs_extra=require(_0x7413('0x6'));var auth=require(_0x7413('0x7'));var interaction=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var controller=require(_0x7413('0xa'));router[_0x7413('0xb')]('/',auth['isAuthenticated'](),controller[_0x7413('0xc')]);router[_0x7413('0xb')](_0x7413('0xd'),auth[_0x7413('0xe')](),controller['describe']);router[_0x7413('0xb')](_0x7413('0xf'),auth['isAuthenticated'](),controller[_0x7413('0x10')]);router[_0x7413('0x11')]('/',auth['isAuthenticated'](),controller[_0x7413('0x12')]);router[_0x7413('0x13')](_0x7413('0xf'),auth[_0x7413('0xe')](),controller[_0x7413('0x14')]);router['delete'](_0x7413('0xf'),auth[_0x7413('0xe')](),controller['destroy']);module[_0x7413('0x15')]=router; \ No newline at end of file +var _0xc6ac=['./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1e597e,_0x1bbd34){var _0x843e6f=function(_0x26204a){while(--_0x26204a){_0x1e597e['push'](_0x1e597e['shift']());}};_0x843e6f(++_0x1bbd34);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x59883d,_0x278481){_0x59883d=_0x59883d-0x0;var _0x439779=_0xc6ac[_0x59883d];return _0x439779;};'use strict';var multer=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var path=require(_0xcc6a('0x2'));var timeout=require(_0xcc6a('0x3'));var express=require(_0xcc6a('0x4'));var router=express[_0xcc6a('0x5')]();var fs_extra=require(_0xcc6a('0x6'));var auth=require(_0xcc6a('0x7'));var interaction=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var controller=require(_0xcc6a('0xa'));router[_0xcc6a('0xb')]('/',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xd')]);router['get'](_0xcc6a('0xe'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xf')]);router['get'](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x11')]);router[_0xcc6a('0x12')]('/',auth[_0xcc6a('0xc')](),controller['create']);router[_0xcc6a('0x13')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller['update']);router[_0xcc6a('0x14')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 54f1402..9b24364 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 _0xb295=['SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN','TEXT','ENUM'];(function(_0x4dc763,_0x22bff4){var _0x292fe1=function(_0x409c8a){while(--_0x409c8a){_0x4dc763['push'](_0x4dc763['shift']());}};_0x292fe1(++_0x22bff4);}(_0xb295,0x1b4));var _0x5b29=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xb295[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0x5b29('0x0'));module[_0x5b29('0x1')]={'integration':{'type':Sequelize[_0x5b29('0x2')]},'eventChannel':{'type':Sequelize[_0x5b29('0x2')]},'exitStatus':{'type':Sequelize[_0x5b29('0x2')]},'ticketId':{'type':Sequelize[_0x5b29('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x5b29('0x2')]},'uniqueid':{'type':Sequelize[_0x5b29('0x2')]},'calleridnum':{'type':Sequelize[_0x5b29('0x2')]},'calleridname':{'type':Sequelize[_0x5b29('0x2')]},'queue':{'type':Sequelize[_0x5b29('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x5b29('0x2')]},'agentcalledAt':{'type':Sequelize[_0x5b29('0x3')]},'agentconnectAt':{'type':Sequelize[_0x5b29('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x5b29('0x3')]},'talktime':{'type':Sequelize[_0x5b29('0x4')]},'agentacw':{'type':Sequelize[_0x5b29('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x5b29('0x4')]},'reason':{'type':Sequelize[_0x5b29('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x5b29('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x5b29('0x3')]},'agentdump':{'type':Sequelize[_0x5b29('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x5b29('0x3')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5b29('0x2')]},'channelstate':{'type':Sequelize[_0x5b29('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x5b29('0x2')]},'connectedlinename':{'type':Sequelize[_0x5b29('0x2')]},'language':{'type':Sequelize[_0x5b29('0x2')]},'accountcode':{'type':Sequelize[_0x5b29('0x2')]},'context':{'type':Sequelize[_0x5b29('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x5b29('0x2')]},'destchannel':{'type':Sequelize[_0x5b29('0x2')]},'destchannelstate':{'type':Sequelize[_0x5b29('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x5b29('0x2')]},'destcalleridname':{'type':Sequelize[_0x5b29('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x5b29('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x5b29('0x2')]},'destaccountcode':{'type':Sequelize[_0x5b29('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x5b29('0x2')]},'destpriority':{'type':Sequelize[_0x5b29('0x2')]},'destuniqueid':{'type':Sequelize[_0x5b29('0x2')]},'messageId':{'type':Sequelize[_0x5b29('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x5b29('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x5b29('0x7')](_0x5b29('0x8'),_0x5b29('0x9'),_0x5b29('0xa'),_0x5b29('0xb'))},'url':{'type':Sequelize[_0x5b29('0x2')]},'app':{'type':Sequelize[_0x5b29('0x2')]},'appdata':{'type':Sequelize[_0x5b29('0x2')]},'projectId':{'type':Sequelize[_0x5b29('0x4')]}}; \ No newline at end of file +var _0x964c=['exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','sequelize'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x964c,0xd0));var _0xc964=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x964c[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xc964('0x0'));module[_0xc964('0x1')]={'integration':{'type':Sequelize[_0xc964('0x2')]},'eventChannel':{'type':Sequelize[_0xc964('0x2')]},'exitStatus':{'type':Sequelize[_0xc964('0x2')]},'ticketId':{'type':Sequelize[_0xc964('0x2')]},'integrationId':{'type':Sequelize[_0xc964('0x3')]},'contacts':{'type':Sequelize[_0xc964('0x2')]},'uniqueid':{'type':Sequelize[_0xc964('0x2')]},'calleridnum':{'type':Sequelize[_0xc964('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xc964('0x2')]},'membername':{'type':Sequelize[_0xc964('0x2')]},'agentcalledAt':{'type':Sequelize[_0xc964('0x4')]},'agentconnectAt':{'type':Sequelize[_0xc964('0x4')]},'holdtime':{'type':Sequelize[_0xc964('0x3')]},'agentcomplete':{'type':Sequelize[_0xc964('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xc964('0x4')]},'talktime':{'type':Sequelize[_0xc964('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xc964('0x3')]},'reason':{'type':Sequelize[_0xc964('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xc964('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xc964('0x4')]},'agentdump':{'type':Sequelize[_0xc964('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xc964('0x4')]},'lastevent':{'type':Sequelize[_0xc964('0x2')]},'channel':{'type':Sequelize[_0xc964('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xc964('0x2')]},'language':{'type':Sequelize[_0xc964('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xc964('0x2')]},'exten':{'type':Sequelize[_0xc964('0x2')]},'priority':{'type':Sequelize[_0xc964('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xc964('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xc964('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xc964('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xc964('0x2')]},'destlanguage':{'type':Sequelize[_0xc964('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xc964('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xc964('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xc964('0x2')]},'subject':{'type':Sequelize[_0xc964('0x2')]},'from':{'type':Sequelize[_0xc964('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0xc964('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0xc964('0x6')]},'status':{'type':Sequelize[_0xc964('0x7')](_0xc964('0x8'),_0xc964('0x9'),_0xc964('0xa'),'FAILED')},'url':{'type':Sequelize[_0xc964('0x2')]},'app':{'type':Sequelize[_0xc964('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0xc964('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 1a50f50..7457f67 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 _0xc5e5=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','findAll','show','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x51ed4c,_0xc5c838){var _0x54d1ac=function(_0x14b136){while(--_0x14b136){_0x51ed4c['push'](_0x51ed4c['shift']());}};_0x54d1ac(++_0xc5c838);}(_0xc5e5,0x1c8));var _0x5c5e=function(_0x37529a,_0x3a0311){_0x37529a=_0x37529a-0x0;var _0x2d042b=_0xc5e5[_0x37529a];return _0x2d042b;};'use strict';var emlformat=require(_0x5c5e('0x0'));var rimraf=require(_0x5c5e('0x1'));var zipdir=require(_0x5c5e('0x2'));var jsonpatch=require(_0x5c5e('0x3'));var rp=require(_0x5c5e('0x4'));var moment=require(_0x5c5e('0x5'));var BPromise=require(_0x5c5e('0x6'));var Mustache=require(_0x5c5e('0x7'));var util=require(_0x5c5e('0x8'));var path=require(_0x5c5e('0x9'));var sox=require(_0x5c5e('0xa'));var csv=require(_0x5c5e('0xb'));var ejs=require(_0x5c5e('0xc'));var fs=require('fs');var fs_extra=require(_0x5c5e('0xd'));var _=require('lodash');var squel=require(_0x5c5e('0xe'));var crypto=require(_0x5c5e('0xf'));var jsforce=require(_0x5c5e('0x10'));var deskjs=require(_0x5c5e('0x11'));var toCsv=require(_0x5c5e('0xb'));var querystring=require(_0x5c5e('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5c5e('0x13'));var qs=require(_0x5c5e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5c5e('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x5c5e('0x16'));var config=require(_0x5c5e('0x17'));var licenseUtil=require(_0x5c5e('0x18'));var db=require(_0x5c5e('0x19'))['db'];function respondWithStatusCode(_0x5f003a,_0x192a48){_0x192a48=_0x192a48||0xcc;return function(_0xc13392){if(_0xc13392){return _0x5f003a[_0x5c5e('0x1a')](_0x192a48);}return _0x5f003a[_0x5c5e('0x1b')](_0x192a48)[_0x5c5e('0x1c')]();};}function respondWithResult(_0x4b45fa,_0x4ac991){_0x4ac991=_0x4ac991||0xc8;return function(_0x7bfe46){if(_0x7bfe46){return _0x4b45fa['status'](_0x4ac991)[_0x5c5e('0x1d')](_0x7bfe46);}};}function respondWithFilteredResult(_0x1f9d03,_0xf34372){return function(_0x1243ca){if(_0x1243ca){var _0x2eed2d=typeof _0xf34372[_0x5c5e('0x1e')]===_0x5c5e('0x1f')&&typeof _0xf34372[_0x5c5e('0x20')]===_0x5c5e('0x1f');var _0x4fb255=_0x1243ca[_0x5c5e('0x21')];var _0xb062b9=_0x2eed2d?0x0:_0xf34372['offset'];var _0x2718a7=_0x2eed2d?_0x1243ca['count']:_0xf34372[_0x5c5e('0x1e')]+_0xf34372[_0x5c5e('0x20')];var _0x42d745;if(_0x2718a7>=_0x4fb255){_0x2718a7=_0x4fb255;_0x42d745=0xc8;}else{_0x42d745=0xce;}_0x1f9d03[_0x5c5e('0x1b')](_0x42d745);return _0x1f9d03['set']('Content-Range',_0xb062b9+'-'+_0x2718a7+'/'+_0x4fb255)['json'](_0x1243ca);}return null;};}function patchUpdates(_0x189891){return function(_0xb54df9){try{jsonpatch[_0x5c5e('0x22')](_0xb54df9,_0x189891,!![]);}catch(_0x386af8){return BPromise[_0x5c5e('0x23')](_0x386af8);}return _0xb54df9[_0x5c5e('0x24')]();};}function saveUpdates(_0x232a78,_0x339ad1){return function(_0x54bfa9){if(_0x54bfa9){return _0x54bfa9[_0x5c5e('0x25')](_0x232a78)[_0x5c5e('0x26')](function(_0x2cae37){return _0x2cae37;});}return null;};}function removeEntity(_0x24e767,_0x28613f){return function(_0x2613e2){if(_0x2613e2){return _0x2613e2[_0x5c5e('0x27')]()[_0x5c5e('0x26')](function(){_0x24e767['status'](0xcc)[_0x5c5e('0x1c')]();});}};}function handleEntityNotFound(_0x3c9a64,_0x5b4cba){return function(_0x27dad8){if(!_0x27dad8){_0x3c9a64['sendStatus'](0x194);}return _0x27dad8;};}function handleError(_0xed597,_0x3b2355){_0x3b2355=_0x3b2355||0x1f4;return function(_0xd97d9){logger[_0x5c5e('0x28')](_0xd97d9[_0x5c5e('0x29')]);if(_0xd97d9[_0x5c5e('0x2a')]){delete _0xd97d9[_0x5c5e('0x2a')];}_0xed597[_0x5c5e('0x1b')](_0x3b2355)[_0x5c5e('0x2b')](_0xd97d9);};}exports[_0x5c5e('0x2c')]=function(_0x759b9a,_0x113018){var _0x4a9bad={},_0x54d6bd={},_0x3fdc84={'count':0x0,'rows':[]};var _0x1fa7fb=_[_0x5c5e('0x2d')](db[_0x5c5e('0x2e')][_0x5c5e('0x2f')],function(_0x2f41d4){return{'name':_0x2f41d4[_0x5c5e('0x30')],'type':_0x2f41d4[_0x5c5e('0x31')][_0x5c5e('0x32')]};});_0x54d6bd[_0x5c5e('0x33')]=_[_0x5c5e('0x2d')](_0x1fa7fb,'name');_0x54d6bd[_0x5c5e('0x34')]=_[_0x5c5e('0x35')](_0x759b9a[_0x5c5e('0x34')]);_0x54d6bd['filters']=_[_0x5c5e('0x36')](_0x54d6bd[_0x5c5e('0x33')],_0x54d6bd[_0x5c5e('0x34')]);_0x4a9bad[_0x5c5e('0x37')]=_[_0x5c5e('0x36')](_0x54d6bd[_0x5c5e('0x33')],qs[_0x5c5e('0x38')](_0x759b9a[_0x5c5e('0x34')][_0x5c5e('0x38')]));_0x4a9bad[_0x5c5e('0x37')]=_0x4a9bad[_0x5c5e('0x37')][_0x5c5e('0x39')]?_0x4a9bad[_0x5c5e('0x37')]:_0x54d6bd[_0x5c5e('0x33')];if(!_0x759b9a[_0x5c5e('0x34')][_0x5c5e('0x3a')](_0x5c5e('0x3b'))){_0x4a9bad[_0x5c5e('0x20')]=qs[_0x5c5e('0x20')](_0x759b9a[_0x5c5e('0x34')]['limit']);_0x4a9bad[_0x5c5e('0x1e')]=qs[_0x5c5e('0x1e')](_0x759b9a[_0x5c5e('0x34')][_0x5c5e('0x1e')]);}_0x4a9bad[_0x5c5e('0x3c')]=qs[_0x5c5e('0x3d')](_0x759b9a[_0x5c5e('0x34')][_0x5c5e('0x3d')]);_0x4a9bad[_0x5c5e('0x3e')]=qs[_0x5c5e('0x3f')](_[_0x5c5e('0x40')](_0x759b9a[_0x5c5e('0x34')],_0x54d6bd[_0x5c5e('0x3f')]),_0x1fa7fb);if(_0x759b9a[_0x5c5e('0x34')][_0x5c5e('0x41')]){_0x4a9bad['where']=_[_0x5c5e('0x42')](_0x4a9bad[_0x5c5e('0x3e')],{'$or':_[_0x5c5e('0x2d')](_0x1fa7fb,function(_0x16e936){if(_0x16e936[_0x5c5e('0x31')]!=='VIRTUAL'){var _0x2480cf={};_0x2480cf[_0x16e936[_0x5c5e('0x2a')]]={'$like':'%'+_0x759b9a[_0x5c5e('0x34')]['filter']+'%'};return _0x2480cf;}})});}_0x4a9bad=_['merge']({},_0x4a9bad,_0x759b9a[_0x5c5e('0x43')]);var _0x37d1cd={'where':_0x4a9bad[_0x5c5e('0x3e')]};return db[_0x5c5e('0x2e')]['count'](_0x37d1cd)[_0x5c5e('0x26')](function(_0x3499b2){_0x3fdc84[_0x5c5e('0x21')]=_0x3499b2;if(_0x759b9a[_0x5c5e('0x34')][_0x5c5e('0x44')]){_0x4a9bad['include']=[{'all':!![]}];}return db['IntegrationReport'][_0x5c5e('0x45')](_0x4a9bad);})[_0x5c5e('0x26')](function(_0x34108c){_0x3fdc84['rows']=_0x34108c;return _0x3fdc84;})[_0x5c5e('0x26')](respondWithFilteredResult(_0x113018,_0x4a9bad))['catch'](handleError(_0x113018,null));};exports[_0x5c5e('0x46')]=function(_0x544426,_0x137d64){var _0x3aedd7={'raw':![],'where':{'id':_0x544426[_0x5c5e('0x47')]['id']}},_0x3ea0b5={};_0x3ea0b5[_0x5c5e('0x33')]=_[_0x5c5e('0x35')](db[_0x5c5e('0x2e')][_0x5c5e('0x2f')]);_0x3ea0b5[_0x5c5e('0x34')]=_['keys'](_0x544426['query']);_0x3ea0b5[_0x5c5e('0x3f')]=_[_0x5c5e('0x36')](_0x3ea0b5[_0x5c5e('0x33')],_0x3ea0b5[_0x5c5e('0x34')]);_0x3aedd7['attributes']=_['intersection'](_0x3ea0b5['model'],qs[_0x5c5e('0x38')](_0x544426[_0x5c5e('0x34')][_0x5c5e('0x38')]));_0x3aedd7[_0x5c5e('0x37')]=_0x3aedd7[_0x5c5e('0x37')][_0x5c5e('0x39')]?_0x3aedd7[_0x5c5e('0x37')]:_0x3ea0b5[_0x5c5e('0x33')];if(_0x544426[_0x5c5e('0x34')][_0x5c5e('0x44')]){_0x3aedd7['include']=[{'all':!![]}];}_0x3aedd7=_[_0x5c5e('0x42')]({},_0x3aedd7,_0x544426['options']);return db[_0x5c5e('0x2e')][_0x5c5e('0x48')](_0x3aedd7)[_0x5c5e('0x26')](handleEntityNotFound(_0x137d64,null))['then'](respondWithResult(_0x137d64,null))[_0x5c5e('0x49')](handleError(_0x137d64,null));};exports[_0x5c5e('0x4a')]=function(_0x53b7d8,_0x99cadb){return db['IntegrationReport'][_0x5c5e('0x4a')](_0x53b7d8[_0x5c5e('0x4b')],{})['then'](respondWithResult(_0x99cadb,0xc9))[_0x5c5e('0x49')](handleError(_0x99cadb,null));};exports[_0x5c5e('0x25')]=function(_0x20a89e,_0x4819ae){if(_0x20a89e['body']['id']){delete _0x20a89e[_0x5c5e('0x4b')]['id'];}return db[_0x5c5e('0x2e')][_0x5c5e('0x48')]({'where':{'id':_0x20a89e['params']['id']}})['then'](handleEntityNotFound(_0x4819ae,null))[_0x5c5e('0x26')](saveUpdates(_0x20a89e[_0x5c5e('0x4b')],null))[_0x5c5e('0x26')](respondWithResult(_0x4819ae,null))['catch'](handleError(_0x4819ae,null));};exports['destroy']=function(_0x52edc2,_0x11ba8e){return db[_0x5c5e('0x2e')][_0x5c5e('0x48')]({'where':{'id':_0x52edc2[_0x5c5e('0x47')]['id']}})[_0x5c5e('0x26')](handleEntityNotFound(_0x11ba8e,null))[_0x5c5e('0x26')](removeEntity(_0x11ba8e,null))[_0x5c5e('0x49')](handleError(_0x11ba8e,null));};exports['describe']=function(_0x301f98,_0x1de743){return db[_0x5c5e('0x2e')][_0x5c5e('0x4c')]()[_0x5c5e('0x26')](respondWithResult(_0x1de743,null))[_0x5c5e('0x49')](handleError(_0x1de743,null));}; \ No newline at end of file +var _0x7da0=['count','status','set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','send','map','IntegrationReport','fieldName','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','keys','rawAttributes','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','json','offset','undefined','limit'];(function(_0x895b79,_0x13fd86){var _0x210409=function(_0x93b60a){while(--_0x93b60a){_0x895b79['push'](_0x895b79['shift']());}};_0x210409(++_0x13fd86);}(_0x7da0,0x111));var _0x07da=function(_0x37a50c,_0x4e4c2d){_0x37a50c=_0x37a50c-0x0;var _0x5374c6=_0x7da0[_0x37a50c];return _0x5374c6;};'use strict';var emlformat=require(_0x07da('0x0'));var rimraf=require(_0x07da('0x1'));var zipdir=require(_0x07da('0x2'));var jsonpatch=require(_0x07da('0x3'));var rp=require(_0x07da('0x4'));var moment=require(_0x07da('0x5'));var BPromise=require(_0x07da('0x6'));var Mustache=require(_0x07da('0x7'));var util=require(_0x07da('0x8'));var path=require(_0x07da('0x9'));var sox=require('sox');var csv=require(_0x07da('0xa'));var ejs=require(_0x07da('0xb'));var fs=require('fs');var fs_extra=require(_0x07da('0xc'));var _=require('lodash');var squel=require(_0x07da('0xd'));var crypto=require(_0x07da('0xe'));var jsforce=require(_0x07da('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x07da('0xa'));var querystring=require('querystring');var Papa=require(_0x07da('0x10'));var Redis=require('ioredis');var authService=require(_0x07da('0x11'));var qs=require(_0x07da('0x12'));var as=require(_0x07da('0x13'));var hardwareService=require(_0x07da('0x14'));var logger=require(_0x07da('0x15'))(_0x07da('0x16'));var utils=require(_0x07da('0x17'));var config=require(_0x07da('0x18'));var licenseUtil=require(_0x07da('0x19'));var db=require(_0x07da('0x1a'))['db'];function respondWithStatusCode(_0x497a3c,_0x38a1a9){_0x38a1a9=_0x38a1a9||0xcc;return function(_0x43ba02){if(_0x43ba02){return _0x497a3c['sendStatus'](_0x38a1a9);}return _0x497a3c['status'](_0x38a1a9)['end']();};}function respondWithResult(_0x1aa887,_0x2172cc){_0x2172cc=_0x2172cc||0xc8;return function(_0x3d2d4c){if(_0x3d2d4c){return _0x1aa887['status'](_0x2172cc)[_0x07da('0x1b')](_0x3d2d4c);}};}function respondWithFilteredResult(_0xe8ed52,_0x3d9a60){return function(_0x1970e2){if(_0x1970e2){var _0x248f4a=typeof _0x3d9a60[_0x07da('0x1c')]===_0x07da('0x1d')&&typeof _0x3d9a60[_0x07da('0x1e')]===_0x07da('0x1d');var _0x5a660b=_0x1970e2['count'];var _0x2ea58d=_0x248f4a?0x0:_0x3d9a60[_0x07da('0x1c')];var _0x27b18c=_0x248f4a?_0x1970e2[_0x07da('0x1f')]:_0x3d9a60['offset']+_0x3d9a60[_0x07da('0x1e')];var _0x1f16d3;if(_0x27b18c>=_0x5a660b){_0x27b18c=_0x5a660b;_0x1f16d3=0xc8;}else{_0x1f16d3=0xce;}_0xe8ed52[_0x07da('0x20')](_0x1f16d3);return _0xe8ed52[_0x07da('0x21')](_0x07da('0x22'),_0x2ea58d+'-'+_0x27b18c+'/'+_0x5a660b)[_0x07da('0x1b')](_0x1970e2);}return null;};}function patchUpdates(_0x5d675f){return function(_0x4fba00){try{jsonpatch[_0x07da('0x23')](_0x4fba00,_0x5d675f,!![]);}catch(_0x4c7102){return BPromise[_0x07da('0x24')](_0x4c7102);}return _0x4fba00['save']();};}function saveUpdates(_0xe03930,_0x432156){return function(_0x9be4e6){if(_0x9be4e6){return _0x9be4e6[_0x07da('0x25')](_0xe03930)[_0x07da('0x26')](function(_0x38f7c1){return _0x38f7c1;});}return null;};}function removeEntity(_0x11c520,_0x135b25){return function(_0x23da0f){if(_0x23da0f){return _0x23da0f[_0x07da('0x27')]()['then'](function(){_0x11c520[_0x07da('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23e864,_0x22757e){return function(_0x217260){if(!_0x217260){_0x23e864[_0x07da('0x28')](0x194);}return _0x217260;};}function handleError(_0x5c6e63,_0x4127c4){_0x4127c4=_0x4127c4||0x1f4;return function(_0x1d7ede){logger['error'](_0x1d7ede[_0x07da('0x29')]);if(_0x1d7ede[_0x07da('0x2a')]){delete _0x1d7ede['name'];}_0x5c6e63[_0x07da('0x20')](_0x4127c4)[_0x07da('0x2b')](_0x1d7ede);};}exports['index']=function(_0x4f5bae,_0x3a673f){var _0x336f75={},_0x3650c5={},_0x433328={'count':0x0,'rows':[]};var _0x5777af=_[_0x07da('0x2c')](db[_0x07da('0x2d')]['rawAttributes'],function(_0x28b8b8){return{'name':_0x28b8b8[_0x07da('0x2e')],'type':_0x28b8b8['type'][_0x07da('0x2f')]};});_0x3650c5['model']=_['map'](_0x5777af,'name');_0x3650c5[_0x07da('0x30')]=_['keys'](_0x4f5bae[_0x07da('0x30')]);_0x3650c5[_0x07da('0x31')]=_['intersection'](_0x3650c5[_0x07da('0x32')],_0x3650c5[_0x07da('0x30')]);_0x336f75[_0x07da('0x33')]=_[_0x07da('0x34')](_0x3650c5['model'],qs[_0x07da('0x35')](_0x4f5bae[_0x07da('0x30')][_0x07da('0x35')]));_0x336f75[_0x07da('0x33')]=_0x336f75[_0x07da('0x33')][_0x07da('0x36')]?_0x336f75[_0x07da('0x33')]:_0x3650c5[_0x07da('0x32')];if(!_0x4f5bae[_0x07da('0x30')][_0x07da('0x37')](_0x07da('0x38'))){_0x336f75['limit']=qs['limit'](_0x4f5bae[_0x07da('0x30')]['limit']);_0x336f75[_0x07da('0x1c')]=qs[_0x07da('0x1c')](_0x4f5bae[_0x07da('0x30')][_0x07da('0x1c')]);}_0x336f75['order']=qs[_0x07da('0x39')](_0x4f5bae['query'][_0x07da('0x39')]);_0x336f75[_0x07da('0x3a')]=qs[_0x07da('0x31')](_[_0x07da('0x3b')](_0x4f5bae[_0x07da('0x30')],_0x3650c5[_0x07da('0x31')]),_0x5777af);if(_0x4f5bae['query'][_0x07da('0x3c')]){_0x336f75[_0x07da('0x3a')]=_[_0x07da('0x3d')](_0x336f75[_0x07da('0x3a')],{'$or':_[_0x07da('0x2c')](_0x5777af,function(_0xf563ec){if(_0xf563ec['type']!==_0x07da('0x3e')){var _0x16022e={};_0x16022e[_0xf563ec['name']]={'$like':'%'+_0x4f5bae[_0x07da('0x30')][_0x07da('0x3c')]+'%'};return _0x16022e;}})});}_0x336f75=_['merge']({},_0x336f75,_0x4f5bae[_0x07da('0x3f')]);var _0x270ebf={'where':_0x336f75[_0x07da('0x3a')]};return db['IntegrationReport'][_0x07da('0x1f')](_0x270ebf)[_0x07da('0x26')](function(_0x49042d){_0x433328[_0x07da('0x1f')]=_0x49042d;if(_0x4f5bae[_0x07da('0x30')][_0x07da('0x40')]){_0x336f75[_0x07da('0x41')]=[{'all':!![]}];}return db[_0x07da('0x2d')][_0x07da('0x42')](_0x336f75);})['then'](function(_0xcbef97){_0x433328['rows']=_0xcbef97;return _0x433328;})[_0x07da('0x26')](respondWithFilteredResult(_0x3a673f,_0x336f75))[_0x07da('0x43')](handleError(_0x3a673f,null));};exports[_0x07da('0x44')]=function(_0x3caa30,_0x12fba7){var _0x36e867={'raw':![],'where':{'id':_0x3caa30['params']['id']}},_0x15761b={};_0x15761b[_0x07da('0x32')]=_[_0x07da('0x45')](db[_0x07da('0x2d')][_0x07da('0x46')]);_0x15761b[_0x07da('0x30')]=_[_0x07da('0x45')](_0x3caa30[_0x07da('0x30')]);_0x15761b['filters']=_[_0x07da('0x34')](_0x15761b[_0x07da('0x32')],_0x15761b[_0x07da('0x30')]);_0x36e867[_0x07da('0x33')]=_['intersection'](_0x15761b[_0x07da('0x32')],qs[_0x07da('0x35')](_0x3caa30[_0x07da('0x30')]['fields']));_0x36e867[_0x07da('0x33')]=_0x36e867[_0x07da('0x33')][_0x07da('0x36')]?_0x36e867[_0x07da('0x33')]:_0x15761b[_0x07da('0x32')];if(_0x3caa30[_0x07da('0x30')][_0x07da('0x40')]){_0x36e867[_0x07da('0x41')]=[{'all':!![]}];}_0x36e867=_[_0x07da('0x3d')]({},_0x36e867,_0x3caa30['options']);return db[_0x07da('0x2d')]['find'](_0x36e867)['then'](handleEntityNotFound(_0x12fba7,null))[_0x07da('0x26')](respondWithResult(_0x12fba7,null))[_0x07da('0x43')](handleError(_0x12fba7,null));};exports[_0x07da('0x47')]=function(_0x5d55d1,_0x5f5473){return db[_0x07da('0x2d')][_0x07da('0x47')](_0x5d55d1[_0x07da('0x48')],{})[_0x07da('0x26')](respondWithResult(_0x5f5473,0xc9))['catch'](handleError(_0x5f5473,null));};exports['update']=function(_0x44d892,_0x178929){if(_0x44d892[_0x07da('0x48')]['id']){delete _0x44d892[_0x07da('0x48')]['id'];}return db['IntegrationReport'][_0x07da('0x49')]({'where':{'id':_0x44d892['params']['id']}})['then'](handleEntityNotFound(_0x178929,null))['then'](saveUpdates(_0x44d892[_0x07da('0x48')],null))[_0x07da('0x26')](respondWithResult(_0x178929,null))['catch'](handleError(_0x178929,null));};exports[_0x07da('0x27')]=function(_0x42cc07,_0x2f0145){return db[_0x07da('0x2d')][_0x07da('0x49')]({'where':{'id':_0x42cc07[_0x07da('0x4a')]['id']}})[_0x07da('0x26')](handleEntityNotFound(_0x2f0145,null))[_0x07da('0x26')](removeEntity(_0x2f0145,null))[_0x07da('0x43')](handleError(_0x2f0145,null));};exports[_0x07da('0x4b')]=function(_0x56a5c2,_0x1206b){return db[_0x07da('0x2d')]['describe']()[_0x07da('0x26')](respondWithResult(_0x1206b,null))[_0x07da('0x43')](handleError(_0x1206b,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 0cace9a..0549a66 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 _0xdfb4=['define','report_integration','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','exports'];(function(_0x5352aa,_0x13fbee){var _0x19b8ad=function(_0x482514){while(--_0x482514){_0x5352aa['push'](_0x5352aa['shift']());}};_0x19b8ad(++_0x13fbee);}(_0xdfb4,0xc0));var _0x4dfb=function(_0x8da6be,_0x2dc2d6){_0x8da6be=_0x8da6be-0x0;var _0x499aea=_0xdfb4[_0x8da6be];return _0x499aea;};'use strict';var _=require(_0x4dfb('0x0'));var util=require(_0x4dfb('0x1'));var logger=require(_0x4dfb('0x2'))(_0x4dfb('0x3'));var moment=require('moment');var BPromise=require(_0x4dfb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4dfb('0x5'));var rimraf=require('rimraf');var config=require(_0x4dfb('0x6'));var attributes=require('./integrationReport.attributes');module[_0x4dfb('0x7')]=function(_0x580e34,_0x2ba579){return _0x580e34[_0x4dfb('0x8')]('IntegrationReport',attributes,{'tableName':_0x4dfb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x44ea=['request-promise','path','rimraf','define','IntegrationReport','report_integration','lodash','../../config/logger','api','moment','bluebird'];(function(_0x122e9b,_0x391bf4){var _0x22c247=function(_0x1b2c65){while(--_0x1b2c65){_0x122e9b['push'](_0x122e9b['shift']());}};_0x22c247(++_0x391bf4);}(_0x44ea,0x17c));var _0xa44e=function(_0xba1039,_0x93555){_0xba1039=_0xba1039-0x0;var _0x29b97f=_0x44ea[_0xba1039];return _0x29b97f;};'use strict';var _=require(_0xa44e('0x0'));var util=require('util');var logger=require(_0xa44e('0x1'))(_0xa44e('0x2'));var moment=require(_0xa44e('0x3'));var BPromise=require(_0xa44e('0x4'));var rp=require(_0xa44e('0x5'));var fs=require('fs');var path=require(_0xa44e('0x6'));var rimraf=require(_0xa44e('0x7'));var config=require('../../config/environment');var attributes=require('./integrationReport.attributes');module['exports']=function(_0xf068b,_0x2f358e){return _0xf068b[_0xa44e('0x8')](_0xa44e('0x9'),attributes,{'tableName':_0xa44e('0xa'),'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 706b61f..c8f5e1b 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 _0x1967=['then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x1967,0x173));var _0x7196=function(_0x3b388e,_0x122724){_0x3b388e=_0x3b388e-0x0;var _0x5155f2=_0x1967[_0x3b388e];return _0x5155f2;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});} \ No newline at end of file +var _0xba34=['../../config/environment','jayson/promise','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','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0x4e3073,_0xd5b018){var _0x1d844c=function(_0x5234d1){while(--_0x5234d1){_0x4e3073['push'](_0x4e3073['shift']());}};_0x1d844c(++_0xd5b018);}(_0xba34,0x119));var _0x4ba3=function(_0x55f3da,_0xfa7780){_0x55f3da=_0x55f3da-0x0;var _0x537cef=_0xba34[_0x55f3da];return _0x537cef;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var moment=require(_0x4ba3('0x2'));var BPromise=require(_0x4ba3('0x3'));var rs=require(_0x4ba3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ba3('0x5'))(_0x4ba3('0x6'));var config=require(_0x4ba3('0x7'));var jayson=require(_0x4ba3('0x8'));var client=jayson[_0x4ba3('0x9')][_0x4ba3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe5f99a,_0x585f2d,_0x6254fb){return new BPromise(function(_0x368eee,_0x2df7f3){return client[_0x4ba3('0xb')](_0xe5f99a,_0x6254fb)[_0x4ba3('0xc')](function(_0xcf1ec3){logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));logger[_0x4ba3('0x10')](_0x4ba3('0x11'),_0x585f2d,'request\x20sent',JSON[_0x4ba3('0x12')](_0xcf1ec3));if(_0xcf1ec3[_0x4ba3('0x13')]){if(_0xcf1ec3['error'][_0x4ba3('0x14')]===0x1f4){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3['error'][_0x4ba3('0x15')]);return _0x2df7f3(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}logger[_0x4ba3('0x13')](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);return _0x368eee(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}else{logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));_0x368eee(_0xcf1ec3[_0x4ba3('0x16')][_0x4ba3('0x15')]);}})[_0x4ba3('0x17')](function(_0x1b7776){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0x1b7776);_0x2df7f3(_0x1b7776);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 01f5b51..f8efb74 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 _0x806b=['show','/:id/sub_intervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./interval.controller','get','isAuthenticated','/:id'];(function(_0x23baf2,_0x881a82){var _0x5a92e4=function(_0xdca0b4){while(--_0xdca0b4){_0x23baf2['push'](_0x23baf2['shift']());}};_0x5a92e4(++_0x881a82);}(_0x806b,0x163));var _0xb806=function(_0x114d09,_0x4057d9){_0x114d09=_0x114d09-0x0;var _0x5102b3=_0x806b[_0x114d09];return _0x5102b3;};'use strict';var multer=require(_0xb806('0x0'));var util=require(_0xb806('0x1'));var path=require(_0xb806('0x2'));var timeout=require(_0xb806('0x3'));var express=require(_0xb806('0x4'));var router=express[_0xb806('0x5')]();var fs_extra=require(_0xb806('0x6'));var auth=require(_0xb806('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb806('0x8'));var controller=require(_0xb806('0x9'));router[_0xb806('0xa')]('/',auth[_0xb806('0xb')](),controller['index']);router[_0xb806('0xa')](_0xb806('0xc'),auth['isAuthenticated'](),controller[_0xb806('0xd')]);router[_0xb806('0xa')](_0xb806('0xe'),auth[_0xb806('0xb')](),controller['getIntervals']);router[_0xb806('0xf')]('/',auth['isAuthenticated'](),controller[_0xb806('0x10')]);router['post'](_0xb806('0xe'),auth['isAuthenticated'](),controller[_0xb806('0x11')]);router[_0xb806('0xf')](_0xb806('0x12'),auth['isAuthenticated'](),controller[_0xb806('0x13')]);router[_0xb806('0x14')]('/:id',auth[_0xb806('0xb')](),controller[_0xb806('0x15')]);router['delete'](_0xb806('0xc'),auth[_0xb806('0xb')](),controller['destroy']);module[_0xb806('0x16')]=router; \ No newline at end of file +var _0x0b91=['express','Router','fs-extra','../../config/environment','./interval.controller','get','isAuthenticated','show','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','/:id','update','destroy','exports','util','path'];(function(_0x54b470,_0x21037e){var _0x152897=function(_0x339a1e){while(--_0x339a1e){_0x54b470['push'](_0x54b470['shift']());}};_0x152897(++_0x21037e);}(_0x0b91,0xae));var _0x10b9=function(_0x2a1b13,_0x46dad2){_0x2a1b13=_0x2a1b13-0x0;var _0x72cd4=_0x0b91[_0x2a1b13];return _0x72cd4;};'use strict';var multer=require('multer');var util=require(_0x10b9('0x0'));var path=require(_0x10b9('0x1'));var timeout=require('connect-timeout');var express=require(_0x10b9('0x2'));var router=express[_0x10b9('0x3')]();var fs_extra=require(_0x10b9('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x10b9('0x5'));var controller=require(_0x10b9('0x6'));router[_0x10b9('0x7')]('/',auth[_0x10b9('0x8')](),controller['index']);router[_0x10b9('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x10b9('0x9')]);router['get'](_0x10b9('0xa'),auth[_0x10b9('0x8')](),controller[_0x10b9('0xb')]);router[_0x10b9('0xc')]('/',auth['isAuthenticated'](),controller[_0x10b9('0xd')]);router[_0x10b9('0xc')](_0x10b9('0xa'),auth[_0x10b9('0x8')](),controller[_0x10b9('0xe')]);router[_0x10b9('0xc')](_0x10b9('0xf'),auth['isAuthenticated'](),controller[_0x10b9('0x10')]);router[_0x10b9('0x11')](_0x10b9('0x12'),auth[_0x10b9('0x8')](),controller[_0x10b9('0x13')]);router['delete'](_0x10b9('0x12'),auth[_0x10b9('0x8')](),controller[_0x10b9('0x14')]);module[_0x10b9('0x15')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 78a1c79..caf626e 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 _0x90fe=['STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x90fe,0x12c));var _0xe90f=function(_0x1b644f,_0x4c99a0){_0x1b644f=_0x1b644f-0x0;var _0x1d2829=_0x90fe[_0x1b644f];return _0x1d2829;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe90f('0x0')]},'interval':{'type':Sequelize[_0xe90f('0x0')],'allowNull':!![]}}; \ No newline at end of file +var _0xaf39=['exports','STRING','sequelize'];(function(_0x5eeb37,_0x208c8e){var _0x2e8cd7=function(_0x296764){while(--_0x296764){_0x5eeb37['push'](_0x5eeb37['shift']());}};_0x2e8cd7(++_0x208c8e);}(_0xaf39,0x140));var _0x9af3=function(_0x2f432a,_0x21efbd){_0x2f432a=_0x2f432a-0x0;var _0x9fb239=_0xaf39[_0x2f432a];return _0x9fb239;};'use strict';var Sequelize=require(_0x9af3('0x0'));module[_0x9af3('0x1')]={'name':{'type':Sequelize[_0x9af3('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x9af3('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 615cfa4..ad9ab92 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 _0x66a6=['squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','get','Intervals','UserProfileResource','error','stack','name','send','index','Interval','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','includeAll','findAll','rows','show','params','fields','include','options','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','IntervalId','getIntervals','addIntervals','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x66a6,0xaf));var _0x666a=function(_0xb4a704,_0x1deea9){_0xb4a704=_0xb4a704-0x0;var _0x23a1d5=_0x66a6[_0xb4a704];return _0x23a1d5;};'use strict';var emlformat=require(_0x666a('0x0'));var rimraf=require(_0x666a('0x1'));var zipdir=require(_0x666a('0x2'));var jsonpatch=require(_0x666a('0x3'));var rp=require(_0x666a('0x4'));var moment=require(_0x666a('0x5'));var BPromise=require(_0x666a('0x6'));var Mustache=require('mustache');var util=require(_0x666a('0x7'));var path=require(_0x666a('0x8'));var sox=require(_0x666a('0x9'));var csv=require(_0x666a('0xa'));var ejs=require(_0x666a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x666a('0xc'));var squel=require(_0x666a('0xd'));var crypto=require('crypto');var jsforce=require(_0x666a('0xe'));var deskjs=require(_0x666a('0xf'));var toCsv=require(_0x666a('0xa'));var querystring=require(_0x666a('0x10'));var Papa=require(_0x666a('0x11'));var Redis=require(_0x666a('0x12'));var authService=require(_0x666a('0x13'));var qs=require(_0x666a('0x14'));var as=require(_0x666a('0x15'));var hardwareService=require(_0x666a('0x16'));var logger=require(_0x666a('0x17'))(_0x666a('0x18'));var utils=require('../../config/utils');var config=require(_0x666a('0x19'));var licenseUtil=require(_0x666a('0x1a'));var db=require('../../mysqldb')['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x2a6baf,_0x38501b){_0x38501b=_0x38501b||0xcc;return function(_0x151704){if(_0x151704){return _0x2a6baf[_0x666a('0x1b')](_0x38501b);}return _0x2a6baf['status'](_0x38501b)[_0x666a('0x1c')]();};}function respondWithResult(_0xcfba76,_0x1a0e4a){_0x1a0e4a=_0x1a0e4a||0xc8;return function(_0x2db557){if(_0x2db557){return _0xcfba76[_0x666a('0x1d')](_0x1a0e4a)[_0x666a('0x1e')](_0x2db557);}};}function respondWithFilteredResult(_0x205828,_0x363347){return function(_0x1b2583){if(_0x1b2583){var _0x26db96=typeof _0x363347[_0x666a('0x1f')]===_0x666a('0x20')&&typeof _0x363347[_0x666a('0x21')]===_0x666a('0x20');var _0x53d6d3=_0x1b2583[_0x666a('0x22')];var _0xa0a9ce=_0x26db96?0x0:_0x363347[_0x666a('0x1f')];var _0x5a4c92=_0x26db96?_0x1b2583[_0x666a('0x22')]:_0x363347['offset']+_0x363347['limit'];var _0x170561;if(_0x5a4c92>=_0x53d6d3){_0x5a4c92=_0x53d6d3;_0x170561=0xc8;}else{_0x170561=0xce;}_0x205828[_0x666a('0x1d')](_0x170561);return _0x205828['set'](_0x666a('0x23'),_0xa0a9ce+'-'+_0x5a4c92+'/'+_0x53d6d3)[_0x666a('0x1e')](_0x1b2583);}return null;};}function patchUpdates(_0x2dc9c9){return function(_0x146b9d){try{jsonpatch[_0x666a('0x24')](_0x146b9d,_0x2dc9c9,!![]);}catch(_0x4f8b72){return BPromise['reject'](_0x4f8b72);}return _0x146b9d[_0x666a('0x25')]();};}function saveUpdates(_0x507fa5,_0x15e98c){return function(_0x11a922){if(_0x11a922){return _0x11a922[_0x666a('0x26')](_0x507fa5)['then'](function(_0xc8b059){return _0xc8b059;});}return null;};}function removeEntity(_0x35aef7,_0x53d92c){return function(_0x581c65){if(_0x581c65){return _0x581c65[_0x666a('0x27')]()[_0x666a('0x28')](function(){var _0x17078b=_0x581c65[_0x666a('0x29')]({'plain':!![]});var _0x5cbb87=_0x666a('0x2a');return db[_0x666a('0x2b')]['destroy']({'where':{'type':_0x5cbb87,'resourceId':_0x17078b['id']}})['then'](function(){return _0x581c65;});})[_0x666a('0x28')](function(){_0x35aef7['status'](0xcc)[_0x666a('0x1c')]();});}};}function handleEntityNotFound(_0x3f79c4,_0x1cb7c1){return function(_0x32d840){if(!_0x32d840){_0x3f79c4[_0x666a('0x1b')](0x194);}return _0x32d840;};}function handleError(_0x19bc04,_0x1fad49){_0x1fad49=_0x1fad49||0x1f4;return function(_0x26e377){logger[_0x666a('0x2c')](_0x26e377[_0x666a('0x2d')]);if(_0x26e377[_0x666a('0x2e')]){delete _0x26e377['name'];}_0x19bc04[_0x666a('0x1d')](_0x1fad49)[_0x666a('0x2f')](_0x26e377);};}exports[_0x666a('0x30')]=function(_0x43f440,_0x1a4587){var _0x17986e={},_0x18f6a8={},_0x5434fc={'count':0x0,'rows':[]};var _0x3228b0=_['map'](db[_0x666a('0x31')][_0x666a('0x32')],function(_0x6d235f){return{'name':_0x6d235f[_0x666a('0x33')],'type':_0x6d235f[_0x666a('0x34')][_0x666a('0x35')]};});_0x18f6a8[_0x666a('0x36')]=_['map'](_0x3228b0,'name');_0x18f6a8['query']=_[_0x666a('0x37')](_0x43f440[_0x666a('0x38')]);_0x18f6a8['filters']=_['intersection'](_0x18f6a8[_0x666a('0x36')],_0x18f6a8[_0x666a('0x38')]);_0x17986e[_0x666a('0x39')]=_[_0x666a('0x3a')](_0x18f6a8['model'],qs['fields'](_0x43f440[_0x666a('0x38')]['fields']));_0x17986e[_0x666a('0x39')]=_0x17986e[_0x666a('0x39')][_0x666a('0x3b')]?_0x17986e[_0x666a('0x39')]:_0x18f6a8[_0x666a('0x36')];if(!_0x43f440[_0x666a('0x38')][_0x666a('0x3c')](_0x666a('0x3d'))){_0x17986e[_0x666a('0x21')]=qs[_0x666a('0x21')](_0x43f440[_0x666a('0x38')][_0x666a('0x21')]);_0x17986e[_0x666a('0x1f')]=qs[_0x666a('0x1f')](_0x43f440['query']['offset']);}_0x17986e[_0x666a('0x3e')]=qs['sort'](_0x43f440[_0x666a('0x38')][_0x666a('0x3f')]);_0x17986e[_0x666a('0x40')]=qs[_0x666a('0x41')](_[_0x666a('0x42')](_0x43f440[_0x666a('0x38')],_0x18f6a8[_0x666a('0x41')]),_0x3228b0);if(_0x43f440[_0x666a('0x38')][_0x666a('0x43')]){_0x17986e[_0x666a('0x40')]=_[_0x666a('0x44')](_0x17986e['where'],{'$or':_[_0x666a('0x45')](_0x3228b0,function(_0xb7b581){if(_0xb7b581[_0x666a('0x34')]!==_0x666a('0x46')){var _0x1888c2={};_0x1888c2[_0xb7b581['name']]={'$like':'%'+_0x43f440['query'][_0x666a('0x43')]+'%'};return _0x1888c2;}})});}_0x17986e=_['merge']({},_0x17986e,_0x43f440['options']);var _0x1efb20={'where':_0x17986e[_0x666a('0x40')]};return db['Interval'][_0x666a('0x22')](_0x1efb20)[_0x666a('0x28')](function(_0x52b26c){_0x5434fc[_0x666a('0x22')]=_0x52b26c;if(_0x43f440[_0x666a('0x38')][_0x666a('0x47')]){_0x17986e['include']=[{'all':!![]}];}return db[_0x666a('0x31')][_0x666a('0x48')](_0x17986e);})['then'](function(_0x388247){_0x5434fc[_0x666a('0x49')]=_0x388247;return _0x5434fc;})[_0x666a('0x28')](respondWithFilteredResult(_0x1a4587,_0x17986e))['catch'](handleError(_0x1a4587,null));};exports[_0x666a('0x4a')]=function(_0x247728,_0x5c0a30){var _0x537a14={'raw':!![],'where':{'id':_0x247728[_0x666a('0x4b')]['id']}},_0x115c40={};_0x115c40[_0x666a('0x36')]=_[_0x666a('0x37')](db[_0x666a('0x31')][_0x666a('0x32')]);_0x115c40[_0x666a('0x38')]=_[_0x666a('0x37')](_0x247728['query']);_0x115c40[_0x666a('0x41')]=_[_0x666a('0x3a')](_0x115c40['model'],_0x115c40[_0x666a('0x38')]);_0x537a14[_0x666a('0x39')]=_[_0x666a('0x3a')](_0x115c40['model'],qs[_0x666a('0x4c')](_0x247728['query'][_0x666a('0x4c')]));_0x537a14[_0x666a('0x39')]=_0x537a14[_0x666a('0x39')]['length']?_0x537a14[_0x666a('0x39')]:_0x115c40[_0x666a('0x36')];if(_0x247728['query'][_0x666a('0x47')]){_0x537a14[_0x666a('0x4d')]=[{'all':!![]}];}_0x537a14=_[_0x666a('0x44')]({},_0x537a14,_0x247728[_0x666a('0x4e')]);return db[_0x666a('0x31')][_0x666a('0x4f')](_0x537a14)['then'](handleEntityNotFound(_0x5c0a30,null))[_0x666a('0x28')](respondWithResult(_0x5c0a30,null))[_0x666a('0x50')](handleError(_0x5c0a30,null));};exports[_0x666a('0x51')]=function(_0x23d690,_0x4f3318){return db['Interval'][_0x666a('0x51')](_0x23d690['body'],{})[_0x666a('0x28')](function(_0x5bcc50){var _0x3a5d6e=_0x23d690[_0x666a('0x52')][_0x666a('0x29')]({'plain':!![]});if(!_0x3a5d6e)throw new Error(_0x666a('0x53'));if(_0x3a5d6e[_0x666a('0x54')]===_0x666a('0x52')){var _0x238463=_0x5bcc50[_0x666a('0x29')]({'plain':!![]});var _0x5f53d8=_0x666a('0x2a');return db[_0x666a('0x55')]['find']({'where':{'name':_0x5f53d8,'userProfileId':_0x3a5d6e['userProfileId']},'raw':!![]})[_0x666a('0x28')](function(_0x1b84fb){if(_0x1b84fb&&_0x1b84fb[_0x666a('0x56')]===0x0){return db[_0x666a('0x2b')]['create']({'name':_0x238463[_0x666a('0x2e')],'resourceId':_0x238463['id'],'type':_0x1b84fb[_0x666a('0x2e')],'sectionId':_0x1b84fb['id']},{})[_0x666a('0x28')](function(){return _0x5bcc50;});}else{return _0x5bcc50;}})['catch'](function(_0x54c059){logger['error'](_0x666a('0x57'),_0x54c059);throw _0x54c059;});}return _0x5bcc50;})[_0x666a('0x28')](respondWithResult(_0x4f3318,0xc9))[_0x666a('0x50')](handleError(_0x4f3318,null));};exports[_0x666a('0x26')]=function(_0x13f484,_0x51c36d){if(_0x13f484[_0x666a('0x58')]['id']){delete _0x13f484[_0x666a('0x58')]['id'];}return db[_0x666a('0x31')][_0x666a('0x4f')]({'where':{'id':_0x13f484[_0x666a('0x4b')]['id']}})[_0x666a('0x28')](handleEntityNotFound(_0x51c36d,null))[_0x666a('0x28')](saveUpdates(_0x13f484[_0x666a('0x58')],null))[_0x666a('0x28')](respondWithResult(_0x51c36d,null))[_0x666a('0x50')](handleError(_0x51c36d,null));};exports['destroy']=function(_0x5f38da,_0x29d10d){return db[_0x666a('0x31')][_0x666a('0x4f')]({'where':{'id':_0x5f38da[_0x666a('0x4b')]['id']}})[_0x666a('0x28')](handleEntityNotFound(_0x29d10d,null))[_0x666a('0x28')](removeEntity(_0x29d10d,null))['catch'](handleError(_0x29d10d,null));};exports[_0x666a('0x59')]=function(_0x22292c,_0xb6a7da,_0x332e9b){if(_0x22292c[_0x666a('0x58')]['id']){delete _0x22292c[_0x666a('0x58')]['id'];}return db[_0x666a('0x31')][_0x666a('0x4f')]({'where':{'id':_0x22292c[_0x666a('0x4b')]['id']}})[_0x666a('0x28')](handleEntityNotFound(_0xb6a7da,null))[_0x666a('0x28')](function(_0x29d102){if(_0x29d102){_0x22292c[_0x666a('0x58')][_0x666a('0x5a')]=_0x29d102['id'];return db['Interval'][_0x666a('0x51')](_0x22292c['body']);}})[_0x666a('0x28')](respondWithResult(_0xb6a7da,null))['catch'](handleError(_0xb6a7da,null));};exports[_0x666a('0x5b')]=function(_0x5da365,_0x40f4a5,_0x40491b){var _0x6f3663={};var _0x3408ff={};var _0x27c5fa;var _0x5a77cb;return db[_0x666a('0x31')]['findOne']({'where':{'id':_0x5da365['params']['id']}})[_0x666a('0x28')](handleEntityNotFound(_0x40f4a5,null))['then'](function(_0x432ef4){if(_0x432ef4){_0x27c5fa=_0x432ef4;_0x3408ff[_0x666a('0x36')]=_[_0x666a('0x37')](db[_0x666a('0x31')][_0x666a('0x32')]);_0x3408ff['query']=_['keys'](_0x5da365[_0x666a('0x38')]);_0x3408ff[_0x666a('0x41')]=_[_0x666a('0x3a')](_0x3408ff[_0x666a('0x36')],_0x3408ff['query']);_0x6f3663['attributes']=_[_0x666a('0x3a')](_0x3408ff['model'],qs[_0x666a('0x4c')](_0x5da365['query']['fields']));_0x6f3663[_0x666a('0x39')]=_0x6f3663[_0x666a('0x39')]['length']?_0x6f3663[_0x666a('0x39')]:_0x3408ff['model'];_0x6f3663[_0x666a('0x3e')]=qs[_0x666a('0x3f')](_0x5da365[_0x666a('0x38')][_0x666a('0x3f')]);_0x6f3663['where']=qs[_0x666a('0x41')](_[_0x666a('0x42')](_0x5da365[_0x666a('0x38')],_0x3408ff['filters']));if(_0x5da365[_0x666a('0x38')][_0x666a('0x43')]){_0x6f3663[_0x666a('0x40')]=_[_0x666a('0x44')](_0x6f3663[_0x666a('0x40')],{'$or':_['map'](_0x6f3663[_0x666a('0x39')],function(_0xb32341){var _0x583007={};_0x583007[_0xb32341]={'$like':'%'+_0x5da365[_0x666a('0x38')]['filter']+'%'};return _0x583007;})});}_0x6f3663=_[_0x666a('0x44')]({},_0x6f3663,_0x5da365[_0x666a('0x4e')]);return _0x27c5fa[_0x666a('0x5b')](_0x6f3663);}})[_0x666a('0x28')](function(_0x55b51a){if(_0x55b51a){_0x5a77cb=_0x55b51a['length'];if(!_0x5da365[_0x666a('0x38')][_0x666a('0x3c')](_0x666a('0x3d'))){_0x6f3663['limit']=qs[_0x666a('0x21')](_0x5da365[_0x666a('0x38')]['limit']);_0x6f3663[_0x666a('0x1f')]=qs[_0x666a('0x1f')](_0x5da365[_0x666a('0x38')][_0x666a('0x1f')]);}return _0x27c5fa[_0x666a('0x5b')](_0x6f3663);}})[_0x666a('0x28')](function(_0x2bdaf5){if(_0x2bdaf5){return _0x2bdaf5?{'count':_0x5a77cb,'rows':_0x2bdaf5}:null;}})[_0x666a('0x28')](respondWithResult(_0x40f4a5,null))['catch'](handleError(_0x40f4a5,null));};exports[_0x666a('0x5c')]=function(_0x252f78,_0x10fd88,_0x116619){return db[_0x666a('0x31')]['findOne']({'where':{'id':_0x252f78[_0x666a('0x4b')]['id']}})[_0x666a('0x28')](handleEntityNotFound(_0x10fd88,null))[_0x666a('0x28')](function(_0x5c4504){if(_0x5c4504){return db['sequelize']['transaction'](function(_0xff4e89){return db[_0x666a('0x31')][_0x666a('0x27')]({'where':{'IntervalId':_0x252f78['params']['id']},'transaction':_0xff4e89})[_0x666a('0x28')](function(_0x33659e){var _0x46504d=_[_0x666a('0x45')](_0x252f78[_0x666a('0x58')],function(_0x4e3e9c){delete _0x4e3e9c['id'];_0x4e3e9c[_0x666a('0x5a')]=_0x252f78[_0x666a('0x4b')]['id'];return _0x4e3e9c;});return db[_0x666a('0x31')][_0x666a('0x5d')](_0x46504d,{'transaction':_0xff4e89});});})[_0x666a('0x28')](function(){return db[_0x666a('0x31')][_0x666a('0x48')]({'where':{'IntervalId':_0x252f78[_0x666a('0x4b')]['id']}});});}})['then'](respondWithResult(_0x10fd88,null))[_0x666a('0x50')](handleError(_0x10fd88,null));}; \ No newline at end of file +var _0x1fd2=['query','intersection','fields','attributes','sort','where','filter','merge','VIRTUAL','options','Interval','include','findAll','rows','catch','show','params','length','includeAll','find','body','user','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','IntervalId','findOne','order','pick','getIntervals','hasOwnProperty','nolimit','addIntervals','sequelize','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../components/extensions/rewrite','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','error','stack','name','index','map','rawAttributes','key','keys','filters','model'];(function(_0x162e95,_0x5256e9){var _0x566ad7=function(_0x557256){while(--_0x557256){_0x162e95['push'](_0x162e95['shift']());}};_0x566ad7(++_0x5256e9);}(_0x1fd2,0xd5));var _0x21fd=function(_0x5e93c0,_0x3a2332){_0x5e93c0=_0x5e93c0-0x0;var _0x149e9d=_0x1fd2[_0x5e93c0];return _0x149e9d;};'use strict';var emlformat=require(_0x21fd('0x0'));var rimraf=require(_0x21fd('0x1'));var zipdir=require(_0x21fd('0x2'));var jsonpatch=require(_0x21fd('0x3'));var rp=require(_0x21fd('0x4'));var moment=require(_0x21fd('0x5'));var BPromise=require(_0x21fd('0x6'));var Mustache=require(_0x21fd('0x7'));var util=require(_0x21fd('0x8'));var path=require(_0x21fd('0x9'));var sox=require('sox');var csv=require(_0x21fd('0xa'));var ejs=require(_0x21fd('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x21fd('0xc'));var squel=require(_0x21fd('0xd'));var crypto=require(_0x21fd('0xe'));var jsforce=require(_0x21fd('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x21fd('0xa'));var querystring=require(_0x21fd('0x10'));var Papa=require(_0x21fd('0x11'));var Redis=require('ioredis');var authService=require(_0x21fd('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x21fd('0x13'));var hardwareService=require(_0x21fd('0x14'));var logger=require(_0x21fd('0x15'))(_0x21fd('0x16'));var utils=require('../../config/utils');var config=require(_0x21fd('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var extensions=require(_0x21fd('0x18'));function respondWithStatusCode(_0x20a95f,_0x1840f0){_0x1840f0=_0x1840f0||0xcc;return function(_0x2cf1ee){if(_0x2cf1ee){return _0x20a95f['sendStatus'](_0x1840f0);}return _0x20a95f[_0x21fd('0x19')](_0x1840f0)[_0x21fd('0x1a')]();};}function respondWithResult(_0x5582c1,_0xf8117f){_0xf8117f=_0xf8117f||0xc8;return function(_0x1f9f48){if(_0x1f9f48){return _0x5582c1[_0x21fd('0x19')](_0xf8117f)[_0x21fd('0x1b')](_0x1f9f48);}};}function respondWithFilteredResult(_0x33c9e9,_0x47041f){return function(_0x482085){if(_0x482085){var _0xe43d19=typeof _0x47041f[_0x21fd('0x1c')]===_0x21fd('0x1d')&&typeof _0x47041f[_0x21fd('0x1e')]===_0x21fd('0x1d');var _0x16a246=_0x482085[_0x21fd('0x1f')];var _0x5d0f44=_0xe43d19?0x0:_0x47041f[_0x21fd('0x1c')];var _0x3ecd73=_0xe43d19?_0x482085['count']:_0x47041f['offset']+_0x47041f[_0x21fd('0x1e')];var _0x1cc989;if(_0x3ecd73>=_0x16a246){_0x3ecd73=_0x16a246;_0x1cc989=0xc8;}else{_0x1cc989=0xce;}_0x33c9e9['status'](_0x1cc989);return _0x33c9e9[_0x21fd('0x20')](_0x21fd('0x21'),_0x5d0f44+'-'+_0x3ecd73+'/'+_0x16a246)['json'](_0x482085);}return null;};}function patchUpdates(_0x5043f7){return function(_0x499c66){try{jsonpatch[_0x21fd('0x22')](_0x499c66,_0x5043f7,!![]);}catch(_0x2ffcfd){return BPromise[_0x21fd('0x23')](_0x2ffcfd);}return _0x499c66[_0x21fd('0x24')]();};}function saveUpdates(_0x5c5ac6,_0x5c7bdb){return function(_0x4e60ac){if(_0x4e60ac){return _0x4e60ac[_0x21fd('0x25')](_0x5c5ac6)['then'](function(_0x60fede){return _0x60fede;});}return null;};}function removeEntity(_0xd9e31d,_0x125e01){return function(_0x5b3980){if(_0x5b3980){return _0x5b3980[_0x21fd('0x26')]()[_0x21fd('0x27')](function(){var _0x1f0bbc=_0x5b3980[_0x21fd('0x28')]({'plain':!![]});var _0x593c1c='Intervals';return db['UserProfileResource'][_0x21fd('0x26')]({'where':{'type':_0x593c1c,'resourceId':_0x1f0bbc['id']}})[_0x21fd('0x27')](function(){return _0x5b3980;});})[_0x21fd('0x27')](function(){_0xd9e31d[_0x21fd('0x19')](0xcc)[_0x21fd('0x1a')]();});}};}function handleEntityNotFound(_0x5250f6,_0x2dc0b9){return function(_0x13a301){if(!_0x13a301){_0x5250f6['sendStatus'](0x194);}return _0x13a301;};}function handleError(_0x509e40,_0x571d77){_0x571d77=_0x571d77||0x1f4;return function(_0x403428){logger[_0x21fd('0x29')](_0x403428[_0x21fd('0x2a')]);if(_0x403428[_0x21fd('0x2b')]){delete _0x403428['name'];}_0x509e40[_0x21fd('0x19')](_0x571d77)['send'](_0x403428);};}exports[_0x21fd('0x2c')]=function(_0x4f698e,_0x1c2773){var _0x2f26a7={},_0x115a5b={},_0x21c585={'count':0x0,'rows':[]};var _0x55e2b6=_[_0x21fd('0x2d')](db['Interval'][_0x21fd('0x2e')],function(_0x1aa236){return{'name':_0x1aa236['fieldName'],'type':_0x1aa236['type'][_0x21fd('0x2f')]};});_0x115a5b['model']=_[_0x21fd('0x2d')](_0x55e2b6,'name');_0x115a5b['query']=_[_0x21fd('0x30')](_0x4f698e['query']);_0x115a5b[_0x21fd('0x31')]=_['intersection'](_0x115a5b[_0x21fd('0x32')],_0x115a5b[_0x21fd('0x33')]);_0x2f26a7['attributes']=_[_0x21fd('0x34')](_0x115a5b[_0x21fd('0x32')],qs[_0x21fd('0x35')](_0x4f698e[_0x21fd('0x33')]['fields']));_0x2f26a7[_0x21fd('0x36')]=_0x2f26a7['attributes']['length']?_0x2f26a7[_0x21fd('0x36')]:_0x115a5b['model'];if(!_0x4f698e['query']['hasOwnProperty']('nolimit')){_0x2f26a7[_0x21fd('0x1e')]=qs['limit'](_0x4f698e[_0x21fd('0x33')][_0x21fd('0x1e')]);_0x2f26a7['offset']=qs[_0x21fd('0x1c')](_0x4f698e[_0x21fd('0x33')][_0x21fd('0x1c')]);}_0x2f26a7['order']=qs[_0x21fd('0x37')](_0x4f698e[_0x21fd('0x33')]['sort']);_0x2f26a7[_0x21fd('0x38')]=qs[_0x21fd('0x31')](_['pick'](_0x4f698e['query'],_0x115a5b[_0x21fd('0x31')]),_0x55e2b6);if(_0x4f698e['query'][_0x21fd('0x39')]){_0x2f26a7[_0x21fd('0x38')]=_[_0x21fd('0x3a')](_0x2f26a7[_0x21fd('0x38')],{'$or':_[_0x21fd('0x2d')](_0x55e2b6,function(_0x4c40ca){if(_0x4c40ca['type']!==_0x21fd('0x3b')){var _0x110006={};_0x110006[_0x4c40ca['name']]={'$like':'%'+_0x4f698e['query'][_0x21fd('0x39')]+'%'};return _0x110006;}})});}_0x2f26a7=_[_0x21fd('0x3a')]({},_0x2f26a7,_0x4f698e[_0x21fd('0x3c')]);var _0x586e4a={'where':_0x2f26a7[_0x21fd('0x38')]};return db[_0x21fd('0x3d')][_0x21fd('0x1f')](_0x586e4a)[_0x21fd('0x27')](function(_0x3cc23b){_0x21c585['count']=_0x3cc23b;if(_0x4f698e[_0x21fd('0x33')]['includeAll']){_0x2f26a7[_0x21fd('0x3e')]=[{'all':!![]}];}return db[_0x21fd('0x3d')][_0x21fd('0x3f')](_0x2f26a7);})[_0x21fd('0x27')](function(_0x453ab8){_0x21c585[_0x21fd('0x40')]=_0x453ab8;return _0x21c585;})['then'](respondWithFilteredResult(_0x1c2773,_0x2f26a7))[_0x21fd('0x41')](handleError(_0x1c2773,null));};exports[_0x21fd('0x42')]=function(_0x575f5e,_0x3d8b2d){var _0x52741e={'raw':!![],'where':{'id':_0x575f5e[_0x21fd('0x43')]['id']}},_0x101816={};_0x101816[_0x21fd('0x32')]=_['keys'](db[_0x21fd('0x3d')][_0x21fd('0x2e')]);_0x101816[_0x21fd('0x33')]=_[_0x21fd('0x30')](_0x575f5e[_0x21fd('0x33')]);_0x101816['filters']=_[_0x21fd('0x34')](_0x101816[_0x21fd('0x32')],_0x101816['query']);_0x52741e[_0x21fd('0x36')]=_[_0x21fd('0x34')](_0x101816[_0x21fd('0x32')],qs[_0x21fd('0x35')](_0x575f5e[_0x21fd('0x33')][_0x21fd('0x35')]));_0x52741e[_0x21fd('0x36')]=_0x52741e[_0x21fd('0x36')][_0x21fd('0x44')]?_0x52741e[_0x21fd('0x36')]:_0x101816['model'];if(_0x575f5e['query'][_0x21fd('0x45')]){_0x52741e['include']=[{'all':!![]}];}_0x52741e=_[_0x21fd('0x3a')]({},_0x52741e,_0x575f5e['options']);return db[_0x21fd('0x3d')][_0x21fd('0x46')](_0x52741e)[_0x21fd('0x27')](handleEntityNotFound(_0x3d8b2d,null))[_0x21fd('0x27')](respondWithResult(_0x3d8b2d,null))[_0x21fd('0x41')](handleError(_0x3d8b2d,null));};exports['create']=function(_0x5d82ca,_0xc05b01){return db[_0x21fd('0x3d')]['create'](_0x5d82ca[_0x21fd('0x47')],{})[_0x21fd('0x27')](function(_0x2ebe21){var _0x444a1a=_0x5d82ca['user'][_0x21fd('0x28')]({'plain':!![]});if(!_0x444a1a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x444a1a['role']===_0x21fd('0x48')){var _0x56b784=_0x2ebe21[_0x21fd('0x28')]({'plain':!![]});var _0x2a49a4='Intervals';return db['UserProfileSection'][_0x21fd('0x46')]({'where':{'name':_0x2a49a4,'userProfileId':_0x444a1a[_0x21fd('0x49')]},'raw':!![]})[_0x21fd('0x27')](function(_0x232bce){if(_0x232bce&&_0x232bce[_0x21fd('0x4a')]===0x0){return db[_0x21fd('0x4b')][_0x21fd('0x4c')]({'name':_0x56b784[_0x21fd('0x2b')],'resourceId':_0x56b784['id'],'type':_0x232bce[_0x21fd('0x2b')],'sectionId':_0x232bce['id']},{})[_0x21fd('0x27')](function(){return _0x2ebe21;});}else{return _0x2ebe21;}})[_0x21fd('0x41')](function(_0x1e0f98){logger[_0x21fd('0x29')](_0x21fd('0x4d'),_0x1e0f98);throw _0x1e0f98;});}return _0x2ebe21;})['then'](respondWithResult(_0xc05b01,0xc9))['catch'](handleError(_0xc05b01,null));};exports[_0x21fd('0x25')]=function(_0x12c9a9,_0x1a8f36){if(_0x12c9a9['body']['id']){delete _0x12c9a9[_0x21fd('0x47')]['id'];}return db[_0x21fd('0x3d')][_0x21fd('0x46')]({'where':{'id':_0x12c9a9[_0x21fd('0x43')]['id']}})[_0x21fd('0x27')](handleEntityNotFound(_0x1a8f36,null))['then'](saveUpdates(_0x12c9a9['body'],null))['then'](respondWithResult(_0x1a8f36,null))['catch'](handleError(_0x1a8f36,null));};exports[_0x21fd('0x26')]=function(_0x5db1b5,_0x1f209a){return db[_0x21fd('0x3d')][_0x21fd('0x46')]({'where':{'id':_0x5db1b5[_0x21fd('0x43')]['id']}})[_0x21fd('0x27')](handleEntityNotFound(_0x1f209a,null))['then'](removeEntity(_0x1f209a,null))[_0x21fd('0x41')](handleError(_0x1f209a,null));};exports['addInterval']=function(_0xb1dba1,_0x33c2b9,_0x26faba){if(_0xb1dba1[_0x21fd('0x47')]['id']){delete _0xb1dba1[_0x21fd('0x47')]['id'];}return db['Interval'][_0x21fd('0x46')]({'where':{'id':_0xb1dba1[_0x21fd('0x43')]['id']}})[_0x21fd('0x27')](handleEntityNotFound(_0x33c2b9,null))[_0x21fd('0x27')](function(_0x158736){if(_0x158736){_0xb1dba1[_0x21fd('0x47')][_0x21fd('0x4e')]=_0x158736['id'];return db[_0x21fd('0x3d')]['create'](_0xb1dba1[_0x21fd('0x47')]);}})[_0x21fd('0x27')](respondWithResult(_0x33c2b9,null))[_0x21fd('0x41')](handleError(_0x33c2b9,null));};exports['getIntervals']=function(_0x3cdb8b,_0x578046,_0x3f69f4){var _0x5ae959={};var _0x5982ca={};var _0x1c1771;var _0x253cb8;return db[_0x21fd('0x3d')][_0x21fd('0x4f')]({'where':{'id':_0x3cdb8b[_0x21fd('0x43')]['id']}})[_0x21fd('0x27')](handleEntityNotFound(_0x578046,null))[_0x21fd('0x27')](function(_0x31df7d){if(_0x31df7d){_0x1c1771=_0x31df7d;_0x5982ca[_0x21fd('0x32')]=_[_0x21fd('0x30')](db[_0x21fd('0x3d')][_0x21fd('0x2e')]);_0x5982ca[_0x21fd('0x33')]=_[_0x21fd('0x30')](_0x3cdb8b[_0x21fd('0x33')]);_0x5982ca[_0x21fd('0x31')]=_[_0x21fd('0x34')](_0x5982ca[_0x21fd('0x32')],_0x5982ca['query']);_0x5ae959[_0x21fd('0x36')]=_[_0x21fd('0x34')](_0x5982ca[_0x21fd('0x32')],qs[_0x21fd('0x35')](_0x3cdb8b[_0x21fd('0x33')]['fields']));_0x5ae959[_0x21fd('0x36')]=_0x5ae959[_0x21fd('0x36')]['length']?_0x5ae959[_0x21fd('0x36')]:_0x5982ca[_0x21fd('0x32')];_0x5ae959[_0x21fd('0x50')]=qs[_0x21fd('0x37')](_0x3cdb8b['query']['sort']);_0x5ae959[_0x21fd('0x38')]=qs[_0x21fd('0x31')](_[_0x21fd('0x51')](_0x3cdb8b[_0x21fd('0x33')],_0x5982ca['filters']));if(_0x3cdb8b['query'][_0x21fd('0x39')]){_0x5ae959['where']=_[_0x21fd('0x3a')](_0x5ae959[_0x21fd('0x38')],{'$or':_[_0x21fd('0x2d')](_0x5ae959[_0x21fd('0x36')],function(_0x52a2c1){var _0xb6b87d={};_0xb6b87d[_0x52a2c1]={'$like':'%'+_0x3cdb8b[_0x21fd('0x33')][_0x21fd('0x39')]+'%'};return _0xb6b87d;})});}_0x5ae959=_[_0x21fd('0x3a')]({},_0x5ae959,_0x3cdb8b['options']);return _0x1c1771[_0x21fd('0x52')](_0x5ae959);}})[_0x21fd('0x27')](function(_0xe14350){if(_0xe14350){_0x253cb8=_0xe14350['length'];if(!_0x3cdb8b[_0x21fd('0x33')][_0x21fd('0x53')](_0x21fd('0x54'))){_0x5ae959[_0x21fd('0x1e')]=qs['limit'](_0x3cdb8b[_0x21fd('0x33')][_0x21fd('0x1e')]);_0x5ae959[_0x21fd('0x1c')]=qs['offset'](_0x3cdb8b[_0x21fd('0x33')][_0x21fd('0x1c')]);}return _0x1c1771[_0x21fd('0x52')](_0x5ae959);}})[_0x21fd('0x27')](function(_0x4c5ee1){if(_0x4c5ee1){return _0x4c5ee1?{'count':_0x253cb8,'rows':_0x4c5ee1}:null;}})['then'](respondWithResult(_0x578046,null))[_0x21fd('0x41')](handleError(_0x578046,null));};exports[_0x21fd('0x55')]=function(_0x519394,_0x353465,_0x3839b1){return db['Interval'][_0x21fd('0x4f')]({'where':{'id':_0x519394[_0x21fd('0x43')]['id']}})['then'](handleEntityNotFound(_0x353465,null))[_0x21fd('0x27')](function(_0x4afc9d){if(_0x4afc9d){return db[_0x21fd('0x56')]['transaction'](function(_0x504e43){return db[_0x21fd('0x3d')][_0x21fd('0x26')]({'where':{'IntervalId':_0x519394[_0x21fd('0x43')]['id']},'transaction':_0x504e43})[_0x21fd('0x27')](function(_0x37d6a1){var _0x11c472=_[_0x21fd('0x2d')](_0x519394[_0x21fd('0x47')],function(_0x1d9b7c){delete _0x1d9b7c['id'];_0x1d9b7c[_0x21fd('0x4e')]=_0x519394[_0x21fd('0x43')]['id'];return _0x1d9b7c;});return db[_0x21fd('0x3d')][_0x21fd('0x57')](_0x11c472,{'transaction':_0x504e43});});})[_0x21fd('0x27')](function(){return db[_0x21fd('0x3d')][_0x21fd('0x3f')]({'where':{'IntervalId':_0x519394[_0x21fd('0x43')]['id']}});});}})[_0x21fd('0x27')](respondWithResult(_0x353465,null))[_0x21fd('0x41')](handleError(_0x353465,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 70c794d..c5dd116 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 _0x218f=['string','getIntervals','then','all','ifTime','reduce','../../components/extensions/rewrite','iftime','exports','define','Interval','tools_intervals','rewrite','interval'];(function(_0x9be381,_0x4c022d){var _0xf83404=function(_0x283a10){while(--_0x283a10){_0x9be381['push'](_0x9be381['shift']());}};_0xf83404(++_0x4c022d);}(_0x218f,0x148));var _0xf218=function(_0xbd7214,_0x18328e){_0xbd7214=_0xbd7214-0x0;var _0x9eb7a6=_0x218f[_0xbd7214];return _0x9eb7a6;};'use strict';var attributes=require('./interval.attributes');var extensions=require(_0xf218('0x0'));var iftime=require('../../utils/iftime')[_0xf218('0x1')];module[_0xf218('0x2')]=function(_0x5d9ad0){return _0x5d9ad0[_0xf218('0x3')](_0xf218('0x4'),attributes,{'tableName':_0xf218('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3ca972){extensions[_0xf218('0x6')](_0x5d9ad0,_0x3ca972);},'afterBulkCreate':function(_0x251f11,_0x34b34a,_0x5a74e3){_0x5a74e3();extensions['rewrite'](_0x5d9ad0,_0x251f11[0x0]);},'afterUpdate':function(_0x43a617){extensions[_0xf218('0x6')](_0x5d9ad0,_0x43a617);},'afterDestroy':function(_0x5af73c){extensions[_0xf218('0x6')](_0x5d9ad0,_0x5af73c);}},'instanceMethods':{'ifTime':function(_0x218c4b=undefined,_0x2c34a8=new Date()){if(typeof this[_0xf218('0x7')]===_0xf218('0x8')){return iftime(this[_0xf218('0x7')],_0x218c4b,_0x2c34a8);}else{return this[_0xf218('0x9')]()[_0xf218('0xa')](function(_0x1b6374){return Promise[_0xf218('0xb')](_0x1b6374['map'](function(_0x285503){return _0x285503[_0xf218('0xc')](_0x218c4b,_0x2c34a8);}));})[_0xf218('0xa')](function(_0x53982e){return _0x53982e[_0xf218('0xd')](function(_0x347229,_0x3cd297){return _0x347229||_0x3cd297;},![]);});}}}});}; \ No newline at end of file +var _0x8e01=['../../utils/iftime','iftime','exports','define','Interval','rewrite','string','then','all','map','ifTime','reduce'];(function(_0xa5c819,_0x339383){var _0x2a23ff=function(_0x220854){while(--_0x220854){_0xa5c819['push'](_0xa5c819['shift']());}};_0x2a23ff(++_0x339383);}(_0x8e01,0xb4));var _0x18e0=function(_0x103594,_0x6a9c10){_0x103594=_0x103594-0x0;var _0x44609d=_0x8e01[_0x103594];return _0x44609d;};'use strict';var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');var iftime=require(_0x18e0('0x0'))[_0x18e0('0x1')];module[_0x18e0('0x2')]=function(_0x175547){return _0x175547[_0x18e0('0x3')](_0x18e0('0x4'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x30b4e1){extensions[_0x18e0('0x5')](_0x175547,_0x30b4e1);},'afterBulkCreate':function(_0x4c17da,_0x4a493d,_0x3b0d2c){_0x3b0d2c();extensions[_0x18e0('0x5')](_0x175547,_0x4c17da[0x0]);},'afterUpdate':function(_0x25e14d){extensions['rewrite'](_0x175547,_0x25e14d);},'afterDestroy':function(_0x3d1807){extensions[_0x18e0('0x5')](_0x175547,_0x3d1807);}},'instanceMethods':{'ifTime':function(_0x3bab89=undefined,_0x13bc01=new Date()){if(typeof this['interval']===_0x18e0('0x6')){return iftime(this['interval'],_0x3bab89,_0x13bc01);}else{return this['getIntervals']()[_0x18e0('0x7')](function(_0x221845){return Promise[_0x18e0('0x8')](_0x221845[_0x18e0('0x9')](function(_0x170299){return _0x170299[_0x18e0('0xa')](_0x3bab89,_0x13bc01);}));})[_0x18e0('0x7')](function(_0xe78120){return _0xe78120[_0x18e0('0xb')](function(_0x2bfd33,_0x2ec644){return _0x2bfd33||_0x2ec644;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 54b4b5b..ab31c8a 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 _0x0905=['IntervalIftime:\x20timezone\x20=\x20%s','debug','Iftime','resolve','isArray','reduce','catch','IntervalIftime','lodash','util','../../mysqldb','../../utils/iftime','iftime','rpc','GetInterval','Interval','findAll','options','raw','where','attributes','limit','include','map','model','then','info','stringify','message','error','ShowInterval','all','ifTime','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','intervals','string','timezone','length','format','IntervalIftime:\x20interval\x20strings\x20=\x20%s'];(function(_0x12450f,_0x187372){var _0x579938=function(_0x350a66){while(--_0x350a66){_0x12450f['push'](_0x12450f['shift']());}};_0x579938(++_0x187372);}(_0x0905,0x135));var _0x5090=function(_0x538572,_0x27187e){_0x538572=_0x538572-0x0;var _0x28ab1a=_0x0905[_0x538572];return _0x28ab1a;};'use strict';var _=require(_0x5090('0x0'));var util=require(_0x5090('0x1'));var db=require(_0x5090('0x2'))['db'];var iftime=require(_0x5090('0x3'))[_0x5090('0x4')];var logger=require('../../config/logger')(_0x5090('0x5'));exports[_0x5090('0x6')]=function(_0x2a5f2d){var _0x5461d9=this;return new Promise(function(_0x1b60ea,_0x4e90fb){return db[_0x5090('0x7')][_0x5090('0x8')]({'raw':_0x2a5f2d[_0x5090('0x9')]?_0x2a5f2d[_0x5090('0x9')][_0x5090('0xa')]===undefined?!![]:![]:!![],'where':_0x2a5f2d[_0x5090('0x9')]?_0x2a5f2d['options'][_0x5090('0xb')]||null:null,'attributes':_0x2a5f2d[_0x5090('0x9')]?_0x2a5f2d[_0x5090('0x9')][_0x5090('0xc')]||null:null,'limit':_0x2a5f2d[_0x5090('0x9')]?_0x2a5f2d['options'][_0x5090('0xd')]||null:null,'include':_0x2a5f2d[_0x5090('0x9')]?_0x2a5f2d[_0x5090('0x9')][_0x5090('0xe')]?_[_0x5090('0xf')](_0x2a5f2d[_0x5090('0x9')]['include'],function(_0x425a9d){return{'model':db[_0x425a9d[_0x5090('0x10')]],'as':_0x425a9d['as'],'attributes':_0x425a9d['attributes'],'include':_0x425a9d[_0x5090('0xe')]?_[_0x5090('0xf')](_0x425a9d[_0x5090('0xe')],function(_0x2983f6){return{'model':db[_0x2983f6[_0x5090('0x10')]],'as':_0x2983f6['as'],'attributes':_0x2983f6[_0x5090('0xc')],'include':_0x2983f6[_0x5090('0xe')]?_[_0x5090('0xf')](_0x2983f6[_0x5090('0xe')],function(_0x1a11dc){return{'model':db[_0x1a11dc[_0x5090('0x10')]],'as':_0x1a11dc['as'],'attributes':_0x1a11dc[_0x5090('0xc')]};}):[]};}):[]};}):[]:[]})[_0x5090('0x11')](function(_0xe73190){logger[_0x5090('0x12')]('GetInterval',_0x2a5f2d);logger['debug']('GetInterval',_0x2a5f2d,JSON[_0x5090('0x13')](_0xe73190));_0x1b60ea(_0xe73190);})['catch'](function(_0x40caf9){logger['error'](_0x5090('0x6'),_0x40caf9[_0x5090('0x14')],_0x2a5f2d);_0x4e90fb(_0x5461d9[_0x5090('0x15')](0x1f4,_0x40caf9[_0x5090('0x14')]));});});};exports[_0x5090('0x16')]=function(_0xae9300){var _0x4ea1b0=this;return new Promise(function(_0x3f3049,_0x434e48){return db['Interval']['find']({'raw':_0xae9300[_0x5090('0x9')]?_0xae9300[_0x5090('0x9')][_0x5090('0xa')]===undefined?!![]:![]:!![],'where':_0xae9300['options']?_0xae9300[_0x5090('0x9')]['where']||null:null,'attributes':_0xae9300[_0x5090('0x9')]?_0xae9300[_0x5090('0x9')][_0x5090('0xc')]||null:null,'include':_0xae9300[_0x5090('0x9')]?_0xae9300[_0x5090('0x9')][_0x5090('0xe')]?_[_0x5090('0xf')](_0xae9300[_0x5090('0x9')][_0x5090('0xe')],function(_0x5b7c21){return{'model':db[_0x5b7c21['model']],'as':_0x5b7c21['as'],'attributes':_0x5b7c21[_0x5090('0xc')],'include':_0x5b7c21[_0x5090('0xe')]?_['map'](_0x5b7c21[_0x5090('0xe')],function(_0x18337d){return{'model':db[_0x18337d[_0x5090('0x10')]],'as':_0x18337d['as'],'attributes':_0x18337d[_0x5090('0xc')],'include':_0x18337d[_0x5090('0xe')]?_[_0x5090('0xf')](_0x18337d[_0x5090('0xe')],function(_0x378407){return{'model':db[_0x378407[_0x5090('0x10')]],'as':_0x378407['as'],'attributes':_0x378407[_0x5090('0xc')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x25810a){logger['info'](_0x5090('0x16'),_0xae9300);logger['debug'](_0x5090('0x16'),_0xae9300,JSON[_0x5090('0x13')](_0x25810a));_0x3f3049(_0x25810a);})['catch'](function(_0xa89938){logger[_0x5090('0x15')](_0x5090('0x16'),_0xa89938[_0x5090('0x14')],_0xae9300);_0x434e48(_0x4ea1b0[_0x5090('0x15')](0x1f4,_0xa89938[_0x5090('0x14')]));});});};function checkArrayOfIntervals(_0x310cd9,_0x19d82b){var _0x8b2227=[];return db[_0x5090('0x7')][_0x5090('0x8')]({'where':{'id':_0x310cd9}})[_0x5090('0x11')](function(_0x3579fa){_0x8b2227=_0x3579fa;return Promise[_0x5090('0x17')](_0x8b2227['map'](function(_0x30b0bc){return _0x30b0bc[_0x5090('0x18')](_0x19d82b);}));})[_0x5090('0x11')](function(_0xeb2f4d){var _0x2507c3=_0xeb2f4d['reduce'](function(_0x4a3a1c,_0x44ad04){return _0x4a3a1c||_0x44ad04;},![]);logger['info'](util['format']('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0x8b2227[_0x5090('0xf')](function(_0x3caa9a){return _0x3caa9a[_0x5090('0x19')];})[_0x5090('0x1a')](',\x20'),_0x8b2227[_0x5090('0xf')](function(_0x17326d){return _0x17326d['id'];})[_0x5090('0x1a')](',\x20')));return _0x2507c3;});}function checkSingleInterval(_0x287b54,_0x524c18){return db['Interval'][_0x5090('0x1b')](_0x287b54)[_0x5090('0x11')](function(_0x32fa3d){if(_0x32fa3d){logger['info'](util['format'](_0x5090('0x1c'),_0x32fa3d['name'],_0x32fa3d['id']));return _0x32fa3d['ifTime'](_0x524c18);}});}exports['IntervalIftime']=function(_0x4bc797){var _0x54e3c7=_0x4bc797['intervalIds'];var _0x1f8770=Array['isArray'](_0x4bc797['intervals'])?_0x4bc797[_0x5090('0x1d')]:typeof _0x4bc797['intervals']===_0x5090('0x1e')?[_0x4bc797[_0x5090('0x1d')]]:[];var _0x17b3a0=_0x4bc797[_0x5090('0x1f')]||undefined;var _0x4fda77=![];if(_0x1f8770[_0x5090('0x20')]){logger[_0x5090('0x12')](util[_0x5090('0x21')](_0x5090('0x22'),_0x1f8770[_0x5090('0x1a')](';\x20')));}if(_0x17b3a0){logger[_0x5090('0x12')](util[_0x5090('0x21')](_0x5090('0x23'),_0x17b3a0));}logger[_0x5090('0x24')](_0x5090('0x25'),_0x4fda77);logger['silly']('IntervalIftime',_0x4bc797);return Promise[_0x5090('0x26')]()[_0x5090('0x11')](function(){if(Array[_0x5090('0x27')](_0x54e3c7)){return checkArrayOfIntervals(_0x54e3c7,_0x17b3a0);}else if(_0x54e3c7){return checkSingleInterval(_0x54e3c7,_0x17b3a0);}})[_0x5090('0x11')](function(_0x29a3a0){var _0x46c91e=_0x1f8770[_0x5090('0x28')](function(_0x119514,_0x565daf){return _0x119514||iftime(_0x565daf,_0x17b3a0);},![]);_0x4fda77=_0x29a3a0||_0x46c91e;return _0x4fda77;})[_0x5090('0x29')](function(_0x3c4874){logger[_0x5090('0x15')](_0x5090('0x2a'),_0x4bc797,_0x3c4874);throw this[_0x5090('0x15')](0x1f4,_0x3c4874[_0x5090('0x14')]);});}; \ No newline at end of file +var _0x61bf=['intervalIds','isArray','intervals','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','join','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','resolve','util','../../mysqldb','../../utils/iftime','iftime','rpc','GetInterval','Interval','findAll','raw','options','where','attributes','include','map','model','then','info','debug','stringify','catch','error','message','find','ShowInterval','all','ifTime','reduce','format','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime'];(function(_0x534165,_0x5b293a){var _0x5904ec=function(_0x5a252a){while(--_0x5a252a){_0x534165['push'](_0x534165['shift']());}};_0x5904ec(++_0x5b293a);}(_0x61bf,0x131));var _0xf61b=function(_0x192653,_0x40deb6){_0x192653=_0x192653-0x0;var _0x41508b=_0x61bf[_0x192653];return _0x41508b;};'use strict';var _=require('lodash');var util=require(_0xf61b('0x0'));var db=require(_0xf61b('0x1'))['db'];var iftime=require(_0xf61b('0x2'))[_0xf61b('0x3')];var logger=require('../../config/logger')(_0xf61b('0x4'));exports[_0xf61b('0x5')]=function(_0x1fdb3c){var _0x4727bf=this;return new Promise(function(_0x7933be,_0x2224a8){return db[_0xf61b('0x6')][_0xf61b('0x7')]({'raw':_0x1fdb3c['options']?_0x1fdb3c['options'][_0xf61b('0x8')]===undefined?!![]:![]:!![],'where':_0x1fdb3c[_0xf61b('0x9')]?_0x1fdb3c[_0xf61b('0x9')][_0xf61b('0xa')]||null:null,'attributes':_0x1fdb3c[_0xf61b('0x9')]?_0x1fdb3c[_0xf61b('0x9')][_0xf61b('0xb')]||null:null,'limit':_0x1fdb3c['options']?_0x1fdb3c[_0xf61b('0x9')]['limit']||null:null,'include':_0x1fdb3c[_0xf61b('0x9')]?_0x1fdb3c[_0xf61b('0x9')][_0xf61b('0xc')]?_[_0xf61b('0xd')](_0x1fdb3c[_0xf61b('0x9')][_0xf61b('0xc')],function(_0x5f1f46){return{'model':db[_0x5f1f46[_0xf61b('0xe')]],'as':_0x5f1f46['as'],'attributes':_0x5f1f46[_0xf61b('0xb')],'include':_0x5f1f46[_0xf61b('0xc')]?_[_0xf61b('0xd')](_0x5f1f46[_0xf61b('0xc')],function(_0x4018bd){return{'model':db[_0x4018bd['model']],'as':_0x4018bd['as'],'attributes':_0x4018bd['attributes'],'include':_0x4018bd[_0xf61b('0xc')]?_[_0xf61b('0xd')](_0x4018bd[_0xf61b('0xc')],function(_0x2707dc){return{'model':db[_0x2707dc[_0xf61b('0xe')]],'as':_0x2707dc['as'],'attributes':_0x2707dc[_0xf61b('0xb')]};}):[]};}):[]};}):[]:[]})[_0xf61b('0xf')](function(_0x350291){logger[_0xf61b('0x10')](_0xf61b('0x5'),_0x1fdb3c);logger[_0xf61b('0x11')](_0xf61b('0x5'),_0x1fdb3c,JSON[_0xf61b('0x12')](_0x350291));_0x7933be(_0x350291);})[_0xf61b('0x13')](function(_0x433d54){logger[_0xf61b('0x14')]('GetInterval',_0x433d54[_0xf61b('0x15')],_0x1fdb3c);_0x2224a8(_0x4727bf[_0xf61b('0x14')](0x1f4,_0x433d54[_0xf61b('0x15')]));});});};exports['ShowInterval']=function(_0x282a50){var _0x48a3d9=this;return new Promise(function(_0x1cecc0,_0x4c07fc){return db[_0xf61b('0x6')][_0xf61b('0x16')]({'raw':_0x282a50[_0xf61b('0x9')]?_0x282a50[_0xf61b('0x9')][_0xf61b('0x8')]===undefined?!![]:![]:!![],'where':_0x282a50[_0xf61b('0x9')]?_0x282a50['options'][_0xf61b('0xa')]||null:null,'attributes':_0x282a50[_0xf61b('0x9')]?_0x282a50[_0xf61b('0x9')]['attributes']||null:null,'include':_0x282a50['options']?_0x282a50['options'][_0xf61b('0xc')]?_[_0xf61b('0xd')](_0x282a50['options'][_0xf61b('0xc')],function(_0xd0c8a6){return{'model':db[_0xd0c8a6[_0xf61b('0xe')]],'as':_0xd0c8a6['as'],'attributes':_0xd0c8a6[_0xf61b('0xb')],'include':_0xd0c8a6[_0xf61b('0xc')]?_[_0xf61b('0xd')](_0xd0c8a6[_0xf61b('0xc')],function(_0x12a88d){return{'model':db[_0x12a88d[_0xf61b('0xe')]],'as':_0x12a88d['as'],'attributes':_0x12a88d[_0xf61b('0xb')],'include':_0x12a88d[_0xf61b('0xc')]?_[_0xf61b('0xd')](_0x12a88d[_0xf61b('0xc')],function(_0x1e3344){return{'model':db[_0x1e3344[_0xf61b('0xe')]],'as':_0x1e3344['as'],'attributes':_0x1e3344[_0xf61b('0xb')]};}):[]};}):[]};}):[]:[]})[_0xf61b('0xf')](function(_0x489430){logger[_0xf61b('0x10')]('ShowInterval',_0x282a50);logger['debug'](_0xf61b('0x17'),_0x282a50,JSON[_0xf61b('0x12')](_0x489430));_0x1cecc0(_0x489430);})[_0xf61b('0x13')](function(_0x3a2c5d){logger[_0xf61b('0x14')]('ShowInterval',_0x3a2c5d[_0xf61b('0x15')],_0x282a50);_0x4c07fc(_0x48a3d9['error'](0x1f4,_0x3a2c5d['message']));});});};function checkArrayOfIntervals(_0x214d3f,_0x4f8a31){var _0x28a837=[];return db[_0xf61b('0x6')]['findAll']({'where':{'id':_0x214d3f}})[_0xf61b('0xf')](function(_0x4af9e2){_0x28a837=_0x4af9e2;return Promise[_0xf61b('0x18')](_0x28a837[_0xf61b('0xd')](function(_0x2b7245){return _0x2b7245[_0xf61b('0x19')](_0x4f8a31);}));})['then'](function(_0x28071f){var _0xb8a972=_0x28071f[_0xf61b('0x1a')](function(_0x3125bf,_0x4673a7){return _0x3125bf||_0x4673a7;},![]);logger['info'](util[_0xf61b('0x1b')]('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0x28a837[_0xf61b('0xd')](function(_0x148fda){return _0x148fda['name'];})['join'](',\x20'),_0x28a837[_0xf61b('0xd')](function(_0x503c71){return _0x503c71['id'];})['join'](',\x20')));return _0xb8a972;});}function checkSingleInterval(_0x4a2782,_0x495792){return db[_0xf61b('0x6')][_0xf61b('0x1c')](_0x4a2782)[_0xf61b('0xf')](function(_0x34015){if(_0x34015){logger[_0xf61b('0x10')](util['format'](_0xf61b('0x1d'),_0x34015['name'],_0x34015['id']));return _0x34015['ifTime'](_0x495792);}});}exports[_0xf61b('0x1e')]=function(_0xe9f926){var _0x1798f3=_0xe9f926[_0xf61b('0x1f')];var _0x3cf4c8=Array[_0xf61b('0x20')](_0xe9f926['intervals'])?_0xe9f926[_0xf61b('0x21')]:typeof _0xe9f926[_0xf61b('0x21')]==='string'?[_0xe9f926[_0xf61b('0x21')]]:[];var _0x5d427e=_0xe9f926[_0xf61b('0x22')]||undefined;var _0x30890f=![];if(_0x3cf4c8[_0xf61b('0x23')]){logger[_0xf61b('0x10')](util[_0xf61b('0x1b')](_0xf61b('0x24'),_0x3cf4c8[_0xf61b('0x25')](';\x20')));}if(_0x5d427e){logger[_0xf61b('0x10')](util['format'](_0xf61b('0x26'),_0x5d427e));}logger[_0xf61b('0x11')](_0xf61b('0x27'),_0x30890f);logger[_0xf61b('0x28')](_0xf61b('0x1e'),_0xe9f926);return Promise[_0xf61b('0x29')]()[_0xf61b('0xf')](function(){if(Array[_0xf61b('0x20')](_0x1798f3)){return checkArrayOfIntervals(_0x1798f3,_0x5d427e);}else if(_0x1798f3){return checkSingleInterval(_0x1798f3,_0x5d427e);}})['then'](function(_0x397745){var _0x51f848=_0x3cf4c8[_0xf61b('0x1a')](function(_0xee8fc6,_0x3eb2eb){return _0xee8fc6||iftime(_0x3eb2eb,_0x5d427e);},![]);_0x30890f=_0x397745||_0x51f848;return _0x30890f;})[_0xf61b('0x13')](function(_0x1853d9){logger['error'](_0xf61b('0x1e'),_0xe9f926,_0x1853d9);throw this[_0xf61b('0x14')](0x1f4,_0x1853d9[_0xf61b('0x15')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 00dc3e6..051125f 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 _0xb10b=['./jira.controller','post','send','exports','express','../../components/auth/service'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xb10b,0x12a));var _0xbb10=function(_0xaf2427,_0x504859){_0xaf2427=_0xaf2427-0x0;var _0x67addb=_0xb10b[_0xaf2427];return _0x67addb;};'use strict';var express=require(_0xbb10('0x0'));var router=express['Router']();var auth=require(_0xbb10('0x1'));var controller=require(_0xbb10('0x2'));router[_0xbb10('0x3')]('/',auth['isAuthenticated'](),controller[_0xbb10('0x4')]);module[_0xbb10('0x5')]=router; \ No newline at end of file +var _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0x1265ed,_0x4b85e8){var _0x5ac459=function(_0xf0c114){while(--_0xf0c114){_0x1265ed['push'](_0x1265ed['shift']());}};_0x5ac459(++_0x4b85e8);}(_0x5f66,0x1a0));var _0x65f6=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x5f66[_0x164eca];return _0x2ce562;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);module[_0x65f6('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 867cfc7..b07e3b9 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 _0x576b=['remoteAddress','connection','socket','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','Report','description','stringify','issuetype','fields','customfield_11500','email','customfield_11501','oldToken','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','POST','application/json','Basic\x20','toString','base64','request','setEncoding','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','write','openIssue','send','body','headers','x-forwarded-for'];(function(_0x5a5c4b,_0x12499c){var _0xba8cc6=function(_0x5e8ea7){while(--_0x5e8ea7){_0x5a5c4b['push'](_0x5a5c4b['shift']());}};_0xba8cc6(++_0x12499c);}(_0x576b,0x1bc));var _0xb576=function(_0x778a21,_0x6e57b6){_0x778a21=_0x778a21-0x0;var _0x255654=_0x576b[_0x778a21];return _0x255654;};'use strict';var BPromise=require(_0xb576('0x0'));var https=require(_0xb576('0x1'));var logger=require(_0xb576('0x2'))(_0xb576('0x3'));var USERNAME=_0xb576('0x4');var PASSWORD=_0xb576('0x5');function openIssue(_0xb738f1,_0x4c5e9e){var _0x3a0792={'fields':{'project':{'key':_0xb738f1[_0xb576('0x6')]||_0xb576('0x7')},'summary':(_0xb738f1['summary']||_0xb576('0x8'))+'\x20from\x20'+_0xb738f1['ip'],'description':_0xb738f1[_0xb576('0x9')]||JSON[_0xb576('0xa')](_0xb738f1),'issuetype':{'name':_0xb738f1[_0xb576('0xb')]||'Bug'}}};_0x3a0792[_0xb576('0xc')][_0xb576('0xd')]=_0xb738f1[_0xb576('0xe')];_0x3a0792[_0xb576('0xc')][_0xb576('0xf')]=_0xb738f1[_0xb576('0x10')];_0x3a0792[_0xb576('0xc')]['customfield_11502']=_0xb738f1[_0xb576('0x11')];_0x3a0792[_0xb576('0xc')][_0xb576('0x12')]=_0xb738f1[_0xb576('0x13')];_0x3a0792[_0xb576('0xc')][_0xb576('0x14')]=_0xb738f1[_0xb576('0x15')];_0x3a0792['fields'][_0xb576('0x16')]=_0xb738f1['ip'];var _0x49370a={'host':_0xb576('0x17'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0xb576('0x18'),'timeout':0x4e20,'headers':{'Content-Type':_0xb576('0x19'),'Authorization':_0xb576('0x1a')+new Buffer(USERNAME+':'+PASSWORD)[_0xb576('0x1b')](_0xb576('0x1c'))}};var _0x59ade4=JSON[_0xb576('0xa')](_0x3a0792);var _0x14b052=https[_0xb576('0x1d')](_0x49370a,function(_0x1ea0ac){_0x1ea0ac[_0xb576('0x1e')]('utf8');var _0x275350='';_0x1ea0ac['on'](_0xb576('0x1f'),function(_0x4f9a48){_0x275350+=_0x4f9a48;});_0x1ea0ac['on'](_0xb576('0x20'),function(){if(_0x4c5e9e){return _0x4c5e9e[_0xb576('0x21')](_0x1ea0ac[_0xb576('0x22')])['json'](JSON[_0xb576('0x23')](_0x275350));}});});_0x14b052['on'](_0xb576('0x24'),function(_0x3582d0){if(_0x4c5e9e){return _0x4c5e9e[_0xb576('0x21')](0x1f4)[_0xb576('0x25')]({'errors':[{'message':_0xb576('0x26'),'type':_0xb576('0x27')}]});}});_0x14b052[_0xb576('0x28')](_0x59ade4);_0x14b052[_0xb576('0x20')]();}exports[_0xb576('0x29')]=openIssue;exports[_0xb576('0x2a')]=function(_0x1008fa,_0x5bb8e9){_0x1008fa[_0xb576('0x2b')]['ip']=_0x1008fa[_0xb576('0x2c')][_0xb576('0x2d')]||_0x1008fa['connection'][_0xb576('0x2e')]||_0x1008fa['socket'][_0xb576('0x2e')]||_0x1008fa[_0xb576('0x2f')][_0xb576('0x30')][_0xb576('0x2e')];return openIssue(_0x1008fa['body'],_0x5bb8e9);}; \ No newline at end of file +var _0xcd03=['x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','\x20from\x20','stringify','issuetype','fields','customfield_11500','email','customfield_11501','newToken','name','customfield_11504','reason','customfield_10102','/rest/api/2/issue','application/json','Basic\x20','toString','base64','request','setEncoding','data','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers'];(function(_0x4b0092,_0x3295a7){var _0x38163d=function(_0x51bc9f){while(--_0x51bc9f){_0x4b0092['push'](_0x4b0092['shift']());}};_0x38163d(++_0x3295a7);}(_0xcd03,0x1d0));var _0x3cd0=function(_0x3e5ea8,_0x5537b1){_0x3e5ea8=_0x3e5ea8-0x0;var _0x368fde=_0xcd03[_0x3e5ea8];return _0x368fde;};'use strict';var BPromise=require(_0x3cd0('0x0'));var https=require(_0x3cd0('0x1'));var logger=require(_0x3cd0('0x2'))(_0x3cd0('0x3'));var USERNAME=_0x3cd0('0x4');var PASSWORD=_0x3cd0('0x5');function openIssue(_0x90fa1b,_0x30b378){var _0x34f5f1={'fields':{'project':{'key':_0x90fa1b[_0x3cd0('0x6')]||_0x3cd0('0x7')},'summary':(_0x90fa1b[_0x3cd0('0x8')]||'Report')+_0x3cd0('0x9')+_0x90fa1b['ip'],'description':_0x90fa1b['description']||JSON[_0x3cd0('0xa')](_0x90fa1b),'issuetype':{'name':_0x90fa1b[_0x3cd0('0xb')]||'Bug'}}};_0x34f5f1[_0x3cd0('0xc')][_0x3cd0('0xd')]=_0x90fa1b[_0x3cd0('0xe')];_0x34f5f1['fields'][_0x3cd0('0xf')]=_0x90fa1b['oldToken'];_0x34f5f1[_0x3cd0('0xc')]['customfield_11502']=_0x90fa1b[_0x3cd0('0x10')];_0x34f5f1['fields']['customfield_11503']=_0x90fa1b[_0x3cd0('0x11')];_0x34f5f1[_0x3cd0('0xc')][_0x3cd0('0x12')]=_0x90fa1b[_0x3cd0('0x13')];_0x34f5f1[_0x3cd0('0xc')][_0x3cd0('0x14')]=_0x90fa1b['ip'];var _0x57c49c={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x3cd0('0x15'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x3cd0('0x16'),'Authorization':_0x3cd0('0x17')+new Buffer(USERNAME+':'+PASSWORD)[_0x3cd0('0x18')](_0x3cd0('0x19'))}};var _0x56e1d2=JSON[_0x3cd0('0xa')](_0x34f5f1);var _0x55cee9=https[_0x3cd0('0x1a')](_0x57c49c,function(_0x3094f9){_0x3094f9[_0x3cd0('0x1b')]('utf8');var _0x1bc8e3='';_0x3094f9['on'](_0x3cd0('0x1c'),function(_0x3c7227){_0x1bc8e3+=_0x3c7227;});_0x3094f9['on'](_0x3cd0('0x1d'),function(){if(_0x30b378){return _0x30b378[_0x3cd0('0x1e')](_0x3094f9[_0x3cd0('0x1f')])[_0x3cd0('0x20')](JSON[_0x3cd0('0x21')](_0x1bc8e3));}});});_0x55cee9['on'](_0x3cd0('0x22'),function(_0x4a9c99){if(_0x30b378){return _0x30b378[_0x3cd0('0x1e')](0x1f4)['json']({'errors':[{'message':_0x3cd0('0x23'),'type':_0x3cd0('0x24')}]});}});_0x55cee9[_0x3cd0('0x25')](_0x56e1d2);_0x55cee9['end']();}exports[_0x3cd0('0x26')]=openIssue;exports[_0x3cd0('0x27')]=function(_0xce1bce,_0x570995){_0xce1bce[_0x3cd0('0x28')]['ip']=_0xce1bce[_0x3cd0('0x29')][_0x3cd0('0x2a')]||_0xce1bce[_0x3cd0('0x2b')][_0x3cd0('0x2c')]||_0xce1bce[_0x3cd0('0x2d')]['remoteAddress']||_0xce1bce[_0x3cd0('0x2b')]['socket']['remoteAddress'];return openIssue(_0xce1bce[_0x3cd0('0x28')],_0x570995);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index c91f5cc..25d256a 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 _0x2750=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','/:id','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x2b4448,_0x5bcc69){var _0xb4b465=function(_0x5ac741){while(--_0x5ac741){_0x2b4448['push'](_0x2b4448['shift']());}};_0xb4b465(++_0x5bcc69);}(_0x2750,0x13b));var _0x0275=function(_0x4a27c4,_0x1e7e1b){_0x4a27c4=_0x4a27c4-0x0;var _0x3305cd=_0x2750[_0x4a27c4];return _0x3305cd;};'use strict';var multer=require(_0x0275('0x0'));var util=require('util');var path=require(_0x0275('0x1'));var timeout=require(_0x0275('0x2'));var express=require(_0x0275('0x3'));var router=express[_0x0275('0x4')]();var fs_extra=require(_0x0275('0x5'));var auth=require(_0x0275('0x6'));var interaction=require(_0x0275('0x7'));var config=require(_0x0275('0x8'));var controller=require(_0x0275('0x9'));router[_0x0275('0xa')]('/',auth['isAuthenticated'](),controller[_0x0275('0xb')]);router[_0x0275('0xa')](_0x0275('0xc'),auth[_0x0275('0xd')](),controller['describe']);router[_0x0275('0xa')](_0x0275('0xe'),auth[_0x0275('0xd')](),controller['show']);router['post']('/',auth[_0x0275('0xd')](),controller['create']);router[_0x0275('0xf')](_0x0275('0xe'),auth[_0x0275('0xd')](),controller[_0x0275('0x10')]);router[_0x0275('0x11')]('/:id',auth[_0x0275('0xd')](),controller[_0x0275('0x12')]);module[_0x0275('0x13')]=router; \ No newline at end of file +var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index'];(function(_0x1ae156,_0x3caa7d){var _0x2b12ec=function(_0x4b7883){while(--_0x4b7883){_0x1ae156['push'](_0x1ae156['shift']());}};_0x2b12ec(++_0x3caa7d);}(_0xe706,0xa3));var _0x6e70=function(_0x431c26,_0x4b8f47){_0x431c26=_0x431c26-0x0;var _0x3092fd=_0xe706[_0x431c26];return _0x3092fd;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 959c4ee..7a7886c 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x7a54,0x106));var _0x47a5=function(_0x5cd476,_0x3fe1c2){_0x5cd476=_0x5cd476-0x0;var _0x1953a2=_0x7a54[_0x5cd476];return _0x1953a2;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x7a54,0x106));var _0x47a5=function(_0x51bb7e,_0x5298d7){_0x51bb7e=_0x51bb7e-0x0;var _0x923f77=_0x7a54[_0x51bb7e];return _0x923f77;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index c36701e..aaa91de 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 _0x0689=['end','json','offset','undefined','count','limit','set','Content-Range','apply','then','destroy','error','name','send','index','map','JscriptyAnswerReport','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','intersection','length','find','create','body','update','describe','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','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x3c0206,_0x5a09d4){var _0x7b9e9d=function(_0x213c4f){while(--_0x213c4f){_0x3c0206['push'](_0x3c0206['shift']());}};_0x7b9e9d(++_0x5a09d4);}(_0x0689,0x161));var _0x9068=function(_0x4aca46,_0x2251a7){_0x4aca46=_0x4aca46-0x0;var _0x2e8cbb=_0x0689[_0x4aca46];return _0x2e8cbb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9068('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9068('0x1'));var rp=require(_0x9068('0x2'));var moment=require(_0x9068('0x3'));var BPromise=require(_0x9068('0x4'));var Mustache=require(_0x9068('0x5'));var util=require(_0x9068('0x6'));var path=require(_0x9068('0x7'));var sox=require(_0x9068('0x8'));var csv=require(_0x9068('0x9'));var ejs=require(_0x9068('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9068('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9068('0xc'));var deskjs=require(_0x9068('0xd'));var toCsv=require(_0x9068('0x9'));var querystring=require(_0x9068('0xe'));var Papa=require(_0x9068('0xf'));var Redis=require(_0x9068('0x10'));var authService=require(_0x9068('0x11'));var qs=require(_0x9068('0x12'));var as=require(_0x9068('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9068('0x14'))(_0x9068('0x15'));var utils=require(_0x9068('0x16'));var config=require(_0x9068('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9068('0x18'))['db'];function respondWithStatusCode(_0x1a89d4,_0x39eae8){_0x39eae8=_0x39eae8||0xcc;return function(_0x4ba797){if(_0x4ba797){return _0x1a89d4[_0x9068('0x19')](_0x39eae8);}return _0x1a89d4[_0x9068('0x1a')](_0x39eae8)[_0x9068('0x1b')]();};}function respondWithResult(_0x479675,_0x322640){_0x322640=_0x322640||0xc8;return function(_0x3ea030){if(_0x3ea030){return _0x479675['status'](_0x322640)[_0x9068('0x1c')](_0x3ea030);}};}function respondWithFilteredResult(_0x2952f8,_0x486714){return function(_0x1ad536){if(_0x1ad536){var _0x412dbf=typeof _0x486714[_0x9068('0x1d')]===_0x9068('0x1e')&&typeof _0x486714['limit']===_0x9068('0x1e');var _0x376f6d=_0x1ad536[_0x9068('0x1f')];var _0x36d591=_0x412dbf?0x0:_0x486714[_0x9068('0x1d')];var _0x1d09bf=_0x412dbf?_0x1ad536[_0x9068('0x1f')]:_0x486714[_0x9068('0x1d')]+_0x486714[_0x9068('0x20')];var _0x5844b6;if(_0x1d09bf>=_0x376f6d){_0x1d09bf=_0x376f6d;_0x5844b6=0xc8;}else{_0x5844b6=0xce;}_0x2952f8[_0x9068('0x1a')](_0x5844b6);return _0x2952f8[_0x9068('0x21')](_0x9068('0x22'),_0x36d591+'-'+_0x1d09bf+'/'+_0x376f6d)[_0x9068('0x1c')](_0x1ad536);}return null;};}function patchUpdates(_0xb6bf1e){return function(_0x427744){try{jsonpatch[_0x9068('0x23')](_0x427744,_0xb6bf1e,!![]);}catch(_0x1bc81b){return BPromise['reject'](_0x1bc81b);}return _0x427744['save']();};}function saveUpdates(_0x48a2de,_0x4537e7){return function(_0x5cab20){if(_0x5cab20){return _0x5cab20['update'](_0x48a2de)[_0x9068('0x24')](function(_0x290d94){return _0x290d94;});}return null;};}function removeEntity(_0x32231b,_0x3673b9){return function(_0x5d708a){if(_0x5d708a){return _0x5d708a[_0x9068('0x25')]()[_0x9068('0x24')](function(){_0x32231b[_0x9068('0x1a')](0xcc)[_0x9068('0x1b')]();});}};}function handleEntityNotFound(_0x12f17f,_0x28615e){return function(_0x4b93d9){if(!_0x4b93d9){_0x12f17f[_0x9068('0x19')](0x194);}return _0x4b93d9;};}function handleError(_0x3ee9aa,_0x4f48c3){_0x4f48c3=_0x4f48c3||0x1f4;return function(_0x12369a){logger[_0x9068('0x26')](_0x12369a['stack']);if(_0x12369a['name']){delete _0x12369a[_0x9068('0x27')];}_0x3ee9aa['status'](_0x4f48c3)[_0x9068('0x28')](_0x12369a);};}exports[_0x9068('0x29')]=function(_0x422e89,_0x1ceef5){var _0x2f14ab={},_0x4fd2e2={},_0x94b290={'count':0x0,'rows':[]};var _0x412b82=_[_0x9068('0x2a')](db[_0x9068('0x2b')]['rawAttributes'],function(_0x5a49b8){return{'name':_0x5a49b8[_0x9068('0x2c')],'type':_0x5a49b8[_0x9068('0x2d')][_0x9068('0x2e')]};});_0x4fd2e2[_0x9068('0x2f')]=_[_0x9068('0x2a')](_0x412b82,_0x9068('0x27'));_0x4fd2e2[_0x9068('0x30')]=_[_0x9068('0x31')](_0x422e89[_0x9068('0x30')]);_0x4fd2e2[_0x9068('0x32')]=_['intersection'](_0x4fd2e2[_0x9068('0x2f')],_0x4fd2e2[_0x9068('0x30')]);_0x2f14ab[_0x9068('0x33')]=_['intersection'](_0x4fd2e2[_0x9068('0x2f')],qs[_0x9068('0x34')](_0x422e89[_0x9068('0x30')][_0x9068('0x34')]));_0x2f14ab['attributes']=_0x2f14ab[_0x9068('0x33')]['length']?_0x2f14ab[_0x9068('0x33')]:_0x4fd2e2['model'];if(!_0x422e89[_0x9068('0x30')][_0x9068('0x35')](_0x9068('0x36'))){_0x2f14ab[_0x9068('0x20')]=qs[_0x9068('0x20')](_0x422e89['query'][_0x9068('0x20')]);_0x2f14ab[_0x9068('0x1d')]=qs[_0x9068('0x1d')](_0x422e89[_0x9068('0x30')][_0x9068('0x1d')]);}_0x2f14ab[_0x9068('0x37')]=qs[_0x9068('0x38')](_0x422e89[_0x9068('0x30')][_0x9068('0x38')]);_0x2f14ab['where']=qs[_0x9068('0x32')](_[_0x9068('0x39')](_0x422e89[_0x9068('0x30')],_0x4fd2e2[_0x9068('0x32')]),_0x412b82);if(_0x422e89['query']['filter']){_0x2f14ab[_0x9068('0x3a')]=_[_0x9068('0x3b')](_0x2f14ab[_0x9068('0x3a')],{'$or':_[_0x9068('0x2a')](_0x412b82,function(_0x108e98){if(_0x108e98[_0x9068('0x2d')]!==_0x9068('0x3c')){var _0x3e3dc0={};_0x3e3dc0[_0x108e98[_0x9068('0x27')]]={'$like':'%'+_0x422e89[_0x9068('0x30')][_0x9068('0x3d')]+'%'};return _0x3e3dc0;}})});}_0x2f14ab=_[_0x9068('0x3b')]({},_0x2f14ab,_0x422e89[_0x9068('0x3e')]);var _0x3749ff={'where':_0x2f14ab[_0x9068('0x3a')]};return db[_0x9068('0x2b')][_0x9068('0x1f')](_0x3749ff)[_0x9068('0x24')](function(_0x53201f){_0x94b290[_0x9068('0x1f')]=_0x53201f;if(_0x422e89[_0x9068('0x30')][_0x9068('0x3f')]){_0x2f14ab[_0x9068('0x40')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x9068('0x41')](_0x2f14ab);})['then'](function(_0x36bfb2){_0x94b290['rows']=_0x36bfb2;return _0x94b290;})[_0x9068('0x24')](respondWithFilteredResult(_0x1ceef5,_0x2f14ab))[_0x9068('0x42')](handleError(_0x1ceef5,null));};exports[_0x9068('0x43')]=function(_0x2a911a,_0x4a1efd){var _0x399dfd={'raw':!![],'where':{'id':_0x2a911a[_0x9068('0x44')]['id']}},_0x2e7480={};_0x2e7480[_0x9068('0x2f')]=_[_0x9068('0x31')](db[_0x9068('0x2b')]['rawAttributes']);_0x2e7480['query']=_[_0x9068('0x31')](_0x2a911a[_0x9068('0x30')]);_0x2e7480[_0x9068('0x32')]=_[_0x9068('0x45')](_0x2e7480[_0x9068('0x2f')],_0x2e7480[_0x9068('0x30')]);_0x399dfd[_0x9068('0x33')]=_[_0x9068('0x45')](_0x2e7480[_0x9068('0x2f')],qs[_0x9068('0x34')](_0x2a911a['query'][_0x9068('0x34')]));_0x399dfd[_0x9068('0x33')]=_0x399dfd['attributes'][_0x9068('0x46')]?_0x399dfd['attributes']:_0x2e7480[_0x9068('0x2f')];if(_0x2a911a['query'][_0x9068('0x3f')]){_0x399dfd[_0x9068('0x40')]=[{'all':!![]}];}_0x399dfd=_['merge']({},_0x399dfd,_0x2a911a[_0x9068('0x3e')]);return db[_0x9068('0x2b')][_0x9068('0x47')](_0x399dfd)[_0x9068('0x24')](handleEntityNotFound(_0x4a1efd,null))['then'](respondWithResult(_0x4a1efd,null))[_0x9068('0x42')](handleError(_0x4a1efd,null));};exports[_0x9068('0x48')]=function(_0x5ace24,_0x18430f){return db[_0x9068('0x2b')][_0x9068('0x48')](_0x5ace24[_0x9068('0x49')],{})[_0x9068('0x24')](respondWithResult(_0x18430f,0xc9))[_0x9068('0x42')](handleError(_0x18430f,null));};exports[_0x9068('0x4a')]=function(_0x552933,_0x49513f){if(_0x552933['body']['id']){delete _0x552933['body']['id'];}return db['JscriptyAnswerReport'][_0x9068('0x47')]({'where':{'id':_0x552933[_0x9068('0x44')]['id']}})[_0x9068('0x24')](handleEntityNotFound(_0x49513f,null))[_0x9068('0x24')](saveUpdates(_0x552933[_0x9068('0x49')],null))[_0x9068('0x24')](respondWithResult(_0x49513f,null))['catch'](handleError(_0x49513f,null));};exports[_0x9068('0x25')]=function(_0x4cea5d,_0x146964){return db[_0x9068('0x2b')]['find']({'where':{'id':_0x4cea5d[_0x9068('0x44')]['id']}})[_0x9068('0x24')](handleEntityNotFound(_0x146964,null))[_0x9068('0x24')](removeEntity(_0x146964,null))[_0x9068('0x42')](handleError(_0x146964,null));};exports[_0x9068('0x4b')]=function(_0x2a6deb,_0x228f22){return db[_0x9068('0x2b')][_0x9068('0x4b')]()[_0x9068('0x24')](respondWithResult(_0x228f22,null))[_0x9068('0x42')](handleError(_0x228f22,null));}; \ No newline at end of file +var _0x2f2e=['destroy','error','name','send','index','map','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','includeAll','include','JscriptyAnswerReport','rows','catch','show','params','intersection','find','create','update','body','describe','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x2f2e,0x146));var _0xe2f2=function(_0x43d701,_0x4bb2e9){_0x43d701=_0x43d701-0x0;var _0x2ec4c6=_0x2f2e[_0x43d701];return _0x2ec4c6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe2f2('0x0'));var zipdir=require(_0xe2f2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe2f2('0x2'));var moment=require('moment');var BPromise=require(_0xe2f2('0x3'));var Mustache=require(_0xe2f2('0x4'));var util=require(_0xe2f2('0x5'));var path=require(_0xe2f2('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe2f2('0x7'));var _=require(_0xe2f2('0x8'));var squel=require(_0xe2f2('0x9'));var crypto=require(_0xe2f2('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe2f2('0xb'));var Papa=require('papaparse');var Redis=require(_0xe2f2('0xc'));var authService=require(_0xe2f2('0xd'));var qs=require(_0xe2f2('0xe'));var as=require(_0xe2f2('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe2f2('0x10'))(_0xe2f2('0x11'));var utils=require('../../config/utils');var config=require(_0xe2f2('0x12'));var licenseUtil=require(_0xe2f2('0x13'));var db=require(_0xe2f2('0x14'))['db'];function respondWithStatusCode(_0xec8ce1,_0x46a87e){_0x46a87e=_0x46a87e||0xcc;return function(_0x45c78b){if(_0x45c78b){return _0xec8ce1[_0xe2f2('0x15')](_0x46a87e);}return _0xec8ce1[_0xe2f2('0x16')](_0x46a87e)[_0xe2f2('0x17')]();};}function respondWithResult(_0x3392db,_0x5eb9ef){_0x5eb9ef=_0x5eb9ef||0xc8;return function(_0x3bfa74){if(_0x3bfa74){return _0x3392db[_0xe2f2('0x16')](_0x5eb9ef)[_0xe2f2('0x18')](_0x3bfa74);}};}function respondWithFilteredResult(_0x45cd29,_0x43e4e5){return function(_0x51f710){if(_0x51f710){var _0x5b7f1a=typeof _0x43e4e5[_0xe2f2('0x19')]===_0xe2f2('0x1a')&&typeof _0x43e4e5[_0xe2f2('0x1b')]==='undefined';var _0x86c42b=_0x51f710[_0xe2f2('0x1c')];var _0x22433f=_0x5b7f1a?0x0:_0x43e4e5['offset'];var _0x1cf5ac=_0x5b7f1a?_0x51f710[_0xe2f2('0x1c')]:_0x43e4e5[_0xe2f2('0x19')]+_0x43e4e5[_0xe2f2('0x1b')];var _0xf6ca03;if(_0x1cf5ac>=_0x86c42b){_0x1cf5ac=_0x86c42b;_0xf6ca03=0xc8;}else{_0xf6ca03=0xce;}_0x45cd29[_0xe2f2('0x16')](_0xf6ca03);return _0x45cd29['set'](_0xe2f2('0x1d'),_0x22433f+'-'+_0x1cf5ac+'/'+_0x86c42b)[_0xe2f2('0x18')](_0x51f710);}return null;};}function patchUpdates(_0x34a57c){return function(_0x596dd9){try{jsonpatch[_0xe2f2('0x1e')](_0x596dd9,_0x34a57c,!![]);}catch(_0x2670f6){return BPromise[_0xe2f2('0x1f')](_0x2670f6);}return _0x596dd9[_0xe2f2('0x20')]();};}function saveUpdates(_0x4481b2,_0x3fac5d){return function(_0x1e9829){if(_0x1e9829){return _0x1e9829['update'](_0x4481b2)[_0xe2f2('0x21')](function(_0x3be5af){return _0x3be5af;});}return null;};}function removeEntity(_0x26011d,_0x38c524){return function(_0x124ff2){if(_0x124ff2){return _0x124ff2[_0xe2f2('0x22')]()[_0xe2f2('0x21')](function(){_0x26011d[_0xe2f2('0x16')](0xcc)[_0xe2f2('0x17')]();});}};}function handleEntityNotFound(_0x47a9a8,_0x22e734){return function(_0x56ab92){if(!_0x56ab92){_0x47a9a8[_0xe2f2('0x15')](0x194);}return _0x56ab92;};}function handleError(_0x3df2da,_0x28e8c4){_0x28e8c4=_0x28e8c4||0x1f4;return function(_0x5595b2){logger[_0xe2f2('0x23')](_0x5595b2['stack']);if(_0x5595b2[_0xe2f2('0x24')]){delete _0x5595b2['name'];}_0x3df2da[_0xe2f2('0x16')](_0x28e8c4)[_0xe2f2('0x25')](_0x5595b2);};}exports[_0xe2f2('0x26')]=function(_0x45e3f8,_0x33df93){var _0x377e50={},_0x542e69={},_0xc9e784={'count':0x0,'rows':[]};var _0x18c995=_[_0xe2f2('0x27')](db['JscriptyAnswerReport']['rawAttributes'],function(_0xbccb73){return{'name':_0xbccb73[_0xe2f2('0x28')],'type':_0xbccb73[_0xe2f2('0x29')][_0xe2f2('0x2a')]};});_0x542e69['model']=_[_0xe2f2('0x27')](_0x18c995,'name');_0x542e69[_0xe2f2('0x2b')]=_[_0xe2f2('0x2c')](_0x45e3f8[_0xe2f2('0x2b')]);_0x542e69[_0xe2f2('0x2d')]=_['intersection'](_0x542e69[_0xe2f2('0x2e')],_0x542e69[_0xe2f2('0x2b')]);_0x377e50[_0xe2f2('0x2f')]=_['intersection'](_0x542e69['model'],qs['fields'](_0x45e3f8[_0xe2f2('0x2b')][_0xe2f2('0x30')]));_0x377e50[_0xe2f2('0x2f')]=_0x377e50[_0xe2f2('0x2f')][_0xe2f2('0x31')]?_0x377e50['attributes']:_0x542e69[_0xe2f2('0x2e')];if(!_0x45e3f8['query'][_0xe2f2('0x32')](_0xe2f2('0x33'))){_0x377e50['limit']=qs[_0xe2f2('0x1b')](_0x45e3f8[_0xe2f2('0x2b')][_0xe2f2('0x1b')]);_0x377e50[_0xe2f2('0x19')]=qs[_0xe2f2('0x19')](_0x45e3f8[_0xe2f2('0x2b')][_0xe2f2('0x19')]);}_0x377e50[_0xe2f2('0x34')]=qs['sort'](_0x45e3f8['query'][_0xe2f2('0x35')]);_0x377e50['where']=qs[_0xe2f2('0x2d')](_[_0xe2f2('0x36')](_0x45e3f8[_0xe2f2('0x2b')],_0x542e69['filters']),_0x18c995);if(_0x45e3f8[_0xe2f2('0x2b')]['filter']){_0x377e50[_0xe2f2('0x37')]=_[_0xe2f2('0x38')](_0x377e50[_0xe2f2('0x37')],{'$or':_[_0xe2f2('0x27')](_0x18c995,function(_0xd45b){if(_0xd45b[_0xe2f2('0x29')]!=='VIRTUAL'){var _0x2d2990={};_0x2d2990[_0xd45b[_0xe2f2('0x24')]]={'$like':'%'+_0x45e3f8[_0xe2f2('0x2b')][_0xe2f2('0x39')]+'%'};return _0x2d2990;}})});}_0x377e50=_[_0xe2f2('0x38')]({},_0x377e50,_0x45e3f8[_0xe2f2('0x3a')]);var _0x3b3e42={'where':_0x377e50[_0xe2f2('0x37')]};return db['JscriptyAnswerReport']['count'](_0x3b3e42)[_0xe2f2('0x21')](function(_0x4e3586){_0xc9e784[_0xe2f2('0x1c')]=_0x4e3586;if(_0x45e3f8['query'][_0xe2f2('0x3b')]){_0x377e50[_0xe2f2('0x3c')]=[{'all':!![]}];}return db[_0xe2f2('0x3d')]['findAll'](_0x377e50);})[_0xe2f2('0x21')](function(_0x2d305d){_0xc9e784[_0xe2f2('0x3e')]=_0x2d305d;return _0xc9e784;})[_0xe2f2('0x21')](respondWithFilteredResult(_0x33df93,_0x377e50))[_0xe2f2('0x3f')](handleError(_0x33df93,null));};exports[_0xe2f2('0x40')]=function(_0x3b4da0,_0x36a312){var _0x5a0ab7={'raw':!![],'where':{'id':_0x3b4da0[_0xe2f2('0x41')]['id']}},_0x1ccd03={};_0x1ccd03['model']=_[_0xe2f2('0x2c')](db['JscriptyAnswerReport']['rawAttributes']);_0x1ccd03[_0xe2f2('0x2b')]=_[_0xe2f2('0x2c')](_0x3b4da0['query']);_0x1ccd03[_0xe2f2('0x2d')]=_[_0xe2f2('0x42')](_0x1ccd03[_0xe2f2('0x2e')],_0x1ccd03[_0xe2f2('0x2b')]);_0x5a0ab7['attributes']=_[_0xe2f2('0x42')](_0x1ccd03[_0xe2f2('0x2e')],qs[_0xe2f2('0x30')](_0x3b4da0[_0xe2f2('0x2b')][_0xe2f2('0x30')]));_0x5a0ab7['attributes']=_0x5a0ab7['attributes'][_0xe2f2('0x31')]?_0x5a0ab7[_0xe2f2('0x2f')]:_0x1ccd03[_0xe2f2('0x2e')];if(_0x3b4da0[_0xe2f2('0x2b')][_0xe2f2('0x3b')]){_0x5a0ab7[_0xe2f2('0x3c')]=[{'all':!![]}];}_0x5a0ab7=_[_0xe2f2('0x38')]({},_0x5a0ab7,_0x3b4da0[_0xe2f2('0x3a')]);return db[_0xe2f2('0x3d')][_0xe2f2('0x43')](_0x5a0ab7)[_0xe2f2('0x21')](handleEntityNotFound(_0x36a312,null))['then'](respondWithResult(_0x36a312,null))[_0xe2f2('0x3f')](handleError(_0x36a312,null));};exports[_0xe2f2('0x44')]=function(_0x1e6b67,_0x4e6735){return db[_0xe2f2('0x3d')]['create'](_0x1e6b67['body'],{})['then'](respondWithResult(_0x4e6735,0xc9))[_0xe2f2('0x3f')](handleError(_0x4e6735,null));};exports[_0xe2f2('0x45')]=function(_0x6c0195,_0x34a7fa){if(_0x6c0195[_0xe2f2('0x46')]['id']){delete _0x6c0195[_0xe2f2('0x46')]['id'];}return db[_0xe2f2('0x3d')][_0xe2f2('0x43')]({'where':{'id':_0x6c0195[_0xe2f2('0x41')]['id']}})[_0xe2f2('0x21')](handleEntityNotFound(_0x34a7fa,null))[_0xe2f2('0x21')](saveUpdates(_0x6c0195[_0xe2f2('0x46')],null))[_0xe2f2('0x21')](respondWithResult(_0x34a7fa,null))[_0xe2f2('0x3f')](handleError(_0x34a7fa,null));};exports['destroy']=function(_0xa9f888,_0x383230){return db[_0xe2f2('0x3d')][_0xe2f2('0x43')]({'where':{'id':_0xa9f888[_0xe2f2('0x41')]['id']}})[_0xe2f2('0x21')](handleEntityNotFound(_0x383230,null))['then'](removeEntity(_0x383230,null))[_0xe2f2('0x3f')](handleError(_0x383230,null));};exports[_0xe2f2('0x47')]=function(_0x18f806,_0x25676f){return db['JscriptyAnswerReport'][_0xe2f2('0x47')]()[_0xe2f2('0x21')](respondWithResult(_0x25676f,null))[_0xe2f2('0x3f')](handleError(_0x25676f,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 264e6e1..85cd53d 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 _0xa9a2=['report_jscripty_answers','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','define','JscriptyAnswerReport'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xa9a2,0xd9));var _0x2a9a=function(_0x4f7bb0,_0x3dd03a){_0x4f7bb0=_0x4f7bb0-0x0;var _0x2ef9d2=_0xa9a2[_0x4f7bb0];return _0x2ef9d2;};'use strict';var _=require(_0x2a9a('0x0'));var util=require('util');var logger=require(_0x2a9a('0x1'))(_0x2a9a('0x2'));var moment=require('moment');var BPromise=require(_0x2a9a('0x3'));var rp=require(_0x2a9a('0x4'));var fs=require('fs');var path=require(_0x2a9a('0x5'));var rimraf=require(_0x2a9a('0x6'));var config=require(_0x2a9a('0x7'));var attributes=require(_0x2a9a('0x8'));module['exports']=function(_0x197708,_0x29867c){return _0x197708[_0x2a9a('0x9')](_0x2a9a('0xa'),attributes,{'tableName':_0x2a9a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeba2=['bluebird','request-promise','path','./jscriptyAnswerReport.attributes','define','report_jscripty_answers','lodash','util','api','moment'];(function(_0x50b559,_0x6437cd){var _0x4b7ecc=function(_0x711d95){while(--_0x711d95){_0x50b559['push'](_0x50b559['shift']());}};_0x4b7ecc(++_0x6437cd);}(_0xeba2,0xba));var _0x2eba=function(_0x48e86c,_0x9f034d){_0x48e86c=_0x48e86c-0x0;var _0x54fa11=_0xeba2[_0x48e86c];return _0x54fa11;};'use strict';var _=require(_0x2eba('0x0'));var util=require(_0x2eba('0x1'));var logger=require('../../config/logger')(_0x2eba('0x2'));var moment=require(_0x2eba('0x3'));var BPromise=require(_0x2eba('0x4'));var rp=require(_0x2eba('0x5'));var fs=require('fs');var path=require(_0x2eba('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2eba('0x7'));module['exports']=function(_0x162220,_0x3e235f){return _0x162220[_0x2eba('0x8')]('JscriptyAnswerReport',attributes,{'tableName':_0x2eba('0x9'),'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 1b890c7..e9f972f 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 _0xa43b=['request','then','info','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise'];(function(_0x1cf849,_0x448d29){var _0x52df85=function(_0x3cf35b){while(--_0x3cf35b){_0x1cf849['push'](_0x1cf849['shift']());}};_0x52df85(++_0x448d29);}(_0xa43b,0x174));var _0xba43=function(_0x1c8967,_0x5308b4){_0x1c8967=_0x1c8967-0x0;var _0x27b77e=_0xa43b[_0x1c8967];return _0x27b77e;};'use strict';var _=require(_0xba43('0x0'));var util=require(_0xba43('0x1'));var moment=require(_0xba43('0x2'));var BPromise=require(_0xba43('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba43('0x4'));var db=require(_0xba43('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xba43('0x6'));var config=require('../../config/environment');var jayson=require(_0xba43('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x453d99,_0xcd2071,_0x1fc8bf){return new BPromise(function(_0x1c8e79,_0x343109){return client[_0xba43('0x8')](_0x453d99,_0x1fc8bf)[_0xba43('0x9')](function(_0x561489){logger[_0xba43('0xa')]('JscriptyAnswerReport,\x20%s,\x20%s',_0xcd2071,_0xba43('0xb'));logger[_0xba43('0xc')](_0xba43('0xd'),_0xcd2071,_0xba43('0xb'),JSON[_0xba43('0xe')](_0x561489));if(_0x561489[_0xba43('0xf')]){if(_0x561489[_0xba43('0xf')][_0xba43('0x10')]===0x1f4){logger[_0xba43('0xf')](_0xba43('0x11'),_0xcd2071,_0x561489[_0xba43('0xf')][_0xba43('0x12')]);return _0x343109(_0x561489[_0xba43('0xf')][_0xba43('0x12')]);}logger[_0xba43('0xf')](_0xba43('0x11'),_0xcd2071,_0x561489[_0xba43('0xf')][_0xba43('0x12')]);return _0x1c8e79(_0x561489[_0xba43('0xf')]['message']);}else{logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0xcd2071,_0xba43('0xb'));_0x1c8e79(_0x561489['result'][_0xba43('0x12')]);}})[_0xba43('0x13')](function(_0x39b448){logger[_0xba43('0xf')](_0xba43('0x11'),_0xcd2071,_0x39b448);_0x343109(_0x39b448);});});} \ No newline at end of file +var _0x4b72=['lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','error','message','result'];(function(_0x347e6c,_0x3b1346){var _0x768979=function(_0x24cf49){while(--_0x24cf49){_0x347e6c['push'](_0x347e6c['shift']());}};_0x768979(++_0x3b1346);}(_0x4b72,0x1f4));var _0x24b7=function(_0x33959d,_0xead54e){_0x33959d=_0x33959d-0x0;var _0x245703=_0x4b72[_0x33959d];return _0x245703;};'use strict';var _=require(_0x24b7('0x0'));var util=require('util');var moment=require(_0x24b7('0x1'));var BPromise=require(_0x24b7('0x2'));var rs=require(_0x24b7('0x3'));var fs=require('fs');var Redis=require(_0x24b7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x24b7('0x5'));var logger=require(_0x24b7('0x6'))(_0x24b7('0x7'));var config=require(_0x24b7('0x8'));var jayson=require(_0x24b7('0x9'));var client=jayson['client'][_0x24b7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x314f61,_0xf3ff45,_0xee4c27){return new BPromise(function(_0x5e40df,_0x563605){return client[_0x24b7('0xb')](_0x314f61,_0xee4c27)[_0x24b7('0xc')](function(_0x5f2056){logger[_0x24b7('0xd')](_0x24b7('0xe'),_0xf3ff45,_0x24b7('0xf'));logger[_0x24b7('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0xf3ff45,'request\x20sent',JSON['stringify'](_0x5f2056));if(_0x5f2056[_0x24b7('0x11')]){if(_0x5f2056['error']['code']===0x1f4){logger[_0x24b7('0x11')](_0x24b7('0xe'),_0xf3ff45,_0x5f2056['error'][_0x24b7('0x12')]);return _0x563605(_0x5f2056[_0x24b7('0x11')][_0x24b7('0x12')]);}logger[_0x24b7('0x11')](_0x24b7('0xe'),_0xf3ff45,_0x5f2056['error'][_0x24b7('0x12')]);return _0x5e40df(_0x5f2056[_0x24b7('0x11')][_0x24b7('0x12')]);}else{logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0xf3ff45,_0x24b7('0xf'));_0x5e40df(_0x5f2056[_0x24b7('0x13')][_0x24b7('0x12')]);}})['catch'](function(_0x4f467){logger[_0x24b7('0x11')](_0x24b7('0xe'),_0xf3ff45,_0x4f467);_0x563605(_0x4f467);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 06ea23e..d250772 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 _0xceea=['show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','/:id'];(function(_0x3d9b73,_0x332c82){var _0x1684b0=function(_0x5ab46e){while(--_0x5ab46e){_0x3d9b73['push'](_0x3d9b73['shift']());}};_0x1684b0(++_0x332c82);}(_0xceea,0x1d0));var _0xacee=function(_0x25f9ca,_0x2f0d08){_0x25f9ca=_0x25f9ca-0x0;var _0x498db6=_0xceea[_0x25f9ca];return _0x498db6;};'use strict';var multer=require(_0xacee('0x0'));var util=require(_0xacee('0x1'));var path=require('path');var timeout=require(_0xacee('0x2'));var express=require(_0xacee('0x3'));var router=express['Router']();var fs_extra=require(_0xacee('0x4'));var auth=require(_0xacee('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xacee('0x6'));var controller=require(_0xacee('0x7'));router[_0xacee('0x8')]('/',auth[_0xacee('0x9')](),controller['index']);router[_0xacee('0x8')](_0xacee('0xa'),auth[_0xacee('0x9')](),controller[_0xacee('0xb')]);router[_0xacee('0x8')](_0xacee('0xc'),auth[_0xacee('0x9')](),controller[_0xacee('0xd')]);router[_0xacee('0x8')](_0xacee('0xe'),auth[_0xacee('0x9')](),controller[_0xacee('0xf')]);router[_0xacee('0x8')](_0xacee('0x10'),auth[_0xacee('0x9')](),timeout(_0xacee('0x11')),controller[_0xacee('0x12')]);router[_0xacee('0x13')]('/',auth[_0xacee('0x9')](),controller[_0xacee('0x14')]);router[_0xacee('0x13')](_0xacee('0x15'),auth[_0xacee('0x9')](),controller['clone']);router['put'](_0xacee('0xa'),auth[_0xacee('0x9')](),controller['update']);router[_0xacee('0x16')](_0xacee('0xa'),auth[_0xacee('0x9')](),controller[_0xacee('0x17')]);module[_0xacee('0x18')]=router; \ No newline at end of file +var _0x53bc=['/:id/answers','/:id/summary','post','create','/:id/clone','clone','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','/:id','show','/:id/sessions'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x53bc,0x192));var _0xc53b=function(_0x607211,_0x171797){_0x607211=_0x607211-0x0;var _0x2f0e75=_0x53bc[_0x607211];return _0x2f0e75;};'use strict';var multer=require('multer');var util=require(_0xc53b('0x0'));var path=require(_0xc53b('0x1'));var timeout=require(_0xc53b('0x2'));var express=require(_0xc53b('0x3'));var router=express[_0xc53b('0x4')]();var fs_extra=require(_0xc53b('0x5'));var auth=require(_0xc53b('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./jscriptyProject.controller');router[_0xc53b('0x7')]('/',auth[_0xc53b('0x8')](),controller['index']);router[_0xc53b('0x7')](_0xc53b('0x9'),auth[_0xc53b('0x8')](),controller[_0xc53b('0xa')]);router[_0xc53b('0x7')](_0xc53b('0xb'),auth[_0xc53b('0x8')](),controller['getSessions']);router[_0xc53b('0x7')](_0xc53b('0xc'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xc53b('0x7')](_0xc53b('0xd'),auth[_0xc53b('0x8')](),timeout('30s'),controller['getSummary']);router[_0xc53b('0xe')]('/',auth['isAuthenticated'](),controller[_0xc53b('0xf')]);router[_0xc53b('0xe')](_0xc53b('0x10'),auth[_0xc53b('0x8')](),controller[_0xc53b('0x11')]);router[_0xc53b('0x12')]('/:id',auth[_0xc53b('0x8')](),controller[_0xc53b('0x13')]);router[_0xc53b('0x14')](_0xc53b('0x9'),auth['isAuthenticated'](),controller[_0xc53b('0x15')]);module[_0xc53b('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 8ed8091..6fcd708 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 _0x3d94=['{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','lodash','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','stringify','isString','formData'];(function(_0x321e08,_0x3460f9){var _0x341d04=function(_0x3d5c51){while(--_0x3d5c51){_0x321e08['push'](_0x321e08['shift']());}};_0x341d04(++_0x3460f9);}(_0x3d94,0x12f));var _0x43d9=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3d94[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x43d9('0x0'));var _=require(_0x43d9('0x1'));var util=require('util');module[_0x43d9('0x2')]={'name':{'type':Sequelize[_0x43d9('0x3')],'unique':_0x43d9('0x4')},'description':{'type':Sequelize[_0x43d9('0x3')]},'formData':{'type':Sequelize[_0x43d9('0x5')](_0x43d9('0x6')),'set':function(_0x5f4712){if(_[_0x43d9('0x7')](_0x5f4712)){this[_0x43d9('0x8')]('formData',JSON[_0x43d9('0x9')](_0x5f4712));}else if(_[_0x43d9('0xa')](_0x5f4712)){this['setDataValue']('formData',_0x5f4712);}else{this[_0x43d9('0x8')](_0x43d9('0xb'),util['format'](_0x43d9('0xc'),this['getDataValue'](_0x43d9('0x4'))||'',this[_0x43d9('0xd')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x43d9('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x1166=['isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING','name','long','isObjectLike','formData'];(function(_0x1ce06d,_0x3de2d8){var _0x2ea666=function(_0x4be6ec){while(--_0x4be6ec){_0x1ce06d['push'](_0x1ce06d['shift']());}};_0x2ea666(++_0x3de2d8);}(_0x1166,0xc9));var _0x6116=function(_0x40df50,_0x587474){_0x40df50=_0x40df50-0x0;var _0x23b555=_0x1166[_0x40df50];return _0x23b555;};'use strict';var Sequelize=require(_0x6116('0x0'));var _=require(_0x6116('0x1'));var util=require(_0x6116('0x2'));module[_0x6116('0x3')]={'name':{'type':Sequelize[_0x6116('0x4')],'unique':_0x6116('0x5')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0x6116('0x6')),'set':function(_0x54ceec){if(_[_0x6116('0x7')](_0x54ceec)){this['setDataValue'](_0x6116('0x8'),JSON['stringify'](_0x54ceec));}else if(_[_0x6116('0x9')](_0x54ceec)){this['setDataValue']('formData',_0x54ceec);}else{this['setDataValue'](_0x6116('0x8'),util[_0x6116('0xa')](_0x6116('0xb'),this[_0x6116('0xc')](_0x6116('0x5'))||'',this[_0x6116('0xc')](_0x6116('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x6116('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x6116('0xe')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 8e1e3fc..9e4e9b5 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 _0xa321=['createdAt','updatedAt','role','find','autoAssociation','error','update','getSessions','findOne','ProjectId','map','JscriptySessionReport','getAnswers','JscriptyAnswerReport','findAll','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','push','isEmpty','now','writeFileSync','setHeader','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','then','destroy','get','Projects','stack','name','send','index','rawAttributes','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','JscriptyProject','includeAll','include','rows','show','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','clone','omit'];(function(_0x30802a,_0x2276f9){var _0x32b9cc=function(_0x3ede5b){while(--_0x3ede5b){_0x30802a['push'](_0x30802a['shift']());}};_0x32b9cc(++_0x2276f9);}(_0xa321,0x9d));var _0x1a32=function(_0x61bb05,_0x47421f){_0x61bb05=_0x61bb05-0x0;var _0x3ceb3e=_0xa321[_0x61bb05];return _0x3ceb3e;};'use strict';var emlformat=require(_0x1a32('0x0'));var rimraf=require(_0x1a32('0x1'));var zipdir=require(_0x1a32('0x2'));var jsonpatch=require(_0x1a32('0x3'));var rp=require('request-promise');var moment=require(_0x1a32('0x4'));var BPromise=require(_0x1a32('0x5'));var Mustache=require('mustache');var util=require(_0x1a32('0x6'));var path=require(_0x1a32('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1a32('0x8'));var _=require('lodash');var squel=require(_0x1a32('0x9'));var crypto=require(_0x1a32('0xa'));var jsforce=require(_0x1a32('0xb'));var deskjs=require(_0x1a32('0xc'));var toCsv=require(_0x1a32('0xd'));var querystring=require('querystring');var Papa=require(_0x1a32('0xe'));var Redis=require(_0x1a32('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1a32('0x10'));var as=require(_0x1a32('0x11'));var hardwareService=require(_0x1a32('0x12'));var logger=require(_0x1a32('0x13'))(_0x1a32('0x14'));var utils=require(_0x1a32('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1a32('0x16'));var db=require(_0x1a32('0x17'))['db'];function respondWithStatusCode(_0x3b710d,_0x5ea58a){_0x5ea58a=_0x5ea58a||0xcc;return function(_0x42a275){if(_0x42a275){return _0x3b710d[_0x1a32('0x18')](_0x5ea58a);}return _0x3b710d[_0x1a32('0x19')](_0x5ea58a)[_0x1a32('0x1a')]();};}function respondWithResult(_0x171cad,_0x4bcf66){_0x4bcf66=_0x4bcf66||0xc8;return function(_0x4498c7){if(_0x4498c7){return _0x171cad[_0x1a32('0x19')](_0x4bcf66)[_0x1a32('0x1b')](_0x4498c7);}};}function respondWithFilteredResult(_0x268b0a,_0x3400ba){return function(_0x2a66b2){if(_0x2a66b2){var _0x5c272a=typeof _0x3400ba[_0x1a32('0x1c')]===_0x1a32('0x1d')&&typeof _0x3400ba['limit']===_0x1a32('0x1d');var _0x1a68ef=_0x2a66b2[_0x1a32('0x1e')];var _0x3b2983=_0x5c272a?0x0:_0x3400ba[_0x1a32('0x1c')];var _0x303afb=_0x5c272a?_0x2a66b2[_0x1a32('0x1e')]:_0x3400ba[_0x1a32('0x1c')]+_0x3400ba[_0x1a32('0x1f')];var _0x17fcea;if(_0x303afb>=_0x1a68ef){_0x303afb=_0x1a68ef;_0x17fcea=0xc8;}else{_0x17fcea=0xce;}_0x268b0a[_0x1a32('0x19')](_0x17fcea);return _0x268b0a['set'](_0x1a32('0x20'),_0x3b2983+'-'+_0x303afb+'/'+_0x1a68ef)[_0x1a32('0x1b')](_0x2a66b2);}return null;};}function patchUpdates(_0x235fd0){return function(_0x5a12d5){try{jsonpatch[_0x1a32('0x21')](_0x5a12d5,_0x235fd0,!![]);}catch(_0xa7c5c1){return BPromise['reject'](_0xa7c5c1);}return _0x5a12d5[_0x1a32('0x22')]();};}function saveUpdates(_0x55c6a0,_0x125504){return function(_0x3f1409){if(_0x3f1409){return _0x3f1409['update'](_0x55c6a0)[_0x1a32('0x23')](function(_0x33fc4f){return _0x33fc4f;});}return null;};}function removeEntity(_0x2c93b0,_0x5e9a5e){return function(_0x2d6637){if(_0x2d6637){return _0x2d6637[_0x1a32('0x24')]()['then'](function(){var _0x372b95=_0x2d6637[_0x1a32('0x25')]({'plain':!![]});var _0x533700=_0x1a32('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x533700,'resourceId':_0x372b95['id']}})['then'](function(){return _0x2d6637;});})['then'](function(){_0x2c93b0['status'](0xcc)[_0x1a32('0x1a')]();});}};}function handleEntityNotFound(_0x2309b3,_0x4771b7){return function(_0x2094fa){if(!_0x2094fa){_0x2309b3[_0x1a32('0x18')](0x194);}return _0x2094fa;};}function handleError(_0x35af58,_0x19e0e6){_0x19e0e6=_0x19e0e6||0x1f4;return function(_0x2edc3e){logger['error'](_0x2edc3e[_0x1a32('0x27')]);if(_0x2edc3e[_0x1a32('0x28')]){delete _0x2edc3e[_0x1a32('0x28')];}_0x35af58[_0x1a32('0x19')](_0x19e0e6)[_0x1a32('0x29')](_0x2edc3e);};}exports[_0x1a32('0x2a')]=function(_0x821dbf,_0x1211e2){var _0x3bc28a={},_0x54b122={},_0x1af0dc={'count':0x0,'rows':[]};var _0x355d7f=_['map'](db['JscriptyProject'][_0x1a32('0x2b')],function(_0x582606){return{'name':_0x582606['fieldName'],'type':_0x582606[_0x1a32('0x2c')]['key']};});_0x54b122['model']=_['map'](_0x355d7f,'name');_0x54b122[_0x1a32('0x2d')]=_[_0x1a32('0x2e')](_0x821dbf[_0x1a32('0x2d')]);_0x54b122[_0x1a32('0x2f')]=_[_0x1a32('0x30')](_0x54b122['model'],_0x54b122['query']);_0x3bc28a[_0x1a32('0x31')]=_['intersection'](_0x54b122[_0x1a32('0x32')],qs[_0x1a32('0x33')](_0x821dbf[_0x1a32('0x2d')]['fields']));_0x3bc28a[_0x1a32('0x31')]=_0x3bc28a[_0x1a32('0x31')][_0x1a32('0x34')]?_0x3bc28a[_0x1a32('0x31')]:_0x54b122[_0x1a32('0x32')];if(!_0x821dbf[_0x1a32('0x2d')][_0x1a32('0x35')](_0x1a32('0x36'))){_0x3bc28a[_0x1a32('0x1f')]=qs['limit'](_0x821dbf[_0x1a32('0x2d')][_0x1a32('0x1f')]);_0x3bc28a[_0x1a32('0x1c')]=qs['offset'](_0x821dbf[_0x1a32('0x2d')][_0x1a32('0x1c')]);}_0x3bc28a[_0x1a32('0x37')]=qs[_0x1a32('0x38')](_0x821dbf[_0x1a32('0x2d')][_0x1a32('0x38')]);_0x3bc28a[_0x1a32('0x39')]=qs[_0x1a32('0x2f')](_[_0x1a32('0x3a')](_0x821dbf[_0x1a32('0x2d')],_0x54b122[_0x1a32('0x2f')]),_0x355d7f);if(_0x821dbf[_0x1a32('0x2d')][_0x1a32('0x3b')]){_0x3bc28a[_0x1a32('0x39')]=_[_0x1a32('0x3c')](_0x3bc28a['where'],{'$or':_['map'](_0x355d7f,function(_0x5daad5){if(_0x5daad5[_0x1a32('0x2c')]!==_0x1a32('0x3d')){var _0x1f1a98={};_0x1f1a98[_0x5daad5[_0x1a32('0x28')]]={'$like':'%'+_0x821dbf[_0x1a32('0x2d')]['filter']+'%'};return _0x1f1a98;}})});}_0x3bc28a=_[_0x1a32('0x3c')]({},_0x3bc28a,_0x821dbf[_0x1a32('0x3e')]);var _0x26e308={'where':_0x3bc28a[_0x1a32('0x39')]};return db[_0x1a32('0x3f')][_0x1a32('0x1e')](_0x26e308)['then'](function(_0x2e618e){_0x1af0dc[_0x1a32('0x1e')]=_0x2e618e;if(_0x821dbf[_0x1a32('0x2d')][_0x1a32('0x40')]){_0x3bc28a[_0x1a32('0x41')]=[{'all':!![]}];}return db['JscriptyProject']['findAll'](_0x3bc28a);})['then'](function(_0x5e58f7){_0x1af0dc[_0x1a32('0x42')]=_0x5e58f7;return _0x1af0dc;})[_0x1a32('0x23')](respondWithFilteredResult(_0x1211e2,_0x3bc28a))['catch'](handleError(_0x1211e2,null));};exports[_0x1a32('0x43')]=function(_0x4590ab,_0x3bf186){var _0x370022={'raw':![],'where':{'id':_0x4590ab[_0x1a32('0x44')]['id']}},_0x5bc5bf={};_0x5bc5bf[_0x1a32('0x32')]=_[_0x1a32('0x2e')](db[_0x1a32('0x3f')][_0x1a32('0x2b')]);_0x5bc5bf[_0x1a32('0x2d')]=_[_0x1a32('0x2e')](_0x4590ab[_0x1a32('0x2d')]);_0x5bc5bf['filters']=_[_0x1a32('0x30')](_0x5bc5bf['model'],_0x5bc5bf['query']);_0x370022[_0x1a32('0x31')]=_['intersection'](_0x5bc5bf[_0x1a32('0x32')],qs['fields'](_0x4590ab[_0x1a32('0x2d')][_0x1a32('0x33')]));_0x370022[_0x1a32('0x31')]=_0x370022[_0x1a32('0x31')][_0x1a32('0x34')]?_0x370022[_0x1a32('0x31')]:_0x5bc5bf[_0x1a32('0x32')];if(_0x4590ab[_0x1a32('0x2d')][_0x1a32('0x40')]){_0x370022['include']=[{'all':!![]}];}_0x370022=_[_0x1a32('0x3c')]({},_0x370022,_0x4590ab[_0x1a32('0x3e')]);return db[_0x1a32('0x3f')]['find'](_0x370022)[_0x1a32('0x23')](handleEntityNotFound(_0x3bf186,null))[_0x1a32('0x23')](respondWithResult(_0x3bf186,null))[_0x1a32('0x45')](handleError(_0x3bf186,null));};exports[_0x1a32('0x46')]=function(_0x18fbef,_0x4a902c){return db[_0x1a32('0x3f')][_0x1a32('0x46')](_0x18fbef[_0x1a32('0x47')],{})[_0x1a32('0x23')](function(_0x1c4566){var _0x24b75b=_0x18fbef[_0x1a32('0x48')][_0x1a32('0x25')]({'plain':!![]});if(!_0x24b75b)throw new Error(_0x1a32('0x49'));if(_0x24b75b['role']===_0x1a32('0x48')){var _0xc50291=_0x1c4566[_0x1a32('0x25')]({'plain':!![]});var _0x4a0042=_0x1a32('0x26');return db[_0x1a32('0x4a')]['find']({'where':{'name':_0x4a0042,'userProfileId':_0x24b75b[_0x1a32('0x4b')]},'raw':!![]})[_0x1a32('0x23')](function(_0x766417){if(_0x766417&&_0x766417['autoAssociation']===0x0){return db[_0x1a32('0x4c')][_0x1a32('0x46')]({'name':_0xc50291['name'],'resourceId':_0xc50291['id'],'type':_0x766417[_0x1a32('0x28')],'sectionId':_0x766417['id']},{})['then'](function(){return _0x1c4566;});}else{return _0x1c4566;}})['catch'](function(_0x196206){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x196206);throw _0x196206;});}return _0x1c4566;})[_0x1a32('0x23')](respondWithResult(_0x4a902c,0xc9))[_0x1a32('0x45')](handleError(_0x4a902c,null));};exports[_0x1a32('0x4d')]=function(_0x10244f,_0xbf023a){var _0x698ad2={'where':{'id':_0x10244f['params']['id']}},_0x133067={};_0x133067['model']=_[_0x1a32('0x2e')](db['JscriptyProject'][_0x1a32('0x2b')]);_0x698ad2[_0x1a32('0x31')]=_[_0x1a32('0x30')](_0x133067[_0x1a32('0x32')],qs[_0x1a32('0x33')](_0x10244f['query'][_0x1a32('0x33')]));_0x698ad2[_0x1a32('0x31')]=_0x698ad2[_0x1a32('0x31')]['length']?_0x698ad2['attributes']:_0x133067['model'];if(_0x10244f[_0x1a32('0x2d')][_0x1a32('0x40')]){_0x698ad2[_0x1a32('0x41')]=[{'all':!![]}];}_0x698ad2=_[_0x1a32('0x3c')]({},_0x698ad2,_0x10244f[_0x1a32('0x3e')]);return db[_0x1a32('0x3f')]['find'](_0x698ad2)['then'](handleEntityNotFound(_0xbf023a,null))[_0x1a32('0x23')](function(_0x41596f){if(_0x41596f){var _0x17be7e=_0x41596f[_0x1a32('0x25')]({'plain':!![]});_0x17be7e=qs[_0x1a32('0x4e')](_0x17be7e,['id',_0x1a32('0x4f'),_0x1a32('0x50')]);_0x10244f['body']=_[_0x1a32('0x4e')](_0x10244f[_0x1a32('0x47')],['id',_0x1a32('0x4f'),_0x1a32('0x50')]);return db['JscriptyProject'][_0x1a32('0x46')](_[_0x1a32('0x3c')](_0x17be7e,_0x10244f['body']),{'include':_0x10244f[_0x1a32('0x2d')][_0x1a32('0x40')]?[{'all':!![]}]:undefined})[_0x1a32('0x23')](function(_0x31da99){var _0x2bc60f=_0x10244f[_0x1a32('0x48')][_0x1a32('0x25')]({'plain':!![]});if(!_0x2bc60f)throw new Error(_0x1a32('0x49'));if(_0x2bc60f[_0x1a32('0x51')]===_0x1a32('0x48')){var _0x493194=_0x31da99[_0x1a32('0x25')]({'plain':!![]});var _0x3d0b2e='Projects';return db[_0x1a32('0x4a')][_0x1a32('0x52')]({'where':{'name':_0x3d0b2e,'userProfileId':_0x2bc60f['userProfileId']},'raw':!![]})['then'](function(_0x341a70){if(_0x341a70&&_0x341a70[_0x1a32('0x53')]===0x0){return db[_0x1a32('0x4c')][_0x1a32('0x46')]({'name':_0x493194[_0x1a32('0x28')],'resourceId':_0x493194['id'],'type':_0x341a70[_0x1a32('0x28')],'sectionId':_0x341a70['id']},{})[_0x1a32('0x23')](function(){return _0x31da99;});}else{return _0x31da99;}})['catch'](function(_0x306644){logger[_0x1a32('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x306644);throw _0x306644;});}return _0x31da99;});}})[_0x1a32('0x23')](respondWithResult(_0xbf023a,0xc9))[_0x1a32('0x45')](handleError(_0xbf023a,null));};exports[_0x1a32('0x55')]=function(_0x4679a1,_0xaf8e55){if(_0x4679a1[_0x1a32('0x47')]['id']){delete _0x4679a1[_0x1a32('0x47')]['id'];}return db[_0x1a32('0x3f')][_0x1a32('0x52')]({'where':{'id':_0x4679a1[_0x1a32('0x44')]['id']}})[_0x1a32('0x23')](handleEntityNotFound(_0xaf8e55,null))[_0x1a32('0x23')](saveUpdates(_0x4679a1['body'],null))['then'](respondWithResult(_0xaf8e55,null))[_0x1a32('0x45')](handleError(_0xaf8e55,null));};exports[_0x1a32('0x24')]=function(_0x267337,_0x4817ee){return db[_0x1a32('0x3f')]['find']({'where':{'id':_0x267337['params']['id']}})[_0x1a32('0x23')](handleEntityNotFound(_0x4817ee,null))[_0x1a32('0x23')](removeEntity(_0x4817ee,null))['catch'](handleError(_0x4817ee,null));};exports[_0x1a32('0x56')]=function(_0x40cb60,_0x3d32f1,_0x5d2de7){var _0x4bd526={'raw':!![],'where':{}};var _0x322f79={};var _0x22b66b={'count':0x0,'rows':[]};return db[_0x1a32('0x3f')][_0x1a32('0x57')]({'where':{'id':_0x40cb60[_0x1a32('0x44')]['id']}})['then'](handleEntityNotFound(_0x3d32f1,null))['then'](function(_0x241d6b){if(_0x241d6b){_0x322f79[_0x1a32('0x32')]=_[_0x1a32('0x2e')](db['JscriptySessionReport'][_0x1a32('0x2b')]);_0x322f79[_0x1a32('0x2d')]=_[_0x1a32('0x2e')](_0x40cb60['query']);_0x322f79['filters']=_['intersection'](_0x322f79[_0x1a32('0x32')],_0x322f79[_0x1a32('0x2d')]);_0x4bd526[_0x1a32('0x31')]=_['intersection'](_0x322f79[_0x1a32('0x32')],qs[_0x1a32('0x33')](_0x40cb60[_0x1a32('0x2d')][_0x1a32('0x33')]));_0x4bd526[_0x1a32('0x31')]=_0x4bd526[_0x1a32('0x31')][_0x1a32('0x34')]?_0x4bd526[_0x1a32('0x31')]:_0x322f79[_0x1a32('0x32')];if(!_0x40cb60[_0x1a32('0x2d')]['hasOwnProperty'](_0x1a32('0x36'))){_0x4bd526[_0x1a32('0x1f')]=qs[_0x1a32('0x1f')](_0x40cb60[_0x1a32('0x2d')][_0x1a32('0x1f')]);_0x4bd526[_0x1a32('0x1c')]=qs[_0x1a32('0x1c')](_0x40cb60[_0x1a32('0x2d')][_0x1a32('0x1c')]);}_0x4bd526[_0x1a32('0x37')]=qs[_0x1a32('0x38')](_0x40cb60[_0x1a32('0x2d')][_0x1a32('0x38')]);_0x4bd526[_0x1a32('0x39')]=qs['filters'](_[_0x1a32('0x3a')](_0x40cb60[_0x1a32('0x2d')],_0x322f79['filters']));_0x4bd526['where'][_0x1a32('0x58')]=_0x241d6b['id'];if(_0x40cb60[_0x1a32('0x2d')][_0x1a32('0x3b')]){_0x4bd526[_0x1a32('0x39')]=_[_0x1a32('0x3c')](_0x4bd526[_0x1a32('0x39')],{'$or':_[_0x1a32('0x59')](_0x4bd526[_0x1a32('0x31')],function(_0x3dd783){var _0x16b1c5={};_0x16b1c5[_0x3dd783]={'$like':'%'+_0x40cb60[_0x1a32('0x2d')][_0x1a32('0x3b')]+'%'};return _0x16b1c5;})});}_0x4bd526=_[_0x1a32('0x3c')]({},_0x4bd526,_0x40cb60[_0x1a32('0x3e')]);return db[_0x1a32('0x5a')][_0x1a32('0x1e')]({'where':_0x4bd526[_0x1a32('0x39')]})[_0x1a32('0x23')](function(_0x3b6d11){_0x22b66b[_0x1a32('0x1e')]=_0x3b6d11;if(_0x40cb60[_0x1a32('0x2d')][_0x1a32('0x40')]){_0x4bd526[_0x1a32('0x41')]=[{'all':!![]}];}return db[_0x1a32('0x5a')]['findAll'](_0x4bd526);})['then'](function(_0xffd369){_0x22b66b['rows']=_0xffd369;return _0x22b66b;});}})[_0x1a32('0x23')](respondWithFilteredResult(_0x3d32f1,_0x4bd526))[_0x1a32('0x45')](handleError(_0x3d32f1,null));};exports[_0x1a32('0x5b')]=function(_0x14296e,_0x17d6e9,_0x33beff){var _0x46ed95={'raw':!![],'where':{}};var _0x48c29a={};var _0x275db0={'count':0x0,'rows':[]};return db[_0x1a32('0x3f')][_0x1a32('0x57')]({'where':{'id':_0x14296e[_0x1a32('0x44')]['id']}})[_0x1a32('0x23')](handleEntityNotFound(_0x17d6e9,null))[_0x1a32('0x23')](function(_0x6cdb87){if(_0x6cdb87){_0x48c29a[_0x1a32('0x32')]=_[_0x1a32('0x2e')](db[_0x1a32('0x5c')][_0x1a32('0x2b')]);_0x48c29a['query']=_['keys'](_0x14296e[_0x1a32('0x2d')]);_0x48c29a[_0x1a32('0x2f')]=_[_0x1a32('0x30')](_0x48c29a[_0x1a32('0x32')],_0x48c29a[_0x1a32('0x2d')]);_0x46ed95[_0x1a32('0x31')]=_[_0x1a32('0x30')](_0x48c29a[_0x1a32('0x32')],qs['fields'](_0x14296e['query'][_0x1a32('0x33')]));_0x46ed95[_0x1a32('0x31')]=_0x46ed95[_0x1a32('0x31')]['length']?_0x46ed95[_0x1a32('0x31')]:_0x48c29a['model'];if(!_0x14296e[_0x1a32('0x2d')]['hasOwnProperty'](_0x1a32('0x36'))){_0x46ed95[_0x1a32('0x1f')]=qs[_0x1a32('0x1f')](_0x14296e[_0x1a32('0x2d')][_0x1a32('0x1f')]);_0x46ed95['offset']=qs['offset'](_0x14296e[_0x1a32('0x2d')][_0x1a32('0x1c')]);}_0x46ed95[_0x1a32('0x37')]=qs[_0x1a32('0x38')](_0x14296e[_0x1a32('0x2d')][_0x1a32('0x38')]);_0x46ed95[_0x1a32('0x39')]=qs[_0x1a32('0x2f')](_['pick'](_0x14296e[_0x1a32('0x2d')],_0x48c29a[_0x1a32('0x2f')]));_0x46ed95['where'][_0x1a32('0x58')]=_0x6cdb87['id'];if(_0x14296e['query']['filter']){_0x46ed95[_0x1a32('0x39')]=_['merge'](_0x46ed95[_0x1a32('0x39')],{'$or':_[_0x1a32('0x59')](_0x46ed95['attributes'],function(_0x72c06d){var _0x3d6e75={};_0x3d6e75[_0x72c06d]={'$like':'%'+_0x14296e[_0x1a32('0x2d')][_0x1a32('0x3b')]+'%'};return _0x3d6e75;})});}_0x46ed95=_[_0x1a32('0x3c')]({},_0x46ed95,_0x14296e[_0x1a32('0x3e')]);return db[_0x1a32('0x5c')][_0x1a32('0x1e')]({'where':_0x46ed95['where']})[_0x1a32('0x23')](function(_0x3f7d29){_0x275db0['count']=_0x3f7d29;if(_0x14296e[_0x1a32('0x2d')]['includeAll']){_0x46ed95[_0x1a32('0x41')]=[{'all':!![]}];}return db[_0x1a32('0x5c')][_0x1a32('0x5d')](_0x46ed95);})[_0x1a32('0x23')](function(_0x28bb9a){_0x275db0[_0x1a32('0x42')]=_0x28bb9a;return _0x275db0;});}})[_0x1a32('0x23')](respondWithFilteredResult(_0x17d6e9,_0x46ed95))['catch'](handleError(_0x17d6e9,null));};function char(_0x106984){return _0x1a32('0x5e')===typeof _0x106984?String[_0x1a32('0x5f')][_0x1a32('0x21')](null,arguments):_0x106984;}function needsEncapsulation(_0x3a1129){return!!_0x3a1129&&(_0x3a1129[_0x1a32('0x60')]()[_0x1a32('0x61')](char(0xd))>=0x0||_0x3a1129['toString']()[_0x1a32('0x61')](char(0xa))>=0x0||_0x3a1129['toString']()['indexOf'](char(0x2c))>=0x0||_0x3a1129[_0x1a32('0x60')]()[_0x1a32('0x61')](char(0x22))>=0x0);}function encapsulate(_0x9eaafb){var _0x236636=char(0x22),_0x2cbd2f='\x5c'+char(0x22),_0x508a24=_0x9eaafb[_0x1a32('0x60')]()[_0x1a32('0x62')](new RegExp(_0x236636,'g'),_0x2cbd2f);return _0x236636+_0x508a24+_0x236636;}exports[_0x1a32('0x63')]=function(_0x13ddbe,_0x1e2008,_0x43a739){var _0x494d2b,_0x58bb0d;var _0x23b8be={'where':{'ProjectId':_0x13ddbe[_0x1a32('0x44')]['id']}};if(_0x13ddbe[_0x1a32('0x2d')][_0x1a32('0x64')]){_0x23b8be[_0x1a32('0x39')][_0x1a32('0x65')]=JSON['parse'](_0x13ddbe[_0x1a32('0x2d')][_0x1a32('0x64')]);}return db[_0x1a32('0x5a')]['findAll'](_0x23b8be)[_0x1a32('0x23')](handleEntityNotFound(_0x1e2008,null))['then'](function(_0x327275){if(_0x327275){_0x494d2b=_0x327275;return db[_0x1a32('0x66')]['findAll']({'where':{'SessionId':{'$in':_[_0x1a32('0x59')](_0x494d2b,'id')},'ProjectId':_0x13ddbe[_0x1a32('0x44')]['id']},'order':'-createdAt'});}})[_0x1a32('0x23')](handleEntityNotFound(_0x1e2008,null))[_0x1a32('0x23')](function(_0x1eb49d){if(_0x1eb49d){_0x58bb0d=_0x1eb49d;var _0xf9c7bf={};for(var _0x35efc4=0x0,_0x27c971=_0x58bb0d[_0x1a32('0x34')];_0x35efc4<_0x27c971;_0x35efc4++){if(!_0xf9c7bf[_0x1a32('0x35')](_0x58bb0d[_0x35efc4][_0x1a32('0x67')])){_0xf9c7bf[_0x58bb0d[_0x35efc4][_0x1a32('0x67')]]=needsEncapsulation(_0x58bb0d[_0x35efc4][_0x1a32('0x68')])?encapsulate(_0x58bb0d[_0x35efc4]['question']):_0x58bb0d[_0x35efc4][_0x1a32('0x68')];}}var _0x3d67d1=[],_0x37153a={};for(var _0x3d974c=0x0,_0x431bf4=_0x494d2b[_0x1a32('0x34')];_0x3d974c<_0x431bf4;_0x3d974c++){_0x37153a={'ProjectId':_0x13ddbe[_0x1a32('0x44')]['id'],'SessionId':_0x494d2b[_0x3d974c]['id'],'StartTime':moment(_0x494d2b[_0x3d974c][_0x1a32('0x65')])[_0x1a32('0x69')](_0x1a32('0x6a'))};for(var _0x2010fc=0x0,_0x44a051=_0x58bb0d['length'];_0x2010fc<_0x44a051;_0x2010fc++){if(_0x58bb0d[_0x2010fc]['SessionId']==_0x494d2b[_0x3d974c]['id']&&_0xf9c7bf[_0x1a32('0x35')](_0x58bb0d[_0x2010fc][_0x1a32('0x67')])){_0x37153a[_0xf9c7bf[_0x58bb0d[_0x2010fc]['questionId']]]=_0x58bb0d[_0x2010fc]['answer'];}}for(var _0x42c24c in _0xf9c7bf){if(!_0x37153a[_0x1a32('0x35')](_0xf9c7bf[_0x42c24c])){_0x37153a[_0xf9c7bf[_0x42c24c]]=null;}}_0x3d67d1[_0x1a32('0x6b')](_0x37153a);}return _0x3d67d1;}})['then'](function(_0x13fa2c){if(!_[_0x1a32('0x6c')](_0x13fa2c)){var _0x49b8d1=toCsv(_0x13fa2c);var _0x52dbd9=Date[_0x1a32('0x6d')]();fs[_0x1a32('0x6e')](util[_0x1a32('0x69')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x13ddbe[_0x1a32('0x44')]['id'],_0x52dbd9),_0x49b8d1);_0x1e2008[_0x1a32('0x6f')](_0x1a32('0x70'),'attachment;\x20filename='+util[_0x1a32('0x69')](_0x1a32('0x71'),_0x13ddbe[_0x1a32('0x44')]['id'],_0x52dbd9));_0x1e2008[_0x1a32('0x6f')](_0x1a32('0x72'),_0x1a32('0x73'));return _0x1e2008[_0x1a32('0x74')](util[_0x1a32('0x69')](_0x1a32('0x75'),_0x13ddbe[_0x1a32('0x44')]['id'],_0x52dbd9));}else{return _0x1e2008[_0x1a32('0x18')](0xcc);}})['catch'](handleError(_0x1e2008,null));}; \ No newline at end of file +var _0x0999=['replace','getSummary','starttime','startTime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','text/csv','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','Projects','UserProfileResource','end','error','stack','name','send','map','rawAttributes','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filters','merge','VIRTUAL','filter','options','JscriptyProject','includeAll','include','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','body','omit','update','getSessions','findOne','JscriptySessionReport','pick','ProjectId','findAll','rows','JscriptyAnswerReport','nolimit','number','fromCharCode','indexOf','toString'];(function(_0x2d0151,_0x2d5c38){var _0x3c1d84=function(_0x104fe2){while(--_0x104fe2){_0x2d0151['push'](_0x2d0151['shift']());}};_0x3c1d84(++_0x2d5c38);}(_0x0999,0x85));var _0x9099=function(_0x1d4449,_0x495153){_0x1d4449=_0x1d4449-0x0;var _0x4dcde3=_0x0999[_0x1d4449];return _0x4dcde3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9099('0x0'));var zipdir=require(_0x9099('0x1'));var jsonpatch=require(_0x9099('0x2'));var rp=require(_0x9099('0x3'));var moment=require(_0x9099('0x4'));var BPromise=require(_0x9099('0x5'));var Mustache=require(_0x9099('0x6'));var util=require(_0x9099('0x7'));var path=require(_0x9099('0x8'));var sox=require(_0x9099('0x9'));var csv=require(_0x9099('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9099('0xb'));var _=require(_0x9099('0xc'));var squel=require('squel');var crypto=require(_0x9099('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9099('0xa'));var querystring=require(_0x9099('0xe'));var Papa=require('papaparse');var Redis=require(_0x9099('0xf'));var authService=require(_0x9099('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9099('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9099('0x12'))(_0x9099('0x13'));var utils=require(_0x9099('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9099('0x15'));var db=require(_0x9099('0x16'))['db'];function respondWithStatusCode(_0xaf38f0,_0x59e806){_0x59e806=_0x59e806||0xcc;return function(_0x159346){if(_0x159346){return _0xaf38f0[_0x9099('0x17')](_0x59e806);}return _0xaf38f0[_0x9099('0x18')](_0x59e806)['end']();};}function respondWithResult(_0x5bb453,_0x298d04){_0x298d04=_0x298d04||0xc8;return function(_0x4d3233){if(_0x4d3233){return _0x5bb453[_0x9099('0x18')](_0x298d04)['json'](_0x4d3233);}};}function respondWithFilteredResult(_0x359cc4,_0x4c55dc){return function(_0x3548e8){if(_0x3548e8){var _0x1867a0=typeof _0x4c55dc[_0x9099('0x19')]===_0x9099('0x1a')&&typeof _0x4c55dc[_0x9099('0x1b')]===_0x9099('0x1a');var _0xc2094a=_0x3548e8[_0x9099('0x1c')];var _0x993bb9=_0x1867a0?0x0:_0x4c55dc[_0x9099('0x19')];var _0x563325=_0x1867a0?_0x3548e8['count']:_0x4c55dc[_0x9099('0x19')]+_0x4c55dc[_0x9099('0x1b')];var _0x490f05;if(_0x563325>=_0xc2094a){_0x563325=_0xc2094a;_0x490f05=0xc8;}else{_0x490f05=0xce;}_0x359cc4[_0x9099('0x18')](_0x490f05);return _0x359cc4[_0x9099('0x1d')](_0x9099('0x1e'),_0x993bb9+'-'+_0x563325+'/'+_0xc2094a)['json'](_0x3548e8);}return null;};}function patchUpdates(_0x5e962d){return function(_0x23c1b6){try{jsonpatch[_0x9099('0x1f')](_0x23c1b6,_0x5e962d,!![]);}catch(_0xbb444d){return BPromise[_0x9099('0x20')](_0xbb444d);}return _0x23c1b6[_0x9099('0x21')]();};}function saveUpdates(_0x305826,_0x23e12){return function(_0x53aa89){if(_0x53aa89){return _0x53aa89['update'](_0x305826)[_0x9099('0x22')](function(_0x5a2b7f){return _0x5a2b7f;});}return null;};}function removeEntity(_0xe12a3c,_0x22f4b3){return function(_0x281cb0){if(_0x281cb0){return _0x281cb0[_0x9099('0x23')]()[_0x9099('0x22')](function(){var _0x34c616=_0x281cb0[_0x9099('0x24')]({'plain':!![]});var _0x387688=_0x9099('0x25');return db[_0x9099('0x26')]['destroy']({'where':{'type':_0x387688,'resourceId':_0x34c616['id']}})['then'](function(){return _0x281cb0;});})[_0x9099('0x22')](function(){_0xe12a3c[_0x9099('0x18')](0xcc)[_0x9099('0x27')]();});}};}function handleEntityNotFound(_0x28777f,_0x22a652){return function(_0x326cd1){if(!_0x326cd1){_0x28777f[_0x9099('0x17')](0x194);}return _0x326cd1;};}function handleError(_0xf1eae6,_0x49e9c0){_0x49e9c0=_0x49e9c0||0x1f4;return function(_0xe677c0){logger[_0x9099('0x28')](_0xe677c0[_0x9099('0x29')]);if(_0xe677c0['name']){delete _0xe677c0[_0x9099('0x2a')];}_0xf1eae6[_0x9099('0x18')](_0x49e9c0)[_0x9099('0x2b')](_0xe677c0);};}exports['index']=function(_0x4c7e93,_0x33b831){var _0x165092={},_0x4cc428={},_0xdc3c9c={'count':0x0,'rows':[]};var _0x77e9d8=_[_0x9099('0x2c')](db['JscriptyProject'][_0x9099('0x2d')],function(_0x11f38a){return{'name':_0x11f38a['fieldName'],'type':_0x11f38a['type'][_0x9099('0x2e')]};});_0x4cc428['model']=_[_0x9099('0x2c')](_0x77e9d8,_0x9099('0x2a'));_0x4cc428[_0x9099('0x2f')]=_[_0x9099('0x30')](_0x4c7e93[_0x9099('0x2f')]);_0x4cc428['filters']=_[_0x9099('0x31')](_0x4cc428[_0x9099('0x32')],_0x4cc428[_0x9099('0x2f')]);_0x165092[_0x9099('0x33')]=_['intersection'](_0x4cc428[_0x9099('0x32')],qs[_0x9099('0x34')](_0x4c7e93[_0x9099('0x2f')][_0x9099('0x34')]));_0x165092[_0x9099('0x33')]=_0x165092[_0x9099('0x33')]['length']?_0x165092['attributes']:_0x4cc428[_0x9099('0x32')];if(!_0x4c7e93[_0x9099('0x2f')][_0x9099('0x35')]('nolimit')){_0x165092['limit']=qs['limit'](_0x4c7e93[_0x9099('0x2f')][_0x9099('0x1b')]);_0x165092[_0x9099('0x19')]=qs['offset'](_0x4c7e93[_0x9099('0x2f')]['offset']);}_0x165092[_0x9099('0x36')]=qs[_0x9099('0x37')](_0x4c7e93[_0x9099('0x2f')][_0x9099('0x37')]);_0x165092[_0x9099('0x38')]=qs[_0x9099('0x39')](_['pick'](_0x4c7e93[_0x9099('0x2f')],_0x4cc428[_0x9099('0x39')]),_0x77e9d8);if(_0x4c7e93[_0x9099('0x2f')]['filter']){_0x165092['where']=_[_0x9099('0x3a')](_0x165092['where'],{'$or':_[_0x9099('0x2c')](_0x77e9d8,function(_0x477d06){if(_0x477d06['type']!==_0x9099('0x3b')){var _0x35ae8b={};_0x35ae8b[_0x477d06[_0x9099('0x2a')]]={'$like':'%'+_0x4c7e93['query'][_0x9099('0x3c')]+'%'};return _0x35ae8b;}})});}_0x165092=_[_0x9099('0x3a')]({},_0x165092,_0x4c7e93[_0x9099('0x3d')]);var _0x342e9a={'where':_0x165092['where']};return db[_0x9099('0x3e')]['count'](_0x342e9a)[_0x9099('0x22')](function(_0x52244c){_0xdc3c9c['count']=_0x52244c;if(_0x4c7e93[_0x9099('0x2f')][_0x9099('0x3f')]){_0x165092[_0x9099('0x40')]=[{'all':!![]}];}return db[_0x9099('0x3e')]['findAll'](_0x165092);})[_0x9099('0x22')](function(_0x1918ca){_0xdc3c9c['rows']=_0x1918ca;return _0xdc3c9c;})[_0x9099('0x22')](respondWithFilteredResult(_0x33b831,_0x165092))['catch'](handleError(_0x33b831,null));};exports['show']=function(_0x143dff,_0x512c8b){var _0x4f7429={'raw':![],'where':{'id':_0x143dff[_0x9099('0x41')]['id']}},_0x1b63ef={};_0x1b63ef['model']=_[_0x9099('0x30')](db[_0x9099('0x3e')][_0x9099('0x2d')]);_0x1b63ef['query']=_[_0x9099('0x30')](_0x143dff['query']);_0x1b63ef[_0x9099('0x39')]=_[_0x9099('0x31')](_0x1b63ef[_0x9099('0x32')],_0x1b63ef[_0x9099('0x2f')]);_0x4f7429[_0x9099('0x33')]=_[_0x9099('0x31')](_0x1b63ef[_0x9099('0x32')],qs[_0x9099('0x34')](_0x143dff['query'][_0x9099('0x34')]));_0x4f7429[_0x9099('0x33')]=_0x4f7429['attributes'][_0x9099('0x42')]?_0x4f7429[_0x9099('0x33')]:_0x1b63ef['model'];if(_0x143dff[_0x9099('0x2f')][_0x9099('0x3f')]){_0x4f7429[_0x9099('0x40')]=[{'all':!![]}];}_0x4f7429=_[_0x9099('0x3a')]({},_0x4f7429,_0x143dff['options']);return db['JscriptyProject'][_0x9099('0x43')](_0x4f7429)['then'](handleEntityNotFound(_0x512c8b,null))[_0x9099('0x22')](respondWithResult(_0x512c8b,null))['catch'](handleError(_0x512c8b,null));};exports[_0x9099('0x44')]=function(_0xbe9cbc,_0x234da5){return db[_0x9099('0x3e')][_0x9099('0x44')](_0xbe9cbc['body'],{})['then'](function(_0x5086c1){var _0x2b15ed=_0xbe9cbc[_0x9099('0x45')][_0x9099('0x24')]({'plain':!![]});if(!_0x2b15ed)throw new Error(_0x9099('0x46'));if(_0x2b15ed[_0x9099('0x47')]===_0x9099('0x45')){var _0x3de0c1=_0x5086c1[_0x9099('0x24')]({'plain':!![]});var _0x383db5='Projects';return db[_0x9099('0x48')]['find']({'where':{'name':_0x383db5,'userProfileId':_0x2b15ed[_0x9099('0x49')]},'raw':!![]})[_0x9099('0x22')](function(_0x51688f){if(_0x51688f&&_0x51688f[_0x9099('0x4a')]===0x0){return db['UserProfileResource'][_0x9099('0x44')]({'name':_0x3de0c1[_0x9099('0x2a')],'resourceId':_0x3de0c1['id'],'type':_0x51688f[_0x9099('0x2a')],'sectionId':_0x51688f['id']},{})[_0x9099('0x22')](function(){return _0x5086c1;});}else{return _0x5086c1;}})[_0x9099('0x4b')](function(_0x181088){logger[_0x9099('0x28')](_0x9099('0x4c'),_0x181088);throw _0x181088;});}return _0x5086c1;})[_0x9099('0x22')](respondWithResult(_0x234da5,0xc9))[_0x9099('0x4b')](handleError(_0x234da5,null));};exports[_0x9099('0x4d')]=function(_0x42cc30,_0x263412){var _0x4ac885={'where':{'id':_0x42cc30[_0x9099('0x41')]['id']}},_0x49ffb8={};_0x49ffb8['model']=_[_0x9099('0x30')](db[_0x9099('0x3e')][_0x9099('0x2d')]);_0x4ac885[_0x9099('0x33')]=_[_0x9099('0x31')](_0x49ffb8[_0x9099('0x32')],qs[_0x9099('0x34')](_0x42cc30['query'][_0x9099('0x34')]));_0x4ac885['attributes']=_0x4ac885['attributes'][_0x9099('0x42')]?_0x4ac885[_0x9099('0x33')]:_0x49ffb8['model'];if(_0x42cc30[_0x9099('0x2f')][_0x9099('0x3f')]){_0x4ac885[_0x9099('0x40')]=[{'all':!![]}];}_0x4ac885=_[_0x9099('0x3a')]({},_0x4ac885,_0x42cc30[_0x9099('0x3d')]);return db[_0x9099('0x3e')][_0x9099('0x43')](_0x4ac885)[_0x9099('0x22')](handleEntityNotFound(_0x263412,null))[_0x9099('0x22')](function(_0x2fce16){if(_0x2fce16){var _0x425105=_0x2fce16[_0x9099('0x24')]({'plain':!![]});_0x425105=qs['omit'](_0x425105,['id',_0x9099('0x4e'),'updatedAt']);_0x42cc30[_0x9099('0x4f')]=_[_0x9099('0x50')](_0x42cc30[_0x9099('0x4f')],['id',_0x9099('0x4e'),'updatedAt']);return db['JscriptyProject'][_0x9099('0x44')](_[_0x9099('0x3a')](_0x425105,_0x42cc30[_0x9099('0x4f')]),{'include':_0x42cc30['query'][_0x9099('0x3f')]?[{'all':!![]}]:undefined})['then'](function(_0x429773){var _0x396f39=_0x42cc30[_0x9099('0x45')]['get']({'plain':!![]});if(!_0x396f39)throw new Error(_0x9099('0x46'));if(_0x396f39['role']===_0x9099('0x45')){var _0x53bb97=_0x429773[_0x9099('0x24')]({'plain':!![]});var _0x6f09f3=_0x9099('0x25');return db[_0x9099('0x48')][_0x9099('0x43')]({'where':{'name':_0x6f09f3,'userProfileId':_0x396f39[_0x9099('0x49')]},'raw':!![]})['then'](function(_0x3d2096){if(_0x3d2096&&_0x3d2096[_0x9099('0x4a')]===0x0){return db[_0x9099('0x26')][_0x9099('0x44')]({'name':_0x53bb97[_0x9099('0x2a')],'resourceId':_0x53bb97['id'],'type':_0x3d2096[_0x9099('0x2a')],'sectionId':_0x3d2096['id']},{})[_0x9099('0x22')](function(){return _0x429773;});}else{return _0x429773;}})[_0x9099('0x4b')](function(_0x2cb696){logger[_0x9099('0x28')](_0x9099('0x4c'),_0x2cb696);throw _0x2cb696;});}return _0x429773;});}})['then'](respondWithResult(_0x263412,0xc9))[_0x9099('0x4b')](handleError(_0x263412,null));};exports[_0x9099('0x51')]=function(_0x2a4b95,_0x4e852c){if(_0x2a4b95['body']['id']){delete _0x2a4b95[_0x9099('0x4f')]['id'];}return db[_0x9099('0x3e')]['find']({'where':{'id':_0x2a4b95[_0x9099('0x41')]['id']}})['then'](handleEntityNotFound(_0x4e852c,null))[_0x9099('0x22')](saveUpdates(_0x2a4b95['body'],null))[_0x9099('0x22')](respondWithResult(_0x4e852c,null))[_0x9099('0x4b')](handleError(_0x4e852c,null));};exports[_0x9099('0x23')]=function(_0x285b1a,_0x3b2668){return db['JscriptyProject'][_0x9099('0x43')]({'where':{'id':_0x285b1a[_0x9099('0x41')]['id']}})[_0x9099('0x22')](handleEntityNotFound(_0x3b2668,null))[_0x9099('0x22')](removeEntity(_0x3b2668,null))['catch'](handleError(_0x3b2668,null));};exports[_0x9099('0x52')]=function(_0x4c2503,_0x3c7a1e,_0x563c9a){var _0x352d77={'raw':!![],'where':{}};var _0x48b0fa={};var _0x5bf674={'count':0x0,'rows':[]};return db[_0x9099('0x3e')][_0x9099('0x53')]({'where':{'id':_0x4c2503[_0x9099('0x41')]['id']}})[_0x9099('0x22')](handleEntityNotFound(_0x3c7a1e,null))['then'](function(_0x5fbbee){if(_0x5fbbee){_0x48b0fa[_0x9099('0x32')]=_[_0x9099('0x30')](db[_0x9099('0x54')][_0x9099('0x2d')]);_0x48b0fa[_0x9099('0x2f')]=_[_0x9099('0x30')](_0x4c2503[_0x9099('0x2f')]);_0x48b0fa[_0x9099('0x39')]=_[_0x9099('0x31')](_0x48b0fa[_0x9099('0x32')],_0x48b0fa[_0x9099('0x2f')]);_0x352d77['attributes']=_[_0x9099('0x31')](_0x48b0fa[_0x9099('0x32')],qs[_0x9099('0x34')](_0x4c2503[_0x9099('0x2f')]['fields']));_0x352d77[_0x9099('0x33')]=_0x352d77[_0x9099('0x33')][_0x9099('0x42')]?_0x352d77[_0x9099('0x33')]:_0x48b0fa['model'];if(!_0x4c2503[_0x9099('0x2f')][_0x9099('0x35')]('nolimit')){_0x352d77[_0x9099('0x1b')]=qs[_0x9099('0x1b')](_0x4c2503['query'][_0x9099('0x1b')]);_0x352d77[_0x9099('0x19')]=qs[_0x9099('0x19')](_0x4c2503[_0x9099('0x2f')][_0x9099('0x19')]);}_0x352d77[_0x9099('0x36')]=qs[_0x9099('0x37')](_0x4c2503[_0x9099('0x2f')][_0x9099('0x37')]);_0x352d77['where']=qs['filters'](_[_0x9099('0x55')](_0x4c2503[_0x9099('0x2f')],_0x48b0fa['filters']));_0x352d77[_0x9099('0x38')][_0x9099('0x56')]=_0x5fbbee['id'];if(_0x4c2503['query']['filter']){_0x352d77[_0x9099('0x38')]=_[_0x9099('0x3a')](_0x352d77[_0x9099('0x38')],{'$or':_[_0x9099('0x2c')](_0x352d77['attributes'],function(_0x9b5f85){var _0x2e6e27={};_0x2e6e27[_0x9b5f85]={'$like':'%'+_0x4c2503[_0x9099('0x2f')][_0x9099('0x3c')]+'%'};return _0x2e6e27;})});}_0x352d77=_[_0x9099('0x3a')]({},_0x352d77,_0x4c2503[_0x9099('0x3d')]);return db[_0x9099('0x54')][_0x9099('0x1c')]({'where':_0x352d77[_0x9099('0x38')]})['then'](function(_0x1e31ab){_0x5bf674[_0x9099('0x1c')]=_0x1e31ab;if(_0x4c2503[_0x9099('0x2f')][_0x9099('0x3f')]){_0x352d77['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x9099('0x57')](_0x352d77);})[_0x9099('0x22')](function(_0x429106){_0x5bf674[_0x9099('0x58')]=_0x429106;return _0x5bf674;});}})[_0x9099('0x22')](respondWithFilteredResult(_0x3c7a1e,_0x352d77))[_0x9099('0x4b')](handleError(_0x3c7a1e,null));};exports['getAnswers']=function(_0x24b984,_0x549a49,_0x2c7d78){var _0xc0002c={'raw':!![],'where':{}};var _0x51d217={};var _0x3c3c94={'count':0x0,'rows':[]};return db[_0x9099('0x3e')][_0x9099('0x53')]({'where':{'id':_0x24b984['params']['id']}})[_0x9099('0x22')](handleEntityNotFound(_0x549a49,null))['then'](function(_0x2a38ac){if(_0x2a38ac){_0x51d217[_0x9099('0x32')]=_[_0x9099('0x30')](db[_0x9099('0x59')]['rawAttributes']);_0x51d217[_0x9099('0x2f')]=_['keys'](_0x24b984[_0x9099('0x2f')]);_0x51d217[_0x9099('0x39')]=_['intersection'](_0x51d217[_0x9099('0x32')],_0x51d217['query']);_0xc0002c['attributes']=_[_0x9099('0x31')](_0x51d217[_0x9099('0x32')],qs['fields'](_0x24b984['query'][_0x9099('0x34')]));_0xc0002c[_0x9099('0x33')]=_0xc0002c[_0x9099('0x33')][_0x9099('0x42')]?_0xc0002c[_0x9099('0x33')]:_0x51d217[_0x9099('0x32')];if(!_0x24b984[_0x9099('0x2f')][_0x9099('0x35')](_0x9099('0x5a'))){_0xc0002c[_0x9099('0x1b')]=qs[_0x9099('0x1b')](_0x24b984[_0x9099('0x2f')]['limit']);_0xc0002c[_0x9099('0x19')]=qs[_0x9099('0x19')](_0x24b984[_0x9099('0x2f')][_0x9099('0x19')]);}_0xc0002c[_0x9099('0x36')]=qs['sort'](_0x24b984[_0x9099('0x2f')][_0x9099('0x37')]);_0xc0002c[_0x9099('0x38')]=qs[_0x9099('0x39')](_[_0x9099('0x55')](_0x24b984[_0x9099('0x2f')],_0x51d217[_0x9099('0x39')]));_0xc0002c[_0x9099('0x38')][_0x9099('0x56')]=_0x2a38ac['id'];if(_0x24b984[_0x9099('0x2f')][_0x9099('0x3c')]){_0xc0002c[_0x9099('0x38')]=_[_0x9099('0x3a')](_0xc0002c[_0x9099('0x38')],{'$or':_[_0x9099('0x2c')](_0xc0002c[_0x9099('0x33')],function(_0x5c230a){var _0x256896={};_0x256896[_0x5c230a]={'$like':'%'+_0x24b984[_0x9099('0x2f')][_0x9099('0x3c')]+'%'};return _0x256896;})});}_0xc0002c=_['merge']({},_0xc0002c,_0x24b984['options']);return db[_0x9099('0x59')][_0x9099('0x1c')]({'where':_0xc0002c[_0x9099('0x38')]})[_0x9099('0x22')](function(_0x165ee5){_0x3c3c94[_0x9099('0x1c')]=_0x165ee5;if(_0x24b984['query'][_0x9099('0x3f')]){_0xc0002c[_0x9099('0x40')]=[{'all':!![]}];}return db[_0x9099('0x59')][_0x9099('0x57')](_0xc0002c);})['then'](function(_0x154406){_0x3c3c94['rows']=_0x154406;return _0x3c3c94;});}})[_0x9099('0x22')](respondWithFilteredResult(_0x549a49,_0xc0002c))[_0x9099('0x4b')](handleError(_0x549a49,null));};function char(_0x144c52){return _0x9099('0x5b')===typeof _0x144c52?String[_0x9099('0x5c')][_0x9099('0x1f')](null,arguments):_0x144c52;}function needsEncapsulation(_0x2f1285){return!!_0x2f1285&&(_0x2f1285['toString']()[_0x9099('0x5d')](char(0xd))>=0x0||_0x2f1285[_0x9099('0x5e')]()[_0x9099('0x5d')](char(0xa))>=0x0||_0x2f1285[_0x9099('0x5e')]()[_0x9099('0x5d')](char(0x2c))>=0x0||_0x2f1285[_0x9099('0x5e')]()[_0x9099('0x5d')](char(0x22))>=0x0);}function encapsulate(_0x508114){var _0x59421e=char(0x22),_0x25f3ab='\x5c'+char(0x22),_0x4cd168=_0x508114[_0x9099('0x5e')]()[_0x9099('0x5f')](new RegExp(_0x59421e,'g'),_0x25f3ab);return _0x59421e+_0x4cd168+_0x59421e;}exports[_0x9099('0x60')]=function(_0x2d5ef7,_0x55b162,_0x484a1e){var _0x87e61,_0xc15e1f;var _0x4cd330={'where':{'ProjectId':_0x2d5ef7[_0x9099('0x41')]['id']}};if(_0x2d5ef7[_0x9099('0x2f')]['startTime']){_0x4cd330[_0x9099('0x38')][_0x9099('0x61')]=JSON['parse'](_0x2d5ef7[_0x9099('0x2f')][_0x9099('0x62')]);}return db['JscriptySessionReport'][_0x9099('0x57')](_0x4cd330)[_0x9099('0x22')](handleEntityNotFound(_0x55b162,null))[_0x9099('0x22')](function(_0x56cadb){if(_0x56cadb){_0x87e61=_0x56cadb;return db[_0x9099('0x63')][_0x9099('0x57')]({'where':{'SessionId':{'$in':_['map'](_0x87e61,'id')},'ProjectId':_0x2d5ef7[_0x9099('0x41')]['id']},'order':_0x9099('0x64')});}})[_0x9099('0x22')](handleEntityNotFound(_0x55b162,null))['then'](function(_0x425a6c){if(_0x425a6c){_0xc15e1f=_0x425a6c;var _0x3de194={};for(var _0x59381a=0x0,_0x39625e=_0xc15e1f[_0x9099('0x42')];_0x59381a<_0x39625e;_0x59381a++){if(!_0x3de194[_0x9099('0x35')](_0xc15e1f[_0x59381a][_0x9099('0x65')])){_0x3de194[_0xc15e1f[_0x59381a][_0x9099('0x65')]]=needsEncapsulation(_0xc15e1f[_0x59381a][_0x9099('0x66')])?encapsulate(_0xc15e1f[_0x59381a][_0x9099('0x66')]):_0xc15e1f[_0x59381a]['question'];}}var _0x3fe8a8=[],_0x42f375={};for(var _0x40647f=0x0,_0xac6290=_0x87e61[_0x9099('0x42')];_0x40647f<_0xac6290;_0x40647f++){_0x42f375={'ProjectId':_0x2d5ef7['params']['id'],'SessionId':_0x87e61[_0x40647f]['id'],'StartTime':moment(_0x87e61[_0x40647f]['starttime'])[_0x9099('0x67')](_0x9099('0x68'))};for(var _0x49e55b=0x0,_0x29fe46=_0xc15e1f['length'];_0x49e55b<_0x29fe46;_0x49e55b++){if(_0xc15e1f[_0x49e55b][_0x9099('0x69')]==_0x87e61[_0x40647f]['id']&&_0x3de194['hasOwnProperty'](_0xc15e1f[_0x49e55b][_0x9099('0x65')])){_0x42f375[_0x3de194[_0xc15e1f[_0x49e55b]['questionId']]]=_0xc15e1f[_0x49e55b]['answer'];}}for(var _0xb01fd7 in _0x3de194){if(!_0x42f375['hasOwnProperty'](_0x3de194[_0xb01fd7])){_0x42f375[_0x3de194[_0xb01fd7]]=null;}}_0x3fe8a8[_0x9099('0x6a')](_0x42f375);}return _0x3fe8a8;}})['then'](function(_0x136f46){if(!_[_0x9099('0x6b')](_0x136f46)){var _0x285ef2=toCsv(_0x136f46);var _0x2715e1=Date['now']();fs[_0x9099('0x6c')](util[_0x9099('0x67')](_0x9099('0x6d'),_0x2d5ef7[_0x9099('0x41')]['id'],_0x2715e1),_0x285ef2);_0x55b162[_0x9099('0x6e')](_0x9099('0x6f'),'attachment;\x20filename='+util[_0x9099('0x67')](_0x9099('0x70'),_0x2d5ef7[_0x9099('0x41')]['id'],_0x2715e1));_0x55b162['setHeader']('Content-type',_0x9099('0x71'));return _0x55b162['download'](util[_0x9099('0x67')](_0x9099('0x6d'),_0x2d5ef7[_0x9099('0x41')]['id'],_0x2715e1));}else{return _0x55b162[_0x9099('0x17')](0xcc);}})[_0x9099('0x4b')](handleError(_0x55b162,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 2d2685d..649376b 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 _0x4a9c=['bluebird','path','rimraf','../../config/environment','define','JscriptyProject','lodash','util','../../config/logger','api','moment'];(function(_0x3cf6f4,_0x429d80){var _0x5c5513=function(_0x70d238){while(--_0x70d238){_0x3cf6f4['push'](_0x3cf6f4['shift']());}};_0x5c5513(++_0x429d80);}(_0x4a9c,0xcc));var _0xc4a9=function(_0x1d7c44,_0xa5a49a){_0x1d7c44=_0x1d7c44-0x0;var _0x33f6c9=_0x4a9c[_0x1d7c44];return _0x33f6c9;};'use strict';var _=require(_0xc4a9('0x0'));var util=require(_0xc4a9('0x1'));var logger=require(_0xc4a9('0x2'))(_0xc4a9('0x3'));var moment=require(_0xc4a9('0x4'));var BPromise=require(_0xc4a9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc4a9('0x6'));var rimraf=require(_0xc4a9('0x7'));var config=require(_0xc4a9('0x8'));var attributes=require('./jscriptyProject.attributes');module['exports']=function(_0x95d3f6,_0x2f35e4){return _0x95d3f6[_0xc4a9('0x9')](_0xc4a9('0xa'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb458=['path','rimraf','./jscriptyProject.attributes','define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x2c3af7,_0x1ef62d){var _0x22a2f8=function(_0x4487d1){while(--_0x4487d1){_0x2c3af7['push'](_0x2c3af7['shift']());}};_0x22a2f8(++_0x1ef62d);}(_0xb458,0x103));var _0x8b45=function(_0x330939,_0x52dac5){_0x330939=_0x330939-0x0;var _0x4b5b43=_0xb458[_0x330939];return _0x4b5b43;};'use strict';var _=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var logger=require(_0x8b45('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8b45('0x3'));var rp=require(_0x8b45('0x4'));var fs=require('fs');var path=require(_0x8b45('0x5'));var rimraf=require(_0x8b45('0x6'));var config=require('../../config/environment');var attributes=require(_0x8b45('0x7'));module['exports']=function(_0x5cc2d5,_0xe8d774){return _0x5cc2d5[_0x8b45('0x8')](_0x8b45('0x9'),attributes,{'tableName':_0x8b45('0xa'),'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 a503324..f4f3822 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 _0x9bde=['code','message','JscriptyProject,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x558bff,_0x2c5141){var _0x1c4d89=function(_0xd9789c){while(--_0xd9789c){_0x558bff['push'](_0x558bff['shift']());}};_0x1c4d89(++_0x2c5141);}(_0x9bde,0xe1));var _0xe9bd=function(_0xe1bcc4,_0x2c10f5){_0xe1bcc4=_0xe1bcc4-0x0;var _0x56ad45=_0x9bde[_0xe1bcc4];return _0x56ad45;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});} \ No newline at end of file +var _0x0713=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x4aa8e2,_0x48c9bc){var _0x5f7f00=function(_0x58f0a2){while(--_0x58f0a2){_0x4aa8e2['push'](_0x4aa8e2['shift']());}};_0x5f7f00(++_0x48c9bc);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 326c184..b5df73f 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 _0x73d5=['../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x58965a,_0x2e71db){var _0x254efc=function(_0xf14fb4){while(--_0xf14fb4){_0x58965a['push'](_0x58965a['shift']());}};_0x254efc(++_0x2e71db);}(_0x73d5,0x1f1));var _0x573d=function(_0xf9fb96,_0x4037bc){_0xf9fb96=_0xf9fb96-0x0;var _0x53ec33=_0x73d5[_0xf9fb96];return _0x53ec33;};'use strict';var multer=require(_0x573d('0x0'));var util=require(_0x573d('0x1'));var path=require(_0x573d('0x2'));var timeout=require(_0x573d('0x3'));var express=require('express');var router=express[_0x573d('0x4')]();var fs_extra=require(_0x573d('0x5'));var auth=require(_0x573d('0x6'));var interaction=require(_0x573d('0x7'));var config=require(_0x573d('0x8'));var controller=require('./jscriptyQuestionReport.controller');router[_0x573d('0x9')]('/',auth['isAuthenticated'](),controller[_0x573d('0xa')]);router[_0x573d('0x9')]('/describe',auth[_0x573d('0xb')](),controller[_0x573d('0xc')]);router['get'](_0x573d('0xd'),auth[_0x573d('0xb')](),controller[_0x573d('0xe')]);router[_0x573d('0xf')]('/',auth[_0x573d('0xb')](),controller['create']);router[_0x573d('0x10')]('/:id',auth[_0x573d('0xb')](),controller[_0x573d('0x11')]);router[_0x573d('0x12')](_0x573d('0xd'),auth[_0x573d('0xb')](),controller[_0x573d('0x13')]);module[_0x573d('0x14')]=router; \ No newline at end of file +var _0x8a56=['put','/:id','delete','destroy','util','path','Router','../../components/interaction/service','./jscriptyQuestionReport.controller','get','isAuthenticated','/describe','show','post','create'];(function(_0x1f7a98,_0x5e532e){var _0x199005=function(_0x32918e){while(--_0x32918e){_0x1f7a98['push'](_0x1f7a98['shift']());}};_0x199005(++_0x5e532e);}(_0x8a56,0x112));var _0x68a5=function(_0x39106e,_0x586f3d){_0x39106e=_0x39106e-0x0;var _0x892aec=_0x8a56[_0x39106e];return _0x892aec;};'use strict';var multer=require('multer');var util=require(_0x68a5('0x0'));var path=require(_0x68a5('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x68a5('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x68a5('0x3'));var config=require('../../config/environment');var controller=require(_0x68a5('0x4'));router[_0x68a5('0x5')]('/',auth[_0x68a5('0x6')](),controller['index']);router[_0x68a5('0x5')](_0x68a5('0x7'),auth[_0x68a5('0x6')](),controller['describe']);router[_0x68a5('0x5')]('/:id',auth[_0x68a5('0x6')](),controller[_0x68a5('0x8')]);router[_0x68a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x68a5('0xa')]);router[_0x68a5('0xb')](_0x68a5('0xc'),auth[_0x68a5('0x6')](),controller['update']);router[_0x68a5('0xd')](_0x68a5('0xc'),auth[_0x68a5('0x6')](),controller[_0x68a5('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index c9b4d11..80f5ff8 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x7a54,0x106));var _0x47a5=function(_0x3d5e0a,_0x3c6354){_0x3d5e0a=_0x3d5e0a-0x0;var _0x401387=_0x7a54[_0x3d5e0a];return _0x401387;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x7a54,0x106));var _0x47a5=function(_0x4eb2c6,_0x23f0e4){_0x4eb2c6=_0x4eb2c6-0x0;var _0x583d69=_0x7a54[_0x4eb2c6];return _0x583d69;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index a9a1796..457c5dc 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 _0x3048=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','sendStatus','name','send','index','map','JscriptyQuestionReport','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x529ca7,_0x59a854){var _0x11b235=function(_0x24c4f2){while(--_0x24c4f2){_0x529ca7['push'](_0x529ca7['shift']());}};_0x11b235(++_0x59a854);}(_0x3048,0x1ba));var _0x8304=function(_0x47f58f,_0x534dda){_0x47f58f=_0x47f58f-0x0;var _0x11b74c=_0x3048[_0x47f58f];return _0x11b74c;};'use strict';var emlformat=require(_0x8304('0x0'));var rimraf=require(_0x8304('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8304('0x2'));var moment=require(_0x8304('0x3'));var BPromise=require(_0x8304('0x4'));var Mustache=require(_0x8304('0x5'));var util=require(_0x8304('0x6'));var path=require('path');var sox=require(_0x8304('0x7'));var csv=require(_0x8304('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8304('0x9'));var squel=require(_0x8304('0xa'));var crypto=require(_0x8304('0xb'));var jsforce=require(_0x8304('0xc'));var deskjs=require(_0x8304('0xd'));var toCsv=require(_0x8304('0x8'));var querystring=require(_0x8304('0xe'));var Papa=require(_0x8304('0xf'));var Redis=require('ioredis');var authService=require(_0x8304('0x10'));var qs=require(_0x8304('0x11'));var as=require(_0x8304('0x12'));var hardwareService=require(_0x8304('0x13'));var logger=require(_0x8304('0x14'))(_0x8304('0x15'));var utils=require(_0x8304('0x16'));var config=require(_0x8304('0x17'));var licenseUtil=require(_0x8304('0x18'));var db=require(_0x8304('0x19'))['db'];function respondWithStatusCode(_0xf5de54,_0x407420){_0x407420=_0x407420||0xcc;return function(_0xf8575c){if(_0xf8575c){return _0xf5de54['sendStatus'](_0x407420);}return _0xf5de54[_0x8304('0x1a')](_0x407420)[_0x8304('0x1b')]();};}function respondWithResult(_0x2a1f92,_0xb8f414){_0xb8f414=_0xb8f414||0xc8;return function(_0x439d40){if(_0x439d40){return _0x2a1f92[_0x8304('0x1a')](_0xb8f414)[_0x8304('0x1c')](_0x439d40);}};}function respondWithFilteredResult(_0x29250e,_0x33a3c0){return function(_0x1e9ca4){if(_0x1e9ca4){var _0x3bfe33=typeof _0x33a3c0['offset']===_0x8304('0x1d')&&typeof _0x33a3c0[_0x8304('0x1e')]===_0x8304('0x1d');var _0xb8d164=_0x1e9ca4[_0x8304('0x1f')];var _0x322130=_0x3bfe33?0x0:_0x33a3c0[_0x8304('0x20')];var _0x1ea3e3=_0x3bfe33?_0x1e9ca4['count']:_0x33a3c0[_0x8304('0x20')]+_0x33a3c0[_0x8304('0x1e')];var _0x1e8ddd;if(_0x1ea3e3>=_0xb8d164){_0x1ea3e3=_0xb8d164;_0x1e8ddd=0xc8;}else{_0x1e8ddd=0xce;}_0x29250e[_0x8304('0x1a')](_0x1e8ddd);return _0x29250e['set'](_0x8304('0x21'),_0x322130+'-'+_0x1ea3e3+'/'+_0xb8d164)[_0x8304('0x1c')](_0x1e9ca4);}return null;};}function patchUpdates(_0x1dd0d6){return function(_0x33cb27){try{jsonpatch[_0x8304('0x22')](_0x33cb27,_0x1dd0d6,!![]);}catch(_0x1ec40f){return BPromise[_0x8304('0x23')](_0x1ec40f);}return _0x33cb27['save']();};}function saveUpdates(_0x679a21,_0x2d684c){return function(_0x59e1d1){if(_0x59e1d1){return _0x59e1d1[_0x8304('0x24')](_0x679a21)[_0x8304('0x25')](function(_0x4c5f45){return _0x4c5f45;});}return null;};}function removeEntity(_0x3b4f5f,_0x19eecf){return function(_0x4c75f1){if(_0x4c75f1){return _0x4c75f1[_0x8304('0x26')]()[_0x8304('0x25')](function(){_0x3b4f5f[_0x8304('0x1a')](0xcc)[_0x8304('0x1b')]();});}};}function handleEntityNotFound(_0x4cecf3,_0x3870e1){return function(_0x4248ae){if(!_0x4248ae){_0x4cecf3[_0x8304('0x27')](0x194);}return _0x4248ae;};}function handleError(_0x2955a0,_0x1cde01){_0x1cde01=_0x1cde01||0x1f4;return function(_0x1f94da){logger['error'](_0x1f94da['stack']);if(_0x1f94da['name']){delete _0x1f94da[_0x8304('0x28')];}_0x2955a0['status'](_0x1cde01)[_0x8304('0x29')](_0x1f94da);};}exports[_0x8304('0x2a')]=function(_0x464a92,_0x38f0c8){var _0x57be8a={},_0x235017={},_0x5a47fc={'count':0x0,'rows':[]};var _0x5c5e45=_[_0x8304('0x2b')](db[_0x8304('0x2c')]['rawAttributes'],function(_0x2ac561){return{'name':_0x2ac561[_0x8304('0x2d')],'type':_0x2ac561[_0x8304('0x2e')][_0x8304('0x2f')]};});_0x235017[_0x8304('0x30')]=_[_0x8304('0x2b')](_0x5c5e45,_0x8304('0x28'));_0x235017['query']=_[_0x8304('0x31')](_0x464a92[_0x8304('0x32')]);_0x235017['filters']=_[_0x8304('0x33')](_0x235017[_0x8304('0x30')],_0x235017['query']);_0x57be8a['attributes']=_['intersection'](_0x235017[_0x8304('0x30')],qs[_0x8304('0x34')](_0x464a92[_0x8304('0x32')]['fields']));_0x57be8a[_0x8304('0x35')]=_0x57be8a[_0x8304('0x35')][_0x8304('0x36')]?_0x57be8a['attributes']:_0x235017[_0x8304('0x30')];if(!_0x464a92[_0x8304('0x32')][_0x8304('0x37')](_0x8304('0x38'))){_0x57be8a[_0x8304('0x1e')]=qs['limit'](_0x464a92['query'][_0x8304('0x1e')]);_0x57be8a['offset']=qs['offset'](_0x464a92['query']['offset']);}_0x57be8a[_0x8304('0x39')]=qs[_0x8304('0x3a')](_0x464a92[_0x8304('0x32')][_0x8304('0x3a')]);_0x57be8a[_0x8304('0x3b')]=qs[_0x8304('0x3c')](_[_0x8304('0x3d')](_0x464a92[_0x8304('0x32')],_0x235017['filters']),_0x5c5e45);if(_0x464a92[_0x8304('0x32')][_0x8304('0x3e')]){_0x57be8a[_0x8304('0x3b')]=_[_0x8304('0x3f')](_0x57be8a['where'],{'$or':_['map'](_0x5c5e45,function(_0x35a899){if(_0x35a899[_0x8304('0x2e')]!==_0x8304('0x40')){var _0x173ced={};_0x173ced[_0x35a899[_0x8304('0x28')]]={'$like':'%'+_0x464a92[_0x8304('0x32')][_0x8304('0x3e')]+'%'};return _0x173ced;}})});}_0x57be8a=_['merge']({},_0x57be8a,_0x464a92[_0x8304('0x41')]);var _0x1a8ea4={'where':_0x57be8a[_0x8304('0x3b')]};return db['JscriptyQuestionReport'][_0x8304('0x1f')](_0x1a8ea4)[_0x8304('0x25')](function(_0x1d7673){_0x5a47fc[_0x8304('0x1f')]=_0x1d7673;if(_0x464a92[_0x8304('0x32')][_0x8304('0x42')]){_0x57be8a['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x8304('0x43')](_0x57be8a);})[_0x8304('0x25')](function(_0x18e2fa){_0x5a47fc[_0x8304('0x44')]=_0x18e2fa;return _0x5a47fc;})['then'](respondWithFilteredResult(_0x38f0c8,_0x57be8a))[_0x8304('0x45')](handleError(_0x38f0c8,null));};exports[_0x8304('0x46')]=function(_0x499799,_0x51cb9f){var _0x2ffc71={'raw':!![],'where':{'id':_0x499799[_0x8304('0x47')]['id']}},_0x45bd91={};_0x45bd91[_0x8304('0x30')]=_[_0x8304('0x31')](db[_0x8304('0x2c')][_0x8304('0x48')]);_0x45bd91['query']=_[_0x8304('0x31')](_0x499799[_0x8304('0x32')]);_0x45bd91[_0x8304('0x3c')]=_[_0x8304('0x33')](_0x45bd91[_0x8304('0x30')],_0x45bd91[_0x8304('0x32')]);_0x2ffc71[_0x8304('0x35')]=_['intersection'](_0x45bd91['model'],qs['fields'](_0x499799[_0x8304('0x32')][_0x8304('0x34')]));_0x2ffc71[_0x8304('0x35')]=_0x2ffc71['attributes'][_0x8304('0x36')]?_0x2ffc71[_0x8304('0x35')]:_0x45bd91['model'];if(_0x499799['query']['includeAll']){_0x2ffc71[_0x8304('0x49')]=[{'all':!![]}];}_0x2ffc71=_['merge']({},_0x2ffc71,_0x499799[_0x8304('0x41')]);return db['JscriptyQuestionReport'][_0x8304('0x4a')](_0x2ffc71)[_0x8304('0x25')](handleEntityNotFound(_0x51cb9f,null))[_0x8304('0x25')](respondWithResult(_0x51cb9f,null))[_0x8304('0x45')](handleError(_0x51cb9f,null));};exports[_0x8304('0x4b')]=function(_0x2898c5,_0x20189f){return db['JscriptyQuestionReport'][_0x8304('0x4b')](_0x2898c5[_0x8304('0x4c')],{})[_0x8304('0x25')](respondWithResult(_0x20189f,0xc9))[_0x8304('0x45')](handleError(_0x20189f,null));};exports[_0x8304('0x24')]=function(_0x554c5e,_0x3fbadf){if(_0x554c5e[_0x8304('0x4c')]['id']){delete _0x554c5e[_0x8304('0x4c')]['id'];}return db[_0x8304('0x2c')][_0x8304('0x4a')]({'where':{'id':_0x554c5e[_0x8304('0x47')]['id']}})[_0x8304('0x25')](handleEntityNotFound(_0x3fbadf,null))[_0x8304('0x25')](saveUpdates(_0x554c5e[_0x8304('0x4c')],null))[_0x8304('0x25')](respondWithResult(_0x3fbadf,null))['catch'](handleError(_0x3fbadf,null));};exports['destroy']=function(_0x51ac93,_0x552592){return db[_0x8304('0x2c')][_0x8304('0x4a')]({'where':{'id':_0x51ac93[_0x8304('0x47')]['id']}})[_0x8304('0x25')](handleEntityNotFound(_0x552592,null))[_0x8304('0x25')](removeEntity(_0x552592,null))['catch'](handleError(_0x552592,null));};exports['describe']=function(_0x3f0f15,_0x5307e8){return db['JscriptyQuestionReport']['describe']()['then'](respondWithResult(_0x5307e8,null))[_0x8304('0x45')](handleError(_0x5307e8,null));}; \ No newline at end of file +var _0x2e32=['map','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','filter','options','JscriptyQuestionReport','includeAll','include','findAll','rows','params','keys','filters','find','create','body','catch','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','name','index'];(function(_0x4fe6d5,_0xf83fa1){var _0x1495f0=function(_0x238727){while(--_0x238727){_0x4fe6d5['push'](_0x4fe6d5['shift']());}};_0x1495f0(++_0xf83fa1);}(_0x2e32,0x1f0));var _0x22e3=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x2e32[_0x2e4e19];return _0x9ba20b;};'use strict';var emlformat=require(_0x22e3('0x0'));var rimraf=require(_0x22e3('0x1'));var zipdir=require(_0x22e3('0x2'));var jsonpatch=require(_0x22e3('0x3'));var rp=require(_0x22e3('0x4'));var moment=require(_0x22e3('0x5'));var BPromise=require(_0x22e3('0x6'));var Mustache=require(_0x22e3('0x7'));var util=require('util');var path=require(_0x22e3('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x22e3('0x9'));var fs=require('fs');var fs_extra=require(_0x22e3('0xa'));var _=require('lodash');var squel=require(_0x22e3('0xb'));var crypto=require(_0x22e3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x22e3('0xd'));var toCsv=require(_0x22e3('0xe'));var querystring=require(_0x22e3('0xf'));var Papa=require('papaparse');var Redis=require(_0x22e3('0x10'));var authService=require(_0x22e3('0x11'));var qs=require(_0x22e3('0x12'));var as=require(_0x22e3('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x22e3('0x14'))(_0x22e3('0x15'));var utils=require(_0x22e3('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x22e3('0x17'));var db=require(_0x22e3('0x18'))['db'];function respondWithStatusCode(_0x135a29,_0x6ea043){_0x6ea043=_0x6ea043||0xcc;return function(_0x15d4d5){if(_0x15d4d5){return _0x135a29[_0x22e3('0x19')](_0x6ea043);}return _0x135a29[_0x22e3('0x1a')](_0x6ea043)[_0x22e3('0x1b')]();};}function respondWithResult(_0x5a3e96,_0x495d3f){_0x495d3f=_0x495d3f||0xc8;return function(_0x48b4ec){if(_0x48b4ec){return _0x5a3e96[_0x22e3('0x1a')](_0x495d3f)['json'](_0x48b4ec);}};}function respondWithFilteredResult(_0x4c5e22,_0x5acdbf){return function(_0x3b3786){if(_0x3b3786){var _0x47e487=typeof _0x5acdbf[_0x22e3('0x1c')]===_0x22e3('0x1d')&&typeof _0x5acdbf[_0x22e3('0x1e')]===_0x22e3('0x1d');var _0x48f3bf=_0x3b3786[_0x22e3('0x1f')];var _0x41ed0c=_0x47e487?0x0:_0x5acdbf[_0x22e3('0x1c')];var _0x560c49=_0x47e487?_0x3b3786[_0x22e3('0x1f')]:_0x5acdbf[_0x22e3('0x1c')]+_0x5acdbf[_0x22e3('0x1e')];var _0xcbd037;if(_0x560c49>=_0x48f3bf){_0x560c49=_0x48f3bf;_0xcbd037=0xc8;}else{_0xcbd037=0xce;}_0x4c5e22['status'](_0xcbd037);return _0x4c5e22[_0x22e3('0x20')](_0x22e3('0x21'),_0x41ed0c+'-'+_0x560c49+'/'+_0x48f3bf)[_0x22e3('0x22')](_0x3b3786);}return null;};}function patchUpdates(_0x42b199){return function(_0x1a78e4){try{jsonpatch[_0x22e3('0x23')](_0x1a78e4,_0x42b199,!![]);}catch(_0x51c9e0){return BPromise[_0x22e3('0x24')](_0x51c9e0);}return _0x1a78e4[_0x22e3('0x25')]();};}function saveUpdates(_0x3becc8,_0x4014f4){return function(_0x2371cf){if(_0x2371cf){return _0x2371cf['update'](_0x3becc8)[_0x22e3('0x26')](function(_0x1d6082){return _0x1d6082;});}return null;};}function removeEntity(_0x5645b7,_0x20ae90){return function(_0x3b4ef7){if(_0x3b4ef7){return _0x3b4ef7[_0x22e3('0x27')]()['then'](function(){_0x5645b7[_0x22e3('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23889f,_0x1a6a5e){return function(_0xd02998){if(!_0xd02998){_0x23889f[_0x22e3('0x19')](0x194);}return _0xd02998;};}function handleError(_0x52f049,_0xbd0ee1){_0xbd0ee1=_0xbd0ee1||0x1f4;return function(_0x863065){logger[_0x22e3('0x28')](_0x863065['stack']);if(_0x863065[_0x22e3('0x29')]){delete _0x863065['name'];}_0x52f049['status'](_0xbd0ee1)['send'](_0x863065);};}exports[_0x22e3('0x2a')]=function(_0x180229,_0x381973){var _0x2b9a79={},_0x19f164={},_0x12b651={'count':0x0,'rows':[]};var _0x445f8e=_[_0x22e3('0x2b')](db['JscriptyQuestionReport'][_0x22e3('0x2c')],function(_0x5e2b0e){return{'name':_0x5e2b0e[_0x22e3('0x2d')],'type':_0x5e2b0e['type'][_0x22e3('0x2e')]};});_0x19f164[_0x22e3('0x2f')]=_[_0x22e3('0x2b')](_0x445f8e,_0x22e3('0x29'));_0x19f164[_0x22e3('0x30')]=_['keys'](_0x180229[_0x22e3('0x30')]);_0x19f164['filters']=_[_0x22e3('0x31')](_0x19f164[_0x22e3('0x2f')],_0x19f164[_0x22e3('0x30')]);_0x2b9a79[_0x22e3('0x32')]=_[_0x22e3('0x31')](_0x19f164[_0x22e3('0x2f')],qs[_0x22e3('0x33')](_0x180229[_0x22e3('0x30')][_0x22e3('0x33')]));_0x2b9a79['attributes']=_0x2b9a79['attributes'][_0x22e3('0x34')]?_0x2b9a79[_0x22e3('0x32')]:_0x19f164[_0x22e3('0x2f')];if(!_0x180229[_0x22e3('0x30')][_0x22e3('0x35')](_0x22e3('0x36'))){_0x2b9a79[_0x22e3('0x1e')]=qs[_0x22e3('0x1e')](_0x180229[_0x22e3('0x30')]['limit']);_0x2b9a79[_0x22e3('0x1c')]=qs[_0x22e3('0x1c')](_0x180229['query'][_0x22e3('0x1c')]);}_0x2b9a79[_0x22e3('0x37')]=qs['sort'](_0x180229[_0x22e3('0x30')][_0x22e3('0x38')]);_0x2b9a79['where']=qs['filters'](_[_0x22e3('0x39')](_0x180229[_0x22e3('0x30')],_0x19f164['filters']),_0x445f8e);if(_0x180229['query']['filter']){_0x2b9a79[_0x22e3('0x3a')]=_[_0x22e3('0x3b')](_0x2b9a79[_0x22e3('0x3a')],{'$or':_[_0x22e3('0x2b')](_0x445f8e,function(_0x2ef695){if(_0x2ef695[_0x22e3('0x3c')]!=='VIRTUAL'){var _0x3d7fb7={};_0x3d7fb7[_0x2ef695[_0x22e3('0x29')]]={'$like':'%'+_0x180229['query'][_0x22e3('0x3d')]+'%'};return _0x3d7fb7;}})});}_0x2b9a79=_[_0x22e3('0x3b')]({},_0x2b9a79,_0x180229[_0x22e3('0x3e')]);var _0x495788={'where':_0x2b9a79['where']};return db[_0x22e3('0x3f')]['count'](_0x495788)[_0x22e3('0x26')](function(_0x59178a){_0x12b651['count']=_0x59178a;if(_0x180229[_0x22e3('0x30')][_0x22e3('0x40')]){_0x2b9a79[_0x22e3('0x41')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x22e3('0x42')](_0x2b9a79);})['then'](function(_0x3d53f8){_0x12b651[_0x22e3('0x43')]=_0x3d53f8;return _0x12b651;})[_0x22e3('0x26')](respondWithFilteredResult(_0x381973,_0x2b9a79))['catch'](handleError(_0x381973,null));};exports['show']=function(_0x21c7a2,_0x2dadfa){var _0x32f6f3={'raw':!![],'where':{'id':_0x21c7a2[_0x22e3('0x44')]['id']}},_0x57fd31={};_0x57fd31[_0x22e3('0x2f')]=_['keys'](db['JscriptyQuestionReport']['rawAttributes']);_0x57fd31[_0x22e3('0x30')]=_[_0x22e3('0x45')](_0x21c7a2[_0x22e3('0x30')]);_0x57fd31[_0x22e3('0x46')]=_[_0x22e3('0x31')](_0x57fd31['model'],_0x57fd31['query']);_0x32f6f3[_0x22e3('0x32')]=_['intersection'](_0x57fd31[_0x22e3('0x2f')],qs[_0x22e3('0x33')](_0x21c7a2['query'][_0x22e3('0x33')]));_0x32f6f3[_0x22e3('0x32')]=_0x32f6f3[_0x22e3('0x32')]['length']?_0x32f6f3[_0x22e3('0x32')]:_0x57fd31[_0x22e3('0x2f')];if(_0x21c7a2['query'][_0x22e3('0x40')]){_0x32f6f3[_0x22e3('0x41')]=[{'all':!![]}];}_0x32f6f3=_[_0x22e3('0x3b')]({},_0x32f6f3,_0x21c7a2[_0x22e3('0x3e')]);return db[_0x22e3('0x3f')][_0x22e3('0x47')](_0x32f6f3)['then'](handleEntityNotFound(_0x2dadfa,null))['then'](respondWithResult(_0x2dadfa,null))['catch'](handleError(_0x2dadfa,null));};exports[_0x22e3('0x48')]=function(_0x172406,_0x552974){return db[_0x22e3('0x3f')][_0x22e3('0x48')](_0x172406[_0x22e3('0x49')],{})[_0x22e3('0x26')](respondWithResult(_0x552974,0xc9))[_0x22e3('0x4a')](handleError(_0x552974,null));};exports[_0x22e3('0x4b')]=function(_0x3c46f9,_0x299119){if(_0x3c46f9[_0x22e3('0x49')]['id']){delete _0x3c46f9['body']['id'];}return db[_0x22e3('0x3f')][_0x22e3('0x47')]({'where':{'id':_0x3c46f9[_0x22e3('0x44')]['id']}})['then'](handleEntityNotFound(_0x299119,null))['then'](saveUpdates(_0x3c46f9[_0x22e3('0x49')],null))[_0x22e3('0x26')](respondWithResult(_0x299119,null))[_0x22e3('0x4a')](handleError(_0x299119,null));};exports[_0x22e3('0x27')]=function(_0x5e77a5,_0x410416){return db[_0x22e3('0x3f')][_0x22e3('0x47')]({'where':{'id':_0x5e77a5[_0x22e3('0x44')]['id']}})[_0x22e3('0x26')](handleEntityNotFound(_0x410416,null))[_0x22e3('0x26')](removeEntity(_0x410416,null))[_0x22e3('0x4a')](handleError(_0x410416,null));};exports[_0x22e3('0x4c')]=function(_0x4e869e,_0x3bbba4){return db[_0x22e3('0x3f')][_0x22e3('0x4c')]()[_0x22e3('0x26')](respondWithResult(_0x3bbba4,null))[_0x22e3('0x4a')](handleError(_0x3bbba4,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 7d58f69..ccb77c1 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 _0x85f2=['../../config/logger','api','bluebird','request-promise','rimraf','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x85f2,0xd6));var _0x285f=function(_0x28f922,_0x1302f8){_0x28f922=_0x28f922-0x0;var _0x4eceac=_0x85f2[_0x28f922];return _0x4eceac;};'use strict';var _=require(_0x285f('0x0'));var util=require(_0x285f('0x1'));var logger=require(_0x285f('0x2'))(_0x285f('0x3'));var moment=require('moment');var BPromise=require(_0x285f('0x4'));var rp=require(_0x285f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x285f('0x6'));var config=require('../../config/environment');var attributes=require(_0x285f('0x7'));module[_0x285f('0x8')]=function(_0xcc8d2a,_0x2111fc){return _0xcc8d2a[_0x285f('0x9')](_0x285f('0xa'),attributes,{'tableName':_0x285f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x460e=['moment','bluebird','request-promise','path','../../config/environment','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','api'];(function(_0x406957,_0x36fc08){var _0x803a57=function(_0x27f25f){while(--_0x27f25f){_0x406957['push'](_0x406957['shift']());}};_0x803a57(++_0x36fc08);}(_0x460e,0x11d));var _0xe460=function(_0x4350c2,_0x112f3c){_0x4350c2=_0x4350c2-0x0;var _0x8b6406=_0x460e[_0x4350c2];return _0x8b6406;};'use strict';var _=require(_0xe460('0x0'));var util=require(_0xe460('0x1'));var logger=require('../../config/logger')(_0xe460('0x2'));var moment=require(_0xe460('0x3'));var BPromise=require(_0xe460('0x4'));var rp=require(_0xe460('0x5'));var fs=require('fs');var path=require(_0xe460('0x6'));var rimraf=require('rimraf');var config=require(_0xe460('0x7'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0xe460('0x8')]=function(_0x2cf277,_0x43a7df){return _0x2cf277[_0xe460('0x9')](_0xe460('0xa'),attributes,{'tableName':_0xe460('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 578e6c1..84d880c 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 _0x2ccd=['http','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0x2ccd,0x9f));var _0xd2cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2ccd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xd2cc('0x0'));var moment=require(_0xd2cc('0x1'));var BPromise=require(_0xd2cc('0x2'));var rs=require(_0xd2cc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd2cc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd2cc('0x5'))(_0xd2cc('0x6'));var config=require(_0xd2cc('0x7'));var jayson=require(_0xd2cc('0x8'));var client=jayson['client'][_0xd2cc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c955a,_0x42750d,_0x583276){return new BPromise(function(_0x1c3bca,_0x5794fc){return client['request'](_0x5c955a,_0x583276)['then'](function(_0x47679c){logger[_0xd2cc('0xa')](_0xd2cc('0xb'),_0x42750d,'request\x20sent');logger[_0xd2cc('0xc')](_0xd2cc('0xd'),_0x42750d,'request\x20sent',JSON[_0xd2cc('0xe')](_0x47679c));if(_0x47679c[_0xd2cc('0xf')]){if(_0x47679c[_0xd2cc('0xf')][_0xd2cc('0x10')]===0x1f4){logger[_0xd2cc('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x42750d,_0x47679c[_0xd2cc('0xf')][_0xd2cc('0x11')]);return _0x5794fc(_0x47679c[_0xd2cc('0xf')][_0xd2cc('0x11')]);}logger['error'](_0xd2cc('0xb'),_0x42750d,_0x47679c[_0xd2cc('0xf')][_0xd2cc('0x11')]);return _0x1c3bca(_0x47679c[_0xd2cc('0xf')][_0xd2cc('0x11')]);}else{logger[_0xd2cc('0xa')](_0xd2cc('0xb'),_0x42750d,_0xd2cc('0x12'));_0x1c3bca(_0x47679c[_0xd2cc('0x13')][_0xd2cc('0x11')]);}})[_0xd2cc('0x14')](function(_0x1abf11){logger[_0xd2cc('0xf')](_0xd2cc('0xb'),_0x42750d,_0x1abf11);_0x5794fc(_0x1abf11);});});} \ No newline at end of file +var _0x2185=['debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent'];(function(_0x1fc2bf,_0x586306){var _0x53bfc5=function(_0x311c15){while(--_0x311c15){_0x1fc2bf['push'](_0x1fc2bf['shift']());}};_0x53bfc5(++_0x586306);}(_0x2185,0x17e));var _0x5218=function(_0x210761,_0x4d266e){_0x210761=_0x210761-0x0;var _0x558832=_0x2185[_0x210761];return _0x558832;};'use strict';var _=require(_0x5218('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5218('0x1'));var rs=require(_0x5218('0x2'));var fs=require('fs');var Redis=require(_0x5218('0x3'));var db=require(_0x5218('0x4'))['db'];var utils=require(_0x5218('0x5'));var logger=require(_0x5218('0x6'))('rpc');var config=require(_0x5218('0x7'));var jayson=require(_0x5218('0x8'));var client=jayson[_0x5218('0x9')][_0x5218('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x253c3d,_0xcf766b,_0x2acdd8){return new BPromise(function(_0x1073fb,_0x4a8559){return client[_0x5218('0xb')](_0x253c3d,_0x2acdd8)['then'](function(_0x3e3e48){logger['info'](_0x5218('0xc'),_0xcf766b,_0x5218('0xd'));logger[_0x5218('0xe')](_0x5218('0xf'),_0xcf766b,_0x5218('0xd'),JSON[_0x5218('0x10')](_0x3e3e48));if(_0x3e3e48[_0x5218('0x11')]){if(_0x3e3e48[_0x5218('0x11')]['code']===0x1f4){logger[_0x5218('0x11')](_0x5218('0xc'),_0xcf766b,_0x3e3e48[_0x5218('0x11')]['message']);return _0x4a8559(_0x3e3e48[_0x5218('0x11')]['message']);}logger[_0x5218('0x11')](_0x5218('0xc'),_0xcf766b,_0x3e3e48['error'][_0x5218('0x12')]);return _0x1073fb(_0x3e3e48['error'][_0x5218('0x12')]);}else{logger[_0x5218('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0xcf766b,_0x5218('0xd'));_0x1073fb(_0x3e3e48[_0x5218('0x14')][_0x5218('0x12')]);}})[_0x5218('0x15')](function(_0x38e0f3){logger[_0x5218('0x11')](_0x5218('0xc'),_0xcf766b,_0x38e0f3);_0x4a8559(_0x38e0f3);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 7d1c072..548747c 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 _0x6276=['../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getQuestions','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x460fd7,_0x2012db){var _0x44d1c2=function(_0x545e11){while(--_0x545e11){_0x460fd7['push'](_0x460fd7['shift']());}};_0x44d1c2(++_0x2012db);}(_0x6276,0x17f));var _0x6627=function(_0x172407,_0x8ce89a){_0x172407=_0x172407-0x0;var _0x3be27f=_0x6276[_0x172407];return _0x3be27f;};'use strict';var multer=require(_0x6627('0x0'));var util=require(_0x6627('0x1'));var path=require(_0x6627('0x2'));var timeout=require(_0x6627('0x3'));var express=require(_0x6627('0x4'));var router=express['Router']();var fs_extra=require(_0x6627('0x5'));var auth=require(_0x6627('0x6'));var interaction=require(_0x6627('0x7'));var config=require(_0x6627('0x8'));var controller=require(_0x6627('0x9'));router[_0x6627('0xa')]('/',auth[_0x6627('0xb')](),controller[_0x6627('0xc')]);router[_0x6627('0xa')](_0x6627('0xd'),auth[_0x6627('0xb')](),controller[_0x6627('0xe')]);router[_0x6627('0xa')](_0x6627('0xf'),auth[_0x6627('0xb')](),controller[_0x6627('0x10')]);router['get']('/:id/questions',auth[_0x6627('0xb')](),controller[_0x6627('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6627('0x12')]);router[_0x6627('0x13')]('/:id',auth[_0x6627('0xb')](),controller[_0x6627('0x14')]);router[_0x6627('0x15')]('/:id',auth[_0x6627('0xb')](),controller[_0x6627('0x16')]);module['exports']=router; \ No newline at end of file +var _0x1c82=['get','isAuthenticated','index','/describe','/:id/questions','getQuestions','create','/:id','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptySessionReport.controller'];(function(_0x84e74,_0x186c9f){var _0x3bffd0=function(_0x35b6b0){while(--_0x35b6b0){_0x84e74['push'](_0x84e74['shift']());}};_0x3bffd0(++_0x186c9f);}(_0x1c82,0x187));var _0x21c8=function(_0x542752,_0x9920ed){_0x542752=_0x542752-0x0;var _0x45d072=_0x1c82[_0x542752];return _0x45d072;};'use strict';var multer=require(_0x21c8('0x0'));var util=require('util');var path=require(_0x21c8('0x1'));var timeout=require(_0x21c8('0x2'));var express=require(_0x21c8('0x3'));var router=express[_0x21c8('0x4')]();var fs_extra=require(_0x21c8('0x5'));var auth=require(_0x21c8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x21c8('0x7'));var controller=require(_0x21c8('0x8'));router[_0x21c8('0x9')]('/',auth[_0x21c8('0xa')](),controller[_0x21c8('0xb')]);router[_0x21c8('0x9')](_0x21c8('0xc'),auth[_0x21c8('0xa')](),controller['describe']);router[_0x21c8('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x21c8('0x9')](_0x21c8('0xd'),auth['isAuthenticated'](),controller[_0x21c8('0xe')]);router['post']('/',auth[_0x21c8('0xa')](),controller[_0x21c8('0xf')]);router['put'](_0x21c8('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x21c8('0x11')](_0x21c8('0x10'),auth['isAuthenticated'](),controller[_0x21c8('0x12')]);module[_0x21c8('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 598cda1..4b929a6 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 _0xabd8=['moment','sequelize','DATE','setDataValue','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xabd8,0xa8));var _0x8abd=function(_0x5cbf0e,_0x4cd140){_0x5cbf0e=_0x5cbf0e-0x0;var _0x1c76f8=_0xabd8[_0x5cbf0e];return _0x1c76f8;};'use strict';var moment=require(_0x8abd('0x0'));var Sequelize=require(_0x8abd('0x1'));module['exports']={'starttime':{'type':Sequelize[_0x8abd('0x2')],'set':function(_0x3f79d6){this[_0x8abd('0x3')]('starttime',_0x3f79d6);this[_0x8abd('0x3')](_0x8abd('0x4'),moment()['format'](_0x8abd('0x5')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x8abd('0x6')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x8abd('0x6')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x8abd('0x6')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x3e3c=['starttime','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports','DATE','setDataValue'];(function(_0x26ca02,_0x270f53){var _0x541f6e=function(_0x268760){while(--_0x268760){_0x26ca02['push'](_0x26ca02['shift']());}};_0x541f6e(++_0x270f53);}(_0x3e3c,0xc1));var _0xc3e3=function(_0x29632f,_0x216481){_0x29632f=_0x29632f-0x0;var _0x2da04b=_0x3e3c[_0x29632f];return _0x2da04b;};'use strict';var moment=require(_0xc3e3('0x0'));var Sequelize=require(_0xc3e3('0x1'));module[_0xc3e3('0x2')]={'starttime':{'type':Sequelize[_0xc3e3('0x3')],'set':function(_0x5ef88a){this[_0xc3e3('0x4')](_0xc3e3('0x5'),_0x5ef88a);this[_0xc3e3('0x4')]('endtime',moment()['format'](_0xc3e3('0x6')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xc3e3('0x7')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xc3e3('0x7')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xc3e3('0x7')]},'calleridnum':{'type':Sequelize[_0xc3e3('0x7')]},'completed':{'type':Sequelize[_0xc3e3('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index b934b7d..d08919e 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 _0x1385=['length','hasOwnProperty','nolimit','sort','where','pick','filter','options','includeAll','findAll','rows','catch','params','keys','include','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','order','SessionId','merge','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','index','map','JscriptySessionReport','rawAttributes','type','model','query','filters','intersection','fields','attributes'];(function(_0x4521e2,_0x56db85){var _0x515750=function(_0x4d9e83){while(--_0x4d9e83){_0x4521e2['push'](_0x4521e2['shift']());}};_0x515750(++_0x56db85);}(_0x1385,0x190));var _0x5138=function(_0x5884a1,_0x42e0ff){_0x5884a1=_0x5884a1-0x0;var _0x41da84=_0x1385[_0x5884a1];return _0x41da84;};'use strict';var emlformat=require(_0x5138('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5138('0x1'));var jsonpatch=require(_0x5138('0x2'));var rp=require(_0x5138('0x3'));var moment=require(_0x5138('0x4'));var BPromise=require(_0x5138('0x5'));var Mustache=require(_0x5138('0x6'));var util=require(_0x5138('0x7'));var path=require(_0x5138('0x8'));var sox=require('sox');var csv=require(_0x5138('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5138('0xa'));var _=require(_0x5138('0xb'));var squel=require('squel');var crypto=require(_0x5138('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5138('0x9'));var querystring=require('querystring');var Papa=require(_0x5138('0xd'));var Redis=require('ioredis');var authService=require(_0x5138('0xe'));var qs=require(_0x5138('0xf'));var as=require(_0x5138('0x10'));var hardwareService=require(_0x5138('0x11'));var logger=require('../../config/logger')(_0x5138('0x12'));var utils=require(_0x5138('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x5138('0x14'));var db=require(_0x5138('0x15'))['db'];function respondWithStatusCode(_0x27a073,_0x5a193a){_0x5a193a=_0x5a193a||0xcc;return function(_0x233c6e){if(_0x233c6e){return _0x27a073[_0x5138('0x16')](_0x5a193a);}return _0x27a073[_0x5138('0x17')](_0x5a193a)[_0x5138('0x18')]();};}function respondWithResult(_0x3750fe,_0x52c398){_0x52c398=_0x52c398||0xc8;return function(_0x2bf77b){if(_0x2bf77b){return _0x3750fe[_0x5138('0x17')](_0x52c398)[_0x5138('0x19')](_0x2bf77b);}};}function respondWithFilteredResult(_0x58d923,_0x2f59dd){return function(_0x45bf7d){if(_0x45bf7d){var _0x421ea3=typeof _0x2f59dd['offset']===_0x5138('0x1a')&&typeof _0x2f59dd['limit']==='undefined';var _0x5e8db4=_0x45bf7d[_0x5138('0x1b')];var _0x470b4d=_0x421ea3?0x0:_0x2f59dd['offset'];var _0x50892b=_0x421ea3?_0x45bf7d[_0x5138('0x1b')]:_0x2f59dd[_0x5138('0x1c')]+_0x2f59dd[_0x5138('0x1d')];var _0x4ed4b3;if(_0x50892b>=_0x5e8db4){_0x50892b=_0x5e8db4;_0x4ed4b3=0xc8;}else{_0x4ed4b3=0xce;}_0x58d923[_0x5138('0x17')](_0x4ed4b3);return _0x58d923[_0x5138('0x1e')](_0x5138('0x1f'),_0x470b4d+'-'+_0x50892b+'/'+_0x5e8db4)[_0x5138('0x19')](_0x45bf7d);}return null;};}function patchUpdates(_0x320eb0){return function(_0x46b8fa){try{jsonpatch[_0x5138('0x20')](_0x46b8fa,_0x320eb0,!![]);}catch(_0x589c5e){return BPromise[_0x5138('0x21')](_0x589c5e);}return _0x46b8fa[_0x5138('0x22')]();};}function saveUpdates(_0x55b2ef,_0x10c3be){return function(_0x152383){if(_0x152383){return _0x152383[_0x5138('0x23')](_0x55b2ef)[_0x5138('0x24')](function(_0x3177c7){return _0x3177c7;});}return null;};}function removeEntity(_0x4988c6,_0x202f99){return function(_0x9099f0){if(_0x9099f0){return _0x9099f0[_0x5138('0x25')]()[_0x5138('0x24')](function(){_0x4988c6['status'](0xcc)[_0x5138('0x18')]();});}};}function handleEntityNotFound(_0x4a98a6,_0x42184c){return function(_0x3f73a0){if(!_0x3f73a0){_0x4a98a6[_0x5138('0x16')](0x194);}return _0x3f73a0;};}function handleError(_0x35bf3c,_0x307a4c){_0x307a4c=_0x307a4c||0x1f4;return function(_0x38e63a){logger['error'](_0x38e63a['stack']);if(_0x38e63a['name']){delete _0x38e63a[_0x5138('0x26')];}_0x35bf3c['status'](_0x307a4c)['send'](_0x38e63a);};}exports[_0x5138('0x27')]=function(_0x57153e,_0xcf99bd){var _0x106d26={},_0x318d6e={},_0xd851e6={'count':0x0,'rows':[]};var _0x47d046=_[_0x5138('0x28')](db[_0x5138('0x29')][_0x5138('0x2a')],function(_0x50228f){return{'name':_0x50228f['fieldName'],'type':_0x50228f[_0x5138('0x2b')]['key']};});_0x318d6e[_0x5138('0x2c')]=_[_0x5138('0x28')](_0x47d046,_0x5138('0x26'));_0x318d6e[_0x5138('0x2d')]=_['keys'](_0x57153e[_0x5138('0x2d')]);_0x318d6e[_0x5138('0x2e')]=_[_0x5138('0x2f')](_0x318d6e[_0x5138('0x2c')],_0x318d6e['query']);_0x106d26['attributes']=_[_0x5138('0x2f')](_0x318d6e[_0x5138('0x2c')],qs[_0x5138('0x30')](_0x57153e[_0x5138('0x2d')][_0x5138('0x30')]));_0x106d26[_0x5138('0x31')]=_0x106d26[_0x5138('0x31')][_0x5138('0x32')]?_0x106d26[_0x5138('0x31')]:_0x318d6e[_0x5138('0x2c')];if(!_0x57153e['query'][_0x5138('0x33')](_0x5138('0x34'))){_0x106d26[_0x5138('0x1d')]=qs[_0x5138('0x1d')](_0x57153e['query'][_0x5138('0x1d')]);_0x106d26['offset']=qs[_0x5138('0x1c')](_0x57153e[_0x5138('0x2d')][_0x5138('0x1c')]);}_0x106d26['order']=qs[_0x5138('0x35')](_0x57153e['query'][_0x5138('0x35')]);_0x106d26[_0x5138('0x36')]=qs[_0x5138('0x2e')](_[_0x5138('0x37')](_0x57153e[_0x5138('0x2d')],_0x318d6e['filters']),_0x47d046);if(_0x57153e[_0x5138('0x2d')][_0x5138('0x38')]){_0x106d26['where']=_['merge'](_0x106d26['where'],{'$or':_[_0x5138('0x28')](_0x47d046,function(_0x372484){if(_0x372484['type']!=='VIRTUAL'){var _0x24f8fb={};_0x24f8fb[_0x372484[_0x5138('0x26')]]={'$like':'%'+_0x57153e['query'][_0x5138('0x38')]+'%'};return _0x24f8fb;}})});}_0x106d26=_['merge']({},_0x106d26,_0x57153e[_0x5138('0x39')]);var _0x205de2={'where':_0x106d26[_0x5138('0x36')]};return db['JscriptySessionReport']['count'](_0x205de2)[_0x5138('0x24')](function(_0x1dca24){_0xd851e6['count']=_0x1dca24;if(_0x57153e[_0x5138('0x2d')][_0x5138('0x3a')]){_0x106d26['include']=[{'all':!![]}];}return db[_0x5138('0x29')][_0x5138('0x3b')](_0x106d26);})[_0x5138('0x24')](function(_0x5ca5fd){_0xd851e6[_0x5138('0x3c')]=_0x5ca5fd;return _0xd851e6;})[_0x5138('0x24')](respondWithFilteredResult(_0xcf99bd,_0x106d26))[_0x5138('0x3d')](handleError(_0xcf99bd,null));};exports['show']=function(_0x5a1793,_0x592c59){var _0x282449={'raw':!![],'where':{'id':_0x5a1793[_0x5138('0x3e')]['id']}},_0x5ec8ff={};_0x5ec8ff[_0x5138('0x2c')]=_[_0x5138('0x3f')](db[_0x5138('0x29')][_0x5138('0x2a')]);_0x5ec8ff[_0x5138('0x2d')]=_['keys'](_0x5a1793[_0x5138('0x2d')]);_0x5ec8ff['filters']=_['intersection'](_0x5ec8ff['model'],_0x5ec8ff[_0x5138('0x2d')]);_0x282449[_0x5138('0x31')]=_[_0x5138('0x2f')](_0x5ec8ff['model'],qs[_0x5138('0x30')](_0x5a1793[_0x5138('0x2d')]['fields']));_0x282449[_0x5138('0x31')]=_0x282449[_0x5138('0x31')]['length']?_0x282449['attributes']:_0x5ec8ff[_0x5138('0x2c')];if(_0x5a1793[_0x5138('0x2d')][_0x5138('0x3a')]){_0x282449[_0x5138('0x40')]=[{'all':!![]}];}_0x282449=_['merge']({},_0x282449,_0x5a1793['options']);return db[_0x5138('0x29')][_0x5138('0x41')](_0x282449)[_0x5138('0x24')](handleEntityNotFound(_0x592c59,null))[_0x5138('0x24')](respondWithResult(_0x592c59,null))[_0x5138('0x3d')](handleError(_0x592c59,null));};exports[_0x5138('0x42')]=function(_0x38f9c4,_0x518cba){return db[_0x5138('0x29')][_0x5138('0x42')](_0x38f9c4['body'],{})[_0x5138('0x24')](respondWithResult(_0x518cba,0xc9))[_0x5138('0x3d')](handleError(_0x518cba,null));};exports[_0x5138('0x23')]=function(_0x38109b,_0xa50bb6){if(_0x38109b[_0x5138('0x43')]['id']){delete _0x38109b[_0x5138('0x43')]['id'];}return db[_0x5138('0x29')][_0x5138('0x41')]({'where':{'id':_0x38109b[_0x5138('0x3e')]['id']}})[_0x5138('0x24')](handleEntityNotFound(_0xa50bb6,null))[_0x5138('0x24')](saveUpdates(_0x38109b[_0x5138('0x43')],null))[_0x5138('0x24')](respondWithResult(_0xa50bb6,null))['catch'](handleError(_0xa50bb6,null));};exports['destroy']=function(_0x253ce7,_0x5a66fe){return db[_0x5138('0x29')][_0x5138('0x41')]({'where':{'id':_0x253ce7[_0x5138('0x3e')]['id']}})[_0x5138('0x24')](handleEntityNotFound(_0x5a66fe,null))[_0x5138('0x24')](removeEntity(_0x5a66fe,null))[_0x5138('0x3d')](handleError(_0x5a66fe,null));};exports['describe']=function(_0x33777b,_0x4df13f){return db[_0x5138('0x29')][_0x5138('0x44')]()[_0x5138('0x24')](respondWithResult(_0x4df13f,null))[_0x5138('0x3d')](handleError(_0x4df13f,null));};exports[_0x5138('0x45')]=function(_0x37b879,_0x1f2236,_0x32349b){var _0x16b366={'raw':!![],'where':{}};var _0xdc3f26={};var _0x3caa7b={'count':0x0,'rows':[]};return db[_0x5138('0x29')][_0x5138('0x46')]({'where':{'id':_0x37b879[_0x5138('0x3e')]['id']}})[_0x5138('0x24')](handleEntityNotFound(_0x1f2236,null))[_0x5138('0x24')](function(_0x3d2cd4){if(_0x3d2cd4){_0xdc3f26[_0x5138('0x2c')]=_['keys'](db[_0x5138('0x47')]['rawAttributes']);_0xdc3f26[_0x5138('0x2d')]=_[_0x5138('0x3f')](_0x37b879['query']);_0xdc3f26[_0x5138('0x2e')]=_['intersection'](_0xdc3f26[_0x5138('0x2c')],_0xdc3f26[_0x5138('0x2d')]);_0x16b366[_0x5138('0x31')]=_['intersection'](_0xdc3f26[_0x5138('0x2c')],qs[_0x5138('0x30')](_0x37b879[_0x5138('0x2d')][_0x5138('0x30')]));_0x16b366[_0x5138('0x31')]=_0x16b366[_0x5138('0x31')][_0x5138('0x32')]?_0x16b366[_0x5138('0x31')]:_0xdc3f26[_0x5138('0x2c')];if(!_0x37b879['query']['hasOwnProperty'](_0x5138('0x34'))){_0x16b366[_0x5138('0x1d')]=qs[_0x5138('0x1d')](_0x37b879['query'][_0x5138('0x1d')]);_0x16b366[_0x5138('0x1c')]=qs[_0x5138('0x1c')](_0x37b879['query'][_0x5138('0x1c')]);}_0x16b366[_0x5138('0x48')]=qs[_0x5138('0x35')](_0x37b879[_0x5138('0x2d')][_0x5138('0x35')]);_0x16b366[_0x5138('0x36')]=qs['filters'](_['pick'](_0x37b879['query'],_0xdc3f26[_0x5138('0x2e')]));_0x16b366[_0x5138('0x36')][_0x5138('0x49')]=_0x3d2cd4['id'];if(_0x37b879[_0x5138('0x2d')]['filter']){_0x16b366[_0x5138('0x36')]=_[_0x5138('0x4a')](_0x16b366[_0x5138('0x36')],{'$or':_[_0x5138('0x28')](_0x16b366[_0x5138('0x31')],function(_0x554403){var _0x50ce83={};_0x50ce83[_0x554403]={'$like':'%'+_0x37b879[_0x5138('0x2d')]['filter']+'%'};return _0x50ce83;})});}_0x16b366=_[_0x5138('0x4a')]({},_0x16b366,_0x37b879[_0x5138('0x39')]);return db[_0x5138('0x47')][_0x5138('0x1b')]({'where':_0x16b366[_0x5138('0x36')]})[_0x5138('0x24')](function(_0x59693e){_0x3caa7b[_0x5138('0x1b')]=_0x59693e;if(_0x37b879['query'][_0x5138('0x3a')]){_0x16b366[_0x5138('0x40')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x5138('0x3b')](_0x16b366);})['then'](function(_0x330183){_0x3caa7b[_0x5138('0x3c')]=_0x330183;return _0x3caa7b;});}})[_0x5138('0x24')](respondWithFilteredResult(_0x1f2236,_0x16b366))[_0x5138('0x3d')](handleError(_0x1f2236,null));}; \ No newline at end of file +var _0x4470=['map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','length','options','find','create','body','destroy','describe','findOne','SessionId','JscriptyQuestionReport','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','error','stack','name','send','index'];(function(_0x49485c,_0x591466){var _0x5c0ce7=function(_0xd0c298){while(--_0xd0c298){_0x49485c['push'](_0x49485c['shift']());}};_0x5c0ce7(++_0x591466);}(_0x4470,0x78));var _0x0447=function(_0x1cbcf1,_0x3f9fd9){_0x1cbcf1=_0x1cbcf1-0x0;var _0x3a06f0=_0x4470[_0x1cbcf1];return _0x3a06f0;};'use strict';var emlformat=require(_0x0447('0x0'));var rimraf=require(_0x0447('0x1'));var zipdir=require(_0x0447('0x2'));var jsonpatch=require(_0x0447('0x3'));var rp=require(_0x0447('0x4'));var moment=require(_0x0447('0x5'));var BPromise=require(_0x0447('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0447('0x7'));var sox=require(_0x0447('0x8'));var csv=require(_0x0447('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0447('0xa'));var _=require(_0x0447('0xb'));var squel=require(_0x0447('0xc'));var crypto=require(_0x0447('0xd'));var jsforce=require(_0x0447('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0447('0x9'));var querystring=require('querystring');var Papa=require(_0x0447('0xf'));var Redis=require(_0x0447('0x10'));var authService=require(_0x0447('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0447('0x12'));var hardwareService=require(_0x0447('0x13'));var logger=require('../../config/logger')(_0x0447('0x14'));var utils=require('../../config/utils');var config=require(_0x0447('0x15'));var licenseUtil=require(_0x0447('0x16'));var db=require(_0x0447('0x17'))['db'];function respondWithStatusCode(_0x242230,_0x335848){_0x335848=_0x335848||0xcc;return function(_0xf322a9){if(_0xf322a9){return _0x242230[_0x0447('0x18')](_0x335848);}return _0x242230[_0x0447('0x19')](_0x335848)[_0x0447('0x1a')]();};}function respondWithResult(_0x2b5dd5,_0x1307f4){_0x1307f4=_0x1307f4||0xc8;return function(_0x3df846){if(_0x3df846){return _0x2b5dd5[_0x0447('0x19')](_0x1307f4)[_0x0447('0x1b')](_0x3df846);}};}function respondWithFilteredResult(_0x1631e0,_0x5dbced){return function(_0x4c425c){if(_0x4c425c){var _0x50b657=typeof _0x5dbced[_0x0447('0x1c')]===_0x0447('0x1d')&&typeof _0x5dbced['limit']===_0x0447('0x1d');var _0x34a217=_0x4c425c[_0x0447('0x1e')];var _0xfa5cd6=_0x50b657?0x0:_0x5dbced['offset'];var _0x250fed=_0x50b657?_0x4c425c[_0x0447('0x1e')]:_0x5dbced[_0x0447('0x1c')]+_0x5dbced[_0x0447('0x1f')];var _0x5f24b8;if(_0x250fed>=_0x34a217){_0x250fed=_0x34a217;_0x5f24b8=0xc8;}else{_0x5f24b8=0xce;}_0x1631e0['status'](_0x5f24b8);return _0x1631e0['set']('Content-Range',_0xfa5cd6+'-'+_0x250fed+'/'+_0x34a217)[_0x0447('0x1b')](_0x4c425c);}return null;};}function patchUpdates(_0x93dfb2){return function(_0x50e630){try{jsonpatch[_0x0447('0x20')](_0x50e630,_0x93dfb2,!![]);}catch(_0x82c9f){return BPromise[_0x0447('0x21')](_0x82c9f);}return _0x50e630[_0x0447('0x22')]();};}function saveUpdates(_0x451a74,_0x86835f){return function(_0x29ed95){if(_0x29ed95){return _0x29ed95[_0x0447('0x23')](_0x451a74)[_0x0447('0x24')](function(_0x14561d){return _0x14561d;});}return null;};}function removeEntity(_0x435ceb,_0x58cc4e){return function(_0x461b58){if(_0x461b58){return _0x461b58['destroy']()['then'](function(){_0x435ceb[_0x0447('0x19')](0xcc)[_0x0447('0x1a')]();});}};}function handleEntityNotFound(_0x1c8057,_0x2fbd18){return function(_0x563e53){if(!_0x563e53){_0x1c8057[_0x0447('0x18')](0x194);}return _0x563e53;};}function handleError(_0x10fee9,_0x2ff541){_0x2ff541=_0x2ff541||0x1f4;return function(_0x18d824){logger[_0x0447('0x25')](_0x18d824[_0x0447('0x26')]);if(_0x18d824[_0x0447('0x27')]){delete _0x18d824[_0x0447('0x27')];}_0x10fee9['status'](_0x2ff541)[_0x0447('0x28')](_0x18d824);};}exports[_0x0447('0x29')]=function(_0x13ede1,_0x1a0248){var _0xd7f0ee={},_0x5c6f1e={},_0x12f841={'count':0x0,'rows':[]};var _0x2c04c6=_[_0x0447('0x2a')](db[_0x0447('0x2b')][_0x0447('0x2c')],function(_0x5e358d){return{'name':_0x5e358d[_0x0447('0x2d')],'type':_0x5e358d[_0x0447('0x2e')][_0x0447('0x2f')]};});_0x5c6f1e[_0x0447('0x30')]=_['map'](_0x2c04c6,_0x0447('0x27'));_0x5c6f1e['query']=_[_0x0447('0x31')](_0x13ede1[_0x0447('0x32')]);_0x5c6f1e[_0x0447('0x33')]=_[_0x0447('0x34')](_0x5c6f1e[_0x0447('0x30')],_0x5c6f1e[_0x0447('0x32')]);_0xd7f0ee[_0x0447('0x35')]=_['intersection'](_0x5c6f1e[_0x0447('0x30')],qs[_0x0447('0x36')](_0x13ede1['query']['fields']));_0xd7f0ee[_0x0447('0x35')]=_0xd7f0ee[_0x0447('0x35')]['length']?_0xd7f0ee['attributes']:_0x5c6f1e[_0x0447('0x30')];if(!_0x13ede1[_0x0447('0x32')][_0x0447('0x37')](_0x0447('0x38'))){_0xd7f0ee[_0x0447('0x1f')]=qs[_0x0447('0x1f')](_0x13ede1['query'][_0x0447('0x1f')]);_0xd7f0ee[_0x0447('0x1c')]=qs[_0x0447('0x1c')](_0x13ede1[_0x0447('0x32')][_0x0447('0x1c')]);}_0xd7f0ee[_0x0447('0x39')]=qs[_0x0447('0x3a')](_0x13ede1['query'][_0x0447('0x3a')]);_0xd7f0ee[_0x0447('0x3b')]=qs[_0x0447('0x33')](_[_0x0447('0x3c')](_0x13ede1[_0x0447('0x32')],_0x5c6f1e[_0x0447('0x33')]),_0x2c04c6);if(_0x13ede1[_0x0447('0x32')]['filter']){_0xd7f0ee[_0x0447('0x3b')]=_[_0x0447('0x3d')](_0xd7f0ee[_0x0447('0x3b')],{'$or':_[_0x0447('0x2a')](_0x2c04c6,function(_0x2fa6c5){if(_0x2fa6c5[_0x0447('0x2e')]!==_0x0447('0x3e')){var _0x35346e={};_0x35346e[_0x2fa6c5[_0x0447('0x27')]]={'$like':'%'+_0x13ede1[_0x0447('0x32')][_0x0447('0x3f')]+'%'};return _0x35346e;}})});}_0xd7f0ee=_['merge']({},_0xd7f0ee,_0x13ede1['options']);var _0x1e7553={'where':_0xd7f0ee[_0x0447('0x3b')]};return db[_0x0447('0x2b')][_0x0447('0x1e')](_0x1e7553)[_0x0447('0x24')](function(_0x1dead2){_0x12f841[_0x0447('0x1e')]=_0x1dead2;if(_0x13ede1[_0x0447('0x32')][_0x0447('0x40')]){_0xd7f0ee[_0x0447('0x41')]=[{'all':!![]}];}return db[_0x0447('0x2b')][_0x0447('0x42')](_0xd7f0ee);})[_0x0447('0x24')](function(_0x278c26){_0x12f841['rows']=_0x278c26;return _0x12f841;})[_0x0447('0x24')](respondWithFilteredResult(_0x1a0248,_0xd7f0ee))[_0x0447('0x43')](handleError(_0x1a0248,null));};exports[_0x0447('0x44')]=function(_0x24edd3,_0x3ca8f7){var _0x1362bd={'raw':!![],'where':{'id':_0x24edd3[_0x0447('0x45')]['id']}},_0x234b71={};_0x234b71[_0x0447('0x30')]=_[_0x0447('0x31')](db['JscriptySessionReport'][_0x0447('0x2c')]);_0x234b71[_0x0447('0x32')]=_[_0x0447('0x31')](_0x24edd3[_0x0447('0x32')]);_0x234b71[_0x0447('0x33')]=_['intersection'](_0x234b71['model'],_0x234b71[_0x0447('0x32')]);_0x1362bd[_0x0447('0x35')]=_['intersection'](_0x234b71[_0x0447('0x30')],qs[_0x0447('0x36')](_0x24edd3[_0x0447('0x32')][_0x0447('0x36')]));_0x1362bd[_0x0447('0x35')]=_0x1362bd['attributes'][_0x0447('0x46')]?_0x1362bd[_0x0447('0x35')]:_0x234b71[_0x0447('0x30')];if(_0x24edd3[_0x0447('0x32')][_0x0447('0x40')]){_0x1362bd[_0x0447('0x41')]=[{'all':!![]}];}_0x1362bd=_[_0x0447('0x3d')]({},_0x1362bd,_0x24edd3[_0x0447('0x47')]);return db[_0x0447('0x2b')][_0x0447('0x48')](_0x1362bd)[_0x0447('0x24')](handleEntityNotFound(_0x3ca8f7,null))[_0x0447('0x24')](respondWithResult(_0x3ca8f7,null))[_0x0447('0x43')](handleError(_0x3ca8f7,null));};exports[_0x0447('0x49')]=function(_0x247761,_0x502c2e){return db[_0x0447('0x2b')][_0x0447('0x49')](_0x247761[_0x0447('0x4a')],{})['then'](respondWithResult(_0x502c2e,0xc9))[_0x0447('0x43')](handleError(_0x502c2e,null));};exports[_0x0447('0x23')]=function(_0x5ecb22,_0x147ede){if(_0x5ecb22[_0x0447('0x4a')]['id']){delete _0x5ecb22[_0x0447('0x4a')]['id'];}return db[_0x0447('0x2b')][_0x0447('0x48')]({'where':{'id':_0x5ecb22[_0x0447('0x45')]['id']}})[_0x0447('0x24')](handleEntityNotFound(_0x147ede,null))[_0x0447('0x24')](saveUpdates(_0x5ecb22[_0x0447('0x4a')],null))[_0x0447('0x24')](respondWithResult(_0x147ede,null))[_0x0447('0x43')](handleError(_0x147ede,null));};exports[_0x0447('0x4b')]=function(_0x2a3b40,_0x436359){return db[_0x0447('0x2b')][_0x0447('0x48')]({'where':{'id':_0x2a3b40[_0x0447('0x45')]['id']}})[_0x0447('0x24')](handleEntityNotFound(_0x436359,null))[_0x0447('0x24')](removeEntity(_0x436359,null))[_0x0447('0x43')](handleError(_0x436359,null));};exports[_0x0447('0x4c')]=function(_0x496275,_0x215f14){return db[_0x0447('0x2b')][_0x0447('0x4c')]()[_0x0447('0x24')](respondWithResult(_0x215f14,null))[_0x0447('0x43')](handleError(_0x215f14,null));};exports['getQuestions']=function(_0x4069a5,_0x254b7d,_0x3bbe52){var _0x5c1a14={'raw':!![],'where':{}};var _0xa250a4={};var _0x3e14d4={'count':0x0,'rows':[]};return db[_0x0447('0x2b')][_0x0447('0x4d')]({'where':{'id':_0x4069a5[_0x0447('0x45')]['id']}})[_0x0447('0x24')](handleEntityNotFound(_0x254b7d,null))['then'](function(_0x447599){if(_0x447599){_0xa250a4[_0x0447('0x30')]=_[_0x0447('0x31')](db['JscriptyQuestionReport'][_0x0447('0x2c')]);_0xa250a4[_0x0447('0x32')]=_['keys'](_0x4069a5[_0x0447('0x32')]);_0xa250a4['filters']=_['intersection'](_0xa250a4[_0x0447('0x30')],_0xa250a4['query']);_0x5c1a14['attributes']=_['intersection'](_0xa250a4['model'],qs[_0x0447('0x36')](_0x4069a5[_0x0447('0x32')]['fields']));_0x5c1a14['attributes']=_0x5c1a14[_0x0447('0x35')]['length']?_0x5c1a14['attributes']:_0xa250a4[_0x0447('0x30')];if(!_0x4069a5['query'][_0x0447('0x37')](_0x0447('0x38'))){_0x5c1a14[_0x0447('0x1f')]=qs[_0x0447('0x1f')](_0x4069a5['query'][_0x0447('0x1f')]);_0x5c1a14[_0x0447('0x1c')]=qs['offset'](_0x4069a5['query']['offset']);}_0x5c1a14['order']=qs['sort'](_0x4069a5[_0x0447('0x32')]['sort']);_0x5c1a14['where']=qs[_0x0447('0x33')](_[_0x0447('0x3c')](_0x4069a5[_0x0447('0x32')],_0xa250a4['filters']));_0x5c1a14[_0x0447('0x3b')][_0x0447('0x4e')]=_0x447599['id'];if(_0x4069a5[_0x0447('0x32')][_0x0447('0x3f')]){_0x5c1a14[_0x0447('0x3b')]=_[_0x0447('0x3d')](_0x5c1a14[_0x0447('0x3b')],{'$or':_[_0x0447('0x2a')](_0x5c1a14[_0x0447('0x35')],function(_0x3c038c){var _0xb872e4={};_0xb872e4[_0x3c038c]={'$like':'%'+_0x4069a5[_0x0447('0x32')][_0x0447('0x3f')]+'%'};return _0xb872e4;})});}_0x5c1a14=_[_0x0447('0x3d')]({},_0x5c1a14,_0x4069a5[_0x0447('0x47')]);return db[_0x0447('0x4f')]['count']({'where':_0x5c1a14[_0x0447('0x3b')]})['then'](function(_0x2ef73f){_0x3e14d4[_0x0447('0x1e')]=_0x2ef73f;if(_0x4069a5[_0x0447('0x32')][_0x0447('0x40')]){_0x5c1a14['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x0447('0x42')](_0x5c1a14);})['then'](function(_0x1c6860){_0x3e14d4[_0x0447('0x50')]=_0x1c6860;return _0x3e14d4;});}})[_0x0447('0x24')](respondWithFilteredResult(_0x254b7d,_0x5c1a14))[_0x0447('0x43')](handleError(_0x254b7d,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 2769d79..67119eb 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 _0x53ec=['bluebird','path','../../config/environment','./jscriptySessionReport.attributes','define','JscriptySessionReport','lodash','util','../../config/logger','api','moment'];(function(_0xf4a07c,_0x137274){var _0x561755=function(_0x1592f1){while(--_0x1592f1){_0xf4a07c['push'](_0xf4a07c['shift']());}};_0x561755(++_0x137274);}(_0x53ec,0x192));var _0xc53e=function(_0x2ecbfd,_0x5bacbc){_0x2ecbfd=_0x2ecbfd-0x0;var _0x2c65a2=_0x53ec[_0x2ecbfd];return _0x2c65a2;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa46e=['api','moment','bluebird','path','../../config/environment','exports','define','report_jscripty_sessions','lodash','util'];(function(_0x270adf,_0x1daaa3){var _0x29eda9=function(_0x40afec){while(--_0x40afec){_0x270adf['push'](_0x270adf['shift']());}};_0x29eda9(++_0x1daaa3);}(_0xa46e,0x8a));var _0xea46=function(_0x4358f5,_0x5b1ac6){_0x4358f5=_0x4358f5-0x0;var _0x4d8104=_0xa46e[_0x4358f5];return _0x4d8104;};'use strict';var _=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var logger=require('../../config/logger')(_0xea46('0x2'));var moment=require(_0xea46('0x3'));var BPromise=require(_0xea46('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea46('0x5'));var rimraf=require('rimraf');var config=require(_0xea46('0x6'));var attributes=require('./jscriptySessionReport.attributes');module[_0xea46('0x7')]=function(_0x528404,_0x10bee5){return _0x528404[_0xea46('0x8')]('JscriptySessionReport',attributes,{'tableName':_0xea46('0x9'),'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 b333db7..247ecec 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 _0x4745=['debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent'];(function(_0x24fea2,_0x4c611e){var _0x4cf1f1=function(_0x2a8d81){while(--_0x2a8d81){_0x24fea2['push'](_0x24fea2['shift']());}};_0x4cf1f1(++_0x4c611e);}(_0x4745,0x1e7));var _0x5474=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x4745[_0x521929];return _0x632436;};'use strict';var _=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var moment=require(_0x5474('0x2'));var BPromise=require(_0x5474('0x3'));var rs=require(_0x5474('0x4'));var fs=require('fs');var Redis=require(_0x5474('0x5'));var db=require(_0x5474('0x6'))['db'];var utils=require(_0x5474('0x7'));var logger=require(_0x5474('0x8'))(_0x5474('0x9'));var config=require(_0x5474('0xa'));var jayson=require(_0x5474('0xb'));var client=jayson['client'][_0x5474('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x431f81,_0x57add7,_0x13929f){return new BPromise(function(_0x5d778b,_0x902ba8){return client[_0x5474('0xd')](_0x431f81,_0x13929f)['then'](function(_0xf876f8){logger[_0x5474('0xe')](_0x5474('0xf'),_0x57add7,_0x5474('0x10'));logger[_0x5474('0x11')](_0x5474('0x12'),_0x57add7,_0x5474('0x10'),JSON[_0x5474('0x13')](_0xf876f8));if(_0xf876f8['error']){if(_0xf876f8[_0x5474('0x14')][_0x5474('0x15')]===0x1f4){logger[_0x5474('0x14')](_0x5474('0xf'),_0x57add7,_0xf876f8[_0x5474('0x14')][_0x5474('0x16')]);return _0x902ba8(_0xf876f8[_0x5474('0x14')][_0x5474('0x16')]);}logger[_0x5474('0x14')]('JscriptySessionReport,\x20%s,\x20%s',_0x57add7,_0xf876f8[_0x5474('0x14')][_0x5474('0x16')]);return _0x5d778b(_0xf876f8[_0x5474('0x14')][_0x5474('0x16')]);}else{logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x57add7,'request\x20sent');_0x5d778b(_0xf876f8['result'][_0x5474('0x16')]);}})[_0x5474('0x17')](function(_0x2da774){logger['error'](_0x5474('0xf'),_0x57add7,_0x2da774);_0x902ba8(_0x2da774);});});} \ No newline at end of file +var _0x9f0e=['../../config/environment','jayson/promise','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x193b69,_0x1c2128){var _0x296731=function(_0x220c9c){while(--_0x220c9c){_0x193b69['push'](_0x193b69['shift']());}};_0x296731(++_0x1c2128);}(_0x9f0e,0x116));var _0xe9f0=function(_0x4854c7,_0x2d2f3c){_0x4854c7=_0x4854c7-0x0;var _0x6258e6=_0x9f0e[_0x4854c7];return _0x6258e6;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var moment=require(_0xe9f0('0x2'));var BPromise=require(_0xe9f0('0x3'));var rs=require(_0xe9f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9f0('0x5'));var logger=require(_0xe9f0('0x6'))(_0xe9f0('0x7'));var config=require(_0xe9f0('0x8'));var jayson=require(_0xe9f0('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a17b3,_0x167198,_0xe64a79){return new BPromise(function(_0x4be6a6,_0xf4a256){return client[_0xe9f0('0xa')](_0x3a17b3,_0xe64a79)[_0xe9f0('0xb')](function(_0x3386a8){logger[_0xe9f0('0xc')](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));logger[_0xe9f0('0xf')](_0xe9f0('0x10'),_0x167198,'request\x20sent',JSON[_0xe9f0('0x11')](_0x3386a8));if(_0x3386a8[_0xe9f0('0x12')]){if(_0x3386a8[_0xe9f0('0x12')]['code']===0x1f4){logger[_0xe9f0('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0x167198,_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);return _0xf4a256(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}logger['error'](_0xe9f0('0xd'),_0x167198,_0x3386a8['error'][_0xe9f0('0x13')]);return _0x4be6a6(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}else{logger['info'](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));_0x4be6a6(_0x3386a8[_0xe9f0('0x14')]['message']);}})[_0xe9f0('0x15')](function(_0x1e16e0){logger[_0xe9f0('0x12')](_0xe9f0('0xd'),_0x167198,_0x1e16e0);_0xf4a256(_0x1e16e0);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 5fcf2f9..995190b 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 _0xfa0b=['multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./license.controller','get','put','/:id','isAuthenticated','update','exports'];(function(_0x1c6039,_0x3759ee){var _0x437f23=function(_0x4ab150){while(--_0x4ab150){_0x1c6039['push'](_0x1c6039['shift']());}};_0x437f23(++_0x3759ee);}(_0xfa0b,0x138));var _0xbfa0=function(_0x3c3b01,_0xbaa847){_0x3c3b01=_0x3c3b01-0x0;var _0xda6617=_0xfa0b[_0x3c3b01];return _0xda6617;};'use strict';var multer=require(_0xbfa0('0x0'));var util=require('util');var path=require(_0xbfa0('0x1'));var timeout=require('connect-timeout');var express=require(_0xbfa0('0x2'));var router=express['Router']();var fs_extra=require(_0xbfa0('0x3'));var auth=require(_0xbfa0('0x4'));var interaction=require(_0xbfa0('0x5'));var config=require('../../config/environment');var controller=require(_0xbfa0('0x6'));router[_0xbfa0('0x7')]('/',controller['index']);router[_0xbfa0('0x8')](_0xbfa0('0x9'),auth[_0xbfa0('0xa')](),controller[_0xbfa0('0xb')]);router[_0xbfa0('0x7')]('/download_log_file',auth[_0xbfa0('0xa')](),controller['downloadLogFile']);module[_0xbfa0('0xc')]=router; \ No newline at end of file +var _0x03f4=['/download_log_file','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./license.controller','get','update'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0x03f4,0x13a));var _0x403f=function(_0x40b27b,_0x15bfde){_0x40b27b=_0x40b27b-0x0;var _0x2abdb1=_0x03f4[_0x40b27b];return _0x2abdb1;};'use strict';var multer=require(_0x403f('0x0'));var util=require(_0x403f('0x1'));var path=require('path');var timeout=require(_0x403f('0x2'));var express=require(_0x403f('0x3'));var router=express[_0x403f('0x4')]();var fs_extra=require(_0x403f('0x5'));var auth=require(_0x403f('0x6'));var interaction=require(_0x403f('0x7'));var config=require('../../config/environment');var controller=require(_0x403f('0x8'));router[_0x403f('0x9')]('/',controller['index']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x403f('0xa')]);router['get'](_0x403f('0xb'),auth['isAuthenticated'](),controller['downloadLogFile']);module[_0x403f('0xc')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 4fdd50b..7e35b8d 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 _0x7e95=['TEXT','STRING','exports'];(function(_0x99cebd,_0x401a68){var _0x10cdf2=function(_0x32681c){while(--_0x32681c){_0x99cebd['push'](_0x99cebd['shift']());}};_0x10cdf2(++_0x401a68);}(_0x7e95,0xdd));var _0x57e9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7e95[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x57e9('0x0')]={'license':{'type':Sequelize[_0x57e9('0x1')]},'data1':{'type':Sequelize[_0x57e9('0x2')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x25af=['TEXT','STRING','INTEGER'];(function(_0x5ccd38,_0x34ceb7){var _0x2fffe5=function(_0x3e074f){while(--_0x3e074f){_0x5ccd38['push'](_0x5ccd38['shift']());}};_0x2fffe5(++_0x34ceb7);}(_0x25af,0x135));var _0xf25a=function(_0x3de828,_0x3c2d64){_0x3de828=_0x3de828-0x0;var _0x2d4827=_0x25af[_0x3de828];return _0x2d4827;};'use strict';var Sequelize=require('sequelize');module['exports']={'license':{'type':Sequelize[_0xf25a('0x0')]},'data1':{'type':Sequelize[_0xf25a('0x1')]},'data2':{'type':Sequelize[_0xf25a('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0xf25a('0x2')],'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 dc8e54f..e09e8b2 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 _0x7687=['name','send','index','model','rawAttributes','query','keys','filters','intersection','attributes','fields','merge','options','getLicense','catch','body','License','find','get','checkLicense','demo','downloadLogFile','license-info.log','join','log','xcally','attachment;\x20filename=','Content-Type','text/plain','download','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack'];(function(_0xd94e64,_0x5cd648){var _0x4d669e=function(_0x4a1987){while(--_0x4a1987){_0xd94e64['push'](_0xd94e64['shift']());}};_0x4d669e(++_0x5cd648);}(_0x7687,0xf3));var _0x7768=function(_0x400766,_0x368660){_0x400766=_0x400766-0x0;var _0x3ae58b=_0x7687[_0x400766];return _0x3ae58b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7768('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7768('0x1'));var rp=require(_0x7768('0x2'));var moment=require(_0x7768('0x3'));var BPromise=require(_0x7768('0x4'));var Mustache=require(_0x7768('0x5'));var util=require(_0x7768('0x6'));var path=require(_0x7768('0x7'));var sox=require(_0x7768('0x8'));var csv=require(_0x7768('0x9'));var ejs=require(_0x7768('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7768('0xb'));var jsforce=require(_0x7768('0xc'));var deskjs=require(_0x7768('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7768('0xe'));var Papa=require(_0x7768('0xf'));var Redis=require('ioredis');var authService=require(_0x7768('0x10'));var qs=require(_0x7768('0x11'));var as=require(_0x7768('0x12'));var hardwareService=require(_0x7768('0x13'));var logger=require(_0x7768('0x14'))(_0x7768('0x15'));var utils=require(_0x7768('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7768('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59265c,_0x53e20e){_0x53e20e=_0x53e20e||0xcc;return function(_0x43c9f4){if(_0x43c9f4){return _0x59265c[_0x7768('0x18')](_0x53e20e);}return _0x59265c['status'](_0x53e20e)[_0x7768('0x19')]();};}function respondWithResult(_0x5442b5,_0x2710a5){_0x2710a5=_0x2710a5||0xc8;return function(_0x296080){if(_0x296080){return _0x5442b5[_0x7768('0x1a')](_0x2710a5)[_0x7768('0x1b')](_0x296080);}};}function respondWithFilteredResult(_0xdc99a8,_0x128c59){return function(_0x1e24df){if(_0x1e24df){var _0x49b655=typeof _0x128c59['offset']==='undefined'&&typeof _0x128c59[_0x7768('0x1c')]===_0x7768('0x1d');var _0x14fba3=_0x1e24df[_0x7768('0x1e')];var _0x298d61=_0x49b655?0x0:_0x128c59['offset'];var _0x4f3b90=_0x49b655?_0x1e24df['count']:_0x128c59[_0x7768('0x1f')]+_0x128c59[_0x7768('0x1c')];var _0x8df5aa;if(_0x4f3b90>=_0x14fba3){_0x4f3b90=_0x14fba3;_0x8df5aa=0xc8;}else{_0x8df5aa=0xce;}_0xdc99a8[_0x7768('0x1a')](_0x8df5aa);return _0xdc99a8['set'](_0x7768('0x20'),_0x298d61+'-'+_0x4f3b90+'/'+_0x14fba3)['json'](_0x1e24df);}return null;};}function patchUpdates(_0x890477){return function(_0x29210c){try{jsonpatch[_0x7768('0x21')](_0x29210c,_0x890477,!![]);}catch(_0x42d46b){return BPromise[_0x7768('0x22')](_0x42d46b);}return _0x29210c[_0x7768('0x23')]();};}function saveUpdates(_0x44bab1,_0x4073a5){return function(_0x34446c){if(_0x34446c){return _0x34446c[_0x7768('0x24')](_0x44bab1)[_0x7768('0x25')](function(_0x201c0d){return _0x201c0d;});}return null;};}function removeEntity(_0x51b239,_0x1325fc){return function(_0x22eea3){if(_0x22eea3){return _0x22eea3[_0x7768('0x26')]()[_0x7768('0x25')](function(){_0x51b239['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a8204,_0x30ee5a){return function(_0x1dfb51){if(!_0x1dfb51){_0x3a8204[_0x7768('0x18')](0x194);}return _0x1dfb51;};}function handleError(_0x30e523,_0x2e9a48){_0x2e9a48=_0x2e9a48||0x1f4;return function(_0x296a8b){logger[_0x7768('0x27')](_0x296a8b[_0x7768('0x28')]);if(_0x296a8b[_0x7768('0x29')]){delete _0x296a8b['name'];}_0x30e523[_0x7768('0x1a')](_0x2e9a48)[_0x7768('0x2a')](_0x296a8b);};}var utilLicense=require(_0x7768('0x17'));exports[_0x7768('0x2b')]=function(_0x3b7637,_0x3e22f9){var _0x560514={'raw':!![],'where':{'id':0x1}},_0x22575d={};_0x22575d[_0x7768('0x2c')]=_['keys'](db['License'][_0x7768('0x2d')]);_0x22575d[_0x7768('0x2e')]=_[_0x7768('0x2f')](_0x3b7637[_0x7768('0x2e')]);_0x22575d[_0x7768('0x30')]=_[_0x7768('0x31')](_0x22575d['model'],_0x22575d['query']);_0x560514[_0x7768('0x32')]=_[_0x7768('0x31')](_0x22575d[_0x7768('0x2c')],qs['fields'](_0x3b7637[_0x7768('0x2e')][_0x7768('0x33')]));_0x560514[_0x7768('0x32')]=_0x560514[_0x7768('0x32')]['length']?_0x560514['attributes']:_0x22575d['model'];_0x560514=_[_0x7768('0x34')]({},_0x560514,_0x3b7637[_0x7768('0x35')]);return utilLicense[_0x7768('0x36')](_0x560514)[_0x7768('0x25')](respondWithResult(_0x3e22f9,null))[_0x7768('0x37')](handleError(_0x3e22f9,null));};exports[_0x7768('0x24')]=function(_0x16fc73,_0x4ef4f0){if(_0x16fc73[_0x7768('0x38')]['id']){delete _0x16fc73['body']['id'];}return db[_0x7768('0x39')][_0x7768('0x3a')]({'where':{'id':_0x16fc73['params']['id']}})[_0x7768('0x25')](handleEntityNotFound(_0x4ef4f0,null))[_0x7768('0x25')](function(_0x4d5295){var _0x2b7a31=_0x4d5295[_0x7768('0x3b')]({'plain':!![]});return utilLicense[_0x7768('0x3c')](_0x2b7a31,_0x16fc73['body']['key']);})[_0x7768('0x25')](function(_0xdcc6cb){if(!_0xdcc6cb[_0x7768('0x3d')]){return saveUpdates(_0x16fc73[_0x7768('0x38')],null);}return _0xdcc6cb;})[_0x7768('0x25')](respondWithResult(_0x4ef4f0,null))[_0x7768('0x37')](handleError(_0x4ef4f0,null));};exports[_0x7768('0x3e')]=function(_0x2530e5,_0x126b87){var _0x272464=_0x7768('0x3f');var _0x188e6c=path[_0x7768('0x40')]('/var',_0x7768('0x41'),_0x7768('0x42'),_0x272464);_0x126b87['setHeader']('Content-disposition',_0x7768('0x43')+_0x272464);_0x126b87['set'](_0x7768('0x44'),_0x7768('0x45'));_0x126b87[_0x7768('0x46')](_0x188e6c);}; \ No newline at end of file +var _0xf5f1=['fields','length','options','getLicense','body','find','params','checkLicense','key','demo','catch','license-info.log','/var','log','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','model','rawAttributes','keys','query','filters','intersection','attributes'];(function(_0x35aa90,_0x2a9cdb){var _0x329edd=function(_0x566609){while(--_0x566609){_0x35aa90['push'](_0x35aa90['shift']());}};_0x329edd(++_0x2a9cdb);}(_0xf5f1,0x17c));var _0x1f5f=function(_0x4dbf43,_0x3585f7){_0x4dbf43=_0x4dbf43-0x0;var _0x3bf82f=_0xf5f1[_0x4dbf43];return _0x3bf82f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1f5f('0x0'));var zipdir=require(_0x1f5f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1f5f('0x2'));var moment=require(_0x1f5f('0x3'));var BPromise=require(_0x1f5f('0x4'));var Mustache=require(_0x1f5f('0x5'));var util=require(_0x1f5f('0x6'));var path=require(_0x1f5f('0x7'));var sox=require(_0x1f5f('0x8'));var csv=require(_0x1f5f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1f5f('0xa'));var _=require('lodash');var squel=require(_0x1f5f('0xb'));var crypto=require(_0x1f5f('0xc'));var jsforce=require(_0x1f5f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1f5f('0x9'));var querystring=require('querystring');var Papa=require(_0x1f5f('0xe'));var Redis=require(_0x1f5f('0xf'));var authService=require(_0x1f5f('0x10'));var qs=require(_0x1f5f('0x11'));var as=require(_0x1f5f('0x12'));var hardwareService=require(_0x1f5f('0x13'));var logger=require(_0x1f5f('0x14'))(_0x1f5f('0x15'));var utils=require(_0x1f5f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1f5f('0x17'));var db=require(_0x1f5f('0x18'))['db'];function respondWithStatusCode(_0x14b71e,_0x3ab74d){_0x3ab74d=_0x3ab74d||0xcc;return function(_0x4f9b6a){if(_0x4f9b6a){return _0x14b71e[_0x1f5f('0x19')](_0x3ab74d);}return _0x14b71e['status'](_0x3ab74d)[_0x1f5f('0x1a')]();};}function respondWithResult(_0x8c3e5f,_0x4e0e20){_0x4e0e20=_0x4e0e20||0xc8;return function(_0x2542e7){if(_0x2542e7){return _0x8c3e5f[_0x1f5f('0x1b')](_0x4e0e20)[_0x1f5f('0x1c')](_0x2542e7);}};}function respondWithFilteredResult(_0x36dfd7,_0xce4dab){return function(_0x46ce1c){if(_0x46ce1c){var _0xfcd3b5=typeof _0xce4dab[_0x1f5f('0x1d')]===_0x1f5f('0x1e')&&typeof _0xce4dab[_0x1f5f('0x1f')]===_0x1f5f('0x1e');var _0x4f5d01=_0x46ce1c[_0x1f5f('0x20')];var _0x8dad45=_0xfcd3b5?0x0:_0xce4dab[_0x1f5f('0x1d')];var _0x428199=_0xfcd3b5?_0x46ce1c[_0x1f5f('0x20')]:_0xce4dab['offset']+_0xce4dab[_0x1f5f('0x1f')];var _0x3e1798;if(_0x428199>=_0x4f5d01){_0x428199=_0x4f5d01;_0x3e1798=0xc8;}else{_0x3e1798=0xce;}_0x36dfd7[_0x1f5f('0x1b')](_0x3e1798);return _0x36dfd7[_0x1f5f('0x21')](_0x1f5f('0x22'),_0x8dad45+'-'+_0x428199+'/'+_0x4f5d01)['json'](_0x46ce1c);}return null;};}function patchUpdates(_0x271928){return function(_0xc73ad4){try{jsonpatch[_0x1f5f('0x23')](_0xc73ad4,_0x271928,!![]);}catch(_0x4858ec){return BPromise[_0x1f5f('0x24')](_0x4858ec);}return _0xc73ad4[_0x1f5f('0x25')]();};}function saveUpdates(_0x786e78,_0x2b9833){return function(_0x4c7dd8){if(_0x4c7dd8){return _0x4c7dd8[_0x1f5f('0x26')](_0x786e78)[_0x1f5f('0x27')](function(_0x5658ab){return _0x5658ab;});}return null;};}function removeEntity(_0xe62e31,_0x5402ab){return function(_0x55428d){if(_0x55428d){return _0x55428d[_0x1f5f('0x28')]()[_0x1f5f('0x27')](function(){_0xe62e31[_0x1f5f('0x1b')](0xcc)[_0x1f5f('0x1a')]();});}};}function handleEntityNotFound(_0x385332,_0x36a996){return function(_0x1ee443){if(!_0x1ee443){_0x385332[_0x1f5f('0x19')](0x194);}return _0x1ee443;};}function handleError(_0x4f5570,_0x579297){_0x579297=_0x579297||0x1f4;return function(_0x32e0a6){logger[_0x1f5f('0x29')](_0x32e0a6[_0x1f5f('0x2a')]);if(_0x32e0a6[_0x1f5f('0x2b')]){delete _0x32e0a6[_0x1f5f('0x2b')];}_0x4f5570['status'](_0x579297)['send'](_0x32e0a6);};}var utilLicense=require(_0x1f5f('0x17'));exports[_0x1f5f('0x2c')]=function(_0x386e0d,_0x57fb36){var _0x3e9a47={'raw':!![],'where':{'id':0x1}},_0x4e006f={};_0x4e006f[_0x1f5f('0x2d')]=_['keys'](db['License'][_0x1f5f('0x2e')]);_0x4e006f['query']=_[_0x1f5f('0x2f')](_0x386e0d[_0x1f5f('0x30')]);_0x4e006f[_0x1f5f('0x31')]=_[_0x1f5f('0x32')](_0x4e006f[_0x1f5f('0x2d')],_0x4e006f[_0x1f5f('0x30')]);_0x3e9a47[_0x1f5f('0x33')]=_[_0x1f5f('0x32')](_0x4e006f[_0x1f5f('0x2d')],qs[_0x1f5f('0x34')](_0x386e0d[_0x1f5f('0x30')]['fields']));_0x3e9a47[_0x1f5f('0x33')]=_0x3e9a47[_0x1f5f('0x33')][_0x1f5f('0x35')]?_0x3e9a47[_0x1f5f('0x33')]:_0x4e006f['model'];_0x3e9a47=_['merge']({},_0x3e9a47,_0x386e0d[_0x1f5f('0x36')]);return utilLicense[_0x1f5f('0x37')](_0x3e9a47)[_0x1f5f('0x27')](respondWithResult(_0x57fb36,null))['catch'](handleError(_0x57fb36,null));};exports['update']=function(_0x20fdb9,_0x299f23){if(_0x20fdb9[_0x1f5f('0x38')]['id']){delete _0x20fdb9['body']['id'];}return db['License'][_0x1f5f('0x39')]({'where':{'id':_0x20fdb9[_0x1f5f('0x3a')]['id']}})[_0x1f5f('0x27')](handleEntityNotFound(_0x299f23,null))['then'](function(_0x55da92){var _0x32e142=_0x55da92['get']({'plain':!![]});return utilLicense[_0x1f5f('0x3b')](_0x32e142,_0x20fdb9[_0x1f5f('0x38')][_0x1f5f('0x3c')]);})[_0x1f5f('0x27')](function(_0x333c7c){if(!_0x333c7c[_0x1f5f('0x3d')]){return saveUpdates(_0x20fdb9[_0x1f5f('0x38')],null);}return _0x333c7c;})['then'](respondWithResult(_0x299f23,null))[_0x1f5f('0x3e')](handleError(_0x299f23,null));};exports['downloadLogFile']=function(_0x3892c3,_0x3e3345){var _0x5eae15=_0x1f5f('0x3f');var _0x5c8197=path['join'](_0x1f5f('0x40'),_0x1f5f('0x41'),'xcally',_0x5eae15);_0x3e3345[_0x1f5f('0x42')](_0x1f5f('0x43'),_0x1f5f('0x44')+_0x5eae15);_0x3e3345['set'](_0x1f5f('0x45'),_0x1f5f('0x46'));_0x3e3345[_0x1f5f('0x47')](_0x5c8197);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 2feb4f8..893c384 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 _0xf375=['path','rimraf','../../config/environment','define','License','license','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3599fc,_0x5455e8){var _0x5991c7=function(_0x82374f){while(--_0x82374f){_0x3599fc['push'](_0x3599fc['shift']());}};_0x5991c7(++_0x5455e8);}(_0xf375,0xc6));var _0x5f37=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf375[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x5f37('0x0'));var logger=require(_0x5f37('0x1'))(_0x5f37('0x2'));var moment=require(_0x5f37('0x3'));var BPromise=require(_0x5f37('0x4'));var rp=require(_0x5f37('0x5'));var fs=require('fs');var path=require(_0x5f37('0x6'));var rimraf=require(_0x5f37('0x7'));var config=require(_0x5f37('0x8'));var attributes=require('./license.attributes');module['exports']=function(_0x1d0e61,_0x4f37a0){return _0x1d0e61[_0x5f37('0x9')](_0x5f37('0xa'),attributes,{'tableName':_0x5f37('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b30=['request-promise','path','license','lodash','../../config/logger','api','moment','bluebird'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x6b30,0x19b));var _0x06b3=function(_0x57da06,_0x4c9d35){_0x57da06=_0x57da06-0x0;var _0x118c39=_0x6b30[_0x57da06];return _0x118c39;};'use strict';var _=require(_0x06b3('0x0'));var util=require('util');var logger=require(_0x06b3('0x1'))(_0x06b3('0x2'));var moment=require(_0x06b3('0x3'));var BPromise=require(_0x06b3('0x4'));var rp=require(_0x06b3('0x5'));var fs=require('fs');var path=require(_0x06b3('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./license.attributes');module['exports']=function(_0x4c00a6,_0x2a965e){return _0x4c00a6['define']('License',attributes,{'tableName':_0x06b3('0x7'),'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 76837e3..01ab73f 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 _0x44de=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x4b311c,_0x358ee2){var _0x1aebaa=function(_0x501f7e){while(--_0x501f7e){_0x4b311c['push'](_0x4b311c['shift']());}};_0x1aebaa(++_0x358ee2);}(_0x44de,0x93));var _0xe44d=function(_0x25cefb,_0x45c9d7){_0x25cefb=_0x25cefb-0x0;var _0xbceb4b=_0x44de[_0x25cefb];return _0xbceb4b;};'use strict';var _=require(_0xe44d('0x0'));var util=require(_0xe44d('0x1'));var moment=require('moment');var BPromise=require(_0xe44d('0x2'));var rs=require(_0xe44d('0x3'));var fs=require('fs');var Redis=require(_0xe44d('0x4'));var db=require(_0xe44d('0x5'))['db'];var utils=require(_0xe44d('0x6'));var logger=require(_0xe44d('0x7'))(_0xe44d('0x8'));var config=require(_0xe44d('0x9'));var jayson=require(_0xe44d('0xa'));var client=jayson[_0xe44d('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x75afe3,_0x3e4ce0,_0x49cfc3){return new BPromise(function(_0x1c40ce,_0x2f9f36){return client[_0xe44d('0xc')](_0x75afe3,_0x49cfc3)[_0xe44d('0xd')](function(_0x3501ba){logger[_0xe44d('0xe')](_0xe44d('0xf'),_0x3e4ce0,_0xe44d('0x10'));logger[_0xe44d('0x11')](_0xe44d('0x12'),_0x3e4ce0,'request\x20sent',JSON[_0xe44d('0x13')](_0x3501ba));if(_0x3501ba[_0xe44d('0x14')]){if(_0x3501ba[_0xe44d('0x14')][_0xe44d('0x15')]===0x1f4){logger['error'](_0xe44d('0xf'),_0x3e4ce0,_0x3501ba['error'][_0xe44d('0x16')]);return _0x2f9f36(_0x3501ba[_0xe44d('0x14')]['message']);}logger[_0xe44d('0x14')]('License,\x20%s,\x20%s',_0x3e4ce0,_0x3501ba['error'][_0xe44d('0x16')]);return _0x1c40ce(_0x3501ba['error'][_0xe44d('0x16')]);}else{logger['info'](_0xe44d('0xf'),_0x3e4ce0,_0xe44d('0x10'));_0x1c40ce(_0x3501ba[_0xe44d('0x17')][_0xe44d('0x16')]);}})[_0xe44d('0x18')](function(_0x593234){logger[_0xe44d('0x14')](_0xe44d('0xf'),_0x3e4ce0,_0x593234);_0x2f9f36(_0x593234);});});} \ No newline at end of file +var _0x5089=['http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x25dfc7,_0x39c8b1){var _0xafd3b7=function(_0x53a428){while(--_0x53a428){_0x25dfc7['push'](_0x25dfc7['shift']());}};_0xafd3b7(++_0x39c8b1);}(_0x5089,0xd4));var _0x9508=function(_0x2338fa,_0x80579a){_0x2338fa=_0x2338fa-0x0;var _0x42df9b=_0x5089[_0x2338fa];return _0x42df9b;};'use strict';var _=require('lodash');var util=require(_0x9508('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9508('0x1'));var fs=require('fs');var Redis=require(_0x9508('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x9508('0x3'));var logger=require(_0x9508('0x4'))(_0x9508('0x5'));var config=require(_0x9508('0x6'));var jayson=require(_0x9508('0x7'));var client=jayson['client'][_0x9508('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x591213,_0x3cc938,_0xe29ae6){return new BPromise(function(_0x321b2c,_0x47c0d9){return client[_0x9508('0x9')](_0x591213,_0xe29ae6)[_0x9508('0xa')](function(_0x13078c){logger[_0x9508('0xb')](_0x9508('0xc'),_0x3cc938,_0x9508('0xd'));logger[_0x9508('0xe')]('License,\x20%s,\x20%s,\x20%s',_0x3cc938,_0x9508('0xd'),JSON['stringify'](_0x13078c));if(_0x13078c[_0x9508('0xf')]){if(_0x13078c[_0x9508('0xf')][_0x9508('0x10')]===0x1f4){logger[_0x9508('0xf')](_0x9508('0xc'),_0x3cc938,_0x13078c[_0x9508('0xf')]['message']);return _0x47c0d9(_0x13078c[_0x9508('0xf')][_0x9508('0x11')]);}logger[_0x9508('0xf')](_0x9508('0xc'),_0x3cc938,_0x13078c['error'][_0x9508('0x11')]);return _0x321b2c(_0x13078c['error'][_0x9508('0x11')]);}else{logger[_0x9508('0xb')](_0x9508('0xc'),_0x3cc938,_0x9508('0xd'));_0x321b2c(_0x13078c[_0x9508('0x12')][_0x9508('0x11')]);}})[_0x9508('0x13')](function(_0x2dd830){logger[_0x9508('0xf')]('License,\x20%s,\x20%s',_0x3cc938,_0x2dd830);_0x47c0d9(_0x2dd830);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 682a288..a3c2525 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 _0x22d8=['addApplications','send','addAgents','put','update','removeDispositions','removeAnswers','removeImap','removeSmtp','delete','destroy','removeAgents','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','verifySmtp','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addImap','/:id/out_servers','addInteraction'];(function(_0x15ca05,_0x2b5b95){var _0x12f94a=function(_0x466688){while(--_0x466688){_0x15ca05['push'](_0x15ca05['shift']());}};_0x12f94a(++_0x2b5b95);}(_0x22d8,0x15d));var _0x822d=function(_0xeadb4,_0x19523a){_0xeadb4=_0xeadb4-0x0;var _0xe86888=_0x22d8[_0xeadb4];return _0xe86888;};'use strict';var multer=require(_0x822d('0x0'));var util=require(_0x822d('0x1'));var path=require('path');var timeout=require(_0x822d('0x2'));var express=require('express');var router=express[_0x822d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x822d('0x4'));var interaction=require(_0x822d('0x5'));var config=require('../../config/environment');var controller=require('./mailAccount.controller');router[_0x822d('0x6')]('/',auth[_0x822d('0x7')](),controller[_0x822d('0x8')]);router[_0x822d('0x6')](_0x822d('0x9'),auth[_0x822d('0x7')](),controller[_0x822d('0xa')]);router[_0x822d('0x6')](_0x822d('0xb'),auth['isAuthenticated'](),controller[_0x822d('0xc')]);router[_0x822d('0x6')](_0x822d('0xd'),auth[_0x822d('0x7')](),controller[_0x822d('0xe')]);router['get']('/:id/canned_answers',auth[_0x822d('0x7')](),controller[_0x822d('0xf')]);router[_0x822d('0x6')](_0x822d('0x10'),auth['isAuthenticated'](),controller[_0x822d('0x11')]);router['get']('/:id/out_servers',auth['isAuthenticated'](),controller[_0x822d('0x12')]);router[_0x822d('0x6')](_0x822d('0x13'),auth['isAuthenticated'](),controller[_0x822d('0x14')]);router[_0x822d('0x6')](_0x822d('0x15'),auth[_0x822d('0x7')](),controller[_0x822d('0x16')]);router['get'](_0x822d('0x17'),auth[_0x822d('0x7')](),controller[_0x822d('0x18')]);router[_0x822d('0x6')]('/:id/verify',auth[_0x822d('0x7')](),controller[_0x822d('0x19')]);router[_0x822d('0x6')](_0x822d('0x1a'),auth[_0x822d('0x7')](),controller[_0x822d('0x1b')]);router[_0x822d('0x1c')](_0x822d('0xd'),auth[_0x822d('0x7')](),controller[_0x822d('0x1d')]);router[_0x822d('0x1c')](_0x822d('0x1e'),auth['isAuthenticated'](),controller[_0x822d('0x1f')]);router[_0x822d('0x1c')]('/',auth['isAuthenticated'](),controller['create']);router[_0x822d('0x1c')](_0x822d('0x10'),auth[_0x822d('0x7')](),controller[_0x822d('0x20')]);router[_0x822d('0x1c')](_0x822d('0x21'),auth[_0x822d('0x7')](),controller['addSmtp']);router['post'](_0x822d('0x13'),auth[_0x822d('0x7')](),controller[_0x822d('0x22')]);router[_0x822d('0x1c')](_0x822d('0x15'),auth['isAuthenticated'](),controller[_0x822d('0x23')]);router['post']('/:id/send',auth[_0x822d('0x7')](),controller[_0x822d('0x24')]);router[_0x822d('0x1c')](_0x822d('0x1a'),auth[_0x822d('0x7')](),controller[_0x822d('0x25')]);router[_0x822d('0x26')](_0x822d('0xb'),auth[_0x822d('0x7')](),controller[_0x822d('0x27')]);router['delete']('/:id/dispositions',auth[_0x822d('0x7')](),controller[_0x822d('0x28')]);router['delete'](_0x822d('0x1e'),auth[_0x822d('0x7')](),controller[_0x822d('0x29')]);router['delete'](_0x822d('0x10'),auth[_0x822d('0x7')](),controller[_0x822d('0x2a')]);router['delete']('/:id/out_servers',auth[_0x822d('0x7')](),controller[_0x822d('0x2b')]);router[_0x822d('0x2c')](_0x822d('0xb'),auth[_0x822d('0x7')](),controller[_0x822d('0x2d')]);router['delete']('/:id/users',auth[_0x822d('0x7')](),controller[_0x822d('0x2e')]);module[_0x822d('0x2f')]=router; \ No newline at end of file +var _0x2808=['/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','addDisposition','/:id/canned_answers','post','addSmtp','addApplications','/:id/send','send','/:id','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','describe','show','/:id/dispositions','getDispositions','getAnswers'];(function(_0x2e35c8,_0x1eae2e){var _0x2431af=function(_0x4607f0){while(--_0x4607f0){_0x2e35c8['push'](_0x2e35c8['shift']());}};_0x2431af(++_0x1eae2e);}(_0x2808,0x1a9));var _0x8280=function(_0x58a50a,_0x686696){_0x58a50a=_0x58a50a-0x0;var _0x595e48=_0x2808[_0x58a50a];return _0x595e48;};'use strict';var multer=require(_0x8280('0x0'));var util=require(_0x8280('0x1'));var path=require(_0x8280('0x2'));var timeout=require(_0x8280('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8280('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8280('0x5'));var controller=require(_0x8280('0x6'));router[_0x8280('0x7')]('/',auth[_0x8280('0x8')](),controller[_0x8280('0x9')]);router[_0x8280('0x7')]('/describe',auth[_0x8280('0x8')](),controller[_0x8280('0xa')]);router[_0x8280('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x8280('0xb')]);router[_0x8280('0x7')](_0x8280('0xc'),auth[_0x8280('0x8')](),controller[_0x8280('0xd')]);router[_0x8280('0x7')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x8280('0xe')]);router[_0x8280('0x7')](_0x8280('0xf'),auth[_0x8280('0x8')](),controller[_0x8280('0x10')]);router[_0x8280('0x7')](_0x8280('0x11'),auth['isAuthenticated'](),controller[_0x8280('0x12')]);router[_0x8280('0x7')](_0x8280('0x13'),auth[_0x8280('0x8')](),controller[_0x8280('0x14')]);router[_0x8280('0x7')](_0x8280('0x15'),auth[_0x8280('0x8')](),controller[_0x8280('0x16')]);router[_0x8280('0x7')](_0x8280('0x17'),auth[_0x8280('0x8')](),controller[_0x8280('0x18')]);router['get'](_0x8280('0x19'),auth[_0x8280('0x8')](),controller[_0x8280('0x1a')]);router[_0x8280('0x7')](_0x8280('0x1b'),auth[_0x8280('0x8')](),controller['getAgents']);router['post']('/:id/dispositions',auth[_0x8280('0x8')](),controller[_0x8280('0x1c')]);router['post'](_0x8280('0x1d'),auth[_0x8280('0x8')](),controller['addAnswer']);router[_0x8280('0x1e')]('/',auth[_0x8280('0x8')](),controller['create']);router[_0x8280('0x1e')](_0x8280('0xf'),auth[_0x8280('0x8')](),controller['addImap']);router[_0x8280('0x1e')]('/:id/out_servers',auth[_0x8280('0x8')](),controller[_0x8280('0x1f')]);router['post']('/:id/interactions',auth[_0x8280('0x8')](),controller['addInteraction']);router[_0x8280('0x1e')](_0x8280('0x15'),auth[_0x8280('0x8')](),controller[_0x8280('0x20')]);router['post'](_0x8280('0x21'),auth[_0x8280('0x8')](),controller[_0x8280('0x22')]);router[_0x8280('0x1e')](_0x8280('0x1b'),auth[_0x8280('0x8')](),controller['addAgents']);router['put'](_0x8280('0x23'),auth[_0x8280('0x8')](),controller['update']);router[_0x8280('0x24')](_0x8280('0xc'),auth[_0x8280('0x8')](),controller[_0x8280('0x25')]);router[_0x8280('0x24')](_0x8280('0x1d'),auth[_0x8280('0x8')](),controller[_0x8280('0x26')]);router[_0x8280('0x24')](_0x8280('0xf'),auth[_0x8280('0x8')](),controller[_0x8280('0x27')]);router[_0x8280('0x24')]('/:id/out_servers',auth[_0x8280('0x8')](),controller[_0x8280('0x28')]);router['delete'](_0x8280('0x23'),auth[_0x8280('0x8')](),controller[_0x8280('0x29')]);router[_0x8280('0x24')]('/:id/users',auth['isAuthenticated'](),controller[_0x8280('0x2a')]);module[_0x8280('0x2b')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index c2e809f..4f5e76c 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 _0xb71f=['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','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','ENUM','hotmail','yahoo','outlook365','getDataValue','custom','provider','sequelize','exports','STRING','BOOLEAN'];(function(_0x57c83c,_0x1028c0){var _0x4ac758=function(_0x12a6b1){while(--_0x12a6b1){_0x57c83c['push'](_0x57c83c['shift']());}};_0x4ac758(++_0x1028c0);}(_0xb71f,0x81));var _0xfb71=function(_0x20aadb,_0x5a607a){_0x20aadb=_0x20aadb-0x0;var _0x520018=_0xb71f[_0x20aadb];return _0x520018;};'use strict';var Sequelize=require(_0xfb71('0x0'));module[_0xfb71('0x1')]={'description':{'type':Sequelize[_0xfb71('0x2')]},'name':{'type':Sequelize[_0xfb71('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xfb71('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xfb71('0x4')]},'markAsUnread':{'type':Sequelize[_0xfb71('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfb71('0x5')},'fontSize':{'type':Sequelize[_0xfb71('0x6')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xfb71('0x4')],'defaultValue':function(){return _0xfb71('0x7');}},'notificationSound':{'type':Sequelize[_0xfb71('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfb71('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfb71('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xfb71('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfb71('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfb71('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfb71('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xfb71('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x17c305){if(!_0x17c305)this['setDataValue'](_0xfb71('0x9'),null);this[_0xfb71('0xa')](_0xfb71('0xb'),_0x17c305);}},'provider':{'type':Sequelize[_0xfb71('0xc')]('gmail',_0xfb71('0xd'),_0xfb71('0xe'),_0xfb71('0xf')),'defaultValue':null,'get':function(){if(!this[_0xfb71('0x10')]('provider'))return _0xfb71('0x11');return this[_0xfb71('0x10')]('provider');},'set':function(_0x53e873){if(_0x53e873===_0xfb71('0x11'))_0x53e873=null;return this['setDataValue'](_0xfb71('0x12'),_0x53e873);}}}; \ No newline at end of file +var _0x836b=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','outlook365','provider','getDataValue','sequelize','exports','STRING','BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','TEXT'];(function(_0x94d262,_0x44d7df){var _0x1d1399=function(_0x5ce0bd){while(--_0x5ce0bd){_0x94d262['push'](_0x94d262['shift']());}};_0x1d1399(++_0x44d7df);}(_0x836b,0x1db));var _0xb836=function(_0x5035ed,_0x4df0d6){_0x5035ed=_0x5035ed-0x0;var _0x1eed97=_0x836b[_0x5035ed];return _0x1eed97;};'use strict';var Sequelize=require(_0xb836('0x0'));module[_0xb836('0x1')]={'description':{'type':Sequelize[_0xb836('0x2')]},'name':{'type':Sequelize[_0xb836('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xb836('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xb836('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xb836('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0xb836('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xb836('0x2')],'allowNull':![],'defaultValue':_0xb836('0x4')},'fontSize':{'type':Sequelize[_0xb836('0x5')](0x2)[_0xb836('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xb836('0x7')],'defaultValue':function(){return _0xb836('0x8');}},'notificationSound':{'type':Sequelize[_0xb836('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb836('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb836('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb836('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb836('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb836('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xb836('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xb836('0x3')],'defaultValue':![],'comment':_0xb836('0xa'),'set':function(_0x1624cc){if(!_0x1624cc)this[_0xb836('0xb')](_0xb836('0xc'),null);this[_0xb836('0xb')](_0xb836('0xd'),_0x1624cc);}},'provider':{'type':Sequelize[_0xb836('0xe')](_0xb836('0xf'),_0xb836('0x10'),_0xb836('0x11'),_0xb836('0x12')),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0xb836('0x13')))return'custom';return this[_0xb836('0x14')](_0xb836('0x13'));},'set':function(_0x2009fc){if(_0x2009fc==='custom')_0x2009fc=null;return this[_0xb836('0xb')](_0xb836('0x13'),_0x2009fc);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 42baa56..0687602 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 _0x2eb3=['Tag','Tags','color','tag','addApplications','sequelize','Transaction','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getMessages','MailMessage','$gte','YYYY-MM-DD\x20HH:mm:ss','true','CmList','List','Contacts','CloudProvider','from','format','%s\x20<%s>','email','attachments','join','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','defaults','messageId','attach','out','Interaction','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','./mailAccount.socket','register','jayson/promise','http','request','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','update','destroy','get','MailAccounts','stack','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','smtp.gmail.com','smtp.mail.yahoo.com','outlook365','Unknown\x20email\x20service\x20provider','user','username','password','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','pass','Imap','Smtp','index','MailServerIn','Pause','map','MailAccount','rawAttributes','fieldName','type','model','name','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','MailServerOut','mandatoryDispositionPause','include','find','body','provider','custom','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','getDispositions','removeDispositions','ids','CannedAnswer','getAnswers','findOne','removeAnswers','create','key','ListId','isNil','active','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','addInteraction','MailInteraction','omit','CmContact','User','internal'];(function(_0xf4f64d,_0x515c50){var _0x340989=function(_0x2d8626){while(--_0x2d8626){_0xf4f64d['push'](_0xf4f64d['shift']());}};_0x340989(++_0x515c50);}(_0x2eb3,0x1b7));var _0x32eb=function(_0x3cc9f7,_0x2e396b){_0x3cc9f7=_0x3cc9f7-0x0;var _0xcf5ef3=_0x2eb3[_0x3cc9f7];return _0xcf5ef3;};'use strict';var moment=require(_0x32eb('0x0'));var BPromise=require(_0x32eb('0x1'));var util=require(_0x32eb('0x2'));var path=require(_0x32eb('0x3'));var _=require(_0x32eb('0x4'));var juice=require('juice');var Redis=require(_0x32eb('0x5'));var qs=require(_0x32eb('0x6'));var logger=require(_0x32eb('0x7'))('api');var config=require(_0x32eb('0x8'));var db=require(_0x32eb('0x9'))['db'];config[_0x32eb('0xa')]=_['defaults'](config[_0x32eb('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x32eb('0xa')]));require(_0x32eb('0xb'))[_0x32eb('0xc')](socket);var jayson=require(_0x32eb('0xd'));var client=jayson['client'][_0x32eb('0xe')]({'port':0x232b});function respondWithRpcPromise(_0x21a9bb,_0x4eba41,_0x44efa0,_0x1610f8){return new BPromise(function(_0x239ea8,_0x2649d8){var _0x5b70c5=_0x1610f8||client;return _0x5b70c5[_0x32eb('0xf')](_0x21a9bb,_0x44efa0)[_0x32eb('0x10')](function(_0x4dd73a){logger[_0x32eb('0x11')](_0x32eb('0x12'),_0x4eba41,'request\x20sent');logger[_0x32eb('0x13')](_0x32eb('0x14'),_0x4eba41,_0x32eb('0x15'),JSON[_0x32eb('0x16')](_0x4dd73a));if(_0x4dd73a[_0x32eb('0x17')]){if(_0x4dd73a['error'][_0x32eb('0x18')]===0x1f4){logger[_0x32eb('0x17')]('MailAccount,\x20%s,\x20%s',_0x4eba41,_0x4dd73a[_0x32eb('0x17')][_0x32eb('0x19')]);return _0x2649d8(_0x4dd73a[_0x32eb('0x17')][_0x32eb('0x19')]);}logger[_0x32eb('0x17')](_0x32eb('0x12'),_0x4eba41,_0x4dd73a[_0x32eb('0x17')][_0x32eb('0x19')]);return _0x239ea8(_0x4dd73a['error']['message']);}else{logger['info'](_0x32eb('0x12'),_0x4eba41,_0x32eb('0x15'));_0x239ea8(_0x4dd73a[_0x32eb('0x1a')][_0x32eb('0x19')]);}})[_0x32eb('0x1b')](function(_0x3903cf){logger['error']('MailAccount,\x20%s,\x20%s',_0x4eba41,_0x3903cf);_0x2649d8(_0x3903cf);});});}function respondWithStatusCode(_0x409fd2,_0x29cfd1){_0x29cfd1=_0x29cfd1||0xcc;return function(_0x49451f){if(_0x49451f){return _0x409fd2[_0x32eb('0x1c')](_0x29cfd1);}return _0x409fd2[_0x32eb('0x1d')](_0x29cfd1)[_0x32eb('0x1e')]();};}function respondWithResult(_0x1cfa33,_0x51ac8e){_0x51ac8e=_0x51ac8e||0xc8;return function(_0x1a6755){if(_0x1a6755){return _0x1cfa33[_0x32eb('0x1d')](_0x51ac8e)['json'](_0x1a6755);}};}function respondWithFilteredResult(_0x5e8ec9,_0xf8136c){return function(_0x4cfbb8){if(_0x4cfbb8){var _0xf399c2=typeof _0xf8136c[_0x32eb('0x1f')]===_0x32eb('0x20')&&typeof _0xf8136c['limit']===_0x32eb('0x20');var _0x36b7e2=_0x4cfbb8[_0x32eb('0x21')];var _0x347ae3=_0xf399c2?0x0:_0xf8136c[_0x32eb('0x1f')];var _0x1427ef=_0xf399c2?_0x4cfbb8['count']:_0xf8136c[_0x32eb('0x1f')]+_0xf8136c[_0x32eb('0x22')];var _0x3f3792;if(_0x1427ef>=_0x36b7e2){_0x1427ef=_0x36b7e2;_0x3f3792=0xc8;}else{_0x3f3792=0xce;}_0x5e8ec9[_0x32eb('0x1d')](_0x3f3792);return _0x5e8ec9[_0x32eb('0x23')](_0x32eb('0x24'),_0x347ae3+'-'+_0x1427ef+'/'+_0x36b7e2)[_0x32eb('0x25')](_0x4cfbb8);}return null;};}function saveUpdates(_0x14a7e3){return function(_0x4f39ba){if(_0x4f39ba){return _0x4f39ba[_0x32eb('0x26')](_0x14a7e3)[_0x32eb('0x10')](function(_0x1719ab){return _0x1719ab;});}return null;};}function removeEntity(_0x18ad90){return function(_0x4b5215){if(_0x4b5215){return _0x4b5215[_0x32eb('0x27')]()['then'](function(){var _0x271e30=_0x4b5215[_0x32eb('0x28')]({'plain':!![]});var _0x3fdd74=_0x32eb('0x29');return db['UserProfileResource'][_0x32eb('0x27')]({'where':{'type':_0x3fdd74,'resourceId':_0x271e30['id']}})['then'](function(){return _0x4b5215;});})[_0x32eb('0x10')](function(){_0x18ad90['status'](0xcc)[_0x32eb('0x1e')]();});}};}function handleEntityNotFound(_0x5f5a48){return function(_0x63fc4c){if(!_0x63fc4c){_0x5f5a48[_0x32eb('0x1c')](0x194);}return _0x63fc4c;};}function handleError(_0x3959aa,_0x38959a){_0x38959a=_0x38959a||0x1f4;return function(_0x5fbe42){logger[_0x32eb('0x17')](_0x5fbe42[_0x32eb('0x2a')]);if(_0x5fbe42['name']){delete _0x5fbe42['name'];}_0x3959aa['status'](_0x38959a)[_0x32eb('0x2b')](_0x5fbe42);};}function getImapHost(_0x48434e){switch(_0x48434e){case _0x32eb('0x2c'):return _0x32eb('0x2d');case _0x32eb('0x2e'):return _0x32eb('0x2f');case _0x32eb('0x30'):return _0x32eb('0x31');case'outlook365':return'outlook.office365.com';}throw new Error('Unknown\x20email\x20service\x20provider',_0x48434e);}function getSmtpHost(_0x58d808){switch(_0x58d808){case _0x32eb('0x2c'):return _0x32eb('0x32');case _0x32eb('0x2e'):return _0x32eb('0x33');case _0x32eb('0x30'):return'smtp-mail.outlook.com';case _0x32eb('0x34'):return'smtp.office365.com';}throw new Error(_0x32eb('0x35'),_0x58d808);}function getAuthenticationOptions(_0x78be05,_0x53107f){var _0x100d93={};var _0x5118cb={};if(_0x78be05){_0x100d93['user']=_0x5118cb[_0x32eb('0x36')]=_0x53107f[_0x32eb('0x37')];_0x100d93[_0x32eb('0x38')]=_0x5118cb['pass']=_0x53107f[_0x32eb('0x38')];if(_0x53107f[_0x32eb('0x39')]){_0x100d93[_0x32eb('0x39')]=_0x5118cb[_0x32eb('0x39')]=!![];_0x100d93[_0x32eb('0x3a')]=_0x5118cb[_0x32eb('0x3a')]=_0x53107f[_0x32eb('0x3a')];_0x100d93[_0x32eb('0x38')]=_0x5118cb['pass']=null;}else{_0x100d93[_0x32eb('0x3a')]=_0x5118cb['CloudProviderId']=null;}_0x100d93[_0x32eb('0x3b')]=getImapHost(_0x78be05);_0x100d93[_0x32eb('0x3c')]=0x3e1;_0x5118cb['host']=getSmtpHost(_0x78be05);_0x5118cb[_0x32eb('0x3c')]=0x24b;_0x5118cb[_0x32eb('0x3d')]=![];_0x100d93['service']=_0x5118cb[_0x32eb('0x3e')]=null;}else{if(_0x53107f[_0x32eb('0x3f')]){_0x100d93[_0x32eb('0x36')]=_0x5118cb[_0x32eb('0x36')]=_0x53107f['username'];_0x100d93['password']=_0x5118cb[_0x32eb('0x40')]=_0x53107f['password'];}else{_0x100d93['authentication']=_0x5118cb[_0x32eb('0x3f')]=![];_0x100d93['user']=_0x5118cb[_0x32eb('0x36')]=null;_0x100d93[_0x32eb('0x38')]=_0x5118cb[_0x32eb('0x40')]=null;}_0x100d93[_0x32eb('0x3b')]=_0x53107f[_0x32eb('0x41')][_0x32eb('0x3b')];_0x100d93[_0x32eb('0x3c')]=_0x53107f[_0x32eb('0x41')][_0x32eb('0x3c')];_0x5118cb[_0x32eb('0x3b')]=_0x53107f['Smtp'][_0x32eb('0x3b')];_0x5118cb['port']=_0x53107f[_0x32eb('0x42')][_0x32eb('0x3c')];}return{'Imap':_0x100d93,'Smtp':_0x5118cb};}exports[_0x32eb('0x43')]=function(_0x591bed,_0x36ae8b){var _0x124e53={'include':[{'model':db[_0x32eb('0x44')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x32eb('0x42')},{'model':db[_0x32eb('0x45')],'as':'mandatoryDispositionPause'}]},_0x41d82c={},_0x451535={'count':0x0,'rows':[]};var _0x57606b=_[_0x32eb('0x46')](db[_0x32eb('0x47')][_0x32eb('0x48')],function(_0x23a903){return{'name':_0x23a903[_0x32eb('0x49')],'type':_0x23a903[_0x32eb('0x4a')]['key']};});_0x41d82c[_0x32eb('0x4b')]=_[_0x32eb('0x46')](_0x57606b,_0x32eb('0x4c'));_0x41d82c['query']=_[_0x32eb('0x4d')](_0x591bed[_0x32eb('0x4e')]);_0x41d82c[_0x32eb('0x4f')]=_[_0x32eb('0x50')](_0x41d82c[_0x32eb('0x4b')],_0x41d82c[_0x32eb('0x4e')]);_0x124e53['attributes']=_[_0x32eb('0x50')](_0x41d82c['model'],qs[_0x32eb('0x51')](_0x591bed['query'][_0x32eb('0x51')]));_0x124e53['attributes']=_0x124e53[_0x32eb('0x52')][_0x32eb('0x53')]?_0x124e53[_0x32eb('0x52')]:_0x41d82c['model'];if(!_0x591bed[_0x32eb('0x4e')][_0x32eb('0x54')](_0x32eb('0x55'))){_0x124e53[_0x32eb('0x22')]=qs[_0x32eb('0x22')](_0x591bed[_0x32eb('0x4e')]['limit']);_0x124e53[_0x32eb('0x1f')]=qs['offset'](_0x591bed[_0x32eb('0x4e')][_0x32eb('0x1f')]);}_0x124e53[_0x32eb('0x56')]=qs[_0x32eb('0x57')](_0x591bed[_0x32eb('0x4e')][_0x32eb('0x57')]);_0x124e53['where']=qs[_0x32eb('0x4f')](_[_0x32eb('0x58')](_0x591bed['query'],_0x41d82c['filters']),_0x57606b);if(_0x591bed[_0x32eb('0x4e')][_0x32eb('0x59')]){_0x124e53[_0x32eb('0x5a')]=_[_0x32eb('0x5b')](_0x124e53['where'],{'$or':_[_0x32eb('0x46')](_0x57606b,function(_0x26bdef){if(_0x26bdef[_0x32eb('0x4a')]!==_0x32eb('0x5c')){var _0x5f3148={};_0x5f3148[_0x26bdef['name']]={'$like':'%'+_0x591bed['query'][_0x32eb('0x59')]+'%'};return _0x5f3148;}})});}_0x124e53=_[_0x32eb('0x5b')]({},_0x124e53,_0x591bed[_0x32eb('0x5d')]);var _0x24d2fd={'where':_0x124e53[_0x32eb('0x5a')]};return db[_0x32eb('0x47')][_0x32eb('0x21')](_0x24d2fd)[_0x32eb('0x10')](function(_0x492dcb){_0x451535[_0x32eb('0x21')]=_0x492dcb;if(_0x591bed[_0x32eb('0x4e')][_0x32eb('0x5e')]){_0x124e53['include']=[{'all':!![]}];}return db[_0x32eb('0x47')][_0x32eb('0x5f')](_0x124e53);})[_0x32eb('0x10')](function(_0x434051){_0x451535[_0x32eb('0x60')]=_0x434051;return _0x451535;})[_0x32eb('0x10')](respondWithFilteredResult(_0x36ae8b,_0x124e53))[_0x32eb('0x1b')](handleError(_0x36ae8b,null));};exports[_0x32eb('0x61')]=function(_0x408e72,_0x13d6cb){var _0x47039f={'raw':![],'where':{'id':_0x408e72[_0x32eb('0x62')]['id']},'include':[{'model':db[_0x32eb('0x44')],'as':'Imap'},{'model':db[_0x32eb('0x63')],'as':_0x32eb('0x42')},{'model':db[_0x32eb('0x45')],'as':_0x32eb('0x64')}]},_0x25c0b3={};_0x25c0b3[_0x32eb('0x4b')]=_['keys'](db[_0x32eb('0x47')]['rawAttributes']);_0x25c0b3[_0x32eb('0x4e')]=_['keys'](_0x408e72[_0x32eb('0x4e')]);_0x25c0b3['filters']=_[_0x32eb('0x50')](_0x25c0b3[_0x32eb('0x4b')],_0x25c0b3['query']);_0x47039f[_0x32eb('0x52')]=_[_0x32eb('0x50')](_0x25c0b3['model'],qs[_0x32eb('0x51')](_0x408e72[_0x32eb('0x4e')][_0x32eb('0x51')]));_0x47039f[_0x32eb('0x52')]=_0x47039f[_0x32eb('0x52')][_0x32eb('0x53')]?_0x47039f[_0x32eb('0x52')]:_0x25c0b3[_0x32eb('0x4b')];if(_0x408e72[_0x32eb('0x4e')][_0x32eb('0x5e')]){_0x47039f[_0x32eb('0x65')]=[{'all':!![]}];}_0x47039f=_[_0x32eb('0x5b')]({},_0x47039f,_0x408e72[_0x32eb('0x5d')]);return db['MailAccount'][_0x32eb('0x66')](_0x47039f)[_0x32eb('0x10')](handleEntityNotFound(_0x13d6cb,null))[_0x32eb('0x10')](respondWithResult(_0x13d6cb,null))[_0x32eb('0x1b')](handleError(_0x13d6cb,null));};exports['update']=function(_0x477757,_0x4392b7){if(_0x477757['body']['id']){delete _0x477757[_0x32eb('0x67')]['id'];}var _0x22bb4d=_0x477757[_0x32eb('0x67')][_0x32eb('0x68')]===_0x32eb('0x69')?null:_0x477757['body'][_0x32eb('0x68')];var _0x2e6190=_0x477757[_0x32eb('0x67')][_0x32eb('0x41')]||{};var _0x440ce9=_0x477757[_0x32eb('0x67')][_0x32eb('0x42')]||{};if(_0x22bb4d){_0x2e6190['host']=getImapHost(_0x22bb4d);_0x2e6190[_0x32eb('0x3c')]=0x3e1;_0x440ce9['host']=getSmtpHost(_0x22bb4d);_0x440ce9['port']=0x24b;_0x440ce9[_0x32eb('0x3d')]=![];}if(_0x440ce9[_0x32eb('0x39')]){_0x440ce9[_0x32eb('0x3d')]=![];}else{_0x440ce9[_0x32eb('0x3a')]=null;}if(!_0x2e6190[_0x32eb('0x39')])_0x2e6190[_0x32eb('0x3a')]=null;_0x477757['body'][_0x32eb('0x41')]=_0x2e6190;_0x477757[_0x32eb('0x67')][_0x32eb('0x42')]=_0x440ce9;return db[_0x32eb('0x47')][_0x32eb('0x66')]({'where':{'id':_0x477757[_0x32eb('0x62')]['id']},'include':[{'model':db[_0x32eb('0x44')],'as':_0x32eb('0x41')},{'model':db[_0x32eb('0x63')],'as':_0x32eb('0x42')},{'model':db[_0x32eb('0x45')],'as':_0x32eb('0x64')}]})[_0x32eb('0x10')](handleEntityNotFound(_0x4392b7,null))[_0x32eb('0x10')](function(_0x4f2348){if(!_0x4f2348)throw new Error(_0x32eb('0x6a'));if(_0x4f2348['service'])delete _0x477757[_0x32eb('0x67')]['Imap'];return _0x4f2348;})[_0x32eb('0x10')](saveUpdates(_0x477757['body'],null))[_0x32eb('0x10')](function(_0x284dcd){if(!_0x477757['body'][_0x32eb('0x41')])return _0x284dcd;return db[_0x32eb('0x44')][_0x32eb('0x26')](_0x477757[_0x32eb('0x67')][_0x32eb('0x41')],{'where':{'MailAccountId':_0x284dcd['id']}})[_0x32eb('0x10')](function(){return _0x284dcd;});})[_0x32eb('0x10')](function(_0x2bb593){if(!_0x477757['body'][_0x32eb('0x42')])return _0x2bb593;return db[_0x32eb('0x63')][_0x32eb('0x26')](_0x477757['body']['Smtp'],{'where':{'MailAccountId':_0x2bb593['id']}})['then'](function(){return _0x2bb593;});})[_0x32eb('0x10')](respondWithResult(_0x4392b7,null))[_0x32eb('0x1b')](handleError(_0x4392b7,null));};exports['describe']=function(_0x5395cd,_0x2c8463){return db[_0x32eb('0x47')][_0x32eb('0x6b')]()[_0x32eb('0x10')](respondWithResult(_0x2c8463,null))[_0x32eb('0x1b')](handleError(_0x2c8463,null));};exports[_0x32eb('0x6c')]=function(_0x360b78,_0x543f19){if(_0x360b78['body']['id']){delete _0x360b78[_0x32eb('0x67')]['id'];}return db[_0x32eb('0x47')][_0x32eb('0x66')]({'where':{'id':_0x360b78[_0x32eb('0x62')]['id']}})[_0x32eb('0x10')](handleEntityNotFound(_0x543f19,null))['then'](function(_0x5e9cd4){if(_0x5e9cd4){_0x360b78[_0x32eb('0x67')][_0x32eb('0x6d')]=_0x5e9cd4['id'];return db[_0x32eb('0x6e')]['create'](_0x360b78[_0x32eb('0x67')]);}})['then'](respondWithResult(_0x543f19,null))[_0x32eb('0x1b')](handleError(_0x543f19,null));};exports[_0x32eb('0x6f')]=function(_0xc6fc7a,_0x1f7e17){var _0x161d14={'raw':![],'where':{}};var _0x16617a={};var _0x41cdda={'count':0x0,'rows':[]};return db[_0x32eb('0x47')]['findOne']({'where':{'id':_0xc6fc7a[_0x32eb('0x62')]['id']}})['then'](handleEntityNotFound(_0x1f7e17,null))['then'](function(_0xd884fc){if(_0xd884fc){_0x16617a[_0x32eb('0x4b')]=_[_0x32eb('0x4d')](db[_0x32eb('0x6e')][_0x32eb('0x48')]);_0x16617a[_0x32eb('0x4e')]=_[_0x32eb('0x4d')](_0xc6fc7a['query']);_0x16617a[_0x32eb('0x4f')]=_[_0x32eb('0x50')](_0x16617a[_0x32eb('0x4b')],_0x16617a[_0x32eb('0x4e')]);_0x161d14['attributes']=_['intersection'](_0x16617a['model'],qs[_0x32eb('0x51')](_0xc6fc7a[_0x32eb('0x4e')][_0x32eb('0x51')]));_0x161d14[_0x32eb('0x52')]=_0x161d14[_0x32eb('0x52')][_0x32eb('0x53')]?_0x161d14['attributes']:_0x16617a['model'];if(!_0xc6fc7a[_0x32eb('0x4e')][_0x32eb('0x54')](_0x32eb('0x55'))){_0x161d14['limit']=qs['limit'](_0xc6fc7a['query'][_0x32eb('0x22')]);_0x161d14[_0x32eb('0x1f')]=qs['offset'](_0xc6fc7a[_0x32eb('0x4e')]['offset']);}_0x161d14[_0x32eb('0x56')]=qs['sort'](_0xc6fc7a['query']['sort']);_0x161d14[_0x32eb('0x5a')]=qs[_0x32eb('0x4f')](_['pick'](_0xc6fc7a['query'],_0x16617a[_0x32eb('0x4f')]));_0x161d14[_0x32eb('0x5a')][_0x32eb('0x6d')]=_0xd884fc['id'];if(_0xc6fc7a[_0x32eb('0x4e')]['filter']){_0x161d14['where']=_[_0x32eb('0x5b')](_0x161d14[_0x32eb('0x5a')],{'$or':_[_0x32eb('0x46')](_0x161d14[_0x32eb('0x52')],function(_0x15f9fd){var _0x5b6b5c={};_0x5b6b5c[_0x15f9fd]={'$like':'%'+_0xc6fc7a[_0x32eb('0x4e')][_0x32eb('0x59')]+'%'};return _0x5b6b5c;})});}_0x161d14=_[_0x32eb('0x5b')]({},_0x161d14,_0xc6fc7a['options']);return db[_0x32eb('0x6e')]['count']({'where':_0x161d14[_0x32eb('0x5a')]})['then'](function(_0x3082c9){_0x41cdda[_0x32eb('0x21')]=_0x3082c9;if(_0xc6fc7a[_0x32eb('0x4e')][_0x32eb('0x5e')]){_0x161d14[_0x32eb('0x65')]=[{'all':!![]}];}return db[_0x32eb('0x6e')][_0x32eb('0x5f')](_0x161d14);})[_0x32eb('0x10')](function(_0x161ba4){_0x41cdda[_0x32eb('0x60')]=_0x161ba4;return _0x41cdda;});}})[_0x32eb('0x10')](respondWithFilteredResult(_0x1f7e17,_0x161d14))['catch'](handleError(_0x1f7e17,null));};exports[_0x32eb('0x70')]=function(_0x3cd039,_0x1eda33){return db[_0x32eb('0x47')]['find']({'where':{'id':_0x3cd039[_0x32eb('0x62')]['id']}})[_0x32eb('0x10')](handleEntityNotFound(_0x1eda33,null))[_0x32eb('0x10')](function(_0x20a723){if(_0x20a723){return _0x20a723['removeDispositions'](_0x3cd039['query'][_0x32eb('0x71')]);}})[_0x32eb('0x10')](respondWithStatusCode(_0x1eda33,null))[_0x32eb('0x1b')](handleError(_0x1eda33,null));};exports['addAnswer']=function(_0x34293b,_0x17bd6b){if(_0x34293b['body']['id']){delete _0x34293b[_0x32eb('0x67')]['id'];}return db[_0x32eb('0x47')][_0x32eb('0x66')]({'where':{'id':_0x34293b[_0x32eb('0x62')]['id']}})[_0x32eb('0x10')](handleEntityNotFound(_0x17bd6b,null))[_0x32eb('0x10')](function(_0x420ba6){if(_0x420ba6){_0x34293b['body'][_0x32eb('0x6d')]=_0x420ba6['id'];return db[_0x32eb('0x72')]['create'](_0x34293b[_0x32eb('0x67')]);}})[_0x32eb('0x10')](respondWithResult(_0x17bd6b,null))[_0x32eb('0x1b')](handleError(_0x17bd6b,null));};exports[_0x32eb('0x73')]=function(_0x5b1650,_0x299eb9){var _0x20765e={'raw':![],'where':{}};var _0x3c2855={};var _0x290588={'count':0x0,'rows':[]};return db[_0x32eb('0x47')][_0x32eb('0x74')]({'where':{'id':_0x5b1650[_0x32eb('0x62')]['id']}})[_0x32eb('0x10')](handleEntityNotFound(_0x299eb9,null))[_0x32eb('0x10')](function(_0x47ec2d){if(_0x47ec2d){_0x3c2855[_0x32eb('0x4b')]=_['keys'](db['CannedAnswer'][_0x32eb('0x48')]);_0x3c2855['query']=_[_0x32eb('0x4d')](_0x5b1650[_0x32eb('0x4e')]);_0x3c2855[_0x32eb('0x4f')]=_[_0x32eb('0x50')](_0x3c2855[_0x32eb('0x4b')],_0x3c2855['query']);_0x20765e[_0x32eb('0x52')]=_['intersection'](_0x3c2855[_0x32eb('0x4b')],qs[_0x32eb('0x51')](_0x5b1650[_0x32eb('0x4e')][_0x32eb('0x51')]));_0x20765e['attributes']=_0x20765e[_0x32eb('0x52')][_0x32eb('0x53')]?_0x20765e[_0x32eb('0x52')]:_0x3c2855[_0x32eb('0x4b')];if(!_0x5b1650['query'][_0x32eb('0x54')]('nolimit')){_0x20765e[_0x32eb('0x22')]=qs[_0x32eb('0x22')](_0x5b1650['query'][_0x32eb('0x22')]);_0x20765e['offset']=qs[_0x32eb('0x1f')](_0x5b1650[_0x32eb('0x4e')][_0x32eb('0x1f')]);}_0x20765e[_0x32eb('0x56')]=qs[_0x32eb('0x57')](_0x5b1650['query']['sort']);_0x20765e['where']=qs['filters'](_[_0x32eb('0x58')](_0x5b1650['query'],_0x3c2855[_0x32eb('0x4f')]));_0x20765e[_0x32eb('0x5a')][_0x32eb('0x6d')]=_0x47ec2d['id'];if(_0x5b1650[_0x32eb('0x4e')][_0x32eb('0x59')]){_0x20765e['where']=_['merge'](_0x20765e[_0x32eb('0x5a')],{'$or':_['map'](_0x20765e[_0x32eb('0x52')],function(_0x95f9a6){var _0x267c46={};_0x267c46[_0x95f9a6]={'$like':'%'+_0x5b1650[_0x32eb('0x4e')]['filter']+'%'};return _0x267c46;})});}_0x20765e=_[_0x32eb('0x5b')]({},_0x20765e,_0x5b1650[_0x32eb('0x5d')]);return db[_0x32eb('0x72')][_0x32eb('0x21')]({'where':_0x20765e[_0x32eb('0x5a')]})[_0x32eb('0x10')](function(_0x44eaee){_0x290588['count']=_0x44eaee;if(_0x5b1650[_0x32eb('0x4e')][_0x32eb('0x5e')]){_0x20765e[_0x32eb('0x65')]=[{'all':!![]}];}return db[_0x32eb('0x72')][_0x32eb('0x5f')](_0x20765e);})[_0x32eb('0x10')](function(_0x4651b3){_0x290588['rows']=_0x4651b3;return _0x290588;});}})[_0x32eb('0x10')](respondWithFilteredResult(_0x299eb9,_0x20765e))[_0x32eb('0x1b')](handleError(_0x299eb9,null));};exports[_0x32eb('0x75')]=function(_0x30ddac,_0x300925){return db['MailAccount'][_0x32eb('0x66')]({'where':{'id':_0x30ddac[_0x32eb('0x62')]['id']}})[_0x32eb('0x10')](handleEntityNotFound(_0x300925,null))['then'](function(_0x15a491){if(_0x15a491){return _0x15a491[_0x32eb('0x75')](_0x30ddac[_0x32eb('0x4e')]['ids']);}})[_0x32eb('0x10')](respondWithStatusCode(_0x300925,null))[_0x32eb('0x1b')](handleError(_0x300925,null));};exports[_0x32eb('0x76')]=function(_0x12cf02,_0x397a4c){var _0x1f9cac={'name':_0x12cf02[_0x32eb('0x67')][_0x32eb('0x4c')],'key':_0x12cf02[_0x32eb('0x67')][_0x32eb('0x77')],'provider':_0x12cf02[_0x32eb('0x67')][_0x32eb('0x68')]===_0x32eb('0x69')?null:_0x12cf02['body'][_0x32eb('0x68')],'email':_0x12cf02[_0x32eb('0x67')]['email'],'ListId':_0x12cf02[_0x32eb('0x67')][_0x32eb('0x78')],'active':!_[_0x32eb('0x79')](_0x12cf02[_0x32eb('0x67')]['active'])?_0x12cf02[_0x32eb('0x67')][_0x32eb('0x7a')]:!![],'description':_0x12cf02[_0x32eb('0x67')]['description']||null};var _0x36ae71=getAuthenticationOptions(_0x1f9cac[_0x32eb('0x68')],_0x12cf02['body']);_0x1f9cac[_0x32eb('0x41')]=_0x36ae71[_0x32eb('0x41')];_0x1f9cac['Smtp']=_0x36ae71[_0x32eb('0x42')];return db[_0x32eb('0x47')]['create'](_0x1f9cac,{'include':[{'model':db[_0x32eb('0x63')],'as':_0x32eb('0x42')},{'model':db[_0x32eb('0x44')],'as':_0x32eb('0x41')}]})['then'](function(_0x4ca6d1){var _0x20b9ee=_0x12cf02[_0x32eb('0x36')][_0x32eb('0x28')]({'plain':!![]});if(!_0x20b9ee)throw new Error(_0x32eb('0x7b'));if(_0x20b9ee[_0x32eb('0x7c')]==='user'){var _0xb81ee9=_0x4ca6d1[_0x32eb('0x28')]({'plain':!![]});return db[_0x32eb('0x7d')][_0x32eb('0x66')]({'where':{'name':_0x32eb('0x29'),'userProfileId':_0x20b9ee['userProfileId']},'raw':!![]})['then'](function(_0x38f63a){if(_0x38f63a&&_0x38f63a['autoAssociation']===0x0){return db[_0x32eb('0x7e')][_0x32eb('0x76')]({'name':_0xb81ee9[_0x32eb('0x4c')],'resourceId':_0xb81ee9['id'],'type':_0x38f63a['name'],'sectionId':_0x38f63a['id']},{})[_0x32eb('0x10')](function(){return _0x4ca6d1;});}else{return _0x4ca6d1;}})['catch'](function(_0x137d24){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x137d24);throw _0x137d24;});}return _0x4ca6d1;})[_0x32eb('0x10')](respondWithResult(_0x397a4c,0xc9))['catch'](handleError(_0x397a4c,null));};exports[_0x32eb('0x7f')]=function(_0x49c7b1,_0xf5100e){return db[_0x32eb('0x47')][_0x32eb('0x74')]({'where':{'id':_0x49c7b1[_0x32eb('0x62')]['id']}})[_0x32eb('0x10')](handleEntityNotFound(_0xf5100e,null))[_0x32eb('0x10')](function(_0x50a240){if(_0x50a240){return _0x50a240[_0x32eb('0x7f')]();}return null;})['then'](respondWithResult(_0xf5100e,null))['catch'](handleError(_0xf5100e,null));};exports[_0x32eb('0x80')]=function(_0x3c22f8,_0x299a3c){if(_0x3c22f8[_0x32eb('0x67')]['id']){delete _0x3c22f8[_0x32eb('0x67')]['id'];}return db[_0x32eb('0x47')]['find']({'where':{'id':_0x3c22f8[_0x32eb('0x62')]['id']}})[_0x32eb('0x10')](handleEntityNotFound(_0x299a3c,null))[_0x32eb('0x10')](function(_0x2cdf74){if(_0x2cdf74){_0x3c22f8[_0x32eb('0x67')]['MailAccountId']=_0x2cdf74['id'];return db['MailServerIn'][_0x32eb('0x76')](_0x3c22f8[_0x32eb('0x67')]);}})[_0x32eb('0x10')](respondWithResult(_0x299a3c,null))[_0x32eb('0x1b')](handleError(_0x299a3c,null));};exports[_0x32eb('0x81')]=function(_0x4c54de,_0x1f5863){return db[_0x32eb('0x47')][_0x32eb('0x74')]({'where':{'id':_0x4c54de[_0x32eb('0x62')]['id']}})['then'](handleEntityNotFound(_0x1f5863,null))[_0x32eb('0x10')](function(_0x258325){if(_0x258325){return _0x258325[_0x32eb('0x82')](null);}return null;})[_0x32eb('0x10')](respondWithStatusCode(_0x1f5863,null))['catch'](handleError(_0x1f5863,null));};exports['getSmtp']=function(_0x2fc9de,_0xc2a9ae){return db['MailAccount'][_0x32eb('0x74')]({'where':{'id':_0x2fc9de[_0x32eb('0x62')]['id']}})[_0x32eb('0x10')](handleEntityNotFound(_0xc2a9ae,null))[_0x32eb('0x10')](function(_0x9943ac){if(_0x9943ac){return _0x9943ac[_0x32eb('0x83')]();}return null;})['then'](respondWithResult(_0xc2a9ae,null))[_0x32eb('0x1b')](handleError(_0xc2a9ae,null));};exports[_0x32eb('0x84')]=function(_0x254dd4,_0x3d2662){if(_0x254dd4[_0x32eb('0x67')]['id']){delete _0x254dd4[_0x32eb('0x67')]['id'];}return db[_0x32eb('0x47')][_0x32eb('0x66')]({'where':{'id':_0x254dd4[_0x32eb('0x62')]['id']}})['then'](handleEntityNotFound(_0x3d2662,null))['then'](function(_0x4c89c1){if(_0x4c89c1){_0x254dd4[_0x32eb('0x67')][_0x32eb('0x6d')]=_0x4c89c1['id'];return db[_0x32eb('0x63')][_0x32eb('0x76')](_0x254dd4['body']);}})[_0x32eb('0x10')](respondWithResult(_0x3d2662,null))[_0x32eb('0x1b')](handleError(_0x3d2662,null));};exports[_0x32eb('0x85')]=function(_0x421fd9,_0x1b8eff){return db[_0x32eb('0x47')]['findOne']({'where':{'id':_0x421fd9['params']['id']}})[_0x32eb('0x10')](handleEntityNotFound(_0x1b8eff,null))[_0x32eb('0x10')](function(_0x1efe71){if(_0x1efe71){return _0x1efe71['setSmtp'](null);}return null;})['then'](respondWithStatusCode(_0x1b8eff,null))['catch'](handleError(_0x1b8eff,null));};exports[_0x32eb('0x86')]=function(_0x4d60c1,_0x4208d6){return db[_0x32eb('0x87')][_0x32eb('0x66')]({'where':{'id':_0x4d60c1[_0x32eb('0x62')]['id']}})[_0x32eb('0x10')](handleEntityNotFound(_0x4208d6,null))[_0x32eb('0x10')](function(_0x2414e0){if(_0x2414e0){return _0x2414e0[_0x32eb('0x86')](_0x4d60c1[_0x32eb('0x67')][_0x32eb('0x71')],_[_0x32eb('0x88')](_0x4d60c1[_0x32eb('0x67')],[_0x32eb('0x71'),'id'])||{});}})[_0x32eb('0x10')](respondWithResult(_0x4208d6,null))[_0x32eb('0x1b')](handleError(_0x4208d6,null));};exports['getInteractions']=function(_0x4a4b10,_0x360598){var _0x5e0ba2={'raw':![],'where':{}};var _0x2269be={};var _0x23cd95={'count':0x0,'rows':[]};return db[_0x32eb('0x47')][_0x32eb('0x74')]({'where':{'id':_0x4a4b10[_0x32eb('0x62')]['id']}})[_0x32eb('0x10')](handleEntityNotFound(_0x360598,null))['then'](function(_0x4da7ac){if(_0x4da7ac){_0x2269be[_0x32eb('0x4b')]=_[_0x32eb('0x4d')](db[_0x32eb('0x87')][_0x32eb('0x48')]);_0x2269be[_0x32eb('0x4e')]=_[_0x32eb('0x4d')](_0x4a4b10['query']);_0x2269be[_0x32eb('0x4f')]=_['intersection'](_0x2269be['model'],_0x2269be[_0x32eb('0x4e')]);_0x5e0ba2[_0x32eb('0x52')]=_['intersection'](_0x2269be['model'],qs[_0x32eb('0x51')](_0x4a4b10[_0x32eb('0x4e')][_0x32eb('0x51')]));_0x5e0ba2['attributes']=_0x5e0ba2[_0x32eb('0x52')][_0x32eb('0x53')]?_0x5e0ba2[_0x32eb('0x52')]:_0x2269be[_0x32eb('0x4b')];if(!_0x4a4b10['query'][_0x32eb('0x54')](_0x32eb('0x55'))){_0x5e0ba2[_0x32eb('0x22')]=qs[_0x32eb('0x22')](_0x4a4b10[_0x32eb('0x4e')][_0x32eb('0x22')]);_0x5e0ba2[_0x32eb('0x1f')]=qs[_0x32eb('0x1f')](_0x4a4b10['query']['offset']);}_0x5e0ba2[_0x32eb('0x56')]=qs[_0x32eb('0x57')](_0x4a4b10[_0x32eb('0x4e')][_0x32eb('0x57')]);_0x5e0ba2[_0x32eb('0x5a')]=qs[_0x32eb('0x4f')](_[_0x32eb('0x58')](_0x4a4b10['query'],_0x2269be[_0x32eb('0x4f')]));_0x5e0ba2[_0x32eb('0x5a')][_0x32eb('0x6d')]=_0x4da7ac['id'];if(_0x4a4b10['query']['filter']){_0x5e0ba2[_0x32eb('0x5a')]=_[_0x32eb('0x5b')](_0x5e0ba2[_0x32eb('0x5a')],{'$or':_['map'](_0x5e0ba2[_0x32eb('0x52')],function(_0x303aa2){var _0x3157cb={};_0x3157cb[_0x303aa2]={'$like':'%'+_0x4a4b10['query'][_0x32eb('0x59')]+'%'};return _0x3157cb;})});}_0x5e0ba2=_[_0x32eb('0x5b')]({},_0x5e0ba2,_0x4a4b10['options']);return db[_0x32eb('0x87')][_0x32eb('0x21')]({'where':_0x5e0ba2[_0x32eb('0x5a')]})[_0x32eb('0x10')](function(_0x2752b0){_0x23cd95[_0x32eb('0x21')]=_0x2752b0;if(_0x4a4b10['query']['includeAll']){_0x5e0ba2['include']=[{'model':db[_0x32eb('0x89')],'as':'Contact','required':![]},{'model':db[_0x32eb('0x8a')],'as':'Owner','attributes':['name','fullname',_0x32eb('0x8b')],'required':![]},{'model':db[_0x32eb('0x8c')],'as':_0x32eb('0x8d'),'attributes':['id',_0x32eb('0x4c'),_0x32eb('0x8e')],'where':_0x4a4b10['query'][_0x32eb('0x8f')]?{'id':_0x4a4b10[_0x32eb('0x4e')][_0x32eb('0x8f')]}:undefined,'required':_0x4a4b10[_0x32eb('0x4e')]['tag']?!![]:![]}];}return db[_0x32eb('0x87')]['findAll'](_0x5e0ba2);})[_0x32eb('0x10')](function(_0x110c20){_0x23cd95['rows']=_0x110c20;return _0x23cd95;});}})['then'](respondWithFilteredResult(_0x360598,_0x5e0ba2))['catch'](handleError(_0x360598,null));};exports[_0x32eb('0x90')]=function addApplications(_0x429db3,_0x292f3d){var _0x280dcf=_0x429db3[_0x32eb('0x62')]['id'];var _0x3d5103=_0x429db3['body'];var _0x398168=0xc8;var _0x47314a=null;return db[_0x32eb('0x91')]['transaction']({'isolationLevel':db[_0x32eb('0x91')][_0x32eb('0x92')]['ISOLATION_LEVELS'][_0x32eb('0x93')]},function(_0x882130){return db[_0x32eb('0x47')][_0x32eb('0x74')]({'where':{'id':_0x280dcf},'transaction':_0x882130})[_0x32eb('0x10')](function(_0x4d7749){if(_0x4d7749){return db[_0x32eb('0x94')]['destroy']({'where':{'MailAccountId':_0x280dcf},'transaction':_0x882130})['then'](function(){var _0x13983a=_['map'](_0x3d5103,function(_0x4077ee){_0x4077ee[_0x32eb('0x6d')]=_0x280dcf;return _0x4077ee;});return db[_0x32eb('0x94')][_0x32eb('0x95')](_0x13983a,{'transaction':_0x882130});});}else{_0x398168=0x194;_0x47314a=[];}});})[_0x32eb('0x10')](function(){if(_0x398168!==0x194){return db[_0x32eb('0x94')][_0x32eb('0x96')]({'where':{'MailAccountId':_0x280dcf},'order':_0x32eb('0x97')})[_0x32eb('0x10')](function(_0x24766b){_0x47314a=_0x24766b;});}})[_0x32eb('0x1b')](function(_0x5ee1bf){_0x398168=0x1f4;logger[_0x32eb('0x17')](_0x5ee1bf['stack']);if(_0x5ee1bf['name']){delete _0x5ee1bf[_0x32eb('0x4c')];}_0x47314a=_0x5ee1bf;})[_0x32eb('0x98')](function(){if(_0x47314a===null){_0x292f3d[_0x32eb('0x1c')](_0x398168);}else{if(_0x398168===0x1f4){_0x292f3d[_0x32eb('0x1d')](_0x398168)[_0x32eb('0x2b')](_0x47314a);}else{_0x292f3d[_0x32eb('0x1d')](_0x398168)[_0x32eb('0x25')](_0x47314a);}}});};exports[_0x32eb('0x99')]=function(_0x14ec4b,_0x338f4c){var _0x3a2813={};var _0x37283e={};var _0x1d70af;var _0x1fe6d3;return db[_0x32eb('0x47')][_0x32eb('0x74')]({'where':{'id':_0x14ec4b[_0x32eb('0x62')]['id']}})[_0x32eb('0x10')](handleEntityNotFound(_0x338f4c,null))[_0x32eb('0x10')](function(_0x2f6720){if(_0x2f6720){_0x1d70af=_0x2f6720;_0x37283e[_0x32eb('0x4b')]=_['keys'](db['MailApplication']['rawAttributes']);_0x37283e['query']=_[_0x32eb('0x4d')](_0x14ec4b[_0x32eb('0x4e')]);_0x37283e[_0x32eb('0x4f')]=_[_0x32eb('0x50')](_0x37283e[_0x32eb('0x4b')],_0x37283e[_0x32eb('0x4e')]);_0x3a2813[_0x32eb('0x52')]=_[_0x32eb('0x50')](_0x37283e['model'],qs['fields'](_0x14ec4b[_0x32eb('0x4e')][_0x32eb('0x51')]));_0x3a2813[_0x32eb('0x52')]=_0x3a2813[_0x32eb('0x52')][_0x32eb('0x53')]?_0x3a2813[_0x32eb('0x52')]:_0x37283e[_0x32eb('0x4b')];_0x3a2813['order']=qs['sort'](_0x14ec4b[_0x32eb('0x4e')][_0x32eb('0x57')]);_0x3a2813[_0x32eb('0x5a')]=qs['filters'](_['pick'](_0x14ec4b['query'],_0x37283e[_0x32eb('0x4f')]));if(_0x14ec4b[_0x32eb('0x4e')]['filter']){_0x3a2813[_0x32eb('0x5a')]=_[_0x32eb('0x5b')](_0x3a2813[_0x32eb('0x5a')],{'$or':_[_0x32eb('0x46')](_0x3a2813[_0x32eb('0x52')],function(_0x15f858){var _0x2933bd={};_0x2933bd[_0x15f858]={'$like':'%'+_0x14ec4b['query'][_0x32eb('0x59')]+'%'};return _0x2933bd;})});}_0x3a2813=_[_0x32eb('0x5b')]({},_0x3a2813,_0x14ec4b[_0x32eb('0x5d')]);return _0x1d70af[_0x32eb('0x99')](_0x3a2813);}})[_0x32eb('0x10')](function(_0x1bdbae){if(_0x1bdbae){_0x1fe6d3=_0x1bdbae['length'];if(!_0x14ec4b[_0x32eb('0x4e')][_0x32eb('0x54')](_0x32eb('0x55'))){_0x3a2813['limit']=qs['limit'](_0x14ec4b[_0x32eb('0x4e')][_0x32eb('0x22')]);_0x3a2813[_0x32eb('0x1f')]=qs[_0x32eb('0x1f')](_0x14ec4b['query']['offset']);}return _0x1d70af[_0x32eb('0x99')](_0x3a2813);}})[_0x32eb('0x10')](function(_0x20f69b){if(_0x20f69b){return _0x20f69b?{'count':_0x1fe6d3,'rows':_0x20f69b}:null;}})['then'](respondWithResult(_0x338f4c,null))[_0x32eb('0x1b')](handleError(_0x338f4c,null));};exports[_0x32eb('0x9a')]=function(_0x318303,_0x4e1015){var _0x5c62d3={'raw':!![],'where':{}};var _0x22780f={};var _0x302978={'count':0x0,'rows':[]};return db[_0x32eb('0x47')][_0x32eb('0x74')]({'where':{'id':_0x318303[_0x32eb('0x62')]['id']}})[_0x32eb('0x10')](handleEntityNotFound(_0x4e1015,null))[_0x32eb('0x10')](function(_0x209ad6){if(_0x209ad6){_0x22780f[_0x32eb('0x4b')]=_['keys'](db[_0x32eb('0x9b')][_0x32eb('0x48')]);_0x22780f[_0x32eb('0x4e')]=_[_0x32eb('0x4d')](_0x318303[_0x32eb('0x4e')]);_0x22780f[_0x32eb('0x4f')]=_[_0x32eb('0x50')](_0x22780f[_0x32eb('0x4b')],_0x22780f[_0x32eb('0x4e')]);_0x5c62d3['attributes']=_['intersection'](_0x22780f[_0x32eb('0x4b')],qs[_0x32eb('0x51')](_0x318303[_0x32eb('0x4e')][_0x32eb('0x51')]));_0x5c62d3[_0x32eb('0x52')]=_0x5c62d3['attributes'][_0x32eb('0x53')]?_0x5c62d3['attributes']:_0x22780f[_0x32eb('0x4b')];if(!_0x318303[_0x32eb('0x4e')][_0x32eb('0x54')]('nolimit')){_0x5c62d3[_0x32eb('0x22')]=qs[_0x32eb('0x22')](_0x318303[_0x32eb('0x4e')][_0x32eb('0x22')]);_0x5c62d3[_0x32eb('0x1f')]=qs[_0x32eb('0x1f')](_0x318303['query'][_0x32eb('0x1f')]);}_0x5c62d3[_0x32eb('0x56')]=qs[_0x32eb('0x57')](_0x318303['query'][_0x32eb('0x57')]);_0x5c62d3['where']=qs[_0x32eb('0x4f')](_[_0x32eb('0x58')](_0x318303[_0x32eb('0x4e')],_0x22780f[_0x32eb('0x4f')]));_0x5c62d3[_0x32eb('0x5a')][_0x32eb('0x6d')]=_0x209ad6['id'];if(_0x318303[_0x32eb('0x4e')][_0x32eb('0x59')]){_0x5c62d3['where']=_[_0x32eb('0x5b')](_0x5c62d3[_0x32eb('0x5a')],{'$or':_[_0x32eb('0x46')](_0x5c62d3[_0x32eb('0x52')],function(_0x3c0fc1){var _0x4c952c={};_0x4c952c[_0x3c0fc1]={'$like':'%'+_0x318303[_0x32eb('0x4e')]['filter']+'%'};return _0x4c952c;})});}if(_0x318303[_0x32eb('0x4e')][_0x32eb('0x9c')]){var _0x23f084=_0x318303[_0x32eb('0x4e')][_0x32eb('0x9c')]['split'](',');var _0x27c9d7={};_0x27c9d7[_0x23f084[0x0]]={'$gte':moment(_0x23f084[0x1])['format'](_0x32eb('0x9d'))};_0x5c62d3[_0x32eb('0x5a')]=_['merge'](_0x5c62d3[_0x32eb('0x5a')],_0x27c9d7);}_0x5c62d3=_[_0x32eb('0x5b')]({},_0x5c62d3,_0x318303['options']);return db['MailMessage'][_0x32eb('0x21')]({'where':_0x5c62d3['where']})[_0x32eb('0x10')](function(_0xbcd74c){_0x302978[_0x32eb('0x21')]=_0xbcd74c;if(_0x318303['query'][_0x32eb('0x5e')]){_0x5c62d3[_0x32eb('0x65')]=[{'all':!![]}];}return db['MailMessage'][_0x32eb('0x5f')](_0x5c62d3);})[_0x32eb('0x10')](function(_0x302fc8){if(_0x318303[_0x32eb('0x4e')]['inlineCss']===_0x32eb('0x9e')){for(var _0x1b2c82=0x0;_0x1b2c82<_0x302fc8[_0x32eb('0x53')];_0x1b2c82++){_0x302fc8[_0x1b2c82][_0x32eb('0x67')]=juice(_0x302fc8[_0x1b2c82][_0x32eb('0x67')]);}}_0x302978['rows']=_0x302fc8;return _0x302978;});}})[_0x32eb('0x10')](respondWithFilteredResult(_0x4e1015,_0x5c62d3))[_0x32eb('0x1b')](handleError(_0x4e1015,null));};exports['send']=function(_0x53c278,_0x49f3a8){var _0x1adb04,_0x3fcfc9={},_0x52b532;if(_0x53c278[_0x32eb('0x67')]['to']){_0x52b532=_0x53c278[_0x32eb('0x67')]['to']['split'](',')[0x0];}return db[_0x32eb('0x47')][_0x32eb('0x66')]({'where':{'id':_0x53c278[_0x32eb('0x62')]['id']},'include':[{'model':db[_0x32eb('0x9f')],'as':_0x32eb('0xa0'),'include':[{'model':db[_0x32eb('0x89')],'as':_0x32eb('0xa1'),'where':{'email':_0x52b532},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x32eb('0x63')],'as':_0x32eb('0x42'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x32eb('0xa2'),'raw':!![]}]}]})[_0x32eb('0x10')](handleEntityNotFound(_0x49f3a8,null))[_0x32eb('0x10')](function(_0x404bcf){if(!_0x404bcf)return;_0x1adb04=_0x404bcf;if(!_0x404bcf[_0x32eb('0x42')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0x32eb('0x79')](_0x53c278[_0x32eb('0x67')]['from'])){_0x53c278['body'][_0x32eb('0xa3')]=util[_0x32eb('0xa4')](_0x32eb('0xa5'),_0x404bcf[_0x32eb('0x4c')],_0x404bcf[_0x32eb('0xa6')]||_0x404bcf['Smtp'][_0x32eb('0x36')]);}if(_0x53c278[_0x32eb('0x67')][_0x32eb('0xa7')]&&_0x53c278['body']['attachments'][_0x32eb('0x53')]){for(var _0x220d23=0x0;_0x220d23<_0x53c278[_0x32eb('0x67')][_0x32eb('0xa7')][_0x32eb('0x53')];_0x220d23+=0x1){_0x53c278['body']['attachments'][_0x220d23]={'filename':_0x53c278[_0x32eb('0x67')][_0x32eb('0xa7')][_0x220d23][_0x32eb('0x4c')],'path':path[_0x32eb('0xa8')](config['root'],_0x32eb('0xa9'),_0x53c278[_0x32eb('0x67')][_0x32eb('0xa7')][_0x220d23][_0x32eb('0xaa')])};}}var _0x4cd80d=_0x404bcf[_0x32eb('0xab')]();return respondWithRpcPromise(_0x32eb('0xac'),_0x32eb('0xad'),{'account':_0x4cd80d,'message':_0x53c278[_0x32eb('0x67')]});})[_0x32eb('0x10')](function(_0x15b7a5){if(!_0x15b7a5)return;_0x3fcfc9=_0x15b7a5;if(!_0x1adb04[_0x32eb('0xa0')])throw new Error(_0x32eb('0xae'));if(_0x1adb04[_0x32eb('0xa0')][_0x32eb('0xa1')]['length'])return _0x1adb04[_0x32eb('0xa0')]['Contacts'][0x0];return db['CmContact'][_0x32eb('0x76')](_[_0x32eb('0xaf')](_0x53c278['body'],{'firstName':_0x53c278[_0x32eb('0x67')]['to'],'email':_0x53c278[_0x32eb('0x67')]['to'],'phone':_0x53c278[_0x32eb('0x67')]['to'],'ListId':_0x1adb04[_0x32eb('0x78')]}));})['then'](function(_0x2163f7){if(!_0x2163f7)return;var _0x20a246={'UserId':_0x53c278[_0x32eb('0x36')]['id'],'ContactId':_0x2163f7['id'],'MailAccountId':_0x1adb04['id'],'inReplyTo':_0x3fcfc9[_0x32eb('0xb0')],'to':_0x53c278['body'][_0x32eb('0xa3')],'cc':_0x53c278['body']['cc'],'subject':_0x53c278[_0x32eb('0x67')]['subject'],'attach':_0x53c278['body'][_0x32eb('0xb1')],'firstMsgDirection':_0x32eb('0xb2'),'lastMsgAt':moment()['format'](_0x32eb('0x9d')),'lastMsgDirection':_0x32eb('0xb2'),'Messages':[_[_0x32eb('0x5b')](_0x53c278[_0x32eb('0x67')],{'messageId':_0x3fcfc9[_0x32eb('0xb0')],'sentAt':moment()[_0x32eb('0xa4')](_0x32eb('0x9d')),'read':!![],'MailAccountId':_0x1adb04['id'],'UserId':_0x53c278[_0x32eb('0x36')]['id'],'ContactId':_0x2163f7['id']})]};if(_0x53c278[_0x32eb('0x67')][_0x32eb('0xb3')]){_0x20a246=_['merge'](_0x20a246,_0x53c278['body'][_0x32eb('0xb3')]);}return db[_0x32eb('0x87')]['create'](_0x20a246,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});})[_0x32eb('0x10')](respondWithResult(_0x49f3a8,null))['catch'](handleError(_0x49f3a8,null));};exports[_0x32eb('0xb4')]=function(_0x3409e7,_0x1a7e8d){return db[_0x32eb('0x47')][_0x32eb('0x66')]({'where':{'id':_0x3409e7[_0x32eb('0x62')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x32eb('0x42'),'raw':!![],'include':[{'model':db[_0x32eb('0xa2')],'as':'CloudProvider','raw':!![]}]}]})[_0x32eb('0x10')](handleEntityNotFound(_0x1a7e8d,null))['then'](function(_0x544f88){if(!_0x544f88[_0x32eb('0x42')])return;var _0xa841e6=_0x544f88[_0x32eb('0xab')]();return respondWithRpcPromise(_0x32eb('0xb5'),'verifySmtp',{'account':_0xa841e6});})[_0x32eb('0x10')](respondWithResult(_0x1a7e8d,null))[_0x32eb('0x1b')](handleError(_0x1a7e8d,null));};exports['destroy']=function(_0x41b150,_0x44b138){return db['MailAccount'][_0x32eb('0x66')]({'where':{'id':_0x41b150[_0x32eb('0x62')]['id']}})['then'](handleEntityNotFound(_0x44b138,null))[_0x32eb('0x10')](function(_0x5ccb42){if(_0x5ccb42&&_0x5ccb42[_0x32eb('0x3e')]){throw new db[(_0x32eb('0xb6'))][(_0x32eb('0xb7'))](_0x32eb('0xb8'));}return _0x5ccb42;})[_0x32eb('0x10')](removeEntity(_0x44b138,null))[_0x32eb('0x1b')](handleError(_0x44b138,null));};exports['addAgents']=function(_0x433c11,_0x32446a){return db[_0x32eb('0x47')]['find']({'where':{'id':_0x433c11[_0x32eb('0x62')]['id']}})['then'](handleEntityNotFound(_0x32446a,null))[_0x32eb('0x10')](function(_0x59ab62){if(_0x59ab62){return _0x59ab62[_0x32eb('0xb9')](_0x433c11[_0x32eb('0x67')]['ids'],_['omit'](_0x433c11[_0x32eb('0x67')],[_0x32eb('0x71'),'id'])||{})[_0x32eb('0xba')](function(_0x428132){for(var _0x1fe73c=0x0;_0x1fe73c<_0x433c11['body'][_0x32eb('0x71')][_0x32eb('0x53')];_0x1fe73c+=0x1){socket[_0x32eb('0xbb')](_0x32eb('0xbc'),{'UserId':Number(_0x433c11['body']['ids'][_0x1fe73c]),'MailAccountId':Number(_0x433c11[_0x32eb('0x62')]['id'])});}return _0x428132;});}})['then'](respondWithResult(_0x32446a,null))[_0x32eb('0x1b')](handleError(_0x32446a,null));};exports[_0x32eb('0xbd')]=function(_0x101dc8,_0x4205a8){return db['MailAccount'][_0x32eb('0x66')]({'where':{'id':_0x101dc8['params']['id']}})[_0x32eb('0x10')](handleEntityNotFound(_0x4205a8,null))[_0x32eb('0x10')](function(_0x5a5244){if(_0x5a5244){return _0x5a5244[_0x32eb('0xbd')](_0x101dc8[_0x32eb('0x4e')][_0x32eb('0x71')])['then'](function(){if(_[_0x32eb('0xbe')](_0x101dc8['query'][_0x32eb('0x71')])){for(var _0x76a26f=0x0;_0x76a26f<_0x101dc8[_0x32eb('0x4e')]['ids']['length'];_0x76a26f+=0x1){socket[_0x32eb('0xbb')](_0x32eb('0xbf'),{'UserId':Number(_0x101dc8[_0x32eb('0x4e')][_0x32eb('0x71')][_0x76a26f]),'MailAccountId':Number(_0x101dc8[_0x32eb('0x62')]['id'])});}}else{socket[_0x32eb('0xbb')](_0x32eb('0xbf'),{'UserId':Number(_0x101dc8[_0x32eb('0x4e')][_0x32eb('0x71')]),'MailAccountId':Number(_0x101dc8[_0x32eb('0x62')]['id'])});}});}})['then'](respondWithStatusCode(_0x4205a8,null))['catch'](handleError(_0x4205a8,null));};exports['getAgents']=function(_0x4aac3d,_0x688dcd){var _0x28e4af={};var _0x39c38c={};var _0x50aa58;var _0x2039d6;return db[_0x32eb('0x47')][_0x32eb('0x74')]({'where':{'id':_0x4aac3d['params']['id']}})[_0x32eb('0x10')](handleEntityNotFound(_0x688dcd,null))[_0x32eb('0x10')](function(_0x5851fc){if(_0x5851fc){_0x50aa58=_0x5851fc;_0x39c38c[_0x32eb('0x4b')]=_[_0x32eb('0x4d')](db[_0x32eb('0x8a')][_0x32eb('0x48')]);_0x39c38c['query']=_[_0x32eb('0x4d')](_0x4aac3d[_0x32eb('0x4e')]);_0x39c38c['filters']=_['intersection'](_0x39c38c['model'],_0x39c38c[_0x32eb('0x4e')]);_0x28e4af[_0x32eb('0x52')]=_[_0x32eb('0x50')](_0x39c38c[_0x32eb('0x4b')],qs[_0x32eb('0x51')](_0x4aac3d[_0x32eb('0x4e')]['fields']));_0x28e4af['attributes']=_0x28e4af[_0x32eb('0x52')][_0x32eb('0x53')]?_0x28e4af['attributes']:_0x39c38c[_0x32eb('0x4b')];_0x28e4af[_0x32eb('0x56')]=qs[_0x32eb('0x57')](_0x4aac3d[_0x32eb('0x4e')][_0x32eb('0x57')]);_0x28e4af[_0x32eb('0x5a')]=qs[_0x32eb('0x4f')](_['pick'](_0x4aac3d[_0x32eb('0x4e')],_0x39c38c['filters']));if(_0x4aac3d[_0x32eb('0x4e')][_0x32eb('0x59')]){_0x28e4af[_0x32eb('0x5a')]=_[_0x32eb('0x5b')](_0x28e4af['where'],{'$or':_[_0x32eb('0x46')](_0x28e4af['attributes'],function(_0x30da06){var _0x2303f4={};_0x2303f4[_0x30da06]={'$like':'%'+_0x4aac3d[_0x32eb('0x4e')]['filter']+'%'};return _0x2303f4;})});}_0x28e4af=_['merge']({},_0x28e4af,_0x4aac3d[_0x32eb('0x5d')]);return _0x50aa58[_0x32eb('0xc0')](_0x28e4af);}})[_0x32eb('0x10')](function(_0x4b280f){if(_0x4b280f){_0x2039d6=_0x4b280f[_0x32eb('0x53')];if(!_0x4aac3d['query'][_0x32eb('0x54')](_0x32eb('0x55'))){_0x28e4af['limit']=qs[_0x32eb('0x22')](_0x4aac3d['query'][_0x32eb('0x22')]);_0x28e4af[_0x32eb('0x1f')]=qs[_0x32eb('0x1f')](_0x4aac3d['query'][_0x32eb('0x1f')]);}return _0x50aa58[_0x32eb('0xc0')](_0x28e4af);}})[_0x32eb('0x10')](function(_0x2a4627){if(_0x2a4627){return _0x2a4627?{'count':_0x2039d6,'rows':_0x2a4627}:null;}})[_0x32eb('0x10')](respondWithResult(_0x688dcd,null))[_0x32eb('0x1b')](handleError(_0x688dcd,null));}; \ No newline at end of file +var _0xdaf8=['CannedAnswer','removeAnswers','custom','ListId','isNil','active','description','role','MailAccounts','userProfileId','autoAssociation','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','Transaction','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','CmList','List','Contacts','CloudProvider','from','%s\x20<%s>','email','attachments','join','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','attach','out','Interaction','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','emit','getAgents','moment','bluebird','util','path','juice','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','./mailAccount.socket','register','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','end','status','json','offset','limit','undefined','count','set','update','destroy','get','UserProfileResource','stack','name','send','gmail','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','yahoo','smtp.mail.yahoo.com','smtp.office365.com','Unknown\x20email\x20service\x20provider','user','password','modernAuthentication','CloudProviderId','pass','host','port','secure','service','authentication','username','Imap','Smtp','index','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','includeAll','findAll','rows','show','params','MailServerIn','MailServerOut','include','find','body','provider','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','hasOwnProperty','nolimit','options','removeDispositions','ids','addAnswer'];(function(_0x3f017a,_0x24ba1f){var _0x172281=function(_0x2f3a86){while(--_0x2f3a86){_0x3f017a['push'](_0x3f017a['shift']());}};_0x172281(++_0x24ba1f);}(_0xdaf8,0x10f));var _0x8daf=function(_0x2ba61e,_0x2f730c){_0x2ba61e=_0x2ba61e-0x0;var _0x38c56e=_0xdaf8[_0x2ba61e];return _0x38c56e;};'use strict';var moment=require(_0x8daf('0x0'));var BPromise=require(_0x8daf('0x1'));var util=require(_0x8daf('0x2'));var path=require(_0x8daf('0x3'));var _=require('lodash');var juice=require(_0x8daf('0x4'));var Redis=require(_0x8daf('0x5'));var qs=require(_0x8daf('0x6'));var logger=require('../../config/logger')(_0x8daf('0x7'));var config=require(_0x8daf('0x8'));var db=require(_0x8daf('0x9'))['db'];config[_0x8daf('0xa')]=_['defaults'](config['redis'],{'host':_0x8daf('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8daf('0xc'))[_0x8daf('0xd')](socket);var jayson=require('jayson/promise');var client=jayson[_0x8daf('0xe')][_0x8daf('0xf')]({'port':0x232b});function respondWithRpcPromise(_0x491d8d,_0x17f824,_0x481a16,_0x5a1c22){return new BPromise(function(_0x3165cf,_0x18b81a){var _0x4adfbb=_0x5a1c22||client;return _0x4adfbb[_0x8daf('0x10')](_0x491d8d,_0x481a16)[_0x8daf('0x11')](function(_0x4ee94b){logger[_0x8daf('0x12')](_0x8daf('0x13'),_0x17f824,_0x8daf('0x14'));logger[_0x8daf('0x15')](_0x8daf('0x16'),_0x17f824,_0x8daf('0x14'),JSON['stringify'](_0x4ee94b));if(_0x4ee94b[_0x8daf('0x17')]){if(_0x4ee94b[_0x8daf('0x17')][_0x8daf('0x18')]===0x1f4){logger[_0x8daf('0x17')](_0x8daf('0x13'),_0x17f824,_0x4ee94b['error'][_0x8daf('0x19')]);return _0x18b81a(_0x4ee94b[_0x8daf('0x17')][_0x8daf('0x19')]);}logger[_0x8daf('0x17')](_0x8daf('0x13'),_0x17f824,_0x4ee94b[_0x8daf('0x17')][_0x8daf('0x19')]);return _0x3165cf(_0x4ee94b[_0x8daf('0x17')][_0x8daf('0x19')]);}else{logger[_0x8daf('0x12')](_0x8daf('0x13'),_0x17f824,_0x8daf('0x14'));_0x3165cf(_0x4ee94b[_0x8daf('0x1a')]['message']);}})[_0x8daf('0x1b')](function(_0x2c3cbc){logger[_0x8daf('0x17')]('MailAccount,\x20%s,\x20%s',_0x17f824,_0x2c3cbc);_0x18b81a(_0x2c3cbc);});});}function respondWithStatusCode(_0x3f485a,_0x79f235){_0x79f235=_0x79f235||0xcc;return function(_0x569687){if(_0x569687){return _0x3f485a[_0x8daf('0x1c')](_0x79f235);}return _0x3f485a['status'](_0x79f235)[_0x8daf('0x1d')]();};}function respondWithResult(_0x478d3b,_0x440be0){_0x440be0=_0x440be0||0xc8;return function(_0x4b7454){if(_0x4b7454){return _0x478d3b[_0x8daf('0x1e')](_0x440be0)[_0x8daf('0x1f')](_0x4b7454);}};}function respondWithFilteredResult(_0x5cce04,_0x467176){return function(_0x132587){if(_0x132587){var _0x455e2a=typeof _0x467176[_0x8daf('0x20')]==='undefined'&&typeof _0x467176[_0x8daf('0x21')]===_0x8daf('0x22');var _0x449e45=_0x132587[_0x8daf('0x23')];var _0x31f02b=_0x455e2a?0x0:_0x467176['offset'];var _0x15a543=_0x455e2a?_0x132587['count']:_0x467176['offset']+_0x467176[_0x8daf('0x21')];var _0x4197a8;if(_0x15a543>=_0x449e45){_0x15a543=_0x449e45;_0x4197a8=0xc8;}else{_0x4197a8=0xce;}_0x5cce04[_0x8daf('0x1e')](_0x4197a8);return _0x5cce04[_0x8daf('0x24')]('Content-Range',_0x31f02b+'-'+_0x15a543+'/'+_0x449e45)[_0x8daf('0x1f')](_0x132587);}return null;};}function saveUpdates(_0xa5eb25){return function(_0x180aba){if(_0x180aba){return _0x180aba[_0x8daf('0x25')](_0xa5eb25)[_0x8daf('0x11')](function(_0x31b22f){return _0x31b22f;});}return null;};}function removeEntity(_0x521f56){return function(_0x49fa18){if(_0x49fa18){return _0x49fa18[_0x8daf('0x26')]()['then'](function(){var _0x4a06c3=_0x49fa18[_0x8daf('0x27')]({'plain':!![]});var _0xfe4d16='MailAccounts';return db[_0x8daf('0x28')][_0x8daf('0x26')]({'where':{'type':_0xfe4d16,'resourceId':_0x4a06c3['id']}})[_0x8daf('0x11')](function(){return _0x49fa18;});})['then'](function(){_0x521f56[_0x8daf('0x1e')](0xcc)[_0x8daf('0x1d')]();});}};}function handleEntityNotFound(_0x58ab48){return function(_0x1c32bd){if(!_0x1c32bd){_0x58ab48[_0x8daf('0x1c')](0x194);}return _0x1c32bd;};}function handleError(_0x4eec2d,_0x1a95ad){_0x1a95ad=_0x1a95ad||0x1f4;return function(_0xbaebd4){logger[_0x8daf('0x17')](_0xbaebd4[_0x8daf('0x29')]);if(_0xbaebd4[_0x8daf('0x2a')]){delete _0xbaebd4[_0x8daf('0x2a')];}_0x4eec2d[_0x8daf('0x1e')](_0x1a95ad)[_0x8daf('0x2b')](_0xbaebd4);};}function getImapHost(_0x28529b){switch(_0x28529b){case _0x8daf('0x2c'):return'imap.gmail.com';case'yahoo':return _0x8daf('0x2d');case _0x8daf('0x2e'):return'imap-mail.outlook.com';case _0x8daf('0x2f'):return _0x8daf('0x30');}throw new Error('Unknown\x20email\x20service\x20provider',_0x28529b);}function getSmtpHost(_0x149a20){switch(_0x149a20){case _0x8daf('0x2c'):return'smtp.gmail.com';case _0x8daf('0x31'):return _0x8daf('0x32');case'hotmail':return'smtp-mail.outlook.com';case _0x8daf('0x2f'):return _0x8daf('0x33');}throw new Error(_0x8daf('0x34'),_0x149a20);}function getAuthenticationOptions(_0x26fbdf,_0x5506fb){var _0x364ada={};var _0x24ce1d={};if(_0x26fbdf){_0x364ada[_0x8daf('0x35')]=_0x24ce1d[_0x8daf('0x35')]=_0x5506fb['username'];_0x364ada[_0x8daf('0x36')]=_0x24ce1d['pass']=_0x5506fb[_0x8daf('0x36')];if(_0x5506fb[_0x8daf('0x37')]){_0x364ada[_0x8daf('0x37')]=_0x24ce1d[_0x8daf('0x37')]=!![];_0x364ada[_0x8daf('0x38')]=_0x24ce1d[_0x8daf('0x38')]=_0x5506fb['CloudProviderId'];_0x364ada[_0x8daf('0x36')]=_0x24ce1d[_0x8daf('0x39')]=null;}else{_0x364ada['CloudProviderId']=_0x24ce1d[_0x8daf('0x38')]=null;}_0x364ada[_0x8daf('0x3a')]=getImapHost(_0x26fbdf);_0x364ada[_0x8daf('0x3b')]=0x3e1;_0x24ce1d[_0x8daf('0x3a')]=getSmtpHost(_0x26fbdf);_0x24ce1d[_0x8daf('0x3b')]=0x24b;_0x24ce1d[_0x8daf('0x3c')]=![];_0x364ada[_0x8daf('0x3d')]=_0x24ce1d[_0x8daf('0x3d')]=null;}else{if(_0x5506fb[_0x8daf('0x3e')]){_0x364ada[_0x8daf('0x35')]=_0x24ce1d['user']=_0x5506fb[_0x8daf('0x3f')];_0x364ada[_0x8daf('0x36')]=_0x24ce1d[_0x8daf('0x39')]=_0x5506fb['password'];}else{_0x364ada[_0x8daf('0x3e')]=_0x24ce1d[_0x8daf('0x3e')]=![];_0x364ada[_0x8daf('0x35')]=_0x24ce1d[_0x8daf('0x35')]=null;_0x364ada[_0x8daf('0x36')]=_0x24ce1d[_0x8daf('0x39')]=null;}_0x364ada[_0x8daf('0x3a')]=_0x5506fb['Imap'][_0x8daf('0x3a')];_0x364ada[_0x8daf('0x3b')]=_0x5506fb[_0x8daf('0x40')][_0x8daf('0x3b')];_0x24ce1d[_0x8daf('0x3a')]=_0x5506fb[_0x8daf('0x41')][_0x8daf('0x3a')];_0x24ce1d[_0x8daf('0x3b')]=_0x5506fb[_0x8daf('0x41')][_0x8daf('0x3b')];}return{'Imap':_0x364ada,'Smtp':_0x24ce1d};}exports[_0x8daf('0x42')]=function(_0x2b49ba,_0x2bcd89){var _0x3f126e={'include':[{'model':db['MailServerIn'],'as':_0x8daf('0x40')},{'model':db['MailServerOut'],'as':_0x8daf('0x41')},{'model':db[_0x8daf('0x43')],'as':_0x8daf('0x44')}]},_0x4bd3ab={},_0x4e3166={'count':0x0,'rows':[]};var _0x4c66f9=_['map'](db[_0x8daf('0x45')][_0x8daf('0x46')],function(_0x1be2d4){return{'name':_0x1be2d4[_0x8daf('0x47')],'type':_0x1be2d4[_0x8daf('0x48')][_0x8daf('0x49')]};});_0x4bd3ab[_0x8daf('0x4a')]=_[_0x8daf('0x4b')](_0x4c66f9,'name');_0x4bd3ab[_0x8daf('0x4c')]=_[_0x8daf('0x4d')](_0x2b49ba[_0x8daf('0x4c')]);_0x4bd3ab['filters']=_[_0x8daf('0x4e')](_0x4bd3ab['model'],_0x4bd3ab[_0x8daf('0x4c')]);_0x3f126e[_0x8daf('0x4f')]=_[_0x8daf('0x4e')](_0x4bd3ab[_0x8daf('0x4a')],qs[_0x8daf('0x50')](_0x2b49ba[_0x8daf('0x4c')][_0x8daf('0x50')]));_0x3f126e['attributes']=_0x3f126e[_0x8daf('0x4f')][_0x8daf('0x51')]?_0x3f126e[_0x8daf('0x4f')]:_0x4bd3ab['model'];if(!_0x2b49ba[_0x8daf('0x4c')]['hasOwnProperty']('nolimit')){_0x3f126e['limit']=qs['limit'](_0x2b49ba['query'][_0x8daf('0x21')]);_0x3f126e[_0x8daf('0x20')]=qs[_0x8daf('0x20')](_0x2b49ba[_0x8daf('0x4c')][_0x8daf('0x20')]);}_0x3f126e[_0x8daf('0x52')]=qs[_0x8daf('0x53')](_0x2b49ba['query'][_0x8daf('0x53')]);_0x3f126e[_0x8daf('0x54')]=qs[_0x8daf('0x55')](_[_0x8daf('0x56')](_0x2b49ba[_0x8daf('0x4c')],_0x4bd3ab[_0x8daf('0x55')]),_0x4c66f9);if(_0x2b49ba['query'][_0x8daf('0x57')]){_0x3f126e[_0x8daf('0x54')]=_[_0x8daf('0x58')](_0x3f126e[_0x8daf('0x54')],{'$or':_[_0x8daf('0x4b')](_0x4c66f9,function(_0x4e64b2){if(_0x4e64b2['type']!=='VIRTUAL'){var _0x7bc075={};_0x7bc075[_0x4e64b2[_0x8daf('0x2a')]]={'$like':'%'+_0x2b49ba['query'][_0x8daf('0x57')]+'%'};return _0x7bc075;}})});}_0x3f126e=_[_0x8daf('0x58')]({},_0x3f126e,_0x2b49ba['options']);var _0x101dfc={'where':_0x3f126e[_0x8daf('0x54')]};return db['MailAccount'][_0x8daf('0x23')](_0x101dfc)[_0x8daf('0x11')](function(_0x7666fd){_0x4e3166['count']=_0x7666fd;if(_0x2b49ba[_0x8daf('0x4c')][_0x8daf('0x59')]){_0x3f126e['include']=[{'all':!![]}];}return db['MailAccount'][_0x8daf('0x5a')](_0x3f126e);})[_0x8daf('0x11')](function(_0x1784b4){_0x4e3166[_0x8daf('0x5b')]=_0x1784b4;return _0x4e3166;})[_0x8daf('0x11')](respondWithFilteredResult(_0x2bcd89,_0x3f126e))[_0x8daf('0x1b')](handleError(_0x2bcd89,null));};exports[_0x8daf('0x5c')]=function(_0x298821,_0x34015f){var _0x4ec5ce={'raw':![],'where':{'id':_0x298821[_0x8daf('0x5d')]['id']},'include':[{'model':db[_0x8daf('0x5e')],'as':'Imap'},{'model':db[_0x8daf('0x5f')],'as':_0x8daf('0x41')},{'model':db[_0x8daf('0x43')],'as':_0x8daf('0x44')}]},_0xbdc8ea={};_0xbdc8ea['model']=_[_0x8daf('0x4d')](db[_0x8daf('0x45')]['rawAttributes']);_0xbdc8ea[_0x8daf('0x4c')]=_['keys'](_0x298821['query']);_0xbdc8ea['filters']=_[_0x8daf('0x4e')](_0xbdc8ea[_0x8daf('0x4a')],_0xbdc8ea[_0x8daf('0x4c')]);_0x4ec5ce['attributes']=_['intersection'](_0xbdc8ea[_0x8daf('0x4a')],qs[_0x8daf('0x50')](_0x298821[_0x8daf('0x4c')][_0x8daf('0x50')]));_0x4ec5ce[_0x8daf('0x4f')]=_0x4ec5ce[_0x8daf('0x4f')][_0x8daf('0x51')]?_0x4ec5ce['attributes']:_0xbdc8ea[_0x8daf('0x4a')];if(_0x298821[_0x8daf('0x4c')][_0x8daf('0x59')]){_0x4ec5ce[_0x8daf('0x60')]=[{'all':!![]}];}_0x4ec5ce=_[_0x8daf('0x58')]({},_0x4ec5ce,_0x298821['options']);return db[_0x8daf('0x45')][_0x8daf('0x61')](_0x4ec5ce)[_0x8daf('0x11')](handleEntityNotFound(_0x34015f,null))['then'](respondWithResult(_0x34015f,null))['catch'](handleError(_0x34015f,null));};exports[_0x8daf('0x25')]=function(_0x3255a9,_0x44e244){if(_0x3255a9[_0x8daf('0x62')]['id']){delete _0x3255a9[_0x8daf('0x62')]['id'];}var _0x17f3a9=_0x3255a9[_0x8daf('0x62')][_0x8daf('0x63')]==='custom'?null:_0x3255a9[_0x8daf('0x62')][_0x8daf('0x63')];var _0x4e5f43=_0x3255a9[_0x8daf('0x62')][_0x8daf('0x40')]||{};var _0x2a599f=_0x3255a9['body']['Smtp']||{};if(_0x17f3a9){_0x4e5f43['host']=getImapHost(_0x17f3a9);_0x4e5f43[_0x8daf('0x3b')]=0x3e1;_0x2a599f['host']=getSmtpHost(_0x17f3a9);_0x2a599f[_0x8daf('0x3b')]=0x24b;_0x2a599f['secure']=![];}if(_0x2a599f[_0x8daf('0x37')]){_0x2a599f[_0x8daf('0x3c')]=![];}else{_0x2a599f['CloudProviderId']=null;}if(!_0x4e5f43['modernAuthentication'])_0x4e5f43['CloudProviderId']=null;_0x3255a9[_0x8daf('0x62')][_0x8daf('0x40')]=_0x4e5f43;_0x3255a9[_0x8daf('0x62')][_0x8daf('0x41')]=_0x2a599f;return db[_0x8daf('0x45')]['find']({'where':{'id':_0x3255a9[_0x8daf('0x5d')]['id']},'include':[{'model':db[_0x8daf('0x5e')],'as':'Imap'},{'model':db[_0x8daf('0x5f')],'as':_0x8daf('0x41')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x44e244,null))[_0x8daf('0x11')](function(_0x30cc32){if(!_0x30cc32)throw new Error('Mail\x20Account\x20not\x20found');if(_0x30cc32[_0x8daf('0x3d')])delete _0x3255a9[_0x8daf('0x62')][_0x8daf('0x40')];return _0x30cc32;})['then'](saveUpdates(_0x3255a9[_0x8daf('0x62')],null))[_0x8daf('0x11')](function(_0x3abc48){if(!_0x3255a9[_0x8daf('0x62')][_0x8daf('0x40')])return _0x3abc48;return db[_0x8daf('0x5e')]['update'](_0x3255a9[_0x8daf('0x62')]['Imap'],{'where':{'MailAccountId':_0x3abc48['id']}})[_0x8daf('0x11')](function(){return _0x3abc48;});})['then'](function(_0x5dd274){if(!_0x3255a9['body'][_0x8daf('0x41')])return _0x5dd274;return db['MailServerOut']['update'](_0x3255a9[_0x8daf('0x62')][_0x8daf('0x41')],{'where':{'MailAccountId':_0x5dd274['id']}})[_0x8daf('0x11')](function(){return _0x5dd274;});})[_0x8daf('0x11')](respondWithResult(_0x44e244,null))['catch'](handleError(_0x44e244,null));};exports[_0x8daf('0x64')]=function(_0x48b1bb,_0x43492c){return db[_0x8daf('0x45')][_0x8daf('0x64')]()['then'](respondWithResult(_0x43492c,null))[_0x8daf('0x1b')](handleError(_0x43492c,null));};exports[_0x8daf('0x65')]=function(_0x3620ef,_0x4828a2){if(_0x3620ef['body']['id']){delete _0x3620ef[_0x8daf('0x62')]['id'];}return db[_0x8daf('0x45')][_0x8daf('0x61')]({'where':{'id':_0x3620ef[_0x8daf('0x5d')]['id']}})[_0x8daf('0x11')](handleEntityNotFound(_0x4828a2,null))[_0x8daf('0x11')](function(_0x1cd723){if(_0x1cd723){_0x3620ef['body'][_0x8daf('0x66')]=_0x1cd723['id'];return db[_0x8daf('0x67')][_0x8daf('0x68')](_0x3620ef['body']);}})[_0x8daf('0x11')](respondWithResult(_0x4828a2,null))['catch'](handleError(_0x4828a2,null));};exports[_0x8daf('0x69')]=function(_0x474fa0,_0x1fd587){var _0x2642f0={'raw':![],'where':{}};var _0x353ed9={};var _0x2accc5={'count':0x0,'rows':[]};return db['MailAccount'][_0x8daf('0x6a')]({'where':{'id':_0x474fa0['params']['id']}})['then'](handleEntityNotFound(_0x1fd587,null))['then'](function(_0x14243a){if(_0x14243a){_0x353ed9['model']=_['keys'](db[_0x8daf('0x67')][_0x8daf('0x46')]);_0x353ed9[_0x8daf('0x4c')]=_['keys'](_0x474fa0[_0x8daf('0x4c')]);_0x353ed9[_0x8daf('0x55')]=_[_0x8daf('0x4e')](_0x353ed9[_0x8daf('0x4a')],_0x353ed9[_0x8daf('0x4c')]);_0x2642f0['attributes']=_[_0x8daf('0x4e')](_0x353ed9['model'],qs[_0x8daf('0x50')](_0x474fa0[_0x8daf('0x4c')][_0x8daf('0x50')]));_0x2642f0['attributes']=_0x2642f0['attributes'][_0x8daf('0x51')]?_0x2642f0[_0x8daf('0x4f')]:_0x353ed9['model'];if(!_0x474fa0[_0x8daf('0x4c')][_0x8daf('0x6b')](_0x8daf('0x6c'))){_0x2642f0[_0x8daf('0x21')]=qs[_0x8daf('0x21')](_0x474fa0[_0x8daf('0x4c')][_0x8daf('0x21')]);_0x2642f0['offset']=qs[_0x8daf('0x20')](_0x474fa0[_0x8daf('0x4c')]['offset']);}_0x2642f0[_0x8daf('0x52')]=qs[_0x8daf('0x53')](_0x474fa0[_0x8daf('0x4c')][_0x8daf('0x53')]);_0x2642f0[_0x8daf('0x54')]=qs[_0x8daf('0x55')](_['pick'](_0x474fa0[_0x8daf('0x4c')],_0x353ed9[_0x8daf('0x55')]));_0x2642f0[_0x8daf('0x54')]['MailAccountId']=_0x14243a['id'];if(_0x474fa0['query'][_0x8daf('0x57')]){_0x2642f0[_0x8daf('0x54')]=_['merge'](_0x2642f0[_0x8daf('0x54')],{'$or':_[_0x8daf('0x4b')](_0x2642f0['attributes'],function(_0x1cd5eb){var _0x56cea4={};_0x56cea4[_0x1cd5eb]={'$like':'%'+_0x474fa0['query'][_0x8daf('0x57')]+'%'};return _0x56cea4;})});}_0x2642f0=_[_0x8daf('0x58')]({},_0x2642f0,_0x474fa0[_0x8daf('0x6d')]);return db['Disposition'][_0x8daf('0x23')]({'where':_0x2642f0['where']})['then'](function(_0x14611f){_0x2accc5['count']=_0x14611f;if(_0x474fa0[_0x8daf('0x4c')][_0x8daf('0x59')]){_0x2642f0[_0x8daf('0x60')]=[{'all':!![]}];}return db['Disposition'][_0x8daf('0x5a')](_0x2642f0);})[_0x8daf('0x11')](function(_0xe37df3){_0x2accc5[_0x8daf('0x5b')]=_0xe37df3;return _0x2accc5;});}})[_0x8daf('0x11')](respondWithFilteredResult(_0x1fd587,_0x2642f0))['catch'](handleError(_0x1fd587,null));};exports[_0x8daf('0x6e')]=function(_0xbad167,_0x217a78){return db['MailAccount'][_0x8daf('0x61')]({'where':{'id':_0xbad167['params']['id']}})[_0x8daf('0x11')](handleEntityNotFound(_0x217a78,null))[_0x8daf('0x11')](function(_0x373079){if(_0x373079){return _0x373079[_0x8daf('0x6e')](_0xbad167['query'][_0x8daf('0x6f')]);}})[_0x8daf('0x11')](respondWithStatusCode(_0x217a78,null))[_0x8daf('0x1b')](handleError(_0x217a78,null));};exports[_0x8daf('0x70')]=function(_0x2e64ad,_0x4d0faa){if(_0x2e64ad[_0x8daf('0x62')]['id']){delete _0x2e64ad[_0x8daf('0x62')]['id'];}return db[_0x8daf('0x45')][_0x8daf('0x61')]({'where':{'id':_0x2e64ad[_0x8daf('0x5d')]['id']}})[_0x8daf('0x11')](handleEntityNotFound(_0x4d0faa,null))[_0x8daf('0x11')](function(_0x409d45){if(_0x409d45){_0x2e64ad[_0x8daf('0x62')][_0x8daf('0x66')]=_0x409d45['id'];return db['CannedAnswer'][_0x8daf('0x68')](_0x2e64ad[_0x8daf('0x62')]);}})[_0x8daf('0x11')](respondWithResult(_0x4d0faa,null))['catch'](handleError(_0x4d0faa,null));};exports['getAnswers']=function(_0xd0757f,_0x43fdb5){var _0x5a4d19={'raw':![],'where':{}};var _0x52cc47={};var _0x41803f={'count':0x0,'rows':[]};return db[_0x8daf('0x45')][_0x8daf('0x6a')]({'where':{'id':_0xd0757f[_0x8daf('0x5d')]['id']}})[_0x8daf('0x11')](handleEntityNotFound(_0x43fdb5,null))['then'](function(_0xc3f531){if(_0xc3f531){_0x52cc47[_0x8daf('0x4a')]=_[_0x8daf('0x4d')](db['CannedAnswer'][_0x8daf('0x46')]);_0x52cc47[_0x8daf('0x4c')]=_['keys'](_0xd0757f[_0x8daf('0x4c')]);_0x52cc47[_0x8daf('0x55')]=_['intersection'](_0x52cc47[_0x8daf('0x4a')],_0x52cc47[_0x8daf('0x4c')]);_0x5a4d19[_0x8daf('0x4f')]=_[_0x8daf('0x4e')](_0x52cc47['model'],qs[_0x8daf('0x50')](_0xd0757f[_0x8daf('0x4c')]['fields']));_0x5a4d19['attributes']=_0x5a4d19['attributes'][_0x8daf('0x51')]?_0x5a4d19[_0x8daf('0x4f')]:_0x52cc47[_0x8daf('0x4a')];if(!_0xd0757f[_0x8daf('0x4c')][_0x8daf('0x6b')]('nolimit')){_0x5a4d19[_0x8daf('0x21')]=qs[_0x8daf('0x21')](_0xd0757f[_0x8daf('0x4c')][_0x8daf('0x21')]);_0x5a4d19['offset']=qs[_0x8daf('0x20')](_0xd0757f['query'][_0x8daf('0x20')]);}_0x5a4d19['order']=qs[_0x8daf('0x53')](_0xd0757f[_0x8daf('0x4c')][_0x8daf('0x53')]);_0x5a4d19[_0x8daf('0x54')]=qs[_0x8daf('0x55')](_[_0x8daf('0x56')](_0xd0757f['query'],_0x52cc47[_0x8daf('0x55')]));_0x5a4d19[_0x8daf('0x54')][_0x8daf('0x66')]=_0xc3f531['id'];if(_0xd0757f[_0x8daf('0x4c')][_0x8daf('0x57')]){_0x5a4d19[_0x8daf('0x54')]=_[_0x8daf('0x58')](_0x5a4d19[_0x8daf('0x54')],{'$or':_[_0x8daf('0x4b')](_0x5a4d19['attributes'],function(_0x3b9665){var _0x1c6f1f={};_0x1c6f1f[_0x3b9665]={'$like':'%'+_0xd0757f['query'][_0x8daf('0x57')]+'%'};return _0x1c6f1f;})});}_0x5a4d19=_[_0x8daf('0x58')]({},_0x5a4d19,_0xd0757f[_0x8daf('0x6d')]);return db[_0x8daf('0x71')]['count']({'where':_0x5a4d19[_0x8daf('0x54')]})[_0x8daf('0x11')](function(_0x457506){_0x41803f[_0x8daf('0x23')]=_0x457506;if(_0xd0757f[_0x8daf('0x4c')]['includeAll']){_0x5a4d19['include']=[{'all':!![]}];}return db[_0x8daf('0x71')][_0x8daf('0x5a')](_0x5a4d19);})[_0x8daf('0x11')](function(_0x1c703d){_0x41803f['rows']=_0x1c703d;return _0x41803f;});}})[_0x8daf('0x11')](respondWithFilteredResult(_0x43fdb5,_0x5a4d19))[_0x8daf('0x1b')](handleError(_0x43fdb5,null));};exports[_0x8daf('0x72')]=function(_0xb3e489,_0x249a02){return db[_0x8daf('0x45')][_0x8daf('0x61')]({'where':{'id':_0xb3e489[_0x8daf('0x5d')]['id']}})[_0x8daf('0x11')](handleEntityNotFound(_0x249a02,null))[_0x8daf('0x11')](function(_0x2c8191){if(_0x2c8191){return _0x2c8191[_0x8daf('0x72')](_0xb3e489[_0x8daf('0x4c')]['ids']);}})[_0x8daf('0x11')](respondWithStatusCode(_0x249a02,null))['catch'](handleError(_0x249a02,null));};exports['create']=function(_0x5e6188,_0x527a66){var _0x47323b={'name':_0x5e6188[_0x8daf('0x62')][_0x8daf('0x2a')],'key':_0x5e6188[_0x8daf('0x62')]['key'],'provider':_0x5e6188['body'][_0x8daf('0x63')]===_0x8daf('0x73')?null:_0x5e6188[_0x8daf('0x62')]['provider'],'email':_0x5e6188[_0x8daf('0x62')]['email'],'ListId':_0x5e6188['body'][_0x8daf('0x74')],'active':!_[_0x8daf('0x75')](_0x5e6188[_0x8daf('0x62')]['active'])?_0x5e6188[_0x8daf('0x62')][_0x8daf('0x76')]:!![],'description':_0x5e6188['body'][_0x8daf('0x77')]||null};var _0x2915e4=getAuthenticationOptions(_0x47323b['provider'],_0x5e6188[_0x8daf('0x62')]);_0x47323b[_0x8daf('0x40')]=_0x2915e4[_0x8daf('0x40')];_0x47323b[_0x8daf('0x41')]=_0x2915e4[_0x8daf('0x41')];return db[_0x8daf('0x45')]['create'](_0x47323b,{'include':[{'model':db[_0x8daf('0x5f')],'as':_0x8daf('0x41')},{'model':db[_0x8daf('0x5e')],'as':_0x8daf('0x40')}]})[_0x8daf('0x11')](function(_0x5ec71a){var _0x201427=_0x5e6188[_0x8daf('0x35')]['get']({'plain':!![]});if(!_0x201427)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x201427[_0x8daf('0x78')]==='user'){var _0x27371c=_0x5ec71a['get']({'plain':!![]});return db['UserProfileSection'][_0x8daf('0x61')]({'where':{'name':_0x8daf('0x79'),'userProfileId':_0x201427[_0x8daf('0x7a')]},'raw':!![]})[_0x8daf('0x11')](function(_0x39d04a){if(_0x39d04a&&_0x39d04a[_0x8daf('0x7b')]===0x0){return db[_0x8daf('0x28')][_0x8daf('0x68')]({'name':_0x27371c[_0x8daf('0x2a')],'resourceId':_0x27371c['id'],'type':_0x39d04a[_0x8daf('0x2a')],'sectionId':_0x39d04a['id']},{})[_0x8daf('0x11')](function(){return _0x5ec71a;});}else{return _0x5ec71a;}})[_0x8daf('0x1b')](function(_0x2fe64d){logger[_0x8daf('0x17')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2fe64d);throw _0x2fe64d;});}return _0x5ec71a;})[_0x8daf('0x11')](respondWithResult(_0x527a66,0xc9))['catch'](handleError(_0x527a66,null));};exports[_0x8daf('0x7c')]=function(_0x2b52a9,_0x216e5b){return db[_0x8daf('0x45')]['findOne']({'where':{'id':_0x2b52a9[_0x8daf('0x5d')]['id']}})[_0x8daf('0x11')](handleEntityNotFound(_0x216e5b,null))[_0x8daf('0x11')](function(_0x248179){if(_0x248179){return _0x248179[_0x8daf('0x7c')]();}return null;})[_0x8daf('0x11')](respondWithResult(_0x216e5b,null))[_0x8daf('0x1b')](handleError(_0x216e5b,null));};exports[_0x8daf('0x7d')]=function(_0x4098c6,_0x127ed8){if(_0x4098c6[_0x8daf('0x62')]['id']){delete _0x4098c6[_0x8daf('0x62')]['id'];}return db['MailAccount'][_0x8daf('0x61')]({'where':{'id':_0x4098c6['params']['id']}})['then'](handleEntityNotFound(_0x127ed8,null))[_0x8daf('0x11')](function(_0x513932){if(_0x513932){_0x4098c6[_0x8daf('0x62')]['MailAccountId']=_0x513932['id'];return db[_0x8daf('0x5e')][_0x8daf('0x68')](_0x4098c6[_0x8daf('0x62')]);}})[_0x8daf('0x11')](respondWithResult(_0x127ed8,null))[_0x8daf('0x1b')](handleError(_0x127ed8,null));};exports[_0x8daf('0x7e')]=function(_0x3fb3d4,_0x3b2b70){return db[_0x8daf('0x45')][_0x8daf('0x6a')]({'where':{'id':_0x3fb3d4[_0x8daf('0x5d')]['id']}})[_0x8daf('0x11')](handleEntityNotFound(_0x3b2b70,null))[_0x8daf('0x11')](function(_0x264f29){if(_0x264f29){return _0x264f29[_0x8daf('0x7f')](null);}return null;})['then'](respondWithStatusCode(_0x3b2b70,null))[_0x8daf('0x1b')](handleError(_0x3b2b70,null));};exports['getSmtp']=function(_0x179c2d,_0x58ad6a){return db[_0x8daf('0x45')]['findOne']({'where':{'id':_0x179c2d[_0x8daf('0x5d')]['id']}})[_0x8daf('0x11')](handleEntityNotFound(_0x58ad6a,null))[_0x8daf('0x11')](function(_0x5afc58){if(_0x5afc58){return _0x5afc58[_0x8daf('0x80')]();}return null;})['then'](respondWithResult(_0x58ad6a,null))[_0x8daf('0x1b')](handleError(_0x58ad6a,null));};exports[_0x8daf('0x81')]=function(_0x443432,_0x50d56e){if(_0x443432[_0x8daf('0x62')]['id']){delete _0x443432[_0x8daf('0x62')]['id'];}return db[_0x8daf('0x45')][_0x8daf('0x61')]({'where':{'id':_0x443432[_0x8daf('0x5d')]['id']}})[_0x8daf('0x11')](handleEntityNotFound(_0x50d56e,null))[_0x8daf('0x11')](function(_0xbc0acd){if(_0xbc0acd){_0x443432[_0x8daf('0x62')][_0x8daf('0x66')]=_0xbc0acd['id'];return db['MailServerOut'][_0x8daf('0x68')](_0x443432['body']);}})[_0x8daf('0x11')](respondWithResult(_0x50d56e,null))[_0x8daf('0x1b')](handleError(_0x50d56e,null));};exports['removeSmtp']=function(_0x3e997f,_0x37499e){return db[_0x8daf('0x45')][_0x8daf('0x6a')]({'where':{'id':_0x3e997f[_0x8daf('0x5d')]['id']}})[_0x8daf('0x11')](handleEntityNotFound(_0x37499e,null))[_0x8daf('0x11')](function(_0x3d70c7){if(_0x3d70c7){return _0x3d70c7[_0x8daf('0x82')](null);}return null;})[_0x8daf('0x11')](respondWithStatusCode(_0x37499e,null))[_0x8daf('0x1b')](handleError(_0x37499e,null));};exports[_0x8daf('0x83')]=function(_0x366f61,_0x50ba67){return db[_0x8daf('0x84')][_0x8daf('0x61')]({'where':{'id':_0x366f61[_0x8daf('0x5d')]['id']}})[_0x8daf('0x11')](handleEntityNotFound(_0x50ba67,null))[_0x8daf('0x11')](function(_0x47ae95){if(_0x47ae95){return _0x47ae95[_0x8daf('0x83')](_0x366f61['body'][_0x8daf('0x6f')],_[_0x8daf('0x85')](_0x366f61[_0x8daf('0x62')],[_0x8daf('0x6f'),'id'])||{});}})[_0x8daf('0x11')](respondWithResult(_0x50ba67,null))['catch'](handleError(_0x50ba67,null));};exports[_0x8daf('0x86')]=function(_0x3e8b9e,_0x36975c){var _0x515a11={'raw':![],'where':{}};var _0x42038d={};var _0x41a779={'count':0x0,'rows':[]};return db[_0x8daf('0x45')][_0x8daf('0x6a')]({'where':{'id':_0x3e8b9e['params']['id']}})['then'](handleEntityNotFound(_0x36975c,null))[_0x8daf('0x11')](function(_0x1a7567){if(_0x1a7567){_0x42038d['model']=_[_0x8daf('0x4d')](db[_0x8daf('0x84')]['rawAttributes']);_0x42038d[_0x8daf('0x4c')]=_['keys'](_0x3e8b9e[_0x8daf('0x4c')]);_0x42038d[_0x8daf('0x55')]=_[_0x8daf('0x4e')](_0x42038d['model'],_0x42038d[_0x8daf('0x4c')]);_0x515a11[_0x8daf('0x4f')]=_['intersection'](_0x42038d['model'],qs['fields'](_0x3e8b9e[_0x8daf('0x4c')][_0x8daf('0x50')]));_0x515a11[_0x8daf('0x4f')]=_0x515a11[_0x8daf('0x4f')][_0x8daf('0x51')]?_0x515a11[_0x8daf('0x4f')]:_0x42038d[_0x8daf('0x4a')];if(!_0x3e8b9e[_0x8daf('0x4c')]['hasOwnProperty'](_0x8daf('0x6c'))){_0x515a11['limit']=qs['limit'](_0x3e8b9e[_0x8daf('0x4c')]['limit']);_0x515a11[_0x8daf('0x20')]=qs[_0x8daf('0x20')](_0x3e8b9e[_0x8daf('0x4c')]['offset']);}_0x515a11[_0x8daf('0x52')]=qs['sort'](_0x3e8b9e[_0x8daf('0x4c')][_0x8daf('0x53')]);_0x515a11[_0x8daf('0x54')]=qs[_0x8daf('0x55')](_['pick'](_0x3e8b9e[_0x8daf('0x4c')],_0x42038d[_0x8daf('0x55')]));_0x515a11['where'][_0x8daf('0x66')]=_0x1a7567['id'];if(_0x3e8b9e[_0x8daf('0x4c')][_0x8daf('0x57')]){_0x515a11[_0x8daf('0x54')]=_[_0x8daf('0x58')](_0x515a11[_0x8daf('0x54')],{'$or':_[_0x8daf('0x4b')](_0x515a11[_0x8daf('0x4f')],function(_0x4fc3ff){var _0x2ce887={};_0x2ce887[_0x4fc3ff]={'$like':'%'+_0x3e8b9e['query']['filter']+'%'};return _0x2ce887;})});}_0x515a11=_[_0x8daf('0x58')]({},_0x515a11,_0x3e8b9e[_0x8daf('0x6d')]);return db[_0x8daf('0x84')][_0x8daf('0x23')]({'where':_0x515a11['where']})[_0x8daf('0x11')](function(_0x1c82b6){_0x41a779[_0x8daf('0x23')]=_0x1c82b6;if(_0x3e8b9e['query'][_0x8daf('0x59')]){_0x515a11[_0x8daf('0x60')]=[{'model':db[_0x8daf('0x87')],'as':_0x8daf('0x88'),'required':![]},{'model':db[_0x8daf('0x89')],'as':_0x8daf('0x8a'),'attributes':[_0x8daf('0x2a'),_0x8daf('0x8b'),_0x8daf('0x8c')],'required':![]},{'model':db[_0x8daf('0x8d')],'as':_0x8daf('0x8e'),'attributes':['id',_0x8daf('0x2a'),_0x8daf('0x8f')],'where':_0x3e8b9e[_0x8daf('0x4c')][_0x8daf('0x90')]?{'id':_0x3e8b9e[_0x8daf('0x4c')][_0x8daf('0x90')]}:undefined,'required':_0x3e8b9e['query'][_0x8daf('0x90')]?!![]:![]}];}return db['MailInteraction'][_0x8daf('0x5a')](_0x515a11);})[_0x8daf('0x11')](function(_0x3630b7){_0x41a779[_0x8daf('0x5b')]=_0x3630b7;return _0x41a779;});}})[_0x8daf('0x11')](respondWithFilteredResult(_0x36975c,_0x515a11))[_0x8daf('0x1b')](handleError(_0x36975c,null));};exports[_0x8daf('0x91')]=function addApplications(_0x17ad72,_0x1ccdcd){var _0x3669a3=_0x17ad72['params']['id'];var _0xc9dd9d=_0x17ad72[_0x8daf('0x62')];var _0x4da182=0xc8;var _0x3d9ec3=null;return db[_0x8daf('0x92')]['transaction']({'isolationLevel':db['sequelize'][_0x8daf('0x93')]['ISOLATION_LEVELS'][_0x8daf('0x94')]},function(_0x3c676e){return db['MailAccount'][_0x8daf('0x6a')]({'where':{'id':_0x3669a3},'transaction':_0x3c676e})[_0x8daf('0x11')](function(_0x2e5bcc){if(_0x2e5bcc){return db[_0x8daf('0x95')][_0x8daf('0x26')]({'where':{'MailAccountId':_0x3669a3},'transaction':_0x3c676e})[_0x8daf('0x11')](function(){var _0x586e07=_[_0x8daf('0x4b')](_0xc9dd9d,function(_0x135f96){_0x135f96[_0x8daf('0x66')]=_0x3669a3;return _0x135f96;});return db[_0x8daf('0x95')][_0x8daf('0x96')](_0x586e07,{'transaction':_0x3c676e});});}else{_0x4da182=0x194;_0x3d9ec3=[];}});})[_0x8daf('0x11')](function(){if(_0x4da182!==0x194){return db[_0x8daf('0x95')][_0x8daf('0x97')]({'where':{'MailAccountId':_0x3669a3},'order':_0x8daf('0x98')})[_0x8daf('0x11')](function(_0x24e346){_0x3d9ec3=_0x24e346;});}})[_0x8daf('0x1b')](function(_0x128748){_0x4da182=0x1f4;logger[_0x8daf('0x17')](_0x128748[_0x8daf('0x29')]);if(_0x128748[_0x8daf('0x2a')]){delete _0x128748[_0x8daf('0x2a')];}_0x3d9ec3=_0x128748;})[_0x8daf('0x99')](function(){if(_0x3d9ec3===null){_0x1ccdcd[_0x8daf('0x1c')](_0x4da182);}else{if(_0x4da182===0x1f4){_0x1ccdcd[_0x8daf('0x1e')](_0x4da182)['send'](_0x3d9ec3);}else{_0x1ccdcd[_0x8daf('0x1e')](_0x4da182)[_0x8daf('0x1f')](_0x3d9ec3);}}});};exports[_0x8daf('0x9a')]=function(_0x5c4279,_0x43abfd){var _0x1a55fa={};var _0x10ce9e={};var _0x289aaf;var _0x1915cd;return db[_0x8daf('0x45')][_0x8daf('0x6a')]({'where':{'id':_0x5c4279[_0x8daf('0x5d')]['id']}})[_0x8daf('0x11')](handleEntityNotFound(_0x43abfd,null))[_0x8daf('0x11')](function(_0x1a78f7){if(_0x1a78f7){_0x289aaf=_0x1a78f7;_0x10ce9e['model']=_[_0x8daf('0x4d')](db[_0x8daf('0x95')][_0x8daf('0x46')]);_0x10ce9e[_0x8daf('0x4c')]=_[_0x8daf('0x4d')](_0x5c4279[_0x8daf('0x4c')]);_0x10ce9e[_0x8daf('0x55')]=_[_0x8daf('0x4e')](_0x10ce9e[_0x8daf('0x4a')],_0x10ce9e[_0x8daf('0x4c')]);_0x1a55fa[_0x8daf('0x4f')]=_[_0x8daf('0x4e')](_0x10ce9e[_0x8daf('0x4a')],qs[_0x8daf('0x50')](_0x5c4279['query']['fields']));_0x1a55fa[_0x8daf('0x4f')]=_0x1a55fa[_0x8daf('0x4f')][_0x8daf('0x51')]?_0x1a55fa[_0x8daf('0x4f')]:_0x10ce9e[_0x8daf('0x4a')];_0x1a55fa[_0x8daf('0x52')]=qs[_0x8daf('0x53')](_0x5c4279['query'][_0x8daf('0x53')]);_0x1a55fa[_0x8daf('0x54')]=qs[_0x8daf('0x55')](_['pick'](_0x5c4279[_0x8daf('0x4c')],_0x10ce9e['filters']));if(_0x5c4279[_0x8daf('0x4c')]['filter']){_0x1a55fa[_0x8daf('0x54')]=_[_0x8daf('0x58')](_0x1a55fa[_0x8daf('0x54')],{'$or':_[_0x8daf('0x4b')](_0x1a55fa['attributes'],function(_0x6cce5c){var _0x3c91b6={};_0x3c91b6[_0x6cce5c]={'$like':'%'+_0x5c4279[_0x8daf('0x4c')]['filter']+'%'};return _0x3c91b6;})});}_0x1a55fa=_[_0x8daf('0x58')]({},_0x1a55fa,_0x5c4279['options']);return _0x289aaf[_0x8daf('0x9a')](_0x1a55fa);}})[_0x8daf('0x11')](function(_0x1eb7c5){if(_0x1eb7c5){_0x1915cd=_0x1eb7c5['length'];if(!_0x5c4279[_0x8daf('0x4c')][_0x8daf('0x6b')](_0x8daf('0x6c'))){_0x1a55fa['limit']=qs['limit'](_0x5c4279['query'][_0x8daf('0x21')]);_0x1a55fa[_0x8daf('0x20')]=qs[_0x8daf('0x20')](_0x5c4279['query'][_0x8daf('0x20')]);}return _0x289aaf[_0x8daf('0x9a')](_0x1a55fa);}})[_0x8daf('0x11')](function(_0x40813c){if(_0x40813c){return _0x40813c?{'count':_0x1915cd,'rows':_0x40813c}:null;}})['then'](respondWithResult(_0x43abfd,null))['catch'](handleError(_0x43abfd,null));};exports['getMessages']=function(_0x560d8e,_0x291b4a){var _0x2a7a4={'raw':!![],'where':{}};var _0x1a6128={};var _0x401bac={'count':0x0,'rows':[]};return db[_0x8daf('0x45')][_0x8daf('0x6a')]({'where':{'id':_0x560d8e['params']['id']}})[_0x8daf('0x11')](handleEntityNotFound(_0x291b4a,null))[_0x8daf('0x11')](function(_0x21fa94){if(_0x21fa94){_0x1a6128[_0x8daf('0x4a')]=_[_0x8daf('0x4d')](db[_0x8daf('0x9b')][_0x8daf('0x46')]);_0x1a6128[_0x8daf('0x4c')]=_[_0x8daf('0x4d')](_0x560d8e[_0x8daf('0x4c')]);_0x1a6128[_0x8daf('0x55')]=_[_0x8daf('0x4e')](_0x1a6128[_0x8daf('0x4a')],_0x1a6128[_0x8daf('0x4c')]);_0x2a7a4[_0x8daf('0x4f')]=_['intersection'](_0x1a6128[_0x8daf('0x4a')],qs[_0x8daf('0x50')](_0x560d8e[_0x8daf('0x4c')]['fields']));_0x2a7a4[_0x8daf('0x4f')]=_0x2a7a4[_0x8daf('0x4f')][_0x8daf('0x51')]?_0x2a7a4[_0x8daf('0x4f')]:_0x1a6128[_0x8daf('0x4a')];if(!_0x560d8e['query']['hasOwnProperty']('nolimit')){_0x2a7a4['limit']=qs[_0x8daf('0x21')](_0x560d8e['query'][_0x8daf('0x21')]);_0x2a7a4['offset']=qs['offset'](_0x560d8e[_0x8daf('0x4c')][_0x8daf('0x20')]);}_0x2a7a4[_0x8daf('0x52')]=qs['sort'](_0x560d8e[_0x8daf('0x4c')][_0x8daf('0x53')]);_0x2a7a4[_0x8daf('0x54')]=qs[_0x8daf('0x55')](_[_0x8daf('0x56')](_0x560d8e[_0x8daf('0x4c')],_0x1a6128[_0x8daf('0x55')]));_0x2a7a4[_0x8daf('0x54')][_0x8daf('0x66')]=_0x21fa94['id'];if(_0x560d8e[_0x8daf('0x4c')][_0x8daf('0x57')]){_0x2a7a4[_0x8daf('0x54')]=_[_0x8daf('0x58')](_0x2a7a4[_0x8daf('0x54')],{'$or':_[_0x8daf('0x4b')](_0x2a7a4[_0x8daf('0x4f')],function(_0x1a3a1e){var _0x4ec5a3={};_0x4ec5a3[_0x1a3a1e]={'$like':'%'+_0x560d8e[_0x8daf('0x4c')][_0x8daf('0x57')]+'%'};return _0x4ec5a3;})});}if(_0x560d8e[_0x8daf('0x4c')][_0x8daf('0x9c')]){var _0x212ad3=_0x560d8e['query'][_0x8daf('0x9c')][_0x8daf('0x9d')](',');var _0x45bc6c={};_0x45bc6c[_0x212ad3[0x0]]={'$gte':moment(_0x212ad3[0x1])[_0x8daf('0x9e')](_0x8daf('0x9f'))};_0x2a7a4['where']=_[_0x8daf('0x58')](_0x2a7a4[_0x8daf('0x54')],_0x45bc6c);}_0x2a7a4=_['merge']({},_0x2a7a4,_0x560d8e[_0x8daf('0x6d')]);return db['MailMessage']['count']({'where':_0x2a7a4['where']})[_0x8daf('0x11')](function(_0x3e495d){_0x401bac['count']=_0x3e495d;if(_0x560d8e['query'][_0x8daf('0x59')]){_0x2a7a4[_0x8daf('0x60')]=[{'all':!![]}];}return db[_0x8daf('0x9b')]['findAll'](_0x2a7a4);})[_0x8daf('0x11')](function(_0x2d148f){if(_0x560d8e[_0x8daf('0x4c')][_0x8daf('0xa0')]==='true'){for(var _0x4b712b=0x0;_0x4b712b<_0x2d148f[_0x8daf('0x51')];_0x4b712b++){_0x2d148f[_0x4b712b][_0x8daf('0x62')]=juice(_0x2d148f[_0x4b712b][_0x8daf('0x62')]);}}_0x401bac[_0x8daf('0x5b')]=_0x2d148f;return _0x401bac;});}})[_0x8daf('0x11')](respondWithFilteredResult(_0x291b4a,_0x2a7a4))['catch'](handleError(_0x291b4a,null));};exports['send']=function(_0x662b97,_0x58139b){var _0x53686a,_0x14eb1e={},_0x47f998;if(_0x662b97[_0x8daf('0x62')]['to']){_0x47f998=_0x662b97[_0x8daf('0x62')]['to'][_0x8daf('0x9d')](',')[0x0];}return db['MailAccount']['find']({'where':{'id':_0x662b97['params']['id']},'include':[{'model':db[_0x8daf('0xa1')],'as':_0x8daf('0xa2'),'include':[{'model':db[_0x8daf('0x87')],'as':_0x8daf('0xa3'),'where':{'email':_0x47f998},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x8daf('0x5f')],'as':_0x8daf('0x41'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x8daf('0xa4'),'raw':!![]}]}]})[_0x8daf('0x11')](handleEntityNotFound(_0x58139b,null))['then'](function(_0xc716a6){if(!_0xc716a6)return;_0x53686a=_0xc716a6;if(!_0xc716a6['Smtp'])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0x8daf('0x75')](_0x662b97[_0x8daf('0x62')][_0x8daf('0xa5')])){_0x662b97['body'][_0x8daf('0xa5')]=util[_0x8daf('0x9e')](_0x8daf('0xa6'),_0xc716a6['name'],_0xc716a6[_0x8daf('0xa7')]||_0xc716a6[_0x8daf('0x41')][_0x8daf('0x35')]);}if(_0x662b97['body']['attachments']&&_0x662b97[_0x8daf('0x62')][_0x8daf('0xa8')]['length']){for(var _0x5c4688=0x0;_0x5c4688<_0x662b97[_0x8daf('0x62')]['attachments']['length'];_0x5c4688+=0x1){_0x662b97[_0x8daf('0x62')][_0x8daf('0xa8')][_0x5c4688]={'filename':_0x662b97[_0x8daf('0x62')][_0x8daf('0xa8')][_0x5c4688]['name'],'path':path[_0x8daf('0xa9')](config['root'],_0x8daf('0xaa'),_0x662b97['body'][_0x8daf('0xa8')][_0x5c4688][_0x8daf('0xab')])};}}var _0x36bb6c=_0xc716a6[_0x8daf('0xac')]();return respondWithRpcPromise(_0x8daf('0xad'),_0x8daf('0xae'),{'account':_0x36bb6c,'message':_0x662b97[_0x8daf('0x62')]});})[_0x8daf('0x11')](function(_0x17f6e0){if(!_0x17f6e0)return;_0x14eb1e=_0x17f6e0;if(!_0x53686a['List'])throw new Error(_0x8daf('0xaf'));if(_0x53686a[_0x8daf('0xa2')][_0x8daf('0xa3')][_0x8daf('0x51')])return _0x53686a[_0x8daf('0xa2')][_0x8daf('0xa3')][0x0];return db[_0x8daf('0x87')][_0x8daf('0x68')](_['defaults'](_0x662b97[_0x8daf('0x62')],{'firstName':_0x662b97['body']['to'],'email':_0x662b97[_0x8daf('0x62')]['to'],'phone':_0x662b97[_0x8daf('0x62')]['to'],'ListId':_0x53686a[_0x8daf('0x74')]}));})['then'](function(_0x3ed1f2){if(!_0x3ed1f2)return;var _0x547881={'UserId':_0x662b97['user']['id'],'ContactId':_0x3ed1f2['id'],'MailAccountId':_0x53686a['id'],'inReplyTo':_0x14eb1e['messageId'],'to':_0x662b97[_0x8daf('0x62')]['from'],'cc':_0x662b97['body']['cc'],'subject':_0x662b97[_0x8daf('0x62')]['subject'],'attach':_0x662b97[_0x8daf('0x62')][_0x8daf('0xb0')],'firstMsgDirection':_0x8daf('0xb1'),'lastMsgAt':moment()[_0x8daf('0x9e')](_0x8daf('0x9f')),'lastMsgDirection':_0x8daf('0xb1'),'Messages':[_[_0x8daf('0x58')](_0x662b97[_0x8daf('0x62')],{'messageId':_0x14eb1e['messageId'],'sentAt':moment()[_0x8daf('0x9e')](_0x8daf('0x9f')),'read':!![],'MailAccountId':_0x53686a['id'],'UserId':_0x662b97['user']['id'],'ContactId':_0x3ed1f2['id']})]};if(_0x662b97[_0x8daf('0x62')]['Interaction']){_0x547881=_[_0x8daf('0x58')](_0x547881,_0x662b97[_0x8daf('0x62')][_0x8daf('0xb2')]);}return db[_0x8daf('0x84')][_0x8daf('0x68')](_0x547881,{'include':[{'model':db[_0x8daf('0x9b')],'as':'Messages'}]});})[_0x8daf('0x11')](respondWithResult(_0x58139b,null))[_0x8daf('0x1b')](handleError(_0x58139b,null));};exports[_0x8daf('0xb3')]=function(_0x21232c,_0x353f1e){return db[_0x8daf('0x45')][_0x8daf('0x61')]({'where':{'id':_0x21232c[_0x8daf('0x5d')]['id']},'include':[{'model':db[_0x8daf('0x5f')],'as':_0x8daf('0x41'),'raw':!![],'include':[{'model':db[_0x8daf('0xa4')],'as':'CloudProvider','raw':!![]}]}]})[_0x8daf('0x11')](handleEntityNotFound(_0x353f1e,null))[_0x8daf('0x11')](function(_0xd47a0b){if(!_0xd47a0b[_0x8daf('0x41')])return;var _0x579363=_0xd47a0b[_0x8daf('0xac')]();return respondWithRpcPromise(_0x8daf('0xb4'),_0x8daf('0xb3'),{'account':_0x579363});})[_0x8daf('0x11')](respondWithResult(_0x353f1e,null))['catch'](handleError(_0x353f1e,null));};exports['destroy']=function(_0x28de9a,_0x1872f9){return db['MailAccount'][_0x8daf('0x61')]({'where':{'id':_0x28de9a[_0x8daf('0x5d')]['id']}})[_0x8daf('0x11')](handleEntityNotFound(_0x1872f9,null))[_0x8daf('0x11')](function(_0xb28571){if(_0xb28571&&_0xb28571[_0x8daf('0x3d')]){throw new db[(_0x8daf('0xb5'))][(_0x8daf('0xb6'))](_0x8daf('0xb7'));}return _0xb28571;})[_0x8daf('0x11')](removeEntity(_0x1872f9,null))[_0x8daf('0x1b')](handleError(_0x1872f9,null));};exports[_0x8daf('0xb8')]=function(_0x3204a6,_0x32f68b){return db[_0x8daf('0x45')][_0x8daf('0x61')]({'where':{'id':_0x3204a6[_0x8daf('0x5d')]['id']}})['then'](handleEntityNotFound(_0x32f68b,null))[_0x8daf('0x11')](function(_0x9f6dad){if(_0x9f6dad){return _0x9f6dad['addAgents'](_0x3204a6[_0x8daf('0x62')]['ids'],_['omit'](_0x3204a6['body'],[_0x8daf('0x6f'),'id'])||{})[_0x8daf('0xb9')](function(_0x45d99b){for(var _0x19c29a=0x0;_0x19c29a<_0x3204a6[_0x8daf('0x62')][_0x8daf('0x6f')][_0x8daf('0x51')];_0x19c29a+=0x1){socket['emit'](_0x8daf('0xba'),{'UserId':Number(_0x3204a6[_0x8daf('0x62')][_0x8daf('0x6f')][_0x19c29a]),'MailAccountId':Number(_0x3204a6[_0x8daf('0x5d')]['id'])});}return _0x45d99b;});}})['then'](respondWithResult(_0x32f68b,null))[_0x8daf('0x1b')](handleError(_0x32f68b,null));};exports[_0x8daf('0xbb')]=function(_0x54c6d5,_0x5d6031){return db['MailAccount'][_0x8daf('0x61')]({'where':{'id':_0x54c6d5[_0x8daf('0x5d')]['id']}})[_0x8daf('0x11')](handleEntityNotFound(_0x5d6031,null))[_0x8daf('0x11')](function(_0x2f9dfd){if(_0x2f9dfd){return _0x2f9dfd[_0x8daf('0xbb')](_0x54c6d5[_0x8daf('0x4c')]['ids'])[_0x8daf('0x11')](function(){if(_[_0x8daf('0xbc')](_0x54c6d5[_0x8daf('0x4c')][_0x8daf('0x6f')])){for(var _0xe39242=0x0;_0xe39242<_0x54c6d5[_0x8daf('0x4c')]['ids']['length'];_0xe39242+=0x1){socket['emit'](_0x8daf('0xbd'),{'UserId':Number(_0x54c6d5['query'][_0x8daf('0x6f')][_0xe39242]),'MailAccountId':Number(_0x54c6d5[_0x8daf('0x5d')]['id'])});}}else{socket[_0x8daf('0xbe')](_0x8daf('0xbd'),{'UserId':Number(_0x54c6d5['query'][_0x8daf('0x6f')]),'MailAccountId':Number(_0x54c6d5[_0x8daf('0x5d')]['id'])});}});}})[_0x8daf('0x11')](respondWithStatusCode(_0x5d6031,null))[_0x8daf('0x1b')](handleError(_0x5d6031,null));};exports[_0x8daf('0xbf')]=function(_0x550bbe,_0x2a34be){var _0x41dc41={};var _0x4f50c2={};var _0x113c48;var _0x22c3de;return db[_0x8daf('0x45')]['findOne']({'where':{'id':_0x550bbe[_0x8daf('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2a34be,null))[_0x8daf('0x11')](function(_0x18fabc){if(_0x18fabc){_0x113c48=_0x18fabc;_0x4f50c2[_0x8daf('0x4a')]=_[_0x8daf('0x4d')](db[_0x8daf('0x89')][_0x8daf('0x46')]);_0x4f50c2[_0x8daf('0x4c')]=_[_0x8daf('0x4d')](_0x550bbe[_0x8daf('0x4c')]);_0x4f50c2[_0x8daf('0x55')]=_['intersection'](_0x4f50c2[_0x8daf('0x4a')],_0x4f50c2[_0x8daf('0x4c')]);_0x41dc41[_0x8daf('0x4f')]=_[_0x8daf('0x4e')](_0x4f50c2[_0x8daf('0x4a')],qs['fields'](_0x550bbe[_0x8daf('0x4c')][_0x8daf('0x50')]));_0x41dc41[_0x8daf('0x4f')]=_0x41dc41['attributes']['length']?_0x41dc41[_0x8daf('0x4f')]:_0x4f50c2['model'];_0x41dc41[_0x8daf('0x52')]=qs['sort'](_0x550bbe[_0x8daf('0x4c')]['sort']);_0x41dc41[_0x8daf('0x54')]=qs[_0x8daf('0x55')](_[_0x8daf('0x56')](_0x550bbe[_0x8daf('0x4c')],_0x4f50c2['filters']));if(_0x550bbe[_0x8daf('0x4c')][_0x8daf('0x57')]){_0x41dc41['where']=_[_0x8daf('0x58')](_0x41dc41[_0x8daf('0x54')],{'$or':_[_0x8daf('0x4b')](_0x41dc41[_0x8daf('0x4f')],function(_0x568f60){var _0x1e7adb={};_0x1e7adb[_0x568f60]={'$like':'%'+_0x550bbe[_0x8daf('0x4c')][_0x8daf('0x57')]+'%'};return _0x1e7adb;})});}_0x41dc41=_[_0x8daf('0x58')]({},_0x41dc41,_0x550bbe['options']);return _0x113c48[_0x8daf('0xbf')](_0x41dc41);}})['then'](function(_0x27edbe){if(_0x27edbe){_0x22c3de=_0x27edbe[_0x8daf('0x51')];if(!_0x550bbe[_0x8daf('0x4c')][_0x8daf('0x6b')]('nolimit')){_0x41dc41[_0x8daf('0x21')]=qs['limit'](_0x550bbe[_0x8daf('0x4c')][_0x8daf('0x21')]);_0x41dc41[_0x8daf('0x20')]=qs[_0x8daf('0x20')](_0x550bbe[_0x8daf('0x4c')][_0x8daf('0x20')]);}return _0x113c48[_0x8daf('0xbf')](_0x41dc41);}})[_0x8daf('0x11')](function(_0x4dedcd){if(_0x4dedcd){return _0x4dedcd?{'count':_0x22c3de,'rows':_0x4dedcd}:null;}})[_0x8daf('0x11')](respondWithResult(_0x2a34be,null))['catch'](handleError(_0x2a34be,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index bd34952..63bc3e7 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 _0x56fd=['../../mysqldb','MailAccount','save','update','remove','emit','exports','events'];(function(_0x39d001,_0x1f6e72){var _0x1f2910=function(_0x1532e8){while(--_0x1532e8){_0x39d001['push'](_0x39d001['shift']());}};_0x1f2910(++_0x1f6e72);}(_0x56fd,0x15f));var _0xd56f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x56fd[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xd56f('0x0'));var MailAccount=require(_0xd56f('0x1'))['db'][_0xd56f('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd56f('0x3'),'afterUpdate':_0xd56f('0x4'),'afterDestroy':_0xd56f('0x5')};function emitEvent(_0x4efac8){return function(_0x572e50,_0x30580f,_0x3a9fb0){MailAccountEvents[_0xd56f('0x6')](_0x4efac8+':'+_0x572e50['id'],_0x572e50);MailAccountEvents[_0xd56f('0x6')](_0x4efac8,_0x572e50);_0x3a9fb0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0xd56f('0x7')]=MailAccountEvents; \ No newline at end of file +var _0x2cd0=['exports','events','../../mysqldb','MailAccount','setMaxListeners','save','update','remove','emit','hook'];(function(_0x2273e0,_0x4c9f32){var _0x1a6a37=function(_0x5eca4a){while(--_0x5eca4a){_0x2273e0['push'](_0x2273e0['shift']());}};_0x1a6a37(++_0x4c9f32);}(_0x2cd0,0x10f));var _0x02cd=function(_0x543f5a,_0x1933fb){_0x543f5a=_0x543f5a-0x0;var _0x3beea6=_0x2cd0[_0x543f5a];return _0x3beea6;};'use strict';var EventEmitter=require(_0x02cd('0x0'));var MailAccount=require(_0x02cd('0x1'))['db'][_0x02cd('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x02cd('0x3')](0x0);var events={'afterCreate':_0x02cd('0x4'),'afterUpdate':_0x02cd('0x5'),'afterDestroy':_0x02cd('0x6')};function emitEvent(_0x215b17){return function(_0x4fecc3,_0x3dfd49,_0x3c4a73){MailAccountEvents[_0x02cd('0x7')](_0x215b17+':'+_0x4fecc3['id'],_0x4fecc3);MailAccountEvents[_0x02cd('0x7')](_0x215b17,_0x4fecc3);_0x3c4a73(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x02cd('0x8')](e,emitEvent(event));}}module[_0x02cd('0x9')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index e01e915..d0d4b62 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 _0x6bf9=['provider','custom','service','host','Smtp','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','data5','user','pass','exports','define','MailAccount','mail_accounts'];(function(_0x4a2897,_0x24f918){var _0x1931a5=function(_0x129a75){while(--_0x129a75){_0x4a2897['push'](_0x4a2897['shift']());}};_0x1931a5(++_0x24f918);}(_0x6bf9,0x12c));var _0x96bf=function(_0x4b4d43,_0x1590f7){_0x4b4d43=_0x4b4d43-0x0;var _0x5706ba=_0x6bf9[_0x4b4d43];return _0x5706ba;};'use strict';var attributes=require('./mailAccount.attributes');module[_0x96bf('0x0')]=function(_0x1b4bbb){return _0x1b4bbb[_0x96bf('0x1')](_0x96bf('0x2'),attributes,{'tableName':_0x96bf('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x2efc50=this;var _0x3d11d6={'id':_0x2efc50['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2efc50[_0x96bf('0x4')]!==_0x96bf('0x5')){_0x3d11d6[_0x96bf('0x6')]=_0x2efc50['provider'];}else{_0x3d11d6[_0x96bf('0x7')]=_0x2efc50[_0x96bf('0x8')][_0x96bf('0x7')];_0x3d11d6[_0x96bf('0x9')]=_0x2efc50[_0x96bf('0x8')][_0x96bf('0x9')];_0x3d11d6[_0x96bf('0xa')]=_0x2efc50[_0x96bf('0x8')]['secure'];}if(_0x2efc50['Smtp'][_0x96bf('0xb')]){if(_0x2efc50['Smtp'][_0x96bf('0xc')]){if(!_0x2efc50['Smtp'][_0x96bf('0xd')])throw new Error(_0x96bf('0xe'));_0x3d11d6['auth']={'type':_0x96bf('0xf'),'user':_0x2efc50[_0x96bf('0x8')]['user'],'accessToken':_0x2efc50[_0x96bf('0x8')][_0x96bf('0xd')][_0x96bf('0x10')]};}else{_0x3d11d6['auth']={'user':_0x2efc50[_0x96bf('0x8')][_0x96bf('0x11')],'pass':_0x2efc50['Smtp'][_0x96bf('0x12')]};}}return _0x3d11d6;}}});}; \ No newline at end of file +var _0xabad=['host','Smtp','port','secure','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','user','data5','exports','define','MailAccount','mail_accounts','provider','service'];(function(_0x58f393,_0x463b8e){var _0x183529=function(_0x54a390){while(--_0x54a390){_0x58f393['push'](_0x58f393['shift']());}};_0x183529(++_0x463b8e);}(_0xabad,0x135));var _0xdaba=function(_0x159969,_0x48b72a){_0x159969=_0x159969-0x0;var _0x21fb4b=_0xabad[_0x159969];return _0x21fb4b;};'use strict';var attributes=require('./mailAccount.attributes');module[_0xdaba('0x0')]=function(_0x19c298){return _0x19c298[_0xdaba('0x1')](_0xdaba('0x2'),attributes,{'tableName':_0xdaba('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x525518=this;var _0x447b7a={'id':_0x525518['id'],'tls':{'rejectUnauthorized':![]}};if(_0x525518[_0xdaba('0x4')]!=='custom'){_0x447b7a[_0xdaba('0x5')]=_0x525518['provider'];}else{_0x447b7a[_0xdaba('0x6')]=_0x525518[_0xdaba('0x7')][_0xdaba('0x6')];_0x447b7a[_0xdaba('0x8')]=_0x525518[_0xdaba('0x7')][_0xdaba('0x8')];_0x447b7a[_0xdaba('0x9')]=_0x525518['Smtp'][_0xdaba('0x9')];}if(_0x525518[_0xdaba('0x7')]['authentication']){if(_0x525518['Smtp']['modernAuthentication']){if(!_0x525518[_0xdaba('0x7')][_0xdaba('0xa')])throw new Error(_0xdaba('0xb'));_0x447b7a[_0xdaba('0xc')]={'type':'OAuth2','user':_0x525518[_0xdaba('0x7')][_0xdaba('0xd')],'accessToken':_0x525518[_0xdaba('0x7')]['CloudProvider'][_0xdaba('0xe')]};}else{_0x447b7a[_0xdaba('0xc')]={'user':_0x525518['Smtp'][_0xdaba('0xd')],'pass':_0x525518['Smtp']['pass']};}}return _0x447b7a;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 440e106..36c4314 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 _0x5fab=['DESC','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','omit','smtpOptions','getSmtpOptions','applications','orderBy','priority','push','length','close','autoclose','*,*,*,*','defaults','ListId','List\x20not\x20found','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','spread','interaction','get','created','create','attachments','originTo','originCc','bcc','originChannel','Email','Attachment','Attachments','UserId','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','findAll','options','attributes','limit','include','model','map','ShowMailAccount','find','where','body','mail','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','account','CmList','List','Contacts','updatedAt'];(function(_0x2dc7c9,_0x3a15f8){var _0x3e6536=function(_0x312829){while(--_0x312829){_0x2dc7c9['push'](_0x2dc7c9['shift']());}};_0x3e6536(++_0x3a15f8);}(_0x5fab,0x177));var _0xb5fa=function(_0x124fbe,_0x5a9dfe){_0x124fbe=_0x124fbe-0x0;var _0x4700d5=_0x5fab[_0x124fbe];return _0x4700d5;};'use strict';var _=require(_0xb5fa('0x0'));var moment=require(_0xb5fa('0x1'));var BPromise=require('bluebird');var rs=require(_0xb5fa('0x2'));var Redis=require(_0xb5fa('0x3'));var db=require(_0xb5fa('0x4'))['db'];var logger=require(_0xb5fa('0x5'))(_0xb5fa('0x6'));var config=require(_0xb5fa('0x7'));var jayson=require(_0xb5fa('0x8'));var client=jayson[_0xb5fa('0x9')][_0xb5fa('0xa')]({'port':0x232c});config[_0xb5fa('0xb')]=_['defaults'](config['redis'],{'host':_0xb5fa('0xc'),'port':0x18eb});var socket=require(_0xb5fa('0xd'))(new Redis(config[_0xb5fa('0xb')]));require('./mailAccount.socket')[_0xb5fa('0xe')](socket);function respondWithRpcPromise(_0x38d9a3,_0x2cf4a5,_0x54c7eb){return new BPromise(function(_0x5b5ea8,_0x3a8e1b){return client[_0xb5fa('0xf')](_0x38d9a3,_0x54c7eb)[_0xb5fa('0x10')](function(_0x44e6c8){logger[_0xb5fa('0x11')](_0xb5fa('0x12'),_0x2cf4a5,_0xb5fa('0x13'));logger[_0xb5fa('0x14')](_0xb5fa('0x15'),_0x2cf4a5,'request\x20sent',JSON[_0xb5fa('0x16')](_0x44e6c8));if(_0x44e6c8[_0xb5fa('0x17')]){if(_0x44e6c8['error'][_0xb5fa('0x18')]===0x1f4){logger['error'](_0xb5fa('0x12'),_0x2cf4a5,_0x44e6c8[_0xb5fa('0x17')][_0xb5fa('0x19')]);return _0x3a8e1b(_0x44e6c8[_0xb5fa('0x17')][_0xb5fa('0x19')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0x2cf4a5,_0x44e6c8[_0xb5fa('0x17')][_0xb5fa('0x19')]);return _0x5b5ea8(_0x44e6c8[_0xb5fa('0x17')][_0xb5fa('0x19')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x2cf4a5,_0xb5fa('0x13'));_0x5b5ea8(_0x44e6c8[_0xb5fa('0x1a')][_0xb5fa('0x19')]);}})[_0xb5fa('0x1b')](function(_0x324ba5){logger[_0xb5fa('0x17')](_0xb5fa('0x12'),_0x2cf4a5,_0x324ba5);_0x3a8e1b(_0x324ba5);});});}exports[_0xb5fa('0x1c')]=function(_0xc14dc4){var _0x368cb1=this;return new Promise(function(_0x3c8d53,_0x1f5064){return db['MailAccount'][_0xb5fa('0x1d')]({'raw':_0xc14dc4['options']?_0xc14dc4[_0xb5fa('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0xc14dc4[_0xb5fa('0x1e')]?_0xc14dc4[_0xb5fa('0x1e')]['where']||null:null,'attributes':_0xc14dc4[_0xb5fa('0x1e')]?_0xc14dc4[_0xb5fa('0x1e')][_0xb5fa('0x1f')]||null:null,'limit':_0xc14dc4['options']?_0xc14dc4[_0xb5fa('0x1e')][_0xb5fa('0x20')]||null:null,'include':_0xc14dc4[_0xb5fa('0x1e')]?_0xc14dc4['options'][_0xb5fa('0x21')]?_['map'](_0xc14dc4[_0xb5fa('0x1e')][_0xb5fa('0x21')],function(_0x11053a){return{'model':db[_0x11053a[_0xb5fa('0x22')]],'as':_0x11053a['as'],'attributes':_0x11053a[_0xb5fa('0x1f')],'include':_0x11053a[_0xb5fa('0x21')]?_[_0xb5fa('0x23')](_0x11053a[_0xb5fa('0x21')],function(_0x568870){return{'model':db[_0x568870['model']],'as':_0x568870['as'],'attributes':_0x568870['attributes'],'include':_0x568870['include']?_[_0xb5fa('0x23')](_0x568870[_0xb5fa('0x21')],function(_0x12c0d4){return{'model':db[_0x12c0d4[_0xb5fa('0x22')]],'as':_0x12c0d4['as'],'attributes':_0x12c0d4[_0xb5fa('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb5fa('0x10')](function(_0x358549){logger[_0xb5fa('0x11')](_0xb5fa('0x1c'),_0xc14dc4);logger[_0xb5fa('0x14')](_0xb5fa('0x1c'),_0xc14dc4,JSON[_0xb5fa('0x16')](_0x358549));_0x3c8d53(_0x358549);})[_0xb5fa('0x1b')](function(_0x1f4380){logger[_0xb5fa('0x17')](_0xb5fa('0x1c'),_0x1f4380[_0xb5fa('0x19')],_0xc14dc4);_0x1f5064(_0x368cb1[_0xb5fa('0x17')](0x1f4,_0x1f4380[_0xb5fa('0x19')]));});});};exports[_0xb5fa('0x24')]=function(_0x291938){var _0x370d95=this;return new Promise(function(_0x10fb43,_0x25fc7c){return db['MailAccount'][_0xb5fa('0x25')]({'raw':_0x291938['options']?_0x291938['options']['raw']===undefined?!![]:![]:!![],'where':_0x291938[_0xb5fa('0x1e')]?_0x291938['options'][_0xb5fa('0x26')]||null:null,'attributes':_0x291938['options']?_0x291938['options'][_0xb5fa('0x1f')]||null:null,'include':_0x291938[_0xb5fa('0x1e')]?_0x291938['options']['include']?_[_0xb5fa('0x23')](_0x291938[_0xb5fa('0x1e')][_0xb5fa('0x21')],function(_0x560b53){return{'model':db[_0x560b53[_0xb5fa('0x22')]],'as':_0x560b53['as'],'attributes':_0x560b53[_0xb5fa('0x1f')],'include':_0x560b53['include']?_[_0xb5fa('0x23')](_0x560b53[_0xb5fa('0x21')],function(_0x204d6b){return{'model':db[_0x204d6b['model']],'as':_0x204d6b['as'],'attributes':_0x204d6b[_0xb5fa('0x1f')],'include':_0x204d6b[_0xb5fa('0x21')]?_[_0xb5fa('0x23')](_0x204d6b['include'],function(_0x117694){return{'model':db[_0x117694[_0xb5fa('0x22')]],'as':_0x117694['as'],'attributes':_0x117694[_0xb5fa('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb5fa('0x10')](function(_0x5e7770){if(_0x291938['options']['smtp']===!![])_0x5e7770['setDataValue']('smtpOptions',_0x5e7770['getSmtpOptions']());logger[_0xb5fa('0x11')]('ShowMailAccount',_0x291938);logger[_0xb5fa('0x14')](_0xb5fa('0x24'),_0x291938,JSON[_0xb5fa('0x16')](_0x5e7770));_0x10fb43(_0x5e7770);})[_0xb5fa('0x1b')](function(_0x40c1c0){logger[_0xb5fa('0x17')]('ShowMailAccount',_0x40c1c0['message'],_0x291938);_0x25fc7c(_0x370d95['error'](0x1f4,_0x40c1c0[_0xb5fa('0x19')]));});});};exports['NotifyMailAccount']=function(_0x73d425){var _0x5addd5=this;return new Promise(function(_0x58aa97,_0x3cdf63){var _0x42d331={'body':_0x73d425[_0xb5fa('0x27')],'channel':_0xb5fa('0x28')};var _0x5bc93f=_[_0xb5fa('0x29')](_[_0xb5fa('0x2a')](db[_0xb5fa('0x2b')][_0xb5fa('0x2c')]),[_0xb5fa('0x2d'),'updatedAt',_0xb5fa('0x2e'),'ListId']);var _0x233f90=![];if(_0x73d425[_0xb5fa('0x27')]['id']){delete _0x73d425[_0xb5fa('0x27')]['id'];}if(_[_0xb5fa('0x2f')](_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x30')])){return _0x3cdf63(_0x5addd5[_0xb5fa('0x17')](0x1f4,_0xb5fa('0x31')));}if(_['isNil'](_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x27')])||_0x73d425['body'][_0xb5fa('0x27')]===''){return _0x3cdf63(_0x5addd5['error'](0x1f4,_0xb5fa('0x32')));}if(_[_0xb5fa('0x2f')](_0x73d425['body']['mapKey'])){return _0x3cdf63(_0x5addd5[_0xb5fa('0x17')](0x1f4,_0xb5fa('0x33')+_0x5bc93f));}if(!_[_0xb5fa('0x34')](_0x5bc93f,_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x35')])){return _0x3cdf63(_0x5addd5[_0xb5fa('0x17')](0x1f4,_0xb5fa('0x36')+_0x5bc93f));}var _0x125a5c={};_0x125a5c[_0x73d425['body'][_0xb5fa('0x35')]]=_0x73d425[_0xb5fa('0x27')]['from'];return db[_0xb5fa('0x37')][_0xb5fa('0x25')]({'where':{'id':_0x73d425[_0xb5fa('0x38')]['id']},'include':[{'model':db[_0xb5fa('0x39')],'as':_0xb5fa('0x3a'),'include':[{'model':db[_0xb5fa('0x2b')],'as':_0xb5fa('0x3b'),'where':_0x125a5c,'limit':0x1,'order':[[_0xb5fa('0x3c'),_0xb5fa('0x3d')]]}]},{'model':db[_0xb5fa('0x3e')],'as':_0xb5fa('0x3f')},{'model':db[_0xb5fa('0x40')],'as':_0xb5fa('0x41'),'include':[{'model':db[_0xb5fa('0x42')],'as':_0xb5fa('0x42')}]}]})[_0xb5fa('0x10')](function(_0x52f5d8){if(_0x52f5d8&&_0x52f5d8['List']){var _0x46194d=_0x52f5d8['get']({'plain':!![]});_0x42d331[_0xb5fa('0x38')]=_[_0xb5fa('0x43')](_0x46194d,['Applications',_0xb5fa('0x3a')]);_0x42d331[_0xb5fa('0x38')][_0xb5fa('0x44')]=_0x52f5d8[_0xb5fa('0x45')]();_0x42d331[_0xb5fa('0x46')]=_0x46194d[_0xb5fa('0x3f')];_0x42d331['list']=_0x46194d[_0xb5fa('0x3a')];_0x42d331['applications']=_[_0xb5fa('0x47')](_0x42d331[_0xb5fa('0x46')],[_0xb5fa('0x48')],['asc']);if(_0x42d331[_0xb5fa('0x38')]&&_0x42d331[_0xb5fa('0x38')]['autoclose']){_0x42d331['applications'][_0xb5fa('0x49')]({'id':0x0,'priority':_0x42d331[_0xb5fa('0x46')][_0xb5fa('0x4a')]+0x1,'app':_0xb5fa('0x4b'),'appdata':_0xb5fa('0x4c'),'interval':_0xb5fa('0x4d')});}if(_0x42d331[_0xb5fa('0x38')][_0xb5fa('0x3f')]){delete _0x42d331[_0xb5fa('0x38')][_0xb5fa('0x3f')];}if(_0x42d331[_0xb5fa('0x38')][_0xb5fa('0x3a')]){delete _0x42d331[_0xb5fa('0x38')][_0xb5fa('0x3a')];}if(_0x46194d[_0xb5fa('0x3a')][_0xb5fa('0x3b')][_0xb5fa('0x4a')]){return _0x46194d[_0xb5fa('0x3a')]['Contacts'][0x0];}var _0x1900a5=_[_0xb5fa('0x4e')](_0x73d425[_0xb5fa('0x27')],{'firstName':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x30')],'ListId':_0x46194d[_0xb5fa('0x4f')]});_0x1900a5[_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x35')]]=_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x30')];return db['CmContact']['create'](_0x1900a5);}else{throw new Error(_0xb5fa('0x50'));}})[_0xb5fa('0x10')](function(_0x1e78cb){_0x42d331['contact']=_0x1e78cb;if(_0x1e78cb){if(!_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')][_0xb5fa('0x51')]){_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')][_0xb5fa('0x51')]=rs[_0xb5fa('0x52')]()+'\x20'+_0x73d425['body'][_0xb5fa('0x19')][_0xb5fa('0x30')];}var _0x4afc02={'ContactId':_0x1e78cb['id'],'MailAccountId':_0x73d425[_0xb5fa('0x38')]['id'],'inReplyTo':_0x73d425[_0xb5fa('0x27')]['message'][_0xb5fa('0x51')],'to':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')][_0xb5fa('0x30')],'cc':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')]['cc'],'subject':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')][_0xb5fa('0x53')],'attach':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')][_0xb5fa('0x54')],'lastMsgAt':moment()[_0xb5fa('0x55')](_0xb5fa('0x56')),'lastMsgDirection':'in'};return db[_0xb5fa('0x57')][_0xb5fa('0x25')]({'where':{'closed':![],'MailAccountId':_0x73d425[_0xb5fa('0x38')]['id']},'include':[{'model':db[_0xb5fa('0x58')],'as':_0xb5fa('0x59'),'attributes':[_0xb5fa('0x51')],'where':{'messageId':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')]['inReplyTo']}}]})[_0xb5fa('0x10')](function(_0x34ebd0){if(_0x34ebd0){return[_0x34ebd0,![]];}return db[_0xb5fa('0x57')]['create'](_0x4afc02)[_0xb5fa('0x10')](function(_0x2d786e){return[_0x2d786e,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xb5fa('0x5a')](function(_0xb535c3,_0x5c25f6){if(_0xb535c3){_0x233f90=_0x5c25f6;if(!_0x5c25f6){return _0xb535c3['update']({'inReplyTo':_0x73d425['body'][_0xb5fa('0x19')][_0xb5fa('0x51')],'to':_0x73d425[_0xb5fa('0x27')]['message'][_0xb5fa('0x30')],'cc':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')]['cc'],'subject':_0x73d425[_0xb5fa('0x27')]['message']['subject'],'attach':_0xb535c3['attach']?_0xb535c3[_0xb5fa('0x54')]:_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')]['attach'],'substatus':null,'substatusAt':moment()[_0xb5fa('0x55')](_0xb5fa('0x56')),'lastMsgAt':moment()[_0xb5fa('0x55')](_0xb5fa('0x56')),'lastMsgDirection':'in'});}else{return _0xb535c3;}}})[_0xb5fa('0x10')](function(_0x36b709){_0x42d331[_0xb5fa('0x5b')]=_0x36b709[_0xb5fa('0x5c')]({'plain':!![]});_0x42d331[_0xb5fa('0x5b')][_0xb5fa('0x5d')]=_0x233f90;return db[_0xb5fa('0x58')][_0xb5fa('0x5e')]({'body':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x27')],'MailAccountId':_0x73d425[_0xb5fa('0x38')]['id'],'MailInteractionId':_0x36b709['id'],'direction':'in','ContactId':_0x42d331['contact']['id'],'messageId':_0x73d425[_0xb5fa('0x27')]['message'][_0xb5fa('0x51')],'from':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')][_0xb5fa('0x30')],'to':_0x73d425[_0xb5fa('0x27')]['message']['to'],'cc':_0x73d425[_0xb5fa('0x27')]['message']['cc'],'subject':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')][_0xb5fa('0x53')],'attach':_0x73d425[_0xb5fa('0x27')]['message']['attach'],'Attachments':_0x73d425['body'][_0xb5fa('0x19')][_0xb5fa('0x5f')],'originTo':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')][_0xb5fa('0x60')],'originCc':_0x73d425[_0xb5fa('0x27')]['message'][_0xb5fa('0x61')],'bcc':_0x73d425['body']['message'][_0xb5fa('0x62')],'ChatWebsiteId':_0x73d425['body']['message']['ChatWebsiteId']||null,'originChannel':_0x73d425[_0xb5fa('0x27')]['message'][_0xb5fa('0x63')]||_0xb5fa('0x64'),'ChatOfflineMessageId':_0x73d425[_0xb5fa('0x27')]['message']['ChatOfflineMessageId']||null},{'include':[{'model':db[_0xb5fa('0x65')],'as':_0xb5fa('0x66')}]});})['then'](function(_0x2d0c95){_0x42d331[_0xb5fa('0x19')]=_0x2d0c95;if(_0x42d331[_0xb5fa('0x5b')][_0xb5fa('0x67')]){return db['User'][_0xb5fa('0x25')]({'attributes':['id',_0xb5fa('0x68')],'where':{'id':_0x42d331[_0xb5fa('0x5b')][_0xb5fa('0x67')]}})[_0xb5fa('0x10')](function(_0x3348f7){if(_0x3348f7){_0x42d331[_0xb5fa('0x46')]['unshift']({'id':0x0,'priority':0x0,'app':_0xb5fa('0x69'),'appdata':_0x3348f7['name']+','+(_0x42d331[_0xb5fa('0x38')][_0xb5fa('0x6a')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xb5fa('0x6b'),_0xb5fa('0x6c'),_0x42d331);});}return respondWithRpcPromise(_0xb5fa('0x6b'),_0xb5fa('0x6c'),_0x42d331);})[_0xb5fa('0x10')](function(_0x8ce5b8){_0x58aa97(_0x8ce5b8);})[_0xb5fa('0x1b')](function(_0x1bac54){_0x3cdf63(_0x5addd5['error'](0x1f4,_0x1bac54[_0xb5fa('0x19')]));});});}; \ No newline at end of file +var _0xc2c7=['defaults','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','findAll','raw','options','where','attributes','include','map','model','ShowMailAccount','MailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','NotifyMailAccount','body','mail','difference','CmContact','rawAttributes','updatedAt','ListId','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','from','account','CmList','List','DESC','MailApplication','Smtp','CloudProvider','get','omit','Applications','applications','orderBy','asc','autoclose','push','close','Contacts','length','List\x20not\x20found','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','Messages','inReplyTo','MailInteraction','create','Contact\x20not\x20found','spread','update','attach','interaction','created','attachments','originTo','originCc','bcc','ChatWebsiteId','Email','Attachment','Attachments','User','name','UserId','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis'];(function(_0x47bdbe,_0x431fed){var _0x5975b7=function(_0x55500b){while(--_0x55500b){_0x47bdbe['push'](_0x47bdbe['shift']());}};_0x5975b7(++_0x431fed);}(_0xc2c7,0x134));var _0x7c2c=function(_0x3b7a0c,_0x352226){_0x3b7a0c=_0x3b7a0c-0x0;var _0x5d96cb=_0xc2c7[_0x3b7a0c];return _0x5d96cb;};'use strict';var _=require('lodash');var moment=require(_0x7c2c('0x0'));var BPromise=require(_0x7c2c('0x1'));var rs=require(_0x7c2c('0x2'));var Redis=require(_0x7c2c('0x3'));var db=require(_0x7c2c('0x4'))['db'];var logger=require(_0x7c2c('0x5'))(_0x7c2c('0x6'));var config=require(_0x7c2c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7c2c('0x8')]({'port':0x232c});config[_0x7c2c('0x9')]=_[_0x7c2c('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7c2c('0x9')]));require(_0x7c2c('0xb'))[_0x7c2c('0xc')](socket);function respondWithRpcPromise(_0x3b780b,_0x279cff,_0x57b107){return new BPromise(function(_0x3093d2,_0x307bec){return client[_0x7c2c('0xd')](_0x3b780b,_0x57b107)[_0x7c2c('0xe')](function(_0x2587ec){logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x279cff,_0x7c2c('0x11'));logger[_0x7c2c('0x12')](_0x7c2c('0x13'),_0x279cff,_0x7c2c('0x11'),JSON[_0x7c2c('0x14')](_0x2587ec));if(_0x2587ec[_0x7c2c('0x15')]){if(_0x2587ec[_0x7c2c('0x15')][_0x7c2c('0x16')]===0x1f4){logger[_0x7c2c('0x15')]('MailAccount,\x20%s,\x20%s',_0x279cff,_0x2587ec['error'][_0x7c2c('0x17')]);return _0x307bec(_0x2587ec[_0x7c2c('0x15')][_0x7c2c('0x17')]);}logger['error'](_0x7c2c('0x10'),_0x279cff,_0x2587ec[_0x7c2c('0x15')]['message']);return _0x3093d2(_0x2587ec[_0x7c2c('0x15')]['message']);}else{logger[_0x7c2c('0xf')]('MailAccount,\x20%s,\x20%s',_0x279cff,_0x7c2c('0x11'));_0x3093d2(_0x2587ec[_0x7c2c('0x18')][_0x7c2c('0x17')]);}})[_0x7c2c('0x19')](function(_0x17df4a){logger[_0x7c2c('0x15')](_0x7c2c('0x10'),_0x279cff,_0x17df4a);_0x307bec(_0x17df4a);});});}exports[_0x7c2c('0x1a')]=function(_0x2d356e){var _0x39c5f3=this;return new Promise(function(_0x40eaef,_0x2381b4){return db['MailAccount'][_0x7c2c('0x1b')]({'raw':_0x2d356e['options']?_0x2d356e['options'][_0x7c2c('0x1c')]===undefined?!![]:![]:!![],'where':_0x2d356e[_0x7c2c('0x1d')]?_0x2d356e[_0x7c2c('0x1d')][_0x7c2c('0x1e')]||null:null,'attributes':_0x2d356e[_0x7c2c('0x1d')]?_0x2d356e[_0x7c2c('0x1d')][_0x7c2c('0x1f')]||null:null,'limit':_0x2d356e['options']?_0x2d356e[_0x7c2c('0x1d')]['limit']||null:null,'include':_0x2d356e[_0x7c2c('0x1d')]?_0x2d356e['options'][_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0x2d356e[_0x7c2c('0x1d')]['include'],function(_0x4d6ec7){return{'model':db[_0x4d6ec7[_0x7c2c('0x22')]],'as':_0x4d6ec7['as'],'attributes':_0x4d6ec7[_0x7c2c('0x1f')],'include':_0x4d6ec7[_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0x4d6ec7[_0x7c2c('0x20')],function(_0xa8e145){return{'model':db[_0xa8e145[_0x7c2c('0x22')]],'as':_0xa8e145['as'],'attributes':_0xa8e145['attributes'],'include':_0xa8e145[_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0xa8e145[_0x7c2c('0x20')],function(_0x22d03f){return{'model':db[_0x22d03f[_0x7c2c('0x22')]],'as':_0x22d03f['as'],'attributes':_0x22d03f[_0x7c2c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7c2c('0xe')](function(_0x26f472){logger[_0x7c2c('0xf')]('GetMailAccount',_0x2d356e);logger[_0x7c2c('0x12')](_0x7c2c('0x1a'),_0x2d356e,JSON[_0x7c2c('0x14')](_0x26f472));_0x40eaef(_0x26f472);})[_0x7c2c('0x19')](function(_0x53ad23){logger[_0x7c2c('0x15')](_0x7c2c('0x1a'),_0x53ad23[_0x7c2c('0x17')],_0x2d356e);_0x2381b4(_0x39c5f3[_0x7c2c('0x15')](0x1f4,_0x53ad23[_0x7c2c('0x17')]));});});};exports[_0x7c2c('0x23')]=function(_0x463ef7){var _0x57af44=this;return new Promise(function(_0x1969f4,_0x1acf75){return db[_0x7c2c('0x24')][_0x7c2c('0x25')]({'raw':_0x463ef7[_0x7c2c('0x1d')]?_0x463ef7['options']['raw']===undefined?!![]:![]:!![],'where':_0x463ef7[_0x7c2c('0x1d')]?_0x463ef7['options']['where']||null:null,'attributes':_0x463ef7[_0x7c2c('0x1d')]?_0x463ef7[_0x7c2c('0x1d')][_0x7c2c('0x1f')]||null:null,'include':_0x463ef7[_0x7c2c('0x1d')]?_0x463ef7['options'][_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0x463ef7[_0x7c2c('0x1d')][_0x7c2c('0x20')],function(_0x204968){return{'model':db[_0x204968[_0x7c2c('0x22')]],'as':_0x204968['as'],'attributes':_0x204968[_0x7c2c('0x1f')],'include':_0x204968[_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0x204968[_0x7c2c('0x20')],function(_0x3230a1){return{'model':db[_0x3230a1[_0x7c2c('0x22')]],'as':_0x3230a1['as'],'attributes':_0x3230a1[_0x7c2c('0x1f')],'include':_0x3230a1['include']?_['map'](_0x3230a1[_0x7c2c('0x20')],function(_0x4acc5d){return{'model':db[_0x4acc5d['model']],'as':_0x4acc5d['as'],'attributes':_0x4acc5d['attributes']};}):[]};}):[]};}):[]:[]})[_0x7c2c('0xe')](function(_0xc77f11){if(_0x463ef7[_0x7c2c('0x1d')][_0x7c2c('0x26')]===!![])_0xc77f11[_0x7c2c('0x27')](_0x7c2c('0x28'),_0xc77f11[_0x7c2c('0x29')]());logger[_0x7c2c('0xf')](_0x7c2c('0x23'),_0x463ef7);logger[_0x7c2c('0x12')](_0x7c2c('0x23'),_0x463ef7,JSON['stringify'](_0xc77f11));_0x1969f4(_0xc77f11);})['catch'](function(_0x3920b6){logger[_0x7c2c('0x15')](_0x7c2c('0x23'),_0x3920b6[_0x7c2c('0x17')],_0x463ef7);_0x1acf75(_0x57af44['error'](0x1f4,_0x3920b6[_0x7c2c('0x17')]));});});};exports[_0x7c2c('0x2a')]=function(_0x93e2a8){var _0x45fddf=this;return new Promise(function(_0x18e288,_0x8b0dc9){var _0x12c9cd={'body':_0x93e2a8[_0x7c2c('0x2b')],'channel':_0x7c2c('0x2c')};var _0x4e1f79=_[_0x7c2c('0x2d')](_['keys'](db[_0x7c2c('0x2e')][_0x7c2c('0x2f')]),['createdAt',_0x7c2c('0x30'),'CompanyId',_0x7c2c('0x31')]);var _0x33b2be=![];if(_0x93e2a8[_0x7c2c('0x2b')]['id']){delete _0x93e2a8[_0x7c2c('0x2b')]['id'];}if(_['isNil'](_0x93e2a8[_0x7c2c('0x2b')]['from'])){return _0x8b0dc9(_0x45fddf['error'](0x1f4,_0x7c2c('0x32')));}if(_[_0x7c2c('0x33')](_0x93e2a8[_0x7c2c('0x2b')]['body'])||_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x2b')]===''){return _0x8b0dc9(_0x45fddf['error'](0x1f4,_0x7c2c('0x34')));}if(_['isNil'](_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x35')])){return _0x8b0dc9(_0x45fddf['error'](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4e1f79));}if(!_[_0x7c2c('0x36')](_0x4e1f79,_0x93e2a8[_0x7c2c('0x2b')]['mapKey'])){return _0x8b0dc9(_0x45fddf[_0x7c2c('0x15')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4e1f79));}var _0x51e3b7={};_0x51e3b7[_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x35')]]=_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x37')];return db[_0x7c2c('0x24')][_0x7c2c('0x25')]({'where':{'id':_0x93e2a8[_0x7c2c('0x38')]['id']},'include':[{'model':db[_0x7c2c('0x39')],'as':_0x7c2c('0x3a'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x51e3b7,'limit':0x1,'order':[[_0x7c2c('0x30'),_0x7c2c('0x3b')]]}]},{'model':db[_0x7c2c('0x3c')],'as':'Applications'},{'model':db['MailServerOut'],'as':_0x7c2c('0x3d'),'include':[{'model':db[_0x7c2c('0x3e')],'as':_0x7c2c('0x3e')}]}]})[_0x7c2c('0xe')](function(_0x5f3de8){if(_0x5f3de8&&_0x5f3de8['List']){var _0x587667=_0x5f3de8[_0x7c2c('0x3f')]({'plain':!![]});_0x12c9cd[_0x7c2c('0x38')]=_[_0x7c2c('0x40')](_0x587667,[_0x7c2c('0x41'),_0x7c2c('0x3a')]);_0x12c9cd['account'][_0x7c2c('0x28')]=_0x5f3de8[_0x7c2c('0x29')]();_0x12c9cd['applications']=_0x587667[_0x7c2c('0x41')];_0x12c9cd['list']=_0x587667[_0x7c2c('0x3a')];_0x12c9cd[_0x7c2c('0x42')]=_[_0x7c2c('0x43')](_0x12c9cd['applications'],['priority'],[_0x7c2c('0x44')]);if(_0x12c9cd['account']&&_0x12c9cd[_0x7c2c('0x38')][_0x7c2c('0x45')]){_0x12c9cd['applications'][_0x7c2c('0x46')]({'id':0x0,'priority':_0x12c9cd[_0x7c2c('0x42')]['length']+0x1,'app':_0x7c2c('0x47'),'appdata':_0x7c2c('0x45'),'interval':'*,*,*,*'});}if(_0x12c9cd[_0x7c2c('0x38')][_0x7c2c('0x41')]){delete _0x12c9cd[_0x7c2c('0x38')]['Applications'];}if(_0x12c9cd[_0x7c2c('0x38')]['List']){delete _0x12c9cd[_0x7c2c('0x38')][_0x7c2c('0x3a')];}if(_0x587667['List'][_0x7c2c('0x48')][_0x7c2c('0x49')]){return _0x587667[_0x7c2c('0x3a')][_0x7c2c('0x48')][0x0];}var _0x481b9e=_[_0x7c2c('0xa')](_0x93e2a8[_0x7c2c('0x2b')],{'firstName':_0x93e2a8['body'][_0x7c2c('0x37')],'ListId':_0x587667['ListId']});_0x481b9e[_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x35')]]=_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x37')];return db[_0x7c2c('0x2e')]['create'](_0x481b9e);}else{throw new Error(_0x7c2c('0x4a'));}})[_0x7c2c('0xe')](function(_0x4c4661){_0x12c9cd['contact']=_0x4c4661;if(_0x4c4661){if(!_0x93e2a8['body'][_0x7c2c('0x17')]['messageId']){_0x93e2a8[_0x7c2c('0x2b')]['message'][_0x7c2c('0x4b')]=rs[_0x7c2c('0x4c')]()+'\x20'+_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x37')];}var _0x1ee34d={'ContactId':_0x4c4661['id'],'MailAccountId':_0x93e2a8[_0x7c2c('0x38')]['id'],'inReplyTo':_0x93e2a8[_0x7c2c('0x2b')]['message']['messageId'],'to':_0x93e2a8['body'][_0x7c2c('0x17')][_0x7c2c('0x37')],'cc':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['cc'],'subject':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x4d')],'attach':_0x93e2a8[_0x7c2c('0x2b')]['message']['attach'],'lastMsgAt':moment()[_0x7c2c('0x4e')](_0x7c2c('0x4f')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x7c2c('0x25')]({'where':{'closed':![],'MailAccountId':_0x93e2a8['account']['id']},'include':[{'model':db['MailMessage'],'as':_0x7c2c('0x50'),'attributes':[_0x7c2c('0x4b')],'where':{'messageId':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x51')]}}]})[_0x7c2c('0xe')](function(_0x2d4459){if(_0x2d4459){return[_0x2d4459,![]];}return db[_0x7c2c('0x52')][_0x7c2c('0x53')](_0x1ee34d)[_0x7c2c('0xe')](function(_0xd01d59){return[_0xd01d59,!![]];});});}else{throw new Error(_0x7c2c('0x54'));}})[_0x7c2c('0x55')](function(_0x3d44f8,_0x559005){if(_0x3d44f8){_0x33b2be=_0x559005;if(!_0x559005){return _0x3d44f8[_0x7c2c('0x56')]({'inReplyTo':_0x93e2a8['body']['message']['messageId'],'to':_0x93e2a8['body'][_0x7c2c('0x17')][_0x7c2c('0x37')],'cc':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['cc'],'subject':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['subject'],'attach':_0x3d44f8[_0x7c2c('0x57')]?_0x3d44f8[_0x7c2c('0x57')]:_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x57')],'substatus':null,'substatusAt':moment()[_0x7c2c('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x7c2c('0x4e')](_0x7c2c('0x4f')),'lastMsgDirection':'in'});}else{return _0x3d44f8;}}})['then'](function(_0x39d319){_0x12c9cd[_0x7c2c('0x58')]=_0x39d319['get']({'plain':!![]});_0x12c9cd[_0x7c2c('0x58')][_0x7c2c('0x59')]=_0x33b2be;return db['MailMessage']['create']({'body':_0x93e2a8[_0x7c2c('0x2b')]['body'],'MailAccountId':_0x93e2a8[_0x7c2c('0x38')]['id'],'MailInteractionId':_0x39d319['id'],'direction':'in','ContactId':_0x12c9cd['contact']['id'],'messageId':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['messageId'],'from':_0x93e2a8[_0x7c2c('0x2b')]['message'][_0x7c2c('0x37')],'to':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['to'],'cc':_0x93e2a8['body'][_0x7c2c('0x17')]['cc'],'subject':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x4d')],'attach':_0x93e2a8['body'][_0x7c2c('0x17')][_0x7c2c('0x57')],'Attachments':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x5a')],'originTo':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x5b')],'originCc':_0x93e2a8[_0x7c2c('0x2b')]['message'][_0x7c2c('0x5c')],'bcc':_0x93e2a8[_0x7c2c('0x2b')]['message'][_0x7c2c('0x5d')],'ChatWebsiteId':_0x93e2a8['body']['message'][_0x7c2c('0x5e')]||null,'originChannel':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['originChannel']||_0x7c2c('0x5f'),'ChatOfflineMessageId':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x7c2c('0x60')],'as':_0x7c2c('0x61')}]});})[_0x7c2c('0xe')](function(_0x8f8b42){_0x12c9cd['message']=_0x8f8b42;if(_0x12c9cd[_0x7c2c('0x58')]['UserId']){return db[_0x7c2c('0x62')]['find']({'attributes':['id',_0x7c2c('0x63')],'where':{'id':_0x12c9cd[_0x7c2c('0x58')][_0x7c2c('0x64')]}})[_0x7c2c('0xe')](function(_0x43eb9d){if(_0x43eb9d){_0x12c9cd[_0x7c2c('0x42')][_0x7c2c('0x65')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x43eb9d[_0x7c2c('0x63')]+','+(_0x12c9cd[_0x7c2c('0x38')][_0x7c2c('0x66')]||0xa),'interval':_0x7c2c('0x67')});}return respondWithRpcPromise(_0x7c2c('0x68'),_0x7c2c('0x69'),_0x12c9cd);});}return respondWithRpcPromise(_0x7c2c('0x68'),_0x7c2c('0x69'),_0x12c9cd);})['then'](function(_0x2d75b8){_0x18e288(_0x2d75b8);})[_0x7c2c('0x19')](function(_0x2391a7){_0x8b0dc9(_0x45fddf[_0x7c2c('0x15')](0x1f4,_0x2391a7[_0x7c2c('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index fc29c22..590ac10 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 _0x6245=['update','emit','removeListener','length','mailAccount:','./mailAccount.events','save','remove'];(function(_0x3056ed,_0x54b8c9){var _0x2c8fb6=function(_0x48c9fe){while(--_0x48c9fe){_0x3056ed['push'](_0x3056ed['shift']());}};_0x2c8fb6(++_0x54b8c9);}(_0x6245,0xe5));var _0x5624=function(_0x5dafd0,_0x3bcbb6){_0x5dafd0=_0x5dafd0-0x0;var _0x364354=_0x6245[_0x5dafd0];return _0x364354;};'use strict';var MailAccountEvents=require(_0x5624('0x0'));var events=[_0x5624('0x1'),_0x5624('0x2'),_0x5624('0x3')];function createListener(_0x5f07bd,_0x39f0ec){return function(_0x3b2b39){_0x39f0ec[_0x5624('0x4')](_0x5f07bd,_0x3b2b39);};}function removeListener(_0x50e974,_0x16da51){return function(){MailAccountEvents[_0x5624('0x5')](_0x50e974,_0x16da51);};}exports['register']=function(_0x269a95){for(var _0x381b4a=0x0,_0x6075af=events[_0x5624('0x6')];_0x381b4a<_0x6075af;_0x381b4a++){var _0x46fad9=events[_0x381b4a];var _0x5f7bf5=createListener(_0x5624('0x7')+_0x46fad9,_0x269a95);MailAccountEvents['on'](_0x46fad9,_0x5f7bf5);}}; \ No newline at end of file +var _0x686e=['removeListener','register','length','mailAccount:','save','remove','update'];(function(_0x55cc6a,_0x5dbd65){var _0x26e2cd=function(_0x3d5c6b){while(--_0x3d5c6b){_0x55cc6a['push'](_0x55cc6a['shift']());}};_0x26e2cd(++_0x5dbd65);}(_0x686e,0xba));var _0xe686=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x686e[_0x3dd15e];return _0x231fd0;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0xe686('0x0'),_0xe686('0x1'),_0xe686('0x2')];function createListener(_0x2e34a3,_0x3aa2f2){return function(_0x42c11d){_0x3aa2f2['emit'](_0x2e34a3,_0x42c11d);};}function removeListener(_0xdc93fd,_0x4a04b3){return function(){MailAccountEvents[_0xe686('0x3')](_0xdc93fd,_0x4a04b3);};}exports[_0xe686('0x4')]=function(_0xe30aa1){for(var _0x5f562d=0x0,_0x3ec620=events[_0xe686('0x5')];_0x5f562d<_0x3ec620;_0x5f562d++){var _0x25f6f8=events[_0x5f562d];var _0x5e68c2=createListener(_0xe686('0x6')+_0x25f6f8,_0xe30aa1);MailAccountEvents['on'](_0x25f6f8,_0x5e68c2);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index bccf71c..75e02eb 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 _0xa1b2=['isAuthenticated','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./mailApplication.controller','/:id','show','put','update'];(function(_0x3bb146,_0x31890e){var _0x2aab55=function(_0x1402e5){while(--_0x1402e5){_0x3bb146['push'](_0x3bb146['shift']());}};_0x2aab55(++_0x31890e);}(_0xa1b2,0x80));var _0x2a1b=function(_0x1688c4,_0x1f3782){_0x1688c4=_0x1688c4-0x0;var _0x57d1cc=_0xa1b2[_0x1688c4];return _0x57d1cc;};'use strict';var multer=require(_0x2a1b('0x0'));var util=require(_0x2a1b('0x1'));var path=require(_0x2a1b('0x2'));var timeout=require(_0x2a1b('0x3'));var express=require(_0x2a1b('0x4'));var router=express['Router']();var fs_extra=require(_0x2a1b('0x5'));var auth=require(_0x2a1b('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2a1b('0x7'));router['get'](_0x2a1b('0x8'),auth['isAuthenticated'](),controller[_0x2a1b('0x9')]);router[_0x2a1b('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x2a1b('0xb')]);router['delete'](_0x2a1b('0x8'),auth[_0x2a1b('0xc')](),controller['destroy']);module[_0x2a1b('0xd')]=router; \ No newline at end of file +var _0x52a1=['isAuthenticated','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x52a1,0x1ae));var _0x152a=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x52a1[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x152a('0x0'));var util=require(_0x152a('0x1'));var path=require(_0x152a('0x2'));var timeout=require(_0x152a('0x3'));var express=require(_0x152a('0x4'));var router=express[_0x152a('0x5')]();var fs_extra=require(_0x152a('0x6'));var auth=require(_0x152a('0x7'));var interaction=require(_0x152a('0x8'));var config=require(_0x152a('0x9'));var controller=require('./mailApplication.controller');router[_0x152a('0xa')](_0x152a('0xb'),auth[_0x152a('0xc')](),controller['show']);router[_0x152a('0xd')]('/:id',auth[_0x152a('0xc')](),controller[_0x152a('0xe')]);router[_0x152a('0xf')](_0x152a('0xb'),auth[_0x152a('0xc')](),controller[_0x152a('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index a8cc2c8..eba014e 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 _0xee4c=['*,*,*,*','sequelize','exports','INTEGER','noop','STRING'];(function(_0x1ea5aa,_0x1bed21){var _0x3b9950=function(_0x145d94){while(--_0x145d94){_0x1ea5aa['push'](_0x1ea5aa['shift']());}};_0x3b9950(++_0x1bed21);}(_0xee4c,0x121));var _0xcee4=function(_0x20e07a,_0x224483){_0x20e07a=_0x20e07a-0x0;var _0x30824b=_0xee4c[_0x20e07a];return _0x30824b;};'use strict';var Sequelize=require(_0xcee4('0x0'));module[_0xcee4('0x1')]={'priority':{'type':Sequelize[_0xcee4('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xcee4('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xcee4('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xcee4('0x5')}}; \ No newline at end of file +var _0xb0b0=['STRING','noop'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xb0b0,0x90));var _0x0b0b=function(_0x426ab4,_0x3aa799){_0x426ab4=_0x426ab4-0x0;var _0x290c07=_0xb0b0[_0x426ab4];return _0x290c07;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x0b0b('0x0')],'allowNull':![],'defaultValue':_0x0b0b('0x1')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x0b0b('0x0')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 97590db..dcf5306 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 _0xa9e0=['includeAll','merge','options','find','catch','body','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','show','params','model','MailApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length'];(function(_0x2b8c5f,_0xed0acf){var _0x5dbc5c=function(_0x58d949){while(--_0x58d949){_0x2b8c5f['push'](_0x2b8c5f['shift']());}};_0x5dbc5c(++_0xed0acf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={'raw':!![],'where':{'id':_0x25fba9[_0x0a9e('0x28')]['id']}},_0x1538a4={};_0x1538a4[_0x0a9e('0x29')]=_['keys'](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x25fba9['query']);_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],_0x1538a4[_0x0a9e('0x2c')]);_0x140511[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],qs[_0x0a9e('0x31')](_0x25fba9[_0x0a9e('0x2c')]['fields']));_0x140511[_0x0a9e('0x30')]=_0x140511['attributes'][_0x0a9e('0x32')]?_0x140511[_0x0a9e('0x30')]:_0x1538a4[_0x0a9e('0x29')];if(_0x25fba9[_0x0a9e('0x2c')][_0x0a9e('0x33')]){_0x140511['include']=[{'all':!![]}];}_0x140511=_[_0x0a9e('0x34')]({},_0x140511,_0x25fba9[_0x0a9e('0x35')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x36')](_0x140511)[_0x0a9e('0x22')](handleEntityNotFound(_0x14433c,null))[_0x0a9e('0x22')](respondWithResult(_0x14433c,null))[_0x0a9e('0x37')](handleError(_0x14433c,null));};exports[_0x0a9e('0x21')]=function(_0x5583a4,_0x44295a){if(_0x5583a4['body']['id']){delete _0x5583a4[_0x0a9e('0x38')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x36')]({'where':{'id':_0x5583a4[_0x0a9e('0x28')]['id']}})['then'](handleEntityNotFound(_0x44295a,null))[_0x0a9e('0x22')](saveUpdates(_0x5583a4[_0x0a9e('0x38')],null))[_0x0a9e('0x22')](respondWithResult(_0x44295a,null))[_0x0a9e('0x37')](handleError(_0x44295a,null));};exports['destroy']=function(_0x54135e,_0x1e8694){return db['MailApplication'][_0x0a9e('0x36')]({'where':{'id':_0x54135e[_0x0a9e('0x28')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x1e8694,null))[_0x0a9e('0x22')](removeEntity(_0x1e8694,null))['catch'](handleError(_0x1e8694,null));}; \ No newline at end of file +var _0xaa88=['limit','count','set','apply','reject','then','stack','name','send','params','model','keys','MailApplication','query','filters','intersection','attributes','fields','length','include','merge','options','find','update','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa88,0x137));var _0x8aa8=function(_0x55d911,_0x2b768c){_0x55d911=_0x55d911-0x0;var _0x3104c2=_0xaa88[_0x55d911];return _0x3104c2;};'use strict';var emlformat=require(_0x8aa8('0x0'));var rimraf=require(_0x8aa8('0x1'));var zipdir=require(_0x8aa8('0x2'));var jsonpatch=require(_0x8aa8('0x3'));var rp=require('request-promise');var moment=require(_0x8aa8('0x4'));var BPromise=require(_0x8aa8('0x5'));var Mustache=require(_0x8aa8('0x6'));var util=require(_0x8aa8('0x7'));var path=require(_0x8aa8('0x8'));var sox=require(_0x8aa8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8aa8('0xa'));var _=require('lodash');var squel=require(_0x8aa8('0xb'));var crypto=require(_0x8aa8('0xc'));var jsforce=require(_0x8aa8('0xd'));var deskjs=require(_0x8aa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8aa8('0xf'));var Papa=require(_0x8aa8('0x10'));var Redis=require(_0x8aa8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8aa8('0x12'));var as=require(_0x8aa8('0x13'));var hardwareService=require(_0x8aa8('0x14'));var logger=require(_0x8aa8('0x15'))('api');var utils=require(_0x8aa8('0x16'));var config=require(_0x8aa8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8aa8('0x18'))['db'];function respondWithStatusCode(_0xa691d6,_0x28132f){_0x28132f=_0x28132f||0xcc;return function(_0x535aa0){if(_0x535aa0){return _0xa691d6[_0x8aa8('0x19')](_0x28132f);}return _0xa691d6[_0x8aa8('0x1a')](_0x28132f)[_0x8aa8('0x1b')]();};}function respondWithResult(_0x4b686e,_0x391642){_0x391642=_0x391642||0xc8;return function(_0x4af534){if(_0x4af534){return _0x4b686e['status'](_0x391642)[_0x8aa8('0x1c')](_0x4af534);}};}function respondWithFilteredResult(_0x200662,_0xae81a0){return function(_0xa6c2af){if(_0xa6c2af){var _0x42a6a4=typeof _0xae81a0[_0x8aa8('0x1d')]===_0x8aa8('0x1e')&&typeof _0xae81a0[_0x8aa8('0x1f')]===_0x8aa8('0x1e');var _0x4e8ce3=_0xa6c2af['count'];var _0x2c1b9a=_0x42a6a4?0x0:_0xae81a0['offset'];var _0x557adc=_0x42a6a4?_0xa6c2af[_0x8aa8('0x20')]:_0xae81a0['offset']+_0xae81a0[_0x8aa8('0x1f')];var _0x41092b;if(_0x557adc>=_0x4e8ce3){_0x557adc=_0x4e8ce3;_0x41092b=0xc8;}else{_0x41092b=0xce;}_0x200662[_0x8aa8('0x1a')](_0x41092b);return _0x200662[_0x8aa8('0x21')]('Content-Range',_0x2c1b9a+'-'+_0x557adc+'/'+_0x4e8ce3)[_0x8aa8('0x1c')](_0xa6c2af);}return null;};}function patchUpdates(_0x36c445){return function(_0x2825fd){try{jsonpatch[_0x8aa8('0x22')](_0x2825fd,_0x36c445,!![]);}catch(_0x4c754e){return BPromise[_0x8aa8('0x23')](_0x4c754e);}return _0x2825fd['save']();};}function saveUpdates(_0x26cf63,_0x4cc455){return function(_0x1fdadd){if(_0x1fdadd){return _0x1fdadd['update'](_0x26cf63)[_0x8aa8('0x24')](function(_0x557e4e){return _0x557e4e;});}return null;};}function removeEntity(_0x65945b,_0x40adb5){return function(_0x3ca7dc){if(_0x3ca7dc){return _0x3ca7dc['destroy']()[_0x8aa8('0x24')](function(){_0x65945b[_0x8aa8('0x1a')](0xcc)[_0x8aa8('0x1b')]();});}};}function handleEntityNotFound(_0x547a7b,_0x57acd2){return function(_0x2d1508){if(!_0x2d1508){_0x547a7b[_0x8aa8('0x19')](0x194);}return _0x2d1508;};}function handleError(_0x2f91f3,_0x3a3c7a){_0x3a3c7a=_0x3a3c7a||0x1f4;return function(_0x24143e){logger['error'](_0x24143e[_0x8aa8('0x25')]);if(_0x24143e['name']){delete _0x24143e[_0x8aa8('0x26')];}_0x2f91f3[_0x8aa8('0x1a')](_0x3a3c7a)[_0x8aa8('0x27')](_0x24143e);};}exports['show']=function(_0x4c5c5c,_0x10810d){var _0x5e96c9={'raw':!![],'where':{'id':_0x4c5c5c[_0x8aa8('0x28')]['id']}},_0x385208={};_0x385208[_0x8aa8('0x29')]=_[_0x8aa8('0x2a')](db[_0x8aa8('0x2b')]['rawAttributes']);_0x385208[_0x8aa8('0x2c')]=_[_0x8aa8('0x2a')](_0x4c5c5c['query']);_0x385208[_0x8aa8('0x2d')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],_0x385208['query']);_0x5e96c9[_0x8aa8('0x2f')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],qs[_0x8aa8('0x30')](_0x4c5c5c[_0x8aa8('0x2c')][_0x8aa8('0x30')]));_0x5e96c9[_0x8aa8('0x2f')]=_0x5e96c9[_0x8aa8('0x2f')][_0x8aa8('0x31')]?_0x5e96c9[_0x8aa8('0x2f')]:_0x385208[_0x8aa8('0x29')];if(_0x4c5c5c['query']['includeAll']){_0x5e96c9[_0x8aa8('0x32')]=[{'all':!![]}];}_0x5e96c9=_[_0x8aa8('0x33')]({},_0x5e96c9,_0x4c5c5c[_0x8aa8('0x34')]);return db[_0x8aa8('0x2b')][_0x8aa8('0x35')](_0x5e96c9)[_0x8aa8('0x24')](handleEntityNotFound(_0x10810d,null))['then'](respondWithResult(_0x10810d,null))['catch'](handleError(_0x10810d,null));};exports[_0x8aa8('0x36')]=function(_0x5755b5,_0x24997c){if(_0x5755b5[_0x8aa8('0x37')]['id']){delete _0x5755b5[_0x8aa8('0x37')]['id'];}return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x5755b5[_0x8aa8('0x28')]['id']}})[_0x8aa8('0x24')](handleEntityNotFound(_0x24997c,null))['then'](saveUpdates(_0x5755b5['body'],null))[_0x8aa8('0x24')](respondWithResult(_0x24997c,null))[_0x8aa8('0x38')](handleError(_0x24997c,null));};exports['destroy']=function(_0x24eb18,_0x2e1f52){return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x24eb18['params']['id']}})['then'](handleEntityNotFound(_0x2e1f52,null))[_0x8aa8('0x24')](removeEntity(_0x2e1f52,null))['catch'](handleError(_0x2e1f52,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 7310740..df09fb8 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 _0x5d07=['../../config/environment','./mailApplication.attributes','define','MailApplication','mail_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','rimraf'];(function(_0x12d796,_0x5a76ff){var _0x35d7d0=function(_0x2b98bd){while(--_0x2b98bd){_0x12d796['push'](_0x12d796['shift']());}};_0x35d7d0(++_0x5a76ff);}(_0x5d07,0x11a));var _0x75d0=function(_0x507614,_0x3ba66e){_0x507614=_0x507614-0x0;var _0x432e1f=_0x5d07[_0x507614];return _0x432e1f;};'use strict';var _=require(_0x75d0('0x0'));var util=require(_0x75d0('0x1'));var logger=require(_0x75d0('0x2'))('api');var moment=require(_0x75d0('0x3'));var BPromise=require(_0x75d0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x75d0('0x5'));var config=require(_0x75d0('0x6'));var attributes=require(_0x75d0('0x7'));module['exports']=function(_0x59996c,_0xf34f6e){return _0x59996c[_0x75d0('0x8')](_0x75d0('0x9'),attributes,{'tableName':_0x75d0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x75d0('0xb')});}; \ No newline at end of file +var _0xd5f2=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','MailApplication','utf8mb4','../../config/logger'];(function(_0x1d382e,_0xb62ed0){var _0x2571ee=function(_0x4c79a1){while(--_0x4c79a1){_0x1d382e['push'](_0x1d382e['shift']());}};_0x2571ee(++_0xb62ed0);}(_0xd5f2,0x103));var _0x2d5f=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0xd5f2[_0xfa634c];return _0x73e478;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2d5f('0x0'))(_0x2d5f('0x1'));var moment=require('moment');var BPromise=require(_0x2d5f('0x2'));var rp=require(_0x2d5f('0x3'));var fs=require('fs');var path=require(_0x2d5f('0x4'));var rimraf=require(_0x2d5f('0x5'));var config=require(_0x2d5f('0x6'));var attributes=require('./mailApplication.attributes');module[_0x2d5f('0x7')]=function(_0x1de6bd,_0xe8c285){return _0x1de6bd['define'](_0x2d5f('0x8'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2d5f('0x9'),'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 c08a2b4..dd59198 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 _0x4df2=['error','MailApplication,\x20%s,\x20%s','message','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw','where','attributes','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','debug','request\x20sent','stringify'];(function(_0x24ade8,_0x1f4af4){var _0x3e2761=function(_0x417043){while(--_0x417043){_0x24ade8['push'](_0x24ade8['shift']());}};_0x3e2761(++_0x1f4af4);}(_0x4df2,0x176));var _0x24df=function(_0x1655ff,_0x43cb20){_0x1655ff=_0x1655ff-0x0;var _0x2c0288=_0x4df2[_0x1655ff];return _0x2c0288;};'use strict';var _=require(_0x24df('0x0'));var util=require(_0x24df('0x1'));var moment=require(_0x24df('0x2'));var BPromise=require(_0x24df('0x3'));var rs=require(_0x24df('0x4'));var fs=require('fs');var Redis=require(_0x24df('0x5'));var db=require(_0x24df('0x6'))['db'];var utils=require(_0x24df('0x7'));var logger=require('../../config/logger')(_0x24df('0x8'));var config=require(_0x24df('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x24df('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2258bb,_0x260cb9,_0x360f16){return new BPromise(function(_0x50bfda,_0x17c1b7){return client[_0x24df('0xb')](_0x2258bb,_0x360f16)[_0x24df('0xc')](function(_0x406e7b){logger['info']('MailApplication,\x20%s,\x20%s',_0x260cb9,'request\x20sent');logger[_0x24df('0xd')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x260cb9,_0x24df('0xe'),JSON[_0x24df('0xf')](_0x406e7b));if(_0x406e7b[_0x24df('0x10')]){if(_0x406e7b['error']['code']===0x1f4){logger[_0x24df('0x10')](_0x24df('0x11'),_0x260cb9,_0x406e7b[_0x24df('0x10')]['message']);return _0x17c1b7(_0x406e7b[_0x24df('0x10')][_0x24df('0x12')]);}logger[_0x24df('0x10')](_0x24df('0x11'),_0x260cb9,_0x406e7b[_0x24df('0x10')][_0x24df('0x12')]);return _0x50bfda(_0x406e7b[_0x24df('0x10')][_0x24df('0x12')]);}else{logger['info'](_0x24df('0x11'),_0x260cb9,'request\x20sent');_0x50bfda(_0x406e7b[_0x24df('0x13')][_0x24df('0x12')]);}})[_0x24df('0x14')](function(_0x219c51){logger[_0x24df('0x10')](_0x24df('0x11'),_0x260cb9,_0x219c51);_0x17c1b7(_0x219c51);});});}exports[_0x24df('0x15')]=function(_0x555bbd){var _0x3bf906=this;return new Promise(function(_0x4f290b,_0x68c844){return db[_0x24df('0x16')][_0x24df('0x17')](_0x555bbd[_0x24df('0x18')],{'raw':_0x555bbd[_0x24df('0x19')]?_0x555bbd[_0x24df('0x19')][_0x24df('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x555bbd['options']?_0x555bbd['options'][_0x24df('0x1b')]||null:null,'attributes':_0x555bbd[_0x24df('0x19')]?_0x555bbd[_0x24df('0x19')][_0x24df('0x1c')]||null:null,'limit':_0x555bbd[_0x24df('0x19')]?_0x555bbd['options']['limit']||null:null})[_0x24df('0xc')](function(_0x345a41){logger[_0x24df('0x1d')](_0x24df('0x15'),_0x555bbd);logger[_0x24df('0xd')](_0x24df('0x15'),_0x555bbd,JSON[_0x24df('0xf')](_0x345a41));_0x4f290b(_0x345a41);})[_0x24df('0x14')](function(_0x4c2295){logger[_0x24df('0x10')](_0x24df('0x15'),_0x4c2295[_0x24df('0x12')],_0x555bbd);_0x68c844(_0x3bf906[_0x24df('0x10')](0x1f4,_0x4c2295[_0x24df('0x12')]));});});}; \ No newline at end of file +var _0x23c3=['jayson/promise','client','then','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','UpdateMailApplication','update','body','options','raw','where','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x1cfda7,_0x134360){var _0xf3189b=function(_0x18d2b1){while(--_0x18d2b1){_0x1cfda7['push'](_0x1cfda7['shift']());}};_0xf3189b(++_0x134360);}(_0x23c3,0x19b));var _0x323c=function(_0x59f0dc,_0x1e2497){_0x59f0dc=_0x59f0dc-0x0;var _0x5b5445=_0x23c3[_0x59f0dc];return _0x5b5445;};'use strict';var _=require(_0x323c('0x0'));var util=require(_0x323c('0x1'));var moment=require(_0x323c('0x2'));var BPromise=require(_0x323c('0x3'));var rs=require(_0x323c('0x4'));var fs=require('fs');var Redis=require(_0x323c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x323c('0x6'))(_0x323c('0x7'));var config=require(_0x323c('0x8'));var jayson=require(_0x323c('0x9'));var client=jayson[_0x323c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a6c81,_0x34d8bc,_0x3e762c){return new BPromise(function(_0x32f6e6,_0x50950a){return client['request'](_0x1a6c81,_0x3e762c)[_0x323c('0xb')](function(_0x279388){logger['info'](_0x323c('0xc'),_0x34d8bc,_0x323c('0xd'));logger[_0x323c('0xe')](_0x323c('0xf'),_0x34d8bc,_0x323c('0xd'),JSON[_0x323c('0x10')](_0x279388));if(_0x279388['error']){if(_0x279388[_0x323c('0x11')][_0x323c('0x12')]===0x1f4){logger['error'](_0x323c('0xc'),_0x34d8bc,_0x279388[_0x323c('0x11')][_0x323c('0x13')]);return _0x50950a(_0x279388[_0x323c('0x11')][_0x323c('0x13')]);}logger[_0x323c('0x11')]('MailApplication,\x20%s,\x20%s',_0x34d8bc,_0x279388[_0x323c('0x11')][_0x323c('0x13')]);return _0x32f6e6(_0x279388[_0x323c('0x11')][_0x323c('0x13')]);}else{logger[_0x323c('0x14')](_0x323c('0xc'),_0x34d8bc,'request\x20sent');_0x32f6e6(_0x279388['result'][_0x323c('0x13')]);}})[_0x323c('0x15')](function(_0x4ac75e){logger[_0x323c('0x11')](_0x323c('0xc'),_0x34d8bc,_0x4ac75e);_0x50950a(_0x4ac75e);});});}exports[_0x323c('0x16')]=function(_0x53ddc5){var _0x75f8fe=this;return new Promise(function(_0x29cd94,_0x2c68e2){return db['MailApplication'][_0x323c('0x17')](_0x53ddc5[_0x323c('0x18')],{'raw':_0x53ddc5[_0x323c('0x19')]?_0x53ddc5[_0x323c('0x19')][_0x323c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53ddc5[_0x323c('0x19')]?_0x53ddc5[_0x323c('0x19')][_0x323c('0x1b')]||null:null,'attributes':_0x53ddc5[_0x323c('0x19')]?_0x53ddc5[_0x323c('0x19')]['attributes']||null:null,'limit':_0x53ddc5[_0x323c('0x19')]?_0x53ddc5['options']['limit']||null:null})[_0x323c('0xb')](function(_0x14905d){logger[_0x323c('0x14')](_0x323c('0x16'),_0x53ddc5);logger[_0x323c('0xe')](_0x323c('0x16'),_0x53ddc5,JSON[_0x323c('0x10')](_0x14905d));_0x29cd94(_0x14905d);})[_0x323c('0x15')](function(_0x3c1901){logger['error'](_0x323c('0x16'),_0x3c1901[_0x323c('0x13')],_0x53ddc5);_0x2c68e2(_0x75f8fe['error'](0x1f4,_0x3c1901[_0x323c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 7892719..926f828 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 _0x1223=['tracked','mail','mailinteraction:addtags','addTags','mailinteraction:update','update','destroy','exports','express','Router','../../components/auth/service','./mailInteraction.controller','get','isAuthenticated','index','/:id','show','/:id/messages','/:id/download','post','create','addMessage','/:id/tags'];(function(_0x404f55,_0x2814e3){var _0x395a9e=function(_0x5846e9){while(--_0x5846e9){_0x404f55['push'](_0x404f55['shift']());}};_0x395a9e(++_0x2814e3);}(_0x1223,0xd7));var _0x3122=function(_0x459f23,_0x3298f7){_0x459f23=_0x459f23-0x0;var _0x3d5b16=_0x1223[_0x459f23];return _0x3d5b16;};'use strict';var express=require(_0x3122('0x0'));var router=express[_0x3122('0x1')]();var auth=require(_0x3122('0x2'));var interaction=require('../../components/interaction/service');var controller=require(_0x3122('0x3'));router[_0x3122('0x4')]('/',auth[_0x3122('0x5')](),controller[_0x3122('0x6')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x3122('0x4')](_0x3122('0x7'),auth[_0x3122('0x5')](),controller[_0x3122('0x8')]);router[_0x3122('0x4')](_0x3122('0x9'),auth[_0x3122('0x5')](),controller['getMessages']);router[_0x3122('0x4')](_0x3122('0xa'),auth['isAuthenticated'](),controller['download']);router[_0x3122('0xb')]('/',auth['isAuthenticated'](),controller[_0x3122('0xc')]);router[_0x3122('0xb')](_0x3122('0x9'),auth[_0x3122('0x5')](),controller[_0x3122('0xd')]);router['post'](_0x3122('0xe'),auth[_0x3122('0x5')](),interaction[_0x3122('0xf')](_0x3122('0x10'),_0x3122('0x11')),controller[_0x3122('0x12')]);router['put'](_0x3122('0x7'),auth['isAuthenticated'](),interaction[_0x3122('0xf')](_0x3122('0x10'),_0x3122('0x13')),controller[_0x3122('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x3122('0x10'),'mailinteraction:destroy'),controller[_0x3122('0x15')]);router['delete'](_0x3122('0xe'),auth['isAuthenticated'](),controller['removeTags']);module[_0x3122('0x16')]=router; \ No newline at end of file +var _0xe963=['destroy','/:id/tags','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','describe','/:id','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','tracked','mailinteraction:addtags','addTags','put','mail','mailinteraction:update','update','delete'];(function(_0x5e4beb,_0x5c3cb2){var _0x46a709=function(_0x2efc6e){while(--_0x2efc6e){_0x5e4beb['push'](_0x5e4beb['shift']());}};_0x46a709(++_0x5c3cb2);}(_0xe963,0xec));var _0x3e96=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe963[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x3e96('0x0'));var router=express[_0x3e96('0x1')]();var auth=require(_0x3e96('0x2'));var interaction=require(_0x3e96('0x3'));var controller=require(_0x3e96('0x4'));router[_0x3e96('0x5')]('/',auth[_0x3e96('0x6')](),controller[_0x3e96('0x7')]);router[_0x3e96('0x5')]('/describe',auth[_0x3e96('0x6')](),controller[_0x3e96('0x8')]);router[_0x3e96('0x5')](_0x3e96('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x3e96('0x5')]('/:id/messages',auth[_0x3e96('0x6')](),controller[_0x3e96('0xa')]);router[_0x3e96('0x5')](_0x3e96('0xb'),auth[_0x3e96('0x6')](),controller[_0x3e96('0xc')]);router[_0x3e96('0xd')]('/',auth[_0x3e96('0x6')](),controller[_0x3e96('0xe')]);router[_0x3e96('0xd')](_0x3e96('0xf'),auth[_0x3e96('0x6')](),controller[_0x3e96('0x10')]);router[_0x3e96('0xd')]('/:id/tags',auth[_0x3e96('0x6')](),interaction[_0x3e96('0x11')]('mail',_0x3e96('0x12')),controller[_0x3e96('0x13')]);router[_0x3e96('0x14')](_0x3e96('0x9'),auth[_0x3e96('0x6')](),interaction[_0x3e96('0x11')](_0x3e96('0x15'),_0x3e96('0x16')),controller[_0x3e96('0x17')]);router[_0x3e96('0x18')](_0x3e96('0x9'),auth['isAuthenticated'](),interaction[_0x3e96('0x11')]('mail','mailinteraction:destroy'),controller[_0x3e96('0x19')]);router['delete'](_0x3e96('0x1a'),auth[_0x3e96('0x6')](),controller[_0x3e96('0x1b')]);module[_0x3e96('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index b920a1f..4ab041b 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 _0x1e47=['ENUM','out','iconv','exports','STRING','TEXT','long','BOOLEAN','DATE'];(function(_0x3be0a8,_0x283c17){var _0x143bba=function(_0x78c731){while(--_0x78c731){_0x3be0a8['push'](_0x3be0a8['shift']());}};_0x143bba(++_0x283c17);}(_0x1e47,0x18e));var _0x71e4=function(_0xce43e1,_0x440bbf){_0xce43e1=_0xce43e1-0x0;var _0x2a0c98=_0x1e47[_0xce43e1];return _0x2a0c98;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x71e4('0x0'));module[_0x71e4('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x71e4('0x2')]},'secondDisposition':{'type':Sequelize[_0x71e4('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x71e4('0x2')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x71e4('0x3')](_0x71e4('0x4'))},'subject':{'type':Sequelize[_0x71e4('0x3')]()},'attach':{'type':Sequelize[_0x71e4('0x5')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x71e4('0x6')]},'substatus':{'type':Sequelize[_0x71e4('0x2')](0x3c)},'substatusAt':{'type':Sequelize[_0x71e4('0x6')]},'firstMsgDirection':{'type':Sequelize[_0x71e4('0x7')]('in',_0x71e4('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x71e4('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x71e4('0x7')]('in',_0x71e4('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x71e4('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0xe15a=['DATE','STRING','TEXT','long','BOOLEAN','ENUM','out','sequelize','exports'];(function(_0x190734,_0x591be1){var _0x52027d=function(_0xbf3cdb){while(--_0xbf3cdb){_0x190734['push'](_0x190734['shift']());}};_0x52027d(++_0x591be1);}(_0xe15a,0x1db));var _0xae15=function(_0x30bd4d,_0x50eb60){_0x30bd4d=_0x30bd4d-0x0;var _0x306915=_0xe15a[_0x30bd4d];return _0x306915;};'use strict';var Sequelize=require(_0xae15('0x0'));var iconv=require('iconv');module[_0xae15('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xae15('0x2')]},'disposition':{'type':Sequelize[_0xae15('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xae15('0x3')]},'note':{'type':Sequelize[_0xae15('0x3')]},'inReplyTo':{'type':Sequelize[_0xae15('0x3')](0x1fe)},'to':{'type':Sequelize[_0xae15('0x3')]},'cc':{'type':Sequelize[_0xae15('0x4')](_0xae15('0x5'))},'subject':{'type':Sequelize[_0xae15('0x4')]()},'attach':{'type':Sequelize[_0xae15('0x6')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xae15('0x2')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0xae15('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xae15('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xae15('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xae15('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xae15('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index ae52e68..d12d370 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 _0xfc87=['Bcc','basename','readFileSync','build','writeFileSync','message%d.eml','eml-format','rimraf','zip-dir','bluebird','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','defaults','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','update','then','destroy','error','stack','name','index','map','MailInteraction','rawAttributes','type','key','getOptions','findAll','mail','user','show','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','create','body','describe','MailMessage','addMessage','omit','ids','getMessages','findOne','nolimit','order','sort','where','MailInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','Tag','emit','removeTags','download','unix','toString','join','root','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','from','bcc','subject','Messages','get','mkdirSync','each','missing.recipient@your.company.com','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers'];(function(_0x19bfdc,_0x50d9e7){var _0x483eb0=function(_0x2fe3ce){while(--_0x2fe3ce){_0x19bfdc['push'](_0x19bfdc['shift']());}};_0x483eb0(++_0x50d9e7);}(_0xfc87,0xea));var _0x7fc8=function(_0x222363,_0x39b651){_0x222363=_0x222363-0x0;var _0x496dd1=_0xfc87[_0x222363];return _0x496dd1;};'use strict';var emlformat=require(_0x7fc8('0x0'));var rimraf=require(_0x7fc8('0x1'));var zipdir=require(_0x7fc8('0x2'));var moment=require('moment');var BPromise=require(_0x7fc8('0x3'));var util=require('util');var path=require(_0x7fc8('0x4'));var fs=require('fs');var _=require(_0x7fc8('0x5'));var juice=require('juice');var Redis=require(_0x7fc8('0x6'));var interaction=require(_0x7fc8('0x7'));var qs=require(_0x7fc8('0x8'));var logger=require(_0x7fc8('0x9'))(_0x7fc8('0xa'));var config=require(_0x7fc8('0xb'));var db=require(_0x7fc8('0xc'))['db'];var htmlEntities=require(_0x7fc8('0xd'));config['redis']=_[_0x7fc8('0xe')](config[_0x7fc8('0xf')],{'host':_0x7fc8('0x10'),'port':0x18eb});var socket=require(_0x7fc8('0x11'))(new Redis(config[_0x7fc8('0xf')]));require(_0x7fc8('0x12'))[_0x7fc8('0x13')](socket);function respondWithStatusCode(_0x5f18d,_0x544bbc){_0x544bbc=_0x544bbc||0xcc;return function(_0x1bfdc0){if(_0x1bfdc0){return _0x5f18d[_0x7fc8('0x14')](_0x544bbc);}return _0x5f18d[_0x7fc8('0x15')](_0x544bbc)[_0x7fc8('0x16')]();};}function respondWithResult(_0x3a5b4f,_0x5c3a33){_0x5c3a33=_0x5c3a33||0xc8;return function(_0x529222){if(_0x529222){return _0x3a5b4f['status'](_0x5c3a33)['json'](_0x529222);}};}function respondWithFilteredResult(_0xad7a41,_0x5ebf19){return function(_0x373368){if(_0x373368){var _0x4ed453=typeof _0x5ebf19[_0x7fc8('0x17')]===_0x7fc8('0x18')&&typeof _0x5ebf19[_0x7fc8('0x19')]===_0x7fc8('0x18');var _0x4d6a6d=_0x373368[_0x7fc8('0x1a')];var _0x1eb32=_0x4ed453?0x0:_0x5ebf19[_0x7fc8('0x17')];var _0x351ce8=_0x4ed453?_0x373368[_0x7fc8('0x1a')]:_0x5ebf19[_0x7fc8('0x17')]+_0x5ebf19[_0x7fc8('0x19')];var _0xd96ae5;if(_0x351ce8>=_0x4d6a6d){_0x351ce8=_0x4d6a6d;_0xd96ae5=0xc8;}else{_0xd96ae5=0xce;}_0xad7a41[_0x7fc8('0x15')](_0xd96ae5);return _0xad7a41['set'](_0x7fc8('0x1b'),_0x1eb32+'-'+_0x351ce8+'/'+_0x4d6a6d)[_0x7fc8('0x1c')](_0x373368);}return null;};}function saveUpdates(_0x5a494f){return function(_0x54ec35){if(_0x54ec35){return _0x54ec35[_0x7fc8('0x1d')](_0x5a494f)[_0x7fc8('0x1e')](function(_0x11bdc4){return _0x11bdc4;});}return null;};}function removeEntity(_0x3e9856){return function(_0x524474){if(_0x524474){return _0x524474[_0x7fc8('0x1f')]()['then'](function(){_0x3e9856[_0x7fc8('0x15')](0xcc)[_0x7fc8('0x16')]();});}};}function handleEntityNotFound(_0x2b8fcc){return function(_0x580faa){if(!_0x580faa){_0x2b8fcc[_0x7fc8('0x14')](0x194);}return _0x580faa;};}function handleError(_0x1dfa53,_0x11f74d){_0x11f74d=_0x11f74d||0x1f4;return function(_0x1af9c3){logger[_0x7fc8('0x20')](_0x1af9c3[_0x7fc8('0x21')]);if(_0x1af9c3[_0x7fc8('0x22')]){delete _0x1af9c3[_0x7fc8('0x22')];}_0x1dfa53['status'](_0x11f74d)['send'](_0x1af9c3);};}exports[_0x7fc8('0x23')]=function(_0x119955,_0x4708e5){var _0x13165e={};var _0x51641a=_[_0x7fc8('0x24')](db[_0x7fc8('0x25')][_0x7fc8('0x26')],function(_0x8f7cac){return{'name':_0x8f7cac['fieldName'],'type':_0x8f7cac[_0x7fc8('0x27')][_0x7fc8('0x28')]};});_0x13165e=qs[_0x7fc8('0x29')](_0x51641a,_0x119955);return interaction[_0x7fc8('0x2a')](_0x7fc8('0x2b'),_0x119955['query'],_0x119955[_0x7fc8('0x2c')],_0x13165e,_0x51641a)[_0x7fc8('0x1e')](respondWithFilteredResult(_0x4708e5,_0x13165e))['catch'](handleError(_0x4708e5,null));};exports[_0x7fc8('0x2d')]=function(_0x582136,_0x574853){var _0x40de71={'raw':![],'where':{'id':_0x582136[_0x7fc8('0x2e')]['id']}},_0x13e3bb={};_0x13e3bb[_0x7fc8('0x2f')]=_[_0x7fc8('0x30')](db['MailInteraction'][_0x7fc8('0x26')]);_0x13e3bb[_0x7fc8('0x31')]=_[_0x7fc8('0x30')](_0x582136[_0x7fc8('0x31')]);_0x13e3bb[_0x7fc8('0x32')]=_[_0x7fc8('0x33')](_0x13e3bb['model'],_0x13e3bb[_0x7fc8('0x31')]);_0x40de71[_0x7fc8('0x34')]=_[_0x7fc8('0x33')](_0x13e3bb['model'],qs[_0x7fc8('0x35')](_0x582136[_0x7fc8('0x31')][_0x7fc8('0x35')]));_0x40de71[_0x7fc8('0x34')]=_0x40de71[_0x7fc8('0x34')][_0x7fc8('0x36')]?_0x40de71[_0x7fc8('0x34')]:_0x13e3bb[_0x7fc8('0x2f')];if(_0x582136['query'][_0x7fc8('0x37')]){_0x40de71[_0x7fc8('0x38')]=[{'all':!![]}];}_0x40de71=_[_0x7fc8('0x39')]({},_0x40de71,_0x582136[_0x7fc8('0x3a')]);return db[_0x7fc8('0x25')][_0x7fc8('0x3b')](_0x40de71)[_0x7fc8('0x1e')](handleEntityNotFound(_0x574853,null))[_0x7fc8('0x1e')](respondWithResult(_0x574853,null))[_0x7fc8('0x3c')](handleError(_0x574853,null));};exports[_0x7fc8('0x3d')]=function(_0x49768c,_0x2aa6d9){return db[_0x7fc8('0x25')][_0x7fc8('0x3d')](_0x49768c[_0x7fc8('0x3e')],{})['then'](respondWithResult(_0x2aa6d9,0xc9))[_0x7fc8('0x3c')](handleError(_0x2aa6d9,null));};exports['update']=function(_0x1936bb,_0x43d6a8){if(_0x1936bb[_0x7fc8('0x3e')]['id']){delete _0x1936bb[_0x7fc8('0x3e')]['id'];}return db[_0x7fc8('0x25')][_0x7fc8('0x3b')]({'where':{'id':_0x1936bb[_0x7fc8('0x2e')]['id']}})[_0x7fc8('0x1e')](handleEntityNotFound(_0x43d6a8,null))[_0x7fc8('0x1e')](saveUpdates(_0x1936bb[_0x7fc8('0x3e')],null))[_0x7fc8('0x1e')](respondWithResult(_0x43d6a8,null))['catch'](handleError(_0x43d6a8,null));};exports['destroy']=function(_0x29034c,_0x11631f){return db[_0x7fc8('0x25')]['find']({'where':{'id':_0x29034c[_0x7fc8('0x2e')]['id']}})[_0x7fc8('0x1e')](handleEntityNotFound(_0x11631f,null))['then'](removeEntity(_0x11631f,null))[_0x7fc8('0x3c')](handleError(_0x11631f,null));};exports[_0x7fc8('0x3f')]=function(_0x37edb9,_0x545388){return db['MailInteraction'][_0x7fc8('0x3f')]()[_0x7fc8('0x1e')](respondWithResult(_0x545388,null))[_0x7fc8('0x3c')](handleError(_0x545388,null));};exports['addMessage']=function(_0x5c11cd,_0x109c95){return db[_0x7fc8('0x40')]['find']({'where':{'id':_0x5c11cd[_0x7fc8('0x2e')]['id']}})[_0x7fc8('0x1e')](handleEntityNotFound(_0x109c95,null))['then'](function(_0x10fe2b){if(_0x10fe2b){return _0x10fe2b[_0x7fc8('0x41')](_0x5c11cd[_0x7fc8('0x3e')]['ids'],_[_0x7fc8('0x42')](_0x5c11cd['body'],[_0x7fc8('0x43'),'id'])||{});}})[_0x7fc8('0x1e')](respondWithResult(_0x109c95,null))['catch'](handleError(_0x109c95,null));};exports[_0x7fc8('0x44')]=function(_0x44cbe4,_0x220102){var _0x47ea21={'raw':![],'where':{}};var _0x2b22b8={};var _0x349f81={'count':0x0,'rows':[]};return db[_0x7fc8('0x25')][_0x7fc8('0x45')]({'where':{'id':_0x44cbe4[_0x7fc8('0x2e')]['id']}})[_0x7fc8('0x1e')](handleEntityNotFound(_0x220102,null))[_0x7fc8('0x1e')](function(_0x5cbe40){if(_0x5cbe40){_0x2b22b8[_0x7fc8('0x2f')]=_[_0x7fc8('0x30')](db[_0x7fc8('0x40')][_0x7fc8('0x26')]);_0x2b22b8[_0x7fc8('0x31')]=_[_0x7fc8('0x30')](_0x44cbe4[_0x7fc8('0x31')]);_0x2b22b8[_0x7fc8('0x32')]=_[_0x7fc8('0x33')](_0x2b22b8['model'],_0x2b22b8[_0x7fc8('0x31')]);_0x47ea21[_0x7fc8('0x34')]=_[_0x7fc8('0x33')](_0x2b22b8[_0x7fc8('0x2f')],qs[_0x7fc8('0x35')](_0x44cbe4[_0x7fc8('0x31')]['fields']));_0x47ea21[_0x7fc8('0x34')]=_0x47ea21[_0x7fc8('0x34')][_0x7fc8('0x36')]?_0x47ea21[_0x7fc8('0x34')]:_0x2b22b8[_0x7fc8('0x2f')];if(!_0x44cbe4[_0x7fc8('0x31')]['hasOwnProperty'](_0x7fc8('0x46'))){_0x47ea21['limit']=qs[_0x7fc8('0x19')](_0x44cbe4[_0x7fc8('0x31')][_0x7fc8('0x19')]);_0x47ea21['offset']=qs[_0x7fc8('0x17')](_0x44cbe4[_0x7fc8('0x31')][_0x7fc8('0x17')]);}_0x47ea21[_0x7fc8('0x47')]=qs['sort'](_0x44cbe4[_0x7fc8('0x31')][_0x7fc8('0x48')]);_0x47ea21[_0x7fc8('0x49')]=qs['filters'](_['pick'](_0x44cbe4['query'],_0x2b22b8[_0x7fc8('0x32')]));_0x47ea21[_0x7fc8('0x49')][_0x7fc8('0x4a')]=_0x5cbe40['id'];if(_0x44cbe4['query'][_0x7fc8('0x4b')]){_0x47ea21[_0x7fc8('0x49')]=_['merge'](_0x47ea21[_0x7fc8('0x49')],{'$or':_['map'](_0x47ea21[_0x7fc8('0x34')],function(_0x304614){var _0x366b03={};_0x366b03[_0x304614]={'$like':'%'+_0x44cbe4['query']['filter']+'%'};return _0x366b03;})});}if(_0x44cbe4[_0x7fc8('0x31')][_0x7fc8('0x4c')]){var _0x1ccc91=_0x44cbe4[_0x7fc8('0x31')][_0x7fc8('0x4c')][_0x7fc8('0x4d')](',');var _0x240d4a={};_0x240d4a[_0x1ccc91[0x0]]={'$gte':moment(_0x1ccc91[0x1])[_0x7fc8('0x4e')](_0x7fc8('0x4f'))};_0x47ea21[_0x7fc8('0x49')]=_[_0x7fc8('0x39')](_0x47ea21[_0x7fc8('0x49')],_0x240d4a);}_0x47ea21=_[_0x7fc8('0x39')]({},_0x47ea21,_0x44cbe4['options']);return db['MailMessage']['count']({'where':_0x47ea21['where']})[_0x7fc8('0x1e')](function(_0x265181){_0x349f81[_0x7fc8('0x1a')]=_0x265181;if(_0x44cbe4['query'][_0x7fc8('0x37')]){_0x47ea21[_0x7fc8('0x38')]=[{'all':!![]}];}return db['MailMessage'][_0x7fc8('0x2a')](_0x47ea21);})[_0x7fc8('0x1e')](function(_0x10ffbd){if(_0x44cbe4['query']['inlineCss']==='true'){for(var _0x464cf3=0x0;_0x464cf3<_0x10ffbd['length'];_0x464cf3++){_0x10ffbd[_0x464cf3][_0x7fc8('0x3e')]=juice(_0x10ffbd[_0x464cf3][_0x7fc8('0x3e')]);}}_0x349f81[_0x7fc8('0x50')]=_0x10ffbd;return _0x349f81;});}})[_0x7fc8('0x1e')](respondWithFilteredResult(_0x220102,_0x47ea21))['catch'](handleError(_0x220102,null));};exports[_0x7fc8('0x51')]=function(_0x329f75,_0x20a3df){return db[_0x7fc8('0x25')][_0x7fc8('0x3b')]({'where':{'id':_0x329f75[_0x7fc8('0x2e')]['id']}})[_0x7fc8('0x1e')](handleEntityNotFound(_0x20a3df,null))[_0x7fc8('0x1e')](function(_0x520261){if(_0x520261){return _0x520261[_0x7fc8('0x52')](_0x329f75['body'][_0x7fc8('0x43')],_[_0x7fc8('0x42')](_0x329f75[_0x7fc8('0x3e')],[_0x7fc8('0x43'),'id'])||{})['spread'](function(){return db[_0x7fc8('0x53')][_0x7fc8('0x2a')]({'attributes':['id',_0x7fc8('0x22'),'color'],'where':{'id':_0x329f75[_0x7fc8('0x3e')]['ids']}});})['then'](function(_0x531462){socket[_0x7fc8('0x54')]('mailInteractionTags:save',{'id':Number(_0x329f75[_0x7fc8('0x2e')]['id']),'tags':_0x531462||[]});return{'id':Number(_0x329f75[_0x7fc8('0x2e')]['id']),'tags':_0x531462||[]};});}})[_0x7fc8('0x1e')](respondWithResult(_0x20a3df,null))['catch'](handleError(_0x20a3df,null));};exports[_0x7fc8('0x55')]=function(_0x6836d,_0x587faf){return db['MailInteraction'][_0x7fc8('0x3b')]({'where':{'id':_0x6836d[_0x7fc8('0x2e')]['id']}})[_0x7fc8('0x1e')](handleEntityNotFound(_0x587faf,null))[_0x7fc8('0x1e')](function(_0x5e6982){if(_0x5e6982){return _0x5e6982[_0x7fc8('0x55')](_0x6836d[_0x7fc8('0x31')][_0x7fc8('0x43')]);}})[_0x7fc8('0x1e')](respondWithStatusCode(_0x587faf,null))['catch'](handleError(_0x587faf,null));};exports[_0x7fc8('0x56')]=function(_0x598ba5,_0x40a1bb){var _0x53ff5f=moment()[_0x7fc8('0x57')]()[_0x7fc8('0x58')]();var _0x4b7587=path[_0x7fc8('0x59')](config[_0x7fc8('0x5a')],'server',_0x7fc8('0x5b'),'tmp');var _0x27c2a3=path['join'](config[_0x7fc8('0x5a')],'server',_0x7fc8('0x5b'),_0x7fc8('0x5c'));var _0x43194e=path['join'](_0x4b7587,_0x53ff5f);var _0x246d11=util[_0x7fc8('0x4e')](_0x7fc8('0x5d'),_0x598ba5[_0x7fc8('0x2e')]['id'],_0x53ff5f);var _0x67c32d=path[_0x7fc8('0x59')](_0x4b7587,_0x246d11);var _0x5e74f3=[];if(_0x598ba5[_0x7fc8('0x31')]['attachments']){_0x5e74f3['push']({'model':db[_0x7fc8('0x5e')],'as':_0x7fc8('0x5f'),'raw':!![]});}var _0x25d8c2=[{'model':db['MailMessage'],'as':'Messages','attributes':['id',_0x7fc8('0x3e'),_0x7fc8('0x60'),'to','cc',_0x7fc8('0x61'),_0x7fc8('0x62'),'createdAt'],'where':{'secret':![]},'order':qs[_0x7fc8('0x48')]('id'),'include':_0x5e74f3}];return db['MailInteraction'][_0x7fc8('0x3b')]({'where':{'id':_0x598ba5[_0x7fc8('0x2e')]['id']},'include':_0x25d8c2})[_0x7fc8('0x1e')](handleEntityNotFound(_0x40a1bb,null))[_0x7fc8('0x1e')](function(_0x1f2f12){if(_0x1f2f12&&_0x1f2f12[_0x7fc8('0x63')]){var _0x1e77c2=_0x1f2f12[_0x7fc8('0x64')]({'plain':!![]});fs[_0x7fc8('0x65')](_0x43194e);return BPromise[_0x7fc8('0x66')](_0x1e77c2[_0x7fc8('0x63')],function(_0x1273f9,_0x3551ec){var _0x24294c={'from':_0x1273f9[_0x7fc8('0x60')],'to':_0x1273f9['to']||_0x7fc8('0x67'),'subject':_0x1273f9[_0x7fc8('0x62')],'html':htmlEntities[_0x7fc8('0x68')](_0x1273f9[_0x7fc8('0x3e')]),'headers':{'Date':moment(_0x1273f9[_0x7fc8('0x69')])[_0x7fc8('0x4e')](_0x7fc8('0x6a'))},'attachments':[]};if(_0x1273f9['cc']){_0x24294c[_0x7fc8('0x6b')]['Cc']=_0x1273f9['cc'];}if(_0x1273f9[_0x7fc8('0x61')]){_0x24294c[_0x7fc8('0x6b')][_0x7fc8('0x6c')]=_0x1273f9['bcc'];}return new BPromise(function(_0x50ff42,_0x2ea098){if(_0x1273f9[_0x7fc8('0x5f')]){for(var _0x2ca391=0x0;_0x2ca391<_0x1273f9[_0x7fc8('0x5f')][_0x7fc8('0x36')];_0x2ca391++){var _0x350fff=_0x1273f9[_0x7fc8('0x5f')][_0x2ca391];var _0x3ed0f2=path[_0x7fc8('0x59')](_0x27c2a3,_0x350fff[_0x7fc8('0x6d')]);if(fs['existsSync'](_0x3ed0f2)){_0x24294c['attachments']['push']({'name':_0x350fff[_0x7fc8('0x22')],'contentType':_0x350fff[_0x7fc8('0x27')],'data':fs[_0x7fc8('0x6e')](_0x3ed0f2)});}}}emlformat[_0x7fc8('0x6f')](_0x24294c,function(_0x9cf576,_0x30741c){if(_0x9cf576)return _0x2ea098(_0x9cf576);fs[_0x7fc8('0x70')](path['join'](_0x43194e,util['format'](_0x7fc8('0x71'),_0x3551ec)),_0x30741c);return _0x50ff42(_0x30741c);});});})[_0x7fc8('0x1e')](function(){return new BPromise(function(_0x3b0fe8,_0x4f910d){zipdir(_0x43194e,{'saveTo':_0x67c32d},function(_0x466d64,_0x3d5c4d){if(_0x466d64)return _0x4f910d(_0x466d64);return _0x3b0fe8(_0x3d5c4d);});})['then'](function(){return new BPromise(function(_0x53a855,_0xecadf7){rimraf(_0x43194e,function(_0x5a403e){if(_0x5a403e)_0xecadf7(_0x5a403e);return _0x53a855();});});})[_0x7fc8('0x1e')](function(){return _0x40a1bb[_0x7fc8('0x56')](_0x67c32d,_0x246d11,function(_0x3a143d){if(!_0x3a143d)fs['unlinkSync'](_0x67c32d);});});});}else{return _0x40a1bb[_0x7fc8('0x14')](0xc8);}})[_0x7fc8('0x3c')](handleError(_0x40a1bb,null));}; \ No newline at end of file +var _0x8837=['tmp','transcript-%d-%s.zip','attachments','push','Attachment','Attachments','Messages','from','subject','createdAt','sort','get','missing.recipient@your.company.com','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','existsSync','type','readFileSync','build','writeFileSync','message%d.eml','rimraf','bluebird','util','lodash','juice','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','html-entities','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','json','offset','count','limit','Content-Range','update','then','destroy','error','stack','name','send','index','MailInteraction','rawAttributes','fieldName','key','getOptions','mail','query','catch','params','keys','intersection','model','attributes','fields','length','include','merge','create','body','find','addMessage','ids','omit','getMessages','findOne','MailMessage','filters','where','filter','$gte','format','includeAll','findAll','true','addTags','setTags','spread','Tag','color','emit','removeTags','download','toString','join','root','server','files'];(function(_0x37ae25,_0x26cfdc){var _0x33876a=function(_0x2de9b2){while(--_0x2de9b2){_0x37ae25['push'](_0x37ae25['shift']());}};_0x33876a(++_0x26cfdc);}(_0x8837,0x1b4));var _0x7883=function(_0x318e34,_0x883777){_0x318e34=_0x318e34-0x0;var _0x41f6bc=_0x8837[_0x318e34];return _0x41f6bc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7883('0x0'));var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require(_0x7883('0x1'));var util=require(_0x7883('0x2'));var path=require('path');var fs=require('fs');var _=require(_0x7883('0x3'));var juice=require(_0x7883('0x4'));var Redis=require('ioredis');var interaction=require(_0x7883('0x5'));var qs=require(_0x7883('0x6'));var logger=require(_0x7883('0x7'))('api');var config=require(_0x7883('0x8'));var db=require(_0x7883('0x9'))['db'];var htmlEntities=require(_0x7883('0xa'));config[_0x7883('0xb')]=_['defaults'](config[_0x7883('0xb')],{'host':_0x7883('0xc'),'port':0x18eb});var socket=require(_0x7883('0xd'))(new Redis(config[_0x7883('0xb')]));require(_0x7883('0xe'))[_0x7883('0xf')](socket);function respondWithStatusCode(_0x842ef0,_0x29396a){_0x29396a=_0x29396a||0xcc;return function(_0x3f16a4){if(_0x3f16a4){return _0x842ef0[_0x7883('0x10')](_0x29396a);}return _0x842ef0[_0x7883('0x11')](_0x29396a)[_0x7883('0x12')]();};}function respondWithResult(_0x33ca15,_0x1aa928){_0x1aa928=_0x1aa928||0xc8;return function(_0x32286){if(_0x32286){return _0x33ca15[_0x7883('0x11')](_0x1aa928)[_0x7883('0x13')](_0x32286);}};}function respondWithFilteredResult(_0x384bce,_0x4fb243){return function(_0x306e79){if(_0x306e79){var _0x2a1458=typeof _0x4fb243[_0x7883('0x14')]==='undefined'&&typeof _0x4fb243['limit']==='undefined';var _0x3b6f41=_0x306e79[_0x7883('0x15')];var _0x436d4a=_0x2a1458?0x0:_0x4fb243[_0x7883('0x14')];var _0x233dfd=_0x2a1458?_0x306e79[_0x7883('0x15')]:_0x4fb243[_0x7883('0x14')]+_0x4fb243[_0x7883('0x16')];var _0x39215e;if(_0x233dfd>=_0x3b6f41){_0x233dfd=_0x3b6f41;_0x39215e=0xc8;}else{_0x39215e=0xce;}_0x384bce['status'](_0x39215e);return _0x384bce['set'](_0x7883('0x17'),_0x436d4a+'-'+_0x233dfd+'/'+_0x3b6f41)[_0x7883('0x13')](_0x306e79);}return null;};}function saveUpdates(_0x591416){return function(_0xedd225){if(_0xedd225){return _0xedd225[_0x7883('0x18')](_0x591416)[_0x7883('0x19')](function(_0x11f6de){return _0x11f6de;});}return null;};}function removeEntity(_0x2ec74d){return function(_0x470f4d){if(_0x470f4d){return _0x470f4d[_0x7883('0x1a')]()[_0x7883('0x19')](function(){_0x2ec74d[_0x7883('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe569b3){return function(_0x3113ea){if(!_0x3113ea){_0xe569b3[_0x7883('0x10')](0x194);}return _0x3113ea;};}function handleError(_0x390be1,_0x1fa39c){_0x1fa39c=_0x1fa39c||0x1f4;return function(_0x4cbf16){logger[_0x7883('0x1b')](_0x4cbf16[_0x7883('0x1c')]);if(_0x4cbf16['name']){delete _0x4cbf16[_0x7883('0x1d')];}_0x390be1[_0x7883('0x11')](_0x1fa39c)[_0x7883('0x1e')](_0x4cbf16);};}exports[_0x7883('0x1f')]=function(_0x53aef2,_0x5a92ca){var _0x4e5f7e={};var _0x1ec09a=_['map'](db[_0x7883('0x20')][_0x7883('0x21')],function(_0x14172b){return{'name':_0x14172b[_0x7883('0x22')],'type':_0x14172b['type'][_0x7883('0x23')]};});_0x4e5f7e=qs[_0x7883('0x24')](_0x1ec09a,_0x53aef2);return interaction['findAll'](_0x7883('0x25'),_0x53aef2[_0x7883('0x26')],_0x53aef2['user'],_0x4e5f7e,_0x1ec09a)[_0x7883('0x19')](respondWithFilteredResult(_0x5a92ca,_0x4e5f7e))[_0x7883('0x27')](handleError(_0x5a92ca,null));};exports['show']=function(_0x1ebdd3,_0x5d5883){var _0x579edf={'raw':![],'where':{'id':_0x1ebdd3[_0x7883('0x28')]['id']}},_0x1ed9c1={};_0x1ed9c1['model']=_[_0x7883('0x29')](db[_0x7883('0x20')]['rawAttributes']);_0x1ed9c1[_0x7883('0x26')]=_[_0x7883('0x29')](_0x1ebdd3['query']);_0x1ed9c1['filters']=_[_0x7883('0x2a')](_0x1ed9c1[_0x7883('0x2b')],_0x1ed9c1['query']);_0x579edf[_0x7883('0x2c')]=_[_0x7883('0x2a')](_0x1ed9c1[_0x7883('0x2b')],qs[_0x7883('0x2d')](_0x1ebdd3[_0x7883('0x26')][_0x7883('0x2d')]));_0x579edf[_0x7883('0x2c')]=_0x579edf[_0x7883('0x2c')][_0x7883('0x2e')]?_0x579edf[_0x7883('0x2c')]:_0x1ed9c1[_0x7883('0x2b')];if(_0x1ebdd3[_0x7883('0x26')]['includeAll']){_0x579edf[_0x7883('0x2f')]=[{'all':!![]}];}_0x579edf=_[_0x7883('0x30')]({},_0x579edf,_0x1ebdd3['options']);return db[_0x7883('0x20')]['find'](_0x579edf)['then'](handleEntityNotFound(_0x5d5883,null))[_0x7883('0x19')](respondWithResult(_0x5d5883,null))['catch'](handleError(_0x5d5883,null));};exports[_0x7883('0x31')]=function(_0x4576fc,_0x534792){return db[_0x7883('0x20')][_0x7883('0x31')](_0x4576fc[_0x7883('0x32')],{})[_0x7883('0x19')](respondWithResult(_0x534792,0xc9))[_0x7883('0x27')](handleError(_0x534792,null));};exports[_0x7883('0x18')]=function(_0x51335b,_0x2b6f72){if(_0x51335b[_0x7883('0x32')]['id']){delete _0x51335b['body']['id'];}return db[_0x7883('0x20')][_0x7883('0x33')]({'where':{'id':_0x51335b[_0x7883('0x28')]['id']}})[_0x7883('0x19')](handleEntityNotFound(_0x2b6f72,null))[_0x7883('0x19')](saveUpdates(_0x51335b[_0x7883('0x32')],null))[_0x7883('0x19')](respondWithResult(_0x2b6f72,null))[_0x7883('0x27')](handleError(_0x2b6f72,null));};exports[_0x7883('0x1a')]=function(_0x1fe1dd,_0x16c782){return db['MailInteraction'][_0x7883('0x33')]({'where':{'id':_0x1fe1dd[_0x7883('0x28')]['id']}})[_0x7883('0x19')](handleEntityNotFound(_0x16c782,null))[_0x7883('0x19')](removeEntity(_0x16c782,null))[_0x7883('0x27')](handleError(_0x16c782,null));};exports['describe']=function(_0x5325e6,_0x5b8536){return db['MailInteraction']['describe']()[_0x7883('0x19')](respondWithResult(_0x5b8536,null))['catch'](handleError(_0x5b8536,null));};exports[_0x7883('0x34')]=function(_0x2ed409,_0x4a7880){return db['MailMessage'][_0x7883('0x33')]({'where':{'id':_0x2ed409['params']['id']}})[_0x7883('0x19')](handleEntityNotFound(_0x4a7880,null))[_0x7883('0x19')](function(_0x49f9e3){if(_0x49f9e3){return _0x49f9e3[_0x7883('0x34')](_0x2ed409[_0x7883('0x32')][_0x7883('0x35')],_[_0x7883('0x36')](_0x2ed409[_0x7883('0x32')],['ids','id'])||{});}})[_0x7883('0x19')](respondWithResult(_0x4a7880,null))['catch'](handleError(_0x4a7880,null));};exports[_0x7883('0x37')]=function(_0x5729e0,_0x5f218d){var _0x387520={'raw':![],'where':{}};var _0x50b9cf={};var _0x18b258={'count':0x0,'rows':[]};return db['MailInteraction'][_0x7883('0x38')]({'where':{'id':_0x5729e0[_0x7883('0x28')]['id']}})[_0x7883('0x19')](handleEntityNotFound(_0x5f218d,null))['then'](function(_0x31454e){if(_0x31454e){_0x50b9cf[_0x7883('0x2b')]=_[_0x7883('0x29')](db[_0x7883('0x39')]['rawAttributes']);_0x50b9cf['query']=_[_0x7883('0x29')](_0x5729e0[_0x7883('0x26')]);_0x50b9cf[_0x7883('0x3a')]=_[_0x7883('0x2a')](_0x50b9cf[_0x7883('0x2b')],_0x50b9cf['query']);_0x387520[_0x7883('0x2c')]=_['intersection'](_0x50b9cf['model'],qs[_0x7883('0x2d')](_0x5729e0[_0x7883('0x26')][_0x7883('0x2d')]));_0x387520[_0x7883('0x2c')]=_0x387520['attributes'][_0x7883('0x2e')]?_0x387520[_0x7883('0x2c')]:_0x50b9cf[_0x7883('0x2b')];if(!_0x5729e0[_0x7883('0x26')]['hasOwnProperty']('nolimit')){_0x387520[_0x7883('0x16')]=qs['limit'](_0x5729e0[_0x7883('0x26')][_0x7883('0x16')]);_0x387520[_0x7883('0x14')]=qs[_0x7883('0x14')](_0x5729e0[_0x7883('0x26')][_0x7883('0x14')]);}_0x387520['order']=qs['sort'](_0x5729e0[_0x7883('0x26')]['sort']);_0x387520[_0x7883('0x3b')]=qs[_0x7883('0x3a')](_['pick'](_0x5729e0[_0x7883('0x26')],_0x50b9cf[_0x7883('0x3a')]));_0x387520['where']['MailInteractionId']=_0x31454e['id'];if(_0x5729e0[_0x7883('0x26')][_0x7883('0x3c')]){_0x387520[_0x7883('0x3b')]=_['merge'](_0x387520[_0x7883('0x3b')],{'$or':_['map'](_0x387520[_0x7883('0x2c')],function(_0xe48361){var _0x492d80={};_0x492d80[_0xe48361]={'$like':'%'+_0x5729e0[_0x7883('0x26')][_0x7883('0x3c')]+'%'};return _0x492d80;})});}if(_0x5729e0['query'][_0x7883('0x3d')]){var _0x18f8bc=_0x5729e0[_0x7883('0x26')][_0x7883('0x3d')]['split'](',');var _0x4068bf={};_0x4068bf[_0x18f8bc[0x0]]={'$gte':moment(_0x18f8bc[0x1])[_0x7883('0x3e')]('YYYY-MM-DD\x20HH:mm:ss')};_0x387520[_0x7883('0x3b')]=_[_0x7883('0x30')](_0x387520[_0x7883('0x3b')],_0x4068bf);}_0x387520=_[_0x7883('0x30')]({},_0x387520,_0x5729e0['options']);return db[_0x7883('0x39')][_0x7883('0x15')]({'where':_0x387520[_0x7883('0x3b')]})[_0x7883('0x19')](function(_0x11d31b){_0x18b258[_0x7883('0x15')]=_0x11d31b;if(_0x5729e0[_0x7883('0x26')][_0x7883('0x3f')]){_0x387520['include']=[{'all':!![]}];}return db['MailMessage'][_0x7883('0x40')](_0x387520);})[_0x7883('0x19')](function(_0x48865e){if(_0x5729e0[_0x7883('0x26')]['inlineCss']===_0x7883('0x41')){for(var _0x5a9244=0x0;_0x5a9244<_0x48865e['length'];_0x5a9244++){_0x48865e[_0x5a9244]['body']=juice(_0x48865e[_0x5a9244][_0x7883('0x32')]);}}_0x18b258['rows']=_0x48865e;return _0x18b258;});}})[_0x7883('0x19')](respondWithFilteredResult(_0x5f218d,_0x387520))[_0x7883('0x27')](handleError(_0x5f218d,null));};exports[_0x7883('0x42')]=function(_0x1d0f11,_0x56c7ae){return db[_0x7883('0x20')][_0x7883('0x33')]({'where':{'id':_0x1d0f11[_0x7883('0x28')]['id']}})[_0x7883('0x19')](handleEntityNotFound(_0x56c7ae,null))[_0x7883('0x19')](function(_0x1add50){if(_0x1add50){return _0x1add50[_0x7883('0x43')](_0x1d0f11['body'][_0x7883('0x35')],_[_0x7883('0x36')](_0x1d0f11['body'],[_0x7883('0x35'),'id'])||{})[_0x7883('0x44')](function(){return db[_0x7883('0x45')][_0x7883('0x40')]({'attributes':['id',_0x7883('0x1d'),_0x7883('0x46')],'where':{'id':_0x1d0f11['body']['ids']}});})['then'](function(_0x4b8804){socket[_0x7883('0x47')]('mailInteractionTags:save',{'id':Number(_0x1d0f11['params']['id']),'tags':_0x4b8804||[]});return{'id':Number(_0x1d0f11[_0x7883('0x28')]['id']),'tags':_0x4b8804||[]};});}})['then'](respondWithResult(_0x56c7ae,null))[_0x7883('0x27')](handleError(_0x56c7ae,null));};exports[_0x7883('0x48')]=function(_0x1e4b2a,_0x497cd1){return db[_0x7883('0x20')]['find']({'where':{'id':_0x1e4b2a['params']['id']}})[_0x7883('0x19')](handleEntityNotFound(_0x497cd1,null))[_0x7883('0x19')](function(_0x472428){if(_0x472428){return _0x472428[_0x7883('0x48')](_0x1e4b2a[_0x7883('0x26')]['ids']);}})['then'](respondWithStatusCode(_0x497cd1,null))[_0x7883('0x27')](handleError(_0x497cd1,null));};exports[_0x7883('0x49')]=function(_0x1e463d,_0x37ed05){var _0x2dd720=moment()['unix']()[_0x7883('0x4a')]();var _0x33b9c6=path[_0x7883('0x4b')](config[_0x7883('0x4c')],_0x7883('0x4d'),_0x7883('0x4e'),_0x7883('0x4f'));var _0x2a0a8f=path[_0x7883('0x4b')](config[_0x7883('0x4c')],_0x7883('0x4d'),_0x7883('0x4e'),'attachments');var _0x51a2fc=path[_0x7883('0x4b')](_0x33b9c6,_0x2dd720);var _0x278ab4=util['format'](_0x7883('0x50'),_0x1e463d['params']['id'],_0x2dd720);var _0x2d9c4a=path[_0x7883('0x4b')](_0x33b9c6,_0x278ab4);var _0x4b9eac=[];if(_0x1e463d['query'][_0x7883('0x51')]){_0x4b9eac[_0x7883('0x52')]({'model':db[_0x7883('0x53')],'as':_0x7883('0x54'),'raw':!![]});}var _0x4f6bff=[{'model':db['MailMessage'],'as':_0x7883('0x55'),'attributes':['id','body',_0x7883('0x56'),'to','cc','bcc',_0x7883('0x57'),_0x7883('0x58')],'where':{'secret':![]},'order':qs[_0x7883('0x59')]('id'),'include':_0x4b9eac}];return db[_0x7883('0x20')]['find']({'where':{'id':_0x1e463d[_0x7883('0x28')]['id']},'include':_0x4f6bff})[_0x7883('0x19')](handleEntityNotFound(_0x37ed05,null))[_0x7883('0x19')](function(_0x2a1af6){if(_0x2a1af6&&_0x2a1af6[_0x7883('0x55')]){var _0x2bc93e=_0x2a1af6[_0x7883('0x5a')]({'plain':!![]});fs['mkdirSync'](_0x51a2fc);return BPromise['each'](_0x2bc93e[_0x7883('0x55')],function(_0x45e457,_0x4abf75){var _0x652ec7={'from':_0x45e457[_0x7883('0x56')],'to':_0x45e457['to']||_0x7883('0x5b'),'subject':_0x45e457[_0x7883('0x57')],'html':htmlEntities[_0x7883('0x5c')](_0x45e457[_0x7883('0x32')]),'headers':{'Date':moment(_0x45e457[_0x7883('0x58')])[_0x7883('0x3e')](_0x7883('0x5d'))},'attachments':[]};if(_0x45e457['cc']){_0x652ec7[_0x7883('0x5e')]['Cc']=_0x45e457['cc'];}if(_0x45e457[_0x7883('0x5f')]){_0x652ec7[_0x7883('0x5e')][_0x7883('0x60')]=_0x45e457[_0x7883('0x5f')];}return new BPromise(function(_0x55ac19,_0x4cd23b){if(_0x45e457[_0x7883('0x54')]){for(var _0x48a71f=0x0;_0x48a71f<_0x45e457['Attachments'][_0x7883('0x2e')];_0x48a71f++){var _0x6d714e=_0x45e457[_0x7883('0x54')][_0x48a71f];var _0x515810=path[_0x7883('0x4b')](_0x2a0a8f,_0x6d714e['basename']);if(fs[_0x7883('0x61')](_0x515810)){_0x652ec7['attachments'][_0x7883('0x52')]({'name':_0x6d714e[_0x7883('0x1d')],'contentType':_0x6d714e[_0x7883('0x62')],'data':fs[_0x7883('0x63')](_0x515810)});}}}emlformat[_0x7883('0x64')](_0x652ec7,function(_0x123032,_0x1bb02a){if(_0x123032)return _0x4cd23b(_0x123032);fs[_0x7883('0x65')](path[_0x7883('0x4b')](_0x51a2fc,util[_0x7883('0x3e')](_0x7883('0x66'),_0x4abf75)),_0x1bb02a);return _0x55ac19(_0x1bb02a);});});})[_0x7883('0x19')](function(){return new BPromise(function(_0x2a6e75,_0x62fc18){zipdir(_0x51a2fc,{'saveTo':_0x2d9c4a},function(_0x11d84c,_0x5aa7d9){if(_0x11d84c)return _0x62fc18(_0x11d84c);return _0x2a6e75(_0x5aa7d9);});})[_0x7883('0x19')](function(){return new BPromise(function(_0x169ea1,_0x551dcf){rimraf(_0x51a2fc,function(_0x451764){if(_0x451764)_0x551dcf(_0x451764);return _0x169ea1();});});})['then'](function(){return _0x37ed05['download'](_0x2d9c4a,_0x278ab4,function(_0x205451){if(!_0x205451)fs['unlinkSync'](_0x2d9c4a);});});});}else{return _0x37ed05['sendStatus'](0xc8);}})[_0x7883('0x27')](handleError(_0x37ed05,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 5d1f6dc..914aa1a 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 _0x07ca=['../../mysqldb','MailInteraction','MailMessage','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','hook','exports','events'];(function(_0x2bbe5c,_0x35a44a){var _0x6f96a4=function(_0x81c650){while(--_0x81c650){_0x2bbe5c['push'](_0x2bbe5c['shift']());}};_0x6f96a4(++_0x35a44a);}(_0x07ca,0x1da));var _0xa07c=function(_0x378891,_0x4e3e16){_0x378891=_0x378891-0x0;var _0xfbfda2=_0x07ca[_0x378891];return _0xfbfda2;};'use strict';var EventEmitter=require(_0xa07c('0x0'));var MailInteraction=require(_0xa07c('0x1'))['db'][_0xa07c('0x2')];var MailMessage=require(_0xa07c('0x1'))['db'][_0xa07c('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa07c('0x4'),'afterUpdate':_0xa07c('0x5'),'afterDestroy':_0xa07c('0x6')};function emitEvent(_0x2513fb){return function(_0x215796,_0x3d77a0,_0x522d53){_0x215796[_0xa07c('0x7')]({'attributes':['id'],'raw':!![]})[_0xa07c('0x8')](function(_0x5189f4){_0x215796[_0xa07c('0x9')](_0xa07c('0xa'),_0x5189f4[_0xa07c('0xb')](function(_0x3105d3){return{'id':_0x3105d3['id']};}));return MailMessage[_0xa07c('0xc')]({'where':{'MailInteractionId':_0x215796['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa07c('0x8')](function(_0x2e391c){_0x215796[_0xa07c('0x9')]('unreadMessages',_0x2e391c[_0xa07c('0xd')]);MailInteractionEvents['emit'](_0x2513fb+':'+_0x215796['id'],_0x215796);MailInteractionEvents[_0xa07c('0xe')](_0x2513fb,_0x215796);_0x522d53(null);})[_0xa07c('0xf')](_0x522d53(null));};}for(var e in events){if(events[_0xa07c('0x10')](e)){var event=events[e];MailInteraction[_0xa07c('0x11')](e,emitEvent(event));}}module[_0xa07c('0x12')]=MailInteractionEvents; \ No newline at end of file +var _0x43c4=['../../mysqldb','MailMessage','update','remove','then','setDataValue','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','events'];(function(_0x5d91c7,_0x1bed4d){var _0x584b9e=function(_0x444e94){while(--_0x444e94){_0x5d91c7['push'](_0x5d91c7['shift']());}};_0x584b9e(++_0x1bed4d);}(_0x43c4,0x8b));var _0x443c=function(_0x558b52,_0x44bdbc){_0x558b52=_0x558b52-0x0;var _0x2ab18d=_0x43c4[_0x558b52];return _0x2ab18d;};'use strict';var EventEmitter=require(_0x443c('0x0'));var MailInteraction=require(_0x443c('0x1'))['db']['MailInteraction'];var MailMessage=require('../../mysqldb')['db'][_0x443c('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x443c('0x3'),'afterDestroy':_0x443c('0x4')};function emitEvent(_0x538089){return function(_0x36ec13,_0x9db8b4,_0x1bc250){_0x36ec13['getUsers']({'attributes':['id'],'raw':!![]})[_0x443c('0x5')](function(_0x38e940){_0x36ec13[_0x443c('0x6')]('Users',_0x38e940[_0x443c('0x7')](function(_0x1a3989){return{'id':_0x1a3989['id']};}));return MailMessage[_0x443c('0x8')]({'where':{'MailInteractionId':_0x36ec13['id'],'direction':'in','read':![]},'raw':!![]});})[_0x443c('0x5')](function(_0x26cbae){_0x36ec13[_0x443c('0x6')](_0x443c('0x9'),_0x26cbae['length']);MailInteractionEvents[_0x443c('0xa')](_0x538089+':'+_0x36ec13['id'],_0x36ec13);MailInteractionEvents['emit'](_0x538089,_0x36ec13);_0x1bc250(null);})[_0x443c('0xb')](_0x1bc250(null));};}for(var e in events){if(events[_0x443c('0xc')](e)){var event=events[e];MailInteraction[_0x443c('0xd')](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 dcd69f3..4ea98a7 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 _0xa5f9=['catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','rimraf','./mailInteraction.attributes','define','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','get','MailMessage','update','then'];(function(_0x28d391,_0x1357b3){var _0x3c8bf0=function(_0x55bac9){while(--_0x55bac9){_0x28d391['push'](_0x28d391['shift']());}};_0x3c8bf0(++_0x1357b3);}(_0xa5f9,0x8f));var _0x9a5f=function(_0xfab345,_0x43fc6e){_0xfab345=_0xfab345-0x0;var _0x1a60fd=_0xa5f9[_0xfab345];return _0x1a60fd;};'use strict';var _=require(_0x9a5f('0x0'));var util=require(_0x9a5f('0x1'));var logger=require('../../config/logger')(_0x9a5f('0x2'));var moment=require(_0x9a5f('0x3'));var BPromise=require(_0x9a5f('0x4'));var rp=require(_0x9a5f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9a5f('0x6'));var config=require('../../config/environment');var attributes=require(_0x9a5f('0x7'));module['exports']=function(_0x597c91,_0x4ec681){return _0x597c91[_0x9a5f('0x8')]('MailInteraction',attributes,{'tableName':_0x9a5f('0x9'),'paranoid':![],'indexes':[{'name':_0x9a5f('0xa'),'fields':[_0x9a5f('0xb'),'to'],'type':_0x9a5f('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x30c0a9,_0x309858,_0x9ba88b){if(_0x30c0a9[_0x9a5f('0xd')]){_0x30c0a9[_0x9a5f('0xe')]=moment()[_0x9a5f('0xf')](_0x9a5f('0x10'));}if(_0x30c0a9[_0x9a5f('0x11')]){_0x30c0a9[_0x9a5f('0x12')]=moment()[_0x9a5f('0xf')](_0x9a5f('0x10'));}_0x9ba88b(null,_0x309858);},'beforeUpdate':function(_0x17b8a7,_0xadf5cf,_0x5034a1){if(_0x17b8a7['changed'](_0x9a5f('0xd'))){_0x17b8a7[_0x9a5f('0xe')]=_0x17b8a7[_0x9a5f('0xd')]?moment()['format'](_0x9a5f('0x10')):null;}if(_0x17b8a7[_0x9a5f('0x13')]('closed')){_0x17b8a7[_0x9a5f('0x12')]=moment()[_0x9a5f('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x17b8a7['substatus']=null;_0x17b8a7[_0x9a5f('0xe')]=null;}_0x5034a1(null,_0x17b8a7);},'afterUpdate':function(_0x3a7898,_0x26aae7,_0x22bc70){var _0x5a8172=_0x597c91[_0x9a5f('0x14')];var _0x511c19=_0x3a7898[_0x9a5f('0x15')]({'plain':!![]});if(_0x511c19['closed']){return _0x5a8172[_0x9a5f('0x16')][_0x9a5f('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x511c19['id']}})[_0x9a5f('0x18')](function(){_0x22bc70();})[_0x9a5f('0x19')](function(_0x5b89e3){_0x22bc70(_0x5b89e3);});}else{_0x22bc70();}}},'charset':_0x9a5f('0x1a'),'collate':_0x9a5f('0x1b')});}; \ No newline at end of file +var _0xeddf=['rimraf','../../config/environment','exports','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','format','changed','closedAt','models','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x919445,_0x5467dc){var _0x511b3e=function(_0xde10f3){while(--_0xde10f3){_0x919445['push'](_0x919445['shift']());}};_0x511b3e(++_0x5467dc);}(_0xeddf,0xf6));var _0xfedd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeddf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xfedd('0x0'));var logger=require(_0xfedd('0x1'))('api');var moment=require(_0xfedd('0x2'));var BPromise=require(_0xfedd('0x3'));var rp=require(_0xfedd('0x4'));var fs=require('fs');var path=require(_0xfedd('0x5'));var rimraf=require(_0xfedd('0x6'));var config=require(_0xfedd('0x7'));var attributes=require('./mailInteraction.attributes');module[_0xfedd('0x8')]=function(_0x1fb547,_0x168aaf){return _0x1fb547['define'](_0xfedd('0x9'),attributes,{'tableName':_0xfedd('0xa'),'paranoid':![],'indexes':[{'name':_0xfedd('0xb'),'fields':[_0xfedd('0xc'),'to'],'type':_0xfedd('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x21f338,_0x2a0e2a,_0x4be774){if(_0x21f338[_0xfedd('0xe')]){_0x21f338[_0xfedd('0xf')]=moment()['format'](_0xfedd('0x10'));}if(_0x21f338[_0xfedd('0x11')]){_0x21f338['closedAt']=moment()[_0xfedd('0x12')](_0xfedd('0x10'));}_0x4be774(null,_0x2a0e2a);},'beforeUpdate':function(_0x1443dc,_0x5b7a4e,_0x2b66ee){if(_0x1443dc[_0xfedd('0x13')](_0xfedd('0xe'))){_0x1443dc[_0xfedd('0xf')]=_0x1443dc[_0xfedd('0xe')]?moment()['format'](_0xfedd('0x10')):null;}if(_0x1443dc[_0xfedd('0x13')](_0xfedd('0x11'))){_0x1443dc[_0xfedd('0x14')]=moment()[_0xfedd('0x12')](_0xfedd('0x10'));_0x1443dc[_0xfedd('0xe')]=null;_0x1443dc[_0xfedd('0xf')]=null;}_0x2b66ee(null,_0x1443dc);},'afterUpdate':function(_0x4e2f4f,_0x3eb56c,_0x4d35e8){var _0x35a585=_0x1fb547[_0xfedd('0x15')];var _0x2c5844=_0x4e2f4f['get']({'plain':!![]});if(_0x2c5844[_0xfedd('0x11')]){return _0x35a585[_0xfedd('0x16')][_0xfedd('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x2c5844['id']}})[_0xfedd('0x18')](function(){_0x4d35e8();})[_0xfedd('0x19')](function(_0x1b45d9){_0x4d35e8(_0x1b45d9);});}else{_0x4d35e8();}}},'charset':_0xfedd('0x1a'),'collate':_0xfedd('0x1b')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 42dcd50..235b0ea 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 _0x74f7=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','limit','catch','AddTagsToMailInteraction','find','addTags','ids','AddTags','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment'];(function(_0x18e6f9,_0x297116){var _0x38903a=function(_0x395ba7){while(--_0x395ba7){_0x18e6f9['push'](_0x18e6f9['shift']());}};_0x38903a(++_0x297116);}(_0x74f7,0xbd));var _0x774f=function(_0x4221b5,_0x20034e){_0x4221b5=_0x4221b5-0x0;var _0x44de3d=_0x74f7[_0x4221b5];return _0x44de3d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x774f('0x0'));var BPromise=require(_0x774f('0x1'));var rs=require(_0x774f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x774f('0x3'))(_0x774f('0x4'));var config=require(_0x774f('0x5'));var jayson=require(_0x774f('0x6'));var client=jayson[_0x774f('0x7')][_0x774f('0x8')]({'port':0x232a});config[_0x774f('0x9')]=_['defaults'](config[_0x774f('0x9')],{'host':_0x774f('0xa'),'port':0x18eb});var socket=require(_0x774f('0xb'))(new Redis(config[_0x774f('0x9')]));require(_0x774f('0xc'))[_0x774f('0xd')](socket);function respondWithRpcPromise(_0x23cc1a,_0x38e3aa,_0xc992e9){return new BPromise(function(_0x22d116,_0x567e38){return client[_0x774f('0xe')](_0x23cc1a,_0xc992e9)[_0x774f('0xf')](function(_0xc15825){logger[_0x774f('0x10')](_0x774f('0x11'),_0x38e3aa,'request\x20sent');logger[_0x774f('0x12')](_0x774f('0x13'),_0x38e3aa,'request\x20sent',JSON[_0x774f('0x14')](_0xc15825));if(_0xc15825[_0x774f('0x15')]){if(_0xc15825['error'][_0x774f('0x16')]===0x1f4){logger[_0x774f('0x15')]('MailInteraction,\x20%s,\x20%s',_0x38e3aa,_0xc15825[_0x774f('0x15')][_0x774f('0x17')]);return _0x567e38(_0xc15825[_0x774f('0x15')]['message']);}logger[_0x774f('0x15')](_0x774f('0x11'),_0x38e3aa,_0xc15825[_0x774f('0x15')][_0x774f('0x17')]);return _0x22d116(_0xc15825[_0x774f('0x15')][_0x774f('0x17')]);}else{logger['info'](_0x774f('0x11'),_0x38e3aa,'request\x20sent');_0x22d116(_0xc15825['result'][_0x774f('0x17')]);}})['catch'](function(_0x14bff2){logger[_0x774f('0x15')](_0x774f('0x11'),_0x38e3aa,_0x14bff2);_0x567e38(_0x14bff2);});});}exports[_0x774f('0x18')]=function(_0x16488b){var _0x534737=this;return new Promise(function(_0x5c5f0d,_0x22ad7a){return db[_0x774f('0x19')][_0x774f('0x1a')](_0x16488b[_0x774f('0x1b')],{'raw':_0x16488b[_0x774f('0x1c')]?_0x16488b['options'][_0x774f('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16488b[_0x774f('0x1c')]?_0x16488b[_0x774f('0x1c')][_0x774f('0x1e')]||null:null,'attributes':_0x16488b[_0x774f('0x1c')]?_0x16488b[_0x774f('0x1c')][_0x774f('0x1f')]||null:null,'limit':_0x16488b[_0x774f('0x1c')]?_0x16488b[_0x774f('0x1c')][_0x774f('0x20')]||null:null})[_0x774f('0xf')](function(_0x14f544){logger['info'](_0x774f('0x18'),_0x16488b);logger[_0x774f('0x12')](_0x774f('0x18'),_0x16488b,JSON[_0x774f('0x14')](_0x14f544));_0x5c5f0d(_0x14f544);})[_0x774f('0x21')](function(_0x3cc4e9){logger[_0x774f('0x15')](_0x774f('0x18'),_0x3cc4e9['message'],_0x16488b);_0x22ad7a(_0x534737['error'](0x1f4,_0x3cc4e9[_0x774f('0x17')]));});});};exports[_0x774f('0x22')]=function(_0x13f8f2){return new Promise(function(_0x2ad5df,_0x4f00a0){return db['MailInteraction'][_0x774f('0x23')]({'where':_0x13f8f2[_0x774f('0x1c')]?_0x13f8f2['options'][_0x774f('0x1e')]||null:null})[_0x774f('0xf')](function(_0x5ee915){if(_0x5ee915){return _0x5ee915[_0x774f('0x24')](_0x13f8f2[_0x774f('0x1b')]['ids'],_['omit'](_0x13f8f2['body'],[_0x774f('0x25'),'id'])||{});}})['spread'](function(_0x3f880e){logger[_0x774f('0x10')](_0x774f('0x26'),_0x13f8f2);logger[_0x774f('0x12')](_0x774f('0x26'),_0x13f8f2,JSON[_0x774f('0x14')](_0x3f880e));_0x2ad5df(_0x3f880e);})[_0x774f('0x21')](function(_0x2de13a){logger[_0x774f('0x15')](_0x774f('0x26'),_0x2de13a[_0x774f('0x17')],_0x13f8f2);_0x4f00a0(_this[_0x774f('0x15')](0x1f4,_0x2de13a[_0x774f('0x17')]));});});}; \ No newline at end of file +var _0x720b=['defaults','socket.io-emitter','./mailInteraction.socket','register','request','then','info','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','MailInteraction,\x20%s,\x20%s','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','attributes','limit','AddTagsToMailInteraction','find','addTags','omit','ids','spread','AddTags','debug','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x720b,0x1d8));var _0xb720=function(_0xb1dff3,_0x5ed37e){_0xb1dff3=_0xb1dff3-0x0;var _0x190c82=_0x720b[_0xb1dff3];return _0x190c82;};'use strict';var _=require(_0xb720('0x0'));var util=require(_0xb720('0x1'));var moment=require(_0xb720('0x2'));var BPromise=require('bluebird');var rs=require(_0xb720('0x3'));var fs=require('fs');var Redis=require(_0xb720('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb720('0x5'));var logger=require(_0xb720('0x6'))(_0xb720('0x7'));var config=require('../../config/environment');var jayson=require(_0xb720('0x8'));var client=jayson[_0xb720('0x9')][_0xb720('0xa')]({'port':0x232a});config[_0xb720('0xb')]=_[_0xb720('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb720('0xd'))(new Redis(config[_0xb720('0xb')]));require(_0xb720('0xe'))[_0xb720('0xf')](socket);function respondWithRpcPromise(_0x4351eb,_0x141d72,_0x2b66ef){return new BPromise(function(_0x2922c7,_0x4e7422){return client[_0xb720('0x10')](_0x4351eb,_0x2b66ef)[_0xb720('0x11')](function(_0x5384e6){logger[_0xb720('0x12')]('MailInteraction,\x20%s,\x20%s',_0x141d72,_0xb720('0x13'));logger['debug'](_0xb720('0x14'),_0x141d72,_0xb720('0x13'),JSON[_0xb720('0x15')](_0x5384e6));if(_0x5384e6[_0xb720('0x16')]){if(_0x5384e6[_0xb720('0x16')][_0xb720('0x17')]===0x1f4){logger[_0xb720('0x16')](_0xb720('0x18'),_0x141d72,_0x5384e6['error'][_0xb720('0x19')]);return _0x4e7422(_0x5384e6[_0xb720('0x16')][_0xb720('0x19')]);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x141d72,_0x5384e6[_0xb720('0x16')][_0xb720('0x19')]);return _0x2922c7(_0x5384e6[_0xb720('0x16')]['message']);}else{logger[_0xb720('0x12')](_0xb720('0x18'),_0x141d72,_0xb720('0x13'));_0x2922c7(_0x5384e6[_0xb720('0x1a')][_0xb720('0x19')]);}})[_0xb720('0x1b')](function(_0x4203ce){logger[_0xb720('0x16')](_0xb720('0x18'),_0x141d72,_0x4203ce);_0x4e7422(_0x4203ce);});});}exports[_0xb720('0x1c')]=function(_0x37920f){var _0x35bf0a=this;return new Promise(function(_0xd3ec7a,_0x3bcca2){return db[_0xb720('0x1d')][_0xb720('0x1e')](_0x37920f[_0xb720('0x1f')],{'raw':_0x37920f[_0xb720('0x20')]?_0x37920f[_0xb720('0x20')][_0xb720('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37920f['options']?_0x37920f['options']['where']||null:null,'attributes':_0x37920f[_0xb720('0x20')]?_0x37920f['options'][_0xb720('0x22')]||null:null,'limit':_0x37920f[_0xb720('0x20')]?_0x37920f[_0xb720('0x20')][_0xb720('0x23')]||null:null})[_0xb720('0x11')](function(_0xa0f8a4){logger['info']('UpdateMailInteraction',_0x37920f);logger['debug'](_0xb720('0x1c'),_0x37920f,JSON[_0xb720('0x15')](_0xa0f8a4));_0xd3ec7a(_0xa0f8a4);})['catch'](function(_0x508eb8){logger[_0xb720('0x16')]('UpdateMailInteraction',_0x508eb8[_0xb720('0x19')],_0x37920f);_0x3bcca2(_0x35bf0a['error'](0x1f4,_0x508eb8['message']));});});};exports[_0xb720('0x24')]=function(_0x401d97){return new Promise(function(_0x46b05a,_0x416161){return db[_0xb720('0x1d')][_0xb720('0x25')]({'where':_0x401d97[_0xb720('0x20')]?_0x401d97[_0xb720('0x20')]['where']||null:null})['then'](function(_0x54fb7b){if(_0x54fb7b){return _0x54fb7b[_0xb720('0x26')](_0x401d97[_0xb720('0x1f')]['ids'],_[_0xb720('0x27')](_0x401d97['body'],[_0xb720('0x28'),'id'])||{});}})[_0xb720('0x29')](function(_0x443e23){logger[_0xb720('0x12')](_0xb720('0x2a'),_0x401d97);logger[_0xb720('0x2b')]('AddTags',_0x401d97,JSON[_0xb720('0x15')](_0x443e23));_0x46b05a(_0x443e23);})[_0xb720('0x1b')](function(_0x26d0fb){logger['error'](_0xb720('0x2a'),_0x26d0fb[_0xb720('0x19')],_0x401d97);_0x416161(_this['error'](0x1f4,_0x26d0fb['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index edba2bd..f919408 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 _0x5aac=['emit','removeListener','register','length','mailInteraction:','./mailInteraction.events','save','update'];(function(_0x35e06d,_0xad434c){var _0x1b7a39=function(_0x40efcb){while(--_0x40efcb){_0x35e06d['push'](_0x35e06d['shift']());}};_0x1b7a39(++_0xad434c);}(_0x5aac,0xbd));var _0xc5aa=function(_0x271ed7,_0xe0bee3){_0x271ed7=_0x271ed7-0x0;var _0x594082=_0x5aac[_0x271ed7];return _0x594082;};'use strict';var MailInteractionEvents=require(_0xc5aa('0x0'));var events=[_0xc5aa('0x1'),'remove',_0xc5aa('0x2')];function createListener(_0x31a223,_0x3964cf){return function(_0x43ca1e){_0x3964cf[_0xc5aa('0x3')](_0x31a223,_0x43ca1e);};}function removeListener(_0x34b324,_0x4d9415){return function(){MailInteractionEvents[_0xc5aa('0x4')](_0x34b324,_0x4d9415);};}exports[_0xc5aa('0x5')]=function(_0x4df6a8){for(var _0x5246ec=0x0,_0x3b17f7=events[_0xc5aa('0x6')];_0x5246ec<_0x3b17f7;_0x5246ec++){var _0x7abf47=events[_0x5246ec];var _0x471fd2=createListener(_0xc5aa('0x7')+_0x7abf47,_0x4df6a8);MailInteractionEvents['on'](_0x7abf47,_0x471fd2);}}; \ No newline at end of file +var _0xf6f2=['./mailInteraction.events','update','removeListener','register','length','mailInteraction:'];(function(_0x76f5ab,_0x21e657){var _0x2fbda6=function(_0x466f8c){while(--_0x466f8c){_0x76f5ab['push'](_0x76f5ab['shift']());}};_0x2fbda6(++_0x21e657);}(_0xf6f2,0x120));var _0x2f6f=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xf6f2[_0x3bf83f];return _0x22c4a9;};'use strict';var MailInteractionEvents=require(_0x2f6f('0x0'));var events=['save','remove',_0x2f6f('0x1')];function createListener(_0x322087,_0x3a05cc){return function(_0x1b0f42){_0x3a05cc['emit'](_0x322087,_0x1b0f42);};}function removeListener(_0x5ca6de,_0x211308){return function(){MailInteractionEvents[_0x2f6f('0x2')](_0x5ca6de,_0x211308);};}exports[_0x2f6f('0x3')]=function(_0x345fa2){for(var _0x150d91=0x0,_0x4ecd91=events[_0x2f6f('0x4')];_0x150d91<_0x4ecd91;_0x150d91++){var _0x3ec921=events[_0x150d91];var _0x409d6a=createListener(_0x2f6f('0x5')+_0x3ec921,_0x345fa2);MailInteractionEvents['on'](_0x3ec921,_0x409d6a);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 1fc9064..a5515c0 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 _0xfccd=['/:id/download','download','post','mailmessage:create','create','put','update','/:id/accept','accept','reject','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x14e27a,_0x3b4136){var _0x288688=function(_0x3d7ab1){while(--_0x3d7ab1){_0x14e27a['push'](_0x14e27a['shift']());}};_0x288688(++_0x3b4136);}(_0xfccd,0xc2));var _0xdfcc=function(_0x2d0d9f,_0x22c0d8){_0x2d0d9f=_0x2d0d9f-0x0;var _0x30243d=_0xfccd[_0x2d0d9f];return _0x30243d;};'use strict';var multer=require(_0xdfcc('0x0'));var util=require(_0xdfcc('0x1'));var path=require(_0xdfcc('0x2'));var timeout=require('connect-timeout');var express=require(_0xdfcc('0x3'));var router=express[_0xdfcc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdfcc('0x5'));var interaction=require(_0xdfcc('0x6'));var config=require('../../config/environment');var controller=require(_0xdfcc('0x7'));router[_0xdfcc('0x8')]('/',auth[_0xdfcc('0x9')](),controller[_0xdfcc('0xa')]);router[_0xdfcc('0x8')](_0xdfcc('0xb'),auth[_0xdfcc('0x9')](),controller['describe']);router['get'](_0xdfcc('0xc'),auth[_0xdfcc('0x9')](),controller[_0xdfcc('0xd')]);router[_0xdfcc('0x8')](_0xdfcc('0xe'),auth[_0xdfcc('0x9')](),controller[_0xdfcc('0xf')]);router[_0xdfcc('0x10')]('/',auth[_0xdfcc('0x9')](),interaction['tracked']('mail',_0xdfcc('0x11')),controller[_0xdfcc('0x12')]);router[_0xdfcc('0x13')](_0xdfcc('0xc'),auth[_0xdfcc('0x9')](),controller[_0xdfcc('0x14')]);router[_0xdfcc('0x13')](_0xdfcc('0x15'),auth[_0xdfcc('0x9')](),controller[_0xdfcc('0x16')]);router[_0xdfcc('0x13')]('/:id/reject',auth['isAuthenticated'](),controller[_0xdfcc('0x17')]);router['delete']('/:id',auth[_0xdfcc('0x9')](),controller[_0xdfcc('0x18')]);module[_0xdfcc('0x19')]=router; \ No newline at end of file +var _0xca4a=['Router','fs-extra','../../components/auth/service','./mailMessage.controller','isAuthenticated','/describe','describe','get','/:id','show','/:id/download','download','post','tracked','mail','mailmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','express'];(function(_0x3f35ce,_0x4a0e1f){var _0x1b0c8f=function(_0x3dd909){while(--_0x3dd909){_0x3f35ce['push'](_0x3f35ce['shift']());}};_0x1b0c8f(++_0x4a0e1f);}(_0xca4a,0xaa));var _0xaca4=function(_0x48f9cb,_0x5296f7){_0x48f9cb=_0x48f9cb-0x0;var _0x1ea5f2=_0xca4a[_0x48f9cb];return _0x1ea5f2;};'use strict';var multer=require(_0xaca4('0x0'));var util=require(_0xaca4('0x1'));var path=require(_0xaca4('0x2'));var timeout=require('connect-timeout');var express=require(_0xaca4('0x3'));var router=express[_0xaca4('0x4')]();var fs_extra=require(_0xaca4('0x5'));var auth=require(_0xaca4('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xaca4('0x7'));router['get']('/',auth[_0xaca4('0x8')](),controller['index']);router['get'](_0xaca4('0x9'),auth['isAuthenticated'](),controller[_0xaca4('0xa')]);router[_0xaca4('0xb')](_0xaca4('0xc'),auth[_0xaca4('0x8')](),controller[_0xaca4('0xd')]);router[_0xaca4('0xb')](_0xaca4('0xe'),auth[_0xaca4('0x8')](),controller[_0xaca4('0xf')]);router[_0xaca4('0x10')]('/',auth[_0xaca4('0x8')](),interaction[_0xaca4('0x11')](_0xaca4('0x12'),_0xaca4('0x13')),controller[_0xaca4('0x14')]);router[_0xaca4('0x15')]('/:id',auth[_0xaca4('0x8')](),controller['update']);router['put'](_0xaca4('0x16'),auth[_0xaca4('0x8')](),controller[_0xaca4('0x17')]);router['put'](_0xaca4('0x18'),auth['isAuthenticated'](),controller[_0xaca4('0x19')]);router[_0xaca4('0x1a')](_0xaca4('0xc'),auth[_0xaca4('0x8')](),controller[_0xaca4('0x1b')]);module[_0xaca4('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index f1c96fa..6f66476 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 _0x4b45=['Email','exports','TEXT','ENUM','out','STRING','long','DATE','INTEGER'];(function(_0x5828d0,_0x2c3e93){var _0x239b02=function(_0x702fe4){while(--_0x702fe4){_0x5828d0['push'](_0x5828d0['shift']());}};_0x239b02(++_0x2c3e93);}(_0x4b45,0x121));var _0x54b4=function(_0x59c7b6,_0x92d174){_0x59c7b6=_0x59c7b6-0x0;var _0x1d27aa=_0x4b45[_0x59c7b6];return _0x1d27aa;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0x54b4('0x0')]={'body':{'type':Sequelize[_0x54b4('0x1')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x54b4('0x1')]('medium')},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x54b4('0x2')]('in',_0x54b4('0x3')),'defaultValue':_0x54b4('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0x54b4('0x4')](0x1fe)},'from':{'type':Sequelize[_0x54b4('0x4')]},'to':{'type':Sequelize['TEXT'](_0x54b4('0x5'))},'cc':{'type':Sequelize[_0x54b4('0x1')](_0x54b4('0x5'))},'bcc':{'type':Sequelize[_0x54b4('0x1')](_0x54b4('0x5'))},'subject':{'type':Sequelize[_0x54b4('0x1')]},'sentAt':{'type':Sequelize[_0x54b4('0x6')]},'attach':{'type':Sequelize[_0x54b4('0x7')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize['TEXT'](_0x54b4('0x5'))},'originCc':{'type':Sequelize[_0x54b4('0x1')]('long')},'originChannel':{'type':Sequelize[_0x54b4('0x2')](_0x54b4('0x8'),'Chat'),'defaultValue':_0x54b4('0x8'),'allowNull':![]}}; \ No newline at end of file +var _0x2a06=['sequelize','lodash','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','long','DATE','INTEGER','Email','Chat'];(function(_0x4a60ce,_0x2a08e3){var _0x29309f=function(_0x110ae1){while(--_0x110ae1){_0x4a60ce['push'](_0x4a60ce['shift']());}};_0x29309f(++_0x2a08e3);}(_0x2a06,0xb6));var _0x62a0=function(_0x39351e,_0x54027f){_0x39351e=_0x39351e-0x0;var _0x41b507=_0x2a06[_0x39351e];return _0x41b507;};'use strict';var Sequelize=require(_0x62a0('0x0'));var _=require(_0x62a0('0x1'));module[_0x62a0('0x2')]={'body':{'type':Sequelize[_0x62a0('0x3')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x62a0('0x4'))},'read':{'type':Sequelize[_0x62a0('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x62a0('0x6')]('in','out'),'defaultValue':_0x62a0('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x62a0('0x8')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x62a0('0x3')](_0x62a0('0x9'))},'cc':{'type':Sequelize[_0x62a0('0x3')](_0x62a0('0x9'))},'bcc':{'type':Sequelize[_0x62a0('0x3')]('long')},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x62a0('0xa')]},'attach':{'type':Sequelize[_0x62a0('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x62a0('0xa')]},'originTo':{'type':Sequelize['TEXT'](_0x62a0('0x9'))},'originCc':{'type':Sequelize[_0x62a0('0x3')](_0x62a0('0x9'))},'originChannel':{'type':Sequelize[_0x62a0('0x6')](_0x62a0('0xc'),_0x62a0('0xd')),'defaultValue':_0x62a0('0xc'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index b077cbe..cf08325 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 _0x4d69=['keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','find','update','body','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','readAt','UserId','user','get','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','internal','interface','SIP/%s','channel','event','fromString','EventManager','reject','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','motionChannel','unix','toString','files','tmp','server','from','bcc','subject','createdAt','Attachment','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','existsSync','push','readFileSync','download','unlinkSync','eml-format','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','defaults','redis','localhost','html-entities','./mailMessage.socket','register','http','client','info','MailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','offset','count','limit','Content-Range','json','then','destroy','sendStatus','stack','name','send','index','MailMessage','fieldName','type','key','model','map','query'];(function(_0x35143c,_0x5788a6){var _0x13eb02=function(_0x8b3904){while(--_0x8b3904){_0x35143c['push'](_0x35143c['shift']());}};_0x13eb02(++_0x5788a6);}(_0x4d69,0x1a9));var _0x94d6=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x4d69[_0x263a74];return _0x2aa86c;};'use strict';var emlformat=require(_0x94d6('0x0'));var moment=require('moment');var BPromise=require(_0x94d6('0x1'));var util=require(_0x94d6('0x2'));var path=require(_0x94d6('0x3'));var fs=require('fs');var _=require(_0x94d6('0x4'));var Redis=require(_0x94d6('0x5'));var htmlToText=require('html-to-text');var qs=require(_0x94d6('0x6'));var logger=require(_0x94d6('0x7'))(_0x94d6('0x8'));var interaction_log=require(_0x94d6('0x7'))(_0x94d6('0x9'));var config=require(_0x94d6('0xa'));var db=require(_0x94d6('0xb'))['db'];config['redis']=_[_0x94d6('0xc')](config[_0x94d6('0xd')],{'host':_0x94d6('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x94d6('0xd')]));var htmlEntities=require(_0x94d6('0xf'));require(_0x94d6('0x10'))[_0x94d6('0x11')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x94d6('0x12')]({'port':0x232c});var client9003=jayson[_0x94d6('0x13')][_0x94d6('0x12')]({'port':0x232b});var client9002=jayson['client'][_0x94d6('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x4dfcb0,_0x25dd6a,_0x1f4570,_0xe1b92d){return new BPromise(function(_0x152c34,_0x10a4e6){var _0x379fbb=_0xe1b92d||client;return _0x379fbb['request'](_0x4dfcb0,_0x1f4570)['then'](function(_0x566c99){logger[_0x94d6('0x14')](_0x94d6('0x15'),_0x25dd6a,_0x94d6('0x16'));logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x25dd6a,_0x94d6('0x16'),JSON[_0x94d6('0x17')](_0x566c99));if(_0x566c99[_0x94d6('0x18')]){if(_0x566c99[_0x94d6('0x18')][_0x94d6('0x19')]===0x1f4){logger[_0x94d6('0x18')](_0x94d6('0x15'),_0x25dd6a,_0x566c99[_0x94d6('0x18')][_0x94d6('0x1a')]);return _0x10a4e6(_0x566c99['error']['message']);}logger[_0x94d6('0x18')](_0x94d6('0x15'),_0x25dd6a,_0x566c99[_0x94d6('0x18')][_0x94d6('0x1a')]);return _0x152c34(_0x566c99['error'][_0x94d6('0x1a')]);}else{logger[_0x94d6('0x14')](_0x94d6('0x15'),_0x25dd6a,'request\x20sent');_0x152c34(_0x566c99[_0x94d6('0x1b')][_0x94d6('0x1a')]);}})[_0x94d6('0x1c')](function(_0x24c3f9){logger['error']('MailMessage,\x20%s,\x20%s',_0x25dd6a,_0x24c3f9);_0x10a4e6(_0x24c3f9);});});}function respondWithResult(_0x3c5bae,_0x477c8f){_0x477c8f=_0x477c8f||0xc8;return function(_0x57e749){if(_0x57e749){return _0x3c5bae[_0x94d6('0x1d')](_0x477c8f)['json'](_0x57e749);}};}function respondWithFilteredResult(_0x202a9d,_0x2ae44d){return function(_0x2991e9){if(_0x2991e9){var _0x3a2734=typeof _0x2ae44d[_0x94d6('0x1e')]==='undefined'&&typeof _0x2ae44d['limit']==='undefined';var _0x4540cd=_0x2991e9[_0x94d6('0x1f')];var _0x5504dc=_0x3a2734?0x0:_0x2ae44d[_0x94d6('0x1e')];var _0x4a6e39=_0x3a2734?_0x2991e9[_0x94d6('0x1f')]:_0x2ae44d['offset']+_0x2ae44d[_0x94d6('0x20')];var _0xc617c7;if(_0x4a6e39>=_0x4540cd){_0x4a6e39=_0x4540cd;_0xc617c7=0xc8;}else{_0xc617c7=0xce;}_0x202a9d[_0x94d6('0x1d')](_0xc617c7);return _0x202a9d['set'](_0x94d6('0x21'),_0x5504dc+'-'+_0x4a6e39+'/'+_0x4540cd)[_0x94d6('0x22')](_0x2991e9);}return null;};}function saveUpdates(_0x10d9cb){return function(_0x3a7466){if(_0x3a7466){return _0x3a7466['update'](_0x10d9cb)[_0x94d6('0x23')](function(_0x525788){return _0x525788;});}return null;};}function removeEntity(_0x136acd){return function(_0x5ede32){if(_0x5ede32){return _0x5ede32[_0x94d6('0x24')]()[_0x94d6('0x23')](function(){_0x136acd[_0x94d6('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x457258){return function(_0x3c903f){if(!_0x3c903f){_0x457258[_0x94d6('0x25')](0x194);}return _0x3c903f;};}function handleError(_0x3b0e57,_0x39bb07){_0x39bb07=_0x39bb07||0x1f4;return function(_0x465b6c){logger[_0x94d6('0x18')](_0x465b6c[_0x94d6('0x26')]);if(_0x465b6c['name']){delete _0x465b6c[_0x94d6('0x27')];}_0x3b0e57[_0x94d6('0x1d')](_0x39bb07)[_0x94d6('0x28')](_0x465b6c);};}exports[_0x94d6('0x29')]=function(_0x39b654,_0x42a719){var _0x14f704={},_0x5926ab={},_0x51f183={'count':0x0,'rows':[]};var _0x2c72df=_['map'](db[_0x94d6('0x2a')]['rawAttributes'],function(_0x2b72af){return{'name':_0x2b72af[_0x94d6('0x2b')],'type':_0x2b72af[_0x94d6('0x2c')][_0x94d6('0x2d')]};});_0x5926ab[_0x94d6('0x2e')]=_[_0x94d6('0x2f')](_0x2c72df,'name');_0x5926ab[_0x94d6('0x30')]=_[_0x94d6('0x31')](_0x39b654[_0x94d6('0x30')]);_0x5926ab[_0x94d6('0x32')]=_[_0x94d6('0x33')](_0x5926ab[_0x94d6('0x2e')],_0x5926ab['query']);_0x14f704[_0x94d6('0x34')]=_[_0x94d6('0x33')](_0x5926ab[_0x94d6('0x2e')],qs[_0x94d6('0x35')](_0x39b654[_0x94d6('0x30')][_0x94d6('0x35')]));_0x14f704[_0x94d6('0x34')]=_0x14f704[_0x94d6('0x34')][_0x94d6('0x36')]?_0x14f704['attributes']:_0x5926ab[_0x94d6('0x2e')];if(!_0x39b654[_0x94d6('0x30')]['hasOwnProperty'](_0x94d6('0x37'))){_0x14f704[_0x94d6('0x20')]=qs[_0x94d6('0x20')](_0x39b654[_0x94d6('0x30')][_0x94d6('0x20')]);_0x14f704[_0x94d6('0x1e')]=qs[_0x94d6('0x1e')](_0x39b654[_0x94d6('0x30')]['offset']);}_0x14f704[_0x94d6('0x38')]=qs[_0x94d6('0x39')](_0x39b654[_0x94d6('0x30')][_0x94d6('0x39')]);_0x14f704[_0x94d6('0x3a')]=qs['filters'](_[_0x94d6('0x3b')](_0x39b654['query'],_0x5926ab[_0x94d6('0x32')]),_0x2c72df);if(_0x39b654[_0x94d6('0x30')][_0x94d6('0x3c')]){_0x14f704[_0x94d6('0x3a')]=_[_0x94d6('0x3d')](_0x14f704[_0x94d6('0x3a')],{'$or':_['map'](_0x2c72df,function(_0x37695f){if(_0x37695f['type']!=='VIRTUAL'){var _0x32554e={};_0x32554e[_0x37695f['name']]={'$like':'%'+_0x39b654[_0x94d6('0x30')][_0x94d6('0x3c')]+'%'};return _0x32554e;}})});}_0x14f704=_[_0x94d6('0x3d')]({},_0x14f704,_0x39b654[_0x94d6('0x3e')]);var _0x1be8d7={'where':_0x14f704['where']};return db[_0x94d6('0x2a')]['count'](_0x1be8d7)['then'](function(_0x54868a){_0x51f183[_0x94d6('0x1f')]=_0x54868a;if(_0x39b654[_0x94d6('0x30')][_0x94d6('0x3f')]){_0x14f704[_0x94d6('0x40')]=[{'all':!![]}];}return db[_0x94d6('0x2a')][_0x94d6('0x41')](_0x14f704);})['then'](function(_0x37cc41){_0x51f183[_0x94d6('0x42')]=_0x37cc41;return _0x51f183;})[_0x94d6('0x23')](respondWithFilteredResult(_0x42a719,_0x14f704))['catch'](handleError(_0x42a719,null));};exports[_0x94d6('0x43')]=function(_0x16790e,_0x3be30a){var _0x293fd3={'raw':!![],'where':{'id':_0x16790e[_0x94d6('0x44')]['id']}},_0x44c582={};_0x44c582['model']=_['keys'](db[_0x94d6('0x2a')]['rawAttributes']);_0x44c582[_0x94d6('0x30')]=_[_0x94d6('0x31')](_0x16790e[_0x94d6('0x30')]);_0x44c582[_0x94d6('0x32')]=_[_0x94d6('0x33')](_0x44c582[_0x94d6('0x2e')],_0x44c582['query']);_0x293fd3[_0x94d6('0x34')]=_[_0x94d6('0x33')](_0x44c582[_0x94d6('0x2e')],qs[_0x94d6('0x35')](_0x16790e['query'][_0x94d6('0x35')]));_0x293fd3[_0x94d6('0x34')]=_0x293fd3[_0x94d6('0x34')][_0x94d6('0x36')]?_0x293fd3[_0x94d6('0x34')]:_0x44c582[_0x94d6('0x2e')];if(_0x16790e[_0x94d6('0x30')][_0x94d6('0x3f')]){_0x293fd3['include']=[{'all':!![]}];}_0x293fd3=_[_0x94d6('0x3d')]({},_0x293fd3,_0x16790e[_0x94d6('0x3e')]);return db[_0x94d6('0x2a')][_0x94d6('0x45')](_0x293fd3)[_0x94d6('0x23')](handleEntityNotFound(_0x3be30a,null))['then'](respondWithResult(_0x3be30a,null))[_0x94d6('0x1c')](handleError(_0x3be30a,null));};exports[_0x94d6('0x46')]=function(_0x36ada6,_0x3dcf42){if(_0x36ada6['body']['id']){delete _0x36ada6[_0x94d6('0x47')]['id'];}return db[_0x94d6('0x2a')][_0x94d6('0x45')]({'where':{'id':_0x36ada6[_0x94d6('0x44')]['id']}})[_0x94d6('0x23')](handleEntityNotFound(_0x3dcf42,null))['then'](saveUpdates(_0x36ada6[_0x94d6('0x47')],null))['then'](respondWithResult(_0x3dcf42,null))[_0x94d6('0x1c')](handleError(_0x3dcf42,null));};exports[_0x94d6('0x24')]=function(_0x5547b3,_0x131d2b){return db[_0x94d6('0x2a')]['find']({'where':{'id':_0x5547b3[_0x94d6('0x44')]['id']}})[_0x94d6('0x23')](handleEntityNotFound(_0x131d2b,null))[_0x94d6('0x23')](removeEntity(_0x131d2b,null))[_0x94d6('0x1c')](handleError(_0x131d2b,null));};exports[_0x94d6('0x48')]=function(_0x507ecc,_0x5402da){return db[_0x94d6('0x2a')][_0x94d6('0x48')]()[_0x94d6('0x23')](respondWithResult(_0x5402da,null))[_0x94d6('0x1c')](handleError(_0x5402da,null));};exports[_0x94d6('0x49')]=function(_0x274564,_0x260d39){return db[_0x94d6('0x2a')][_0x94d6('0x49')](_0x274564['body'])[_0x94d6('0x23')](function(_0x1437c5){if(_0x1437c5){if(_0x1437c5[_0x94d6('0x4a')]===_0x94d6('0x4b')&&!_0x1437c5[_0x94d6('0x4c')]){var _0x13043e,_0x15a6a0,_0x2efecb;if(_0x274564[_0x94d6('0x47')]['to']){_0x15a6a0=_0x274564[_0x94d6('0x47')]['to'][_0x94d6('0x4d')](',')[0x0];}return db[_0x94d6('0x4e')][_0x94d6('0x4f')]({'where':{'id':_0x1437c5[_0x94d6('0x50')]},'include':[{'model':db[_0x94d6('0x51')],'as':_0x94d6('0x52'),'include':[{'model':db[_0x94d6('0x53')],'as':_0x94d6('0x54'),'where':{'email':_0x15a6a0},'limit':0x1,'order':[[_0x94d6('0x55'),'DESC']]}]},{'model':db[_0x94d6('0x56')],'as':_0x94d6('0x57'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x94d6('0x58'),'raw':!![]}]}]})[_0x94d6('0x23')](function(_0x2cfe90){_0x13043e=_0x2cfe90;if(!_0x13043e||!_0x13043e[_0x94d6('0x57')])return;var _0x342889=_0x13043e[_0x94d6('0x59')]();if(_0x274564[_0x94d6('0x47')]['attachments']&&_0x274564[_0x94d6('0x47')][_0x94d6('0x5a')][_0x94d6('0x36')]){for(var _0x134497=0x0;_0x134497<_0x274564['body']['attachments'][_0x94d6('0x36')];_0x134497+=0x1){_0x274564['body'][_0x94d6('0x5a')][_0x134497]={'filename':_0x274564[_0x94d6('0x47')][_0x94d6('0x5a')][_0x134497]['name'],'path':path[_0x94d6('0x5b')](config[_0x94d6('0x5c')],_0x94d6('0x5d'),_0x274564['body']['attachments'][_0x134497][_0x94d6('0x5e')])};}}_0x2efecb={'account':_0x342889,'message':_0x274564[_0x94d6('0x47')]};return;})['then'](function(){if(_0x13043e[_0x94d6('0x52')]){if(_0x13043e['List']['Contacts'][_0x94d6('0x36')]){return _0x13043e[_0x94d6('0x52')][_0x94d6('0x54')][0x0];}else{return db[_0x94d6('0x53')][_0x94d6('0x49')](_[_0x94d6('0xc')](_0x274564[_0x94d6('0x47')],{'firstName':_0x274564[_0x94d6('0x47')]['to'],'email':_0x274564[_0x94d6('0x47')]['to'],'phone':_0x274564[_0x94d6('0x47')]['to'],'ListId':_0x13043e[_0x94d6('0x5f')]}));}}else{throw new Error(_0x94d6('0x60'));}})[_0x94d6('0x23')](function(){if(_0x2efecb){return respondWithRpcPromise(_0x94d6('0x61'),_0x94d6('0x62'),_0x2efecb,client9003)[_0x94d6('0x23')](function(_0x1e77c6){return _0x1437c5['update']({'read':!![],'messageId':_0x1e77c6[_0x94d6('0x63')],'sentAt':moment()[_0x94d6('0x64')](_0x94d6('0x65'))});})[_0x94d6('0x1c')](function(_0x7c6a5d){logger['error']('%s',JSON[_0x94d6('0x17')](_0x7c6a5d));return _0x1437c5;});}return _0x1437c5;});}return _0x1437c5;}})[_0x94d6('0x23')](respondWithResult(_0x260d39,0xc9))['catch'](handleError(_0x260d39,null));};exports[_0x94d6('0x66')]=function(_0x14943d,_0x441122){var _0x1fae7c={'agent':{},'channel':_0x94d6('0x67')};if(_0x14943d[_0x94d6('0x47')]['id']){delete _0x14943d['body']['id'];}_0x14943d[_0x94d6('0x47')]['read']=!![];_0x14943d[_0x94d6('0x47')][_0x94d6('0x68')]=moment()[_0x94d6('0x64')](_0x94d6('0x65'));_0x14943d['body'][_0x94d6('0x69')]=_0x14943d['body'][_0x94d6('0x69')]||_0x14943d[_0x94d6('0x6a')]['id'];_0x1fae7c['agent']['id']=_0x14943d['body'][_0x94d6('0x69')];return db[_0x94d6('0x2a')][_0x94d6('0x45')]({'where':{'id':_0x14943d['params']['id'],'UserId':null}})[_0x94d6('0x23')](handleEntityNotFound(_0x441122,null))[_0x94d6('0x23')](saveUpdates(_0x14943d[_0x94d6('0x47')],null))['then'](function(_0x48ae4b){if(_0x48ae4b){_0x1fae7c[_0x94d6('0x1a')]=_0x48ae4b[_0x94d6('0x6b')]({'plain':!![]});return db['MailInteraction'][_0x94d6('0x45')]({'where':{'id':_0x48ae4b[_0x94d6('0x6c')]}});}return null;})['then'](handleEntityNotFound(_0x441122,null))[_0x94d6('0x23')](function(_0x388cd9){if(_0x388cd9){return _0x388cd9[_0x94d6('0x46')]({'UserId':_0x14943d[_0x94d6('0x47')][_0x94d6('0x69')],'read1stAt':_[_0x94d6('0x6d')](_0x388cd9[_0x94d6('0x6e')])?moment()[_0x94d6('0x64')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0xf0198e){if(_0xf0198e){_0x1fae7c[_0x94d6('0x6f')]=_0xf0198e['get']({'plain':!![]});interaction_log[_0x94d6('0x14')](_0x94d6('0x70'),_0x14943d['user']['id'],_0x14943d[_0x94d6('0x6a')][_0x94d6('0x27')],_0x14943d['user']['role'],_0x1fae7c[_0x94d6('0x6f')]['id'],_0x14943d[_0x94d6('0x47')]?JSON[_0x94d6('0x17')](_0x14943d[_0x94d6('0x47')]):_0x94d6('0x71'));return respondWithRpcPromise(_0x94d6('0x72'),_0x94d6('0x73'),_0x1fae7c);}return null;})[_0x94d6('0x23')](function(_0x456046){var _0x5a42de=_0x94d6('0x74')+_0x456046[_0x94d6('0x1a')][_0x94d6('0x75')];return db[_0x94d6('0x76')][_0x94d6('0x30')](_0x5a42de,{'type':db[_0x94d6('0x77')][_0x94d6('0x78')][_0x94d6('0x79')],'raw':!![]})[_0x94d6('0x23')](function(_0x51bdc8){return _0x51bdc8;});})[_0x94d6('0x23')](function(_0x3869a5){if(_0x3869a5){_0x1fae7c[_0x94d6('0x1a')][_0x94d6('0x7a')]=_0x3869a5[0x0];if(!_0x14943d['body'][_0x94d6('0x69')])return;return db[_0x94d6('0x7b')][_0x94d6('0x45')]({'where':{'id':_0x14943d[_0x94d6('0x47')][_0x94d6('0x69')],'role':_0x94d6('0x7c')},'attributes':['id','name',_0x94d6('0x7d'),'email',_0x94d6('0x7e')],'raw':!![]});}return null;})[_0x94d6('0x23')](function(_0x4216bf){if(!_0x4216bf)return null;_0x1fae7c[_0x94d6('0x1a')][_0x94d6('0x7c')]=_0x4216bf;return _0x1fae7c;})[_0x94d6('0x23')](function(_0x2a47e4){if(_0x2a47e4){if(_0x14943d[_0x94d6('0x47')]['manual']){_0x1fae7c[_0x94d6('0x1a')][_0x94d6('0x7f')]=util['format'](_0x94d6('0x80'),_0x14943d[_0x94d6('0x6a')][_0x94d6('0x27')]);_0x1fae7c[_0x94d6('0x1a')][_0x94d6('0x81')]=_0x1fae7c[_0x94d6('0x81')];_0x1fae7c['message']['motionChannel']=_0x1fae7c['channel'];_0x1fae7c[_0x94d6('0x1a')][_0x94d6('0x82')]=_0x94d6('0x66');_0x1fae7c[_0x94d6('0x1a')]['body']=htmlToText[_0x94d6('0x83')](_0x1fae7c['message'][_0x94d6('0x47')]);return respondWithRpcPromise(_0x94d6('0x84'),_0x94d6('0x84'),{'event':'acceptmessage','message':_0x1fae7c[_0x94d6('0x1a')]},client9002)[_0x94d6('0x23')](function(){return _0x1fae7c;});}return _0x1fae7c;}return null;})[_0x94d6('0x23')](respondWithResult(_0x441122,null))[_0x94d6('0x1c')](handleError(_0x441122,null));};exports[_0x94d6('0x85')]=function(_0x5851be,_0x29c539){var _0x514dee={'agent':{},'channel':_0x94d6('0x67')};if(_0x5851be[_0x94d6('0x47')]['id']){delete _0x5851be['body']['id'];}_0x5851be[_0x94d6('0x47')][_0x94d6('0x69')]=_0x5851be[_0x94d6('0x47')][_0x94d6('0x69')]||_0x5851be['user']['id'];_0x514dee['agent']['id']=_0x5851be[_0x94d6('0x47')]['UserId'];return db[_0x94d6('0x2a')]['find']({'where':{'id':_0x5851be[_0x94d6('0x44')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x29c539,null))[_0x94d6('0x23')](function(_0x23f744){if(_0x23f744){_0x514dee[_0x94d6('0x1a')]=_0x23f744[_0x94d6('0x6b')]({'plain':!![]});return db[_0x94d6('0x86')][_0x94d6('0x45')]({'where':{'id':_0x23f744[_0x94d6('0x6c')]}});}return null;})[_0x94d6('0x23')](handleEntityNotFound(_0x29c539,null))['then'](function(_0x547d6e){if(_0x547d6e){_0x514dee[_0x94d6('0x6f')]=_0x547d6e['get']({'plain':!![]});interaction_log['info'](_0x94d6('0x87'),_0x5851be['user']['id'],_0x5851be[_0x94d6('0x6a')][_0x94d6('0x27')],_0x5851be['user'][_0x94d6('0x88')],_0x514dee['interaction']['id'],_0x5851be[_0x94d6('0x47')]?JSON[_0x94d6('0x17')](_0x5851be[_0x94d6('0x47')]):_0x94d6('0x71'));return respondWithRpcPromise(_0x94d6('0x89'),'rejectMessage',_0x514dee);}return null;})[_0x94d6('0x23')](function(_0x5c0416){var _0xf27829=_0x94d6('0x74')+_0x5c0416['message'][_0x94d6('0x75')];return db[_0x94d6('0x76')]['query'](_0xf27829,{'type':db[_0x94d6('0x77')]['QueryTypes'][_0x94d6('0x79')],'raw':!![]})[_0x94d6('0x23')](function(_0x343786){return _0x343786;});})['then'](function(_0xa36091){if(_0xa36091){_0x514dee[_0x94d6('0x1a')][_0x94d6('0x7a')]=_0xa36091[0x0];if(!_0x5851be[_0x94d6('0x47')][_0x94d6('0x69')])return;return db[_0x94d6('0x7b')][_0x94d6('0x45')]({'where':{'id':_0x5851be[_0x94d6('0x47')]['UserId'],'role':_0x94d6('0x7c')},'attributes':['id',_0x94d6('0x27'),_0x94d6('0x7d'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x10dd8c){if(!_0x10dd8c)return null;_0x514dee[_0x94d6('0x1a')][_0x94d6('0x7c')]=_0x10dd8c;return _0x514dee;})[_0x94d6('0x23')](function(_0x1d6263){if(_0x1d6263){_0x1d6263['message']['interface']=util[_0x94d6('0x64')](_0x94d6('0x80'),_0x5851be[_0x94d6('0x6a')][_0x94d6('0x27')]);_0x1d6263[_0x94d6('0x1a')][_0x94d6('0x81')]=_0x514dee[_0x94d6('0x81')];_0x1d6263[_0x94d6('0x1a')][_0x94d6('0x8a')]=_0x514dee[_0x94d6('0x81')];_0x1d6263[_0x94d6('0x1a')][_0x94d6('0x82')]=_0x94d6('0x85');_0x1d6263[_0x94d6('0x1a')][_0x94d6('0x47')]=htmlToText[_0x94d6('0x83')](_0x514dee[_0x94d6('0x1a')][_0x94d6('0x47')]);respondWithRpcPromise('EventManager',_0x94d6('0x84'),{'event':'rejectmessage','message':_0x1d6263['message']},client9002);return _0x514dee;}return null;})[_0x94d6('0x23')](respondWithResult(_0x29c539,null))['catch'](handleError(_0x29c539,null));};exports['download']=function(_0x422ab3,_0x30ec7a){var _0x59c3e0=moment()[_0x94d6('0x8b')]()[_0x94d6('0x8c')]();var _0x175f7d=path['join'](config[_0x94d6('0x5c')],'server',_0x94d6('0x8d'),_0x94d6('0x8e'));var _0x2b6adf=path[_0x94d6('0x5b')](config[_0x94d6('0x5c')],_0x94d6('0x8f'),_0x94d6('0x8d'),'attachments');var _0x380693=util['format']('message-%s.eml',_0x59c3e0);return db[_0x94d6('0x2a')][_0x94d6('0x45')]({'where':{'id':_0x422ab3[_0x94d6('0x44')]['id']},'attributes':['id','body',_0x94d6('0x90'),'to','cc',_0x94d6('0x91'),_0x94d6('0x92'),_0x94d6('0x93')],'include':_0x422ab3[_0x94d6('0x30')][_0x94d6('0x5a')]?[{'model':db[_0x94d6('0x94')],'as':'Attachments'}]:undefined})['then'](handleEntityNotFound(_0x30ec7a,null))[_0x94d6('0x23')](function(_0x164aed){if(_0x164aed){var _0x9f3a62=_0x164aed;var _0x514823={'from':_0x9f3a62[_0x94d6('0x90')],'to':_0x9f3a62['to'],'subject':_0x9f3a62[_0x94d6('0x92')],'html':htmlEntities['decode'](_0x9f3a62[_0x94d6('0x47')]),'headers':{'Date':moment(_0x9f3a62[_0x94d6('0x93')])[_0x94d6('0x64')](_0x94d6('0x95'))},'attachments':[]};if(_0x164aed['cc']){_0x514823['headers']['Cc']=_0x164aed['cc'];}if(_0x164aed[_0x94d6('0x91')]){_0x514823[_0x94d6('0x96')][_0x94d6('0x97')]=_0x164aed[_0x94d6('0x91')];}return new BPromise(function(_0x1c3b1c,_0x4c1aa5){if(_0x164aed[_0x94d6('0x98')]){for(var _0x8e125a=0x0;_0x8e125a<_0x164aed[_0x94d6('0x98')]['length'];_0x8e125a++){var _0x393910=_0x164aed['Attachments'][_0x8e125a];var _0x48ef7d=path[_0x94d6('0x5b')](_0x2b6adf,_0x393910[_0x94d6('0x5e')]);if(fs[_0x94d6('0x99')](_0x48ef7d)){_0x514823[_0x94d6('0x5a')][_0x94d6('0x9a')]({'name':_0x393910[_0x94d6('0x27')],'contentType':_0x393910[_0x94d6('0x2c')],'data':fs[_0x94d6('0x9b')](_0x48ef7d)});}}}emlformat['build'](_0x514823,function(_0x4b4304,_0x37a396){if(_0x4b4304)return _0x4c1aa5(_0x4b4304);fs['writeFileSync'](path[_0x94d6('0x5b')](_0x175f7d,_0x380693),_0x37a396);return _0x1c3b1c(_0x37a396);});});}})[_0x94d6('0x23')](function(_0xf35a06){if(_0xf35a06){return _0x30ec7a[_0x94d6('0x9c')](path[_0x94d6('0x5b')](_0x175f7d,_0x380693),_0x380693,function(_0x296366){if(!_0x296366)fs[_0x94d6('0x9d')](path[_0x94d6('0x5b')](_0x175f7d,_0x380693));});}})[_0x94d6('0x1c')](handleError(_0x30ec7a,null));}; \ No newline at end of file +var _0x0ad2=['sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','show','params','include','find','body','describe','create','direction','secret','split','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','defaults','ListId','List\x20not\x20found','SendMail','sendMail','update','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail','read','UserId','user','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','accept','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','User','event','rejectmessage','download','unix','toString','server','files','tmp','message-%s.eml','bcc','subject','Attachment','Attachments','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','Bcc','readFileSync','writeFileSync','eml-format','moment','bluebird','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','localhost','html-entities','./mailMessage.socket','register','jayson/promise','http','client','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','status','offset','undefined','limit','count','set','Content-Range','json','destroy','end','sendStatus','stack','send','index','map','MailMessage','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order'];(function(_0x21056f,_0x4f7e91){var _0x33728e=function(_0x5be58c){while(--_0x5be58c){_0x21056f['push'](_0x21056f['shift']());}};_0x33728e(++_0x4f7e91);}(_0x0ad2,0x1b4));var _0x20ad=function(_0x3a9db0,_0x3b1a72){_0x3a9db0=_0x3a9db0-0x0;var _0x56cc7d=_0x0ad2[_0x3a9db0];return _0x56cc7d;};'use strict';var emlformat=require(_0x20ad('0x0'));var moment=require(_0x20ad('0x1'));var BPromise=require(_0x20ad('0x2'));var util=require(_0x20ad('0x3'));var path=require(_0x20ad('0x4'));var fs=require('fs');var _=require(_0x20ad('0x5'));var Redis=require(_0x20ad('0x6'));var htmlToText=require(_0x20ad('0x7'));var qs=require(_0x20ad('0x8'));var logger=require(_0x20ad('0x9'))(_0x20ad('0xa'));var interaction_log=require(_0x20ad('0x9'))(_0x20ad('0xb'));var config=require(_0x20ad('0xc'));var db=require(_0x20ad('0xd'))['db'];config['redis']=_['defaults'](config[_0x20ad('0xe')],{'host':_0x20ad('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var htmlEntities=require(_0x20ad('0x10'));require(_0x20ad('0x11'))[_0x20ad('0x12')](socket);var jayson=require(_0x20ad('0x13'));var client=jayson['client'][_0x20ad('0x14')]({'port':0x232c});var client9003=jayson[_0x20ad('0x15')]['http']({'port':0x232b});var client9002=jayson[_0x20ad('0x15')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31a14f,_0x52f5af,_0x5e6889,_0x2b8295){return new BPromise(function(_0x394711,_0x52a847){var _0x42434f=_0x2b8295||client;return _0x42434f['request'](_0x31a14f,_0x5e6889)[_0x20ad('0x16')](function(_0x2bfc4b){logger[_0x20ad('0x17')](_0x20ad('0x18'),_0x52f5af,_0x20ad('0x19'));logger['debug'](_0x20ad('0x1a'),_0x52f5af,_0x20ad('0x19'),JSON[_0x20ad('0x1b')](_0x2bfc4b));if(_0x2bfc4b[_0x20ad('0x1c')]){if(_0x2bfc4b['error']['code']===0x1f4){logger[_0x20ad('0x1c')](_0x20ad('0x18'),_0x52f5af,_0x2bfc4b[_0x20ad('0x1c')][_0x20ad('0x1d')]);return _0x52a847(_0x2bfc4b['error'][_0x20ad('0x1d')]);}logger[_0x20ad('0x1c')](_0x20ad('0x18'),_0x52f5af,_0x2bfc4b[_0x20ad('0x1c')][_0x20ad('0x1d')]);return _0x394711(_0x2bfc4b[_0x20ad('0x1c')]['message']);}else{logger[_0x20ad('0x17')](_0x20ad('0x18'),_0x52f5af,_0x20ad('0x19'));_0x394711(_0x2bfc4b['result'][_0x20ad('0x1d')]);}})[_0x20ad('0x1e')](function(_0x35f271){logger['error']('MailMessage,\x20%s,\x20%s',_0x52f5af,_0x35f271);_0x52a847(_0x35f271);});});}function respondWithResult(_0x164910,_0x1b165c){_0x1b165c=_0x1b165c||0xc8;return function(_0x2683de){if(_0x2683de){return _0x164910[_0x20ad('0x1f')](_0x1b165c)['json'](_0x2683de);}};}function respondWithFilteredResult(_0x40e3e4,_0x4ff0aa){return function(_0x1a4430){if(_0x1a4430){var _0x360920=typeof _0x4ff0aa[_0x20ad('0x20')]===_0x20ad('0x21')&&typeof _0x4ff0aa[_0x20ad('0x22')]===_0x20ad('0x21');var _0x32192e=_0x1a4430[_0x20ad('0x23')];var _0x5aa807=_0x360920?0x0:_0x4ff0aa[_0x20ad('0x20')];var _0x236f7a=_0x360920?_0x1a4430['count']:_0x4ff0aa[_0x20ad('0x20')]+_0x4ff0aa[_0x20ad('0x22')];var _0xae4309;if(_0x236f7a>=_0x32192e){_0x236f7a=_0x32192e;_0xae4309=0xc8;}else{_0xae4309=0xce;}_0x40e3e4[_0x20ad('0x1f')](_0xae4309);return _0x40e3e4[_0x20ad('0x24')](_0x20ad('0x25'),_0x5aa807+'-'+_0x236f7a+'/'+_0x32192e)[_0x20ad('0x26')](_0x1a4430);}return null;};}function saveUpdates(_0x4fc0a8){return function(_0x3e2f8c){if(_0x3e2f8c){return _0x3e2f8c['update'](_0x4fc0a8)[_0x20ad('0x16')](function(_0x1e1498){return _0x1e1498;});}return null;};}function removeEntity(_0x4e90c1){return function(_0x4ef2b6){if(_0x4ef2b6){return _0x4ef2b6[_0x20ad('0x27')]()[_0x20ad('0x16')](function(){_0x4e90c1['status'](0xcc)[_0x20ad('0x28')]();});}};}function handleEntityNotFound(_0x54a50d){return function(_0x3533f3){if(!_0x3533f3){_0x54a50d[_0x20ad('0x29')](0x194);}return _0x3533f3;};}function handleError(_0x5cbed2,_0x71c525){_0x71c525=_0x71c525||0x1f4;return function(_0x55d432){logger[_0x20ad('0x1c')](_0x55d432[_0x20ad('0x2a')]);if(_0x55d432['name']){delete _0x55d432['name'];}_0x5cbed2['status'](_0x71c525)[_0x20ad('0x2b')](_0x55d432);};}exports[_0x20ad('0x2c')]=function(_0x75ab83,_0x53b103){var _0x534b6a={},_0x3b7b2d={},_0x511f69={'count':0x0,'rows':[]};var _0x515203=_[_0x20ad('0x2d')](db[_0x20ad('0x2e')][_0x20ad('0x2f')],function(_0x2c4f59){return{'name':_0x2c4f59[_0x20ad('0x30')],'type':_0x2c4f59[_0x20ad('0x31')][_0x20ad('0x32')]};});_0x3b7b2d[_0x20ad('0x33')]=_[_0x20ad('0x2d')](_0x515203,_0x20ad('0x34'));_0x3b7b2d[_0x20ad('0x35')]=_[_0x20ad('0x36')](_0x75ab83['query']);_0x3b7b2d[_0x20ad('0x37')]=_[_0x20ad('0x38')](_0x3b7b2d['model'],_0x3b7b2d[_0x20ad('0x35')]);_0x534b6a[_0x20ad('0x39')]=_[_0x20ad('0x38')](_0x3b7b2d[_0x20ad('0x33')],qs[_0x20ad('0x3a')](_0x75ab83[_0x20ad('0x35')][_0x20ad('0x3a')]));_0x534b6a[_0x20ad('0x39')]=_0x534b6a['attributes'][_0x20ad('0x3b')]?_0x534b6a['attributes']:_0x3b7b2d[_0x20ad('0x33')];if(!_0x75ab83[_0x20ad('0x35')]['hasOwnProperty'](_0x20ad('0x3c'))){_0x534b6a['limit']=qs[_0x20ad('0x22')](_0x75ab83[_0x20ad('0x35')][_0x20ad('0x22')]);_0x534b6a[_0x20ad('0x20')]=qs['offset'](_0x75ab83[_0x20ad('0x35')][_0x20ad('0x20')]);}_0x534b6a[_0x20ad('0x3d')]=qs['sort'](_0x75ab83['query'][_0x20ad('0x3e')]);_0x534b6a[_0x20ad('0x3f')]=qs['filters'](_[_0x20ad('0x40')](_0x75ab83['query'],_0x3b7b2d['filters']),_0x515203);if(_0x75ab83[_0x20ad('0x35')][_0x20ad('0x41')]){_0x534b6a[_0x20ad('0x3f')]=_['merge'](_0x534b6a['where'],{'$or':_[_0x20ad('0x2d')](_0x515203,function(_0xd54d13){if(_0xd54d13[_0x20ad('0x31')]!==_0x20ad('0x42')){var _0x2e02c9={};_0x2e02c9[_0xd54d13[_0x20ad('0x34')]]={'$like':'%'+_0x75ab83['query']['filter']+'%'};return _0x2e02c9;}})});}_0x534b6a=_[_0x20ad('0x43')]({},_0x534b6a,_0x75ab83[_0x20ad('0x44')]);var _0x43b3fe={'where':_0x534b6a[_0x20ad('0x3f')]};return db[_0x20ad('0x2e')][_0x20ad('0x23')](_0x43b3fe)[_0x20ad('0x16')](function(_0x51ae4d){_0x511f69[_0x20ad('0x23')]=_0x51ae4d;if(_0x75ab83[_0x20ad('0x35')][_0x20ad('0x45')]){_0x534b6a['include']=[{'all':!![]}];}return db[_0x20ad('0x2e')][_0x20ad('0x46')](_0x534b6a);})[_0x20ad('0x16')](function(_0x1cb095){_0x511f69['rows']=_0x1cb095;return _0x511f69;})['then'](respondWithFilteredResult(_0x53b103,_0x534b6a))[_0x20ad('0x1e')](handleError(_0x53b103,null));};exports[_0x20ad('0x47')]=function(_0x445df7,_0x1fd646){var _0x2dd2ed={'raw':!![],'where':{'id':_0x445df7[_0x20ad('0x48')]['id']}},_0x3ccbf5={};_0x3ccbf5['model']=_['keys'](db[_0x20ad('0x2e')]['rawAttributes']);_0x3ccbf5[_0x20ad('0x35')]=_[_0x20ad('0x36')](_0x445df7[_0x20ad('0x35')]);_0x3ccbf5[_0x20ad('0x37')]=_[_0x20ad('0x38')](_0x3ccbf5['model'],_0x3ccbf5[_0x20ad('0x35')]);_0x2dd2ed[_0x20ad('0x39')]=_[_0x20ad('0x38')](_0x3ccbf5[_0x20ad('0x33')],qs[_0x20ad('0x3a')](_0x445df7[_0x20ad('0x35')][_0x20ad('0x3a')]));_0x2dd2ed[_0x20ad('0x39')]=_0x2dd2ed['attributes']['length']?_0x2dd2ed[_0x20ad('0x39')]:_0x3ccbf5[_0x20ad('0x33')];if(_0x445df7[_0x20ad('0x35')]['includeAll']){_0x2dd2ed[_0x20ad('0x49')]=[{'all':!![]}];}_0x2dd2ed=_[_0x20ad('0x43')]({},_0x2dd2ed,_0x445df7[_0x20ad('0x44')]);return db[_0x20ad('0x2e')][_0x20ad('0x4a')](_0x2dd2ed)[_0x20ad('0x16')](handleEntityNotFound(_0x1fd646,null))[_0x20ad('0x16')](respondWithResult(_0x1fd646,null))[_0x20ad('0x1e')](handleError(_0x1fd646,null));};exports['update']=function(_0x1b07d4,_0x100873){if(_0x1b07d4[_0x20ad('0x4b')]['id']){delete _0x1b07d4['body']['id'];}return db['MailMessage']['find']({'where':{'id':_0x1b07d4['params']['id']}})[_0x20ad('0x16')](handleEntityNotFound(_0x100873,null))[_0x20ad('0x16')](saveUpdates(_0x1b07d4['body'],null))[_0x20ad('0x16')](respondWithResult(_0x100873,null))[_0x20ad('0x1e')](handleError(_0x100873,null));};exports[_0x20ad('0x27')]=function(_0x1b54f4,_0x5ebce4){return db['MailMessage'][_0x20ad('0x4a')]({'where':{'id':_0x1b54f4[_0x20ad('0x48')]['id']}})['then'](handleEntityNotFound(_0x5ebce4,null))[_0x20ad('0x16')](removeEntity(_0x5ebce4,null))[_0x20ad('0x1e')](handleError(_0x5ebce4,null));};exports['describe']=function(_0x1c7195,_0x4040f3){return db[_0x20ad('0x2e')][_0x20ad('0x4c')]()['then'](respondWithResult(_0x4040f3,null))['catch'](handleError(_0x4040f3,null));};exports[_0x20ad('0x4d')]=function(_0x3229e8,_0x2208d4){return db[_0x20ad('0x2e')][_0x20ad('0x4d')](_0x3229e8['body'])[_0x20ad('0x16')](function(_0x3a8e69){if(_0x3a8e69){if(_0x3a8e69[_0x20ad('0x4e')]==='out'&&!_0x3a8e69[_0x20ad('0x4f')]){var _0xdb76b5,_0x180ed0,_0x12ec26;if(_0x3229e8['body']['to']){_0x180ed0=_0x3229e8['body']['to'][_0x20ad('0x50')](',')[0x0];}return db['MailAccount'][_0x20ad('0x51')]({'where':{'id':_0x3a8e69[_0x20ad('0x52')]},'include':[{'model':db[_0x20ad('0x53')],'as':_0x20ad('0x54'),'include':[{'model':db[_0x20ad('0x55')],'as':_0x20ad('0x56'),'where':{'email':_0x180ed0},'limit':0x1,'order':[[_0x20ad('0x57'),_0x20ad('0x58')]]}]},{'model':db[_0x20ad('0x59')],'as':_0x20ad('0x5a'),'raw':!![],'include':[{'model':db[_0x20ad('0x5b')],'as':_0x20ad('0x5b'),'raw':!![]}]}]})['then'](function(_0x3774cc){_0xdb76b5=_0x3774cc;if(!_0xdb76b5||!_0xdb76b5[_0x20ad('0x5a')])return;var _0x74cc73=_0xdb76b5[_0x20ad('0x5c')]();if(_0x3229e8[_0x20ad('0x4b')][_0x20ad('0x5d')]&&_0x3229e8['body']['attachments']['length']){for(var _0x4d8383=0x0;_0x4d8383<_0x3229e8[_0x20ad('0x4b')][_0x20ad('0x5d')][_0x20ad('0x3b')];_0x4d8383+=0x1){_0x3229e8[_0x20ad('0x4b')]['attachments'][_0x4d8383]={'filename':_0x3229e8['body']['attachments'][_0x4d8383]['name'],'path':path[_0x20ad('0x5e')](config[_0x20ad('0x5f')],_0x20ad('0x60'),_0x3229e8[_0x20ad('0x4b')]['attachments'][_0x4d8383][_0x20ad('0x61')])};}}_0x12ec26={'account':_0x74cc73,'message':_0x3229e8[_0x20ad('0x4b')]};return;})[_0x20ad('0x16')](function(){if(_0xdb76b5['List']){if(_0xdb76b5[_0x20ad('0x54')][_0x20ad('0x56')][_0x20ad('0x3b')]){return _0xdb76b5[_0x20ad('0x54')]['Contacts'][0x0];}else{return db[_0x20ad('0x55')][_0x20ad('0x4d')](_[_0x20ad('0x62')](_0x3229e8[_0x20ad('0x4b')],{'firstName':_0x3229e8[_0x20ad('0x4b')]['to'],'email':_0x3229e8[_0x20ad('0x4b')]['to'],'phone':_0x3229e8[_0x20ad('0x4b')]['to'],'ListId':_0xdb76b5[_0x20ad('0x63')]}));}}else{throw new Error(_0x20ad('0x64'));}})[_0x20ad('0x16')](function(){if(_0x12ec26){return respondWithRpcPromise(_0x20ad('0x65'),_0x20ad('0x66'),_0x12ec26,client9003)[_0x20ad('0x16')](function(_0x379d82){return _0x3a8e69[_0x20ad('0x67')]({'read':!![],'messageId':_0x379d82[_0x20ad('0x68')],'sentAt':moment()[_0x20ad('0x69')](_0x20ad('0x6a'))});})[_0x20ad('0x1e')](function(_0x301b8c){logger[_0x20ad('0x1c')]('%s',JSON['stringify'](_0x301b8c));return _0x3a8e69;});}return _0x3a8e69;});}return _0x3a8e69;}})[_0x20ad('0x16')](respondWithResult(_0x2208d4,0xc9))['catch'](handleError(_0x2208d4,null));};exports['accept']=function(_0x20bb8a,_0x2ebc7b){var _0x328a05={'agent':{},'channel':_0x20ad('0x6b')};if(_0x20bb8a[_0x20ad('0x4b')]['id']){delete _0x20bb8a[_0x20ad('0x4b')]['id'];}_0x20bb8a[_0x20ad('0x4b')][_0x20ad('0x6c')]=!![];_0x20bb8a[_0x20ad('0x4b')]['readAt']=moment()[_0x20ad('0x69')](_0x20ad('0x6a'));_0x20bb8a[_0x20ad('0x4b')][_0x20ad('0x6d')]=_0x20bb8a[_0x20ad('0x4b')][_0x20ad('0x6d')]||_0x20bb8a[_0x20ad('0x6e')]['id'];_0x328a05[_0x20ad('0x6f')]['id']=_0x20bb8a[_0x20ad('0x4b')]['UserId'];return db['MailMessage']['find']({'where':{'id':_0x20bb8a['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2ebc7b,null))['then'](saveUpdates(_0x20bb8a['body'],null))['then'](function(_0x206667){if(_0x206667){_0x328a05[_0x20ad('0x1d')]=_0x206667[_0x20ad('0x70')]({'plain':!![]});return db[_0x20ad('0x71')][_0x20ad('0x4a')]({'where':{'id':_0x206667[_0x20ad('0x72')]}});}return null;})[_0x20ad('0x16')](handleEntityNotFound(_0x2ebc7b,null))[_0x20ad('0x16')](function(_0x3ae3e0){if(_0x3ae3e0){return _0x3ae3e0['update']({'UserId':_0x20bb8a['body'][_0x20ad('0x6d')],'read1stAt':_[_0x20ad('0x73')](_0x3ae3e0[_0x20ad('0x74')])?moment()[_0x20ad('0x69')](_0x20ad('0x6a')):undefined});}return null;})[_0x20ad('0x16')](function(_0xdd9a24){if(_0xdd9a24){_0x328a05[_0x20ad('0x75')]=_0xdd9a24['get']({'plain':!![]});interaction_log[_0x20ad('0x17')](_0x20ad('0x76'),_0x20bb8a[_0x20ad('0x6e')]['id'],_0x20bb8a['user'][_0x20ad('0x34')],_0x20bb8a[_0x20ad('0x6e')][_0x20ad('0x77')],_0x328a05['interaction']['id'],_0x20bb8a[_0x20ad('0x4b')]?JSON[_0x20ad('0x1b')](_0x20bb8a[_0x20ad('0x4b')]):_0x20ad('0x78'));return respondWithRpcPromise(_0x20ad('0x79'),_0x20ad('0x7a'),_0x328a05);}return null;})[_0x20ad('0x16')](function(_0x55f6c0){var _0x4650a9=_0x20ad('0x7b')+_0x55f6c0[_0x20ad('0x1d')][_0x20ad('0x7c')];return db[_0x20ad('0x7d')][_0x20ad('0x35')](_0x4650a9,{'type':db['Sequelize'][_0x20ad('0x7e')][_0x20ad('0x7f')],'raw':!![]})[_0x20ad('0x16')](function(_0x3e0f19){return _0x3e0f19;});})[_0x20ad('0x16')](function(_0x50e19c){if(_0x50e19c){_0x328a05['message'][_0x20ad('0x80')]=_0x50e19c[0x0];if(!_0x20bb8a[_0x20ad('0x4b')][_0x20ad('0x6d')])return;return db['User']['find']({'where':{'id':_0x20bb8a['body'][_0x20ad('0x6d')],'role':_0x20ad('0x6f')},'attributes':['id','name',_0x20ad('0x81'),_0x20ad('0x82'),_0x20ad('0x83')],'raw':!![]});}return null;})['then'](function(_0x2530ba){if(!_0x2530ba)return null;_0x328a05[_0x20ad('0x1d')]['agent']=_0x2530ba;return _0x328a05;})[_0x20ad('0x16')](function(_0x4da253){if(_0x4da253){if(_0x20bb8a['body'][_0x20ad('0x84')]){_0x328a05[_0x20ad('0x1d')][_0x20ad('0x85')]=util['format'](_0x20ad('0x86'),_0x20bb8a[_0x20ad('0x6e')][_0x20ad('0x34')]);_0x328a05[_0x20ad('0x1d')][_0x20ad('0x87')]=_0x328a05[_0x20ad('0x87')];_0x328a05[_0x20ad('0x1d')][_0x20ad('0x88')]=_0x328a05[_0x20ad('0x87')];_0x328a05['message']['event']=_0x20ad('0x89');_0x328a05[_0x20ad('0x1d')][_0x20ad('0x4b')]=htmlToText[_0x20ad('0x8a')](_0x328a05[_0x20ad('0x1d')]['body']);return respondWithRpcPromise(_0x20ad('0x8b'),_0x20ad('0x8b'),{'event':_0x20ad('0x8c'),'message':_0x328a05[_0x20ad('0x1d')]},client9002)[_0x20ad('0x16')](function(){return _0x328a05;});}return _0x328a05;}return null;})['then'](respondWithResult(_0x2ebc7b,null))['catch'](handleError(_0x2ebc7b,null));};exports[_0x20ad('0x8d')]=function(_0x507642,_0x17c2f5){var _0x451a0c={'agent':{},'channel':'mail'};if(_0x507642[_0x20ad('0x4b')]['id']){delete _0x507642[_0x20ad('0x4b')]['id'];}_0x507642[_0x20ad('0x4b')][_0x20ad('0x6d')]=_0x507642[_0x20ad('0x4b')][_0x20ad('0x6d')]||_0x507642['user']['id'];_0x451a0c[_0x20ad('0x6f')]['id']=_0x507642[_0x20ad('0x4b')][_0x20ad('0x6d')];return db[_0x20ad('0x2e')][_0x20ad('0x4a')]({'where':{'id':_0x507642[_0x20ad('0x48')]['id'],'UserId':null}})[_0x20ad('0x16')](handleEntityNotFound(_0x17c2f5,null))[_0x20ad('0x16')](function(_0xf9f489){if(_0xf9f489){_0x451a0c[_0x20ad('0x1d')]=_0xf9f489[_0x20ad('0x70')]({'plain':!![]});return db[_0x20ad('0x71')]['find']({'where':{'id':_0xf9f489[_0x20ad('0x72')]}});}return null;})[_0x20ad('0x16')](handleEntityNotFound(_0x17c2f5,null))[_0x20ad('0x16')](function(_0x214401){if(_0x214401){_0x451a0c[_0x20ad('0x75')]=_0x214401[_0x20ad('0x70')]({'plain':!![]});interaction_log[_0x20ad('0x17')](_0x20ad('0x8e'),_0x507642[_0x20ad('0x6e')]['id'],_0x507642[_0x20ad('0x6e')]['name'],_0x507642[_0x20ad('0x6e')][_0x20ad('0x77')],_0x451a0c['interaction']['id'],_0x507642[_0x20ad('0x4b')]?JSON[_0x20ad('0x1b')](_0x507642['body']):'null');return respondWithRpcPromise(_0x20ad('0x8f'),_0x20ad('0x90'),_0x451a0c);}return null;})[_0x20ad('0x16')](function(_0x44d318){var _0x2ec6f3=_0x20ad('0x7b')+_0x44d318[_0x20ad('0x1d')]['ContactId'];return db['sequelize'][_0x20ad('0x35')](_0x2ec6f3,{'type':db[_0x20ad('0x91')][_0x20ad('0x7e')][_0x20ad('0x7f')],'raw':!![]})[_0x20ad('0x16')](function(_0x5edb3f){return _0x5edb3f;});})[_0x20ad('0x16')](function(_0x33ea35){if(_0x33ea35){_0x451a0c['message'][_0x20ad('0x80')]=_0x33ea35[0x0];if(!_0x507642[_0x20ad('0x4b')][_0x20ad('0x6d')])return;return db[_0x20ad('0x92')][_0x20ad('0x4a')]({'where':{'id':_0x507642['body'][_0x20ad('0x6d')],'role':'agent'},'attributes':['id',_0x20ad('0x34'),'fullname',_0x20ad('0x82'),'internal'],'raw':!![]});}return null;})[_0x20ad('0x16')](function(_0x4edd62){if(!_0x4edd62)return null;_0x451a0c[_0x20ad('0x1d')][_0x20ad('0x6f')]=_0x4edd62;return _0x451a0c;})[_0x20ad('0x16')](function(_0x5ad819){if(_0x5ad819){_0x5ad819[_0x20ad('0x1d')][_0x20ad('0x85')]=util[_0x20ad('0x69')](_0x20ad('0x86'),_0x507642['user'][_0x20ad('0x34')]);_0x5ad819['message'][_0x20ad('0x87')]=_0x451a0c[_0x20ad('0x87')];_0x5ad819['message'][_0x20ad('0x88')]=_0x451a0c[_0x20ad('0x87')];_0x5ad819[_0x20ad('0x1d')][_0x20ad('0x93')]=_0x20ad('0x8d');_0x5ad819[_0x20ad('0x1d')][_0x20ad('0x4b')]=htmlToText[_0x20ad('0x8a')](_0x451a0c[_0x20ad('0x1d')][_0x20ad('0x4b')]);respondWithRpcPromise('EventManager',_0x20ad('0x8b'),{'event':_0x20ad('0x94'),'message':_0x5ad819[_0x20ad('0x1d')]},client9002);return _0x451a0c;}return null;})[_0x20ad('0x16')](respondWithResult(_0x17c2f5,null))['catch'](handleError(_0x17c2f5,null));};exports[_0x20ad('0x95')]=function(_0x2d8a57,_0x2f8111){var _0x507be9=moment()[_0x20ad('0x96')]()[_0x20ad('0x97')]();var _0x3ef8ac=path[_0x20ad('0x5e')](config[_0x20ad('0x5f')],_0x20ad('0x98'),_0x20ad('0x99'),_0x20ad('0x9a'));var _0x21c57b=path[_0x20ad('0x5e')](config[_0x20ad('0x5f')],'server',_0x20ad('0x99'),_0x20ad('0x5d'));var _0x317af8=util[_0x20ad('0x69')](_0x20ad('0x9b'),_0x507be9);return db[_0x20ad('0x2e')][_0x20ad('0x4a')]({'where':{'id':_0x2d8a57[_0x20ad('0x48')]['id']},'attributes':['id','body','from','to','cc',_0x20ad('0x9c'),_0x20ad('0x9d'),'createdAt'],'include':_0x2d8a57['query'][_0x20ad('0x5d')]?[{'model':db[_0x20ad('0x9e')],'as':_0x20ad('0x9f')}]:undefined})[_0x20ad('0x16')](handleEntityNotFound(_0x2f8111,null))[_0x20ad('0x16')](function(_0x3a5988){if(_0x3a5988){var _0x57fb4e=_0x3a5988;var _0x387cba={'from':_0x57fb4e['from'],'to':_0x57fb4e['to'],'subject':_0x57fb4e[_0x20ad('0x9d')],'html':htmlEntities[_0x20ad('0xa0')](_0x57fb4e[_0x20ad('0x4b')]),'headers':{'Date':moment(_0x57fb4e[_0x20ad('0xa1')])['format'](_0x20ad('0xa2'))},'attachments':[]};if(_0x3a5988['cc']){_0x387cba['headers']['Cc']=_0x3a5988['cc'];}if(_0x3a5988[_0x20ad('0x9c')]){_0x387cba['headers'][_0x20ad('0xa3')]=_0x3a5988[_0x20ad('0x9c')];}return new BPromise(function(_0x1395ea,_0x271c19){if(_0x3a5988['Attachments']){for(var _0x2de13b=0x0;_0x2de13b<_0x3a5988['Attachments'][_0x20ad('0x3b')];_0x2de13b++){var _0x11e780=_0x3a5988['Attachments'][_0x2de13b];var _0x4fd922=path[_0x20ad('0x5e')](_0x21c57b,_0x11e780[_0x20ad('0x61')]);if(fs['existsSync'](_0x4fd922)){_0x387cba[_0x20ad('0x5d')]['push']({'name':_0x11e780['name'],'contentType':_0x11e780[_0x20ad('0x31')],'data':fs[_0x20ad('0xa4')](_0x4fd922)});}}}emlformat['build'](_0x387cba,function(_0x26cd05,_0x4bedae){if(_0x26cd05)return _0x271c19(_0x26cd05);fs[_0x20ad('0xa5')](path[_0x20ad('0x5e')](_0x3ef8ac,_0x317af8),_0x4bedae);return _0x1395ea(_0x4bedae);});});}})['then'](function(_0xba9383){if(_0xba9383){return _0x2f8111['download'](path['join'](_0x3ef8ac,_0x317af8),_0x317af8,function(_0x4a3707){if(!_0x4a3707)fs['unlinkSync'](path['join'](_0x3ef8ac,_0x317af8));});}})['catch'](handleError(_0x2f8111,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 10c056c..075dea7 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 _0x3d48=['update','remove','emit','exports','events','MailMessage','save'];(function(_0x57c828,_0x1d716c){var _0x3b5e89=function(_0x3303b4){while(--_0x3303b4){_0x57c828['push'](_0x57c828['shift']());}};_0x3b5e89(++_0x1d716c);}(_0x3d48,0xcf));var _0x83d4=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x3d48[_0x502c7d];return _0x30b7ed;};'use strict';var EventEmitter=require(_0x83d4('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x83d4('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x83d4('0x2'),'afterUpdate':_0x83d4('0x3'),'afterDestroy':_0x83d4('0x4')};function emitEvent(_0x970b43){return function(_0xcc221a,_0x43c639,_0x41e960){MailMessageEvents[_0x83d4('0x5')](_0x970b43+':'+_0xcc221a['id'],_0xcc221a);MailMessageEvents[_0x83d4('0x5')](_0x970b43,_0xcc221a);_0x41e960(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x83d4('0x6')]=MailMessageEvents; \ No newline at end of file +var _0x6337=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save'];(function(_0x286f87,_0x4605d3){var _0x9d5b54=function(_0x59b4d3){while(--_0x59b4d3){_0x286f87['push'](_0x286f87['shift']());}};_0x9d5b54(++_0x4605d3);}(_0x6337,0xcd));var _0x7633=function(_0x5d3d76,_0x96f453){_0x5d3d76=_0x5d3d76-0x0;var _0x2382f9=_0x6337[_0x5d3d76];return _0x2382f9;};'use strict';var EventEmitter=require(_0x7633('0x0'));var MailMessage=require(_0x7633('0x1'))['db'][_0x7633('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x7633('0x3')](0x0);var events={'afterCreate':_0x7633('0x4'),'afterUpdate':_0x7633('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4b49b5){return function(_0x27acaa,_0x305f89,_0x959e35){MailMessageEvents['emit'](_0x4b49b5+':'+_0x27acaa['id'],_0x27acaa);MailMessageEvents[_0x7633('0x6')](_0x4b49b5,_0x27acaa);_0x959e35(null);};}for(var e in events){if(events[_0x7633('0x7')](e)){var event=events[e];MailMessage[_0x7633('0x8')](e,emitEvent(event));}}module[_0x7633('0x9')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index aa027f8..71acd40 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 _0xd290=['UserId','MailInteraction','findOne','MailInteractionId','createdAt','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailMessage','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','fromString','models','get','toLowerCase','direction','secret','isNil'];(function(_0x17d229,_0x265a8f){var _0x2318da=function(_0x4a9fd5){while(--_0x4a9fd5){_0x17d229['push'](_0x17d229['shift']());}};_0x2318da(++_0x265a8f);}(_0xd290,0x1e8));var _0x0d29=function(_0x31b192,_0x4d0e5c){_0x31b192=_0x31b192-0x0;var _0x559a3a=_0xd290[_0x31b192];return _0x559a3a;};'use strict';var _=require('lodash');var util=require(_0x0d29('0x0'));var logger=require(_0x0d29('0x1'))(_0x0d29('0x2'));var moment=require(_0x0d29('0x3'));var BPromise=require(_0x0d29('0x4'));var rp=require(_0x0d29('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x0d29('0x6'));var rimraf=require(_0x0d29('0x7'));var config=require(_0x0d29('0x8'));var attributes=require('./mailMessage.attributes');module[_0x0d29('0x9')]=function(_0x5625ca,_0x117c2d){return _0x5625ca[_0x0d29('0xa')](_0x0d29('0xb'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x0d29('0xc')]},{'name':_0x0d29('0xd'),'fields':[_0x0d29('0xe'),_0x0d29('0xf')],'type':_0x0d29('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x46d369,_0x3d581f,_0x418685){if(_0x46d369['body']){_0x46d369[_0x0d29('0xe')]=htmlToText[_0x0d29('0x11')](_0x46d369['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x418685(null,_0x3d581f);},'afterCreate':function(_0x40797c,_0x21cb6e,_0x614273){var _0x58103d=_0x5625ca[_0x0d29('0x12')];var _0x2ec75e=_0x40797c[_0x0d29('0x13')]({'plain':!![]});if(_0x2ec75e['direction'][_0x0d29('0x14')]()==='in'||_0x2ec75e[_0x0d29('0x15')][_0x0d29('0x14')]()==='out'&&!_0x2ec75e[_0x0d29('0x16')]&&!_[_0x0d29('0x17')](_0x2ec75e[_0x0d29('0x18')])){_0x58103d[_0x0d29('0x19')][_0x0d29('0x1a')]({'where':{'id':_0x2ec75e[_0x0d29('0x1b')]}})['then'](function(_0xcfd80b){if(_0xcfd80b){_0xcfd80b['update']({'lastMsgAt':_0x2ec75e[_0x0d29('0x1c')],'lastMsgDirection':_0x2ec75e[_0x0d29('0x15')][_0x0d29('0x14')]()});}})['catch'](function(_0x41d3c3){console[_0x0d29('0x1d')](_0x41d3c3);});}_0x614273();}},'charset':_0x0d29('0x1e'),'collate':_0x0d29('0x1f')});}; \ No newline at end of file +var _0xdf61=['bluebird','request-promise','path','rimraf','exports','define','MailMessage','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','models','direction','toLowerCase','out','secret','isNil','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x224c67,_0x450adb){var _0x1c9538=function(_0x58c14d){while(--_0x58c14d){_0x224c67['push'](_0x224c67['shift']());}};_0x1c9538(++_0x450adb);}(_0xdf61,0xb6));var _0x1df6=function(_0x295d70,_0xa6ff98){_0x295d70=_0x295d70-0x0;var _0x1a6a39=_0xdf61[_0x295d70];return _0x1a6a39;};'use strict';var _=require(_0x1df6('0x0'));var util=require(_0x1df6('0x1'));var logger=require(_0x1df6('0x2'))(_0x1df6('0x3'));var moment=require('moment');var BPromise=require(_0x1df6('0x4'));var rp=require(_0x1df6('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x1df6('0x6'));var rimraf=require(_0x1df6('0x7'));var config=require('../../config/environment');var attributes=require('./mailMessage.attributes');module[_0x1df6('0x8')]=function(_0x5d0e4b,_0x368b50){return _0x5d0e4b[_0x1df6('0x9')](_0x1df6('0xa'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x1df6('0xb'),'fields':[_0x1df6('0xb')]},{'name':_0x1df6('0xc'),'fields':[_0x1df6('0xd'),_0x1df6('0xe')],'type':_0x1df6('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x409811,_0x49dee8,_0xda58d){if(_0x409811[_0x1df6('0x10')]){_0x409811[_0x1df6('0xd')]=htmlToText['fromString'](_0x409811[_0x1df6('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0xda58d(null,_0x49dee8);},'afterCreate':function(_0xc7efd9,_0x2c7503,_0x3c7081){var _0x54d431=_0x5d0e4b[_0x1df6('0x11')];var _0x15a9e5=_0xc7efd9['get']({'plain':!![]});if(_0x15a9e5[_0x1df6('0x12')][_0x1df6('0x13')]()==='in'||_0x15a9e5['direction'][_0x1df6('0x13')]()===_0x1df6('0x14')&&!_0x15a9e5[_0x1df6('0x15')]&&!_[_0x1df6('0x16')](_0x15a9e5['UserId'])){_0x54d431[_0x1df6('0x17')][_0x1df6('0x18')]({'where':{'id':_0x15a9e5[_0x1df6('0x19')]}})[_0x1df6('0x1a')](function(_0x6af066){if(_0x6af066){_0x6af066[_0x1df6('0x1b')]({'lastMsgAt':_0x15a9e5[_0x1df6('0x1c')],'lastMsgDirection':_0x15a9e5[_0x1df6('0x12')]['toLowerCase']()});}})[_0x1df6('0x1d')](function(_0x2e8ea2){console['error'](_0x2e8ea2);});}_0x3c7081();}},'charset':'utf8mb4','collate':_0x1df6('0x1e')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index b8b3e41..a6e19df 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 _0xbaf0=['request','then','info','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','MailMessage,\x20%s,\x20%s','message','result','catch','MailMessage','create','body','options','raw','CreateMailMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailMessage.socket','register'];(function(_0x59e85e,_0x4e399b){var _0x34e955=function(_0xebbfce){while(--_0xebbfce){_0x59e85e['push'](_0x59e85e['shift']());}};_0x34e955(++_0x4e399b);}(_0xbaf0,0x12a));var _0x0baf=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xbaf0[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});config[_0x0baf('0xc')]=_[_0x0baf('0xd')](config[_0x0baf('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0baf('0xe'))(new Redis(config['redis']));require(_0x0baf('0xf'))[_0x0baf('0x10')](socket);function respondWithRpcPromise(_0x465528,_0x2f46e8,_0x7f54d4){return new BPromise(function(_0xf4c8ac,_0x41cead){return client[_0x0baf('0x11')](_0x465528,_0x7f54d4)[_0x0baf('0x12')](function(_0x1d60a2){logger[_0x0baf('0x13')]('MailMessage,\x20%s,\x20%s',_0x2f46e8,'request\x20sent');logger[_0x0baf('0x14')](_0x0baf('0x15'),_0x2f46e8,_0x0baf('0x16'),JSON[_0x0baf('0x17')](_0x1d60a2));if(_0x1d60a2['error']){if(_0x1d60a2[_0x0baf('0x18')]['code']===0x1f4){logger[_0x0baf('0x18')](_0x0baf('0x19'),_0x2f46e8,_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);return _0x41cead(_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x2f46e8,_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);return _0xf4c8ac(_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);}else{logger[_0x0baf('0x13')](_0x0baf('0x19'),_0x2f46e8,'request\x20sent');_0xf4c8ac(_0x1d60a2[_0x0baf('0x1b')][_0x0baf('0x1a')]);}})[_0x0baf('0x1c')](function(_0x3e9cb4){logger[_0x0baf('0x18')](_0x0baf('0x19'),_0x2f46e8,_0x3e9cb4);_0x41cead(_0x3e9cb4);});});}exports['CreateMailMessage']=function(_0x5cff5d){var _0x1410ec=this;return new Promise(function(_0x154f48,_0x32e839){return db[_0x0baf('0x1d')][_0x0baf('0x1e')](_0x5cff5d[_0x0baf('0x1f')],{'raw':_0x5cff5d[_0x0baf('0x20')]?_0x5cff5d[_0x0baf('0x20')][_0x0baf('0x21')]===undefined?!![]:![]:!![]})[_0x0baf('0x12')](function(_0x54f2fa){logger[_0x0baf('0x13')]('CreateMailMessage',_0x5cff5d);logger[_0x0baf('0x14')]('CreateMailMessage',_0x5cff5d,JSON['stringify'](_0x54f2fa));_0x154f48(_0x54f2fa);})[_0x0baf('0x1c')](function(_0x48a0e9){logger['error'](_0x0baf('0x22'),_0x48a0e9[_0x0baf('0x1a')],_0x5cff5d);_0x32e839(_0x1410ec[_0x0baf('0x18')](0x1f4,_0x48a0e9[_0x0baf('0x1a')]));});});}; \ No newline at end of file +var _0xed3c=['request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateMailMessage','MailMessage','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','localhost','register'];(function(_0x5c1bdc,_0x4eb6f0){var _0xb3fd5=function(_0x568767){while(--_0x568767){_0x5c1bdc['push'](_0x5c1bdc['shift']());}};_0xb3fd5(++_0x4eb6f0);}(_0xed3c,0x1a6));var _0xced3=function(_0x2ddfd9,_0x5877d0){_0x2ddfd9=_0x2ddfd9-0x0;var _0x2668f0=_0xed3c[_0x2ddfd9];return _0x2668f0;};'use strict';var _=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var moment=require(_0xced3('0x2'));var BPromise=require(_0xced3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xced3('0x4'));var db=require(_0xced3('0x5'))['db'];var utils=require(_0xced3('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xced3('0x7'));var jayson=require(_0xced3('0x8'));var client=jayson[_0xced3('0x9')][_0xced3('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xced3('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailMessage.socket')[_0xced3('0xc')](socket);function respondWithRpcPromise(_0x321c42,_0x3e5a04,_0x12612f){return new BPromise(function(_0x1cb639,_0x5934b2){return client[_0xced3('0xd')](_0x321c42,_0x12612f)[_0xced3('0xe')](function(_0x3da0ff){logger['info'](_0xced3('0xf'),_0x3e5a04,_0xced3('0x10'));logger[_0xced3('0x11')](_0xced3('0x12'),_0x3e5a04,_0xced3('0x10'),JSON[_0xced3('0x13')](_0x3da0ff));if(_0x3da0ff[_0xced3('0x14')]){if(_0x3da0ff['error'][_0xced3('0x15')]===0x1f4){logger['error'](_0xced3('0xf'),_0x3e5a04,_0x3da0ff[_0xced3('0x14')][_0xced3('0x16')]);return _0x5934b2(_0x3da0ff[_0xced3('0x14')]['message']);}logger[_0xced3('0x14')](_0xced3('0xf'),_0x3e5a04,_0x3da0ff['error'][_0xced3('0x16')]);return _0x1cb639(_0x3da0ff[_0xced3('0x14')][_0xced3('0x16')]);}else{logger[_0xced3('0x17')]('MailMessage,\x20%s,\x20%s',_0x3e5a04,_0xced3('0x10'));_0x1cb639(_0x3da0ff['result'][_0xced3('0x16')]);}})[_0xced3('0x18')](function(_0x32c402){logger[_0xced3('0x14')](_0xced3('0xf'),_0x3e5a04,_0x32c402);_0x5934b2(_0x32c402);});});}exports[_0xced3('0x19')]=function(_0xe0cf2e){var _0x16d30d=this;return new Promise(function(_0x3f688c,_0x17c011){return db[_0xced3('0x1a')]['create'](_0xe0cf2e['body'],{'raw':_0xe0cf2e['options']?_0xe0cf2e[_0xced3('0x1b')][_0xced3('0x1c')]===undefined?!![]:![]:!![]})[_0xced3('0xe')](function(_0x4bf915){logger[_0xced3('0x17')](_0xced3('0x19'),_0xe0cf2e);logger['debug']('CreateMailMessage',_0xe0cf2e,JSON[_0xced3('0x13')](_0x4bf915));_0x3f688c(_0x4bf915);})[_0xced3('0x18')](function(_0x219fa8){logger[_0xced3('0x14')]('CreateMailMessage',_0x219fa8[_0xced3('0x16')],_0xe0cf2e);_0x17c011(_0x16d30d[_0xced3('0x14')](0x1f4,_0x219fa8['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 3f519a7..0111a2c 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 _0x6324=['save','removeListener','register','length','mailMessage:'];(function(_0x5ac8b8,_0x43f938){var _0x143e78=function(_0x469efd){while(--_0x469efd){_0x5ac8b8['push'](_0x5ac8b8['shift']());}};_0x143e78(++_0x43f938);}(_0x6324,0x13b));var _0x4632=function(_0xe9e8f9,_0xa250b8){_0xe9e8f9=_0xe9e8f9-0x0;var _0x28768e=_0x6324[_0xe9e8f9];return _0x28768e;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x4632('0x0'),'remove','update'];function createListener(_0xcdafe8,_0x75f872){return function(_0x143a36){_0x75f872['emit'](_0xcdafe8,_0x143a36);};}function removeListener(_0x1d52ae,_0x23194f){return function(){MailMessageEvents[_0x4632('0x1')](_0x1d52ae,_0x23194f);};}exports[_0x4632('0x2')]=function(_0x39d265){for(var _0xa77962=0x0,_0x4a7800=events[_0x4632('0x3')];_0xa77962<_0x4a7800;_0xa77962++){var _0x4a8368=events[_0xa77962];var _0x17e6bd=createListener(_0x4632('0x4')+_0x4a8368,_0x39d265);MailMessageEvents['on'](_0x4a8368,_0x17e6bd);}}; \ No newline at end of file +var _0x2e3d=['emit','removeListener','register','length','./mailMessage.events','save','remove','update'];(function(_0xe5de85,_0x22e2a0){var _0x21a13e=function(_0x2d13a5){while(--_0x2d13a5){_0xe5de85['push'](_0xe5de85['shift']());}};_0x21a13e(++_0x22e2a0);}(_0x2e3d,0x8c));var _0xd2e3=function(_0x16d0d0,_0x39e9ee){_0x16d0d0=_0x16d0d0-0x0;var _0x3dc6fd=_0x2e3d[_0x16d0d0];return _0x3dc6fd;};'use strict';var MailMessageEvents=require(_0xd2e3('0x0'));var events=[_0xd2e3('0x1'),_0xd2e3('0x2'),_0xd2e3('0x3')];function createListener(_0x28de2a,_0x3c3bcb){return function(_0x27d016){_0x3c3bcb[_0xd2e3('0x4')](_0x28de2a,_0x27d016);};}function removeListener(_0x431948,_0x5bc44a){return function(){MailMessageEvents[_0xd2e3('0x5')](_0x431948,_0x5bc44a);};}exports[_0xd2e3('0x6')]=function(_0x2ea6e2){for(var _0x3da0e9=0x0,_0x4a3a97=events[_0xd2e3('0x7')];_0x3da0e9<_0x4a3a97;_0x3da0e9++){var _0x5c7736=events[_0x3da0e9];var _0x3152a2=createListener('mailMessage:'+_0x5c7736,_0x2ea6e2);MailMessageEvents['on'](_0x5c7736,_0x3152a2);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 8f54a95..733877e 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 _0x4169=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','connect-timeout','express','Router','fs-extra'];(function(_0x1ad0fd,_0x3bdd93){var _0x50d5c5=function(_0x2e8a29){while(--_0x2e8a29){_0x1ad0fd['push'](_0x1ad0fd['shift']());}};_0x50d5c5(++_0x3bdd93);}(_0x4169,0x146));var _0x9416=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4169[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9416('0x0'));var express=require(_0x9416('0x1'));var router=express[_0x9416('0x2')]();var fs_extra=require(_0x9416('0x3'));var auth=require(_0x9416('0x4'));var interaction=require(_0x9416('0x5'));var config=require(_0x9416('0x6'));var controller=require(_0x9416('0x7'));router[_0x9416('0x8')]('/',auth[_0x9416('0x9')](),controller[_0x9416('0xa')]);router[_0x9416('0x8')](_0x9416('0xb'),auth['isAuthenticated'](),controller[_0x9416('0xc')]);router[_0x9416('0x8')](_0x9416('0xd'),auth[_0x9416('0x9')](),controller[_0x9416('0xe')]);router['get'](_0x9416('0xf'),auth[_0x9416('0x9')](),controller['getMembers']);router[_0x9416('0x8')](_0x9416('0x10'),auth[_0x9416('0x9')](),controller[_0x9416('0x11')]);router[_0x9416('0x8')](_0x9416('0x12'),auth[_0x9416('0x9')](),controller[_0x9416('0x13')]);router[_0x9416('0x14')]('/',auth[_0x9416('0x9')](),controller[_0x9416('0x15')]);router[_0x9416('0x14')](_0x9416('0x10'),auth['isAuthenticated'](),controller['addTeams']);router[_0x9416('0x14')](_0x9416('0x12'),auth[_0x9416('0x9')](),controller[_0x9416('0x16')]);router[_0x9416('0x17')](_0x9416('0xd'),auth[_0x9416('0x9')](),controller[_0x9416('0x18')]);router[_0x9416('0x19')](_0x9416('0xd'),auth['isAuthenticated'](),controller[_0x9416('0x1a')]);router[_0x9416('0x19')](_0x9416('0x10'),auth['isAuthenticated'](),controller[_0x9416('0x1b')]);router[_0x9416('0x19')]('/:id/users',auth['isAuthenticated'](),controller[_0x9416('0x1c')]);module[_0x9416('0x1d')]=router; \ No newline at end of file +var _0x653c=['/:id/teams','getTeams','getAgents','post','addTeams','/:id/users','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','express','fs-extra','../../config/environment','./mailQueue.controller','get','isAuthenticated','/:id','show','/:id/members','getMembers'];(function(_0x4276aa,_0x492207){var _0x4e46f7=function(_0x1fa4dd){while(--_0x1fa4dd){_0x4276aa['push'](_0x4276aa['shift']());}};_0x4e46f7(++_0x492207);}(_0x653c,0x1cf));var _0xc653=function(_0x36f643,_0x17b77c){_0x36f643=_0x36f643-0x0;var _0x177533=_0x653c[_0x36f643];return _0x177533;};'use strict';var multer=require(_0xc653('0x0'));var util=require('util');var path=require(_0xc653('0x1'));var timeout=require('connect-timeout');var express=require(_0xc653('0x2'));var router=express['Router']();var fs_extra=require(_0xc653('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc653('0x4'));var controller=require(_0xc653('0x5'));router[_0xc653('0x6')]('/',auth[_0xc653('0x7')](),controller['index']);router[_0xc653('0x6')]('/describe',auth[_0xc653('0x7')](),controller['describe']);router[_0xc653('0x6')](_0xc653('0x8'),auth[_0xc653('0x7')](),controller[_0xc653('0x9')]);router[_0xc653('0x6')](_0xc653('0xa'),auth[_0xc653('0x7')](),controller[_0xc653('0xb')]);router['get'](_0xc653('0xc'),auth[_0xc653('0x7')](),controller[_0xc653('0xd')]);router[_0xc653('0x6')]('/:id/users',auth[_0xc653('0x7')](),controller[_0xc653('0xe')]);router[_0xc653('0xf')]('/',auth[_0xc653('0x7')](),controller['create']);router[_0xc653('0xf')]('/:id/teams',auth[_0xc653('0x7')](),controller[_0xc653('0x10')]);router['post'](_0xc653('0x11'),auth['isAuthenticated'](),controller[_0xc653('0x12')]);router['put'](_0xc653('0x8'),auth[_0xc653('0x7')](),controller[_0xc653('0x13')]);router[_0xc653('0x14')](_0xc653('0x8'),auth[_0xc653('0x7')](),controller[_0xc653('0x15')]);router[_0xc653('0x14')](_0xc653('0xc'),auth[_0xc653('0x7')](),controller[_0xc653('0x16')]);router[_0xc653('0x14')](_0xc653('0x11'),auth[_0xc653('0x7')](),controller[_0xc653('0x17')]);module[_0xc653('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index f77ead7..5fec524 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 _0xf327=['INTEGER','ENUM','roundrobin','sequelize','exports','STRING'];(function(_0x3d0ebb,_0x1f24c8){var _0x513343=function(_0x1476a4){while(--_0x1476a4){_0x3d0ebb['push'](_0x3d0ebb['shift']());}};_0x513343(++_0x1f24c8);}(_0xf327,0xcf));var _0x7f32=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf327[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x7f32('0x0'));module[_0x7f32('0x1')]={'name':{'type':Sequelize[_0x7f32('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x7f32('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7f32('0x4')]('rrmemory','beepall',_0x7f32('0x5'))}}; \ No newline at end of file +var _0xce6a=['beepall','roundrobin','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x407604,_0x43e3cc){var _0x5a2589=function(_0x1f0978){while(--_0x1f0978){_0x407604['push'](_0x407604['shift']());}};_0x5a2589(++_0x43e3cc);}(_0xce6a,0x8a));var _0xace6=function(_0x4a908c,_0x3d3764){_0x4a908c=_0x4a908c-0x0;var _0x2639ce=_0xce6a[_0x4a908c];return _0x2639ce;};'use strict';var Sequelize=require('sequelize');module[_0xace6('0x0')]={'name':{'type':Sequelize[_0xace6('0x1')],'unique':_0xace6('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xace6('0x1')]},'timeout':{'type':Sequelize[_0xace6('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xace6('0x4')](_0xace6('0x5'),_0xace6('0x6'),_0xace6('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 8ea8e38..4af8c7e 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 _0x4edf=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./mailQueue.socket','register','end','status','undefined','count','offset','limit','Content-Range','json','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','MailQueue','rawAttributes','type','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','MailQueues','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','findOne','UserMailQueue','pick','MailQueueId','User','UserId','mailPause','updatedAt','createdAt','format','SIP','getTeams','Team','voicePause','flatMap','Agents','sequelize','transaction','addTeams','each','forEach','userMailQueue:save','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','ids','isEmpty','removeAgents','emit','addAgents','spread','userMailQueue:remove','getAgents','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x366388,_0x4595a6){var _0x41c97e=function(_0x4b9fff){while(--_0x4b9fff){_0x366388['push'](_0x366388['shift']());}};_0x41c97e(++_0x4595a6);}(_0x4edf,0x196));var _0xf4ed=function(_0xb99421,_0xaab133){_0xb99421=_0xb99421-0x0;var _0x4b3ec7=_0x4edf[_0xb99421];return _0x4b3ec7;};'use strict';var emlformat=require(_0xf4ed('0x0'));var rimraf=require(_0xf4ed('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf4ed('0x2'));var moment=require(_0xf4ed('0x3'));var BPromise=require(_0xf4ed('0x4'));var Mustache=require(_0xf4ed('0x5'));var util=require(_0xf4ed('0x6'));var path=require(_0xf4ed('0x7'));var sox=require(_0xf4ed('0x8'));var csv=require(_0xf4ed('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf4ed('0xa'));var _=require(_0xf4ed('0xb'));var squel=require(_0xf4ed('0xc'));var crypto=require(_0xf4ed('0xd'));var jsforce=require(_0xf4ed('0xe'));var deskjs=require(_0xf4ed('0xf'));var toCsv=require(_0xf4ed('0x9'));var querystring=require(_0xf4ed('0x10'));var Papa=require('papaparse');var Redis=require(_0xf4ed('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf4ed('0x12'));var as=require(_0xf4ed('0x13'));var hardwareService=require(_0xf4ed('0x14'));var logger=require(_0xf4ed('0x15'))(_0xf4ed('0x16'));var utils=require(_0xf4ed('0x17'));var config=require(_0xf4ed('0x18'));var licenseUtil=require(_0xf4ed('0x19'));var db=require(_0xf4ed('0x1a'))['db'];config[_0xf4ed('0x1b')]=_[_0xf4ed('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf4ed('0x1d'))(new Redis(config[_0xf4ed('0x1b')]));require(_0xf4ed('0x1e'))[_0xf4ed('0x1f')](socket);function respondWithStatusCode(_0x39d437,_0x2568e6){_0x2568e6=_0x2568e6||0xcc;return function(_0x519f36){if(_0x519f36){return _0x39d437['sendStatus'](_0x2568e6);}return _0x39d437['status'](_0x2568e6)[_0xf4ed('0x20')]();};}function respondWithResult(_0x30c8d8,_0x38f4c8){_0x38f4c8=_0x38f4c8||0xc8;return function(_0x32d3bd){if(_0x32d3bd){return _0x30c8d8[_0xf4ed('0x21')](_0x38f4c8)['json'](_0x32d3bd);}};}function respondWithFilteredResult(_0x1cb49b,_0x525bea){return function(_0x5e67ec){if(_0x5e67ec){var _0x3c4b2a=typeof _0x525bea['offset']==='undefined'&&typeof _0x525bea['limit']===_0xf4ed('0x22');var _0x11fab6=_0x5e67ec[_0xf4ed('0x23')];var _0x124ab6=_0x3c4b2a?0x0:_0x525bea[_0xf4ed('0x24')];var _0x22fa10=_0x3c4b2a?_0x5e67ec[_0xf4ed('0x23')]:_0x525bea[_0xf4ed('0x24')]+_0x525bea[_0xf4ed('0x25')];var _0x11ec8e;if(_0x22fa10>=_0x11fab6){_0x22fa10=_0x11fab6;_0x11ec8e=0xc8;}else{_0x11ec8e=0xce;}_0x1cb49b[_0xf4ed('0x21')](_0x11ec8e);return _0x1cb49b['set'](_0xf4ed('0x26'),_0x124ab6+'-'+_0x22fa10+'/'+_0x11fab6)[_0xf4ed('0x27')](_0x5e67ec);}return null;};}function patchUpdates(_0x20c308){return function(_0x17d03d){try{jsonpatch['apply'](_0x17d03d,_0x20c308,!![]);}catch(_0x5d0c14){return BPromise[_0xf4ed('0x28')](_0x5d0c14);}return _0x17d03d[_0xf4ed('0x29')]();};}function saveUpdates(_0x7dc8fc,_0x49c991){return function(_0x5237d9){if(_0x5237d9){return _0x5237d9['update'](_0x7dc8fc)[_0xf4ed('0x2a')](function(_0x18ed82){return _0x18ed82;});}return null;};}function removeEntity(_0x5dbe46,_0x297c00){return function(_0x59bbf2){if(_0x59bbf2){return _0x59bbf2[_0xf4ed('0x2b')]()['then'](function(){var _0x7c691d=_0x59bbf2['get']({'plain':!![]});var _0x1eaf28='MailQueues';return db['UserProfileResource'][_0xf4ed('0x2b')]({'where':{'type':_0x1eaf28,'resourceId':_0x7c691d['id']}})['then'](function(){return _0x59bbf2;});})['then'](function(){_0x5dbe46[_0xf4ed('0x21')](0xcc)[_0xf4ed('0x20')]();});}};}function handleEntityNotFound(_0x2c2b17,_0x57fbdf){return function(_0x2e0bef){if(!_0x2e0bef){_0x2c2b17[_0xf4ed('0x2c')](0x194);}return _0x2e0bef;};}function handleError(_0x79d454,_0x52c4fc){_0x52c4fc=_0x52c4fc||0x1f4;return function(_0x3bb241){logger[_0xf4ed('0x2d')](_0x3bb241[_0xf4ed('0x2e')]);if(_0x3bb241[_0xf4ed('0x2f')]){delete _0x3bb241[_0xf4ed('0x2f')];}_0x79d454[_0xf4ed('0x21')](_0x52c4fc)[_0xf4ed('0x30')](_0x3bb241);};}exports[_0xf4ed('0x31')]=function(_0x244f61,_0x4206f7){var _0x1b7394={},_0x251296={},_0x55cb7b={'count':0x0,'rows':[]};var _0x2b8c99=_[_0xf4ed('0x32')](db[_0xf4ed('0x33')][_0xf4ed('0x34')],function(_0x349f98){return{'name':_0x349f98['fieldName'],'type':_0x349f98[_0xf4ed('0x35')]['key']};});_0x251296[_0xf4ed('0x36')]=_[_0xf4ed('0x32')](_0x2b8c99,_0xf4ed('0x2f'));_0x251296[_0xf4ed('0x37')]=_[_0xf4ed('0x38')](_0x244f61[_0xf4ed('0x37')]);_0x251296[_0xf4ed('0x39')]=_[_0xf4ed('0x3a')](_0x251296[_0xf4ed('0x36')],_0x251296[_0xf4ed('0x37')]);_0x1b7394[_0xf4ed('0x3b')]=_[_0xf4ed('0x3a')](_0x251296[_0xf4ed('0x36')],qs['fields'](_0x244f61['query']['fields']));_0x1b7394[_0xf4ed('0x3b')]=_0x1b7394[_0xf4ed('0x3b')]['length']?_0x1b7394[_0xf4ed('0x3b')]:_0x251296[_0xf4ed('0x36')];if(!_0x244f61[_0xf4ed('0x37')][_0xf4ed('0x3c')](_0xf4ed('0x3d'))){_0x1b7394[_0xf4ed('0x25')]=qs['limit'](_0x244f61[_0xf4ed('0x37')][_0xf4ed('0x25')]);_0x1b7394[_0xf4ed('0x24')]=qs[_0xf4ed('0x24')](_0x244f61['query'][_0xf4ed('0x24')]);}_0x1b7394[_0xf4ed('0x3e')]=qs[_0xf4ed('0x3f')](_0x244f61[_0xf4ed('0x37')][_0xf4ed('0x3f')]);_0x1b7394[_0xf4ed('0x40')]=qs[_0xf4ed('0x39')](_['pick'](_0x244f61['query'],_0x251296[_0xf4ed('0x39')]),_0x2b8c99);if(_0x244f61[_0xf4ed('0x37')][_0xf4ed('0x41')]){_0x1b7394[_0xf4ed('0x40')]=_[_0xf4ed('0x42')](_0x1b7394[_0xf4ed('0x40')],{'$or':_['map'](_0x2b8c99,function(_0x556119){if(_0x556119[_0xf4ed('0x35')]!==_0xf4ed('0x43')){var _0x4256b8={};_0x4256b8[_0x556119['name']]={'$like':'%'+_0x244f61[_0xf4ed('0x37')][_0xf4ed('0x41')]+'%'};return _0x4256b8;}})});}_0x1b7394=_['merge']({},_0x1b7394,_0x244f61[_0xf4ed('0x44')]);var _0x555bad={'where':_0x1b7394['where']};return db[_0xf4ed('0x33')][_0xf4ed('0x23')](_0x555bad)[_0xf4ed('0x2a')](function(_0x38afcb){_0x55cb7b[_0xf4ed('0x23')]=_0x38afcb;if(_0x244f61[_0xf4ed('0x37')][_0xf4ed('0x45')]){_0x1b7394[_0xf4ed('0x46')]=[{'all':!![]}];}return db[_0xf4ed('0x33')][_0xf4ed('0x47')](_0x1b7394);})[_0xf4ed('0x2a')](function(_0xbcbfd5){_0x55cb7b[_0xf4ed('0x48')]=_0xbcbfd5;return _0x55cb7b;})[_0xf4ed('0x2a')](respondWithFilteredResult(_0x4206f7,_0x1b7394))[_0xf4ed('0x49')](handleError(_0x4206f7,null));};exports[_0xf4ed('0x4a')]=function(_0x59c74b,_0x2fe9fd){var _0x2eac68={'raw':!![],'where':{'id':_0x59c74b[_0xf4ed('0x4b')]['id']}},_0x5f307f={};_0x5f307f['model']=_[_0xf4ed('0x38')](db[_0xf4ed('0x33')][_0xf4ed('0x34')]);_0x5f307f[_0xf4ed('0x37')]=_['keys'](_0x59c74b[_0xf4ed('0x37')]);_0x5f307f[_0xf4ed('0x39')]=_[_0xf4ed('0x3a')](_0x5f307f[_0xf4ed('0x36')],_0x5f307f['query']);_0x2eac68['attributes']=_[_0xf4ed('0x3a')](_0x5f307f[_0xf4ed('0x36')],qs[_0xf4ed('0x4c')](_0x59c74b[_0xf4ed('0x37')][_0xf4ed('0x4c')]));_0x2eac68[_0xf4ed('0x3b')]=_0x2eac68[_0xf4ed('0x3b')][_0xf4ed('0x4d')]?_0x2eac68[_0xf4ed('0x3b')]:_0x5f307f[_0xf4ed('0x36')];if(_0x59c74b[_0xf4ed('0x37')][_0xf4ed('0x45')]){_0x2eac68[_0xf4ed('0x46')]=[{'all':!![]}];}_0x2eac68=_[_0xf4ed('0x42')]({},_0x2eac68,_0x59c74b[_0xf4ed('0x44')]);return db[_0xf4ed('0x33')][_0xf4ed('0x4e')](_0x2eac68)[_0xf4ed('0x2a')](handleEntityNotFound(_0x2fe9fd,null))['then'](respondWithResult(_0x2fe9fd,null))[_0xf4ed('0x49')](handleError(_0x2fe9fd,null));};exports[_0xf4ed('0x4f')]=function(_0x33b074,_0x335d93){return db['MailQueue'][_0xf4ed('0x4f')](_0x33b074['body'],{})[_0xf4ed('0x2a')](function(_0x4df88c){var _0x53b24b=_0x33b074[_0xf4ed('0x50')]['get']({'plain':!![]});if(!_0x53b24b)throw new Error(_0xf4ed('0x51'));if(_0x53b24b[_0xf4ed('0x52')]==='user'){var _0x241fd8=_0x4df88c[_0xf4ed('0x53')]({'plain':!![]});var _0x645e5f=_0xf4ed('0x54');return db[_0xf4ed('0x55')][_0xf4ed('0x4e')]({'where':{'name':_0x645e5f,'userProfileId':_0x53b24b[_0xf4ed('0x56')]},'raw':!![]})[_0xf4ed('0x2a')](function(_0x47ca11){if(_0x47ca11&&_0x47ca11['autoAssociation']===0x0){return db[_0xf4ed('0x57')][_0xf4ed('0x4f')]({'name':_0x241fd8[_0xf4ed('0x2f')],'resourceId':_0x241fd8['id'],'type':_0x47ca11['name'],'sectionId':_0x47ca11['id']},{})[_0xf4ed('0x2a')](function(){return _0x4df88c;});}else{return _0x4df88c;}})[_0xf4ed('0x49')](function(_0x3899ec){logger[_0xf4ed('0x2d')](_0xf4ed('0x58'),_0x3899ec);throw _0x3899ec;});}return _0x4df88c;})[_0xf4ed('0x2a')](respondWithResult(_0x335d93,0xc9))[_0xf4ed('0x49')](handleError(_0x335d93,null));};exports[_0xf4ed('0x59')]=function(_0x361f98,_0x141747){if(_0x361f98['body']['id']){delete _0x361f98['body']['id'];}return db['MailQueue'][_0xf4ed('0x4e')]({'where':{'id':_0x361f98[_0xf4ed('0x4b')]['id']}})[_0xf4ed('0x2a')](handleEntityNotFound(_0x141747,null))[_0xf4ed('0x2a')](saveUpdates(_0x361f98[_0xf4ed('0x5a')],null))[_0xf4ed('0x2a')](respondWithResult(_0x141747,null))['catch'](handleError(_0x141747,null));};exports['destroy']=function(_0x3feb64,_0x12620c){return db[_0xf4ed('0x33')][_0xf4ed('0x4e')]({'where':{'id':_0x3feb64[_0xf4ed('0x4b')]['id']}})[_0xf4ed('0x2a')](handleEntityNotFound(_0x12620c,null))['then'](removeEntity(_0x12620c,null))[_0xf4ed('0x49')](handleError(_0x12620c,null));};exports['describe']=function(_0x2bbaf9,_0x1fd7e7){return db[_0xf4ed('0x33')][_0xf4ed('0x5b')]()['then'](respondWithResult(_0x1fd7e7,null))['catch'](handleError(_0x1fd7e7,null));};exports[_0xf4ed('0x5c')]=function(_0xd49d68,_0x36a452,_0x1c78c5){var _0x553e8f={'raw':!![],'where':{}},_0x1cbb27={},_0x84f645;return db[_0xf4ed('0x33')][_0xf4ed('0x5d')]({'where':{'id':_0xd49d68['params']['id']}})[_0xf4ed('0x2a')](handleEntityNotFound(_0x36a452,null))[_0xf4ed('0x2a')](function(_0x50b7eb){if(_0x50b7eb){_0x84f645=_0x50b7eb[_0xf4ed('0x53')]({'plain':!![]});_0x1cbb27['model']=_[_0xf4ed('0x38')](db[_0xf4ed('0x5e')][_0xf4ed('0x34')]);_0x1cbb27[_0xf4ed('0x37')]=_[_0xf4ed('0x38')](_0xd49d68[_0xf4ed('0x37')]);_0x1cbb27[_0xf4ed('0x39')]=_[_0xf4ed('0x3a')](_0x1cbb27[_0xf4ed('0x36')],_0x1cbb27[_0xf4ed('0x37')]);_0x553e8f[_0xf4ed('0x3b')]=_[_0xf4ed('0x3a')](_0x1cbb27['model'],qs[_0xf4ed('0x4c')](_0xd49d68['query']['fields']));_0x553e8f[_0xf4ed('0x3b')]=_0x553e8f[_0xf4ed('0x3b')][_0xf4ed('0x4d')]?_0x553e8f[_0xf4ed('0x3b')]:_0x1cbb27[_0xf4ed('0x36')];if(!_0xd49d68[_0xf4ed('0x37')][_0xf4ed('0x3c')](_0xf4ed('0x3d'))){_0x553e8f[_0xf4ed('0x25')]=qs['limit'](_0xd49d68['query']['limit']);_0x553e8f['offset']=qs[_0xf4ed('0x24')](_0xd49d68[_0xf4ed('0x37')][_0xf4ed('0x24')]);}_0x553e8f[_0xf4ed('0x3e')]=qs[_0xf4ed('0x3f')](_0xd49d68['query'][_0xf4ed('0x3f')]);_0x553e8f[_0xf4ed('0x40')]=qs[_0xf4ed('0x39')](_[_0xf4ed('0x5f')](_0xd49d68[_0xf4ed('0x37')],_0x1cbb27[_0xf4ed('0x39')]));_0x553e8f['where'][_0xf4ed('0x60')]=_0x50b7eb['id'];if(_0xd49d68[_0xf4ed('0x37')][_0xf4ed('0x41')]){_0x553e8f[_0xf4ed('0x40')]=_[_0xf4ed('0x42')](_0x553e8f[_0xf4ed('0x40')],{'$or':_[_0xf4ed('0x32')](_0x553e8f[_0xf4ed('0x3b')],function(_0x49efe6){var _0x389f0c={};_0x389f0c[_0x49efe6]={'$like':'%'+_0xd49d68[_0xf4ed('0x37')][_0xf4ed('0x41')]+'%'};return _0x389f0c;})});}_0x553e8f=_[_0xf4ed('0x42')]({},_0x553e8f,_0xd49d68[_0xf4ed('0x44')]);return db[_0xf4ed('0x5e')][_0xf4ed('0x47')](_0x553e8f);}})[_0xf4ed('0x2a')](function(_0x49c19f){if(_0x49c19f){return db[_0xf4ed('0x61')]['findAndCountAll']({'where':{'id':_[_0xf4ed('0x32')](_0x49c19f,_0xf4ed('0x62')),'role':'agent'},'attributes':['id',_0xf4ed('0x2f'),_0xf4ed('0x63'),_0xf4ed('0x64'),_0xf4ed('0x65')]});}})[_0xf4ed('0x2a')](function(_0x4e9c81){if(_0x4e9c81){return{'count':_0x4e9c81[_0xf4ed('0x23')],'rows':_[_0xf4ed('0x32')](_0x4e9c81['rows'],function(_0x484b2f){return{'membername':_0x484b2f['name'],'UserId':_0x484b2f['id'],'queue_name':_0x84f645[_0xf4ed('0x2f')],'MailQueueId':_0x84f645['id'],'interface':util[_0xf4ed('0x66')]('%s/%s',_0xf4ed('0x67'),_0x484b2f[_0xf4ed('0x2f')]),'penalty':0x0,'paused':_0x484b2f['mailPause'],'createdAt':_0x484b2f['createdAt'],'updatedAt':_0x484b2f[_0xf4ed('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf4ed('0x2a')](respondWithFilteredResult(_0x36a452,_0x553e8f))[_0xf4ed('0x49')](handleError(_0x36a452,null));};exports[_0xf4ed('0x68')]=function(_0x18121e,_0x387c62,_0x184d1f){var _0x47c7db={};var _0x43c779={};var _0x13d610;var _0x55900a;return db[_0xf4ed('0x33')][_0xf4ed('0x5d')]({'where':{'id':_0x18121e[_0xf4ed('0x4b')]['id']}})[_0xf4ed('0x2a')](handleEntityNotFound(_0x387c62,null))['then'](function(_0x1d8e5e){if(_0x1d8e5e){_0x13d610=_0x1d8e5e;_0x43c779[_0xf4ed('0x36')]=_['keys'](db[_0xf4ed('0x69')][_0xf4ed('0x34')]);_0x43c779[_0xf4ed('0x37')]=_[_0xf4ed('0x38')](_0x18121e[_0xf4ed('0x37')]);_0x43c779[_0xf4ed('0x39')]=_[_0xf4ed('0x3a')](_0x43c779[_0xf4ed('0x36')],_0x43c779[_0xf4ed('0x37')]);_0x47c7db[_0xf4ed('0x3b')]=_[_0xf4ed('0x3a')](_0x43c779[_0xf4ed('0x36')],qs[_0xf4ed('0x4c')](_0x18121e['query'][_0xf4ed('0x4c')]));_0x47c7db[_0xf4ed('0x3b')]=_0x47c7db[_0xf4ed('0x3b')][_0xf4ed('0x4d')]?_0x47c7db[_0xf4ed('0x3b')]:_0x43c779['model'];_0x47c7db[_0xf4ed('0x3e')]=qs['sort'](_0x18121e['query'][_0xf4ed('0x3f')]);_0x47c7db['where']=qs[_0xf4ed('0x39')](_[_0xf4ed('0x5f')](_0x18121e['query'],_0x43c779[_0xf4ed('0x39')]));if(_0x18121e[_0xf4ed('0x37')]['filter']){_0x47c7db[_0xf4ed('0x40')]=_[_0xf4ed('0x42')](_0x47c7db['where'],{'$or':_['map'](_0x47c7db[_0xf4ed('0x3b')],function(_0x5910f6){var _0x383497={};_0x383497[_0x5910f6]={'$like':'%'+_0x18121e['query']['filter']+'%'};return _0x383497;})});}_0x47c7db=_[_0xf4ed('0x42')]({},_0x47c7db,_0x18121e[_0xf4ed('0x44')]);return _0x13d610[_0xf4ed('0x68')](_0x47c7db);}})[_0xf4ed('0x2a')](function(_0xf11bc5){if(_0xf11bc5){_0x55900a=_0xf11bc5[_0xf4ed('0x4d')];if(!_0x18121e[_0xf4ed('0x37')]['hasOwnProperty'](_0xf4ed('0x3d'))){_0x47c7db[_0xf4ed('0x25')]=qs['limit'](_0x18121e['query'][_0xf4ed('0x25')]);_0x47c7db[_0xf4ed('0x24')]=qs['offset'](_0x18121e['query']['offset']);}return _0x13d610[_0xf4ed('0x68')](_0x47c7db);}})[_0xf4ed('0x2a')](function(_0x33c83e){if(_0x33c83e){return _0x33c83e?{'count':_0x55900a,'rows':_0x33c83e}:null;}})[_0xf4ed('0x2a')](respondWithResult(_0x387c62,null))[_0xf4ed('0x49')](handleError(_0x387c62,null));};exports['addTeams']=function(_0x4b857f,_0x196529,_0xa8fd15){var _0x1946a8=_0x4b857f[_0xf4ed('0x5a')]['ids'];return db[_0xf4ed('0x69')][_0xf4ed('0x47')]({'where':{'id':_0x1946a8},'attributes':['id'],'include':[{'model':db[_0xf4ed('0x61')],'as':'Agents','attributes':['id',_0xf4ed('0x2f'),'online',_0xf4ed('0x6a'),'interface'],'raw':!![]}]})[_0xf4ed('0x2a')](function(_0x5eddc4){if(_0x5eddc4){var _0x2bc115=_[_0xf4ed('0x6b')](_0x5eddc4,function(_0x27f7f1){var _0x917bd7=_0x27f7f1[_0xf4ed('0x53')]({'plain':!![]});return _0x917bd7[_0xf4ed('0x6c')];});return db['MailQueue'][_0xf4ed('0x4e')]({'where':{'id':_0x4b857f[_0xf4ed('0x4b')]['id']}})[_0xf4ed('0x2a')](function(_0x21c7b9){return db[_0xf4ed('0x6d')][_0xf4ed('0x6e')](function(_0x1220f2){return _0x21c7b9[_0xf4ed('0x6f')](_0x1946a8,{'transaction':_0x1220f2})[_0xf4ed('0x2a')](function(){return BPromise[_0xf4ed('0x70')](_0x2bc115,function(_0x3b1b78){return db['UserMailQueue']['findOrCreate']({'where':{'UserId':_0x3b1b78['id'],'MailQueueId':_0x4b857f['params']['id']},'transaction':_0x1220f2});});})[_0xf4ed('0x2a')](function(){_0x2bc115[_0xf4ed('0x71')](function(_0x3dac47){socket['emit'](_0xf4ed('0x72'),{'UserId':_0x3dac47['id'],'MailQueueId':_0x21c7b9['id']});});});});});}})['then'](respondWithStatusCode(_0x196529,null))['catch'](handleError(_0x196529,null));};exports['removeTeams']=function(_0x5f2698,_0x52859b,_0x7832ff){return db['Team']['findAll']({'where':{'id':_0x5f2698[_0xf4ed('0x37')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x52859b,null))[_0xf4ed('0x2a')](function(_0x255da6){var _0x238bb8=_['map'](_0x255da6,'id');var _0x704952=[];var _0x4f7b62=[];var _0x4cf86=squel['select']();_0x4cf86['field'](_0xf4ed('0x73'))[_0xf4ed('0x74')]('team_has_mail_queues','tq')[_0xf4ed('0x75')]('user_has_teams','ut',_0xf4ed('0x76'))[_0xf4ed('0x40')](_0xf4ed('0x77'),_0x5f2698[_0xf4ed('0x4b')]['id']);for(var _0x2c9531=0x0;_0x2c9531<_0x255da6[_0xf4ed('0x4d')];_0x2c9531+=0x1){let _0x3f16aa=_0x255da6[_0x2c9531];for(var _0x2af5ad=0x0;_0x2af5ad<_0x3f16aa['Agents'][_0xf4ed('0x4d')];_0x2af5ad+=0x1){let _0x2c2ace=_0x3f16aa['Agents'][_0x2af5ad];var _0x1810ae=_0x4cf86[_0xf4ed('0x78')]();_0x1810ae['where']('ut.UserId\x20=\x20?',_0x2c2ace['id']);_0x4f7b62[_0xf4ed('0x79')](db[_0xf4ed('0x6d')][_0xf4ed('0x37')](_0x1810ae[_0xf4ed('0x7a')](),{'type':db[_0xf4ed('0x6d')][_0xf4ed('0x7b')][_0xf4ed('0x7c')]})['then'](function(_0x3a8c9f){if(_0x3a8c9f[_0xf4ed('0x4d')]===0x1){return _0x2c2ace['id'];}else{var _0x15b1e1=_[_0xf4ed('0x7d')](_[_0xf4ed('0x32')](_0x3a8c9f,_0xf4ed('0x7e')),function(_0x5b09ac){return _[_0xf4ed('0x7f')](_0x238bb8,_0x5b09ac);});if(_0x15b1e1){return _0x2c2ace['id'];}}}));}}return BPromise[_0xf4ed('0x80')](_0x4f7b62)[_0xf4ed('0x2a')](function(_0x211198){_0x704952=_(_0x704952)[_0xf4ed('0x81')](_0x211198)[_0xf4ed('0x82')]()[_0xf4ed('0x83')]();return db[_0xf4ed('0x33')][_0xf4ed('0x4e')]({'where':{'id':_0x5f2698[_0xf4ed('0x4b')]['id']}})[_0xf4ed('0x2a')](function(_0x4fbfa8){return db[_0xf4ed('0x6d')][_0xf4ed('0x6e')](function(_0x14ffca){return _0x4fbfa8[_0xf4ed('0x84')](_0x5f2698[_0xf4ed('0x37')][_0xf4ed('0x85')],{'transaction':_0x14ffca})[_0xf4ed('0x2a')](function(){if(!_[_0xf4ed('0x86')](_0x704952)){return _0x4fbfa8[_0xf4ed('0x87')](_0x704952,{'transaction':_0x14ffca});}})[_0xf4ed('0x2a')](function(){_0x704952[_0xf4ed('0x71')](function(_0x4a5190){socket[_0xf4ed('0x88')]('userMailQueue:remove',{'UserId':_0x4a5190,'MailQueueId':_0x4fbfa8['id']});});});});});});})[_0xf4ed('0x2a')](respondWithStatusCode(_0x52859b,null))[_0xf4ed('0x49')](handleError(_0x52859b,null));};exports[_0xf4ed('0x89')]=function(_0x45bc86,_0x7ae72b,_0x11f4e6){return db[_0xf4ed('0x33')][_0xf4ed('0x4e')]({'where':{'id':_0x45bc86['params']['id']}})[_0xf4ed('0x2a')](handleEntityNotFound(_0x7ae72b,null))['then'](function(_0x5b7f57){if(_0x5b7f57){return _0x5b7f57[_0xf4ed('0x89')](_0x45bc86['body'][_0xf4ed('0x85')],_['omit'](_0x45bc86[_0xf4ed('0x5a')],[_0xf4ed('0x85'),'id'])||{})[_0xf4ed('0x8a')](function(_0x237fe4){for(var _0x191697=0x0;_0x191697<_0x45bc86[_0xf4ed('0x5a')][_0xf4ed('0x85')]['length'];_0x191697+=0x1){socket[_0xf4ed('0x88')](_0xf4ed('0x72'),{'UserId':Number(_0x45bc86[_0xf4ed('0x5a')][_0xf4ed('0x85')][_0x191697]),'MailQueueId':Number(_0x45bc86[_0xf4ed('0x4b')]['id'])});}return _0x237fe4;});}})[_0xf4ed('0x2a')](respondWithResult(_0x7ae72b,null))['catch'](handleError(_0x7ae72b,null));};exports[_0xf4ed('0x87')]=function(_0x32f0f4,_0x1aa878,_0x469e82){return db[_0xf4ed('0x33')]['find']({'where':{'id':_0x32f0f4[_0xf4ed('0x4b')]['id']}})[_0xf4ed('0x2a')](handleEntityNotFound(_0x1aa878,null))['then'](function(_0x2c36c5){if(_0x2c36c5){return _0x2c36c5['removeAgents'](_0x32f0f4[_0xf4ed('0x37')][_0xf4ed('0x85')])[_0xf4ed('0x2a')](function(){if(_['isArray'](_0x32f0f4[_0xf4ed('0x37')][_0xf4ed('0x85')])){for(var _0x3d0849=0x0;_0x3d0849<_0x32f0f4[_0xf4ed('0x37')][_0xf4ed('0x85')][_0xf4ed('0x4d')];_0x3d0849+=0x1){socket[_0xf4ed('0x88')](_0xf4ed('0x8b'),{'UserId':Number(_0x32f0f4['query']['ids'][_0x3d0849]),'MailQueueId':Number(_0x32f0f4['params']['id'])});}}else{socket[_0xf4ed('0x88')](_0xf4ed('0x8b'),{'UserId':Number(_0x32f0f4['query']['ids']),'MailQueueId':Number(_0x32f0f4[_0xf4ed('0x4b')]['id'])});}});}})[_0xf4ed('0x2a')](respondWithStatusCode(_0x1aa878,null))[_0xf4ed('0x49')](handleError(_0x1aa878,null));};exports[_0xf4ed('0x8c')]=function(_0x2da7f2,_0x2e61db,_0x27b0e9){var _0x3bdd1e={};var _0x312258={};var _0x559db5;var _0x2eb704;return db[_0xf4ed('0x33')][_0xf4ed('0x5d')]({'where':{'id':_0x2da7f2[_0xf4ed('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2e61db,null))['then'](function(_0x32a1a5){if(_0x32a1a5){_0x559db5=_0x32a1a5;_0x312258[_0xf4ed('0x36')]=_[_0xf4ed('0x38')](db[_0xf4ed('0x61')][_0xf4ed('0x34')]);_0x312258[_0xf4ed('0x37')]=_[_0xf4ed('0x38')](_0x2da7f2[_0xf4ed('0x37')]);_0x312258[_0xf4ed('0x39')]=_[_0xf4ed('0x3a')](_0x312258[_0xf4ed('0x36')],_0x312258[_0xf4ed('0x37')]);_0x3bdd1e[_0xf4ed('0x3b')]=_[_0xf4ed('0x3a')](_0x312258[_0xf4ed('0x36')],qs[_0xf4ed('0x4c')](_0x2da7f2[_0xf4ed('0x37')][_0xf4ed('0x4c')]));_0x3bdd1e[_0xf4ed('0x3b')]=_0x3bdd1e[_0xf4ed('0x3b')][_0xf4ed('0x4d')]?_0x3bdd1e[_0xf4ed('0x3b')]:_0x312258[_0xf4ed('0x36')];_0x3bdd1e['order']=qs['sort'](_0x2da7f2[_0xf4ed('0x37')]['sort']);_0x3bdd1e['where']=qs[_0xf4ed('0x39')](_[_0xf4ed('0x5f')](_0x2da7f2['query'],_0x312258[_0xf4ed('0x39')]));if(_0x2da7f2[_0xf4ed('0x37')][_0xf4ed('0x41')]){_0x3bdd1e['where']=_['merge'](_0x3bdd1e[_0xf4ed('0x40')],{'$or':_[_0xf4ed('0x32')](_0x3bdd1e[_0xf4ed('0x3b')],function(_0x323cff){var _0x2c3a88={};_0x2c3a88[_0x323cff]={'$like':'%'+_0x2da7f2[_0xf4ed('0x37')][_0xf4ed('0x41')]+'%'};return _0x2c3a88;})});}_0x3bdd1e=_['merge']({},_0x3bdd1e,_0x2da7f2[_0xf4ed('0x44')]);return _0x559db5[_0xf4ed('0x8c')](_0x3bdd1e);}})[_0xf4ed('0x2a')](function(_0x3c572f){if(_0x3c572f){_0x2eb704=_0x3c572f[_0xf4ed('0x4d')];if(!_0x2da7f2[_0xf4ed('0x37')]['hasOwnProperty'](_0xf4ed('0x3d'))){_0x3bdd1e[_0xf4ed('0x25')]=qs['limit'](_0x2da7f2[_0xf4ed('0x37')]['limit']);_0x3bdd1e['offset']=qs[_0xf4ed('0x24')](_0x2da7f2['query'][_0xf4ed('0x24')]);}return _0x559db5['getAgents'](_0x3bdd1e);}})[_0xf4ed('0x2a')](function(_0x2dc82a){if(_0x2dc82a){return _0x2dc82a?{'count':_0x2eb704,'rows':_0x2dc82a}:null;}})[_0xf4ed('0x2a')](respondWithResult(_0x2e61db,null))['catch'](handleError(_0x2e61db,null));}; \ No newline at end of file +var _0x92ba=['count','Content-Range','apply','reject','update','then','destroy','MailQueues','error','name','send','index','map','MailQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','findAll','catch','params','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','describe','getMembers','findOne','UserMailQueue','length','MailQueueId','User','UserId','mailPause','updatedAt','rows','format','SIP','createdAt','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','forEach','emit','userMailQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','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/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit'];(function(_0x2b7938,_0x33d58d){var _0x2a696f=function(_0x10b9c4){while(--_0x10b9c4){_0x2b7938['push'](_0x2b7938['shift']());}};_0x2a696f(++_0x33d58d);}(_0x92ba,0x17c));var _0xa92b=function(_0x43d0e6,_0x13483f){_0x43d0e6=_0x43d0e6-0x0;var _0x5edca0=_0x92ba[_0x43d0e6];return _0x5edca0;};'use strict';var emlformat=require(_0xa92b('0x0'));var rimraf=require(_0xa92b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa92b('0x2'));var rp=require(_0xa92b('0x3'));var moment=require(_0xa92b('0x4'));var BPromise=require(_0xa92b('0x5'));var Mustache=require(_0xa92b('0x6'));var util=require('util');var path=require(_0xa92b('0x7'));var sox=require(_0xa92b('0x8'));var csv=require(_0xa92b('0x9'));var ejs=require(_0xa92b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa92b('0xb'));var squel=require(_0xa92b('0xc'));var crypto=require('crypto');var jsforce=require(_0xa92b('0xd'));var deskjs=require(_0xa92b('0xe'));var toCsv=require(_0xa92b('0x9'));var querystring=require(_0xa92b('0xf'));var Papa=require(_0xa92b('0x10'));var Redis=require(_0xa92b('0x11'));var authService=require(_0xa92b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa92b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xa92b('0x14'));var licenseUtil=require(_0xa92b('0x15'));var db=require(_0xa92b('0x16'))['db'];config[_0xa92b('0x17')]=_[_0xa92b('0x18')](config[_0xa92b('0x17')],{'host':_0xa92b('0x19'),'port':0x18eb});var socket=require(_0xa92b('0x1a'))(new Redis(config[_0xa92b('0x17')]));require('./mailQueue.socket')[_0xa92b('0x1b')](socket);function respondWithStatusCode(_0x443323,_0x4745f3){_0x4745f3=_0x4745f3||0xcc;return function(_0x6d715d){if(_0x6d715d){return _0x443323[_0xa92b('0x1c')](_0x4745f3);}return _0x443323[_0xa92b('0x1d')](_0x4745f3)[_0xa92b('0x1e')]();};}function respondWithResult(_0x408ed2,_0x1d90d2){_0x1d90d2=_0x1d90d2||0xc8;return function(_0x1d7043){if(_0x1d7043){return _0x408ed2['status'](_0x1d90d2)[_0xa92b('0x1f')](_0x1d7043);}};}function respondWithFilteredResult(_0x1a5ff6,_0x426f9d){return function(_0x1c26f1){if(_0x1c26f1){var _0x387ab5=typeof _0x426f9d[_0xa92b('0x20')]==='undefined'&&typeof _0x426f9d[_0xa92b('0x21')]==='undefined';var _0x44df31=_0x1c26f1[_0xa92b('0x22')];var _0x26e476=_0x387ab5?0x0:_0x426f9d[_0xa92b('0x20')];var _0x212e93=_0x387ab5?_0x1c26f1[_0xa92b('0x22')]:_0x426f9d['offset']+_0x426f9d[_0xa92b('0x21')];var _0x42eb92;if(_0x212e93>=_0x44df31){_0x212e93=_0x44df31;_0x42eb92=0xc8;}else{_0x42eb92=0xce;}_0x1a5ff6[_0xa92b('0x1d')](_0x42eb92);return _0x1a5ff6['set'](_0xa92b('0x23'),_0x26e476+'-'+_0x212e93+'/'+_0x44df31)['json'](_0x1c26f1);}return null;};}function patchUpdates(_0xdb21cb){return function(_0x388f95){try{jsonpatch[_0xa92b('0x24')](_0x388f95,_0xdb21cb,!![]);}catch(_0x5517c4){return BPromise[_0xa92b('0x25')](_0x5517c4);}return _0x388f95['save']();};}function saveUpdates(_0x48c462,_0x48ed66){return function(_0x4db41e){if(_0x4db41e){return _0x4db41e[_0xa92b('0x26')](_0x48c462)[_0xa92b('0x27')](function(_0x568422){return _0x568422;});}return null;};}function removeEntity(_0x422c3a,_0x546d5d){return function(_0x524903){if(_0x524903){return _0x524903[_0xa92b('0x28')]()[_0xa92b('0x27')](function(){var _0x12d631=_0x524903['get']({'plain':!![]});var _0x4e5e69=_0xa92b('0x29');return db['UserProfileResource'][_0xa92b('0x28')]({'where':{'type':_0x4e5e69,'resourceId':_0x12d631['id']}})[_0xa92b('0x27')](function(){return _0x524903;});})[_0xa92b('0x27')](function(){_0x422c3a['status'](0xcc)[_0xa92b('0x1e')]();});}};}function handleEntityNotFound(_0x26e579,_0x14d2f4){return function(_0x4ae13a){if(!_0x4ae13a){_0x26e579['sendStatus'](0x194);}return _0x4ae13a;};}function handleError(_0x4e2cc5,_0x1779b6){_0x1779b6=_0x1779b6||0x1f4;return function(_0x4bb1e5){logger[_0xa92b('0x2a')](_0x4bb1e5['stack']);if(_0x4bb1e5['name']){delete _0x4bb1e5[_0xa92b('0x2b')];}_0x4e2cc5[_0xa92b('0x1d')](_0x1779b6)[_0xa92b('0x2c')](_0x4bb1e5);};}exports[_0xa92b('0x2d')]=function(_0x3f678d,_0x3dddf4){var _0x477098={},_0x10d295={},_0x18a1fa={'count':0x0,'rows':[]};var _0x308fd3=_[_0xa92b('0x2e')](db[_0xa92b('0x2f')][_0xa92b('0x30')],function(_0x5bcf91){return{'name':_0x5bcf91[_0xa92b('0x31')],'type':_0x5bcf91['type'][_0xa92b('0x32')]};});_0x10d295[_0xa92b('0x33')]=_[_0xa92b('0x2e')](_0x308fd3,_0xa92b('0x2b'));_0x10d295[_0xa92b('0x34')]=_[_0xa92b('0x35')](_0x3f678d['query']);_0x10d295[_0xa92b('0x36')]=_[_0xa92b('0x37')](_0x10d295[_0xa92b('0x33')],_0x10d295['query']);_0x477098[_0xa92b('0x38')]=_['intersection'](_0x10d295[_0xa92b('0x33')],qs[_0xa92b('0x39')](_0x3f678d[_0xa92b('0x34')][_0xa92b('0x39')]));_0x477098['attributes']=_0x477098[_0xa92b('0x38')]['length']?_0x477098[_0xa92b('0x38')]:_0x10d295[_0xa92b('0x33')];if(!_0x3f678d[_0xa92b('0x34')][_0xa92b('0x3a')](_0xa92b('0x3b'))){_0x477098[_0xa92b('0x21')]=qs[_0xa92b('0x21')](_0x3f678d[_0xa92b('0x34')]['limit']);_0x477098[_0xa92b('0x20')]=qs['offset'](_0x3f678d[_0xa92b('0x34')][_0xa92b('0x20')]);}_0x477098[_0xa92b('0x3c')]=qs[_0xa92b('0x3d')](_0x3f678d[_0xa92b('0x34')][_0xa92b('0x3d')]);_0x477098[_0xa92b('0x3e')]=qs['filters'](_[_0xa92b('0x3f')](_0x3f678d[_0xa92b('0x34')],_0x10d295['filters']),_0x308fd3);if(_0x3f678d[_0xa92b('0x34')][_0xa92b('0x40')]){_0x477098[_0xa92b('0x3e')]=_[_0xa92b('0x41')](_0x477098[_0xa92b('0x3e')],{'$or':_[_0xa92b('0x2e')](_0x308fd3,function(_0x364d67){if(_0x364d67[_0xa92b('0x42')]!==_0xa92b('0x43')){var _0x2426a1={};_0x2426a1[_0x364d67[_0xa92b('0x2b')]]={'$like':'%'+_0x3f678d[_0xa92b('0x34')][_0xa92b('0x40')]+'%'};return _0x2426a1;}})});}_0x477098=_[_0xa92b('0x41')]({},_0x477098,_0x3f678d[_0xa92b('0x44')]);var _0x38c00d={'where':_0x477098[_0xa92b('0x3e')]};return db['MailQueue']['count'](_0x38c00d)[_0xa92b('0x27')](function(_0xc710d8){_0x18a1fa[_0xa92b('0x22')]=_0xc710d8;if(_0x3f678d[_0xa92b('0x34')]['includeAll']){_0x477098['include']=[{'all':!![]}];}return db[_0xa92b('0x2f')][_0xa92b('0x45')](_0x477098);})['then'](function(_0x2be314){_0x18a1fa['rows']=_0x2be314;return _0x18a1fa;})[_0xa92b('0x27')](respondWithFilteredResult(_0x3dddf4,_0x477098))[_0xa92b('0x46')](handleError(_0x3dddf4,null));};exports['show']=function(_0x5da0b9,_0x47b171){var _0x4fadfc={'raw':!![],'where':{'id':_0x5da0b9[_0xa92b('0x47')]['id']}},_0x25fee2={};_0x25fee2[_0xa92b('0x33')]=_[_0xa92b('0x35')](db[_0xa92b('0x2f')][_0xa92b('0x30')]);_0x25fee2[_0xa92b('0x34')]=_[_0xa92b('0x35')](_0x5da0b9[_0xa92b('0x34')]);_0x25fee2[_0xa92b('0x36')]=_['intersection'](_0x25fee2[_0xa92b('0x33')],_0x25fee2[_0xa92b('0x34')]);_0x4fadfc[_0xa92b('0x38')]=_[_0xa92b('0x37')](_0x25fee2[_0xa92b('0x33')],qs[_0xa92b('0x39')](_0x5da0b9[_0xa92b('0x34')][_0xa92b('0x39')]));_0x4fadfc['attributes']=_0x4fadfc[_0xa92b('0x38')]['length']?_0x4fadfc[_0xa92b('0x38')]:_0x25fee2[_0xa92b('0x33')];if(_0x5da0b9[_0xa92b('0x34')][_0xa92b('0x48')]){_0x4fadfc['include']=[{'all':!![]}];}_0x4fadfc=_[_0xa92b('0x41')]({},_0x4fadfc,_0x5da0b9[_0xa92b('0x44')]);return db[_0xa92b('0x2f')][_0xa92b('0x49')](_0x4fadfc)['then'](handleEntityNotFound(_0x47b171,null))[_0xa92b('0x27')](respondWithResult(_0x47b171,null))['catch'](handleError(_0x47b171,null));};exports[_0xa92b('0x4a')]=function(_0x54906a,_0xa528ff){return db[_0xa92b('0x2f')]['create'](_0x54906a[_0xa92b('0x4b')],{})[_0xa92b('0x27')](function(_0xf3e72b){var _0x40d660=_0x54906a[_0xa92b('0x4c')][_0xa92b('0x4d')]({'plain':!![]});if(!_0x40d660)throw new Error(_0xa92b('0x4e'));if(_0x40d660['role']==='user'){var _0x52f747=_0xf3e72b['get']({'plain':!![]});var _0x366046='MailQueues';return db[_0xa92b('0x4f')][_0xa92b('0x49')]({'where':{'name':_0x366046,'userProfileId':_0x40d660['userProfileId']},'raw':!![]})[_0xa92b('0x27')](function(_0x387a99){if(_0x387a99&&_0x387a99[_0xa92b('0x50')]===0x0){return db[_0xa92b('0x51')][_0xa92b('0x4a')]({'name':_0x52f747[_0xa92b('0x2b')],'resourceId':_0x52f747['id'],'type':_0x387a99[_0xa92b('0x2b')],'sectionId':_0x387a99['id']},{})['then'](function(){return _0xf3e72b;});}else{return _0xf3e72b;}})['catch'](function(_0x5b6ab1){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b6ab1);throw _0x5b6ab1;});}return _0xf3e72b;})['then'](respondWithResult(_0xa528ff,0xc9))['catch'](handleError(_0xa528ff,null));};exports[_0xa92b('0x26')]=function(_0x4a2d33,_0x4537bb){if(_0x4a2d33[_0xa92b('0x4b')]['id']){delete _0x4a2d33[_0xa92b('0x4b')]['id'];}return db[_0xa92b('0x2f')][_0xa92b('0x49')]({'where':{'id':_0x4a2d33[_0xa92b('0x47')]['id']}})[_0xa92b('0x27')](handleEntityNotFound(_0x4537bb,null))[_0xa92b('0x27')](saveUpdates(_0x4a2d33[_0xa92b('0x4b')],null))['then'](respondWithResult(_0x4537bb,null))['catch'](handleError(_0x4537bb,null));};exports[_0xa92b('0x28')]=function(_0x5c84ed,_0x46a4b7){return db[_0xa92b('0x2f')]['find']({'where':{'id':_0x5c84ed['params']['id']}})[_0xa92b('0x27')](handleEntityNotFound(_0x46a4b7,null))[_0xa92b('0x27')](removeEntity(_0x46a4b7,null))[_0xa92b('0x46')](handleError(_0x46a4b7,null));};exports[_0xa92b('0x52')]=function(_0x3b5265,_0x20de77){return db[_0xa92b('0x2f')][_0xa92b('0x52')]()['then'](respondWithResult(_0x20de77,null))[_0xa92b('0x46')](handleError(_0x20de77,null));};exports[_0xa92b('0x53')]=function(_0x154bcc,_0x169761,_0x124fb){var _0x1bfa19={'raw':!![],'where':{}},_0xbc89fa={},_0x14f730;return db[_0xa92b('0x2f')][_0xa92b('0x54')]({'where':{'id':_0x154bcc['params']['id']}})['then'](handleEntityNotFound(_0x169761,null))[_0xa92b('0x27')](function(_0x403fb7){if(_0x403fb7){_0x14f730=_0x403fb7['get']({'plain':!![]});_0xbc89fa['model']=_[_0xa92b('0x35')](db[_0xa92b('0x55')][_0xa92b('0x30')]);_0xbc89fa[_0xa92b('0x34')]=_[_0xa92b('0x35')](_0x154bcc[_0xa92b('0x34')]);_0xbc89fa['filters']=_[_0xa92b('0x37')](_0xbc89fa['model'],_0xbc89fa[_0xa92b('0x34')]);_0x1bfa19[_0xa92b('0x38')]=_[_0xa92b('0x37')](_0xbc89fa[_0xa92b('0x33')],qs[_0xa92b('0x39')](_0x154bcc[_0xa92b('0x34')][_0xa92b('0x39')]));_0x1bfa19[_0xa92b('0x38')]=_0x1bfa19[_0xa92b('0x38')][_0xa92b('0x56')]?_0x1bfa19[_0xa92b('0x38')]:_0xbc89fa[_0xa92b('0x33')];if(!_0x154bcc[_0xa92b('0x34')]['hasOwnProperty'](_0xa92b('0x3b'))){_0x1bfa19['limit']=qs['limit'](_0x154bcc[_0xa92b('0x34')][_0xa92b('0x21')]);_0x1bfa19[_0xa92b('0x20')]=qs[_0xa92b('0x20')](_0x154bcc[_0xa92b('0x34')][_0xa92b('0x20')]);}_0x1bfa19[_0xa92b('0x3c')]=qs['sort'](_0x154bcc['query']['sort']);_0x1bfa19[_0xa92b('0x3e')]=qs[_0xa92b('0x36')](_[_0xa92b('0x3f')](_0x154bcc['query'],_0xbc89fa[_0xa92b('0x36')]));_0x1bfa19[_0xa92b('0x3e')][_0xa92b('0x57')]=_0x403fb7['id'];if(_0x154bcc[_0xa92b('0x34')][_0xa92b('0x40')]){_0x1bfa19[_0xa92b('0x3e')]=_['merge'](_0x1bfa19[_0xa92b('0x3e')],{'$or':_['map'](_0x1bfa19[_0xa92b('0x38')],function(_0x1a1f4b){var _0xb1a5eb={};_0xb1a5eb[_0x1a1f4b]={'$like':'%'+_0x154bcc[_0xa92b('0x34')]['filter']+'%'};return _0xb1a5eb;})});}_0x1bfa19=_['merge']({},_0x1bfa19,_0x154bcc[_0xa92b('0x44')]);return db[_0xa92b('0x55')][_0xa92b('0x45')](_0x1bfa19);}})[_0xa92b('0x27')](function(_0x134184){if(_0x134184){return db[_0xa92b('0x58')]['findAndCountAll']({'where':{'id':_[_0xa92b('0x2e')](_0x134184,_0xa92b('0x59')),'role':'agent'},'attributes':['id',_0xa92b('0x2b'),_0xa92b('0x5a'),_0xa92b('0x5b'),'createdAt']});}})[_0xa92b('0x27')](function(_0x4758b6){if(_0x4758b6){return{'count':_0x4758b6[_0xa92b('0x22')],'rows':_['map'](_0x4758b6[_0xa92b('0x5c')],function(_0x362650){return{'membername':_0x362650[_0xa92b('0x2b')],'UserId':_0x362650['id'],'queue_name':_0x14f730[_0xa92b('0x2b')],'MailQueueId':_0x14f730['id'],'interface':util[_0xa92b('0x5d')]('%s/%s',_0xa92b('0x5e'),_0x362650['name']),'penalty':0x0,'paused':_0x362650['mailPause'],'createdAt':_0x362650[_0xa92b('0x5f')],'updatedAt':_0x362650[_0xa92b('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa92b('0x27')](respondWithFilteredResult(_0x169761,_0x1bfa19))[_0xa92b('0x46')](handleError(_0x169761,null));};exports['getTeams']=function(_0x18f488,_0x537665,_0x43911d){var _0x31a7c5={};var _0x563a66={};var _0x28a4fb;var _0x3a795c;return db[_0xa92b('0x2f')][_0xa92b('0x54')]({'where':{'id':_0x18f488[_0xa92b('0x47')]['id']}})[_0xa92b('0x27')](handleEntityNotFound(_0x537665,null))[_0xa92b('0x27')](function(_0x9f5d12){if(_0x9f5d12){_0x28a4fb=_0x9f5d12;_0x563a66[_0xa92b('0x33')]=_['keys'](db['Team'][_0xa92b('0x30')]);_0x563a66[_0xa92b('0x34')]=_[_0xa92b('0x35')](_0x18f488[_0xa92b('0x34')]);_0x563a66[_0xa92b('0x36')]=_[_0xa92b('0x37')](_0x563a66[_0xa92b('0x33')],_0x563a66[_0xa92b('0x34')]);_0x31a7c5[_0xa92b('0x38')]=_['intersection'](_0x563a66[_0xa92b('0x33')],qs[_0xa92b('0x39')](_0x18f488['query'][_0xa92b('0x39')]));_0x31a7c5[_0xa92b('0x38')]=_0x31a7c5[_0xa92b('0x38')][_0xa92b('0x56')]?_0x31a7c5[_0xa92b('0x38')]:_0x563a66[_0xa92b('0x33')];_0x31a7c5['order']=qs[_0xa92b('0x3d')](_0x18f488['query'][_0xa92b('0x3d')]);_0x31a7c5[_0xa92b('0x3e')]=qs[_0xa92b('0x36')](_[_0xa92b('0x3f')](_0x18f488[_0xa92b('0x34')],_0x563a66[_0xa92b('0x36')]));if(_0x18f488[_0xa92b('0x34')][_0xa92b('0x40')]){_0x31a7c5[_0xa92b('0x3e')]=_[_0xa92b('0x41')](_0x31a7c5[_0xa92b('0x3e')],{'$or':_[_0xa92b('0x2e')](_0x31a7c5[_0xa92b('0x38')],function(_0x5ecb3f){var _0x1117d5={};_0x1117d5[_0x5ecb3f]={'$like':'%'+_0x18f488[_0xa92b('0x34')]['filter']+'%'};return _0x1117d5;})});}_0x31a7c5=_[_0xa92b('0x41')]({},_0x31a7c5,_0x18f488[_0xa92b('0x44')]);return _0x28a4fb[_0xa92b('0x60')](_0x31a7c5);}})[_0xa92b('0x27')](function(_0x2f12ea){if(_0x2f12ea){_0x3a795c=_0x2f12ea[_0xa92b('0x56')];if(!_0x18f488[_0xa92b('0x34')][_0xa92b('0x3a')](_0xa92b('0x3b'))){_0x31a7c5[_0xa92b('0x21')]=qs[_0xa92b('0x21')](_0x18f488['query'][_0xa92b('0x21')]);_0x31a7c5[_0xa92b('0x20')]=qs[_0xa92b('0x20')](_0x18f488['query'][_0xa92b('0x20')]);}return _0x28a4fb['getTeams'](_0x31a7c5);}})[_0xa92b('0x27')](function(_0x1bcd97){if(_0x1bcd97){return _0x1bcd97?{'count':_0x3a795c,'rows':_0x1bcd97}:null;}})[_0xa92b('0x27')](respondWithResult(_0x537665,null))[_0xa92b('0x46')](handleError(_0x537665,null));};exports[_0xa92b('0x61')]=function(_0x4f2c04,_0x17beb4,_0x503cd9){var _0x53d8b6=_0x4f2c04['body'][_0xa92b('0x62')];return db[_0xa92b('0x63')][_0xa92b('0x45')]({'where':{'id':_0x53d8b6},'attributes':['id'],'include':[{'model':db[_0xa92b('0x58')],'as':_0xa92b('0x64'),'attributes':['id',_0xa92b('0x2b'),_0xa92b('0x65'),_0xa92b('0x66'),_0xa92b('0x67')],'raw':!![]}]})[_0xa92b('0x27')](function(_0x6f939d){if(_0x6f939d){var _0x31774a=_[_0xa92b('0x68')](_0x6f939d,function(_0xe13183){var _0xbadb93=_0xe13183[_0xa92b('0x4d')]({'plain':!![]});return _0xbadb93[_0xa92b('0x64')];});return db[_0xa92b('0x2f')][_0xa92b('0x49')]({'where':{'id':_0x4f2c04[_0xa92b('0x47')]['id']}})[_0xa92b('0x27')](function(_0x3b99f8){return db[_0xa92b('0x69')][_0xa92b('0x6a')](function(_0x90104c){return _0x3b99f8[_0xa92b('0x61')](_0x53d8b6,{'transaction':_0x90104c})[_0xa92b('0x27')](function(){return BPromise['each'](_0x31774a,function(_0x33e378){return db[_0xa92b('0x55')]['findOrCreate']({'where':{'UserId':_0x33e378['id'],'MailQueueId':_0x4f2c04[_0xa92b('0x47')]['id']},'transaction':_0x90104c});});})['then'](function(){_0x31774a['forEach'](function(_0x2e14ed){socket['emit'](_0xa92b('0x6b'),{'UserId':_0x2e14ed['id'],'MailQueueId':_0x3b99f8['id']});});});});});}})['then'](respondWithStatusCode(_0x17beb4,null))['catch'](handleError(_0x17beb4,null));};exports[_0xa92b('0x6c')]=function(_0x737974,_0x41f2a4,_0x2c45fb){return db['Team']['findAll']({'where':{'id':_0x737974[_0xa92b('0x34')][_0xa92b('0x62')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa92b('0x64'),'attributes':['id'],'raw':!![]}]})[_0xa92b('0x27')](handleEntityNotFound(_0x41f2a4,null))['then'](function(_0x4fc3a9){var _0x5e8992=_[_0xa92b('0x2e')](_0x4fc3a9,'id');var _0x292cbb=[];var _0x3d0fb9=[];var _0x1af358=squel[_0xa92b('0x6d')]();_0x1af358[_0xa92b('0x6e')](_0xa92b('0x6f'))[_0xa92b('0x70')](_0xa92b('0x71'),'tq')['join'](_0xa92b('0x72'),'ut',_0xa92b('0x73'))[_0xa92b('0x3e')](_0xa92b('0x74'),_0x737974[_0xa92b('0x47')]['id']);for(var _0xd70178=0x0;_0xd70178<_0x4fc3a9[_0xa92b('0x56')];_0xd70178+=0x1){let _0x135435=_0x4fc3a9[_0xd70178];for(var _0x135da0=0x0;_0x135da0<_0x135435[_0xa92b('0x64')][_0xa92b('0x56')];_0x135da0+=0x1){let _0x3abecb=_0x135435[_0xa92b('0x64')][_0x135da0];var _0x8147f=_0x1af358['clone']();_0x8147f[_0xa92b('0x3e')]('ut.UserId\x20=\x20?',_0x3abecb['id']);_0x3d0fb9[_0xa92b('0x75')](db[_0xa92b('0x69')][_0xa92b('0x34')](_0x8147f[_0xa92b('0x76')](),{'type':db['sequelize'][_0xa92b('0x77')][_0xa92b('0x78')]})['then'](function(_0xdd078f){if(_0xdd078f['length']===0x1){return _0x3abecb['id'];}else{var _0x772c5c=_[_0xa92b('0x79')](_['map'](_0xdd078f,_0xa92b('0x7a')),function(_0x100cb9){return _[_0xa92b('0x7b')](_0x5e8992,_0x100cb9);});if(_0x772c5c){return _0x3abecb['id'];}}}));}}return BPromise[_0xa92b('0x7c')](_0x3d0fb9)[_0xa92b('0x27')](function(_0x2c84ef){_0x292cbb=_(_0x292cbb)[_0xa92b('0x7d')](_0x2c84ef)[_0xa92b('0x7e')]()[_0xa92b('0x7f')]();return db[_0xa92b('0x2f')][_0xa92b('0x49')]({'where':{'id':_0x737974[_0xa92b('0x47')]['id']}})[_0xa92b('0x27')](function(_0x1c09cf){return db['sequelize'][_0xa92b('0x6a')](function(_0x2ee9df){return _0x1c09cf['removeTeams'](_0x737974[_0xa92b('0x34')]['ids'],{'transaction':_0x2ee9df})[_0xa92b('0x27')](function(){if(!_[_0xa92b('0x80')](_0x292cbb)){return _0x1c09cf['removeAgents'](_0x292cbb,{'transaction':_0x2ee9df});}})[_0xa92b('0x27')](function(){_0x292cbb[_0xa92b('0x81')](function(_0x436dcb){socket[_0xa92b('0x82')](_0xa92b('0x83'),{'UserId':_0x436dcb,'MailQueueId':_0x1c09cf['id']});});});});});});})[_0xa92b('0x27')](respondWithStatusCode(_0x41f2a4,null))[_0xa92b('0x46')](handleError(_0x41f2a4,null));};exports[_0xa92b('0x84')]=function(_0x50a714,_0xcd9f37,_0x8b981f){return db['MailQueue'][_0xa92b('0x49')]({'where':{'id':_0x50a714[_0xa92b('0x47')]['id']}})[_0xa92b('0x27')](handleEntityNotFound(_0xcd9f37,null))[_0xa92b('0x27')](function(_0xe339a9){if(_0xe339a9){return _0xe339a9[_0xa92b('0x84')](_0x50a714[_0xa92b('0x4b')]['ids'],_[_0xa92b('0x85')](_0x50a714[_0xa92b('0x4b')],[_0xa92b('0x62'),'id'])||{})[_0xa92b('0x86')](function(_0x5908ea){for(var _0x14effa=0x0;_0x14effa<_0x50a714[_0xa92b('0x4b')][_0xa92b('0x62')][_0xa92b('0x56')];_0x14effa+=0x1){socket[_0xa92b('0x82')](_0xa92b('0x6b'),{'UserId':Number(_0x50a714[_0xa92b('0x4b')][_0xa92b('0x62')][_0x14effa]),'MailQueueId':Number(_0x50a714[_0xa92b('0x47')]['id'])});}return _0x5908ea;});}})[_0xa92b('0x27')](respondWithResult(_0xcd9f37,null))[_0xa92b('0x46')](handleError(_0xcd9f37,null));};exports[_0xa92b('0x87')]=function(_0x3d76d1,_0x4a3de5,_0x464763){return db[_0xa92b('0x2f')][_0xa92b('0x49')]({'where':{'id':_0x3d76d1[_0xa92b('0x47')]['id']}})[_0xa92b('0x27')](handleEntityNotFound(_0x4a3de5,null))[_0xa92b('0x27')](function(_0x53b5ae){if(_0x53b5ae){return _0x53b5ae['removeAgents'](_0x3d76d1[_0xa92b('0x34')]['ids'])['then'](function(){if(_[_0xa92b('0x88')](_0x3d76d1['query']['ids'])){for(var _0x729ecb=0x0;_0x729ecb<_0x3d76d1[_0xa92b('0x34')][_0xa92b('0x62')][_0xa92b('0x56')];_0x729ecb+=0x1){socket[_0xa92b('0x82')](_0xa92b('0x83'),{'UserId':Number(_0x3d76d1[_0xa92b('0x34')][_0xa92b('0x62')][_0x729ecb]),'MailQueueId':Number(_0x3d76d1[_0xa92b('0x47')]['id'])});}}else{socket['emit'](_0xa92b('0x83'),{'UserId':Number(_0x3d76d1[_0xa92b('0x34')][_0xa92b('0x62')]),'MailQueueId':Number(_0x3d76d1['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4a3de5,null))[_0xa92b('0x46')](handleError(_0x4a3de5,null));};exports[_0xa92b('0x89')]=function(_0x5bb25f,_0x5910f6,_0x198841){var _0x5e0a51={};var _0x34e090={};var _0x3cbe15;var _0x1a4111;return db[_0xa92b('0x2f')][_0xa92b('0x54')]({'where':{'id':_0x5bb25f[_0xa92b('0x47')]['id']}})[_0xa92b('0x27')](handleEntityNotFound(_0x5910f6,null))[_0xa92b('0x27')](function(_0x10be26){if(_0x10be26){_0x3cbe15=_0x10be26;_0x34e090[_0xa92b('0x33')]=_['keys'](db[_0xa92b('0x58')][_0xa92b('0x30')]);_0x34e090[_0xa92b('0x34')]=_[_0xa92b('0x35')](_0x5bb25f['query']);_0x34e090['filters']=_[_0xa92b('0x37')](_0x34e090['model'],_0x34e090[_0xa92b('0x34')]);_0x5e0a51[_0xa92b('0x38')]=_[_0xa92b('0x37')](_0x34e090[_0xa92b('0x33')],qs[_0xa92b('0x39')](_0x5bb25f['query'][_0xa92b('0x39')]));_0x5e0a51['attributes']=_0x5e0a51[_0xa92b('0x38')][_0xa92b('0x56')]?_0x5e0a51[_0xa92b('0x38')]:_0x34e090[_0xa92b('0x33')];_0x5e0a51[_0xa92b('0x3c')]=qs['sort'](_0x5bb25f[_0xa92b('0x34')][_0xa92b('0x3d')]);_0x5e0a51[_0xa92b('0x3e')]=qs[_0xa92b('0x36')](_[_0xa92b('0x3f')](_0x5bb25f[_0xa92b('0x34')],_0x34e090[_0xa92b('0x36')]));if(_0x5bb25f['query']['filter']){_0x5e0a51[_0xa92b('0x3e')]=_[_0xa92b('0x41')](_0x5e0a51[_0xa92b('0x3e')],{'$or':_['map'](_0x5e0a51[_0xa92b('0x38')],function(_0xf5b782){var _0xcc3236={};_0xcc3236[_0xf5b782]={'$like':'%'+_0x5bb25f[_0xa92b('0x34')][_0xa92b('0x40')]+'%'};return _0xcc3236;})});}_0x5e0a51=_['merge']({},_0x5e0a51,_0x5bb25f[_0xa92b('0x44')]);return _0x3cbe15[_0xa92b('0x89')](_0x5e0a51);}})[_0xa92b('0x27')](function(_0x269d53){if(_0x269d53){_0x1a4111=_0x269d53[_0xa92b('0x56')];if(!_0x5bb25f[_0xa92b('0x34')][_0xa92b('0x3a')]('nolimit')){_0x5e0a51[_0xa92b('0x21')]=qs['limit'](_0x5bb25f[_0xa92b('0x34')][_0xa92b('0x21')]);_0x5e0a51[_0xa92b('0x20')]=qs[_0xa92b('0x20')](_0x5bb25f['query']['offset']);}return _0x3cbe15['getAgents'](_0x5e0a51);}})[_0xa92b('0x27')](function(_0x6b06cb){if(_0x6b06cb){return _0x6b06cb?{'count':_0x1a4111,'rows':_0x6b06cb}:null;}})[_0xa92b('0x27')](respondWithResult(_0x5910f6,null))['catch'](handleError(_0x5910f6,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index f9457c8..c6b37b9 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 _0xa118=['emit','exports','events','MailQueue','save','update','remove'];(function(_0x57dfe7,_0x2ea319){var _0x4e5082=function(_0x4d25cc){while(--_0x4d25cc){_0x57dfe7['push'](_0x57dfe7['shift']());}};_0x4e5082(++_0x2ea319);}(_0xa118,0x159));var _0x8a11=function(_0x205f12,_0x3f6454){_0x205f12=_0x205f12-0x0;var _0x571fc6=_0xa118[_0x205f12];return _0x571fc6;};'use strict';var EventEmitter=require(_0x8a11('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x8a11('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8a11('0x2'),'afterUpdate':_0x8a11('0x3'),'afterDestroy':_0x8a11('0x4')};function emitEvent(_0x344b18){return function(_0x20d13f,_0x1d0f86,_0x693966){MailQueueEvents['emit'](_0x344b18+':'+_0x20d13f['id'],_0x20d13f);MailQueueEvents[_0x8a11('0x5')](_0x344b18,_0x20d13f);_0x693966(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x8a11('0x6')]=MailQueueEvents; \ No newline at end of file +var _0x475c=['update','remove','emit','hook','exports','events','MailQueue','setMaxListeners','save'];(function(_0x100d60,_0x4ea4b3){var _0x5b2dff=function(_0x13f1a2){while(--_0x13f1a2){_0x100d60['push'](_0x100d60['shift']());}};_0x5b2dff(++_0x4ea4b3);}(_0x475c,0x113));var _0xc475=function(_0x4f8cff,_0x488ab2){_0x4f8cff=_0x4f8cff-0x0;var _0x16ba80=_0x475c[_0x4f8cff];return _0x16ba80;};'use strict';var EventEmitter=require(_0xc475('0x0'));var MailQueue=require('../../mysqldb')['db'][_0xc475('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xc475('0x2')](0x0);var events={'afterCreate':_0xc475('0x3'),'afterUpdate':_0xc475('0x4'),'afterDestroy':_0xc475('0x5')};function emitEvent(_0x5e1e49){return function(_0xd24324,_0x2cb240,_0x13a5a2){MailQueueEvents['emit'](_0x5e1e49+':'+_0xd24324['id'],_0xd24324);MailQueueEvents[_0xc475('0x6')](_0x5e1e49,_0xd24324);_0x13a5a2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0xc475('0x7')](e,emitEvent(event));}}module[_0xc475('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 6933582..0384323 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 _0xa18b=['request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','../../config/logger','api','moment'];(function(_0x3188de,_0x576963){var _0x1fef63=function(_0x566e48){while(--_0x566e48){_0x3188de['push'](_0x3188de['shift']());}};_0x1fef63(++_0x576963);}(_0xa18b,0x1d0));var _0xba18=function(_0x435592,_0x363aed){_0x435592=_0x435592-0x0;var _0x2d544d=_0xa18b[_0x435592];return _0x2d544d;};'use strict';var _=require(_0xba18('0x0'));var util=require('util');var logger=require(_0xba18('0x1'))(_0xba18('0x2'));var moment=require(_0xba18('0x3'));var BPromise=require('bluebird');var rp=require(_0xba18('0x4'));var fs=require('fs');var path=require(_0xba18('0x5'));var rimraf=require(_0xba18('0x6'));var config=require(_0xba18('0x7'));var attributes=require(_0xba18('0x8'));module[_0xba18('0x9')]=function(_0x33110c,_0x560555){return _0x33110c[_0xba18('0xa')](_0xba18('0xb'),attributes,{'tableName':_0xba18('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x14fd=['path','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x18c0ca,_0x1f4c22){var _0x2e9c71=function(_0x42ab40){while(--_0x42ab40){_0x18c0ca['push'](_0x18c0ca['shift']());}};_0x2e9c71(++_0x1f4c22);}(_0x14fd,0x1e8));var _0xd14f=function(_0x1bda57,_0x57ed25){_0x1bda57=_0x1bda57-0x0;var _0x4430e6=_0x14fd[_0x1bda57];return _0x4430e6;};'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('rimraf');var config=require(_0xd14f('0x7'));var attributes=require(_0xd14f('0x8'));module[_0xd14f('0x9')]=function(_0x2f2775,_0x3ad2cb){return _0x2f2775[_0xd14f('0xa')](_0xd14f('0xb'),attributes,{'tableName':_0xd14f('0xc'),'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 7ed06ee..04306f0 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 _0x79a5=['request\x20sent','stringify','error','MailQueue,\x20%s,\x20%s','message','result','catch','GetMailQueue','MailQueue','options','raw','where','attributes','limit','include','map','model','ShowMailQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','./mailQueue.socket','register','request','then','info','debug','MailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x2cac8e,_0x145b7f){var _0x3af00f=function(_0x4acbe7){while(--_0x4acbe7){_0x2cac8e['push'](_0x2cac8e['shift']());}};_0x3af00f(++_0x145b7f);}(_0x79a5,0x17a));var _0x579a=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x79a5[_0x710815];return _0x5b3b89;};'use strict';var _=require(_0x579a('0x0'));var util=require(_0x579a('0x1'));var moment=require(_0x579a('0x2'));var BPromise=require(_0x579a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x579a('0x4'));var db=require(_0x579a('0x5'))['db'];var utils=require(_0x579a('0x6'));var logger=require(_0x579a('0x7'))(_0x579a('0x8'));var config=require(_0x579a('0x9'));var jayson=require(_0x579a('0xa'));var client=jayson[_0x579a('0xb')]['http']({'port':0x232a});config['redis']=_[_0x579a('0xc')](config[_0x579a('0xd')],{'host':_0x579a('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x579a('0xd')]));require(_0x579a('0xf'))[_0x579a('0x10')](socket);function respondWithRpcPromise(_0x37033d,_0x2260f3,_0x4e0219){return new BPromise(function(_0x544cda,_0x3eaa92){return client[_0x579a('0x11')](_0x37033d,_0x4e0219)[_0x579a('0x12')](function(_0x2795f5){logger[_0x579a('0x13')]('MailQueue,\x20%s,\x20%s',_0x2260f3,'request\x20sent');logger[_0x579a('0x14')](_0x579a('0x15'),_0x2260f3,_0x579a('0x16'),JSON[_0x579a('0x17')](_0x2795f5));if(_0x2795f5['error']){if(_0x2795f5[_0x579a('0x18')]['code']===0x1f4){logger[_0x579a('0x18')](_0x579a('0x19'),_0x2260f3,_0x2795f5[_0x579a('0x18')][_0x579a('0x1a')]);return _0x3eaa92(_0x2795f5[_0x579a('0x18')]['message']);}logger[_0x579a('0x18')](_0x579a('0x19'),_0x2260f3,_0x2795f5[_0x579a('0x18')][_0x579a('0x1a')]);return _0x544cda(_0x2795f5['error'][_0x579a('0x1a')]);}else{logger[_0x579a('0x13')]('MailQueue,\x20%s,\x20%s',_0x2260f3,_0x579a('0x16'));_0x544cda(_0x2795f5[_0x579a('0x1b')][_0x579a('0x1a')]);}})[_0x579a('0x1c')](function(_0x556dd7){logger[_0x579a('0x18')](_0x579a('0x19'),_0x2260f3,_0x556dd7);_0x3eaa92(_0x556dd7);});});}exports[_0x579a('0x1d')]=function(_0x2ece3e){var _0x3e351c=this;return new Promise(function(_0x285ab6,_0x2ee45a){return db[_0x579a('0x1e')]['findAll']({'raw':_0x2ece3e['options']?_0x2ece3e[_0x579a('0x1f')][_0x579a('0x20')]===undefined?!![]:![]:!![],'where':_0x2ece3e[_0x579a('0x1f')]?_0x2ece3e[_0x579a('0x1f')][_0x579a('0x21')]||null:null,'attributes':_0x2ece3e[_0x579a('0x1f')]?_0x2ece3e[_0x579a('0x1f')][_0x579a('0x22')]||null:null,'limit':_0x2ece3e[_0x579a('0x1f')]?_0x2ece3e[_0x579a('0x1f')][_0x579a('0x23')]||null:null,'include':_0x2ece3e[_0x579a('0x1f')]?_0x2ece3e[_0x579a('0x1f')][_0x579a('0x24')]?_[_0x579a('0x25')](_0x2ece3e[_0x579a('0x1f')][_0x579a('0x24')],function(_0x504319){return{'model':db[_0x504319[_0x579a('0x26')]],'as':_0x504319['as'],'attributes':_0x504319[_0x579a('0x22')],'include':_0x504319[_0x579a('0x24')]?_[_0x579a('0x25')](_0x504319[_0x579a('0x24')],function(_0x1d12bf){return{'model':db[_0x1d12bf[_0x579a('0x26')]],'as':_0x1d12bf['as'],'attributes':_0x1d12bf['attributes'],'include':_0x1d12bf[_0x579a('0x24')]?_[_0x579a('0x25')](_0x1d12bf[_0x579a('0x24')],function(_0xadae30){return{'model':db[_0xadae30[_0x579a('0x26')]],'as':_0xadae30['as'],'attributes':_0xadae30[_0x579a('0x22')]};}):[]};}):[]};}):[]:[]})[_0x579a('0x12')](function(_0x125200){logger[_0x579a('0x13')]('GetMailQueue',_0x2ece3e);logger['debug'](_0x579a('0x1d'),_0x2ece3e,JSON[_0x579a('0x17')](_0x125200));_0x285ab6(_0x125200);})[_0x579a('0x1c')](function(_0x18fd18){logger[_0x579a('0x18')](_0x579a('0x1d'),_0x18fd18[_0x579a('0x1a')],_0x2ece3e);_0x2ee45a(_0x3e351c['error'](0x1f4,_0x18fd18['message']));});});};exports[_0x579a('0x27')]=function(_0x28333d){var _0xc97cbd=this;return new Promise(function(_0x30b054,_0x383d53){return db[_0x579a('0x1e')]['find']({'raw':_0x28333d[_0x579a('0x1f')]?_0x28333d[_0x579a('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x28333d[_0x579a('0x1f')]?_0x28333d['options'][_0x579a('0x21')]||null:null,'attributes':_0x28333d['options']?_0x28333d['options']['attributes']||null:null,'include':_0x28333d[_0x579a('0x1f')]?_0x28333d[_0x579a('0x1f')][_0x579a('0x24')]?_['map'](_0x28333d[_0x579a('0x1f')][_0x579a('0x24')],function(_0x303325){return{'model':db[_0x303325[_0x579a('0x26')]],'as':_0x303325['as'],'attributes':_0x303325['attributes'],'include':_0x303325[_0x579a('0x24')]?_[_0x579a('0x25')](_0x303325[_0x579a('0x24')],function(_0x2b4b56){return{'model':db[_0x2b4b56['model']],'as':_0x2b4b56['as'],'attributes':_0x2b4b56[_0x579a('0x22')],'include':_0x2b4b56[_0x579a('0x24')]?_['map'](_0x2b4b56['include'],function(_0x1690ac){return{'model':db[_0x1690ac[_0x579a('0x26')]],'as':_0x1690ac['as'],'attributes':_0x1690ac[_0x579a('0x22')]};}):[]};}):[]};}):[]:[]})[_0x579a('0x12')](function(_0x17e6ce){logger['info'](_0x579a('0x27'),_0x28333d);logger['debug'](_0x579a('0x27'),_0x28333d,JSON[_0x579a('0x17')](_0x17e6ce));_0x30b054(_0x17e6ce);})['catch'](function(_0x43164a){logger[_0x579a('0x18')](_0x579a('0x27'),_0x43164a[_0x579a('0x1a')],_0x28333d);_0x383d53(_0xc97cbd[_0x579a('0x18')](0x1f4,_0x43164a['message']));});});}; \ No newline at end of file +var _0x6a17=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','./mailQueue.socket','register','request','then','request\x20sent','stringify','error','code','message','MailQueue,\x20%s,\x20%s','info','catch','GetMailQueue','MailQueue','options','raw','where','attributes','limit','include','map','model','ShowMailQueue','debug','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x43cc69,_0x401eea){var _0xde43ae=function(_0x43608f){while(--_0x43608f){_0x43cc69['push'](_0x43cc69['shift']());}};_0xde43ae(++_0x401eea);}(_0x6a17,0x1e8));var _0x76a1=function(_0x385093,_0x44f577){_0x385093=_0x385093-0x0;var _0x50bc92=_0x6a17[_0x385093];return _0x50bc92;};'use strict';var _=require(_0x76a1('0x0'));var util=require(_0x76a1('0x1'));var moment=require(_0x76a1('0x2'));var BPromise=require(_0x76a1('0x3'));var rs=require(_0x76a1('0x4'));var fs=require('fs');var Redis=require(_0x76a1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x76a1('0x6'));var logger=require(_0x76a1('0x7'))(_0x76a1('0x8'));var config=require(_0x76a1('0x9'));var jayson=require(_0x76a1('0xa'));var client=jayson[_0x76a1('0xb')]['http']({'port':0x232a});config[_0x76a1('0xc')]=_[_0x76a1('0xd')](config[_0x76a1('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x76a1('0xc')]));require(_0x76a1('0xe'))[_0x76a1('0xf')](socket);function respondWithRpcPromise(_0x3407c,_0x5ada37,_0x13938c){return new BPromise(function(_0x540d37,_0x3da056){return client[_0x76a1('0x10')](_0x3407c,_0x13938c)[_0x76a1('0x11')](function(_0x2c2686){logger['info']('MailQueue,\x20%s,\x20%s',_0x5ada37,'request\x20sent');logger['debug']('MailQueue,\x20%s,\x20%s,\x20%s',_0x5ada37,_0x76a1('0x12'),JSON[_0x76a1('0x13')](_0x2c2686));if(_0x2c2686[_0x76a1('0x14')]){if(_0x2c2686[_0x76a1('0x14')][_0x76a1('0x15')]===0x1f4){logger[_0x76a1('0x14')]('MailQueue,\x20%s,\x20%s',_0x5ada37,_0x2c2686['error'][_0x76a1('0x16')]);return _0x3da056(_0x2c2686[_0x76a1('0x14')][_0x76a1('0x16')]);}logger[_0x76a1('0x14')](_0x76a1('0x17'),_0x5ada37,_0x2c2686[_0x76a1('0x14')]['message']);return _0x540d37(_0x2c2686[_0x76a1('0x14')]['message']);}else{logger[_0x76a1('0x18')](_0x76a1('0x17'),_0x5ada37,_0x76a1('0x12'));_0x540d37(_0x2c2686['result']['message']);}})[_0x76a1('0x19')](function(_0x30543e){logger['error'](_0x76a1('0x17'),_0x5ada37,_0x30543e);_0x3da056(_0x30543e);});});}exports[_0x76a1('0x1a')]=function(_0x1fa694){var _0x4d117d=this;return new Promise(function(_0xffd49d,_0x3d729f){return db[_0x76a1('0x1b')]['findAll']({'raw':_0x1fa694[_0x76a1('0x1c')]?_0x1fa694['options'][_0x76a1('0x1d')]===undefined?!![]:![]:!![],'where':_0x1fa694['options']?_0x1fa694[_0x76a1('0x1c')][_0x76a1('0x1e')]||null:null,'attributes':_0x1fa694['options']?_0x1fa694[_0x76a1('0x1c')][_0x76a1('0x1f')]||null:null,'limit':_0x1fa694[_0x76a1('0x1c')]?_0x1fa694['options'][_0x76a1('0x20')]||null:null,'include':_0x1fa694['options']?_0x1fa694[_0x76a1('0x1c')][_0x76a1('0x21')]?_[_0x76a1('0x22')](_0x1fa694[_0x76a1('0x1c')]['include'],function(_0x3f8ee4){return{'model':db[_0x3f8ee4[_0x76a1('0x23')]],'as':_0x3f8ee4['as'],'attributes':_0x3f8ee4[_0x76a1('0x1f')],'include':_0x3f8ee4[_0x76a1('0x21')]?_[_0x76a1('0x22')](_0x3f8ee4[_0x76a1('0x21')],function(_0x22f74c){return{'model':db[_0x22f74c[_0x76a1('0x23')]],'as':_0x22f74c['as'],'attributes':_0x22f74c[_0x76a1('0x1f')],'include':_0x22f74c[_0x76a1('0x21')]?_[_0x76a1('0x22')](_0x22f74c[_0x76a1('0x21')],function(_0x522343){return{'model':db[_0x522343[_0x76a1('0x23')]],'as':_0x522343['as'],'attributes':_0x522343[_0x76a1('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x76a1('0x11')](function(_0x2d4edd){logger[_0x76a1('0x18')](_0x76a1('0x1a'),_0x1fa694);logger['debug'](_0x76a1('0x1a'),_0x1fa694,JSON[_0x76a1('0x13')](_0x2d4edd));_0xffd49d(_0x2d4edd);})[_0x76a1('0x19')](function(_0x1489ad){logger[_0x76a1('0x14')]('GetMailQueue',_0x1489ad[_0x76a1('0x16')],_0x1fa694);_0x3d729f(_0x4d117d[_0x76a1('0x14')](0x1f4,_0x1489ad[_0x76a1('0x16')]));});});};exports[_0x76a1('0x24')]=function(_0x305910){var _0x34741b=this;return new Promise(function(_0x496fd2,_0x4380a4){return db[_0x76a1('0x1b')]['find']({'raw':_0x305910['options']?_0x305910['options']['raw']===undefined?!![]:![]:!![],'where':_0x305910[_0x76a1('0x1c')]?_0x305910['options'][_0x76a1('0x1e')]||null:null,'attributes':_0x305910[_0x76a1('0x1c')]?_0x305910['options']['attributes']||null:null,'include':_0x305910[_0x76a1('0x1c')]?_0x305910[_0x76a1('0x1c')][_0x76a1('0x21')]?_['map'](_0x305910[_0x76a1('0x1c')]['include'],function(_0x4e60e8){return{'model':db[_0x4e60e8['model']],'as':_0x4e60e8['as'],'attributes':_0x4e60e8[_0x76a1('0x1f')],'include':_0x4e60e8[_0x76a1('0x21')]?_[_0x76a1('0x22')](_0x4e60e8[_0x76a1('0x21')],function(_0x2dd980){return{'model':db[_0x2dd980[_0x76a1('0x23')]],'as':_0x2dd980['as'],'attributes':_0x2dd980['attributes'],'include':_0x2dd980[_0x76a1('0x21')]?_[_0x76a1('0x22')](_0x2dd980[_0x76a1('0x21')],function(_0x5361fb){return{'model':db[_0x5361fb[_0x76a1('0x23')]],'as':_0x5361fb['as'],'attributes':_0x5361fb['attributes']};}):[]};}):[]};}):[]:[]})[_0x76a1('0x11')](function(_0x16f1de){logger[_0x76a1('0x18')]('ShowMailQueue',_0x305910);logger[_0x76a1('0x25')](_0x76a1('0x24'),_0x305910,JSON[_0x76a1('0x13')](_0x16f1de));_0x496fd2(_0x16f1de);})[_0x76a1('0x19')](function(_0x214ff2){logger[_0x76a1('0x14')]('ShowMailQueue',_0x214ff2[_0x76a1('0x16')],_0x305910);_0x4380a4(_0x34741b[_0x76a1('0x14')](0x1f4,_0x214ff2[_0x76a1('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 3a012a2..406f6e0 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 _0x854d=['register','mailQueue:','./mailQueue.events','save','remove','update','emit','removeListener'];(function(_0x2826c6,_0x481561){var _0x2f1996=function(_0x354cdf){while(--_0x354cdf){_0x2826c6['push'](_0x2826c6['shift']());}};_0x2f1996(++_0x481561);}(_0x854d,0x13a));var _0xd854=function(_0xad5f6d,_0x16baf4){_0xad5f6d=_0xad5f6d-0x0;var _0x1c609c=_0x854d[_0xad5f6d];return _0x1c609c;};'use strict';var MailQueueEvents=require(_0xd854('0x0'));var events=[_0xd854('0x1'),_0xd854('0x2'),_0xd854('0x3')];function createListener(_0xeb45e4,_0x550fce){return function(_0xa5cca8){_0x550fce[_0xd854('0x4')](_0xeb45e4,_0xa5cca8);};}function removeListener(_0x50b8a9,_0x5d3e78){return function(){MailQueueEvents[_0xd854('0x5')](_0x50b8a9,_0x5d3e78);};}exports[_0xd854('0x6')]=function(_0x360a83){for(var _0x2f22b4=0x0,_0x4530ba=events['length'];_0x2f22b4<_0x4530ba;_0x2f22b4++){var _0x26f8d7=events[_0x2f22b4];var _0x2c17d5=createListener(_0xd854('0x7')+_0x26f8d7,_0x360a83);MailQueueEvents['on'](_0x26f8d7,_0x2c17d5);}}; \ No newline at end of file +var _0xed44=['mailQueue:','./mailQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xed44,0x12a));var _0x4ed4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xed44[_0x8c43de];return _0xa6591b;};'use strict';var MailQueueEvents=require(_0x4ed4('0x0'));var events=[_0x4ed4('0x1'),_0x4ed4('0x2'),_0x4ed4('0x3')];function createListener(_0x1a1fae,_0x590c53){return function(_0x2042c3){_0x590c53[_0x4ed4('0x4')](_0x1a1fae,_0x2042c3);};}function removeListener(_0x4f6bce,_0x38274f){return function(){MailQueueEvents[_0x4ed4('0x5')](_0x4f6bce,_0x38274f);};}exports[_0x4ed4('0x6')]=function(_0xb2ecb8){for(var _0x12c902=0x0,_0x10816a=events[_0x4ed4('0x7')];_0x12c902<_0x10816a;_0x12c902++){var _0x1cffcf=events[_0x12c902];var _0x291d40=createListener(_0x4ed4('0x8')+_0x1cffcf,_0xb2ecb8);MailQueueEvents['on'](_0x1cffcf,_0x291d40);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 42391c8..eb35e35 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 _0x6b97=['post','create','put','/:id','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe'];(function(_0x36b3ef,_0x26acd1){var _0x36f0d3=function(_0xc8b750){while(--_0xc8b750){_0x36b3ef['push'](_0x36b3ef['shift']());}};_0x36f0d3(++_0x26acd1);}(_0x6b97,0x111));var _0x76b9=function(_0x5a5bff,_0x350844){_0x5a5bff=_0x5a5bff-0x0;var _0x2ffe98=_0x6b97[_0x5a5bff];return _0x2ffe98;};'use strict';var multer=require('multer');var util=require(_0x76b9('0x0'));var path=require(_0x76b9('0x1'));var timeout=require(_0x76b9('0x2'));var express=require(_0x76b9('0x3'));var router=express[_0x76b9('0x4')]();var fs_extra=require(_0x76b9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x76b9('0x6'));var config=require(_0x76b9('0x7'));var controller=require('./mailQueueReport.controller');router['get']('/',auth[_0x76b9('0x8')](),controller['index']);router[_0x76b9('0x9')](_0x76b9('0xa'),auth[_0x76b9('0x8')](),controller[_0x76b9('0xb')]);router['get']('/:id',auth[_0x76b9('0x8')](),controller['show']);router[_0x76b9('0xc')]('/',auth['isAuthenticated'](),controller[_0x76b9('0xd')]);router[_0x76b9('0xe')](_0x76b9('0xf'),auth[_0x76b9('0x8')](),controller[_0x76b9('0x10')]);router['delete']('/:id',auth[_0x76b9('0x8')](),controller[_0x76b9('0x11')]);module[_0x76b9('0x12')]=router; \ No newline at end of file +var _0xbdd4=['./mailQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','update','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xbdd4,0x1d7));var _0x4bdd=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xbdd4[_0x1c546c];return _0x2cc384;};'use strict';var multer=require('multer');var util=require(_0x4bdd('0x0'));var path=require(_0x4bdd('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x4bdd('0x2'));var auth=require(_0x4bdd('0x3'));var interaction=require(_0x4bdd('0x4'));var config=require('../../config/environment');var controller=require(_0x4bdd('0x5'));router[_0x4bdd('0x6')]('/',auth['isAuthenticated'](),controller[_0x4bdd('0x7')]);router[_0x4bdd('0x6')](_0x4bdd('0x8'),auth[_0x4bdd('0x9')](),controller[_0x4bdd('0xa')]);router[_0x4bdd('0x6')](_0x4bdd('0xb'),auth[_0x4bdd('0x9')](),controller[_0x4bdd('0xc')]);router[_0x4bdd('0xd')]('/',auth[_0x4bdd('0x9')](),controller['create']);router['put'](_0x4bdd('0xb'),auth[_0x4bdd('0x9')](),controller[_0x4bdd('0xe')]);router['delete'](_0x4bdd('0xb'),auth['isAuthenticated'](),controller[_0x4bdd('0xf')]);module[_0x4bdd('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 60c3f6f..c0764ad 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 _0x4093=['STRING','DATE','moment','sequelize','exports'];(function(_0x406ede,_0x155d84){var _0x302322=function(_0x28e5bb){while(--_0x28e5bb){_0x406ede['push'](_0x406ede['shift']());}};_0x302322(++_0x155d84);}(_0x4093,0x18d));var _0x3409=function(_0x5595c5,_0x4616b3){_0x5595c5=_0x5595c5-0x0;var _0x524287=_0x4093[_0x5595c5];return _0x524287;};'use strict';var moment=require(_0x3409('0x0'));var Sequelize=require(_0x3409('0x1'));module[_0x3409('0x2')]={'uniqueid':{'type':Sequelize[_0x3409('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x3409('0x4')]},'leaveAt':{'type':Sequelize[_0x3409('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x3409('0x4')]},'reason':{'type':Sequelize[_0x3409('0x3')]}}; \ No newline at end of file +var _0x08cb=['STRING','DATE','sequelize'];(function(_0x47d56f,_0x4115dc){var _0x4c66a1=function(_0x318260){while(--_0x318260){_0x47d56f['push'](_0x47d56f['shift']());}};_0x4c66a1(++_0x4115dc);}(_0x08cb,0x16d));var _0xb08c=function(_0x307c83,_0x2f5cde){_0x307c83=_0x307c83-0x0;var _0x1a4f1b=_0x08cb[_0x307c83];return _0x1a4f1b;};'use strict';var moment=require('moment');var Sequelize=require(_0xb08c('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xb08c('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xb08c('0x1')]},'joinAt':{'type':Sequelize[_0xb08c('0x2')]},'leaveAt':{'type':Sequelize[_0xb08c('0x2')]},'acceptAt':{'type':Sequelize[_0xb08c('0x2')]},'exitAt':{'type':Sequelize[_0xb08c('0x2')]},'reason':{'type':Sequelize[_0xb08c('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index f79060c..098b29c 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 _0x5c3c=['findAll','rows','params','merge','catch','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','limit','count','offset','Content-Range','json','apply','reject','save','update','then','sendStatus','stack','name','send','index','map','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','MailQueueReport','includeAll','include'];(function(_0x30bb30,_0x564af1){var _0xce44e7=function(_0x5b96aa){while(--_0x5b96aa){_0x30bb30['push'](_0x30bb30['shift']());}};_0xce44e7(++_0x564af1);}(_0x5c3c,0x132));var _0xc5c3=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5c3c[_0x278e3c];return _0x3e2d9b;};'use strict';var emlformat=require(_0xc5c3('0x0'));var rimraf=require(_0xc5c3('0x1'));var zipdir=require(_0xc5c3('0x2'));var jsonpatch=require(_0xc5c3('0x3'));var rp=require('request-promise');var moment=require(_0xc5c3('0x4'));var BPromise=require(_0xc5c3('0x5'));var Mustache=require(_0xc5c3('0x6'));var util=require(_0xc5c3('0x7'));var path=require(_0xc5c3('0x8'));var sox=require(_0xc5c3('0x9'));var csv=require(_0xc5c3('0xa'));var ejs=require(_0xc5c3('0xb'));var fs=require('fs');var fs_extra=require(_0xc5c3('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc5c3('0xd'));var deskjs=require(_0xc5c3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc5c3('0xf'));var Papa=require(_0xc5c3('0x10'));var Redis=require('ioredis');var authService=require(_0xc5c3('0x11'));var qs=require(_0xc5c3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc5c3('0x13'));var logger=require(_0xc5c3('0x14'))(_0xc5c3('0x15'));var utils=require('../../config/utils');var config=require(_0xc5c3('0x16'));var licenseUtil=require(_0xc5c3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b56e6,_0x44d2b9){_0x44d2b9=_0x44d2b9||0xcc;return function(_0x3f0f45){if(_0x3f0f45){return _0x2b56e6['sendStatus'](_0x44d2b9);}return _0x2b56e6[_0xc5c3('0x18')](_0x44d2b9)[_0xc5c3('0x19')]();};}function respondWithResult(_0x1488ab,_0x13a740){_0x13a740=_0x13a740||0xc8;return function(_0xc8a636){if(_0xc8a636){return _0x1488ab['status'](_0x13a740)['json'](_0xc8a636);}};}function respondWithFilteredResult(_0x4445ea,_0x577e1a){return function(_0x1bae87){if(_0x1bae87){var _0xef8b21=typeof _0x577e1a['offset']==='undefined'&&typeof _0x577e1a[_0xc5c3('0x1a')]==='undefined';var _0xa9bc84=_0x1bae87[_0xc5c3('0x1b')];var _0x2ff158=_0xef8b21?0x0:_0x577e1a[_0xc5c3('0x1c')];var _0x28bae6=_0xef8b21?_0x1bae87['count']:_0x577e1a[_0xc5c3('0x1c')]+_0x577e1a[_0xc5c3('0x1a')];var _0x123dba;if(_0x28bae6>=_0xa9bc84){_0x28bae6=_0xa9bc84;_0x123dba=0xc8;}else{_0x123dba=0xce;}_0x4445ea[_0xc5c3('0x18')](_0x123dba);return _0x4445ea['set'](_0xc5c3('0x1d'),_0x2ff158+'-'+_0x28bae6+'/'+_0xa9bc84)[_0xc5c3('0x1e')](_0x1bae87);}return null;};}function patchUpdates(_0x3cc612){return function(_0x3ca20a){try{jsonpatch[_0xc5c3('0x1f')](_0x3ca20a,_0x3cc612,!![]);}catch(_0x564815){return BPromise[_0xc5c3('0x20')](_0x564815);}return _0x3ca20a[_0xc5c3('0x21')]();};}function saveUpdates(_0x370254,_0x2de266){return function(_0x1c5793){if(_0x1c5793){return _0x1c5793[_0xc5c3('0x22')](_0x370254)[_0xc5c3('0x23')](function(_0x5996a0){return _0x5996a0;});}return null;};}function removeEntity(_0x52d638,_0x45affe){return function(_0x38dd9e){if(_0x38dd9e){return _0x38dd9e['destroy']()['then'](function(){_0x52d638[_0xc5c3('0x18')](0xcc)[_0xc5c3('0x19')]();});}};}function handleEntityNotFound(_0x38a3df,_0x52e54a){return function(_0x4af067){if(!_0x4af067){_0x38a3df[_0xc5c3('0x24')](0x194);}return _0x4af067;};}function handleError(_0x22f607,_0x20c506){_0x20c506=_0x20c506||0x1f4;return function(_0x29791c){logger['error'](_0x29791c[_0xc5c3('0x25')]);if(_0x29791c['name']){delete _0x29791c[_0xc5c3('0x26')];}_0x22f607['status'](_0x20c506)[_0xc5c3('0x27')](_0x29791c);};}exports[_0xc5c3('0x28')]=function(_0x4269eb,_0x4773c5){var _0x15361c={},_0x2d07e1={},_0x35a397={'count':0x0,'rows':[]};var _0x4b5a0c=_[_0xc5c3('0x29')](db['MailQueueReport'][_0xc5c3('0x2a')],function(_0x43ebfc){return{'name':_0x43ebfc['fieldName'],'type':_0x43ebfc['type'][_0xc5c3('0x2b')]};});_0x2d07e1[_0xc5c3('0x2c')]=_[_0xc5c3('0x29')](_0x4b5a0c,_0xc5c3('0x26'));_0x2d07e1['query']=_[_0xc5c3('0x2d')](_0x4269eb[_0xc5c3('0x2e')]);_0x2d07e1[_0xc5c3('0x2f')]=_[_0xc5c3('0x30')](_0x2d07e1[_0xc5c3('0x2c')],_0x2d07e1[_0xc5c3('0x2e')]);_0x15361c[_0xc5c3('0x31')]=_[_0xc5c3('0x30')](_0x2d07e1[_0xc5c3('0x2c')],qs['fields'](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x32')]));_0x15361c[_0xc5c3('0x31')]=_0x15361c[_0xc5c3('0x31')][_0xc5c3('0x33')]?_0x15361c[_0xc5c3('0x31')]:_0x2d07e1[_0xc5c3('0x2c')];if(!_0x4269eb['query']['hasOwnProperty'](_0xc5c3('0x34'))){_0x15361c['limit']=qs[_0xc5c3('0x1a')](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x1a')]);_0x15361c[_0xc5c3('0x1c')]=qs[_0xc5c3('0x1c')](_0x4269eb['query'][_0xc5c3('0x1c')]);}_0x15361c[_0xc5c3('0x35')]=qs['sort'](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x36')]);_0x15361c[_0xc5c3('0x37')]=qs[_0xc5c3('0x2f')](_[_0xc5c3('0x38')](_0x4269eb[_0xc5c3('0x2e')],_0x2d07e1[_0xc5c3('0x2f')]),_0x4b5a0c);if(_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x39')]){_0x15361c[_0xc5c3('0x37')]=_['merge'](_0x15361c[_0xc5c3('0x37')],{'$or':_['map'](_0x4b5a0c,function(_0x4fdbe6){if(_0x4fdbe6[_0xc5c3('0x3a')]!==_0xc5c3('0x3b')){var _0x1b546e={};_0x1b546e[_0x4fdbe6[_0xc5c3('0x26')]]={'$like':'%'+_0x4269eb[_0xc5c3('0x2e')]['filter']+'%'};return _0x1b546e;}})});}_0x15361c=_['merge']({},_0x15361c,_0x4269eb[_0xc5c3('0x3c')]);var _0xa7cb91={'where':_0x15361c['where']};return db[_0xc5c3('0x3d')]['count'](_0xa7cb91)[_0xc5c3('0x23')](function(_0x2dfd19){_0x35a397[_0xc5c3('0x1b')]=_0x2dfd19;if(_0x4269eb['query'][_0xc5c3('0x3e')]){_0x15361c[_0xc5c3('0x3f')]=[{'all':!![]}];}return db['MailQueueReport'][_0xc5c3('0x40')](_0x15361c);})['then'](function(_0x33936c){_0x35a397[_0xc5c3('0x41')]=_0x33936c;return _0x35a397;})['then'](respondWithFilteredResult(_0x4773c5,_0x15361c))['catch'](handleError(_0x4773c5,null));};exports['show']=function(_0xfb64bb,_0x2f02ab){var _0x49b1fc={'raw':!![],'where':{'id':_0xfb64bb[_0xc5c3('0x42')]['id']}},_0x1a8490={};_0x1a8490[_0xc5c3('0x2c')]=_[_0xc5c3('0x2d')](db['MailQueueReport'][_0xc5c3('0x2a')]);_0x1a8490['query']=_['keys'](_0xfb64bb[_0xc5c3('0x2e')]);_0x1a8490[_0xc5c3('0x2f')]=_['intersection'](_0x1a8490[_0xc5c3('0x2c')],_0x1a8490[_0xc5c3('0x2e')]);_0x49b1fc['attributes']=_[_0xc5c3('0x30')](_0x1a8490['model'],qs[_0xc5c3('0x32')](_0xfb64bb[_0xc5c3('0x2e')]['fields']));_0x49b1fc[_0xc5c3('0x31')]=_0x49b1fc['attributes'][_0xc5c3('0x33')]?_0x49b1fc[_0xc5c3('0x31')]:_0x1a8490['model'];if(_0xfb64bb[_0xc5c3('0x2e')][_0xc5c3('0x3e')]){_0x49b1fc[_0xc5c3('0x3f')]=[{'all':!![]}];}_0x49b1fc=_[_0xc5c3('0x43')]({},_0x49b1fc,_0xfb64bb[_0xc5c3('0x3c')]);return db[_0xc5c3('0x3d')]['find'](_0x49b1fc)[_0xc5c3('0x23')](handleEntityNotFound(_0x2f02ab,null))[_0xc5c3('0x23')](respondWithResult(_0x2f02ab,null))[_0xc5c3('0x44')](handleError(_0x2f02ab,null));};exports[_0xc5c3('0x45')]=function(_0x23002b,_0x4a7330){return db['MailQueueReport'][_0xc5c3('0x45')](_0x23002b[_0xc5c3('0x46')],{})[_0xc5c3('0x23')](respondWithResult(_0x4a7330,0xc9))['catch'](handleError(_0x4a7330,null));};exports[_0xc5c3('0x22')]=function(_0x65f720,_0x3a901f){if(_0x65f720[_0xc5c3('0x46')]['id']){delete _0x65f720[_0xc5c3('0x46')]['id'];}return db[_0xc5c3('0x3d')][_0xc5c3('0x47')]({'where':{'id':_0x65f720['params']['id']}})[_0xc5c3('0x23')](handleEntityNotFound(_0x3a901f,null))[_0xc5c3('0x23')](saveUpdates(_0x65f720[_0xc5c3('0x46')],null))['then'](respondWithResult(_0x3a901f,null))[_0xc5c3('0x44')](handleError(_0x3a901f,null));};exports[_0xc5c3('0x48')]=function(_0x3b1bc2,_0x103bde){return db[_0xc5c3('0x3d')]['find']({'where':{'id':_0x3b1bc2[_0xc5c3('0x42')]['id']}})['then'](handleEntityNotFound(_0x103bde,null))[_0xc5c3('0x23')](removeEntity(_0x103bde,null))['catch'](handleError(_0x103bde,null));};exports[_0xc5c3('0x49')]=function(_0x34a2c3,_0x4add6b){return db[_0xc5c3('0x3d')][_0xc5c3('0x49')]()['then'](respondWithResult(_0x4add6b,null))[_0xc5c3('0x44')](handleError(_0x4add6b,null));}; \ No newline at end of file +var _0x5fdc=['papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','MailQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring'];(function(_0x1602ef,_0x447aba){var _0x5870ee=function(_0x4d94e7){while(--_0x4d94e7){_0x1602ef['push'](_0x1602ef['shift']());}};_0x5870ee(++_0x447aba);}(_0x5fdc,0x127));var _0xc5fd=function(_0x24df5b,_0x1c14bd){_0x24df5b=_0x24df5b-0x0;var _0x440b1e=_0x5fdc[_0x24df5b];return _0x440b1e;};'use strict';var emlformat=require(_0xc5fd('0x0'));var rimraf=require(_0xc5fd('0x1'));var zipdir=require(_0xc5fd('0x2'));var jsonpatch=require(_0xc5fd('0x3'));var rp=require(_0xc5fd('0x4'));var moment=require(_0xc5fd('0x5'));var BPromise=require(_0xc5fd('0x6'));var Mustache=require(_0xc5fd('0x7'));var util=require(_0xc5fd('0x8'));var path=require(_0xc5fd('0x9'));var sox=require(_0xc5fd('0xa'));var csv=require(_0xc5fd('0xb'));var ejs=require(_0xc5fd('0xc'));var fs=require('fs');var fs_extra=require(_0xc5fd('0xd'));var _=require(_0xc5fd('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc5fd('0xf'));var toCsv=require(_0xc5fd('0xb'));var querystring=require(_0xc5fd('0x10'));var Papa=require(_0xc5fd('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc5fd('0x12'));var as=require(_0xc5fd('0x13'));var hardwareService=require(_0xc5fd('0x14'));var logger=require(_0xc5fd('0x15'))(_0xc5fd('0x16'));var utils=require(_0xc5fd('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc5fd('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x558939,_0x1b1b2b){_0x1b1b2b=_0x1b1b2b||0xcc;return function(_0x1bc6d1){if(_0x1bc6d1){return _0x558939[_0xc5fd('0x19')](_0x1b1b2b);}return _0x558939[_0xc5fd('0x1a')](_0x1b1b2b)[_0xc5fd('0x1b')]();};}function respondWithResult(_0x40b0f8,_0x27447e){_0x27447e=_0x27447e||0xc8;return function(_0xa7a954){if(_0xa7a954){return _0x40b0f8['status'](_0x27447e)[_0xc5fd('0x1c')](_0xa7a954);}};}function respondWithFilteredResult(_0x103c3d,_0x2221da){return function(_0x3404e0){if(_0x3404e0){var _0x4d3636=typeof _0x2221da['offset']==='undefined'&&typeof _0x2221da['limit']==='undefined';var _0x35a9d0=_0x3404e0[_0xc5fd('0x1d')];var _0x27f611=_0x4d3636?0x0:_0x2221da[_0xc5fd('0x1e')];var _0x2ee392=_0x4d3636?_0x3404e0[_0xc5fd('0x1d')]:_0x2221da[_0xc5fd('0x1e')]+_0x2221da['limit'];var _0xb7bab1;if(_0x2ee392>=_0x35a9d0){_0x2ee392=_0x35a9d0;_0xb7bab1=0xc8;}else{_0xb7bab1=0xce;}_0x103c3d[_0xc5fd('0x1a')](_0xb7bab1);return _0x103c3d[_0xc5fd('0x1f')](_0xc5fd('0x20'),_0x27f611+'-'+_0x2ee392+'/'+_0x35a9d0)[_0xc5fd('0x1c')](_0x3404e0);}return null;};}function patchUpdates(_0x48024e){return function(_0x3966a2){try{jsonpatch[_0xc5fd('0x21')](_0x3966a2,_0x48024e,!![]);}catch(_0x18048e){return BPromise[_0xc5fd('0x22')](_0x18048e);}return _0x3966a2['save']();};}function saveUpdates(_0x4c85d5,_0x13cc42){return function(_0x2ab935){if(_0x2ab935){return _0x2ab935[_0xc5fd('0x23')](_0x4c85d5)[_0xc5fd('0x24')](function(_0x334401){return _0x334401;});}return null;};}function removeEntity(_0x311952,_0x56d473){return function(_0x1a3f21){if(_0x1a3f21){return _0x1a3f21[_0xc5fd('0x25')]()[_0xc5fd('0x24')](function(){_0x311952[_0xc5fd('0x1a')](0xcc)[_0xc5fd('0x1b')]();});}};}function handleEntityNotFound(_0x4020af,_0x475b91){return function(_0x527018){if(!_0x527018){_0x4020af[_0xc5fd('0x19')](0x194);}return _0x527018;};}function handleError(_0x48cd1d,_0x2ee700){_0x2ee700=_0x2ee700||0x1f4;return function(_0x231368){logger[_0xc5fd('0x26')](_0x231368[_0xc5fd('0x27')]);if(_0x231368['name']){delete _0x231368[_0xc5fd('0x28')];}_0x48cd1d[_0xc5fd('0x1a')](_0x2ee700)[_0xc5fd('0x29')](_0x231368);};}exports[_0xc5fd('0x2a')]=function(_0x19df33,_0x209975){var _0x541c12={},_0x412ef7={},_0x5d4f70={'count':0x0,'rows':[]};var _0x4859f7=_[_0xc5fd('0x2b')](db[_0xc5fd('0x2c')][_0xc5fd('0x2d')],function(_0x38db1d){return{'name':_0x38db1d[_0xc5fd('0x2e')],'type':_0x38db1d[_0xc5fd('0x2f')][_0xc5fd('0x30')]};});_0x412ef7[_0xc5fd('0x31')]=_['map'](_0x4859f7,_0xc5fd('0x28'));_0x412ef7[_0xc5fd('0x32')]=_[_0xc5fd('0x33')](_0x19df33[_0xc5fd('0x32')]);_0x412ef7[_0xc5fd('0x34')]=_[_0xc5fd('0x35')](_0x412ef7[_0xc5fd('0x31')],_0x412ef7[_0xc5fd('0x32')]);_0x541c12[_0xc5fd('0x36')]=_[_0xc5fd('0x35')](_0x412ef7[_0xc5fd('0x31')],qs[_0xc5fd('0x37')](_0x19df33['query'][_0xc5fd('0x37')]));_0x541c12[_0xc5fd('0x36')]=_0x541c12[_0xc5fd('0x36')][_0xc5fd('0x38')]?_0x541c12[_0xc5fd('0x36')]:_0x412ef7[_0xc5fd('0x31')];if(!_0x19df33[_0xc5fd('0x32')][_0xc5fd('0x39')](_0xc5fd('0x3a'))){_0x541c12['limit']=qs[_0xc5fd('0x3b')](_0x19df33[_0xc5fd('0x32')][_0xc5fd('0x3b')]);_0x541c12[_0xc5fd('0x1e')]=qs[_0xc5fd('0x1e')](_0x19df33[_0xc5fd('0x32')][_0xc5fd('0x1e')]);}_0x541c12['order']=qs[_0xc5fd('0x3c')](_0x19df33[_0xc5fd('0x32')]['sort']);_0x541c12[_0xc5fd('0x3d')]=qs['filters'](_[_0xc5fd('0x3e')](_0x19df33[_0xc5fd('0x32')],_0x412ef7[_0xc5fd('0x34')]),_0x4859f7);if(_0x19df33['query'][_0xc5fd('0x3f')]){_0x541c12[_0xc5fd('0x3d')]=_['merge'](_0x541c12[_0xc5fd('0x3d')],{'$or':_[_0xc5fd('0x2b')](_0x4859f7,function(_0x31b457){if(_0x31b457[_0xc5fd('0x2f')]!==_0xc5fd('0x40')){var _0x33f669={};_0x33f669[_0x31b457['name']]={'$like':'%'+_0x19df33[_0xc5fd('0x32')][_0xc5fd('0x3f')]+'%'};return _0x33f669;}})});}_0x541c12=_[_0xc5fd('0x41')]({},_0x541c12,_0x19df33[_0xc5fd('0x42')]);var _0x5d3fce={'where':_0x541c12['where']};return db['MailQueueReport'][_0xc5fd('0x1d')](_0x5d3fce)[_0xc5fd('0x24')](function(_0x2dd4ca){_0x5d4f70[_0xc5fd('0x1d')]=_0x2dd4ca;if(_0x19df33[_0xc5fd('0x32')][_0xc5fd('0x43')]){_0x541c12[_0xc5fd('0x44')]=[{'all':!![]}];}return db[_0xc5fd('0x2c')][_0xc5fd('0x45')](_0x541c12);})['then'](function(_0x5a2199){_0x5d4f70[_0xc5fd('0x46')]=_0x5a2199;return _0x5d4f70;})['then'](respondWithFilteredResult(_0x209975,_0x541c12))[_0xc5fd('0x47')](handleError(_0x209975,null));};exports[_0xc5fd('0x48')]=function(_0x2259e4,_0x57fd81){var _0x6ebcbf={'raw':!![],'where':{'id':_0x2259e4['params']['id']}},_0x350753={};_0x350753[_0xc5fd('0x31')]=_[_0xc5fd('0x33')](db['MailQueueReport'][_0xc5fd('0x2d')]);_0x350753['query']=_[_0xc5fd('0x33')](_0x2259e4[_0xc5fd('0x32')]);_0x350753['filters']=_[_0xc5fd('0x35')](_0x350753[_0xc5fd('0x31')],_0x350753[_0xc5fd('0x32')]);_0x6ebcbf['attributes']=_[_0xc5fd('0x35')](_0x350753[_0xc5fd('0x31')],qs['fields'](_0x2259e4['query'][_0xc5fd('0x37')]));_0x6ebcbf['attributes']=_0x6ebcbf['attributes']['length']?_0x6ebcbf[_0xc5fd('0x36')]:_0x350753[_0xc5fd('0x31')];if(_0x2259e4[_0xc5fd('0x32')][_0xc5fd('0x43')]){_0x6ebcbf[_0xc5fd('0x44')]=[{'all':!![]}];}_0x6ebcbf=_[_0xc5fd('0x41')]({},_0x6ebcbf,_0x2259e4['options']);return db['MailQueueReport']['find'](_0x6ebcbf)[_0xc5fd('0x24')](handleEntityNotFound(_0x57fd81,null))[_0xc5fd('0x24')](respondWithResult(_0x57fd81,null))[_0xc5fd('0x47')](handleError(_0x57fd81,null));};exports['create']=function(_0x1a2200,_0x51641b){return db[_0xc5fd('0x2c')][_0xc5fd('0x49')](_0x1a2200[_0xc5fd('0x4a')],{})[_0xc5fd('0x24')](respondWithResult(_0x51641b,0xc9))[_0xc5fd('0x47')](handleError(_0x51641b,null));};exports[_0xc5fd('0x23')]=function(_0x54d86c,_0x6b2f77){if(_0x54d86c[_0xc5fd('0x4a')]['id']){delete _0x54d86c['body']['id'];}return db['MailQueueReport'][_0xc5fd('0x4b')]({'where':{'id':_0x54d86c['params']['id']}})['then'](handleEntityNotFound(_0x6b2f77,null))[_0xc5fd('0x24')](saveUpdates(_0x54d86c[_0xc5fd('0x4a')],null))['then'](respondWithResult(_0x6b2f77,null))[_0xc5fd('0x47')](handleError(_0x6b2f77,null));};exports[_0xc5fd('0x25')]=function(_0x5c49e7,_0x21d418){return db[_0xc5fd('0x2c')][_0xc5fd('0x4b')]({'where':{'id':_0x5c49e7[_0xc5fd('0x4c')]['id']}})[_0xc5fd('0x24')](handleEntityNotFound(_0x21d418,null))[_0xc5fd('0x24')](removeEntity(_0x21d418,null))[_0xc5fd('0x47')](handleError(_0x21d418,null));};exports[_0xc5fd('0x4d')]=function(_0x4217f7,_0x32721e){return db[_0xc5fd('0x2c')]['describe']()[_0xc5fd('0x24')](respondWithResult(_0x32721e,null))[_0xc5fd('0x47')](handleError(_0x32721e,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 9b44be4..eb7127d 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 _0x5ec3=['rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ec3,0xf2));var _0x35ec=function(_0x468670,_0x4e2e61){_0x468670=_0x468670-0x0;var _0x3023ed=_0x5ec3[_0x468670];return _0x3023ed;};'use strict';var _=require(_0x35ec('0x0'));var util=require('util');var logger=require(_0x35ec('0x1'))(_0x35ec('0x2'));var moment=require('moment');var BPromise=require(_0x35ec('0x3'));var rp=require(_0x35ec('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x35ec('0x5'));var config=require(_0x35ec('0x6'));var attributes=require(_0x35ec('0x7'));module[_0x35ec('0x8')]=function(_0x15a070,_0x361ffa){return _0x15a070[_0x35ec('0x9')](_0x35ec('0xa'),attributes,{'tableName':_0x35ec('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x35ec('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x330a=['uniqueid','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue'];(function(_0x5774be,_0x2259d3){var _0x4914b4=function(_0x1eebc3){while(--_0x1eebc3){_0x5774be['push'](_0x5774be['shift']());}};_0x4914b4(++_0x2259d3);}(_0x330a,0xfd));var _0xa330=function(_0x320b9e,_0x1f892f){_0x320b9e=_0x320b9e-0x0;var _0x5e4416=_0x330a[_0x320b9e];return _0x5e4416;};'use strict';var _=require(_0xa330('0x0'));var util=require('util');var logger=require(_0xa330('0x1'))(_0xa330('0x2'));var moment=require(_0xa330('0x3'));var BPromise=require('bluebird');var rp=require(_0xa330('0x4'));var fs=require('fs');var path=require(_0xa330('0x5'));var rimraf=require(_0xa330('0x6'));var config=require(_0xa330('0x7'));var attributes=require(_0xa330('0x8'));module[_0xa330('0x9')]=function(_0x1856e5,_0x3e53a1){return _0x1856e5[_0xa330('0xa')](_0xa330('0xb'),attributes,{'tableName':_0xa330('0xc'),'paranoid':![],'indexes':[{'name':_0xa330('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index a65f6e5..924b08b 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 _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x42e8f3,_0x5c8dba){var _0x47feab=function(_0x35fbf7){while(--_0x35fbf7){_0x42e8f3['push'](_0x42e8f3['shift']());}};_0x47feab(++_0x5c8dba);}(_0x2ef3,0xba));var _0x32ef=function(_0x5814fa,_0x1de4bf){_0x5814fa=_0x5814fa-0x0;var _0x34f2de=_0x2ef3[_0x5814fa];return _0x34f2de;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});}; \ No newline at end of file +var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x314ccb,_0x1342d1){var _0x1bb80a=function(_0x2e48ad){while(--_0x2e48ad){_0x314ccb['push'](_0x314ccb['shift']());}};_0x1bb80a(++_0x1342d1);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xc4aa[_0x3b0731];return _0x4204d7;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index a0419a9..87ee4b1 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1f1599,_0x4299bc){var _0xa400d1=function(_0x2a02fb){while(--_0x2a02fb){_0x1f1599['push'](_0x1f1599['shift']());}};_0xa400d1(++_0x4299bc);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x3911a0,_0x399077){var _0xf3dd14=function(_0x40561d){while(--_0x40561d){_0x3911a0['push'](_0x3911a0['shift']());}};_0xf3dd14(++_0x399077);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 96fc272..0c27554 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 _0xa858=['STRING','BOOLEAN','INTEGER','INBOX','sequelize','exports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xa858,0x1cc));var _0x8a85=function(_0x383388,_0xf2abef){_0x383388=_0x383388-0x0;var _0x1603c8=_0xa858[_0x383388];return _0x1603c8;};'use strict';var Sequelize=require(_0x8a85('0x0'));module[_0x8a85('0x1')]={'description':{'type':Sequelize[_0x8a85('0x2')]},'host':{'type':Sequelize[_0x8a85('0x2')]},'authentication':{'type':Sequelize[_0x8a85('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x8a85('0x2')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x8a85('0x4')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x8a85('0x2')],'defaultValue':_0x8a85('0x5')},'connTimeout':{'type':Sequelize[_0x8a85('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x8a85('0x4')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x8a85('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xddb3=['sequelize','STRING','BOOLEAN','INTEGER','INBOX'];(function(_0x271b55,_0x236afe){var _0x170629=function(_0x293edc){while(--_0x293edc){_0x271b55['push'](_0x271b55['shift']());}};_0x170629(++_0x236afe);}(_0xddb3,0x1e5));var _0x3ddb=function(_0x3941fe,_0x13bfae){_0x3941fe=_0x3941fe-0x0;var _0x53daa2=_0xddb3[_0x3941fe];return _0x53daa2;};'use strict';var Sequelize=require(_0x3ddb('0x0'));module['exports']={'description':{'type':Sequelize[_0x3ddb('0x1')]},'host':{'type':Sequelize[_0x3ddb('0x1')]},'authentication':{'type':Sequelize[_0x3ddb('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x3ddb('0x1')]},'password':{'type':Sequelize[_0x3ddb('0x1')]},'port':{'type':Sequelize[_0x3ddb('0x3')]},'tls':{'type':Sequelize[_0x3ddb('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x3ddb('0x1')],'defaultValue':_0x3ddb('0x4')},'connTimeout':{'type':Sequelize[_0x3ddb('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x3ddb('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x3ddb('0x1')]},'modernAuthentication':{'type':Sequelize[_0x3ddb('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 5413a15..9650e22 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 _0x7f04=['exports','define','MailServerIn','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x5d7231,_0x4f3d88){var _0x3d1b96=function(_0x1eb45b){while(--_0x1eb45b){_0x5d7231['push'](_0x5d7231['shift']());}};_0x3d1b96(++_0x4f3d88);}(_0x7f04,0xdf));var _0x47f0=function(_0xd37e3d,_0x5c9573){_0xd37e3d=_0xd37e3d-0x0;var _0xff1ac0=_0x7f04[_0xd37e3d];return _0xff1ac0;};'use strict';var _=require(_0x47f0('0x0'));var util=require(_0x47f0('0x1'));var logger=require(_0x47f0('0x2'))(_0x47f0('0x3'));var moment=require('moment');var BPromise=require(_0x47f0('0x4'));var rp=require(_0x47f0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x47f0('0x6'));var config=require('../../config/environment');var attributes=require('./mailServerIn.attributes');module[_0x47f0('0x7')]=function(_0x52a897,_0x25663d){return _0x52a897[_0x47f0('0x8')](_0x47f0('0x9'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe34e=['exports','define','mail_servers_in','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment','./mailServerIn.attributes'];(function(_0x41f67e,_0x9c7206){var _0x161c3b=function(_0x399c8b){while(--_0x399c8b){_0x41f67e['push'](_0x41f67e['shift']());}};_0x161c3b(++_0x9c7206);}(_0xe34e,0x66));var _0xee34=function(_0xe96694,_0x434b8a){_0xe96694=_0xe96694-0x0;var _0x209386=_0xe34e[_0xe96694];return _0x209386;};'use strict';var _=require(_0xee34('0x0'));var util=require('util');var logger=require(_0xee34('0x1'))(_0xee34('0x2'));var moment=require(_0xee34('0x3'));var BPromise=require(_0xee34('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xee34('0x5'));var rimraf=require('rimraf');var config=require(_0xee34('0x6'));var attributes=require(_0xee34('0x7'));module[_0xee34('0x8')]=function(_0x272bef,_0x59e503){return _0x272bef[_0xee34('0x9')]('MailServerIn',attributes,{'tableName':_0xee34('0xa'),'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 2fb5211..34990c1 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 _0xf746=['MailServerIn','findAll','raw','options','where','limit','map','include','model','attributes','then','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','GetMailServerIn'];(function(_0x421eeb,_0x3d3e3e){var _0x2c7371=function(_0x174b74){while(--_0x174b74){_0x421eeb['push'](_0x421eeb['shift']());}};_0x2c7371(++_0x3d3e3e);}(_0xf746,0xf3));var _0x6f74=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0xf746[_0x11ce46];return _0x368a1e;};'use strict';var _=require('lodash');var util=require(_0x6f74('0x0'));var moment=require(_0x6f74('0x1'));var BPromise=require(_0x6f74('0x2'));var rs=require(_0x6f74('0x3'));var fs=require('fs');var Redis=require(_0x6f74('0x4'));var db=require(_0x6f74('0x5'))['db'];var utils=require(_0x6f74('0x6'));var logger=require('../../config/logger')(_0x6f74('0x7'));var config=require(_0x6f74('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6f74('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x114247,_0x37d607,_0x48946f){return new BPromise(function(_0x12a711,_0x2e1001){return client[_0x6f74('0xa')](_0x114247,_0x48946f)['then'](function(_0x6e4734){logger['info'](_0x6f74('0xb'),_0x37d607,'request\x20sent');logger[_0x6f74('0xc')](_0x6f74('0xd'),_0x37d607,_0x6f74('0xe'),JSON['stringify'](_0x6e4734));if(_0x6e4734[_0x6f74('0xf')]){if(_0x6e4734['error'][_0x6f74('0x10')]===0x1f4){logger[_0x6f74('0xf')](_0x6f74('0xb'),_0x37d607,_0x6e4734['error'][_0x6f74('0x11')]);return _0x2e1001(_0x6e4734['error'][_0x6f74('0x11')]);}logger[_0x6f74('0xf')](_0x6f74('0xb'),_0x37d607,_0x6e4734[_0x6f74('0xf')][_0x6f74('0x11')]);return _0x12a711(_0x6e4734['error'][_0x6f74('0x11')]);}else{logger[_0x6f74('0x12')](_0x6f74('0xb'),_0x37d607,_0x6f74('0xe'));_0x12a711(_0x6e4734[_0x6f74('0x13')][_0x6f74('0x11')]);}})['catch'](function(_0x339a2f){logger[_0x6f74('0xf')]('MailServerIn,\x20%s,\x20%s',_0x37d607,_0x339a2f);_0x2e1001(_0x339a2f);});});}exports[_0x6f74('0x14')]=function(_0x15c6aa){var _0x15ecff=this;return new Promise(function(_0x54cfed,_0x33b1c0){return db[_0x6f74('0x15')][_0x6f74('0x16')]({'raw':_0x15c6aa['options']?_0x15c6aa['options'][_0x6f74('0x17')]===undefined?!![]:![]:!![],'where':_0x15c6aa[_0x6f74('0x18')]?_0x15c6aa[_0x6f74('0x18')][_0x6f74('0x19')]||null:null,'attributes':_0x15c6aa[_0x6f74('0x18')]?_0x15c6aa[_0x6f74('0x18')]['attributes']||null:null,'limit':_0x15c6aa[_0x6f74('0x18')]?_0x15c6aa['options'][_0x6f74('0x1a')]||null:null,'include':_0x15c6aa[_0x6f74('0x18')]?_0x15c6aa['options']['include']?_[_0x6f74('0x1b')](_0x15c6aa[_0x6f74('0x18')][_0x6f74('0x1c')],function(_0x508d1d){return{'model':db[_0x508d1d[_0x6f74('0x1d')]],'as':_0x508d1d['as'],'attributes':_0x508d1d[_0x6f74('0x1e')],'include':_0x508d1d[_0x6f74('0x1c')]?_[_0x6f74('0x1b')](_0x508d1d[_0x6f74('0x1c')],function(_0x4b4a90){return{'model':db[_0x4b4a90[_0x6f74('0x1d')]],'as':_0x4b4a90['as'],'attributes':_0x4b4a90[_0x6f74('0x1e')],'include':_0x4b4a90[_0x6f74('0x1c')]?_['map'](_0x4b4a90[_0x6f74('0x1c')],function(_0x366d3b){return{'model':db[_0x366d3b['model']],'as':_0x366d3b['as'],'attributes':_0x366d3b[_0x6f74('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6f74('0x1f')](function(_0x3e7971){logger[_0x6f74('0x12')](_0x6f74('0x14'),_0x15c6aa);logger[_0x6f74('0xc')](_0x6f74('0x14'),_0x15c6aa,JSON[_0x6f74('0x20')](_0x3e7971));_0x54cfed(_0x3e7971);})['catch'](function(_0x107fbb){logger['error']('GetMailServerIn',_0x107fbb[_0x6f74('0x11')],_0x15c6aa);_0x33b1c0(_0x15ecff[_0x6f74('0xf')](0x1f4,_0x107fbb[_0x6f74('0x11')]));});});}; \ No newline at end of file +var _0x07c1=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','include','model','map','debug','util'];(function(_0x361b51,_0x3bc0b3){var _0xc3def8=function(_0x1faabd){while(--_0x1faabd){_0x361b51['push'](_0x361b51['shift']());}};_0xc3def8(++_0x3bc0b3);}(_0x07c1,0xff));var _0x107c=function(_0x47dea,_0x5bdeb6){_0x47dea=_0x47dea-0x0;var _0x32e4b5=_0x07c1[_0x47dea];return _0x32e4b5;};'use strict';var _=require('lodash');var util=require(_0x107c('0x0'));var moment=require('moment');var BPromise=require(_0x107c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x107c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x107c('0x3'));var logger=require(_0x107c('0x4'))(_0x107c('0x5'));var config=require(_0x107c('0x6'));var jayson=require(_0x107c('0x7'));var client=jayson[_0x107c('0x8')][_0x107c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18e547,_0x1edfe9,_0x1c5ad0){return new BPromise(function(_0x5848a2,_0x49509d){return client['request'](_0x18e547,_0x1c5ad0)[_0x107c('0xa')](function(_0xcf7f7b){logger[_0x107c('0xb')]('MailServerIn,\x20%s,\x20%s',_0x1edfe9,_0x107c('0xc'));logger['debug'](_0x107c('0xd'),_0x1edfe9,'request\x20sent',JSON[_0x107c('0xe')](_0xcf7f7b));if(_0xcf7f7b[_0x107c('0xf')]){if(_0xcf7f7b[_0x107c('0xf')][_0x107c('0x10')]===0x1f4){logger[_0x107c('0xf')](_0x107c('0x11'),_0x1edfe9,_0xcf7f7b[_0x107c('0xf')][_0x107c('0x12')]);return _0x49509d(_0xcf7f7b[_0x107c('0xf')][_0x107c('0x12')]);}logger[_0x107c('0xf')](_0x107c('0x11'),_0x1edfe9,_0xcf7f7b[_0x107c('0xf')][_0x107c('0x12')]);return _0x5848a2(_0xcf7f7b[_0x107c('0xf')][_0x107c('0x12')]);}else{logger[_0x107c('0xb')](_0x107c('0x11'),_0x1edfe9,_0x107c('0xc'));_0x5848a2(_0xcf7f7b[_0x107c('0x13')][_0x107c('0x12')]);}})[_0x107c('0x14')](function(_0x27535a){logger[_0x107c('0xf')](_0x107c('0x11'),_0x1edfe9,_0x27535a);_0x49509d(_0x27535a);});});}exports[_0x107c('0x15')]=function(_0x266b36){var _0x10f4f3=this;return new Promise(function(_0x4b2c06,_0x5c340c){return db[_0x107c('0x16')][_0x107c('0x17')]({'raw':_0x266b36[_0x107c('0x18')]?_0x266b36['options'][_0x107c('0x19')]===undefined?!![]:![]:!![],'where':_0x266b36[_0x107c('0x18')]?_0x266b36[_0x107c('0x18')][_0x107c('0x1a')]||null:null,'attributes':_0x266b36[_0x107c('0x18')]?_0x266b36['options'][_0x107c('0x1b')]||null:null,'limit':_0x266b36[_0x107c('0x18')]?_0x266b36[_0x107c('0x18')]['limit']||null:null,'include':_0x266b36['options']?_0x266b36[_0x107c('0x18')][_0x107c('0x1c')]?_['map'](_0x266b36['options']['include'],function(_0x5bd538){return{'model':db[_0x5bd538[_0x107c('0x1d')]],'as':_0x5bd538['as'],'attributes':_0x5bd538['attributes'],'include':_0x5bd538[_0x107c('0x1c')]?_[_0x107c('0x1e')](_0x5bd538['include'],function(_0x542e3a){return{'model':db[_0x542e3a[_0x107c('0x1d')]],'as':_0x542e3a['as'],'attributes':_0x542e3a[_0x107c('0x1b')],'include':_0x542e3a[_0x107c('0x1c')]?_[_0x107c('0x1e')](_0x542e3a[_0x107c('0x1c')],function(_0x50f90b){return{'model':db[_0x50f90b[_0x107c('0x1d')]],'as':_0x50f90b['as'],'attributes':_0x50f90b[_0x107c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x107c('0xa')](function(_0x3efe95){logger[_0x107c('0xb')](_0x107c('0x15'),_0x266b36);logger[_0x107c('0x1f')](_0x107c('0x15'),_0x266b36,JSON['stringify'](_0x3efe95));_0x4b2c06(_0x3efe95);})[_0x107c('0x14')](function(_0x29a32c){logger[_0x107c('0xf')]('GetMailServerIn',_0x29a32c[_0x107c('0x12')],_0x266b36);_0x5c340c(_0x10f4f3[_0x107c('0xf')](0x1f4,_0x29a32c[_0x107c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 9b4b0f5..d7db41b 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x7a54,0x106));var _0x47a5=function(_0x16a2d8,_0x4ae229){_0x16a2d8=_0x16a2d8-0x0;var _0x11a5a8=_0x7a54[_0x16a2d8];return _0x11a5a8;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index fb56de9..eefb63d 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 _0x9c00=['sequelize','exports','STRING','BOOLEAN'];(function(_0x53c802,_0xa8058f){var _0x1a0f9e=function(_0x4fd56c){while(--_0x4fd56c){_0x53c802['push'](_0x53c802['shift']());}};_0x1a0f9e(++_0xa8058f);}(_0x9c00,0x1a0));var _0x09c0=function(_0x19527a,_0x1857f6){_0x19527a=_0x19527a-0x0;var _0x95df0a=_0x9c00[_0x19527a];return _0x95df0a;};'use strict';var Sequelize=require(_0x09c0('0x0'));module[_0x09c0('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x09c0('0x2')]},'pass':{'type':Sequelize[_0x09c0('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0x09c0('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x09c0('0x2')]},'authentication':{'type':Sequelize[_0x09c0('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x09c0('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x1775=['STRING','INTEGER','BOOLEAN','exports'];(function(_0x1cd5c7,_0x1c79d8){var _0x275dc4=function(_0x3b9656){while(--_0x3b9656){_0x1cd5c7['push'](_0x1cd5c7['shift']());}};_0x275dc4(++_0x1c79d8);}(_0x1775,0x1db));var _0x5177=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1775[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x5177('0x0')]={'description':{'type':Sequelize[_0x5177('0x1')]},'host':{'type':Sequelize[_0x5177('0x1')]},'user':{'type':Sequelize[_0x5177('0x1')]},'pass':{'type':Sequelize[_0x5177('0x1')]},'port':{'type':Sequelize[_0x5177('0x2')]},'secure':{'type':Sequelize[_0x5177('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x5177('0x1')]},'authentication':{'type':Sequelize[_0x5177('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x5177('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 80a4ba5..ffb6167 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 _0x8012=['lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','update','then','stack','name','send','index','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','merge','map','type','VIRTUAL','options','include','findAll','keys','includeAll','MailServerOut','find','create','body','catch','destroy','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x8012,0x158));var _0x2801=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x8012[_0x525c7b];return _0x27b33e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2801('0x0'));var zipdir=require(_0x2801('0x1'));var jsonpatch=require(_0x2801('0x2'));var rp=require(_0x2801('0x3'));var moment=require(_0x2801('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2801('0x5'));var util=require(_0x2801('0x6'));var path=require(_0x2801('0x7'));var sox=require('sox');var csv=require(_0x2801('0x8'));var ejs=require(_0x2801('0x9'));var fs=require('fs');var fs_extra=require(_0x2801('0xa'));var _=require(_0x2801('0xb'));var squel=require('squel');var crypto=require(_0x2801('0xc'));var jsforce=require(_0x2801('0xd'));var deskjs=require(_0x2801('0xe'));var toCsv=require(_0x2801('0x8'));var querystring=require(_0x2801('0xf'));var Papa=require(_0x2801('0x10'));var Redis=require(_0x2801('0x11'));var authService=require(_0x2801('0x12'));var qs=require(_0x2801('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2801('0x14'));var logger=require('../../config/logger')(_0x2801('0x15'));var utils=require(_0x2801('0x16'));var config=require(_0x2801('0x17'));var licenseUtil=require(_0x2801('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a8cbf,_0x5d3a2f){_0x5d3a2f=_0x5d3a2f||0xcc;return function(_0x236fc0){if(_0x236fc0){return _0x3a8cbf[_0x2801('0x19')](_0x5d3a2f);}return _0x3a8cbf[_0x2801('0x1a')](_0x5d3a2f)[_0x2801('0x1b')]();};}function respondWithResult(_0x16c0e0,_0x23a6d6){_0x23a6d6=_0x23a6d6||0xc8;return function(_0x2acfce){if(_0x2acfce){return _0x16c0e0[_0x2801('0x1a')](_0x23a6d6)[_0x2801('0x1c')](_0x2acfce);}};}function respondWithFilteredResult(_0x7f4f7b,_0x270cc8){return function(_0x5d835a){if(_0x5d835a){var _0x2d8635=typeof _0x270cc8[_0x2801('0x1d')]==='undefined'&&typeof _0x270cc8[_0x2801('0x1e')]===_0x2801('0x1f');var _0x388b3e=_0x5d835a[_0x2801('0x20')];var _0x12c66c=_0x2d8635?0x0:_0x270cc8[_0x2801('0x1d')];var _0xd74bc5=_0x2d8635?_0x5d835a[_0x2801('0x20')]:_0x270cc8[_0x2801('0x1d')]+_0x270cc8[_0x2801('0x1e')];var _0x368fc9;if(_0xd74bc5>=_0x388b3e){_0xd74bc5=_0x388b3e;_0x368fc9=0xc8;}else{_0x368fc9=0xce;}_0x7f4f7b['status'](_0x368fc9);return _0x7f4f7b['set'](_0x2801('0x21'),_0x12c66c+'-'+_0xd74bc5+'/'+_0x388b3e)['json'](_0x5d835a);}return null;};}function patchUpdates(_0x32b24a){return function(_0x3986bb){try{jsonpatch[_0x2801('0x22')](_0x3986bb,_0x32b24a,!![]);}catch(_0x1a187f){return BPromise['reject'](_0x1a187f);}return _0x3986bb['save']();};}function saveUpdates(_0x249478,_0x467f1f){return function(_0x4467fc){if(_0x4467fc){return _0x4467fc[_0x2801('0x23')](_0x249478)[_0x2801('0x24')](function(_0x409bb6){return _0x409bb6;});}return null;};}function removeEntity(_0x817c95,_0x45f201){return function(_0x2ebd7e){if(_0x2ebd7e){return _0x2ebd7e['destroy']()[_0x2801('0x24')](function(){_0x817c95[_0x2801('0x1a')](0xcc)[_0x2801('0x1b')]();});}};}function handleEntityNotFound(_0x22c75c,_0xc15a4){return function(_0x5797a2){if(!_0x5797a2){_0x22c75c[_0x2801('0x19')](0x194);}return _0x5797a2;};}function handleError(_0x1c0c32,_0x45f5c2){_0x45f5c2=_0x45f5c2||0x1f4;return function(_0x97a783){logger['error'](_0x97a783[_0x2801('0x25')]);if(_0x97a783[_0x2801('0x26')]){delete _0x97a783['name'];}_0x1c0c32[_0x2801('0x1a')](_0x45f5c2)[_0x2801('0x27')](_0x97a783);};}exports[_0x2801('0x28')]=function(_0x1c65ff,_0x10a498){var _0x436639={},_0x3eb07e={},_0x4b9928={'count':0x0,'rows':[]};var _0x249abb=_['map'](db['MailServerOut'][_0x2801('0x29')],function(_0x248c9f){return{'name':_0x248c9f[_0x2801('0x2a')],'type':_0x248c9f['type']['key']};});_0x3eb07e[_0x2801('0x2b')]=_['map'](_0x249abb,_0x2801('0x26'));_0x3eb07e[_0x2801('0x2c')]=_['keys'](_0x1c65ff[_0x2801('0x2c')]);_0x3eb07e[_0x2801('0x2d')]=_[_0x2801('0x2e')](_0x3eb07e['model'],_0x3eb07e[_0x2801('0x2c')]);_0x436639[_0x2801('0x2f')]=_[_0x2801('0x2e')](_0x3eb07e[_0x2801('0x2b')],qs[_0x2801('0x30')](_0x1c65ff[_0x2801('0x2c')][_0x2801('0x30')]));_0x436639[_0x2801('0x2f')]=_0x436639[_0x2801('0x2f')][_0x2801('0x31')]?_0x436639['attributes']:_0x3eb07e[_0x2801('0x2b')];if(!_0x1c65ff[_0x2801('0x2c')]['hasOwnProperty'](_0x2801('0x32'))){_0x436639[_0x2801('0x1e')]=qs['limit'](_0x1c65ff[_0x2801('0x2c')][_0x2801('0x1e')]);_0x436639[_0x2801('0x1d')]=qs[_0x2801('0x1d')](_0x1c65ff[_0x2801('0x2c')][_0x2801('0x1d')]);}_0x436639[_0x2801('0x33')]=qs['sort'](_0x1c65ff[_0x2801('0x2c')]['sort']);_0x436639[_0x2801('0x34')]=qs[_0x2801('0x2d')](_[_0x2801('0x35')](_0x1c65ff[_0x2801('0x2c')],_0x3eb07e[_0x2801('0x2d')]),_0x249abb);if(_0x1c65ff[_0x2801('0x2c')][_0x2801('0x36')]){_0x436639[_0x2801('0x34')]=_[_0x2801('0x37')](_0x436639[_0x2801('0x34')],{'$or':_[_0x2801('0x38')](_0x249abb,function(_0x1dbc11){if(_0x1dbc11[_0x2801('0x39')]!==_0x2801('0x3a')){var _0x16bd03={};_0x16bd03[_0x1dbc11[_0x2801('0x26')]]={'$like':'%'+_0x1c65ff['query'][_0x2801('0x36')]+'%'};return _0x16bd03;}})});}_0x436639=_['merge']({},_0x436639,_0x1c65ff[_0x2801('0x3b')]);var _0xf4107e={'where':_0x436639[_0x2801('0x34')]};return db['MailServerOut']['count'](_0xf4107e)['then'](function(_0x1e4e46){_0x4b9928[_0x2801('0x20')]=_0x1e4e46;if(_0x1c65ff[_0x2801('0x2c')]['includeAll']){_0x436639[_0x2801('0x3c')]=[{'all':!![]}];}return db['MailServerOut'][_0x2801('0x3d')](_0x436639);})[_0x2801('0x24')](function(_0x4b17d9){_0x4b9928['rows']=_0x4b17d9;return _0x4b9928;})[_0x2801('0x24')](respondWithFilteredResult(_0x10a498,_0x436639))['catch'](handleError(_0x10a498,null));};exports['show']=function(_0x5c4b4e,_0x229fdf){var _0x49fc10={'raw':!![],'where':{'id':_0x5c4b4e['params']['id']}},_0x5cdf48={};_0x5cdf48[_0x2801('0x2b')]=_[_0x2801('0x3e')](db['MailServerOut'][_0x2801('0x29')]);_0x5cdf48[_0x2801('0x2c')]=_[_0x2801('0x3e')](_0x5c4b4e[_0x2801('0x2c')]);_0x5cdf48[_0x2801('0x2d')]=_[_0x2801('0x2e')](_0x5cdf48[_0x2801('0x2b')],_0x5cdf48[_0x2801('0x2c')]);_0x49fc10['attributes']=_[_0x2801('0x2e')](_0x5cdf48[_0x2801('0x2b')],qs[_0x2801('0x30')](_0x5c4b4e[_0x2801('0x2c')][_0x2801('0x30')]));_0x49fc10[_0x2801('0x2f')]=_0x49fc10[_0x2801('0x2f')][_0x2801('0x31')]?_0x49fc10[_0x2801('0x2f')]:_0x5cdf48[_0x2801('0x2b')];if(_0x5c4b4e['query'][_0x2801('0x3f')]){_0x49fc10[_0x2801('0x3c')]=[{'all':!![]}];}_0x49fc10=_['merge']({},_0x49fc10,_0x5c4b4e[_0x2801('0x3b')]);return db[_0x2801('0x40')][_0x2801('0x41')](_0x49fc10)[_0x2801('0x24')](handleEntityNotFound(_0x229fdf,null))[_0x2801('0x24')](respondWithResult(_0x229fdf,null))['catch'](handleError(_0x229fdf,null));};exports[_0x2801('0x42')]=function(_0x133ec9,_0x3d88c7){return db[_0x2801('0x40')][_0x2801('0x42')](_0x133ec9[_0x2801('0x43')],{})[_0x2801('0x24')](respondWithResult(_0x3d88c7,0xc9))[_0x2801('0x44')](handleError(_0x3d88c7,null));};exports[_0x2801('0x23')]=function(_0x150dc3,_0x226029){if(_0x150dc3[_0x2801('0x43')]['id']){delete _0x150dc3[_0x2801('0x43')]['id'];}return db[_0x2801('0x40')][_0x2801('0x41')]({'where':{'id':_0x150dc3['params']['id']}})['then'](handleEntityNotFound(_0x226029,null))['then'](saveUpdates(_0x150dc3[_0x2801('0x43')],null))[_0x2801('0x24')](respondWithResult(_0x226029,null))[_0x2801('0x44')](handleError(_0x226029,null));};exports[_0x2801('0x45')]=function(_0x5d4ed8,_0x2501fc){return db['MailServerOut']['find']({'where':{'id':_0x5d4ed8[_0x2801('0x46')]['id']}})[_0x2801('0x24')](handleEntityNotFound(_0x2501fc,null))['then'](removeEntity(_0x2501fc,null))[_0x2801('0x44')](handleError(_0x2501fc,null));}; \ No newline at end of file +var _0x8ae8=['fast-json-patch','moment','bluebird','mustache','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','error','stack','name','send','index','map','MailServerOut','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','zip-dir'];(function(_0xb98825,_0x554182){var _0x451d90=function(_0x1e2b76){while(--_0x1e2b76){_0xb98825['push'](_0xb98825['shift']());}};_0x451d90(++_0x554182);}(_0x8ae8,0x1a2));var _0x88ae=function(_0x2a24de,_0x21fcbc){_0x2a24de=_0x2a24de-0x0;var _0x32b38e=_0x8ae8[_0x2a24de];return _0x32b38e;};'use strict';var emlformat=require(_0x88ae('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x88ae('0x1'));var jsonpatch=require(_0x88ae('0x2'));var rp=require('request-promise');var moment=require(_0x88ae('0x3'));var BPromise=require(_0x88ae('0x4'));var Mustache=require(_0x88ae('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x88ae('0x6'));var ejs=require(_0x88ae('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x88ae('0x8'));var squel=require('squel');var crypto=require(_0x88ae('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x88ae('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x88ae('0xb'));var Redis=require(_0x88ae('0xc'));var authService=require(_0x88ae('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x88ae('0xe'));var hardwareService=require(_0x88ae('0xf'));var logger=require(_0x88ae('0x10'))(_0x88ae('0x11'));var utils=require(_0x88ae('0x12'));var config=require(_0x88ae('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x88ae('0x14'))['db'];function respondWithStatusCode(_0x5de1ab,_0x5dab2e){_0x5dab2e=_0x5dab2e||0xcc;return function(_0x1a1124){if(_0x1a1124){return _0x5de1ab[_0x88ae('0x15')](_0x5dab2e);}return _0x5de1ab[_0x88ae('0x16')](_0x5dab2e)[_0x88ae('0x17')]();};}function respondWithResult(_0x1680d3,_0x533ec0){_0x533ec0=_0x533ec0||0xc8;return function(_0x48a3eb){if(_0x48a3eb){return _0x1680d3[_0x88ae('0x16')](_0x533ec0)[_0x88ae('0x18')](_0x48a3eb);}};}function respondWithFilteredResult(_0xd005a8,_0x5d69a4){return function(_0x9dea94){if(_0x9dea94){var _0x4d9c70=typeof _0x5d69a4[_0x88ae('0x19')]===_0x88ae('0x1a')&&typeof _0x5d69a4[_0x88ae('0x1b')]===_0x88ae('0x1a');var _0x17cd57=_0x9dea94[_0x88ae('0x1c')];var _0x4c8c92=_0x4d9c70?0x0:_0x5d69a4[_0x88ae('0x19')];var _0x498474=_0x4d9c70?_0x9dea94[_0x88ae('0x1c')]:_0x5d69a4[_0x88ae('0x19')]+_0x5d69a4[_0x88ae('0x1b')];var _0x497505;if(_0x498474>=_0x17cd57){_0x498474=_0x17cd57;_0x497505=0xc8;}else{_0x497505=0xce;}_0xd005a8[_0x88ae('0x16')](_0x497505);return _0xd005a8[_0x88ae('0x1d')](_0x88ae('0x1e'),_0x4c8c92+'-'+_0x498474+'/'+_0x17cd57)['json'](_0x9dea94);}return null;};}function patchUpdates(_0x45295c){return function(_0x2bba79){try{jsonpatch['apply'](_0x2bba79,_0x45295c,!![]);}catch(_0x2fac49){return BPromise['reject'](_0x2fac49);}return _0x2bba79[_0x88ae('0x1f')]();};}function saveUpdates(_0x2fba31,_0x565123){return function(_0x5ca2fa){if(_0x5ca2fa){return _0x5ca2fa[_0x88ae('0x20')](_0x2fba31)['then'](function(_0x4d6122){return _0x4d6122;});}return null;};}function removeEntity(_0x1b9e59,_0xa4f285){return function(_0x136026){if(_0x136026){return _0x136026['destroy']()['then'](function(){_0x1b9e59[_0x88ae('0x16')](0xcc)[_0x88ae('0x17')]();});}};}function handleEntityNotFound(_0x53b245,_0x6d2d1){return function(_0x50d425){if(!_0x50d425){_0x53b245['sendStatus'](0x194);}return _0x50d425;};}function handleError(_0x5ceffd,_0x8869c2){_0x8869c2=_0x8869c2||0x1f4;return function(_0x1cf11f){logger[_0x88ae('0x21')](_0x1cf11f[_0x88ae('0x22')]);if(_0x1cf11f['name']){delete _0x1cf11f[_0x88ae('0x23')];}_0x5ceffd[_0x88ae('0x16')](_0x8869c2)[_0x88ae('0x24')](_0x1cf11f);};}exports[_0x88ae('0x25')]=function(_0x277fce,_0x109540){var _0x4d748a={},_0x53ca40={},_0x41a5a2={'count':0x0,'rows':[]};var _0x36dabd=_[_0x88ae('0x26')](db[_0x88ae('0x27')][_0x88ae('0x28')],function(_0x13291e){return{'name':_0x13291e['fieldName'],'type':_0x13291e[_0x88ae('0x29')][_0x88ae('0x2a')]};});_0x53ca40[_0x88ae('0x2b')]=_['map'](_0x36dabd,_0x88ae('0x23'));_0x53ca40[_0x88ae('0x2c')]=_[_0x88ae('0x2d')](_0x277fce[_0x88ae('0x2c')]);_0x53ca40[_0x88ae('0x2e')]=_[_0x88ae('0x2f')](_0x53ca40[_0x88ae('0x2b')],_0x53ca40[_0x88ae('0x2c')]);_0x4d748a[_0x88ae('0x30')]=_[_0x88ae('0x2f')](_0x53ca40[_0x88ae('0x2b')],qs['fields'](_0x277fce['query'][_0x88ae('0x31')]));_0x4d748a['attributes']=_0x4d748a[_0x88ae('0x30')][_0x88ae('0x32')]?_0x4d748a[_0x88ae('0x30')]:_0x53ca40[_0x88ae('0x2b')];if(!_0x277fce[_0x88ae('0x2c')][_0x88ae('0x33')]('nolimit')){_0x4d748a[_0x88ae('0x1b')]=qs[_0x88ae('0x1b')](_0x277fce['query'][_0x88ae('0x1b')]);_0x4d748a['offset']=qs[_0x88ae('0x19')](_0x277fce[_0x88ae('0x2c')]['offset']);}_0x4d748a[_0x88ae('0x34')]=qs[_0x88ae('0x35')](_0x277fce['query'][_0x88ae('0x35')]);_0x4d748a[_0x88ae('0x36')]=qs[_0x88ae('0x2e')](_[_0x88ae('0x37')](_0x277fce['query'],_0x53ca40['filters']),_0x36dabd);if(_0x277fce[_0x88ae('0x2c')][_0x88ae('0x38')]){_0x4d748a[_0x88ae('0x36')]=_[_0x88ae('0x39')](_0x4d748a[_0x88ae('0x36')],{'$or':_['map'](_0x36dabd,function(_0x3e774b){if(_0x3e774b[_0x88ae('0x29')]!==_0x88ae('0x3a')){var _0x841a86={};_0x841a86[_0x3e774b[_0x88ae('0x23')]]={'$like':'%'+_0x277fce[_0x88ae('0x2c')]['filter']+'%'};return _0x841a86;}})});}_0x4d748a=_[_0x88ae('0x39')]({},_0x4d748a,_0x277fce[_0x88ae('0x3b')]);var _0x58f728={'where':_0x4d748a[_0x88ae('0x36')]};return db[_0x88ae('0x27')][_0x88ae('0x1c')](_0x58f728)[_0x88ae('0x3c')](function(_0x42da80){_0x41a5a2[_0x88ae('0x1c')]=_0x42da80;if(_0x277fce['query'][_0x88ae('0x3d')]){_0x4d748a[_0x88ae('0x3e')]=[{'all':!![]}];}return db['MailServerOut'][_0x88ae('0x3f')](_0x4d748a);})[_0x88ae('0x3c')](function(_0x3c6acf){_0x41a5a2['rows']=_0x3c6acf;return _0x41a5a2;})[_0x88ae('0x3c')](respondWithFilteredResult(_0x109540,_0x4d748a))[_0x88ae('0x40')](handleError(_0x109540,null));};exports[_0x88ae('0x41')]=function(_0x200add,_0x4482a9){var _0x1b60f2={'raw':!![],'where':{'id':_0x200add[_0x88ae('0x42')]['id']}},_0xb557ce={};_0xb557ce[_0x88ae('0x2b')]=_['keys'](db['MailServerOut']['rawAttributes']);_0xb557ce[_0x88ae('0x2c')]=_['keys'](_0x200add['query']);_0xb557ce[_0x88ae('0x2e')]=_[_0x88ae('0x2f')](_0xb557ce[_0x88ae('0x2b')],_0xb557ce['query']);_0x1b60f2['attributes']=_[_0x88ae('0x2f')](_0xb557ce['model'],qs[_0x88ae('0x31')](_0x200add[_0x88ae('0x2c')][_0x88ae('0x31')]));_0x1b60f2['attributes']=_0x1b60f2['attributes'][_0x88ae('0x32')]?_0x1b60f2[_0x88ae('0x30')]:_0xb557ce[_0x88ae('0x2b')];if(_0x200add[_0x88ae('0x2c')]['includeAll']){_0x1b60f2[_0x88ae('0x3e')]=[{'all':!![]}];}_0x1b60f2=_['merge']({},_0x1b60f2,_0x200add[_0x88ae('0x3b')]);return db[_0x88ae('0x27')][_0x88ae('0x43')](_0x1b60f2)['then'](handleEntityNotFound(_0x4482a9,null))[_0x88ae('0x3c')](respondWithResult(_0x4482a9,null))[_0x88ae('0x40')](handleError(_0x4482a9,null));};exports[_0x88ae('0x44')]=function(_0x34a3fc,_0x1d46fe){return db['MailServerOut'][_0x88ae('0x44')](_0x34a3fc['body'],{})[_0x88ae('0x3c')](respondWithResult(_0x1d46fe,0xc9))[_0x88ae('0x40')](handleError(_0x1d46fe,null));};exports['update']=function(_0x53d515,_0x2acf7e){if(_0x53d515[_0x88ae('0x45')]['id']){delete _0x53d515[_0x88ae('0x45')]['id'];}return db['MailServerOut'][_0x88ae('0x43')]({'where':{'id':_0x53d515[_0x88ae('0x42')]['id']}})['then'](handleEntityNotFound(_0x2acf7e,null))['then'](saveUpdates(_0x53d515['body'],null))[_0x88ae('0x3c')](respondWithResult(_0x2acf7e,null))['catch'](handleError(_0x2acf7e,null));};exports['destroy']=function(_0x1cdfdf,_0x4ddfd7){return db[_0x88ae('0x27')][_0x88ae('0x43')]({'where':{'id':_0x1cdfdf[_0x88ae('0x42')]['id']}})[_0x88ae('0x3c')](handleEntityNotFound(_0x4ddfd7,null))['then'](removeEntity(_0x4ddfd7,null))[_0x88ae('0x40')](handleError(_0x4ddfd7,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 9abc03b..b075ce2 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 _0x882d=['util','../../config/logger','api','moment','bluebird','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash'];(function(_0x2e487f,_0x5395d2){var _0x1043f7=function(_0x4cd43b){while(--_0x4cd43b){_0x2e487f['push'](_0x2e487f['shift']());}};_0x1043f7(++_0x5395d2);}(_0x882d,0x9b));var _0xd882=function(_0x44f974,_0x4db616){_0x44f974=_0x44f974-0x0;var _0x805dbd=_0x882d[_0x44f974];return _0x805dbd;};'use strict';var _=require(_0xd882('0x0'));var util=require(_0xd882('0x1'));var logger=require(_0xd882('0x2'))(_0xd882('0x3'));var moment=require(_0xd882('0x4'));var BPromise=require(_0xd882('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd882('0x6'));var attributes=require(_0xd882('0x7'));module[_0xd882('0x8')]=function(_0x224ead,_0x53aa00){return _0x224ead[_0xd882('0x9')](_0xd882('0xa'),attributes,{'tableName':_0xd882('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb6d0=['request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x38538f,_0x40ceee){var _0xfbf463=function(_0x54d878){while(--_0x54d878){_0x38538f['push'](_0x38538f['shift']());}};_0xfbf463(++_0x40ceee);}(_0xb6d0,0x120));var _0x0b6d=function(_0x5227ab,_0x514da4){_0x5227ab=_0x5227ab-0x0;var _0x3dc702=_0xb6d0[_0x5227ab];return _0x3dc702;};'use strict';var _=require(_0x0b6d('0x0'));var util=require(_0x0b6d('0x1'));var logger=require(_0x0b6d('0x2'))(_0x0b6d('0x3'));var moment=require(_0x0b6d('0x4'));var BPromise=require(_0x0b6d('0x5'));var rp=require(_0x0b6d('0x6'));var fs=require('fs');var path=require(_0x0b6d('0x7'));var rimraf=require(_0x0b6d('0x8'));var config=require(_0x0b6d('0x9'));var attributes=require(_0x0b6d('0xa'));module[_0x0b6d('0xb')]=function(_0xf3685e,_0x444444){return _0xf3685e['define'](_0x0b6d('0xc'),attributes,{'tableName':_0x0b6d('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 59d91a2..656120b 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x51a759,_0x4e9d6d){var _0x1557ab=function(_0x3ee298){while(--_0x3ee298){_0x51a759['push'](_0x51a759['shift']());}};_0x1557ab(++_0x4e9d6d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xc4aa[_0x11005e];return _0x29338f;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x3abf28,_0x4b4321){var _0x524563=function(_0x5d4977){while(--_0x5d4977){_0x3abf28['push'](_0x3abf28['shift']());}};_0x524563(++_0x4b4321);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x5f66[_0x4cf98e];return _0x1623ac;};'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')]('MailServerOut,\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/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index af85f89..2948d13 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 _0x2b89=['post','create','put','/:id','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','isAuthenticated','index','get','/describe','describe','show'];(function(_0x4266b4,_0x4859ad){var _0x1442aa=function(_0x21f8c1){while(--_0x21f8c1){_0x4266b4['push'](_0x4266b4['shift']());}};_0x1442aa(++_0x4859ad);}(_0x2b89,0xce));var _0x92b8=function(_0x2d0463,_0x115417){_0x2d0463=_0x2d0463-0x0;var _0xc8a3f5=_0x2b89[_0x2d0463];return _0xc8a3f5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x92b8('0x0'));var timeout=require(_0x92b8('0x1'));var express=require(_0x92b8('0x2'));var router=express[_0x92b8('0x3')]();var fs_extra=require(_0x92b8('0x4'));var auth=require(_0x92b8('0x5'));var interaction=require(_0x92b8('0x6'));var config=require('../../config/environment');var controller=require(_0x92b8('0x7'));router['get']('/',auth[_0x92b8('0x8')](),controller[_0x92b8('0x9')]);router[_0x92b8('0xa')](_0x92b8('0xb'),auth[_0x92b8('0x8')](),controller[_0x92b8('0xc')]);router[_0x92b8('0xa')]('/:id',auth[_0x92b8('0x8')](),controller[_0x92b8('0xd')]);router[_0x92b8('0xe')]('/',auth[_0x92b8('0x8')](),controller[_0x92b8('0xf')]);router[_0x92b8('0x10')](_0x92b8('0x11'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x92b8('0x11'),auth[_0x92b8('0x8')](),controller[_0x92b8('0x12')]);module[_0x92b8('0x13')]=router; \ No newline at end of file +var _0x8526=['delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','/describe','show','post','create','put'];(function(_0x437c3b,_0xf190cb){var _0x2a5c52=function(_0x1250e7){while(--_0x1250e7){_0x437c3b['push'](_0x437c3b['shift']());}};_0x2a5c52(++_0xf190cb);}(_0x8526,0x1c5));var _0x6852=function(_0x3f2e17,_0x2b18cb){_0x3f2e17=_0x3f2e17-0x0;var _0x54259a=_0x8526[_0x3f2e17];return _0x54259a;};'use strict';var multer=require(_0x6852('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6852('0x1'));var router=express[_0x6852('0x2')]();var fs_extra=require(_0x6852('0x3'));var auth=require(_0x6852('0x4'));var interaction=require(_0x6852('0x5'));var config=require(_0x6852('0x6'));var controller=require(_0x6852('0x7'));router[_0x6852('0x8')]('/',auth[_0x6852('0x9')](),controller['index']);router['get'](_0x6852('0xa'),auth[_0x6852('0x9')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x6852('0xb')]);router[_0x6852('0xc')]('/',auth[_0x6852('0x9')](),controller[_0x6852('0xd')]);router[_0x6852('0xe')]('/:id',auth[_0x6852('0x9')](),controller['update']);router[_0x6852('0xf')]('/:id',auth[_0x6852('0x9')](),controller[_0x6852('0x10')]);module[_0x6852('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index d5596d7..7f0a111 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 _0xafdd=['STRING','name','sequelize','exports'];(function(_0x22a244,_0x8f61d2){var _0x5c6b69=function(_0x321600){while(--_0x321600){_0x22a244['push'](_0x22a244['shift']());}};_0x5c6b69(++_0x8f61d2);}(_0xafdd,0x19a));var _0xdafd=function(_0x7bb1db,_0x371b1b){_0x7bb1db=_0x7bb1db-0x0;var _0x4c1a6b=_0xafdd[_0x7bb1db];return _0x4c1a6b;};'use strict';var Sequelize=require(_0xdafd('0x0'));module[_0xdafd('0x1')]={'name':{'type':Sequelize[_0xdafd('0x2')],'unique':_0xdafd('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xdafd('0x2')]}}; \ No newline at end of file +var _0x6075=['STRING','name','exports'];(function(_0xce2009,_0x1f8cf8){var _0x1c83cb=function(_0x16eaff){while(--_0x16eaff){_0xce2009['push'](_0xce2009['shift']());}};_0x1c83cb(++_0x1f8cf8);}(_0x6075,0x191));var _0x5607=function(_0x4cdedc,_0x3703fb){_0x4cdedc=_0x4cdedc-0x0;var _0x350127=_0x6075[_0x4cdedc];return _0x350127;};'use strict';var Sequelize=require('sequelize');module[_0x5607('0x0')]={'name':{'type':Sequelize[_0x5607('0x1')],'unique':_0x5607('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5607('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index c7c58fd..9690b4c 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 _0xa55a=['offset','undefined','count','limit','json','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','MailSubstatus','includeAll','findAll','catch','show','params','include','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x14a33e,_0x34f21f){var _0x308541=function(_0x260028){while(--_0x260028){_0x14a33e['push'](_0x14a33e['shift']());}};_0x308541(++_0x34f21f);}(_0xa55a,0x1a9));var _0xaa55=function(_0x4488b2,_0x453f2c){_0x4488b2=_0x4488b2-0x0;var _0x2dabb2=_0xa55a[_0x4488b2];return _0x2dabb2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaa55('0x0'));var zipdir=require(_0xaa55('0x1'));var jsonpatch=require(_0xaa55('0x2'));var rp=require(_0xaa55('0x3'));var moment=require('moment');var BPromise=require(_0xaa55('0x4'));var Mustache=require(_0xaa55('0x5'));var util=require('util');var path=require(_0xaa55('0x6'));var sox=require('sox');var csv=require(_0xaa55('0x7'));var ejs=require(_0xaa55('0x8'));var fs=require('fs');var fs_extra=require(_0xaa55('0x9'));var _=require(_0xaa55('0xa'));var squel=require(_0xaa55('0xb'));var crypto=require(_0xaa55('0xc'));var jsforce=require(_0xaa55('0xd'));var deskjs=require(_0xaa55('0xe'));var toCsv=require(_0xaa55('0x7'));var querystring=require(_0xaa55('0xf'));var Papa=require(_0xaa55('0x10'));var Redis=require(_0xaa55('0x11'));var authService=require(_0xaa55('0x12'));var qs=require(_0xaa55('0x13'));var as=require(_0xaa55('0x14'));var hardwareService=require(_0xaa55('0x15'));var logger=require(_0xaa55('0x16'))(_0xaa55('0x17'));var utils=require(_0xaa55('0x18'));var config=require(_0xaa55('0x19'));var licenseUtil=require(_0xaa55('0x1a'));var db=require(_0xaa55('0x1b'))['db'];function respondWithStatusCode(_0x40f80a,_0x156e72){_0x156e72=_0x156e72||0xcc;return function(_0x3839bc){if(_0x3839bc){return _0x40f80a[_0xaa55('0x1c')](_0x156e72);}return _0x40f80a[_0xaa55('0x1d')](_0x156e72)[_0xaa55('0x1e')]();};}function respondWithResult(_0x27c8c4,_0x328f61){_0x328f61=_0x328f61||0xc8;return function(_0x2336ec){if(_0x2336ec){return _0x27c8c4['status'](_0x328f61)['json'](_0x2336ec);}};}function respondWithFilteredResult(_0x485cd7,_0x4eefc0){return function(_0x2ba162){if(_0x2ba162){var _0x15bf2c=typeof _0x4eefc0[_0xaa55('0x1f')]===_0xaa55('0x20')&&typeof _0x4eefc0['limit']===_0xaa55('0x20');var _0x504064=_0x2ba162[_0xaa55('0x21')];var _0x181b8a=_0x15bf2c?0x0:_0x4eefc0[_0xaa55('0x1f')];var _0xf0bb5b=_0x15bf2c?_0x2ba162[_0xaa55('0x21')]:_0x4eefc0[_0xaa55('0x1f')]+_0x4eefc0[_0xaa55('0x22')];var _0x195e4a;if(_0xf0bb5b>=_0x504064){_0xf0bb5b=_0x504064;_0x195e4a=0xc8;}else{_0x195e4a=0xce;}_0x485cd7[_0xaa55('0x1d')](_0x195e4a);return _0x485cd7['set']('Content-Range',_0x181b8a+'-'+_0xf0bb5b+'/'+_0x504064)[_0xaa55('0x23')](_0x2ba162);}return null;};}function patchUpdates(_0x3b28fa){return function(_0x468b43){try{jsonpatch[_0xaa55('0x24')](_0x468b43,_0x3b28fa,!![]);}catch(_0x472ec1){return BPromise['reject'](_0x472ec1);}return _0x468b43[_0xaa55('0x25')]();};}function saveUpdates(_0x44f76d,_0xc565d7){return function(_0x1d1756){if(_0x1d1756){return _0x1d1756[_0xaa55('0x26')](_0x44f76d)[_0xaa55('0x27')](function(_0x108238){return _0x108238;});}return null;};}function removeEntity(_0x46bdef,_0x2fedb7){return function(_0x3a93ad){if(_0x3a93ad){return _0x3a93ad[_0xaa55('0x28')]()[_0xaa55('0x27')](function(){_0x46bdef[_0xaa55('0x1d')](0xcc)[_0xaa55('0x1e')]();});}};}function handleEntityNotFound(_0x1799a7,_0x10557f){return function(_0x576464){if(!_0x576464){_0x1799a7[_0xaa55('0x1c')](0x194);}return _0x576464;};}function handleError(_0x1df160,_0x5dfe4b){_0x5dfe4b=_0x5dfe4b||0x1f4;return function(_0x286f75){logger['error'](_0x286f75[_0xaa55('0x29')]);if(_0x286f75[_0xaa55('0x2a')]){delete _0x286f75[_0xaa55('0x2a')];}_0x1df160['status'](_0x5dfe4b)[_0xaa55('0x2b')](_0x286f75);};}exports[_0xaa55('0x2c')]=function(_0x31de5b,_0x2a3f90){var _0x42382e={},_0xa07bd3={},_0x22e5e9={'count':0x0,'rows':[]};var _0x2659a8=_[_0xaa55('0x2d')](db['MailSubstatus'][_0xaa55('0x2e')],function(_0x1c07f3){return{'name':_0x1c07f3['fieldName'],'type':_0x1c07f3[_0xaa55('0x2f')][_0xaa55('0x30')]};});_0xa07bd3[_0xaa55('0x31')]=_['map'](_0x2659a8,_0xaa55('0x2a'));_0xa07bd3[_0xaa55('0x32')]=_[_0xaa55('0x33')](_0x31de5b[_0xaa55('0x32')]);_0xa07bd3[_0xaa55('0x34')]=_[_0xaa55('0x35')](_0xa07bd3[_0xaa55('0x31')],_0xa07bd3['query']);_0x42382e[_0xaa55('0x36')]=_[_0xaa55('0x35')](_0xa07bd3[_0xaa55('0x31')],qs[_0xaa55('0x37')](_0x31de5b[_0xaa55('0x32')][_0xaa55('0x37')]));_0x42382e[_0xaa55('0x36')]=_0x42382e[_0xaa55('0x36')][_0xaa55('0x38')]?_0x42382e['attributes']:_0xa07bd3[_0xaa55('0x31')];if(!_0x31de5b[_0xaa55('0x32')][_0xaa55('0x39')]('nolimit')){_0x42382e[_0xaa55('0x22')]=qs[_0xaa55('0x22')](_0x31de5b[_0xaa55('0x32')][_0xaa55('0x22')]);_0x42382e[_0xaa55('0x1f')]=qs[_0xaa55('0x1f')](_0x31de5b[_0xaa55('0x32')][_0xaa55('0x1f')]);}_0x42382e[_0xaa55('0x3a')]=qs[_0xaa55('0x3b')](_0x31de5b[_0xaa55('0x32')][_0xaa55('0x3b')]);_0x42382e[_0xaa55('0x3c')]=qs[_0xaa55('0x34')](_[_0xaa55('0x3d')](_0x31de5b['query'],_0xa07bd3[_0xaa55('0x34')]),_0x2659a8);if(_0x31de5b[_0xaa55('0x32')][_0xaa55('0x3e')]){_0x42382e[_0xaa55('0x3c')]=_[_0xaa55('0x3f')](_0x42382e[_0xaa55('0x3c')],{'$or':_[_0xaa55('0x2d')](_0x2659a8,function(_0x28de55){if(_0x28de55[_0xaa55('0x2f')]!==_0xaa55('0x40')){var _0x47c18f={};_0x47c18f[_0x28de55['name']]={'$like':'%'+_0x31de5b['query'][_0xaa55('0x3e')]+'%'};return _0x47c18f;}})});}_0x42382e=_[_0xaa55('0x3f')]({},_0x42382e,_0x31de5b[_0xaa55('0x41')]);var _0x139fd6={'where':_0x42382e[_0xaa55('0x3c')]};return db[_0xaa55('0x42')][_0xaa55('0x21')](_0x139fd6)[_0xaa55('0x27')](function(_0x1da33f){_0x22e5e9['count']=_0x1da33f;if(_0x31de5b[_0xaa55('0x32')][_0xaa55('0x43')]){_0x42382e['include']=[{'all':!![]}];}return db[_0xaa55('0x42')][_0xaa55('0x44')](_0x42382e);})[_0xaa55('0x27')](function(_0x3dbf23){_0x22e5e9['rows']=_0x3dbf23;return _0x22e5e9;})[_0xaa55('0x27')](respondWithFilteredResult(_0x2a3f90,_0x42382e))[_0xaa55('0x45')](handleError(_0x2a3f90,null));};exports[_0xaa55('0x46')]=function(_0x5b250f,_0x4b8a67){var _0x39caad={'raw':!![],'where':{'id':_0x5b250f[_0xaa55('0x47')]['id']}},_0x262568={};_0x262568[_0xaa55('0x31')]=_[_0xaa55('0x33')](db[_0xaa55('0x42')]['rawAttributes']);_0x262568['query']=_['keys'](_0x5b250f[_0xaa55('0x32')]);_0x262568[_0xaa55('0x34')]=_[_0xaa55('0x35')](_0x262568[_0xaa55('0x31')],_0x262568[_0xaa55('0x32')]);_0x39caad[_0xaa55('0x36')]=_['intersection'](_0x262568[_0xaa55('0x31')],qs['fields'](_0x5b250f[_0xaa55('0x32')][_0xaa55('0x37')]));_0x39caad[_0xaa55('0x36')]=_0x39caad[_0xaa55('0x36')]['length']?_0x39caad[_0xaa55('0x36')]:_0x262568['model'];if(_0x5b250f[_0xaa55('0x32')]['includeAll']){_0x39caad[_0xaa55('0x48')]=[{'all':!![]}];}_0x39caad=_[_0xaa55('0x3f')]({},_0x39caad,_0x5b250f[_0xaa55('0x41')]);return db[_0xaa55('0x42')]['find'](_0x39caad)[_0xaa55('0x27')](handleEntityNotFound(_0x4b8a67,null))[_0xaa55('0x27')](respondWithResult(_0x4b8a67,null))['catch'](handleError(_0x4b8a67,null));};exports['create']=function(_0x39b102,_0x56cf0c){return db[_0xaa55('0x42')]['create'](_0x39b102['body'],{})[_0xaa55('0x27')](respondWithResult(_0x56cf0c,0xc9))[_0xaa55('0x45')](handleError(_0x56cf0c,null));};exports[_0xaa55('0x26')]=function(_0x3f6566,_0x2cb018){if(_0x3f6566[_0xaa55('0x49')]['id']){delete _0x3f6566[_0xaa55('0x49')]['id'];}return db[_0xaa55('0x42')]['find']({'where':{'id':_0x3f6566[_0xaa55('0x47')]['id']}})[_0xaa55('0x27')](handleEntityNotFound(_0x2cb018,null))[_0xaa55('0x27')](saveUpdates(_0x3f6566[_0xaa55('0x49')],null))[_0xaa55('0x27')](respondWithResult(_0x2cb018,null))[_0xaa55('0x45')](handleError(_0x2cb018,null));};exports[_0xaa55('0x28')]=function(_0x488bdb,_0x5cc4d0){return db[_0xaa55('0x42')][_0xaa55('0x4a')]({'where':{'id':_0x488bdb[_0xaa55('0x47')]['id']}})['then'](handleEntityNotFound(_0x5cc4d0,null))[_0xaa55('0x27')](removeEntity(_0x5cc4d0,null))['catch'](handleError(_0x5cc4d0,null));};exports[_0xaa55('0x4b')]=function(_0x319324,_0x4d386b){return db[_0xaa55('0x42')]['describe']()[_0xaa55('0x27')](respondWithResult(_0x4d386b,null))['catch'](handleError(_0x4d386b,null));}; \ No newline at end of file +var _0xfe0c=['update','then','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','MailSubstatus','includeAll','findAll','rows','catch','show','params','find','body','destroy','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save'];(function(_0xf94ac1,_0x2a8234){var _0x2578c1=function(_0x56f3e7){while(--_0x56f3e7){_0xf94ac1['push'](_0xf94ac1['shift']());}};_0x2578c1(++_0x2a8234);}(_0xfe0c,0x1df));var _0xcfe0=function(_0x2f36d1,_0x1eb0e8){_0x2f36d1=_0x2f36d1-0x0;var _0x39b89e=_0xfe0c[_0x2f36d1];return _0x39b89e;};'use strict';var emlformat=require(_0xcfe0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcfe0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcfe0('0x2'));var moment=require(_0xcfe0('0x3'));var BPromise=require(_0xcfe0('0x4'));var Mustache=require(_0xcfe0('0x5'));var util=require(_0xcfe0('0x6'));var path=require(_0xcfe0('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcfe0('0x8'));var _=require(_0xcfe0('0x9'));var squel=require(_0xcfe0('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcfe0('0xb'));var querystring=require(_0xcfe0('0xc'));var Papa=require('papaparse');var Redis=require(_0xcfe0('0xd'));var authService=require(_0xcfe0('0xe'));var qs=require(_0xcfe0('0xf'));var as=require(_0xcfe0('0x10'));var hardwareService=require(_0xcfe0('0x11'));var logger=require('../../config/logger')(_0xcfe0('0x12'));var utils=require(_0xcfe0('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xcfe0('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e6ae0,_0x2ee9bf){_0x2ee9bf=_0x2ee9bf||0xcc;return function(_0x1a5018){if(_0x1a5018){return _0x2e6ae0['sendStatus'](_0x2ee9bf);}return _0x2e6ae0[_0xcfe0('0x15')](_0x2ee9bf)[_0xcfe0('0x16')]();};}function respondWithResult(_0x52c7dd,_0x10ba74){_0x10ba74=_0x10ba74||0xc8;return function(_0x47aa35){if(_0x47aa35){return _0x52c7dd['status'](_0x10ba74)[_0xcfe0('0x17')](_0x47aa35);}};}function respondWithFilteredResult(_0x377a7f,_0x50020c){return function(_0x25f82e){if(_0x25f82e){var _0x30f369=typeof _0x50020c['offset']===_0xcfe0('0x18')&&typeof _0x50020c['limit']===_0xcfe0('0x18');var _0x22d900=_0x25f82e[_0xcfe0('0x19')];var _0x52ee8a=_0x30f369?0x0:_0x50020c[_0xcfe0('0x1a')];var _0x5cfd7e=_0x30f369?_0x25f82e[_0xcfe0('0x19')]:_0x50020c[_0xcfe0('0x1a')]+_0x50020c['limit'];var _0xa1473e;if(_0x5cfd7e>=_0x22d900){_0x5cfd7e=_0x22d900;_0xa1473e=0xc8;}else{_0xa1473e=0xce;}_0x377a7f[_0xcfe0('0x15')](_0xa1473e);return _0x377a7f[_0xcfe0('0x1b')](_0xcfe0('0x1c'),_0x52ee8a+'-'+_0x5cfd7e+'/'+_0x22d900)[_0xcfe0('0x17')](_0x25f82e);}return null;};}function patchUpdates(_0x1a2eb6){return function(_0x5931e0){try{jsonpatch[_0xcfe0('0x1d')](_0x5931e0,_0x1a2eb6,!![]);}catch(_0x22b76a){return BPromise[_0xcfe0('0x1e')](_0x22b76a);}return _0x5931e0[_0xcfe0('0x1f')]();};}function saveUpdates(_0x3488d8,_0x48032c){return function(_0xf3cbd8){if(_0xf3cbd8){return _0xf3cbd8[_0xcfe0('0x20')](_0x3488d8)[_0xcfe0('0x21')](function(_0x489d87){return _0x489d87;});}return null;};}function removeEntity(_0x44f851,_0x3f89e6){return function(_0x2f551f){if(_0x2f551f){return _0x2f551f['destroy']()[_0xcfe0('0x21')](function(){_0x44f851[_0xcfe0('0x15')](0xcc)[_0xcfe0('0x16')]();});}};}function handleEntityNotFound(_0xcccbad,_0x3c5cb5){return function(_0x5af73a){if(!_0x5af73a){_0xcccbad[_0xcfe0('0x22')](0x194);}return _0x5af73a;};}function handleError(_0x13f9a1,_0x300197){_0x300197=_0x300197||0x1f4;return function(_0x1be600){logger[_0xcfe0('0x23')](_0x1be600[_0xcfe0('0x24')]);if(_0x1be600['name']){delete _0x1be600[_0xcfe0('0x25')];}_0x13f9a1[_0xcfe0('0x15')](_0x300197)['send'](_0x1be600);};}exports[_0xcfe0('0x26')]=function(_0x539d8d,_0x134125){var _0x4a5e9a={},_0x5ce24c={},_0x27b98f={'count':0x0,'rows':[]};var _0x3884a7=_[_0xcfe0('0x27')](db['MailSubstatus'][_0xcfe0('0x28')],function(_0x4d6054){return{'name':_0x4d6054[_0xcfe0('0x29')],'type':_0x4d6054[_0xcfe0('0x2a')][_0xcfe0('0x2b')]};});_0x5ce24c[_0xcfe0('0x2c')]=_[_0xcfe0('0x27')](_0x3884a7,'name');_0x5ce24c[_0xcfe0('0x2d')]=_[_0xcfe0('0x2e')](_0x539d8d[_0xcfe0('0x2d')]);_0x5ce24c[_0xcfe0('0x2f')]=_['intersection'](_0x5ce24c[_0xcfe0('0x2c')],_0x5ce24c[_0xcfe0('0x2d')]);_0x4a5e9a[_0xcfe0('0x30')]=_[_0xcfe0('0x31')](_0x5ce24c['model'],qs[_0xcfe0('0x32')](_0x539d8d[_0xcfe0('0x2d')][_0xcfe0('0x32')]));_0x4a5e9a['attributes']=_0x4a5e9a[_0xcfe0('0x30')][_0xcfe0('0x33')]?_0x4a5e9a['attributes']:_0x5ce24c[_0xcfe0('0x2c')];if(!_0x539d8d[_0xcfe0('0x2d')][_0xcfe0('0x34')]('nolimit')){_0x4a5e9a['limit']=qs['limit'](_0x539d8d[_0xcfe0('0x2d')][_0xcfe0('0x35')]);_0x4a5e9a[_0xcfe0('0x1a')]=qs[_0xcfe0('0x1a')](_0x539d8d[_0xcfe0('0x2d')][_0xcfe0('0x1a')]);}_0x4a5e9a[_0xcfe0('0x36')]=qs['sort'](_0x539d8d[_0xcfe0('0x2d')][_0xcfe0('0x37')]);_0x4a5e9a['where']=qs[_0xcfe0('0x2f')](_[_0xcfe0('0x38')](_0x539d8d['query'],_0x5ce24c[_0xcfe0('0x2f')]),_0x3884a7);if(_0x539d8d['query'][_0xcfe0('0x39')]){_0x4a5e9a[_0xcfe0('0x3a')]=_[_0xcfe0('0x3b')](_0x4a5e9a[_0xcfe0('0x3a')],{'$or':_['map'](_0x3884a7,function(_0x437aa4){if(_0x437aa4[_0xcfe0('0x2a')]!==_0xcfe0('0x3c')){var _0x32d726={};_0x32d726[_0x437aa4[_0xcfe0('0x25')]]={'$like':'%'+_0x539d8d[_0xcfe0('0x2d')][_0xcfe0('0x39')]+'%'};return _0x32d726;}})});}_0x4a5e9a=_['merge']({},_0x4a5e9a,_0x539d8d[_0xcfe0('0x3d')]);var _0x271597={'where':_0x4a5e9a[_0xcfe0('0x3a')]};return db[_0xcfe0('0x3e')][_0xcfe0('0x19')](_0x271597)[_0xcfe0('0x21')](function(_0x49487f){_0x27b98f[_0xcfe0('0x19')]=_0x49487f;if(_0x539d8d[_0xcfe0('0x2d')][_0xcfe0('0x3f')]){_0x4a5e9a['include']=[{'all':!![]}];}return db['MailSubstatus'][_0xcfe0('0x40')](_0x4a5e9a);})[_0xcfe0('0x21')](function(_0x4f68dc){_0x27b98f[_0xcfe0('0x41')]=_0x4f68dc;return _0x27b98f;})['then'](respondWithFilteredResult(_0x134125,_0x4a5e9a))[_0xcfe0('0x42')](handleError(_0x134125,null));};exports[_0xcfe0('0x43')]=function(_0x3458a0,_0x566f18){var _0x2cac58={'raw':!![],'where':{'id':_0x3458a0[_0xcfe0('0x44')]['id']}},_0x42d8de={};_0x42d8de[_0xcfe0('0x2c')]=_[_0xcfe0('0x2e')](db[_0xcfe0('0x3e')]['rawAttributes']);_0x42d8de['query']=_['keys'](_0x3458a0[_0xcfe0('0x2d')]);_0x42d8de[_0xcfe0('0x2f')]=_[_0xcfe0('0x31')](_0x42d8de[_0xcfe0('0x2c')],_0x42d8de[_0xcfe0('0x2d')]);_0x2cac58[_0xcfe0('0x30')]=_[_0xcfe0('0x31')](_0x42d8de['model'],qs['fields'](_0x3458a0[_0xcfe0('0x2d')][_0xcfe0('0x32')]));_0x2cac58[_0xcfe0('0x30')]=_0x2cac58[_0xcfe0('0x30')][_0xcfe0('0x33')]?_0x2cac58[_0xcfe0('0x30')]:_0x42d8de['model'];if(_0x3458a0[_0xcfe0('0x2d')][_0xcfe0('0x3f')]){_0x2cac58['include']=[{'all':!![]}];}_0x2cac58=_['merge']({},_0x2cac58,_0x3458a0['options']);return db[_0xcfe0('0x3e')][_0xcfe0('0x45')](_0x2cac58)[_0xcfe0('0x21')](handleEntityNotFound(_0x566f18,null))[_0xcfe0('0x21')](respondWithResult(_0x566f18,null))[_0xcfe0('0x42')](handleError(_0x566f18,null));};exports['create']=function(_0x1a98e8,_0x24f7fc){return db[_0xcfe0('0x3e')]['create'](_0x1a98e8['body'],{})[_0xcfe0('0x21')](respondWithResult(_0x24f7fc,0xc9))['catch'](handleError(_0x24f7fc,null));};exports['update']=function(_0xc8c401,_0x55ee81){if(_0xc8c401[_0xcfe0('0x46')]['id']){delete _0xc8c401[_0xcfe0('0x46')]['id'];}return db[_0xcfe0('0x3e')][_0xcfe0('0x45')]({'where':{'id':_0xc8c401[_0xcfe0('0x44')]['id']}})[_0xcfe0('0x21')](handleEntityNotFound(_0x55ee81,null))[_0xcfe0('0x21')](saveUpdates(_0xc8c401[_0xcfe0('0x46')],null))['then'](respondWithResult(_0x55ee81,null))[_0xcfe0('0x42')](handleError(_0x55ee81,null));};exports[_0xcfe0('0x47')]=function(_0x3d2b75,_0x219e85){return db[_0xcfe0('0x3e')][_0xcfe0('0x45')]({'where':{'id':_0x3d2b75[_0xcfe0('0x44')]['id']}})[_0xcfe0('0x21')](handleEntityNotFound(_0x219e85,null))[_0xcfe0('0x21')](removeEntity(_0x219e85,null))['catch'](handleError(_0x219e85,null));};exports[_0xcfe0('0x48')]=function(_0x593f21,_0x563028){return db[_0xcfe0('0x3e')][_0xcfe0('0x48')]()[_0xcfe0('0x21')](respondWithResult(_0x563028,null))[_0xcfe0('0x42')](handleError(_0x563028,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 7d54103..7d0a408 100644 --- a/server/api/mailSubstatus/mailSubstatus.events.js +++ b/server/api/mailSubstatus/mailSubstatus.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x49e2=['emit','hook','exports','update'];(function(_0x2c18a8,_0x24eaa5){var _0x1e009a=function(_0x5dea3a){while(--_0x5dea3a){_0x2c18a8['push'](_0x2c18a8['shift']());}};_0x1e009a(++_0x24eaa5);}(_0x49e2,0x12b));var _0x249e=function(_0x1d5e48,_0x8fe109){_0x1d5e48=_0x1d5e48-0x0;var _0x428264=_0x49e2[_0x1d5e48];return _0x428264;};'use strict';var EventEmitter=require('events');var MailSubstatus=require('../../mysqldb')['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0x249e('0x0')};function emitEvent(_0x52ab91){return function(_0x2a5d00,_0x24574c,_0x17b0d6){MailSubstatusEvents[_0x249e('0x1')](_0x52ab91+':'+_0x2a5d00['id'],_0x2a5d00);MailSubstatusEvents[_0x249e('0x1')](_0x52ab91,_0x2a5d00);_0x17b0d6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0x249e('0x2')](e,emitEvent(event));}}module[_0x249e('0x3')]=MailSubstatusEvents; \ No newline at end of file +var _0x265a=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailSubstatus','setMaxListeners'];(function(_0x21c46e,_0x5a0580){var _0x1d3cbb=function(_0x427ef1){while(--_0x427ef1){_0x21c46e['push'](_0x21c46e['shift']());}};_0x1d3cbb(++_0x5a0580);}(_0x265a,0x113));var _0xa265=function(_0x530c1e,_0x3cff8c){_0x530c1e=_0x530c1e-0x0;var _0x2178a6=_0x265a[_0x530c1e];return _0x2178a6;};'use strict';var EventEmitter=require(_0xa265('0x0'));var MailSubstatus=require(_0xa265('0x1'))['db'][_0xa265('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xa265('0x3')](0x0);var events={'afterUpdate':_0xa265('0x4')};function emitEvent(_0x3a8651){return function(_0x370c83,_0x40c816,_0x4e054d){MailSubstatusEvents[_0xa265('0x5')](_0x3a8651+':'+_0x370c83['id'],_0x370c83);MailSubstatusEvents[_0xa265('0x5')](_0x3a8651,_0x370c83);_0x4e054d(null);};}for(var e in events){if(events[_0xa265('0x6')](e)){var event=events[e];MailSubstatus[_0xa265('0x7')](e,emitEvent(event));}}module[_0xa265('0x8')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 56289df..cacb1c9 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 _0x8bc3=['mail_substatuses','Condition','name','mailSubstatus','_previousDataValues','then','./mailSubstatus.attributes','exports','models','define','MailSubstatus'];(function(_0xaffa2d,_0x4b1c10){var _0x3c6a3a=function(_0x1e2cf5){while(--_0x1e2cf5){_0xaffa2d['push'](_0xaffa2d['shift']());}};_0x3c6a3a(++_0x4b1c10);}(_0x8bc3,0x8a));var _0x38bc=function(_0x57b36b,_0x452782){_0x57b36b=_0x57b36b-0x0;var _0x515125=_0x8bc3[_0x57b36b];return _0x515125;};'use strict';var attributes=require(_0x38bc('0x0'));module[_0x38bc('0x1')]=function(_0x20703d){var _0x130b8d=_0x20703d[_0x38bc('0x2')];return _0x20703d[_0x38bc('0x3')](_0x38bc('0x4'),attributes,{'tableName':_0x38bc('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x7dd1dd,_0x1f10d8,_0x549052){return _0x130b8d[_0x38bc('0x6')]['update']({'value':_0x7dd1dd[_0x38bc('0x7')]},{'where':{'field':_0x38bc('0x8'),'value':_0x7dd1dd[_0x38bc('0x9')][_0x38bc('0x7')]}})[_0x38bc('0xa')](function(){_0x549052();})['catch'](function(_0x4b9ec7){_0x549052(_0x4b9ec7);});}}});}; \ No newline at end of file +var _0xe85d=['models','define','mail_substatuses','update','name','mailSubstatus','_previousDataValues','then','catch','./mailSubstatus.attributes','exports'];(function(_0x44647c,_0xe5a07f){var _0x26adbb=function(_0x45eacb){while(--_0x45eacb){_0x44647c['push'](_0x44647c['shift']());}};_0x26adbb(++_0xe5a07f);}(_0xe85d,0x1ed));var _0xde85=function(_0x2d364e,_0x301c5e){_0x2d364e=_0x2d364e-0x0;var _0x1b9312=_0xe85d[_0x2d364e];return _0x1b9312;};'use strict';var attributes=require(_0xde85('0x0'));module[_0xde85('0x1')]=function(_0x4c881a){var _0x2ef83d=_0x4c881a[_0xde85('0x2')];return _0x4c881a[_0xde85('0x3')]('MailSubstatus',attributes,{'tableName':_0xde85('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x2fc8c8,_0x7ac15c,_0x54aa1e){return _0x2ef83d['Condition'][_0xde85('0x5')]({'value':_0x2fc8c8[_0xde85('0x6')]},{'where':{'field':_0xde85('0x7'),'value':_0x2fc8c8[_0xde85('0x8')][_0xde85('0x6')]}})[_0xde85('0x9')](function(){_0x54aa1e();})[_0xde85('0xa')](function(_0x4f4e50){_0x54aa1e(_0x4f4e50);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index e816be8..316cec9 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 _0x50e8=['error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2fdc64,_0x5e1268){var _0x2da4dd=function(_0x2f7085){while(--_0x2f7085){_0x2fdc64['push'](_0x2fdc64['shift']());}};_0x2da4dd(++_0x5e1268);}(_0x50e8,0x147));var _0x850e=function(_0x4c98b9,_0x1ad11b){_0x4c98b9=_0x4c98b9-0x0;var _0x3a257a=_0x50e8[_0x4c98b9];return _0x3a257a;};'use strict';var _=require(_0x850e('0x0'));var util=require('util');var moment=require(_0x850e('0x1'));var BPromise=require(_0x850e('0x2'));var rs=require(_0x850e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x850e('0x4'))['db'];var utils=require(_0x850e('0x5'));var logger=require(_0x850e('0x6'))(_0x850e('0x7'));var config=require('../../config/environment');var jayson=require(_0x850e('0x8'));var client=jayson[_0x850e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x305a04,_0x17dd51,_0x4fc384){return new BPromise(function(_0x5f3bb2,_0x20c6ce){return client[_0x850e('0xa')](_0x305a04,_0x4fc384)[_0x850e('0xb')](function(_0x1d0ce3){logger[_0x850e('0xc')](_0x850e('0xd'),_0x17dd51,_0x850e('0xe'));logger[_0x850e('0xf')](_0x850e('0x10'),_0x17dd51,_0x850e('0xe'),JSON[_0x850e('0x11')](_0x1d0ce3));if(_0x1d0ce3[_0x850e('0x12')]){if(_0x1d0ce3['error'][_0x850e('0x13')]===0x1f4){logger[_0x850e('0x12')](_0x850e('0xd'),_0x17dd51,_0x1d0ce3[_0x850e('0x12')][_0x850e('0x14')]);return _0x20c6ce(_0x1d0ce3[_0x850e('0x12')][_0x850e('0x14')]);}logger['error'](_0x850e('0xd'),_0x17dd51,_0x1d0ce3[_0x850e('0x12')]['message']);return _0x5f3bb2(_0x1d0ce3[_0x850e('0x12')][_0x850e('0x14')]);}else{logger[_0x850e('0xc')](_0x850e('0xd'),_0x17dd51,_0x850e('0xe'));_0x5f3bb2(_0x1d0ce3[_0x850e('0x15')]['message']);}})[_0x850e('0x16')](function(_0x524e3a){logger[_0x850e('0x12')](_0x850e('0xd'),_0x17dd51,_0x524e3a);_0x20c6ce(_0x524e3a);});});} \ No newline at end of file +var _0x128c=['request','then','info','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','MailSubstatus,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2512d5,_0x43a575){var _0x1ef3d4=function(_0x479e82){while(--_0x479e82){_0x2512d5['push'](_0x2512d5['shift']());}};_0x1ef3d4(++_0x43a575);}(_0x128c,0x96));var _0xc128=function(_0x5c688c,_0x2fa858){_0x5c688c=_0x5c688c-0x0;var _0xe48fac=_0x128c[_0x5c688c];return _0xe48fac;};'use strict';var _=require(_0xc128('0x0'));var util=require(_0xc128('0x1'));var moment=require(_0xc128('0x2'));var BPromise=require(_0xc128('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc128('0x4'))['db'];var utils=require(_0xc128('0x5'));var logger=require(_0xc128('0x6'))(_0xc128('0x7'));var config=require(_0xc128('0x8'));var jayson=require(_0xc128('0x9'));var client=jayson['client'][_0xc128('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x515c2b,_0x17fba9,_0x4e671f){return new BPromise(function(_0x450a9c,_0x44f379){return client[_0xc128('0xb')](_0x515c2b,_0x4e671f)[_0xc128('0xc')](function(_0x246c4a){logger[_0xc128('0xd')]('MailSubstatus,\x20%s,\x20%s',_0x17fba9,_0xc128('0xe'));logger[_0xc128('0xf')](_0xc128('0x10'),_0x17fba9,'request\x20sent',JSON['stringify'](_0x246c4a));if(_0x246c4a[_0xc128('0x11')]){if(_0x246c4a['error'][_0xc128('0x12')]===0x1f4){logger[_0xc128('0x11')](_0xc128('0x13'),_0x17fba9,_0x246c4a[_0xc128('0x11')][_0xc128('0x14')]);return _0x44f379(_0x246c4a[_0xc128('0x11')]['message']);}logger['error'](_0xc128('0x13'),_0x17fba9,_0x246c4a[_0xc128('0x11')]['message']);return _0x450a9c(_0x246c4a[_0xc128('0x11')][_0xc128('0x14')]);}else{logger[_0xc128('0xd')]('MailSubstatus,\x20%s,\x20%s',_0x17fba9,_0xc128('0xe'));_0x450a9c(_0x246c4a[_0xc128('0x15')][_0xc128('0x14')]);}})[_0xc128('0x16')](function(_0x36a034){logger[_0xc128('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x17fba9,_0x36a034);_0x44f379(_0x36a034);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 46360a8..d394095 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 _0x2fc0=['update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put'];(function(_0x48465c,_0x2174fd){var _0x883916=function(_0x20b714){while(--_0x20b714){_0x48465c['push'](_0x48465c['shift']());}};_0x883916(++_0x2174fd);}(_0x2fc0,0xc1));var _0x02fc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2fc0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x02fc('0x0'));var path=require('path');var timeout=require(_0x02fc('0x1'));var express=require(_0x02fc('0x2'));var router=express[_0x02fc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x02fc('0x4'));var interaction=require(_0x02fc('0x5'));var config=require(_0x02fc('0x6'));var controller=require(_0x02fc('0x7'));router[_0x02fc('0x8')]('/',auth[_0x02fc('0x9')](),controller[_0x02fc('0xa')]);router[_0x02fc('0x8')](_0x02fc('0xb'),auth[_0x02fc('0x9')](),controller[_0x02fc('0xc')]);router[_0x02fc('0x8')](_0x02fc('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x02fc('0xe')]('/',auth['isAuthenticated'](),controller[_0x02fc('0xf')]);router[_0x02fc('0x10')](_0x02fc('0xd'),auth[_0x02fc('0x9')](),controller[_0x02fc('0x11')]);router[_0x02fc('0x12')]('/:id',auth[_0x02fc('0x9')](),controller[_0x02fc('0x13')]);module[_0x02fc('0x14')]=router; \ No newline at end of file +var _0xff92=['isAuthenticated','index','describe','/:id','show','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get'];(function(_0x2b3d62,_0x409947){var _0x326b19=function(_0x2ae5da){while(--_0x2ae5da){_0x2b3d62['push'](_0x2b3d62['shift']());}};_0x326b19(++_0x409947);}(_0xff92,0xc8));var _0x2ff9=function(_0x1b6686,_0x50474c){_0x1b6686=_0x1b6686-0x0;var _0x172469=_0xff92[_0x1b6686];return _0x172469;};'use strict';var multer=require(_0x2ff9('0x0'));var util=require(_0x2ff9('0x1'));var path=require('path');var timeout=require(_0x2ff9('0x2'));var express=require(_0x2ff9('0x3'));var router=express[_0x2ff9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2ff9('0x5'));var config=require(_0x2ff9('0x6'));var controller=require(_0x2ff9('0x7'));router[_0x2ff9('0x8')]('/',auth[_0x2ff9('0x9')](),controller[_0x2ff9('0xa')]);router[_0x2ff9('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x2ff9('0xb')]);router[_0x2ff9('0x8')](_0x2ff9('0xc'),auth[_0x2ff9('0x9')](),controller[_0x2ff9('0xd')]);router['post']('/',auth[_0x2ff9('0x9')](),controller['create']);router[_0x2ff9('0xe')]('/:id',auth[_0x2ff9('0x9')](),controller[_0x2ff9('0xf')]);router[_0x2ff9('0x10')](_0x2ff9('0xc'),auth[_0x2ff9('0x9')](),controller[_0x2ff9('0x11')]);module[_0x2ff9('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 30241e6..36010f7 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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1fb6c2,_0x9ff97f){_0x1fb6c2=_0x1fb6c2-0x0;var _0x366ef8=_0xb43b[_0x1fb6c2];return _0x366ef8;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x499297,_0xbae5dc){var _0x53578b=function(_0x3126b7){while(--_0x3126b7){_0x499297['push'](_0x499297['shift']());}};_0x53578b(++_0xbae5dc);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x555b2f,_0x43b622){_0x555b2f=_0x555b2f-0x0;var _0x81c0a6=_0xf3cd[_0x555b2f];return _0x81c0a6;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 6a13e13..3336576 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 _0x66ef=['ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','sendStatus','error','stack','name','send','MailTransferReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','length','create','body','find','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x240758,_0x26c5c9){var _0x90e7e5=function(_0x49e059){while(--_0x49e059){_0x240758['push'](_0x240758['shift']());}};_0x90e7e5(++_0x26c5c9);}(_0x66ef,0x162));var _0xf66e=function(_0x2952c4,_0x4201ad){_0x2952c4=_0x2952c4-0x0;var _0x334929=_0x66ef[_0x2952c4];return _0x334929;};'use strict';var emlformat=require(_0xf66e('0x0'));var rimraf=require(_0xf66e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf66e('0x2'));var rp=require(_0xf66e('0x3'));var moment=require(_0xf66e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf66e('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf66e('0x6'));var csv=require(_0xf66e('0x7'));var ejs=require(_0xf66e('0x8'));var fs=require('fs');var fs_extra=require(_0xf66e('0x9'));var _=require(_0xf66e('0xa'));var squel=require(_0xf66e('0xb'));var crypto=require('crypto');var jsforce=require(_0xf66e('0xc'));var deskjs=require(_0xf66e('0xd'));var toCsv=require(_0xf66e('0x7'));var querystring=require(_0xf66e('0xe'));var Papa=require(_0xf66e('0xf'));var Redis=require(_0xf66e('0x10'));var authService=require(_0xf66e('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf66e('0x12'));var logger=require('../../config/logger')(_0xf66e('0x13'));var utils=require(_0xf66e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf66e('0x15'));var db=require(_0xf66e('0x16'))['db'];function respondWithStatusCode(_0x3c32be,_0x336275){_0x336275=_0x336275||0xcc;return function(_0x2a2b81){if(_0x2a2b81){return _0x3c32be['sendStatus'](_0x336275);}return _0x3c32be[_0xf66e('0x17')](_0x336275)[_0xf66e('0x18')]();};}function respondWithResult(_0x2259c2,_0x2a150b){_0x2a150b=_0x2a150b||0xc8;return function(_0x10b65d){if(_0x10b65d){return _0x2259c2['status'](_0x2a150b)[_0xf66e('0x19')](_0x10b65d);}};}function respondWithFilteredResult(_0x408a5a,_0x411976){return function(_0x46cfca){if(_0x46cfca){var _0x14a344=typeof _0x411976[_0xf66e('0x1a')]==='undefined'&&typeof _0x411976['limit']===_0xf66e('0x1b');var _0x5b11c7=_0x46cfca['count'];var _0x4e5494=_0x14a344?0x0:_0x411976['offset'];var _0x392e84=_0x14a344?_0x46cfca[_0xf66e('0x1c')]:_0x411976[_0xf66e('0x1a')]+_0x411976['limit'];var _0x4a06e;if(_0x392e84>=_0x5b11c7){_0x392e84=_0x5b11c7;_0x4a06e=0xc8;}else{_0x4a06e=0xce;}_0x408a5a['status'](_0x4a06e);return _0x408a5a[_0xf66e('0x1d')](_0xf66e('0x1e'),_0x4e5494+'-'+_0x392e84+'/'+_0x5b11c7)[_0xf66e('0x19')](_0x46cfca);}return null;};}function patchUpdates(_0xeb8173){return function(_0x55cb2d){try{jsonpatch[_0xf66e('0x1f')](_0x55cb2d,_0xeb8173,!![]);}catch(_0x5b3e75){return BPromise['reject'](_0x5b3e75);}return _0x55cb2d[_0xf66e('0x20')]();};}function saveUpdates(_0xf3e558,_0x993f5e){return function(_0x1bf328){if(_0x1bf328){return _0x1bf328[_0xf66e('0x21')](_0xf3e558)['then'](function(_0x4c27a4){return _0x4c27a4;});}return null;};}function removeEntity(_0x2e397d,_0x5072d6){return function(_0x267bbe){if(_0x267bbe){return _0x267bbe['destroy']()[_0xf66e('0x22')](function(){_0x2e397d[_0xf66e('0x17')](0xcc)[_0xf66e('0x18')]();});}};}function handleEntityNotFound(_0x13ba3f,_0x48ad51){return function(_0x3f39fb){if(!_0x3f39fb){_0x13ba3f[_0xf66e('0x23')](0x194);}return _0x3f39fb;};}function handleError(_0x3fff8c,_0x500bb3){_0x500bb3=_0x500bb3||0x1f4;return function(_0x26796a){logger[_0xf66e('0x24')](_0x26796a[_0xf66e('0x25')]);if(_0x26796a[_0xf66e('0x26')]){delete _0x26796a[_0xf66e('0x26')];}_0x3fff8c['status'](_0x500bb3)[_0xf66e('0x27')](_0x26796a);};}exports['index']=function(_0x54f9b3,_0x4b9427){var _0x3edc21={},_0x26029b={},_0x3d1281={'count':0x0,'rows':[]};var _0x3d9216=_['map'](db[_0xf66e('0x28')][_0xf66e('0x29')],function(_0x36d544){return{'name':_0x36d544[_0xf66e('0x2a')],'type':_0x36d544[_0xf66e('0x2b')][_0xf66e('0x2c')]};});_0x26029b[_0xf66e('0x2d')]=_[_0xf66e('0x2e')](_0x3d9216,_0xf66e('0x26'));_0x26029b[_0xf66e('0x2f')]=_[_0xf66e('0x30')](_0x54f9b3[_0xf66e('0x2f')]);_0x26029b[_0xf66e('0x31')]=_[_0xf66e('0x32')](_0x26029b['model'],_0x26029b[_0xf66e('0x2f')]);_0x3edc21[_0xf66e('0x33')]=_[_0xf66e('0x32')](_0x26029b['model'],qs[_0xf66e('0x34')](_0x54f9b3[_0xf66e('0x2f')][_0xf66e('0x34')]));_0x3edc21['attributes']=_0x3edc21[_0xf66e('0x33')]['length']?_0x3edc21[_0xf66e('0x33')]:_0x26029b[_0xf66e('0x2d')];if(!_0x54f9b3['query']['hasOwnProperty'](_0xf66e('0x35'))){_0x3edc21[_0xf66e('0x36')]=qs[_0xf66e('0x36')](_0x54f9b3[_0xf66e('0x2f')][_0xf66e('0x36')]);_0x3edc21[_0xf66e('0x1a')]=qs[_0xf66e('0x1a')](_0x54f9b3['query'][_0xf66e('0x1a')]);}_0x3edc21[_0xf66e('0x37')]=qs['sort'](_0x54f9b3[_0xf66e('0x2f')][_0xf66e('0x38')]);_0x3edc21[_0xf66e('0x39')]=qs['filters'](_[_0xf66e('0x3a')](_0x54f9b3[_0xf66e('0x2f')],_0x26029b[_0xf66e('0x31')]),_0x3d9216);if(_0x54f9b3[_0xf66e('0x2f')][_0xf66e('0x3b')]){_0x3edc21[_0xf66e('0x39')]=_[_0xf66e('0x3c')](_0x3edc21[_0xf66e('0x39')],{'$or':_[_0xf66e('0x2e')](_0x3d9216,function(_0x320070){if(_0x320070[_0xf66e('0x2b')]!==_0xf66e('0x3d')){var _0x3260d0={};_0x3260d0[_0x320070[_0xf66e('0x26')]]={'$like':'%'+_0x54f9b3['query']['filter']+'%'};return _0x3260d0;}})});}_0x3edc21=_[_0xf66e('0x3c')]({},_0x3edc21,_0x54f9b3[_0xf66e('0x3e')]);var _0x59e412={'where':_0x3edc21[_0xf66e('0x39')]};return db[_0xf66e('0x28')]['count'](_0x59e412)['then'](function(_0x2ec0b8){_0x3d1281['count']=_0x2ec0b8;if(_0x54f9b3['query']['includeAll']){_0x3edc21[_0xf66e('0x3f')]=[{'all':!![]}];}return db[_0xf66e('0x28')]['findAll'](_0x3edc21);})[_0xf66e('0x22')](function(_0x29134c){_0x3d1281[_0xf66e('0x40')]=_0x29134c;return _0x3d1281;})['then'](respondWithFilteredResult(_0x4b9427,_0x3edc21))[_0xf66e('0x41')](handleError(_0x4b9427,null));};exports[_0xf66e('0x42')]=function(_0x4d3ce0,_0x3fba7e){var _0xfb7e1a={'raw':!![],'where':{'id':_0x4d3ce0[_0xf66e('0x43')]['id']}},_0x4370da={};_0x4370da[_0xf66e('0x2d')]=_[_0xf66e('0x30')](db['MailTransferReport'][_0xf66e('0x29')]);_0x4370da[_0xf66e('0x2f')]=_[_0xf66e('0x30')](_0x4d3ce0[_0xf66e('0x2f')]);_0x4370da[_0xf66e('0x31')]=_['intersection'](_0x4370da[_0xf66e('0x2d')],_0x4370da['query']);_0xfb7e1a[_0xf66e('0x33')]=_[_0xf66e('0x32')](_0x4370da['model'],qs[_0xf66e('0x34')](_0x4d3ce0[_0xf66e('0x2f')][_0xf66e('0x34')]));_0xfb7e1a[_0xf66e('0x33')]=_0xfb7e1a[_0xf66e('0x33')][_0xf66e('0x44')]?_0xfb7e1a['attributes']:_0x4370da['model'];if(_0x4d3ce0['query']['includeAll']){_0xfb7e1a[_0xf66e('0x3f')]=[{'all':!![]}];}_0xfb7e1a=_[_0xf66e('0x3c')]({},_0xfb7e1a,_0x4d3ce0['options']);return db[_0xf66e('0x28')]['find'](_0xfb7e1a)[_0xf66e('0x22')](handleEntityNotFound(_0x3fba7e,null))[_0xf66e('0x22')](respondWithResult(_0x3fba7e,null))['catch'](handleError(_0x3fba7e,null));};exports[_0xf66e('0x45')]=function(_0x35f901,_0x5d281f){return db[_0xf66e('0x28')][_0xf66e('0x45')](_0x35f901[_0xf66e('0x46')],{})[_0xf66e('0x22')](respondWithResult(_0x5d281f,0xc9))['catch'](handleError(_0x5d281f,null));};exports[_0xf66e('0x21')]=function(_0x2d8876,_0x47abcd){if(_0x2d8876['body']['id']){delete _0x2d8876['body']['id'];}return db['MailTransferReport'][_0xf66e('0x47')]({'where':{'id':_0x2d8876[_0xf66e('0x43')]['id']}})[_0xf66e('0x22')](handleEntityNotFound(_0x47abcd,null))[_0xf66e('0x22')](saveUpdates(_0x2d8876[_0xf66e('0x46')],null))['then'](respondWithResult(_0x47abcd,null))['catch'](handleError(_0x47abcd,null));};exports[_0xf66e('0x48')]=function(_0x4f2329,_0x1a2441){return db[_0xf66e('0x28')][_0xf66e('0x47')]({'where':{'id':_0x4f2329[_0xf66e('0x43')]['id']}})[_0xf66e('0x22')](handleEntityNotFound(_0x1a2441,null))[_0xf66e('0x22')](removeEntity(_0x1a2441,null))[_0xf66e('0x41')](handleError(_0x1a2441,null));};exports[_0xf66e('0x49')]=function(_0x4b137a,_0x5182d6){return db[_0xf66e('0x28')][_0xf66e('0x49')]()['then'](respondWithResult(_0x5182d6,null))[_0xf66e('0x41')](handleError(_0x5182d6,null));}; \ No newline at end of file +var _0x75a3=['save','update','then','error','stack','name','send','index','MailTransferReport','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','where','pick','merge','VIRTUAL','filter','options','includeAll','catch','params','include','create','body','find','destroy','describe','eml-format','rimraf','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply'];(function(_0x492535,_0x46524a){var _0x256620=function(_0x3015f8){while(--_0x3015f8){_0x492535['push'](_0x492535['shift']());}};_0x256620(++_0x46524a);}(_0x75a3,0xf7));var _0x375a=function(_0xd05bb7,_0x7fe7cb){_0xd05bb7=_0xd05bb7-0x0;var _0x3a9dfb=_0x75a3[_0xd05bb7];return _0x3a9dfb;};'use strict';var emlformat=require(_0x375a('0x0'));var rimraf=require(_0x375a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x375a('0x2'));var Mustache=require(_0x375a('0x3'));var util=require(_0x375a('0x4'));var path=require(_0x375a('0x5'));var sox=require('sox');var csv=require(_0x375a('0x6'));var ejs=require(_0x375a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x375a('0x8'));var squel=require(_0x375a('0x9'));var crypto=require(_0x375a('0xa'));var jsforce=require(_0x375a('0xb'));var deskjs=require(_0x375a('0xc'));var toCsv=require(_0x375a('0x6'));var querystring=require('querystring');var Papa=require(_0x375a('0xd'));var Redis=require(_0x375a('0xe'));var authService=require(_0x375a('0xf'));var qs=require(_0x375a('0x10'));var as=require(_0x375a('0x11'));var hardwareService=require(_0x375a('0x12'));var logger=require(_0x375a('0x13'))(_0x375a('0x14'));var utils=require(_0x375a('0x15'));var config=require(_0x375a('0x16'));var licenseUtil=require(_0x375a('0x17'));var db=require(_0x375a('0x18'))['db'];function respondWithStatusCode(_0x37295b,_0x2cb61a){_0x2cb61a=_0x2cb61a||0xcc;return function(_0x152471){if(_0x152471){return _0x37295b[_0x375a('0x19')](_0x2cb61a);}return _0x37295b[_0x375a('0x1a')](_0x2cb61a)['end']();};}function respondWithResult(_0x531a22,_0x473ba0){_0x473ba0=_0x473ba0||0xc8;return function(_0x246cf5){if(_0x246cf5){return _0x531a22[_0x375a('0x1a')](_0x473ba0)[_0x375a('0x1b')](_0x246cf5);}};}function respondWithFilteredResult(_0x29cf05,_0x196031){return function(_0x490b72){if(_0x490b72){var _0x5e8957=typeof _0x196031[_0x375a('0x1c')]===_0x375a('0x1d')&&typeof _0x196031[_0x375a('0x1e')]==='undefined';var _0x146a8e=_0x490b72[_0x375a('0x1f')];var _0x33b5fa=_0x5e8957?0x0:_0x196031[_0x375a('0x1c')];var _0xdde68d=_0x5e8957?_0x490b72[_0x375a('0x1f')]:_0x196031[_0x375a('0x1c')]+_0x196031[_0x375a('0x1e')];var _0x17e059;if(_0xdde68d>=_0x146a8e){_0xdde68d=_0x146a8e;_0x17e059=0xc8;}else{_0x17e059=0xce;}_0x29cf05[_0x375a('0x1a')](_0x17e059);return _0x29cf05['set']('Content-Range',_0x33b5fa+'-'+_0xdde68d+'/'+_0x146a8e)[_0x375a('0x1b')](_0x490b72);}return null;};}function patchUpdates(_0x40c036){return function(_0x2d0c3c){try{jsonpatch[_0x375a('0x20')](_0x2d0c3c,_0x40c036,!![]);}catch(_0x3aa3d4){return BPromise['reject'](_0x3aa3d4);}return _0x2d0c3c[_0x375a('0x21')]();};}function saveUpdates(_0x4c78c8,_0x45c469){return function(_0x257643){if(_0x257643){return _0x257643[_0x375a('0x22')](_0x4c78c8)[_0x375a('0x23')](function(_0x20a801){return _0x20a801;});}return null;};}function removeEntity(_0x245122,_0x35277e){return function(_0x57eda4){if(_0x57eda4){return _0x57eda4['destroy']()['then'](function(){_0x245122['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5053f6,_0x2ff076){return function(_0x2987b4){if(!_0x2987b4){_0x5053f6[_0x375a('0x19')](0x194);}return _0x2987b4;};}function handleError(_0x536fa1,_0xd46439){_0xd46439=_0xd46439||0x1f4;return function(_0x42bf81){logger[_0x375a('0x24')](_0x42bf81[_0x375a('0x25')]);if(_0x42bf81[_0x375a('0x26')]){delete _0x42bf81['name'];}_0x536fa1['status'](_0xd46439)[_0x375a('0x27')](_0x42bf81);};}exports[_0x375a('0x28')]=function(_0x528404,_0x58239c){var _0xfc3875={},_0x294db7={},_0x37a77d={'count':0x0,'rows':[]};var _0x539052=_['map'](db[_0x375a('0x29')][_0x375a('0x2a')],function(_0x2bb340){return{'name':_0x2bb340['fieldName'],'type':_0x2bb340[_0x375a('0x2b')][_0x375a('0x2c')]};});_0x294db7['model']=_['map'](_0x539052,_0x375a('0x26'));_0x294db7[_0x375a('0x2d')]=_[_0x375a('0x2e')](_0x528404[_0x375a('0x2d')]);_0x294db7[_0x375a('0x2f')]=_[_0x375a('0x30')](_0x294db7[_0x375a('0x31')],_0x294db7[_0x375a('0x2d')]);_0xfc3875[_0x375a('0x32')]=_[_0x375a('0x30')](_0x294db7[_0x375a('0x31')],qs[_0x375a('0x33')](_0x528404[_0x375a('0x2d')]['fields']));_0xfc3875['attributes']=_0xfc3875['attributes'][_0x375a('0x34')]?_0xfc3875[_0x375a('0x32')]:_0x294db7['model'];if(!_0x528404['query'][_0x375a('0x35')](_0x375a('0x36'))){_0xfc3875[_0x375a('0x1e')]=qs['limit'](_0x528404[_0x375a('0x2d')][_0x375a('0x1e')]);_0xfc3875['offset']=qs[_0x375a('0x1c')](_0x528404[_0x375a('0x2d')]['offset']);}_0xfc3875['order']=qs['sort'](_0x528404[_0x375a('0x2d')]['sort']);_0xfc3875[_0x375a('0x37')]=qs[_0x375a('0x2f')](_[_0x375a('0x38')](_0x528404['query'],_0x294db7[_0x375a('0x2f')]),_0x539052);if(_0x528404[_0x375a('0x2d')]['filter']){_0xfc3875[_0x375a('0x37')]=_[_0x375a('0x39')](_0xfc3875[_0x375a('0x37')],{'$or':_['map'](_0x539052,function(_0x59a604){if(_0x59a604['type']!==_0x375a('0x3a')){var _0x4506ef={};_0x4506ef[_0x59a604[_0x375a('0x26')]]={'$like':'%'+_0x528404['query'][_0x375a('0x3b')]+'%'};return _0x4506ef;}})});}_0xfc3875=_[_0x375a('0x39')]({},_0xfc3875,_0x528404[_0x375a('0x3c')]);var _0x1555cc={'where':_0xfc3875['where']};return db[_0x375a('0x29')][_0x375a('0x1f')](_0x1555cc)[_0x375a('0x23')](function(_0x1c7b8a){_0x37a77d['count']=_0x1c7b8a;if(_0x528404[_0x375a('0x2d')][_0x375a('0x3d')]){_0xfc3875['include']=[{'all':!![]}];}return db[_0x375a('0x29')]['findAll'](_0xfc3875);})[_0x375a('0x23')](function(_0x46e01b){_0x37a77d['rows']=_0x46e01b;return _0x37a77d;})[_0x375a('0x23')](respondWithFilteredResult(_0x58239c,_0xfc3875))[_0x375a('0x3e')](handleError(_0x58239c,null));};exports['show']=function(_0x141ea3,_0x549441){var _0x224bee={'raw':!![],'where':{'id':_0x141ea3[_0x375a('0x3f')]['id']}},_0x4598fe={};_0x4598fe[_0x375a('0x31')]=_[_0x375a('0x2e')](db[_0x375a('0x29')][_0x375a('0x2a')]);_0x4598fe[_0x375a('0x2d')]=_[_0x375a('0x2e')](_0x141ea3[_0x375a('0x2d')]);_0x4598fe['filters']=_[_0x375a('0x30')](_0x4598fe[_0x375a('0x31')],_0x4598fe[_0x375a('0x2d')]);_0x224bee['attributes']=_[_0x375a('0x30')](_0x4598fe[_0x375a('0x31')],qs['fields'](_0x141ea3[_0x375a('0x2d')]['fields']));_0x224bee['attributes']=_0x224bee[_0x375a('0x32')][_0x375a('0x34')]?_0x224bee[_0x375a('0x32')]:_0x4598fe[_0x375a('0x31')];if(_0x141ea3[_0x375a('0x2d')][_0x375a('0x3d')]){_0x224bee[_0x375a('0x40')]=[{'all':!![]}];}_0x224bee=_[_0x375a('0x39')]({},_0x224bee,_0x141ea3[_0x375a('0x3c')]);return db['MailTransferReport']['find'](_0x224bee)['then'](handleEntityNotFound(_0x549441,null))[_0x375a('0x23')](respondWithResult(_0x549441,null))[_0x375a('0x3e')](handleError(_0x549441,null));};exports[_0x375a('0x41')]=function(_0x2b3cfa,_0x4b5961){return db['MailTransferReport'][_0x375a('0x41')](_0x2b3cfa[_0x375a('0x42')],{})['then'](respondWithResult(_0x4b5961,0xc9))[_0x375a('0x3e')](handleError(_0x4b5961,null));};exports[_0x375a('0x22')]=function(_0x376f27,_0x2a8519){if(_0x376f27[_0x375a('0x42')]['id']){delete _0x376f27[_0x375a('0x42')]['id'];}return db[_0x375a('0x29')][_0x375a('0x43')]({'where':{'id':_0x376f27['params']['id']}})['then'](handleEntityNotFound(_0x2a8519,null))[_0x375a('0x23')](saveUpdates(_0x376f27['body'],null))[_0x375a('0x23')](respondWithResult(_0x2a8519,null))[_0x375a('0x3e')](handleError(_0x2a8519,null));};exports[_0x375a('0x44')]=function(_0x329897,_0x48a404){return db[_0x375a('0x29')][_0x375a('0x43')]({'where':{'id':_0x329897['params']['id']}})[_0x375a('0x23')](handleEntityNotFound(_0x48a404,null))[_0x375a('0x23')](removeEntity(_0x48a404,null))[_0x375a('0x3e')](handleError(_0x48a404,null));};exports[_0x375a('0x45')]=function(_0x26b806,_0x18b1c3){return db[_0x375a('0x29')][_0x375a('0x45')]()[_0x375a('0x23')](respondWithResult(_0x18b1c3,null))['catch'](handleError(_0x18b1c3,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 4360318..2c448f8 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 _0xcd4e=['path','../../config/environment','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','request-promise'];(function(_0x22ed4a,_0x323c7a){var _0x6db5fc=function(_0x5b5d02){while(--_0x5b5d02){_0x22ed4a['push'](_0x22ed4a['shift']());}};_0x6db5fc(++_0x323c7a);}(_0xcd4e,0x187));var _0xecd4=function(_0x1c6873,_0x3960a0){_0x1c6873=_0x1c6873-0x0;var _0x2515b5=_0xcd4e[_0x1c6873];return _0x2515b5;};'use strict';var _=require(_0xecd4('0x0'));var util=require(_0xecd4('0x1'));var logger=require(_0xecd4('0x2'))(_0xecd4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xecd4('0x4'));var fs=require('fs');var path=require(_0xecd4('0x5'));var rimraf=require('rimraf');var config=require(_0xecd4('0x6'));var attributes=require('./mailTransferReport.attributes');module[_0xecd4('0x7')]=function(_0x47f6ae,_0x41dd0c){return _0x47f6ae[_0xecd4('0x8')](_0xecd4('0x9'),attributes,{'tableName':_0xecd4('0xa'),'paranoid':![],'indexes':[{'name':_0xecd4('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6d65=['exports','MailTransferReport','uniqueid','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','./mailTransferReport.attributes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6d65,0x100));var _0x56d6=function(_0x163b3f,_0x45bf39){_0x163b3f=_0x163b3f-0x0;var _0x591af1=_0x6d65[_0x163b3f];return _0x591af1;};'use strict';var _=require(_0x56d6('0x0'));var util=require(_0x56d6('0x1'));var logger=require('../../config/logger')(_0x56d6('0x2'));var moment=require('moment');var BPromise=require(_0x56d6('0x3'));var rp=require(_0x56d6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x56d6('0x5'));var config=require(_0x56d6('0x6'));var attributes=require(_0x56d6('0x7'));module[_0x56d6('0x8')]=function(_0x17f94d,_0x2febbb){return _0x17f94d['define'](_0x56d6('0x9'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x56d6('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index d5a3e9a..6a59de6 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 _0xd1d8=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util'];(function(_0xf297f4,_0xd19ede){var _0x3de69a=function(_0x3b6a09){while(--_0x3b6a09){_0xf297f4['push'](_0xf297f4['shift']());}};_0x3de69a(++_0xd19ede);}(_0xd1d8,0x92));var _0x8d1d=function(_0x10d3c2,_0x1f5142){_0x10d3c2=_0x10d3c2-0x0;var _0x4208aa=_0xd1d8[_0x10d3c2];return _0x4208aa;};'use strict';var _=require('lodash');var util=require(_0x8d1d('0x0'));var moment=require(_0x8d1d('0x1'));var BPromise=require(_0x8d1d('0x2'));var rs=require(_0x8d1d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8d1d('0x4'))['db'];var utils=require(_0x8d1d('0x5'));var logger=require('../../config/logger')(_0x8d1d('0x6'));var config=require(_0x8d1d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8d1d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x225017,_0x175783,_0x53914f){return new BPromise(function(_0x227e89,_0x1e7d43){return client['request'](_0x225017,_0x53914f)[_0x8d1d('0x9')](function(_0x3e3403){logger[_0x8d1d('0xa')](_0x8d1d('0xb'),_0x175783,_0x8d1d('0xc'));logger[_0x8d1d('0xd')](_0x8d1d('0xe'),_0x175783,'request\x20sent',JSON[_0x8d1d('0xf')](_0x3e3403));if(_0x3e3403[_0x8d1d('0x10')]){if(_0x3e3403[_0x8d1d('0x10')][_0x8d1d('0x11')]===0x1f4){logger['error'](_0x8d1d('0xb'),_0x175783,_0x3e3403[_0x8d1d('0x10')][_0x8d1d('0x12')]);return _0x1e7d43(_0x3e3403[_0x8d1d('0x10')][_0x8d1d('0x12')]);}logger[_0x8d1d('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x175783,_0x3e3403['error'][_0x8d1d('0x12')]);return _0x227e89(_0x3e3403[_0x8d1d('0x10')][_0x8d1d('0x12')]);}else{logger[_0x8d1d('0xa')](_0x8d1d('0xb'),_0x175783,_0x8d1d('0xc'));_0x227e89(_0x3e3403[_0x8d1d('0x13')][_0x8d1d('0x12')]);}})[_0x8d1d('0x14')](function(_0xc127f7){logger[_0x8d1d('0x10')](_0x8d1d('0xb'),_0x175783,_0xc127f7);_0x1e7d43(_0xc127f7);});});} \ No newline at end of file +var _0x5954=['lodash','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x51e5c6,_0x228eb1){var _0x12be06=function(_0x22566b){while(--_0x22566b){_0x51e5c6['push'](_0x51e5c6['shift']());}};_0x12be06(++_0x228eb1);}(_0x5954,0x98));var _0x4595=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5954[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x4595('0x0'));var util=require('util');var moment=require(_0x4595('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4595('0x2'))['db'];var utils=require(_0x4595('0x3'));var logger=require(_0x4595('0x4'))(_0x4595('0x5'));var config=require(_0x4595('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4595('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x396370,_0x5de20f,_0x48150a){return new BPromise(function(_0x4c8536,_0x235acb){return client['request'](_0x396370,_0x48150a)[_0x4595('0x8')](function(_0x28e949){logger[_0x4595('0x9')](_0x4595('0xa'),_0x5de20f,_0x4595('0xb'));logger[_0x4595('0xc')](_0x4595('0xd'),_0x5de20f,_0x4595('0xb'),JSON[_0x4595('0xe')](_0x28e949));if(_0x28e949[_0x4595('0xf')]){if(_0x28e949[_0x4595('0xf')]['code']===0x1f4){logger['error'](_0x4595('0xa'),_0x5de20f,_0x28e949[_0x4595('0xf')]['message']);return _0x235acb(_0x28e949['error'][_0x4595('0x10')]);}logger[_0x4595('0xf')](_0x4595('0xa'),_0x5de20f,_0x28e949[_0x4595('0xf')][_0x4595('0x10')]);return _0x4c8536(_0x28e949['error']['message']);}else{logger[_0x4595('0x9')](_0x4595('0xa'),_0x5de20f,'request\x20sent');_0x4c8536(_0x28e949[_0x4595('0x11')][_0x4595('0x10')]);}})[_0x4595('0x12')](function(_0x2bc538){logger['error'](_0x4595('0xa'),_0x5de20f,_0x2bc538);_0x235acb(_0x2bc538);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index bfc2eca..59dd71d 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 _0xef2b=['put','/:id','update','delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0xef2b,0x1e9));var _0xbef2=function(_0x1fa2e3,_0x2b920c){_0x1fa2e3=_0x1fa2e3-0x0;var _0x5d1d52=_0xef2b[_0x1fa2e3];return _0x5d1d52;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbef2('0x0'));var timeout=require('connect-timeout');var express=require(_0xbef2('0x1'));var router=express[_0xbef2('0x2')]();var fs_extra=require(_0xbef2('0x3'));var auth=require(_0xbef2('0x4'));var interaction=require(_0xbef2('0x5'));var config=require(_0xbef2('0x6'));var controller=require('./memberReport.controller');router[_0xbef2('0x7')]('/',auth[_0xbef2('0x8')](),controller[_0xbef2('0x9')]);router[_0xbef2('0x7')](_0xbef2('0xa'),auth[_0xbef2('0x8')](),controller[_0xbef2('0xb')]);router[_0xbef2('0x7')]('/:id',auth[_0xbef2('0x8')](),controller[_0xbef2('0xc')]);router[_0xbef2('0xd')]('/',auth[_0xbef2('0x8')](),controller[_0xbef2('0xe')]);router[_0xbef2('0xf')](_0xbef2('0x10'),auth[_0xbef2('0x8')](),controller[_0xbef2('0x11')]);router[_0xbef2('0x12')]('/:id',auth[_0xbef2('0x8')](),controller[_0xbef2('0x13')]);module[_0xbef2('0x14')]=router; \ No newline at end of file +var _0xb9ce=['/describe','isAuthenticated','describe','/:id','show','post','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0xb9ce,0x145));var _0xeb9c=function(_0x2cc3a3,_0x32cdd9){_0x2cc3a3=_0x2cc3a3-0x0;var _0x48652f=_0xb9ce[_0x2cc3a3];return _0x48652f;};'use strict';var multer=require(_0xeb9c('0x0'));var util=require(_0xeb9c('0x1'));var path=require(_0xeb9c('0x2'));var timeout=require(_0xeb9c('0x3'));var express=require('express');var router=express[_0xeb9c('0x4')]();var fs_extra=require(_0xeb9c('0x5'));var auth=require(_0xeb9c('0x6'));var interaction=require(_0xeb9c('0x7'));var config=require(_0xeb9c('0x8'));var controller=require(_0xeb9c('0x9'));router[_0xeb9c('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xeb9c('0xb'),auth[_0xeb9c('0xc')](),controller[_0xeb9c('0xd')]);router['get'](_0xeb9c('0xe'),auth[_0xeb9c('0xc')](),controller[_0xeb9c('0xf')]);router[_0xeb9c('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xeb9c('0x11')]('/:id',auth[_0xeb9c('0xc')](),controller['update']);router[_0xeb9c('0x12')](_0xeb9c('0xe'),auth['isAuthenticated'](),controller[_0xeb9c('0x13')]);module[_0xeb9c('0x14')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index b5e91ce..3dd03cc 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 _0x6787=['talk:[queue]','moment','exports','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue','enterAt','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]'];(function(_0x492535,_0x46524a){var _0x256620=function(_0x3015f8){while(--_0x3015f8){_0x492535['push'](_0x492535['shift']());}};_0x256620(++_0x46524a);}(_0x6787,0xb1));var _0x7678=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x6787[_0x5c351c];return _0x26f3b3;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x7678('0x0'));module[_0x7678('0x1')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x7678('0x2')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x7678('0x2')],'defaultValue':_0x7678('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x7678('0x4')]},'enterAt':{'type':Sequelize[_0x7678('0x5')]},'exitAt':{'type':Sequelize[_0x7678('0x5')],'set':function(_0x958f22){var _0xc9e928=moment(_0x958f22);var _0x5e3d21=moment(this[_0x7678('0x6')](_0x7678('0x7')));var _0x4613f2=_0xc9e928['diff'](_0x5e3d21,_0x7678('0x8'));this[_0x7678('0x9')](_0x7678('0xa'),_0x958f22);this[_0x7678('0x9')](_0x7678('0xb'),_0x4613f2>=0x0?_0x4613f2:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x7678('0xc')},'data2':{'type':Sequelize[_0x7678('0x2')],'comment':_0x7678('0xd')},'data3':{'type':Sequelize['STRING'],'comment':_0x7678('0xe')},'data4':{'type':Sequelize[_0x7678('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x7678('0x2')],'comment':_0x7678('0xf')},'role':{'type':Sequelize[_0x7678('0x2')]},'internal':{'type':Sequelize[_0x7678('0x4')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc489=['talk:[dial\x20string]','sequelize','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','diff','seconds','setDataValue','duration','talk:[start]','talk:[destination]'];(function(_0x31ca9c,_0x3e4cb3){var _0x421a1b=function(_0x32eebe){while(--_0x32eebe){_0x31ca9c['push'](_0x31ca9c['shift']());}};_0x421a1b(++_0x3e4cb3);}(_0xc489,0x135));var _0x9c48=function(_0x24f3d3,_0xb13780){_0x24f3d3=_0x24f3d3-0x0;var _0x2b9655=_0xc489[_0x24f3d3];return _0x2b9655;};'use strict';var Sequelize=require(_0x9c48('0x0'));var moment=require('moment');module['exports']={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x9c48('0x1')]},'type':{'type':Sequelize[_0x9c48('0x1')],'defaultValue':_0x9c48('0x2'),'comment':_0x9c48('0x3')},'duration':{'type':Sequelize[_0x9c48('0x4')]},'enterAt':{'type':Sequelize[_0x9c48('0x5')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x1a2059){var _0x9172c3=moment(_0x1a2059);var _0x1bee15=moment(this['getDataValue'](_0x9c48('0x6')));var _0x392e72=_0x9172c3[_0x9c48('0x7')](_0x1bee15,_0x9c48('0x8'));this[_0x9c48('0x9')]('exitAt',_0x1a2059);this[_0x9c48('0x9')](_0x9c48('0xa'),_0x392e72>=0x0?_0x392e72:null);}},'data1':{'type':Sequelize['STRING'],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x9c48('0x1')],'comment':_0x9c48('0xb')},'data3':{'type':Sequelize[_0x9c48('0x1')],'comment':_0x9c48('0xc')},'data4':{'type':Sequelize['STRING'],'comment':_0x9c48('0xd')},'data5':{'type':Sequelize[_0x9c48('0x1')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x9c48('0x1')]},'internal':{'type':Sequelize[_0x9c48('0x4')]},'uniqueid':{'type':Sequelize[_0x9c48('0x1')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 8c3eefc..df93670 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 _0x9957=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x25e905,_0x42f080){var _0x4d1f16=function(_0x575f79){while(--_0x575f79){_0x25e905['push'](_0x25e905['shift']());}};_0x4d1f16(++_0x42f080);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['MemberReport']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['MemberReport'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['MemberReport'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file +var _0xedd9=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','name','query'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xedd9,0xfc));var _0x9edd=function(_0x4d9dea,_0x3c09a1){_0x4d9dea=_0x4d9dea-0x0;var _0x3cdf98=_0xedd9[_0x4d9dea];return _0x3cdf98;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={},_0x2ae8dd={},_0x41af53={'count':0x0,'rows':[]};var _0x5eccfb=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x12c1bc){return{'name':_0x12c1bc[_0x9edd('0x2a')],'type':_0x12c1bc[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x2ae8dd[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x5eccfb,_0x9edd('0x2e'));_0x2ae8dd[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],_0x2ae8dd[_0x9edd('0x2f')]);_0x28cfae[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],qs[_0x9edd('0x34')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x28cfae[_0x9edd('0x33')]=_0x28cfae[_0x9edd('0x33')][_0x9edd('0x35')]?_0x28cfae[_0x9edd('0x33')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a[_0x9edd('0x2f')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x28cfae[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x52746a[_0x9edd('0x2f')]['limit']);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x3a')]=qs[_0x9edd('0x31')](_[_0x9edd('0x3b')](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]){_0x28cfae[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x28cfae[_0x9edd('0x3a')],{'$or':_['map'](_0x5eccfb,function(_0x231604){if(_0x231604['type']!==_0x9edd('0x3e')){var _0x5658d6={};_0x5658d6[_0x231604[_0x9edd('0x2e')]]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]+'%'};return _0x5658d6;}})});}_0x28cfae=_['merge']({},_0x28cfae,_0x52746a[_0x9edd('0x3f')]);var _0xcbd0ef={'where':_0x28cfae[_0x9edd('0x3a')]};return db['MemberReport'][_0x9edd('0x1e')](_0xcbd0ef)['then'](function(_0x1fc4fb){_0x41af53[_0x9edd('0x1e')]=_0x1fc4fb;if(_0x52746a['query'][_0x9edd('0x40')]){_0x28cfae[_0x9edd('0x41')]=[{'all':!![]}];}return db[_0x9edd('0x28')][_0x9edd('0x42')](_0x28cfae);})['then'](function(_0x449f01){_0x41af53['rows']=_0x449f01;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x43')](handleError(_0x238b22,null));};exports['show']=function(_0x318757,_0x49a128){var _0x548299={'raw':!![],'where':{'id':_0x318757[_0x9edd('0x44')]['id']}},_0x369b69={};_0x369b69[_0x9edd('0x2d')]=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x369b69[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x318757[_0x9edd('0x2f')]);_0x369b69[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x369b69[_0x9edd('0x2d')],_0x369b69[_0x9edd('0x2f')]);_0x548299[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x369b69['model'],qs[_0x9edd('0x34')](_0x318757[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x548299[_0x9edd('0x33')]=_0x548299[_0x9edd('0x33')][_0x9edd('0x35')]?_0x548299[_0x9edd('0x33')]:_0x369b69['model'];if(_0x318757['query']['includeAll']){_0x548299[_0x9edd('0x41')]=[{'all':!![]}];}_0x548299=_['merge']({},_0x548299,_0x318757[_0x9edd('0x3f')]);return db[_0x9edd('0x28')][_0x9edd('0x45')](_0x548299)[_0x9edd('0x21')](handleEntityNotFound(_0x49a128,null))[_0x9edd('0x21')](respondWithResult(_0x49a128,null))['catch'](handleError(_0x49a128,null));};exports[_0x9edd('0x46')]=function(_0x35e63c,_0x40e33d){return db['MemberReport'][_0x9edd('0x46')](_0x35e63c[_0x9edd('0x47')],{})[_0x9edd('0x21')](respondWithResult(_0x40e33d,0xc9))[_0x9edd('0x43')](handleError(_0x40e33d,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){if(_0x35bdec[_0x9edd('0x47')]['id']){delete _0x35bdec[_0x9edd('0x47')]['id'];}return db['MemberReport'][_0x9edd('0x45')]({'where':{'id':_0x35bdec[_0x9edd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x21')](saveUpdates(_0x35bdec[_0x9edd('0x47')],null))[_0x9edd('0x21')](respondWithResult(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));};exports[_0x9edd('0x49')]=function(_0x151157,_0x317a60){return db[_0x9edd('0x28')]['find']({'where':{'id':_0x151157[_0x9edd('0x44')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x317a60,null))[_0x9edd('0x21')](removeEntity(_0x317a60,null))['catch'](handleError(_0x317a60,null));};exports[_0x9edd('0x4a')]=function(_0x21f6ce,_0x57db43){return db[_0x9edd('0x28')]['describe']()[_0x9edd('0x21')](respondWithResult(_0x57db43,null))[_0x9edd('0x43')](handleError(_0x57db43,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index effa799..cb94501 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 _0xa919=['interface','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','membername_interface','membername'];(function(_0x11af3b,_0x53f3d){var _0x1cb20c=function(_0x28d8c7){while(--_0x28d8c7){_0x11af3b['push'](_0x11af3b['shift']());}};_0x1cb20c(++_0x53f3d);}(_0xa919,0x1ae));var _0x9a91=function(_0x2b6600,_0x24c497){_0x2b6600=_0x2b6600-0x0;var _0x912ee2=_0xa919[_0x2b6600];return _0x912ee2;};'use strict';var _=require('lodash');var util=require(_0x9a91('0x0'));var logger=require(_0x9a91('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9a91('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9a91('0x3'));var rimraf=require(_0x9a91('0x4'));var config=require(_0x9a91('0x5'));var attributes=require(_0x9a91('0x6'));module[_0x9a91('0x7')]=function(_0x45de70,_0x403fcd){return _0x45de70[_0x9a91('0x8')](_0x9a91('0x9'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x9a91('0xa'),'fields':[_0x9a91('0xb'),_0x9a91('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x63eb=['report_member','membername','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./memberReport.attributes','exports','MemberReport'];(function(_0x387157,_0x162f84){var _0x734c4b=function(_0x428036){while(--_0x428036){_0x387157['push'](_0x387157['shift']());}};_0x734c4b(++_0x162f84);}(_0x63eb,0x195));var _0xb63e=function(_0x2c293b,_0x280cad){_0x2c293b=_0x2c293b-0x0;var _0x505cb8=_0x63eb[_0x2c293b];return _0x505cb8;};'use strict';var _=require(_0xb63e('0x0'));var util=require(_0xb63e('0x1'));var logger=require(_0xb63e('0x2'))(_0xb63e('0x3'));var moment=require(_0xb63e('0x4'));var BPromise=require('bluebird');var rp=require(_0xb63e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb63e('0x6'));var config=require(_0xb63e('0x7'));var attributes=require(_0xb63e('0x8'));module[_0xb63e('0x9')]=function(_0x3a8274,_0x53a4ef){return _0x3a8274['define'](_0xb63e('0xa'),attributes,{'tableName':_0xb63e('0xb'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0xb63e('0xc'),'interface']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index b1809ec..7f9f70d 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 _0x5496=['CreateMemberReport','UpdateMemberReport','update','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetMemberReport','findAll','options','raw','where','attributes','limit','include','map','model','MemberReport','create','body'];(function(_0x3b3e01,_0x4dd46c){var _0x124e12=function(_0x51a96a){while(--_0x51a96a){_0x3b3e01['push'](_0x3b3e01['shift']());}};_0x124e12(++_0x4dd46c);}(_0x5496,0x175));var _0x6549=function(_0x1bf7a6,_0x219aa8){_0x1bf7a6=_0x1bf7a6-0x0;var _0x106d46=_0x5496[_0x1bf7a6];return _0x106d46;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var moment=require(_0x6549('0x2'));var BPromise=require(_0x6549('0x3'));var rs=require(_0x6549('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6549('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6549('0x6'))(_0x6549('0x7'));var config=require(_0x6549('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6549('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d8cea,_0x4fcffd,_0x1ca8fc){return new BPromise(function(_0x3442c3,_0x1ef2a6){return client['request'](_0x1d8cea,_0x1ca8fc)[_0x6549('0xa')](function(_0x35d008){logger[_0x6549('0xb')](_0x6549('0xc'),_0x4fcffd,_0x6549('0xd'));logger[_0x6549('0xe')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x4fcffd,'request\x20sent',JSON[_0x6549('0xf')](_0x35d008));if(_0x35d008[_0x6549('0x10')]){if(_0x35d008[_0x6549('0x10')][_0x6549('0x11')]===0x1f4){logger[_0x6549('0x10')]('MemberReport,\x20%s,\x20%s',_0x4fcffd,_0x35d008['error'][_0x6549('0x12')]);return _0x1ef2a6(_0x35d008[_0x6549('0x10')]['message']);}logger[_0x6549('0x10')](_0x6549('0xc'),_0x4fcffd,_0x35d008[_0x6549('0x10')][_0x6549('0x12')]);return _0x3442c3(_0x35d008[_0x6549('0x10')][_0x6549('0x12')]);}else{logger['info']('MemberReport,\x20%s,\x20%s',_0x4fcffd,_0x6549('0xd'));_0x3442c3(_0x35d008[_0x6549('0x13')]['message']);}})[_0x6549('0x14')](function(_0x67acc0){logger[_0x6549('0x10')](_0x6549('0xc'),_0x4fcffd,_0x67acc0);_0x1ef2a6(_0x67acc0);});});}exports[_0x6549('0x15')]=function(_0x53b12b){var _0x5d61a0=this;return new Promise(function(_0x26a212,_0x48f037){return db['MemberReport'][_0x6549('0x16')]({'raw':_0x53b12b[_0x6549('0x17')]?_0x53b12b[_0x6549('0x17')][_0x6549('0x18')]===undefined?!![]:![]:!![],'where':_0x53b12b[_0x6549('0x17')]?_0x53b12b['options'][_0x6549('0x19')]||null:null,'attributes':_0x53b12b['options']?_0x53b12b[_0x6549('0x17')][_0x6549('0x1a')]||null:null,'limit':_0x53b12b[_0x6549('0x17')]?_0x53b12b[_0x6549('0x17')][_0x6549('0x1b')]||null:null,'include':_0x53b12b[_0x6549('0x17')]?_0x53b12b[_0x6549('0x17')][_0x6549('0x1c')]?_[_0x6549('0x1d')](_0x53b12b[_0x6549('0x17')][_0x6549('0x1c')],function(_0x1fbfa4){return{'model':db[_0x1fbfa4[_0x6549('0x1e')]],'as':_0x1fbfa4['as'],'attributes':_0x1fbfa4['attributes'],'include':_0x1fbfa4[_0x6549('0x1c')]?_[_0x6549('0x1d')](_0x1fbfa4['include'],function(_0x126967){return{'model':db[_0x126967[_0x6549('0x1e')]],'as':_0x126967['as'],'attributes':_0x126967[_0x6549('0x1a')],'include':_0x126967['include']?_[_0x6549('0x1d')](_0x126967[_0x6549('0x1c')],function(_0x14de1f){return{'model':db[_0x14de1f[_0x6549('0x1e')]],'as':_0x14de1f['as'],'attributes':_0x14de1f[_0x6549('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6549('0xa')](function(_0x2f58f7){logger[_0x6549('0xb')]('GetMemberReport',_0x53b12b);logger[_0x6549('0xe')](_0x6549('0x15'),_0x53b12b,JSON[_0x6549('0xf')](_0x2f58f7));_0x26a212(_0x2f58f7);})['catch'](function(_0x3f1502){logger['error']('GetMemberReport',_0x3f1502['message'],_0x53b12b);_0x48f037(_0x5d61a0[_0x6549('0x10')](0x1f4,_0x3f1502[_0x6549('0x12')]));});});};exports['CreateMemberReport']=function(_0x30aac6){var _0x194ae7=this;return new Promise(function(_0x2e481f,_0x102a21){return db[_0x6549('0x1f')][_0x6549('0x20')](_0x30aac6[_0x6549('0x21')],{'raw':_0x30aac6['options']?_0x30aac6[_0x6549('0x17')][_0x6549('0x18')]===undefined?!![]:![]:!![]})[_0x6549('0xa')](function(_0x33bf79){logger[_0x6549('0xb')](_0x6549('0x22'),_0x30aac6);logger['debug'](_0x6549('0x22'),_0x30aac6,JSON['stringify'](_0x33bf79));_0x2e481f(_0x33bf79);})[_0x6549('0x14')](function(_0x49872c){logger[_0x6549('0x10')](_0x6549('0x22'),_0x49872c[_0x6549('0x12')],_0x30aac6);_0x102a21(_0x194ae7['error'](0x1f4,_0x49872c[_0x6549('0x12')]));});});};exports[_0x6549('0x23')]=function(_0x3f6062){var _0x3040e3=this;return new Promise(function(_0x5b8624,_0x54f971){return db['MemberReport'][_0x6549('0x24')](_0x3f6062[_0x6549('0x21')],{'raw':_0x3f6062['options']?_0x3f6062[_0x6549('0x17')][_0x6549('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f6062[_0x6549('0x17')]?_0x3f6062[_0x6549('0x17')][_0x6549('0x19')]||null:null,'attributes':_0x3f6062['options']?_0x3f6062['options'][_0x6549('0x1a')]||null:null,'limit':_0x3f6062[_0x6549('0x17')]?_0x3f6062[_0x6549('0x17')][_0x6549('0x1b')]||null:null})[_0x6549('0xa')](function(_0x789559){logger[_0x6549('0xb')](_0x6549('0x23'),_0x3f6062);logger[_0x6549('0xe')](_0x6549('0x23'),_0x3f6062,JSON['stringify'](_0x789559));_0x5b8624(_0x789559);})[_0x6549('0x14')](function(_0x7986b0){logger[_0x6549('0x10')](_0x6549('0x23'),_0x7986b0[_0x6549('0x12')],_0x3f6062);_0x54f971(_0x3040e3['error'](0x1f4,_0x7986b0['message']));});});}; \ No newline at end of file +var _0xfc46=['raw','UpdateMemberReport','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetMemberReport','findAll','options','where','attributes','limit','map','include','model','CreateMemberReport','MemberReport','create','body'];(function(_0xc3b210,_0x3b16fc){var _0x1f835e=function(_0x748ba8){while(--_0x748ba8){_0xc3b210['push'](_0xc3b210['shift']());}};_0x1f835e(++_0x3b16fc);}(_0xfc46,0x9a));var _0x6fc4=function(_0x21090b,_0x39dd3b){_0x21090b=_0x21090b-0x0;var _0x3c68d7=_0xfc46[_0x21090b];return _0x3c68d7;};'use strict';var _=require(_0x6fc4('0x0'));var util=require('util');var moment=require(_0x6fc4('0x1'));var BPromise=require(_0x6fc4('0x2'));var rs=require(_0x6fc4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6fc4('0x4'))['db'];var utils=require(_0x6fc4('0x5'));var logger=require(_0x6fc4('0x6'))(_0x6fc4('0x7'));var config=require('../../config/environment');var jayson=require(_0x6fc4('0x8'));var client=jayson[_0x6fc4('0x9')][_0x6fc4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x454abb,_0x31e6c7,_0x241761){return new BPromise(function(_0x56cee3,_0x1fcd95){return client['request'](_0x454abb,_0x241761)[_0x6fc4('0xb')](function(_0x2fad80){logger['info'](_0x6fc4('0xc'),_0x31e6c7,_0x6fc4('0xd'));logger[_0x6fc4('0xe')](_0x6fc4('0xf'),_0x31e6c7,_0x6fc4('0xd'),JSON[_0x6fc4('0x10')](_0x2fad80));if(_0x2fad80[_0x6fc4('0x11')]){if(_0x2fad80[_0x6fc4('0x11')][_0x6fc4('0x12')]===0x1f4){logger[_0x6fc4('0x11')](_0x6fc4('0xc'),_0x31e6c7,_0x2fad80[_0x6fc4('0x11')][_0x6fc4('0x13')]);return _0x1fcd95(_0x2fad80[_0x6fc4('0x11')][_0x6fc4('0x13')]);}logger[_0x6fc4('0x11')](_0x6fc4('0xc'),_0x31e6c7,_0x2fad80['error']['message']);return _0x56cee3(_0x2fad80[_0x6fc4('0x11')][_0x6fc4('0x13')]);}else{logger[_0x6fc4('0x14')](_0x6fc4('0xc'),_0x31e6c7,_0x6fc4('0xd'));_0x56cee3(_0x2fad80[_0x6fc4('0x15')][_0x6fc4('0x13')]);}})[_0x6fc4('0x16')](function(_0x1d51b1){logger['error'](_0x6fc4('0xc'),_0x31e6c7,_0x1d51b1);_0x1fcd95(_0x1d51b1);});});}exports[_0x6fc4('0x17')]=function(_0x5d61c7){var _0x5b4b71=this;return new Promise(function(_0x2bc789,_0x21c901){return db['MemberReport'][_0x6fc4('0x18')]({'raw':_0x5d61c7[_0x6fc4('0x19')]?_0x5d61c7[_0x6fc4('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5d61c7[_0x6fc4('0x19')]?_0x5d61c7[_0x6fc4('0x19')][_0x6fc4('0x1a')]||null:null,'attributes':_0x5d61c7['options']?_0x5d61c7[_0x6fc4('0x19')][_0x6fc4('0x1b')]||null:null,'limit':_0x5d61c7['options']?_0x5d61c7['options'][_0x6fc4('0x1c')]||null:null,'include':_0x5d61c7['options']?_0x5d61c7['options']['include']?_[_0x6fc4('0x1d')](_0x5d61c7[_0x6fc4('0x19')][_0x6fc4('0x1e')],function(_0x59d809){return{'model':db[_0x59d809[_0x6fc4('0x1f')]],'as':_0x59d809['as'],'attributes':_0x59d809[_0x6fc4('0x1b')],'include':_0x59d809['include']?_[_0x6fc4('0x1d')](_0x59d809[_0x6fc4('0x1e')],function(_0x2b9811){return{'model':db[_0x2b9811[_0x6fc4('0x1f')]],'as':_0x2b9811['as'],'attributes':_0x2b9811[_0x6fc4('0x1b')],'include':_0x2b9811[_0x6fc4('0x1e')]?_[_0x6fc4('0x1d')](_0x2b9811[_0x6fc4('0x1e')],function(_0x2e7fde){return{'model':db[_0x2e7fde[_0x6fc4('0x1f')]],'as':_0x2e7fde['as'],'attributes':_0x2e7fde[_0x6fc4('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6fc4('0xb')](function(_0x37d90f){logger['info'](_0x6fc4('0x17'),_0x5d61c7);logger[_0x6fc4('0xe')](_0x6fc4('0x17'),_0x5d61c7,JSON[_0x6fc4('0x10')](_0x37d90f));_0x2bc789(_0x37d90f);})[_0x6fc4('0x16')](function(_0x21e2d7){logger[_0x6fc4('0x11')](_0x6fc4('0x17'),_0x21e2d7[_0x6fc4('0x13')],_0x5d61c7);_0x21c901(_0x5b4b71[_0x6fc4('0x11')](0x1f4,_0x21e2d7[_0x6fc4('0x13')]));});});};exports[_0x6fc4('0x20')]=function(_0x5d9b7c){var _0x23d762=this;return new Promise(function(_0x5d9a9d,_0x4952d5){return db[_0x6fc4('0x21')][_0x6fc4('0x22')](_0x5d9b7c[_0x6fc4('0x23')],{'raw':_0x5d9b7c[_0x6fc4('0x19')]?_0x5d9b7c[_0x6fc4('0x19')][_0x6fc4('0x24')]===undefined?!![]:![]:!![]})['then'](function(_0x3b33ca){logger[_0x6fc4('0x14')](_0x6fc4('0x20'),_0x5d9b7c);logger[_0x6fc4('0xe')](_0x6fc4('0x20'),_0x5d9b7c,JSON[_0x6fc4('0x10')](_0x3b33ca));_0x5d9a9d(_0x3b33ca);})[_0x6fc4('0x16')](function(_0x26a0c6){logger['error'](_0x6fc4('0x20'),_0x26a0c6[_0x6fc4('0x13')],_0x5d9b7c);_0x4952d5(_0x23d762[_0x6fc4('0x11')](0x1f4,_0x26a0c6[_0x6fc4('0x13')]));});});};exports[_0x6fc4('0x25')]=function(_0x16cdbd){var _0x22156f=this;return new Promise(function(_0x96efbe,_0x3a11cd){return db['MemberReport']['update'](_0x16cdbd[_0x6fc4('0x23')],{'raw':_0x16cdbd[_0x6fc4('0x19')]?_0x16cdbd[_0x6fc4('0x19')][_0x6fc4('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16cdbd[_0x6fc4('0x19')]?_0x16cdbd[_0x6fc4('0x19')]['where']||null:null,'attributes':_0x16cdbd[_0x6fc4('0x19')]?_0x16cdbd[_0x6fc4('0x19')][_0x6fc4('0x1b')]||null:null,'limit':_0x16cdbd[_0x6fc4('0x19')]?_0x16cdbd[_0x6fc4('0x19')][_0x6fc4('0x1c')]||null:null})[_0x6fc4('0xb')](function(_0x20c009){logger[_0x6fc4('0x14')](_0x6fc4('0x25'),_0x16cdbd);logger[_0x6fc4('0xe')](_0x6fc4('0x25'),_0x16cdbd,JSON[_0x6fc4('0x10')](_0x20c009));_0x96efbe(_0x20c009);})[_0x6fc4('0x16')](function(_0x5a4946){logger[_0x6fc4('0x11')](_0x6fc4('0x25'),_0x5a4946[_0x6fc4('0x13')],_0x16cdbd);_0x3a11cd(_0x22156f['error'](0x1f4,_0x5a4946[_0x6fc4('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 88cbdc2..c40a6ea 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 _0x781e=['../../components/interaction/service','../../config/environment','./migration.controller','index','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x781e,0x13d));var _0xe781=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x781e[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xe781('0x0'));var util=require(_0xe781('0x1'));var path=require(_0xe781('0x2'));var timeout=require(_0xe781('0x3'));var express=require(_0xe781('0x4'));var router=express['Router']();var fs_extra=require(_0xe781('0x5'));var auth=require(_0xe781('0x6'));var interaction=require(_0xe781('0x7'));var config=require(_0xe781('0x8'));var controller=require(_0xe781('0x9'));router['get']('/',controller[_0xe781('0xa')]);module[_0xe781('0xb')]=router; \ No newline at end of file +var _0x2a2f=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','multer','util','express','Router','fs-extra'];(function(_0x4175a7,_0x1bad8f){var _0x19e716=function(_0x442cd9){while(--_0x442cd9){_0x4175a7['push'](_0x4175a7['shift']());}};_0x19e716(++_0x1bad8f);}(_0x2a2f,0x1c6));var _0xf2a2=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x2a2f[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0xf2a2('0x0'));var util=require(_0xf2a2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf2a2('0x2'));var router=express[_0xf2a2('0x3')]();var fs_extra=require(_0xf2a2('0x4'));var auth=require(_0xf2a2('0x5'));var interaction=require(_0xf2a2('0x6'));var config=require(_0xf2a2('0x7'));var controller=require('./migration.controller');router[_0xf2a2('0x8')]('/',controller['index']);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 541cfd4..a248a86 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 _0xfdc1=['version','sequelize'];(function(_0x6ef0e7,_0x1cf78c){var _0x1f5ebf=function(_0x7ea441){while(--_0x7ea441){_0x6ef0e7['push'](_0x6ef0e7['shift']());}};_0x1f5ebf(++_0x1cf78c);}(_0xfdc1,0x143));var _0x1fdc=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0xfdc1[_0x424a9a];return _0xa7831c;};'use strict';var Sequelize=require(_0x1fdc('0x0'));module['exports']={'version':{'type':Sequelize['STRING'],'unique':_0x1fdc('0x1')}}; \ No newline at end of file +var _0xf184=['sequelize','exports','STRING'];(function(_0x552871,_0x87cd12){var _0x5da6eb=function(_0x54ebf0){while(--_0x54ebf0){_0x552871['push'](_0x552871['shift']());}};_0x5da6eb(++_0x87cd12);}(_0xf184,0x1b0));var _0x4f18=function(_0x2c32de,_0x138844){_0x2c32de=_0x2c32de-0x0;var _0x1ad47e=_0xf184[_0x2c32de];return _0x1ad47e;};'use strict';var Sequelize=require(_0x4f18('0x0'));module[_0x4f18('0x1')]={'version':{'type':Sequelize[_0x4f18('0x2')],'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 1ccdaf9..23c7956 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 _0xe0cc=['json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','stack','name','send','index','Migration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','include','findAll','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xe0cc,0x1cd));var _0xce0c=function(_0x4c2252,_0x3e7998){_0x4c2252=_0x4c2252-0x0;var _0x30fdf8=_0xe0cc[_0x4c2252];return _0x30fdf8;};'use strict';var emlformat=require(_0xce0c('0x0'));var rimraf=require(_0xce0c('0x1'));var zipdir=require(_0xce0c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xce0c('0x3'));var moment=require(_0xce0c('0x4'));var BPromise=require(_0xce0c('0x5'));var Mustache=require(_0xce0c('0x6'));var util=require(_0xce0c('0x7'));var path=require(_0xce0c('0x8'));var sox=require(_0xce0c('0x9'));var csv=require(_0xce0c('0xa'));var ejs=require(_0xce0c('0xb'));var fs=require('fs');var fs_extra=require(_0xce0c('0xc'));var _=require(_0xce0c('0xd'));var squel=require(_0xce0c('0xe'));var crypto=require('crypto');var jsforce=require(_0xce0c('0xf'));var deskjs=require(_0xce0c('0x10'));var toCsv=require(_0xce0c('0xa'));var querystring=require(_0xce0c('0x11'));var Papa=require(_0xce0c('0x12'));var Redis=require(_0xce0c('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xce0c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xce0c('0x15'));var logger=require('../../config/logger')(_0xce0c('0x16'));var utils=require(_0xce0c('0x17'));var config=require(_0xce0c('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xce0c('0x19'))['db'];function respondWithStatusCode(_0x570712,_0x399d8c){_0x399d8c=_0x399d8c||0xcc;return function(_0x9db68f){if(_0x9db68f){return _0x570712[_0xce0c('0x1a')](_0x399d8c);}return _0x570712[_0xce0c('0x1b')](_0x399d8c)[_0xce0c('0x1c')]();};}function respondWithResult(_0x4b3bde,_0x5d6416){_0x5d6416=_0x5d6416||0xc8;return function(_0x5c6d1a){if(_0x5c6d1a){return _0x4b3bde[_0xce0c('0x1b')](_0x5d6416)[_0xce0c('0x1d')](_0x5c6d1a);}};}function respondWithFilteredResult(_0xd955ae,_0x478aac){return function(_0xcd59de){if(_0xcd59de){var _0x5693fb=typeof _0x478aac[_0xce0c('0x1e')]===_0xce0c('0x1f')&&typeof _0x478aac[_0xce0c('0x20')]==='undefined';var _0x2792f9=_0xcd59de[_0xce0c('0x21')];var _0x5e5ac8=_0x5693fb?0x0:_0x478aac['offset'];var _0x3fd6e9=_0x5693fb?_0xcd59de[_0xce0c('0x21')]:_0x478aac['offset']+_0x478aac[_0xce0c('0x20')];var _0x9b61eb;if(_0x3fd6e9>=_0x2792f9){_0x3fd6e9=_0x2792f9;_0x9b61eb=0xc8;}else{_0x9b61eb=0xce;}_0xd955ae[_0xce0c('0x1b')](_0x9b61eb);return _0xd955ae[_0xce0c('0x22')](_0xce0c('0x23'),_0x5e5ac8+'-'+_0x3fd6e9+'/'+_0x2792f9)[_0xce0c('0x1d')](_0xcd59de);}return null;};}function patchUpdates(_0x336ef2){return function(_0x598b65){try{jsonpatch[_0xce0c('0x24')](_0x598b65,_0x336ef2,!![]);}catch(_0x511af9){return BPromise['reject'](_0x511af9);}return _0x598b65[_0xce0c('0x25')]();};}function saveUpdates(_0x40bd4b,_0x36e418){return function(_0xa9a60b){if(_0xa9a60b){return _0xa9a60b[_0xce0c('0x26')](_0x40bd4b)['then'](function(_0x116dbb){return _0x116dbb;});}return null;};}function removeEntity(_0x32f565,_0x48b963){return function(_0x52ce25){if(_0x52ce25){return _0x52ce25[_0xce0c('0x27')]()[_0xce0c('0x28')](function(){_0x32f565[_0xce0c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17b81c,_0x175119){return function(_0x135ba7){if(!_0x135ba7){_0x17b81c[_0xce0c('0x1a')](0x194);}return _0x135ba7;};}function handleError(_0x32b227,_0xba033b){_0xba033b=_0xba033b||0x1f4;return function(_0x450b32){logger['error'](_0x450b32[_0xce0c('0x29')]);if(_0x450b32[_0xce0c('0x2a')]){delete _0x450b32['name'];}_0x32b227[_0xce0c('0x1b')](_0xba033b)[_0xce0c('0x2b')](_0x450b32);};}exports[_0xce0c('0x2c')]=function(_0x39c371,_0x11c3b3){var _0x253c81={},_0x266a52={},_0xe674eb={'count':0x0,'rows':[]};var _0x53a014=_['map'](db[_0xce0c('0x2d')][_0xce0c('0x2e')],function(_0x5ca57e){return{'name':_0x5ca57e[_0xce0c('0x2f')],'type':_0x5ca57e[_0xce0c('0x30')][_0xce0c('0x31')]};});_0x266a52['model']=_['map'](_0x53a014,'name');_0x266a52[_0xce0c('0x32')]=_[_0xce0c('0x33')](_0x39c371[_0xce0c('0x32')]);_0x266a52[_0xce0c('0x34')]=_[_0xce0c('0x35')](_0x266a52[_0xce0c('0x36')],_0x266a52['query']);_0x253c81['attributes']=_[_0xce0c('0x35')](_0x266a52[_0xce0c('0x36')],qs[_0xce0c('0x37')](_0x39c371[_0xce0c('0x32')]['fields']));_0x253c81[_0xce0c('0x38')]=_0x253c81[_0xce0c('0x38')][_0xce0c('0x39')]?_0x253c81['attributes']:_0x266a52['model'];if(!_0x39c371[_0xce0c('0x32')]['hasOwnProperty'](_0xce0c('0x3a'))){_0x253c81['limit']=qs[_0xce0c('0x20')](_0x39c371[_0xce0c('0x32')][_0xce0c('0x20')]);_0x253c81[_0xce0c('0x1e')]=qs[_0xce0c('0x1e')](_0x39c371[_0xce0c('0x32')][_0xce0c('0x1e')]);}_0x253c81[_0xce0c('0x3b')]=qs[_0xce0c('0x3c')](_0x39c371['query'][_0xce0c('0x3c')]);_0x253c81[_0xce0c('0x3d')]=qs[_0xce0c('0x34')](_[_0xce0c('0x3e')](_0x39c371[_0xce0c('0x32')],_0x266a52[_0xce0c('0x34')]),_0x53a014);if(_0x39c371[_0xce0c('0x32')][_0xce0c('0x3f')]){_0x253c81[_0xce0c('0x3d')]=_[_0xce0c('0x40')](_0x253c81[_0xce0c('0x3d')],{'$or':_[_0xce0c('0x41')](_0x53a014,function(_0x487c86){if(_0x487c86[_0xce0c('0x30')]!==_0xce0c('0x42')){var _0x3a16bb={};_0x3a16bb[_0x487c86[_0xce0c('0x2a')]]={'$like':'%'+_0x39c371[_0xce0c('0x32')][_0xce0c('0x3f')]+'%'};return _0x3a16bb;}})});}_0x253c81=_['merge']({},_0x253c81,_0x39c371['options']);var _0x1f07b3={'where':_0x253c81['where']};return db[_0xce0c('0x2d')]['count'](_0x1f07b3)[_0xce0c('0x28')](function(_0x13ed0f){_0xe674eb['count']=_0x13ed0f;if(_0x39c371[_0xce0c('0x32')][_0xce0c('0x43')]){_0x253c81[_0xce0c('0x44')]=[{'all':!![]}];}return db[_0xce0c('0x2d')][_0xce0c('0x45')](_0x253c81);})[_0xce0c('0x28')](function(_0x29a0ca){_0xe674eb['rows']=_0x29a0ca;return _0xe674eb;})[_0xce0c('0x28')](respondWithFilteredResult(_0x11c3b3,_0x253c81))['catch'](handleError(_0x11c3b3,null));}; \ No newline at end of file +var _0xda3c=['offset','limit','undefined','Content-Range','apply','save','then','destroy','end','stack','name','send','map','Migration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','count','includeAll','include','findAll','rows','catch','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','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json'];(function(_0x1f83a5,_0x59843f){var _0x45edf0=function(_0x431e25){while(--_0x431e25){_0x1f83a5['push'](_0x1f83a5['shift']());}};_0x45edf0(++_0x59843f);}(_0xda3c,0x1ac));var _0xcda3=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xda3c[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcda3('0x0'));var zipdir=require(_0xcda3('0x1'));var jsonpatch=require(_0xcda3('0x2'));var rp=require(_0xcda3('0x3'));var moment=require(_0xcda3('0x4'));var BPromise=require(_0xcda3('0x5'));var Mustache=require(_0xcda3('0x6'));var util=require(_0xcda3('0x7'));var path=require(_0xcda3('0x8'));var sox=require(_0xcda3('0x9'));var csv=require(_0xcda3('0xa'));var ejs=require(_0xcda3('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcda3('0xc'));var squel=require(_0xcda3('0xd'));var crypto=require('crypto');var jsforce=require(_0xcda3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcda3('0xa'));var querystring=require(_0xcda3('0xf'));var Papa=require(_0xcda3('0x10'));var Redis=require(_0xcda3('0x11'));var authService=require(_0xcda3('0x12'));var qs=require(_0xcda3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcda3('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xcda3('0x15'));var licenseUtil=require(_0xcda3('0x16'));var db=require(_0xcda3('0x17'))['db'];function respondWithStatusCode(_0xbb5c08,_0x2fd17e){_0x2fd17e=_0x2fd17e||0xcc;return function(_0x227c85){if(_0x227c85){return _0xbb5c08[_0xcda3('0x18')](_0x2fd17e);}return _0xbb5c08[_0xcda3('0x19')](_0x2fd17e)['end']();};}function respondWithResult(_0x31ee3d,_0x55db13){_0x55db13=_0x55db13||0xc8;return function(_0x2c1f55){if(_0x2c1f55){return _0x31ee3d[_0xcda3('0x19')](_0x55db13)[_0xcda3('0x1a')](_0x2c1f55);}};}function respondWithFilteredResult(_0x16cf95,_0x57d297){return function(_0x11bd68){if(_0x11bd68){var _0x95e812=typeof _0x57d297[_0xcda3('0x1b')]==='undefined'&&typeof _0x57d297[_0xcda3('0x1c')]===_0xcda3('0x1d');var _0x550939=_0x11bd68['count'];var _0x319cd4=_0x95e812?0x0:_0x57d297[_0xcda3('0x1b')];var _0x5d3dba=_0x95e812?_0x11bd68['count']:_0x57d297[_0xcda3('0x1b')]+_0x57d297[_0xcda3('0x1c')];var _0x4235cb;if(_0x5d3dba>=_0x550939){_0x5d3dba=_0x550939;_0x4235cb=0xc8;}else{_0x4235cb=0xce;}_0x16cf95[_0xcda3('0x19')](_0x4235cb);return _0x16cf95['set'](_0xcda3('0x1e'),_0x319cd4+'-'+_0x5d3dba+'/'+_0x550939)[_0xcda3('0x1a')](_0x11bd68);}return null;};}function patchUpdates(_0xd43a53){return function(_0x5b8d11){try{jsonpatch[_0xcda3('0x1f')](_0x5b8d11,_0xd43a53,!![]);}catch(_0x25786f){return BPromise['reject'](_0x25786f);}return _0x5b8d11[_0xcda3('0x20')]();};}function saveUpdates(_0x49f549,_0x56a100){return function(_0x18da4c){if(_0x18da4c){return _0x18da4c['update'](_0x49f549)[_0xcda3('0x21')](function(_0x14eedf){return _0x14eedf;});}return null;};}function removeEntity(_0x391157,_0x12707a){return function(_0x319f91){if(_0x319f91){return _0x319f91[_0xcda3('0x22')]()[_0xcda3('0x21')](function(){_0x391157[_0xcda3('0x19')](0xcc)[_0xcda3('0x23')]();});}};}function handleEntityNotFound(_0x6157e7,_0x38cf83){return function(_0x185a95){if(!_0x185a95){_0x6157e7[_0xcda3('0x18')](0x194);}return _0x185a95;};}function handleError(_0x55ee26,_0x4a3ba5){_0x4a3ba5=_0x4a3ba5||0x1f4;return function(_0x31c41e){logger['error'](_0x31c41e[_0xcda3('0x24')]);if(_0x31c41e[_0xcda3('0x25')]){delete _0x31c41e[_0xcda3('0x25')];}_0x55ee26['status'](_0x4a3ba5)[_0xcda3('0x26')](_0x31c41e);};}exports['index']=function(_0x13942b,_0x4285c0){var _0x3e1798={},_0x50b3cd={},_0x32032a={'count':0x0,'rows':[]};var _0x97d15e=_[_0xcda3('0x27')](db[_0xcda3('0x28')][_0xcda3('0x29')],function(_0x1fe2ef){return{'name':_0x1fe2ef[_0xcda3('0x2a')],'type':_0x1fe2ef['type'][_0xcda3('0x2b')]};});_0x50b3cd[_0xcda3('0x2c')]=_[_0xcda3('0x27')](_0x97d15e,'name');_0x50b3cd[_0xcda3('0x2d')]=_[_0xcda3('0x2e')](_0x13942b[_0xcda3('0x2d')]);_0x50b3cd[_0xcda3('0x2f')]=_[_0xcda3('0x30')](_0x50b3cd[_0xcda3('0x2c')],_0x50b3cd[_0xcda3('0x2d')]);_0x3e1798[_0xcda3('0x31')]=_[_0xcda3('0x30')](_0x50b3cd[_0xcda3('0x2c')],qs[_0xcda3('0x32')](_0x13942b[_0xcda3('0x2d')]['fields']));_0x3e1798[_0xcda3('0x31')]=_0x3e1798[_0xcda3('0x31')]['length']?_0x3e1798['attributes']:_0x50b3cd['model'];if(!_0x13942b['query'][_0xcda3('0x33')](_0xcda3('0x34'))){_0x3e1798['limit']=qs[_0xcda3('0x1c')](_0x13942b['query'][_0xcda3('0x1c')]);_0x3e1798['offset']=qs['offset'](_0x13942b[_0xcda3('0x2d')][_0xcda3('0x1b')]);}_0x3e1798[_0xcda3('0x35')]=qs[_0xcda3('0x36')](_0x13942b[_0xcda3('0x2d')][_0xcda3('0x36')]);_0x3e1798[_0xcda3('0x37')]=qs[_0xcda3('0x2f')](_['pick'](_0x13942b[_0xcda3('0x2d')],_0x50b3cd[_0xcda3('0x2f')]),_0x97d15e);if(_0x13942b['query'][_0xcda3('0x38')]){_0x3e1798['where']=_[_0xcda3('0x39')](_0x3e1798[_0xcda3('0x37')],{'$or':_[_0xcda3('0x27')](_0x97d15e,function(_0x44778d){if(_0x44778d['type']!=='VIRTUAL'){var _0x383d2a={};_0x383d2a[_0x44778d[_0xcda3('0x25')]]={'$like':'%'+_0x13942b['query']['filter']+'%'};return _0x383d2a;}})});}_0x3e1798=_['merge']({},_0x3e1798,_0x13942b[_0xcda3('0x3a')]);var _0x210c51={'where':_0x3e1798[_0xcda3('0x37')]};return db[_0xcda3('0x28')][_0xcda3('0x3b')](_0x210c51)[_0xcda3('0x21')](function(_0x53ede2){_0x32032a[_0xcda3('0x3b')]=_0x53ede2;if(_0x13942b['query'][_0xcda3('0x3c')]){_0x3e1798[_0xcda3('0x3d')]=[{'all':!![]}];}return db['Migration'][_0xcda3('0x3e')](_0x3e1798);})[_0xcda3('0x21')](function(_0xa0c088){_0x32032a[_0xcda3('0x3f')]=_0xa0c088;return _0x32032a;})[_0xcda3('0x21')](respondWithFilteredResult(_0x4285c0,_0x3e1798))[_0xcda3('0x40')](handleError(_0x4285c0,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index f43e4c5..796de0e 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 _0x900e=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations'];(function(_0xae3c32,_0x38f88f){var _0x1e4fce=function(_0x5d76ed){while(--_0x5d76ed){_0xae3c32['push'](_0xae3c32['shift']());}};_0x1e4fce(++_0x38f88f);}(_0x900e,0xe4));var _0xe900=function(_0x69e47b,_0x2ab23b){_0x69e47b=_0x69e47b-0x0;var _0x5392a3=_0x900e[_0x69e47b];return _0x5392a3;};'use strict';var _=require('lodash');var util=require(_0xe900('0x0'));var logger=require('../../config/logger')(_0xe900('0x1'));var moment=require(_0xe900('0x2'));var BPromise=require(_0xe900('0x3'));var rp=require(_0xe900('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe900('0x5'));var config=require(_0xe900('0x6'));var attributes=require(_0xe900('0x7'));module[_0xe900('0x8')]=function(_0x5cd3a8,_0x5bb7b5){return _0x5cd3a8[_0xe900('0x9')](_0xe900('0xa'),attributes,{'tableName':_0xe900('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaec3=['util','../../config/logger','api','path','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations'];(function(_0x4ac1ac,_0x2c271a){var _0x442537=function(_0x54d8e4){while(--_0x54d8e4){_0x4ac1ac['push'](_0x4ac1ac['shift']());}};_0x442537(++_0x2c271a);}(_0xaec3,0x1a2));var _0x3aec=function(_0x418448,_0x18a590){_0x418448=_0x418448-0x0;var _0x34704d=_0xaec3[_0x418448];return _0x34704d;};'use strict';var _=require('lodash');var util=require(_0x3aec('0x0'));var logger=require(_0x3aec('0x1'))(_0x3aec('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3aec('0x3'));var rimraf=require(_0x3aec('0x4'));var config=require(_0x3aec('0x5'));var attributes=require(_0x3aec('0x6'));module[_0x3aec('0x7')]=function(_0x4efb83,_0x583a6b){return _0x4efb83[_0x3aec('0x8')](_0x3aec('0x9'),attributes,{'tableName':_0x3aec('0xa'),'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 9de87a6..e1142ae 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 _0xb921=['info','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x947959,_0xe60e92){var _0xf2b815=function(_0x1e9f1b){while(--_0x1e9f1b){_0x947959['push'](_0x947959['shift']());}};_0xf2b815(++_0xe60e92);}(_0xb921,0x16a));var _0x1b92=function(_0x5cb1a5,_0x13016f){_0x5cb1a5=_0x5cb1a5-0x0;var _0x533f56=_0xb921[_0x5cb1a5];return _0x533f56;};'use strict';var _=require(_0x1b92('0x0'));var util=require(_0x1b92('0x1'));var moment=require(_0x1b92('0x2'));var BPromise=require(_0x1b92('0x3'));var rs=require(_0x1b92('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1b92('0x5'));var logger=require(_0x1b92('0x6'))(_0x1b92('0x7'));var config=require(_0x1b92('0x8'));var jayson=require(_0x1b92('0x9'));var client=jayson[_0x1b92('0xa')][_0x1b92('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8a6282,_0x7973df,_0x352406){return new BPromise(function(_0x1545f9,_0x64a3ed){return client[_0x1b92('0xc')](_0x8a6282,_0x352406)[_0x1b92('0xd')](function(_0x4567ab){logger['info'](_0x1b92('0xe'),_0x7973df,_0x1b92('0xf'));logger[_0x1b92('0x10')](_0x1b92('0x11'),_0x7973df,_0x1b92('0xf'),JSON[_0x1b92('0x12')](_0x4567ab));if(_0x4567ab[_0x1b92('0x13')]){if(_0x4567ab['error'][_0x1b92('0x14')]===0x1f4){logger[_0x1b92('0x13')]('Migration,\x20%s,\x20%s',_0x7973df,_0x4567ab[_0x1b92('0x13')][_0x1b92('0x15')]);return _0x64a3ed(_0x4567ab[_0x1b92('0x13')][_0x1b92('0x15')]);}logger[_0x1b92('0x13')](_0x1b92('0xe'),_0x7973df,_0x4567ab[_0x1b92('0x13')]['message']);return _0x1545f9(_0x4567ab[_0x1b92('0x13')]['message']);}else{logger[_0x1b92('0x16')]('Migration,\x20%s,\x20%s',_0x7973df,_0x1b92('0xf'));_0x1545f9(_0x4567ab['result'][_0x1b92('0x15')]);}})[_0x1b92('0x17')](function(_0x688aef){logger['error'](_0x1b92('0xe'),_0x7973df,_0x688aef);_0x64a3ed(_0x688aef);});});} \ No newline at end of file +var _0xc4dd=['stringify','error','message','request\x20sent','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s'];(function(_0x3975d9,_0x2913f4){var _0x115b33=function(_0x2ab5f5){while(--_0x2ab5f5){_0x3975d9['push'](_0x3975d9['shift']());}};_0x115b33(++_0x2913f4);}(_0xc4dd,0xad));var _0xdc4d=function(_0x583f89,_0x2937f0){_0x583f89=_0x583f89-0x0;var _0x3cc5a0=_0xc4dd[_0x583f89];return _0x3cc5a0;};'use strict';var _=require(_0xdc4d('0x0'));var util=require(_0xdc4d('0x1'));var moment=require(_0xdc4d('0x2'));var BPromise=require('bluebird');var rs=require(_0xdc4d('0x3'));var fs=require('fs');var Redis=require(_0xdc4d('0x4'));var db=require(_0xdc4d('0x5'))['db'];var utils=require(_0xdc4d('0x6'));var logger=require(_0xdc4d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xdc4d('0x8'));var client=jayson[_0xdc4d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c4ce7,_0x2a2a14,_0x566564){return new BPromise(function(_0x1c2e51,_0x1db67d){return client[_0xdc4d('0xa')](_0x3c4ce7,_0x566564)[_0xdc4d('0xb')](function(_0x1f3a6d){logger[_0xdc4d('0xc')](_0xdc4d('0xd'),_0x2a2a14,'request\x20sent');logger[_0xdc4d('0xe')](_0xdc4d('0xf'),_0x2a2a14,'request\x20sent',JSON[_0xdc4d('0x10')](_0x1f3a6d));if(_0x1f3a6d['error']){if(_0x1f3a6d[_0xdc4d('0x11')]['code']===0x1f4){logger['error']('Migration,\x20%s,\x20%s',_0x2a2a14,_0x1f3a6d[_0xdc4d('0x11')][_0xdc4d('0x12')]);return _0x1db67d(_0x1f3a6d[_0xdc4d('0x11')]['message']);}logger[_0xdc4d('0x11')](_0xdc4d('0xd'),_0x2a2a14,_0x1f3a6d[_0xdc4d('0x11')]['message']);return _0x1c2e51(_0x1f3a6d[_0xdc4d('0x11')]['message']);}else{logger['info'](_0xdc4d('0xd'),_0x2a2a14,_0xdc4d('0x13'));_0x1c2e51(_0x1f3a6d[_0xdc4d('0x14')][_0xdc4d('0x12')]);}})['catch'](function(_0x7b1093){logger[_0xdc4d('0x11')](_0xdc4d('0xd'),_0x2a2a14,_0x7b1093);_0x1db67d(_0x7b1093);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index e544af4..895bfd8 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 _0xa4a9=['fs-extra','../../components/interaction/service','../../config/environment','./network.controller','get','index','/:id','isAuthenticated','show','post','create','put','delete','exports','util','path','connect-timeout','express'];(function(_0x7b4397,_0x50ab04){var _0x16de0b=function(_0x26a130){while(--_0x26a130){_0x7b4397['push'](_0x7b4397['shift']());}};_0x16de0b(++_0x50ab04);}(_0xa4a9,0x7a));var _0x9a4a=function(_0x260e4b,_0x54668d){_0x260e4b=_0x260e4b-0x0;var _0x18dfba=_0xa4a9[_0x260e4b];return _0x18dfba;};'use strict';var multer=require('multer');var util=require(_0x9a4a('0x0'));var path=require(_0x9a4a('0x1'));var timeout=require(_0x9a4a('0x2'));var express=require(_0x9a4a('0x3'));var router=express['Router']();var fs_extra=require(_0x9a4a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9a4a('0x5'));var config=require(_0x9a4a('0x6'));var controller=require(_0x9a4a('0x7'));router[_0x9a4a('0x8')]('/',auth['isAuthenticated'](),controller[_0x9a4a('0x9')]);router['get'](_0x9a4a('0xa'),auth[_0x9a4a('0xb')](),controller[_0x9a4a('0xc')]);router[_0x9a4a('0xd')]('/',auth[_0x9a4a('0xb')](),controller[_0x9a4a('0xe')]);router[_0x9a4a('0xf')](_0x9a4a('0xa'),auth[_0x9a4a('0xb')](),controller['update']);router[_0x9a4a('0x10')](_0x9a4a('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x9a4a('0x11')]=router; \ No newline at end of file +var _0x187d=['show','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./network.controller','isAuthenticated','index','get','/:id'];(function(_0xf6f225,_0x261854){var _0x5bfe08=function(_0x2c31ce){while(--_0x2c31ce){_0xf6f225['push'](_0xf6f225['shift']());}};_0x5bfe08(++_0x261854);}(_0x187d,0x93));var _0xd187=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0x187d[_0x481bf7];return _0x461787;};'use strict';var multer=require(_0xd187('0x0'));var util=require('util');var path=require(_0xd187('0x1'));var timeout=require(_0xd187('0x2'));var express=require(_0xd187('0x3'));var router=express[_0xd187('0x4')]();var fs_extra=require(_0xd187('0x5'));var auth=require(_0xd187('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd187('0x7'));var controller=require(_0xd187('0x8'));router['get']('/',auth[_0xd187('0x9')](),controller[_0xd187('0xa')]);router[_0xd187('0xb')](_0xd187('0xc'),auth[_0xd187('0x9')](),controller[_0xd187('0xd')]);router[_0xd187('0xe')]('/',auth[_0xd187('0x9')](),controller['create']);router[_0xd187('0xf')](_0xd187('0xc'),auth[_0xd187('0x9')](),controller[_0xd187('0x10')]);router[_0xd187('0x11')](_0xd187('0xc'),auth['isAuthenticated'](),controller[_0xd187('0x12')]);module[_0xd187('0x13')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 912aa74..6b44241 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 _0x4b6f=['localnet','stun','turn','STRING','sequelize','exports','ENUM'];(function(_0x539b71,_0x4daf0b){var _0x3d1a59=function(_0x1a59ed){while(--_0x1a59ed){_0x539b71['push'](_0x539b71['shift']());}};_0x3d1a59(++_0x4daf0b);}(_0x4b6f,0x10e));var _0xf4b6=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4b6f[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0xf4b6('0x0'));module[_0xf4b6('0x1')]={'type':{'type':Sequelize[_0xf4b6('0x2')](_0xf4b6('0x3'),'externip',_0xf4b6('0x4'),_0xf4b6('0x5'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xf4b6('0x6')]}}; \ No newline at end of file +var _0xcb06=['turn','STRING','sequelize','exports','localnet','stun'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb06,0x74));var _0x6cb0=function(_0x2867a6,_0x10d905){_0x2867a6=_0x2867a6-0x0;var _0x4afc2b=_0xcb06[_0x2867a6];return _0x4afc2b;};'use strict';var Sequelize=require(_0x6cb0('0x0'));module[_0x6cb0('0x1')]={'type':{'type':Sequelize['ENUM'](_0x6cb0('0x2'),'externip',_0x6cb0('0x3'),_0x6cb0('0x4'))},'value':{'type':Sequelize[_0x6cb0('0x5')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x6cb0('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index bbeaedf..7f5edd0 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 _0xfe81=['findAll','rows','catch','show','params','find','create','body','toUpperCase','STUN','readFileSync','join','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','res_stun_monitor.so','root','server/files/templates/turn_multiple.ejs','render','/etc/asterisk/turn_xcally.conf','Reload','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','/etc/asterisk/stun_xcally.conf','util','ejs','lodash','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','request','then','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','json','offset','undefined','limit','count','status','Content-Range','update','destroy','end','stack','name','index','map','Network','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','type','options','includeAll','include'];(function(_0x994df7,_0x5aa999){var _0x11ca08=function(_0x593558){while(--_0x593558){_0x994df7['push'](_0x994df7['shift']());}};_0x11ca08(++_0x5aa999);}(_0xfe81,0x6e));var _0x1fe8=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xfe81[_0x6cf19c];return _0xce14f3;};'use strict';var util=require(_0x1fe8('0x0'));var path=require('path');var ejs=require(_0x1fe8('0x1'));var fs=require('fs');var _=require(_0x1fe8('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x1fe8('0x3'))(_0x1fe8('0x4'));var config=require(_0x1fe8('0x5'));var db=require(_0x1fe8('0x6'))['db'];var jayson=require(_0x1fe8('0x7'));var client=jayson[_0x1fe8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11c417,_0x58d97e,_0x5c1234,_0x4ae9e4){return new Promise(function(_0x42b0bb,_0x312b72){var _0x3d7fce=_0x4ae9e4||client;return _0x3d7fce[_0x1fe8('0x9')](_0x11c417,_0x5c1234)[_0x1fe8('0xa')](function(_0x1e4e31){logger[_0x1fe8('0xb')](_0x1fe8('0xc'),_0x58d97e,'request\x20sent');logger[_0x1fe8('0xd')](_0x1fe8('0xe'),_0x58d97e,_0x1fe8('0xf'),JSON[_0x1fe8('0x10')](_0x1e4e31));if(_0x1e4e31['error']){if(_0x1e4e31[_0x1fe8('0x11')][_0x1fe8('0x12')]===0x1f4){logger[_0x1fe8('0x11')](_0x1fe8('0xc'),_0x58d97e,_0x1e4e31[_0x1fe8('0x11')]['message']);return _0x312b72(_0x1e4e31[_0x1fe8('0x11')][_0x1fe8('0x13')]);}logger[_0x1fe8('0x11')]('Network,\x20%s,\x20%s',_0x58d97e,_0x1e4e31[_0x1fe8('0x11')][_0x1fe8('0x13')]);return _0x42b0bb(_0x1e4e31['error'][_0x1fe8('0x13')]);}else{logger[_0x1fe8('0xb')]('Network,\x20%s,\x20%s',_0x58d97e,'request\x20sent');_0x42b0bb(_0x1e4e31[_0x1fe8('0x14')]['message']);}})['catch'](function(_0x126b0e){logger[_0x1fe8('0x11')](_0x1fe8('0xc'),_0x58d97e,_0x126b0e);_0x312b72(_0x126b0e);});});}function respondWithResult(_0x604a88,_0x4464fe){_0x4464fe=_0x4464fe||0xc8;return function(_0x58af9b){if(_0x58af9b){return _0x604a88['status'](_0x4464fe)[_0x1fe8('0x15')](_0x58af9b);}};}function respondWithFilteredResult(_0x4bfe8c,_0x1c2928){return function(_0x1e119e){if(_0x1e119e){var _0x5dc346=typeof _0x1c2928[_0x1fe8('0x16')]===_0x1fe8('0x17')&&typeof _0x1c2928[_0x1fe8('0x18')]==='undefined';var _0x2f4b86=_0x1e119e['count'];var _0x215799=_0x5dc346?0x0:_0x1c2928[_0x1fe8('0x16')];var _0x25c123=_0x5dc346?_0x1e119e[_0x1fe8('0x19')]:_0x1c2928['offset']+_0x1c2928['limit'];var _0x37daa4;if(_0x25c123>=_0x2f4b86){_0x25c123=_0x2f4b86;_0x37daa4=0xc8;}else{_0x37daa4=0xce;}_0x4bfe8c[_0x1fe8('0x1a')](_0x37daa4);return _0x4bfe8c['set'](_0x1fe8('0x1b'),_0x215799+'-'+_0x25c123+'/'+_0x2f4b86)[_0x1fe8('0x15')](_0x1e119e);}return null;};}function saveUpdates(_0x5aa6e9){return function(_0xca51b3){if(_0xca51b3){return _0xca51b3[_0x1fe8('0x1c')](_0x5aa6e9)['then'](function(_0x8a752f){return _0x8a752f;});}return null;};}function removeEntity(_0x3fae99){return function(_0x1171b7){if(_0x1171b7){return _0x1171b7[_0x1fe8('0x1d')]()[_0x1fe8('0xa')](function(){_0x3fae99[_0x1fe8('0x1a')](0xcc)[_0x1fe8('0x1e')]();});}};}function handleEntityNotFound(_0x1d56d2){return function(_0x380a83){if(!_0x380a83){_0x1d56d2['sendStatus'](0x194);}return _0x380a83;};}function handleError(_0x2b8813,_0x56acde){_0x56acde=_0x56acde||0x1f4;return function(_0x33eeb4){logger['error'](_0x33eeb4[_0x1fe8('0x1f')]);if(_0x33eeb4['name']){delete _0x33eeb4[_0x1fe8('0x20')];}_0x2b8813['status'](_0x56acde)['send'](_0x33eeb4);};}exports[_0x1fe8('0x21')]=function(_0xfb512a,_0x142504){var _0x23ecea={},_0xaf134b={},_0x769b8e={'count':0x0,'rows':[]};var _0x5a8278=_[_0x1fe8('0x22')](db[_0x1fe8('0x23')][_0x1fe8('0x24')],function(_0x1e5cb5){return{'name':_0x1e5cb5['fieldName'],'type':_0x1e5cb5['type'][_0x1fe8('0x25')]};});_0xaf134b[_0x1fe8('0x26')]=_['map'](_0x5a8278,_0x1fe8('0x20'));_0xaf134b[_0x1fe8('0x27')]=_['keys'](_0xfb512a[_0x1fe8('0x27')]);_0xaf134b[_0x1fe8('0x28')]=_[_0x1fe8('0x29')](_0xaf134b[_0x1fe8('0x26')],_0xaf134b[_0x1fe8('0x27')]);_0x23ecea[_0x1fe8('0x2a')]=_[_0x1fe8('0x29')](_0xaf134b[_0x1fe8('0x26')],qs[_0x1fe8('0x2b')](_0xfb512a['query']['fields']));_0x23ecea['attributes']=_0x23ecea[_0x1fe8('0x2a')][_0x1fe8('0x2c')]?_0x23ecea[_0x1fe8('0x2a')]:_0xaf134b[_0x1fe8('0x26')];if(!_0xfb512a[_0x1fe8('0x27')][_0x1fe8('0x2d')](_0x1fe8('0x2e'))){_0x23ecea['limit']=qs[_0x1fe8('0x18')](_0xfb512a['query'][_0x1fe8('0x18')]);_0x23ecea[_0x1fe8('0x16')]=qs[_0x1fe8('0x16')](_0xfb512a[_0x1fe8('0x27')][_0x1fe8('0x16')]);}_0x23ecea[_0x1fe8('0x2f')]=qs['sort'](_0xfb512a[_0x1fe8('0x27')]['sort']);_0x23ecea['where']=qs['filters'](_[_0x1fe8('0x30')](_0xfb512a[_0x1fe8('0x27')],_0xaf134b[_0x1fe8('0x28')]),_0x5a8278);if(_0xfb512a[_0x1fe8('0x27')][_0x1fe8('0x31')]){_0x23ecea[_0x1fe8('0x32')]=_[_0x1fe8('0x33')](_0x23ecea[_0x1fe8('0x32')],{'$or':_['map'](_0x5a8278,function(_0x57b9d4){if(_0x57b9d4[_0x1fe8('0x34')]!=='VIRTUAL'){var _0x2f7926={};_0x2f7926[_0x57b9d4[_0x1fe8('0x20')]]={'$like':'%'+_0xfb512a[_0x1fe8('0x27')][_0x1fe8('0x31')]+'%'};return _0x2f7926;}})});}_0x23ecea=_[_0x1fe8('0x33')]({},_0x23ecea,_0xfb512a[_0x1fe8('0x35')]);var _0x4678e1={'where':_0x23ecea[_0x1fe8('0x32')]};return db[_0x1fe8('0x23')][_0x1fe8('0x19')](_0x4678e1)[_0x1fe8('0xa')](function(_0x17659b){_0x769b8e[_0x1fe8('0x19')]=_0x17659b;if(_0xfb512a[_0x1fe8('0x27')][_0x1fe8('0x36')]){_0x23ecea[_0x1fe8('0x37')]=[{'all':!![]}];}return db[_0x1fe8('0x23')][_0x1fe8('0x38')](_0x23ecea);})['then'](function(_0x1cfc78){_0x769b8e[_0x1fe8('0x39')]=_0x1cfc78;return _0x769b8e;})[_0x1fe8('0xa')](respondWithFilteredResult(_0x142504,_0x23ecea))[_0x1fe8('0x3a')](handleError(_0x142504,null));};exports[_0x1fe8('0x3b')]=function(_0x44d859,_0x172c23){var _0x1aa8f8={'raw':!![],'where':{'id':_0x44d859[_0x1fe8('0x3c')]['id']}},_0x1da13d={};_0x1da13d[_0x1fe8('0x26')]=_['keys'](db[_0x1fe8('0x23')][_0x1fe8('0x24')]);_0x1da13d['query']=_['keys'](_0x44d859[_0x1fe8('0x27')]);_0x1da13d[_0x1fe8('0x28')]=_['intersection'](_0x1da13d[_0x1fe8('0x26')],_0x1da13d[_0x1fe8('0x27')]);_0x1aa8f8[_0x1fe8('0x2a')]=_['intersection'](_0x1da13d[_0x1fe8('0x26')],qs[_0x1fe8('0x2b')](_0x44d859['query'][_0x1fe8('0x2b')]));_0x1aa8f8[_0x1fe8('0x2a')]=_0x1aa8f8[_0x1fe8('0x2a')][_0x1fe8('0x2c')]?_0x1aa8f8[_0x1fe8('0x2a')]:_0x1da13d[_0x1fe8('0x26')];if(_0x44d859['query'][_0x1fe8('0x36')]){_0x1aa8f8[_0x1fe8('0x37')]=[{'all':!![]}];}_0x1aa8f8=_['merge']({},_0x1aa8f8,_0x44d859[_0x1fe8('0x35')]);return db[_0x1fe8('0x23')][_0x1fe8('0x3d')](_0x1aa8f8)[_0x1fe8('0xa')](handleEntityNotFound(_0x172c23,null))[_0x1fe8('0xa')](respondWithResult(_0x172c23,null))['catch'](handleError(_0x172c23,null));};exports[_0x1fe8('0x3e')]=function(_0x100cc2,_0x1afcb6){var _0x16f2a1;return db[_0x1fe8('0x23')][_0x1fe8('0x3e')](_0x100cc2[_0x1fe8('0x3f')],{'raw':!![]})[_0x1fe8('0xa')](function(_0x2c1559){_0x16f2a1=_0x2c1559;return db['Network']['findAll']({'where':{'type':_0x100cc2[_0x1fe8('0x3f')][_0x1fe8('0x34')]},'raw':!![]});})[_0x1fe8('0xa')](function(_0x3b4a56){if(_0x16f2a1[_0x1fe8('0x34')][_0x1fe8('0x40')]()==_0x1fe8('0x41')){var _0x415bdf=fs[_0x1fe8('0x42')](path[_0x1fe8('0x43')](config['root'],_0x1fe8('0x44')),_0x1fe8('0x45'));var _0x387999=ejs['render'](_0x415bdf,{'networks':_0x3b4a56||[]});fs[_0x1fe8('0x46')]('/etc/asterisk/stun_xcally.conf',_0x387999);return respondWithRpcPromise('Reload','create',{'module':_0x1fe8('0x47')});}else if(_0x16f2a1[_0x1fe8('0x34')]['toUpperCase']()=='TURN'){var _0x48da8a=fs[_0x1fe8('0x42')](path[_0x1fe8('0x43')](config[_0x1fe8('0x48')],_0x1fe8('0x49')),_0x1fe8('0x45'));var _0x48681f=ejs[_0x1fe8('0x4a')](_0x48da8a,{'networks':_0x3b4a56||[]});fs[_0x1fe8('0x46')](_0x1fe8('0x4b'),_0x48681f);return respondWithRpcPromise(_0x1fe8('0x4c'),'create',{'module':_0x1fe8('0x47')});}else{var _0xcfcce=fs[_0x1fe8('0x42')](path[_0x1fe8('0x43')](config[_0x1fe8('0x48')],_0x1fe8('0x4d')),_0x1fe8('0x45'));var _0x40ff03=ejs[_0x1fe8('0x4a')](_0xcfcce,{'networks':_0x3b4a56||[]});fs[_0x1fe8('0x46')](util[_0x1fe8('0x4e')](_0x1fe8('0x4f'),_0x100cc2['body']['type'][_0x1fe8('0x50')]()),_0x40ff03);return respondWithRpcPromise('Reload',_0x1fe8('0x3e'),{'module':_0x1fe8('0x51')});}})[_0x1fe8('0xa')](function(){return _0x16f2a1;})['then'](respondWithResult(_0x1afcb6,0xc9))[_0x1fe8('0x3a')](handleError(_0x1afcb6,null));};exports[_0x1fe8('0x1c')]=function(_0x38a838,_0xd114e8){var _0x3c4d8c;return db['Network'][_0x1fe8('0x3d')]({'where':{'id':_0x38a838[_0x1fe8('0x3c')]['id']}})['then'](handleEntityNotFound(_0xd114e8,null))[_0x1fe8('0xa')](saveUpdates(_0x38a838[_0x1fe8('0x3f')],null))[_0x1fe8('0xa')](function(_0x35d68e){if(_0x35d68e){_0x3c4d8c=_0x35d68e;return db['Network'][_0x1fe8('0x38')]({'where':{'type':_0x3c4d8c[_0x1fe8('0x34')]},'raw':!![]});}return null;})[_0x1fe8('0xa')](function(_0x2e68a7){if(_0x3c4d8c['type'][_0x1fe8('0x40')]()==_0x1fe8('0x41')){var _0x32c7d0=fs[_0x1fe8('0x42')](path['join'](config[_0x1fe8('0x48')],_0x1fe8('0x44')),_0x1fe8('0x45'));var _0x2ea95c=ejs[_0x1fe8('0x4a')](_0x32c7d0,{'networks':_0x2e68a7||[]});fs['writeFileSync'](_0x1fe8('0x52'),_0x2ea95c);return respondWithRpcPromise(_0x1fe8('0x4c'),_0x1fe8('0x1c'),{'module':_0x1fe8('0x47')});}else if(_0x3c4d8c[_0x1fe8('0x34')]['toUpperCase']()=='TURN'){var _0x50cfa3=fs[_0x1fe8('0x42')](path[_0x1fe8('0x43')](config[_0x1fe8('0x48')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x50f3db=ejs['render'](_0x50cfa3,{'networks':_0x2e68a7||[]});fs[_0x1fe8('0x46')](_0x1fe8('0x4b'),_0x50f3db);return respondWithRpcPromise(_0x1fe8('0x4c'),'update',{'module':_0x1fe8('0x47')});}else{var _0xe0f11c=fs[_0x1fe8('0x42')](path[_0x1fe8('0x43')](config[_0x1fe8('0x48')],'server/files/templates/network.ejs'),_0x1fe8('0x45'));var _0x4a60c6=ejs[_0x1fe8('0x4a')](_0xe0f11c,{'networks':_0x2e68a7||[]});fs[_0x1fe8('0x46')](util['format'](_0x1fe8('0x4f'),_0x38a838[_0x1fe8('0x3f')]['type'][_0x1fe8('0x50')]()),_0x4a60c6);return respondWithRpcPromise(_0x1fe8('0x4c'),_0x1fe8('0x1c'),{'module':_0x1fe8('0x51')});}})[_0x1fe8('0xa')](function(_0x2b05fb){if(_0x2b05fb){return _0x3c4d8c;}return null;})['then'](respondWithResult(_0xd114e8,null))[_0x1fe8('0x3a')](handleError(_0xd114e8,null));};exports[_0x1fe8('0x1d')]=function(_0x53ff52,_0xbdce06){var _0x34313c;return db[_0x1fe8('0x23')][_0x1fe8('0x3d')]({'where':{'id':_0x53ff52['params']['id']}})['then'](function(_0x4f01bb){_0x34313c=_0x4f01bb;return _0x4f01bb;})[_0x1fe8('0xa')](handleEntityNotFound(_0xbdce06,null))[_0x1fe8('0xa')](removeEntity(_0xbdce06,null))[_0x1fe8('0xa')](function(){if(_0x34313c){return db[_0x1fe8('0x23')][_0x1fe8('0x38')]({'where':{'type':_0x34313c['type']},'raw':!![]});}})['then'](function(_0x19eb80){if(_0x34313c[_0x1fe8('0x34')][_0x1fe8('0x40')]()==_0x1fe8('0x41')){var _0x15851e=fs['readFileSync'](path[_0x1fe8('0x43')](config[_0x1fe8('0x48')],_0x1fe8('0x44')),'utf8');var _0x51c6f5=ejs[_0x1fe8('0x4a')](_0x15851e,{'networks':_0x19eb80||[]});fs[_0x1fe8('0x46')](_0x1fe8('0x52'),_0x51c6f5);return respondWithRpcPromise(_0x1fe8('0x4c'),_0x1fe8('0x1d'),{'module':_0x1fe8('0x47')});}else if(_0x34313c[_0x1fe8('0x34')][_0x1fe8('0x40')]()=='TURN'){var _0x221051=fs[_0x1fe8('0x42')](path[_0x1fe8('0x43')](config['root'],_0x1fe8('0x49')),_0x1fe8('0x45'));var _0x5926a2=ejs['render'](_0x221051,{'networks':_0x19eb80||[]});fs['writeFileSync'](_0x1fe8('0x4b'),_0x5926a2);return respondWithRpcPromise(_0x1fe8('0x4c'),_0x1fe8('0x1d'),{'module':'res_stun_monitor.so'});}else{var _0x311b8e=fs[_0x1fe8('0x42')](path[_0x1fe8('0x43')](config['root'],_0x1fe8('0x4d')),_0x1fe8('0x45'));var _0xc942fd=ejs[_0x1fe8('0x4a')](_0x311b8e,{'networks':_0x19eb80||[]});fs['writeFileSync'](util[_0x1fe8('0x4e')](_0x1fe8('0x4f'),_0x34313c[_0x1fe8('0x34')][_0x1fe8('0x50')]()),_0xc942fd);return respondWithRpcPromise(_0x1fe8('0x4c'),_0x1fe8('0x1d'),{'module':_0x1fe8('0x51')});}})[_0x1fe8('0x3a')](handleError(_0xbdce06,null));}; \ No newline at end of file +var _0xdd49=['message','result','catch','status','json','offset','undefined','count','limit','set','Content-Range','update','destroy','end','name','send','index','map','Network','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','findAll','rows','params','keys','includeAll','include','merge','find','create','body','STUN','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','toUpperCase','TURN','readFileSync','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','chan_sip.so','server/files/templates/network.ejs','format','toLowerCase','/etc/asterisk/sip_xcally_%s.conf','util','path','ejs','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','Network,\x20%s,\x20%s','debug','request\x20sent','error'];(function(_0x2fe48a,_0x1bbc88){var _0x38420a=function(_0x24a428){while(--_0x24a428){_0x2fe48a['push'](_0x2fe48a['shift']());}};_0x38420a(++_0x1bbc88);}(_0xdd49,0x99));var _0x9dd4=function(_0x3e2480,_0x2eed70){_0x3e2480=_0x3e2480-0x0;var _0x652c0=_0xdd49[_0x3e2480];return _0x652c0;};'use strict';var util=require(_0x9dd4('0x0'));var path=require(_0x9dd4('0x1'));var ejs=require(_0x9dd4('0x2'));var fs=require('fs');var _=require('lodash');var qs=require(_0x9dd4('0x3'));var logger=require(_0x9dd4('0x4'))(_0x9dd4('0x5'));var config=require(_0x9dd4('0x6'));var db=require(_0x9dd4('0x7'))['db'];var jayson=require(_0x9dd4('0x8'));var client=jayson['client'][_0x9dd4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xb3c63a,_0x21591f,_0x3bff14,_0x303dcf){return new Promise(function(_0x4767df,_0x284264){var _0x32ba02=_0x303dcf||client;return _0x32ba02[_0x9dd4('0xa')](_0xb3c63a,_0x3bff14)[_0x9dd4('0xb')](function(_0x5efd88){logger[_0x9dd4('0xc')](_0x9dd4('0xd'),_0x21591f,'request\x20sent');logger[_0x9dd4('0xe')]('Network,\x20%s,\x20%s,\x20%s',_0x21591f,_0x9dd4('0xf'),JSON['stringify'](_0x5efd88));if(_0x5efd88['error']){if(_0x5efd88['error']['code']===0x1f4){logger['error'](_0x9dd4('0xd'),_0x21591f,_0x5efd88[_0x9dd4('0x10')][_0x9dd4('0x11')]);return _0x284264(_0x5efd88['error'][_0x9dd4('0x11')]);}logger['error']('Network,\x20%s,\x20%s',_0x21591f,_0x5efd88[_0x9dd4('0x10')][_0x9dd4('0x11')]);return _0x4767df(_0x5efd88[_0x9dd4('0x10')][_0x9dd4('0x11')]);}else{logger[_0x9dd4('0xc')]('Network,\x20%s,\x20%s',_0x21591f,_0x9dd4('0xf'));_0x4767df(_0x5efd88[_0x9dd4('0x12')]['message']);}})[_0x9dd4('0x13')](function(_0x52918e){logger[_0x9dd4('0x10')](_0x9dd4('0xd'),_0x21591f,_0x52918e);_0x284264(_0x52918e);});});}function respondWithResult(_0x490d80,_0x25461a){_0x25461a=_0x25461a||0xc8;return function(_0x495b33){if(_0x495b33){return _0x490d80[_0x9dd4('0x14')](_0x25461a)[_0x9dd4('0x15')](_0x495b33);}};}function respondWithFilteredResult(_0x3bca91,_0x244a2d){return function(_0x30a6ed){if(_0x30a6ed){var _0x3b2239=typeof _0x244a2d[_0x9dd4('0x16')]==='undefined'&&typeof _0x244a2d['limit']===_0x9dd4('0x17');var _0x51bfab=_0x30a6ed['count'];var _0x29d7bd=_0x3b2239?0x0:_0x244a2d[_0x9dd4('0x16')];var _0x5bdca9=_0x3b2239?_0x30a6ed[_0x9dd4('0x18')]:_0x244a2d[_0x9dd4('0x16')]+_0x244a2d[_0x9dd4('0x19')];var _0x5186d2;if(_0x5bdca9>=_0x51bfab){_0x5bdca9=_0x51bfab;_0x5186d2=0xc8;}else{_0x5186d2=0xce;}_0x3bca91[_0x9dd4('0x14')](_0x5186d2);return _0x3bca91[_0x9dd4('0x1a')](_0x9dd4('0x1b'),_0x29d7bd+'-'+_0x5bdca9+'/'+_0x51bfab)['json'](_0x30a6ed);}return null;};}function saveUpdates(_0x26c89c){return function(_0x1a2d2a){if(_0x1a2d2a){return _0x1a2d2a[_0x9dd4('0x1c')](_0x26c89c)[_0x9dd4('0xb')](function(_0x2ba6e5){return _0x2ba6e5;});}return null;};}function removeEntity(_0x4d0ea1){return function(_0x4305a7){if(_0x4305a7){return _0x4305a7[_0x9dd4('0x1d')]()[_0x9dd4('0xb')](function(){_0x4d0ea1[_0x9dd4('0x14')](0xcc)[_0x9dd4('0x1e')]();});}};}function handleEntityNotFound(_0x40af14){return function(_0x2fed6d){if(!_0x2fed6d){_0x40af14['sendStatus'](0x194);}return _0x2fed6d;};}function handleError(_0x2c6899,_0x38f066){_0x38f066=_0x38f066||0x1f4;return function(_0x5d171c){logger[_0x9dd4('0x10')](_0x5d171c['stack']);if(_0x5d171c[_0x9dd4('0x1f')]){delete _0x5d171c[_0x9dd4('0x1f')];}_0x2c6899[_0x9dd4('0x14')](_0x38f066)[_0x9dd4('0x20')](_0x5d171c);};}exports[_0x9dd4('0x21')]=function(_0x4aea3e,_0x543e3d){var _0x223fc2={},_0x9a4aa={},_0x2ff098={'count':0x0,'rows':[]};var _0x7e7d35=_[_0x9dd4('0x22')](db[_0x9dd4('0x23')][_0x9dd4('0x24')],function(_0x2547ef){return{'name':_0x2547ef[_0x9dd4('0x25')],'type':_0x2547ef[_0x9dd4('0x26')][_0x9dd4('0x27')]};});_0x9a4aa[_0x9dd4('0x28')]=_[_0x9dd4('0x22')](_0x7e7d35,_0x9dd4('0x1f'));_0x9a4aa['query']=_['keys'](_0x4aea3e[_0x9dd4('0x29')]);_0x9a4aa[_0x9dd4('0x2a')]=_['intersection'](_0x9a4aa['model'],_0x9a4aa[_0x9dd4('0x29')]);_0x223fc2[_0x9dd4('0x2b')]=_[_0x9dd4('0x2c')](_0x9a4aa[_0x9dd4('0x28')],qs[_0x9dd4('0x2d')](_0x4aea3e[_0x9dd4('0x29')]['fields']));_0x223fc2[_0x9dd4('0x2b')]=_0x223fc2[_0x9dd4('0x2b')][_0x9dd4('0x2e')]?_0x223fc2[_0x9dd4('0x2b')]:_0x9a4aa[_0x9dd4('0x28')];if(!_0x4aea3e[_0x9dd4('0x29')]['hasOwnProperty'](_0x9dd4('0x2f'))){_0x223fc2[_0x9dd4('0x19')]=qs[_0x9dd4('0x19')](_0x4aea3e[_0x9dd4('0x29')][_0x9dd4('0x19')]);_0x223fc2['offset']=qs[_0x9dd4('0x16')](_0x4aea3e['query'][_0x9dd4('0x16')]);}_0x223fc2[_0x9dd4('0x30')]=qs['sort'](_0x4aea3e[_0x9dd4('0x29')][_0x9dd4('0x31')]);_0x223fc2[_0x9dd4('0x32')]=qs[_0x9dd4('0x2a')](_[_0x9dd4('0x33')](_0x4aea3e['query'],_0x9a4aa['filters']),_0x7e7d35);if(_0x4aea3e[_0x9dd4('0x29')][_0x9dd4('0x34')]){_0x223fc2[_0x9dd4('0x32')]=_['merge'](_0x223fc2[_0x9dd4('0x32')],{'$or':_[_0x9dd4('0x22')](_0x7e7d35,function(_0x58a96f){if(_0x58a96f[_0x9dd4('0x26')]!==_0x9dd4('0x35')){var _0xd34f1d={};_0xd34f1d[_0x58a96f[_0x9dd4('0x1f')]]={'$like':'%'+_0x4aea3e[_0x9dd4('0x29')][_0x9dd4('0x34')]+'%'};return _0xd34f1d;}})});}_0x223fc2=_['merge']({},_0x223fc2,_0x4aea3e[_0x9dd4('0x36')]);var _0x292b17={'where':_0x223fc2[_0x9dd4('0x32')]};return db[_0x9dd4('0x23')][_0x9dd4('0x18')](_0x292b17)['then'](function(_0x99c854){_0x2ff098[_0x9dd4('0x18')]=_0x99c854;if(_0x4aea3e[_0x9dd4('0x29')]['includeAll']){_0x223fc2['include']=[{'all':!![]}];}return db[_0x9dd4('0x23')][_0x9dd4('0x37')](_0x223fc2);})[_0x9dd4('0xb')](function(_0x25b807){_0x2ff098[_0x9dd4('0x38')]=_0x25b807;return _0x2ff098;})[_0x9dd4('0xb')](respondWithFilteredResult(_0x543e3d,_0x223fc2))[_0x9dd4('0x13')](handleError(_0x543e3d,null));};exports['show']=function(_0x1024f2,_0x3b8bf8){var _0x477762={'raw':!![],'where':{'id':_0x1024f2[_0x9dd4('0x39')]['id']}},_0x30011c={};_0x30011c[_0x9dd4('0x28')]=_['keys'](db[_0x9dd4('0x23')][_0x9dd4('0x24')]);_0x30011c['query']=_[_0x9dd4('0x3a')](_0x1024f2[_0x9dd4('0x29')]);_0x30011c[_0x9dd4('0x2a')]=_[_0x9dd4('0x2c')](_0x30011c[_0x9dd4('0x28')],_0x30011c[_0x9dd4('0x29')]);_0x477762[_0x9dd4('0x2b')]=_[_0x9dd4('0x2c')](_0x30011c[_0x9dd4('0x28')],qs[_0x9dd4('0x2d')](_0x1024f2[_0x9dd4('0x29')][_0x9dd4('0x2d')]));_0x477762[_0x9dd4('0x2b')]=_0x477762[_0x9dd4('0x2b')][_0x9dd4('0x2e')]?_0x477762[_0x9dd4('0x2b')]:_0x30011c[_0x9dd4('0x28')];if(_0x1024f2['query'][_0x9dd4('0x3b')]){_0x477762[_0x9dd4('0x3c')]=[{'all':!![]}];}_0x477762=_[_0x9dd4('0x3d')]({},_0x477762,_0x1024f2[_0x9dd4('0x36')]);return db[_0x9dd4('0x23')][_0x9dd4('0x3e')](_0x477762)['then'](handleEntityNotFound(_0x3b8bf8,null))[_0x9dd4('0xb')](respondWithResult(_0x3b8bf8,null))['catch'](handleError(_0x3b8bf8,null));};exports[_0x9dd4('0x3f')]=function(_0xf166d8,_0x26e719){var _0x436f37;return db[_0x9dd4('0x23')][_0x9dd4('0x3f')](_0xf166d8[_0x9dd4('0x40')],{'raw':!![]})['then'](function(_0x42d8e5){_0x436f37=_0x42d8e5;return db[_0x9dd4('0x23')][_0x9dd4('0x37')]({'where':{'type':_0xf166d8[_0x9dd4('0x40')][_0x9dd4('0x26')]},'raw':!![]});})[_0x9dd4('0xb')](function(_0x209add){if(_0x436f37[_0x9dd4('0x26')]['toUpperCase']()==_0x9dd4('0x41')){var _0x3cef39=fs['readFileSync'](path[_0x9dd4('0x42')](config[_0x9dd4('0x43')],_0x9dd4('0x44')),_0x9dd4('0x45'));var _0x4577ea=ejs[_0x9dd4('0x46')](_0x3cef39,{'networks':_0x209add||[]});fs[_0x9dd4('0x47')](_0x9dd4('0x48'),_0x4577ea);return respondWithRpcPromise(_0x9dd4('0x49'),_0x9dd4('0x3f'),{'module':_0x9dd4('0x4a')});}else if(_0x436f37[_0x9dd4('0x26')][_0x9dd4('0x4b')]()==_0x9dd4('0x4c')){var _0x231bc8=fs[_0x9dd4('0x4d')](path[_0x9dd4('0x42')](config['root'],_0x9dd4('0x4e')),_0x9dd4('0x45'));var _0x31fe1c=ejs['render'](_0x231bc8,{'networks':_0x209add||[]});fs[_0x9dd4('0x47')](_0x9dd4('0x4f'),_0x31fe1c);return respondWithRpcPromise(_0x9dd4('0x49'),_0x9dd4('0x3f'),{'module':_0x9dd4('0x4a')});}else{var _0x3302ef=fs[_0x9dd4('0x4d')](path[_0x9dd4('0x42')](config[_0x9dd4('0x43')],'server/files/templates/network.ejs'),_0x9dd4('0x45'));var _0x4e1352=ejs[_0x9dd4('0x46')](_0x3302ef,{'networks':_0x209add||[]});fs[_0x9dd4('0x47')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0xf166d8[_0x9dd4('0x40')][_0x9dd4('0x26')]['toLowerCase']()),_0x4e1352);return respondWithRpcPromise(_0x9dd4('0x49'),_0x9dd4('0x3f'),{'module':_0x9dd4('0x50')});}})[_0x9dd4('0xb')](function(){return _0x436f37;})[_0x9dd4('0xb')](respondWithResult(_0x26e719,0xc9))[_0x9dd4('0x13')](handleError(_0x26e719,null));};exports['update']=function(_0x41f632,_0x3615aa){var _0x1bb613;return db[_0x9dd4('0x23')][_0x9dd4('0x3e')]({'where':{'id':_0x41f632[_0x9dd4('0x39')]['id']}})[_0x9dd4('0xb')](handleEntityNotFound(_0x3615aa,null))[_0x9dd4('0xb')](saveUpdates(_0x41f632[_0x9dd4('0x40')],null))[_0x9dd4('0xb')](function(_0x5a0274){if(_0x5a0274){_0x1bb613=_0x5a0274;return db[_0x9dd4('0x23')][_0x9dd4('0x37')]({'where':{'type':_0x1bb613[_0x9dd4('0x26')]},'raw':!![]});}return null;})[_0x9dd4('0xb')](function(_0x41f4aa){if(_0x1bb613['type']['toUpperCase']()=='STUN'){var _0x2f2068=fs[_0x9dd4('0x4d')](path[_0x9dd4('0x42')](config['root'],_0x9dd4('0x44')),'utf8');var _0x5568f8=ejs[_0x9dd4('0x46')](_0x2f2068,{'networks':_0x41f4aa||[]});fs[_0x9dd4('0x47')](_0x9dd4('0x48'),_0x5568f8);return respondWithRpcPromise('Reload',_0x9dd4('0x1c'),{'module':_0x9dd4('0x4a')});}else if(_0x1bb613['type'][_0x9dd4('0x4b')]()==_0x9dd4('0x4c')){var _0x3f9222=fs[_0x9dd4('0x4d')](path[_0x9dd4('0x42')](config[_0x9dd4('0x43')],_0x9dd4('0x4e')),'utf8');var _0x35976f=ejs['render'](_0x3f9222,{'networks':_0x41f4aa||[]});fs[_0x9dd4('0x47')](_0x9dd4('0x4f'),_0x35976f);return respondWithRpcPromise(_0x9dd4('0x49'),_0x9dd4('0x1c'),{'module':_0x9dd4('0x4a')});}else{var _0x1acdb9=fs[_0x9dd4('0x4d')](path['join'](config[_0x9dd4('0x43')],_0x9dd4('0x51')),_0x9dd4('0x45'));var _0x443398=ejs[_0x9dd4('0x46')](_0x1acdb9,{'networks':_0x41f4aa||[]});fs[_0x9dd4('0x47')](util[_0x9dd4('0x52')]('/etc/asterisk/sip_xcally_%s.conf',_0x41f632['body'][_0x9dd4('0x26')][_0x9dd4('0x53')]()),_0x443398);return respondWithRpcPromise(_0x9dd4('0x49'),_0x9dd4('0x1c'),{'module':'chan_sip.so'});}})[_0x9dd4('0xb')](function(_0x2e5f47){if(_0x2e5f47){return _0x1bb613;}return null;})[_0x9dd4('0xb')](respondWithResult(_0x3615aa,null))['catch'](handleError(_0x3615aa,null));};exports[_0x9dd4('0x1d')]=function(_0xb062a9,_0x3bd3d2){var _0x48977b;return db[_0x9dd4('0x23')][_0x9dd4('0x3e')]({'where':{'id':_0xb062a9[_0x9dd4('0x39')]['id']}})['then'](function(_0x43bf3c){_0x48977b=_0x43bf3c;return _0x43bf3c;})[_0x9dd4('0xb')](handleEntityNotFound(_0x3bd3d2,null))[_0x9dd4('0xb')](removeEntity(_0x3bd3d2,null))[_0x9dd4('0xb')](function(){if(_0x48977b){return db[_0x9dd4('0x23')][_0x9dd4('0x37')]({'where':{'type':_0x48977b[_0x9dd4('0x26')]},'raw':!![]});}})['then'](function(_0x40cf3d){if(_0x48977b[_0x9dd4('0x26')][_0x9dd4('0x4b')]()==_0x9dd4('0x41')){var _0x1f6aad=fs[_0x9dd4('0x4d')](path[_0x9dd4('0x42')](config[_0x9dd4('0x43')],_0x9dd4('0x44')),_0x9dd4('0x45'));var _0x30e444=ejs[_0x9dd4('0x46')](_0x1f6aad,{'networks':_0x40cf3d||[]});fs[_0x9dd4('0x47')](_0x9dd4('0x48'),_0x30e444);return respondWithRpcPromise(_0x9dd4('0x49'),_0x9dd4('0x1d'),{'module':_0x9dd4('0x4a')});}else if(_0x48977b[_0x9dd4('0x26')][_0x9dd4('0x4b')]()==_0x9dd4('0x4c')){var _0x54dd2e=fs[_0x9dd4('0x4d')](path[_0x9dd4('0x42')](config[_0x9dd4('0x43')],'server/files/templates/turn_multiple.ejs'),_0x9dd4('0x45'));var _0x419a6c=ejs['render'](_0x54dd2e,{'networks':_0x40cf3d||[]});fs[_0x9dd4('0x47')](_0x9dd4('0x4f'),_0x419a6c);return respondWithRpcPromise(_0x9dd4('0x49'),_0x9dd4('0x1d'),{'module':_0x9dd4('0x4a')});}else{var _0x2b9924=fs['readFileSync'](path['join'](config[_0x9dd4('0x43')],_0x9dd4('0x51')),_0x9dd4('0x45'));var _0x3f9001=ejs[_0x9dd4('0x46')](_0x2b9924,{'networks':_0x40cf3d||[]});fs['writeFileSync'](util[_0x9dd4('0x52')](_0x9dd4('0x54'),_0x48977b[_0x9dd4('0x26')]['toLowerCase']()),_0x3f9001);return respondWithRpcPromise(_0x9dd4('0x49'),_0x9dd4('0x1d'),{'module':_0x9dd4('0x50')});}})[_0x9dd4('0x13')](handleError(_0x3bd3d2,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 4b96a67..ad26367 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 _0xcea2=['../../config/environment','./network.attributes','define','Network','network','lodash','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x305352,_0x35cfd1){var _0x126a61=function(_0x5e26c9){while(--_0x5e26c9){_0x305352['push'](_0x305352['shift']());}};_0x126a61(++_0x35cfd1);}(_0xcea2,0x15a));var _0x2cea=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xcea2[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x2cea('0x0'));var util=require('util');var logger=require(_0x2cea('0x1'))('api');var moment=require(_0x2cea('0x2'));var BPromise=require(_0x2cea('0x3'));var rp=require(_0x2cea('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2cea('0x5'));var config=require(_0x2cea('0x6'));var attributes=require(_0x2cea('0x7'));module['exports']=function(_0x34f0f2,_0x485c26){return _0x34f0f2[_0x2cea('0x8')](_0x2cea('0x9'),attributes,{'tableName':_0x2cea('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b29=['lodash','../../config/logger','api','request-promise','path','../../config/environment','exports','define','Network','network'];(function(_0x5955f3,_0x3a7402){var _0x3d94b0=function(_0x5d9903){while(--_0x5d9903){_0x5955f3['push'](_0x5955f3['shift']());}};_0x3d94b0(++_0x3a7402);}(_0x8b29,0xbe));var _0x98b2=function(_0x5dfe08,_0x25f7ab){_0x5dfe08=_0x5dfe08-0x0;var _0xb4e181=_0x8b29[_0x5dfe08];return _0xb4e181;};'use strict';var _=require(_0x98b2('0x0'));var util=require('util');var logger=require(_0x98b2('0x1'))(_0x98b2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x98b2('0x3'));var fs=require('fs');var path=require(_0x98b2('0x4'));var rimraf=require('rimraf');var config=require(_0x98b2('0x5'));var attributes=require('./network.attributes');module[_0x98b2('0x6')]=function(_0xa3c251,_0xb0082c){return _0xa3c251[_0x98b2('0x7')](_0x98b2('0x8'),attributes,{'tableName':_0x98b2('0x9'),'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 f4b662a..144e3b7 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x15f976,_0x5585bf){var _0x78f160=function(_0x4e9161){while(--_0x4e9161){_0x15f976['push'](_0x15f976['shift']());}};_0x78f160(++_0x5585bf);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4e04b1,_0x1d23d6){var _0x2c2515=function(_0x1dfc1e){while(--_0x1dfc1e){_0x4e04b1['push'](_0x4e04b1['shift']());}};_0x2c2515(++_0x1d23d6);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index a14456a..fb51baf 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 _0x9aeb=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addDisposition','/:id/notify','notify','/:id/send','send','put','update','delete','destroy','removeAnswers','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x5a1baa,_0x3185a5){var _0x3ebe28=function(_0x2b99ab){while(--_0x2b99ab){_0x5a1baa['push'](_0x5a1baa['shift']());}};_0x3ebe28(++_0x3185a5);}(_0x9aeb,0x12a));var _0xb9ae=function(_0x4c6f53,_0x23c382){_0x4c6f53=_0x4c6f53-0x0;var _0x270957=_0x9aeb[_0x4c6f53];return _0x270957;};'use strict';var multer=require(_0xb9ae('0x0'));var util=require(_0xb9ae('0x1'));var path=require(_0xb9ae('0x2'));var timeout=require(_0xb9ae('0x3'));var express=require('express');var router=express[_0xb9ae('0x4')]();var fs_extra=require(_0xb9ae('0x5'));var auth=require(_0xb9ae('0x6'));var interaction=require(_0xb9ae('0x7'));var config=require(_0xb9ae('0x8'));var controller=require(_0xb9ae('0x9'));router[_0xb9ae('0xa')]('/',auth[_0xb9ae('0xb')](),controller['index']);router[_0xb9ae('0xa')](_0xb9ae('0xc'),auth[_0xb9ae('0xb')](),controller[_0xb9ae('0xd')]);router[_0xb9ae('0xa')](_0xb9ae('0xe'),auth[_0xb9ae('0xb')](),controller[_0xb9ae('0xf')]);router[_0xb9ae('0xa')](_0xb9ae('0x10'),auth[_0xb9ae('0xb')](),controller[_0xb9ae('0x11')]);router['get'](_0xb9ae('0x12'),auth[_0xb9ae('0xb')](),controller['getAnswers']);router[_0xb9ae('0xa')](_0xb9ae('0x13'),auth[_0xb9ae('0xb')](),controller[_0xb9ae('0x14')]);router[_0xb9ae('0xa')](_0xb9ae('0x15'),auth['isAuthenticated'](),controller[_0xb9ae('0x16')]);router[_0xb9ae('0xa')](_0xb9ae('0x17'),auth[_0xb9ae('0xb')](),controller[_0xb9ae('0x18')]);router[_0xb9ae('0x19')]('/',auth[_0xb9ae('0xb')](),controller[_0xb9ae('0x1a')]);router[_0xb9ae('0x19')](_0xb9ae('0x10'),auth[_0xb9ae('0xb')](),controller[_0xb9ae('0x1b')]);router['post'](_0xb9ae('0x12'),auth['isAuthenticated'](),controller['addAnswer']);router[_0xb9ae('0x19')](_0xb9ae('0x1c'),controller[_0xb9ae('0x1d')]);router[_0xb9ae('0x19')](_0xb9ae('0x13'),auth[_0xb9ae('0xb')](),controller['addApplications']);router[_0xb9ae('0x19')]('/:id/users',auth[_0xb9ae('0xb')](),controller['addAgents']);router[_0xb9ae('0x19')](_0xb9ae('0x1e'),auth[_0xb9ae('0xb')](),controller[_0xb9ae('0x1f')]);router[_0xb9ae('0x20')](_0xb9ae('0xe'),auth['isAuthenticated'](),controller[_0xb9ae('0x21')]);router[_0xb9ae('0x22')](_0xb9ae('0xe'),auth[_0xb9ae('0xb')](),controller[_0xb9ae('0x23')]);router['delete'](_0xb9ae('0x10'),auth[_0xb9ae('0xb')](),controller['removeDispositions']);router[_0xb9ae('0x22')](_0xb9ae('0x12'),auth[_0xb9ae('0xb')](),controller[_0xb9ae('0x24')]);router[_0xb9ae('0x22')](_0xb9ae('0x17'),auth[_0xb9ae('0xb')](),controller['removeAgents']);module[_0xb9ae('0x25')]=router; \ No newline at end of file +var _0x9b2b=['getInteractions','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/notify','addApplications','addAgents','send','/:id','destroy','delete','removeDispositions','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','isAuthenticated','/:id/applications','getApplications','/:id/interactions'];(function(_0x3358ba,_0x24c5fc){var _0x296e73=function(_0x843ff3){while(--_0x843ff3){_0x3358ba['push'](_0x3358ba['shift']());}};_0x296e73(++_0x24c5fc);}(_0x9b2b,0x79));var _0xb9b2=function(_0x1f71d8,_0x278518){_0x1f71d8=_0x1f71d8-0x0;var _0x10b045=_0x9b2b[_0x1f71d8];return _0x10b045;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb9b2('0x0'));var timeout=require(_0xb9b2('0x1'));var express=require(_0xb9b2('0x2'));var router=express['Router']();var fs_extra=require(_0xb9b2('0x3'));var auth=require(_0xb9b2('0x4'));var interaction=require(_0xb9b2('0x5'));var config=require(_0xb9b2('0x6'));var controller=require(_0xb9b2('0x7'));router[_0xb9b2('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb9b2('0x8')](_0xb9b2('0x9'),auth['isAuthenticated'](),controller[_0xb9b2('0xa')]);router[_0xb9b2('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xb9b2('0xb')]);router[_0xb9b2('0x8')](_0xb9b2('0xc'),auth['isAuthenticated'](),controller[_0xb9b2('0xd')]);router[_0xb9b2('0x8')](_0xb9b2('0xe'),auth[_0xb9b2('0xf')](),controller['getAnswers']);router[_0xb9b2('0x8')](_0xb9b2('0x10'),auth[_0xb9b2('0xf')](),controller[_0xb9b2('0x11')]);router['get'](_0xb9b2('0x12'),auth[_0xb9b2('0xf')](),controller[_0xb9b2('0x13')]);router[_0xb9b2('0x8')](_0xb9b2('0x14'),auth['isAuthenticated'](),controller[_0xb9b2('0x15')]);router[_0xb9b2('0x16')]('/',auth[_0xb9b2('0xf')](),controller[_0xb9b2('0x17')]);router[_0xb9b2('0x16')](_0xb9b2('0xc'),auth[_0xb9b2('0xf')](),controller[_0xb9b2('0x18')]);router[_0xb9b2('0x16')](_0xb9b2('0xe'),auth[_0xb9b2('0xf')](),controller[_0xb9b2('0x19')]);router[_0xb9b2('0x16')](_0xb9b2('0x1a'),controller['notify']);router[_0xb9b2('0x16')](_0xb9b2('0x10'),auth[_0xb9b2('0xf')](),controller[_0xb9b2('0x1b')]);router[_0xb9b2('0x16')](_0xb9b2('0x14'),auth[_0xb9b2('0xf')](),controller[_0xb9b2('0x1c')]);router[_0xb9b2('0x16')]('/:id/send',auth[_0xb9b2('0xf')](),controller[_0xb9b2('0x1d')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xb9b2('0x1e'),auth[_0xb9b2('0xf')](),controller[_0xb9b2('0x1f')]);router[_0xb9b2('0x20')](_0xb9b2('0xc'),auth[_0xb9b2('0xf')](),controller[_0xb9b2('0x21')]);router[_0xb9b2('0x20')](_0xb9b2('0xe'),auth[_0xb9b2('0xf')](),controller['removeAnswers']);router['delete'](_0xb9b2('0x14'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xb9b2('0x22')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 74ae456..8caeb6a 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 _0x3717=['generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','STRING'];(function(_0x52d422,_0x2d1008){var _0xaa93f9=function(_0x38a7ec){while(--_0x38a7ec){_0x52d422['push'](_0x52d422['shift']());}};_0xaa93f9(++_0x2d1008);}(_0x3717,0xe4));var _0x7371=function(_0x511ff0,_0x5f7232){_0x511ff0=_0x511ff0-0x0;var _0x5ddae4=_0x3717[_0x511ff0];return _0x5ddae4;};'use strict';var Sequelize=require(_0x7371('0x0'));var rs=require(_0x7371('0x1'));module['exports']={'name':{'type':Sequelize[_0x7371('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x7371('0x2')]},'token':{'type':Sequelize[_0x7371('0x2')],'defaultValue':function(){return rs[_0x7371('0x3')]();}},'replyUri':{'type':Sequelize[_0x7371('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x7371('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x7371('0x4')],'defaultValue':function(){return _0x7371('0x5');}},'notificationSound':{'type':Sequelize[_0x7371('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x7371('0x2')]},'queueTransfer':{'type':Sequelize[_0x7371('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7371('0x7')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x7371('0x6')],'defaultValue':![],'comment':_0x7371('0x8'),'set':function(_0x21b5ba){if(!_0x21b5ba)this[_0x7371('0x9')](_0x7371('0xa'),null);this['setDataValue']('mandatoryDisposition',_0x21b5ba);}}}; \ No newline at end of file +var _0x5af3=['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','sequelize','exports','STRING','name'];(function(_0x28209c,_0x31e201){var _0x171f0f=function(_0xfe7a1){while(--_0xfe7a1){_0x28209c['push'](_0x28209c['shift']());}};_0x171f0f(++_0x31e201);}(_0x5af3,0x1a9));var _0x35af=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x5af3[_0x4e9628];return _0x27bc8c;};'use strict';var Sequelize=require(_0x35af('0x0'));var rs=require('randomstring');module[_0x35af('0x1')]={'name':{'type':Sequelize[_0x35af('0x2')],'unique':_0x35af('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x35af('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x35af('0x4')]();}},'replyUri':{'type':Sequelize[_0x35af('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x35af('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x35af('0x5')],'defaultValue':function(){return _0x35af('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x35af('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x35af('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x35af('0x2')]},'queueTransfer':{'type':Sequelize[_0x35af('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x35af('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x35af('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x35af('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x35af('0xa'),'set':function(_0xd4f092){if(!_0xd4f092)this[_0x35af('0xb')](_0x35af('0xc'),null);this[_0x35af('0xb')]('mandatoryDisposition',_0xd4f092);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index fb0e49c..270e030 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 _0x79c6=['map','OpenchannelAccount','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','Pause','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','OpenchannelAccounts','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','Disposition','getDispositions','findOne','order','OpenchannelAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','defaults','ListId','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','contact','messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','OpenchannelMessage','UserId','waitForTheAssignedAgent','Start','startRouting','EventManager','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','getApplications','Contact','User','Owner','fullname','internal','Tag','color','tag','omit','spread','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','dataValues','Messages','push','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/license/util','../../mysqldb','redis','localhost','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','json','limit','undefined','offset','count','set','apply','save','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','mandatoryDispositionPause'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x79c6,0x81));var _0x679c=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x79c6[_0xda464c];return _0x19e222;};'use strict';var emlformat=require(_0x679c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x679c('0x1'));var jsonpatch=require(_0x679c('0x2'));var rp=require(_0x679c('0x3'));var moment=require(_0x679c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x679c('0x5'));var path=require(_0x679c('0x6'));var sox=require(_0x679c('0x7'));var csv=require(_0x679c('0x8'));var ejs=require(_0x679c('0x9'));var fs=require('fs');var fs_extra=require(_0x679c('0xa'));var _=require(_0x679c('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x679c('0xc'));var deskjs=require(_0x679c('0xd'));var toCsv=require(_0x679c('0x8'));var querystring=require(_0x679c('0xe'));var Papa=require(_0x679c('0xf'));var Redis=require(_0x679c('0x10'));var authService=require(_0x679c('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x679c('0x12'))(_0x679c('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x679c('0x14'));var db=require(_0x679c('0x15'))['db'];config[_0x679c('0x16')]=_['defaults'](config[_0x679c('0x16')],{'host':_0x679c('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x679c('0x16')]));require('./openchannelAccount.socket')['register'](socket);var jayson=require(_0x679c('0x18'));var client=jayson[_0x679c('0x19')][_0x679c('0x1a')]({'port':0x232c});var client9002=jayson[_0x679c('0x19')][_0x679c('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x35e715,_0x4f7619,_0x40c54e,_0x30e86b){return new BPromise(function(_0x18117f,_0x3980a2){var _0x24b4f0=_0x30e86b||client;return _0x24b4f0[_0x679c('0x1b')](_0x35e715,_0x40c54e)[_0x679c('0x1c')](function(_0x5434fb){logger[_0x679c('0x1d')](_0x679c('0x1e'),_0x4f7619,_0x679c('0x1f'));logger['debug'](_0x679c('0x20'),_0x4f7619,_0x679c('0x1f'),JSON[_0x679c('0x21')](_0x5434fb));if(_0x5434fb[_0x679c('0x22')]){if(_0x5434fb[_0x679c('0x22')]['code']===0x1f4){logger[_0x679c('0x22')](_0x679c('0x1e'),_0x4f7619,_0x5434fb[_0x679c('0x22')][_0x679c('0x23')]);return _0x3980a2(_0x5434fb['error'][_0x679c('0x23')]);}logger[_0x679c('0x22')](_0x679c('0x1e'),_0x4f7619,_0x5434fb[_0x679c('0x22')][_0x679c('0x23')]);return _0x18117f(_0x5434fb[_0x679c('0x22')][_0x679c('0x23')]);}else{logger[_0x679c('0x1d')]('OpenchannelAccount,\x20%s,\x20%s',_0x4f7619,_0x679c('0x1f'));_0x18117f(_0x5434fb[_0x679c('0x24')][_0x679c('0x23')]);}})[_0x679c('0x25')](function(_0x25e38d){logger[_0x679c('0x22')](_0x679c('0x1e'),_0x4f7619,_0x25e38d);_0x3980a2(_0x25e38d);});});}function respondWithStatusCode(_0x300d77,_0x2c6b34){_0x2c6b34=_0x2c6b34||0xcc;return function(_0x4dcd9e){if(_0x4dcd9e){return _0x300d77['sendStatus'](_0x2c6b34);}return _0x300d77[_0x679c('0x26')](_0x2c6b34)[_0x679c('0x27')]();};}function respondWithResult(_0x5db7b0,_0x162a47){_0x162a47=_0x162a47||0xc8;return function(_0x24e965){if(_0x24e965){return _0x5db7b0[_0x679c('0x26')](_0x162a47)[_0x679c('0x28')](_0x24e965);}};}function respondWithFilteredResult(_0x1de804,_0x3ed3d8){return function(_0x2aa249){if(_0x2aa249){var _0x3cb8bc=typeof _0x3ed3d8['offset']==='undefined'&&typeof _0x3ed3d8[_0x679c('0x29')]===_0x679c('0x2a');var _0x46247b=_0x2aa249['count'];var _0xa64dd1=_0x3cb8bc?0x0:_0x3ed3d8[_0x679c('0x2b')];var _0x4d756d=_0x3cb8bc?_0x2aa249[_0x679c('0x2c')]:_0x3ed3d8[_0x679c('0x2b')]+_0x3ed3d8['limit'];var _0x94fe30;if(_0x4d756d>=_0x46247b){_0x4d756d=_0x46247b;_0x94fe30=0xc8;}else{_0x94fe30=0xce;}_0x1de804[_0x679c('0x26')](_0x94fe30);return _0x1de804[_0x679c('0x2d')]('Content-Range',_0xa64dd1+'-'+_0x4d756d+'/'+_0x46247b)['json'](_0x2aa249);}return null;};}function patchUpdates(_0x128944){return function(_0x2ac136){try{jsonpatch[_0x679c('0x2e')](_0x2ac136,_0x128944,!![]);}catch(_0x6721e){return BPromise['reject'](_0x6721e);}return _0x2ac136[_0x679c('0x2f')]();};}function saveUpdates(_0x524379,_0x58c181){return function(_0x3616a9){if(_0x3616a9){return _0x3616a9['update'](_0x524379)[_0x679c('0x1c')](function(_0x417a60){return _0x417a60;});}return null;};}function removeEntity(_0x2bef76,_0x340fb9){return function(_0x3acb16){if(_0x3acb16){return _0x3acb16[_0x679c('0x30')]()[_0x679c('0x1c')](function(){var _0x2ef042=_0x3acb16[_0x679c('0x31')]({'plain':!![]});var _0x2594ed='OpenchannelAccounts';return db[_0x679c('0x32')][_0x679c('0x30')]({'where':{'type':_0x2594ed,'resourceId':_0x2ef042['id']}})[_0x679c('0x1c')](function(){return _0x3acb16;});})[_0x679c('0x1c')](function(){_0x2bef76[_0x679c('0x26')](0xcc)[_0x679c('0x27')]();});}};}function handleEntityNotFound(_0x1e2c63,_0x4cd817){return function(_0x423397){if(!_0x423397){_0x1e2c63[_0x679c('0x33')](0x194);}return _0x423397;};}function handleError(_0x249ad5,_0x4d2738){_0x4d2738=_0x4d2738||0x1f4;return function(_0x592b94){logger[_0x679c('0x22')](_0x592b94[_0x679c('0x34')]);if(_0x592b94[_0x679c('0x35')]){delete _0x592b94[_0x679c('0x35')];}_0x249ad5[_0x679c('0x26')](_0x4d2738)[_0x679c('0x36')](_0x592b94);};}exports[_0x679c('0x37')]=function(_0x1dfcef,_0x1616e3){var _0x41bf49={'include':[{'model':db['Pause'],'as':_0x679c('0x38')}]},_0x19593d={},_0x209e7a={'count':0x0,'rows':[]};var _0x184810=_[_0x679c('0x39')](db[_0x679c('0x3a')][_0x679c('0x3b')],function(_0x257bf2){return{'name':_0x257bf2[_0x679c('0x3c')],'type':_0x257bf2[_0x679c('0x3d')][_0x679c('0x3e')]};});_0x19593d['model']=_[_0x679c('0x39')](_0x184810,_0x679c('0x35'));_0x19593d[_0x679c('0x3f')]=_[_0x679c('0x40')](_0x1dfcef[_0x679c('0x3f')]);_0x19593d['filters']=_[_0x679c('0x41')](_0x19593d['model'],_0x19593d[_0x679c('0x3f')]);_0x41bf49[_0x679c('0x42')]=_['intersection'](_0x19593d[_0x679c('0x43')],qs['fields'](_0x1dfcef['query'][_0x679c('0x44')]));_0x41bf49[_0x679c('0x42')]=_0x41bf49[_0x679c('0x42')][_0x679c('0x45')]?_0x41bf49[_0x679c('0x42')]:_0x19593d[_0x679c('0x43')];if(!_0x1dfcef[_0x679c('0x3f')][_0x679c('0x46')](_0x679c('0x47'))){_0x41bf49[_0x679c('0x29')]=qs[_0x679c('0x29')](_0x1dfcef[_0x679c('0x3f')][_0x679c('0x29')]);_0x41bf49[_0x679c('0x2b')]=qs['offset'](_0x1dfcef[_0x679c('0x3f')]['offset']);}_0x41bf49['order']=qs[_0x679c('0x48')](_0x1dfcef[_0x679c('0x3f')][_0x679c('0x48')]);_0x41bf49[_0x679c('0x49')]=qs[_0x679c('0x4a')](_[_0x679c('0x4b')](_0x1dfcef['query'],_0x19593d['filters']),_0x184810);if(_0x1dfcef[_0x679c('0x3f')][_0x679c('0x4c')]){_0x41bf49[_0x679c('0x49')]=_[_0x679c('0x4d')](_0x41bf49[_0x679c('0x49')],{'$or':_[_0x679c('0x39')](_0x184810,function(_0x228d54){if(_0x228d54[_0x679c('0x3d')]!==_0x679c('0x4e')){var _0x477d65={};_0x477d65[_0x228d54[_0x679c('0x35')]]={'$like':'%'+_0x1dfcef[_0x679c('0x3f')]['filter']+'%'};return _0x477d65;}})});}_0x41bf49=_[_0x679c('0x4d')]({},_0x41bf49,_0x1dfcef[_0x679c('0x4f')]);var _0x29c44f={'where':_0x41bf49[_0x679c('0x49')]};return db['OpenchannelAccount'][_0x679c('0x2c')](_0x29c44f)[_0x679c('0x1c')](function(_0x4ffd2d){_0x209e7a[_0x679c('0x2c')]=_0x4ffd2d;if(_0x1dfcef[_0x679c('0x3f')][_0x679c('0x50')]){_0x41bf49['include']=[{'all':!![]}];}return db[_0x679c('0x3a')][_0x679c('0x51')](_0x41bf49);})[_0x679c('0x1c')](function(_0x341d8e){_0x209e7a[_0x679c('0x52')]=_0x341d8e;return _0x209e7a;})[_0x679c('0x1c')](respondWithFilteredResult(_0x1616e3,_0x41bf49))[_0x679c('0x25')](handleError(_0x1616e3,null));};exports[_0x679c('0x53')]=function(_0x29a4be,_0x1f4c5b){var _0x440ae4={'raw':![],'where':{'id':_0x29a4be['params']['id']},'include':[{'model':db[_0x679c('0x54')],'as':'mandatoryDispositionPause'}]},_0x247816={};_0x247816['model']=_[_0x679c('0x40')](db[_0x679c('0x3a')]['rawAttributes']);_0x247816['query']=_[_0x679c('0x40')](_0x29a4be[_0x679c('0x3f')]);_0x247816[_0x679c('0x4a')]=_[_0x679c('0x41')](_0x247816['model'],_0x247816[_0x679c('0x3f')]);_0x440ae4[_0x679c('0x42')]=_[_0x679c('0x41')](_0x247816[_0x679c('0x43')],qs[_0x679c('0x44')](_0x29a4be[_0x679c('0x3f')][_0x679c('0x44')]));_0x440ae4[_0x679c('0x42')]=_0x440ae4['attributes'][_0x679c('0x45')]?_0x440ae4['attributes']:_0x247816[_0x679c('0x43')];if(_0x29a4be[_0x679c('0x3f')][_0x679c('0x50')]){_0x440ae4[_0x679c('0x55')]=[{'all':!![]}];}_0x440ae4=_[_0x679c('0x4d')]({},_0x440ae4,_0x29a4be[_0x679c('0x4f')]);return db[_0x679c('0x3a')]['find'](_0x440ae4)[_0x679c('0x1c')](handleEntityNotFound(_0x1f4c5b,null))['then'](respondWithResult(_0x1f4c5b,null))[_0x679c('0x25')](handleError(_0x1f4c5b,null));};exports[_0x679c('0x56')]=function(_0x30de70,_0xd6ec1){return db[_0x679c('0x3a')][_0x679c('0x56')](_0x30de70[_0x679c('0x57')],{})['then'](function(_0x4d2127){var _0x50b5f6=_0x30de70[_0x679c('0x58')][_0x679c('0x31')]({'plain':!![]});if(!_0x50b5f6)throw new Error(_0x679c('0x59'));if(_0x50b5f6['role']==='user'){var _0x17e064=_0x4d2127[_0x679c('0x31')]({'plain':!![]});var _0x31220a=_0x679c('0x5a');return db[_0x679c('0x5b')][_0x679c('0x5c')]({'where':{'name':_0x31220a,'userProfileId':_0x50b5f6['userProfileId']},'raw':!![]})[_0x679c('0x1c')](function(_0x596ad9){if(_0x596ad9&&_0x596ad9['autoAssociation']===0x0){return db[_0x679c('0x32')][_0x679c('0x56')]({'name':_0x17e064['name'],'resourceId':_0x17e064['id'],'type':_0x596ad9[_0x679c('0x35')],'sectionId':_0x596ad9['id']},{})[_0x679c('0x1c')](function(){return _0x4d2127;});}else{return _0x4d2127;}})[_0x679c('0x25')](function(_0x168fd7){logger[_0x679c('0x22')](_0x679c('0x5d'),_0x168fd7);throw _0x168fd7;});}return _0x4d2127;})[_0x679c('0x1c')](respondWithResult(_0xd6ec1,0xc9))[_0x679c('0x25')](handleError(_0xd6ec1,null));};exports['update']=function(_0x2215f3,_0x4e2906){if(_0x2215f3['body']['id']){delete _0x2215f3[_0x679c('0x57')]['id'];}return db[_0x679c('0x3a')][_0x679c('0x5c')]({'where':{'id':_0x2215f3['params']['id']},'include':[{'model':db['Pause'],'as':_0x679c('0x38')}]})[_0x679c('0x1c')](handleEntityNotFound(_0x4e2906,null))['then'](saveUpdates(_0x2215f3[_0x679c('0x57')],null))['then'](respondWithResult(_0x4e2906,null))[_0x679c('0x25')](handleError(_0x4e2906,null));};exports[_0x679c('0x30')]=function(_0x5a97d6,_0x1c4cac){return db[_0x679c('0x3a')][_0x679c('0x5c')]({'where':{'id':_0x5a97d6[_0x679c('0x5e')]['id']}})[_0x679c('0x1c')](handleEntityNotFound(_0x1c4cac,null))[_0x679c('0x1c')](removeEntity(_0x1c4cac,null))[_0x679c('0x25')](handleError(_0x1c4cac,null));};exports['describe']=function(_0x304020,_0xa68c0a){return db[_0x679c('0x3a')][_0x679c('0x5f')]()['then'](respondWithResult(_0xa68c0a,null))[_0x679c('0x25')](handleError(_0xa68c0a,null));};exports[_0x679c('0x60')]=function(_0x5c43af,_0x3eed76,_0x206675){if(_0x5c43af[_0x679c('0x57')]['id']){delete _0x5c43af[_0x679c('0x57')]['id'];}return db[_0x679c('0x3a')][_0x679c('0x5c')]({'where':{'id':_0x5c43af[_0x679c('0x5e')]['id']}})[_0x679c('0x1c')](handleEntityNotFound(_0x3eed76,null))[_0x679c('0x1c')](function(_0x5c5b81){if(_0x5c5b81){_0x5c43af[_0x679c('0x57')]['OpenchannelAccountId']=_0x5c5b81['id'];return db[_0x679c('0x61')][_0x679c('0x56')](_0x5c43af['body']);}})['then'](respondWithResult(_0x3eed76,null))[_0x679c('0x25')](handleError(_0x3eed76,null));};exports[_0x679c('0x62')]=function(_0x9923e2,_0x3629d7,_0x43f11b){var _0x50c962={'raw':![],'where':{}};var _0x1176ce={};var _0x352bb0={'count':0x0,'rows':[]};return db[_0x679c('0x3a')][_0x679c('0x63')]({'where':{'id':_0x9923e2['params']['id']}})[_0x679c('0x1c')](handleEntityNotFound(_0x3629d7,null))[_0x679c('0x1c')](function(_0x185709){if(_0x185709){_0x1176ce[_0x679c('0x43')]=_['keys'](db[_0x679c('0x61')][_0x679c('0x3b')]);_0x1176ce[_0x679c('0x3f')]=_['keys'](_0x9923e2[_0x679c('0x3f')]);_0x1176ce[_0x679c('0x4a')]=_[_0x679c('0x41')](_0x1176ce[_0x679c('0x43')],_0x1176ce['query']);_0x50c962[_0x679c('0x42')]=_[_0x679c('0x41')](_0x1176ce['model'],qs[_0x679c('0x44')](_0x9923e2[_0x679c('0x3f')][_0x679c('0x44')]));_0x50c962[_0x679c('0x42')]=_0x50c962[_0x679c('0x42')][_0x679c('0x45')]?_0x50c962[_0x679c('0x42')]:_0x1176ce['model'];if(!_0x9923e2[_0x679c('0x3f')][_0x679c('0x46')](_0x679c('0x47'))){_0x50c962[_0x679c('0x29')]=qs[_0x679c('0x29')](_0x9923e2[_0x679c('0x3f')][_0x679c('0x29')]);_0x50c962[_0x679c('0x2b')]=qs[_0x679c('0x2b')](_0x9923e2[_0x679c('0x3f')][_0x679c('0x2b')]);}_0x50c962[_0x679c('0x64')]=qs[_0x679c('0x48')](_0x9923e2[_0x679c('0x3f')][_0x679c('0x48')]);_0x50c962[_0x679c('0x49')]=qs['filters'](_[_0x679c('0x4b')](_0x9923e2[_0x679c('0x3f')],_0x1176ce[_0x679c('0x4a')]));_0x50c962[_0x679c('0x49')][_0x679c('0x65')]=_0x185709['id'];if(_0x9923e2[_0x679c('0x3f')][_0x679c('0x4c')]){_0x50c962['where']=_[_0x679c('0x4d')](_0x50c962[_0x679c('0x49')],{'$or':_[_0x679c('0x39')](_0x50c962[_0x679c('0x42')],function(_0x33faa9){var _0x1e5f21={};_0x1e5f21[_0x33faa9]={'$like':'%'+_0x9923e2[_0x679c('0x3f')][_0x679c('0x4c')]+'%'};return _0x1e5f21;})});}_0x50c962=_['merge']({},_0x50c962,_0x9923e2['options']);return db[_0x679c('0x61')][_0x679c('0x2c')]({'where':_0x50c962[_0x679c('0x49')]})[_0x679c('0x1c')](function(_0x4dc5d4){_0x352bb0['count']=_0x4dc5d4;if(_0x9923e2['query'][_0x679c('0x50')]){_0x50c962[_0x679c('0x55')]=[{'all':!![]}];}return db[_0x679c('0x61')][_0x679c('0x51')](_0x50c962);})[_0x679c('0x1c')](function(_0x46e200){_0x352bb0[_0x679c('0x52')]=_0x46e200;return _0x352bb0;});}})['then'](respondWithFilteredResult(_0x3629d7,_0x50c962))['catch'](handleError(_0x3629d7,null));};exports['removeDispositions']=function(_0x153911,_0x535a55,_0x340a64){return db['OpenchannelAccount'][_0x679c('0x5c')]({'where':{'id':_0x153911['params']['id']}})['then'](handleEntityNotFound(_0x535a55,null))[_0x679c('0x1c')](function(_0x4bf2f8){if(_0x4bf2f8){return _0x4bf2f8[_0x679c('0x66')](_0x153911['query'][_0x679c('0x67')]);}})[_0x679c('0x1c')](respondWithStatusCode(_0x535a55,null))[_0x679c('0x25')](handleError(_0x535a55,null));};exports[_0x679c('0x68')]=function(_0x597b76,_0x118f2e,_0x2c8898){if(_0x597b76[_0x679c('0x57')]['id']){delete _0x597b76[_0x679c('0x57')]['id'];}return db[_0x679c('0x3a')][_0x679c('0x5c')]({'where':{'id':_0x597b76[_0x679c('0x5e')]['id']}})[_0x679c('0x1c')](handleEntityNotFound(_0x118f2e,null))[_0x679c('0x1c')](function(_0x45b3b2){if(_0x45b3b2){_0x597b76[_0x679c('0x57')][_0x679c('0x65')]=_0x45b3b2['id'];return db[_0x679c('0x69')]['create'](_0x597b76[_0x679c('0x57')]);}})['then'](respondWithResult(_0x118f2e,null))[_0x679c('0x25')](handleError(_0x118f2e,null));};exports[_0x679c('0x6a')]=function(_0x1b854e,_0x140f48,_0x3be023){var _0x476776={'raw':![],'where':{}};var _0x325516={};var _0x125a4b={'count':0x0,'rows':[]};return db[_0x679c('0x3a')]['findOne']({'where':{'id':_0x1b854e[_0x679c('0x5e')]['id']}})[_0x679c('0x1c')](handleEntityNotFound(_0x140f48,null))[_0x679c('0x1c')](function(_0x1522ae){if(_0x1522ae){_0x325516[_0x679c('0x43')]=_[_0x679c('0x40')](db[_0x679c('0x69')][_0x679c('0x3b')]);_0x325516[_0x679c('0x3f')]=_[_0x679c('0x40')](_0x1b854e['query']);_0x325516[_0x679c('0x4a')]=_['intersection'](_0x325516[_0x679c('0x43')],_0x325516['query']);_0x476776[_0x679c('0x42')]=_[_0x679c('0x41')](_0x325516[_0x679c('0x43')],qs[_0x679c('0x44')](_0x1b854e[_0x679c('0x3f')]['fields']));_0x476776['attributes']=_0x476776[_0x679c('0x42')]['length']?_0x476776[_0x679c('0x42')]:_0x325516[_0x679c('0x43')];if(!_0x1b854e[_0x679c('0x3f')][_0x679c('0x46')](_0x679c('0x47'))){_0x476776[_0x679c('0x29')]=qs[_0x679c('0x29')](_0x1b854e[_0x679c('0x3f')][_0x679c('0x29')]);_0x476776[_0x679c('0x2b')]=qs[_0x679c('0x2b')](_0x1b854e['query'][_0x679c('0x2b')]);}_0x476776[_0x679c('0x64')]=qs['sort'](_0x1b854e[_0x679c('0x3f')][_0x679c('0x48')]);_0x476776[_0x679c('0x49')]=qs['filters'](_[_0x679c('0x4b')](_0x1b854e[_0x679c('0x3f')],_0x325516[_0x679c('0x4a')]));_0x476776[_0x679c('0x49')][_0x679c('0x65')]=_0x1522ae['id'];if(_0x1b854e[_0x679c('0x3f')]['filter']){_0x476776['where']=_['merge'](_0x476776['where'],{'$or':_['map'](_0x476776[_0x679c('0x42')],function(_0x3e981b){var _0x3979dc={};_0x3979dc[_0x3e981b]={'$like':'%'+_0x1b854e[_0x679c('0x3f')][_0x679c('0x4c')]+'%'};return _0x3979dc;})});}_0x476776=_[_0x679c('0x4d')]({},_0x476776,_0x1b854e[_0x679c('0x4f')]);return db[_0x679c('0x69')][_0x679c('0x2c')]({'where':_0x476776[_0x679c('0x49')]})[_0x679c('0x1c')](function(_0x375b6f){_0x125a4b['count']=_0x375b6f;if(_0x1b854e[_0x679c('0x3f')]['includeAll']){_0x476776[_0x679c('0x55')]=[{'all':!![]}];}return db[_0x679c('0x69')][_0x679c('0x51')](_0x476776);})['then'](function(_0x51c3a0){_0x125a4b[_0x679c('0x52')]=_0x51c3a0;return _0x125a4b;});}})[_0x679c('0x1c')](respondWithFilteredResult(_0x140f48,_0x476776))['catch'](handleError(_0x140f48,null));};exports['removeAnswers']=function(_0x3aa57e,_0x40670e,_0x396cee){return db[_0x679c('0x3a')][_0x679c('0x5c')]({'where':{'id':_0x3aa57e[_0x679c('0x5e')]['id']}})[_0x679c('0x1c')](handleEntityNotFound(_0x40670e,null))[_0x679c('0x1c')](function(_0x4195cf){if(_0x4195cf){return _0x4195cf['removeAnswers'](_0x3aa57e[_0x679c('0x3f')]['ids']);}})['then'](respondWithStatusCode(_0x40670e,null))[_0x679c('0x25')](handleError(_0x40670e,null));};exports[_0x679c('0x6b')]=function(_0x474ab7,_0x1818dc,_0x30c981){var _0x14306e={'body':_0x474ab7[_0x679c('0x57')],'channel':_0x679c('0x6c')};var _0x5ead4e=[];var _0x4df487=[];var _0x4739fb={};var _0x26e22c=![];return db[_0x679c('0x6d')][_0x679c('0x5f')]()['then'](function(_0x4e4a75){if(!_0x4e4a75){throw new db[(_0x679c('0x6e'))][(_0x679c('0x6f'))](_0x679c('0x70'));}_0x5ead4e=_[_0x679c('0x71')](_['keys'](_0x4e4a75),[_0x679c('0x72'),_0x679c('0x73')]);_0x4df487=_[_0x679c('0x71')](_[_0x679c('0x40')](_0x4e4a75),['createdAt',_0x679c('0x73'),_0x679c('0x74'),'ListId']);if(_0x474ab7[_0x679c('0x57')]['id']){delete _0x474ab7['body']['id'];}if(_['isNil'](_0x474ab7['body'][_0x679c('0x75')])){throw new db[(_0x679c('0x6e'))][(_0x679c('0x6f'))](_0x679c('0x76'));}if(_[_0x679c('0x77')](_0x474ab7[_0x679c('0x57')][_0x679c('0x57')])||_0x474ab7[_0x679c('0x57')][_0x679c('0x57')]===''){throw new db['Sequelize'][(_0x679c('0x6f'))](_0x679c('0x78'));}if(_[_0x679c('0x77')](_0x474ab7[_0x679c('0x57')]['mapKey'])){throw new db[(_0x679c('0x6e'))][(_0x679c('0x6f'))](_0x679c('0x79')+_0x4df487);}if(!_[_0x679c('0x7a')](_0x4df487,_0x474ab7['body'][_0x679c('0x7b')])){throw new db[(_0x679c('0x6e'))]['ValidationError'](_0x679c('0x7c')+_0x4df487);}_0x4739fb[_0x474ab7[_0x679c('0x57')][_0x679c('0x7b')]]=_0x474ab7[_0x679c('0x57')]['from'];})[_0x679c('0x1c')](function(){return db['OpenchannelAccount']['find']({'where':{'id':_0x474ab7[_0x679c('0x5e')]['id']},'include':[{'model':db[_0x679c('0x7d')],'as':_0x679c('0x7e'),'include':[{'model':db['CmContact'],'as':_0x679c('0x7f'),'where':_0x4739fb,'limit':0x1,'order':[[_0x679c('0x73'),'DESC']]}]},{'model':db[_0x679c('0x80')],'as':_0x679c('0x81')}]});})[_0x679c('0x1c')](handleEntityNotFound(_0x1818dc,null))[_0x679c('0x1c')](function(_0x15def0){if(_0x15def0&&_0x15def0[_0x679c('0x7e')]){_0x14306e[_0x679c('0x82')]=_0x15def0;_0x14306e[_0x679c('0x83')]=_0x15def0[_0x679c('0x81')];_0x14306e[_0x679c('0x84')]=_0x15def0[_0x679c('0x7e')];_0x14306e[_0x679c('0x83')]=_[_0x679c('0x85')](_0x14306e[_0x679c('0x83')],[_0x679c('0x86')],[_0x679c('0x87')]);if(_0x14306e[_0x679c('0x82')][_0x679c('0x81')]){delete _0x14306e[_0x679c('0x82')]['Applications'];}if(_0x14306e[_0x679c('0x82')][_0x679c('0x7e')]&&_0x14306e['account']['List'][_0x679c('0x7f')][_0x679c('0x45')]){return _0x14306e[_0x679c('0x82')][_0x679c('0x7e')]['Contacts'][0x0];}var _0x4b4736=_[_0x679c('0x88')](_0x474ab7[_0x679c('0x57')],{'firstName':_0x474ab7[_0x679c('0x57')][_0x679c('0x75')],'ListId':_0x15def0[_0x679c('0x89')]});_0x4b4736[_0x474ab7[_0x679c('0x57')][_0x679c('0x7b')]]=_0x474ab7[_0x679c('0x57')]['from'];return db[_0x679c('0x6d')][_0x679c('0x56')](_0x4b4736,{'fields':_0x5ead4e,'raw':!![]});}})[_0x679c('0x1c')](handleEntityNotFound(_0x1818dc,null))['then'](function(_0x4303f6){_0x14306e['contact']=_0x4303f6;if(_0x4303f6){var _0x3a134d={'ContactId':_0x4303f6['id'],'OpenchannelAccountId':_0x474ab7[_0x679c('0x5e')]['id'],'from':(_0x4303f6[_0x679c('0x8a')]||'')+'\x20'+(_0x4303f6[_0x679c('0x8b')]||'')};var _0x3987d0={'OpenchannelAccountId':_0x474ab7[_0x679c('0x5e')]['id'],'closed':![]};if(_0x474ab7['body']['threadId']){_0x3987d0[_0x679c('0x8c')]=_0x474ab7[_0x679c('0x57')]['threadId'];return db[_0x679c('0x8d')][_0x679c('0x5c')]({'where':_0x3987d0})[_0x679c('0x1c')](function(_0x2aa10b){if(_0x2aa10b){return[_0x2aa10b,![]];}_0x3a134d['threadId']=_0x474ab7[_0x679c('0x57')]['threadId'];_0x3a134d[_0x679c('0x8e')]=_0x474ab7[_0x679c('0x57')]['externalUrl'];return db[_0x679c('0x8d')][_0x679c('0x56')](_0x3a134d)[_0x679c('0x1c')](function(_0x281bdf){return[_0x281bdf,!![]];});});}else{_0x3987d0[_0x679c('0x8c')]=null;}_0x3987d0[_0x679c('0x8f')]=_0x4303f6['id'];return db['OpenchannelInteraction']['find']({'where':_0x3987d0})[_0x679c('0x1c')](function(_0x4eb410){if(_0x4eb410){return[_0x4eb410,![]];}return db['OpenchannelInteraction'][_0x679c('0x56')](_0x3a134d)['then'](function(_0x403041){return[_0x403041,!![]];});});}})['spread'](function(_0x9021ce,_0x5074ee){if(_0x9021ce){_0x26e22c=_0x5074ee;if(!_0x5074ee){var _0x33e976={'from':(_0x14306e[_0x679c('0x90')]['firstName']||'')+'\x20'+(_0x14306e['contact'][_0x679c('0x8b')]||'')};if(_0x474ab7['body']['threadId']&&_0x474ab7[_0x679c('0x57')][_0x679c('0x91')]&&_0x474ab7[_0x679c('0x57')][_0x679c('0x8c')]!=_0x474ab7[_0x679c('0x57')][_0x679c('0x91')]){_0x33e976['threadId']=_0x474ab7[_0x679c('0x57')][_0x679c('0x91')];}return _0x9021ce['update'](_0x33e976);}else{return _0x9021ce;}}})[_0x679c('0x1c')](function(_0x275918){_0x14306e[_0x679c('0x92')]=_0x275918[_0x679c('0x31')]({'plain':!![]});_0x14306e[_0x679c('0x92')][_0x679c('0x93')]=_0x26e22c;if(_0x14306e[_0x679c('0x92')]['created']){if(_0x14306e[_0x679c('0x82')][_0x679c('0x94')]){_0x14306e[_0x679c('0x83')]['push']({'id':0x0,'priority':_0x14306e[_0x679c('0x83')][_0x679c('0x45')]+0x1,'app':_0x679c('0x95'),'appdata':_0x679c('0x96'),'interval':_0x679c('0x97')});}}return db[_0x679c('0x98')]['create']({'body':_0x474ab7['body']['body'],'OpenchannelAccountId':_0x474ab7[_0x679c('0x5e')]['id'],'OpenchannelInteractionId':_0x275918['id'],'direction':'in','ContactId':_0x14306e[_0x679c('0x90')]['id'],'AttachmentId':_0x474ab7[_0x679c('0x57')]['AttachmentId']});})[_0x679c('0x1c')](function(_0x553ec9){_0x14306e[_0x679c('0x23')]=_0x553ec9;if(_0x14306e['interaction'][_0x679c('0x99')]){return db['User'][_0x679c('0x5c')]({'attributes':['id','name'],'where':{'id':_0x14306e[_0x679c('0x92')][_0x679c('0x99')]}})['then'](function(_0x14cb8f){if(_0x14cb8f){_0x14306e[_0x679c('0x83')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x14cb8f['name']+','+(_0x14306e[_0x679c('0x82')][_0x679c('0x9a')]||0xa),'interval':_0x679c('0x97')});_0x14306e['forcedOwnership']=![];}return respondWithRpcPromise(_0x679c('0x9b'),'startRouting',_0x14306e);});}return respondWithRpcPromise(_0x679c('0x9b'),_0x679c('0x9c'),_0x14306e);})['then'](function(_0x5c42c0){respondWithRpcPromise(_0x679c('0x9d'),'EventManager',{'event':'notify','message':_0x5c42c0},client9002);return _0x5c42c0;})[_0x679c('0x1c')](respondWithResult(_0x1818dc,null))[_0x679c('0x25')](handleError(_0x1818dc,null));};exports[_0x679c('0x9e')]=function(_0x1cb095,_0x1ebb55){var _0xd589a=_0x1cb095[_0x679c('0x5e')]['id'];var _0x50737b=_0x1cb095[_0x679c('0x57')];var _0x422a22=0xc8;var _0x36a85d=null;return db[_0x679c('0x9f')][_0x679c('0xa0')]({'isolationLevel':db['sequelize']['Transaction'][_0x679c('0xa1')][_0x679c('0xa2')]},function(_0x34ea58){return db[_0x679c('0x3a')][_0x679c('0x63')]({'where':{'id':_0xd589a},'transaction':_0x34ea58})[_0x679c('0x1c')](function(_0x5890fc){if(_0x5890fc){return db['OpenchannelApplication'][_0x679c('0x30')]({'where':{'OpenchannelAccountId':_0xd589a},'transaction':_0x34ea58})['then'](function(){var _0x446232=_[_0x679c('0x39')](_0x50737b,function(_0x3203ea){_0x3203ea[_0x679c('0x65')]=_0xd589a;return _0x3203ea;});return db['OpenchannelApplication'][_0x679c('0xa3')](_0x446232,{'transaction':_0x34ea58});});}else{_0x422a22=0x194;_0x36a85d=[];}});})['then'](function(){if(_0x422a22!==0x194){return db[_0x679c('0x80')][_0x679c('0xa4')]({'where':{'OpenchannelAccountId':_0xd589a},'order':_0x679c('0x86')})[_0x679c('0x1c')](function(_0x211512){_0x36a85d=_0x211512;});}})['catch'](function(_0x5a36a2){_0x422a22=0x1f4;logger['error'](_0x5a36a2['stack']);if(_0x5a36a2[_0x679c('0x35')]){delete _0x5a36a2['name'];}_0x36a85d=_0x5a36a2;})['finally'](function(){if(_0x36a85d===null){_0x1ebb55['sendStatus'](_0x422a22);}else{if(_0x422a22===0x1f4){_0x1ebb55[_0x679c('0x26')](_0x422a22)[_0x679c('0x36')](_0x36a85d);}else{_0x1ebb55['status'](_0x422a22)[_0x679c('0x28')](_0x36a85d);}}});};exports[_0x679c('0xa5')]=function(_0x46b4c0,_0x52e682,_0x53443c){var _0x489dca={};var _0x39df6d={};var _0x1c642a;var _0x31fdfd;return db[_0x679c('0x3a')][_0x679c('0x63')]({'where':{'id':_0x46b4c0[_0x679c('0x5e')]['id']}})[_0x679c('0x1c')](handleEntityNotFound(_0x52e682,null))[_0x679c('0x1c')](function(_0x1072f2){if(_0x1072f2){_0x1c642a=_0x1072f2;_0x39df6d[_0x679c('0x43')]=_[_0x679c('0x40')](db[_0x679c('0x80')]['rawAttributes']);_0x39df6d[_0x679c('0x3f')]=_['keys'](_0x46b4c0[_0x679c('0x3f')]);_0x39df6d[_0x679c('0x4a')]=_[_0x679c('0x41')](_0x39df6d[_0x679c('0x43')],_0x39df6d[_0x679c('0x3f')]);_0x489dca['attributes']=_[_0x679c('0x41')](_0x39df6d[_0x679c('0x43')],qs[_0x679c('0x44')](_0x46b4c0['query'][_0x679c('0x44')]));_0x489dca['attributes']=_0x489dca['attributes'][_0x679c('0x45')]?_0x489dca[_0x679c('0x42')]:_0x39df6d['model'];_0x489dca['order']=qs[_0x679c('0x48')](_0x46b4c0[_0x679c('0x3f')][_0x679c('0x48')]);_0x489dca[_0x679c('0x49')]=qs[_0x679c('0x4a')](_[_0x679c('0x4b')](_0x46b4c0[_0x679c('0x3f')],_0x39df6d[_0x679c('0x4a')]));if(_0x46b4c0[_0x679c('0x3f')]['filter']){_0x489dca[_0x679c('0x49')]=_[_0x679c('0x4d')](_0x489dca[_0x679c('0x49')],{'$or':_[_0x679c('0x39')](_0x489dca['attributes'],function(_0x585579){var _0x196035={};_0x196035[_0x585579]={'$like':'%'+_0x46b4c0[_0x679c('0x3f')][_0x679c('0x4c')]+'%'};return _0x196035;})});}_0x489dca=_[_0x679c('0x4d')]({},_0x489dca,_0x46b4c0['options']);return _0x1c642a[_0x679c('0xa5')](_0x489dca);}})[_0x679c('0x1c')](function(_0xa4e96d){if(_0xa4e96d){_0x31fdfd=_0xa4e96d[_0x679c('0x45')];if(!_0x46b4c0[_0x679c('0x3f')][_0x679c('0x46')](_0x679c('0x47'))){_0x489dca[_0x679c('0x29')]=qs[_0x679c('0x29')](_0x46b4c0[_0x679c('0x3f')][_0x679c('0x29')]);_0x489dca[_0x679c('0x2b')]=qs[_0x679c('0x2b')](_0x46b4c0['query'][_0x679c('0x2b')]);}return _0x1c642a[_0x679c('0xa5')](_0x489dca);}})[_0x679c('0x1c')](function(_0x597ecb){if(_0x597ecb){return _0x597ecb?{'count':_0x31fdfd,'rows':_0x597ecb}:null;}})[_0x679c('0x1c')](respondWithResult(_0x52e682,null))[_0x679c('0x25')](handleError(_0x52e682,null));};exports['getInteractions']=function(_0x4ff6dd,_0x2dc951,_0x41a0e1){var _0x21ed3e={'raw':![],'where':{}};var _0x158309={};var _0x269620={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x679c('0x63')]({'where':{'id':_0x4ff6dd[_0x679c('0x5e')]['id']}})['then'](handleEntityNotFound(_0x2dc951,null))[_0x679c('0x1c')](function(_0x5b013a){if(_0x5b013a){_0x158309['model']=_[_0x679c('0x40')](db[_0x679c('0x8d')][_0x679c('0x3b')]);_0x158309['query']=_['keys'](_0x4ff6dd[_0x679c('0x3f')]);_0x158309[_0x679c('0x4a')]=_[_0x679c('0x41')](_0x158309[_0x679c('0x43')],_0x158309[_0x679c('0x3f')]);_0x21ed3e[_0x679c('0x42')]=_[_0x679c('0x41')](_0x158309[_0x679c('0x43')],qs[_0x679c('0x44')](_0x4ff6dd['query'][_0x679c('0x44')]));_0x21ed3e[_0x679c('0x42')]=_0x21ed3e[_0x679c('0x42')][_0x679c('0x45')]?_0x21ed3e[_0x679c('0x42')]:_0x158309[_0x679c('0x43')];if(!_0x4ff6dd['query']['hasOwnProperty'](_0x679c('0x47'))){_0x21ed3e[_0x679c('0x29')]=qs[_0x679c('0x29')](_0x4ff6dd[_0x679c('0x3f')]['limit']);_0x21ed3e['offset']=qs[_0x679c('0x2b')](_0x4ff6dd[_0x679c('0x3f')][_0x679c('0x2b')]);}_0x21ed3e[_0x679c('0x64')]=qs['sort'](_0x4ff6dd['query'][_0x679c('0x48')]);_0x21ed3e[_0x679c('0x49')]=qs[_0x679c('0x4a')](_[_0x679c('0x4b')](_0x4ff6dd[_0x679c('0x3f')],_0x158309[_0x679c('0x4a')]));_0x21ed3e[_0x679c('0x49')][_0x679c('0x65')]=_0x5b013a['id'];if(_0x4ff6dd[_0x679c('0x3f')]['filter']){_0x21ed3e[_0x679c('0x49')]=_['merge'](_0x21ed3e[_0x679c('0x49')],{'$or':_[_0x679c('0x39')](_0x21ed3e[_0x679c('0x42')],function(_0x1815f7){var _0x370843={};_0x370843[_0x1815f7]={'$like':'%'+_0x4ff6dd[_0x679c('0x3f')][_0x679c('0x4c')]+'%'};return _0x370843;})});}_0x21ed3e=_['merge']({},_0x21ed3e,_0x4ff6dd[_0x679c('0x4f')]);return db[_0x679c('0x8d')]['count']({'where':_0x21ed3e[_0x679c('0x49')]})[_0x679c('0x1c')](function(_0xacd4ec){_0x269620['count']=_0xacd4ec;if(_0x4ff6dd[_0x679c('0x3f')][_0x679c('0x50')]){_0x21ed3e[_0x679c('0x55')]=[{'model':db['CmContact'],'as':_0x679c('0xa6'),'required':![]},{'model':db[_0x679c('0xa7')],'as':_0x679c('0xa8'),'attributes':[_0x679c('0x35'),_0x679c('0xa9'),_0x679c('0xaa')],'required':![]},{'model':db[_0x679c('0xab')],'as':'Tags','attributes':['id','name',_0x679c('0xac')],'where':_0x4ff6dd['query']['tag']?{'id':_0x4ff6dd[_0x679c('0x3f')][_0x679c('0xad')]}:undefined,'required':_0x4ff6dd[_0x679c('0x3f')][_0x679c('0xad')]?!![]:![]}];}return db[_0x679c('0x8d')][_0x679c('0x51')](_0x21ed3e);})[_0x679c('0x1c')](function(_0x1f958b){_0x269620[_0x679c('0x52')]=_0x1f958b;return _0x269620;});}})[_0x679c('0x1c')](respondWithFilteredResult(_0x2dc951,_0x21ed3e))[_0x679c('0x25')](handleError(_0x2dc951,null));};exports['addAgents']=function(_0x1bce5d,_0x5a660f,_0x489da4){return db[_0x679c('0x3a')][_0x679c('0x5c')]({'where':{'id':_0x1bce5d[_0x679c('0x5e')]['id']}})[_0x679c('0x1c')](handleEntityNotFound(_0x5a660f,null))[_0x679c('0x1c')](function(_0x38309b){if(_0x38309b){return _0x38309b['addAgents'](_0x1bce5d['body'][_0x679c('0x67')],_[_0x679c('0xae')](_0x1bce5d[_0x679c('0x57')],[_0x679c('0x67'),'id'])||{})[_0x679c('0xaf')](function(_0x57cf36){for(var _0x3e106a=0x0;_0x3e106a<_0x1bce5d[_0x679c('0x57')]['ids']['length'];_0x3e106a+=0x1){socket[_0x679c('0xb0')](_0x679c('0xb1'),{'UserId':Number(_0x1bce5d[_0x679c('0x57')][_0x679c('0x67')][_0x3e106a]),'OpenchannelAccountId':Number(_0x1bce5d[_0x679c('0x5e')]['id'])});}return _0x57cf36;});}})[_0x679c('0x1c')](respondWithResult(_0x5a660f,null))[_0x679c('0x25')](handleError(_0x5a660f,null));};exports[_0x679c('0xb2')]=function(_0x39ff2a,_0x47e797,_0x34f95d){return db[_0x679c('0x3a')]['find']({'where':{'id':_0x39ff2a['params']['id']}})['then'](handleEntityNotFound(_0x47e797,null))[_0x679c('0x1c')](function(_0x5ae70f){if(_0x5ae70f){return _0x5ae70f[_0x679c('0xb2')](_0x39ff2a[_0x679c('0x3f')]['ids'])[_0x679c('0x1c')](function(){if(_[_0x679c('0xb3')](_0x39ff2a[_0x679c('0x3f')][_0x679c('0x67')])){for(var _0x967c43=0x0;_0x967c43<_0x39ff2a[_0x679c('0x3f')]['ids'][_0x679c('0x45')];_0x967c43+=0x1){socket[_0x679c('0xb0')](_0x679c('0xb4'),{'UserId':Number(_0x39ff2a[_0x679c('0x3f')][_0x679c('0x67')][_0x967c43]),'OpenchannelAccountId':Number(_0x39ff2a[_0x679c('0x5e')]['id'])});}}else{socket[_0x679c('0xb0')]('userOpenchannelAccount:remove',{'UserId':Number(_0x39ff2a[_0x679c('0x3f')][_0x679c('0x67')]),'OpenchannelAccountId':Number(_0x39ff2a[_0x679c('0x5e')]['id'])});}});}})[_0x679c('0x1c')](respondWithStatusCode(_0x47e797,null))[_0x679c('0x25')](handleError(_0x47e797,null));};exports[_0x679c('0xb5')]=function(_0x10c336,_0x1cca2f,_0x46220c){var _0xdd3e1={};var _0x3cfa76={};var _0x491b8b;var _0x332547;return db[_0x679c('0x3a')][_0x679c('0x63')]({'where':{'id':_0x10c336[_0x679c('0x5e')]['id']}})[_0x679c('0x1c')](handleEntityNotFound(_0x1cca2f,null))[_0x679c('0x1c')](function(_0x39e315){if(_0x39e315){_0x491b8b=_0x39e315;_0x3cfa76[_0x679c('0x43')]=_[_0x679c('0x40')](db['User'][_0x679c('0x3b')]);_0x3cfa76[_0x679c('0x3f')]=_['keys'](_0x10c336[_0x679c('0x3f')]);_0x3cfa76[_0x679c('0x4a')]=_[_0x679c('0x41')](_0x3cfa76['model'],_0x3cfa76[_0x679c('0x3f')]);_0xdd3e1[_0x679c('0x42')]=_[_0x679c('0x41')](_0x3cfa76['model'],qs[_0x679c('0x44')](_0x10c336[_0x679c('0x3f')][_0x679c('0x44')]));_0xdd3e1['attributes']=_0xdd3e1[_0x679c('0x42')][_0x679c('0x45')]?_0xdd3e1[_0x679c('0x42')]:_0x3cfa76[_0x679c('0x43')];_0xdd3e1[_0x679c('0x64')]=qs[_0x679c('0x48')](_0x10c336[_0x679c('0x3f')]['sort']);_0xdd3e1[_0x679c('0x49')]=qs['filters'](_[_0x679c('0x4b')](_0x10c336['query'],_0x3cfa76[_0x679c('0x4a')]));if(_0x10c336['query'][_0x679c('0x4c')]){_0xdd3e1[_0x679c('0x49')]=_[_0x679c('0x4d')](_0xdd3e1[_0x679c('0x49')],{'$or':_['map'](_0xdd3e1['attributes'],function(_0x3e6da1){var _0x1926df={};_0x1926df[_0x3e6da1]={'$like':'%'+_0x10c336['query'][_0x679c('0x4c')]+'%'};return _0x1926df;})});}_0xdd3e1=_['merge']({},_0xdd3e1,_0x10c336[_0x679c('0x4f')]);return _0x491b8b[_0x679c('0xb5')](_0xdd3e1);}})[_0x679c('0x1c')](function(_0x1b0c2a){if(_0x1b0c2a){_0x332547=_0x1b0c2a[_0x679c('0x45')];if(!_0x10c336[_0x679c('0x3f')][_0x679c('0x46')](_0x679c('0x47'))){_0xdd3e1[_0x679c('0x29')]=qs[_0x679c('0x29')](_0x10c336[_0x679c('0x3f')]['limit']);_0xdd3e1[_0x679c('0x2b')]=qs[_0x679c('0x2b')](_0x10c336[_0x679c('0x3f')][_0x679c('0x2b')]);}return _0x491b8b[_0x679c('0xb5')](_0xdd3e1);}})[_0x679c('0x1c')](function(_0x1e9713){if(_0x1e9713){return _0x1e9713?{'count':_0x332547,'rows':_0x1e9713}:null;}})['then'](respondWithResult(_0x1cca2f,null))[_0x679c('0x25')](handleError(_0x1cca2f,null));};exports['send']=function(_0xb3799e,_0x1e1193,_0x2e2b9d){var _0x1e1fc9,_0x46f764,_0x24dfcd;if(_[_0x679c('0x77')](_0xb3799e[_0x679c('0x57')][_0x679c('0x57')])||_0xb3799e[_0x679c('0x57')][_0x679c('0x57')]===''){throw new db[(_0x679c('0x6e'))][(_0x679c('0x6f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0xb3799e[_0x679c('0x57')]['to'])){}_0x1e1fc9=_0xb3799e['body']['to'];return db['OpenchannelAccount'][_0x679c('0x63')]({'where':{'id':_0xb3799e[_0x679c('0x5e')]['id']}})[_0x679c('0x1c')](handleEntityNotFound(_0x1e1193,null))[_0x679c('0x1c')](function(_0x3abc48){if(_0x3abc48){return db['OpenchannelAccount'][_0x679c('0x5c')]({'where':{'id':_0x3abc48['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0x679c('0x7f'),'where':{[_0x3abc48[_0x679c('0x7b')]]:_0x1e1fc9},'limit':0x1,'order':[[_0x679c('0x73'),'DESC']]}]}]})[_0x679c('0x1c')](handleEntityNotFound(_0x1e1193,null))[_0x679c('0x1c')](function(_0x57b699){if(_0x57b699&&_0x57b699[_0x679c('0x7e')]){_0x46f764=_0x57b699[_0x679c('0x31')]({'plain':!![]});if(_0x46f764['List']&&_0x46f764[_0x679c('0x7e')][_0x679c('0x7f')][_0x679c('0x45')]){return _0x46f764['List'][_0x679c('0x7f')][0x0];}return db[_0x679c('0x6d')][_0x679c('0x56')](_[_0x679c('0x88')](_0xb3799e['body'],{'firstName':_0x1e1fc9,[_0x57b699['mapKey']]:_0x1e1fc9,'phone':_0x1e1fc9,'ListId':_0x46f764['ListId']}));}})[_0x679c('0x1c')](handleEntityNotFound(_0x1e1193,null))[_0x679c('0x1c')](function(_0x45d4a2){if(_0x45d4a2){_0x24dfcd=_0x45d4a2;return db[_0x679c('0x8d')][_0x679c('0x5c')]({'where':{'ContactId':_0x24dfcd['id'],'closed':![],'OpenchannelAccountId':_0x46f764['id']}})[_0x679c('0x1c')](function(_0x11f5fc){if(_0x11f5fc){return[_0x11f5fc,![]];}return db[_0x679c('0x8d')][_0x679c('0x56')]({'UserId':_0xb3799e['user']['id'],'ContactId':_0x24dfcd['id'],'OpenchannelAccountId':_0x46f764['id'],'lastMsgDirection':_0x679c('0xb6'),'firstMsgDirection':_0x679c('0xb6'),'Messages':[_['merge'](_0xb3799e[_0x679c('0x57')],{'read':![],'body':_0xb3799e['body'][_0x679c('0x57')],'OpenchannelAccountId':_0x46f764['id'],'UserId':_0xb3799e[_0x679c('0x58')]['id'],'ContactId':_0x24dfcd['id']})]},{'include':[{'model':db[_0x679c('0x98')],'as':'Messages'}]})[_0x679c('0x1c')](function(_0x23f837){return[_0x23f837,!![]];});});}})[_0x679c('0xaf')](function(_0x20a31e,_0x2b8c0d){if(_0x2b8c0d){return _0x20a31e;}return db['OpenchannelMessage']['create'](_['merge'](_0xb3799e[_0x679c('0x57')],{'read':![],'body':_0xb3799e[_0x679c('0x57')]['body'],'OpenchannelAccountId':_0x46f764['id'],'OpenchannelInteractionId':_0x20a31e['id'],'UserId':_0xb3799e[_0x679c('0x58')]['id'],'ContactId':_0x24dfcd['id']}))[_0x679c('0x1c')](function(_0x20791b){_0x20a31e[_0x679c('0xb7')][_0x679c('0xb8')]=[];_0x20a31e[_0x679c('0xb7')][_0x679c('0xb8')][_0x679c('0xb9')](_0x20791b[_0x679c('0xb7')]);return _0x20a31e;});});}})['then'](respondWithResult(_0x1e1193,null))['catch'](handleError(_0x1e1193,null));}; \ No newline at end of file +var _0x9c48=['jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','http','client','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','OpenchannelAccounts','UserProfileResource','destroy','stack','name','send','index','Pause','map','OpenchannelAccount','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','intersection','find','create','user','get','role','userProfileId','autoAssociation','body','mandatoryDispositionPause','describe','addDisposition','Disposition','getDispositions','OpenchannelAccountId','removeDispositions','ids','CannedAnswer','getAnswers','pick','removeAnswers','notify','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','Sequelize','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','contact','threadId','OpenchannelInteraction','ContactId','spread','lastName','messageId','interaction','created','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','agent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','bulkCreate','findAndCountAll','getApplications','Contact','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','User','getAgents','defaults','out','Messages','dataValues','push','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0xc8ce64,_0x56f52e){var _0x18ef60=function(_0x8c1910){while(--_0x8c1910){_0xc8ce64['push'](_0xc8ce64['shift']());}};_0x18ef60(++_0x56f52e);}(_0x9c48,0xb1));var _0x89c4=function(_0x1998c7,_0x2afce7){_0x1998c7=_0x1998c7-0x0;var _0x54b045=_0x9c48[_0x1998c7];return _0x54b045;};'use strict';var emlformat=require(_0x89c4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x89c4('0x1'));var jsonpatch=require(_0x89c4('0x2'));var rp=require(_0x89c4('0x3'));var moment=require(_0x89c4('0x4'));var BPromise=require(_0x89c4('0x5'));var Mustache=require(_0x89c4('0x6'));var util=require(_0x89c4('0x7'));var path=require(_0x89c4('0x8'));var sox=require(_0x89c4('0x9'));var csv=require(_0x89c4('0xa'));var ejs=require(_0x89c4('0xb'));var fs=require('fs');var fs_extra=require(_0x89c4('0xc'));var _=require(_0x89c4('0xd'));var squel=require(_0x89c4('0xe'));var crypto=require('crypto');var jsforce=require(_0x89c4('0xf'));var deskjs=require(_0x89c4('0x10'));var toCsv=require(_0x89c4('0xa'));var querystring=require(_0x89c4('0x11'));var Papa=require(_0x89c4('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x89c4('0x13'));var as=require(_0x89c4('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x89c4('0x15'));var utils=require(_0x89c4('0x16'));var config=require(_0x89c4('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x89c4('0x18'))['db'];config[_0x89c4('0x19')]=_['defaults'](config[_0x89c4('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x89c4('0x1a'))(new Redis(config[_0x89c4('0x19')]));require(_0x89c4('0x1b'))[_0x89c4('0x1c')](socket);var jayson=require(_0x89c4('0x1d'));var client=jayson['client'][_0x89c4('0x1e')]({'port':0x232c});var client9002=jayson[_0x89c4('0x1f')][_0x89c4('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x48286c,_0x6f9159,_0x4e2097,_0x55a3a2){return new BPromise(function(_0x15d638,_0x22c796){var _0x24f8ae=_0x55a3a2||client;return _0x24f8ae[_0x89c4('0x20')](_0x48286c,_0x4e2097)[_0x89c4('0x21')](function(_0x18c45b){logger[_0x89c4('0x22')](_0x89c4('0x23'),_0x6f9159,'request\x20sent');logger[_0x89c4('0x24')](_0x89c4('0x25'),_0x6f9159,'request\x20sent',JSON[_0x89c4('0x26')](_0x18c45b));if(_0x18c45b[_0x89c4('0x27')]){if(_0x18c45b['error']['code']===0x1f4){logger[_0x89c4('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x6f9159,_0x18c45b['error']['message']);return _0x22c796(_0x18c45b['error'][_0x89c4('0x28')]);}logger[_0x89c4('0x27')](_0x89c4('0x23'),_0x6f9159,_0x18c45b['error'][_0x89c4('0x28')]);return _0x15d638(_0x18c45b[_0x89c4('0x27')]['message']);}else{logger[_0x89c4('0x22')](_0x89c4('0x23'),_0x6f9159,_0x89c4('0x29'));_0x15d638(_0x18c45b[_0x89c4('0x2a')][_0x89c4('0x28')]);}})[_0x89c4('0x2b')](function(_0x407677){logger[_0x89c4('0x27')](_0x89c4('0x23'),_0x6f9159,_0x407677);_0x22c796(_0x407677);});});}function respondWithStatusCode(_0x37f836,_0x30a82d){_0x30a82d=_0x30a82d||0xcc;return function(_0x1845ee){if(_0x1845ee){return _0x37f836[_0x89c4('0x2c')](_0x30a82d);}return _0x37f836[_0x89c4('0x2d')](_0x30a82d)[_0x89c4('0x2e')]();};}function respondWithResult(_0x35f1a7,_0x5b393a){_0x5b393a=_0x5b393a||0xc8;return function(_0x3dd289){if(_0x3dd289){return _0x35f1a7[_0x89c4('0x2d')](_0x5b393a)[_0x89c4('0x2f')](_0x3dd289);}};}function respondWithFilteredResult(_0x4d7ee7,_0x590d90){return function(_0x5d604c){if(_0x5d604c){var _0x25ff07=typeof _0x590d90[_0x89c4('0x30')]===_0x89c4('0x31')&&typeof _0x590d90[_0x89c4('0x32')]===_0x89c4('0x31');var _0x11eb00=_0x5d604c[_0x89c4('0x33')];var _0x34cd0a=_0x25ff07?0x0:_0x590d90[_0x89c4('0x30')];var _0x5e43e7=_0x25ff07?_0x5d604c['count']:_0x590d90['offset']+_0x590d90[_0x89c4('0x32')];var _0x4ddf9d;if(_0x5e43e7>=_0x11eb00){_0x5e43e7=_0x11eb00;_0x4ddf9d=0xc8;}else{_0x4ddf9d=0xce;}_0x4d7ee7[_0x89c4('0x2d')](_0x4ddf9d);return _0x4d7ee7['set'](_0x89c4('0x34'),_0x34cd0a+'-'+_0x5e43e7+'/'+_0x11eb00)[_0x89c4('0x2f')](_0x5d604c);}return null;};}function patchUpdates(_0x5dd051){return function(_0x42cba1){try{jsonpatch[_0x89c4('0x35')](_0x42cba1,_0x5dd051,!![]);}catch(_0x3f0b6c){return BPromise[_0x89c4('0x36')](_0x3f0b6c);}return _0x42cba1['save']();};}function saveUpdates(_0x57fd7a,_0x5e427d){return function(_0x4556b9){if(_0x4556b9){return _0x4556b9[_0x89c4('0x37')](_0x57fd7a)['then'](function(_0xcaeb69){return _0xcaeb69;});}return null;};}function removeEntity(_0x160139,_0xad55d0){return function(_0x25add7){if(_0x25add7){return _0x25add7['destroy']()['then'](function(){var _0x156512=_0x25add7['get']({'plain':!![]});var _0x171a33=_0x89c4('0x38');return db[_0x89c4('0x39')][_0x89c4('0x3a')]({'where':{'type':_0x171a33,'resourceId':_0x156512['id']}})[_0x89c4('0x21')](function(){return _0x25add7;});})[_0x89c4('0x21')](function(){_0x160139['status'](0xcc)[_0x89c4('0x2e')]();});}};}function handleEntityNotFound(_0x23656d,_0x5a34a7){return function(_0x1157d2){if(!_0x1157d2){_0x23656d[_0x89c4('0x2c')](0x194);}return _0x1157d2;};}function handleError(_0x34e548,_0x59a69b){_0x59a69b=_0x59a69b||0x1f4;return function(_0x3d386d){logger['error'](_0x3d386d[_0x89c4('0x3b')]);if(_0x3d386d[_0x89c4('0x3c')]){delete _0x3d386d['name'];}_0x34e548[_0x89c4('0x2d')](_0x59a69b)[_0x89c4('0x3d')](_0x3d386d);};}exports[_0x89c4('0x3e')]=function(_0x682bd6,_0x2a3609){var _0x283ff6={'include':[{'model':db[_0x89c4('0x3f')],'as':'mandatoryDispositionPause'}]},_0x79c5ab={},_0x38d13c={'count':0x0,'rows':[]};var _0x27d9e5=_[_0x89c4('0x40')](db[_0x89c4('0x41')][_0x89c4('0x42')],function(_0x413091){return{'name':_0x413091[_0x89c4('0x43')],'type':_0x413091[_0x89c4('0x44')]['key']};});_0x79c5ab[_0x89c4('0x45')]=_['map'](_0x27d9e5,_0x89c4('0x3c'));_0x79c5ab[_0x89c4('0x46')]=_[_0x89c4('0x47')](_0x682bd6['query']);_0x79c5ab[_0x89c4('0x48')]=_['intersection'](_0x79c5ab[_0x89c4('0x45')],_0x79c5ab[_0x89c4('0x46')]);_0x283ff6[_0x89c4('0x49')]=_['intersection'](_0x79c5ab[_0x89c4('0x45')],qs[_0x89c4('0x4a')](_0x682bd6[_0x89c4('0x46')][_0x89c4('0x4a')]));_0x283ff6[_0x89c4('0x49')]=_0x283ff6['attributes'][_0x89c4('0x4b')]?_0x283ff6['attributes']:_0x79c5ab[_0x89c4('0x45')];if(!_0x682bd6['query'][_0x89c4('0x4c')](_0x89c4('0x4d'))){_0x283ff6[_0x89c4('0x32')]=qs['limit'](_0x682bd6['query'][_0x89c4('0x32')]);_0x283ff6['offset']=qs[_0x89c4('0x30')](_0x682bd6['query']['offset']);}_0x283ff6[_0x89c4('0x4e')]=qs[_0x89c4('0x4f')](_0x682bd6[_0x89c4('0x46')]['sort']);_0x283ff6[_0x89c4('0x50')]=qs[_0x89c4('0x48')](_['pick'](_0x682bd6[_0x89c4('0x46')],_0x79c5ab[_0x89c4('0x48')]),_0x27d9e5);if(_0x682bd6['query']['filter']){_0x283ff6[_0x89c4('0x50')]=_[_0x89c4('0x51')](_0x283ff6[_0x89c4('0x50')],{'$or':_[_0x89c4('0x40')](_0x27d9e5,function(_0x50a6e8){if(_0x50a6e8[_0x89c4('0x44')]!==_0x89c4('0x52')){var _0x2ef13c={};_0x2ef13c[_0x50a6e8['name']]={'$like':'%'+_0x682bd6['query'][_0x89c4('0x53')]+'%'};return _0x2ef13c;}})});}_0x283ff6=_['merge']({},_0x283ff6,_0x682bd6[_0x89c4('0x54')]);var _0x2c91eb={'where':_0x283ff6[_0x89c4('0x50')]};return db[_0x89c4('0x41')][_0x89c4('0x33')](_0x2c91eb)[_0x89c4('0x21')](function(_0x3f1923){_0x38d13c[_0x89c4('0x33')]=_0x3f1923;if(_0x682bd6[_0x89c4('0x46')][_0x89c4('0x55')]){_0x283ff6[_0x89c4('0x56')]=[{'all':!![]}];}return db[_0x89c4('0x41')][_0x89c4('0x57')](_0x283ff6);})[_0x89c4('0x21')](function(_0x4b3e15){_0x38d13c[_0x89c4('0x58')]=_0x4b3e15;return _0x38d13c;})[_0x89c4('0x21')](respondWithFilteredResult(_0x2a3609,_0x283ff6))[_0x89c4('0x2b')](handleError(_0x2a3609,null));};exports['show']=function(_0x19e844,_0x4af079){var _0x2bdd29={'raw':![],'where':{'id':_0x19e844[_0x89c4('0x59')]['id']},'include':[{'model':db[_0x89c4('0x3f')],'as':'mandatoryDispositionPause'}]},_0x1eaf10={};_0x1eaf10[_0x89c4('0x45')]=_['keys'](db[_0x89c4('0x41')][_0x89c4('0x42')]);_0x1eaf10[_0x89c4('0x46')]=_[_0x89c4('0x47')](_0x19e844[_0x89c4('0x46')]);_0x1eaf10[_0x89c4('0x48')]=_[_0x89c4('0x5a')](_0x1eaf10[_0x89c4('0x45')],_0x1eaf10[_0x89c4('0x46')]);_0x2bdd29[_0x89c4('0x49')]=_[_0x89c4('0x5a')](_0x1eaf10[_0x89c4('0x45')],qs['fields'](_0x19e844[_0x89c4('0x46')][_0x89c4('0x4a')]));_0x2bdd29['attributes']=_0x2bdd29[_0x89c4('0x49')][_0x89c4('0x4b')]?_0x2bdd29[_0x89c4('0x49')]:_0x1eaf10['model'];if(_0x19e844['query'][_0x89c4('0x55')]){_0x2bdd29[_0x89c4('0x56')]=[{'all':!![]}];}_0x2bdd29=_[_0x89c4('0x51')]({},_0x2bdd29,_0x19e844[_0x89c4('0x54')]);return db[_0x89c4('0x41')][_0x89c4('0x5b')](_0x2bdd29)[_0x89c4('0x21')](handleEntityNotFound(_0x4af079,null))[_0x89c4('0x21')](respondWithResult(_0x4af079,null))[_0x89c4('0x2b')](handleError(_0x4af079,null));};exports[_0x89c4('0x5c')]=function(_0x3969a7,_0x569275){return db['OpenchannelAccount']['create'](_0x3969a7['body'],{})[_0x89c4('0x21')](function(_0x3df244){var _0x2910af=_0x3969a7[_0x89c4('0x5d')][_0x89c4('0x5e')]({'plain':!![]});if(!_0x2910af)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2910af[_0x89c4('0x5f')]===_0x89c4('0x5d')){var _0x4ad5b0=_0x3df244[_0x89c4('0x5e')]({'plain':!![]});var _0x44d59f='OpenchannelAccounts';return db['UserProfileSection']['find']({'where':{'name':_0x44d59f,'userProfileId':_0x2910af[_0x89c4('0x60')]},'raw':!![]})['then'](function(_0x644513){if(_0x644513&&_0x644513[_0x89c4('0x61')]===0x0){return db[_0x89c4('0x39')]['create']({'name':_0x4ad5b0['name'],'resourceId':_0x4ad5b0['id'],'type':_0x644513[_0x89c4('0x3c')],'sectionId':_0x644513['id']},{})[_0x89c4('0x21')](function(){return _0x3df244;});}else{return _0x3df244;}})['catch'](function(_0x5cd861){logger[_0x89c4('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5cd861);throw _0x5cd861;});}return _0x3df244;})['then'](respondWithResult(_0x569275,0xc9))[_0x89c4('0x2b')](handleError(_0x569275,null));};exports[_0x89c4('0x37')]=function(_0x74f74e,_0x3a98e3){if(_0x74f74e[_0x89c4('0x62')]['id']){delete _0x74f74e[_0x89c4('0x62')]['id'];}return db['OpenchannelAccount'][_0x89c4('0x5b')]({'where':{'id':_0x74f74e[_0x89c4('0x59')]['id']},'include':[{'model':db[_0x89c4('0x3f')],'as':_0x89c4('0x63')}]})[_0x89c4('0x21')](handleEntityNotFound(_0x3a98e3,null))[_0x89c4('0x21')](saveUpdates(_0x74f74e[_0x89c4('0x62')],null))[_0x89c4('0x21')](respondWithResult(_0x3a98e3,null))['catch'](handleError(_0x3a98e3,null));};exports[_0x89c4('0x3a')]=function(_0x17d917,_0x21ed54){return db[_0x89c4('0x41')]['find']({'where':{'id':_0x17d917['params']['id']}})[_0x89c4('0x21')](handleEntityNotFound(_0x21ed54,null))['then'](removeEntity(_0x21ed54,null))['catch'](handleError(_0x21ed54,null));};exports['describe']=function(_0xcb0de3,_0x403295){return db[_0x89c4('0x41')][_0x89c4('0x64')]()[_0x89c4('0x21')](respondWithResult(_0x403295,null))[_0x89c4('0x2b')](handleError(_0x403295,null));};exports[_0x89c4('0x65')]=function(_0x218c23,_0x325e85,_0x35f3f9){if(_0x218c23[_0x89c4('0x62')]['id']){delete _0x218c23[_0x89c4('0x62')]['id'];}return db[_0x89c4('0x41')][_0x89c4('0x5b')]({'where':{'id':_0x218c23[_0x89c4('0x59')]['id']}})[_0x89c4('0x21')](handleEntityNotFound(_0x325e85,null))[_0x89c4('0x21')](function(_0x2e6af6){if(_0x2e6af6){_0x218c23[_0x89c4('0x62')]['OpenchannelAccountId']=_0x2e6af6['id'];return db[_0x89c4('0x66')]['create'](_0x218c23[_0x89c4('0x62')]);}})[_0x89c4('0x21')](respondWithResult(_0x325e85,null))[_0x89c4('0x2b')](handleError(_0x325e85,null));};exports[_0x89c4('0x67')]=function(_0x3bcb4b,_0x5efa2e,_0x56d2dd){var _0x543621={'raw':![],'where':{}};var _0x268d04={};var _0x5630d6={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x3bcb4b['params']['id']}})[_0x89c4('0x21')](handleEntityNotFound(_0x5efa2e,null))[_0x89c4('0x21')](function(_0x12b0cd){if(_0x12b0cd){_0x268d04[_0x89c4('0x45')]=_[_0x89c4('0x47')](db[_0x89c4('0x66')][_0x89c4('0x42')]);_0x268d04[_0x89c4('0x46')]=_[_0x89c4('0x47')](_0x3bcb4b['query']);_0x268d04['filters']=_[_0x89c4('0x5a')](_0x268d04[_0x89c4('0x45')],_0x268d04['query']);_0x543621[_0x89c4('0x49')]=_[_0x89c4('0x5a')](_0x268d04[_0x89c4('0x45')],qs[_0x89c4('0x4a')](_0x3bcb4b[_0x89c4('0x46')][_0x89c4('0x4a')]));_0x543621[_0x89c4('0x49')]=_0x543621[_0x89c4('0x49')]['length']?_0x543621[_0x89c4('0x49')]:_0x268d04[_0x89c4('0x45')];if(!_0x3bcb4b['query']['hasOwnProperty'](_0x89c4('0x4d'))){_0x543621[_0x89c4('0x32')]=qs['limit'](_0x3bcb4b[_0x89c4('0x46')][_0x89c4('0x32')]);_0x543621[_0x89c4('0x30')]=qs[_0x89c4('0x30')](_0x3bcb4b[_0x89c4('0x46')][_0x89c4('0x30')]);}_0x543621[_0x89c4('0x4e')]=qs['sort'](_0x3bcb4b[_0x89c4('0x46')][_0x89c4('0x4f')]);_0x543621['where']=qs[_0x89c4('0x48')](_['pick'](_0x3bcb4b[_0x89c4('0x46')],_0x268d04['filters']));_0x543621['where'][_0x89c4('0x68')]=_0x12b0cd['id'];if(_0x3bcb4b['query'][_0x89c4('0x53')]){_0x543621[_0x89c4('0x50')]=_['merge'](_0x543621[_0x89c4('0x50')],{'$or':_[_0x89c4('0x40')](_0x543621[_0x89c4('0x49')],function(_0x1df8df){var _0x2c4b66={};_0x2c4b66[_0x1df8df]={'$like':'%'+_0x3bcb4b[_0x89c4('0x46')][_0x89c4('0x53')]+'%'};return _0x2c4b66;})});}_0x543621=_[_0x89c4('0x51')]({},_0x543621,_0x3bcb4b['options']);return db['Disposition']['count']({'where':_0x543621[_0x89c4('0x50')]})[_0x89c4('0x21')](function(_0x4473ba){_0x5630d6[_0x89c4('0x33')]=_0x4473ba;if(_0x3bcb4b[_0x89c4('0x46')][_0x89c4('0x55')]){_0x543621[_0x89c4('0x56')]=[{'all':!![]}];}return db[_0x89c4('0x66')][_0x89c4('0x57')](_0x543621);})[_0x89c4('0x21')](function(_0x5618bf){_0x5630d6[_0x89c4('0x58')]=_0x5618bf;return _0x5630d6;});}})[_0x89c4('0x21')](respondWithFilteredResult(_0x5efa2e,_0x543621))[_0x89c4('0x2b')](handleError(_0x5efa2e,null));};exports[_0x89c4('0x69')]=function(_0x5caec0,_0x187b03,_0x38789b){return db['OpenchannelAccount'][_0x89c4('0x5b')]({'where':{'id':_0x5caec0[_0x89c4('0x59')]['id']}})[_0x89c4('0x21')](handleEntityNotFound(_0x187b03,null))['then'](function(_0x82dc63){if(_0x82dc63){return _0x82dc63[_0x89c4('0x69')](_0x5caec0[_0x89c4('0x46')][_0x89c4('0x6a')]);}})['then'](respondWithStatusCode(_0x187b03,null))['catch'](handleError(_0x187b03,null));};exports['addAnswer']=function(_0x29cc8f,_0x5ecd31,_0xf6bf3d){if(_0x29cc8f['body']['id']){delete _0x29cc8f[_0x89c4('0x62')]['id'];}return db[_0x89c4('0x41')][_0x89c4('0x5b')]({'where':{'id':_0x29cc8f['params']['id']}})[_0x89c4('0x21')](handleEntityNotFound(_0x5ecd31,null))[_0x89c4('0x21')](function(_0x4a6077){if(_0x4a6077){_0x29cc8f[_0x89c4('0x62')][_0x89c4('0x68')]=_0x4a6077['id'];return db[_0x89c4('0x6b')]['create'](_0x29cc8f['body']);}})[_0x89c4('0x21')](respondWithResult(_0x5ecd31,null))[_0x89c4('0x2b')](handleError(_0x5ecd31,null));};exports[_0x89c4('0x6c')]=function(_0x3131c2,_0x2793b6,_0x4c4009){var _0x52f495={'raw':![],'where':{}};var _0x15a973={};var _0x44aade={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x3131c2[_0x89c4('0x59')]['id']}})[_0x89c4('0x21')](handleEntityNotFound(_0x2793b6,null))[_0x89c4('0x21')](function(_0x2e5abf){if(_0x2e5abf){_0x15a973[_0x89c4('0x45')]=_[_0x89c4('0x47')](db[_0x89c4('0x6b')]['rawAttributes']);_0x15a973[_0x89c4('0x46')]=_[_0x89c4('0x47')](_0x3131c2['query']);_0x15a973['filters']=_[_0x89c4('0x5a')](_0x15a973[_0x89c4('0x45')],_0x15a973[_0x89c4('0x46')]);_0x52f495[_0x89c4('0x49')]=_['intersection'](_0x15a973[_0x89c4('0x45')],qs[_0x89c4('0x4a')](_0x3131c2[_0x89c4('0x46')][_0x89c4('0x4a')]));_0x52f495[_0x89c4('0x49')]=_0x52f495[_0x89c4('0x49')][_0x89c4('0x4b')]?_0x52f495[_0x89c4('0x49')]:_0x15a973[_0x89c4('0x45')];if(!_0x3131c2[_0x89c4('0x46')][_0x89c4('0x4c')]('nolimit')){_0x52f495['limit']=qs['limit'](_0x3131c2['query'][_0x89c4('0x32')]);_0x52f495['offset']=qs[_0x89c4('0x30')](_0x3131c2['query'][_0x89c4('0x30')]);}_0x52f495[_0x89c4('0x4e')]=qs[_0x89c4('0x4f')](_0x3131c2[_0x89c4('0x46')]['sort']);_0x52f495['where']=qs[_0x89c4('0x48')](_[_0x89c4('0x6d')](_0x3131c2[_0x89c4('0x46')],_0x15a973[_0x89c4('0x48')]));_0x52f495[_0x89c4('0x50')]['OpenchannelAccountId']=_0x2e5abf['id'];if(_0x3131c2[_0x89c4('0x46')]['filter']){_0x52f495[_0x89c4('0x50')]=_[_0x89c4('0x51')](_0x52f495[_0x89c4('0x50')],{'$or':_[_0x89c4('0x40')](_0x52f495[_0x89c4('0x49')],function(_0x1b8f67){var _0x18e46f={};_0x18e46f[_0x1b8f67]={'$like':'%'+_0x3131c2['query'][_0x89c4('0x53')]+'%'};return _0x18e46f;})});}_0x52f495=_['merge']({},_0x52f495,_0x3131c2['options']);return db['CannedAnswer']['count']({'where':_0x52f495[_0x89c4('0x50')]})[_0x89c4('0x21')](function(_0x5f5550){_0x44aade[_0x89c4('0x33')]=_0x5f5550;if(_0x3131c2[_0x89c4('0x46')][_0x89c4('0x55')]){_0x52f495[_0x89c4('0x56')]=[{'all':!![]}];}return db[_0x89c4('0x6b')]['findAll'](_0x52f495);})[_0x89c4('0x21')](function(_0x55b3ee){_0x44aade[_0x89c4('0x58')]=_0x55b3ee;return _0x44aade;});}})['then'](respondWithFilteredResult(_0x2793b6,_0x52f495))[_0x89c4('0x2b')](handleError(_0x2793b6,null));};exports[_0x89c4('0x6e')]=function(_0x45754a,_0x1b09b3,_0x2b32e2){return db['OpenchannelAccount'][_0x89c4('0x5b')]({'where':{'id':_0x45754a[_0x89c4('0x59')]['id']}})[_0x89c4('0x21')](handleEntityNotFound(_0x1b09b3,null))[_0x89c4('0x21')](function(_0x1c0e2e){if(_0x1c0e2e){return _0x1c0e2e[_0x89c4('0x6e')](_0x45754a['query'][_0x89c4('0x6a')]);}})[_0x89c4('0x21')](respondWithStatusCode(_0x1b09b3,null))['catch'](handleError(_0x1b09b3,null));};exports[_0x89c4('0x6f')]=function(_0x1bc294,_0x56743c,_0x325a4b){var _0x45e6c3={'body':_0x1bc294['body'],'channel':'openchannel'};var _0x3dc27f=[];var _0x6b9e28=[];var _0x362a46={};var _0x16d2f0=![];return db[_0x89c4('0x70')][_0x89c4('0x64')]()[_0x89c4('0x21')](function(_0xdc259e){if(!_0xdc259e){throw new db['Sequelize'][(_0x89c4('0x71'))](_0x89c4('0x72'));}_0x3dc27f=_[_0x89c4('0x73')](_[_0x89c4('0x47')](_0xdc259e),['createdAt',_0x89c4('0x74')]);_0x6b9e28=_[_0x89c4('0x73')](_[_0x89c4('0x47')](_0xdc259e),[_0x89c4('0x75'),'updatedAt',_0x89c4('0x76'),_0x89c4('0x77')]);if(_0x1bc294[_0x89c4('0x62')]['id']){delete _0x1bc294[_0x89c4('0x62')]['id'];}if(_[_0x89c4('0x78')](_0x1bc294[_0x89c4('0x62')][_0x89c4('0x79')])){throw new db['Sequelize']['ValidationError'](_0x89c4('0x7a'));}if(_[_0x89c4('0x78')](_0x1bc294[_0x89c4('0x62')][_0x89c4('0x62')])||_0x1bc294[_0x89c4('0x62')][_0x89c4('0x62')]===''){throw new db['Sequelize'][(_0x89c4('0x71'))](_0x89c4('0x7b'));}if(_[_0x89c4('0x78')](_0x1bc294[_0x89c4('0x62')][_0x89c4('0x7c')])){throw new db[(_0x89c4('0x7d'))]['ValidationError'](_0x89c4('0x7e')+_0x6b9e28);}if(!_[_0x89c4('0x7f')](_0x6b9e28,_0x1bc294[_0x89c4('0x62')][_0x89c4('0x7c')])){throw new db[(_0x89c4('0x7d'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x6b9e28);}_0x362a46[_0x1bc294['body'][_0x89c4('0x7c')]]=_0x1bc294[_0x89c4('0x62')]['from'];})[_0x89c4('0x21')](function(){return db[_0x89c4('0x41')][_0x89c4('0x5b')]({'where':{'id':_0x1bc294['params']['id']},'include':[{'model':db[_0x89c4('0x80')],'as':_0x89c4('0x81'),'include':[{'model':db['CmContact'],'as':_0x89c4('0x82'),'where':_0x362a46,'limit':0x1,'order':[['updatedAt',_0x89c4('0x83')]]}]},{'model':db[_0x89c4('0x84')],'as':_0x89c4('0x85')}]});})[_0x89c4('0x21')](handleEntityNotFound(_0x56743c,null))[_0x89c4('0x21')](function(_0x2cdfe2){if(_0x2cdfe2&&_0x2cdfe2['List']){_0x45e6c3[_0x89c4('0x86')]=_0x2cdfe2;_0x45e6c3[_0x89c4('0x87')]=_0x2cdfe2['Applications'];_0x45e6c3[_0x89c4('0x88')]=_0x2cdfe2[_0x89c4('0x81')];_0x45e6c3[_0x89c4('0x87')]=_[_0x89c4('0x89')](_0x45e6c3[_0x89c4('0x87')],[_0x89c4('0x8a')],[_0x89c4('0x8b')]);if(_0x45e6c3[_0x89c4('0x86')][_0x89c4('0x85')]){delete _0x45e6c3[_0x89c4('0x86')][_0x89c4('0x85')];}if(_0x45e6c3[_0x89c4('0x86')]['List']&&_0x45e6c3[_0x89c4('0x86')]['List']['Contacts'][_0x89c4('0x4b')]){return _0x45e6c3['account'][_0x89c4('0x81')][_0x89c4('0x82')][0x0];}var _0x59ddd6=_['defaults'](_0x1bc294[_0x89c4('0x62')],{'firstName':_0x1bc294[_0x89c4('0x62')]['from'],'ListId':_0x2cdfe2[_0x89c4('0x77')]});_0x59ddd6[_0x1bc294[_0x89c4('0x62')][_0x89c4('0x7c')]]=_0x1bc294[_0x89c4('0x62')][_0x89c4('0x79')];return db['CmContact'][_0x89c4('0x5c')](_0x59ddd6,{'fields':_0x3dc27f,'raw':!![]});}})['then'](handleEntityNotFound(_0x56743c,null))[_0x89c4('0x21')](function(_0x480200){_0x45e6c3[_0x89c4('0x8c')]=_0x480200;if(_0x480200){var _0x324aa1={'ContactId':_0x480200['id'],'OpenchannelAccountId':_0x1bc294['params']['id'],'from':(_0x480200['firstName']||'')+'\x20'+(_0x480200['lastName']||'')};var _0x39838c={'OpenchannelAccountId':_0x1bc294[_0x89c4('0x59')]['id'],'closed':![]};if(_0x1bc294[_0x89c4('0x62')]['threadId']){_0x39838c['threadId']=_0x1bc294[_0x89c4('0x62')][_0x89c4('0x8d')];return db['OpenchannelInteraction'][_0x89c4('0x5b')]({'where':_0x39838c})[_0x89c4('0x21')](function(_0x5019b3){if(_0x5019b3){return[_0x5019b3,![]];}_0x324aa1['threadId']=_0x1bc294[_0x89c4('0x62')][_0x89c4('0x8d')];_0x324aa1['externalUrl']=_0x1bc294['body']['externalUrl'];return db[_0x89c4('0x8e')][_0x89c4('0x5c')](_0x324aa1)['then'](function(_0x3e049f){return[_0x3e049f,!![]];});});}else{_0x39838c[_0x89c4('0x8d')]=null;}_0x39838c[_0x89c4('0x8f')]=_0x480200['id'];return db[_0x89c4('0x8e')][_0x89c4('0x5b')]({'where':_0x39838c})[_0x89c4('0x21')](function(_0x2e347e){if(_0x2e347e){return[_0x2e347e,![]];}return db[_0x89c4('0x8e')][_0x89c4('0x5c')](_0x324aa1)[_0x89c4('0x21')](function(_0x5235bb){return[_0x5235bb,!![]];});});}})[_0x89c4('0x90')](function(_0x5ed79c,_0x5639e7){if(_0x5ed79c){_0x16d2f0=_0x5639e7;if(!_0x5639e7){var _0x4c0e70={'from':(_0x45e6c3[_0x89c4('0x8c')]['firstName']||'')+'\x20'+(_0x45e6c3[_0x89c4('0x8c')][_0x89c4('0x91')]||'')};if(_0x1bc294[_0x89c4('0x62')]['threadId']&&_0x1bc294[_0x89c4('0x62')][_0x89c4('0x92')]&&_0x1bc294[_0x89c4('0x62')][_0x89c4('0x8d')]!=_0x1bc294[_0x89c4('0x62')]['messageId']){_0x4c0e70[_0x89c4('0x8d')]=_0x1bc294['body']['messageId'];}return _0x5ed79c[_0x89c4('0x37')](_0x4c0e70);}else{return _0x5ed79c;}}})[_0x89c4('0x21')](function(_0x52514e){_0x45e6c3[_0x89c4('0x93')]=_0x52514e[_0x89c4('0x5e')]({'plain':!![]});_0x45e6c3[_0x89c4('0x93')][_0x89c4('0x94')]=_0x16d2f0;if(_0x45e6c3[_0x89c4('0x93')][_0x89c4('0x94')]){if(_0x45e6c3['account']['autoclose']){_0x45e6c3[_0x89c4('0x87')]['push']({'id':0x0,'priority':_0x45e6c3[_0x89c4('0x87')]['length']+0x1,'app':_0x89c4('0x95'),'appdata':_0x89c4('0x96'),'interval':_0x89c4('0x97')});}}return db[_0x89c4('0x98')]['create']({'body':_0x1bc294['body'][_0x89c4('0x62')],'OpenchannelAccountId':_0x1bc294['params']['id'],'OpenchannelInteractionId':_0x52514e['id'],'direction':'in','ContactId':_0x45e6c3[_0x89c4('0x8c')]['id'],'AttachmentId':_0x1bc294['body'][_0x89c4('0x99')]});})[_0x89c4('0x21')](function(_0x4a1afc){_0x45e6c3[_0x89c4('0x28')]=_0x4a1afc;if(_0x45e6c3['interaction'][_0x89c4('0x9a')]){return db['User'][_0x89c4('0x5b')]({'attributes':['id',_0x89c4('0x3c')],'where':{'id':_0x45e6c3[_0x89c4('0x93')][_0x89c4('0x9a')]}})[_0x89c4('0x21')](function(_0x471acf){if(_0x471acf){_0x45e6c3['applications'][_0x89c4('0x9b')]({'id':0x0,'priority':0x0,'app':_0x89c4('0x9c'),'appdata':_0x471acf[_0x89c4('0x3c')]+','+(_0x45e6c3[_0x89c4('0x86')]['waitForTheAssignedAgent']||0xa),'interval':_0x89c4('0x97')});_0x45e6c3[_0x89c4('0x9d')]=![];}return respondWithRpcPromise(_0x89c4('0x9e'),_0x89c4('0x9f'),_0x45e6c3);});}return respondWithRpcPromise(_0x89c4('0x9e'),'startRouting',_0x45e6c3);})[_0x89c4('0x21')](function(_0x219cae){respondWithRpcPromise(_0x89c4('0xa0'),_0x89c4('0xa0'),{'event':_0x89c4('0x6f'),'message':_0x219cae},client9002);return _0x219cae;})[_0x89c4('0x21')](respondWithResult(_0x56743c,null))[_0x89c4('0x2b')](handleError(_0x56743c,null));};exports[_0x89c4('0xa1')]=function(_0x4f4575,_0xd4ca7e){var _0x432a89=_0x4f4575[_0x89c4('0x59')]['id'];var _0x5d024f=_0x4f4575['body'];var _0x572b9c=0xc8;var _0x3feb27=null;return db[_0x89c4('0xa2')][_0x89c4('0xa3')]({'isolationLevel':db['sequelize'][_0x89c4('0xa4')][_0x89c4('0xa5')][_0x89c4('0xa6')]},function(_0x1bae66){return db[_0x89c4('0x41')][_0x89c4('0xa7')]({'where':{'id':_0x432a89},'transaction':_0x1bae66})[_0x89c4('0x21')](function(_0x1f7986){if(_0x1f7986){return db[_0x89c4('0x84')][_0x89c4('0x3a')]({'where':{'OpenchannelAccountId':_0x432a89},'transaction':_0x1bae66})[_0x89c4('0x21')](function(){var _0x104e89=_[_0x89c4('0x40')](_0x5d024f,function(_0xe541f3){_0xe541f3[_0x89c4('0x68')]=_0x432a89;return _0xe541f3;});return db['OpenchannelApplication'][_0x89c4('0xa8')](_0x104e89,{'transaction':_0x1bae66});});}else{_0x572b9c=0x194;_0x3feb27=[];}});})[_0x89c4('0x21')](function(){if(_0x572b9c!==0x194){return db[_0x89c4('0x84')][_0x89c4('0xa9')]({'where':{'OpenchannelAccountId':_0x432a89},'order':_0x89c4('0x8a')})[_0x89c4('0x21')](function(_0x560fc5){_0x3feb27=_0x560fc5;});}})[_0x89c4('0x2b')](function(_0x31b032){_0x572b9c=0x1f4;logger[_0x89c4('0x27')](_0x31b032[_0x89c4('0x3b')]);if(_0x31b032['name']){delete _0x31b032['name'];}_0x3feb27=_0x31b032;})['finally'](function(){if(_0x3feb27===null){_0xd4ca7e[_0x89c4('0x2c')](_0x572b9c);}else{if(_0x572b9c===0x1f4){_0xd4ca7e[_0x89c4('0x2d')](_0x572b9c)['send'](_0x3feb27);}else{_0xd4ca7e[_0x89c4('0x2d')](_0x572b9c)['json'](_0x3feb27);}}});};exports[_0x89c4('0xaa')]=function(_0x2d1b96,_0x1c3e92,_0x5a2840){var _0x482dd4={};var _0x254bef={};var _0x1a967e;var _0x1d8904;return db['OpenchannelAccount'][_0x89c4('0xa7')]({'where':{'id':_0x2d1b96[_0x89c4('0x59')]['id']}})[_0x89c4('0x21')](handleEntityNotFound(_0x1c3e92,null))[_0x89c4('0x21')](function(_0x3abec0){if(_0x3abec0){_0x1a967e=_0x3abec0;_0x254bef[_0x89c4('0x45')]=_['keys'](db['OpenchannelApplication'][_0x89c4('0x42')]);_0x254bef[_0x89c4('0x46')]=_[_0x89c4('0x47')](_0x2d1b96[_0x89c4('0x46')]);_0x254bef[_0x89c4('0x48')]=_[_0x89c4('0x5a')](_0x254bef[_0x89c4('0x45')],_0x254bef['query']);_0x482dd4['attributes']=_['intersection'](_0x254bef[_0x89c4('0x45')],qs[_0x89c4('0x4a')](_0x2d1b96[_0x89c4('0x46')][_0x89c4('0x4a')]));_0x482dd4['attributes']=_0x482dd4['attributes'][_0x89c4('0x4b')]?_0x482dd4['attributes']:_0x254bef[_0x89c4('0x45')];_0x482dd4[_0x89c4('0x4e')]=qs[_0x89c4('0x4f')](_0x2d1b96[_0x89c4('0x46')]['sort']);_0x482dd4[_0x89c4('0x50')]=qs[_0x89c4('0x48')](_[_0x89c4('0x6d')](_0x2d1b96['query'],_0x254bef[_0x89c4('0x48')]));if(_0x2d1b96['query'][_0x89c4('0x53')]){_0x482dd4['where']=_['merge'](_0x482dd4[_0x89c4('0x50')],{'$or':_['map'](_0x482dd4[_0x89c4('0x49')],function(_0x5b8540){var _0x3a9d7f={};_0x3a9d7f[_0x5b8540]={'$like':'%'+_0x2d1b96[_0x89c4('0x46')][_0x89c4('0x53')]+'%'};return _0x3a9d7f;})});}_0x482dd4=_[_0x89c4('0x51')]({},_0x482dd4,_0x2d1b96[_0x89c4('0x54')]);return _0x1a967e[_0x89c4('0xaa')](_0x482dd4);}})[_0x89c4('0x21')](function(_0x312297){if(_0x312297){_0x1d8904=_0x312297[_0x89c4('0x4b')];if(!_0x2d1b96[_0x89c4('0x46')][_0x89c4('0x4c')](_0x89c4('0x4d'))){_0x482dd4['limit']=qs[_0x89c4('0x32')](_0x2d1b96[_0x89c4('0x46')][_0x89c4('0x32')]);_0x482dd4['offset']=qs[_0x89c4('0x30')](_0x2d1b96[_0x89c4('0x46')][_0x89c4('0x30')]);}return _0x1a967e['getApplications'](_0x482dd4);}})[_0x89c4('0x21')](function(_0x2b9d2e){if(_0x2b9d2e){return _0x2b9d2e?{'count':_0x1d8904,'rows':_0x2b9d2e}:null;}})[_0x89c4('0x21')](respondWithResult(_0x1c3e92,null))[_0x89c4('0x2b')](handleError(_0x1c3e92,null));};exports['getInteractions']=function(_0x463f82,_0x2d7226,_0x515df9){var _0x2bdffa={'raw':![],'where':{}};var _0x24a000={};var _0x4d0e85={'count':0x0,'rows':[]};return db[_0x89c4('0x41')]['findOne']({'where':{'id':_0x463f82[_0x89c4('0x59')]['id']}})[_0x89c4('0x21')](handleEntityNotFound(_0x2d7226,null))[_0x89c4('0x21')](function(_0x280117){if(_0x280117){_0x24a000[_0x89c4('0x45')]=_[_0x89c4('0x47')](db[_0x89c4('0x8e')][_0x89c4('0x42')]);_0x24a000[_0x89c4('0x46')]=_[_0x89c4('0x47')](_0x463f82[_0x89c4('0x46')]);_0x24a000[_0x89c4('0x48')]=_[_0x89c4('0x5a')](_0x24a000[_0x89c4('0x45')],_0x24a000['query']);_0x2bdffa[_0x89c4('0x49')]=_[_0x89c4('0x5a')](_0x24a000[_0x89c4('0x45')],qs[_0x89c4('0x4a')](_0x463f82[_0x89c4('0x46')][_0x89c4('0x4a')]));_0x2bdffa['attributes']=_0x2bdffa[_0x89c4('0x49')]['length']?_0x2bdffa[_0x89c4('0x49')]:_0x24a000['model'];if(!_0x463f82[_0x89c4('0x46')][_0x89c4('0x4c')](_0x89c4('0x4d'))){_0x2bdffa['limit']=qs[_0x89c4('0x32')](_0x463f82[_0x89c4('0x46')][_0x89c4('0x32')]);_0x2bdffa[_0x89c4('0x30')]=qs[_0x89c4('0x30')](_0x463f82[_0x89c4('0x46')]['offset']);}_0x2bdffa[_0x89c4('0x4e')]=qs[_0x89c4('0x4f')](_0x463f82[_0x89c4('0x46')][_0x89c4('0x4f')]);_0x2bdffa[_0x89c4('0x50')]=qs[_0x89c4('0x48')](_[_0x89c4('0x6d')](_0x463f82[_0x89c4('0x46')],_0x24a000[_0x89c4('0x48')]));_0x2bdffa[_0x89c4('0x50')]['OpenchannelAccountId']=_0x280117['id'];if(_0x463f82[_0x89c4('0x46')]['filter']){_0x2bdffa[_0x89c4('0x50')]=_[_0x89c4('0x51')](_0x2bdffa[_0x89c4('0x50')],{'$or':_[_0x89c4('0x40')](_0x2bdffa[_0x89c4('0x49')],function(_0x3d8558){var _0x349ebb={};_0x349ebb[_0x3d8558]={'$like':'%'+_0x463f82['query'][_0x89c4('0x53')]+'%'};return _0x349ebb;})});}_0x2bdffa=_[_0x89c4('0x51')]({},_0x2bdffa,_0x463f82[_0x89c4('0x54')]);return db[_0x89c4('0x8e')][_0x89c4('0x33')]({'where':_0x2bdffa[_0x89c4('0x50')]})[_0x89c4('0x21')](function(_0x27824e){_0x4d0e85[_0x89c4('0x33')]=_0x27824e;if(_0x463f82['query'][_0x89c4('0x55')]){_0x2bdffa[_0x89c4('0x56')]=[{'model':db['CmContact'],'as':_0x89c4('0xab'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x89c4('0x3c'),_0x89c4('0xac'),_0x89c4('0xad')],'required':![]},{'model':db[_0x89c4('0xae')],'as':_0x89c4('0xaf'),'attributes':['id',_0x89c4('0x3c'),_0x89c4('0xb0')],'where':_0x463f82[_0x89c4('0x46')][_0x89c4('0xb1')]?{'id':_0x463f82[_0x89c4('0x46')]['tag']}:undefined,'required':_0x463f82[_0x89c4('0x46')][_0x89c4('0xb1')]?!![]:![]}];}return db[_0x89c4('0x8e')][_0x89c4('0x57')](_0x2bdffa);})[_0x89c4('0x21')](function(_0x48da6e){_0x4d0e85[_0x89c4('0x58')]=_0x48da6e;return _0x4d0e85;});}})[_0x89c4('0x21')](respondWithFilteredResult(_0x2d7226,_0x2bdffa))[_0x89c4('0x2b')](handleError(_0x2d7226,null));};exports[_0x89c4('0xb2')]=function(_0x5b283b,_0x2db741,_0x516bac){return db[_0x89c4('0x41')][_0x89c4('0x5b')]({'where':{'id':_0x5b283b[_0x89c4('0x59')]['id']}})[_0x89c4('0x21')](handleEntityNotFound(_0x2db741,null))[_0x89c4('0x21')](function(_0x35eb42){if(_0x35eb42){return _0x35eb42['addAgents'](_0x5b283b[_0x89c4('0x62')][_0x89c4('0x6a')],_[_0x89c4('0xb3')](_0x5b283b['body'],['ids','id'])||{})['spread'](function(_0x2200ae){for(var _0x3c1b79=0x0;_0x3c1b79<_0x5b283b[_0x89c4('0x62')][_0x89c4('0x6a')][_0x89c4('0x4b')];_0x3c1b79+=0x1){socket[_0x89c4('0xb4')](_0x89c4('0xb5'),{'UserId':Number(_0x5b283b[_0x89c4('0x62')][_0x89c4('0x6a')][_0x3c1b79]),'OpenchannelAccountId':Number(_0x5b283b[_0x89c4('0x59')]['id'])});}return _0x2200ae;});}})[_0x89c4('0x21')](respondWithResult(_0x2db741,null))[_0x89c4('0x2b')](handleError(_0x2db741,null));};exports[_0x89c4('0xb6')]=function(_0x47714d,_0x2a2c20,_0x5b7431){return db[_0x89c4('0x41')][_0x89c4('0x5b')]({'where':{'id':_0x47714d[_0x89c4('0x59')]['id']}})[_0x89c4('0x21')](handleEntityNotFound(_0x2a2c20,null))['then'](function(_0x4dca0d){if(_0x4dca0d){return _0x4dca0d['removeAgents'](_0x47714d[_0x89c4('0x46')]['ids'])[_0x89c4('0x21')](function(){if(_[_0x89c4('0xb7')](_0x47714d[_0x89c4('0x46')][_0x89c4('0x6a')])){for(var _0x25802f=0x0;_0x25802f<_0x47714d['query']['ids'][_0x89c4('0x4b')];_0x25802f+=0x1){socket['emit'](_0x89c4('0xb8'),{'UserId':Number(_0x47714d[_0x89c4('0x46')][_0x89c4('0x6a')][_0x25802f]),'OpenchannelAccountId':Number(_0x47714d[_0x89c4('0x59')]['id'])});}}else{socket[_0x89c4('0xb4')](_0x89c4('0xb8'),{'UserId':Number(_0x47714d['query']['ids']),'OpenchannelAccountId':Number(_0x47714d['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2a2c20,null))['catch'](handleError(_0x2a2c20,null));};exports['getAgents']=function(_0x1c2dd2,_0x128443,_0x372144){var _0xd7ed85={};var _0x5590f1={};var _0x2c1359;var _0x26ef5e;return db[_0x89c4('0x41')][_0x89c4('0xa7')]({'where':{'id':_0x1c2dd2[_0x89c4('0x59')]['id']}})[_0x89c4('0x21')](handleEntityNotFound(_0x128443,null))['then'](function(_0x19af4e){if(_0x19af4e){_0x2c1359=_0x19af4e;_0x5590f1[_0x89c4('0x45')]=_['keys'](db[_0x89c4('0xb9')]['rawAttributes']);_0x5590f1[_0x89c4('0x46')]=_[_0x89c4('0x47')](_0x1c2dd2['query']);_0x5590f1[_0x89c4('0x48')]=_[_0x89c4('0x5a')](_0x5590f1[_0x89c4('0x45')],_0x5590f1[_0x89c4('0x46')]);_0xd7ed85[_0x89c4('0x49')]=_[_0x89c4('0x5a')](_0x5590f1[_0x89c4('0x45')],qs['fields'](_0x1c2dd2[_0x89c4('0x46')][_0x89c4('0x4a')]));_0xd7ed85[_0x89c4('0x49')]=_0xd7ed85['attributes'][_0x89c4('0x4b')]?_0xd7ed85[_0x89c4('0x49')]:_0x5590f1[_0x89c4('0x45')];_0xd7ed85['order']=qs['sort'](_0x1c2dd2[_0x89c4('0x46')]['sort']);_0xd7ed85['where']=qs['filters'](_[_0x89c4('0x6d')](_0x1c2dd2[_0x89c4('0x46')],_0x5590f1[_0x89c4('0x48')]));if(_0x1c2dd2[_0x89c4('0x46')][_0x89c4('0x53')]){_0xd7ed85['where']=_[_0x89c4('0x51')](_0xd7ed85[_0x89c4('0x50')],{'$or':_[_0x89c4('0x40')](_0xd7ed85['attributes'],function(_0x4f87c3){var _0x2d598d={};_0x2d598d[_0x4f87c3]={'$like':'%'+_0x1c2dd2[_0x89c4('0x46')][_0x89c4('0x53')]+'%'};return _0x2d598d;})});}_0xd7ed85=_[_0x89c4('0x51')]({},_0xd7ed85,_0x1c2dd2[_0x89c4('0x54')]);return _0x2c1359['getAgents'](_0xd7ed85);}})[_0x89c4('0x21')](function(_0xd1988){if(_0xd1988){_0x26ef5e=_0xd1988['length'];if(!_0x1c2dd2[_0x89c4('0x46')]['hasOwnProperty'](_0x89c4('0x4d'))){_0xd7ed85[_0x89c4('0x32')]=qs[_0x89c4('0x32')](_0x1c2dd2[_0x89c4('0x46')][_0x89c4('0x32')]);_0xd7ed85[_0x89c4('0x30')]=qs[_0x89c4('0x30')](_0x1c2dd2[_0x89c4('0x46')]['offset']);}return _0x2c1359[_0x89c4('0xba')](_0xd7ed85);}})[_0x89c4('0x21')](function(_0x3c0bcf){if(_0x3c0bcf){return _0x3c0bcf?{'count':_0x26ef5e,'rows':_0x3c0bcf}:null;}})[_0x89c4('0x21')](respondWithResult(_0x128443,null))[_0x89c4('0x2b')](handleError(_0x128443,null));};exports['send']=function(_0x508b13,_0x141397,_0x2b042b){var _0x4c7fea,_0x400149,_0x7837c6;if(_[_0x89c4('0x78')](_0x508b13[_0x89c4('0x62')][_0x89c4('0x62')])||_0x508b13[_0x89c4('0x62')][_0x89c4('0x62')]===''){throw new db[(_0x89c4('0x7d'))][(_0x89c4('0x71'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x89c4('0x78')](_0x508b13[_0x89c4('0x62')]['to'])){}_0x4c7fea=_0x508b13[_0x89c4('0x62')]['to'];return db[_0x89c4('0x41')][_0x89c4('0xa7')]({'where':{'id':_0x508b13[_0x89c4('0x59')]['id']}})[_0x89c4('0x21')](handleEntityNotFound(_0x141397,null))['then'](function(_0x44742c){if(_0x44742c){return db[_0x89c4('0x41')][_0x89c4('0x5b')]({'where':{'id':_0x44742c['id']},'include':[{'model':db[_0x89c4('0x80')],'as':'List','include':[{'model':db[_0x89c4('0x70')],'as':_0x89c4('0x82'),'where':{[_0x44742c[_0x89c4('0x7c')]]:_0x4c7fea},'limit':0x1,'order':[[_0x89c4('0x74'),_0x89c4('0x83')]]}]}]})['then'](handleEntityNotFound(_0x141397,null))[_0x89c4('0x21')](function(_0x1e599d){if(_0x1e599d&&_0x1e599d[_0x89c4('0x81')]){_0x400149=_0x1e599d[_0x89c4('0x5e')]({'plain':!![]});if(_0x400149[_0x89c4('0x81')]&&_0x400149['List'][_0x89c4('0x82')][_0x89c4('0x4b')]){return _0x400149[_0x89c4('0x81')][_0x89c4('0x82')][0x0];}return db['CmContact'][_0x89c4('0x5c')](_[_0x89c4('0xbb')](_0x508b13[_0x89c4('0x62')],{'firstName':_0x4c7fea,[_0x1e599d[_0x89c4('0x7c')]]:_0x4c7fea,'phone':_0x4c7fea,'ListId':_0x400149[_0x89c4('0x77')]}));}})[_0x89c4('0x21')](handleEntityNotFound(_0x141397,null))[_0x89c4('0x21')](function(_0x77c2b7){if(_0x77c2b7){_0x7837c6=_0x77c2b7;return db['OpenchannelInteraction'][_0x89c4('0x5b')]({'where':{'ContactId':_0x7837c6['id'],'closed':![],'OpenchannelAccountId':_0x400149['id']}})[_0x89c4('0x21')](function(_0x373da4){if(_0x373da4){return[_0x373da4,![]];}return db[_0x89c4('0x8e')]['create']({'UserId':_0x508b13[_0x89c4('0x5d')]['id'],'ContactId':_0x7837c6['id'],'OpenchannelAccountId':_0x400149['id'],'lastMsgDirection':_0x89c4('0xbc'),'firstMsgDirection':_0x89c4('0xbc'),'Messages':[_[_0x89c4('0x51')](_0x508b13[_0x89c4('0x62')],{'read':![],'body':_0x508b13['body']['body'],'OpenchannelAccountId':_0x400149['id'],'UserId':_0x508b13['user']['id'],'ContactId':_0x7837c6['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x89c4('0xbd')}]})[_0x89c4('0x21')](function(_0x5e4898){return[_0x5e4898,!![]];});});}})[_0x89c4('0x90')](function(_0x51c82b,_0x19cb83){if(_0x19cb83){return _0x51c82b;}return db[_0x89c4('0x98')]['create'](_[_0x89c4('0x51')](_0x508b13[_0x89c4('0x62')],{'read':![],'body':_0x508b13['body']['body'],'OpenchannelAccountId':_0x400149['id'],'OpenchannelInteractionId':_0x51c82b['id'],'UserId':_0x508b13[_0x89c4('0x5d')]['id'],'ContactId':_0x7837c6['id']}))[_0x89c4('0x21')](function(_0x2f6f31){_0x51c82b[_0x89c4('0xbe')]['Messages']=[];_0x51c82b['dataValues'][_0x89c4('0xbd')][_0x89c4('0xbf')](_0x2f6f31[_0x89c4('0xbe')]);return _0x51c82b;});});}})[_0x89c4('0x21')](respondWithResult(_0x141397,null))[_0x89c4('0x2b')](handleError(_0x141397,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 940f0df..2e4af6a 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 _0x4ea3=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount','setMaxListeners','update'];(function(_0x1732ff,_0x21afca){var _0x34d943=function(_0x259d65){while(--_0x259d65){_0x1732ff['push'](_0x1732ff['shift']());}};_0x34d943(++_0x21afca);}(_0x4ea3,0x70));var _0x34ea=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x4ea3[_0x5b644e];return _0x49c6bf;};'use strict';var EventEmitter=require(_0x34ea('0x0'));var OpenchannelAccount=require(_0x34ea('0x1'))['db'][_0x34ea('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x34ea('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x34ea('0x4'),'afterDestroy':'remove'};function emitEvent(_0x269d4c){return function(_0x571f1b,_0x5e5a84,_0x2ce955){OpenchannelAccountEvents[_0x34ea('0x5')](_0x269d4c+':'+_0x571f1b['id'],_0x571f1b);OpenchannelAccountEvents[_0x34ea('0x5')](_0x269d4c,_0x571f1b);_0x2ce955(null);};}for(var e in events){if(events[_0x34ea('0x6')](e)){var event=events[e];OpenchannelAccount[_0x34ea('0x7')](e,emitEvent(event));}}module[_0x34ea('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x70e0=['emit','events','../../mysqldb','OpenchannelAccount','update','remove'];(function(_0x41cbd1,_0x2ad20c){var _0x48d679=function(_0x38cc5f){while(--_0x38cc5f){_0x41cbd1['push'](_0x41cbd1['shift']());}};_0x48d679(++_0x2ad20c);}(_0x70e0,0x17b));var _0x070e=function(_0x274614,_0x2661c1){_0x274614=_0x274614-0x0;var _0x592b28=_0x70e0[_0x274614];return _0x592b28;};'use strict';var EventEmitter=require(_0x070e('0x0'));var OpenchannelAccount=require(_0x070e('0x1'))['db'][_0x070e('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x070e('0x3'),'afterDestroy':_0x070e('0x4')};function emitEvent(_0x277d32){return function(_0x2593e5,_0x5c90fc,_0x7bce9b){OpenchannelAccountEvents['emit'](_0x277d32+':'+_0x2593e5['id'],_0x2593e5);OpenchannelAccountEvents[_0x070e('0x5')](_0x277d32,_0x2593e5);_0x7bce9b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index ef07b72..f74c72a 100644 --- a/server/api/openchannelAccount/openchannelAccount.model.js +++ b/server/api/openchannelAccount/openchannelAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x3aa816,_0x41796c){var _0x206a01=function(_0x14f9d4){while(--_0x14f9d4){_0x3aa816['push'](_0x3aa816['shift']());}};_0x206a01(++_0x41796c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x2f6248,_0xc0935f){var _0x497a2a=function(_0x4b41d9){while(--_0x4b41d9){_0x2f6248['push'](_0x2f6248['shift']());}};_0x497a2a(++_0xc0935f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.rpc.js b/server/api/openchannelAccount/openchannelAccount.rpc.js index 14bb208..3e55269 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 _0xed3c=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','localhost','register','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment'];(function(_0x137859,_0x30885c){var _0x1d1dfb=function(_0x34a847){while(--_0x34a847){_0x137859['push'](_0x137859['shift']());}};_0x1d1dfb(++_0x30885c);}(_0xed3c,0x1a6));var _0xced3=function(_0x5c38a2,_0x40e4e4){_0x5c38a2=_0x5c38a2-0x0;var _0x22869c=_0xed3c[_0x5c38a2];return _0x22869c;};'use strict';var _=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var moment=require(_0xced3('0x2'));var BPromise=require(_0xced3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xced3('0x4'));var db=require(_0xced3('0x5'))['db'];var utils=require(_0xced3('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xced3('0x7'));var jayson=require(_0xced3('0x8'));var client=jayson[_0xced3('0x9')][_0xced3('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xced3('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelAccount.socket')[_0xced3('0xc')](socket);function respondWithRpcPromise(_0x321c42,_0x3e5a04,_0x12612f){return new BPromise(function(_0x1cb639,_0x5934b2){return client[_0xced3('0xd')](_0x321c42,_0x12612f)[_0xced3('0xe')](function(_0x3da0ff){logger['info'](_0xced3('0xf'),_0x3e5a04,_0xced3('0x10'));logger[_0xced3('0x11')](_0xced3('0x12'),_0x3e5a04,_0xced3('0x10'),JSON[_0xced3('0x13')](_0x3da0ff));if(_0x3da0ff[_0xced3('0x14')]){if(_0x3da0ff['error'][_0xced3('0x15')]===0x1f4){logger['error'](_0xced3('0xf'),_0x3e5a04,_0x3da0ff[_0xced3('0x14')][_0xced3('0x16')]);return _0x5934b2(_0x3da0ff[_0xced3('0x14')]['message']);}logger[_0xced3('0x14')](_0xced3('0xf'),_0x3e5a04,_0x3da0ff['error'][_0xced3('0x16')]);return _0x1cb639(_0x3da0ff[_0xced3('0x14')][_0xced3('0x16')]);}else{logger[_0xced3('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x3e5a04,_0xced3('0x10'));_0x1cb639(_0x3da0ff['result'][_0xced3('0x16')]);}})[_0xced3('0x18')](function(_0x32c402){logger[_0xced3('0x14')](_0xced3('0xf'),_0x3e5a04,_0x32c402);_0x5934b2(_0x32c402);});});} \ No newline at end of file +var _0x5eb1=['redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x5eb1,0x7c));var _0x15eb=function(_0x56fb7d,_0x539ea1){_0x56fb7d=_0x56fb7d-0x0;var _0x3be1c3=_0x5eb1[_0x56fb7d];return _0x3be1c3;};'use strict';var _=require('lodash');var util=require(_0x15eb('0x0'));var moment=require(_0x15eb('0x1'));var BPromise=require(_0x15eb('0x2'));var rs=require(_0x15eb('0x3'));var fs=require('fs');var Redis=require(_0x15eb('0x4'));var db=require(_0x15eb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x15eb('0x6'))(_0x15eb('0x7'));var config=require(_0x15eb('0x8'));var jayson=require(_0x15eb('0x9'));var client=jayson['client'][_0x15eb('0xa')]({'port':0x232a});config[_0x15eb('0xb')]=_['defaults'](config[_0x15eb('0xb')],{'host':_0x15eb('0xc'),'port':0x18eb});var socket=require(_0x15eb('0xd'))(new Redis(config[_0x15eb('0xb')]));require(_0x15eb('0xe'))[_0x15eb('0xf')](socket);function respondWithRpcPromise(_0x412db6,_0x1481ae,_0x295e45){return new BPromise(function(_0x31e040,_0x3f08c1){return client[_0x15eb('0x10')](_0x412db6,_0x295e45)[_0x15eb('0x11')](function(_0x56c25c){logger[_0x15eb('0x12')]('OpenchannelAccount,\x20%s,\x20%s',_0x1481ae,'request\x20sent');logger['debug'](_0x15eb('0x13'),_0x1481ae,_0x15eb('0x14'),JSON[_0x15eb('0x15')](_0x56c25c));if(_0x56c25c[_0x15eb('0x16')]){if(_0x56c25c['error'][_0x15eb('0x17')]===0x1f4){logger[_0x15eb('0x16')](_0x15eb('0x18'),_0x1481ae,_0x56c25c[_0x15eb('0x16')]['message']);return _0x3f08c1(_0x56c25c['error']['message']);}logger['error'](_0x15eb('0x18'),_0x1481ae,_0x56c25c['error']['message']);return _0x31e040(_0x56c25c[_0x15eb('0x16')]['message']);}else{logger[_0x15eb('0x12')]('OpenchannelAccount,\x20%s,\x20%s',_0x1481ae,_0x15eb('0x14'));_0x31e040(_0x56c25c['result'][_0x15eb('0x19')]);}})[_0x15eb('0x1a')](function(_0x5cc4b1){logger[_0x15eb('0x16')](_0x15eb('0x18'),_0x1481ae,_0x5cc4b1);_0x3f08c1(_0x5cc4b1);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index facfbe5..1376b38 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 _0x09dd=['register','length','openchannelAccount:','./openchannelAccount.events','save','remove','update','emit','removeListener'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x09dd,0x81));var _0xd09d=function(_0x562362,_0x5d54f4){_0x562362=_0x562362-0x0;var _0x3a18ce=_0x09dd[_0x562362];return _0x3a18ce;};'use strict';var OpenchannelAccountEvents=require(_0xd09d('0x0'));var events=[_0xd09d('0x1'),_0xd09d('0x2'),_0xd09d('0x3')];function createListener(_0x45dad5,_0x2a77ce){return function(_0x28a63a){_0x2a77ce[_0xd09d('0x4')](_0x45dad5,_0x28a63a);};}function removeListener(_0x44faf7,_0x3e1b57){return function(){OpenchannelAccountEvents[_0xd09d('0x5')](_0x44faf7,_0x3e1b57);};}exports[_0xd09d('0x6')]=function(_0x3410c4){for(var _0x2034af=0x0,_0x5621cf=events[_0xd09d('0x7')];_0x2034af<_0x5621cf;_0x2034af++){var _0x1fce72=events[_0x2034af];var _0x3e062b=createListener(_0xd09d('0x8')+_0x1fce72,_0x3410c4);OpenchannelAccountEvents['on'](_0x1fce72,_0x3e062b);}}; \ No newline at end of file +var _0xad95=['length','openchannelAccount:','./openchannelAccount.events','save','remove'];(function(_0x37dd1e,_0x5714dc){var _0x4dd1bd=function(_0x154928){while(--_0x154928){_0x37dd1e['push'](_0x37dd1e['shift']());}};_0x4dd1bd(++_0x5714dc);}(_0xad95,0x70));var _0x5ad9=function(_0x5a761e,_0x3acc5f){_0x5a761e=_0x5a761e-0x0;var _0x549086=_0xad95[_0x5a761e];return _0x549086;};'use strict';var OpenchannelAccountEvents=require(_0x5ad9('0x0'));var events=[_0x5ad9('0x1'),_0x5ad9('0x2'),'update'];function createListener(_0x52ad89,_0x409d5b){return function(_0x235c61){_0x409d5b['emit'](_0x52ad89,_0x235c61);};}function removeListener(_0x5c9fd6,_0x185bff){return function(){OpenchannelAccountEvents['removeListener'](_0x5c9fd6,_0x185bff);};}exports['register']=function(_0x5e4279){for(var _0x5b81f9=0x0,_0x2bef4e=events[_0x5ad9('0x3')];_0x5b81f9<_0x2bef4e;_0x5b81f9++){var _0x2a0915=events[_0x5b81f9];var _0x3d937a=createListener(_0x5ad9('0x4')+_0x2a0915,_0x5e4279);OpenchannelAccountEvents['on'](_0x2a0915,_0x3d937a);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index e31fe42..9a59abb 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 _0x64fc=['./openchannelApplication.controller','get','index','/:id','isAuthenticated','show','put','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3b8616,_0x13d71c){var _0x44f7ca=function(_0x36921b){while(--_0x36921b){_0x3b8616['push'](_0x3b8616['shift']());}};_0x44f7ca(++_0x13d71c);}(_0x64fc,0xd9));var _0xc64f=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x64fc[_0x173441];return _0x2423a8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc64f('0x0'));var timeout=require(_0xc64f('0x1'));var express=require(_0xc64f('0x2'));var router=express['Router']();var fs_extra=require(_0xc64f('0x3'));var auth=require(_0xc64f('0x4'));var interaction=require(_0xc64f('0x5'));var config=require(_0xc64f('0x6'));var controller=require(_0xc64f('0x7'));router[_0xc64f('0x8')]('/',auth['isAuthenticated'](),controller[_0xc64f('0x9')]);router[_0xc64f('0x8')](_0xc64f('0xa'),auth[_0xc64f('0xb')](),controller[_0xc64f('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xc64f('0xd')](_0xc64f('0xa'),auth[_0xc64f('0xb')](),controller['update']);router['delete'](_0xc64f('0xa'),auth[_0xc64f('0xb')](),controller[_0xc64f('0xe')]);module[_0xc64f('0xf')]=router; \ No newline at end of file +var _0x8a93=['path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','/:id','show','post','create','update','destroy','exports','multer','util'];(function(_0x46b3b7,_0x512f7a){var _0x35e130=function(_0x2b4770){while(--_0x2b4770){_0x46b3b7['push'](_0x46b3b7['shift']());}};_0x35e130(++_0x512f7a);}(_0x8a93,0xec));var _0x38a9=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x8a93[_0x26462c];return _0x509a42;};'use strict';var multer=require(_0x38a9('0x0'));var util=require(_0x38a9('0x1'));var path=require(_0x38a9('0x2'));var timeout=require(_0x38a9('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x38a9('0x4'));var interaction=require(_0x38a9('0x5'));var config=require(_0x38a9('0x6'));var controller=require(_0x38a9('0x7'));router[_0x38a9('0x8')]('/',auth[_0x38a9('0x9')](),controller['index']);router['get'](_0x38a9('0xa'),auth[_0x38a9('0x9')](),controller[_0x38a9('0xb')]);router[_0x38a9('0xc')]('/',auth['isAuthenticated'](),controller[_0x38a9('0xd')]);router['put'](_0x38a9('0xa'),auth[_0x38a9('0x9')](),controller[_0x38a9('0xe')]);router['delete'](_0x38a9('0xa'),auth[_0x38a9('0x9')](),controller[_0x38a9('0xf')]);module[_0x38a9('0x10')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index b22372a..ebc9ff9 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 _0xb9d8=['TEXT','sequelize','exports','INTEGER','STRING'];(function(_0x4c98b9,_0x1ad11b){var _0x3a257a=function(_0x147857){while(--_0x147857){_0x4c98b9['push'](_0x4c98b9['shift']());}};_0x3a257a(++_0x1ad11b);}(_0xb9d8,0x12d));var _0x8b9d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb9d8[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8b9d('0x0'));module[_0x8b9d('0x1')]={'priority':{'type':Sequelize[_0x8b9d('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x8b9d('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x8b9d('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x4864=['exports','INTEGER','noop','TEXT','STRING','sequelize'];(function(_0x48ac12,_0x41a6fa){var _0x36a2a0=function(_0x4990a8){while(--_0x4990a8){_0x48ac12['push'](_0x48ac12['shift']());}};_0x36a2a0(++_0x41a6fa);}(_0x4864,0x1f1));var _0x4486=function(_0x5df780,_0x3460c8){_0x5df780=_0x5df780-0x0;var _0x535f5b=_0x4864[_0x5df780];return _0x535f5b;};'use strict';var Sequelize=require(_0x4486('0x0'));module[_0x4486('0x1')]={'priority':{'type':Sequelize[_0x4486('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4486('0x3')},'appdata':{'type':Sequelize[_0x4486('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x4486('0x5')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 9e15b96..dbf9e16 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 _0xdb9f=['include','findAll','catch','show','params','keys','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','includeAll'];(function(_0x5bf420,_0x2d068d){var _0x1c5255=function(_0x4964a2){while(--_0x4964a2){_0x5bf420['push'](_0x5bf420['shift']());}};_0x1c5255(++_0x2d068d);}(_0xdb9f,0x1cc));var _0xfdb9=function(_0x21090b,_0x39dd3b){_0x21090b=_0x21090b-0x0;var _0x3c68d7=_0xdb9f[_0x21090b];return _0x3c68d7;};'use strict';var emlformat=require(_0xfdb9('0x0'));var rimraf=require(_0xfdb9('0x1'));var zipdir=require(_0xfdb9('0x2'));var jsonpatch=require(_0xfdb9('0x3'));var rp=require(_0xfdb9('0x4'));var moment=require(_0xfdb9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfdb9('0x6'));var util=require(_0xfdb9('0x7'));var path=require(_0xfdb9('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfdb9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfdb9('0xa'));var squel=require(_0xfdb9('0xb'));var crypto=require('crypto');var jsforce=require(_0xfdb9('0xc'));var deskjs=require(_0xfdb9('0xd'));var toCsv=require('to-csv');var querystring=require(_0xfdb9('0xe'));var Papa=require(_0xfdb9('0xf'));var Redis=require(_0xfdb9('0x10'));var authService=require(_0xfdb9('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xfdb9('0x12'));var hardwareService=require(_0xfdb9('0x13'));var logger=require(_0xfdb9('0x14'))('api');var utils=require(_0xfdb9('0x15'));var config=require(_0xfdb9('0x16'));var licenseUtil=require(_0xfdb9('0x17'));var db=require(_0xfdb9('0x18'))['db'];function respondWithStatusCode(_0x4148a1,_0x4ec211){_0x4ec211=_0x4ec211||0xcc;return function(_0x2ab8fd){if(_0x2ab8fd){return _0x4148a1[_0xfdb9('0x19')](_0x4ec211);}return _0x4148a1[_0xfdb9('0x1a')](_0x4ec211)[_0xfdb9('0x1b')]();};}function respondWithResult(_0x12e05c,_0x459a70){_0x459a70=_0x459a70||0xc8;return function(_0x122510){if(_0x122510){return _0x12e05c['status'](_0x459a70)[_0xfdb9('0x1c')](_0x122510);}};}function respondWithFilteredResult(_0x183b00,_0x2a4fb1){return function(_0x4a608a){if(_0x4a608a){var _0x5beae8=typeof _0x2a4fb1[_0xfdb9('0x1d')]===_0xfdb9('0x1e')&&typeof _0x2a4fb1[_0xfdb9('0x1f')]===_0xfdb9('0x1e');var _0xf06e27=_0x4a608a[_0xfdb9('0x20')];var _0x238c10=_0x5beae8?0x0:_0x2a4fb1['offset'];var _0x214043=_0x5beae8?_0x4a608a[_0xfdb9('0x20')]:_0x2a4fb1[_0xfdb9('0x1d')]+_0x2a4fb1[_0xfdb9('0x1f')];var _0x182b68;if(_0x214043>=_0xf06e27){_0x214043=_0xf06e27;_0x182b68=0xc8;}else{_0x182b68=0xce;}_0x183b00[_0xfdb9('0x1a')](_0x182b68);return _0x183b00[_0xfdb9('0x21')](_0xfdb9('0x22'),_0x238c10+'-'+_0x214043+'/'+_0xf06e27)[_0xfdb9('0x1c')](_0x4a608a);}return null;};}function patchUpdates(_0x577202){return function(_0xb7246e){try{jsonpatch[_0xfdb9('0x23')](_0xb7246e,_0x577202,!![]);}catch(_0xa27aa7){return BPromise[_0xfdb9('0x24')](_0xa27aa7);}return _0xb7246e[_0xfdb9('0x25')]();};}function saveUpdates(_0x580ca1,_0x389735){return function(_0x135e73){if(_0x135e73){return _0x135e73[_0xfdb9('0x26')](_0x580ca1)['then'](function(_0xfe3d61){return _0xfe3d61;});}return null;};}function removeEntity(_0x4c81bd,_0xe93269){return function(_0xad1c6e){if(_0xad1c6e){return _0xad1c6e['destroy']()[_0xfdb9('0x27')](function(){_0x4c81bd[_0xfdb9('0x1a')](0xcc)[_0xfdb9('0x1b')]();});}};}function handleEntityNotFound(_0x44d367,_0x44991c){return function(_0xc4722){if(!_0xc4722){_0x44d367['sendStatus'](0x194);}return _0xc4722;};}function handleError(_0x2bfb1e,_0x4b63ca){_0x4b63ca=_0x4b63ca||0x1f4;return function(_0x3248fc){logger[_0xfdb9('0x28')](_0x3248fc[_0xfdb9('0x29')]);if(_0x3248fc[_0xfdb9('0x2a')]){delete _0x3248fc[_0xfdb9('0x2a')];}_0x2bfb1e[_0xfdb9('0x1a')](_0x4b63ca)[_0xfdb9('0x2b')](_0x3248fc);};}exports[_0xfdb9('0x2c')]=function(_0x2ac507,_0x125819){var _0x5c84b0={},_0x12bb0e={},_0x596dcf={'count':0x0,'rows':[]};var _0x3f77a5=_[_0xfdb9('0x2d')](db[_0xfdb9('0x2e')][_0xfdb9('0x2f')],function(_0x12b6e0){return{'name':_0x12b6e0['fieldName'],'type':_0x12b6e0[_0xfdb9('0x30')]['key']};});_0x12bb0e[_0xfdb9('0x31')]=_[_0xfdb9('0x2d')](_0x3f77a5,_0xfdb9('0x2a'));_0x12bb0e['query']=_['keys'](_0x2ac507[_0xfdb9('0x32')]);_0x12bb0e[_0xfdb9('0x33')]=_[_0xfdb9('0x34')](_0x12bb0e['model'],_0x12bb0e[_0xfdb9('0x32')]);_0x5c84b0[_0xfdb9('0x35')]=_[_0xfdb9('0x34')](_0x12bb0e['model'],qs[_0xfdb9('0x36')](_0x2ac507[_0xfdb9('0x32')][_0xfdb9('0x36')]));_0x5c84b0[_0xfdb9('0x35')]=_0x5c84b0[_0xfdb9('0x35')][_0xfdb9('0x37')]?_0x5c84b0[_0xfdb9('0x35')]:_0x12bb0e[_0xfdb9('0x31')];if(!_0x2ac507['query'][_0xfdb9('0x38')](_0xfdb9('0x39'))){_0x5c84b0[_0xfdb9('0x1f')]=qs[_0xfdb9('0x1f')](_0x2ac507[_0xfdb9('0x32')][_0xfdb9('0x1f')]);_0x5c84b0[_0xfdb9('0x1d')]=qs[_0xfdb9('0x1d')](_0x2ac507[_0xfdb9('0x32')][_0xfdb9('0x1d')]);}_0x5c84b0[_0xfdb9('0x3a')]=qs[_0xfdb9('0x3b')](_0x2ac507[_0xfdb9('0x32')][_0xfdb9('0x3b')]);_0x5c84b0['where']=qs['filters'](_[_0xfdb9('0x3c')](_0x2ac507['query'],_0x12bb0e[_0xfdb9('0x33')]),_0x3f77a5);if(_0x2ac507[_0xfdb9('0x32')]['filter']){_0x5c84b0[_0xfdb9('0x3d')]=_[_0xfdb9('0x3e')](_0x5c84b0[_0xfdb9('0x3d')],{'$or':_[_0xfdb9('0x2d')](_0x3f77a5,function(_0xdf6ace){if(_0xdf6ace[_0xfdb9('0x30')]!==_0xfdb9('0x3f')){var _0x48185c={};_0x48185c[_0xdf6ace['name']]={'$like':'%'+_0x2ac507[_0xfdb9('0x32')]['filter']+'%'};return _0x48185c;}})});}_0x5c84b0=_[_0xfdb9('0x3e')]({},_0x5c84b0,_0x2ac507['options']);var _0xe34f79={'where':_0x5c84b0[_0xfdb9('0x3d')]};return db[_0xfdb9('0x2e')][_0xfdb9('0x20')](_0xe34f79)['then'](function(_0x3a6889){_0x596dcf[_0xfdb9('0x20')]=_0x3a6889;if(_0x2ac507[_0xfdb9('0x32')][_0xfdb9('0x40')]){_0x5c84b0[_0xfdb9('0x41')]=[{'all':!![]}];}return db[_0xfdb9('0x2e')][_0xfdb9('0x42')](_0x5c84b0);})[_0xfdb9('0x27')](function(_0x271c56){_0x596dcf['rows']=_0x271c56;return _0x596dcf;})[_0xfdb9('0x27')](respondWithFilteredResult(_0x125819,_0x5c84b0))[_0xfdb9('0x43')](handleError(_0x125819,null));};exports[_0xfdb9('0x44')]=function(_0x1c6cec,_0x17aa0a){var _0x388917={'raw':!![],'where':{'id':_0x1c6cec[_0xfdb9('0x45')]['id']}},_0x299aa7={};_0x299aa7[_0xfdb9('0x31')]=_[_0xfdb9('0x46')](db['OpenchannelApplication'][_0xfdb9('0x2f')]);_0x299aa7[_0xfdb9('0x32')]=_[_0xfdb9('0x46')](_0x1c6cec[_0xfdb9('0x32')]);_0x299aa7[_0xfdb9('0x33')]=_[_0xfdb9('0x34')](_0x299aa7['model'],_0x299aa7['query']);_0x388917[_0xfdb9('0x35')]=_['intersection'](_0x299aa7['model'],qs[_0xfdb9('0x36')](_0x1c6cec[_0xfdb9('0x32')][_0xfdb9('0x36')]));_0x388917['attributes']=_0x388917[_0xfdb9('0x35')][_0xfdb9('0x37')]?_0x388917['attributes']:_0x299aa7[_0xfdb9('0x31')];if(_0x1c6cec['query']['includeAll']){_0x388917[_0xfdb9('0x41')]=[{'all':!![]}];}_0x388917=_[_0xfdb9('0x3e')]({},_0x388917,_0x1c6cec[_0xfdb9('0x47')]);return db[_0xfdb9('0x2e')][_0xfdb9('0x48')](_0x388917)['then'](handleEntityNotFound(_0x17aa0a,null))[_0xfdb9('0x27')](respondWithResult(_0x17aa0a,null))[_0xfdb9('0x43')](handleError(_0x17aa0a,null));};exports[_0xfdb9('0x49')]=function(_0x2d8104,_0x1d67d1){return db[_0xfdb9('0x2e')][_0xfdb9('0x49')](_0x2d8104[_0xfdb9('0x4a')],{})[_0xfdb9('0x27')](respondWithResult(_0x1d67d1,0xc9))[_0xfdb9('0x43')](handleError(_0x1d67d1,null));};exports[_0xfdb9('0x26')]=function(_0x11423e,_0x108f23){if(_0x11423e['body']['id']){delete _0x11423e[_0xfdb9('0x4a')]['id'];}return db[_0xfdb9('0x2e')]['find']({'where':{'id':_0x11423e['params']['id']}})[_0xfdb9('0x27')](handleEntityNotFound(_0x108f23,null))[_0xfdb9('0x27')](saveUpdates(_0x11423e[_0xfdb9('0x4a')],null))[_0xfdb9('0x27')](respondWithResult(_0x108f23,null))['catch'](handleError(_0x108f23,null));};exports['destroy']=function(_0x3ed6e5,_0x8e70fd){return db[_0xfdb9('0x2e')][_0xfdb9('0x48')]({'where':{'id':_0x3ed6e5[_0xfdb9('0x45')]['id']}})[_0xfdb9('0x27')](handleEntityNotFound(_0x8e70fd,null))[_0xfdb9('0x27')](removeEntity(_0x8e70fd,null))[_0xfdb9('0x43')](handleError(_0x8e70fd,null));}; \ No newline at end of file +var _0xa17f=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','rawAttributes','type','model','keys','filters','intersection','query','attributes','fields','length','nolimit','sort','where','pick','filter','merge','map','OpenchannelApplication','includeAll','include','rows','catch','options','create','find','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x2b37b5,_0x4f677b){var _0x36df6d=function(_0x501dc7){while(--_0x501dc7){_0x2b37b5['push'](_0x2b37b5['shift']());}};_0x36df6d(++_0x4f677b);}(_0xa17f,0x198));var _0xfa17=function(_0x36bff5,_0x3156cb){_0x36bff5=_0x36bff5-0x0;var _0x80ade5=_0xa17f[_0x36bff5];return _0x80ade5;};'use strict';var emlformat=require(_0xfa17('0x0'));var rimraf=require(_0xfa17('0x1'));var zipdir=require(_0xfa17('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfa17('0x3'));var moment=require(_0xfa17('0x4'));var BPromise=require(_0xfa17('0x5'));var Mustache=require(_0xfa17('0x6'));var util=require(_0xfa17('0x7'));var path=require(_0xfa17('0x8'));var sox=require(_0xfa17('0x9'));var csv=require(_0xfa17('0xa'));var ejs=require(_0xfa17('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfa17('0xc'));var squel=require(_0xfa17('0xd'));var crypto=require(_0xfa17('0xe'));var jsforce=require(_0xfa17('0xf'));var deskjs=require(_0xfa17('0x10'));var toCsv=require(_0xfa17('0xa'));var querystring=require(_0xfa17('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfa17('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xfa17('0x13'));var hardwareService=require(_0xfa17('0x14'));var logger=require(_0xfa17('0x15'))(_0xfa17('0x16'));var utils=require('../../config/utils');var config=require(_0xfa17('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xfa17('0x18'))['db'];function respondWithStatusCode(_0x188820,_0x54bc65){_0x54bc65=_0x54bc65||0xcc;return function(_0x5daae0){if(_0x5daae0){return _0x188820[_0xfa17('0x19')](_0x54bc65);}return _0x188820['status'](_0x54bc65)[_0xfa17('0x1a')]();};}function respondWithResult(_0x5b95c1,_0x2da14e){_0x2da14e=_0x2da14e||0xc8;return function(_0x2e8df8){if(_0x2e8df8){return _0x5b95c1[_0xfa17('0x1b')](_0x2da14e)[_0xfa17('0x1c')](_0x2e8df8);}};}function respondWithFilteredResult(_0x467608,_0x17cf72){return function(_0x288561){if(_0x288561){var _0x1451cb=typeof _0x17cf72[_0xfa17('0x1d')]===_0xfa17('0x1e')&&typeof _0x17cf72[_0xfa17('0x1f')]===_0xfa17('0x1e');var _0x1a1fa6=_0x288561[_0xfa17('0x20')];var _0x322be7=_0x1451cb?0x0:_0x17cf72[_0xfa17('0x1d')];var _0x3d7157=_0x1451cb?_0x288561[_0xfa17('0x20')]:_0x17cf72[_0xfa17('0x1d')]+_0x17cf72[_0xfa17('0x1f')];var _0x5d2d9f;if(_0x3d7157>=_0x1a1fa6){_0x3d7157=_0x1a1fa6;_0x5d2d9f=0xc8;}else{_0x5d2d9f=0xce;}_0x467608[_0xfa17('0x1b')](_0x5d2d9f);return _0x467608[_0xfa17('0x21')](_0xfa17('0x22'),_0x322be7+'-'+_0x3d7157+'/'+_0x1a1fa6)[_0xfa17('0x1c')](_0x288561);}return null;};}function patchUpdates(_0x5c1f52){return function(_0x3ab8c0){try{jsonpatch[_0xfa17('0x23')](_0x3ab8c0,_0x5c1f52,!![]);}catch(_0x4b533b){return BPromise[_0xfa17('0x24')](_0x4b533b);}return _0x3ab8c0[_0xfa17('0x25')]();};}function saveUpdates(_0x8766f7,_0x148dc9){return function(_0x262890){if(_0x262890){return _0x262890[_0xfa17('0x26')](_0x8766f7)[_0xfa17('0x27')](function(_0x42273c){return _0x42273c;});}return null;};}function removeEntity(_0x5e9256,_0x5a347d){return function(_0x5f18f8){if(_0x5f18f8){return _0x5f18f8[_0xfa17('0x28')]()[_0xfa17('0x27')](function(){_0x5e9256['status'](0xcc)[_0xfa17('0x1a')]();});}};}function handleEntityNotFound(_0x4fb453,_0x1a09c7){return function(_0x4963b2){if(!_0x4963b2){_0x4fb453[_0xfa17('0x19')](0x194);}return _0x4963b2;};}function handleError(_0x4dad39,_0x2c7223){_0x2c7223=_0x2c7223||0x1f4;return function(_0x2d01d3){logger[_0xfa17('0x29')](_0x2d01d3['stack']);if(_0x2d01d3[_0xfa17('0x2a')]){delete _0x2d01d3[_0xfa17('0x2a')];}_0x4dad39['status'](_0x2c7223)[_0xfa17('0x2b')](_0x2d01d3);};}exports[_0xfa17('0x2c')]=function(_0x1cdf6a,_0x49377a){var _0xefc960={},_0x46aba7={},_0x591d27={'count':0x0,'rows':[]};var _0x745698=_['map'](db['OpenchannelApplication'][_0xfa17('0x2d')],function(_0xb5fa84){return{'name':_0xb5fa84['fieldName'],'type':_0xb5fa84[_0xfa17('0x2e')]['key']};});_0x46aba7[_0xfa17('0x2f')]=_['map'](_0x745698,_0xfa17('0x2a'));_0x46aba7['query']=_[_0xfa17('0x30')](_0x1cdf6a['query']);_0x46aba7[_0xfa17('0x31')]=_[_0xfa17('0x32')](_0x46aba7[_0xfa17('0x2f')],_0x46aba7[_0xfa17('0x33')]);_0xefc960[_0xfa17('0x34')]=_[_0xfa17('0x32')](_0x46aba7[_0xfa17('0x2f')],qs[_0xfa17('0x35')](_0x1cdf6a[_0xfa17('0x33')][_0xfa17('0x35')]));_0xefc960[_0xfa17('0x34')]=_0xefc960['attributes'][_0xfa17('0x36')]?_0xefc960[_0xfa17('0x34')]:_0x46aba7[_0xfa17('0x2f')];if(!_0x1cdf6a[_0xfa17('0x33')]['hasOwnProperty'](_0xfa17('0x37'))){_0xefc960[_0xfa17('0x1f')]=qs[_0xfa17('0x1f')](_0x1cdf6a[_0xfa17('0x33')][_0xfa17('0x1f')]);_0xefc960[_0xfa17('0x1d')]=qs[_0xfa17('0x1d')](_0x1cdf6a[_0xfa17('0x33')][_0xfa17('0x1d')]);}_0xefc960['order']=qs[_0xfa17('0x38')](_0x1cdf6a[_0xfa17('0x33')][_0xfa17('0x38')]);_0xefc960[_0xfa17('0x39')]=qs[_0xfa17('0x31')](_[_0xfa17('0x3a')](_0x1cdf6a[_0xfa17('0x33')],_0x46aba7[_0xfa17('0x31')]),_0x745698);if(_0x1cdf6a[_0xfa17('0x33')][_0xfa17('0x3b')]){_0xefc960[_0xfa17('0x39')]=_[_0xfa17('0x3c')](_0xefc960[_0xfa17('0x39')],{'$or':_[_0xfa17('0x3d')](_0x745698,function(_0x518ef9){if(_0x518ef9['type']!=='VIRTUAL'){var _0x4aa487={};_0x4aa487[_0x518ef9[_0xfa17('0x2a')]]={'$like':'%'+_0x1cdf6a[_0xfa17('0x33')][_0xfa17('0x3b')]+'%'};return _0x4aa487;}})});}_0xefc960=_[_0xfa17('0x3c')]({},_0xefc960,_0x1cdf6a['options']);var _0x5667e0={'where':_0xefc960[_0xfa17('0x39')]};return db[_0xfa17('0x3e')]['count'](_0x5667e0)['then'](function(_0xb60aa1){_0x591d27[_0xfa17('0x20')]=_0xb60aa1;if(_0x1cdf6a[_0xfa17('0x33')][_0xfa17('0x3f')]){_0xefc960[_0xfa17('0x40')]=[{'all':!![]}];}return db[_0xfa17('0x3e')]['findAll'](_0xefc960);})['then'](function(_0x58f1bd){_0x591d27[_0xfa17('0x41')]=_0x58f1bd;return _0x591d27;})[_0xfa17('0x27')](respondWithFilteredResult(_0x49377a,_0xefc960))[_0xfa17('0x42')](handleError(_0x49377a,null));};exports['show']=function(_0x14e509,_0x1a6278){var _0x1498d1={'raw':!![],'where':{'id':_0x14e509['params']['id']}},_0x2048f6={};_0x2048f6[_0xfa17('0x2f')]=_[_0xfa17('0x30')](db[_0xfa17('0x3e')]['rawAttributes']);_0x2048f6[_0xfa17('0x33')]=_[_0xfa17('0x30')](_0x14e509['query']);_0x2048f6[_0xfa17('0x31')]=_[_0xfa17('0x32')](_0x2048f6[_0xfa17('0x2f')],_0x2048f6[_0xfa17('0x33')]);_0x1498d1[_0xfa17('0x34')]=_[_0xfa17('0x32')](_0x2048f6[_0xfa17('0x2f')],qs['fields'](_0x14e509[_0xfa17('0x33')][_0xfa17('0x35')]));_0x1498d1[_0xfa17('0x34')]=_0x1498d1[_0xfa17('0x34')]['length']?_0x1498d1[_0xfa17('0x34')]:_0x2048f6['model'];if(_0x14e509[_0xfa17('0x33')][_0xfa17('0x3f')]){_0x1498d1[_0xfa17('0x40')]=[{'all':!![]}];}_0x1498d1=_['merge']({},_0x1498d1,_0x14e509[_0xfa17('0x43')]);return db['OpenchannelApplication']['find'](_0x1498d1)[_0xfa17('0x27')](handleEntityNotFound(_0x1a6278,null))[_0xfa17('0x27')](respondWithResult(_0x1a6278,null))[_0xfa17('0x42')](handleError(_0x1a6278,null));};exports[_0xfa17('0x44')]=function(_0x41bf45,_0x155f77){return db[_0xfa17('0x3e')][_0xfa17('0x44')](_0x41bf45['body'],{})[_0xfa17('0x27')](respondWithResult(_0x155f77,0xc9))[_0xfa17('0x42')](handleError(_0x155f77,null));};exports[_0xfa17('0x26')]=function(_0x322360,_0x3655ba){if(_0x322360['body']['id']){delete _0x322360['body']['id'];}return db['OpenchannelApplication'][_0xfa17('0x45')]({'where':{'id':_0x322360[_0xfa17('0x46')]['id']}})[_0xfa17('0x27')](handleEntityNotFound(_0x3655ba,null))[_0xfa17('0x27')](saveUpdates(_0x322360['body'],null))[_0xfa17('0x27')](respondWithResult(_0x3655ba,null))[_0xfa17('0x42')](handleError(_0x3655ba,null));};exports[_0xfa17('0x28')]=function(_0x33e28e,_0x364cfa){return db[_0xfa17('0x3e')][_0xfa17('0x45')]({'where':{'id':_0x33e28e[_0xfa17('0x46')]['id']}})[_0xfa17('0x27')](handleEntityNotFound(_0x364cfa,null))[_0xfa17('0x27')](removeEntity(_0x364cfa,null))[_0xfa17('0x42')](handleError(_0x364cfa,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index e991ebf..f60a2f8 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 _0x085f=['bluebird','request-promise','rimraf','../../config/environment','./openchannelApplication.attributes','exports','OpenchannelApplication','lodash','util','../../config/logger','api','moment'];(function(_0x2ebac6,_0x432720){var _0x52eaef=function(_0x562318){while(--_0x562318){_0x2ebac6['push'](_0x2ebac6['shift']());}};_0x52eaef(++_0x432720);}(_0x085f,0x73));var _0xf085=function(_0x4b9eb4,_0x2c1dea){_0x4b9eb4=_0x4b9eb4-0x0;var _0x1697bc=_0x085f[_0x4b9eb4];return _0x1697bc;};'use strict';var _=require(_0xf085('0x0'));var util=require(_0xf085('0x1'));var logger=require(_0xf085('0x2'))(_0xf085('0x3'));var moment=require(_0xf085('0x4'));var BPromise=require(_0xf085('0x5'));var rp=require(_0xf085('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf085('0x7'));var config=require(_0xf085('0x8'));var attributes=require(_0xf085('0x9'));module[_0xf085('0xa')]=function(_0x5c6a2c,_0x561414){return _0x5c6a2c['define'](_0xf085('0xb'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf3ce=['api','moment','bluebird','request-promise','path','../../config/environment','./openchannelApplication.attributes','define','OpenchannelApplication','openchannel_applications','lodash','util'];(function(_0x22776b,_0x22e3db){var _0x5ea053=function(_0x1d4f5e){while(--_0x1d4f5e){_0x22776b['push'](_0x22776b['shift']());}};_0x5ea053(++_0x22e3db);}(_0xf3ce,0x8e));var _0xef3c=function(_0x4c25cb,_0xce5c6c){_0x4c25cb=_0x4c25cb-0x0;var _0x5a61f2=_0xf3ce[_0x4c25cb];return _0x5a61f2;};'use strict';var _=require(_0xef3c('0x0'));var util=require(_0xef3c('0x1'));var logger=require('../../config/logger')(_0xef3c('0x2'));var moment=require(_0xef3c('0x3'));var BPromise=require(_0xef3c('0x4'));var rp=require(_0xef3c('0x5'));var fs=require('fs');var path=require(_0xef3c('0x6'));var rimraf=require('rimraf');var config=require(_0xef3c('0x7'));var attributes=require(_0xef3c('0x8'));module['exports']=function(_0x253cb4,_0xf7574e){return _0x253cb4[_0xef3c('0x9')](_0xef3c('0xa'),attributes,{'tableName':_0xef3c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','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 d226a61..303e602 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 _0x567d=['error','code','message','info','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4bf8a9,_0x45a22f){var _0x478349=function(_0x3a61de){while(--_0x3a61de){_0x4bf8a9['push'](_0x4bf8a9['shift']());}};_0x478349(++_0x45a22f);}(_0x567d,0xa3));var _0xd567=function(_0x44ee4c,_0x2c370b){_0x44ee4c=_0x44ee4c-0x0;var _0x44291d=_0x567d[_0x44ee4c];return _0x44291d;};'use strict';var _=require(_0xd567('0x0'));var util=require(_0xd567('0x1'));var moment=require(_0xd567('0x2'));var BPromise=require('bluebird');var rs=require(_0xd567('0x3'));var fs=require('fs');var Redis=require(_0xd567('0x4'));var db=require(_0xd567('0x5'))['db'];var utils=require(_0xd567('0x6'));var logger=require(_0xd567('0x7'))(_0xd567('0x8'));var config=require(_0xd567('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd567('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e26ce,_0x11e575,_0x537cd0){return new BPromise(function(_0x3602ac,_0x1b29f1){return client['request'](_0x2e26ce,_0x537cd0)[_0xd567('0xb')](function(_0x5c6c2a){logger['info'](_0xd567('0xc'),_0x11e575,_0xd567('0xd'));logger[_0xd567('0xe')](_0xd567('0xf'),_0x11e575,_0xd567('0xd'),JSON[_0xd567('0x10')](_0x5c6c2a));if(_0x5c6c2a[_0xd567('0x11')]){if(_0x5c6c2a[_0xd567('0x11')][_0xd567('0x12')]===0x1f4){logger[_0xd567('0x11')](_0xd567('0xc'),_0x11e575,_0x5c6c2a[_0xd567('0x11')]['message']);return _0x1b29f1(_0x5c6c2a[_0xd567('0x11')]['message']);}logger[_0xd567('0x11')](_0xd567('0xc'),_0x11e575,_0x5c6c2a[_0xd567('0x11')]['message']);return _0x3602ac(_0x5c6c2a['error'][_0xd567('0x13')]);}else{logger[_0xd567('0x14')]('OpenchannelApplication,\x20%s,\x20%s',_0x11e575,_0xd567('0xd'));_0x3602ac(_0x5c6c2a['result']['message']);}})[_0xd567('0x15')](function(_0x2d152f){logger['error'](_0xd567('0xc'),_0x11e575,_0x2d152f);_0x1b29f1(_0x2d152f);});});}exports[_0xd567('0x16')]=function(_0x241e01){var _0x55c364=this;return new Promise(function(_0x1ceb59,_0x182187){return db[_0xd567('0x17')][_0xd567('0x18')](_0x241e01['body'],{'raw':_0x241e01['options']?_0x241e01[_0xd567('0x19')][_0xd567('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x241e01[_0xd567('0x19')]?_0x241e01[_0xd567('0x19')][_0xd567('0x1b')]||null:null,'attributes':_0x241e01[_0xd567('0x19')]?_0x241e01[_0xd567('0x19')][_0xd567('0x1c')]||null:null,'limit':_0x241e01[_0xd567('0x19')]?_0x241e01['options'][_0xd567('0x1d')]||null:null})[_0xd567('0xb')](function(_0x5126a9){logger[_0xd567('0x14')](_0xd567('0x16'),_0x241e01);logger[_0xd567('0xe')](_0xd567('0x16'),_0x241e01,JSON[_0xd567('0x10')](_0x5126a9));_0x1ceb59(_0x5126a9);})[_0xd567('0x15')](function(_0x393455){logger[_0xd567('0x11')]('UpdateOpenchannelApplication',_0x393455[_0xd567('0x13')],_0x241e01);_0x182187(_0x55c364['error'](0x1f4,_0x393455[_0xd567('0x13')]));});});}; \ No newline at end of file +var _0xa062=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','result','UpdateOpenchannelApplication','update','body','options','raw','where','limit'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xa062,0x101));var _0x2a06=function(_0x4f834a,_0x2e7f25){_0x4f834a=_0x4f834a-0x0;var _0x52089d=_0xa062[_0x4f834a];return _0x52089d;};'use strict';var _=require(_0x2a06('0x0'));var util=require(_0x2a06('0x1'));var moment=require(_0x2a06('0x2'));var BPromise=require(_0x2a06('0x3'));var rs=require(_0x2a06('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a06('0x5'))['db'];var utils=require(_0x2a06('0x6'));var logger=require(_0x2a06('0x7'))(_0x2a06('0x8'));var config=require(_0x2a06('0x9'));var jayson=require(_0x2a06('0xa'));var client=jayson['client'][_0x2a06('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2fc80f,_0x4c6b0b,_0x1181d4){return new BPromise(function(_0x5a7f8a,_0x3f7cf9){return client[_0x2a06('0xc')](_0x2fc80f,_0x1181d4)[_0x2a06('0xd')](function(_0x34fac2){logger[_0x2a06('0xe')]('OpenchannelApplication,\x20%s,\x20%s',_0x4c6b0b,_0x2a06('0xf'));logger[_0x2a06('0x10')](_0x2a06('0x11'),_0x4c6b0b,_0x2a06('0xf'),JSON[_0x2a06('0x12')](_0x34fac2));if(_0x34fac2[_0x2a06('0x13')]){if(_0x34fac2[_0x2a06('0x13')][_0x2a06('0x14')]===0x1f4){logger[_0x2a06('0x13')](_0x2a06('0x15'),_0x4c6b0b,_0x34fac2[_0x2a06('0x13')][_0x2a06('0x16')]);return _0x3f7cf9(_0x34fac2[_0x2a06('0x13')][_0x2a06('0x16')]);}logger[_0x2a06('0x13')](_0x2a06('0x15'),_0x4c6b0b,_0x34fac2[_0x2a06('0x13')]['message']);return _0x5a7f8a(_0x34fac2['error']['message']);}else{logger[_0x2a06('0xe')](_0x2a06('0x15'),_0x4c6b0b,_0x2a06('0xf'));_0x5a7f8a(_0x34fac2[_0x2a06('0x17')]['message']);}})['catch'](function(_0x1123f0){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x4c6b0b,_0x1123f0);_0x3f7cf9(_0x1123f0);});});}exports[_0x2a06('0x18')]=function(_0x507f83){var _0x107bc4=this;return new Promise(function(_0x5c7cd0,_0x5b6851){return db['OpenchannelApplication'][_0x2a06('0x19')](_0x507f83[_0x2a06('0x1a')],{'raw':_0x507f83[_0x2a06('0x1b')]?_0x507f83[_0x2a06('0x1b')][_0x2a06('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x507f83[_0x2a06('0x1b')]?_0x507f83[_0x2a06('0x1b')][_0x2a06('0x1d')]||null:null,'attributes':_0x507f83[_0x2a06('0x1b')]?_0x507f83[_0x2a06('0x1b')]['attributes']||null:null,'limit':_0x507f83[_0x2a06('0x1b')]?_0x507f83[_0x2a06('0x1b')][_0x2a06('0x1e')]||null:null})[_0x2a06('0xd')](function(_0x5de3da){logger[_0x2a06('0xe')](_0x2a06('0x18'),_0x507f83);logger[_0x2a06('0x10')]('UpdateOpenchannelApplication',_0x507f83,JSON[_0x2a06('0x12')](_0x5de3da));_0x5c7cd0(_0x5de3da);})[_0x2a06('0x1f')](function(_0x483756){logger[_0x2a06('0x13')](_0x2a06('0x18'),_0x483756[_0x2a06('0x16')],_0x507f83);_0x5b6851(_0x107bc4[_0x2a06('0x13')](0x1f4,_0x483756['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 361ecef..df2821c 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 _0x310f=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/messages','post','create','addMessage','/:id/tags','openchannel','openchannelinteraction:addtags','addTags','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','removeTags','exports','multer'];(function(_0x42c3ea,_0x2cae04){var _0x294a04=function(_0x265626){while(--_0x265626){_0x42c3ea['push'](_0x42c3ea['shift']());}};_0x294a04(++_0x2cae04);}(_0x310f,0x1cf));var _0xf310=function(_0x269b6d,_0x76fe8f){_0x269b6d=_0x269b6d-0x0;var _0x75dae5=_0x310f[_0x269b6d];return _0x75dae5;};'use strict';var multer=require(_0xf310('0x0'));var util=require(_0xf310('0x1'));var path=require(_0xf310('0x2'));var timeout=require(_0xf310('0x3'));var express=require(_0xf310('0x4'));var router=express[_0xf310('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf310('0x6'));var interaction=require(_0xf310('0x7'));var config=require(_0xf310('0x8'));var controller=require('./openchannelInteraction.controller');router[_0xf310('0x9')]('/',auth[_0xf310('0xa')](),controller[_0xf310('0xb')]);router[_0xf310('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xf310('0xc')]);router['get'](_0xf310('0xd'),auth['isAuthenticated'](),controller[_0xf310('0xe')]);router['get'](_0xf310('0xf'),auth[_0xf310('0xa')](),controller['getMessages']);router[_0xf310('0x9')]('/:id/download',auth[_0xf310('0xa')](),controller['download']);router[_0xf310('0x10')]('/',auth[_0xf310('0xa')](),controller[_0xf310('0x11')]);router[_0xf310('0x10')](_0xf310('0xf'),auth[_0xf310('0xa')](),controller[_0xf310('0x12')]);router['post'](_0xf310('0x13'),auth['isAuthenticated'](),interaction['tracked'](_0xf310('0x14'),_0xf310('0x15')),controller[_0xf310('0x16')]);router['put'](_0xf310('0xd'),auth['isAuthenticated'](),interaction['tracked'](_0xf310('0x14'),_0xf310('0x17')),controller[_0xf310('0x18')]);router[_0xf310('0x19')](_0xf310('0xd'),auth[_0xf310('0xa')](),interaction['tracked'](_0xf310('0x14'),_0xf310('0x1a')),controller['destroy']);router[_0xf310('0x19')](_0xf310('0x13'),auth[_0xf310('0xa')](),controller[_0xf310('0x1b')]);module[_0xf310('0x1c')]=router; \ No newline at end of file +var _0xaf0c=['openchannelinteraction:update','update','destroy','delete','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','post','/:id/tags','tracked','openchannelinteraction:addtags','addTags','put','openchannel'];(function(_0x57d6ec,_0x103687){var _0x5ce568=function(_0x4dd281){while(--_0x4dd281){_0x57d6ec['push'](_0x57d6ec['shift']());}};_0x5ce568(++_0x103687);}(_0xaf0c,0x75));var _0xcaf0=function(_0x3c79d1,_0x1e55d4){_0x3c79d1=_0x3c79d1-0x0;var _0x1646e8=_0xaf0c[_0x3c79d1];return _0x1646e8;};'use strict';var multer=require('multer');var util=require(_0xcaf0('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcaf0('0x1'));var router=express[_0xcaf0('0x2')]();var fs_extra=require(_0xcaf0('0x3'));var auth=require(_0xcaf0('0x4'));var interaction=require(_0xcaf0('0x5'));var config=require(_0xcaf0('0x6'));var controller=require(_0xcaf0('0x7'));router[_0xcaf0('0x8')]('/',auth[_0xcaf0('0x9')](),controller[_0xcaf0('0xa')]);router['get'](_0xcaf0('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xcaf0('0x8')](_0xcaf0('0xc'),auth[_0xcaf0('0x9')](),controller[_0xcaf0('0xd')]);router[_0xcaf0('0x8')](_0xcaf0('0xe'),auth[_0xcaf0('0x9')](),controller[_0xcaf0('0xf')]);router['get']('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0xcaf0('0x10')]('/',auth[_0xcaf0('0x9')](),controller['create']);router[_0xcaf0('0x10')](_0xcaf0('0xe'),auth[_0xcaf0('0x9')](),controller['addMessage']);router[_0xcaf0('0x10')](_0xcaf0('0x11'),auth[_0xcaf0('0x9')](),interaction[_0xcaf0('0x12')]('openchannel',_0xcaf0('0x13')),controller[_0xcaf0('0x14')]);router[_0xcaf0('0x15')](_0xcaf0('0xc'),auth[_0xcaf0('0x9')](),interaction[_0xcaf0('0x12')](_0xcaf0('0x16'),_0xcaf0('0x17')),controller[_0xcaf0('0x18')]);router['delete'](_0xcaf0('0xc'),auth['isAuthenticated'](),interaction[_0xcaf0('0x12')](_0xcaf0('0x16'),'openchannelinteraction:destroy'),controller[_0xcaf0('0x19')]);router[_0xcaf0('0x1a')](_0xcaf0('0x11'),auth[_0xcaf0('0x9')](),controller['removeTags']);module[_0xcaf0('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 0988db1..8b8ca89 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 _0xfb30=['STRING','DATE','ENUM','out','sequelize','exports'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xfb30,0x88));var _0x0fb3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfb30[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0fb3('0x0'));module[_0x0fb3('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0fb3('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x0fb3('0x2')]},'note':{'type':Sequelize[_0x0fb3('0x2')]},'read1stAt':{'type':Sequelize[_0x0fb3('0x3')]},'threadId':{'type':Sequelize[_0x0fb3('0x2')]},'externalUrl':{'type':Sequelize[_0x0fb3('0x2')]},'lastMsgAt':{'type':Sequelize[_0x0fb3('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0fb3('0x4')]('in',_0x0fb3('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x0fb3('0x4')]('in',_0x0fb3('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x0fb3('0x2')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x0cfa=['DATE','STRING','ENUM','sequelize','exports','BOOLEAN'];(function(_0x103d4c,_0x1baf87){var _0x588a26=function(_0x9da33c){while(--_0x9da33c){_0x103d4c['push'](_0x103d4c['shift']());}};_0x588a26(++_0x1baf87);}(_0x0cfa,0x18f));var _0xa0cf=function(_0x3e41fb,_0x3777b4){_0x3e41fb=_0x3e41fb-0x0;var _0x57570b=_0x0cfa[_0x3e41fb];return _0x57570b;};'use strict';var Sequelize=require(_0xa0cf('0x0'));module[_0xa0cf('0x1')]={'closed':{'type':Sequelize[_0xa0cf('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa0cf('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xa0cf('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xa0cf('0x4')]},'externalUrl':{'type':Sequelize[_0xa0cf('0x4')]},'lastMsgAt':{'type':Sequelize[_0xa0cf('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xa0cf('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xa0cf('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xa0cf('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 25ad533..68288b7 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 _0x3f82=['disposition','Public','Private','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','firstName','secret','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','moment','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','getOptions','query','user','catch','show','type','from','params','model','OpenchannelInteraction','keys','filters','intersection','attributes','fields','includeAll','include','merge','options','find','create','body','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','length','hasOwnProperty','nolimit','order','sort','where','pick','OpenchannelInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','setTags','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','unix','toString','root','files','tmp','server','attachments','join','push','fullname','CmContact','Contact','lastName','Attachment','Messages','createdAt','direction','read','OpenchannelAccount','Account','User','Owner','mkdirSync','Openchannel','N.A.','closed','closedAt'];(function(_0x180aee,_0x572755){var _0x5732e5=function(_0x4d2d53){while(--_0x4d2d53){_0x180aee['push'](_0x180aee['shift']());}};_0x5732e5(++_0x572755);}(_0x3f82,0x19b));var _0x23f8=function(_0x229702,_0x40947d){_0x229702=_0x229702-0x0;var _0x1901af=_0x3f82[_0x229702];return _0x1901af;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0x23f8('0x0'));var util=require('util');var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0x23f8('0x1'));var interaction=require(_0x23f8('0x2'));var qs=require('../../components/parsers/qs');var pdf=require(_0x23f8('0x3'));var logger=require(_0x23f8('0x4'))('api');var config=require(_0x23f8('0x5'));var db=require(_0x23f8('0x6'))['db'];config[_0x23f8('0x7')]=_[_0x23f8('0x8')](config[_0x23f8('0x7')],{'host':_0x23f8('0x9'),'port':0x18eb});var socket=require(_0x23f8('0xa'))(new Redis(config[_0x23f8('0x7')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithStatusCode(_0x1a1fa8,_0xbd472d){_0xbd472d=_0xbd472d||0xcc;return function(_0x4b5343){if(_0x4b5343){return _0x1a1fa8[_0x23f8('0xb')](_0xbd472d);}return _0x1a1fa8[_0x23f8('0xc')](_0xbd472d)[_0x23f8('0xd')]();};}function respondWithResult(_0x269768,_0x4d3032){_0x4d3032=_0x4d3032||0xc8;return function(_0x2ab804){if(_0x2ab804){return _0x269768[_0x23f8('0xc')](_0x4d3032)[_0x23f8('0xe')](_0x2ab804);}};}function respondWithFilteredResult(_0x57322e,_0x41f26e){return function(_0x2da165){if(_0x2da165){var _0x9f5ca0=typeof _0x41f26e['offset']==='undefined'&&typeof _0x41f26e[_0x23f8('0xf')]===_0x23f8('0x10');var _0x51b2d2=_0x2da165[_0x23f8('0x11')];var _0x2f01b2=_0x9f5ca0?0x0:_0x41f26e[_0x23f8('0x12')];var _0x34adc4=_0x9f5ca0?_0x2da165[_0x23f8('0x11')]:_0x41f26e[_0x23f8('0x12')]+_0x41f26e[_0x23f8('0xf')];var _0x12e782;if(_0x34adc4>=_0x51b2d2){_0x34adc4=_0x51b2d2;_0x12e782=0xc8;}else{_0x12e782=0xce;}_0x57322e[_0x23f8('0xc')](_0x12e782);return _0x57322e[_0x23f8('0x13')](_0x23f8('0x14'),_0x2f01b2+'-'+_0x34adc4+'/'+_0x51b2d2)[_0x23f8('0xe')](_0x2da165);}return null;};}function saveUpdates(_0x39eed9){return function(_0x53f759){if(_0x53f759){return _0x53f759[_0x23f8('0x15')](_0x39eed9)[_0x23f8('0x16')](function(_0x40f490){return _0x40f490;});}return null;};}function removeEntity(_0x5b5da4){return function(_0x4ede76){if(_0x4ede76){return _0x4ede76[_0x23f8('0x17')]()[_0x23f8('0x16')](function(){_0x5b5da4[_0x23f8('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22529c){return function(_0xa1405f){if(!_0xa1405f){_0x22529c[_0x23f8('0xb')](0x194);}return _0xa1405f;};}function handleError(_0x410efa,_0x5bc6c7){_0x5bc6c7=_0x5bc6c7||0x1f4;return function(_0x396c20){logger[_0x23f8('0x18')](_0x396c20[_0x23f8('0x19')]);if(_0x396c20[_0x23f8('0x1a')]){delete _0x396c20[_0x23f8('0x1a')];}_0x410efa['status'](_0x5bc6c7)[_0x23f8('0x1b')](_0x396c20);};}exports['index']=function(_0x28614b,_0x3f9394){var _0x22dad1={};var _0x3ab975=_[_0x23f8('0x1c')](db['OpenchannelInteraction'][_0x23f8('0x1d')],function(_0x52e190){return{'name':_0x52e190[_0x23f8('0x1e')],'type':_0x52e190['type']['key']};});_0x22dad1=qs[_0x23f8('0x1f')](_0x3ab975,_0x28614b);return interaction['findAll']('openchannel',_0x28614b[_0x23f8('0x20')],_0x28614b[_0x23f8('0x21')],_0x22dad1,_0x3ab975)[_0x23f8('0x16')](respondWithFilteredResult(_0x3f9394,_0x22dad1))[_0x23f8('0x22')](handleError(_0x3f9394,null));};exports[_0x23f8('0x23')]=function(_0xb2e852,_0x387366){var _0x4e4afa={};if(_0xb2e852[_0x23f8('0x20')][_0x23f8('0x24')]&&_0xb2e852[_0x23f8('0x20')]['type']===_0x23f8('0x25')){_0x4e4afa['from']=_0xb2e852[_0x23f8('0x26')]['id'];}else{_0x4e4afa['id']=_0xb2e852[_0x23f8('0x26')]['id'];}var _0x59060c={'raw':![],'where':_0x4e4afa},_0x48e5d9={};_0x48e5d9[_0x23f8('0x27')]=_['keys'](db[_0x23f8('0x28')][_0x23f8('0x1d')]);_0x48e5d9[_0x23f8('0x20')]=_[_0x23f8('0x29')](_0xb2e852['query']);_0x48e5d9[_0x23f8('0x2a')]=_[_0x23f8('0x2b')](_0x48e5d9[_0x23f8('0x27')],_0x48e5d9[_0x23f8('0x20')]);_0x59060c[_0x23f8('0x2c')]=_[_0x23f8('0x2b')](_0x48e5d9['model'],qs[_0x23f8('0x2d')](_0xb2e852['query'][_0x23f8('0x2d')]));_0x59060c[_0x23f8('0x2c')]=_0x59060c['attributes']['length']?_0x59060c[_0x23f8('0x2c')]:_0x48e5d9['model'];if(_0xb2e852[_0x23f8('0x20')][_0x23f8('0x2e')]){_0x59060c[_0x23f8('0x2f')]=[{'all':!![]}];}_0x59060c=_[_0x23f8('0x30')]({},_0x59060c,_0xb2e852[_0x23f8('0x31')]);return db['OpenchannelInteraction'][_0x23f8('0x32')](_0x59060c)['then'](handleEntityNotFound(_0x387366,null))['then'](respondWithResult(_0x387366,null))['catch'](handleError(_0x387366,null));};exports[_0x23f8('0x33')]=function(_0x92cb91,_0x238365){return db[_0x23f8('0x28')][_0x23f8('0x33')](_0x92cb91[_0x23f8('0x34')],{})[_0x23f8('0x16')](respondWithResult(_0x238365,0xc9))[_0x23f8('0x22')](handleError(_0x238365,null));};exports[_0x23f8('0x15')]=function(_0x128bcf,_0x323e82){if(_0x128bcf[_0x23f8('0x34')]['id']){delete _0x128bcf[_0x23f8('0x34')]['id'];}return db[_0x23f8('0x28')][_0x23f8('0x32')]({'where':{'id':_0x128bcf[_0x23f8('0x26')]['id']}})[_0x23f8('0x16')](handleEntityNotFound(_0x323e82,null))[_0x23f8('0x16')](saveUpdates(_0x128bcf[_0x23f8('0x34')],null))[_0x23f8('0x16')](respondWithResult(_0x323e82,null))[_0x23f8('0x22')](handleError(_0x323e82,null));};exports['destroy']=function(_0x33d097,_0x36f6db){return db[_0x23f8('0x28')][_0x23f8('0x32')]({'where':{'id':_0x33d097[_0x23f8('0x26')]['id']}})[_0x23f8('0x16')](handleEntityNotFound(_0x36f6db,null))['then'](removeEntity(_0x36f6db,null))[_0x23f8('0x22')](handleError(_0x36f6db,null));};exports[_0x23f8('0x35')]=function(_0xbae6de,_0x380189){return db[_0x23f8('0x28')][_0x23f8('0x35')]()[_0x23f8('0x16')](respondWithResult(_0x380189,null))[_0x23f8('0x22')](handleError(_0x380189,null));};exports[_0x23f8('0x36')]=function(_0x1d935c,_0x9d91cc){return db[_0x23f8('0x37')][_0x23f8('0x32')]({'where':{'id':_0x1d935c['params']['id']}})[_0x23f8('0x16')](handleEntityNotFound(_0x9d91cc,null))['then'](function(_0x505b42){if(_0x505b42){return _0x505b42['addMessage'](_0x1d935c[_0x23f8('0x34')][_0x23f8('0x38')],_[_0x23f8('0x39')](_0x1d935c[_0x23f8('0x34')],[_0x23f8('0x38'),'id'])||{});}})['then'](respondWithResult(_0x9d91cc,null))['catch'](handleError(_0x9d91cc,null));};exports[_0x23f8('0x3a')]=function(_0x21e091,_0x5c5d81){var _0x961c66={'raw':![],'where':{}};var _0x552d6b={};var _0x2ab9ba={'count':0x0,'rows':[]};return db[_0x23f8('0x28')][_0x23f8('0x3b')]({'where':{'id':_0x21e091['params']['id']}})[_0x23f8('0x16')](handleEntityNotFound(_0x5c5d81,null))[_0x23f8('0x16')](function(_0x4e0b7e){if(_0x4e0b7e){_0x552d6b[_0x23f8('0x27')]=_['keys'](db[_0x23f8('0x37')][_0x23f8('0x1d')]);_0x552d6b[_0x23f8('0x20')]=_[_0x23f8('0x29')](_0x21e091[_0x23f8('0x20')]);_0x552d6b[_0x23f8('0x2a')]=_['intersection'](_0x552d6b[_0x23f8('0x27')],_0x552d6b[_0x23f8('0x20')]);_0x961c66['attributes']=_['intersection'](_0x552d6b['model'],qs[_0x23f8('0x2d')](_0x21e091[_0x23f8('0x20')][_0x23f8('0x2d')]));_0x961c66[_0x23f8('0x2c')]=_0x961c66[_0x23f8('0x2c')][_0x23f8('0x3c')]?_0x961c66[_0x23f8('0x2c')]:_0x552d6b[_0x23f8('0x27')];if(!_0x21e091[_0x23f8('0x20')][_0x23f8('0x3d')](_0x23f8('0x3e'))){_0x961c66[_0x23f8('0xf')]=qs[_0x23f8('0xf')](_0x21e091[_0x23f8('0x20')][_0x23f8('0xf')]);_0x961c66[_0x23f8('0x12')]=qs[_0x23f8('0x12')](_0x21e091[_0x23f8('0x20')][_0x23f8('0x12')]);}_0x961c66[_0x23f8('0x3f')]=qs[_0x23f8('0x40')](_0x21e091['query'][_0x23f8('0x40')]);_0x961c66[_0x23f8('0x41')]=qs[_0x23f8('0x2a')](_[_0x23f8('0x42')](_0x21e091[_0x23f8('0x20')],_0x552d6b[_0x23f8('0x2a')]));_0x961c66[_0x23f8('0x41')][_0x23f8('0x43')]=_0x4e0b7e['id'];if(_0x21e091[_0x23f8('0x20')][_0x23f8('0x44')]){_0x961c66['where']=_['merge'](_0x961c66['where'],{'$or':_[_0x23f8('0x1c')](_0x961c66['attributes'],function(_0x2852eb){var _0x494bdd={};_0x494bdd[_0x2852eb]={'$like':'%'+_0x21e091[_0x23f8('0x20')][_0x23f8('0x44')]+'%'};return _0x494bdd;})});}if(_0x21e091['query']['$gte']){var _0xe6f4c=_0x21e091[_0x23f8('0x20')][_0x23f8('0x45')][_0x23f8('0x46')](',');var _0x25b524={};_0x25b524[_0xe6f4c[0x0]]={'$gte':moment(_0xe6f4c[0x1])[_0x23f8('0x47')](_0x23f8('0x48'))};_0x961c66[_0x23f8('0x41')]=_['merge'](_0x961c66[_0x23f8('0x41')],_0x25b524);}_0x961c66=_['merge']({},_0x961c66,_0x21e091[_0x23f8('0x31')]);return db[_0x23f8('0x37')][_0x23f8('0x11')]({'where':_0x961c66[_0x23f8('0x41')]})[_0x23f8('0x16')](function(_0x4ba98a){_0x2ab9ba[_0x23f8('0x11')]=_0x4ba98a;if(_0x21e091[_0x23f8('0x20')][_0x23f8('0x2e')]){_0x961c66[_0x23f8('0x2f')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x23f8('0x49')](_0x961c66);})[_0x23f8('0x16')](function(_0x40bd6c){_0x2ab9ba[_0x23f8('0x4a')]=_0x40bd6c;return _0x2ab9ba;});}})[_0x23f8('0x16')](respondWithFilteredResult(_0x5c5d81,_0x961c66))[_0x23f8('0x22')](handleError(_0x5c5d81,null));};exports['addTags']=function(_0x1965b6,_0x5c5994){return db['OpenchannelInteraction'][_0x23f8('0x32')]({'where':{'id':_0x1965b6[_0x23f8('0x26')]['id']}})[_0x23f8('0x16')](handleEntityNotFound(_0x5c5994,null))[_0x23f8('0x16')](function(_0x4e7c89){if(_0x4e7c89){return _0x4e7c89[_0x23f8('0x4b')](_0x1965b6[_0x23f8('0x34')][_0x23f8('0x38')],_[_0x23f8('0x39')](_0x1965b6[_0x23f8('0x34')],[_0x23f8('0x38'),'id'])||{})[_0x23f8('0x4c')](function(){return db[_0x23f8('0x4d')][_0x23f8('0x49')]({'attributes':['id',_0x23f8('0x1a'),_0x23f8('0x4e')],'where':{'id':_0x1965b6[_0x23f8('0x34')]['ids']}});})[_0x23f8('0x16')](function(_0x1321ec){socket[_0x23f8('0x4f')](_0x23f8('0x50'),{'id':Number(_0x1965b6[_0x23f8('0x26')]['id']),'tags':_0x1321ec||[]});return{'id':Number(_0x1965b6[_0x23f8('0x26')]['id']),'tags':_0x1321ec||[]};});}})[_0x23f8('0x16')](respondWithResult(_0x5c5994,null))['catch'](handleError(_0x5c5994,null));};exports[_0x23f8('0x51')]=function(_0x5936ba,_0x54fbed){return db['OpenchannelInteraction'][_0x23f8('0x32')]({'where':{'id':_0x5936ba[_0x23f8('0x26')]['id']}})[_0x23f8('0x16')](handleEntityNotFound(_0x54fbed,null))['then'](function(_0xb13e3a){if(_0xb13e3a){return _0xb13e3a[_0x23f8('0x51')](_0x5936ba[_0x23f8('0x20')][_0x23f8('0x38')]);}})[_0x23f8('0x16')](respondWithStatusCode(_0x54fbed,null))[_0x23f8('0x22')](handleError(_0x54fbed,null));};exports['download']=function(_0x1d7677,_0x384e07){var _0x1d9eef=moment()[_0x23f8('0x52')]()[_0x23f8('0x53')]();var _0x596c90=path['join'](config[_0x23f8('0x54')],'server',_0x23f8('0x55'),_0x23f8('0x56'));var _0x6420bb=path['join'](config[_0x23f8('0x54')],_0x23f8('0x57'),'files',_0x23f8('0x58'));var _0x25f456=path[_0x23f8('0x59')](_0x596c90,_0x1d9eef);var _0xb0212e=util[_0x23f8('0x47')]('transcript-%d-%s.zip',_0x1d7677[_0x23f8('0x26')]['id'],_0x1d9eef);var _0x5176c1=path[_0x23f8('0x59')](_0x596c90,_0xb0212e);var _0x50e6c0=[];_0x50e6c0[_0x23f8('0x5a')]({'model':db['User'],'as':'User','attributes':['id',_0x23f8('0x5b')],'raw':!![]});_0x50e6c0['push']({'model':db[_0x23f8('0x5c')],'as':_0x23f8('0x5d'),'attributes':['id','firstName',_0x23f8('0x5e')],'raw':!![]});if(_0x1d7677['query'][_0x23f8('0x58')]){_0x50e6c0[_0x23f8('0x5a')]({'model':db[_0x23f8('0x5f')],'as':_0x23f8('0x5f'),'raw':!![]});}var _0x3ea3ee=[{'model':db[_0x23f8('0x37')],'as':_0x23f8('0x60'),'attributes':['id',_0x23f8('0x34'),_0x23f8('0x61'),_0x23f8('0x62'),'secret',_0x23f8('0x63')],'include':_0x50e6c0}];_0x3ea3ee['push']({'model':db[_0x23f8('0x64')],'as':_0x23f8('0x65'),'attributes':['id',_0x23f8('0x1a')]});_0x3ea3ee[_0x23f8('0x5a')]({'model':db[_0x23f8('0x66')],'as':_0x23f8('0x67'),'attributes':['id',_0x23f8('0x5b')]});return db[_0x23f8('0x28')][_0x23f8('0x32')]({'where':{'id':_0x1d7677[_0x23f8('0x26')]['id']},'include':_0x3ea3ee})[_0x23f8('0x16')](handleEntityNotFound(_0x384e07,null))[_0x23f8('0x16')](function(_0x4a978b){if(_0x4a978b){var _0xab71e7=_0x4a978b['get']({'plain':!![]});fs[_0x23f8('0x68')](_0x25f456);var _0x2c981b={'channel':_0x23f8('0x69'),'account':_0xab71e7[_0x23f8('0x65')]['name'],'agent':_0xab71e7[_0x23f8('0x67')]?_0xab71e7[_0x23f8('0x67')]['fullname']:_0x23f8('0x6a'),'createdAt':moment(_0xab71e7[_0x23f8('0x61')])[_0x23f8('0x47')](_0x23f8('0x48'))[_0x23f8('0x53')](),'closedAt':_0xab71e7[_0x23f8('0x6b')]?moment(_0xab71e7[_0x23f8('0x6c')])[_0x23f8('0x47')](_0x23f8('0x48'))['toString']():'','disposition':_0xab71e7[_0x23f8('0x6d')],'visibility':_0xab71e7['threadId']?_0x23f8('0x6e'):_0x23f8('0x6f'),'messages':_(_0xab71e7[_0x23f8('0x60')])[_0x23f8('0x44')]({'secret':![]})[_0x23f8('0x1c')](function(_0x4270e4){if(_0x4270e4[_0x23f8('0x5f')]){var _0xf46366=path[_0x23f8('0x59')](_0x6420bb,_0x4270e4[_0x23f8('0x5f')][_0x23f8('0x70')]);if(fs[_0x23f8('0x71')](_0xf46366)){fs[_0x23f8('0x72')](_0xf46366)[_0x23f8('0x73')](fs[_0x23f8('0x74')](path[_0x23f8('0x59')](_0x25f456,_0x4270e4[_0x23f8('0x5f')][_0x23f8('0x70')])));}}return{'date':moment(_0x4270e4[_0x23f8('0x61')])[_0x23f8('0x47')](_0x23f8('0x48'))['toString'](),'sender':_0x4270e4['direction']===_0x23f8('0x75')?_0x4270e4[_0x23f8('0x66')]?_0x4270e4[_0x23f8('0x66')][_0x23f8('0x5b')]:_0x23f8('0x76'):_0x4270e4[_0x23f8('0x5d')][_0x23f8('0x77')]+(_0x4270e4['Contact'][_0x23f8('0x5e')]?'\x20'+_0x4270e4[_0x23f8('0x5d')][_0x23f8('0x5e')]:''),'body':_0x4270e4[_0x23f8('0x5f')]?_0x4270e4[_0x23f8('0x5f')][_0x23f8('0x70')]:_0x4270e4['body'],'direction':_0x4270e4[_0x23f8('0x62')]===_0x23f8('0x75')?'A':'C','secret':_0x4270e4[_0x23f8('0x78')],'read':_0x4270e4[_0x23f8('0x63')],'attachment':_0x4270e4[_0x23f8('0x5f')]};})[_0x23f8('0x79')]()};return ejs[_0x23f8('0x7a')](path[_0x23f8('0x59')](config['root'],_0x23f8('0x57'),_0x23f8('0x7b'),_0x23f8('0x7c')),{'interaction':_0x2c981b})[_0x23f8('0x16')](function(_0x50a2d3){var _0x48db2c=path['join'](_0x25f456,_0x23f8('0x7d')+_0xab71e7['id']+'-'+_0x1d9eef+_0x23f8('0x7e'));var _0x140a3d={'path':_0x48db2c,'channel':_0x23f8('0x69'),'interactionId':_0xab71e7['id']};return pdf[_0x23f8('0x7f')](_0x50a2d3,_0x140a3d);})[_0x23f8('0x16')](function(){return new Promise(function(_0x2cca50,_0x5cf119){zipdir(_0x25f456,{'saveTo':_0x5176c1},function(_0x41f1be,_0x23d7e4){if(_0x41f1be)return _0x5cf119(_0x41f1be);return _0x2cca50(_0x23d7e4);});})[_0x23f8('0x16')](function(){return new Promise(function(_0x88b746,_0x5eb787){rimraf(_0x25f456,function(_0x635e2a){if(_0x635e2a)_0x5eb787(_0x635e2a);return _0x88b746();});});})[_0x23f8('0x16')](function(){return _0x384e07['download'](_0x5176c1,_0xb0212e,function(_0x2e765d){if(_0x2e765d){logger[_0x23f8('0x18')](_0x23f8('0x80'),_0x2e765d);}else{fs[_0x23f8('0x81')](_0x5176c1);}});});});}else{return _0x384e07[_0x23f8('0xb')](0xc8);}})[_0x23f8('0x22')](handleError(_0x384e07,null));}; \ No newline at end of file +var _0xaf34=['Private','map','existsSync','createReadStream','pipe','createWriteStream','basename','out','System','firstName','value','renderFile','downloadInteraction.ejs','transcript-','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','sendStatus','rimraf','zip-dir','moment','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','status','end','offset','undefined','count','limit','Content-Range','json','update','then','error','name','send','index','rawAttributes','fieldName','key','getOptions','findAll','openchannel','query','user','show','type','from','params','model','OpenchannelInteraction','keys','intersection','fields','attributes','include','find','create','body','catch','destroy','OpenchannelMessage','ids','omit','getMessages','findOne','filters','length','hasOwnProperty','nolimit','sort','pick','where','filter','merge','$gte','split','format','options','includeAll','rows','Tag','color','openchannelInteractionTags:save','removeTags','download','unix','toString','root','server','join','files','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','lastName','Attachment','Messages','createdAt','direction','secret','read','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','threadId','Public'];(function(_0x1114dc,_0x50aed4){var _0x164894=function(_0x40ec33){while(--_0x40ec33){_0x1114dc['push'](_0x1114dc['shift']());}};_0x164894(++_0x50aed4);}(_0xaf34,0x1a1));var _0x4af3=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xaf34[_0x1d1779];return _0x2377e9;};'use strict';var rimraf=require(_0x4af3('0x0'));var zipdir=require(_0x4af3('0x1'));var moment=require(_0x4af3('0x2'));var util=require(_0x4af3('0x3'));var path=require(_0x4af3('0x4'));var ejs=require(_0x4af3('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x4af3('0x6'));var interaction=require(_0x4af3('0x7'));var qs=require(_0x4af3('0x8'));var pdf=require(_0x4af3('0x9'));var logger=require(_0x4af3('0xa'))(_0x4af3('0xb'));var config=require('../../config/environment');var db=require(_0x4af3('0xc'))['db'];config[_0x4af3('0xd')]=_[_0x4af3('0xe')](config[_0x4af3('0xd')],{'host':_0x4af3('0xf'),'port':0x18eb});var socket=require(_0x4af3('0x10'))(new Redis(config['redis']));require(_0x4af3('0x11'))[_0x4af3('0x12')](socket);function respondWithStatusCode(_0x1431ce,_0x2a28af){_0x2a28af=_0x2a28af||0xcc;return function(_0x3c5bff){if(_0x3c5bff){return _0x1431ce['sendStatus'](_0x2a28af);}return _0x1431ce[_0x4af3('0x13')](_0x2a28af)[_0x4af3('0x14')]();};}function respondWithResult(_0x56f731,_0x237e5c){_0x237e5c=_0x237e5c||0xc8;return function(_0x253ca5){if(_0x253ca5){return _0x56f731[_0x4af3('0x13')](_0x237e5c)['json'](_0x253ca5);}};}function respondWithFilteredResult(_0x26191c,_0x16cb57){return function(_0x5833cd){if(_0x5833cd){var _0x158100=typeof _0x16cb57[_0x4af3('0x15')]===_0x4af3('0x16')&&typeof _0x16cb57['limit']===_0x4af3('0x16');var _0x4b0bfb=_0x5833cd[_0x4af3('0x17')];var _0x545ba7=_0x158100?0x0:_0x16cb57[_0x4af3('0x15')];var _0x5ddf8f=_0x158100?_0x5833cd['count']:_0x16cb57[_0x4af3('0x15')]+_0x16cb57[_0x4af3('0x18')];var _0x107d3a;if(_0x5ddf8f>=_0x4b0bfb){_0x5ddf8f=_0x4b0bfb;_0x107d3a=0xc8;}else{_0x107d3a=0xce;}_0x26191c['status'](_0x107d3a);return _0x26191c['set'](_0x4af3('0x19'),_0x545ba7+'-'+_0x5ddf8f+'/'+_0x4b0bfb)[_0x4af3('0x1a')](_0x5833cd);}return null;};}function saveUpdates(_0x289c2c){return function(_0x59b53c){if(_0x59b53c){return _0x59b53c[_0x4af3('0x1b')](_0x289c2c)[_0x4af3('0x1c')](function(_0x24c046){return _0x24c046;});}return null;};}function removeEntity(_0xe30ffa){return function(_0x552665){if(_0x552665){return _0x552665['destroy']()[_0x4af3('0x1c')](function(){_0xe30ffa['status'](0xcc)[_0x4af3('0x14')]();});}};}function handleEntityNotFound(_0x5392b4){return function(_0x261ded){if(!_0x261ded){_0x5392b4['sendStatus'](0x194);}return _0x261ded;};}function handleError(_0x54cb1a,_0x1776b0){_0x1776b0=_0x1776b0||0x1f4;return function(_0xd414b6){logger[_0x4af3('0x1d')](_0xd414b6['stack']);if(_0xd414b6[_0x4af3('0x1e')]){delete _0xd414b6['name'];}_0x54cb1a['status'](_0x1776b0)[_0x4af3('0x1f')](_0xd414b6);};}exports[_0x4af3('0x20')]=function(_0x1e2f8e,_0x1ad6be){var _0xe29d8b={};var _0x37ffaf=_['map'](db['OpenchannelInteraction'][_0x4af3('0x21')],function(_0xcbac4b){return{'name':_0xcbac4b[_0x4af3('0x22')],'type':_0xcbac4b['type'][_0x4af3('0x23')]};});_0xe29d8b=qs[_0x4af3('0x24')](_0x37ffaf,_0x1e2f8e);return interaction[_0x4af3('0x25')](_0x4af3('0x26'),_0x1e2f8e[_0x4af3('0x27')],_0x1e2f8e[_0x4af3('0x28')],_0xe29d8b,_0x37ffaf)[_0x4af3('0x1c')](respondWithFilteredResult(_0x1ad6be,_0xe29d8b))['catch'](handleError(_0x1ad6be,null));};exports[_0x4af3('0x29')]=function(_0xbe1fd2,_0x50161c){var _0x123a8f={};if(_0xbe1fd2[_0x4af3('0x27')][_0x4af3('0x2a')]&&_0xbe1fd2[_0x4af3('0x27')]['type']===_0x4af3('0x2b')){_0x123a8f['from']=_0xbe1fd2['params']['id'];}else{_0x123a8f['id']=_0xbe1fd2[_0x4af3('0x2c')]['id'];}var _0x52bb58={'raw':![],'where':_0x123a8f},_0xb1caf0={};_0xb1caf0[_0x4af3('0x2d')]=_['keys'](db[_0x4af3('0x2e')][_0x4af3('0x21')]);_0xb1caf0['query']=_[_0x4af3('0x2f')](_0xbe1fd2[_0x4af3('0x27')]);_0xb1caf0['filters']=_[_0x4af3('0x30')](_0xb1caf0['model'],_0xb1caf0[_0x4af3('0x27')]);_0x52bb58['attributes']=_[_0x4af3('0x30')](_0xb1caf0[_0x4af3('0x2d')],qs[_0x4af3('0x31')](_0xbe1fd2['query'][_0x4af3('0x31')]));_0x52bb58[_0x4af3('0x32')]=_0x52bb58[_0x4af3('0x32')]['length']?_0x52bb58[_0x4af3('0x32')]:_0xb1caf0[_0x4af3('0x2d')];if(_0xbe1fd2[_0x4af3('0x27')]['includeAll']){_0x52bb58[_0x4af3('0x33')]=[{'all':!![]}];}_0x52bb58=_['merge']({},_0x52bb58,_0xbe1fd2['options']);return db[_0x4af3('0x2e')][_0x4af3('0x34')](_0x52bb58)[_0x4af3('0x1c')](handleEntityNotFound(_0x50161c,null))[_0x4af3('0x1c')](respondWithResult(_0x50161c,null))['catch'](handleError(_0x50161c,null));};exports[_0x4af3('0x35')]=function(_0x3ebf93,_0x13b67a){return db[_0x4af3('0x2e')][_0x4af3('0x35')](_0x3ebf93[_0x4af3('0x36')],{})['then'](respondWithResult(_0x13b67a,0xc9))[_0x4af3('0x37')](handleError(_0x13b67a,null));};exports[_0x4af3('0x1b')]=function(_0x3c62f2,_0x4626d6){if(_0x3c62f2[_0x4af3('0x36')]['id']){delete _0x3c62f2[_0x4af3('0x36')]['id'];}return db['OpenchannelInteraction'][_0x4af3('0x34')]({'where':{'id':_0x3c62f2[_0x4af3('0x2c')]['id']}})[_0x4af3('0x1c')](handleEntityNotFound(_0x4626d6,null))['then'](saveUpdates(_0x3c62f2[_0x4af3('0x36')],null))[_0x4af3('0x1c')](respondWithResult(_0x4626d6,null))[_0x4af3('0x37')](handleError(_0x4626d6,null));};exports[_0x4af3('0x38')]=function(_0x295b67,_0x5cd836){return db[_0x4af3('0x2e')][_0x4af3('0x34')]({'where':{'id':_0x295b67[_0x4af3('0x2c')]['id']}})[_0x4af3('0x1c')](handleEntityNotFound(_0x5cd836,null))[_0x4af3('0x1c')](removeEntity(_0x5cd836,null))[_0x4af3('0x37')](handleError(_0x5cd836,null));};exports['describe']=function(_0x1225e9,_0x7bea60){return db[_0x4af3('0x2e')]['describe']()[_0x4af3('0x1c')](respondWithResult(_0x7bea60,null))[_0x4af3('0x37')](handleError(_0x7bea60,null));};exports['addMessage']=function(_0x76225d,_0x105b1c){return db[_0x4af3('0x39')][_0x4af3('0x34')]({'where':{'id':_0x76225d[_0x4af3('0x2c')]['id']}})[_0x4af3('0x1c')](handleEntityNotFound(_0x105b1c,null))[_0x4af3('0x1c')](function(_0x577bc1){if(_0x577bc1){return _0x577bc1['addMessage'](_0x76225d[_0x4af3('0x36')][_0x4af3('0x3a')],_[_0x4af3('0x3b')](_0x76225d[_0x4af3('0x36')],[_0x4af3('0x3a'),'id'])||{});}})['then'](respondWithResult(_0x105b1c,null))['catch'](handleError(_0x105b1c,null));};exports[_0x4af3('0x3c')]=function(_0x4995a3,_0x1435ae){var _0x480fda={'raw':![],'where':{}};var _0x24745f={};var _0x30dc6b={'count':0x0,'rows':[]};return db[_0x4af3('0x2e')][_0x4af3('0x3d')]({'where':{'id':_0x4995a3['params']['id']}})[_0x4af3('0x1c')](handleEntityNotFound(_0x1435ae,null))[_0x4af3('0x1c')](function(_0x50e5c9){if(_0x50e5c9){_0x24745f[_0x4af3('0x2d')]=_['keys'](db[_0x4af3('0x39')][_0x4af3('0x21')]);_0x24745f[_0x4af3('0x27')]=_[_0x4af3('0x2f')](_0x4995a3[_0x4af3('0x27')]);_0x24745f[_0x4af3('0x3e')]=_[_0x4af3('0x30')](_0x24745f[_0x4af3('0x2d')],_0x24745f[_0x4af3('0x27')]);_0x480fda[_0x4af3('0x32')]=_[_0x4af3('0x30')](_0x24745f[_0x4af3('0x2d')],qs[_0x4af3('0x31')](_0x4995a3[_0x4af3('0x27')][_0x4af3('0x31')]));_0x480fda[_0x4af3('0x32')]=_0x480fda[_0x4af3('0x32')][_0x4af3('0x3f')]?_0x480fda[_0x4af3('0x32')]:_0x24745f[_0x4af3('0x2d')];if(!_0x4995a3[_0x4af3('0x27')][_0x4af3('0x40')](_0x4af3('0x41'))){_0x480fda['limit']=qs[_0x4af3('0x18')](_0x4995a3[_0x4af3('0x27')][_0x4af3('0x18')]);_0x480fda[_0x4af3('0x15')]=qs[_0x4af3('0x15')](_0x4995a3[_0x4af3('0x27')][_0x4af3('0x15')]);}_0x480fda['order']=qs[_0x4af3('0x42')](_0x4995a3[_0x4af3('0x27')][_0x4af3('0x42')]);_0x480fda['where']=qs[_0x4af3('0x3e')](_[_0x4af3('0x43')](_0x4995a3[_0x4af3('0x27')],_0x24745f[_0x4af3('0x3e')]));_0x480fda[_0x4af3('0x44')]['OpenchannelInteractionId']=_0x50e5c9['id'];if(_0x4995a3[_0x4af3('0x27')][_0x4af3('0x45')]){_0x480fda[_0x4af3('0x44')]=_[_0x4af3('0x46')](_0x480fda['where'],{'$or':_['map'](_0x480fda[_0x4af3('0x32')],function(_0x351d9b){var _0x18bd30={};_0x18bd30[_0x351d9b]={'$like':'%'+_0x4995a3[_0x4af3('0x27')][_0x4af3('0x45')]+'%'};return _0x18bd30;})});}if(_0x4995a3[_0x4af3('0x27')][_0x4af3('0x47')]){var _0x5a0cb1=_0x4995a3[_0x4af3('0x27')]['$gte'][_0x4af3('0x48')](',');var _0x50ff62={};_0x50ff62[_0x5a0cb1[0x0]]={'$gte':moment(_0x5a0cb1[0x1])[_0x4af3('0x49')]('YYYY-MM-DD\x20HH:mm:ss')};_0x480fda[_0x4af3('0x44')]=_[_0x4af3('0x46')](_0x480fda[_0x4af3('0x44')],_0x50ff62);}_0x480fda=_['merge']({},_0x480fda,_0x4995a3[_0x4af3('0x4a')]);return db['OpenchannelMessage'][_0x4af3('0x17')]({'where':_0x480fda[_0x4af3('0x44')]})[_0x4af3('0x1c')](function(_0x33b590){_0x30dc6b[_0x4af3('0x17')]=_0x33b590;if(_0x4995a3[_0x4af3('0x27')][_0x4af3('0x4b')]){_0x480fda['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0x4af3('0x25')](_0x480fda);})[_0x4af3('0x1c')](function(_0x7481c9){_0x30dc6b[_0x4af3('0x4c')]=_0x7481c9;return _0x30dc6b;});}})[_0x4af3('0x1c')](respondWithFilteredResult(_0x1435ae,_0x480fda))[_0x4af3('0x37')](handleError(_0x1435ae,null));};exports['addTags']=function(_0x3c2301,_0x3a4143){return db['OpenchannelInteraction'][_0x4af3('0x34')]({'where':{'id':_0x3c2301['params']['id']}})['then'](handleEntityNotFound(_0x3a4143,null))[_0x4af3('0x1c')](function(_0x29876f){if(_0x29876f){return _0x29876f['setTags'](_0x3c2301[_0x4af3('0x36')]['ids'],_[_0x4af3('0x3b')](_0x3c2301['body'],[_0x4af3('0x3a'),'id'])||{})['spread'](function(){return db[_0x4af3('0x4d')][_0x4af3('0x25')]({'attributes':['id',_0x4af3('0x1e'),_0x4af3('0x4e')],'where':{'id':_0x3c2301[_0x4af3('0x36')]['ids']}});})['then'](function(_0x533ae1){socket['emit'](_0x4af3('0x4f'),{'id':Number(_0x3c2301[_0x4af3('0x2c')]['id']),'tags':_0x533ae1||[]});return{'id':Number(_0x3c2301[_0x4af3('0x2c')]['id']),'tags':_0x533ae1||[]};});}})[_0x4af3('0x1c')](respondWithResult(_0x3a4143,null))[_0x4af3('0x37')](handleError(_0x3a4143,null));};exports[_0x4af3('0x50')]=function(_0x308845,_0x453cfd){return db[_0x4af3('0x2e')]['find']({'where':{'id':_0x308845[_0x4af3('0x2c')]['id']}})[_0x4af3('0x1c')](handleEntityNotFound(_0x453cfd,null))[_0x4af3('0x1c')](function(_0x461aea){if(_0x461aea){return _0x461aea[_0x4af3('0x50')](_0x308845[_0x4af3('0x27')][_0x4af3('0x3a')]);}})[_0x4af3('0x1c')](respondWithStatusCode(_0x453cfd,null))[_0x4af3('0x37')](handleError(_0x453cfd,null));};exports[_0x4af3('0x51')]=function(_0x4303d5,_0xd8e4e8){var _0x614f04=moment()[_0x4af3('0x52')]()[_0x4af3('0x53')]();var _0x3c9244=path['join'](config[_0x4af3('0x54')],_0x4af3('0x55'),'files','tmp');var _0x392622=path[_0x4af3('0x56')](config[_0x4af3('0x54')],_0x4af3('0x55'),_0x4af3('0x57'),_0x4af3('0x58'));var _0x110037=path[_0x4af3('0x56')](_0x3c9244,_0x614f04);var _0x3a6ac5=util[_0x4af3('0x49')](_0x4af3('0x59'),_0x4303d5[_0x4af3('0x2c')]['id'],_0x614f04);var _0x3d6980=path[_0x4af3('0x56')](_0x3c9244,_0x3a6ac5);var _0x2632a0=[];_0x2632a0[_0x4af3('0x5a')]({'model':db[_0x4af3('0x5b')],'as':_0x4af3('0x5b'),'attributes':['id',_0x4af3('0x5c')],'raw':!![]});_0x2632a0[_0x4af3('0x5a')]({'model':db[_0x4af3('0x5d')],'as':_0x4af3('0x5e'),'attributes':['id','firstName',_0x4af3('0x5f')],'raw':!![]});if(_0x4303d5['query'][_0x4af3('0x58')]){_0x2632a0[_0x4af3('0x5a')]({'model':db[_0x4af3('0x60')],'as':_0x4af3('0x60'),'raw':!![]});}var _0x5c083e=[{'model':db[_0x4af3('0x39')],'as':_0x4af3('0x61'),'attributes':['id',_0x4af3('0x36'),_0x4af3('0x62'),_0x4af3('0x63'),_0x4af3('0x64'),_0x4af3('0x65')],'include':_0x2632a0}];_0x5c083e[_0x4af3('0x5a')]({'model':db[_0x4af3('0x66')],'as':_0x4af3('0x67'),'attributes':['id',_0x4af3('0x1e')]});_0x5c083e[_0x4af3('0x5a')]({'model':db[_0x4af3('0x5b')],'as':_0x4af3('0x68'),'attributes':['id',_0x4af3('0x5c')]});return db[_0x4af3('0x2e')][_0x4af3('0x34')]({'where':{'id':_0x4303d5[_0x4af3('0x2c')]['id']},'include':_0x5c083e})[_0x4af3('0x1c')](handleEntityNotFound(_0xd8e4e8,null))['then'](function(_0x2d2e24){if(_0x2d2e24){var _0x51aa49=_0x2d2e24[_0x4af3('0x69')]({'plain':!![]});fs[_0x4af3('0x6a')](_0x110037);var _0x5baf48={'channel':_0x4af3('0x6b'),'account':_0x51aa49[_0x4af3('0x67')][_0x4af3('0x1e')],'agent':_0x51aa49[_0x4af3('0x68')]?_0x51aa49[_0x4af3('0x68')]['fullname']:_0x4af3('0x6c'),'createdAt':moment(_0x51aa49[_0x4af3('0x62')])[_0x4af3('0x49')](_0x4af3('0x6d'))['toString'](),'closedAt':_0x51aa49[_0x4af3('0x6e')]?moment(_0x51aa49[_0x4af3('0x6f')])[_0x4af3('0x49')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x51aa49[_0x4af3('0x70')],'visibility':_0x51aa49[_0x4af3('0x71')]?_0x4af3('0x72'):_0x4af3('0x73'),'messages':_(_0x51aa49[_0x4af3('0x61')])['filter']({'secret':![]})[_0x4af3('0x74')](function(_0x4cb797){if(_0x4cb797[_0x4af3('0x60')]){var _0x2c8786=path[_0x4af3('0x56')](_0x392622,_0x4cb797['Attachment']['basename']);if(fs[_0x4af3('0x75')](_0x2c8786)){fs[_0x4af3('0x76')](_0x2c8786)[_0x4af3('0x77')](fs[_0x4af3('0x78')](path[_0x4af3('0x56')](_0x110037,_0x4cb797[_0x4af3('0x60')][_0x4af3('0x79')])));}}return{'date':moment(_0x4cb797[_0x4af3('0x62')])[_0x4af3('0x49')](_0x4af3('0x6d'))[_0x4af3('0x53')](),'sender':_0x4cb797[_0x4af3('0x63')]===_0x4af3('0x7a')?_0x4cb797[_0x4af3('0x5b')]?_0x4cb797['User'][_0x4af3('0x5c')]:_0x4af3('0x7b'):_0x4cb797[_0x4af3('0x5e')][_0x4af3('0x7c')]+(_0x4cb797[_0x4af3('0x5e')][_0x4af3('0x5f')]?'\x20'+_0x4cb797[_0x4af3('0x5e')][_0x4af3('0x5f')]:''),'body':_0x4cb797['Attachment']?_0x4cb797[_0x4af3('0x60')][_0x4af3('0x79')]:_0x4cb797['body'],'direction':_0x4cb797['direction']===_0x4af3('0x7a')?'A':'C','secret':_0x4cb797[_0x4af3('0x64')],'read':_0x4cb797['read'],'attachment':_0x4cb797[_0x4af3('0x60')]};})[_0x4af3('0x7d')]()};return ejs[_0x4af3('0x7e')](path[_0x4af3('0x56')](config[_0x4af3('0x54')],_0x4af3('0x55'),'views',_0x4af3('0x7f')),{'interaction':_0x5baf48})[_0x4af3('0x1c')](function(_0x335275){var _0x3726ee=path['join'](_0x110037,_0x4af3('0x80')+_0x51aa49['id']+'-'+_0x614f04+'.pdf');var _0x4ca023={'path':_0x3726ee,'channel':_0x4af3('0x6b'),'interactionId':_0x51aa49['id']};return pdf[_0x4af3('0x81')](_0x335275,_0x4ca023);})[_0x4af3('0x1c')](function(){return new Promise(function(_0x7bc5a,_0x4cd40a){zipdir(_0x110037,{'saveTo':_0x3d6980},function(_0x28a571,_0x552a80){if(_0x28a571)return _0x4cd40a(_0x28a571);return _0x7bc5a(_0x552a80);});})[_0x4af3('0x1c')](function(){return new Promise(function(_0xc476b8,_0x56d41f){rimraf(_0x110037,function(_0x4cfd7f){if(_0x4cfd7f)_0x56d41f(_0x4cfd7f);return _0xc476b8();});});})['then'](function(){return _0xd8e4e8['download'](_0x3d6980,_0x3a6ac5,function(_0x291825){if(_0x291825){logger[_0x4af3('0x1d')](_0x4af3('0x82'),_0x291825);}else{fs[_0x4af3('0x83')](_0x3d6980);}});});});}else{return _0xd8e4e8[_0x4af3('0x84')](0xc8);}})[_0x4af3('0x37')](handleError(_0xd8e4e8,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index fc8ded6..716f3af 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 _0xda06=['../../mysqldb','OpenchannelInteraction','OpenchannelMessage','save','update','remove','then','Users','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','events'];(function(_0x25c326,_0x250137){var _0x762452=function(_0x50ce5e){while(--_0x50ce5e){_0x25c326['push'](_0x25c326['shift']());}};_0x762452(++_0x250137);}(_0xda06,0x175));var _0x6da0=function(_0x86dbdc,_0x31693b){_0x86dbdc=_0x86dbdc-0x0;var _0x42c1fd=_0xda06[_0x86dbdc];return _0x42c1fd;};'use strict';var EventEmitter=require(_0x6da0('0x0'));var OpenchannelInteraction=require(_0x6da0('0x1'))['db'][_0x6da0('0x2')];var OpenchannelMessage=require(_0x6da0('0x1'))['db'][_0x6da0('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6da0('0x4'),'afterUpdate':_0x6da0('0x5'),'afterDestroy':_0x6da0('0x6')};function emitEvent(_0x1a265e){return function(_0x4bb216,_0x9184fc,_0x12814e){_0x4bb216['getUsers']({'attributes':['id'],'raw':!![]})[_0x6da0('0x7')](function(_0x468548){_0x4bb216['setDataValue'](_0x6da0('0x8'),_0x468548['map'](function(_0x1d57ab){return{'id':_0x1d57ab['id']};}));return OpenchannelMessage[_0x6da0('0x9')]({'where':{'OpenchannelInteractionId':_0x4bb216['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6da0('0x7')](function(_0x236967){_0x4bb216[_0x6da0('0xa')](_0x6da0('0xb'),_0x236967[_0x6da0('0xc')]);OpenchannelInteractionEvents[_0x6da0('0xd')](_0x1a265e+':'+_0x4bb216['id'],_0x4bb216);OpenchannelInteractionEvents['emit'](_0x1a265e,_0x4bb216);_0x12814e(null);})[_0x6da0('0xe')](_0x12814e(null));};}for(var e in events){if(events[_0x6da0('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x6da0('0x10')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0x40de=['hook','../../mysqldb','OpenchannelInteraction','setMaxListeners','save','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x29c3a0,_0x32be87){var _0x430f8a=function(_0x4143d9){while(--_0x4143d9){_0x29c3a0['push'](_0x29c3a0['shift']());}};_0x430f8a(++_0x32be87);}(_0x40de,0x157));var _0xe40d=function(_0x3c4087,_0x5c764b){_0x3c4087=_0x3c4087-0x0;var _0x23ad1f=_0x40de[_0x3c4087];return _0x23ad1f;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xe40d('0x0'))['db'][_0xe40d('0x1')];var OpenchannelMessage=require(_0xe40d('0x0'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xe40d('0x2')](0x0);var events={'afterCreate':_0xe40d('0x3'),'afterUpdate':_0xe40d('0x4'),'afterDestroy':_0xe40d('0x5')};function emitEvent(_0x2ca27f){return function(_0x4fa76a,_0x584cee,_0x8ee57c){_0x4fa76a[_0xe40d('0x6')]({'attributes':['id'],'raw':!![]})[_0xe40d('0x7')](function(_0x4c8a4e){_0x4fa76a['setDataValue'](_0xe40d('0x8'),_0x4c8a4e[_0xe40d('0x9')](function(_0x2eaede){return{'id':_0x2eaede['id']};}));return OpenchannelMessage[_0xe40d('0xa')]({'where':{'OpenchannelInteractionId':_0x4fa76a['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe40d('0x7')](function(_0x50635e){_0x4fa76a[_0xe40d('0xb')](_0xe40d('0xc'),_0x50635e[_0xe40d('0xd')]);OpenchannelInteractionEvents[_0xe40d('0xe')](_0x2ca27f+':'+_0x4fa76a['id'],_0x4fa76a);OpenchannelInteractionEvents['emit'](_0x2ca27f,_0x4fa76a);_0x8ee57c(null);})[_0xe40d('0xf')](_0x8ee57c(null));};}for(var e in events){if(events[_0xe40d('0x10')](e)){var event=events[e];OpenchannelInteraction[_0xe40d('0x11')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index ee21aa7..5598684 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 _0xf898=['moment','bluebird','request-promise','./openchannelInteraction.attributes','exports','define','utf8mb4_unicode_ci','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api'];(function(_0x1c446a,_0x3b3ad2){var _0x899e24=function(_0x579843){while(--_0x579843){_0x1c446a['push'](_0x1c446a['shift']());}};_0x899e24(++_0x3b3ad2);}(_0xf898,0x14d));var _0x8f89=function(_0x4c73bc,_0x1b9e44){_0x4c73bc=_0x4c73bc-0x0;var _0x13e738=_0xf898[_0x4c73bc];return _0x13e738;};'use strict';var _=require(_0x8f89('0x0'));var util=require(_0x8f89('0x1'));var logger=require('../../config/logger')(_0x8f89('0x2'));var moment=require(_0x8f89('0x3'));var BPromise=require(_0x8f89('0x4'));var rp=require(_0x8f89('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8f89('0x6'));module[_0x8f89('0x7')]=function(_0x19321c,_0x43f8ee){return _0x19321c[_0x8f89('0x8')]('OpenchannelInteraction',attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8f89('0x9'),'hooks':{'beforeUpdate':function(_0x565972,_0x10a951,_0x4ccadd){if(_0x565972[_0x8f89('0xa')]('closed')){_0x565972[_0x8f89('0xb')]=moment()[_0x8f89('0xc')](_0x8f89('0xd'));}_0x4ccadd(null,_0x565972);}}});}; \ No newline at end of file +var _0x203d=['define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closedAt','util','../../config/logger','api','moment','path','../../config/environment','./openchannelInteraction.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x203d,0x8e));var _0xd203=function(_0x340da7,_0x13d6fc){_0x340da7=_0x340da7-0x0;var _0x43b466=_0x203d[_0x340da7];return _0x43b466;};'use strict';var _=require('lodash');var util=require(_0xd203('0x0'));var logger=require(_0xd203('0x1'))(_0xd203('0x2'));var moment=require(_0xd203('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd203('0x4'));var rimraf=require('rimraf');var config=require(_0xd203('0x5'));var attributes=require(_0xd203('0x6'));module[_0xd203('0x7')]=function(_0x4827d3,_0x4ac2b0){return _0x4827d3[_0xd203('0x8')](_0xd203('0x9'),attributes,{'tableName':_0xd203('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd203('0xb'),'collate':_0xd203('0xc'),'hooks':{'beforeUpdate':function(_0x1c633f,_0x4e9fd6,_0x1528e5){if(_0x1c633f[_0xd203('0xd')]('closed')){_0x1c633f[_0xd203('0xe')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x1528e5(null,_0x1c633f);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 29c9fec..352fc06 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 _0x505e=['ids','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','find','addTags','body','omit'];(function(_0x57cfe,_0x128a7a){var _0x5adb1d=function(_0x2dd096){while(--_0x2dd096){_0x57cfe['push'](_0x57cfe['shift']());}};_0x5adb1d(++_0x128a7a);}(_0x505e,0x145));var _0xe505=function(_0x355ce8,_0x5f1d0a){_0x355ce8=_0x355ce8-0x0;var _0x1db8b8=_0x505e[_0x355ce8];return _0x1db8b8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe505('0x0'));var BPromise=require(_0xe505('0x1'));var rs=require(_0xe505('0x2'));var fs=require('fs');var Redis=require(_0xe505('0x3'));var db=require(_0xe505('0x4'))['db'];var utils=require(_0xe505('0x5'));var logger=require(_0xe505('0x6'))(_0xe505('0x7'));var config=require(_0xe505('0x8'));var jayson=require(_0xe505('0x9'));var client=jayson[_0xe505('0xa')][_0xe505('0xb')]({'port':0x232a});config[_0xe505('0xc')]=_[_0xe505('0xd')](config['redis'],{'host':_0xe505('0xe'),'port':0x18eb});var socket=require(_0xe505('0xf'))(new Redis(config[_0xe505('0xc')]));require(_0xe505('0x10'))[_0xe505('0x11')](socket);function respondWithRpcPromise(_0x5172e7,_0x34f071,_0x51544f){return new BPromise(function(_0x260605,_0x216840){return client[_0xe505('0x12')](_0x5172e7,_0x51544f)[_0xe505('0x13')](function(_0x20c27f){logger[_0xe505('0x14')](_0xe505('0x15'),_0x34f071,_0xe505('0x16'));logger[_0xe505('0x17')](_0xe505('0x18'),_0x34f071,_0xe505('0x16'),JSON[_0xe505('0x19')](_0x20c27f));if(_0x20c27f[_0xe505('0x1a')]){if(_0x20c27f['error'][_0xe505('0x1b')]===0x1f4){logger[_0xe505('0x1a')](_0xe505('0x15'),_0x34f071,_0x20c27f[_0xe505('0x1a')][_0xe505('0x1c')]);return _0x216840(_0x20c27f['error'][_0xe505('0x1c')]);}logger['error'](_0xe505('0x15'),_0x34f071,_0x20c27f[_0xe505('0x1a')][_0xe505('0x1c')]);return _0x260605(_0x20c27f['error'][_0xe505('0x1c')]);}else{logger[_0xe505('0x14')]('OpenchannelInteraction,\x20%s,\x20%s',_0x34f071,'request\x20sent');_0x260605(_0x20c27f['result'][_0xe505('0x1c')]);}})[_0xe505('0x1d')](function(_0x1836a3){logger[_0xe505('0x1a')]('OpenchannelInteraction,\x20%s,\x20%s',_0x34f071,_0x1836a3);_0x216840(_0x1836a3);});});}exports[_0xe505('0x1e')]=function(_0x176152){var _0xd76622=this;return new Promise(function(_0xed487,_0x3b9cb3){return db[_0xe505('0x1f')][_0xe505('0x20')](_0x176152['body'],{'raw':_0x176152[_0xe505('0x21')]?_0x176152[_0xe505('0x21')][_0xe505('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x176152['options']?_0x176152[_0xe505('0x21')][_0xe505('0x23')]||null:null,'attributes':_0x176152['options']?_0x176152[_0xe505('0x21')][_0xe505('0x24')]||null:null,'limit':_0x176152[_0xe505('0x21')]?_0x176152[_0xe505('0x21')][_0xe505('0x25')]||null:null})[_0xe505('0x13')](function(_0x299c0a){logger[_0xe505('0x14')]('UpdateOpenchannelInteraction',_0x176152);logger[_0xe505('0x17')](_0xe505('0x1e'),_0x176152,JSON[_0xe505('0x19')](_0x299c0a));_0xed487(_0x299c0a);})[_0xe505('0x1d')](function(_0x50b36e){logger[_0xe505('0x1a')](_0xe505('0x1e'),_0x50b36e['message'],_0x176152);_0x3b9cb3(_0xd76622[_0xe505('0x1a')](0x1f4,_0x50b36e[_0xe505('0x1c')]));});});};exports[_0xe505('0x26')]=function(_0x5d1052){return new Promise(function(_0x1cc96f,_0x29415f){return db[_0xe505('0x1f')][_0xe505('0x27')]({'where':_0x5d1052[_0xe505('0x21')]?_0x5d1052[_0xe505('0x21')][_0xe505('0x23')]||null:null})[_0xe505('0x13')](function(_0x4cff75){if(_0x4cff75){return _0x4cff75[_0xe505('0x28')](_0x5d1052[_0xe505('0x29')]['ids'],_[_0xe505('0x2a')](_0x5d1052['body'],[_0xe505('0x2b'),'id'])||{});}})[_0xe505('0x2c')](function(_0x223bb2){logger[_0xe505('0x14')](_0xe505('0x2d'),_0x5d1052);logger[_0xe505('0x17')](_0xe505('0x2d'),_0x5d1052,JSON[_0xe505('0x19')](_0x223bb2));_0x1cc96f(_0x223bb2);})[_0xe505('0x1d')](function(_0x30743){logger[_0xe505('0x1a')]('AddTags',_0x30743['message'],_0x5d1052);_0x29415f(_this[_0xe505('0x1a')](0x1f4,_0x30743[_0xe505('0x1c')]));});});}; \ No newline at end of file +var _0x3286=['redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateOpenchannelInteraction','body','options','raw','where','attributes','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','then','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client'];(function(_0x201d86,_0x247922){var _0x20f069=function(_0x504d28){while(--_0x504d28){_0x201d86['push'](_0x201d86['shift']());}};_0x20f069(++_0x247922);}(_0x3286,0x109));var _0x6328=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3286[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6328('0x0'));var util=require('util');var moment=require(_0x6328('0x1'));var BPromise=require(_0x6328('0x2'));var rs=require(_0x6328('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6328('0x4'));var logger=require(_0x6328('0x5'))(_0x6328('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6328('0x7')]['http']({'port':0x232a});config[_0x6328('0x8')]=_['defaults'](config[_0x6328('0x8')],{'host':_0x6328('0x9'),'port':0x18eb});var socket=require(_0x6328('0xa'))(new Redis(config[_0x6328('0x8')]));require(_0x6328('0xb'))[_0x6328('0xc')](socket);function respondWithRpcPromise(_0x4cf4a6,_0x3d7f31,_0x5dfa20){return new BPromise(function(_0x3a16a9,_0x480950){return client[_0x6328('0xd')](_0x4cf4a6,_0x5dfa20)['then'](function(_0x38cfa3){logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x3d7f31,_0x6328('0xe'));logger[_0x6328('0xf')](_0x6328('0x10'),_0x3d7f31,_0x6328('0xe'),JSON['stringify'](_0x38cfa3));if(_0x38cfa3[_0x6328('0x11')]){if(_0x38cfa3[_0x6328('0x11')][_0x6328('0x12')]===0x1f4){logger['error'](_0x6328('0x13'),_0x3d7f31,_0x38cfa3[_0x6328('0x11')][_0x6328('0x14')]);return _0x480950(_0x38cfa3[_0x6328('0x11')][_0x6328('0x14')]);}logger['error'](_0x6328('0x13'),_0x3d7f31,_0x38cfa3[_0x6328('0x11')]['message']);return _0x3a16a9(_0x38cfa3[_0x6328('0x11')][_0x6328('0x14')]);}else{logger[_0x6328('0x15')](_0x6328('0x13'),_0x3d7f31,_0x6328('0xe'));_0x3a16a9(_0x38cfa3[_0x6328('0x16')][_0x6328('0x14')]);}})[_0x6328('0x17')](function(_0x13d7aa){logger['error'](_0x6328('0x13'),_0x3d7f31,_0x13d7aa);_0x480950(_0x13d7aa);});});}exports[_0x6328('0x18')]=function(_0x2c03df){var _0x32fccc=this;return new Promise(function(_0xf774c6,_0x342b22){return db['OpenchannelInteraction']['update'](_0x2c03df[_0x6328('0x19')],{'raw':_0x2c03df[_0x6328('0x1a')]?_0x2c03df[_0x6328('0x1a')][_0x6328('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c03df[_0x6328('0x1a')]?_0x2c03df[_0x6328('0x1a')][_0x6328('0x1c')]||null:null,'attributes':_0x2c03df[_0x6328('0x1a')]?_0x2c03df['options'][_0x6328('0x1d')]||null:null,'limit':_0x2c03df[_0x6328('0x1a')]?_0x2c03df[_0x6328('0x1a')]['limit']||null:null})['then'](function(_0x1ae538){logger[_0x6328('0x15')]('UpdateOpenchannelInteraction',_0x2c03df);logger[_0x6328('0xf')]('UpdateOpenchannelInteraction',_0x2c03df,JSON['stringify'](_0x1ae538));_0xf774c6(_0x1ae538);})[_0x6328('0x17')](function(_0x290936){logger[_0x6328('0x11')](_0x6328('0x18'),_0x290936['message'],_0x2c03df);_0x342b22(_0x32fccc['error'](0x1f4,_0x290936[_0x6328('0x14')]));});});};exports[_0x6328('0x1e')]=function(_0xb227c3){return new Promise(function(_0x458739,_0x42c38d){return db[_0x6328('0x1f')][_0x6328('0x20')]({'where':_0xb227c3['options']?_0xb227c3['options']['where']||null:null})[_0x6328('0x21')](function(_0x2d64a6){if(_0x2d64a6){return _0x2d64a6[_0x6328('0x22')](_0xb227c3[_0x6328('0x19')][_0x6328('0x23')],_[_0x6328('0x24')](_0xb227c3[_0x6328('0x19')],[_0x6328('0x23'),'id'])||{});}})[_0x6328('0x25')](function(_0x548e1a){logger[_0x6328('0x15')](_0x6328('0x26'),_0xb227c3);logger[_0x6328('0xf')](_0x6328('0x26'),_0xb227c3,JSON['stringify'](_0x548e1a));_0x458739(_0x548e1a);})['catch'](function(_0x10c68f){logger[_0x6328('0x11')]('AddTags',_0x10c68f[_0x6328('0x14')],_0xb227c3);_0x42c38d(_this[_0x6328('0x11')](0x1f4,_0x10c68f[_0x6328('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 223a0b3..c683672 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 _0x21d1=['save','update','emit','removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events'];(function(_0x11bab6,_0x12c5c8){var _0x4dcaf5=function(_0x4b3927){while(--_0x4b3927){_0x11bab6['push'](_0x11bab6['shift']());}};_0x4dcaf5(++_0x12c5c8);}(_0x21d1,0x1df));var _0x121d=function(_0x2ec753,_0x51557b){_0x2ec753=_0x2ec753-0x0;var _0x36bc4a=_0x21d1[_0x2ec753];return _0x36bc4a;};'use strict';var OpenchannelInteractionEvents=require(_0x121d('0x0'));var events=[_0x121d('0x1'),'remove',_0x121d('0x2')];function createListener(_0x1acb99,_0x3d6dd2){return function(_0x2a46cd){_0x3d6dd2[_0x121d('0x3')](_0x1acb99,_0x2a46cd);};}function removeListener(_0x142440,_0x4f679f){return function(){OpenchannelInteractionEvents[_0x121d('0x4')](_0x142440,_0x4f679f);};}exports[_0x121d('0x5')]=function(_0x42fed3){for(var _0x33b0a1=0x0,_0x1600ce=events[_0x121d('0x6')];_0x33b0a1<_0x1600ce;_0x33b0a1++){var _0x2d6799=events[_0x33b0a1];var _0x378c42=createListener(_0x121d('0x7')+_0x2d6799,_0x42fed3);OpenchannelInteractionEvents['on'](_0x2d6799,_0x378c42);}}; \ No newline at end of file +var _0xfef9=['./openchannelInteraction.events','save','remove','update','emit','removeListener','register','length'];(function(_0x499311,_0x3b8bb0){var _0x9ae1f4=function(_0x184e28){while(--_0x184e28){_0x499311['push'](_0x499311['shift']());}};_0x9ae1f4(++_0x3b8bb0);}(_0xfef9,0x1c0));var _0x9fef=function(_0x4d389d,_0xec145d){_0x4d389d=_0x4d389d-0x0;var _0x22bd25=_0xfef9[_0x4d389d];return _0x22bd25;};'use strict';var OpenchannelInteractionEvents=require(_0x9fef('0x0'));var events=[_0x9fef('0x1'),_0x9fef('0x2'),_0x9fef('0x3')];function createListener(_0xdd2586,_0x19098d){return function(_0x546fac){_0x19098d[_0x9fef('0x4')](_0xdd2586,_0x546fac);};}function removeListener(_0x2c8cd8,_0x252753){return function(){OpenchannelInteractionEvents[_0x9fef('0x5')](_0x2c8cd8,_0x252753);};}exports[_0x9fef('0x6')]=function(_0x4fb2bc){for(var _0x594c67=0x0,_0x1a4e8f=events[_0x9fef('0x7')];_0x594c67<_0x1a4e8f;_0x594c67++){var _0x34aa5d=events[_0x594c67];var _0x9a5518=createListener('openchannelInteraction:'+_0x34aa5d,_0x4fb2bc);OpenchannelInteractionEvents['on'](_0x34aa5d,_0x9a5518);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index cd9d6f1..537fd09 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 _0xcb91=['openchannelmessage:create','put','update','/:id/reject','reject','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','index','isAuthenticated','describe','/:id','post','tracked','openchannel'];(function(_0x4a8893,_0x38f6ee){var _0x2b6e06=function(_0xe5acdb){while(--_0xe5acdb){_0x4a8893['push'](_0x4a8893['shift']());}};_0x2b6e06(++_0x38f6ee);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1597e2,_0x388d3e){_0x1597e2=_0x1597e2-0x0;var _0x4c8c0a=_0xcb91[_0x1597e2];return _0x4c8c0a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),interaction[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x1cb9('0xf')),controller['create']);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x10')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1cb9('0x10')](_0x1cb9('0x12'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x13')]);router['delete'](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);module[_0x1cb9('0x15')]=router; \ No newline at end of file +var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 3683ebf..12a0130 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 _0x3609=['BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x21edaf,_0x304d2f){var _0x4b9f9b=function(_0x2d33c9){while(--_0x2d33c9){_0x21edaf['push'](_0x21edaf['shift']());}};_0x4b9f9b(++_0x304d2f);}(_0x3609,0x101));var _0x9360=function(_0x311596,_0x42dbc0){_0x311596=_0x311596-0x0;var _0x4be69b=_0x3609[_0x311596];return _0x4be69b;};'use strict';var Sequelize=require(_0x9360('0x0'));module[_0x9360('0x1')]={'body':{'type':Sequelize[_0x9360('0x2')](_0x9360('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9360('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x9360('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9360('0x5')]('in','out'),'defaultValue':_0x9360('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x9360('0x7')]},'providerName':{'type':Sequelize[_0x9360('0x8')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x65c9=['exports','medium','BOOLEAN','ENUM','out','DATE','STRING','TEXT','sequelize'];(function(_0xfc70e6,_0xb4c897){var _0x5a0405=function(_0x501e6c){while(--_0x501e6c){_0xfc70e6['push'](_0xfc70e6['shift']());}};_0x5a0405(++_0xb4c897);}(_0x65c9,0x182));var _0x965c=function(_0x500d34,_0x475d70){_0x500d34=_0x500d34-0x0;var _0x297443=_0x65c9[_0x500d34];return _0x297443;};'use strict';var Sequelize=require(_0x965c('0x0'));module[_0x965c('0x1')]={'body':{'type':Sequelize['TEXT'](_0x965c('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x965c('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x965c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x965c('0x4')]('in',_0x965c('0x5')),'defaultValue':_0x965c('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x965c('0x6')]},'providerName':{'type':Sequelize[_0x965c('0x7')]},'providerResponse':{'type':Sequelize[_0x965c('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 94a5b4e..17968b3 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 _0xabdd=['SELECT','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','client','request','info','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','OpenchannelMessage,\x20%s,\x20%s','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','index','rawAttributes','fieldName','type','key','map','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','OpenchannelMessage','includeAll','include','findAll','rows','show','params','options','create','body','find','describe','../../config/logger','openchannel-interactions','accept','openchannel','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteractionId','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','User','fullname','email','internal','channel','motionChannel','event','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xabdd,0x82));var _0xdabd=function(_0x2235f4,_0x3a7ac6){_0x2235f4=_0x2235f4-0x0;var _0x33d883=_0xabdd[_0x2235f4];return _0x33d883;};'use strict';var emlformat=require(_0xdabd('0x0'));var rimraf=require(_0xdabd('0x1'));var zipdir=require(_0xdabd('0x2'));var jsonpatch=require(_0xdabd('0x3'));var rp=require('request-promise');var moment=require(_0xdabd('0x4'));var BPromise=require(_0xdabd('0x5'));var Mustache=require(_0xdabd('0x6'));var util=require('util');var path=require(_0xdabd('0x7'));var sox=require(_0xdabd('0x8'));var csv=require(_0xdabd('0x9'));var ejs=require(_0xdabd('0xa'));var fs=require('fs');var fs_extra=require(_0xdabd('0xb'));var _=require(_0xdabd('0xc'));var squel=require(_0xdabd('0xd'));var crypto=require(_0xdabd('0xe'));var jsforce=require(_0xdabd('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdabd('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdabd('0x11'));var as=require(_0xdabd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xdabd('0x13'));var config=require(_0xdabd('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xdabd('0x15'))['db'];config[_0xdabd('0x16')]=_[_0xdabd('0x17')](config[_0xdabd('0x16')],{'host':_0xdabd('0x18'),'port':0x18eb});var socket=require(_0xdabd('0x19'))(new Redis(config[_0xdabd('0x16')]));require('./openchannelMessage.socket')[_0xdabd('0x1a')](socket);var jayson=require(_0xdabd('0x1b'));var client=jayson['client'][_0xdabd('0x1c')]({'port':0x232c});var client9002=jayson[_0xdabd('0x1d')][_0xdabd('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x158130,_0x39349b,_0x283368,_0x38856e){return new BPromise(function(_0x530e0c,_0x6bf182){var _0x3eb5e1=_0x38856e||client;return _0x3eb5e1[_0xdabd('0x1e')](_0x158130,_0x283368)['then'](function(_0x1bdb33){logger[_0xdabd('0x1f')]('OpenchannelMessage,\x20%s,\x20%s',_0x39349b,'request\x20sent');logger[_0xdabd('0x20')](_0xdabd('0x21'),_0x39349b,'request\x20sent',JSON['stringify'](_0x1bdb33));if(_0x1bdb33[_0xdabd('0x22')]){if(_0x1bdb33[_0xdabd('0x22')][_0xdabd('0x23')]===0x1f4){logger[_0xdabd('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x39349b,_0x1bdb33[_0xdabd('0x22')]['message']);return _0x6bf182(_0x1bdb33['error'][_0xdabd('0x24')]);}logger['error'](_0xdabd('0x25'),_0x39349b,_0x1bdb33[_0xdabd('0x22')][_0xdabd('0x24')]);return _0x530e0c(_0x1bdb33[_0xdabd('0x22')]['message']);}else{logger[_0xdabd('0x1f')]('OpenchannelMessage,\x20%s,\x20%s',_0x39349b,'request\x20sent');_0x530e0c(_0x1bdb33[_0xdabd('0x26')][_0xdabd('0x24')]);}})[_0xdabd('0x27')](function(_0x294114){logger[_0xdabd('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x39349b,_0x294114);_0x6bf182(_0x294114);});});}function respondWithStatusCode(_0x1c8d2c,_0x5072ae){_0x5072ae=_0x5072ae||0xcc;return function(_0x3944f6){if(_0x3944f6){return _0x1c8d2c['sendStatus'](_0x5072ae);}return _0x1c8d2c[_0xdabd('0x28')](_0x5072ae)[_0xdabd('0x29')]();};}function respondWithResult(_0x5d78f3,_0x31d1ba){_0x31d1ba=_0x31d1ba||0xc8;return function(_0x3c006b){if(_0x3c006b){return _0x5d78f3[_0xdabd('0x28')](_0x31d1ba)[_0xdabd('0x2a')](_0x3c006b);}};}function respondWithFilteredResult(_0x3e532d,_0xaa485e){return function(_0x28cb96){if(_0x28cb96){var _0x947be2=typeof _0xaa485e[_0xdabd('0x2b')]===_0xdabd('0x2c')&&typeof _0xaa485e[_0xdabd('0x2d')]==='undefined';var _0x278ec7=_0x28cb96['count'];var _0x3ac15c=_0x947be2?0x0:_0xaa485e[_0xdabd('0x2b')];var _0x37c0f9=_0x947be2?_0x28cb96[_0xdabd('0x2e')]:_0xaa485e[_0xdabd('0x2b')]+_0xaa485e[_0xdabd('0x2d')];var _0x553603;if(_0x37c0f9>=_0x278ec7){_0x37c0f9=_0x278ec7;_0x553603=0xc8;}else{_0x553603=0xce;}_0x3e532d['status'](_0x553603);return _0x3e532d[_0xdabd('0x2f')](_0xdabd('0x30'),_0x3ac15c+'-'+_0x37c0f9+'/'+_0x278ec7)['json'](_0x28cb96);}return null;};}function patchUpdates(_0x4ad2cc){return function(_0x636a14){try{jsonpatch[_0xdabd('0x31')](_0x636a14,_0x4ad2cc,!![]);}catch(_0x3cb166){return BPromise[_0xdabd('0x32')](_0x3cb166);}return _0x636a14[_0xdabd('0x33')]();};}function saveUpdates(_0x54e24c,_0x4ba504){return function(_0x34cd02){if(_0x34cd02){return _0x34cd02[_0xdabd('0x34')](_0x54e24c)[_0xdabd('0x35')](function(_0x5ed55e){return _0x5ed55e;});}return null;};}function removeEntity(_0x5a2ac0,_0x27525a){return function(_0x2cff34){if(_0x2cff34){return _0x2cff34[_0xdabd('0x36')]()['then'](function(){_0x5a2ac0[_0xdabd('0x28')](0xcc)[_0xdabd('0x29')]();});}};}function handleEntityNotFound(_0xb0f6a,_0x2305cd){return function(_0x1e6dbe){if(!_0x1e6dbe){_0xb0f6a[_0xdabd('0x37')](0x194);}return _0x1e6dbe;};}function handleError(_0x1c7d1a,_0x297329){_0x297329=_0x297329||0x1f4;return function(_0x553388){logger[_0xdabd('0x22')](_0x553388[_0xdabd('0x38')]);if(_0x553388[_0xdabd('0x39')]){delete _0x553388['name'];}_0x1c7d1a[_0xdabd('0x28')](_0x297329)['send'](_0x553388);};}exports[_0xdabd('0x3a')]=function(_0x5980db,_0xcc909){var _0x5b5c42={},_0xd78aee={},_0x5acb1a={'count':0x0,'rows':[]};var _0x47009d=_['map'](db['OpenchannelMessage'][_0xdabd('0x3b')],function(_0x24a277){return{'name':_0x24a277[_0xdabd('0x3c')],'type':_0x24a277[_0xdabd('0x3d')][_0xdabd('0x3e')]};});_0xd78aee['model']=_[_0xdabd('0x3f')](_0x47009d,_0xdabd('0x39'));_0xd78aee[_0xdabd('0x40')]=_[_0xdabd('0x41')](_0x5980db[_0xdabd('0x40')]);_0xd78aee['filters']=_['intersection'](_0xd78aee[_0xdabd('0x42')],_0xd78aee[_0xdabd('0x40')]);_0x5b5c42[_0xdabd('0x43')]=_[_0xdabd('0x44')](_0xd78aee[_0xdabd('0x42')],qs[_0xdabd('0x45')](_0x5980db['query'][_0xdabd('0x45')]));_0x5b5c42['attributes']=_0x5b5c42[_0xdabd('0x43')][_0xdabd('0x46')]?_0x5b5c42['attributes']:_0xd78aee[_0xdabd('0x42')];if(!_0x5980db[_0xdabd('0x40')][_0xdabd('0x47')](_0xdabd('0x48'))){_0x5b5c42['limit']=qs[_0xdabd('0x2d')](_0x5980db[_0xdabd('0x40')][_0xdabd('0x2d')]);_0x5b5c42[_0xdabd('0x2b')]=qs['offset'](_0x5980db['query']['offset']);}_0x5b5c42[_0xdabd('0x49')]=qs[_0xdabd('0x4a')](_0x5980db['query'][_0xdabd('0x4a')]);_0x5b5c42[_0xdabd('0x4b')]=qs['filters'](_[_0xdabd('0x4c')](_0x5980db[_0xdabd('0x40')],_0xd78aee[_0xdabd('0x4d')]),_0x47009d);if(_0x5980db[_0xdabd('0x40')]['filter']){_0x5b5c42[_0xdabd('0x4b')]=_[_0xdabd('0x4e')](_0x5b5c42[_0xdabd('0x4b')],{'$or':_[_0xdabd('0x3f')](_0x47009d,function(_0x2e8100){if(_0x2e8100['type']!==_0xdabd('0x4f')){var _0x382994={};_0x382994[_0x2e8100[_0xdabd('0x39')]]={'$like':'%'+_0x5980db[_0xdabd('0x40')]['filter']+'%'};return _0x382994;}})});}_0x5b5c42=_['merge']({},_0x5b5c42,_0x5980db['options']);var _0x2584d0={'where':_0x5b5c42[_0xdabd('0x4b')]};return db[_0xdabd('0x50')][_0xdabd('0x2e')](_0x2584d0)[_0xdabd('0x35')](function(_0x2af207){_0x5acb1a[_0xdabd('0x2e')]=_0x2af207;if(_0x5980db[_0xdabd('0x40')][_0xdabd('0x51')]){_0x5b5c42[_0xdabd('0x52')]=[{'all':!![]}];}return db[_0xdabd('0x50')][_0xdabd('0x53')](_0x5b5c42);})[_0xdabd('0x35')](function(_0x55b5fa){_0x5acb1a[_0xdabd('0x54')]=_0x55b5fa;return _0x5acb1a;})['then'](respondWithFilteredResult(_0xcc909,_0x5b5c42))['catch'](handleError(_0xcc909,null));};exports[_0xdabd('0x55')]=function(_0x3831ec,_0x5e8bfe){var _0x43ea26={'raw':!![],'where':{'id':_0x3831ec[_0xdabd('0x56')]['id']}},_0x449a5a={};_0x449a5a[_0xdabd('0x42')]=_['keys'](db[_0xdabd('0x50')]['rawAttributes']);_0x449a5a[_0xdabd('0x40')]=_['keys'](_0x3831ec[_0xdabd('0x40')]);_0x449a5a[_0xdabd('0x4d')]=_[_0xdabd('0x44')](_0x449a5a[_0xdabd('0x42')],_0x449a5a[_0xdabd('0x40')]);_0x43ea26[_0xdabd('0x43')]=_['intersection'](_0x449a5a['model'],qs['fields'](_0x3831ec['query'][_0xdabd('0x45')]));_0x43ea26['attributes']=_0x43ea26[_0xdabd('0x43')][_0xdabd('0x46')]?_0x43ea26[_0xdabd('0x43')]:_0x449a5a[_0xdabd('0x42')];if(_0x3831ec[_0xdabd('0x40')][_0xdabd('0x51')]){_0x43ea26[_0xdabd('0x52')]=[{'all':!![]}];}_0x43ea26=_[_0xdabd('0x4e')]({},_0x43ea26,_0x3831ec[_0xdabd('0x57')]);return db[_0xdabd('0x50')]['find'](_0x43ea26)[_0xdabd('0x35')](handleEntityNotFound(_0x5e8bfe,null))[_0xdabd('0x35')](respondWithResult(_0x5e8bfe,null))['catch'](handleError(_0x5e8bfe,null));};exports[_0xdabd('0x58')]=function(_0x1dfe89,_0x4b1a6e){return db['OpenchannelMessage'][_0xdabd('0x58')](_0x1dfe89[_0xdabd('0x59')],{})[_0xdabd('0x35')](respondWithResult(_0x4b1a6e,0xc9))[_0xdabd('0x27')](handleError(_0x4b1a6e,null));};exports[_0xdabd('0x34')]=function(_0x2f0fff,_0x182780){if(_0x2f0fff[_0xdabd('0x59')]['id']){delete _0x2f0fff[_0xdabd('0x59')]['id'];}return db['OpenchannelMessage']['find']({'where':{'id':_0x2f0fff['params']['id']}})['then'](handleEntityNotFound(_0x182780,null))['then'](saveUpdates(_0x2f0fff[_0xdabd('0x59')],null))[_0xdabd('0x35')](respondWithResult(_0x182780,null))['catch'](handleError(_0x182780,null));};exports[_0xdabd('0x36')]=function(_0x1ec356,_0xdfabfa){return db[_0xdabd('0x50')][_0xdabd('0x5a')]({'where':{'id':_0x1ec356[_0xdabd('0x56')]['id']}})[_0xdabd('0x35')](handleEntityNotFound(_0xdfabfa,null))[_0xdabd('0x35')](removeEntity(_0xdfabfa,null))[_0xdabd('0x27')](handleError(_0xdfabfa,null));};exports[_0xdabd('0x5b')]=function(_0xbe0fba,_0x10f98b){return db[_0xdabd('0x50')][_0xdabd('0x5b')]()[_0xdabd('0x35')](respondWithResult(_0x10f98b,null))['catch'](handleError(_0x10f98b,null));};var interaction_log=require(_0xdabd('0x5c'))(_0xdabd('0x5d'));exports[_0xdabd('0x5e')]=function(_0x24486c,_0x1ade19,_0x59e273){var _0x4f30eb={'agent':{},'channel':_0xdabd('0x5f')};if(_0x24486c[_0xdabd('0x59')]['id']){delete _0x24486c[_0xdabd('0x59')]['id'];}_0x24486c[_0xdabd('0x59')][_0xdabd('0x60')]=!![];_0x24486c[_0xdabd('0x59')]['readAt']=moment()[_0xdabd('0x61')](_0xdabd('0x62'));_0x24486c[_0xdabd('0x59')][_0xdabd('0x63')]=_0x24486c[_0xdabd('0x59')][_0xdabd('0x63')]||_0x24486c[_0xdabd('0x64')]['id'];_0x4f30eb[_0xdabd('0x65')]['id']=_0x24486c[_0xdabd('0x59')][_0xdabd('0x63')];return db[_0xdabd('0x50')]['find']({'where':{'id':_0x24486c[_0xdabd('0x56')]['id'],'UserId':null}})[_0xdabd('0x35')](handleEntityNotFound(_0x1ade19,null))[_0xdabd('0x35')](saveUpdates(_0x24486c['body'],null))[_0xdabd('0x35')](function(_0x492757){if(_0x492757){_0x4f30eb[_0xdabd('0x24')]=_0x492757[_0xdabd('0x66')]({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x492757[_0xdabd('0x67')]}});}return null;})[_0xdabd('0x35')](handleEntityNotFound(_0x1ade19,null))[_0xdabd('0x35')](function(_0x249af3){if(_0x249af3){return _0x249af3[_0xdabd('0x34')]({'UserId':_0x24486c[_0xdabd('0x59')][_0xdabd('0x63')],'read1stAt':_['isNil'](_0x249af3['read1stAt'])?moment()['format'](_0xdabd('0x62')):undefined});}return null;})[_0xdabd('0x35')](function(_0x1807b5){if(_0x1807b5){_0x4f30eb['interaction']=_0x1807b5[_0xdabd('0x66')]({'plain':!![]});interaction_log[_0xdabd('0x1f')](_0xdabd('0x68'),_0x24486c[_0xdabd('0x64')]['id'],_0x24486c[_0xdabd('0x64')][_0xdabd('0x39')],_0x24486c['user'][_0xdabd('0x69')],_0x4f30eb[_0xdabd('0x6a')]['id'],_0x24486c[_0xdabd('0x59')]?JSON[_0xdabd('0x6b')](_0x24486c[_0xdabd('0x59')]):_0xdabd('0x6c'));return respondWithRpcPromise(_0xdabd('0x6d'),_0xdabd('0x6e'),_0x4f30eb);}return null;})['then'](function(_0xf83f66){var _0x4756fe=_0xdabd('0x6f')+_0xf83f66['message'][_0xdabd('0x70')];return db[_0xdabd('0x71')][_0xdabd('0x40')](_0x4756fe,{'type':db[_0xdabd('0x72')][_0xdabd('0x73')]['SELECT'],'raw':!![]})[_0xdabd('0x35')](function(_0x313a10){return _0x313a10;});})[_0xdabd('0x35')](function(_0x20024c){if(_0x20024c){_0x4f30eb[_0xdabd('0x24')]['contact']=_0x20024c[0x0];if(!_0x24486c[_0xdabd('0x59')][_0xdabd('0x63')])return;return db[_0xdabd('0x74')]['find']({'where':{'id':_0x24486c[_0xdabd('0x59')][_0xdabd('0x63')],'role':_0xdabd('0x65')},'attributes':['id',_0xdabd('0x39'),_0xdabd('0x75'),_0xdabd('0x76'),_0xdabd('0x77')],'raw':!![]});}return null;})[_0xdabd('0x35')](function(_0x580909){if(!_0x580909)return null;_0x4f30eb['message']['agent']=_0x580909;return _0x4f30eb;})['then'](function(_0x3b007d){if(_0x3b007d){if(_0x24486c[_0xdabd('0x59')]['manual']){_0x4f30eb[_0xdabd('0x24')]['interface']=util[_0xdabd('0x61')]('SIP/%s',_0x24486c[_0xdabd('0x64')]['name']);_0x4f30eb[_0xdabd('0x24')][_0xdabd('0x78')]=_0x4f30eb[_0xdabd('0x78')];_0x4f30eb[_0xdabd('0x24')][_0xdabd('0x79')]=_0x4f30eb[_0xdabd('0x78')];_0x4f30eb[_0xdabd('0x24')][_0xdabd('0x7a')]=_0xdabd('0x5e');return respondWithRpcPromise('EventManager',_0xdabd('0x7b'),{'event':_0xdabd('0x7c'),'message':_0x4f30eb[_0xdabd('0x24')]},client9002)[_0xdabd('0x35')](function(){return _0x4f30eb;});}return _0x4f30eb;}return null;})[_0xdabd('0x35')](respondWithResult(_0x1ade19,null))[_0xdabd('0x27')](handleError(_0x1ade19,null));};var interaction_log=require(_0xdabd('0x5c'))(_0xdabd('0x5d'));exports['reject']=function(_0x3ec2c0,_0x8dfc37,_0x50bb8b){var _0x5a638a={'agent':{},'channel':_0xdabd('0x5f')};if(_0x3ec2c0['body']['id']){delete _0x3ec2c0[_0xdabd('0x59')]['id'];}_0x3ec2c0[_0xdabd('0x59')][_0xdabd('0x63')]=_0x3ec2c0['body'][_0xdabd('0x63')]||_0x3ec2c0['user']['id'];_0x5a638a[_0xdabd('0x65')]['id']=_0x3ec2c0[_0xdabd('0x59')][_0xdabd('0x63')];return db[_0xdabd('0x50')]['find']({'where':{'id':_0x3ec2c0[_0xdabd('0x56')]['id'],'UserId':null}})[_0xdabd('0x35')](handleEntityNotFound(_0x8dfc37,null))[_0xdabd('0x35')](function(_0x412a0f){if(_0x412a0f){_0x5a638a[_0xdabd('0x24')]=_0x412a0f[_0xdabd('0x66')]({'plain':!![]});return db['OpenchannelInteraction'][_0xdabd('0x5a')]({'where':{'id':_0x412a0f[_0xdabd('0x67')]}});}return null;})[_0xdabd('0x35')](handleEntityNotFound(_0x8dfc37,null))[_0xdabd('0x35')](function(_0x5ba640){if(_0x5ba640){_0x5a638a['interaction']=_0x5ba640[_0xdabd('0x66')]({'plain':!![]});interaction_log[_0xdabd('0x1f')](_0xdabd('0x7d'),_0x3ec2c0['user']['id'],_0x3ec2c0[_0xdabd('0x64')][_0xdabd('0x39')],_0x3ec2c0[_0xdabd('0x64')][_0xdabd('0x69')],_0x5a638a[_0xdabd('0x6a')]['id'],_0x3ec2c0[_0xdabd('0x59')]?JSON[_0xdabd('0x6b')](_0x3ec2c0[_0xdabd('0x59')]):_0xdabd('0x6c'));return respondWithRpcPromise(_0xdabd('0x7e'),_0xdabd('0x7f'),_0x5a638a);}return null;})[_0xdabd('0x35')](function(_0x426e71){var _0x1910a3=_0xdabd('0x6f')+_0x426e71['message']['ContactId'];return db[_0xdabd('0x71')][_0xdabd('0x40')](_0x1910a3,{'type':db[_0xdabd('0x72')][_0xdabd('0x73')][_0xdabd('0x80')],'raw':!![]})[_0xdabd('0x35')](function(_0x1e67b6){return _0x1e67b6;});})[_0xdabd('0x35')](function(_0x20b63d){if(_0x20b63d){_0x5a638a['message']['contact']=_0x20b63d[0x0];if(!_0x3ec2c0[_0xdabd('0x59')][_0xdabd('0x63')])return;return db[_0xdabd('0x74')][_0xdabd('0x5a')]({'where':{'id':_0x3ec2c0['body'][_0xdabd('0x63')],'role':_0xdabd('0x65')},'attributes':['id',_0xdabd('0x39'),_0xdabd('0x75'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x24ef93){if(!_0x24ef93)return null;_0x5a638a[_0xdabd('0x24')][_0xdabd('0x65')]=_0x24ef93;return _0x5a638a;})[_0xdabd('0x35')](function(_0x52acc2){if(_0x52acc2){_0x52acc2[_0xdabd('0x24')]['interface']=util[_0xdabd('0x61')]('SIP/%s',_0x3ec2c0['user'][_0xdabd('0x39')]);_0x52acc2[_0xdabd('0x24')]['channel']=_0x5a638a[_0xdabd('0x78')];_0x52acc2[_0xdabd('0x24')]['motionChannel']=_0x5a638a[_0xdabd('0x78')];_0x52acc2[_0xdabd('0x24')][_0xdabd('0x7a')]=_0xdabd('0x32');respondWithRpcPromise('EventManager',_0xdabd('0x7b'),{'event':'rejectmessage','message':_0x52acc2[_0xdabd('0x24')]},client9002);return _0x5a638a;}return null;})[_0xdabd('0x35')](respondWithResult(_0x8dfc37,null))['catch'](handleError(_0x8dfc37,null));}; \ No newline at end of file +var _0x2bd4=['moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','undefined','limit','offset','set','Content-Range','json','reject','save','update','destroy','stack','name','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','pick','filter','where','merge','options','OpenchannelMessage','count','includeAll','include','findAll','rows','params','keys','length','create','body','find','describe','../../config/logger','openchannel-interactions','accept','openchannel','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','OpenchannelInteraction','OpenchannelInteractionId','interaction','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','rejectMessage','contact','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x1d33e8,_0x3d76aa){var _0x3b87ed=function(_0x42cf24){while(--_0x42cf24){_0x1d33e8['push'](_0x1d33e8['shift']());}};_0x3b87ed(++_0x3d76aa);}(_0x2bd4,0x103));var _0x42bd=function(_0xd5b1e,_0xf0c640){_0xd5b1e=_0xd5b1e-0x0;var _0x42247=_0x2bd4[_0xd5b1e];return _0x42247;};'use strict';var emlformat=require(_0x42bd('0x0'));var rimraf=require(_0x42bd('0x1'));var zipdir=require(_0x42bd('0x2'));var jsonpatch=require(_0x42bd('0x3'));var rp=require(_0x42bd('0x4'));var moment=require(_0x42bd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x42bd('0x6'));var util=require(_0x42bd('0x7'));var path=require(_0x42bd('0x8'));var sox=require(_0x42bd('0x9'));var csv=require(_0x42bd('0xa'));var ejs=require(_0x42bd('0xb'));var fs=require('fs');var fs_extra=require(_0x42bd('0xc'));var _=require('lodash');var squel=require(_0x42bd('0xd'));var crypto=require(_0x42bd('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x42bd('0xf'));var toCsv=require('to-csv');var querystring=require(_0x42bd('0x10'));var Papa=require('papaparse');var Redis=require(_0x42bd('0x11'));var authService=require(_0x42bd('0x12'));var qs=require(_0x42bd('0x13'));var as=require(_0x42bd('0x14'));var hardwareService=require(_0x42bd('0x15'));var logger=require('../../config/logger')(_0x42bd('0x16'));var utils=require(_0x42bd('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x42bd('0x18'));var db=require(_0x42bd('0x19'))['db'];config['redis']=_[_0x42bd('0x1a')](config[_0x42bd('0x1b')],{'host':_0x42bd('0x1c'),'port':0x18eb});var socket=require(_0x42bd('0x1d'))(new Redis(config[_0x42bd('0x1b')]));require('./openchannelMessage.socket')[_0x42bd('0x1e')](socket);var jayson=require(_0x42bd('0x1f'));var client=jayson[_0x42bd('0x20')][_0x42bd('0x21')]({'port':0x232c});var client9002=jayson[_0x42bd('0x20')][_0x42bd('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x477aa6,_0x3e8501,_0x4c64a4,_0x44a155){return new BPromise(function(_0x5c8a8a,_0x10e6ba){var _0x9321d4=_0x44a155||client;return _0x9321d4[_0x42bd('0x22')](_0x477aa6,_0x4c64a4)[_0x42bd('0x23')](function(_0x28b13f){logger[_0x42bd('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x3e8501,_0x42bd('0x25'));logger[_0x42bd('0x26')](_0x42bd('0x27'),_0x3e8501,_0x42bd('0x25'),JSON[_0x42bd('0x28')](_0x28b13f));if(_0x28b13f[_0x42bd('0x29')]){if(_0x28b13f[_0x42bd('0x29')][_0x42bd('0x2a')]===0x1f4){logger[_0x42bd('0x29')](_0x42bd('0x2b'),_0x3e8501,_0x28b13f['error'][_0x42bd('0x2c')]);return _0x10e6ba(_0x28b13f[_0x42bd('0x29')][_0x42bd('0x2c')]);}logger[_0x42bd('0x29')]('OpenchannelMessage,\x20%s,\x20%s',_0x3e8501,_0x28b13f[_0x42bd('0x29')]['message']);return _0x5c8a8a(_0x28b13f['error'][_0x42bd('0x2c')]);}else{logger[_0x42bd('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x3e8501,_0x42bd('0x25'));_0x5c8a8a(_0x28b13f[_0x42bd('0x2d')][_0x42bd('0x2c')]);}})[_0x42bd('0x2e')](function(_0x40b0c0){logger[_0x42bd('0x29')](_0x42bd('0x2b'),_0x3e8501,_0x40b0c0);_0x10e6ba(_0x40b0c0);});});}function respondWithStatusCode(_0xb174ec,_0x2be60d){_0x2be60d=_0x2be60d||0xcc;return function(_0x59f1b0){if(_0x59f1b0){return _0xb174ec[_0x42bd('0x2f')](_0x2be60d);}return _0xb174ec['status'](_0x2be60d)[_0x42bd('0x30')]();};}function respondWithResult(_0x3111d1,_0x4de071){_0x4de071=_0x4de071||0xc8;return function(_0x3b3520){if(_0x3b3520){return _0x3111d1[_0x42bd('0x31')](_0x4de071)['json'](_0x3b3520);}};}function respondWithFilteredResult(_0x58d57b,_0x49984e){return function(_0x2d281f){if(_0x2d281f){var _0xa9e4ce=typeof _0x49984e['offset']===_0x42bd('0x32')&&typeof _0x49984e[_0x42bd('0x33')]==='undefined';var _0x38a0a1=_0x2d281f['count'];var _0x328025=_0xa9e4ce?0x0:_0x49984e[_0x42bd('0x34')];var _0x149f18=_0xa9e4ce?_0x2d281f['count']:_0x49984e[_0x42bd('0x34')]+_0x49984e['limit'];var _0x159b4a;if(_0x149f18>=_0x38a0a1){_0x149f18=_0x38a0a1;_0x159b4a=0xc8;}else{_0x159b4a=0xce;}_0x58d57b[_0x42bd('0x31')](_0x159b4a);return _0x58d57b[_0x42bd('0x35')](_0x42bd('0x36'),_0x328025+'-'+_0x149f18+'/'+_0x38a0a1)[_0x42bd('0x37')](_0x2d281f);}return null;};}function patchUpdates(_0xc4fdb0){return function(_0x20488b){try{jsonpatch['apply'](_0x20488b,_0xc4fdb0,!![]);}catch(_0x3ca4cd){return BPromise[_0x42bd('0x38')](_0x3ca4cd);}return _0x20488b[_0x42bd('0x39')]();};}function saveUpdates(_0x15f360,_0x49b1f0){return function(_0x536bcc){if(_0x536bcc){return _0x536bcc[_0x42bd('0x3a')](_0x15f360)[_0x42bd('0x23')](function(_0x34b836){return _0x34b836;});}return null;};}function removeEntity(_0x242e97,_0x50fdd8){return function(_0x5c9dc0){if(_0x5c9dc0){return _0x5c9dc0[_0x42bd('0x3b')]()[_0x42bd('0x23')](function(){_0x242e97['status'](0xcc)[_0x42bd('0x30')]();});}};}function handleEntityNotFound(_0x462275,_0x10b1d2){return function(_0x4cbbe2){if(!_0x4cbbe2){_0x462275[_0x42bd('0x2f')](0x194);}return _0x4cbbe2;};}function handleError(_0x5243b1,_0x35aa48){_0x35aa48=_0x35aa48||0x1f4;return function(_0x56d0e1){logger[_0x42bd('0x29')](_0x56d0e1[_0x42bd('0x3c')]);if(_0x56d0e1[_0x42bd('0x3d')]){delete _0x56d0e1['name'];}_0x5243b1[_0x42bd('0x31')](_0x35aa48)['send'](_0x56d0e1);};}exports[_0x42bd('0x3e')]=function(_0x38f622,_0x46a163){var _0x29465f={},_0x1d9d50={},_0x27033b={'count':0x0,'rows':[]};var _0x1c5a9f=_[_0x42bd('0x3f')](db['OpenchannelMessage'][_0x42bd('0x40')],function(_0x593ab5){return{'name':_0x593ab5['fieldName'],'type':_0x593ab5[_0x42bd('0x41')][_0x42bd('0x42')]};});_0x1d9d50[_0x42bd('0x43')]=_['map'](_0x1c5a9f,_0x42bd('0x3d'));_0x1d9d50['query']=_['keys'](_0x38f622[_0x42bd('0x44')]);_0x1d9d50[_0x42bd('0x45')]=_[_0x42bd('0x46')](_0x1d9d50[_0x42bd('0x43')],_0x1d9d50[_0x42bd('0x44')]);_0x29465f[_0x42bd('0x47')]=_[_0x42bd('0x46')](_0x1d9d50[_0x42bd('0x43')],qs[_0x42bd('0x48')](_0x38f622[_0x42bd('0x44')][_0x42bd('0x48')]));_0x29465f[_0x42bd('0x47')]=_0x29465f[_0x42bd('0x47')]['length']?_0x29465f['attributes']:_0x1d9d50[_0x42bd('0x43')];if(!_0x38f622[_0x42bd('0x44')][_0x42bd('0x49')](_0x42bd('0x4a'))){_0x29465f[_0x42bd('0x33')]=qs['limit'](_0x38f622['query']['limit']);_0x29465f[_0x42bd('0x34')]=qs[_0x42bd('0x34')](_0x38f622[_0x42bd('0x44')][_0x42bd('0x34')]);}_0x29465f['order']=qs['sort'](_0x38f622['query']['sort']);_0x29465f['where']=qs['filters'](_[_0x42bd('0x4b')](_0x38f622[_0x42bd('0x44')],_0x1d9d50['filters']),_0x1c5a9f);if(_0x38f622[_0x42bd('0x44')][_0x42bd('0x4c')]){_0x29465f[_0x42bd('0x4d')]=_[_0x42bd('0x4e')](_0x29465f[_0x42bd('0x4d')],{'$or':_[_0x42bd('0x3f')](_0x1c5a9f,function(_0x1f0e0e){if(_0x1f0e0e[_0x42bd('0x41')]!=='VIRTUAL'){var _0x261d08={};_0x261d08[_0x1f0e0e[_0x42bd('0x3d')]]={'$like':'%'+_0x38f622['query'][_0x42bd('0x4c')]+'%'};return _0x261d08;}})});}_0x29465f=_['merge']({},_0x29465f,_0x38f622[_0x42bd('0x4f')]);var _0x1aca88={'where':_0x29465f[_0x42bd('0x4d')]};return db[_0x42bd('0x50')]['count'](_0x1aca88)[_0x42bd('0x23')](function(_0x5b2072){_0x27033b[_0x42bd('0x51')]=_0x5b2072;if(_0x38f622[_0x42bd('0x44')][_0x42bd('0x52')]){_0x29465f[_0x42bd('0x53')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x42bd('0x54')](_0x29465f);})['then'](function(_0x3774db){_0x27033b[_0x42bd('0x55')]=_0x3774db;return _0x27033b;})[_0x42bd('0x23')](respondWithFilteredResult(_0x46a163,_0x29465f))[_0x42bd('0x2e')](handleError(_0x46a163,null));};exports['show']=function(_0x170b3a,_0x496adb){var _0x5e8b35={'raw':!![],'where':{'id':_0x170b3a[_0x42bd('0x56')]['id']}},_0x5872da={};_0x5872da[_0x42bd('0x43')]=_[_0x42bd('0x57')](db[_0x42bd('0x50')][_0x42bd('0x40')]);_0x5872da['query']=_[_0x42bd('0x57')](_0x170b3a['query']);_0x5872da[_0x42bd('0x45')]=_[_0x42bd('0x46')](_0x5872da['model'],_0x5872da[_0x42bd('0x44')]);_0x5e8b35['attributes']=_['intersection'](_0x5872da['model'],qs[_0x42bd('0x48')](_0x170b3a[_0x42bd('0x44')][_0x42bd('0x48')]));_0x5e8b35[_0x42bd('0x47')]=_0x5e8b35[_0x42bd('0x47')][_0x42bd('0x58')]?_0x5e8b35['attributes']:_0x5872da[_0x42bd('0x43')];if(_0x170b3a[_0x42bd('0x44')][_0x42bd('0x52')]){_0x5e8b35[_0x42bd('0x53')]=[{'all':!![]}];}_0x5e8b35=_['merge']({},_0x5e8b35,_0x170b3a['options']);return db[_0x42bd('0x50')]['find'](_0x5e8b35)[_0x42bd('0x23')](handleEntityNotFound(_0x496adb,null))[_0x42bd('0x23')](respondWithResult(_0x496adb,null))[_0x42bd('0x2e')](handleError(_0x496adb,null));};exports[_0x42bd('0x59')]=function(_0x536f9f,_0xf6de42){return db[_0x42bd('0x50')][_0x42bd('0x59')](_0x536f9f['body'],{})[_0x42bd('0x23')](respondWithResult(_0xf6de42,0xc9))[_0x42bd('0x2e')](handleError(_0xf6de42,null));};exports[_0x42bd('0x3a')]=function(_0x102b3e,_0x36830c){if(_0x102b3e[_0x42bd('0x5a')]['id']){delete _0x102b3e[_0x42bd('0x5a')]['id'];}return db[_0x42bd('0x50')][_0x42bd('0x5b')]({'where':{'id':_0x102b3e['params']['id']}})[_0x42bd('0x23')](handleEntityNotFound(_0x36830c,null))[_0x42bd('0x23')](saveUpdates(_0x102b3e[_0x42bd('0x5a')],null))[_0x42bd('0x23')](respondWithResult(_0x36830c,null))[_0x42bd('0x2e')](handleError(_0x36830c,null));};exports[_0x42bd('0x3b')]=function(_0x104b88,_0x26154c){return db[_0x42bd('0x50')][_0x42bd('0x5b')]({'where':{'id':_0x104b88[_0x42bd('0x56')]['id']}})[_0x42bd('0x23')](handleEntityNotFound(_0x26154c,null))['then'](removeEntity(_0x26154c,null))[_0x42bd('0x2e')](handleError(_0x26154c,null));};exports[_0x42bd('0x5c')]=function(_0x98e54e,_0x3d1726){return db[_0x42bd('0x50')][_0x42bd('0x5c')]()[_0x42bd('0x23')](respondWithResult(_0x3d1726,null))[_0x42bd('0x2e')](handleError(_0x3d1726,null));};var interaction_log=require(_0x42bd('0x5d'))(_0x42bd('0x5e'));exports[_0x42bd('0x5f')]=function(_0xa95b41,_0x577479,_0x8d4e13){var _0x459d06={'agent':{},'channel':_0x42bd('0x60')};if(_0xa95b41[_0x42bd('0x5a')]['id']){delete _0xa95b41[_0x42bd('0x5a')]['id'];}_0xa95b41[_0x42bd('0x5a')][_0x42bd('0x61')]=!![];_0xa95b41['body']['readAt']=moment()[_0x42bd('0x62')](_0x42bd('0x63'));_0xa95b41[_0x42bd('0x5a')][_0x42bd('0x64')]=_0xa95b41[_0x42bd('0x5a')]['UserId']||_0xa95b41[_0x42bd('0x65')]['id'];_0x459d06[_0x42bd('0x66')]['id']=_0xa95b41[_0x42bd('0x5a')][_0x42bd('0x64')];return db['OpenchannelMessage'][_0x42bd('0x5b')]({'where':{'id':_0xa95b41['params']['id'],'UserId':null}})[_0x42bd('0x23')](handleEntityNotFound(_0x577479,null))['then'](saveUpdates(_0xa95b41[_0x42bd('0x5a')],null))[_0x42bd('0x23')](function(_0x87508f){if(_0x87508f){_0x459d06['message']=_0x87508f['get']({'plain':!![]});return db[_0x42bd('0x67')][_0x42bd('0x5b')]({'where':{'id':_0x87508f[_0x42bd('0x68')]}});}return null;})[_0x42bd('0x23')](handleEntityNotFound(_0x577479,null))[_0x42bd('0x23')](function(_0x5c0cfe){if(_0x5c0cfe){return _0x5c0cfe[_0x42bd('0x3a')]({'UserId':_0xa95b41[_0x42bd('0x5a')][_0x42bd('0x64')],'read1stAt':_['isNil'](_0x5c0cfe['read1stAt'])?moment()[_0x42bd('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x42bd('0x23')](function(_0x3b6104){if(_0x3b6104){_0x459d06[_0x42bd('0x69')]=_0x3b6104[_0x42bd('0x6a')]({'plain':!![]});interaction_log[_0x42bd('0x24')](_0x42bd('0x6b'),_0xa95b41[_0x42bd('0x65')]['id'],_0xa95b41[_0x42bd('0x65')]['name'],_0xa95b41[_0x42bd('0x65')]['role'],_0x459d06[_0x42bd('0x69')]['id'],_0xa95b41[_0x42bd('0x5a')]?JSON[_0x42bd('0x28')](_0xa95b41['body']):'null');return respondWithRpcPromise(_0x42bd('0x6c'),_0x42bd('0x6d'),_0x459d06);}return null;})[_0x42bd('0x23')](function(_0xc8c3a1){var _0x33a16b=_0x42bd('0x6e')+_0xc8c3a1[_0x42bd('0x2c')][_0x42bd('0x6f')];return db[_0x42bd('0x70')][_0x42bd('0x44')](_0x33a16b,{'type':db[_0x42bd('0x71')][_0x42bd('0x72')][_0x42bd('0x73')],'raw':!![]})[_0x42bd('0x23')](function(_0x2d7f18){return _0x2d7f18;});})[_0x42bd('0x23')](function(_0x43ba38){if(_0x43ba38){_0x459d06['message']['contact']=_0x43ba38[0x0];if(!_0xa95b41[_0x42bd('0x5a')][_0x42bd('0x64')])return;return db[_0x42bd('0x74')][_0x42bd('0x5b')]({'where':{'id':_0xa95b41[_0x42bd('0x5a')][_0x42bd('0x64')],'role':_0x42bd('0x66')},'attributes':['id',_0x42bd('0x3d'),_0x42bd('0x75'),'email',_0x42bd('0x76')],'raw':!![]});}return null;})[_0x42bd('0x23')](function(_0x45391d){if(!_0x45391d)return null;_0x459d06['message'][_0x42bd('0x66')]=_0x45391d;return _0x459d06;})['then'](function(_0x33206d){if(_0x33206d){if(_0xa95b41[_0x42bd('0x5a')]['manual']){_0x459d06[_0x42bd('0x2c')][_0x42bd('0x77')]=util[_0x42bd('0x62')](_0x42bd('0x78'),_0xa95b41['user']['name']);_0x459d06['message'][_0x42bd('0x79')]=_0x459d06[_0x42bd('0x79')];_0x459d06[_0x42bd('0x2c')][_0x42bd('0x7a')]=_0x459d06[_0x42bd('0x79')];_0x459d06[_0x42bd('0x2c')][_0x42bd('0x7b')]='accept';return respondWithRpcPromise(_0x42bd('0x7c'),_0x42bd('0x7c'),{'event':_0x42bd('0x7d'),'message':_0x459d06[_0x42bd('0x2c')]},client9002)[_0x42bd('0x23')](function(){return _0x459d06;});}return _0x459d06;}return null;})['then'](respondWithResult(_0x577479,null))[_0x42bd('0x2e')](handleError(_0x577479,null));};var interaction_log=require(_0x42bd('0x5d'))(_0x42bd('0x5e'));exports[_0x42bd('0x38')]=function(_0x18481d,_0x1540e0,_0x54adf5){var _0x52c3ea={'agent':{},'channel':_0x42bd('0x60')};if(_0x18481d[_0x42bd('0x5a')]['id']){delete _0x18481d[_0x42bd('0x5a')]['id'];}_0x18481d['body']['UserId']=_0x18481d[_0x42bd('0x5a')][_0x42bd('0x64')]||_0x18481d[_0x42bd('0x65')]['id'];_0x52c3ea['agent']['id']=_0x18481d[_0x42bd('0x5a')]['UserId'];return db[_0x42bd('0x50')][_0x42bd('0x5b')]({'where':{'id':_0x18481d[_0x42bd('0x56')]['id'],'UserId':null}})[_0x42bd('0x23')](handleEntityNotFound(_0x1540e0,null))['then'](function(_0xad9477){if(_0xad9477){_0x52c3ea[_0x42bd('0x2c')]=_0xad9477['get']({'plain':!![]});return db[_0x42bd('0x67')][_0x42bd('0x5b')]({'where':{'id':_0xad9477[_0x42bd('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x1540e0,null))['then'](function(_0x712fa9){if(_0x712fa9){_0x52c3ea[_0x42bd('0x69')]=_0x712fa9['get']({'plain':!![]});interaction_log[_0x42bd('0x24')](_0x42bd('0x7e'),_0x18481d[_0x42bd('0x65')]['id'],_0x18481d[_0x42bd('0x65')]['name'],_0x18481d[_0x42bd('0x65')][_0x42bd('0x7f')],_0x52c3ea[_0x42bd('0x69')]['id'],_0x18481d['body']?JSON[_0x42bd('0x28')](_0x18481d[_0x42bd('0x5a')]):_0x42bd('0x80'));return respondWithRpcPromise('RejectMessage',_0x42bd('0x81'),_0x52c3ea);}return null;})['then'](function(_0x30ddae){var _0x31f653=_0x42bd('0x6e')+_0x30ddae[_0x42bd('0x2c')][_0x42bd('0x6f')];return db[_0x42bd('0x70')][_0x42bd('0x44')](_0x31f653,{'type':db['Sequelize']['QueryTypes'][_0x42bd('0x73')],'raw':!![]})[_0x42bd('0x23')](function(_0xfa1c68){return _0xfa1c68;});})[_0x42bd('0x23')](function(_0x21c55c){if(_0x21c55c){_0x52c3ea[_0x42bd('0x2c')][_0x42bd('0x82')]=_0x21c55c[0x0];if(!_0x18481d[_0x42bd('0x5a')][_0x42bd('0x64')])return;return db[_0x42bd('0x74')][_0x42bd('0x5b')]({'where':{'id':_0x18481d[_0x42bd('0x5a')][_0x42bd('0x64')],'role':_0x42bd('0x66')},'attributes':['id',_0x42bd('0x3d'),_0x42bd('0x75'),'email',_0x42bd('0x76')],'raw':!![]});}return null;})[_0x42bd('0x23')](function(_0x4f501c){if(!_0x4f501c)return null;_0x52c3ea['message'][_0x42bd('0x66')]=_0x4f501c;return _0x52c3ea;})[_0x42bd('0x23')](function(_0x5d7d97){if(_0x5d7d97){_0x5d7d97['message']['interface']=util[_0x42bd('0x62')](_0x42bd('0x78'),_0x18481d[_0x42bd('0x65')][_0x42bd('0x3d')]);_0x5d7d97['message'][_0x42bd('0x79')]=_0x52c3ea[_0x42bd('0x79')];_0x5d7d97[_0x42bd('0x2c')][_0x42bd('0x7a')]=_0x52c3ea['channel'];_0x5d7d97[_0x42bd('0x2c')][_0x42bd('0x7b')]=_0x42bd('0x38');respondWithRpcPromise(_0x42bd('0x7c'),_0x42bd('0x7c'),{'event':_0x42bd('0x83'),'message':_0x5d7d97[_0x42bd('0x2c')]},client9002);return _0x52c3ea;}return null;})['then'](respondWithResult(_0x1540e0,null))[_0x42bd('0x2e')](handleError(_0x1540e0,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 68884fe..1ebebf8 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 _0xd2be=['emit','hasOwnProperty','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update'];(function(_0x431889,_0x5a2e00){var _0x58d41f=function(_0x2cbd4c){while(--_0x2cbd4c){_0x431889['push'](_0x431889['shift']());}};_0x58d41f(++_0x5a2e00);}(_0xd2be,0x1e0));var _0xed2b=function(_0x36f58b,_0x2e27b3){_0x36f58b=_0x36f58b-0x0;var _0x10ebaa=_0xd2be[_0x36f58b];return _0x10ebaa;};'use strict';var EventEmitter=require(_0xed2b('0x0'));var OpenchannelMessage=require(_0xed2b('0x1'))['db'][_0xed2b('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xed2b('0x3')](0x0);var events={'afterCreate':_0xed2b('0x4'),'afterUpdate':_0xed2b('0x5'),'afterDestroy':'remove'};function emitEvent(_0x33abac){return function(_0x5e4ff2,_0x2567ff,_0x12be30){OpenchannelMessageEvents[_0xed2b('0x6')](_0x33abac+':'+_0x5e4ff2['id'],_0x5e4ff2);OpenchannelMessageEvents[_0xed2b('0x6')](_0x33abac,_0x5e4ff2);_0x12be30(null);};}for(var e in events){if(events[_0xed2b('0x7')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0xed2b('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xffb1=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save'];(function(_0x2a3389,_0x3ec333){var _0x2dea7e=function(_0x5237bc){while(--_0x5237bc){_0x2a3389['push'](_0x2a3389['shift']());}};_0x2dea7e(++_0x3ec333);}(_0xffb1,0x8a));var _0x1ffb=function(_0x7abd7,_0x1ca3f9){_0x7abd7=_0x7abd7-0x0;var _0x3a2577=_0xffb1[_0x7abd7];return _0x3a2577;};'use strict';var EventEmitter=require(_0x1ffb('0x0'));var OpenchannelMessage=require(_0x1ffb('0x1'))['db'][_0x1ffb('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x1ffb('0x3')](0x0);var events={'afterCreate':_0x1ffb('0x4'),'afterUpdate':_0x1ffb('0x5'),'afterDestroy':_0x1ffb('0x6')};function emitEvent(_0x123e57){return function(_0x1531f5,_0x1481d1,_0x2f5f35){OpenchannelMessageEvents[_0x1ffb('0x7')](_0x123e57+':'+_0x1531f5['id'],_0x1531f5);OpenchannelMessageEvents[_0x1ffb('0x7')](_0x123e57,_0x1531f5);_0x2f5f35(null);};}for(var e in events){if(events[_0x1ffb('0x8')](e)){var event=events[e];OpenchannelMessage[_0x1ffb('0x9')](e,emitEvent(event));}}module[_0x1ffb('0xa')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 7159206..ff3a2e4 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 _0x03d1=['direction','toLowerCase','out','UserId','OpenchannelInteraction','findOne','then','update','createdAt','catch','error','secret','CmContact','describe','find','OpenchannelAccountId','Interactions','OpenchannelInteractionId','keys','get','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','Contact','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models'];(function(_0x7b18e0,_0x5d4c5e){var _0x4fe95b=function(_0x37db8c){while(--_0x37db8c){_0x7b18e0['push'](_0x7b18e0['shift']());}};_0x4fe95b(++_0x5d4c5e);}(_0x03d1,0x135));var _0x103d=function(_0x197065,_0x2e79d0){_0x197065=_0x197065-0x0;var _0x3d9404=_0x03d1[_0x197065];return _0x3d9404;};'use strict';var _=require(_0x103d('0x0'));var util=require('util');var logger=require(_0x103d('0x1'))(_0x103d('0x2'));var moment=require(_0x103d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x103d('0x4'));var rimraf=require(_0x103d('0x5'));var config=require(_0x103d('0x6'));var attributes=require('./openchannelMessage.attributes');module[_0x103d('0x7')]=function(_0x5d21b8,_0x202294){return _0x5d21b8[_0x103d('0x8')](_0x103d('0x9'),attributes,{'tableName':_0x103d('0xa'),'paranoid':![],'indexes':[{'name':_0x103d('0xb'),'fields':[_0x103d('0xc')],'type':_0x103d('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x375399,_0x49e97d,_0x1a81ba){var _0x3b3daf=_0x5d21b8[_0x103d('0xe')];var _0x12571f=_0x375399['get']({'plain':!![]});if(_0x12571f[_0x103d('0xf')]['toLowerCase']()==='in'||_0x12571f['direction'][_0x103d('0x10')]()===_0x103d('0x11')&&!_0x12571f['secret']&&!_['isNil'](_0x12571f[_0x103d('0x12')])){_0x3b3daf[_0x103d('0x13')][_0x103d('0x14')]({'where':{'id':_0x12571f['OpenchannelInteractionId']}})[_0x103d('0x15')](function(_0x11e943){if(_0x11e943){_0x11e943[_0x103d('0x16')]({'lastMsgAt':_0x12571f[_0x103d('0x17')],'lastMsgDirection':_0x12571f['direction'][_0x103d('0x10')]()});}})[_0x103d('0x18')](function(_0x42050e){console[_0x103d('0x19')](_0x42050e);});}if(_0x12571f[_0x103d('0xf')]===_0x103d('0x11')&&!_0x12571f[_0x103d('0x1a')]){var _0x998f88;_0x3b3daf[_0x103d('0x1b')][_0x103d('0x1c')]()['then'](function(_0x132450){return _0x3b3daf['OpenchannelAccount'][_0x103d('0x1d')]({'where':{'id':_0x12571f[_0x103d('0x1e')]},'include':[{'model':_0x3b3daf[_0x103d('0x13')],'as':_0x103d('0x1f'),'where':{'id':_0x12571f[_0x103d('0x20')]},'limit':0x1,'include':[{'model':_0x3b3daf[_0x103d('0x1b')],'as':'Contact','attributes':_[_0x103d('0x21')](_0x132450)}]}]});})[_0x103d('0x15')](function(_0x2c3668){_0x998f88=_0x2c3668[_0x103d('0x22')]({'plain':!![]});if(_0x998f88&&_0x998f88[_0x103d('0x23')]){logger[_0x103d('0x24')](_0x103d('0x25'),_0x103d('0x26'),util[_0x103d('0x27')](_0x103d('0x28'),_0x12571f['id'],_0x998f88[_0x103d('0x23')]));if(_0x998f88[_0x103d('0x1f')]&&_0x998f88[_0x103d('0x1f')][_0x103d('0x29')]){_0x12571f[_0x103d('0x2a')]=_[_0x103d('0x2b')](_0x998f88[_0x103d('0x1f')][0x0],_0x103d('0x2c'));_0x12571f['Contact']=_0x998f88[_0x103d('0x1f')][0x0]['Contact'];}var _0x49e97d={'method':_0x103d('0x2d'),'uri':encodeURI(_0x998f88[_0x103d('0x23')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x49e97d[_0x103d('0x2e')]){case _0x103d('0x2f'):_0x49e97d['qs']=_0x12571f;break;case _0x103d('0x2d'):_0x49e97d[_0x103d('0xc')]=_0x12571f;break;}return rp(_0x49e97d)[_0x103d('0x15')](function(_0x59cca7){logger[_0x103d('0x24')](_0x103d('0x25'),_0x103d('0x26'),util[_0x103d('0x27')](_0x103d('0x30'),_0x12571f['id'],_0x998f88['replyUri']));if(_0x59cca7['body'][_0x103d('0x31')]&&_0x59cca7['body'][_0x103d('0x31')]!=_0x12571f['Interaction'][_0x103d('0x31')]){return _0x3b3daf[_0x103d('0x13')][_0x103d('0x16')]({'threadId':_0x59cca7[_0x103d('0xc')][_0x103d('0x31')]},{'where':{'id':_0x12571f[_0x103d('0x2a')]['id']}});}else{return;}})[_0x103d('0x15')](function(){return _0x375399[_0x103d('0x16')]({'read':!![]});})[_0x103d('0x18')](function(_0x169797){logger[_0x103d('0x19')](_0x103d('0x25'),_0x103d('0x26'),util[_0x103d('0x32')](_0x169797,{'showHidden':![],'depth':null}));_0x1a81ba();});}else{_0x1a81ba();}})[_0x103d('0x33')](function(){_0x1a81ba();});}else{_0x1a81ba();}}},'charset':_0x103d('0x34'),'collate':_0x103d('0x35')});}; \ No newline at end of file +var _0x46b0=['get','direction','toLowerCase','out','isNil','UserId','OpenchannelInteraction','findOne','then','createdAt','catch','error','secret','CmContact','describe','OpenchannelAccount','OpenchannelAccountId','Interactions','OpenchannelInteractionId','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','omit','POST','method','GET','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','update','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','FULLTEXT','models'];(function(_0x2f81e9,_0x1e9204){var _0x1a17e8=function(_0x2f15cc){while(--_0x2f15cc){_0x2f81e9['push'](_0x2f81e9['shift']());}};_0x1a17e8(++_0x1e9204);}(_0x46b0,0x98));var _0x046b=function(_0x240c8c,_0x85021){_0x240c8c=_0x240c8c-0x0;var _0x537220=_0x46b0[_0x240c8c];return _0x537220;};'use strict';var _=require(_0x046b('0x0'));var util=require('util');var logger=require(_0x046b('0x1'))(_0x046b('0x2'));var moment=require(_0x046b('0x3'));var BPromise=require(_0x046b('0x4'));var rp=require(_0x046b('0x5'));var fs=require('fs');var path=require(_0x046b('0x6'));var rimraf=require('rimraf');var config=require(_0x046b('0x7'));var attributes=require(_0x046b('0x8'));module[_0x046b('0x9')]=function(_0x437977,_0x34b412){return _0x437977[_0x046b('0xa')](_0x046b('0xb'),attributes,{'tableName':_0x046b('0xc'),'paranoid':![],'indexes':[{'name':_0x046b('0xd'),'fields':['body'],'type':_0x046b('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xbe3832,_0x1de56a,_0x4d1b19){var _0x4762be=_0x437977[_0x046b('0xf')];var _0x204953=_0xbe3832[_0x046b('0x10')]({'plain':!![]});if(_0x204953[_0x046b('0x11')][_0x046b('0x12')]()==='in'||_0x204953[_0x046b('0x11')][_0x046b('0x12')]()===_0x046b('0x13')&&!_0x204953['secret']&&!_[_0x046b('0x14')](_0x204953[_0x046b('0x15')])){_0x4762be[_0x046b('0x16')][_0x046b('0x17')]({'where':{'id':_0x204953['OpenchannelInteractionId']}})[_0x046b('0x18')](function(_0x2cc651){if(_0x2cc651){_0x2cc651['update']({'lastMsgAt':_0x204953[_0x046b('0x19')],'lastMsgDirection':_0x204953['direction'][_0x046b('0x12')]()});}})[_0x046b('0x1a')](function(_0x1ba57d){console[_0x046b('0x1b')](_0x1ba57d);});}if(_0x204953[_0x046b('0x11')]===_0x046b('0x13')&&!_0x204953[_0x046b('0x1c')]){var _0x559f8f;_0x4762be[_0x046b('0x1d')][_0x046b('0x1e')]()[_0x046b('0x18')](function(_0x2025ab){return _0x4762be[_0x046b('0x1f')]['find']({'where':{'id':_0x204953[_0x046b('0x20')]},'include':[{'model':_0x4762be[_0x046b('0x16')],'as':_0x046b('0x21'),'where':{'id':_0x204953[_0x046b('0x22')]},'limit':0x1,'include':[{'model':_0x4762be['CmContact'],'as':_0x046b('0x23'),'attributes':_[_0x046b('0x24')](_0x2025ab)}]}]});})[_0x046b('0x18')](function(_0x2891be){_0x559f8f=_0x2891be[_0x046b('0x10')]({'plain':!![]});if(_0x559f8f&&_0x559f8f[_0x046b('0x25')]){logger['info'](_0x046b('0x26'),_0x046b('0x27'),util[_0x046b('0x28')](_0x046b('0x29'),_0x204953['id'],_0x559f8f['replyUri']));if(_0x559f8f['Interactions']&&_0x559f8f[_0x046b('0x21')][_0x046b('0x2a')]){_0x204953['Interaction']=_[_0x046b('0x2b')](_0x559f8f[_0x046b('0x21')][0x0],_0x046b('0x23'));_0x204953[_0x046b('0x23')]=_0x559f8f[_0x046b('0x21')][0x0][_0x046b('0x23')];}var _0x1de56a={'method':_0x046b('0x2c'),'uri':encodeURI(_0x559f8f['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1de56a[_0x046b('0x2d')]){case _0x046b('0x2e'):_0x1de56a['qs']=_0x204953;break;case _0x046b('0x2c'):_0x1de56a['body']=_0x204953;break;}return rp(_0x1de56a)['then'](function(_0x89673){logger[_0x046b('0x2f')](_0x046b('0x26'),_0x046b('0x27'),util[_0x046b('0x28')](_0x046b('0x30'),_0x204953['id'],_0x559f8f[_0x046b('0x25')]));if(_0x89673['body'][_0x046b('0x31')]&&_0x89673['body'][_0x046b('0x31')]!=_0x204953[_0x046b('0x32')][_0x046b('0x31')]){return _0x4762be[_0x046b('0x16')][_0x046b('0x33')]({'threadId':_0x89673['body'][_0x046b('0x31')]},{'where':{'id':_0x204953[_0x046b('0x32')]['id']}});}else{return;}})[_0x046b('0x18')](function(){return _0xbe3832['update']({'read':!![]});})[_0x046b('0x1a')](function(_0x1b8fed){logger[_0x046b('0x1b')]('OpenchannelMessage,\x20%s,\x20%s',_0x046b('0x27'),util[_0x046b('0x34')](_0x1b8fed,{'showHidden':![],'depth':null}));_0x4d1b19();});}else{_0x4d1b19();}})[_0x046b('0x35')](function(){_0x4d1b19();});}else{_0x4d1b19();}}},'charset':_0x046b('0x36'),'collate':_0x046b('0x37')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 226e740..c563078 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 _0x5f2f=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelMessage','create','options','raw','CreateOpenchannelMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3b9c79,_0x2f19ad){var _0x511fbf=function(_0x53541e){while(--_0x53541e){_0x3b9c79['push'](_0x3b9c79['shift']());}};_0x511fbf(++_0x2f19ad);}(_0x5f2f,0x73));var _0xf5f2=function(_0x38a8af,_0x5729e2){_0x38a8af=_0x38a8af-0x0;var _0x25cc45=_0x5f2f[_0x38a8af];return _0x25cc45;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./openchannelMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateOpenchannelMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x275c03,_0x2b2502){var _0x5f35fc=function(_0x17f652){while(--_0x17f652){_0x275c03['push'](_0x275c03['shift']());}};_0x5f35fc(++_0x2b2502);}(_0x7a54,0x106));var _0x47a5=function(_0x19855d,_0xbfc9f4){_0x19855d=_0x19855d-0x0;var _0x17c9ee=_0x7a54[_0x19855d];return _0x17c9ee;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 914f0b3..44467f6 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 _0x8a68=['register','length','openchannelMessage:','./openchannelMessage.events','save','update'];(function(_0x190e4a,_0x58a451){var _0x3167ad=function(_0x2948f4){while(--_0x2948f4){_0x190e4a['push'](_0x190e4a['shift']());}};_0x3167ad(++_0x58a451);}(_0x8a68,0x183));var _0x88a6=function(_0x387819,_0xe647f5){_0x387819=_0x387819-0x0;var _0x11241f=_0x8a68[_0x387819];return _0x11241f;};'use strict';var OpenchannelMessageEvents=require(_0x88a6('0x0'));var events=[_0x88a6('0x1'),'remove',_0x88a6('0x2')];function createListener(_0x516e3f,_0x25fddb){return function(_0x3a073d){_0x25fddb['emit'](_0x516e3f,_0x3a073d);};}function removeListener(_0xb6c77,_0x58beb3){return function(){OpenchannelMessageEvents['removeListener'](_0xb6c77,_0x58beb3);};}exports[_0x88a6('0x3')]=function(_0x4df36a){for(var _0x5d83eb=0x0,_0x159799=events[_0x88a6('0x4')];_0x5d83eb<_0x159799;_0x5d83eb++){var _0x25c814=events[_0x5d83eb];var _0x55150a=createListener(_0x88a6('0x5')+_0x25c814,_0x4df36a);OpenchannelMessageEvents['on'](_0x25c814,_0x55150a);}}; \ No newline at end of file +var _0x722c=['update','emit','length','openchannelMessage:','./openchannelMessage.events'];(function(_0x264b9b,_0xa1181e){var _0x4c7a0e=function(_0x4b77a0){while(--_0x4b77a0){_0x264b9b['push'](_0x264b9b['shift']());}};_0x4c7a0e(++_0xa1181e);}(_0x722c,0x1e4));var _0xc722=function(_0x4ccfde,_0x29fb2b){_0x4ccfde=_0x4ccfde-0x0;var _0x4fb493=_0x722c[_0x4ccfde];return _0x4fb493;};'use strict';var OpenchannelMessageEvents=require(_0xc722('0x0'));var events=['save','remove',_0xc722('0x1')];function createListener(_0x11687d,_0xe784fe){return function(_0x465911){_0xe784fe[_0xc722('0x2')](_0x11687d,_0x465911);};}function removeListener(_0x5ae56b,_0x4e4541){return function(){OpenchannelMessageEvents['removeListener'](_0x5ae56b,_0x4e4541);};}exports['register']=function(_0x476bee){for(var _0x3950a5=0x0,_0x2976e5=events[_0xc722('0x3')];_0x3950a5<_0x2976e5;_0x3950a5++){var _0x3c4dcd=events[_0x3950a5];var _0x5bc5f5=createListener(_0xc722('0x4')+_0x3c4dcd,_0x476bee);OpenchannelMessageEvents['on'](_0x3c4dcd,_0x5bc5f5);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 0d82abc..d81517e 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 _0xa812=['addAgents','update','delete','destroy','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams'];(function(_0x58209d,_0xe598e7){var _0x203fa8=function(_0x59842b){while(--_0x59842b){_0x58209d['push'](_0x58209d['shift']());}};_0x203fa8(++_0xe598e7);}(_0xa812,0x10b));var _0x2a81=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xa812[_0x2d2c16];return _0x53f2fb;};'use strict';var multer=require(_0x2a81('0x0'));var util=require(_0x2a81('0x1'));var path=require(_0x2a81('0x2'));var timeout=require(_0x2a81('0x3'));var express=require(_0x2a81('0x4'));var router=express[_0x2a81('0x5')]();var fs_extra=require(_0x2a81('0x6'));var auth=require(_0x2a81('0x7'));var interaction=require(_0x2a81('0x8'));var config=require(_0x2a81('0x9'));var controller=require('./openchannelQueue.controller');router[_0x2a81('0xa')]('/',auth['isAuthenticated'](),controller[_0x2a81('0xb')]);router['get'](_0x2a81('0xc'),auth[_0x2a81('0xd')](),controller[_0x2a81('0xe')]);router[_0x2a81('0xa')](_0x2a81('0xf'),auth[_0x2a81('0xd')](),controller['show']);router[_0x2a81('0xa')]('/:id/members',auth[_0x2a81('0xd')](),controller['getMembers']);router['get'](_0x2a81('0x10'),auth[_0x2a81('0xd')](),controller[_0x2a81('0x11')]);router[_0x2a81('0xa')](_0x2a81('0x12'),auth[_0x2a81('0xd')](),controller[_0x2a81('0x13')]);router[_0x2a81('0x14')]('/',auth[_0x2a81('0xd')](),controller[_0x2a81('0x15')]);router[_0x2a81('0x14')](_0x2a81('0x10'),auth[_0x2a81('0xd')](),controller[_0x2a81('0x16')]);router['post'](_0x2a81('0x12'),auth[_0x2a81('0xd')](),controller[_0x2a81('0x17')]);router['put'](_0x2a81('0xf'),auth[_0x2a81('0xd')](),controller[_0x2a81('0x18')]);router[_0x2a81('0x19')](_0x2a81('0xf'),auth['isAuthenticated'](),controller[_0x2a81('0x1a')]);router['delete'](_0x2a81('0x10'),auth[_0x2a81('0xd')](),controller[_0x2a81('0x1b')]);router['delete'](_0x2a81('0x12'),auth[_0x2a81('0xd')](),controller[_0x2a81('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xf2b7=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addAgents','put','update','delete','removeTeams','removeAgents','exports'];(function(_0x26b5aa,_0x2bbac5){var _0x3171f6=function(_0x5d1571){while(--_0x5d1571){_0x26b5aa['push'](_0x26b5aa['shift']());}};_0x3171f6(++_0x2bbac5);}(_0xf2b7,0x105));var _0x7f2b=function(_0x2af578,_0xb86cb6){_0x2af578=_0x2af578-0x0;var _0x3c2492=_0xf2b7[_0x2af578];return _0x3c2492;};'use strict';var multer=require('multer');var util=require(_0x7f2b('0x0'));var path=require(_0x7f2b('0x1'));var timeout=require(_0x7f2b('0x2'));var express=require('express');var router=express[_0x7f2b('0x3')]();var fs_extra=require(_0x7f2b('0x4'));var auth=require(_0x7f2b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7f2b('0x6'));var controller=require(_0x7f2b('0x7'));router[_0x7f2b('0x8')]('/',auth[_0x7f2b('0x9')](),controller[_0x7f2b('0xa')]);router[_0x7f2b('0x8')](_0x7f2b('0xb'),auth['isAuthenticated'](),controller[_0x7f2b('0xc')]);router[_0x7f2b('0x8')](_0x7f2b('0xd'),auth[_0x7f2b('0x9')](),controller[_0x7f2b('0xe')]);router[_0x7f2b('0x8')](_0x7f2b('0xf'),auth[_0x7f2b('0x9')](),controller[_0x7f2b('0x10')]);router[_0x7f2b('0x8')](_0x7f2b('0x11'),auth['isAuthenticated'](),controller['getTeams']);router['get'](_0x7f2b('0x12'),auth[_0x7f2b('0x9')](),controller[_0x7f2b('0x13')]);router[_0x7f2b('0x14')]('/',auth[_0x7f2b('0x9')](),controller[_0x7f2b('0x15')]);router[_0x7f2b('0x14')](_0x7f2b('0x11'),auth[_0x7f2b('0x9')](),controller['addTeams']);router[_0x7f2b('0x14')]('/:id/users',auth[_0x7f2b('0x9')](),controller[_0x7f2b('0x16')]);router[_0x7f2b('0x17')]('/:id',auth[_0x7f2b('0x9')](),controller[_0x7f2b('0x18')]);router[_0x7f2b('0x19')](_0x7f2b('0xd'),auth[_0x7f2b('0x9')](),controller['destroy']);router[_0x7f2b('0x19')](_0x7f2b('0x11'),auth[_0x7f2b('0x9')](),controller[_0x7f2b('0x1a')]);router[_0x7f2b('0x19')](_0x7f2b('0x12'),auth['isAuthenticated'](),controller[_0x7f2b('0x1b')]);module[_0x7f2b('0x1c')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 1d825a7..800b9d6 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 _0xaccc=['name','INTEGER','rrmemory','beepall','sequelize','exports','STRING'];(function(_0x242220,_0x1c7863){var _0x3a5228=function(_0x443b57){while(--_0x443b57){_0x242220['push'](_0x242220['shift']());}};_0x3a5228(++_0x1c7863);}(_0xaccc,0x15b));var _0xcacc=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xaccc[_0x5f0089];return _0x193892;};'use strict';var Sequelize=require(_0xcacc('0x0'));module[_0xcacc('0x1')]={'name':{'type':Sequelize[_0xcacc('0x2')],'unique':_0xcacc('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xcacc('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xcacc('0x5'),_0xcacc('0x6'),'roundrobin')}}; \ No newline at end of file +var _0x2023=['STRING','name','rrmemory','beepall','roundrobin','sequelize'];(function(_0xa9a245,_0x2a0387){var _0x2d0eaa=function(_0x2bba86){while(--_0x2bba86){_0xa9a245['push'](_0xa9a245['shift']());}};_0x2d0eaa(++_0x2a0387);}(_0x2023,0x7d));var _0x3202=function(_0x4bda8b,_0x126559){_0x4bda8b=_0x4bda8b-0x0;var _0x4528a2=_0x2023[_0x4bda8b];return _0x4528a2;};'use strict';var Sequelize=require(_0x3202('0x0'));module['exports']={'name':{'type':Sequelize[_0x3202('0x1')],'unique':_0x3202('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3202('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x3202('0x3'),_0x3202('0x4'),_0x3202('0x5'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 11b8159..7a18235 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 _0x1b2c=['addAgents','omit','removeAgents','isArray','userOpenchannelQueue:remove','getAgents','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','destroy','then','get','OpenchannelQueues','UserProfileResource','error','name','index','OpenchannelQueue','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','nolimit','order','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','params','keys','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserOpenchannelQueue','sort','map','User','findAndCountAll','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','length','ids','Agents','online','voicePause','interface','flatMap','sequelize','addTeams','each','forEach','emit','userOpenchannelQueue:save','select','field','tq.TeamId','from','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','TeamId','all','union','compact','value','isEmpty'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x1b2c,0x94));var _0xc1b2=function(_0x1a0a39,_0x59b891){_0x1a0a39=_0x1a0a39-0x0;var _0x51b386=_0x1b2c[_0x1a0a39];return _0x51b386;};'use strict';var emlformat=require(_0xc1b2('0x0'));var rimraf=require(_0xc1b2('0x1'));var zipdir=require(_0xc1b2('0x2'));var jsonpatch=require(_0xc1b2('0x3'));var rp=require('request-promise');var moment=require(_0xc1b2('0x4'));var BPromise=require(_0xc1b2('0x5'));var Mustache=require(_0xc1b2('0x6'));var util=require(_0xc1b2('0x7'));var path=require(_0xc1b2('0x8'));var sox=require(_0xc1b2('0x9'));var csv=require(_0xc1b2('0xa'));var ejs=require(_0xc1b2('0xb'));var fs=require('fs');var fs_extra=require(_0xc1b2('0xc'));var _=require(_0xc1b2('0xd'));var squel=require(_0xc1b2('0xe'));var crypto=require('crypto');var jsforce=require(_0xc1b2('0xf'));var deskjs=require(_0xc1b2('0x10'));var toCsv=require(_0xc1b2('0xa'));var querystring=require(_0xc1b2('0x11'));var Papa=require(_0xc1b2('0x12'));var Redis=require('ioredis');var authService=require(_0xc1b2('0x13'));var qs=require(_0xc1b2('0x14'));var as=require(_0xc1b2('0x15'));var hardwareService=require(_0xc1b2('0x16'));var logger=require(_0xc1b2('0x17'))(_0xc1b2('0x18'));var utils=require(_0xc1b2('0x19'));var config=require(_0xc1b2('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xc1b2('0x1b'))['db'];config['redis']=_[_0xc1b2('0x1c')](config[_0xc1b2('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0xc1b2('0x1e'))(new Redis(config[_0xc1b2('0x1d')]));require(_0xc1b2('0x1f'))[_0xc1b2('0x20')](socket);function respondWithStatusCode(_0x340aca,_0x338a82){_0x338a82=_0x338a82||0xcc;return function(_0x4bd032){if(_0x4bd032){return _0x340aca[_0xc1b2('0x21')](_0x338a82);}return _0x340aca[_0xc1b2('0x22')](_0x338a82)[_0xc1b2('0x23')]();};}function respondWithResult(_0x46e088,_0x577a5c){_0x577a5c=_0x577a5c||0xc8;return function(_0x1e5579){if(_0x1e5579){return _0x46e088['status'](_0x577a5c)[_0xc1b2('0x24')](_0x1e5579);}};}function respondWithFilteredResult(_0xa6941f,_0x497f03){return function(_0x4bd2de){if(_0x4bd2de){var _0x3cc29f=typeof _0x497f03['offset']===_0xc1b2('0x25')&&typeof _0x497f03[_0xc1b2('0x26')]===_0xc1b2('0x25');var _0x242a95=_0x4bd2de[_0xc1b2('0x27')];var _0x427ae5=_0x3cc29f?0x0:_0x497f03['offset'];var _0x49ecea=_0x3cc29f?_0x4bd2de['count']:_0x497f03[_0xc1b2('0x28')]+_0x497f03[_0xc1b2('0x26')];var _0x20b179;if(_0x49ecea>=_0x242a95){_0x49ecea=_0x242a95;_0x20b179=0xc8;}else{_0x20b179=0xce;}_0xa6941f[_0xc1b2('0x22')](_0x20b179);return _0xa6941f[_0xc1b2('0x29')](_0xc1b2('0x2a'),_0x427ae5+'-'+_0x49ecea+'/'+_0x242a95)[_0xc1b2('0x24')](_0x4bd2de);}return null;};}function patchUpdates(_0x3af9ad){return function(_0xe4bfab){try{jsonpatch['apply'](_0xe4bfab,_0x3af9ad,!![]);}catch(_0x50ce44){return BPromise[_0xc1b2('0x2b')](_0x50ce44);}return _0xe4bfab['save']();};}function saveUpdates(_0x2cd8e7,_0x19e8c7){return function(_0x5c45c5){if(_0x5c45c5){return _0x5c45c5[_0xc1b2('0x2c')](_0x2cd8e7)['then'](function(_0x3ddb4c){return _0x3ddb4c;});}return null;};}function removeEntity(_0xb4d3e,_0x509b13){return function(_0x377083){if(_0x377083){return _0x377083[_0xc1b2('0x2d')]()[_0xc1b2('0x2e')](function(){var _0x34cf60=_0x377083[_0xc1b2('0x2f')]({'plain':!![]});var _0x1ffa5b=_0xc1b2('0x30');return db[_0xc1b2('0x31')][_0xc1b2('0x2d')]({'where':{'type':_0x1ffa5b,'resourceId':_0x34cf60['id']}})[_0xc1b2('0x2e')](function(){return _0x377083;});})['then'](function(){_0xb4d3e[_0xc1b2('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41dc39,_0x7f40af){return function(_0x189225){if(!_0x189225){_0x41dc39['sendStatus'](0x194);}return _0x189225;};}function handleError(_0x3c0d04,_0x4c0d1d){_0x4c0d1d=_0x4c0d1d||0x1f4;return function(_0x36cb97){logger[_0xc1b2('0x32')](_0x36cb97['stack']);if(_0x36cb97[_0xc1b2('0x33')]){delete _0x36cb97[_0xc1b2('0x33')];}_0x3c0d04[_0xc1b2('0x22')](_0x4c0d1d)['send'](_0x36cb97);};}exports[_0xc1b2('0x34')]=function(_0x73bdea,_0x3b1c31){var _0x32287c={},_0x5e6d6c={},_0x5241b9={'count':0x0,'rows':[]};var _0x487824=_['map'](db[_0xc1b2('0x35')][_0xc1b2('0x36')],function(_0x57158e){return{'name':_0x57158e[_0xc1b2('0x37')],'type':_0x57158e[_0xc1b2('0x38')]['key']};});_0x5e6d6c[_0xc1b2('0x39')]=_['map'](_0x487824,_0xc1b2('0x33'));_0x5e6d6c[_0xc1b2('0x3a')]=_['keys'](_0x73bdea[_0xc1b2('0x3a')]);_0x5e6d6c[_0xc1b2('0x3b')]=_[_0xc1b2('0x3c')](_0x5e6d6c[_0xc1b2('0x39')],_0x5e6d6c[_0xc1b2('0x3a')]);_0x32287c[_0xc1b2('0x3d')]=_[_0xc1b2('0x3c')](_0x5e6d6c[_0xc1b2('0x39')],qs[_0xc1b2('0x3e')](_0x73bdea['query'][_0xc1b2('0x3e')]));_0x32287c[_0xc1b2('0x3d')]=_0x32287c[_0xc1b2('0x3d')]['length']?_0x32287c[_0xc1b2('0x3d')]:_0x5e6d6c[_0xc1b2('0x39')];if(!_0x73bdea[_0xc1b2('0x3a')]['hasOwnProperty'](_0xc1b2('0x3f'))){_0x32287c['limit']=qs[_0xc1b2('0x26')](_0x73bdea[_0xc1b2('0x3a')][_0xc1b2('0x26')]);_0x32287c['offset']=qs[_0xc1b2('0x28')](_0x73bdea[_0xc1b2('0x3a')][_0xc1b2('0x28')]);}_0x32287c[_0xc1b2('0x40')]=qs['sort'](_0x73bdea[_0xc1b2('0x3a')]['sort']);_0x32287c[_0xc1b2('0x41')]=qs[_0xc1b2('0x3b')](_[_0xc1b2('0x42')](_0x73bdea[_0xc1b2('0x3a')],_0x5e6d6c[_0xc1b2('0x3b')]),_0x487824);if(_0x73bdea['query'][_0xc1b2('0x43')]){_0x32287c[_0xc1b2('0x41')]=_[_0xc1b2('0x44')](_0x32287c[_0xc1b2('0x41')],{'$or':_['map'](_0x487824,function(_0x17915e){if(_0x17915e[_0xc1b2('0x38')]!==_0xc1b2('0x45')){var _0x43c069={};_0x43c069[_0x17915e['name']]={'$like':'%'+_0x73bdea['query'][_0xc1b2('0x43')]+'%'};return _0x43c069;}})});}_0x32287c=_[_0xc1b2('0x44')]({},_0x32287c,_0x73bdea[_0xc1b2('0x46')]);var _0x48791e={'where':_0x32287c['where']};return db['OpenchannelQueue'][_0xc1b2('0x27')](_0x48791e)[_0xc1b2('0x2e')](function(_0x49ebb8){_0x5241b9[_0xc1b2('0x27')]=_0x49ebb8;if(_0x73bdea[_0xc1b2('0x3a')]['includeAll']){_0x32287c[_0xc1b2('0x47')]=[{'all':!![]}];}return db[_0xc1b2('0x35')][_0xc1b2('0x48')](_0x32287c);})['then'](function(_0x1c9c3e){_0x5241b9[_0xc1b2('0x49')]=_0x1c9c3e;return _0x5241b9;})[_0xc1b2('0x2e')](respondWithFilteredResult(_0x3b1c31,_0x32287c))['catch'](handleError(_0x3b1c31,null));};exports['show']=function(_0x25da1d,_0x4663ab){var _0x3f9018={'raw':!![],'where':{'id':_0x25da1d[_0xc1b2('0x4a')]['id']}},_0x2ceb50={};_0x2ceb50[_0xc1b2('0x39')]=_[_0xc1b2('0x4b')](db[_0xc1b2('0x35')][_0xc1b2('0x36')]);_0x2ceb50[_0xc1b2('0x3a')]=_[_0xc1b2('0x4b')](_0x25da1d[_0xc1b2('0x3a')]);_0x2ceb50[_0xc1b2('0x3b')]=_['intersection'](_0x2ceb50[_0xc1b2('0x39')],_0x2ceb50['query']);_0x3f9018['attributes']=_['intersection'](_0x2ceb50[_0xc1b2('0x39')],qs[_0xc1b2('0x3e')](_0x25da1d[_0xc1b2('0x3a')][_0xc1b2('0x3e')]));_0x3f9018['attributes']=_0x3f9018[_0xc1b2('0x3d')]['length']?_0x3f9018[_0xc1b2('0x3d')]:_0x2ceb50[_0xc1b2('0x39')];if(_0x25da1d[_0xc1b2('0x3a')][_0xc1b2('0x4c')]){_0x3f9018[_0xc1b2('0x47')]=[{'all':!![]}];}_0x3f9018=_[_0xc1b2('0x44')]({},_0x3f9018,_0x25da1d[_0xc1b2('0x46')]);return db['OpenchannelQueue'][_0xc1b2('0x4d')](_0x3f9018)[_0xc1b2('0x2e')](handleEntityNotFound(_0x4663ab,null))[_0xc1b2('0x2e')](respondWithResult(_0x4663ab,null))[_0xc1b2('0x4e')](handleError(_0x4663ab,null));};exports[_0xc1b2('0x4f')]=function(_0xc4a412,_0x453b0e){return db[_0xc1b2('0x35')][_0xc1b2('0x4f')](_0xc4a412[_0xc1b2('0x50')],{})[_0xc1b2('0x2e')](function(_0x15a17f){var _0x37efc6=_0xc4a412[_0xc1b2('0x51')][_0xc1b2('0x2f')]({'plain':!![]});if(!_0x37efc6)throw new Error(_0xc1b2('0x52'));if(_0x37efc6[_0xc1b2('0x53')]===_0xc1b2('0x51')){var _0x3bf3b5=_0x15a17f[_0xc1b2('0x2f')]({'plain':!![]});var _0x1d9a55=_0xc1b2('0x30');return db[_0xc1b2('0x54')][_0xc1b2('0x4d')]({'where':{'name':_0x1d9a55,'userProfileId':_0x37efc6[_0xc1b2('0x55')]},'raw':!![]})[_0xc1b2('0x2e')](function(_0xd3bfd7){if(_0xd3bfd7&&_0xd3bfd7[_0xc1b2('0x56')]===0x0){return db[_0xc1b2('0x31')][_0xc1b2('0x4f')]({'name':_0x3bf3b5[_0xc1b2('0x33')],'resourceId':_0x3bf3b5['id'],'type':_0xd3bfd7[_0xc1b2('0x33')],'sectionId':_0xd3bfd7['id']},{})[_0xc1b2('0x2e')](function(){return _0x15a17f;});}else{return _0x15a17f;}})[_0xc1b2('0x4e')](function(_0x3b93fb){logger['error'](_0xc1b2('0x57'),_0x3b93fb);throw _0x3b93fb;});}return _0x15a17f;})[_0xc1b2('0x2e')](respondWithResult(_0x453b0e,0xc9))[_0xc1b2('0x4e')](handleError(_0x453b0e,null));};exports[_0xc1b2('0x2c')]=function(_0x1a5903,_0x16da21){if(_0x1a5903[_0xc1b2('0x50')]['id']){delete _0x1a5903['body']['id'];}return db[_0xc1b2('0x35')][_0xc1b2('0x4d')]({'where':{'id':_0x1a5903[_0xc1b2('0x4a')]['id']}})[_0xc1b2('0x2e')](handleEntityNotFound(_0x16da21,null))['then'](saveUpdates(_0x1a5903[_0xc1b2('0x50')],null))[_0xc1b2('0x2e')](respondWithResult(_0x16da21,null))[_0xc1b2('0x4e')](handleError(_0x16da21,null));};exports[_0xc1b2('0x2d')]=function(_0x4970b7,_0x1cca5b){return db['OpenchannelQueue']['find']({'where':{'id':_0x4970b7[_0xc1b2('0x4a')]['id']}})[_0xc1b2('0x2e')](handleEntityNotFound(_0x1cca5b,null))[_0xc1b2('0x2e')](removeEntity(_0x1cca5b,null))['catch'](handleError(_0x1cca5b,null));};exports['describe']=function(_0x18198c,_0x5b5712){return db[_0xc1b2('0x35')][_0xc1b2('0x58')]()['then'](respondWithResult(_0x5b5712,null))[_0xc1b2('0x4e')](handleError(_0x5b5712,null));};exports['getMembers']=function(_0x4ddea4,_0x314f3f,_0x580f9d){var _0x293344={'raw':!![],'where':{}},_0x38b67a={},_0x33f56f;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x4ddea4[_0xc1b2('0x4a')]['id']}})[_0xc1b2('0x2e')](handleEntityNotFound(_0x314f3f,null))[_0xc1b2('0x2e')](function(_0x23ef75){if(_0x23ef75){_0x33f56f=_0x23ef75[_0xc1b2('0x2f')]({'plain':!![]});_0x38b67a[_0xc1b2('0x39')]=_[_0xc1b2('0x4b')](db[_0xc1b2('0x59')][_0xc1b2('0x36')]);_0x38b67a[_0xc1b2('0x3a')]=_[_0xc1b2('0x4b')](_0x4ddea4[_0xc1b2('0x3a')]);_0x38b67a['filters']=_[_0xc1b2('0x3c')](_0x38b67a[_0xc1b2('0x39')],_0x38b67a[_0xc1b2('0x3a')]);_0x293344[_0xc1b2('0x3d')]=_['intersection'](_0x38b67a['model'],qs[_0xc1b2('0x3e')](_0x4ddea4[_0xc1b2('0x3a')][_0xc1b2('0x3e')]));_0x293344[_0xc1b2('0x3d')]=_0x293344[_0xc1b2('0x3d')]['length']?_0x293344[_0xc1b2('0x3d')]:_0x38b67a[_0xc1b2('0x39')];if(!_0x4ddea4[_0xc1b2('0x3a')]['hasOwnProperty']('nolimit')){_0x293344[_0xc1b2('0x26')]=qs[_0xc1b2('0x26')](_0x4ddea4[_0xc1b2('0x3a')][_0xc1b2('0x26')]);_0x293344['offset']=qs[_0xc1b2('0x28')](_0x4ddea4[_0xc1b2('0x3a')][_0xc1b2('0x28')]);}_0x293344[_0xc1b2('0x40')]=qs[_0xc1b2('0x5a')](_0x4ddea4[_0xc1b2('0x3a')]['sort']);_0x293344[_0xc1b2('0x41')]=qs[_0xc1b2('0x3b')](_['pick'](_0x4ddea4[_0xc1b2('0x3a')],_0x38b67a[_0xc1b2('0x3b')]));_0x293344['where']['OpenchannelQueueId']=_0x23ef75['id'];if(_0x4ddea4[_0xc1b2('0x3a')]['filter']){_0x293344[_0xc1b2('0x41')]=_[_0xc1b2('0x44')](_0x293344[_0xc1b2('0x41')],{'$or':_[_0xc1b2('0x5b')](_0x293344[_0xc1b2('0x3d')],function(_0x300c2e){var _0xe881c7={};_0xe881c7[_0x300c2e]={'$like':'%'+_0x4ddea4['query'][_0xc1b2('0x43')]+'%'};return _0xe881c7;})});}_0x293344=_[_0xc1b2('0x44')]({},_0x293344,_0x4ddea4[_0xc1b2('0x46')]);return db[_0xc1b2('0x59')]['findAll'](_0x293344);}})[_0xc1b2('0x2e')](function(_0x3949bf){if(_0x3949bf){return db[_0xc1b2('0x5c')][_0xc1b2('0x5d')]({'where':{'id':_[_0xc1b2('0x5b')](_0x3949bf,'UserId'),'role':_0xc1b2('0x5e')},'attributes':['id','name',_0xc1b2('0x5f'),_0xc1b2('0x60'),_0xc1b2('0x61')]});}})[_0xc1b2('0x2e')](function(_0x3d0b78){if(_0x3d0b78){return{'count':_0x3d0b78[_0xc1b2('0x27')],'rows':_[_0xc1b2('0x5b')](_0x3d0b78[_0xc1b2('0x49')],function(_0x4fafab){return{'membername':_0x4fafab[_0xc1b2('0x33')],'UserId':_0x4fafab['id'],'queue_name':_0x33f56f[_0xc1b2('0x33')],'OpenchannelQueueId':_0x33f56f['id'],'interface':util[_0xc1b2('0x62')](_0xc1b2('0x63'),_0xc1b2('0x64'),_0x4fafab[_0xc1b2('0x33')]),'penalty':0x0,'paused':_0x4fafab['openchannelPause'],'createdAt':_0x4fafab[_0xc1b2('0x61')],'updatedAt':_0x4fafab['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xc1b2('0x2e')](respondWithFilteredResult(_0x314f3f,_0x293344))[_0xc1b2('0x4e')](handleError(_0x314f3f,null));};exports[_0xc1b2('0x65')]=function(_0x44c414,_0x15d8d2,_0x498d7){var _0x3cdd43={};var _0x156ed8={};var _0x481299;var _0x42c7e9;return db['OpenchannelQueue'][_0xc1b2('0x66')]({'where':{'id':_0x44c414[_0xc1b2('0x4a')]['id']}})[_0xc1b2('0x2e')](handleEntityNotFound(_0x15d8d2,null))[_0xc1b2('0x2e')](function(_0x2bd7c0){if(_0x2bd7c0){_0x481299=_0x2bd7c0;_0x156ed8[_0xc1b2('0x39')]=_[_0xc1b2('0x4b')](db[_0xc1b2('0x67')][_0xc1b2('0x36')]);_0x156ed8[_0xc1b2('0x3a')]=_[_0xc1b2('0x4b')](_0x44c414['query']);_0x156ed8[_0xc1b2('0x3b')]=_[_0xc1b2('0x3c')](_0x156ed8['model'],_0x156ed8[_0xc1b2('0x3a')]);_0x3cdd43[_0xc1b2('0x3d')]=_[_0xc1b2('0x3c')](_0x156ed8[_0xc1b2('0x39')],qs['fields'](_0x44c414[_0xc1b2('0x3a')]['fields']));_0x3cdd43[_0xc1b2('0x3d')]=_0x3cdd43[_0xc1b2('0x3d')]['length']?_0x3cdd43[_0xc1b2('0x3d')]:_0x156ed8['model'];_0x3cdd43[_0xc1b2('0x40')]=qs[_0xc1b2('0x5a')](_0x44c414[_0xc1b2('0x3a')][_0xc1b2('0x5a')]);_0x3cdd43[_0xc1b2('0x41')]=qs[_0xc1b2('0x3b')](_['pick'](_0x44c414[_0xc1b2('0x3a')],_0x156ed8[_0xc1b2('0x3b')]));if(_0x44c414[_0xc1b2('0x3a')][_0xc1b2('0x43')]){_0x3cdd43['where']=_[_0xc1b2('0x44')](_0x3cdd43[_0xc1b2('0x41')],{'$or':_[_0xc1b2('0x5b')](_0x3cdd43[_0xc1b2('0x3d')],function(_0x362f58){var _0x52519c={};_0x52519c[_0x362f58]={'$like':'%'+_0x44c414[_0xc1b2('0x3a')][_0xc1b2('0x43')]+'%'};return _0x52519c;})});}_0x3cdd43=_[_0xc1b2('0x44')]({},_0x3cdd43,_0x44c414['options']);return _0x481299[_0xc1b2('0x65')](_0x3cdd43);}})[_0xc1b2('0x2e')](function(_0x5f2313){if(_0x5f2313){_0x42c7e9=_0x5f2313[_0xc1b2('0x68')];if(!_0x44c414[_0xc1b2('0x3a')]['hasOwnProperty'](_0xc1b2('0x3f'))){_0x3cdd43[_0xc1b2('0x26')]=qs[_0xc1b2('0x26')](_0x44c414['query']['limit']);_0x3cdd43['offset']=qs[_0xc1b2('0x28')](_0x44c414['query'][_0xc1b2('0x28')]);}return _0x481299[_0xc1b2('0x65')](_0x3cdd43);}})[_0xc1b2('0x2e')](function(_0x3fe5a1){if(_0x3fe5a1){return _0x3fe5a1?{'count':_0x42c7e9,'rows':_0x3fe5a1}:null;}})[_0xc1b2('0x2e')](respondWithResult(_0x15d8d2,null))[_0xc1b2('0x4e')](handleError(_0x15d8d2,null));};exports['addTeams']=function(_0x1b95d7,_0x5ac19c,_0x1794da){var _0x4e082b=_0x1b95d7[_0xc1b2('0x50')][_0xc1b2('0x69')];return db[_0xc1b2('0x67')][_0xc1b2('0x48')]({'where':{'id':_0x4e082b},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc1b2('0x6a'),'attributes':['id',_0xc1b2('0x33'),_0xc1b2('0x6b'),_0xc1b2('0x6c'),_0xc1b2('0x6d')],'raw':!![]}]})[_0xc1b2('0x2e')](function(_0x2d4587){if(_0x2d4587){var _0x5b0740=_[_0xc1b2('0x6e')](_0x2d4587,function(_0x600c83){var _0x2160f8=_0x600c83[_0xc1b2('0x2f')]({'plain':!![]});return _0x2160f8[_0xc1b2('0x6a')];});return db[_0xc1b2('0x35')][_0xc1b2('0x4d')]({'where':{'id':_0x1b95d7['params']['id']}})[_0xc1b2('0x2e')](function(_0x39e06b){return db[_0xc1b2('0x6f')]['transaction'](function(_0x52f0ea){return _0x39e06b[_0xc1b2('0x70')](_0x4e082b,{'transaction':_0x52f0ea})['then'](function(){return BPromise[_0xc1b2('0x71')](_0x5b0740,function(_0x32db2b){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0x32db2b['id'],'OpenchannelQueueId':_0x1b95d7[_0xc1b2('0x4a')]['id']},'transaction':_0x52f0ea});});})[_0xc1b2('0x2e')](function(){_0x5b0740[_0xc1b2('0x72')](function(_0x177a05){socket[_0xc1b2('0x73')](_0xc1b2('0x74'),{'UserId':_0x177a05['id'],'OpenchannelQueueId':_0x39e06b['id']});});});});});}})['then'](respondWithStatusCode(_0x5ac19c,null))[_0xc1b2('0x4e')](handleError(_0x5ac19c,null));};exports['removeTeams']=function(_0x483cbf,_0x2f9289,_0x270339){return db[_0xc1b2('0x67')][_0xc1b2('0x48')]({'where':{'id':_0x483cbf['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xc1b2('0x5c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xc1b2('0x2e')](handleEntityNotFound(_0x2f9289,null))[_0xc1b2('0x2e')](function(_0x5d427c){var _0x146555=_['map'](_0x5d427c,'id');var _0x4877fe=[];var _0x241fd8=[];var _0x63016c=squel[_0xc1b2('0x75')]();_0x63016c[_0xc1b2('0x76')](_0xc1b2('0x77'))[_0xc1b2('0x78')]('team_has_openchannel_queues','tq')['join']('user_has_teams','ut',_0xc1b2('0x79'))[_0xc1b2('0x41')](_0xc1b2('0x7a'),_0x483cbf['params']['id']);for(var _0x2b61d2=0x0;_0x2b61d2<_0x5d427c[_0xc1b2('0x68')];_0x2b61d2+=0x1){let _0x2e4129=_0x5d427c[_0x2b61d2];for(var _0x265899=0x0;_0x265899<_0x2e4129[_0xc1b2('0x6a')]['length'];_0x265899+=0x1){let _0xc861c1=_0x2e4129[_0xc1b2('0x6a')][_0x265899];var _0x5387d5=_0x63016c[_0xc1b2('0x7b')]();_0x5387d5[_0xc1b2('0x41')](_0xc1b2('0x7c'),_0xc861c1['id']);_0x241fd8[_0xc1b2('0x7d')](db[_0xc1b2('0x6f')][_0xc1b2('0x3a')](_0x5387d5[_0xc1b2('0x7e')](),{'type':db['sequelize'][_0xc1b2('0x7f')]['SELECT']})[_0xc1b2('0x2e')](function(_0x303741){if(_0x303741['length']===0x1){return _0xc861c1['id'];}else{var _0x3ab737=_['every'](_[_0xc1b2('0x5b')](_0x303741,_0xc1b2('0x80')),function(_0x1b7429){return _['includes'](_0x146555,_0x1b7429);});if(_0x3ab737){return _0xc861c1['id'];}}}));}}return BPromise[_0xc1b2('0x81')](_0x241fd8)[_0xc1b2('0x2e')](function(_0x2f6918){_0x4877fe=_(_0x4877fe)[_0xc1b2('0x82')](_0x2f6918)[_0xc1b2('0x83')]()[_0xc1b2('0x84')]();return db[_0xc1b2('0x35')]['find']({'where':{'id':_0x483cbf[_0xc1b2('0x4a')]['id']}})[_0xc1b2('0x2e')](function(_0x42d9de){return db['sequelize']['transaction'](function(_0xf265d){return _0x42d9de['removeTeams'](_0x483cbf[_0xc1b2('0x3a')]['ids'],{'transaction':_0xf265d})[_0xc1b2('0x2e')](function(){if(!_[_0xc1b2('0x85')](_0x4877fe)){return _0x42d9de['removeAgents'](_0x4877fe,{'transaction':_0xf265d});}})[_0xc1b2('0x2e')](function(){_0x4877fe[_0xc1b2('0x72')](function(_0x189ff0){socket[_0xc1b2('0x73')]('userOpenchannelQueue:remove',{'UserId':_0x189ff0,'OpenchannelQueueId':_0x42d9de['id']});});});});});});})['then'](respondWithStatusCode(_0x2f9289,null))[_0xc1b2('0x4e')](handleError(_0x2f9289,null));};exports[_0xc1b2('0x86')]=function(_0x54663b,_0x133f19,_0x29b27d){return db['OpenchannelQueue'][_0xc1b2('0x4d')]({'where':{'id':_0x54663b[_0xc1b2('0x4a')]['id']}})[_0xc1b2('0x2e')](handleEntityNotFound(_0x133f19,null))['then'](function(_0x26f61e){if(_0x26f61e){return _0x26f61e['addAgents'](_0x54663b['body'][_0xc1b2('0x69')],_[_0xc1b2('0x87')](_0x54663b[_0xc1b2('0x50')],['ids','id'])||{})['spread'](function(_0x1fd099){for(var _0xb07281=0x0;_0xb07281<_0x54663b[_0xc1b2('0x50')]['ids'][_0xc1b2('0x68')];_0xb07281+=0x1){socket['emit'](_0xc1b2('0x74'),{'UserId':Number(_0x54663b[_0xc1b2('0x50')][_0xc1b2('0x69')][_0xb07281]),'OpenchannelQueueId':Number(_0x54663b[_0xc1b2('0x4a')]['id'])});}return _0x1fd099;});}})[_0xc1b2('0x2e')](respondWithResult(_0x133f19,null))[_0xc1b2('0x4e')](handleError(_0x133f19,null));};exports[_0xc1b2('0x88')]=function(_0x53f47d,_0x352cff,_0x43772f){return db[_0xc1b2('0x35')]['find']({'where':{'id':_0x53f47d['params']['id']}})['then'](handleEntityNotFound(_0x352cff,null))[_0xc1b2('0x2e')](function(_0x1f59e1){if(_0x1f59e1){return _0x1f59e1['removeAgents'](_0x53f47d[_0xc1b2('0x3a')][_0xc1b2('0x69')])[_0xc1b2('0x2e')](function(){if(_[_0xc1b2('0x89')](_0x53f47d[_0xc1b2('0x3a')][_0xc1b2('0x69')])){for(var _0xcdb8bd=0x0;_0xcdb8bd<_0x53f47d['query'][_0xc1b2('0x69')][_0xc1b2('0x68')];_0xcdb8bd+=0x1){socket['emit'](_0xc1b2('0x8a'),{'UserId':Number(_0x53f47d['query'][_0xc1b2('0x69')][_0xcdb8bd]),'OpenchannelQueueId':Number(_0x53f47d['params']['id'])});}}else{socket[_0xc1b2('0x73')]('userOpenchannelQueue:remove',{'UserId':Number(_0x53f47d[_0xc1b2('0x3a')][_0xc1b2('0x69')]),'OpenchannelQueueId':Number(_0x53f47d[_0xc1b2('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x352cff,null))[_0xc1b2('0x4e')](handleError(_0x352cff,null));};exports[_0xc1b2('0x8b')]=function(_0x37959a,_0x3528e6,_0x303755){var _0x431f6e={};var _0x419a01={};var _0xcaad1b;var _0x40a760;return db[_0xc1b2('0x35')]['findOne']({'where':{'id':_0x37959a[_0xc1b2('0x4a')]['id']}})[_0xc1b2('0x2e')](handleEntityNotFound(_0x3528e6,null))[_0xc1b2('0x2e')](function(_0x15a789){if(_0x15a789){_0xcaad1b=_0x15a789;_0x419a01[_0xc1b2('0x39')]=_[_0xc1b2('0x4b')](db[_0xc1b2('0x5c')][_0xc1b2('0x36')]);_0x419a01['query']=_[_0xc1b2('0x4b')](_0x37959a['query']);_0x419a01[_0xc1b2('0x3b')]=_[_0xc1b2('0x3c')](_0x419a01[_0xc1b2('0x39')],_0x419a01[_0xc1b2('0x3a')]);_0x431f6e[_0xc1b2('0x3d')]=_[_0xc1b2('0x3c')](_0x419a01[_0xc1b2('0x39')],qs[_0xc1b2('0x3e')](_0x37959a[_0xc1b2('0x3a')][_0xc1b2('0x3e')]));_0x431f6e[_0xc1b2('0x3d')]=_0x431f6e[_0xc1b2('0x3d')][_0xc1b2('0x68')]?_0x431f6e[_0xc1b2('0x3d')]:_0x419a01[_0xc1b2('0x39')];_0x431f6e[_0xc1b2('0x40')]=qs[_0xc1b2('0x5a')](_0x37959a['query'][_0xc1b2('0x5a')]);_0x431f6e['where']=qs['filters'](_['pick'](_0x37959a[_0xc1b2('0x3a')],_0x419a01['filters']));if(_0x37959a[_0xc1b2('0x3a')][_0xc1b2('0x43')]){_0x431f6e['where']=_['merge'](_0x431f6e[_0xc1b2('0x41')],{'$or':_[_0xc1b2('0x5b')](_0x431f6e[_0xc1b2('0x3d')],function(_0x586ebc){var _0x3b64b0={};_0x3b64b0[_0x586ebc]={'$like':'%'+_0x37959a['query']['filter']+'%'};return _0x3b64b0;})});}_0x431f6e=_['merge']({},_0x431f6e,_0x37959a[_0xc1b2('0x46')]);return _0xcaad1b[_0xc1b2('0x8b')](_0x431f6e);}})[_0xc1b2('0x2e')](function(_0x2531eb){if(_0x2531eb){_0x40a760=_0x2531eb[_0xc1b2('0x68')];if(!_0x37959a[_0xc1b2('0x3a')][_0xc1b2('0x8c')](_0xc1b2('0x3f'))){_0x431f6e['limit']=qs[_0xc1b2('0x26')](_0x37959a[_0xc1b2('0x3a')][_0xc1b2('0x26')]);_0x431f6e[_0xc1b2('0x28')]=qs[_0xc1b2('0x28')](_0x37959a[_0xc1b2('0x3a')][_0xc1b2('0x28')]);}return _0xcaad1b['getAgents'](_0x431f6e);}})[_0xc1b2('0x2e')](function(_0x43cc68){if(_0x43cc68){return _0x43cc68?{'count':_0x40a760,'rows':_0x43cc68}:null;}})['then'](respondWithResult(_0x3528e6,null))[_0xc1b2('0x4e')](handleError(_0x3528e6,null));}; \ No newline at end of file +var _0xf063=['merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','params','keys','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','length','pick','OpenchannelQueueId','findAndCountAll','UserId','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','User','Agents','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','sequelize','toString','TeamId','includes','all','union','compact','value','isEmpty','userOpenchannelQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','json','offset','undefined','limit','status','set','apply','reject','update','destroy','then','get','OpenchannelQueues','UserProfileResource','end','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter'];(function(_0x1a44f4,_0x3e823e){var _0xa12f7f=function(_0x59d5ba){while(--_0x59d5ba){_0x1a44f4['push'](_0x1a44f4['shift']());}};_0xa12f7f(++_0x3e823e);}(_0xf063,0x16b));var _0x3f06=function(_0xcf5d07,_0x8c2b35){_0xcf5d07=_0xcf5d07-0x0;var _0x532784=_0xf063[_0xcf5d07];return _0x532784;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3f06('0x0'));var zipdir=require(_0x3f06('0x1'));var jsonpatch=require(_0x3f06('0x2'));var rp=require(_0x3f06('0x3'));var moment=require(_0x3f06('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3f06('0x5'));var util=require(_0x3f06('0x6'));var path=require(_0x3f06('0x7'));var sox=require(_0x3f06('0x8'));var csv=require('to-csv');var ejs=require(_0x3f06('0x9'));var fs=require('fs');var fs_extra=require(_0x3f06('0xa'));var _=require(_0x3f06('0xb'));var squel=require(_0x3f06('0xc'));var crypto=require(_0x3f06('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3f06('0xe'));var toCsv=require(_0x3f06('0xf'));var querystring=require(_0x3f06('0x10'));var Papa=require(_0x3f06('0x11'));var Redis=require('ioredis');var authService=require(_0x3f06('0x12'));var qs=require(_0x3f06('0x13'));var as=require(_0x3f06('0x14'));var hardwareService=require(_0x3f06('0x15'));var logger=require(_0x3f06('0x16'))(_0x3f06('0x17'));var utils=require(_0x3f06('0x18'));var config=require(_0x3f06('0x19'));var licenseUtil=require(_0x3f06('0x1a'));var db=require('../../mysqldb')['db'];config[_0x3f06('0x1b')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3f06('0x1c'))(new Redis(config[_0x3f06('0x1b')]));require(_0x3f06('0x1d'))[_0x3f06('0x1e')](socket);function respondWithStatusCode(_0x420846,_0x5d283b){_0x5d283b=_0x5d283b||0xcc;return function(_0x5dcd92){if(_0x5dcd92){return _0x420846[_0x3f06('0x1f')](_0x5d283b);}return _0x420846['status'](_0x5d283b)['end']();};}function respondWithResult(_0x2de116,_0x2ba26d){_0x2ba26d=_0x2ba26d||0xc8;return function(_0x31ab8b){if(_0x31ab8b){return _0x2de116['status'](_0x2ba26d)[_0x3f06('0x20')](_0x31ab8b);}};}function respondWithFilteredResult(_0x3c00d9,_0x58b514){return function(_0xe2333){if(_0xe2333){var _0x4ab1fa=typeof _0x58b514[_0x3f06('0x21')]===_0x3f06('0x22')&&typeof _0x58b514[_0x3f06('0x23')]===_0x3f06('0x22');var _0x93a8a3=_0xe2333['count'];var _0x25493d=_0x4ab1fa?0x0:_0x58b514[_0x3f06('0x21')];var _0x69b3a5=_0x4ab1fa?_0xe2333['count']:_0x58b514[_0x3f06('0x21')]+_0x58b514['limit'];var _0x142a5d;if(_0x69b3a5>=_0x93a8a3){_0x69b3a5=_0x93a8a3;_0x142a5d=0xc8;}else{_0x142a5d=0xce;}_0x3c00d9[_0x3f06('0x24')](_0x142a5d);return _0x3c00d9[_0x3f06('0x25')]('Content-Range',_0x25493d+'-'+_0x69b3a5+'/'+_0x93a8a3)['json'](_0xe2333);}return null;};}function patchUpdates(_0x18bdce){return function(_0x1e1400){try{jsonpatch[_0x3f06('0x26')](_0x1e1400,_0x18bdce,!![]);}catch(_0x4d41d2){return BPromise[_0x3f06('0x27')](_0x4d41d2);}return _0x1e1400['save']();};}function saveUpdates(_0x248e9b,_0x123a58){return function(_0x5f0514){if(_0x5f0514){return _0x5f0514[_0x3f06('0x28')](_0x248e9b)['then'](function(_0x1f9862){return _0x1f9862;});}return null;};}function removeEntity(_0x3faab6,_0x105a69){return function(_0x636b23){if(_0x636b23){return _0x636b23[_0x3f06('0x29')]()[_0x3f06('0x2a')](function(){var _0xeb584f=_0x636b23[_0x3f06('0x2b')]({'plain':!![]});var _0xea1d6c=_0x3f06('0x2c');return db[_0x3f06('0x2d')]['destroy']({'where':{'type':_0xea1d6c,'resourceId':_0xeb584f['id']}})['then'](function(){return _0x636b23;});})[_0x3f06('0x2a')](function(){_0x3faab6[_0x3f06('0x24')](0xcc)[_0x3f06('0x2e')]();});}};}function handleEntityNotFound(_0x4b2d8d,_0x5ddd99){return function(_0x11b18f){if(!_0x11b18f){_0x4b2d8d['sendStatus'](0x194);}return _0x11b18f;};}function handleError(_0x2727a3,_0xf33dd){_0xf33dd=_0xf33dd||0x1f4;return function(_0x1fdf95){logger[_0x3f06('0x2f')](_0x1fdf95[_0x3f06('0x30')]);if(_0x1fdf95['name']){delete _0x1fdf95[_0x3f06('0x31')];}_0x2727a3[_0x3f06('0x24')](_0xf33dd)[_0x3f06('0x32')](_0x1fdf95);};}exports[_0x3f06('0x33')]=function(_0x2fbb79,_0xc864af){var _0x17c5ae={},_0x34ed28={},_0x21d46b={'count':0x0,'rows':[]};var _0x3a584a=_[_0x3f06('0x34')](db[_0x3f06('0x35')][_0x3f06('0x36')],function(_0x19279d){return{'name':_0x19279d[_0x3f06('0x37')],'type':_0x19279d[_0x3f06('0x38')]['key']};});_0x34ed28[_0x3f06('0x39')]=_[_0x3f06('0x34')](_0x3a584a,_0x3f06('0x31'));_0x34ed28[_0x3f06('0x3a')]=_['keys'](_0x2fbb79[_0x3f06('0x3a')]);_0x34ed28[_0x3f06('0x3b')]=_[_0x3f06('0x3c')](_0x34ed28[_0x3f06('0x39')],_0x34ed28['query']);_0x17c5ae[_0x3f06('0x3d')]=_[_0x3f06('0x3c')](_0x34ed28[_0x3f06('0x39')],qs[_0x3f06('0x3e')](_0x2fbb79[_0x3f06('0x3a')][_0x3f06('0x3e')]));_0x17c5ae['attributes']=_0x17c5ae[_0x3f06('0x3d')]['length']?_0x17c5ae[_0x3f06('0x3d')]:_0x34ed28[_0x3f06('0x39')];if(!_0x2fbb79[_0x3f06('0x3a')][_0x3f06('0x3f')](_0x3f06('0x40'))){_0x17c5ae[_0x3f06('0x23')]=qs['limit'](_0x2fbb79['query'][_0x3f06('0x23')]);_0x17c5ae[_0x3f06('0x21')]=qs['offset'](_0x2fbb79[_0x3f06('0x3a')][_0x3f06('0x21')]);}_0x17c5ae[_0x3f06('0x41')]=qs[_0x3f06('0x42')](_0x2fbb79[_0x3f06('0x3a')][_0x3f06('0x42')]);_0x17c5ae[_0x3f06('0x43')]=qs[_0x3f06('0x3b')](_['pick'](_0x2fbb79['query'],_0x34ed28[_0x3f06('0x3b')]),_0x3a584a);if(_0x2fbb79[_0x3f06('0x3a')][_0x3f06('0x44')]){_0x17c5ae['where']=_[_0x3f06('0x45')](_0x17c5ae[_0x3f06('0x43')],{'$or':_[_0x3f06('0x34')](_0x3a584a,function(_0x2ff238){if(_0x2ff238['type']!==_0x3f06('0x46')){var _0x17c600={};_0x17c600[_0x2ff238['name']]={'$like':'%'+_0x2fbb79[_0x3f06('0x3a')][_0x3f06('0x44')]+'%'};return _0x17c600;}})});}_0x17c5ae=_[_0x3f06('0x45')]({},_0x17c5ae,_0x2fbb79[_0x3f06('0x47')]);var _0x28ed1b={'where':_0x17c5ae[_0x3f06('0x43')]};return db['OpenchannelQueue'][_0x3f06('0x48')](_0x28ed1b)[_0x3f06('0x2a')](function(_0x2eb5f6){_0x21d46b['count']=_0x2eb5f6;if(_0x2fbb79[_0x3f06('0x3a')][_0x3f06('0x49')]){_0x17c5ae['include']=[{'all':!![]}];}return db[_0x3f06('0x35')][_0x3f06('0x4a')](_0x17c5ae);})[_0x3f06('0x2a')](function(_0x379717){_0x21d46b[_0x3f06('0x4b')]=_0x379717;return _0x21d46b;})[_0x3f06('0x2a')](respondWithFilteredResult(_0xc864af,_0x17c5ae))[_0x3f06('0x4c')](handleError(_0xc864af,null));};exports['show']=function(_0x5ed58b,_0x42bc00){var _0x380cfc={'raw':!![],'where':{'id':_0x5ed58b[_0x3f06('0x4d')]['id']}},_0x338a01={};_0x338a01[_0x3f06('0x39')]=_['keys'](db[_0x3f06('0x35')][_0x3f06('0x36')]);_0x338a01[_0x3f06('0x3a')]=_[_0x3f06('0x4e')](_0x5ed58b['query']);_0x338a01['filters']=_[_0x3f06('0x3c')](_0x338a01[_0x3f06('0x39')],_0x338a01[_0x3f06('0x3a')]);_0x380cfc[_0x3f06('0x3d')]=_[_0x3f06('0x3c')](_0x338a01[_0x3f06('0x39')],qs['fields'](_0x5ed58b[_0x3f06('0x3a')][_0x3f06('0x3e')]));_0x380cfc['attributes']=_0x380cfc['attributes']['length']?_0x380cfc[_0x3f06('0x3d')]:_0x338a01[_0x3f06('0x39')];if(_0x5ed58b[_0x3f06('0x3a')][_0x3f06('0x49')]){_0x380cfc[_0x3f06('0x4f')]=[{'all':!![]}];}_0x380cfc=_['merge']({},_0x380cfc,_0x5ed58b[_0x3f06('0x47')]);return db[_0x3f06('0x35')][_0x3f06('0x50')](_0x380cfc)[_0x3f06('0x2a')](handleEntityNotFound(_0x42bc00,null))['then'](respondWithResult(_0x42bc00,null))[_0x3f06('0x4c')](handleError(_0x42bc00,null));};exports[_0x3f06('0x51')]=function(_0x25daf3,_0xded20e){return db[_0x3f06('0x35')][_0x3f06('0x51')](_0x25daf3[_0x3f06('0x52')],{})['then'](function(_0x1b34fc){var _0x5d2f39=_0x25daf3[_0x3f06('0x53')]['get']({'plain':!![]});if(!_0x5d2f39)throw new Error(_0x3f06('0x54'));if(_0x5d2f39[_0x3f06('0x55')]===_0x3f06('0x53')){var _0x3d51ca=_0x1b34fc[_0x3f06('0x2b')]({'plain':!![]});var _0x5d6dc0=_0x3f06('0x2c');return db['UserProfileSection']['find']({'where':{'name':_0x5d6dc0,'userProfileId':_0x5d2f39[_0x3f06('0x56')]},'raw':!![]})[_0x3f06('0x2a')](function(_0x1e48e8){if(_0x1e48e8&&_0x1e48e8[_0x3f06('0x57')]===0x0){return db['UserProfileResource'][_0x3f06('0x51')]({'name':_0x3d51ca[_0x3f06('0x31')],'resourceId':_0x3d51ca['id'],'type':_0x1e48e8[_0x3f06('0x31')],'sectionId':_0x1e48e8['id']},{})[_0x3f06('0x2a')](function(){return _0x1b34fc;});}else{return _0x1b34fc;}})[_0x3f06('0x4c')](function(_0x3811c5){logger['error'](_0x3f06('0x58'),_0x3811c5);throw _0x3811c5;});}return _0x1b34fc;})[_0x3f06('0x2a')](respondWithResult(_0xded20e,0xc9))['catch'](handleError(_0xded20e,null));};exports[_0x3f06('0x28')]=function(_0x67cbdd,_0x4e0981){if(_0x67cbdd[_0x3f06('0x52')]['id']){delete _0x67cbdd[_0x3f06('0x52')]['id'];}return db[_0x3f06('0x35')][_0x3f06('0x50')]({'where':{'id':_0x67cbdd[_0x3f06('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4e0981,null))[_0x3f06('0x2a')](saveUpdates(_0x67cbdd['body'],null))[_0x3f06('0x2a')](respondWithResult(_0x4e0981,null))[_0x3f06('0x4c')](handleError(_0x4e0981,null));};exports[_0x3f06('0x29')]=function(_0x34a979,_0x1bb70f){return db['OpenchannelQueue'][_0x3f06('0x50')]({'where':{'id':_0x34a979[_0x3f06('0x4d')]['id']}})[_0x3f06('0x2a')](handleEntityNotFound(_0x1bb70f,null))[_0x3f06('0x2a')](removeEntity(_0x1bb70f,null))[_0x3f06('0x4c')](handleError(_0x1bb70f,null));};exports[_0x3f06('0x59')]=function(_0x45ff6c,_0x2bdfe2){return db['OpenchannelQueue']['describe']()['then'](respondWithResult(_0x2bdfe2,null))[_0x3f06('0x4c')](handleError(_0x2bdfe2,null));};exports[_0x3f06('0x5a')]=function(_0x4402a5,_0x19b5e2,_0x45f9f7){var _0x3dbf8d={'raw':!![],'where':{}},_0x9eaa7f={},_0x33d151;return db[_0x3f06('0x35')][_0x3f06('0x5b')]({'where':{'id':_0x4402a5[_0x3f06('0x4d')]['id']}})['then'](handleEntityNotFound(_0x19b5e2,null))[_0x3f06('0x2a')](function(_0x27d8c5){if(_0x27d8c5){_0x33d151=_0x27d8c5['get']({'plain':!![]});_0x9eaa7f['model']=_[_0x3f06('0x4e')](db[_0x3f06('0x5c')]['rawAttributes']);_0x9eaa7f[_0x3f06('0x3a')]=_[_0x3f06('0x4e')](_0x4402a5['query']);_0x9eaa7f[_0x3f06('0x3b')]=_[_0x3f06('0x3c')](_0x9eaa7f['model'],_0x9eaa7f['query']);_0x3dbf8d[_0x3f06('0x3d')]=_['intersection'](_0x9eaa7f['model'],qs['fields'](_0x4402a5['query'][_0x3f06('0x3e')]));_0x3dbf8d['attributes']=_0x3dbf8d[_0x3f06('0x3d')][_0x3f06('0x5d')]?_0x3dbf8d[_0x3f06('0x3d')]:_0x9eaa7f[_0x3f06('0x39')];if(!_0x4402a5[_0x3f06('0x3a')][_0x3f06('0x3f')]('nolimit')){_0x3dbf8d[_0x3f06('0x23')]=qs[_0x3f06('0x23')](_0x4402a5[_0x3f06('0x3a')]['limit']);_0x3dbf8d[_0x3f06('0x21')]=qs[_0x3f06('0x21')](_0x4402a5[_0x3f06('0x3a')][_0x3f06('0x21')]);}_0x3dbf8d[_0x3f06('0x41')]=qs['sort'](_0x4402a5['query'][_0x3f06('0x42')]);_0x3dbf8d[_0x3f06('0x43')]=qs[_0x3f06('0x3b')](_[_0x3f06('0x5e')](_0x4402a5[_0x3f06('0x3a')],_0x9eaa7f[_0x3f06('0x3b')]));_0x3dbf8d[_0x3f06('0x43')][_0x3f06('0x5f')]=_0x27d8c5['id'];if(_0x4402a5[_0x3f06('0x3a')][_0x3f06('0x44')]){_0x3dbf8d[_0x3f06('0x43')]=_['merge'](_0x3dbf8d[_0x3f06('0x43')],{'$or':_['map'](_0x3dbf8d[_0x3f06('0x3d')],function(_0x1df028){var _0x43b364={};_0x43b364[_0x1df028]={'$like':'%'+_0x4402a5[_0x3f06('0x3a')][_0x3f06('0x44')]+'%'};return _0x43b364;})});}_0x3dbf8d=_[_0x3f06('0x45')]({},_0x3dbf8d,_0x4402a5[_0x3f06('0x47')]);return db[_0x3f06('0x5c')]['findAll'](_0x3dbf8d);}})[_0x3f06('0x2a')](function(_0x4300e4){if(_0x4300e4){return db['User'][_0x3f06('0x60')]({'where':{'id':_[_0x3f06('0x34')](_0x4300e4,_0x3f06('0x61')),'role':'agent'},'attributes':['id',_0x3f06('0x31'),_0x3f06('0x62'),_0x3f06('0x63'),_0x3f06('0x64')]});}})[_0x3f06('0x2a')](function(_0x3b0a42){if(_0x3b0a42){return{'count':_0x3b0a42[_0x3f06('0x48')],'rows':_[_0x3f06('0x34')](_0x3b0a42[_0x3f06('0x4b')],function(_0x58c1c7){return{'membername':_0x58c1c7[_0x3f06('0x31')],'UserId':_0x58c1c7['id'],'queue_name':_0x33d151[_0x3f06('0x31')],'OpenchannelQueueId':_0x33d151['id'],'interface':util[_0x3f06('0x65')](_0x3f06('0x66'),_0x3f06('0x67'),_0x58c1c7[_0x3f06('0x31')]),'penalty':0x0,'paused':_0x58c1c7['openchannelPause'],'createdAt':_0x58c1c7[_0x3f06('0x64')],'updatedAt':_0x58c1c7[_0x3f06('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3f06('0x2a')](respondWithFilteredResult(_0x19b5e2,_0x3dbf8d))['catch'](handleError(_0x19b5e2,null));};exports[_0x3f06('0x68')]=function(_0x1c2b97,_0x19de05,_0xf7e224){var _0x50798d={};var _0xe81c4a={};var _0x3cae2e;var _0x927f36;return db[_0x3f06('0x35')][_0x3f06('0x5b')]({'where':{'id':_0x1c2b97[_0x3f06('0x4d')]['id']}})[_0x3f06('0x2a')](handleEntityNotFound(_0x19de05,null))[_0x3f06('0x2a')](function(_0x54d303){if(_0x54d303){_0x3cae2e=_0x54d303;_0xe81c4a[_0x3f06('0x39')]=_['keys'](db[_0x3f06('0x69')][_0x3f06('0x36')]);_0xe81c4a[_0x3f06('0x3a')]=_[_0x3f06('0x4e')](_0x1c2b97[_0x3f06('0x3a')]);_0xe81c4a[_0x3f06('0x3b')]=_[_0x3f06('0x3c')](_0xe81c4a['model'],_0xe81c4a[_0x3f06('0x3a')]);_0x50798d['attributes']=_['intersection'](_0xe81c4a['model'],qs[_0x3f06('0x3e')](_0x1c2b97[_0x3f06('0x3a')][_0x3f06('0x3e')]));_0x50798d[_0x3f06('0x3d')]=_0x50798d['attributes']['length']?_0x50798d[_0x3f06('0x3d')]:_0xe81c4a['model'];_0x50798d[_0x3f06('0x41')]=qs[_0x3f06('0x42')](_0x1c2b97[_0x3f06('0x3a')][_0x3f06('0x42')]);_0x50798d[_0x3f06('0x43')]=qs[_0x3f06('0x3b')](_['pick'](_0x1c2b97['query'],_0xe81c4a[_0x3f06('0x3b')]));if(_0x1c2b97['query'][_0x3f06('0x44')]){_0x50798d[_0x3f06('0x43')]=_['merge'](_0x50798d[_0x3f06('0x43')],{'$or':_[_0x3f06('0x34')](_0x50798d[_0x3f06('0x3d')],function(_0x4f0549){var _0x43f95c={};_0x43f95c[_0x4f0549]={'$like':'%'+_0x1c2b97[_0x3f06('0x3a')][_0x3f06('0x44')]+'%'};return _0x43f95c;})});}_0x50798d=_['merge']({},_0x50798d,_0x1c2b97[_0x3f06('0x47')]);return _0x3cae2e[_0x3f06('0x68')](_0x50798d);}})[_0x3f06('0x2a')](function(_0x41da30){if(_0x41da30){_0x927f36=_0x41da30[_0x3f06('0x5d')];if(!_0x1c2b97[_0x3f06('0x3a')][_0x3f06('0x3f')](_0x3f06('0x40'))){_0x50798d[_0x3f06('0x23')]=qs['limit'](_0x1c2b97['query'][_0x3f06('0x23')]);_0x50798d[_0x3f06('0x21')]=qs[_0x3f06('0x21')](_0x1c2b97['query']['offset']);}return _0x3cae2e['getTeams'](_0x50798d);}})[_0x3f06('0x2a')](function(_0x1f14ad){if(_0x1f14ad){return _0x1f14ad?{'count':_0x927f36,'rows':_0x1f14ad}:null;}})[_0x3f06('0x2a')](respondWithResult(_0x19de05,null))[_0x3f06('0x4c')](handleError(_0x19de05,null));};exports[_0x3f06('0x6a')]=function(_0x3091dd,_0xc95e46,_0xbdc2e0){var _0x7c28b3=_0x3091dd['body'][_0x3f06('0x6b')];return db[_0x3f06('0x69')]['findAll']({'where':{'id':_0x7c28b3},'attributes':['id'],'include':[{'model':db[_0x3f06('0x6c')],'as':_0x3f06('0x6d'),'attributes':['id',_0x3f06('0x31'),'online',_0x3f06('0x6e'),_0x3f06('0x6f')],'raw':!![]}]})[_0x3f06('0x2a')](function(_0x56e6c0){if(_0x56e6c0){var _0x293ae7=_[_0x3f06('0x70')](_0x56e6c0,function(_0x35b872){var _0x5f0dce=_0x35b872[_0x3f06('0x2b')]({'plain':!![]});return _0x5f0dce[_0x3f06('0x6d')];});return db[_0x3f06('0x35')][_0x3f06('0x50')]({'where':{'id':_0x3091dd[_0x3f06('0x4d')]['id']}})[_0x3f06('0x2a')](function(_0x55b17a){return db['sequelize'][_0x3f06('0x71')](function(_0x4ac87d){return _0x55b17a[_0x3f06('0x6a')](_0x7c28b3,{'transaction':_0x4ac87d})['then'](function(){return BPromise[_0x3f06('0x72')](_0x293ae7,function(_0x50adec){return db['UserOpenchannelQueue'][_0x3f06('0x73')]({'where':{'UserId':_0x50adec['id'],'OpenchannelQueueId':_0x3091dd[_0x3f06('0x4d')]['id']},'transaction':_0x4ac87d});});})[_0x3f06('0x2a')](function(){_0x293ae7[_0x3f06('0x74')](function(_0x16082a){socket[_0x3f06('0x75')](_0x3f06('0x76'),{'UserId':_0x16082a['id'],'OpenchannelQueueId':_0x55b17a['id']});});});});});}})[_0x3f06('0x2a')](respondWithStatusCode(_0xc95e46,null))[_0x3f06('0x4c')](handleError(_0xc95e46,null));};exports[_0x3f06('0x77')]=function(_0x3f4ec3,_0x4abbd2,_0x162f9a){return db[_0x3f06('0x69')]['findAll']({'where':{'id':_0x3f4ec3['query'][_0x3f06('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x3f06('0x6c')],'as':_0x3f06('0x6d'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4abbd2,null))[_0x3f06('0x2a')](function(_0x1a604a){var _0x42de28=_['map'](_0x1a604a,'id');var _0x274094=[];var _0x47c216=[];var _0xee7e0=squel[_0x3f06('0x78')]();_0xee7e0[_0x3f06('0x79')](_0x3f06('0x7a'))[_0x3f06('0x7b')](_0x3f06('0x7c'),'tq')[_0x3f06('0x7d')](_0x3f06('0x7e'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x3f06('0x7f'),_0x3f4ec3[_0x3f06('0x4d')]['id']);for(var _0x3b4e0f=0x0;_0x3b4e0f<_0x1a604a[_0x3f06('0x5d')];_0x3b4e0f+=0x1){let _0x16e347=_0x1a604a[_0x3b4e0f];for(var _0x1bb327=0x0;_0x1bb327<_0x16e347['Agents']['length'];_0x1bb327+=0x1){let _0x252229=_0x16e347['Agents'][_0x1bb327];var _0x29f9c1=_0xee7e0['clone']();_0x29f9c1[_0x3f06('0x43')](_0x3f06('0x80'),_0x252229['id']);_0x47c216['push'](db[_0x3f06('0x81')]['query'](_0x29f9c1[_0x3f06('0x82')](),{'type':db[_0x3f06('0x81')]['QueryTypes']['SELECT']})['then'](function(_0x545456){if(_0x545456['length']===0x1){return _0x252229['id'];}else{var _0x1896c1=_['every'](_[_0x3f06('0x34')](_0x545456,_0x3f06('0x83')),function(_0x5395dc){return _[_0x3f06('0x84')](_0x42de28,_0x5395dc);});if(_0x1896c1){return _0x252229['id'];}}}));}}return BPromise[_0x3f06('0x85')](_0x47c216)[_0x3f06('0x2a')](function(_0x20d208){_0x274094=_(_0x274094)[_0x3f06('0x86')](_0x20d208)[_0x3f06('0x87')]()[_0x3f06('0x88')]();return db[_0x3f06('0x35')][_0x3f06('0x50')]({'where':{'id':_0x3f4ec3[_0x3f06('0x4d')]['id']}})['then'](function(_0x21bec6){return db['sequelize'][_0x3f06('0x71')](function(_0x39ff3e){return _0x21bec6[_0x3f06('0x77')](_0x3f4ec3['query'][_0x3f06('0x6b')],{'transaction':_0x39ff3e})[_0x3f06('0x2a')](function(){if(!_[_0x3f06('0x89')](_0x274094)){return _0x21bec6['removeAgents'](_0x274094,{'transaction':_0x39ff3e});}})[_0x3f06('0x2a')](function(){_0x274094[_0x3f06('0x74')](function(_0x47642a){socket[_0x3f06('0x75')](_0x3f06('0x8a'),{'UserId':_0x47642a,'OpenchannelQueueId':_0x21bec6['id']});});});});});});})[_0x3f06('0x2a')](respondWithStatusCode(_0x4abbd2,null))[_0x3f06('0x4c')](handleError(_0x4abbd2,null));};exports['addAgents']=function(_0x4504b2,_0x1a791f,_0x46c97f){return db[_0x3f06('0x35')][_0x3f06('0x50')]({'where':{'id':_0x4504b2[_0x3f06('0x4d')]['id']}})[_0x3f06('0x2a')](handleEntityNotFound(_0x1a791f,null))[_0x3f06('0x2a')](function(_0x326fd6){if(_0x326fd6){return _0x326fd6[_0x3f06('0x8b')](_0x4504b2[_0x3f06('0x52')]['ids'],_['omit'](_0x4504b2[_0x3f06('0x52')],[_0x3f06('0x6b'),'id'])||{})[_0x3f06('0x8c')](function(_0x4af10b){for(var _0x5db6dd=0x0;_0x5db6dd<_0x4504b2[_0x3f06('0x52')][_0x3f06('0x6b')][_0x3f06('0x5d')];_0x5db6dd+=0x1){socket[_0x3f06('0x75')](_0x3f06('0x76'),{'UserId':Number(_0x4504b2[_0x3f06('0x52')][_0x3f06('0x6b')][_0x5db6dd]),'OpenchannelQueueId':Number(_0x4504b2[_0x3f06('0x4d')]['id'])});}return _0x4af10b;});}})[_0x3f06('0x2a')](respondWithResult(_0x1a791f,null))['catch'](handleError(_0x1a791f,null));};exports[_0x3f06('0x8d')]=function(_0x48d4e2,_0x30de0d,_0x406508){return db[_0x3f06('0x35')][_0x3f06('0x50')]({'where':{'id':_0x48d4e2[_0x3f06('0x4d')]['id']}})['then'](handleEntityNotFound(_0x30de0d,null))[_0x3f06('0x2a')](function(_0x2dcbd0){if(_0x2dcbd0){return _0x2dcbd0[_0x3f06('0x8d')](_0x48d4e2[_0x3f06('0x3a')][_0x3f06('0x6b')])['then'](function(){if(_[_0x3f06('0x8e')](_0x48d4e2[_0x3f06('0x3a')][_0x3f06('0x6b')])){for(var _0x377de5=0x0;_0x377de5<_0x48d4e2[_0x3f06('0x3a')]['ids']['length'];_0x377de5+=0x1){socket[_0x3f06('0x75')]('userOpenchannelQueue:remove',{'UserId':Number(_0x48d4e2['query'][_0x3f06('0x6b')][_0x377de5]),'OpenchannelQueueId':Number(_0x48d4e2[_0x3f06('0x4d')]['id'])});}}else{socket[_0x3f06('0x75')](_0x3f06('0x8a'),{'UserId':Number(_0x48d4e2['query']['ids']),'OpenchannelQueueId':Number(_0x48d4e2[_0x3f06('0x4d')]['id'])});}});}})[_0x3f06('0x2a')](respondWithStatusCode(_0x30de0d,null))[_0x3f06('0x4c')](handleError(_0x30de0d,null));};exports[_0x3f06('0x8f')]=function(_0x3f6b2a,_0x21c5e1,_0x32a121){var _0x43001f={};var _0x3389c1={};var _0x4817c4;var _0x5ebb5b;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x3f6b2a[_0x3f06('0x4d')]['id']}})['then'](handleEntityNotFound(_0x21c5e1,null))[_0x3f06('0x2a')](function(_0x4ee584){if(_0x4ee584){_0x4817c4=_0x4ee584;_0x3389c1[_0x3f06('0x39')]=_[_0x3f06('0x4e')](db[_0x3f06('0x6c')][_0x3f06('0x36')]);_0x3389c1['query']=_[_0x3f06('0x4e')](_0x3f6b2a[_0x3f06('0x3a')]);_0x3389c1[_0x3f06('0x3b')]=_[_0x3f06('0x3c')](_0x3389c1[_0x3f06('0x39')],_0x3389c1[_0x3f06('0x3a')]);_0x43001f[_0x3f06('0x3d')]=_[_0x3f06('0x3c')](_0x3389c1['model'],qs[_0x3f06('0x3e')](_0x3f6b2a[_0x3f06('0x3a')]['fields']));_0x43001f[_0x3f06('0x3d')]=_0x43001f['attributes']['length']?_0x43001f[_0x3f06('0x3d')]:_0x3389c1['model'];_0x43001f['order']=qs[_0x3f06('0x42')](_0x3f6b2a[_0x3f06('0x3a')][_0x3f06('0x42')]);_0x43001f[_0x3f06('0x43')]=qs[_0x3f06('0x3b')](_[_0x3f06('0x5e')](_0x3f6b2a[_0x3f06('0x3a')],_0x3389c1[_0x3f06('0x3b')]));if(_0x3f6b2a[_0x3f06('0x3a')][_0x3f06('0x44')]){_0x43001f[_0x3f06('0x43')]=_['merge'](_0x43001f[_0x3f06('0x43')],{'$or':_[_0x3f06('0x34')](_0x43001f[_0x3f06('0x3d')],function(_0x2c1a24){var _0x31fa26={};_0x31fa26[_0x2c1a24]={'$like':'%'+_0x3f6b2a[_0x3f06('0x3a')][_0x3f06('0x44')]+'%'};return _0x31fa26;})});}_0x43001f=_[_0x3f06('0x45')]({},_0x43001f,_0x3f6b2a[_0x3f06('0x47')]);return _0x4817c4[_0x3f06('0x8f')](_0x43001f);}})[_0x3f06('0x2a')](function(_0x20f824){if(_0x20f824){_0x5ebb5b=_0x20f824['length'];if(!_0x3f6b2a['query'][_0x3f06('0x3f')](_0x3f06('0x40'))){_0x43001f[_0x3f06('0x23')]=qs[_0x3f06('0x23')](_0x3f6b2a['query'][_0x3f06('0x23')]);_0x43001f[_0x3f06('0x21')]=qs['offset'](_0x3f6b2a[_0x3f06('0x3a')][_0x3f06('0x21')]);}return _0x4817c4[_0x3f06('0x8f')](_0x43001f);}})[_0x3f06('0x2a')](function(_0x498e2d){if(_0x498e2d){return _0x498e2d?{'count':_0x5ebb5b,'rows':_0x498e2d}:null;}})[_0x3f06('0x2a')](respondWithResult(_0x21c5e1,null))[_0x3f06('0x4c')](handleError(_0x21c5e1,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 36fc3e8..6d4e231 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 _0x1590=['exports','events','../../mysqldb','OpenchannelQueue','update','emit','hasOwnProperty','hook'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1590,0x181));var _0x0159=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x1590[_0x126558];return _0x1f6d14;};'use strict';var EventEmitter=require(_0x0159('0x0'));var OpenchannelQueue=require(_0x0159('0x1'))['db'][_0x0159('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0159('0x3'),'afterDestroy':'remove'};function emitEvent(_0x97d06f){return function(_0x139f93,_0x5f8ab,_0x193a2e){OpenchannelQueueEvents[_0x0159('0x4')](_0x97d06f+':'+_0x139f93['id'],_0x139f93);OpenchannelQueueEvents[_0x0159('0x4')](_0x97d06f,_0x139f93);_0x193a2e(null);};}for(var e in events){if(events[_0x0159('0x5')](e)){var event=events[e];OpenchannelQueue[_0x0159('0x6')](e,emitEvent(event));}}module[_0x0159('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xf2db=['setMaxListeners','update','remove','emit','hook','exports','events','OpenchannelQueue'];(function(_0x346371,_0x818daa){var _0x1741c2=function(_0x4ac663){while(--_0x4ac663){_0x346371['push'](_0x346371['shift']());}};_0x1741c2(++_0x818daa);}(_0xf2db,0x13e));var _0xbf2d=function(_0x35d0ab,_0xab6f73){_0x35d0ab=_0x35d0ab-0x0;var _0x4ba7c4=_0xf2db[_0x35d0ab];return _0x4ba7c4;};'use strict';var EventEmitter=require(_0xbf2d('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0xbf2d('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xbf2d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbf2d('0x3'),'afterDestroy':_0xbf2d('0x4')};function emitEvent(_0x11409a){return function(_0x3a7ca9,_0x18e7da,_0x5cb629){OpenchannelQueueEvents[_0xbf2d('0x5')](_0x11409a+':'+_0x3a7ca9['id'],_0x3a7ca9);OpenchannelQueueEvents[_0xbf2d('0x5')](_0x11409a,_0x3a7ca9);_0x5cb629(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xbf2d('0x6')](e,emitEvent(event));}}module[_0xbf2d('0x7')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 8e712d1..4e33ce5 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 _0x771d=['openchannel_queues','lodash','../../config/logger','api','moment','request-promise','rimraf','./openchannelQueue.attributes','exports','define','OpenchannelQueue'];(function(_0xef2c3c,_0x8ad6fe){var _0x6e14e8=function(_0x38af9b){while(--_0x38af9b){_0xef2c3c['push'](_0xef2c3c['shift']());}};_0x6e14e8(++_0x8ad6fe);}(_0x771d,0x14b));var _0xd771=function(_0x3ce385,_0x10670c){_0x3ce385=_0x3ce385-0x0;var _0x1d394a=_0x771d[_0x3ce385];return _0x1d394a;};'use strict';var _=require(_0xd771('0x0'));var util=require('util');var logger=require(_0xd771('0x1'))(_0xd771('0x2'));var moment=require(_0xd771('0x3'));var BPromise=require('bluebird');var rp=require(_0xd771('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd771('0x5'));var config=require('../../config/environment');var attributes=require(_0xd771('0x6'));module[_0xd771('0x7')]=function(_0x3f6ff6,_0xc2a59e){return _0x3f6ff6[_0xd771('0x8')](_0xd771('0x9'),attributes,{'tableName':_0xd771('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe870=['openchannel_queues','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue'];(function(_0x20cf0c,_0x14259b){var _0x4a5336=function(_0x49e433){while(--_0x49e433){_0x20cf0c['push'](_0x20cf0c['shift']());}};_0x4a5336(++_0x14259b);}(_0xe870,0xe5));var _0x0e87=function(_0x2e3d46,_0x22cdba){_0x2e3d46=_0x2e3d46-0x0;var _0x1c1386=_0xe870[_0x2e3d46];return _0x1c1386;};'use strict';var _=require(_0x0e87('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x0e87('0x1'));var BPromise=require(_0x0e87('0x2'));var rp=require(_0x0e87('0x3'));var fs=require('fs');var path=require(_0x0e87('0x4'));var rimraf=require(_0x0e87('0x5'));var config=require(_0x0e87('0x6'));var attributes=require(_0x0e87('0x7'));module[_0x0e87('0x8')]=function(_0xdd95be,_0x35d60e){return _0xdd95be[_0x0e87('0x9')](_0x0e87('0xa'),attributes,{'tableName':_0x0e87('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index c0c81ba..bccdb98 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 _0x8043=['util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelQueue,\x20%s,\x20%s','message','request\x20sent','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','attributes','limit','include','model','map','where','ShowOpenchannelQueue','debug','lodash'];(function(_0x4592f9,_0x4c3e2a){var _0x4c10f0=function(_0x470a8b){while(--_0x470a8b){_0x4592f9['push'](_0x4592f9['shift']());}};_0x4c10f0(++_0x4c3e2a);}(_0x8043,0xc2));var _0x3804=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x8043[_0xaa1b3e];return _0x454d7d;};'use strict';var _=require(_0x3804('0x0'));var util=require(_0x3804('0x1'));var moment=require(_0x3804('0x2'));var BPromise=require('bluebird');var rs=require(_0x3804('0x3'));var fs=require('fs');var Redis=require(_0x3804('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3804('0x5'))(_0x3804('0x6'));var config=require(_0x3804('0x7'));var jayson=require(_0x3804('0x8'));var client=jayson[_0x3804('0x9')]['http']({'port':0x232a});config[_0x3804('0xa')]=_['defaults'](config[_0x3804('0xa')],{'host':_0x3804('0xb'),'port':0x18eb});var socket=require(_0x3804('0xc'))(new Redis(config[_0x3804('0xa')]));require(_0x3804('0xd'))[_0x3804('0xe')](socket);function respondWithRpcPromise(_0xfa5fda,_0x4bd6ef,_0x5f1ba0){return new BPromise(function(_0x3e30d6,_0x471aab){return client[_0x3804('0xf')](_0xfa5fda,_0x5f1ba0)[_0x3804('0x10')](function(_0x160d1e){logger[_0x3804('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0x4bd6ef,'request\x20sent');logger['debug'](_0x3804('0x12'),_0x4bd6ef,'request\x20sent',JSON[_0x3804('0x13')](_0x160d1e));if(_0x160d1e['error']){if(_0x160d1e[_0x3804('0x14')]['code']===0x1f4){logger[_0x3804('0x14')](_0x3804('0x15'),_0x4bd6ef,_0x160d1e[_0x3804('0x14')][_0x3804('0x16')]);return _0x471aab(_0x160d1e[_0x3804('0x14')][_0x3804('0x16')]);}logger[_0x3804('0x14')](_0x3804('0x15'),_0x4bd6ef,_0x160d1e[_0x3804('0x14')][_0x3804('0x16')]);return _0x3e30d6(_0x160d1e['error'][_0x3804('0x16')]);}else{logger[_0x3804('0x11')](_0x3804('0x15'),_0x4bd6ef,_0x3804('0x17'));_0x3e30d6(_0x160d1e[_0x3804('0x18')]['message']);}})[_0x3804('0x19')](function(_0x1f39c2){logger[_0x3804('0x14')](_0x3804('0x15'),_0x4bd6ef,_0x1f39c2);_0x471aab(_0x1f39c2);});});}exports[_0x3804('0x1a')]=function(_0x5a2d08){var _0x2c4e0b=this;return new Promise(function(_0x5334ff,_0x4d951b){return db[_0x3804('0x1b')][_0x3804('0x1c')]({'raw':_0x5a2d08[_0x3804('0x1d')]?_0x5a2d08['options'][_0x3804('0x1e')]===undefined?!![]:![]:!![],'where':_0x5a2d08['options']?_0x5a2d08[_0x3804('0x1d')]['where']||null:null,'attributes':_0x5a2d08[_0x3804('0x1d')]?_0x5a2d08[_0x3804('0x1d')][_0x3804('0x1f')]||null:null,'limit':_0x5a2d08[_0x3804('0x1d')]?_0x5a2d08['options'][_0x3804('0x20')]||null:null,'include':_0x5a2d08[_0x3804('0x1d')]?_0x5a2d08[_0x3804('0x1d')][_0x3804('0x21')]?_['map'](_0x5a2d08[_0x3804('0x1d')][_0x3804('0x21')],function(_0x12e4b8){return{'model':db[_0x12e4b8[_0x3804('0x22')]],'as':_0x12e4b8['as'],'attributes':_0x12e4b8[_0x3804('0x1f')],'include':_0x12e4b8[_0x3804('0x21')]?_[_0x3804('0x23')](_0x12e4b8['include'],function(_0x6041eb){return{'model':db[_0x6041eb[_0x3804('0x22')]],'as':_0x6041eb['as'],'attributes':_0x6041eb['attributes'],'include':_0x6041eb['include']?_[_0x3804('0x23')](_0x6041eb['include'],function(_0x434920){return{'model':db[_0x434920[_0x3804('0x22')]],'as':_0x434920['as'],'attributes':_0x434920['attributes']};}):[]};}):[]};}):[]:[]})[_0x3804('0x10')](function(_0x16c5b7){logger[_0x3804('0x11')](_0x3804('0x1a'),_0x5a2d08);logger['debug'](_0x3804('0x1a'),_0x5a2d08,JSON[_0x3804('0x13')](_0x16c5b7));_0x5334ff(_0x16c5b7);})[_0x3804('0x19')](function(_0x23a84e){logger[_0x3804('0x14')]('GetOpenchannelQueue',_0x23a84e[_0x3804('0x16')],_0x5a2d08);_0x4d951b(_0x2c4e0b['error'](0x1f4,_0x23a84e['message']));});});};exports['ShowOpenchannelQueue']=function(_0x5914bc){var _0x17b294=this;return new Promise(function(_0x598090,_0x395852){return db[_0x3804('0x1b')]['find']({'raw':_0x5914bc['options']?_0x5914bc['options']['raw']===undefined?!![]:![]:!![],'where':_0x5914bc[_0x3804('0x1d')]?_0x5914bc['options'][_0x3804('0x24')]||null:null,'attributes':_0x5914bc['options']?_0x5914bc['options']['attributes']||null:null,'include':_0x5914bc[_0x3804('0x1d')]?_0x5914bc[_0x3804('0x1d')][_0x3804('0x21')]?_[_0x3804('0x23')](_0x5914bc[_0x3804('0x1d')][_0x3804('0x21')],function(_0x238f25){return{'model':db[_0x238f25[_0x3804('0x22')]],'as':_0x238f25['as'],'attributes':_0x238f25[_0x3804('0x1f')],'include':_0x238f25['include']?_[_0x3804('0x23')](_0x238f25[_0x3804('0x21')],function(_0x2a2856){return{'model':db[_0x2a2856[_0x3804('0x22')]],'as':_0x2a2856['as'],'attributes':_0x2a2856['attributes'],'include':_0x2a2856[_0x3804('0x21')]?_['map'](_0x2a2856[_0x3804('0x21')],function(_0x167a95){return{'model':db[_0x167a95['model']],'as':_0x167a95['as'],'attributes':_0x167a95['attributes']};}):[]};}):[]};}):[]:[]})[_0x3804('0x10')](function(_0x502d60){logger[_0x3804('0x11')](_0x3804('0x25'),_0x5914bc);logger[_0x3804('0x26')](_0x3804('0x25'),_0x5914bc,JSON[_0x3804('0x13')](_0x502d60));_0x598090(_0x502d60);})[_0x3804('0x19')](function(_0x1042de){logger['error'](_0x3804('0x25'),_0x1042de[_0x3804('0x16')],_0x5914bc);_0x395852(_0x17b294[_0x3804('0x14')](0x1f4,_0x1042de[_0x3804('0x16')]));});});}; \ No newline at end of file +var _0x4d2e=['include','map','model','OpenchannelQueue','find','ShowOpenchannelQueue','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./openchannelQueue.socket','request','then','info','request\x20sent','debug','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','GetOpenchannelQueue','findAll','options','raw','where','attributes','limit'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x4d2e,0x136));var _0xe4d2=function(_0x39a0ea,_0x4ed052){_0x39a0ea=_0x39a0ea-0x0;var _0x428d97=_0x4d2e[_0x39a0ea];return _0x428d97;};'use strict';var _=require('lodash');var util=require(_0xe4d2('0x0'));var moment=require('moment');var BPromise=require(_0xe4d2('0x1'));var rs=require(_0xe4d2('0x2'));var fs=require('fs');var Redis=require(_0xe4d2('0x3'));var db=require(_0xe4d2('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe4d2('0x5'));var config=require(_0xe4d2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe4d2('0x7')][_0xe4d2('0x8')]({'port':0x232a});config[_0xe4d2('0x9')]=_[_0xe4d2('0xa')](config[_0xe4d2('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xe4d2('0xb'))(new Redis(config['redis']));require(_0xe4d2('0xc'))['register'](socket);function respondWithRpcPromise(_0x2db369,_0x1c5a89,_0x74cc05){return new BPromise(function(_0x3a267e,_0x50ab07){return client[_0xe4d2('0xd')](_0x2db369,_0x74cc05)[_0xe4d2('0xe')](function(_0xb58fbf){logger[_0xe4d2('0xf')]('OpenchannelQueue,\x20%s,\x20%s',_0x1c5a89,_0xe4d2('0x10'));logger[_0xe4d2('0x11')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x1c5a89,_0xe4d2('0x10'),JSON[_0xe4d2('0x12')](_0xb58fbf));if(_0xb58fbf[_0xe4d2('0x13')]){if(_0xb58fbf[_0xe4d2('0x13')][_0xe4d2('0x14')]===0x1f4){logger[_0xe4d2('0x13')](_0xe4d2('0x15'),_0x1c5a89,_0xb58fbf[_0xe4d2('0x13')][_0xe4d2('0x16')]);return _0x50ab07(_0xb58fbf[_0xe4d2('0x13')][_0xe4d2('0x16')]);}logger[_0xe4d2('0x13')](_0xe4d2('0x15'),_0x1c5a89,_0xb58fbf[_0xe4d2('0x13')]['message']);return _0x3a267e(_0xb58fbf[_0xe4d2('0x13')]['message']);}else{logger[_0xe4d2('0xf')](_0xe4d2('0x15'),_0x1c5a89,'request\x20sent');_0x3a267e(_0xb58fbf[_0xe4d2('0x17')][_0xe4d2('0x16')]);}})[_0xe4d2('0x18')](function(_0xf617d4){logger[_0xe4d2('0x13')](_0xe4d2('0x15'),_0x1c5a89,_0xf617d4);_0x50ab07(_0xf617d4);});});}exports[_0xe4d2('0x19')]=function(_0x18454d){var _0x327c8e=this;return new Promise(function(_0x5c999e,_0x8050e8){return db['OpenchannelQueue'][_0xe4d2('0x1a')]({'raw':_0x18454d[_0xe4d2('0x1b')]?_0x18454d['options'][_0xe4d2('0x1c')]===undefined?!![]:![]:!![],'where':_0x18454d[_0xe4d2('0x1b')]?_0x18454d[_0xe4d2('0x1b')][_0xe4d2('0x1d')]||null:null,'attributes':_0x18454d[_0xe4d2('0x1b')]?_0x18454d[_0xe4d2('0x1b')][_0xe4d2('0x1e')]||null:null,'limit':_0x18454d[_0xe4d2('0x1b')]?_0x18454d['options'][_0xe4d2('0x1f')]||null:null,'include':_0x18454d[_0xe4d2('0x1b')]?_0x18454d[_0xe4d2('0x1b')][_0xe4d2('0x20')]?_[_0xe4d2('0x21')](_0x18454d[_0xe4d2('0x1b')][_0xe4d2('0x20')],function(_0x5cf6a6){return{'model':db[_0x5cf6a6['model']],'as':_0x5cf6a6['as'],'attributes':_0x5cf6a6[_0xe4d2('0x1e')],'include':_0x5cf6a6[_0xe4d2('0x20')]?_[_0xe4d2('0x21')](_0x5cf6a6[_0xe4d2('0x20')],function(_0x2feec6){return{'model':db[_0x2feec6[_0xe4d2('0x22')]],'as':_0x2feec6['as'],'attributes':_0x2feec6['attributes'],'include':_0x2feec6[_0xe4d2('0x20')]?_[_0xe4d2('0x21')](_0x2feec6[_0xe4d2('0x20')],function(_0x1e8bfa){return{'model':db[_0x1e8bfa[_0xe4d2('0x22')]],'as':_0x1e8bfa['as'],'attributes':_0x1e8bfa['attributes']};}):[]};}):[]};}):[]:[]})[_0xe4d2('0xe')](function(_0x4ab0c4){logger[_0xe4d2('0xf')](_0xe4d2('0x19'),_0x18454d);logger[_0xe4d2('0x11')]('GetOpenchannelQueue',_0x18454d,JSON[_0xe4d2('0x12')](_0x4ab0c4));_0x5c999e(_0x4ab0c4);})[_0xe4d2('0x18')](function(_0x4758e5){logger[_0xe4d2('0x13')](_0xe4d2('0x19'),_0x4758e5[_0xe4d2('0x16')],_0x18454d);_0x8050e8(_0x327c8e[_0xe4d2('0x13')](0x1f4,_0x4758e5[_0xe4d2('0x16')]));});});};exports['ShowOpenchannelQueue']=function(_0x3fcd6e){var _0x3d7125=this;return new Promise(function(_0x3f8db1,_0x85d4da){return db[_0xe4d2('0x23')][_0xe4d2('0x24')]({'raw':_0x3fcd6e['options']?_0x3fcd6e[_0xe4d2('0x1b')][_0xe4d2('0x1c')]===undefined?!![]:![]:!![],'where':_0x3fcd6e[_0xe4d2('0x1b')]?_0x3fcd6e[_0xe4d2('0x1b')][_0xe4d2('0x1d')]||null:null,'attributes':_0x3fcd6e['options']?_0x3fcd6e[_0xe4d2('0x1b')][_0xe4d2('0x1e')]||null:null,'include':_0x3fcd6e['options']?_0x3fcd6e[_0xe4d2('0x1b')]['include']?_[_0xe4d2('0x21')](_0x3fcd6e[_0xe4d2('0x1b')]['include'],function(_0xfee0db){return{'model':db[_0xfee0db[_0xe4d2('0x22')]],'as':_0xfee0db['as'],'attributes':_0xfee0db['attributes'],'include':_0xfee0db[_0xe4d2('0x20')]?_[_0xe4d2('0x21')](_0xfee0db[_0xe4d2('0x20')],function(_0x4edf6d){return{'model':db[_0x4edf6d[_0xe4d2('0x22')]],'as':_0x4edf6d['as'],'attributes':_0x4edf6d[_0xe4d2('0x1e')],'include':_0x4edf6d[_0xe4d2('0x20')]?_[_0xe4d2('0x21')](_0x4edf6d[_0xe4d2('0x20')],function(_0x3129f0){return{'model':db[_0x3129f0['model']],'as':_0x3129f0['as'],'attributes':_0x3129f0['attributes']};}):[]};}):[]};}):[]:[]})[_0xe4d2('0xe')](function(_0x3985f1){logger[_0xe4d2('0xf')](_0xe4d2('0x25'),_0x3fcd6e);logger[_0xe4d2('0x11')](_0xe4d2('0x25'),_0x3fcd6e,JSON['stringify'](_0x3985f1));_0x3f8db1(_0x3985f1);})['catch'](function(_0x33a4c0){logger[_0xe4d2('0x13')](_0xe4d2('0x25'),_0x33a4c0['message'],_0x3fcd6e);_0x85d4da(_0x3d7125['error'](0x1f4,_0x33a4c0[_0xe4d2('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index c00e90c..e3691b5 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 _0x417f=['save','remove','update','emit','register','length','./openchannelQueue.events'];(function(_0x6eb833,_0x2bb5e5){var _0xdfc38c=function(_0x13c4a4){while(--_0x13c4a4){_0x6eb833['push'](_0x6eb833['shift']());}};_0xdfc38c(++_0x2bb5e5);}(_0x417f,0x6f));var _0xf417=function(_0x38d31c,_0x1d84fa){_0x38d31c=_0x38d31c-0x0;var _0x2eb682=_0x417f[_0x38d31c];return _0x2eb682;};'use strict';var OpenchannelQueueEvents=require(_0xf417('0x0'));var events=[_0xf417('0x1'),_0xf417('0x2'),_0xf417('0x3')];function createListener(_0x152223,_0x49b740){return function(_0x5c0d0a){_0x49b740[_0xf417('0x4')](_0x152223,_0x5c0d0a);};}function removeListener(_0x3ffa5a,_0x5d81d9){return function(){OpenchannelQueueEvents['removeListener'](_0x3ffa5a,_0x5d81d9);};}exports[_0xf417('0x5')]=function(_0xff8990){for(var _0x2f769d=0x0,_0x44ef98=events[_0xf417('0x6')];_0x2f769d<_0x44ef98;_0x2f769d++){var _0x3d99c6=events[_0x2f769d];var _0x94b52f=createListener('openchannelQueue:'+_0x3d99c6,_0xff8990);OpenchannelQueueEvents['on'](_0x3d99c6,_0x94b52f);}}; \ No newline at end of file +var _0x36bb=['openchannelQueue:','save','update','emit','register','length'];(function(_0x533a19,_0x2811b5){var _0x2d33af=function(_0x4238b2){while(--_0x4238b2){_0x533a19['push'](_0x533a19['shift']());}};_0x2d33af(++_0x2811b5);}(_0x36bb,0x17b));var _0xb36b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36bb[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xb36b('0x0'),'remove',_0xb36b('0x1')];function createListener(_0x30bb0e,_0x33cf6d){return function(_0x130e41){_0x33cf6d[_0xb36b('0x2')](_0x30bb0e,_0x130e41);};}function removeListener(_0x4e5516,_0x1cf946){return function(){OpenchannelQueueEvents['removeListener'](_0x4e5516,_0x1cf946);};}exports[_0xb36b('0x3')]=function(_0x2a3d6c){for(var _0x256a51=0x0,_0x10d034=events[_0xb36b('0x4')];_0x256a51<_0x10d034;_0x256a51++){var _0x14362f=events[_0x256a51];var _0x10911d=createListener(_0xb36b('0x5')+_0x14362f,_0x2a3d6c);OpenchannelQueueEvents['on'](_0x14362f,_0x10911d);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 8887719..da0e4cb 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 _0x5f80=['../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','post','put','/:id','delete','destroy','util','path','connect-timeout','express','fs-extra'];(function(_0x2e41e2,_0x4e7250){var _0x2844d6=function(_0x28ce24){while(--_0x28ce24){_0x2e41e2['push'](_0x2e41e2['shift']());}};_0x2844d6(++_0x4e7250);}(_0x5f80,0x12d));var _0x05f8=function(_0x4427de,_0x5b6b6f){_0x4427de=_0x4427de-0x0;var _0x31291b=_0x5f80[_0x4427de];return _0x31291b;};'use strict';var multer=require('multer');var util=require(_0x05f8('0x0'));var path=require(_0x05f8('0x1'));var timeout=require(_0x05f8('0x2'));var express=require(_0x05f8('0x3'));var router=express['Router']();var fs_extra=require(_0x05f8('0x4'));var auth=require(_0x05f8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x05f8('0x6'));var controller=require(_0x05f8('0x7'));router[_0x05f8('0x8')]('/',auth[_0x05f8('0x9')](),controller[_0x05f8('0xa')]);router[_0x05f8('0x8')](_0x05f8('0xb'),auth[_0x05f8('0x9')](),controller[_0x05f8('0xc')]);router[_0x05f8('0x8')]('/:id',auth[_0x05f8('0x9')](),controller['show']);router[_0x05f8('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x05f8('0xe')](_0x05f8('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x05f8('0x10')](_0x05f8('0xf'),auth[_0x05f8('0x9')](),controller[_0x05f8('0x11')]);module['exports']=router; \ No newline at end of file +var _0x723f=['post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','get','/describe','describe','/:id','show'];(function(_0x418a24,_0x5b3d47){var _0x23c91f=function(_0x5f1477){while(--_0x5f1477){_0x418a24['push'](_0x418a24['shift']());}};_0x23c91f(++_0x5b3d47);}(_0x723f,0x1bf));var _0xf723=function(_0x293919,_0x389028){_0x293919=_0x293919-0x0;var _0x838542=_0x723f[_0x293919];return _0x838542;};'use strict';var multer=require(_0xf723('0x0'));var util=require('util');var path=require(_0xf723('0x1'));var timeout=require(_0xf723('0x2'));var express=require(_0xf723('0x3'));var router=express[_0xf723('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf723('0x5'));var controller=require(_0xf723('0x6'));router['get']('/',auth[_0xf723('0x7')](),controller['index']);router[_0xf723('0x8')](_0xf723('0x9'),auth['isAuthenticated'](),controller[_0xf723('0xa')]);router['get'](_0xf723('0xb'),auth[_0xf723('0x7')](),controller[_0xf723('0xc')]);router[_0xf723('0xd')]('/',auth[_0xf723('0x7')](),controller[_0xf723('0xe')]);router[_0xf723('0xf')](_0xf723('0xb'),auth[_0xf723('0x7')](),controller[_0xf723('0x10')]);router[_0xf723('0x11')](_0xf723('0xb'),auth[_0xf723('0x7')](),controller[_0xf723('0x12')]);module[_0xf723('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index b75d3a7..7bcf104 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 _0xd9f4=['moment','sequelize','exports','STRING','DATE'];(function(_0x1f70c3,_0x2ee382){var _0x334017=function(_0x3534c6){while(--_0x3534c6){_0x1f70c3['push'](_0x1f70c3['shift']());}};_0x334017(++_0x2ee382);}(_0xd9f4,0x172));var _0x4d9f=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0xd9f4[_0x18cd5b];return _0x5eaa52;};'use strict';var moment=require(_0x4d9f('0x0'));var Sequelize=require(_0x4d9f('0x1'));module[_0x4d9f('0x2')]={'uniqueid':{'type':Sequelize[_0x4d9f('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x4d9f('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x4d9f('0x4')]},'acceptAt':{'type':Sequelize[_0x4d9f('0x4')]},'exitAt':{'type':Sequelize[_0x4d9f('0x4')]},'reason':{'type':Sequelize[_0x4d9f('0x3')]}}; \ No newline at end of file +var _0xb4ce=['STRING','DATE','moment','exports'];(function(_0x2edfd5,_0x52d329){var _0x43c997=function(_0x46da39){while(--_0x46da39){_0x2edfd5['push'](_0x2edfd5['shift']());}};_0x43c997(++_0x52d329);}(_0xb4ce,0x166));var _0xeb4c=function(_0x128107,_0x5a977c){_0x128107=_0x128107-0x0;var _0xfbe1d7=_0xb4ce[_0x128107];return _0xfbe1d7;};'use strict';var moment=require(_0xeb4c('0x0'));var Sequelize=require('sequelize');module[_0xeb4c('0x1')]={'uniqueid':{'type':Sequelize[_0xeb4c('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xeb4c('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xeb4c('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xeb4c('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 84ebb32..60a277b 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 _0x87de=['status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','sendStatus','error','name','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','options','OpenchannelQueueReport','includeAll','include','findAll','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x38c76a,_0x5a963b){var _0x2867ed=function(_0x1a7633){while(--_0x1a7633){_0x38c76a['push'](_0x38c76a['shift']());}};_0x2867ed(++_0x5a963b);}(_0x87de,0x18c));var _0xe87d=function(_0x40ffc6,_0x3f7b1c){_0x40ffc6=_0x40ffc6-0x0;var _0x4b7f83=_0x87de[_0x40ffc6];return _0x4b7f83;};'use strict';var emlformat=require(_0xe87d('0x0'));var rimraf=require(_0xe87d('0x1'));var zipdir=require(_0xe87d('0x2'));var jsonpatch=require(_0xe87d('0x3'));var rp=require(_0xe87d('0x4'));var moment=require(_0xe87d('0x5'));var BPromise=require(_0xe87d('0x6'));var Mustache=require(_0xe87d('0x7'));var util=require(_0xe87d('0x8'));var path=require(_0xe87d('0x9'));var sox=require(_0xe87d('0xa'));var csv=require(_0xe87d('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe87d('0xc'));var _=require(_0xe87d('0xd'));var squel=require(_0xe87d('0xe'));var crypto=require(_0xe87d('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe87d('0xb'));var querystring=require(_0xe87d('0x10'));var Papa=require(_0xe87d('0x11'));var Redis=require(_0xe87d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe87d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe87d('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xe87d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe87d('0x16'));var db=require(_0xe87d('0x17'))['db'];function respondWithStatusCode(_0x48518d,_0x4b9d13){_0x4b9d13=_0x4b9d13||0xcc;return function(_0x5a8f79){if(_0x5a8f79){return _0x48518d['sendStatus'](_0x4b9d13);}return _0x48518d[_0xe87d('0x18')](_0x4b9d13)['end']();};}function respondWithResult(_0x575137,_0x2307eb){_0x2307eb=_0x2307eb||0xc8;return function(_0x95319d){if(_0x95319d){return _0x575137[_0xe87d('0x18')](_0x2307eb)[_0xe87d('0x19')](_0x95319d);}};}function respondWithFilteredResult(_0x3755ce,_0x133de5){return function(_0x2ce1a5){if(_0x2ce1a5){var _0x4d6fa8=typeof _0x133de5[_0xe87d('0x1a')]===_0xe87d('0x1b')&&typeof _0x133de5[_0xe87d('0x1c')]===_0xe87d('0x1b');var _0x262789=_0x2ce1a5[_0xe87d('0x1d')];var _0x1e7fe1=_0x4d6fa8?0x0:_0x133de5[_0xe87d('0x1a')];var _0x7705f4=_0x4d6fa8?_0x2ce1a5[_0xe87d('0x1d')]:_0x133de5[_0xe87d('0x1a')]+_0x133de5[_0xe87d('0x1c')];var _0x4b74ac;if(_0x7705f4>=_0x262789){_0x7705f4=_0x262789;_0x4b74ac=0xc8;}else{_0x4b74ac=0xce;}_0x3755ce[_0xe87d('0x18')](_0x4b74ac);return _0x3755ce[_0xe87d('0x1e')]('Content-Range',_0x1e7fe1+'-'+_0x7705f4+'/'+_0x262789)[_0xe87d('0x19')](_0x2ce1a5);}return null;};}function patchUpdates(_0x87db2){return function(_0xca6541){try{jsonpatch['apply'](_0xca6541,_0x87db2,!![]);}catch(_0x449993){return BPromise[_0xe87d('0x1f')](_0x449993);}return _0xca6541[_0xe87d('0x20')]();};}function saveUpdates(_0x378553,_0x111ce3){return function(_0x462457){if(_0x462457){return _0x462457[_0xe87d('0x21')](_0x378553)[_0xe87d('0x22')](function(_0x36506d){return _0x36506d;});}return null;};}function removeEntity(_0x2c0ba7,_0x578360){return function(_0x1af3c5){if(_0x1af3c5){return _0x1af3c5[_0xe87d('0x23')]()['then'](function(){_0x2c0ba7[_0xe87d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a9dd9,_0x2983eb){return function(_0x4663f4){if(!_0x4663f4){_0x5a9dd9[_0xe87d('0x24')](0x194);}return _0x4663f4;};}function handleError(_0x37d6dc,_0x19699c){_0x19699c=_0x19699c||0x1f4;return function(_0x54193e){logger[_0xe87d('0x25')](_0x54193e['stack']);if(_0x54193e[_0xe87d('0x26')]){delete _0x54193e[_0xe87d('0x26')];}_0x37d6dc[_0xe87d('0x18')](_0x19699c)['send'](_0x54193e);};}exports[_0xe87d('0x27')]=function(_0x2fa741,_0x394967){var _0x48a6af={},_0x529a5b={},_0x5e52b2={'count':0x0,'rows':[]};var _0x152b7d=_[_0xe87d('0x28')](db['OpenchannelQueueReport'][_0xe87d('0x29')],function(_0x26829e){return{'name':_0x26829e[_0xe87d('0x2a')],'type':_0x26829e['type'][_0xe87d('0x2b')]};});_0x529a5b[_0xe87d('0x2c')]=_[_0xe87d('0x28')](_0x152b7d,_0xe87d('0x26'));_0x529a5b[_0xe87d('0x2d')]=_[_0xe87d('0x2e')](_0x2fa741[_0xe87d('0x2d')]);_0x529a5b['filters']=_[_0xe87d('0x2f')](_0x529a5b['model'],_0x529a5b['query']);_0x48a6af[_0xe87d('0x30')]=_[_0xe87d('0x2f')](_0x529a5b[_0xe87d('0x2c')],qs[_0xe87d('0x31')](_0x2fa741[_0xe87d('0x2d')][_0xe87d('0x31')]));_0x48a6af[_0xe87d('0x30')]=_0x48a6af[_0xe87d('0x30')][_0xe87d('0x32')]?_0x48a6af[_0xe87d('0x30')]:_0x529a5b[_0xe87d('0x2c')];if(!_0x2fa741['query']['hasOwnProperty'](_0xe87d('0x33'))){_0x48a6af[_0xe87d('0x1c')]=qs[_0xe87d('0x1c')](_0x2fa741[_0xe87d('0x2d')]['limit']);_0x48a6af[_0xe87d('0x1a')]=qs[_0xe87d('0x1a')](_0x2fa741[_0xe87d('0x2d')][_0xe87d('0x1a')]);}_0x48a6af[_0xe87d('0x34')]=qs[_0xe87d('0x35')](_0x2fa741[_0xe87d('0x2d')][_0xe87d('0x35')]);_0x48a6af[_0xe87d('0x36')]=qs[_0xe87d('0x37')](_['pick'](_0x2fa741[_0xe87d('0x2d')],_0x529a5b[_0xe87d('0x37')]),_0x152b7d);if(_0x2fa741[_0xe87d('0x2d')][_0xe87d('0x38')]){_0x48a6af[_0xe87d('0x36')]=_[_0xe87d('0x39')](_0x48a6af['where'],{'$or':_[_0xe87d('0x28')](_0x152b7d,function(_0x56bd71){if(_0x56bd71['type']!=='VIRTUAL'){var _0x157cdb={};_0x157cdb[_0x56bd71[_0xe87d('0x26')]]={'$like':'%'+_0x2fa741['query'][_0xe87d('0x38')]+'%'};return _0x157cdb;}})});}_0x48a6af=_[_0xe87d('0x39')]({},_0x48a6af,_0x2fa741[_0xe87d('0x3a')]);var _0x3fa818={'where':_0x48a6af[_0xe87d('0x36')]};return db[_0xe87d('0x3b')][_0xe87d('0x1d')](_0x3fa818)[_0xe87d('0x22')](function(_0x344618){_0x5e52b2[_0xe87d('0x1d')]=_0x344618;if(_0x2fa741[_0xe87d('0x2d')][_0xe87d('0x3c')]){_0x48a6af[_0xe87d('0x3d')]=[{'all':!![]}];}return db[_0xe87d('0x3b')][_0xe87d('0x3e')](_0x48a6af);})[_0xe87d('0x22')](function(_0x390ac2){_0x5e52b2['rows']=_0x390ac2;return _0x5e52b2;})[_0xe87d('0x22')](respondWithFilteredResult(_0x394967,_0x48a6af))[_0xe87d('0x3f')](handleError(_0x394967,null));};exports[_0xe87d('0x40')]=function(_0x5665ff,_0x5f33c0){var _0x53c7ed={'raw':!![],'where':{'id':_0x5665ff['params']['id']}},_0x2c53ad={};_0x2c53ad['model']=_[_0xe87d('0x2e')](db[_0xe87d('0x3b')][_0xe87d('0x29')]);_0x2c53ad[_0xe87d('0x2d')]=_[_0xe87d('0x2e')](_0x5665ff[_0xe87d('0x2d')]);_0x2c53ad['filters']=_[_0xe87d('0x2f')](_0x2c53ad[_0xe87d('0x2c')],_0x2c53ad[_0xe87d('0x2d')]);_0x53c7ed[_0xe87d('0x30')]=_[_0xe87d('0x2f')](_0x2c53ad[_0xe87d('0x2c')],qs[_0xe87d('0x31')](_0x5665ff[_0xe87d('0x2d')][_0xe87d('0x31')]));_0x53c7ed[_0xe87d('0x30')]=_0x53c7ed[_0xe87d('0x30')][_0xe87d('0x32')]?_0x53c7ed['attributes']:_0x2c53ad[_0xe87d('0x2c')];if(_0x5665ff[_0xe87d('0x2d')][_0xe87d('0x3c')]){_0x53c7ed[_0xe87d('0x3d')]=[{'all':!![]}];}_0x53c7ed=_[_0xe87d('0x39')]({},_0x53c7ed,_0x5665ff['options']);return db[_0xe87d('0x3b')][_0xe87d('0x41')](_0x53c7ed)['then'](handleEntityNotFound(_0x5f33c0,null))['then'](respondWithResult(_0x5f33c0,null))[_0xe87d('0x3f')](handleError(_0x5f33c0,null));};exports[_0xe87d('0x42')]=function(_0x1ef060,_0xc18e1c){return db[_0xe87d('0x3b')]['create'](_0x1ef060[_0xe87d('0x43')],{})['then'](respondWithResult(_0xc18e1c,0xc9))['catch'](handleError(_0xc18e1c,null));};exports[_0xe87d('0x21')]=function(_0x24e2bd,_0x5855b1){if(_0x24e2bd[_0xe87d('0x43')]['id']){delete _0x24e2bd[_0xe87d('0x43')]['id'];}return db['OpenchannelQueueReport'][_0xe87d('0x41')]({'where':{'id':_0x24e2bd[_0xe87d('0x44')]['id']}})[_0xe87d('0x22')](handleEntityNotFound(_0x5855b1,null))['then'](saveUpdates(_0x24e2bd['body'],null))[_0xe87d('0x22')](respondWithResult(_0x5855b1,null))[_0xe87d('0x3f')](handleError(_0x5855b1,null));};exports[_0xe87d('0x23')]=function(_0x380ef4,_0x1b4e85){return db[_0xe87d('0x3b')]['find']({'where':{'id':_0x380ef4[_0xe87d('0x44')]['id']}})[_0xe87d('0x22')](handleEntityNotFound(_0x1b4e85,null))[_0xe87d('0x22')](removeEntity(_0x1b4e85,null))['catch'](handleError(_0x1b4e85,null));};exports[_0xe87d('0x45')]=function(_0x34f1f6,_0x5be34f){return db['OpenchannelQueueReport'][_0xe87d('0x45')]()[_0xe87d('0x22')](respondWithResult(_0x5be34f,null))['catch'](handleError(_0x5be34f,null));}; \ No newline at end of file +var _0x773f=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','type','key','keys','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','include','findAll','rows','catch','show','intersection','options','find','create','body','params','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x57fc2a,_0x14bbe5){var _0xa839b=function(_0x26572c){while(--_0x26572c){_0x57fc2a['push'](_0x57fc2a['shift']());}};_0xa839b(++_0x14bbe5);}(_0x773f,0x85));var _0xf773=function(_0x5a91a5,_0x1eb099){_0x5a91a5=_0x5a91a5-0x0;var _0x8f99de=_0x773f[_0x5a91a5];return _0x8f99de;};'use strict';var emlformat=require(_0xf773('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf773('0x1'));var jsonpatch=require(_0xf773('0x2'));var rp=require('request-promise');var moment=require(_0xf773('0x3'));var BPromise=require(_0xf773('0x4'));var Mustache=require(_0xf773('0x5'));var util=require(_0xf773('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xf773('0x7'));var ejs=require(_0xf773('0x8'));var fs=require('fs');var fs_extra=require(_0xf773('0x9'));var _=require(_0xf773('0xa'));var squel=require(_0xf773('0xb'));var crypto=require('crypto');var jsforce=require(_0xf773('0xc'));var deskjs=require(_0xf773('0xd'));var toCsv=require(_0xf773('0x7'));var querystring=require(_0xf773('0xe'));var Papa=require(_0xf773('0xf'));var Redis=require('ioredis');var authService=require(_0xf773('0x10'));var qs=require(_0xf773('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf773('0x12'));var logger=require(_0xf773('0x13'))(_0xf773('0x14'));var utils=require(_0xf773('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf773('0x16'));var db=require(_0xf773('0x17'))['db'];function respondWithStatusCode(_0x21793a,_0x28ee0d){_0x28ee0d=_0x28ee0d||0xcc;return function(_0x4c5434){if(_0x4c5434){return _0x21793a[_0xf773('0x18')](_0x28ee0d);}return _0x21793a[_0xf773('0x19')](_0x28ee0d)[_0xf773('0x1a')]();};}function respondWithResult(_0x3f3c18,_0x1a3e87){_0x1a3e87=_0x1a3e87||0xc8;return function(_0x3625ed){if(_0x3625ed){return _0x3f3c18[_0xf773('0x19')](_0x1a3e87)[_0xf773('0x1b')](_0x3625ed);}};}function respondWithFilteredResult(_0x2e1352,_0x3ae6d1){return function(_0x2f543b){if(_0x2f543b){var _0x4cdd25=typeof _0x3ae6d1[_0xf773('0x1c')]===_0xf773('0x1d')&&typeof _0x3ae6d1[_0xf773('0x1e')]==='undefined';var _0x5e5033=_0x2f543b['count'];var _0x12cd7b=_0x4cdd25?0x0:_0x3ae6d1['offset'];var _0x3f1f22=_0x4cdd25?_0x2f543b[_0xf773('0x1f')]:_0x3ae6d1['offset']+_0x3ae6d1[_0xf773('0x1e')];var _0x2217fd;if(_0x3f1f22>=_0x5e5033){_0x3f1f22=_0x5e5033;_0x2217fd=0xc8;}else{_0x2217fd=0xce;}_0x2e1352[_0xf773('0x19')](_0x2217fd);return _0x2e1352[_0xf773('0x20')](_0xf773('0x21'),_0x12cd7b+'-'+_0x3f1f22+'/'+_0x5e5033)[_0xf773('0x1b')](_0x2f543b);}return null;};}function patchUpdates(_0x8ae2af){return function(_0x3e62d2){try{jsonpatch[_0xf773('0x22')](_0x3e62d2,_0x8ae2af,!![]);}catch(_0x4b4c4b){return BPromise['reject'](_0x4b4c4b);}return _0x3e62d2[_0xf773('0x23')]();};}function saveUpdates(_0x5e9bf0,_0x4ac2c2){return function(_0x12e3b4){if(_0x12e3b4){return _0x12e3b4[_0xf773('0x24')](_0x5e9bf0)[_0xf773('0x25')](function(_0x458a5a){return _0x458a5a;});}return null;};}function removeEntity(_0x486b8b,_0xf8455e){return function(_0x52268d){if(_0x52268d){return _0x52268d['destroy']()[_0xf773('0x25')](function(){_0x486b8b[_0xf773('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc73b41,_0x174ed4){return function(_0x4ae3dd){if(!_0x4ae3dd){_0xc73b41[_0xf773('0x18')](0x194);}return _0x4ae3dd;};}function handleError(_0x29345b,_0x4c304e){_0x4c304e=_0x4c304e||0x1f4;return function(_0x39f2b6){logger[_0xf773('0x26')](_0x39f2b6[_0xf773('0x27')]);if(_0x39f2b6[_0xf773('0x28')]){delete _0x39f2b6['name'];}_0x29345b['status'](_0x4c304e)[_0xf773('0x29')](_0x39f2b6);};}exports[_0xf773('0x2a')]=function(_0x286144,_0x2bef53){var _0x5d2494={},_0xa17e7f={},_0x58d2a8={'count':0x0,'rows':[]};var _0x50e6e8=_[_0xf773('0x2b')](db[_0xf773('0x2c')][_0xf773('0x2d')],function(_0x3f542b){return{'name':_0x3f542b['fieldName'],'type':_0x3f542b[_0xf773('0x2e')][_0xf773('0x2f')]};});_0xa17e7f['model']=_[_0xf773('0x2b')](_0x50e6e8,'name');_0xa17e7f['query']=_[_0xf773('0x30')](_0x286144[_0xf773('0x31')]);_0xa17e7f[_0xf773('0x32')]=_['intersection'](_0xa17e7f[_0xf773('0x33')],_0xa17e7f[_0xf773('0x31')]);_0x5d2494[_0xf773('0x34')]=_['intersection'](_0xa17e7f[_0xf773('0x33')],qs[_0xf773('0x35')](_0x286144[_0xf773('0x31')][_0xf773('0x35')]));_0x5d2494['attributes']=_0x5d2494['attributes'][_0xf773('0x36')]?_0x5d2494[_0xf773('0x34')]:_0xa17e7f[_0xf773('0x33')];if(!_0x286144[_0xf773('0x31')][_0xf773('0x37')](_0xf773('0x38'))){_0x5d2494[_0xf773('0x1e')]=qs[_0xf773('0x1e')](_0x286144[_0xf773('0x31')][_0xf773('0x1e')]);_0x5d2494[_0xf773('0x1c')]=qs[_0xf773('0x1c')](_0x286144[_0xf773('0x31')][_0xf773('0x1c')]);}_0x5d2494[_0xf773('0x39')]=qs[_0xf773('0x3a')](_0x286144['query'][_0xf773('0x3a')]);_0x5d2494[_0xf773('0x3b')]=qs[_0xf773('0x32')](_['pick'](_0x286144[_0xf773('0x31')],_0xa17e7f[_0xf773('0x32')]),_0x50e6e8);if(_0x286144[_0xf773('0x31')][_0xf773('0x3c')]){_0x5d2494[_0xf773('0x3b')]=_[_0xf773('0x3d')](_0x5d2494[_0xf773('0x3b')],{'$or':_[_0xf773('0x2b')](_0x50e6e8,function(_0x27323e){if(_0x27323e[_0xf773('0x2e')]!=='VIRTUAL'){var _0x11ea17={};_0x11ea17[_0x27323e[_0xf773('0x28')]]={'$like':'%'+_0x286144[_0xf773('0x31')][_0xf773('0x3c')]+'%'};return _0x11ea17;}})});}_0x5d2494=_['merge']({},_0x5d2494,_0x286144['options']);var _0x36570b={'where':_0x5d2494[_0xf773('0x3b')]};return db[_0xf773('0x2c')][_0xf773('0x1f')](_0x36570b)[_0xf773('0x25')](function(_0x323ab1){_0x58d2a8[_0xf773('0x1f')]=_0x323ab1;if(_0x286144['query']['includeAll']){_0x5d2494[_0xf773('0x3e')]=[{'all':!![]}];}return db[_0xf773('0x2c')][_0xf773('0x3f')](_0x5d2494);})[_0xf773('0x25')](function(_0x3a9fcc){_0x58d2a8[_0xf773('0x40')]=_0x3a9fcc;return _0x58d2a8;})[_0xf773('0x25')](respondWithFilteredResult(_0x2bef53,_0x5d2494))[_0xf773('0x41')](handleError(_0x2bef53,null));};exports[_0xf773('0x42')]=function(_0x1ae4c8,_0x23f16c){var _0x259699={'raw':!![],'where':{'id':_0x1ae4c8['params']['id']}},_0x3a1712={};_0x3a1712['model']=_[_0xf773('0x30')](db[_0xf773('0x2c')][_0xf773('0x2d')]);_0x3a1712['query']=_[_0xf773('0x30')](_0x1ae4c8[_0xf773('0x31')]);_0x3a1712[_0xf773('0x32')]=_['intersection'](_0x3a1712[_0xf773('0x33')],_0x3a1712[_0xf773('0x31')]);_0x259699[_0xf773('0x34')]=_[_0xf773('0x43')](_0x3a1712[_0xf773('0x33')],qs[_0xf773('0x35')](_0x1ae4c8['query'][_0xf773('0x35')]));_0x259699['attributes']=_0x259699[_0xf773('0x34')]['length']?_0x259699[_0xf773('0x34')]:_0x3a1712[_0xf773('0x33')];if(_0x1ae4c8[_0xf773('0x31')]['includeAll']){_0x259699[_0xf773('0x3e')]=[{'all':!![]}];}_0x259699=_[_0xf773('0x3d')]({},_0x259699,_0x1ae4c8[_0xf773('0x44')]);return db[_0xf773('0x2c')][_0xf773('0x45')](_0x259699)[_0xf773('0x25')](handleEntityNotFound(_0x23f16c,null))[_0xf773('0x25')](respondWithResult(_0x23f16c,null))[_0xf773('0x41')](handleError(_0x23f16c,null));};exports[_0xf773('0x46')]=function(_0x94edac,_0x337e26){return db[_0xf773('0x2c')][_0xf773('0x46')](_0x94edac[_0xf773('0x47')],{})[_0xf773('0x25')](respondWithResult(_0x337e26,0xc9))[_0xf773('0x41')](handleError(_0x337e26,null));};exports[_0xf773('0x24')]=function(_0x27e452,_0x3c9215){if(_0x27e452['body']['id']){delete _0x27e452[_0xf773('0x47')]['id'];}return db['OpenchannelQueueReport'][_0xf773('0x45')]({'where':{'id':_0x27e452[_0xf773('0x48')]['id']}})[_0xf773('0x25')](handleEntityNotFound(_0x3c9215,null))[_0xf773('0x25')](saveUpdates(_0x27e452[_0xf773('0x47')],null))[_0xf773('0x25')](respondWithResult(_0x3c9215,null))[_0xf773('0x41')](handleError(_0x3c9215,null));};exports[_0xf773('0x49')]=function(_0x2723c7,_0x2034e9){return db['OpenchannelQueueReport'][_0xf773('0x45')]({'where':{'id':_0x2723c7[_0xf773('0x48')]['id']}})['then'](handleEntityNotFound(_0x2034e9,null))[_0xf773('0x25')](removeEntity(_0x2034e9,null))[_0xf773('0x41')](handleError(_0x2034e9,null));};exports[_0xf773('0x4a')]=function(_0x5bd3cc,_0x2f9e1a){return db[_0xf773('0x2c')][_0xf773('0x4a')]()[_0xf773('0x25')](respondWithResult(_0x2f9e1a,null))[_0xf773('0x41')](handleError(_0x2f9e1a,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index ebd50d9..703f575 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0x481657,_0x3f66e4){var _0x2e5568=function(_0x162875){while(--_0x162875){_0x481657['push'](_0x481657['shift']());}};_0x2e5568(++_0x3f66e4);}(_0xe14b,0x93));var _0xbe14=function(_0xc11e96,_0x2f0502){_0xc11e96=_0xc11e96-0x0;var _0x25e1ae=_0xe14b[_0xc11e96];return _0x25e1ae;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x23a763,_0xb4c7ff){var _0x28b908=function(_0x2edae2){while(--_0x2edae2){_0x23a763['push'](_0x23a763['shift']());}};_0x28b908(++_0xb4c7ff);}(_0x326f,0xd1));var _0xf326=function(_0xa4b692,_0xaaa99c){_0xa4b692=_0xa4b692-0x0;var _0x858806=_0x326f[_0xa4b692];return _0x858806;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 91bec47..81e9185 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 _0x937d=['info','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelQueueReport,\x20%s,\x20%s','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','debug','UpdateOpenchannelQueueReport','attributes','limit','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x9e62e8,_0x43f779){var _0x4936c5=function(_0x120342){while(--_0x120342){_0x9e62e8['push'](_0x9e62e8['shift']());}};_0x4936c5(++_0x43f779);}(_0x937d,0x1f4));var _0xd937=function(_0x89cb3a,_0x385fd1){_0x89cb3a=_0x89cb3a-0x0;var _0x407cf1=_0x937d[_0x89cb3a];return _0x407cf1;};'use strict';var _=require(_0xd937('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd937('0x1'));var fs=require('fs');var Redis=require(_0xd937('0x2'));var db=require(_0xd937('0x3'))['db'];var utils=require(_0xd937('0x4'));var logger=require(_0xd937('0x5'))(_0xd937('0x6'));var config=require('../../config/environment');var jayson=require(_0xd937('0x7'));var client=jayson[_0xd937('0x8')][_0xd937('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f6cd9,_0x2454f9,_0x4dc790){return new BPromise(function(_0x490b1d,_0x372dff){return client[_0xd937('0xa')](_0x4f6cd9,_0x4dc790)[_0xd937('0xb')](function(_0xa97338){logger[_0xd937('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x2454f9,_0xd937('0xd'));logger['debug'](_0xd937('0xe'),_0x2454f9,'request\x20sent',JSON[_0xd937('0xf')](_0xa97338));if(_0xa97338[_0xd937('0x10')]){if(_0xa97338[_0xd937('0x10')][_0xd937('0x11')]===0x1f4){logger[_0xd937('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x2454f9,_0xa97338[_0xd937('0x10')][_0xd937('0x12')]);return _0x372dff(_0xa97338[_0xd937('0x10')][_0xd937('0x12')]);}logger[_0xd937('0x10')](_0xd937('0x13'),_0x2454f9,_0xa97338[_0xd937('0x10')][_0xd937('0x12')]);return _0x490b1d(_0xa97338[_0xd937('0x10')][_0xd937('0x12')]);}else{logger['info'](_0xd937('0x13'),_0x2454f9,_0xd937('0xd'));_0x490b1d(_0xa97338[_0xd937('0x14')]['message']);}})[_0xd937('0x15')](function(_0x16d2ba){logger[_0xd937('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x2454f9,_0x16d2ba);_0x372dff(_0x16d2ba);});});}exports[_0xd937('0x16')]=function(_0x3d6b1c){var _0x1d1b8b=this;return new Promise(function(_0x1bd7ee,_0x26d5ca){return db[_0xd937('0x17')][_0xd937('0x18')](_0x3d6b1c[_0xd937('0x19')],{'raw':_0x3d6b1c[_0xd937('0x1a')]?_0x3d6b1c[_0xd937('0x1a')][_0xd937('0x1b')]===undefined?!![]:![]:!![]})[_0xd937('0xb')](function(_0x2c18ea){logger[_0xd937('0xc')](_0xd937('0x16'),_0x3d6b1c);logger[_0xd937('0x1c')](_0xd937('0x16'),_0x3d6b1c,JSON['stringify'](_0x2c18ea));_0x1bd7ee(_0x2c18ea);})[_0xd937('0x15')](function(_0x168f3e){logger[_0xd937('0x10')](_0xd937('0x16'),_0x168f3e[_0xd937('0x12')],_0x3d6b1c);_0x26d5ca(_0x1d1b8b[_0xd937('0x10')](0x1f4,_0x168f3e[_0xd937('0x12')]));});});};exports[_0xd937('0x1d')]=function(_0x194fe5){var _0x14b350=this;return new Promise(function(_0x2bbbd4,_0x5b14d0){return db['OpenchannelQueueReport']['update'](_0x194fe5[_0xd937('0x19')],{'raw':_0x194fe5[_0xd937('0x1a')]?_0x194fe5['options'][_0xd937('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x194fe5[_0xd937('0x1a')]?_0x194fe5[_0xd937('0x1a')]['where']||null:null,'attributes':_0x194fe5['options']?_0x194fe5[_0xd937('0x1a')][_0xd937('0x1e')]||null:null,'limit':_0x194fe5[_0xd937('0x1a')]?_0x194fe5[_0xd937('0x1a')][_0xd937('0x1f')]||null:null})[_0xd937('0xb')](function(_0x291fb7){logger[_0xd937('0xc')](_0xd937('0x1d'),_0x194fe5);logger[_0xd937('0x1c')](_0xd937('0x1d'),_0x194fe5,JSON['stringify'](_0x291fb7));_0x2bbbd4(_0x291fb7);})[_0xd937('0x15')](function(_0x23b4ef){logger[_0xd937('0x10')](_0xd937('0x1d'),_0x23b4ef['message'],_0x194fe5);_0x5b14d0(_0x14b350[_0xd937('0x10')](0x1f4,_0x23b4ef[_0xd937('0x12')]));});});}; \ No newline at end of file +var _0xe2cf=['debug','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','info','UpdateOpenchannelQueueReport','update','where','attributes','limit'];(function(_0x216d43,_0x48c90d){var _0x1575a9=function(_0xb61c0b){while(--_0xb61c0b){_0x216d43['push'](_0x216d43['shift']());}};_0x1575a9(++_0x48c90d);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x483d2a,_0x4bffba){_0x483d2a=_0x483d2a-0x0;var _0x5ba5d5=_0xe2cf[_0x483d2a];return _0x5ba5d5;};'use strict';var _=require('lodash');var util=require(_0xfe2c('0x0'));var moment=require('moment');var BPromise=require(_0xfe2c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe2c('0x2'));var db=require(_0xfe2c('0x3'))['db'];var utils=require(_0xfe2c('0x4'));var logger=require(_0xfe2c('0x5'))('rpc');var config=require(_0xfe2c('0x6'));var jayson=require(_0xfe2c('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4e0b97,_0x417bc4,_0x5e5b46){return new BPromise(function(_0x485a24,_0x30aafe){return client[_0xfe2c('0x8')](_0x4e0b97,_0x5e5b46)[_0xfe2c('0x9')](function(_0x562414){logger['info'](_0xfe2c('0xa'),_0x417bc4,_0xfe2c('0xb'));logger['debug'](_0xfe2c('0xc'),_0x417bc4,_0xfe2c('0xb'),JSON[_0xfe2c('0xd')](_0x562414));if(_0x562414[_0xfe2c('0xe')]){if(_0x562414[_0xfe2c('0xe')][_0xfe2c('0xf')]===0x1f4){logger[_0xfe2c('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x417bc4,_0x562414['error']['message']);return _0x30aafe(_0x562414['error'][_0xfe2c('0x10')]);}logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x417bc4,_0x562414[_0xfe2c('0xe')][_0xfe2c('0x10')]);return _0x485a24(_0x562414[_0xfe2c('0xe')][_0xfe2c('0x10')]);}else{logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x417bc4,_0xfe2c('0xb'));_0x485a24(_0x562414[_0xfe2c('0x11')][_0xfe2c('0x10')]);}})[_0xfe2c('0x12')](function(_0x565f40){logger[_0xfe2c('0xe')](_0xfe2c('0xa'),_0x417bc4,_0x565f40);_0x30aafe(_0x565f40);});});}exports[_0xfe2c('0x13')]=function(_0x23242b){var _0x36aeec=this;return new Promise(function(_0x13f233,_0x4afea3){return db[_0xfe2c('0x14')][_0xfe2c('0x15')](_0x23242b[_0xfe2c('0x16')],{'raw':_0x23242b[_0xfe2c('0x17')]?_0x23242b['options'][_0xfe2c('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x4e9137){logger[_0xfe2c('0x19')](_0xfe2c('0x13'),_0x23242b);logger['debug'](_0xfe2c('0x13'),_0x23242b,JSON[_0xfe2c('0xd')](_0x4e9137));_0x13f233(_0x4e9137);})['catch'](function(_0x1bd50e){logger['error'](_0xfe2c('0x13'),_0x1bd50e[_0xfe2c('0x10')],_0x23242b);_0x4afea3(_0x36aeec[_0xfe2c('0xe')](0x1f4,_0x1bd50e[_0xfe2c('0x10')]));});});};exports[_0xfe2c('0x1a')]=function(_0x2ee3b3){var _0x57cd6d=this;return new Promise(function(_0x41a545,_0x45a722){return db[_0xfe2c('0x14')][_0xfe2c('0x1b')](_0x2ee3b3[_0xfe2c('0x16')],{'raw':_0x2ee3b3[_0xfe2c('0x17')]?_0x2ee3b3['options'][_0xfe2c('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ee3b3['options']?_0x2ee3b3[_0xfe2c('0x17')][_0xfe2c('0x1c')]||null:null,'attributes':_0x2ee3b3[_0xfe2c('0x17')]?_0x2ee3b3['options'][_0xfe2c('0x1d')]||null:null,'limit':_0x2ee3b3[_0xfe2c('0x17')]?_0x2ee3b3['options'][_0xfe2c('0x1e')]||null:null})[_0xfe2c('0x9')](function(_0x3352e8){logger[_0xfe2c('0x19')](_0xfe2c('0x1a'),_0x2ee3b3);logger[_0xfe2c('0x1f')]('UpdateOpenchannelQueueReport',_0x2ee3b3,JSON['stringify'](_0x3352e8));_0x41a545(_0x3352e8);})[_0xfe2c('0x12')](function(_0x13e9a9){logger[_0xfe2c('0xe')](_0xfe2c('0x1a'),_0x13e9a9[_0xfe2c('0x10')],_0x2ee3b3);_0x45a722(_0x57cd6d['error'](0x1f4,_0x13e9a9[_0xfe2c('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 37551fd..464901c 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 _0x35c0=['./openchannelTransferReport.controller','isAuthenticated','index','get','describe','/:id','show','post','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x35c0,0xfc));var _0x035c=function(_0xd0a847,_0x72562b){_0xd0a847=_0xd0a847-0x0;var _0x2536ec=_0x35c0[_0xd0a847];return _0x2536ec;};'use strict';var multer=require(_0x035c('0x0'));var util=require('util');var path=require(_0x035c('0x1'));var timeout=require(_0x035c('0x2'));var express=require(_0x035c('0x3'));var router=express[_0x035c('0x4')]();var fs_extra=require(_0x035c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x035c('0x6'));var config=require(_0x035c('0x7'));var controller=require(_0x035c('0x8'));router['get']('/',auth[_0x035c('0x9')](),controller[_0x035c('0xa')]);router[_0x035c('0xb')]('/describe',auth[_0x035c('0x9')](),controller[_0x035c('0xc')]);router[_0x035c('0xb')](_0x035c('0xd'),auth['isAuthenticated'](),controller[_0x035c('0xe')]);router[_0x035c('0xf')]('/',auth[_0x035c('0x9')](),controller['create']);router[_0x035c('0x10')](_0x035c('0xd'),auth[_0x035c('0x9')](),controller[_0x035c('0x11')]);router[_0x035c('0x12')](_0x035c('0xd'),auth[_0x035c('0x9')](),controller[_0x035c('0x13')]);module['exports']=router; \ No newline at end of file +var _0x0fa3=['get','index','/describe','isAuthenticated','/:id','post','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller'];(function(_0x1e4870,_0x470ac0){var _0x243d39=function(_0x4d0465){while(--_0x4d0465){_0x1e4870['push'](_0x1e4870['shift']());}};_0x243d39(++_0x470ac0);}(_0x0fa3,0x6e));var _0x30fa=function(_0x38aa04,_0x2c8039){_0x38aa04=_0x38aa04-0x0;var _0x39bb22=_0x0fa3[_0x38aa04];return _0x39bb22;};'use strict';var multer=require(_0x30fa('0x0'));var util=require(_0x30fa('0x1'));var path=require(_0x30fa('0x2'));var timeout=require(_0x30fa('0x3'));var express=require(_0x30fa('0x4'));var router=express[_0x30fa('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x30fa('0x6'));var interaction=require(_0x30fa('0x7'));var config=require(_0x30fa('0x8'));var controller=require(_0x30fa('0x9'));router[_0x30fa('0xa')]('/',auth['isAuthenticated'](),controller[_0x30fa('0xb')]);router['get'](_0x30fa('0xc'),auth[_0x30fa('0xd')](),controller['describe']);router[_0x30fa('0xa')](_0x30fa('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x30fa('0xf')]('/',auth[_0x30fa('0xd')](),controller[_0x30fa('0x10')]);router[_0x30fa('0x11')](_0x30fa('0xe'),auth[_0x30fa('0xd')](),controller['update']);router[_0x30fa('0x12')](_0x30fa('0xe'),auth[_0x30fa('0xd')](),controller[_0x30fa('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 0dd0021..eef47b8 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x3baf08,_0x2e6807){var _0x16a01b=function(_0x2581c0){while(--_0x2581c0){_0x3baf08['push'](_0x3baf08['shift']());}};_0x16a01b(++_0x2e6807);}(_0x00bb,0x1d8));var _0xb00b=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x00bb[_0xae7c2f];return _0x5d7001;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x2091e2,_0x90a458){var _0x1b5406=function(_0x55294d){while(--_0x55294d){_0x2091e2['push'](_0x2091e2['shift']());}};_0x1b5406(++_0x90a458);}(_0xf4eb,0xec));var _0xbf4e=function(_0x3227a6,_0x242f7){_0x3227a6=_0x3227a6-0x0;var _0x302a00=_0xf4eb[_0x3227a6];return _0x302a00;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 08223b7..12f3324 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 _0x1fde=['destroy','error','stack','name','send','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then'];(function(_0x2682af,_0x10b3b1){var _0x264864=function(_0x38340c){while(--_0x38340c){_0x2682af['push'](_0x2682af['shift']());}};_0x264864(++_0x10b3b1);}(_0x1fde,0x74));var _0xe1fd=function(_0x2d61ac,_0x18ff36){_0x2d61ac=_0x2d61ac-0x0;var _0x3f7d3c=_0x1fde[_0x2d61ac];return _0x3f7d3c;};'use strict';var emlformat=require(_0xe1fd('0x0'));var rimraf=require(_0xe1fd('0x1'));var zipdir=require(_0xe1fd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe1fd('0x3'));var moment=require(_0xe1fd('0x4'));var BPromise=require(_0xe1fd('0x5'));var Mustache=require(_0xe1fd('0x6'));var util=require(_0xe1fd('0x7'));var path=require('path');var sox=require(_0xe1fd('0x8'));var csv=require('to-csv');var ejs=require(_0xe1fd('0x9'));var fs=require('fs');var fs_extra=require(_0xe1fd('0xa'));var _=require(_0xe1fd('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe1fd('0xc'));var toCsv=require(_0xe1fd('0xd'));var querystring=require(_0xe1fd('0xe'));var Papa=require(_0xe1fd('0xf'));var Redis=require('ioredis');var authService=require(_0xe1fd('0x10'));var qs=require(_0xe1fd('0x11'));var as=require(_0xe1fd('0x12'));var hardwareService=require(_0xe1fd('0x13'));var logger=require('../../config/logger')(_0xe1fd('0x14'));var utils=require('../../config/utils');var config=require(_0xe1fd('0x15'));var licenseUtil=require(_0xe1fd('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x590aae,_0x52b6a8){_0x52b6a8=_0x52b6a8||0xcc;return function(_0x519c67){if(_0x519c67){return _0x590aae[_0xe1fd('0x17')](_0x52b6a8);}return _0x590aae[_0xe1fd('0x18')](_0x52b6a8)[_0xe1fd('0x19')]();};}function respondWithResult(_0xa44812,_0x47bebc){_0x47bebc=_0x47bebc||0xc8;return function(_0x2df0e7){if(_0x2df0e7){return _0xa44812[_0xe1fd('0x18')](_0x47bebc)[_0xe1fd('0x1a')](_0x2df0e7);}};}function respondWithFilteredResult(_0x27ccf2,_0x297234){return function(_0x87a624){if(_0x87a624){var _0x23507e=typeof _0x297234[_0xe1fd('0x1b')]===_0xe1fd('0x1c')&&typeof _0x297234[_0xe1fd('0x1d')]===_0xe1fd('0x1c');var _0x49bdf0=_0x87a624['count'];var _0x9eeb6f=_0x23507e?0x0:_0x297234[_0xe1fd('0x1b')];var _0x3eef82=_0x23507e?_0x87a624[_0xe1fd('0x1e')]:_0x297234[_0xe1fd('0x1b')]+_0x297234['limit'];var _0x551d48;if(_0x3eef82>=_0x49bdf0){_0x3eef82=_0x49bdf0;_0x551d48=0xc8;}else{_0x551d48=0xce;}_0x27ccf2[_0xe1fd('0x18')](_0x551d48);return _0x27ccf2[_0xe1fd('0x1f')](_0xe1fd('0x20'),_0x9eeb6f+'-'+_0x3eef82+'/'+_0x49bdf0)[_0xe1fd('0x1a')](_0x87a624);}return null;};}function patchUpdates(_0x388df4){return function(_0x2644ba){try{jsonpatch[_0xe1fd('0x21')](_0x2644ba,_0x388df4,!![]);}catch(_0x3931aa){return BPromise[_0xe1fd('0x22')](_0x3931aa);}return _0x2644ba[_0xe1fd('0x23')]();};}function saveUpdates(_0x255b60,_0x2dc315){return function(_0xdaf0b0){if(_0xdaf0b0){return _0xdaf0b0[_0xe1fd('0x24')](_0x255b60)[_0xe1fd('0x25')](function(_0x2e8dd1){return _0x2e8dd1;});}return null;};}function removeEntity(_0x34805,_0x4ff1ce){return function(_0x3aa42e){if(_0x3aa42e){return _0x3aa42e[_0xe1fd('0x26')]()[_0xe1fd('0x25')](function(){_0x34805['status'](0xcc)[_0xe1fd('0x19')]();});}};}function handleEntityNotFound(_0x4b748e,_0x19169e){return function(_0x3e6281){if(!_0x3e6281){_0x4b748e[_0xe1fd('0x17')](0x194);}return _0x3e6281;};}function handleError(_0x4385f6,_0x3ba103){_0x3ba103=_0x3ba103||0x1f4;return function(_0x5bb0a9){logger[_0xe1fd('0x27')](_0x5bb0a9[_0xe1fd('0x28')]);if(_0x5bb0a9[_0xe1fd('0x29')]){delete _0x5bb0a9[_0xe1fd('0x29')];}_0x4385f6[_0xe1fd('0x18')](_0x3ba103)[_0xe1fd('0x2a')](_0x5bb0a9);};}exports['index']=function(_0xfcdf52,_0x4eec50){var _0x5ae962={},_0x20294f={},_0x56fd3b={'count':0x0,'rows':[]};var _0xd758bd=_[_0xe1fd('0x2b')](db[_0xe1fd('0x2c')][_0xe1fd('0x2d')],function(_0x1582a0){return{'name':_0x1582a0[_0xe1fd('0x2e')],'type':_0x1582a0[_0xe1fd('0x2f')][_0xe1fd('0x30')]};});_0x20294f['model']=_['map'](_0xd758bd,_0xe1fd('0x29'));_0x20294f[_0xe1fd('0x31')]=_[_0xe1fd('0x32')](_0xfcdf52[_0xe1fd('0x31')]);_0x20294f[_0xe1fd('0x33')]=_[_0xe1fd('0x34')](_0x20294f[_0xe1fd('0x35')],_0x20294f['query']);_0x5ae962[_0xe1fd('0x36')]=_[_0xe1fd('0x34')](_0x20294f[_0xe1fd('0x35')],qs['fields'](_0xfcdf52['query'][_0xe1fd('0x37')]));_0x5ae962['attributes']=_0x5ae962[_0xe1fd('0x36')][_0xe1fd('0x38')]?_0x5ae962['attributes']:_0x20294f[_0xe1fd('0x35')];if(!_0xfcdf52['query'][_0xe1fd('0x39')](_0xe1fd('0x3a'))){_0x5ae962[_0xe1fd('0x1d')]=qs['limit'](_0xfcdf52[_0xe1fd('0x31')][_0xe1fd('0x1d')]);_0x5ae962[_0xe1fd('0x1b')]=qs['offset'](_0xfcdf52[_0xe1fd('0x31')][_0xe1fd('0x1b')]);}_0x5ae962[_0xe1fd('0x3b')]=qs[_0xe1fd('0x3c')](_0xfcdf52[_0xe1fd('0x31')]['sort']);_0x5ae962[_0xe1fd('0x3d')]=qs[_0xe1fd('0x33')](_[_0xe1fd('0x3e')](_0xfcdf52[_0xe1fd('0x31')],_0x20294f['filters']),_0xd758bd);if(_0xfcdf52['query'][_0xe1fd('0x3f')]){_0x5ae962['where']=_[_0xe1fd('0x40')](_0x5ae962['where'],{'$or':_[_0xe1fd('0x2b')](_0xd758bd,function(_0x13e94d){if(_0x13e94d[_0xe1fd('0x2f')]!==_0xe1fd('0x41')){var _0x5b0102={};_0x5b0102[_0x13e94d[_0xe1fd('0x29')]]={'$like':'%'+_0xfcdf52[_0xe1fd('0x31')][_0xe1fd('0x3f')]+'%'};return _0x5b0102;}})});}_0x5ae962=_[_0xe1fd('0x40')]({},_0x5ae962,_0xfcdf52[_0xe1fd('0x42')]);var _0x4b0f0d={'where':_0x5ae962[_0xe1fd('0x3d')]};return db[_0xe1fd('0x2c')][_0xe1fd('0x1e')](_0x4b0f0d)['then'](function(_0x3eac92){_0x56fd3b[_0xe1fd('0x1e')]=_0x3eac92;if(_0xfcdf52[_0xe1fd('0x31')][_0xe1fd('0x43')]){_0x5ae962[_0xe1fd('0x44')]=[{'all':!![]}];}return db[_0xe1fd('0x2c')][_0xe1fd('0x45')](_0x5ae962);})[_0xe1fd('0x25')](function(_0x33187a){_0x56fd3b['rows']=_0x33187a;return _0x56fd3b;})[_0xe1fd('0x25')](respondWithFilteredResult(_0x4eec50,_0x5ae962))[_0xe1fd('0x46')](handleError(_0x4eec50,null));};exports[_0xe1fd('0x47')]=function(_0x1024b9,_0x2c3109){var _0xfe19d5={'raw':!![],'where':{'id':_0x1024b9[_0xe1fd('0x48')]['id']}},_0x24f637={};_0x24f637[_0xe1fd('0x35')]=_[_0xe1fd('0x32')](db[_0xe1fd('0x2c')][_0xe1fd('0x2d')]);_0x24f637['query']=_['keys'](_0x1024b9[_0xe1fd('0x31')]);_0x24f637[_0xe1fd('0x33')]=_[_0xe1fd('0x34')](_0x24f637[_0xe1fd('0x35')],_0x24f637['query']);_0xfe19d5[_0xe1fd('0x36')]=_[_0xe1fd('0x34')](_0x24f637[_0xe1fd('0x35')],qs['fields'](_0x1024b9['query'][_0xe1fd('0x37')]));_0xfe19d5[_0xe1fd('0x36')]=_0xfe19d5[_0xe1fd('0x36')][_0xe1fd('0x38')]?_0xfe19d5['attributes']:_0x24f637[_0xe1fd('0x35')];if(_0x1024b9[_0xe1fd('0x31')]['includeAll']){_0xfe19d5['include']=[{'all':!![]}];}_0xfe19d5=_[_0xe1fd('0x40')]({},_0xfe19d5,_0x1024b9[_0xe1fd('0x42')]);return db['OpenchannelTransferReport'][_0xe1fd('0x49')](_0xfe19d5)['then'](handleEntityNotFound(_0x2c3109,null))[_0xe1fd('0x25')](respondWithResult(_0x2c3109,null))['catch'](handleError(_0x2c3109,null));};exports[_0xe1fd('0x4a')]=function(_0x43d31f,_0xc226d3){return db[_0xe1fd('0x2c')][_0xe1fd('0x4a')](_0x43d31f['body'],{})['then'](respondWithResult(_0xc226d3,0xc9))['catch'](handleError(_0xc226d3,null));};exports[_0xe1fd('0x24')]=function(_0xed4f13,_0xd822ee){if(_0xed4f13['body']['id']){delete _0xed4f13[_0xe1fd('0x4b')]['id'];}return db['OpenchannelTransferReport'][_0xe1fd('0x49')]({'where':{'id':_0xed4f13[_0xe1fd('0x48')]['id']}})[_0xe1fd('0x25')](handleEntityNotFound(_0xd822ee,null))[_0xe1fd('0x25')](saveUpdates(_0xed4f13[_0xe1fd('0x4b')],null))[_0xe1fd('0x25')](respondWithResult(_0xd822ee,null))['catch'](handleError(_0xd822ee,null));};exports[_0xe1fd('0x26')]=function(_0x2c343a,_0x588e52){return db[_0xe1fd('0x2c')]['find']({'where':{'id':_0x2c343a['params']['id']}})[_0xe1fd('0x25')](handleEntityNotFound(_0x588e52,null))['then'](removeEntity(_0x588e52,null))[_0xe1fd('0x46')](handleError(_0x588e52,null));};exports[_0xe1fd('0x4c')]=function(_0x36742c,_0x474f63){return db[_0xe1fd('0x2c')][_0xe1fd('0x4c')]()[_0xe1fd('0x25')](respondWithResult(_0x474f63,null))[_0xe1fd('0x46')](handleError(_0x474f63,null));}; \ No newline at end of file +var _0x861c=['set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count'];(function(_0x21da64,_0x1d3d1f){var _0x5a79f1=function(_0x59c2a8){while(--_0x59c2a8){_0x21da64['push'](_0x21da64['shift']());}};_0x5a79f1(++_0x1d3d1f);}(_0x861c,0x1c0));var _0xc861=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x861c[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc861('0x0'));var zipdir=require(_0xc861('0x1'));var jsonpatch=require(_0xc861('0x2'));var rp=require(_0xc861('0x3'));var moment=require(_0xc861('0x4'));var BPromise=require(_0xc861('0x5'));var Mustache=require('mustache');var util=require(_0xc861('0x6'));var path=require(_0xc861('0x7'));var sox=require(_0xc861('0x8'));var csv=require(_0xc861('0x9'));var ejs=require(_0xc861('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc861('0xb'));var crypto=require(_0xc861('0xc'));var jsforce=require(_0xc861('0xd'));var deskjs=require(_0xc861('0xe'));var toCsv=require(_0xc861('0x9'));var querystring=require('querystring');var Papa=require(_0xc861('0xf'));var Redis=require(_0xc861('0x10'));var authService=require(_0xc861('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc861('0x12'));var hardwareService=require(_0xc861('0x13'));var logger=require(_0xc861('0x14'))(_0xc861('0x15'));var utils=require(_0xc861('0x16'));var config=require(_0xc861('0x17'));var licenseUtil=require(_0xc861('0x18'));var db=require(_0xc861('0x19'))['db'];function respondWithStatusCode(_0x4cf26c,_0x2b0ccd){_0x2b0ccd=_0x2b0ccd||0xcc;return function(_0x481bb1){if(_0x481bb1){return _0x4cf26c['sendStatus'](_0x2b0ccd);}return _0x4cf26c[_0xc861('0x1a')](_0x2b0ccd)['end']();};}function respondWithResult(_0x5dc63d,_0x32736d){_0x32736d=_0x32736d||0xc8;return function(_0x90cf9e){if(_0x90cf9e){return _0x5dc63d[_0xc861('0x1a')](_0x32736d)[_0xc861('0x1b')](_0x90cf9e);}};}function respondWithFilteredResult(_0x2c9681,_0x3d87cb){return function(_0xb911d1){if(_0xb911d1){var _0x472e61=typeof _0x3d87cb[_0xc861('0x1c')]===_0xc861('0x1d')&&typeof _0x3d87cb[_0xc861('0x1e')]===_0xc861('0x1d');var _0x37eb7e=_0xb911d1[_0xc861('0x1f')];var _0x1440f3=_0x472e61?0x0:_0x3d87cb[_0xc861('0x1c')];var _0x215a56=_0x472e61?_0xb911d1['count']:_0x3d87cb['offset']+_0x3d87cb[_0xc861('0x1e')];var _0x9c516;if(_0x215a56>=_0x37eb7e){_0x215a56=_0x37eb7e;_0x9c516=0xc8;}else{_0x9c516=0xce;}_0x2c9681['status'](_0x9c516);return _0x2c9681[_0xc861('0x20')](_0xc861('0x21'),_0x1440f3+'-'+_0x215a56+'/'+_0x37eb7e)[_0xc861('0x1b')](_0xb911d1);}return null;};}function patchUpdates(_0x47ca6e){return function(_0x143f26){try{jsonpatch[_0xc861('0x22')](_0x143f26,_0x47ca6e,!![]);}catch(_0x1c0e4e){return BPromise[_0xc861('0x23')](_0x1c0e4e);}return _0x143f26[_0xc861('0x24')]();};}function saveUpdates(_0x380898,_0x97f07f){return function(_0x2fa08b){if(_0x2fa08b){return _0x2fa08b[_0xc861('0x25')](_0x380898)[_0xc861('0x26')](function(_0x2aba4b){return _0x2aba4b;});}return null;};}function removeEntity(_0x411a22,_0x1a9d5e){return function(_0x618633){if(_0x618633){return _0x618633[_0xc861('0x27')]()[_0xc861('0x26')](function(){_0x411a22[_0xc861('0x1a')](0xcc)[_0xc861('0x28')]();});}};}function handleEntityNotFound(_0x541507,_0x415e00){return function(_0x2cfdfd){if(!_0x2cfdfd){_0x541507[_0xc861('0x29')](0x194);}return _0x2cfdfd;};}function handleError(_0x1acc34,_0x5ebd02){_0x5ebd02=_0x5ebd02||0x1f4;return function(_0x1213ff){logger[_0xc861('0x2a')](_0x1213ff[_0xc861('0x2b')]);if(_0x1213ff[_0xc861('0x2c')]){delete _0x1213ff[_0xc861('0x2c')];}_0x1acc34['status'](_0x5ebd02)[_0xc861('0x2d')](_0x1213ff);};}exports[_0xc861('0x2e')]=function(_0x575431,_0x36fe8e){var _0x569d3d={},_0x37cf4b={},_0x162cfb={'count':0x0,'rows':[]};var _0x205e2f=_[_0xc861('0x2f')](db[_0xc861('0x30')][_0xc861('0x31')],function(_0x1d6a2d){return{'name':_0x1d6a2d[_0xc861('0x32')],'type':_0x1d6a2d[_0xc861('0x33')][_0xc861('0x34')]};});_0x37cf4b['model']=_[_0xc861('0x2f')](_0x205e2f,_0xc861('0x2c'));_0x37cf4b['query']=_[_0xc861('0x35')](_0x575431[_0xc861('0x36')]);_0x37cf4b[_0xc861('0x37')]=_['intersection'](_0x37cf4b['model'],_0x37cf4b[_0xc861('0x36')]);_0x569d3d['attributes']=_[_0xc861('0x38')](_0x37cf4b[_0xc861('0x39')],qs['fields'](_0x575431['query'][_0xc861('0x3a')]));_0x569d3d[_0xc861('0x3b')]=_0x569d3d[_0xc861('0x3b')][_0xc861('0x3c')]?_0x569d3d[_0xc861('0x3b')]:_0x37cf4b['model'];if(!_0x575431[_0xc861('0x36')]['hasOwnProperty'](_0xc861('0x3d'))){_0x569d3d[_0xc861('0x1e')]=qs[_0xc861('0x1e')](_0x575431['query'][_0xc861('0x1e')]);_0x569d3d['offset']=qs[_0xc861('0x1c')](_0x575431[_0xc861('0x36')][_0xc861('0x1c')]);}_0x569d3d[_0xc861('0x3e')]=qs[_0xc861('0x3f')](_0x575431[_0xc861('0x36')]['sort']);_0x569d3d[_0xc861('0x40')]=qs[_0xc861('0x37')](_[_0xc861('0x41')](_0x575431['query'],_0x37cf4b[_0xc861('0x37')]),_0x205e2f);if(_0x575431[_0xc861('0x36')][_0xc861('0x42')]){_0x569d3d['where']=_[_0xc861('0x43')](_0x569d3d['where'],{'$or':_['map'](_0x205e2f,function(_0x96e4cf){if(_0x96e4cf[_0xc861('0x33')]!==_0xc861('0x44')){var _0x3a2f30={};_0x3a2f30[_0x96e4cf[_0xc861('0x2c')]]={'$like':'%'+_0x575431[_0xc861('0x36')][_0xc861('0x42')]+'%'};return _0x3a2f30;}})});}_0x569d3d=_[_0xc861('0x43')]({},_0x569d3d,_0x575431[_0xc861('0x45')]);var _0x53d5d3={'where':_0x569d3d[_0xc861('0x40')]};return db[_0xc861('0x30')][_0xc861('0x1f')](_0x53d5d3)[_0xc861('0x26')](function(_0x3f1b6d){_0x162cfb[_0xc861('0x1f')]=_0x3f1b6d;if(_0x575431[_0xc861('0x36')][_0xc861('0x46')]){_0x569d3d[_0xc861('0x47')]=[{'all':!![]}];}return db['OpenchannelTransferReport']['findAll'](_0x569d3d);})[_0xc861('0x26')](function(_0x1b09c5){_0x162cfb[_0xc861('0x48')]=_0x1b09c5;return _0x162cfb;})[_0xc861('0x26')](respondWithFilteredResult(_0x36fe8e,_0x569d3d))[_0xc861('0x49')](handleError(_0x36fe8e,null));};exports[_0xc861('0x4a')]=function(_0x26fcac,_0x2849d7){var _0x3b8564={'raw':!![],'where':{'id':_0x26fcac[_0xc861('0x4b')]['id']}},_0x5859c9={};_0x5859c9[_0xc861('0x39')]=_['keys'](db[_0xc861('0x30')][_0xc861('0x31')]);_0x5859c9[_0xc861('0x36')]=_[_0xc861('0x35')](_0x26fcac[_0xc861('0x36')]);_0x5859c9[_0xc861('0x37')]=_[_0xc861('0x38')](_0x5859c9[_0xc861('0x39')],_0x5859c9[_0xc861('0x36')]);_0x3b8564[_0xc861('0x3b')]=_[_0xc861('0x38')](_0x5859c9[_0xc861('0x39')],qs[_0xc861('0x3a')](_0x26fcac['query']['fields']));_0x3b8564[_0xc861('0x3b')]=_0x3b8564[_0xc861('0x3b')][_0xc861('0x3c')]?_0x3b8564['attributes']:_0x5859c9[_0xc861('0x39')];if(_0x26fcac[_0xc861('0x36')]['includeAll']){_0x3b8564[_0xc861('0x47')]=[{'all':!![]}];}_0x3b8564=_[_0xc861('0x43')]({},_0x3b8564,_0x26fcac[_0xc861('0x45')]);return db[_0xc861('0x30')][_0xc861('0x4c')](_0x3b8564)[_0xc861('0x26')](handleEntityNotFound(_0x2849d7,null))[_0xc861('0x26')](respondWithResult(_0x2849d7,null))[_0xc861('0x49')](handleError(_0x2849d7,null));};exports[_0xc861('0x4d')]=function(_0x6c4658,_0x2de2f5){return db['OpenchannelTransferReport'][_0xc861('0x4d')](_0x6c4658[_0xc861('0x4e')],{})[_0xc861('0x26')](respondWithResult(_0x2de2f5,0xc9))[_0xc861('0x49')](handleError(_0x2de2f5,null));};exports[_0xc861('0x25')]=function(_0x10dda0,_0x42ba13){if(_0x10dda0[_0xc861('0x4e')]['id']){delete _0x10dda0[_0xc861('0x4e')]['id'];}return db[_0xc861('0x30')][_0xc861('0x4c')]({'where':{'id':_0x10dda0[_0xc861('0x4b')]['id']}})[_0xc861('0x26')](handleEntityNotFound(_0x42ba13,null))[_0xc861('0x26')](saveUpdates(_0x10dda0[_0xc861('0x4e')],null))[_0xc861('0x26')](respondWithResult(_0x42ba13,null))['catch'](handleError(_0x42ba13,null));};exports[_0xc861('0x27')]=function(_0x194fab,_0x3304fb){return db[_0xc861('0x30')][_0xc861('0x4c')]({'where':{'id':_0x194fab[_0xc861('0x4b')]['id']}})[_0xc861('0x26')](handleEntityNotFound(_0x3304fb,null))[_0xc861('0x26')](removeEntity(_0x3304fb,null))['catch'](handleError(_0x3304fb,null));};exports[_0xc861('0x4f')]=function(_0x1f8b07,_0x17cfbe){return db[_0xc861('0x30')][_0xc861('0x4f')]()['then'](respondWithResult(_0x17cfbe,null))[_0xc861('0x49')](handleError(_0x17cfbe,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 7ecb0ae..986b5a7 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 _0xb5c8=['exports','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelTransferReport.attributes'];(function(_0x43b01a,_0x558b7e){var _0x5cd997=function(_0x2ec3ac){while(--_0x2ec3ac){_0x43b01a['push'](_0x43b01a['shift']());}};_0x5cd997(++_0x558b7e);}(_0xb5c8,0x13b));var _0x8b5c=function(_0x70f515,_0x31a8a9){_0x70f515=_0x70f515-0x0;var _0x412225=_0xb5c8[_0x70f515];return _0x412225;};'use strict';var _=require(_0x8b5c('0x0'));var util=require(_0x8b5c('0x1'));var logger=require(_0x8b5c('0x2'))(_0x8b5c('0x3'));var moment=require(_0x8b5c('0x4'));var BPromise=require(_0x8b5c('0x5'));var rp=require(_0x8b5c('0x6'));var fs=require('fs');var path=require(_0x8b5c('0x7'));var rimraf=require('rimraf');var config=require(_0x8b5c('0x8'));var attributes=require(_0x8b5c('0x9'));module[_0x8b5c('0xa')]=function(_0xd05b56,_0x5e4fff){return _0xd05b56['define']('OpenchannelTransferReport',attributes,{'tableName':_0x8b5c('0xb'),'paranoid':![],'indexes':[{'name':_0x8b5c('0xc'),'fields':[_0x8b5c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0205=['moment','bluebird','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','uniqueid','util','api'];(function(_0x364085,_0x503c2f){var _0x503044=function(_0x2c423f){while(--_0x2c423f){_0x364085['push'](_0x364085['shift']());}};_0x503044(++_0x503c2f);}(_0x0205,0xae));var _0x5020=function(_0x3ed075,_0x560ddc){_0x3ed075=_0x3ed075-0x0;var _0x3bdb0e=_0x0205[_0x3ed075];return _0x3bdb0e;};'use strict';var _=require('lodash');var util=require(_0x5020('0x0'));var logger=require('../../config/logger')(_0x5020('0x1'));var moment=require(_0x5020('0x2'));var BPromise=require(_0x5020('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5020('0x4'));var config=require(_0x5020('0x5'));var attributes=require(_0x5020('0x6'));module[_0x5020('0x7')]=function(_0x322736,_0x475fd1){return _0x322736[_0x5020('0x8')](_0x5020('0x9'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x5020('0xa'),'fields':[_0x5020('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 0bf8f2a..805745b 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 _0xf2cf=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','util','moment'];(function(_0x5a8a92,_0x575131){var _0x529197=function(_0x487af4){while(--_0x487af4){_0x5a8a92['push'](_0x5a8a92['shift']());}};_0x529197(++_0x575131);}(_0xf2cf,0xf5));var _0xff2c=function(_0x594d6c,_0x54ee23){_0x594d6c=_0x594d6c-0x0;var _0x60aef9=_0xf2cf[_0x594d6c];return _0x60aef9;};'use strict';var _=require('lodash');var util=require(_0xff2c('0x0'));var moment=require(_0xff2c('0x1'));var BPromise=require(_0xff2c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xff2c('0x3'));var db=require(_0xff2c('0x4'))['db'];var utils=require(_0xff2c('0x5'));var logger=require(_0xff2c('0x6'))(_0xff2c('0x7'));var config=require(_0xff2c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xff2c('0x9')][_0xff2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57ba3d,_0x21c5a5,_0x223a86){return new BPromise(function(_0x105f4d,_0x7ba107){return client[_0xff2c('0xb')](_0x57ba3d,_0x223a86)[_0xff2c('0xc')](function(_0x133ee9){logger['info'](_0xff2c('0xd'),_0x21c5a5,_0xff2c('0xe'));logger[_0xff2c('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x21c5a5,_0xff2c('0xe'),JSON[_0xff2c('0x10')](_0x133ee9));if(_0x133ee9[_0xff2c('0x11')]){if(_0x133ee9['error']['code']===0x1f4){logger[_0xff2c('0x11')](_0xff2c('0xd'),_0x21c5a5,_0x133ee9['error'][_0xff2c('0x12')]);return _0x7ba107(_0x133ee9['error']['message']);}logger[_0xff2c('0x11')](_0xff2c('0xd'),_0x21c5a5,_0x133ee9[_0xff2c('0x11')][_0xff2c('0x12')]);return _0x105f4d(_0x133ee9['error'][_0xff2c('0x12')]);}else{logger['info'](_0xff2c('0xd'),_0x21c5a5,_0xff2c('0xe'));_0x105f4d(_0x133ee9['result']['message']);}})['catch'](function(_0x31cec8){logger[_0xff2c('0x11')](_0xff2c('0xd'),_0x21c5a5,_0x31cec8);_0x7ba107(_0x31cec8);});});} \ No newline at end of file +var _0x3c17=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','randomstring'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x3c17,0x1a1));var _0x73c1=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x3c17[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x73c1('0x0'));var util=require('util');var moment=require(_0x73c1('0x1'));var BPromise=require('bluebird');var rs=require(_0x73c1('0x2'));var fs=require('fs');var Redis=require(_0x73c1('0x3'));var db=require(_0x73c1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x73c1('0x5'))(_0x73c1('0x6'));var config=require(_0x73c1('0x7'));var jayson=require(_0x73c1('0x8'));var client=jayson['client'][_0x73c1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x58151c,_0x4433e0,_0x42ca06){return new BPromise(function(_0x422176,_0x5155aa){return client['request'](_0x58151c,_0x42ca06)[_0x73c1('0xa')](function(_0x2eb6fe){logger[_0x73c1('0xb')](_0x73c1('0xc'),_0x4433e0,_0x73c1('0xd'));logger[_0x73c1('0xe')](_0x73c1('0xf'),_0x4433e0,'request\x20sent',JSON['stringify'](_0x2eb6fe));if(_0x2eb6fe[_0x73c1('0x10')]){if(_0x2eb6fe[_0x73c1('0x10')][_0x73c1('0x11')]===0x1f4){logger[_0x73c1('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4433e0,_0x2eb6fe[_0x73c1('0x10')]['message']);return _0x5155aa(_0x2eb6fe[_0x73c1('0x10')]['message']);}logger[_0x73c1('0x10')](_0x73c1('0xc'),_0x4433e0,_0x2eb6fe['error']['message']);return _0x422176(_0x2eb6fe[_0x73c1('0x10')]['message']);}else{logger[_0x73c1('0xb')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4433e0,_0x73c1('0xd'));_0x422176(_0x2eb6fe['result'][_0x73c1('0x12')]);}})[_0x73c1('0x13')](function(_0x39256e){logger[_0x73c1('0x10')](_0x73c1('0xc'),_0x4433e0,_0x39256e);_0x5155aa(_0x39256e);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 044ade0..c1777a9 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 _0xd3e1=['post','put','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show'];(function(_0x1c45cd,_0x22f191){var _0xf15841=function(_0x4464a4){while(--_0x4464a4){_0x1c45cd['push'](_0x1c45cd['shift']());}};_0xf15841(++_0x22f191);}(_0xd3e1,0x134));var _0x1d3e=function(_0x5d0676,_0x46ec03){_0x5d0676=_0x5d0676-0x0;var _0x43b551=_0xd3e1[_0x5d0676];return _0x43b551;};'use strict';var multer=require('multer');var util=require(_0x1d3e('0x0'));var path=require(_0x1d3e('0x1'));var timeout=require(_0x1d3e('0x2'));var express=require(_0x1d3e('0x3'));var router=express[_0x1d3e('0x4')]();var fs_extra=require(_0x1d3e('0x5'));var auth=require(_0x1d3e('0x6'));var interaction=require(_0x1d3e('0x7'));var config=require(_0x1d3e('0x8'));var controller=require(_0x1d3e('0x9'));router[_0x1d3e('0xa')]('/',auth[_0x1d3e('0xb')](),controller[_0x1d3e('0xc')]);router[_0x1d3e('0xa')](_0x1d3e('0xd'),auth[_0x1d3e('0xb')](),controller[_0x1d3e('0xe')]);router[_0x1d3e('0xf')]('/',auth[_0x1d3e('0xb')](),controller['create']);router[_0x1d3e('0x10')](_0x1d3e('0xd'),auth[_0x1d3e('0xb')](),controller[_0x1d3e('0x11')]);router['delete'](_0x1d3e('0xd'),auth[_0x1d3e('0xb')](),controller['destroy']);module[_0x1d3e('0x12')]=router; \ No newline at end of file +var _0xa747=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated','index','get','/:id','show','post','create','put','delete','destroy','multer','util','connect-timeout'];(function(_0x48b3fc,_0x94e22e){var _0x3cf3fe=function(_0x234636){while(--_0x234636){_0x48b3fc['push'](_0x48b3fc['shift']());}};_0x3cf3fe(++_0x94e22e);}(_0xa747,0x12f));var _0x7a74=function(_0x5322a8,_0x2f0e07){_0x5322a8=_0x5322a8-0x0;var _0x485e82=_0xa747[_0x5322a8];return _0x485e82;};'use strict';var multer=require(_0x7a74('0x0'));var util=require(_0x7a74('0x1'));var path=require('path');var timeout=require(_0x7a74('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7a74('0x3'));var auth=require(_0x7a74('0x4'));var interaction=require(_0x7a74('0x5'));var config=require(_0x7a74('0x6'));var controller=require(_0x7a74('0x7'));router['get']('/',auth[_0x7a74('0x8')](),controller[_0x7a74('0x9')]);router[_0x7a74('0xa')](_0x7a74('0xb'),auth[_0x7a74('0x8')](),controller[_0x7a74('0xc')]);router[_0x7a74('0xd')]('/',auth[_0x7a74('0x8')](),controller[_0x7a74('0xe')]);router[_0x7a74('0xf')](_0x7a74('0xb'),auth[_0x7a74('0x8')](),controller['update']);router[_0x7a74('0x10')](_0x7a74('0xb'),auth[_0x7a74('0x8')](),controller[_0x7a74('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 19f4022..e871e38 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 _0x5f42=['STRING','name'];(function(_0x45bb6e,_0x2e0225){var _0x4cc30a=function(_0x4b4896){while(--_0x4b4896){_0x45bb6e['push'](_0x45bb6e['shift']());}};_0x4cc30a(++_0x2e0225);}(_0x5f42,0xc6));var _0x25f4=function(_0x3886a7,_0x5b5e04){_0x3886a7=_0x3886a7-0x0;var _0x130198=_0x5f42[_0x3886a7];return _0x130198;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x25f4('0x0')],'unique':_0x25f4('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x25f4('0x0')]}}; \ No newline at end of file +var _0xaec6=['STRING','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xaec6,0x1ae));var _0x6aec=function(_0x13e0dd,_0x54ccc6){_0x13e0dd=_0x13e0dd-0x0;var _0xa43c16=_0xaec6[_0x13e0dd];return _0xa43c16;};'use strict';var Sequelize=require(_0x6aec('0x0'));module[_0x6aec('0x1')]={'name':{'type':Sequelize[_0x6aec('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x6aec('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index bce049f..9096c19 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 _0x4393=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','Pauses','UserProfileResource','destroy','error','stack','name','map','Pause','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','find','create','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x2cb860,_0x2ab949){var _0x35c787=function(_0x21c895){while(--_0x21c895){_0x2cb860['push'](_0x2cb860['shift']());}};_0x35c787(++_0x2ab949);}(_0x4393,0xf8));var _0x3439=function(_0xbdd169,_0x1774c5){_0xbdd169=_0xbdd169-0x0;var _0x11d22a=_0x4393[_0xbdd169];return _0x11d22a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3439('0x0'));var zipdir=require(_0x3439('0x1'));var jsonpatch=require(_0x3439('0x2'));var rp=require(_0x3439('0x3'));var moment=require(_0x3439('0x4'));var BPromise=require(_0x3439('0x5'));var Mustache=require('mustache');var util=require(_0x3439('0x6'));var path=require(_0x3439('0x7'));var sox=require(_0x3439('0x8'));var csv=require(_0x3439('0x9'));var ejs=require(_0x3439('0xa'));var fs=require('fs');var fs_extra=require(_0x3439('0xb'));var _=require(_0x3439('0xc'));var squel=require('squel');var crypto=require(_0x3439('0xd'));var jsforce=require(_0x3439('0xe'));var deskjs=require(_0x3439('0xf'));var toCsv=require(_0x3439('0x9'));var querystring=require(_0x3439('0x10'));var Papa=require(_0x3439('0x11'));var Redis=require(_0x3439('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3439('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3439('0x14'));var logger=require('../../config/logger')(_0x3439('0x15'));var utils=require(_0x3439('0x16'));var config=require(_0x3439('0x17'));var licenseUtil=require(_0x3439('0x18'));var db=require(_0x3439('0x19'))['db'];function respondWithStatusCode(_0x4e878f,_0x4ca7ca){_0x4ca7ca=_0x4ca7ca||0xcc;return function(_0x390f62){if(_0x390f62){return _0x4e878f[_0x3439('0x1a')](_0x4ca7ca);}return _0x4e878f[_0x3439('0x1b')](_0x4ca7ca)[_0x3439('0x1c')]();};}function respondWithResult(_0x17f06b,_0x4afc87){_0x4afc87=_0x4afc87||0xc8;return function(_0x186e6f){if(_0x186e6f){return _0x17f06b[_0x3439('0x1b')](_0x4afc87)[_0x3439('0x1d')](_0x186e6f);}};}function respondWithFilteredResult(_0x82edd5,_0x1bc2cf){return function(_0x12df6e){if(_0x12df6e){var _0x1a35b9=typeof _0x1bc2cf[_0x3439('0x1e')]==='undefined'&&typeof _0x1bc2cf[_0x3439('0x1f')]===_0x3439('0x20');var _0x5a6f80=_0x12df6e['count'];var _0x529b23=_0x1a35b9?0x0:_0x1bc2cf[_0x3439('0x1e')];var _0x5f8669=_0x1a35b9?_0x12df6e[_0x3439('0x21')]:_0x1bc2cf['offset']+_0x1bc2cf[_0x3439('0x1f')];var _0x5f7890;if(_0x5f8669>=_0x5a6f80){_0x5f8669=_0x5a6f80;_0x5f7890=0xc8;}else{_0x5f7890=0xce;}_0x82edd5[_0x3439('0x1b')](_0x5f7890);return _0x82edd5[_0x3439('0x22')](_0x3439('0x23'),_0x529b23+'-'+_0x5f8669+'/'+_0x5a6f80)[_0x3439('0x1d')](_0x12df6e);}return null;};}function patchUpdates(_0x229d6d){return function(_0x321482){try{jsonpatch['apply'](_0x321482,_0x229d6d,!![]);}catch(_0xbfa7c9){return BPromise[_0x3439('0x24')](_0xbfa7c9);}return _0x321482[_0x3439('0x25')]();};}function saveUpdates(_0x5d3125,_0x19bc5a){return function(_0x46dbd4){if(_0x46dbd4){return _0x46dbd4[_0x3439('0x26')](_0x5d3125)[_0x3439('0x27')](function(_0x3356f7){return _0x3356f7;});}return null;};}function removeEntity(_0x3a5d84,_0x244f74){return function(_0x549814){if(_0x549814){return _0x549814['destroy']()['then'](function(){var _0x4a4524=_0x549814[_0x3439('0x28')]({'plain':!![]});var _0x548cbd=_0x3439('0x29');return db[_0x3439('0x2a')][_0x3439('0x2b')]({'where':{'type':_0x548cbd,'resourceId':_0x4a4524['id']}})[_0x3439('0x27')](function(){return _0x549814;});})[_0x3439('0x27')](function(){_0x3a5d84['status'](0xcc)[_0x3439('0x1c')]();});}};}function handleEntityNotFound(_0x1f686c,_0x569fdb){return function(_0x4fbd37){if(!_0x4fbd37){_0x1f686c[_0x3439('0x1a')](0x194);}return _0x4fbd37;};}function handleError(_0x285fd8,_0x2e3086){_0x2e3086=_0x2e3086||0x1f4;return function(_0x1d951f){logger[_0x3439('0x2c')](_0x1d951f[_0x3439('0x2d')]);if(_0x1d951f[_0x3439('0x2e')]){delete _0x1d951f[_0x3439('0x2e')];}_0x285fd8[_0x3439('0x1b')](_0x2e3086)['send'](_0x1d951f);};}exports['index']=function(_0x2c40ce,_0x27844b){var _0x5a8269={},_0x39831e={},_0x33fd75={'count':0x0,'rows':[]};var _0x47af01=_[_0x3439('0x2f')](db[_0x3439('0x30')][_0x3439('0x31')],function(_0x364352){return{'name':_0x364352['fieldName'],'type':_0x364352[_0x3439('0x32')][_0x3439('0x33')]};});_0x39831e[_0x3439('0x34')]=_[_0x3439('0x2f')](_0x47af01,'name');_0x39831e['query']=_[_0x3439('0x35')](_0x2c40ce[_0x3439('0x36')]);_0x39831e[_0x3439('0x37')]=_[_0x3439('0x38')](_0x39831e[_0x3439('0x34')],_0x39831e[_0x3439('0x36')]);_0x5a8269['attributes']=_['intersection'](_0x39831e[_0x3439('0x34')],qs[_0x3439('0x39')](_0x2c40ce[_0x3439('0x36')][_0x3439('0x39')]));_0x5a8269['attributes']=_0x5a8269[_0x3439('0x3a')][_0x3439('0x3b')]?_0x5a8269['attributes']:_0x39831e['model'];if(!_0x2c40ce[_0x3439('0x36')][_0x3439('0x3c')](_0x3439('0x3d'))){_0x5a8269[_0x3439('0x1f')]=qs[_0x3439('0x1f')](_0x2c40ce[_0x3439('0x36')][_0x3439('0x1f')]);_0x5a8269[_0x3439('0x1e')]=qs[_0x3439('0x1e')](_0x2c40ce[_0x3439('0x36')][_0x3439('0x1e')]);}_0x5a8269[_0x3439('0x3e')]=qs[_0x3439('0x3f')](_0x2c40ce['query']['sort']);_0x5a8269['where']=qs[_0x3439('0x37')](_[_0x3439('0x40')](_0x2c40ce[_0x3439('0x36')],_0x39831e[_0x3439('0x37')]),_0x47af01);if(_0x2c40ce[_0x3439('0x36')][_0x3439('0x41')]){_0x5a8269[_0x3439('0x42')]=_[_0x3439('0x43')](_0x5a8269[_0x3439('0x42')],{'$or':_['map'](_0x47af01,function(_0x2026a8){if(_0x2026a8[_0x3439('0x32')]!==_0x3439('0x44')){var _0x186ca8={};_0x186ca8[_0x2026a8['name']]={'$like':'%'+_0x2c40ce[_0x3439('0x36')]['filter']+'%'};return _0x186ca8;}})});}_0x5a8269=_[_0x3439('0x43')]({},_0x5a8269,_0x2c40ce['options']);var _0x524e6a={'where':_0x5a8269[_0x3439('0x42')]};return db[_0x3439('0x30')]['count'](_0x524e6a)[_0x3439('0x27')](function(_0x2373be){_0x33fd75[_0x3439('0x21')]=_0x2373be;if(_0x2c40ce['query'][_0x3439('0x45')]){_0x5a8269['include']=[{'all':!![]}];}return db[_0x3439('0x30')][_0x3439('0x46')](_0x5a8269);})[_0x3439('0x27')](function(_0x5636b1){_0x33fd75[_0x3439('0x47')]=_0x5636b1;return _0x33fd75;})[_0x3439('0x27')](respondWithFilteredResult(_0x27844b,_0x5a8269))[_0x3439('0x48')](handleError(_0x27844b,null));};exports[_0x3439('0x49')]=function(_0x4049b8,_0xc8baf7){var _0x538265={'raw':!![],'where':{'id':_0x4049b8[_0x3439('0x4a')]['id']}},_0x478dd7={};_0x478dd7['model']=_[_0x3439('0x35')](db['Pause'][_0x3439('0x31')]);_0x478dd7[_0x3439('0x36')]=_['keys'](_0x4049b8[_0x3439('0x36')]);_0x478dd7['filters']=_['intersection'](_0x478dd7[_0x3439('0x34')],_0x478dd7['query']);_0x538265[_0x3439('0x3a')]=_[_0x3439('0x38')](_0x478dd7[_0x3439('0x34')],qs[_0x3439('0x39')](_0x4049b8[_0x3439('0x36')][_0x3439('0x39')]));_0x538265['attributes']=_0x538265[_0x3439('0x3a')][_0x3439('0x3b')]?_0x538265[_0x3439('0x3a')]:_0x478dd7[_0x3439('0x34')];if(_0x4049b8[_0x3439('0x36')][_0x3439('0x45')]){_0x538265[_0x3439('0x4b')]=[{'all':!![]}];}_0x538265=_[_0x3439('0x43')]({},_0x538265,_0x4049b8['options']);return db[_0x3439('0x30')][_0x3439('0x4c')](_0x538265)[_0x3439('0x27')](handleEntityNotFound(_0xc8baf7,null))[_0x3439('0x27')](respondWithResult(_0xc8baf7,null))[_0x3439('0x48')](handleError(_0xc8baf7,null));};exports[_0x3439('0x4d')]=function(_0x5e3561,_0x8bd623){return db['Pause'][_0x3439('0x4d')](_0x5e3561['body'],{})[_0x3439('0x27')](function(_0x4a4015){var _0x5b81fc=_0x5e3561['user'][_0x3439('0x28')]({'plain':!![]});if(!_0x5b81fc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b81fc[_0x3439('0x4e')]===_0x3439('0x4f')){var _0x11eb5b=_0x4a4015[_0x3439('0x28')]({'plain':!![]});var _0x192f0d=_0x3439('0x29');return db[_0x3439('0x50')]['find']({'where':{'name':_0x192f0d,'userProfileId':_0x5b81fc[_0x3439('0x51')]},'raw':!![]})[_0x3439('0x27')](function(_0x3b61ec){if(_0x3b61ec&&_0x3b61ec[_0x3439('0x52')]===0x0){return db[_0x3439('0x2a')][_0x3439('0x4d')]({'name':_0x11eb5b['name'],'resourceId':_0x11eb5b['id'],'type':_0x3b61ec[_0x3439('0x2e')],'sectionId':_0x3b61ec['id']},{})['then'](function(){return _0x4a4015;});}else{return _0x4a4015;}})['catch'](function(_0x2da19d){logger[_0x3439('0x2c')](_0x3439('0x53'),_0x2da19d);throw _0x2da19d;});}return _0x4a4015;})['then'](respondWithResult(_0x8bd623,0xc9))[_0x3439('0x48')](handleError(_0x8bd623,null));};exports[_0x3439('0x26')]=function(_0x497025,_0x567f4b){if(_0x497025[_0x3439('0x54')]['id']){delete _0x497025['body']['id'];}return db[_0x3439('0x30')][_0x3439('0x4c')]({'where':{'id':_0x497025[_0x3439('0x4a')]['id']}})[_0x3439('0x27')](handleEntityNotFound(_0x567f4b,null))[_0x3439('0x27')](saveUpdates(_0x497025[_0x3439('0x54')],null))[_0x3439('0x27')](respondWithResult(_0x567f4b,null))[_0x3439('0x48')](handleError(_0x567f4b,null));};exports[_0x3439('0x2b')]=function(_0x2dbbab,_0x2a78ac){return db[_0x3439('0x30')]['find']({'where':{'id':_0x2dbbab[_0x3439('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2a78ac,null))[_0x3439('0x27')](removeEntity(_0x2a78ac,null))['catch'](handleError(_0x2a78ac,null));}; \ No newline at end of file +var _0xe933=['json','apply','reject','then','destroy','get','Pauses','error','stack','name','send','index','type','map','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Pause','includeAll','include','catch','show','params','rawAttributes','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range'];(function(_0x40fbee,_0x268f74){var _0x1d93e8=function(_0x55b3c1){while(--_0x55b3c1){_0x40fbee['push'](_0x40fbee['shift']());}};_0x1d93e8(++_0x268f74);}(_0xe933,0x1d5));var _0x3e93=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xe933[_0x4fbfd9];return _0x31dc94;};'use strict';var emlformat=require(_0x3e93('0x0'));var rimraf=require(_0x3e93('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3e93('0x2'));var rp=require(_0x3e93('0x3'));var moment=require(_0x3e93('0x4'));var BPromise=require(_0x3e93('0x5'));var Mustache=require(_0x3e93('0x6'));var util=require(_0x3e93('0x7'));var path=require(_0x3e93('0x8'));var sox=require(_0x3e93('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e93('0xa'));var _=require(_0x3e93('0xb'));var squel=require(_0x3e93('0xc'));var crypto=require(_0x3e93('0xd'));var jsforce=require(_0x3e93('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3e93('0xf'));var querystring=require('querystring');var Papa=require(_0x3e93('0x10'));var Redis=require(_0x3e93('0x11'));var authService=require(_0x3e93('0x12'));var qs=require(_0x3e93('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e93('0x14'));var logger=require(_0x3e93('0x15'))(_0x3e93('0x16'));var utils=require(_0x3e93('0x17'));var config=require(_0x3e93('0x18'));var licenseUtil=require(_0x3e93('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2cd0a8,_0x409ebf){_0x409ebf=_0x409ebf||0xcc;return function(_0x1a6d77){if(_0x1a6d77){return _0x2cd0a8[_0x3e93('0x1a')](_0x409ebf);}return _0x2cd0a8[_0x3e93('0x1b')](_0x409ebf)[_0x3e93('0x1c')]();};}function respondWithResult(_0xc9250e,_0x1f0074){_0x1f0074=_0x1f0074||0xc8;return function(_0x2a6d5f){if(_0x2a6d5f){return _0xc9250e[_0x3e93('0x1b')](_0x1f0074)['json'](_0x2a6d5f);}};}function respondWithFilteredResult(_0x195c79,_0x233521){return function(_0xa97680){if(_0xa97680){var _0x96eeec=typeof _0x233521[_0x3e93('0x1d')]===_0x3e93('0x1e')&&typeof _0x233521[_0x3e93('0x1f')]===_0x3e93('0x1e');var _0x248c10=_0xa97680[_0x3e93('0x20')];var _0x4908ca=_0x96eeec?0x0:_0x233521['offset'];var _0x3d4d92=_0x96eeec?_0xa97680[_0x3e93('0x20')]:_0x233521[_0x3e93('0x1d')]+_0x233521[_0x3e93('0x1f')];var _0x4cbdd9;if(_0x3d4d92>=_0x248c10){_0x3d4d92=_0x248c10;_0x4cbdd9=0xc8;}else{_0x4cbdd9=0xce;}_0x195c79['status'](_0x4cbdd9);return _0x195c79[_0x3e93('0x21')](_0x3e93('0x22'),_0x4908ca+'-'+_0x3d4d92+'/'+_0x248c10)[_0x3e93('0x23')](_0xa97680);}return null;};}function patchUpdates(_0x5e4673){return function(_0x2e648d){try{jsonpatch[_0x3e93('0x24')](_0x2e648d,_0x5e4673,!![]);}catch(_0x186201){return BPromise[_0x3e93('0x25')](_0x186201);}return _0x2e648d['save']();};}function saveUpdates(_0x20ac1f,_0x4a51f){return function(_0x56651f){if(_0x56651f){return _0x56651f['update'](_0x20ac1f)[_0x3e93('0x26')](function(_0x146ff3){return _0x146ff3;});}return null;};}function removeEntity(_0x41cfda,_0x2bd738){return function(_0x5980c2){if(_0x5980c2){return _0x5980c2[_0x3e93('0x27')]()[_0x3e93('0x26')](function(){var _0x1b295a=_0x5980c2[_0x3e93('0x28')]({'plain':!![]});var _0x8b44b2=_0x3e93('0x29');return db['UserProfileResource'][_0x3e93('0x27')]({'where':{'type':_0x8b44b2,'resourceId':_0x1b295a['id']}})[_0x3e93('0x26')](function(){return _0x5980c2;});})[_0x3e93('0x26')](function(){_0x41cfda[_0x3e93('0x1b')](0xcc)[_0x3e93('0x1c')]();});}};}function handleEntityNotFound(_0x428270,_0x2b4f5d){return function(_0x44f907){if(!_0x44f907){_0x428270[_0x3e93('0x1a')](0x194);}return _0x44f907;};}function handleError(_0x55fa38,_0x94f1dd){_0x94f1dd=_0x94f1dd||0x1f4;return function(_0x4f3cbd){logger[_0x3e93('0x2a')](_0x4f3cbd[_0x3e93('0x2b')]);if(_0x4f3cbd[_0x3e93('0x2c')]){delete _0x4f3cbd[_0x3e93('0x2c')];}_0x55fa38['status'](_0x94f1dd)[_0x3e93('0x2d')](_0x4f3cbd);};}exports[_0x3e93('0x2e')]=function(_0x460fbd,_0x42ad97){var _0x41419b={},_0x4a0dbd={},_0x1ae7d1={'count':0x0,'rows':[]};var _0x286f5=_['map'](db['Pause']['rawAttributes'],function(_0x52dd7e){return{'name':_0x52dd7e['fieldName'],'type':_0x52dd7e[_0x3e93('0x2f')]['key']};});_0x4a0dbd['model']=_[_0x3e93('0x30')](_0x286f5,_0x3e93('0x2c'));_0x4a0dbd[_0x3e93('0x31')]=_[_0x3e93('0x32')](_0x460fbd[_0x3e93('0x31')]);_0x4a0dbd['filters']=_[_0x3e93('0x33')](_0x4a0dbd[_0x3e93('0x34')],_0x4a0dbd[_0x3e93('0x31')]);_0x41419b['attributes']=_[_0x3e93('0x33')](_0x4a0dbd[_0x3e93('0x34')],qs['fields'](_0x460fbd[_0x3e93('0x31')][_0x3e93('0x35')]));_0x41419b[_0x3e93('0x36')]=_0x41419b['attributes'][_0x3e93('0x37')]?_0x41419b[_0x3e93('0x36')]:_0x4a0dbd['model'];if(!_0x460fbd['query'][_0x3e93('0x38')](_0x3e93('0x39'))){_0x41419b[_0x3e93('0x1f')]=qs[_0x3e93('0x1f')](_0x460fbd[_0x3e93('0x31')]['limit']);_0x41419b[_0x3e93('0x1d')]=qs[_0x3e93('0x1d')](_0x460fbd[_0x3e93('0x31')][_0x3e93('0x1d')]);}_0x41419b[_0x3e93('0x3a')]=qs[_0x3e93('0x3b')](_0x460fbd['query'][_0x3e93('0x3b')]);_0x41419b[_0x3e93('0x3c')]=qs[_0x3e93('0x3d')](_[_0x3e93('0x3e')](_0x460fbd[_0x3e93('0x31')],_0x4a0dbd[_0x3e93('0x3d')]),_0x286f5);if(_0x460fbd[_0x3e93('0x31')][_0x3e93('0x3f')]){_0x41419b[_0x3e93('0x3c')]=_[_0x3e93('0x40')](_0x41419b[_0x3e93('0x3c')],{'$or':_[_0x3e93('0x30')](_0x286f5,function(_0x143f00){if(_0x143f00[_0x3e93('0x2f')]!==_0x3e93('0x41')){var _0x35668e={};_0x35668e[_0x143f00[_0x3e93('0x2c')]]={'$like':'%'+_0x460fbd['query']['filter']+'%'};return _0x35668e;}})});}_0x41419b=_[_0x3e93('0x40')]({},_0x41419b,_0x460fbd[_0x3e93('0x42')]);var _0x4b77a6={'where':_0x41419b[_0x3e93('0x3c')]};return db[_0x3e93('0x43')][_0x3e93('0x20')](_0x4b77a6)[_0x3e93('0x26')](function(_0x5b026e){_0x1ae7d1[_0x3e93('0x20')]=_0x5b026e;if(_0x460fbd[_0x3e93('0x31')][_0x3e93('0x44')]){_0x41419b[_0x3e93('0x45')]=[{'all':!![]}];}return db[_0x3e93('0x43')]['findAll'](_0x41419b);})['then'](function(_0x2d9ed8){_0x1ae7d1['rows']=_0x2d9ed8;return _0x1ae7d1;})[_0x3e93('0x26')](respondWithFilteredResult(_0x42ad97,_0x41419b))[_0x3e93('0x46')](handleError(_0x42ad97,null));};exports[_0x3e93('0x47')]=function(_0x3e96c5,_0x244502){var _0x51de48={'raw':!![],'where':{'id':_0x3e96c5[_0x3e93('0x48')]['id']}},_0x5e284e={};_0x5e284e[_0x3e93('0x34')]=_[_0x3e93('0x32')](db['Pause'][_0x3e93('0x49')]);_0x5e284e['query']=_[_0x3e93('0x32')](_0x3e96c5[_0x3e93('0x31')]);_0x5e284e[_0x3e93('0x3d')]=_[_0x3e93('0x33')](_0x5e284e[_0x3e93('0x34')],_0x5e284e[_0x3e93('0x31')]);_0x51de48['attributes']=_[_0x3e93('0x33')](_0x5e284e[_0x3e93('0x34')],qs[_0x3e93('0x35')](_0x3e96c5[_0x3e93('0x31')][_0x3e93('0x35')]));_0x51de48['attributes']=_0x51de48[_0x3e93('0x36')][_0x3e93('0x37')]?_0x51de48[_0x3e93('0x36')]:_0x5e284e[_0x3e93('0x34')];if(_0x3e96c5[_0x3e93('0x31')][_0x3e93('0x44')]){_0x51de48[_0x3e93('0x45')]=[{'all':!![]}];}_0x51de48=_[_0x3e93('0x40')]({},_0x51de48,_0x3e96c5[_0x3e93('0x42')]);return db[_0x3e93('0x43')][_0x3e93('0x4a')](_0x51de48)['then'](handleEntityNotFound(_0x244502,null))[_0x3e93('0x26')](respondWithResult(_0x244502,null))[_0x3e93('0x46')](handleError(_0x244502,null));};exports['create']=function(_0x416fa7,_0x5cd886){return db['Pause']['create'](_0x416fa7[_0x3e93('0x4b')],{})[_0x3e93('0x26')](function(_0x1ccc90){var _0x342b89=_0x416fa7[_0x3e93('0x4c')][_0x3e93('0x28')]({'plain':!![]});if(!_0x342b89)throw new Error(_0x3e93('0x4d'));if(_0x342b89[_0x3e93('0x4e')]===_0x3e93('0x4c')){var _0xb34c59=_0x1ccc90[_0x3e93('0x28')]({'plain':!![]});var _0x1678c7=_0x3e93('0x29');return db['UserProfileSection'][_0x3e93('0x4a')]({'where':{'name':_0x1678c7,'userProfileId':_0x342b89[_0x3e93('0x4f')]},'raw':!![]})[_0x3e93('0x26')](function(_0x39be3c){if(_0x39be3c&&_0x39be3c[_0x3e93('0x50')]===0x0){return db[_0x3e93('0x51')][_0x3e93('0x52')]({'name':_0xb34c59[_0x3e93('0x2c')],'resourceId':_0xb34c59['id'],'type':_0x39be3c[_0x3e93('0x2c')],'sectionId':_0x39be3c['id']},{})[_0x3e93('0x26')](function(){return _0x1ccc90;});}else{return _0x1ccc90;}})[_0x3e93('0x46')](function(_0x33b72b){logger['error'](_0x3e93('0x53'),_0x33b72b);throw _0x33b72b;});}return _0x1ccc90;})[_0x3e93('0x26')](respondWithResult(_0x5cd886,0xc9))['catch'](handleError(_0x5cd886,null));};exports['update']=function(_0x2413f5,_0x3fb741){if(_0x2413f5['body']['id']){delete _0x2413f5[_0x3e93('0x4b')]['id'];}return db[_0x3e93('0x43')][_0x3e93('0x4a')]({'where':{'id':_0x2413f5[_0x3e93('0x48')]['id']}})['then'](handleEntityNotFound(_0x3fb741,null))[_0x3e93('0x26')](saveUpdates(_0x2413f5['body'],null))[_0x3e93('0x26')](respondWithResult(_0x3fb741,null))[_0x3e93('0x46')](handleError(_0x3fb741,null));};exports['destroy']=function(_0x4c3d0b,_0x572125){return db['Pause']['find']({'where':{'id':_0x4c3d0b[_0x3e93('0x48')]['id']}})[_0x3e93('0x26')](handleEntityNotFound(_0x572125,null))[_0x3e93('0x26')](removeEntity(_0x572125,null))[_0x3e93('0x46')](handleError(_0x572125,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 2c33ec8..ea90ff7 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 _0xe14b=['bluebird','path','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','moment'];(function(_0x46c379,_0x34e32a){var _0x2ddbee=function(_0x49254e){while(--_0x49254e){_0x46c379['push'](_0x46c379['shift']());}};_0x2ddbee(++_0x34e32a);}(_0xe14b,0x93));var _0xbe14=function(_0x15c929,_0x2b3902){_0x15c929=_0x15c929-0x0;var _0x518d15=_0xe14b[_0x15c929];return _0x518d15;};'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 _0x814b=['define','Pause','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./pause.attributes','exports'];(function(_0xcd0863,_0x324520){var _0x4de5a6=function(_0x4ad6f6){while(--_0x4ad6f6){_0xcd0863['push'](_0xcd0863['shift']());}};_0x4de5a6(++_0x324520);}(_0x814b,0x1a2));var _0xb814=function(_0x4105a8,_0x198324){_0x4105a8=_0x4105a8-0x0;var _0x553f0c=_0x814b[_0x4105a8];return _0x553f0c;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index d325941..b3836ba 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 _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x473980,_0x3eb32a){var _0x48d151=function(_0x1a7c9d){while(--_0x1a7c9d){_0x473980['push'](_0x473980['shift']());}};_0x48d151(++_0x3eb32a);}(_0x7a54,0x106));var _0x47a5=function(_0x592ff9,_0x2ff160){_0x592ff9=_0x592ff9-0x0;var _0x476c14=_0x7a54[_0x592ff9];return _0x476c14;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x207ba9,_0x2fcb58){var _0x1af48b=function(_0x86a160){while(--_0x86a160){_0x207ba9['push'](_0x207ba9['shift']());}};_0x1af48b(++_0x2fcb58);}(_0xb10b,0x12a));var _0xbb10=function(_0x15cdcb,_0x4340e9){_0x15cdcb=_0x15cdcb-0x0;var _0x37b069=_0xb10b[_0x15cdcb];return _0x37b069;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 0d74b38..94f59f6 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 _0xda55=['diskStorage','join','server/files/plugins','originalname','replace','format','%s-%s%s','now','extname','post','single','file','webhookPost','put','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','isAuthenticated','get','/webhook','webhookGet','/:id','show','download'];(function(_0x436df1,_0x44526c){var _0x2dda9a=function(_0x536310){while(--_0x536310){_0x436df1['push'](_0x436df1['shift']());}};_0x2dda9a(++_0x44526c);}(_0xda55,0x6d));var _0x5da5=function(_0x3f7d24,_0x3ce1d5){_0x3f7d24=_0x3f7d24-0x0;var _0x143f6e=_0xda55[_0x3f7d24];return _0x143f6e;};'use strict';var multer=require(_0x5da5('0x0'));var util=require(_0x5da5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5da5('0x2'));var router=express[_0x5da5('0x3')]();var fs_extra=require(_0x5da5('0x4'));var auth=require(_0x5da5('0x5'));var interaction=require(_0x5da5('0x6'));var config=require('../../config/environment');var controller=require(_0x5da5('0x7'));router['get']('/',auth[_0x5da5('0x8')](),controller['index']);router[_0x5da5('0x9')](_0x5da5('0xa'),controller[_0x5da5('0xb')]);router[_0x5da5('0x9')](_0x5da5('0xc'),auth[_0x5da5('0x8')](),controller[_0x5da5('0xd')]);router[_0x5da5('0x9')]('/:id/download',auth[_0x5da5('0x8')](),controller[_0x5da5('0xe')]);var upload=multer({'storage':multer[_0x5da5('0xf')]({'destination':function(_0x26fbe3,_0x1a047e,_0x2a361c){_0x2a361c(null,path[_0x5da5('0x10')](config['root'],_0x5da5('0x11')));},'filename':function(_0x3b5ff9,_0x4f813b,_0x37aeb0){_0x4f813b[_0x5da5('0x12')]=_0x4f813b[_0x5da5('0x12')][_0x5da5('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x37aeb0(null,util[_0x5da5('0x14')](_0x5da5('0x15'),path['basename'](_0x4f813b['originalname'],path['extname'](_0x4f813b[_0x5da5('0x12')])),Date[_0x5da5('0x16')](),path[_0x5da5('0x17')](_0x4f813b[_0x5da5('0x12')])));}})});router[_0x5da5('0x18')]('/',upload[_0x5da5('0x19')](_0x5da5('0x1a')),controller['upload']);router[_0x5da5('0x18')](_0x5da5('0xa'),controller[_0x5da5('0x1b')]);router[_0x5da5('0x1c')](_0x5da5('0xc'),auth[_0x5da5('0x8')](),controller['update']);router[_0x5da5('0x1d')](_0x5da5('0xc'),auth[_0x5da5('0x8')](),controller[_0x5da5('0x1d')]);module[_0x5da5('0x1e')]=router; \ No newline at end of file +var _0x826a=['fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','%s-%s%s','basename','now','post','single','file','webhookPost','put','update','delete','exports','util','connect-timeout','Router'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x826a,0x1aa));var _0xa826=function(_0x127fc9,_0x5315bc){_0x127fc9=_0x127fc9-0x0;var _0x5e6407=_0x826a[_0x127fc9];return _0x5e6407;};'use strict';var multer=require('multer');var util=require(_0xa826('0x0'));var path=require('path');var timeout=require(_0xa826('0x1'));var express=require('express');var router=express[_0xa826('0x2')]();var fs_extra=require(_0xa826('0x3'));var auth=require(_0xa826('0x4'));var interaction=require(_0xa826('0x5'));var config=require('../../config/environment');var controller=require(_0xa826('0x6'));router[_0xa826('0x7')]('/',auth[_0xa826('0x8')](),controller[_0xa826('0x9')]);router[_0xa826('0x7')](_0xa826('0xa'),controller[_0xa826('0xb')]);router[_0xa826('0x7')](_0xa826('0xc'),auth[_0xa826('0x8')](),controller[_0xa826('0xd')]);router[_0xa826('0x7')](_0xa826('0xe'),auth[_0xa826('0x8')](),controller[_0xa826('0xf')]);var upload=multer({'storage':multer[_0xa826('0x10')]({'destination':function(_0x48df82,_0xbd22fc,_0x4b4caf){_0x4b4caf(null,path[_0xa826('0x11')](config[_0xa826('0x12')],_0xa826('0x13')));},'filename':function(_0xa55bd7,_0x212fac,_0x40838f){_0x212fac[_0xa826('0x14')]=_0x212fac['originalname'][_0xa826('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x40838f(null,util['format'](_0xa826('0x16'),path[_0xa826('0x17')](_0x212fac['originalname'],path['extname'](_0x212fac['originalname'])),Date[_0xa826('0x18')](),path['extname'](_0x212fac['originalname'])));}})});router[_0xa826('0x19')]('/',upload[_0xa826('0x1a')](_0xa826('0x1b')),controller['upload']);router[_0xa826('0x19')](_0xa826('0xa'),controller[_0xa826('0x1c')]);router[_0xa826('0x1d')](_0xa826('0xc'),auth['isAuthenticated'](),controller[_0xa826('0x1e')]);router[_0xa826('0x1f')](_0xa826('0xc'),auth['isAuthenticated'](),controller['delete']);module[_0xa826('0x20')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index d14e8ad..e56af21 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 _0xe9fa=['html','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','exports','STRING','ENUM'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe9fa,0x76));var _0xae9f=function(_0x2670eb,_0x376693){_0x2670eb=_0x2670eb-0x0;var _0x374c3a=_0xe9fa[_0x2670eb];return _0x374c3a;};'use strict';var Sequelize=require('sequelize');module[_0xae9f('0x0')]={'name':{'type':Sequelize[_0xae9f('0x1')]},'type':{'type':Sequelize[_0xae9f('0x2')](_0xae9f('0x3'),'script')},'description':{'type':Sequelize[_0xae9f('0x4')]},'version':{'type':Sequelize[_0xae9f('0x4')]},'path':{'type':Sequelize[_0xae9f('0x1')],'comment':_0xae9f('0x5')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xae9f('0x6')},'sidebar':{'type':Sequelize[_0xae9f('0x2')](_0xae9f('0x7'),_0xae9f('0x8'),_0xae9f('0x9'),_0xae9f('0xa')),'defaultValue':'always','comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0xae9f('0x1')]},'adminUrl':{'type':Sequelize[_0xae9f('0x1')]},'agentUrl':{'type':Sequelize[_0xae9f('0x1')]},'scriptName':{'type':Sequelize[_0xae9f('0x1')]},'scriptPath':{'type':Sequelize[_0xae9f('0x1')]}}; \ No newline at end of file +var _0xad59=['sequelize','STRING','ENUM','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','never'];(function(_0x44e79f,_0x425cb8){var _0x2ddb9d=function(_0x17f0c0){while(--_0x17f0c0){_0x44e79f['push'](_0x44e79f['shift']());}};_0x2ddb9d(++_0x425cb8);}(_0xad59,0x1ad));var _0x9ad5=function(_0x125bb6,_0x27dd70){_0x125bb6=_0x125bb6-0x0;var _0x8a222=_0xad59[_0x125bb6];return _0x8a222;};'use strict';var Sequelize=require(_0x9ad5('0x0'));module['exports']={'name':{'type':Sequelize[_0x9ad5('0x1')]},'type':{'type':Sequelize[_0x9ad5('0x2')]('html',_0x9ad5('0x3'))},'description':{'type':Sequelize[_0x9ad5('0x4')]},'version':{'type':Sequelize[_0x9ad5('0x4')]},'path':{'type':Sequelize[_0x9ad5('0x1')],'comment':_0x9ad5('0x5')},'active':{'type':Sequelize[_0x9ad5('0x6')],'defaultValue':0x0,'comment':_0x9ad5('0x7')},'sidebar':{'type':Sequelize[_0x9ad5('0x2')](_0x9ad5('0x8'),_0x9ad5('0x9'),'always',_0x9ad5('0xa')),'defaultValue':'always','comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x9ad5('0x1')]},'agentUrl':{'type':Sequelize[_0x9ad5('0x1')]},'scriptName':{'type':Sequelize[_0x9ad5('0x1')]},'scriptPath':{'type':Sequelize[_0x9ad5('0x1')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 25af2f4..d2ae28e 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 _0xf5c8=['Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon-apps','html','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','scriptName','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','port','hostname','%s%s','headers','content-length','content-type','set','endsWith','statusCode','sendStatus','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','http://localhost:','method','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','localhost','socket.io-emitter','redis','./plugin.socket','end','status','json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','get','Plugins','UserProfileResource','error','name','send','index','map','Plugin','rawAttributes','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','VIRTUAL','filter','merge','options','includeAll','rows','catch','show','find','params','join','root','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','server/files/plugins','dirname','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','download','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','some','manifest.json','Plugin\x20manifest\x20missing','parse'];(function(_0x564615,_0x51000c){var _0x3e5c3c=function(_0x35b777){while(--_0x35b777){_0x564615['push'](_0x564615['shift']());}};_0x3e5c3c(++_0x51000c);}(_0xf5c8,0x185));var _0x8f5c=function(_0x2e3107,_0x25f970){_0x2e3107=_0x2e3107-0x0;var _0x833d69=_0xf5c8[_0x2e3107];return _0x833d69;};'use strict';var emlformat=require(_0x8f5c('0x0'));var rimraf=require(_0x8f5c('0x1'));var zipdir=require(_0x8f5c('0x2'));var jsonpatch=require(_0x8f5c('0x3'));var rp=require(_0x8f5c('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8f5c('0x5'));var path=require(_0x8f5c('0x6'));var sox=require(_0x8f5c('0x7'));var csv=require(_0x8f5c('0x8'));var ejs=require(_0x8f5c('0x9'));var fs=require('fs');var fs_extra=require(_0x8f5c('0xa'));var _=require('lodash');var squel=require(_0x8f5c('0xb'));var crypto=require(_0x8f5c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8f5c('0xd'));var toCsv=require(_0x8f5c('0x8'));var querystring=require(_0x8f5c('0xe'));var Papa=require(_0x8f5c('0xf'));var extract=require(_0x8f5c('0x10'));var rimraf=require('rimraf');var archiver=require(_0x8f5c('0x11'));var Redis=require(_0x8f5c('0x12'));var authService=require(_0x8f5c('0x13'));var qs=require(_0x8f5c('0x14'));var as=require(_0x8f5c('0x15'));var hardwareService=require(_0x8f5c('0x16'));var logger=require(_0x8f5c('0x17'))(_0x8f5c('0x18'));var utils=require(_0x8f5c('0x19'));var config=require(_0x8f5c('0x1a'));var licenseUtil=require(_0x8f5c('0x1b'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x8f5c('0x1c'),'port':0x18eb});var socket=require(_0x8f5c('0x1d'))(new Redis(config[_0x8f5c('0x1e')]));require(_0x8f5c('0x1f'))['register'](socket);function respondWithStatusCode(_0x4945a1,_0x11015e){_0x11015e=_0x11015e||0xcc;return function(_0x214db2){if(_0x214db2){return _0x4945a1['sendStatus'](_0x11015e);}return _0x4945a1['status'](_0x11015e)[_0x8f5c('0x20')]();};}function respondWithResult(_0xf7a035,_0x317386){_0x317386=_0x317386||0xc8;return function(_0x3b571a){if(_0x3b571a){return _0xf7a035[_0x8f5c('0x21')](_0x317386)[_0x8f5c('0x22')](_0x3b571a);}};}function respondWithFilteredResult(_0xa1b866,_0x793814){return function(_0x570771){if(_0x570771){var _0x28b673=typeof _0x793814[_0x8f5c('0x23')]===_0x8f5c('0x24')&&typeof _0x793814[_0x8f5c('0x25')]==='undefined';var _0x1ef02d=_0x570771[_0x8f5c('0x26')];var _0x561a7a=_0x28b673?0x0:_0x793814[_0x8f5c('0x23')];var _0x3dd633=_0x28b673?_0x570771['count']:_0x793814[_0x8f5c('0x23')]+_0x793814[_0x8f5c('0x25')];var _0xc14859;if(_0x3dd633>=_0x1ef02d){_0x3dd633=_0x1ef02d;_0xc14859=0xc8;}else{_0xc14859=0xce;}_0xa1b866[_0x8f5c('0x21')](_0xc14859);return _0xa1b866['set']('Content-Range',_0x561a7a+'-'+_0x3dd633+'/'+_0x1ef02d)[_0x8f5c('0x22')](_0x570771);}return null;};}function patchUpdates(_0x470963){return function(_0x3eba28){try{jsonpatch[_0x8f5c('0x27')](_0x3eba28,_0x470963,!![]);}catch(_0x2c49dc){return BPromise[_0x8f5c('0x28')](_0x2c49dc);}return _0x3eba28[_0x8f5c('0x29')]();};}function saveUpdates(_0x3bfb45,_0x5a9d7a){return function(_0xf97197){if(_0xf97197){return _0xf97197[_0x8f5c('0x2a')](_0x3bfb45)['then'](function(_0x4175a7){return _0x4175a7;});}return null;};}function removeEntity(_0x4e3e18,_0x2d244d){return function(_0x2d525a){if(_0x2d525a){return _0x2d525a[_0x8f5c('0x2b')]()[_0x8f5c('0x2c')](function(){var _0x32b98b=_0x2d525a[_0x8f5c('0x2d')]({'plain':!![]});var _0x715c82=_0x8f5c('0x2e');return db[_0x8f5c('0x2f')][_0x8f5c('0x2b')]({'where':{'type':_0x715c82,'resourceId':_0x32b98b['id']}})[_0x8f5c('0x2c')](function(){return _0x2d525a;});})[_0x8f5c('0x2c')](function(){_0x4e3e18[_0x8f5c('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3901cd,_0x359fba){return function(_0x49519b){if(!_0x49519b){_0x3901cd['sendStatus'](0x194);}return _0x49519b;};}function handleError(_0x352c15,_0x45aa69){_0x45aa69=_0x45aa69||0x1f4;return function(_0x40937f){logger[_0x8f5c('0x30')](_0x40937f['stack']);if(_0x40937f[_0x8f5c('0x31')]){delete _0x40937f[_0x8f5c('0x31')];}_0x352c15[_0x8f5c('0x21')](_0x45aa69)[_0x8f5c('0x32')](_0x40937f);};}exports[_0x8f5c('0x33')]=function(_0x93d7df,_0x4e273a){var _0x292695={},_0x332fdf={},_0x43c799={'count':0x0,'rows':[]};var _0x55531=_[_0x8f5c('0x34')](db[_0x8f5c('0x35')][_0x8f5c('0x36')],function(_0x451d6f){return{'name':_0x451d6f['fieldName'],'type':_0x451d6f[_0x8f5c('0x37')][_0x8f5c('0x38')]};});_0x332fdf[_0x8f5c('0x39')]=_['map'](_0x55531,_0x8f5c('0x31'));_0x332fdf['query']=_[_0x8f5c('0x3a')](_0x93d7df[_0x8f5c('0x3b')]);_0x332fdf['filters']=_[_0x8f5c('0x3c')](_0x332fdf[_0x8f5c('0x39')],_0x332fdf['query']);_0x292695['attributes']=_[_0x8f5c('0x3c')](_0x332fdf['model'],qs['fields'](_0x93d7df[_0x8f5c('0x3b')][_0x8f5c('0x3d')]));_0x292695[_0x8f5c('0x3e')]=_0x292695['attributes'][_0x8f5c('0x3f')]?_0x292695[_0x8f5c('0x3e')]:_0x332fdf[_0x8f5c('0x39')];if(!_0x93d7df[_0x8f5c('0x3b')][_0x8f5c('0x40')](_0x8f5c('0x41'))){_0x292695[_0x8f5c('0x25')]=qs['limit'](_0x93d7df[_0x8f5c('0x3b')][_0x8f5c('0x25')]);_0x292695[_0x8f5c('0x23')]=qs[_0x8f5c('0x23')](_0x93d7df[_0x8f5c('0x3b')][_0x8f5c('0x23')]);}_0x292695[_0x8f5c('0x42')]=qs[_0x8f5c('0x43')](_0x93d7df[_0x8f5c('0x3b')][_0x8f5c('0x43')]);_0x292695[_0x8f5c('0x44')]=qs[_0x8f5c('0x45')](_['pick'](_0x93d7df[_0x8f5c('0x3b')],_0x332fdf[_0x8f5c('0x45')]),_0x55531);if(_0x93d7df[_0x8f5c('0x3b')]['filter']){_0x292695['where']=_['merge'](_0x292695[_0x8f5c('0x44')],{'$or':_['map'](_0x55531,function(_0x40852d){if(_0x40852d[_0x8f5c('0x37')]!==_0x8f5c('0x46')){var _0x30a529={};_0x30a529[_0x40852d[_0x8f5c('0x31')]]={'$like':'%'+_0x93d7df['query'][_0x8f5c('0x47')]+'%'};return _0x30a529;}})});}_0x292695=_[_0x8f5c('0x48')]({},_0x292695,_0x93d7df[_0x8f5c('0x49')]);var _0xa2ec5f={'where':_0x292695['where']};return db['Plugin'][_0x8f5c('0x26')](_0xa2ec5f)['then'](function(_0x1ab489){_0x43c799['count']=_0x1ab489;if(_0x93d7df[_0x8f5c('0x3b')][_0x8f5c('0x4a')]){_0x292695['include']=[{'all':!![]}];}return db['Plugin']['findAll'](_0x292695);})[_0x8f5c('0x2c')](function(_0x28e2e7){_0x43c799[_0x8f5c('0x4b')]=_0x28e2e7;return _0x43c799;})['then'](respondWithFilteredResult(_0x4e273a,_0x292695))[_0x8f5c('0x4c')](handleError(_0x4e273a,null));};exports[_0x8f5c('0x4d')]=function(_0x2e3be1,_0x35559f){var _0x4d58c0={'raw':!![],'where':{'id':_0x2e3be1['params']['id']}},_0x32ad07={};_0x32ad07[_0x8f5c('0x39')]=_[_0x8f5c('0x3a')](db[_0x8f5c('0x35')][_0x8f5c('0x36')]);_0x32ad07['query']=_[_0x8f5c('0x3a')](_0x2e3be1[_0x8f5c('0x3b')]);_0x32ad07[_0x8f5c('0x45')]=_[_0x8f5c('0x3c')](_0x32ad07[_0x8f5c('0x39')],_0x32ad07[_0x8f5c('0x3b')]);_0x4d58c0[_0x8f5c('0x3e')]=_[_0x8f5c('0x3c')](_0x32ad07[_0x8f5c('0x39')],qs[_0x8f5c('0x3d')](_0x2e3be1[_0x8f5c('0x3b')][_0x8f5c('0x3d')]));_0x4d58c0['attributes']=_0x4d58c0[_0x8f5c('0x3e')]['length']?_0x4d58c0[_0x8f5c('0x3e')]:_0x32ad07[_0x8f5c('0x39')];if(_0x2e3be1[_0x8f5c('0x3b')]['includeAll']){_0x4d58c0['include']=[{'all':!![]}];}_0x4d58c0=_[_0x8f5c('0x48')]({},_0x4d58c0,_0x2e3be1[_0x8f5c('0x49')]);return db[_0x8f5c('0x35')][_0x8f5c('0x4e')](_0x4d58c0)[_0x8f5c('0x2c')](handleEntityNotFound(_0x35559f,null))[_0x8f5c('0x2c')](respondWithResult(_0x35559f,null))['catch'](handleError(_0x35559f,null));};exports['download']=function(_0x5476ee,_0x17d4f2,_0x29ba26){return db[_0x8f5c('0x35')][_0x8f5c('0x4e')]({'where':{'id':_0x5476ee[_0x8f5c('0x4f')]['id']},'attributes':[_0x8f5c('0x31'),_0x8f5c('0x6')],'raw':!![]})[_0x8f5c('0x2c')](handleEntityNotFound(_0x17d4f2,null))[_0x8f5c('0x2c')](function(_0x9b75fd){if(_0x9b75fd){var _0x4464ca=path[_0x8f5c('0x50')](config[_0x8f5c('0x51')],'server/files/plugins',util[_0x8f5c('0x52')](_0x8f5c('0x53'),path[_0x8f5c('0x54')](_0x9b75fd[_0x8f5c('0x6')])));var _0x4b4837=fs[_0x8f5c('0x55')](_0x4464ca);var _0x457f5d=archiver(_0x8f5c('0x56'),{'zlib':{'level':0x9}});_0x457f5d['on'](_0x8f5c('0x57'),function(_0x54ead5){if(_0x54ead5[_0x8f5c('0x58')]===_0x8f5c('0x59')){logger[_0x8f5c('0x30')](_0x54ead5);}else{throw new db[(_0x8f5c('0x5a'))][(_0x8f5c('0x5b'))](_0x8f5c('0x5c'));}});_0x457f5d['on']('error',function(_0x4d4e01){throw new db['Sequelize'][(_0x8f5c('0x5b'))](_0x8f5c('0x5c'));});_0x457f5d['pipe'](_0x4b4837);_0x457f5d[_0x8f5c('0x5d')](_0x8f5c('0x5e'),{'cwd':path[_0x8f5c('0x50')](config[_0x8f5c('0x51')],_0x8f5c('0x5f'),path[_0x8f5c('0x60')](_0x9b75fd[_0x8f5c('0x6')])),'ignore':[path['join'](path[_0x8f5c('0x54')](_0x9b75fd['path']),'node_modules/**/*'),path[_0x8f5c('0x50')](path[_0x8f5c('0x54')](_0x9b75fd[_0x8f5c('0x6')]),_0x8f5c('0x61'))],'nodir':!![]})[_0x8f5c('0x62')]();_0x4b4837['on'](_0x8f5c('0x63'),function(){if(!fs[_0x8f5c('0x64')](_0x4464ca)){throw new db['Sequelize'][(_0x8f5c('0x5b'))](_0x8f5c('0x65'));}return _0x17d4f2[_0x8f5c('0x66')](_0x4464ca,util[_0x8f5c('0x52')]('%s.zip',path[_0x8f5c('0x54')](_0x9b75fd['path'])),function(_0x3a6fec){if(_0x3a6fec){throw new db[(_0x8f5c('0x5a'))][(_0x8f5c('0x5b'))](_0x8f5c('0x67'));}fs['unlinkSync'](_0x4464ca);logger[_0x8f5c('0x68')](_0x8f5c('0x69'));logger['info']('Temporary\x20file\x20removed');});});}return null;})[_0x8f5c('0x4c')](handleError(_0x17d4f2,null));};exports[_0x8f5c('0x6a')]=function(_0x40e3a3,_0x54e39e,_0x23a177){var _0x4aee22=path[_0x8f5c('0x54')](_0x40e3a3[_0x8f5c('0x6b')][_0x8f5c('0x6c')],path[_0x8f5c('0x6d')](_0x40e3a3['file'][_0x8f5c('0x6c')]));var _0x457c6a=path['join'](config[_0x8f5c('0x51')],'server/files/plugins',_0x40e3a3[_0x8f5c('0x6b')]['filename']);var _0x3e7162=path['join'](config[_0x8f5c('0x51')],_0x8f5c('0x5f'),_0x4aee22);logger[_0x8f5c('0x68')](_0x8f5c('0x6e'),_0x457c6a);logger[_0x8f5c('0x68')](_0x8f5c('0x6f'),_0x3e7162);try{fs[_0x8f5c('0x70')](_0x457c6a,parseInt(_0x8f5c('0x71'),0x8));extract(_0x457c6a,{'dir':_0x3e7162},function(_0x23ce64){if(_0x23ce64){logger['error'](_0x23ce64);handleError(_0x23ce64,!![]);};var _0x28338a=fs[_0x8f5c('0x72')](_0x3e7162);if(_0x28338a[_0x8f5c('0x3f')]>0x1){removeReferences(_0x457c6a,_0x3e7162);logger[_0x8f5c('0x30')](_0x8f5c('0x73'));return _0x23a177(new Error(_0x8f5c('0x73')));}var _0x3cbecf=fs[_0x8f5c('0x74')](path[_0x8f5c('0x50')](_0x3e7162,_0x28338a[0x0]));if(_0x3cbecf['isFile']()){removeReferences(_0x457c6a,_0x3e7162);logger[_0x8f5c('0x30')](_0x8f5c('0x73'));return _0x23a177(new Error(_0x8f5c('0x73')));}if(_0x3cbecf['isDirectory']()){var _0x25f8d2=fs[_0x8f5c('0x72')](path['join'](_0x3e7162,_0x28338a[0x0]));if(_0x25f8d2['length']===0x0){removeReferences(_0x457c6a,_0x3e7162);logger[_0x8f5c('0x30')](_0x8f5c('0x73'));return _0x23a177(new Error(_0x8f5c('0x73')));}var _0x39d8fc=_0x25f8d2[_0x8f5c('0x75')](function(_0x63b95c){return _0x63b95c===_0x8f5c('0x76');});if(!_0x39d8fc){return _0x23a177(new Error(_0x8f5c('0x77')));}var _0x44492f=fs['readFileSync'](path['join'](_0x3e7162,_0x28338a[0x0],_0x8f5c('0x76')));var _0x15f47d=JSON[_0x8f5c('0x78')](_0x44492f);if(_0x8f5c('0x24')==typeof _0x15f47d['name']){return _0x23a177(new Error(_0x8f5c('0x79')));}if(_0x8f5c('0x24')==typeof _0x15f47d[_0x8f5c('0x37')]){return _0x23a177(new Error(_0x8f5c('0x7a')));}if('undefined'==typeof _0x15f47d[_0x8f5c('0x7b')]){return _0x23a177(new Error(_0x8f5c('0x7c')));}if(_0x8f5c('0x24')==typeof _0x15f47d[_0x8f5c('0x7d')]){return _0x23a177(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x15f47d[_0x8f5c('0x37')]==='html'){if(_0x8f5c('0x24')==typeof _0x15f47d[_0x8f5c('0x7d')][_0x8f5c('0x7e')]){return _0x23a177(new Error(_0x8f5c('0x7f')));}if(_0x8f5c('0x24')==typeof _0x15f47d[_0x8f5c('0x7d')][_0x8f5c('0x7e')][_0x8f5c('0x80')]&&_0x8f5c('0x24')==typeof _0x15f47d[_0x8f5c('0x7d')][_0x8f5c('0x7e')]['agent']){return _0x23a177(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x15f47d[_0x8f5c('0x37')]===_0x8f5c('0x81')){if('undefined'==typeof _0x15f47d[_0x8f5c('0x7d')]['scriptName']){return _0x23a177(new Error(_0x8f5c('0x82')));}if(_0x8f5c('0x24')==typeof _0x15f47d[_0x8f5c('0x7d')][_0x8f5c('0x83')]){return _0x23a177(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x23a177(new Error(_0x8f5c('0x84')));}var _0x41094e=_0x15f47d[_0x8f5c('0x31')];var _0x3e7e04=_0x15f47d[_0x8f5c('0x85')];var _0xcb708c=_0x15f47d[_0x8f5c('0x37')];var _0xd2dd0f=_0x15f47d[_0x8f5c('0x86')]?_0x15f47d[_0x8f5c('0x86')]:_0x8f5c('0x87');var _0x576390=_0x15f47d['icon']?_0x15f47d['icon']:_0x8f5c('0x88');var _0x3db534='';var _0x37a746='';var _0x1cbc37='';var _0x5df61c='';var _0x5c31d2=_0x15f47d[_0x8f5c('0x7b')];if(_0xcb708c===_0x8f5c('0x89')){if(_0x8f5c('0x24')!=typeof _0x15f47d[_0x8f5c('0x7d')][_0x8f5c('0x7e')][_0x8f5c('0x80')]){var _0x5ed79=_0x15f47d['parameters']['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0x8f5c('0x8a')](_0x5ed79)){_0x3db534=path[_0x8f5c('0x50')](_0x8f5c('0x8b'),_0x4aee22,_0x28338a[0x0],_0x5ed79);}else{_0x3db534=_0x5ed79;}}else{logger[_0x8f5c('0x68')](_0x8f5c('0x8c'));}if(_0x8f5c('0x24')!=typeof _0x15f47d[_0x8f5c('0x7d')][_0x8f5c('0x7e')][_0x8f5c('0x8d')]){var _0x4e3ab0=_0x15f47d[_0x8f5c('0x7d')][_0x8f5c('0x7e')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x8f5c('0x8a')](_0x4e3ab0)){_0x37a746=path[_0x8f5c('0x50')](_0x8f5c('0x8b'),_0x4aee22,_0x28338a[0x0],_0x4e3ab0);}else{_0x37a746=_0x4e3ab0;}}else{logger[_0x8f5c('0x68')](_0x8f5c('0x8e'));}}else if(_0xcb708c===_0x8f5c('0x81')){_0x1cbc37=_0x15f47d[_0x8f5c('0x7d')][_0x8f5c('0x8f')];_0x5df61c=_0x15f47d[_0x8f5c('0x7d')]['scriptPath'];if('undefined'!=typeof _0x15f47d[_0x8f5c('0x7d')][_0x8f5c('0x7e')]){if('undefined'!=typeof _0x15f47d['parameters'][_0x8f5c('0x7e')][_0x8f5c('0x80')]){var _0x5ed79=_0x15f47d[_0x8f5c('0x7d')][_0x8f5c('0x7e')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x8f5c('0x8a')](_0x5ed79)){_0x3db534=path[_0x8f5c('0x50')](_0x8f5c('0x8b'),_0x4aee22,_0x28338a[0x0],_0x5ed79);}else{_0x3db534=_0x5ed79;}}if(_0x8f5c('0x24')!=typeof _0x15f47d[_0x8f5c('0x7d')][_0x8f5c('0x7e')][_0x8f5c('0x8d')]){var _0x4e3ab0=_0x15f47d[_0x8f5c('0x7d')]['views'][_0x8f5c('0x8d')];if(!/^(f|ht)tps?:\/\//i[_0x8f5c('0x8a')](_0x4e3ab0)){_0x37a746=path[_0x8f5c('0x50')](_0x8f5c('0x8b'),_0x4aee22,_0x28338a[0x0],_0x4e3ab0);}else{_0x37a746=_0x4e3ab0;}}}}var _0x5a599e={'name':_0x41094e,'description':_0x3e7e04,'path':path[_0x8f5c('0x50')](_0x4aee22,_0x28338a[0x0]),'type':_0xcb708c,'sidebar':_0xd2dd0f,'icon':_0x576390,'adminUrl':_0x3db534,'agentUrl':_0x37a746,'scriptName':_0x1cbc37,'scriptPath':_0x5df61c,'version':_0x5c31d2};removeReferences(_0x457c6a,null);return db[_0x8f5c('0x35')][_0x8f5c('0x90')](_0x5a599e)[_0x8f5c('0x2c')](function(_0x2285ef){var _0x5014e3={'role':_0x40e3a3[_0x8f5c('0x91')]['role'],'userProfileId':_0x40e3a3[_0x8f5c('0x91')][_0x8f5c('0x92')]};if(!_0x5014e3)throw new Error(_0x8f5c('0x93'));if(_0x5014e3[_0x8f5c('0x94')]===_0x8f5c('0x95')){var _0x439771=_0x2285ef[_0x8f5c('0x2d')]({'plain':!![]});return db['UserProfileSection'][_0x8f5c('0x4e')]({'where':{'name':_0x8f5c('0x2e'),'userProfileId':_0x5014e3['userProfileId']},'raw':!![]})[_0x8f5c('0x2c')](function(_0x5c7ead){if(_0x5c7ead&&_0x5c7ead['autoAssociation']===0x0){return db[_0x8f5c('0x2f')]['create']({'name':_0x439771[_0x8f5c('0x31')],'resourceId':_0x439771['id'],'type':_0x5c7ead[_0x8f5c('0x31')],'sectionId':_0x5c7ead['id']},{})[_0x8f5c('0x2c')](function(){return _0x2285ef;});}else{return _0x2285ef;}})[_0x8f5c('0x4c')](function(_0x97bec6){logger['error'](_0x8f5c('0x96'),_0x97bec6);throw _0x97bec6;});}return _0x2285ef;})[_0x8f5c('0x2c')](respondWithResult(_0x54e39e,null))['catch'](handleError(_0x54e39e,null));}});}catch(_0x267eee){_0x54e39e[_0x8f5c('0x21')](0x1f4)['send'](_0x267eee);}};function removeReferences(_0x21f3fc,_0x5e6e26){try{if(_0x21f3fc){fs['unlinkSync'](_0x21f3fc);logger[_0x8f5c('0x68')](_0x8f5c('0x97'));}if(_0x5e6e26){rimraf(_0x5e6e26,function(){});logger[_0x8f5c('0x68')](_0x8f5c('0x98'));}}catch(_0x48b307){logger['error'](_0x48b307);}}exports[_0x8f5c('0x2a')]=function(_0x753191,_0x158109,_0x435e11){return db[_0x8f5c('0x35')][_0x8f5c('0x4e')]({'where':{'id':_0x753191['params']['id']}})[_0x8f5c('0x2c')](handleEntityNotFound(_0x158109,null))[_0x8f5c('0x2c')](saveUpdates(_0x753191[_0x8f5c('0x91')],null))['then'](respondWithResult(_0x158109,null))[_0x8f5c('0x4c')](handleError(_0x158109,null));};exports[_0x8f5c('0x99')]=function(_0x3ccee6,_0x240bca,_0x346362){return db[_0x8f5c('0x35')][_0x8f5c('0x4e')]({'where':{'id':_0x3ccee6[_0x8f5c('0x4f')]['id']}})[_0x8f5c('0x2c')](function(_0x40bdb4){if(_0x40bdb4){return _0x40bdb4[_0x8f5c('0x2b')]();}})['then'](function(_0x34f92f){rimraf(path[_0x8f5c('0x50')](config['root'],_0x8f5c('0x5f'),path[_0x8f5c('0x60')](_0x34f92f[_0x8f5c('0x6')])),function(){});return _0x34f92f;})['then'](handleEntityNotFound(_0x240bca,null))['then'](respondWithStatusCode(_0x240bca,null))[_0x8f5c('0x4c')](handleError(_0x240bca,null));};exports[_0x8f5c('0x9a')]=function(_0x471814,_0x1ad89d,_0x5c75fa){return BPromise[_0x8f5c('0x9b')]()[_0x8f5c('0x2c')](function(){if(!_0x471814[_0x8f5c('0x3b')][_0x8f5c('0x6')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x471814[_0x8f5c('0x3b')][_0x8f5c('0x9c')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0xd793bc=_0x471814['query']['hostname']?_0x471814[_0x8f5c('0x3b')][_0x8f5c('0x9d')]+':'+_0x471814[_0x8f5c('0x3b')][_0x8f5c('0x9c')]:'http://localhost:'+_0x471814[_0x8f5c('0x3b')]['port'];var _0x458202=_0x471814['query'][_0x8f5c('0x22')]?_0x471814[_0x8f5c('0x3b')][_0x8f5c('0x22')]:!![];var _0x357200=_0x471814[_0x8f5c('0x3b')]['encoding']?_0x471814[_0x8f5c('0x3b')]['encoding']:null;var _0x1fab32={'method':_0x471814['method'],'uri':util[_0x8f5c('0x52')](_0x8f5c('0x9e'),_0xd793bc,_0x471814[_0x8f5c('0x3b')][_0x8f5c('0x6')]),'json':_0x458202,'resolveWithFullResponse':!![],'encoding':_0x357200,'qs':_0x471814[_0x8f5c('0x3b')]};if(_0x471814[_0x8f5c('0x9f')]){_0x1fab32['headers']=_0x471814[_0x8f5c('0x9f')];if(_0x1fab32[_0x8f5c('0x9f')][_0x8f5c('0xa0')]){delete _0x1fab32['headers'][_0x8f5c('0xa0')];}}if(_0x1fab32['headers']['content-type']){delete _0x1fab32['headers'][_0x8f5c('0xa1')];}return rp(_0x1fab32);})[_0x8f5c('0x2c')](function(_0x192675){if(_0x192675){_0x1ad89d[_0x8f5c('0xa2')](_0x192675[_0x8f5c('0x9f')]);logger[_0x8f5c('0x68')](_0x192675[_0x8f5c('0x91')]);if(_[_0x8f5c('0xa3')](_0x471814[_0x8f5c('0x3b')][_0x8f5c('0x6')],_0x8f5c('0x66'))&&_0x192675[_0x8f5c('0xa4')]==0x1f4){return _0x1ad89d[_0x8f5c('0xa5')](_0x192675[_0x8f5c('0xa4')]);}else{return _0x1ad89d[_0x8f5c('0x21')](_0x192675[_0x8f5c('0xa4')])[_0x8f5c('0x32')](_0x192675[_0x8f5c('0x91')]);}}else{return _0x1ad89d[_0x8f5c('0xa5')](0xc8);}})['catch'](handleError(_0x1ad89d,null));};exports[_0x8f5c('0xa6')]=function(_0x482bca,_0x1c3ca8,_0x2bbc89){return BPromise['resolve']()[_0x8f5c('0x2c')](function(){if(!_0x482bca[_0x8f5c('0x3b')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x482bca[_0x8f5c('0x3b')][_0x8f5c('0x9c')]){throw new Error(_0x8f5c('0xa7'));}var _0x2c3104=_0x482bca[_0x8f5c('0x3b')][_0x8f5c('0x9d')]?_0x482bca[_0x8f5c('0x3b')][_0x8f5c('0x9d')]+':'+_0x482bca['query'][_0x8f5c('0x9c')]:_0x8f5c('0xa8')+_0x482bca['query']['port'];var _0x52c004=_0x482bca[_0x8f5c('0x3b')][_0x8f5c('0x22')]?_0x482bca[_0x8f5c('0x3b')]['json']:!![];var _0x1d2076=_0x482bca[_0x8f5c('0x3b')]['encoding']?_0x482bca['query']['encoding']:null;var _0x5e61d5={'method':_0x482bca[_0x8f5c('0xa9')],'uri':util[_0x8f5c('0x52')](_0x8f5c('0x9e'),_0x2c3104,_0x482bca['query']['path']),'json':_0x52c004,'resolveWithFullResponse':!![],'encoding':_0x1d2076,'body':_0x482bca[_0x8f5c('0x91')]};if(_0x482bca['headers']){_0x5e61d5[_0x8f5c('0x9f')]=_0x482bca[_0x8f5c('0x9f')];if(_0x5e61d5[_0x8f5c('0x9f')][_0x8f5c('0xa0')]){delete _0x5e61d5[_0x8f5c('0x9f')]['content-length'];}}if(_0x5e61d5['headers']['content-type']){delete _0x5e61d5[_0x8f5c('0x9f')]['content-type'];}return rp(_0x5e61d5);})[_0x8f5c('0x2c')](function(_0x18d219){if(_0x18d219){_0x1c3ca8[_0x8f5c('0xa2')](_0x18d219['headers']);logger[_0x8f5c('0x68')](_0x18d219[_0x8f5c('0x91')]);return _0x1c3ca8['status'](_0x18d219[_0x8f5c('0xa4')])['send'](_0x18d219[_0x8f5c('0x91')]);}else{return _0x1c3ca8[_0x8f5c('0xa5')](0xc8);}})[_0x8f5c('0x4c')](handleError(_0x1c3ca8,null));}; \ No newline at end of file +var _0xbe8a=['rows','catch','show','params','include','find','download','join','root','server/files/plugins','format','%s.zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','dirname','basename','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','always','icon','version','html','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','script','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','headers','content-length','content-type','endsWith','statusCode','webhookPost','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','extract-zip','archiver','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Plugins','UserProfileResource','error','stack','name','send','Plugin','rawAttributes','type','key','map','keys','query','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll'];(function(_0x53968c,_0x3c7195){var _0x580fa0=function(_0x1747b4){while(--_0x1747b4){_0x53968c['push'](_0x53968c['shift']());}};_0x580fa0(++_0x3c7195);}(_0xbe8a,0x10b));var _0xabe8=function(_0x3b5049,_0x495a94){_0x3b5049=_0x3b5049-0x0;var _0x12454e=_0xbe8a[_0x3b5049];return _0x12454e;};'use strict';var emlformat=require(_0xabe8('0x0'));var rimraf=require(_0xabe8('0x1'));var zipdir=require(_0xabe8('0x2'));var jsonpatch=require(_0xabe8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xabe8('0x4'));var Mustache=require(_0xabe8('0x5'));var util=require(_0xabe8('0x6'));var path=require(_0xabe8('0x7'));var sox=require(_0xabe8('0x8'));var csv=require('to-csv');var ejs=require(_0xabe8('0x9'));var fs=require('fs');var fs_extra=require(_0xabe8('0xa'));var _=require(_0xabe8('0xb'));var squel=require(_0xabe8('0xc'));var crypto=require(_0xabe8('0xd'));var jsforce=require(_0xabe8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xabe8('0xf'));var querystring=require('querystring');var Papa=require(_0xabe8('0x10'));var extract=require(_0xabe8('0x11'));var rimraf=require(_0xabe8('0x1'));var archiver=require(_0xabe8('0x12'));var Redis=require(_0xabe8('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xabe8('0x14'));var as=require(_0xabe8('0x15'));var hardwareService=require(_0xabe8('0x16'));var logger=require(_0xabe8('0x17'))(_0xabe8('0x18'));var utils=require('../../config/utils');var config=require(_0xabe8('0x19'));var licenseUtil=require(_0xabe8('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xabe8('0x1b')](config[_0xabe8('0x1c')],{'host':_0xabe8('0x1d'),'port':0x18eb});var socket=require(_0xabe8('0x1e'))(new Redis(config[_0xabe8('0x1c')]));require('./plugin.socket')[_0xabe8('0x1f')](socket);function respondWithStatusCode(_0x2a4c37,_0x614c8e){_0x614c8e=_0x614c8e||0xcc;return function(_0x4f703f){if(_0x4f703f){return _0x2a4c37[_0xabe8('0x20')](_0x614c8e);}return _0x2a4c37[_0xabe8('0x21')](_0x614c8e)[_0xabe8('0x22')]();};}function respondWithResult(_0x236099,_0x45ee81){_0x45ee81=_0x45ee81||0xc8;return function(_0x11e07a){if(_0x11e07a){return _0x236099[_0xabe8('0x21')](_0x45ee81)[_0xabe8('0x23')](_0x11e07a);}};}function respondWithFilteredResult(_0x50c1dc,_0x5c4e74){return function(_0x5e698f){if(_0x5e698f){var _0x149651=typeof _0x5c4e74[_0xabe8('0x24')]===_0xabe8('0x25')&&typeof _0x5c4e74[_0xabe8('0x26')]===_0xabe8('0x25');var _0x182309=_0x5e698f['count'];var _0x4c827f=_0x149651?0x0:_0x5c4e74['offset'];var _0x30c6cd=_0x149651?_0x5e698f[_0xabe8('0x27')]:_0x5c4e74[_0xabe8('0x24')]+_0x5c4e74[_0xabe8('0x26')];var _0x2b8835;if(_0x30c6cd>=_0x182309){_0x30c6cd=_0x182309;_0x2b8835=0xc8;}else{_0x2b8835=0xce;}_0x50c1dc[_0xabe8('0x21')](_0x2b8835);return _0x50c1dc[_0xabe8('0x28')](_0xabe8('0x29'),_0x4c827f+'-'+_0x30c6cd+'/'+_0x182309)['json'](_0x5e698f);}return null;};}function patchUpdates(_0x178e9c){return function(_0x23f9aa){try{jsonpatch['apply'](_0x23f9aa,_0x178e9c,!![]);}catch(_0x26ea66){return BPromise[_0xabe8('0x2a')](_0x26ea66);}return _0x23f9aa[_0xabe8('0x2b')]();};}function saveUpdates(_0x39bf21,_0x5536d6){return function(_0x470873){if(_0x470873){return _0x470873[_0xabe8('0x2c')](_0x39bf21)[_0xabe8('0x2d')](function(_0x11d67d){return _0x11d67d;});}return null;};}function removeEntity(_0x1e1364,_0x5a3b1f){return function(_0x42fb7f){if(_0x42fb7f){return _0x42fb7f[_0xabe8('0x2e')]()[_0xabe8('0x2d')](function(){var _0x43b18f=_0x42fb7f[_0xabe8('0x2f')]({'plain':!![]});var _0x42b19f=_0xabe8('0x30');return db[_0xabe8('0x31')][_0xabe8('0x2e')]({'where':{'type':_0x42b19f,'resourceId':_0x43b18f['id']}})[_0xabe8('0x2d')](function(){return _0x42fb7f;});})[_0xabe8('0x2d')](function(){_0x1e1364[_0xabe8('0x21')](0xcc)[_0xabe8('0x22')]();});}};}function handleEntityNotFound(_0xcaf38c,_0x590d06){return function(_0x5bd13d){if(!_0x5bd13d){_0xcaf38c[_0xabe8('0x20')](0x194);}return _0x5bd13d;};}function handleError(_0x21dd23,_0x16e9a6){_0x16e9a6=_0x16e9a6||0x1f4;return function(_0x20741e){logger[_0xabe8('0x32')](_0x20741e[_0xabe8('0x33')]);if(_0x20741e[_0xabe8('0x34')]){delete _0x20741e[_0xabe8('0x34')];}_0x21dd23[_0xabe8('0x21')](_0x16e9a6)[_0xabe8('0x35')](_0x20741e);};}exports['index']=function(_0x365a7c,_0x50e2dd){var _0x39b428={},_0x153d96={},_0x552fa5={'count':0x0,'rows':[]};var _0x28822d=_['map'](db[_0xabe8('0x36')][_0xabe8('0x37')],function(_0x308868){return{'name':_0x308868['fieldName'],'type':_0x308868[_0xabe8('0x38')][_0xabe8('0x39')]};});_0x153d96['model']=_[_0xabe8('0x3a')](_0x28822d,_0xabe8('0x34'));_0x153d96['query']=_[_0xabe8('0x3b')](_0x365a7c[_0xabe8('0x3c')]);_0x153d96['filters']=_[_0xabe8('0x3d')](_0x153d96['model'],_0x153d96[_0xabe8('0x3c')]);_0x39b428[_0xabe8('0x3e')]=_[_0xabe8('0x3d')](_0x153d96['model'],qs[_0xabe8('0x3f')](_0x365a7c['query'][_0xabe8('0x3f')]));_0x39b428[_0xabe8('0x3e')]=_0x39b428[_0xabe8('0x3e')][_0xabe8('0x40')]?_0x39b428[_0xabe8('0x3e')]:_0x153d96[_0xabe8('0x41')];if(!_0x365a7c[_0xabe8('0x3c')][_0xabe8('0x42')](_0xabe8('0x43'))){_0x39b428[_0xabe8('0x26')]=qs['limit'](_0x365a7c[_0xabe8('0x3c')][_0xabe8('0x26')]);_0x39b428[_0xabe8('0x24')]=qs[_0xabe8('0x24')](_0x365a7c[_0xabe8('0x3c')][_0xabe8('0x24')]);}_0x39b428[_0xabe8('0x44')]=qs[_0xabe8('0x45')](_0x365a7c[_0xabe8('0x3c')][_0xabe8('0x45')]);_0x39b428[_0xabe8('0x46')]=qs[_0xabe8('0x47')](_[_0xabe8('0x48')](_0x365a7c[_0xabe8('0x3c')],_0x153d96['filters']),_0x28822d);if(_0x365a7c[_0xabe8('0x3c')][_0xabe8('0x49')]){_0x39b428['where']=_[_0xabe8('0x4a')](_0x39b428[_0xabe8('0x46')],{'$or':_[_0xabe8('0x3a')](_0x28822d,function(_0x4ca633){if(_0x4ca633[_0xabe8('0x38')]!==_0xabe8('0x4b')){var _0x2d801a={};_0x2d801a[_0x4ca633[_0xabe8('0x34')]]={'$like':'%'+_0x365a7c[_0xabe8('0x3c')]['filter']+'%'};return _0x2d801a;}})});}_0x39b428=_[_0xabe8('0x4a')]({},_0x39b428,_0x365a7c[_0xabe8('0x4c')]);var _0x493588={'where':_0x39b428[_0xabe8('0x46')]};return db[_0xabe8('0x36')]['count'](_0x493588)[_0xabe8('0x2d')](function(_0x362cbd){_0x552fa5[_0xabe8('0x27')]=_0x362cbd;if(_0x365a7c['query'][_0xabe8('0x4d')]){_0x39b428['include']=[{'all':!![]}];}return db['Plugin'][_0xabe8('0x4e')](_0x39b428);})[_0xabe8('0x2d')](function(_0x1167e8){_0x552fa5[_0xabe8('0x4f')]=_0x1167e8;return _0x552fa5;})[_0xabe8('0x2d')](respondWithFilteredResult(_0x50e2dd,_0x39b428))[_0xabe8('0x50')](handleError(_0x50e2dd,null));};exports[_0xabe8('0x51')]=function(_0x5822eb,_0xf8c6e5){var _0x1df95a={'raw':!![],'where':{'id':_0x5822eb[_0xabe8('0x52')]['id']}},_0x289125={};_0x289125[_0xabe8('0x41')]=_[_0xabe8('0x3b')](db['Plugin'][_0xabe8('0x37')]);_0x289125[_0xabe8('0x3c')]=_[_0xabe8('0x3b')](_0x5822eb['query']);_0x289125[_0xabe8('0x47')]=_[_0xabe8('0x3d')](_0x289125[_0xabe8('0x41')],_0x289125[_0xabe8('0x3c')]);_0x1df95a[_0xabe8('0x3e')]=_[_0xabe8('0x3d')](_0x289125['model'],qs[_0xabe8('0x3f')](_0x5822eb['query'][_0xabe8('0x3f')]));_0x1df95a[_0xabe8('0x3e')]=_0x1df95a[_0xabe8('0x3e')][_0xabe8('0x40')]?_0x1df95a[_0xabe8('0x3e')]:_0x289125['model'];if(_0x5822eb[_0xabe8('0x3c')][_0xabe8('0x4d')]){_0x1df95a[_0xabe8('0x53')]=[{'all':!![]}];}_0x1df95a=_['merge']({},_0x1df95a,_0x5822eb[_0xabe8('0x4c')]);return db[_0xabe8('0x36')][_0xabe8('0x54')](_0x1df95a)[_0xabe8('0x2d')](handleEntityNotFound(_0xf8c6e5,null))[_0xabe8('0x2d')](respondWithResult(_0xf8c6e5,null))[_0xabe8('0x50')](handleError(_0xf8c6e5,null));};exports[_0xabe8('0x55')]=function(_0x57ac15,_0x3fd08c,_0x25a8ef){return db[_0xabe8('0x36')][_0xabe8('0x54')]({'where':{'id':_0x57ac15[_0xabe8('0x52')]['id']},'attributes':[_0xabe8('0x34'),_0xabe8('0x7')],'raw':!![]})['then'](handleEntityNotFound(_0x3fd08c,null))[_0xabe8('0x2d')](function(_0x4b110f){if(_0x4b110f){var _0x3c32ad=path[_0xabe8('0x56')](config[_0xabe8('0x57')],_0xabe8('0x58'),util[_0xabe8('0x59')](_0xabe8('0x5a'),path['basename'](_0x4b110f[_0xabe8('0x7')])));var _0x167f04=fs['createWriteStream'](_0x3c32ad);var _0xad8a52=archiver('zip',{'zlib':{'level':0x9}});_0xad8a52['on'](_0xabe8('0x5b'),function(_0x28757c){if(_0x28757c[_0xabe8('0x5c')]===_0xabe8('0x5d')){logger['error'](_0x28757c);}else{throw new db[(_0xabe8('0x5e'))][(_0xabe8('0x5f'))](_0xabe8('0x60'));}});_0xad8a52['on']('error',function(_0xba7e3e){throw new db[(_0xabe8('0x5e'))][(_0xabe8('0x5f'))](_0xabe8('0x60'));});_0xad8a52['pipe'](_0x167f04);_0xad8a52[_0xabe8('0x61')](_0xabe8('0x62'),{'cwd':path['join'](config[_0xabe8('0x57')],_0xabe8('0x58'),path[_0xabe8('0x63')](_0x4b110f[_0xabe8('0x7')])),'ignore':[path[_0xabe8('0x56')](path[_0xabe8('0x64')](_0x4b110f['path']),_0xabe8('0x65')),path[_0xabe8('0x56')](path['basename'](_0x4b110f[_0xabe8('0x7')]),_0xabe8('0x66'))],'nodir':!![]})[_0xabe8('0x67')]();_0x167f04['on'](_0xabe8('0x68'),function(){if(!fs[_0xabe8('0x69')](_0x3c32ad)){throw new db[(_0xabe8('0x5e'))]['Error']('Plugin\x20not\x20found');}return _0x3fd08c[_0xabe8('0x55')](_0x3c32ad,util[_0xabe8('0x59')]('%s.zip',path['basename'](_0x4b110f[_0xabe8('0x7')])),function(_0xee400d){if(_0xee400d){throw new db[(_0xabe8('0x5e'))][(_0xabe8('0x5f'))](_0xabe8('0x6a'));}fs[_0xabe8('0x6b')](_0x3c32ad);logger[_0xabe8('0x6c')](_0xabe8('0x6d'));logger[_0xabe8('0x6c')](_0xabe8('0x6e'));});});}return null;})[_0xabe8('0x50')](handleError(_0x3fd08c,null));};exports[_0xabe8('0x6f')]=function(_0x2086fd,_0x1c1390,_0x3b3957){var _0x4409d4=path['basename'](_0x2086fd[_0xabe8('0x70')]['filename'],path['extname'](_0x2086fd['file'][_0xabe8('0x71')]));var _0x3420d2=path[_0xabe8('0x56')](config['root'],'server/files/plugins',_0x2086fd[_0xabe8('0x70')]['filename']);var _0x4a528e=path['join'](config[_0xabe8('0x57')],'server/files/plugins',_0x4409d4);logger['info'](_0xabe8('0x72'),_0x3420d2);logger[_0xabe8('0x6c')](_0xabe8('0x73'),_0x4a528e);try{fs[_0xabe8('0x74')](_0x3420d2,parseInt(_0xabe8('0x75'),0x8));extract(_0x3420d2,{'dir':_0x4a528e},function(_0x56be69){if(_0x56be69){logger[_0xabe8('0x32')](_0x56be69);handleError(_0x56be69,!![]);};var _0x3a59b4=fs[_0xabe8('0x76')](_0x4a528e);if(_0x3a59b4[_0xabe8('0x40')]>0x1){removeReferences(_0x3420d2,_0x4a528e);logger[_0xabe8('0x32')](_0xabe8('0x77'));return _0x3b3957(new Error(_0xabe8('0x77')));}var _0x39fd27=fs[_0xabe8('0x78')](path[_0xabe8('0x56')](_0x4a528e,_0x3a59b4[0x0]));if(_0x39fd27[_0xabe8('0x79')]()){removeReferences(_0x3420d2,_0x4a528e);logger[_0xabe8('0x32')](_0xabe8('0x77'));return _0x3b3957(new Error(_0xabe8('0x77')));}if(_0x39fd27[_0xabe8('0x7a')]()){var _0x2cd4a0=fs[_0xabe8('0x76')](path['join'](_0x4a528e,_0x3a59b4[0x0]));if(_0x2cd4a0[_0xabe8('0x40')]===0x0){removeReferences(_0x3420d2,_0x4a528e);logger[_0xabe8('0x32')](_0xabe8('0x77'));return _0x3b3957(new Error('Invalid\x20plugin\x20structure'));}var _0x56042f=_0x2cd4a0['some'](function(_0x42668f){return _0x42668f===_0xabe8('0x7b');});if(!_0x56042f){return _0x3b3957(new Error(_0xabe8('0x7c')));}var _0x39cf7a=fs[_0xabe8('0x7d')](path[_0xabe8('0x56')](_0x4a528e,_0x3a59b4[0x0],_0xabe8('0x7b')));var _0x521e6b=JSON['parse'](_0x39cf7a);if(_0xabe8('0x25')==typeof _0x521e6b[_0xabe8('0x34')]){return _0x3b3957(new Error(_0xabe8('0x7e')));}if(_0xabe8('0x25')==typeof _0x521e6b[_0xabe8('0x38')]){return _0x3b3957(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0xabe8('0x25')==typeof _0x521e6b['version']){return _0x3b3957(new Error(_0xabe8('0x7f')));}if(_0xabe8('0x25')==typeof _0x521e6b[_0xabe8('0x80')]){return _0x3b3957(new Error(_0xabe8('0x81')));}if(_0x521e6b[_0xabe8('0x38')]==='html'){if(_0xabe8('0x25')==typeof _0x521e6b['parameters'][_0xabe8('0x82')]){return _0x3b3957(new Error(_0xabe8('0x83')));}if(_0xabe8('0x25')==typeof _0x521e6b[_0xabe8('0x80')]['views'][_0xabe8('0x84')]&&_0xabe8('0x25')==typeof _0x521e6b[_0xabe8('0x80')][_0xabe8('0x82')][_0xabe8('0x85')]){return _0x3b3957(new Error(_0xabe8('0x86')));}}else if(_0x521e6b[_0xabe8('0x38')]==='script'){if(_0xabe8('0x25')==typeof _0x521e6b[_0xabe8('0x80')][_0xabe8('0x87')]){return _0x3b3957(new Error(_0xabe8('0x88')));}if(_0xabe8('0x25')==typeof _0x521e6b[_0xabe8('0x80')][_0xabe8('0x89')]){return _0x3b3957(new Error(_0xabe8('0x8a')));}}else{return _0x3b3957(new Error(_0xabe8('0x8b')));}var _0x139ff7=_0x521e6b[_0xabe8('0x34')];var _0x5733f0=_0x521e6b[_0xabe8('0x8c')];var _0x5606df=_0x521e6b[_0xabe8('0x38')];var _0x45af86=_0x521e6b['sidebar']?_0x521e6b['sidebar']:_0xabe8('0x8d');var _0x567500=_0x521e6b['icon']?_0x521e6b[_0xabe8('0x8e')]:'icon-apps';var _0x53149c='';var _0x529bb9='';var _0x1a8309='';var _0x30c43b='';var _0x4eaaec=_0x521e6b[_0xabe8('0x8f')];if(_0x5606df===_0xabe8('0x90')){if(_0xabe8('0x25')!=typeof _0x521e6b[_0xabe8('0x80')][_0xabe8('0x82')][_0xabe8('0x84')]){var _0x28918e=_0x521e6b['parameters'][_0xabe8('0x82')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xabe8('0x91')](_0x28918e)){_0x53149c=path[_0xabe8('0x56')](_0xabe8('0x92'),_0x4409d4,_0x3a59b4[0x0],_0x28918e);}else{_0x53149c=_0x28918e;}}else{logger[_0xabe8('0x6c')](_0xabe8('0x93'));}if('undefined'!=typeof _0x521e6b[_0xabe8('0x80')]['views']['agent']){var _0x38980c=_0x521e6b[_0xabe8('0x80')]['views'][_0xabe8('0x85')];if(!/^(f|ht)tps?:\/\//i[_0xabe8('0x91')](_0x38980c)){_0x529bb9=path['join'](_0xabe8('0x92'),_0x4409d4,_0x3a59b4[0x0],_0x38980c);}else{_0x529bb9=_0x38980c;}}else{logger[_0xabe8('0x6c')](_0xabe8('0x94'));}}else if(_0x5606df===_0xabe8('0x95')){_0x1a8309=_0x521e6b[_0xabe8('0x80')][_0xabe8('0x87')];_0x30c43b=_0x521e6b[_0xabe8('0x80')][_0xabe8('0x89')];if(_0xabe8('0x25')!=typeof _0x521e6b['parameters'][_0xabe8('0x82')]){if(_0xabe8('0x25')!=typeof _0x521e6b[_0xabe8('0x80')]['views']['admin']){var _0x28918e=_0x521e6b[_0xabe8('0x80')]['views'][_0xabe8('0x84')];if(!/^(f|ht)tps?:\/\//i['test'](_0x28918e)){_0x53149c=path[_0xabe8('0x56')](_0xabe8('0x92'),_0x4409d4,_0x3a59b4[0x0],_0x28918e);}else{_0x53149c=_0x28918e;}}if(_0xabe8('0x25')!=typeof _0x521e6b['parameters']['views']['agent']){var _0x38980c=_0x521e6b['parameters'][_0xabe8('0x82')][_0xabe8('0x85')];if(!/^(f|ht)tps?:\/\//i['test'](_0x38980c)){_0x529bb9=path[_0xabe8('0x56')]('plugins',_0x4409d4,_0x3a59b4[0x0],_0x38980c);}else{_0x529bb9=_0x38980c;}}}}var _0x57fdd0={'name':_0x139ff7,'description':_0x5733f0,'path':path['join'](_0x4409d4,_0x3a59b4[0x0]),'type':_0x5606df,'sidebar':_0x45af86,'icon':_0x567500,'adminUrl':_0x53149c,'agentUrl':_0x529bb9,'scriptName':_0x1a8309,'scriptPath':_0x30c43b,'version':_0x4eaaec};removeReferences(_0x3420d2,null);return db['Plugin'][_0xabe8('0x96')](_0x57fdd0)[_0xabe8('0x2d')](function(_0x337dc7){var _0x41fba2={'role':_0x2086fd[_0xabe8('0x97')][_0xabe8('0x98')],'userProfileId':_0x2086fd['body'][_0xabe8('0x99')]};if(!_0x41fba2)throw new Error(_0xabe8('0x9a'));if(_0x41fba2['role']==='user'){var _0x56efef=_0x337dc7['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xabe8('0x30'),'userProfileId':_0x41fba2[_0xabe8('0x99')]},'raw':!![]})['then'](function(_0x1e9502){if(_0x1e9502&&_0x1e9502[_0xabe8('0x9b')]===0x0){return db[_0xabe8('0x31')][_0xabe8('0x96')]({'name':_0x56efef[_0xabe8('0x34')],'resourceId':_0x56efef['id'],'type':_0x1e9502[_0xabe8('0x34')],'sectionId':_0x1e9502['id']},{})[_0xabe8('0x2d')](function(){return _0x337dc7;});}else{return _0x337dc7;}})[_0xabe8('0x50')](function(_0x2c00d2){logger[_0xabe8('0x32')](_0xabe8('0x9c'),_0x2c00d2);throw _0x2c00d2;});}return _0x337dc7;})[_0xabe8('0x2d')](respondWithResult(_0x1c1390,null))['catch'](handleError(_0x1c1390,null));}});}catch(_0x103630){_0x1c1390['status'](0x1f4)[_0xabe8('0x35')](_0x103630);}};function removeReferences(_0x13280d,_0xe3c430){try{if(_0x13280d){fs[_0xabe8('0x6b')](_0x13280d);logger[_0xabe8('0x6c')](_0xabe8('0x9d'));}if(_0xe3c430){rimraf(_0xe3c430,function(){});logger[_0xabe8('0x6c')](_0xabe8('0x9e'));}}catch(_0x2c8a53){logger[_0xabe8('0x32')](_0x2c8a53);}}exports[_0xabe8('0x2c')]=function(_0x8d1bbd,_0x4a84ac,_0x263179){return db['Plugin'][_0xabe8('0x54')]({'where':{'id':_0x8d1bbd[_0xabe8('0x52')]['id']}})[_0xabe8('0x2d')](handleEntityNotFound(_0x4a84ac,null))['then'](saveUpdates(_0x8d1bbd[_0xabe8('0x97')],null))['then'](respondWithResult(_0x4a84ac,null))[_0xabe8('0x50')](handleError(_0x4a84ac,null));};exports[_0xabe8('0x9f')]=function(_0x23d745,_0xf4865b,_0x102843){return db['Plugin'][_0xabe8('0x54')]({'where':{'id':_0x23d745[_0xabe8('0x52')]['id']}})['then'](function(_0x632125){if(_0x632125){return _0x632125[_0xabe8('0x2e')]();}})[_0xabe8('0x2d')](function(_0x1338e3){rimraf(path[_0xabe8('0x56')](config[_0xabe8('0x57')],_0xabe8('0x58'),path[_0xabe8('0x63')](_0x1338e3[_0xabe8('0x7')])),function(){});return _0x1338e3;})['then'](handleEntityNotFound(_0xf4865b,null))[_0xabe8('0x2d')](respondWithStatusCode(_0xf4865b,null))[_0xabe8('0x50')](handleError(_0xf4865b,null));};exports['webhookGet']=function(_0x46b1a9,_0x2b517e,_0x4a1002){return BPromise['resolve']()[_0xabe8('0x2d')](function(){if(!_0x46b1a9[_0xabe8('0x3c')][_0xabe8('0x7')]){throw new Error(_0xabe8('0xa0'));}if(!_0x46b1a9[_0xabe8('0x3c')][_0xabe8('0xa1')]){throw new Error(_0xabe8('0xa2'));}var _0x9d677c=_0x46b1a9[_0xabe8('0x3c')][_0xabe8('0xa3')]?_0x46b1a9[_0xabe8('0x3c')][_0xabe8('0xa3')]+':'+_0x46b1a9[_0xabe8('0x3c')][_0xabe8('0xa1')]:_0xabe8('0xa4')+_0x46b1a9[_0xabe8('0x3c')][_0xabe8('0xa1')];var _0x43e78c=_0x46b1a9[_0xabe8('0x3c')][_0xabe8('0x23')]?_0x46b1a9[_0xabe8('0x3c')][_0xabe8('0x23')]:!![];var _0x369391=_0x46b1a9[_0xabe8('0x3c')][_0xabe8('0xa5')]?_0x46b1a9['query'][_0xabe8('0xa5')]:null;var _0x4e05e4={'method':_0x46b1a9[_0xabe8('0xa6')],'uri':util[_0xabe8('0x59')]('%s%s',_0x9d677c,_0x46b1a9[_0xabe8('0x3c')]['path']),'json':_0x43e78c,'resolveWithFullResponse':!![],'encoding':_0x369391,'qs':_0x46b1a9[_0xabe8('0x3c')]};if(_0x46b1a9['headers']){_0x4e05e4[_0xabe8('0xa7')]=_0x46b1a9[_0xabe8('0xa7')];if(_0x4e05e4[_0xabe8('0xa7')][_0xabe8('0xa8')]){delete _0x4e05e4['headers'][_0xabe8('0xa8')];}}if(_0x4e05e4[_0xabe8('0xa7')][_0xabe8('0xa9')]){delete _0x4e05e4['headers']['content-type'];}return rp(_0x4e05e4);})[_0xabe8('0x2d')](function(_0x5aeed6){if(_0x5aeed6){_0x2b517e['set'](_0x5aeed6[_0xabe8('0xa7')]);logger[_0xabe8('0x6c')](_0x5aeed6[_0xabe8('0x97')]);if(_[_0xabe8('0xaa')](_0x46b1a9['query']['path'],_0xabe8('0x55'))&&_0x5aeed6[_0xabe8('0xab')]==0x1f4){return _0x2b517e[_0xabe8('0x20')](_0x5aeed6[_0xabe8('0xab')]);}else{return _0x2b517e[_0xabe8('0x21')](_0x5aeed6[_0xabe8('0xab')])[_0xabe8('0x35')](_0x5aeed6[_0xabe8('0x97')]);}}else{return _0x2b517e[_0xabe8('0x20')](0xc8);}})[_0xabe8('0x50')](handleError(_0x2b517e,null));};exports[_0xabe8('0xac')]=function(_0x53f853,_0x2a4242,_0x2dbd7a){return BPromise['resolve']()[_0xabe8('0x2d')](function(){if(!_0x53f853[_0xabe8('0x3c')][_0xabe8('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x53f853[_0xabe8('0x3c')][_0xabe8('0xa1')]){throw new Error(_0xabe8('0xa2'));}var _0xbf50f9=_0x53f853[_0xabe8('0x3c')][_0xabe8('0xa3')]?_0x53f853[_0xabe8('0x3c')][_0xabe8('0xa3')]+':'+_0x53f853[_0xabe8('0x3c')][_0xabe8('0xa1')]:_0xabe8('0xa4')+_0x53f853['query'][_0xabe8('0xa1')];var _0x2f3bd1=_0x53f853[_0xabe8('0x3c')][_0xabe8('0x23')]?_0x53f853[_0xabe8('0x3c')]['json']:!![];var _0x4c5fc4=_0x53f853[_0xabe8('0x3c')]['encoding']?_0x53f853[_0xabe8('0x3c')][_0xabe8('0xa5')]:null;var _0x4454bf={'method':_0x53f853['method'],'uri':util[_0xabe8('0x59')]('%s%s',_0xbf50f9,_0x53f853[_0xabe8('0x3c')]['path']),'json':_0x2f3bd1,'resolveWithFullResponse':!![],'encoding':_0x4c5fc4,'body':_0x53f853[_0xabe8('0x97')]};if(_0x53f853[_0xabe8('0xa7')]){_0x4454bf[_0xabe8('0xa7')]=_0x53f853[_0xabe8('0xa7')];if(_0x4454bf['headers'][_0xabe8('0xa8')]){delete _0x4454bf[_0xabe8('0xa7')][_0xabe8('0xa8')];}}if(_0x4454bf[_0xabe8('0xa7')][_0xabe8('0xa9')]){delete _0x4454bf[_0xabe8('0xa7')][_0xabe8('0xa9')];}return rp(_0x4454bf);})[_0xabe8('0x2d')](function(_0x1fa7ed){if(_0x1fa7ed){_0x2a4242['set'](_0x1fa7ed[_0xabe8('0xa7')]);logger[_0xabe8('0x6c')](_0x1fa7ed[_0xabe8('0x97')]);return _0x2a4242[_0xabe8('0x21')](_0x1fa7ed[_0xabe8('0xab')])[_0xabe8('0x35')](_0x1fa7ed[_0xabe8('0x97')]);}else{return _0x2a4242[_0xabe8('0x20')](0xc8);}})[_0xabe8('0x50')](handleError(_0x2a4242,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 89c44ad..c647c97 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 _0xa647=['../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x427352,_0x1bce61){var _0x23e0e6=function(_0x2a42a9){while(--_0x2a42a9){_0x427352['push'](_0x427352['shift']());}};_0x23e0e6(++_0x1bce61);}(_0xa647,0x81));var _0x7a64=function(_0x4dcc53,_0x55a677){_0x4dcc53=_0x4dcc53-0x0;var _0x105c89=_0xa647[_0x4dcc53];return _0x105c89;};'use strict';var EventEmitter=require(_0x7a64('0x0'));var Plugin=require(_0x7a64('0x1'))['db'][_0x7a64('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x7a64('0x3')](0x0);var events={'afterCreate':_0x7a64('0x4'),'afterUpdate':_0x7a64('0x5'),'afterDestroy':_0x7a64('0x6')};function emitEvent(_0x30b8b7){return function(_0x1c7a04,_0x2e1029,_0x46b8b0){PluginEvents[_0x7a64('0x7')](_0x30b8b7+':'+_0x1c7a04['id'],_0x1c7a04);PluginEvents['emit'](_0x30b8b7,_0x1c7a04);_0x46b8b0(null);};}for(var e in events){if(events[_0x7a64('0x8')](e)){var event=events[e];Plugin[_0x7a64('0x9')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0x82c4=['Plugin','setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x248a82,_0x4fca3e){var _0x4bef56=function(_0x1d68f6){while(--_0x1d68f6){_0x248a82['push'](_0x248a82['shift']());}};_0x4bef56(++_0x4fca3e);}(_0x82c4,0x1ca));var _0x482c=function(_0x1ab29e,_0x2058bd){_0x1ab29e=_0x1ab29e-0x0;var _0x401ea7=_0x82c4[_0x1ab29e];return _0x401ea7;};'use strict';var EventEmitter=require(_0x482c('0x0'));var Plugin=require(_0x482c('0x1'))['db'][_0x482c('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x482c('0x3')](0x0);var events={'afterCreate':_0x482c('0x4'),'afterUpdate':_0x482c('0x5'),'afterDestroy':_0x482c('0x6')};function emitEvent(_0x56de13){return function(_0x16b0f8,_0x5f4dee,_0x4556c8){PluginEvents['emit'](_0x56de13+':'+_0x16b0f8['id'],_0x16b0f8);PluginEvents[_0x482c('0x7')](_0x56de13,_0x16b0f8);_0x4556c8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x482c('0x8')](e,emitEvent(event));}}module[_0x482c('0x9')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index e92c7cf..7257af2 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 _0xea34=['request-promise','rimraf','exports','define','Plugin','plugins','lodash','bluebird'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xea34,0xbe));var _0x4ea3=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xea34[_0x4b2863];return _0x567d67;};'use strict';var _=require(_0x4ea3('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4ea3('0x1'));var rp=require(_0x4ea3('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4ea3('0x3'));var config=require('../../config/environment');var attributes=require('./plugin.attributes');module[_0x4ea3('0x4')]=function(_0x5f2c33,_0x2c9d4d){return _0x5f2c33[_0x4ea3('0x5')](_0x4ea3('0x6'),attributes,{'tableName':_0x4ea3('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd9cc=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define','plugins','util','../../config/logger'];(function(_0x57fcc0,_0x585004){var _0x5270df=function(_0x5f2db0){while(--_0x5f2db0){_0x57fcc0['push'](_0x57fcc0['shift']());}};_0x5270df(++_0x585004);}(_0xd9cc,0xb4));var _0xcd9c=function(_0x3613f0,_0x20b129){_0x3613f0=_0x3613f0-0x0;var _0x1d902b=_0xd9cc[_0x3613f0];return _0x1d902b;};'use strict';var _=require('lodash');var util=require(_0xcd9c('0x0'));var logger=require(_0xcd9c('0x1'))(_0xcd9c('0x2'));var moment=require(_0xcd9c('0x3'));var BPromise=require(_0xcd9c('0x4'));var rp=require(_0xcd9c('0x5'));var fs=require('fs');var path=require(_0xcd9c('0x6'));var rimraf=require(_0xcd9c('0x7'));var config=require(_0xcd9c('0x8'));var attributes=require(_0xcd9c('0x9'));module[_0xcd9c('0xa')]=function(_0x1686b9,_0x4654b4){return _0x1686b9[_0xcd9c('0xb')]('Plugin',attributes,{'tableName':_0xcd9c('0xc'),'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 a72b6f3..0a9f171 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 _0x7bd5=['request','then','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreatePlugin','Plugin','create','body','options','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','socket.io-emitter','./plugin.socket','register'];(function(_0x46e05a,_0x5b40b8){var _0x3e5908=function(_0x24201a){while(--_0x24201a){_0x46e05a['push'](_0x46e05a['shift']());}};_0x3e5908(++_0x5b40b8);}(_0x7bd5,0x1e1));var _0x57bd=function(_0x3e9383,_0x45cf30){_0x3e9383=_0x3e9383-0x0;var _0x3ac37e=_0x7bd5[_0x3e9383];return _0x3ac37e;};'use strict';var _=require(_0x57bd('0x0'));var util=require('util');var moment=require(_0x57bd('0x1'));var BPromise=require(_0x57bd('0x2'));var rs=require(_0x57bd('0x3'));var fs=require('fs');var Redis=require(_0x57bd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x57bd('0x5'));var logger=require(_0x57bd('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x57bd('0x7'));var client=jayson[_0x57bd('0x8')][_0x57bd('0x9')]({'port':0x232a});config[_0x57bd('0xa')]=_[_0x57bd('0xb')](config[_0x57bd('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x57bd('0xc'))(new Redis(config[_0x57bd('0xa')]));require(_0x57bd('0xd'))[_0x57bd('0xe')](socket);function respondWithRpcPromise(_0x2294c8,_0x3d5289,_0x3468ef){return new BPromise(function(_0x52581a,_0x5d5332){return client[_0x57bd('0xf')](_0x2294c8,_0x3468ef)[_0x57bd('0x10')](function(_0x449f4c){logger['info'](_0x57bd('0x11'),_0x3d5289,_0x57bd('0x12'));logger['debug'](_0x57bd('0x13'),_0x3d5289,'request\x20sent',JSON[_0x57bd('0x14')](_0x449f4c));if(_0x449f4c[_0x57bd('0x15')]){if(_0x449f4c[_0x57bd('0x15')][_0x57bd('0x16')]===0x1f4){logger['error'](_0x57bd('0x11'),_0x3d5289,_0x449f4c[_0x57bd('0x15')][_0x57bd('0x17')]);return _0x5d5332(_0x449f4c[_0x57bd('0x15')][_0x57bd('0x17')]);}logger[_0x57bd('0x15')](_0x57bd('0x11'),_0x3d5289,_0x449f4c[_0x57bd('0x15')]['message']);return _0x52581a(_0x449f4c[_0x57bd('0x15')][_0x57bd('0x17')]);}else{logger[_0x57bd('0x18')]('Plugin,\x20%s,\x20%s',_0x3d5289,_0x57bd('0x12'));_0x52581a(_0x449f4c['result']['message']);}})[_0x57bd('0x19')](function(_0x1f5b51){logger[_0x57bd('0x15')](_0x57bd('0x11'),_0x3d5289,_0x1f5b51);_0x5d5332(_0x1f5b51);});});}exports[_0x57bd('0x1a')]=function(_0x46ccdf){var _0x13b479=this;return new Promise(function(_0x53f792,_0x1960ea){return db[_0x57bd('0x1b')][_0x57bd('0x1c')](_0x46ccdf[_0x57bd('0x1d')],{'raw':_0x46ccdf[_0x57bd('0x1e')]?_0x46ccdf[_0x57bd('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x57bd('0x10')](function(_0x106bd4){logger[_0x57bd('0x18')]('CreatePlugin',_0x46ccdf);logger['debug'](_0x57bd('0x1a'),_0x46ccdf,JSON['stringify'](_0x106bd4));_0x53f792(_0x106bd4);})[_0x57bd('0x19')](function(_0x161a14){logger[_0x57bd('0x15')](_0x57bd('0x1a'),_0x161a14['message'],_0x46ccdf);_0x1960ea(_0x13b479[_0x57bd('0x15')](0x1f4,_0x161a14['message']));});});}; \ No newline at end of file +var _0x0c87=['Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','./plugin.socket','register','info','Plugin,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x13c4eb,_0x5d218c){var _0x421546=function(_0x4d2494){while(--_0x4d2494){_0x13c4eb['push'](_0x13c4eb['shift']());}};_0x421546(++_0x5d218c);}(_0x0c87,0x1d5));var _0x70c8=function(_0xd8323c,_0x21fd3a){_0xd8323c=_0xd8323c-0x0;var _0x35343c=_0x0c87[_0xd8323c];return _0x35343c;};'use strict';var _=require(_0x70c8('0x0'));var util=require(_0x70c8('0x1'));var moment=require(_0x70c8('0x2'));var BPromise=require(_0x70c8('0x3'));var rs=require(_0x70c8('0x4'));var fs=require('fs');var Redis=require(_0x70c8('0x5'));var db=require(_0x70c8('0x6'))['db'];var utils=require(_0x70c8('0x7'));var logger=require(_0x70c8('0x8'))('rpc');var config=require(_0x70c8('0x9'));var jayson=require(_0x70c8('0xa'));var client=jayson['client'][_0x70c8('0xb')]({'port':0x232a});config[_0x70c8('0xc')]=_[_0x70c8('0xd')](config[_0x70c8('0xc')],{'host':_0x70c8('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x70c8('0xc')]));require(_0x70c8('0xf'))[_0x70c8('0x10')](socket);function respondWithRpcPromise(_0x3118c3,_0x1dfd93,_0x8e7ae2){return new BPromise(function(_0x36eb80,_0x34ec44){return client['request'](_0x3118c3,_0x8e7ae2)['then'](function(_0x71553a){logger[_0x70c8('0x11')](_0x70c8('0x12'),_0x1dfd93,_0x70c8('0x13'));logger[_0x70c8('0x14')](_0x70c8('0x15'),_0x1dfd93,_0x70c8('0x13'),JSON[_0x70c8('0x16')](_0x71553a));if(_0x71553a['error']){if(_0x71553a[_0x70c8('0x17')][_0x70c8('0x18')]===0x1f4){logger[_0x70c8('0x17')](_0x70c8('0x12'),_0x1dfd93,_0x71553a[_0x70c8('0x17')]['message']);return _0x34ec44(_0x71553a[_0x70c8('0x17')][_0x70c8('0x19')]);}logger[_0x70c8('0x17')](_0x70c8('0x12'),_0x1dfd93,_0x71553a[_0x70c8('0x17')]['message']);return _0x36eb80(_0x71553a[_0x70c8('0x17')][_0x70c8('0x19')]);}else{logger[_0x70c8('0x11')](_0x70c8('0x12'),_0x1dfd93,_0x70c8('0x13'));_0x36eb80(_0x71553a[_0x70c8('0x1a')][_0x70c8('0x19')]);}})[_0x70c8('0x1b')](function(_0x3684e3){logger['error']('Plugin,\x20%s,\x20%s',_0x1dfd93,_0x3684e3);_0x34ec44(_0x3684e3);});});}exports[_0x70c8('0x1c')]=function(_0x2c318f){var _0x44112c=this;return new Promise(function(_0x186e0e,_0x159e6d){return db[_0x70c8('0x1d')][_0x70c8('0x1e')](_0x2c318f[_0x70c8('0x1f')],{'raw':_0x2c318f[_0x70c8('0x20')]?_0x2c318f['options'][_0x70c8('0x21')]===undefined?!![]:![]:!![]})[_0x70c8('0x22')](function(_0x1e8d8d){logger['info'](_0x70c8('0x1c'),_0x2c318f);logger[_0x70c8('0x14')](_0x70c8('0x1c'),_0x2c318f,JSON[_0x70c8('0x16')](_0x1e8d8d));_0x186e0e(_0x1e8d8d);})[_0x70c8('0x1b')](function(_0x110d4e){logger['error']('CreatePlugin',_0x110d4e[_0x70c8('0x19')],_0x2c318f);_0x159e6d(_0x44112c['error'](0x1f4,_0x110d4e[_0x70c8('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 9b9b85a..efba612 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 _0xa0aa=['update','emit','removeListener','register','length','plugin:','./plugin.events','save','remove'];(function(_0x26eb79,_0x2ac0d7){var _0x5c8bbf=function(_0x178986){while(--_0x178986){_0x26eb79['push'](_0x26eb79['shift']());}};_0x5c8bbf(++_0x2ac0d7);}(_0xa0aa,0x114));var _0xaa0a=function(_0x442fed,_0x1a0b70){_0x442fed=_0x442fed-0x0;var _0x2b847c=_0xa0aa[_0x442fed];return _0x2b847c;};'use strict';var PluginEvents=require(_0xaa0a('0x0'));var events=[_0xaa0a('0x1'),_0xaa0a('0x2'),_0xaa0a('0x3')];function createListener(_0x2f9751,_0xe94f5b){return function(_0x92e6b0){_0xe94f5b[_0xaa0a('0x4')](_0x2f9751,_0x92e6b0);};}function removeListener(_0x455818,_0x2c1ab9){return function(){PluginEvents[_0xaa0a('0x5')](_0x455818,_0x2c1ab9);};}exports[_0xaa0a('0x6')]=function(_0x31fc5d){for(var _0x4b4ba0=0x0,_0x514c9b=events[_0xaa0a('0x7')];_0x4b4ba0<_0x514c9b;_0x4b4ba0++){var _0x30b8b2=events[_0x4b4ba0];var _0x1cb267=createListener(_0xaa0a('0x8')+_0x30b8b2,_0x31fc5d);PluginEvents['on'](_0x30b8b2,_0x1cb267);}}; \ No newline at end of file +var _0x6537=['save','remove','update','emit','removeListener','length','plugin:','./plugin.events'];(function(_0x407160,_0x149b19){var _0x22206d=function(_0x108f05){while(--_0x108f05){_0x407160['push'](_0x407160['shift']());}};_0x22206d(++_0x149b19);}(_0x6537,0x167));var _0x7653=function(_0x50e14a,_0x2f7fc4){_0x50e14a=_0x50e14a-0x0;var _0x28a38c=_0x6537[_0x50e14a];return _0x28a38c;};'use strict';var PluginEvents=require(_0x7653('0x0'));var events=[_0x7653('0x1'),_0x7653('0x2'),_0x7653('0x3')];function createListener(_0x3a9c86,_0x34183c){return function(_0x492ebf){_0x34183c[_0x7653('0x4')](_0x3a9c86,_0x492ebf);};}function removeListener(_0x58f0da,_0x54a007){return function(){PluginEvents[_0x7653('0x5')](_0x58f0da,_0x54a007);};}exports['register']=function(_0x2e6e7b){for(var _0x2cbac5=0x0,_0x811b=events[_0x7653('0x6')];_0x2cbac5<_0x811b;_0x2cbac5++){var _0x6f4dc4=events[_0x2cbac5];var _0x1a1484=createListener(_0x7653('0x7')+_0x6f4dc4,_0x2e6e7b);PluginEvents['on'](_0x6f4dc4,_0x1a1484);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 6afac40..f3262f0 100644 --- a/server/api/pm2/index.js +++ b/server/api/pm2/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x4a4a3f,_0x102e4c){var _0x33857e=function(_0x379003){while(--_0x379003){_0x4a4a3f['push'](_0x4a4a3f['shift']());}};_0x33857e(++_0x102e4c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file +var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x2819ad,_0x5322a6){var _0x291471=function(_0x2a6f99){while(--_0x2a6f99){_0x2819ad['push'](_0x2819ad['shift']());}};_0x291471(++_0x5322a6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index 6525d1f..d207053 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 _0x4fdb=['lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','status','json','error','stack','name','send','npm\x20install','info','index','then','reject','express','motion2','length','catch','show','describe','params','body','script','join','../../files/plugins','cwd','chdir','dump','restart','stop','hasOwnProperty','Unknown\x20status','destroy','Unknown\x20id'];(function(_0xdd383f,_0x17468b){var _0x571a36=function(_0x31509d){while(--_0x31509d){_0xdd383f['push'](_0xdd383f['shift']());}};_0x571a36(++_0x17468b);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x228770,_0x544f8b){_0x228770=_0x228770-0x0;var _0x548c01=_0x4fdb[_0x228770];return _0x548c01;};'use strict';var _=require(_0xb4fd('0x0'));var pm2=require(_0xb4fd('0x1'));var logger=require(_0xb4fd('0x2'))(_0xb4fd('0x3'));var path=require(_0xb4fd('0x4'));var exec=require(_0xb4fd('0x5'))[_0xb4fd('0x6')];var BPromise=require(_0xb4fd('0x7'));function handleEntityNotFound(_0x1c0b08,_0x5b73bb){return function(_0x308de6){if(!_0x308de6){_0x1c0b08['sendStatus'](0x194);;}return _0x308de6;};}function respondWithResult(_0x14052b,_0x5d8b39){_0x5d8b39=_0x5d8b39||0xc8;return function(_0x53273f){if(_0x53273f){return _0x14052b[_0xb4fd('0x8')](_0x5d8b39)[_0xb4fd('0x9')](_0x53273f);}return null;};}function handleError(_0x1151b5,_0x52dca2){_0x52dca2=_0x52dca2||0x1f4;return function(_0x526d3b){logger[_0xb4fd('0xa')](_0x526d3b[_0xb4fd('0xb')]);if(_0x526d3b[_0xb4fd('0xc')]){delete _0x526d3b['name'];}_0x1151b5[_0xb4fd('0x8')](_0x52dca2)[_0xb4fd('0xd')](_0x526d3b);};}function execChildProcess(){return new BPromise(function(_0x2148db,_0x23b08f){exec(_0xb4fd('0xe'),function(_0x502379,_0xd05458,_0x1f3e30){logger[_0xb4fd('0xf')](_0xd05458);logger[_0xb4fd('0xf')](_0x1f3e30);if(_0x502379){logger['error'](_0x502379);return _0x23b08f(_0x502379);}return _0x2148db(_0xd05458);});});}exports[_0xb4fd('0x10')]=function(_0x65f08a,_0x345d35){return pm2['list']()[_0xb4fd('0x11')](function(_0x1234d7){if(_0x1234d7){var _0xc35d8d=_[_0xb4fd('0x12')](_0x1234d7,function(_0x36e88f){return _0x36e88f[_0xb4fd('0xc')]===_0xb4fd('0x13')||_0x36e88f['name']===_0xb4fd('0x14');});return{'rows':_0xc35d8d,'count':_0xc35d8d[_0xb4fd('0x15')]};}return null;})[_0xb4fd('0x11')](respondWithResult(_0x345d35,null))[_0xb4fd('0x16')](handleError(_0x345d35,null));};exports[_0xb4fd('0x17')]=function(_0x137e51,_0x1d0812){return pm2[_0xb4fd('0x18')](_0x137e51[_0xb4fd('0x19')]['id'])[_0xb4fd('0x11')](respondWithResult(_0x1d0812,null))[_0xb4fd('0x11')](handleEntityNotFound(_0x1d0812,null))['catch'](handleError(_0x1d0812,null));};exports['create']=function(_0x504e80,_0x5c14c0){if(_0x504e80[_0xb4fd('0x1a')][_0xb4fd('0xc')]&&_0x504e80[_0xb4fd('0x1a')][_0xb4fd('0x1b')]){var _0x458133=path[_0xb4fd('0x1c')](__dirname,_0xb4fd('0x1d'),_0x504e80['body']['script']);var _0x216307=process[_0xb4fd('0x1e')]();process[_0xb4fd('0x1f')](path['dirname'](_0x458133));return execChildProcess()[_0xb4fd('0x11')](function(_0x49d42c){process[_0xb4fd('0x1f')](_0x216307);return pm2['start']({'name':_0x504e80[_0xb4fd('0x1a')][_0xb4fd('0xc')],'script':_0x458133});})[_0xb4fd('0x11')](function(_0x261eda){pm2[_0xb4fd('0x20')]();return _0x261eda[0x0];})[_0xb4fd('0x11')](respondWithResult(_0x5c14c0,0xc9))[_0xb4fd('0x16')](handleError(_0x5c14c0,null));}else{return _0x5c14c0[_0xb4fd('0x8')](0x1f4)['send']({'message':'Missing\x20name\x20and/or\x20path'});}};exports['update']=function(_0x453982,_0x4bad85){if(_0x453982[_0xb4fd('0x1a')]['id']){delete _0x453982['body']['id'];}var _0x5738c2={'online':_0xb4fd('0x21'),'stopped':_0xb4fd('0x22')};if(_0x5738c2[_0xb4fd('0x23')](_0x453982['body'][_0xb4fd('0x8')])){return pm2[_0x5738c2[_0x453982[_0xb4fd('0x1a')][_0xb4fd('0x8')]]](_0x453982[_0xb4fd('0x19')]['id'])['then'](respondWithResult(_0x4bad85,0xc8))[_0xb4fd('0x16')](handleError(_0x4bad85,null));}else{return _0x4bad85[_0xb4fd('0x8')](0x1f4)['send']({'message':_0xb4fd('0x24')});}};exports[_0xb4fd('0x25')]=function(_0xbe7d2c,_0x597874){if(_0xbe7d2c[_0xb4fd('0x1a')]['id']){delete _0xbe7d2c[_0xb4fd('0x1a')]['id'];}if(_0xbe7d2c[_0xb4fd('0x19')]['id']){return pm2['delete'](_0xbe7d2c['params']['id'])['then'](function(_0x5f36e4){pm2[_0xb4fd('0x20')]();return _0x5f36e4[0x0];})[_0xb4fd('0x11')](respondWithResult(_0x597874,null))[_0xb4fd('0x16')](handleError(_0x597874,null));}else{return _0x597874[_0xb4fd('0x8')](0x1f4)[_0xb4fd('0xd')]({'message':_0xb4fd('0x26')});}}; \ No newline at end of file +var _0x7a2c=['start','dump','catch','status','Missing\x20name\x20and/or\x20path','restart','stop','hasOwnProperty','destroy','Unknown\x20id','lodash','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','json','stack','name','send','npm\x20install','info','index','list','then','reject','express','motion2','length','show','describe','params','create','body','join','script','cwd','chdir','dirname'];(function(_0x564949,_0x465317){var _0x4bd267=function(_0x4fea71){while(--_0x4fea71){_0x564949['push'](_0x564949['shift']());}};_0x4bd267(++_0x465317);}(_0x7a2c,0x17b));var _0xc7a2=function(_0x163917,_0xeb5843){_0x163917=_0x163917-0x0;var _0x2356e3=_0x7a2c[_0x163917];return _0x2356e3;};'use strict';var _=require(_0xc7a2('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xc7a2('0x1'))(_0xc7a2('0x2'));var path=require(_0xc7a2('0x3'));var exec=require(_0xc7a2('0x4'))[_0xc7a2('0x5')];var BPromise=require(_0xc7a2('0x6'));function handleEntityNotFound(_0x3f2b0d,_0x34cd60){return function(_0x489232){if(!_0x489232){_0x3f2b0d[_0xc7a2('0x7')](0x194);;}return _0x489232;};}function respondWithResult(_0x1ddbae,_0x5f334e){_0x5f334e=_0x5f334e||0xc8;return function(_0x481430){if(_0x481430){return _0x1ddbae['status'](_0x5f334e)[_0xc7a2('0x8')](_0x481430);}return null;};}function handleError(_0x3de428,_0x3f0573){_0x3f0573=_0x3f0573||0x1f4;return function(_0x426fea){logger['error'](_0x426fea[_0xc7a2('0x9')]);if(_0x426fea[_0xc7a2('0xa')]){delete _0x426fea[_0xc7a2('0xa')];}_0x3de428['status'](_0x3f0573)[_0xc7a2('0xb')](_0x426fea);};}function execChildProcess(){return new BPromise(function(_0x4a44c7,_0x3e216a){exec(_0xc7a2('0xc'),function(_0x1a9b38,_0x540267,_0x226982){logger[_0xc7a2('0xd')](_0x540267);logger[_0xc7a2('0xd')](_0x226982);if(_0x1a9b38){logger['error'](_0x1a9b38);return _0x3e216a(_0x1a9b38);}return _0x4a44c7(_0x540267);});});}exports[_0xc7a2('0xe')]=function(_0x1b7844,_0x181f0c){return pm2[_0xc7a2('0xf')]()[_0xc7a2('0x10')](function(_0x2af363){if(_0x2af363){var _0x15d4cf=_[_0xc7a2('0x11')](_0x2af363,function(_0x275be9){return _0x275be9[_0xc7a2('0xa')]===_0xc7a2('0x12')||_0x275be9[_0xc7a2('0xa')]===_0xc7a2('0x13');});return{'rows':_0x15d4cf,'count':_0x15d4cf[_0xc7a2('0x14')]};}return null;})[_0xc7a2('0x10')](respondWithResult(_0x181f0c,null))['catch'](handleError(_0x181f0c,null));};exports[_0xc7a2('0x15')]=function(_0x59e8ad,_0x2414f4){return pm2[_0xc7a2('0x16')](_0x59e8ad[_0xc7a2('0x17')]['id'])[_0xc7a2('0x10')](respondWithResult(_0x2414f4,null))['then'](handleEntityNotFound(_0x2414f4,null))['catch'](handleError(_0x2414f4,null));};exports[_0xc7a2('0x18')]=function(_0x22e80a,_0x51cbb3){if(_0x22e80a['body']['name']&&_0x22e80a[_0xc7a2('0x19')]['script']){var _0x155c42=path[_0xc7a2('0x1a')](__dirname,'../../files/plugins',_0x22e80a[_0xc7a2('0x19')][_0xc7a2('0x1b')]);var _0x1b51a1=process[_0xc7a2('0x1c')]();process[_0xc7a2('0x1d')](path[_0xc7a2('0x1e')](_0x155c42));return execChildProcess()[_0xc7a2('0x10')](function(_0x4a05e1){process['chdir'](_0x1b51a1);return pm2[_0xc7a2('0x1f')]({'name':_0x22e80a[_0xc7a2('0x19')]['name'],'script':_0x155c42});})[_0xc7a2('0x10')](function(_0x3cad61){pm2[_0xc7a2('0x20')]();return _0x3cad61[0x0];})[_0xc7a2('0x10')](respondWithResult(_0x51cbb3,0xc9))[_0xc7a2('0x21')](handleError(_0x51cbb3,null));}else{return _0x51cbb3[_0xc7a2('0x22')](0x1f4)[_0xc7a2('0xb')]({'message':_0xc7a2('0x23')});}};exports['update']=function(_0x35a6e0,_0x505fe8){if(_0x35a6e0[_0xc7a2('0x19')]['id']){delete _0x35a6e0['body']['id'];}var _0x20404b={'online':_0xc7a2('0x24'),'stopped':_0xc7a2('0x25')};if(_0x20404b[_0xc7a2('0x26')](_0x35a6e0['body']['status'])){return pm2[_0x20404b[_0x35a6e0[_0xc7a2('0x19')][_0xc7a2('0x22')]]](_0x35a6e0[_0xc7a2('0x17')]['id'])[_0xc7a2('0x10')](respondWithResult(_0x505fe8,0xc8))[_0xc7a2('0x21')](handleError(_0x505fe8,null));}else{return _0x505fe8[_0xc7a2('0x22')](0x1f4)[_0xc7a2('0xb')]({'message':'Unknown\x20status'});}};exports[_0xc7a2('0x27')]=function(_0x926b6c,_0x496386){if(_0x926b6c[_0xc7a2('0x19')]['id']){delete _0x926b6c[_0xc7a2('0x19')]['id'];}if(_0x926b6c[_0xc7a2('0x17')]['id']){return pm2['delete'](_0x926b6c[_0xc7a2('0x17')]['id'])['then'](function(_0x1f9bdc){pm2['dump']();return _0x1f9bdc[0x0];})['then'](respondWithResult(_0x496386,null))[_0xc7a2('0x21')](handleError(_0x496386,null));}else{return _0x496386['status'](0x1f4)['send']({'message':_0xc7a2('0x28')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index bd8daef..f29c9d9 100644 --- a/server/api/realtime/index.js +++ b/server/api/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb17a=['get','getAgents','/queues','isAuthenticated','getQueues','exports','express','Router','../../components/auth/service','./realtime.controller'];(function(_0x48ba04,_0x3f0913){var _0x3bb908=function(_0x5b041b){while(--_0x5b041b){_0x48ba04['push'](_0x48ba04['shift']());}};_0x3bb908(++_0x3f0913);}(_0xb17a,0x182));var _0xab17=function(_0x1a1454,_0x2a6dd4){_0x1a1454=_0x1a1454-0x0;var _0x545248=_0xb17a[_0x1a1454];return _0x545248;};'use strict';var express=require(_0xab17('0x0'));var router=express[_0xab17('0x1')]();var auth=require(_0xab17('0x2'));var controller=require(_0xab17('0x3'));router[_0xab17('0x4')]('/agents',auth['isAuthenticated'](),controller[_0xab17('0x5')]);router[_0xab17('0x4')](_0xab17('0x6'),auth[_0xab17('0x7')](),controller[_0xab17('0x8')]);module[_0xab17('0x9')]=router; \ No newline at end of file +var _0x6258=['express','Router','../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated','getQueues','exports'];(function(_0x337020,_0x12b4f1){var _0x401131=function(_0x19cb51){while(--_0x19cb51){_0x337020['push'](_0x337020['shift']());}};_0x401131(++_0x12b4f1);}(_0x6258,0x1ef));var _0x8625=function(_0xab7583,_0x59a843){_0xab7583=_0xab7583-0x0;var _0x47f0d3=_0x6258[_0xab7583];return _0x47f0d3;};'use strict';var express=require(_0x8625('0x0'));var router=express[_0x8625('0x1')]();var auth=require(_0x8625('0x2'));var controller=require(_0x8625('0x3'));router[_0x8625('0x4')](_0x8625('0x5'),auth[_0x8625('0x6')](),controller['getAgents']);router[_0x8625('0x4')]('/queues',auth['isAuthenticated'](),controller[_0x8625('0x7')]);module[_0x8625('0x8')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 897bab4..187d146 100644 --- a/server/api/realtime/realtime.controller.js +++ b/server/api/realtime/realtime.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x39d6=['getRealtimeQueues','rows','lodash','util','../../components/realtime/queues','../../config/utils','../../mysqldb','../../errors/api','APIBadRequestError','handleError','offset','limit','undefined','count','status','set','Content-Range','json','getAgents','getChannels','globalQueueFilter','query','globalStatusFilter','pauseTypeFilter','pause','*pause','resolve','then','channel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','validateSortParameter','getUpdatedSortOptions','fields','join','order','getAgentIdsByQueues','getRealtimeAgents','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','User','rawAttributes','fieldName','type','role','getOptions','raw','sequelize','literal','FIELD(id,','push','Pause','forEach','merge','where','user','userProfileId','Agents','agent','extraQueryConditions','assign','UserProfile','getResources','findAndCountAll','find','filterAgentAttributes','globalStatus','getAgentStatus','Status','sortAgentsByStatus','split','pick','catch','Queue','name','voice','outbound','dialMethod','startCase','filter'];(function(_0x283f1a,_0x271f9a){var _0x3eeb4c=function(_0x3c2780){while(--_0x3c2780){_0x283f1a['push'](_0x283f1a['shift']());}};_0x3eeb4c(++_0x271f9a);}(_0x39d6,0xac));var _0x639d=function(_0x1d8f23,_0x1d4573){_0x1d8f23=_0x1d8f23-0x0;var _0x9499d7=_0x39d6[_0x1d8f23];return _0x9499d7;};'use strict';var _=require(_0x639d('0x0'));var util=require(_0x639d('0x1'));var rta=require('../../components/realtime/agents');var rtq=require(_0x639d('0x2'));var qs=require('../../components/parsers/qs');var utils=require(_0x639d('0x3'));var db=require(_0x639d('0x4'))['db'];var APIBadRequestError=require(_0x639d('0x5'))[_0x639d('0x6')];var APIHandleError=require(_0x639d('0x5'))[_0x639d('0x7')];function respondWithFilteredResult(_0x2e1f8c,_0x3f6716){return function(_0x101228){if(_0x101228){var _0x499c97=typeof _0x3f6716[_0x639d('0x8')]==='undefined'&&typeof _0x3f6716[_0x639d('0x9')]===_0x639d('0xa');var _0x606952=_0x101228['count'];var _0x2d392=_0x499c97?0x0:_0x3f6716[_0x639d('0x8')];var _0x519b9a=_0x499c97?_0x101228[_0x639d('0xb')]:_0x3f6716[_0x639d('0x8')]+_0x3f6716[_0x639d('0x9')];var _0x15ed45;if(_0x519b9a>=_0x606952){_0x519b9a=_0x606952;_0x15ed45=0xc8;}else{_0x15ed45=0xce;}_0x2e1f8c[_0x639d('0xc')](_0x15ed45);return _0x2e1f8c[_0x639d('0xd')](_0x639d('0xe'),_0x2d392+'-'+_0x519b9a+'/'+_0x606952)[_0x639d('0xf')](_0x101228);}return null;};}exports[_0x639d('0x10')]=function(_0x3cf053,_0x593979){var _0x18f6de={'count':0x0,'rows':[]};var _0xcf736f={};var _0x2e2f4e;var _0x3fb6ff=utils[_0x639d('0x11')]();var _0x41afd2;var _0x44f0ff;var _0x1c90b3=_0x3cf053['query'][_0x639d('0x12')];var _0x3b8997=_0x3cf053[_0x639d('0x13')][_0x639d('0x14')];var _0x3eab56=_0x3cf053[_0x639d('0x13')][_0x639d('0x15')];var _0x2d9854=_0x3b8997===_0x639d('0x16')||_0x3b8997===_0x639d('0x17')?!![]:![];var _0x181cc5=[];var _0x443d84;var _0x45ebfa;Promise[_0x639d('0x18')]()[_0x639d('0x19')](function(){if(_0x3cf053['query'][_0x639d('0x1a')]){if(!utils['isValidChannel'](_0x3cf053[_0x639d('0x13')][_0x639d('0x1a')])){throw new APIBadRequestError(util[_0x639d('0x1b')](_0x639d('0x1c'),_0x3cf053['query'][_0x639d('0x1a')]));}_0x2e2f4e=_0x3cf053[_0x639d('0x13')]['channel'][_0x639d('0x1d')]();}if(!_0x3cf053['query'][_0x639d('0x1e')]||!_0x3cf053[_0x639d('0x13')][_0x639d('0x1e')][_0x639d('0x1f')]('globalStatus')){_0x3cf053[_0x639d('0x13')]['sort']=rta[_0x639d('0x20')](_0x3cf053[_0x639d('0x13')][_0x639d('0x1e')]);return;}var _0x986c24=rta[_0x639d('0x21')](_0x3cf053[_0x639d('0x13')][_0x639d('0x1e')]);_0x3cf053[_0x639d('0x13')][_0x639d('0x1e')]=_0x986c24[_0x639d('0x22')][_0x639d('0x23')](',');_0x443d84=_0x986c24[_0x639d('0x24')];})[_0x639d('0x19')](function(){if(!_0x1c90b3){return[];}return rta[_0x639d('0x25')](_0x1c90b3,_0x2e2f4e);})['then'](function(_0x606046){_0x181cc5=_0x606046;return rta[_0x639d('0x26')]();})[_0x639d('0x19')](function(_0x568b41){_0x44f0ff=_0x568b41['rows'];if((!_0x3b8997||_0x2d9854)&&!_0x443d84){return _0x181cc5;}if(_0x443d84&&!_0x3b8997){return rta[_0x639d('0x27')](_0x44f0ff,_0x181cc5,_0x443d84);}else{return rta[_0x639d('0x28')](_0x44f0ff,_0x181cc5,_0x3b8997);}})[_0x639d('0x19')](function(_0xc0513b){_0x181cc5=_0xc0513b;var _0x33ac93=![];if(_0x181cc5[_0x639d('0x29')]===0x0){if(_0x1c90b3||_0x3b8997){_0x33ac93=!![];}if(_0x2d9854){_0x33ac93=![];}}if(_0x33ac93){return _0x18f6de;}var _0x560b8b=_[_0x639d('0x2a')](db[_0x639d('0x2b')][_0x639d('0x2c')],function(_0x3fbfca){return{'name':_0x3fbfca[_0x639d('0x2d')],'type':_0x3fbfca[_0x639d('0x2e')]['key']};});_0x3cf053[_0x639d('0x13')][_0x639d('0x2f')]='agent';_0x3cf053[_0x639d('0x13')]['online']=!![];_0xcf736f=qs[_0x639d('0x30')](_0x560b8b,_0x3cf053);_0xcf736f[_0x639d('0x31')]=!![];var _0x34761f=[];if(_0x181cc5['length']>0x0){_0x34761f['push']({'id':{'$in':_0x181cc5}});if(_0x443d84&&!_0x3b8997){_0x45ebfa=[db[_0x639d('0x32')][_0x639d('0x33')](_0x639d('0x34')+_0x181cc5+')')];_0xcf736f[_0x639d('0x24')]=_0x45ebfa;}}if(_0x2d9854){_0x3fb6ff['forEach'](function(_0x11eacf){var _0x5dd598=!![];if(_0x3b8997===_0x639d('0x17')&&_0x2e2f4e!==_0x11eacf){_0x5dd598=![];}_0x34761f[_0x639d('0x35')]({[_0x11eacf+_0x639d('0x36')]:_0x5dd598});});if(_0x3eab56){_0x34761f['push']({'pauseType':_0x3eab56});}}else if(_0x3b8997){_0x3fb6ff[_0x639d('0x37')](function(_0x2593f2){_0x34761f[_0x639d('0x35')]({[_0x2593f2+_0x639d('0x36')]:![]});});}_0xcf736f['where']=_[_0x639d('0x38')](_0xcf736f[_0x639d('0x39')],{'$and':_0x34761f});if(_0x3cf053[_0x639d('0x3a')][_0x639d('0x2f')]==='user'){var _0x2c1aac={'params':{'id':_0x3cf053[_0x639d('0x3a')][_0x639d('0x3b')]},'query':{'section':_0x639d('0x3c'),'role':_0x639d('0x3d'),'online':!![],'raw':!![],'ids':_0x181cc5,'customSorting':_0x45ebfa}};if(_0x2d9854){_0x2c1aac['query'][_0x639d('0x3e')]=_0x34761f;}_0x2c1aac[_0x639d('0x13')]=Object[_0x639d('0x3f')](_0x2c1aac['query'],_0x3cf053[_0x639d('0x13')]);delete _0x2c1aac[_0x639d('0x13')]['id'];return db[_0x639d('0x40')][_0x639d('0x41')](_0x2c1aac);}return db['User'][_0x639d('0x42')](_0xcf736f);})[_0x639d('0x19')](function(_0x45feb6){_0x18f6de[_0x639d('0xb')]=_0x45feb6[_0x639d('0xb')];_0x41afd2=_0x45feb6['rows'];return _0x41afd2[_0x639d('0x2a')](function(_0xe575c1){var _0x23828c=_[_0x639d('0x43')](_0x44f0ff,['id',_0xe575c1['id']]);if(_0x23828c){var _0x4d5c59=rta[_0x639d('0x44')](_0x23828c);_['merge'](_0xe575c1,_0x4d5c59);}_0xe575c1[_0x639d('0x45')]=rta[_0x639d('0x46')](_0xe575c1);if(_0xe575c1[_0x639d('0x45')][_0x639d('0x1f')](_0x639d('0x16'))){_0x3fb6ff[_0x639d('0x37')](function(_0x4897c7){if(_0xe575c1[_0x4897c7+_0x639d('0x36')]){_0xe575c1[_0x4897c7+_0x639d('0x47')]=_0x639d('0x16');}});}return _0xe575c1;});})[_0x639d('0x19')](function(_0xc0e873){if(!_0x443d84||_0x45ebfa){return _0xc0e873;}return rta[_0x639d('0x48')](_0xc0e873,_0x443d84);})[_0x639d('0x19')](function(_0x2205c1){var _0x385965=null;if(_0x3cf053[_0x639d('0x13')][_0x639d('0x22')]){var _0x1e9688=_0x3cf053[_0x639d('0x13')]['fields'][_0x639d('0x49')](',');_0x385965=_0x2205c1['map'](function(_0x29e6a0){return _[_0x639d('0x4a')](_0x29e6a0,_0x1e9688);});}_0x18f6de['rows']=_0x385965||_0x2205c1;return _0x18f6de;})['then'](respondWithFilteredResult(_0x593979,_0xcf736f))[_0x639d('0x4b')](APIHandleError(_0x593979));};exports['getQueues']=function(_0x1d7797,_0x27da3e){var _0x220441={'count':0x0,'rows':[]};var _0x5b99cd={};var _0x2ec63f;var _0x6b7c57;var _0x5ec9cc;Promise['resolve']()[_0x639d('0x19')](function(){if(_0x1d7797[_0x639d('0x13')][_0x639d('0x1a')]){if(!utils['isValidChannel'](_0x1d7797[_0x639d('0x13')]['channel'])){throw new APIBadRequestError(util[_0x639d('0x1b')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x1d7797[_0x639d('0x13')]['channel']));}_0x2ec63f=_0x1d7797[_0x639d('0x13')][_0x639d('0x1a')][_0x639d('0x1d')]();}var _0x992244=_['startCase'](_0x2ec63f)+_0x639d('0x4c');var _0x2ce756=_['map'](db[_0x992244][_0x639d('0x2c')],function(_0x8f11e){return{'name':_0x8f11e['fieldName'],'type':_0x8f11e[_0x639d('0x2e')]['key']};});if(!_0x1d7797['query'][_0x639d('0x22')]){var _0x43a881=['id',_0x639d('0x4d')];if(_0x2ec63f===_0x639d('0x4e')){_0x43a881[_0x639d('0x35')]('type');if(_0x1d7797[_0x639d('0x13')][_0x639d('0x2e')]===_0x639d('0x4f')){_0x43a881[_0x639d('0x35')](['dialActive',_0x639d('0x50')]);}}_0x1d7797['query'][_0x639d('0x22')]=_0x43a881[_0x639d('0x23')](',');}_0x5b99cd=qs[_0x639d('0x30')](_0x2ce756,_0x1d7797);if(_0x1d7797[_0x639d('0x3a')][_0x639d('0x2f')]===_0x639d('0x3a')){var _0x30d238={'params':{'id':_0x1d7797['user']['userProfileId']},'query':{'section':_0x2ec63f==='voice'&&_0x1d7797[_0x639d('0x13')][_0x639d('0x2e')]===_0x639d('0x4f')?'QueueCampaigns':_[_0x639d('0x51')](_0x2ec63f)+'Queues','type':_0x1d7797['query']['type'],'nolimit':!![],'sort':_0x639d('0x4d'),'filter':_0x1d7797['query'][_0x639d('0x52')]}};return db[_0x639d('0x40')][_0x639d('0x41')](_0x30d238);}return db[_0x992244][_0x639d('0x42')](_0x5b99cd);})[_0x639d('0x19')](function(_0x2fbd5a){_0x220441[_0x639d('0xb')]=_0x2fbd5a[_0x639d('0xb')];_0x6b7c57=_0x2fbd5a['rows'];return rtq[_0x639d('0x53')](_0x1d7797,_0x2ec63f);})[_0x639d('0x19')](function(_0x449475){_0x5ec9cc=_0x449475[_0x639d('0x54')];return rtq['initializeQueues'](_0x6b7c57,_0x5ec9cc,_0x2ec63f,_0x1d7797['query']['type']);})[_0x639d('0x19')](function(_0x30e896){_0x220441[_0x639d('0x54')]=_0x30e896;return _0x220441;})[_0x639d('0x19')](respondWithFilteredResult(_0x27da3e,_0x5b99cd))[_0x639d('0x4b')](APIHandleError(_0x27da3e));}; \ No newline at end of file +var _0xbae7=['getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','User','rawAttributes','fieldName','type','agent','online','push','sequelize','literal','FIELD(id,','order','forEach','*pause','Pause','where','merge','role','user','userProfileId','extraQueryConditions','UserProfile','getResources','find','filterAgentAttributes','getAgentStatus','sortAgentsByStatus','split','pick','catch','getQueues','Queue','key','outbound','dialActive','dialMethod','join','getOptions','voice','QueueCampaigns','Queues','filter','findAndCountAll','getRealtimeQueues','initializeQueues','lodash','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','handleError','offset','limit','undefined','count','set','json','getAgents','getChannels','globalQueueFilter','query','globalStatusFilter','pauseTypeFilter','pause','resolve','then','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','getAgentIdsByQueues','getRealtimeAgents','rows'];(function(_0x1c7d3b,_0x36a7c7){var _0x43f1f2=function(_0x289d41){while(--_0x289d41){_0x1c7d3b['push'](_0x1c7d3b['shift']());}};_0x43f1f2(++_0x36a7c7);}(_0xbae7,0x84));var _0x7bae=function(_0x2aca26,_0xdc73db){_0x2aca26=_0x2aca26-0x0;var _0x591592=_0xbae7[_0x2aca26];return _0x591592;};'use strict';var _=require(_0x7bae('0x0'));var util=require('util');var rta=require(_0x7bae('0x1'));var rtq=require(_0x7bae('0x2'));var qs=require(_0x7bae('0x3'));var utils=require(_0x7bae('0x4'));var db=require(_0x7bae('0x5'))['db'];var APIBadRequestError=require('../../errors/api')['APIBadRequestError'];var APIHandleError=require('../../errors/api')[_0x7bae('0x6')];function respondWithFilteredResult(_0x5afa79,_0x1341b8){return function(_0x5d3c62){if(_0x5d3c62){var _0x1b38f1=typeof _0x1341b8[_0x7bae('0x7')]==='undefined'&&typeof _0x1341b8[_0x7bae('0x8')]===_0x7bae('0x9');var _0x4693ad=_0x5d3c62[_0x7bae('0xa')];var _0x1a1db1=_0x1b38f1?0x0:_0x1341b8[_0x7bae('0x7')];var _0x31736b=_0x1b38f1?_0x5d3c62[_0x7bae('0xa')]:_0x1341b8['offset']+_0x1341b8[_0x7bae('0x8')];var _0x401f0;if(_0x31736b>=_0x4693ad){_0x31736b=_0x4693ad;_0x401f0=0xc8;}else{_0x401f0=0xce;}_0x5afa79['status'](_0x401f0);return _0x5afa79[_0x7bae('0xb')]('Content-Range',_0x1a1db1+'-'+_0x31736b+'/'+_0x4693ad)[_0x7bae('0xc')](_0x5d3c62);}return null;};}exports[_0x7bae('0xd')]=function(_0x533e9e,_0x180885){var _0x26fcb7={'count':0x0,'rows':[]};var _0x409b85={};var _0x3185ac;var _0x188815=utils[_0x7bae('0xe')]();var _0xffd9f7;var _0x35b9b9;var _0x3dda6f=_0x533e9e['query'][_0x7bae('0xf')];var _0x270256=_0x533e9e[_0x7bae('0x10')][_0x7bae('0x11')];var _0x5f1cc9=_0x533e9e['query'][_0x7bae('0x12')];var _0x30259f=_0x270256===_0x7bae('0x13')||_0x270256==='*pause'?!![]:![];var _0x1954be=[];var _0x53aad3;var _0x41579a;Promise[_0x7bae('0x14')]()[_0x7bae('0x15')](function(){if(_0x533e9e[_0x7bae('0x10')][_0x7bae('0x16')]){if(!utils[_0x7bae('0x17')](_0x533e9e[_0x7bae('0x10')][_0x7bae('0x16')])){throw new APIBadRequestError(util[_0x7bae('0x18')](_0x7bae('0x19'),_0x533e9e[_0x7bae('0x10')][_0x7bae('0x16')]));}_0x3185ac=_0x533e9e[_0x7bae('0x10')][_0x7bae('0x16')][_0x7bae('0x1a')]();}if(!_0x533e9e[_0x7bae('0x10')][_0x7bae('0x1b')]||!_0x533e9e[_0x7bae('0x10')]['sort'][_0x7bae('0x1c')](_0x7bae('0x1d'))){_0x533e9e[_0x7bae('0x10')]['sort']=rta[_0x7bae('0x1e')](_0x533e9e[_0x7bae('0x10')][_0x7bae('0x1b')]);return;}var _0x49f8bf=rta[_0x7bae('0x1f')](_0x533e9e['query']['sort']);_0x533e9e[_0x7bae('0x10')][_0x7bae('0x1b')]=_0x49f8bf[_0x7bae('0x20')]['join'](',');_0x53aad3=_0x49f8bf['order'];})[_0x7bae('0x15')](function(){if(!_0x3dda6f){return[];}return rta[_0x7bae('0x21')](_0x3dda6f,_0x3185ac);})['then'](function(_0x2938cb){_0x1954be=_0x2938cb;return rta[_0x7bae('0x22')]();})[_0x7bae('0x15')](function(_0x4e592a){_0x35b9b9=_0x4e592a[_0x7bae('0x23')];if((!_0x270256||_0x30259f)&&!_0x53aad3){return _0x1954be;}if(_0x53aad3&&!_0x270256){return rta[_0x7bae('0x24')](_0x35b9b9,_0x1954be,_0x53aad3);}else{return rta[_0x7bae('0x25')](_0x35b9b9,_0x1954be,_0x270256);}})[_0x7bae('0x15')](function(_0x36570a){_0x1954be=_0x36570a;var _0x5b4bf3=![];if(_0x1954be[_0x7bae('0x26')]===0x0){if(_0x3dda6f||_0x270256){_0x5b4bf3=!![];}if(_0x30259f){_0x5b4bf3=![];}}if(_0x5b4bf3){return _0x26fcb7;}var _0x5914da=_[_0x7bae('0x27')](db[_0x7bae('0x28')][_0x7bae('0x29')],function(_0x48a710){return{'name':_0x48a710[_0x7bae('0x2a')],'type':_0x48a710[_0x7bae('0x2b')]['key']};});_0x533e9e[_0x7bae('0x10')]['role']=_0x7bae('0x2c');_0x533e9e[_0x7bae('0x10')][_0x7bae('0x2d')]=!![];_0x409b85=qs['getOptions'](_0x5914da,_0x533e9e);_0x409b85['raw']=!![];var _0x3e0879=[];if(_0x1954be['length']>0x0){_0x3e0879[_0x7bae('0x2e')]({'id':{'$in':_0x1954be}});if(_0x53aad3&&!_0x270256){_0x41579a=[db[_0x7bae('0x2f')][_0x7bae('0x30')](_0x7bae('0x31')+_0x1954be+')')];_0x409b85[_0x7bae('0x32')]=_0x41579a;}}if(_0x30259f){_0x188815[_0x7bae('0x33')](function(_0x12880a){var _0x2463ec=!![];if(_0x270256===_0x7bae('0x34')&&_0x3185ac!==_0x12880a){_0x2463ec=![];}_0x3e0879[_0x7bae('0x2e')]({[_0x12880a+_0x7bae('0x35')]:_0x2463ec});});if(_0x5f1cc9){_0x3e0879[_0x7bae('0x2e')]({'pauseType':_0x5f1cc9});}}else if(_0x270256){_0x188815[_0x7bae('0x33')](function(_0x15873a){_0x3e0879[_0x7bae('0x2e')]({[_0x15873a+'Pause']:![]});});}_0x409b85[_0x7bae('0x36')]=_[_0x7bae('0x37')](_0x409b85[_0x7bae('0x36')],{'$and':_0x3e0879});if(_0x533e9e['user'][_0x7bae('0x38')]==='user'){var _0x24fb4f={'params':{'id':_0x533e9e[_0x7bae('0x39')][_0x7bae('0x3a')]},'query':{'section':'Agents','role':_0x7bae('0x2c'),'online':!![],'raw':!![],'ids':_0x1954be,'customSorting':_0x41579a}};if(_0x30259f){_0x24fb4f['query'][_0x7bae('0x3b')]=_0x3e0879;}_0x24fb4f[_0x7bae('0x10')]=Object['assign'](_0x24fb4f[_0x7bae('0x10')],_0x533e9e['query']);delete _0x24fb4f['query']['id'];return db[_0x7bae('0x3c')][_0x7bae('0x3d')](_0x24fb4f);}return db[_0x7bae('0x28')]['findAndCountAll'](_0x409b85);})[_0x7bae('0x15')](function(_0x526d13){_0x26fcb7[_0x7bae('0xa')]=_0x526d13[_0x7bae('0xa')];_0xffd9f7=_0x526d13['rows'];return _0xffd9f7[_0x7bae('0x27')](function(_0x16f4c9){var _0x1db692=_[_0x7bae('0x3e')](_0x35b9b9,['id',_0x16f4c9['id']]);if(_0x1db692){var _0x18dea7=rta[_0x7bae('0x3f')](_0x1db692);_[_0x7bae('0x37')](_0x16f4c9,_0x18dea7);}_0x16f4c9[_0x7bae('0x1d')]=rta[_0x7bae('0x40')](_0x16f4c9);if(_0x16f4c9[_0x7bae('0x1d')][_0x7bae('0x1c')](_0x7bae('0x13'))){_0x188815[_0x7bae('0x33')](function(_0x2f3aec){if(_0x16f4c9[_0x2f3aec+_0x7bae('0x35')]){_0x16f4c9[_0x2f3aec+'Status']=_0x7bae('0x13');}});}return _0x16f4c9;});})['then'](function(_0x51b2b5){if(!_0x53aad3||_0x41579a){return _0x51b2b5;}return rta[_0x7bae('0x41')](_0x51b2b5,_0x53aad3);})['then'](function(_0xaf5531){var _0x486004=null;if(_0x533e9e['query'][_0x7bae('0x20')]){var _0x3b1b31=_0x533e9e[_0x7bae('0x10')][_0x7bae('0x20')][_0x7bae('0x42')](',');_0x486004=_0xaf5531[_0x7bae('0x27')](function(_0x283121){return _[_0x7bae('0x43')](_0x283121,_0x3b1b31);});}_0x26fcb7[_0x7bae('0x23')]=_0x486004||_0xaf5531;return _0x26fcb7;})[_0x7bae('0x15')](respondWithFilteredResult(_0x180885,_0x409b85))[_0x7bae('0x44')](APIHandleError(_0x180885));};exports[_0x7bae('0x45')]=function(_0x5adf4d,_0x16db7d){var _0x35f0f4={'count':0x0,'rows':[]};var _0x3abb4a={};var _0x2dff8d;var _0x169dfa;var _0x201606;Promise[_0x7bae('0x14')]()[_0x7bae('0x15')](function(){if(_0x5adf4d[_0x7bae('0x10')][_0x7bae('0x16')]){if(!utils['isValidChannel'](_0x5adf4d['query'][_0x7bae('0x16')])){throw new APIBadRequestError(util[_0x7bae('0x18')](_0x7bae('0x19'),_0x5adf4d[_0x7bae('0x10')][_0x7bae('0x16')]));}_0x2dff8d=_0x5adf4d['query'][_0x7bae('0x16')][_0x7bae('0x1a')]();}var _0x35048b=_['startCase'](_0x2dff8d)+_0x7bae('0x46');var _0x2f98b1=_[_0x7bae('0x27')](db[_0x35048b][_0x7bae('0x29')],function(_0x26a59b){return{'name':_0x26a59b[_0x7bae('0x2a')],'type':_0x26a59b['type'][_0x7bae('0x47')]};});if(!_0x5adf4d[_0x7bae('0x10')][_0x7bae('0x20')]){var _0x2a4803=['id','name'];if(_0x2dff8d==='voice'){_0x2a4803[_0x7bae('0x2e')](_0x7bae('0x2b'));if(_0x5adf4d[_0x7bae('0x10')]['type']===_0x7bae('0x48')){_0x2a4803[_0x7bae('0x2e')]([_0x7bae('0x49'),_0x7bae('0x4a')]);}}_0x5adf4d[_0x7bae('0x10')][_0x7bae('0x20')]=_0x2a4803[_0x7bae('0x4b')](',');}_0x3abb4a=qs[_0x7bae('0x4c')](_0x2f98b1,_0x5adf4d);if(_0x5adf4d[_0x7bae('0x39')][_0x7bae('0x38')]===_0x7bae('0x39')){var _0x3718a0={'params':{'id':_0x5adf4d['user'][_0x7bae('0x3a')]},'query':{'section':_0x2dff8d===_0x7bae('0x4d')&&_0x5adf4d['query'][_0x7bae('0x2b')]===_0x7bae('0x48')?_0x7bae('0x4e'):_['startCase'](_0x2dff8d)+_0x7bae('0x4f'),'type':_0x5adf4d[_0x7bae('0x10')][_0x7bae('0x2b')],'nolimit':!![],'sort':'name','filter':_0x5adf4d['query'][_0x7bae('0x50')]}};return db['UserProfile'][_0x7bae('0x3d')](_0x3718a0);}return db[_0x35048b][_0x7bae('0x51')](_0x3abb4a);})[_0x7bae('0x15')](function(_0x282adb){_0x35f0f4[_0x7bae('0xa')]=_0x282adb[_0x7bae('0xa')];_0x169dfa=_0x282adb[_0x7bae('0x23')];return rtq[_0x7bae('0x52')](_0x5adf4d,_0x2dff8d);})[_0x7bae('0x15')](function(_0x367d1e){_0x201606=_0x367d1e[_0x7bae('0x23')];return rtq[_0x7bae('0x53')](_0x169dfa,_0x201606,_0x2dff8d,_0x5adf4d[_0x7bae('0x10')][_0x7bae('0x2b')]);})[_0x7bae('0x15')](function(_0x43fb2d){_0x35f0f4[_0x7bae('0x23')]=_0x43fb2d;return _0x35f0f4;})[_0x7bae('0x15')](respondWithFilteredResult(_0x16db7d,_0x3abb4a))['catch'](APIHandleError(_0x16db7d));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index debdfc0..2242717 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x5021f7,_0x53fe34){var _0x29f8a2=function(_0x135612){while(--_0x135612){_0x5021f7['push'](_0x5021f7['shift']());}};_0x29f8a2(++_0x53fe34);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x26d2ea,_0x3763a0){var _0x35d0c8=function(_0x405522){while(--_0x405522){_0x26d2ea['push'](_0x26d2ea['shift']());}};_0x35d0c8(++_0x3763a0);}(_0xe706,0xa3));var _0x6e70=function(_0x398294,_0x5ceb9d){_0x398294=_0x398294-0x0;var _0x2a872d=_0xe706[_0x398294];return _0x2a872d;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index b380624..3cdef49 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 _0xeff8=['sequelize','exports','STRING','DATE','INTEGER'];(function(_0x16f383,_0x45170e){var _0x1a2fea=function(_0xde6573){while(--_0xde6573){_0x16f383['push'](_0x16f383['shift']());}};_0x1a2fea(++_0x45170e);}(_0xeff8,0x186));var _0x8eff=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xeff8[_0xf71120];return _0xbe2fd3;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x8eff('0x2')]},'scheduledat':{'type':Sequelize[_0x8eff('0x3')]},'uniqueid':{'type':Sequelize[_0x8eff('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x8eff('0x3')]},'ringtime':{'type':Sequelize[_0x8eff('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x8eff('0x2')]},'campaigntype':{'type':Sequelize[_0x8eff('0x2')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x72a2=['DATE','exports','INTEGER','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x72a2,0x161));var _0x272a=function(_0x3d3cbb,_0xc292c5){_0x3d3cbb=_0x3d3cbb-0x0;var _0x2217cf=_0x72a2[_0x3d3cbb];return _0x2217cf;};'use strict';var Sequelize=require('sequelize');module[_0x272a('0x0')]={'state':{'type':Sequelize[_0x272a('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x272a('0x2')]},'scheduledat':{'type':Sequelize[_0x272a('0x3')]},'uniqueid':{'type':Sequelize[_0x272a('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x272a('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x272a('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index d272900..25b657d 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 _0x04a8=['moment','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','lodash','api'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x04a8,0xd0));var _0x804a=function(_0x340a55,_0x35616d){_0x340a55=_0x340a55-0x0;var _0x230917=_0x04a8[_0x340a55];return _0x230917;};'use strict';var _=require(_0x804a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x804a('0x1'));var moment=require(_0x804a('0x2'));var BPromise=require('bluebird');var rp=require(_0x804a('0x3'));var fs=require('fs');var path=require(_0x804a('0x4'));var rimraf=require(_0x804a('0x5'));var config=require(_0x804a('0x6'));var attributes=require(_0x804a('0x7'));module[_0x804a('0x8')]=function(_0xe1424,_0x3c3a54){return _0xe1424[_0x804a('0x9')]('ReportAgentPreview',attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa488=['api','path','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger'];(function(_0x410fb0,_0x40b6ed){var _0x5038f8=function(_0x402d2c){while(--_0x402d2c){_0x410fb0['push'](_0x410fb0['shift']());}};_0x5038f8(++_0x40b6ed);}(_0xa488,0x1e1));var _0x8a48=function(_0x5c1911,_0x5063d9){_0x5c1911=_0x5c1911-0x0;var _0x360290=_0xa488[_0x5c1911];return _0x360290;};'use strict';var _=require(_0x8a48('0x0'));var util=require(_0x8a48('0x1'));var logger=require(_0x8a48('0x2'))(_0x8a48('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8a48('0x4'));var rimraf=require('rimraf');var config=require(_0x8a48('0x5'));var attributes=require(_0x8a48('0x6'));module[_0x8a48('0x7')]=function(_0x5df915,_0x4052a0){return _0x5df915[_0x8a48('0x8')](_0x8a48('0x9'),attributes,{'tableName':_0x8a48('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index 9a00674..191b644 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 _0x046a=['create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateReportAgentPreview'];(function(_0x491468,_0x42f169){var _0x5b8c22=function(_0x407a9b){while(--_0x407a9b){_0x491468['push'](_0x491468['shift']());}};_0x5b8c22(++_0x42f169);}(_0x046a,0x1d5));var _0xa046=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x046a[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0xa046('0x0'));var util=require(_0xa046('0x1'));var moment=require(_0xa046('0x2'));var BPromise=require(_0xa046('0x3'));var rs=require(_0xa046('0x4'));var fs=require('fs');var Redis=require(_0xa046('0x5'));var db=require(_0xa046('0x6'))['db'];var utils=require(_0xa046('0x7'));var logger=require('../../config/logger')(_0xa046('0x8'));var config=require(_0xa046('0x9'));var jayson=require(_0xa046('0xa'));var client=jayson[_0xa046('0xb')][_0xa046('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3dee15,_0x2d75af,_0x116fa7){return new BPromise(function(_0x47d041,_0x7ab606){return client[_0xa046('0xd')](_0x3dee15,_0x116fa7)[_0xa046('0xe')](function(_0x2ed99f){logger[_0xa046('0xf')](_0xa046('0x10'),_0x2d75af,_0xa046('0x11'));logger[_0xa046('0x12')](_0xa046('0x13'),_0x2d75af,_0xa046('0x11'),JSON[_0xa046('0x14')](_0x2ed99f));if(_0x2ed99f[_0xa046('0x15')]){if(_0x2ed99f[_0xa046('0x15')][_0xa046('0x16')]===0x1f4){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x2d75af,_0x2ed99f[_0xa046('0x15')][_0xa046('0x17')]);return _0x7ab606(_0x2ed99f['error'][_0xa046('0x17')]);}logger[_0xa046('0x15')](_0xa046('0x10'),_0x2d75af,_0x2ed99f[_0xa046('0x15')][_0xa046('0x17')]);return _0x47d041(_0x2ed99f['error']['message']);}else{logger[_0xa046('0xf')](_0xa046('0x10'),_0x2d75af,'request\x20sent');_0x47d041(_0x2ed99f[_0xa046('0x18')]['message']);}})[_0xa046('0x19')](function(_0x1bda02){logger['error'](_0xa046('0x10'),_0x2d75af,_0x1bda02);_0x7ab606(_0x1bda02);});});}exports[_0xa046('0x1a')]=function(_0x25f45d){var _0x2d00c0=this;return new Promise(function(_0x22525e,_0x1d12be){return db['ReportAgentPreview'][_0xa046('0x1b')](_0x25f45d[_0xa046('0x1c')],{'raw':_0x25f45d[_0xa046('0x1d')]?_0x25f45d[_0xa046('0x1d')][_0xa046('0x1e')]===undefined?!![]:![]:!![]})[_0xa046('0xe')](function(_0x4018b3){logger[_0xa046('0xf')](_0xa046('0x1a'),_0x25f45d);logger[_0xa046('0x12')](_0xa046('0x1a'),_0x25f45d,JSON[_0xa046('0x14')](_0x4018b3));_0x22525e(_0x4018b3);})['catch'](function(_0x51a519){logger[_0xa046('0x15')](_0xa046('0x1a'),_0x51a519[_0xa046('0x17')],_0x25f45d);_0x1d12be(_0x2d00c0[_0xa046('0x15')](0x1f4,_0x51a519[_0xa046('0x17')]));});});}; \ No newline at end of file +var _0x3e68=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ReportAgentPreview','body','options','raw','CreateReportAgentPreview','lodash','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x14566c,_0x23d849){var _0x16c13a=function(_0x5a74b7){while(--_0x5a74b7){_0x14566c['push'](_0x14566c['shift']());}};_0x16c13a(++_0x23d849);}(_0x3e68,0x190));var _0x83e6=function(_0x298e90,_0x305688){_0x298e90=_0x298e90-0x0;var _0x1d1c80=_0x3e68[_0x298e90];return _0x1d1c80;};'use strict';var _=require(_0x83e6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x83e6('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x83e6('0x2'));var db=require(_0x83e6('0x3'))['db'];var utils=require(_0x83e6('0x4'));var logger=require(_0x83e6('0x5'))(_0x83e6('0x6'));var config=require(_0x83e6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x83e6('0x8')][_0x83e6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x370166,_0x44a802,_0x7decbc){return new BPromise(function(_0x1a8050,_0x4c6b3d){return client[_0x83e6('0xa')](_0x370166,_0x7decbc)[_0x83e6('0xb')](function(_0x31c103){logger[_0x83e6('0xc')](_0x83e6('0xd'),_0x44a802,_0x83e6('0xe'));logger[_0x83e6('0xf')](_0x83e6('0x10'),_0x44a802,_0x83e6('0xe'),JSON[_0x83e6('0x11')](_0x31c103));if(_0x31c103['error']){if(_0x31c103['error']['code']===0x1f4){logger[_0x83e6('0x12')](_0x83e6('0xd'),_0x44a802,_0x31c103[_0x83e6('0x12')]['message']);return _0x4c6b3d(_0x31c103[_0x83e6('0x12')][_0x83e6('0x13')]);}logger[_0x83e6('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x44a802,_0x31c103[_0x83e6('0x12')]['message']);return _0x1a8050(_0x31c103[_0x83e6('0x12')][_0x83e6('0x13')]);}else{logger[_0x83e6('0xc')](_0x83e6('0xd'),_0x44a802,'request\x20sent');_0x1a8050(_0x31c103[_0x83e6('0x14')][_0x83e6('0x13')]);}})[_0x83e6('0x15')](function(_0x1be5de){logger[_0x83e6('0x12')](_0x83e6('0xd'),_0x44a802,_0x1be5de);_0x4c6b3d(_0x1be5de);});});}exports['CreateReportAgentPreview']=function(_0x4c3942){var _0x298911=this;return new Promise(function(_0x9aa5d9,_0x3a67c7){return db[_0x83e6('0x16')]['create'](_0x4c3942[_0x83e6('0x17')],{'raw':_0x4c3942[_0x83e6('0x18')]?_0x4c3942['options'][_0x83e6('0x19')]===undefined?!![]:![]:!![]})[_0x83e6('0xb')](function(_0x218c28){logger[_0x83e6('0xc')](_0x83e6('0x1a'),_0x4c3942);logger[_0x83e6('0xf')](_0x83e6('0x1a'),_0x4c3942,JSON[_0x83e6('0x11')](_0x218c28));_0x9aa5d9(_0x218c28);})[_0x83e6('0x15')](function(_0x18d13a){logger[_0x83e6('0x12')](_0x83e6('0x1a'),_0x18d13a[_0x83e6('0x13')],_0x4c3942);_0x3a67c7(_0x298911[_0x83e6('0x12')](0x1f4,_0x18d13a[_0x83e6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 957a759..2bfc1e0 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 _0x8e35=['/chat/queues/:id/notify','queueNotify','chat','showChatQueues','/fax/queues/:id/notify','fax','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports','multer','util','path','express','../../components/auth/service','./rpc.controller','get','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','/trunks','trunks','campaigns','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','mail','/mail/queues/:id'];(function(_0x205cfa,_0x5c8122){var _0x2a2a37=function(_0x56f0ea){while(--_0x56f0ea){_0x205cfa['push'](_0x205cfa['shift']());}};_0x2a2a37(++_0x5c8122);}(_0x8e35,0x1f0));var _0x58e3=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x8e35[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0x58e3('0x0'));var util=require(_0x58e3('0x1'));var path=require(_0x58e3('0x2'));var express=require(_0x58e3('0x3'));var router=express['Router']();var auth=require(_0x58e3('0x4'));var controller=require(_0x58e3('0x5'));router[_0x58e3('0x6')]('/voice/channels',auth[_0x58e3('0x7')](),controller[_0x58e3('0x8')]);router[_0x58e3('0x6')](_0x58e3('0x9'),auth[_0x58e3('0x7')](),controller[_0x58e3('0xa')]);router[_0x58e3('0x6')](_0x58e3('0xb'),auth['isAuthenticated'](),controller[_0x58e3('0xc')]);router['get'](_0x58e3('0xd'),auth['isAuthenticated'](),controller[_0x58e3('0xe')]);router['get'](_0x58e3('0xf'),auth[_0x58e3('0x7')](),controller[_0x58e3('0x10')]);router[_0x58e3('0x6')](_0x58e3('0x11'),auth[_0x58e3('0x7')](),controller[_0x58e3('0x12')]);router['get']('/mail/accounts',auth[_0x58e3('0x7')](),controller[_0x58e3('0x13')]);router[_0x58e3('0x6')](_0x58e3('0x14'),auth[_0x58e3('0x7')](),controller[_0x58e3('0x15')]);router[_0x58e3('0x6')](_0x58e3('0x16'),auth[_0x58e3('0x7')](),controller[_0x58e3('0x17')]);router['get'](_0x58e3('0x18'),auth[_0x58e3('0x7')](),controller[_0x58e3('0x19')]);router[_0x58e3('0x6')](_0x58e3('0x1a'),auth['isAuthenticated'](),controller[_0x58e3('0x1b')]);router[_0x58e3('0x6')](_0x58e3('0x1c'),auth['isAuthenticated'](),controller[_0x58e3('0x1d')]);router[_0x58e3('0x6')]('/voice/queues/channels',auth[_0x58e3('0x7')](),controller[_0x58e3('0x1e')]);router[_0x58e3('0x6')]('/voice/queues/channels/:uniqueid',auth[_0x58e3('0x7')](),controller['voiceQueuesChannel']);router['get'](_0x58e3('0x1f'),auth[_0x58e3('0x7')](),controller[_0x58e3('0x20')]);router['get'](_0x58e3('0x21'),auth[_0x58e3('0x7')](),controller[_0x58e3('0x22')]);router['get'](_0x58e3('0x23'),auth[_0x58e3('0x7')](),controller[_0x58e3('0x24')]);router[_0x58e3('0x25')](_0x58e3('0x23'),auth[_0x58e3('0x7')](),controller[_0x58e3('0x26')]);router[_0x58e3('0x6')](_0x58e3('0x27'),auth[_0x58e3('0x7')](),controller['outbound']);router[_0x58e3('0x6')](_0x58e3('0x28'),auth['isAuthenticated'](),controller[_0x58e3('0x29')]);router[_0x58e3('0x6')](_0x58e3('0x2a'),auth[_0x58e3('0x7')](),controller[_0x58e3('0x2b')]);router[_0x58e3('0x25')](_0x58e3('0x2c'),auth[_0x58e3('0x7')](),controller[_0x58e3('0x2d')]);router[_0x58e3('0x6')](_0x58e3('0x2e'),auth['isAuthenticated'](),controller['telephones']);router[_0x58e3('0x6')](_0x58e3('0x2f'),auth['isAuthenticated'](),controller[_0x58e3('0x30')]);router[_0x58e3('0x6')]('/campaigns',auth[_0x58e3('0x7')](),controller[_0x58e3('0x31')]);router['get']('/fax/accounts',auth[_0x58e3('0x7')](),controller['faxAccounts']);router['get'](_0x58e3('0x32'),auth[_0x58e3('0x7')](),controller[_0x58e3('0x33')]);router[_0x58e3('0x6')](_0x58e3('0x34'),auth[_0x58e3('0x7')](),controller['mailQueuesWaitingInteractions']);router[_0x58e3('0x6')](_0x58e3('0x35'),auth[_0x58e3('0x7')](),controller[_0x58e3('0x36')]);router[_0x58e3('0x6')](_0x58e3('0x37'),auth[_0x58e3('0x7')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x58e3('0x6')](_0x58e3('0x38'),auth[_0x58e3('0x7')](),controller[_0x58e3('0x39')]);router[_0x58e3('0x6')](_0x58e3('0x3a'),auth[_0x58e3('0x7')](),controller['whatsappQueuesWaitingInteractions']);router['get']('/fax/queues/waitinginteractions',auth[_0x58e3('0x7')](),controller[_0x58e3('0x3b')]);router[_0x58e3('0x3c')](_0x58e3('0x3d'),auth['isAuthenticated'](),controller['queueNotify'](_0x58e3('0x3e')));router[_0x58e3('0x6')](_0x58e3('0x3f'),auth[_0x58e3('0x7')](),controller['showMailQueues']);router['post'](_0x58e3('0x40'),auth[_0x58e3('0x7')](),controller[_0x58e3('0x41')](_0x58e3('0x42')));router[_0x58e3('0x6')]('/chat/queues/:id',auth[_0x58e3('0x7')](),controller[_0x58e3('0x43')]);router[_0x58e3('0x3c')](_0x58e3('0x44'),auth[_0x58e3('0x7')](),controller[_0x58e3('0x41')](_0x58e3('0x45')));router[_0x58e3('0x6')]('/fax/queues/:id',auth[_0x58e3('0x7')](),controller['showFaxQueues']);router['post'](_0x58e3('0x46'),auth[_0x58e3('0x7')](),controller[_0x58e3('0x41')](_0x58e3('0x47')));router['get'](_0x58e3('0x48'),auth[_0x58e3('0x7')](),controller['showOpenchannelQueues']);router[_0x58e3('0x3c')]('/sms/queues/:id/notify',auth[_0x58e3('0x7')](),controller[_0x58e3('0x41')]('sms'));router[_0x58e3('0x3c')](_0x58e3('0x49'),auth[_0x58e3('0x7')](),controller[_0x58e3('0x41')](_0x58e3('0x4a')));router[_0x58e3('0x6')](_0x58e3('0x4b'),auth[_0x58e3('0x7')](),controller['showSmsQueues']);router['get'](_0x58e3('0x4c'),auth[_0x58e3('0x7')](),controller[_0x58e3('0x4d')]);router[_0x58e3('0x3c')]('/agents/:id/notify',auth[_0x58e3('0x7')](),controller[_0x58e3('0x4e')]);module[_0x58e3('0x4f')]=router; \ No newline at end of file +var _0x7f8c=['isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','telephones','/trunks','trunks','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','mail','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor'];(function(_0x1e8a57,_0x2b5577){var _0x5a3d4a=function(_0x3f0529){while(--_0x3f0529){_0x1e8a57['push'](_0x1e8a57['shift']());}};_0x5a3d4a(++_0x2b5577);}(_0x7f8c,0x139));var _0xc7f8=function(_0x3437ae,_0x2da133){_0x3437ae=_0x3437ae-0x0;var _0x326bd0=_0x7f8c[_0x3437ae];return _0x326bd0;};'use strict';var multer=require(_0xc7f8('0x0'));var util=require(_0xc7f8('0x1'));var path=require(_0xc7f8('0x2'));var express=require(_0xc7f8('0x3'));var router=express[_0xc7f8('0x4')]();var auth=require(_0xc7f8('0x5'));var controller=require(_0xc7f8('0x6'));router[_0xc7f8('0x7')](_0xc7f8('0x8'),auth['isAuthenticated'](),controller[_0xc7f8('0x9')]);router[_0xc7f8('0x7')](_0xc7f8('0xa'),auth[_0xc7f8('0xb')](),controller[_0xc7f8('0xc')]);router[_0xc7f8('0x7')](_0xc7f8('0xd'),auth['isAuthenticated'](),controller[_0xc7f8('0xe')]);router['get'](_0xc7f8('0xf'),auth['isAuthenticated'](),controller[_0xc7f8('0x10')]);router['get'](_0xc7f8('0x11'),auth[_0xc7f8('0xb')](),controller[_0xc7f8('0x12')]);router['get'](_0xc7f8('0x13'),auth[_0xc7f8('0xb')](),controller[_0xc7f8('0x14')]);router[_0xc7f8('0x7')](_0xc7f8('0x15'),auth[_0xc7f8('0xb')](),controller[_0xc7f8('0x16')]);router['get']('/openchannel/queues',auth[_0xc7f8('0xb')](),controller[_0xc7f8('0x17')]);router['get']('/sms/queues',auth[_0xc7f8('0xb')](),controller[_0xc7f8('0x18')]);router[_0xc7f8('0x7')](_0xc7f8('0x19'),auth['isAuthenticated'](),controller['whatsappQueues']);router[_0xc7f8('0x7')](_0xc7f8('0x1a'),auth[_0xc7f8('0xb')](),controller[_0xc7f8('0x1b')]);router[_0xc7f8('0x7')](_0xc7f8('0x1c'),auth[_0xc7f8('0xb')](),controller['voiceQueuesPreview']);router[_0xc7f8('0x7')](_0xc7f8('0x1d'),auth['isAuthenticated'](),controller['voiceQueuesChannels']);router[_0xc7f8('0x7')](_0xc7f8('0x1e'),auth[_0xc7f8('0xb')](),controller[_0xc7f8('0x1f')]);router['get'](_0xc7f8('0x20'),auth[_0xc7f8('0xb')](),controller[_0xc7f8('0x21')]);router[_0xc7f8('0x7')](_0xc7f8('0x22'),auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router[_0xc7f8('0x7')](_0xc7f8('0x23'),auth[_0xc7f8('0xb')](),controller['showVoiceQueues']);router[_0xc7f8('0x24')](_0xc7f8('0x23'),auth[_0xc7f8('0xb')](),controller[_0xc7f8('0x25')]);router[_0xc7f8('0x7')](_0xc7f8('0x26'),auth[_0xc7f8('0xb')](),controller[_0xc7f8('0x27')]);router[_0xc7f8('0x7')](_0xc7f8('0x28'),auth[_0xc7f8('0xb')](),controller[_0xc7f8('0x29')]);router[_0xc7f8('0x7')](_0xc7f8('0x2a'),auth['isAuthenticated'](),controller[_0xc7f8('0x2b')]);router['put'](_0xc7f8('0x2c'),auth[_0xc7f8('0xb')](),controller['agentCapacity']);router[_0xc7f8('0x7')]('/telephones',auth[_0xc7f8('0xb')](),controller[_0xc7f8('0x2d')]);router[_0xc7f8('0x7')](_0xc7f8('0x2e'),auth['isAuthenticated'](),controller[_0xc7f8('0x2f')]);router[_0xc7f8('0x7')]('/campaigns',auth[_0xc7f8('0xb')](),controller['campaigns']);router[_0xc7f8('0x7')](_0xc7f8('0x30'),auth[_0xc7f8('0xb')](),controller[_0xc7f8('0x31')]);router[_0xc7f8('0x7')](_0xc7f8('0x32'),auth[_0xc7f8('0xb')](),controller['chatQueuesWaitingInteractions']);router['get']('/mail/queues/waitinginteractions',auth[_0xc7f8('0xb')](),controller[_0xc7f8('0x33')]);router[_0xc7f8('0x7')](_0xc7f8('0x34'),auth[_0xc7f8('0xb')](),controller['openchannelQueuesWaitingInteractions']);router[_0xc7f8('0x7')](_0xc7f8('0x35'),auth['isAuthenticated'](),controller[_0xc7f8('0x36')]);router[_0xc7f8('0x7')](_0xc7f8('0x37'),auth[_0xc7f8('0xb')](),controller[_0xc7f8('0x38')]);router[_0xc7f8('0x7')](_0xc7f8('0x39'),auth[_0xc7f8('0xb')](),controller['whatsappQueuesWaitingInteractions']);router[_0xc7f8('0x7')]('/fax/queues/waitinginteractions',auth[_0xc7f8('0xb')](),controller[_0xc7f8('0x3a')]);router[_0xc7f8('0x3b')]('/mail/queues/:id/notify',auth['isAuthenticated'](),controller[_0xc7f8('0x3c')](_0xc7f8('0x3d')));router['get']('/mail/queues/:id',auth['isAuthenticated'](),controller[_0xc7f8('0x3e')]);router[_0xc7f8('0x3b')](_0xc7f8('0x3f'),auth[_0xc7f8('0xb')](),controller[_0xc7f8('0x3c')]('chat'));router[_0xc7f8('0x7')](_0xc7f8('0x40'),auth[_0xc7f8('0xb')](),controller['showChatQueues']);router[_0xc7f8('0x3b')](_0xc7f8('0x41'),auth[_0xc7f8('0xb')](),controller['queueNotify'](_0xc7f8('0x42')));router[_0xc7f8('0x7')](_0xc7f8('0x43'),auth[_0xc7f8('0xb')](),controller[_0xc7f8('0x44')]);router[_0xc7f8('0x3b')](_0xc7f8('0x45'),auth['isAuthenticated'](),controller['queueNotify'](_0xc7f8('0x46')));router[_0xc7f8('0x7')](_0xc7f8('0x47'),auth[_0xc7f8('0xb')](),controller[_0xc7f8('0x48')]);router[_0xc7f8('0x3b')](_0xc7f8('0x49'),auth[_0xc7f8('0xb')](),controller[_0xc7f8('0x3c')](_0xc7f8('0x4a')));router[_0xc7f8('0x3b')](_0xc7f8('0x4b'),auth[_0xc7f8('0xb')](),controller[_0xc7f8('0x3c')](_0xc7f8('0x4c')));router['get']('/sms/queues/:id',auth['isAuthenticated'](),controller[_0xc7f8('0x4d')]);router[_0xc7f8('0x7')](_0xc7f8('0x4e'),auth[_0xc7f8('0xb')](),controller[_0xc7f8('0x4f')]);router[_0xc7f8('0x3b')]('/agents/:id/notify',auth[_0xc7f8('0xb')](),controller['agentNotify']);module[_0xc7f8('0x50')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 245eb62..28b1ed1 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 _0x2675=['request','error','result','catch','status','json','sendStatus','name','send','isNil','rows','find','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','then','voiceChannelStopMixMonitor','params','voiceQueues','VoiceQueues','updateVoiceQueue','body','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','merge','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','findAll','INTERACTION','length','format','MemberReport','findOrCreate','interface','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','telephones','Telephones','trunks','Trunks','Campaigns','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','showOpenchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','filter','type','map','queue_id','indexOf','SmsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Agent\x20not\x20found','Message','findOne','agentTransferTimeout','bluebird','../../mysqldb','../../config/logger','jayson/promise','client','http'];(function(_0x5b6375,_0x563718){var _0x4045b4=function(_0x314db8){while(--_0x314db8){_0x5b6375['push'](_0x5b6375['shift']());}};_0x4045b4(++_0x563718);}(_0x2675,0x75));var _0x5267=function(_0x1bceb5,_0x4e6bff){_0x1bceb5=_0x1bceb5-0x0;var _0x296308=_0x2675[_0x1bceb5];return _0x296308;};'use strict';var BPromise=require(_0x5267('0x0'));var moment=require('moment');var _=require('lodash');var util=require('util');var db=require(_0x5267('0x1'))['db'];var logger=require(_0x5267('0x2'))('api');var jayson=require(_0x5267('0x3'));var amiClient=jayson[_0x5267('0x4')]['http']({'port':0x232a});var mailClient=jayson[_0x5267('0x4')][_0x5267('0x5')]({'port':0x232b});var routingClient=jayson[_0x5267('0x4')][_0x5267('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x20f065,_0xc56cd5,_0x527c16){return new BPromise(function(_0x9e0a27,_0x46bfdf){var _0x506fd7=_0x527c16?_0x527c16:amiClient;return _0x506fd7[_0x5267('0x6')](_0x20f065,_0xc56cd5)['then'](function(_0x3ff4e9){if(_0x3ff4e9[_0x5267('0x7')]){if(_0x3ff4e9[_0x5267('0x7')]['code']===0x1f4){return _0x46bfdf(_0x3ff4e9[_0x5267('0x7')]['message']);}return _0x9e0a27(_0x3ff4e9[_0x5267('0x7')]['message']);}else{_0x9e0a27(_0x3ff4e9[_0x5267('0x8')]);}})[_0x5267('0x9')](function(_0x268a8a){_0x46bfdf(_0x268a8a);});});}function respondWithResult(_0x1f9be3,_0x1d7090){_0x1d7090=_0x1d7090||0xc8;return function(_0x1171b9){if(_0x1171b9){return _0x1f9be3[_0x5267('0xa')](_0x1d7090)[_0x5267('0xb')](_0x1171b9);}return _0x1f9be3[_0x5267('0xc')](0x194);};}function handleError(_0x1e2d3b,_0x16e5a7){_0x16e5a7=_0x16e5a7||0x1f4;return function(_0x29349a){logger[_0x5267('0x7')](_0x29349a['stack']);if(_0x29349a['name']){delete _0x29349a[_0x5267('0xd')];}_0x1e2d3b[_0x5267('0xa')](_0x16e5a7)[_0x5267('0xe')](_0x29349a);};}function findById(_0x3f5344){return function(_0x46b2c2){if(!_[_0x5267('0xf')](_0x3f5344)&&!_[_0x5267('0xf')](_0x46b2c2)&&!_[_0x5267('0xf')](_0x46b2c2[_0x5267('0x10')])){return _[_0x5267('0x11')](_0x46b2c2[_0x5267('0x10')],function(_0x1ab03){return _0x1ab03['id']==_0x3f5344;});}return null;};}exports['voiceChannels']=function(_0x18f32e,_0x2afd38){return respondWithRpcPromise('VoiceChannels',_0x18f32e[_0x5267('0x12')])['then'](respondWithResult(_0x2afd38,null))[_0x5267('0x9')](handleError(_0x2afd38,null));};exports[_0x5267('0x13')]=function(_0x39c0c3,_0x2a9f99){return respondWithRpcPromise(_0x5267('0x14'),_['merge'](_0x39c0c3[_0x5267('0x12')],_0x39c0c3['params']))[_0x5267('0x15')](respondWithResult(_0x2a9f99,null))[_0x5267('0x9')](handleError(_0x2a9f99,null));};exports[_0x5267('0x16')]=function(_0x56dd95,_0x499f19){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_['merge'](_0x56dd95['query'],_0x56dd95[_0x5267('0x17')]))[_0x5267('0x15')](respondWithResult(_0x499f19,null))[_0x5267('0x9')](handleError(_0x499f19,null));};exports[_0x5267('0x18')]=function(_0x11c8ea,_0x40d1be){return respondWithRpcPromise(_0x5267('0x19'),_0x11c8ea[_0x5267('0x12')])[_0x5267('0x15')](respondWithResult(_0x40d1be,null))['catch'](handleError(_0x40d1be,null));};exports['showVoiceQueues']=function(_0x354111,_0x472938){return respondWithRpcPromise('VoiceQueues',_0x354111[_0x5267('0x12')])['then'](findById(_0x354111['params']['id']))[_0x5267('0x15')](respondWithResult(_0x472938,null))[_0x5267('0x9')](handleError(_0x472938,null));};exports[_0x5267('0x1a')]=function(_0x2d2ace,_0x33c431){return respondWithRpcPromise('UpdateVoiceQueue',_['merge'](_0x2d2ace[_0x5267('0x1b')],_0x2d2ace[_0x5267('0x17')]))[_0x5267('0x15')](respondWithResult(_0x33c431,null))['catch'](handleError(_0x33c431,null));};exports['voiceQueuesPreview']=function(_0xbe7922,_0x3ef2a8){return respondWithRpcPromise(_0x5267('0x1c'),_['merge'](_0xbe7922['query'],_0xbe7922[_0x5267('0x17')]))[_0x5267('0x15')](respondWithResult(_0x3ef2a8,null))[_0x5267('0x9')](handleError(_0x3ef2a8,null));};exports[_0x5267('0x1d')]=function(_0x5bbb83,_0x33e456){return respondWithRpcPromise(_0x5267('0x1e'),_0x5bbb83[_0x5267('0x12')])[_0x5267('0x15')](respondWithResult(_0x33e456,null))[_0x5267('0x9')](handleError(_0x33e456,null));};exports[_0x5267('0x1f')]=function(_0x341bae,_0x1dda95){return respondWithRpcPromise('VoiceQueuesChannel',_['merge'](_0x341bae[_0x5267('0x12')],_0x341bae['params']))[_0x5267('0x15')](respondWithResult(_0x1dda95,null))[_0x5267('0x9')](handleError(_0x1dda95,null));};exports[_0x5267('0x20')]=function(_0x3a729c,_0x4ac4a0){return respondWithRpcPromise(_0x5267('0x21'),_[_0x5267('0x22')](_0x3a729c[_0x5267('0x12')],_0x3a729c[_0x5267('0x17')]))[_0x5267('0x15')](respondWithResult(_0x4ac4a0,null))[_0x5267('0x9')](handleError(_0x4ac4a0,null));};exports[_0x5267('0x23')]=function(_0xa0ea89,_0x484b77){return respondWithRpcPromise(_0x5267('0x24'),_['merge'](_0xa0ea89[_0x5267('0x12')],_0xa0ea89[_0x5267('0x17')]))[_0x5267('0x15')](respondWithResult(_0x484b77,null))[_0x5267('0x9')](handleError(_0x484b77,null));};exports[_0x5267('0x25')]=function(_0x33ecd7,_0x465ad9){return respondWithRpcPromise('Outbound',_0x33ecd7[_0x5267('0x12')])[_0x5267('0x15')](respondWithResult(_0x465ad9,null))[_0x5267('0x9')](handleError(_0x465ad9,null));};exports[_0x5267('0x26')]=function(_0x82cea7,_0x21eabf){return respondWithRpcPromise(_0x5267('0x27'),_0x82cea7['query'])[_0x5267('0x15')](respondWithResult(_0x21eabf,null))['catch'](handleError(_0x21eabf,null));};exports[_0x5267('0x28')]=function(_0x5c0cdf,_0x4dee66){var _0x51bddd;return respondWithRpcPromise(_0x5267('0x29'),_0x5c0cdf['query'])[_0x5267('0x15')](function(_0x146476){_0x51bddd=_0x146476;return respondWithRpcPromise(_0x5267('0x29'),_0x5c0cdf[_0x5267('0x12')],routingClient);})['then'](function(_0x456b33){return _[_0x5267('0x22')]({},_0x456b33,_0x51bddd);})['then'](respondWithResult(_0x4dee66,null))['catch'](handleError(_0x4dee66,null));};exports[_0x5267('0x2a')]=function(_0x560cdf,_0x12df83){if(_0x560cdf[_0x5267('0x1b')]&&_0x560cdf[_0x5267('0x1b')][_0x5267('0x2b')]&&_0x560cdf[_0x5267('0x2c')]&&_0x560cdf[_0x5267('0x2c')][_0x5267('0xd')]){for(var _0x5697b3 in _0x560cdf['body'][_0x5267('0x2b')]){if(_0x560cdf['body'][_0x5267('0x2b')][_0x5267('0x2d')](_0x5697b3)){db['MemberReport'][_0x5267('0x2e')]({'where':{'channel':_0x5697b3,'membername':_0x560cdf[_0x5267('0x2c')][_0x5267('0xd')],'type':_0x5267('0x2f'),'exitAt':null,'uniqueid':_0x560cdf[_0x5267('0x1b')][_0x5267('0x2b')][_0x5697b3]&&_0x560cdf[_0x5267('0x1b')][_0x5267('0x2b')][_0x5697b3][_0x5267('0x30')]?{'$notIn':_0x560cdf['body'][_0x5267('0x2b')][_0x5697b3]}:{'$ne':null}}})[_0x5267('0x15')](function(_0x19b015){var _0x45241a=moment()[_0x5267('0x31')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x3d15ac=0x0,_0x4e0132=_0x19b015[_0x5267('0x30')];_0x3d15ac<_0x4e0132;_0x3d15ac+=0x1){_0x19b015[_0x3d15ac]['updateAttributes']({'exitAt':_0x45241a});}});for(var _0x4ae9f9=0x0;_0x4ae9f9<_0x560cdf[_0x5267('0x1b')]['interaction'][_0x5697b3][_0x5267('0x30')];_0x4ae9f9+=0x1){db[_0x5267('0x32')][_0x5267('0x33')]({'where':{'channel':_0x5697b3,'membername':_0x560cdf[_0x5267('0x2c')]['name'],'type':_0x5267('0x2f'),'uniqueid':_0x560cdf['body']['interaction'][_0x5697b3][_0x4ae9f9],'exitAt':null},'defaults':{'channel':_0x5697b3,'membername':_0x560cdf[_0x5267('0x2c')][_0x5267('0xd')],'interface':_['isNil'](_0x560cdf['user'][_0x5267('0x34')])?util[_0x5267('0x31')](_0x5267('0x35'),_0x560cdf[_0x5267('0x2c')][_0x5267('0xd')]):_0x560cdf[_0x5267('0x2c')][_0x5267('0x34')],'type':_0x5267('0x2f'),'enterAt':moment()[_0x5267('0x31')](_0x5267('0x36')),'role':_0x5267('0x37'),'internal':_0x560cdf[_0x5267('0x2c')][_0x5267('0x38')],'uniqueid':_0x560cdf[_0x5267('0x1b')]['interaction'][_0x5697b3][_0x4ae9f9]}});}}}}return respondWithRpcPromise(_0x5267('0x39'),{'id':_0x560cdf[_0x5267('0x17')]['id'],'capacity':_0x560cdf[_0x5267('0x1b')]['capacity']},routingClient)[_0x5267('0x15')](respondWithResult(_0x12df83,null))[_0x5267('0x9')](handleError(_0x12df83,null));};exports[_0x5267('0x3a')]=function(_0x2a97f1,_0x119546){return respondWithRpcPromise(_0x5267('0x3b'),_0x2a97f1['query'])[_0x5267('0x15')](respondWithResult(_0x119546,null))['catch'](handleError(_0x119546,null));};exports[_0x5267('0x3c')]=function(_0x30fcd2,_0xa49fd7){return respondWithRpcPromise(_0x5267('0x3d'),_0x30fcd2[_0x5267('0x12')])[_0x5267('0x15')](respondWithResult(_0xa49fd7,null))[_0x5267('0x9')](handleError(_0xa49fd7,null));};exports['campaigns']=function(_0x57ca8f,_0x200855){return respondWithRpcPromise(_0x5267('0x3e'),_0x57ca8f['query'])[_0x5267('0x15')](respondWithResult(_0x200855,null))['catch'](handleError(_0x200855,null));};exports['chatQueues']=function(_0x1eeb21,_0x79cee1){return respondWithRpcPromise(_0x5267('0x3f'),_0x1eeb21[_0x5267('0x12')],routingClient)[_0x5267('0x15')](respondWithResult(_0x79cee1,null))[_0x5267('0x9')](handleError(_0x79cee1,null));};exports[_0x5267('0x40')]=function(_0x3fd8f9,_0xf0b5a9){return respondWithRpcPromise(_0x5267('0x3f'),_0x3fd8f9['query'],routingClient)[_0x5267('0x15')](findById(_0x3fd8f9[_0x5267('0x17')]['id']))[_0x5267('0x15')](respondWithResult(_0xf0b5a9,null))[_0x5267('0x9')](handleError(_0xf0b5a9,null));};exports[_0x5267('0x41')]=function(_0x34c205,_0x552211){return respondWithRpcPromise(_0x5267('0x42'),_0x34c205['query'],routingClient)[_0x5267('0x15')](respondWithResult(_0x552211,null))[_0x5267('0x9')](handleError(_0x552211,null));};exports[_0x5267('0x43')]=function(_0x4a72c3,_0x1593ce){return respondWithRpcPromise(_0x5267('0x42'),_0x4a72c3[_0x5267('0x12')],routingClient)[_0x5267('0x15')](findById(_0x4a72c3[_0x5267('0x17')]['id']))[_0x5267('0x15')](respondWithResult(_0x1593ce,null))['catch'](handleError(_0x1593ce,null));};exports[_0x5267('0x44')]=function(_0x190d02,_0x186667){return respondWithRpcPromise(_0x5267('0x45'),_0x190d02['query'],mailClient)['then'](respondWithResult(_0x186667,null))[_0x5267('0x9')](handleError(_0x186667,null));};exports['openchannelQueues']=function(_0x3f5cda,_0x47059c){return respondWithRpcPromise('OpenchannelQueues',_0x3f5cda['query'],routingClient)[_0x5267('0x15')](respondWithResult(_0x47059c,null))[_0x5267('0x9')](handleError(_0x47059c,null));};exports[_0x5267('0x46')]=function(_0x537f75,_0x457dca){return respondWithRpcPromise(_0x5267('0x47'),_0x537f75[_0x5267('0x12')],routingClient)[_0x5267('0x15')](findById(_0x537f75['params']['id']))['then'](respondWithResult(_0x457dca,null))['catch'](handleError(_0x457dca,null));};exports[_0x5267('0x48')]=function(_0x2457a3,_0x45ee25){return respondWithRpcPromise(_0x5267('0x49'),_0x2457a3[_0x5267('0x12')],routingClient)[_0x5267('0x15')](respondWithResult(_0x45ee25,null))[_0x5267('0x9')](handleError(_0x45ee25,null));};exports[_0x5267('0x4a')]=function(_0x486b02,_0x1ddfad){return respondWithRpcPromise(_0x5267('0x49'),_0x486b02['query'],routingClient)[_0x5267('0x15')](findById(_0x486b02[_0x5267('0x17')]['id']))[_0x5267('0x15')](respondWithResult(_0x1ddfad,null))[_0x5267('0x9')](handleError(_0x1ddfad,null));};exports[_0x5267('0x4b')]=function(_0xde1ecd,_0x4915f4){return respondWithRpcPromise(_0x5267('0x4c'),_0xde1ecd[_0x5267('0x12')],routingClient)[_0x5267('0x15')](respondWithResult(_0x4915f4,null))[_0x5267('0x9')](handleError(_0x4915f4,null));};exports[_0x5267('0x4d')]=function(_0xd9bcf9,_0x4aac32){return respondWithRpcPromise(_0x5267('0x4c'),_0xd9bcf9[_0x5267('0x12')],routingClient)[_0x5267('0x15')](findById(_0xd9bcf9[_0x5267('0x17')]['id']))[_0x5267('0x15')](respondWithResult(_0x4aac32,null))[_0x5267('0x9')](handleError(_0x4aac32,null));};exports['faxQueues']=function(_0x283423,_0x41299c){return respondWithRpcPromise(_0x5267('0x4e'),_0x283423[_0x5267('0x12')],routingClient)['then'](respondWithResult(_0x41299c,null))['catch'](handleError(_0x41299c,null));};exports['showFaxQueues']=function(_0x910f97,_0x5cca85){return respondWithRpcPromise(_0x5267('0x4e'),_0x910f97['query'],routingClient)[_0x5267('0x15')](findById(_0x910f97[_0x5267('0x17')]['id']))[_0x5267('0x15')](respondWithResult(_0x5cca85,null))[_0x5267('0x9')](handleError(_0x5cca85,null));};exports[_0x5267('0x4f')]=function(_0xa92aa5,_0x21338f){return respondWithRpcPromise(_0x5267('0x50'),_0xa92aa5['query'])['then'](respondWithResult(_0x21338f,null))['catch'](handleError(_0x21338f,null));};exports[_0x5267('0x51')]=function(_0x28a101,_0x2ab2be){return respondWithRpcPromise(_0x5267('0x52'),_0x28a101['query'],routingClient)[_0x5267('0x15')](respondWithResult(_0x2ab2be,null))[_0x5267('0x9')](handleError(_0x2ab2be,null));};exports[_0x5267('0x53')]=function(_0xc3ac3f,_0x5a0e73){return respondWithRpcPromise(_0x5267('0x54'),_0xc3ac3f[_0x5267('0x12')],routingClient)['then'](respondWithResult(_0x5a0e73,null))[_0x5267('0x9')](handleError(_0x5a0e73,null));};exports[_0x5267('0x55')]=function(_0x4a9995,_0x47e235){return respondWithRpcPromise(_0x5267('0x56'),_0x4a9995[_0x5267('0x12')],routingClient)['then'](respondWithResult(_0x47e235,null))['catch'](handleError(_0x47e235,null));};exports[_0x5267('0x57')]=function(_0x2e7f8a,_0x35b302){return respondWithRpcPromise(_0x5267('0x56'),_0x2e7f8a[_0x5267('0x12')],routingClient)['then'](function(_0x4643ae){if(_0x2e7f8a[_0x5267('0x12')]['type']!==undefined){var _0x26c628=_(_0x4643ae[_0x5267('0x10')])[_0x5267('0x58')]([_0x2e7f8a[_0x5267('0x12')][_0x5267('0x59')],_0x2e7f8a[_0x5267('0x17')]['id']])[_0x5267('0x5a')](_0x5267('0x5b'))['uniq']()['value']();return _0x4643ae[_0x5267('0x10')][_0x5267('0x58')](function(_0x3f729f){return _0x26c628[_0x5267('0x5c')](_0x3f729f['queue_id'])>-0x1;});}else{return _0x4643ae[_0x5267('0x10')]['filter'](function(_0x2988a1){return _0x2988a1[_0x5267('0x5b')]===parseInt(_0x2e7f8a[_0x5267('0x17')]['id']);});}})[_0x5267('0x15')](respondWithResult(_0x35b302,null))['catch'](handleError(_0x35b302,null));};exports['smsQueuesWaitingInteractions']=function(_0x3a67a0,_0x3e2cf5){return respondWithRpcPromise(_0x5267('0x5d'),_0x3a67a0[_0x5267('0x12')],routingClient)[_0x5267('0x15')](respondWithResult(_0x3e2cf5,null))[_0x5267('0x9')](handleError(_0x3e2cf5,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x1b8d72,_0x4a05c9){return respondWithRpcPromise(_0x5267('0x5e'),_0x1b8d72['query'],routingClient)[_0x5267('0x15')](respondWithResult(_0x4a05c9,null))[_0x5267('0x9')](handleError(_0x4a05c9,null));};exports[_0x5267('0x5f')]=function(_0x87aa90,_0x164cc1){return respondWithRpcPromise(_0x5267('0x60'),_0x87aa90[_0x5267('0x12')],routingClient)[_0x5267('0x15')](respondWithResult(_0x164cc1,null))[_0x5267('0x9')](handleError(_0x164cc1,null));};exports[_0x5267('0x61')]=function(_0x555c8){return function(_0x531bb9,_0x40c7b5){var _0x14baf4,_0x4d9ec9;var _0xde179f=_[_0x5267('0x62')](_0x555c8);var _0x3ebda6=_0x555c8===_0x5267('0x63')?_0x5267('0x64'):_0x5267('0x65');return db[_0xde179f+_0x5267('0x66')]['findOne']({'raw':!![],'where':{'id':_0x531bb9[_0x5267('0x17')]['id']}})[_0x5267('0x15')](function(_0x2543a4){if(_[_0x5267('0xf')](_0x2543a4)){throw new Error(_0xde179f+_0x5267('0x67'));}_0x14baf4=_0x2543a4;return db[_0xde179f+'Message']['findOne']({'where':{'id':_0x531bb9[_0x5267('0x1b')][_0x5267('0x68')]},'include':[{'model':db[_0xde179f+_0x5267('0x69')],'as':_0x5267('0x69')},{'model':db[_0xde179f+_0x3ebda6],'as':'Account'}]});})[_0x5267('0x15')](function(_0x3cc775){if(_[_0x5267('0xf')](_0x3cc775)){throw new Error(_0xde179f+_0x5267('0x6a'));}_0x4d9ec9=_0x3cc775;return _0x3cc775[_0x5267('0x6b')]({'read':0x0,'readAt':null,'UserId':null});})[_0x5267('0x15')](function(){var _0x2b38f2={'uniqueid':_0x555c8+'.'+_0x4d9ec9['id']+'.'+_0x4d9ec9[_0x5267('0x69')]['id'],'FromUserId':_0x531bb9[_0x5267('0x2c')]['id'],'type':_0x5267('0x6c')};_0x2b38f2[_0xde179f+_0x5267('0x6d')]=_0x4d9ec9['id'];_0x2b38f2[_0xde179f+_0x5267('0x6e')]=_0x4d9ec9[_0x5267('0x69')]['id'];_0x2b38f2['From'+_0xde179f+_0x3ebda6+'Id']=_0x4d9ec9[_0x5267('0x65')]['id'];_0x2b38f2['To'+_0xde179f+_0x5267('0x6f')]=_0x14baf4['id'];return db[_0xde179f+_0x5267('0x70')][_0x5267('0x71')](_0x2b38f2);})[_0x5267('0x15')](function(){return respondWithRpcPromise(_0x5267('0x72'),{'channel':_0x555c8,'interaction':_0x4d9ec9[_0x5267('0x69')],'message':_0x4d9ec9,'account':_0x4d9ec9[_0x5267('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':_0x5267('0x6c'),'appdata':_0x14baf4[_0x5267('0xd')]+','+(_0x4d9ec9[_0x5267('0x65')][_0x5267('0x73')]||0x12c),'interval':_0x5267('0x74')}]},routingClient);})[_0x5267('0x15')](respondWithResult(_0x40c7b5,null))[_0x5267('0x9')](handleError(_0x40c7b5,null));};};exports[_0x5267('0x75')]=function(_0x28884b,_0x35a4a3){var _0x7ecf0e,_0x676556;if(_[_0x5267('0xf')](_0x28884b[_0x5267('0x1b')][_0x5267('0x76')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x339f3f=_0x28884b[_0x5267('0x1b')][_0x5267('0x76')];var _0x405eb4=_[_0x5267('0x62')](_0x339f3f);var _0x557749=_0x339f3f===_0x5267('0x63')?_0x5267('0x64'):'Account';return db['User']['findOne']({'raw':!![],'where':{'id':_0x28884b[_0x5267('0x17')]['id'],'role':'agent'}})[_0x5267('0x15')](function(_0x54422c){if(_['isNil'](_0x54422c)){throw new Error(_0x5267('0x77'));}_0x7ecf0e=_0x54422c;return db[_0x405eb4+_0x5267('0x78')][_0x5267('0x79')]({'where':{'id':_0x28884b[_0x5267('0x1b')][_0x5267('0x68')]},'include':[{'model':db[_0x405eb4+'Interaction'],'as':'Interaction'},{'model':db[_0x405eb4+_0x557749],'as':_0x5267('0x65')}]});})[_0x5267('0x15')](function(_0x1a6245){if(_[_0x5267('0xf')](_0x1a6245)){throw new Error(_0x405eb4+_0x5267('0x6a'));}_0x676556=_0x1a6245;return _0x1a6245['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x5267('0x15')](function(){var _0x5bece1={'uniqueid':_0x339f3f+'.'+_0x676556['id']+'.'+_0x676556['Interaction']['id'],'FromUserId':_0x28884b[_0x5267('0x2c')]['id'],'type':'queue','ToUserId':_0x7ecf0e['id']};_0x5bece1[_0x405eb4+'MessageId']=_0x676556['id'];_0x5bece1[_0x405eb4+_0x5267('0x6e')]=_0x676556[_0x5267('0x69')]['id'];_0x5bece1['From'+_0x405eb4+_0x557749+'Id']=_0x676556['Account']['id'];return db[_0x405eb4+'TransferReport'][_0x5267('0x71')](_0x5bece1);})['then'](function(){return respondWithRpcPromise(_0x5267('0x72'),{'channel':_0x339f3f,'interaction':_0x676556['Interaction'],'message':_0x676556,'account':_0x676556[_0x5267('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':_0x5267('0x37'),'appdata':_0x7ecf0e['name']+','+(_0x676556[_0x5267('0x65')][_0x5267('0x7a')]||0x12c),'interval':_0x5267('0x74')}]},routingClient);})[_0x5267('0x15')](respondWithResult(_0x35a4a3,null))[_0x5267('0x9')](handleError(_0x35a4a3,null));}; \ No newline at end of file +var _0x2eb2=['map','value','indexOf','filter','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Website','Queue','\x20Queue\x20not\x20found','Message','findOne','messageId','Interaction','Account','update','queue','MessageId','From','QueueId','TransferReport','create','queueTransferTimeout','*,*,*,*','channel','InteractionId','Start','agentTransferTimeout','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','request','then','error','message','result','status','json','stack','name','isNil','find','rows','voiceChannels','VoiceChannels','query','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','params','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','format','SIP/%s','interface','agent','internal','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type'];(function(_0x3b404f,_0xa30e6f){var _0x5ee6d0=function(_0x404209){while(--_0x404209){_0x3b404f['push'](_0x3b404f['shift']());}};_0x5ee6d0(++_0xa30e6f);}(_0x2eb2,0x19f));var _0x22eb=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x2eb2[_0x28947d];return _0x12d2ee;};'use strict';var BPromise=require('bluebird');var moment=require(_0x22eb('0x0'));var _=require(_0x22eb('0x1'));var util=require(_0x22eb('0x2'));var db=require(_0x22eb('0x3'))['db'];var logger=require(_0x22eb('0x4'))(_0x22eb('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x22eb('0x6')]['http']({'port':0x232a});var mailClient=jayson['client'][_0x22eb('0x7')]({'port':0x232b});var routingClient=jayson[_0x22eb('0x6')][_0x22eb('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x2a9850,_0x4539d0,_0x396806){return new BPromise(function(_0x33ddef,_0x3375d6){var _0x419601=_0x396806?_0x396806:amiClient;return _0x419601[_0x22eb('0x8')](_0x2a9850,_0x4539d0)[_0x22eb('0x9')](function(_0x3008e0){if(_0x3008e0['error']){if(_0x3008e0[_0x22eb('0xa')]['code']===0x1f4){return _0x3375d6(_0x3008e0['error'][_0x22eb('0xb')]);}return _0x33ddef(_0x3008e0['error'][_0x22eb('0xb')]);}else{_0x33ddef(_0x3008e0[_0x22eb('0xc')]);}})['catch'](function(_0x5068ea){_0x3375d6(_0x5068ea);});});}function respondWithResult(_0x1f286c,_0x189f05){_0x189f05=_0x189f05||0xc8;return function(_0x128d43){if(_0x128d43){return _0x1f286c[_0x22eb('0xd')](_0x189f05)[_0x22eb('0xe')](_0x128d43);}return _0x1f286c['sendStatus'](0x194);};}function handleError(_0x350ade,_0x53f14e){_0x53f14e=_0x53f14e||0x1f4;return function(_0x1f5089){logger['error'](_0x1f5089[_0x22eb('0xf')]);if(_0x1f5089[_0x22eb('0x10')]){delete _0x1f5089['name'];}_0x350ade['status'](_0x53f14e)['send'](_0x1f5089);};}function findById(_0x2ed8a7){return function(_0x5245fe){if(!_['isNil'](_0x2ed8a7)&&!_[_0x22eb('0x11')](_0x5245fe)&&!_['isNil'](_0x5245fe['rows'])){return _[_0x22eb('0x12')](_0x5245fe[_0x22eb('0x13')],function(_0x385bcb){return _0x385bcb['id']==_0x2ed8a7;});}return null;};}exports[_0x22eb('0x14')]=function(_0x3b0940,_0x4bc0a2){return respondWithRpcPromise(_0x22eb('0x15'),_0x3b0940[_0x22eb('0x16')])[_0x22eb('0x9')](respondWithResult(_0x4bc0a2,null))[_0x22eb('0x17')](handleError(_0x4bc0a2,null));};exports[_0x22eb('0x18')]=function(_0x517313,_0x2eb115){return respondWithRpcPromise(_0x22eb('0x19'),_[_0x22eb('0x1a')](_0x517313['query'],_0x517313['params']))[_0x22eb('0x9')](respondWithResult(_0x2eb115,null))[_0x22eb('0x17')](handleError(_0x2eb115,null));};exports[_0x22eb('0x1b')]=function(_0x44639a,_0x2d95f0){return respondWithRpcPromise(_0x22eb('0x1c'),_[_0x22eb('0x1a')](_0x44639a['query'],_0x44639a[_0x22eb('0x1d')]))[_0x22eb('0x9')](respondWithResult(_0x2d95f0,null))[_0x22eb('0x17')](handleError(_0x2d95f0,null));};exports[_0x22eb('0x1e')]=function(_0x420d4f,_0x4da252){return respondWithRpcPromise(_0x22eb('0x1f'),_0x420d4f[_0x22eb('0x16')])[_0x22eb('0x9')](respondWithResult(_0x4da252,null))['catch'](handleError(_0x4da252,null));};exports[_0x22eb('0x20')]=function(_0x259847,_0x4b409a){return respondWithRpcPromise(_0x22eb('0x1f'),_0x259847[_0x22eb('0x16')])[_0x22eb('0x9')](findById(_0x259847[_0x22eb('0x1d')]['id']))[_0x22eb('0x9')](respondWithResult(_0x4b409a,null))['catch'](handleError(_0x4b409a,null));};exports['updateVoiceQueue']=function(_0x2a950e,_0x25e5bc){return respondWithRpcPromise(_0x22eb('0x21'),_[_0x22eb('0x1a')](_0x2a950e[_0x22eb('0x22')],_0x2a950e[_0x22eb('0x1d')]))[_0x22eb('0x9')](respondWithResult(_0x25e5bc,null))[_0x22eb('0x17')](handleError(_0x25e5bc,null));};exports[_0x22eb('0x23')]=function(_0x39cec1,_0x24e9dc){return respondWithRpcPromise(_0x22eb('0x24'),_['merge'](_0x39cec1[_0x22eb('0x16')],_0x39cec1['params']))[_0x22eb('0x9')](respondWithResult(_0x24e9dc,null))[_0x22eb('0x17')](handleError(_0x24e9dc,null));};exports[_0x22eb('0x25')]=function(_0x11199f,_0x351ed8){return respondWithRpcPromise(_0x22eb('0x26'),_0x11199f[_0x22eb('0x16')])[_0x22eb('0x9')](respondWithResult(_0x351ed8,null))[_0x22eb('0x17')](handleError(_0x351ed8,null));};exports[_0x22eb('0x27')]=function(_0x509bb7,_0x49259f){return respondWithRpcPromise(_0x22eb('0x28'),_['merge'](_0x509bb7['query'],_0x509bb7[_0x22eb('0x1d')]))[_0x22eb('0x9')](respondWithResult(_0x49259f,null))[_0x22eb('0x17')](handleError(_0x49259f,null));};exports[_0x22eb('0x29')]=function(_0x45c53e,_0x332e9a){return respondWithRpcPromise(_0x22eb('0x2a'),_[_0x22eb('0x1a')](_0x45c53e[_0x22eb('0x16')],_0x45c53e[_0x22eb('0x1d')]))['then'](respondWithResult(_0x332e9a,null))[_0x22eb('0x17')](handleError(_0x332e9a,null));};exports['voiceQueuesChannelRedirect']=function(_0x5c43e7,_0x35a264){return respondWithRpcPromise(_0x22eb('0x2b'),_['merge'](_0x5c43e7[_0x22eb('0x16')],_0x5c43e7[_0x22eb('0x1d')]))[_0x22eb('0x9')](respondWithResult(_0x35a264,null))[_0x22eb('0x17')](handleError(_0x35a264,null));};exports[_0x22eb('0x2c')]=function(_0x574555,_0x25f140){return respondWithRpcPromise(_0x22eb('0x2d'),_0x574555['query'])[_0x22eb('0x9')](respondWithResult(_0x25f140,null))[_0x22eb('0x17')](handleError(_0x25f140,null));};exports[_0x22eb('0x2e')]=function(_0x2cc77c,_0x9353f1){return respondWithRpcPromise('OutboundChannels',_0x2cc77c['query'])[_0x22eb('0x9')](respondWithResult(_0x9353f1,null))[_0x22eb('0x17')](handleError(_0x9353f1,null));};exports['agents']=function(_0x595d76,_0x2e2a0c){var _0x46c6a1;return respondWithRpcPromise('Agents',_0x595d76[_0x22eb('0x16')])[_0x22eb('0x9')](function(_0x382163){_0x46c6a1=_0x382163;return respondWithRpcPromise(_0x22eb('0x2f'),_0x595d76[_0x22eb('0x16')],routingClient);})[_0x22eb('0x9')](function(_0x513b65){return _[_0x22eb('0x1a')]({},_0x513b65,_0x46c6a1);})[_0x22eb('0x9')](respondWithResult(_0x2e2a0c,null))['catch'](handleError(_0x2e2a0c,null));};exports[_0x22eb('0x30')]=function(_0x44d39f,_0x204092){if(_0x44d39f[_0x22eb('0x22')]&&_0x44d39f[_0x22eb('0x22')][_0x22eb('0x31')]&&_0x44d39f[_0x22eb('0x32')]&&_0x44d39f[_0x22eb('0x32')][_0x22eb('0x10')]){for(var _0x82ace8 in _0x44d39f[_0x22eb('0x22')][_0x22eb('0x31')]){if(_0x44d39f[_0x22eb('0x22')][_0x22eb('0x31')][_0x22eb('0x33')](_0x82ace8)){db[_0x22eb('0x34')][_0x22eb('0x35')]({'where':{'channel':_0x82ace8,'membername':_0x44d39f[_0x22eb('0x32')]['name'],'type':_0x22eb('0x36'),'exitAt':null,'uniqueid':_0x44d39f[_0x22eb('0x22')]['interaction'][_0x82ace8]&&_0x44d39f[_0x22eb('0x22')][_0x22eb('0x31')][_0x82ace8]['length']?{'$notIn':_0x44d39f['body']['interaction'][_0x82ace8]}:{'$ne':null}}})[_0x22eb('0x9')](function(_0x1efc65){var _0x4e4c6d=moment()['format'](_0x22eb('0x37'));for(var _0x43f771=0x0,_0x326b24=_0x1efc65[_0x22eb('0x38')];_0x43f771<_0x326b24;_0x43f771+=0x1){_0x1efc65[_0x43f771][_0x22eb('0x39')]({'exitAt':_0x4e4c6d});}});for(var _0x3b30a3=0x0;_0x3b30a3<_0x44d39f[_0x22eb('0x22')][_0x22eb('0x31')][_0x82ace8]['length'];_0x3b30a3+=0x1){db['MemberReport'][_0x22eb('0x3a')]({'where':{'channel':_0x82ace8,'membername':_0x44d39f['user'][_0x22eb('0x10')],'type':'INTERACTION','uniqueid':_0x44d39f[_0x22eb('0x22')]['interaction'][_0x82ace8][_0x3b30a3],'exitAt':null},'defaults':{'channel':_0x82ace8,'membername':_0x44d39f['user']['name'],'interface':_['isNil'](_0x44d39f[_0x22eb('0x32')]['interface'])?util[_0x22eb('0x3b')](_0x22eb('0x3c'),_0x44d39f['user'][_0x22eb('0x10')]):_0x44d39f['user'][_0x22eb('0x3d')],'type':_0x22eb('0x36'),'enterAt':moment()[_0x22eb('0x3b')](_0x22eb('0x37')),'role':_0x22eb('0x3e'),'internal':_0x44d39f[_0x22eb('0x32')][_0x22eb('0x3f')],'uniqueid':_0x44d39f[_0x22eb('0x22')][_0x22eb('0x31')][_0x82ace8][_0x3b30a3]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x44d39f[_0x22eb('0x1d')]['id'],'capacity':_0x44d39f[_0x22eb('0x22')]['capacity']},routingClient)[_0x22eb('0x9')](respondWithResult(_0x204092,null))[_0x22eb('0x17')](handleError(_0x204092,null));};exports[_0x22eb('0x40')]=function(_0x31216f,_0x4fee5c){return respondWithRpcPromise(_0x22eb('0x41'),_0x31216f[_0x22eb('0x16')])[_0x22eb('0x9')](respondWithResult(_0x4fee5c,null))[_0x22eb('0x17')](handleError(_0x4fee5c,null));};exports[_0x22eb('0x42')]=function(_0x10393b,_0x5effca){return respondWithRpcPromise(_0x22eb('0x43'),_0x10393b['query'])[_0x22eb('0x9')](respondWithResult(_0x5effca,null))['catch'](handleError(_0x5effca,null));};exports[_0x22eb('0x44')]=function(_0x254b53,_0x4028ef){return respondWithRpcPromise(_0x22eb('0x45'),_0x254b53[_0x22eb('0x16')])['then'](respondWithResult(_0x4028ef,null))['catch'](handleError(_0x4028ef,null));};exports[_0x22eb('0x46')]=function(_0x8e3864,_0x490110){return respondWithRpcPromise(_0x22eb('0x47'),_0x8e3864[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](respondWithResult(_0x490110,null))[_0x22eb('0x17')](handleError(_0x490110,null));};exports[_0x22eb('0x48')]=function(_0x27756b,_0x3a8588){return respondWithRpcPromise(_0x22eb('0x47'),_0x27756b[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](findById(_0x27756b[_0x22eb('0x1d')]['id']))['then'](respondWithResult(_0x3a8588,null))[_0x22eb('0x17')](handleError(_0x3a8588,null));};exports[_0x22eb('0x49')]=function(_0x3764d4,_0x2562a1){return respondWithRpcPromise(_0x22eb('0x4a'),_0x3764d4[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](respondWithResult(_0x2562a1,null))[_0x22eb('0x17')](handleError(_0x2562a1,null));};exports[_0x22eb('0x4b')]=function(_0x9f8465,_0x3e9ab5){return respondWithRpcPromise(_0x22eb('0x4a'),_0x9f8465[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](findById(_0x9f8465['params']['id']))['then'](respondWithResult(_0x3e9ab5,null))[_0x22eb('0x17')](handleError(_0x3e9ab5,null));};exports[_0x22eb('0x4c')]=function(_0x165e79,_0x38c02f){return respondWithRpcPromise(_0x22eb('0x4d'),_0x165e79['query'],mailClient)[_0x22eb('0x9')](respondWithResult(_0x38c02f,null))[_0x22eb('0x17')](handleError(_0x38c02f,null));};exports['openchannelQueues']=function(_0x485408,_0x341a1c){return respondWithRpcPromise(_0x22eb('0x4e'),_0x485408[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](respondWithResult(_0x341a1c,null))[_0x22eb('0x17')](handleError(_0x341a1c,null));};exports[_0x22eb('0x4f')]=function(_0x16099e,_0x22104f){return respondWithRpcPromise(_0x22eb('0x4e'),_0x16099e[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](findById(_0x16099e[_0x22eb('0x1d')]['id']))[_0x22eb('0x9')](respondWithResult(_0x22104f,null))[_0x22eb('0x17')](handleError(_0x22104f,null));};exports['smsQueues']=function(_0x29dd8b,_0x46ba3b){return respondWithRpcPromise(_0x22eb('0x50'),_0x29dd8b['query'],routingClient)[_0x22eb('0x9')](respondWithResult(_0x46ba3b,null))['catch'](handleError(_0x46ba3b,null));};exports[_0x22eb('0x51')]=function(_0x5347b4,_0x1919d0){return respondWithRpcPromise(_0x22eb('0x50'),_0x5347b4['query'],routingClient)[_0x22eb('0x9')](findById(_0x5347b4[_0x22eb('0x1d')]['id']))['then'](respondWithResult(_0x1919d0,null))['catch'](handleError(_0x1919d0,null));};exports[_0x22eb('0x52')]=function(_0x3073b1,_0x1984f0){return respondWithRpcPromise(_0x22eb('0x53'),_0x3073b1[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](respondWithResult(_0x1984f0,null))['catch'](handleError(_0x1984f0,null));};exports[_0x22eb('0x54')]=function(_0x5d035b,_0x5f4ea3){return respondWithRpcPromise(_0x22eb('0x53'),_0x5d035b[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](findById(_0x5d035b[_0x22eb('0x1d')]['id']))[_0x22eb('0x9')](respondWithResult(_0x5f4ea3,null))[_0x22eb('0x17')](handleError(_0x5f4ea3,null));};exports[_0x22eb('0x55')]=function(_0x109f7f,_0x50d914){return respondWithRpcPromise('FaxQueues',_0x109f7f[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](respondWithResult(_0x50d914,null))['catch'](handleError(_0x50d914,null));};exports[_0x22eb('0x56')]=function(_0x3f7405,_0x25f1b2){return respondWithRpcPromise(_0x22eb('0x57'),_0x3f7405[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](findById(_0x3f7405['params']['id']))[_0x22eb('0x9')](respondWithResult(_0x25f1b2,null))[_0x22eb('0x17')](handleError(_0x25f1b2,null));};exports[_0x22eb('0x58')]=function(_0x5e46b0,_0x4fcc2c){return respondWithRpcPromise(_0x22eb('0x59'),_0x5e46b0[_0x22eb('0x16')])[_0x22eb('0x9')](respondWithResult(_0x4fcc2c,null))['catch'](handleError(_0x4fcc2c,null));};exports[_0x22eb('0x5a')]=function(_0x4b6cf3,_0x1a305d){return respondWithRpcPromise(_0x22eb('0x5b'),_0x4b6cf3[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](respondWithResult(_0x1a305d,null))['catch'](handleError(_0x1a305d,null));};exports[_0x22eb('0x5c')]=function(_0x2e35b0,_0x304492){return respondWithRpcPromise(_0x22eb('0x5d'),_0x2e35b0[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](respondWithResult(_0x304492,null))[_0x22eb('0x17')](handleError(_0x304492,null));};exports[_0x22eb('0x5e')]=function(_0x47865e,_0x1c5b0b){return respondWithRpcPromise(_0x22eb('0x5f'),_0x47865e['query'],routingClient)[_0x22eb('0x9')](respondWithResult(_0x1c5b0b,null))[_0x22eb('0x17')](handleError(_0x1c5b0b,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x5cc383,_0x51d9f4){return respondWithRpcPromise(_0x22eb('0x5f'),_0x5cc383[_0x22eb('0x16')],routingClient)['then'](function(_0x10726f){if(_0x5cc383[_0x22eb('0x16')][_0x22eb('0x60')]!==undefined){var _0x41c50e=_(_0x10726f[_0x22eb('0x13')])['filter']([_0x5cc383['query'][_0x22eb('0x60')],_0x5cc383[_0x22eb('0x1d')]['id']])[_0x22eb('0x61')]('queue_id')['uniq']()[_0x22eb('0x62')]();return _0x10726f['rows']['filter'](function(_0x3568bc){return _0x41c50e[_0x22eb('0x63')](_0x3568bc['queue_id'])>-0x1;});}else{return _0x10726f['rows'][_0x22eb('0x64')](function(_0x2dd41a){return _0x2dd41a['queue_id']===parseInt(_0x5cc383[_0x22eb('0x1d')]['id']);});}})[_0x22eb('0x9')](respondWithResult(_0x51d9f4,null))[_0x22eb('0x17')](handleError(_0x51d9f4,null));};exports['smsQueuesWaitingInteractions']=function(_0x464f4f,_0x26fb52){return respondWithRpcPromise(_0x22eb('0x65'),_0x464f4f[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](respondWithResult(_0x26fb52,null))['catch'](handleError(_0x26fb52,null));};exports[_0x22eb('0x66')]=function(_0x2ecc24,_0x3f429b){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x2ecc24['query'],routingClient)[_0x22eb('0x9')](respondWithResult(_0x3f429b,null))[_0x22eb('0x17')](handleError(_0x3f429b,null));};exports[_0x22eb('0x67')]=function(_0x557c03,_0x215472){return respondWithRpcPromise(_0x22eb('0x68'),_0x557c03[_0x22eb('0x16')],routingClient)['then'](respondWithResult(_0x215472,null))[_0x22eb('0x17')](handleError(_0x215472,null));};exports['queueNotify']=function(_0x532a59){return function(_0x222616,_0x1e541f){var _0x1057f2,_0x49f362;var _0x3fc402=_[_0x22eb('0x69')](_0x532a59);var _0x2d422b=_0x532a59===_0x22eb('0x6a')?_0x22eb('0x6b'):'Account';return db[_0x3fc402+_0x22eb('0x6c')]['findOne']({'raw':!![],'where':{'id':_0x222616[_0x22eb('0x1d')]['id']}})[_0x22eb('0x9')](function(_0x37d7c6){if(_['isNil'](_0x37d7c6)){throw new Error(_0x3fc402+_0x22eb('0x6d'));}_0x1057f2=_0x37d7c6;return db[_0x3fc402+_0x22eb('0x6e')][_0x22eb('0x6f')]({'where':{'id':_0x222616[_0x22eb('0x22')][_0x22eb('0x70')]},'include':[{'model':db[_0x3fc402+_0x22eb('0x71')],'as':_0x22eb('0x71')},{'model':db[_0x3fc402+_0x2d422b],'as':_0x22eb('0x72')}]});})[_0x22eb('0x9')](function(_0x42d6fa){if(_[_0x22eb('0x11')](_0x42d6fa)){throw new Error(_0x3fc402+'\x20Message\x20not\x20found');}_0x49f362=_0x42d6fa;return _0x42d6fa[_0x22eb('0x73')]({'read':0x0,'readAt':null,'UserId':null});})[_0x22eb('0x9')](function(){var _0x40999d={'uniqueid':_0x532a59+'.'+_0x49f362['id']+'.'+_0x49f362[_0x22eb('0x71')]['id'],'FromUserId':_0x222616['user']['id'],'type':_0x22eb('0x74')};_0x40999d[_0x3fc402+_0x22eb('0x75')]=_0x49f362['id'];_0x40999d[_0x3fc402+'InteractionId']=_0x49f362[_0x22eb('0x71')]['id'];_0x40999d[_0x22eb('0x76')+_0x3fc402+_0x2d422b+'Id']=_0x49f362[_0x22eb('0x72')]['id'];_0x40999d['To'+_0x3fc402+_0x22eb('0x77')]=_0x1057f2['id'];return db[_0x3fc402+_0x22eb('0x78')][_0x22eb('0x79')](_0x40999d);})[_0x22eb('0x9')](function(){return respondWithRpcPromise('Start',{'channel':_0x532a59,'interaction':_0x49f362[_0x22eb('0x71')],'message':_0x49f362,'account':_0x49f362[_0x22eb('0x72')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x1057f2['name']+','+(_0x49f362[_0x22eb('0x72')][_0x22eb('0x7a')]||0x12c),'interval':_0x22eb('0x7b')}]},routingClient);})[_0x22eb('0x9')](respondWithResult(_0x1e541f,null))[_0x22eb('0x17')](handleError(_0x1e541f,null));};};exports['agentNotify']=function(_0x4e6fa6,_0x41fa99){var _0x18abf4,_0x5cf5e5;if(_[_0x22eb('0x11')](_0x4e6fa6[_0x22eb('0x22')][_0x22eb('0x7c')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x448fea=_0x4e6fa6[_0x22eb('0x22')][_0x22eb('0x7c')];var _0x402c2c=_[_0x22eb('0x69')](_0x448fea);var _0x195f58=_0x448fea===_0x22eb('0x6a')?_0x22eb('0x6b'):'Account';return db['User']['findOne']({'raw':!![],'where':{'id':_0x4e6fa6[_0x22eb('0x1d')]['id'],'role':'agent'}})['then'](function(_0x4170a5){if(_[_0x22eb('0x11')](_0x4170a5)){throw new Error('Agent\x20not\x20found');}_0x18abf4=_0x4170a5;return db[_0x402c2c+_0x22eb('0x6e')][_0x22eb('0x6f')]({'where':{'id':_0x4e6fa6[_0x22eb('0x22')][_0x22eb('0x70')]},'include':[{'model':db[_0x402c2c+'Interaction'],'as':_0x22eb('0x71')},{'model':db[_0x402c2c+_0x195f58],'as':_0x22eb('0x72')}]});})[_0x22eb('0x9')](function(_0x536f29){if(_['isNil'](_0x536f29)){throw new Error(_0x402c2c+'\x20Message\x20not\x20found');}_0x5cf5e5=_0x536f29;return _0x536f29[_0x22eb('0x73')]({'read':0x0,'readAt':null,'UserId':null});})[_0x22eb('0x9')](function(){var _0x48fa11={'uniqueid':_0x448fea+'.'+_0x5cf5e5['id']+'.'+_0x5cf5e5['Interaction']['id'],'FromUserId':_0x4e6fa6[_0x22eb('0x32')]['id'],'type':'queue','ToUserId':_0x18abf4['id']};_0x48fa11[_0x402c2c+'MessageId']=_0x5cf5e5['id'];_0x48fa11[_0x402c2c+_0x22eb('0x7d')]=_0x5cf5e5[_0x22eb('0x71')]['id'];_0x48fa11['From'+_0x402c2c+_0x195f58+'Id']=_0x5cf5e5['Account']['id'];return db[_0x402c2c+_0x22eb('0x78')][_0x22eb('0x79')](_0x48fa11);})[_0x22eb('0x9')](function(){return respondWithRpcPromise(_0x22eb('0x7e'),{'channel':_0x448fea,'interaction':_0x5cf5e5[_0x22eb('0x71')],'message':_0x5cf5e5,'account':_0x5cf5e5['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x18abf4[_0x22eb('0x10')]+','+(_0x5cf5e5[_0x22eb('0x72')][_0x22eb('0x7f')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x22eb('0x9')](respondWithResult(_0x41fa99,null))['catch'](handleError(_0x41fa99,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index f3d14be..3ecdf1b 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 _0xc8b5=['update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./schedule.controller','get','isAuthenticated','index','/:id','/:id/run','run','post','put'];(function(_0x4074d5,_0xa57194){var _0x502cfe=function(_0x345efa){while(--_0x345efa){_0x4074d5['push'](_0x4074d5['shift']());}};_0x502cfe(++_0xa57194);}(_0xc8b5,0xd5));var _0x5c8b=function(_0x2eeb51,_0x20d2b3){_0x2eeb51=_0x2eeb51-0x0;var _0x2740b3=_0xc8b5[_0x2eeb51];return _0x2740b3;};'use strict';var multer=require(_0x5c8b('0x0'));var util=require(_0x5c8b('0x1'));var path=require(_0x5c8b('0x2'));var timeout=require(_0x5c8b('0x3'));var express=require(_0x5c8b('0x4'));var router=express[_0x5c8b('0x5')]();var fs_extra=require(_0x5c8b('0x6'));var auth=require(_0x5c8b('0x7'));var interaction=require(_0x5c8b('0x8'));var config=require('../../config/environment');var controller=require(_0x5c8b('0x9'));router[_0x5c8b('0xa')]('/',auth[_0x5c8b('0xb')](),controller[_0x5c8b('0xc')]);router['get'](_0x5c8b('0xd'),auth[_0x5c8b('0xb')](),controller['show']);router['get'](_0x5c8b('0xe'),auth[_0x5c8b('0xb')](),controller[_0x5c8b('0xf')]);router[_0x5c8b('0x10')]('/',auth[_0x5c8b('0xb')](),controller['create']);router[_0x5c8b('0x11')](_0x5c8b('0xd'),auth[_0x5c8b('0xb')](),controller[_0x5c8b('0x12')]);router[_0x5c8b('0x13')]('/:id',auth[_0x5c8b('0xb')](),controller['destroy']);module[_0x5c8b('0x14')]=router; \ No newline at end of file +var _0x974e=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated','index','get','/:id','show','/:id/run','run','put','update','delete','destroy','exports'];(function(_0x121a0f,_0x1539eb){var _0x18d0f0=function(_0x23fa34){while(--_0x23fa34){_0x121a0f['push'](_0x121a0f['shift']());}};_0x18d0f0(++_0x1539eb);}(_0x974e,0x1ce));var _0xe974=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x974e[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require(_0xe974('0x0'));var path=require(_0xe974('0x1'));var timeout=require(_0xe974('0x2'));var express=require(_0xe974('0x3'));var router=express[_0xe974('0x4')]();var fs_extra=require(_0xe974('0x5'));var auth=require(_0xe974('0x6'));var interaction=require(_0xe974('0x7'));var config=require(_0xe974('0x8'));var controller=require(_0xe974('0x9'));router['get']('/',auth[_0xe974('0xa')](),controller[_0xe974('0xb')]);router[_0xe974('0xc')](_0xe974('0xd'),auth['isAuthenticated'](),controller[_0xe974('0xe')]);router[_0xe974('0xc')](_0xe974('0xf'),auth[_0xe974('0xa')](),controller[_0xe974('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe974('0x11')]('/:id',auth[_0xe974('0xa')](),controller[_0xe974('0x12')]);router[_0xe974('0x13')](_0xe974('0xd'),auth[_0xe974('0xa')](),controller[_0xe974('0x14')]);module[_0xe974('0x15')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 3605613..adf71bd 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 _0xbf3b=['days','hours','csv','pdf','xlsx','custom','default','TEXT','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','quarters','months','weeks'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf3b,0x1b1));var _0xbbf3=function(_0x589c72,_0x471fee){_0x589c72=_0x589c72-0x0;var _0x747473=_0xbf3b[_0x589c72];return _0x747473;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xbbf3('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xbbf3('0x1')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xbbf3('0x0')],'allowNull':![],'defaultValue':_0xbbf3('0x2')},'startAt':{'type':Sequelize[_0xbbf3('0x3')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xbbf3('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xbbf3('0x5')]('years',_0xbbf3('0x6'),_0xbbf3('0x7'),_0xbbf3('0x8'),_0xbbf3('0x9'),_0xbbf3('0xa'),'minutes'),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xbbf3('0x5')](_0xbbf3('0xb'),_0xbbf3('0xc'),_0xbbf3('0xd')),'allowNull':![],'defaultValue':_0xbbf3('0xb')},'type':{'type':Sequelize[_0xbbf3('0x5')](_0xbbf3('0xe'),_0xbbf3('0xf')),'allowNull':![],'defaultValue':_0xbbf3('0xe')},'sendMail':{'type':Sequelize[_0xbbf3('0x1')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xbbf3('0x10')]},'bcc':{'type':Sequelize[_0xbbf3('0x10')]},'sendIfEmpty':{'type':Sequelize[_0xbbf3('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0x16d0=['DATE','INTEGER','ENUM','years','months','weeks','days','minutes','csv','pdf','custom','default','BOOLEAN','TEXT','exports','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x16d0,0xce));var _0x016d=function(_0x1df42f,_0x341614){_0x1df42f=_0x1df42f-0x0;var _0x261739=_0x16d0[_0x1df42f];return _0x261739;};'use strict';var Sequelize=require('sequelize');module[_0x016d('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x016d('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x016d('0x1')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x016d('0x2')],'allowNull':![]},'endAt':{'type':Sequelize[_0x016d('0x2')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x016d('0x3')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x016d('0x4')](_0x016d('0x5'),'quarters',_0x016d('0x6'),_0x016d('0x7'),_0x016d('0x8'),'hours',_0x016d('0x9')),'allowNull':![],'defaultValue':_0x016d('0x8')},'output':{'type':Sequelize[_0x016d('0x4')](_0x016d('0xa'),_0x016d('0xb'),'xlsx'),'allowNull':![],'defaultValue':_0x016d('0xa')},'type':{'type':Sequelize[_0x016d('0x4')](_0x016d('0xc'),_0x016d('0xd')),'allowNull':![],'defaultValue':_0x016d('0xc')},'sendMail':{'type':Sequelize[_0x016d('0xe')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x016d('0xf')]},'bcc':{'type':Sequelize[_0x016d('0xf')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 53b0d9d..d8ecf1d 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 _0x2f66=['include','findAll','rows','params','rawAttributes','merge','create','user','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','body','destroy','find','run','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','Scheduler','UserProfileResource','error','stack','name','map','Schedule','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','VIRTUAL','options','includeAll'];(function(_0x1a6659,_0xcc8b76){var _0x53aeb8=function(_0x2b58f6){while(--_0x2b58f6){_0x1a6659['push'](_0x1a6659['shift']());}};_0x53aeb8(++_0xcc8b76);}(_0x2f66,0x107));var _0x62f6=function(_0x57944f,_0x4f975f){_0x57944f=_0x57944f-0x0;var _0x44d4d7=_0x2f66[_0x57944f];return _0x44d4d7;};'use strict';var emlformat=require(_0x62f6('0x0'));var rimraf=require(_0x62f6('0x1'));var zipdir=require(_0x62f6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x62f6('0x3'));var moment=require(_0x62f6('0x4'));var BPromise=require(_0x62f6('0x5'));var Mustache=require(_0x62f6('0x6'));var util=require('util');var path=require(_0x62f6('0x7'));var sox=require(_0x62f6('0x8'));var csv=require(_0x62f6('0x9'));var ejs=require(_0x62f6('0xa'));var fs=require('fs');var fs_extra=require(_0x62f6('0xb'));var _=require(_0x62f6('0xc'));var squel=require(_0x62f6('0xd'));var crypto=require(_0x62f6('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x62f6('0x9'));var querystring=require(_0x62f6('0xf'));var Papa=require('papaparse');var Redis=require(_0x62f6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x62f6('0x11'));var as=require(_0x62f6('0x12'));var hardwareService=require(_0x62f6('0x13'));var logger=require(_0x62f6('0x14'))('api');var utils=require(_0x62f6('0x15'));var config=require(_0x62f6('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x62f6('0x17'))['db'];function respondWithStatusCode(_0x35c200,_0x47de67){_0x47de67=_0x47de67||0xcc;return function(_0x47a316){if(_0x47a316){return _0x35c200[_0x62f6('0x18')](_0x47de67);}return _0x35c200[_0x62f6('0x19')](_0x47de67)[_0x62f6('0x1a')]();};}function respondWithResult(_0x1c2b7,_0x302652){_0x302652=_0x302652||0xc8;return function(_0x3dc73c){if(_0x3dc73c){return _0x1c2b7['status'](_0x302652)[_0x62f6('0x1b')](_0x3dc73c);}};}function respondWithFilteredResult(_0x1765cc,_0x3ff20d){return function(_0x3054e5){if(_0x3054e5){var _0x654785=typeof _0x3ff20d[_0x62f6('0x1c')]===_0x62f6('0x1d')&&typeof _0x3ff20d[_0x62f6('0x1e')]===_0x62f6('0x1d');var _0x30227b=_0x3054e5[_0x62f6('0x1f')];var _0x30df80=_0x654785?0x0:_0x3ff20d[_0x62f6('0x1c')];var _0xcb5c16=_0x654785?_0x3054e5[_0x62f6('0x1f')]:_0x3ff20d[_0x62f6('0x1c')]+_0x3ff20d['limit'];var _0x3ce6f3;if(_0xcb5c16>=_0x30227b){_0xcb5c16=_0x30227b;_0x3ce6f3=0xc8;}else{_0x3ce6f3=0xce;}_0x1765cc[_0x62f6('0x19')](_0x3ce6f3);return _0x1765cc[_0x62f6('0x20')](_0x62f6('0x21'),_0x30df80+'-'+_0xcb5c16+'/'+_0x30227b)[_0x62f6('0x1b')](_0x3054e5);}return null;};}function patchUpdates(_0x262027){return function(_0x5987b6){try{jsonpatch['apply'](_0x5987b6,_0x262027,!![]);}catch(_0x802a28){return BPromise['reject'](_0x802a28);}return _0x5987b6[_0x62f6('0x22')]();};}function saveUpdates(_0x2de099,_0x4c04af){return function(_0xdaaf25){if(_0xdaaf25){return _0xdaaf25[_0x62f6('0x23')](_0x2de099)[_0x62f6('0x24')](function(_0x1e5337){return _0x1e5337;});}return null;};}function removeEntity(_0x59bfd3,_0x4a91ab){return function(_0xf7a797){if(_0xf7a797){return _0xf7a797['destroy']()[_0x62f6('0x24')](function(){var _0x3acb1b=_0xf7a797['get']({'plain':!![]});var _0x5bba55=_0x62f6('0x25');return db[_0x62f6('0x26')]['destroy']({'where':{'type':_0x5bba55,'resourceId':_0x3acb1b['id']}})['then'](function(){return _0xf7a797;});})[_0x62f6('0x24')](function(){_0x59bfd3['status'](0xcc)[_0x62f6('0x1a')]();});}};}function handleEntityNotFound(_0x3ead65,_0x44307b){return function(_0x1732f9){if(!_0x1732f9){_0x3ead65[_0x62f6('0x18')](0x194);}return _0x1732f9;};}function handleError(_0x53fb49,_0xdd9084){_0xdd9084=_0xdd9084||0x1f4;return function(_0x1d3de7){logger[_0x62f6('0x27')](_0x1d3de7[_0x62f6('0x28')]);if(_0x1d3de7['name']){delete _0x1d3de7[_0x62f6('0x29')];}_0x53fb49[_0x62f6('0x19')](_0xdd9084)['send'](_0x1d3de7);};}exports['index']=function(_0x5d5316,_0xc60835){var _0x3bec5b={},_0x559efc={},_0x2a11fe={'count':0x0,'rows':[]};var _0x1225d0=_[_0x62f6('0x2a')](db[_0x62f6('0x2b')]['rawAttributes'],function(_0x94be67){return{'name':_0x94be67[_0x62f6('0x2c')],'type':_0x94be67[_0x62f6('0x2d')][_0x62f6('0x2e')]};});_0x559efc[_0x62f6('0x2f')]=_[_0x62f6('0x2a')](_0x1225d0,'name');_0x559efc[_0x62f6('0x30')]=_[_0x62f6('0x31')](_0x5d5316['query']);_0x559efc['filters']=_['intersection'](_0x559efc[_0x62f6('0x2f')],_0x559efc[_0x62f6('0x30')]);_0x3bec5b[_0x62f6('0x32')]=_[_0x62f6('0x33')](_0x559efc[_0x62f6('0x2f')],qs[_0x62f6('0x34')](_0x5d5316[_0x62f6('0x30')]['fields']));_0x3bec5b['attributes']=_0x3bec5b[_0x62f6('0x32')][_0x62f6('0x35')]?_0x3bec5b['attributes']:_0x559efc['model'];if(!_0x5d5316[_0x62f6('0x30')][_0x62f6('0x36')](_0x62f6('0x37'))){_0x3bec5b[_0x62f6('0x1e')]=qs['limit'](_0x5d5316['query']['limit']);_0x3bec5b[_0x62f6('0x1c')]=qs[_0x62f6('0x1c')](_0x5d5316[_0x62f6('0x30')][_0x62f6('0x1c')]);}_0x3bec5b[_0x62f6('0x38')]=qs[_0x62f6('0x39')](_0x5d5316[_0x62f6('0x30')][_0x62f6('0x39')]);_0x3bec5b['where']=qs['filters'](_[_0x62f6('0x3a')](_0x5d5316[_0x62f6('0x30')],_0x559efc[_0x62f6('0x3b')]),_0x1225d0);if(_0x5d5316[_0x62f6('0x30')][_0x62f6('0x3c')]){_0x3bec5b[_0x62f6('0x3d')]=_['merge'](_0x3bec5b[_0x62f6('0x3d')],{'$or':_[_0x62f6('0x2a')](_0x1225d0,function(_0x43f412){if(_0x43f412['type']!==_0x62f6('0x3e')){var _0x2aebcd={};_0x2aebcd[_0x43f412[_0x62f6('0x29')]]={'$like':'%'+_0x5d5316[_0x62f6('0x30')][_0x62f6('0x3c')]+'%'};return _0x2aebcd;}})});}_0x3bec5b=_['merge']({},_0x3bec5b,_0x5d5316[_0x62f6('0x3f')]);var _0x4b6e33={'where':_0x3bec5b['where']};return db[_0x62f6('0x2b')][_0x62f6('0x1f')](_0x4b6e33)['then'](function(_0x13e367){_0x2a11fe[_0x62f6('0x1f')]=_0x13e367;if(_0x5d5316[_0x62f6('0x30')][_0x62f6('0x40')]){_0x3bec5b[_0x62f6('0x41')]=[{'all':!![]}];}return db[_0x62f6('0x2b')][_0x62f6('0x42')](_0x3bec5b);})[_0x62f6('0x24')](function(_0x4bdd0c){_0x2a11fe[_0x62f6('0x43')]=_0x4bdd0c;return _0x2a11fe;})[_0x62f6('0x24')](respondWithFilteredResult(_0xc60835,_0x3bec5b))['catch'](handleError(_0xc60835,null));};exports['show']=function(_0x445f93,_0x274fc0){var _0x3cbe57={'raw':![],'where':{'id':_0x445f93[_0x62f6('0x44')]['id']}},_0x42a8a4={};_0x42a8a4[_0x62f6('0x2f')]=_[_0x62f6('0x31')](db[_0x62f6('0x2b')][_0x62f6('0x45')]);_0x42a8a4[_0x62f6('0x30')]=_[_0x62f6('0x31')](_0x445f93[_0x62f6('0x30')]);_0x42a8a4[_0x62f6('0x3b')]=_['intersection'](_0x42a8a4[_0x62f6('0x2f')],_0x42a8a4[_0x62f6('0x30')]);_0x3cbe57[_0x62f6('0x32')]=_['intersection'](_0x42a8a4[_0x62f6('0x2f')],qs[_0x62f6('0x34')](_0x445f93[_0x62f6('0x30')][_0x62f6('0x34')]));_0x3cbe57[_0x62f6('0x32')]=_0x3cbe57['attributes'][_0x62f6('0x35')]?_0x3cbe57[_0x62f6('0x32')]:_0x42a8a4[_0x62f6('0x2f')];if(_0x445f93[_0x62f6('0x30')][_0x62f6('0x40')]){_0x3cbe57[_0x62f6('0x41')]=[{'all':!![]}];}_0x3cbe57=_[_0x62f6('0x46')]({},_0x3cbe57,_0x445f93[_0x62f6('0x3f')]);return db['Schedule']['find'](_0x3cbe57)['then'](handleEntityNotFound(_0x274fc0,null))[_0x62f6('0x24')](respondWithResult(_0x274fc0,null))['catch'](handleError(_0x274fc0,null));};exports[_0x62f6('0x47')]=function(_0x4fcec6,_0x427f30){return db[_0x62f6('0x2b')]['create'](_0x4fcec6['body'],{})[_0x62f6('0x24')](function(_0x3531ce){var _0x26f427=_0x4fcec6[_0x62f6('0x48')]['get']({'plain':!![]});if(!_0x26f427)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26f427['role']===_0x62f6('0x48')){var _0x57caad=_0x3531ce[_0x62f6('0x49')]({'plain':!![]});var _0x595b1c=_0x62f6('0x25');return db[_0x62f6('0x4a')]['find']({'where':{'name':_0x595b1c,'userProfileId':_0x26f427[_0x62f6('0x4b')]},'raw':!![]})[_0x62f6('0x24')](function(_0x1e034f){if(_0x1e034f&&_0x1e034f['autoAssociation']===0x0){return db[_0x62f6('0x26')][_0x62f6('0x47')]({'name':_0x57caad[_0x62f6('0x29')],'resourceId':_0x57caad['id'],'type':_0x1e034f[_0x62f6('0x29')],'sectionId':_0x1e034f['id']},{})[_0x62f6('0x24')](function(){return _0x3531ce;});}else{return _0x3531ce;}})['catch'](function(_0x533380){logger[_0x62f6('0x27')](_0x62f6('0x4c'),_0x533380);throw _0x533380;});}return _0x3531ce;})[_0x62f6('0x24')](respondWithResult(_0x427f30,0xc9))[_0x62f6('0x4d')](handleError(_0x427f30,null));};exports[_0x62f6('0x23')]=function(_0x53e872,_0x5edfcd){if(_0x53e872[_0x62f6('0x4e')]['id']){delete _0x53e872[_0x62f6('0x4e')]['id'];}return db[_0x62f6('0x2b')]['find']({'where':{'id':_0x53e872[_0x62f6('0x44')]['id']}})['then'](handleEntityNotFound(_0x5edfcd,null))[_0x62f6('0x24')](saveUpdates(_0x53e872[_0x62f6('0x4e')],null))['then'](respondWithResult(_0x5edfcd,null))[_0x62f6('0x4d')](handleError(_0x5edfcd,null));};exports[_0x62f6('0x4f')]=function(_0x5e88f7,_0x54199a){return db[_0x62f6('0x2b')][_0x62f6('0x50')]({'where':{'id':_0x5e88f7[_0x62f6('0x44')]['id']}})[_0x62f6('0x24')](handleEntityNotFound(_0x54199a,null))['then'](removeEntity(_0x54199a,null))[_0x62f6('0x4d')](handleError(_0x54199a,null));};exports[_0x62f6('0x51')]=function(_0x81ee2,_0x2d72c3,_0x2b4f3e){var _0x295225=require('../../config/schedule');return db[_0x62f6('0x2b')][_0x62f6('0x50')]({'where':{'id':_0x81ee2[_0x62f6('0x44')]['id']},'raw':!![]})[_0x62f6('0x24')](handleEntityNotFound(_0x2d72c3,null))[_0x62f6('0x24')](function(){_0x295225[_0x62f6('0x51')](_0x81ee2[_0x62f6('0x44')]['id']);})[_0x62f6('0x24')](respondWithStatusCode(_0x2d72c3,null))[_0x62f6('0x4d')](handleError(_0x2d72c3,null));}; \ No newline at end of file +var _0x1049=['papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','destroy','then','Scheduler','UserProfileResource','error','stack','name','send','map','Schedule','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring'];(function(_0x3b7368,_0x382051){var _0x303e05=function(_0x5a2bd3){while(--_0x5a2bd3){_0x3b7368['push'](_0x3b7368['shift']());}};_0x303e05(++_0x382051);}(_0x1049,0x1b9));var _0x9104=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1049[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x9104('0x0'));var rimraf=require(_0x9104('0x1'));var zipdir=require(_0x9104('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9104('0x3'));var moment=require(_0x9104('0x4'));var BPromise=require(_0x9104('0x5'));var Mustache=require(_0x9104('0x6'));var util=require('util');var path=require(_0x9104('0x7'));var sox=require(_0x9104('0x8'));var csv=require(_0x9104('0x9'));var ejs=require(_0x9104('0xa'));var fs=require('fs');var fs_extra=require(_0x9104('0xb'));var _=require(_0x9104('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9104('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9104('0x9'));var querystring=require(_0x9104('0xe'));var Papa=require(_0x9104('0xf'));var Redis=require(_0x9104('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9104('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9104('0x12'));var logger=require('../../config/logger')(_0x9104('0x13'));var utils=require('../../config/utils');var config=require(_0x9104('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x9104('0x15'))['db'];function respondWithStatusCode(_0xaaac65,_0x4487fa){_0x4487fa=_0x4487fa||0xcc;return function(_0x449a8c){if(_0x449a8c){return _0xaaac65[_0x9104('0x16')](_0x4487fa);}return _0xaaac65[_0x9104('0x17')](_0x4487fa)[_0x9104('0x18')]();};}function respondWithResult(_0x35e533,_0x192d9f){_0x192d9f=_0x192d9f||0xc8;return function(_0x496b4d){if(_0x496b4d){return _0x35e533['status'](_0x192d9f)['json'](_0x496b4d);}};}function respondWithFilteredResult(_0x8a4c18,_0x2a24a0){return function(_0xc3cea7){if(_0xc3cea7){var _0xc1277b=typeof _0x2a24a0[_0x9104('0x19')]===_0x9104('0x1a')&&typeof _0x2a24a0[_0x9104('0x1b')]===_0x9104('0x1a');var _0x5136fa=_0xc3cea7[_0x9104('0x1c')];var _0x56c75b=_0xc1277b?0x0:_0x2a24a0['offset'];var _0x26bb71=_0xc1277b?_0xc3cea7['count']:_0x2a24a0['offset']+_0x2a24a0[_0x9104('0x1b')];var _0x2cb74d;if(_0x26bb71>=_0x5136fa){_0x26bb71=_0x5136fa;_0x2cb74d=0xc8;}else{_0x2cb74d=0xce;}_0x8a4c18[_0x9104('0x17')](_0x2cb74d);return _0x8a4c18[_0x9104('0x1d')](_0x9104('0x1e'),_0x56c75b+'-'+_0x26bb71+'/'+_0x5136fa)[_0x9104('0x1f')](_0xc3cea7);}return null;};}function patchUpdates(_0x58f630){return function(_0x2332de){try{jsonpatch['apply'](_0x2332de,_0x58f630,!![]);}catch(_0xcd448c){return BPromise['reject'](_0xcd448c);}return _0x2332de['save']();};}function saveUpdates(_0x387b8b,_0x558db8){return function(_0x462bda){if(_0x462bda){return _0x462bda[_0x9104('0x20')](_0x387b8b)['then'](function(_0x12dcb2){return _0x12dcb2;});}return null;};}function removeEntity(_0x54f4c8,_0x830cbd){return function(_0x296539){if(_0x296539){return _0x296539[_0x9104('0x21')]()[_0x9104('0x22')](function(){var _0x48e2fa=_0x296539['get']({'plain':!![]});var _0xcf6f13=_0x9104('0x23');return db[_0x9104('0x24')]['destroy']({'where':{'type':_0xcf6f13,'resourceId':_0x48e2fa['id']}})[_0x9104('0x22')](function(){return _0x296539;});})[_0x9104('0x22')](function(){_0x54f4c8[_0x9104('0x17')](0xcc)[_0x9104('0x18')]();});}};}function handleEntityNotFound(_0x5cd2a2,_0x2b3148){return function(_0x56c54d){if(!_0x56c54d){_0x5cd2a2[_0x9104('0x16')](0x194);}return _0x56c54d;};}function handleError(_0x4ab9f4,_0x3cfba3){_0x3cfba3=_0x3cfba3||0x1f4;return function(_0x8528f8){logger[_0x9104('0x25')](_0x8528f8[_0x9104('0x26')]);if(_0x8528f8[_0x9104('0x27')]){delete _0x8528f8['name'];}_0x4ab9f4[_0x9104('0x17')](_0x3cfba3)[_0x9104('0x28')](_0x8528f8);};}exports['index']=function(_0x2895af,_0x556286){var _0x4d0888={},_0x3cba58={},_0x38b0c0={'count':0x0,'rows':[]};var _0x4a0d9b=_[_0x9104('0x29')](db[_0x9104('0x2a')][_0x9104('0x2b')],function(_0x477d1d){return{'name':_0x477d1d[_0x9104('0x2c')],'type':_0x477d1d[_0x9104('0x2d')]['key']};});_0x3cba58[_0x9104('0x2e')]=_[_0x9104('0x29')](_0x4a0d9b,_0x9104('0x27'));_0x3cba58[_0x9104('0x2f')]=_[_0x9104('0x30')](_0x2895af[_0x9104('0x2f')]);_0x3cba58['filters']=_['intersection'](_0x3cba58[_0x9104('0x2e')],_0x3cba58[_0x9104('0x2f')]);_0x4d0888[_0x9104('0x31')]=_[_0x9104('0x32')](_0x3cba58['model'],qs[_0x9104('0x33')](_0x2895af[_0x9104('0x2f')][_0x9104('0x33')]));_0x4d0888[_0x9104('0x31')]=_0x4d0888['attributes'][_0x9104('0x34')]?_0x4d0888['attributes']:_0x3cba58[_0x9104('0x2e')];if(!_0x2895af['query']['hasOwnProperty']('nolimit')){_0x4d0888[_0x9104('0x1b')]=qs[_0x9104('0x1b')](_0x2895af['query'][_0x9104('0x1b')]);_0x4d0888[_0x9104('0x19')]=qs[_0x9104('0x19')](_0x2895af['query'][_0x9104('0x19')]);}_0x4d0888[_0x9104('0x35')]=qs['sort'](_0x2895af[_0x9104('0x2f')][_0x9104('0x36')]);_0x4d0888[_0x9104('0x37')]=qs[_0x9104('0x38')](_[_0x9104('0x39')](_0x2895af[_0x9104('0x2f')],_0x3cba58[_0x9104('0x38')]),_0x4a0d9b);if(_0x2895af[_0x9104('0x2f')][_0x9104('0x3a')]){_0x4d0888[_0x9104('0x37')]=_[_0x9104('0x3b')](_0x4d0888[_0x9104('0x37')],{'$or':_['map'](_0x4a0d9b,function(_0x43a7d0){if(_0x43a7d0[_0x9104('0x2d')]!==_0x9104('0x3c')){var _0x4d6456={};_0x4d6456[_0x43a7d0[_0x9104('0x27')]]={'$like':'%'+_0x2895af[_0x9104('0x2f')]['filter']+'%'};return _0x4d6456;}})});}_0x4d0888=_[_0x9104('0x3b')]({},_0x4d0888,_0x2895af['options']);var _0x1f9683={'where':_0x4d0888['where']};return db[_0x9104('0x2a')]['count'](_0x1f9683)[_0x9104('0x22')](function(_0x54dc0d){_0x38b0c0['count']=_0x54dc0d;if(_0x2895af[_0x9104('0x2f')][_0x9104('0x3d')]){_0x4d0888[_0x9104('0x3e')]=[{'all':!![]}];}return db[_0x9104('0x2a')]['findAll'](_0x4d0888);})['then'](function(_0x231c86){_0x38b0c0[_0x9104('0x3f')]=_0x231c86;return _0x38b0c0;})[_0x9104('0x22')](respondWithFilteredResult(_0x556286,_0x4d0888))['catch'](handleError(_0x556286,null));};exports[_0x9104('0x40')]=function(_0x25514d,_0x57571f){var _0x3fb1ff={'raw':![],'where':{'id':_0x25514d[_0x9104('0x41')]['id']}},_0x59e18f={};_0x59e18f['model']=_[_0x9104('0x30')](db[_0x9104('0x2a')][_0x9104('0x2b')]);_0x59e18f[_0x9104('0x2f')]=_[_0x9104('0x30')](_0x25514d[_0x9104('0x2f')]);_0x59e18f[_0x9104('0x38')]=_['intersection'](_0x59e18f[_0x9104('0x2e')],_0x59e18f[_0x9104('0x2f')]);_0x3fb1ff[_0x9104('0x31')]=_[_0x9104('0x32')](_0x59e18f[_0x9104('0x2e')],qs[_0x9104('0x33')](_0x25514d[_0x9104('0x2f')][_0x9104('0x33')]));_0x3fb1ff[_0x9104('0x31')]=_0x3fb1ff[_0x9104('0x31')][_0x9104('0x34')]?_0x3fb1ff[_0x9104('0x31')]:_0x59e18f['model'];if(_0x25514d['query'][_0x9104('0x3d')]){_0x3fb1ff[_0x9104('0x3e')]=[{'all':!![]}];}_0x3fb1ff=_['merge']({},_0x3fb1ff,_0x25514d['options']);return db[_0x9104('0x2a')][_0x9104('0x42')](_0x3fb1ff)[_0x9104('0x22')](handleEntityNotFound(_0x57571f,null))['then'](respondWithResult(_0x57571f,null))[_0x9104('0x43')](handleError(_0x57571f,null));};exports['create']=function(_0x50aa8d,_0x31689f){return db[_0x9104('0x2a')][_0x9104('0x44')](_0x50aa8d[_0x9104('0x45')],{})[_0x9104('0x22')](function(_0x2ca952){var _0x4e3508=_0x50aa8d['user']['get']({'plain':!![]});if(!_0x4e3508)throw new Error(_0x9104('0x46'));if(_0x4e3508[_0x9104('0x47')]==='user'){var _0x581148=_0x2ca952[_0x9104('0x48')]({'plain':!![]});var _0x20e277='Scheduler';return db['UserProfileSection'][_0x9104('0x42')]({'where':{'name':_0x20e277,'userProfileId':_0x4e3508[_0x9104('0x49')]},'raw':!![]})[_0x9104('0x22')](function(_0xb26b13){if(_0xb26b13&&_0xb26b13['autoAssociation']===0x0){return db[_0x9104('0x24')][_0x9104('0x44')]({'name':_0x581148['name'],'resourceId':_0x581148['id'],'type':_0xb26b13['name'],'sectionId':_0xb26b13['id']},{})[_0x9104('0x22')](function(){return _0x2ca952;});}else{return _0x2ca952;}})['catch'](function(_0x524737){logger[_0x9104('0x25')](_0x9104('0x4a'),_0x524737);throw _0x524737;});}return _0x2ca952;})['then'](respondWithResult(_0x31689f,0xc9))[_0x9104('0x43')](handleError(_0x31689f,null));};exports[_0x9104('0x20')]=function(_0x444e1a,_0x1fb038){if(_0x444e1a[_0x9104('0x45')]['id']){delete _0x444e1a[_0x9104('0x45')]['id'];}return db[_0x9104('0x2a')][_0x9104('0x42')]({'where':{'id':_0x444e1a['params']['id']}})[_0x9104('0x22')](handleEntityNotFound(_0x1fb038,null))[_0x9104('0x22')](saveUpdates(_0x444e1a['body'],null))[_0x9104('0x22')](respondWithResult(_0x1fb038,null))[_0x9104('0x43')](handleError(_0x1fb038,null));};exports[_0x9104('0x21')]=function(_0xae65ae,_0x4b8640){return db[_0x9104('0x2a')][_0x9104('0x42')]({'where':{'id':_0xae65ae[_0x9104('0x41')]['id']}})[_0x9104('0x22')](handleEntityNotFound(_0x4b8640,null))[_0x9104('0x22')](removeEntity(_0x4b8640,null))[_0x9104('0x43')](handleError(_0x4b8640,null));};exports[_0x9104('0x4b')]=function(_0x529332,_0x33b833,_0x562678){var _0x140691=require('../../config/schedule');return db['Schedule'][_0x9104('0x42')]({'where':{'id':_0x529332[_0x9104('0x41')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x33b833,null))['then'](function(){_0x140691[_0x9104('0x4b')](_0x529332[_0x9104('0x41')]['id']);})['then'](respondWithStatusCode(_0x33b833,null))[_0x9104('0x43')](handleError(_0x33b833,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 03bf856..56b5ff4 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 _0x572f=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','Schedule','tools_schedules','lodash','util'];(function(_0x361d8b,_0x23cbce){var _0x469613=function(_0x912fc1){while(--_0x912fc1){_0x361d8b['push'](_0x361d8b['shift']());}};_0x469613(++_0x23cbce);}(_0x572f,0x8e));var _0xf572=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x572f[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xf572('0x0'));var util=require(_0xf572('0x1'));var logger=require(_0xf572('0x2'))(_0xf572('0x3'));var moment=require('moment');var BPromise=require(_0xf572('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf572('0x5'));var rimraf=require(_0xf572('0x6'));var config=require(_0xf572('0x7'));var attributes=require('./schedule.attributes');module[_0xf572('0x8')]=function(_0x396298,_0x1d1ee8){return _0x396298[_0xf572('0x9')](_0xf572('0xa'),attributes,{'tableName':_0xf572('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a01=['moment','bluebird','request-promise','path','rimraf','exports','Schedule','tools_schedules','lodash','util','../../config/logger'];(function(_0x451043,_0xd459af){var _0x5755ba=function(_0x5cac52){while(--_0x5cac52){_0x451043['push'](_0x451043['shift']());}};_0x5755ba(++_0xd459af);}(_0x3a01,0x131));var _0x13a0=function(_0x1918d5,_0x12180b){_0x1918d5=_0x1918d5-0x0;var _0x448f40=_0x3a01[_0x1918d5];return _0x448f40;};'use strict';var _=require(_0x13a0('0x0'));var util=require(_0x13a0('0x1'));var logger=require(_0x13a0('0x2'))('api');var moment=require(_0x13a0('0x3'));var BPromise=require(_0x13a0('0x4'));var rp=require(_0x13a0('0x5'));var fs=require('fs');var path=require(_0x13a0('0x6'));var rimraf=require(_0x13a0('0x7'));var config=require('../../config/environment');var attributes=require('./schedule.attributes');module[_0x13a0('0x8')]=function(_0x35fe9d,_0x56830c){return _0x35fe9d['define'](_0x13a0('0x9'),attributes,{'tableName':_0x13a0('0xa'),'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 9192297..1d6fdab 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 _0x5909=['message','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x41490f,_0x3b2f24){var _0x3fa5bf=function(_0x337a63){while(--_0x337a63){_0x41490f['push'](_0x41490f['shift']());}};_0x3fa5bf(++_0x3b2f24);}(_0x5909,0x1dc));var _0x9590=function(_0x1f0679,_0x53d43c){_0x1f0679=_0x1f0679-0x0;var _0x3dc3a4=_0x5909[_0x1f0679];return _0x3dc3a4;};'use strict';var _=require(_0x9590('0x0'));var util=require(_0x9590('0x1'));var moment=require('moment');var BPromise=require(_0x9590('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9590('0x3'));var db=require(_0x9590('0x4'))['db'];var utils=require(_0x9590('0x5'));var logger=require('../../config/logger')(_0x9590('0x6'));var config=require(_0x9590('0x7'));var jayson=require(_0x9590('0x8'));var client=jayson[_0x9590('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45b938,_0x5028dd,_0x4556a6){return new BPromise(function(_0x39b7b4,_0x170473){return client[_0x9590('0xa')](_0x45b938,_0x4556a6)[_0x9590('0xb')](function(_0x56b347){logger[_0x9590('0xc')](_0x9590('0xd'),_0x5028dd,_0x9590('0xe'));logger[_0x9590('0xf')]('Schedule,\x20%s,\x20%s,\x20%s',_0x5028dd,'request\x20sent',JSON[_0x9590('0x10')](_0x56b347));if(_0x56b347[_0x9590('0x11')]){if(_0x56b347[_0x9590('0x11')]['code']===0x1f4){logger['error'](_0x9590('0xd'),_0x5028dd,_0x56b347['error'][_0x9590('0x12')]);return _0x170473(_0x56b347['error'][_0x9590('0x12')]);}logger[_0x9590('0x11')]('Schedule,\x20%s,\x20%s',_0x5028dd,_0x56b347[_0x9590('0x11')][_0x9590('0x12')]);return _0x39b7b4(_0x56b347[_0x9590('0x11')]['message']);}else{logger[_0x9590('0xc')](_0x9590('0xd'),_0x5028dd,_0x9590('0xe'));_0x39b7b4(_0x56b347['result'][_0x9590('0x12')]);}})['catch'](function(_0x551758){logger[_0x9590('0x11')](_0x9590('0xd'),_0x5028dd,_0x551758);_0x170473(_0x551758);});});} \ No newline at end of file +var _0xaa9a=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','Schedule,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x39dfcf,_0x4c23b8){var _0x2c8933=function(_0x2e2d69){while(--_0x2e2d69){_0x39dfcf['push'](_0x39dfcf['shift']());}};_0x2c8933(++_0x4c23b8);}(_0xaa9a,0x1de));var _0xaaa9=function(_0x570f85,_0x48098c){_0x570f85=_0x570f85-0x0;var _0x4c8ac7=_0xaa9a[_0x570f85];return _0x4c8ac7;};'use strict';var _=require(_0xaaa9('0x0'));var util=require(_0xaaa9('0x1'));var moment=require(_0xaaa9('0x2'));var BPromise=require(_0xaaa9('0x3'));var rs=require(_0xaaa9('0x4'));var fs=require('fs');var Redis=require(_0xaaa9('0x5'));var db=require(_0xaaa9('0x6'))['db'];var utils=require(_0xaaa9('0x7'));var logger=require(_0xaaa9('0x8'))('rpc');var config=require(_0xaaa9('0x9'));var jayson=require(_0xaaa9('0xa'));var client=jayson[_0xaaa9('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7aa064,_0x347820,_0x2b95db){return new BPromise(function(_0x3da559,_0x1a6ebf){return client[_0xaaa9('0xc')](_0x7aa064,_0x2b95db)['then'](function(_0x18c2c1){logger[_0xaaa9('0xd')](_0xaaa9('0xe'),_0x347820,_0xaaa9('0xf'));logger['debug']('Schedule,\x20%s,\x20%s,\x20%s',_0x347820,_0xaaa9('0xf'),JSON[_0xaaa9('0x10')](_0x18c2c1));if(_0x18c2c1[_0xaaa9('0x11')]){if(_0x18c2c1['error']['code']===0x1f4){logger[_0xaaa9('0x11')](_0xaaa9('0xe'),_0x347820,_0x18c2c1[_0xaaa9('0x11')][_0xaaa9('0x12')]);return _0x1a6ebf(_0x18c2c1[_0xaaa9('0x11')][_0xaaa9('0x12')]);}logger[_0xaaa9('0x11')](_0xaaa9('0xe'),_0x347820,_0x18c2c1[_0xaaa9('0x11')][_0xaaa9('0x12')]);return _0x3da559(_0x18c2c1[_0xaaa9('0x11')][_0xaaa9('0x12')]);}else{logger[_0xaaa9('0xd')](_0xaaa9('0xe'),_0x347820,_0xaaa9('0xf'));_0x3da559(_0x18c2c1[_0xaaa9('0x13')][_0xaaa9('0x12')]);}})[_0xaaa9('0x14')](function(_0x44eb29){logger[_0xaaa9('0x11')](_0xaaa9('0xe'),_0x347820,_0x44eb29);_0x1a6ebf(_0x44eb29);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index f3558f4..41e3a99 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 _0xe366=['/describe','isAuthenticated','describe','show','/:id/download','download','create','delete','/:id','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','index','get'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe366,0x1af));var _0x6e36=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xe366[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0x6e36('0x0'));var util=require(_0x6e36('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6e36('0x2'));var router=express[_0x6e36('0x3')]();var fs_extra=require(_0x6e36('0x4'));var auth=require(_0x6e36('0x5'));var interaction=require(_0x6e36('0x6'));var config=require('../../config/environment');var controller=require(_0x6e36('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x6e36('0x8')]);router[_0x6e36('0x9')](_0x6e36('0xa'),auth[_0x6e36('0xb')](),controller[_0x6e36('0xc')]);router[_0x6e36('0x9')]('/:id',auth[_0x6e36('0xb')](),controller[_0x6e36('0xd')]);router[_0x6e36('0x9')](_0x6e36('0xe'),auth[_0x6e36('0xb')](),controller[_0x6e36('0xf')]);router['post']('/',auth[_0x6e36('0xb')](),controller[_0x6e36('0x10')]);router['put']('/:id',auth[_0x6e36('0xb')](),controller['update']);router[_0x6e36('0x11')](_0x6e36('0x12'),auth[_0x6e36('0xb')](),controller[_0x6e36('0x13')]);module[_0x6e36('0x14')]=router; \ No newline at end of file +var _0xeecb=['create','put','update','delete','destroy','exports','connect-timeout','express','fs-extra','./screenRecording.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/download','download','post'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xeecb,0xce));var _0xbeec=function(_0x4c0998,_0x165050){_0x4c0998=_0x4c0998-0x0;var _0x1110e2=_0xeecb[_0x4c0998];return _0x1110e2;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xbeec('0x0'));var express=require(_0xbeec('0x1'));var router=express['Router']();var fs_extra=require(_0xbeec('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbeec('0x3'));router[_0xbeec('0x4')]('/',auth['isAuthenticated'](),controller[_0xbeec('0x5')]);router[_0xbeec('0x4')](_0xbeec('0x6'),auth[_0xbeec('0x7')](),controller[_0xbeec('0x8')]);router[_0xbeec('0x4')](_0xbeec('0x9'),auth[_0xbeec('0x7')](),controller[_0xbeec('0xa')]);router[_0xbeec('0x4')](_0xbeec('0xb'),auth[_0xbeec('0x7')](),controller[_0xbeec('0xc')]);router[_0xbeec('0xd')]('/',auth[_0xbeec('0x7')](),controller[_0xbeec('0xe')]);router[_0xbeec('0xf')]('/:id',auth[_0xbeec('0x7')](),controller[_0xbeec('0x10')]);router[_0xbeec('0x11')]('/:id',auth[_0xbeec('0x7')](),controller[_0xbeec('0x12')]);module[_0xbeec('0x13')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index ed57bba..f709388 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 _0x9e69=['getDataValue','value','STRING','setDataValue','INTEGER','startedAt','subtract','duration','DATE','format','toString','MM-DD-YYYY\x20HH:mm','updatedAt','moment','path','../../config/environment','exports'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x9e69,0x150));var _0x99e6=function(_0x3d6b65,_0x577884){_0x3d6b65=_0x3d6b65-0x0;var _0xd822a0=_0x9e69[_0x3d6b65];return _0xd822a0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x99e6('0x0'));var path=require(_0x99e6('0x1'));var config=require(_0x99e6('0x2'));module[_0x99e6('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x99e6('0x4')](_0x99e6('0x5'))?path['extname'](this[_0x99e6('0x4')](_0x99e6('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x99e6('0x6')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x99e6('0x6')],'set':function(_0x3cf241){var _0x41635b=_0x3cf241['replace'](/\\/g,'/');this[_0x99e6('0x7')](_0x99e6('0x5'),_0x41635b);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x99e6('0x8')],'set':function(_0x133169){this['setDataValue'](_0x99e6('0x9'),moment()[_0x99e6('0xa')](_0x133169,'ms'));this['setDataValue']('closedAt',moment());this[_0x99e6('0x7')](_0x99e6('0xb'),_0x133169);}},'startedAt':{'type':Sequelize[_0x99e6('0xc')],'get':function(){return moment(this[_0x99e6('0x4')](_0x99e6('0x9')))[_0x99e6('0xd')]('MM-DD-YYYY\x20HH:mm')[_0x99e6('0xe')]();}},'closedAt':{'type':Sequelize[_0x99e6('0xc')],'get':function(){return moment(this[_0x99e6('0x4')]('closedAt'))[_0x99e6('0xd')](_0x99e6('0xf'))[_0x99e6('0xe')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue']('createdAt'))[_0x99e6('0xd')](_0x99e6('0xf'))[_0x99e6('0xe')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x99e6('0x4')](_0x99e6('0x10')))[_0x99e6('0xd')](_0x99e6('0xf'))[_0x99e6('0xe')]();}}}; \ No newline at end of file +var _0x8fcd=['INTEGER','startedAt','closedAt','MM-DD-YYYY\x20HH:mm','toString','DATE','createdAt','updatedAt','format','sequelize','moment','path','../../config/environment','exports','value','extname','getDataValue','STRING','setDataValue'];(function(_0x27dd27,_0x397f9e){var _0x116fed=function(_0x491bd1){while(--_0x491bd1){_0x27dd27['push'](_0x27dd27['shift']());}};_0x116fed(++_0x397f9e);}(_0x8fcd,0xa1));var _0xd8fc=function(_0x2fe81,_0x134d72){_0x2fe81=_0x2fe81-0x0;var _0x49644a=_0x8fcd[_0x2fe81];return _0x49644a;};'use strict';var Sequelize=require(_0xd8fc('0x0'));var moment=require(_0xd8fc('0x1'));var path=require(_0xd8fc('0x2'));var config=require(_0xd8fc('0x3'));module[_0xd8fc('0x4')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0xd8fc('0x5'))?path[_0xd8fc('0x6')](this[_0xd8fc('0x7')](_0xd8fc('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0xd8fc('0x8')]},'channel':{'type':Sequelize[_0xd8fc('0x8')]},'value':{'type':Sequelize['STRING'],'set':function(_0x4f3825){var _0xa229b7=_0x4f3825['replace'](/\\/g,'/');this[_0xd8fc('0x9')](_0xd8fc('0x5'),_0xa229b7);}},'rating':{'type':Sequelize[_0xd8fc('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xd8fc('0xa')],'set':function(_0x56baca){this['setDataValue'](_0xd8fc('0xb'),moment()['subtract'](_0x56baca,'ms'));this['setDataValue'](_0xd8fc('0xc'),moment());this[_0xd8fc('0x9')]('duration',_0x56baca);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xd8fc('0x7')](_0xd8fc('0xb')))['format'](_0xd8fc('0xd'))[_0xd8fc('0xe')]();}},'closedAt':{'type':Sequelize[_0xd8fc('0xf')],'get':function(){return moment(this[_0xd8fc('0x7')](_0xd8fc('0xc')))['format'](_0xd8fc('0xd'))['toString']();}},'createdAt':{'type':Sequelize[_0xd8fc('0xf')],'get':function(){return moment(this[_0xd8fc('0x7')](_0xd8fc('0x10')))['format'](_0xd8fc('0xd'))[_0xd8fc('0xe')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0xd8fc('0x11')))[_0xd8fc('0x12')](_0xd8fc('0xd'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 381171d..beb699e 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 _0xed1f=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','ScreenRecording','rawAttributes','fieldName','type','key','differenceBy','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','show','params','merge','options','catch','create','body','duration','createdAt','closedAt','value','find','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','format','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','filename','extname','unlink','message','ScreenRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','eml-format','rimraf'];(function(_0x3715be,_0x2b2ae1){var _0x2e373c=function(_0x21677d){while(--_0x21677d){_0x3715be['push'](_0x3715be['shift']());}};_0x2e373c(++_0x2b2ae1);}(_0xed1f,0x6a));var _0xfed1=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0xed1f[_0xfa634c];return _0x73e478;};'use strict';var emlformat=require(_0xfed1('0x0'));var rimraf=require(_0xfed1('0x1'));var zipdir=require(_0xfed1('0x2'));var jsonpatch=require(_0xfed1('0x3'));var rp=require(_0xfed1('0x4'));var moment=require(_0xfed1('0x5'));var BPromise=require(_0xfed1('0x6'));var Mustache=require(_0xfed1('0x7'));var util=require(_0xfed1('0x8'));var path=require(_0xfed1('0x9'));var sox=require(_0xfed1('0xa'));var csv=require(_0xfed1('0xb'));var ejs=require(_0xfed1('0xc'));var fs=require('fs');var fs_extra=require(_0xfed1('0xd'));var _=require(_0xfed1('0xe'));var squel=require(_0xfed1('0xf'));var crypto=require(_0xfed1('0x10'));var jsforce=require(_0xfed1('0x11'));var deskjs=require('desk.js');var toCsv=require(_0xfed1('0xb'));var querystring=require(_0xfed1('0x12'));var Papa=require('papaparse');var Redis=require(_0xfed1('0x13'));var authService=require(_0xfed1('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xfed1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfed1('0x16'))(_0xfed1('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfed1('0x18'));var db=require(_0xfed1('0x19'))['db'];function respondWithStatusCode(_0x569a6e,_0x17f4fe){_0x17f4fe=_0x17f4fe||0xcc;return function(_0x5a3469){if(_0x5a3469){return _0x569a6e['sendStatus'](_0x17f4fe);}return _0x569a6e[_0xfed1('0x1a')](_0x17f4fe)[_0xfed1('0x1b')]();};}function respondWithResult(_0x532537,_0x2dde3a){_0x2dde3a=_0x2dde3a||0xc8;return function(_0x5b9455){if(_0x5b9455){return _0x532537['status'](_0x2dde3a)[_0xfed1('0x1c')](_0x5b9455);}};}function respondWithFilteredResult(_0x39aa0c,_0x1fbb7a){return function(_0x123c46){if(_0x123c46){var _0x582e67=typeof _0x1fbb7a[_0xfed1('0x1d')]==='undefined'&&typeof _0x1fbb7a[_0xfed1('0x1e')]===_0xfed1('0x1f');var _0x489a0f=_0x123c46[_0xfed1('0x20')];var _0xa72a20=_0x582e67?0x0:_0x1fbb7a['offset'];var _0x59509b=_0x582e67?_0x123c46['count']:_0x1fbb7a[_0xfed1('0x1d')]+_0x1fbb7a['limit'];var _0x201f18;if(_0x59509b>=_0x489a0f){_0x59509b=_0x489a0f;_0x201f18=0xc8;}else{_0x201f18=0xce;}_0x39aa0c[_0xfed1('0x1a')](_0x201f18);return _0x39aa0c['set'](_0xfed1('0x21'),_0xa72a20+'-'+_0x59509b+'/'+_0x489a0f)[_0xfed1('0x1c')](_0x123c46);}return null;};}function patchUpdates(_0x59ee9d){return function(_0x3ce944){try{jsonpatch[_0xfed1('0x22')](_0x3ce944,_0x59ee9d,!![]);}catch(_0xff4842){return BPromise[_0xfed1('0x23')](_0xff4842);}return _0x3ce944['save']();};}function saveUpdates(_0x203cec,_0x59333e){return function(_0x446558){if(_0x446558){return _0x446558[_0xfed1('0x24')](_0x203cec)[_0xfed1('0x25')](function(_0x532ec2){return _0x532ec2;});}return null;};}function removeEntity(_0x41d22c,_0x594917){return function(_0x460555){if(_0x460555){return _0x460555[_0xfed1('0x26')]()[_0xfed1('0x25')](function(){_0x41d22c[_0xfed1('0x1a')](0xcc)[_0xfed1('0x1b')]();});}};}function handleEntityNotFound(_0x1199b7,_0x527fc7){return function(_0x465ce6){if(!_0x465ce6){_0x1199b7[_0xfed1('0x27')](0x194);}return _0x465ce6;};}function handleError(_0x49072b,_0x1d6c72){_0x1d6c72=_0x1d6c72||0x1f4;return function(_0x2b9dd2){logger[_0xfed1('0x28')](_0x2b9dd2[_0xfed1('0x29')]);if(_0x2b9dd2[_0xfed1('0x2a')]){delete _0x2b9dd2[_0xfed1('0x2a')];}_0x49072b['status'](_0x1d6c72)[_0xfed1('0x2b')](_0x2b9dd2);};}exports['index']=function(_0x3106ee,_0x4e5249){var _0x53b0c9={},_0x1cec64={},_0x42c950={'count':0x0,'rows':[]};var _0x2d334e=_['map'](db[_0xfed1('0x2c')][_0xfed1('0x2d')],function(_0x13f414){return{'name':_0x13f414[_0xfed1('0x2e')],'type':_0x13f414[_0xfed1('0x2f')][_0xfed1('0x30')]};});_0x1cec64['model']=_[_0xfed1('0x31')](_[_0xfed1('0x32')](_0x2d334e,'name'),['format']);_0x1cec64[_0xfed1('0x33')]=_[_0xfed1('0x34')](_0x3106ee[_0xfed1('0x33')]);_0x1cec64[_0xfed1('0x35')]=_[_0xfed1('0x36')](_0x1cec64['model'],_0x1cec64[_0xfed1('0x33')]);_0x53b0c9[_0xfed1('0x37')]=_[_0xfed1('0x36')](_0x1cec64[_0xfed1('0x38')],qs[_0xfed1('0x39')](_0x3106ee['query'][_0xfed1('0x39')]));_0x53b0c9['attributes']=_0x53b0c9[_0xfed1('0x37')][_0xfed1('0x3a')]?_0x53b0c9[_0xfed1('0x37')]:_0x1cec64[_0xfed1('0x38')];if(!_0x3106ee[_0xfed1('0x33')][_0xfed1('0x3b')](_0xfed1('0x3c'))){_0x53b0c9[_0xfed1('0x1e')]=qs['limit'](_0x3106ee[_0xfed1('0x33')][_0xfed1('0x1e')]);_0x53b0c9[_0xfed1('0x1d')]=qs[_0xfed1('0x1d')](_0x3106ee['query']['offset']);}_0x53b0c9[_0xfed1('0x3d')]=qs[_0xfed1('0x3e')](_0x3106ee[_0xfed1('0x33')][_0xfed1('0x3e')]);_0x53b0c9[_0xfed1('0x3f')]=qs[_0xfed1('0x35')](_[_0xfed1('0x40')](_0x3106ee[_0xfed1('0x33')],_0x1cec64['filters']),_0x2d334e);if(_0x3106ee['query'][_0xfed1('0x41')]){_0x53b0c9[_0xfed1('0x3f')]=_['merge'](_0x53b0c9[_0xfed1('0x3f')],{'$or':_[_0xfed1('0x32')](_0x2d334e,function(_0x3b0973){if(_0x3b0973[_0xfed1('0x2f')]!==_0xfed1('0x42')){var _0x31ffeb={};_0x31ffeb[_0x3b0973[_0xfed1('0x2a')]]={'$like':'%'+_0x3106ee[_0xfed1('0x33')][_0xfed1('0x41')]+'%'};return _0x31ffeb;}})});}_0x53b0c9=_['merge']({},_0x53b0c9,_0x3106ee['options']);var _0x5598dc={'where':_0x53b0c9[_0xfed1('0x3f')]};return db[_0xfed1('0x2c')][_0xfed1('0x20')](_0x5598dc)['then'](function(_0x3454e6){_0x42c950['count']=_0x3454e6;if(_0x3106ee[_0xfed1('0x33')][_0xfed1('0x43')]){_0x53b0c9[_0xfed1('0x44')]=[{'all':!![]}];}return db['ScreenRecording'][_0xfed1('0x45')](_0x53b0c9);})[_0xfed1('0x25')](function(_0x422433){_0x42c950['rows']=_0x422433;return _0x42c950;})[_0xfed1('0x25')](respondWithFilteredResult(_0x4e5249,_0x53b0c9))['catch'](handleError(_0x4e5249,null));};exports[_0xfed1('0x46')]=function(_0xf1f739,_0x229fc7){var _0x13c087={'raw':![],'where':{'id':_0xf1f739[_0xfed1('0x47')]['id']}},_0x1bfbe8={};_0x1bfbe8[_0xfed1('0x38')]=_[_0xfed1('0x34')](db[_0xfed1('0x2c')]['rawAttributes']);_0x1bfbe8[_0xfed1('0x33')]=_[_0xfed1('0x34')](_0xf1f739[_0xfed1('0x33')]);_0x1bfbe8['filters']=_['intersection'](_0x1bfbe8[_0xfed1('0x38')],_0x1bfbe8[_0xfed1('0x33')]);_0x13c087[_0xfed1('0x37')]=_[_0xfed1('0x36')](_0x1bfbe8[_0xfed1('0x38')],qs[_0xfed1('0x39')](_0xf1f739[_0xfed1('0x33')][_0xfed1('0x39')]));_0x13c087[_0xfed1('0x37')]=_0x13c087[_0xfed1('0x37')][_0xfed1('0x3a')]?_0x13c087[_0xfed1('0x37')]:_0x1bfbe8['model'];if(_0xf1f739[_0xfed1('0x33')][_0xfed1('0x43')]){_0x13c087[_0xfed1('0x44')]=[{'all':!![]}];}_0x13c087=_[_0xfed1('0x48')]({},_0x13c087,_0xf1f739[_0xfed1('0x49')]);return db[_0xfed1('0x2c')]['find'](_0x13c087)[_0xfed1('0x25')](handleEntityNotFound(_0x229fc7,null))[_0xfed1('0x25')](respondWithResult(_0x229fc7,null))[_0xfed1('0x4a')](handleError(_0x229fc7,null));};exports['create']=function(_0x22874a,_0x10f98d){return db[_0xfed1('0x2c')][_0xfed1('0x4b')](_0x22874a['body'],{})[_0xfed1('0x25')](respondWithResult(_0x10f98d,0xc9))[_0xfed1('0x4a')](handleError(_0x10f98d,null));};exports[_0xfed1('0x24')]=function(_0x42761f,_0x14745e){if(_0x42761f[_0xfed1('0x4c')]['id']){delete _0x42761f[_0xfed1('0x4c')]['id'];}delete _0x42761f[_0xfed1('0x4c')][_0xfed1('0x4d')];delete _0x42761f[_0xfed1('0x4c')][_0xfed1('0x4e')];delete _0x42761f[_0xfed1('0x4c')][_0xfed1('0x4f')];delete _0x42761f[_0xfed1('0x4c')][_0xfed1('0x50')];return db[_0xfed1('0x2c')][_0xfed1('0x51')]({'where':{'id':_0x42761f[_0xfed1('0x47')]['id']}})['then'](handleEntityNotFound(_0x14745e,null))['then'](saveUpdates(_0x42761f[_0xfed1('0x4c')],null))[_0xfed1('0x25')](respondWithResult(_0x14745e,null))[_0xfed1('0x4a')](handleError(_0x14745e,null));};exports[_0xfed1('0x52')]=function(_0x5da599,_0x3c2534){return db[_0xfed1('0x2c')]['describe']()['then'](respondWithResult(_0x3c2534,null))['catch'](handleError(_0x3c2534,null));};exports[_0xfed1('0x53')]=function(_0x1aaa3d,_0x15e90f,_0x1d8ef2){var _0x2665c8=require(_0xfed1('0x54'));var _0x1a9f22=![];var _0x144102={};if(_0x1aaa3d[_0xfed1('0x33')][_0xfed1('0x2f')]&&_0x1aaa3d['query']['type']===_0xfed1('0x55')){_0x144102[_0xfed1('0x55')]=_0x1aaa3d[_0xfed1('0x47')]['id'];}else{_0x144102['id']=_0x1aaa3d[_0xfed1('0x47')]['id'];}return db[_0xfed1('0x2c')][_0xfed1('0x51')]({'where':_0x144102,'attributes':['id',_0xfed1('0x50')],'raw':!![]})[_0xfed1('0x25')](handleEntityNotFound(_0x15e90f,null))[_0xfed1('0x25')](function(_0x427fa6){if(_0x427fa6){var _0xbd49dc=path[_0xfed1('0x56')](config[_0xfed1('0x57')],_0xfed1('0x58'),_0x427fa6[_0xfed1('0x50')]);var _0x3a7a42=util[_0xfed1('0x59')]('%s.cypher',_0xbd49dc);if(fs['existsSync'](_0x3a7a42)){_0x1a9f22=!![];return _0x2665c8[_0xfed1('0x5a')](_0x3a7a42,_0xbd49dc,config[_0xfed1('0x5b')][_0xfed1('0x5c')])[_0xfed1('0x25')](function(){return _0x427fa6;});}return _0x427fa6;}})[_0xfed1('0x25')](function(_0x41a22a){if(_0x41a22a){var _0x2ccdc3=path[_0xfed1('0x56')](config[_0xfed1('0x57')],_0xfed1('0x58'),_0x41a22a[_0xfed1('0x50')]);if(!fs[_0xfed1('0x5d')](_0x2ccdc3)){throw new db[(_0xfed1('0x5e'))][(_0xfed1('0x5f'))]('ScreenRecording\x20not\x20found');}if(_0x41a22a[_0xfed1('0x60')]){return _0x15e90f['download'](_0x2ccdc3,_0x41a22a['filename']+path[_0xfed1('0x61')](_0x2ccdc3),function(){if(_0x1a9f22){fs['unlink'](_0x2ccdc3);}});}else{return _0x15e90f[_0xfed1('0x53')](_0x2ccdc3,function(_0x5acc45){if(_0x1a9f22){fs[_0xfed1('0x62')](_0x2ccdc3);}});}}})[_0xfed1('0x4a')](function(_0x53f0ab){if(_0x53f0ab[_0xfed1('0x63')]===_0xfed1('0x64')){_0x15e90f['status'](0x194)[_0xfed1('0x2b')](_0xfed1('0x65'));}else{return handleError(_0x15e90f,null);}});};exports[_0xfed1('0x26')]=function(_0x2f37b9,_0x59a23a){return db[_0xfed1('0x2c')][_0xfed1('0x51')]({'where':{'id':_0x2f37b9[_0xfed1('0x47')]['id']}})[_0xfed1('0x25')](function(_0x23347a){if(_[_0xfed1('0x66')](_0x23347a)){throw new ReferenceError(_0xfed1('0x67'));}return _0x23347a;})[_0xfed1('0x25')](function(_0x5c043d){var _0x2d66ec=path[_0xfed1('0x56')](config[_0xfed1('0x57')],_0xfed1('0x58'),_0x5c043d[_0xfed1('0x50')]);logger[_0xfed1('0x68')]('cancellazione\x20fisica\x20documento\x20%s',_0x2d66ec);if(!_['isNil'](_0x5c043d['value'])&&fs[_0xfed1('0x5d')](_0x2d66ec)){logger[_0xfed1('0x68')](_0xfed1('0x69')+_0x2d66ec+_0xfed1('0x6a'));fs['unlinkSync'](_0x2d66ec);}_0x2d66ec=_0x2d66ec+_0xfed1('0x6b');if(!_['isNil'](_0x5c043d[_0xfed1('0x50')])&&fs[_0xfed1('0x5d')](_0x2d66ec)){logger[_0xfed1('0x68')](_0xfed1('0x69')+_0x2d66ec+_0xfed1('0x6a'));fs['unlinkSync'](_0x2d66ec);}return _0x5c043d;})[_0xfed1('0x25')](function(_0x6b74cb){if(!_0x6b74cb)throw new InternalError();return _0x6b74cb[_0xfed1('0x26')]();})['then'](function(){_0x59a23a[_0xfed1('0x1a')](0xcc)[_0xfed1('0x1b')]();})[_0xfed1('0x4a')](handleError(_0x59a23a,null));}; \ No newline at end of file +var _0xac31=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','ScreenRecording','rawAttributes','type','key','model','differenceBy','format','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','options','then','includeAll','findAll','rows','catch','params','find','create','body','createdAt','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xac31,0xca));var _0x1ac3=function(_0x3b8e0d,_0x1996ff){_0x3b8e0d=_0x3b8e0d-0x0;var _0x208441=_0xac31[_0x3b8e0d];return _0x208441;};'use strict';var emlformat=require(_0x1ac3('0x0'));var rimraf=require(_0x1ac3('0x1'));var zipdir=require(_0x1ac3('0x2'));var jsonpatch=require(_0x1ac3('0x3'));var rp=require(_0x1ac3('0x4'));var moment=require(_0x1ac3('0x5'));var BPromise=require(_0x1ac3('0x6'));var Mustache=require('mustache');var util=require(_0x1ac3('0x7'));var path=require(_0x1ac3('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1ac3('0x9'));var fs=require('fs');var fs_extra=require(_0x1ac3('0xa'));var _=require(_0x1ac3('0xb'));var squel=require(_0x1ac3('0xc'));var crypto=require(_0x1ac3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1ac3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1ac3('0xf'));var Papa=require(_0x1ac3('0x10'));var Redis=require(_0x1ac3('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1ac3('0x12'));var as=require(_0x1ac3('0x13'));var hardwareService=require(_0x1ac3('0x14'));var logger=require(_0x1ac3('0x15'))(_0x1ac3('0x16'));var utils=require(_0x1ac3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1ac3('0x18'));var db=require(_0x1ac3('0x19'))['db'];function respondWithStatusCode(_0x2eeabf,_0x2338b9){_0x2338b9=_0x2338b9||0xcc;return function(_0x50d3b6){if(_0x50d3b6){return _0x2eeabf[_0x1ac3('0x1a')](_0x2338b9);}return _0x2eeabf[_0x1ac3('0x1b')](_0x2338b9)[_0x1ac3('0x1c')]();};}function respondWithResult(_0x2def9f,_0x53cc35){_0x53cc35=_0x53cc35||0xc8;return function(_0x24bb5e){if(_0x24bb5e){return _0x2def9f[_0x1ac3('0x1b')](_0x53cc35)['json'](_0x24bb5e);}};}function respondWithFilteredResult(_0x29a7b3,_0x1f9641){return function(_0x38b52a){if(_0x38b52a){var _0x51f1e4=typeof _0x1f9641[_0x1ac3('0x1d')]===_0x1ac3('0x1e')&&typeof _0x1f9641[_0x1ac3('0x1f')]==='undefined';var _0x195683=_0x38b52a['count'];var _0x291616=_0x51f1e4?0x0:_0x1f9641[_0x1ac3('0x1d')];var _0x20091d=_0x51f1e4?_0x38b52a[_0x1ac3('0x20')]:_0x1f9641[_0x1ac3('0x1d')]+_0x1f9641['limit'];var _0x136e73;if(_0x20091d>=_0x195683){_0x20091d=_0x195683;_0x136e73=0xc8;}else{_0x136e73=0xce;}_0x29a7b3[_0x1ac3('0x1b')](_0x136e73);return _0x29a7b3[_0x1ac3('0x21')](_0x1ac3('0x22'),_0x291616+'-'+_0x20091d+'/'+_0x195683)['json'](_0x38b52a);}return null;};}function patchUpdates(_0x48d18a){return function(_0x2879d8){try{jsonpatch[_0x1ac3('0x23')](_0x2879d8,_0x48d18a,!![]);}catch(_0x14070b){return BPromise[_0x1ac3('0x24')](_0x14070b);}return _0x2879d8[_0x1ac3('0x25')]();};}function saveUpdates(_0x319988,_0x23b767){return function(_0x10912a){if(_0x10912a){return _0x10912a[_0x1ac3('0x26')](_0x319988)['then'](function(_0x1e277f){return _0x1e277f;});}return null;};}function removeEntity(_0x231b7f,_0x4b19f2){return function(_0x2b5182){if(_0x2b5182){return _0x2b5182[_0x1ac3('0x27')]()['then'](function(){_0x231b7f[_0x1ac3('0x1b')](0xcc)[_0x1ac3('0x1c')]();});}};}function handleEntityNotFound(_0x145486,_0x2dfdb7){return function(_0x10db3d){if(!_0x10db3d){_0x145486['sendStatus'](0x194);}return _0x10db3d;};}function handleError(_0x5a2ab2,_0x503a64){_0x503a64=_0x503a64||0x1f4;return function(_0x528807){logger['error'](_0x528807[_0x1ac3('0x28')]);if(_0x528807['name']){delete _0x528807[_0x1ac3('0x29')];}_0x5a2ab2[_0x1ac3('0x1b')](_0x503a64)[_0x1ac3('0x2a')](_0x528807);};}exports[_0x1ac3('0x2b')]=function(_0x4b3d3c,_0x61441d){var _0x541da0={},_0x2ddd73={},_0x4000b0={'count':0x0,'rows':[]};var _0x440aed=_[_0x1ac3('0x2c')](db[_0x1ac3('0x2d')][_0x1ac3('0x2e')],function(_0x9c17c2){return{'name':_0x9c17c2['fieldName'],'type':_0x9c17c2[_0x1ac3('0x2f')][_0x1ac3('0x30')]};});_0x2ddd73[_0x1ac3('0x31')]=_[_0x1ac3('0x32')](_['map'](_0x440aed,_0x1ac3('0x29')),[_0x1ac3('0x33')]);_0x2ddd73[_0x1ac3('0x34')]=_[_0x1ac3('0x35')](_0x4b3d3c[_0x1ac3('0x34')]);_0x2ddd73['filters']=_[_0x1ac3('0x36')](_0x2ddd73[_0x1ac3('0x31')],_0x2ddd73[_0x1ac3('0x34')]);_0x541da0[_0x1ac3('0x37')]=_[_0x1ac3('0x36')](_0x2ddd73[_0x1ac3('0x31')],qs['fields'](_0x4b3d3c[_0x1ac3('0x34')][_0x1ac3('0x38')]));_0x541da0[_0x1ac3('0x37')]=_0x541da0[_0x1ac3('0x37')]['length']?_0x541da0[_0x1ac3('0x37')]:_0x2ddd73[_0x1ac3('0x31')];if(!_0x4b3d3c[_0x1ac3('0x34')][_0x1ac3('0x39')](_0x1ac3('0x3a'))){_0x541da0[_0x1ac3('0x1f')]=qs[_0x1ac3('0x1f')](_0x4b3d3c[_0x1ac3('0x34')][_0x1ac3('0x1f')]);_0x541da0['offset']=qs[_0x1ac3('0x1d')](_0x4b3d3c[_0x1ac3('0x34')]['offset']);}_0x541da0[_0x1ac3('0x3b')]=qs[_0x1ac3('0x3c')](_0x4b3d3c[_0x1ac3('0x34')][_0x1ac3('0x3c')]);_0x541da0[_0x1ac3('0x3d')]=qs[_0x1ac3('0x3e')](_[_0x1ac3('0x3f')](_0x4b3d3c[_0x1ac3('0x34')],_0x2ddd73['filters']),_0x440aed);if(_0x4b3d3c[_0x1ac3('0x34')]['filter']){_0x541da0[_0x1ac3('0x3d')]=_[_0x1ac3('0x40')](_0x541da0[_0x1ac3('0x3d')],{'$or':_[_0x1ac3('0x2c')](_0x440aed,function(_0x3141ae){if(_0x3141ae[_0x1ac3('0x2f')]!=='VIRTUAL'){var _0x3b5c1c={};_0x3b5c1c[_0x3141ae[_0x1ac3('0x29')]]={'$like':'%'+_0x4b3d3c[_0x1ac3('0x34')]['filter']+'%'};return _0x3b5c1c;}})});}_0x541da0=_[_0x1ac3('0x40')]({},_0x541da0,_0x4b3d3c[_0x1ac3('0x41')]);var _0x5cec6b={'where':_0x541da0[_0x1ac3('0x3d')]};return db[_0x1ac3('0x2d')][_0x1ac3('0x20')](_0x5cec6b)[_0x1ac3('0x42')](function(_0x466a45){_0x4000b0[_0x1ac3('0x20')]=_0x466a45;if(_0x4b3d3c[_0x1ac3('0x34')][_0x1ac3('0x43')]){_0x541da0['include']=[{'all':!![]}];}return db[_0x1ac3('0x2d')][_0x1ac3('0x44')](_0x541da0);})[_0x1ac3('0x42')](function(_0x254a77){_0x4000b0[_0x1ac3('0x45')]=_0x254a77;return _0x4000b0;})[_0x1ac3('0x42')](respondWithFilteredResult(_0x61441d,_0x541da0))[_0x1ac3('0x46')](handleError(_0x61441d,null));};exports['show']=function(_0x4edc4d,_0x2c2099){var _0x3f60ca={'raw':![],'where':{'id':_0x4edc4d[_0x1ac3('0x47')]['id']}},_0x4972d1={};_0x4972d1[_0x1ac3('0x31')]=_['keys'](db[_0x1ac3('0x2d')]['rawAttributes']);_0x4972d1[_0x1ac3('0x34')]=_[_0x1ac3('0x35')](_0x4edc4d[_0x1ac3('0x34')]);_0x4972d1[_0x1ac3('0x3e')]=_['intersection'](_0x4972d1[_0x1ac3('0x31')],_0x4972d1[_0x1ac3('0x34')]);_0x3f60ca[_0x1ac3('0x37')]=_[_0x1ac3('0x36')](_0x4972d1[_0x1ac3('0x31')],qs['fields'](_0x4edc4d[_0x1ac3('0x34')][_0x1ac3('0x38')]));_0x3f60ca[_0x1ac3('0x37')]=_0x3f60ca[_0x1ac3('0x37')]['length']?_0x3f60ca[_0x1ac3('0x37')]:_0x4972d1[_0x1ac3('0x31')];if(_0x4edc4d[_0x1ac3('0x34')][_0x1ac3('0x43')]){_0x3f60ca['include']=[{'all':!![]}];}_0x3f60ca=_[_0x1ac3('0x40')]({},_0x3f60ca,_0x4edc4d[_0x1ac3('0x41')]);return db[_0x1ac3('0x2d')][_0x1ac3('0x48')](_0x3f60ca)['then'](handleEntityNotFound(_0x2c2099,null))[_0x1ac3('0x42')](respondWithResult(_0x2c2099,null))['catch'](handleError(_0x2c2099,null));};exports[_0x1ac3('0x49')]=function(_0x10bcaf,_0x2e3347){return db[_0x1ac3('0x2d')][_0x1ac3('0x49')](_0x10bcaf[_0x1ac3('0x4a')],{})[_0x1ac3('0x42')](respondWithResult(_0x2e3347,0xc9))['catch'](handleError(_0x2e3347,null));};exports['update']=function(_0xe8f33c,_0x249c2d){if(_0xe8f33c[_0x1ac3('0x4a')]['id']){delete _0xe8f33c['body']['id'];}delete _0xe8f33c['body']['duration'];delete _0xe8f33c[_0x1ac3('0x4a')][_0x1ac3('0x4b')];delete _0xe8f33c['body'][_0x1ac3('0x4c')];delete _0xe8f33c[_0x1ac3('0x4a')][_0x1ac3('0x4d')];return db[_0x1ac3('0x2d')]['find']({'where':{'id':_0xe8f33c['params']['id']}})[_0x1ac3('0x42')](handleEntityNotFound(_0x249c2d,null))[_0x1ac3('0x42')](saveUpdates(_0xe8f33c['body'],null))[_0x1ac3('0x42')](respondWithResult(_0x249c2d,null))['catch'](handleError(_0x249c2d,null));};exports['describe']=function(_0x2d628d,_0x220dd0){return db['ScreenRecording'][_0x1ac3('0x4e')]()['then'](respondWithResult(_0x220dd0,null))[_0x1ac3('0x46')](handleError(_0x220dd0,null));};exports[_0x1ac3('0x4f')]=function(_0x3586b9,_0x3a0320,_0x34ad43){var _0x40e9c7=require(_0x1ac3('0x50'));var _0x331374=![];var _0xeb7e49={};if(_0x3586b9[_0x1ac3('0x34')][_0x1ac3('0x2f')]&&_0x3586b9['query']['type']===_0x1ac3('0x51')){_0xeb7e49[_0x1ac3('0x51')]=_0x3586b9[_0x1ac3('0x47')]['id'];}else{_0xeb7e49['id']=_0x3586b9[_0x1ac3('0x47')]['id'];}return db[_0x1ac3('0x2d')][_0x1ac3('0x48')]({'where':_0xeb7e49,'attributes':['id',_0x1ac3('0x4d')],'raw':!![]})[_0x1ac3('0x42')](handleEntityNotFound(_0x3a0320,null))[_0x1ac3('0x42')](function(_0x3149f6){if(_0x3149f6){var _0x541bba=path[_0x1ac3('0x52')](config[_0x1ac3('0x53')],_0x1ac3('0x54'),_0x3149f6[_0x1ac3('0x4d')]);var _0x20c195=util['format'](_0x1ac3('0x55'),_0x541bba);if(fs[_0x1ac3('0x56')](_0x20c195)){_0x331374=!![];return _0x40e9c7['decryptFile'](_0x20c195,_0x541bba,config['secrets']['recording'])[_0x1ac3('0x42')](function(){return _0x3149f6;});}return _0x3149f6;}})[_0x1ac3('0x42')](function(_0x2a1f66){if(_0x2a1f66){var _0x5ad546=path[_0x1ac3('0x52')](config['root'],'server/files/screen_recordings',_0x2a1f66['value']);if(!fs['existsSync'](_0x5ad546)){throw new db[(_0x1ac3('0x57'))][(_0x1ac3('0x58'))](_0x1ac3('0x59'));}if(_0x2a1f66[_0x1ac3('0x5a')]){return _0x3a0320[_0x1ac3('0x4f')](_0x5ad546,_0x2a1f66['filename']+path[_0x1ac3('0x5b')](_0x5ad546),function(){if(_0x331374){fs[_0x1ac3('0x5c')](_0x5ad546);}});}else{return _0x3a0320['download'](_0x5ad546,function(_0x2bcb4b){if(_0x331374){fs[_0x1ac3('0x5c')](_0x5ad546);}});}}})[_0x1ac3('0x46')](function(_0x2e79b2){if(_0x2e79b2[_0x1ac3('0x5d')]==='ScreenRecording\x20not\x20found'){_0x3a0320[_0x1ac3('0x1b')](0x194)[_0x1ac3('0x2a')](_0x1ac3('0x5e'));}else{return handleError(_0x3a0320,null);}});};exports[_0x1ac3('0x27')]=function(_0x4cfa04,_0x19407a){return db[_0x1ac3('0x2d')][_0x1ac3('0x48')]({'where':{'id':_0x4cfa04[_0x1ac3('0x47')]['id']}})[_0x1ac3('0x42')](function(_0x1ac283){if(_['isNil'](_0x1ac283)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1ac283;})['then'](function(_0x582fe2){var _0x3b930b=path['join'](config[_0x1ac3('0x53')],_0x1ac3('0x54'),_0x582fe2[_0x1ac3('0x4d')]);logger[_0x1ac3('0x5f')](_0x1ac3('0x60'),_0x3b930b);if(!_[_0x1ac3('0x61')](_0x582fe2['value'])&&fs[_0x1ac3('0x56')](_0x3b930b)){logger[_0x1ac3('0x5f')](_0x1ac3('0x62')+_0x3b930b+_0x1ac3('0x63'));fs['unlinkSync'](_0x3b930b);}_0x3b930b=_0x3b930b+_0x1ac3('0x64');if(!_[_0x1ac3('0x61')](_0x582fe2[_0x1ac3('0x4d')])&&fs[_0x1ac3('0x56')](_0x3b930b)){logger[_0x1ac3('0x5f')]('File:\x20\x22'+_0x3b930b+_0x1ac3('0x63'));fs['unlinkSync'](_0x3b930b);}return _0x582fe2;})['then'](function(_0x402507){if(!_0x402507)throw new InternalError();return _0x402507[_0x1ac3('0x27')]();})[_0x1ac3('0x42')](function(){_0x19407a[_0x1ac3('0x1b')](0xcc)[_0x1ac3('0x1c')]();})[_0x1ac3('0x46')](handleError(_0x19407a,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 12f1166..e098257 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 _0x8e29=['../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x4621eb,_0x3defb8){var _0x1f1769=function(_0x53a482){while(--_0x53a482){_0x4621eb['push'](_0x4621eb['shift']());}};_0x1f1769(++_0x3defb8);}(_0x8e29,0xfe));var _0x98e2=function(_0xf4e81,_0x4ea574){_0xf4e81=_0xf4e81-0x0;var _0x9ee828=_0x8e29[_0xf4e81];return _0x9ee828;};'use strict';var _=require('lodash');var util=require(_0x98e2('0x0'));var logger=require(_0x98e2('0x1'))('api');var moment=require(_0x98e2('0x2'));var BPromise=require(_0x98e2('0x3'));var rp=require(_0x98e2('0x4'));var fs=require('fs');var path=require(_0x98e2('0x5'));var rimraf=require('rimraf');var config=require(_0x98e2('0x6'));var attributes=require(_0x98e2('0x7'));module[_0x98e2('0x8')]=function(_0x49e1e7,_0x1f545e){return _0x49e1e7[_0x98e2('0x9')](_0x98e2('0xa'),attributes,{'tableName':_0x98e2('0xb'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x98e2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2b5d=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','screen_recordings','interactionid'];(function(_0xeba35c,_0x2e5dad){var _0x2f2c39=function(_0x211db4){while(--_0x211db4){_0xeba35c['push'](_0xeba35c['shift']());}};_0x2f2c39(++_0x2e5dad);}(_0x2b5d,0x118));var _0xd2b5=function(_0x1155bb,_0x1bc566){_0x1155bb=_0x1155bb-0x0;var _0x48f6c2=_0x2b5d[_0x1155bb];return _0x48f6c2;};'use strict';var _=require(_0xd2b5('0x0'));var util=require(_0xd2b5('0x1'));var logger=require(_0xd2b5('0x2'))(_0xd2b5('0x3'));var moment=require(_0xd2b5('0x4'));var BPromise=require(_0xd2b5('0x5'));var rp=require(_0xd2b5('0x6'));var fs=require('fs');var path=require(_0xd2b5('0x7'));var rimraf=require(_0xd2b5('0x8'));var config=require(_0xd2b5('0x9'));var attributes=require('./screenRecording.attributes');module[_0xd2b5('0xa')]=function(_0x3b1087,_0x309dea){return _0x3b1087[_0xd2b5('0xb')]('ScreenRecording',attributes,{'tableName':_0xd2b5('0xc'),'paranoid':![],'indexes':[{'name':_0xd2b5('0xd'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index de5a84d..59bf9c5 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 _0x0e00=['error','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s'];(function(_0x369cf2,_0x47e28c){var _0x5c7d3e=function(_0x4143d9){while(--_0x4143d9){_0x369cf2['push'](_0x369cf2['shift']());}};_0x5c7d3e(++_0x47e28c);}(_0x0e00,0x1cc));var _0x00e0=function(_0x45348c,_0x354af2){_0x45348c=_0x45348c-0x0;var _0x1f8279=_0x0e00[_0x45348c];return _0x1f8279;};'use strict';var _=require('lodash');var util=require(_0x00e0('0x0'));var moment=require(_0x00e0('0x1'));var BPromise=require('bluebird');var rs=require(_0x00e0('0x2'));var fs=require('fs');var Redis=require(_0x00e0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x00e0('0x4'));var logger=require(_0x00e0('0x5'))(_0x00e0('0x6'));var config=require('../../config/environment');var jayson=require(_0x00e0('0x7'));var client=jayson[_0x00e0('0x8')][_0x00e0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf78ab,_0xbced98,_0x18ff40){return new BPromise(function(_0x4fe768,_0x16f23d){return client['request'](_0xf78ab,_0x18ff40)['then'](function(_0x26da00){logger[_0x00e0('0xa')](_0x00e0('0xb'),_0xbced98,_0x00e0('0xc'));logger[_0x00e0('0xd')](_0x00e0('0xe'),_0xbced98,_0x00e0('0xc'),JSON['stringify'](_0x26da00));if(_0x26da00['error']){if(_0x26da00[_0x00e0('0xf')]['code']===0x1f4){logger[_0x00e0('0xf')](_0x00e0('0xb'),_0xbced98,_0x26da00[_0x00e0('0xf')][_0x00e0('0x10')]);return _0x16f23d(_0x26da00['error'][_0x00e0('0x10')]);}logger[_0x00e0('0xf')](_0x00e0('0xb'),_0xbced98,_0x26da00[_0x00e0('0xf')][_0x00e0('0x10')]);return _0x4fe768(_0x26da00['error'][_0x00e0('0x10')]);}else{logger[_0x00e0('0xa')]('ScreenRecording,\x20%s,\x20%s',_0xbced98,_0x00e0('0xc'));_0x4fe768(_0x26da00[_0x00e0('0x11')][_0x00e0('0x10')]);}})[_0x00e0('0x12')](function(_0x13fb4d){logger[_0x00e0('0xf')](_0x00e0('0xb'),_0xbced98,_0x13fb4d);_0x16f23d(_0x13fb4d);});});} \ No newline at end of file +var _0x2478=['bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment'];(function(_0x254a19,_0x7b092b){var _0xba020a=function(_0x231bb3){while(--_0x231bb3){_0x254a19['push'](_0x254a19['shift']());}};_0xba020a(++_0x7b092b);}(_0x2478,0x12a));var _0x8247=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x2478[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x8247('0x0'));var util=require('util');var moment=require(_0x8247('0x1'));var BPromise=require(_0x8247('0x2'));var rs=require(_0x8247('0x3'));var fs=require('fs');var Redis=require(_0x8247('0x4'));var db=require(_0x8247('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8247('0x6'));var config=require(_0x8247('0x7'));var jayson=require(_0x8247('0x8'));var client=jayson[_0x8247('0x9')][_0x8247('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56449d,_0x3441e4,_0x2bb143){return new BPromise(function(_0x2998ac,_0x8f1c1a){return client[_0x8247('0xb')](_0x56449d,_0x2bb143)['then'](function(_0x16e9b4){logger[_0x8247('0xc')](_0x8247('0xd'),_0x3441e4,_0x8247('0xe'));logger['debug'](_0x8247('0xf'),_0x3441e4,_0x8247('0xe'),JSON['stringify'](_0x16e9b4));if(_0x16e9b4[_0x8247('0x10')]){if(_0x16e9b4[_0x8247('0x10')][_0x8247('0x11')]===0x1f4){logger['error'](_0x8247('0xd'),_0x3441e4,_0x16e9b4['error'][_0x8247('0x12')]);return _0x8f1c1a(_0x16e9b4[_0x8247('0x10')]['message']);}logger[_0x8247('0x10')]('ScreenRecording,\x20%s,\x20%s',_0x3441e4,_0x16e9b4[_0x8247('0x10')]['message']);return _0x2998ac(_0x16e9b4[_0x8247('0x10')][_0x8247('0x12')]);}else{logger['info']('ScreenRecording,\x20%s,\x20%s',_0x3441e4,_0x8247('0xe'));_0x2998ac(_0x16e9b4['result']['message']);}})[_0x8247('0x13')](function(_0x18c6da){logger[_0x8247('0x10')](_0x8247('0xd'),_0x3441e4,_0x18c6da);_0x8f1c1a(_0x18c6da);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 84a5bb8..19f2ff6 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 _0xd55e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/gdpr','gdpr','/:id/preferred','getFavicon','join','server/files/images/logos/','format','%s%s','logo','originalname','post','single','root','logologin','extname','/:id/logo_login','file','addLogoLogin','diskStorage','preferred','/:id/favicon','put','isAuthenticated','update','multer','util'];(function(_0x1ebfc7,_0x2797db){var _0x1627b8=function(_0x59ceee){while(--_0x59ceee){_0x1ebfc7['push'](_0x1ebfc7['shift']());}};_0x1627b8(++_0x2797db);}(_0xd55e,0x166));var _0xed55=function(_0x1a0365,_0xc6d580){_0x1a0365=_0x1a0365-0x0;var _0x13c319=_0xd55e[_0x1a0365];return _0x13c319;};'use strict';var multer=require(_0xed55('0x0'));var util=require(_0xed55('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xed55('0x2'));var router=express[_0xed55('0x3')]();var fs_extra=require(_0xed55('0x4'));var auth=require(_0xed55('0x5'));var interaction=require(_0xed55('0x6'));var config=require(_0xed55('0x7'));var controller=require('./setting.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xed55('0x8')]);router[_0xed55('0x9')](_0xed55('0xa'),controller[_0xed55('0xb')]);router[_0xed55('0x9')](_0xed55('0xc'),controller[_0xed55('0xd')]);router['get'](_0xed55('0xe'),controller[_0xed55('0xf')]);router['get']('/:id/logo_login',controller['getLogoLogin']);router[_0xed55('0x9')](_0xed55('0x10'),controller[_0xed55('0x11')]);router['get'](_0xed55('0x12'),controller['getPreferred']);router[_0xed55('0x9')]('/:id/favicon',controller[_0xed55('0x13')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x21c8f6,_0x16a4ba,_0x12c1d7){_0x12c1d7(null,path[_0xed55('0x14')](config['root'],_0xed55('0x15')));},'filename':function(_0x2cffaf,_0x1da80a,_0x34c9c2){_0x34c9c2(null,util[_0xed55('0x16')](_0xed55('0x17'),_0xed55('0x18'),path['extname'](_0x1da80a[_0xed55('0x19')])));}})});router[_0xed55('0x1a')]('/:id/logo',upload[_0xed55('0x1b')]('file'),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xf448aa,_0x94a2d9,_0xddb77d){_0xddb77d(null,path[_0xed55('0x14')](config[_0xed55('0x1c')],_0xed55('0x15')));},'filename':function(_0x18d235,_0x5f3057,_0x28f182){_0x28f182(null,util[_0xed55('0x16')](_0xed55('0x17'),_0xed55('0x1d'),path[_0xed55('0x1e')](_0x5f3057[_0xed55('0x19')])));}})});router['post'](_0xed55('0x1f'),upload[_0xed55('0x1b')](_0xed55('0x20')),controller[_0xed55('0x21')]);var upload=multer({'storage':multer[_0xed55('0x22')]({'destination':function(_0x13fd58,_0xdde356,_0x380664){_0x380664(null,path[_0xed55('0x14')](config['root'],'server/files/images/logos/'));},'filename':function(_0x5644c6,_0x2a1d95,_0x5e279c){_0x5e279c(null,util['format'](_0xed55('0x17'),_0xed55('0x23'),path[_0xed55('0x1e')](_0x2a1d95['originalname'])));}})});router[_0xed55('0x1a')]('/:id/preferred',upload[_0xed55('0x1b')](_0xed55('0x20')),controller['addPreferred']);var upload=multer({'storage':multer[_0xed55('0x22')]({'destination':function(_0x3a62cc,_0x400167,_0xbfc3ac){_0xbfc3ac(null,path[_0xed55('0x14')](config[_0xed55('0x1c')],_0xed55('0x15')));},'filename':function(_0x49aba4,_0x1697b7,_0x12b453){_0x12b453(null,util['format'](_0xed55('0x17'),'favicon',path[_0xed55('0x1e')](_0x1697b7['originalname'])));}})});router[_0xed55('0x1a')](_0xed55('0x24'),upload['single'](_0xed55('0x20')),controller['addFavicon']);router[_0xed55('0x25')](_0xed55('0xc'),auth[_0xed55('0x26')](),controller[_0xed55('0x27')]);module['exports']=router; \ No newline at end of file +var _0x236c=['originalname','post','single','addLogo','join','%s%s','file','addLogoLogin','preferred','/:id/preferred','addPreferred','/:id/favicon','addFavicon','put','update','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','getFavicon','diskStorage','root','server/files/images/logos/','format','logo','extname'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x236c,0xec));var _0xc236=function(_0x2d14e7,_0x32cff9){_0x2d14e7=_0x2d14e7-0x0;var _0x30f1e8=_0x236c[_0x2d14e7];return _0x30f1e8;};'use strict';var multer=require(_0xc236('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc236('0x1'));var express=require(_0xc236('0x2'));var router=express[_0xc236('0x3')]();var fs_extra=require(_0xc236('0x4'));var auth=require(_0xc236('0x5'));var interaction=require(_0xc236('0x6'));var config=require(_0xc236('0x7'));var controller=require(_0xc236('0x8'));router[_0xc236('0x9')]('/',auth[_0xc236('0xa')](),controller[_0xc236('0xb')]);router[_0xc236('0x9')](_0xc236('0xc'),controller['getDate']);router['get'](_0xc236('0xd'),controller[_0xc236('0xe')]);router['get'](_0xc236('0xf'),controller[_0xc236('0x10')]);router[_0xc236('0x9')](_0xc236('0x11'),controller[_0xc236('0x12')]);router['get'](_0xc236('0x13'),controller[_0xc236('0x14')]);router['get']('/:id/preferred',controller['getPreferred']);router[_0xc236('0x9')]('/:id/favicon',controller[_0xc236('0x15')]);var upload=multer({'storage':multer[_0xc236('0x16')]({'destination':function(_0x1f5609,_0x5d6863,_0x5f442e){_0x5f442e(null,path['join'](config[_0xc236('0x17')],_0xc236('0x18')));},'filename':function(_0x49d18f,_0x1cb4fd,_0x249d58){_0x249d58(null,util[_0xc236('0x19')]('%s%s',_0xc236('0x1a'),path[_0xc236('0x1b')](_0x1cb4fd[_0xc236('0x1c')])));}})});router[_0xc236('0x1d')]('/:id/logo',upload[_0xc236('0x1e')]('file'),controller[_0xc236('0x1f')]);var upload=multer({'storage':multer[_0xc236('0x16')]({'destination':function(_0xd5a00c,_0x48f30e,_0x683ad1){_0x683ad1(null,path[_0xc236('0x20')](config[_0xc236('0x17')],_0xc236('0x18')));},'filename':function(_0x5a896b,_0x53c73f,_0x52bbfb){_0x52bbfb(null,util['format'](_0xc236('0x21'),'logologin',path[_0xc236('0x1b')](_0x53c73f[_0xc236('0x1c')])));}})});router[_0xc236('0x1d')](_0xc236('0x11'),upload[_0xc236('0x1e')](_0xc236('0x22')),controller[_0xc236('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x6f95a1,_0x18fe97,_0x3a684d){_0x3a684d(null,path[_0xc236('0x20')](config[_0xc236('0x17')],_0xc236('0x18')));},'filename':function(_0x31f3d0,_0x30f863,_0xd76b3b){_0xd76b3b(null,util[_0xc236('0x19')](_0xc236('0x21'),_0xc236('0x24'),path[_0xc236('0x1b')](_0x30f863[_0xc236('0x1c')])));}})});router[_0xc236('0x1d')](_0xc236('0x25'),upload[_0xc236('0x1e')]('file'),controller[_0xc236('0x26')]);var upload=multer({'storage':multer[_0xc236('0x16')]({'destination':function(_0x2defc8,_0x42b5a4,_0x22a627){_0x22a627(null,path['join'](config['root'],_0xc236('0x18')));},'filename':function(_0x490bfc,_0x4ef417,_0x24229a){_0x24229a(null,util['format']('%s%s','favicon',path[_0xc236('0x1b')](_0x4ef417[_0xc236('0x1c')])));}})});router[_0xc236('0x1d')](_0xc236('0x27'),upload[_0xc236('0x1e')](_0xc236('0x22')),controller[_0xc236('0x28')]);router[_0xc236('0x29')]('/:id',auth[_0xc236('0xa')](),controller[_0xc236('0x2a')]);module[_0xc236('0x2b')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index e639729..14bf531 100644 --- a/server/api/setting/setting.attributes.js +++ b/server/api/setting/setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x4da8f0,_0x295e37){var _0x3085e1=function(_0x42ae05){while(--_0x42ae05){_0x4da8f0['push'](_0x4da8f0['shift']());}};_0x3085e1(++_0x295e37);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x5cd729,_0x3deb6e){var _0x239376=function(_0x3a38e8){while(--_0x3a38e8){_0x5cd729['push'](_0x5cd729['shift']());}};_0x239376(++_0x3deb6e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index beb9cef..ce5f676 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 _0x34aa=['jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','send','index','map','Setting','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','name','options','includeAll','include','findAll','rows','show','params','find','body','addLogo','file','filename','logo','loginLogo','server/files/images/logos','preferred','favicon','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','default_logo.svg','default','custom','root','Sequelize','ValidationError','getLogoLogin','getLicense','defaultLogo','default_loginLogo.svg','upperFirst','download','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','\x20not\x20found','addFavicon','getFavicon','default_favicon.ico','now','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x55503b,_0x489192){var _0x4783c2=function(_0x18f1c8){while(--_0x18f1c8){_0x55503b['push'](_0x55503b['shift']());}};_0x4783c2(++_0x489192);}(_0x34aa,0x171));var _0xa34a=function(_0x3ef8f7,_0x35359a){_0x3ef8f7=_0x3ef8f7-0x0;var _0x3b097e=_0x34aa[_0x3ef8f7];return _0x3b097e;};'use strict';var emlformat=require(_0xa34a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa34a('0x1'));var jsonpatch=require(_0xa34a('0x2'));var rp=require(_0xa34a('0x3'));var moment=require(_0xa34a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa34a('0x5'));var util=require(_0xa34a('0x6'));var path=require(_0xa34a('0x7'));var sox=require(_0xa34a('0x8'));var csv=require(_0xa34a('0x9'));var ejs=require(_0xa34a('0xa'));var fs=require('fs');var fs_extra=require(_0xa34a('0xb'));var _=require(_0xa34a('0xc'));var squel=require(_0xa34a('0xd'));var crypto=require(_0xa34a('0xe'));var jsforce=require(_0xa34a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa34a('0x9'));var querystring=require(_0xa34a('0x10'));var Papa=require(_0xa34a('0x11'));var Redis=require(_0xa34a('0x12'));var authService=require(_0xa34a('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa34a('0x14'));var hardwareService=require(_0xa34a('0x15'));var logger=require(_0xa34a('0x16'))(_0xa34a('0x17'));var utils=require(_0xa34a('0x18'));var config=require(_0xa34a('0x19'));var licenseUtil=require(_0xa34a('0x1a'));var db=require('../../mysqldb')['db'];var jayson=require(_0xa34a('0x1b'));var client=jayson[_0xa34a('0x1c')][_0xa34a('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5ca87f,_0xc08e6,_0x441a7f,_0x525eff){return new BPromise(function(_0x2f5ded,_0x3d5926){var _0x5af32c=_0x525eff||client;return _0x5af32c[_0xa34a('0x1e')](_0x5ca87f,_0x441a7f)[_0xa34a('0x1f')](function(_0x19580a){logger[_0xa34a('0x20')](_0xa34a('0x21'),_0xc08e6,'request\x20sent');logger[_0xa34a('0x22')]('Setting,\x20%s,\x20%s,\x20%s',_0xc08e6,_0xa34a('0x23'),JSON[_0xa34a('0x24')](_0x19580a));if(_0x19580a[_0xa34a('0x25')]){if(_0x19580a[_0xa34a('0x25')]['code']===0x1f4){logger[_0xa34a('0x25')](_0xa34a('0x21'),_0xc08e6,_0x19580a[_0xa34a('0x25')][_0xa34a('0x26')]);return _0x3d5926(_0x19580a[_0xa34a('0x25')]['message']);}logger[_0xa34a('0x25')](_0xa34a('0x21'),_0xc08e6,_0x19580a[_0xa34a('0x25')]['message']);return _0x2f5ded(_0x19580a[_0xa34a('0x25')][_0xa34a('0x26')]);}else{logger[_0xa34a('0x20')](_0xa34a('0x21'),_0xc08e6,_0xa34a('0x23'));_0x2f5ded(_0x19580a[_0xa34a('0x27')]['message']);}})[_0xa34a('0x28')](function(_0x2afffe){logger['error'](_0xa34a('0x21'),_0xc08e6,_0x2afffe);_0x3d5926(_0x2afffe);});});}function respondWithStatusCode(_0x377c4a,_0x746078){_0x746078=_0x746078||0xcc;return function(_0x254b75){if(_0x254b75){return _0x377c4a[_0xa34a('0x29')](_0x746078);}return _0x377c4a[_0xa34a('0x2a')](_0x746078)[_0xa34a('0x2b')]();};}function respondWithResult(_0x54f08d,_0x351b9e){_0x351b9e=_0x351b9e||0xc8;return function(_0xb314d2){if(_0xb314d2){return _0x54f08d[_0xa34a('0x2a')](_0x351b9e)[_0xa34a('0x2c')](_0xb314d2);}};}function respondWithFilteredResult(_0x502b4d,_0x1ab30a){return function(_0x7ecf44){if(_0x7ecf44){var _0x30c843=typeof _0x1ab30a[_0xa34a('0x2d')]==='undefined'&&typeof _0x1ab30a[_0xa34a('0x2e')]===_0xa34a('0x2f');var _0x429d14=_0x7ecf44[_0xa34a('0x30')];var _0x48e428=_0x30c843?0x0:_0x1ab30a[_0xa34a('0x2d')];var _0x82350e=_0x30c843?_0x7ecf44[_0xa34a('0x30')]:_0x1ab30a[_0xa34a('0x2d')]+_0x1ab30a['limit'];var _0x1034d3;if(_0x82350e>=_0x429d14){_0x82350e=_0x429d14;_0x1034d3=0xc8;}else{_0x1034d3=0xce;}_0x502b4d[_0xa34a('0x2a')](_0x1034d3);return _0x502b4d['set'](_0xa34a('0x31'),_0x48e428+'-'+_0x82350e+'/'+_0x429d14)[_0xa34a('0x2c')](_0x7ecf44);}return null;};}function patchUpdates(_0x554cf6){return function(_0x5f4a05){try{jsonpatch[_0xa34a('0x32')](_0x5f4a05,_0x554cf6,!![]);}catch(_0x3e882b){return BPromise[_0xa34a('0x33')](_0x3e882b);}return _0x5f4a05[_0xa34a('0x34')]();};}function saveUpdates(_0xa8890c,_0x248324){return function(_0x5e490b){if(_0x5e490b){return _0x5e490b[_0xa34a('0x35')](_0xa8890c)[_0xa34a('0x1f')](function(_0x4d60de){return _0x4d60de;});}return null;};}function removeEntity(_0x120717,_0x3349c){return function(_0x39f804){if(_0x39f804){return _0x39f804[_0xa34a('0x36')]()['then'](function(){_0x120717[_0xa34a('0x2a')](0xcc)[_0xa34a('0x2b')]();});}};}function handleEntityNotFound(_0x457903,_0x5c5bf9){return function(_0xf9dd20){if(!_0xf9dd20){_0x457903[_0xa34a('0x29')](0x194);}return _0xf9dd20;};}function handleError(_0x38d3b2,_0xc93711){_0xc93711=_0xc93711||0x1f4;return function(_0x40db44){logger[_0xa34a('0x25')](_0x40db44['stack']);if(_0x40db44['name']){delete _0x40db44['name'];}_0x38d3b2[_0xa34a('0x2a')](_0xc93711)[_0xa34a('0x37')](_0x40db44);};}exports[_0xa34a('0x38')]=function(_0x46dc84,_0x2fede6){var _0xc74618={},_0x58b8ba={},_0x40b0d2={'count':0x0,'rows':[]};var _0xb4f345=_[_0xa34a('0x39')](db[_0xa34a('0x3a')][_0xa34a('0x3b')],function(_0x16e8f0){return{'name':_0x16e8f0['fieldName'],'type':_0x16e8f0[_0xa34a('0x3c')][_0xa34a('0x3d')]};});_0x58b8ba['model']=_[_0xa34a('0x39')](_0xb4f345,'name');_0x58b8ba[_0xa34a('0x3e')]=_[_0xa34a('0x3f')](_0x46dc84[_0xa34a('0x3e')]);_0x58b8ba[_0xa34a('0x40')]=_[_0xa34a('0x41')](_0x58b8ba[_0xa34a('0x42')],_0x58b8ba[_0xa34a('0x3e')]);_0xc74618[_0xa34a('0x43')]=_[_0xa34a('0x41')](_0x58b8ba['model'],qs['fields'](_0x46dc84[_0xa34a('0x3e')][_0xa34a('0x44')]));_0xc74618['attributes']=_0xc74618[_0xa34a('0x43')][_0xa34a('0x45')]?_0xc74618[_0xa34a('0x43')]:_0x58b8ba[_0xa34a('0x42')];if(!_0x46dc84['query'][_0xa34a('0x46')](_0xa34a('0x47'))){_0xc74618[_0xa34a('0x2e')]=qs[_0xa34a('0x2e')](_0x46dc84['query']['limit']);_0xc74618['offset']=qs[_0xa34a('0x2d')](_0x46dc84['query'][_0xa34a('0x2d')]);}_0xc74618[_0xa34a('0x48')]=qs[_0xa34a('0x49')](_0x46dc84[_0xa34a('0x3e')][_0xa34a('0x49')]);_0xc74618['where']=qs[_0xa34a('0x40')](_[_0xa34a('0x4a')](_0x46dc84[_0xa34a('0x3e')],_0x58b8ba[_0xa34a('0x40')]),_0xb4f345);if(_0x46dc84[_0xa34a('0x3e')][_0xa34a('0x4b')]){_0xc74618['where']=_[_0xa34a('0x4c')](_0xc74618[_0xa34a('0x4d')],{'$or':_[_0xa34a('0x39')](_0xb4f345,function(_0x63d3ca){if(_0x63d3ca[_0xa34a('0x3c')]!==_0xa34a('0x4e')){var _0x5914dc={};_0x5914dc[_0x63d3ca[_0xa34a('0x4f')]]={'$like':'%'+_0x46dc84['query'][_0xa34a('0x4b')]+'%'};return _0x5914dc;}})});}_0xc74618=_[_0xa34a('0x4c')]({},_0xc74618,_0x46dc84[_0xa34a('0x50')]);var _0x4d5834={'where':_0xc74618[_0xa34a('0x4d')]};return db['Setting'][_0xa34a('0x30')](_0x4d5834)['then'](function(_0x3d0b24){_0x40b0d2[_0xa34a('0x30')]=_0x3d0b24;if(_0x46dc84[_0xa34a('0x3e')][_0xa34a('0x51')]){_0xc74618[_0xa34a('0x52')]=[{'all':!![]}];}return db['Setting'][_0xa34a('0x53')](_0xc74618);})['then'](function(_0x87b76d){_0x40b0d2[_0xa34a('0x54')]=_0x87b76d;return _0x40b0d2;})[_0xa34a('0x1f')](respondWithFilteredResult(_0x2fede6,_0xc74618))[_0xa34a('0x28')](handleError(_0x2fede6,null));};exports[_0xa34a('0x55')]=function(_0xfe1d93,_0x30d59a){var _0xde8a7={'raw':![],'where':{'id':_0xfe1d93[_0xa34a('0x56')]['id']}},_0x4be0d0={};_0x4be0d0['model']=_['keys'](db['Setting'][_0xa34a('0x3b')]);_0x4be0d0['query']=_[_0xa34a('0x3f')](_0xfe1d93[_0xa34a('0x3e')]);_0x4be0d0['filters']=_[_0xa34a('0x41')](_0x4be0d0['model'],_0x4be0d0[_0xa34a('0x3e')]);_0xde8a7[_0xa34a('0x43')]=_[_0xa34a('0x41')](_0x4be0d0[_0xa34a('0x42')],qs['fields'](_0xfe1d93['query'][_0xa34a('0x44')]));_0xde8a7[_0xa34a('0x43')]=_0xde8a7[_0xa34a('0x43')][_0xa34a('0x45')]?_0xde8a7[_0xa34a('0x43')]:_0x4be0d0[_0xa34a('0x42')];if(_0xfe1d93[_0xa34a('0x3e')][_0xa34a('0x51')]){_0xde8a7[_0xa34a('0x52')]=[{'all':!![]}];}_0xde8a7=_[_0xa34a('0x4c')]({},_0xde8a7,_0xfe1d93['options']);return db[_0xa34a('0x3a')][_0xa34a('0x57')](_0xde8a7)[_0xa34a('0x1f')](handleEntityNotFound(_0x30d59a,null))['then'](respondWithResult(_0x30d59a,null))[_0xa34a('0x28')](handleError(_0x30d59a,null));};exports[_0xa34a('0x35')]=function(_0x4f80e5,_0x56ba98){if(_0x4f80e5[_0xa34a('0x58')]['id']){delete _0x4f80e5[_0xa34a('0x58')]['id'];}return db[_0xa34a('0x3a')][_0xa34a('0x57')]({'where':{'id':_0x4f80e5[_0xa34a('0x56')]['id']}})['then'](handleEntityNotFound(_0x56ba98,null))[_0xa34a('0x1f')](saveUpdates(_0x4f80e5[_0xa34a('0x58')],null))[_0xa34a('0x1f')](respondWithResult(_0x56ba98,null))[_0xa34a('0x28')](handleError(_0x56ba98,null));};exports[_0xa34a('0x59')]=function(_0x5dd258,_0xd5dd6a,_0x3e9cf7){if(_0x5dd258[_0xa34a('0x5a')]&&_0x5dd258[_0xa34a('0x5a')][_0xa34a('0x5b')]){_0x5dd258['body'][_0xa34a('0x5c')]=_0x5dd258['file'][_0xa34a('0x5b')];}return db[_0xa34a('0x3a')][_0xa34a('0x57')]({'where':{'id':_0x5dd258[_0xa34a('0x56')]['id']}})[_0xa34a('0x1f')](handleEntityNotFound(_0xd5dd6a,null))['then'](saveUpdates(_0x5dd258[_0xa34a('0x58')],null))['then'](respondWithResult(_0xd5dd6a,null))[_0xa34a('0x28')](handleError(_0xd5dd6a,null));};exports['addLogoLogin']=function(_0x42c73d,_0x1f2255,_0x4dca47){if(_0x42c73d[_0xa34a('0x5a')]&&_0x42c73d[_0xa34a('0x5a')]['filename']){_0x42c73d[_0xa34a('0x58')][_0xa34a('0x5d')]=_0x42c73d['file']['filename'];}return db[_0xa34a('0x3a')]['find']({'where':{'id':_0x42c73d['params']['id']}})[_0xa34a('0x1f')](handleEntityNotFound(_0x1f2255,null))[_0xa34a('0x1f')](saveUpdates(_0x42c73d[_0xa34a('0x58')],null))[_0xa34a('0x1f')](respondWithResult(_0x1f2255,null))[_0xa34a('0x28')](handleError(_0x1f2255,null));};var utilLicense=require('../../config/license/util');exports['getLogo']=function(_0x3de1de,_0x3f7a96,_0x5977ea){var _0x5a990d=_0xa34a('0x5e');var _0x25c6cb={'custom':![]};return utilLicense['getLicense']()[_0xa34a('0x1f')](function(_0x3dd354){if(_0x3dd354){_0x25c6cb=_0x3dd354;}return db[_0xa34a('0x3a')]['find']({'where':{'id':_0x3de1de[_0xa34a('0x56')]['id']},'attributes':[_0xa34a('0x5c'),_0xa34a('0x5d'),_0xa34a('0x5f'),_0xa34a('0x60'),'defaultLogo',_0xa34a('0x61'),_0xa34a('0x62'),_0xa34a('0x63')],'raw':!![]});})[_0xa34a('0x1f')](handleEntityNotFound(_0x3f7a96,null))['then'](function(_0x459ba7){if(_0x459ba7){var _0x5de8e3=_0x459ba7[_0xa34a('0x5c')]&&fs[_0xa34a('0x64')](path['join'](config['root'],_0x5a990d,_['toLower'](_0x459ba7[_0xa34a('0x5c')])))?path[_0xa34a('0x65')](config['root'],_0x5a990d,_[_0xa34a('0x66')](_0x459ba7[_0xa34a('0x5c')])):path[_0xa34a('0x65')](config['root'],_0x5a990d,_[_0xa34a('0x66')](_0xa34a('0x67')));var _0x2f6f52=_0xa34a('0x68')+_['upperFirst'](_0xa34a('0x5c'));if(_0x459ba7[_0x2f6f52]||!_0x25c6cb[_0xa34a('0x69')]){_0x5de8e3=path['join'](config[_0xa34a('0x6a')],_0x5a990d,_[_0xa34a('0x66')](_0xa34a('0x67')));}if(!fs[_0xa34a('0x64')](_0x5de8e3)){throw new db[(_0xa34a('0x6b'))][(_0xa34a('0x6c'))](_['upperFirst'](_0xa34a('0x5c'))+'\x20not\x20found');}return _0x3f7a96['download'](_0x5de8e3);}})[_0xa34a('0x28')](handleError(_0x3f7a96,null));};var utilLicense=require('../../config/license/util');exports[_0xa34a('0x6d')]=function(_0x1f1a07,_0x49f6fe,_0x52bf0a){var _0x81216a=_0xa34a('0x5e');var _0x480f5f={'custom':![]};return utilLicense[_0xa34a('0x6e')]()[_0xa34a('0x1f')](function(_0x354264){if(_0x354264){_0x480f5f=_0x354264;}return db[_0xa34a('0x3a')]['find']({'where':{'id':_0x1f1a07[_0xa34a('0x56')]['id']},'attributes':[_0xa34a('0x5c'),_0xa34a('0x5d'),_0xa34a('0x5f'),'favicon',_0xa34a('0x6f'),_0xa34a('0x61'),'defaultPreferred',_0xa34a('0x63')],'raw':!![]});})[_0xa34a('0x1f')](handleEntityNotFound(_0x49f6fe,null))['then'](function(_0x564093){if(_0x564093){var _0x2a6dfd=_0x564093[_0xa34a('0x5d')]&&fs[_0xa34a('0x64')](path[_0xa34a('0x65')](config['root'],_0x81216a,_['toLower'](_0x564093[_0xa34a('0x5d')])))?path[_0xa34a('0x65')](config[_0xa34a('0x6a')],_0x81216a,_['toLower'](_0x564093[_0xa34a('0x5d')])):path['join'](config[_0xa34a('0x6a')],_0x81216a,_[_0xa34a('0x66')](_0xa34a('0x70')));var _0x3ede65=_0xa34a('0x68')+_[_0xa34a('0x71')](_0xa34a('0x5d'));if(_0x564093[_0x3ede65]||!_0x480f5f['custom']){_0x2a6dfd=path[_0xa34a('0x65')](config[_0xa34a('0x6a')],_0x81216a,_['toLower']('default_loginLogo.svg'));}if(!fs['existsSync'](_0x2a6dfd)){throw new db[(_0xa34a('0x6b'))][(_0xa34a('0x6c'))](_[_0xa34a('0x71')](_0xa34a('0x5d'))+'\x20not\x20found');}return _0x49f6fe[_0xa34a('0x72')](_0x2a6dfd);}})[_0xa34a('0x28')](handleError(_0x49f6fe,null));};exports[_0xa34a('0x73')]=function(_0x5e846b,_0x17d795){return db[_0xa34a('0x3a')][_0xa34a('0x57')]({'where':{'id':_0x5e846b['params']['id']},'attributes':[_0xa34a('0x74')]})[_0xa34a('0x1f')](respondWithResult(_0x17d795,null))[_0xa34a('0x28')](handleError(_0x17d795,null));};exports[_0xa34a('0x75')]=function(_0x3008b,_0x3c5ec4,_0x53e3e5){if(_0x3008b[_0xa34a('0x5a')]&&_0x3008b[_0xa34a('0x5a')]['filename']){_0x3008b[_0xa34a('0x58')][_0xa34a('0x5f')]=_0x3008b[_0xa34a('0x5a')][_0xa34a('0x5b')];}return db['Setting'][_0xa34a('0x57')]({'where':{'id':_0x3008b[_0xa34a('0x56')]['id']}})[_0xa34a('0x1f')](handleEntityNotFound(_0x3c5ec4,null))['then'](saveUpdates(_0x3008b['body'],null))[_0xa34a('0x1f')](respondWithResult(_0x3c5ec4,null))['catch'](handleError(_0x3c5ec4,null));};var utilLicense=require(_0xa34a('0x1a'));exports[_0xa34a('0x76')]=function(_0x36682b,_0x464168,_0x208536){var _0x4a4a3f=_0xa34a('0x5e');var _0x5e51e7={'custom':![]};return utilLicense[_0xa34a('0x6e')]()[_0xa34a('0x1f')](function(_0x163407){if(_0x163407){_0x5e51e7=_0x163407;}return db[_0xa34a('0x3a')][_0xa34a('0x57')]({'where':{'id':_0x36682b['params']['id']},'attributes':[_0xa34a('0x5c'),_0xa34a('0x5d'),_0xa34a('0x5f'),_0xa34a('0x60'),_0xa34a('0x6f'),_0xa34a('0x61'),_0xa34a('0x62'),'defaultFavicon'],'raw':!![]});})[_0xa34a('0x1f')](handleEntityNotFound(_0x464168,null))[_0xa34a('0x1f')](function(_0x230ba4){if(_0x230ba4){var _0x4a7f08=_0x230ba4[_0xa34a('0x5f')]&&fs[_0xa34a('0x64')](path[_0xa34a('0x65')](config['root'],_0x4a4a3f,_[_0xa34a('0x66')](_0x230ba4[_0xa34a('0x5f')])))?path[_0xa34a('0x65')](config[_0xa34a('0x6a')],_0x4a4a3f,_['toLower'](_0x230ba4[_0xa34a('0x5f')])):path['join'](config['root'],_0x4a4a3f,_['toLower']('default_preferred.png'));var _0x284ad9=_0xa34a('0x68')+_[_0xa34a('0x71')]('preferred');if(_0x230ba4[_0x284ad9]||!_0x5e51e7['custom']||!_0x5e51e7[_0xa34a('0x5f')]){_0x4a7f08=path[_0xa34a('0x65')](config[_0xa34a('0x6a')],_0x4a4a3f,_[_0xa34a('0x66')](_0xa34a('0x77')));}if(!fs[_0xa34a('0x64')](_0x4a7f08)){throw new db[(_0xa34a('0x6b'))]['ValidationError'](_[_0xa34a('0x71')](_0xa34a('0x5f'))+_0xa34a('0x78'));}return _0x464168['download'](_0x4a7f08);}})['catch'](handleError(_0x464168,null));};exports[_0xa34a('0x79')]=function(_0x285bc1,_0x1b6a6a,_0x2c0c2a){if(_0x285bc1[_0xa34a('0x5a')]&&_0x285bc1[_0xa34a('0x5a')][_0xa34a('0x5b')]){_0x285bc1[_0xa34a('0x58')][_0xa34a('0x60')]=_0x285bc1[_0xa34a('0x5a')][_0xa34a('0x5b')];}return db[_0xa34a('0x3a')][_0xa34a('0x57')]({'where':{'id':_0x285bc1[_0xa34a('0x56')]['id']}})[_0xa34a('0x1f')](handleEntityNotFound(_0x1b6a6a,null))[_0xa34a('0x1f')](saveUpdates(_0x285bc1[_0xa34a('0x58')],null))['then'](respondWithResult(_0x1b6a6a,null))[_0xa34a('0x28')](handleError(_0x1b6a6a,null));};var utilLicense=require(_0xa34a('0x1a'));exports[_0xa34a('0x7a')]=function(_0xc28100,_0x2ff4a7,_0x379c76){var _0x256867='server/files/images/logos';var _0x1fa6a1={'custom':![]};return utilLicense[_0xa34a('0x6e')]()[_0xa34a('0x1f')](function(_0x47364d){if(_0x47364d){_0x1fa6a1=_0x47364d;}return db[_0xa34a('0x3a')][_0xa34a('0x57')]({'where':{'id':_0xc28100[_0xa34a('0x56')]['id']},'attributes':[_0xa34a('0x5c'),_0xa34a('0x5d'),'preferred',_0xa34a('0x60'),_0xa34a('0x6f'),_0xa34a('0x61'),_0xa34a('0x62'),_0xa34a('0x63')],'raw':!![]});})[_0xa34a('0x1f')](handleEntityNotFound(_0x2ff4a7,null))[_0xa34a('0x1f')](function(_0x3c854d){if(_0x3c854d){var _0xbe197d=_0x3c854d['favicon']&&fs['existsSync'](path[_0xa34a('0x65')](config[_0xa34a('0x6a')],_0x256867,_[_0xa34a('0x66')](_0x3c854d[_0xa34a('0x60')])))?path['join'](config[_0xa34a('0x6a')],_0x256867,_[_0xa34a('0x66')](_0x3c854d[_0xa34a('0x60')])):path[_0xa34a('0x65')](config[_0xa34a('0x6a')],_0x256867,_['toLower'](_0xa34a('0x7b')));var _0x4b3a13=_0xa34a('0x68')+_['upperFirst'](_0xa34a('0x60'));if(_0x3c854d[_0x4b3a13]||!_0x1fa6a1[_0xa34a('0x69')]){_0xbe197d=path[_0xa34a('0x65')](config[_0xa34a('0x6a')],_0x256867,_[_0xa34a('0x66')](_0xa34a('0x7b')));}if(!fs['existsSync'](_0xbe197d)){throw new db[(_0xa34a('0x6b'))][(_0xa34a('0x6c'))](_[_0xa34a('0x71')](_0xa34a('0x60'))+_0xa34a('0x78'));}return _0x2ff4a7[_0xa34a('0x72')](_0xbe197d);}})[_0xa34a('0x28')](handleError(_0x2ff4a7,null));};exports['getDate']=function(_0x47c328,_0x5d1634){var _0xe77593={'offset':moment()['utcOffset']()};_0xe77593[_0xa34a('0x7c')]=moment()[_0xa34a('0x7d')](_0xe77593[_0xa34a('0x2d')])[_0xa34a('0x7e')](_0xa34a('0x7f'));return _0x5d1634['status'](0xc8)[_0xa34a('0x37')](_0xe77593);}; \ No newline at end of file +var _0xab55=['model','fields','attributes','length','hasOwnProperty','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','body','find','addLogo','file','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLoginLogo','defaultFavicon','logo','root','toLower','join','default_logo.svg','default','upperFirst','custom','existsSync','Sequelize','\x20not\x20found','download','getLogoLogin','defaultLogo','defaultPreferred','default_loginLogo.svg','addPreferred','getPreferred','default_preferred.png','ValidationError','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','name','index','map','Setting','fieldName','type','query','keys','intersection'];(function(_0x327d85,_0x2ca2f2){var _0x2d6d69=function(_0x34c4ba){while(--_0x34c4ba){_0x327d85['push'](_0x327d85['shift']());}};_0x2d6d69(++_0x2ca2f2);}(_0xab55,0x139));var _0x5ab5=function(_0x2bf2e6,_0x4fb46d){_0x2bf2e6=_0x2bf2e6-0x0;var _0x391681=_0xab55[_0x2bf2e6];return _0x391681;};'use strict';var emlformat=require(_0x5ab5('0x0'));var rimraf=require(_0x5ab5('0x1'));var zipdir=require(_0x5ab5('0x2'));var jsonpatch=require(_0x5ab5('0x3'));var rp=require('request-promise');var moment=require(_0x5ab5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5ab5('0x5'));var util=require(_0x5ab5('0x6'));var path=require(_0x5ab5('0x7'));var sox=require(_0x5ab5('0x8'));var csv=require(_0x5ab5('0x9'));var ejs=require(_0x5ab5('0xa'));var fs=require('fs');var fs_extra=require(_0x5ab5('0xb'));var _=require(_0x5ab5('0xc'));var squel=require(_0x5ab5('0xd'));var crypto=require(_0x5ab5('0xe'));var jsforce=require(_0x5ab5('0xf'));var deskjs=require(_0x5ab5('0x10'));var toCsv=require(_0x5ab5('0x9'));var querystring=require(_0x5ab5('0x11'));var Papa=require(_0x5ab5('0x12'));var Redis=require(_0x5ab5('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x5ab5('0x14'));var as=require(_0x5ab5('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ab5('0x16'))(_0x5ab5('0x17'));var utils=require(_0x5ab5('0x18'));var config=require(_0x5ab5('0x19'));var licenseUtil=require(_0x5ab5('0x1a'));var db=require(_0x5ab5('0x1b'))['db'];var jayson=require(_0x5ab5('0x1c'));var client=jayson[_0x5ab5('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d5455,_0x2623f4,_0xff0c49,_0x1eb597){return new BPromise(function(_0x4fd7f1,_0x3da8ea){var _0x5f2885=_0x1eb597||client;return _0x5f2885[_0x5ab5('0x1e')](_0x2d5455,_0xff0c49)[_0x5ab5('0x1f')](function(_0xd48f81){logger[_0x5ab5('0x20')](_0x5ab5('0x21'),_0x2623f4,_0x5ab5('0x22'));logger[_0x5ab5('0x23')](_0x5ab5('0x24'),_0x2623f4,_0x5ab5('0x22'),JSON[_0x5ab5('0x25')](_0xd48f81));if(_0xd48f81[_0x5ab5('0x26')]){if(_0xd48f81[_0x5ab5('0x26')][_0x5ab5('0x27')]===0x1f4){logger['error'](_0x5ab5('0x21'),_0x2623f4,_0xd48f81[_0x5ab5('0x26')][_0x5ab5('0x28')]);return _0x3da8ea(_0xd48f81[_0x5ab5('0x26')][_0x5ab5('0x28')]);}logger[_0x5ab5('0x26')]('Setting,\x20%s,\x20%s',_0x2623f4,_0xd48f81[_0x5ab5('0x26')][_0x5ab5('0x28')]);return _0x4fd7f1(_0xd48f81[_0x5ab5('0x26')][_0x5ab5('0x28')]);}else{logger[_0x5ab5('0x20')](_0x5ab5('0x21'),_0x2623f4,_0x5ab5('0x22'));_0x4fd7f1(_0xd48f81[_0x5ab5('0x29')][_0x5ab5('0x28')]);}})[_0x5ab5('0x2a')](function(_0x397348){logger[_0x5ab5('0x26')](_0x5ab5('0x21'),_0x2623f4,_0x397348);_0x3da8ea(_0x397348);});});}function respondWithStatusCode(_0x4ab058,_0x7ba7ce){_0x7ba7ce=_0x7ba7ce||0xcc;return function(_0x3ae1d4){if(_0x3ae1d4){return _0x4ab058[_0x5ab5('0x2b')](_0x7ba7ce);}return _0x4ab058[_0x5ab5('0x2c')](_0x7ba7ce)['end']();};}function respondWithResult(_0x5e7396,_0x53e702){_0x53e702=_0x53e702||0xc8;return function(_0x3565d7){if(_0x3565d7){return _0x5e7396[_0x5ab5('0x2c')](_0x53e702)[_0x5ab5('0x2d')](_0x3565d7);}};}function respondWithFilteredResult(_0x5edbd3,_0x239bce){return function(_0x2e9e0b){if(_0x2e9e0b){var _0x1a0dd2=typeof _0x239bce[_0x5ab5('0x2e')]===_0x5ab5('0x2f')&&typeof _0x239bce['limit']==='undefined';var _0x3a1a37=_0x2e9e0b[_0x5ab5('0x30')];var _0x4a0279=_0x1a0dd2?0x0:_0x239bce[_0x5ab5('0x2e')];var _0x57ee88=_0x1a0dd2?_0x2e9e0b[_0x5ab5('0x30')]:_0x239bce[_0x5ab5('0x2e')]+_0x239bce[_0x5ab5('0x31')];var _0x3ae77c;if(_0x57ee88>=_0x3a1a37){_0x57ee88=_0x3a1a37;_0x3ae77c=0xc8;}else{_0x3ae77c=0xce;}_0x5edbd3['status'](_0x3ae77c);return _0x5edbd3[_0x5ab5('0x32')](_0x5ab5('0x33'),_0x4a0279+'-'+_0x57ee88+'/'+_0x3a1a37)[_0x5ab5('0x2d')](_0x2e9e0b);}return null;};}function patchUpdates(_0x1fc33e){return function(_0x156cf8){try{jsonpatch[_0x5ab5('0x34')](_0x156cf8,_0x1fc33e,!![]);}catch(_0x30aad0){return BPromise[_0x5ab5('0x35')](_0x30aad0);}return _0x156cf8['save']();};}function saveUpdates(_0x42619e,_0x1bc6d3){return function(_0x2b0fa3){if(_0x2b0fa3){return _0x2b0fa3[_0x5ab5('0x36')](_0x42619e)[_0x5ab5('0x1f')](function(_0x1c33c7){return _0x1c33c7;});}return null;};}function removeEntity(_0x21c95c,_0x1c6865){return function(_0x34d482){if(_0x34d482){return _0x34d482[_0x5ab5('0x37')]()['then'](function(){_0x21c95c[_0x5ab5('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a6d91,_0x34b18e){return function(_0x2c7bc7){if(!_0x2c7bc7){_0x1a6d91[_0x5ab5('0x2b')](0x194);}return _0x2c7bc7;};}function handleError(_0x5b8da2,_0x24c148){_0x24c148=_0x24c148||0x1f4;return function(_0x891905){logger[_0x5ab5('0x26')](_0x891905['stack']);if(_0x891905[_0x5ab5('0x38')]){delete _0x891905['name'];}_0x5b8da2['status'](_0x24c148)['send'](_0x891905);};}exports[_0x5ab5('0x39')]=function(_0x21c935,_0x29c2d2){var _0x55f3d4={},_0x313741={},_0x61347c={'count':0x0,'rows':[]};var _0x3f01c7=_[_0x5ab5('0x3a')](db[_0x5ab5('0x3b')]['rawAttributes'],function(_0x48d89a){return{'name':_0x48d89a[_0x5ab5('0x3c')],'type':_0x48d89a[_0x5ab5('0x3d')]['key']};});_0x313741['model']=_[_0x5ab5('0x3a')](_0x3f01c7,_0x5ab5('0x38'));_0x313741[_0x5ab5('0x3e')]=_[_0x5ab5('0x3f')](_0x21c935[_0x5ab5('0x3e')]);_0x313741['filters']=_[_0x5ab5('0x40')](_0x313741[_0x5ab5('0x41')],_0x313741[_0x5ab5('0x3e')]);_0x55f3d4['attributes']=_['intersection'](_0x313741[_0x5ab5('0x41')],qs[_0x5ab5('0x42')](_0x21c935[_0x5ab5('0x3e')][_0x5ab5('0x42')]));_0x55f3d4[_0x5ab5('0x43')]=_0x55f3d4[_0x5ab5('0x43')][_0x5ab5('0x44')]?_0x55f3d4[_0x5ab5('0x43')]:_0x313741[_0x5ab5('0x41')];if(!_0x21c935[_0x5ab5('0x3e')][_0x5ab5('0x45')]('nolimit')){_0x55f3d4['limit']=qs[_0x5ab5('0x31')](_0x21c935[_0x5ab5('0x3e')][_0x5ab5('0x31')]);_0x55f3d4[_0x5ab5('0x2e')]=qs['offset'](_0x21c935[_0x5ab5('0x3e')]['offset']);}_0x55f3d4['order']=qs[_0x5ab5('0x46')](_0x21c935[_0x5ab5('0x3e')][_0x5ab5('0x46')]);_0x55f3d4['where']=qs[_0x5ab5('0x47')](_[_0x5ab5('0x48')](_0x21c935[_0x5ab5('0x3e')],_0x313741['filters']),_0x3f01c7);if(_0x21c935['query'][_0x5ab5('0x49')]){_0x55f3d4[_0x5ab5('0x4a')]=_[_0x5ab5('0x4b')](_0x55f3d4['where'],{'$or':_['map'](_0x3f01c7,function(_0x3a133b){if(_0x3a133b[_0x5ab5('0x3d')]!==_0x5ab5('0x4c')){var _0x1b63e0={};_0x1b63e0[_0x3a133b[_0x5ab5('0x38')]]={'$like':'%'+_0x21c935[_0x5ab5('0x3e')][_0x5ab5('0x49')]+'%'};return _0x1b63e0;}})});}_0x55f3d4=_['merge']({},_0x55f3d4,_0x21c935[_0x5ab5('0x4d')]);var _0x1571e5={'where':_0x55f3d4[_0x5ab5('0x4a')]};return db[_0x5ab5('0x3b')]['count'](_0x1571e5)[_0x5ab5('0x1f')](function(_0x34b6d5){_0x61347c['count']=_0x34b6d5;if(_0x21c935[_0x5ab5('0x3e')][_0x5ab5('0x4e')]){_0x55f3d4[_0x5ab5('0x4f')]=[{'all':!![]}];}return db[_0x5ab5('0x3b')]['findAll'](_0x55f3d4);})[_0x5ab5('0x1f')](function(_0x357861){_0x61347c[_0x5ab5('0x50')]=_0x357861;return _0x61347c;})[_0x5ab5('0x1f')](respondWithFilteredResult(_0x29c2d2,_0x55f3d4))[_0x5ab5('0x2a')](handleError(_0x29c2d2,null));};exports[_0x5ab5('0x51')]=function(_0x41934d,_0x5d8b58){var _0x18a9ea={'raw':![],'where':{'id':_0x41934d[_0x5ab5('0x52')]['id']}},_0x41b5aa={};_0x41b5aa['model']=_['keys'](db[_0x5ab5('0x3b')][_0x5ab5('0x53')]);_0x41b5aa[_0x5ab5('0x3e')]=_['keys'](_0x41934d['query']);_0x41b5aa[_0x5ab5('0x47')]=_['intersection'](_0x41b5aa[_0x5ab5('0x41')],_0x41b5aa['query']);_0x18a9ea['attributes']=_[_0x5ab5('0x40')](_0x41b5aa[_0x5ab5('0x41')],qs[_0x5ab5('0x42')](_0x41934d[_0x5ab5('0x3e')][_0x5ab5('0x42')]));_0x18a9ea['attributes']=_0x18a9ea['attributes'][_0x5ab5('0x44')]?_0x18a9ea[_0x5ab5('0x43')]:_0x41b5aa[_0x5ab5('0x41')];if(_0x41934d[_0x5ab5('0x3e')][_0x5ab5('0x4e')]){_0x18a9ea[_0x5ab5('0x4f')]=[{'all':!![]}];}_0x18a9ea=_[_0x5ab5('0x4b')]({},_0x18a9ea,_0x41934d['options']);return db[_0x5ab5('0x3b')]['find'](_0x18a9ea)['then'](handleEntityNotFound(_0x5d8b58,null))[_0x5ab5('0x1f')](respondWithResult(_0x5d8b58,null))['catch'](handleError(_0x5d8b58,null));};exports[_0x5ab5('0x36')]=function(_0x422da8,_0x58bdc1){if(_0x422da8[_0x5ab5('0x54')]['id']){delete _0x422da8[_0x5ab5('0x54')]['id'];}return db['Setting'][_0x5ab5('0x55')]({'where':{'id':_0x422da8[_0x5ab5('0x52')]['id']}})[_0x5ab5('0x1f')](handleEntityNotFound(_0x58bdc1,null))[_0x5ab5('0x1f')](saveUpdates(_0x422da8[_0x5ab5('0x54')],null))[_0x5ab5('0x1f')](respondWithResult(_0x58bdc1,null))[_0x5ab5('0x2a')](handleError(_0x58bdc1,null));};exports[_0x5ab5('0x56')]=function(_0x5bc695,_0x56f4ab,_0x4a30b0){if(_0x5bc695[_0x5ab5('0x57')]&&_0x5bc695['file'][_0x5ab5('0x58')]){_0x5bc695[_0x5ab5('0x54')]['logo']=_0x5bc695[_0x5ab5('0x57')][_0x5ab5('0x58')];}return db['Setting']['find']({'where':{'id':_0x5bc695[_0x5ab5('0x52')]['id']}})['then'](handleEntityNotFound(_0x56f4ab,null))['then'](saveUpdates(_0x5bc695[_0x5ab5('0x54')],null))[_0x5ab5('0x1f')](respondWithResult(_0x56f4ab,null))[_0x5ab5('0x2a')](handleError(_0x56f4ab,null));};exports[_0x5ab5('0x59')]=function(_0x1bfcbd,_0x32429e,_0x426029){if(_0x1bfcbd[_0x5ab5('0x57')]&&_0x1bfcbd['file'][_0x5ab5('0x58')]){_0x1bfcbd[_0x5ab5('0x54')][_0x5ab5('0x5a')]=_0x1bfcbd[_0x5ab5('0x57')][_0x5ab5('0x58')];}return db[_0x5ab5('0x3b')][_0x5ab5('0x55')]({'where':{'id':_0x1bfcbd['params']['id']}})['then'](handleEntityNotFound(_0x32429e,null))[_0x5ab5('0x1f')](saveUpdates(_0x1bfcbd['body'],null))['then'](respondWithResult(_0x32429e,null))['catch'](handleError(_0x32429e,null));};var utilLicense=require('../../config/license/util');exports[_0x5ab5('0x5b')]=function(_0x458b3d,_0x40074d,_0x5911b9){var _0x2e6baf=_0x5ab5('0x5c');var _0x2d7022={'custom':![]};return utilLicense[_0x5ab5('0x5d')]()[_0x5ab5('0x1f')](function(_0x15790b){if(_0x15790b){_0x2d7022=_0x15790b;}return db[_0x5ab5('0x3b')][_0x5ab5('0x55')]({'where':{'id':_0x458b3d[_0x5ab5('0x52')]['id']},'attributes':['logo',_0x5ab5('0x5a'),_0x5ab5('0x5e'),_0x5ab5('0x5f'),'defaultLogo',_0x5ab5('0x60'),'defaultPreferred',_0x5ab5('0x61')],'raw':!![]});})['then'](handleEntityNotFound(_0x40074d,null))[_0x5ab5('0x1f')](function(_0x2c703e){if(_0x2c703e){var _0x8b3d73=_0x2c703e[_0x5ab5('0x62')]&&fs['existsSync'](path['join'](config[_0x5ab5('0x63')],_0x2e6baf,_[_0x5ab5('0x64')](_0x2c703e['logo'])))?path[_0x5ab5('0x65')](config[_0x5ab5('0x63')],_0x2e6baf,_[_0x5ab5('0x64')](_0x2c703e['logo'])):path[_0x5ab5('0x65')](config[_0x5ab5('0x63')],_0x2e6baf,_['toLower'](_0x5ab5('0x66')));var _0x1cb7f7=_0x5ab5('0x67')+_[_0x5ab5('0x68')](_0x5ab5('0x62'));if(_0x2c703e[_0x1cb7f7]||!_0x2d7022[_0x5ab5('0x69')]){_0x8b3d73=path[_0x5ab5('0x65')](config[_0x5ab5('0x63')],_0x2e6baf,_[_0x5ab5('0x64')](_0x5ab5('0x66')));}if(!fs[_0x5ab5('0x6a')](_0x8b3d73)){throw new db[(_0x5ab5('0x6b'))]['ValidationError'](_[_0x5ab5('0x68')]('logo')+_0x5ab5('0x6c'));}return _0x40074d[_0x5ab5('0x6d')](_0x8b3d73);}})[_0x5ab5('0x2a')](handleError(_0x40074d,null));};var utilLicense=require(_0x5ab5('0x1a'));exports[_0x5ab5('0x6e')]=function(_0x44baad,_0x1fd57b,_0x21787a){var _0x200bfd=_0x5ab5('0x5c');var _0xce1f4e={'custom':![]};return utilLicense[_0x5ab5('0x5d')]()[_0x5ab5('0x1f')](function(_0x25e634){if(_0x25e634){_0xce1f4e=_0x25e634;}return db[_0x5ab5('0x3b')][_0x5ab5('0x55')]({'where':{'id':_0x44baad[_0x5ab5('0x52')]['id']},'attributes':[_0x5ab5('0x62'),_0x5ab5('0x5a'),'preferred',_0x5ab5('0x5f'),_0x5ab5('0x6f'),_0x5ab5('0x60'),_0x5ab5('0x70'),_0x5ab5('0x61')],'raw':!![]});})[_0x5ab5('0x1f')](handleEntityNotFound(_0x1fd57b,null))['then'](function(_0x45b3ae){if(_0x45b3ae){var _0x20e219=_0x45b3ae[_0x5ab5('0x5a')]&&fs['existsSync'](path[_0x5ab5('0x65')](config[_0x5ab5('0x63')],_0x200bfd,_[_0x5ab5('0x64')](_0x45b3ae[_0x5ab5('0x5a')])))?path[_0x5ab5('0x65')](config[_0x5ab5('0x63')],_0x200bfd,_['toLower'](_0x45b3ae[_0x5ab5('0x5a')])):path['join'](config[_0x5ab5('0x63')],_0x200bfd,_[_0x5ab5('0x64')]('default_loginLogo.svg'));var _0x22f987='default'+_[_0x5ab5('0x68')](_0x5ab5('0x5a'));if(_0x45b3ae[_0x22f987]||!_0xce1f4e[_0x5ab5('0x69')]){_0x20e219=path['join'](config[_0x5ab5('0x63')],_0x200bfd,_[_0x5ab5('0x64')](_0x5ab5('0x71')));}if(!fs[_0x5ab5('0x6a')](_0x20e219)){throw new db['Sequelize']['ValidationError'](_[_0x5ab5('0x68')]('loginLogo')+_0x5ab5('0x6c'));}return _0x1fd57b[_0x5ab5('0x6d')](_0x20e219);}})[_0x5ab5('0x2a')](handleError(_0x1fd57b,null));};exports['gdpr']=function(_0x1b6f63,_0x528252){return db[_0x5ab5('0x3b')]['find']({'where':{'id':_0x1b6f63[_0x5ab5('0x52')]['id']},'attributes':['securePassword']})['then'](respondWithResult(_0x528252,null))[_0x5ab5('0x2a')](handleError(_0x528252,null));};exports[_0x5ab5('0x72')]=function(_0x4155f4,_0x347343,_0x5b0cc4){if(_0x4155f4[_0x5ab5('0x57')]&&_0x4155f4['file'][_0x5ab5('0x58')]){_0x4155f4[_0x5ab5('0x54')]['preferred']=_0x4155f4[_0x5ab5('0x57')]['filename'];}return db[_0x5ab5('0x3b')]['find']({'where':{'id':_0x4155f4[_0x5ab5('0x52')]['id']}})['then'](handleEntityNotFound(_0x347343,null))[_0x5ab5('0x1f')](saveUpdates(_0x4155f4[_0x5ab5('0x54')],null))['then'](respondWithResult(_0x347343,null))['catch'](handleError(_0x347343,null));};var utilLicense=require(_0x5ab5('0x1a'));exports[_0x5ab5('0x73')]=function(_0x46ccdb,_0x19902d,_0x2489cf){var _0x514e36='server/files/images/logos';var _0x4081bf={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x10333f){if(_0x10333f){_0x4081bf=_0x10333f;}return db[_0x5ab5('0x3b')][_0x5ab5('0x55')]({'where':{'id':_0x46ccdb[_0x5ab5('0x52')]['id']},'attributes':[_0x5ab5('0x62'),'loginLogo',_0x5ab5('0x5e'),'favicon',_0x5ab5('0x6f'),_0x5ab5('0x60'),'defaultPreferred',_0x5ab5('0x61')],'raw':!![]});})[_0x5ab5('0x1f')](handleEntityNotFound(_0x19902d,null))['then'](function(_0x2e8c77){if(_0x2e8c77){var _0xb8eceb=_0x2e8c77['preferred']&&fs[_0x5ab5('0x6a')](path[_0x5ab5('0x65')](config[_0x5ab5('0x63')],_0x514e36,_[_0x5ab5('0x64')](_0x2e8c77[_0x5ab5('0x5e')])))?path[_0x5ab5('0x65')](config[_0x5ab5('0x63')],_0x514e36,_[_0x5ab5('0x64')](_0x2e8c77[_0x5ab5('0x5e')])):path[_0x5ab5('0x65')](config[_0x5ab5('0x63')],_0x514e36,_[_0x5ab5('0x64')](_0x5ab5('0x74')));var _0x595d15=_0x5ab5('0x67')+_[_0x5ab5('0x68')](_0x5ab5('0x5e'));if(_0x2e8c77[_0x595d15]||!_0x4081bf[_0x5ab5('0x69')]||!_0x4081bf[_0x5ab5('0x5e')]){_0xb8eceb=path[_0x5ab5('0x65')](config[_0x5ab5('0x63')],_0x514e36,_[_0x5ab5('0x64')]('default_preferred.png'));}if(!fs[_0x5ab5('0x6a')](_0xb8eceb)){throw new db['Sequelize'][(_0x5ab5('0x75'))](_[_0x5ab5('0x68')](_0x5ab5('0x5e'))+_0x5ab5('0x6c'));}return _0x19902d[_0x5ab5('0x6d')](_0xb8eceb);}})['catch'](handleError(_0x19902d,null));};exports['addFavicon']=function(_0x365953,_0x46000c,_0x3b6f50){if(_0x365953[_0x5ab5('0x57')]&&_0x365953['file'][_0x5ab5('0x58')]){_0x365953[_0x5ab5('0x54')][_0x5ab5('0x5f')]=_0x365953[_0x5ab5('0x57')][_0x5ab5('0x58')];}return db[_0x5ab5('0x3b')][_0x5ab5('0x55')]({'where':{'id':_0x365953[_0x5ab5('0x52')]['id']}})[_0x5ab5('0x1f')](handleEntityNotFound(_0x46000c,null))[_0x5ab5('0x1f')](saveUpdates(_0x365953[_0x5ab5('0x54')],null))['then'](respondWithResult(_0x46000c,null))['catch'](handleError(_0x46000c,null));};var utilLicense=require(_0x5ab5('0x1a'));exports[_0x5ab5('0x76')]=function(_0x1653dd,_0x86045,_0x426df6){var _0x2e06d4='server/files/images/logos';var _0x41a0e9={'custom':![]};return utilLicense[_0x5ab5('0x5d')]()['then'](function(_0x2f0ff4){if(_0x2f0ff4){_0x41a0e9=_0x2f0ff4;}return db['Setting'][_0x5ab5('0x55')]({'where':{'id':_0x1653dd[_0x5ab5('0x52')]['id']},'attributes':[_0x5ab5('0x62'),_0x5ab5('0x5a'),_0x5ab5('0x5e'),_0x5ab5('0x5f'),'defaultLogo',_0x5ab5('0x60'),'defaultPreferred',_0x5ab5('0x61')],'raw':!![]});})[_0x5ab5('0x1f')](handleEntityNotFound(_0x86045,null))[_0x5ab5('0x1f')](function(_0x146b6b){if(_0x146b6b){var _0x5e1e08=_0x146b6b[_0x5ab5('0x5f')]&&fs['existsSync'](path['join'](config[_0x5ab5('0x63')],_0x2e06d4,_['toLower'](_0x146b6b[_0x5ab5('0x5f')])))?path[_0x5ab5('0x65')](config[_0x5ab5('0x63')],_0x2e06d4,_[_0x5ab5('0x64')](_0x146b6b[_0x5ab5('0x5f')])):path[_0x5ab5('0x65')](config['root'],_0x2e06d4,_[_0x5ab5('0x64')]('default_favicon.ico'));var _0x45d912=_0x5ab5('0x67')+_['upperFirst']('favicon');if(_0x146b6b[_0x45d912]||!_0x41a0e9[_0x5ab5('0x69')]){_0x5e1e08=path[_0x5ab5('0x65')](config[_0x5ab5('0x63')],_0x2e06d4,_[_0x5ab5('0x64')](_0x5ab5('0x77')));}if(!fs[_0x5ab5('0x6a')](_0x5e1e08)){throw new db[(_0x5ab5('0x6b'))][(_0x5ab5('0x75'))](_[_0x5ab5('0x68')](_0x5ab5('0x5f'))+_0x5ab5('0x6c'));}return _0x86045[_0x5ab5('0x6d')](_0x5e1e08);}})[_0x5ab5('0x2a')](handleError(_0x86045,null));};exports[_0x5ab5('0x78')]=function(_0x21bcab,_0x20a0b3){var _0x49c401={'offset':moment()[_0x5ab5('0x79')]()};_0x49c401[_0x5ab5('0x7a')]=moment()[_0x5ab5('0x79')](_0x49c401['offset'])[_0x5ab5('0x7b')](_0x5ab5('0x7c'));return _0x20a0b3['status'](0xc8)[_0x5ab5('0x7d')](_0x49c401);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index b235767..7ad7071 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x33b730,_0x3f06bb){var _0x1e7ff3=function(_0x5e6abf){while(--_0x5e6abf){_0x33b730['push'](_0x33b730['shift']());}};_0x1e7ff3(++_0x3f06bb);}(_0xedd9,0xfc));var _0x9edd=function(_0xd58823,_0x15c483){_0xd58823=_0xd58823-0x0;var _0x249c0a=_0xedd9[_0xd58823];return _0x249c0a;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x11edf0,_0x570ba7){var _0x383775=function(_0xed6127){while(--_0xed6127){_0x11edf0['push'](_0x11edf0['shift']());}};_0x383775(++_0x570ba7);}(_0xedd9,0xfc));var _0x9edd=function(_0x113a1a,_0x22a2c9){_0x113a1a=_0x113a1a-0x0;var _0x14d16e=_0xedd9[_0x113a1a];return _0x14d16e;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index d721e0b..cf73883 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 _0xf4c9=['ioredis','../../mysqldb','../../config/logger','rpc','client','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','ShowSetting','find','options','raw','attributes','include','map','model','then','lodash','util','moment'];(function(_0x51aa44,_0x5c8182){var _0x3fbd16=function(_0x495a64){while(--_0x495a64){_0x51aa44['push'](_0x51aa44['shift']());}};_0x3fbd16(++_0x5c8182);}(_0xf4c9,0x84));var _0x9f4c=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0xf4c9[_0x42bdad];return _0x122626;};'use strict';var _=require(_0x9f4c('0x0'));var util=require(_0x9f4c('0x1'));var moment=require(_0x9f4c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9f4c('0x3'));var db=require(_0x9f4c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f4c('0x5'))(_0x9f4c('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9f4c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x254f8a,_0x4b76a2,_0x1a9ea0){return new BPromise(function(_0x4c48de,_0x57b5fa){return client[_0x9f4c('0x8')](_0x254f8a,_0x1a9ea0)['then'](function(_0xac4ba9){logger[_0x9f4c('0x9')](_0x9f4c('0xa'),_0x4b76a2,_0x9f4c('0xb'));logger[_0x9f4c('0xc')](_0x9f4c('0xd'),_0x4b76a2,'request\x20sent',JSON[_0x9f4c('0xe')](_0xac4ba9));if(_0xac4ba9[_0x9f4c('0xf')]){if(_0xac4ba9[_0x9f4c('0xf')]['code']===0x1f4){logger[_0x9f4c('0xf')](_0x9f4c('0xa'),_0x4b76a2,_0xac4ba9[_0x9f4c('0xf')][_0x9f4c('0x10')]);return _0x57b5fa(_0xac4ba9[_0x9f4c('0xf')]['message']);}logger[_0x9f4c('0xf')]('Setting,\x20%s,\x20%s',_0x4b76a2,_0xac4ba9[_0x9f4c('0xf')]['message']);return _0x4c48de(_0xac4ba9['error'][_0x9f4c('0x10')]);}else{logger[_0x9f4c('0x9')](_0x9f4c('0xa'),_0x4b76a2,_0x9f4c('0xb'));_0x4c48de(_0xac4ba9['result'][_0x9f4c('0x10')]);}})[_0x9f4c('0x11')](function(_0x5b6bc3){logger[_0x9f4c('0xf')]('Setting,\x20%s,\x20%s',_0x4b76a2,_0x5b6bc3);_0x57b5fa(_0x5b6bc3);});});}exports[_0x9f4c('0x12')]=function(_0x3ae49b){var _0x5248f8=this;return new Promise(function(_0x2ec82d,_0x252d7d){return db['Setting'][_0x9f4c('0x13')]({'raw':_0x3ae49b[_0x9f4c('0x14')]?_0x3ae49b[_0x9f4c('0x14')][_0x9f4c('0x15')]===undefined?!![]:![]:!![],'where':_0x3ae49b['options']?_0x3ae49b[_0x9f4c('0x14')]['where']||null:null,'attributes':_0x3ae49b['options']?_0x3ae49b[_0x9f4c('0x14')][_0x9f4c('0x16')]||null:null,'include':_0x3ae49b[_0x9f4c('0x14')]?_0x3ae49b[_0x9f4c('0x14')][_0x9f4c('0x17')]?_[_0x9f4c('0x18')](_0x3ae49b[_0x9f4c('0x14')][_0x9f4c('0x17')],function(_0x454708){return{'model':db[_0x454708['model']],'as':_0x454708['as'],'attributes':_0x454708[_0x9f4c('0x16')],'include':_0x454708[_0x9f4c('0x17')]?_[_0x9f4c('0x18')](_0x454708[_0x9f4c('0x17')],function(_0x4e5bc3){return{'model':db[_0x4e5bc3['model']],'as':_0x4e5bc3['as'],'attributes':_0x4e5bc3['attributes'],'include':_0x4e5bc3[_0x9f4c('0x17')]?_[_0x9f4c('0x18')](_0x4e5bc3[_0x9f4c('0x17')],function(_0x222324){return{'model':db[_0x222324[_0x9f4c('0x19')]],'as':_0x222324['as'],'attributes':_0x222324[_0x9f4c('0x16')]};}):[]};}):[]};}):[]:[]})[_0x9f4c('0x1a')](function(_0x39247c){logger['info']('ShowSetting',_0x3ae49b);logger[_0x9f4c('0xc')](_0x9f4c('0x12'),_0x3ae49b,JSON['stringify'](_0x39247c));_0x2ec82d(_0x39247c);})[_0x9f4c('0x11')](function(_0x2b70cc){logger[_0x9f4c('0xf')](_0x9f4c('0x12'),_0x2b70cc[_0x9f4c('0x10')],_0x3ae49b);_0x252d7d(_0x5248f8[_0x9f4c('0xf')](0x1f4,_0x2b70cc['message']));});});}; \ No newline at end of file +var _0x797c=['ShowSetting','Setting','find','options','raw','where','attributes','map','include','model','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','info','Setting,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x24ac6a,_0x27a7a4){var _0x39f483=function(_0x47c872){while(--_0x47c872){_0x24ac6a['push'](_0x24ac6a['shift']());}};_0x39f483(++_0x27a7a4);}(_0x797c,0x1cb));var _0xc797=function(_0x241424,_0x25eb5d){_0x241424=_0x241424-0x0;var _0x3da798=_0x797c[_0x241424];return _0x3da798;};'use strict';var _=require(_0xc797('0x0'));var util=require(_0xc797('0x1'));var moment=require(_0xc797('0x2'));var BPromise=require(_0xc797('0x3'));var rs=require(_0xc797('0x4'));var fs=require('fs');var Redis=require(_0xc797('0x5'));var db=require(_0xc797('0x6'))['db'];var utils=require(_0xc797('0x7'));var logger=require(_0xc797('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc797('0x9'));var client=jayson[_0xc797('0xa')][_0xc797('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbb0d88,_0x18ef01,_0x5bc448){return new BPromise(function(_0x2f5d4c,_0x4daded){return client['request'](_0xbb0d88,_0x5bc448)['then'](function(_0x316027){logger[_0xc797('0xc')](_0xc797('0xd'),_0x18ef01,'request\x20sent');logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x18ef01,_0xc797('0xe'),JSON[_0xc797('0xf')](_0x316027));if(_0x316027[_0xc797('0x10')]){if(_0x316027[_0xc797('0x10')][_0xc797('0x11')]===0x1f4){logger[_0xc797('0x10')](_0xc797('0xd'),_0x18ef01,_0x316027['error']['message']);return _0x4daded(_0x316027[_0xc797('0x10')][_0xc797('0x12')]);}logger[_0xc797('0x10')](_0xc797('0xd'),_0x18ef01,_0x316027[_0xc797('0x10')][_0xc797('0x12')]);return _0x2f5d4c(_0x316027[_0xc797('0x10')][_0xc797('0x12')]);}else{logger[_0xc797('0xc')](_0xc797('0xd'),_0x18ef01,_0xc797('0xe'));_0x2f5d4c(_0x316027[_0xc797('0x13')][_0xc797('0x12')]);}})[_0xc797('0x14')](function(_0x21c64e){logger[_0xc797('0x10')](_0xc797('0xd'),_0x18ef01,_0x21c64e);_0x4daded(_0x21c64e);});});}exports[_0xc797('0x15')]=function(_0x2ed645){var _0x3ec9ef=this;return new Promise(function(_0x264dc4,_0x5a1e75){return db[_0xc797('0x16')][_0xc797('0x17')]({'raw':_0x2ed645[_0xc797('0x18')]?_0x2ed645[_0xc797('0x18')][_0xc797('0x19')]===undefined?!![]:![]:!![],'where':_0x2ed645['options']?_0x2ed645['options'][_0xc797('0x1a')]||null:null,'attributes':_0x2ed645[_0xc797('0x18')]?_0x2ed645[_0xc797('0x18')][_0xc797('0x1b')]||null:null,'include':_0x2ed645[_0xc797('0x18')]?_0x2ed645['options']['include']?_[_0xc797('0x1c')](_0x2ed645[_0xc797('0x18')][_0xc797('0x1d')],function(_0x592631){return{'model':db[_0x592631[_0xc797('0x1e')]],'as':_0x592631['as'],'attributes':_0x592631[_0xc797('0x1b')],'include':_0x592631[_0xc797('0x1d')]?_[_0xc797('0x1c')](_0x592631['include'],function(_0x6f92e4){return{'model':db[_0x6f92e4[_0xc797('0x1e')]],'as':_0x6f92e4['as'],'attributes':_0x6f92e4[_0xc797('0x1b')],'include':_0x6f92e4[_0xc797('0x1d')]?_[_0xc797('0x1c')](_0x6f92e4[_0xc797('0x1d')],function(_0x4ab588){return{'model':db[_0x4ab588['model']],'as':_0x4ab588['as'],'attributes':_0x4ab588[_0xc797('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2294e9){logger[_0xc797('0xc')](_0xc797('0x15'),_0x2ed645);logger[_0xc797('0x1f')](_0xc797('0x15'),_0x2ed645,JSON['stringify'](_0x2294e9));_0x264dc4(_0x2294e9);})[_0xc797('0x14')](function(_0x2ad7ea){logger[_0xc797('0x10')](_0xc797('0x15'),_0x2ad7ea['message'],_0x2ed645);_0x5a1e75(_0x3ec9ef['error'](0x1f4,_0x2ad7ea[_0xc797('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 90b7efb..9f43309 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 _0x7217=['/:id/send','status','put','update','delete','removeDispositions','removeAnswers','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','create','post','/:id/notify','notify','addApplications'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x7217,0x19e));var _0x7721=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x7217[_0x2763f2];return _0x3ef471;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getApplications']);router[_0x7721('0x8')](_0x7721('0x14'),auth['isAuthenticated'](),controller[_0x7721('0x15')]);router[_0x7721('0x8')](_0x7721('0x16'),controller[_0x7721('0x17')]);router['get'](_0x7721('0x18'),auth[_0x7721('0x9')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x1a')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller['addDisposition']);router[_0x7721('0x1a')]('/:id/canned_answers',auth[_0x7721('0x9')](),controller['addAnswer']);router[_0x7721('0x1a')](_0x7721('0x1b'),controller[_0x7721('0x1c')]);router[_0x7721('0x1a')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1d')]);router[_0x7721('0x1a')](_0x7721('0x1e'),auth[_0x7721('0x9')](),controller['send']);router[_0x7721('0x1a')](_0x7721('0x16'),controller[_0x7721('0x1f')]);router[_0x7721('0x1a')]('/:id/users',auth[_0x7721('0x9')](),controller['addAgents']);router[_0x7721('0x20')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0x21')]);router[_0x7721('0x22')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller['destroy']);router[_0x7721('0x22')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller[_0x7721('0x23')]);router[_0x7721('0x22')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x24')]);router[_0x7721('0x22')]('/:id/users',auth[_0x7721('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x5e804b,_0x242732){var _0x116e07=function(_0x550e22){while(--_0x550e22){_0x5e804b['push'](_0x5e804b['shift']());}};_0x116e07(++_0x242732);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 33ec3af..de2a822 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 _0x0535=['infobip','intelepeer','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','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','exports','STRING','generate','twilio','skebby','connectel','clicksend','plivo','clickatell','bandwidth','csc'];(function(_0x13992d,_0x3029ea){var _0x3d15bf=function(_0x3444f7){while(--_0x3444f7){_0x13992d['push'](_0x13992d['shift']());}};_0x3d15bf(++_0x3029ea);}(_0x0535,0xfd));var _0x5053=function(_0x57207d,_0x531f07){_0x57207d=_0x57207d-0x0;var _0x14b4c6=_0x0535[_0x57207d];return _0x14b4c6;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x5053('0x0')]={'name':{'type':Sequelize[_0x5053('0x1')],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x5053('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0x5053('0x1')],'defaultValue':function(){return rs[_0x5053('0x2')]();}},'phone':{'type':Sequelize[_0x5053('0x1')]},'type':{'type':Sequelize['ENUM'](_0x5053('0x3'),_0x5053('0x4'),_0x5053('0x5'),_0x5053('0x6'),_0x5053('0x7'),_0x5053('0x8'),_0x5053('0x9'),_0x5053('0xa'),_0x5053('0xb'),_0x5053('0xc'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x5053('0x1')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x5053('0x1')]},'password':{'type':Sequelize[_0x5053('0x1')]},'apiKey':{'type':Sequelize[_0x5053('0x1')]},'applicationId':{'type':Sequelize[_0x5053('0x1')]},'accountId':{'type':Sequelize[_0x5053('0x1')]},'senderString':{'type':Sequelize[_0x5053('0x1')]},'deliveryReport':{'type':Sequelize[_0x5053('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0x5053('0x1')]},'notificationTemplate':{'type':Sequelize[_0x5053('0xe')],'defaultValue':function(){return _0x5053('0xf');}},'notificationSound':{'type':Sequelize[_0x5053('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5053('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5053('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5053('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5053('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5053('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x5053('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5053('0x10')],'comment':_0x5053('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x5053('0xd')],'defaultValue':![],'comment':_0x5053('0x12'),'set':function(_0x2b934f){if(!_0x2b934f)this['setDataValue'](_0x5053('0x13'),null);this[_0x5053('0x14')](_0x5053('0x15'),_0x2b934f);}}}; \ No newline at end of file +var _0x362b=['mandatoryDispositionPauseId','sequelize','randomstring','STRING','name','ENUM','twilio','skebby','clicksend','plivo','csc','intelepeer','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'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x362b,0x157));var _0xb362=function(_0x411f0f,_0x14b24b){_0x411f0f=_0x411f0f-0x0;var _0x58119a=_0x362b[_0x411f0f];return _0x58119a;};'use strict';var Sequelize=require(_0xb362('0x0'));var rs=require(_0xb362('0x1'));module['exports']={'name':{'type':Sequelize[_0xb362('0x2')],'unique':_0xb362('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xb362('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xb362('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xb362('0x2')]},'type':{'type':Sequelize[_0xb362('0x4')](_0xb362('0x5'),_0xb362('0x6'),'connectel',_0xb362('0x7'),_0xb362('0x8'),'clickatell','bandwidth',_0xb362('0x9'),'infobip',_0xb362('0xa'))},'accountSid':{'type':Sequelize[_0xb362('0x2')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xb362('0x2')]},'smsMethod':{'type':Sequelize[_0xb362('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0xb362('0x2')]},'password':{'type':Sequelize[_0xb362('0x2')]},'apiKey':{'type':Sequelize[_0xb362('0x2')]},'applicationId':{'type':Sequelize[_0xb362('0x2')]},'accountId':{'type':Sequelize[_0xb362('0x2')]},'senderString':{'type':Sequelize[_0xb362('0x2')]},'deliveryReport':{'type':Sequelize[_0xb362('0xb')],'defaultValue':![]},'description':{'type':Sequelize[_0xb362('0x2')]},'notificationTemplate':{'type':Sequelize[_0xb362('0xc')],'defaultValue':function(){return _0xb362('0xd');}},'notificationSound':{'type':Sequelize[_0xb362('0xb')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb362('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb362('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb362('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb362('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xb362('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb362('0xe')],'comment':_0xb362('0xf')},'mandatoryDisposition':{'type':Sequelize[_0xb362('0xb')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2d668b){if(!_0x2d668b)this[_0xb362('0x10')](_0xb362('0x11'),null);this[_0xb362('0x10')]('mandatoryDisposition',_0x2d668b);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 99c15f7..90ecb45 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 _0xa097=['create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','describe','addDisposition','SmsAccountId','getDispositions','findOne','Disposition','filter','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','notify','sms','Applications','orderBy','priority','asc','account','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','twilio','from','From','Body','messageId','MessageSid','skebby','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','from\x20is\x20mandatory','isNil','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','list','omit','defaults','SmsInteraction','spread','interaction','created','push','applications','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','agent','startRouting','Start','receiveMessage','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','\x0a','addApplications','transaction','sequelize','Transaction','SmsApplication','findAndCountAll','finally','getApplications','getInteractions','User','Owner','fullname','internal','Tag','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','Messages','dataValues','SmsAccount,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','redif','error_code','DELIVERED','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','state','message-id','addAgents','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsAccount.socket','http','SmsAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','SmsAccounts','UserProfileResource','then','stack','name','send','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','includeAll','include','rows','show','find'];(function(_0x484195,_0x25a4d2){var _0xd057ff=function(_0x4a1b2b){while(--_0x4a1b2b){_0x484195['push'](_0x484195['shift']());}};_0xd057ff(++_0x25a4d2);}(_0xa097,0x8d));var _0x7a09=function(_0x48a81d,_0x2b3d9e){_0x48a81d=_0x48a81d-0x0;var _0x19699a=_0xa097[_0x48a81d];return _0x19699a;};'use strict';var emlformat=require(_0x7a09('0x0'));var rimraf=require(_0x7a09('0x1'));var zipdir=require(_0x7a09('0x2'));var jsonpatch=require(_0x7a09('0x3'));var rp=require(_0x7a09('0x4'));var moment=require(_0x7a09('0x5'));var BPromise=require(_0x7a09('0x6'));var Mustache=require(_0x7a09('0x7'));var util=require(_0x7a09('0x8'));var path=require(_0x7a09('0x9'));var sox=require('sox');var csv=require(_0x7a09('0xa'));var ejs=require(_0x7a09('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7a09('0xc'));var squel=require(_0x7a09('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7a09('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7a09('0xf'));var authService=require(_0x7a09('0x10'));var qs=require(_0x7a09('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7a09('0x12'))(_0x7a09('0x13'));var utils=require(_0x7a09('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x7a09('0x15'));var db=require(_0x7a09('0x16'))['db'];config[_0x7a09('0x17')]=_['defaults'](config[_0x7a09('0x17')],{'host':_0x7a09('0x18'),'port':0x18eb});var socket=require(_0x7a09('0x19'))(new Redis(config[_0x7a09('0x17')]));require(_0x7a09('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x7a09('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x1e3dc3,_0x259e6c,_0x1d8ee5,_0x141863){return new BPromise(function(_0x429e8b,_0x4e82fa){var _0x101e85=_0x141863||client;return _0x101e85['request'](_0x1e3dc3,_0x1d8ee5)['then'](function(_0x4085ed){logger['info'](_0x7a09('0x1c'),_0x259e6c,_0x7a09('0x1d'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x259e6c,'request\x20sent',JSON[_0x7a09('0x1e')](_0x4085ed));if(_0x4085ed['error']){if(_0x4085ed[_0x7a09('0x1f')][_0x7a09('0x20')]===0x1f4){logger[_0x7a09('0x1f')]('SmsAccount,\x20%s,\x20%s',_0x259e6c,_0x4085ed[_0x7a09('0x1f')][_0x7a09('0x21')]);return _0x4e82fa(_0x4085ed[_0x7a09('0x1f')][_0x7a09('0x21')]);}logger[_0x7a09('0x1f')](_0x7a09('0x1c'),_0x259e6c,_0x4085ed[_0x7a09('0x1f')][_0x7a09('0x21')]);return _0x429e8b(_0x4085ed['error']['message']);}else{logger[_0x7a09('0x22')]('SmsAccount,\x20%s,\x20%s',_0x259e6c,'request\x20sent');_0x429e8b(_0x4085ed[_0x7a09('0x23')][_0x7a09('0x21')]);}})[_0x7a09('0x24')](function(_0x420402){logger[_0x7a09('0x1f')]('SmsAccount,\x20%s,\x20%s',_0x259e6c,_0x420402);_0x4e82fa(_0x420402);});});}function respondWithStatusCode(_0x2f58b2,_0x3ddcfb){_0x3ddcfb=_0x3ddcfb||0xcc;return function(_0x364bcb){if(_0x364bcb){return _0x2f58b2[_0x7a09('0x25')](_0x3ddcfb);}return _0x2f58b2[_0x7a09('0x26')](_0x3ddcfb)[_0x7a09('0x27')]();};}function respondWithResult(_0x3bb164,_0x333e84){_0x333e84=_0x333e84||0xc8;return function(_0x9fbe7e){if(_0x9fbe7e){return _0x3bb164[_0x7a09('0x26')](_0x333e84)[_0x7a09('0x28')](_0x9fbe7e);}};}function respondWithFilteredResult(_0x17a4c9,_0x2f7526){return function(_0x2e04b1){if(_0x2e04b1){var _0x32bbf6=typeof _0x2f7526[_0x7a09('0x29')]===_0x7a09('0x2a')&&typeof _0x2f7526[_0x7a09('0x2b')]===_0x7a09('0x2a');var _0xdb05bf=_0x2e04b1[_0x7a09('0x2c')];var _0x3cbaf=_0x32bbf6?0x0:_0x2f7526[_0x7a09('0x29')];var _0xdb0258=_0x32bbf6?_0x2e04b1[_0x7a09('0x2c')]:_0x2f7526[_0x7a09('0x29')]+_0x2f7526['limit'];var _0x219c9f;if(_0xdb0258>=_0xdb05bf){_0xdb0258=_0xdb05bf;_0x219c9f=0xc8;}else{_0x219c9f=0xce;}_0x17a4c9[_0x7a09('0x26')](_0x219c9f);return _0x17a4c9[_0x7a09('0x2d')](_0x7a09('0x2e'),_0x3cbaf+'-'+_0xdb0258+'/'+_0xdb05bf)[_0x7a09('0x28')](_0x2e04b1);}return null;};}function patchUpdates(_0x4a6ce2){return function(_0x20b158){try{jsonpatch['apply'](_0x20b158,_0x4a6ce2,!![]);}catch(_0x4e4360){return BPromise[_0x7a09('0x2f')](_0x4e4360);}return _0x20b158[_0x7a09('0x30')]();};}function saveUpdates(_0x1545e0,_0x9a5cde){return function(_0x2fcdac){if(_0x2fcdac){return _0x2fcdac[_0x7a09('0x31')](_0x1545e0)['then'](function(_0x12e370){return _0x12e370;});}return null;};}function removeEntity(_0x576e10,_0x1c6619){return function(_0x2a0e99){if(_0x2a0e99){return _0x2a0e99['destroy']()['then'](function(){var _0x4a5cd7=_0x2a0e99['get']({'plain':!![]});var _0x57d032=_0x7a09('0x32');return db[_0x7a09('0x33')]['destroy']({'where':{'type':_0x57d032,'resourceId':_0x4a5cd7['id']}})[_0x7a09('0x34')](function(){return _0x2a0e99;});})[_0x7a09('0x34')](function(){_0x576e10[_0x7a09('0x26')](0xcc)[_0x7a09('0x27')]();});}};}function handleEntityNotFound(_0x237c26,_0x3de871){return function(_0x5198c4){if(!_0x5198c4){_0x237c26[_0x7a09('0x25')](0x194);}return _0x5198c4;};}function handleError(_0x29bfcd,_0x393114){_0x393114=_0x393114||0x1f4;return function(_0x47a761){logger[_0x7a09('0x1f')](_0x47a761[_0x7a09('0x35')]);if(_0x47a761[_0x7a09('0x36')]){delete _0x47a761[_0x7a09('0x36')];}_0x29bfcd[_0x7a09('0x26')](_0x393114)[_0x7a09('0x37')](_0x47a761);};}exports['index']=function(_0x1de6d3,_0x10019b){var _0x4d68ea={'include':[{'model':db[_0x7a09('0x38')],'as':_0x7a09('0x39')}]},_0x4bdad9={},_0xd5dd10={'count':0x0,'rows':[]};var _0x28b5b0=_['map'](db[_0x7a09('0x3a')][_0x7a09('0x3b')],function(_0x3e0191){return{'name':_0x3e0191[_0x7a09('0x3c')],'type':_0x3e0191[_0x7a09('0x3d')][_0x7a09('0x3e')]};});_0x4bdad9[_0x7a09('0x3f')]=_[_0x7a09('0x40')](_0x28b5b0,_0x7a09('0x36'));_0x4bdad9[_0x7a09('0x41')]=_[_0x7a09('0x42')](_0x1de6d3[_0x7a09('0x41')]);_0x4bdad9[_0x7a09('0x43')]=_[_0x7a09('0x44')](_0x4bdad9['model'],_0x4bdad9['query']);_0x4d68ea[_0x7a09('0x45')]=_[_0x7a09('0x44')](_0x4bdad9['model'],qs['fields'](_0x1de6d3[_0x7a09('0x41')][_0x7a09('0x46')]));_0x4d68ea[_0x7a09('0x45')]=_0x4d68ea[_0x7a09('0x45')][_0x7a09('0x47')]?_0x4d68ea['attributes']:_0x4bdad9[_0x7a09('0x3f')];if(!_0x1de6d3[_0x7a09('0x41')][_0x7a09('0x48')](_0x7a09('0x49'))){_0x4d68ea['limit']=qs['limit'](_0x1de6d3[_0x7a09('0x41')][_0x7a09('0x2b')]);_0x4d68ea[_0x7a09('0x29')]=qs['offset'](_0x1de6d3[_0x7a09('0x41')]['offset']);}_0x4d68ea[_0x7a09('0x4a')]=qs[_0x7a09('0x4b')](_0x1de6d3['query']['sort']);_0x4d68ea['where']=qs['filters'](_[_0x7a09('0x4c')](_0x1de6d3[_0x7a09('0x41')],_0x4bdad9['filters']),_0x28b5b0);if(_0x1de6d3[_0x7a09('0x41')]['filter']){_0x4d68ea[_0x7a09('0x4d')]=_[_0x7a09('0x4e')](_0x4d68ea[_0x7a09('0x4d')],{'$or':_['map'](_0x28b5b0,function(_0x17d461){if(_0x17d461[_0x7a09('0x3d')]!==_0x7a09('0x4f')){var _0x5c9b52={};_0x5c9b52[_0x17d461[_0x7a09('0x36')]]={'$like':'%'+_0x1de6d3[_0x7a09('0x41')]['filter']+'%'};return _0x5c9b52;}})});}_0x4d68ea=_[_0x7a09('0x4e')]({},_0x4d68ea,_0x1de6d3[_0x7a09('0x50')]);var _0x485810={'where':_0x4d68ea[_0x7a09('0x4d')]};return db['SmsAccount'][_0x7a09('0x2c')](_0x485810)[_0x7a09('0x34')](function(_0x24312e){_0xd5dd10['count']=_0x24312e;if(_0x1de6d3['query'][_0x7a09('0x51')]){_0x4d68ea[_0x7a09('0x52')]=[{'all':!![]}];}return db[_0x7a09('0x3a')]['findAll'](_0x4d68ea);})[_0x7a09('0x34')](function(_0x58b208){_0xd5dd10[_0x7a09('0x53')]=_0x58b208;return _0xd5dd10;})[_0x7a09('0x34')](respondWithFilteredResult(_0x10019b,_0x4d68ea))[_0x7a09('0x24')](handleError(_0x10019b,null));};exports[_0x7a09('0x54')]=function(_0xcaf3dc,_0x2660f9){var _0x801026={'raw':![],'where':{'id':_0xcaf3dc['params']['id']},'include':[{'model':db[_0x7a09('0x38')],'as':_0x7a09('0x39')}]},_0x5ac742={};_0x5ac742['model']=_[_0x7a09('0x42')](db[_0x7a09('0x3a')][_0x7a09('0x3b')]);_0x5ac742[_0x7a09('0x41')]=_['keys'](_0xcaf3dc[_0x7a09('0x41')]);_0x5ac742[_0x7a09('0x43')]=_[_0x7a09('0x44')](_0x5ac742[_0x7a09('0x3f')],_0x5ac742[_0x7a09('0x41')]);_0x801026['attributes']=_[_0x7a09('0x44')](_0x5ac742[_0x7a09('0x3f')],qs['fields'](_0xcaf3dc[_0x7a09('0x41')][_0x7a09('0x46')]));_0x801026[_0x7a09('0x45')]=_0x801026[_0x7a09('0x45')][_0x7a09('0x47')]?_0x801026[_0x7a09('0x45')]:_0x5ac742['model'];if(_0xcaf3dc['query'][_0x7a09('0x51')]){_0x801026[_0x7a09('0x52')]=[{'all':!![]}];}_0x801026=_[_0x7a09('0x4e')]({},_0x801026,_0xcaf3dc[_0x7a09('0x50')]);return db[_0x7a09('0x3a')][_0x7a09('0x55')](_0x801026)['then'](handleEntityNotFound(_0x2660f9,null))[_0x7a09('0x34')](respondWithResult(_0x2660f9,null))['catch'](handleError(_0x2660f9,null));};exports[_0x7a09('0x56')]=function(_0x5a6dfe,_0x46cf50){return db[_0x7a09('0x3a')][_0x7a09('0x56')](_0x5a6dfe[_0x7a09('0x57')],{})['then'](function(_0x31413b){var _0x51b227=_0x5a6dfe[_0x7a09('0x58')][_0x7a09('0x59')]({'plain':!![]});if(!_0x51b227)throw new Error(_0x7a09('0x5a'));if(_0x51b227[_0x7a09('0x5b')]===_0x7a09('0x58')){var _0x2054f5=_0x31413b['get']({'plain':!![]});var _0x32c820=_0x7a09('0x32');return db[_0x7a09('0x5c')][_0x7a09('0x55')]({'where':{'name':_0x32c820,'userProfileId':_0x51b227['userProfileId']},'raw':!![]})[_0x7a09('0x34')](function(_0x478f60){if(_0x478f60&&_0x478f60['autoAssociation']===0x0){return db[_0x7a09('0x33')][_0x7a09('0x56')]({'name':_0x2054f5[_0x7a09('0x36')],'resourceId':_0x2054f5['id'],'type':_0x478f60[_0x7a09('0x36')],'sectionId':_0x478f60['id']},{})[_0x7a09('0x34')](function(){return _0x31413b;});}else{return _0x31413b;}})[_0x7a09('0x24')](function(_0x4c31a7){logger[_0x7a09('0x1f')](_0x7a09('0x5d'),_0x4c31a7);throw _0x4c31a7;});}return _0x31413b;})['then'](respondWithResult(_0x46cf50,0xc9))[_0x7a09('0x24')](handleError(_0x46cf50,null));};exports[_0x7a09('0x31')]=function(_0x145857,_0x4e85b2){if(_0x145857[_0x7a09('0x57')]['id']){delete _0x145857[_0x7a09('0x57')]['id'];}return db['SmsAccount'][_0x7a09('0x55')]({'where':{'id':_0x145857[_0x7a09('0x5e')]['id']},'include':[{'model':db[_0x7a09('0x38')],'as':_0x7a09('0x39')}]})[_0x7a09('0x34')](handleEntityNotFound(_0x4e85b2,null))[_0x7a09('0x34')](saveUpdates(_0x145857[_0x7a09('0x57')],null))[_0x7a09('0x34')](respondWithResult(_0x4e85b2,null))[_0x7a09('0x24')](handleError(_0x4e85b2,null));};exports[_0x7a09('0x5f')]=function(_0x2378fe,_0x4f60d3){return db[_0x7a09('0x3a')]['find']({'where':{'id':_0x2378fe[_0x7a09('0x5e')]['id']}})['then'](handleEntityNotFound(_0x4f60d3,null))[_0x7a09('0x34')](removeEntity(_0x4f60d3,null))[_0x7a09('0x24')](handleError(_0x4f60d3,null));};exports[_0x7a09('0x60')]=function(_0x5bb8db,_0x216130){return db[_0x7a09('0x3a')][_0x7a09('0x60')]()['then'](respondWithResult(_0x216130,null))[_0x7a09('0x24')](handleError(_0x216130,null));};exports[_0x7a09('0x61')]=function(_0x910b71,_0xed0c0c,_0x601cec){if(_0x910b71[_0x7a09('0x57')]['id']){delete _0x910b71[_0x7a09('0x57')]['id'];}return db[_0x7a09('0x3a')][_0x7a09('0x55')]({'where':{'id':_0x910b71[_0x7a09('0x5e')]['id']}})[_0x7a09('0x34')](handleEntityNotFound(_0xed0c0c,null))[_0x7a09('0x34')](function(_0x1dd467){if(_0x1dd467){_0x910b71['body'][_0x7a09('0x62')]=_0x1dd467['id'];return db['Disposition'][_0x7a09('0x56')](_0x910b71[_0x7a09('0x57')]);}})[_0x7a09('0x34')](respondWithResult(_0xed0c0c,null))[_0x7a09('0x24')](handleError(_0xed0c0c,null));};exports[_0x7a09('0x63')]=function(_0x48ff06,_0x12175c,_0x399474){var _0x162851={'raw':![],'where':{}};var _0x55baa9={};var _0x35c808={'count':0x0,'rows':[]};return db[_0x7a09('0x3a')][_0x7a09('0x64')]({'where':{'id':_0x48ff06[_0x7a09('0x5e')]['id']}})[_0x7a09('0x34')](handleEntityNotFound(_0x12175c,null))[_0x7a09('0x34')](function(_0x363c70){if(_0x363c70){_0x55baa9[_0x7a09('0x3f')]=_[_0x7a09('0x42')](db[_0x7a09('0x65')][_0x7a09('0x3b')]);_0x55baa9[_0x7a09('0x41')]=_['keys'](_0x48ff06['query']);_0x55baa9[_0x7a09('0x43')]=_[_0x7a09('0x44')](_0x55baa9[_0x7a09('0x3f')],_0x55baa9[_0x7a09('0x41')]);_0x162851[_0x7a09('0x45')]=_[_0x7a09('0x44')](_0x55baa9[_0x7a09('0x3f')],qs[_0x7a09('0x46')](_0x48ff06[_0x7a09('0x41')]['fields']));_0x162851['attributes']=_0x162851[_0x7a09('0x45')]['length']?_0x162851[_0x7a09('0x45')]:_0x55baa9[_0x7a09('0x3f')];if(!_0x48ff06[_0x7a09('0x41')][_0x7a09('0x48')](_0x7a09('0x49'))){_0x162851[_0x7a09('0x2b')]=qs[_0x7a09('0x2b')](_0x48ff06['query'][_0x7a09('0x2b')]);_0x162851['offset']=qs[_0x7a09('0x29')](_0x48ff06['query'][_0x7a09('0x29')]);}_0x162851[_0x7a09('0x4a')]=qs[_0x7a09('0x4b')](_0x48ff06[_0x7a09('0x41')][_0x7a09('0x4b')]);_0x162851[_0x7a09('0x4d')]=qs[_0x7a09('0x43')](_[_0x7a09('0x4c')](_0x48ff06[_0x7a09('0x41')],_0x55baa9[_0x7a09('0x43')]));_0x162851[_0x7a09('0x4d')][_0x7a09('0x62')]=_0x363c70['id'];if(_0x48ff06[_0x7a09('0x41')][_0x7a09('0x66')]){_0x162851[_0x7a09('0x4d')]=_['merge'](_0x162851[_0x7a09('0x4d')],{'$or':_['map'](_0x162851[_0x7a09('0x45')],function(_0xa96de8){var _0x5ae719={};_0x5ae719[_0xa96de8]={'$like':'%'+_0x48ff06[_0x7a09('0x41')][_0x7a09('0x66')]+'%'};return _0x5ae719;})});}_0x162851=_[_0x7a09('0x4e')]({},_0x162851,_0x48ff06[_0x7a09('0x50')]);return db['Disposition']['count']({'where':_0x162851[_0x7a09('0x4d')]})[_0x7a09('0x34')](function(_0x19f32d){_0x35c808[_0x7a09('0x2c')]=_0x19f32d;if(_0x48ff06[_0x7a09('0x41')][_0x7a09('0x51')]){_0x162851[_0x7a09('0x52')]=[{'all':!![]}];}return db['Disposition'][_0x7a09('0x67')](_0x162851);})[_0x7a09('0x34')](function(_0x26fdeb){_0x35c808[_0x7a09('0x53')]=_0x26fdeb;return _0x35c808;});}})['then'](respondWithFilteredResult(_0x12175c,_0x162851))['catch'](handleError(_0x12175c,null));};exports[_0x7a09('0x68')]=function(_0x3c84e4,_0x2f2c1a,_0x23e057){return db['SmsAccount'][_0x7a09('0x55')]({'where':{'id':_0x3c84e4['params']['id']}})[_0x7a09('0x34')](handleEntityNotFound(_0x2f2c1a,null))[_0x7a09('0x34')](function(_0x11a805){if(_0x11a805){return _0x11a805[_0x7a09('0x68')](_0x3c84e4[_0x7a09('0x41')]['ids']);}})['then'](respondWithStatusCode(_0x2f2c1a,null))['catch'](handleError(_0x2f2c1a,null));};exports[_0x7a09('0x69')]=function(_0x12dee6,_0x5d6e11,_0x5c319a){if(_0x12dee6['body']['id']){delete _0x12dee6[_0x7a09('0x57')]['id'];}return db['SmsAccount'][_0x7a09('0x55')]({'where':{'id':_0x12dee6[_0x7a09('0x5e')]['id']}})[_0x7a09('0x34')](handleEntityNotFound(_0x5d6e11,null))[_0x7a09('0x34')](function(_0x11f877){if(_0x11f877){_0x12dee6[_0x7a09('0x57')][_0x7a09('0x62')]=_0x11f877['id'];return db[_0x7a09('0x6a')][_0x7a09('0x56')](_0x12dee6['body']);}})[_0x7a09('0x34')](respondWithResult(_0x5d6e11,null))['catch'](handleError(_0x5d6e11,null));};exports[_0x7a09('0x6b')]=function(_0x374888,_0x25a3a5,_0x2b2f89){var _0x49a970={'raw':![],'where':{}};var _0x1e1520={};var _0x55a6e8={'count':0x0,'rows':[]};return db[_0x7a09('0x3a')][_0x7a09('0x64')]({'where':{'id':_0x374888[_0x7a09('0x5e')]['id']}})[_0x7a09('0x34')](handleEntityNotFound(_0x25a3a5,null))['then'](function(_0x374527){if(_0x374527){_0x1e1520[_0x7a09('0x3f')]=_['keys'](db[_0x7a09('0x6a')][_0x7a09('0x3b')]);_0x1e1520[_0x7a09('0x41')]=_[_0x7a09('0x42')](_0x374888[_0x7a09('0x41')]);_0x1e1520[_0x7a09('0x43')]=_[_0x7a09('0x44')](_0x1e1520[_0x7a09('0x3f')],_0x1e1520[_0x7a09('0x41')]);_0x49a970[_0x7a09('0x45')]=_['intersection'](_0x1e1520[_0x7a09('0x3f')],qs[_0x7a09('0x46')](_0x374888[_0x7a09('0x41')][_0x7a09('0x46')]));_0x49a970['attributes']=_0x49a970[_0x7a09('0x45')][_0x7a09('0x47')]?_0x49a970['attributes']:_0x1e1520[_0x7a09('0x3f')];if(!_0x374888[_0x7a09('0x41')]['hasOwnProperty'](_0x7a09('0x49'))){_0x49a970[_0x7a09('0x2b')]=qs[_0x7a09('0x2b')](_0x374888[_0x7a09('0x41')][_0x7a09('0x2b')]);_0x49a970[_0x7a09('0x29')]=qs['offset'](_0x374888[_0x7a09('0x41')][_0x7a09('0x29')]);}_0x49a970[_0x7a09('0x4a')]=qs[_0x7a09('0x4b')](_0x374888[_0x7a09('0x41')][_0x7a09('0x4b')]);_0x49a970['where']=qs[_0x7a09('0x43')](_[_0x7a09('0x4c')](_0x374888['query'],_0x1e1520[_0x7a09('0x43')]));_0x49a970[_0x7a09('0x4d')][_0x7a09('0x62')]=_0x374527['id'];if(_0x374888['query'][_0x7a09('0x66')]){_0x49a970[_0x7a09('0x4d')]=_[_0x7a09('0x4e')](_0x49a970[_0x7a09('0x4d')],{'$or':_[_0x7a09('0x40')](_0x49a970[_0x7a09('0x45')],function(_0x489cfc){var _0x477f7c={};_0x477f7c[_0x489cfc]={'$like':'%'+_0x374888[_0x7a09('0x41')][_0x7a09('0x66')]+'%'};return _0x477f7c;})});}_0x49a970=_[_0x7a09('0x4e')]({},_0x49a970,_0x374888['options']);return db[_0x7a09('0x6a')][_0x7a09('0x2c')]({'where':_0x49a970['where']})[_0x7a09('0x34')](function(_0xa0d490){_0x55a6e8[_0x7a09('0x2c')]=_0xa0d490;if(_0x374888[_0x7a09('0x41')][_0x7a09('0x51')]){_0x49a970[_0x7a09('0x52')]=[{'all':!![]}];}return db[_0x7a09('0x6a')][_0x7a09('0x67')](_0x49a970);})[_0x7a09('0x34')](function(_0x5b6add){_0x55a6e8['rows']=_0x5b6add;return _0x55a6e8;});}})[_0x7a09('0x34')](respondWithFilteredResult(_0x25a3a5,_0x49a970))[_0x7a09('0x24')](handleError(_0x25a3a5,null));};exports['removeAnswers']=function(_0x299706,_0x86435a,_0x4e51c1){return db[_0x7a09('0x3a')]['find']({'where':{'id':_0x299706[_0x7a09('0x5e')]['id']}})[_0x7a09('0x34')](handleEntityNotFound(_0x86435a,null))[_0x7a09('0x34')](function(_0x2cb9b6){if(_0x2cb9b6){return _0x2cb9b6[_0x7a09('0x6c')](_0x299706[_0x7a09('0x41')][_0x7a09('0x6d')]);}})[_0x7a09('0x34')](respondWithStatusCode(_0x86435a,null))[_0x7a09('0x24')](handleError(_0x86435a,null));};exports[_0x7a09('0x6e')]=function(_0x17df94,_0x9bc107,_0x550bc0){var _0x2a0bab={'channel':_0x7a09('0x6f')};var _0x527a90=[];var _0x539d00=[];var _0x355553={};return db[_0x7a09('0x3a')]['find']({'where':{'id':_0x17df94[_0x7a09('0x5e')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x7a09('0x70')}]})[_0x7a09('0x34')](handleEntityNotFound(_0x9bc107,null))['then'](function(_0x44ce30){_0x2a0bab['account']=_0x44ce30;_0x2a0bab['applications']=_[_0x7a09('0x71')](_0x44ce30[_0x7a09('0x70')],[_0x7a09('0x72')],[_0x7a09('0x73')]);if(_0x2a0bab[_0x7a09('0x74')]['Applications']){delete _0x2a0bab[_0x7a09('0x74')]['Applications'];}return db['CmContact'][_0x7a09('0x60')]();})['then'](function(_0x441c78){if(!_0x441c78){throw new db[(_0x7a09('0x75'))][(_0x7a09('0x76'))](_0x7a09('0x77'));}_0x527a90=_[_0x7a09('0x78')](_[_0x7a09('0x42')](_0x441c78),[_0x7a09('0x79'),_0x7a09('0x7a')]);_0x539d00=_[_0x7a09('0x78')](_[_0x7a09('0x42')](_0x441c78),[_0x7a09('0x79'),_0x7a09('0x7a'),'CompanyId',_0x7a09('0x7b')]);_0x2a0bab['body']={'mapKey':'mobile'};if(_0x2a0bab[_0x7a09('0x74')][_0x7a09('0x3d')]){switch(_0x2a0bab[_0x7a09('0x74')][_0x7a09('0x3d')]){case _0x7a09('0x7c'):_0x2a0bab[_0x7a09('0x57')][_0x7a09('0x7d')]=_0x17df94[_0x7a09('0x57')][_0x7a09('0x7e')];_0x2a0bab['body'][_0x7a09('0x57')]=_0x17df94['body'][_0x7a09('0x7f')];_0x2a0bab[_0x7a09('0x57')][_0x7a09('0x80')]=_0x17df94[_0x7a09('0x57')][_0x7a09('0x81')];break;case _0x7a09('0x82'):_0x2a0bab['body'][_0x7a09('0x7d')]='+'+_0x17df94[_0x7a09('0x57')]['sender'];_0x2a0bab[_0x7a09('0x57')][_0x7a09('0x57')]=_0x17df94[_0x7a09('0x57')][_0x7a09('0x83')];break;case _0x7a09('0x84'):_0x2a0bab[_0x7a09('0x57')][_0x7a09('0x7d')]=_0x17df94[_0x7a09('0x57')]['from'];_0x2a0bab['body']['body']=_0x17df94[_0x7a09('0x57')][_0x7a09('0x21')];break;case _0x7a09('0x85'):_0x2a0bab[_0x7a09('0x57')]['from']=_0x17df94[_0x7a09('0x57')][_0x7a09('0x7d')];_0x2a0bab[_0x7a09('0x57')]['body']=_0x17df94['body'][_0x7a09('0x57')];_0x2a0bab['body'][_0x7a09('0x80')]=_0x17df94['body'][_0x7a09('0x86')];break;case _0x7a09('0x87'):_0x2a0bab['body'][_0x7a09('0x7d')]=_0x17df94[_0x7a09('0x57')][_0x7a09('0x7e')];_0x2a0bab[_0x7a09('0x57')][_0x7a09('0x57')]=_0x17df94[_0x7a09('0x57')][_0x7a09('0x88')];_0x2a0bab[_0x7a09('0x57')][_0x7a09('0x80')]=_0x17df94[_0x7a09('0x57')][_0x7a09('0x89')];break;case _0x7a09('0x8a'):_0x2a0bab['body']['from']='+'+_0x17df94['body'][_0x7a09('0x8b')][0x0]['from'];_0x2a0bab[_0x7a09('0x57')][_0x7a09('0x57')]=_0x17df94[_0x7a09('0x57')][_0x7a09('0x8b')][0x0][_0x7a09('0x83')];_0x2a0bab[_0x7a09('0x57')][_0x7a09('0x80')]=_0x17df94['body']['results'][0x0]['messageId'];break;case _0x7a09('0x8c'):_0x2a0bab[_0x7a09('0x57')][_0x7a09('0x7d')]=_0x17df94[_0x7a09('0x57')][_0x7a09('0x8d')];_0x2a0bab[_0x7a09('0x57')][_0x7a09('0x57')]=_0x17df94[_0x7a09('0x57')][_0x7a09('0x8e')][_0x7a09('0x21')];break;case _0x7a09('0x8f'):_0x2a0bab[_0x7a09('0x57')][_0x7a09('0x7d')]=_0x17df94[_0x7a09('0x57')][_0x7a09('0x90')];_0x2a0bab[_0x7a09('0x57')][_0x7a09('0x57')]=_0x17df94['body']['text'];_0x2a0bab[_0x7a09('0x57')][_0x7a09('0x80')]=_0x17df94['body'][_0x7a09('0x91')];break;case _0x7a09('0x92'):_0x2a0bab[_0x7a09('0x57')][_0x7a09('0x80')]=_0x17df94[_0x7a09('0x57')][0x0][_0x7a09('0x21')]['id'];_0x2a0bab['body'][_0x7a09('0x7d')]=_0x17df94[_0x7a09('0x57')][0x0][_0x7a09('0x21')][_0x7a09('0x7d')];_0x2a0bab[_0x7a09('0x57')][_0x7a09('0x57')]=_0x17df94[_0x7a09('0x57')][0x0][_0x7a09('0x21')][_0x7a09('0x83')];break;case _0x7a09('0x93'):_0x2a0bab[_0x7a09('0x57')][_0x7a09('0x7d')]=_0x17df94[_0x7a09('0x57')][_0x7a09('0x7d')];_0x2a0bab[_0x7a09('0x57')][_0x7a09('0x57')]=_0x17df94[_0x7a09('0x57')]['message'];_0x2a0bab[_0x7a09('0x57')]['messageId']=_0x17df94[_0x7a09('0x57')][_0x7a09('0x94')];break;}}if(_0x2a0bab[_0x7a09('0x57')]['id']){delete _0x2a0bab['body']['id'];}if(_['isNil'](_0x2a0bab[_0x7a09('0x57')]['from'])){throw new db[(_0x7a09('0x75'))][(_0x7a09('0x76'))](_0x7a09('0x95'));}if(_[_0x7a09('0x96')](_0x2a0bab['body'][_0x7a09('0x57')])||_0x2a0bab[_0x7a09('0x57')]['body']===''){throw new db['Sequelize'][(_0x7a09('0x76'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x7a09('0x96')](_0x2a0bab[_0x7a09('0x57')][_0x7a09('0x97')])){throw new db[(_0x7a09('0x75'))][(_0x7a09('0x76'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x539d00);}if(!_[_0x7a09('0x98')](_0x539d00,_0x2a0bab[_0x7a09('0x57')][_0x7a09('0x97')])){throw new db['Sequelize'][(_0x7a09('0x76'))](_0x7a09('0x99')+_0x539d00);}_0x355553[_0x2a0bab[_0x7a09('0x57')][_0x7a09('0x97')]]=_0x2a0bab[_0x7a09('0x57')]['from'];return db[_0x7a09('0x9a')]['find']({'where':{'id':_0x2a0bab[_0x7a09('0x74')][_0x7a09('0x7b')]},'include':[{'model':db[_0x7a09('0x9b')],'as':_0x7a09('0x9c'),'where':_0x355553,'limit':0x1,'order':[['updatedAt',_0x7a09('0x9d')]]}]});})[_0x7a09('0x34')](handleEntityNotFound(_0x9bc107,null))[_0x7a09('0x34')](function(_0xd17852){if(_0xd17852){_0x2a0bab[_0x7a09('0x9e')]=_[_0x7a09('0x9f')](_0xd17852,[_0x7a09('0x9c')]);if(_0xd17852[_0x7a09('0x9c')][_0x7a09('0x47')]){return _0xd17852[_0x7a09('0x9c')][0x0];}var _0x2ee217=_[_0x7a09('0xa0')](_0x2a0bab[_0x7a09('0x57')],{'firstName':_0x2a0bab['body'][_0x7a09('0x7d')],'ListId':_0xd17852['id']});_0x2ee217[_0x2a0bab[_0x7a09('0x57')][_0x7a09('0x97')]]=_0x2a0bab[_0x7a09('0x57')][_0x7a09('0x7d')];return db[_0x7a09('0x9b')][_0x7a09('0x56')](_0x2ee217,{'fields':_0x527a90,'raw':!![]});}})['then'](handleEntityNotFound(_0x9bc107,null))[_0x7a09('0x34')](function(_0x55f2a8){if(_0x55f2a8){_0x2a0bab['contact']=_0x55f2a8;var _0xc89bb4={'ContactId':_0x55f2a8['id'],'phone':_0x2a0bab['body'][_0x7a09('0x7d')],'SmsAccountId':_0x17df94['params']['id']};var _0x247118={'ContactId':_0x55f2a8['id'],'SmsAccountId':_0x17df94[_0x7a09('0x5e')]['id'],'closed':![]};return db[_0x7a09('0xa1')]['find']({'where':_0x247118})[_0x7a09('0x34')](function(_0x4c2204){if(_0x4c2204){return[_0x4c2204,![]];}return db[_0x7a09('0xa1')][_0x7a09('0x56')](_0xc89bb4)[_0x7a09('0x34')](function(_0x11cf85){return[_0x11cf85,!![]];});});}})[_0x7a09('0xa2')](function(_0x38afff,_0x51b04e){_0x2a0bab[_0x7a09('0xa3')]=_0x38afff[_0x7a09('0x59')]({'plain':!![]});_0x2a0bab['interaction'][_0x7a09('0xa4')]=![];if(_0x51b04e){if(_0x2a0bab[_0x7a09('0x74')]['autoclose']){_0x2a0bab['applications'][_0x7a09('0xa5')]({'id':0x0,'priority':_0x2a0bab[_0x7a09('0xa6')][_0x7a09('0x47')]+0x1,'app':_0x7a09('0xa7'),'appdata':_0x7a09('0xa8'),'interval':_0x7a09('0xa9')});}_0x2a0bab['interaction'][_0x7a09('0xa4')]=!![];}return db[_0x7a09('0xaa')][_0x7a09('0x56')]({'phone':_0x2a0bab[_0x7a09('0x57')][_0x7a09('0x7d')],'messageId':_0x2a0bab['body']['messageId'],'body':_0x2a0bab[_0x7a09('0x57')][_0x7a09('0x57')],'SmsAccountId':_0x17df94[_0x7a09('0x5e')]['id'],'SmsInteractionId':_0x38afff['id'],'direction':'in','ContactId':_0x38afff[_0x7a09('0xab')],'AttachmentId':_0x2a0bab['body'][_0x7a09('0xac')]});})[_0x7a09('0x34')](function(_0x355ffd){_0x2a0bab[_0x7a09('0x21')]=_0x355ffd;if(_0x2a0bab['interaction'][_0x7a09('0xad')]){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x2a0bab[_0x7a09('0xa3')][_0x7a09('0xad')]}})[_0x7a09('0x34')](function(_0x39b581){if(_0x39b581){_0x2a0bab[_0x7a09('0xa6')]['unshift']({'id':0x0,'priority':0x0,'app':_0x7a09('0xae'),'appdata':_0x39b581[_0x7a09('0x36')]+','+(_0x2a0bab[_0x7a09('0x74')]['waitForTheAssignedAgent']||0xa),'interval':_0x7a09('0xa9')});}return respondWithRpcPromise('Start',_0x7a09('0xaf'),_0x2a0bab);});}return respondWithRpcPromise(_0x7a09('0xb0'),_0x7a09('0xaf'),_0x2a0bab);})['then'](function(_0x5526e6){if(_0x5526e6){var _0x5b9d33=0xc8;var _0x7ddb29=_0x7a09('0xb1');logger[_0x7a09('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7ddb29,_0x5b9d33,'entity\x20found');logger[_0x7a09('0xb2')](_0x7a09('0xb3'),_0x7ddb29,_0x5b9d33,_0x7a09('0xb4'),JSON[_0x7a09('0x1e')](_0x5526e6));if(_0x2a0bab['account']['type']===_0x7a09('0x7c')){return _0x9bc107[_0x7a09('0x26')](_0x5b9d33)[_0x7a09('0x2d')](_0x7a09('0xb5'),'text/xml')[_0x7a09('0x37')](_0x7a09('0xb6'));}else{return _0x9bc107[_0x7a09('0x26')](_0x5b9d33)[_0x7a09('0x28')](_0x5526e6);}}})[_0x7a09('0x24')](handleError(_0x9bc107,null));};exports[_0x7a09('0xb7')]=function(_0x222e04,_0x287a52){var _0x3edd0c=_0x222e04[_0x7a09('0x5e')]['id'];var _0x58167c=_0x222e04[_0x7a09('0x57')];var _0x111057=0xc8;var _0x5b80de=null;return db['sequelize'][_0x7a09('0xb8')]({'isolationLevel':db[_0x7a09('0xb9')][_0x7a09('0xba')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x49934a){return db[_0x7a09('0x3a')][_0x7a09('0x64')]({'where':{'id':_0x3edd0c},'transaction':_0x49934a})[_0x7a09('0x34')](function(_0x52bb4c){if(_0x52bb4c){return db[_0x7a09('0xbb')][_0x7a09('0x5f')]({'where':{'SmsAccountId':_0x3edd0c},'transaction':_0x49934a})[_0x7a09('0x34')](function(){var _0x50ae2e=_[_0x7a09('0x40')](_0x58167c,function(_0x32b638){_0x32b638[_0x7a09('0x62')]=_0x3edd0c;return _0x32b638;});return db['SmsApplication']['bulkCreate'](_0x50ae2e,{'transaction':_0x49934a});});}else{_0x111057=0x194;_0x5b80de=[];}});})[_0x7a09('0x34')](function(){if(_0x111057!==0x194){return db[_0x7a09('0xbb')][_0x7a09('0xbc')]({'where':{'SmsAccountId':_0x3edd0c},'order':_0x7a09('0x72')})[_0x7a09('0x34')](function(_0x145e83){_0x5b80de=_0x145e83;});}})[_0x7a09('0x24')](function(_0x5e4bf4){_0x111057=0x1f4;logger[_0x7a09('0x1f')](_0x5e4bf4[_0x7a09('0x35')]);if(_0x5e4bf4[_0x7a09('0x36')]){delete _0x5e4bf4[_0x7a09('0x36')];}_0x5b80de=_0x5e4bf4;})[_0x7a09('0xbd')](function(){if(_0x5b80de===null){_0x287a52['sendStatus'](_0x111057);}else{if(_0x111057===0x1f4){_0x287a52[_0x7a09('0x26')](_0x111057)[_0x7a09('0x37')](_0x5b80de);}else{_0x287a52[_0x7a09('0x26')](_0x111057)[_0x7a09('0x28')](_0x5b80de);}}});};exports[_0x7a09('0xbe')]=function(_0x4e5a05,_0x26b283,_0x8e28b9){var _0x4ed068={};var _0x42b24d={};var _0x2269ba;var _0x28c28b;return db[_0x7a09('0x3a')]['findOne']({'where':{'id':_0x4e5a05[_0x7a09('0x5e')]['id']}})[_0x7a09('0x34')](handleEntityNotFound(_0x26b283,null))[_0x7a09('0x34')](function(_0x24168a){if(_0x24168a){_0x2269ba=_0x24168a;_0x42b24d[_0x7a09('0x3f')]=_[_0x7a09('0x42')](db[_0x7a09('0xbb')]['rawAttributes']);_0x42b24d[_0x7a09('0x41')]=_[_0x7a09('0x42')](_0x4e5a05['query']);_0x42b24d[_0x7a09('0x43')]=_[_0x7a09('0x44')](_0x42b24d[_0x7a09('0x3f')],_0x42b24d[_0x7a09('0x41')]);_0x4ed068['attributes']=_[_0x7a09('0x44')](_0x42b24d[_0x7a09('0x3f')],qs[_0x7a09('0x46')](_0x4e5a05[_0x7a09('0x41')][_0x7a09('0x46')]));_0x4ed068[_0x7a09('0x45')]=_0x4ed068['attributes'][_0x7a09('0x47')]?_0x4ed068['attributes']:_0x42b24d[_0x7a09('0x3f')];_0x4ed068[_0x7a09('0x4a')]=qs[_0x7a09('0x4b')](_0x4e5a05[_0x7a09('0x41')][_0x7a09('0x4b')]);_0x4ed068[_0x7a09('0x4d')]=qs['filters'](_[_0x7a09('0x4c')](_0x4e5a05[_0x7a09('0x41')],_0x42b24d['filters']));if(_0x4e5a05[_0x7a09('0x41')][_0x7a09('0x66')]){_0x4ed068[_0x7a09('0x4d')]=_['merge'](_0x4ed068[_0x7a09('0x4d')],{'$or':_[_0x7a09('0x40')](_0x4ed068[_0x7a09('0x45')],function(_0x13c9eb){var _0x3d4f33={};_0x3d4f33[_0x13c9eb]={'$like':'%'+_0x4e5a05[_0x7a09('0x41')][_0x7a09('0x66')]+'%'};return _0x3d4f33;})});}_0x4ed068=_[_0x7a09('0x4e')]({},_0x4ed068,_0x4e5a05[_0x7a09('0x50')]);return _0x2269ba[_0x7a09('0xbe')](_0x4ed068);}})[_0x7a09('0x34')](function(_0x1f81c7){if(_0x1f81c7){_0x28c28b=_0x1f81c7[_0x7a09('0x47')];if(!_0x4e5a05[_0x7a09('0x41')][_0x7a09('0x48')](_0x7a09('0x49'))){_0x4ed068['limit']=qs[_0x7a09('0x2b')](_0x4e5a05[_0x7a09('0x41')]['limit']);_0x4ed068[_0x7a09('0x29')]=qs[_0x7a09('0x29')](_0x4e5a05['query'][_0x7a09('0x29')]);}return _0x2269ba[_0x7a09('0xbe')](_0x4ed068);}})[_0x7a09('0x34')](function(_0x9d2ee0){if(_0x9d2ee0){return _0x9d2ee0?{'count':_0x28c28b,'rows':_0x9d2ee0}:null;}})[_0x7a09('0x34')](respondWithResult(_0x26b283,null))[_0x7a09('0x24')](handleError(_0x26b283,null));};exports[_0x7a09('0xbf')]=function(_0x3433f6,_0x143b35,_0x1db5a8){var _0x3aa5d1={'raw':![],'where':{}};var _0x1af275={};var _0x590f36={'count':0x0,'rows':[]};return db['SmsAccount'][_0x7a09('0x64')]({'where':{'id':_0x3433f6[_0x7a09('0x5e')]['id']}})[_0x7a09('0x34')](handleEntityNotFound(_0x143b35,null))[_0x7a09('0x34')](function(_0x50edbc){if(_0x50edbc){_0x1af275[_0x7a09('0x3f')]=_[_0x7a09('0x42')](db[_0x7a09('0xa1')]['rawAttributes']);_0x1af275[_0x7a09('0x41')]=_[_0x7a09('0x42')](_0x3433f6[_0x7a09('0x41')]);_0x1af275[_0x7a09('0x43')]=_[_0x7a09('0x44')](_0x1af275['model'],_0x1af275[_0x7a09('0x41')]);_0x3aa5d1[_0x7a09('0x45')]=_[_0x7a09('0x44')](_0x1af275[_0x7a09('0x3f')],qs['fields'](_0x3433f6[_0x7a09('0x41')][_0x7a09('0x46')]));_0x3aa5d1['attributes']=_0x3aa5d1['attributes'][_0x7a09('0x47')]?_0x3aa5d1[_0x7a09('0x45')]:_0x1af275[_0x7a09('0x3f')];if(!_0x3433f6[_0x7a09('0x41')][_0x7a09('0x48')](_0x7a09('0x49'))){_0x3aa5d1[_0x7a09('0x2b')]=qs[_0x7a09('0x2b')](_0x3433f6[_0x7a09('0x41')][_0x7a09('0x2b')]);_0x3aa5d1[_0x7a09('0x29')]=qs[_0x7a09('0x29')](_0x3433f6['query'][_0x7a09('0x29')]);}_0x3aa5d1['order']=qs['sort'](_0x3433f6[_0x7a09('0x41')]['sort']);_0x3aa5d1[_0x7a09('0x4d')]=qs[_0x7a09('0x43')](_[_0x7a09('0x4c')](_0x3433f6[_0x7a09('0x41')],_0x1af275[_0x7a09('0x43')]));_0x3aa5d1[_0x7a09('0x4d')][_0x7a09('0x62')]=_0x50edbc['id'];if(_0x3433f6[_0x7a09('0x41')]['filter']){_0x3aa5d1[_0x7a09('0x4d')]=_['merge'](_0x3aa5d1[_0x7a09('0x4d')],{'$or':_[_0x7a09('0x40')](_0x3aa5d1[_0x7a09('0x45')],function(_0x577c0a){var _0x3adc01={};_0x3adc01[_0x577c0a]={'$like':'%'+_0x3433f6[_0x7a09('0x41')]['filter']+'%'};return _0x3adc01;})});}_0x3aa5d1=_[_0x7a09('0x4e')]({},_0x3aa5d1,_0x3433f6[_0x7a09('0x50')]);return db[_0x7a09('0xa1')][_0x7a09('0x2c')]({'where':_0x3aa5d1[_0x7a09('0x4d')]})['then'](function(_0x3cc54f){_0x590f36[_0x7a09('0x2c')]=_0x3cc54f;if(_0x3433f6['query'][_0x7a09('0x51')]){_0x3aa5d1[_0x7a09('0x52')]=[{'model':db[_0x7a09('0x9b')],'as':'Contact','required':![]},{'model':db[_0x7a09('0xc0')],'as':_0x7a09('0xc1'),'attributes':[_0x7a09('0x36'),_0x7a09('0xc2'),_0x7a09('0xc3')],'required':![]},{'model':db[_0x7a09('0xc4')],'as':'Tags','attributes':['id',_0x7a09('0x36'),'color'],'where':_0x3433f6['query']['tag']?{'id':_0x3433f6[_0x7a09('0x41')][_0x7a09('0xc5')]}:undefined,'required':_0x3433f6['query'][_0x7a09('0xc5')]?!![]:![]}];}return db['SmsInteraction'][_0x7a09('0x67')](_0x3aa5d1);})[_0x7a09('0x34')](function(_0x29dc15){_0x590f36[_0x7a09('0x53')]=_0x29dc15;return _0x590f36;});}})['then'](respondWithFilteredResult(_0x143b35,_0x3aa5d1))['catch'](handleError(_0x143b35,null));};exports[_0x7a09('0x37')]=function(_0x285335,_0x205de5,_0x1a02bd){var _0x2c8e32,_0x10f565,_0x504abd;if(_[_0x7a09('0x96')](_0x285335['body'][_0x7a09('0x57')])||_0x285335[_0x7a09('0x57')][_0x7a09('0x57')]===''){throw new db[(_0x7a09('0x75'))][(_0x7a09('0x76'))](_0x7a09('0xc6'));}if(_[_0x7a09('0x96')](_0x285335[_0x7a09('0x57')]['to'])){throw new db['Sequelize'][(_0x7a09('0x76'))](_0x7a09('0xc7'));}_0x2c8e32=_0x285335['body']['to'];return db[_0x7a09('0x3a')][_0x7a09('0x55')]({'where':{'id':_0x285335[_0x7a09('0x5e')]['id']},'include':[{'model':db[_0x7a09('0x9a')],'as':_0x7a09('0xc8'),'include':[{'model':db['CmContact'],'as':_0x7a09('0x9c'),'where':{'mobile':_0x2c8e32},'limit':0x1,'order':[[_0x7a09('0x7a'),_0x7a09('0x9d')]]}]}]})[_0x7a09('0x34')](handleEntityNotFound(_0x205de5,null))[_0x7a09('0x34')](function(_0x4b4521){if(_0x4b4521&&_0x4b4521[_0x7a09('0xc8')]){_0x10f565=_0x4b4521[_0x7a09('0x59')]({'plain':!![]});if(_0x10f565[_0x7a09('0xc8')]&&_0x10f565[_0x7a09('0xc8')][_0x7a09('0x9c')][_0x7a09('0x47')]){return _0x10f565[_0x7a09('0xc8')][_0x7a09('0x9c')][0x0];}return db['CmContact']['create'](_[_0x7a09('0xa0')](_0x285335[_0x7a09('0x57')],{'firstName':_0x2c8e32,'mobile':_0x2c8e32,'phone':_0x2c8e32,'ListId':_0x10f565['ListId']}));}})[_0x7a09('0x34')](handleEntityNotFound(_0x205de5,null))[_0x7a09('0x34')](function(_0x2d9f10){if(_0x2d9f10){_0x504abd=_0x2d9f10;return db['SmsInteraction']['find']({'where':{'ContactId':_0x504abd['id'],'closed':![],'SmsAccountId':_0x10f565['id']}})[_0x7a09('0x34')](function(_0x4b23c4){if(_0x4b23c4){return[_0x4b23c4,![]];}return db[_0x7a09('0xa1')][_0x7a09('0x56')]({'UserId':_0x285335['user']['id'],'ContactId':_0x504abd['id'],'SmsAccountId':_0x10f565['id'],'phone':_0x2c8e32,'firstMsgDirection':'out','Messages':[_[_0x7a09('0x4e')](_0x285335[_0x7a09('0x57')],{'read':![],'body':_0x285335[_0x7a09('0x57')][_0x7a09('0x57')],'phone':_0x2c8e32,'SmsAccountId':_0x10f565['id'],'UserId':_0x285335[_0x7a09('0x58')]['id'],'ContactId':_0x504abd['id']})]},{'include':[{'model':db[_0x7a09('0xaa')],'as':_0x7a09('0xc9')}]})[_0x7a09('0x34')](function(_0x12b59c){return[_0x12b59c,!![]];});});}})[_0x7a09('0xa2')](function(_0x3df832,_0x5ab5c8){if(_0x5ab5c8){return _0x3df832;}return db[_0x7a09('0xaa')][_0x7a09('0x56')](_[_0x7a09('0x4e')](_0x285335[_0x7a09('0x57')],{'read':![],'body':_0x285335[_0x7a09('0x57')]['body'],'phone':_0x2c8e32,'SmsAccountId':_0x10f565['id'],'SmsInteractionId':_0x3df832['id'],'UserId':_0x285335[_0x7a09('0x58')]['id'],'ContactId':_0x504abd['id']}))[_0x7a09('0x34')](function(_0x10a035){_0x3df832[_0x7a09('0xca')][_0x7a09('0xc9')]=[];_0x3df832[_0x7a09('0xca')]['Messages'][_0x7a09('0xa5')](_0x10a035[_0x7a09('0xca')]);return _0x3df832;});})[_0x7a09('0x34')](respondWithResult(_0x205de5,null))[_0x7a09('0x24')](handleError(_0x205de5,null));};exports[_0x7a09('0x26')]=function(_0x40720e,_0x21da9a,_0x33a7fa){if(_0x40720e[_0x7a09('0x57')]['id']){delete _0x40720e['body']['id'];}var _0x18030a,_0x4cd90c,_0xae5c67;return db[_0x7a09('0x3a')][_0x7a09('0x55')]({'where':{'id':_0x40720e[_0x7a09('0x5e')]['id']}})[_0x7a09('0x34')](handleEntityNotFound(_0x21da9a,null))[_0x7a09('0x34')](function(_0x219405){if(_0x219405){_0xae5c67=_0x219405;logger['debug'](_0x7a09('0xcb'),'status',_0x7a09('0xcc'),_0x219405[_0x7a09('0x3d')],util[_0x7a09('0xcd')](_0x40720e[_0x7a09('0x57')],{'showHidden':![],'depth':null}));switch(_0x219405[_0x7a09('0x3d')]){case _0x7a09('0x82'):if(_0x40720e[_0x7a09('0x57')][_0x7a09('0xce')]&&_0x40720e[_0x7a09('0x57')]['status']){_0x4cd90c=_0x40720e['body'][_0x7a09('0x26')];return db[_0x7a09('0xaa')]['find']({'where':{'messageId':_0x40720e[_0x7a09('0x57')][_0x7a09('0xce')]}});}break;case _0x7a09('0x84'):if(_0x40720e[_0x7a09('0x57')][_0x7a09('0xcf')]&&_0x40720e['body'][_0x7a09('0xd0')]){_0x4cd90c=_0x40720e[_0x7a09('0x57')][_0x7a09('0xd0')];return db[_0x7a09('0xaa')][_0x7a09('0x55')]({'where':{'messageId':_0x40720e[_0x7a09('0x57')][_0x7a09('0xcf')]}});}break;case _0x7a09('0x85'):if(_0x40720e[_0x7a09('0x57')][_0x7a09('0x86')]&&_0x40720e[_0x7a09('0x57')][_0x7a09('0xd1')]){_0x4cd90c=_0x40720e[_0x7a09('0x57')]['status_code'];return db['SmsMessage'][_0x7a09('0x55')]({'where':{'messageId':_0x40720e[_0x7a09('0x57')][_0x7a09('0x86')]}});}break;case _0x7a09('0x8a'):var _0x1c2ffb=_0x40720e[_0x7a09('0x57')][_0x7a09('0x8b')][0x0];if(_0x1c2ffb[_0x7a09('0x80')]&&_0x1c2ffb['status'][_0x7a09('0xd2')]==='DELIVERED'){_0x4cd90c=_0x1c2ffb[_0x7a09('0x26')]['groupName'];return db[_0x7a09('0xaa')][_0x7a09('0x55')]({'where':{'messageId':_0x1c2ffb[_0x7a09('0x80')]}});}break;case _0x7a09('0x8f'):if(_0x40720e[_0x7a09('0x57')][_0x7a09('0x80')]&&_0x40720e[_0x7a09('0x57')][_0x7a09('0x26')]){_0x4cd90c=_0x40720e[_0x7a09('0x57')][_0x7a09('0x26')];return db['SmsMessage'][_0x7a09('0x55')]({'where':{'messageId':_0x40720e[_0x7a09('0x57')][_0x7a09('0x80')]}});}break;case _0x7a09('0x92'):if(_0x40720e['body'][0x0]['message']['id']){_0x4cd90c=_0x40720e[_0x7a09('0x57')][0x0][_0x7a09('0x3d')];return db['SmsMessage']['find']({'where':{'messageId':_0x40720e['body'][0x0][_0x7a09('0x21')]['id']}});}break;case _0x7a09('0x93'):if(_0x40720e[_0x7a09('0x57')][_0x7a09('0xd3')]&&_0x40720e[_0x7a09('0x57')][_0x7a09('0x26')]){_0x4cd90c=_0x40720e[_0x7a09('0x57')][_0x7a09('0x26')];return db[_0x7a09('0xaa')][_0x7a09('0x55')]({'where':{'messageId':_0x40720e[_0x7a09('0x57')]['redif']}});}break;}}})[_0x7a09('0x34')](handleEntityNotFound(_0x21da9a,null))['then'](function(_0x46e5eb){if(_0x46e5eb){_0x18030a=_0x46e5eb;switch(_0xae5c67[_0x7a09('0x3d')]){case _0x7a09('0x82'):if(_0x4cd90c==='DELIVERED'){return _0x18030a[_0x7a09('0x31')]({'read':!![]});}else{logger[_0x7a09('0x1f')](_0x7a09('0xcb'),_0x7a09('0x26'),'skebby',util['inspect'](_0x40720e[_0x7a09('0x57')],{'showHidden':![],'depth':null}));}break;case _0x7a09('0x84'):if(_0x4cd90c==='1'){return _0x18030a[_0x7a09('0x31')]({'read':!![]});}else{logger['error'](_0x7a09('0xcb'),'status','skebby',util[_0x7a09('0xcd')](_0x40720e[_0x7a09('0x57')],{'showHidden':![],'depth':null}));}break;case _0x7a09('0x85'):if(!_0x40720e[_0x7a09('0x57')][_0x7a09('0xd4')]&&_0x4cd90c>=0xc8&&_0x4cd90c<=0xce){return _0x18030a[_0x7a09('0x31')]({'read':!![]});}else{logger['error'](_0x7a09('0xcb'),'status',_0x7a09('0x85'),util['inspect'](_0x40720e[_0x7a09('0x57')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x5bbcf2=_0x40720e[_0x7a09('0x57')][_0x7a09('0x8b')][0x0];if(_0x5bbcf2[_0x7a09('0x26')][_0x7a09('0xd2')]===_0x7a09('0xd5')){return _0x18030a[_0x7a09('0x31')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x7a09('0x8a'),util[_0x7a09('0xcd')](_0x40720e[_0x7a09('0x57')],{'showHidden':![],'depth':null}));}break;case _0x7a09('0x8f'):if(_0x4cd90c==_0x7a09('0xd6')||_0x4cd90c==_0x7a09('0xd7')){return _0x18030a[_0x7a09('0x31')]({'read':!![]});}else{logger['error'](_0x7a09('0xcb'),_0x7a09('0x26'),_0x7a09('0x8f'),util[_0x7a09('0xcd')](_0x40720e[_0x7a09('0x57')],{'showHidden':![],'depth':null}));}break;case _0x7a09('0x92'):if(_0x4cd90c==_0x7a09('0xd8')){return _0x18030a[_0x7a09('0x31')]({'read':!![]});}else{logger[_0x7a09('0x1f')](_0x7a09('0xcb'),'status',_0x7a09('0x92'),util[_0x7a09('0xcd')](_0x40720e[_0x7a09('0x57')],{'showHidden':![],'depth':null}));}break;case _0x7a09('0x93'):if(_0x4cd90c===_0x7a09('0xd9')||_0x4cd90c==='ACCEPTD'){return _0x18030a['update']({'read':!![]});}else{logger[_0x7a09('0x1f')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7a09('0x26'),_0x7a09('0x93'),util[_0x7a09('0xcd')](_0x40720e[_0x7a09('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x18030a;}})[_0x7a09('0x34')](respondWithResult(_0x21da9a,null))[_0x7a09('0x24')](handleError(_0x21da9a,null));};exports['statusGet']=function(_0x39d38c,_0x401677,_0x13bfef){var _0x358fc6,_0x8672ca,_0x23e519;return db[_0x7a09('0x3a')][_0x7a09('0x55')]({'where':{'id':_0x39d38c['params']['id']}})[_0x7a09('0x34')](handleEntityNotFound(_0x401677,null))[_0x7a09('0x34')](function(_0x3dd104){if(_0x3dd104){_0x23e519=_0x3dd104;logger[_0x7a09('0xb2')](_0x7a09('0xcb'),_0x7a09('0x26'),_0x7a09('0xcc'),_0x3dd104['type'],util[_0x7a09('0xcd')](_0x39d38c[_0x7a09('0x41')],{'showHidden':![],'depth':null}));switch(_0x3dd104[_0x7a09('0x3d')]){case _0x7a09('0x8c'):if(_0x39d38c[_0x7a09('0x41')]['message-id']&&_0x39d38c[_0x7a09('0x41')][_0x7a09('0xda')]){_0x8672ca=_0x39d38c['query']['state'];return db[_0x7a09('0xaa')][_0x7a09('0x55')]({'where':{'messageId':_0x39d38c[_0x7a09('0x41')][_0x7a09('0xdb')]}});}break;}}})[_0x7a09('0x34')](handleEntityNotFound(_0x401677,null))['then'](function(_0x3fdb1b){if(_0x3fdb1b){_0x358fc6=_0x3fdb1b;switch(_0x23e519[_0x7a09('0x3d')]){case'csc':if(_0x8672ca==='2'||_0x8672ca==='6'){return _0x358fc6[_0x7a09('0x31')]({'read':!![]});}else{logger[_0x7a09('0x1f')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7a09('0x26'),'csc',util['inspect'](_0x39d38c[_0x7a09('0x41')],{'showHidden':![],'depth':null}));};break;}return _0x358fc6;}})[_0x7a09('0x34')](respondWithResult(_0x401677,null))[_0x7a09('0x24')](handleError(_0x401677,null));};exports[_0x7a09('0xdc')]=function(_0x29d832,_0x28b1f3,_0x6be6de){return db[_0x7a09('0x3a')][_0x7a09('0x55')]({'where':{'id':_0x29d832['params']['id']}})[_0x7a09('0x34')](handleEntityNotFound(_0x28b1f3,null))['then'](function(_0x2b5523){if(_0x2b5523){return _0x2b5523[_0x7a09('0xdc')](_0x29d832['body'][_0x7a09('0x6d')],_[_0x7a09('0x9f')](_0x29d832[_0x7a09('0x57')],[_0x7a09('0x6d'),'id'])||{})[_0x7a09('0xa2')](function(_0xc04aa1){for(var _0x13e277=0x0;_0x13e277<_0x29d832[_0x7a09('0x57')][_0x7a09('0x6d')][_0x7a09('0x47')];_0x13e277+=0x1){socket['emit'](_0x7a09('0xdd'),{'UserId':Number(_0x29d832['body'][_0x7a09('0x6d')][_0x13e277]),'SmsAccountId':Number(_0x29d832[_0x7a09('0x5e')]['id'])});}return _0xc04aa1;});}})[_0x7a09('0x34')](respondWithResult(_0x28b1f3,null))['catch'](handleError(_0x28b1f3,null));};exports['removeAgents']=function(_0x13c314,_0xf24620,_0xf51c31){return db[_0x7a09('0x3a')][_0x7a09('0x55')]({'where':{'id':_0x13c314[_0x7a09('0x5e')]['id']}})[_0x7a09('0x34')](handleEntityNotFound(_0xf24620,null))[_0x7a09('0x34')](function(_0x8c0843){if(_0x8c0843){return _0x8c0843[_0x7a09('0xde')](_0x13c314[_0x7a09('0x41')][_0x7a09('0x6d')])[_0x7a09('0x34')](function(){if(_[_0x7a09('0xdf')](_0x13c314['query'][_0x7a09('0x6d')])){for(var _0x13c26f=0x0;_0x13c26f<_0x13c314[_0x7a09('0x41')]['ids'][_0x7a09('0x47')];_0x13c26f+=0x1){socket[_0x7a09('0xe0')](_0x7a09('0xe1'),{'UserId':Number(_0x13c314['query']['ids'][_0x13c26f]),'SmsAccountId':Number(_0x13c314[_0x7a09('0x5e')]['id'])});}}else{socket['emit'](_0x7a09('0xe1'),{'UserId':Number(_0x13c314[_0x7a09('0x41')][_0x7a09('0x6d')]),'SmsAccountId':Number(_0x13c314['params']['id'])});}});}})[_0x7a09('0x34')](respondWithStatusCode(_0xf24620,null))[_0x7a09('0x24')](handleError(_0xf24620,null));};exports[_0x7a09('0xe2')]=function(_0x1c75d3,_0x4c261e,_0x23bb41){var _0x460095={};var _0x8fb14a={};var _0x2ef6b5;var _0x5894e2;return db[_0x7a09('0x3a')][_0x7a09('0x64')]({'where':{'id':_0x1c75d3[_0x7a09('0x5e')]['id']}})['then'](handleEntityNotFound(_0x4c261e,null))[_0x7a09('0x34')](function(_0x2454a3){if(_0x2454a3){_0x2ef6b5=_0x2454a3;_0x8fb14a[_0x7a09('0x3f')]=_[_0x7a09('0x42')](db[_0x7a09('0xc0')][_0x7a09('0x3b')]);_0x8fb14a['query']=_[_0x7a09('0x42')](_0x1c75d3[_0x7a09('0x41')]);_0x8fb14a[_0x7a09('0x43')]=_[_0x7a09('0x44')](_0x8fb14a[_0x7a09('0x3f')],_0x8fb14a[_0x7a09('0x41')]);_0x460095[_0x7a09('0x45')]=_[_0x7a09('0x44')](_0x8fb14a[_0x7a09('0x3f')],qs[_0x7a09('0x46')](_0x1c75d3[_0x7a09('0x41')][_0x7a09('0x46')]));_0x460095[_0x7a09('0x45')]=_0x460095['attributes'][_0x7a09('0x47')]?_0x460095[_0x7a09('0x45')]:_0x8fb14a[_0x7a09('0x3f')];_0x460095['order']=qs[_0x7a09('0x4b')](_0x1c75d3['query'][_0x7a09('0x4b')]);_0x460095['where']=qs[_0x7a09('0x43')](_[_0x7a09('0x4c')](_0x1c75d3['query'],_0x8fb14a[_0x7a09('0x43')]));if(_0x1c75d3[_0x7a09('0x41')]['filter']){_0x460095[_0x7a09('0x4d')]=_[_0x7a09('0x4e')](_0x460095['where'],{'$or':_['map'](_0x460095['attributes'],function(_0x4cdd68){var _0x26b4d9={};_0x26b4d9[_0x4cdd68]={'$like':'%'+_0x1c75d3[_0x7a09('0x41')][_0x7a09('0x66')]+'%'};return _0x26b4d9;})});}_0x460095=_[_0x7a09('0x4e')]({},_0x460095,_0x1c75d3[_0x7a09('0x50')]);return _0x2ef6b5[_0x7a09('0xe2')](_0x460095);}})[_0x7a09('0x34')](function(_0x1f7bdb){if(_0x1f7bdb){_0x5894e2=_0x1f7bdb['length'];if(!_0x1c75d3['query'][_0x7a09('0x48')](_0x7a09('0x49'))){_0x460095[_0x7a09('0x2b')]=qs[_0x7a09('0x2b')](_0x1c75d3[_0x7a09('0x41')][_0x7a09('0x2b')]);_0x460095[_0x7a09('0x29')]=qs['offset'](_0x1c75d3['query'][_0x7a09('0x29')]);}return _0x2ef6b5[_0x7a09('0xe2')](_0x460095);}})[_0x7a09('0x34')](function(_0x25dded){if(_0x25dded){return _0x25dded?{'count':_0x5894e2,'rows':_0x25dded}:null;}})['then'](respondWithResult(_0x4c261e,null))['catch'](handleError(_0x4c261e,null));}; \ No newline at end of file +var _0x1957=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','redis','defaults','./smsAccount.socket','register','http','request','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','save','then','SmsAccounts','UserProfileResource','destroy','end','stack','name','send','mandatoryDispositionPause','map','SmsAccount','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','Pause','options','find','create','body','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','SmsAccountId','Disposition','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','ids','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','sender','text','connectel','clicksend','message_id','plivo','infobip','results','originatingAddress','segmentedMessage','clickatell','fromNumber','bandwidth','intelepeer','refid','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','Contacts','DESC','list','omit','contact','SmsInteraction','interaction','created','autoclose','unmanaged','*,*,*,*','SmsMessage','ContactId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','\x0a','sequelize','transaction','Transaction','READ_COMMITTED','findOne','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','spread','dataValues','Messages','push','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','DELIVERED','groupName','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','statusGet','csc','message-id','state','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x272156,_0x5e4b0d){var _0x1071d0=function(_0x5f1f6b){while(--_0x5f1f6b){_0x272156['push'](_0x272156['shift']());}};_0x1071d0(++_0x5e4b0d);}(_0x1957,0xd2));var _0x7195=function(_0xa20971,_0x1bf32c){_0xa20971=_0xa20971-0x0;var _0x4f4271=_0x1957[_0xa20971];return _0x4f4271;};'use strict';var emlformat=require(_0x7195('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7195('0x1'));var jsonpatch=require(_0x7195('0x2'));var rp=require(_0x7195('0x3'));var moment=require(_0x7195('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x7195('0x5'));var sox=require(_0x7195('0x6'));var csv=require(_0x7195('0x7'));var ejs=require(_0x7195('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7195('0x9'));var squel=require(_0x7195('0xa'));var crypto=require(_0x7195('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7195('0xc'));var toCsv=require(_0x7195('0x7'));var querystring=require(_0x7195('0xd'));var Papa=require(_0x7195('0xe'));var Redis=require(_0x7195('0xf'));var authService=require(_0x7195('0x10'));var qs=require(_0x7195('0x11'));var as=require(_0x7195('0x12'));var hardwareService=require(_0x7195('0x13'));var logger=require(_0x7195('0x14'))(_0x7195('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x7195('0x16')]=_[_0x7195('0x17')](config[_0x7195('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7195('0x16')]));require(_0x7195('0x18'))[_0x7195('0x19')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x7195('0x1a')]({'port':0x232c});function respondWithRpcPromise(_0x4d86da,_0x36cbff,_0x8404a4,_0x1d0594){return new BPromise(function(_0x451948,_0x351c36){var _0x33a652=_0x1d0594||client;return _0x33a652[_0x7195('0x1b')](_0x4d86da,_0x8404a4)['then'](function(_0x2f2966){logger[_0x7195('0x1c')](_0x7195('0x1d'),_0x36cbff,'request\x20sent');logger[_0x7195('0x1e')](_0x7195('0x1f'),_0x36cbff,_0x7195('0x20'),JSON[_0x7195('0x21')](_0x2f2966));if(_0x2f2966['error']){if(_0x2f2966[_0x7195('0x22')][_0x7195('0x23')]===0x1f4){logger[_0x7195('0x22')]('SmsAccount,\x20%s,\x20%s',_0x36cbff,_0x2f2966[_0x7195('0x22')][_0x7195('0x24')]);return _0x351c36(_0x2f2966['error'][_0x7195('0x24')]);}logger['error'](_0x7195('0x1d'),_0x36cbff,_0x2f2966['error'][_0x7195('0x24')]);return _0x451948(_0x2f2966[_0x7195('0x22')][_0x7195('0x24')]);}else{logger[_0x7195('0x1c')](_0x7195('0x1d'),_0x36cbff,_0x7195('0x20'));_0x451948(_0x2f2966['result']['message']);}})[_0x7195('0x25')](function(_0x48d621){logger[_0x7195('0x22')](_0x7195('0x1d'),_0x36cbff,_0x48d621);_0x351c36(_0x48d621);});});}function respondWithStatusCode(_0x3a6c70,_0x140b55){_0x140b55=_0x140b55||0xcc;return function(_0x449455){if(_0x449455){return _0x3a6c70[_0x7195('0x26')](_0x140b55);}return _0x3a6c70[_0x7195('0x27')](_0x140b55)['end']();};}function respondWithResult(_0x5af62b,_0x4df0d0){_0x4df0d0=_0x4df0d0||0xc8;return function(_0x5761cc){if(_0x5761cc){return _0x5af62b[_0x7195('0x27')](_0x4df0d0)[_0x7195('0x28')](_0x5761cc);}};}function respondWithFilteredResult(_0xf7f3b8,_0x187988){return function(_0x15401d){if(_0x15401d){var _0x4f0bfd=typeof _0x187988['offset']===_0x7195('0x29')&&typeof _0x187988[_0x7195('0x2a')]==='undefined';var _0x151802=_0x15401d[_0x7195('0x2b')];var _0x12bbaa=_0x4f0bfd?0x0:_0x187988['offset'];var _0x137ecc=_0x4f0bfd?_0x15401d['count']:_0x187988[_0x7195('0x2c')]+_0x187988[_0x7195('0x2a')];var _0x2b1804;if(_0x137ecc>=_0x151802){_0x137ecc=_0x151802;_0x2b1804=0xc8;}else{_0x2b1804=0xce;}_0xf7f3b8['status'](_0x2b1804);return _0xf7f3b8[_0x7195('0x2d')](_0x7195('0x2e'),_0x12bbaa+'-'+_0x137ecc+'/'+_0x151802)[_0x7195('0x28')](_0x15401d);}return null;};}function patchUpdates(_0x3491f3){return function(_0x4aff2b){try{jsonpatch['apply'](_0x4aff2b,_0x3491f3,!![]);}catch(_0x17211a){return BPromise['reject'](_0x17211a);}return _0x4aff2b[_0x7195('0x2f')]();};}function saveUpdates(_0x2ca3bc,_0x1ead97){return function(_0x3437f8){if(_0x3437f8){return _0x3437f8['update'](_0x2ca3bc)[_0x7195('0x30')](function(_0x56ddfe){return _0x56ddfe;});}return null;};}function removeEntity(_0x298756,_0x333fb1){return function(_0x2b1e4b){if(_0x2b1e4b){return _0x2b1e4b['destroy']()['then'](function(){var _0x329220=_0x2b1e4b['get']({'plain':!![]});var _0xf98cc8=_0x7195('0x31');return db[_0x7195('0x32')][_0x7195('0x33')]({'where':{'type':_0xf98cc8,'resourceId':_0x329220['id']}})['then'](function(){return _0x2b1e4b;});})[_0x7195('0x30')](function(){_0x298756[_0x7195('0x27')](0xcc)[_0x7195('0x34')]();});}};}function handleEntityNotFound(_0x2bb385,_0x2801f7){return function(_0x258e66){if(!_0x258e66){_0x2bb385[_0x7195('0x26')](0x194);}return _0x258e66;};}function handleError(_0x61442b,_0x57a74b){_0x57a74b=_0x57a74b||0x1f4;return function(_0x44ff44){logger[_0x7195('0x22')](_0x44ff44[_0x7195('0x35')]);if(_0x44ff44[_0x7195('0x36')]){delete _0x44ff44[_0x7195('0x36')];}_0x61442b['status'](_0x57a74b)[_0x7195('0x37')](_0x44ff44);};}exports['index']=function(_0x56681c,_0x521720){var _0x4dea6b={'include':[{'model':db['Pause'],'as':_0x7195('0x38')}]},_0x15dae7={},_0x98436d={'count':0x0,'rows':[]};var _0xf14f83=_[_0x7195('0x39')](db[_0x7195('0x3a')][_0x7195('0x3b')],function(_0x148332){return{'name':_0x148332['fieldName'],'type':_0x148332['type'][_0x7195('0x3c')]};});_0x15dae7[_0x7195('0x3d')]=_[_0x7195('0x39')](_0xf14f83,'name');_0x15dae7[_0x7195('0x3e')]=_[_0x7195('0x3f')](_0x56681c[_0x7195('0x3e')]);_0x15dae7[_0x7195('0x40')]=_[_0x7195('0x41')](_0x15dae7[_0x7195('0x3d')],_0x15dae7[_0x7195('0x3e')]);_0x4dea6b[_0x7195('0x42')]=_['intersection'](_0x15dae7[_0x7195('0x3d')],qs['fields'](_0x56681c[_0x7195('0x3e')][_0x7195('0x43')]));_0x4dea6b[_0x7195('0x42')]=_0x4dea6b[_0x7195('0x42')][_0x7195('0x44')]?_0x4dea6b[_0x7195('0x42')]:_0x15dae7['model'];if(!_0x56681c[_0x7195('0x3e')][_0x7195('0x45')](_0x7195('0x46'))){_0x4dea6b[_0x7195('0x2a')]=qs[_0x7195('0x2a')](_0x56681c[_0x7195('0x3e')][_0x7195('0x2a')]);_0x4dea6b[_0x7195('0x2c')]=qs[_0x7195('0x2c')](_0x56681c[_0x7195('0x3e')][_0x7195('0x2c')]);}_0x4dea6b[_0x7195('0x47')]=qs[_0x7195('0x48')](_0x56681c['query']['sort']);_0x4dea6b[_0x7195('0x49')]=qs[_0x7195('0x40')](_[_0x7195('0x4a')](_0x56681c[_0x7195('0x3e')],_0x15dae7[_0x7195('0x40')]),_0xf14f83);if(_0x56681c[_0x7195('0x3e')][_0x7195('0x4b')]){_0x4dea6b[_0x7195('0x49')]=_[_0x7195('0x4c')](_0x4dea6b['where'],{'$or':_[_0x7195('0x39')](_0xf14f83,function(_0x44b8cc){if(_0x44b8cc[_0x7195('0x4d')]!==_0x7195('0x4e')){var _0x4b16d0={};_0x4b16d0[_0x44b8cc[_0x7195('0x36')]]={'$like':'%'+_0x56681c['query'][_0x7195('0x4b')]+'%'};return _0x4b16d0;}})});}_0x4dea6b=_[_0x7195('0x4c')]({},_0x4dea6b,_0x56681c['options']);var _0x1dd366={'where':_0x4dea6b['where']};return db[_0x7195('0x3a')]['count'](_0x1dd366)[_0x7195('0x30')](function(_0x40193a){_0x98436d['count']=_0x40193a;if(_0x56681c['query'][_0x7195('0x4f')]){_0x4dea6b[_0x7195('0x50')]=[{'all':!![]}];}return db[_0x7195('0x3a')][_0x7195('0x51')](_0x4dea6b);})[_0x7195('0x30')](function(_0x3288dd){_0x98436d[_0x7195('0x52')]=_0x3288dd;return _0x98436d;})[_0x7195('0x30')](respondWithFilteredResult(_0x521720,_0x4dea6b))[_0x7195('0x25')](handleError(_0x521720,null));};exports[_0x7195('0x53')]=function(_0x20d83f,_0x62a358){var _0x4101ce={'raw':![],'where':{'id':_0x20d83f['params']['id']},'include':[{'model':db[_0x7195('0x54')],'as':_0x7195('0x38')}]},_0xbea026={};_0xbea026['model']=_[_0x7195('0x3f')](db[_0x7195('0x3a')][_0x7195('0x3b')]);_0xbea026[_0x7195('0x3e')]=_[_0x7195('0x3f')](_0x20d83f['query']);_0xbea026[_0x7195('0x40')]=_[_0x7195('0x41')](_0xbea026['model'],_0xbea026[_0x7195('0x3e')]);_0x4101ce['attributes']=_[_0x7195('0x41')](_0xbea026['model'],qs[_0x7195('0x43')](_0x20d83f[_0x7195('0x3e')][_0x7195('0x43')]));_0x4101ce[_0x7195('0x42')]=_0x4101ce['attributes']['length']?_0x4101ce['attributes']:_0xbea026[_0x7195('0x3d')];if(_0x20d83f[_0x7195('0x3e')][_0x7195('0x4f')]){_0x4101ce['include']=[{'all':!![]}];}_0x4101ce=_[_0x7195('0x4c')]({},_0x4101ce,_0x20d83f[_0x7195('0x55')]);return db[_0x7195('0x3a')][_0x7195('0x56')](_0x4101ce)[_0x7195('0x30')](handleEntityNotFound(_0x62a358,null))[_0x7195('0x30')](respondWithResult(_0x62a358,null))[_0x7195('0x25')](handleError(_0x62a358,null));};exports[_0x7195('0x57')]=function(_0x71d617,_0x51c36d){return db[_0x7195('0x3a')][_0x7195('0x57')](_0x71d617[_0x7195('0x58')],{})[_0x7195('0x30')](function(_0x156f84){var _0x3ede24=_0x71d617['user']['get']({'plain':!![]});if(!_0x3ede24)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ede24['role']===_0x7195('0x59')){var _0x1c8ed5=_0x156f84[_0x7195('0x5a')]({'plain':!![]});var _0x18e255=_0x7195('0x31');return db[_0x7195('0x5b')][_0x7195('0x56')]({'where':{'name':_0x18e255,'userProfileId':_0x3ede24['userProfileId']},'raw':!![]})[_0x7195('0x30')](function(_0x2618be){if(_0x2618be&&_0x2618be[_0x7195('0x5c')]===0x0){return db[_0x7195('0x32')][_0x7195('0x57')]({'name':_0x1c8ed5['name'],'resourceId':_0x1c8ed5['id'],'type':_0x2618be[_0x7195('0x36')],'sectionId':_0x2618be['id']},{})[_0x7195('0x30')](function(){return _0x156f84;});}else{return _0x156f84;}})[_0x7195('0x25')](function(_0x1cad67){logger[_0x7195('0x22')](_0x7195('0x5d'),_0x1cad67);throw _0x1cad67;});}return _0x156f84;})[_0x7195('0x30')](respondWithResult(_0x51c36d,0xc9))['catch'](handleError(_0x51c36d,null));};exports[_0x7195('0x5e')]=function(_0x56a5af,_0x4f5aec){if(_0x56a5af[_0x7195('0x58')]['id']){delete _0x56a5af['body']['id'];}return db[_0x7195('0x3a')][_0x7195('0x56')]({'where':{'id':_0x56a5af[_0x7195('0x5f')]['id']},'include':[{'model':db[_0x7195('0x54')],'as':'mandatoryDispositionPause'}]})[_0x7195('0x30')](handleEntityNotFound(_0x4f5aec,null))[_0x7195('0x30')](saveUpdates(_0x56a5af[_0x7195('0x58')],null))['then'](respondWithResult(_0x4f5aec,null))[_0x7195('0x25')](handleError(_0x4f5aec,null));};exports['destroy']=function(_0xadd80a,_0x48a6f9){return db[_0x7195('0x3a')]['find']({'where':{'id':_0xadd80a['params']['id']}})[_0x7195('0x30')](handleEntityNotFound(_0x48a6f9,null))['then'](removeEntity(_0x48a6f9,null))[_0x7195('0x25')](handleError(_0x48a6f9,null));};exports['describe']=function(_0x54433b,_0x169db4){return db['SmsAccount'][_0x7195('0x60')]()[_0x7195('0x30')](respondWithResult(_0x169db4,null))['catch'](handleError(_0x169db4,null));};exports[_0x7195('0x61')]=function(_0x13ae19,_0x3029cd,_0xc95f1c){if(_0x13ae19[_0x7195('0x58')]['id']){delete _0x13ae19['body']['id'];}return db[_0x7195('0x3a')][_0x7195('0x56')]({'where':{'id':_0x13ae19[_0x7195('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3029cd,null))['then'](function(_0x4f7c6a){if(_0x4f7c6a){_0x13ae19[_0x7195('0x58')][_0x7195('0x62')]=_0x4f7c6a['id'];return db[_0x7195('0x63')][_0x7195('0x57')](_0x13ae19['body']);}})[_0x7195('0x30')](respondWithResult(_0x3029cd,null))[_0x7195('0x25')](handleError(_0x3029cd,null));};exports['getDispositions']=function(_0x301329,_0x4c6871,_0x53109e){var _0x221e63={'raw':![],'where':{}};var _0x24dac6={};var _0x59a78c={'count':0x0,'rows':[]};return db[_0x7195('0x3a')]['findOne']({'where':{'id':_0x301329['params']['id']}})[_0x7195('0x30')](handleEntityNotFound(_0x4c6871,null))[_0x7195('0x30')](function(_0x527566){if(_0x527566){_0x24dac6[_0x7195('0x3d')]=_[_0x7195('0x3f')](db[_0x7195('0x63')][_0x7195('0x3b')]);_0x24dac6['query']=_[_0x7195('0x3f')](_0x301329[_0x7195('0x3e')]);_0x24dac6[_0x7195('0x40')]=_[_0x7195('0x41')](_0x24dac6[_0x7195('0x3d')],_0x24dac6['query']);_0x221e63[_0x7195('0x42')]=_[_0x7195('0x41')](_0x24dac6[_0x7195('0x3d')],qs['fields'](_0x301329['query'][_0x7195('0x43')]));_0x221e63['attributes']=_0x221e63['attributes'][_0x7195('0x44')]?_0x221e63[_0x7195('0x42')]:_0x24dac6[_0x7195('0x3d')];if(!_0x301329[_0x7195('0x3e')]['hasOwnProperty'](_0x7195('0x46'))){_0x221e63[_0x7195('0x2a')]=qs[_0x7195('0x2a')](_0x301329[_0x7195('0x3e')][_0x7195('0x2a')]);_0x221e63['offset']=qs[_0x7195('0x2c')](_0x301329['query'][_0x7195('0x2c')]);}_0x221e63[_0x7195('0x47')]=qs[_0x7195('0x48')](_0x301329['query'][_0x7195('0x48')]);_0x221e63['where']=qs[_0x7195('0x40')](_[_0x7195('0x4a')](_0x301329[_0x7195('0x3e')],_0x24dac6['filters']));_0x221e63[_0x7195('0x49')][_0x7195('0x62')]=_0x527566['id'];if(_0x301329[_0x7195('0x3e')]['filter']){_0x221e63[_0x7195('0x49')]=_[_0x7195('0x4c')](_0x221e63[_0x7195('0x49')],{'$or':_[_0x7195('0x39')](_0x221e63[_0x7195('0x42')],function(_0x2aad85){var _0x1328d5={};_0x1328d5[_0x2aad85]={'$like':'%'+_0x301329[_0x7195('0x3e')][_0x7195('0x4b')]+'%'};return _0x1328d5;})});}_0x221e63=_[_0x7195('0x4c')]({},_0x221e63,_0x301329[_0x7195('0x55')]);return db['Disposition'][_0x7195('0x2b')]({'where':_0x221e63['where']})[_0x7195('0x30')](function(_0x108443){_0x59a78c[_0x7195('0x2b')]=_0x108443;if(_0x301329[_0x7195('0x3e')][_0x7195('0x4f')]){_0x221e63['include']=[{'all':!![]}];}return db[_0x7195('0x63')][_0x7195('0x51')](_0x221e63);})['then'](function(_0x128f85){_0x59a78c['rows']=_0x128f85;return _0x59a78c;});}})[_0x7195('0x30')](respondWithFilteredResult(_0x4c6871,_0x221e63))[_0x7195('0x25')](handleError(_0x4c6871,null));};exports[_0x7195('0x64')]=function(_0x322813,_0x2fff71,_0x4e8a69){return db[_0x7195('0x3a')]['find']({'where':{'id':_0x322813[_0x7195('0x5f')]['id']}})[_0x7195('0x30')](handleEntityNotFound(_0x2fff71,null))[_0x7195('0x30')](function(_0x1beaa4){if(_0x1beaa4){return _0x1beaa4[_0x7195('0x64')](_0x322813['query']['ids']);}})['then'](respondWithStatusCode(_0x2fff71,null))[_0x7195('0x25')](handleError(_0x2fff71,null));};exports[_0x7195('0x65')]=function(_0x5d8674,_0x1fac41,_0x32bd83){if(_0x5d8674[_0x7195('0x58')]['id']){delete _0x5d8674[_0x7195('0x58')]['id'];}return db['SmsAccount'][_0x7195('0x56')]({'where':{'id':_0x5d8674[_0x7195('0x5f')]['id']}})[_0x7195('0x30')](handleEntityNotFound(_0x1fac41,null))[_0x7195('0x30')](function(_0x1c5bde){if(_0x1c5bde){_0x5d8674['body'][_0x7195('0x62')]=_0x1c5bde['id'];return db['CannedAnswer'][_0x7195('0x57')](_0x5d8674[_0x7195('0x58')]);}})[_0x7195('0x30')](respondWithResult(_0x1fac41,null))[_0x7195('0x25')](handleError(_0x1fac41,null));};exports[_0x7195('0x66')]=function(_0x36b63f,_0x2e707b,_0x1690be){var _0xc03c16={'raw':![],'where':{}};var _0x3549db={};var _0x556cb9={'count':0x0,'rows':[]};return db[_0x7195('0x3a')]['findOne']({'where':{'id':_0x36b63f[_0x7195('0x5f')]['id']}})[_0x7195('0x30')](handleEntityNotFound(_0x2e707b,null))[_0x7195('0x30')](function(_0x3494a3){if(_0x3494a3){_0x3549db[_0x7195('0x3d')]=_['keys'](db[_0x7195('0x67')]['rawAttributes']);_0x3549db[_0x7195('0x3e')]=_[_0x7195('0x3f')](_0x36b63f[_0x7195('0x3e')]);_0x3549db['filters']=_[_0x7195('0x41')](_0x3549db[_0x7195('0x3d')],_0x3549db[_0x7195('0x3e')]);_0xc03c16[_0x7195('0x42')]=_[_0x7195('0x41')](_0x3549db[_0x7195('0x3d')],qs[_0x7195('0x43')](_0x36b63f['query'][_0x7195('0x43')]));_0xc03c16[_0x7195('0x42')]=_0xc03c16['attributes'][_0x7195('0x44')]?_0xc03c16[_0x7195('0x42')]:_0x3549db[_0x7195('0x3d')];if(!_0x36b63f[_0x7195('0x3e')]['hasOwnProperty']('nolimit')){_0xc03c16[_0x7195('0x2a')]=qs[_0x7195('0x2a')](_0x36b63f[_0x7195('0x3e')][_0x7195('0x2a')]);_0xc03c16[_0x7195('0x2c')]=qs[_0x7195('0x2c')](_0x36b63f[_0x7195('0x3e')]['offset']);}_0xc03c16[_0x7195('0x47')]=qs[_0x7195('0x48')](_0x36b63f[_0x7195('0x3e')][_0x7195('0x48')]);_0xc03c16[_0x7195('0x49')]=qs['filters'](_[_0x7195('0x4a')](_0x36b63f[_0x7195('0x3e')],_0x3549db[_0x7195('0x40')]));_0xc03c16[_0x7195('0x49')][_0x7195('0x62')]=_0x3494a3['id'];if(_0x36b63f[_0x7195('0x3e')]['filter']){_0xc03c16[_0x7195('0x49')]=_[_0x7195('0x4c')](_0xc03c16[_0x7195('0x49')],{'$or':_[_0x7195('0x39')](_0xc03c16[_0x7195('0x42')],function(_0x564645){var _0x447cfa={};_0x447cfa[_0x564645]={'$like':'%'+_0x36b63f[_0x7195('0x3e')][_0x7195('0x4b')]+'%'};return _0x447cfa;})});}_0xc03c16=_[_0x7195('0x4c')]({},_0xc03c16,_0x36b63f[_0x7195('0x55')]);return db['CannedAnswer'][_0x7195('0x2b')]({'where':_0xc03c16['where']})[_0x7195('0x30')](function(_0x43ae8e){_0x556cb9[_0x7195('0x2b')]=_0x43ae8e;if(_0x36b63f['query'][_0x7195('0x4f')]){_0xc03c16[_0x7195('0x50')]=[{'all':!![]}];}return db['CannedAnswer'][_0x7195('0x51')](_0xc03c16);})[_0x7195('0x30')](function(_0x179324){_0x556cb9[_0x7195('0x52')]=_0x179324;return _0x556cb9;});}})[_0x7195('0x30')](respondWithFilteredResult(_0x2e707b,_0xc03c16))[_0x7195('0x25')](handleError(_0x2e707b,null));};exports[_0x7195('0x68')]=function(_0x13acd1,_0xf51b74,_0x4e7c37){return db[_0x7195('0x3a')][_0x7195('0x56')]({'where':{'id':_0x13acd1['params']['id']}})[_0x7195('0x30')](handleEntityNotFound(_0xf51b74,null))['then'](function(_0x13e7f0){if(_0x13e7f0){return _0x13e7f0[_0x7195('0x68')](_0x13acd1[_0x7195('0x3e')][_0x7195('0x69')]);}})[_0x7195('0x30')](respondWithStatusCode(_0xf51b74,null))[_0x7195('0x25')](handleError(_0xf51b74,null));};exports[_0x7195('0x6a')]=function(_0x527c09,_0x40e537,_0x1947ee){var _0x3335b6={'channel':_0x7195('0x6b')};var _0x399196=[];var _0x10fff3=[];var _0x17ec10={};return db[_0x7195('0x3a')][_0x7195('0x56')]({'where':{'id':_0x527c09[_0x7195('0x5f')]['id']},'include':[{'model':db[_0x7195('0x6c')],'as':_0x7195('0x6d')}]})[_0x7195('0x30')](handleEntityNotFound(_0x40e537,null))['then'](function(_0x2641d0){_0x3335b6[_0x7195('0x6e')]=_0x2641d0;_0x3335b6[_0x7195('0x6f')]=_[_0x7195('0x70')](_0x2641d0[_0x7195('0x6d')],[_0x7195('0x71')],['asc']);if(_0x3335b6[_0x7195('0x6e')]['Applications']){delete _0x3335b6[_0x7195('0x6e')][_0x7195('0x6d')];}return db[_0x7195('0x72')][_0x7195('0x60')]();})[_0x7195('0x30')](function(_0x596502){if(!_0x596502){throw new db[(_0x7195('0x73'))][(_0x7195('0x74'))](_0x7195('0x75'));}_0x399196=_[_0x7195('0x76')](_[_0x7195('0x3f')](_0x596502),[_0x7195('0x77'),_0x7195('0x78')]);_0x10fff3=_['difference'](_[_0x7195('0x3f')](_0x596502),[_0x7195('0x77'),_0x7195('0x78'),_0x7195('0x79'),_0x7195('0x7a')]);_0x3335b6[_0x7195('0x58')]={'mapKey':_0x7195('0x7b')};if(_0x3335b6[_0x7195('0x6e')][_0x7195('0x4d')]){switch(_0x3335b6[_0x7195('0x6e')][_0x7195('0x4d')]){case _0x7195('0x7c'):_0x3335b6['body'][_0x7195('0x7d')]=_0x527c09[_0x7195('0x58')][_0x7195('0x7e')];_0x3335b6[_0x7195('0x58')][_0x7195('0x58')]=_0x527c09[_0x7195('0x58')][_0x7195('0x7f')];_0x3335b6[_0x7195('0x58')][_0x7195('0x80')]=_0x527c09['body'][_0x7195('0x81')];break;case _0x7195('0x82'):_0x3335b6['body'][_0x7195('0x7d')]='+'+_0x527c09[_0x7195('0x58')][_0x7195('0x83')];_0x3335b6[_0x7195('0x58')]['body']=_0x527c09[_0x7195('0x58')][_0x7195('0x84')];break;case _0x7195('0x85'):_0x3335b6['body'][_0x7195('0x7d')]=_0x527c09['body'][_0x7195('0x7d')];_0x3335b6['body'][_0x7195('0x58')]=_0x527c09[_0x7195('0x58')][_0x7195('0x24')];break;case _0x7195('0x86'):_0x3335b6[_0x7195('0x58')]['from']=_0x527c09['body'][_0x7195('0x7d')];_0x3335b6[_0x7195('0x58')][_0x7195('0x58')]=_0x527c09['body'][_0x7195('0x58')];_0x3335b6['body']['messageId']=_0x527c09['body'][_0x7195('0x87')];break;case _0x7195('0x88'):_0x3335b6[_0x7195('0x58')][_0x7195('0x7d')]=_0x527c09[_0x7195('0x58')]['From'];_0x3335b6['body'][_0x7195('0x58')]=_0x527c09['body']['Text'];_0x3335b6[_0x7195('0x58')][_0x7195('0x80')]=_0x527c09[_0x7195('0x58')]['MessageUUID'];break;case _0x7195('0x89'):_0x3335b6[_0x7195('0x58')][_0x7195('0x7d')]='+'+_0x527c09[_0x7195('0x58')][_0x7195('0x8a')][0x0]['from'];_0x3335b6[_0x7195('0x58')]['body']=_0x527c09[_0x7195('0x58')][_0x7195('0x8a')][0x0][_0x7195('0x84')];_0x3335b6[_0x7195('0x58')][_0x7195('0x80')]=_0x527c09[_0x7195('0x58')][_0x7195('0x8a')][0x0]['messageId'];break;case'csc':_0x3335b6['body'][_0x7195('0x7d')]=_0x527c09[_0x7195('0x58')][_0x7195('0x8b')];_0x3335b6[_0x7195('0x58')][_0x7195('0x58')]=_0x527c09['body'][_0x7195('0x8c')][_0x7195('0x24')];break;case _0x7195('0x8d'):_0x3335b6['body'][_0x7195('0x7d')]=_0x527c09[_0x7195('0x58')][_0x7195('0x8e')];_0x3335b6[_0x7195('0x58')][_0x7195('0x58')]=_0x527c09['body'][_0x7195('0x84')];_0x3335b6[_0x7195('0x58')]['messageId']=_0x527c09[_0x7195('0x58')]['replyMessageId'];break;case _0x7195('0x8f'):_0x3335b6[_0x7195('0x58')]['messageId']=_0x527c09[_0x7195('0x58')][0x0][_0x7195('0x24')]['id'];_0x3335b6[_0x7195('0x58')][_0x7195('0x7d')]=_0x527c09[_0x7195('0x58')][0x0][_0x7195('0x24')][_0x7195('0x7d')];_0x3335b6[_0x7195('0x58')][_0x7195('0x58')]=_0x527c09[_0x7195('0x58')][0x0][_0x7195('0x24')]['text'];break;case _0x7195('0x90'):_0x3335b6['body'][_0x7195('0x7d')]=_0x527c09[_0x7195('0x58')][_0x7195('0x7d')];_0x3335b6[_0x7195('0x58')]['body']=_0x527c09[_0x7195('0x58')][_0x7195('0x24')];_0x3335b6[_0x7195('0x58')]['messageId']=_0x527c09['body'][_0x7195('0x91')];break;}}if(_0x3335b6[_0x7195('0x58')]['id']){delete _0x3335b6[_0x7195('0x58')]['id'];}if(_[_0x7195('0x92')](_0x3335b6['body'][_0x7195('0x7d')])){throw new db[(_0x7195('0x73'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x7195('0x92')](_0x3335b6[_0x7195('0x58')][_0x7195('0x58')])||_0x3335b6['body']['body']===''){throw new db[(_0x7195('0x73'))][(_0x7195('0x74'))](_0x7195('0x93'));}if(_[_0x7195('0x92')](_0x3335b6['body']['mapKey'])){throw new db[(_0x7195('0x73'))][(_0x7195('0x74'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x10fff3);}if(!_['includes'](_0x10fff3,_0x3335b6['body']['mapKey'])){throw new db[(_0x7195('0x73'))]['ValidationError'](_0x7195('0x94')+_0x10fff3);}_0x17ec10[_0x3335b6[_0x7195('0x58')][_0x7195('0x95')]]=_0x3335b6[_0x7195('0x58')][_0x7195('0x7d')];return db[_0x7195('0x96')]['find']({'where':{'id':_0x3335b6[_0x7195('0x6e')][_0x7195('0x7a')]},'include':[{'model':db['CmContact'],'as':_0x7195('0x97'),'where':_0x17ec10,'limit':0x1,'order':[[_0x7195('0x78'),_0x7195('0x98')]]}]});})['then'](handleEntityNotFound(_0x40e537,null))[_0x7195('0x30')](function(_0x13caac){if(_0x13caac){_0x3335b6[_0x7195('0x99')]=_[_0x7195('0x9a')](_0x13caac,['Contacts']);if(_0x13caac[_0x7195('0x97')][_0x7195('0x44')]){return _0x13caac[_0x7195('0x97')][0x0];}var _0x436509=_[_0x7195('0x17')](_0x3335b6[_0x7195('0x58')],{'firstName':_0x3335b6[_0x7195('0x58')][_0x7195('0x7d')],'ListId':_0x13caac['id']});_0x436509[_0x3335b6[_0x7195('0x58')][_0x7195('0x95')]]=_0x3335b6[_0x7195('0x58')][_0x7195('0x7d')];return db[_0x7195('0x72')][_0x7195('0x57')](_0x436509,{'fields':_0x399196,'raw':!![]});}})[_0x7195('0x30')](handleEntityNotFound(_0x40e537,null))['then'](function(_0x5124ec){if(_0x5124ec){_0x3335b6[_0x7195('0x9b')]=_0x5124ec;var _0x3543b2={'ContactId':_0x5124ec['id'],'phone':_0x3335b6[_0x7195('0x58')][_0x7195('0x7d')],'SmsAccountId':_0x527c09[_0x7195('0x5f')]['id']};var _0x218a07={'ContactId':_0x5124ec['id'],'SmsAccountId':_0x527c09[_0x7195('0x5f')]['id'],'closed':![]};return db[_0x7195('0x9c')][_0x7195('0x56')]({'where':_0x218a07})[_0x7195('0x30')](function(_0x2e26d0){if(_0x2e26d0){return[_0x2e26d0,![]];}return db[_0x7195('0x9c')][_0x7195('0x57')](_0x3543b2)[_0x7195('0x30')](function(_0xf76a61){return[_0xf76a61,!![]];});});}})['spread'](function(_0x31f95b,_0x31e53d){_0x3335b6[_0x7195('0x9d')]=_0x31f95b[_0x7195('0x5a')]({'plain':!![]});_0x3335b6[_0x7195('0x9d')][_0x7195('0x9e')]=![];if(_0x31e53d){if(_0x3335b6[_0x7195('0x6e')][_0x7195('0x9f')]){_0x3335b6['applications']['push']({'id':0x0,'priority':_0x3335b6[_0x7195('0x6f')][_0x7195('0x44')]+0x1,'app':'close','appdata':_0x7195('0xa0'),'interval':_0x7195('0xa1')});}_0x3335b6['interaction'][_0x7195('0x9e')]=!![];}return db[_0x7195('0xa2')][_0x7195('0x57')]({'phone':_0x3335b6[_0x7195('0x58')][_0x7195('0x7d')],'messageId':_0x3335b6[_0x7195('0x58')]['messageId'],'body':_0x3335b6['body'][_0x7195('0x58')],'SmsAccountId':_0x527c09[_0x7195('0x5f')]['id'],'SmsInteractionId':_0x31f95b['id'],'direction':'in','ContactId':_0x31f95b[_0x7195('0xa3')],'AttachmentId':_0x3335b6[_0x7195('0x58')]['AttachmentId']});})['then'](function(_0x39bebd){_0x3335b6['message']=_0x39bebd;if(_0x3335b6[_0x7195('0x9d')][_0x7195('0xa4')]){return db[_0x7195('0xa5')][_0x7195('0x56')]({'attributes':['id',_0x7195('0x36')],'where':{'id':_0x3335b6[_0x7195('0x9d')][_0x7195('0xa4')]}})['then'](function(_0x25ae24){if(_0x25ae24){_0x3335b6['applications'][_0x7195('0xa6')]({'id':0x0,'priority':0x0,'app':_0x7195('0xa7'),'appdata':_0x25ae24[_0x7195('0x36')]+','+(_0x3335b6[_0x7195('0x6e')][_0x7195('0xa8')]||0xa),'interval':_0x7195('0xa1')});}return respondWithRpcPromise(_0x7195('0xa9'),_0x7195('0xaa'),_0x3335b6);});}return respondWithRpcPromise(_0x7195('0xa9'),_0x7195('0xaa'),_0x3335b6);})[_0x7195('0x30')](function(_0x4e675d){if(_0x4e675d){var _0x49c5aa=0xc8;var _0x5dedbc='receiveMessage';logger['info'](_0x7195('0x1f'),_0x5dedbc,_0x49c5aa,'entity\x20found');logger[_0x7195('0x1e')](_0x7195('0xab'),_0x5dedbc,_0x49c5aa,'entity\x20found',JSON[_0x7195('0x21')](_0x4e675d));if(_0x3335b6[_0x7195('0x6e')][_0x7195('0x4d')]===_0x7195('0x7c')){return _0x40e537[_0x7195('0x27')](_0x49c5aa)[_0x7195('0x2d')](_0x7195('0xac'),'text/xml')[_0x7195('0x37')](_0x7195('0xad'));}else{return _0x40e537[_0x7195('0x27')](_0x49c5aa)['json'](_0x4e675d);}}})['catch'](handleError(_0x40e537,null));};exports['addApplications']=function(_0x56a629,_0x569b3e){var _0x490852=_0x56a629[_0x7195('0x5f')]['id'];var _0x4fca83=_0x56a629[_0x7195('0x58')];var _0x5bb8c7=0xc8;var _0x4b0f46=null;return db[_0x7195('0xae')][_0x7195('0xaf')]({'isolationLevel':db['sequelize'][_0x7195('0xb0')]['ISOLATION_LEVELS'][_0x7195('0xb1')]},function(_0x4d9776){return db[_0x7195('0x3a')][_0x7195('0xb2')]({'where':{'id':_0x490852},'transaction':_0x4d9776})[_0x7195('0x30')](function(_0x3faa37){if(_0x3faa37){return db[_0x7195('0x6c')]['destroy']({'where':{'SmsAccountId':_0x490852},'transaction':_0x4d9776})[_0x7195('0x30')](function(){var _0x1409a7=_[_0x7195('0x39')](_0x4fca83,function(_0x43f3a2){_0x43f3a2[_0x7195('0x62')]=_0x490852;return _0x43f3a2;});return db[_0x7195('0x6c')][_0x7195('0xb3')](_0x1409a7,{'transaction':_0x4d9776});});}else{_0x5bb8c7=0x194;_0x4b0f46=[];}});})['then'](function(){if(_0x5bb8c7!==0x194){return db[_0x7195('0x6c')][_0x7195('0xb4')]({'where':{'SmsAccountId':_0x490852},'order':'priority'})[_0x7195('0x30')](function(_0x420274){_0x4b0f46=_0x420274;});}})['catch'](function(_0xfbb005){_0x5bb8c7=0x1f4;logger[_0x7195('0x22')](_0xfbb005[_0x7195('0x35')]);if(_0xfbb005[_0x7195('0x36')]){delete _0xfbb005[_0x7195('0x36')];}_0x4b0f46=_0xfbb005;})[_0x7195('0xb5')](function(){if(_0x4b0f46===null){_0x569b3e[_0x7195('0x26')](_0x5bb8c7);}else{if(_0x5bb8c7===0x1f4){_0x569b3e[_0x7195('0x27')](_0x5bb8c7)['send'](_0x4b0f46);}else{_0x569b3e[_0x7195('0x27')](_0x5bb8c7)[_0x7195('0x28')](_0x4b0f46);}}});};exports[_0x7195('0xb6')]=function(_0x230415,_0x1052ec,_0x574087){var _0x1d8c89={};var _0x1a1d0f={};var _0x11899f;var _0x257a85;return db[_0x7195('0x3a')][_0x7195('0xb2')]({'where':{'id':_0x230415[_0x7195('0x5f')]['id']}})[_0x7195('0x30')](handleEntityNotFound(_0x1052ec,null))[_0x7195('0x30')](function(_0x145f91){if(_0x145f91){_0x11899f=_0x145f91;_0x1a1d0f[_0x7195('0x3d')]=_[_0x7195('0x3f')](db[_0x7195('0x6c')][_0x7195('0x3b')]);_0x1a1d0f[_0x7195('0x3e')]=_[_0x7195('0x3f')](_0x230415[_0x7195('0x3e')]);_0x1a1d0f[_0x7195('0x40')]=_[_0x7195('0x41')](_0x1a1d0f[_0x7195('0x3d')],_0x1a1d0f[_0x7195('0x3e')]);_0x1d8c89[_0x7195('0x42')]=_['intersection'](_0x1a1d0f['model'],qs[_0x7195('0x43')](_0x230415['query'][_0x7195('0x43')]));_0x1d8c89[_0x7195('0x42')]=_0x1d8c89[_0x7195('0x42')][_0x7195('0x44')]?_0x1d8c89[_0x7195('0x42')]:_0x1a1d0f[_0x7195('0x3d')];_0x1d8c89['order']=qs[_0x7195('0x48')](_0x230415[_0x7195('0x3e')][_0x7195('0x48')]);_0x1d8c89['where']=qs['filters'](_[_0x7195('0x4a')](_0x230415[_0x7195('0x3e')],_0x1a1d0f[_0x7195('0x40')]));if(_0x230415[_0x7195('0x3e')][_0x7195('0x4b')]){_0x1d8c89['where']=_[_0x7195('0x4c')](_0x1d8c89[_0x7195('0x49')],{'$or':_[_0x7195('0x39')](_0x1d8c89[_0x7195('0x42')],function(_0x58e1f5){var _0x1d294d={};_0x1d294d[_0x58e1f5]={'$like':'%'+_0x230415['query'][_0x7195('0x4b')]+'%'};return _0x1d294d;})});}_0x1d8c89=_[_0x7195('0x4c')]({},_0x1d8c89,_0x230415['options']);return _0x11899f[_0x7195('0xb6')](_0x1d8c89);}})[_0x7195('0x30')](function(_0xc2f020){if(_0xc2f020){_0x257a85=_0xc2f020[_0x7195('0x44')];if(!_0x230415['query'][_0x7195('0x45')](_0x7195('0x46'))){_0x1d8c89[_0x7195('0x2a')]=qs[_0x7195('0x2a')](_0x230415[_0x7195('0x3e')][_0x7195('0x2a')]);_0x1d8c89[_0x7195('0x2c')]=qs[_0x7195('0x2c')](_0x230415[_0x7195('0x3e')][_0x7195('0x2c')]);}return _0x11899f[_0x7195('0xb6')](_0x1d8c89);}})[_0x7195('0x30')](function(_0x33bc4d){if(_0x33bc4d){return _0x33bc4d?{'count':_0x257a85,'rows':_0x33bc4d}:null;}})['then'](respondWithResult(_0x1052ec,null))[_0x7195('0x25')](handleError(_0x1052ec,null));};exports[_0x7195('0xb7')]=function(_0x174f84,_0x3a0579,_0x4cd216){var _0x3ab3ca={'raw':![],'where':{}};var _0xc74de={};var _0x970261={'count':0x0,'rows':[]};return db[_0x7195('0x3a')][_0x7195('0xb2')]({'where':{'id':_0x174f84[_0x7195('0x5f')]['id']}})[_0x7195('0x30')](handleEntityNotFound(_0x3a0579,null))['then'](function(_0x3f7b75){if(_0x3f7b75){_0xc74de[_0x7195('0x3d')]=_[_0x7195('0x3f')](db[_0x7195('0x9c')]['rawAttributes']);_0xc74de['query']=_['keys'](_0x174f84[_0x7195('0x3e')]);_0xc74de[_0x7195('0x40')]=_['intersection'](_0xc74de[_0x7195('0x3d')],_0xc74de[_0x7195('0x3e')]);_0x3ab3ca[_0x7195('0x42')]=_[_0x7195('0x41')](_0xc74de[_0x7195('0x3d')],qs[_0x7195('0x43')](_0x174f84['query'][_0x7195('0x43')]));_0x3ab3ca[_0x7195('0x42')]=_0x3ab3ca[_0x7195('0x42')][_0x7195('0x44')]?_0x3ab3ca['attributes']:_0xc74de[_0x7195('0x3d')];if(!_0x174f84[_0x7195('0x3e')]['hasOwnProperty'](_0x7195('0x46'))){_0x3ab3ca[_0x7195('0x2a')]=qs[_0x7195('0x2a')](_0x174f84[_0x7195('0x3e')][_0x7195('0x2a')]);_0x3ab3ca[_0x7195('0x2c')]=qs[_0x7195('0x2c')](_0x174f84[_0x7195('0x3e')][_0x7195('0x2c')]);}_0x3ab3ca[_0x7195('0x47')]=qs[_0x7195('0x48')](_0x174f84[_0x7195('0x3e')][_0x7195('0x48')]);_0x3ab3ca[_0x7195('0x49')]=qs[_0x7195('0x40')](_[_0x7195('0x4a')](_0x174f84[_0x7195('0x3e')],_0xc74de['filters']));_0x3ab3ca[_0x7195('0x49')]['SmsAccountId']=_0x3f7b75['id'];if(_0x174f84[_0x7195('0x3e')][_0x7195('0x4b')]){_0x3ab3ca[_0x7195('0x49')]=_[_0x7195('0x4c')](_0x3ab3ca[_0x7195('0x49')],{'$or':_[_0x7195('0x39')](_0x3ab3ca['attributes'],function(_0x30d1fe){var _0x4b1665={};_0x4b1665[_0x30d1fe]={'$like':'%'+_0x174f84[_0x7195('0x3e')][_0x7195('0x4b')]+'%'};return _0x4b1665;})});}_0x3ab3ca=_[_0x7195('0x4c')]({},_0x3ab3ca,_0x174f84[_0x7195('0x55')]);return db[_0x7195('0x9c')][_0x7195('0x2b')]({'where':_0x3ab3ca[_0x7195('0x49')]})[_0x7195('0x30')](function(_0x1bd807){_0x970261[_0x7195('0x2b')]=_0x1bd807;if(_0x174f84[_0x7195('0x3e')][_0x7195('0x4f')]){_0x3ab3ca[_0x7195('0x50')]=[{'model':db[_0x7195('0x72')],'as':_0x7195('0xb8'),'required':![]},{'model':db[_0x7195('0xa5')],'as':_0x7195('0xb9'),'attributes':[_0x7195('0x36'),'fullname',_0x7195('0xba')],'required':![]},{'model':db[_0x7195('0xbb')],'as':_0x7195('0xbc'),'attributes':['id',_0x7195('0x36'),_0x7195('0xbd')],'where':_0x174f84[_0x7195('0x3e')]['tag']?{'id':_0x174f84[_0x7195('0x3e')][_0x7195('0xbe')]}:undefined,'required':_0x174f84['query'][_0x7195('0xbe')]?!![]:![]}];}return db[_0x7195('0x9c')][_0x7195('0x51')](_0x3ab3ca);})[_0x7195('0x30')](function(_0x59c0ca){_0x970261[_0x7195('0x52')]=_0x59c0ca;return _0x970261;});}})[_0x7195('0x30')](respondWithFilteredResult(_0x3a0579,_0x3ab3ca))['catch'](handleError(_0x3a0579,null));};exports['send']=function(_0xc85ad1,_0x392214,_0x3ded98){var _0xdd6134,_0x1abda2,_0x3b3370;if(_[_0x7195('0x92')](_0xc85ad1[_0x7195('0x58')]['body'])||_0xc85ad1[_0x7195('0x58')][_0x7195('0x58')]===''){throw new db[(_0x7195('0x73'))][(_0x7195('0x74'))](_0x7195('0x93'));}if(_[_0x7195('0x92')](_0xc85ad1[_0x7195('0x58')]['to'])){throw new db[(_0x7195('0x73'))][(_0x7195('0x74'))](_0x7195('0xbf'));}_0xdd6134=_0xc85ad1[_0x7195('0x58')]['to'];return db[_0x7195('0x3a')][_0x7195('0x56')]({'where':{'id':_0xc85ad1[_0x7195('0x5f')]['id']},'include':[{'model':db[_0x7195('0x96')],'as':_0x7195('0xc0'),'include':[{'model':db[_0x7195('0x72')],'as':'Contacts','where':{'mobile':_0xdd6134},'limit':0x1,'order':[[_0x7195('0x78'),_0x7195('0x98')]]}]}]})[_0x7195('0x30')](handleEntityNotFound(_0x392214,null))[_0x7195('0x30')](function(_0x178d7a){if(_0x178d7a&&_0x178d7a[_0x7195('0xc0')]){_0x1abda2=_0x178d7a[_0x7195('0x5a')]({'plain':!![]});if(_0x1abda2[_0x7195('0xc0')]&&_0x1abda2['List'][_0x7195('0x97')][_0x7195('0x44')]){return _0x1abda2['List'][_0x7195('0x97')][0x0];}return db[_0x7195('0x72')][_0x7195('0x57')](_[_0x7195('0x17')](_0xc85ad1[_0x7195('0x58')],{'firstName':_0xdd6134,'mobile':_0xdd6134,'phone':_0xdd6134,'ListId':_0x1abda2[_0x7195('0x7a')]}));}})[_0x7195('0x30')](handleEntityNotFound(_0x392214,null))[_0x7195('0x30')](function(_0x4eaa2c){if(_0x4eaa2c){_0x3b3370=_0x4eaa2c;return db['SmsInteraction']['find']({'where':{'ContactId':_0x3b3370['id'],'closed':![],'SmsAccountId':_0x1abda2['id']}})['then'](function(_0x16b89c){if(_0x16b89c){return[_0x16b89c,![]];}return db['SmsInteraction']['create']({'UserId':_0xc85ad1[_0x7195('0x59')]['id'],'ContactId':_0x3b3370['id'],'SmsAccountId':_0x1abda2['id'],'phone':_0xdd6134,'firstMsgDirection':_0x7195('0xc1'),'Messages':[_['merge'](_0xc85ad1[_0x7195('0x58')],{'read':![],'body':_0xc85ad1[_0x7195('0x58')][_0x7195('0x58')],'phone':_0xdd6134,'SmsAccountId':_0x1abda2['id'],'UserId':_0xc85ad1['user']['id'],'ContactId':_0x3b3370['id']})]},{'include':[{'model':db[_0x7195('0xa2')],'as':'Messages'}]})['then'](function(_0x12befc){return[_0x12befc,!![]];});});}})[_0x7195('0xc2')](function(_0x1b5c57,_0x3fece3){if(_0x3fece3){return _0x1b5c57;}return db[_0x7195('0xa2')]['create'](_[_0x7195('0x4c')](_0xc85ad1[_0x7195('0x58')],{'read':![],'body':_0xc85ad1[_0x7195('0x58')]['body'],'phone':_0xdd6134,'SmsAccountId':_0x1abda2['id'],'SmsInteractionId':_0x1b5c57['id'],'UserId':_0xc85ad1['user']['id'],'ContactId':_0x3b3370['id']}))['then'](function(_0x4d5b8c){_0x1b5c57[_0x7195('0xc3')]['Messages']=[];_0x1b5c57[_0x7195('0xc3')][_0x7195('0xc4')][_0x7195('0xc5')](_0x4d5b8c[_0x7195('0xc3')]);return _0x1b5c57;});})[_0x7195('0x30')](respondWithResult(_0x392214,null))[_0x7195('0x25')](handleError(_0x392214,null));};exports[_0x7195('0x27')]=function(_0x974ea0,_0x130445,_0x566dca){if(_0x974ea0['body']['id']){delete _0x974ea0[_0x7195('0x58')]['id'];}var _0x154ada,_0x150130,_0x287c2e;return db['SmsAccount'][_0x7195('0x56')]({'where':{'id':_0x974ea0[_0x7195('0x5f')]['id']}})[_0x7195('0x30')](handleEntityNotFound(_0x130445,null))['then'](function(_0x56d156){if(_0x56d156){_0x287c2e=_0x56d156;logger['debug'](_0x7195('0x1f'),_0x7195('0x27'),_0x7195('0xc6'),_0x56d156['type'],util[_0x7195('0xc7')](_0x974ea0['body'],{'showHidden':![],'depth':null}));switch(_0x56d156['type']){case _0x7195('0x82'):if(_0x974ea0['body']['skebby_dispatch_id']&&_0x974ea0[_0x7195('0x58')][_0x7195('0x27')]){_0x150130=_0x974ea0['body'][_0x7195('0x27')];return db[_0x7195('0xa2')][_0x7195('0x56')]({'where':{'messageId':_0x974ea0[_0x7195('0x58')][_0x7195('0xc8')]}});}break;case'connectel':if(_0x974ea0[_0x7195('0x58')][_0x7195('0xc9')]&&_0x974ea0[_0x7195('0x58')][_0x7195('0xca')]){_0x150130=_0x974ea0['body'][_0x7195('0xca')];return db[_0x7195('0xa2')][_0x7195('0x56')]({'where':{'messageId':_0x974ea0['body']['requestid']}});}break;case'clicksend':if(_0x974ea0[_0x7195('0x58')][_0x7195('0x87')]&&_0x974ea0[_0x7195('0x58')]['status_code']){_0x150130=_0x974ea0[_0x7195('0x58')][_0x7195('0xcb')];return db['SmsMessage'][_0x7195('0x56')]({'where':{'messageId':_0x974ea0[_0x7195('0x58')][_0x7195('0x87')]}});}break;case _0x7195('0x89'):var _0x48d896=_0x974ea0[_0x7195('0x58')][_0x7195('0x8a')][0x0];if(_0x48d896[_0x7195('0x80')]&&_0x48d896[_0x7195('0x27')]['groupName']===_0x7195('0xcc')){_0x150130=_0x48d896['status'][_0x7195('0xcd')];return db[_0x7195('0xa2')][_0x7195('0x56')]({'where':{'messageId':_0x48d896[_0x7195('0x80')]}});}break;case _0x7195('0x8d'):if(_0x974ea0[_0x7195('0x58')][_0x7195('0x80')]&&_0x974ea0['body'][_0x7195('0x27')]){_0x150130=_0x974ea0[_0x7195('0x58')]['status'];return db[_0x7195('0xa2')]['find']({'where':{'messageId':_0x974ea0[_0x7195('0x58')][_0x7195('0x80')]}});}break;case _0x7195('0x8f'):if(_0x974ea0['body'][0x0][_0x7195('0x24')]['id']){_0x150130=_0x974ea0['body'][0x0][_0x7195('0x4d')];return db[_0x7195('0xa2')][_0x7195('0x56')]({'where':{'messageId':_0x974ea0[_0x7195('0x58')][0x0][_0x7195('0x24')]['id']}});}break;case _0x7195('0x90'):if(_0x974ea0['body'][_0x7195('0xce')]&&_0x974ea0[_0x7195('0x58')]['status']){_0x150130=_0x974ea0['body'][_0x7195('0x27')];return db[_0x7195('0xa2')]['find']({'where':{'messageId':_0x974ea0[_0x7195('0x58')][_0x7195('0xce')]}});}break;}}})[_0x7195('0x30')](handleEntityNotFound(_0x130445,null))[_0x7195('0x30')](function(_0x2bc78c){if(_0x2bc78c){_0x154ada=_0x2bc78c;switch(_0x287c2e[_0x7195('0x4d')]){case _0x7195('0x82'):if(_0x150130===_0x7195('0xcc')){return _0x154ada[_0x7195('0x5e')]({'read':!![]});}else{logger[_0x7195('0x22')](_0x7195('0x1f'),'status','skebby',util[_0x7195('0xc7')](_0x974ea0['body'],{'showHidden':![],'depth':null}));}break;case _0x7195('0x85'):if(_0x150130==='1'){return _0x154ada['update']({'read':!![]});}else{logger['error'](_0x7195('0x1f'),'status',_0x7195('0x82'),util[_0x7195('0xc7')](_0x974ea0[_0x7195('0x58')],{'showHidden':![],'depth':null}));}break;case _0x7195('0x86'):if(!_0x974ea0[_0x7195('0x58')][_0x7195('0xcf')]&&_0x150130>=0xc8&&_0x150130<=0xce){return _0x154ada['update']({'read':!![]});}else{logger['error'](_0x7195('0x1f'),_0x7195('0x27'),'clicksend',util[_0x7195('0xc7')](_0x974ea0[_0x7195('0x58')],{'showHidden':![],'depth':null}));}break;case _0x7195('0x89'):var _0x4bd6aa=_0x974ea0[_0x7195('0x58')][_0x7195('0x8a')][0x0];if(_0x4bd6aa[_0x7195('0x27')]['groupName']==='DELIVERED'){return _0x154ada[_0x7195('0x5e')]({'read':!![]});}else{logger[_0x7195('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7195('0x27'),_0x7195('0x89'),util[_0x7195('0xc7')](_0x974ea0['body'],{'showHidden':![],'depth':null}));}break;case _0x7195('0x8d'):if(_0x150130==_0x7195('0xd0')||_0x150130==_0x7195('0xd1')){return _0x154ada[_0x7195('0x5e')]({'read':!![]});}else{logger['error'](_0x7195('0x1f'),_0x7195('0x27'),_0x7195('0x8d'),util[_0x7195('0xc7')](_0x974ea0[_0x7195('0x58')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x150130==_0x7195('0xd2')){return _0x154ada[_0x7195('0x5e')]({'read':!![]});}else{logger[_0x7195('0x22')](_0x7195('0x1f'),_0x7195('0x27'),'bandwidth',util['inspect'](_0x974ea0[_0x7195('0x58')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x150130===_0x7195('0xd3')||_0x150130==='ACCEPTD'){return _0x154ada[_0x7195('0x5e')]({'read':!![]});}else{logger[_0x7195('0x22')](_0x7195('0x1f'),_0x7195('0x27'),'intelepeer',util['inspect'](_0x974ea0[_0x7195('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x154ada;}})[_0x7195('0x30')](respondWithResult(_0x130445,null))[_0x7195('0x25')](handleError(_0x130445,null));};exports[_0x7195('0xd4')]=function(_0x29d61b,_0x59bd4a,_0x19609d){var _0x13d225,_0x27fa5e,_0x4fcc22;return db[_0x7195('0x3a')][_0x7195('0x56')]({'where':{'id':_0x29d61b[_0x7195('0x5f')]['id']}})['then'](handleEntityNotFound(_0x59bd4a,null))[_0x7195('0x30')](function(_0x576f82){if(_0x576f82){_0x4fcc22=_0x576f82;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x7195('0xc6'),_0x576f82[_0x7195('0x4d')],util[_0x7195('0xc7')](_0x29d61b['query'],{'showHidden':![],'depth':null}));switch(_0x576f82[_0x7195('0x4d')]){case _0x7195('0xd5'):if(_0x29d61b[_0x7195('0x3e')][_0x7195('0xd6')]&&_0x29d61b[_0x7195('0x3e')]['state']){_0x27fa5e=_0x29d61b[_0x7195('0x3e')][_0x7195('0xd7')];return db[_0x7195('0xa2')][_0x7195('0x56')]({'where':{'messageId':_0x29d61b[_0x7195('0x3e')][_0x7195('0xd6')]}});}break;}}})['then'](handleEntityNotFound(_0x59bd4a,null))[_0x7195('0x30')](function(_0x1bdd4d){if(_0x1bdd4d){_0x13d225=_0x1bdd4d;switch(_0x4fcc22[_0x7195('0x4d')]){case _0x7195('0xd5'):if(_0x27fa5e==='2'||_0x27fa5e==='6'){return _0x13d225['update']({'read':!![]});}else{logger['error'](_0x7195('0x1f'),_0x7195('0x27'),'csc',util[_0x7195('0xc7')](_0x29d61b[_0x7195('0x3e')],{'showHidden':![],'depth':null}));};break;}return _0x13d225;}})[_0x7195('0x30')](respondWithResult(_0x59bd4a,null))[_0x7195('0x25')](handleError(_0x59bd4a,null));};exports[_0x7195('0xd8')]=function(_0x2534ea,_0x481ce1,_0x176077){return db[_0x7195('0x3a')][_0x7195('0x56')]({'where':{'id':_0x2534ea[_0x7195('0x5f')]['id']}})[_0x7195('0x30')](handleEntityNotFound(_0x481ce1,null))[_0x7195('0x30')](function(_0x56595e){if(_0x56595e){return _0x56595e[_0x7195('0xd8')](_0x2534ea[_0x7195('0x58')][_0x7195('0x69')],_[_0x7195('0x9a')](_0x2534ea['body'],[_0x7195('0x69'),'id'])||{})[_0x7195('0xc2')](function(_0x5dd0bd){for(var _0x2368d5=0x0;_0x2368d5<_0x2534ea['body'][_0x7195('0x69')][_0x7195('0x44')];_0x2368d5+=0x1){socket[_0x7195('0xd9')]('userSmsAccount:save',{'UserId':Number(_0x2534ea[_0x7195('0x58')][_0x7195('0x69')][_0x2368d5]),'SmsAccountId':Number(_0x2534ea[_0x7195('0x5f')]['id'])});}return _0x5dd0bd;});}})['then'](respondWithResult(_0x481ce1,null))['catch'](handleError(_0x481ce1,null));};exports[_0x7195('0xda')]=function(_0x591ec4,_0x56f818,_0x2ff814){return db[_0x7195('0x3a')][_0x7195('0x56')]({'where':{'id':_0x591ec4[_0x7195('0x5f')]['id']}})[_0x7195('0x30')](handleEntityNotFound(_0x56f818,null))[_0x7195('0x30')](function(_0x553b30){if(_0x553b30){return _0x553b30[_0x7195('0xda')](_0x591ec4[_0x7195('0x3e')][_0x7195('0x69')])[_0x7195('0x30')](function(){if(_[_0x7195('0xdb')](_0x591ec4['query'][_0x7195('0x69')])){for(var _0x19a654=0x0;_0x19a654<_0x591ec4[_0x7195('0x3e')][_0x7195('0x69')][_0x7195('0x44')];_0x19a654+=0x1){socket[_0x7195('0xd9')](_0x7195('0xdc'),{'UserId':Number(_0x591ec4['query'][_0x7195('0x69')][_0x19a654]),'SmsAccountId':Number(_0x591ec4['params']['id'])});}}else{socket[_0x7195('0xd9')](_0x7195('0xdc'),{'UserId':Number(_0x591ec4[_0x7195('0x3e')]['ids']),'SmsAccountId':Number(_0x591ec4[_0x7195('0x5f')]['id'])});}});}})[_0x7195('0x30')](respondWithStatusCode(_0x56f818,null))[_0x7195('0x25')](handleError(_0x56f818,null));};exports[_0x7195('0xdd')]=function(_0x2d17a5,_0x4edab6,_0x31b24b){var _0x202302={};var _0x2b5997={};var _0x4ce0ed;var _0x17c21c;return db[_0x7195('0x3a')]['findOne']({'where':{'id':_0x2d17a5[_0x7195('0x5f')]['id']}})[_0x7195('0x30')](handleEntityNotFound(_0x4edab6,null))['then'](function(_0x13574e){if(_0x13574e){_0x4ce0ed=_0x13574e;_0x2b5997[_0x7195('0x3d')]=_['keys'](db[_0x7195('0xa5')][_0x7195('0x3b')]);_0x2b5997[_0x7195('0x3e')]=_[_0x7195('0x3f')](_0x2d17a5[_0x7195('0x3e')]);_0x2b5997[_0x7195('0x40')]=_[_0x7195('0x41')](_0x2b5997[_0x7195('0x3d')],_0x2b5997['query']);_0x202302[_0x7195('0x42')]=_[_0x7195('0x41')](_0x2b5997[_0x7195('0x3d')],qs[_0x7195('0x43')](_0x2d17a5['query'][_0x7195('0x43')]));_0x202302[_0x7195('0x42')]=_0x202302[_0x7195('0x42')][_0x7195('0x44')]?_0x202302[_0x7195('0x42')]:_0x2b5997[_0x7195('0x3d')];_0x202302[_0x7195('0x47')]=qs['sort'](_0x2d17a5[_0x7195('0x3e')][_0x7195('0x48')]);_0x202302[_0x7195('0x49')]=qs[_0x7195('0x40')](_[_0x7195('0x4a')](_0x2d17a5[_0x7195('0x3e')],_0x2b5997['filters']));if(_0x2d17a5[_0x7195('0x3e')][_0x7195('0x4b')]){_0x202302[_0x7195('0x49')]=_[_0x7195('0x4c')](_0x202302[_0x7195('0x49')],{'$or':_[_0x7195('0x39')](_0x202302[_0x7195('0x42')],function(_0x8603bd){var _0x3c1241={};_0x3c1241[_0x8603bd]={'$like':'%'+_0x2d17a5[_0x7195('0x3e')]['filter']+'%'};return _0x3c1241;})});}_0x202302=_[_0x7195('0x4c')]({},_0x202302,_0x2d17a5['options']);return _0x4ce0ed['getAgents'](_0x202302);}})[_0x7195('0x30')](function(_0x43b041){if(_0x43b041){_0x17c21c=_0x43b041[_0x7195('0x44')];if(!_0x2d17a5[_0x7195('0x3e')][_0x7195('0x45')](_0x7195('0x46'))){_0x202302[_0x7195('0x2a')]=qs[_0x7195('0x2a')](_0x2d17a5[_0x7195('0x3e')][_0x7195('0x2a')]);_0x202302[_0x7195('0x2c')]=qs[_0x7195('0x2c')](_0x2d17a5[_0x7195('0x3e')][_0x7195('0x2c')]);}return _0x4ce0ed[_0x7195('0xdd')](_0x202302);}})[_0x7195('0x30')](function(_0xe89bdb){if(_0xe89bdb){return _0xe89bdb?{'count':_0x17c21c,'rows':_0xe89bdb}:null;}})[_0x7195('0x30')](respondWithResult(_0x4edab6,null))[_0x7195('0x25')](handleError(_0x4edab6,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 3210198..de689b3 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 _0x4593=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsAccount','save','update'];(function(_0x2b9597,_0xcae06a){var _0x379c08=function(_0x434770){while(--_0x434770){_0x2b9597['push'](_0x2b9597['shift']());}};_0x379c08(++_0xcae06a);}(_0x4593,0x9b));var _0x3459=function(_0x2bc3f4,_0x470b26){_0x2bc3f4=_0x2bc3f4-0x0;var _0x14ac53=_0x4593[_0x2bc3f4];return _0x14ac53;};'use strict';var EventEmitter=require(_0x3459('0x0'));var SmsAccount=require(_0x3459('0x1'))['db'][_0x3459('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3459('0x3'),'afterUpdate':_0x3459('0x4'),'afterDestroy':_0x3459('0x5')};function emitEvent(_0x2bcc91){return function(_0x10a6c9,_0x23be73,_0x73e007){SmsAccountEvents[_0x3459('0x6')](_0x2bcc91+':'+_0x10a6c9['id'],_0x10a6c9);SmsAccountEvents[_0x3459('0x6')](_0x2bcc91,_0x10a6c9);_0x73e007(null);};}for(var e in events){if(events[_0x3459('0x7')](e)){var event=events[e];SmsAccount[_0x3459('0x8')](e,emitEvent(event));}}module[_0x3459('0x9')]=SmsAccountEvents; \ No newline at end of file +var _0x943e=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x3c516a,_0x4e4635){var _0x595fde=function(_0x3eefa2){while(--_0x3eefa2){_0x3c516a['push'](_0x3c516a['shift']());}};_0x595fde(++_0x4e4635);}(_0x943e,0x1df));var _0xe943=function(_0x3112d0,_0x55961c){_0x3112d0=_0x3112d0-0x0;var _0x2ea0e1=_0x943e[_0x3112d0];return _0x2ea0e1;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0xe943('0x0'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xe943('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe943('0x2'),'afterDestroy':_0xe943('0x3')};function emitEvent(_0x4a38f2){return function(_0x58613b,_0x952b17,_0x4b586b){SmsAccountEvents[_0xe943('0x4')](_0x4a38f2+':'+_0x58613b['id'],_0x58613b);SmsAccountEvents[_0xe943('0x4')](_0x4a38f2,_0x58613b);_0x4b586b(null);};}for(var e in events){if(events[_0xe943('0x5')](e)){var event=events[e];SmsAccount[_0xe943('0x6')](e,emitEvent(event));}}module[_0xe943('0x7')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 524fc06..eb274bc 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 _0x4639=['../../config/logger','api','moment','request-promise','../../config/environment','exports','define','SmsAccount','sms_accounts','lodash','util'];(function(_0x4d9bb2,_0x3db50d){var _0x3179fe=function(_0x5272f3){while(--_0x5272f3){_0x4d9bb2['push'](_0x4d9bb2['shift']());}};_0x3179fe(++_0x3db50d);}(_0x4639,0x195));var _0x9463=function(_0x287059,_0x499940){_0x287059=_0x287059-0x0;var _0x225c79=_0x4639[_0x287059];return _0x225c79;};'use strict';var _=require(_0x9463('0x0'));var util=require(_0x9463('0x1'));var logger=require(_0x9463('0x2'))(_0x9463('0x3'));var moment=require(_0x9463('0x4'));var BPromise=require('bluebird');var rp=require(_0x9463('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9463('0x6'));var attributes=require('./smsAccount.attributes');module[_0x9463('0x7')]=function(_0x2c87e9,_0x5a9822){return _0x2c87e9[_0x9463('0x8')](_0x9463('0x9'),attributes,{'tableName':_0x9463('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x198a=['../../config/logger','moment','bluebird','path','rimraf','./smsAccount.attributes','exports','sms_accounts','lodash','util'];(function(_0x380ed4,_0x648b67){var _0x1851f0=function(_0x5c6b24){while(--_0x5c6b24){_0x380ed4['push'](_0x380ed4['shift']());}};_0x1851f0(++_0x648b67);}(_0x198a,0x116));var _0xa198=function(_0x7ebed6,_0x18f494){_0x7ebed6=_0x7ebed6-0x0;var _0x543a25=_0x198a[_0x7ebed6];return _0x543a25;};'use strict';var _=require(_0xa198('0x0'));var util=require(_0xa198('0x1'));var logger=require(_0xa198('0x2'))('api');var moment=require(_0xa198('0x3'));var BPromise=require(_0xa198('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa198('0x5'));var rimraf=require(_0xa198('0x6'));var config=require('../../config/environment');var attributes=require(_0xa198('0x7'));module[_0xa198('0x8')]=function(_0x47e9c7,_0xa075d6){return _0x47e9c7['define']('SmsAccount',attributes,{'tableName':_0xa198('0x9'),'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 4c37dca..8e21497 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 _0xbd61=['where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSmsAccount','find','options'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0xbd61,0xd7));var _0x1bd6=function(_0x18068a,_0x813319){_0x18068a=_0x18068a-0x0;var _0x4f7ee4=_0xbd61[_0x18068a];return _0x4f7ee4;};'use strict';var _=require(_0x1bd6('0x0'));var util=require(_0x1bd6('0x1'));var moment=require(_0x1bd6('0x2'));var BPromise=require(_0x1bd6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1bd6('0x4'));var db=require(_0x1bd6('0x5'))['db'];var utils=require(_0x1bd6('0x6'));var logger=require(_0x1bd6('0x7'))(_0x1bd6('0x8'));var config=require('../../config/environment');var jayson=require(_0x1bd6('0x9'));var client=jayson[_0x1bd6('0xa')][_0x1bd6('0xb')]({'port':0x232a});config[_0x1bd6('0xc')]=_[_0x1bd6('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1bd6('0xe'))(new Redis(config[_0x1bd6('0xc')]));require('./smsAccount.socket')[_0x1bd6('0xf')](socket);function respondWithRpcPromise(_0x2fa6fe,_0x1b1181,_0x5d477a){return new BPromise(function(_0x26b816,_0xa92e44){return client[_0x1bd6('0x10')](_0x2fa6fe,_0x5d477a)[_0x1bd6('0x11')](function(_0x41b6a6){logger[_0x1bd6('0x12')](_0x1bd6('0x13'),_0x1b1181,_0x1bd6('0x14'));logger['debug'](_0x1bd6('0x15'),_0x1b1181,_0x1bd6('0x14'),JSON[_0x1bd6('0x16')](_0x41b6a6));if(_0x41b6a6[_0x1bd6('0x17')]){if(_0x41b6a6[_0x1bd6('0x17')][_0x1bd6('0x18')]===0x1f4){logger['error'](_0x1bd6('0x13'),_0x1b1181,_0x41b6a6[_0x1bd6('0x17')][_0x1bd6('0x19')]);return _0xa92e44(_0x41b6a6[_0x1bd6('0x17')][_0x1bd6('0x19')]);}logger[_0x1bd6('0x17')](_0x1bd6('0x13'),_0x1b1181,_0x41b6a6[_0x1bd6('0x17')][_0x1bd6('0x19')]);return _0x26b816(_0x41b6a6[_0x1bd6('0x17')][_0x1bd6('0x19')]);}else{logger[_0x1bd6('0x12')](_0x1bd6('0x13'),_0x1b1181,'request\x20sent');_0x26b816(_0x41b6a6['result'][_0x1bd6('0x19')]);}})[_0x1bd6('0x1a')](function(_0x489b43){logger[_0x1bd6('0x17')](_0x1bd6('0x13'),_0x1b1181,_0x489b43);_0xa92e44(_0x489b43);});});}exports[_0x1bd6('0x1b')]=function(_0x144e67){var _0x35b970=this;return new Promise(function(_0x15d6d4,_0x22460f){return db['SmsAccount'][_0x1bd6('0x1c')]({'raw':_0x144e67[_0x1bd6('0x1d')]?_0x144e67['options']['raw']===undefined?!![]:![]:!![],'where':_0x144e67[_0x1bd6('0x1d')]?_0x144e67[_0x1bd6('0x1d')][_0x1bd6('0x1e')]||null:null,'attributes':_0x144e67['options']?_0x144e67[_0x1bd6('0x1d')][_0x1bd6('0x1f')]||null:null,'include':_0x144e67[_0x1bd6('0x1d')]?_0x144e67[_0x1bd6('0x1d')][_0x1bd6('0x20')]?_[_0x1bd6('0x21')](_0x144e67['options'][_0x1bd6('0x20')],function(_0x55caa4){return{'model':db[_0x55caa4[_0x1bd6('0x22')]],'as':_0x55caa4['as'],'attributes':_0x55caa4[_0x1bd6('0x1f')],'include':_0x55caa4[_0x1bd6('0x20')]?_['map'](_0x55caa4[_0x1bd6('0x20')],function(_0x40102a){return{'model':db[_0x40102a[_0x1bd6('0x22')]],'as':_0x40102a['as'],'attributes':_0x40102a[_0x1bd6('0x1f')],'include':_0x40102a['include']?_['map'](_0x40102a['include'],function(_0x21e1c4){return{'model':db[_0x21e1c4[_0x1bd6('0x22')]],'as':_0x21e1c4['as'],'attributes':_0x21e1c4[_0x1bd6('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1bd6('0x11')](function(_0x22fa93){logger['info']('ShowSmsAccount',_0x144e67);logger['debug']('ShowSmsAccount',_0x144e67,JSON[_0x1bd6('0x16')](_0x22fa93));_0x15d6d4(_0x22fa93);})[_0x1bd6('0x1a')](function(_0x2607ab){logger[_0x1bd6('0x17')](_0x1bd6('0x1b'),_0x2607ab[_0x1bd6('0x19')],_0x144e67);_0x22460f(_0x35b970[_0x1bd6('0x17')](0x1f4,_0x2607ab[_0x1bd6('0x19')]));});});}; \ No newline at end of file +var _0x1dcf=['SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','SmsAccount,\x20%s,\x20%s','message','result','ShowSmsAccount','options','raw','where','attributes','include','map','model','then','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./smsAccount.socket','register','request','info','debug'];(function(_0x42bfb7,_0x25a3ec){var _0x5c497d=function(_0x48e83e){while(--_0x48e83e){_0x42bfb7['push'](_0x42bfb7['shift']());}};_0x5c497d(++_0x25a3ec);}(_0x1dcf,0x154));var _0xf1dc=function(_0x2d9def,_0x52a521){_0x2d9def=_0x2d9def-0x0;var _0x109e29=_0x1dcf[_0x2d9def];return _0x109e29;};'use strict';var _=require(_0xf1dc('0x0'));var util=require(_0xf1dc('0x1'));var moment=require(_0xf1dc('0x2'));var BPromise=require(_0xf1dc('0x3'));var rs=require(_0xf1dc('0x4'));var fs=require('fs');var Redis=require(_0xf1dc('0x5'));var db=require(_0xf1dc('0x6'))['db'];var utils=require(_0xf1dc('0x7'));var logger=require('../../config/logger')(_0xf1dc('0x8'));var config=require(_0xf1dc('0x9'));var jayson=require(_0xf1dc('0xa'));var client=jayson[_0xf1dc('0xb')][_0xf1dc('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xf1dc('0xd')],{'host':_0xf1dc('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf1dc('0xd')]));require(_0xf1dc('0xf'))[_0xf1dc('0x10')](socket);function respondWithRpcPromise(_0x4d852b,_0x10ca66,_0x2338e6){return new BPromise(function(_0x5826c2,_0x44c3d4){return client[_0xf1dc('0x11')](_0x4d852b,_0x2338e6)['then'](function(_0x1020a1){logger[_0xf1dc('0x12')]('SmsAccount,\x20%s,\x20%s',_0x10ca66,'request\x20sent');logger[_0xf1dc('0x13')](_0xf1dc('0x14'),_0x10ca66,'request\x20sent',JSON[_0xf1dc('0x15')](_0x1020a1));if(_0x1020a1['error']){if(_0x1020a1['error']['code']===0x1f4){logger[_0xf1dc('0x16')](_0xf1dc('0x17'),_0x10ca66,_0x1020a1['error']['message']);return _0x44c3d4(_0x1020a1['error'][_0xf1dc('0x18')]);}logger[_0xf1dc('0x16')]('SmsAccount,\x20%s,\x20%s',_0x10ca66,_0x1020a1['error']['message']);return _0x5826c2(_0x1020a1[_0xf1dc('0x16')][_0xf1dc('0x18')]);}else{logger[_0xf1dc('0x12')](_0xf1dc('0x17'),_0x10ca66,'request\x20sent');_0x5826c2(_0x1020a1[_0xf1dc('0x19')]['message']);}})['catch'](function(_0x4ccda7){logger[_0xf1dc('0x16')](_0xf1dc('0x17'),_0x10ca66,_0x4ccda7);_0x44c3d4(_0x4ccda7);});});}exports[_0xf1dc('0x1a')]=function(_0x4295c4){var _0x2f4a2a=this;return new Promise(function(_0x59eb30,_0x5cb692){return db['SmsAccount']['find']({'raw':_0x4295c4[_0xf1dc('0x1b')]?_0x4295c4['options'][_0xf1dc('0x1c')]===undefined?!![]:![]:!![],'where':_0x4295c4[_0xf1dc('0x1b')]?_0x4295c4[_0xf1dc('0x1b')][_0xf1dc('0x1d')]||null:null,'attributes':_0x4295c4[_0xf1dc('0x1b')]?_0x4295c4['options'][_0xf1dc('0x1e')]||null:null,'include':_0x4295c4[_0xf1dc('0x1b')]?_0x4295c4[_0xf1dc('0x1b')][_0xf1dc('0x1f')]?_[_0xf1dc('0x20')](_0x4295c4[_0xf1dc('0x1b')][_0xf1dc('0x1f')],function(_0x28f88d){return{'model':db[_0x28f88d[_0xf1dc('0x21')]],'as':_0x28f88d['as'],'attributes':_0x28f88d[_0xf1dc('0x1e')],'include':_0x28f88d[_0xf1dc('0x1f')]?_['map'](_0x28f88d['include'],function(_0x1f19ce){return{'model':db[_0x1f19ce[_0xf1dc('0x21')]],'as':_0x1f19ce['as'],'attributes':_0x1f19ce['attributes'],'include':_0x1f19ce[_0xf1dc('0x1f')]?_[_0xf1dc('0x20')](_0x1f19ce['include'],function(_0x2e8384){return{'model':db[_0x2e8384[_0xf1dc('0x21')]],'as':_0x2e8384['as'],'attributes':_0x2e8384[_0xf1dc('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf1dc('0x22')](function(_0x43e511){logger[_0xf1dc('0x12')]('ShowSmsAccount',_0x4295c4);logger[_0xf1dc('0x13')](_0xf1dc('0x1a'),_0x4295c4,JSON['stringify'](_0x43e511));_0x59eb30(_0x43e511);})[_0xf1dc('0x23')](function(_0x209dfd){logger[_0xf1dc('0x16')]('ShowSmsAccount',_0x209dfd['message'],_0x4295c4);_0x5cb692(_0x2f4a2a['error'](0x1f4,_0x209dfd[_0xf1dc('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 0fcf1b3..6d1c985 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 9345755..64f670f 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 _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x10c9d1,_0x43d60f){var _0x2bcd1c=function(_0x48f8ce){while(--_0x48f8ce){_0x10c9d1['push'](_0x10c9d1['shift']());}};_0x2bcd1c(++_0x43d60f);}(_0x3e74,0x175));var _0x43e7=function(_0x8ba30,_0x6af732){_0x8ba30=_0x8ba30-0x0;var _0x4d3a40=_0x3e74[_0x8ba30];return _0x4d3a40;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router; \ No newline at end of file +var _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x286fdc,_0x54551d){var _0x11fe49=function(_0x10ae7f){while(--_0x10ae7f){_0x286fdc['push'](_0x286fdc['shift']());}};_0x11fe49(++_0x54551d);}(_0x34e8,0x12c));var _0x834e=function(_0x45f7e5,_0x15acac){_0x45f7e5=_0x45f7e5-0x0;var _0x534f0c=_0x34e8[_0x45f7e5];return _0x534f0c;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 3c8efdb..3c4dd4c 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 _0x691d=['STRING','noop','TEXT','*,*,*,*','sequelize','INTEGER'];(function(_0x3eeb3e,_0x1bdb6f){var _0x59f715=function(_0x152faa){while(--_0x152faa){_0x3eeb3e['push'](_0x3eeb3e['shift']());}};_0x59f715(++_0x1bdb6f);}(_0x691d,0x70));var _0xd691=function(_0x2aee30,_0x5465df){_0x2aee30=_0x2aee30-0x0;var _0x1f3407=_0x691d[_0x2aee30];return _0x1f3407;};'use strict';var Sequelize=require(_0xd691('0x0'));module['exports']={'priority':{'type':Sequelize[_0xd691('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xd691('0x2')],'allowNull':![],'defaultValue':_0xd691('0x3')},'appdata':{'type':Sequelize[_0xd691('0x4')]()},'description':{'type':Sequelize[_0xd691('0x2')]},'interval':{'type':Sequelize[_0xd691('0x2')],'defaultValue':_0xd691('0x5')}}; \ No newline at end of file +var _0x4ca9=['TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER','noop'];(function(_0x2b01cb,_0x5461a5){var _0x5e7ed1=function(_0x556a56){while(--_0x556a56){_0x2b01cb['push'](_0x2b01cb['shift']());}};_0x5e7ed1(++_0x5461a5);}(_0x4ca9,0x1ca));var _0x94ca=function(_0x56d60f,_0x37c234){_0x56d60f=_0x56d60f-0x0;var _0x2c5f37=_0x4ca9[_0x56d60f];return _0x2c5f37;};'use strict';var Sequelize=require(_0x94ca('0x0'));module[_0x94ca('0x1')]={'priority':{'type':Sequelize[_0x94ca('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x94ca('0x3')},'appdata':{'type':Sequelize[_0x94ca('0x4')]()},'description':{'type':Sequelize[_0x94ca('0x5')]},'interval':{'type':Sequelize[_0x94ca('0x5')],'defaultValue':_0x94ca('0x6')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index a535315..be1fbbe 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 _0x560a=['../../config/license/util','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','update','then','destroy','error','name','send','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','map','options','SmsApplication','findAll','rows','show','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0xc045c5,_0x1419bd){var _0x42b992=function(_0x1d06ec){while(--_0x1d06ec){_0xc045c5['push'](_0xc045c5['shift']());}};_0x42b992(++_0x1419bd);}(_0x560a,0x14d));var _0xa560=function(_0x36f797,_0x351603){_0x36f797=_0x36f797-0x0;var _0x44ba30=_0x560a[_0x36f797];return _0x44ba30;};'use strict';var emlformat=require(_0xa560('0x0'));var rimraf=require(_0xa560('0x1'));var zipdir=require(_0xa560('0x2'));var jsonpatch=require(_0xa560('0x3'));var rp=require(_0xa560('0x4'));var moment=require(_0xa560('0x5'));var BPromise=require(_0xa560('0x6'));var Mustache=require(_0xa560('0x7'));var util=require(_0xa560('0x8'));var path=require(_0xa560('0x9'));var sox=require(_0xa560('0xa'));var csv=require(_0xa560('0xb'));var ejs=require(_0xa560('0xc'));var fs=require('fs');var fs_extra=require(_0xa560('0xd'));var _=require(_0xa560('0xe'));var squel=require('squel');var crypto=require(_0xa560('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xa560('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa560('0x11'));var Papa=require(_0xa560('0x12'));var Redis=require(_0xa560('0x13'));var authService=require(_0xa560('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xa560('0x15'));var hardwareService=require(_0xa560('0x16'));var logger=require(_0xa560('0x17'))(_0xa560('0x18'));var utils=require(_0xa560('0x19'));var config=require(_0xa560('0x1a'));var licenseUtil=require(_0xa560('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5780bd,_0x50bb82){_0x50bb82=_0x50bb82||0xcc;return function(_0x24ce10){if(_0x24ce10){return _0x5780bd[_0xa560('0x1c')](_0x50bb82);}return _0x5780bd['status'](_0x50bb82)[_0xa560('0x1d')]();};}function respondWithResult(_0x3c2354,_0x11651b){_0x11651b=_0x11651b||0xc8;return function(_0x387db1){if(_0x387db1){return _0x3c2354[_0xa560('0x1e')](_0x11651b)[_0xa560('0x1f')](_0x387db1);}};}function respondWithFilteredResult(_0x3681b8,_0x215b25){return function(_0x27e96b){if(_0x27e96b){var _0x357b98=typeof _0x215b25[_0xa560('0x20')]==='undefined'&&typeof _0x215b25['limit']===_0xa560('0x21');var _0x43a4b1=_0x27e96b[_0xa560('0x22')];var _0x5501b1=_0x357b98?0x0:_0x215b25['offset'];var _0x5a67aa=_0x357b98?_0x27e96b[_0xa560('0x22')]:_0x215b25['offset']+_0x215b25['limit'];var _0x403cc1;if(_0x5a67aa>=_0x43a4b1){_0x5a67aa=_0x43a4b1;_0x403cc1=0xc8;}else{_0x403cc1=0xce;}_0x3681b8[_0xa560('0x1e')](_0x403cc1);return _0x3681b8[_0xa560('0x23')](_0xa560('0x24'),_0x5501b1+'-'+_0x5a67aa+'/'+_0x43a4b1)[_0xa560('0x1f')](_0x27e96b);}return null;};}function patchUpdates(_0x6754ad){return function(_0x37c550){try{jsonpatch[_0xa560('0x25')](_0x37c550,_0x6754ad,!![]);}catch(_0x53953c){return BPromise['reject'](_0x53953c);}return _0x37c550['save']();};}function saveUpdates(_0x9fcff4,_0x56b42e){return function(_0x330230){if(_0x330230){return _0x330230[_0xa560('0x26')](_0x9fcff4)[_0xa560('0x27')](function(_0x447e49){return _0x447e49;});}return null;};}function removeEntity(_0xd7233,_0x4a3224){return function(_0x439f91){if(_0x439f91){return _0x439f91[_0xa560('0x28')]()[_0xa560('0x27')](function(){_0xd7233[_0xa560('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14e21d,_0xdb0b7d){return function(_0x316c4d){if(!_0x316c4d){_0x14e21d['sendStatus'](0x194);}return _0x316c4d;};}function handleError(_0x2c9133,_0x5d03fc){_0x5d03fc=_0x5d03fc||0x1f4;return function(_0x491881){logger[_0xa560('0x29')](_0x491881['stack']);if(_0x491881[_0xa560('0x2a')]){delete _0x491881[_0xa560('0x2a')];}_0x2c9133[_0xa560('0x1e')](_0x5d03fc)[_0xa560('0x2b')](_0x491881);};}exports['index']=function(_0xd2ffc6,_0x57eaa9){var _0x110742={},_0x51faa2={},_0x5e6104={'count':0x0,'rows':[]};var _0x1d4526=_['map'](db['SmsApplication'][_0xa560('0x2c')],function(_0x5e7033){return{'name':_0x5e7033['fieldName'],'type':_0x5e7033[_0xa560('0x2d')][_0xa560('0x2e')]};});_0x51faa2[_0xa560('0x2f')]=_['map'](_0x1d4526,_0xa560('0x2a'));_0x51faa2['query']=_[_0xa560('0x30')](_0xd2ffc6[_0xa560('0x31')]);_0x51faa2[_0xa560('0x32')]=_[_0xa560('0x33')](_0x51faa2[_0xa560('0x2f')],_0x51faa2[_0xa560('0x31')]);_0x110742[_0xa560('0x34')]=_[_0xa560('0x33')](_0x51faa2['model'],qs[_0xa560('0x35')](_0xd2ffc6[_0xa560('0x31')][_0xa560('0x35')]));_0x110742[_0xa560('0x34')]=_0x110742[_0xa560('0x34')][_0xa560('0x36')]?_0x110742['attributes']:_0x51faa2['model'];if(!_0xd2ffc6[_0xa560('0x31')][_0xa560('0x37')](_0xa560('0x38'))){_0x110742[_0xa560('0x39')]=qs[_0xa560('0x39')](_0xd2ffc6[_0xa560('0x31')][_0xa560('0x39')]);_0x110742[_0xa560('0x20')]=qs['offset'](_0xd2ffc6[_0xa560('0x31')][_0xa560('0x20')]);}_0x110742[_0xa560('0x3a')]=qs[_0xa560('0x3b')](_0xd2ffc6[_0xa560('0x31')][_0xa560('0x3b')]);_0x110742[_0xa560('0x3c')]=qs['filters'](_['pick'](_0xd2ffc6['query'],_0x51faa2[_0xa560('0x32')]),_0x1d4526);if(_0xd2ffc6[_0xa560('0x31')]['filter']){_0x110742[_0xa560('0x3c')]=_[_0xa560('0x3d')](_0x110742[_0xa560('0x3c')],{'$or':_[_0xa560('0x3e')](_0x1d4526,function(_0x4f1f0b){if(_0x4f1f0b[_0xa560('0x2d')]!=='VIRTUAL'){var _0x23e04a={};_0x23e04a[_0x4f1f0b['name']]={'$like':'%'+_0xd2ffc6[_0xa560('0x31')]['filter']+'%'};return _0x23e04a;}})});}_0x110742=_[_0xa560('0x3d')]({},_0x110742,_0xd2ffc6[_0xa560('0x3f')]);var _0x57b585={'where':_0x110742['where']};return db[_0xa560('0x40')][_0xa560('0x22')](_0x57b585)[_0xa560('0x27')](function(_0xc3bed9){_0x5e6104[_0xa560('0x22')]=_0xc3bed9;if(_0xd2ffc6[_0xa560('0x31')]['includeAll']){_0x110742['include']=[{'all':!![]}];}return db['SmsApplication'][_0xa560('0x41')](_0x110742);})[_0xa560('0x27')](function(_0x3988b7){_0x5e6104[_0xa560('0x42')]=_0x3988b7;return _0x5e6104;})['then'](respondWithFilteredResult(_0x57eaa9,_0x110742))['catch'](handleError(_0x57eaa9,null));};exports[_0xa560('0x43')]=function(_0x3ecbb4,_0x301734){var _0x4f6e65={'raw':!![],'where':{'id':_0x3ecbb4['params']['id']}},_0x4ba03c={};_0x4ba03c[_0xa560('0x2f')]=_['keys'](db[_0xa560('0x40')][_0xa560('0x2c')]);_0x4ba03c['query']=_['keys'](_0x3ecbb4['query']);_0x4ba03c[_0xa560('0x32')]=_[_0xa560('0x33')](_0x4ba03c[_0xa560('0x2f')],_0x4ba03c[_0xa560('0x31')]);_0x4f6e65[_0xa560('0x34')]=_[_0xa560('0x33')](_0x4ba03c[_0xa560('0x2f')],qs['fields'](_0x3ecbb4[_0xa560('0x31')][_0xa560('0x35')]));_0x4f6e65[_0xa560('0x34')]=_0x4f6e65[_0xa560('0x34')]['length']?_0x4f6e65[_0xa560('0x34')]:_0x4ba03c['model'];if(_0x3ecbb4[_0xa560('0x31')]['includeAll']){_0x4f6e65['include']=[{'all':!![]}];}_0x4f6e65=_['merge']({},_0x4f6e65,_0x3ecbb4[_0xa560('0x3f')]);return db['SmsApplication'][_0xa560('0x44')](_0x4f6e65)[_0xa560('0x27')](handleEntityNotFound(_0x301734,null))['then'](respondWithResult(_0x301734,null))[_0xa560('0x45')](handleError(_0x301734,null));};exports[_0xa560('0x46')]=function(_0x3b341c,_0x8c8563){return db[_0xa560('0x40')]['create'](_0x3b341c[_0xa560('0x47')],{})[_0xa560('0x27')](respondWithResult(_0x8c8563,0xc9))[_0xa560('0x45')](handleError(_0x8c8563,null));};exports[_0xa560('0x26')]=function(_0x238f96,_0xac7a12){if(_0x238f96[_0xa560('0x47')]['id']){delete _0x238f96[_0xa560('0x47')]['id'];}return db[_0xa560('0x40')][_0xa560('0x44')]({'where':{'id':_0x238f96['params']['id']}})[_0xa560('0x27')](handleEntityNotFound(_0xac7a12,null))[_0xa560('0x27')](saveUpdates(_0x238f96['body'],null))[_0xa560('0x27')](respondWithResult(_0xac7a12,null))[_0xa560('0x45')](handleError(_0xac7a12,null));};exports[_0xa560('0x28')]=function(_0x4f47d1,_0x2e84a6){return db[_0xa560('0x40')][_0xa560('0x44')]({'where':{'id':_0x4f47d1['params']['id']}})['then'](handleEntityNotFound(_0x2e84a6,null))[_0xa560('0x27')](removeEntity(_0x2e84a6,null))['catch'](handleError(_0x2e84a6,null));}; \ No newline at end of file +var _0x5ff3=['order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','keys','catch','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','error','name','send','index','map','SmsApplication','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x3bd974,_0x21b12d){var _0x281a3c=function(_0x4bfeef){while(--_0x4bfeef){_0x3bd974['push'](_0x3bd974['shift']());}};_0x281a3c(++_0x21b12d);}(_0x5ff3,0x1ed));var _0x35ff=function(_0x40161f,_0x7a9d){_0x40161f=_0x40161f-0x0;var _0x408111=_0x5ff3[_0x40161f];return _0x408111;};'use strict';var emlformat=require(_0x35ff('0x0'));var rimraf=require(_0x35ff('0x1'));var zipdir=require(_0x35ff('0x2'));var jsonpatch=require(_0x35ff('0x3'));var rp=require(_0x35ff('0x4'));var moment=require(_0x35ff('0x5'));var BPromise=require(_0x35ff('0x6'));var Mustache=require(_0x35ff('0x7'));var util=require(_0x35ff('0x8'));var path=require(_0x35ff('0x9'));var sox=require(_0x35ff('0xa'));var csv=require('to-csv');var ejs=require(_0x35ff('0xb'));var fs=require('fs');var fs_extra=require(_0x35ff('0xc'));var _=require(_0x35ff('0xd'));var squel=require(_0x35ff('0xe'));var crypto=require(_0x35ff('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x35ff('0x10'));var toCsv=require(_0x35ff('0x11'));var querystring=require('querystring');var Papa=require(_0x35ff('0x12'));var Redis=require(_0x35ff('0x13'));var authService=require(_0x35ff('0x14'));var qs=require(_0x35ff('0x15'));var as=require(_0x35ff('0x16'));var hardwareService=require(_0x35ff('0x17'));var logger=require(_0x35ff('0x18'))(_0x35ff('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x35ff('0x1a'));var db=require(_0x35ff('0x1b'))['db'];function respondWithStatusCode(_0x4428b3,_0x1a9ae9){_0x1a9ae9=_0x1a9ae9||0xcc;return function(_0x3b34fd){if(_0x3b34fd){return _0x4428b3['sendStatus'](_0x1a9ae9);}return _0x4428b3[_0x35ff('0x1c')](_0x1a9ae9)[_0x35ff('0x1d')]();};}function respondWithResult(_0x507141,_0x25901c){_0x25901c=_0x25901c||0xc8;return function(_0x5fb12c){if(_0x5fb12c){return _0x507141[_0x35ff('0x1c')](_0x25901c)['json'](_0x5fb12c);}};}function respondWithFilteredResult(_0x2f0f8d,_0x410e8d){return function(_0x167890){if(_0x167890){var _0x7daa9a=typeof _0x410e8d[_0x35ff('0x1e')]===_0x35ff('0x1f')&&typeof _0x410e8d[_0x35ff('0x20')]===_0x35ff('0x1f');var _0x1b2c73=_0x167890[_0x35ff('0x21')];var _0x49cd87=_0x7daa9a?0x0:_0x410e8d[_0x35ff('0x1e')];var _0x34bc54=_0x7daa9a?_0x167890['count']:_0x410e8d['offset']+_0x410e8d[_0x35ff('0x20')];var _0x5e5e31;if(_0x34bc54>=_0x1b2c73){_0x34bc54=_0x1b2c73;_0x5e5e31=0xc8;}else{_0x5e5e31=0xce;}_0x2f0f8d['status'](_0x5e5e31);return _0x2f0f8d['set'](_0x35ff('0x22'),_0x49cd87+'-'+_0x34bc54+'/'+_0x1b2c73)[_0x35ff('0x23')](_0x167890);}return null;};}function patchUpdates(_0x5cb378){return function(_0xa8ffe){try{jsonpatch[_0x35ff('0x24')](_0xa8ffe,_0x5cb378,!![]);}catch(_0x3731dc){return BPromise[_0x35ff('0x25')](_0x3731dc);}return _0xa8ffe[_0x35ff('0x26')]();};}function saveUpdates(_0x5a2cb9,_0x1edf34){return function(_0xd7f212){if(_0xd7f212){return _0xd7f212[_0x35ff('0x27')](_0x5a2cb9)['then'](function(_0x445eb8){return _0x445eb8;});}return null;};}function removeEntity(_0x2451b1,_0x4d231a){return function(_0x5ca03f){if(_0x5ca03f){return _0x5ca03f[_0x35ff('0x28')]()[_0x35ff('0x29')](function(){_0x2451b1['status'](0xcc)[_0x35ff('0x1d')]();});}};}function handleEntityNotFound(_0x11bf93,_0x416989){return function(_0x357a61){if(!_0x357a61){_0x11bf93[_0x35ff('0x2a')](0x194);}return _0x357a61;};}function handleError(_0x4aa5a0,_0x3ee7e9){_0x3ee7e9=_0x3ee7e9||0x1f4;return function(_0x4a2ef7){logger[_0x35ff('0x2b')](_0x4a2ef7['stack']);if(_0x4a2ef7[_0x35ff('0x2c')]){delete _0x4a2ef7['name'];}_0x4aa5a0[_0x35ff('0x1c')](_0x3ee7e9)[_0x35ff('0x2d')](_0x4a2ef7);};}exports[_0x35ff('0x2e')]=function(_0x2792b1,_0x35c341){var _0x3082b9={},_0x1d86d9={},_0x22e962={'count':0x0,'rows':[]};var _0x5d2b54=_[_0x35ff('0x2f')](db[_0x35ff('0x30')][_0x35ff('0x31')],function(_0x4f1113){return{'name':_0x4f1113[_0x35ff('0x32')],'type':_0x4f1113['type'][_0x35ff('0x33')]};});_0x1d86d9[_0x35ff('0x34')]=_['map'](_0x5d2b54,_0x35ff('0x2c'));_0x1d86d9[_0x35ff('0x35')]=_['keys'](_0x2792b1[_0x35ff('0x35')]);_0x1d86d9[_0x35ff('0x36')]=_['intersection'](_0x1d86d9[_0x35ff('0x34')],_0x1d86d9['query']);_0x3082b9[_0x35ff('0x37')]=_[_0x35ff('0x38')](_0x1d86d9[_0x35ff('0x34')],qs[_0x35ff('0x39')](_0x2792b1[_0x35ff('0x35')][_0x35ff('0x39')]));_0x3082b9[_0x35ff('0x37')]=_0x3082b9[_0x35ff('0x37')][_0x35ff('0x3a')]?_0x3082b9[_0x35ff('0x37')]:_0x1d86d9[_0x35ff('0x34')];if(!_0x2792b1['query'][_0x35ff('0x3b')]('nolimit')){_0x3082b9[_0x35ff('0x20')]=qs['limit'](_0x2792b1[_0x35ff('0x35')][_0x35ff('0x20')]);_0x3082b9[_0x35ff('0x1e')]=qs['offset'](_0x2792b1[_0x35ff('0x35')][_0x35ff('0x1e')]);}_0x3082b9[_0x35ff('0x3c')]=qs['sort'](_0x2792b1[_0x35ff('0x35')][_0x35ff('0x3d')]);_0x3082b9[_0x35ff('0x3e')]=qs[_0x35ff('0x36')](_['pick'](_0x2792b1[_0x35ff('0x35')],_0x1d86d9['filters']),_0x5d2b54);if(_0x2792b1[_0x35ff('0x35')][_0x35ff('0x3f')]){_0x3082b9[_0x35ff('0x3e')]=_['merge'](_0x3082b9[_0x35ff('0x3e')],{'$or':_['map'](_0x5d2b54,function(_0x2526b6){if(_0x2526b6[_0x35ff('0x40')]!==_0x35ff('0x41')){var _0x3b19b4={};_0x3b19b4[_0x2526b6['name']]={'$like':'%'+_0x2792b1[_0x35ff('0x35')][_0x35ff('0x3f')]+'%'};return _0x3b19b4;}})});}_0x3082b9=_[_0x35ff('0x42')]({},_0x3082b9,_0x2792b1[_0x35ff('0x43')]);var _0x597caf={'where':_0x3082b9['where']};return db['SmsApplication'][_0x35ff('0x21')](_0x597caf)[_0x35ff('0x29')](function(_0x326a8e){_0x22e962[_0x35ff('0x21')]=_0x326a8e;if(_0x2792b1[_0x35ff('0x35')][_0x35ff('0x44')]){_0x3082b9[_0x35ff('0x45')]=[{'all':!![]}];}return db[_0x35ff('0x30')][_0x35ff('0x46')](_0x3082b9);})[_0x35ff('0x29')](function(_0x5dad2){_0x22e962[_0x35ff('0x47')]=_0x5dad2;return _0x22e962;})[_0x35ff('0x29')](respondWithFilteredResult(_0x35c341,_0x3082b9))['catch'](handleError(_0x35c341,null));};exports[_0x35ff('0x48')]=function(_0x3e0cc4,_0x20ddd8){var _0x4bf474={'raw':!![],'where':{'id':_0x3e0cc4['params']['id']}},_0xa3241d={};_0xa3241d[_0x35ff('0x34')]=_[_0x35ff('0x49')](db[_0x35ff('0x30')][_0x35ff('0x31')]);_0xa3241d['query']=_[_0x35ff('0x49')](_0x3e0cc4['query']);_0xa3241d['filters']=_['intersection'](_0xa3241d[_0x35ff('0x34')],_0xa3241d['query']);_0x4bf474['attributes']=_[_0x35ff('0x38')](_0xa3241d[_0x35ff('0x34')],qs[_0x35ff('0x39')](_0x3e0cc4[_0x35ff('0x35')]['fields']));_0x4bf474[_0x35ff('0x37')]=_0x4bf474[_0x35ff('0x37')]['length']?_0x4bf474[_0x35ff('0x37')]:_0xa3241d[_0x35ff('0x34')];if(_0x3e0cc4[_0x35ff('0x35')][_0x35ff('0x44')]){_0x4bf474['include']=[{'all':!![]}];}_0x4bf474=_[_0x35ff('0x42')]({},_0x4bf474,_0x3e0cc4[_0x35ff('0x43')]);return db[_0x35ff('0x30')]['find'](_0x4bf474)[_0x35ff('0x29')](handleEntityNotFound(_0x20ddd8,null))['then'](respondWithResult(_0x20ddd8,null))[_0x35ff('0x4a')](handleError(_0x20ddd8,null));};exports[_0x35ff('0x4b')]=function(_0x5452c5,_0x1f0662){return db[_0x35ff('0x30')][_0x35ff('0x4b')](_0x5452c5[_0x35ff('0x4c')],{})['then'](respondWithResult(_0x1f0662,0xc9))[_0x35ff('0x4a')](handleError(_0x1f0662,null));};exports[_0x35ff('0x27')]=function(_0x429c36,_0xe806c1){if(_0x429c36[_0x35ff('0x4c')]['id']){delete _0x429c36[_0x35ff('0x4c')]['id'];}return db['SmsApplication'][_0x35ff('0x4d')]({'where':{'id':_0x429c36[_0x35ff('0x4e')]['id']}})[_0x35ff('0x29')](handleEntityNotFound(_0xe806c1,null))[_0x35ff('0x29')](saveUpdates(_0x429c36[_0x35ff('0x4c')],null))[_0x35ff('0x29')](respondWithResult(_0xe806c1,null))['catch'](handleError(_0xe806c1,null));};exports[_0x35ff('0x28')]=function(_0xd8d0b6,_0x593f39){return db[_0x35ff('0x30')]['find']({'where':{'id':_0xd8d0b6[_0x35ff('0x4e')]['id']}})['then'](handleEntityNotFound(_0x593f39,null))[_0x35ff('0x29')](removeEntity(_0x593f39,null))[_0x35ff('0x4a')](handleError(_0x593f39,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 578670e..0383d35 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 _0x02ba=['sms_applications','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x7e0d57,_0x4194cf){var _0x386e68=function(_0x375ce6){while(--_0x375ce6){_0x7e0d57['push'](_0x7e0d57['shift']());}};_0x386e68(++_0x4194cf);}(_0x02ba,0x9b));var _0xa02b=function(_0x440931,_0x560e2f){_0x440931=_0x440931-0x0;var _0x2f0825=_0x02ba[_0x440931];return _0x2f0825;};'use strict';var _=require(_0xa02b('0x0'));var util=require(_0xa02b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa02b('0x2'));var BPromise=require(_0xa02b('0x3'));var rp=require(_0xa02b('0x4'));var fs=require('fs');var path=require(_0xa02b('0x5'));var rimraf=require(_0xa02b('0x6'));var config=require(_0xa02b('0x7'));var attributes=require('./smsApplication.attributes');module[_0xa02b('0x8')]=function(_0x12a026,_0x34a0b2){return _0x12a026[_0xa02b('0x9')]('SmsApplication',attributes,{'tableName':_0xa02b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x57af=['moment','bluebird','path','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x57af,0xcd));var _0xf57a=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x57af[_0x29b609];return _0x54c952;};'use strict';var _=require(_0xf57a('0x0'));var util=require(_0xf57a('0x1'));var logger=require('../../config/logger')(_0xf57a('0x2'));var moment=require(_0xf57a('0x3'));var BPromise=require(_0xf57a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf57a('0x5'));var rimraf=require('rimraf');var config=require(_0xf57a('0x6'));var attributes=require(_0xf57a('0x7'));module[_0xf57a('0x8')]=function(_0x401ac7,_0x1d50c3){return _0x401ac7[_0xf57a('0x9')](_0xf57a('0xa'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf57a('0xb'),'collate':_0xf57a('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index d737d28..a076f03 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 _0x1c3d=['request\x20sent','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','SmsApplication,\x20%s,\x20%s,\x20%s'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1c3d,0x1b8));var _0xd1c3=function(_0x175f79,_0x7fed9){_0x175f79=_0x175f79-0x0;var _0x5005da=_0x1c3d[_0x175f79];return _0x5005da;};'use strict';var _=require('lodash');var util=require(_0xd1c3('0x0'));var moment=require(_0xd1c3('0x1'));var BPromise=require(_0xd1c3('0x2'));var rs=require(_0xd1c3('0x3'));var fs=require('fs');var Redis=require(_0xd1c3('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd1c3('0x5'))(_0xd1c3('0x6'));var config=require(_0xd1c3('0x7'));var jayson=require(_0xd1c3('0x8'));var client=jayson[_0xd1c3('0x9')][_0xd1c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5adcb7,_0x398766,_0x420ab0){return new BPromise(function(_0x5db2f0,_0x1afc71){return client[_0xd1c3('0xb')](_0x5adcb7,_0x420ab0)[_0xd1c3('0xc')](function(_0x18556c){logger[_0xd1c3('0xd')]('SmsApplication,\x20%s,\x20%s',_0x398766,'request\x20sent');logger[_0xd1c3('0xe')](_0xd1c3('0xf'),_0x398766,_0xd1c3('0x10'),JSON[_0xd1c3('0x11')](_0x18556c));if(_0x18556c[_0xd1c3('0x12')]){if(_0x18556c[_0xd1c3('0x12')][_0xd1c3('0x13')]===0x1f4){logger[_0xd1c3('0x12')](_0xd1c3('0x14'),_0x398766,_0x18556c['error'][_0xd1c3('0x15')]);return _0x1afc71(_0x18556c['error']['message']);}logger[_0xd1c3('0x12')]('SmsApplication,\x20%s,\x20%s',_0x398766,_0x18556c[_0xd1c3('0x12')][_0xd1c3('0x15')]);return _0x5db2f0(_0x18556c[_0xd1c3('0x12')]['message']);}else{logger[_0xd1c3('0xd')](_0xd1c3('0x14'),_0x398766,_0xd1c3('0x10'));_0x5db2f0(_0x18556c[_0xd1c3('0x16')][_0xd1c3('0x15')]);}})[_0xd1c3('0x17')](function(_0x586fa7){logger[_0xd1c3('0x12')](_0xd1c3('0x14'),_0x398766,_0x586fa7);_0x1afc71(_0x586fa7);});});} \ No newline at end of file +var _0x4e7b=['message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','error','code','SmsApplication,\x20%s,\x20%s'];(function(_0x3f5dbe,_0x2cc1d0){var _0x225547=function(_0x2e9cbf){while(--_0x2e9cbf){_0x3f5dbe['push'](_0x3f5dbe['shift']());}};_0x225547(++_0x2cc1d0);}(_0x4e7b,0xf3));var _0xb4e7=function(_0xd747d9,_0x53e805){_0xd747d9=_0xd747d9-0x0;var _0x3fc4b0=_0x4e7b[_0xd747d9];return _0x3fc4b0;};'use strict';var _=require(_0xb4e7('0x0'));var util=require(_0xb4e7('0x1'));var moment=require('moment');var BPromise=require(_0xb4e7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb4e7('0x3'));var db=require(_0xb4e7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb4e7('0x5'))(_0xb4e7('0x6'));var config=require('../../config/environment');var jayson=require(_0xb4e7('0x7'));var client=jayson[_0xb4e7('0x8')][_0xb4e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1dcf05,_0x315c27,_0x490b1b){return new BPromise(function(_0x366595,_0x3e621e){return client['request'](_0x1dcf05,_0x490b1b)[_0xb4e7('0xa')](function(_0x472973){logger[_0xb4e7('0xb')]('SmsApplication,\x20%s,\x20%s',_0x315c27,_0xb4e7('0xc'));logger[_0xb4e7('0xd')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x315c27,'request\x20sent',JSON['stringify'](_0x472973));if(_0x472973['error']){if(_0x472973[_0xb4e7('0xe')][_0xb4e7('0xf')]===0x1f4){logger[_0xb4e7('0xe')](_0xb4e7('0x10'),_0x315c27,_0x472973[_0xb4e7('0xe')][_0xb4e7('0x11')]);return _0x3e621e(_0x472973[_0xb4e7('0xe')][_0xb4e7('0x11')]);}logger[_0xb4e7('0xe')](_0xb4e7('0x10'),_0x315c27,_0x472973[_0xb4e7('0xe')][_0xb4e7('0x11')]);return _0x366595(_0x472973[_0xb4e7('0xe')][_0xb4e7('0x11')]);}else{logger['info'](_0xb4e7('0x10'),_0x315c27,_0xb4e7('0xc'));_0x366595(_0x472973[_0xb4e7('0x12')][_0xb4e7('0x11')]);}})[_0xb4e7('0x13')](function(_0x3078a0){logger['error']('SmsApplication,\x20%s,\x20%s',_0x315c27,_0x3078a0);_0x3e621e(_0x3078a0);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 0709ee6..3f2bf33 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 _0x4cf8=['/:id','/:id/messages','getMessages','/:id/download','create','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','describe'];(function(_0x2db8ae,_0x3ebe21){var _0x41f9f5=function(_0x406079){while(--_0x406079){_0x2db8ae['push'](_0x2db8ae['shift']());}};_0x41f9f5(++_0x3ebe21);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x295143,_0x105ade){_0x295143=_0x295143-0x0;var _0x7982e4=_0x4cf8[_0x295143];return _0x7982e4;};'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 fs_extra=require(_0x84cf('0x6'));var auth=require(_0x84cf('0x7'));var interaction=require(_0x84cf('0x8'));var config=require(_0x84cf('0x9'));var controller=require(_0x84cf('0xa'));router[_0x84cf('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x84cf('0xb')]('/describe',auth[_0x84cf('0xc')](),controller[_0x84cf('0xd')]);router['get'](_0x84cf('0xe'),auth[_0x84cf('0xc')](),controller['show']);router[_0x84cf('0xb')](_0x84cf('0xf'),auth[_0x84cf('0xc')](),controller[_0x84cf('0x10')]);router['get'](_0x84cf('0x11'),auth[_0x84cf('0xc')](),controller['download']);router['post']('/',auth[_0x84cf('0xc')](),controller[_0x84cf('0x12')]);router[_0x84cf('0x13')](_0x84cf('0xf'),auth[_0x84cf('0xc')](),controller[_0x84cf('0x14')]);router[_0x84cf('0x13')](_0x84cf('0x15'),auth[_0x84cf('0xc')](),interaction[_0x84cf('0x16')](_0x84cf('0x17'),_0x84cf('0x18')),controller[_0x84cf('0x19')]);router[_0x84cf('0x1a')](_0x84cf('0xe'),auth[_0x84cf('0xc')](),interaction[_0x84cf('0x16')](_0x84cf('0x17'),_0x84cf('0x1b')),controller['update']);router[_0x84cf('0x1c')](_0x84cf('0xe'),auth[_0x84cf('0xc')](),interaction[_0x84cf('0x16')](_0x84cf('0x17'),_0x84cf('0x1d')),controller[_0x84cf('0x1e')]);router['delete']('/:id/tags',auth[_0x84cf('0xc')](),controller[_0x84cf('0x1f')]);module[_0x84cf('0x20')]=router; \ No newline at end of file +var _0x5eb8=['smsinteraction:update','update','delete','smsinteraction:destroy','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put'];(function(_0x110afa,_0x43963c){var _0x31ceb3=function(_0x43e8c2){while(--_0x43e8c2){_0x110afa['push'](_0x110afa['shift']());}};_0x31ceb3(++_0x43963c);}(_0x5eb8,0xb0));var _0x85eb=function(_0x2e58c7,_0x23d092){_0x2e58c7=_0x2e58c7-0x0;var _0x26eb00=_0x5eb8[_0x2e58c7];return _0x26eb00;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['get'](_0x85eb('0xe'),auth['isAuthenticated'](),controller[_0x85eb('0xf')]);router[_0x85eb('0x9')](_0x85eb('0x10'),auth[_0x85eb('0xa')](),controller[_0x85eb('0x11')]);router[_0x85eb('0x9')](_0x85eb('0x12'),auth['isAuthenticated'](),controller[_0x85eb('0x13')]);router[_0x85eb('0x14')]('/',auth['isAuthenticated'](),controller[_0x85eb('0x15')]);router[_0x85eb('0x14')](_0x85eb('0x10'),auth[_0x85eb('0xa')](),controller['addMessage']);router['post'](_0x85eb('0x16'),auth['isAuthenticated'](),interaction[_0x85eb('0x17')](_0x85eb('0x18'),_0x85eb('0x19')),controller[_0x85eb('0x1a')]);router[_0x85eb('0x1b')]('/:id',auth[_0x85eb('0xa')](),interaction['tracked'](_0x85eb('0x18'),_0x85eb('0x1c')),controller[_0x85eb('0x1d')]);router[_0x85eb('0x1e')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x85eb('0x18'),_0x85eb('0x1f')),controller[_0x85eb('0x20')]);router[_0x85eb('0x1e')](_0x85eb('0x16'),auth[_0x85eb('0xa')](),controller['removeTags']);module[_0x85eb('0x21')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index dbad60a..bdd3ce9 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 _0xbd51=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x5e2e92,_0x50bec2){var _0x49a78e=function(_0x4b2ceb){while(--_0x4b2ceb){_0x5e2e92['push'](_0x5e2e92['shift']());}};_0x49a78e(++_0x50bec2);}(_0xbd51,0x1a8));var _0x1bd5=function(_0xd46ff1,_0x4cb78d){_0xd46ff1=_0xd46ff1-0x0;var _0x5a3bc1=_0xbd51[_0xd46ff1];return _0x5a3bc1;};'use strict';var Sequelize=require(_0x1bd5('0x0'));var moment=require('moment');module[_0x1bd5('0x1')]={'closed':{'type':Sequelize[_0x1bd5('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1bd5('0x3')]},'disposition':{'type':Sequelize[_0x1bd5('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x1bd5('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x1bd5('0x5')]('in',_0x1bd5('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x1bd5('0x5')]('in',_0x1bd5('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x1bd5('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xf8bb=['BOOLEAN','sequelize','moment','exports','DATE','STRING','ENUM','out'];(function(_0x3e8dac,_0x5aa4cb){var _0x2b8531=function(_0xb3e054){while(--_0xb3e054){_0x3e8dac['push'](_0x3e8dac['shift']());}};_0x2b8531(++_0x5aa4cb);}(_0xf8bb,0x111));var _0xbf8b=function(_0x4cfe0e,_0x1860da){_0x4cfe0e=_0x4cfe0e-0x0;var _0x3c6da3=_0xf8bb[_0x4cfe0e];return _0x3c6da3;};'use strict';var Sequelize=require(_0xbf8b('0x0'));var moment=require(_0xbf8b('0x1'));module[_0xbf8b('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbf8b('0x3')]},'disposition':{'type':Sequelize[_0xbf8b('0x4')]},'secondDisposition':{'type':Sequelize[_0xbf8b('0x4')]},'thirdDisposition':{'type':Sequelize[_0xbf8b('0x4')]},'note':{'type':Sequelize[_0xbf8b('0x4')]},'phone':{'type':Sequelize[_0xbf8b('0x4')]},'read1stAt':{'type':Sequelize[_0xbf8b('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xbf8b('0x5')]('in',_0xbf8b('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbf8b('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xbf8b('0x5')]('in',_0xbf8b('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xbf8b('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 9c989ed..0d20f2e 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 _0xfe31=['smsInteractionTags:save','removeTags','unix','toString','join','root','server','files','tmp','transcript-%d-%s.zip','User','fullname','push','CmContact','Contact','firstName','lastName','direction','secret','read','SmsAccount','Account','Owner','mkdirSync','Sms','N.A.','createdAt','closed','disposition','out','System','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','zip-dir','moment','bluebird','path','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','../../mysqldb','redis','localhost','socket.io-emitter','register','status','end','json','undefined','limit','count','update','destroy','then','sendStatus','error','stack','name','map','SmsInteraction','rawAttributes','fieldName','type','getOptions','findAll','sms','query','user','show','model','keys','intersection','attributes','fields','length','includeAll','include','options','find','create','body','params','catch','describe','addMessage','SmsMessage','ids','getMessages','findOne','filters','offset','order','sort','where','pick','SmsInteractionId','filter','merge','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','omit','spread','Tag','color'];(function(_0x65ff6c,_0x4c2da3){var _0x238215=function(_0x485ddf){while(--_0x485ddf){_0x65ff6c['push'](_0x65ff6c['shift']());}};_0x238215(++_0x4c2da3);}(_0xfe31,0x108));var _0x1fe3=function(_0x4e0e36,_0x5ded03){_0x4e0e36=_0x4e0e36-0x0;var _0x44943b=_0xfe31[_0x4e0e36];return _0x44943b;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x1fe3('0x0'));var moment=require(_0x1fe3('0x1'));var BPromise=require(_0x1fe3('0x2'));var util=require('util');var path=require(_0x1fe3('0x3'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0x1fe3('0x4'));var interaction=require(_0x1fe3('0x5'));var qs=require('../../components/parsers/qs');var pdf=require(_0x1fe3('0x6'));var logger=require(_0x1fe3('0x7'))('api');var config=require('../../config/environment');var db=require(_0x1fe3('0x8'))['db'];config[_0x1fe3('0x9')]=_['defaults'](config[_0x1fe3('0x9')],{'host':_0x1fe3('0xa'),'port':0x18eb});var socket=require(_0x1fe3('0xb'))(new Redis(config[_0x1fe3('0x9')]));require('./smsInteraction.socket')[_0x1fe3('0xc')](socket);function respondWithStatusCode(_0x191535,_0xdec783){_0xdec783=_0xdec783||0xcc;return function(_0x25d1ef){if(_0x25d1ef){return _0x191535['sendStatus'](_0xdec783);}return _0x191535[_0x1fe3('0xd')](_0xdec783)[_0x1fe3('0xe')]();};}function respondWithResult(_0xefae9d,_0xd96c9a){_0xd96c9a=_0xd96c9a||0xc8;return function(_0x405336){if(_0x405336){return _0xefae9d[_0x1fe3('0xd')](_0xd96c9a)[_0x1fe3('0xf')](_0x405336);}};}function respondWithFilteredResult(_0x3a20da,_0x56059e){return function(_0x223189){if(_0x223189){var _0x4de8f5=typeof _0x56059e['offset']===_0x1fe3('0x10')&&typeof _0x56059e[_0x1fe3('0x11')]===_0x1fe3('0x10');var _0x2df788=_0x223189[_0x1fe3('0x12')];var _0x3d6396=_0x4de8f5?0x0:_0x56059e['offset'];var _0x1f3397=_0x4de8f5?_0x223189['count']:_0x56059e['offset']+_0x56059e[_0x1fe3('0x11')];var _0x1c796b;if(_0x1f3397>=_0x2df788){_0x1f3397=_0x2df788;_0x1c796b=0xc8;}else{_0x1c796b=0xce;}_0x3a20da[_0x1fe3('0xd')](_0x1c796b);return _0x3a20da['set']('Content-Range',_0x3d6396+'-'+_0x1f3397+'/'+_0x2df788)[_0x1fe3('0xf')](_0x223189);}return null;};}function saveUpdates(_0x446e94){return function(_0x504bd1){if(_0x504bd1){return _0x504bd1[_0x1fe3('0x13')](_0x446e94)['then'](function(_0x2741f0){return _0x2741f0;});}return null;};}function removeEntity(_0xbbe62b){return function(_0x46aaad){if(_0x46aaad){return _0x46aaad[_0x1fe3('0x14')]()[_0x1fe3('0x15')](function(){_0xbbe62b[_0x1fe3('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x494f7c){return function(_0x2b4dd6){if(!_0x2b4dd6){_0x494f7c[_0x1fe3('0x16')](0x194);}return _0x2b4dd6;};}function handleError(_0x170eec,_0xf71517){_0xf71517=_0xf71517||0x1f4;return function(_0x21fc2c){logger[_0x1fe3('0x17')](_0x21fc2c[_0x1fe3('0x18')]);if(_0x21fc2c['name']){delete _0x21fc2c[_0x1fe3('0x19')];}_0x170eec[_0x1fe3('0xd')](_0xf71517)['send'](_0x21fc2c);};}exports['index']=function(_0x133175,_0x1efcc5){var _0x5e0137={};var _0x2c2381=_[_0x1fe3('0x1a')](db[_0x1fe3('0x1b')][_0x1fe3('0x1c')],function(_0x534fb8){return{'name':_0x534fb8[_0x1fe3('0x1d')],'type':_0x534fb8[_0x1fe3('0x1e')]['key']};});_0x5e0137=qs[_0x1fe3('0x1f')](_0x2c2381,_0x133175);return interaction[_0x1fe3('0x20')](_0x1fe3('0x21'),_0x133175[_0x1fe3('0x22')],_0x133175[_0x1fe3('0x23')],_0x5e0137,_0x2c2381)['then'](respondWithFilteredResult(_0x1efcc5,_0x5e0137))['catch'](handleError(_0x1efcc5,null));};exports[_0x1fe3('0x24')]=function(_0x2b478a,_0x10046d){var _0x14d052={'raw':![],'where':{'id':_0x2b478a['params']['id']}},_0x17755a={};_0x17755a[_0x1fe3('0x25')]=_[_0x1fe3('0x26')](db[_0x1fe3('0x1b')][_0x1fe3('0x1c')]);_0x17755a[_0x1fe3('0x22')]=_[_0x1fe3('0x26')](_0x2b478a['query']);_0x17755a['filters']=_[_0x1fe3('0x27')](_0x17755a[_0x1fe3('0x25')],_0x17755a[_0x1fe3('0x22')]);_0x14d052[_0x1fe3('0x28')]=_[_0x1fe3('0x27')](_0x17755a[_0x1fe3('0x25')],qs['fields'](_0x2b478a[_0x1fe3('0x22')][_0x1fe3('0x29')]));_0x14d052[_0x1fe3('0x28')]=_0x14d052[_0x1fe3('0x28')][_0x1fe3('0x2a')]?_0x14d052[_0x1fe3('0x28')]:_0x17755a[_0x1fe3('0x25')];if(_0x2b478a[_0x1fe3('0x22')][_0x1fe3('0x2b')]){_0x14d052[_0x1fe3('0x2c')]=[{'all':!![]}];}_0x14d052=_['merge']({},_0x14d052,_0x2b478a[_0x1fe3('0x2d')]);return db[_0x1fe3('0x1b')][_0x1fe3('0x2e')](_0x14d052)[_0x1fe3('0x15')](handleEntityNotFound(_0x10046d,null))[_0x1fe3('0x15')](respondWithResult(_0x10046d,null))['catch'](handleError(_0x10046d,null));};exports[_0x1fe3('0x2f')]=function(_0x4b135b,_0x270d23){return db['SmsInteraction']['create'](_0x4b135b[_0x1fe3('0x30')],{})['then'](respondWithResult(_0x270d23,0xc9))['catch'](handleError(_0x270d23,null));};exports[_0x1fe3('0x13')]=function(_0x23e888,_0x28d821){if(_0x23e888[_0x1fe3('0x30')]['id']){delete _0x23e888[_0x1fe3('0x30')]['id'];}return db[_0x1fe3('0x1b')][_0x1fe3('0x2e')]({'where':{'id':_0x23e888[_0x1fe3('0x31')]['id']}})[_0x1fe3('0x15')](handleEntityNotFound(_0x28d821,null))['then'](saveUpdates(_0x23e888[_0x1fe3('0x30')],null))[_0x1fe3('0x15')](respondWithResult(_0x28d821,null))['catch'](handleError(_0x28d821,null));};exports[_0x1fe3('0x14')]=function(_0x18332f,_0x172506){return db[_0x1fe3('0x1b')]['find']({'where':{'id':_0x18332f[_0x1fe3('0x31')]['id']}})[_0x1fe3('0x15')](handleEntityNotFound(_0x172506,null))[_0x1fe3('0x15')](removeEntity(_0x172506,null))[_0x1fe3('0x32')](handleError(_0x172506,null));};exports[_0x1fe3('0x33')]=function(_0x8cae7,_0x424f9a){return db[_0x1fe3('0x1b')][_0x1fe3('0x33')]()[_0x1fe3('0x15')](respondWithResult(_0x424f9a,null))[_0x1fe3('0x32')](handleError(_0x424f9a,null));};exports[_0x1fe3('0x34')]=function(_0x139ac4,_0x13ce38){return db[_0x1fe3('0x35')][_0x1fe3('0x2e')]({'where':{'id':_0x139ac4['params']['id']}})['then'](handleEntityNotFound(_0x13ce38,null))['then'](function(_0xfa3ece){if(_0xfa3ece){return _0xfa3ece[_0x1fe3('0x34')](_0x139ac4[_0x1fe3('0x30')][_0x1fe3('0x36')],_['omit'](_0x139ac4['body'],['ids','id'])||{});}})[_0x1fe3('0x15')](respondWithResult(_0x13ce38,null))[_0x1fe3('0x32')](handleError(_0x13ce38,null));};exports[_0x1fe3('0x37')]=function(_0x135dda,_0x40d653){var _0x2b3567={'raw':![],'where':{}};var _0x543f03={};var _0x412738={'count':0x0,'rows':[]};return db[_0x1fe3('0x1b')][_0x1fe3('0x38')]({'where':{'id':_0x135dda[_0x1fe3('0x31')]['id']}})[_0x1fe3('0x15')](handleEntityNotFound(_0x40d653,null))[_0x1fe3('0x15')](function(_0x3ecd1c){if(_0x3ecd1c){_0x543f03[_0x1fe3('0x25')]=_[_0x1fe3('0x26')](db[_0x1fe3('0x35')][_0x1fe3('0x1c')]);_0x543f03[_0x1fe3('0x22')]=_[_0x1fe3('0x26')](_0x135dda[_0x1fe3('0x22')]);_0x543f03[_0x1fe3('0x39')]=_[_0x1fe3('0x27')](_0x543f03['model'],_0x543f03['query']);_0x2b3567['attributes']=_['intersection'](_0x543f03[_0x1fe3('0x25')],qs[_0x1fe3('0x29')](_0x135dda['query'][_0x1fe3('0x29')]));_0x2b3567['attributes']=_0x2b3567[_0x1fe3('0x28')][_0x1fe3('0x2a')]?_0x2b3567[_0x1fe3('0x28')]:_0x543f03[_0x1fe3('0x25')];if(!_0x135dda[_0x1fe3('0x22')]['hasOwnProperty']('nolimit')){_0x2b3567[_0x1fe3('0x11')]=qs[_0x1fe3('0x11')](_0x135dda[_0x1fe3('0x22')][_0x1fe3('0x11')]);_0x2b3567['offset']=qs[_0x1fe3('0x3a')](_0x135dda['query'][_0x1fe3('0x3a')]);}_0x2b3567[_0x1fe3('0x3b')]=qs[_0x1fe3('0x3c')](_0x135dda[_0x1fe3('0x22')][_0x1fe3('0x3c')]);_0x2b3567[_0x1fe3('0x3d')]=qs[_0x1fe3('0x39')](_[_0x1fe3('0x3e')](_0x135dda[_0x1fe3('0x22')],_0x543f03[_0x1fe3('0x39')]));_0x2b3567[_0x1fe3('0x3d')][_0x1fe3('0x3f')]=_0x3ecd1c['id'];if(_0x135dda[_0x1fe3('0x22')][_0x1fe3('0x40')]){_0x2b3567['where']=_[_0x1fe3('0x41')](_0x2b3567[_0x1fe3('0x3d')],{'$or':_['map'](_0x2b3567[_0x1fe3('0x28')],function(_0x525c41){var _0x57d930={};_0x57d930[_0x525c41]={'$like':'%'+_0x135dda['query'][_0x1fe3('0x40')]+'%'};return _0x57d930;})});}if(_0x135dda[_0x1fe3('0x22')][_0x1fe3('0x42')]){var _0x2126b1=_0x135dda[_0x1fe3('0x22')][_0x1fe3('0x42')]['split'](',');var _0x23d521={};_0x23d521[_0x2126b1[0x0]]={'$gte':moment(_0x2126b1[0x1])[_0x1fe3('0x43')](_0x1fe3('0x44'))};_0x2b3567[_0x1fe3('0x3d')]=_[_0x1fe3('0x41')](_0x2b3567[_0x1fe3('0x3d')],_0x23d521);}_0x2b3567=_[_0x1fe3('0x41')]({},_0x2b3567,_0x135dda[_0x1fe3('0x2d')]);return db[_0x1fe3('0x35')][_0x1fe3('0x12')]({'where':_0x2b3567[_0x1fe3('0x3d')]})['then'](function(_0x460afa){_0x412738[_0x1fe3('0x12')]=_0x460afa;if(_0x135dda[_0x1fe3('0x22')][_0x1fe3('0x2b')]){_0x2b3567['include']=[{'all':!![]}];}return db[_0x1fe3('0x35')]['findAll'](_0x2b3567);})[_0x1fe3('0x15')](function(_0x755c98){_0x412738[_0x1fe3('0x45')]=_0x755c98;return _0x412738;});}})[_0x1fe3('0x15')](respondWithFilteredResult(_0x40d653,_0x2b3567))[_0x1fe3('0x32')](handleError(_0x40d653,null));};exports[_0x1fe3('0x46')]=function(_0x56ad21,_0xf02e8){return db['SmsInteraction']['find']({'where':{'id':_0x56ad21['params']['id']}})[_0x1fe3('0x15')](handleEntityNotFound(_0xf02e8,null))['then'](function(_0x1a48ff){if(_0x1a48ff){return _0x1a48ff['setTags'](_0x56ad21[_0x1fe3('0x30')]['ids'],_[_0x1fe3('0x47')](_0x56ad21[_0x1fe3('0x30')],[_0x1fe3('0x36'),'id'])||{})[_0x1fe3('0x48')](function(){return db[_0x1fe3('0x49')][_0x1fe3('0x20')]({'attributes':['id','name',_0x1fe3('0x4a')],'where':{'id':_0x56ad21['body'][_0x1fe3('0x36')]}});})[_0x1fe3('0x15')](function(_0x348ee2){socket['emit'](_0x1fe3('0x4b'),{'id':Number(_0x56ad21[_0x1fe3('0x31')]['id']),'tags':_0x348ee2||[]});return{'id':Number(_0x56ad21['params']['id']),'tags':_0x348ee2||[]};});}})[_0x1fe3('0x15')](respondWithResult(_0xf02e8,null))[_0x1fe3('0x32')](handleError(_0xf02e8,null));};exports[_0x1fe3('0x4c')]=function(_0x1d1160,_0x82aca9){return db['SmsInteraction']['find']({'where':{'id':_0x1d1160[_0x1fe3('0x31')]['id']}})[_0x1fe3('0x15')](handleEntityNotFound(_0x82aca9,null))['then'](function(_0x46c266){if(_0x46c266){return _0x46c266['removeTags'](_0x1d1160[_0x1fe3('0x22')][_0x1fe3('0x36')]);}})[_0x1fe3('0x15')](respondWithStatusCode(_0x82aca9,null))[_0x1fe3('0x32')](handleError(_0x82aca9,null));};exports['download']=function(_0x35bfd1,_0x5a472f){var _0x1e5629=moment()[_0x1fe3('0x4d')]()[_0x1fe3('0x4e')]();var _0x421060=path[_0x1fe3('0x4f')](config[_0x1fe3('0x50')],_0x1fe3('0x51'),_0x1fe3('0x52'),_0x1fe3('0x53'));var _0xcb2f02=path[_0x1fe3('0x4f')](_0x421060,_0x1e5629);var _0x50c227=util[_0x1fe3('0x43')](_0x1fe3('0x54'),_0x35bfd1[_0x1fe3('0x31')]['id'],_0x1e5629);var _0x5b6099=path[_0x1fe3('0x4f')](_0x421060,_0x50c227);var _0x554ab6=[];_0x554ab6['push']({'model':db[_0x1fe3('0x55')],'as':_0x1fe3('0x55'),'attributes':['id',_0x1fe3('0x56')],'raw':!![]});_0x554ab6[_0x1fe3('0x57')]({'model':db[_0x1fe3('0x58')],'as':_0x1fe3('0x59'),'attributes':['id',_0x1fe3('0x5a'),_0x1fe3('0x5b')],'raw':!![]});var _0x45077f=[{'model':db[_0x1fe3('0x35')],'as':'Messages','attributes':['id',_0x1fe3('0x30'),'createdAt',_0x1fe3('0x5c'),_0x1fe3('0x5d'),_0x1fe3('0x5e')],'include':_0x554ab6}];_0x45077f[_0x1fe3('0x57')]({'model':db[_0x1fe3('0x5f')],'as':_0x1fe3('0x60'),'attributes':['id','name']});_0x45077f[_0x1fe3('0x57')]({'model':db[_0x1fe3('0x55')],'as':_0x1fe3('0x61'),'attributes':['id',_0x1fe3('0x56')]});return db['SmsInteraction'][_0x1fe3('0x2e')]({'where':{'id':_0x35bfd1[_0x1fe3('0x31')]['id']},'include':_0x45077f})[_0x1fe3('0x15')](handleEntityNotFound(_0x5a472f,null))['then'](function(_0x1b2f20){if(_0x1b2f20){var _0x25ee65=_0x1b2f20['get']({'plain':!![]});fs[_0x1fe3('0x62')](_0xcb2f02);var _0x167e5b={'channel':_0x1fe3('0x63'),'account':_0x25ee65[_0x1fe3('0x60')][_0x1fe3('0x19')],'agent':_0x25ee65['Owner']?_0x25ee65[_0x1fe3('0x61')][_0x1fe3('0x56')]:_0x1fe3('0x64'),'createdAt':moment(_0x25ee65[_0x1fe3('0x65')])['format'](_0x1fe3('0x44'))[_0x1fe3('0x4e')](),'closedAt':_0x25ee65[_0x1fe3('0x66')]?moment(_0x25ee65['closedAt'])['format'](_0x1fe3('0x44'))[_0x1fe3('0x4e')]():'','disposition':_0x25ee65[_0x1fe3('0x67')],'messages':_(_0x25ee65['Messages'])[_0x1fe3('0x40')]({'secret':![]})[_0x1fe3('0x1a')](function(_0x1aead6){return{'date':moment(_0x1aead6[_0x1fe3('0x65')])[_0x1fe3('0x43')](_0x1fe3('0x44'))[_0x1fe3('0x4e')](),'sender':_0x1aead6['direction']===_0x1fe3('0x68')?_0x1aead6['User']?_0x1aead6['User']['fullname']:_0x1fe3('0x69'):_0x1aead6['Contact'][_0x1fe3('0x5a')]+(_0x1aead6[_0x1fe3('0x59')][_0x1fe3('0x5b')]?'\x20'+_0x1aead6[_0x1fe3('0x59')][_0x1fe3('0x5b')]:''),'body':_0x1aead6[_0x1fe3('0x30')],'direction':_0x1aead6[_0x1fe3('0x5c')]===_0x1fe3('0x68')?'A':'C','secret':_0x1aead6['secret'],'read':_0x1aead6['read']};})['value']()};return ejs[_0x1fe3('0x6a')](path[_0x1fe3('0x4f')](config[_0x1fe3('0x50')],_0x1fe3('0x51'),'views',_0x1fe3('0x6b')),{'interaction':_0x167e5b})['then'](function(_0x4a02dc){var _0x3cf5d2=path[_0x1fe3('0x4f')](_0xcb2f02,_0x1fe3('0x6c')+_0x25ee65['id']+'-'+_0x1e5629+_0x1fe3('0x6d'));var _0x39e290={'path':_0x3cf5d2,'channel':_0x1fe3('0x63'),'interactionId':_0x25ee65['id']};return pdf[_0x1fe3('0x6e')](_0x4a02dc,_0x39e290);})['then'](function(){return new BPromise(function(_0x114786,_0x10bb86){zipdir(_0xcb2f02,{'saveTo':_0x5b6099},function(_0x39f580,_0x538558){if(_0x39f580)return _0x10bb86(_0x39f580);return _0x114786(_0x538558);});})['then'](function(){return new BPromise(function(_0x583553,_0x1d4c0a){rimraf(_0xcb2f02,function(_0x596684){if(_0x596684)_0x1d4c0a(_0x596684);return _0x583553();});});})[_0x1fe3('0x15')](function(){return _0x5a472f[_0x1fe3('0x6f')](_0x5b6099,_0x50c227,function(_0x596367){if(_0x596367){console[_0x1fe3('0x70')]('err',_0x596367);}else{fs['unlinkSync'](_0x5b6099);}});});});}else{return _0x5a472f['sendStatus'](0xc8);}})[_0x1fe3('0x32')](handleError(_0x5a472f,null));}; \ No newline at end of file +var _0x09e3=['color','emit','removeTags','download','toString','join','root','server','files','tmp','push','User','firstName','createdAt','direction','secret','SmsAccount','Owner','fullname','get','mkdirSync','closed','closedAt','out','Contact','lastName','read','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Sms','createPdfFromHTML','log','err','unlinkSync','zip-dir','moment','bluebird','util','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','redis','localhost','./smsInteraction.socket','register','sendStatus','end','json','undefined','limit','offset','count','set','Content-Range','then','destroy','status','error','name','send','index','SmsInteraction','rawAttributes','type','key','findAll','sms','user','show','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','include','options','find','catch','create','body','update','describe','addMessage','omit','ids','getMessages','findOne','SmsMessage','hasOwnProperty','order','sort','pick','where','SmsInteractionId','merge','map','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread'];(function(_0x125985,_0x3a3df2){var _0x2726d3=function(_0x35a3d){while(--_0x35a3d){_0x125985['push'](_0x125985['shift']());}};_0x2726d3(++_0x3a3df2);}(_0x09e3,0x188));var _0x309e=function(_0x31e9ae,_0x217a5a){_0x31e9ae=_0x31e9ae-0x0;var _0x3a9751=_0x09e3[_0x31e9ae];return _0x3a9751;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x309e('0x0'));var moment=require(_0x309e('0x1'));var BPromise=require(_0x309e('0x2'));var util=require(_0x309e('0x3'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x309e('0x4'));var Redis=require(_0x309e('0x5'));var interaction=require(_0x309e('0x6'));var qs=require('../../components/parsers/qs');var pdf=require(_0x309e('0x7'));var logger=require(_0x309e('0x8'))(_0x309e('0x9'));var config=require(_0x309e('0xa'));var db=require('../../mysqldb')['db'];config[_0x309e('0xb')]=_['defaults'](config[_0x309e('0xb')],{'host':_0x309e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x309e('0xb')]));require(_0x309e('0xd'))[_0x309e('0xe')](socket);function respondWithStatusCode(_0x9879e,_0x1550b5){_0x1550b5=_0x1550b5||0xcc;return function(_0x2b5a8d){if(_0x2b5a8d){return _0x9879e[_0x309e('0xf')](_0x1550b5);}return _0x9879e['status'](_0x1550b5)[_0x309e('0x10')]();};}function respondWithResult(_0x2a7c29,_0x51f967){_0x51f967=_0x51f967||0xc8;return function(_0x353881){if(_0x353881){return _0x2a7c29['status'](_0x51f967)[_0x309e('0x11')](_0x353881);}};}function respondWithFilteredResult(_0x532d96,_0x535947){return function(_0x30c66f){if(_0x30c66f){var _0x3f79d3=typeof _0x535947['offset']===_0x309e('0x12')&&typeof _0x535947[_0x309e('0x13')]===_0x309e('0x12');var _0x571efb=_0x30c66f['count'];var _0x3c8b8f=_0x3f79d3?0x0:_0x535947[_0x309e('0x14')];var _0x51d7a8=_0x3f79d3?_0x30c66f[_0x309e('0x15')]:_0x535947[_0x309e('0x14')]+_0x535947[_0x309e('0x13')];var _0x5a34a2;if(_0x51d7a8>=_0x571efb){_0x51d7a8=_0x571efb;_0x5a34a2=0xc8;}else{_0x5a34a2=0xce;}_0x532d96['status'](_0x5a34a2);return _0x532d96[_0x309e('0x16')](_0x309e('0x17'),_0x3c8b8f+'-'+_0x51d7a8+'/'+_0x571efb)['json'](_0x30c66f);}return null;};}function saveUpdates(_0x3ec860){return function(_0x5a686e){if(_0x5a686e){return _0x5a686e['update'](_0x3ec860)[_0x309e('0x18')](function(_0x3bdf58){return _0x3bdf58;});}return null;};}function removeEntity(_0x1ada05){return function(_0x230cfa){if(_0x230cfa){return _0x230cfa[_0x309e('0x19')]()['then'](function(){_0x1ada05[_0x309e('0x1a')](0xcc)[_0x309e('0x10')]();});}};}function handleEntityNotFound(_0x3d98f4){return function(_0x32e5f6){if(!_0x32e5f6){_0x3d98f4['sendStatus'](0x194);}return _0x32e5f6;};}function handleError(_0x3af915,_0xe27171){_0xe27171=_0xe27171||0x1f4;return function(_0x112924){logger[_0x309e('0x1b')](_0x112924['stack']);if(_0x112924[_0x309e('0x1c')]){delete _0x112924[_0x309e('0x1c')];}_0x3af915['status'](_0xe27171)[_0x309e('0x1d')](_0x112924);};}exports[_0x309e('0x1e')]=function(_0xa34e96,_0x5caf3b){var _0x4395e2={};var _0x29e2c3=_['map'](db[_0x309e('0x1f')][_0x309e('0x20')],function(_0x190fcb){return{'name':_0x190fcb['fieldName'],'type':_0x190fcb[_0x309e('0x21')][_0x309e('0x22')]};});_0x4395e2=qs['getOptions'](_0x29e2c3,_0xa34e96);return interaction[_0x309e('0x23')](_0x309e('0x24'),_0xa34e96['query'],_0xa34e96[_0x309e('0x25')],_0x4395e2,_0x29e2c3)[_0x309e('0x18')](respondWithFilteredResult(_0x5caf3b,_0x4395e2))['catch'](handleError(_0x5caf3b,null));};exports[_0x309e('0x26')]=function(_0x10bd6e,_0x2c199e){var _0x641095={'raw':![],'where':{'id':_0x10bd6e[_0x309e('0x27')]['id']}},_0x245fb5={};_0x245fb5[_0x309e('0x28')]=_[_0x309e('0x29')](db[_0x309e('0x1f')][_0x309e('0x20')]);_0x245fb5[_0x309e('0x2a')]=_[_0x309e('0x29')](_0x10bd6e[_0x309e('0x2a')]);_0x245fb5[_0x309e('0x2b')]=_[_0x309e('0x2c')](_0x245fb5[_0x309e('0x28')],_0x245fb5['query']);_0x641095[_0x309e('0x2d')]=_['intersection'](_0x245fb5[_0x309e('0x28')],qs[_0x309e('0x2e')](_0x10bd6e[_0x309e('0x2a')]['fields']));_0x641095[_0x309e('0x2d')]=_0x641095[_0x309e('0x2d')][_0x309e('0x2f')]?_0x641095[_0x309e('0x2d')]:_0x245fb5[_0x309e('0x28')];if(_0x10bd6e['query'][_0x309e('0x30')]){_0x641095[_0x309e('0x31')]=[{'all':!![]}];}_0x641095=_['merge']({},_0x641095,_0x10bd6e[_0x309e('0x32')]);return db['SmsInteraction'][_0x309e('0x33')](_0x641095)[_0x309e('0x18')](handleEntityNotFound(_0x2c199e,null))[_0x309e('0x18')](respondWithResult(_0x2c199e,null))[_0x309e('0x34')](handleError(_0x2c199e,null));};exports[_0x309e('0x35')]=function(_0x239e0d,_0x27f0ad){return db[_0x309e('0x1f')][_0x309e('0x35')](_0x239e0d[_0x309e('0x36')],{})['then'](respondWithResult(_0x27f0ad,0xc9))['catch'](handleError(_0x27f0ad,null));};exports[_0x309e('0x37')]=function(_0x56611f,_0x2a68e4){if(_0x56611f[_0x309e('0x36')]['id']){delete _0x56611f[_0x309e('0x36')]['id'];}return db[_0x309e('0x1f')][_0x309e('0x33')]({'where':{'id':_0x56611f[_0x309e('0x27')]['id']}})[_0x309e('0x18')](handleEntityNotFound(_0x2a68e4,null))[_0x309e('0x18')](saveUpdates(_0x56611f['body'],null))[_0x309e('0x18')](respondWithResult(_0x2a68e4,null))[_0x309e('0x34')](handleError(_0x2a68e4,null));};exports[_0x309e('0x19')]=function(_0x39fa69,_0x4bdca4){return db[_0x309e('0x1f')][_0x309e('0x33')]({'where':{'id':_0x39fa69[_0x309e('0x27')]['id']}})[_0x309e('0x18')](handleEntityNotFound(_0x4bdca4,null))[_0x309e('0x18')](removeEntity(_0x4bdca4,null))[_0x309e('0x34')](handleError(_0x4bdca4,null));};exports['describe']=function(_0x518a13,_0xbedf65){return db[_0x309e('0x1f')][_0x309e('0x38')]()[_0x309e('0x18')](respondWithResult(_0xbedf65,null))[_0x309e('0x34')](handleError(_0xbedf65,null));};exports[_0x309e('0x39')]=function(_0x35eb28,_0x1bad27){return db['SmsMessage'][_0x309e('0x33')]({'where':{'id':_0x35eb28[_0x309e('0x27')]['id']}})[_0x309e('0x18')](handleEntityNotFound(_0x1bad27,null))[_0x309e('0x18')](function(_0x20b948){if(_0x20b948){return _0x20b948[_0x309e('0x39')](_0x35eb28[_0x309e('0x36')]['ids'],_[_0x309e('0x3a')](_0x35eb28[_0x309e('0x36')],[_0x309e('0x3b'),'id'])||{});}})[_0x309e('0x18')](respondWithResult(_0x1bad27,null))['catch'](handleError(_0x1bad27,null));};exports[_0x309e('0x3c')]=function(_0xff427,_0x5a6149){var _0x6efde3={'raw':![],'where':{}};var _0xe3c9={};var _0x4e60ff={'count':0x0,'rows':[]};return db[_0x309e('0x1f')][_0x309e('0x3d')]({'where':{'id':_0xff427[_0x309e('0x27')]['id']}})[_0x309e('0x18')](handleEntityNotFound(_0x5a6149,null))[_0x309e('0x18')](function(_0x2b34f2){if(_0x2b34f2){_0xe3c9[_0x309e('0x28')]=_[_0x309e('0x29')](db[_0x309e('0x3e')]['rawAttributes']);_0xe3c9[_0x309e('0x2a')]=_[_0x309e('0x29')](_0xff427['query']);_0xe3c9[_0x309e('0x2b')]=_[_0x309e('0x2c')](_0xe3c9[_0x309e('0x28')],_0xe3c9[_0x309e('0x2a')]);_0x6efde3[_0x309e('0x2d')]=_[_0x309e('0x2c')](_0xe3c9[_0x309e('0x28')],qs['fields'](_0xff427[_0x309e('0x2a')]['fields']));_0x6efde3[_0x309e('0x2d')]=_0x6efde3[_0x309e('0x2d')][_0x309e('0x2f')]?_0x6efde3['attributes']:_0xe3c9[_0x309e('0x28')];if(!_0xff427[_0x309e('0x2a')][_0x309e('0x3f')]('nolimit')){_0x6efde3['limit']=qs[_0x309e('0x13')](_0xff427['query'][_0x309e('0x13')]);_0x6efde3['offset']=qs[_0x309e('0x14')](_0xff427[_0x309e('0x2a')][_0x309e('0x14')]);}_0x6efde3[_0x309e('0x40')]=qs[_0x309e('0x41')](_0xff427[_0x309e('0x2a')][_0x309e('0x41')]);_0x6efde3['where']=qs[_0x309e('0x2b')](_[_0x309e('0x42')](_0xff427[_0x309e('0x2a')],_0xe3c9[_0x309e('0x2b')]));_0x6efde3[_0x309e('0x43')][_0x309e('0x44')]=_0x2b34f2['id'];if(_0xff427[_0x309e('0x2a')]['filter']){_0x6efde3[_0x309e('0x43')]=_[_0x309e('0x45')](_0x6efde3[_0x309e('0x43')],{'$or':_[_0x309e('0x46')](_0x6efde3[_0x309e('0x2d')],function(_0x35faa0){var _0x2ec4ba={};_0x2ec4ba[_0x35faa0]={'$like':'%'+_0xff427['query'][_0x309e('0x47')]+'%'};return _0x2ec4ba;})});}if(_0xff427[_0x309e('0x2a')][_0x309e('0x48')]){var _0x1c342f=_0xff427[_0x309e('0x2a')][_0x309e('0x48')][_0x309e('0x49')](',');var _0x365ea2={};_0x365ea2[_0x1c342f[0x0]]={'$gte':moment(_0x1c342f[0x1])[_0x309e('0x4a')](_0x309e('0x4b'))};_0x6efde3[_0x309e('0x43')]=_[_0x309e('0x45')](_0x6efde3[_0x309e('0x43')],_0x365ea2);}_0x6efde3=_[_0x309e('0x45')]({},_0x6efde3,_0xff427[_0x309e('0x32')]);return db['SmsMessage']['count']({'where':_0x6efde3[_0x309e('0x43')]})[_0x309e('0x18')](function(_0x319cc5){_0x4e60ff[_0x309e('0x15')]=_0x319cc5;if(_0xff427[_0x309e('0x2a')]['includeAll']){_0x6efde3[_0x309e('0x31')]=[{'all':!![]}];}return db[_0x309e('0x3e')][_0x309e('0x23')](_0x6efde3);})[_0x309e('0x18')](function(_0x1d45fa){_0x4e60ff[_0x309e('0x4c')]=_0x1d45fa;return _0x4e60ff;});}})['then'](respondWithFilteredResult(_0x5a6149,_0x6efde3))[_0x309e('0x34')](handleError(_0x5a6149,null));};exports[_0x309e('0x4d')]=function(_0x327cc2,_0x50e4ef){return db['SmsInteraction'][_0x309e('0x33')]({'where':{'id':_0x327cc2[_0x309e('0x27')]['id']}})[_0x309e('0x18')](handleEntityNotFound(_0x50e4ef,null))[_0x309e('0x18')](function(_0x335e1c){if(_0x335e1c){return _0x335e1c[_0x309e('0x4e')](_0x327cc2[_0x309e('0x36')][_0x309e('0x3b')],_[_0x309e('0x3a')](_0x327cc2['body'],[_0x309e('0x3b'),'id'])||{})[_0x309e('0x4f')](function(){return db['Tag']['findAll']({'attributes':['id','name',_0x309e('0x50')],'where':{'id':_0x327cc2['body'][_0x309e('0x3b')]}});})[_0x309e('0x18')](function(_0x343215){socket[_0x309e('0x51')]('smsInteractionTags:save',{'id':Number(_0x327cc2['params']['id']),'tags':_0x343215||[]});return{'id':Number(_0x327cc2[_0x309e('0x27')]['id']),'tags':_0x343215||[]};});}})[_0x309e('0x18')](respondWithResult(_0x50e4ef,null))['catch'](handleError(_0x50e4ef,null));};exports[_0x309e('0x52')]=function(_0x564c3e,_0x2b96ce){return db[_0x309e('0x1f')][_0x309e('0x33')]({'where':{'id':_0x564c3e['params']['id']}})[_0x309e('0x18')](handleEntityNotFound(_0x2b96ce,null))['then'](function(_0x488839){if(_0x488839){return _0x488839[_0x309e('0x52')](_0x564c3e['query'][_0x309e('0x3b')]);}})['then'](respondWithStatusCode(_0x2b96ce,null))[_0x309e('0x34')](handleError(_0x2b96ce,null));};exports[_0x309e('0x53')]=function(_0x48ce1a,_0x982de3){var _0x108eb6=moment()['unix']()[_0x309e('0x54')]();var _0x199e9e=path[_0x309e('0x55')](config[_0x309e('0x56')],_0x309e('0x57'),_0x309e('0x58'),_0x309e('0x59'));var _0x21f1e6=path[_0x309e('0x55')](_0x199e9e,_0x108eb6);var _0x2ab5ba=util['format']('transcript-%d-%s.zip',_0x48ce1a[_0x309e('0x27')]['id'],_0x108eb6);var _0x5ee232=path[_0x309e('0x55')](_0x199e9e,_0x2ab5ba);var _0x108a6e=[];_0x108a6e[_0x309e('0x5a')]({'model':db['User'],'as':_0x309e('0x5b'),'attributes':['id','fullname'],'raw':!![]});_0x108a6e['push']({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x309e('0x5c'),'lastName'],'raw':!![]});var _0x4ff5a7=[{'model':db[_0x309e('0x3e')],'as':'Messages','attributes':['id',_0x309e('0x36'),_0x309e('0x5d'),_0x309e('0x5e'),_0x309e('0x5f'),'read'],'include':_0x108a6e}];_0x4ff5a7['push']({'model':db[_0x309e('0x60')],'as':'Account','attributes':['id',_0x309e('0x1c')]});_0x4ff5a7['push']({'model':db[_0x309e('0x5b')],'as':_0x309e('0x61'),'attributes':['id',_0x309e('0x62')]});return db[_0x309e('0x1f')]['find']({'where':{'id':_0x48ce1a['params']['id']},'include':_0x4ff5a7})[_0x309e('0x18')](handleEntityNotFound(_0x982de3,null))[_0x309e('0x18')](function(_0x4bfb43){if(_0x4bfb43){var _0x4aeb12=_0x4bfb43[_0x309e('0x63')]({'plain':!![]});fs[_0x309e('0x64')](_0x21f1e6);var _0xf8a7d8={'channel':'Sms','account':_0x4aeb12['Account'][_0x309e('0x1c')],'agent':_0x4aeb12[_0x309e('0x61')]?_0x4aeb12['Owner'][_0x309e('0x62')]:'N.A.','createdAt':moment(_0x4aeb12[_0x309e('0x5d')])[_0x309e('0x4a')](_0x309e('0x4b'))[_0x309e('0x54')](),'closedAt':_0x4aeb12[_0x309e('0x65')]?moment(_0x4aeb12[_0x309e('0x66')])['format'](_0x309e('0x4b'))[_0x309e('0x54')]():'','disposition':_0x4aeb12['disposition'],'messages':_(_0x4aeb12['Messages'])['filter']({'secret':![]})[_0x309e('0x46')](function(_0x476a2e){return{'date':moment(_0x476a2e[_0x309e('0x5d')])[_0x309e('0x4a')](_0x309e('0x4b'))[_0x309e('0x54')](),'sender':_0x476a2e[_0x309e('0x5e')]===_0x309e('0x67')?_0x476a2e[_0x309e('0x5b')]?_0x476a2e['User']['fullname']:'System':_0x476a2e[_0x309e('0x68')]['firstName']+(_0x476a2e[_0x309e('0x68')][_0x309e('0x69')]?'\x20'+_0x476a2e['Contact'][_0x309e('0x69')]:''),'body':_0x476a2e[_0x309e('0x36')],'direction':_0x476a2e[_0x309e('0x5e')]===_0x309e('0x67')?'A':'C','secret':_0x476a2e[_0x309e('0x5f')],'read':_0x476a2e[_0x309e('0x6a')]};})[_0x309e('0x6b')]()};return ejs[_0x309e('0x6c')](path['join'](config[_0x309e('0x56')],'server',_0x309e('0x6d'),_0x309e('0x6e')),{'interaction':_0xf8a7d8})['then'](function(_0x1bdccd){var _0x345c9e=path['join'](_0x21f1e6,_0x309e('0x6f')+_0x4aeb12['id']+'-'+_0x108eb6+_0x309e('0x70'));var _0x14fce9={'path':_0x345c9e,'channel':_0x309e('0x71'),'interactionId':_0x4aeb12['id']};return pdf[_0x309e('0x72')](_0x1bdccd,_0x14fce9);})[_0x309e('0x18')](function(){return new BPromise(function(_0x1b8dfe,_0xb5a9c7){zipdir(_0x21f1e6,{'saveTo':_0x5ee232},function(_0x2515ef,_0xcf5121){if(_0x2515ef)return _0xb5a9c7(_0x2515ef);return _0x1b8dfe(_0xcf5121);});})[_0x309e('0x18')](function(){return new BPromise(function(_0x18748e,_0x2343f3){rimraf(_0x21f1e6,function(_0x597182){if(_0x597182)_0x2343f3(_0x597182);return _0x18748e();});});})[_0x309e('0x18')](function(){return _0x982de3[_0x309e('0x53')](_0x5ee232,_0x2ab5ba,function(_0x59414b){if(_0x59414b){console[_0x309e('0x73')](_0x309e('0x74'),_0x59414b);}else{fs[_0x309e('0x75')](_0x5ee232);}});});});}else{return _0x982de3[_0x309e('0xf')](0xc8);}})['catch'](handleError(_0x982de3,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 1ad3cbc..e143d34 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 _0x4991=['then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','events','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0x10ecd2,_0x417d22){var _0x753c68=function(_0x134342){while(--_0x134342){_0x10ecd2['push'](_0x10ecd2['shift']());}};_0x753c68(++_0x417d22);}(_0x4991,0xf7));var _0x1499=function(_0x20beae,_0x5eac6d){_0x20beae=_0x20beae-0x0;var _0xf5725=_0x4991[_0x20beae];return _0xf5725;};'use strict';var EventEmitter=require(_0x1499('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x1499('0x1')];var SmsMessage=require('../../mysqldb')['db'][_0x1499('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x1499('0x3')](0x0);var events={'afterCreate':_0x1499('0x4'),'afterUpdate':_0x1499('0x5'),'afterDestroy':_0x1499('0x6')};function emitEvent(_0x158134){return function(_0x19adff,_0x209616,_0x4b6154){_0x19adff[_0x1499('0x7')]({'attributes':['id'],'raw':!![]})[_0x1499('0x8')](function(_0x1c65c3){_0x19adff[_0x1499('0x9')](_0x1499('0xa'),_0x1c65c3[_0x1499('0xb')](function(_0x3277b3){return{'id':_0x3277b3['id']};}));return SmsMessage[_0x1499('0xc')]({'where':{'SmsInteractionId':_0x19adff['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x16e8ad){_0x19adff[_0x1499('0x9')]('unreadMessages',_0x16e8ad[_0x1499('0xd')]);SmsInteractionEvents[_0x1499('0xe')](_0x158134+':'+_0x19adff['id'],_0x19adff);SmsInteractionEvents['emit'](_0x158134,_0x19adff);_0x4b6154(null);})[_0x1499('0xf')](_0x4b6154(null));};}for(var e in events){if(events[_0x1499('0x10')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0x781d=['map','findAll','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','getUsers','setDataValue','Users'];(function(_0x5e9b9a,_0x340a04){var _0x43a474=function(_0x363aeb){while(--_0x363aeb){_0x5e9b9a['push'](_0x5e9b9a['shift']());}};_0x43a474(++_0x340a04);}(_0x781d,0x14a));var _0xd781=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x781d[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require(_0xd781('0x0'));var SmsInteraction=require(_0xd781('0x1'))['db']['SmsInteraction'];var SmsMessage=require('../../mysqldb')['db'][_0xd781('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xd781('0x3')](0x0);var events={'afterCreate':_0xd781('0x4'),'afterUpdate':_0xd781('0x5'),'afterDestroy':_0xd781('0x6')};function emitEvent(_0x42258e){return function(_0x446534,_0x1d4f4e,_0x830b){_0x446534[_0xd781('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x133509){_0x446534[_0xd781('0x8')](_0xd781('0x9'),_0x133509[_0xd781('0xa')](function(_0x4b1a57){return{'id':_0x4b1a57['id']};}));return SmsMessage[_0xd781('0xb')]({'where':{'SmsInteractionId':_0x446534['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x43d863){_0x446534[_0xd781('0x8')]('unreadMessages',_0x43d863[_0xd781('0xc')]);SmsInteractionEvents[_0xd781('0xd')](_0x42258e+':'+_0x446534['id'],_0x446534);SmsInteractionEvents['emit'](_0x42258e,_0x446534);_0x830b(null);})['catch'](_0x830b(null));};}for(var e in events){if(events[_0xd781('0xe')](e)){var event=events[e];SmsInteraction[_0xd781('0xf')](e,emitEvent(event));}}module[_0xd781('0x10')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 340c0fd..af7ec30 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 _0x499b=['api','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','SmsInteraction','sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger'];(function(_0x4654d5,_0x55fdf3){var _0x2da3f9=function(_0x8cd30a){while(--_0x8cd30a){_0x4654d5['push'](_0x4654d5['shift']());}};_0x2da3f9(++_0x55fdf3);}(_0x499b,0x195));var _0xb499=function(_0x4e50e5,_0xdec917){_0x4e50e5=_0x4e50e5-0x0;var _0x411cc3=_0x499b[_0x4e50e5];return _0x411cc3;};'use strict';var _=require(_0xb499('0x0'));var util=require(_0xb499('0x1'));var logger=require(_0xb499('0x2'))(_0xb499('0x3'));var moment=require('moment');var BPromise=require(_0xb499('0x4'));var rp=require(_0xb499('0x5'));var fs=require('fs');var path=require(_0xb499('0x6'));var rimraf=require(_0xb499('0x7'));var config=require(_0xb499('0x8'));var attributes=require(_0xb499('0x9'));module['exports']=function(_0x1ceb1b,_0x12634f){return _0x1ceb1b['define'](_0xb499('0xa'),attributes,{'tableName':_0xb499('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5355f3,_0x5de30c,_0x248c7e){if(_0x5355f3[_0xb499('0xc')](_0xb499('0xd'))){_0x5355f3[_0xb499('0xe')]=moment()[_0xb499('0xf')](_0xb499('0x10'));}_0x248c7e(null,_0x5355f3);}}});}; \ No newline at end of file +var _0x0703=['../../config/environment','./smsInteraction.attributes','exports','sms_interactions','changed','closedAt','format','lodash','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x174486,_0x1882b9){var _0x2b0408=function(_0x59fd45){while(--_0x59fd45){_0x174486['push'](_0x174486['shift']());}};_0x2b0408(++_0x1882b9);}(_0x0703,0x132));var _0x3070=function(_0x1719e4,_0x4278fe){_0x1719e4=_0x1719e4-0x0;var _0x236bac=_0x0703[_0x1719e4];return _0x236bac;};'use strict';var _=require(_0x3070('0x0'));var util=require('util');var logger=require(_0x3070('0x1'))('api');var moment=require(_0x3070('0x2'));var BPromise=require('bluebird');var rp=require(_0x3070('0x3'));var fs=require('fs');var path=require(_0x3070('0x4'));var rimraf=require(_0x3070('0x5'));var config=require(_0x3070('0x6'));var attributes=require(_0x3070('0x7'));module[_0x3070('0x8')]=function(_0x40de90,_0x2dfc8b){return _0x40de90['define']('SmsInteraction',attributes,{'tableName':_0x3070('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3aed86,_0x2261fa,_0x208194){if(_0x3aed86[_0x3070('0xa')]('closed')){_0x3aed86[_0x3070('0xb')]=moment()[_0x3070('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x208194(null,_0x3aed86);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 4d58a39..1dc0c87 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 _0xe777=['redis','defaults','socket.io-emitter','./smsInteraction.socket','register','request','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','update','options','raw','attributes','limit','then','UpdateSmsInteraction','catch','AddTagsToSmsInteraction','find','where','addTags','body','spread','AddTags','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x48dc57,_0x17baf5){var _0x27babb=function(_0x45ba22){while(--_0x45ba22){_0x48dc57['push'](_0x48dc57['shift']());}};_0x27babb(++_0x17baf5);}(_0xe777,0x137));var _0x7e77=function(_0x1558e1,_0x3ec75f){_0x1558e1=_0x1558e1-0x0;var _0x1c47c1=_0xe777[_0x1558e1];return _0x1c47c1;};'use strict';var _=require('lodash');var util=require(_0x7e77('0x0'));var moment=require('moment');var BPromise=require(_0x7e77('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7e77('0x2'));var logger=require(_0x7e77('0x3'))(_0x7e77('0x4'));var config=require(_0x7e77('0x5'));var jayson=require(_0x7e77('0x6'));var client=jayson[_0x7e77('0x7')][_0x7e77('0x8')]({'port':0x232a});config[_0x7e77('0x9')]=_[_0x7e77('0xa')](config[_0x7e77('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x7e77('0xb'))(new Redis(config[_0x7e77('0x9')]));require(_0x7e77('0xc'))[_0x7e77('0xd')](socket);function respondWithRpcPromise(_0x307ecc,_0x435b6a,_0x51ce4e){return new BPromise(function(_0x25b626,_0x5b7098){return client[_0x7e77('0xe')](_0x307ecc,_0x51ce4e)['then'](function(_0x171dba){logger['info'](_0x7e77('0xf'),_0x435b6a,_0x7e77('0x10'));logger[_0x7e77('0x11')](_0x7e77('0x12'),_0x435b6a,_0x7e77('0x10'),JSON[_0x7e77('0x13')](_0x171dba));if(_0x171dba[_0x7e77('0x14')]){if(_0x171dba[_0x7e77('0x14')][_0x7e77('0x15')]===0x1f4){logger[_0x7e77('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x435b6a,_0x171dba[_0x7e77('0x14')][_0x7e77('0x16')]);return _0x5b7098(_0x171dba[_0x7e77('0x14')][_0x7e77('0x16')]);}logger['error'](_0x7e77('0xf'),_0x435b6a,_0x171dba['error'][_0x7e77('0x16')]);return _0x25b626(_0x171dba[_0x7e77('0x14')][_0x7e77('0x16')]);}else{logger[_0x7e77('0x17')](_0x7e77('0xf'),_0x435b6a,'request\x20sent');_0x25b626(_0x171dba[_0x7e77('0x18')]['message']);}})['catch'](function(_0x26c696){logger['error'](_0x7e77('0xf'),_0x435b6a,_0x26c696);_0x5b7098(_0x26c696);});});}exports['UpdateSmsInteraction']=function(_0x5ed0be){var _0x4e7e07=this;return new Promise(function(_0x15d3de,_0x509ab6){return db['SmsInteraction'][_0x7e77('0x19')](_0x5ed0be['body'],{'raw':_0x5ed0be[_0x7e77('0x1a')]?_0x5ed0be[_0x7e77('0x1a')][_0x7e77('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ed0be[_0x7e77('0x1a')]?_0x5ed0be[_0x7e77('0x1a')]['where']||null:null,'attributes':_0x5ed0be[_0x7e77('0x1a')]?_0x5ed0be[_0x7e77('0x1a')][_0x7e77('0x1c')]||null:null,'limit':_0x5ed0be['options']?_0x5ed0be[_0x7e77('0x1a')][_0x7e77('0x1d')]||null:null})[_0x7e77('0x1e')](function(_0x5474a6){logger[_0x7e77('0x17')](_0x7e77('0x1f'),_0x5ed0be);logger['debug'](_0x7e77('0x1f'),_0x5ed0be,JSON[_0x7e77('0x13')](_0x5474a6));_0x15d3de(_0x5474a6);})[_0x7e77('0x20')](function(_0xe14c62){logger[_0x7e77('0x14')](_0x7e77('0x1f'),_0xe14c62[_0x7e77('0x16')],_0x5ed0be);_0x509ab6(_0x4e7e07[_0x7e77('0x14')](0x1f4,_0xe14c62[_0x7e77('0x16')]));});});};exports[_0x7e77('0x21')]=function(_0x5e2552){return new Promise(function(_0x19b8b4,_0x7e63c8){return db['SmsInteraction'][_0x7e77('0x22')]({'where':_0x5e2552[_0x7e77('0x1a')]?_0x5e2552[_0x7e77('0x1a')][_0x7e77('0x23')]||null:null})['then'](function(_0x5afdfd){if(_0x5afdfd){return _0x5afdfd[_0x7e77('0x24')](_0x5e2552['body']['ids'],_['omit'](_0x5e2552[_0x7e77('0x25')],['ids','id'])||{});}})[_0x7e77('0x26')](function(_0x225864){logger[_0x7e77('0x17')](_0x7e77('0x27'),_0x5e2552);logger[_0x7e77('0x11')]('AddTags',_0x5e2552,JSON[_0x7e77('0x13')](_0x225864));_0x19b8b4(_0x225864);})[_0x7e77('0x20')](function(_0x45073a){logger[_0x7e77('0x14')]('AddTags',_0x45073a['message'],_0x5e2552);_0x7e63c8(_this[_0x7e77('0x14')](0x1f4,_0x45073a[_0x7e77('0x16')]));});});}; \ No newline at end of file +var _0xaf5d=['request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','error','message','result','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','limit','then','catch','find','addTags','ids','omit','spread','AddTags','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','defaults','socket.io-emitter','redis','./smsInteraction.socket','register'];(function(_0x424357,_0x9ebe3e){var _0x29c68e=function(_0x663b5d){while(--_0x663b5d){_0x424357['push'](_0x424357['shift']());}};_0x29c68e(++_0x9ebe3e);}(_0xaf5d,0x10a));var _0xdaf5=function(_0x472183,_0x214d71){_0x472183=_0x472183-0x0;var _0x5ae728=_0xaf5d[_0x472183];return _0x5ae728;};'use strict';var _=require(_0xdaf5('0x0'));var util=require('util');var moment=require(_0xdaf5('0x1'));var BPromise=require(_0xdaf5('0x2'));var rs=require(_0xdaf5('0x3'));var fs=require('fs');var Redis=require(_0xdaf5('0x4'));var db=require(_0xdaf5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdaf5('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdaf5('0x7')][_0xdaf5('0x8')]({'port':0x232a});config['redis']=_[_0xdaf5('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xdaf5('0xa'))(new Redis(config[_0xdaf5('0xb')]));require(_0xdaf5('0xc'))[_0xdaf5('0xd')](socket);function respondWithRpcPromise(_0x4c987a,_0x40fb62,_0x18b27f){return new BPromise(function(_0x52c965,_0x766ee5){return client[_0xdaf5('0xe')](_0x4c987a,_0x18b27f)['then'](function(_0x5642ed){logger[_0xdaf5('0xf')](_0xdaf5('0x10'),_0x40fb62,_0xdaf5('0x11'));logger[_0xdaf5('0x12')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x40fb62,_0xdaf5('0x11'),JSON['stringify'](_0x5642ed));if(_0x5642ed[_0xdaf5('0x13')]){if(_0x5642ed[_0xdaf5('0x13')]['code']===0x1f4){logger[_0xdaf5('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x40fb62,_0x5642ed[_0xdaf5('0x13')][_0xdaf5('0x14')]);return _0x766ee5(_0x5642ed[_0xdaf5('0x13')][_0xdaf5('0x14')]);}logger[_0xdaf5('0x13')](_0xdaf5('0x10'),_0x40fb62,_0x5642ed['error'][_0xdaf5('0x14')]);return _0x52c965(_0x5642ed[_0xdaf5('0x13')][_0xdaf5('0x14')]);}else{logger[_0xdaf5('0xf')](_0xdaf5('0x10'),_0x40fb62,_0xdaf5('0x11'));_0x52c965(_0x5642ed[_0xdaf5('0x15')]['message']);}})['catch'](function(_0xecfa51){logger[_0xdaf5('0x13')](_0xdaf5('0x10'),_0x40fb62,_0xecfa51);_0x766ee5(_0xecfa51);});});}exports[_0xdaf5('0x16')]=function(_0x2220b5){var _0x85fc09=this;return new Promise(function(_0x5c1de2,_0x1e2c0e){return db[_0xdaf5('0x17')][_0xdaf5('0x18')](_0x2220b5[_0xdaf5('0x19')],{'raw':_0x2220b5[_0xdaf5('0x1a')]?_0x2220b5[_0xdaf5('0x1a')][_0xdaf5('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2220b5[_0xdaf5('0x1a')]?_0x2220b5[_0xdaf5('0x1a')][_0xdaf5('0x1c')]||null:null,'attributes':_0x2220b5[_0xdaf5('0x1a')]?_0x2220b5[_0xdaf5('0x1a')][_0xdaf5('0x1d')]||null:null,'limit':_0x2220b5[_0xdaf5('0x1a')]?_0x2220b5['options'][_0xdaf5('0x1e')]||null:null})[_0xdaf5('0x1f')](function(_0x54ec5c){logger[_0xdaf5('0xf')](_0xdaf5('0x16'),_0x2220b5);logger[_0xdaf5('0x12')](_0xdaf5('0x16'),_0x2220b5,JSON['stringify'](_0x54ec5c));_0x5c1de2(_0x54ec5c);})[_0xdaf5('0x20')](function(_0x421075){logger[_0xdaf5('0x13')](_0xdaf5('0x16'),_0x421075[_0xdaf5('0x14')],_0x2220b5);_0x1e2c0e(_0x85fc09[_0xdaf5('0x13')](0x1f4,_0x421075[_0xdaf5('0x14')]));});});};exports['AddTagsToSmsInteraction']=function(_0x5189d3){return new Promise(function(_0x58c87a,_0x2d6477){return db[_0xdaf5('0x17')][_0xdaf5('0x21')]({'where':_0x5189d3[_0xdaf5('0x1a')]?_0x5189d3['options'][_0xdaf5('0x1c')]||null:null})['then'](function(_0x13074a){if(_0x13074a){return _0x13074a[_0xdaf5('0x22')](_0x5189d3[_0xdaf5('0x19')][_0xdaf5('0x23')],_[_0xdaf5('0x24')](_0x5189d3[_0xdaf5('0x19')],[_0xdaf5('0x23'),'id'])||{});}})[_0xdaf5('0x25')](function(_0x3fc930){logger[_0xdaf5('0xf')](_0xdaf5('0x26'),_0x5189d3);logger['debug'](_0xdaf5('0x26'),_0x5189d3,JSON[_0xdaf5('0x27')](_0x3fc930));_0x58c87a(_0x3fc930);})['catch'](function(_0x45c247){logger[_0xdaf5('0x13')](_0xdaf5('0x26'),_0x45c247[_0xdaf5('0x14')],_0x5189d3);_0x2d6477(_this[_0xdaf5('0x13')](0x1f4,_0x45c247['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index e4acf98..dc05e8f 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 _0x5a70=['save','remove','update','removeListener','register','length','smsInteraction:'];(function(_0x500360,_0x17b40e){var _0x2698a8=function(_0xa982c){while(--_0xa982c){_0x500360['push'](_0x500360['shift']());}};_0x2698a8(++_0x17b40e);}(_0x5a70,0xa8));var _0x05a7=function(_0x725a4c,_0x102507){_0x725a4c=_0x725a4c-0x0;var _0x37b2cc=_0x5a70[_0x725a4c];return _0x37b2cc;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x05a7('0x0'),_0x05a7('0x1'),_0x05a7('0x2')];function createListener(_0x1e489c,_0x150385){return function(_0x5ee0bd){_0x150385['emit'](_0x1e489c,_0x5ee0bd);};}function removeListener(_0x558330,_0x298534){return function(){SmsInteractionEvents[_0x05a7('0x3')](_0x558330,_0x298534);};}exports[_0x05a7('0x4')]=function(_0x44793d){for(var _0xdb28d9=0x0,_0x22f0f0=events[_0x05a7('0x5')];_0xdb28d9<_0x22f0f0;_0xdb28d9++){var _0x46e48a=events[_0xdb28d9];var _0x3d1409=createListener(_0x05a7('0x6')+_0x46e48a,_0x44793d);SmsInteractionEvents['on'](_0x46e48a,_0x3d1409);}}; \ No newline at end of file +var _0xe38d=['smsInteraction:','save','remove','update','emit','removeListener','length'];(function(_0x268493,_0xc5e14){var _0x2b0326=function(_0x2a2528){while(--_0x2a2528){_0x268493['push'](_0x268493['shift']());}};_0x2b0326(++_0xc5e14);}(_0xe38d,0xe1));var _0xde38=function(_0x5211fc,_0xc070e1){_0x5211fc=_0x5211fc-0x0;var _0x33f47a=_0xe38d[_0x5211fc];return _0x33f47a;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xde38('0x0'),_0xde38('0x1'),_0xde38('0x2')];function createListener(_0x5152e8,_0x567c6a){return function(_0x3f8a51){_0x567c6a[_0xde38('0x3')](_0x5152e8,_0x3f8a51);};}function removeListener(_0xf877fe,_0x390660){return function(){SmsInteractionEvents[_0xde38('0x4')](_0xf877fe,_0x390660);};}exports['register']=function(_0x577721){for(var _0x1a7ce5=0x0,_0x289ddf=events[_0xde38('0x5')];_0x1a7ce5<_0x289ddf;_0x1a7ce5++){var _0xd5e4ca=events[_0x1a7ce5];var _0x5165dd=createListener(_0xde38('0x6')+_0xd5e4ca,_0x577721);SmsInteractionEvents['on'](_0xd5e4ca,_0x5165dd);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 57fd44e..af45870 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 _0x73ab=['../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','show','post','tracked','sms','create','/:id/status','status','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x255036,_0xf94145){var _0x3c4c56=function(_0x50a35c){while(--_0x50a35c){_0x255036['push'](_0x255036['shift']());}};_0x3c4c56(++_0xf94145);}(_0x73ab,0x182));var _0xb73a=function(_0x4e0359,_0x205155){_0x4e0359=_0x4e0359-0x0;var _0x450f0a=_0x73ab[_0x4e0359];return _0x450f0a;};'use strict';var multer=require(_0xb73a('0x0'));var util=require(_0xb73a('0x1'));var path=require(_0xb73a('0x2'));var timeout=require(_0xb73a('0x3'));var express=require(_0xb73a('0x4'));var router=express[_0xb73a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb73a('0x6'));var config=require(_0xb73a('0x7'));var controller=require('./smsMessage.controller');router[_0xb73a('0x8')]('/',auth[_0xb73a('0x9')](),controller['index']);router[_0xb73a('0x8')]('/describe',auth[_0xb73a('0x9')](),controller[_0xb73a('0xa')]);router[_0xb73a('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xb73a('0xb')]);router[_0xb73a('0xc')]('/',auth[_0xb73a('0x9')](),interaction[_0xb73a('0xd')](_0xb73a('0xe'),'smsmessage:create'),controller[_0xb73a('0xf')]);router[_0xb73a('0xc')](_0xb73a('0x10'),controller[_0xb73a('0x11')]);router[_0xb73a('0x12')](_0xb73a('0x13'),auth[_0xb73a('0x9')](),controller[_0xb73a('0x14')]);router[_0xb73a('0x12')](_0xb73a('0x15'),auth[_0xb73a('0x9')](),controller[_0xb73a('0x16')]);router[_0xb73a('0x12')](_0xb73a('0x17'),auth[_0xb73a('0x9')](),controller[_0xb73a('0x18')]);router[_0xb73a('0x19')](_0xb73a('0x13'),auth['isAuthenticated'](),controller[_0xb73a('0x1a')]);module[_0xb73a('0x1b')]=router; \ No newline at end of file +var _0xe66d=['put','update','/:id/reject','reject','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','describe','/:id','isAuthenticated','tracked','sms','smsmessage:create','create','post','/:id/status'];(function(_0x2272b5,_0x362458){var _0x110156=function(_0x5c2e32){while(--_0x5c2e32){_0x2272b5['push'](_0x2272b5['shift']());}};_0x110156(++_0x362458);}(_0xe66d,0x14b));var _0xde66=function(_0x544d66,_0xabcbd9){_0x544d66=_0x544d66-0x0;var _0x46a80d=_0xe66d[_0x544d66];return _0x46a80d;};'use strict';var multer=require(_0xde66('0x0'));var util=require(_0xde66('0x1'));var path=require('path');var timeout=require(_0xde66('0x2'));var express=require(_0xde66('0x3'));var router=express[_0xde66('0x4')]();var fs_extra=require(_0xde66('0x5'));var auth=require(_0xde66('0x6'));var interaction=require(_0xde66('0x7'));var config=require('../../config/environment');var controller=require('./smsMessage.controller');router[_0xde66('0x8')]('/',auth['isAuthenticated'](),controller[_0xde66('0x9')]);router[_0xde66('0x8')](_0xde66('0xa'),auth['isAuthenticated'](),controller[_0xde66('0xb')]);router['get'](_0xde66('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xde66('0xd')](),interaction[_0xde66('0xe')](_0xde66('0xf'),_0xde66('0x10')),controller[_0xde66('0x11')]);router[_0xde66('0x12')](_0xde66('0x13'),controller['status']);router[_0xde66('0x14')](_0xde66('0xc'),auth[_0xde66('0xd')](),controller[_0xde66('0x15')]);router['put']('/:id/accept',auth[_0xde66('0xd')](),controller['accept']);router['put'](_0xde66('0x16'),auth[_0xde66('0xd')](),controller[_0xde66('0x17')]);router[_0xde66('0x18')](_0xde66('0xc'),auth['isAuthenticated'](),controller[_0xde66('0x19')]);module[_0xde66('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index e63fa21..d828846 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 _0xdf98=['out','STRING','DATE','BOOLEAN','sequelize','TEXT','ENUM'];(function(_0x559e51,_0x2836f7){var _0x3d228c=function(_0x1f2a44){while(--_0x1f2a44){_0x559e51['push'](_0x559e51['shift']());}};_0x3d228c(++_0x2836f7);}(_0xdf98,0xcf));var _0x8df9=function(_0x644560,_0x1783aa){_0x644560=_0x644560-0x0;var _0x41b76b=_0xdf98[_0x644560];return _0x41b76b;};'use strict';var Sequelize=require(_0x8df9('0x0'));module['exports']={'body':{'type':Sequelize[_0x8df9('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x8df9('0x2')]('in',_0x8df9('0x3')),'defaultValue':_0x8df9('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0x8df9('0x4')](0xbe)},'phone':{'type':Sequelize[_0x8df9('0x4')]},'readAt':{'type':Sequelize[_0x8df9('0x5')]},'secret':{'type':Sequelize[_0x8df9('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x8df9('0x4')]},'providerResponse':{'type':Sequelize[_0x8df9('0x1')]}}; \ No newline at end of file +var _0xc519=['BOOLEAN','ENUM','STRING','TEXT'];(function(_0x4909f0,_0x5e2fd8){var _0x5671bc=function(_0x450993){while(--_0x450993){_0x4909f0['push'](_0x4909f0['shift']());}};_0x5671bc(++_0x5e2fd8);}(_0xc519,0x11b));var _0x9c51=function(_0x416eed,_0x3a2a24){_0x416eed=_0x416eed-0x0;var _0x325487=_0xc519[_0x416eed];return _0x325487;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x9c51('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x9c51('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9c51('0x2')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x9c51('0x3')](0xbe)},'phone':{'type':Sequelize[_0x9c51('0x3')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x9c51('0x1')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x9c51('0x0')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 3e3c200..3d7a45e 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 _0x5eca=['../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','include','find','create','body','params','describe','sms-interactions','accept','sms','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','SmsInteractionId','update','isNil','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','email','internal','manual','interface','format','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','rejectmessage','SmsAccountId','debug','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','MessageUUID','indexOf','Status','infobip','results','groupName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x12db6a,_0x33f794){var _0x12e742=function(_0x506d43){while(--_0x506d43){_0x12db6a['push'](_0x12db6a['shift']());}};_0x12e742(++_0x33f794);}(_0x5eca,0x10e));var _0xa5ec=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x5eca[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require(_0xa5ec('0x0'));var rimraf=require(_0xa5ec('0x1'));var zipdir=require(_0xa5ec('0x2'));var jsonpatch=require(_0xa5ec('0x3'));var rp=require(_0xa5ec('0x4'));var moment=require('moment');var BPromise=require(_0xa5ec('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa5ec('0x6'));var sox=require(_0xa5ec('0x7'));var csv=require(_0xa5ec('0x8'));var ejs=require(_0xa5ec('0x9'));var fs=require('fs');var fs_extra=require(_0xa5ec('0xa'));var _=require(_0xa5ec('0xb'));var squel=require(_0xa5ec('0xc'));var crypto=require('crypto');var jsforce=require(_0xa5ec('0xd'));var deskjs=require(_0xa5ec('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa5ec('0xf'));var Papa=require('papaparse');var Redis=require(_0xa5ec('0x10'));var authService=require(_0xa5ec('0x11'));var qs=require(_0xa5ec('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa5ec('0x13'));var logger=require(_0xa5ec('0x14'))(_0xa5ec('0x15'));var utils=require(_0xa5ec('0x16'));var config=require(_0xa5ec('0x17'));var licenseUtil=require(_0xa5ec('0x18'));var db=require(_0xa5ec('0x19'))['db'];config[_0xa5ec('0x1a')]=_[_0xa5ec('0x1b')](config[_0xa5ec('0x1a')],{'host':_0xa5ec('0x1c'),'port':0x18eb});var socket=require(_0xa5ec('0x1d'))(new Redis(config[_0xa5ec('0x1a')]));require('./smsMessage.socket')[_0xa5ec('0x1e')](socket);var jayson=require(_0xa5ec('0x1f'));var client=jayson[_0xa5ec('0x20')][_0xa5ec('0x21')]({'port':0x232c});var client9002=jayson[_0xa5ec('0x20')][_0xa5ec('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x54288a,_0x471de4,_0x498882,_0xe591a7){return new BPromise(function(_0x35e4a7,_0x1a4348){var _0x32281e=_0xe591a7||client;return _0x32281e[_0xa5ec('0x22')](_0x54288a,_0x498882)[_0xa5ec('0x23')](function(_0x1ab214){logger[_0xa5ec('0x24')](_0xa5ec('0x25'),_0x471de4,_0xa5ec('0x26'));logger['debug'](_0xa5ec('0x27'),_0x471de4,_0xa5ec('0x26'),JSON[_0xa5ec('0x28')](_0x1ab214));if(_0x1ab214[_0xa5ec('0x29')]){if(_0x1ab214[_0xa5ec('0x29')][_0xa5ec('0x2a')]===0x1f4){logger[_0xa5ec('0x29')](_0xa5ec('0x25'),_0x471de4,_0x1ab214[_0xa5ec('0x29')]['message']);return _0x1a4348(_0x1ab214[_0xa5ec('0x29')][_0xa5ec('0x2b')]);}logger[_0xa5ec('0x29')](_0xa5ec('0x25'),_0x471de4,_0x1ab214[_0xa5ec('0x29')][_0xa5ec('0x2b')]);return _0x35e4a7(_0x1ab214[_0xa5ec('0x29')][_0xa5ec('0x2b')]);}else{logger[_0xa5ec('0x24')]('SmsMessage,\x20%s,\x20%s',_0x471de4,'request\x20sent');_0x35e4a7(_0x1ab214[_0xa5ec('0x2c')]['message']);}})[_0xa5ec('0x2d')](function(_0x38be6b){logger['error'](_0xa5ec('0x25'),_0x471de4,_0x38be6b);_0x1a4348(_0x38be6b);});});}function respondWithStatusCode(_0x1a8f3b,_0x4ff18c){_0x4ff18c=_0x4ff18c||0xcc;return function(_0x4643aa){if(_0x4643aa){return _0x1a8f3b[_0xa5ec('0x2e')](_0x4ff18c);}return _0x1a8f3b['status'](_0x4ff18c)[_0xa5ec('0x2f')]();};}function respondWithResult(_0x48681f,_0x252d65){_0x252d65=_0x252d65||0xc8;return function(_0x403bae){if(_0x403bae){return _0x48681f[_0xa5ec('0x30')](_0x252d65)[_0xa5ec('0x31')](_0x403bae);}};}function respondWithFilteredResult(_0x39907f,_0x40a05a){return function(_0x45e32c){if(_0x45e32c){var _0x2cda8c=typeof _0x40a05a[_0xa5ec('0x32')]===_0xa5ec('0x33')&&typeof _0x40a05a[_0xa5ec('0x34')]==='undefined';var _0x4cc78f=_0x45e32c[_0xa5ec('0x35')];var _0x265e84=_0x2cda8c?0x0:_0x40a05a[_0xa5ec('0x32')];var _0x2fd6f2=_0x2cda8c?_0x45e32c[_0xa5ec('0x35')]:_0x40a05a[_0xa5ec('0x32')]+_0x40a05a['limit'];var _0x18e275;if(_0x2fd6f2>=_0x4cc78f){_0x2fd6f2=_0x4cc78f;_0x18e275=0xc8;}else{_0x18e275=0xce;}_0x39907f[_0xa5ec('0x30')](_0x18e275);return _0x39907f['set'](_0xa5ec('0x36'),_0x265e84+'-'+_0x2fd6f2+'/'+_0x4cc78f)[_0xa5ec('0x31')](_0x45e32c);}return null;};}function patchUpdates(_0x29c37d){return function(_0x282fcb){try{jsonpatch['apply'](_0x282fcb,_0x29c37d,!![]);}catch(_0x3a1075){return BPromise[_0xa5ec('0x37')](_0x3a1075);}return _0x282fcb[_0xa5ec('0x38')]();};}function saveUpdates(_0x1acb96,_0x56c792){return function(_0x28390f){if(_0x28390f){return _0x28390f['update'](_0x1acb96)[_0xa5ec('0x23')](function(_0x41721b){return _0x41721b;});}return null;};}function removeEntity(_0x5f440a,_0x49dda9){return function(_0x121e6d){if(_0x121e6d){return _0x121e6d[_0xa5ec('0x39')]()[_0xa5ec('0x23')](function(){_0x5f440a[_0xa5ec('0x30')](0xcc)[_0xa5ec('0x2f')]();});}};}function handleEntityNotFound(_0x4a0fb4,_0x89984c){return function(_0x17f1fd){if(!_0x17f1fd){_0x4a0fb4[_0xa5ec('0x2e')](0x194);}return _0x17f1fd;};}function handleError(_0x14c7ee,_0x39e56c){_0x39e56c=_0x39e56c||0x1f4;return function(_0x33fbbd){logger['error'](_0x33fbbd[_0xa5ec('0x3a')]);if(_0x33fbbd['name']){delete _0x33fbbd[_0xa5ec('0x3b')];}_0x14c7ee[_0xa5ec('0x30')](_0x39e56c)[_0xa5ec('0x3c')](_0x33fbbd);};}exports[_0xa5ec('0x3d')]=function(_0x4462a7,_0x5cf72d){var _0x2ce989={},_0x38448b={},_0x1e8b79={'count':0x0,'rows':[]};var _0x1fbacb=_[_0xa5ec('0x3e')](db[_0xa5ec('0x3f')][_0xa5ec('0x40')],function(_0x5dda81){return{'name':_0x5dda81[_0xa5ec('0x41')],'type':_0x5dda81[_0xa5ec('0x42')]['key']};});_0x38448b[_0xa5ec('0x43')]=_[_0xa5ec('0x3e')](_0x1fbacb,_0xa5ec('0x3b'));_0x38448b[_0xa5ec('0x44')]=_[_0xa5ec('0x45')](_0x4462a7[_0xa5ec('0x44')]);_0x38448b[_0xa5ec('0x46')]=_[_0xa5ec('0x47')](_0x38448b[_0xa5ec('0x43')],_0x38448b[_0xa5ec('0x44')]);_0x2ce989[_0xa5ec('0x48')]=_['intersection'](_0x38448b['model'],qs['fields'](_0x4462a7['query'][_0xa5ec('0x49')]));_0x2ce989[_0xa5ec('0x48')]=_0x2ce989[_0xa5ec('0x48')][_0xa5ec('0x4a')]?_0x2ce989[_0xa5ec('0x48')]:_0x38448b[_0xa5ec('0x43')];if(!_0x4462a7[_0xa5ec('0x44')][_0xa5ec('0x4b')]('nolimit')){_0x2ce989[_0xa5ec('0x34')]=qs['limit'](_0x4462a7[_0xa5ec('0x44')][_0xa5ec('0x34')]);_0x2ce989['offset']=qs['offset'](_0x4462a7[_0xa5ec('0x44')][_0xa5ec('0x32')]);}_0x2ce989[_0xa5ec('0x4c')]=qs[_0xa5ec('0x4d')](_0x4462a7[_0xa5ec('0x44')][_0xa5ec('0x4d')]);_0x2ce989[_0xa5ec('0x4e')]=qs[_0xa5ec('0x46')](_[_0xa5ec('0x4f')](_0x4462a7[_0xa5ec('0x44')],_0x38448b['filters']),_0x1fbacb);if(_0x4462a7['query'][_0xa5ec('0x50')]){_0x2ce989[_0xa5ec('0x4e')]=_[_0xa5ec('0x51')](_0x2ce989[_0xa5ec('0x4e')],{'$or':_[_0xa5ec('0x3e')](_0x1fbacb,function(_0x136324){if(_0x136324[_0xa5ec('0x42')]!=='VIRTUAL'){var _0x41f7cb={};_0x41f7cb[_0x136324['name']]={'$like':'%'+_0x4462a7['query'][_0xa5ec('0x50')]+'%'};return _0x41f7cb;}})});}_0x2ce989=_[_0xa5ec('0x51')]({},_0x2ce989,_0x4462a7[_0xa5ec('0x52')]);var _0x4da390={'where':_0x2ce989[_0xa5ec('0x4e')]};return db['SmsMessage'][_0xa5ec('0x35')](_0x4da390)[_0xa5ec('0x23')](function(_0x4d42c7){_0x1e8b79[_0xa5ec('0x35')]=_0x4d42c7;if(_0x4462a7[_0xa5ec('0x44')][_0xa5ec('0x53')]){_0x2ce989['include']=[{'all':!![]}];}return db['SmsMessage'][_0xa5ec('0x54')](_0x2ce989);})['then'](function(_0x17f08a){_0x1e8b79[_0xa5ec('0x55')]=_0x17f08a;return _0x1e8b79;})['then'](respondWithFilteredResult(_0x5cf72d,_0x2ce989))['catch'](handleError(_0x5cf72d,null));};exports[_0xa5ec('0x56')]=function(_0x1ce39b,_0x10f3f2){var _0x415d01={'raw':!![],'where':{'id':_0x1ce39b['params']['id']}},_0x5742ef={};_0x5742ef[_0xa5ec('0x43')]=_[_0xa5ec('0x45')](db[_0xa5ec('0x3f')][_0xa5ec('0x40')]);_0x5742ef[_0xa5ec('0x44')]=_[_0xa5ec('0x45')](_0x1ce39b[_0xa5ec('0x44')]);_0x5742ef[_0xa5ec('0x46')]=_[_0xa5ec('0x47')](_0x5742ef[_0xa5ec('0x43')],_0x5742ef[_0xa5ec('0x44')]);_0x415d01['attributes']=_[_0xa5ec('0x47')](_0x5742ef[_0xa5ec('0x43')],qs['fields'](_0x1ce39b['query'][_0xa5ec('0x49')]));_0x415d01['attributes']=_0x415d01[_0xa5ec('0x48')][_0xa5ec('0x4a')]?_0x415d01[_0xa5ec('0x48')]:_0x5742ef['model'];if(_0x1ce39b['query']['includeAll']){_0x415d01[_0xa5ec('0x57')]=[{'all':!![]}];}_0x415d01=_['merge']({},_0x415d01,_0x1ce39b['options']);return db[_0xa5ec('0x3f')][_0xa5ec('0x58')](_0x415d01)[_0xa5ec('0x23')](handleEntityNotFound(_0x10f3f2,null))[_0xa5ec('0x23')](respondWithResult(_0x10f3f2,null))[_0xa5ec('0x2d')](handleError(_0x10f3f2,null));};exports[_0xa5ec('0x59')]=function(_0x28fb94,_0x455c56){return db[_0xa5ec('0x3f')][_0xa5ec('0x59')](_0x28fb94[_0xa5ec('0x5a')],{})[_0xa5ec('0x23')](respondWithResult(_0x455c56,0xc9))[_0xa5ec('0x2d')](handleError(_0x455c56,null));};exports['update']=function(_0x2568df,_0x2f0bc7){if(_0x2568df[_0xa5ec('0x5a')]['id']){delete _0x2568df[_0xa5ec('0x5a')]['id'];}return db['SmsMessage'][_0xa5ec('0x58')]({'where':{'id':_0x2568df[_0xa5ec('0x5b')]['id']}})[_0xa5ec('0x23')](handleEntityNotFound(_0x2f0bc7,null))['then'](saveUpdates(_0x2568df[_0xa5ec('0x5a')],null))[_0xa5ec('0x23')](respondWithResult(_0x2f0bc7,null))[_0xa5ec('0x2d')](handleError(_0x2f0bc7,null));};exports[_0xa5ec('0x39')]=function(_0x125891,_0x402172){return db['SmsMessage']['find']({'where':{'id':_0x125891[_0xa5ec('0x5b')]['id']}})['then'](handleEntityNotFound(_0x402172,null))[_0xa5ec('0x23')](removeEntity(_0x402172,null))[_0xa5ec('0x2d')](handleError(_0x402172,null));};exports['describe']=function(_0x18c7eb,_0x98aee){return db[_0xa5ec('0x3f')][_0xa5ec('0x5c')]()[_0xa5ec('0x23')](respondWithResult(_0x98aee,null))[_0xa5ec('0x2d')](handleError(_0x98aee,null));};var interaction_log=require(_0xa5ec('0x14'))(_0xa5ec('0x5d'));exports[_0xa5ec('0x5e')]=function(_0x1509b3,_0x1b4ca1,_0x44c417){var _0x5ec7f2={'agent':{},'channel':_0xa5ec('0x5f')};if(_0x1509b3[_0xa5ec('0x5a')]['id']){delete _0x1509b3[_0xa5ec('0x5a')]['id'];}_0x1509b3[_0xa5ec('0x5a')]['read']=!![];_0x1509b3['body'][_0xa5ec('0x60')]=moment()['format'](_0xa5ec('0x61'));_0x1509b3[_0xa5ec('0x5a')][_0xa5ec('0x62')]=_0x1509b3[_0xa5ec('0x5a')][_0xa5ec('0x62')]||_0x1509b3['user']['id'];_0x5ec7f2[_0xa5ec('0x63')]['id']=_0x1509b3[_0xa5ec('0x5a')]['UserId'];return db[_0xa5ec('0x3f')][_0xa5ec('0x58')]({'where':{'id':_0x1509b3[_0xa5ec('0x5b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1b4ca1,null))[_0xa5ec('0x23')](saveUpdates(_0x1509b3[_0xa5ec('0x5a')],null))[_0xa5ec('0x23')](function(_0x59c7e2){if(_0x59c7e2){_0x5ec7f2[_0xa5ec('0x2b')]=_0x59c7e2[_0xa5ec('0x64')]({'plain':!![]});return db['SmsInteraction'][_0xa5ec('0x58')]({'where':{'id':_0x59c7e2[_0xa5ec('0x65')]}});}return null;})[_0xa5ec('0x23')](handleEntityNotFound(_0x1b4ca1,null))[_0xa5ec('0x23')](function(_0x2230a2){if(_0x2230a2){return _0x2230a2[_0xa5ec('0x66')]({'UserId':_0x1509b3[_0xa5ec('0x5a')]['UserId'],'read1stAt':_[_0xa5ec('0x67')](_0x2230a2['read1stAt'])?moment()['format'](_0xa5ec('0x61')):undefined});}return null;})[_0xa5ec('0x23')](function(_0x5d61bf){if(_0x5d61bf){_0x5ec7f2[_0xa5ec('0x68')]=_0x5d61bf[_0xa5ec('0x64')]({'plain':!![]});interaction_log[_0xa5ec('0x24')](_0xa5ec('0x69'),_0x1509b3[_0xa5ec('0x6a')]['id'],_0x1509b3[_0xa5ec('0x6a')][_0xa5ec('0x3b')],_0x1509b3[_0xa5ec('0x6a')][_0xa5ec('0x6b')],_0x5ec7f2['interaction']['id'],_0x1509b3[_0xa5ec('0x5a')]?JSON[_0xa5ec('0x28')](_0x1509b3[_0xa5ec('0x5a')]):_0xa5ec('0x6c'));return respondWithRpcPromise(_0xa5ec('0x6d'),'acceptMessage',_0x5ec7f2);}return null;})[_0xa5ec('0x23')](function(_0x305202){var _0x1135e9=_0xa5ec('0x6e')+_0x305202[_0xa5ec('0x2b')][_0xa5ec('0x6f')];return db[_0xa5ec('0x70')][_0xa5ec('0x44')](_0x1135e9,{'type':db[_0xa5ec('0x71')][_0xa5ec('0x72')][_0xa5ec('0x73')],'raw':!![]})['then'](function(_0x43a577){return _0x43a577;});})['then'](function(_0x5116ae){if(_0x5116ae){_0x5ec7f2[_0xa5ec('0x2b')]['contact']=_0x5116ae[0x0];if(!_0x1509b3[_0xa5ec('0x5a')][_0xa5ec('0x62')])return;return db[_0xa5ec('0x74')][_0xa5ec('0x58')]({'where':{'id':_0x1509b3['body'][_0xa5ec('0x62')],'role':_0xa5ec('0x63')},'attributes':['id',_0xa5ec('0x3b'),'fullname',_0xa5ec('0x75'),_0xa5ec('0x76')],'raw':!![]});}return null;})[_0xa5ec('0x23')](function(_0x44b76b){if(!_0x44b76b)return null;_0x5ec7f2[_0xa5ec('0x2b')][_0xa5ec('0x63')]=_0x44b76b;return _0x5ec7f2;})[_0xa5ec('0x23')](function(_0x5730b8){if(_0x5730b8){if(_0x1509b3['body'][_0xa5ec('0x77')]){_0x5ec7f2[_0xa5ec('0x2b')][_0xa5ec('0x78')]=util[_0xa5ec('0x79')](_0xa5ec('0x7a'),_0x1509b3['user'][_0xa5ec('0x3b')]);_0x5ec7f2['message'][_0xa5ec('0x7b')]=_0x5ec7f2['channel'];_0x5ec7f2[_0xa5ec('0x2b')][_0xa5ec('0x7c')]=_0x5ec7f2[_0xa5ec('0x7b')];_0x5ec7f2[_0xa5ec('0x2b')][_0xa5ec('0x7d')]=_0xa5ec('0x5e');return respondWithRpcPromise(_0xa5ec('0x7e'),_0xa5ec('0x7e'),{'event':_0xa5ec('0x7f'),'message':_0x5ec7f2[_0xa5ec('0x2b')]},client9002)[_0xa5ec('0x23')](function(){return _0x5ec7f2;});}return _0x5ec7f2;}return null;})['then'](respondWithResult(_0x1b4ca1,null))['catch'](handleError(_0x1b4ca1,null));};var interaction_log=require(_0xa5ec('0x14'))('sms-interactions');exports[_0xa5ec('0x37')]=function(_0x5a4621,_0x2dfcba,_0x2f36b6){var _0x2734b4={'agent':{},'channel':'sms'};if(_0x5a4621[_0xa5ec('0x5a')]['id']){delete _0x5a4621[_0xa5ec('0x5a')]['id'];}_0x5a4621[_0xa5ec('0x5a')][_0xa5ec('0x62')]=_0x5a4621['body'][_0xa5ec('0x62')]||_0x5a4621[_0xa5ec('0x6a')]['id'];_0x2734b4[_0xa5ec('0x63')]['id']=_0x5a4621[_0xa5ec('0x5a')][_0xa5ec('0x62')];return db[_0xa5ec('0x3f')]['find']({'where':{'id':_0x5a4621[_0xa5ec('0x5b')]['id'],'UserId':null}})[_0xa5ec('0x23')](handleEntityNotFound(_0x2dfcba,null))[_0xa5ec('0x23')](function(_0x23abfc){if(_0x23abfc){_0x2734b4['message']=_0x23abfc['get']({'plain':!![]});return db[_0xa5ec('0x80')]['find']({'where':{'id':_0x23abfc['SmsInteractionId']}});}return null;})[_0xa5ec('0x23')](handleEntityNotFound(_0x2dfcba,null))[_0xa5ec('0x23')](function(_0x539f73){if(_0x539f73){_0x2734b4['interaction']=_0x539f73[_0xa5ec('0x64')]({'plain':!![]});interaction_log['info'](_0xa5ec('0x81'),_0x5a4621['user']['id'],_0x5a4621[_0xa5ec('0x6a')][_0xa5ec('0x3b')],_0x5a4621['user'][_0xa5ec('0x6b')],_0x2734b4['interaction']['id'],_0x5a4621['body']?JSON[_0xa5ec('0x28')](_0x5a4621[_0xa5ec('0x5a')]):_0xa5ec('0x6c'));return respondWithRpcPromise(_0xa5ec('0x82'),_0xa5ec('0x83'),_0x2734b4);}return null;})['then'](function(_0x4bd865){var _0xbacec8=_0xa5ec('0x6e')+_0x4bd865['message'][_0xa5ec('0x6f')];return db['sequelize'][_0xa5ec('0x44')](_0xbacec8,{'type':db[_0xa5ec('0x71')]['QueryTypes']['SELECT'],'raw':!![]})[_0xa5ec('0x23')](function(_0x4f3f46){return _0x4f3f46;});})[_0xa5ec('0x23')](function(_0x2df29d){if(_0x2df29d){_0x2734b4[_0xa5ec('0x2b')][_0xa5ec('0x84')]=_0x2df29d[0x0];if(!_0x5a4621['body']['UserId'])return;return db[_0xa5ec('0x74')][_0xa5ec('0x58')]({'where':{'id':_0x5a4621['body'][_0xa5ec('0x62')],'role':'agent'},'attributes':['id',_0xa5ec('0x3b'),'fullname',_0xa5ec('0x75'),_0xa5ec('0x76')],'raw':!![]});}return null;})['then'](function(_0x4041f4){if(!_0x4041f4)return null;_0x2734b4[_0xa5ec('0x2b')][_0xa5ec('0x63')]=_0x4041f4;return _0x2734b4;})[_0xa5ec('0x23')](function(_0xead08b){if(_0xead08b){_0xead08b['message']['interface']=util[_0xa5ec('0x79')](_0xa5ec('0x7a'),_0x5a4621[_0xa5ec('0x6a')][_0xa5ec('0x3b')]);_0xead08b[_0xa5ec('0x2b')]['channel']=_0x2734b4[_0xa5ec('0x7b')];_0xead08b[_0xa5ec('0x2b')][_0xa5ec('0x7c')]=_0x2734b4[_0xa5ec('0x7b')];_0xead08b[_0xa5ec('0x2b')][_0xa5ec('0x7d')]='reject';respondWithRpcPromise(_0xa5ec('0x7e'),_0xa5ec('0x7e'),{'event':_0xa5ec('0x85'),'message':_0xead08b[_0xa5ec('0x2b')]},client9002);return _0x2734b4;}return null;})[_0xa5ec('0x23')](respondWithResult(_0x2dfcba,null))[_0xa5ec('0x2d')](handleError(_0x2dfcba,null));};exports[_0xa5ec('0x30')]=function(_0x25143f,_0x498e6c,_0x78b654){if(_0x25143f[_0xa5ec('0x5a')]['id']){delete _0x25143f[_0xa5ec('0x5a')]['id'];}var _0xa43067;return db[_0xa5ec('0x3f')]['find']({'where':{'id':_0x25143f['params']['id']}})[_0xa5ec('0x23')](handleEntityNotFound(_0x498e6c,null))['then'](function(_0x2fb0e1){if(_0x2fb0e1){_0xa43067=_0x2fb0e1;return db['SmsAccount'][_0xa5ec('0x58')]({'where':{'id':_0x2fb0e1[_0xa5ec('0x86')]}});}})['then'](handleEntityNotFound(_0x498e6c,null))[_0xa5ec('0x23')](function(_0x9dd5f6){if(_0x9dd5f6){logger[_0xa5ec('0x87')](_0xa5ec('0x27'),_0xa5ec('0x30'),'received\x20delivery\x20report\x20from',_0x9dd5f6[_0xa5ec('0x42')],util['inspect'](_0x25143f[_0xa5ec('0x5a')],{'showHidden':![],'depth':null}));switch(_0x9dd5f6[_0xa5ec('0x42')]){case _0xa5ec('0x88'):if(_0x25143f[_0xa5ec('0x5a')][_0xa5ec('0x89')]&&_0x25143f[_0xa5ec('0x5a')][_0xa5ec('0x89')]===_0xa43067[_0xa5ec('0x8a')]){return _0xa43067['update']({'read':!![]});}else{logger[_0xa5ec('0x29')](_0xa5ec('0x8b'),_0xa5ec('0x30'),_0xa5ec('0x88'),util[_0xa5ec('0x8c')](_0x25143f[_0xa5ec('0x5a')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x25143f[_0xa5ec('0x5a')][_0xa5ec('0x8d')]&&_0x25143f[_0xa5ec('0x5a')][_0xa5ec('0x8d')]===_0xa43067[_0xa5ec('0x8a')]&&_[_0xa5ec('0x8e')](['sent','delivered'],_0x25143f[_0xa5ec('0x5a')][_0xa5ec('0x8f')])>=0x0){return _0xa43067[_0xa5ec('0x66')]({'read':!![]});}else{logger[_0xa5ec('0x29')](_0xa5ec('0x8b'),'status','plivio',util[_0xa5ec('0x8c')](_0x25143f[_0xa5ec('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xa5ec('0x90'):var _0x61f806=_0x25143f[_0xa5ec('0x5a')][_0xa5ec('0x91')][0x0];if(_0x61f806[_0xa5ec('0x30')][_0xa5ec('0x92')]==='DELIVERED'){return _0xa43067[_0xa5ec('0x66')]({'read':!![]});}else{logger[_0xa5ec('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xa5ec('0x90'),util[_0xa5ec('0x8c')](_0x25143f[_0xa5ec('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0xa43067;}})[_0xa5ec('0x23')](respondWithResult(_0x498e6c,null))[_0xa5ec('0x2d')](handleError(_0x498e6c,null));}; \ No newline at end of file +var _0xc247=['status','end','json','offset','undefined','limit','Content-Range','apply','reject','destroy','stack','name','index','rawAttributes','fieldName','key','model','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','SmsMessage','count','includeAll','include','findAll','rows','show','params','keys','intersection','find','create','describe','../../config/logger','sms-interactions','accept','sms','body','read','readAt','format','UserId','user','agent','SmsInteraction','SmsInteractionId','update','isNil','read1stAt','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','fullname','email','internal','interface','SIP/%s','channel','motionChannel','EventManager','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','ContactId','contact','event','rejectmessage','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','MessageUUID','indexOf','sent','Status','plivio','results','DELIVERED','SmsAccount,\x20%s,\x20%s,\x20%s','infobip','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','sendStatus'];(function(_0x2efed0,_0x2301f6){var _0x4eee8d=function(_0x1e4f49){while(--_0x1e4f49){_0x2efed0['push'](_0x2efed0['shift']());}};_0x4eee8d(++_0x2301f6);}(_0xc247,0xfe));var _0x7c24=function(_0x202d24,_0x5e8641){_0x202d24=_0x202d24-0x0;var _0x2b3a8e=_0xc247[_0x202d24];return _0x2b3a8e;};'use strict';var emlformat=require(_0x7c24('0x0'));var rimraf=require(_0x7c24('0x1'));var zipdir=require(_0x7c24('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7c24('0x3'));var moment=require(_0x7c24('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7c24('0x5'));var path=require(_0x7c24('0x6'));var sox=require(_0x7c24('0x7'));var csv=require(_0x7c24('0x8'));var ejs=require(_0x7c24('0x9'));var fs=require('fs');var fs_extra=require(_0x7c24('0xa'));var _=require(_0x7c24('0xb'));var squel=require(_0x7c24('0xc'));var crypto=require(_0x7c24('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7c24('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7c24('0xf'));var Redis=require(_0x7c24('0x10'));var authService=require(_0x7c24('0x11'));var qs=require(_0x7c24('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7c24('0x13'));var logger=require('../../config/logger')(_0x7c24('0x14'));var utils=require(_0x7c24('0x15'));var config=require(_0x7c24('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7c24('0x17'))['db'];config[_0x7c24('0x18')]=_[_0x7c24('0x19')](config[_0x7c24('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7c24('0x18')]));require(_0x7c24('0x1a'))[_0x7c24('0x1b')](socket);var jayson=require(_0x7c24('0x1c'));var client=jayson[_0x7c24('0x1d')]['http']({'port':0x232c});var client9002=jayson['client'][_0x7c24('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x188656,_0x53474f,_0x18459a,_0x28febe){return new BPromise(function(_0x6e3760,_0x27803e){var _0x5c8b43=_0x28febe||client;return _0x5c8b43[_0x7c24('0x1f')](_0x188656,_0x18459a)[_0x7c24('0x20')](function(_0x29db21){logger[_0x7c24('0x21')](_0x7c24('0x22'),_0x53474f,'request\x20sent');logger[_0x7c24('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x53474f,_0x7c24('0x24'),JSON[_0x7c24('0x25')](_0x29db21));if(_0x29db21['error']){if(_0x29db21['error'][_0x7c24('0x26')]===0x1f4){logger[_0x7c24('0x27')](_0x7c24('0x22'),_0x53474f,_0x29db21[_0x7c24('0x27')]['message']);return _0x27803e(_0x29db21[_0x7c24('0x27')][_0x7c24('0x28')]);}logger[_0x7c24('0x27')](_0x7c24('0x22'),_0x53474f,_0x29db21[_0x7c24('0x27')][_0x7c24('0x28')]);return _0x6e3760(_0x29db21['error'][_0x7c24('0x28')]);}else{logger[_0x7c24('0x21')](_0x7c24('0x22'),_0x53474f,_0x7c24('0x24'));_0x6e3760(_0x29db21[_0x7c24('0x29')][_0x7c24('0x28')]);}})[_0x7c24('0x2a')](function(_0x3df3bf){logger[_0x7c24('0x27')](_0x7c24('0x22'),_0x53474f,_0x3df3bf);_0x27803e(_0x3df3bf);});});}function respondWithStatusCode(_0x472882,_0x21b640){_0x21b640=_0x21b640||0xcc;return function(_0x24c02c){if(_0x24c02c){return _0x472882[_0x7c24('0x2b')](_0x21b640);}return _0x472882[_0x7c24('0x2c')](_0x21b640)[_0x7c24('0x2d')]();};}function respondWithResult(_0xdcd9b9,_0x527972){_0x527972=_0x527972||0xc8;return function(_0x39a101){if(_0x39a101){return _0xdcd9b9[_0x7c24('0x2c')](_0x527972)[_0x7c24('0x2e')](_0x39a101);}};}function respondWithFilteredResult(_0x521a01,_0x57bed8){return function(_0x10a814){if(_0x10a814){var _0x465b56=typeof _0x57bed8[_0x7c24('0x2f')]==='undefined'&&typeof _0x57bed8['limit']===_0x7c24('0x30');var _0x29c02b=_0x10a814['count'];var _0x558d11=_0x465b56?0x0:_0x57bed8[_0x7c24('0x2f')];var _0x2e4a27=_0x465b56?_0x10a814['count']:_0x57bed8[_0x7c24('0x2f')]+_0x57bed8[_0x7c24('0x31')];var _0x52711c;if(_0x2e4a27>=_0x29c02b){_0x2e4a27=_0x29c02b;_0x52711c=0xc8;}else{_0x52711c=0xce;}_0x521a01['status'](_0x52711c);return _0x521a01['set'](_0x7c24('0x32'),_0x558d11+'-'+_0x2e4a27+'/'+_0x29c02b)[_0x7c24('0x2e')](_0x10a814);}return null;};}function patchUpdates(_0x244d1d){return function(_0x21b961){try{jsonpatch[_0x7c24('0x33')](_0x21b961,_0x244d1d,!![]);}catch(_0x3cba54){return BPromise[_0x7c24('0x34')](_0x3cba54);}return _0x21b961['save']();};}function saveUpdates(_0x5db47e,_0xfc1098){return function(_0x172b6d){if(_0x172b6d){return _0x172b6d['update'](_0x5db47e)[_0x7c24('0x20')](function(_0x414829){return _0x414829;});}return null;};}function removeEntity(_0x4484f4,_0x16332b){return function(_0x55aa53){if(_0x55aa53){return _0x55aa53[_0x7c24('0x35')]()['then'](function(){_0x4484f4[_0x7c24('0x2c')](0xcc)[_0x7c24('0x2d')]();});}};}function handleEntityNotFound(_0x34ba08,_0xf98971){return function(_0x30d3b3){if(!_0x30d3b3){_0x34ba08[_0x7c24('0x2b')](0x194);}return _0x30d3b3;};}function handleError(_0xbe8dd0,_0x57ce94){_0x57ce94=_0x57ce94||0x1f4;return function(_0x3fe72b){logger[_0x7c24('0x27')](_0x3fe72b[_0x7c24('0x36')]);if(_0x3fe72b[_0x7c24('0x37')]){delete _0x3fe72b[_0x7c24('0x37')];}_0xbe8dd0[_0x7c24('0x2c')](_0x57ce94)['send'](_0x3fe72b);};}exports[_0x7c24('0x38')]=function(_0x2d6131,_0x3cf723){var _0x594ca9={},_0x202283={},_0xdbe4e1={'count':0x0,'rows':[]};var _0xce9273=_['map'](db['SmsMessage'][_0x7c24('0x39')],function(_0x153cc8){return{'name':_0x153cc8[_0x7c24('0x3a')],'type':_0x153cc8['type'][_0x7c24('0x3b')]};});_0x202283[_0x7c24('0x3c')]=_['map'](_0xce9273,_0x7c24('0x37'));_0x202283[_0x7c24('0x3d')]=_['keys'](_0x2d6131[_0x7c24('0x3d')]);_0x202283[_0x7c24('0x3e')]=_['intersection'](_0x202283[_0x7c24('0x3c')],_0x202283['query']);_0x594ca9['attributes']=_['intersection'](_0x202283[_0x7c24('0x3c')],qs[_0x7c24('0x3f')](_0x2d6131[_0x7c24('0x3d')]['fields']));_0x594ca9[_0x7c24('0x40')]=_0x594ca9[_0x7c24('0x40')][_0x7c24('0x41')]?_0x594ca9[_0x7c24('0x40')]:_0x202283[_0x7c24('0x3c')];if(!_0x2d6131['query'][_0x7c24('0x42')](_0x7c24('0x43'))){_0x594ca9[_0x7c24('0x31')]=qs['limit'](_0x2d6131['query'][_0x7c24('0x31')]);_0x594ca9[_0x7c24('0x2f')]=qs[_0x7c24('0x2f')](_0x2d6131[_0x7c24('0x3d')][_0x7c24('0x2f')]);}_0x594ca9[_0x7c24('0x44')]=qs[_0x7c24('0x45')](_0x2d6131[_0x7c24('0x3d')][_0x7c24('0x45')]);_0x594ca9[_0x7c24('0x46')]=qs[_0x7c24('0x3e')](_[_0x7c24('0x47')](_0x2d6131[_0x7c24('0x3d')],_0x202283[_0x7c24('0x3e')]),_0xce9273);if(_0x2d6131['query'][_0x7c24('0x48')]){_0x594ca9[_0x7c24('0x46')]=_[_0x7c24('0x49')](_0x594ca9['where'],{'$or':_['map'](_0xce9273,function(_0x417ebc){if(_0x417ebc[_0x7c24('0x4a')]!==_0x7c24('0x4b')){var _0x36df89={};_0x36df89[_0x417ebc['name']]={'$like':'%'+_0x2d6131[_0x7c24('0x3d')][_0x7c24('0x48')]+'%'};return _0x36df89;}})});}_0x594ca9=_[_0x7c24('0x49')]({},_0x594ca9,_0x2d6131[_0x7c24('0x4c')]);var _0x30c6d4={'where':_0x594ca9[_0x7c24('0x46')]};return db[_0x7c24('0x4d')][_0x7c24('0x4e')](_0x30c6d4)[_0x7c24('0x20')](function(_0x57318a){_0xdbe4e1[_0x7c24('0x4e')]=_0x57318a;if(_0x2d6131[_0x7c24('0x3d')][_0x7c24('0x4f')]){_0x594ca9[_0x7c24('0x50')]=[{'all':!![]}];}return db[_0x7c24('0x4d')][_0x7c24('0x51')](_0x594ca9);})[_0x7c24('0x20')](function(_0x2256a5){_0xdbe4e1[_0x7c24('0x52')]=_0x2256a5;return _0xdbe4e1;})['then'](respondWithFilteredResult(_0x3cf723,_0x594ca9))[_0x7c24('0x2a')](handleError(_0x3cf723,null));};exports[_0x7c24('0x53')]=function(_0xd2cf00,_0x4ea8fa){var _0x589c28={'raw':!![],'where':{'id':_0xd2cf00[_0x7c24('0x54')]['id']}},_0x4c6643={};_0x4c6643['model']=_[_0x7c24('0x55')](db[_0x7c24('0x4d')][_0x7c24('0x39')]);_0x4c6643['query']=_[_0x7c24('0x55')](_0xd2cf00[_0x7c24('0x3d')]);_0x4c6643[_0x7c24('0x3e')]=_[_0x7c24('0x56')](_0x4c6643[_0x7c24('0x3c')],_0x4c6643[_0x7c24('0x3d')]);_0x589c28['attributes']=_[_0x7c24('0x56')](_0x4c6643[_0x7c24('0x3c')],qs[_0x7c24('0x3f')](_0xd2cf00['query'][_0x7c24('0x3f')]));_0x589c28['attributes']=_0x589c28[_0x7c24('0x40')][_0x7c24('0x41')]?_0x589c28['attributes']:_0x4c6643[_0x7c24('0x3c')];if(_0xd2cf00[_0x7c24('0x3d')][_0x7c24('0x4f')]){_0x589c28[_0x7c24('0x50')]=[{'all':!![]}];}_0x589c28=_[_0x7c24('0x49')]({},_0x589c28,_0xd2cf00[_0x7c24('0x4c')]);return db[_0x7c24('0x4d')][_0x7c24('0x57')](_0x589c28)[_0x7c24('0x20')](handleEntityNotFound(_0x4ea8fa,null))[_0x7c24('0x20')](respondWithResult(_0x4ea8fa,null))[_0x7c24('0x2a')](handleError(_0x4ea8fa,null));};exports[_0x7c24('0x58')]=function(_0x334a88,_0xbd21f8){return db[_0x7c24('0x4d')][_0x7c24('0x58')](_0x334a88['body'],{})['then'](respondWithResult(_0xbd21f8,0xc9))[_0x7c24('0x2a')](handleError(_0xbd21f8,null));};exports['update']=function(_0x4fb9fc,_0x5709e2){if(_0x4fb9fc['body']['id']){delete _0x4fb9fc['body']['id'];}return db['SmsMessage'][_0x7c24('0x57')]({'where':{'id':_0x4fb9fc['params']['id']}})[_0x7c24('0x20')](handleEntityNotFound(_0x5709e2,null))[_0x7c24('0x20')](saveUpdates(_0x4fb9fc['body'],null))[_0x7c24('0x20')](respondWithResult(_0x5709e2,null))[_0x7c24('0x2a')](handleError(_0x5709e2,null));};exports[_0x7c24('0x35')]=function(_0x583d8d,_0x229cfc){return db[_0x7c24('0x4d')][_0x7c24('0x57')]({'where':{'id':_0x583d8d[_0x7c24('0x54')]['id']}})['then'](handleEntityNotFound(_0x229cfc,null))['then'](removeEntity(_0x229cfc,null))[_0x7c24('0x2a')](handleError(_0x229cfc,null));};exports[_0x7c24('0x59')]=function(_0x43a2b9,_0x4be583){return db[_0x7c24('0x4d')][_0x7c24('0x59')]()[_0x7c24('0x20')](respondWithResult(_0x4be583,null))[_0x7c24('0x2a')](handleError(_0x4be583,null));};var interaction_log=require(_0x7c24('0x5a'))(_0x7c24('0x5b'));exports[_0x7c24('0x5c')]=function(_0x500a90,_0x258910,_0x16c9ce){var _0x598ca6={'agent':{},'channel':_0x7c24('0x5d')};if(_0x500a90[_0x7c24('0x5e')]['id']){delete _0x500a90[_0x7c24('0x5e')]['id'];}_0x500a90[_0x7c24('0x5e')][_0x7c24('0x5f')]=!![];_0x500a90[_0x7c24('0x5e')][_0x7c24('0x60')]=moment()[_0x7c24('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0x500a90[_0x7c24('0x5e')][_0x7c24('0x62')]=_0x500a90[_0x7c24('0x5e')][_0x7c24('0x62')]||_0x500a90[_0x7c24('0x63')]['id'];_0x598ca6[_0x7c24('0x64')]['id']=_0x500a90[_0x7c24('0x5e')][_0x7c24('0x62')];return db[_0x7c24('0x4d')]['find']({'where':{'id':_0x500a90['params']['id'],'UserId':null}})[_0x7c24('0x20')](handleEntityNotFound(_0x258910,null))[_0x7c24('0x20')](saveUpdates(_0x500a90[_0x7c24('0x5e')],null))[_0x7c24('0x20')](function(_0xd16d87){if(_0xd16d87){_0x598ca6['message']=_0xd16d87['get']({'plain':!![]});return db[_0x7c24('0x65')][_0x7c24('0x57')]({'where':{'id':_0xd16d87[_0x7c24('0x66')]}});}return null;})[_0x7c24('0x20')](handleEntityNotFound(_0x258910,null))[_0x7c24('0x20')](function(_0x230660){if(_0x230660){return _0x230660[_0x7c24('0x67')]({'UserId':_0x500a90[_0x7c24('0x5e')][_0x7c24('0x62')],'read1stAt':_[_0x7c24('0x68')](_0x230660[_0x7c24('0x69')])?moment()[_0x7c24('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x7c24('0x20')](function(_0x5e2131){if(_0x5e2131){_0x598ca6[_0x7c24('0x6a')]=_0x5e2131[_0x7c24('0x6b')]({'plain':!![]});interaction_log[_0x7c24('0x21')](_0x7c24('0x6c'),_0x500a90['user']['id'],_0x500a90[_0x7c24('0x63')][_0x7c24('0x37')],_0x500a90[_0x7c24('0x63')][_0x7c24('0x6d')],_0x598ca6['interaction']['id'],_0x500a90[_0x7c24('0x5e')]?JSON[_0x7c24('0x25')](_0x500a90[_0x7c24('0x5e')]):'null');return respondWithRpcPromise(_0x7c24('0x6e'),_0x7c24('0x6f'),_0x598ca6);}return null;})['then'](function(_0x560931){var _0x8427c0=_0x7c24('0x70')+_0x560931['message']['ContactId'];return db[_0x7c24('0x71')]['query'](_0x8427c0,{'type':db[_0x7c24('0x72')][_0x7c24('0x73')][_0x7c24('0x74')],'raw':!![]})[_0x7c24('0x20')](function(_0x1cd897){return _0x1cd897;});})[_0x7c24('0x20')](function(_0x5abceb){if(_0x5abceb){_0x598ca6[_0x7c24('0x28')]['contact']=_0x5abceb[0x0];if(!_0x500a90[_0x7c24('0x5e')]['UserId'])return;return db['User'][_0x7c24('0x57')]({'where':{'id':_0x500a90[_0x7c24('0x5e')][_0x7c24('0x62')],'role':_0x7c24('0x64')},'attributes':['id','name',_0x7c24('0x75'),_0x7c24('0x76'),_0x7c24('0x77')],'raw':!![]});}return null;})['then'](function(_0x11ebd9){if(!_0x11ebd9)return null;_0x598ca6[_0x7c24('0x28')][_0x7c24('0x64')]=_0x11ebd9;return _0x598ca6;})[_0x7c24('0x20')](function(_0x238e5){if(_0x238e5){if(_0x500a90[_0x7c24('0x5e')]['manual']){_0x598ca6[_0x7c24('0x28')][_0x7c24('0x78')]=util[_0x7c24('0x61')](_0x7c24('0x79'),_0x500a90[_0x7c24('0x63')][_0x7c24('0x37')]);_0x598ca6[_0x7c24('0x28')][_0x7c24('0x7a')]=_0x598ca6[_0x7c24('0x7a')];_0x598ca6[_0x7c24('0x28')][_0x7c24('0x7b')]=_0x598ca6[_0x7c24('0x7a')];_0x598ca6[_0x7c24('0x28')]['event']=_0x7c24('0x5c');return respondWithRpcPromise('EventManager',_0x7c24('0x7c'),{'event':'acceptmessage','message':_0x598ca6[_0x7c24('0x28')]},client9002)['then'](function(){return _0x598ca6;});}return _0x598ca6;}return null;})['then'](respondWithResult(_0x258910,null))[_0x7c24('0x2a')](handleError(_0x258910,null));};var interaction_log=require(_0x7c24('0x5a'))(_0x7c24('0x5b'));exports[_0x7c24('0x34')]=function(_0x1128c9,_0x467221,_0x566c56){var _0x2a489d={'agent':{},'channel':_0x7c24('0x5d')};if(_0x1128c9[_0x7c24('0x5e')]['id']){delete _0x1128c9['body']['id'];}_0x1128c9[_0x7c24('0x5e')]['UserId']=_0x1128c9[_0x7c24('0x5e')][_0x7c24('0x62')]||_0x1128c9['user']['id'];_0x2a489d['agent']['id']=_0x1128c9[_0x7c24('0x5e')][_0x7c24('0x62')];return db[_0x7c24('0x4d')][_0x7c24('0x57')]({'where':{'id':_0x1128c9[_0x7c24('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x467221,null))[_0x7c24('0x20')](function(_0x398ab2){if(_0x398ab2){_0x2a489d[_0x7c24('0x28')]=_0x398ab2[_0x7c24('0x6b')]({'plain':!![]});return db['SmsInteraction'][_0x7c24('0x57')]({'where':{'id':_0x398ab2[_0x7c24('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x467221,null))[_0x7c24('0x20')](function(_0x10e97a){if(_0x10e97a){_0x2a489d[_0x7c24('0x6a')]=_0x10e97a[_0x7c24('0x6b')]({'plain':!![]});interaction_log[_0x7c24('0x21')](_0x7c24('0x7d'),_0x1128c9[_0x7c24('0x63')]['id'],_0x1128c9['user'][_0x7c24('0x37')],_0x1128c9[_0x7c24('0x63')][_0x7c24('0x6d')],_0x2a489d[_0x7c24('0x6a')]['id'],_0x1128c9[_0x7c24('0x5e')]?JSON[_0x7c24('0x25')](_0x1128c9['body']):_0x7c24('0x7e'));return respondWithRpcPromise(_0x7c24('0x7f'),_0x7c24('0x80'),_0x2a489d);}return null;})[_0x7c24('0x20')](function(_0x189ed0){var _0x37fb44=_0x7c24('0x70')+_0x189ed0[_0x7c24('0x28')][_0x7c24('0x81')];return db['sequelize'][_0x7c24('0x3d')](_0x37fb44,{'type':db['Sequelize']['QueryTypes'][_0x7c24('0x74')],'raw':!![]})[_0x7c24('0x20')](function(_0x36121f){return _0x36121f;});})[_0x7c24('0x20')](function(_0x12fe61){if(_0x12fe61){_0x2a489d[_0x7c24('0x28')][_0x7c24('0x82')]=_0x12fe61[0x0];if(!_0x1128c9[_0x7c24('0x5e')][_0x7c24('0x62')])return;return db['User'][_0x7c24('0x57')]({'where':{'id':_0x1128c9[_0x7c24('0x5e')][_0x7c24('0x62')],'role':'agent'},'attributes':['id',_0x7c24('0x37'),_0x7c24('0x75'),_0x7c24('0x76'),_0x7c24('0x77')],'raw':!![]});}return null;})[_0x7c24('0x20')](function(_0x4d85d0){if(!_0x4d85d0)return null;_0x2a489d[_0x7c24('0x28')]['agent']=_0x4d85d0;return _0x2a489d;})[_0x7c24('0x20')](function(_0x18bc11){if(_0x18bc11){_0x18bc11[_0x7c24('0x28')][_0x7c24('0x78')]=util[_0x7c24('0x61')](_0x7c24('0x79'),_0x1128c9[_0x7c24('0x63')]['name']);_0x18bc11[_0x7c24('0x28')][_0x7c24('0x7a')]=_0x2a489d[_0x7c24('0x7a')];_0x18bc11[_0x7c24('0x28')][_0x7c24('0x7b')]=_0x2a489d['channel'];_0x18bc11[_0x7c24('0x28')][_0x7c24('0x83')]=_0x7c24('0x34');respondWithRpcPromise('EventManager',_0x7c24('0x7c'),{'event':_0x7c24('0x84'),'message':_0x18bc11[_0x7c24('0x28')]},client9002);return _0x2a489d;}return null;})['then'](respondWithResult(_0x467221,null))[_0x7c24('0x2a')](handleError(_0x467221,null));};exports[_0x7c24('0x2c')]=function(_0x5ebd04,_0x37e909,_0x49608a){if(_0x5ebd04[_0x7c24('0x5e')]['id']){delete _0x5ebd04[_0x7c24('0x5e')]['id'];}var _0x5e1552;return db[_0x7c24('0x4d')][_0x7c24('0x57')]({'where':{'id':_0x5ebd04['params']['id']}})[_0x7c24('0x20')](handleEntityNotFound(_0x37e909,null))[_0x7c24('0x20')](function(_0x422159){if(_0x422159){_0x5e1552=_0x422159;return db[_0x7c24('0x85')][_0x7c24('0x57')]({'where':{'id':_0x422159[_0x7c24('0x86')]}});}})[_0x7c24('0x20')](handleEntityNotFound(_0x37e909,null))[_0x7c24('0x20')](function(_0x265415){if(_0x265415){logger[_0x7c24('0x23')](_0x7c24('0x87'),_0x7c24('0x2c'),_0x7c24('0x88'),_0x265415[_0x7c24('0x4a')],util[_0x7c24('0x89')](_0x5ebd04[_0x7c24('0x5e')],{'showHidden':![],'depth':null}));switch(_0x265415['type']){case _0x7c24('0x8a'):if(_0x5ebd04[_0x7c24('0x5e')][_0x7c24('0x8b')]&&_0x5ebd04[_0x7c24('0x5e')][_0x7c24('0x8b')]===_0x5e1552['messageId']){return _0x5e1552[_0x7c24('0x67')]({'read':!![]});}else{logger[_0x7c24('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7c24('0x2c'),_0x7c24('0x8a'),util[_0x7c24('0x89')](_0x5ebd04[_0x7c24('0x5e')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x5ebd04[_0x7c24('0x5e')]['MessageUUID']&&_0x5ebd04['body'][_0x7c24('0x8c')]===_0x5e1552['messageId']&&_[_0x7c24('0x8d')]([_0x7c24('0x8e'),'delivered'],_0x5ebd04[_0x7c24('0x5e')][_0x7c24('0x8f')])>=0x0){return _0x5e1552['update']({'read':!![]});}else{logger[_0x7c24('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x7c24('0x90'),util[_0x7c24('0x89')](_0x5ebd04[_0x7c24('0x5e')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x46b013=_0x5ebd04[_0x7c24('0x5e')][_0x7c24('0x91')][0x0];if(_0x46b013[_0x7c24('0x2c')]['groupName']===_0x7c24('0x92')){return _0x5e1552[_0x7c24('0x67')]({'read':!![]});}else{logger[_0x7c24('0x27')](_0x7c24('0x93'),_0x7c24('0x2c'),_0x7c24('0x94'),util[_0x7c24('0x89')](_0x5ebd04[_0x7c24('0x5e')],{'showHidden':![],'depth':null}));}break;}return _0x5e1552;}})[_0x7c24('0x20')](respondWithResult(_0x37e909,null))[_0x7c24('0x2a')](handleError(_0x37e909,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index f68a35b..720ab21 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 _0x2c40=['hook','exports','events','update','remove','emit','hasOwnProperty'];(function(_0xe59f92,_0x3787f3){var _0x2e471d=function(_0x221c3c){while(--_0x221c3c){_0xe59f92['push'](_0xe59f92['shift']());}};_0x2e471d(++_0x3787f3);}(_0x2c40,0x144));var _0x02c4=function(_0x2aeb02,_0x69e6a3){_0x2aeb02=_0x2aeb02-0x0;var _0x324273=_0x2c40[_0x2aeb02];return _0x324273;};'use strict';var EventEmitter=require(_0x02c4('0x0'));var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x02c4('0x1'),'afterDestroy':_0x02c4('0x2')};function emitEvent(_0x41f205){return function(_0x27ef09,_0x4a396d,_0x512d40){SmsMessageEvents[_0x02c4('0x3')](_0x41f205+':'+_0x27ef09['id'],_0x27ef09);SmsMessageEvents['emit'](_0x41f205,_0x27ef09);_0x512d40(null);};}for(var e in events){if(events[_0x02c4('0x4')](e)){var event=events[e];SmsMessage[_0x02c4('0x5')](e,emitEvent(event));}}module[_0x02c4('0x6')]=SmsMessageEvents; \ No newline at end of file +var _0x4bec=['exports','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0xf84870,_0x4dc38f){var _0x4541a4=function(_0x3ff5d5){while(--_0x3ff5d5){_0xf84870['push'](_0xf84870['shift']());}};_0x4541a4(++_0x4dc38f);}(_0x4bec,0x17d));var _0xc4be=function(_0xddfbe3,_0x23d9ca){_0xddfbe3=_0xddfbe3-0x0;var _0xbb1594=_0x4bec[_0xddfbe3];return _0xbb1594;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0xc4be('0x0'))['db'][_0xc4be('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xc4be('0x2')](0x0);var events={'afterCreate':_0xc4be('0x3'),'afterUpdate':_0xc4be('0x4'),'afterDestroy':_0xc4be('0x5')};function emitEvent(_0x35ded9){return function(_0x420413,_0x9427ea,_0x288382){SmsMessageEvents[_0xc4be('0x6')](_0x35ded9+':'+_0x420413['id'],_0x420413);SmsMessageEvents[_0xc4be('0x6')](_0x35ded9,_0x420413);_0x288382(null);};}for(var e in events){if(events[_0xc4be('0x7')](e)){var event=events[e];SmsMessage[_0xc4be('0x8')](e,emitEvent(event));}}module[_0xc4be('0x9')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index fca543c..5e7cdec 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 _0x81e6=['SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','out','secret','isNil','UserId','SmsInteractionId','findOne','then','update','createdAt','toLowerCase','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','sms','POST','user_key','session_key','internal_order_id','deliveryReport','skebby','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','read','connectel','clicksend','xCALLY\x20Motion','%s:%s','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','toString','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','application/json','Missing\x20parameters:\x20base_url','crypto','apiKey','login','text','timestamp','keys','sort','length','createHash','md5','digest','hex','signature=','GET','/external/get/send.php?','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','exports','define'];(function(_0x2a7210,_0x2f3d23){var _0x460766=function(_0xd575dd){while(--_0xd575dd){_0x2a7210['push'](_0x2a7210['shift']());}};_0x460766(++_0x2f3d23);}(_0x81e6,0xf3));var _0x681e=function(_0x5d708c,_0x2c95cc){_0x5d708c=_0x5d708c-0x0;var _0x453d7e=_0x81e6[_0x5d708c];return _0x453d7e;};'use strict';var _=require(_0x681e('0x0'));var util=require(_0x681e('0x1'));var logger=require(_0x681e('0x2'))('api');var moment=require(_0x681e('0x3'));var BPromise=require('bluebird');var rp=require(_0x681e('0x4'));var fs=require('fs');var path=require(_0x681e('0x5'));var rimraf=require('rimraf');var config=require(_0x681e('0x6'));var attributes=require('./smsMessage.attributes');module[_0x681e('0x7')]=function(_0x3d006b,_0x442838){return _0x3d006b[_0x681e('0x8')](_0x681e('0x9'),attributes,{'tableName':_0x681e('0xa'),'paranoid':![],'indexes':[{'name':_0x681e('0xb'),'fields':[_0x681e('0xb')]},{'name':_0x681e('0xc'),'fields':[_0x681e('0xd')],'type':_0x681e('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x449827,_0x7f3e55,_0x3c8de6){var _0x198096=_0x3d006b[_0x681e('0xf')];var _0x25fd7d=_0x449827[_0x681e('0x10')]({'plain':!![]});if(_0x25fd7d[_0x681e('0x11')]['toLowerCase']()==='in'||_0x25fd7d['direction']['toLowerCase']()===_0x681e('0x12')&&!_0x25fd7d[_0x681e('0x13')]&&!_[_0x681e('0x14')](_0x25fd7d[_0x681e('0x15')])&&!_[_0x681e('0x14')](_0x25fd7d[_0x681e('0x16')])){_0x198096['SmsInteraction'][_0x681e('0x17')]({'where':{'id':_0x25fd7d[_0x681e('0x16')]}})[_0x681e('0x18')](function(_0xd3d4cb){if(_0xd3d4cb){_0xd3d4cb[_0x681e('0x19')]({'lastMsgAt':_0x25fd7d[_0x681e('0x1a')],'lastMsgDirection':_0x25fd7d['direction'][_0x681e('0x1b')]()});}})[_0x681e('0x1c')](function(_0x3b8d1d){console[_0x681e('0x1d')](_0x3b8d1d);});}if(_0x25fd7d[_0x681e('0x11')]==='out'&&!_0x25fd7d[_0x681e('0x13')]){var _0x9b6983;_0x198096[_0x681e('0x1e')][_0x681e('0x1f')]({'where':{'id':_0x25fd7d[_0x681e('0x20')]},'raw':!![]})[_0x681e('0x18')](function(_0xf2456f){_0x9b6983=_0xf2456f;if(_0x9b6983&&_0x9b6983[_0x681e('0x21')]){switch(_0x9b6983[_0x681e('0x21')]){case _0x681e('0x22'):var _0x3dded9=require(_0x681e('0x22'));if(_0x9b6983[_0x681e('0x23')]&&_0x9b6983[_0x681e('0x24')]&&_0x9b6983[_0x681e('0x25')]){var _0x16e17f=new _0x3dded9(_0x9b6983[_0x681e('0x23')],_0x9b6983['authToken']);_0x16e17f[_0x681e('0x26')][_0x681e('0x27')]({'body':_0x25fd7d[_0x681e('0xd')],'to':_0x25fd7d[_0x681e('0x25')],'from':_0x9b6983[_0x681e('0x25')],'statusCallback':_0x9b6983[_0x681e('0x28')]+_0x681e('0x29')+_0x25fd7d['id']+_0x681e('0x2a')+_0x9b6983[_0x681e('0x2b')]})[_0x681e('0x18')](function(_0x24a69e){if(_0x24a69e[_0x681e('0x2c')]){return _0x449827[_0x681e('0x19')]({'messageId':_0x24a69e[_0x681e('0x2c')]});}})[_0x681e('0x1c')](function(_0x5b0db9){logger[_0x681e('0x1d')](_0x681e('0x2d'),_0x681e('0x2e'),_0x681e('0x22'),util[_0x681e('0x2f')](_0x5b0db9,{'showHidden':![],'depth':null}));});}else{logger[_0x681e('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x681e('0x2e'),'twilio',_0x681e('0x30'));}break;case'skebby':var _0x3145f9=_0x681e('0x31');if(_0x9b6983[_0x681e('0x32')]&&_0x9b6983[_0x681e('0x33')]){var _0x1ca965={'recipient':[_0x25fd7d[_0x681e('0x25')]],'message':_0x25fd7d[_0x681e('0xd')],'message_type':_0x9b6983[_0x681e('0x34')]};if(_0x9b6983[_0x681e('0x34')]&&_0x9b6983[_0x681e('0x34')]!=='SI'){_0x1ca965[_0x681e('0x35')]=_0x9b6983[_0x681e('0x25')];}var _0xebf68f={'url':_0x3145f9+_0x681e('0x36')+_0x9b6983[_0x681e('0x32')]+_0x681e('0x37')+_0x9b6983[_0x681e('0x33')],'method':'GET'};rp(_0xebf68f)[_0x681e('0x18')](function(_0x23d8f6){var _0x177bbc=_0x23d8f6['split'](';');var _0xfbf0da={'user_key':_0x177bbc[0x0],'session_key':_0x177bbc[0x1]};_0xebf68f={'url':_0x3145f9+_0x681e('0x38'),'method':_0x681e('0x39'),'headers':{'user_key':_0xfbf0da[_0x681e('0x3a')],'Session_key':_0xfbf0da[_0x681e('0x3b')]},'json':!![],'body':_0x1ca965};return rp(_0xebf68f);})[_0x681e('0x18')](function(_0x3cb73f){if(_0x3cb73f['total_sent']>=0x1){var _0x2a4e24={'messageId':_0x3cb73f[_0x681e('0x3c')]};if(_0x9b6983[_0x681e('0x34')]!=='GP'||!_0x9b6983[_0x681e('0x3d')]){_0x2a4e24['read']=!![];}return _0x449827[_0x681e('0x19')](_0x2a4e24);}else{return logger[_0x681e('0x1d')](_0x681e('0x2d'),_0x681e('0x2e'),_0x681e('0x3e'),util['inspect'](_0x3cb73f,{'showHidden':![],'depth':null}));}})[_0x681e('0x1c')](function(_0x3ac47e){return logger[_0x681e('0x1d')](_0x681e('0x2d'),_0x681e('0x2e'),'skebby',util[_0x681e('0x2f')](_0x3ac47e,{'showHidden':![],'depth':null}));});}else{logger[_0x681e('0x1d')](_0x681e('0x2d'),_0x681e('0x2e'),_0x681e('0x3e'),_0x681e('0x3f'));}break;case'connectel':if(_0x9b6983[_0x681e('0x24')]){var _0x520118={'recipient':_0x25fd7d[_0x681e('0x25')],'message':_0x25fd7d['body'],'sender':_0x9b6983[_0x681e('0x40')]||_0x9b6983[_0x681e('0x25')],'authorization':_0x9b6983[_0x681e('0x24')]};var _0x7f3e55={'method':'POST','uri':_0x681e('0x41'),'body':_0x520118,'json':!![]};rp(_0x7f3e55)['then'](function(_0x4756ba){var _0x240b19={'messageId':_0x4756ba[_0x681e('0x42')]};if(!_0x9b6983['deliveryReport']){_0x240b19[_0x681e('0x43')]=!![];}return _0x449827['update'](_0x240b19);})['catch'](function(_0xc76a67){logger[_0x681e('0x1d')](_0x681e('0x2d'),_0x681e('0x2e'),_0x681e('0x44'),util[_0x681e('0x2f')](_0xc76a67,{'showHidden':![],'depth':null}));});}else{logger[_0x681e('0x1d')](_0x681e('0x2d'),_0x681e('0x2e'),_0x681e('0x44'),'Missing\x20parameters:\x20authToken');}break;case _0x681e('0x45'):if(_0x9b6983['username']&&_0x9b6983[_0x681e('0x33')]){var _0x520118={'messages':[{'source':_0x681e('0x46'),'to':_0x25fd7d['phone'],'body':_0x25fd7d['body'],'from':_0x9b6983['senderString']||_0x9b6983[_0x681e('0x25')]}]};var _0x414596=util['format'](_0x681e('0x47'),_0x9b6983[_0x681e('0x32')],_0x9b6983[_0x681e('0x33')]);var _0x7f3e55={'method':_0x681e('0x39'),'uri':_0x681e('0x48'),'body':_0x520118,'headers':{'Authorization':util[_0x681e('0x49')](_0x681e('0x4a'),new Buffer(_0x414596)[_0x681e('0x4b')]('base64'))},'json':!![]};rp(_0x7f3e55)[_0x681e('0x18')](function(_0x188cd5){if(_0x188cd5[_0x681e('0x4c')]>=0xc8&&_0x188cd5[_0x681e('0x4c')]<=0xce){if(_0x188cd5[_0x681e('0x4d')]&&_0x188cd5[_0x681e('0x4d')][_0x681e('0x4e')]>0x0){var _0x38adbb=_[_0x681e('0x4f')](_0x188cd5[_0x681e('0x4d')][_0x681e('0x26')]);var _0x3c45e0={'messageId':_0x38adbb[_0x681e('0x50')]};if(!_0x9b6983[_0x681e('0x3d')]){_0x3c45e0[_0x681e('0x43')]=!![];}return _0x449827['update'](_0x3c45e0);}else{logger[_0x681e('0x1d')](_0x681e('0x2d'),_0x681e('0x2e'),_0x681e('0x51'),util[_0x681e('0x2f')](_0x188cd5,{'showHidden':![],'depth':null}));}}else{logger[_0x681e('0x1d')](_0x681e('0x2d'),_0x681e('0x2e'),'clickSend',util[_0x681e('0x2f')](_0x188cd5,{'showHidden':![],'depth':null}));}})[_0x681e('0x1c')](function(_0x45039c){logger[_0x681e('0x1d')](_0x681e('0x2d'),_0x681e('0x2e'),_0x681e('0x51'),util[_0x681e('0x2f')](_0x45039c,{'showHidden':![],'depth':null}));});}else{logger[_0x681e('0x1d')](_0x681e('0x2d'),'afterCreate',_0x681e('0x51'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x681e('0x52'):if(_0x9b6983[_0x681e('0x53')]&&_0x9b6983[_0x681e('0x24')]){var _0x520118={'dst':_0x25fd7d['phone'],'text':_0x25fd7d[_0x681e('0xd')],'src':_0x9b6983[_0x681e('0x40')]||_0x9b6983[_0x681e('0x25')],'url':_0x9b6983[_0x681e('0x28')]+_0x681e('0x29')+_0x25fd7d['id']+_0x681e('0x2a')+_0x9b6983[_0x681e('0x2b')]};var _0x414596=util[_0x681e('0x49')](_0x681e('0x47'),_0x9b6983[_0x681e('0x53')],_0x9b6983[_0x681e('0x24')]);var _0x7f3e55={'method':_0x681e('0x39'),'uri':util['format'](_0x681e('0x54'),_0x9b6983[_0x681e('0x53')]),'body':_0x520118,'headers':{'Authorization':util['format'](_0x681e('0x4a'),new Buffer(_0x414596)['toString']('base64'))},'json':!![]};rp(_0x7f3e55)[_0x681e('0x18')](function(_0x33acdf){var _0x43ba29={'messageId':_0x33acdf[_0x681e('0x55')][0x0]};return _0x449827[_0x681e('0x19')](_0x43ba29);})[_0x681e('0x1c')](function(_0x268e14){logger[_0x681e('0x1d')](_0x681e('0x2d'),_0x681e('0x2e'),_0x681e('0x52'),util[_0x681e('0x2f')](_0x268e14,{'showHidden':![],'depth':null}));});}else{logger[_0x681e('0x1d')](_0x681e('0x2d'),_0x681e('0x2e'),_0x681e('0x52'),_0x681e('0x56'));}break;case _0x681e('0x57'):if(_0x9b6983[_0x681e('0x32')]&&_0x9b6983[_0x681e('0x33')]){if(_0x9b6983['baseUrl']){var _0xb2701c={'method':_0x681e('0x39'),'uri':_0x9b6983[_0x681e('0x58')]+'/auth/1/session','body':{'username':_0x9b6983[_0x681e('0x32')],'password':_0x9b6983['password']},'json':!![]};return rp(_0xb2701c)[_0x681e('0x18')](function(_0xa9d5e3){var _0x367979={'method':'POST','uri':_0x9b6983['baseUrl']+'/sms/2/text/advanced','body':{'messages':[{'from':_0x9b6983[_0x681e('0x25')],'destinations':[{'to':_0x25fd7d[_0x681e('0x25')]}],'text':_0x25fd7d['body'],'notifyUrl':_0x9b6983['remote']+_0x681e('0x29')+_0x25fd7d['id']+'/status?token='+_0x9b6983['token'],'notifyContentType':_0x681e('0x59'),'callbackData':_0x9b6983['phone']+';'+_0x25fd7d[_0x681e('0xd')]}]},'headers':{'Authorization':'IBSSO\x20'+_0xa9d5e3[_0x681e('0x2b')]},'json':!![]};return rp(_0x367979)[_0x681e('0x18')](function(_0x569605){if(_0x569605['messages']){var _0x4d743c={'messageId':_0x569605['messages'][0x0]['messageId']};if(!_0x9b6983[_0x681e('0x3d')]){_0x4d743c[_0x681e('0x43')]=!![];}return _0x449827[_0x681e('0x19')](_0x4d743c);}else{return logger[_0x681e('0x1d')](_0x681e('0x2d'),'afterCreate',_0x681e('0x57'),util[_0x681e('0x2f')](_0x569605,{'showHidden':![],'depth':null}));}});})[_0x681e('0x1c')](function(_0x3535cb){return logger[_0x681e('0x1d')](_0x681e('0x2d'),_0x681e('0x2e'),'infobip',util[_0x681e('0x2f')](_0x3535cb,{'showHidden':![],'depth':null}));});}else{logger[_0x681e('0x1d')](_0x681e('0x2d'),_0x681e('0x2e'),_0x681e('0x57'),_0x681e('0x5a'));}}else{logger[_0x681e('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x681e('0x2e'),_0x681e('0x57'),_0x681e('0x3f'));}break;case'csc':var _0x7af79c=require(_0x681e('0x5b'));if(_0x9b6983[_0x681e('0x5c')]){var _0x4832a0={};_0x4832a0[_0x681e('0x5d')]=_0x9b6983[_0x681e('0x32')];_0x4832a0[_0x681e('0x25')]=_0x25fd7d[_0x681e('0x25')];_0x4832a0[_0x681e('0x35')]=_0x9b6983[_0x681e('0x25')];_0x4832a0[_0x681e('0x5e')]=_0x25fd7d['body'];_0x4832a0[_0x681e('0x5f')]=+new Date();var _0x391bee='';var _0x2de8de='';var _0x18701e=Object[_0x681e('0x60')](_0x4832a0);_0x18701e[_0x681e('0x61')]();for(var _0x1bc9d3=0x0;_0x1bc9d3<_0x18701e[_0x681e('0x62')];_0x1bc9d3++){if(_0x391bee!=''){_0x391bee+='&';}_0x391bee+=_0x18701e[_0x1bc9d3]+'='+encodeURIComponent(_0x4832a0[_0x18701e[_0x1bc9d3]]);_0x2de8de+=_0x4832a0[_0x18701e[_0x1bc9d3]];}_0x2de8de+=_0x9b6983[_0x681e('0x5c')];_0x2de8de=_0x7af79c[_0x681e('0x63')](_0x681e('0x64'))[_0x681e('0x19')](_0x2de8de)[_0x681e('0x65')](_0x681e('0x66'));if(_0x391bee!==''){_0x391bee+='&';}_0x391bee+=_0x681e('0x67')+_0x2de8de;var _0xebf68f={'method':_0x681e('0x68'),'uri':_0x9b6983['baseUrl']+_0x681e('0x69')+_0x391bee,'json':!![]};return rp(_0xebf68f)[_0x681e('0x18')](function(_0x19ffd0){var _0x1101a0=Object['keys'](_0x19ffd0);if(_0x19ffd0[_0x1101a0[0x0]][_0x681e('0x1d')]&&parseInt(_0x19ffd0[_0x1101a0[0x0]][_0x681e('0x1d')])===0x0){var _0x38873f={'messageId':_0x19ffd0[_0x1101a0[0x0]]['id_sms']};if(!_0x9b6983[_0x681e('0x3d')]){_0x38873f[_0x681e('0x43')]=!![];}return _0x449827[_0x681e('0x19')](_0x38873f);}else{return logger[_0x681e('0x1d')](_0x681e('0x2d'),_0x681e('0x2e'),'csc',util[_0x681e('0x2f')](_0x19ffd0[_0x681e('0x1d')],{'showHidden':![],'depth':null}));}})[_0x681e('0x1c')](function(_0x1f8978){return logger[_0x681e('0x1d')](_0x681e('0x2d'),_0x681e('0x2e'),_0x681e('0x6a'),util[_0x681e('0x2f')](_0x1f8978,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x681e('0x2d'),_0x681e('0x2e'),_0x681e('0x6a'),_0x681e('0x6b'));}break;case _0x681e('0x6c'):if(_0x9b6983[_0x681e('0x5c')]){var _0x507703={'method':_0x681e('0x39'),'uri':_0x681e('0x6d'),'headers':{'Authorization':_0x9b6983[_0x681e('0x5c')]},'body':{'content':_0x25fd7d[_0x681e('0xd')],'to':[_0x25fd7d[_0x681e('0x25')]],'from':_0x9b6983[_0x681e('0x25')],'binary':![],'clientMessageId':_0x681e('0x6e'),'charset':_0x681e('0x6f')},'json':!![]};rp(_0x507703)[_0x681e('0x18')](function(_0x3a9a77){if(!_0x3a9a77[_0x681e('0x1d')]){var _0x19a677={'messageId':_0x3a9a77[_0x681e('0x26')][0x0]['apiMessageId']};if(!_0x9b6983[_0x681e('0x3d')]){_0x19a677[_0x681e('0x43')]=!![];}return _0x449827['update'](_0x19a677);}else{return logger[_0x681e('0x1d')](_0x681e('0x2d'),_0x681e('0x2e'),_0x681e('0x6c'),util['inspect'](_0x3a9a77['error'],{'showHidden':![],'depth':null}));}})[_0x681e('0x1c')](function(_0x56f459){return logger[_0x681e('0x1d')](_0x681e('0x2d'),_0x681e('0x2e'),_0x681e('0x6c'),util[_0x681e('0x2f')](_0x56f459,{'showHidden':![],'depth':null}));});}else{logger[_0x681e('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x681e('0x2e'),_0x681e('0x6c'),'Missing\x20parameters:\x20apiKey');}break;case _0x681e('0x70'):if(_0x9b6983[_0x681e('0x32')]&&_0x9b6983[_0x681e('0x33')]){var _0x414596=util[_0x681e('0x49')](_0x681e('0x47'),_0x9b6983[_0x681e('0x32')],_0x9b6983[_0x681e('0x33')]);var _0x7f3e55={'method':'POST','uri':_0x681e('0x71')+_0x9b6983[_0x681e('0x72')]+_0x681e('0x73'),'body':{'to':[_0x25fd7d[_0x681e('0x25')]],'text':_0x25fd7d[_0x681e('0xd')],'from':_0x9b6983[_0x681e('0x25')],'applicationId':_0x9b6983['applicationId']},'headers':{'Authorization':util[_0x681e('0x49')](_0x681e('0x4a'),new Buffer(_0x414596)[_0x681e('0x4b')]('base64'))},'json':!![]};rp(_0x7f3e55)[_0x681e('0x18')](function(_0x332647){if(_0x332647['id']){var _0x12be7d={'messageId':_0x332647['id']};return _0x449827[_0x681e('0x19')](_0x12be7d);}else{logger[_0x681e('0x1d')](_0x681e('0x2d'),'afterCreate',_0x681e('0x70'),util[_0x681e('0x2f')](_0x332647,{'showHidden':![],'depth':null}));}})[_0x681e('0x1c')](function(_0x35be86){logger[_0x681e('0x1d')](_0x681e('0x2d'),'afterCreate',_0x681e('0x70'),util['inspect'](_0x35be86,{'showHidden':![],'depth':null}));});}else{logger[_0x681e('0x1d')](_0x681e('0x2d'),_0x681e('0x2e'),_0x681e('0x70'),_0x681e('0x3f'));}break;case'intelepeer':if(_0x9b6983[_0x681e('0x5c')]){var _0xed2b86={};var _0xebf68f={'method':_0x681e('0x39'),'uri':_0x681e('0x74'),'headers':{'Authorization':_0x681e('0x75')+_0x9b6983['apiKey'],'Content-Type':_0x681e('0x59')},'body':{'from':_0x9b6983['phone'],'to':_0x25fd7d[_0x681e('0x25')],'text':_0x25fd7d[_0x681e('0xd')]},'json':!![]};return rp(_0xebf68f)[_0x681e('0x18')](function(_0x308029){if(_0x308029['code']==0xca){_0xed2b86[_0x681e('0x76')]=_0x308029;var _0xc2a978={'method':'POST','uri':_0x681e('0x77'),'headers':{'Authorization':'Bearer\x20'+_0x9b6983[_0x681e('0x5c')],'Content-Type':_0x681e('0x59')},'body':{'refid':_0xed2b86[_0x681e('0x76')]['refid']},'json':!![]};return rp(_0xc2a978)[_0x681e('0x18')](function(_0x460f80){_0xed2b86['status']=_0x460f80;var _0x144a52={'messageId':_0xed2b86[_0x681e('0x76')][_0x681e('0x78')],'read':!![]};return _0x449827[_0x681e('0x19')](_0x144a52);});}else{return logger[_0x681e('0x1d')](_0x681e('0x2d'),'afterCreate',_0x681e('0x79'),util[_0x681e('0x2f')](_0x308029,{'showHidden':![],'depth':null}));}})['catch'](function(_0xc3bdc3){return logger[_0x681e('0x1d')](_0x681e('0x2d'),'afterCreate','intelepeer',util[_0x681e('0x2f')](_0xc3bdc3,{'showHidden':![],'depth':null}));});}else{return logger[_0x681e('0x1d')](_0x681e('0x2d'),'afterCreate',_0x681e('0x79'),_0x681e('0x7a'));}break;}}})[_0x681e('0x7b')](function(){_0x3c8de6();});}else{_0x3c8de6();}}},'charset':_0x681e('0x7c'),'collate':_0x681e('0x7d')});}; \ No newline at end of file +var _0x408c=['apiKey','text','timestamp','sort','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','keys','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','/messages','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','findOne','then','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','twilio','authToken','phone','accountSid','create','remote','/api/sms/messages/','/status?token=','token','sid','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','smsMethod','sender','login?username=','username','&password=','password','GET','split','sms','POST','session_key','total_sent','internal_order_id','read','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','connectel','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','base64','http_code','data','queued_count','head','messages','message_id','deliveryReport','clickSend','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','toString','plivo','infobip','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','csc','crypto'];(function(_0x5a0d97,_0x3bb0f0){var _0x5dde67=function(_0x25ef4e){while(--_0x25ef4e){_0x5a0d97['push'](_0x5a0d97['shift']());}};_0x5dde67(++_0x3bb0f0);}(_0x408c,0x9e));var _0xc408=function(_0x432666,_0x1987fd){_0x432666=_0x432666-0x0;var _0x411329=_0x408c[_0x432666];return _0x411329;};'use strict';var _=require(_0xc408('0x0'));var util=require(_0xc408('0x1'));var logger=require('../../config/logger')(_0xc408('0x2'));var moment=require(_0xc408('0x3'));var BPromise=require(_0xc408('0x4'));var rp=require(_0xc408('0x5'));var fs=require('fs');var path=require(_0xc408('0x6'));var rimraf=require(_0xc408('0x7'));var config=require(_0xc408('0x8'));var attributes=require('./smsMessage.attributes');module[_0xc408('0x9')]=function(_0x1665a8,_0x19907c){return _0x1665a8[_0xc408('0xa')](_0xc408('0xb'),attributes,{'tableName':_0xc408('0xc'),'paranoid':![],'indexes':[{'name':_0xc408('0xd'),'fields':[_0xc408('0xd')]},{'name':_0xc408('0xe'),'fields':[_0xc408('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x915dcc,_0x5b84b3,_0x7b033){var _0x2cc3c9=_0x1665a8[_0xc408('0x10')];var _0x43105d=_0x915dcc[_0xc408('0x11')]({'plain':!![]});if(_0x43105d[_0xc408('0x12')][_0xc408('0x13')]()==='in'||_0x43105d[_0xc408('0x12')]['toLowerCase']()===_0xc408('0x14')&&!_0x43105d[_0xc408('0x15')]&&!_[_0xc408('0x16')](_0x43105d[_0xc408('0x17')])&&!_['isNil'](_0x43105d[_0xc408('0x18')])){_0x2cc3c9['SmsInteraction'][_0xc408('0x19')]({'where':{'id':_0x43105d[_0xc408('0x18')]}})[_0xc408('0x1a')](function(_0x36d27a){if(_0x36d27a){_0x36d27a[_0xc408('0x1b')]({'lastMsgAt':_0x43105d[_0xc408('0x1c')],'lastMsgDirection':_0x43105d[_0xc408('0x12')][_0xc408('0x13')]()});}})[_0xc408('0x1d')](function(_0x7e9a66){console[_0xc408('0x1e')](_0x7e9a66);});}if(_0x43105d[_0xc408('0x12')]===_0xc408('0x14')&&!_0x43105d[_0xc408('0x15')]){var _0x99a289;_0x2cc3c9[_0xc408('0x1f')][_0xc408('0x20')]({'where':{'id':_0x43105d[_0xc408('0x21')]},'raw':!![]})['then'](function(_0x4fd907){_0x99a289=_0x4fd907;if(_0x99a289&&_0x99a289[_0xc408('0x22')]){switch(_0x99a289[_0xc408('0x22')]){case _0xc408('0x23'):var _0x19bdb1=require(_0xc408('0x23'));if(_0x99a289['accountSid']&&_0x99a289[_0xc408('0x24')]&&_0x99a289[_0xc408('0x25')]){var _0x28a6c1=new _0x19bdb1(_0x99a289[_0xc408('0x26')],_0x99a289[_0xc408('0x24')]);_0x28a6c1['messages'][_0xc408('0x27')]({'body':_0x43105d[_0xc408('0xf')],'to':_0x43105d[_0xc408('0x25')],'from':_0x99a289[_0xc408('0x25')],'statusCallback':_0x99a289[_0xc408('0x28')]+_0xc408('0x29')+_0x43105d['id']+_0xc408('0x2a')+_0x99a289[_0xc408('0x2b')]})[_0xc408('0x1a')](function(_0x3f98df){if(_0x3f98df[_0xc408('0x2c')]){return _0x915dcc[_0xc408('0x1b')]({'messageId':_0x3f98df[_0xc408('0x2c')]});}})[_0xc408('0x1d')](function(_0x2789fb){logger[_0xc408('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc408('0x2d'),_0xc408('0x23'),util[_0xc408('0x2e')](_0x2789fb,{'showHidden':![],'depth':null}));});}else{logger[_0xc408('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xc408('0x23'),_0xc408('0x2f'));}break;case _0xc408('0x30'):var _0x105dcc=_0xc408('0x31');if(_0x99a289['username']&&_0x99a289['password']){var _0x416161={'recipient':[_0x43105d[_0xc408('0x25')]],'message':_0x43105d['body'],'message_type':_0x99a289[_0xc408('0x32')]};if(_0x99a289[_0xc408('0x32')]&&_0x99a289[_0xc408('0x32')]!=='SI'){_0x416161[_0xc408('0x33')]=_0x99a289[_0xc408('0x25')];}var _0x1e6839={'url':_0x105dcc+_0xc408('0x34')+_0x99a289[_0xc408('0x35')]+_0xc408('0x36')+_0x99a289[_0xc408('0x37')],'method':_0xc408('0x38')};rp(_0x1e6839)['then'](function(_0x3e22aa){var _0x37dd6d=_0x3e22aa[_0xc408('0x39')](';');var _0x355a9b={'user_key':_0x37dd6d[0x0],'session_key':_0x37dd6d[0x1]};_0x1e6839={'url':_0x105dcc+_0xc408('0x3a'),'method':_0xc408('0x3b'),'headers':{'user_key':_0x355a9b['user_key'],'Session_key':_0x355a9b[_0xc408('0x3c')]},'json':!![],'body':_0x416161};return rp(_0x1e6839);})['then'](function(_0x2ba885){if(_0x2ba885[_0xc408('0x3d')]>=0x1){var _0x327936={'messageId':_0x2ba885[_0xc408('0x3e')]};if(_0x99a289['smsMethod']!=='GP'||!_0x99a289['deliveryReport']){_0x327936[_0xc408('0x3f')]=!![];}return _0x915dcc[_0xc408('0x1b')](_0x327936);}else{return logger[_0xc408('0x1e')](_0xc408('0x40'),_0xc408('0x2d'),_0xc408('0x30'),util[_0xc408('0x2e')](_0x2ba885,{'showHidden':![],'depth':null}));}})[_0xc408('0x1d')](function(_0x590e03){return logger[_0xc408('0x1e')](_0xc408('0x40'),_0xc408('0x2d'),'skebby',util[_0xc408('0x2e')](_0x590e03,{'showHidden':![],'depth':null}));});}else{logger[_0xc408('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc408('0x2d'),_0xc408('0x30'),_0xc408('0x41'));}break;case'connectel':if(_0x99a289['authToken']){var _0x5c9f17={'recipient':_0x43105d[_0xc408('0x25')],'message':_0x43105d[_0xc408('0xf')],'sender':_0x99a289[_0xc408('0x42')]||_0x99a289['phone'],'authorization':_0x99a289['authToken']};var _0x5b84b3={'method':_0xc408('0x3b'),'uri':_0xc408('0x43'),'body':_0x5c9f17,'json':!![]};rp(_0x5b84b3)[_0xc408('0x1a')](function(_0x5f2c9d){var _0x15e887={'messageId':_0x5f2c9d[_0xc408('0x44')]};if(!_0x99a289['deliveryReport']){_0x15e887[_0xc408('0x3f')]=!![];}return _0x915dcc[_0xc408('0x1b')](_0x15e887);})[_0xc408('0x1d')](function(_0x4d9ecd){logger[_0xc408('0x1e')](_0xc408('0x40'),_0xc408('0x2d'),_0xc408('0x45'),util[_0xc408('0x2e')](_0x4d9ecd,{'showHidden':![],'depth':null}));});}else{logger[_0xc408('0x1e')](_0xc408('0x40'),'afterCreate',_0xc408('0x45'),_0xc408('0x46'));}break;case _0xc408('0x47'):if(_0x99a289['username']&&_0x99a289[_0xc408('0x37')]){var _0x5c9f17={'messages':[{'source':_0xc408('0x48'),'to':_0x43105d[_0xc408('0x25')],'body':_0x43105d['body'],'from':_0x99a289['senderString']||_0x99a289[_0xc408('0x25')]}]};var _0xb3637a=util[_0xc408('0x49')](_0xc408('0x4a'),_0x99a289['username'],_0x99a289['password']);var _0x5b84b3={'method':_0xc408('0x3b'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x5c9f17,'headers':{'Authorization':util[_0xc408('0x49')]('Basic\x20%s',new Buffer(_0xb3637a)['toString'](_0xc408('0x4b')))},'json':!![]};rp(_0x5b84b3)[_0xc408('0x1a')](function(_0x5b8f64){if(_0x5b8f64[_0xc408('0x4c')]>=0xc8&&_0x5b8f64[_0xc408('0x4c')]<=0xce){if(_0x5b8f64[_0xc408('0x4d')]&&_0x5b8f64['data'][_0xc408('0x4e')]>0x0){var _0x16b692=_[_0xc408('0x4f')](_0x5b8f64[_0xc408('0x4d')][_0xc408('0x50')]);var _0x31df7d={'messageId':_0x16b692[_0xc408('0x51')]};if(!_0x99a289[_0xc408('0x52')]){_0x31df7d['read']=!![];}return _0x915dcc[_0xc408('0x1b')](_0x31df7d);}else{logger[_0xc408('0x1e')](_0xc408('0x40'),'afterCreate',_0xc408('0x53'),util[_0xc408('0x2e')](_0x5b8f64,{'showHidden':![],'depth':null}));}}else{logger[_0xc408('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc408('0x2d'),_0xc408('0x53'),util[_0xc408('0x2e')](_0x5b8f64,{'showHidden':![],'depth':null}));}})[_0xc408('0x1d')](function(_0x300f6c){logger[_0xc408('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xc408('0x53'),util[_0xc408('0x2e')](_0x300f6c,{'showHidden':![],'depth':null}));});}else{logger[_0xc408('0x1e')](_0xc408('0x40'),_0xc408('0x2d'),'clickSend','Missing\x20parameters:\x20username,\x20password');}break;case'plivo':if(_0x99a289[_0xc408('0x54')]&&_0x99a289[_0xc408('0x24')]){var _0x5c9f17={'dst':_0x43105d[_0xc408('0x25')],'text':_0x43105d[_0xc408('0xf')],'src':_0x99a289[_0xc408('0x42')]||_0x99a289['phone'],'url':_0x99a289[_0xc408('0x28')]+_0xc408('0x29')+_0x43105d['id']+_0xc408('0x2a')+_0x99a289[_0xc408('0x2b')]};var _0xb3637a=util[_0xc408('0x49')](_0xc408('0x4a'),_0x99a289[_0xc408('0x54')],_0x99a289[_0xc408('0x24')]);var _0x5b84b3={'method':_0xc408('0x3b'),'uri':util[_0xc408('0x49')](_0xc408('0x55'),_0x99a289[_0xc408('0x54')]),'body':_0x5c9f17,'headers':{'Authorization':util[_0xc408('0x49')](_0xc408('0x56'),new Buffer(_0xb3637a)[_0xc408('0x57')](_0xc408('0x4b')))},'json':!![]};rp(_0x5b84b3)[_0xc408('0x1a')](function(_0x4041bb){var _0x469019={'messageId':_0x4041bb['message_uuid'][0x0]};return _0x915dcc['update'](_0x469019);})[_0xc408('0x1d')](function(_0x5165c0){logger[_0xc408('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc408('0x2d'),_0xc408('0x58'),util[_0xc408('0x2e')](_0x5165c0,{'showHidden':![],'depth':null}));});}else{logger[_0xc408('0x1e')](_0xc408('0x40'),_0xc408('0x2d'),_0xc408('0x58'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xc408('0x59'):if(_0x99a289[_0xc408('0x35')]&&_0x99a289[_0xc408('0x37')]){if(_0x99a289['baseUrl']){var _0x45f722={'method':_0xc408('0x3b'),'uri':_0x99a289['baseUrl']+'/auth/1/session','body':{'username':_0x99a289['username'],'password':_0x99a289[_0xc408('0x37')]},'json':!![]};return rp(_0x45f722)[_0xc408('0x1a')](function(_0x294ce0){var _0x3b5a33={'method':_0xc408('0x3b'),'uri':_0x99a289[_0xc408('0x5a')]+_0xc408('0x5b'),'body':{'messages':[{'from':_0x99a289[_0xc408('0x25')],'destinations':[{'to':_0x43105d[_0xc408('0x25')]}],'text':_0x43105d[_0xc408('0xf')],'notifyUrl':_0x99a289['remote']+'/api/sms/messages/'+_0x43105d['id']+_0xc408('0x2a')+_0x99a289[_0xc408('0x2b')],'notifyContentType':_0xc408('0x5c'),'callbackData':_0x99a289[_0xc408('0x25')]+';'+_0x43105d[_0xc408('0xf')]}]},'headers':{'Authorization':_0xc408('0x5d')+_0x294ce0[_0xc408('0x2b')]},'json':!![]};return rp(_0x3b5a33)['then'](function(_0x1fb51d){if(_0x1fb51d[_0xc408('0x50')]){var _0x24f492={'messageId':_0x1fb51d['messages'][0x0][_0xc408('0xd')]};if(!_0x99a289[_0xc408('0x52')]){_0x24f492[_0xc408('0x3f')]=!![];}return _0x915dcc[_0xc408('0x1b')](_0x24f492);}else{return logger[_0xc408('0x1e')](_0xc408('0x40'),_0xc408('0x2d'),'infobip',util['inspect'](_0x1fb51d,{'showHidden':![],'depth':null}));}});})[_0xc408('0x1d')](function(_0x247831){return logger[_0xc408('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc408('0x2d'),_0xc408('0x59'),util[_0xc408('0x2e')](_0x247831,{'showHidden':![],'depth':null}));});}else{logger[_0xc408('0x1e')](_0xc408('0x40'),_0xc408('0x2d'),_0xc408('0x59'),'Missing\x20parameters:\x20base_url');}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc408('0x2d'),_0xc408('0x59'),_0xc408('0x41'));}break;case _0xc408('0x5e'):var _0x456caa=require(_0xc408('0x5f'));if(_0x99a289[_0xc408('0x60')]){var _0x698ab={};_0x698ab['login']=_0x99a289['username'];_0x698ab[_0xc408('0x25')]=_0x43105d[_0xc408('0x25')];_0x698ab[_0xc408('0x33')]=_0x99a289[_0xc408('0x25')];_0x698ab[_0xc408('0x61')]=_0x43105d[_0xc408('0xf')];_0x698ab[_0xc408('0x62')]=+new Date();var _0x7e41be='';var _0x3e3f7a='';var _0xfb9b25=Object['keys'](_0x698ab);_0xfb9b25[_0xc408('0x63')]();for(var _0x2574e0=0x0;_0x2574e0<_0xfb9b25[_0xc408('0x64')];_0x2574e0++){if(_0x7e41be!=''){_0x7e41be+='&';}_0x7e41be+=_0xfb9b25[_0x2574e0]+'='+encodeURIComponent(_0x698ab[_0xfb9b25[_0x2574e0]]);_0x3e3f7a+=_0x698ab[_0xfb9b25[_0x2574e0]];}_0x3e3f7a+=_0x99a289[_0xc408('0x60')];_0x3e3f7a=_0x456caa[_0xc408('0x65')](_0xc408('0x66'))[_0xc408('0x1b')](_0x3e3f7a)[_0xc408('0x67')](_0xc408('0x68'));if(_0x7e41be!==''){_0x7e41be+='&';}_0x7e41be+=_0xc408('0x69')+_0x3e3f7a;var _0x1e6839={'method':_0xc408('0x38'),'uri':_0x99a289[_0xc408('0x5a')]+_0xc408('0x6a')+_0x7e41be,'json':!![]};return rp(_0x1e6839)[_0xc408('0x1a')](function(_0x4709ce){var _0x14a4d9=Object[_0xc408('0x6b')](_0x4709ce);if(_0x4709ce[_0x14a4d9[0x0]][_0xc408('0x1e')]&&parseInt(_0x4709ce[_0x14a4d9[0x0]][_0xc408('0x1e')])===0x0){var _0x1ee1e7={'messageId':_0x4709ce[_0x14a4d9[0x0]][_0xc408('0x6c')]};if(!_0x99a289[_0xc408('0x52')]){_0x1ee1e7['read']=!![];}return _0x915dcc[_0xc408('0x1b')](_0x1ee1e7);}else{return logger[_0xc408('0x1e')](_0xc408('0x40'),_0xc408('0x2d'),_0xc408('0x5e'),util[_0xc408('0x2e')](_0x4709ce['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x568065){return logger[_0xc408('0x1e')](_0xc408('0x40'),'afterCreate',_0xc408('0x5e'),util[_0xc408('0x2e')](_0x568065,{'showHidden':![],'depth':null}));});}else{logger[_0xc408('0x1e')](_0xc408('0x40'),'afterCreate','csc',_0xc408('0x6d'));}break;case _0xc408('0x6e'):if(_0x99a289[_0xc408('0x60')]){var _0x2ce03e={'method':_0xc408('0x3b'),'uri':_0xc408('0x6f'),'headers':{'Authorization':_0x99a289[_0xc408('0x60')]},'body':{'content':_0x43105d['body'],'to':[_0x43105d[_0xc408('0x25')]],'from':_0x99a289[_0xc408('0x25')],'binary':![],'clientMessageId':_0xc408('0x70'),'charset':'UTF-8'},'json':!![]};rp(_0x2ce03e)[_0xc408('0x1a')](function(_0x26ebd3){if(!_0x26ebd3[_0xc408('0x1e')]){var _0x33c3cd={'messageId':_0x26ebd3[_0xc408('0x50')][0x0][_0xc408('0x71')]};if(!_0x99a289[_0xc408('0x52')]){_0x33c3cd['read']=!![];}return _0x915dcc[_0xc408('0x1b')](_0x33c3cd);}else{return logger[_0xc408('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc408('0x2d'),_0xc408('0x6e'),util[_0xc408('0x2e')](_0x26ebd3['error'],{'showHidden':![],'depth':null}));}})[_0xc408('0x1d')](function(_0xd420b9){return logger[_0xc408('0x1e')](_0xc408('0x40'),'afterCreate',_0xc408('0x6e'),util[_0xc408('0x2e')](_0xd420b9,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xc408('0x40'),_0xc408('0x2d'),'clickatell','Missing\x20parameters:\x20apiKey');}break;case _0xc408('0x72'):if(_0x99a289[_0xc408('0x35')]&&_0x99a289[_0xc408('0x37')]){var _0xb3637a=util[_0xc408('0x49')](_0xc408('0x4a'),_0x99a289[_0xc408('0x35')],_0x99a289[_0xc408('0x37')]);var _0x5b84b3={'method':_0xc408('0x3b'),'uri':_0xc408('0x73')+_0x99a289['accountId']+_0xc408('0x74'),'body':{'to':[_0x43105d[_0xc408('0x25')]],'text':_0x43105d['body'],'from':_0x99a289[_0xc408('0x25')],'applicationId':_0x99a289['applicationId']},'headers':{'Authorization':util[_0xc408('0x49')]('Basic\x20%s',new Buffer(_0xb3637a)[_0xc408('0x57')]('base64'))},'json':!![]};rp(_0x5b84b3)[_0xc408('0x1a')](function(_0x2bd989){if(_0x2bd989['id']){var _0x33558b={'messageId':_0x2bd989['id']};return _0x915dcc[_0xc408('0x1b')](_0x33558b);}else{logger[_0xc408('0x1e')](_0xc408('0x40'),'afterCreate',_0xc408('0x72'),util[_0xc408('0x2e')](_0x2bd989,{'showHidden':![],'depth':null}));}})['catch'](function(_0x14c3fc){logger[_0xc408('0x1e')](_0xc408('0x40'),_0xc408('0x2d'),_0xc408('0x72'),util[_0xc408('0x2e')](_0x14c3fc,{'showHidden':![],'depth':null}));});}else{logger[_0xc408('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc408('0x2d'),_0xc408('0x72'),_0xc408('0x41'));}break;case'intelepeer':if(_0x99a289['apiKey']){var _0x1a3b35={};var _0x1e6839={'method':'POST','uri':_0xc408('0x75'),'headers':{'Authorization':_0xc408('0x76')+_0x99a289[_0xc408('0x60')],'Content-Type':_0xc408('0x5c')},'body':{'from':_0x99a289[_0xc408('0x25')],'to':_0x43105d['phone'],'text':_0x43105d[_0xc408('0xf')]},'json':!![]};return rp(_0x1e6839)[_0xc408('0x1a')](function(_0x865805){if(_0x865805[_0xc408('0x77')]==0xca){_0x1a3b35[_0xc408('0x78')]=_0x865805;var _0x3b4356={'method':_0xc408('0x3b'),'uri':_0xc408('0x79'),'headers':{'Authorization':_0xc408('0x76')+_0x99a289[_0xc408('0x60')],'Content-Type':_0xc408('0x5c')},'body':{'refid':_0x1a3b35[_0xc408('0x78')][_0xc408('0x7a')]},'json':!![]};return rp(_0x3b4356)['then'](function(_0x49d5b0){_0x1a3b35[_0xc408('0x7b')]=_0x49d5b0;var _0x14d6ef={'messageId':_0x1a3b35[_0xc408('0x78')][_0xc408('0x7a')],'read':!![]};return _0x915dcc[_0xc408('0x1b')](_0x14d6ef);});}else{return logger[_0xc408('0x1e')](_0xc408('0x40'),_0xc408('0x2d'),'intelepeer',util[_0xc408('0x2e')](_0x865805,{'showHidden':![],'depth':null}));}})[_0xc408('0x1d')](function(_0x54fb16){return logger[_0xc408('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','intelepeer',util['inspect'](_0x54fb16,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xc408('0x40'),_0xc408('0x2d'),'intelepeer',_0xc408('0x7c'));}break;}}})[_0xc408('0x7d')](function(){_0x7b033();});}else{_0x7b033();}}},'charset':_0xc408('0x7e'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index fa0d460..771772e 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 _0xcdb9=['request','info','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','SmsMessage,\x20%s,\x20%s','catch','CreateSmsMessage','create','body','options','raw','then','debug','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','register'];(function(_0x47ab22,_0x24914e){var _0x36cca5=function(_0x3e030a){while(--_0x3e030a){_0x47ab22['push'](_0x47ab22['shift']());}};_0x36cca5(++_0x24914e);}(_0xcdb9,0xfe));var _0x9cdb=function(_0x217308,_0x109b64){_0x217308=_0x217308-0x0;var _0x2e73a3=_0xcdb9[_0x217308];return _0x2e73a3;};'use strict';var _=require(_0x9cdb('0x0'));var util=require('util');var moment=require(_0x9cdb('0x1'));var BPromise=require('bluebird');var rs=require(_0x9cdb('0x2'));var fs=require('fs');var Redis=require(_0x9cdb('0x3'));var db=require(_0x9cdb('0x4'))['db'];var utils=require(_0x9cdb('0x5'));var logger=require(_0x9cdb('0x6'))(_0x9cdb('0x7'));var config=require(_0x9cdb('0x8'));var jayson=require(_0x9cdb('0x9'));var client=jayson[_0x9cdb('0xa')][_0x9cdb('0xb')]({'port':0x232a});config['redis']=_[_0x9cdb('0xc')](config[_0x9cdb('0xd')],{'host':_0x9cdb('0xe'),'port':0x18eb});var socket=require(_0x9cdb('0xf'))(new Redis(config[_0x9cdb('0xd')]));require(_0x9cdb('0x10'))[_0x9cdb('0x11')](socket);function respondWithRpcPromise(_0x432bfa,_0x340308,_0x53c355){return new BPromise(function(_0x4f70dc,_0x328114){return client[_0x9cdb('0x12')](_0x432bfa,_0x53c355)['then'](function(_0x403273){logger[_0x9cdb('0x13')]('SmsMessage,\x20%s,\x20%s',_0x340308,'request\x20sent');logger['debug'](_0x9cdb('0x14'),_0x340308,_0x9cdb('0x15'),JSON['stringify'](_0x403273));if(_0x403273['error']){if(_0x403273[_0x9cdb('0x16')]['code']===0x1f4){logger[_0x9cdb('0x16')]('SmsMessage,\x20%s,\x20%s',_0x340308,_0x403273['error'][_0x9cdb('0x17')]);return _0x328114(_0x403273[_0x9cdb('0x16')][_0x9cdb('0x17')]);}logger['error'](_0x9cdb('0x18'),_0x340308,_0x403273[_0x9cdb('0x16')][_0x9cdb('0x17')]);return _0x4f70dc(_0x403273[_0x9cdb('0x16')][_0x9cdb('0x17')]);}else{logger[_0x9cdb('0x13')](_0x9cdb('0x18'),_0x340308,_0x9cdb('0x15'));_0x4f70dc(_0x403273['result'][_0x9cdb('0x17')]);}})[_0x9cdb('0x19')](function(_0x3fb09d){logger[_0x9cdb('0x16')]('SmsMessage,\x20%s,\x20%s',_0x340308,_0x3fb09d);_0x328114(_0x3fb09d);});});}exports[_0x9cdb('0x1a')]=function(_0x4eb90a){var _0x5b4d0c=this;return new Promise(function(_0x5ce2fe,_0x3d6ec6){return db['SmsMessage'][_0x9cdb('0x1b')](_0x4eb90a[_0x9cdb('0x1c')],{'raw':_0x4eb90a[_0x9cdb('0x1d')]?_0x4eb90a[_0x9cdb('0x1d')][_0x9cdb('0x1e')]===undefined?!![]:![]:!![]})[_0x9cdb('0x1f')](function(_0x2f2cde){logger['info']('CreateSmsMessage',_0x4eb90a);logger[_0x9cdb('0x20')](_0x9cdb('0x1a'),_0x4eb90a,JSON[_0x9cdb('0x21')](_0x2f2cde));_0x5ce2fe(_0x2f2cde);})[_0x9cdb('0x19')](function(_0x55fe98){logger[_0x9cdb('0x16')](_0x9cdb('0x1a'),_0x55fe98[_0x9cdb('0x17')],_0x4eb90a);_0x3d6ec6(_0x5b4d0c[_0x9cdb('0x16')](0x1f4,_0x55fe98[_0x9cdb('0x17')]));});});}; \ No newline at end of file +var _0x175a=['SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsMessage','options','raw','CreateSmsMessage','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x175a,0x175));var _0xa175=function(_0x539fa5,_0x38f9db){_0x539fa5=_0x539fa5-0x0;var _0x30f3f2=_0x175a[_0x539fa5];return _0x30f3f2;};'use strict';var _=require(_0xa175('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa175('0x1'));var rs=require(_0xa175('0x2'));var fs=require('fs');var Redis=require(_0xa175('0x3'));var db=require(_0xa175('0x4'))['db'];var utils=require(_0xa175('0x5'));var logger=require(_0xa175('0x6'))(_0xa175('0x7'));var config=require(_0xa175('0x8'));var jayson=require(_0xa175('0x9'));var client=jayson[_0xa175('0xa')][_0xa175('0xb')]({'port':0x232a});config['redis']=_[_0xa175('0xc')](config[_0xa175('0xd')],{'host':_0xa175('0xe'),'port':0x18eb});var socket=require(_0xa175('0xf'))(new Redis(config[_0xa175('0xd')]));require('./smsMessage.socket')[_0xa175('0x10')](socket);function respondWithRpcPromise(_0x21507c,_0x24ca44,_0x55bb0c){return new BPromise(function(_0x251f22,_0x52f1e0){return client[_0xa175('0x11')](_0x21507c,_0x55bb0c)[_0xa175('0x12')](function(_0x94052f){logger[_0xa175('0x13')](_0xa175('0x14'),_0x24ca44,_0xa175('0x15'));logger[_0xa175('0x16')](_0xa175('0x17'),_0x24ca44,_0xa175('0x15'),JSON[_0xa175('0x18')](_0x94052f));if(_0x94052f[_0xa175('0x19')]){if(_0x94052f[_0xa175('0x19')][_0xa175('0x1a')]===0x1f4){logger[_0xa175('0x19')](_0xa175('0x14'),_0x24ca44,_0x94052f[_0xa175('0x19')]['message']);return _0x52f1e0(_0x94052f[_0xa175('0x19')][_0xa175('0x1b')]);}logger[_0xa175('0x19')]('SmsMessage,\x20%s,\x20%s',_0x24ca44,_0x94052f[_0xa175('0x19')][_0xa175('0x1b')]);return _0x251f22(_0x94052f[_0xa175('0x19')]['message']);}else{logger[_0xa175('0x13')]('SmsMessage,\x20%s,\x20%s',_0x24ca44,'request\x20sent');_0x251f22(_0x94052f['result']['message']);}})['catch'](function(_0x42ad3a){logger[_0xa175('0x19')](_0xa175('0x14'),_0x24ca44,_0x42ad3a);_0x52f1e0(_0x42ad3a);});});}exports['CreateSmsMessage']=function(_0x442fdc){var _0x5b1816=this;return new Promise(function(_0x424e50,_0x2b7b1d){return db[_0xa175('0x1c')]['create'](_0x442fdc['body'],{'raw':_0x442fdc[_0xa175('0x1d')]?_0x442fdc['options'][_0xa175('0x1e')]===undefined?!![]:![]:!![]})[_0xa175('0x12')](function(_0x5017de){logger[_0xa175('0x13')](_0xa175('0x1f'),_0x442fdc);logger['debug'](_0xa175('0x1f'),_0x442fdc,JSON[_0xa175('0x18')](_0x5017de));_0x424e50(_0x5017de);})[_0xa175('0x20')](function(_0x3037b6){logger[_0xa175('0x19')](_0xa175('0x1f'),_0x3037b6[_0xa175('0x1b')],_0x442fdc);_0x2b7b1d(_0x5b1816['error'](0x1f4,_0x3037b6[_0xa175('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index a20d4a6..c4af991 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 _0xe336=['length','smsMessage:','save','remove','register'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xe336,0x98));var _0x6e33=function(_0x552646,_0x43625b){_0x552646=_0x552646-0x0;var _0x50addf=_0xe336[_0x552646];return _0x50addf;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x6e33('0x0'),_0x6e33('0x1'),'update'];function createListener(_0x53e36b,_0x4c9816){return function(_0x2ac3e7){_0x4c9816['emit'](_0x53e36b,_0x2ac3e7);};}function removeListener(_0x2ae8f2,_0x1bf1a2){return function(){SmsMessageEvents['removeListener'](_0x2ae8f2,_0x1bf1a2);};}exports[_0x6e33('0x2')]=function(_0x48fd35){for(var _0x3ca040=0x0,_0x64201f=events[_0x6e33('0x3')];_0x3ca040<_0x64201f;_0x3ca040++){var _0x18e3ef=events[_0x3ca040];var _0x25abe6=createListener(_0x6e33('0x4')+_0x18e3ef,_0x48fd35);SmsMessageEvents['on'](_0x18e3ef,_0x25abe6);}}; \ No newline at end of file +var _0x654f=['length','smsMessage:','./smsMessage.events','remove','update','emit','register'];(function(_0x339bfc,_0x4a59fa){var _0x474d9d=function(_0x2ce6e1){while(--_0x2ce6e1){_0x339bfc['push'](_0x339bfc['shift']());}};_0x474d9d(++_0x4a59fa);}(_0x654f,0x160));var _0xf654=function(_0x5c5781,_0x3235cd){_0x5c5781=_0x5c5781-0x0;var _0x4fd48c=_0x654f[_0x5c5781];return _0x4fd48c;};'use strict';var SmsMessageEvents=require(_0xf654('0x0'));var events=['save',_0xf654('0x1'),_0xf654('0x2')];function createListener(_0x29dd8e,_0xa5037f){return function(_0x5b3357){_0xa5037f[_0xf654('0x3')](_0x29dd8e,_0x5b3357);};}function removeListener(_0x3058e4,_0x2f83f8){return function(){SmsMessageEvents['removeListener'](_0x3058e4,_0x2f83f8);};}exports[_0xf654('0x4')]=function(_0x10dbc3){for(var _0x4a7a95=0x0,_0x1a8a4a=events[_0xf654('0x5')];_0x4a7a95<_0x1a8a4a;_0x4a7a95++){var _0x3e917b=events[_0x4a7a95];var _0x358477=createListener(_0xf654('0x6')+_0x3e917b,_0x10dbc3);SmsMessageEvents['on'](_0x3e917b,_0x358477);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index c5770ef..37edcb0 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 _0x2442=['index','/describe','describe','/:id','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x2442,0x140));var _0x2244=function(_0x2729cd,_0x462966){_0x2729cd=_0x2729cd-0x0;var _0x1c259=_0x2442[_0x2729cd];return _0x1c259;};'use strict';var multer=require(_0x2244('0x0'));var util=require(_0x2244('0x1'));var path=require('path');var timeout=require(_0x2244('0x2'));var express=require(_0x2244('0x3'));var router=express['Router']();var fs_extra=require(_0x2244('0x4'));var auth=require(_0x2244('0x5'));var interaction=require(_0x2244('0x6'));var config=require(_0x2244('0x7'));var controller=require(_0x2244('0x8'));router[_0x2244('0x9')]('/',auth['isAuthenticated'](),controller[_0x2244('0xa')]);router['get'](_0x2244('0xb'),auth['isAuthenticated'](),controller[_0x2244('0xc')]);router['get'](_0x2244('0xd'),auth[_0x2244('0xe')](),controller[_0x2244('0xf')]);router['get'](_0x2244('0x10'),auth[_0x2244('0xe')](),controller[_0x2244('0x11')]);router[_0x2244('0x9')](_0x2244('0x12'),auth[_0x2244('0xe')](),controller[_0x2244('0x13')]);router[_0x2244('0x9')](_0x2244('0x14'),auth['isAuthenticated'](),controller['getAgents']);router[_0x2244('0x15')]('/',auth[_0x2244('0xe')](),controller[_0x2244('0x16')]);router['post']('/:id/teams',auth[_0x2244('0xe')](),controller['addTeams']);router[_0x2244('0x15')](_0x2244('0x14'),auth[_0x2244('0xe')](),controller[_0x2244('0x17')]);router[_0x2244('0x18')]('/:id',auth[_0x2244('0xe')](),controller[_0x2244('0x19')]);router[_0x2244('0x1a')](_0x2244('0xd'),auth[_0x2244('0xe')](),controller['destroy']);router[_0x2244('0x1a')]('/:id/teams',auth[_0x2244('0xe')](),controller[_0x2244('0x1b')]);router['delete']('/:id/users',auth[_0x2244('0xe')](),controller[_0x2244('0x1c')]);module[_0x2244('0x1d')]=router; \ No newline at end of file +var _0x3847=['exports','util','express','Router','../../components/auth/service','../../components/interaction/service','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','put','delete','destroy','removeTeams','removeAgents'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3847,0x11f));var _0x7384=function(_0x46f948,_0x24f78a){_0x46f948=_0x46f948-0x0;var _0x53c469=_0x3847[_0x46f948];return _0x53c469;};'use strict';var multer=require('multer');var util=require(_0x7384('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7384('0x1'));var router=express[_0x7384('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x7384('0x3'));var interaction=require(_0x7384('0x4'));var config=require('../../config/environment');var controller=require(_0x7384('0x5'));router[_0x7384('0x6')]('/',auth[_0x7384('0x7')](),controller[_0x7384('0x8')]);router[_0x7384('0x6')](_0x7384('0x9'),auth[_0x7384('0x7')](),controller[_0x7384('0xa')]);router[_0x7384('0x6')](_0x7384('0xb'),auth[_0x7384('0x7')](),controller[_0x7384('0xc')]);router[_0x7384('0x6')](_0x7384('0xd'),auth[_0x7384('0x7')](),controller['getMembers']);router[_0x7384('0x6')](_0x7384('0xe'),auth[_0x7384('0x7')](),controller[_0x7384('0xf')]);router['get'](_0x7384('0x10'),auth[_0x7384('0x7')](),controller[_0x7384('0x11')]);router[_0x7384('0x12')]('/',auth[_0x7384('0x7')](),controller[_0x7384('0x13')]);router[_0x7384('0x12')](_0x7384('0xe'),auth[_0x7384('0x7')](),controller['addTeams']);router[_0x7384('0x12')](_0x7384('0x10'),auth[_0x7384('0x7')](),controller['addAgents']);router[_0x7384('0x14')]('/:id',auth[_0x7384('0x7')](),controller['update']);router[_0x7384('0x15')]('/:id',auth[_0x7384('0x7')](),controller[_0x7384('0x16')]);router['delete'](_0x7384('0xe'),auth[_0x7384('0x7')](),controller[_0x7384('0x17')]);router['delete'](_0x7384('0x10'),auth['isAuthenticated'](),controller[_0x7384('0x18')]);module[_0x7384('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 64c325a..db70c41 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 _0x5d6e=['name','INTEGER','ENUM','rrmemory','beepall','sequelize','exports','STRING'];(function(_0x13d905,_0x4093f6){var _0x308b2f=function(_0x2baa70){while(--_0x2baa70){_0x13d905['push'](_0x13d905['shift']());}};_0x308b2f(++_0x4093f6);}(_0x5d6e,0x125));var _0xe5d6=function(_0x162b73,_0x128905){_0x162b73=_0x162b73-0x0;var _0x22e1b6=_0x5d6e[_0x162b73];return _0x22e1b6;};'use strict';var Sequelize=require(_0xe5d6('0x0'));module[_0xe5d6('0x1')]={'name':{'type':Sequelize[_0xe5d6('0x2')],'unique':_0xe5d6('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe5d6('0x2')]},'timeout':{'type':Sequelize[_0xe5d6('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe5d6('0x5')](_0xe5d6('0x6'),_0xe5d6('0x7'),'roundrobin')}}; \ No newline at end of file +var _0x1e56=['STRING','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x310d10,_0x3fe887){var _0x1fb8af=function(_0x42965b){while(--_0x42965b){_0x310d10['push'](_0x310d10['shift']());}};_0x1fb8af(++_0x3fe887);}(_0x1e56,0xc2));var _0x61e5=function(_0x5238b2,_0x300f85){_0x5238b2=_0x5238b2-0x0;var _0x4dc6a6=_0x1e56[_0x5238b2];return _0x4dc6a6;};'use strict';var Sequelize=require(_0x61e5('0x0'));module[_0x61e5('0x1')]={'name':{'type':Sequelize[_0x61e5('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x61e5('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x61e5('0x3')](_0x61e5('0x4'),_0x61e5('0x5'),_0x61e5('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index d181085..70fe10a 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 _0xf9b7=['spread','userSmsQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsQueue.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','SmsQueues','UserProfileResource','stack','name','send','index','map','SmsQueue','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','catch','rawAttributes','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','UserSmsQueue','SmsQueueId','User','findAndCountAll','UserId','smsPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','emit','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','SELECT','includes','all','union','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit'];(function(_0x33fbfc,_0x223146){var _0x10b03c=function(_0x5593d4){while(--_0x5593d4){_0x33fbfc['push'](_0x33fbfc['shift']());}};_0x10b03c(++_0x223146);}(_0xf9b7,0x91));var _0x7f9b=function(_0x2b0749,_0xdf8d63){_0x2b0749=_0x2b0749-0x0;var _0x5a665f=_0xf9b7[_0x2b0749];return _0x5a665f;};'use strict';var emlformat=require(_0x7f9b('0x0'));var rimraf=require(_0x7f9b('0x1'));var zipdir=require(_0x7f9b('0x2'));var jsonpatch=require(_0x7f9b('0x3'));var rp=require(_0x7f9b('0x4'));var moment=require(_0x7f9b('0x5'));var BPromise=require(_0x7f9b('0x6'));var Mustache=require(_0x7f9b('0x7'));var util=require('util');var path=require('path');var sox=require(_0x7f9b('0x8'));var csv=require('to-csv');var ejs=require(_0x7f9b('0x9'));var fs=require('fs');var fs_extra=require(_0x7f9b('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7f9b('0xb'));var jsforce=require(_0x7f9b('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7f9b('0xd'));var Redis=require(_0x7f9b('0xe'));var authService=require(_0x7f9b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7f9b('0x10'));var hardwareService=require(_0x7f9b('0x11'));var logger=require('../../config/logger')(_0x7f9b('0x12'));var utils=require('../../config/utils');var config=require(_0x7f9b('0x13'));var licenseUtil=require(_0x7f9b('0x14'));var db=require(_0x7f9b('0x15'))['db'];config[_0x7f9b('0x16')]=_[_0x7f9b('0x17')](config['redis'],{'host':_0x7f9b('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7f9b('0x16')]));require(_0x7f9b('0x19'))[_0x7f9b('0x1a')](socket);function respondWithStatusCode(_0x1f756c,_0x1f5e43){_0x1f5e43=_0x1f5e43||0xcc;return function(_0x2d1f0c){if(_0x2d1f0c){return _0x1f756c[_0x7f9b('0x1b')](_0x1f5e43);}return _0x1f756c[_0x7f9b('0x1c')](_0x1f5e43)[_0x7f9b('0x1d')]();};}function respondWithResult(_0x39ecbd,_0x1e11fa){_0x1e11fa=_0x1e11fa||0xc8;return function(_0x3e1ce9){if(_0x3e1ce9){return _0x39ecbd[_0x7f9b('0x1c')](_0x1e11fa)[_0x7f9b('0x1e')](_0x3e1ce9);}};}function respondWithFilteredResult(_0x51debb,_0x140853){return function(_0x575643){if(_0x575643){var _0x3bd967=typeof _0x140853['offset']===_0x7f9b('0x1f')&&typeof _0x140853['limit']==='undefined';var _0x5cec50=_0x575643[_0x7f9b('0x20')];var _0x5f3d29=_0x3bd967?0x0:_0x140853[_0x7f9b('0x21')];var _0x5d1291=_0x3bd967?_0x575643['count']:_0x140853[_0x7f9b('0x21')]+_0x140853[_0x7f9b('0x22')];var _0x318203;if(_0x5d1291>=_0x5cec50){_0x5d1291=_0x5cec50;_0x318203=0xc8;}else{_0x318203=0xce;}_0x51debb['status'](_0x318203);return _0x51debb[_0x7f9b('0x23')](_0x7f9b('0x24'),_0x5f3d29+'-'+_0x5d1291+'/'+_0x5cec50)[_0x7f9b('0x1e')](_0x575643);}return null;};}function patchUpdates(_0x4e3f37){return function(_0x2aa960){try{jsonpatch[_0x7f9b('0x25')](_0x2aa960,_0x4e3f37,!![]);}catch(_0x25b6ac){return BPromise[_0x7f9b('0x26')](_0x25b6ac);}return _0x2aa960[_0x7f9b('0x27')]();};}function saveUpdates(_0x527f30,_0x5534e8){return function(_0x1036a6){if(_0x1036a6){return _0x1036a6[_0x7f9b('0x28')](_0x527f30)['then'](function(_0x62295d){return _0x62295d;});}return null;};}function removeEntity(_0x17b31d,_0x22c380){return function(_0x2de741){if(_0x2de741){return _0x2de741[_0x7f9b('0x29')]()[_0x7f9b('0x2a')](function(){var _0x1155f6=_0x2de741['get']({'plain':!![]});var _0x39eba2=_0x7f9b('0x2b');return db[_0x7f9b('0x2c')][_0x7f9b('0x29')]({'where':{'type':_0x39eba2,'resourceId':_0x1155f6['id']}})[_0x7f9b('0x2a')](function(){return _0x2de741;});})[_0x7f9b('0x2a')](function(){_0x17b31d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x49a678,_0xe72154){return function(_0x122caf){if(!_0x122caf){_0x49a678['sendStatus'](0x194);}return _0x122caf;};}function handleError(_0xf44200,_0x5d5e47){_0x5d5e47=_0x5d5e47||0x1f4;return function(_0x4b76d6){logger['error'](_0x4b76d6[_0x7f9b('0x2d')]);if(_0x4b76d6[_0x7f9b('0x2e')]){delete _0x4b76d6[_0x7f9b('0x2e')];}_0xf44200[_0x7f9b('0x1c')](_0x5d5e47)[_0x7f9b('0x2f')](_0x4b76d6);};}exports[_0x7f9b('0x30')]=function(_0x49703f,_0x37d1a6){var _0x5300f0={},_0x1bca25={},_0x443c67={'count':0x0,'rows':[]};var _0x3693ed=_[_0x7f9b('0x31')](db[_0x7f9b('0x32')]['rawAttributes'],function(_0x5c17bd){return{'name':_0x5c17bd['fieldName'],'type':_0x5c17bd['type'][_0x7f9b('0x33')]};});_0x1bca25[_0x7f9b('0x34')]=_['map'](_0x3693ed,_0x7f9b('0x2e'));_0x1bca25[_0x7f9b('0x35')]=_[_0x7f9b('0x36')](_0x49703f[_0x7f9b('0x35')]);_0x1bca25[_0x7f9b('0x37')]=_[_0x7f9b('0x38')](_0x1bca25[_0x7f9b('0x34')],_0x1bca25['query']);_0x5300f0['attributes']=_['intersection'](_0x1bca25[_0x7f9b('0x34')],qs[_0x7f9b('0x39')](_0x49703f[_0x7f9b('0x35')][_0x7f9b('0x39')]));_0x5300f0[_0x7f9b('0x3a')]=_0x5300f0[_0x7f9b('0x3a')][_0x7f9b('0x3b')]?_0x5300f0[_0x7f9b('0x3a')]:_0x1bca25['model'];if(!_0x49703f[_0x7f9b('0x35')][_0x7f9b('0x3c')](_0x7f9b('0x3d'))){_0x5300f0[_0x7f9b('0x22')]=qs['limit'](_0x49703f[_0x7f9b('0x35')][_0x7f9b('0x22')]);_0x5300f0[_0x7f9b('0x21')]=qs[_0x7f9b('0x21')](_0x49703f[_0x7f9b('0x35')][_0x7f9b('0x21')]);}_0x5300f0[_0x7f9b('0x3e')]=qs[_0x7f9b('0x3f')](_0x49703f[_0x7f9b('0x35')][_0x7f9b('0x3f')]);_0x5300f0[_0x7f9b('0x40')]=qs[_0x7f9b('0x37')](_[_0x7f9b('0x41')](_0x49703f['query'],_0x1bca25[_0x7f9b('0x37')]),_0x3693ed);if(_0x49703f[_0x7f9b('0x35')]['filter']){_0x5300f0[_0x7f9b('0x40')]=_[_0x7f9b('0x42')](_0x5300f0[_0x7f9b('0x40')],{'$or':_['map'](_0x3693ed,function(_0x4951e4){if(_0x4951e4[_0x7f9b('0x43')]!==_0x7f9b('0x44')){var _0x4f71aa={};_0x4f71aa[_0x4951e4[_0x7f9b('0x2e')]]={'$like':'%'+_0x49703f[_0x7f9b('0x35')][_0x7f9b('0x45')]+'%'};return _0x4f71aa;}})});}_0x5300f0=_[_0x7f9b('0x42')]({},_0x5300f0,_0x49703f[_0x7f9b('0x46')]);var _0x45eef5={'where':_0x5300f0[_0x7f9b('0x40')]};return db[_0x7f9b('0x32')][_0x7f9b('0x20')](_0x45eef5)['then'](function(_0x190ebc){_0x443c67[_0x7f9b('0x20')]=_0x190ebc;if(_0x49703f[_0x7f9b('0x35')][_0x7f9b('0x47')]){_0x5300f0['include']=[{'all':!![]}];}return db[_0x7f9b('0x32')][_0x7f9b('0x48')](_0x5300f0);})['then'](function(_0x34ed81){_0x443c67['rows']=_0x34ed81;return _0x443c67;})[_0x7f9b('0x2a')](respondWithFilteredResult(_0x37d1a6,_0x5300f0))[_0x7f9b('0x49')](handleError(_0x37d1a6,null));};exports['show']=function(_0x316362,_0x500fdb){var _0x89089e={'raw':!![],'where':{'id':_0x316362['params']['id']}},_0x48b9ab={};_0x48b9ab[_0x7f9b('0x34')]=_[_0x7f9b('0x36')](db[_0x7f9b('0x32')][_0x7f9b('0x4a')]);_0x48b9ab[_0x7f9b('0x35')]=_[_0x7f9b('0x36')](_0x316362[_0x7f9b('0x35')]);_0x48b9ab[_0x7f9b('0x37')]=_[_0x7f9b('0x38')](_0x48b9ab[_0x7f9b('0x34')],_0x48b9ab['query']);_0x89089e[_0x7f9b('0x3a')]=_['intersection'](_0x48b9ab[_0x7f9b('0x34')],qs[_0x7f9b('0x39')](_0x316362['query'][_0x7f9b('0x39')]));_0x89089e[_0x7f9b('0x3a')]=_0x89089e[_0x7f9b('0x3a')][_0x7f9b('0x3b')]?_0x89089e['attributes']:_0x48b9ab['model'];if(_0x316362[_0x7f9b('0x35')][_0x7f9b('0x47')]){_0x89089e['include']=[{'all':!![]}];}_0x89089e=_[_0x7f9b('0x42')]({},_0x89089e,_0x316362[_0x7f9b('0x46')]);return db[_0x7f9b('0x32')][_0x7f9b('0x4b')](_0x89089e)[_0x7f9b('0x2a')](handleEntityNotFound(_0x500fdb,null))[_0x7f9b('0x2a')](respondWithResult(_0x500fdb,null))[_0x7f9b('0x49')](handleError(_0x500fdb,null));};exports[_0x7f9b('0x4c')]=function(_0x327547,_0xaa286a){return db[_0x7f9b('0x32')][_0x7f9b('0x4c')](_0x327547['body'],{})[_0x7f9b('0x2a')](function(_0x3e80d1){var _0x4d85de=_0x327547['user'][_0x7f9b('0x4d')]({'plain':!![]});if(!_0x4d85de)throw new Error(_0x7f9b('0x4e'));if(_0x4d85de[_0x7f9b('0x4f')]===_0x7f9b('0x50')){var _0x298c40=_0x3e80d1['get']({'plain':!![]});var _0x565dad=_0x7f9b('0x2b');return db['UserProfileSection'][_0x7f9b('0x4b')]({'where':{'name':_0x565dad,'userProfileId':_0x4d85de[_0x7f9b('0x51')]},'raw':!![]})[_0x7f9b('0x2a')](function(_0x16ee6f){if(_0x16ee6f&&_0x16ee6f['autoAssociation']===0x0){return db[_0x7f9b('0x2c')][_0x7f9b('0x4c')]({'name':_0x298c40[_0x7f9b('0x2e')],'resourceId':_0x298c40['id'],'type':_0x16ee6f[_0x7f9b('0x2e')],'sectionId':_0x16ee6f['id']},{})['then'](function(){return _0x3e80d1;});}else{return _0x3e80d1;}})[_0x7f9b('0x49')](function(_0x3f7837){logger[_0x7f9b('0x52')](_0x7f9b('0x53'),_0x3f7837);throw _0x3f7837;});}return _0x3e80d1;})[_0x7f9b('0x2a')](respondWithResult(_0xaa286a,0xc9))['catch'](handleError(_0xaa286a,null));};exports['update']=function(_0x5a818c,_0x44dffe){if(_0x5a818c['body']['id']){delete _0x5a818c[_0x7f9b('0x54')]['id'];}return db[_0x7f9b('0x32')]['find']({'where':{'id':_0x5a818c['params']['id']}})[_0x7f9b('0x2a')](handleEntityNotFound(_0x44dffe,null))[_0x7f9b('0x2a')](saveUpdates(_0x5a818c[_0x7f9b('0x54')],null))['then'](respondWithResult(_0x44dffe,null))[_0x7f9b('0x49')](handleError(_0x44dffe,null));};exports[_0x7f9b('0x29')]=function(_0x3fdcd5,_0x2d5ba7){return db[_0x7f9b('0x32')][_0x7f9b('0x4b')]({'where':{'id':_0x3fdcd5[_0x7f9b('0x55')]['id']}})['then'](handleEntityNotFound(_0x2d5ba7,null))[_0x7f9b('0x2a')](removeEntity(_0x2d5ba7,null))[_0x7f9b('0x49')](handleError(_0x2d5ba7,null));};exports[_0x7f9b('0x56')]=function(_0x51d3d,_0x1fad55){return db[_0x7f9b('0x32')][_0x7f9b('0x56')]()['then'](respondWithResult(_0x1fad55,null))[_0x7f9b('0x49')](handleError(_0x1fad55,null));};exports[_0x7f9b('0x57')]=function(_0x230775,_0x330fd2,_0x4fa2bb){var _0x7613bf={'raw':!![],'where':{}},_0x2956e2={},_0x434ab6;return db[_0x7f9b('0x32')]['findOne']({'where':{'id':_0x230775[_0x7f9b('0x55')]['id']}})['then'](handleEntityNotFound(_0x330fd2,null))[_0x7f9b('0x2a')](function(_0x5626cc){if(_0x5626cc){_0x434ab6=_0x5626cc['get']({'plain':!![]});_0x2956e2[_0x7f9b('0x34')]=_[_0x7f9b('0x36')](db[_0x7f9b('0x58')][_0x7f9b('0x4a')]);_0x2956e2[_0x7f9b('0x35')]=_[_0x7f9b('0x36')](_0x230775[_0x7f9b('0x35')]);_0x2956e2[_0x7f9b('0x37')]=_['intersection'](_0x2956e2[_0x7f9b('0x34')],_0x2956e2[_0x7f9b('0x35')]);_0x7613bf[_0x7f9b('0x3a')]=_[_0x7f9b('0x38')](_0x2956e2['model'],qs[_0x7f9b('0x39')](_0x230775[_0x7f9b('0x35')][_0x7f9b('0x39')]));_0x7613bf[_0x7f9b('0x3a')]=_0x7613bf[_0x7f9b('0x3a')][_0x7f9b('0x3b')]?_0x7613bf['attributes']:_0x2956e2['model'];if(!_0x230775[_0x7f9b('0x35')][_0x7f9b('0x3c')](_0x7f9b('0x3d'))){_0x7613bf[_0x7f9b('0x22')]=qs[_0x7f9b('0x22')](_0x230775[_0x7f9b('0x35')]['limit']);_0x7613bf['offset']=qs[_0x7f9b('0x21')](_0x230775['query'][_0x7f9b('0x21')]);}_0x7613bf[_0x7f9b('0x3e')]=qs['sort'](_0x230775['query'][_0x7f9b('0x3f')]);_0x7613bf[_0x7f9b('0x40')]=qs[_0x7f9b('0x37')](_[_0x7f9b('0x41')](_0x230775['query'],_0x2956e2[_0x7f9b('0x37')]));_0x7613bf[_0x7f9b('0x40')][_0x7f9b('0x59')]=_0x5626cc['id'];if(_0x230775[_0x7f9b('0x35')]['filter']){_0x7613bf[_0x7f9b('0x40')]=_[_0x7f9b('0x42')](_0x7613bf[_0x7f9b('0x40')],{'$or':_[_0x7f9b('0x31')](_0x7613bf[_0x7f9b('0x3a')],function(_0x1ab938){var _0x4c5a2c={};_0x4c5a2c[_0x1ab938]={'$like':'%'+_0x230775[_0x7f9b('0x35')]['filter']+'%'};return _0x4c5a2c;})});}_0x7613bf=_['merge']({},_0x7613bf,_0x230775[_0x7f9b('0x46')]);return db[_0x7f9b('0x58')][_0x7f9b('0x48')](_0x7613bf);}})[_0x7f9b('0x2a')](function(_0xc0cd51){if(_0xc0cd51){return db[_0x7f9b('0x5a')][_0x7f9b('0x5b')]({'where':{'id':_[_0x7f9b('0x31')](_0xc0cd51,_0x7f9b('0x5c')),'role':'agent'},'attributes':['id',_0x7f9b('0x2e'),_0x7f9b('0x5d'),_0x7f9b('0x5e'),_0x7f9b('0x5f')]});}})[_0x7f9b('0x2a')](function(_0x25532a){if(_0x25532a){return{'count':_0x25532a[_0x7f9b('0x20')],'rows':_[_0x7f9b('0x31')](_0x25532a[_0x7f9b('0x60')],function(_0x3c105c){return{'membername':_0x3c105c[_0x7f9b('0x2e')],'UserId':_0x3c105c['id'],'queue_name':_0x434ab6[_0x7f9b('0x2e')],'SmsQueueId':_0x434ab6['id'],'interface':util[_0x7f9b('0x61')](_0x7f9b('0x62'),_0x7f9b('0x63'),_0x3c105c['name']),'penalty':0x0,'paused':_0x3c105c['smsPause'],'createdAt':_0x3c105c[_0x7f9b('0x5f')],'updatedAt':_0x3c105c[_0x7f9b('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7f9b('0x2a')](respondWithFilteredResult(_0x330fd2,_0x7613bf))[_0x7f9b('0x49')](handleError(_0x330fd2,null));};exports[_0x7f9b('0x64')]=function(_0x388b4e,_0x4d4327,_0x395ba7){var _0x4bb5bc={};var _0x1a624a={};var _0x185b80;var _0x29c5de;return db[_0x7f9b('0x32')][_0x7f9b('0x65')]({'where':{'id':_0x388b4e[_0x7f9b('0x55')]['id']}})['then'](handleEntityNotFound(_0x4d4327,null))[_0x7f9b('0x2a')](function(_0x267fc9){if(_0x267fc9){_0x185b80=_0x267fc9;_0x1a624a['model']=_[_0x7f9b('0x36')](db[_0x7f9b('0x66')][_0x7f9b('0x4a')]);_0x1a624a['query']=_[_0x7f9b('0x36')](_0x388b4e[_0x7f9b('0x35')]);_0x1a624a[_0x7f9b('0x37')]=_[_0x7f9b('0x38')](_0x1a624a[_0x7f9b('0x34')],_0x1a624a[_0x7f9b('0x35')]);_0x4bb5bc[_0x7f9b('0x3a')]=_[_0x7f9b('0x38')](_0x1a624a[_0x7f9b('0x34')],qs[_0x7f9b('0x39')](_0x388b4e[_0x7f9b('0x35')][_0x7f9b('0x39')]));_0x4bb5bc[_0x7f9b('0x3a')]=_0x4bb5bc[_0x7f9b('0x3a')][_0x7f9b('0x3b')]?_0x4bb5bc[_0x7f9b('0x3a')]:_0x1a624a['model'];_0x4bb5bc[_0x7f9b('0x3e')]=qs[_0x7f9b('0x3f')](_0x388b4e['query'][_0x7f9b('0x3f')]);_0x4bb5bc[_0x7f9b('0x40')]=qs[_0x7f9b('0x37')](_[_0x7f9b('0x41')](_0x388b4e['query'],_0x1a624a[_0x7f9b('0x37')]));if(_0x388b4e[_0x7f9b('0x35')][_0x7f9b('0x45')]){_0x4bb5bc['where']=_['merge'](_0x4bb5bc[_0x7f9b('0x40')],{'$or':_[_0x7f9b('0x31')](_0x4bb5bc[_0x7f9b('0x3a')],function(_0x474b32){var _0x327093={};_0x327093[_0x474b32]={'$like':'%'+_0x388b4e[_0x7f9b('0x35')][_0x7f9b('0x45')]+'%'};return _0x327093;})});}_0x4bb5bc=_[_0x7f9b('0x42')]({},_0x4bb5bc,_0x388b4e[_0x7f9b('0x46')]);return _0x185b80[_0x7f9b('0x64')](_0x4bb5bc);}})[_0x7f9b('0x2a')](function(_0xae11af){if(_0xae11af){_0x29c5de=_0xae11af[_0x7f9b('0x3b')];if(!_0x388b4e[_0x7f9b('0x35')][_0x7f9b('0x3c')]('nolimit')){_0x4bb5bc['limit']=qs[_0x7f9b('0x22')](_0x388b4e[_0x7f9b('0x35')][_0x7f9b('0x22')]);_0x4bb5bc[_0x7f9b('0x21')]=qs[_0x7f9b('0x21')](_0x388b4e[_0x7f9b('0x35')][_0x7f9b('0x21')]);}return _0x185b80['getTeams'](_0x4bb5bc);}})[_0x7f9b('0x2a')](function(_0x10b72b){if(_0x10b72b){return _0x10b72b?{'count':_0x29c5de,'rows':_0x10b72b}:null;}})[_0x7f9b('0x2a')](respondWithResult(_0x4d4327,null))[_0x7f9b('0x49')](handleError(_0x4d4327,null));};exports[_0x7f9b('0x67')]=function(_0x16944d,_0x4f269b,_0xb19ae7){var _0x408ca6=_0x16944d[_0x7f9b('0x54')][_0x7f9b('0x68')];return db[_0x7f9b('0x66')][_0x7f9b('0x48')]({'where':{'id':_0x408ca6},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7f9b('0x69'),'attributes':['id',_0x7f9b('0x2e'),_0x7f9b('0x6a'),_0x7f9b('0x6b'),'interface'],'raw':!![]}]})[_0x7f9b('0x2a')](function(_0x1a1d69){if(_0x1a1d69){var _0x186109=_[_0x7f9b('0x6c')](_0x1a1d69,function(_0x21e863){var _0x38bd3b=_0x21e863[_0x7f9b('0x4d')]({'plain':!![]});return _0x38bd3b[_0x7f9b('0x69')];});return db[_0x7f9b('0x32')][_0x7f9b('0x4b')]({'where':{'id':_0x16944d[_0x7f9b('0x55')]['id']}})['then'](function(_0x1c879f){return db[_0x7f9b('0x6d')][_0x7f9b('0x6e')](function(_0x35f2c0){return _0x1c879f['addTeams'](_0x408ca6,{'transaction':_0x35f2c0})[_0x7f9b('0x2a')](function(){return BPromise[_0x7f9b('0x6f')](_0x186109,function(_0x3faac8){return db[_0x7f9b('0x58')][_0x7f9b('0x70')]({'where':{'UserId':_0x3faac8['id'],'SmsQueueId':_0x16944d[_0x7f9b('0x55')]['id']},'transaction':_0x35f2c0});});})[_0x7f9b('0x2a')](function(){_0x186109['forEach'](function(_0x1c25e7){socket[_0x7f9b('0x71')]('userSmsQueue:save',{'UserId':_0x1c25e7['id'],'SmsQueueId':_0x1c879f['id']});});});});});}})[_0x7f9b('0x2a')](respondWithStatusCode(_0x4f269b,null))[_0x7f9b('0x49')](handleError(_0x4f269b,null));};exports[_0x7f9b('0x72')]=function(_0x3aa6a3,_0x364d6c,_0xc058cd){return db['Team']['findAll']({'where':{'id':_0x3aa6a3[_0x7f9b('0x35')][_0x7f9b('0x68')]},'attributes':['id'],'include':[{'model':db[_0x7f9b('0x5a')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x7f9b('0x2a')](handleEntityNotFound(_0x364d6c,null))[_0x7f9b('0x2a')](function(_0x4ce63b){var _0x253271=_['map'](_0x4ce63b,'id');var _0x44d4a3=[];var _0x254b64=[];var _0x49916c=squel[_0x7f9b('0x73')]();_0x49916c[_0x7f9b('0x74')](_0x7f9b('0x75'))[_0x7f9b('0x76')](_0x7f9b('0x77'),'tq')['join'](_0x7f9b('0x78'),'ut',_0x7f9b('0x79'))[_0x7f9b('0x40')]('SmsQueueId\x20=\x20?',_0x3aa6a3[_0x7f9b('0x55')]['id']);for(var _0x27a630=0x0;_0x27a630<_0x4ce63b[_0x7f9b('0x3b')];_0x27a630+=0x1){let _0x5795f6=_0x4ce63b[_0x27a630];for(var _0x43f836=0x0;_0x43f836<_0x5795f6[_0x7f9b('0x69')][_0x7f9b('0x3b')];_0x43f836+=0x1){let _0x32e80f=_0x5795f6[_0x7f9b('0x69')][_0x43f836];var _0x12e728=_0x49916c[_0x7f9b('0x7a')]();_0x12e728['where']('ut.UserId\x20=\x20?',_0x32e80f['id']);_0x254b64[_0x7f9b('0x7b')](db[_0x7f9b('0x6d')]['query'](_0x12e728[_0x7f9b('0x7c')](),{'type':db[_0x7f9b('0x6d')][_0x7f9b('0x7d')][_0x7f9b('0x7e')]})[_0x7f9b('0x2a')](function(_0xe7cdce){if(_0xe7cdce[_0x7f9b('0x3b')]===0x1){return _0x32e80f['id'];}else{var _0x3739bb=_['every'](_[_0x7f9b('0x31')](_0xe7cdce,'TeamId'),function(_0x1fc496){return _[_0x7f9b('0x7f')](_0x253271,_0x1fc496);});if(_0x3739bb){return _0x32e80f['id'];}}}));}}return BPromise[_0x7f9b('0x80')](_0x254b64)[_0x7f9b('0x2a')](function(_0x30a3f3){_0x44d4a3=_(_0x44d4a3)[_0x7f9b('0x81')](_0x30a3f3)[_0x7f9b('0x82')]()[_0x7f9b('0x83')]();return db[_0x7f9b('0x32')]['find']({'where':{'id':_0x3aa6a3[_0x7f9b('0x55')]['id']}})[_0x7f9b('0x2a')](function(_0x10012c){return db['sequelize'][_0x7f9b('0x6e')](function(_0x388da2){return _0x10012c[_0x7f9b('0x72')](_0x3aa6a3[_0x7f9b('0x35')]['ids'],{'transaction':_0x388da2})[_0x7f9b('0x2a')](function(){if(!_[_0x7f9b('0x84')](_0x44d4a3)){return _0x10012c[_0x7f9b('0x85')](_0x44d4a3,{'transaction':_0x388da2});}})['then'](function(){_0x44d4a3['forEach'](function(_0x3729ce){socket[_0x7f9b('0x71')](_0x7f9b('0x86'),{'UserId':_0x3729ce,'SmsQueueId':_0x10012c['id']});});});});});});})[_0x7f9b('0x2a')](respondWithStatusCode(_0x364d6c,null))['catch'](handleError(_0x364d6c,null));};exports[_0x7f9b('0x87')]=function(_0x366714,_0x24368e,_0x174d94){return db['SmsQueue']['find']({'where':{'id':_0x366714['params']['id']}})[_0x7f9b('0x2a')](handleEntityNotFound(_0x24368e,null))[_0x7f9b('0x2a')](function(_0x2e173f){if(_0x2e173f){return _0x2e173f[_0x7f9b('0x87')](_0x366714[_0x7f9b('0x54')][_0x7f9b('0x68')],_[_0x7f9b('0x88')](_0x366714['body'],[_0x7f9b('0x68'),'id'])||{})[_0x7f9b('0x89')](function(_0x4a6a1a){for(var _0x46bf43=0x0;_0x46bf43<_0x366714[_0x7f9b('0x54')][_0x7f9b('0x68')][_0x7f9b('0x3b')];_0x46bf43+=0x1){socket[_0x7f9b('0x71')](_0x7f9b('0x8a'),{'UserId':Number(_0x366714[_0x7f9b('0x54')][_0x7f9b('0x68')][_0x46bf43]),'SmsQueueId':Number(_0x366714[_0x7f9b('0x55')]['id'])});}return _0x4a6a1a;});}})[_0x7f9b('0x2a')](respondWithResult(_0x24368e,null))[_0x7f9b('0x49')](handleError(_0x24368e,null));};exports[_0x7f9b('0x85')]=function(_0x2cbec8,_0x2a8c89,_0x5bc6d1){return db[_0x7f9b('0x32')][_0x7f9b('0x4b')]({'where':{'id':_0x2cbec8[_0x7f9b('0x55')]['id']}})[_0x7f9b('0x2a')](handleEntityNotFound(_0x2a8c89,null))[_0x7f9b('0x2a')](function(_0x5dda55){if(_0x5dda55){return _0x5dda55[_0x7f9b('0x85')](_0x2cbec8[_0x7f9b('0x35')][_0x7f9b('0x68')])['then'](function(){if(_[_0x7f9b('0x8b')](_0x2cbec8[_0x7f9b('0x35')][_0x7f9b('0x68')])){for(var _0x228c0d=0x0;_0x228c0d<_0x2cbec8['query'][_0x7f9b('0x68')][_0x7f9b('0x3b')];_0x228c0d+=0x1){socket['emit'](_0x7f9b('0x86'),{'UserId':Number(_0x2cbec8[_0x7f9b('0x35')][_0x7f9b('0x68')][_0x228c0d]),'SmsQueueId':Number(_0x2cbec8[_0x7f9b('0x55')]['id'])});}}else{socket[_0x7f9b('0x71')](_0x7f9b('0x86'),{'UserId':Number(_0x2cbec8[_0x7f9b('0x35')][_0x7f9b('0x68')]),'SmsQueueId':Number(_0x2cbec8[_0x7f9b('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x2a8c89,null))[_0x7f9b('0x49')](handleError(_0x2a8c89,null));};exports['getAgents']=function(_0x14ce6b,_0x2fbd2a,_0x366864){var _0x5e07bf={};var _0x3c9e77={};var _0xf3375;var _0x38179f;return db[_0x7f9b('0x32')][_0x7f9b('0x65')]({'where':{'id':_0x14ce6b['params']['id']}})[_0x7f9b('0x2a')](handleEntityNotFound(_0x2fbd2a,null))[_0x7f9b('0x2a')](function(_0x339ec6){if(_0x339ec6){_0xf3375=_0x339ec6;_0x3c9e77[_0x7f9b('0x34')]=_['keys'](db[_0x7f9b('0x5a')][_0x7f9b('0x4a')]);_0x3c9e77['query']=_[_0x7f9b('0x36')](_0x14ce6b[_0x7f9b('0x35')]);_0x3c9e77['filters']=_[_0x7f9b('0x38')](_0x3c9e77[_0x7f9b('0x34')],_0x3c9e77[_0x7f9b('0x35')]);_0x5e07bf['attributes']=_[_0x7f9b('0x38')](_0x3c9e77[_0x7f9b('0x34')],qs[_0x7f9b('0x39')](_0x14ce6b[_0x7f9b('0x35')]['fields']));_0x5e07bf[_0x7f9b('0x3a')]=_0x5e07bf['attributes']['length']?_0x5e07bf['attributes']:_0x3c9e77['model'];_0x5e07bf[_0x7f9b('0x3e')]=qs[_0x7f9b('0x3f')](_0x14ce6b[_0x7f9b('0x35')][_0x7f9b('0x3f')]);_0x5e07bf['where']=qs[_0x7f9b('0x37')](_[_0x7f9b('0x41')](_0x14ce6b['query'],_0x3c9e77[_0x7f9b('0x37')]));if(_0x14ce6b[_0x7f9b('0x35')][_0x7f9b('0x45')]){_0x5e07bf[_0x7f9b('0x40')]=_[_0x7f9b('0x42')](_0x5e07bf[_0x7f9b('0x40')],{'$or':_[_0x7f9b('0x31')](_0x5e07bf[_0x7f9b('0x3a')],function(_0x215002){var _0x226fb2={};_0x226fb2[_0x215002]={'$like':'%'+_0x14ce6b[_0x7f9b('0x35')]['filter']+'%'};return _0x226fb2;})});}_0x5e07bf=_[_0x7f9b('0x42')]({},_0x5e07bf,_0x14ce6b[_0x7f9b('0x46')]);return _0xf3375[_0x7f9b('0x8c')](_0x5e07bf);}})[_0x7f9b('0x2a')](function(_0x178f41){if(_0x178f41){_0x38179f=_0x178f41[_0x7f9b('0x3b')];if(!_0x14ce6b[_0x7f9b('0x35')][_0x7f9b('0x3c')](_0x7f9b('0x3d'))){_0x5e07bf[_0x7f9b('0x22')]=qs[_0x7f9b('0x22')](_0x14ce6b[_0x7f9b('0x35')][_0x7f9b('0x22')]);_0x5e07bf[_0x7f9b('0x21')]=qs[_0x7f9b('0x21')](_0x14ce6b[_0x7f9b('0x35')][_0x7f9b('0x21')]);}return _0xf3375['getAgents'](_0x5e07bf);}})[_0x7f9b('0x2a')](function(_0x47e6ab){if(_0x47e6ab){return _0x47e6ab?{'count':_0x38179f,'rows':_0x47e6ab}:null;}})[_0x7f9b('0x2a')](respondWithResult(_0x2fbd2a,null))[_0x7f9b('0x49')](handleError(_0x2fbd2a,null));}; \ No newline at end of file +var _0xfa60=['includes','all','union','compact','value','isEmpty','userSmsQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./smsQueue.socket','register','sendStatus','end','status','json','limit','undefined','count','offset','Content-Range','save','update','then','get','SmsQueues','UserProfileResource','destroy','error','name','send','index','map','rawAttributes','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','SmsQueue','includeAll','include','findAll','catch','show','params','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserSmsQueue','SmsQueueId','findAndCountAll','UserId','smsPause','updatedAt','createdAt','rows','format','SIP','getTeams','findOne','Team','nolimit','ids','User','Agents','voicePause','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId'];(function(_0xb1061d,_0x568463){var _0x30731c=function(_0x3b31e8){while(--_0x3b31e8){_0xb1061d['push'](_0xb1061d['shift']());}};_0x30731c(++_0x568463);}(_0xfa60,0x9d));var _0x0fa6=function(_0x5de961,_0x55702b){_0x5de961=_0x5de961-0x0;var _0xf4b271=_0xfa60[_0x5de961];return _0xf4b271;};'use strict';var emlformat=require(_0x0fa6('0x0'));var rimraf=require(_0x0fa6('0x1'));var zipdir=require(_0x0fa6('0x2'));var jsonpatch=require(_0x0fa6('0x3'));var rp=require(_0x0fa6('0x4'));var moment=require(_0x0fa6('0x5'));var BPromise=require(_0x0fa6('0x6'));var Mustache=require(_0x0fa6('0x7'));var util=require(_0x0fa6('0x8'));var path=require(_0x0fa6('0x9'));var sox=require(_0x0fa6('0xa'));var csv=require(_0x0fa6('0xb'));var ejs=require(_0x0fa6('0xc'));var fs=require('fs');var fs_extra=require(_0x0fa6('0xd'));var _=require(_0x0fa6('0xe'));var squel=require(_0x0fa6('0xf'));var crypto=require(_0x0fa6('0x10'));var jsforce=require(_0x0fa6('0x11'));var deskjs=require(_0x0fa6('0x12'));var toCsv=require(_0x0fa6('0xb'));var querystring=require(_0x0fa6('0x13'));var Papa=require(_0x0fa6('0x14'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0fa6('0x15'));var as=require(_0x0fa6('0x16'));var hardwareService=require(_0x0fa6('0x17'));var logger=require(_0x0fa6('0x18'))(_0x0fa6('0x19'));var utils=require(_0x0fa6('0x1a'));var config=require(_0x0fa6('0x1b'));var licenseUtil=require(_0x0fa6('0x1c'));var db=require(_0x0fa6('0x1d'))['db'];config[_0x0fa6('0x1e')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0fa6('0x1f'))(new Redis(config[_0x0fa6('0x1e')]));require(_0x0fa6('0x20'))[_0x0fa6('0x21')](socket);function respondWithStatusCode(_0x199ddd,_0x2a2ad3){_0x2a2ad3=_0x2a2ad3||0xcc;return function(_0x2ace1c){if(_0x2ace1c){return _0x199ddd[_0x0fa6('0x22')](_0x2a2ad3);}return _0x199ddd['status'](_0x2a2ad3)[_0x0fa6('0x23')]();};}function respondWithResult(_0x257f8a,_0xe2a262){_0xe2a262=_0xe2a262||0xc8;return function(_0x3d74f8){if(_0x3d74f8){return _0x257f8a[_0x0fa6('0x24')](_0xe2a262)[_0x0fa6('0x25')](_0x3d74f8);}};}function respondWithFilteredResult(_0x5df009,_0x1f15b5){return function(_0x2201f5){if(_0x2201f5){var _0x3ed198=typeof _0x1f15b5['offset']==='undefined'&&typeof _0x1f15b5[_0x0fa6('0x26')]===_0x0fa6('0x27');var _0x371163=_0x2201f5[_0x0fa6('0x28')];var _0x47e7b0=_0x3ed198?0x0:_0x1f15b5[_0x0fa6('0x29')];var _0x3f33c1=_0x3ed198?_0x2201f5[_0x0fa6('0x28')]:_0x1f15b5[_0x0fa6('0x29')]+_0x1f15b5[_0x0fa6('0x26')];var _0x3e9af3;if(_0x3f33c1>=_0x371163){_0x3f33c1=_0x371163;_0x3e9af3=0xc8;}else{_0x3e9af3=0xce;}_0x5df009[_0x0fa6('0x24')](_0x3e9af3);return _0x5df009['set'](_0x0fa6('0x2a'),_0x47e7b0+'-'+_0x3f33c1+'/'+_0x371163)[_0x0fa6('0x25')](_0x2201f5);}return null;};}function patchUpdates(_0x214019){return function(_0x358c10){try{jsonpatch['apply'](_0x358c10,_0x214019,!![]);}catch(_0x409730){return BPromise['reject'](_0x409730);}return _0x358c10[_0x0fa6('0x2b')]();};}function saveUpdates(_0x3943ea,_0x59ff27){return function(_0x558bb1){if(_0x558bb1){return _0x558bb1[_0x0fa6('0x2c')](_0x3943ea)[_0x0fa6('0x2d')](function(_0x118587){return _0x118587;});}return null;};}function removeEntity(_0x1c958b,_0x16e2cc){return function(_0x1fdf75){if(_0x1fdf75){return _0x1fdf75['destroy']()['then'](function(){var _0x167b53=_0x1fdf75[_0x0fa6('0x2e')]({'plain':!![]});var _0x38a323=_0x0fa6('0x2f');return db[_0x0fa6('0x30')][_0x0fa6('0x31')]({'where':{'type':_0x38a323,'resourceId':_0x167b53['id']}})[_0x0fa6('0x2d')](function(){return _0x1fdf75;});})[_0x0fa6('0x2d')](function(){_0x1c958b[_0x0fa6('0x24')](0xcc)[_0x0fa6('0x23')]();});}};}function handleEntityNotFound(_0x251022,_0x549d95){return function(_0x1854cc){if(!_0x1854cc){_0x251022[_0x0fa6('0x22')](0x194);}return _0x1854cc;};}function handleError(_0x338c59,_0x574354){_0x574354=_0x574354||0x1f4;return function(_0xf8c43){logger[_0x0fa6('0x32')](_0xf8c43['stack']);if(_0xf8c43[_0x0fa6('0x33')]){delete _0xf8c43[_0x0fa6('0x33')];}_0x338c59[_0x0fa6('0x24')](_0x574354)[_0x0fa6('0x34')](_0xf8c43);};}exports[_0x0fa6('0x35')]=function(_0x38c67a,_0x30c0af){var _0x281485={},_0x279949={},_0x10d4d3={'count':0x0,'rows':[]};var _0x53e0e2=_[_0x0fa6('0x36')](db['SmsQueue'][_0x0fa6('0x37')],function(_0xc8f2c){return{'name':_0xc8f2c['fieldName'],'type':_0xc8f2c[_0x0fa6('0x38')]['key']};});_0x279949[_0x0fa6('0x39')]=_[_0x0fa6('0x36')](_0x53e0e2,'name');_0x279949[_0x0fa6('0x3a')]=_[_0x0fa6('0x3b')](_0x38c67a[_0x0fa6('0x3a')]);_0x279949['filters']=_['intersection'](_0x279949[_0x0fa6('0x39')],_0x279949[_0x0fa6('0x3a')]);_0x281485[_0x0fa6('0x3c')]=_[_0x0fa6('0x3d')](_0x279949['model'],qs[_0x0fa6('0x3e')](_0x38c67a['query']['fields']));_0x281485[_0x0fa6('0x3c')]=_0x281485[_0x0fa6('0x3c')][_0x0fa6('0x3f')]?_0x281485['attributes']:_0x279949[_0x0fa6('0x39')];if(!_0x38c67a[_0x0fa6('0x3a')][_0x0fa6('0x40')]('nolimit')){_0x281485[_0x0fa6('0x26')]=qs[_0x0fa6('0x26')](_0x38c67a[_0x0fa6('0x3a')][_0x0fa6('0x26')]);_0x281485[_0x0fa6('0x29')]=qs[_0x0fa6('0x29')](_0x38c67a[_0x0fa6('0x3a')][_0x0fa6('0x29')]);}_0x281485[_0x0fa6('0x41')]=qs[_0x0fa6('0x42')](_0x38c67a[_0x0fa6('0x3a')][_0x0fa6('0x42')]);_0x281485[_0x0fa6('0x43')]=qs[_0x0fa6('0x44')](_[_0x0fa6('0x45')](_0x38c67a[_0x0fa6('0x3a')],_0x279949[_0x0fa6('0x44')]),_0x53e0e2);if(_0x38c67a[_0x0fa6('0x3a')][_0x0fa6('0x46')]){_0x281485[_0x0fa6('0x43')]=_[_0x0fa6('0x47')](_0x281485['where'],{'$or':_[_0x0fa6('0x36')](_0x53e0e2,function(_0x500290){if(_0x500290[_0x0fa6('0x38')]!=='VIRTUAL'){var _0x204e54={};_0x204e54[_0x500290[_0x0fa6('0x33')]]={'$like':'%'+_0x38c67a[_0x0fa6('0x3a')][_0x0fa6('0x46')]+'%'};return _0x204e54;}})});}_0x281485=_[_0x0fa6('0x47')]({},_0x281485,_0x38c67a[_0x0fa6('0x48')]);var _0x2f221c={'where':_0x281485[_0x0fa6('0x43')]};return db[_0x0fa6('0x49')]['count'](_0x2f221c)[_0x0fa6('0x2d')](function(_0x20d819){_0x10d4d3[_0x0fa6('0x28')]=_0x20d819;if(_0x38c67a['query'][_0x0fa6('0x4a')]){_0x281485[_0x0fa6('0x4b')]=[{'all':!![]}];}return db[_0x0fa6('0x49')][_0x0fa6('0x4c')](_0x281485);})['then'](function(_0x3ea93d){_0x10d4d3['rows']=_0x3ea93d;return _0x10d4d3;})[_0x0fa6('0x2d')](respondWithFilteredResult(_0x30c0af,_0x281485))[_0x0fa6('0x4d')](handleError(_0x30c0af,null));};exports[_0x0fa6('0x4e')]=function(_0x4d930a,_0x49af8f){var _0x8dac64={'raw':!![],'where':{'id':_0x4d930a[_0x0fa6('0x4f')]['id']}},_0x373b74={};_0x373b74[_0x0fa6('0x39')]=_[_0x0fa6('0x3b')](db['SmsQueue']['rawAttributes']);_0x373b74[_0x0fa6('0x3a')]=_[_0x0fa6('0x3b')](_0x4d930a['query']);_0x373b74[_0x0fa6('0x44')]=_[_0x0fa6('0x3d')](_0x373b74['model'],_0x373b74['query']);_0x8dac64[_0x0fa6('0x3c')]=_[_0x0fa6('0x3d')](_0x373b74[_0x0fa6('0x39')],qs['fields'](_0x4d930a[_0x0fa6('0x3a')][_0x0fa6('0x3e')]));_0x8dac64[_0x0fa6('0x3c')]=_0x8dac64[_0x0fa6('0x3c')]['length']?_0x8dac64[_0x0fa6('0x3c')]:_0x373b74[_0x0fa6('0x39')];if(_0x4d930a['query'][_0x0fa6('0x4a')]){_0x8dac64[_0x0fa6('0x4b')]=[{'all':!![]}];}_0x8dac64=_[_0x0fa6('0x47')]({},_0x8dac64,_0x4d930a[_0x0fa6('0x48')]);return db['SmsQueue'][_0x0fa6('0x50')](_0x8dac64)[_0x0fa6('0x2d')](handleEntityNotFound(_0x49af8f,null))[_0x0fa6('0x2d')](respondWithResult(_0x49af8f,null))[_0x0fa6('0x4d')](handleError(_0x49af8f,null));};exports[_0x0fa6('0x51')]=function(_0x175e09,_0x59da9e){return db[_0x0fa6('0x49')]['create'](_0x175e09[_0x0fa6('0x52')],{})[_0x0fa6('0x2d')](function(_0x2d5fea){var _0x5c397d=_0x175e09['user'][_0x0fa6('0x2e')]({'plain':!![]});if(!_0x5c397d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c397d[_0x0fa6('0x53')]===_0x0fa6('0x54')){var _0x89a0b2=_0x2d5fea[_0x0fa6('0x2e')]({'plain':!![]});var _0x3c07dd='SmsQueues';return db[_0x0fa6('0x55')][_0x0fa6('0x50')]({'where':{'name':_0x3c07dd,'userProfileId':_0x5c397d[_0x0fa6('0x56')]},'raw':!![]})[_0x0fa6('0x2d')](function(_0x46a5e9){if(_0x46a5e9&&_0x46a5e9[_0x0fa6('0x57')]===0x0){return db['UserProfileResource'][_0x0fa6('0x51')]({'name':_0x89a0b2[_0x0fa6('0x33')],'resourceId':_0x89a0b2['id'],'type':_0x46a5e9[_0x0fa6('0x33')],'sectionId':_0x46a5e9['id']},{})[_0x0fa6('0x2d')](function(){return _0x2d5fea;});}else{return _0x2d5fea;}})['catch'](function(_0x5f05ba){logger[_0x0fa6('0x32')](_0x0fa6('0x58'),_0x5f05ba);throw _0x5f05ba;});}return _0x2d5fea;})[_0x0fa6('0x2d')](respondWithResult(_0x59da9e,0xc9))['catch'](handleError(_0x59da9e,null));};exports[_0x0fa6('0x2c')]=function(_0x223261,_0x13fa64){if(_0x223261[_0x0fa6('0x52')]['id']){delete _0x223261[_0x0fa6('0x52')]['id'];}return db['SmsQueue'][_0x0fa6('0x50')]({'where':{'id':_0x223261['params']['id']}})[_0x0fa6('0x2d')](handleEntityNotFound(_0x13fa64,null))[_0x0fa6('0x2d')](saveUpdates(_0x223261[_0x0fa6('0x52')],null))[_0x0fa6('0x2d')](respondWithResult(_0x13fa64,null))[_0x0fa6('0x4d')](handleError(_0x13fa64,null));};exports['destroy']=function(_0x4dd2b6,_0x3ab87c){return db[_0x0fa6('0x49')]['find']({'where':{'id':_0x4dd2b6[_0x0fa6('0x4f')]['id']}})[_0x0fa6('0x2d')](handleEntityNotFound(_0x3ab87c,null))[_0x0fa6('0x2d')](removeEntity(_0x3ab87c,null))[_0x0fa6('0x4d')](handleError(_0x3ab87c,null));};exports[_0x0fa6('0x59')]=function(_0x4c0a0e,_0x25b3cd){return db['SmsQueue']['describe']()[_0x0fa6('0x2d')](respondWithResult(_0x25b3cd,null))[_0x0fa6('0x4d')](handleError(_0x25b3cd,null));};exports['getMembers']=function(_0x3484dd,_0x16540d,_0x431bf9){var _0x1fad60={'raw':!![],'where':{}},_0x432496={},_0x5f09ab;return db[_0x0fa6('0x49')]['findOne']({'where':{'id':_0x3484dd[_0x0fa6('0x4f')]['id']}})[_0x0fa6('0x2d')](handleEntityNotFound(_0x16540d,null))['then'](function(_0x5a8de1){if(_0x5a8de1){_0x5f09ab=_0x5a8de1[_0x0fa6('0x2e')]({'plain':!![]});_0x432496[_0x0fa6('0x39')]=_[_0x0fa6('0x3b')](db[_0x0fa6('0x5a')][_0x0fa6('0x37')]);_0x432496[_0x0fa6('0x3a')]=_[_0x0fa6('0x3b')](_0x3484dd[_0x0fa6('0x3a')]);_0x432496['filters']=_['intersection'](_0x432496[_0x0fa6('0x39')],_0x432496['query']);_0x1fad60['attributes']=_[_0x0fa6('0x3d')](_0x432496[_0x0fa6('0x39')],qs[_0x0fa6('0x3e')](_0x3484dd[_0x0fa6('0x3a')][_0x0fa6('0x3e')]));_0x1fad60[_0x0fa6('0x3c')]=_0x1fad60[_0x0fa6('0x3c')]['length']?_0x1fad60[_0x0fa6('0x3c')]:_0x432496[_0x0fa6('0x39')];if(!_0x3484dd[_0x0fa6('0x3a')][_0x0fa6('0x40')]('nolimit')){_0x1fad60[_0x0fa6('0x26')]=qs[_0x0fa6('0x26')](_0x3484dd[_0x0fa6('0x3a')]['limit']);_0x1fad60[_0x0fa6('0x29')]=qs[_0x0fa6('0x29')](_0x3484dd[_0x0fa6('0x3a')]['offset']);}_0x1fad60[_0x0fa6('0x41')]=qs[_0x0fa6('0x42')](_0x3484dd[_0x0fa6('0x3a')][_0x0fa6('0x42')]);_0x1fad60['where']=qs[_0x0fa6('0x44')](_[_0x0fa6('0x45')](_0x3484dd[_0x0fa6('0x3a')],_0x432496[_0x0fa6('0x44')]));_0x1fad60[_0x0fa6('0x43')][_0x0fa6('0x5b')]=_0x5a8de1['id'];if(_0x3484dd[_0x0fa6('0x3a')]['filter']){_0x1fad60[_0x0fa6('0x43')]=_['merge'](_0x1fad60[_0x0fa6('0x43')],{'$or':_[_0x0fa6('0x36')](_0x1fad60[_0x0fa6('0x3c')],function(_0x271a9f){var _0x44b6a4={};_0x44b6a4[_0x271a9f]={'$like':'%'+_0x3484dd[_0x0fa6('0x3a')]['filter']+'%'};return _0x44b6a4;})});}_0x1fad60=_[_0x0fa6('0x47')]({},_0x1fad60,_0x3484dd['options']);return db[_0x0fa6('0x5a')][_0x0fa6('0x4c')](_0x1fad60);}})[_0x0fa6('0x2d')](function(_0x4ac747){if(_0x4ac747){return db['User'][_0x0fa6('0x5c')]({'where':{'id':_[_0x0fa6('0x36')](_0x4ac747,_0x0fa6('0x5d')),'role':'agent'},'attributes':['id',_0x0fa6('0x33'),_0x0fa6('0x5e'),_0x0fa6('0x5f'),_0x0fa6('0x60')]});}})[_0x0fa6('0x2d')](function(_0xaf5b60){if(_0xaf5b60){return{'count':_0xaf5b60[_0x0fa6('0x28')],'rows':_[_0x0fa6('0x36')](_0xaf5b60[_0x0fa6('0x61')],function(_0x2943a3){return{'membername':_0x2943a3['name'],'UserId':_0x2943a3['id'],'queue_name':_0x5f09ab[_0x0fa6('0x33')],'SmsQueueId':_0x5f09ab['id'],'interface':util[_0x0fa6('0x62')]('%s/%s',_0x0fa6('0x63'),_0x2943a3['name']),'penalty':0x0,'paused':_0x2943a3[_0x0fa6('0x5e')],'createdAt':_0x2943a3[_0x0fa6('0x60')],'updatedAt':_0x2943a3['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x0fa6('0x2d')](respondWithFilteredResult(_0x16540d,_0x1fad60))[_0x0fa6('0x4d')](handleError(_0x16540d,null));};exports[_0x0fa6('0x64')]=function(_0x4d9dd3,_0x1b590d,_0x10d5e9){var _0x27aaca={};var _0x4e67c5={};var _0x4da92d;var _0x465c1a;return db['SmsQueue'][_0x0fa6('0x65')]({'where':{'id':_0x4d9dd3[_0x0fa6('0x4f')]['id']}})[_0x0fa6('0x2d')](handleEntityNotFound(_0x1b590d,null))['then'](function(_0x1eef09){if(_0x1eef09){_0x4da92d=_0x1eef09;_0x4e67c5[_0x0fa6('0x39')]=_[_0x0fa6('0x3b')](db[_0x0fa6('0x66')]['rawAttributes']);_0x4e67c5[_0x0fa6('0x3a')]=_[_0x0fa6('0x3b')](_0x4d9dd3[_0x0fa6('0x3a')]);_0x4e67c5['filters']=_[_0x0fa6('0x3d')](_0x4e67c5[_0x0fa6('0x39')],_0x4e67c5[_0x0fa6('0x3a')]);_0x27aaca['attributes']=_[_0x0fa6('0x3d')](_0x4e67c5[_0x0fa6('0x39')],qs[_0x0fa6('0x3e')](_0x4d9dd3[_0x0fa6('0x3a')]['fields']));_0x27aaca[_0x0fa6('0x3c')]=_0x27aaca[_0x0fa6('0x3c')][_0x0fa6('0x3f')]?_0x27aaca['attributes']:_0x4e67c5[_0x0fa6('0x39')];_0x27aaca['order']=qs[_0x0fa6('0x42')](_0x4d9dd3[_0x0fa6('0x3a')][_0x0fa6('0x42')]);_0x27aaca[_0x0fa6('0x43')]=qs[_0x0fa6('0x44')](_[_0x0fa6('0x45')](_0x4d9dd3[_0x0fa6('0x3a')],_0x4e67c5[_0x0fa6('0x44')]));if(_0x4d9dd3[_0x0fa6('0x3a')][_0x0fa6('0x46')]){_0x27aaca[_0x0fa6('0x43')]=_[_0x0fa6('0x47')](_0x27aaca['where'],{'$or':_[_0x0fa6('0x36')](_0x27aaca[_0x0fa6('0x3c')],function(_0x12284e){var _0x4b3be8={};_0x4b3be8[_0x12284e]={'$like':'%'+_0x4d9dd3[_0x0fa6('0x3a')]['filter']+'%'};return _0x4b3be8;})});}_0x27aaca=_[_0x0fa6('0x47')]({},_0x27aaca,_0x4d9dd3[_0x0fa6('0x48')]);return _0x4da92d[_0x0fa6('0x64')](_0x27aaca);}})['then'](function(_0x4a0fa0){if(_0x4a0fa0){_0x465c1a=_0x4a0fa0[_0x0fa6('0x3f')];if(!_0x4d9dd3['query'][_0x0fa6('0x40')](_0x0fa6('0x67'))){_0x27aaca[_0x0fa6('0x26')]=qs[_0x0fa6('0x26')](_0x4d9dd3[_0x0fa6('0x3a')][_0x0fa6('0x26')]);_0x27aaca[_0x0fa6('0x29')]=qs['offset'](_0x4d9dd3['query'][_0x0fa6('0x29')]);}return _0x4da92d[_0x0fa6('0x64')](_0x27aaca);}})[_0x0fa6('0x2d')](function(_0x30cdcf){if(_0x30cdcf){return _0x30cdcf?{'count':_0x465c1a,'rows':_0x30cdcf}:null;}})['then'](respondWithResult(_0x1b590d,null))[_0x0fa6('0x4d')](handleError(_0x1b590d,null));};exports['addTeams']=function(_0x255e50,_0x3ae3ee,_0x1080c7){var _0x39d55d=_0x255e50[_0x0fa6('0x52')][_0x0fa6('0x68')];return db[_0x0fa6('0x66')][_0x0fa6('0x4c')]({'where':{'id':_0x39d55d},'attributes':['id'],'include':[{'model':db[_0x0fa6('0x69')],'as':_0x0fa6('0x6a'),'attributes':['id',_0x0fa6('0x33'),'online',_0x0fa6('0x6b'),'interface'],'raw':!![]}]})['then'](function(_0x5b73d4){if(_0x5b73d4){var _0xedf07e=_[_0x0fa6('0x6c')](_0x5b73d4,function(_0x2fa822){var _0x121f7f=_0x2fa822[_0x0fa6('0x2e')]({'plain':!![]});return _0x121f7f[_0x0fa6('0x6a')];});return db[_0x0fa6('0x49')]['find']({'where':{'id':_0x255e50[_0x0fa6('0x4f')]['id']}})[_0x0fa6('0x2d')](function(_0x11bdd3){return db[_0x0fa6('0x6d')][_0x0fa6('0x6e')](function(_0x2531ff){return _0x11bdd3['addTeams'](_0x39d55d,{'transaction':_0x2531ff})[_0x0fa6('0x2d')](function(){return BPromise['each'](_0xedf07e,function(_0x3ead9d){return db[_0x0fa6('0x5a')][_0x0fa6('0x6f')]({'where':{'UserId':_0x3ead9d['id'],'SmsQueueId':_0x255e50[_0x0fa6('0x4f')]['id']},'transaction':_0x2531ff});});})[_0x0fa6('0x2d')](function(){_0xedf07e[_0x0fa6('0x70')](function(_0x132887){socket[_0x0fa6('0x71')](_0x0fa6('0x72'),{'UserId':_0x132887['id'],'SmsQueueId':_0x11bdd3['id']});});});});});}})[_0x0fa6('0x2d')](respondWithStatusCode(_0x3ae3ee,null))[_0x0fa6('0x4d')](handleError(_0x3ae3ee,null));};exports[_0x0fa6('0x73')]=function(_0x51eab4,_0x31f8e9,_0x4c42bc){return db[_0x0fa6('0x66')][_0x0fa6('0x4c')]({'where':{'id':_0x51eab4[_0x0fa6('0x3a')][_0x0fa6('0x68')]},'attributes':['id'],'include':[{'model':db[_0x0fa6('0x69')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x31f8e9,null))[_0x0fa6('0x2d')](function(_0x4b3131){var _0x11b635=_[_0x0fa6('0x36')](_0x4b3131,'id');var _0x347e31=[];var _0x103003=[];var _0x1df44a=squel[_0x0fa6('0x74')]();_0x1df44a[_0x0fa6('0x75')](_0x0fa6('0x76'))['from'](_0x0fa6('0x77'),'tq')[_0x0fa6('0x78')]('user_has_teams','ut',_0x0fa6('0x79'))[_0x0fa6('0x43')](_0x0fa6('0x7a'),_0x51eab4['params']['id']);for(var _0x542ae6=0x0;_0x542ae6<_0x4b3131[_0x0fa6('0x3f')];_0x542ae6+=0x1){let _0x4a43b3=_0x4b3131[_0x542ae6];for(var _0x29d144=0x0;_0x29d144<_0x4a43b3[_0x0fa6('0x6a')][_0x0fa6('0x3f')];_0x29d144+=0x1){let _0x8a2719=_0x4a43b3[_0x0fa6('0x6a')][_0x29d144];var _0x5bcff8=_0x1df44a[_0x0fa6('0x7b')]();_0x5bcff8[_0x0fa6('0x43')](_0x0fa6('0x7c'),_0x8a2719['id']);_0x103003[_0x0fa6('0x7d')](db[_0x0fa6('0x6d')][_0x0fa6('0x3a')](_0x5bcff8[_0x0fa6('0x7e')](),{'type':db[_0x0fa6('0x6d')][_0x0fa6('0x7f')][_0x0fa6('0x80')]})[_0x0fa6('0x2d')](function(_0x174555){if(_0x174555[_0x0fa6('0x3f')]===0x1){return _0x8a2719['id'];}else{var _0x4815f5=_[_0x0fa6('0x81')](_['map'](_0x174555,_0x0fa6('0x82')),function(_0x29e454){return _[_0x0fa6('0x83')](_0x11b635,_0x29e454);});if(_0x4815f5){return _0x8a2719['id'];}}}));}}return BPromise[_0x0fa6('0x84')](_0x103003)[_0x0fa6('0x2d')](function(_0x75b3c){_0x347e31=_(_0x347e31)[_0x0fa6('0x85')](_0x75b3c)[_0x0fa6('0x86')]()[_0x0fa6('0x87')]();return db[_0x0fa6('0x49')]['find']({'where':{'id':_0x51eab4[_0x0fa6('0x4f')]['id']}})[_0x0fa6('0x2d')](function(_0x1c502d){return db[_0x0fa6('0x6d')][_0x0fa6('0x6e')](function(_0x587f55){return _0x1c502d['removeTeams'](_0x51eab4[_0x0fa6('0x3a')][_0x0fa6('0x68')],{'transaction':_0x587f55})[_0x0fa6('0x2d')](function(){if(!_[_0x0fa6('0x88')](_0x347e31)){return _0x1c502d['removeAgents'](_0x347e31,{'transaction':_0x587f55});}})[_0x0fa6('0x2d')](function(){_0x347e31['forEach'](function(_0x254e1a){socket[_0x0fa6('0x71')](_0x0fa6('0x89'),{'UserId':_0x254e1a,'SmsQueueId':_0x1c502d['id']});});});});});});})[_0x0fa6('0x2d')](respondWithStatusCode(_0x31f8e9,null))[_0x0fa6('0x4d')](handleError(_0x31f8e9,null));};exports[_0x0fa6('0x8a')]=function(_0x507aad,_0x26fba4,_0x38578b){return db[_0x0fa6('0x49')][_0x0fa6('0x50')]({'where':{'id':_0x507aad[_0x0fa6('0x4f')]['id']}})[_0x0fa6('0x2d')](handleEntityNotFound(_0x26fba4,null))[_0x0fa6('0x2d')](function(_0xa69b7d){if(_0xa69b7d){return _0xa69b7d['addAgents'](_0x507aad[_0x0fa6('0x52')]['ids'],_[_0x0fa6('0x8b')](_0x507aad[_0x0fa6('0x52')],[_0x0fa6('0x68'),'id'])||{})[_0x0fa6('0x8c')](function(_0x3d5e4a){for(var _0x2c28f4=0x0;_0x2c28f4<_0x507aad[_0x0fa6('0x52')][_0x0fa6('0x68')][_0x0fa6('0x3f')];_0x2c28f4+=0x1){socket[_0x0fa6('0x71')]('userSmsQueue:save',{'UserId':Number(_0x507aad[_0x0fa6('0x52')]['ids'][_0x2c28f4]),'SmsQueueId':Number(_0x507aad[_0x0fa6('0x4f')]['id'])});}return _0x3d5e4a;});}})['then'](respondWithResult(_0x26fba4,null))[_0x0fa6('0x4d')](handleError(_0x26fba4,null));};exports[_0x0fa6('0x8d')]=function(_0x240772,_0x1fcd45,_0x3fd30e){return db[_0x0fa6('0x49')][_0x0fa6('0x50')]({'where':{'id':_0x240772[_0x0fa6('0x4f')]['id']}})[_0x0fa6('0x2d')](handleEntityNotFound(_0x1fcd45,null))[_0x0fa6('0x2d')](function(_0x48501b){if(_0x48501b){return _0x48501b[_0x0fa6('0x8d')](_0x240772[_0x0fa6('0x3a')][_0x0fa6('0x68')])[_0x0fa6('0x2d')](function(){if(_[_0x0fa6('0x8e')](_0x240772[_0x0fa6('0x3a')]['ids'])){for(var _0x2205f8=0x0;_0x2205f8<_0x240772[_0x0fa6('0x3a')]['ids'][_0x0fa6('0x3f')];_0x2205f8+=0x1){socket[_0x0fa6('0x71')](_0x0fa6('0x89'),{'UserId':Number(_0x240772[_0x0fa6('0x3a')][_0x0fa6('0x68')][_0x2205f8]),'SmsQueueId':Number(_0x240772[_0x0fa6('0x4f')]['id'])});}}else{socket[_0x0fa6('0x71')](_0x0fa6('0x89'),{'UserId':Number(_0x240772[_0x0fa6('0x3a')][_0x0fa6('0x68')]),'SmsQueueId':Number(_0x240772[_0x0fa6('0x4f')]['id'])});}});}})[_0x0fa6('0x2d')](respondWithStatusCode(_0x1fcd45,null))[_0x0fa6('0x4d')](handleError(_0x1fcd45,null));};exports[_0x0fa6('0x8f')]=function(_0x586004,_0x2ef04a,_0x6b1a66){var _0xe5f0b7={};var _0x214075={};var _0x481826;var _0x4d3077;return db[_0x0fa6('0x49')]['findOne']({'where':{'id':_0x586004['params']['id']}})['then'](handleEntityNotFound(_0x2ef04a,null))['then'](function(_0x24383e){if(_0x24383e){_0x481826=_0x24383e;_0x214075[_0x0fa6('0x39')]=_[_0x0fa6('0x3b')](db[_0x0fa6('0x69')][_0x0fa6('0x37')]);_0x214075[_0x0fa6('0x3a')]=_['keys'](_0x586004[_0x0fa6('0x3a')]);_0x214075[_0x0fa6('0x44')]=_[_0x0fa6('0x3d')](_0x214075[_0x0fa6('0x39')],_0x214075[_0x0fa6('0x3a')]);_0xe5f0b7[_0x0fa6('0x3c')]=_[_0x0fa6('0x3d')](_0x214075[_0x0fa6('0x39')],qs[_0x0fa6('0x3e')](_0x586004['query']['fields']));_0xe5f0b7[_0x0fa6('0x3c')]=_0xe5f0b7[_0x0fa6('0x3c')]['length']?_0xe5f0b7[_0x0fa6('0x3c')]:_0x214075[_0x0fa6('0x39')];_0xe5f0b7[_0x0fa6('0x41')]=qs[_0x0fa6('0x42')](_0x586004[_0x0fa6('0x3a')][_0x0fa6('0x42')]);_0xe5f0b7['where']=qs[_0x0fa6('0x44')](_[_0x0fa6('0x45')](_0x586004[_0x0fa6('0x3a')],_0x214075[_0x0fa6('0x44')]));if(_0x586004[_0x0fa6('0x3a')][_0x0fa6('0x46')]){_0xe5f0b7['where']=_[_0x0fa6('0x47')](_0xe5f0b7[_0x0fa6('0x43')],{'$or':_[_0x0fa6('0x36')](_0xe5f0b7[_0x0fa6('0x3c')],function(_0x2e0e44){var _0x371eb5={};_0x371eb5[_0x2e0e44]={'$like':'%'+_0x586004[_0x0fa6('0x3a')][_0x0fa6('0x46')]+'%'};return _0x371eb5;})});}_0xe5f0b7=_[_0x0fa6('0x47')]({},_0xe5f0b7,_0x586004[_0x0fa6('0x48')]);return _0x481826['getAgents'](_0xe5f0b7);}})[_0x0fa6('0x2d')](function(_0x4f1ce8){if(_0x4f1ce8){_0x4d3077=_0x4f1ce8['length'];if(!_0x586004[_0x0fa6('0x3a')][_0x0fa6('0x40')](_0x0fa6('0x67'))){_0xe5f0b7[_0x0fa6('0x26')]=qs[_0x0fa6('0x26')](_0x586004[_0x0fa6('0x3a')][_0x0fa6('0x26')]);_0xe5f0b7[_0x0fa6('0x29')]=qs['offset'](_0x586004[_0x0fa6('0x3a')][_0x0fa6('0x29')]);}return _0x481826[_0x0fa6('0x8f')](_0xe5f0b7);}})[_0x0fa6('0x2d')](function(_0x21bf02){if(_0x21bf02){return _0x21bf02?{'count':_0x4d3077,'rows':_0x21bf02}:null;}})[_0x0fa6('0x2d')](respondWithResult(_0x2ef04a,null))['catch'](handleError(_0x2ef04a,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 4c6216b..6aab28c 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 _0x7de8=['hasOwnProperty','../../mysqldb','save','update','emit'];(function(_0x390c3d,_0x12eb7f){var _0x1d0ed6=function(_0x9d3ecf){while(--_0x9d3ecf){_0x390c3d['push'](_0x390c3d['shift']());}};_0x1d0ed6(++_0x12eb7f);}(_0x7de8,0x65));var _0x87de=function(_0x4953de,_0x2fc556){_0x4953de=_0x4953de-0x0;var _0x4d205c=_0x7de8[_0x4953de];return _0x4d205c;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x87de('0x0'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x87de('0x1'),'afterUpdate':_0x87de('0x2'),'afterDestroy':'remove'};function emitEvent(_0x481fce){return function(_0xd2d5dd,_0x5aa98f,_0x3d987a){SmsQueueEvents['emit'](_0x481fce+':'+_0xd2d5dd['id'],_0xd2d5dd);SmsQueueEvents[_0x87de('0x3')](_0x481fce,_0xd2d5dd);_0x3d987a(null);};}for(var e in events){if(events[_0x87de('0x4')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0x95a0=['events','../../mysqldb','SmsQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x95a0,0x117));var _0x095a=function(_0x24a503,_0x962807){_0x24a503=_0x24a503-0x0;var _0x36665f=_0x95a0[_0x24a503];return _0x36665f;};'use strict';var EventEmitter=require(_0x095a('0x0'));var SmsQueue=require(_0x095a('0x1'))['db'][_0x095a('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x095a('0x3')](0x0);var events={'afterCreate':_0x095a('0x4'),'afterUpdate':'update','afterDestroy':_0x095a('0x5')};function emitEvent(_0x5533b3){return function(_0x5c0320,_0x457d60,_0x5c63cd){SmsQueueEvents[_0x095a('0x6')](_0x5533b3+':'+_0x5c0320['id'],_0x5c0320);SmsQueueEvents[_0x095a('0x6')](_0x5533b3,_0x5c0320);_0x5c63cd(null);};}for(var e in events){if(events[_0x095a('0x7')](e)){var event=events[e];SmsQueue[_0x095a('0x8')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 323ed5f..d526d15 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 _0xd344=['request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','sms_queues','util','../../config/logger','api','bluebird'];(function(_0x4db304,_0x4b3135){var _0x532e98=function(_0x29716c){while(--_0x29716c){_0x4db304['push'](_0x4db304['shift']());}};_0x532e98(++_0x4b3135);}(_0xd344,0x140));var _0x4d34=function(_0x2d4d3e,_0x4b0cab){_0x2d4d3e=_0x2d4d3e-0x0;var _0x1bc076=_0xd344[_0x2d4d3e];return _0x1bc076;};'use strict';var _=require('lodash');var util=require(_0x4d34('0x0'));var logger=require(_0x4d34('0x1'))(_0x4d34('0x2'));var moment=require('moment');var BPromise=require(_0x4d34('0x3'));var rp=require(_0x4d34('0x4'));var fs=require('fs');var path=require(_0x4d34('0x5'));var rimraf=require(_0x4d34('0x6'));var config=require(_0x4d34('0x7'));var attributes=require(_0x4d34('0x8'));module[_0x4d34('0x9')]=function(_0x55816a,_0x9ae685){return _0x55816a[_0x4d34('0xa')]('SmsQueue',attributes,{'tableName':_0x4d34('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf17b=['sms_queues','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./smsQueue.attributes','exports','define'];(function(_0x3474df,_0x152105){var _0x32c9fc=function(_0xefd2a3){while(--_0xefd2a3){_0x3474df['push'](_0x3474df['shift']());}};_0x32c9fc(++_0x152105);}(_0xf17b,0x114));var _0xbf17=function(_0x5a036c,_0x23e229){_0x5a036c=_0x5a036c-0x0;var _0x1ced2f=_0xf17b[_0x5a036c];return _0x1ced2f;};'use strict';var _=require(_0xbf17('0x0'));var util=require(_0xbf17('0x1'));var logger=require('../../config/logger')(_0xbf17('0x2'));var moment=require(_0xbf17('0x3'));var BPromise=require('bluebird');var rp=require(_0xbf17('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf17('0x5'));var config=require(_0xbf17('0x6'));var attributes=require(_0xbf17('0x7'));module[_0xbf17('0x8')]=function(_0x197dc3,_0x5ae3f6){return _0x197dc3[_0xbf17('0x9')]('SmsQueue',attributes,{'tableName':_0xbf17('0xa'),'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 52638e9..dd7c122 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 _0x305a=['socket.io-emitter','./smsQueue.socket','register','request','then','info','debug','request\x20sent','stringify','error','SmsQueue,\x20%s,\x20%s','message','catch','GetSmsQueue','findAll','options','where','attributes','limit','include','map','model','SmsQueue','find','raw','ShowSmsQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x5ebee2,_0x4b3d05){var _0x4a3b7e=function(_0x477464){while(--_0x477464){_0x5ebee2['push'](_0x5ebee2['shift']());}};_0x4a3b7e(++_0x4b3d05);}(_0x305a,0x140));var _0xa305=function(_0x2e749d,_0x352114){_0x2e749d=_0x2e749d-0x0;var _0x2626c0=_0x305a[_0x2e749d];return _0x2626c0;};'use strict';var _=require(_0xa305('0x0'));var util=require(_0xa305('0x1'));var moment=require('moment');var BPromise=require(_0xa305('0x2'));var rs=require(_0xa305('0x3'));var fs=require('fs');var Redis=require(_0xa305('0x4'));var db=require(_0xa305('0x5'))['db'];var utils=require(_0xa305('0x6'));var logger=require(_0xa305('0x7'))(_0xa305('0x8'));var config=require(_0xa305('0x9'));var jayson=require(_0xa305('0xa'));var client=jayson[_0xa305('0xb')][_0xa305('0xc')]({'port':0x232a});config[_0xa305('0xd')]=_[_0xa305('0xe')](config['redis'],{'host':_0xa305('0xf'),'port':0x18eb});var socket=require(_0xa305('0x10'))(new Redis(config[_0xa305('0xd')]));require(_0xa305('0x11'))[_0xa305('0x12')](socket);function respondWithRpcPromise(_0xb1272f,_0x2e7ca1,_0x14ec1e){return new BPromise(function(_0x2aef08,_0x311aad){return client[_0xa305('0x13')](_0xb1272f,_0x14ec1e)[_0xa305('0x14')](function(_0x3b818c){logger[_0xa305('0x15')]('SmsQueue,\x20%s,\x20%s',_0x2e7ca1,'request\x20sent');logger[_0xa305('0x16')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x2e7ca1,_0xa305('0x17'),JSON[_0xa305('0x18')](_0x3b818c));if(_0x3b818c['error']){if(_0x3b818c[_0xa305('0x19')]['code']===0x1f4){logger[_0xa305('0x19')](_0xa305('0x1a'),_0x2e7ca1,_0x3b818c['error'][_0xa305('0x1b')]);return _0x311aad(_0x3b818c[_0xa305('0x19')][_0xa305('0x1b')]);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x2e7ca1,_0x3b818c[_0xa305('0x19')][_0xa305('0x1b')]);return _0x2aef08(_0x3b818c[_0xa305('0x19')][_0xa305('0x1b')]);}else{logger[_0xa305('0x15')](_0xa305('0x1a'),_0x2e7ca1,_0xa305('0x17'));_0x2aef08(_0x3b818c['result'][_0xa305('0x1b')]);}})[_0xa305('0x1c')](function(_0xf11517){logger[_0xa305('0x19')](_0xa305('0x1a'),_0x2e7ca1,_0xf11517);_0x311aad(_0xf11517);});});}exports[_0xa305('0x1d')]=function(_0x13805c){var _0x5d54d5=this;return new Promise(function(_0x144e68,_0x29ec29){return db['SmsQueue'][_0xa305('0x1e')]({'raw':_0x13805c[_0xa305('0x1f')]?_0x13805c[_0xa305('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x13805c[_0xa305('0x1f')]?_0x13805c['options'][_0xa305('0x20')]||null:null,'attributes':_0x13805c['options']?_0x13805c[_0xa305('0x1f')][_0xa305('0x21')]||null:null,'limit':_0x13805c[_0xa305('0x1f')]?_0x13805c[_0xa305('0x1f')][_0xa305('0x22')]||null:null,'include':_0x13805c[_0xa305('0x1f')]?_0x13805c[_0xa305('0x1f')][_0xa305('0x23')]?_[_0xa305('0x24')](_0x13805c['options'][_0xa305('0x23')],function(_0x545bfc){return{'model':db[_0x545bfc[_0xa305('0x25')]],'as':_0x545bfc['as'],'attributes':_0x545bfc[_0xa305('0x21')],'include':_0x545bfc[_0xa305('0x23')]?_[_0xa305('0x24')](_0x545bfc[_0xa305('0x23')],function(_0x14a717){return{'model':db[_0x14a717[_0xa305('0x25')]],'as':_0x14a717['as'],'attributes':_0x14a717['attributes'],'include':_0x14a717['include']?_[_0xa305('0x24')](_0x14a717[_0xa305('0x23')],function(_0x237350){return{'model':db[_0x237350[_0xa305('0x25')]],'as':_0x237350['as'],'attributes':_0x237350['attributes']};}):[]};}):[]};}):[]:[]})[_0xa305('0x14')](function(_0x931b42){logger[_0xa305('0x15')](_0xa305('0x1d'),_0x13805c);logger['debug']('GetSmsQueue',_0x13805c,JSON['stringify'](_0x931b42));_0x144e68(_0x931b42);})[_0xa305('0x1c')](function(_0x34b585){logger['error']('GetSmsQueue',_0x34b585[_0xa305('0x1b')],_0x13805c);_0x29ec29(_0x5d54d5[_0xa305('0x19')](0x1f4,_0x34b585[_0xa305('0x1b')]));});});};exports['ShowSmsQueue']=function(_0x18a02c){var _0x59ff56=this;return new Promise(function(_0x22157a,_0x2dc856){return db[_0xa305('0x26')][_0xa305('0x27')]({'raw':_0x18a02c[_0xa305('0x1f')]?_0x18a02c[_0xa305('0x1f')][_0xa305('0x28')]===undefined?!![]:![]:!![],'where':_0x18a02c[_0xa305('0x1f')]?_0x18a02c[_0xa305('0x1f')][_0xa305('0x20')]||null:null,'attributes':_0x18a02c['options']?_0x18a02c['options'][_0xa305('0x21')]||null:null,'include':_0x18a02c['options']?_0x18a02c[_0xa305('0x1f')]['include']?_['map'](_0x18a02c[_0xa305('0x1f')]['include'],function(_0x499a41){return{'model':db[_0x499a41['model']],'as':_0x499a41['as'],'attributes':_0x499a41[_0xa305('0x21')],'include':_0x499a41['include']?_[_0xa305('0x24')](_0x499a41[_0xa305('0x23')],function(_0x1141c1){return{'model':db[_0x1141c1[_0xa305('0x25')]],'as':_0x1141c1['as'],'attributes':_0x1141c1[_0xa305('0x21')],'include':_0x1141c1[_0xa305('0x23')]?_['map'](_0x1141c1[_0xa305('0x23')],function(_0x5ddd6c){return{'model':db[_0x5ddd6c[_0xa305('0x25')]],'as':_0x5ddd6c['as'],'attributes':_0x5ddd6c['attributes']};}):[]};}):[]};}):[]:[]})[_0xa305('0x14')](function(_0x4deecf){logger[_0xa305('0x15')](_0xa305('0x29'),_0x18a02c);logger[_0xa305('0x16')](_0xa305('0x29'),_0x18a02c,JSON[_0xa305('0x18')](_0x4deecf));_0x22157a(_0x4deecf);})[_0xa305('0x1c')](function(_0x256baa){logger[_0xa305('0x19')](_0xa305('0x29'),_0x256baa['message'],_0x18a02c);_0x2dc856(_0x59ff56[_0xa305('0x19')](0x1f4,_0x256baa[_0xa305('0x1b')]));});});}; \ No newline at end of file +var _0xc49a=['../../config/environment','client','http','redis','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','SmsQueue','findAll','options','raw','limit','include','model','map','attributes','debug','GetSmsQueue','catch','ShowSmsQueue','find','where','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x13a944,_0xd32881){var _0x12f02e=function(_0x4cbc76){while(--_0x4cbc76){_0x13a944['push'](_0x13a944['shift']());}};_0x12f02e(++_0xd32881);}(_0xc49a,0x14f));var _0xac49=function(_0x1f82e8,_0x9c594a){_0x1f82e8=_0x1f82e8-0x0;var _0x50e425=_0xc49a[_0x1f82e8];return _0x50e425;};'use strict';var _=require('lodash');var util=require(_0xac49('0x0'));var moment=require('moment');var BPromise=require(_0xac49('0x1'));var rs=require(_0xac49('0x2'));var fs=require('fs');var Redis=require(_0xac49('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xac49('0x4'));var logger=require(_0xac49('0x5'))(_0xac49('0x6'));var config=require(_0xac49('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xac49('0x8')][_0xac49('0x9')]({'port':0x232a});config[_0xac49('0xa')]=_['defaults'](config[_0xac49('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xac49('0xb'))[_0xac49('0xc')](socket);function respondWithRpcPromise(_0x110a03,_0x2c74b8,_0x261e02){return new BPromise(function(_0x1b1d5e,_0x131247){return client[_0xac49('0xd')](_0x110a03,_0x261e02)[_0xac49('0xe')](function(_0x19923d){logger[_0xac49('0xf')](_0xac49('0x10'),_0x2c74b8,_0xac49('0x11'));logger['debug'](_0xac49('0x12'),_0x2c74b8,_0xac49('0x11'),JSON[_0xac49('0x13')](_0x19923d));if(_0x19923d[_0xac49('0x14')]){if(_0x19923d[_0xac49('0x14')]['code']===0x1f4){logger['error'](_0xac49('0x10'),_0x2c74b8,_0x19923d['error']['message']);return _0x131247(_0x19923d[_0xac49('0x14')][_0xac49('0x15')]);}logger[_0xac49('0x14')](_0xac49('0x10'),_0x2c74b8,_0x19923d[_0xac49('0x14')]['message']);return _0x1b1d5e(_0x19923d[_0xac49('0x14')]['message']);}else{logger[_0xac49('0xf')]('SmsQueue,\x20%s,\x20%s',_0x2c74b8,_0xac49('0x11'));_0x1b1d5e(_0x19923d[_0xac49('0x16')][_0xac49('0x15')]);}})['catch'](function(_0x575ba7){logger[_0xac49('0x14')]('SmsQueue,\x20%s,\x20%s',_0x2c74b8,_0x575ba7);_0x131247(_0x575ba7);});});}exports['GetSmsQueue']=function(_0x3a9227){var _0x1f2dcc=this;return new Promise(function(_0x207e88,_0x36182d){return db[_0xac49('0x17')][_0xac49('0x18')]({'raw':_0x3a9227[_0xac49('0x19')]?_0x3a9227[_0xac49('0x19')][_0xac49('0x1a')]===undefined?!![]:![]:!![],'where':_0x3a9227['options']?_0x3a9227[_0xac49('0x19')]['where']||null:null,'attributes':_0x3a9227[_0xac49('0x19')]?_0x3a9227[_0xac49('0x19')]['attributes']||null:null,'limit':_0x3a9227[_0xac49('0x19')]?_0x3a9227['options'][_0xac49('0x1b')]||null:null,'include':_0x3a9227['options']?_0x3a9227[_0xac49('0x19')][_0xac49('0x1c')]?_['map'](_0x3a9227[_0xac49('0x19')]['include'],function(_0xf56727){return{'model':db[_0xf56727[_0xac49('0x1d')]],'as':_0xf56727['as'],'attributes':_0xf56727['attributes'],'include':_0xf56727[_0xac49('0x1c')]?_[_0xac49('0x1e')](_0xf56727[_0xac49('0x1c')],function(_0x187a28){return{'model':db[_0x187a28['model']],'as':_0x187a28['as'],'attributes':_0x187a28[_0xac49('0x1f')],'include':_0x187a28['include']?_[_0xac49('0x1e')](_0x187a28[_0xac49('0x1c')],function(_0x173473){return{'model':db[_0x173473[_0xac49('0x1d')]],'as':_0x173473['as'],'attributes':_0x173473[_0xac49('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xac49('0xe')](function(_0x374570){logger['info']('GetSmsQueue',_0x3a9227);logger[_0xac49('0x20')](_0xac49('0x21'),_0x3a9227,JSON['stringify'](_0x374570));_0x207e88(_0x374570);})[_0xac49('0x22')](function(_0x5be470){logger[_0xac49('0x14')]('GetSmsQueue',_0x5be470[_0xac49('0x15')],_0x3a9227);_0x36182d(_0x1f2dcc[_0xac49('0x14')](0x1f4,_0x5be470[_0xac49('0x15')]));});});};exports[_0xac49('0x23')]=function(_0x18d14a){var _0x427352=this;return new Promise(function(_0x3179d4,_0x52ed01){return db[_0xac49('0x17')][_0xac49('0x24')]({'raw':_0x18d14a[_0xac49('0x19')]?_0x18d14a[_0xac49('0x19')][_0xac49('0x1a')]===undefined?!![]:![]:!![],'where':_0x18d14a['options']?_0x18d14a[_0xac49('0x19')][_0xac49('0x25')]||null:null,'attributes':_0x18d14a['options']?_0x18d14a[_0xac49('0x19')][_0xac49('0x1f')]||null:null,'include':_0x18d14a[_0xac49('0x19')]?_0x18d14a[_0xac49('0x19')][_0xac49('0x1c')]?_[_0xac49('0x1e')](_0x18d14a[_0xac49('0x19')][_0xac49('0x1c')],function(_0x39932c){return{'model':db[_0x39932c[_0xac49('0x1d')]],'as':_0x39932c['as'],'attributes':_0x39932c[_0xac49('0x1f')],'include':_0x39932c['include']?_[_0xac49('0x1e')](_0x39932c[_0xac49('0x1c')],function(_0x1d9723){return{'model':db[_0x1d9723[_0xac49('0x1d')]],'as':_0x1d9723['as'],'attributes':_0x1d9723['attributes'],'include':_0x1d9723[_0xac49('0x1c')]?_['map'](_0x1d9723[_0xac49('0x1c')],function(_0x2c2d1c){return{'model':db[_0x2c2d1c[_0xac49('0x1d')]],'as':_0x2c2d1c['as'],'attributes':_0x2c2d1c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x14e860){logger[_0xac49('0xf')]('ShowSmsQueue',_0x18d14a);logger[_0xac49('0x20')](_0xac49('0x23'),_0x18d14a,JSON['stringify'](_0x14e860));_0x3179d4(_0x14e860);})[_0xac49('0x22')](function(_0x36e61a){logger[_0xac49('0x14')](_0xac49('0x23'),_0x36e61a[_0xac49('0x15')],_0x18d14a);_0x52ed01(_0x427352['error'](0x1f4,_0x36e61a[_0xac49('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 919b7ff..580ae86 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 _0xee50=['./smsQueue.events','remove','update','removeListener','register'];(function(_0x3f7598,_0x212e37){var _0x51fb16=function(_0x4a5c0b){while(--_0x4a5c0b){_0x3f7598['push'](_0x3f7598['shift']());}};_0x51fb16(++_0x212e37);}(_0xee50,0xa5));var _0x0ee5=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xee50[_0x2d2c16];return _0x53f2fb;};'use strict';var SmsQueueEvents=require(_0x0ee5('0x0'));var events=['save',_0x0ee5('0x1'),_0x0ee5('0x2')];function createListener(_0x3b7aa1,_0x169599){return function(_0x169e96){_0x169599['emit'](_0x3b7aa1,_0x169e96);};}function removeListener(_0x211828,_0x35c808){return function(){SmsQueueEvents[_0x0ee5('0x3')](_0x211828,_0x35c808);};}exports[_0x0ee5('0x4')]=function(_0x560119){for(var _0x57fb0d=0x0,_0x323383=events['length'];_0x57fb0d<_0x323383;_0x57fb0d++){var _0x16e249=events[_0x57fb0d];var _0x1f97e2=createListener('smsQueue:'+_0x16e249,_0x560119);SmsQueueEvents['on'](_0x16e249,_0x1f97e2);}}; \ No newline at end of file +var _0x7a79=['length','smsQueue:','./smsQueue.events','update','emit','removeListener','register'];(function(_0x4b824f,_0x183c5f){var _0x34baae=function(_0x377bf0){while(--_0x377bf0){_0x4b824f['push'](_0x4b824f['shift']());}};_0x34baae(++_0x183c5f);}(_0x7a79,0xf0));var _0x97a7=function(_0x2de0ec,_0x38812f){_0x2de0ec=_0x2de0ec-0x0;var _0x13aa7b=_0x7a79[_0x2de0ec];return _0x13aa7b;};'use strict';var SmsQueueEvents=require(_0x97a7('0x0'));var events=['save','remove',_0x97a7('0x1')];function createListener(_0x17dca5,_0x2c7160){return function(_0x33b6ce){_0x2c7160[_0x97a7('0x2')](_0x17dca5,_0x33b6ce);};}function removeListener(_0xa36151,_0x308950){return function(){SmsQueueEvents[_0x97a7('0x3')](_0xa36151,_0x308950);};}exports[_0x97a7('0x4')]=function(_0xbdc440){for(var _0x333d97=0x0,_0x1b4cfa=events[_0x97a7('0x5')];_0x333d97<_0x1b4cfa;_0x333d97++){var _0x5927ce=events[_0x333d97];var _0x582587=createListener(_0x97a7('0x6')+_0x5927ce,_0xbdc440);SmsQueueEvents['on'](_0x5927ce,_0x582587);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 6776127..95c6a0a 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 _0xd61f=['/describe','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','index'];(function(_0x56174f,_0x379cba){var _0x4d4418=function(_0x39b987){while(--_0x39b987){_0x56174f['push'](_0x56174f['shift']());}};_0x4d4418(++_0x379cba);}(_0xd61f,0x113));var _0xfd61=function(_0x166936,_0x49a95c){_0x166936=_0x166936-0x0;var _0xf2276b=_0xd61f[_0x166936];return _0xf2276b;};'use strict';var multer=require(_0xfd61('0x0'));var util=require(_0xfd61('0x1'));var path=require(_0xfd61('0x2'));var timeout=require('connect-timeout');var express=require(_0xfd61('0x3'));var router=express[_0xfd61('0x4')]();var fs_extra=require(_0xfd61('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfd61('0x6'));var config=require(_0xfd61('0x7'));var controller=require(_0xfd61('0x8'));router[_0xfd61('0x9')]('/',auth['isAuthenticated'](),controller[_0xfd61('0xa')]);router[_0xfd61('0x9')](_0xfd61('0xb'),auth[_0xfd61('0xc')](),controller[_0xfd61('0xd')]);router['get'](_0xfd61('0xe'),auth[_0xfd61('0xc')](),controller['show']);router[_0xfd61('0xf')]('/',auth[_0xfd61('0xc')](),controller[_0xfd61('0x10')]);router[_0xfd61('0x11')](_0xfd61('0xe'),auth[_0xfd61('0xc')](),controller[_0xfd61('0x12')]);router[_0xfd61('0x13')](_0xfd61('0xe'),auth[_0xfd61('0xc')](),controller[_0xfd61('0x14')]);module[_0xfd61('0x15')]=router; \ No newline at end of file +var _0x8d0a=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','isAuthenticated','index','get','/describe','/:id','create','update','delete','destroy'];(function(_0x494095,_0x38a4cc){var _0x5718d4=function(_0x2ac506){while(--_0x2ac506){_0x494095['push'](_0x494095['shift']());}};_0x5718d4(++_0x38a4cc);}(_0x8d0a,0x65));var _0xa8d0=function(_0xb9039c,_0x2a20ef){_0xb9039c=_0xb9039c-0x0;var _0x540a6c=_0x8d0a[_0xb9039c];return _0x540a6c;};'use strict';var multer=require(_0xa8d0('0x0'));var util=require('util');var path=require(_0xa8d0('0x1'));var timeout=require(_0xa8d0('0x2'));var express=require(_0xa8d0('0x3'));var router=express[_0xa8d0('0x4')]();var fs_extra=require(_0xa8d0('0x5'));var auth=require(_0xa8d0('0x6'));var interaction=require(_0xa8d0('0x7'));var config=require(_0xa8d0('0x8'));var controller=require(_0xa8d0('0x9'));router['get']('/',auth[_0xa8d0('0xa')](),controller[_0xa8d0('0xb')]);router[_0xa8d0('0xc')](_0xa8d0('0xd'),auth[_0xa8d0('0xa')](),controller['describe']);router['get'](_0xa8d0('0xe'),auth[_0xa8d0('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xa8d0('0xf')]);router['put'](_0xa8d0('0xe'),auth[_0xa8d0('0xa')](),controller[_0xa8d0('0x10')]);router[_0xa8d0('0x11')](_0xa8d0('0xe'),auth[_0xa8d0('0xa')](),controller[_0xa8d0('0x12')]);module[_0xa8d0('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 642e311..394b646 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 _0xa72e=['moment','sequelize','STRING','DATE'];(function(_0x1608d0,_0x3a92f6){var _0x457961=function(_0x24ae08){while(--_0x24ae08){_0x1608d0['push'](_0x1608d0['shift']());}};_0x457961(++_0x3a92f6);}(_0xa72e,0xa4));var _0xea72=function(_0x270ea5,_0x454e78){_0x270ea5=_0x270ea5-0x0;var _0x1bafe8=_0xa72e[_0x270ea5];return _0x1bafe8;};'use strict';var moment=require(_0xea72('0x0'));var Sequelize=require(_0xea72('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xea72('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xea72('0x2')]},'joinAt':{'type':Sequelize[_0xea72('0x3')]},'leaveAt':{'type':Sequelize[_0xea72('0x3')]},'acceptAt':{'type':Sequelize[_0xea72('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xea72('0x2')]}}; \ No newline at end of file +var _0x4b33=['STRING','DATE','moment','exports'];(function(_0x1c5fdf,_0x505431){var _0x39ce10=function(_0x1c32ed){while(--_0x1c32ed){_0x1c5fdf['push'](_0x1c5fdf['shift']());}};_0x39ce10(++_0x505431);}(_0x4b33,0x142));var _0x34b3=function(_0x346d89,_0x5230ea){_0x346d89=_0x346d89-0x0;var _0x4ba912=_0x4b33[_0x346d89];return _0x4ba912;};'use strict';var moment=require(_0x34b3('0x0'));var Sequelize=require('sequelize');module[_0x34b3('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x34b3('0x2')]},'joinAt':{'type':Sequelize[_0x34b3('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x34b3('0x3')]},'exitAt':{'type':Sequelize[_0x34b3('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 10a7b44..ff4e164 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 _0x03cc=['save','update','then','destroy','end','sendStatus','error','stack','name','send','map','SmsQueueReport','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','catch','params','length','find','create','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply'];(function(_0x244fae,_0x37b6ae){var _0x55519e=function(_0x4bb470){while(--_0x4bb470){_0x244fae['push'](_0x244fae['shift']());}};_0x55519e(++_0x37b6ae);}(_0x03cc,0x150));var _0xc03c=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x03cc[_0x21549c];return _0x426cbd;};'use strict';var emlformat=require(_0xc03c('0x0'));var rimraf=require(_0xc03c('0x1'));var zipdir=require(_0xc03c('0x2'));var jsonpatch=require(_0xc03c('0x3'));var rp=require(_0xc03c('0x4'));var moment=require(_0xc03c('0x5'));var BPromise=require(_0xc03c('0x6'));var Mustache=require(_0xc03c('0x7'));var util=require('util');var path=require(_0xc03c('0x8'));var sox=require('sox');var csv=require(_0xc03c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc03c('0xa'));var squel=require(_0xc03c('0xb'));var crypto=require(_0xc03c('0xc'));var jsforce=require(_0xc03c('0xd'));var deskjs=require(_0xc03c('0xe'));var toCsv=require(_0xc03c('0x9'));var querystring=require(_0xc03c('0xf'));var Papa=require('papaparse');var Redis=require(_0xc03c('0x10'));var authService=require(_0xc03c('0x11'));var qs=require(_0xc03c('0x12'));var as=require(_0xc03c('0x13'));var hardwareService=require(_0xc03c('0x14'));var logger=require(_0xc03c('0x15'))(_0xc03c('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc03c('0x17'));var db=require(_0xc03c('0x18'))['db'];function respondWithStatusCode(_0x41688c,_0x9d2afc){_0x9d2afc=_0x9d2afc||0xcc;return function(_0x150aff){if(_0x150aff){return _0x41688c['sendStatus'](_0x9d2afc);}return _0x41688c[_0xc03c('0x19')](_0x9d2afc)['end']();};}function respondWithResult(_0x1e5f1d,_0xfb6b2c){_0xfb6b2c=_0xfb6b2c||0xc8;return function(_0x2e48ff){if(_0x2e48ff){return _0x1e5f1d[_0xc03c('0x19')](_0xfb6b2c)[_0xc03c('0x1a')](_0x2e48ff);}};}function respondWithFilteredResult(_0x5032c8,_0x2b385f){return function(_0x3e244b){if(_0x3e244b){var _0x57f97e=typeof _0x2b385f[_0xc03c('0x1b')]==='undefined'&&typeof _0x2b385f[_0xc03c('0x1c')]===_0xc03c('0x1d');var _0x17ad07=_0x3e244b[_0xc03c('0x1e')];var _0x473e78=_0x57f97e?0x0:_0x2b385f[_0xc03c('0x1b')];var _0x2d2b2e=_0x57f97e?_0x3e244b[_0xc03c('0x1e')]:_0x2b385f[_0xc03c('0x1b')]+_0x2b385f[_0xc03c('0x1c')];var _0x173659;if(_0x2d2b2e>=_0x17ad07){_0x2d2b2e=_0x17ad07;_0x173659=0xc8;}else{_0x173659=0xce;}_0x5032c8[_0xc03c('0x19')](_0x173659);return _0x5032c8[_0xc03c('0x1f')](_0xc03c('0x20'),_0x473e78+'-'+_0x2d2b2e+'/'+_0x17ad07)[_0xc03c('0x1a')](_0x3e244b);}return null;};}function patchUpdates(_0x2f56bf){return function(_0x438b8){try{jsonpatch[_0xc03c('0x21')](_0x438b8,_0x2f56bf,!![]);}catch(_0x4b283a){return BPromise['reject'](_0x4b283a);}return _0x438b8[_0xc03c('0x22')]();};}function saveUpdates(_0x719158,_0x19c51e){return function(_0x533b4c){if(_0x533b4c){return _0x533b4c[_0xc03c('0x23')](_0x719158)[_0xc03c('0x24')](function(_0x248643){return _0x248643;});}return null;};}function removeEntity(_0x7a01a6,_0x387572){return function(_0x149c60){if(_0x149c60){return _0x149c60[_0xc03c('0x25')]()[_0xc03c('0x24')](function(){_0x7a01a6[_0xc03c('0x19')](0xcc)[_0xc03c('0x26')]();});}};}function handleEntityNotFound(_0x116f19,_0xa2dbad){return function(_0x28904a){if(!_0x28904a){_0x116f19[_0xc03c('0x27')](0x194);}return _0x28904a;};}function handleError(_0x4347f0,_0x1bbb90){_0x1bbb90=_0x1bbb90||0x1f4;return function(_0xab7c48){logger[_0xc03c('0x28')](_0xab7c48[_0xc03c('0x29')]);if(_0xab7c48[_0xc03c('0x2a')]){delete _0xab7c48[_0xc03c('0x2a')];}_0x4347f0[_0xc03c('0x19')](_0x1bbb90)[_0xc03c('0x2b')](_0xab7c48);};}exports['index']=function(_0x4d824c,_0xd89251){var _0x3d285f={},_0xb9de46={},_0x4c82de={'count':0x0,'rows':[]};var _0x22ac9f=_[_0xc03c('0x2c')](db[_0xc03c('0x2d')][_0xc03c('0x2e')],function(_0x4d5cae){return{'name':_0x4d5cae['fieldName'],'type':_0x4d5cae[_0xc03c('0x2f')][_0xc03c('0x30')]};});_0xb9de46[_0xc03c('0x31')]=_[_0xc03c('0x2c')](_0x22ac9f,_0xc03c('0x2a'));_0xb9de46[_0xc03c('0x32')]=_[_0xc03c('0x33')](_0x4d824c[_0xc03c('0x32')]);_0xb9de46['filters']=_[_0xc03c('0x34')](_0xb9de46['model'],_0xb9de46['query']);_0x3d285f[_0xc03c('0x35')]=_['intersection'](_0xb9de46[_0xc03c('0x31')],qs[_0xc03c('0x36')](_0x4d824c[_0xc03c('0x32')]['fields']));_0x3d285f[_0xc03c('0x35')]=_0x3d285f[_0xc03c('0x35')]['length']?_0x3d285f['attributes']:_0xb9de46[_0xc03c('0x31')];if(!_0x4d824c[_0xc03c('0x32')][_0xc03c('0x37')](_0xc03c('0x38'))){_0x3d285f[_0xc03c('0x1c')]=qs[_0xc03c('0x1c')](_0x4d824c['query'][_0xc03c('0x1c')]);_0x3d285f[_0xc03c('0x1b')]=qs[_0xc03c('0x1b')](_0x4d824c[_0xc03c('0x32')]['offset']);}_0x3d285f[_0xc03c('0x39')]=qs[_0xc03c('0x3a')](_0x4d824c[_0xc03c('0x32')][_0xc03c('0x3a')]);_0x3d285f[_0xc03c('0x3b')]=qs['filters'](_[_0xc03c('0x3c')](_0x4d824c[_0xc03c('0x32')],_0xb9de46[_0xc03c('0x3d')]),_0x22ac9f);if(_0x4d824c[_0xc03c('0x32')][_0xc03c('0x3e')]){_0x3d285f[_0xc03c('0x3b')]=_[_0xc03c('0x3f')](_0x3d285f[_0xc03c('0x3b')],{'$or':_[_0xc03c('0x2c')](_0x22ac9f,function(_0x1b490a){if(_0x1b490a[_0xc03c('0x2f')]!==_0xc03c('0x40')){var _0x5be74a={};_0x5be74a[_0x1b490a[_0xc03c('0x2a')]]={'$like':'%'+_0x4d824c[_0xc03c('0x32')]['filter']+'%'};return _0x5be74a;}})});}_0x3d285f=_[_0xc03c('0x3f')]({},_0x3d285f,_0x4d824c[_0xc03c('0x41')]);var _0x5730cd={'where':_0x3d285f[_0xc03c('0x3b')]};return db[_0xc03c('0x2d')][_0xc03c('0x1e')](_0x5730cd)[_0xc03c('0x24')](function(_0x32c64b){_0x4c82de[_0xc03c('0x1e')]=_0x32c64b;if(_0x4d824c[_0xc03c('0x32')][_0xc03c('0x42')]){_0x3d285f[_0xc03c('0x43')]=[{'all':!![]}];}return db['SmsQueueReport']['findAll'](_0x3d285f);})[_0xc03c('0x24')](function(_0x14de5b){_0x4c82de['rows']=_0x14de5b;return _0x4c82de;})[_0xc03c('0x24')](respondWithFilteredResult(_0xd89251,_0x3d285f))[_0xc03c('0x44')](handleError(_0xd89251,null));};exports['show']=function(_0x2fefbc,_0x31657d){var _0x573667={'raw':!![],'where':{'id':_0x2fefbc[_0xc03c('0x45')]['id']}},_0x28a539={};_0x28a539['model']=_['keys'](db[_0xc03c('0x2d')]['rawAttributes']);_0x28a539['query']=_[_0xc03c('0x33')](_0x2fefbc[_0xc03c('0x32')]);_0x28a539[_0xc03c('0x3d')]=_['intersection'](_0x28a539[_0xc03c('0x31')],_0x28a539[_0xc03c('0x32')]);_0x573667[_0xc03c('0x35')]=_[_0xc03c('0x34')](_0x28a539['model'],qs[_0xc03c('0x36')](_0x2fefbc[_0xc03c('0x32')][_0xc03c('0x36')]));_0x573667['attributes']=_0x573667[_0xc03c('0x35')][_0xc03c('0x46')]?_0x573667[_0xc03c('0x35')]:_0x28a539['model'];if(_0x2fefbc[_0xc03c('0x32')]['includeAll']){_0x573667[_0xc03c('0x43')]=[{'all':!![]}];}_0x573667=_[_0xc03c('0x3f')]({},_0x573667,_0x2fefbc[_0xc03c('0x41')]);return db['SmsQueueReport'][_0xc03c('0x47')](_0x573667)[_0xc03c('0x24')](handleEntityNotFound(_0x31657d,null))['then'](respondWithResult(_0x31657d,null))[_0xc03c('0x44')](handleError(_0x31657d,null));};exports['create']=function(_0x17d574,_0x43eef3){return db[_0xc03c('0x2d')][_0xc03c('0x48')](_0x17d574['body'],{})[_0xc03c('0x24')](respondWithResult(_0x43eef3,0xc9))[_0xc03c('0x44')](handleError(_0x43eef3,null));};exports[_0xc03c('0x23')]=function(_0x1cba2e,_0x581081){if(_0x1cba2e['body']['id']){delete _0x1cba2e['body']['id'];}return db[_0xc03c('0x2d')][_0xc03c('0x47')]({'where':{'id':_0x1cba2e[_0xc03c('0x45')]['id']}})[_0xc03c('0x24')](handleEntityNotFound(_0x581081,null))[_0xc03c('0x24')](saveUpdates(_0x1cba2e['body'],null))[_0xc03c('0x24')](respondWithResult(_0x581081,null))['catch'](handleError(_0x581081,null));};exports[_0xc03c('0x25')]=function(_0x462d2f,_0x3f09fa){return db[_0xc03c('0x2d')][_0xc03c('0x47')]({'where':{'id':_0x462d2f[_0xc03c('0x45')]['id']}})['then'](handleEntityNotFound(_0x3f09fa,null))['then'](removeEntity(_0x3f09fa,null))[_0xc03c('0x44')](handleError(_0x3f09fa,null));};exports[_0xc03c('0x49')]=function(_0x4a6f24,_0x258ebf){return db[_0xc03c('0x2d')][_0xc03c('0x49')]()[_0xc03c('0x24')](respondWithResult(_0x258ebf,null))[_0xc03c('0x44')](handleError(_0x258ebf,null));}; \ No newline at end of file +var _0x039e=['limit','set','Content-Range','apply','then','stack','name','index','SmsQueueReport','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','show','fields','include','catch','create','body','update','params','find','describe','eml-format','rimraf','zip-dir','moment','bluebird','util','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count'];(function(_0x1ae6e1,_0x4d9622){var _0x1773be=function(_0x2b9c0f){while(--_0x2b9c0f){_0x1ae6e1['push'](_0x1ae6e1['shift']());}};_0x1773be(++_0x4d9622);}(_0x039e,0x6e));var _0xe039=function(_0xad2294,_0x3664a6){_0xad2294=_0xad2294-0x0;var _0x1d4ae4=_0x039e[_0xad2294];return _0x1d4ae4;};'use strict';var emlformat=require(_0xe039('0x0'));var rimraf=require(_0xe039('0x1'));var zipdir=require(_0xe039('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe039('0x3'));var BPromise=require(_0xe039('0x4'));var Mustache=require('mustache');var util=require(_0xe039('0x5'));var path=require('path');var sox=require(_0xe039('0x6'));var csv=require(_0xe039('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe039('0x8'));var _=require('lodash');var squel=require(_0xe039('0x9'));var crypto=require(_0xe039('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe039('0xb'));var toCsv=require(_0xe039('0x7'));var querystring=require(_0xe039('0xc'));var Papa=require(_0xe039('0xd'));var Redis=require(_0xe039('0xe'));var authService=require(_0xe039('0xf'));var qs=require(_0xe039('0x10'));var as=require(_0xe039('0x11'));var hardwareService=require(_0xe039('0x12'));var logger=require(_0xe039('0x13'))(_0xe039('0x14'));var utils=require('../../config/utils');var config=require(_0xe039('0x15'));var licenseUtil=require(_0xe039('0x16'));var db=require(_0xe039('0x17'))['db'];function respondWithStatusCode(_0x228e47,_0x4b802e){_0x4b802e=_0x4b802e||0xcc;return function(_0x11dc66){if(_0x11dc66){return _0x228e47[_0xe039('0x18')](_0x4b802e);}return _0x228e47[_0xe039('0x19')](_0x4b802e)[_0xe039('0x1a')]();};}function respondWithResult(_0x56c329,_0x25768f){_0x25768f=_0x25768f||0xc8;return function(_0x2be5b9){if(_0x2be5b9){return _0x56c329[_0xe039('0x19')](_0x25768f)['json'](_0x2be5b9);}};}function respondWithFilteredResult(_0x106d6e,_0x1cd80a){return function(_0x888e0b){if(_0x888e0b){var _0x2f265d=typeof _0x1cd80a[_0xe039('0x1b')]===_0xe039('0x1c')&&typeof _0x1cd80a['limit']==='undefined';var _0x58b9cb=_0x888e0b[_0xe039('0x1d')];var _0x39f7e6=_0x2f265d?0x0:_0x1cd80a['offset'];var _0x4bdc34=_0x2f265d?_0x888e0b[_0xe039('0x1d')]:_0x1cd80a[_0xe039('0x1b')]+_0x1cd80a[_0xe039('0x1e')];var _0x3ef696;if(_0x4bdc34>=_0x58b9cb){_0x4bdc34=_0x58b9cb;_0x3ef696=0xc8;}else{_0x3ef696=0xce;}_0x106d6e[_0xe039('0x19')](_0x3ef696);return _0x106d6e[_0xe039('0x1f')](_0xe039('0x20'),_0x39f7e6+'-'+_0x4bdc34+'/'+_0x58b9cb)['json'](_0x888e0b);}return null;};}function patchUpdates(_0x8c7de1){return function(_0x2a1ab4){try{jsonpatch[_0xe039('0x21')](_0x2a1ab4,_0x8c7de1,!![]);}catch(_0x2703df){return BPromise['reject'](_0x2703df);}return _0x2a1ab4['save']();};}function saveUpdates(_0x34f42b,_0xdede28){return function(_0x53e317){if(_0x53e317){return _0x53e317['update'](_0x34f42b)['then'](function(_0x5d9bb7){return _0x5d9bb7;});}return null;};}function removeEntity(_0x16047f,_0x3533ee){return function(_0x40e9ca){if(_0x40e9ca){return _0x40e9ca['destroy']()[_0xe039('0x22')](function(){_0x16047f[_0xe039('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24cd49,_0x5ea39c){return function(_0x226994){if(!_0x226994){_0x24cd49[_0xe039('0x18')](0x194);}return _0x226994;};}function handleError(_0x5f0f5c,_0x44539f){_0x44539f=_0x44539f||0x1f4;return function(_0x201390){logger['error'](_0x201390[_0xe039('0x23')]);if(_0x201390[_0xe039('0x24')]){delete _0x201390[_0xe039('0x24')];}_0x5f0f5c['status'](_0x44539f)['send'](_0x201390);};}exports[_0xe039('0x25')]=function(_0x41008f,_0x594ea1){var _0x29d47e={},_0x21b870={},_0x50aa2f={'count':0x0,'rows':[]};var _0x402a97=_['map'](db[_0xe039('0x26')][_0xe039('0x27')],function(_0x560090){return{'name':_0x560090[_0xe039('0x28')],'type':_0x560090[_0xe039('0x29')][_0xe039('0x2a')]};});_0x21b870['model']=_[_0xe039('0x2b')](_0x402a97,_0xe039('0x24'));_0x21b870[_0xe039('0x2c')]=_[_0xe039('0x2d')](_0x41008f[_0xe039('0x2c')]);_0x21b870['filters']=_[_0xe039('0x2e')](_0x21b870[_0xe039('0x2f')],_0x21b870[_0xe039('0x2c')]);_0x29d47e['attributes']=_[_0xe039('0x2e')](_0x21b870[_0xe039('0x2f')],qs['fields'](_0x41008f[_0xe039('0x2c')]['fields']));_0x29d47e[_0xe039('0x30')]=_0x29d47e[_0xe039('0x30')][_0xe039('0x31')]?_0x29d47e[_0xe039('0x30')]:_0x21b870[_0xe039('0x2f')];if(!_0x41008f[_0xe039('0x2c')]['hasOwnProperty'](_0xe039('0x32'))){_0x29d47e[_0xe039('0x1e')]=qs[_0xe039('0x1e')](_0x41008f['query']['limit']);_0x29d47e[_0xe039('0x1b')]=qs[_0xe039('0x1b')](_0x41008f[_0xe039('0x2c')][_0xe039('0x1b')]);}_0x29d47e[_0xe039('0x33')]=qs[_0xe039('0x34')](_0x41008f[_0xe039('0x2c')][_0xe039('0x34')]);_0x29d47e[_0xe039('0x35')]=qs[_0xe039('0x36')](_[_0xe039('0x37')](_0x41008f[_0xe039('0x2c')],_0x21b870[_0xe039('0x36')]),_0x402a97);if(_0x41008f[_0xe039('0x2c')][_0xe039('0x38')]){_0x29d47e[_0xe039('0x35')]=_[_0xe039('0x39')](_0x29d47e[_0xe039('0x35')],{'$or':_['map'](_0x402a97,function(_0x3f6df5){if(_0x3f6df5[_0xe039('0x29')]!=='VIRTUAL'){var _0x3d2d48={};_0x3d2d48[_0x3f6df5[_0xe039('0x24')]]={'$like':'%'+_0x41008f[_0xe039('0x2c')][_0xe039('0x38')]+'%'};return _0x3d2d48;}})});}_0x29d47e=_[_0xe039('0x39')]({},_0x29d47e,_0x41008f[_0xe039('0x3a')]);var _0x5d497b={'where':_0x29d47e[_0xe039('0x35')]};return db['SmsQueueReport']['count'](_0x5d497b)[_0xe039('0x22')](function(_0x4447bb){_0x50aa2f['count']=_0x4447bb;if(_0x41008f[_0xe039('0x2c')][_0xe039('0x3b')]){_0x29d47e['include']=[{'all':!![]}];}return db[_0xe039('0x26')]['findAll'](_0x29d47e);})[_0xe039('0x22')](function(_0x587b9f){_0x50aa2f['rows']=_0x587b9f;return _0x50aa2f;})[_0xe039('0x22')](respondWithFilteredResult(_0x594ea1,_0x29d47e))['catch'](handleError(_0x594ea1,null));};exports[_0xe039('0x3c')]=function(_0x53fefc,_0x476258){var _0x4d5b47={'raw':!![],'where':{'id':_0x53fefc['params']['id']}},_0x39e7a1={};_0x39e7a1[_0xe039('0x2f')]=_[_0xe039('0x2d')](db['SmsQueueReport'][_0xe039('0x27')]);_0x39e7a1[_0xe039('0x2c')]=_[_0xe039('0x2d')](_0x53fefc[_0xe039('0x2c')]);_0x39e7a1[_0xe039('0x36')]=_[_0xe039('0x2e')](_0x39e7a1[_0xe039('0x2f')],_0x39e7a1[_0xe039('0x2c')]);_0x4d5b47[_0xe039('0x30')]=_[_0xe039('0x2e')](_0x39e7a1[_0xe039('0x2f')],qs['fields'](_0x53fefc['query'][_0xe039('0x3d')]));_0x4d5b47[_0xe039('0x30')]=_0x4d5b47[_0xe039('0x30')][_0xe039('0x31')]?_0x4d5b47[_0xe039('0x30')]:_0x39e7a1[_0xe039('0x2f')];if(_0x53fefc[_0xe039('0x2c')]['includeAll']){_0x4d5b47[_0xe039('0x3e')]=[{'all':!![]}];}_0x4d5b47=_['merge']({},_0x4d5b47,_0x53fefc['options']);return db['SmsQueueReport']['find'](_0x4d5b47)[_0xe039('0x22')](handleEntityNotFound(_0x476258,null))[_0xe039('0x22')](respondWithResult(_0x476258,null))[_0xe039('0x3f')](handleError(_0x476258,null));};exports[_0xe039('0x40')]=function(_0x373c67,_0x3ee377){return db[_0xe039('0x26')]['create'](_0x373c67[_0xe039('0x41')],{})['then'](respondWithResult(_0x3ee377,0xc9))[_0xe039('0x3f')](handleError(_0x3ee377,null));};exports[_0xe039('0x42')]=function(_0x501d4d,_0x239024){if(_0x501d4d['body']['id']){delete _0x501d4d[_0xe039('0x41')]['id'];}return db['SmsQueueReport']['find']({'where':{'id':_0x501d4d[_0xe039('0x43')]['id']}})[_0xe039('0x22')](handleEntityNotFound(_0x239024,null))[_0xe039('0x22')](saveUpdates(_0x501d4d[_0xe039('0x41')],null))[_0xe039('0x22')](respondWithResult(_0x239024,null))[_0xe039('0x3f')](handleError(_0x239024,null));};exports['destroy']=function(_0x58b601,_0x54dc3f){return db[_0xe039('0x26')][_0xe039('0x44')]({'where':{'id':_0x58b601[_0xe039('0x43')]['id']}})[_0xe039('0x22')](handleEntityNotFound(_0x54dc3f,null))[_0xe039('0x22')](removeEntity(_0x54dc3f,null))[_0xe039('0x3f')](handleError(_0x54dc3f,null));};exports[_0xe039('0x45')]=function(_0x1ebbc1,_0x499f03){return db[_0xe039('0x26')]['describe']()[_0xe039('0x22')](respondWithResult(_0x499f03,null))[_0xe039('0x3f')](handleError(_0x499f03,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 7e1f9fa..8a87c35 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 _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x371ebc,_0x21689a){var _0x51ba5b=function(_0x38912a){while(--_0x38912a){_0x371ebc['push'](_0x371ebc['shift']());}};_0x51ba5b(++_0x21689a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1e9424,_0x191cba){_0x1e9424=_0x1e9424-0x0;var _0x1bd96c=_0xcb91[_0x1e9424];return _0x1bd96c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x59f75b,_0x17ebd){var _0x2e1ca2=function(_0x65496e){while(--_0x65496e){_0x59f75b['push'](_0x59f75b['shift']());}};_0x2e1ca2(++_0x17ebd);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 348bcd7..8296c21 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 _0xb08e=['SmsQueueReport','create','catch','update','options','raw','where','attributes','limit','UpdateSmsQueueReport','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','CreateSmsQueueReport'];(function(_0xca3472,_0x3c8309){var _0x4195cd=function(_0x5cba0b){while(--_0x5cba0b){_0xca3472['push'](_0xca3472['shift']());}};_0x4195cd(++_0x3c8309);}(_0xb08e,0x1c5));var _0xeb08=function(_0x567cdc,_0x2b36d5){_0x567cdc=_0x567cdc-0x0;var _0x243f69=_0xb08e[_0x567cdc];return _0x243f69;};'use strict';var _=require(_0xeb08('0x0'));var util=require(_0xeb08('0x1'));var moment=require(_0xeb08('0x2'));var BPromise=require(_0xeb08('0x3'));var rs=require(_0xeb08('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeb08('0x5'))['db'];var utils=require(_0xeb08('0x6'));var logger=require(_0xeb08('0x7'))(_0xeb08('0x8'));var config=require(_0xeb08('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeb08('0xa')][_0xeb08('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x520ce8,_0x4d7935,_0x4d332d){return new BPromise(function(_0x41f890,_0x35e02a){return client['request'](_0x520ce8,_0x4d332d)[_0xeb08('0xc')](function(_0x5a1111){logger['info'](_0xeb08('0xd'),_0x4d7935,'request\x20sent');logger[_0xeb08('0xe')](_0xeb08('0xf'),_0x4d7935,_0xeb08('0x10'),JSON['stringify'](_0x5a1111));if(_0x5a1111[_0xeb08('0x11')]){if(_0x5a1111[_0xeb08('0x11')][_0xeb08('0x12')]===0x1f4){logger[_0xeb08('0x11')](_0xeb08('0xd'),_0x4d7935,_0x5a1111[_0xeb08('0x11')][_0xeb08('0x13')]);return _0x35e02a(_0x5a1111[_0xeb08('0x11')]['message']);}logger[_0xeb08('0x11')](_0xeb08('0xd'),_0x4d7935,_0x5a1111['error'][_0xeb08('0x13')]);return _0x41f890(_0x5a1111[_0xeb08('0x11')][_0xeb08('0x13')]);}else{logger[_0xeb08('0x14')](_0xeb08('0xd'),_0x4d7935,_0xeb08('0x10'));_0x41f890(_0x5a1111[_0xeb08('0x15')]['message']);}})['catch'](function(_0x143a9c){logger[_0xeb08('0x11')](_0xeb08('0xd'),_0x4d7935,_0x143a9c);_0x35e02a(_0x143a9c);});});}exports[_0xeb08('0x16')]=function(_0x34b63a){var _0x1a29b7=this;return new Promise(function(_0xe19215,_0x3153e5){return db[_0xeb08('0x17')][_0xeb08('0x18')](_0x34b63a['body'],{'raw':_0x34b63a['options']?_0x34b63a['options']['raw']===undefined?!![]:![]:!![]})[_0xeb08('0xc')](function(_0x1323e6){logger[_0xeb08('0x14')]('CreateSmsQueueReport',_0x34b63a);logger[_0xeb08('0xe')](_0xeb08('0x16'),_0x34b63a,JSON['stringify'](_0x1323e6));_0xe19215(_0x1323e6);})[_0xeb08('0x19')](function(_0x4bc6d9){logger[_0xeb08('0x11')]('CreateSmsQueueReport',_0x4bc6d9[_0xeb08('0x13')],_0x34b63a);_0x3153e5(_0x1a29b7[_0xeb08('0x11')](0x1f4,_0x4bc6d9[_0xeb08('0x13')]));});});};exports['UpdateSmsQueueReport']=function(_0xa909ac){var _0x3e3c7d=this;return new Promise(function(_0x3a2d07,_0xa5ec24){return db[_0xeb08('0x17')][_0xeb08('0x1a')](_0xa909ac['body'],{'raw':_0xa909ac[_0xeb08('0x1b')]?_0xa909ac[_0xeb08('0x1b')][_0xeb08('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa909ac[_0xeb08('0x1b')]?_0xa909ac[_0xeb08('0x1b')][_0xeb08('0x1d')]||null:null,'attributes':_0xa909ac[_0xeb08('0x1b')]?_0xa909ac[_0xeb08('0x1b')][_0xeb08('0x1e')]||null:null,'limit':_0xa909ac[_0xeb08('0x1b')]?_0xa909ac[_0xeb08('0x1b')][_0xeb08('0x1f')]||null:null})['then'](function(_0x2d28c0){logger[_0xeb08('0x14')](_0xeb08('0x20'),_0xa909ac);logger['debug'](_0xeb08('0x20'),_0xa909ac,JSON[_0xeb08('0x21')](_0x2d28c0));_0x3a2d07(_0x2d28c0);})['catch'](function(_0x4ae29b){logger[_0xeb08('0x11')](_0xeb08('0x20'),_0x4ae29b[_0xeb08('0x13')],_0xa909ac);_0xa5ec24(_0x3e3c7d[_0xeb08('0x11')](0x1f4,_0x4ae29b[_0xeb08('0x13')]));});});}; \ No newline at end of file +var _0xc546=['SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSmsQueueReport','SmsQueueReport','create','body','raw','catch','UpdateSmsQueueReport','update','options','where','attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc546,0xa0));var _0x6c54=function(_0x3a8fae,_0x1aa129){_0x3a8fae=_0x3a8fae-0x0;var _0x23cc3e=_0xc546[_0x3a8fae];return _0x23cc3e;};'use strict';var _=require(_0x6c54('0x0'));var util=require(_0x6c54('0x1'));var moment=require(_0x6c54('0x2'));var BPromise=require(_0x6c54('0x3'));var rs=require(_0x6c54('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c54('0x5'))['db'];var utils=require(_0x6c54('0x6'));var logger=require(_0x6c54('0x7'))(_0x6c54('0x8'));var config=require(_0x6c54('0x9'));var jayson=require(_0x6c54('0xa'));var client=jayson['client'][_0x6c54('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x195369,_0x2b799a,_0xa246c7){return new BPromise(function(_0x5d0f83,_0xdd4c18){return client[_0x6c54('0xc')](_0x195369,_0xa246c7)[_0x6c54('0xd')](function(_0x330f5d){logger[_0x6c54('0xe')](_0x6c54('0xf'),_0x2b799a,_0x6c54('0x10'));logger[_0x6c54('0x11')](_0x6c54('0x12'),_0x2b799a,'request\x20sent',JSON[_0x6c54('0x13')](_0x330f5d));if(_0x330f5d[_0x6c54('0x14')]){if(_0x330f5d[_0x6c54('0x14')][_0x6c54('0x15')]===0x1f4){logger[_0x6c54('0x14')](_0x6c54('0xf'),_0x2b799a,_0x330f5d[_0x6c54('0x14')]['message']);return _0xdd4c18(_0x330f5d['error'][_0x6c54('0x16')]);}logger[_0x6c54('0x14')](_0x6c54('0xf'),_0x2b799a,_0x330f5d[_0x6c54('0x14')][_0x6c54('0x16')]);return _0x5d0f83(_0x330f5d['error'][_0x6c54('0x16')]);}else{logger[_0x6c54('0xe')](_0x6c54('0xf'),_0x2b799a,_0x6c54('0x10'));_0x5d0f83(_0x330f5d[_0x6c54('0x17')][_0x6c54('0x16')]);}})['catch'](function(_0x3fd57a){logger[_0x6c54('0x14')](_0x6c54('0xf'),_0x2b799a,_0x3fd57a);_0xdd4c18(_0x3fd57a);});});}exports[_0x6c54('0x18')]=function(_0x315498){var _0x21878c=this;return new Promise(function(_0xba7ddc,_0x1cbd94){return db[_0x6c54('0x19')][_0x6c54('0x1a')](_0x315498[_0x6c54('0x1b')],{'raw':_0x315498['options']?_0x315498['options'][_0x6c54('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x93798d){logger[_0x6c54('0xe')](_0x6c54('0x18'),_0x315498);logger[_0x6c54('0x11')]('CreateSmsQueueReport',_0x315498,JSON['stringify'](_0x93798d));_0xba7ddc(_0x93798d);})[_0x6c54('0x1d')](function(_0x3badb0){logger[_0x6c54('0x14')](_0x6c54('0x18'),_0x3badb0[_0x6c54('0x16')],_0x315498);_0x1cbd94(_0x21878c['error'](0x1f4,_0x3badb0[_0x6c54('0x16')]));});});};exports[_0x6c54('0x1e')]=function(_0x30dc35){var _0xdf70bc=this;return new Promise(function(_0x19bf47,_0x53176b){return db[_0x6c54('0x19')][_0x6c54('0x1f')](_0x30dc35['body'],{'raw':_0x30dc35['options']?_0x30dc35[_0x6c54('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30dc35['options']?_0x30dc35[_0x6c54('0x20')][_0x6c54('0x21')]||null:null,'attributes':_0x30dc35['options']?_0x30dc35[_0x6c54('0x20')][_0x6c54('0x22')]||null:null,'limit':_0x30dc35['options']?_0x30dc35[_0x6c54('0x20')]['limit']||null:null})[_0x6c54('0xd')](function(_0x4d4e0b){logger[_0x6c54('0xe')](_0x6c54('0x1e'),_0x30dc35);logger[_0x6c54('0x11')]('UpdateSmsQueueReport',_0x30dc35,JSON['stringify'](_0x4d4e0b));_0x19bf47(_0x4d4e0b);})[_0x6c54('0x1d')](function(_0x59eac2){logger[_0x6c54('0x14')](_0x6c54('0x1e'),_0x59eac2['message'],_0x30dc35);_0x53176b(_0xdf70bc[_0x6c54('0x14')](0x1f4,_0x59eac2[_0x6c54('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 09667f0..97d4934 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 _0x3c94=['get','index','/describe','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller'];(function(_0x22663b,_0xc8c6e3){var _0x310d0a=function(_0x151e66){while(--_0x151e66){_0x22663b['push'](_0x22663b['shift']());}};_0x310d0a(++_0xc8c6e3);}(_0x3c94,0xcd));var _0x43c9=function(_0xb119da,_0x42d325){_0xb119da=_0xb119da-0x0;var _0x3ecb48=_0x3c94[_0xb119da];return _0x3ecb48;};'use strict';var multer=require(_0x43c9('0x0'));var util=require(_0x43c9('0x1'));var path=require(_0x43c9('0x2'));var timeout=require(_0x43c9('0x3'));var express=require(_0x43c9('0x4'));var router=express[_0x43c9('0x5')]();var fs_extra=require(_0x43c9('0x6'));var auth=require(_0x43c9('0x7'));var interaction=require(_0x43c9('0x8'));var config=require(_0x43c9('0x9'));var controller=require(_0x43c9('0xa'));router[_0x43c9('0xb')]('/',auth['isAuthenticated'](),controller[_0x43c9('0xc')]);router[_0x43c9('0xb')](_0x43c9('0xd'),auth[_0x43c9('0xe')](),controller[_0x43c9('0xf')]);router[_0x43c9('0xb')](_0x43c9('0x10'),auth[_0x43c9('0xe')](),controller[_0x43c9('0x11')]);router['post']('/',auth[_0x43c9('0xe')](),controller[_0x43c9('0x12')]);router[_0x43c9('0x13')](_0x43c9('0x10'),auth[_0x43c9('0xe')](),controller[_0x43c9('0x14')]);router[_0x43c9('0x15')](_0x43c9('0x10'),auth[_0x43c9('0xe')](),controller[_0x43c9('0x16')]);module[_0x43c9('0x17')]=router; \ No newline at end of file +var _0xf3be=['./smsTransferReport.controller','get','index','/describe','isAuthenticated','describe','show','create','put','delete','/:id','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xf3be,0x1e1));var _0xef3b=function(_0x2df809,_0x39413a){_0x2df809=_0x2df809-0x0;var _0x49b0d8=_0xf3be[_0x2df809];return _0x49b0d8;};'use strict';var multer=require(_0xef3b('0x0'));var util=require(_0xef3b('0x1'));var path=require(_0xef3b('0x2'));var timeout=require(_0xef3b('0x3'));var express=require('express');var router=express[_0xef3b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xef3b('0x5'));router[_0xef3b('0x6')]('/',auth['isAuthenticated'](),controller[_0xef3b('0x7')]);router[_0xef3b('0x6')](_0xef3b('0x8'),auth[_0xef3b('0x9')](),controller[_0xef3b('0xa')]);router[_0xef3b('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xef3b('0xb')]);router['post']('/',auth[_0xef3b('0x9')](),controller[_0xef3b('0xc')]);router[_0xef3b('0xd')]('/:id',auth[_0xef3b('0x9')](),controller['update']);router[_0xef3b('0xe')](_0xef3b('0xf'),auth[_0xef3b('0x9')](),controller[_0xef3b('0x10')]);module[_0xef3b('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 40f9e9e..a9ff5db 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x2d1f6e,_0x13fdc7){var _0x421074=function(_0x521ea){while(--_0x521ea){_0x2d1f6e['push'](_0x2d1f6e['shift']());}};_0x421074(++_0x13fdc7);}(_0x54ef,0x112));var _0xf54e=function(_0x2210cf,_0x55ddef){_0x2210cf=_0x2210cf-0x0;var _0x15467a=_0x54ef[_0x2210cf];return _0x15467a;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0xe2d8c4,_0x4e3b34){var _0x5e539a=function(_0x35560e){while(--_0x35560e){_0xe2d8c4['push'](_0xe2d8c4['shift']());}};_0x5e539a(++_0x4e3b34);}(_0x4b84,0x1cc));var _0x44b8=function(_0x2181b1,_0x569637){_0x2181b1=_0x2181b1-0x0;var _0x530548=_0x4b84[_0x2181b1];return _0x530548;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 107c32e..2d25cd0 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 _0x1880=['find','create','body','params','describe','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','end','send','index','map','rawAttributes','fieldName','model','name','keys','filters','query','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','merge','type','options','SmsTransferReport','includeAll','include','findAll','catch'];(function(_0x39f5b6,_0xd12ed7){var _0x15d219=function(_0x87e4ff){while(--_0x87e4ff){_0x39f5b6['push'](_0x39f5b6['shift']());}};_0x15d219(++_0xd12ed7);}(_0x1880,0xcb));var _0x0188=function(_0x3eceb2,_0x509ff8){_0x3eceb2=_0x3eceb2-0x0;var _0x818bc4=_0x1880[_0x3eceb2];return _0x818bc4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0188('0x0'));var BPromise=require(_0x0188('0x1'));var Mustache=require('mustache');var util=require(_0x0188('0x2'));var path=require('path');var sox=require(_0x0188('0x3'));var csv=require(_0x0188('0x4'));var ejs=require(_0x0188('0x5'));var fs=require('fs');var fs_extra=require(_0x0188('0x6'));var _=require('lodash');var squel=require(_0x0188('0x7'));var crypto=require(_0x0188('0x8'));var jsforce=require(_0x0188('0x9'));var deskjs=require(_0x0188('0xa'));var toCsv=require(_0x0188('0x4'));var querystring=require(_0x0188('0xb'));var Papa=require(_0x0188('0xc'));var Redis=require('ioredis');var authService=require(_0x0188('0xd'));var qs=require(_0x0188('0xe'));var as=require(_0x0188('0xf'));var hardwareService=require(_0x0188('0x10'));var logger=require(_0x0188('0x11'))(_0x0188('0x12'));var utils=require('../../config/utils');var config=require(_0x0188('0x13'));var licenseUtil=require(_0x0188('0x14'));var db=require(_0x0188('0x15'))['db'];function respondWithStatusCode(_0x59be39,_0x226d7a){_0x226d7a=_0x226d7a||0xcc;return function(_0x429b64){if(_0x429b64){return _0x59be39[_0x0188('0x16')](_0x226d7a);}return _0x59be39[_0x0188('0x17')](_0x226d7a)['end']();};}function respondWithResult(_0x26a83c,_0x108c32){_0x108c32=_0x108c32||0xc8;return function(_0x196ae9){if(_0x196ae9){return _0x26a83c['status'](_0x108c32)['json'](_0x196ae9);}};}function respondWithFilteredResult(_0x433a11,_0x3889f9){return function(_0x2c9bff){if(_0x2c9bff){var _0x3f879c=typeof _0x3889f9['offset']==='undefined'&&typeof _0x3889f9[_0x0188('0x18')]===_0x0188('0x19');var _0x31e9ff=_0x2c9bff[_0x0188('0x1a')];var _0x227b38=_0x3f879c?0x0:_0x3889f9[_0x0188('0x1b')];var _0x47dffb=_0x3f879c?_0x2c9bff[_0x0188('0x1a')]:_0x3889f9['offset']+_0x3889f9[_0x0188('0x18')];var _0x53a703;if(_0x47dffb>=_0x31e9ff){_0x47dffb=_0x31e9ff;_0x53a703=0xc8;}else{_0x53a703=0xce;}_0x433a11[_0x0188('0x17')](_0x53a703);return _0x433a11['set'](_0x0188('0x1c'),_0x227b38+'-'+_0x47dffb+'/'+_0x31e9ff)['json'](_0x2c9bff);}return null;};}function patchUpdates(_0x2a6a28){return function(_0x42e232){try{jsonpatch[_0x0188('0x1d')](_0x42e232,_0x2a6a28,!![]);}catch(_0xba3ab4){return BPromise[_0x0188('0x1e')](_0xba3ab4);}return _0x42e232[_0x0188('0x1f')]();};}function saveUpdates(_0x353ac0,_0x3f3d50){return function(_0x49172d){if(_0x49172d){return _0x49172d[_0x0188('0x20')](_0x353ac0)[_0x0188('0x21')](function(_0x2abc18){return _0x2abc18;});}return null;};}function removeEntity(_0x230d69,_0x3fee35){return function(_0x383803){if(_0x383803){return _0x383803[_0x0188('0x22')]()[_0x0188('0x21')](function(){_0x230d69[_0x0188('0x17')](0xcc)[_0x0188('0x23')]();});}};}function handleEntityNotFound(_0x2ba21b,_0x379c63){return function(_0x1f9699){if(!_0x1f9699){_0x2ba21b[_0x0188('0x16')](0x194);}return _0x1f9699;};}function handleError(_0xcd9f2e,_0x15d310){_0x15d310=_0x15d310||0x1f4;return function(_0x41e865){logger['error'](_0x41e865['stack']);if(_0x41e865['name']){delete _0x41e865['name'];}_0xcd9f2e[_0x0188('0x17')](_0x15d310)[_0x0188('0x24')](_0x41e865);};}exports[_0x0188('0x25')]=function(_0x321656,_0x52630b){var _0x137e7f={},_0x535b07={},_0x495195={'count':0x0,'rows':[]};var _0x49fb24=_[_0x0188('0x26')](db['SmsTransferReport'][_0x0188('0x27')],function(_0x424d4d){return{'name':_0x424d4d[_0x0188('0x28')],'type':_0x424d4d['type']['key']};});_0x535b07[_0x0188('0x29')]=_[_0x0188('0x26')](_0x49fb24,_0x0188('0x2a'));_0x535b07['query']=_[_0x0188('0x2b')](_0x321656['query']);_0x535b07[_0x0188('0x2c')]=_['intersection'](_0x535b07[_0x0188('0x29')],_0x535b07[_0x0188('0x2d')]);_0x137e7f[_0x0188('0x2e')]=_[_0x0188('0x2f')](_0x535b07[_0x0188('0x29')],qs[_0x0188('0x30')](_0x321656[_0x0188('0x2d')][_0x0188('0x30')]));_0x137e7f[_0x0188('0x2e')]=_0x137e7f[_0x0188('0x2e')]['length']?_0x137e7f[_0x0188('0x2e')]:_0x535b07[_0x0188('0x29')];if(!_0x321656[_0x0188('0x2d')][_0x0188('0x31')](_0x0188('0x32'))){_0x137e7f[_0x0188('0x18')]=qs['limit'](_0x321656['query'][_0x0188('0x18')]);_0x137e7f[_0x0188('0x1b')]=qs['offset'](_0x321656['query'][_0x0188('0x1b')]);}_0x137e7f['order']=qs[_0x0188('0x33')](_0x321656['query'][_0x0188('0x33')]);_0x137e7f[_0x0188('0x34')]=qs[_0x0188('0x2c')](_['pick'](_0x321656[_0x0188('0x2d')],_0x535b07[_0x0188('0x2c')]),_0x49fb24);if(_0x321656[_0x0188('0x2d')]['filter']){_0x137e7f['where']=_[_0x0188('0x35')](_0x137e7f[_0x0188('0x34')],{'$or':_[_0x0188('0x26')](_0x49fb24,function(_0x230b83){if(_0x230b83[_0x0188('0x36')]!=='VIRTUAL'){var _0x30f2ae={};_0x30f2ae[_0x230b83[_0x0188('0x2a')]]={'$like':'%'+_0x321656[_0x0188('0x2d')]['filter']+'%'};return _0x30f2ae;}})});}_0x137e7f=_[_0x0188('0x35')]({},_0x137e7f,_0x321656[_0x0188('0x37')]);var _0x59aaa5={'where':_0x137e7f[_0x0188('0x34')]};return db[_0x0188('0x38')][_0x0188('0x1a')](_0x59aaa5)[_0x0188('0x21')](function(_0x4a5506){_0x495195['count']=_0x4a5506;if(_0x321656[_0x0188('0x2d')][_0x0188('0x39')]){_0x137e7f[_0x0188('0x3a')]=[{'all':!![]}];}return db[_0x0188('0x38')][_0x0188('0x3b')](_0x137e7f);})[_0x0188('0x21')](function(_0x1f9f56){_0x495195['rows']=_0x1f9f56;return _0x495195;})['then'](respondWithFilteredResult(_0x52630b,_0x137e7f))[_0x0188('0x3c')](handleError(_0x52630b,null));};exports['show']=function(_0x507d1e,_0x30f63a){var _0x315b37={'raw':!![],'where':{'id':_0x507d1e['params']['id']}},_0x5b8d45={};_0x5b8d45[_0x0188('0x29')]=_[_0x0188('0x2b')](db[_0x0188('0x38')]['rawAttributes']);_0x5b8d45[_0x0188('0x2d')]=_[_0x0188('0x2b')](_0x507d1e[_0x0188('0x2d')]);_0x5b8d45[_0x0188('0x2c')]=_[_0x0188('0x2f')](_0x5b8d45[_0x0188('0x29')],_0x5b8d45[_0x0188('0x2d')]);_0x315b37[_0x0188('0x2e')]=_[_0x0188('0x2f')](_0x5b8d45['model'],qs[_0x0188('0x30')](_0x507d1e[_0x0188('0x2d')][_0x0188('0x30')]));_0x315b37[_0x0188('0x2e')]=_0x315b37[_0x0188('0x2e')]['length']?_0x315b37[_0x0188('0x2e')]:_0x5b8d45[_0x0188('0x29')];if(_0x507d1e[_0x0188('0x2d')][_0x0188('0x39')]){_0x315b37[_0x0188('0x3a')]=[{'all':!![]}];}_0x315b37=_[_0x0188('0x35')]({},_0x315b37,_0x507d1e[_0x0188('0x37')]);return db['SmsTransferReport'][_0x0188('0x3d')](_0x315b37)[_0x0188('0x21')](handleEntityNotFound(_0x30f63a,null))[_0x0188('0x21')](respondWithResult(_0x30f63a,null))[_0x0188('0x3c')](handleError(_0x30f63a,null));};exports[_0x0188('0x3e')]=function(_0x44c022,_0x4b4fe6){return db['SmsTransferReport']['create'](_0x44c022[_0x0188('0x3f')],{})[_0x0188('0x21')](respondWithResult(_0x4b4fe6,0xc9))[_0x0188('0x3c')](handleError(_0x4b4fe6,null));};exports['update']=function(_0x328a69,_0x115cee){if(_0x328a69[_0x0188('0x3f')]['id']){delete _0x328a69[_0x0188('0x3f')]['id'];}return db[_0x0188('0x38')]['find']({'where':{'id':_0x328a69['params']['id']}})['then'](handleEntityNotFound(_0x115cee,null))[_0x0188('0x21')](saveUpdates(_0x328a69[_0x0188('0x3f')],null))[_0x0188('0x21')](respondWithResult(_0x115cee,null))[_0x0188('0x3c')](handleError(_0x115cee,null));};exports[_0x0188('0x22')]=function(_0x341cfc,_0xc07a38){return db[_0x0188('0x38')]['find']({'where':{'id':_0x341cfc[_0x0188('0x40')]['id']}})['then'](handleEntityNotFound(_0xc07a38,null))['then'](removeEntity(_0xc07a38,null))[_0x0188('0x3c')](handleError(_0xc07a38,null));};exports[_0x0188('0x41')]=function(_0xc05aef,_0x1d0654){return db[_0x0188('0x38')]['describe']()[_0x0188('0x21')](respondWithResult(_0x1d0654,null))[_0x0188('0x3c')](handleError(_0x1d0654,null));}; \ No newline at end of file +var _0xd404=['findAll','rows','then','catch','show','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','update','destroy','error','stack','SmsTransferReport','rawAttributes','fieldName','type','key','map','name','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','include'];(function(_0x529385,_0x5429df){var _0x6830f9=function(_0xf15021){while(--_0xf15021){_0x529385['push'](_0x529385['shift']());}};_0x6830f9(++_0x5429df);}(_0xd404,0x126));var _0x4d40=function(_0x5bf18d,_0x264c55){_0x5bf18d=_0x5bf18d-0x0;var _0x1d6cc0=_0xd404[_0x5bf18d];return _0x1d6cc0;};'use strict';var emlformat=require(_0x4d40('0x0'));var rimraf=require(_0x4d40('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d40('0x2'));var rp=require('request-promise');var moment=require(_0x4d40('0x3'));var BPromise=require(_0x4d40('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4d40('0x5'));var sox=require(_0x4d40('0x6'));var csv=require(_0x4d40('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4d40('0x8'));var _=require(_0x4d40('0x9'));var squel=require(_0x4d40('0xa'));var crypto=require(_0x4d40('0xb'));var jsforce=require(_0x4d40('0xc'));var deskjs=require(_0x4d40('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4d40('0xe'));var Redis=require(_0x4d40('0xf'));var authService=require(_0x4d40('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4d40('0x11'));var hardwareService=require(_0x4d40('0x12'));var logger=require(_0x4d40('0x13'))(_0x4d40('0x14'));var utils=require(_0x4d40('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4d40('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xafa70b,_0xdaa2d){_0xdaa2d=_0xdaa2d||0xcc;return function(_0xf3626b){if(_0xf3626b){return _0xafa70b[_0x4d40('0x17')](_0xdaa2d);}return _0xafa70b['status'](_0xdaa2d)[_0x4d40('0x18')]();};}function respondWithResult(_0x2bab5d,_0x52355d){_0x52355d=_0x52355d||0xc8;return function(_0x561ca9){if(_0x561ca9){return _0x2bab5d[_0x4d40('0x19')](_0x52355d)[_0x4d40('0x1a')](_0x561ca9);}};}function respondWithFilteredResult(_0x255ee1,_0x2312cd){return function(_0x29a9a9){if(_0x29a9a9){var _0x1a0719=typeof _0x2312cd[_0x4d40('0x1b')]==='undefined'&&typeof _0x2312cd[_0x4d40('0x1c')]===_0x4d40('0x1d');var _0x23bb30=_0x29a9a9['count'];var _0x30f4c7=_0x1a0719?0x0:_0x2312cd['offset'];var _0x378f1b=_0x1a0719?_0x29a9a9[_0x4d40('0x1e')]:_0x2312cd['offset']+_0x2312cd[_0x4d40('0x1c')];var _0x2d5e9b;if(_0x378f1b>=_0x23bb30){_0x378f1b=_0x23bb30;_0x2d5e9b=0xc8;}else{_0x2d5e9b=0xce;}_0x255ee1[_0x4d40('0x19')](_0x2d5e9b);return _0x255ee1[_0x4d40('0x1f')]('Content-Range',_0x30f4c7+'-'+_0x378f1b+'/'+_0x23bb30)[_0x4d40('0x1a')](_0x29a9a9);}return null;};}function patchUpdates(_0x7414b0){return function(_0x237ae9){try{jsonpatch[_0x4d40('0x20')](_0x237ae9,_0x7414b0,!![]);}catch(_0x4b56b4){return BPromise['reject'](_0x4b56b4);}return _0x237ae9['save']();};}function saveUpdates(_0x978c48,_0x191974){return function(_0x5e4c21){if(_0x5e4c21){return _0x5e4c21[_0x4d40('0x21')](_0x978c48)['then'](function(_0x4aa45f){return _0x4aa45f;});}return null;};}function removeEntity(_0x10ce50,_0x1e0354){return function(_0x382b23){if(_0x382b23){return _0x382b23[_0x4d40('0x22')]()['then'](function(){_0x10ce50[_0x4d40('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3723ca,_0x48c3ee){return function(_0x4a6871){if(!_0x4a6871){_0x3723ca['sendStatus'](0x194);}return _0x4a6871;};}function handleError(_0x1b0e14,_0x5efe08){_0x5efe08=_0x5efe08||0x1f4;return function(_0x4c85e6){logger[_0x4d40('0x23')](_0x4c85e6[_0x4d40('0x24')]);if(_0x4c85e6['name']){delete _0x4c85e6['name'];}_0x1b0e14[_0x4d40('0x19')](_0x5efe08)['send'](_0x4c85e6);};}exports['index']=function(_0x1faad3,_0x41e403){var _0x129160={},_0x6dcc27={},_0x281610={'count':0x0,'rows':[]};var _0x54ae28=_['map'](db[_0x4d40('0x25')][_0x4d40('0x26')],function(_0x107257){return{'name':_0x107257[_0x4d40('0x27')],'type':_0x107257[_0x4d40('0x28')][_0x4d40('0x29')]};});_0x6dcc27['model']=_[_0x4d40('0x2a')](_0x54ae28,_0x4d40('0x2b'));_0x6dcc27[_0x4d40('0x2c')]=_[_0x4d40('0x2d')](_0x1faad3['query']);_0x6dcc27[_0x4d40('0x2e')]=_[_0x4d40('0x2f')](_0x6dcc27['model'],_0x6dcc27['query']);_0x129160[_0x4d40('0x30')]=_[_0x4d40('0x2f')](_0x6dcc27[_0x4d40('0x31')],qs[_0x4d40('0x32')](_0x1faad3[_0x4d40('0x2c')][_0x4d40('0x32')]));_0x129160[_0x4d40('0x30')]=_0x129160[_0x4d40('0x30')][_0x4d40('0x33')]?_0x129160[_0x4d40('0x30')]:_0x6dcc27[_0x4d40('0x31')];if(!_0x1faad3['query'][_0x4d40('0x34')]('nolimit')){_0x129160['limit']=qs['limit'](_0x1faad3[_0x4d40('0x2c')][_0x4d40('0x1c')]);_0x129160[_0x4d40('0x1b')]=qs[_0x4d40('0x1b')](_0x1faad3[_0x4d40('0x2c')][_0x4d40('0x1b')]);}_0x129160[_0x4d40('0x35')]=qs[_0x4d40('0x36')](_0x1faad3[_0x4d40('0x2c')]['sort']);_0x129160[_0x4d40('0x37')]=qs[_0x4d40('0x2e')](_[_0x4d40('0x38')](_0x1faad3['query'],_0x6dcc27[_0x4d40('0x2e')]),_0x54ae28);if(_0x1faad3[_0x4d40('0x2c')][_0x4d40('0x39')]){_0x129160['where']=_['merge'](_0x129160[_0x4d40('0x37')],{'$or':_[_0x4d40('0x2a')](_0x54ae28,function(_0x3fd877){if(_0x3fd877[_0x4d40('0x28')]!=='VIRTUAL'){var _0x4ebbe0={};_0x4ebbe0[_0x3fd877['name']]={'$like':'%'+_0x1faad3[_0x4d40('0x2c')][_0x4d40('0x39')]+'%'};return _0x4ebbe0;}})});}_0x129160=_[_0x4d40('0x3a')]({},_0x129160,_0x1faad3['options']);var _0x1f0202={'where':_0x129160[_0x4d40('0x37')]};return db['SmsTransferReport'][_0x4d40('0x1e')](_0x1f0202)['then'](function(_0x4f162c){_0x281610[_0x4d40('0x1e')]=_0x4f162c;if(_0x1faad3[_0x4d40('0x2c')][_0x4d40('0x3b')]){_0x129160[_0x4d40('0x3c')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x4d40('0x3d')](_0x129160);})['then'](function(_0x533894){_0x281610[_0x4d40('0x3e')]=_0x533894;return _0x281610;})[_0x4d40('0x3f')](respondWithFilteredResult(_0x41e403,_0x129160))[_0x4d40('0x40')](handleError(_0x41e403,null));};exports[_0x4d40('0x41')]=function(_0x9fefc8,_0x31faf2){var _0x9e010f={'raw':!![],'where':{'id':_0x9fefc8['params']['id']}},_0x5ee676={};_0x5ee676['model']=_['keys'](db[_0x4d40('0x25')]['rawAttributes']);_0x5ee676['query']=_['keys'](_0x9fefc8['query']);_0x5ee676[_0x4d40('0x2e')]=_[_0x4d40('0x2f')](_0x5ee676[_0x4d40('0x31')],_0x5ee676[_0x4d40('0x2c')]);_0x9e010f[_0x4d40('0x30')]=_[_0x4d40('0x2f')](_0x5ee676[_0x4d40('0x31')],qs['fields'](_0x9fefc8[_0x4d40('0x2c')][_0x4d40('0x32')]));_0x9e010f[_0x4d40('0x30')]=_0x9e010f[_0x4d40('0x30')][_0x4d40('0x33')]?_0x9e010f[_0x4d40('0x30')]:_0x5ee676[_0x4d40('0x31')];if(_0x9fefc8['query'][_0x4d40('0x3b')]){_0x9e010f['include']=[{'all':!![]}];}_0x9e010f=_['merge']({},_0x9e010f,_0x9fefc8['options']);return db[_0x4d40('0x25')][_0x4d40('0x42')](_0x9e010f)[_0x4d40('0x3f')](handleEntityNotFound(_0x31faf2,null))['then'](respondWithResult(_0x31faf2,null))[_0x4d40('0x40')](handleError(_0x31faf2,null));};exports['create']=function(_0x4ea444,_0x2fa9c5){return db['SmsTransferReport'][_0x4d40('0x43')](_0x4ea444['body'],{})[_0x4d40('0x3f')](respondWithResult(_0x2fa9c5,0xc9))[_0x4d40('0x40')](handleError(_0x2fa9c5,null));};exports[_0x4d40('0x21')]=function(_0x5b5e38,_0x2795fe){if(_0x5b5e38[_0x4d40('0x44')]['id']){delete _0x5b5e38[_0x4d40('0x44')]['id'];}return db[_0x4d40('0x25')][_0x4d40('0x42')]({'where':{'id':_0x5b5e38[_0x4d40('0x45')]['id']}})[_0x4d40('0x3f')](handleEntityNotFound(_0x2795fe,null))[_0x4d40('0x3f')](saveUpdates(_0x5b5e38[_0x4d40('0x44')],null))['then'](respondWithResult(_0x2795fe,null))[_0x4d40('0x40')](handleError(_0x2795fe,null));};exports['destroy']=function(_0x509c22,_0x2f1306){return db[_0x4d40('0x25')][_0x4d40('0x42')]({'where':{'id':_0x509c22[_0x4d40('0x45')]['id']}})[_0x4d40('0x3f')](handleEntityNotFound(_0x2f1306,null))['then'](removeEntity(_0x2f1306,null))[_0x4d40('0x40')](handleError(_0x2f1306,null));};exports[_0x4d40('0x46')]=function(_0x2c1ff0,_0x70f8ab){return db['SmsTransferReport'][_0x4d40('0x46')]()[_0x4d40('0x3f')](respondWithResult(_0x70f8ab,null))['catch'](handleError(_0x70f8ab,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 48afd70..c26f737 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 _0xf6b3=['request-promise','path','../../config/environment','./smsTransferReport.attributes','SmsTransferReport','report_sms_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird'];(function(_0x315199,_0x148ff6){var _0x5582c3=function(_0x1b5135){while(--_0x1b5135){_0x315199['push'](_0x315199['shift']());}};_0x5582c3(++_0x148ff6);}(_0xf6b3,0x97));var _0x3f6b=function(_0x5c8628,_0x2fc5f5){_0x5c8628=_0x5c8628-0x0;var _0xcbd50e=_0xf6b3[_0x5c8628];return _0xcbd50e;};'use strict';var _=require(_0x3f6b('0x0'));var util=require('util');var logger=require(_0x3f6b('0x1'))(_0x3f6b('0x2'));var moment=require(_0x3f6b('0x3'));var BPromise=require(_0x3f6b('0x4'));var rp=require(_0x3f6b('0x5'));var fs=require('fs');var path=require(_0x3f6b('0x6'));var rimraf=require('rimraf');var config=require(_0x3f6b('0x7'));var attributes=require(_0x3f6b('0x8'));module['exports']=function(_0xdfde01,_0x2f6038){return _0xdfde01['define'](_0x3f6b('0x9'),attributes,{'tableName':_0x3f6b('0xa'),'paranoid':![],'indexes':[{'name':_0x3f6b('0xb'),'fields':[_0x3f6b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4ad3=['moment','bluebird','../../config/environment','exports','define','uniqueid','lodash','util','../../config/logger','api'];(function(_0x2a1a30,_0x214ce2){var _0x126c48=function(_0x1aca27){while(--_0x1aca27){_0x2a1a30['push'](_0x2a1a30['shift']());}};_0x126c48(++_0x214ce2);}(_0x4ad3,0x150));var _0x34ad=function(_0x449b54,_0x3776f3){_0x449b54=_0x449b54-0x0;var _0x32d6b9=_0x4ad3[_0x449b54];return _0x32d6b9;};'use strict';var _=require(_0x34ad('0x0'));var util=require(_0x34ad('0x1'));var logger=require(_0x34ad('0x2'))(_0x34ad('0x3'));var moment=require(_0x34ad('0x4'));var BPromise=require(_0x34ad('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x34ad('0x6'));var attributes=require('./smsTransferReport.attributes');module[_0x34ad('0x7')]=function(_0x3b2317,_0x200d13){return _0x3b2317[_0x34ad('0x8')]('SmsTransferReport',attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x34ad('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 43d69eb..184ebc6 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 _0xd847=['../../config/utils','../../config/logger','rpc','../../config/environment','client','request','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','../../mysqldb'];(function(_0x3d931a,_0x123b44){var _0x21f4af=function(_0x1b7880){while(--_0x1b7880){_0x3d931a['push'](_0x3d931a['shift']());}};_0x21f4af(++_0x123b44);}(_0xd847,0x18a));var _0x7d84=function(_0x253113,_0x278426){_0x253113=_0x253113-0x0;var _0x578c99=_0xd847[_0x253113];return _0x578c99;};'use strict';var _=require(_0x7d84('0x0'));var util=require(_0x7d84('0x1'));var moment=require(_0x7d84('0x2'));var BPromise=require(_0x7d84('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7d84('0x4'))['db'];var utils=require(_0x7d84('0x5'));var logger=require(_0x7d84('0x6'))(_0x7d84('0x7'));var config=require(_0x7d84('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7d84('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c57cd,_0x20ce63,_0x1d6297){return new BPromise(function(_0x32da6d,_0x128ef5){return client[_0x7d84('0xa')](_0x3c57cd,_0x1d6297)['then'](function(_0x1cf0b9){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x20ce63,_0x7d84('0xb'));logger[_0x7d84('0xc')](_0x7d84('0xd'),_0x20ce63,_0x7d84('0xb'),JSON[_0x7d84('0xe')](_0x1cf0b9));if(_0x1cf0b9[_0x7d84('0xf')]){if(_0x1cf0b9[_0x7d84('0xf')][_0x7d84('0x10')]===0x1f4){logger[_0x7d84('0xf')](_0x7d84('0x11'),_0x20ce63,_0x1cf0b9[_0x7d84('0xf')][_0x7d84('0x12')]);return _0x128ef5(_0x1cf0b9[_0x7d84('0xf')][_0x7d84('0x12')]);}logger[_0x7d84('0xf')](_0x7d84('0x11'),_0x20ce63,_0x1cf0b9[_0x7d84('0xf')][_0x7d84('0x12')]);return _0x32da6d(_0x1cf0b9[_0x7d84('0xf')][_0x7d84('0x12')]);}else{logger[_0x7d84('0x13')]('SmsTransferReport,\x20%s,\x20%s',_0x20ce63,_0x7d84('0xb'));_0x32da6d(_0x1cf0b9[_0x7d84('0x14')]['message']);}})['catch'](function(_0x5338ab){logger[_0x7d84('0xf')](_0x7d84('0x11'),_0x20ce63,_0x5338ab);_0x128ef5(_0x5338ab);});});} \ No newline at end of file +var _0xa74a=['code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','then','info','SmsTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x454cf0,_0x191e13){var _0x1ebbf3=function(_0x2d09de){while(--_0x2d09de){_0x454cf0['push'](_0x454cf0['shift']());}};_0x1ebbf3(++_0x191e13);}(_0xa74a,0x66));var _0xaa74=function(_0x20171e,_0x3ab7fe){_0x20171e=_0x20171e-0x0;var _0x27de78=_0xa74a[_0x20171e];return _0x27de78;};'use strict';var _=require(_0xaa74('0x0'));var util=require(_0xaa74('0x1'));var moment=require(_0xaa74('0x2'));var BPromise=require(_0xaa74('0x3'));var rs=require(_0xaa74('0x4'));var fs=require('fs');var Redis=require(_0xaa74('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xaa74('0x6'));var logger=require(_0xaa74('0x7'))(_0xaa74('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaa74('0x9')][_0xaa74('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44002b,_0x3aca05,_0x10e7ce){return new BPromise(function(_0x5a3684,_0x197336){return client['request'](_0x44002b,_0x10e7ce)[_0xaa74('0xb')](function(_0x502005){logger[_0xaa74('0xc')](_0xaa74('0xd'),_0x3aca05,'request\x20sent');logger[_0xaa74('0xe')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x3aca05,_0xaa74('0xf'),JSON[_0xaa74('0x10')](_0x502005));if(_0x502005['error']){if(_0x502005[_0xaa74('0x11')][_0xaa74('0x12')]===0x1f4){logger[_0xaa74('0x11')](_0xaa74('0xd'),_0x3aca05,_0x502005[_0xaa74('0x11')][_0xaa74('0x13')]);return _0x197336(_0x502005[_0xaa74('0x11')][_0xaa74('0x13')]);}logger[_0xaa74('0x11')](_0xaa74('0xd'),_0x3aca05,_0x502005[_0xaa74('0x11')]['message']);return _0x5a3684(_0x502005[_0xaa74('0x11')][_0xaa74('0x13')]);}else{logger['info'](_0xaa74('0xd'),_0x3aca05,'request\x20sent');_0x5a3684(_0x502005['result']['message']);}})['catch'](function(_0xbe83ac){logger[_0xaa74('0x11')](_0xaa74('0xd'),_0x3aca05,_0xbe83ac);_0x197336(_0xbe83ac);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 4ba6863..d3f9455 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 _0xfaf7=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','index','get','/:id','show','/:id/download','download','diskStorage','root','server/files/sounds/original/','originalname','replace','format','basename','extname','now','post','single','file','create','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xfaf7,0x10c));var _0x7faf=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0xfaf7[_0x22b68a];return _0x1ac67a;};'use strict';var multer=require(_0x7faf('0x0'));var util=require(_0x7faf('0x1'));var path=require(_0x7faf('0x2'));var timeout=require(_0x7faf('0x3'));var express=require(_0x7faf('0x4'));var router=express[_0x7faf('0x5')]();var fs_extra=require(_0x7faf('0x6'));var auth=require(_0x7faf('0x7'));var interaction=require(_0x7faf('0x8'));var config=require(_0x7faf('0x9'));var controller=require(_0x7faf('0xa'));router['get']('/',auth[_0x7faf('0xb')](),controller[_0x7faf('0xc')]);router[_0x7faf('0xd')](_0x7faf('0xe'),auth[_0x7faf('0xb')](),controller[_0x7faf('0xf')]);router[_0x7faf('0xd')](_0x7faf('0x10'),auth['isAuthenticated'](),controller[_0x7faf('0x11')]);var upload=multer({'storage':multer[_0x7faf('0x12')]({'destination':function(_0x394782,_0x1fc2f9,_0xc6b24c){_0xc6b24c(null,path['join'](config[_0x7faf('0x13')],_0x7faf('0x14')));},'filename':function(_0x4db96a,_0x18f411,_0x10a42e){_0x18f411[_0x7faf('0x15')]=_0x18f411[_0x7faf('0x15')][_0x7faf('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x10a42e(null,util[_0x7faf('0x17')]('%s-%s%s',path[_0x7faf('0x18')](_0x18f411[_0x7faf('0x15')],path[_0x7faf('0x19')](_0x18f411[_0x7faf('0x15')])),Date[_0x7faf('0x1a')](),path[_0x7faf('0x19')](_0x18f411[_0x7faf('0x15')])));}})});router[_0x7faf('0x1b')]('/',upload[_0x7faf('0x1c')](_0x7faf('0x1d')),controller[_0x7faf('0x1e')]);router['put'](_0x7faf('0xe'),auth[_0x7faf('0xb')](),controller[_0x7faf('0x1f')]);router[_0x7faf('0x20')]('/:id',auth[_0x7faf('0xb')](),controller[_0x7faf('0x20')]);module[_0x7faf('0x21')]=router; \ No newline at end of file +var _0x68ab=['/:id','show','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','extname','post','single','file','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x1eada5,_0x9fa422){var _0x577829=function(_0x21dcb0){while(--_0x21dcb0){_0x1eada5['push'](_0x1eada5['shift']());}};_0x577829(++_0x9fa422);}(_0x68ab,0x77));var _0xb68a=function(_0x22add5,_0x346816){_0x22add5=_0x22add5-0x0;var _0x39c293=_0x68ab[_0x22add5];return _0x39c293;};'use strict';var multer=require(_0xb68a('0x0'));var util=require(_0xb68a('0x1'));var path=require(_0xb68a('0x2'));var timeout=require(_0xb68a('0x3'));var express=require(_0xb68a('0x4'));var router=express[_0xb68a('0x5')]();var fs_extra=require(_0xb68a('0x6'));var auth=require(_0xb68a('0x7'));var interaction=require(_0xb68a('0x8'));var config=require(_0xb68a('0x9'));var controller=require('./sound.controller');router[_0xb68a('0xa')]('/',auth[_0xb68a('0xb')](),controller[_0xb68a('0xc')]);router[_0xb68a('0xa')](_0xb68a('0xd'),auth[_0xb68a('0xb')](),controller[_0xb68a('0xe')]);router['get']('/:id/download',auth[_0xb68a('0xb')](),controller[_0xb68a('0xf')]);var upload=multer({'storage':multer[_0xb68a('0x10')]({'destination':function(_0x11b71a,_0x16602f,_0x4bb9fa){_0x4bb9fa(null,path[_0xb68a('0x11')](config[_0xb68a('0x12')],'server/files/sounds/original/'));},'filename':function(_0x33485b,_0x388167,_0x567400){_0x388167[_0xb68a('0x13')]=_0x388167[_0xb68a('0x13')][_0xb68a('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x567400(null,util[_0xb68a('0x15')](_0xb68a('0x16'),path[_0xb68a('0x17')](_0x388167[_0xb68a('0x13')],path[_0xb68a('0x18')](_0x388167['originalname'])),Date['now'](),path['extname'](_0x388167[_0xb68a('0x13')])));}})});router[_0xb68a('0x19')]('/',upload[_0xb68a('0x1a')](_0xb68a('0x1b')),controller[_0xb68a('0x1c')]);router[_0xb68a('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0xb68a('0x1e')]);router[_0xb68a('0x1f')](_0xb68a('0xd'),auth[_0xb68a('0xb')](),controller[_0xb68a('0x1f')]);module[_0xb68a('0x20')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 7538b63..189f5a9 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 _0xa12b=['INTEGER','FLOAT','sequelize','exports','name','STRING','BIGINT'];(function(_0x26cc16,_0x4c174f){var _0x345e3e=function(_0x14b4f8){while(--_0x14b4f8){_0x26cc16['push'](_0x26cc16['shift']());}};_0x345e3e(++_0x4c174f);}(_0xa12b,0x175));var _0xba12=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa12b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xba12('0x0'));module[_0xba12('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xba12('0x2'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0xba12('0x3')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xba12('0x3')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0xba12('0x4')]},'original_channelCount':{'type':Sequelize[_0xba12('0x5')]},'original_bitRate':{'type':Sequelize[_0xba12('0x4')]},'original_sampleRate':{'type':Sequelize[_0xba12('0x5')]},'converted_format':{'type':Sequelize[_0xba12('0x3')]},'converted_duration':{'type':Sequelize[_0xba12('0x6')]},'converted_sampleCount':{'type':Sequelize[_0xba12('0x4')]},'converted_channelCount':{'type':Sequelize[_0xba12('0x5')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x7d43=['sequelize','exports','STRING','FLOAT','BIGINT','INTEGER'];(function(_0x400672,_0x243a7e){var _0x27ed65=function(_0x350ca9){while(--_0x350ca9){_0x400672['push'](_0x400672['shift']());}};_0x27ed65(++_0x243a7e);}(_0x7d43,0x16e));var _0x37d4=function(_0x47a6f3,_0x2c8947){_0x47a6f3=_0x47a6f3-0x0;var _0xef2dd2=_0x7d43[_0x47a6f3];return _0xef2dd2;};'use strict';var Sequelize=require(_0x37d4('0x0'));module[_0x37d4('0x1')]={'name':{'type':Sequelize[_0x37d4('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x37d4('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x37d4('0x2')]},'original_format':{'type':Sequelize[_0x37d4('0x2')]},'original_duration':{'type':Sequelize[_0x37d4('0x3')]},'original_sampleCount':{'type':Sequelize[_0x37d4('0x4')]},'original_channelCount':{'type':Sequelize[_0x37d4('0x5')]},'original_bitRate':{'type':Sequelize[_0x37d4('0x4')]},'original_sampleRate':{'type':Sequelize[_0x37d4('0x5')]},'converted_format':{'type':Sequelize[_0x37d4('0x2')]},'converted_duration':{'type':Sequelize[_0x37d4('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x37d4('0x4')]},'converted_channelCount':{'type':Sequelize[_0x37d4('0x5')]},'converted_bitRate':{'type':Sequelize[_0x37d4('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x37d4('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 9e0715e..7bfde8a 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 _0x99b9=['includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','download','converted_format','existsSync','join','root','server/files/sounds/converted','ValidationError','format','%s.%s','save_name','create','basename','file','originalname','extname','filename','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','wav','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','0777','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Sounds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','pick','server/files/sounds/original','original_format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','get','UserProfileResource','end','error','name','index','Sound','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options'];(function(_0x1fd551,_0x1111a2){var _0x2cd66a=function(_0x4a112b){while(--_0x4a112b){_0x1fd551['push'](_0x1fd551['shift']());}};_0x2cd66a(++_0x1111a2);}(_0x99b9,0x13b));var _0x999b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x99b9[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x999b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x999b('0x1'));var rp=require(_0x999b('0x2'));var moment=require(_0x999b('0x3'));var BPromise=require(_0x999b('0x4'));var Mustache=require(_0x999b('0x5'));var util=require(_0x999b('0x6'));var path=require(_0x999b('0x7'));var sox=require(_0x999b('0x8'));var csv=require(_0x999b('0x9'));var ejs=require(_0x999b('0xa'));var fs=require('fs');var fs_extra=require(_0x999b('0xb'));var _=require(_0x999b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x999b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x999b('0x9'));var querystring=require(_0x999b('0xe'));var Papa=require(_0x999b('0xf'));var Redis=require(_0x999b('0x10'));var authService=require(_0x999b('0x11'));var qs=require(_0x999b('0x12'));var as=require(_0x999b('0x13'));var hardwareService=require(_0x999b('0x14'));var logger=require(_0x999b('0x15'))('api');var utils=require(_0x999b('0x16'));var config=require(_0x999b('0x17'));var licenseUtil=require(_0x999b('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x174ea7,_0x359a90){_0x359a90=_0x359a90||0xcc;return function(_0x35b5e3){if(_0x35b5e3){return _0x174ea7[_0x999b('0x19')](_0x359a90);}return _0x174ea7[_0x999b('0x1a')](_0x359a90)['end']();};}function respondWithResult(_0xc494ab,_0x598600){_0x598600=_0x598600||0xc8;return function(_0x17daed){if(_0x17daed){return _0xc494ab['status'](_0x598600)['json'](_0x17daed);}};}function respondWithFilteredResult(_0x33eb72,_0x1ba464){return function(_0x34fd1a){if(_0x34fd1a){var _0xf84fb6=typeof _0x1ba464[_0x999b('0x1b')]==='undefined'&&typeof _0x1ba464[_0x999b('0x1c')]==='undefined';var _0x50ce2e=_0x34fd1a[_0x999b('0x1d')];var _0x51c6cb=_0xf84fb6?0x0:_0x1ba464[_0x999b('0x1b')];var _0x575c24=_0xf84fb6?_0x34fd1a[_0x999b('0x1d')]:_0x1ba464[_0x999b('0x1b')]+_0x1ba464[_0x999b('0x1c')];var _0x275e64;if(_0x575c24>=_0x50ce2e){_0x575c24=_0x50ce2e;_0x275e64=0xc8;}else{_0x275e64=0xce;}_0x33eb72[_0x999b('0x1a')](_0x275e64);return _0x33eb72[_0x999b('0x1e')](_0x999b('0x1f'),_0x51c6cb+'-'+_0x575c24+'/'+_0x50ce2e)[_0x999b('0x20')](_0x34fd1a);}return null;};}function patchUpdates(_0x4c6ff6){return function(_0x90b62e){try{jsonpatch[_0x999b('0x21')](_0x90b62e,_0x4c6ff6,!![]);}catch(_0x191671){return BPromise[_0x999b('0x22')](_0x191671);}return _0x90b62e[_0x999b('0x23')]();};}function saveUpdates(_0x40745f,_0x3e1377){return function(_0x5aaf51){if(_0x5aaf51){return _0x5aaf51['update'](_0x40745f)[_0x999b('0x24')](function(_0x31ffc1){return _0x31ffc1;});}return null;};}function removeEntity(_0x4e454a,_0x5b237a){return function(_0xbbd05f){if(_0xbbd05f){return _0xbbd05f[_0x999b('0x25')]()[_0x999b('0x24')](function(){var _0xb75687=_0xbbd05f[_0x999b('0x26')]({'plain':!![]});var _0x1b5036='Sounds';return db[_0x999b('0x27')][_0x999b('0x25')]({'where':{'type':_0x1b5036,'resourceId':_0xb75687['id']}})[_0x999b('0x24')](function(){return _0xbbd05f;});})[_0x999b('0x24')](function(){_0x4e454a[_0x999b('0x1a')](0xcc)[_0x999b('0x28')]();});}};}function handleEntityNotFound(_0x1fb003,_0x55c8ea){return function(_0x170833){if(!_0x170833){_0x1fb003[_0x999b('0x19')](0x194);}return _0x170833;};}function handleError(_0x40b497,_0x391a89){_0x391a89=_0x391a89||0x1f4;return function(_0x4206e8){logger[_0x999b('0x29')](_0x4206e8['stack']);if(_0x4206e8['name']){delete _0x4206e8[_0x999b('0x2a')];}_0x40b497[_0x999b('0x1a')](_0x391a89)['send'](_0x4206e8);};}exports[_0x999b('0x2b')]=function(_0x1d14f1,_0x4f9d5c){var _0x366f97={},_0x3a287d={},_0x2f19a3={'count':0x0,'rows':[]};var _0x2b7e2e=_['map'](db[_0x999b('0x2c')]['rawAttributes'],function(_0x2283e8){return{'name':_0x2283e8[_0x999b('0x2d')],'type':_0x2283e8[_0x999b('0x2e')][_0x999b('0x2f')]};});_0x3a287d[_0x999b('0x30')]=_[_0x999b('0x31')](_0x2b7e2e,'name');_0x3a287d['query']=_[_0x999b('0x32')](_0x1d14f1[_0x999b('0x33')]);_0x3a287d[_0x999b('0x34')]=_['intersection'](_0x3a287d['model'],_0x3a287d[_0x999b('0x33')]);_0x366f97['attributes']=_[_0x999b('0x35')](_0x3a287d['model'],qs[_0x999b('0x36')](_0x1d14f1[_0x999b('0x33')][_0x999b('0x36')]));_0x366f97[_0x999b('0x37')]=_0x366f97['attributes'][_0x999b('0x38')]?_0x366f97[_0x999b('0x37')]:_0x3a287d[_0x999b('0x30')];if(!_0x1d14f1[_0x999b('0x33')][_0x999b('0x39')](_0x999b('0x3a'))){_0x366f97[_0x999b('0x1c')]=qs[_0x999b('0x1c')](_0x1d14f1[_0x999b('0x33')][_0x999b('0x1c')]);_0x366f97[_0x999b('0x1b')]=qs[_0x999b('0x1b')](_0x1d14f1[_0x999b('0x33')][_0x999b('0x1b')]);}_0x366f97[_0x999b('0x3b')]=qs[_0x999b('0x3c')](_0x1d14f1[_0x999b('0x33')]['sort']);_0x366f97[_0x999b('0x3d')]=qs[_0x999b('0x34')](_['pick'](_0x1d14f1['query'],_0x3a287d['filters']),_0x2b7e2e);if(_0x1d14f1[_0x999b('0x33')][_0x999b('0x3e')]){_0x366f97[_0x999b('0x3d')]=_[_0x999b('0x3f')](_0x366f97['where'],{'$or':_[_0x999b('0x31')](_0x2b7e2e,function(_0x1e22dd){if(_0x1e22dd[_0x999b('0x2e')]!==_0x999b('0x40')){var _0x4d41cb={};_0x4d41cb[_0x1e22dd['name']]={'$like':'%'+_0x1d14f1['query']['filter']+'%'};return _0x4d41cb;}})});}_0x366f97=_[_0x999b('0x3f')]({},_0x366f97,_0x1d14f1[_0x999b('0x41')]);var _0x54fa7e={'where':_0x366f97[_0x999b('0x3d')]};return db[_0x999b('0x2c')][_0x999b('0x1d')](_0x54fa7e)[_0x999b('0x24')](function(_0x400bce){_0x2f19a3[_0x999b('0x1d')]=_0x400bce;if(_0x1d14f1[_0x999b('0x33')][_0x999b('0x42')]){_0x366f97[_0x999b('0x43')]=[{'all':!![]}];}return db[_0x999b('0x2c')][_0x999b('0x44')](_0x366f97);})[_0x999b('0x24')](function(_0x33109f){_0x2f19a3[_0x999b('0x45')]=_0x33109f;return _0x2f19a3;})[_0x999b('0x24')](respondWithFilteredResult(_0x4f9d5c,_0x366f97))[_0x999b('0x46')](handleError(_0x4f9d5c,null));};exports[_0x999b('0x47')]=function(_0x1b486f,_0x11d62a){var _0x37618f={'raw':!![],'where':{'id':_0x1b486f[_0x999b('0x48')]['id']}},_0x9e3d2b={};_0x9e3d2b[_0x999b('0x30')]=_['keys'](db[_0x999b('0x2c')][_0x999b('0x49')]);_0x9e3d2b[_0x999b('0x33')]=_['keys'](_0x1b486f[_0x999b('0x33')]);_0x9e3d2b['filters']=_[_0x999b('0x35')](_0x9e3d2b['model'],_0x9e3d2b[_0x999b('0x33')]);_0x37618f['attributes']=_['intersection'](_0x9e3d2b[_0x999b('0x30')],qs['fields'](_0x1b486f[_0x999b('0x33')][_0x999b('0x36')]));_0x37618f['attributes']=_0x37618f[_0x999b('0x37')][_0x999b('0x38')]?_0x37618f[_0x999b('0x37')]:_0x9e3d2b['model'];if(_0x1b486f['query']['includeAll']){_0x37618f[_0x999b('0x43')]=[{'all':!![]}];}_0x37618f=_[_0x999b('0x3f')]({},_0x37618f,_0x1b486f['options']);return db[_0x999b('0x2c')][_0x999b('0x4a')](_0x37618f)['then'](handleEntityNotFound(_0x11d62a,null))[_0x999b('0x24')](respondWithResult(_0x11d62a,null))['catch'](handleError(_0x11d62a,null));};exports[_0x999b('0x4b')]=function(_0x3f046f,_0x301d79,_0x578835){return db[_0x999b('0x2c')][_0x999b('0x4a')]({'where':{'id':_0x3f046f[_0x999b('0x48')]['id']},'attributes':['name','save_name',_0x999b('0x4c')],'raw':!![]})[_0x999b('0x24')](handleEntityNotFound(_0x301d79,null))[_0x999b('0x24')](function(_0xb98d){if(_0xb98d){if(!fs[_0x999b('0x4d')](path[_0x999b('0x4e')](config[_0x999b('0x4f')],_0x999b('0x50'),_0xb98d['save_name']+'.'+_0xb98d[_0x999b('0x4c')]))){throw new db['Sequelize'][(_0x999b('0x51'))]('Sound\x20not\x20found');}return _0x301d79[_0x999b('0x4b')](path[_0x999b('0x4e')](config[_0x999b('0x4f')],_0x999b('0x50'),util[_0x999b('0x52')](_0x999b('0x53'),_0xb98d[_0x999b('0x54')],_0xb98d['converted_format'])),util['format'](_0x999b('0x53'),_0xb98d[_0x999b('0x2a')],_0xb98d[_0x999b('0x4c')]));}return null;})[_0x999b('0x46')](handleError(_0x301d79,null));};exports[_0x999b('0x55')]=function(_0x5d7773,_0x4103f3,_0x450af3){var _0x3c3c38={'name':path[_0x999b('0x56')](_0x5d7773[_0x999b('0x57')][_0x999b('0x58')],path['extname'](_0x5d7773['file']['originalname'])),'save_name':path['basename'](_0x5d7773['file']['filename'],path[_0x999b('0x59')](_0x5d7773[_0x999b('0x57')][_0x999b('0x5a')])),'original_format':path['extname'](_0x5d7773['file'][_0x999b('0x58')])['substring'](0x1),'converted_format':'wav'};var _0x1c0663=path['join'](config[_0x999b('0x4f')],'server/files/sounds/original',_0x5d7773[_0x999b('0x57')][_0x999b('0x5a')]);var _0x15939d=path[_0x999b('0x4e')](config[_0x999b('0x4f')],_0x999b('0x50'),util[_0x999b('0x52')](_0x999b('0x53'),path[_0x999b('0x56')](_0x5d7773[_0x999b('0x57')]['filename'],path['extname'](_0x5d7773['file'][_0x999b('0x5a')])),_0x3c3c38[_0x999b('0x4c')]));logger['info'](_0x999b('0x5b'),_0x1c0663);logger[_0x999b('0x5c')](_0x999b('0x5d'),_0x15939d);try{fs[_0x999b('0x5e')](_0x1c0663,parseInt('0777',0x8));var _0x142a36=sox[_0x999b('0x5f')](_0x1c0663,_0x15939d,{'sampleRate':0x1f40,'format':_0x999b('0x60'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x142a36['on']('error',function(_0x28e8b9){fs[_0x999b('0x61')](_0x1c0663);_0x4103f3[_0x999b('0x1a')](0x1f4)['send'](_0x28e8b9);});_0x142a36['on'](_0x999b('0x62'),function(_0x3f5d02){_0x3c3c38[_0x999b('0x63')]=isNaN(_0x3f5d02[_0x999b('0x64')])?null:_0x3f5d02[_0x999b('0x64')]*0x3e8;_0x3c3c38[_0x999b('0x65')]=isNaN(_0x3f5d02[_0x999b('0x66')])?null:_0x3f5d02[_0x999b('0x66')];_0x3c3c38['original_channelCount']=isNaN(_0x3f5d02['channelCount'])?null:_0x3f5d02[_0x999b('0x67')];_0x3c3c38[_0x999b('0x68')]=isNaN(_0x3f5d02[_0x999b('0x69')])?null:_0x3f5d02['bitRate'];_0x3c3c38[_0x999b('0x6a')]=isNaN(_0x3f5d02[_0x999b('0x6b')])?null:_0x3f5d02[_0x999b('0x6b')];});_0x142a36['on'](_0x999b('0x6c'),function(_0x550135){_0x3c3c38['converted_duration']=isNaN(_0x550135[_0x999b('0x64')])?null:_0x550135['duration']*0x3e8;_0x3c3c38[_0x999b('0x6d')]=isNaN(_0x550135[_0x999b('0x66')])?null:_0x550135[_0x999b('0x66')];_0x3c3c38[_0x999b('0x6e')]=isNaN(_0x550135[_0x999b('0x67')])?null:_0x550135[_0x999b('0x67')];_0x3c3c38[_0x999b('0x6f')]=isNaN(_0x550135['bitRate'])?null:_0x550135[_0x999b('0x69')];_0x3c3c38[_0x999b('0x70')]=isNaN(_0x550135[_0x999b('0x6b')])?null:_0x550135['sampleRate'];});_0x142a36['on'](_0x999b('0x28'),function(){fs['chmodSync'](_0x15939d,parseInt(_0x999b('0x71'),0x8));return db[_0x999b('0x2c')]['create'](_0x3c3c38)[_0x999b('0x24')](function(_0x4f25f4){var _0x4689a5={'role':_0x5d7773[_0x999b('0x72')][_0x999b('0x73')],'userProfileId':_0x5d7773[_0x999b('0x72')][_0x999b('0x74')]};if(!_0x4689a5)throw new Error(_0x999b('0x75'));if(_0x4689a5[_0x999b('0x73')]===_0x999b('0x76')){var _0x5c486f=_0x4f25f4[_0x999b('0x26')]({'plain':!![]});return db[_0x999b('0x77')][_0x999b('0x4a')]({'where':{'name':_0x999b('0x78'),'userProfileId':_0x4689a5[_0x999b('0x74')]},'raw':!![]})['then'](function(_0x2fe9c1){if(_0x2fe9c1&&_0x2fe9c1[_0x999b('0x79')]===0x0){return db[_0x999b('0x27')][_0x999b('0x55')]({'name':_0x5c486f[_0x999b('0x2a')],'resourceId':_0x5c486f['id'],'type':_0x2fe9c1[_0x999b('0x2a')],'sectionId':_0x2fe9c1['id']},{})[_0x999b('0x24')](function(){return _0x4f25f4;});}else{return _0x4f25f4;}})['catch'](function(_0x31197f){logger[_0x999b('0x29')](_0x999b('0x7a'),_0x31197f);throw _0x31197f;});}return _0x4f25f4;})['then'](respondWithResult(_0x4103f3,null))[_0x999b('0x46')](handleError(_0x4103f3,null));});_0x142a36[_0x999b('0x7b')]();}catch(_0x538b2b){_0x4103f3[_0x999b('0x1a')](0x1f4)['send'](_0x538b2b);}};exports['update']=function(_0x54d631,_0x154a0a,_0x302714){return db[_0x999b('0x2c')]['find']({'where':{'id':_0x54d631['params']['id']}})[_0x999b('0x24')](handleEntityNotFound(_0x154a0a,null))[_0x999b('0x24')](saveUpdates(_[_0x999b('0x7c')](_0x54d631[_0x999b('0x72')],['name','description']),null))['then'](respondWithResult(_0x154a0a,null))[_0x999b('0x46')](handleError(_0x154a0a,null));};exports['delete']=function(_0xa5d2f,_0x47d6be,_0x47bb3a){return db[_0x999b('0x2c')][_0x999b('0x4a')]({'where':{'id':_0xa5d2f['params']['id']}})['then'](function(_0xc51967){if(_0xc51967){return _0xc51967[_0x999b('0x25')]();}})[_0x999b('0x24')](function(_0x305b90){var _0x39958f=path['join'](config[_0x999b('0x4f')],_0x999b('0x7d'),util[_0x999b('0x52')](_0x999b('0x53'),_0x305b90['save_name'],_0x305b90[_0x999b('0x7e')]));var _0x48dc34=path['join'](config[_0x999b('0x4f')],_0x999b('0x50'),util['format'](_0x999b('0x53'),_0x305b90[_0x999b('0x54')],_0x305b90[_0x999b('0x4c')]));fs[_0x999b('0x61')](_0x39958f);fs['unlinkSync'](_0x48dc34);return _0x305b90;})[_0x999b('0x24')](function(_0xeb5312){if(_0xeb5312){return _0x47d6be[_0x999b('0x1a')](0xcc)['end']();}})[_0x999b('0x24')](handleEntityNotFound(_0x47d6be,null))[_0x999b('0x46')](handleError(_0x47d6be,null));}; \ No newline at end of file +var _0x7048=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','Sounds','UserProfileResource','sendStatus','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','nolimit','order','where','pick','filter','merge','VIRTUAL','catch','show','params','fields','length','includeAll','options','find','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','file','originalname','filename','extname','substring','wav','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','sampleCount','converted_channelCount','converted_sampleRate','body','role','userProfileId','user','get','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','original_format','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x13c2df,_0x4c9d43){var _0x2a8fe2=function(_0x469e37){while(--_0x469e37){_0x13c2df['push'](_0x13c2df['shift']());}};_0x2a8fe2(++_0x4c9d43);}(_0x7048,0x162));var _0x8704=function(_0xf4bc33,_0x1834be){_0xf4bc33=_0xf4bc33-0x0;var _0x43f5b8=_0x7048[_0xf4bc33];return _0x43f5b8;};'use strict';var emlformat=require(_0x8704('0x0'));var rimraf=require(_0x8704('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8704('0x2'));var moment=require(_0x8704('0x3'));var BPromise=require(_0x8704('0x4'));var Mustache=require(_0x8704('0x5'));var util=require(_0x8704('0x6'));var path=require(_0x8704('0x7'));var sox=require(_0x8704('0x8'));var csv=require('to-csv');var ejs=require(_0x8704('0x9'));var fs=require('fs');var fs_extra=require(_0x8704('0xa'));var _=require(_0x8704('0xb'));var squel=require(_0x8704('0xc'));var crypto=require(_0x8704('0xd'));var jsforce=require(_0x8704('0xe'));var deskjs=require(_0x8704('0xf'));var toCsv=require(_0x8704('0x10'));var querystring=require(_0x8704('0x11'));var Papa=require(_0x8704('0x12'));var Redis=require(_0x8704('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x8704('0x14'));var as=require(_0x8704('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8704('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x853c6e,_0x44a8b9){_0x44a8b9=_0x44a8b9||0xcc;return function(_0x5438a7){if(_0x5438a7){return _0x853c6e['sendStatus'](_0x44a8b9);}return _0x853c6e[_0x8704('0x17')](_0x44a8b9)[_0x8704('0x18')]();};}function respondWithResult(_0x163d4d,_0xad4afe){_0xad4afe=_0xad4afe||0xc8;return function(_0x48c047){if(_0x48c047){return _0x163d4d[_0x8704('0x17')](_0xad4afe)[_0x8704('0x19')](_0x48c047);}};}function respondWithFilteredResult(_0x35e76a,_0x26cf50){return function(_0xffac52){if(_0xffac52){var _0x538d51=typeof _0x26cf50['offset']==='undefined'&&typeof _0x26cf50['limit']===_0x8704('0x1a');var _0x412776=_0xffac52[_0x8704('0x1b')];var _0x27b2de=_0x538d51?0x0:_0x26cf50[_0x8704('0x1c')];var _0xe500f6=_0x538d51?_0xffac52[_0x8704('0x1b')]:_0x26cf50['offset']+_0x26cf50[_0x8704('0x1d')];var _0x3a8224;if(_0xe500f6>=_0x412776){_0xe500f6=_0x412776;_0x3a8224=0xc8;}else{_0x3a8224=0xce;}_0x35e76a[_0x8704('0x17')](_0x3a8224);return _0x35e76a[_0x8704('0x1e')](_0x8704('0x1f'),_0x27b2de+'-'+_0xe500f6+'/'+_0x412776)[_0x8704('0x19')](_0xffac52);}return null;};}function patchUpdates(_0xde99d1){return function(_0x5b8dc7){try{jsonpatch[_0x8704('0x20')](_0x5b8dc7,_0xde99d1,!![]);}catch(_0x3b43d){return BPromise[_0x8704('0x21')](_0x3b43d);}return _0x5b8dc7[_0x8704('0x22')]();};}function saveUpdates(_0x4a1c03,_0x13968f){return function(_0x3c4dc2){if(_0x3c4dc2){return _0x3c4dc2[_0x8704('0x23')](_0x4a1c03)[_0x8704('0x24')](function(_0x243f75){return _0x243f75;});}return null;};}function removeEntity(_0x3e8602,_0x48ea06){return function(_0x46307e){if(_0x46307e){return _0x46307e[_0x8704('0x25')]()[_0x8704('0x24')](function(){var _0x4aa0e8=_0x46307e['get']({'plain':!![]});var _0x1da5e7=_0x8704('0x26');return db[_0x8704('0x27')]['destroy']({'where':{'type':_0x1da5e7,'resourceId':_0x4aa0e8['id']}})['then'](function(){return _0x46307e;});})[_0x8704('0x24')](function(){_0x3e8602[_0x8704('0x17')](0xcc)[_0x8704('0x18')]();});}};}function handleEntityNotFound(_0x52f12a,_0x4afbbf){return function(_0xd04b2e){if(!_0xd04b2e){_0x52f12a[_0x8704('0x28')](0x194);}return _0xd04b2e;};}function handleError(_0x3f6c15,_0xf3ad67){_0xf3ad67=_0xf3ad67||0x1f4;return function(_0x116b37){logger[_0x8704('0x29')](_0x116b37[_0x8704('0x2a')]);if(_0x116b37[_0x8704('0x2b')]){delete _0x116b37[_0x8704('0x2b')];}_0x3f6c15[_0x8704('0x17')](_0xf3ad67)[_0x8704('0x2c')](_0x116b37);};}exports[_0x8704('0x2d')]=function(_0x3c6b47,_0x2cd0be){var _0x238109={},_0x439718={},_0x417ad9={'count':0x0,'rows':[]};var _0x298cdc=_[_0x8704('0x2e')](db[_0x8704('0x2f')][_0x8704('0x30')],function(_0x36cb8d){return{'name':_0x36cb8d[_0x8704('0x31')],'type':_0x36cb8d[_0x8704('0x32')]['key']};});_0x439718[_0x8704('0x33')]=_[_0x8704('0x2e')](_0x298cdc,'name');_0x439718['query']=_[_0x8704('0x34')](_0x3c6b47['query']);_0x439718[_0x8704('0x35')]=_[_0x8704('0x36')](_0x439718[_0x8704('0x33')],_0x439718[_0x8704('0x37')]);_0x238109[_0x8704('0x38')]=_[_0x8704('0x36')](_0x439718[_0x8704('0x33')],qs['fields'](_0x3c6b47[_0x8704('0x37')]['fields']));_0x238109[_0x8704('0x38')]=_0x238109[_0x8704('0x38')]['length']?_0x238109[_0x8704('0x38')]:_0x439718[_0x8704('0x33')];if(!_0x3c6b47[_0x8704('0x37')]['hasOwnProperty'](_0x8704('0x39'))){_0x238109[_0x8704('0x1d')]=qs[_0x8704('0x1d')](_0x3c6b47['query'][_0x8704('0x1d')]);_0x238109[_0x8704('0x1c')]=qs[_0x8704('0x1c')](_0x3c6b47[_0x8704('0x37')]['offset']);}_0x238109[_0x8704('0x3a')]=qs['sort'](_0x3c6b47[_0x8704('0x37')]['sort']);_0x238109[_0x8704('0x3b')]=qs[_0x8704('0x35')](_[_0x8704('0x3c')](_0x3c6b47[_0x8704('0x37')],_0x439718[_0x8704('0x35')]),_0x298cdc);if(_0x3c6b47[_0x8704('0x37')][_0x8704('0x3d')]){_0x238109[_0x8704('0x3b')]=_[_0x8704('0x3e')](_0x238109['where'],{'$or':_['map'](_0x298cdc,function(_0x35f258){if(_0x35f258['type']!==_0x8704('0x3f')){var _0x27d40f={};_0x27d40f[_0x35f258[_0x8704('0x2b')]]={'$like':'%'+_0x3c6b47[_0x8704('0x37')][_0x8704('0x3d')]+'%'};return _0x27d40f;}})});}_0x238109=_[_0x8704('0x3e')]({},_0x238109,_0x3c6b47['options']);var _0xcfd08b={'where':_0x238109['where']};return db[_0x8704('0x2f')][_0x8704('0x1b')](_0xcfd08b)[_0x8704('0x24')](function(_0x7f7af9){_0x417ad9['count']=_0x7f7af9;if(_0x3c6b47['query']['includeAll']){_0x238109['include']=[{'all':!![]}];}return db[_0x8704('0x2f')]['findAll'](_0x238109);})[_0x8704('0x24')](function(_0x48813a){_0x417ad9['rows']=_0x48813a;return _0x417ad9;})[_0x8704('0x24')](respondWithFilteredResult(_0x2cd0be,_0x238109))[_0x8704('0x40')](handleError(_0x2cd0be,null));};exports[_0x8704('0x41')]=function(_0x4916b6,_0x4bcf27){var _0x11e3c7={'raw':!![],'where':{'id':_0x4916b6[_0x8704('0x42')]['id']}},_0x2c5748={};_0x2c5748[_0x8704('0x33')]=_[_0x8704('0x34')](db[_0x8704('0x2f')][_0x8704('0x30')]);_0x2c5748['query']=_[_0x8704('0x34')](_0x4916b6[_0x8704('0x37')]);_0x2c5748['filters']=_[_0x8704('0x36')](_0x2c5748['model'],_0x2c5748['query']);_0x11e3c7[_0x8704('0x38')]=_[_0x8704('0x36')](_0x2c5748[_0x8704('0x33')],qs['fields'](_0x4916b6[_0x8704('0x37')][_0x8704('0x43')]));_0x11e3c7[_0x8704('0x38')]=_0x11e3c7['attributes'][_0x8704('0x44')]?_0x11e3c7[_0x8704('0x38')]:_0x2c5748[_0x8704('0x33')];if(_0x4916b6[_0x8704('0x37')][_0x8704('0x45')]){_0x11e3c7['include']=[{'all':!![]}];}_0x11e3c7=_['merge']({},_0x11e3c7,_0x4916b6[_0x8704('0x46')]);return db['Sound']['find'](_0x11e3c7)[_0x8704('0x24')](handleEntityNotFound(_0x4bcf27,null))[_0x8704('0x24')](respondWithResult(_0x4bcf27,null))[_0x8704('0x40')](handleError(_0x4bcf27,null));};exports['download']=function(_0x28a7df,_0x219ffd,_0x2965d7){return db[_0x8704('0x2f')][_0x8704('0x47')]({'where':{'id':_0x28a7df['params']['id']},'attributes':['name',_0x8704('0x48'),_0x8704('0x49')],'raw':!![]})[_0x8704('0x24')](handleEntityNotFound(_0x219ffd,null))[_0x8704('0x24')](function(_0x3487d6){if(_0x3487d6){if(!fs[_0x8704('0x4a')](path[_0x8704('0x4b')](config[_0x8704('0x4c')],_0x8704('0x4d'),_0x3487d6[_0x8704('0x48')]+'.'+_0x3487d6['converted_format']))){throw new db[(_0x8704('0x4e'))][(_0x8704('0x4f'))](_0x8704('0x50'));}return _0x219ffd['download'](path[_0x8704('0x4b')](config[_0x8704('0x4c')],_0x8704('0x4d'),util[_0x8704('0x51')](_0x8704('0x52'),_0x3487d6[_0x8704('0x48')],_0x3487d6[_0x8704('0x49')])),util['format'](_0x8704('0x52'),_0x3487d6[_0x8704('0x2b')],_0x3487d6[_0x8704('0x49')]));}return null;})[_0x8704('0x40')](handleError(_0x219ffd,null));};exports[_0x8704('0x53')]=function(_0x2dcfd0,_0x4c35e6,_0x4633b5){var _0x2b597d={'name':path[_0x8704('0x54')](_0x2dcfd0[_0x8704('0x55')][_0x8704('0x56')],path['extname'](_0x2dcfd0[_0x8704('0x55')]['originalname'])),'save_name':path[_0x8704('0x54')](_0x2dcfd0[_0x8704('0x55')][_0x8704('0x57')],path['extname'](_0x2dcfd0[_0x8704('0x55')][_0x8704('0x57')])),'original_format':path[_0x8704('0x58')](_0x2dcfd0[_0x8704('0x55')][_0x8704('0x56')])[_0x8704('0x59')](0x1),'converted_format':_0x8704('0x5a')};var _0x11bacc=path['join'](config[_0x8704('0x4c')],'server/files/sounds/original',_0x2dcfd0[_0x8704('0x55')][_0x8704('0x57')]);var _0x1a2eef=path[_0x8704('0x4b')](config['root'],_0x8704('0x4d'),util[_0x8704('0x51')]('%s.%s',path[_0x8704('0x54')](_0x2dcfd0[_0x8704('0x55')][_0x8704('0x57')],path[_0x8704('0x58')](_0x2dcfd0[_0x8704('0x55')][_0x8704('0x57')])),_0x2b597d[_0x8704('0x49')]));logger[_0x8704('0x5b')](_0x8704('0x5c'),_0x11bacc);logger[_0x8704('0x5b')]('Sound\x20upload\x20destination:\x20%s',_0x1a2eef);try{fs[_0x8704('0x5d')](_0x11bacc,parseInt(_0x8704('0x5e'),0x8));var _0x44a051=sox[_0x8704('0x5f')](_0x11bacc,_0x1a2eef,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x44a051['on'](_0x8704('0x29'),function(_0x20b134){fs[_0x8704('0x60')](_0x11bacc);_0x4c35e6['status'](0x1f4)[_0x8704('0x2c')](_0x20b134);});_0x44a051['on'](_0x8704('0x61'),function(_0x1a60c9){_0x2b597d[_0x8704('0x62')]=isNaN(_0x1a60c9[_0x8704('0x63')])?null:_0x1a60c9[_0x8704('0x63')]*0x3e8;_0x2b597d['original_sampleCount']=isNaN(_0x1a60c9['sampleCount'])?null:_0x1a60c9['sampleCount'];_0x2b597d[_0x8704('0x64')]=isNaN(_0x1a60c9[_0x8704('0x65')])?null:_0x1a60c9[_0x8704('0x65')];_0x2b597d[_0x8704('0x66')]=isNaN(_0x1a60c9['bitRate'])?null:_0x1a60c9[_0x8704('0x67')];_0x2b597d[_0x8704('0x68')]=isNaN(_0x1a60c9[_0x8704('0x69')])?null:_0x1a60c9['sampleRate'];});_0x44a051['on'](_0x8704('0x6a'),function(_0x53299c){_0x2b597d[_0x8704('0x6b')]=isNaN(_0x53299c[_0x8704('0x63')])?null:_0x53299c[_0x8704('0x63')]*0x3e8;_0x2b597d[_0x8704('0x6c')]=isNaN(_0x53299c[_0x8704('0x6d')])?null:_0x53299c[_0x8704('0x6d')];_0x2b597d[_0x8704('0x6e')]=isNaN(_0x53299c['channelCount'])?null:_0x53299c[_0x8704('0x65')];_0x2b597d['converted_bitRate']=isNaN(_0x53299c[_0x8704('0x67')])?null:_0x53299c[_0x8704('0x67')];_0x2b597d[_0x8704('0x6f')]=isNaN(_0x53299c['sampleRate'])?null:_0x53299c[_0x8704('0x69')];});_0x44a051['on'](_0x8704('0x18'),function(){fs[_0x8704('0x5d')](_0x1a2eef,parseInt(_0x8704('0x5e'),0x8));return db['Sound'][_0x8704('0x53')](_0x2b597d)['then'](function(_0x4a520e){var _0x12ecb2={'role':_0x2dcfd0[_0x8704('0x70')][_0x8704('0x71')],'userProfileId':_0x2dcfd0[_0x8704('0x70')][_0x8704('0x72')]};if(!_0x12ecb2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x12ecb2[_0x8704('0x71')]===_0x8704('0x73')){var _0x1259ed=_0x4a520e[_0x8704('0x74')]({'plain':!![]});return db[_0x8704('0x75')][_0x8704('0x47')]({'where':{'name':_0x8704('0x26'),'userProfileId':_0x12ecb2[_0x8704('0x72')]},'raw':!![]})[_0x8704('0x24')](function(_0x10ce8b){if(_0x10ce8b&&_0x10ce8b['autoAssociation']===0x0){return db[_0x8704('0x27')][_0x8704('0x53')]({'name':_0x1259ed[_0x8704('0x2b')],'resourceId':_0x1259ed['id'],'type':_0x10ce8b[_0x8704('0x2b')],'sectionId':_0x10ce8b['id']},{})['then'](function(){return _0x4a520e;});}else{return _0x4a520e;}})[_0x8704('0x40')](function(_0x49eed9){logger[_0x8704('0x29')](_0x8704('0x76'),_0x49eed9);throw _0x49eed9;});}return _0x4a520e;})[_0x8704('0x24')](respondWithResult(_0x4c35e6,null))[_0x8704('0x40')](handleError(_0x4c35e6,null));});_0x44a051[_0x8704('0x77')]();}catch(_0x16af9d){_0x4c35e6[_0x8704('0x17')](0x1f4)[_0x8704('0x2c')](_0x16af9d);}};exports[_0x8704('0x23')]=function(_0x1f10bc,_0x2f7044,_0x558274){return db[_0x8704('0x2f')][_0x8704('0x47')]({'where':{'id':_0x1f10bc[_0x8704('0x42')]['id']}})['then'](handleEntityNotFound(_0x2f7044,null))[_0x8704('0x24')](saveUpdates(_[_0x8704('0x3c')](_0x1f10bc[_0x8704('0x70')],['name','description']),null))[_0x8704('0x24')](respondWithResult(_0x2f7044,null))[_0x8704('0x40')](handleError(_0x2f7044,null));};exports['delete']=function(_0x31b65c,_0x148f10,_0x143c56){return db[_0x8704('0x2f')]['find']({'where':{'id':_0x31b65c[_0x8704('0x42')]['id']}})[_0x8704('0x24')](function(_0xdcd323){if(_0xdcd323){return _0xdcd323[_0x8704('0x25')]();}})[_0x8704('0x24')](function(_0x99f33a){var _0x4b0190=path['join'](config[_0x8704('0x4c')],'server/files/sounds/original',util[_0x8704('0x51')](_0x8704('0x52'),_0x99f33a['save_name'],_0x99f33a[_0x8704('0x78')]));var _0x2be7ad=path[_0x8704('0x4b')](config[_0x8704('0x4c')],_0x8704('0x4d'),util['format']('%s.%s',_0x99f33a[_0x8704('0x48')],_0x99f33a[_0x8704('0x49')]));fs['unlinkSync'](_0x4b0190);fs['unlinkSync'](_0x2be7ad);return _0x99f33a;})[_0x8704('0x24')](function(_0x128756){if(_0x128756){return _0x148f10['status'](0xcc)[_0x8704('0x18')]();}})[_0x8704('0x24')](handleEntityNotFound(_0x148f10,null))['catch'](handleError(_0x148f10,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index f0c010d..f7f8c61 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 _0x0e32=['rimraf','../../config/environment','./sound.attributes','exports','define','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x367dc0,_0x1072df){var _0x90cea=function(_0x29ede9){while(--_0x29ede9){_0x367dc0['push'](_0x367dc0['shift']());}};_0x90cea(++_0x1072df);}(_0x0e32,0xdd));var _0x20e3=function(_0x111781,_0x2512f6){_0x111781=_0x111781-0x0;var _0x2aa1aa=_0x0e32[_0x111781];return _0x2aa1aa;};'use strict';var _=require(_0x20e3('0x0'));var util=require(_0x20e3('0x1'));var logger=require(_0x20e3('0x2'))(_0x20e3('0x3'));var moment=require('moment');var BPromise=require(_0x20e3('0x4'));var rp=require(_0x20e3('0x5'));var fs=require('fs');var path=require(_0x20e3('0x6'));var rimraf=require(_0x20e3('0x7'));var config=require(_0x20e3('0x8'));var attributes=require(_0x20e3('0x9'));module[_0x20e3('0xa')]=function(_0xfae8ac,_0x5cf840){return _0xfae8ac[_0x20e3('0xb')]('Sound',attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf9ea=['moment','bluebird','request-promise','path','../../config/environment','./sound.attributes','exports','define','tools_sounds','lodash','util','api'];(function(_0x3b68c7,_0x546380){var _0x29a450=function(_0x58f335){while(--_0x58f335){_0x3b68c7['push'](_0x3b68c7['shift']());}};_0x29a450(++_0x546380);}(_0xf9ea,0x17d));var _0xaf9e=function(_0x17784a,_0x42fe44){_0x17784a=_0x17784a-0x0;var _0x41aded=_0xf9ea[_0x17784a];return _0x41aded;};'use strict';var _=require(_0xaf9e('0x0'));var util=require(_0xaf9e('0x1'));var logger=require('../../config/logger')(_0xaf9e('0x2'));var moment=require(_0xaf9e('0x3'));var BPromise=require(_0xaf9e('0x4'));var rp=require(_0xaf9e('0x5'));var fs=require('fs');var path=require(_0xaf9e('0x6'));var rimraf=require('rimraf');var config=require(_0xaf9e('0x7'));var attributes=require(_0xaf9e('0x8'));module[_0xaf9e('0x9')]=function(_0x519491,_0x5344a7){return _0x519491[_0xaf9e('0xa')]('Sound',attributes,{'tableName':_0xaf9e('0xb'),'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 c5e31b3..f7aa6fa 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 _0x8736=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','Sound,\x20%s,\x20%s','message','result','catch','find','options','where','attributes','include','map','model','ShowSound','lodash','util'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0x8736,0x15e));var _0x6873=function(_0xed53c7,_0x2bc520){_0xed53c7=_0xed53c7-0x0;var _0x538ab2=_0x8736[_0xed53c7];return _0x538ab2;};'use strict';var _=require(_0x6873('0x0'));var util=require(_0x6873('0x1'));var moment=require(_0x6873('0x2'));var BPromise=require(_0x6873('0x3'));var rs=require(_0x6873('0x4'));var fs=require('fs');var Redis=require(_0x6873('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6873('0x6'));var logger=require(_0x6873('0x7'))(_0x6873('0x8'));var config=require(_0x6873('0x9'));var jayson=require(_0x6873('0xa'));var client=jayson[_0x6873('0xb')][_0x6873('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3ee97d,_0x1eb794,_0x44a7a6){return new BPromise(function(_0x44e0b8,_0x5e24cb){return client['request'](_0x3ee97d,_0x44a7a6)[_0x6873('0xd')](function(_0x11c99b){logger[_0x6873('0xe')]('Sound,\x20%s,\x20%s',_0x1eb794,_0x6873('0xf'));logger[_0x6873('0x10')](_0x6873('0x11'),_0x1eb794,_0x6873('0xf'),JSON['stringify'](_0x11c99b));if(_0x11c99b[_0x6873('0x12')]){if(_0x11c99b[_0x6873('0x12')][_0x6873('0x13')]===0x1f4){logger[_0x6873('0x12')](_0x6873('0x14'),_0x1eb794,_0x11c99b[_0x6873('0x12')][_0x6873('0x15')]);return _0x5e24cb(_0x11c99b['error'][_0x6873('0x15')]);}logger['error'](_0x6873('0x14'),_0x1eb794,_0x11c99b[_0x6873('0x12')][_0x6873('0x15')]);return _0x44e0b8(_0x11c99b['error'][_0x6873('0x15')]);}else{logger['info'](_0x6873('0x14'),_0x1eb794,'request\x20sent');_0x44e0b8(_0x11c99b[_0x6873('0x16')][_0x6873('0x15')]);}})[_0x6873('0x17')](function(_0x4d3383){logger[_0x6873('0x12')]('Sound,\x20%s,\x20%s',_0x1eb794,_0x4d3383);_0x5e24cb(_0x4d3383);});});}exports['ShowSound']=function(_0x51e57a){var _0x35ca0d=this;return new Promise(function(_0x59bcf4,_0x6fce2c){return db['Sound'][_0x6873('0x18')]({'raw':_0x51e57a[_0x6873('0x19')]?_0x51e57a[_0x6873('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x51e57a['options']?_0x51e57a[_0x6873('0x19')][_0x6873('0x1a')]||null:null,'attributes':_0x51e57a[_0x6873('0x19')]?_0x51e57a['options'][_0x6873('0x1b')]||null:null,'include':_0x51e57a['options']?_0x51e57a[_0x6873('0x19')][_0x6873('0x1c')]?_[_0x6873('0x1d')](_0x51e57a[_0x6873('0x19')][_0x6873('0x1c')],function(_0x3c9f94){return{'model':db[_0x3c9f94[_0x6873('0x1e')]],'as':_0x3c9f94['as'],'attributes':_0x3c9f94[_0x6873('0x1b')],'include':_0x3c9f94['include']?_[_0x6873('0x1d')](_0x3c9f94['include'],function(_0x36e57e){return{'model':db[_0x36e57e[_0x6873('0x1e')]],'as':_0x36e57e['as'],'attributes':_0x36e57e[_0x6873('0x1b')],'include':_0x36e57e['include']?_[_0x6873('0x1d')](_0x36e57e[_0x6873('0x1c')],function(_0xdb0b71){return{'model':db[_0xdb0b71[_0x6873('0x1e')]],'as':_0xdb0b71['as'],'attributes':_0xdb0b71[_0x6873('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6873('0xd')](function(_0x405029){logger[_0x6873('0xe')](_0x6873('0x1f'),_0x51e57a);logger[_0x6873('0x10')](_0x6873('0x1f'),_0x51e57a,JSON['stringify'](_0x405029));_0x59bcf4(_0x405029);})['catch'](function(_0x13252a){logger['error']('ShowSound',_0x13252a['message'],_0x51e57a);_0x6fce2c(_0x35ca0d['error'](0x1f4,_0x13252a[_0x6873('0x15')]));});});}; \ No newline at end of file +var _0xe878=['ShowSound','options','raw','where','include','model','attributes','map','stringify','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','client','request','info','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','Sound,\x20%s,\x20%s','message','result'];(function(_0x5290e8,_0x1786ff){var _0x581967=function(_0x15896e){while(--_0x15896e){_0x5290e8['push'](_0x5290e8['shift']());}};_0x581967(++_0x1786ff);}(_0xe878,0xea));var _0x8e87=function(_0x4bd374,_0x1b9051){_0x4bd374=_0x4bd374-0x0;var _0x4959a0=_0xe878[_0x4bd374];return _0x4959a0;};'use strict';var _=require(_0x8e87('0x0'));var util=require(_0x8e87('0x1'));var moment=require('moment');var BPromise=require(_0x8e87('0x2'));var rs=require(_0x8e87('0x3'));var fs=require('fs');var Redis=require(_0x8e87('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8e87('0x5'))(_0x8e87('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8e87('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x416145,_0x9bad12,_0x32a87c){return new BPromise(function(_0x40862f,_0x2dfefa){return client[_0x8e87('0x8')](_0x416145,_0x32a87c)['then'](function(_0xb34756){logger[_0x8e87('0x9')]('Sound,\x20%s,\x20%s',_0x9bad12,_0x8e87('0xa'));logger[_0x8e87('0xb')](_0x8e87('0xc'),_0x9bad12,_0x8e87('0xa'),JSON['stringify'](_0xb34756));if(_0xb34756[_0x8e87('0xd')]){if(_0xb34756['error'][_0x8e87('0xe')]===0x1f4){logger[_0x8e87('0xd')](_0x8e87('0xf'),_0x9bad12,_0xb34756['error'][_0x8e87('0x10')]);return _0x2dfefa(_0xb34756[_0x8e87('0xd')][_0x8e87('0x10')]);}logger[_0x8e87('0xd')](_0x8e87('0xf'),_0x9bad12,_0xb34756[_0x8e87('0xd')][_0x8e87('0x10')]);return _0x40862f(_0xb34756[_0x8e87('0xd')][_0x8e87('0x10')]);}else{logger[_0x8e87('0x9')]('Sound,\x20%s,\x20%s',_0x9bad12,_0x8e87('0xa'));_0x40862f(_0xb34756[_0x8e87('0x11')]['message']);}})['catch'](function(_0x4a06d3){logger[_0x8e87('0xd')](_0x8e87('0xf'),_0x9bad12,_0x4a06d3);_0x2dfefa(_0x4a06d3);});});}exports[_0x8e87('0x12')]=function(_0x3ea844){var _0x3cdaca=this;return new Promise(function(_0x2ab053,_0x2c0b02){return db['Sound']['find']({'raw':_0x3ea844[_0x8e87('0x13')]?_0x3ea844['options'][_0x8e87('0x14')]===undefined?!![]:![]:!![],'where':_0x3ea844[_0x8e87('0x13')]?_0x3ea844[_0x8e87('0x13')][_0x8e87('0x15')]||null:null,'attributes':_0x3ea844['options']?_0x3ea844[_0x8e87('0x13')]['attributes']||null:null,'include':_0x3ea844['options']?_0x3ea844[_0x8e87('0x13')]['include']?_['map'](_0x3ea844['options'][_0x8e87('0x16')],function(_0x31d0e8){return{'model':db[_0x31d0e8[_0x8e87('0x17')]],'as':_0x31d0e8['as'],'attributes':_0x31d0e8[_0x8e87('0x18')],'include':_0x31d0e8[_0x8e87('0x16')]?_[_0x8e87('0x19')](_0x31d0e8[_0x8e87('0x16')],function(_0x2230a8){return{'model':db[_0x2230a8[_0x8e87('0x17')]],'as':_0x2230a8['as'],'attributes':_0x2230a8['attributes'],'include':_0x2230a8['include']?_['map'](_0x2230a8[_0x8e87('0x16')],function(_0x43a0bd){return{'model':db[_0x43a0bd['model']],'as':_0x43a0bd['as'],'attributes':_0x43a0bd['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x39369e){logger[_0x8e87('0x9')](_0x8e87('0x12'),_0x3ea844);logger[_0x8e87('0xb')]('ShowSound',_0x3ea844,JSON[_0x8e87('0x1a')](_0x39369e));_0x2ab053(_0x39369e);})[_0x8e87('0x1b')](function(_0x5b5275){logger['error'](_0x8e87('0x12'),_0x5b5275[_0x8e87('0x10')],_0x3ea844);_0x2c0b02(_0x3cdaca[_0x8e87('0xd')](0x1f4,_0x5b5275[_0x8e87('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 638b522..05f7761 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 _0x9ffd=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','multer'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x5b3cb7,_0x29c1c2){_0x5b3cb7=_0x5b3cb7-0x0;var _0x5bd635=_0x9ffd[_0x5b3cb7];return _0x5bd635;};'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 fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xe')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd9ff('0x10')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);module[_0xd9ff('0x12')]=router; \ No newline at end of file +var _0x8603=['../../components/interaction/service','./squareMessage.controller','isAuthenticated','index','get','/:id','create','put','update','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x11c6b8,_0x5b2d7b){var _0x38b38f=function(_0x641ad0){while(--_0x641ad0){_0x11c6b8['push'](_0x11c6b8['shift']());}};_0x38b38f(++_0x5b2d7b);}(_0x8603,0x190));var _0x3860=function(_0x5b756c,_0x3621b6){_0x5b756c=_0x5b756c-0x0;var _0x2e0952=_0x8603[_0x5b756c];return _0x2e0952;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3860('0x3'));var auth=require(_0x3860('0x4'));var interaction=require(_0x3860('0x5'));var config=require('../../config/environment');var controller=require(_0x3860('0x6'));router['get']('/',auth[_0x3860('0x7')](),controller[_0x3860('0x8')]);router[_0x3860('0x9')](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3860('0xb')]);router[_0x3860('0xc')]('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xd')]);router['delete'](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['destroy']);module[_0x3860('0xe')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 9dea98d..5074a92 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 _0x9cdd=['medium','ENUM','out','exports','STRING','TEXT'];(function(_0x4e5ab4,_0x289d30){var _0x1af4c4=function(_0x1602c5){while(--_0x1602c5){_0x4e5ab4['push'](_0x4e5ab4['shift']());}};_0x1af4c4(++_0x289d30);}(_0x9cdd,0x13b));var _0xd9cd=function(_0x536b37,_0x5c69dc){_0x536b37=_0x536b37-0x0;var _0x57898f=_0x9cdd[_0x536b37];return _0x57898f;};'use strict';var Sequelize=require('sequelize');module[_0xd9cd('0x0')]={'uniqueid':{'type':Sequelize[_0xd9cd('0x1')]},'body':{'type':Sequelize[_0xd9cd('0x2')](_0xd9cd('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xd9cd('0x4')]('in',_0xd9cd('0x5')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0xd9cd('0x1')]},'providerResponse':{'type':Sequelize[_0xd9cd('0x2')]}}; \ No newline at end of file +var _0x327b=['TEXT','medium','ENUM','out','exports','STRING'];(function(_0x1263f6,_0x1044ca){var _0x262bd7=function(_0x3394f0){while(--_0x3394f0){_0x1263f6['push'](_0x1263f6['shift']());}};_0x262bd7(++_0x1044ca);}(_0x327b,0xa0));var _0xb327=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x327b[_0xdea41a];return _0x15d0d8;};'use strict';var Sequelize=require('sequelize');module[_0xb327('0x0')]={'uniqueid':{'type':Sequelize[_0xb327('0x1')]},'body':{'type':Sequelize[_0xb327('0x2')](_0xb327('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xb327('0x4')]('in',_0xb327('0x5')),'defaultValue':_0xb327('0x5'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xb327('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 73263fd..44f66ac 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 _0x094f=['mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','end','sendStatus','error','stack','name','map','SquareMessage','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x094f,0x80));var _0xf094=function(_0x1347f8,_0x233feb){_0x1347f8=_0x1347f8-0x0;var _0x218368=_0x094f[_0x1347f8];return _0x218368;};'use strict';var emlformat=require(_0xf094('0x0'));var rimraf=require(_0xf094('0x1'));var zipdir=require(_0xf094('0x2'));var jsonpatch=require(_0xf094('0x3'));var rp=require('request-promise');var moment=require(_0xf094('0x4'));var BPromise=require(_0xf094('0x5'));var Mustache=require(_0xf094('0x6'));var util=require('util');var path=require('path');var sox=require(_0xf094('0x7'));var csv=require(_0xf094('0x8'));var ejs=require(_0xf094('0x9'));var fs=require('fs');var fs_extra=require(_0xf094('0xa'));var _=require(_0xf094('0xb'));var squel=require(_0xf094('0xc'));var crypto=require(_0xf094('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf094('0xe'));var authService=require(_0xf094('0xf'));var qs=require(_0xf094('0x10'));var as=require(_0xf094('0x11'));var hardwareService=require(_0xf094('0x12'));var logger=require('../../config/logger')(_0xf094('0x13'));var utils=require(_0xf094('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41d385,_0x4d99bd){_0x4d99bd=_0x4d99bd||0xcc;return function(_0x583a23){if(_0x583a23){return _0x41d385['sendStatus'](_0x4d99bd);}return _0x41d385[_0xf094('0x15')](_0x4d99bd)['end']();};}function respondWithResult(_0x4b97cb,_0x32f64d){_0x32f64d=_0x32f64d||0xc8;return function(_0x29d688){if(_0x29d688){return _0x4b97cb[_0xf094('0x15')](_0x32f64d)[_0xf094('0x16')](_0x29d688);}};}function respondWithFilteredResult(_0x13471a,_0x187460){return function(_0x51f2af){if(_0x51f2af){var _0x47ecb1=typeof _0x187460[_0xf094('0x17')]===_0xf094('0x18')&&typeof _0x187460[_0xf094('0x19')]===_0xf094('0x18');var _0x2be8d0=_0x51f2af[_0xf094('0x1a')];var _0x584e99=_0x47ecb1?0x0:_0x187460[_0xf094('0x17')];var _0x45542d=_0x47ecb1?_0x51f2af[_0xf094('0x1a')]:_0x187460['offset']+_0x187460['limit'];var _0x5ec15d;if(_0x45542d>=_0x2be8d0){_0x45542d=_0x2be8d0;_0x5ec15d=0xc8;}else{_0x5ec15d=0xce;}_0x13471a['status'](_0x5ec15d);return _0x13471a[_0xf094('0x1b')](_0xf094('0x1c'),_0x584e99+'-'+_0x45542d+'/'+_0x2be8d0)[_0xf094('0x16')](_0x51f2af);}return null;};}function patchUpdates(_0x4e601d){return function(_0x109a0f){try{jsonpatch[_0xf094('0x1d')](_0x109a0f,_0x4e601d,!![]);}catch(_0x7b77b8){return BPromise[_0xf094('0x1e')](_0x7b77b8);}return _0x109a0f['save']();};}function saveUpdates(_0x3aff2f,_0x2db49d){return function(_0x5e9de5){if(_0x5e9de5){return _0x5e9de5[_0xf094('0x1f')](_0x3aff2f)['then'](function(_0x3a9fe3){return _0x3a9fe3;});}return null;};}function removeEntity(_0x4f74af,_0x2e0c75){return function(_0xbf4029){if(_0xbf4029){return _0xbf4029[_0xf094('0x20')]()[_0xf094('0x21')](function(){_0x4f74af[_0xf094('0x15')](0xcc)[_0xf094('0x22')]();});}};}function handleEntityNotFound(_0x51f7f4,_0x5f44ff){return function(_0xaf91fa){if(!_0xaf91fa){_0x51f7f4[_0xf094('0x23')](0x194);}return _0xaf91fa;};}function handleError(_0x5621d8,_0x14016c){_0x14016c=_0x14016c||0x1f4;return function(_0xc1ff00){logger[_0xf094('0x24')](_0xc1ff00[_0xf094('0x25')]);if(_0xc1ff00[_0xf094('0x26')]){delete _0xc1ff00['name'];}_0x5621d8[_0xf094('0x15')](_0x14016c)['send'](_0xc1ff00);};}exports['index']=function(_0xfef319,_0x32f5ca){var _0x211faa={},_0x112415={},_0x5537cf={'count':0x0,'rows':[]};var _0x4a7575=_[_0xf094('0x27')](db[_0xf094('0x28')][_0xf094('0x29')],function(_0xcc5640){return{'name':_0xcc5640['fieldName'],'type':_0xcc5640[_0xf094('0x2a')]['key']};});_0x112415['model']=_[_0xf094('0x27')](_0x4a7575,_0xf094('0x26'));_0x112415['query']=_[_0xf094('0x2b')](_0xfef319[_0xf094('0x2c')]);_0x112415[_0xf094('0x2d')]=_[_0xf094('0x2e')](_0x112415[_0xf094('0x2f')],_0x112415[_0xf094('0x2c')]);_0x211faa[_0xf094('0x30')]=_[_0xf094('0x2e')](_0x112415['model'],qs[_0xf094('0x31')](_0xfef319[_0xf094('0x2c')][_0xf094('0x31')]));_0x211faa[_0xf094('0x30')]=_0x211faa['attributes'][_0xf094('0x32')]?_0x211faa['attributes']:_0x112415['model'];if(!_0xfef319[_0xf094('0x2c')]['hasOwnProperty']('nolimit')){_0x211faa[_0xf094('0x19')]=qs[_0xf094('0x19')](_0xfef319[_0xf094('0x2c')][_0xf094('0x19')]);_0x211faa[_0xf094('0x17')]=qs[_0xf094('0x17')](_0xfef319[_0xf094('0x2c')][_0xf094('0x17')]);}_0x211faa[_0xf094('0x33')]=qs[_0xf094('0x34')](_0xfef319[_0xf094('0x2c')]['sort']);_0x211faa[_0xf094('0x35')]=qs[_0xf094('0x2d')](_[_0xf094('0x36')](_0xfef319[_0xf094('0x2c')],_0x112415[_0xf094('0x2d')]),_0x4a7575);if(_0xfef319[_0xf094('0x2c')][_0xf094('0x37')]){_0x211faa['where']=_[_0xf094('0x38')](_0x211faa[_0xf094('0x35')],{'$or':_[_0xf094('0x27')](_0x4a7575,function(_0x5320d6){if(_0x5320d6[_0xf094('0x2a')]!=='VIRTUAL'){var _0x281e56={};_0x281e56[_0x5320d6[_0xf094('0x26')]]={'$like':'%'+_0xfef319['query'][_0xf094('0x37')]+'%'};return _0x281e56;}})});}_0x211faa=_[_0xf094('0x38')]({},_0x211faa,_0xfef319[_0xf094('0x39')]);var _0x46c703={'where':_0x211faa[_0xf094('0x35')]};return db[_0xf094('0x28')][_0xf094('0x1a')](_0x46c703)[_0xf094('0x21')](function(_0xb92643){_0x5537cf['count']=_0xb92643;if(_0xfef319['query'][_0xf094('0x3a')]){_0x211faa[_0xf094('0x3b')]=[{'all':!![]}];}return db['SquareMessage']['findAll'](_0x211faa);})[_0xf094('0x21')](function(_0x306812){_0x5537cf[_0xf094('0x3c')]=_0x306812;return _0x5537cf;})['then'](respondWithFilteredResult(_0x32f5ca,_0x211faa))[_0xf094('0x3d')](handleError(_0x32f5ca,null));};exports[_0xf094('0x3e')]=function(_0x4da2b2,_0x1ce616){var _0x1090c2={'raw':!![],'where':{'id':_0x4da2b2[_0xf094('0x3f')]['id']}},_0x237b59={};_0x237b59[_0xf094('0x2f')]=_[_0xf094('0x2b')](db['SquareMessage']['rawAttributes']);_0x237b59[_0xf094('0x2c')]=_['keys'](_0x4da2b2['query']);_0x237b59[_0xf094('0x2d')]=_[_0xf094('0x2e')](_0x237b59[_0xf094('0x2f')],_0x237b59['query']);_0x1090c2['attributes']=_[_0xf094('0x2e')](_0x237b59[_0xf094('0x2f')],qs[_0xf094('0x31')](_0x4da2b2[_0xf094('0x2c')][_0xf094('0x31')]));_0x1090c2[_0xf094('0x30')]=_0x1090c2[_0xf094('0x30')]['length']?_0x1090c2[_0xf094('0x30')]:_0x237b59['model'];if(_0x4da2b2['query'][_0xf094('0x3a')]){_0x1090c2[_0xf094('0x3b')]=[{'all':!![]}];}_0x1090c2=_[_0xf094('0x38')]({},_0x1090c2,_0x4da2b2[_0xf094('0x39')]);return db[_0xf094('0x28')][_0xf094('0x40')](_0x1090c2)[_0xf094('0x21')](handleEntityNotFound(_0x1ce616,null))[_0xf094('0x21')](respondWithResult(_0x1ce616,null))['catch'](handleError(_0x1ce616,null));};exports[_0xf094('0x41')]=function(_0x33e906,_0x32370a){return db['SquareMessage']['create'](_0x33e906[_0xf094('0x42')],{})['then'](respondWithResult(_0x32370a,0xc9))[_0xf094('0x3d')](handleError(_0x32370a,null));};exports[_0xf094('0x1f')]=function(_0x30e70d,_0x1af84e){if(_0x30e70d[_0xf094('0x42')]['id']){delete _0x30e70d[_0xf094('0x42')]['id'];}return db[_0xf094('0x28')]['find']({'where':{'id':_0x30e70d[_0xf094('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1af84e,null))[_0xf094('0x21')](saveUpdates(_0x30e70d['body'],null))[_0xf094('0x21')](respondWithResult(_0x1af84e,null))[_0xf094('0x3d')](handleError(_0x1af84e,null));};exports[_0xf094('0x20')]=function(_0x431cc2,_0x451847){return db[_0xf094('0x28')]['find']({'where':{'id':_0x431cc2[_0xf094('0x3f')]['id']}})[_0xf094('0x21')](handleEntityNotFound(_0x451847,null))['then'](removeEntity(_0x451847,null))[_0xf094('0x3d')](handleError(_0x451847,null));}; \ No newline at end of file +var _0x5f66=['update','catch','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','SquareMessage','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body'];(function(_0x598983,_0x3395e0){var _0x2e0248=function(_0x559c7b){while(--_0x559c7b){_0x598983['push'](_0x598983['shift']());}};_0x2e0248(++_0x3395e0);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5f66[_0x3e5086];return _0xfeb102;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'all':!![]}];}return db[_0x65f6('0x27')][_0x65f6('0x3c')](_0x4ac04b);})[_0x65f6('0x21')](function(_0xed4c96){_0x266cfe[_0x65f6('0x3d')]=_0xed4c96;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))['catch'](handleError(_0x559330,null));};exports[_0x65f6('0x3e')]=function(_0x400ed2,_0x377ae5){var _0x181798={'raw':!![],'where':{'id':_0x400ed2[_0x65f6('0x3f')]['id']}},_0x83e2d9={};_0x83e2d9[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x83e2d9[_0x65f6('0x2c')]=_[_0x65f6('0x2b')](_0x400ed2[_0x65f6('0x2c')]);_0x83e2d9[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],_0x83e2d9['query']);_0x181798[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x400ed2['query'][_0x65f6('0x2f')]));_0x181798[_0x65f6('0x30')]=_0x181798[_0x65f6('0x30')]['length']?_0x181798[_0x65f6('0x30')]:_0x83e2d9[_0x65f6('0x2a')];if(_0x400ed2[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x181798['include']=[{'all':!![]}];}_0x181798=_[_0x65f6('0x37')]({},_0x181798,_0x400ed2['options']);return db[_0x65f6('0x27')][_0x65f6('0x40')](_0x181798)['then'](handleEntityNotFound(_0x377ae5,null))[_0x65f6('0x21')](respondWithResult(_0x377ae5,null))['catch'](handleError(_0x377ae5,null));};exports[_0x65f6('0x41')]=function(_0x4d9b76,_0x2d1706){return db[_0x65f6('0x27')][_0x65f6('0x41')](_0x4d9b76[_0x65f6('0x42')],{})['then'](respondWithResult(_0x2d1706,0xc9))['catch'](handleError(_0x2d1706,null));};exports[_0x65f6('0x43')]=function(_0x15d3ba,_0x3b647a){if(_0x15d3ba[_0x65f6('0x42')]['id']){delete _0x15d3ba[_0x65f6('0x42')]['id'];}return db[_0x65f6('0x27')][_0x65f6('0x40')]({'where':{'id':_0x15d3ba[_0x65f6('0x3f')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b647a,null))['then'](saveUpdates(_0x15d3ba[_0x65f6('0x42')],null))[_0x65f6('0x21')](respondWithResult(_0x3b647a,null))[_0x65f6('0x44')](handleError(_0x3b647a,null));};exports['destroy']=function(_0x47e749,_0x42d453){return db['SquareMessage'][_0x65f6('0x40')]({'where':{'id':_0x47e749[_0x65f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x42d453,null))[_0x65f6('0x21')](removeEntity(_0x42d453,null))['catch'](handleError(_0x42d453,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index f499828..40bf339 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 _0xe664=['path','rimraf','../../config/environment','./squareMessage.attributes','define','SquareMessage','lodash','api','moment','bluebird'];(function(_0x23c779,_0x58d97e){var _0x467395=function(_0x289952){while(--_0x289952){_0x23c779['push'](_0x23c779['shift']());}};_0x467395(++_0x58d97e);}(_0xe664,0x132));var _0x4e66=function(_0x3fa508,_0x4ef55e){_0x3fa508=_0x3fa508-0x0;var _0x591477=_0xe664[_0x3fa508];return _0x591477;};'use strict';var _=require(_0x4e66('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4e66('0x1'));var moment=require(_0x4e66('0x2'));var BPromise=require(_0x4e66('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e66('0x4'));var rimraf=require(_0x4e66('0x5'));var config=require(_0x4e66('0x6'));var attributes=require(_0x4e66('0x7'));module['exports']=function(_0x38dd19,_0x375c0f){return _0x38dd19[_0x4e66('0x8')](_0x4e66('0x9'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x47e6=['moment','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','../../config/logger','api'];(function(_0x5b9206,_0x6dd88b){var _0x4bea8a=function(_0x540d17){while(--_0x540d17){_0x5b9206['push'](_0x5b9206['shift']());}};_0x4bea8a(++_0x6dd88b);}(_0x47e6,0x101));var _0x647e=function(_0x50726b,_0x5c4c6c){_0x50726b=_0x50726b-0x0;var _0x413891=_0x47e6[_0x50726b];return _0x413891;};'use strict';var _=require(_0x647e('0x0'));var util=require('util');var logger=require(_0x647e('0x1'))(_0x647e('0x2'));var moment=require(_0x647e('0x3'));var BPromise=require('bluebird');var rp=require(_0x647e('0x4'));var fs=require('fs');var path=require(_0x647e('0x5'));var rimraf=require(_0x647e('0x6'));var config=require(_0x647e('0x7'));var attributes=require(_0x647e('0x8'));module[_0x647e('0x9')]=function(_0x18b320,_0x42fbb8){return _0x18b320[_0x647e('0xa')](_0x647e('0xb'),attributes,{'tableName':_0x647e('0xc'),'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 135a759..89bc07a 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 _0xb5fc=['then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request'];(function(_0x309d6,_0x1cfd0d){var _0x50e813=function(_0x293f4b){while(--_0x293f4b){_0x309d6['push'](_0x309d6['shift']());}};_0x50e813(++_0x1cfd0d);}(_0xb5fc,0x11e));var _0xcb5f=function(_0x409421,_0x1e50c1){_0x409421=_0x409421-0x0;var _0x5987ac=_0xb5fc[_0x409421];return _0x5987ac;};'use strict';var _=require(_0xcb5f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcb5f('0x1'));var rs=require(_0xcb5f('0x2'));var fs=require('fs');var Redis=require(_0xcb5f('0x3'));var db=require(_0xcb5f('0x4'))['db'];var utils=require(_0xcb5f('0x5'));var logger=require('../../config/logger')(_0xcb5f('0x6'));var config=require('../../config/environment');var jayson=require(_0xcb5f('0x7'));var client=jayson[_0xcb5f('0x8')][_0xcb5f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x404b18,_0x115955,_0x4b359f){return new BPromise(function(_0x1bd54e,_0x398d54){return client[_0xcb5f('0xa')](_0x404b18,_0x4b359f)[_0xcb5f('0xb')](function(_0x5461e0){logger[_0xcb5f('0xc')](_0xcb5f('0xd'),_0x115955,_0xcb5f('0xe'));logger['debug']('SquareMessage,\x20%s,\x20%s,\x20%s',_0x115955,_0xcb5f('0xe'),JSON[_0xcb5f('0xf')](_0x5461e0));if(_0x5461e0[_0xcb5f('0x10')]){if(_0x5461e0['error']['code']===0x1f4){logger[_0xcb5f('0x10')](_0xcb5f('0xd'),_0x115955,_0x5461e0['error'][_0xcb5f('0x11')]);return _0x398d54(_0x5461e0[_0xcb5f('0x10')][_0xcb5f('0x11')]);}logger[_0xcb5f('0x10')]('SquareMessage,\x20%s,\x20%s',_0x115955,_0x5461e0[_0xcb5f('0x10')][_0xcb5f('0x11')]);return _0x1bd54e(_0x5461e0[_0xcb5f('0x10')]['message']);}else{logger['info'](_0xcb5f('0xd'),_0x115955,_0xcb5f('0xe'));_0x1bd54e(_0x5461e0[_0xcb5f('0x12')][_0xcb5f('0x11')]);}})[_0xcb5f('0x13')](function(_0x5605e9){logger[_0xcb5f('0x10')](_0xcb5f('0xd'),_0x115955,_0x5605e9);_0x398d54(_0x5605e9);});});}exports[_0xcb5f('0x14')]=function(_0x3abc03){var _0x575256=this;return new Promise(function(_0xcc8021,_0x5c8df3){return db[_0xcb5f('0x15')][_0xcb5f('0x16')](_0x3abc03[_0xcb5f('0x17')],{'raw':_0x3abc03[_0xcb5f('0x18')]?_0x3abc03[_0xcb5f('0x18')][_0xcb5f('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x43f827){logger[_0xcb5f('0xc')]('CreateSquareMessage',_0x3abc03);logger[_0xcb5f('0x1a')]('CreateSquareMessage',_0x3abc03,JSON[_0xcb5f('0xf')](_0x43f827));_0xcc8021(_0x43f827);})[_0xcb5f('0x13')](function(_0xf90a1c){logger[_0xcb5f('0x10')](_0xcb5f('0x14'),_0xf90a1c[_0xcb5f('0x11')],_0x3abc03);_0x5c8df3(_0x575256[_0xcb5f('0x10')](0x1f4,_0xf90a1c[_0xcb5f('0x11')]));});});}; \ No newline at end of file +var _0x9a83=['code','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xcd120c,_0x1bca47){var _0x1f73da=function(_0x57c6eb){while(--_0x57c6eb){_0xcd120c['push'](_0xcd120c['shift']());}};_0x1f73da(++_0x1bca47);}(_0x9a83,0x10a));var _0x39a8=function(_0x47408e,_0x481428){_0x47408e=_0x47408e-0x0;var _0x1636bc=_0x9a83[_0x47408e];return _0x1636bc;};'use strict';var _=require(_0x39a8('0x0'));var util=require(_0x39a8('0x1'));var moment=require(_0x39a8('0x2'));var BPromise=require(_0x39a8('0x3'));var rs=require(_0x39a8('0x4'));var fs=require('fs');var Redis=require(_0x39a8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x39a8('0x6'));var logger=require(_0x39a8('0x7'))(_0x39a8('0x8'));var config=require(_0x39a8('0x9'));var jayson=require(_0x39a8('0xa'));var client=jayson[_0x39a8('0xb')][_0x39a8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x396346,_0x36a319,_0x4d2d51){return new BPromise(function(_0x38f69a,_0x2a4849){return client[_0x39a8('0xd')](_0x396346,_0x4d2d51)[_0x39a8('0xe')](function(_0x4aa338){logger[_0x39a8('0xf')](_0x39a8('0x10'),_0x36a319,_0x39a8('0x11'));logger[_0x39a8('0x12')](_0x39a8('0x13'),_0x36a319,_0x39a8('0x11'),JSON[_0x39a8('0x14')](_0x4aa338));if(_0x4aa338['error']){if(_0x4aa338[_0x39a8('0x15')][_0x39a8('0x16')]===0x1f4){logger[_0x39a8('0x15')](_0x39a8('0x10'),_0x36a319,_0x4aa338[_0x39a8('0x15')]['message']);return _0x2a4849(_0x4aa338[_0x39a8('0x15')][_0x39a8('0x17')]);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x36a319,_0x4aa338[_0x39a8('0x15')][_0x39a8('0x17')]);return _0x38f69a(_0x4aa338[_0x39a8('0x15')][_0x39a8('0x17')]);}else{logger['info'](_0x39a8('0x10'),_0x36a319,'request\x20sent');_0x38f69a(_0x4aa338[_0x39a8('0x18')][_0x39a8('0x17')]);}})[_0x39a8('0x19')](function(_0x36b438){logger[_0x39a8('0x15')](_0x39a8('0x10'),_0x36a319,_0x36b438);_0x2a4849(_0x36b438);});});}exports[_0x39a8('0x1a')]=function(_0x201cdc){var _0x18be22=this;return new Promise(function(_0x443e56,_0x4bc26f){return db[_0x39a8('0x1b')][_0x39a8('0x1c')](_0x201cdc[_0x39a8('0x1d')],{'raw':_0x201cdc[_0x39a8('0x1e')]?_0x201cdc['options'][_0x39a8('0x1f')]===undefined?!![]:![]:!![]})[_0x39a8('0xe')](function(_0x491230){logger[_0x39a8('0xf')]('CreateSquareMessage',_0x201cdc);logger[_0x39a8('0x12')](_0x39a8('0x1a'),_0x201cdc,JSON[_0x39a8('0x14')](_0x491230));_0x443e56(_0x491230);})['catch'](function(_0x4f9395){logger[_0x39a8('0x15')]('CreateSquareMessage',_0x4f9395['message'],_0x201cdc);_0x4bc26f(_0x18be22[_0x39a8('0x15')](0x1f4,_0x4f9395[_0x39a8('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index d560f4d..98365f7 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 _0xa3ce=['get','/:id/test','15s','test','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./squareOdbc.controller','/:id','isAuthenticated'];(function(_0x5e6abf,_0x5a8a52){var _0x442a56=function(_0x47a309){while(--_0x47a309){_0x5e6abf['push'](_0x5e6abf['shift']());}};_0x442a56(++_0x5a8a52);}(_0xa3ce,0xfa));var _0xea3c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa3ce[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xea3c('0x0'));var util=require(_0xea3c('0x1'));var path=require(_0xea3c('0x2'));var timeout=require(_0xea3c('0x3'));var express=require(_0xea3c('0x4'));var router=express[_0xea3c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xea3c('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xea3c('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xea3c('0x8'),auth[_0xea3c('0x9')](),controller['show']);router[_0xea3c('0xa')](_0xea3c('0xb'),auth['isAuthenticated'](),timeout(_0xea3c('0xc')),controller[_0xea3c('0xd')]);router[_0xea3c('0xe')]('/',auth[_0xea3c('0x9')](),controller[_0xea3c('0xf')]);router[_0xea3c('0x10')](_0xea3c('0x8'),auth[_0xea3c('0x9')](),controller[_0xea3c('0x11')]);router['delete'](_0xea3c('0x8'),auth[_0xea3c('0x9')](),controller[_0xea3c('0x12')]);module[_0xea3c('0x13')]=router; \ No newline at end of file +var _0x9730=['delete','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','test','post','create','put','update'];(function(_0x43c3fa,_0x2870f9){var _0x3a134d=function(_0x2b45fc){while(--_0x2b45fc){_0x43c3fa['push'](_0x43c3fa['shift']());}};_0x3a134d(++_0x2870f9);}(_0x9730,0xa3));var _0x0973=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9730[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x0973('0x0'));var express=require(_0x0973('0x1'));var router=express[_0x0973('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0973('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0973('0x4'));var controller=require(_0x0973('0x5'));router[_0x0973('0x6')]('/',auth[_0x0973('0x7')](),controller[_0x0973('0x8')]);router['get'](_0x0973('0x9'),auth[_0x0973('0x7')](),controller[_0x0973('0xa')]);router['get'](_0x0973('0xb'),auth[_0x0973('0x7')](),timeout('15s'),controller[_0x0973('0xc')]);router[_0x0973('0xd')]('/',auth['isAuthenticated'](),controller[_0x0973('0xe')]);router[_0x0973('0xf')](_0x0973('0x9'),auth[_0x0973('0x7')](),controller[_0x0973('0x10')]);router[_0x0973('0x11')](_0x0973('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 915ce78..93973e0 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 _0xabd1=['exports','STRING','name','sequelize'];(function(_0x1e5a87,_0xad9d5){var _0x309977=function(_0x1763c5){while(--_0x1763c5){_0x1e5a87['push'](_0x1e5a87['shift']());}};_0x309977(++_0xad9d5);}(_0xabd1,0x10f));var _0x1abd=function(_0x284bc3,_0x22dffe){_0x284bc3=_0x284bc3-0x0;var _0x41ac81=_0xabd1[_0x284bc3];return _0x41ac81;};'use strict';var Sequelize=require(_0x1abd('0x0'));module[_0x1abd('0x1')]={'name':{'type':Sequelize[_0x1abd('0x2')],'unique':_0x1abd('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x1abd('0x2')]},'description':{'type':Sequelize[_0x1abd('0x2')]}}; \ No newline at end of file +var _0xc9aa=['name','sequelize','exports','STRING'];(function(_0x261408,_0x213155){var _0x41cd82=function(_0x2135d8){while(--_0x2135d8){_0x261408['push'](_0x261408['shift']());}};_0x41cd82(++_0x213155);}(_0xc9aa,0x131));var _0xac9a=function(_0x9307ea,_0x38968a){_0x9307ea=_0x9307ea-0x0;var _0x295554=_0xc9aa[_0x9307ea];return _0x295554;};'use strict';var Sequelize=require(_0xac9a('0x0'));module[_0xac9a('0x1')]={'name':{'type':Sequelize[_0xac9a('0x2')],'unique':_0xac9a('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0xac9a('0x2')]},'description':{'type':Sequelize[_0xac9a('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 77f83bb..54ffbc3 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 _0x1532=['body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','closeSync','eml-format','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','count','set','apply','reject','update','then','UserProfileResource','destroy','error','stack','name','send','map','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','SquareOdbc','include','catch','params','rawAttributes','includeAll','find','create'];(function(_0x40fa80,_0x39d328){var _0x4d05c3=function(_0x108668){while(--_0x108668){_0x40fa80['push'](_0x40fa80['shift']());}};_0x4d05c3(++_0x39d328);}(_0x1532,0x1d2));var _0x2153=function(_0x4cb947,_0x62b4f9){_0x4cb947=_0x4cb947-0x0;var _0xe2b62a=_0x1532[_0x4cb947];return _0xe2b62a;};'use strict';var emlformat=require(_0x2153('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2153('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2153('0x2'));var moment=require(_0x2153('0x3'));var BPromise=require(_0x2153('0x4'));var Mustache=require('mustache');var util=require(_0x2153('0x5'));var path=require('path');var sox=require(_0x2153('0x6'));var csv=require(_0x2153('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2153('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2153('0x9'));var jsforce=require(_0x2153('0xa'));var deskjs=require(_0x2153('0xb'));var toCsv=require(_0x2153('0x7'));var querystring=require(_0x2153('0xc'));var Papa=require(_0x2153('0xd'));var Redis=require('ioredis');var authService=require(_0x2153('0xe'));var qs=require(_0x2153('0xf'));var as=require(_0x2153('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2153('0x11'));var utils=require('../../config/utils');var config=require(_0x2153('0x12'));var licenseUtil=require(_0x2153('0x13'));var db=require(_0x2153('0x14'))['db'];function respondWithStatusCode(_0x3c8705,_0x2a0db4){_0x2a0db4=_0x2a0db4||0xcc;return function(_0x3f52d6){if(_0x3f52d6){return _0x3c8705['sendStatus'](_0x2a0db4);}return _0x3c8705['status'](_0x2a0db4)[_0x2153('0x15')]();};}function respondWithResult(_0x4c31b1,_0x290e32){_0x290e32=_0x290e32||0xc8;return function(_0x415dc7){if(_0x415dc7){return _0x4c31b1[_0x2153('0x16')](_0x290e32)[_0x2153('0x17')](_0x415dc7);}};}function respondWithFilteredResult(_0x3b3bdc,_0x29fab1){return function(_0x49f531){if(_0x49f531){var _0x38c837=typeof _0x29fab1[_0x2153('0x18')]==='undefined'&&typeof _0x29fab1[_0x2153('0x19')]==='undefined';var _0x1eb595=_0x49f531[_0x2153('0x1a')];var _0x2a85b5=_0x38c837?0x0:_0x29fab1[_0x2153('0x18')];var _0x2013e2=_0x38c837?_0x49f531[_0x2153('0x1a')]:_0x29fab1[_0x2153('0x18')]+_0x29fab1[_0x2153('0x19')];var _0x4e1acb;if(_0x2013e2>=_0x1eb595){_0x2013e2=_0x1eb595;_0x4e1acb=0xc8;}else{_0x4e1acb=0xce;}_0x3b3bdc[_0x2153('0x16')](_0x4e1acb);return _0x3b3bdc[_0x2153('0x1b')]('Content-Range',_0x2a85b5+'-'+_0x2013e2+'/'+_0x1eb595)[_0x2153('0x17')](_0x49f531);}return null;};}function patchUpdates(_0x459d30){return function(_0x16940f){try{jsonpatch[_0x2153('0x1c')](_0x16940f,_0x459d30,!![]);}catch(_0xdd4da0){return BPromise[_0x2153('0x1d')](_0xdd4da0);}return _0x16940f['save']();};}function saveUpdates(_0x4baf53,_0x2b8fc4){return function(_0x488165){if(_0x488165){return _0x488165[_0x2153('0x1e')](_0x4baf53)['then'](function(_0x4c67a5){return _0x4c67a5;});}return null;};}function removeEntity(_0x1a8455,_0x27e4fc){return function(_0x593803){if(_0x593803){return _0x593803['destroy']()[_0x2153('0x1f')](function(){var _0x4f9c14=_0x593803['get']({'plain':!![]});var _0x18da4b='ODBC';return db[_0x2153('0x20')][_0x2153('0x21')]({'where':{'type':_0x18da4b,'resourceId':_0x4f9c14['id']}})[_0x2153('0x1f')](function(){return _0x593803;});})[_0x2153('0x1f')](function(){_0x1a8455[_0x2153('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x151972,_0x2a7f91){return function(_0x5bec1d){if(!_0x5bec1d){_0x151972['sendStatus'](0x194);}return _0x5bec1d;};}function handleError(_0x1cf182,_0x3efd74){_0x3efd74=_0x3efd74||0x1f4;return function(_0x343f50){logger[_0x2153('0x22')](_0x343f50[_0x2153('0x23')]);if(_0x343f50[_0x2153('0x24')]){delete _0x343f50[_0x2153('0x24')];}_0x1cf182[_0x2153('0x16')](_0x3efd74)[_0x2153('0x25')](_0x343f50);};}exports['index']=function(_0x1287f0,_0x1a5575){var _0x4a9883={},_0x2dabcc={},_0x11461c={'count':0x0,'rows':[]};var _0x5ccca7=_[_0x2153('0x26')](db['SquareOdbc']['rawAttributes'],function(_0x4afeba){return{'name':_0x4afeba['fieldName'],'type':_0x4afeba[_0x2153('0x27')][_0x2153('0x28')]};});_0x2dabcc['model']=_['map'](_0x5ccca7,_0x2153('0x24'));_0x2dabcc[_0x2153('0x29')]=_[_0x2153('0x2a')](_0x1287f0[_0x2153('0x29')]);_0x2dabcc[_0x2153('0x2b')]=_['intersection'](_0x2dabcc[_0x2153('0x2c')],_0x2dabcc['query']);_0x4a9883[_0x2153('0x2d')]=_[_0x2153('0x2e')](_0x2dabcc[_0x2153('0x2c')],qs[_0x2153('0x2f')](_0x1287f0[_0x2153('0x29')][_0x2153('0x2f')]));_0x4a9883[_0x2153('0x2d')]=_0x4a9883[_0x2153('0x2d')][_0x2153('0x30')]?_0x4a9883[_0x2153('0x2d')]:_0x2dabcc[_0x2153('0x2c')];if(!_0x1287f0[_0x2153('0x29')][_0x2153('0x31')](_0x2153('0x32'))){_0x4a9883['limit']=qs[_0x2153('0x19')](_0x1287f0[_0x2153('0x29')][_0x2153('0x19')]);_0x4a9883[_0x2153('0x18')]=qs['offset'](_0x1287f0[_0x2153('0x29')][_0x2153('0x18')]);}_0x4a9883['order']=qs['sort'](_0x1287f0[_0x2153('0x29')][_0x2153('0x33')]);_0x4a9883[_0x2153('0x34')]=qs['filters'](_[_0x2153('0x35')](_0x1287f0['query'],_0x2dabcc[_0x2153('0x2b')]),_0x5ccca7);if(_0x1287f0['query'][_0x2153('0x36')]){_0x4a9883[_0x2153('0x34')]=_[_0x2153('0x37')](_0x4a9883[_0x2153('0x34')],{'$or':_[_0x2153('0x26')](_0x5ccca7,function(_0x510e82){if(_0x510e82[_0x2153('0x27')]!==_0x2153('0x38')){var _0x14070d={};_0x14070d[_0x510e82['name']]={'$like':'%'+_0x1287f0[_0x2153('0x29')][_0x2153('0x36')]+'%'};return _0x14070d;}})});}_0x4a9883=_[_0x2153('0x37')]({},_0x4a9883,_0x1287f0[_0x2153('0x39')]);var _0x34996={'where':_0x4a9883[_0x2153('0x34')]};return db[_0x2153('0x3a')][_0x2153('0x1a')](_0x34996)[_0x2153('0x1f')](function(_0x19300a){_0x11461c[_0x2153('0x1a')]=_0x19300a;if(_0x1287f0['query']['includeAll']){_0x4a9883[_0x2153('0x3b')]=[{'all':!![]}];}return db[_0x2153('0x3a')]['findAll'](_0x4a9883);})[_0x2153('0x1f')](function(_0x392924){_0x11461c['rows']=_0x392924;return _0x11461c;})['then'](respondWithFilteredResult(_0x1a5575,_0x4a9883))[_0x2153('0x3c')](handleError(_0x1a5575,null));};exports['show']=function(_0x2f72ba,_0x3cb6fe){var _0x4c20a6={'raw':!![],'where':{'id':_0x2f72ba[_0x2153('0x3d')]['id']}},_0x53fe7a={};_0x53fe7a['model']=_[_0x2153('0x2a')](db[_0x2153('0x3a')][_0x2153('0x3e')]);_0x53fe7a[_0x2153('0x29')]=_[_0x2153('0x2a')](_0x2f72ba[_0x2153('0x29')]);_0x53fe7a[_0x2153('0x2b')]=_[_0x2153('0x2e')](_0x53fe7a[_0x2153('0x2c')],_0x53fe7a['query']);_0x4c20a6['attributes']=_[_0x2153('0x2e')](_0x53fe7a[_0x2153('0x2c')],qs[_0x2153('0x2f')](_0x2f72ba[_0x2153('0x29')][_0x2153('0x2f')]));_0x4c20a6[_0x2153('0x2d')]=_0x4c20a6['attributes']['length']?_0x4c20a6[_0x2153('0x2d')]:_0x53fe7a['model'];if(_0x2f72ba['query'][_0x2153('0x3f')]){_0x4c20a6[_0x2153('0x3b')]=[{'all':!![]}];}_0x4c20a6=_[_0x2153('0x37')]({},_0x4c20a6,_0x2f72ba['options']);return db[_0x2153('0x3a')][_0x2153('0x40')](_0x4c20a6)[_0x2153('0x1f')](handleEntityNotFound(_0x3cb6fe,null))[_0x2153('0x1f')](respondWithResult(_0x3cb6fe,null))[_0x2153('0x3c')](handleError(_0x3cb6fe,null));};exports[_0x2153('0x41')]=function(_0x40612c,_0x1387d1){return db[_0x2153('0x3a')]['create'](_0x40612c[_0x2153('0x42')],{})[_0x2153('0x1f')](function(_0x169842){var _0x19d8ab=_0x40612c[_0x2153('0x43')][_0x2153('0x44')]({'plain':!![]});if(!_0x19d8ab)throw new Error(_0x2153('0x45'));if(_0x19d8ab['role']==='user'){var _0x4c34b3=_0x169842[_0x2153('0x44')]({'plain':!![]});var _0x1d050f='ODBC';return db[_0x2153('0x46')]['find']({'where':{'name':_0x1d050f,'userProfileId':_0x19d8ab[_0x2153('0x47')]},'raw':!![]})[_0x2153('0x1f')](function(_0x371110){if(_0x371110&&_0x371110['autoAssociation']===0x0){return db['UserProfileResource'][_0x2153('0x41')]({'name':_0x4c34b3['name'],'resourceId':_0x4c34b3['id'],'type':_0x371110[_0x2153('0x24')],'sectionId':_0x371110['id']},{})[_0x2153('0x1f')](function(){return _0x169842;});}else{return _0x169842;}})[_0x2153('0x3c')](function(_0x32ba67){logger[_0x2153('0x22')](_0x2153('0x48'),_0x32ba67);throw _0x32ba67;});}return _0x169842;})[_0x2153('0x1f')](respondWithResult(_0x1387d1,0xc9))[_0x2153('0x3c')](handleError(_0x1387d1,null));};exports[_0x2153('0x1e')]=function(_0x32fb2e,_0x15155e){if(_0x32fb2e[_0x2153('0x42')]['id']){delete _0x32fb2e[_0x2153('0x42')]['id'];}return db[_0x2153('0x3a')][_0x2153('0x40')]({'where':{'id':_0x32fb2e['params']['id']}})[_0x2153('0x1f')](handleEntityNotFound(_0x15155e,null))['then'](saveUpdates(_0x32fb2e[_0x2153('0x42')],null))['then'](respondWithResult(_0x15155e,null))[_0x2153('0x3c')](handleError(_0x15155e,null));};exports[_0x2153('0x21')]=function(_0x351978,_0xc1bc5a){return db[_0x2153('0x3a')]['find']({'where':{'id':_0x351978['params']['id']}})[_0x2153('0x1f')](handleEntityNotFound(_0xc1bc5a,null))['then'](removeEntity(_0xc1bc5a,null))[_0x2153('0x3c')](handleError(_0xc1bc5a,null));};exports[_0x2153('0x49')]=function(_0x1d9bab,_0xcf6218,_0x49e635){var _0x45db02;return db[_0x2153('0x3a')][_0x2153('0x40')]({'where':{'id':_0x1d9bab[_0x2153('0x3d')]['id']},'attributes':['id',_0x2153('0x4a')]})[_0x2153('0x1f')](handleEntityNotFound(_0xcf6218,null))[_0x2153('0x1f')](function(_0x387555){if(_0x387555){var _0x27d65a=require('odbc')();_0x27d65a['openSync'](_0x387555['dsn']);_0x27d65a[_0x2153('0x4b')]();return _0x387555;}})[_0x2153('0x1f')](respondWithResult(_0xcf6218,null))[_0x2153('0x3c')](handleError(_0xcf6218,null));}; \ No newline at end of file +var _0xace5=['error','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','filter','where','merge','options','SquareOdbc','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','dsn','openSync','closeSync','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','ODBC','UserProfileResource'];(function(_0x402eff,_0x2525f2){var _0x2eb371=function(_0x15e9b3){while(--_0x15e9b3){_0x402eff['push'](_0x402eff['shift']());}};_0x2eb371(++_0x2525f2);}(_0xace5,0xd3));var _0x5ace=function(_0x5b2810,_0x1f7e96){_0x5b2810=_0x5b2810-0x0;var _0x2bbd6a=_0xace5[_0x5b2810];return _0x2bbd6a;};'use strict';var emlformat=require(_0x5ace('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5ace('0x1'));var rp=require(_0x5ace('0x2'));var moment=require('moment');var BPromise=require(_0x5ace('0x3'));var Mustache=require(_0x5ace('0x4'));var util=require(_0x5ace('0x5'));var path=require(_0x5ace('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5ace('0x7'));var _=require(_0x5ace('0x8'));var squel=require(_0x5ace('0x9'));var crypto=require(_0x5ace('0xa'));var jsforce=require(_0x5ace('0xb'));var deskjs=require(_0x5ace('0xc'));var toCsv=require(_0x5ace('0xd'));var querystring=require(_0x5ace('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5ace('0xf'));var as=require(_0x5ace('0x10'));var hardwareService=require(_0x5ace('0x11'));var logger=require(_0x5ace('0x12'))(_0x5ace('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5ace('0x14'));var db=require(_0x5ace('0x15'))['db'];function respondWithStatusCode(_0x2ddca0,_0x1696d3){_0x1696d3=_0x1696d3||0xcc;return function(_0x1a1228){if(_0x1a1228){return _0x2ddca0[_0x5ace('0x16')](_0x1696d3);}return _0x2ddca0[_0x5ace('0x17')](_0x1696d3)[_0x5ace('0x18')]();};}function respondWithResult(_0x1b0910,_0x2041c3){_0x2041c3=_0x2041c3||0xc8;return function(_0x3fb3ea){if(_0x3fb3ea){return _0x1b0910[_0x5ace('0x17')](_0x2041c3)['json'](_0x3fb3ea);}};}function respondWithFilteredResult(_0x504e0b,_0x2a7ec4){return function(_0x5cb013){if(_0x5cb013){var _0x340168=typeof _0x2a7ec4['offset']===_0x5ace('0x19')&&typeof _0x2a7ec4[_0x5ace('0x1a')]===_0x5ace('0x19');var _0x27f4dd=_0x5cb013[_0x5ace('0x1b')];var _0x1710df=_0x340168?0x0:_0x2a7ec4[_0x5ace('0x1c')];var _0x4f7ca5=_0x340168?_0x5cb013[_0x5ace('0x1b')]:_0x2a7ec4[_0x5ace('0x1c')]+_0x2a7ec4[_0x5ace('0x1a')];var _0x35bf4e;if(_0x4f7ca5>=_0x27f4dd){_0x4f7ca5=_0x27f4dd;_0x35bf4e=0xc8;}else{_0x35bf4e=0xce;}_0x504e0b['status'](_0x35bf4e);return _0x504e0b[_0x5ace('0x1d')](_0x5ace('0x1e'),_0x1710df+'-'+_0x4f7ca5+'/'+_0x27f4dd)[_0x5ace('0x1f')](_0x5cb013);}return null;};}function patchUpdates(_0x695b4d){return function(_0x914084){try{jsonpatch[_0x5ace('0x20')](_0x914084,_0x695b4d,!![]);}catch(_0x50ffba){return BPromise[_0x5ace('0x21')](_0x50ffba);}return _0x914084[_0x5ace('0x22')]();};}function saveUpdates(_0x28ba39,_0x2b0db1){return function(_0x32ab92){if(_0x32ab92){return _0x32ab92[_0x5ace('0x23')](_0x28ba39)[_0x5ace('0x24')](function(_0x4dc0ae){return _0x4dc0ae;});}return null;};}function removeEntity(_0x1c32c1,_0xc51b79){return function(_0x2eec0a){if(_0x2eec0a){return _0x2eec0a[_0x5ace('0x25')]()['then'](function(){var _0x19fa00=_0x2eec0a[_0x5ace('0x26')]({'plain':!![]});var _0xa98bbe=_0x5ace('0x27');return db[_0x5ace('0x28')][_0x5ace('0x25')]({'where':{'type':_0xa98bbe,'resourceId':_0x19fa00['id']}})[_0x5ace('0x24')](function(){return _0x2eec0a;});})['then'](function(){_0x1c32c1[_0x5ace('0x17')](0xcc)[_0x5ace('0x18')]();});}};}function handleEntityNotFound(_0x12ca5a,_0x11fa66){return function(_0x3579c1){if(!_0x3579c1){_0x12ca5a['sendStatus'](0x194);}return _0x3579c1;};}function handleError(_0x28d61c,_0x547de){_0x547de=_0x547de||0x1f4;return function(_0x3cb5f1){logger[_0x5ace('0x29')](_0x3cb5f1['stack']);if(_0x3cb5f1[_0x5ace('0x2a')]){delete _0x3cb5f1[_0x5ace('0x2a')];}_0x28d61c[_0x5ace('0x17')](_0x547de)[_0x5ace('0x2b')](_0x3cb5f1);};}exports[_0x5ace('0x2c')]=function(_0x3edb95,_0x1acd7c){var _0x4ec114={},_0x12b24a={},_0x412825={'count':0x0,'rows':[]};var _0x59339c=_[_0x5ace('0x2d')](db['SquareOdbc']['rawAttributes'],function(_0x4397ba){return{'name':_0x4397ba[_0x5ace('0x2e')],'type':_0x4397ba[_0x5ace('0x2f')]['key']};});_0x12b24a[_0x5ace('0x30')]=_[_0x5ace('0x2d')](_0x59339c,'name');_0x12b24a[_0x5ace('0x31')]=_[_0x5ace('0x32')](_0x3edb95[_0x5ace('0x31')]);_0x12b24a[_0x5ace('0x33')]=_[_0x5ace('0x34')](_0x12b24a[_0x5ace('0x30')],_0x12b24a[_0x5ace('0x31')]);_0x4ec114['attributes']=_[_0x5ace('0x34')](_0x12b24a[_0x5ace('0x30')],qs[_0x5ace('0x35')](_0x3edb95[_0x5ace('0x31')][_0x5ace('0x35')]));_0x4ec114['attributes']=_0x4ec114[_0x5ace('0x36')][_0x5ace('0x37')]?_0x4ec114[_0x5ace('0x36')]:_0x12b24a['model'];if(!_0x3edb95[_0x5ace('0x31')]['hasOwnProperty'](_0x5ace('0x38'))){_0x4ec114[_0x5ace('0x1a')]=qs['limit'](_0x3edb95[_0x5ace('0x31')]['limit']);_0x4ec114[_0x5ace('0x1c')]=qs[_0x5ace('0x1c')](_0x3edb95['query']['offset']);}_0x4ec114[_0x5ace('0x39')]=qs['sort'](_0x3edb95[_0x5ace('0x31')][_0x5ace('0x3a')]);_0x4ec114['where']=qs[_0x5ace('0x33')](_['pick'](_0x3edb95[_0x5ace('0x31')],_0x12b24a[_0x5ace('0x33')]),_0x59339c);if(_0x3edb95[_0x5ace('0x31')][_0x5ace('0x3b')]){_0x4ec114[_0x5ace('0x3c')]=_[_0x5ace('0x3d')](_0x4ec114[_0x5ace('0x3c')],{'$or':_[_0x5ace('0x2d')](_0x59339c,function(_0x31a660){if(_0x31a660['type']!=='VIRTUAL'){var _0x5a2ab3={};_0x5a2ab3[_0x31a660[_0x5ace('0x2a')]]={'$like':'%'+_0x3edb95[_0x5ace('0x31')][_0x5ace('0x3b')]+'%'};return _0x5a2ab3;}})});}_0x4ec114=_['merge']({},_0x4ec114,_0x3edb95[_0x5ace('0x3e')]);var _0x4d5293={'where':_0x4ec114[_0x5ace('0x3c')]};return db[_0x5ace('0x3f')]['count'](_0x4d5293)['then'](function(_0x1e5960){_0x412825['count']=_0x1e5960;if(_0x3edb95[_0x5ace('0x31')][_0x5ace('0x40')]){_0x4ec114['include']=[{'all':!![]}];}return db[_0x5ace('0x3f')][_0x5ace('0x41')](_0x4ec114);})[_0x5ace('0x24')](function(_0x196017){_0x412825[_0x5ace('0x42')]=_0x196017;return _0x412825;})[_0x5ace('0x24')](respondWithFilteredResult(_0x1acd7c,_0x4ec114))[_0x5ace('0x43')](handleError(_0x1acd7c,null));};exports[_0x5ace('0x44')]=function(_0x5bfb25,_0x5b5d74){var _0x14d849={'raw':!![],'where':{'id':_0x5bfb25[_0x5ace('0x45')]['id']}},_0x204d35={};_0x204d35[_0x5ace('0x30')]=_[_0x5ace('0x32')](db[_0x5ace('0x3f')][_0x5ace('0x46')]);_0x204d35['query']=_[_0x5ace('0x32')](_0x5bfb25[_0x5ace('0x31')]);_0x204d35[_0x5ace('0x33')]=_[_0x5ace('0x34')](_0x204d35['model'],_0x204d35[_0x5ace('0x31')]);_0x14d849[_0x5ace('0x36')]=_[_0x5ace('0x34')](_0x204d35['model'],qs[_0x5ace('0x35')](_0x5bfb25[_0x5ace('0x31')][_0x5ace('0x35')]));_0x14d849[_0x5ace('0x36')]=_0x14d849[_0x5ace('0x36')][_0x5ace('0x37')]?_0x14d849[_0x5ace('0x36')]:_0x204d35['model'];if(_0x5bfb25[_0x5ace('0x31')][_0x5ace('0x40')]){_0x14d849[_0x5ace('0x47')]=[{'all':!![]}];}_0x14d849=_[_0x5ace('0x3d')]({},_0x14d849,_0x5bfb25['options']);return db[_0x5ace('0x3f')][_0x5ace('0x48')](_0x14d849)[_0x5ace('0x24')](handleEntityNotFound(_0x5b5d74,null))[_0x5ace('0x24')](respondWithResult(_0x5b5d74,null))['catch'](handleError(_0x5b5d74,null));};exports[_0x5ace('0x49')]=function(_0x23dc0f,_0x2dd669){return db[_0x5ace('0x3f')]['create'](_0x23dc0f['body'],{})['then'](function(_0x26ae20){var _0x37ef49=_0x23dc0f[_0x5ace('0x4a')][_0x5ace('0x26')]({'plain':!![]});if(!_0x37ef49)throw new Error(_0x5ace('0x4b'));if(_0x37ef49['role']===_0x5ace('0x4a')){var _0x1ba866=_0x26ae20[_0x5ace('0x26')]({'plain':!![]});var _0x580082=_0x5ace('0x27');return db[_0x5ace('0x4c')][_0x5ace('0x48')]({'where':{'name':_0x580082,'userProfileId':_0x37ef49[_0x5ace('0x4d')]},'raw':!![]})[_0x5ace('0x24')](function(_0x5e46f4){if(_0x5e46f4&&_0x5e46f4['autoAssociation']===0x0){return db[_0x5ace('0x28')]['create']({'name':_0x1ba866[_0x5ace('0x2a')],'resourceId':_0x1ba866['id'],'type':_0x5e46f4[_0x5ace('0x2a')],'sectionId':_0x5e46f4['id']},{})[_0x5ace('0x24')](function(){return _0x26ae20;});}else{return _0x26ae20;}})['catch'](function(_0x5238fc){logger[_0x5ace('0x29')](_0x5ace('0x4e'),_0x5238fc);throw _0x5238fc;});}return _0x26ae20;})[_0x5ace('0x24')](respondWithResult(_0x2dd669,0xc9))[_0x5ace('0x43')](handleError(_0x2dd669,null));};exports['update']=function(_0x30e30c,_0x2d75fa){if(_0x30e30c[_0x5ace('0x4f')]['id']){delete _0x30e30c[_0x5ace('0x4f')]['id'];}return db[_0x5ace('0x3f')][_0x5ace('0x48')]({'where':{'id':_0x30e30c[_0x5ace('0x45')]['id']}})[_0x5ace('0x24')](handleEntityNotFound(_0x2d75fa,null))[_0x5ace('0x24')](saveUpdates(_0x30e30c['body'],null))['then'](respondWithResult(_0x2d75fa,null))['catch'](handleError(_0x2d75fa,null));};exports[_0x5ace('0x25')]=function(_0x5a02a5,_0x1ae00e){return db[_0x5ace('0x3f')][_0x5ace('0x48')]({'where':{'id':_0x5a02a5[_0x5ace('0x45')]['id']}})['then'](handleEntityNotFound(_0x1ae00e,null))['then'](removeEntity(_0x1ae00e,null))[_0x5ace('0x43')](handleError(_0x1ae00e,null));};exports[_0x5ace('0x50')]=function(_0x2a3bf5,_0x4dc754,_0x29b380){var _0x125de0;return db[_0x5ace('0x3f')][_0x5ace('0x48')]({'where':{'id':_0x2a3bf5[_0x5ace('0x45')]['id']},'attributes':['id',_0x5ace('0x51')]})[_0x5ace('0x24')](handleEntityNotFound(_0x4dc754,null))['then'](function(_0x574f11){if(_0x574f11){var _0x55e078=require('odbc')();_0x55e078[_0x5ace('0x52')](_0x574f11[_0x5ace('0x51')]);_0x55e078[_0x5ace('0x53')]();return _0x574f11;}})[_0x5ace('0x24')](respondWithResult(_0x4dc754,null))[_0x5ace('0x43')](handleError(_0x4dc754,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index edb98a1..927c2b0 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 _0x0c7e=['exports','define','SquareOdbc','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./squareOdbc.attributes'];(function(_0x350277,_0x25d306){var _0x5e418b=function(_0x19c176){while(--_0x19c176){_0x350277['push'](_0x350277['shift']());}};_0x5e418b(++_0x25d306);}(_0x0c7e,0x1b3));var _0xe0c7=function(_0x45ae0e,_0x4feee0){_0x45ae0e=_0x45ae0e-0x0;var _0x46c553=_0x0c7e[_0x45ae0e];return _0x46c553;};'use strict';var _=require(_0xe0c7('0x0'));var util=require(_0xe0c7('0x1'));var logger=require(_0xe0c7('0x2'))(_0xe0c7('0x3'));var moment=require(_0xe0c7('0x4'));var BPromise=require('bluebird');var rp=require(_0xe0c7('0x5'));var fs=require('fs');var path=require(_0xe0c7('0x6'));var rimraf=require('rimraf');var config=require(_0xe0c7('0x7'));var attributes=require(_0xe0c7('0x8'));module[_0xe0c7('0x9')]=function(_0x5e7889,_0x14b2da){return _0x5e7889[_0xe0c7('0xa')](_0xe0c7('0xb'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d54=['path','rimraf','exports','define','square_odbc','lodash','../../config/logger','api','moment'];(function(_0x4c1b90,_0x27432a){var _0xe0d2ba=function(_0x19286b){while(--_0x19286b){_0x4c1b90['push'](_0x4c1b90['shift']());}};_0xe0d2ba(++_0x27432a);}(_0x4d54,0x1b5));var _0x44d5=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x4d54[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x44d5('0x0'));var util=require('util');var logger=require(_0x44d5('0x1'))(_0x44d5('0x2'));var moment=require(_0x44d5('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x44d5('0x4'));var rimraf=require(_0x44d5('0x5'));var config=require('../../config/environment');var attributes=require('./squareOdbc.attributes');module[_0x44d5('0x6')]=function(_0x55bc5b,_0x445124){return _0x55bc5b[_0x44d5('0x7')]('SquareOdbc',attributes,{'tableName':_0x44d5('0x8'),'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 4198fe4..14fcc30 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 _0x2346=['model','debug','stringify','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','client','http','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','attributes','include','map'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x2346,0x1b6));var _0x6234=function(_0x25da9f,_0x47d72c){_0x25da9f=_0x25da9f-0x0;var _0x447588=_0x2346[_0x25da9f];return _0x447588;};'use strict';var _=require('lodash');var util=require(_0x6234('0x0'));var moment=require(_0x6234('0x1'));var BPromise=require(_0x6234('0x2'));var rs=require(_0x6234('0x3'));var fs=require('fs');var Redis=require(_0x6234('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6234('0x5'));var config=require(_0x6234('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6234('0x7')][_0x6234('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x174205,_0x1e03bc,_0x4da41e){return new BPromise(function(_0x48b51f,_0x3e8fd1){return client['request'](_0x174205,_0x4da41e)['then'](function(_0x2db6cb){logger[_0x6234('0x9')](_0x6234('0xa'),_0x1e03bc,_0x6234('0xb'));logger['debug'](_0x6234('0xc'),_0x1e03bc,_0x6234('0xb'),JSON['stringify'](_0x2db6cb));if(_0x2db6cb[_0x6234('0xd')]){if(_0x2db6cb[_0x6234('0xd')][_0x6234('0xe')]===0x1f4){logger[_0x6234('0xd')](_0x6234('0xa'),_0x1e03bc,_0x2db6cb['error'][_0x6234('0xf')]);return _0x3e8fd1(_0x2db6cb[_0x6234('0xd')][_0x6234('0xf')]);}logger[_0x6234('0xd')](_0x6234('0xa'),_0x1e03bc,_0x2db6cb['error']['message']);return _0x48b51f(_0x2db6cb[_0x6234('0xd')][_0x6234('0xf')]);}else{logger[_0x6234('0x9')](_0x6234('0xa'),_0x1e03bc,_0x6234('0xb'));_0x48b51f(_0x2db6cb[_0x6234('0x10')][_0x6234('0xf')]);}})[_0x6234('0x11')](function(_0x30aa29){logger[_0x6234('0xd')](_0x6234('0xa'),_0x1e03bc,_0x30aa29);_0x3e8fd1(_0x30aa29);});});}exports[_0x6234('0x12')]=function(_0x362458){var _0x31dd59=this;return new Promise(function(_0x11be3b,_0x1d8de5){return db[_0x6234('0x13')][_0x6234('0x14')]({'raw':_0x362458[_0x6234('0x15')]?_0x362458['options'][_0x6234('0x16')]===undefined?!![]:![]:!![],'where':_0x362458[_0x6234('0x15')]?_0x362458[_0x6234('0x15')]['where']||null:null,'attributes':_0x362458[_0x6234('0x15')]?_0x362458[_0x6234('0x15')][_0x6234('0x17')]||null:null,'include':_0x362458[_0x6234('0x15')]?_0x362458['options'][_0x6234('0x18')]?_[_0x6234('0x19')](_0x362458['options']['include'],function(_0x126cfe){return{'model':db[_0x126cfe[_0x6234('0x1a')]],'as':_0x126cfe['as'],'attributes':_0x126cfe[_0x6234('0x17')],'include':_0x126cfe[_0x6234('0x18')]?_['map'](_0x126cfe[_0x6234('0x18')],function(_0x1ff193){return{'model':db[_0x1ff193['model']],'as':_0x1ff193['as'],'attributes':_0x1ff193[_0x6234('0x17')],'include':_0x1ff193['include']?_['map'](_0x1ff193[_0x6234('0x18')],function(_0x429574){return{'model':db[_0x429574[_0x6234('0x1a')]],'as':_0x429574['as'],'attributes':_0x429574[_0x6234('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4cf607){logger[_0x6234('0x9')]('ShowSquareOdbc',_0x362458);logger[_0x6234('0x1b')](_0x6234('0x12'),_0x362458,JSON[_0x6234('0x1c')](_0x4cf607));_0x11be3b(_0x4cf607);})[_0x6234('0x11')](function(_0x578a04){logger['error'](_0x6234('0x12'),_0x578a04[_0x6234('0xf')],_0x362458);_0x1d8de5(_0x31dd59['error'](0x1f4,_0x578a04[_0x6234('0xf')]));});});}; \ No newline at end of file +var _0xac69=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','SquareOdbc','find','options','raw','where','include','attributes','map','model','ShowSquareOdbc','debug'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0xac69,0x1ba));var _0x9ac6=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xac69[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x9ac6('0x0'));var util=require('util');var moment=require(_0x9ac6('0x1'));var BPromise=require(_0x9ac6('0x2'));var rs=require(_0x9ac6('0x3'));var fs=require('fs');var Redis=require(_0x9ac6('0x4'));var db=require(_0x9ac6('0x5'))['db'];var utils=require(_0x9ac6('0x6'));var logger=require(_0x9ac6('0x7'))(_0x9ac6('0x8'));var config=require(_0x9ac6('0x9'));var jayson=require(_0x9ac6('0xa'));var client=jayson[_0x9ac6('0xb')][_0x9ac6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc3bfe8,_0x4e9d96,_0x157e6a){return new BPromise(function(_0x555ac7,_0x787858){return client[_0x9ac6('0xd')](_0xc3bfe8,_0x157e6a)[_0x9ac6('0xe')](function(_0x235829){logger[_0x9ac6('0xf')](_0x9ac6('0x10'),_0x4e9d96,_0x9ac6('0x11'));logger['debug'](_0x9ac6('0x12'),_0x4e9d96,_0x9ac6('0x11'),JSON[_0x9ac6('0x13')](_0x235829));if(_0x235829[_0x9ac6('0x14')]){if(_0x235829[_0x9ac6('0x14')]['code']===0x1f4){logger['error'](_0x9ac6('0x10'),_0x4e9d96,_0x235829['error'][_0x9ac6('0x15')]);return _0x787858(_0x235829[_0x9ac6('0x14')][_0x9ac6('0x15')]);}logger['error']('SquareOdbc,\x20%s,\x20%s',_0x4e9d96,_0x235829[_0x9ac6('0x14')]['message']);return _0x555ac7(_0x235829[_0x9ac6('0x14')][_0x9ac6('0x15')]);}else{logger[_0x9ac6('0xf')](_0x9ac6('0x10'),_0x4e9d96,'request\x20sent');_0x555ac7(_0x235829['result'][_0x9ac6('0x15')]);}})[_0x9ac6('0x16')](function(_0x234a7e){logger['error'](_0x9ac6('0x10'),_0x4e9d96,_0x234a7e);_0x787858(_0x234a7e);});});}exports['ShowSquareOdbc']=function(_0x32fbc0){var _0x2d4e8a=this;return new Promise(function(_0x1cf775,_0x35a872){return db[_0x9ac6('0x17')][_0x9ac6('0x18')]({'raw':_0x32fbc0[_0x9ac6('0x19')]?_0x32fbc0[_0x9ac6('0x19')][_0x9ac6('0x1a')]===undefined?!![]:![]:!![],'where':_0x32fbc0[_0x9ac6('0x19')]?_0x32fbc0[_0x9ac6('0x19')][_0x9ac6('0x1b')]||null:null,'attributes':_0x32fbc0[_0x9ac6('0x19')]?_0x32fbc0[_0x9ac6('0x19')]['attributes']||null:null,'include':_0x32fbc0[_0x9ac6('0x19')]?_0x32fbc0['options'][_0x9ac6('0x1c')]?_['map'](_0x32fbc0[_0x9ac6('0x19')][_0x9ac6('0x1c')],function(_0x4099c3){return{'model':db[_0x4099c3['model']],'as':_0x4099c3['as'],'attributes':_0x4099c3[_0x9ac6('0x1d')],'include':_0x4099c3[_0x9ac6('0x1c')]?_[_0x9ac6('0x1e')](_0x4099c3['include'],function(_0x5e7409){return{'model':db[_0x5e7409[_0x9ac6('0x1f')]],'as':_0x5e7409['as'],'attributes':_0x5e7409[_0x9ac6('0x1d')],'include':_0x5e7409[_0x9ac6('0x1c')]?_[_0x9ac6('0x1e')](_0x5e7409[_0x9ac6('0x1c')],function(_0x601561){return{'model':db[_0x601561[_0x9ac6('0x1f')]],'as':_0x601561['as'],'attributes':_0x601561[_0x9ac6('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ac2fa){logger[_0x9ac6('0xf')](_0x9ac6('0x20'),_0x32fbc0);logger[_0x9ac6('0x21')](_0x9ac6('0x20'),_0x32fbc0,JSON[_0x9ac6('0x13')](_0x2ac2fa));_0x1cf775(_0x2ac2fa);})[_0x9ac6('0x16')](function(_0x1fa205){logger[_0x9ac6('0x14')](_0x9ac6('0x20'),_0x1fa205[_0x9ac6('0x15')],_0x32fbc0);_0x35a872(_0x2d4e8a[_0x9ac6('0x14')](0x1f4,_0x1fa205[_0x9ac6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 1d7420b..20f2850 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 _0x176e=['/:id','delete','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareProject.controller','index','get','show','post','isAuthenticated'];(function(_0x3a0e18,_0x44f07f){var _0x13f77c=function(_0x5b2b30){while(--_0x5b2b30){_0x3a0e18['push'](_0x3a0e18['shift']());}};_0x13f77c(++_0x44f07f);}(_0x176e,0x197));var _0xe176=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x176e[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0xe176('0x0'));var util=require('util');var path=require(_0xe176('0x1'));var timeout=require('connect-timeout');var express=require(_0xe176('0x2'));var router=express[_0xe176('0x3')]();var fs_extra=require(_0xe176('0x4'));var auth=require(_0xe176('0x5'));var interaction=require(_0xe176('0x6'));var config=require('../../config/environment');var controller=require(_0xe176('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xe176('0x8')]);router[_0xe176('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe176('0xa')]);router[_0xe176('0xb')]('/',auth[_0xe176('0xc')](),controller['create']);router['put'](_0xe176('0xd'),auth[_0xe176('0xc')](),controller['update']);router[_0xe176('0xe')](_0xe176('0xd'),auth[_0xe176('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x16b0=['get','index','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','./squareProject.controller'];(function(_0x336573,_0x4372e9){var _0x3b8061=function(_0x1874f4){while(--_0x1874f4){_0x336573['push'](_0x336573['shift']());}};_0x3b8061(++_0x4372e9);}(_0x16b0,0x11a));var _0x016b=function(_0x1dfe00,_0x241d31){_0x1dfe00=_0x1dfe00-0x0;var _0xb2cdf4=_0x16b0[_0x1dfe00];return _0xb2cdf4;};'use strict';var multer=require('multer');var util=require(_0x016b('0x0'));var path=require(_0x016b('0x1'));var timeout=require('connect-timeout');var express=require(_0x016b('0x2'));var router=express['Router']();var fs_extra=require(_0x016b('0x3'));var auth=require(_0x016b('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x016b('0x5'));router[_0x016b('0x6')]('/',auth['isAuthenticated'](),controller[_0x016b('0x7')]);router[_0x016b('0x6')]('/:id',auth[_0x016b('0x8')](),controller[_0x016b('0x9')]);router[_0x016b('0xa')]('/',auth['isAuthenticated'](),controller[_0x016b('0xb')]);router[_0x016b('0xc')](_0x016b('0xd'),auth[_0x016b('0x8')](),controller[_0x016b('0xe')]);router[_0x016b('0xf')](_0x016b('0xd'),auth[_0x016b('0x8')](),controller[_0x016b('0x10')]);module[_0x016b('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index de3e790..bbe54df 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 _0x7510=['DATE','exports','name','STRING','TEXT','long','getDataValue','preproduction','BLOB','production','toString','utf8'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7510,0xa9));var _0x0751=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x7510[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require('sequelize');module[_0x0751('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x0751('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x0751('0x2')]},'notes':{'type':Sequelize[_0x0751('0x3')]},'preproduction':{'type':Sequelize['BLOB'](_0x0751('0x4')),'get':function(){if(this[_0x0751('0x5')](_0x0751('0x6'))){return this['getDataValue']('preproduction')['toString']('utf8');}}},'production':{'type':Sequelize[_0x0751('0x7')]('long'),'get':function(){if(this[_0x0751('0x5')](_0x0751('0x8'))){return this[_0x0751('0x5')](_0x0751('0x8'))[_0x0751('0x9')](_0x0751('0xa'));}}},'savedAt':{'type':Sequelize[_0x0751('0xb')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x39bd=['preproduction','utf8','production','DATE','sequelize','name','TEXT','BLOB','long','getDataValue'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x39bd,0x7c));var _0xd39b=function(_0x24791d,_0x2da26a){_0x24791d=_0x24791d-0x0;var _0x140319=_0x39bd[_0x24791d];return _0x140319;};'use strict';var Sequelize=require(_0xd39b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xd39b('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0xd39b('0x2')]},'preproduction':{'type':Sequelize[_0xd39b('0x3')](_0xd39b('0x4')),'get':function(){if(this[_0xd39b('0x5')](_0xd39b('0x6'))){return this[_0xd39b('0x5')]('preproduction')['toString'](_0xd39b('0x7'));}}},'production':{'type':Sequelize[_0xd39b('0x3')](_0xd39b('0x4')),'get':function(){if(this[_0xd39b('0x5')](_0xd39b('0x8'))){return this[_0xd39b('0x5')](_0xd39b('0x8'))['toString'](_0xd39b('0x7'));}}},'savedAt':{'type':Sequelize[_0xd39b('0x9')]},'publishedAt':{'type':Sequelize[_0xd39b('0x9')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 1c2ed1d..b2d2cb6 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 _0x23e2=['findAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','redis','agi','stringify','production','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','./squareProject.socket','register','json','undefined','count','offset','limit','status','set','Content-Range','update','then','destroy','get','SquareProjects','UserProfileResource','publish','end','sendStatus','error','stack','name','index','map','SquareProject','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options'];(function(_0x49e04c,_0x1b3350){var _0x197469=function(_0x446ee2){while(--_0x446ee2){_0x49e04c['push'](_0x49e04c['shift']());}};_0x197469(++_0x1b3350);}(_0x23e2,0xe7));var _0x223e=function(_0x4c0155,_0x5b20db){_0x4c0155=_0x4c0155-0x0;var _0x1276db=_0x23e2[_0x4c0155];return _0x1276db;};'use strict';var _=require(_0x223e('0x0'));var Redis=require(_0x223e('0x1'));var qs=require(_0x223e('0x2'));var logger=require('../../config/logger')('api');var config=require(_0x223e('0x3'));var db=require(_0x223e('0x4'))['db'];config['redis']=_[_0x223e('0x5')](config['redis'],{'host':_0x223e('0x6'),'port':0x18eb});var socket=require(_0x223e('0x7'))(new Redis(config['redis']));require(_0x223e('0x8'))[_0x223e('0x9')](socket);function respondWithResult(_0x11cf79,_0x4d6c64){_0x4d6c64=_0x4d6c64||0xc8;return function(_0x3e274e){if(_0x3e274e){return _0x11cf79['status'](_0x4d6c64)[_0x223e('0xa')](_0x3e274e);}};}function respondWithFilteredResult(_0x15f179,_0x38e34a){return function(_0x460e71){if(_0x460e71){var _0xe9708f=typeof _0x38e34a['offset']==='undefined'&&typeof _0x38e34a['limit']===_0x223e('0xb');var _0x8d4bf3=_0x460e71[_0x223e('0xc')];var _0x2db409=_0xe9708f?0x0:_0x38e34a[_0x223e('0xd')];var _0x49e463=_0xe9708f?_0x460e71[_0x223e('0xc')]:_0x38e34a['offset']+_0x38e34a[_0x223e('0xe')];var _0x54fc2c;if(_0x49e463>=_0x8d4bf3){_0x49e463=_0x8d4bf3;_0x54fc2c=0xc8;}else{_0x54fc2c=0xce;}_0x15f179[_0x223e('0xf')](_0x54fc2c);return _0x15f179[_0x223e('0x10')](_0x223e('0x11'),_0x2db409+'-'+_0x49e463+'/'+_0x8d4bf3)[_0x223e('0xa')](_0x460e71);}return null;};}function saveUpdates(_0x1e17a4){return function(_0x267464){if(_0x267464){return _0x267464[_0x223e('0x12')](_0x1e17a4)[_0x223e('0x13')](function(_0x3d570b){return _0x3d570b;});}return null;};}function removeEntity(_0x10e49b){return function(_0xfed1ff){if(_0xfed1ff){return _0xfed1ff[_0x223e('0x14')]()[_0x223e('0x13')](function(){var _0x5587f5=_0xfed1ff[_0x223e('0x15')]({'plain':!![]});var _0x1accbc=_0x223e('0x16');return db[_0x223e('0x17')][_0x223e('0x14')]({'where':{'type':_0x1accbc,'resourceId':_0x5587f5['id']}})[_0x223e('0x13')](function(){return _0xfed1ff;});})[_0x223e('0x13')](function(){var _0x2cd9f3=new Redis(config['redis']);_0x2cd9f3[_0x223e('0x18')]('agi',JSON['stringify']({'id':_0xfed1ff['id'],'deleted':!![]}));})[_0x223e('0x13')](function(){_0x10e49b['status'](0xcc)[_0x223e('0x19')]();});}};}function handleEntityNotFound(_0x2ec331){return function(_0x3ab054){if(!_0x3ab054){_0x2ec331[_0x223e('0x1a')](0x194);}return _0x3ab054;};}function handleError(_0x5eb13d,_0x293274){_0x293274=_0x293274||0x1f4;return function(_0x8e5bb1){logger[_0x223e('0x1b')](_0x8e5bb1[_0x223e('0x1c')]);if(_0x8e5bb1[_0x223e('0x1d')]){delete _0x8e5bb1[_0x223e('0x1d')];}_0x5eb13d[_0x223e('0xf')](_0x293274)['send'](_0x8e5bb1);};}exports[_0x223e('0x1e')]=function(_0x4fb6ec,_0x11260b){var _0x5eafe6={},_0x3f5647={},_0x3c5d6f={'count':0x0,'rows':[]};var _0x109be6=_[_0x223e('0x1f')](db[_0x223e('0x20')][_0x223e('0x21')],function(_0x1ca58e){return{'name':_0x1ca58e[_0x223e('0x22')],'type':_0x1ca58e[_0x223e('0x23')][_0x223e('0x24')]};});_0x3f5647[_0x223e('0x25')]=_[_0x223e('0x1f')](_0x109be6,_0x223e('0x1d'));_0x3f5647[_0x223e('0x26')]=_[_0x223e('0x27')](_0x4fb6ec[_0x223e('0x26')]);_0x3f5647['filters']=_['intersection'](_0x3f5647[_0x223e('0x25')],_0x3f5647[_0x223e('0x26')]);_0x5eafe6['attributes']=_[_0x223e('0x28')](_0x3f5647[_0x223e('0x25')],qs[_0x223e('0x29')](_0x4fb6ec[_0x223e('0x26')][_0x223e('0x29')]));_0x5eafe6[_0x223e('0x2a')]=_0x5eafe6[_0x223e('0x2a')][_0x223e('0x2b')]?_0x5eafe6[_0x223e('0x2a')]:_0x3f5647[_0x223e('0x25')];if(!_0x4fb6ec[_0x223e('0x26')][_0x223e('0x2c')](_0x223e('0x2d'))){_0x5eafe6[_0x223e('0xe')]=qs[_0x223e('0xe')](_0x4fb6ec[_0x223e('0x26')][_0x223e('0xe')]);_0x5eafe6[_0x223e('0xd')]=qs['offset'](_0x4fb6ec['query'][_0x223e('0xd')]);}_0x5eafe6['order']=qs[_0x223e('0x2e')](_0x4fb6ec[_0x223e('0x26')][_0x223e('0x2e')]);_0x5eafe6[_0x223e('0x2f')]=qs[_0x223e('0x30')](_[_0x223e('0x31')](_0x4fb6ec['query'],_0x3f5647[_0x223e('0x30')]),_0x109be6);if(_0x4fb6ec['query'][_0x223e('0x32')]){_0x5eafe6[_0x223e('0x2f')]=_['merge'](_0x5eafe6['where'],{'$or':_[_0x223e('0x1f')](_0x109be6,function(_0x205beb){if(_0x205beb[_0x223e('0x23')]!=='VIRTUAL'){var _0x416e44={};_0x416e44[_0x205beb[_0x223e('0x1d')]]={'$like':'%'+_0x4fb6ec[_0x223e('0x26')][_0x223e('0x32')]+'%'};return _0x416e44;}})});}_0x5eafe6=_[_0x223e('0x33')]({},_0x5eafe6,_0x4fb6ec[_0x223e('0x34')]);var _0x269de6={'where':_0x5eafe6[_0x223e('0x2f')]};return db[_0x223e('0x20')][_0x223e('0xc')](_0x269de6)[_0x223e('0x13')](function(_0x418e14){_0x3c5d6f[_0x223e('0xc')]=_0x418e14;if(_0x4fb6ec[_0x223e('0x26')]['includeAll']){_0x5eafe6['include']=[{'all':!![]}];}return db[_0x223e('0x20')][_0x223e('0x35')](_0x5eafe6);})[_0x223e('0x13')](function(_0x3dc472){_0x3c5d6f[_0x223e('0x36')]=_0x3dc472;return _0x3c5d6f;})[_0x223e('0x13')](respondWithFilteredResult(_0x11260b,_0x5eafe6))[_0x223e('0x37')](handleError(_0x11260b,null));};exports[_0x223e('0x38')]=function(_0x3f15ed,_0x4d56bf){var _0xad7cb0={'raw':![],'where':{'id':_0x3f15ed[_0x223e('0x39')]['id']}},_0x3dec94={};_0x3dec94[_0x223e('0x25')]=_[_0x223e('0x27')](db['SquareProject'][_0x223e('0x21')]);_0x3dec94[_0x223e('0x26')]=_[_0x223e('0x27')](_0x3f15ed[_0x223e('0x26')]);_0x3dec94[_0x223e('0x30')]=_[_0x223e('0x28')](_0x3dec94[_0x223e('0x25')],_0x3dec94['query']);_0xad7cb0[_0x223e('0x2a')]=_[_0x223e('0x28')](_0x3dec94['model'],qs[_0x223e('0x29')](_0x3f15ed[_0x223e('0x26')]['fields']));_0xad7cb0[_0x223e('0x2a')]=_0xad7cb0[_0x223e('0x2a')][_0x223e('0x2b')]?_0xad7cb0[_0x223e('0x2a')]:_0x3dec94[_0x223e('0x25')];if(_0x3f15ed['query']['includeAll']){_0xad7cb0[_0x223e('0x3a')]=[{'all':!![]}];}_0xad7cb0=_[_0x223e('0x33')]({},_0xad7cb0,_0x3f15ed[_0x223e('0x34')]);return db[_0x223e('0x20')][_0x223e('0x3b')](_0xad7cb0)['then'](handleEntityNotFound(_0x4d56bf,null))[_0x223e('0x13')](respondWithResult(_0x4d56bf,null))[_0x223e('0x37')](handleError(_0x4d56bf,null));};exports[_0x223e('0x3c')]=function(_0x37175b,_0x245d07){return db['SquareProject'][_0x223e('0x3c')](_0x37175b[_0x223e('0x3d')],{})['then'](function(_0x1d4cfa){var _0x41d830=_0x37175b[_0x223e('0x3e')]['get']({'plain':!![]});if(!_0x41d830)throw new Error(_0x223e('0x3f'));if(_0x41d830[_0x223e('0x40')]==='user'){var _0x3a54cd=_0x1d4cfa['get']({'plain':!![]});var _0x3ee1dc=_0x223e('0x16');return db['UserProfileSection'][_0x223e('0x3b')]({'where':{'name':_0x3ee1dc,'userProfileId':_0x41d830[_0x223e('0x41')]},'raw':!![]})[_0x223e('0x13')](function(_0x4eba4e){if(_0x4eba4e&&_0x4eba4e[_0x223e('0x42')]===0x0){return db[_0x223e('0x17')][_0x223e('0x3c')]({'name':_0x3a54cd[_0x223e('0x1d')],'resourceId':_0x3a54cd['id'],'type':_0x4eba4e['name'],'sectionId':_0x4eba4e['id']},{})[_0x223e('0x13')](function(){return _0x1d4cfa;});}else{return _0x1d4cfa;}})[_0x223e('0x37')](function(_0x5f3881){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5f3881);throw _0x5f3881;});}return _0x1d4cfa;})[_0x223e('0x13')](respondWithResult(_0x245d07,0xc9))[_0x223e('0x37')](handleError(_0x245d07,null));};exports[_0x223e('0x12')]=function(_0x19aec3,_0x453958){if(_0x19aec3['body']['id']){delete _0x19aec3[_0x223e('0x3d')]['id'];}return db[_0x223e('0x20')][_0x223e('0x3b')]({'where':{'id':_0x19aec3['params']['id']}})[_0x223e('0x13')](handleEntityNotFound(_0x453958,null))[_0x223e('0x13')](saveUpdates(_0x19aec3[_0x223e('0x3d')],null))[_0x223e('0x13')](function(_0xaf0a7b){if(!_0xaf0a7b)return;var _0x47358e=_0xaf0a7b[_0x223e('0x15')]({'plain':!![]});return _0x47358e;})[_0x223e('0x13')](function(_0xd5a283){var _0x3862c1=new Redis(config[_0x223e('0x43')]);_0x3862c1[_0x223e('0x18')](_0x223e('0x44'),JSON[_0x223e('0x45')](_[_0x223e('0x31')](_0xd5a283,['id','name',_0x223e('0x46')])));return _0xd5a283;})[_0x223e('0x13')](respondWithResult(_0x453958,null))[_0x223e('0x37')](handleError(_0x453958,null));};exports[_0x223e('0x14')]=function(_0x2d0233,_0x24f185){return db[_0x223e('0x20')]['find']({'where':{'id':_0x2d0233[_0x223e('0x39')]['id']}})[_0x223e('0x13')](handleEntityNotFound(_0x24f185,null))[_0x223e('0x13')](removeEntity(_0x24f185,null))[_0x223e('0x37')](handleError(_0x24f185,null));}; \ No newline at end of file +var _0x7e3e=['filter','merge','VIRTUAL','options','includeAll','include','findAll','show','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','production','ioredis','../../config/logger','api','redis','defaults','localhost','./squareProject.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','then','destroy','get','SquareProjects','UserProfileResource','publish','agi','stringify','end','sendStatus','stack','name','send','map','SquareProject','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick'];(function(_0x594e11,_0x28f652){var _0x5418ad=function(_0x5dcfa7){while(--_0x5dcfa7){_0x594e11['push'](_0x594e11['shift']());}};_0x5418ad(++_0x28f652);}(_0x7e3e,0x1b3));var _0xe7e3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7e3e[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var Redis=require(_0xe7e3('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0xe7e3('0x1'))(_0xe7e3('0x2'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xe7e3('0x3')]=_[_0xe7e3('0x4')](config[_0xe7e3('0x3')],{'host':_0xe7e3('0x5'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe7e3('0x6'))[_0xe7e3('0x7')](socket);function respondWithResult(_0x1cb6ce,_0x25de19){_0x25de19=_0x25de19||0xc8;return function(_0x514d17){if(_0x514d17){return _0x1cb6ce[_0xe7e3('0x8')](_0x25de19)[_0xe7e3('0x9')](_0x514d17);}};}function respondWithFilteredResult(_0x5c9e14,_0x37dc48){return function(_0xb7a5a6){if(_0xb7a5a6){var _0xfeda40=typeof _0x37dc48[_0xe7e3('0xa')]===_0xe7e3('0xb')&&typeof _0x37dc48[_0xe7e3('0xc')]===_0xe7e3('0xb');var _0xe82f77=_0xb7a5a6[_0xe7e3('0xd')];var _0xa6944e=_0xfeda40?0x0:_0x37dc48[_0xe7e3('0xa')];var _0x1a0f6e=_0xfeda40?_0xb7a5a6['count']:_0x37dc48[_0xe7e3('0xa')]+_0x37dc48[_0xe7e3('0xc')];var _0x32b173;if(_0x1a0f6e>=_0xe82f77){_0x1a0f6e=_0xe82f77;_0x32b173=0xc8;}else{_0x32b173=0xce;}_0x5c9e14[_0xe7e3('0x8')](_0x32b173);return _0x5c9e14[_0xe7e3('0xe')](_0xe7e3('0xf'),_0xa6944e+'-'+_0x1a0f6e+'/'+_0xe82f77)['json'](_0xb7a5a6);}return null;};}function saveUpdates(_0x4edce5){return function(_0x17ed4c){if(_0x17ed4c){return _0x17ed4c['update'](_0x4edce5)[_0xe7e3('0x10')](function(_0x2fb995){return _0x2fb995;});}return null;};}function removeEntity(_0x2acce9){return function(_0xb4f589){if(_0xb4f589){return _0xb4f589[_0xe7e3('0x11')]()['then'](function(){var _0xdfd928=_0xb4f589[_0xe7e3('0x12')]({'plain':!![]});var _0x45dc42=_0xe7e3('0x13');return db[_0xe7e3('0x14')][_0xe7e3('0x11')]({'where':{'type':_0x45dc42,'resourceId':_0xdfd928['id']}})[_0xe7e3('0x10')](function(){return _0xb4f589;});})['then'](function(){var _0x3abd7c=new Redis(config[_0xe7e3('0x3')]);_0x3abd7c[_0xe7e3('0x15')](_0xe7e3('0x16'),JSON[_0xe7e3('0x17')]({'id':_0xb4f589['id'],'deleted':!![]}));})[_0xe7e3('0x10')](function(){_0x2acce9['status'](0xcc)[_0xe7e3('0x18')]();});}};}function handleEntityNotFound(_0x4c26a3){return function(_0x4ad7af){if(!_0x4ad7af){_0x4c26a3[_0xe7e3('0x19')](0x194);}return _0x4ad7af;};}function handleError(_0x36bcd4,_0x2e8437){_0x2e8437=_0x2e8437||0x1f4;return function(_0x461717){logger['error'](_0x461717[_0xe7e3('0x1a')]);if(_0x461717[_0xe7e3('0x1b')]){delete _0x461717[_0xe7e3('0x1b')];}_0x36bcd4[_0xe7e3('0x8')](_0x2e8437)[_0xe7e3('0x1c')](_0x461717);};}exports['index']=function(_0x2cdfcc,_0x220cc4){var _0x13f78b={},_0x3435c2={},_0x2f767e={'count':0x0,'rows':[]};var _0x515331=_[_0xe7e3('0x1d')](db[_0xe7e3('0x1e')][_0xe7e3('0x1f')],function(_0x24c40f){return{'name':_0x24c40f[_0xe7e3('0x20')],'type':_0x24c40f[_0xe7e3('0x21')][_0xe7e3('0x22')]};});_0x3435c2[_0xe7e3('0x23')]=_[_0xe7e3('0x1d')](_0x515331,_0xe7e3('0x1b'));_0x3435c2['query']=_[_0xe7e3('0x24')](_0x2cdfcc[_0xe7e3('0x25')]);_0x3435c2[_0xe7e3('0x26')]=_[_0xe7e3('0x27')](_0x3435c2[_0xe7e3('0x23')],_0x3435c2[_0xe7e3('0x25')]);_0x13f78b[_0xe7e3('0x28')]=_[_0xe7e3('0x27')](_0x3435c2[_0xe7e3('0x23')],qs[_0xe7e3('0x29')](_0x2cdfcc[_0xe7e3('0x25')]['fields']));_0x13f78b['attributes']=_0x13f78b[_0xe7e3('0x28')][_0xe7e3('0x2a')]?_0x13f78b[_0xe7e3('0x28')]:_0x3435c2[_0xe7e3('0x23')];if(!_0x2cdfcc[_0xe7e3('0x25')]['hasOwnProperty'](_0xe7e3('0x2b'))){_0x13f78b[_0xe7e3('0xc')]=qs[_0xe7e3('0xc')](_0x2cdfcc[_0xe7e3('0x25')]['limit']);_0x13f78b[_0xe7e3('0xa')]=qs[_0xe7e3('0xa')](_0x2cdfcc[_0xe7e3('0x25')][_0xe7e3('0xa')]);}_0x13f78b[_0xe7e3('0x2c')]=qs[_0xe7e3('0x2d')](_0x2cdfcc[_0xe7e3('0x25')][_0xe7e3('0x2d')]);_0x13f78b[_0xe7e3('0x2e')]=qs[_0xe7e3('0x26')](_[_0xe7e3('0x2f')](_0x2cdfcc[_0xe7e3('0x25')],_0x3435c2[_0xe7e3('0x26')]),_0x515331);if(_0x2cdfcc[_0xe7e3('0x25')][_0xe7e3('0x30')]){_0x13f78b[_0xe7e3('0x2e')]=_[_0xe7e3('0x31')](_0x13f78b[_0xe7e3('0x2e')],{'$or':_['map'](_0x515331,function(_0x44f876){if(_0x44f876[_0xe7e3('0x21')]!==_0xe7e3('0x32')){var _0x105705={};_0x105705[_0x44f876[_0xe7e3('0x1b')]]={'$like':'%'+_0x2cdfcc[_0xe7e3('0x25')][_0xe7e3('0x30')]+'%'};return _0x105705;}})});}_0x13f78b=_['merge']({},_0x13f78b,_0x2cdfcc[_0xe7e3('0x33')]);var _0x1f3244={'where':_0x13f78b[_0xe7e3('0x2e')]};return db[_0xe7e3('0x1e')][_0xe7e3('0xd')](_0x1f3244)[_0xe7e3('0x10')](function(_0x590248){_0x2f767e[_0xe7e3('0xd')]=_0x590248;if(_0x2cdfcc[_0xe7e3('0x25')][_0xe7e3('0x34')]){_0x13f78b[_0xe7e3('0x35')]=[{'all':!![]}];}return db[_0xe7e3('0x1e')][_0xe7e3('0x36')](_0x13f78b);})[_0xe7e3('0x10')](function(_0x1c974c){_0x2f767e['rows']=_0x1c974c;return _0x2f767e;})[_0xe7e3('0x10')](respondWithFilteredResult(_0x220cc4,_0x13f78b))['catch'](handleError(_0x220cc4,null));};exports[_0xe7e3('0x37')]=function(_0x5c2b66,_0x1a8bac){var _0x51a1ea={'raw':![],'where':{'id':_0x5c2b66['params']['id']}},_0x606665={};_0x606665[_0xe7e3('0x23')]=_[_0xe7e3('0x24')](db[_0xe7e3('0x1e')][_0xe7e3('0x1f')]);_0x606665[_0xe7e3('0x25')]=_[_0xe7e3('0x24')](_0x5c2b66[_0xe7e3('0x25')]);_0x606665['filters']=_['intersection'](_0x606665[_0xe7e3('0x23')],_0x606665[_0xe7e3('0x25')]);_0x51a1ea[_0xe7e3('0x28')]=_[_0xe7e3('0x27')](_0x606665[_0xe7e3('0x23')],qs[_0xe7e3('0x29')](_0x5c2b66[_0xe7e3('0x25')][_0xe7e3('0x29')]));_0x51a1ea[_0xe7e3('0x28')]=_0x51a1ea[_0xe7e3('0x28')][_0xe7e3('0x2a')]?_0x51a1ea[_0xe7e3('0x28')]:_0x606665[_0xe7e3('0x23')];if(_0x5c2b66[_0xe7e3('0x25')][_0xe7e3('0x34')]){_0x51a1ea[_0xe7e3('0x35')]=[{'all':!![]}];}_0x51a1ea=_['merge']({},_0x51a1ea,_0x5c2b66[_0xe7e3('0x33')]);return db[_0xe7e3('0x1e')]['find'](_0x51a1ea)[_0xe7e3('0x10')](handleEntityNotFound(_0x1a8bac,null))['then'](respondWithResult(_0x1a8bac,null))[_0xe7e3('0x38')](handleError(_0x1a8bac,null));};exports[_0xe7e3('0x39')]=function(_0x5bd515,_0x553b5f){return db[_0xe7e3('0x1e')]['create'](_0x5bd515[_0xe7e3('0x3a')],{})[_0xe7e3('0x10')](function(_0xb9cf40){var _0x5dcf52=_0x5bd515[_0xe7e3('0x3b')]['get']({'plain':!![]});if(!_0x5dcf52)throw new Error(_0xe7e3('0x3c'));if(_0x5dcf52[_0xe7e3('0x3d')]===_0xe7e3('0x3b')){var _0x3dffc8=_0xb9cf40[_0xe7e3('0x12')]({'plain':!![]});var _0x5d0898=_0xe7e3('0x13');return db['UserProfileSection']['find']({'where':{'name':_0x5d0898,'userProfileId':_0x5dcf52[_0xe7e3('0x3e')]},'raw':!![]})[_0xe7e3('0x10')](function(_0x500c20){if(_0x500c20&&_0x500c20[_0xe7e3('0x3f')]===0x0){return db['UserProfileResource']['create']({'name':_0x3dffc8['name'],'resourceId':_0x3dffc8['id'],'type':_0x500c20[_0xe7e3('0x1b')],'sectionId':_0x500c20['id']},{})['then'](function(){return _0xb9cf40;});}else{return _0xb9cf40;}})[_0xe7e3('0x38')](function(_0x26b99b){logger['error'](_0xe7e3('0x40'),_0x26b99b);throw _0x26b99b;});}return _0xb9cf40;})[_0xe7e3('0x10')](respondWithResult(_0x553b5f,0xc9))['catch'](handleError(_0x553b5f,null));};exports[_0xe7e3('0x41')]=function(_0x5268b5,_0x3e2c38){if(_0x5268b5[_0xe7e3('0x3a')]['id']){delete _0x5268b5[_0xe7e3('0x3a')]['id'];}return db[_0xe7e3('0x1e')][_0xe7e3('0x42')]({'where':{'id':_0x5268b5[_0xe7e3('0x43')]['id']}})['then'](handleEntityNotFound(_0x3e2c38,null))[_0xe7e3('0x10')](saveUpdates(_0x5268b5[_0xe7e3('0x3a')],null))[_0xe7e3('0x10')](function(_0x5c5a0e){if(!_0x5c5a0e)return;var _0x30e56a=_0x5c5a0e['get']({'plain':!![]});return _0x30e56a;})['then'](function(_0x35ef5c){var _0x3cb8f3=new Redis(config[_0xe7e3('0x3')]);_0x3cb8f3[_0xe7e3('0x15')](_0xe7e3('0x16'),JSON['stringify'](_['pick'](_0x35ef5c,['id','name',_0xe7e3('0x44')])));return _0x35ef5c;})[_0xe7e3('0x10')](respondWithResult(_0x3e2c38,null))[_0xe7e3('0x38')](handleError(_0x3e2c38,null));};exports[_0xe7e3('0x11')]=function(_0xe24c12,_0x397e1b){return db[_0xe7e3('0x1e')][_0xe7e3('0x42')]({'where':{'id':_0xe24c12[_0xe7e3('0x43')]['id']}})[_0xe7e3('0x10')](handleEntityNotFound(_0x397e1b,null))[_0xe7e3('0x10')](removeEntity(_0x397e1b,null))[_0xe7e3('0x38')](handleError(_0x397e1b,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index c154d32..4aa494c 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 _0x56c9=['emit','hasOwnProperty','hook','exports','../../mysqldb','save','update'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x56c9,0x146));var _0x956c=function(_0x556dd2,_0x1bfcc1){_0x556dd2=_0x556dd2-0x0;var _0x3dcda2=_0x56c9[_0x556dd2];return _0x3dcda2;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x956c('0x0'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x956c('0x1'),'afterUpdate':_0x956c('0x2'),'afterDestroy':'remove'};function emitEvent(_0x22aab0){return function(_0x413057,_0x4d66bb,_0x4b3f77){SquareProjectEvents[_0x956c('0x3')](_0x22aab0+':'+_0x413057['id'],_0x413057);SquareProjectEvents[_0x956c('0x3')](_0x22aab0,_0x413057);_0x4b3f77(null);};}for(var e in events){if(events[_0x956c('0x4')](e)){var event=events[e];SquareProject[_0x956c('0x5')](e,emitEvent(event));}}module[_0x956c('0x6')]=SquareProjectEvents; \ No newline at end of file +var _0x4e1b=['../../mysqldb','SquareProject','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x189a98,_0x5d5dd6){var _0x40239d=function(_0x122c1e){while(--_0x122c1e){_0x189a98['push'](_0x189a98['shift']());}};_0x40239d(++_0x5d5dd6);}(_0x4e1b,0x178));var _0xb4e1=function(_0x373a05,_0x230bec){_0x373a05=_0x373a05-0x0;var _0x24b584=_0x4e1b[_0x373a05];return _0x24b584;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xb4e1('0x0'))['db'][_0xb4e1('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xb4e1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb4e1('0x3'),'afterDestroy':'remove'};function emitEvent(_0x6452df){return function(_0x3bc9af,_0x89e9c4,_0x2a2a3f){SquareProjectEvents[_0xb4e1('0x4')](_0x6452df+':'+_0x3bc9af['id'],_0x3bc9af);SquareProjectEvents[_0xb4e1('0x4')](_0x6452df,_0x3bc9af);_0x2a2a3f(null);};}for(var e in events){if(events[_0xb4e1('0x5')](e)){var event=events[e];SquareProject[_0xb4e1('0x6')](e,emitEvent(event));}}module[_0xb4e1('0x7')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 49e4ead..c8ce739 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 _0x6f6a=['SquareProject','square_projects','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','publishedAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareProject.attributes','exports','define'];(function(_0x187948,_0x4b1dc4){var _0x513ed9=function(_0x2c3dfc){while(--_0x2c3dfc){_0x187948['push'](_0x187948['shift']());}};_0x513ed9(++_0x4b1dc4);}(_0x6f6a,0xd0));var _0xa6f6=function(_0x20dbb6,_0x40aff5){_0x20dbb6=_0x20dbb6-0x0;var _0x25aeb3=_0x6f6a[_0x20dbb6];return _0x25aeb3;};'use strict';var _=require(_0xa6f6('0x0'));var util=require(_0xa6f6('0x1'));var logger=require(_0xa6f6('0x2'))(_0xa6f6('0x3'));var moment=require(_0xa6f6('0x4'));var BPromise=require(_0xa6f6('0x5'));var rp=require(_0xa6f6('0x6'));var fs=require('fs');var path=require(_0xa6f6('0x7'));var rimraf=require('rimraf');var config=require(_0xa6f6('0x8'));var attributes=require(_0xa6f6('0x9'));module[_0xa6f6('0xa')]=function(_0x2b679d,_0x186268){return _0x2b679d[_0xa6f6('0xb')](_0xa6f6('0xc'),attributes,{'tableName':_0xa6f6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5a310c,_0x42e9fe,_0x21178b){if(_0x5a310c['changed'](_0xa6f6('0xe'))){_0x5a310c[_0xa6f6('0xf')]=moment()[_0xa6f6('0x10')](_0xa6f6('0x11'));}if(_0x5a310c[_0xa6f6('0x12')]('production')){_0x5a310c[_0xa6f6('0x13')]=moment()['format'](_0xa6f6('0x11'));}_0x21178b(null,_0x5a310c);}}});}; \ No newline at end of file +var _0x4bba=['SquareProject','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','lodash','util','moment','bluebird','request-promise','path','exports','define'];(function(_0x5232f8,_0x59fa7b){var _0x4191c5=function(_0x20cff4){while(--_0x20cff4){_0x5232f8['push'](_0x5232f8['shift']());}};_0x4191c5(++_0x59fa7b);}(_0x4bba,0x124));var _0xa4bb=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x4bba[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0xa4bb('0x0'));var util=require(_0xa4bb('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa4bb('0x2'));var BPromise=require(_0xa4bb('0x3'));var rp=require(_0xa4bb('0x4'));var fs=require('fs');var path=require(_0xa4bb('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareProject.attributes');module[_0xa4bb('0x6')]=function(_0x40b322,_0x3a2ce3){return _0x40b322[_0xa4bb('0x7')](_0xa4bb('0x8'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x511f34,_0x4ce23c,_0x15b318){if(_0x511f34[_0xa4bb('0x9')](_0xa4bb('0xa'))){_0x511f34[_0xa4bb('0xb')]=moment()[_0xa4bb('0xc')](_0xa4bb('0xd'));}if(_0x511f34[_0xa4bb('0x9')](_0xa4bb('0xe'))){_0x511f34['publishedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x15b318(null,_0x511f34);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 4c206a9..8572b00 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 _0xf08c=['./squareProject.socket','GetSquareProjects','SquareProject','options','where','attributes','limit','map','include','model','then','debug','stringify','catch','message','error','ShowSquareProject','find','raw','lodash','ioredis','../../mysqldb','../../config/logger','rpc','redis','defaults','localhost','socket.io-emitter'];(function(_0x1d07da,_0x5501e9){var _0x2d1897=function(_0x12d2a0){while(--_0x12d2a0){_0x1d07da['push'](_0x1d07da['shift']());}};_0x2d1897(++_0x5501e9);}(_0xf08c,0x147));var _0xcf08=function(_0x31e5d1,_0xeeb2ed){_0x31e5d1=_0x31e5d1-0x0;var _0x2f2c1a=_0xf08c[_0x31e5d1];return _0x2f2c1a;};'use strict';var _=require(_0xcf08('0x0'));var Redis=require(_0xcf08('0x1'));var db=require(_0xcf08('0x2'))['db'];var logger=require(_0xcf08('0x3'))(_0xcf08('0x4'));var config=require('../../config/environment');config[_0xcf08('0x5')]=_[_0xcf08('0x6')](config[_0xcf08('0x5')],{'host':_0xcf08('0x7'),'port':0x18eb});var socket=require(_0xcf08('0x8'))(new Redis(config[_0xcf08('0x5')]));require(_0xcf08('0x9'))['register'](socket);exports[_0xcf08('0xa')]=function(_0x406379){var _0x246311=this;return new Promise(function(_0x51318d,_0x582642){return db[_0xcf08('0xb')]['findAll']({'raw':_0x406379[_0xcf08('0xc')]?_0x406379[_0xcf08('0xc')]['raw']===undefined?!![]:![]:!![],'where':_0x406379[_0xcf08('0xc')]?_0x406379[_0xcf08('0xc')][_0xcf08('0xd')]||null:null,'attributes':_0x406379[_0xcf08('0xc')]?_0x406379[_0xcf08('0xc')][_0xcf08('0xe')]||null:null,'limit':_0x406379['options']?_0x406379['options'][_0xcf08('0xf')]||null:null,'include':_0x406379[_0xcf08('0xc')]?_0x406379[_0xcf08('0xc')]['include']?_[_0xcf08('0x10')](_0x406379['options'][_0xcf08('0x11')],function(_0x5ef93e){return{'model':db[_0x5ef93e['model']],'as':_0x5ef93e['as'],'attributes':_0x5ef93e[_0xcf08('0xe')],'include':_0x5ef93e[_0xcf08('0x11')]?_[_0xcf08('0x10')](_0x5ef93e[_0xcf08('0x11')],function(_0x48abdd){return{'model':db[_0x48abdd[_0xcf08('0x12')]],'as':_0x48abdd['as'],'attributes':_0x48abdd[_0xcf08('0xe')],'include':_0x48abdd[_0xcf08('0x11')]?_[_0xcf08('0x10')](_0x48abdd[_0xcf08('0x11')],function(_0x42e91e){return{'model':db[_0x42e91e['model']],'as':_0x42e91e['as'],'attributes':_0x42e91e[_0xcf08('0xe')]};}):[]};}):[]};}):[]:[]})[_0xcf08('0x13')](function(_0x59896a){logger['info'](_0xcf08('0xa'),_0x406379);logger[_0xcf08('0x14')](_0xcf08('0xa'),_0x406379,JSON[_0xcf08('0x15')](_0x59896a));_0x51318d(_0x59896a);})[_0xcf08('0x16')](function(_0x11bfdc){logger['error']('GetSquareProjects',_0x11bfdc[_0xcf08('0x17')],_0x406379);_0x582642(_0x246311[_0xcf08('0x18')](0x1f4,_0x11bfdc['message']));});});};exports[_0xcf08('0x19')]=function(_0x4328c2){var _0x52ac7c=this;return new Promise(function(_0x309236,_0x55809d){return db[_0xcf08('0xb')][_0xcf08('0x1a')]({'raw':_0x4328c2['options']?_0x4328c2[_0xcf08('0xc')][_0xcf08('0x1b')]===undefined?!![]:![]:!![],'where':_0x4328c2[_0xcf08('0xc')]?_0x4328c2[_0xcf08('0xc')][_0xcf08('0xd')]||null:null,'attributes':_0x4328c2['options']?_0x4328c2[_0xcf08('0xc')][_0xcf08('0xe')]||null:null,'include':_0x4328c2['options']?_0x4328c2[_0xcf08('0xc')]['include']?_[_0xcf08('0x10')](_0x4328c2['options'][_0xcf08('0x11')],function(_0x1e2491){return{'model':db[_0x1e2491[_0xcf08('0x12')]],'as':_0x1e2491['as'],'attributes':_0x1e2491['attributes'],'include':_0x1e2491[_0xcf08('0x11')]?_[_0xcf08('0x10')](_0x1e2491[_0xcf08('0x11')],function(_0x52c319){return{'model':db[_0x52c319[_0xcf08('0x12')]],'as':_0x52c319['as'],'attributes':_0x52c319[_0xcf08('0xe')],'include':_0x52c319[_0xcf08('0x11')]?_[_0xcf08('0x10')](_0x52c319['include'],function(_0xfe6069){return{'model':db[_0xfe6069[_0xcf08('0x12')]],'as':_0xfe6069['as'],'attributes':_0xfe6069[_0xcf08('0xe')]};}):[]};}):[]};}):[]:[]})[_0xcf08('0x13')](function(_0x5737b9){logger['info'](_0xcf08('0x19'),_0x4328c2);logger[_0xcf08('0x14')]('ShowSquareProject',_0x4328c2,JSON[_0xcf08('0x15')](_0x5737b9));_0x309236(_0x5737b9);})[_0xcf08('0x16')](function(_0x5ec2a1){logger[_0xcf08('0x18')](_0xcf08('0x19'),_0x5ec2a1[_0xcf08('0x17')],_0x4328c2);_0x55809d(_0x52ac7c[_0xcf08('0x18')](0x1f4,_0x5ec2a1[_0xcf08('0x17')]));});});}; \ No newline at end of file +var _0xdc68=['catch','error','message','ShowSquareProject','find','where','info','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','./squareProject.socket','GetSquareProjects','SquareProject','findAll','options','raw','include','map','model','attributes','then','debug','stringify'];(function(_0xab2f88,_0x7a1ad6){var _0x473d32=function(_0x1432d2){while(--_0x1432d2){_0xab2f88['push'](_0xab2f88['shift']());}};_0x473d32(++_0x7a1ad6);}(_0xdc68,0xaf));var _0x8dc6=function(_0x4a473c,_0x30093a){_0x4a473c=_0x4a473c-0x0;var _0x49079d=_0xdc68[_0x4a473c];return _0x49079d;};'use strict';var _=require('lodash');var Redis=require(_0x8dc6('0x0'));var db=require(_0x8dc6('0x1'))['db'];var logger=require(_0x8dc6('0x2'))(_0x8dc6('0x3'));var config=require(_0x8dc6('0x4'));config[_0x8dc6('0x5')]=_[_0x8dc6('0x6')](config[_0x8dc6('0x5')],{'host':_0x8dc6('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8dc6('0x5')]));require(_0x8dc6('0x8'))['register'](socket);exports[_0x8dc6('0x9')]=function(_0x3b1379){var _0x54d904=this;return new Promise(function(_0xe753f9,_0x4b5dc2){return db[_0x8dc6('0xa')][_0x8dc6('0xb')]({'raw':_0x3b1379[_0x8dc6('0xc')]?_0x3b1379['options'][_0x8dc6('0xd')]===undefined?!![]:![]:!![],'where':_0x3b1379[_0x8dc6('0xc')]?_0x3b1379['options']['where']||null:null,'attributes':_0x3b1379[_0x8dc6('0xc')]?_0x3b1379[_0x8dc6('0xc')]['attributes']||null:null,'limit':_0x3b1379[_0x8dc6('0xc')]?_0x3b1379['options']['limit']||null:null,'include':_0x3b1379[_0x8dc6('0xc')]?_0x3b1379['options'][_0x8dc6('0xe')]?_[_0x8dc6('0xf')](_0x3b1379[_0x8dc6('0xc')][_0x8dc6('0xe')],function(_0x4d42d7){return{'model':db[_0x4d42d7[_0x8dc6('0x10')]],'as':_0x4d42d7['as'],'attributes':_0x4d42d7[_0x8dc6('0x11')],'include':_0x4d42d7[_0x8dc6('0xe')]?_[_0x8dc6('0xf')](_0x4d42d7[_0x8dc6('0xe')],function(_0x27d96a){return{'model':db[_0x27d96a[_0x8dc6('0x10')]],'as':_0x27d96a['as'],'attributes':_0x27d96a['attributes'],'include':_0x27d96a[_0x8dc6('0xe')]?_[_0x8dc6('0xf')](_0x27d96a[_0x8dc6('0xe')],function(_0x213c6f){return{'model':db[_0x213c6f[_0x8dc6('0x10')]],'as':_0x213c6f['as'],'attributes':_0x213c6f[_0x8dc6('0x11')]};}):[]};}):[]};}):[]:[]})[_0x8dc6('0x12')](function(_0x4f8b02){logger['info'](_0x8dc6('0x9'),_0x3b1379);logger[_0x8dc6('0x13')](_0x8dc6('0x9'),_0x3b1379,JSON[_0x8dc6('0x14')](_0x4f8b02));_0xe753f9(_0x4f8b02);})[_0x8dc6('0x15')](function(_0x266c7b){logger[_0x8dc6('0x16')](_0x8dc6('0x9'),_0x266c7b[_0x8dc6('0x17')],_0x3b1379);_0x4b5dc2(_0x54d904[_0x8dc6('0x16')](0x1f4,_0x266c7b[_0x8dc6('0x17')]));});});};exports[_0x8dc6('0x18')]=function(_0x2067d4){var _0x5ac09d=this;return new Promise(function(_0x125377,_0x54f82b){return db[_0x8dc6('0xa')][_0x8dc6('0x19')]({'raw':_0x2067d4[_0x8dc6('0xc')]?_0x2067d4['options'][_0x8dc6('0xd')]===undefined?!![]:![]:!![],'where':_0x2067d4[_0x8dc6('0xc')]?_0x2067d4[_0x8dc6('0xc')][_0x8dc6('0x1a')]||null:null,'attributes':_0x2067d4[_0x8dc6('0xc')]?_0x2067d4[_0x8dc6('0xc')][_0x8dc6('0x11')]||null:null,'include':_0x2067d4['options']?_0x2067d4['options'][_0x8dc6('0xe')]?_[_0x8dc6('0xf')](_0x2067d4[_0x8dc6('0xc')][_0x8dc6('0xe')],function(_0x1dda68){return{'model':db[_0x1dda68['model']],'as':_0x1dda68['as'],'attributes':_0x1dda68['attributes'],'include':_0x1dda68[_0x8dc6('0xe')]?_[_0x8dc6('0xf')](_0x1dda68[_0x8dc6('0xe')],function(_0x31f759){return{'model':db[_0x31f759[_0x8dc6('0x10')]],'as':_0x31f759['as'],'attributes':_0x31f759['attributes'],'include':_0x31f759[_0x8dc6('0xe')]?_[_0x8dc6('0xf')](_0x31f759[_0x8dc6('0xe')],function(_0x14bb62){return{'model':db[_0x14bb62[_0x8dc6('0x10')]],'as':_0x14bb62['as'],'attributes':_0x14bb62[_0x8dc6('0x11')]};}):[]};}):[]};}):[]:[]})[_0x8dc6('0x12')](function(_0x4e2862){logger[_0x8dc6('0x1b')](_0x8dc6('0x18'),_0x2067d4);logger[_0x8dc6('0x13')]('ShowSquareProject',_0x2067d4,JSON[_0x8dc6('0x14')](_0x4e2862));_0x125377(_0x4e2862);})[_0x8dc6('0x15')](function(_0xe697c1){logger[_0x8dc6('0x16')](_0x8dc6('0x18'),_0xe697c1['message'],_0x2067d4);_0x54f82b(_0x5ac09d[_0x8dc6('0x16')](0x1f4,_0xe697c1[_0x8dc6('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 29f6306..24b6ef9 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 _0x20c4=['./squareProject.events','update','emit','removeListener','register','length','squareProject:'];(function(_0x5a0b50,_0x4f982f){var _0x13729d=function(_0x4256c7){while(--_0x4256c7){_0x5a0b50['push'](_0x5a0b50['shift']());}};_0x13729d(++_0x4f982f);}(_0x20c4,0xcb));var _0x420c=function(_0x348619,_0x31cd4c){_0x348619=_0x348619-0x0;var _0x11ec5f=_0x20c4[_0x348619];return _0x11ec5f;};'use strict';var SquareProjectEvents=require(_0x420c('0x0'));var events=['save','remove',_0x420c('0x1')];function createListener(_0x1a11a5,_0x34bc83){return function(_0x4e97f2){_0x34bc83[_0x420c('0x2')](_0x1a11a5,_0x4e97f2);};}function removeListener(_0x269af8,_0x25a133){return function(){SquareProjectEvents[_0x420c('0x3')](_0x269af8,_0x25a133);};}exports[_0x420c('0x4')]=function(_0x5e5ee9){for(var _0x53f80b=0x0,_0x4e21d6=events[_0x420c('0x5')];_0x53f80b<_0x4e21d6;_0x53f80b++){var _0x27d326=events[_0x53f80b];var _0x180c80=createListener(_0x420c('0x6')+_0x27d326,_0x5e5ee9);SquareProjectEvents['on'](_0x27d326,_0x180c80);}}; \ No newline at end of file +var _0xe429=['removeListener','length','squareProject:','./squareProject.events','save','remove','update','emit'];(function(_0x2c8857,_0x466084){var _0x499bf0=function(_0x30d07b){while(--_0x30d07b){_0x2c8857['push'](_0x2c8857['shift']());}};_0x499bf0(++_0x466084);}(_0xe429,0x11b));var _0x9e42=function(_0x32026c,_0x4b01ad){_0x32026c=_0x32026c-0x0;var _0x406df0=_0xe429[_0x32026c];return _0x406df0;};'use strict';var SquareProjectEvents=require(_0x9e42('0x0'));var events=[_0x9e42('0x1'),_0x9e42('0x2'),_0x9e42('0x3')];function createListener(_0x523e44,_0x45feec){return function(_0x279254){_0x45feec[_0x9e42('0x4')](_0x523e44,_0x279254);};}function removeListener(_0x2ad0f4,_0x1c0631){return function(){SquareProjectEvents[_0x9e42('0x5')](_0x2ad0f4,_0x1c0631);};}exports['register']=function(_0xff6859){for(var _0x2f0dfa=0x0,_0x466126=events[_0x9e42('0x6')];_0x2f0dfa<_0x466126;_0x2f0dfa++){var _0x4abf3f=events[_0x2f0dfa];var _0x17e49a=createListener(_0x9e42('0x7')+_0x4abf3f,_0xff6859);SquareProjectEvents['on'](_0x4abf3f,_0x17e49a);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index fd153ba..e18fdba 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 _0x7fbe=['/:id','show','/:id/download','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index'];(function(_0x270562,_0x2c28ed){var _0x1d93d5=function(_0x250e73){while(--_0x250e73){_0x270562['push'](_0x270562['shift']());}};_0x1d93d5(++_0x2c28ed);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x27a1a0,_0x410857){_0x27a1a0=_0x27a1a0-0x0;var _0x1321a0=_0x7fbe[_0x27a1a0];return _0x1321a0;};'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 fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['download']);router['post']('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xf')]);router[_0xe7fb('0x10')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x11')]);router[_0xe7fb('0x12')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x13')]);module[_0xe7fb('0x14')]=router; \ No newline at end of file +var _0x5fc3=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','show','/:id/download','download','post','create','put','update','/:id','multer','util','connect-timeout'];(function(_0x2e1993,_0x4c294a){var _0x4e36b4=function(_0x407271){while(--_0x407271){_0x2e1993['push'](_0x2e1993['shift']());}};_0x4e36b4(++_0x4c294a);}(_0x5fc3,0xa8));var _0x35fc=function(_0x485abd,_0x32c7c1){_0x485abd=_0x485abd-0x0;var _0x3379f1=_0x5fc3[_0x485abd];return _0x3379f1;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xe')]('/',auth['isAuthenticated'](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router['delete'](_0x35fc('0x12'),auth[_0x35fc('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 85ead3c..0b6ae69 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 _0xed1f=['lastIndexOf','sequelize','exports','STRING','VIRTUAL','getDataValue','substring'];(function(_0x1bfcfc,_0x140f5b){var _0x1041ff=function(_0x2d48fc){while(--_0x2d48fc){_0x1bfcfc['push'](_0x1bfcfc['shift']());}};_0x1041ff(++_0x140f5b);}(_0xed1f,0x6a));var _0xfed1=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0xed1f[_0x580647];return _0x5f0792;};'use strict';var Sequelize=require(_0xfed1('0x0'));module[_0xfed1('0x1')]={'uniqueid':{'type':Sequelize[_0xfed1('0x2')]},'callerid':{'type':Sequelize[_0xfed1('0x2')]},'calleridname':{'type':Sequelize[_0xfed1('0x2')]},'context':{'type':Sequelize[_0xfed1('0x2')]},'extension':{'type':Sequelize[_0xfed1('0x2')]},'priority':{'type':Sequelize[_0xfed1('0x2')]},'accountcode':{'type':Sequelize[_0xfed1('0x2')]},'dnid':{'type':Sequelize[_0xfed1('0x2')]},'projectName':{'type':Sequelize[_0xfed1('0x2')]},'saveName':{'type':Sequelize[_0xfed1('0x2')]},'filename':{'type':Sequelize[_0xfed1('0x2')]},'savePath':{'type':Sequelize[_0xfed1('0x2')]},'format':{'type':Sequelize[_0xfed1('0x3')],'get':function(){var _0x612b38='';var _0x2a6082=this[_0xfed1('0x4')]('savePath');if(_0x2a6082){_0x612b38=_0x2a6082[_0xfed1('0x5')](_0x2a6082[_0xfed1('0x6')]('.'));}return _0x612b38;}}}; \ No newline at end of file +var _0x7dfd=['substring','lastIndexOf','sequelize','exports','STRING','VIRTUAL','savePath'];(function(_0xcfdd2a,_0x2e8dae){var _0x1a4a74=function(_0x147337){while(--_0x147337){_0xcfdd2a['push'](_0xcfdd2a['shift']());}};_0x1a4a74(++_0x2e8dae);}(_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')]={'uniqueid':{'type':Sequelize[_0xd7df('0x2')]},'callerid':{'type':Sequelize[_0xd7df('0x2')]},'calleridname':{'type':Sequelize[_0xd7df('0x2')]},'context':{'type':Sequelize[_0xd7df('0x2')]},'extension':{'type':Sequelize[_0xd7df('0x2')]},'priority':{'type':Sequelize[_0xd7df('0x2')]},'accountcode':{'type':Sequelize[_0xd7df('0x2')]},'dnid':{'type':Sequelize[_0xd7df('0x2')]},'projectName':{'type':Sequelize[_0xd7df('0x2')]},'saveName':{'type':Sequelize[_0xd7df('0x2')]},'filename':{'type':Sequelize[_0xd7df('0x2')]},'savePath':{'type':Sequelize[_0xd7df('0x2')]},'format':{'type':Sequelize[_0xd7df('0x3')],'get':function(){var _0x16e50='';var _0x2c48a4=this['getDataValue'](_0xd7df('0x4'));if(_0x2c48a4){_0x16e50=_0x2c48a4[_0xd7df('0x5')](_0x2c48a4[_0xd7df('0x6')]('.'));}return _0x16e50;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index d9018e8..2d354a4 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 _0x27f8=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','end','stack','name','send','index','SquareRecording','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','where','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','download','../../components/encryptor','uniqueid','filename','savePath','format','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0xc0a44f,_0x726428){var _0x393fc7=function(_0x571944){while(--_0x571944){_0xc0a44f['push'](_0xc0a44f['shift']());}};_0x393fc7(++_0x726428);}(_0x27f8,0x116));var _0x827f=function(_0x2cc21c,_0x4ceefa){_0x2cc21c=_0x2cc21c-0x0;var _0x59e4ea=_0x27f8[_0x2cc21c];return _0x59e4ea;};'use strict';var emlformat=require(_0x827f('0x0'));var rimraf=require(_0x827f('0x1'));var zipdir=require(_0x827f('0x2'));var jsonpatch=require(_0x827f('0x3'));var rp=require(_0x827f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x827f('0x5'));var util=require(_0x827f('0x6'));var path=require('path');var sox=require(_0x827f('0x7'));var csv=require(_0x827f('0x8'));var ejs=require(_0x827f('0x9'));var fs=require('fs');var fs_extra=require(_0x827f('0xa'));var _=require(_0x827f('0xb'));var squel=require(_0x827f('0xc'));var crypto=require(_0x827f('0xd'));var jsforce=require(_0x827f('0xe'));var deskjs=require(_0x827f('0xf'));var toCsv=require(_0x827f('0x8'));var querystring=require(_0x827f('0x10'));var Papa=require(_0x827f('0x11'));var Redis=require(_0x827f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x827f('0x13'));var as=require(_0x827f('0x14'));var hardwareService=require(_0x827f('0x15'));var logger=require(_0x827f('0x16'))(_0x827f('0x17'));var utils=require(_0x827f('0x18'));var config=require(_0x827f('0x19'));var licenseUtil=require(_0x827f('0x1a'));var db=require(_0x827f('0x1b'))['db'];function respondWithStatusCode(_0x521933,_0x44a797){_0x44a797=_0x44a797||0xcc;return function(_0x5c27d9){if(_0x5c27d9){return _0x521933[_0x827f('0x1c')](_0x44a797);}return _0x521933[_0x827f('0x1d')](_0x44a797)['end']();};}function respondWithResult(_0x469df5,_0x357114){_0x357114=_0x357114||0xc8;return function(_0xb41d28){if(_0xb41d28){return _0x469df5['status'](_0x357114)[_0x827f('0x1e')](_0xb41d28);}};}function respondWithFilteredResult(_0x286cba,_0x4bdf10){return function(_0xc89520){if(_0xc89520){var _0x3014b3=typeof _0x4bdf10[_0x827f('0x1f')]==='undefined'&&typeof _0x4bdf10[_0x827f('0x20')]===_0x827f('0x21');var _0x40c6d1=_0xc89520[_0x827f('0x22')];var _0xf6c9cd=_0x3014b3?0x0:_0x4bdf10['offset'];var _0x3eb9c9=_0x3014b3?_0xc89520['count']:_0x4bdf10[_0x827f('0x1f')]+_0x4bdf10[_0x827f('0x20')];var _0x2a476a;if(_0x3eb9c9>=_0x40c6d1){_0x3eb9c9=_0x40c6d1;_0x2a476a=0xc8;}else{_0x2a476a=0xce;}_0x286cba[_0x827f('0x1d')](_0x2a476a);return _0x286cba[_0x827f('0x23')](_0x827f('0x24'),_0xf6c9cd+'-'+_0x3eb9c9+'/'+_0x40c6d1)[_0x827f('0x1e')](_0xc89520);}return null;};}function patchUpdates(_0x30d2d4){return function(_0x2ba60b){try{jsonpatch[_0x827f('0x25')](_0x2ba60b,_0x30d2d4,!![]);}catch(_0x145fb5){return BPromise['reject'](_0x145fb5);}return _0x2ba60b[_0x827f('0x26')]();};}function saveUpdates(_0x55ced0,_0xe79572){return function(_0x40fd36){if(_0x40fd36){return _0x40fd36['update'](_0x55ced0)[_0x827f('0x27')](function(_0x154adb){return _0x154adb;});}return null;};}function removeEntity(_0x1558ca,_0x63e2f0){return function(_0x3acfb4){if(_0x3acfb4){return _0x3acfb4['destroy']()['then'](function(){_0x1558ca[_0x827f('0x1d')](0xcc)[_0x827f('0x28')]();});}};}function handleEntityNotFound(_0xa571e1,_0x19113e){return function(_0x391128){if(!_0x391128){_0xa571e1['sendStatus'](0x194);}return _0x391128;};}function handleError(_0x1c6d9e,_0x5ece4a){_0x5ece4a=_0x5ece4a||0x1f4;return function(_0x1f466b){logger['error'](_0x1f466b[_0x827f('0x29')]);if(_0x1f466b[_0x827f('0x2a')]){delete _0x1f466b['name'];}_0x1c6d9e[_0x827f('0x1d')](_0x5ece4a)[_0x827f('0x2b')](_0x1f466b);};}exports[_0x827f('0x2c')]=function(_0x5365ca,_0x29e858){var _0x5045fd={},_0x13425e={},_0x356b0d={'count':0x0,'rows':[]};var _0xc217aa=_['map'](db[_0x827f('0x2d')]['rawAttributes'],function(_0x491aa1){return{'name':_0x491aa1[_0x827f('0x2e')],'type':_0x491aa1[_0x827f('0x2f')][_0x827f('0x30')]};});_0x13425e[_0x827f('0x31')]=_['map'](_0xc217aa,_0x827f('0x2a'));_0x13425e[_0x827f('0x32')]=_[_0x827f('0x33')](_0x5365ca[_0x827f('0x32')]);_0x13425e['filters']=_[_0x827f('0x34')](_0x13425e[_0x827f('0x31')],_0x13425e[_0x827f('0x32')]);_0x5045fd[_0x827f('0x35')]=_[_0x827f('0x34')](_0x13425e[_0x827f('0x31')],qs[_0x827f('0x36')](_0x5365ca[_0x827f('0x32')][_0x827f('0x36')]));_0x5045fd[_0x827f('0x35')]=_0x5045fd[_0x827f('0x35')][_0x827f('0x37')]?_0x5045fd[_0x827f('0x35')]:_0x13425e[_0x827f('0x31')];if(!_0x5365ca[_0x827f('0x32')][_0x827f('0x38')](_0x827f('0x39'))){_0x5045fd[_0x827f('0x20')]=qs[_0x827f('0x20')](_0x5365ca[_0x827f('0x32')][_0x827f('0x20')]);_0x5045fd[_0x827f('0x1f')]=qs['offset'](_0x5365ca[_0x827f('0x32')][_0x827f('0x1f')]);}_0x5045fd['order']=qs[_0x827f('0x3a')](_0x5365ca[_0x827f('0x32')][_0x827f('0x3a')]);_0x5045fd['where']=qs[_0x827f('0x3b')](_[_0x827f('0x3c')](_0x5365ca[_0x827f('0x32')],_0x13425e[_0x827f('0x3b')]),_0xc217aa);if(_0x5365ca['query'][_0x827f('0x3d')]){_0x5045fd['where']=_[_0x827f('0x3e')](_0x5045fd[_0x827f('0x3f')],{'$or':_[_0x827f('0x40')](_0xc217aa,function(_0x24c5b4){if(_0x24c5b4[_0x827f('0x2f')]!==_0x827f('0x41')){var _0x306380={};_0x306380[_0x24c5b4['name']]={'$like':'%'+_0x5365ca[_0x827f('0x32')]['filter']+'%'};return _0x306380;}})});}_0x5045fd=_[_0x827f('0x3e')]({},_0x5045fd,_0x5365ca[_0x827f('0x42')]);var _0x2631a2={'where':_0x5045fd[_0x827f('0x3f')]};return db[_0x827f('0x2d')]['count'](_0x2631a2)[_0x827f('0x27')](function(_0x24128b){_0x356b0d['count']=_0x24128b;if(_0x5365ca['query'][_0x827f('0x43')]){_0x5045fd[_0x827f('0x44')]=[{'all':!![]}];}return db[_0x827f('0x2d')][_0x827f('0x45')](_0x5045fd);})['then'](function(_0xf34197){_0x356b0d[_0x827f('0x46')]=_0xf34197;return _0x356b0d;})[_0x827f('0x27')](respondWithFilteredResult(_0x29e858,_0x5045fd))[_0x827f('0x47')](handleError(_0x29e858,null));};exports[_0x827f('0x48')]=function(_0x54ab3c,_0xf5c440){var _0x189a11={'raw':!![],'where':{'id':_0x54ab3c[_0x827f('0x49')]['id']}},_0x472472={};_0x472472[_0x827f('0x31')]=_['keys'](db[_0x827f('0x2d')][_0x827f('0x4a')]);_0x472472[_0x827f('0x32')]=_['keys'](_0x54ab3c[_0x827f('0x32')]);_0x472472[_0x827f('0x3b')]=_['intersection'](_0x472472[_0x827f('0x31')],_0x472472[_0x827f('0x32')]);_0x189a11[_0x827f('0x35')]=_[_0x827f('0x34')](_0x472472[_0x827f('0x31')],qs[_0x827f('0x36')](_0x54ab3c[_0x827f('0x32')][_0x827f('0x36')]));_0x189a11[_0x827f('0x35')]=_0x189a11[_0x827f('0x35')][_0x827f('0x37')]?_0x189a11[_0x827f('0x35')]:_0x472472[_0x827f('0x31')];if(_0x54ab3c['query'][_0x827f('0x43')]){_0x189a11[_0x827f('0x44')]=[{'all':!![]}];}_0x189a11=_['merge']({},_0x189a11,_0x54ab3c[_0x827f('0x42')]);return db['SquareRecording'][_0x827f('0x4b')](_0x189a11)[_0x827f('0x27')](handleEntityNotFound(_0xf5c440,null))[_0x827f('0x27')](respondWithResult(_0xf5c440,null))[_0x827f('0x47')](handleError(_0xf5c440,null));};exports['create']=function(_0x5be2ec,_0x28e325){return db[_0x827f('0x2d')][_0x827f('0x4c')](_0x5be2ec[_0x827f('0x4d')],{})[_0x827f('0x27')](respondWithResult(_0x28e325,0xc9))[_0x827f('0x47')](handleError(_0x28e325,null));};exports[_0x827f('0x4e')]=function(_0x1f6c82,_0x1954e0){if(_0x1f6c82[_0x827f('0x4d')]['id']){delete _0x1f6c82[_0x827f('0x4d')]['id'];}return db['SquareRecording'][_0x827f('0x4b')]({'where':{'id':_0x1f6c82[_0x827f('0x49')]['id']}})[_0x827f('0x27')](handleEntityNotFound(_0x1954e0,null))['then'](saveUpdates(_0x1f6c82[_0x827f('0x4d')],null))[_0x827f('0x27')](respondWithResult(_0x1954e0,null))[_0x827f('0x47')](handleError(_0x1954e0,null));};exports[_0x827f('0x4f')]=function(_0x3d2e8d,_0x5bbf8e,_0x1537cd){var _0x45bcc0=require(_0x827f('0x50'));var _0x5cfe98=![];var _0x29e68e={};if(_0x3d2e8d[_0x827f('0x32')][_0x827f('0x2f')]&&_0x3d2e8d[_0x827f('0x32')][_0x827f('0x2f')]==='uniqueid'){_0x29e68e[_0x827f('0x51')]=_0x3d2e8d[_0x827f('0x49')]['id'];}else{_0x29e68e['id']=_0x3d2e8d[_0x827f('0x49')]['id'];}return db[_0x827f('0x2d')][_0x827f('0x4b')]({'where':_0x29e68e,'attributes':['id','savePath',_0x827f('0x52')],'raw':!![]})[_0x827f('0x27')](handleEntityNotFound(_0x5bbf8e,null))['then'](function(_0x527701){if(_0x527701){var _0x3a5639=_0x527701[_0x827f('0x53')];var _0x1cc664=util[_0x827f('0x54')](_0x827f('0x55'),_0x3a5639);if(fs[_0x827f('0x56')](_0x1cc664)){_0x5cfe98=!![];return _0x45bcc0['decryptFile'](_0x1cc664,_0x3a5639,config[_0x827f('0x57')][_0x827f('0x58')])[_0x827f('0x27')](function(){return _0x527701;});}return _0x527701;}})['then'](function(_0x679ff7){if(_0x679ff7){var _0x3ffcad=_0x679ff7[_0x827f('0x53')];if(!fs[_0x827f('0x56')](_0x3ffcad)){throw new db[(_0x827f('0x59'))][(_0x827f('0x5a'))](_0x827f('0x5b'));}if(_0x679ff7['filename']){return _0x5bbf8e[_0x827f('0x4f')](_0x3ffcad,_0x679ff7[_0x827f('0x52')]+path[_0x827f('0x5c')](_0x3ffcad),function(){if(_0x5cfe98){fs[_0x827f('0x5d')](_0x3ffcad);}});}else{return _0x5bbf8e[_0x827f('0x4f')](_0x3ffcad,function(_0x3a0191){if(_0x5cfe98){fs[_0x827f('0x5d')](_0x3ffcad);}});}}})['catch'](function(_0x5332b9){if(_0x5332b9['message']===_0x827f('0x5b')){_0x5bbf8e[_0x827f('0x1d')](0x194)[_0x827f('0x2b')]('Not\x20found');}else{return handleError(_0x5bbf8e,null);}});};exports['destroy']=function(_0x40b1d1,_0x4350b1){return db[_0x827f('0x2d')]['find']({'where':{'id':_0x40b1d1[_0x827f('0x49')]['id']}})['then'](function(_0x3690fc){if(_[_0x827f('0x5e')](_0x3690fc)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3690fc;})[_0x827f('0x27')](function(_0x4ba830){var _0x510c96=_0x4ba830[_0x827f('0x53')];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x510c96);if(!_[_0x827f('0x5e')](_0x4ba830['savePath'])&&fs[_0x827f('0x56')](_0x510c96)){logger[_0x827f('0x5f')](_0x827f('0x60')+_0x510c96+_0x827f('0x61'));fs[_0x827f('0x62')](_0x510c96);}_0x510c96=_0x510c96+_0x827f('0x63');if(!_[_0x827f('0x5e')](_0x4ba830[_0x827f('0x53')])&&fs['existsSync'](_0x510c96)){logger[_0x827f('0x5f')](_0x827f('0x60')+_0x510c96+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x510c96);}return _0x4ba830;})[_0x827f('0x27')](function(_0x186655){if(!_0x186655)throw new InternalError();return _0x186655[_0x827f('0x64')]();})[_0x827f('0x27')](function(){_0x4350b1[_0x827f('0x1d')](0xcc)[_0x827f('0x28')]();})[_0x827f('0x47')](handleError(_0x4350b1,null));}; \ No newline at end of file +var _0x0cd9=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','save','then','end','error','stack','name','send','index','map','SquareRecording','fieldName','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','length','find','create','body','update','../../components/encryptor','uniqueid','savePath','format','%s.cypher','decryptFile','secrets','recording','Sequelize','ValidationError','filename','download','extname','unlink','message','SquareRecording\x20not\x20found','Not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','existsSync','File:\x20\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0xcd82a5,_0x10b762){var _0x5023a3=function(_0x4b4057){while(--_0x4b4057){_0xcd82a5['push'](_0xcd82a5['shift']());}};_0x5023a3(++_0x10b762);}(_0x0cd9,0x12b));var _0x90cd=function(_0x119b8f,_0x166c5e){_0x119b8f=_0x119b8f-0x0;var _0x2d183f=_0x0cd9[_0x119b8f];return _0x2d183f;};'use strict';var emlformat=require(_0x90cd('0x0'));var rimraf=require(_0x90cd('0x1'));var zipdir=require(_0x90cd('0x2'));var jsonpatch=require(_0x90cd('0x3'));var rp=require(_0x90cd('0x4'));var moment=require(_0x90cd('0x5'));var BPromise=require(_0x90cd('0x6'));var Mustache=require(_0x90cd('0x7'));var util=require('util');var path=require(_0x90cd('0x8'));var sox=require(_0x90cd('0x9'));var csv=require(_0x90cd('0xa'));var ejs=require(_0x90cd('0xb'));var fs=require('fs');var fs_extra=require(_0x90cd('0xc'));var _=require(_0x90cd('0xd'));var squel=require(_0x90cd('0xe'));var crypto=require(_0x90cd('0xf'));var jsforce=require(_0x90cd('0x10'));var deskjs=require(_0x90cd('0x11'));var toCsv=require(_0x90cd('0xa'));var querystring=require(_0x90cd('0x12'));var Papa=require(_0x90cd('0x13'));var Redis=require(_0x90cd('0x14'));var authService=require(_0x90cd('0x15'));var qs=require(_0x90cd('0x16'));var as=require(_0x90cd('0x17'));var hardwareService=require(_0x90cd('0x18'));var logger=require(_0x90cd('0x19'))(_0x90cd('0x1a'));var utils=require(_0x90cd('0x1b'));var config=require(_0x90cd('0x1c'));var licenseUtil=require(_0x90cd('0x1d'));var db=require(_0x90cd('0x1e'))['db'];function respondWithStatusCode(_0x552a60,_0x5dd80d){_0x5dd80d=_0x5dd80d||0xcc;return function(_0x12d024){if(_0x12d024){return _0x552a60[_0x90cd('0x1f')](_0x5dd80d);}return _0x552a60['status'](_0x5dd80d)['end']();};}function respondWithResult(_0x1c336e,_0x4c2b37){_0x4c2b37=_0x4c2b37||0xc8;return function(_0x16b0af){if(_0x16b0af){return _0x1c336e[_0x90cd('0x20')](_0x4c2b37)['json'](_0x16b0af);}};}function respondWithFilteredResult(_0x11c01c,_0x1bc68a){return function(_0x224381){if(_0x224381){var _0x3ed01b=typeof _0x1bc68a[_0x90cd('0x21')]===_0x90cd('0x22')&&typeof _0x1bc68a[_0x90cd('0x23')]===_0x90cd('0x22');var _0xef6272=_0x224381[_0x90cd('0x24')];var _0x391fc7=_0x3ed01b?0x0:_0x1bc68a[_0x90cd('0x21')];var _0x69995c=_0x3ed01b?_0x224381['count']:_0x1bc68a[_0x90cd('0x21')]+_0x1bc68a[_0x90cd('0x23')];var _0x5da2c5;if(_0x69995c>=_0xef6272){_0x69995c=_0xef6272;_0x5da2c5=0xc8;}else{_0x5da2c5=0xce;}_0x11c01c['status'](_0x5da2c5);return _0x11c01c[_0x90cd('0x25')](_0x90cd('0x26'),_0x391fc7+'-'+_0x69995c+'/'+_0xef6272)[_0x90cd('0x27')](_0x224381);}return null;};}function patchUpdates(_0x388f21){return function(_0xe479c1){try{jsonpatch['apply'](_0xe479c1,_0x388f21,!![]);}catch(_0x3961a0){return BPromise['reject'](_0x3961a0);}return _0xe479c1[_0x90cd('0x28')]();};}function saveUpdates(_0x2d203a,_0x50a100){return function(_0x3a1588){if(_0x3a1588){return _0x3a1588['update'](_0x2d203a)[_0x90cd('0x29')](function(_0xccc184){return _0xccc184;});}return null;};}function removeEntity(_0x341cfb,_0x37dd7c){return function(_0x27d66a){if(_0x27d66a){return _0x27d66a['destroy']()[_0x90cd('0x29')](function(){_0x341cfb[_0x90cd('0x20')](0xcc)[_0x90cd('0x2a')]();});}};}function handleEntityNotFound(_0x9bd92b,_0x127197){return function(_0x55d456){if(!_0x55d456){_0x9bd92b['sendStatus'](0x194);}return _0x55d456;};}function handleError(_0x552fea,_0x270964){_0x270964=_0x270964||0x1f4;return function(_0x3f2f07){logger[_0x90cd('0x2b')](_0x3f2f07[_0x90cd('0x2c')]);if(_0x3f2f07[_0x90cd('0x2d')]){delete _0x3f2f07[_0x90cd('0x2d')];}_0x552fea[_0x90cd('0x20')](_0x270964)[_0x90cd('0x2e')](_0x3f2f07);};}exports[_0x90cd('0x2f')]=function(_0xf21db7,_0x5c2f12){var _0x5ea586={},_0x2b61d9={},_0x2f23b9={'count':0x0,'rows':[]};var _0x52bcaf=_[_0x90cd('0x30')](db[_0x90cd('0x31')]['rawAttributes'],function(_0x4164a1){return{'name':_0x4164a1[_0x90cd('0x32')],'type':_0x4164a1[_0x90cd('0x33')]['key']};});_0x2b61d9[_0x90cd('0x34')]=_['map'](_0x52bcaf,_0x90cd('0x2d'));_0x2b61d9['query']=_['keys'](_0xf21db7[_0x90cd('0x35')]);_0x2b61d9[_0x90cd('0x36')]=_['intersection'](_0x2b61d9[_0x90cd('0x34')],_0x2b61d9[_0x90cd('0x35')]);_0x5ea586[_0x90cd('0x37')]=_[_0x90cd('0x38')](_0x2b61d9[_0x90cd('0x34')],qs[_0x90cd('0x39')](_0xf21db7[_0x90cd('0x35')][_0x90cd('0x39')]));_0x5ea586[_0x90cd('0x37')]=_0x5ea586[_0x90cd('0x37')]['length']?_0x5ea586[_0x90cd('0x37')]:_0x2b61d9[_0x90cd('0x34')];if(!_0xf21db7[_0x90cd('0x35')][_0x90cd('0x3a')](_0x90cd('0x3b'))){_0x5ea586['limit']=qs['limit'](_0xf21db7[_0x90cd('0x35')][_0x90cd('0x23')]);_0x5ea586[_0x90cd('0x21')]=qs['offset'](_0xf21db7[_0x90cd('0x35')][_0x90cd('0x21')]);}_0x5ea586['order']=qs['sort'](_0xf21db7['query']['sort']);_0x5ea586[_0x90cd('0x3c')]=qs[_0x90cd('0x36')](_[_0x90cd('0x3d')](_0xf21db7['query'],_0x2b61d9[_0x90cd('0x36')]),_0x52bcaf);if(_0xf21db7[_0x90cd('0x35')][_0x90cd('0x3e')]){_0x5ea586['where']=_[_0x90cd('0x3f')](_0x5ea586[_0x90cd('0x3c')],{'$or':_[_0x90cd('0x30')](_0x52bcaf,function(_0x1ce8da){if(_0x1ce8da[_0x90cd('0x33')]!==_0x90cd('0x40')){var _0x3591b1={};_0x3591b1[_0x1ce8da[_0x90cd('0x2d')]]={'$like':'%'+_0xf21db7[_0x90cd('0x35')][_0x90cd('0x3e')]+'%'};return _0x3591b1;}})});}_0x5ea586=_[_0x90cd('0x3f')]({},_0x5ea586,_0xf21db7[_0x90cd('0x41')]);var _0x560cea={'where':_0x5ea586['where']};return db[_0x90cd('0x31')][_0x90cd('0x24')](_0x560cea)[_0x90cd('0x29')](function(_0x5eb31b){_0x2f23b9[_0x90cd('0x24')]=_0x5eb31b;if(_0xf21db7[_0x90cd('0x35')][_0x90cd('0x42')]){_0x5ea586[_0x90cd('0x43')]=[{'all':!![]}];}return db['SquareRecording'][_0x90cd('0x44')](_0x5ea586);})[_0x90cd('0x29')](function(_0x5a955c){_0x2f23b9[_0x90cd('0x45')]=_0x5a955c;return _0x2f23b9;})[_0x90cd('0x29')](respondWithFilteredResult(_0x5c2f12,_0x5ea586))[_0x90cd('0x46')](handleError(_0x5c2f12,null));};exports[_0x90cd('0x47')]=function(_0x1e53ab,_0x8fc08c){var _0x21a90f={'raw':!![],'where':{'id':_0x1e53ab[_0x90cd('0x48')]['id']}},_0x3b3051={};_0x3b3051['model']=_['keys'](db['SquareRecording'][_0x90cd('0x49')]);_0x3b3051[_0x90cd('0x35')]=_[_0x90cd('0x4a')](_0x1e53ab[_0x90cd('0x35')]);_0x3b3051[_0x90cd('0x36')]=_[_0x90cd('0x38')](_0x3b3051['model'],_0x3b3051['query']);_0x21a90f[_0x90cd('0x37')]=_['intersection'](_0x3b3051['model'],qs[_0x90cd('0x39')](_0x1e53ab['query'][_0x90cd('0x39')]));_0x21a90f[_0x90cd('0x37')]=_0x21a90f[_0x90cd('0x37')][_0x90cd('0x4b')]?_0x21a90f[_0x90cd('0x37')]:_0x3b3051['model'];if(_0x1e53ab[_0x90cd('0x35')]['includeAll']){_0x21a90f[_0x90cd('0x43')]=[{'all':!![]}];}_0x21a90f=_[_0x90cd('0x3f')]({},_0x21a90f,_0x1e53ab[_0x90cd('0x41')]);return db[_0x90cd('0x31')][_0x90cd('0x4c')](_0x21a90f)[_0x90cd('0x29')](handleEntityNotFound(_0x8fc08c,null))[_0x90cd('0x29')](respondWithResult(_0x8fc08c,null))[_0x90cd('0x46')](handleError(_0x8fc08c,null));};exports[_0x90cd('0x4d')]=function(_0x5e246e,_0x18b1a4){return db[_0x90cd('0x31')][_0x90cd('0x4d')](_0x5e246e[_0x90cd('0x4e')],{})[_0x90cd('0x29')](respondWithResult(_0x18b1a4,0xc9))[_0x90cd('0x46')](handleError(_0x18b1a4,null));};exports[_0x90cd('0x4f')]=function(_0x126df1,_0x267d6f){if(_0x126df1['body']['id']){delete _0x126df1[_0x90cd('0x4e')]['id'];}return db[_0x90cd('0x31')][_0x90cd('0x4c')]({'where':{'id':_0x126df1[_0x90cd('0x48')]['id']}})['then'](handleEntityNotFound(_0x267d6f,null))[_0x90cd('0x29')](saveUpdates(_0x126df1['body'],null))[_0x90cd('0x29')](respondWithResult(_0x267d6f,null))[_0x90cd('0x46')](handleError(_0x267d6f,null));};exports['download']=function(_0x141d51,_0x29ba10,_0x5197d9){var _0x5edde6=require(_0x90cd('0x50'));var _0x1995dc=![];var _0x7b5662={};if(_0x141d51[_0x90cd('0x35')][_0x90cd('0x33')]&&_0x141d51[_0x90cd('0x35')]['type']===_0x90cd('0x51')){_0x7b5662[_0x90cd('0x51')]=_0x141d51[_0x90cd('0x48')]['id'];}else{_0x7b5662['id']=_0x141d51['params']['id'];}return db[_0x90cd('0x31')][_0x90cd('0x4c')]({'where':_0x7b5662,'attributes':['id',_0x90cd('0x52'),'filename'],'raw':!![]})['then'](handleEntityNotFound(_0x29ba10,null))['then'](function(_0x4a3098){if(_0x4a3098){var _0x1d6b0a=_0x4a3098[_0x90cd('0x52')];var _0x1d1cd4=util[_0x90cd('0x53')](_0x90cd('0x54'),_0x1d6b0a);if(fs['existsSync'](_0x1d1cd4)){_0x1995dc=!![];return _0x5edde6[_0x90cd('0x55')](_0x1d1cd4,_0x1d6b0a,config[_0x90cd('0x56')][_0x90cd('0x57')])[_0x90cd('0x29')](function(){return _0x4a3098;});}return _0x4a3098;}})['then'](function(_0x5f1de7){if(_0x5f1de7){var _0x17bfdb=_0x5f1de7['savePath'];if(!fs['existsSync'](_0x17bfdb)){throw new db[(_0x90cd('0x58'))][(_0x90cd('0x59'))]('SquareRecording\x20not\x20found');}if(_0x5f1de7[_0x90cd('0x5a')]){return _0x29ba10[_0x90cd('0x5b')](_0x17bfdb,_0x5f1de7[_0x90cd('0x5a')]+path[_0x90cd('0x5c')](_0x17bfdb),function(){if(_0x1995dc){fs[_0x90cd('0x5d')](_0x17bfdb);}});}else{return _0x29ba10[_0x90cd('0x5b')](_0x17bfdb,function(_0xf7bc64){if(_0x1995dc){fs[_0x90cd('0x5d')](_0x17bfdb);}});}}})[_0x90cd('0x46')](function(_0x592e3d){if(_0x592e3d[_0x90cd('0x5e')]===_0x90cd('0x5f')){_0x29ba10[_0x90cd('0x20')](0x194)[_0x90cd('0x2e')](_0x90cd('0x60'));}else{return handleError(_0x29ba10,null);}});};exports[_0x90cd('0x61')]=function(_0x8928e9,_0x1553a8){return db[_0x90cd('0x31')][_0x90cd('0x4c')]({'where':{'id':_0x8928e9['params']['id']}})['then'](function(_0x2b5903){if(_[_0x90cd('0x62')](_0x2b5903)){throw new ReferenceError(_0x90cd('0x63'));}return _0x2b5903;})[_0x90cd('0x29')](function(_0x547013){var _0x5ca56b=_0x547013[_0x90cd('0x52')];logger[_0x90cd('0x64')](_0x90cd('0x65'),_0x5ca56b);if(!_[_0x90cd('0x62')](_0x547013[_0x90cd('0x52')])&&fs['existsSync'](_0x5ca56b)){logger[_0x90cd('0x64')]('File:\x20\x22'+_0x5ca56b+_0x90cd('0x66'));fs[_0x90cd('0x67')](_0x5ca56b);}_0x5ca56b=_0x5ca56b+_0x90cd('0x68');if(!_[_0x90cd('0x62')](_0x547013[_0x90cd('0x52')])&&fs[_0x90cd('0x69')](_0x5ca56b)){logger[_0x90cd('0x64')](_0x90cd('0x6a')+_0x5ca56b+_0x90cd('0x66'));fs[_0x90cd('0x67')](_0x5ca56b);}return _0x547013;})[_0x90cd('0x29')](function(_0x24db0b){if(!_0x24db0b)throw new InternalError();return _0x24db0b[_0x90cd('0x61')]();})[_0x90cd('0x29')](function(){_0x1553a8['status'](0xcc)[_0x90cd('0x2a')]();})['catch'](handleError(_0x1553a8,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index dd84018..2c98aff 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 _0x7d10=['SquareRecording','square_recordings','util','../../config/logger','moment','bluebird','path','rimraf','./squareRecording.attributes','exports'];(function(_0x5343da,_0xf56770){var _0x59b155=function(_0x23fffb){while(--_0x23fffb){_0x5343da['push'](_0x5343da['shift']());}};_0x59b155(++_0xf56770);}(_0x7d10,0x1ce));var _0x07d1=function(_0x7d0654,_0x5921a3){_0x7d0654=_0x7d0654-0x0;var _0x450005=_0x7d10[_0x7d0654];return _0x450005;};'use strict';var _=require('lodash');var util=require(_0x07d1('0x0'));var logger=require(_0x07d1('0x1'))('api');var moment=require(_0x07d1('0x2'));var BPromise=require(_0x07d1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x07d1('0x4'));var rimraf=require(_0x07d1('0x5'));var config=require('../../config/environment');var attributes=require(_0x07d1('0x6'));module[_0x07d1('0x7')]=function(_0x1c8f3d,_0x36198a){return _0x1c8f3d['define'](_0x07d1('0x8'),attributes,{'tableName':_0x07d1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd08d=['bluebird','request-promise','rimraf','../../config/environment','./squareRecording.attributes','define','SquareRecording','square_recordings','util','../../config/logger','moment'];(function(_0x17a1b0,_0x433bcc){var _0x6a2865=function(_0x17e406){while(--_0x17e406){_0x17a1b0['push'](_0x17a1b0['shift']());}};_0x6a2865(++_0x433bcc);}(_0xd08d,0x81));var _0xdd08=function(_0x1b3564,_0x16c919){_0x1b3564=_0x1b3564-0x0;var _0x504069=_0xd08d[_0x1b3564];return _0x504069;};'use strict';var _=require('lodash');var util=require(_0xdd08('0x0'));var logger=require(_0xdd08('0x1'))('api');var moment=require(_0xdd08('0x2'));var BPromise=require(_0xdd08('0x3'));var rp=require(_0xdd08('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdd08('0x5'));var config=require(_0xdd08('0x6'));var attributes=require(_0xdd08('0x7'));module['exports']=function(_0x37c67a,_0x1587df){return _0x37c67a[_0xdd08('0x8')](_0xdd08('0x9'),attributes,{'tableName':_0xdd08('0xa'),'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 c590fc5..e40111d 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 _0xad47=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','SquareRecording','create','body','options','raw','CreateSquareRecording','lodash','util','bluebird'];(function(_0x5081b4,_0x290780){var _0x4a202b=function(_0x58220a){while(--_0x58220a){_0x5081b4['push'](_0x5081b4['shift']());}};_0x4a202b(++_0x290780);}(_0xad47,0xc1));var _0x7ad4=function(_0x2341c6,_0x3af092){_0x2341c6=_0x2341c6-0x0;var _0x54c34d=_0xad47[_0x2341c6];return _0x54c34d;};'use strict';var _=require(_0x7ad4('0x0'));var util=require(_0x7ad4('0x1'));var moment=require('moment');var BPromise=require(_0x7ad4('0x2'));var rs=require(_0x7ad4('0x3'));var fs=require('fs');var Redis=require(_0x7ad4('0x4'));var db=require(_0x7ad4('0x5'))['db'];var utils=require(_0x7ad4('0x6'));var logger=require('../../config/logger')(_0x7ad4('0x7'));var config=require(_0x7ad4('0x8'));var jayson=require(_0x7ad4('0x9'));var client=jayson['client'][_0x7ad4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cbc12,_0x1ea267,_0x528d0c){return new BPromise(function(_0x5b2536,_0x208442){return client[_0x7ad4('0xb')](_0x3cbc12,_0x528d0c)[_0x7ad4('0xc')](function(_0x32eb79){logger[_0x7ad4('0xd')](_0x7ad4('0xe'),_0x1ea267,'request\x20sent');logger[_0x7ad4('0xf')](_0x7ad4('0x10'),_0x1ea267,_0x7ad4('0x11'),JSON[_0x7ad4('0x12')](_0x32eb79));if(_0x32eb79[_0x7ad4('0x13')]){if(_0x32eb79[_0x7ad4('0x13')]['code']===0x1f4){logger[_0x7ad4('0x13')](_0x7ad4('0xe'),_0x1ea267,_0x32eb79[_0x7ad4('0x13')]['message']);return _0x208442(_0x32eb79[_0x7ad4('0x13')]['message']);}logger[_0x7ad4('0x13')](_0x7ad4('0xe'),_0x1ea267,_0x32eb79['error'][_0x7ad4('0x14')]);return _0x5b2536(_0x32eb79['error']['message']);}else{logger[_0x7ad4('0xd')](_0x7ad4('0xe'),_0x1ea267,_0x7ad4('0x11'));_0x5b2536(_0x32eb79['result'][_0x7ad4('0x14')]);}})[_0x7ad4('0x15')](function(_0x407b48){logger[_0x7ad4('0x13')](_0x7ad4('0xe'),_0x1ea267,_0x407b48);_0x208442(_0x407b48);});});}exports['CreateSquareRecording']=function(_0x4ab9aa){var _0x309b6b=this;return new Promise(function(_0x1f7f22,_0x164dcf){return db[_0x7ad4('0x16')][_0x7ad4('0x17')](_0x4ab9aa[_0x7ad4('0x18')],{'raw':_0x4ab9aa[_0x7ad4('0x19')]?_0x4ab9aa['options'][_0x7ad4('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x3738a1){logger['info'](_0x7ad4('0x1b'),_0x4ab9aa);logger[_0x7ad4('0xf')]('CreateSquareRecording',_0x4ab9aa,JSON['stringify'](_0x3738a1));_0x1f7f22(_0x3738a1);})[_0x7ad4('0x15')](function(_0x5be203){logger[_0x7ad4('0x13')](_0x7ad4('0x1b'),_0x5be203[_0x7ad4('0x14')],_0x4ab9aa);_0x164dcf(_0x309b6b['error'](0x1f4,_0x5be203['message']));});});}; \ No newline at end of file +var _0x1eee=['options','raw','CreateSquareRecording','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareRecording,\x20%s,\x20%s','info','result','catch','SquareRecording','create','body'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1eee,0x162));var _0xe1ee=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x1eee[_0xc67528];return _0x38e26d;};'use strict';var _=require(_0xe1ee('0x0'));var util=require(_0xe1ee('0x1'));var moment=require(_0xe1ee('0x2'));var BPromise=require(_0xe1ee('0x3'));var rs=require(_0xe1ee('0x4'));var fs=require('fs');var Redis=require(_0xe1ee('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe1ee('0x6'));var logger=require('../../config/logger')(_0xe1ee('0x7'));var config=require(_0xe1ee('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe1ee('0x9')][_0xe1ee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3587b7,_0x191e02,_0x41efae){return new BPromise(function(_0x3d5b62,_0x3bb64a){return client['request'](_0x3587b7,_0x41efae)['then'](function(_0x4feb00){logger['info']('SquareRecording,\x20%s,\x20%s',_0x191e02,_0xe1ee('0xb'));logger['debug'](_0xe1ee('0xc'),_0x191e02,'request\x20sent',JSON[_0xe1ee('0xd')](_0x4feb00));if(_0x4feb00[_0xe1ee('0xe')]){if(_0x4feb00[_0xe1ee('0xe')][_0xe1ee('0xf')]===0x1f4){logger['error']('SquareRecording,\x20%s,\x20%s',_0x191e02,_0x4feb00[_0xe1ee('0xe')]['message']);return _0x3bb64a(_0x4feb00['error'][_0xe1ee('0x10')]);}logger[_0xe1ee('0xe')](_0xe1ee('0x11'),_0x191e02,_0x4feb00['error'][_0xe1ee('0x10')]);return _0x3d5b62(_0x4feb00[_0xe1ee('0xe')][_0xe1ee('0x10')]);}else{logger[_0xe1ee('0x12')]('SquareRecording,\x20%s,\x20%s',_0x191e02,_0xe1ee('0xb'));_0x3d5b62(_0x4feb00[_0xe1ee('0x13')][_0xe1ee('0x10')]);}})[_0xe1ee('0x14')](function(_0x33c5db){logger[_0xe1ee('0xe')](_0xe1ee('0x11'),_0x191e02,_0x33c5db);_0x3bb64a(_0x33c5db);});});}exports['CreateSquareRecording']=function(_0x6de404){var _0x2e6495=this;return new Promise(function(_0x3c7390,_0x165b91){return db[_0xe1ee('0x15')][_0xe1ee('0x16')](_0x6de404[_0xe1ee('0x17')],{'raw':_0x6de404[_0xe1ee('0x18')]?_0x6de404['options'][_0xe1ee('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1e003f){logger['info'](_0xe1ee('0x1a'),_0x6de404);logger['debug'](_0xe1ee('0x1a'),_0x6de404,JSON[_0xe1ee('0xd')](_0x1e003f));_0x3c7390(_0x1e003f);})[_0xe1ee('0x14')](function(_0x5abb9e){logger[_0xe1ee('0xe')](_0xe1ee('0x1a'),_0x5abb9e[_0xe1ee('0x10')],_0x6de404);_0x165b91(_0x2e6495[_0xe1ee('0xe')](0x1f4,_0x5abb9e[_0xe1ee('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 9ca5cd6..a0ed120 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 _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x18be13,_0x12f269){var _0x17317b=function(_0x449d31){while(--_0x449d31){_0x18be13['push'](_0x18be13['shift']());}};_0x17317b(++_0x12f269);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x5d88c0,_0x5d7d83){var _0x1b40f0=function(_0x3fde10){while(--_0x3fde10){_0x5d88c0['push'](_0x5d88c0['shift']());}};_0x1b40f0(++_0x5d7d83);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index e21c8f2..69cfc8d 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 _0x67f9=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x37cc52,_0x459a9b){var _0x2b4a90=function(_0xabcfc7){while(--_0xabcfc7){_0x37cc52['push'](_0x37cc52['shift']());}};_0x2b4a90(++_0x459a9b);}(_0x67f9,0x148));var _0x967f=function(_0x28ecd9,_0x234921){_0x28ecd9=_0x28ecd9-0x0;var _0x3957f9=_0x67f9[_0x28ecd9];return _0x3957f9;};'use strict';var Sequelize=require(_0x967f('0x0'));module[_0x967f('0x1')]={'network':{'type':Sequelize[_0x967f('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x967f('0x2')]},'channel':{'type':Sequelize[_0x967f('0x2')]},'language':{'type':Sequelize[_0x967f('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x967f('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x967f('0x2')]},'callingpres':{'type':Sequelize[_0x967f('0x2')]},'callingani2':{'type':Sequelize[_0x967f('0x2')]},'callington':{'type':Sequelize[_0x967f('0x2')]},'callingtns':{'type':Sequelize[_0x967f('0x2')]},'dnid':{'type':Sequelize[_0x967f('0x2')]},'rdnis':{'type':Sequelize[_0x967f('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x967f('0x2')]},'priority':{'type':Sequelize[_0x967f('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x967f('0x2')]},'joinAt':{'type':Sequelize[_0x967f('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x967f('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x823b=['BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x1ddd60,_0xd95456){var _0xffd0a5=function(_0x25fae5){while(--_0x25fae5){_0x1ddd60['push'](_0x1ddd60['shift']());}};_0xffd0a5(++_0xd95456);}(_0x823b,0x16e));var _0xb823=function(_0x2aebf0,_0x24fcbd){_0x2aebf0=_0x2aebf0-0x0;var _0x593c2a=_0x823b[_0x2aebf0];return _0x593c2a;};'use strict';var Sequelize=require(_0xb823('0x0'));module[_0xb823('0x1')]={'network':{'type':Sequelize[_0xb823('0x2')]},'network_script':{'type':Sequelize[_0xb823('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb823('0x2')]},'language':{'type':Sequelize[_0xb823('0x2')]},'type':{'type':Sequelize[_0xb823('0x2')]},'uniqueid':{'type':Sequelize[_0xb823('0x2')]},'version':{'type':Sequelize[_0xb823('0x2')]},'callerid':{'type':Sequelize[_0xb823('0x2')]},'calleridname':{'type':Sequelize[_0xb823('0x2')]},'callingpres':{'type':Sequelize[_0xb823('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xb823('0x2')]},'dnid':{'type':Sequelize[_0xb823('0x2')]},'rdnis':{'type':Sequelize[_0xb823('0x2')]},'context':{'type':Sequelize[_0xb823('0x2')]},'extension':{'type':Sequelize[_0xb823('0x2')]},'priority':{'type':Sequelize[_0xb823('0x2')]},'enhanced':{'type':Sequelize[_0xb823('0x2')]},'accountcode':{'type':Sequelize[_0xb823('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xb823('0x3')]},'bot':{'type':Sequelize[_0xb823('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 782a15f..9e2a9af 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 _0x01ae=['sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','error','stack','name','send','SquareReport','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0xc66461,_0x38bf3c){var _0x17a69a=function(_0x2cad3b){while(--_0x2cad3b){_0xc66461['push'](_0xc66461['shift']());}};_0x17a69a(++_0x38bf3c);}(_0x01ae,0x7b));var _0xe01a=function(_0x3d27a,_0x31311d){_0x3d27a=_0x3d27a-0x0;var _0x314fd7=_0x01ae[_0x3d27a];return _0x314fd7;};'use strict';var emlformat=require(_0xe01a('0x0'));var rimraf=require(_0xe01a('0x1'));var zipdir=require(_0xe01a('0x2'));var jsonpatch=require(_0xe01a('0x3'));var rp=require(_0xe01a('0x4'));var moment=require(_0xe01a('0x5'));var BPromise=require(_0xe01a('0x6'));var Mustache=require('mustache');var util=require(_0xe01a('0x7'));var path=require(_0xe01a('0x8'));var sox=require('sox');var csv=require(_0xe01a('0x9'));var ejs=require(_0xe01a('0xa'));var fs=require('fs');var fs_extra=require(_0xe01a('0xb'));var _=require(_0xe01a('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe01a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe01a('0xe'));var Papa=require('papaparse');var Redis=require(_0xe01a('0xf'));var authService=require(_0xe01a('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe01a('0x11'));var hardwareService=require(_0xe01a('0x12'));var logger=require('../../config/logger')(_0xe01a('0x13'));var utils=require('../../config/utils');var config=require(_0xe01a('0x14'));var licenseUtil=require(_0xe01a('0x15'));var db=require(_0xe01a('0x16'))['db'];function respondWithStatusCode(_0x519ef1,_0x30cf5f){_0x30cf5f=_0x30cf5f||0xcc;return function(_0x1af5f9){if(_0x1af5f9){return _0x519ef1[_0xe01a('0x17')](_0x30cf5f);}return _0x519ef1[_0xe01a('0x18')](_0x30cf5f)[_0xe01a('0x19')]();};}function respondWithResult(_0x8f11c5,_0x5c1bc0){_0x5c1bc0=_0x5c1bc0||0xc8;return function(_0x1e312d){if(_0x1e312d){return _0x8f11c5[_0xe01a('0x18')](_0x5c1bc0)['json'](_0x1e312d);}};}function respondWithFilteredResult(_0x28375b,_0x3a479c){return function(_0x8c7d81){if(_0x8c7d81){var _0x3dda2a=typeof _0x3a479c['offset']==='undefined'&&typeof _0x3a479c[_0xe01a('0x1a')]===_0xe01a('0x1b');var _0xce77b4=_0x8c7d81[_0xe01a('0x1c')];var _0x3f59cd=_0x3dda2a?0x0:_0x3a479c[_0xe01a('0x1d')];var _0x416bd5=_0x3dda2a?_0x8c7d81[_0xe01a('0x1c')]:_0x3a479c[_0xe01a('0x1d')]+_0x3a479c['limit'];var _0x30fe10;if(_0x416bd5>=_0xce77b4){_0x416bd5=_0xce77b4;_0x30fe10=0xc8;}else{_0x30fe10=0xce;}_0x28375b['status'](_0x30fe10);return _0x28375b[_0xe01a('0x1e')](_0xe01a('0x1f'),_0x3f59cd+'-'+_0x416bd5+'/'+_0xce77b4)['json'](_0x8c7d81);}return null;};}function patchUpdates(_0x13b7cc){return function(_0x38c87b){try{jsonpatch[_0xe01a('0x20')](_0x38c87b,_0x13b7cc,!![]);}catch(_0x380380){return BPromise['reject'](_0x380380);}return _0x38c87b[_0xe01a('0x21')]();};}function saveUpdates(_0x53ada8,_0x5be967){return function(_0x12c689){if(_0x12c689){return _0x12c689[_0xe01a('0x22')](_0x53ada8)[_0xe01a('0x23')](function(_0x413ea0){return _0x413ea0;});}return null;};}function removeEntity(_0x54b65a,_0x59a29c){return function(_0x882a20){if(_0x882a20){return _0x882a20['destroy']()[_0xe01a('0x23')](function(){_0x54b65a[_0xe01a('0x18')](0xcc)[_0xe01a('0x19')]();});}};}function handleEntityNotFound(_0x8be244,_0x494071){return function(_0x116d8a){if(!_0x116d8a){_0x8be244[_0xe01a('0x17')](0x194);}return _0x116d8a;};}function handleError(_0x41034c,_0x521579){_0x521579=_0x521579||0x1f4;return function(_0x377601){logger[_0xe01a('0x24')](_0x377601[_0xe01a('0x25')]);if(_0x377601[_0xe01a('0x26')]){delete _0x377601[_0xe01a('0x26')];}_0x41034c[_0xe01a('0x18')](_0x521579)[_0xe01a('0x27')](_0x377601);};}exports['index']=function(_0x10b361,_0x236722){var _0x43c875={},_0x2010c5={},_0x3409ce={'count':0x0,'rows':[]};var _0x1f2f57=_['map'](db[_0xe01a('0x28')][_0xe01a('0x29')],function(_0x38bfc4){return{'name':_0x38bfc4[_0xe01a('0x2a')],'type':_0x38bfc4[_0xe01a('0x2b')]['key']};});_0x2010c5[_0xe01a('0x2c')]=_[_0xe01a('0x2d')](_0x1f2f57,_0xe01a('0x26'));_0x2010c5[_0xe01a('0x2e')]=_[_0xe01a('0x2f')](_0x10b361[_0xe01a('0x2e')]);_0x2010c5['filters']=_[_0xe01a('0x30')](_0x2010c5[_0xe01a('0x2c')],_0x2010c5['query']);_0x43c875[_0xe01a('0x31')]=_[_0xe01a('0x30')](_0x2010c5['model'],qs[_0xe01a('0x32')](_0x10b361[_0xe01a('0x2e')][_0xe01a('0x32')]));_0x43c875[_0xe01a('0x31')]=_0x43c875[_0xe01a('0x31')][_0xe01a('0x33')]?_0x43c875[_0xe01a('0x31')]:_0x2010c5['model'];if(!_0x10b361[_0xe01a('0x2e')][_0xe01a('0x34')]('nolimit')){_0x43c875[_0xe01a('0x1a')]=qs[_0xe01a('0x1a')](_0x10b361['query']['limit']);_0x43c875[_0xe01a('0x1d')]=qs[_0xe01a('0x1d')](_0x10b361[_0xe01a('0x2e')][_0xe01a('0x1d')]);}_0x43c875[_0xe01a('0x35')]=qs[_0xe01a('0x36')](_0x10b361[_0xe01a('0x2e')]['sort']);_0x43c875['where']=qs[_0xe01a('0x37')](_[_0xe01a('0x38')](_0x10b361[_0xe01a('0x2e')],_0x2010c5['filters']),_0x1f2f57);if(_0x10b361[_0xe01a('0x2e')][_0xe01a('0x39')]){_0x43c875['where']=_[_0xe01a('0x3a')](_0x43c875[_0xe01a('0x3b')],{'$or':_[_0xe01a('0x2d')](_0x1f2f57,function(_0xc2c8f1){if(_0xc2c8f1[_0xe01a('0x2b')]!==_0xe01a('0x3c')){var _0x55e375={};_0x55e375[_0xc2c8f1[_0xe01a('0x26')]]={'$like':'%'+_0x10b361['query'][_0xe01a('0x39')]+'%'};return _0x55e375;}})});}_0x43c875=_['merge']({},_0x43c875,_0x10b361[_0xe01a('0x3d')]);var _0x131a5b={'where':_0x43c875[_0xe01a('0x3b')]};return db[_0xe01a('0x28')][_0xe01a('0x1c')](_0x131a5b)[_0xe01a('0x23')](function(_0x3b33f1){_0x3409ce[_0xe01a('0x1c')]=_0x3b33f1;if(_0x10b361[_0xe01a('0x2e')][_0xe01a('0x3e')]){_0x43c875[_0xe01a('0x3f')]=[{'all':!![]}];}return db[_0xe01a('0x28')][_0xe01a('0x40')](_0x43c875);})[_0xe01a('0x23')](function(_0xb1bf7b){_0x3409ce['rows']=_0xb1bf7b;return _0x3409ce;})[_0xe01a('0x23')](respondWithFilteredResult(_0x236722,_0x43c875))[_0xe01a('0x41')](handleError(_0x236722,null));};exports[_0xe01a('0x42')]=function(_0xa4a484,_0x2596e3){var _0xa9a1b9={'raw':!![],'where':{'id':_0xa4a484[_0xe01a('0x43')]['id']}},_0x11048b={};_0x11048b['model']=_[_0xe01a('0x2f')](db[_0xe01a('0x28')][_0xe01a('0x29')]);_0x11048b[_0xe01a('0x2e')]=_['keys'](_0xa4a484[_0xe01a('0x2e')]);_0x11048b[_0xe01a('0x37')]=_['intersection'](_0x11048b['model'],_0x11048b[_0xe01a('0x2e')]);_0xa9a1b9['attributes']=_['intersection'](_0x11048b[_0xe01a('0x2c')],qs[_0xe01a('0x32')](_0xa4a484[_0xe01a('0x2e')][_0xe01a('0x32')]));_0xa9a1b9['attributes']=_0xa9a1b9['attributes'][_0xe01a('0x33')]?_0xa9a1b9[_0xe01a('0x31')]:_0x11048b['model'];if(_0xa4a484[_0xe01a('0x2e')][_0xe01a('0x3e')]){_0xa9a1b9[_0xe01a('0x3f')]=[{'all':!![]}];}_0xa9a1b9=_['merge']({},_0xa9a1b9,_0xa4a484['options']);return db[_0xe01a('0x28')][_0xe01a('0x44')](_0xa9a1b9)[_0xe01a('0x23')](handleEntityNotFound(_0x2596e3,null))[_0xe01a('0x23')](respondWithResult(_0x2596e3,null))[_0xe01a('0x41')](handleError(_0x2596e3,null));};exports[_0xe01a('0x45')]=function(_0x24d99a,_0x360d3d){return db['SquareReport'][_0xe01a('0x45')](_0x24d99a['body'],{})[_0xe01a('0x23')](respondWithResult(_0x360d3d,0xc9))['catch'](handleError(_0x360d3d,null));};exports[_0xe01a('0x22')]=function(_0x53a695,_0x160483){if(_0x53a695[_0xe01a('0x46')]['id']){delete _0x53a695[_0xe01a('0x46')]['id'];}return db[_0xe01a('0x28')]['find']({'where':{'id':_0x53a695[_0xe01a('0x43')]['id']}})['then'](handleEntityNotFound(_0x160483,null))['then'](saveUpdates(_0x53a695['body'],null))['then'](respondWithResult(_0x160483,null))[_0xe01a('0x41')](handleError(_0x160483,null));};exports[_0xe01a('0x47')]=function(_0xb0ac82,_0x515868){return db[_0xe01a('0x28')][_0xe01a('0x44')]({'where':{'id':_0xb0ac82[_0xe01a('0x43')]['id']}})[_0xe01a('0x23')](handleEntityNotFound(_0x515868,null))[_0xe01a('0x23')](removeEntity(_0x515868,null))[_0xe01a('0x41')](handleError(_0x515868,null));};exports[_0xe01a('0x48')]=function(_0x4ad6c3,_0x46b9e4){return db[_0xe01a('0x28')][_0xe01a('0x48')]()[_0xe01a('0x23')](respondWithResult(_0x46b9e4,null))[_0xe01a('0x41')](handleError(_0x46b9e4,null));}; \ No newline at end of file +var _0x6d1e=['includeAll','findAll','catch','show','keys','length','include','body','params','find','describe','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','stack','name','send','index','SquareReport','rawAttributes','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','options'];(function(_0x322a33,_0x2d6162){var _0x4386ea=function(_0x35bc70){while(--_0x35bc70){_0x322a33['push'](_0x322a33['shift']());}};_0x4386ea(++_0x2d6162);}(_0x6d1e,0x127));var _0xe6d1=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x6d1e[_0x297fd3];return _0x2af381;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe6d1('0x0'));var zipdir=require(_0xe6d1('0x1'));var jsonpatch=require(_0xe6d1('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe6d1('0x3'));var Mustache=require(_0xe6d1('0x4'));var util=require(_0xe6d1('0x5'));var path=require(_0xe6d1('0x6'));var sox=require(_0xe6d1('0x7'));var csv=require(_0xe6d1('0x8'));var ejs=require(_0xe6d1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe6d1('0xa'));var crypto=require(_0xe6d1('0xb'));var jsforce=require(_0xe6d1('0xc'));var deskjs=require(_0xe6d1('0xd'));var toCsv=require(_0xe6d1('0x8'));var querystring=require(_0xe6d1('0xe'));var Papa=require(_0xe6d1('0xf'));var Redis=require(_0xe6d1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe6d1('0x11'));var as=require(_0xe6d1('0x12'));var hardwareService=require(_0xe6d1('0x13'));var logger=require('../../config/logger')(_0xe6d1('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe6d1('0x15'));var db=require(_0xe6d1('0x16'))['db'];function respondWithStatusCode(_0x345d48,_0x536399){_0x536399=_0x536399||0xcc;return function(_0x32f232){if(_0x32f232){return _0x345d48[_0xe6d1('0x17')](_0x536399);}return _0x345d48[_0xe6d1('0x18')](_0x536399)[_0xe6d1('0x19')]();};}function respondWithResult(_0x51b35a,_0x1c1309){_0x1c1309=_0x1c1309||0xc8;return function(_0x34ee87){if(_0x34ee87){return _0x51b35a[_0xe6d1('0x18')](_0x1c1309)['json'](_0x34ee87);}};}function respondWithFilteredResult(_0x41a6d0,_0x46ec03){return function(_0x2077f5){if(_0x2077f5){var _0x3dd4c1=typeof _0x46ec03[_0xe6d1('0x1a')]===_0xe6d1('0x1b')&&typeof _0x46ec03[_0xe6d1('0x1c')]===_0xe6d1('0x1b');var _0x3af236=_0x2077f5[_0xe6d1('0x1d')];var _0x1de471=_0x3dd4c1?0x0:_0x46ec03['offset'];var _0x5c397b=_0x3dd4c1?_0x2077f5[_0xe6d1('0x1d')]:_0x46ec03[_0xe6d1('0x1a')]+_0x46ec03[_0xe6d1('0x1c')];var _0x3fc094;if(_0x5c397b>=_0x3af236){_0x5c397b=_0x3af236;_0x3fc094=0xc8;}else{_0x3fc094=0xce;}_0x41a6d0[_0xe6d1('0x18')](_0x3fc094);return _0x41a6d0[_0xe6d1('0x1e')](_0xe6d1('0x1f'),_0x1de471+'-'+_0x5c397b+'/'+_0x3af236)[_0xe6d1('0x20')](_0x2077f5);}return null;};}function patchUpdates(_0x2ce95a){return function(_0x40c3f8){try{jsonpatch[_0xe6d1('0x21')](_0x40c3f8,_0x2ce95a,!![]);}catch(_0x5f138c){return BPromise[_0xe6d1('0x22')](_0x5f138c);}return _0x40c3f8[_0xe6d1('0x23')]();};}function saveUpdates(_0x39f607,_0x3f2932){return function(_0x13896b){if(_0x13896b){return _0x13896b[_0xe6d1('0x24')](_0x39f607)['then'](function(_0x30b0a2){return _0x30b0a2;});}return null;};}function removeEntity(_0x41f9de,_0x12b1bc){return function(_0x258601){if(_0x258601){return _0x258601['destroy']()[_0xe6d1('0x25')](function(){_0x41f9de[_0xe6d1('0x18')](0xcc)[_0xe6d1('0x19')]();});}};}function handleEntityNotFound(_0x29dac7,_0x5f09cf){return function(_0x29e029){if(!_0x29e029){_0x29dac7[_0xe6d1('0x17')](0x194);}return _0x29e029;};}function handleError(_0x8ff341,_0x555eb0){_0x555eb0=_0x555eb0||0x1f4;return function(_0x3b5079){logger['error'](_0x3b5079[_0xe6d1('0x26')]);if(_0x3b5079[_0xe6d1('0x27')]){delete _0x3b5079[_0xe6d1('0x27')];}_0x8ff341[_0xe6d1('0x18')](_0x555eb0)[_0xe6d1('0x28')](_0x3b5079);};}exports[_0xe6d1('0x29')]=function(_0x339ffa,_0x4180e8){var _0x2f1eea={},_0x45859f={},_0x458c71={'count':0x0,'rows':[]};var _0xec9d5f=_['map'](db[_0xe6d1('0x2a')][_0xe6d1('0x2b')],function(_0x9ba819){return{'name':_0x9ba819['fieldName'],'type':_0x9ba819[_0xe6d1('0x2c')]['key']};});_0x45859f[_0xe6d1('0x2d')]=_['map'](_0xec9d5f,_0xe6d1('0x27'));_0x45859f[_0xe6d1('0x2e')]=_['keys'](_0x339ffa[_0xe6d1('0x2e')]);_0x45859f[_0xe6d1('0x2f')]=_[_0xe6d1('0x30')](_0x45859f['model'],_0x45859f['query']);_0x2f1eea[_0xe6d1('0x31')]=_[_0xe6d1('0x30')](_0x45859f[_0xe6d1('0x2d')],qs[_0xe6d1('0x32')](_0x339ffa[_0xe6d1('0x2e')][_0xe6d1('0x32')]));_0x2f1eea[_0xe6d1('0x31')]=_0x2f1eea[_0xe6d1('0x31')]['length']?_0x2f1eea[_0xe6d1('0x31')]:_0x45859f[_0xe6d1('0x2d')];if(!_0x339ffa[_0xe6d1('0x2e')][_0xe6d1('0x33')](_0xe6d1('0x34'))){_0x2f1eea[_0xe6d1('0x1c')]=qs[_0xe6d1('0x1c')](_0x339ffa[_0xe6d1('0x2e')][_0xe6d1('0x1c')]);_0x2f1eea['offset']=qs[_0xe6d1('0x1a')](_0x339ffa['query'][_0xe6d1('0x1a')]);}_0x2f1eea['order']=qs[_0xe6d1('0x35')](_0x339ffa['query']['sort']);_0x2f1eea[_0xe6d1('0x36')]=qs[_0xe6d1('0x2f')](_[_0xe6d1('0x37')](_0x339ffa[_0xe6d1('0x2e')],_0x45859f[_0xe6d1('0x2f')]),_0xec9d5f);if(_0x339ffa[_0xe6d1('0x2e')][_0xe6d1('0x38')]){_0x2f1eea[_0xe6d1('0x36')]=_[_0xe6d1('0x39')](_0x2f1eea[_0xe6d1('0x36')],{'$or':_[_0xe6d1('0x3a')](_0xec9d5f,function(_0x47a8a8){if(_0x47a8a8[_0xe6d1('0x2c')]!=='VIRTUAL'){var _0x4d160f={};_0x4d160f[_0x47a8a8[_0xe6d1('0x27')]]={'$like':'%'+_0x339ffa[_0xe6d1('0x2e')][_0xe6d1('0x38')]+'%'};return _0x4d160f;}})});}_0x2f1eea=_[_0xe6d1('0x39')]({},_0x2f1eea,_0x339ffa[_0xe6d1('0x3b')]);var _0x4b658d={'where':_0x2f1eea[_0xe6d1('0x36')]};return db[_0xe6d1('0x2a')][_0xe6d1('0x1d')](_0x4b658d)['then'](function(_0x203af8){_0x458c71['count']=_0x203af8;if(_0x339ffa[_0xe6d1('0x2e')][_0xe6d1('0x3c')]){_0x2f1eea['include']=[{'all':!![]}];}return db['SquareReport'][_0xe6d1('0x3d')](_0x2f1eea);})[_0xe6d1('0x25')](function(_0xcfb1c7){_0x458c71['rows']=_0xcfb1c7;return _0x458c71;})['then'](respondWithFilteredResult(_0x4180e8,_0x2f1eea))[_0xe6d1('0x3e')](handleError(_0x4180e8,null));};exports[_0xe6d1('0x3f')]=function(_0x46143c,_0x479a32){var _0x473a6b={'raw':!![],'where':{'id':_0x46143c['params']['id']}},_0x15455d={};_0x15455d['model']=_[_0xe6d1('0x40')](db[_0xe6d1('0x2a')][_0xe6d1('0x2b')]);_0x15455d['query']=_[_0xe6d1('0x40')](_0x46143c['query']);_0x15455d[_0xe6d1('0x2f')]=_[_0xe6d1('0x30')](_0x15455d[_0xe6d1('0x2d')],_0x15455d[_0xe6d1('0x2e')]);_0x473a6b[_0xe6d1('0x31')]=_[_0xe6d1('0x30')](_0x15455d['model'],qs[_0xe6d1('0x32')](_0x46143c['query'][_0xe6d1('0x32')]));_0x473a6b[_0xe6d1('0x31')]=_0x473a6b[_0xe6d1('0x31')][_0xe6d1('0x41')]?_0x473a6b[_0xe6d1('0x31')]:_0x15455d[_0xe6d1('0x2d')];if(_0x46143c[_0xe6d1('0x2e')][_0xe6d1('0x3c')]){_0x473a6b[_0xe6d1('0x42')]=[{'all':!![]}];}_0x473a6b=_[_0xe6d1('0x39')]({},_0x473a6b,_0x46143c['options']);return db['SquareReport']['find'](_0x473a6b)['then'](handleEntityNotFound(_0x479a32,null))[_0xe6d1('0x25')](respondWithResult(_0x479a32,null))['catch'](handleError(_0x479a32,null));};exports['create']=function(_0x28cba2,_0x2df7e5){return db[_0xe6d1('0x2a')]['create'](_0x28cba2[_0xe6d1('0x43')],{})[_0xe6d1('0x25')](respondWithResult(_0x2df7e5,0xc9))[_0xe6d1('0x3e')](handleError(_0x2df7e5,null));};exports[_0xe6d1('0x24')]=function(_0x46efd9,_0xfa1f1b){if(_0x46efd9['body']['id']){delete _0x46efd9['body']['id'];}return db[_0xe6d1('0x2a')]['find']({'where':{'id':_0x46efd9[_0xe6d1('0x44')]['id']}})[_0xe6d1('0x25')](handleEntityNotFound(_0xfa1f1b,null))[_0xe6d1('0x25')](saveUpdates(_0x46efd9['body'],null))[_0xe6d1('0x25')](respondWithResult(_0xfa1f1b,null))[_0xe6d1('0x3e')](handleError(_0xfa1f1b,null));};exports['destroy']=function(_0x2baa07,_0x53c634){return db[_0xe6d1('0x2a')][_0xe6d1('0x45')]({'where':{'id':_0x2baa07[_0xe6d1('0x44')]['id']}})[_0xe6d1('0x25')](handleEntityNotFound(_0x53c634,null))[_0xe6d1('0x25')](removeEntity(_0x53c634,null))[_0xe6d1('0x3e')](handleError(_0x53c634,null));};exports[_0xe6d1('0x46')]=function(_0x3453b9,_0x379e08){return db[_0xe6d1('0x2a')][_0xe6d1('0x46')]()[_0xe6d1('0x25')](respondWithResult(_0x379e08,null))[_0xe6d1('0x3e')](handleError(_0x379e08,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index a0520ce..0645ace 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 _0x2f89=['moment','request-promise','../../config/environment','exports','define','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x2f89,0xa6));var _0x92f8=function(_0x2b0c01,_0x549efd){_0x2b0c01=_0x2b0c01-0x0;var _0x3080ea=_0x2f89[_0x2b0c01];return _0x3080ea;};'use strict';var _=require(_0x92f8('0x0'));var util=require(_0x92f8('0x1'));var logger=require(_0x92f8('0x2'))('api');var moment=require(_0x92f8('0x3'));var BPromise=require('bluebird');var rp=require(_0x92f8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x92f8('0x5'));var attributes=require('./squareReport.attributes');module[_0x92f8('0x6')]=function(_0x1bc2d1,_0x440c08){return _0x1bc2d1[_0x92f8('0x7')]('SquareReport',attributes,{'tableName':_0x92f8('0x8'),'paranoid':![],'indexes':[{'name':_0x92f8('0x9'),'fields':[_0x92f8('0xa'),_0x92f8('0xb')]},{'name':_0x92f8('0xc'),'fields':[_0x92f8('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5172=['request-promise','rimraf','exports','define','SquareReport','report_square','uniqueid','leaveAt','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x34a038,_0x353ddd){var _0x3aca8a=function(_0x2de3e1){while(--_0x2de3e1){_0x34a038['push'](_0x34a038['shift']());}};_0x3aca8a(++_0x353ddd);}(_0x5172,0xbe));var _0x2517=function(_0x3a0809,_0x372235){_0x3a0809=_0x3a0809-0x0;var _0x531ded=_0x5172[_0x3a0809];return _0x531ded;};'use strict';var _=require(_0x2517('0x0'));var util=require(_0x2517('0x1'));var logger=require(_0x2517('0x2'))(_0x2517('0x3'));var moment=require(_0x2517('0x4'));var BPromise=require(_0x2517('0x5'));var rp=require(_0x2517('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2517('0x7'));var config=require('../../config/environment');var attributes=require('./squareReport.attributes');module[_0x2517('0x8')]=function(_0x1bbe65,_0x49d551){return _0x1bbe65[_0x2517('0x9')](_0x2517('0xa'),attributes,{'tableName':_0x2517('0xb'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x2517('0xc'),'project_name']},{'name':_0x2517('0xd'),'fields':[_0x2517('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index da230bd..ae0c346 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 _0x80ba=['request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','CreateSquareReport','SquareReport','create','options','raw','catch','UpdateSquareReport','update','body','where','attributes','util','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x52eefa,_0x5aa662){var _0x44e953=function(_0x572d93){while(--_0x572d93){_0x52eefa['push'](_0x52eefa['shift']());}};_0x44e953(++_0x5aa662);}(_0x80ba,0x12c));var _0xa80b=function(_0x1d3e22,_0x2a3efb){_0x1d3e22=_0x1d3e22-0x0;var _0x5b08cf=_0x80ba[_0x1d3e22];return _0x5b08cf;};'use strict';var _=require('lodash');var util=require(_0xa80b('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa80b('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xa80b('0x2'));var logger=require(_0xa80b('0x3'))(_0xa80b('0x4'));var config=require('../../config/environment');var jayson=require(_0xa80b('0x5'));var client=jayson[_0xa80b('0x6')][_0xa80b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x56e128,_0xb3839f,_0x1d2d74){return new BPromise(function(_0x503e65,_0x2870cf){return client[_0xa80b('0x8')](_0x56e128,_0x1d2d74)[_0xa80b('0x9')](function(_0x334794){logger[_0xa80b('0xa')](_0xa80b('0xb'),_0xb3839f,_0xa80b('0xc'));logger[_0xa80b('0xd')]('SquareReport,\x20%s,\x20%s,\x20%s',_0xb3839f,_0xa80b('0xc'),JSON[_0xa80b('0xe')](_0x334794));if(_0x334794[_0xa80b('0xf')]){if(_0x334794[_0xa80b('0xf')]['code']===0x1f4){logger[_0xa80b('0xf')](_0xa80b('0xb'),_0xb3839f,_0x334794['error'][_0xa80b('0x10')]);return _0x2870cf(_0x334794['error'][_0xa80b('0x10')]);}logger[_0xa80b('0xf')](_0xa80b('0xb'),_0xb3839f,_0x334794[_0xa80b('0xf')][_0xa80b('0x10')]);return _0x503e65(_0x334794[_0xa80b('0xf')]['message']);}else{logger[_0xa80b('0xa')](_0xa80b('0xb'),_0xb3839f,_0xa80b('0xc'));_0x503e65(_0x334794['result']['message']);}})['catch'](function(_0x22e88b){logger[_0xa80b('0xf')](_0xa80b('0xb'),_0xb3839f,_0x22e88b);_0x2870cf(_0x22e88b);});});}exports[_0xa80b('0x11')]=function(_0x34b8c8){var _0x5652a9=this;return new Promise(function(_0x5870ba,_0x4246e5){return db[_0xa80b('0x12')][_0xa80b('0x13')](_0x34b8c8['body'],{'raw':_0x34b8c8[_0xa80b('0x14')]?_0x34b8c8['options'][_0xa80b('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x14ee6c){logger['info'](_0xa80b('0x11'),_0x34b8c8);logger[_0xa80b('0xd')](_0xa80b('0x11'),_0x34b8c8,JSON[_0xa80b('0xe')](_0x14ee6c));_0x5870ba(_0x14ee6c);})[_0xa80b('0x16')](function(_0x26120b){logger['error'](_0xa80b('0x11'),_0x26120b['message'],_0x34b8c8);_0x4246e5(_0x5652a9[_0xa80b('0xf')](0x1f4,_0x26120b[_0xa80b('0x10')]));});});};exports[_0xa80b('0x17')]=function(_0xf33197){var _0x2ad407=this;return new Promise(function(_0x39fd3a,_0x37c6e2){return db[_0xa80b('0x12')][_0xa80b('0x18')](_0xf33197[_0xa80b('0x19')],{'raw':_0xf33197[_0xa80b('0x14')]?_0xf33197[_0xa80b('0x14')][_0xa80b('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf33197[_0xa80b('0x14')]?_0xf33197[_0xa80b('0x14')][_0xa80b('0x1a')]||null:null,'attributes':_0xf33197[_0xa80b('0x14')]?_0xf33197[_0xa80b('0x14')][_0xa80b('0x1b')]||null:null,'limit':_0xf33197[_0xa80b('0x14')]?_0xf33197[_0xa80b('0x14')]['limit']||null:null})[_0xa80b('0x9')](function(_0x2d7a15){logger[_0xa80b('0xa')](_0xa80b('0x17'),_0xf33197);logger[_0xa80b('0xd')]('UpdateSquareReport',_0xf33197,JSON['stringify'](_0x2d7a15));_0x39fd3a(_0x2d7a15);})[_0xa80b('0x16')](function(_0x3e9f98){logger['error'](_0xa80b('0x17'),_0x3e9f98[_0xa80b('0x10')],_0xf33197);_0x37c6e2(_0x2ad407[_0xa80b('0xf')](0x1f4,_0x3e9f98[_0xa80b('0x10')]));});});}; \ No newline at end of file +var _0x4ebf=['SquareReport,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateSquareReport','create','body','options','raw','stringify','UpdateSquareReport','SquareReport','attributes','limit','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x8a4bbc,_0x5d9f54){var _0x2ffac0=function(_0x16d49a){while(--_0x16d49a){_0x8a4bbc['push'](_0x8a4bbc['shift']());}};_0x2ffac0(++_0x5d9f54);}(_0x4ebf,0xd0));var _0xf4eb=function(_0x5ad07c,_0x324dcd){_0x5ad07c=_0x5ad07c-0x0;var _0x204bae=_0x4ebf[_0x5ad07c];return _0x204bae;};'use strict';var _=require(_0xf4eb('0x0'));var util=require(_0xf4eb('0x1'));var moment=require(_0xf4eb('0x2'));var BPromise=require(_0xf4eb('0x3'));var rs=require(_0xf4eb('0x4'));var fs=require('fs');var Redis=require(_0xf4eb('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf4eb('0x6'))(_0xf4eb('0x7'));var config=require('../../config/environment');var jayson=require(_0xf4eb('0x8'));var client=jayson[_0xf4eb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28f1af,_0x5784c0,_0x2cea1a){return new BPromise(function(_0x2a2580,_0x35dc39){return client[_0xf4eb('0xa')](_0x28f1af,_0x2cea1a)[_0xf4eb('0xb')](function(_0x151369){logger[_0xf4eb('0xc')](_0xf4eb('0xd'),_0x5784c0,_0xf4eb('0xe'));logger[_0xf4eb('0xf')](_0xf4eb('0x10'),_0x5784c0,'request\x20sent',JSON['stringify'](_0x151369));if(_0x151369['error']){if(_0x151369[_0xf4eb('0x11')][_0xf4eb('0x12')]===0x1f4){logger['error'](_0xf4eb('0xd'),_0x5784c0,_0x151369[_0xf4eb('0x11')]['message']);return _0x35dc39(_0x151369['error'][_0xf4eb('0x13')]);}logger[_0xf4eb('0x11')](_0xf4eb('0xd'),_0x5784c0,_0x151369[_0xf4eb('0x11')]['message']);return _0x2a2580(_0x151369[_0xf4eb('0x11')][_0xf4eb('0x13')]);}else{logger['info']('SquareReport,\x20%s,\x20%s',_0x5784c0,'request\x20sent');_0x2a2580(_0x151369[_0xf4eb('0x14')][_0xf4eb('0x13')]);}})['catch'](function(_0x1f6458){logger[_0xf4eb('0x11')]('SquareReport,\x20%s,\x20%s',_0x5784c0,_0x1f6458);_0x35dc39(_0x1f6458);});});}exports[_0xf4eb('0x15')]=function(_0x2fea4f){var _0x363788=this;return new Promise(function(_0x2c3931,_0x4ab20d){return db['SquareReport'][_0xf4eb('0x16')](_0x2fea4f[_0xf4eb('0x17')],{'raw':_0x2fea4f[_0xf4eb('0x18')]?_0x2fea4f['options'][_0xf4eb('0x19')]===undefined?!![]:![]:!![]})[_0xf4eb('0xb')](function(_0x4b7151){logger['info']('CreateSquareReport',_0x2fea4f);logger[_0xf4eb('0xf')](_0xf4eb('0x15'),_0x2fea4f,JSON[_0xf4eb('0x1a')](_0x4b7151));_0x2c3931(_0x4b7151);})['catch'](function(_0x540591){logger[_0xf4eb('0x11')](_0xf4eb('0x15'),_0x540591[_0xf4eb('0x13')],_0x2fea4f);_0x4ab20d(_0x363788[_0xf4eb('0x11')](0x1f4,_0x540591[_0xf4eb('0x13')]));});});};exports[_0xf4eb('0x1b')]=function(_0x13a227){var _0x2c7333=this;return new Promise(function(_0x3ec091,_0x2dffaa){return db[_0xf4eb('0x1c')]['update'](_0x13a227[_0xf4eb('0x17')],{'raw':_0x13a227[_0xf4eb('0x18')]?_0x13a227[_0xf4eb('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13a227[_0xf4eb('0x18')]?_0x13a227[_0xf4eb('0x18')]['where']||null:null,'attributes':_0x13a227[_0xf4eb('0x18')]?_0x13a227[_0xf4eb('0x18')][_0xf4eb('0x1d')]||null:null,'limit':_0x13a227['options']?_0x13a227[_0xf4eb('0x18')][_0xf4eb('0x1e')]||null:null})[_0xf4eb('0xb')](function(_0x4b5707){logger[_0xf4eb('0xc')]('UpdateSquareReport',_0x13a227);logger[_0xf4eb('0xf')]('UpdateSquareReport',_0x13a227,JSON[_0xf4eb('0x1a')](_0x4b5707));_0x3ec091(_0x4b5707);})[_0xf4eb('0x1f')](function(_0x52ae96){logger[_0xf4eb('0x11')](_0xf4eb('0x1b'),_0x52ae96[_0xf4eb('0x13')],_0x13a227);_0x2dffaa(_0x2c7333[_0xf4eb('0x11')](0x1f4,_0x52ae96[_0xf4eb('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 78c5f1a..d046ce1 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 _0xfc97=['isAuthenticated','describe','show','post','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get'];(function(_0x4541a0,_0x336a71){var _0x364dc8=function(_0x1032b3){while(--_0x1032b3){_0x4541a0['push'](_0x4541a0['shift']());}};_0x364dc8(++_0x336a71);}(_0xfc97,0xa2));var _0x7fc9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfc97[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x7fc9('0x0'));var util=require('util');var path=require(_0x7fc9('0x1'));var timeout=require(_0x7fc9('0x2'));var express=require(_0x7fc9('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7fc9('0x4'));var interaction=require(_0x7fc9('0x5'));var config=require('../../config/environment');var controller=require(_0x7fc9('0x6'));router[_0x7fc9('0x7')]('/',auth[_0x7fc9('0x8')](),controller['index']);router[_0x7fc9('0x7')]('/describe',auth[_0x7fc9('0x8')](),controller[_0x7fc9('0x9')]);router[_0x7fc9('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x7fc9('0xa')]);router[_0x7fc9('0xb')]('/',auth[_0x7fc9('0x8')](),controller['create']);router[_0x7fc9('0xc')](_0x7fc9('0xd'),auth[_0x7fc9('0x8')](),controller[_0x7fc9('0xe')]);router[_0x7fc9('0xf')](_0x7fc9('0xd'),auth[_0x7fc9('0x8')](),controller[_0x7fc9('0x10')]);module['exports']=router; \ No newline at end of file +var _0xdb09=['show','post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x1f1e68,_0xb9807c){var _0x4ebdd7=function(_0x339a66){while(--_0x339a66){_0x1f1e68['push'](_0x1f1e68['shift']());}};_0x4ebdd7(++_0xb9807c);}(_0xdb09,0x157));var _0x9db0=function(_0x55ff3e,_0x41077f){_0x55ff3e=_0x55ff3e-0x0;var _0x2709eb=_0xdb09[_0x55ff3e];return _0x2709eb;};'use strict';var multer=require('multer');var util=require(_0x9db0('0x0'));var path=require(_0x9db0('0x1'));var timeout=require(_0x9db0('0x2'));var express=require(_0x9db0('0x3'));var router=express[_0x9db0('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9db0('0x5'));var config=require(_0x9db0('0x6'));var controller=require(_0x9db0('0x7'));router[_0x9db0('0x8')]('/',auth['isAuthenticated'](),controller[_0x9db0('0x9')]);router[_0x9db0('0x8')](_0x9db0('0xa'),auth[_0x9db0('0xb')](),controller[_0x9db0('0xc')]);router[_0x9db0('0x8')](_0x9db0('0xd'),auth[_0x9db0('0xb')](),controller[_0x9db0('0xe')]);router[_0x9db0('0xf')]('/',auth['isAuthenticated'](),controller[_0x9db0('0x10')]);router[_0x9db0('0x11')](_0x9db0('0xd'),auth[_0x9db0('0xb')](),controller[_0x9db0('0x12')]);router['delete'](_0x9db0('0xd'),auth[_0x9db0('0xb')](),controller[_0x9db0('0x13')]);module[_0x9db0('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 ae5bff1..297049a 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 _0xc139=['TEXT','STRING'];(function(_0x2823d1,_0x1c6299){var _0x2db1ce=function(_0x4c472f){while(--_0x4c472f){_0x2823d1['push'](_0x2823d1['shift']());}};_0x2db1ce(++_0x1c6299);}(_0xc139,0x10d));var _0x9c13=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc139[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x9c13('0x0')]},'node':{'type':Sequelize[_0x9c13('0x0')]},'application':{'type':Sequelize[_0x9c13('0x0')]},'data':{'type':Sequelize[_0x9c13('0x1')]},'project_name':{'type':Sequelize[_0x9c13('0x0')]},'callerid':{'type':Sequelize[_0x9c13('0x0')]}}; \ No newline at end of file +var _0x16c8=['sequelize','STRING'];(function(_0x41d56b,_0x576329){var _0x8c4a8a=function(_0x5c366d){while(--_0x5c366d){_0x41d56b['push'](_0x41d56b['shift']());}};_0x8c4a8a(++_0x576329);}(_0x16c8,0x150));var _0x816c=function(_0x3b26cd,_0x2afb3f){_0x3b26cd=_0x3b26cd-0x0;var _0x3c98b5=_0x16c8[_0x3b26cd];return _0x3c98b5;};'use strict';var Sequelize=require(_0x816c('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x816c('0x1')]},'node':{'type':Sequelize[_0x816c('0x1')]},'application':{'type':Sequelize[_0x816c('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x816c('0x1')]},'callerid':{'type':Sequelize[_0x816c('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index a794bc0..afa123f 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 _0x8d3c=['querystring','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','offset','limit','count','status','Content-Range','json','reject','save','update','destroy','then','end','error','stack','name','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js'];(function(_0x4cfee3,_0x4c23d3){var _0x678b68=function(_0x4d06e5){while(--_0x4d06e5){_0x4cfee3['push'](_0x4cfee3['shift']());}};_0x678b68(++_0x4c23d3);}(_0x8d3c,0x19a));var _0xc8d3=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x8d3c[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require(_0xc8d3('0x0'));var rimraf=require(_0xc8d3('0x1'));var zipdir=require(_0xc8d3('0x2'));var jsonpatch=require(_0xc8d3('0x3'));var rp=require('request-promise');var moment=require(_0xc8d3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc8d3('0x5'));var util=require(_0xc8d3('0x6'));var path=require(_0xc8d3('0x7'));var sox=require(_0xc8d3('0x8'));var csv=require(_0xc8d3('0x9'));var ejs=require(_0xc8d3('0xa'));var fs=require('fs');var fs_extra=require(_0xc8d3('0xb'));var _=require(_0xc8d3('0xc'));var squel=require(_0xc8d3('0xd'));var crypto=require(_0xc8d3('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc8d3('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc8d3('0x10'));var Papa=require('papaparse');var Redis=require(_0xc8d3('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc8d3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc8d3('0x13'));var utils=require(_0xc8d3('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xc8d3('0x15'));var db=require(_0xc8d3('0x16'))['db'];function respondWithStatusCode(_0x5be299,_0x4cfa4e){_0x4cfa4e=_0x4cfa4e||0xcc;return function(_0x442c2b){if(_0x442c2b){return _0x5be299[_0xc8d3('0x17')](_0x4cfa4e);}return _0x5be299['status'](_0x4cfa4e)['end']();};}function respondWithResult(_0x46bd9e,_0xb38969){_0xb38969=_0xb38969||0xc8;return function(_0x358d3a){if(_0x358d3a){return _0x46bd9e['status'](_0xb38969)['json'](_0x358d3a);}};}function respondWithFilteredResult(_0x4ac8cf,_0x3e6fce){return function(_0x39fdef){if(_0x39fdef){var _0x6f5499=typeof _0x3e6fce[_0xc8d3('0x18')]==='undefined'&&typeof _0x3e6fce[_0xc8d3('0x19')]==='undefined';var _0x2f85e5=_0x39fdef['count'];var _0x294d28=_0x6f5499?0x0:_0x3e6fce[_0xc8d3('0x18')];var _0x3f6bf0=_0x6f5499?_0x39fdef[_0xc8d3('0x1a')]:_0x3e6fce[_0xc8d3('0x18')]+_0x3e6fce[_0xc8d3('0x19')];var _0x50c1c6;if(_0x3f6bf0>=_0x2f85e5){_0x3f6bf0=_0x2f85e5;_0x50c1c6=0xc8;}else{_0x50c1c6=0xce;}_0x4ac8cf[_0xc8d3('0x1b')](_0x50c1c6);return _0x4ac8cf['set'](_0xc8d3('0x1c'),_0x294d28+'-'+_0x3f6bf0+'/'+_0x2f85e5)[_0xc8d3('0x1d')](_0x39fdef);}return null;};}function patchUpdates(_0x4ec67c){return function(_0xd8b6a1){try{jsonpatch['apply'](_0xd8b6a1,_0x4ec67c,!![]);}catch(_0x1c83e1){return BPromise[_0xc8d3('0x1e')](_0x1c83e1);}return _0xd8b6a1[_0xc8d3('0x1f')]();};}function saveUpdates(_0x29643a,_0x16753c){return function(_0x3f8670){if(_0x3f8670){return _0x3f8670[_0xc8d3('0x20')](_0x29643a)['then'](function(_0x2b6ecb){return _0x2b6ecb;});}return null;};}function removeEntity(_0x1de4c9,_0x4d8f46){return function(_0x3f463a){if(_0x3f463a){return _0x3f463a[_0xc8d3('0x21')]()[_0xc8d3('0x22')](function(){_0x1de4c9['status'](0xcc)[_0xc8d3('0x23')]();});}};}function handleEntityNotFound(_0x1d752e,_0x14910e){return function(_0x347686){if(!_0x347686){_0x1d752e[_0xc8d3('0x17')](0x194);}return _0x347686;};}function handleError(_0x44fa92,_0x2c77b8){_0x2c77b8=_0x2c77b8||0x1f4;return function(_0x5a6eb7){logger[_0xc8d3('0x24')](_0x5a6eb7[_0xc8d3('0x25')]);if(_0x5a6eb7[_0xc8d3('0x26')]){delete _0x5a6eb7[_0xc8d3('0x26')];}_0x44fa92['status'](_0x2c77b8)['send'](_0x5a6eb7);};}exports['index']=function(_0x3a2f65,_0x4d2d84){var _0x1805f5={},_0x4da364={},_0x35d037={'count':0x0,'rows':[]};var _0x138872=_[_0xc8d3('0x27')](db[_0xc8d3('0x28')][_0xc8d3('0x29')],function(_0xedb92a){return{'name':_0xedb92a[_0xc8d3('0x2a')],'type':_0xedb92a[_0xc8d3('0x2b')][_0xc8d3('0x2c')]};});_0x4da364[_0xc8d3('0x2d')]=_[_0xc8d3('0x27')](_0x138872,_0xc8d3('0x26'));_0x4da364[_0xc8d3('0x2e')]=_['keys'](_0x3a2f65['query']);_0x4da364[_0xc8d3('0x2f')]=_[_0xc8d3('0x30')](_0x4da364['model'],_0x4da364[_0xc8d3('0x2e')]);_0x1805f5[_0xc8d3('0x31')]=_[_0xc8d3('0x30')](_0x4da364[_0xc8d3('0x2d')],qs[_0xc8d3('0x32')](_0x3a2f65['query'][_0xc8d3('0x32')]));_0x1805f5[_0xc8d3('0x31')]=_0x1805f5['attributes'][_0xc8d3('0x33')]?_0x1805f5[_0xc8d3('0x31')]:_0x4da364[_0xc8d3('0x2d')];if(!_0x3a2f65[_0xc8d3('0x2e')]['hasOwnProperty'](_0xc8d3('0x34'))){_0x1805f5[_0xc8d3('0x19')]=qs[_0xc8d3('0x19')](_0x3a2f65[_0xc8d3('0x2e')]['limit']);_0x1805f5[_0xc8d3('0x18')]=qs[_0xc8d3('0x18')](_0x3a2f65[_0xc8d3('0x2e')][_0xc8d3('0x18')]);}_0x1805f5['order']=qs[_0xc8d3('0x35')](_0x3a2f65[_0xc8d3('0x2e')][_0xc8d3('0x35')]);_0x1805f5[_0xc8d3('0x36')]=qs[_0xc8d3('0x2f')](_[_0xc8d3('0x37')](_0x3a2f65['query'],_0x4da364[_0xc8d3('0x2f')]),_0x138872);if(_0x3a2f65[_0xc8d3('0x2e')][_0xc8d3('0x38')]){_0x1805f5[_0xc8d3('0x36')]=_[_0xc8d3('0x39')](_0x1805f5[_0xc8d3('0x36')],{'$or':_[_0xc8d3('0x27')](_0x138872,function(_0x3d8f30){if(_0x3d8f30[_0xc8d3('0x2b')]!==_0xc8d3('0x3a')){var _0x402a2c={};_0x402a2c[_0x3d8f30[_0xc8d3('0x26')]]={'$like':'%'+_0x3a2f65[_0xc8d3('0x2e')][_0xc8d3('0x38')]+'%'};return _0x402a2c;}})});}_0x1805f5=_[_0xc8d3('0x39')]({},_0x1805f5,_0x3a2f65[_0xc8d3('0x3b')]);var _0x321636={'where':_0x1805f5['where']};return db[_0xc8d3('0x28')][_0xc8d3('0x1a')](_0x321636)[_0xc8d3('0x22')](function(_0x325661){_0x35d037[_0xc8d3('0x1a')]=_0x325661;if(_0x3a2f65[_0xc8d3('0x2e')][_0xc8d3('0x3c')]){_0x1805f5[_0xc8d3('0x3d')]=[{'all':!![]}];}return db[_0xc8d3('0x28')][_0xc8d3('0x3e')](_0x1805f5);})[_0xc8d3('0x22')](function(_0x23d497){_0x35d037['rows']=_0x23d497;return _0x35d037;})[_0xc8d3('0x22')](respondWithFilteredResult(_0x4d2d84,_0x1805f5))[_0xc8d3('0x3f')](handleError(_0x4d2d84,null));};exports[_0xc8d3('0x40')]=function(_0x212f11,_0x54fa39){var _0x309489={'raw':!![],'where':{'id':_0x212f11[_0xc8d3('0x41')]['id']}},_0x4e51bd={};_0x4e51bd[_0xc8d3('0x2d')]=_[_0xc8d3('0x42')](db[_0xc8d3('0x28')]['rawAttributes']);_0x4e51bd['query']=_[_0xc8d3('0x42')](_0x212f11[_0xc8d3('0x2e')]);_0x4e51bd[_0xc8d3('0x2f')]=_[_0xc8d3('0x30')](_0x4e51bd['model'],_0x4e51bd[_0xc8d3('0x2e')]);_0x309489[_0xc8d3('0x31')]=_[_0xc8d3('0x30')](_0x4e51bd[_0xc8d3('0x2d')],qs[_0xc8d3('0x32')](_0x212f11['query']['fields']));_0x309489[_0xc8d3('0x31')]=_0x309489[_0xc8d3('0x31')][_0xc8d3('0x33')]?_0x309489['attributes']:_0x4e51bd[_0xc8d3('0x2d')];if(_0x212f11[_0xc8d3('0x2e')][_0xc8d3('0x3c')]){_0x309489[_0xc8d3('0x3d')]=[{'all':!![]}];}_0x309489=_[_0xc8d3('0x39')]({},_0x309489,_0x212f11['options']);return db[_0xc8d3('0x28')][_0xc8d3('0x43')](_0x309489)['then'](handleEntityNotFound(_0x54fa39,null))['then'](respondWithResult(_0x54fa39,null))[_0xc8d3('0x3f')](handleError(_0x54fa39,null));};exports[_0xc8d3('0x44')]=function(_0x233257,_0x288fa8){return db[_0xc8d3('0x28')][_0xc8d3('0x44')](_0x233257[_0xc8d3('0x45')],{})[_0xc8d3('0x22')](respondWithResult(_0x288fa8,0xc9))[_0xc8d3('0x3f')](handleError(_0x288fa8,null));};exports[_0xc8d3('0x20')]=function(_0x33fbd1,_0x29a3d0){if(_0x33fbd1[_0xc8d3('0x45')]['id']){delete _0x33fbd1['body']['id'];}return db[_0xc8d3('0x28')][_0xc8d3('0x43')]({'where':{'id':_0x33fbd1['params']['id']}})[_0xc8d3('0x22')](handleEntityNotFound(_0x29a3d0,null))['then'](saveUpdates(_0x33fbd1[_0xc8d3('0x45')],null))[_0xc8d3('0x22')](respondWithResult(_0x29a3d0,null))[_0xc8d3('0x3f')](handleError(_0x29a3d0,null));};exports[_0xc8d3('0x21')]=function(_0x405999,_0x48b335){return db['SquareDetailsReport'][_0xc8d3('0x43')]({'where':{'id':_0x405999[_0xc8d3('0x41')]['id']}})['then'](handleEntityNotFound(_0x48b335,null))[_0xc8d3('0x22')](removeEntity(_0x48b335,null))[_0xc8d3('0x3f')](handleError(_0x48b335,null));};exports[_0xc8d3('0x46')]=function(_0x10a47a,_0x5f2c7d){return db['SquareDetailsReport'][_0xc8d3('0x46')]()['then'](respondWithResult(_0x5f2c7d,null))[_0xc8d3('0x3f')](handleError(_0x5f2c7d,null));}; \ No newline at end of file +var _0x32b8=['request-promise','moment','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','apply','update','then','end','error','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','SquareDetailsReport','findAll','rows','show','params','intersection','find','catch','create','body','destroy','describe','rimraf','zip-dir'];(function(_0x2fc113,_0x45ec6e){var _0x5144ce=function(_0x47fd29){while(--_0x47fd29){_0x2fc113['push'](_0x2fc113['shift']());}};_0x5144ce(++_0x45ec6e);}(_0x32b8,0x96));var _0x832b=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x32b8[_0x46e363];return _0x3fb059;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x832b('0x0'));var zipdir=require(_0x832b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x832b('0x2'));var moment=require(_0x832b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x832b('0x4'));var path=require(_0x832b('0x5'));var sox=require(_0x832b('0x6'));var csv=require(_0x832b('0x7'));var ejs=require(_0x832b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x832b('0x9'));var squel=require('squel');var crypto=require(_0x832b('0xa'));var jsforce=require(_0x832b('0xb'));var deskjs=require(_0x832b('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x832b('0xd'));var Redis=require(_0x832b('0xe'));var authService=require(_0x832b('0xf'));var qs=require(_0x832b('0x10'));var as=require(_0x832b('0x11'));var hardwareService=require(_0x832b('0x12'));var logger=require(_0x832b('0x13'))(_0x832b('0x14'));var utils=require(_0x832b('0x15'));var config=require(_0x832b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x832b('0x17'))['db'];function respondWithStatusCode(_0xf7e272,_0x21f38a){_0x21f38a=_0x21f38a||0xcc;return function(_0x1dc71c){if(_0x1dc71c){return _0xf7e272[_0x832b('0x18')](_0x21f38a);}return _0xf7e272[_0x832b('0x19')](_0x21f38a)['end']();};}function respondWithResult(_0x5336d1,_0x2aea62){_0x2aea62=_0x2aea62||0xc8;return function(_0x231be4){if(_0x231be4){return _0x5336d1[_0x832b('0x19')](_0x2aea62)[_0x832b('0x1a')](_0x231be4);}};}function respondWithFilteredResult(_0x3d27de,_0xaa5386){return function(_0x49314c){if(_0x49314c){var _0x1c0307=typeof _0xaa5386['offset']===_0x832b('0x1b')&&typeof _0xaa5386['limit']===_0x832b('0x1b');var _0x5202d6=_0x49314c[_0x832b('0x1c')];var _0x1a5f8e=_0x1c0307?0x0:_0xaa5386[_0x832b('0x1d')];var _0x5e2c24=_0x1c0307?_0x49314c['count']:_0xaa5386[_0x832b('0x1d')]+_0xaa5386[_0x832b('0x1e')];var _0x44fcea;if(_0x5e2c24>=_0x5202d6){_0x5e2c24=_0x5202d6;_0x44fcea=0xc8;}else{_0x44fcea=0xce;}_0x3d27de[_0x832b('0x19')](_0x44fcea);return _0x3d27de[_0x832b('0x1f')]('Content-Range',_0x1a5f8e+'-'+_0x5e2c24+'/'+_0x5202d6)[_0x832b('0x1a')](_0x49314c);}return null;};}function patchUpdates(_0x5b0915){return function(_0x311f89){try{jsonpatch[_0x832b('0x20')](_0x311f89,_0x5b0915,!![]);}catch(_0x338f8e){return BPromise['reject'](_0x338f8e);}return _0x311f89['save']();};}function saveUpdates(_0x33a95f,_0x92efa0){return function(_0x5ed258){if(_0x5ed258){return _0x5ed258[_0x832b('0x21')](_0x33a95f)[_0x832b('0x22')](function(_0x1049ef){return _0x1049ef;});}return null;};}function removeEntity(_0x3e9b45,_0x58fe0c){return function(_0x9e1d3e){if(_0x9e1d3e){return _0x9e1d3e['destroy']()[_0x832b('0x22')](function(){_0x3e9b45[_0x832b('0x19')](0xcc)[_0x832b('0x23')]();});}};}function handleEntityNotFound(_0x3b7d9b,_0x152ded){return function(_0x291d57){if(!_0x291d57){_0x3b7d9b[_0x832b('0x18')](0x194);}return _0x291d57;};}function handleError(_0x1bcb4c,_0x2bcfdd){_0x2bcfdd=_0x2bcfdd||0x1f4;return function(_0x11c4ce){logger[_0x832b('0x24')](_0x11c4ce['stack']);if(_0x11c4ce[_0x832b('0x25')]){delete _0x11c4ce[_0x832b('0x25')];}_0x1bcb4c[_0x832b('0x19')](_0x2bcfdd)[_0x832b('0x26')](_0x11c4ce);};}exports[_0x832b('0x27')]=function(_0x130e39,_0x37108d){var _0x1b8fb9={},_0x426941={},_0x3c2be2={'count':0x0,'rows':[]};var _0x5e2fa2=_['map'](db['SquareDetailsReport'][_0x832b('0x28')],function(_0x503ed5){return{'name':_0x503ed5[_0x832b('0x29')],'type':_0x503ed5[_0x832b('0x2a')][_0x832b('0x2b')]};});_0x426941[_0x832b('0x2c')]=_[_0x832b('0x2d')](_0x5e2fa2,_0x832b('0x25'));_0x426941['query']=_[_0x832b('0x2e')](_0x130e39[_0x832b('0x2f')]);_0x426941['filters']=_['intersection'](_0x426941[_0x832b('0x2c')],_0x426941[_0x832b('0x2f')]);_0x1b8fb9[_0x832b('0x30')]=_['intersection'](_0x426941[_0x832b('0x2c')],qs[_0x832b('0x31')](_0x130e39[_0x832b('0x2f')]['fields']));_0x1b8fb9[_0x832b('0x30')]=_0x1b8fb9[_0x832b('0x30')][_0x832b('0x32')]?_0x1b8fb9['attributes']:_0x426941[_0x832b('0x2c')];if(!_0x130e39[_0x832b('0x2f')][_0x832b('0x33')](_0x832b('0x34'))){_0x1b8fb9['limit']=qs[_0x832b('0x1e')](_0x130e39[_0x832b('0x2f')][_0x832b('0x1e')]);_0x1b8fb9['offset']=qs[_0x832b('0x1d')](_0x130e39[_0x832b('0x2f')][_0x832b('0x1d')]);}_0x1b8fb9[_0x832b('0x35')]=qs[_0x832b('0x36')](_0x130e39[_0x832b('0x2f')][_0x832b('0x36')]);_0x1b8fb9[_0x832b('0x37')]=qs[_0x832b('0x38')](_[_0x832b('0x39')](_0x130e39[_0x832b('0x2f')],_0x426941[_0x832b('0x38')]),_0x5e2fa2);if(_0x130e39['query'][_0x832b('0x3a')]){_0x1b8fb9[_0x832b('0x37')]=_['merge'](_0x1b8fb9[_0x832b('0x37')],{'$or':_[_0x832b('0x2d')](_0x5e2fa2,function(_0x51257d){if(_0x51257d['type']!==_0x832b('0x3b')){var _0x231702={};_0x231702[_0x51257d[_0x832b('0x25')]]={'$like':'%'+_0x130e39[_0x832b('0x2f')][_0x832b('0x3a')]+'%'};return _0x231702;}})});}_0x1b8fb9=_[_0x832b('0x3c')]({},_0x1b8fb9,_0x130e39[_0x832b('0x3d')]);var _0x2dbc52={'where':_0x1b8fb9[_0x832b('0x37')]};return db['SquareDetailsReport'][_0x832b('0x1c')](_0x2dbc52)[_0x832b('0x22')](function(_0x3759ac){_0x3c2be2[_0x832b('0x1c')]=_0x3759ac;if(_0x130e39[_0x832b('0x2f')][_0x832b('0x3e')]){_0x1b8fb9[_0x832b('0x3f')]=[{'all':!![]}];}return db[_0x832b('0x40')][_0x832b('0x41')](_0x1b8fb9);})['then'](function(_0x426a6d){_0x3c2be2[_0x832b('0x42')]=_0x426a6d;return _0x3c2be2;})['then'](respondWithFilteredResult(_0x37108d,_0x1b8fb9))['catch'](handleError(_0x37108d,null));};exports[_0x832b('0x43')]=function(_0x372024,_0x42778b){var _0x30afaa={'raw':!![],'where':{'id':_0x372024[_0x832b('0x44')]['id']}},_0x5913e2={};_0x5913e2[_0x832b('0x2c')]=_['keys'](db[_0x832b('0x40')][_0x832b('0x28')]);_0x5913e2[_0x832b('0x2f')]=_['keys'](_0x372024[_0x832b('0x2f')]);_0x5913e2[_0x832b('0x38')]=_[_0x832b('0x45')](_0x5913e2[_0x832b('0x2c')],_0x5913e2[_0x832b('0x2f')]);_0x30afaa[_0x832b('0x30')]=_[_0x832b('0x45')](_0x5913e2[_0x832b('0x2c')],qs['fields'](_0x372024[_0x832b('0x2f')]['fields']));_0x30afaa[_0x832b('0x30')]=_0x30afaa[_0x832b('0x30')][_0x832b('0x32')]?_0x30afaa[_0x832b('0x30')]:_0x5913e2['model'];if(_0x372024['query'][_0x832b('0x3e')]){_0x30afaa[_0x832b('0x3f')]=[{'all':!![]}];}_0x30afaa=_[_0x832b('0x3c')]({},_0x30afaa,_0x372024[_0x832b('0x3d')]);return db[_0x832b('0x40')][_0x832b('0x46')](_0x30afaa)[_0x832b('0x22')](handleEntityNotFound(_0x42778b,null))['then'](respondWithResult(_0x42778b,null))[_0x832b('0x47')](handleError(_0x42778b,null));};exports[_0x832b('0x48')]=function(_0x5805e1,_0x471d2c){return db[_0x832b('0x40')]['create'](_0x5805e1[_0x832b('0x49')],{})[_0x832b('0x22')](respondWithResult(_0x471d2c,0xc9))[_0x832b('0x47')](handleError(_0x471d2c,null));};exports['update']=function(_0xce88d3,_0x280cc5){if(_0xce88d3[_0x832b('0x49')]['id']){delete _0xce88d3[_0x832b('0x49')]['id'];}return db[_0x832b('0x40')][_0x832b('0x46')]({'where':{'id':_0xce88d3[_0x832b('0x44')]['id']}})['then'](handleEntityNotFound(_0x280cc5,null))[_0x832b('0x22')](saveUpdates(_0xce88d3['body'],null))['then'](respondWithResult(_0x280cc5,null))[_0x832b('0x47')](handleError(_0x280cc5,null));};exports[_0x832b('0x4a')]=function(_0x1444f7,_0x37c111){return db[_0x832b('0x40')][_0x832b('0x46')]({'where':{'id':_0x1444f7[_0x832b('0x44')]['id']}})[_0x832b('0x22')](handleEntityNotFound(_0x37c111,null))[_0x832b('0x22')](removeEntity(_0x37c111,null))['catch'](handleError(_0x37c111,null));};exports[_0x832b('0x4b')]=function(_0x3d782e,_0x5b9dd7){return db[_0x832b('0x40')][_0x832b('0x4b')]()[_0x832b('0x22')](respondWithResult(_0x5b9dd7,null))['catch'](handleError(_0x5b9dd7,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 2576724..470866c 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 _0x171c=['SquareDetailsReport','report_square_details','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x326d48,_0x42c9ff){var _0x1b6224=function(_0x2dd54d){while(--_0x2dd54d){_0x326d48['push'](_0x326d48['shift']());}};_0x1b6224(++_0x42c9ff);}(_0x171c,0x1be));var _0xc171=function(_0x4e3475,_0x406a24){_0x4e3475=_0x4e3475-0x0;var _0x3aebc6=_0x171c[_0x4e3475];return _0x3aebc6;};'use strict';var _=require(_0xc171('0x0'));var util=require('util');var logger=require(_0xc171('0x1'))(_0xc171('0x2'));var moment=require(_0xc171('0x3'));var BPromise=require(_0xc171('0x4'));var rp=require(_0xc171('0x5'));var fs=require('fs');var path=require(_0xc171('0x6'));var rimraf=require(_0xc171('0x7'));var config=require(_0xc171('0x8'));var attributes=require('./squareReportDetail.attributes');module[_0xc171('0x9')]=function(_0x53af15,_0x28bb7d){return _0x53af15['define'](_0xc171('0xa'),attributes,{'tableName':_0xc171('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5881=['report_square_details','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','define','SquareDetailsReport'];(function(_0x27f09e,_0x35d4ae){var _0x242523=function(_0x4852a9){while(--_0x4852a9){_0x27f09e['push'](_0x27f09e['shift']());}};_0x242523(++_0x35d4ae);}(_0x5881,0x109));var _0x1588=function(_0x1f0b78,_0x22c6f8){_0x1f0b78=_0x1f0b78-0x0;var _0x59e1a1=_0x5881[_0x1f0b78];return _0x59e1a1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1588('0x0'))('api');var moment=require(_0x1588('0x1'));var BPromise=require(_0x1588('0x2'));var rp=require(_0x1588('0x3'));var fs=require('fs');var path=require(_0x1588('0x4'));var rimraf=require(_0x1588('0x5'));var config=require(_0x1588('0x6'));var attributes=require(_0x1588('0x7'));module['exports']=function(_0x464c26,_0x1bd1a3){return _0x464c26[_0x1588('0x8')](_0x1588('0x9'),attributes,{'tableName':_0x1588('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 72223bb..863b182 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 _0x9ccd=['SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateSquareDetailsReport','create','body','options','raw','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x4788c6,_0x395539){var _0x6a33a1=function(_0x5462a4){while(--_0x5462a4){_0x4788c6['push'](_0x4788c6['shift']());}};_0x6a33a1(++_0x395539);}(_0x9ccd,0x1a3));var _0xd9cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ccd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd9cc('0x0'));var util=require('util');var moment=require(_0xd9cc('0x1'));var BPromise=require(_0xd9cc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd9cc('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd9cc('0x4'))(_0xd9cc('0x5'));var config=require(_0xd9cc('0x6'));var jayson=require(_0xd9cc('0x7'));var client=jayson[_0xd9cc('0x8')][_0xd9cc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f7b2b,_0x23b70a,_0x9e1e10){return new BPromise(function(_0x1a1bd1,_0x20282c){return client[_0xd9cc('0xa')](_0x1f7b2b,_0x9e1e10)[_0xd9cc('0xb')](function(_0x1737e5){logger[_0xd9cc('0xc')](_0xd9cc('0xd'),_0x23b70a,'request\x20sent');logger[_0xd9cc('0xe')](_0xd9cc('0xf'),_0x23b70a,_0xd9cc('0x10'),JSON[_0xd9cc('0x11')](_0x1737e5));if(_0x1737e5[_0xd9cc('0x12')]){if(_0x1737e5[_0xd9cc('0x12')][_0xd9cc('0x13')]===0x1f4){logger[_0xd9cc('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x23b70a,_0x1737e5[_0xd9cc('0x12')]['message']);return _0x20282c(_0x1737e5['error']['message']);}logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x23b70a,_0x1737e5[_0xd9cc('0x12')][_0xd9cc('0x14')]);return _0x1a1bd1(_0x1737e5[_0xd9cc('0x12')][_0xd9cc('0x14')]);}else{logger[_0xd9cc('0xc')](_0xd9cc('0xd'),_0x23b70a,_0xd9cc('0x10'));_0x1a1bd1(_0x1737e5['result'][_0xd9cc('0x14')]);}})[_0xd9cc('0x15')](function(_0x513635){logger[_0xd9cc('0x12')](_0xd9cc('0xd'),_0x23b70a,_0x513635);_0x20282c(_0x513635);});});}exports[_0xd9cc('0x16')]=function(_0x2e2baa){var _0x5a4b50=this;return new Promise(function(_0x37b745,_0x32df89){return db['SquareDetailsReport'][_0xd9cc('0x17')](_0x2e2baa[_0xd9cc('0x18')],{'raw':_0x2e2baa[_0xd9cc('0x19')]?_0x2e2baa[_0xd9cc('0x19')][_0xd9cc('0x1a')]===undefined?!![]:![]:!![]})[_0xd9cc('0xb')](function(_0x59f00d){logger['info'](_0xd9cc('0x16'),_0x2e2baa);logger[_0xd9cc('0xe')](_0xd9cc('0x16'),_0x2e2baa,JSON[_0xd9cc('0x11')](_0x59f00d));_0x37b745(_0x59f00d);})[_0xd9cc('0x15')](function(_0x426a5c){logger[_0xd9cc('0x12')](_0xd9cc('0x16'),_0x426a5c[_0xd9cc('0x14')],_0x2e2baa);_0x32df89(_0x5a4b50[_0xd9cc('0x12')](0x1f4,_0x426a5c[_0xd9cc('0x14')]));});});}; \ No newline at end of file +var _0x8d05=['lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','stringify','catch'];(function(_0x314b78,_0x158ccf){var _0xc35bff=function(_0xd3b6b){while(--_0xd3b6b){_0x314b78['push'](_0x314b78['shift']());}};_0xc35bff(++_0x158ccf);}(_0x8d05,0xe8));var _0x58d0=function(_0x18e26e,_0x5d277b){_0x18e26e=_0x18e26e-0x0;var _0x2dc649=_0x8d05[_0x18e26e];return _0x2dc649;};'use strict';var _=require(_0x58d0('0x0'));var util=require(_0x58d0('0x1'));var moment=require(_0x58d0('0x2'));var BPromise=require(_0x58d0('0x3'));var rs=require(_0x58d0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x58d0('0x5'));var logger=require(_0x58d0('0x6'))(_0x58d0('0x7'));var config=require(_0x58d0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x58d0('0x9')][_0x58d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x528303,_0x66aef1,_0x4e44e2){return new BPromise(function(_0xe744f4,_0x34ab60){return client[_0x58d0('0xb')](_0x528303,_0x4e44e2)[_0x58d0('0xc')](function(_0x1d070a){logger['info'](_0x58d0('0xd'),_0x66aef1,_0x58d0('0xe'));logger['debug'](_0x58d0('0xf'),_0x66aef1,_0x58d0('0xe'),JSON['stringify'](_0x1d070a));if(_0x1d070a['error']){if(_0x1d070a[_0x58d0('0x10')][_0x58d0('0x11')]===0x1f4){logger[_0x58d0('0x10')](_0x58d0('0xd'),_0x66aef1,_0x1d070a[_0x58d0('0x10')][_0x58d0('0x12')]);return _0x34ab60(_0x1d070a[_0x58d0('0x10')][_0x58d0('0x12')]);}logger[_0x58d0('0x10')](_0x58d0('0xd'),_0x66aef1,_0x1d070a[_0x58d0('0x10')][_0x58d0('0x12')]);return _0xe744f4(_0x1d070a[_0x58d0('0x10')][_0x58d0('0x12')]);}else{logger[_0x58d0('0x13')](_0x58d0('0xd'),_0x66aef1,_0x58d0('0xe'));_0xe744f4(_0x1d070a[_0x58d0('0x14')][_0x58d0('0x12')]);}})['catch'](function(_0x10874e){logger[_0x58d0('0x10')](_0x58d0('0xd'),_0x66aef1,_0x10874e);_0x34ab60(_0x10874e);});});}exports[_0x58d0('0x15')]=function(_0xb8dd5f){var _0x2c7db6=this;return new Promise(function(_0x23dcfb,_0x41d221){return db[_0x58d0('0x16')][_0x58d0('0x17')](_0xb8dd5f[_0x58d0('0x18')],{'raw':_0xb8dd5f[_0x58d0('0x19')]?_0xb8dd5f[_0x58d0('0x19')][_0x58d0('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x3072f9){logger[_0x58d0('0x13')](_0x58d0('0x15'),_0xb8dd5f);logger['debug'](_0x58d0('0x15'),_0xb8dd5f,JSON[_0x58d0('0x1b')](_0x3072f9));_0x23dcfb(_0x3072f9);})[_0x58d0('0x1c')](function(_0x575b34){logger[_0x58d0('0x10')]('CreateSquareDetailsReport',_0x575b34['message'],_0xb8dd5f);_0x41d221(_0x2c7db6[_0x58d0('0x10')](0x1f4,_0x575b34[_0x58d0('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 2afadf3..63c27aa 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 _0x7925=['Router','../../components/auth/service','get','isAuthenticated','index','/process/:pid/kill','killProcess','exports','express'];(function(_0x59ebc4,_0x5e14bd){var _0x2ffd57=function(_0x12483f){while(--_0x12483f){_0x59ebc4['push'](_0x59ebc4['shift']());}};_0x2ffd57(++_0x5e14bd);}(_0x7925,0x1d3));var _0x5792=function(_0x6ccef6,_0x1e86da){_0x6ccef6=_0x6ccef6-0x0;var _0x137ffb=_0x7925[_0x6ccef6];return _0x137ffb;};'use strict';var express=require(_0x5792('0x0'));var router=express[_0x5792('0x1')]();var auth=require(_0x5792('0x2'));var controller=require('./system.controller');router[_0x5792('0x3')]('/',auth[_0x5792('0x4')](),controller[_0x5792('0x5')]);router[_0x5792('0x3')](_0x5792('0x6'),auth[_0x5792('0x4')](),controller[_0x5792('0x7')]);module[_0x5792('0x8')]=router; \ No newline at end of file +var _0x158b=['index','get','/process/:pid/kill','killProcess','exports','express','../../components/auth/service','./system.controller','isAuthenticated'];(function(_0x8731fb,_0x5ee538){var _0x5c2a87=function(_0x308c37){while(--_0x308c37){_0x8731fb['push'](_0x8731fb['shift']());}};_0x5c2a87(++_0x5ee538);}(_0x158b,0x1d0));var _0xb158=function(_0x55471e,_0x135801){_0x55471e=_0x55471e-0x0;var _0x2244de=_0x158b[_0x55471e];return _0x2244de;};'use strict';var express=require(_0xb158('0x0'));var router=express['Router']();var auth=require(_0xb158('0x1'));var controller=require(_0xb158('0x2'));router['get']('/',auth[_0xb158('0x3')](),controller[_0xb158('0x4')]);router[_0xb158('0x5')](_0xb158('0x6'),auth[_0xb158('0x3')](),controller[_0xb158('0x7')]);module[_0xb158('0x8')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 3ccbb1f..194eab1 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 _0xf4bb=['ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','length','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','getAllData','then','json','catch','killProcess','components/import/cm'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xf4bb,0x72));var _0xbf4b=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0xf4bb[_0x1eda20];return _0x31b953;};'use strict';var info=require('systeminformation');var exec=require(_0xbf4b('0x0'))['exec'];var logger=require('../../config/logger')('api');var util=require(_0xbf4b('0x1'));var BPromise=require(_0xbf4b('0x2'));var _=require(_0xbf4b('0x3'));function handleError(_0x1aff07,_0x54f2e8,_0x76f7d9){_0x54f2e8=_0x54f2e8||0x1f4;return function(_0x44f7c8){logger[_0xbf4b('0x4')](_0xbf4b('0x5'),_0x76f7d9,_0x54f2e8,util[_0xbf4b('0x6')](_0x44f7c8,{'showHidden':![],'depth':null}));delete _0x44f7c8[_0xbf4b('0x7')];_0x1aff07[_0xbf4b('0x8')](_0x54f2e8)[_0xbf4b('0x9')](_0x44f7c8);};}exports['index']=function(_0x2b2f8a,_0x453e6a){return info[_0xbf4b('0xa')]()[_0xbf4b('0xb')](function(_0x9d3701){return _0x453e6a['status'](0xc8)[_0xbf4b('0xc')](_0x9d3701);})[_0xbf4b('0xd')](function(_0x41900d){return _0x453e6a[_0xbf4b('0x8')](0x1f4)[_0xbf4b('0xc')](_0x41900d);});};exports[_0xbf4b('0xe')]=function(_0x14283a,_0x531069){var _0x45c8d4=[_0xbf4b('0xf')];return new BPromise(function(_0x3c2f1d,_0x5612e2){return exec(util['format'](_0xbf4b('0x10'),_0x14283a[_0xbf4b('0x11')][_0xbf4b('0x12')]),function(_0x2a0e63,_0x413c9b,_0x5f105a){if(_0x2a0e63){return _0x5612e2(_0x2a0e63);}return _0x3c2f1d(_0x413c9b);});})[_0xbf4b('0xb')](function(_0x132d5b){var _0x338525=![];var _0x5cc3d4=_0x132d5b['split'](/\n/);for(var _0x479794=0x0,_0x5229a3=_0x45c8d4[_0xbf4b('0x13')];_0x479794<_0x5229a3,_0x338525===![];_0x479794+=0x1){if(_0x132d5b[_0xbf4b('0x14')](_0x45c8d4[_0x479794])>=0x0){_0x338525=!![];}}if(!_0x338525){throw new Error(util[_0xbf4b('0x15')](_0xbf4b('0x16'),_0x14283a['params']['pid']));}process[_0xbf4b('0x17')](_0x14283a[_0xbf4b('0x11')][_0xbf4b('0x12')],_0xbf4b('0x18'));return _0x531069[_0xbf4b('0x8')](0xc8)['json']({'message':util['format'](_0xbf4b('0x19'),_0x14283a['params']['pid'])});})[_0xbf4b('0xd')](handleError(_0x531069,null,_0xbf4b('0xe')));}; \ No newline at end of file +var _0x68dc=['catch','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','send','index','getAllData','then'];(function(_0x4e1765,_0x47a36c){var _0x11e5cc=function(_0xcecd90){while(--_0xcecd90){_0x4e1765['push'](_0x4e1765['shift']());}};_0x11e5cc(++_0x47a36c);}(_0x68dc,0x185));var _0xc68d=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x68dc[_0x1caf6a];return _0x1bf493;};'use strict';var info=require('systeminformation');var exec=require(_0xc68d('0x0'))['exec'];var logger=require('../../config/logger')('api');var util=require('util');var BPromise=require(_0xc68d('0x1'));var _=require(_0xc68d('0x2'));function handleError(_0x351dbc,_0x58801a,_0x595b05){_0x58801a=_0x58801a||0x1f4;return function(_0x10b6b7){logger[_0xc68d('0x3')](_0xc68d('0x4'),_0x595b05,_0x58801a,util['inspect'](_0x10b6b7,{'showHidden':![],'depth':null}));delete _0x10b6b7[_0xc68d('0x5')];_0x351dbc[_0xc68d('0x6')](_0x58801a)[_0xc68d('0x7')](_0x10b6b7);};}exports[_0xc68d('0x8')]=function(_0x153df6,_0x7f7fdb){return info[_0xc68d('0x9')]()[_0xc68d('0xa')](function(_0x2f729e){return _0x7f7fdb[_0xc68d('0x6')](0xc8)['json'](_0x2f729e);})[_0xc68d('0xb')](function(_0x13c9ea){return _0x7f7fdb[_0xc68d('0x6')](0x1f4)[_0xc68d('0xc')](_0x13c9ea);});};exports[_0xc68d('0xd')]=function(_0x332178,_0xe478a9){var _0x3efe31=[_0xc68d('0xe')];return new BPromise(function(_0x303ba4,_0x57d59b){return exec(util[_0xc68d('0xf')](_0xc68d('0x10'),_0x332178[_0xc68d('0x11')][_0xc68d('0x12')]),function(_0x444eb1,_0x33236a,_0x3bb8ea){if(_0x444eb1){return _0x57d59b(_0x444eb1);}return _0x303ba4(_0x33236a);});})[_0xc68d('0xa')](function(_0x52fbf4){var _0xd484a1=![];var _0x2ca0cc=_0x52fbf4['split'](/\n/);for(var _0x74ff0b=0x0,_0x433475=_0x3efe31[_0xc68d('0x13')];_0x74ff0b<_0x433475,_0xd484a1===![];_0x74ff0b+=0x1){if(_0x52fbf4[_0xc68d('0x14')](_0x3efe31[_0x74ff0b])>=0x0){_0xd484a1=!![];}}if(!_0xd484a1){throw new Error(util[_0xc68d('0xf')](_0xc68d('0x15'),_0x332178[_0xc68d('0x11')][_0xc68d('0x12')]));}process[_0xc68d('0x16')](_0x332178[_0xc68d('0x11')][_0xc68d('0x12')],_0xc68d('0x17'));return _0xe478a9[_0xc68d('0x6')](0xc8)[_0xc68d('0xc')]({'message':util['format'](_0xc68d('0x18'),_0x332178[_0xc68d('0x11')][_0xc68d('0x12')])});})[_0xc68d('0xb')](handleError(_0xe478a9,null,_0xc68d('0xd')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 9f1ab3e..287f188 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 _0x75af=['./tag.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4480a6,_0x8cd58e){var _0x162965=function(_0x217849){while(--_0x217849){_0x4480a6['push'](_0x4480a6['shift']());}};_0x162965(++_0x8cd58e);}(_0x75af,0x17d));var _0xf75a=function(_0x4d3484,_0x2e1f67){_0x4d3484=_0x4d3484-0x0;var _0xe8c158=_0x75af[_0x4d3484];return _0xe8c158;};'use strict';var multer=require(_0xf75a('0x0'));var util=require(_0xf75a('0x1'));var path=require(_0xf75a('0x2'));var timeout=require(_0xf75a('0x3'));var express=require(_0xf75a('0x4'));var router=express[_0xf75a('0x5')]();var fs_extra=require(_0xf75a('0x6'));var auth=require(_0xf75a('0x7'));var interaction=require(_0xf75a('0x8'));var config=require(_0xf75a('0x9'));var controller=require(_0xf75a('0xa'));router[_0xf75a('0xb')]('/',auth[_0xf75a('0xc')](),controller[_0xf75a('0xd')]);router[_0xf75a('0xb')](_0xf75a('0xe'),auth[_0xf75a('0xc')](),controller[_0xf75a('0xf')]);router[_0xf75a('0x10')]('/',auth[_0xf75a('0xc')](),controller[_0xf75a('0x11')]);router[_0xf75a('0x12')]('/:id',auth[_0xf75a('0xc')](),controller[_0xf75a('0x13')]);router[_0xf75a('0x14')](_0xf75a('0xe'),auth['isAuthenticated'](),controller[_0xf75a('0x15')]);module[_0xf75a('0x16')]=router; \ No newline at end of file +var _0xc217=['show','create','put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index'];(function(_0xf38492,_0x45d84e){var _0x3e66e3=function(_0xf16ba){while(--_0xf16ba){_0xf38492['push'](_0xf38492['shift']());}};_0x3e66e3(++_0x45d84e);}(_0xc217,0x15d));var _0x7c21=function(_0x29e3b6,_0x40b0b4){_0x29e3b6=_0x29e3b6-0x0;var _0x55d4b0=_0xc217[_0x29e3b6];return _0x55d4b0;};'use strict';var multer=require(_0x7c21('0x0'));var util=require('util');var path=require(_0x7c21('0x1'));var timeout=require(_0x7c21('0x2'));var express=require(_0x7c21('0x3'));var router=express[_0x7c21('0x4')]();var fs_extra=require(_0x7c21('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7c21('0x6'));var config=require(_0x7c21('0x7'));var controller=require(_0x7c21('0x8'));router[_0x7c21('0x9')]('/',auth[_0x7c21('0xa')](),controller[_0x7c21('0xb')]);router[_0x7c21('0x9')]('/:id',auth[_0x7c21('0xa')](),controller[_0x7c21('0xc')]);router['post']('/',auth[_0x7c21('0xa')](),controller[_0x7c21('0xd')]);router[_0x7c21('0xe')](_0x7c21('0xf'),auth[_0x7c21('0xa')](),controller[_0x7c21('0x10')]);router[_0x7c21('0x11')]('/:id',auth[_0x7c21('0xa')](),controller['destroy']);module[_0x7c21('0x12')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 1da2208..554b061 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 _0x8eba=['exports','#0091EA','STRING','sequelize'];(function(_0x51ddbc,_0x55dffe){var _0x217d8c=function(_0x4f8f83){while(--_0x4f8f83){_0x51ddbc['push'](_0x51ddbc['shift']());}};_0x217d8c(++_0x55dffe);}(_0x8eba,0xc3));var _0xa8eb=function(_0x36bf88,_0x15c459){_0x36bf88=_0x36bf88-0x0;var _0x332914=_0x8eba[_0x36bf88];return _0x332914;};'use strict';var Sequelize=require(_0xa8eb('0x0'));module[_0xa8eb('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0xa8eb('0x2')},'description':{'type':Sequelize[_0xa8eb('0x3')]}}; \ No newline at end of file +var _0x57f8=['exports','STRING','name','#0091EA'];(function(_0x3c49b2,_0x285e48){var _0x2d9203=function(_0x486d6f){while(--_0x486d6f){_0x3c49b2['push'](_0x3c49b2['shift']());}};_0x2d9203(++_0x285e48);}(_0x57f8,0x198));var _0x857f=function(_0x147686,_0x292c6a){_0x147686=_0x147686-0x0;var _0x4db1b8=_0x57f8[_0x147686];return _0x4db1b8;};'use strict';var Sequelize=require('sequelize');module[_0x857f('0x0')]={'name':{'type':Sequelize[_0x857f('0x1')],'unique':_0x857f('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x857f('0x1')],'defaultValue':_0x857f('0x3')},'description':{'type':Sequelize[_0x857f('0x1')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index a6e2da7..645f483 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 _0xbe02=['zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','Tags','UserProfileResource','destroy','error','stack','name','index','map','Tag','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filter','merge','VIRTUAL','options','where','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf'];(function(_0x5cc8b9,_0x20e3c3){var _0x58892e=function(_0x87457a){while(--_0x87457a){_0x5cc8b9['push'](_0x5cc8b9['shift']());}};_0x58892e(++_0x20e3c3);}(_0xbe02,0x146));var _0x2be0=function(_0x4128a3,_0x4d09da){_0x4128a3=_0x4128a3-0x0;var _0x2cdb25=_0xbe02[_0x4128a3];return _0x2cdb25;};'use strict';var emlformat=require(_0x2be0('0x0'));var rimraf=require(_0x2be0('0x1'));var zipdir=require(_0x2be0('0x2'));var jsonpatch=require(_0x2be0('0x3'));var rp=require('request-promise');var moment=require(_0x2be0('0x4'));var BPromise=require(_0x2be0('0x5'));var Mustache=require(_0x2be0('0x6'));var util=require(_0x2be0('0x7'));var path=require(_0x2be0('0x8'));var sox=require(_0x2be0('0x9'));var csv=require(_0x2be0('0xa'));var ejs=require(_0x2be0('0xb'));var fs=require('fs');var fs_extra=require(_0x2be0('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2be0('0xd'));var jsforce=require(_0x2be0('0xe'));var deskjs=require(_0x2be0('0xf'));var toCsv=require(_0x2be0('0xa'));var querystring=require(_0x2be0('0x10'));var Papa=require(_0x2be0('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2be0('0x12'));var utils=require(_0x2be0('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2be0('0x14'));var db=require(_0x2be0('0x15'))['db'];function respondWithStatusCode(_0x204a1f,_0x258b54){_0x258b54=_0x258b54||0xcc;return function(_0x470739){if(_0x470739){return _0x204a1f[_0x2be0('0x16')](_0x258b54);}return _0x204a1f[_0x2be0('0x17')](_0x258b54)[_0x2be0('0x18')]();};}function respondWithResult(_0x135d01,_0x271f25){_0x271f25=_0x271f25||0xc8;return function(_0x54e9f2){if(_0x54e9f2){return _0x135d01[_0x2be0('0x17')](_0x271f25)[_0x2be0('0x19')](_0x54e9f2);}};}function respondWithFilteredResult(_0x5cda7b,_0x8bdce0){return function(_0x1e0c27){if(_0x1e0c27){var _0x5bcbc5=typeof _0x8bdce0[_0x2be0('0x1a')]===_0x2be0('0x1b')&&typeof _0x8bdce0[_0x2be0('0x1c')]===_0x2be0('0x1b');var _0x1d4e04=_0x1e0c27[_0x2be0('0x1d')];var _0x48d386=_0x5bcbc5?0x0:_0x8bdce0[_0x2be0('0x1a')];var _0x3f8dba=_0x5bcbc5?_0x1e0c27[_0x2be0('0x1d')]:_0x8bdce0[_0x2be0('0x1a')]+_0x8bdce0[_0x2be0('0x1c')];var _0x361f25;if(_0x3f8dba>=_0x1d4e04){_0x3f8dba=_0x1d4e04;_0x361f25=0xc8;}else{_0x361f25=0xce;}_0x5cda7b[_0x2be0('0x17')](_0x361f25);return _0x5cda7b[_0x2be0('0x1e')](_0x2be0('0x1f'),_0x48d386+'-'+_0x3f8dba+'/'+_0x1d4e04)[_0x2be0('0x19')](_0x1e0c27);}return null;};}function patchUpdates(_0x4c8afc){return function(_0x51ddee){try{jsonpatch[_0x2be0('0x20')](_0x51ddee,_0x4c8afc,!![]);}catch(_0x53445b){return BPromise['reject'](_0x53445b);}return _0x51ddee[_0x2be0('0x21')]();};}function saveUpdates(_0x4d2c62,_0x2da0d5){return function(_0x2b3f88){if(_0x2b3f88){return _0x2b3f88[_0x2be0('0x22')](_0x4d2c62)[_0x2be0('0x23')](function(_0x105fa6){return _0x105fa6;});}return null;};}function removeEntity(_0x72018a,_0x494fb4){return function(_0x2f44f7){if(_0x2f44f7){return _0x2f44f7['destroy']()['then'](function(){var _0x2fd80f=_0x2f44f7[_0x2be0('0x24')]({'plain':!![]});var _0x166aa1=_0x2be0('0x25');return db[_0x2be0('0x26')][_0x2be0('0x27')]({'where':{'type':_0x166aa1,'resourceId':_0x2fd80f['id']}})[_0x2be0('0x23')](function(){return _0x2f44f7;});})['then'](function(){_0x72018a[_0x2be0('0x17')](0xcc)[_0x2be0('0x18')]();});}};}function handleEntityNotFound(_0x559a66,_0x5260d3){return function(_0x1fd3eb){if(!_0x1fd3eb){_0x559a66[_0x2be0('0x16')](0x194);}return _0x1fd3eb;};}function handleError(_0x4bdf61,_0xe42dd0){_0xe42dd0=_0xe42dd0||0x1f4;return function(_0x36b490){logger[_0x2be0('0x28')](_0x36b490[_0x2be0('0x29')]);if(_0x36b490[_0x2be0('0x2a')]){delete _0x36b490[_0x2be0('0x2a')];}_0x4bdf61[_0x2be0('0x17')](_0xe42dd0)['send'](_0x36b490);};}exports[_0x2be0('0x2b')]=function(_0x4d2ad6,_0x11abcf){var _0xa88b4f={},_0x120b62={},_0x493b7c={'count':0x0,'rows':[]};var _0x452417=_[_0x2be0('0x2c')](db[_0x2be0('0x2d')]['rawAttributes'],function(_0x121e5b){return{'name':_0x121e5b[_0x2be0('0x2e')],'type':_0x121e5b[_0x2be0('0x2f')][_0x2be0('0x30')]};});_0x120b62[_0x2be0('0x31')]=_['map'](_0x452417,_0x2be0('0x2a'));_0x120b62[_0x2be0('0x32')]=_[_0x2be0('0x33')](_0x4d2ad6[_0x2be0('0x32')]);_0x120b62[_0x2be0('0x34')]=_['intersection'](_0x120b62['model'],_0x120b62[_0x2be0('0x32')]);_0xa88b4f[_0x2be0('0x35')]=_[_0x2be0('0x36')](_0x120b62['model'],qs['fields'](_0x4d2ad6['query'][_0x2be0('0x37')]));_0xa88b4f[_0x2be0('0x35')]=_0xa88b4f[_0x2be0('0x35')][_0x2be0('0x38')]?_0xa88b4f[_0x2be0('0x35')]:_0x120b62[_0x2be0('0x31')];if(!_0x4d2ad6[_0x2be0('0x32')][_0x2be0('0x39')](_0x2be0('0x3a'))){_0xa88b4f[_0x2be0('0x1c')]=qs[_0x2be0('0x1c')](_0x4d2ad6['query'][_0x2be0('0x1c')]);_0xa88b4f[_0x2be0('0x1a')]=qs[_0x2be0('0x1a')](_0x4d2ad6[_0x2be0('0x32')][_0x2be0('0x1a')]);}_0xa88b4f['order']=qs[_0x2be0('0x3b')](_0x4d2ad6[_0x2be0('0x32')][_0x2be0('0x3b')]);_0xa88b4f['where']=qs[_0x2be0('0x34')](_['pick'](_0x4d2ad6[_0x2be0('0x32')],_0x120b62['filters']),_0x452417);if(_0x4d2ad6['query'][_0x2be0('0x3c')]){_0xa88b4f['where']=_[_0x2be0('0x3d')](_0xa88b4f['where'],{'$or':_[_0x2be0('0x2c')](_0x452417,function(_0x4f1094){if(_0x4f1094[_0x2be0('0x2f')]!==_0x2be0('0x3e')){var _0xa4d6f0={};_0xa4d6f0[_0x4f1094['name']]={'$like':'%'+_0x4d2ad6[_0x2be0('0x32')]['filter']+'%'};return _0xa4d6f0;}})});}_0xa88b4f=_[_0x2be0('0x3d')]({},_0xa88b4f,_0x4d2ad6[_0x2be0('0x3f')]);var _0x21683a={'where':_0xa88b4f[_0x2be0('0x40')]};return db[_0x2be0('0x2d')][_0x2be0('0x1d')](_0x21683a)[_0x2be0('0x23')](function(_0x9b6867){_0x493b7c[_0x2be0('0x1d')]=_0x9b6867;if(_0x4d2ad6[_0x2be0('0x32')][_0x2be0('0x41')]){_0xa88b4f[_0x2be0('0x42')]=[{'all':!![]}];}return db[_0x2be0('0x2d')][_0x2be0('0x43')](_0xa88b4f);})[_0x2be0('0x23')](function(_0x4a49df){_0x493b7c[_0x2be0('0x44')]=_0x4a49df;return _0x493b7c;})['then'](respondWithFilteredResult(_0x11abcf,_0xa88b4f))[_0x2be0('0x45')](handleError(_0x11abcf,null));};exports[_0x2be0('0x46')]=function(_0x20869a,_0x394c65){var _0x15a118={'raw':!![],'where':{'id':_0x20869a[_0x2be0('0x47')]['id']}},_0x35eea1={};_0x35eea1['model']=_[_0x2be0('0x33')](db[_0x2be0('0x2d')][_0x2be0('0x48')]);_0x35eea1[_0x2be0('0x32')]=_[_0x2be0('0x33')](_0x20869a['query']);_0x35eea1[_0x2be0('0x34')]=_['intersection'](_0x35eea1[_0x2be0('0x31')],_0x35eea1[_0x2be0('0x32')]);_0x15a118[_0x2be0('0x35')]=_[_0x2be0('0x36')](_0x35eea1[_0x2be0('0x31')],qs[_0x2be0('0x37')](_0x20869a['query'][_0x2be0('0x37')]));_0x15a118['attributes']=_0x15a118[_0x2be0('0x35')][_0x2be0('0x38')]?_0x15a118['attributes']:_0x35eea1[_0x2be0('0x31')];if(_0x20869a[_0x2be0('0x32')][_0x2be0('0x41')]){_0x15a118[_0x2be0('0x42')]=[{'all':!![]}];}_0x15a118=_[_0x2be0('0x3d')]({},_0x15a118,_0x20869a['options']);return db['Tag'][_0x2be0('0x49')](_0x15a118)[_0x2be0('0x23')](handleEntityNotFound(_0x394c65,null))['then'](respondWithResult(_0x394c65,null))['catch'](handleError(_0x394c65,null));};exports[_0x2be0('0x4a')]=function(_0x3e6f94,_0x2d0ec3){return db[_0x2be0('0x2d')]['create'](_0x3e6f94[_0x2be0('0x4b')],{})[_0x2be0('0x23')](function(_0x7c024c){var _0x3e7e87=_0x3e6f94[_0x2be0('0x4c')][_0x2be0('0x24')]({'plain':!![]});if(!_0x3e7e87)throw new Error(_0x2be0('0x4d'));if(_0x3e7e87['role']===_0x2be0('0x4c')){var _0x400f59=_0x7c024c['get']({'plain':!![]});var _0x24a2aa=_0x2be0('0x25');return db[_0x2be0('0x4e')]['find']({'where':{'name':_0x24a2aa,'userProfileId':_0x3e7e87[_0x2be0('0x4f')]},'raw':!![]})[_0x2be0('0x23')](function(_0x1cd530){if(_0x1cd530&&_0x1cd530[_0x2be0('0x50')]===0x0){return db[_0x2be0('0x26')][_0x2be0('0x4a')]({'name':_0x400f59[_0x2be0('0x2a')],'resourceId':_0x400f59['id'],'type':_0x1cd530[_0x2be0('0x2a')],'sectionId':_0x1cd530['id']},{})[_0x2be0('0x23')](function(){return _0x7c024c;});}else{return _0x7c024c;}})['catch'](function(_0x2d586f){logger[_0x2be0('0x28')](_0x2be0('0x51'),_0x2d586f);throw _0x2d586f;});}return _0x7c024c;})[_0x2be0('0x23')](respondWithResult(_0x2d0ec3,0xc9))['catch'](handleError(_0x2d0ec3,null));};exports[_0x2be0('0x22')]=function(_0x552cbd,_0x1b5a31){if(_0x552cbd[_0x2be0('0x4b')]['id']){delete _0x552cbd['body']['id'];}return db[_0x2be0('0x2d')]['find']({'where':{'id':_0x552cbd[_0x2be0('0x47')]['id']}})[_0x2be0('0x23')](handleEntityNotFound(_0x1b5a31,null))['then'](saveUpdates(_0x552cbd[_0x2be0('0x4b')],null))[_0x2be0('0x23')](respondWithResult(_0x1b5a31,null))[_0x2be0('0x45')](handleError(_0x1b5a31,null));};exports[_0x2be0('0x27')]=function(_0x18258c,_0x210df5){return db[_0x2be0('0x2d')][_0x2be0('0x49')]({'where':{'id':_0x18258c[_0x2be0('0x47')]['id']}})['then'](handleEntityNotFound(_0x210df5,null))[_0x2be0('0x23')](removeEntity(_0x210df5,null))[_0x2be0('0x45')](handleError(_0x210df5,null));}; \ No newline at end of file +var _0xb469=['to-csv','ejs','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','limit','set','Content-Range','apply','update','then','get','Tags','UserProfileResource','destroy','error','stack','name','send','index','map','Tag','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','filter','includeAll','findAll','rows','catch','show','params','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0x4b672d,_0x4f9ba3){var _0x4cae2f=function(_0x14b6b6){while(--_0x14b6b6){_0x4b672d['push'](_0x4b672d['shift']());}};_0x4cae2f(++_0x4f9ba3);}(_0xb469,0x13b));var _0x9b46=function(_0x1165d8,_0x8f2ca){_0x1165d8=_0x1165d8-0x0;var _0x5e9977=_0xb469[_0x1165d8];return _0x5e9977;};'use strict';var emlformat=require(_0x9b46('0x0'));var rimraf=require(_0x9b46('0x1'));var zipdir=require(_0x9b46('0x2'));var jsonpatch=require(_0x9b46('0x3'));var rp=require(_0x9b46('0x4'));var moment=require(_0x9b46('0x5'));var BPromise=require(_0x9b46('0x6'));var Mustache=require('mustache');var util=require(_0x9b46('0x7'));var path=require(_0x9b46('0x8'));var sox=require('sox');var csv=require(_0x9b46('0x9'));var ejs=require(_0x9b46('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9b46('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9b46('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9b46('0x9'));var querystring=require(_0x9b46('0xd'));var Papa=require(_0x9b46('0xe'));var Redis=require('ioredis');var authService=require(_0x9b46('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9b46('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9b46('0x11'))('api');var utils=require(_0x9b46('0x12'));var config=require(_0x9b46('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x9b46('0x14'))['db'];function respondWithStatusCode(_0x417df5,_0x5b65c2){_0x5b65c2=_0x5b65c2||0xcc;return function(_0x14362a){if(_0x14362a){return _0x417df5[_0x9b46('0x15')](_0x5b65c2);}return _0x417df5[_0x9b46('0x16')](_0x5b65c2)[_0x9b46('0x17')]();};}function respondWithResult(_0xa8f4ac,_0x35c5c1){_0x35c5c1=_0x35c5c1||0xc8;return function(_0x2136bc){if(_0x2136bc){return _0xa8f4ac[_0x9b46('0x16')](_0x35c5c1)[_0x9b46('0x18')](_0x2136bc);}};}function respondWithFilteredResult(_0x178293,_0xbc1ba6){return function(_0x135cc2){if(_0x135cc2){var _0x1e6911=typeof _0xbc1ba6['offset']==='undefined'&&typeof _0xbc1ba6['limit']===_0x9b46('0x19');var _0x5a380c=_0x135cc2[_0x9b46('0x1a')];var _0x5c5cc9=_0x1e6911?0x0:_0xbc1ba6['offset'];var _0x3d9efa=_0x1e6911?_0x135cc2['count']:_0xbc1ba6['offset']+_0xbc1ba6[_0x9b46('0x1b')];var _0x3a15cc;if(_0x3d9efa>=_0x5a380c){_0x3d9efa=_0x5a380c;_0x3a15cc=0xc8;}else{_0x3a15cc=0xce;}_0x178293['status'](_0x3a15cc);return _0x178293[_0x9b46('0x1c')](_0x9b46('0x1d'),_0x5c5cc9+'-'+_0x3d9efa+'/'+_0x5a380c)['json'](_0x135cc2);}return null;};}function patchUpdates(_0x55aece){return function(_0xbec2ea){try{jsonpatch[_0x9b46('0x1e')](_0xbec2ea,_0x55aece,!![]);}catch(_0x204098){return BPromise['reject'](_0x204098);}return _0xbec2ea['save']();};}function saveUpdates(_0x2b3440,_0x51d2ca){return function(_0x21dacb){if(_0x21dacb){return _0x21dacb[_0x9b46('0x1f')](_0x2b3440)['then'](function(_0xadff19){return _0xadff19;});}return null;};}function removeEntity(_0x5182b1,_0x141cb6){return function(_0x2b6f72){if(_0x2b6f72){return _0x2b6f72['destroy']()[_0x9b46('0x20')](function(){var _0x31ca63=_0x2b6f72[_0x9b46('0x21')]({'plain':!![]});var _0x319930=_0x9b46('0x22');return db[_0x9b46('0x23')][_0x9b46('0x24')]({'where':{'type':_0x319930,'resourceId':_0x31ca63['id']}})['then'](function(){return _0x2b6f72;});})[_0x9b46('0x20')](function(){_0x5182b1[_0x9b46('0x16')](0xcc)[_0x9b46('0x17')]();});}};}function handleEntityNotFound(_0x268821,_0x2468be){return function(_0x2a79a5){if(!_0x2a79a5){_0x268821[_0x9b46('0x15')](0x194);}return _0x2a79a5;};}function handleError(_0x50fb4a,_0x3bf5b9){_0x3bf5b9=_0x3bf5b9||0x1f4;return function(_0xee519e){logger[_0x9b46('0x25')](_0xee519e[_0x9b46('0x26')]);if(_0xee519e[_0x9b46('0x27')]){delete _0xee519e[_0x9b46('0x27')];}_0x50fb4a[_0x9b46('0x16')](_0x3bf5b9)[_0x9b46('0x28')](_0xee519e);};}exports[_0x9b46('0x29')]=function(_0x20090a,_0x2e1c51){var _0x5ab8b7={},_0x1f722d={},_0x27f326={'count':0x0,'rows':[]};var _0x807f2=_[_0x9b46('0x2a')](db[_0x9b46('0x2b')][_0x9b46('0x2c')],function(_0xbf8bc5){return{'name':_0xbf8bc5[_0x9b46('0x2d')],'type':_0xbf8bc5[_0x9b46('0x2e')][_0x9b46('0x2f')]};});_0x1f722d[_0x9b46('0x30')]=_['map'](_0x807f2,_0x9b46('0x27'));_0x1f722d['query']=_[_0x9b46('0x31')](_0x20090a[_0x9b46('0x32')]);_0x1f722d[_0x9b46('0x33')]=_['intersection'](_0x1f722d[_0x9b46('0x30')],_0x1f722d[_0x9b46('0x32')]);_0x5ab8b7[_0x9b46('0x34')]=_[_0x9b46('0x35')](_0x1f722d[_0x9b46('0x30')],qs['fields'](_0x20090a['query'][_0x9b46('0x36')]));_0x5ab8b7[_0x9b46('0x34')]=_0x5ab8b7[_0x9b46('0x34')][_0x9b46('0x37')]?_0x5ab8b7['attributes']:_0x1f722d[_0x9b46('0x30')];if(!_0x20090a['query'][_0x9b46('0x38')](_0x9b46('0x39'))){_0x5ab8b7[_0x9b46('0x1b')]=qs[_0x9b46('0x1b')](_0x20090a['query'][_0x9b46('0x1b')]);_0x5ab8b7['offset']=qs[_0x9b46('0x3a')](_0x20090a[_0x9b46('0x32')][_0x9b46('0x3a')]);}_0x5ab8b7[_0x9b46('0x3b')]=qs[_0x9b46('0x3c')](_0x20090a[_0x9b46('0x32')][_0x9b46('0x3c')]);_0x5ab8b7[_0x9b46('0x3d')]=qs[_0x9b46('0x33')](_[_0x9b46('0x3e')](_0x20090a[_0x9b46('0x32')],_0x1f722d['filters']),_0x807f2);if(_0x20090a[_0x9b46('0x32')]['filter']){_0x5ab8b7[_0x9b46('0x3d')]=_[_0x9b46('0x3f')](_0x5ab8b7['where'],{'$or':_[_0x9b46('0x2a')](_0x807f2,function(_0x4f953e){if(_0x4f953e[_0x9b46('0x2e')]!=='VIRTUAL'){var _0x443226={};_0x443226[_0x4f953e[_0x9b46('0x27')]]={'$like':'%'+_0x20090a[_0x9b46('0x32')][_0x9b46('0x40')]+'%'};return _0x443226;}})});}_0x5ab8b7=_[_0x9b46('0x3f')]({},_0x5ab8b7,_0x20090a['options']);var _0x4e268c={'where':_0x5ab8b7[_0x9b46('0x3d')]};return db['Tag']['count'](_0x4e268c)['then'](function(_0x4e1911){_0x27f326[_0x9b46('0x1a')]=_0x4e1911;if(_0x20090a['query'][_0x9b46('0x41')]){_0x5ab8b7['include']=[{'all':!![]}];}return db[_0x9b46('0x2b')][_0x9b46('0x42')](_0x5ab8b7);})[_0x9b46('0x20')](function(_0xa14b){_0x27f326[_0x9b46('0x43')]=_0xa14b;return _0x27f326;})[_0x9b46('0x20')](respondWithFilteredResult(_0x2e1c51,_0x5ab8b7))[_0x9b46('0x44')](handleError(_0x2e1c51,null));};exports[_0x9b46('0x45')]=function(_0x148d86,_0x5602a9){var _0x447302={'raw':!![],'where':{'id':_0x148d86[_0x9b46('0x46')]['id']}},_0xe7d0fc={};_0xe7d0fc[_0x9b46('0x30')]=_[_0x9b46('0x31')](db[_0x9b46('0x2b')][_0x9b46('0x2c')]);_0xe7d0fc[_0x9b46('0x32')]=_[_0x9b46('0x31')](_0x148d86[_0x9b46('0x32')]);_0xe7d0fc[_0x9b46('0x33')]=_[_0x9b46('0x35')](_0xe7d0fc[_0x9b46('0x30')],_0xe7d0fc[_0x9b46('0x32')]);_0x447302['attributes']=_['intersection'](_0xe7d0fc[_0x9b46('0x30')],qs[_0x9b46('0x36')](_0x148d86[_0x9b46('0x32')]['fields']));_0x447302['attributes']=_0x447302[_0x9b46('0x34')][_0x9b46('0x37')]?_0x447302[_0x9b46('0x34')]:_0xe7d0fc[_0x9b46('0x30')];if(_0x148d86[_0x9b46('0x32')][_0x9b46('0x41')]){_0x447302['include']=[{'all':!![]}];}_0x447302=_[_0x9b46('0x3f')]({},_0x447302,_0x148d86[_0x9b46('0x47')]);return db[_0x9b46('0x2b')]['find'](_0x447302)[_0x9b46('0x20')](handleEntityNotFound(_0x5602a9,null))['then'](respondWithResult(_0x5602a9,null))[_0x9b46('0x44')](handleError(_0x5602a9,null));};exports[_0x9b46('0x48')]=function(_0x16e6d8,_0x566bad){return db[_0x9b46('0x2b')][_0x9b46('0x48')](_0x16e6d8[_0x9b46('0x49')],{})[_0x9b46('0x20')](function(_0x3d4c13){var _0x373ffd=_0x16e6d8['user'][_0x9b46('0x21')]({'plain':!![]});if(!_0x373ffd)throw new Error(_0x9b46('0x4a'));if(_0x373ffd[_0x9b46('0x4b')]===_0x9b46('0x4c')){var _0x362311=_0x3d4c13[_0x9b46('0x21')]({'plain':!![]});var _0x4a1df0=_0x9b46('0x22');return db['UserProfileSection'][_0x9b46('0x4d')]({'where':{'name':_0x4a1df0,'userProfileId':_0x373ffd[_0x9b46('0x4e')]},'raw':!![]})[_0x9b46('0x20')](function(_0x33d9ac){if(_0x33d9ac&&_0x33d9ac[_0x9b46('0x4f')]===0x0){return db['UserProfileResource'][_0x9b46('0x48')]({'name':_0x362311[_0x9b46('0x27')],'resourceId':_0x362311['id'],'type':_0x33d9ac[_0x9b46('0x27')],'sectionId':_0x33d9ac['id']},{})[_0x9b46('0x20')](function(){return _0x3d4c13;});}else{return _0x3d4c13;}})[_0x9b46('0x44')](function(_0x14080e){logger[_0x9b46('0x25')](_0x9b46('0x50'),_0x14080e);throw _0x14080e;});}return _0x3d4c13;})[_0x9b46('0x20')](respondWithResult(_0x566bad,0xc9))[_0x9b46('0x44')](handleError(_0x566bad,null));};exports[_0x9b46('0x1f')]=function(_0x4d473f,_0x551a64){if(_0x4d473f['body']['id']){delete _0x4d473f[_0x9b46('0x49')]['id'];}return db['Tag'][_0x9b46('0x4d')]({'where':{'id':_0x4d473f['params']['id']}})[_0x9b46('0x20')](handleEntityNotFound(_0x551a64,null))['then'](saveUpdates(_0x4d473f[_0x9b46('0x49')],null))[_0x9b46('0x20')](respondWithResult(_0x551a64,null))[_0x9b46('0x44')](handleError(_0x551a64,null));};exports[_0x9b46('0x24')]=function(_0x35f71d,_0x5bcaad){return db[_0x9b46('0x2b')][_0x9b46('0x4d')]({'where':{'id':_0x35f71d[_0x9b46('0x46')]['id']}})[_0x9b46('0x20')](handleEntityNotFound(_0x5bcaad,null))[_0x9b46('0x20')](removeEntity(_0x5bcaad,null))['catch'](handleError(_0x5bcaad,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 51473b8..5f4d152 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 _0x0153=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','lodash','api'];(function(_0x5a6f56,_0x366b19){var _0x435c39=function(_0x4698e8){while(--_0x4698e8){_0x5a6f56['push'](_0x5a6f56['shift']());}};_0x435c39(++_0x366b19);}(_0x0153,0x1f2));var _0x3015=function(_0x22e0e2,_0x3523ca){_0x22e0e2=_0x22e0e2-0x0;var _0x48143a=_0x0153[_0x22e0e2];return _0x48143a;};'use strict';var _=require(_0x3015('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3015('0x1'));var moment=require(_0x3015('0x2'));var BPromise=require(_0x3015('0x3'));var rp=require(_0x3015('0x4'));var fs=require('fs');var path=require(_0x3015('0x5'));var rimraf=require(_0x3015('0x6'));var config=require(_0x3015('0x7'));var attributes=require('./tag.attributes');module[_0x3015('0x8')]=function(_0x5188c1,_0x3d8fa3){return _0x5188c1[_0x3015('0x9')]('Tag',attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6008=['tools_tags','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag'];(function(_0x2db667,_0x193cf5){var _0x83ff9=function(_0x5da022){while(--_0x5da022){_0x2db667['push'](_0x2db667['shift']());}};_0x83ff9(++_0x193cf5);}(_0x6008,0x10b));var _0x8600=function(_0xbd3cb,_0x1d602b){_0xbd3cb=_0xbd3cb-0x0;var _0x156cdf=_0x6008[_0xbd3cb];return _0x156cdf;};'use strict';var _=require(_0x8600('0x0'));var util=require('util');var logger=require(_0x8600('0x1'))(_0x8600('0x2'));var moment=require(_0x8600('0x3'));var BPromise=require(_0x8600('0x4'));var rp=require(_0x8600('0x5'));var fs=require('fs');var path=require(_0x8600('0x6'));var rimraf=require(_0x8600('0x7'));var config=require(_0x8600('0x8'));var attributes=require(_0x8600('0x9'));module[_0x8600('0xa')]=function(_0x5aaa40,_0x4a3d9f){return _0x5aaa40[_0x8600('0xb')](_0x8600('0xc'),attributes,{'tableName':_0x8600('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 6eb53a8..3badb67 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 _0x3685=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x102ff9,_0x907658){var _0x24fa97=function(_0x3622ff){while(--_0x3622ff){_0x102ff9['push'](_0x102ff9['shift']());}};_0x24fa97(++_0x907658);}(_0x3685,0xf8));var _0x5368=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3685[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x5368('0x0'));var util=require('util');var moment=require(_0x5368('0x1'));var BPromise=require(_0x5368('0x2'));var rs=require(_0x5368('0x3'));var fs=require('fs');var Redis=require(_0x5368('0x4'));var db=require(_0x5368('0x5'))['db'];var utils=require(_0x5368('0x6'));var logger=require(_0x5368('0x7'))(_0x5368('0x8'));var config=require(_0x5368('0x9'));var jayson=require(_0x5368('0xa'));var client=jayson['client'][_0x5368('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2529a2,_0x39223d,_0xaf4549){return new BPromise(function(_0x55fb7d,_0x14e621){return client[_0x5368('0xc')](_0x2529a2,_0xaf4549)[_0x5368('0xd')](function(_0x2a6ce8){logger[_0x5368('0xe')](_0x5368('0xf'),_0x39223d,_0x5368('0x10'));logger[_0x5368('0x11')]('Tag,\x20%s,\x20%s,\x20%s',_0x39223d,_0x5368('0x10'),JSON[_0x5368('0x12')](_0x2a6ce8));if(_0x2a6ce8[_0x5368('0x13')]){if(_0x2a6ce8['error'][_0x5368('0x14')]===0x1f4){logger[_0x5368('0x13')]('Tag,\x20%s,\x20%s',_0x39223d,_0x2a6ce8['error']['message']);return _0x14e621(_0x2a6ce8[_0x5368('0x13')][_0x5368('0x15')]);}logger[_0x5368('0x13')](_0x5368('0xf'),_0x39223d,_0x2a6ce8[_0x5368('0x13')][_0x5368('0x15')]);return _0x55fb7d(_0x2a6ce8[_0x5368('0x13')][_0x5368('0x15')]);}else{logger[_0x5368('0xe')](_0x5368('0xf'),_0x39223d,'request\x20sent');_0x55fb7d(_0x2a6ce8[_0x5368('0x16')][_0x5368('0x15')]);}})['catch'](function(_0x19790d){logger[_0x5368('0x13')](_0x5368('0xf'),_0x39223d,_0x19790d);_0x14e621(_0x19790d);});});} \ No newline at end of file +var _0x98a8=['request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x31ff98,_0x5a41a0){var _0x1f8b20=function(_0x2fa831){while(--_0x2fa831){_0x31ff98['push'](_0x31ff98['shift']());}};_0x1f8b20(++_0x5a41a0);}(_0x98a8,0x12c));var _0x898a=function(_0x2a1183,_0x5311a0){_0x2a1183=_0x2a1183-0x0;var _0x3ce85b=_0x98a8[_0x2a1183];return _0x3ce85b;};'use strict';var _=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var moment=require(_0x898a('0x2'));var BPromise=require(_0x898a('0x3'));var rs=require(_0x898a('0x4'));var fs=require('fs');var Redis=require(_0x898a('0x5'));var db=require(_0x898a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x898a('0x7'))(_0x898a('0x8'));var config=require(_0x898a('0x9'));var jayson=require(_0x898a('0xa'));var client=jayson[_0x898a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3aadc2,_0x564583,_0xfa8c50){return new BPromise(function(_0x4fbce5,_0x42021d){return client[_0x898a('0xc')](_0x3aadc2,_0xfa8c50)[_0x898a('0xd')](function(_0x96b636){logger[_0x898a('0xe')](_0x898a('0xf'),_0x564583,_0x898a('0x10'));logger[_0x898a('0x11')](_0x898a('0x12'),_0x564583,'request\x20sent',JSON[_0x898a('0x13')](_0x96b636));if(_0x96b636['error']){if(_0x96b636[_0x898a('0x14')]['code']===0x1f4){logger[_0x898a('0x14')](_0x898a('0xf'),_0x564583,_0x96b636[_0x898a('0x14')]['message']);return _0x42021d(_0x96b636['error']['message']);}logger[_0x898a('0x14')](_0x898a('0xf'),_0x564583,_0x96b636[_0x898a('0x14')][_0x898a('0x15')]);return _0x4fbce5(_0x96b636[_0x898a('0x14')][_0x898a('0x15')]);}else{logger['info'](_0x898a('0xf'),_0x564583,'request\x20sent');_0x4fbce5(_0x96b636[_0x898a('0x16')]['message']);}})[_0x898a('0x17')](function(_0x4fb05b){logger[_0x898a('0x14')]('Tag,\x20%s,\x20%s',_0x564583,_0x4fb05b);_0x42021d(_0x4fb05b);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 49da194..62ef1f9 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 356d8c7..4fa3a1f 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['STRING','name'];(function(_0x2a7cea,_0x3f49ef){var _0x89287=function(_0x3c9458){while(--_0x3c9458){_0x2a7cea['push'](_0x2a7cea['shift']());}};_0x89287(++_0x3f49ef);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0x757a=['exports','STRING'];(function(_0x57d73a,_0x27b264){var _0xea07c1=function(_0x886a45){while(--_0x886a45){_0x57d73a['push'](_0x57d73a['shift']());}};_0xea07c1(++_0x27b264);}(_0x757a,0xde));var _0xa757=function(_0x5cb93e,_0x5b9bef){_0x5cb93e=_0x5cb93e-0x0;var _0x1c8c4f=_0x757a[_0x5cb93e];return _0x1c8c4f;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 16bbad1..f7404c9 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 _0xd0d6=['OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','TeamVoicePrefix','UserVoicePrefix','send','findOne','channel','ValidationError','Unknown\x20channel','toLowerCase','capitalize','Queues','addQueues','isValidChannel','ids','removeQueues','addAgents','Chat','Mail','Sms','Fax','Whatsapp','through','penalty','QueueId','Voice','TeamVoiceQueue','User','Queue','findOrCreate','emit','Queue:save','online','interface','UserVoiceQueueRt','isNil','SIP/%s','voicePause','all','upsert','VoicePrefixId','spread','isArray','removeAgents','Queue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./team.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','then','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Team','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','role','user','get','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','transaction','sequelize','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','UserVoiceQueue','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','UserSmsQueue','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId'];(function(_0x34ef08,_0x3490fc){var _0x161a4f=function(_0x47f7a1){while(--_0x47f7a1){_0x34ef08['push'](_0x34ef08['shift']());}};_0x161a4f(++_0x3490fc);}(_0xd0d6,0xc7));var _0x6d0d=function(_0x478c14,_0x3b433f){_0x478c14=_0x478c14-0x0;var _0x3a0ca1=_0xd0d6[_0x478c14];return _0x3a0ca1;};'use strict';var emlformat=require(_0x6d0d('0x0'));var rimraf=require(_0x6d0d('0x1'));var zipdir=require(_0x6d0d('0x2'));var jsonpatch=require(_0x6d0d('0x3'));var rp=require(_0x6d0d('0x4'));var moment=require('moment');var BPromise=require(_0x6d0d('0x5'));var Mustache=require(_0x6d0d('0x6'));var util=require(_0x6d0d('0x7'));var path=require('path');var sox=require(_0x6d0d('0x8'));var csv=require(_0x6d0d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6d0d('0xa'));var squel=require('squel');var crypto=require(_0x6d0d('0xb'));var jsforce=require(_0x6d0d('0xc'));var deskjs=require(_0x6d0d('0xd'));var toCsv=require(_0x6d0d('0x9'));var querystring=require(_0x6d0d('0xe'));var Papa=require('papaparse');var Redis=require(_0x6d0d('0xf'));var authService=require(_0x6d0d('0x10'));var qs=require(_0x6d0d('0x11'));var as=require(_0x6d0d('0x12'));var hardwareService=require(_0x6d0d('0x13'));var logger=require(_0x6d0d('0x14'))(_0x6d0d('0x15'));var utils=require('../../config/utils');var config=require(_0x6d0d('0x16'));var licenseUtil=require(_0x6d0d('0x17'));var db=require(_0x6d0d('0x18'))['db'];config[_0x6d0d('0x19')]=_[_0x6d0d('0x1a')](config['redis'],{'host':_0x6d0d('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6d0d('0x1c'))[_0x6d0d('0x1d')](socket);function respondWithStatusCode(_0x4858cf,_0x13d232){_0x13d232=_0x13d232||0xcc;return function(_0x1714b4){if(_0x1714b4){return _0x4858cf[_0x6d0d('0x1e')](_0x13d232);}return _0x4858cf[_0x6d0d('0x1f')](_0x13d232)[_0x6d0d('0x20')]();};}function respondWithResult(_0x6f49d1,_0x2e6638){_0x2e6638=_0x2e6638||0xc8;return function(_0x5f0c6){if(_0x5f0c6){return _0x6f49d1['status'](_0x2e6638)[_0x6d0d('0x21')](_0x5f0c6);}};}function respondWithFilteredResult(_0x46a43f,_0x53fa8c){return function(_0x4a5be9){if(_0x4a5be9){var _0x50d656=typeof _0x53fa8c[_0x6d0d('0x22')]===_0x6d0d('0x23')&&typeof _0x53fa8c['limit']==='undefined';var _0x28c4ab=_0x4a5be9[_0x6d0d('0x24')];var _0x527bb9=_0x50d656?0x0:_0x53fa8c[_0x6d0d('0x22')];var _0x5a0da1=_0x50d656?_0x4a5be9[_0x6d0d('0x24')]:_0x53fa8c['offset']+_0x53fa8c[_0x6d0d('0x25')];var _0x4a8939;if(_0x5a0da1>=_0x28c4ab){_0x5a0da1=_0x28c4ab;_0x4a8939=0xc8;}else{_0x4a8939=0xce;}_0x46a43f['status'](_0x4a8939);return _0x46a43f[_0x6d0d('0x26')](_0x6d0d('0x27'),_0x527bb9+'-'+_0x5a0da1+'/'+_0x28c4ab)[_0x6d0d('0x21')](_0x4a5be9);}return null;};}function patchUpdates(_0x1c4925){return function(_0x441cc8){try{jsonpatch[_0x6d0d('0x28')](_0x441cc8,_0x1c4925,!![]);}catch(_0x4e4f07){return BPromise['reject'](_0x4e4f07);}return _0x441cc8['save']();};}function saveUpdates(_0x92dc98,_0x5d3895){return function(_0x54bfe0){if(_0x54bfe0){return _0x54bfe0['update'](_0x92dc98)[_0x6d0d('0x29')](function(_0x593fe3){return _0x593fe3;});}return null;};}function handleEntityNotFound(_0x2e2c44,_0x183f04){return function(_0x5ba187){if(!_0x5ba187){_0x2e2c44[_0x6d0d('0x1e')](0x194);}return _0x5ba187;};}function handleError(_0x2a633e,_0x3d15f5){_0x3d15f5=_0x3d15f5||0x1f4;return function(_0x8a899f){logger[_0x6d0d('0x2a')](_0x8a899f[_0x6d0d('0x2b')]);if(_0x8a899f[_0x6d0d('0x2c')]){delete _0x8a899f['name'];}_0x2a633e[_0x6d0d('0x1f')](_0x3d15f5)['send'](_0x8a899f);};}exports[_0x6d0d('0x2d')]=function(_0xb5e930,_0x329867){var _0x5e36ec={},_0x1e5e9a={},_0x222ae0={'count':0x0,'rows':[]};var _0x15df35=_['map'](db['Team'][_0x6d0d('0x2e')],function(_0x38246d){return{'name':_0x38246d[_0x6d0d('0x2f')],'type':_0x38246d[_0x6d0d('0x30')][_0x6d0d('0x31')]};});_0x1e5e9a[_0x6d0d('0x32')]=_[_0x6d0d('0x33')](_0x15df35,_0x6d0d('0x2c'));_0x1e5e9a['query']=_[_0x6d0d('0x34')](_0xb5e930[_0x6d0d('0x35')]);_0x1e5e9a[_0x6d0d('0x36')]=_[_0x6d0d('0x37')](_0x1e5e9a['model'],_0x1e5e9a[_0x6d0d('0x35')]);_0x5e36ec[_0x6d0d('0x38')]=_['intersection'](_0x1e5e9a['model'],qs[_0x6d0d('0x39')](_0xb5e930['query'][_0x6d0d('0x39')]));_0x5e36ec[_0x6d0d('0x38')]=_0x5e36ec[_0x6d0d('0x38')]['length']?_0x5e36ec[_0x6d0d('0x38')]:_0x1e5e9a[_0x6d0d('0x32')];if(!_0xb5e930[_0x6d0d('0x35')][_0x6d0d('0x3a')](_0x6d0d('0x3b'))){_0x5e36ec[_0x6d0d('0x25')]=qs[_0x6d0d('0x25')](_0xb5e930['query'][_0x6d0d('0x25')]);_0x5e36ec[_0x6d0d('0x22')]=qs[_0x6d0d('0x22')](_0xb5e930['query'][_0x6d0d('0x22')]);}_0x5e36ec[_0x6d0d('0x3c')]=qs[_0x6d0d('0x3d')](_0xb5e930[_0x6d0d('0x35')]['sort']);_0x5e36ec[_0x6d0d('0x3e')]=qs[_0x6d0d('0x36')](_[_0x6d0d('0x3f')](_0xb5e930[_0x6d0d('0x35')],_0x1e5e9a[_0x6d0d('0x36')]),_0x15df35);if(_0xb5e930[_0x6d0d('0x35')][_0x6d0d('0x40')]){_0x5e36ec['where']=_[_0x6d0d('0x41')](_0x5e36ec[_0x6d0d('0x3e')],{'$or':_[_0x6d0d('0x33')](_0x15df35,function(_0x163e5b){if(_0x163e5b[_0x6d0d('0x30')]!==_0x6d0d('0x42')){var _0x39a559={};_0x39a559[_0x163e5b[_0x6d0d('0x2c')]]={'$like':'%'+_0xb5e930[_0x6d0d('0x35')][_0x6d0d('0x40')]+'%'};return _0x39a559;}})});}_0x5e36ec=_[_0x6d0d('0x41')]({},_0x5e36ec,_0xb5e930[_0x6d0d('0x43')]);var _0x251628={'where':_0x5e36ec['where']};return db[_0x6d0d('0x44')]['count'](_0x251628)[_0x6d0d('0x29')](function(_0x4416ab){_0x222ae0[_0x6d0d('0x24')]=_0x4416ab;if(_0xb5e930[_0x6d0d('0x35')][_0x6d0d('0x45')]){_0x5e36ec[_0x6d0d('0x46')]=[{'all':!![]}];}return db[_0x6d0d('0x44')][_0x6d0d('0x47')](_0x5e36ec);})[_0x6d0d('0x29')](function(_0x4abe0f){_0x222ae0[_0x6d0d('0x48')]=_0x4abe0f;return _0x222ae0;})[_0x6d0d('0x29')](respondWithFilteredResult(_0x329867,_0x5e36ec))[_0x6d0d('0x49')](handleError(_0x329867,null));};exports[_0x6d0d('0x4a')]=function(_0x2ecd84,_0xdc35c8){var _0x5bbd14={'raw':![],'where':{'id':_0x2ecd84[_0x6d0d('0x4b')]['id']}},_0x38b3f4={};_0x38b3f4[_0x6d0d('0x32')]=_[_0x6d0d('0x34')](db[_0x6d0d('0x44')][_0x6d0d('0x2e')]);_0x38b3f4[_0x6d0d('0x35')]=_[_0x6d0d('0x34')](_0x2ecd84[_0x6d0d('0x35')]);_0x38b3f4['filters']=_['intersection'](_0x38b3f4['model'],_0x38b3f4[_0x6d0d('0x35')]);_0x5bbd14[_0x6d0d('0x38')]=_[_0x6d0d('0x37')](_0x38b3f4['model'],qs['fields'](_0x2ecd84[_0x6d0d('0x35')][_0x6d0d('0x39')]));_0x5bbd14[_0x6d0d('0x38')]=_0x5bbd14[_0x6d0d('0x38')][_0x6d0d('0x4c')]?_0x5bbd14[_0x6d0d('0x38')]:_0x38b3f4[_0x6d0d('0x32')];if(_0x2ecd84['query'][_0x6d0d('0x45')]){_0x5bbd14[_0x6d0d('0x46')]=[{'all':!![]}];}_0x5bbd14=_['merge']({},_0x5bbd14,_0x2ecd84[_0x6d0d('0x43')]);return db[_0x6d0d('0x44')][_0x6d0d('0x4d')](_0x5bbd14)[_0x6d0d('0x29')](handleEntityNotFound(_0xdc35c8,null))[_0x6d0d('0x29')](respondWithResult(_0xdc35c8,null))[_0x6d0d('0x49')](handleError(_0xdc35c8,null));};exports[_0x6d0d('0x4e')]=function(_0xfcdd61,_0x20486f){return db[_0x6d0d('0x44')][_0x6d0d('0x4e')](_0xfcdd61[_0x6d0d('0x4f')],{})[_0x6d0d('0x29')](function(_0x4c45f3){var _0x23f7b5=_0xfcdd61['user']['get']({'plain':!![]});if(!_0x23f7b5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23f7b5[_0x6d0d('0x50')]===_0x6d0d('0x51')){var _0x2136da=_0x4c45f3[_0x6d0d('0x52')]({'plain':!![]});var _0x1469b8=_0x6d0d('0x53');return db[_0x6d0d('0x54')][_0x6d0d('0x4d')]({'where':{'name':_0x1469b8,'userProfileId':_0x23f7b5[_0x6d0d('0x55')]},'raw':!![]})[_0x6d0d('0x29')](function(_0x129ba2){if(_0x129ba2&&_0x129ba2[_0x6d0d('0x56')]===0x0){return db[_0x6d0d('0x57')][_0x6d0d('0x4e')]({'name':_0x2136da[_0x6d0d('0x2c')],'resourceId':_0x2136da['id'],'type':_0x129ba2[_0x6d0d('0x2c')],'sectionId':_0x129ba2['id']},{})[_0x6d0d('0x29')](function(){return _0x4c45f3;});}else{return _0x4c45f3;}})[_0x6d0d('0x49')](function(_0xc73779){logger['error'](_0x6d0d('0x58'),_0xc73779);throw _0xc73779;});}return _0x4c45f3;})['then'](respondWithResult(_0x20486f,0xc9))[_0x6d0d('0x49')](handleError(_0x20486f,null));};exports['update']=function(_0x1588a3,_0x39c5f7){if(_0x1588a3[_0x6d0d('0x4f')]['id']){delete _0x1588a3[_0x6d0d('0x4f')]['id'];}return db[_0x6d0d('0x44')]['find']({'where':{'id':_0x1588a3[_0x6d0d('0x4b')]['id']}})[_0x6d0d('0x29')](handleEntityNotFound(_0x39c5f7,null))['then'](saveUpdates(_0x1588a3['body'],null))[_0x6d0d('0x29')](respondWithResult(_0x39c5f7,null))[_0x6d0d('0x49')](handleError(_0x39c5f7,null));};exports[_0x6d0d('0x59')]=function(_0xbc0b45,_0x4501ed){var _0x4cb668=_0xbc0b45['params']['id'];var _0x180c6d=[];return db['sequelize'][_0x6d0d('0x5a')](function(_0x5b0f49){var _0x5aaddb='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x4cb668;return db[_0x6d0d('0x5b')][_0x6d0d('0x35')](_0x5aaddb,{'type':db[_0x6d0d('0x5c')][_0x6d0d('0x5d')][_0x6d0d('0x5e')],'raw':!![],'transaction':_0x5b0f49})['then'](function(_0x5c7c3e){_0x180c6d=_[_0x6d0d('0x33')](_0x5c7c3e,function(_0x50aa19){return Number(_0x50aa19[_0x6d0d('0x5f')]);});})['then'](function(){var _0x479a37=_0x6d0d('0x60')+_0x4cb668;return db['sequelize'][_0x6d0d('0x35')](_0x479a37,{'type':db['Sequelize'][_0x6d0d('0x5d')][_0x6d0d('0x5e')],'raw':!![],'transaction':_0x5b0f49});})[_0x6d0d('0x29')](function(_0x3156be){var _0x3b9d52=_['map'](_0x3156be,function(_0x46418c){return Number(_0x46418c['VoiceQueueId']);});return db[_0x6d0d('0x61')][_0x6d0d('0x59')]({'where':{'UserId':{'$in':_0x180c6d},'VoiceQueueId':{'$in':_0x3b9d52}},'transaction':_0x5b0f49});})[_0x6d0d('0x29')](function(){var _0x13d204='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4cb668;return db[_0x6d0d('0x5b')][_0x6d0d('0x35')](_0x13d204,{'type':db[_0x6d0d('0x5c')]['QueryTypes'][_0x6d0d('0x5e')],'raw':!![],'transaction':_0x5b0f49});})[_0x6d0d('0x29')](function(_0x14b64d){var _0x32a72a=_[_0x6d0d('0x33')](_0x14b64d,function(_0x4d940b){return Number(_0x4d940b['MailQueueId']);});return db[_0x6d0d('0x62')]['destroy']({'where':{'UserId':{'$in':_0x180c6d},'MailQueueId':{'$in':_0x32a72a}},'transaction':_0x5b0f49});})[_0x6d0d('0x29')](function(){var _0x128a6a=_0x6d0d('0x63')+_0x4cb668;return db['sequelize'][_0x6d0d('0x35')](_0x128a6a,{'type':db[_0x6d0d('0x5c')][_0x6d0d('0x5d')][_0x6d0d('0x5e')],'raw':!![],'transaction':_0x5b0f49});})['then'](function(_0x582622){var _0x595577=_['map'](_0x582622,function(_0x3624fb){return Number(_0x3624fb['SmsQueueId']);});return db[_0x6d0d('0x64')][_0x6d0d('0x59')]({'where':{'UserId':{'$in':_0x180c6d},'SmsQueueId':{'$in':_0x595577}},'transaction':_0x5b0f49});})[_0x6d0d('0x29')](function(){var _0x9c7ce6='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4cb668;return db[_0x6d0d('0x5b')][_0x6d0d('0x35')](_0x9c7ce6,{'type':db[_0x6d0d('0x5c')][_0x6d0d('0x5d')][_0x6d0d('0x5e')],'raw':!![],'transaction':_0x5b0f49});})[_0x6d0d('0x29')](function(_0x10a8c9){var _0xca9c9e=_[_0x6d0d('0x33')](_0x10a8c9,function(_0x36deff){return Number(_0x36deff[_0x6d0d('0x65')]);});return db[_0x6d0d('0x66')][_0x6d0d('0x59')]({'where':{'UserId':{'$in':_0x180c6d},'ChatQueueId':{'$in':_0xca9c9e}},'transaction':_0x5b0f49});})[_0x6d0d('0x29')](function(){var _0x17b7fe=_0x6d0d('0x67')+_0x4cb668;return db[_0x6d0d('0x5b')][_0x6d0d('0x35')](_0x17b7fe,{'type':db[_0x6d0d('0x5c')]['QueryTypes'][_0x6d0d('0x5e')],'raw':!![],'transaction':_0x5b0f49});})[_0x6d0d('0x29')](function(_0xe27db7){var _0x3e9dac=_[_0x6d0d('0x33')](_0xe27db7,function(_0x1cb87d){return Number(_0x1cb87d[_0x6d0d('0x68')]);});return db['UserFaxQueue'][_0x6d0d('0x59')]({'where':{'UserId':{'$in':_0x180c6d},'FaxQueueId':{'$in':_0x3e9dac}},'transaction':_0x5b0f49});})[_0x6d0d('0x29')](function(){var _0x8577a7='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4cb668;return db[_0x6d0d('0x5b')][_0x6d0d('0x35')](_0x8577a7,{'type':db['Sequelize'][_0x6d0d('0x5d')]['SELECT'],'raw':!![],'transaction':_0x5b0f49});})[_0x6d0d('0x29')](function(_0x1f834f){var _0x29b319=_['map'](_0x1f834f,function(_0x5bb570){return Number(_0x5bb570[_0x6d0d('0x69')]);});return db[_0x6d0d('0x6a')][_0x6d0d('0x59')]({'where':{'UserId':{'$in':_0x180c6d},'OpenchannelQueueId':{'$in':_0x29b319}},'transaction':_0x5b0f49});})[_0x6d0d('0x29')](function(){var _0x2367fe=_0x6d0d('0x6b')+_0x4cb668;return db[_0x6d0d('0x5b')][_0x6d0d('0x35')](_0x2367fe,{'type':db[_0x6d0d('0x5c')][_0x6d0d('0x5d')]['SELECT'],'raw':!![],'transaction':_0x5b0f49});})[_0x6d0d('0x29')](function(_0x20a9c8){var _0x41cb0a=_[_0x6d0d('0x33')](_0x20a9c8,function(_0x342c16){return Number(_0x342c16['WhatsappQueueId']);});return db['UserWhatsappQueue'][_0x6d0d('0x59')]({'where':{'UserId':{'$in':_0x180c6d},'WhatsappQueueId':{'$in':_0x41cb0a}},'transaction':_0x5b0f49});})[_0x6d0d('0x29')](function(){return db[_0x6d0d('0x6c')][_0x6d0d('0x4d')]({'where':{'TeamId':_0x4cb668}});})[_0x6d0d('0x29')](function(_0x392eb9){if(_0x392eb9===null){return;}return db[_0x6d0d('0x6d')][_0x6d0d('0x59')]({'where':{'UserId':{'$in':_0x180c6d},'VoicePrefixId':_0x392eb9['VoicePrefixId']},'transaction':_0x5b0f49});})[_0x6d0d('0x29')](function(){return db['Team'][_0x6d0d('0x59')]({'where':{'id':_0x4cb668},'cascade':!![],'transaction':_0x5b0f49});})[_0x6d0d('0x29')](function(_0x5d2d07){if(_0x5d2d07===0x0){_0x4501ed[_0x6d0d('0x1e')](0x194);}else{return db[_0x6d0d('0x57')][_0x6d0d('0x59')]({'where':{'type':_0x6d0d('0x53'),'resourceId':_0x4cb668},'cascade':!![],'transaction':_0x5b0f49})['then'](function(){_0x4501ed[_0x6d0d('0x1f')](0xcc)[_0x6d0d('0x20')]();});}})[_0x6d0d('0x49')](function(_0x3caf20){_0x4501ed[_0x6d0d('0x1f')](0x1f4)[_0x6d0d('0x6e')](_0x3caf20);});});};exports['getQueues']=function(_0x572bba,_0x430eb5,_0x55aa4a){return db['Team'][_0x6d0d('0x6f')]({'where':{'id':_0x572bba[_0x6d0d('0x4b')]['id']}})[_0x6d0d('0x29')](handleEntityNotFound(_0x430eb5,null))[_0x6d0d('0x29')](function(_0x3f7226){if(!_0x572bba[_0x6d0d('0x35')]['channel']||!utils['isValidChannel'](_0x572bba[_0x6d0d('0x35')][_0x6d0d('0x70')])){throw new db[(_0x6d0d('0x5c'))][(_0x6d0d('0x71'))](_0x6d0d('0x72'));}var _0x25c4a7={};var _0x8ed3ec={};_0x8ed3ec[_0x6d0d('0x32')]=_[_0x6d0d('0x34')](db[_['capitalize'](_0x572bba['query'][_0x6d0d('0x70')][_0x6d0d('0x73')]())+'Queue'][_0x6d0d('0x2e')]);_0x8ed3ec[_0x6d0d('0x35')]=_[_0x6d0d('0x34')](_0x572bba[_0x6d0d('0x35')]);_0x8ed3ec['filters']=_[_0x6d0d('0x37')](_0x8ed3ec['model'],_0x8ed3ec[_0x6d0d('0x35')]);_0x25c4a7[_0x6d0d('0x38')]=_[_0x6d0d('0x37')](_0x8ed3ec[_0x6d0d('0x32')],qs[_0x6d0d('0x39')](_0x572bba['query'][_0x6d0d('0x39')]));_0x25c4a7[_0x6d0d('0x38')]=_0x25c4a7[_0x6d0d('0x38')]['length']?_0x25c4a7[_0x6d0d('0x38')]:_0x8ed3ec['model'];_0x25c4a7[_0x6d0d('0x25')]=qs[_0x6d0d('0x25')](_0x572bba[_0x6d0d('0x35')][_0x6d0d('0x25')]);_0x25c4a7[_0x6d0d('0x22')]=qs[_0x6d0d('0x22')](_0x572bba[_0x6d0d('0x35')][_0x6d0d('0x22')]);_0x25c4a7['order']=qs[_0x6d0d('0x3d')](_0x572bba[_0x6d0d('0x35')][_0x6d0d('0x3d')]);_0x25c4a7[_0x6d0d('0x3e')]=qs['filters'](_[_0x6d0d('0x3f')](_0x572bba[_0x6d0d('0x35')],_0x8ed3ec['filters']));_0x25c4a7=_[_0x6d0d('0x41')]({},_0x25c4a7,_0x572bba[_0x6d0d('0x43')]);return _0x3f7226[_0x6d0d('0x52')+_[_0x6d0d('0x74')](_0x572bba[_0x6d0d('0x35')]['channel']['toLowerCase']())+_0x6d0d('0x75')](_0x25c4a7);})[_0x6d0d('0x29')](respondWithResult(_0x430eb5,null))[_0x6d0d('0x49')](handleError(_0x430eb5,null));};exports[_0x6d0d('0x76')]=function(_0x2e468e,_0x247c47,_0xe7288e){return db[_0x6d0d('0x44')][_0x6d0d('0x6f')]({'where':{'id':_0x2e468e[_0x6d0d('0x4b')]['id']}})[_0x6d0d('0x29')](function(_0x501507){if(_0x501507){if(!_0x2e468e[_0x6d0d('0x4f')][_0x6d0d('0x70')]||!utils[_0x6d0d('0x77')](_0x2e468e['body'][_0x6d0d('0x70')])){throw new db[(_0x6d0d('0x5c'))][(_0x6d0d('0x71'))]('Unknown\x20channel');}return _0x501507['add'+_[_0x6d0d('0x74')](_0x2e468e['body'][_0x6d0d('0x70')][_0x6d0d('0x73')]())+_0x6d0d('0x75')](_0x2e468e[_0x6d0d('0x4f')][_0x6d0d('0x78')]);}return null;})[_0x6d0d('0x29')](handleEntityNotFound(_0x247c47,null))[_0x6d0d('0x29')](respondWithStatusCode(_0x247c47,null))[_0x6d0d('0x49')](handleError(_0x247c47,null));};exports[_0x6d0d('0x79')]=function(_0x1b5f2b,_0x20c1e4,_0x16bf28){return db[_0x6d0d('0x44')][_0x6d0d('0x6f')]({'where':{'id':_0x1b5f2b[_0x6d0d('0x4b')]['id']}})[_0x6d0d('0x29')](function(_0xbf1ac7){if(_0xbf1ac7){if(!_0x1b5f2b['query']['channel']||!utils[_0x6d0d('0x77')](_0x1b5f2b[_0x6d0d('0x35')][_0x6d0d('0x70')])){throw new db[(_0x6d0d('0x5c'))]['ValidationError'](_0x6d0d('0x72'));}return _0xbf1ac7['remove'+_[_0x6d0d('0x74')](_0x1b5f2b[_0x6d0d('0x35')][_0x6d0d('0x70')]['toLowerCase']())+_0x6d0d('0x75')](_0x1b5f2b['query'][_0x6d0d('0x78')]);}return null;})[_0x6d0d('0x29')](handleEntityNotFound(_0x20c1e4,null))[_0x6d0d('0x29')](respondWithStatusCode(_0x20c1e4,null))[_0x6d0d('0x49')](handleError(_0x20c1e4,null));};exports[_0x6d0d('0x7a')]=function(_0xd50d4,_0x4b7675){var _0x4ae610=_['isArray'](_0xd50d4[_0x6d0d('0x4f')]['ids'])?_0xd50d4[_0x6d0d('0x4f')][_0x6d0d('0x78')]:[_0xd50d4['body']['ids']];var _0x146b92=_0xd50d4['params']['id'];return db[_0x6d0d('0x44')][_0x6d0d('0x4d')]({'where':{'id':_0x146b92}})[_0x6d0d('0x29')](handleEntityNotFound(_0x4b7675,null))[_0x6d0d('0x29')](function(_0x45dfa6){if(_0x45dfa6){var _0x2563fb=['Voice',_0x6d0d('0x7b'),_0x6d0d('0x7c'),_0x6d0d('0x7d'),_0x6d0d('0x7e'),'Openchannel',_0x6d0d('0x7f')];return db[_0x6d0d('0x5b')]['transaction'](function(_0x596057){var _0x4d391d=_[_0x6d0d('0x33')](_0x2563fb,function(_0x643472){var _0x5978b2={'attributes':['id','name']};if(_0x643472==='Voice'){_0x5978b2[_0x6d0d('0x80')]={'attributes':[_0x6d0d('0x81')]};}return _0x45dfa6[_0x6d0d('0x52')+_0x643472+_0x6d0d('0x75')](_0x5978b2)[_0x6d0d('0x29')](function(_0x67aaa1){var _0x3ee826=_[_0x6d0d('0x33')](_0x67aaa1,function(_0x3df1d6){var _0x540622=_[_0x6d0d('0x33')](_0x4ae610,function(_0x1a17a3){var _0x56f387={'where':{'UserId':_0x1a17a3,[_0x643472+_0x6d0d('0x82')]:_0x3df1d6['id']},'transaction':_0x596057};if(_0x643472===_0x6d0d('0x83')){_0x56f387[_0x6d0d('0x1a')]={'penalty':_0x3df1d6[_0x6d0d('0x84')][_0x6d0d('0x81')]};}return db[_0x6d0d('0x85')+_0x643472+_0x6d0d('0x86')][_0x6d0d('0x87')](_0x56f387)['then'](function(){socket[_0x6d0d('0x88')]('user'+_0x643472+_0x6d0d('0x89'),{'UserId':_0x1a17a3,[_0x643472+_0x6d0d('0x82')]:_0x3df1d6['id']});if(_0x643472!==_0x6d0d('0x83')){return;}return db[_0x6d0d('0x85')][_0x6d0d('0x47')]({'where':{'id':_0x4ae610,'online':0x1},'attributes':['id',_0x6d0d('0x2c'),_0x6d0d('0x8a'),'voicePause',_0x6d0d('0x8b')],'raw':!![]})[_0x6d0d('0x29')](function(_0x16e162){var _0x366b28=_[_0x6d0d('0x33')](_0x16e162,function(_0x4413c3){return db[_0x6d0d('0x8c')]['upsert']({'membername':_0x4413c3[_0x6d0d('0x2c')],'UserId':_0x4413c3['id'],'queue_name':_0x3df1d6[_0x6d0d('0x2c')],'VoiceQueueId':_0x3df1d6['id'],'interface':_[_0x6d0d('0x8d')](_0x4413c3[_0x6d0d('0x8b')])?util['format'](_0x6d0d('0x8e'),_0x4413c3['name']):_0x4413c3[_0x6d0d('0x8b')],'paused':_0x4413c3[_0x6d0d('0x8f')]||![],'penalty':_0x3df1d6[_0x6d0d('0x84')][_0x6d0d('0x81')]},{'transaction':_0x596057});});return Promise[_0x6d0d('0x90')](_0x366b28);});});});return Promise[_0x6d0d('0x90')](_0x540622);});return Promise[_0x6d0d('0x90')](_0x3ee826);})[_0x6d0d('0x29')](function(){return db['TeamVoicePrefix'][_0x6d0d('0x6f')]({'where':{'teamId':_0x146b92}})['then'](function(_0x2a7fbf){if(_0x2a7fbf){var _0x50052c=_[_0x6d0d('0x33')](_0x4ae610,function(_0x4d9a63){db[_0x6d0d('0x6d')][_0x6d0d('0x91')]({'UserId':_0x4d9a63,'VoicePrefixId':_0x2a7fbf[_0x6d0d('0x92')]});});return Promise[_0x6d0d('0x90')](_0x50052c);}});});});return Promise[_0x6d0d('0x90')](_0x4d391d)[_0x6d0d('0x29')](function(){return _0x45dfa6['addAgents'](_0x4ae610,{'transaction':_0x596057})[_0x6d0d('0x93')](function(_0x2f1adb){return _0x2f1adb;});});});}})['then'](respondWithResult(_0x4b7675,null))[_0x6d0d('0x49')](handleError(_0x4b7675,null));};exports['removeAgents']=function(_0xda732f,_0x5990a0){var _0x19b49a=_[_0x6d0d('0x94')](_0xda732f[_0x6d0d('0x35')][_0x6d0d('0x78')])?_0xda732f[_0x6d0d('0x35')][_0x6d0d('0x78')]:[_0xda732f[_0x6d0d('0x35')][_0x6d0d('0x78')]];var _0x488824=_0xda732f['params']['id'];return db[_0x6d0d('0x44')][_0x6d0d('0x4d')]({'where':{'id':_0x488824}})['then'](handleEntityNotFound(_0x5990a0,null))[_0x6d0d('0x29')](function(_0x50c038){if(_0x50c038){var _0x540642=[_0x6d0d('0x83'),'Chat',_0x6d0d('0x7c'),'Sms',_0x6d0d('0x7e'),'Openchannel',_0x6d0d('0x7f')];return db['sequelize'][_0x6d0d('0x5a')](function(_0x7379a5){var _0x542b95=_['map'](_0x540642,function(_0x25576c){var _0x19c4c8={'attributes':['id','name']};return _0x50c038[_0x6d0d('0x52')+_0x25576c+_0x6d0d('0x75')](_0x19c4c8)['then'](function(_0x137983){var _0x3c333e=_[_0x6d0d('0x33')](_0x137983,function(_0x4198df){return _0x4198df[_0x6d0d('0x95')](_0x19b49a,{'transaction':_0x7379a5})['then'](function(){var _0x5a9a59=_[_0x6d0d('0x33')](_0x19b49a,function(_0x4559f1){socket['emit'](_0x6d0d('0x51')+_0x25576c+_0x6d0d('0x96'),{'UserId':Number(_0x4559f1),[_0x25576c+_0x6d0d('0x82')]:_0x4198df['id']});if(_0x25576c!=='Voice'){return;}return db['UserVoiceQueueRt'][_0x6d0d('0x59')]({'where':{'VoiceQueueId':_0x4198df['id'],'UserId':_0x4559f1},'transaction':_0x7379a5});});return Promise[_0x6d0d('0x90')](_0x5a9a59);});});return Promise[_0x6d0d('0x90')](_0x3c333e);});});return Promise['all'](_0x542b95)[_0x6d0d('0x29')](function(){return _0x50c038[_0x6d0d('0x95')](_0x19b49a,{'transaction':_0x7379a5});})['then'](function(){return db[_0x6d0d('0x6c')]['findOne']({'where':{'teamId':_0x488824}})[_0x6d0d('0x29')](function(_0x2d3195){if(_0x2d3195){var _0x38968e=_['map'](_0x19b49a,function(_0x591cfa){db[_0x6d0d('0x6d')]['destroy']({'where':{'UserId':_0x591cfa,'VoicePrefixId':_0x2d3195[_0x6d0d('0x92')]}});});return Promise['all'](_0x38968e);}});});});}})[_0x6d0d('0x29')](respondWithStatusCode(_0x5990a0,null))[_0x6d0d('0x49')](handleError(_0x5990a0,null));};exports['getAgents']=function(_0x27dab9,_0x228a34,_0x596bc7){var _0x534cbf={};var _0xe12a02={};var _0x36ddfa;var _0x4fad55;return db[_0x6d0d('0x44')]['findOne']({'where':{'id':_0x27dab9[_0x6d0d('0x4b')]['id']}})[_0x6d0d('0x29')](handleEntityNotFound(_0x228a34,null))[_0x6d0d('0x29')](function(_0x11edd8){if(_0x11edd8){_0x36ddfa=_0x11edd8;_0xe12a02[_0x6d0d('0x32')]=_[_0x6d0d('0x34')](db[_0x6d0d('0x85')][_0x6d0d('0x2e')]);_0xe12a02[_0x6d0d('0x35')]=_[_0x6d0d('0x34')](_0x27dab9['query']);_0xe12a02[_0x6d0d('0x36')]=_[_0x6d0d('0x37')](_0xe12a02[_0x6d0d('0x32')],_0xe12a02[_0x6d0d('0x35')]);_0x534cbf[_0x6d0d('0x38')]=_[_0x6d0d('0x37')](_0xe12a02[_0x6d0d('0x32')],qs[_0x6d0d('0x39')](_0x27dab9[_0x6d0d('0x35')][_0x6d0d('0x39')]));_0x534cbf['attributes']=_0x534cbf['attributes']['length']?_0x534cbf[_0x6d0d('0x38')]:_0xe12a02[_0x6d0d('0x32')];_0x534cbf['order']=qs[_0x6d0d('0x3d')](_0x27dab9['query'][_0x6d0d('0x3d')]);_0x534cbf['where']=qs[_0x6d0d('0x36')](_[_0x6d0d('0x3f')](_0x27dab9[_0x6d0d('0x35')],_0xe12a02[_0x6d0d('0x36')]));if(_0x27dab9[_0x6d0d('0x35')][_0x6d0d('0x40')]){_0x534cbf['where']=_[_0x6d0d('0x41')](_0x534cbf[_0x6d0d('0x3e')],{'$or':_[_0x6d0d('0x33')](_0x534cbf['attributes'],function(_0x2f0a5b){var _0x176f80={};_0x176f80[_0x2f0a5b]={'$like':'%'+_0x27dab9[_0x6d0d('0x35')][_0x6d0d('0x40')]+'%'};return _0x176f80;})});}_0x534cbf=_['merge']({},_0x534cbf,_0x27dab9[_0x6d0d('0x43')]);return _0x36ddfa[_0x6d0d('0x97')](_0x534cbf);}})['then'](function(_0x30dde0){if(_0x30dde0){_0x4fad55=_0x30dde0[_0x6d0d('0x4c')];if(!_0x27dab9[_0x6d0d('0x35')]['hasOwnProperty'](_0x6d0d('0x3b'))){_0x534cbf[_0x6d0d('0x25')]=qs[_0x6d0d('0x25')](_0x27dab9[_0x6d0d('0x35')][_0x6d0d('0x25')]);_0x534cbf[_0x6d0d('0x22')]=qs[_0x6d0d('0x22')](_0x27dab9[_0x6d0d('0x35')]['offset']);}return _0x36ddfa['getAgents'](_0x534cbf);}})[_0x6d0d('0x29')](function(_0x34a8cb){if(_0x34a8cb){return _0x34a8cb?{'count':_0x4fad55,'rows':_0x34a8cb}:null;}})[_0x6d0d('0x29')](respondWithResult(_0x228a34,null))[_0x6d0d('0x49')](handleError(_0x228a34,null));}; \ No newline at end of file +var _0xcfce=['spread','removeAgents','Whatsapp','Queue:remove','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','localhost','redis','./team.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','then','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','Team','includeAll','include','findAll','catch','show','options','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','find','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','params','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','UserId','Sequelize','VoiceQueueId','UserVoiceQueue','MailQueueId','UserMailQueue','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','getQueues','findOne','channel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','add','ids','removeQueues','isValidChannel','remove','addAgents','isArray','Voice','Chat','Mail','Sms','Openchannel','through','penalty','QueueId','defaults','User','findOrCreate','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','TeamVoiceQueue','all','UserVoicePrefix','VoicePrefixId'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0xcfce,0x137));var _0xecfc=function(_0x31cdf3,_0x4f2183){_0x31cdf3=_0x31cdf3-0x0;var _0x5623f8=_0xcfce[_0x31cdf3];return _0x5623f8;};'use strict';var emlformat=require(_0xecfc('0x0'));var rimraf=require(_0xecfc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xecfc('0x2'));var rp=require('request-promise');var moment=require(_0xecfc('0x3'));var BPromise=require(_0xecfc('0x4'));var Mustache=require('mustache');var util=require(_0xecfc('0x5'));var path=require(_0xecfc('0x6'));var sox=require(_0xecfc('0x7'));var csv=require(_0xecfc('0x8'));var ejs=require(_0xecfc('0x9'));var fs=require('fs');var fs_extra=require(_0xecfc('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xecfc('0xb'));var jsforce=require(_0xecfc('0xc'));var deskjs=require(_0xecfc('0xd'));var toCsv=require(_0xecfc('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xecfc('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xecfc('0xf'));var hardwareService=require(_0xecfc('0x10'));var logger=require('../../config/logger')(_0xecfc('0x11'));var utils=require('../../config/utils');var config=require(_0xecfc('0x12'));var licenseUtil=require(_0xecfc('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xecfc('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xecfc('0x15')]));require(_0xecfc('0x16'))[_0xecfc('0x17')](socket);function respondWithStatusCode(_0x4aad5c,_0x262ddf){_0x262ddf=_0x262ddf||0xcc;return function(_0x1cab27){if(_0x1cab27){return _0x4aad5c[_0xecfc('0x18')](_0x262ddf);}return _0x4aad5c[_0xecfc('0x19')](_0x262ddf)[_0xecfc('0x1a')]();};}function respondWithResult(_0x53cc4a,_0x21b2c0){_0x21b2c0=_0x21b2c0||0xc8;return function(_0x151426){if(_0x151426){return _0x53cc4a[_0xecfc('0x19')](_0x21b2c0)[_0xecfc('0x1b')](_0x151426);}};}function respondWithFilteredResult(_0x449258,_0xbf6a95){return function(_0x39aac6){if(_0x39aac6){var _0x4b8840=typeof _0xbf6a95[_0xecfc('0x1c')]===_0xecfc('0x1d')&&typeof _0xbf6a95[_0xecfc('0x1e')]==='undefined';var _0x2bab7a=_0x39aac6[_0xecfc('0x1f')];var _0x215403=_0x4b8840?0x0:_0xbf6a95[_0xecfc('0x1c')];var _0x168d01=_0x4b8840?_0x39aac6['count']:_0xbf6a95[_0xecfc('0x1c')]+_0xbf6a95[_0xecfc('0x1e')];var _0x480011;if(_0x168d01>=_0x2bab7a){_0x168d01=_0x2bab7a;_0x480011=0xc8;}else{_0x480011=0xce;}_0x449258[_0xecfc('0x19')](_0x480011);return _0x449258['set'](_0xecfc('0x20'),_0x215403+'-'+_0x168d01+'/'+_0x2bab7a)[_0xecfc('0x1b')](_0x39aac6);}return null;};}function patchUpdates(_0x59466c){return function(_0x574695){try{jsonpatch[_0xecfc('0x21')](_0x574695,_0x59466c,!![]);}catch(_0x474ed9){return BPromise['reject'](_0x474ed9);}return _0x574695['save']();};}function saveUpdates(_0x2786a4,_0x2eab87){return function(_0x3038f9){if(_0x3038f9){return _0x3038f9[_0xecfc('0x22')](_0x2786a4)[_0xecfc('0x23')](function(_0x1383e4){return _0x1383e4;});}return null;};}function handleEntityNotFound(_0x1a64b0,_0xd092d1){return function(_0x577f58){if(!_0x577f58){_0x1a64b0[_0xecfc('0x18')](0x194);}return _0x577f58;};}function handleError(_0x44fecb,_0x14ff4b){_0x14ff4b=_0x14ff4b||0x1f4;return function(_0xaf6108){logger['error'](_0xaf6108['stack']);if(_0xaf6108[_0xecfc('0x24')]){delete _0xaf6108[_0xecfc('0x24')];}_0x44fecb[_0xecfc('0x19')](_0x14ff4b)[_0xecfc('0x25')](_0xaf6108);};}exports[_0xecfc('0x26')]=function(_0x5735bd,_0x4b76db){var _0x11a228={},_0x1869c5={},_0x10579e={'count':0x0,'rows':[]};var _0x5728fe=_[_0xecfc('0x27')](db['Team'][_0xecfc('0x28')],function(_0x9729f1){return{'name':_0x9729f1[_0xecfc('0x29')],'type':_0x9729f1[_0xecfc('0x2a')][_0xecfc('0x2b')]};});_0x1869c5['model']=_[_0xecfc('0x27')](_0x5728fe,_0xecfc('0x24'));_0x1869c5[_0xecfc('0x2c')]=_[_0xecfc('0x2d')](_0x5735bd[_0xecfc('0x2c')]);_0x1869c5[_0xecfc('0x2e')]=_[_0xecfc('0x2f')](_0x1869c5['model'],_0x1869c5[_0xecfc('0x2c')]);_0x11a228['attributes']=_[_0xecfc('0x2f')](_0x1869c5[_0xecfc('0x30')],qs['fields'](_0x5735bd['query'][_0xecfc('0x31')]));_0x11a228['attributes']=_0x11a228['attributes'][_0xecfc('0x32')]?_0x11a228[_0xecfc('0x33')]:_0x1869c5[_0xecfc('0x30')];if(!_0x5735bd[_0xecfc('0x2c')][_0xecfc('0x34')](_0xecfc('0x35'))){_0x11a228['limit']=qs[_0xecfc('0x1e')](_0x5735bd[_0xecfc('0x2c')]['limit']);_0x11a228['offset']=qs['offset'](_0x5735bd[_0xecfc('0x2c')][_0xecfc('0x1c')]);}_0x11a228[_0xecfc('0x36')]=qs['sort'](_0x5735bd[_0xecfc('0x2c')][_0xecfc('0x37')]);_0x11a228[_0xecfc('0x38')]=qs['filters'](_[_0xecfc('0x39')](_0x5735bd[_0xecfc('0x2c')],_0x1869c5['filters']),_0x5728fe);if(_0x5735bd[_0xecfc('0x2c')][_0xecfc('0x3a')]){_0x11a228[_0xecfc('0x38')]=_['merge'](_0x11a228[_0xecfc('0x38')],{'$or':_['map'](_0x5728fe,function(_0x5db124){if(_0x5db124[_0xecfc('0x2a')]!==_0xecfc('0x3b')){var _0x4ec770={};_0x4ec770[_0x5db124[_0xecfc('0x24')]]={'$like':'%'+_0x5735bd[_0xecfc('0x2c')][_0xecfc('0x3a')]+'%'};return _0x4ec770;}})});}_0x11a228=_[_0xecfc('0x3c')]({},_0x11a228,_0x5735bd['options']);var _0x1aeef8={'where':_0x11a228['where']};return db[_0xecfc('0x3d')]['count'](_0x1aeef8)[_0xecfc('0x23')](function(_0x27da08){_0x10579e[_0xecfc('0x1f')]=_0x27da08;if(_0x5735bd[_0xecfc('0x2c')][_0xecfc('0x3e')]){_0x11a228[_0xecfc('0x3f')]=[{'all':!![]}];}return db[_0xecfc('0x3d')][_0xecfc('0x40')](_0x11a228);})[_0xecfc('0x23')](function(_0x5e0183){_0x10579e['rows']=_0x5e0183;return _0x10579e;})[_0xecfc('0x23')](respondWithFilteredResult(_0x4b76db,_0x11a228))[_0xecfc('0x41')](handleError(_0x4b76db,null));};exports[_0xecfc('0x42')]=function(_0xb815a7,_0x438ee2){var _0x3c92ca={'raw':![],'where':{'id':_0xb815a7['params']['id']}},_0x3b24b7={};_0x3b24b7[_0xecfc('0x30')]=_['keys'](db[_0xecfc('0x3d')][_0xecfc('0x28')]);_0x3b24b7[_0xecfc('0x2c')]=_['keys'](_0xb815a7[_0xecfc('0x2c')]);_0x3b24b7[_0xecfc('0x2e')]=_[_0xecfc('0x2f')](_0x3b24b7['model'],_0x3b24b7['query']);_0x3c92ca[_0xecfc('0x33')]=_[_0xecfc('0x2f')](_0x3b24b7[_0xecfc('0x30')],qs['fields'](_0xb815a7[_0xecfc('0x2c')][_0xecfc('0x31')]));_0x3c92ca['attributes']=_0x3c92ca[_0xecfc('0x33')][_0xecfc('0x32')]?_0x3c92ca[_0xecfc('0x33')]:_0x3b24b7[_0xecfc('0x30')];if(_0xb815a7[_0xecfc('0x2c')][_0xecfc('0x3e')]){_0x3c92ca['include']=[{'all':!![]}];}_0x3c92ca=_['merge']({},_0x3c92ca,_0xb815a7[_0xecfc('0x43')]);return db[_0xecfc('0x3d')]['find'](_0x3c92ca)[_0xecfc('0x23')](handleEntityNotFound(_0x438ee2,null))[_0xecfc('0x23')](respondWithResult(_0x438ee2,null))[_0xecfc('0x41')](handleError(_0x438ee2,null));};exports['create']=function(_0x54b86f,_0x752bc0){return db['Team'][_0xecfc('0x44')](_0x54b86f['body'],{})[_0xecfc('0x23')](function(_0x359c6f){var _0x19b366=_0x54b86f[_0xecfc('0x45')][_0xecfc('0x46')]({'plain':!![]});if(!_0x19b366)throw new Error(_0xecfc('0x47'));if(_0x19b366[_0xecfc('0x48')]===_0xecfc('0x45')){var _0x342e86=_0x359c6f[_0xecfc('0x46')]({'plain':!![]});var _0x312f09=_0xecfc('0x49');return db[_0xecfc('0x4a')][_0xecfc('0x4b')]({'where':{'name':_0x312f09,'userProfileId':_0x19b366['userProfileId']},'raw':!![]})[_0xecfc('0x23')](function(_0x260829){if(_0x260829&&_0x260829[_0xecfc('0x4c')]===0x0){return db[_0xecfc('0x4d')][_0xecfc('0x44')]({'name':_0x342e86[_0xecfc('0x24')],'resourceId':_0x342e86['id'],'type':_0x260829[_0xecfc('0x24')],'sectionId':_0x260829['id']},{})[_0xecfc('0x23')](function(){return _0x359c6f;});}else{return _0x359c6f;}})[_0xecfc('0x41')](function(_0x9f80d3){logger[_0xecfc('0x4e')](_0xecfc('0x4f'),_0x9f80d3);throw _0x9f80d3;});}return _0x359c6f;})['then'](respondWithResult(_0x752bc0,0xc9))[_0xecfc('0x41')](handleError(_0x752bc0,null));};exports[_0xecfc('0x22')]=function(_0x3646ee,_0x55c8bc){if(_0x3646ee['body']['id']){delete _0x3646ee[_0xecfc('0x50')]['id'];}return db[_0xecfc('0x3d')][_0xecfc('0x4b')]({'where':{'id':_0x3646ee['params']['id']}})[_0xecfc('0x23')](handleEntityNotFound(_0x55c8bc,null))[_0xecfc('0x23')](saveUpdates(_0x3646ee[_0xecfc('0x50')],null))[_0xecfc('0x23')](respondWithResult(_0x55c8bc,null))[_0xecfc('0x41')](handleError(_0x55c8bc,null));};exports[_0xecfc('0x51')]=function(_0x325b09,_0x1afdb1){var _0x4d3c43=_0x325b09[_0xecfc('0x52')]['id'];var _0x538cfb=[];return db[_0xecfc('0x53')][_0xecfc('0x54')](function(_0x320964){var _0x12458e=_0xecfc('0x55')+_0x4d3c43;return db[_0xecfc('0x53')][_0xecfc('0x2c')](_0x12458e,{'type':db['Sequelize'][_0xecfc('0x56')][_0xecfc('0x57')],'raw':!![],'transaction':_0x320964})['then'](function(_0x47c25f){_0x538cfb=_['map'](_0x47c25f,function(_0x2e7774){return Number(_0x2e7774[_0xecfc('0x58')]);});})[_0xecfc('0x23')](function(){var _0x364386='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4d3c43;return db['sequelize'][_0xecfc('0x2c')](_0x364386,{'type':db[_0xecfc('0x59')][_0xecfc('0x56')][_0xecfc('0x57')],'raw':!![],'transaction':_0x320964});})['then'](function(_0x38f51d){var _0x434520=_[_0xecfc('0x27')](_0x38f51d,function(_0xf929fb){return Number(_0xf929fb[_0xecfc('0x5a')]);});return db[_0xecfc('0x5b')][_0xecfc('0x51')]({'where':{'UserId':{'$in':_0x538cfb},'VoiceQueueId':{'$in':_0x434520}},'transaction':_0x320964});})[_0xecfc('0x23')](function(){var _0x3bcf65='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4d3c43;return db[_0xecfc('0x53')][_0xecfc('0x2c')](_0x3bcf65,{'type':db[_0xecfc('0x59')][_0xecfc('0x56')]['SELECT'],'raw':!![],'transaction':_0x320964});})[_0xecfc('0x23')](function(_0x25c890){var _0xaf8d1b=_[_0xecfc('0x27')](_0x25c890,function(_0x420df7){return Number(_0x420df7[_0xecfc('0x5c')]);});return db[_0xecfc('0x5d')][_0xecfc('0x51')]({'where':{'UserId':{'$in':_0x538cfb},'MailQueueId':{'$in':_0xaf8d1b}},'transaction':_0x320964});})[_0xecfc('0x23')](function(){var _0x39df2b='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4d3c43;return db[_0xecfc('0x53')][_0xecfc('0x2c')](_0x39df2b,{'type':db['Sequelize'][_0xecfc('0x56')][_0xecfc('0x57')],'raw':!![],'transaction':_0x320964});})['then'](function(_0x437b4e){var _0x377d39=_[_0xecfc('0x27')](_0x437b4e,function(_0x203ea9){return Number(_0x203ea9[_0xecfc('0x5e')]);});return db[_0xecfc('0x5f')][_0xecfc('0x51')]({'where':{'UserId':{'$in':_0x538cfb},'SmsQueueId':{'$in':_0x377d39}},'transaction':_0x320964});})[_0xecfc('0x23')](function(){var _0x468220=_0xecfc('0x60')+_0x4d3c43;return db[_0xecfc('0x53')][_0xecfc('0x2c')](_0x468220,{'type':db[_0xecfc('0x59')][_0xecfc('0x56')]['SELECT'],'raw':!![],'transaction':_0x320964});})[_0xecfc('0x23')](function(_0x854bc4){var _0x36048f=_['map'](_0x854bc4,function(_0xdae3a4){return Number(_0xdae3a4[_0xecfc('0x61')]);});return db[_0xecfc('0x62')][_0xecfc('0x51')]({'where':{'UserId':{'$in':_0x538cfb},'ChatQueueId':{'$in':_0x36048f}},'transaction':_0x320964});})[_0xecfc('0x23')](function(){var _0x5933f6='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4d3c43;return db['sequelize'][_0xecfc('0x2c')](_0x5933f6,{'type':db[_0xecfc('0x59')][_0xecfc('0x56')][_0xecfc('0x57')],'raw':!![],'transaction':_0x320964});})[_0xecfc('0x23')](function(_0x180d4d){var _0x3c193e=_[_0xecfc('0x27')](_0x180d4d,function(_0x17cfae){return Number(_0x17cfae[_0xecfc('0x63')]);});return db[_0xecfc('0x64')][_0xecfc('0x51')]({'where':{'UserId':{'$in':_0x538cfb},'FaxQueueId':{'$in':_0x3c193e}},'transaction':_0x320964});})[_0xecfc('0x23')](function(){var _0x1c71f4=_0xecfc('0x65')+_0x4d3c43;return db[_0xecfc('0x53')]['query'](_0x1c71f4,{'type':db[_0xecfc('0x59')][_0xecfc('0x56')][_0xecfc('0x57')],'raw':!![],'transaction':_0x320964});})[_0xecfc('0x23')](function(_0x52c637){var _0x496b34=_[_0xecfc('0x27')](_0x52c637,function(_0x4f82cd){return Number(_0x4f82cd[_0xecfc('0x66')]);});return db['UserOpenchannelQueue']['destroy']({'where':{'UserId':{'$in':_0x538cfb},'OpenchannelQueueId':{'$in':_0x496b34}},'transaction':_0x320964});})['then'](function(){var _0x426654=_0xecfc('0x67')+_0x4d3c43;return db[_0xecfc('0x53')]['query'](_0x426654,{'type':db['Sequelize'][_0xecfc('0x56')][_0xecfc('0x57')],'raw':!![],'transaction':_0x320964});})[_0xecfc('0x23')](function(_0xc3d67d){var _0x37f359=_['map'](_0xc3d67d,function(_0x2acead){return Number(_0x2acead[_0xecfc('0x68')]);});return db[_0xecfc('0x69')][_0xecfc('0x51')]({'where':{'UserId':{'$in':_0x538cfb},'WhatsappQueueId':{'$in':_0x37f359}},'transaction':_0x320964});})[_0xecfc('0x23')](function(){return db[_0xecfc('0x6a')][_0xecfc('0x4b')]({'where':{'TeamId':_0x4d3c43}});})['then'](function(_0x2e372d){if(_0x2e372d===null){return;}return db['UserVoicePrefix'][_0xecfc('0x51')]({'where':{'UserId':{'$in':_0x538cfb},'VoicePrefixId':_0x2e372d['VoicePrefixId']},'transaction':_0x320964});})['then'](function(){return db[_0xecfc('0x3d')]['destroy']({'where':{'id':_0x4d3c43},'cascade':!![],'transaction':_0x320964});})[_0xecfc('0x23')](function(_0x519db2){if(_0x519db2===0x0){_0x1afdb1[_0xecfc('0x18')](0x194);}else{return db['UserProfileResource'][_0xecfc('0x51')]({'where':{'type':_0xecfc('0x49'),'resourceId':_0x4d3c43},'cascade':!![],'transaction':_0x320964})['then'](function(){_0x1afdb1['status'](0xcc)[_0xecfc('0x1a')]();});}})[_0xecfc('0x41')](function(_0x45b7eb){_0x1afdb1['status'](0x1f4)['send'](_0x45b7eb);});});};exports[_0xecfc('0x6b')]=function(_0x3c15b3,_0x3409a6,_0xd0b013){return db['Team'][_0xecfc('0x6c')]({'where':{'id':_0x3c15b3[_0xecfc('0x52')]['id']}})[_0xecfc('0x23')](handleEntityNotFound(_0x3409a6,null))[_0xecfc('0x23')](function(_0x1544a9){if(!_0x3c15b3[_0xecfc('0x2c')][_0xecfc('0x6d')]||!utils['isValidChannel'](_0x3c15b3[_0xecfc('0x2c')][_0xecfc('0x6d')])){throw new db[(_0xecfc('0x59'))][(_0xecfc('0x6e'))](_0xecfc('0x6f'));}var _0x5979da={};var _0x240ab9={};_0x240ab9[_0xecfc('0x30')]=_[_0xecfc('0x2d')](db[_[_0xecfc('0x70')](_0x3c15b3['query'][_0xecfc('0x6d')][_0xecfc('0x71')]())+_0xecfc('0x72')]['rawAttributes']);_0x240ab9['query']=_[_0xecfc('0x2d')](_0x3c15b3[_0xecfc('0x2c')]);_0x240ab9[_0xecfc('0x2e')]=_[_0xecfc('0x2f')](_0x240ab9[_0xecfc('0x30')],_0x240ab9[_0xecfc('0x2c')]);_0x5979da[_0xecfc('0x33')]=_['intersection'](_0x240ab9[_0xecfc('0x30')],qs[_0xecfc('0x31')](_0x3c15b3[_0xecfc('0x2c')]['fields']));_0x5979da['attributes']=_0x5979da[_0xecfc('0x33')][_0xecfc('0x32')]?_0x5979da[_0xecfc('0x33')]:_0x240ab9['model'];_0x5979da['limit']=qs[_0xecfc('0x1e')](_0x3c15b3[_0xecfc('0x2c')][_0xecfc('0x1e')]);_0x5979da[_0xecfc('0x1c')]=qs[_0xecfc('0x1c')](_0x3c15b3[_0xecfc('0x2c')][_0xecfc('0x1c')]);_0x5979da['order']=qs[_0xecfc('0x37')](_0x3c15b3[_0xecfc('0x2c')][_0xecfc('0x37')]);_0x5979da[_0xecfc('0x38')]=qs[_0xecfc('0x2e')](_[_0xecfc('0x39')](_0x3c15b3[_0xecfc('0x2c')],_0x240ab9[_0xecfc('0x2e')]));_0x5979da=_[_0xecfc('0x3c')]({},_0x5979da,_0x3c15b3[_0xecfc('0x43')]);return _0x1544a9[_0xecfc('0x46')+_[_0xecfc('0x70')](_0x3c15b3[_0xecfc('0x2c')][_0xecfc('0x6d')][_0xecfc('0x71')]())+_0xecfc('0x73')](_0x5979da);})[_0xecfc('0x23')](respondWithResult(_0x3409a6,null))['catch'](handleError(_0x3409a6,null));};exports['addQueues']=function(_0x38076c,_0x3cb725,_0x4ff1be){return db[_0xecfc('0x3d')][_0xecfc('0x6c')]({'where':{'id':_0x38076c[_0xecfc('0x52')]['id']}})[_0xecfc('0x23')](function(_0x5ab255){if(_0x5ab255){if(!_0x38076c['body'][_0xecfc('0x6d')]||!utils['isValidChannel'](_0x38076c['body']['channel'])){throw new db[(_0xecfc('0x59'))]['ValidationError'](_0xecfc('0x6f'));}return _0x5ab255[_0xecfc('0x74')+_['capitalize'](_0x38076c[_0xecfc('0x50')][_0xecfc('0x6d')][_0xecfc('0x71')]())+'Queues'](_0x38076c[_0xecfc('0x50')][_0xecfc('0x75')]);}return null;})['then'](handleEntityNotFound(_0x3cb725,null))[_0xecfc('0x23')](respondWithStatusCode(_0x3cb725,null))[_0xecfc('0x41')](handleError(_0x3cb725,null));};exports[_0xecfc('0x76')]=function(_0x1596fb,_0x2d8552,_0x20bf5a){return db[_0xecfc('0x3d')][_0xecfc('0x6c')]({'where':{'id':_0x1596fb[_0xecfc('0x52')]['id']}})[_0xecfc('0x23')](function(_0x1ce46d){if(_0x1ce46d){if(!_0x1596fb[_0xecfc('0x2c')]['channel']||!utils[_0xecfc('0x77')](_0x1596fb[_0xecfc('0x2c')]['channel'])){throw new db[(_0xecfc('0x59'))][(_0xecfc('0x6e'))](_0xecfc('0x6f'));}return _0x1ce46d[_0xecfc('0x78')+_[_0xecfc('0x70')](_0x1596fb[_0xecfc('0x2c')]['channel'][_0xecfc('0x71')]())+'Queues'](_0x1596fb[_0xecfc('0x2c')][_0xecfc('0x75')]);}return null;})['then'](handleEntityNotFound(_0x2d8552,null))['then'](respondWithStatusCode(_0x2d8552,null))[_0xecfc('0x41')](handleError(_0x2d8552,null));};exports[_0xecfc('0x79')]=function(_0x866792,_0x338387){var _0x32325c=_[_0xecfc('0x7a')](_0x866792['body'][_0xecfc('0x75')])?_0x866792[_0xecfc('0x50')][_0xecfc('0x75')]:[_0x866792[_0xecfc('0x50')][_0xecfc('0x75')]];var _0x48f2d5=_0x866792[_0xecfc('0x52')]['id'];return db['Team'][_0xecfc('0x4b')]({'where':{'id':_0x48f2d5}})[_0xecfc('0x23')](handleEntityNotFound(_0x338387,null))[_0xecfc('0x23')](function(_0x3d912c){if(_0x3d912c){var _0x365495=[_0xecfc('0x7b'),_0xecfc('0x7c'),_0xecfc('0x7d'),_0xecfc('0x7e'),'Fax',_0xecfc('0x7f'),'Whatsapp'];return db[_0xecfc('0x53')]['transaction'](function(_0x3e83e2){var _0x50d83c=_['map'](_0x365495,function(_0x111b8d){var _0x53c725={'attributes':['id',_0xecfc('0x24')]};if(_0x111b8d===_0xecfc('0x7b')){_0x53c725[_0xecfc('0x80')]={'attributes':[_0xecfc('0x81')]};}return _0x3d912c[_0xecfc('0x46')+_0x111b8d+'Queues'](_0x53c725)[_0xecfc('0x23')](function(_0x36ac87){var _0x365aa8=_[_0xecfc('0x27')](_0x36ac87,function(_0x336bbd){var _0xf407fe=_[_0xecfc('0x27')](_0x32325c,function(_0x21ff77){var _0x81a5bb={'where':{'UserId':_0x21ff77,[_0x111b8d+_0xecfc('0x82')]:_0x336bbd['id']},'transaction':_0x3e83e2};if(_0x111b8d===_0xecfc('0x7b')){_0x81a5bb[_0xecfc('0x83')]={'penalty':_0x336bbd['TeamVoiceQueue'][_0xecfc('0x81')]};}return db[_0xecfc('0x84')+_0x111b8d+_0xecfc('0x72')][_0xecfc('0x85')](_0x81a5bb)[_0xecfc('0x23')](function(){socket[_0xecfc('0x86')](_0xecfc('0x45')+_0x111b8d+_0xecfc('0x87'),{'UserId':_0x21ff77,[_0x111b8d+_0xecfc('0x82')]:_0x336bbd['id']});if(_0x111b8d!=='Voice'){return;}return db[_0xecfc('0x84')][_0xecfc('0x40')]({'where':{'id':_0x32325c,'online':0x1},'attributes':['id',_0xecfc('0x24'),_0xecfc('0x88'),_0xecfc('0x89'),_0xecfc('0x8a')],'raw':!![]})[_0xecfc('0x23')](function(_0xfd1926){var _0xba32ed=_[_0xecfc('0x27')](_0xfd1926,function(_0xf4faf9){return db[_0xecfc('0x8b')][_0xecfc('0x8c')]({'membername':_0xf4faf9['name'],'UserId':_0xf4faf9['id'],'queue_name':_0x336bbd[_0xecfc('0x24')],'VoiceQueueId':_0x336bbd['id'],'interface':_[_0xecfc('0x8d')](_0xf4faf9['interface'])?util[_0xecfc('0x8e')](_0xecfc('0x8f'),_0xf4faf9[_0xecfc('0x24')]):_0xf4faf9[_0xecfc('0x8a')],'paused':_0xf4faf9[_0xecfc('0x89')]||![],'penalty':_0x336bbd[_0xecfc('0x90')][_0xecfc('0x81')]},{'transaction':_0x3e83e2});});return Promise[_0xecfc('0x91')](_0xba32ed);});});});return Promise['all'](_0xf407fe);});return Promise['all'](_0x365aa8);})['then'](function(){return db[_0xecfc('0x6a')]['findOne']({'where':{'teamId':_0x48f2d5}})['then'](function(_0x3645bc){if(_0x3645bc){var _0x20071f=_[_0xecfc('0x27')](_0x32325c,function(_0x4ef338){db[_0xecfc('0x92')][_0xecfc('0x8c')]({'UserId':_0x4ef338,'VoicePrefixId':_0x3645bc[_0xecfc('0x93')]});});return Promise[_0xecfc('0x91')](_0x20071f);}});});});return Promise[_0xecfc('0x91')](_0x50d83c)[_0xecfc('0x23')](function(){return _0x3d912c[_0xecfc('0x79')](_0x32325c,{'transaction':_0x3e83e2})[_0xecfc('0x94')](function(_0x2eaf51){return _0x2eaf51;});});});}})[_0xecfc('0x23')](respondWithResult(_0x338387,null))[_0xecfc('0x41')](handleError(_0x338387,null));};exports[_0xecfc('0x95')]=function(_0x3c5188,_0x33a73e){var _0x300e64=_['isArray'](_0x3c5188[_0xecfc('0x2c')][_0xecfc('0x75')])?_0x3c5188[_0xecfc('0x2c')][_0xecfc('0x75')]:[_0x3c5188[_0xecfc('0x2c')]['ids']];var _0x28490b=_0x3c5188[_0xecfc('0x52')]['id'];return db[_0xecfc('0x3d')][_0xecfc('0x4b')]({'where':{'id':_0x28490b}})['then'](handleEntityNotFound(_0x33a73e,null))[_0xecfc('0x23')](function(_0x2d57af){if(_0x2d57af){var _0x25b08c=[_0xecfc('0x7b'),_0xecfc('0x7c'),_0xecfc('0x7d'),_0xecfc('0x7e'),'Fax',_0xecfc('0x7f'),_0xecfc('0x96')];return db[_0xecfc('0x53')][_0xecfc('0x54')](function(_0x1d34df){var _0xf72b8d=_[_0xecfc('0x27')](_0x25b08c,function(_0x55a907){var _0x3ae935={'attributes':['id',_0xecfc('0x24')]};return _0x2d57af['get'+_0x55a907+_0xecfc('0x73')](_0x3ae935)[_0xecfc('0x23')](function(_0x20b727){var _0x3c887e=_[_0xecfc('0x27')](_0x20b727,function(_0x3f5af5){return _0x3f5af5[_0xecfc('0x95')](_0x300e64,{'transaction':_0x1d34df})[_0xecfc('0x23')](function(){var _0x4ce4c9=_[_0xecfc('0x27')](_0x300e64,function(_0x3e60a1){socket['emit']('user'+_0x55a907+_0xecfc('0x97'),{'UserId':Number(_0x3e60a1),[_0x55a907+_0xecfc('0x82')]:_0x3f5af5['id']});if(_0x55a907!==_0xecfc('0x7b')){return;}return db[_0xecfc('0x8b')]['destroy']({'where':{'VoiceQueueId':_0x3f5af5['id'],'UserId':_0x3e60a1},'transaction':_0x1d34df});});return Promise[_0xecfc('0x91')](_0x4ce4c9);});});return Promise[_0xecfc('0x91')](_0x3c887e);});});return Promise[_0xecfc('0x91')](_0xf72b8d)[_0xecfc('0x23')](function(){return _0x2d57af[_0xecfc('0x95')](_0x300e64,{'transaction':_0x1d34df});})['then'](function(){return db[_0xecfc('0x6a')][_0xecfc('0x6c')]({'where':{'teamId':_0x28490b}})[_0xecfc('0x23')](function(_0x143fef){if(_0x143fef){var _0x33b17b=_['map'](_0x300e64,function(_0x2b9462){db[_0xecfc('0x92')][_0xecfc('0x51')]({'where':{'UserId':_0x2b9462,'VoicePrefixId':_0x143fef[_0xecfc('0x93')]}});});return Promise[_0xecfc('0x91')](_0x33b17b);}});});});}})[_0xecfc('0x23')](respondWithStatusCode(_0x33a73e,null))[_0xecfc('0x41')](handleError(_0x33a73e,null));};exports[_0xecfc('0x98')]=function(_0x5d5bc3,_0x132d32,_0x145e2b){var _0x4a0ff0={};var _0x4cfaed={};var _0x3608ba;var _0x10b52e;return db[_0xecfc('0x3d')][_0xecfc('0x6c')]({'where':{'id':_0x5d5bc3['params']['id']}})[_0xecfc('0x23')](handleEntityNotFound(_0x132d32,null))[_0xecfc('0x23')](function(_0x1ed989){if(_0x1ed989){_0x3608ba=_0x1ed989;_0x4cfaed[_0xecfc('0x30')]=_['keys'](db[_0xecfc('0x84')]['rawAttributes']);_0x4cfaed[_0xecfc('0x2c')]=_['keys'](_0x5d5bc3[_0xecfc('0x2c')]);_0x4cfaed[_0xecfc('0x2e')]=_[_0xecfc('0x2f')](_0x4cfaed['model'],_0x4cfaed[_0xecfc('0x2c')]);_0x4a0ff0[_0xecfc('0x33')]=_[_0xecfc('0x2f')](_0x4cfaed[_0xecfc('0x30')],qs[_0xecfc('0x31')](_0x5d5bc3[_0xecfc('0x2c')][_0xecfc('0x31')]));_0x4a0ff0[_0xecfc('0x33')]=_0x4a0ff0['attributes'][_0xecfc('0x32')]?_0x4a0ff0[_0xecfc('0x33')]:_0x4cfaed[_0xecfc('0x30')];_0x4a0ff0['order']=qs[_0xecfc('0x37')](_0x5d5bc3['query'][_0xecfc('0x37')]);_0x4a0ff0[_0xecfc('0x38')]=qs['filters'](_[_0xecfc('0x39')](_0x5d5bc3[_0xecfc('0x2c')],_0x4cfaed['filters']));if(_0x5d5bc3[_0xecfc('0x2c')][_0xecfc('0x3a')]){_0x4a0ff0['where']=_[_0xecfc('0x3c')](_0x4a0ff0[_0xecfc('0x38')],{'$or':_[_0xecfc('0x27')](_0x4a0ff0[_0xecfc('0x33')],function(_0x5a5028){var _0x5511c0={};_0x5511c0[_0x5a5028]={'$like':'%'+_0x5d5bc3[_0xecfc('0x2c')][_0xecfc('0x3a')]+'%'};return _0x5511c0;})});}_0x4a0ff0=_['merge']({},_0x4a0ff0,_0x5d5bc3['options']);return _0x3608ba[_0xecfc('0x98')](_0x4a0ff0);}})[_0xecfc('0x23')](function(_0x5b513a){if(_0x5b513a){_0x10b52e=_0x5b513a['length'];if(!_0x5d5bc3[_0xecfc('0x2c')][_0xecfc('0x34')]('nolimit')){_0x4a0ff0[_0xecfc('0x1e')]=qs['limit'](_0x5d5bc3[_0xecfc('0x2c')]['limit']);_0x4a0ff0[_0xecfc('0x1c')]=qs['offset'](_0x5d5bc3[_0xecfc('0x2c')]['offset']);}return _0x3608ba[_0xecfc('0x98')](_0x4a0ff0);}})[_0xecfc('0x23')](function(_0x2f05b4){if(_0x2f05b4){return _0x2f05b4?{'count':_0x10b52e,'rows':_0x2f05b4}:null;}})['then'](respondWithResult(_0x132d32,null))[_0xecfc('0x41')](handleError(_0x132d32,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index f57000f..5a19b26 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 _0x03d4=['exports','../../mysqldb','Team','save','emit','hasOwnProperty'];(function(_0x3c2166,_0x41fc16){var _0x30ccc3=function(_0x689bc3){while(--_0x689bc3){_0x3c2166['push'](_0x3c2166['shift']());}};_0x30ccc3(++_0x41fc16);}(_0x03d4,0xdf));var _0x403d=function(_0x521097,_0x3b6465){_0x521097=_0x521097-0x0;var _0x22fa9e=_0x03d4[_0x521097];return _0x22fa9e;};'use strict';var EventEmitter=require('events');var Team=require(_0x403d('0x0'))['db'][_0x403d('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x403d('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x581ecc){return function(_0x549681,_0x1f8813,_0x79af97){TeamEvents[_0x403d('0x3')](_0x581ecc+':'+_0x549681['id'],_0x549681);TeamEvents[_0x403d('0x3')](_0x581ecc,_0x549681);_0x79af97(null);};}for(var e in events){if(events[_0x403d('0x4')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x403d('0x5')]=TeamEvents; \ No newline at end of file +var _0xeb14=['hook','events','../../mysqldb','Team','setMaxListeners','update','emit'];(function(_0x302922,_0x35a295){var _0x5ea880=function(_0x13a009){while(--_0x13a009){_0x302922['push'](_0x302922['shift']());}};_0x5ea880(++_0x35a295);}(_0xeb14,0xbe));var _0x4eb1=function(_0x3a315a,_0x555f8a){_0x3a315a=_0x3a315a-0x0;var _0xba15e0=_0xeb14[_0x3a315a];return _0xba15e0;};'use strict';var EventEmitter=require(_0x4eb1('0x0'));var Team=require(_0x4eb1('0x1'))['db'][_0x4eb1('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x4eb1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4eb1('0x4'),'afterDestroy':'remove'};function emitEvent(_0x24c1f8){return function(_0x3d2c95,_0x5a7369,_0x24ceb7){TeamEvents['emit'](_0x24c1f8+':'+_0x3d2c95['id'],_0x3d2c95);TeamEvents[_0x4eb1('0x5')](_0x24c1f8,_0x3d2c95);_0x24ceb7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x4eb1('0x6')](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 df6fccd..b783198 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 _0xa2a4=['Queues','then','map','setDataValue','channel','catch','define','teams','Fax','Mail','Sms','Voice','Whatsapp','resolve','all','lodash','./team.attributes','get'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xa2a4,0xe7));var _0x4a2a=function(_0x15f6ca,_0x3c4ad0){_0x15f6ca=_0x15f6ca-0x0;var _0x5ef434=_0xa2a4[_0x15f6ca];return _0x5ef434;};'use strict';var _=require(_0x4a2a('0x0'));var attributes=require(_0x4a2a('0x1'));function getQueuesByChannel(_0x4d324f,_0x54a6c6){var _0xb1472f=_0x4a2a('0x2')+_0x54a6c6+_0x4a2a('0x3');return _0x4d324f[_0xb1472f]()[_0x4a2a('0x4')](function(_0xea81c6){return _[_0x4a2a('0x5')](_0xea81c6,function(_0x20542b){_0x20542b[_0x4a2a('0x6')](_0x4a2a('0x7'),_0x54a6c6);return _0x20542b;});})[_0x4a2a('0x8')](function(_0x3622f0){throw _0x3622f0;});}module['exports']=function(_0x3856b8){return _0x3856b8[_0x4a2a('0x9')]('Team',attributes,{'tableName':_0x4a2a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x3da0c1=this;var _0x2f764a=['Chat',_0x4a2a('0xb'),_0x4a2a('0xc'),'Openchannel',_0x4a2a('0xd'),_0x4a2a('0xe'),_0x4a2a('0xf')];return Promise[_0x4a2a('0x10')]()[_0x4a2a('0x4')](function(){var _0x5c70e5=_['map'](_0x2f764a,function(_0x4c37bf){return getQueuesByChannel(_0x3da0c1,_0x4c37bf);});return Promise[_0x4a2a('0x11')](_0x5c70e5);})[_0x4a2a('0x8')](function(_0x13927f){throw _0x13927f;});}}});}; \ No newline at end of file +var _0x0b68=['Sms','Voice','resolve','all','lodash','Queues','then','map','setDataValue','channel','catch','exports','define','Team','teams','Chat','Fax','Mail','Openchannel'];(function(_0x268db8,_0x5609d7){var _0x461eb2=function(_0x4f3f48){while(--_0x4f3f48){_0x268db8['push'](_0x268db8['shift']());}};_0x461eb2(++_0x5609d7);}(_0x0b68,0x15a));var _0x80b6=function(_0x1dbd56,_0x28579b){_0x1dbd56=_0x1dbd56-0x0;var _0x31d425=_0x0b68[_0x1dbd56];return _0x31d425;};'use strict';var _=require(_0x80b6('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0x1801bd,_0x2a753e){var _0x185036='get'+_0x2a753e+_0x80b6('0x1');return _0x1801bd[_0x185036]()[_0x80b6('0x2')](function(_0x312e73){return _[_0x80b6('0x3')](_0x312e73,function(_0x5db084){_0x5db084[_0x80b6('0x4')](_0x80b6('0x5'),_0x2a753e);return _0x5db084;});})[_0x80b6('0x6')](function(_0x3e1e62){throw _0x3e1e62;});}module[_0x80b6('0x7')]=function(_0x358796){return _0x358796[_0x80b6('0x8')](_0x80b6('0x9'),attributes,{'tableName':_0x80b6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x140425=this;var _0x3a6671=[_0x80b6('0xb'),_0x80b6('0xc'),_0x80b6('0xd'),_0x80b6('0xe'),_0x80b6('0xf'),_0x80b6('0x10'),'Whatsapp'];return Promise[_0x80b6('0x11')]()[_0x80b6('0x2')](function(){var _0x14e167=_[_0x80b6('0x3')](_0x3a6671,function(_0x3e394e){return getQueuesByChannel(_0x140425,_0x3e394e);});return Promise[_0x80b6('0x12')](_0x14e167);})['catch'](function(_0x4fb76a){throw _0x4fb76a;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 7068b86..20061d2 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 _0x05e7=['request\x20sent','debug','error','Team,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./team.socket','then','info'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x05e7,0x1c9));var _0x705e=function(_0xc2261d,_0x16d759){_0xc2261d=_0xc2261d-0x0;var _0x12d0fe=_0x05e7[_0xc2261d];return _0x12d0fe;};'use strict';var _=require(_0x705e('0x0'));var util=require(_0x705e('0x1'));var moment=require(_0x705e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x705e('0x3'));var db=require(_0x705e('0x4'))['db'];var utils=require(_0x705e('0x5'));var logger=require(_0x705e('0x6'))(_0x705e('0x7'));var config=require(_0x705e('0x8'));var jayson=require(_0x705e('0x9'));var client=jayson[_0x705e('0xa')][_0x705e('0xb')]({'port':0x232a});config[_0x705e('0xc')]=_['defaults'](config[_0x705e('0xc')],{'host':_0x705e('0xd'),'port':0x18eb});var socket=require(_0x705e('0xe'))(new Redis(config[_0x705e('0xc')]));require(_0x705e('0xf'))['register'](socket);function respondWithRpcPromise(_0x51a9a3,_0x41f34a,_0x457cf6){return new BPromise(function(_0x23f9c5,_0x4b1eac){return client['request'](_0x51a9a3,_0x457cf6)[_0x705e('0x10')](function(_0x1266e0){logger[_0x705e('0x11')]('Team,\x20%s,\x20%s',_0x41f34a,_0x705e('0x12'));logger[_0x705e('0x13')]('Team,\x20%s,\x20%s,\x20%s',_0x41f34a,_0x705e('0x12'),JSON['stringify'](_0x1266e0));if(_0x1266e0['error']){if(_0x1266e0['error']['code']===0x1f4){logger[_0x705e('0x14')](_0x705e('0x15'),_0x41f34a,_0x1266e0[_0x705e('0x14')][_0x705e('0x16')]);return _0x4b1eac(_0x1266e0[_0x705e('0x14')][_0x705e('0x16')]);}logger[_0x705e('0x14')](_0x705e('0x15'),_0x41f34a,_0x1266e0[_0x705e('0x14')][_0x705e('0x16')]);return _0x23f9c5(_0x1266e0[_0x705e('0x14')][_0x705e('0x16')]);}else{logger[_0x705e('0x11')](_0x705e('0x15'),_0x41f34a,'request\x20sent');_0x23f9c5(_0x1266e0[_0x705e('0x17')]['message']);}})[_0x705e('0x18')](function(_0x3e7206){logger[_0x705e('0x14')](_0x705e('0x15'),_0x41f34a,_0x3e7206);_0x4b1eac(_0x3e7206);});});} \ No newline at end of file +var _0x1d17=['request\x20sent','debug','stringify','error','message','info','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','./team.socket','register','request','Team,\x20%s,\x20%s'];(function(_0x5216e0,_0x4f8cb9){var _0x5b3f40=function(_0x30c832){while(--_0x30c832){_0x5216e0['push'](_0x5216e0['shift']());}};_0x5b3f40(++_0x4f8cb9);}(_0x1d17,0x157));var _0x71d1=function(_0x5609be,_0x4c500d){_0x5609be=_0x5609be-0x0;var _0x44c606=_0x1d17[_0x5609be];return _0x44c606;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x71d1('0x0'));var BPromise=require(_0x71d1('0x1'));var rs=require(_0x71d1('0x2'));var fs=require('fs');var Redis=require(_0x71d1('0x3'));var db=require(_0x71d1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x71d1('0x5'))(_0x71d1('0x6'));var config=require(_0x71d1('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x71d1('0x8')]({'port':0x232a});config['redis']=_[_0x71d1('0x9')](config[_0x71d1('0xa')],{'host':_0x71d1('0xb'),'port':0x18eb});var socket=require(_0x71d1('0xc'))(new Redis(config[_0x71d1('0xa')]));require(_0x71d1('0xd'))[_0x71d1('0xe')](socket);function respondWithRpcPromise(_0x2a5134,_0x3f0ad5,_0x29e30e){return new BPromise(function(_0x28d2b1,_0x3ec893){return client[_0x71d1('0xf')](_0x2a5134,_0x29e30e)['then'](function(_0x4f9047){logger['info'](_0x71d1('0x10'),_0x3f0ad5,_0x71d1('0x11'));logger[_0x71d1('0x12')]('Team,\x20%s,\x20%s,\x20%s',_0x3f0ad5,_0x71d1('0x11'),JSON[_0x71d1('0x13')](_0x4f9047));if(_0x4f9047['error']){if(_0x4f9047[_0x71d1('0x14')]['code']===0x1f4){logger[_0x71d1('0x14')](_0x71d1('0x10'),_0x3f0ad5,_0x4f9047[_0x71d1('0x14')][_0x71d1('0x15')]);return _0x3ec893(_0x4f9047[_0x71d1('0x14')][_0x71d1('0x15')]);}logger[_0x71d1('0x14')](_0x71d1('0x10'),_0x3f0ad5,_0x4f9047[_0x71d1('0x14')][_0x71d1('0x15')]);return _0x28d2b1(_0x4f9047[_0x71d1('0x14')][_0x71d1('0x15')]);}else{logger[_0x71d1('0x16')]('Team,\x20%s,\x20%s',_0x3f0ad5,'request\x20sent');_0x28d2b1(_0x4f9047[_0x71d1('0x17')][_0x71d1('0x15')]);}})['catch'](function(_0x9e3f2f){logger[_0x71d1('0x14')](_0x71d1('0x10'),_0x3f0ad5,_0x9e3f2f);_0x3ec893(_0x9e3f2f);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 33149c7..9a6ff95 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 _0x9086=['emit','removeListener','length','./team.events','save','update'];(function(_0x112a45,_0x53b763){var _0x2d0888=function(_0x41cd6e){while(--_0x41cd6e){_0x112a45['push'](_0x112a45['shift']());}};_0x2d0888(++_0x53b763);}(_0x9086,0x10b));var _0x6908=function(_0x514451,_0x350f4e){_0x514451=_0x514451-0x0;var _0x588103=_0x9086[_0x514451];return _0x588103;};'use strict';var TeamEvents=require(_0x6908('0x0'));var events=[_0x6908('0x1'),'remove',_0x6908('0x2')];function createListener(_0x3f95e4,_0x38d58b){return function(_0x230e29){_0x38d58b[_0x6908('0x3')](_0x3f95e4,_0x230e29);};}function removeListener(_0x1a49e1,_0x4b8a45){return function(){TeamEvents[_0x6908('0x4')](_0x1a49e1,_0x4b8a45);};}exports['register']=function(_0x578f7a){for(var _0xecf3b7=0x0,_0x4e8ff0=events[_0x6908('0x5')];_0xecf3b7<_0x4e8ff0;_0xecf3b7++){var _0x2049a1=events[_0xecf3b7];var _0x2ce577=createListener('team:'+_0x2049a1,_0x578f7a);TeamEvents['on'](_0x2049a1,_0x2ce577);}}; \ No newline at end of file +var _0xe9e8=['update','emit','removeListener','register','length','team:','./team.events','save'];(function(_0x35c5a8,_0x8ecb48){var _0x34782c=function(_0x1b23ec){while(--_0x1b23ec){_0x35c5a8['push'](_0x35c5a8['shift']());}};_0x34782c(++_0x8ecb48);}(_0xe9e8,0x7e));var _0x8e9e=function(_0x526b20,_0x5401c3){_0x526b20=_0x526b20-0x0;var _0x2413e8=_0xe9e8[_0x526b20];return _0x2413e8;};'use strict';var TeamEvents=require(_0x8e9e('0x0'));var events=[_0x8e9e('0x1'),'remove',_0x8e9e('0x2')];function createListener(_0x3c203b,_0x3c5256){return function(_0x345cdf){_0x3c5256[_0x8e9e('0x3')](_0x3c203b,_0x345cdf);};}function removeListener(_0x16ce4b,_0x482731){return function(){TeamEvents[_0x8e9e('0x4')](_0x16ce4b,_0x482731);};}exports[_0x8e9e('0x5')]=function(_0x217e7e){for(var _0xded6f7=0x0,_0x5cdd95=events[_0x8e9e('0x6')];_0xded6f7<_0x5cdd95;_0xded6f7++){var _0x12eaae=events[_0xded6f7];var _0x244836=createListener(_0x8e9e('0x7')+_0x12eaae,_0x217e7e);TeamEvents['on'](_0x12eaae,_0x244836);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 00546c1..4514538 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd691=['exports','INTEGER','sequelize'];(function(_0xcd799d,_0x10f1dd){var _0x1f65e1=function(_0x3e3067){while(--_0x3e3067){_0xcd799d['push'](_0xcd799d['shift']());}};_0x1f65e1(++_0x10f1dd);}(_0xd691,0xe6));var _0x1d69=function(_0x55da99,_0x4a6b0c){_0x55da99=_0x55da99-0x0;var _0x575612=_0xd691[_0x55da99];return _0x575612;};'use strict';var Sequelize=require(_0x1d69('0x0'));module[_0x1d69('0x1')]={'TeamId':{'type':Sequelize[_0x1d69('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x9b83=['sequelize','exports','INTEGER'];(function(_0x456548,_0x100afe){var _0x3e54f5=function(_0x2714e8){while(--_0x2714e8){_0x456548['push'](_0x456548['shift']());}};_0x3e54f5(++_0x100afe);}(_0x9b83,0x84));var _0x39b8=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0x9b83[_0x26b80e];return _0x84a8a8;};'use strict';var Sequelize=require(_0x39b8('0x0'));module[_0x39b8('0x1')]={'TeamId':{'type':Sequelize[_0x39b8('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x39b8('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index d1715bb..fb555cb 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.model.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7cdc=['exports','define','TeamVoicePrefix','team_has_voice_prefixes','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x285e38,_0x45eff5){var _0x1d4609=function(_0x277d61){while(--_0x277d61){_0x285e38['push'](_0x285e38['shift']());}};_0x1d4609(++_0x45eff5);}(_0x7cdc,0x190));var _0xc7cd=function(_0x444e09,_0x4e76f2){_0x444e09=_0x444e09-0x0;var _0x43bea3=_0x7cdc[_0x444e09];return _0x43bea3;};'use strict';var _=require('lodash');var util=require(_0xc7cd('0x0'));var logger=require(_0xc7cd('0x1'))('api');var moment=require(_0xc7cd('0x2'));var BPromise=require(_0xc7cd('0x3'));var rp=require(_0xc7cd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc7cd('0x5'));var config=require(_0xc7cd('0x6'));var attributes=require('./teamVoicePrefix.attributes');module[_0xc7cd('0x7')]=function(_0x26603f,_0x18bb1b){return _0x26603f[_0xc7cd('0x8')](_0xc7cd('0x9'),attributes,{'tableName':_0xc7cd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xba5a=['path','rimraf','../../config/environment','TeamVoicePrefix','team_has_voice_prefixes','util','../../config/logger','api','request-promise'];(function(_0x35d6d1,_0x2124c6){var _0x1de478=function(_0x1fe553){while(--_0x1fe553){_0x35d6d1['push'](_0x35d6d1['shift']());}};_0x1de478(++_0x2124c6);}(_0xba5a,0x1d0));var _0xaba5=function(_0x52ae40,_0x23c2bf){_0x52ae40=_0x52ae40-0x0;var _0xab6ed1=_0xba5a[_0x52ae40];return _0xab6ed1;};'use strict';var _=require('lodash');var util=require(_0xaba5('0x0'));var logger=require(_0xaba5('0x1'))(_0xaba5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xaba5('0x3'));var fs=require('fs');var path=require(_0xaba5('0x4'));var rimraf=require(_0xaba5('0x5'));var config=require(_0xaba5('0x6'));var attributes=require('./teamVoicePrefix.attributes');module['exports']=function(_0x58b605,_0x35a186){return _0x58b605['define'](_0xaba5('0x7'),attributes,{'tableName':_0xaba5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 9f506c2..8a794e7 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5e7316,_0x27528a){var _0x34af83=function(_0x17aa38){while(--_0x17aa38){_0x5e7316['push'](_0x5e7316['shift']());}};_0x34af83(++_0x27528a);}(_0x70e0,0x17b));var _0x070e=function(_0x524773,_0x1e1893){_0x524773=_0x524773-0x0;var _0x196e4f=_0x70e0[_0x524773];return _0x196e4f;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xca5dcc,_0x31af8e){var _0xcb17f9=function(_0x2756d3){while(--_0x2756d3){_0xca5dcc['push'](_0xca5dcc['shift']());}};_0xcb17f9(++_0x31af8e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 99f6667..cb800d4 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xece3=['exports','INTEGER'];(function(_0x5884c1,_0x1938e2){var _0x58282a=function(_0x5d29fa){while(--_0x5d29fa){_0x5884c1['push'](_0x5884c1['shift']());}};_0x58282a(++_0x1938e2);}(_0xece3,0x102));var _0x3ece=function(_0x3b8bb3,_0x29136d){_0x3b8bb3=_0x3b8bb3-0x0;var _0x420eb8=_0xece3[_0x3b8bb3];return _0x420eb8;};'use strict';var Sequelize=require('sequelize');module[_0x3ece('0x0')]={'penalty':{'type':Sequelize[_0x3ece('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf421=['exports','INTEGER'];(function(_0x685346,_0x3ef2e5){var _0x52e15b=function(_0x4435da){while(--_0x4435da){_0x685346['push'](_0x685346['shift']());}};_0x52e15b(++_0x3ef2e5);}(_0xf421,0x64));var _0x1f42=function(_0x1f5303,_0x354414){_0x1f5303=_0x1f5303-0x0;var _0x84ef1a=_0xf421[_0x1f5303];return _0x84ef1a;};'use strict';var Sequelize=require('sequelize');module[_0x1f42('0x0')]={'penalty':{'type':Sequelize[_0x1f42('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index d2a4d86..dfa9c35 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.model.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ebf=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','define','TeamVoiceQueue','team_has_voice_queues'];(function(_0x468301,_0x470230){var _0x31b3cf=function(_0x51f42c){while(--_0x51f42c){_0x468301['push'](_0x468301['shift']());}};_0x31b3cf(++_0x470230);}(_0x8ebf,0x15c));var _0xf8eb=function(_0x38ff1e,_0x3b9385){_0x38ff1e=_0x38ff1e-0x0;var _0x3755d4=_0x8ebf[_0x38ff1e];return _0x3755d4;};'use strict';var _=require(_0xf8eb('0x0'));var util=require(_0xf8eb('0x1'));var logger=require(_0xf8eb('0x2'))('api');var moment=require(_0xf8eb('0x3'));var BPromise=require(_0xf8eb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf8eb('0x5'));var rimraf=require(_0xf8eb('0x6'));var config=require(_0xf8eb('0x7'));var attributes=require('./teamVoiceQueue.attributes');module[_0xf8eb('0x8')]=function(_0x36fde3,_0x4cbeaa){return _0x36fde3[_0xf8eb('0x9')](_0xf8eb('0xa'),attributes,{'tableName':_0xf8eb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa25a=['rimraf','exports','define','TeamVoiceQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x421c51,_0x46e2fd){var _0x378bd7=function(_0x44678c){while(--_0x44678c){_0x421c51['push'](_0x421c51['shift']());}};_0x378bd7(++_0x46e2fd);}(_0xa25a,0x160));var _0xaa25=function(_0x5f0575,_0x5e0da9){_0x5f0575=_0x5f0575-0x0;var _0xa7a1fa=_0xa25a[_0x5f0575];return _0xa7a1fa;};'use strict';var _=require(_0xaa25('0x0'));var util=require(_0xaa25('0x1'));var logger=require(_0xaa25('0x2'))(_0xaa25('0x3'));var moment=require(_0xaa25('0x4'));var BPromise=require(_0xaa25('0x5'));var rp=require(_0xaa25('0x6'));var fs=require('fs');var path=require(_0xaa25('0x7'));var rimraf=require(_0xaa25('0x8'));var config=require('../../config/environment');var attributes=require('./teamVoiceQueue.attributes');module[_0xaa25('0x9')]=function(_0x866fa1,_0x51ce9a){return _0x866fa1[_0xaa25('0xa')](_0xaa25('0xb'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index d9796a6..448c595 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb6b1=['catch','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','TeamVoiceQueue,\x20%s,\x20%s','message','info','result'];(function(_0x30fdd2,_0x54f9a1){var _0x4fce53=function(_0x3d7ed2){while(--_0x3d7ed2){_0x30fdd2['push'](_0x30fdd2['shift']());}};_0x4fce53(++_0x54f9a1);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x421263,_0x18187d){_0x421263=_0x421263-0x0;var _0x34e4b5=_0xb6b1[_0x421263];return _0x34e4b5;};'use strict';var _=require(_0x1b6b('0x0'));var util=require('util');var moment=require(_0x1b6b('0x1'));var BPromise=require('bluebird');var rs=require(_0x1b6b('0x2'));var fs=require('fs');var Redis=require(_0x1b6b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b6b('0x4'));var logger=require('../../config/logger')(_0x1b6b('0x5'));var config=require(_0x1b6b('0x6'));var jayson=require(_0x1b6b('0x7'));var client=jayson[_0x1b6b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41d09e,_0x51cfed,_0xae4115){return new BPromise(function(_0x5042f7,_0x21f403){return client[_0x1b6b('0x9')](_0x41d09e,_0xae4115)[_0x1b6b('0xa')](function(_0x29258a){logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x51cfed,_0x1b6b('0xb'));logger[_0x1b6b('0xc')](_0x1b6b('0xd'),_0x51cfed,_0x1b6b('0xb'),JSON[_0x1b6b('0xe')](_0x29258a));if(_0x29258a[_0x1b6b('0xf')]){if(_0x29258a[_0x1b6b('0xf')]['code']===0x1f4){logger[_0x1b6b('0xf')](_0x1b6b('0x10'),_0x51cfed,_0x29258a[_0x1b6b('0xf')]['message']);return _0x21f403(_0x29258a[_0x1b6b('0xf')]['message']);}logger['error'](_0x1b6b('0x10'),_0x51cfed,_0x29258a[_0x1b6b('0xf')][_0x1b6b('0x11')]);return _0x5042f7(_0x29258a[_0x1b6b('0xf')][_0x1b6b('0x11')]);}else{logger[_0x1b6b('0x12')](_0x1b6b('0x10'),_0x51cfed,'request\x20sent');_0x5042f7(_0x29258a[_0x1b6b('0x13')][_0x1b6b('0x11')]);}})[_0x1b6b('0x14')](function(_0x33dc7e){logger['error'](_0x1b6b('0x10'),_0x51cfed,_0x33dc7e);_0x21f403(_0x33dc7e);});});} \ No newline at end of file +var _0xfa4b=['ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring'];(function(_0x44268d,_0xad8443){var _0x4be92d=function(_0x8a57ff){while(--_0x8a57ff){_0x44268d['push'](_0x44268d['shift']());}};_0x4be92d(++_0xad8443);}(_0xfa4b,0x175));var _0xbfa4=function(_0x5e4456,_0x3aef56){_0x5e4456=_0x5e4456-0x0;var _0x311747=_0xfa4b[_0x5e4456];return _0x311747;};'use strict';var _=require(_0xbfa4('0x0'));var util=require(_0xbfa4('0x1'));var moment=require(_0xbfa4('0x2'));var BPromise=require(_0xbfa4('0x3'));var rs=require(_0xbfa4('0x4'));var fs=require('fs');var Redis=require(_0xbfa4('0x5'));var db=require(_0xbfa4('0x6'))['db'];var utils=require(_0xbfa4('0x7'));var logger=require('../../config/logger')(_0xbfa4('0x8'));var config=require('../../config/environment');var jayson=require(_0xbfa4('0x9'));var client=jayson['client'][_0xbfa4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21c828,_0x3488eb,_0x1696bb){return new BPromise(function(_0x64eeb7,_0x5c7502){return client[_0xbfa4('0xb')](_0x21c828,_0x1696bb)['then'](function(_0x5224cb){logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x3488eb,_0xbfa4('0xc'));logger['debug'](_0xbfa4('0xd'),_0x3488eb,_0xbfa4('0xc'),JSON[_0xbfa4('0xe')](_0x5224cb));if(_0x5224cb['error']){if(_0x5224cb[_0xbfa4('0xf')][_0xbfa4('0x10')]===0x1f4){logger['error'](_0xbfa4('0x11'),_0x3488eb,_0x5224cb['error'][_0xbfa4('0x12')]);return _0x5c7502(_0x5224cb[_0xbfa4('0xf')]['message']);}logger[_0xbfa4('0xf')](_0xbfa4('0x11'),_0x3488eb,_0x5224cb[_0xbfa4('0xf')][_0xbfa4('0x12')]);return _0x64eeb7(_0x5224cb[_0xbfa4('0xf')][_0xbfa4('0x12')]);}else{logger[_0xbfa4('0x13')](_0xbfa4('0x11'),_0x3488eb,_0xbfa4('0xc'));_0x64eeb7(_0x5224cb[_0xbfa4('0x14')][_0xbfa4('0x12')]);}})['catch'](function(_0x4e0a24){logger[_0xbfa4('0xf')](_0xbfa4('0x11'),_0x3488eb,_0x4e0a24);_0x5c7502(_0x4e0a24);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index d0d9607..a825fd4 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 _0xab95=['post','update','delete','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show'];(function(_0x42f6b1,_0x560c04){var _0x39b69f=function(_0x38df3c){while(--_0x38df3c){_0x42f6b1['push'](_0x42f6b1['shift']());}};_0x39b69f(++_0x560c04);}(_0xab95,0x1d5));var _0x5ab9=function(_0x55d5fa,_0x520a08){_0x55d5fa=_0x55d5fa-0x0;var _0x4443c4=_0xab95[_0x55d5fa];return _0x4443c4;};'use strict';var multer=require(_0x5ab9('0x0'));var util=require(_0x5ab9('0x1'));var path=require(_0x5ab9('0x2'));var timeout=require('connect-timeout');var express=require(_0x5ab9('0x3'));var router=express[_0x5ab9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5ab9('0x5'));var config=require(_0x5ab9('0x6'));var controller=require('./template.controller');router[_0x5ab9('0x7')]('/',auth[_0x5ab9('0x8')](),controller['index']);router[_0x5ab9('0x7')](_0x5ab9('0x9'),auth['isAuthenticated'](),controller[_0x5ab9('0xa')]);router[_0x5ab9('0xb')]('/',auth[_0x5ab9('0x8')](),controller['create']);router['put'](_0x5ab9('0x9'),auth[_0x5ab9('0x8')](),controller[_0x5ab9('0xc')]);router[_0x5ab9('0xd')](_0x5ab9('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x5ab9('0xe')]=router; \ No newline at end of file +var _0x8cda=['get','/:id','show','post','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./template.controller','isAuthenticated','index'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x8cda,0x1db));var _0xa8cd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8cda[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xa8cd('0x0'));var path=require(_0xa8cd('0x1'));var timeout=require(_0xa8cd('0x2'));var express=require(_0xa8cd('0x3'));var router=express[_0xa8cd('0x4')]();var fs_extra=require(_0xa8cd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa8cd('0x6'));var config=require(_0xa8cd('0x7'));var controller=require(_0xa8cd('0x8'));router['get']('/',auth[_0xa8cd('0x9')](),controller[_0xa8cd('0xa')]);router[_0xa8cd('0xb')](_0xa8cd('0xc'),auth[_0xa8cd('0x9')](),controller[_0xa8cd('0xd')]);router[_0xa8cd('0xe')]('/',auth[_0xa8cd('0x9')](),controller['create']);router['put']('/:id',auth[_0xa8cd('0x9')](),controller['update']);router[_0xa8cd('0xf')](_0xa8cd('0xc'),auth['isAuthenticated'](),controller[_0xa8cd('0x10')]);module[_0xa8cd('0x11')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 3580242..615fe51 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 _0xb99a=['STRING','TEXT','sequelize','exports'];(function(_0xf312ff,_0x50250a){var _0x47ec88=function(_0x42d417){while(--_0x42d417){_0xf312ff['push'](_0xf312ff['shift']());}};_0x47ec88(++_0x50250a);}(_0xb99a,0x156));var _0xab99=function(_0x118f8a,_0x32012b){_0x118f8a=_0x118f8a-0x0;var _0x4edf5b=_0xb99a[_0x118f8a];return _0x4edf5b;};'use strict';var Sequelize=require(_0xab99('0x0'));module[_0xab99('0x1')]={'name':{'type':Sequelize[_0xab99('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xab99('0x3')]}}; \ No newline at end of file +var _0x7658=['TEXT','sequelize','STRING'];(function(_0x392dc2,_0x47c3f3){var _0x14150f=function(_0x9f305a){while(--_0x9f305a){_0x392dc2['push'](_0x392dc2['shift']());}};_0x14150f(++_0x47c3f3);}(_0x7658,0x16f));var _0x8765=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7658[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8765('0x0'));module['exports']={'name':{'type':Sequelize[_0x8765('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x8765('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index ceb7bfd..a454865 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 _0x0c5c=['limit','Content-Range','apply','save','update','then','destroy','get','Templates','stack','name','index','map','Template','rawAttributes','type','key','model','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x903228,_0x42c429){var _0xcec81d=function(_0x4da97a){while(--_0x4da97a){_0x903228['push'](_0x903228['shift']());}};_0xcec81d(++_0x42c429);}(_0x0c5c,0x1d8));var _0xc0c5=function(_0x213765,_0x408956){_0x213765=_0x213765-0x0;var _0x15ef94=_0x0c5c[_0x213765];return _0x15ef94;};'use strict';var emlformat=require(_0xc0c5('0x0'));var rimraf=require(_0xc0c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc0c5('0x2'));var rp=require(_0xc0c5('0x3'));var moment=require(_0xc0c5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc0c5('0x5'));var util=require(_0xc0c5('0x6'));var path=require(_0xc0c5('0x7'));var sox=require(_0xc0c5('0x8'));var csv=require('to-csv');var ejs=require(_0xc0c5('0x9'));var fs=require('fs');var fs_extra=require(_0xc0c5('0xa'));var _=require(_0xc0c5('0xb'));var squel=require(_0xc0c5('0xc'));var crypto=require('crypto');var jsforce=require(_0xc0c5('0xd'));var deskjs=require(_0xc0c5('0xe'));var toCsv=require(_0xc0c5('0xf'));var querystring=require(_0xc0c5('0x10'));var Papa=require(_0xc0c5('0x11'));var Redis=require(_0xc0c5('0x12'));var authService=require(_0xc0c5('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc0c5('0x14'));var hardwareService=require(_0xc0c5('0x15'));var logger=require(_0xc0c5('0x16'))(_0xc0c5('0x17'));var utils=require('../../config/utils');var config=require(_0xc0c5('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc0c5('0x19'))['db'];function respondWithStatusCode(_0x14d62a,_0x44901e){_0x44901e=_0x44901e||0xcc;return function(_0x1b4725){if(_0x1b4725){return _0x14d62a[_0xc0c5('0x1a')](_0x44901e);}return _0x14d62a[_0xc0c5('0x1b')](_0x44901e)[_0xc0c5('0x1c')]();};}function respondWithResult(_0x4f8b87,_0x23c9d7){_0x23c9d7=_0x23c9d7||0xc8;return function(_0x5d8e93){if(_0x5d8e93){return _0x4f8b87['status'](_0x23c9d7)[_0xc0c5('0x1d')](_0x5d8e93);}};}function respondWithFilteredResult(_0x258099,_0x17bcb5){return function(_0x1e3d1b){if(_0x1e3d1b){var _0x5dc595=typeof _0x17bcb5[_0xc0c5('0x1e')]===_0xc0c5('0x1f')&&typeof _0x17bcb5['limit']===_0xc0c5('0x1f');var _0x19449a=_0x1e3d1b['count'];var _0x43a0f4=_0x5dc595?0x0:_0x17bcb5[_0xc0c5('0x1e')];var _0x4939a2=_0x5dc595?_0x1e3d1b['count']:_0x17bcb5[_0xc0c5('0x1e')]+_0x17bcb5[_0xc0c5('0x20')];var _0x235b24;if(_0x4939a2>=_0x19449a){_0x4939a2=_0x19449a;_0x235b24=0xc8;}else{_0x235b24=0xce;}_0x258099[_0xc0c5('0x1b')](_0x235b24);return _0x258099['set'](_0xc0c5('0x21'),_0x43a0f4+'-'+_0x4939a2+'/'+_0x19449a)[_0xc0c5('0x1d')](_0x1e3d1b);}return null;};}function patchUpdates(_0xd2bd7){return function(_0x5441f2){try{jsonpatch[_0xc0c5('0x22')](_0x5441f2,_0xd2bd7,!![]);}catch(_0x530764){return BPromise['reject'](_0x530764);}return _0x5441f2[_0xc0c5('0x23')]();};}function saveUpdates(_0x125cf0,_0x42ead9){return function(_0x21b7c8){if(_0x21b7c8){return _0x21b7c8[_0xc0c5('0x24')](_0x125cf0)[_0xc0c5('0x25')](function(_0x4ce7b4){return _0x4ce7b4;});}return null;};}function removeEntity(_0x3fa655,_0x2079af){return function(_0x35f2ef){if(_0x35f2ef){return _0x35f2ef[_0xc0c5('0x26')]()['then'](function(){var _0x496a83=_0x35f2ef[_0xc0c5('0x27')]({'plain':!![]});var _0x34f1c1=_0xc0c5('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x34f1c1,'resourceId':_0x496a83['id']}})['then'](function(){return _0x35f2ef;});})['then'](function(){_0x3fa655['status'](0xcc)[_0xc0c5('0x1c')]();});}};}function handleEntityNotFound(_0x4b611a,_0x467e02){return function(_0x386773){if(!_0x386773){_0x4b611a[_0xc0c5('0x1a')](0x194);}return _0x386773;};}function handleError(_0x24d5b3,_0x5278a0){_0x5278a0=_0x5278a0||0x1f4;return function(_0x9a2b3){logger['error'](_0x9a2b3[_0xc0c5('0x29')]);if(_0x9a2b3['name']){delete _0x9a2b3[_0xc0c5('0x2a')];}_0x24d5b3[_0xc0c5('0x1b')](_0x5278a0)['send'](_0x9a2b3);};}exports[_0xc0c5('0x2b')]=function(_0x16e781,_0x160bf2){var _0x59866d={},_0x1f2df2={},_0x3ccc00={'count':0x0,'rows':[]};var _0x5092b1=_[_0xc0c5('0x2c')](db[_0xc0c5('0x2d')][_0xc0c5('0x2e')],function(_0x143628){return{'name':_0x143628['fieldName'],'type':_0x143628[_0xc0c5('0x2f')][_0xc0c5('0x30')]};});_0x1f2df2[_0xc0c5('0x31')]=_[_0xc0c5('0x2c')](_0x5092b1,'name');_0x1f2df2['query']=_['keys'](_0x16e781['query']);_0x1f2df2[_0xc0c5('0x32')]=_['intersection'](_0x1f2df2[_0xc0c5('0x31')],_0x1f2df2[_0xc0c5('0x33')]);_0x59866d[_0xc0c5('0x34')]=_[_0xc0c5('0x35')](_0x1f2df2[_0xc0c5('0x31')],qs[_0xc0c5('0x36')](_0x16e781['query'][_0xc0c5('0x36')]));_0x59866d[_0xc0c5('0x34')]=_0x59866d[_0xc0c5('0x34')][_0xc0c5('0x37')]?_0x59866d[_0xc0c5('0x34')]:_0x1f2df2[_0xc0c5('0x31')];if(!_0x16e781[_0xc0c5('0x33')][_0xc0c5('0x38')](_0xc0c5('0x39'))){_0x59866d[_0xc0c5('0x20')]=qs[_0xc0c5('0x20')](_0x16e781[_0xc0c5('0x33')]['limit']);_0x59866d['offset']=qs[_0xc0c5('0x1e')](_0x16e781[_0xc0c5('0x33')][_0xc0c5('0x1e')]);}_0x59866d[_0xc0c5('0x3a')]=qs[_0xc0c5('0x3b')](_0x16e781[_0xc0c5('0x33')][_0xc0c5('0x3b')]);_0x59866d[_0xc0c5('0x3c')]=qs[_0xc0c5('0x32')](_['pick'](_0x16e781['query'],_0x1f2df2['filters']),_0x5092b1);if(_0x16e781[_0xc0c5('0x33')]['filter']){_0x59866d[_0xc0c5('0x3c')]=_['merge'](_0x59866d['where'],{'$or':_[_0xc0c5('0x2c')](_0x5092b1,function(_0x5bc634){if(_0x5bc634[_0xc0c5('0x2f')]!==_0xc0c5('0x3d')){var _0x4a5274={};_0x4a5274[_0x5bc634['name']]={'$like':'%'+_0x16e781[_0xc0c5('0x33')][_0xc0c5('0x3e')]+'%'};return _0x4a5274;}})});}_0x59866d=_[_0xc0c5('0x3f')]({},_0x59866d,_0x16e781[_0xc0c5('0x40')]);var _0x30d709={'where':_0x59866d['where']};return db[_0xc0c5('0x2d')][_0xc0c5('0x41')](_0x30d709)[_0xc0c5('0x25')](function(_0xbe1846){_0x3ccc00[_0xc0c5('0x41')]=_0xbe1846;if(_0x16e781['query'][_0xc0c5('0x42')]){_0x59866d[_0xc0c5('0x43')]=[{'all':!![]}];}return db[_0xc0c5('0x2d')][_0xc0c5('0x44')](_0x59866d);})[_0xc0c5('0x25')](function(_0x46d369){_0x3ccc00[_0xc0c5('0x45')]=_0x46d369;return _0x3ccc00;})[_0xc0c5('0x25')](respondWithFilteredResult(_0x160bf2,_0x59866d))[_0xc0c5('0x46')](handleError(_0x160bf2,null));};exports[_0xc0c5('0x47')]=function(_0x2e3c14,_0x44f0e5){var _0x11d168={'raw':!![],'where':{'id':_0x2e3c14[_0xc0c5('0x48')]['id']}},_0x4b4946={};_0x4b4946[_0xc0c5('0x31')]=_[_0xc0c5('0x49')](db[_0xc0c5('0x2d')][_0xc0c5('0x2e')]);_0x4b4946[_0xc0c5('0x33')]=_[_0xc0c5('0x49')](_0x2e3c14['query']);_0x4b4946[_0xc0c5('0x32')]=_[_0xc0c5('0x35')](_0x4b4946[_0xc0c5('0x31')],_0x4b4946[_0xc0c5('0x33')]);_0x11d168['attributes']=_['intersection'](_0x4b4946[_0xc0c5('0x31')],qs[_0xc0c5('0x36')](_0x2e3c14['query'][_0xc0c5('0x36')]));_0x11d168[_0xc0c5('0x34')]=_0x11d168['attributes']['length']?_0x11d168[_0xc0c5('0x34')]:_0x4b4946[_0xc0c5('0x31')];if(_0x2e3c14['query']['includeAll']){_0x11d168[_0xc0c5('0x43')]=[{'all':!![]}];}_0x11d168=_[_0xc0c5('0x3f')]({},_0x11d168,_0x2e3c14[_0xc0c5('0x40')]);return db['Template'][_0xc0c5('0x4a')](_0x11d168)[_0xc0c5('0x25')](handleEntityNotFound(_0x44f0e5,null))[_0xc0c5('0x25')](respondWithResult(_0x44f0e5,null))[_0xc0c5('0x46')](handleError(_0x44f0e5,null));};exports[_0xc0c5('0x4b')]=function(_0x4b64d7,_0x514dd5){return db[_0xc0c5('0x2d')][_0xc0c5('0x4b')](_0x4b64d7[_0xc0c5('0x4c')],{})['then'](function(_0x3f5175){var _0x5f2a6b=_0x4b64d7[_0xc0c5('0x4d')][_0xc0c5('0x27')]({'plain':!![]});if(!_0x5f2a6b)throw new Error(_0xc0c5('0x4e'));if(_0x5f2a6b['role']===_0xc0c5('0x4d')){var _0x510b3a=_0x3f5175[_0xc0c5('0x27')]({'plain':!![]});var _0x52ad5a='Templates';return db[_0xc0c5('0x4f')][_0xc0c5('0x4a')]({'where':{'name':_0x52ad5a,'userProfileId':_0x5f2a6b[_0xc0c5('0x50')]},'raw':!![]})['then'](function(_0x588848){if(_0x588848&&_0x588848[_0xc0c5('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x510b3a[_0xc0c5('0x2a')],'resourceId':_0x510b3a['id'],'type':_0x588848[_0xc0c5('0x2a')],'sectionId':_0x588848['id']},{})['then'](function(){return _0x3f5175;});}else{return _0x3f5175;}})[_0xc0c5('0x46')](function(_0x1ec38b){logger[_0xc0c5('0x52')](_0xc0c5('0x53'),_0x1ec38b);throw _0x1ec38b;});}return _0x3f5175;})[_0xc0c5('0x25')](respondWithResult(_0x514dd5,0xc9))[_0xc0c5('0x46')](handleError(_0x514dd5,null));};exports[_0xc0c5('0x24')]=function(_0x41f83d,_0xf30c9d){if(_0x41f83d['body']['id']){delete _0x41f83d[_0xc0c5('0x4c')]['id'];}return db[_0xc0c5('0x2d')]['find']({'where':{'id':_0x41f83d[_0xc0c5('0x48')]['id']}})[_0xc0c5('0x25')](handleEntityNotFound(_0xf30c9d,null))[_0xc0c5('0x25')](saveUpdates(_0x41f83d[_0xc0c5('0x4c')],null))[_0xc0c5('0x25')](respondWithResult(_0xf30c9d,null))[_0xc0c5('0x46')](handleError(_0xf30c9d,null));};exports[_0xc0c5('0x26')]=function(_0x3ac90e,_0x3f1661){return db['Template'][_0xc0c5('0x4a')]({'where':{'id':_0x3ac90e[_0xc0c5('0x48')]['id']}})[_0xc0c5('0x25')](handleEntityNotFound(_0x3f1661,null))[_0xc0c5('0x25')](removeEntity(_0x3f1661,null))[_0xc0c5('0x46')](handleError(_0x3f1661,null));}; \ No newline at end of file +var _0xc9b3=['reject','save','update','then','destroy','get','Templates','UserProfileResource','error','stack','name','send','index','map','Template','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','options','include','findAll','rows','catch','show','params','includeAll','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range'];(function(_0x4ed473,_0x588698){var _0x629879=function(_0x3cb3c0){while(--_0x3cb3c0){_0x4ed473['push'](_0x4ed473['shift']());}};_0x629879(++_0x588698);}(_0xc9b3,0xdb));var _0x3c9b=function(_0x34de05,_0x425300){_0x34de05=_0x34de05-0x0;var _0x4b61b9=_0xc9b3[_0x34de05];return _0x4b61b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3c9b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3c9b('0x1'));var moment=require(_0x3c9b('0x2'));var BPromise=require(_0x3c9b('0x3'));var Mustache=require(_0x3c9b('0x4'));var util=require(_0x3c9b('0x5'));var path=require('path');var sox=require(_0x3c9b('0x6'));var csv=require(_0x3c9b('0x7'));var ejs=require(_0x3c9b('0x8'));var fs=require('fs');var fs_extra=require(_0x3c9b('0x9'));var _=require(_0x3c9b('0xa'));var squel=require(_0x3c9b('0xb'));var crypto=require(_0x3c9b('0xc'));var jsforce=require(_0x3c9b('0xd'));var deskjs=require(_0x3c9b('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3c9b('0xf'));var Redis=require(_0x3c9b('0x10'));var authService=require(_0x3c9b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3c9b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c9b('0x13'))(_0x3c9b('0x14'));var utils=require(_0x3c9b('0x15'));var config=require(_0x3c9b('0x16'));var licenseUtil=require(_0x3c9b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4df235,_0x5358ee){_0x5358ee=_0x5358ee||0xcc;return function(_0x5c801a){if(_0x5c801a){return _0x4df235[_0x3c9b('0x18')](_0x5358ee);}return _0x4df235[_0x3c9b('0x19')](_0x5358ee)[_0x3c9b('0x1a')]();};}function respondWithResult(_0x267887,_0x1b79a0){_0x1b79a0=_0x1b79a0||0xc8;return function(_0x179dfe){if(_0x179dfe){return _0x267887[_0x3c9b('0x19')](_0x1b79a0)[_0x3c9b('0x1b')](_0x179dfe);}};}function respondWithFilteredResult(_0x5d9bc2,_0x5aca01){return function(_0x2349ef){if(_0x2349ef){var _0xf49c5f=typeof _0x5aca01[_0x3c9b('0x1c')]===_0x3c9b('0x1d')&&typeof _0x5aca01[_0x3c9b('0x1e')]===_0x3c9b('0x1d');var _0x46e5f6=_0x2349ef[_0x3c9b('0x1f')];var _0x8f4767=_0xf49c5f?0x0:_0x5aca01[_0x3c9b('0x1c')];var _0x5a9ed4=_0xf49c5f?_0x2349ef['count']:_0x5aca01[_0x3c9b('0x1c')]+_0x5aca01['limit'];var _0x25519e;if(_0x5a9ed4>=_0x46e5f6){_0x5a9ed4=_0x46e5f6;_0x25519e=0xc8;}else{_0x25519e=0xce;}_0x5d9bc2[_0x3c9b('0x19')](_0x25519e);return _0x5d9bc2['set'](_0x3c9b('0x20'),_0x8f4767+'-'+_0x5a9ed4+'/'+_0x46e5f6)['json'](_0x2349ef);}return null;};}function patchUpdates(_0x4712d7){return function(_0xa60c9e){try{jsonpatch['apply'](_0xa60c9e,_0x4712d7,!![]);}catch(_0x47567b){return BPromise[_0x3c9b('0x21')](_0x47567b);}return _0xa60c9e[_0x3c9b('0x22')]();};}function saveUpdates(_0x3ac495,_0x3f95db){return function(_0x368d39){if(_0x368d39){return _0x368d39[_0x3c9b('0x23')](_0x3ac495)[_0x3c9b('0x24')](function(_0x105547){return _0x105547;});}return null;};}function removeEntity(_0x1c8b61,_0x3e7dfe){return function(_0x49e43f){if(_0x49e43f){return _0x49e43f[_0x3c9b('0x25')]()[_0x3c9b('0x24')](function(){var _0x265da5=_0x49e43f[_0x3c9b('0x26')]({'plain':!![]});var _0x3e2e76=_0x3c9b('0x27');return db[_0x3c9b('0x28')][_0x3c9b('0x25')]({'where':{'type':_0x3e2e76,'resourceId':_0x265da5['id']}})[_0x3c9b('0x24')](function(){return _0x49e43f;});})[_0x3c9b('0x24')](function(){_0x1c8b61[_0x3c9b('0x19')](0xcc)[_0x3c9b('0x1a')]();});}};}function handleEntityNotFound(_0x2fdc3c,_0x45a99d){return function(_0x5dc5ff){if(!_0x5dc5ff){_0x2fdc3c['sendStatus'](0x194);}return _0x5dc5ff;};}function handleError(_0x554c50,_0x3d732e){_0x3d732e=_0x3d732e||0x1f4;return function(_0x2852ca){logger[_0x3c9b('0x29')](_0x2852ca[_0x3c9b('0x2a')]);if(_0x2852ca[_0x3c9b('0x2b')]){delete _0x2852ca[_0x3c9b('0x2b')];}_0x554c50[_0x3c9b('0x19')](_0x3d732e)[_0x3c9b('0x2c')](_0x2852ca);};}exports[_0x3c9b('0x2d')]=function(_0x263ecc,_0x4c3802){var _0x585f50={},_0x3d9943={},_0x205fba={'count':0x0,'rows':[]};var _0x115a70=_[_0x3c9b('0x2e')](db[_0x3c9b('0x2f')][_0x3c9b('0x30')],function(_0x39dabd){return{'name':_0x39dabd['fieldName'],'type':_0x39dabd['type'][_0x3c9b('0x31')]};});_0x3d9943[_0x3c9b('0x32')]=_[_0x3c9b('0x2e')](_0x115a70,_0x3c9b('0x2b'));_0x3d9943[_0x3c9b('0x33')]=_[_0x3c9b('0x34')](_0x263ecc[_0x3c9b('0x33')]);_0x3d9943[_0x3c9b('0x35')]=_[_0x3c9b('0x36')](_0x3d9943[_0x3c9b('0x32')],_0x3d9943['query']);_0x585f50[_0x3c9b('0x37')]=_[_0x3c9b('0x36')](_0x3d9943[_0x3c9b('0x32')],qs[_0x3c9b('0x38')](_0x263ecc[_0x3c9b('0x33')][_0x3c9b('0x38')]));_0x585f50[_0x3c9b('0x37')]=_0x585f50[_0x3c9b('0x37')][_0x3c9b('0x39')]?_0x585f50[_0x3c9b('0x37')]:_0x3d9943[_0x3c9b('0x32')];if(!_0x263ecc[_0x3c9b('0x33')]['hasOwnProperty'](_0x3c9b('0x3a'))){_0x585f50[_0x3c9b('0x1e')]=qs[_0x3c9b('0x1e')](_0x263ecc[_0x3c9b('0x33')][_0x3c9b('0x1e')]);_0x585f50['offset']=qs['offset'](_0x263ecc[_0x3c9b('0x33')][_0x3c9b('0x1c')]);}_0x585f50[_0x3c9b('0x3b')]=qs[_0x3c9b('0x3c')](_0x263ecc[_0x3c9b('0x33')][_0x3c9b('0x3c')]);_0x585f50[_0x3c9b('0x3d')]=qs[_0x3c9b('0x35')](_[_0x3c9b('0x3e')](_0x263ecc[_0x3c9b('0x33')],_0x3d9943[_0x3c9b('0x35')]),_0x115a70);if(_0x263ecc[_0x3c9b('0x33')][_0x3c9b('0x3f')]){_0x585f50[_0x3c9b('0x3d')]=_[_0x3c9b('0x40')](_0x585f50[_0x3c9b('0x3d')],{'$or':_[_0x3c9b('0x2e')](_0x115a70,function(_0x4a0614){if(_0x4a0614[_0x3c9b('0x41')]!=='VIRTUAL'){var _0x124c4a={};_0x124c4a[_0x4a0614[_0x3c9b('0x2b')]]={'$like':'%'+_0x263ecc[_0x3c9b('0x33')][_0x3c9b('0x3f')]+'%'};return _0x124c4a;}})});}_0x585f50=_['merge']({},_0x585f50,_0x263ecc[_0x3c9b('0x42')]);var _0x1d0e11={'where':_0x585f50['where']};return db[_0x3c9b('0x2f')][_0x3c9b('0x1f')](_0x1d0e11)[_0x3c9b('0x24')](function(_0x33297b){_0x205fba['count']=_0x33297b;if(_0x263ecc[_0x3c9b('0x33')]['includeAll']){_0x585f50[_0x3c9b('0x43')]=[{'all':!![]}];}return db['Template'][_0x3c9b('0x44')](_0x585f50);})['then'](function(_0xb609f7){_0x205fba[_0x3c9b('0x45')]=_0xb609f7;return _0x205fba;})[_0x3c9b('0x24')](respondWithFilteredResult(_0x4c3802,_0x585f50))[_0x3c9b('0x46')](handleError(_0x4c3802,null));};exports[_0x3c9b('0x47')]=function(_0x5c5a25,_0x48d440){var _0x2c573d={'raw':!![],'where':{'id':_0x5c5a25[_0x3c9b('0x48')]['id']}},_0x3453c0={};_0x3453c0[_0x3c9b('0x32')]=_['keys'](db['Template']['rawAttributes']);_0x3453c0[_0x3c9b('0x33')]=_['keys'](_0x5c5a25[_0x3c9b('0x33')]);_0x3453c0[_0x3c9b('0x35')]=_['intersection'](_0x3453c0[_0x3c9b('0x32')],_0x3453c0['query']);_0x2c573d[_0x3c9b('0x37')]=_[_0x3c9b('0x36')](_0x3453c0[_0x3c9b('0x32')],qs[_0x3c9b('0x38')](_0x5c5a25[_0x3c9b('0x33')][_0x3c9b('0x38')]));_0x2c573d[_0x3c9b('0x37')]=_0x2c573d[_0x3c9b('0x37')][_0x3c9b('0x39')]?_0x2c573d[_0x3c9b('0x37')]:_0x3453c0[_0x3c9b('0x32')];if(_0x5c5a25['query'][_0x3c9b('0x49')]){_0x2c573d[_0x3c9b('0x43')]=[{'all':!![]}];}_0x2c573d=_[_0x3c9b('0x40')]({},_0x2c573d,_0x5c5a25['options']);return db[_0x3c9b('0x2f')]['find'](_0x2c573d)[_0x3c9b('0x24')](handleEntityNotFound(_0x48d440,null))[_0x3c9b('0x24')](respondWithResult(_0x48d440,null))['catch'](handleError(_0x48d440,null));};exports['create']=function(_0x39890a,_0x7d85e6){return db[_0x3c9b('0x2f')][_0x3c9b('0x4a')](_0x39890a['body'],{})[_0x3c9b('0x24')](function(_0x3f34f3){var _0x10eb23=_0x39890a[_0x3c9b('0x4b')][_0x3c9b('0x26')]({'plain':!![]});if(!_0x10eb23)throw new Error(_0x3c9b('0x4c'));if(_0x10eb23[_0x3c9b('0x4d')]===_0x3c9b('0x4b')){var _0x5ddd08=_0x3f34f3[_0x3c9b('0x26')]({'plain':!![]});var _0x4aabe7=_0x3c9b('0x27');return db[_0x3c9b('0x4e')][_0x3c9b('0x4f')]({'where':{'name':_0x4aabe7,'userProfileId':_0x10eb23[_0x3c9b('0x50')]},'raw':!![]})[_0x3c9b('0x24')](function(_0x1724ae){if(_0x1724ae&&_0x1724ae[_0x3c9b('0x51')]===0x0){return db[_0x3c9b('0x28')][_0x3c9b('0x4a')]({'name':_0x5ddd08[_0x3c9b('0x2b')],'resourceId':_0x5ddd08['id'],'type':_0x1724ae[_0x3c9b('0x2b')],'sectionId':_0x1724ae['id']},{})[_0x3c9b('0x24')](function(){return _0x3f34f3;});}else{return _0x3f34f3;}})['catch'](function(_0x2e0ef7){logger[_0x3c9b('0x29')](_0x3c9b('0x52'),_0x2e0ef7);throw _0x2e0ef7;});}return _0x3f34f3;})[_0x3c9b('0x24')](respondWithResult(_0x7d85e6,0xc9))['catch'](handleError(_0x7d85e6,null));};exports[_0x3c9b('0x23')]=function(_0x1180f1,_0x279027){if(_0x1180f1[_0x3c9b('0x53')]['id']){delete _0x1180f1[_0x3c9b('0x53')]['id'];}return db['Template'][_0x3c9b('0x4f')]({'where':{'id':_0x1180f1[_0x3c9b('0x48')]['id']}})[_0x3c9b('0x24')](handleEntityNotFound(_0x279027,null))[_0x3c9b('0x24')](saveUpdates(_0x1180f1[_0x3c9b('0x53')],null))[_0x3c9b('0x24')](respondWithResult(_0x279027,null))[_0x3c9b('0x46')](handleError(_0x279027,null));};exports[_0x3c9b('0x25')]=function(_0x36c910,_0x4ac3f3){return db[_0x3c9b('0x2f')]['find']({'where':{'id':_0x36c910[_0x3c9b('0x48')]['id']}})[_0x3c9b('0x24')](handleEntityNotFound(_0x4ac3f3,null))['then'](removeEntity(_0x4ac3f3,null))[_0x3c9b('0x46')](handleError(_0x4ac3f3,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 6a9c2e9..b5b6292 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 _0x668d=['moment','request-promise','path','rimraf','./template.attributes','exports','Template','tools_templates','util','../../config/logger','api'];(function(_0x5b1c58,_0x29581b){var _0x2e25d3=function(_0x5f56b6){while(--_0x5f56b6){_0x5b1c58['push'](_0x5b1c58['shift']());}};_0x2e25d3(++_0x29581b);}(_0x668d,0x11b));var _0xd668=function(_0x5646f9,_0x5a3b01){_0x5646f9=_0x5646f9-0x0;var _0x3b726f=_0x668d[_0x5646f9];return _0x3b726f;};'use strict';var _=require('lodash');var util=require(_0xd668('0x0'));var logger=require(_0xd668('0x1'))(_0xd668('0x2'));var moment=require(_0xd668('0x3'));var BPromise=require('bluebird');var rp=require(_0xd668('0x4'));var fs=require('fs');var path=require(_0xd668('0x5'));var rimraf=require(_0xd668('0x6'));var config=require('../../config/environment');var attributes=require(_0xd668('0x7'));module[_0xd668('0x8')]=function(_0x422f1b,_0xa5a6a3){return _0x422f1b['define'](_0xd668('0x9'),attributes,{'tableName':_0xd668('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xce99=['tools_templates','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./template.attributes','define','Template'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xce99,0x85));var _0x9ce9=function(_0xe4c48b,_0x3c6790){_0xe4c48b=_0xe4c48b-0x0;var _0x51872b=_0xce99[_0xe4c48b];return _0x51872b;};'use strict';var _=require('lodash');var util=require(_0x9ce9('0x0'));var logger=require(_0x9ce9('0x1'))(_0x9ce9('0x2'));var moment=require('moment');var BPromise=require(_0x9ce9('0x3'));var rp=require(_0x9ce9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9ce9('0x5'));var config=require(_0x9ce9('0x6'));var attributes=require(_0x9ce9('0x7'));module['exports']=function(_0x3fbe5c,_0x51d36c){return _0x3fbe5c[_0x9ce9('0x8')](_0x9ce9('0x9'),attributes,{'tableName':_0x9ce9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index d4fe6b4..c0b9b9b 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 _0x495c=['../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include','map','model','stringify','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x2ad83d,_0xf98fe1){var _0x15713f=function(_0x2e558f){while(--_0x2e558f){_0x2ad83d['push'](_0x2ad83d['shift']());}};_0x15713f(++_0xf98fe1);}(_0x495c,0xdb));var _0xc495=function(_0x484e84,_0x3ecdae){_0x484e84=_0x484e84-0x0;var _0x2f1b2c=_0x495c[_0x484e84];return _0x2f1b2c;};'use strict';var _=require('lodash');var util=require(_0xc495('0x0'));var moment=require(_0xc495('0x1'));var BPromise=require(_0xc495('0x2'));var rs=require(_0xc495('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc495('0x4'))['db'];var utils=require(_0xc495('0x5'));var logger=require(_0xc495('0x6'))(_0xc495('0x7'));var config=require('../../config/environment');var jayson=require(_0xc495('0x8'));var client=jayson[_0xc495('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x77d109,_0x460f1a,_0x548bce){return new BPromise(function(_0x4e4f24,_0xb70ffa){return client['request'](_0x77d109,_0x548bce)[_0xc495('0xa')](function(_0x369b65){logger[_0xc495('0xb')](_0xc495('0xc'),_0x460f1a,'request\x20sent');logger[_0xc495('0xd')](_0xc495('0xe'),_0x460f1a,_0xc495('0xf'),JSON['stringify'](_0x369b65));if(_0x369b65['error']){if(_0x369b65['error']['code']===0x1f4){logger[_0xc495('0x10')]('Template,\x20%s,\x20%s',_0x460f1a,_0x369b65['error'][_0xc495('0x11')]);return _0xb70ffa(_0x369b65['error']['message']);}logger['error']('Template,\x20%s,\x20%s',_0x460f1a,_0x369b65[_0xc495('0x10')][_0xc495('0x11')]);return _0x4e4f24(_0x369b65['error'][_0xc495('0x11')]);}else{logger['info'](_0xc495('0xc'),_0x460f1a,_0xc495('0xf'));_0x4e4f24(_0x369b65[_0xc495('0x12')][_0xc495('0x11')]);}})[_0xc495('0x13')](function(_0x2fc927){logger[_0xc495('0x10')](_0xc495('0xc'),_0x460f1a,_0x2fc927);_0xb70ffa(_0x2fc927);});});}exports[_0xc495('0x14')]=function(_0x2a67ad){var _0x4b0fff=this;return new Promise(function(_0x4adb5d,_0x5a3675){return db[_0xc495('0x15')][_0xc495('0x16')]({'raw':_0x2a67ad[_0xc495('0x17')]?_0x2a67ad[_0xc495('0x17')][_0xc495('0x18')]===undefined?!![]:![]:!![],'where':_0x2a67ad[_0xc495('0x17')]?_0x2a67ad['options'][_0xc495('0x19')]||null:null,'attributes':_0x2a67ad[_0xc495('0x17')]?_0x2a67ad['options'][_0xc495('0x1a')]||null:null,'limit':_0x2a67ad[_0xc495('0x17')]?_0x2a67ad[_0xc495('0x17')][_0xc495('0x1b')]||null:null,'include':_0x2a67ad['options']?_0x2a67ad[_0xc495('0x17')][_0xc495('0x1c')]?_[_0xc495('0x1d')](_0x2a67ad[_0xc495('0x17')][_0xc495('0x1c')],function(_0x3c287d){return{'model':db[_0x3c287d['model']],'as':_0x3c287d['as'],'attributes':_0x3c287d[_0xc495('0x1a')],'include':_0x3c287d['include']?_[_0xc495('0x1d')](_0x3c287d[_0xc495('0x1c')],function(_0x3da963){return{'model':db[_0x3da963[_0xc495('0x1e')]],'as':_0x3da963['as'],'attributes':_0x3da963[_0xc495('0x1a')],'include':_0x3da963['include']?_['map'](_0x3da963[_0xc495('0x1c')],function(_0x5782c4){return{'model':db[_0x5782c4['model']],'as':_0x5782c4['as'],'attributes':_0x5782c4['attributes']};}):[]};}):[]};}):[]:[]})[_0xc495('0xa')](function(_0x2168c5){logger[_0xc495('0xb')]('GetTemplate',_0x2a67ad);logger[_0xc495('0xd')](_0xc495('0x14'),_0x2a67ad,JSON[_0xc495('0x1f')](_0x2168c5));_0x4adb5d(_0x2168c5);})[_0xc495('0x13')](function(_0x4da9c2){logger['error']('GetTemplate',_0x4da9c2['message'],_0x2a67ad);_0x5a3675(_0x4b0fff[_0xc495('0x10')](0x1f4,_0x4da9c2['message']));});});}; \ No newline at end of file +var _0x03db=['catch','GetTemplate','Template','findAll','options','where','attributes','include','map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x118650,_0x398c57){var _0xfc9873=function(_0x199600){while(--_0x199600){_0x118650['push'](_0x118650['shift']());}};_0xfc9873(++_0x398c57);}(_0x03db,0xa0));var _0xb03d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x03db[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xb03d('0x0'));var moment=require(_0xb03d('0x1'));var BPromise=require(_0xb03d('0x2'));var rs=require(_0xb03d('0x3'));var fs=require('fs');var Redis=require(_0xb03d('0x4'));var db=require(_0xb03d('0x5'))['db'];var utils=require(_0xb03d('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb03d('0x7'));var client=jayson[_0xb03d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x104f99,_0x18e7f1,_0x538145){return new BPromise(function(_0x50a98f,_0x56fa37){return client[_0xb03d('0x9')](_0x104f99,_0x538145)[_0xb03d('0xa')](function(_0x1e20cf){logger[_0xb03d('0xb')](_0xb03d('0xc'),_0x18e7f1,_0xb03d('0xd'));logger[_0xb03d('0xe')]('Template,\x20%s,\x20%s,\x20%s',_0x18e7f1,_0xb03d('0xd'),JSON[_0xb03d('0xf')](_0x1e20cf));if(_0x1e20cf[_0xb03d('0x10')]){if(_0x1e20cf[_0xb03d('0x10')][_0xb03d('0x11')]===0x1f4){logger[_0xb03d('0x10')](_0xb03d('0xc'),_0x18e7f1,_0x1e20cf[_0xb03d('0x10')][_0xb03d('0x12')]);return _0x56fa37(_0x1e20cf[_0xb03d('0x10')][_0xb03d('0x12')]);}logger[_0xb03d('0x10')](_0xb03d('0xc'),_0x18e7f1,_0x1e20cf[_0xb03d('0x10')][_0xb03d('0x12')]);return _0x50a98f(_0x1e20cf['error'][_0xb03d('0x12')]);}else{logger[_0xb03d('0xb')](_0xb03d('0xc'),_0x18e7f1,'request\x20sent');_0x50a98f(_0x1e20cf[_0xb03d('0x13')]['message']);}})[_0xb03d('0x14')](function(_0x6286d){logger[_0xb03d('0x10')](_0xb03d('0xc'),_0x18e7f1,_0x6286d);_0x56fa37(_0x6286d);});});}exports[_0xb03d('0x15')]=function(_0x5356f1){var _0x1c5aa8=this;return new Promise(function(_0x406a6d,_0x4547ff){return db[_0xb03d('0x16')][_0xb03d('0x17')]({'raw':_0x5356f1[_0xb03d('0x18')]?_0x5356f1[_0xb03d('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5356f1['options']?_0x5356f1[_0xb03d('0x18')][_0xb03d('0x19')]||null:null,'attributes':_0x5356f1[_0xb03d('0x18')]?_0x5356f1[_0xb03d('0x18')][_0xb03d('0x1a')]||null:null,'limit':_0x5356f1[_0xb03d('0x18')]?_0x5356f1['options']['limit']||null:null,'include':_0x5356f1['options']?_0x5356f1[_0xb03d('0x18')][_0xb03d('0x1b')]?_[_0xb03d('0x1c')](_0x5356f1[_0xb03d('0x18')][_0xb03d('0x1b')],function(_0x121595){return{'model':db[_0x121595[_0xb03d('0x1d')]],'as':_0x121595['as'],'attributes':_0x121595[_0xb03d('0x1a')],'include':_0x121595[_0xb03d('0x1b')]?_[_0xb03d('0x1c')](_0x121595[_0xb03d('0x1b')],function(_0x1c8028){return{'model':db[_0x1c8028[_0xb03d('0x1d')]],'as':_0x1c8028['as'],'attributes':_0x1c8028[_0xb03d('0x1a')],'include':_0x1c8028[_0xb03d('0x1b')]?_['map'](_0x1c8028[_0xb03d('0x1b')],function(_0x3e50cb){return{'model':db[_0x3e50cb[_0xb03d('0x1d')]],'as':_0x3e50cb['as'],'attributes':_0x3e50cb['attributes']};}):[]};}):[]};}):[]:[]})[_0xb03d('0xa')](function(_0x3f7929){logger[_0xb03d('0xb')]('GetTemplate',_0x5356f1);logger['debug'](_0xb03d('0x15'),_0x5356f1,JSON[_0xb03d('0xf')](_0x3f7929));_0x406a6d(_0x3f7929);})[_0xb03d('0x14')](function(_0x6ae248){logger[_0xb03d('0x10')](_0xb03d('0x15'),_0x6ae248['message'],_0x5356f1);_0x4547ff(_0x1c5aa8[_0xb03d('0x10')](0x1f4,_0x6ae248[_0xb03d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 624fa33..71bb384 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 _0x7f68=['../../components/auth/service','../../components/interaction/service','./trigger.controller','get','isAuthenticated','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','getActions','post','create','addAllCondition','addAnyCondition','/:id/actions','put','/:id','destroy','multer','path','express','fs-extra'];(function(_0x25f180,_0x3dfe3b){var _0x2629be=function(_0x97539){while(--_0x97539){_0x25f180['push'](_0x25f180['shift']());}};_0x2629be(++_0x3dfe3b);}(_0x7f68,0x11a));var _0x87f6=function(_0x40a4ee,_0x515400){_0x40a4ee=_0x40a4ee-0x0;var _0x57c3cc=_0x7f68[_0x40a4ee];return _0x57c3cc;};'use strict';var multer=require(_0x87f6('0x0'));var util=require('util');var path=require(_0x87f6('0x1'));var timeout=require('connect-timeout');var express=require(_0x87f6('0x2'));var router=express['Router']();var fs_extra=require(_0x87f6('0x3'));var auth=require(_0x87f6('0x4'));var interaction=require(_0x87f6('0x5'));var config=require('../../config/environment');var controller=require(_0x87f6('0x6'));router[_0x87f6('0x7')]('/',auth[_0x87f6('0x8')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x87f6('0x7')](_0x87f6('0x9'),auth[_0x87f6('0x8')](),controller[_0x87f6('0xa')]);router['get'](_0x87f6('0xb'),auth[_0x87f6('0x8')](),controller[_0x87f6('0xc')]);router[_0x87f6('0x7')]('/:id/actions',auth[_0x87f6('0x8')](),controller[_0x87f6('0xd')]);router[_0x87f6('0xe')]('/',auth[_0x87f6('0x8')](),controller[_0x87f6('0xf')]);router['post']('/:id/all_conditions',auth[_0x87f6('0x8')](),controller[_0x87f6('0x10')]);router[_0x87f6('0xe')](_0x87f6('0xb'),auth[_0x87f6('0x8')](),controller[_0x87f6('0x11')]);router[_0x87f6('0xe')](_0x87f6('0x12'),auth[_0x87f6('0x8')](),controller['addAction']);router[_0x87f6('0x13')](_0x87f6('0x14'),auth[_0x87f6('0x8')](),controller['update']);router['delete'](_0x87f6('0x14'),auth[_0x87f6('0x8')](),controller[_0x87f6('0x15')]);module['exports']=router; \ No newline at end of file +var _0xca99=['Router','fs-extra','../../components/interaction/service','./trigger.controller','isAuthenticated','index','get','/:id','/:id/all_conditions','getAllConditions','/:id/any_conditions','post','create','addAllCondition','addAnyCondition','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x1d1963,_0x32cc0e){var _0x3f58bb=function(_0x514823){while(--_0x514823){_0x1d1963['push'](_0x1d1963['shift']());}};_0x3f58bb(++_0x32cc0e);}(_0xca99,0xca));var _0x9ca9=function(_0x5a300a,_0x198ebb){_0x5a300a=_0x5a300a-0x0;var _0xb2260f=_0xca99[_0x5a300a];return _0xb2260f;};'use strict';var multer=require(_0x9ca9('0x0'));var util=require(_0x9ca9('0x1'));var path=require(_0x9ca9('0x2'));var timeout=require(_0x9ca9('0x3'));var express=require(_0x9ca9('0x4'));var router=express[_0x9ca9('0x5')]();var fs_extra=require(_0x9ca9('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9ca9('0x7'));var config=require('../../config/environment');var controller=require(_0x9ca9('0x8'));router['get']('/',auth[_0x9ca9('0x9')](),controller[_0x9ca9('0xa')]);router[_0x9ca9('0xb')](_0x9ca9('0xc'),auth[_0x9ca9('0x9')](),controller['show']);router[_0x9ca9('0xb')](_0x9ca9('0xd'),auth[_0x9ca9('0x9')](),controller[_0x9ca9('0xe')]);router[_0x9ca9('0xb')](_0x9ca9('0xf'),auth[_0x9ca9('0x9')](),controller['getAnyConditions']);router[_0x9ca9('0xb')]('/:id/actions',auth['isAuthenticated'](),controller['getActions']);router[_0x9ca9('0x10')]('/',auth[_0x9ca9('0x9')](),controller[_0x9ca9('0x11')]);router[_0x9ca9('0x10')](_0x9ca9('0xd'),auth[_0x9ca9('0x9')](),controller[_0x9ca9('0x12')]);router['post'](_0x9ca9('0xf'),auth[_0x9ca9('0x9')](),controller[_0x9ca9('0x13')]);router[_0x9ca9('0x10')]('/:id/actions',auth[_0x9ca9('0x9')](),controller['addAction']);router['put'](_0x9ca9('0xc'),auth[_0x9ca9('0x9')](),controller[_0x9ca9('0x14')]);router['delete'](_0x9ca9('0xc'),auth[_0x9ca9('0x9')](),controller[_0x9ca9('0x15')]);module[_0x9ca9('0x16')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index cbdf519..11c9ae0 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 _0x1f30=['STRING','sequelize','exports'];(function(_0x4ac277,_0x58e86a){var _0xfabd70=function(_0x3a73ee){while(--_0x3a73ee){_0x4ac277['push'](_0x4ac277['shift']());}};_0xfabd70(++_0x58e86a);}(_0x1f30,0x8b));var _0x01f3=function(_0x18f52c,_0x4cddb7){_0x18f52c=_0x18f52c-0x0;var _0x474010=_0x1f30[_0x18f52c];return _0x474010;};'use strict';var Sequelize=require(_0x01f3('0x0'));module[_0x01f3('0x1')]={'name':{'type':Sequelize[_0x01f3('0x2')]},'channel':{'type':Sequelize[_0x01f3('0x2')]},'description':{'type':Sequelize[_0x01f3('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x6cae=['sequelize','exports','STRING','BOOLEAN'];(function(_0x463aad,_0x1bd8b4){var _0x215b30=function(_0x471650){while(--_0x471650){_0x463aad['push'](_0x463aad['shift']());}};_0x215b30(++_0x1bd8b4);}(_0x6cae,0xf0));var _0xe6ca=function(_0x3b0bc1,_0x1894d0){_0x3b0bc1=_0x3b0bc1-0x0;var _0x458538=_0x6cae[_0x3b0bc1];return _0x458538;};'use strict';var Sequelize=require(_0xe6ca('0x0'));module[_0xe6ca('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe6ca('0x2')]},'description':{'type':Sequelize[_0xe6ca('0x2')]},'status':{'type':Sequelize[_0xe6ca('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index dade275..583cd88 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 _0xb34f=['Action','getActions','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','get','Triggers','UserProfileResource','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','include','rows','catch','show','fields','includeAll','find','create','Trigger','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','params','addAllCondition','TriggerAllId','Condition','getAllConditions','findOne','getAnyConditions','addAction','TriggerId'];(function(_0x2f7e3a,_0x489379){var _0x47d542=function(_0xaba3cf){while(--_0xaba3cf){_0x2f7e3a['push'](_0x2f7e3a['shift']());}};_0x47d542(++_0x489379);}(_0xb34f,0x1d8));var _0xfb34=function(_0x34a8f0,_0x43525b){_0x34a8f0=_0x34a8f0-0x0;var _0x14b452=_0xb34f[_0x34a8f0];return _0x14b452;};'use strict';var emlformat=require(_0xfb34('0x0'));var rimraf=require(_0xfb34('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfb34('0x2'));var rp=require('request-promise');var moment=require(_0xfb34('0x3'));var BPromise=require(_0xfb34('0x4'));var Mustache=require(_0xfb34('0x5'));var util=require(_0xfb34('0x6'));var path=require(_0xfb34('0x7'));var sox=require('sox');var csv=require(_0xfb34('0x8'));var ejs=require(_0xfb34('0x9'));var fs=require('fs');var fs_extra=require(_0xfb34('0xa'));var _=require(_0xfb34('0xb'));var squel=require(_0xfb34('0xc'));var crypto=require(_0xfb34('0xd'));var jsforce=require(_0xfb34('0xe'));var deskjs=require(_0xfb34('0xf'));var toCsv=require(_0xfb34('0x8'));var querystring=require(_0xfb34('0x10'));var Papa=require(_0xfb34('0x11'));var Redis=require(_0xfb34('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfb34('0x13'));var logger=require(_0xfb34('0x14'))('api');var utils=require(_0xfb34('0x15'));var config=require(_0xfb34('0x16'));var licenseUtil=require(_0xfb34('0x17'));var db=require(_0xfb34('0x18'))['db'];function respondWithStatusCode(_0x34bab8,_0x5a0647){_0x5a0647=_0x5a0647||0xcc;return function(_0x353922){if(_0x353922){return _0x34bab8['sendStatus'](_0x5a0647);}return _0x34bab8[_0xfb34('0x19')](_0x5a0647)[_0xfb34('0x1a')]();};}function respondWithResult(_0x27dcfa,_0x29796a){_0x29796a=_0x29796a||0xc8;return function(_0x15e881){if(_0x15e881){return _0x27dcfa[_0xfb34('0x19')](_0x29796a)[_0xfb34('0x1b')](_0x15e881);}};}function respondWithFilteredResult(_0x29079c,_0x207ec1){return function(_0x3db11d){if(_0x3db11d){var _0x3e1f0f=typeof _0x207ec1[_0xfb34('0x1c')]===_0xfb34('0x1d')&&typeof _0x207ec1[_0xfb34('0x1e')]===_0xfb34('0x1d');var _0x25df1f=_0x3db11d[_0xfb34('0x1f')];var _0x5ab39c=_0x3e1f0f?0x0:_0x207ec1['offset'];var _0x542c9c=_0x3e1f0f?_0x3db11d[_0xfb34('0x1f')]:_0x207ec1[_0xfb34('0x1c')]+_0x207ec1[_0xfb34('0x1e')];var _0x1da553;if(_0x542c9c>=_0x25df1f){_0x542c9c=_0x25df1f;_0x1da553=0xc8;}else{_0x1da553=0xce;}_0x29079c[_0xfb34('0x19')](_0x1da553);return _0x29079c[_0xfb34('0x20')]('Content-Range',_0x5ab39c+'-'+_0x542c9c+'/'+_0x25df1f)[_0xfb34('0x1b')](_0x3db11d);}return null;};}function patchUpdates(_0x2699bd){return function(_0x22209c){try{jsonpatch[_0xfb34('0x21')](_0x22209c,_0x2699bd,!![]);}catch(_0x1381f0){return BPromise['reject'](_0x1381f0);}return _0x22209c[_0xfb34('0x22')]();};}function saveUpdates(_0x420c9b,_0x2e6ed7){return function(_0x34a6ad){if(_0x34a6ad){return _0x34a6ad[_0xfb34('0x23')](_0x420c9b)[_0xfb34('0x24')](function(_0x17575c){return _0x17575c;});}return null;};}function removeEntity(_0x5f4bec,_0x2af0f4){return function(_0x155c72){if(_0x155c72){return _0x155c72['destroy']()[_0xfb34('0x24')](function(){var _0x24ee4c=_0x155c72[_0xfb34('0x25')]({'plain':!![]});var _0x170f92=_0xfb34('0x26');return db[_0xfb34('0x27')][_0xfb34('0x28')]({'where':{'type':_0x170f92,'resourceId':_0x24ee4c['id']}})[_0xfb34('0x24')](function(){return _0x155c72;});})[_0xfb34('0x24')](function(){_0x5f4bec[_0xfb34('0x19')](0xcc)[_0xfb34('0x1a')]();});}};}function handleEntityNotFound(_0x5dc5a9,_0x508db3){return function(_0xbe587d){if(!_0xbe587d){_0x5dc5a9[_0xfb34('0x29')](0x194);}return _0xbe587d;};}function handleError(_0x1495d3,_0x278fb9){_0x278fb9=_0x278fb9||0x1f4;return function(_0x3daad9){logger[_0xfb34('0x2a')](_0x3daad9['stack']);if(_0x3daad9[_0xfb34('0x2b')]){delete _0x3daad9[_0xfb34('0x2b')];}_0x1495d3[_0xfb34('0x19')](_0x278fb9)[_0xfb34('0x2c')](_0x3daad9);};}exports[_0xfb34('0x2d')]=function(_0x33a9c2,_0x5e4461){var _0x1fb132={},_0x10ebe4={},_0x2ed8ee={'count':0x0,'rows':[]};var _0x12d3cd=_[_0xfb34('0x2e')](db['Trigger'][_0xfb34('0x2f')],function(_0xec047){return{'name':_0xec047[_0xfb34('0x30')],'type':_0xec047['type']['key']};});_0x10ebe4['model']=_[_0xfb34('0x2e')](_0x12d3cd,_0xfb34('0x2b'));_0x10ebe4[_0xfb34('0x31')]=_[_0xfb34('0x32')](_0x33a9c2['query']);_0x10ebe4[_0xfb34('0x33')]=_[_0xfb34('0x34')](_0x10ebe4[_0xfb34('0x35')],_0x10ebe4[_0xfb34('0x31')]);_0x1fb132['attributes']=_['intersection'](_0x10ebe4[_0xfb34('0x35')],qs['fields'](_0x33a9c2[_0xfb34('0x31')]['fields']));_0x1fb132[_0xfb34('0x36')]=_0x1fb132[_0xfb34('0x36')][_0xfb34('0x37')]?_0x1fb132[_0xfb34('0x36')]:_0x10ebe4[_0xfb34('0x35')];if(!_0x33a9c2['query'][_0xfb34('0x38')](_0xfb34('0x39'))){_0x1fb132['limit']=qs['limit'](_0x33a9c2[_0xfb34('0x31')]['limit']);_0x1fb132['offset']=qs['offset'](_0x33a9c2[_0xfb34('0x31')][_0xfb34('0x1c')]);}_0x1fb132[_0xfb34('0x3a')]=qs[_0xfb34('0x3b')](_0x33a9c2[_0xfb34('0x31')][_0xfb34('0x3b')]);_0x1fb132[_0xfb34('0x3c')]=qs['filters'](_[_0xfb34('0x3d')](_0x33a9c2[_0xfb34('0x31')],_0x10ebe4[_0xfb34('0x33')]),_0x12d3cd);if(_0x33a9c2[_0xfb34('0x31')]['filter']){_0x1fb132['where']=_['merge'](_0x1fb132[_0xfb34('0x3c')],{'$or':_['map'](_0x12d3cd,function(_0x28aae8){if(_0x28aae8[_0xfb34('0x3e')]!==_0xfb34('0x3f')){var _0x38b53a={};_0x38b53a[_0x28aae8[_0xfb34('0x2b')]]={'$like':'%'+_0x33a9c2[_0xfb34('0x31')][_0xfb34('0x40')]+'%'};return _0x38b53a;}})});}_0x1fb132=_[_0xfb34('0x41')]({},_0x1fb132,_0x33a9c2[_0xfb34('0x42')]);var _0xd3b5c5={'where':_0x1fb132['where']};return db['Trigger'][_0xfb34('0x1f')](_0xd3b5c5)[_0xfb34('0x24')](function(_0xabf591){_0x2ed8ee[_0xfb34('0x1f')]=_0xabf591;if(_0x33a9c2[_0xfb34('0x31')]['includeAll']){_0x1fb132[_0xfb34('0x43')]=[{'all':!![]}];}return db['Trigger']['findAll'](_0x1fb132);})[_0xfb34('0x24')](function(_0xda35dc){_0x2ed8ee[_0xfb34('0x44')]=_0xda35dc;return _0x2ed8ee;})[_0xfb34('0x24')](respondWithFilteredResult(_0x5e4461,_0x1fb132))[_0xfb34('0x45')](handleError(_0x5e4461,null));};exports[_0xfb34('0x46')]=function(_0xa5abb8,_0x21f537){var _0x37de07={'raw':![],'where':{'id':_0xa5abb8['params']['id']}},_0x304c30={};_0x304c30[_0xfb34('0x35')]=_[_0xfb34('0x32')](db['Trigger'][_0xfb34('0x2f')]);_0x304c30[_0xfb34('0x31')]=_[_0xfb34('0x32')](_0xa5abb8[_0xfb34('0x31')]);_0x304c30[_0xfb34('0x33')]=_[_0xfb34('0x34')](_0x304c30['model'],_0x304c30[_0xfb34('0x31')]);_0x37de07[_0xfb34('0x36')]=_[_0xfb34('0x34')](_0x304c30[_0xfb34('0x35')],qs['fields'](_0xa5abb8[_0xfb34('0x31')][_0xfb34('0x47')]));_0x37de07[_0xfb34('0x36')]=_0x37de07['attributes'][_0xfb34('0x37')]?_0x37de07['attributes']:_0x304c30[_0xfb34('0x35')];if(_0xa5abb8[_0xfb34('0x31')][_0xfb34('0x48')]){_0x37de07[_0xfb34('0x43')]=[{'all':!![]}];}_0x37de07=_[_0xfb34('0x41')]({},_0x37de07,_0xa5abb8['options']);return db['Trigger'][_0xfb34('0x49')](_0x37de07)['then'](handleEntityNotFound(_0x21f537,null))[_0xfb34('0x24')](respondWithResult(_0x21f537,null))[_0xfb34('0x45')](handleError(_0x21f537,null));};exports[_0xfb34('0x4a')]=function(_0x131ab2,_0x277471){return db[_0xfb34('0x4b')][_0xfb34('0x4a')](_0x131ab2[_0xfb34('0x4c')],{})[_0xfb34('0x24')](function(_0x59190f){var _0x594f6d=_0x131ab2['user'][_0xfb34('0x25')]({'plain':!![]});if(!_0x594f6d)throw new Error(_0xfb34('0x4d'));if(_0x594f6d[_0xfb34('0x4e')]===_0xfb34('0x4f')){var _0x50c96f=_0x59190f[_0xfb34('0x25')]({'plain':!![]});var _0x1d9b50=_0xfb34('0x26');return db[_0xfb34('0x50')][_0xfb34('0x49')]({'where':{'name':_0x1d9b50,'userProfileId':_0x594f6d[_0xfb34('0x51')]},'raw':!![]})[_0xfb34('0x24')](function(_0x41efb2){if(_0x41efb2&&_0x41efb2[_0xfb34('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x50c96f[_0xfb34('0x2b')],'resourceId':_0x50c96f['id'],'type':_0x41efb2[_0xfb34('0x2b')],'sectionId':_0x41efb2['id']},{})[_0xfb34('0x24')](function(){return _0x59190f;});}else{return _0x59190f;}})[_0xfb34('0x45')](function(_0x2e6299){logger[_0xfb34('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e6299);throw _0x2e6299;});}return _0x59190f;})[_0xfb34('0x24')](respondWithResult(_0x277471,0xc9))[_0xfb34('0x45')](handleError(_0x277471,null));};exports[_0xfb34('0x23')]=function(_0x169cfc,_0x59b37f){if(_0x169cfc[_0xfb34('0x4c')]['id']){delete _0x169cfc['body']['id'];}return db['Trigger'][_0xfb34('0x49')]({'where':{'id':_0x169cfc[_0xfb34('0x53')]['id']}})[_0xfb34('0x24')](handleEntityNotFound(_0x59b37f,null))[_0xfb34('0x24')](saveUpdates(_0x169cfc[_0xfb34('0x4c')],null))[_0xfb34('0x24')](respondWithResult(_0x59b37f,null))[_0xfb34('0x45')](handleError(_0x59b37f,null));};exports['destroy']=function(_0x1cf04e,_0x4ac91f){return db[_0xfb34('0x4b')]['find']({'where':{'id':_0x1cf04e[_0xfb34('0x53')]['id']}})[_0xfb34('0x24')](handleEntityNotFound(_0x4ac91f,null))[_0xfb34('0x24')](removeEntity(_0x4ac91f,null))[_0xfb34('0x45')](handleError(_0x4ac91f,null));};exports[_0xfb34('0x54')]=function(_0x114f07,_0x1ee7b6,_0x4e514f){if(_0x114f07[_0xfb34('0x4c')]['id']){delete _0x114f07[_0xfb34('0x4c')]['id'];}return db[_0xfb34('0x4b')][_0xfb34('0x49')]({'where':{'id':_0x114f07['params']['id']}})[_0xfb34('0x24')](handleEntityNotFound(_0x1ee7b6,null))['then'](function(_0x360eff){if(_0x360eff){_0x114f07[_0xfb34('0x4c')][_0xfb34('0x55')]=_0x360eff['id'];return db[_0xfb34('0x56')][_0xfb34('0x4a')](_0x114f07[_0xfb34('0x4c')]);}})[_0xfb34('0x24')](respondWithResult(_0x1ee7b6,null))[_0xfb34('0x45')](handleError(_0x1ee7b6,null));};exports['addAnyCondition']=function(_0x206994,_0x2e5d62,_0x4f8c00){if(_0x206994[_0xfb34('0x4c')]['id']){delete _0x206994[_0xfb34('0x4c')]['id'];}return db[_0xfb34('0x4b')][_0xfb34('0x49')]({'where':{'id':_0x206994[_0xfb34('0x53')]['id']}})[_0xfb34('0x24')](handleEntityNotFound(_0x2e5d62,null))[_0xfb34('0x24')](function(_0x202fb2){if(_0x202fb2){_0x206994[_0xfb34('0x4c')]['TriggerAnyId']=_0x202fb2['id'];return db[_0xfb34('0x56')][_0xfb34('0x4a')](_0x206994[_0xfb34('0x4c')]);}})[_0xfb34('0x24')](respondWithResult(_0x2e5d62,null))['catch'](handleError(_0x2e5d62,null));};exports[_0xfb34('0x57')]=function(_0x2a06fd,_0x1d2dc9,_0x191f34){var _0x5cab82={};var _0x4b8227={};var _0x542a74;var _0x11449c;return db[_0xfb34('0x4b')][_0xfb34('0x58')]({'where':{'id':_0x2a06fd[_0xfb34('0x53')]['id']}})[_0xfb34('0x24')](handleEntityNotFound(_0x1d2dc9,null))[_0xfb34('0x24')](function(_0x21606c){if(_0x21606c){_0x542a74=_0x21606c;_0x4b8227[_0xfb34('0x35')]=_[_0xfb34('0x32')](db['Condition'][_0xfb34('0x2f')]);_0x4b8227[_0xfb34('0x31')]=_['keys'](_0x2a06fd[_0xfb34('0x31')]);_0x4b8227[_0xfb34('0x33')]=_[_0xfb34('0x34')](_0x4b8227[_0xfb34('0x35')],_0x4b8227[_0xfb34('0x31')]);_0x5cab82['attributes']=_[_0xfb34('0x34')](_0x4b8227[_0xfb34('0x35')],qs[_0xfb34('0x47')](_0x2a06fd[_0xfb34('0x31')][_0xfb34('0x47')]));_0x5cab82[_0xfb34('0x36')]=_0x5cab82['attributes']['length']?_0x5cab82[_0xfb34('0x36')]:_0x4b8227[_0xfb34('0x35')];_0x5cab82[_0xfb34('0x3a')]=qs['sort'](_0x2a06fd[_0xfb34('0x31')][_0xfb34('0x3b')]);_0x5cab82[_0xfb34('0x3c')]=qs[_0xfb34('0x33')](_[_0xfb34('0x3d')](_0x2a06fd[_0xfb34('0x31')],_0x4b8227[_0xfb34('0x33')]));if(_0x2a06fd['query'][_0xfb34('0x40')]){_0x5cab82[_0xfb34('0x3c')]=_['merge'](_0x5cab82[_0xfb34('0x3c')],{'$or':_['map'](_0x5cab82['attributes'],function(_0x5b8d66){var _0x22677a={};_0x22677a[_0x5b8d66]={'$like':'%'+_0x2a06fd[_0xfb34('0x31')][_0xfb34('0x40')]+'%'};return _0x22677a;})});}_0x5cab82=_['merge']({},_0x5cab82,_0x2a06fd['options']);return _0x542a74['getAllConditions'](_0x5cab82);}})[_0xfb34('0x24')](function(_0x392820){if(_0x392820){_0x11449c=_0x392820[_0xfb34('0x37')];if(!_0x2a06fd['query']['hasOwnProperty'](_0xfb34('0x39'))){_0x5cab82['limit']=qs['limit'](_0x2a06fd['query'][_0xfb34('0x1e')]);_0x5cab82[_0xfb34('0x1c')]=qs[_0xfb34('0x1c')](_0x2a06fd[_0xfb34('0x31')][_0xfb34('0x1c')]);}return _0x542a74['getAllConditions'](_0x5cab82);}})['then'](function(_0x44f0e6){if(_0x44f0e6){return _0x44f0e6?{'count':_0x11449c,'rows':_0x44f0e6}:null;}})['then'](respondWithResult(_0x1d2dc9,null))['catch'](handleError(_0x1d2dc9,null));};exports['getAnyConditions']=function(_0x1fb1a5,_0xc49f27,_0x515b6c){var _0x173819={};var _0x32fed0={};var _0x78ce6e;var _0x3c35ef;return db[_0xfb34('0x4b')][_0xfb34('0x58')]({'where':{'id':_0x1fb1a5[_0xfb34('0x53')]['id']}})[_0xfb34('0x24')](handleEntityNotFound(_0xc49f27,null))[_0xfb34('0x24')](function(_0x238efb){if(_0x238efb){_0x78ce6e=_0x238efb;_0x32fed0[_0xfb34('0x35')]=_[_0xfb34('0x32')](db[_0xfb34('0x56')][_0xfb34('0x2f')]);_0x32fed0['query']=_[_0xfb34('0x32')](_0x1fb1a5[_0xfb34('0x31')]);_0x32fed0[_0xfb34('0x33')]=_[_0xfb34('0x34')](_0x32fed0[_0xfb34('0x35')],_0x32fed0[_0xfb34('0x31')]);_0x173819[_0xfb34('0x36')]=_[_0xfb34('0x34')](_0x32fed0[_0xfb34('0x35')],qs[_0xfb34('0x47')](_0x1fb1a5[_0xfb34('0x31')][_0xfb34('0x47')]));_0x173819[_0xfb34('0x36')]=_0x173819['attributes'][_0xfb34('0x37')]?_0x173819[_0xfb34('0x36')]:_0x32fed0[_0xfb34('0x35')];_0x173819['order']=qs[_0xfb34('0x3b')](_0x1fb1a5[_0xfb34('0x31')][_0xfb34('0x3b')]);_0x173819[_0xfb34('0x3c')]=qs[_0xfb34('0x33')](_[_0xfb34('0x3d')](_0x1fb1a5['query'],_0x32fed0['filters']));if(_0x1fb1a5[_0xfb34('0x31')][_0xfb34('0x40')]){_0x173819[_0xfb34('0x3c')]=_[_0xfb34('0x41')](_0x173819[_0xfb34('0x3c')],{'$or':_[_0xfb34('0x2e')](_0x173819[_0xfb34('0x36')],function(_0x59d5ae){var _0x24b46b={};_0x24b46b[_0x59d5ae]={'$like':'%'+_0x1fb1a5['query']['filter']+'%'};return _0x24b46b;})});}_0x173819=_[_0xfb34('0x41')]({},_0x173819,_0x1fb1a5[_0xfb34('0x42')]);return _0x78ce6e[_0xfb34('0x59')](_0x173819);}})[_0xfb34('0x24')](function(_0x3c6c5a){if(_0x3c6c5a){_0x3c35ef=_0x3c6c5a[_0xfb34('0x37')];if(!_0x1fb1a5['query'][_0xfb34('0x38')](_0xfb34('0x39'))){_0x173819[_0xfb34('0x1e')]=qs['limit'](_0x1fb1a5[_0xfb34('0x31')][_0xfb34('0x1e')]);_0x173819[_0xfb34('0x1c')]=qs[_0xfb34('0x1c')](_0x1fb1a5[_0xfb34('0x31')][_0xfb34('0x1c')]);}return _0x78ce6e['getAnyConditions'](_0x173819);}})[_0xfb34('0x24')](function(_0x41e29d){if(_0x41e29d){return _0x41e29d?{'count':_0x3c35ef,'rows':_0x41e29d}:null;}})[_0xfb34('0x24')](respondWithResult(_0xc49f27,null))['catch'](handleError(_0xc49f27,null));};exports[_0xfb34('0x5a')]=function(_0x2d1315,_0x28e783,_0x248cdf){if(_0x2d1315[_0xfb34('0x4c')]['id']){delete _0x2d1315[_0xfb34('0x4c')]['id'];}return db[_0xfb34('0x4b')][_0xfb34('0x49')]({'where':{'id':_0x2d1315['params']['id']}})[_0xfb34('0x24')](handleEntityNotFound(_0x28e783,null))[_0xfb34('0x24')](function(_0x5d14e1){if(_0x5d14e1){_0x2d1315['body'][_0xfb34('0x5b')]=_0x5d14e1['id'];return db[_0xfb34('0x5c')][_0xfb34('0x4a')](_0x2d1315[_0xfb34('0x4c')]);}})[_0xfb34('0x24')](respondWithResult(_0x28e783,null))['catch'](handleError(_0x28e783,null));};exports[_0xfb34('0x5d')]=function(_0x5aecdc,_0x447909,_0x1d9353){var _0x80ab91={};var _0xcf4171={};var _0x47b160;var _0x2244a1;return db['Trigger']['findOne']({'where':{'id':_0x5aecdc['params']['id']}})[_0xfb34('0x24')](handleEntityNotFound(_0x447909,null))['then'](function(_0x5d0633){if(_0x5d0633){_0x47b160=_0x5d0633;_0xcf4171[_0xfb34('0x35')]=_['keys'](db[_0xfb34('0x5c')][_0xfb34('0x2f')]);_0xcf4171[_0xfb34('0x31')]=_[_0xfb34('0x32')](_0x5aecdc[_0xfb34('0x31')]);_0xcf4171[_0xfb34('0x33')]=_[_0xfb34('0x34')](_0xcf4171[_0xfb34('0x35')],_0xcf4171['query']);_0x80ab91['attributes']=_[_0xfb34('0x34')](_0xcf4171[_0xfb34('0x35')],qs[_0xfb34('0x47')](_0x5aecdc[_0xfb34('0x31')][_0xfb34('0x47')]));_0x80ab91['attributes']=_0x80ab91[_0xfb34('0x36')][_0xfb34('0x37')]?_0x80ab91[_0xfb34('0x36')]:_0xcf4171['model'];_0x80ab91[_0xfb34('0x3a')]=qs[_0xfb34('0x3b')](_0x5aecdc['query'][_0xfb34('0x3b')]);_0x80ab91[_0xfb34('0x3c')]=qs[_0xfb34('0x33')](_[_0xfb34('0x3d')](_0x5aecdc[_0xfb34('0x31')],_0xcf4171[_0xfb34('0x33')]));if(_0x5aecdc[_0xfb34('0x31')][_0xfb34('0x40')]){_0x80ab91[_0xfb34('0x3c')]=_[_0xfb34('0x41')](_0x80ab91[_0xfb34('0x3c')],{'$or':_['map'](_0x80ab91[_0xfb34('0x36')],function(_0x1b9eef){var _0x13f1ab={};_0x13f1ab[_0x1b9eef]={'$like':'%'+_0x5aecdc['query'][_0xfb34('0x40')]+'%'};return _0x13f1ab;})});}_0x80ab91=_[_0xfb34('0x41')]({},_0x80ab91,_0x5aecdc[_0xfb34('0x42')]);return _0x47b160[_0xfb34('0x5d')](_0x80ab91);}})[_0xfb34('0x24')](function(_0x4436c2){if(_0x4436c2){_0x2244a1=_0x4436c2[_0xfb34('0x37')];if(!_0x5aecdc['query'][_0xfb34('0x38')](_0xfb34('0x39'))){_0x80ab91[_0xfb34('0x1e')]=qs[_0xfb34('0x1e')](_0x5aecdc[_0xfb34('0x31')][_0xfb34('0x1e')]);_0x80ab91[_0xfb34('0x1c')]=qs[_0xfb34('0x1c')](_0x5aecdc[_0xfb34('0x31')][_0xfb34('0x1c')]);}return _0x47b160[_0xfb34('0x5d')](_0x80ab91);}})['then'](function(_0x53b18){if(_0x53b18){return _0x53b18?{'count':_0x2244a1,'rows':_0x53b18}:null;}})[_0xfb34('0x24')](respondWithResult(_0x447909,null))[_0xfb34('0x45')](handleError(_0x447909,null));}; \ No newline at end of file +var _0x8a9c=['crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','save','update','then','get','Triggers','UserProfileResource','end','error','stack','name','index','map','Trigger','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','addAllCondition','TriggerAllId','Condition','addAnyCondition','getAllConditions','getAnyConditions','findOne','addAction','TriggerId','Action','getActions','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x357985,_0x6f311e){var _0x1524dd=function(_0x3384c0){while(--_0x3384c0){_0x357985['push'](_0x357985['shift']());}};_0x1524dd(++_0x6f311e);}(_0x8a9c,0x16b));var _0xc8a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a9c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc8a9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc8a9('0x1'));var jsonpatch=require(_0xc8a9('0x2'));var rp=require('request-promise');var moment=require(_0xc8a9('0x3'));var BPromise=require(_0xc8a9('0x4'));var Mustache=require(_0xc8a9('0x5'));var util=require(_0xc8a9('0x6'));var path=require(_0xc8a9('0x7'));var sox=require(_0xc8a9('0x8'));var csv=require(_0xc8a9('0x9'));var ejs=require(_0xc8a9('0xa'));var fs=require('fs');var fs_extra=require(_0xc8a9('0xb'));var _=require(_0xc8a9('0xc'));var squel=require('squel');var crypto=require(_0xc8a9('0xd'));var jsforce=require(_0xc8a9('0xe'));var deskjs=require(_0xc8a9('0xf'));var toCsv=require(_0xc8a9('0x9'));var querystring=require(_0xc8a9('0x10'));var Papa=require('papaparse');var Redis=require(_0xc8a9('0x11'));var authService=require(_0xc8a9('0x12'));var qs=require(_0xc8a9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc8a9('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xc8a9('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc8a9('0x16'));var db=require(_0xc8a9('0x17'))['db'];function respondWithStatusCode(_0x31d365,_0x214540){_0x214540=_0x214540||0xcc;return function(_0x5120f3){if(_0x5120f3){return _0x31d365[_0xc8a9('0x18')](_0x214540);}return _0x31d365[_0xc8a9('0x19')](_0x214540)['end']();};}function respondWithResult(_0x366850,_0x35ff94){_0x35ff94=_0x35ff94||0xc8;return function(_0x5da69e){if(_0x5da69e){return _0x366850['status'](_0x35ff94)[_0xc8a9('0x1a')](_0x5da69e);}};}function respondWithFilteredResult(_0x4e502e,_0x23593f){return function(_0x2cd7b8){if(_0x2cd7b8){var _0x1110ae=typeof _0x23593f[_0xc8a9('0x1b')]==='undefined'&&typeof _0x23593f['limit']===_0xc8a9('0x1c');var _0x5a2e28=_0x2cd7b8[_0xc8a9('0x1d')];var _0xf9b6a2=_0x1110ae?0x0:_0x23593f['offset'];var _0x2528a5=_0x1110ae?_0x2cd7b8[_0xc8a9('0x1d')]:_0x23593f['offset']+_0x23593f[_0xc8a9('0x1e')];var _0x2f502e;if(_0x2528a5>=_0x5a2e28){_0x2528a5=_0x5a2e28;_0x2f502e=0xc8;}else{_0x2f502e=0xce;}_0x4e502e[_0xc8a9('0x19')](_0x2f502e);return _0x4e502e[_0xc8a9('0x1f')]('Content-Range',_0xf9b6a2+'-'+_0x2528a5+'/'+_0x5a2e28)[_0xc8a9('0x1a')](_0x2cd7b8);}return null;};}function patchUpdates(_0x4e2303){return function(_0x724c4c){try{jsonpatch[_0xc8a9('0x20')](_0x724c4c,_0x4e2303,!![]);}catch(_0x32b0dc){return BPromise['reject'](_0x32b0dc);}return _0x724c4c[_0xc8a9('0x21')]();};}function saveUpdates(_0x541578,_0x5cecca){return function(_0x5ae81c){if(_0x5ae81c){return _0x5ae81c[_0xc8a9('0x22')](_0x541578)[_0xc8a9('0x23')](function(_0x9a64f8){return _0x9a64f8;});}return null;};}function removeEntity(_0x9070a0,_0x54132b){return function(_0x256946){if(_0x256946){return _0x256946['destroy']()['then'](function(){var _0x4e2174=_0x256946[_0xc8a9('0x24')]({'plain':!![]});var _0x38b4e6=_0xc8a9('0x25');return db[_0xc8a9('0x26')]['destroy']({'where':{'type':_0x38b4e6,'resourceId':_0x4e2174['id']}})[_0xc8a9('0x23')](function(){return _0x256946;});})[_0xc8a9('0x23')](function(){_0x9070a0[_0xc8a9('0x19')](0xcc)[_0xc8a9('0x27')]();});}};}function handleEntityNotFound(_0x2bdba5,_0xd805b6){return function(_0x2726cc){if(!_0x2726cc){_0x2bdba5[_0xc8a9('0x18')](0x194);}return _0x2726cc;};}function handleError(_0x5ecbdb,_0x19881a){_0x19881a=_0x19881a||0x1f4;return function(_0x1d03d7){logger[_0xc8a9('0x28')](_0x1d03d7[_0xc8a9('0x29')]);if(_0x1d03d7[_0xc8a9('0x2a')]){delete _0x1d03d7[_0xc8a9('0x2a')];}_0x5ecbdb[_0xc8a9('0x19')](_0x19881a)['send'](_0x1d03d7);};}exports[_0xc8a9('0x2b')]=function(_0x4646a4,_0x3eb776){var _0x44a1a7={},_0x33ea8d={},_0x440b9c={'count':0x0,'rows':[]};var _0x4788ed=_[_0xc8a9('0x2c')](db[_0xc8a9('0x2d')][_0xc8a9('0x2e')],function(_0x18ee3e){return{'name':_0x18ee3e[_0xc8a9('0x2f')],'type':_0x18ee3e[_0xc8a9('0x30')]['key']};});_0x33ea8d[_0xc8a9('0x31')]=_['map'](_0x4788ed,_0xc8a9('0x2a'));_0x33ea8d[_0xc8a9('0x32')]=_[_0xc8a9('0x33')](_0x4646a4['query']);_0x33ea8d[_0xc8a9('0x34')]=_['intersection'](_0x33ea8d['model'],_0x33ea8d[_0xc8a9('0x32')]);_0x44a1a7['attributes']=_[_0xc8a9('0x35')](_0x33ea8d[_0xc8a9('0x31')],qs[_0xc8a9('0x36')](_0x4646a4[_0xc8a9('0x32')][_0xc8a9('0x36')]));_0x44a1a7['attributes']=_0x44a1a7[_0xc8a9('0x37')]['length']?_0x44a1a7['attributes']:_0x33ea8d[_0xc8a9('0x31')];if(!_0x4646a4[_0xc8a9('0x32')][_0xc8a9('0x38')](_0xc8a9('0x39'))){_0x44a1a7[_0xc8a9('0x1e')]=qs[_0xc8a9('0x1e')](_0x4646a4['query'][_0xc8a9('0x1e')]);_0x44a1a7[_0xc8a9('0x1b')]=qs[_0xc8a9('0x1b')](_0x4646a4[_0xc8a9('0x32')][_0xc8a9('0x1b')]);}_0x44a1a7[_0xc8a9('0x3a')]=qs[_0xc8a9('0x3b')](_0x4646a4[_0xc8a9('0x32')][_0xc8a9('0x3b')]);_0x44a1a7[_0xc8a9('0x3c')]=qs[_0xc8a9('0x34')](_[_0xc8a9('0x3d')](_0x4646a4[_0xc8a9('0x32')],_0x33ea8d[_0xc8a9('0x34')]),_0x4788ed);if(_0x4646a4[_0xc8a9('0x32')]['filter']){_0x44a1a7[_0xc8a9('0x3c')]=_[_0xc8a9('0x3e')](_0x44a1a7[_0xc8a9('0x3c')],{'$or':_[_0xc8a9('0x2c')](_0x4788ed,function(_0x36a7d5){if(_0x36a7d5[_0xc8a9('0x30')]!=='VIRTUAL'){var _0x552e2d={};_0x552e2d[_0x36a7d5[_0xc8a9('0x2a')]]={'$like':'%'+_0x4646a4[_0xc8a9('0x32')][_0xc8a9('0x3f')]+'%'};return _0x552e2d;}})});}_0x44a1a7=_[_0xc8a9('0x3e')]({},_0x44a1a7,_0x4646a4[_0xc8a9('0x40')]);var _0x8542b2={'where':_0x44a1a7[_0xc8a9('0x3c')]};return db[_0xc8a9('0x2d')]['count'](_0x8542b2)[_0xc8a9('0x23')](function(_0x31def6){_0x440b9c[_0xc8a9('0x1d')]=_0x31def6;if(_0x4646a4[_0xc8a9('0x32')]['includeAll']){_0x44a1a7[_0xc8a9('0x41')]=[{'all':!![]}];}return db[_0xc8a9('0x2d')][_0xc8a9('0x42')](_0x44a1a7);})[_0xc8a9('0x23')](function(_0x435fba){_0x440b9c[_0xc8a9('0x43')]=_0x435fba;return _0x440b9c;})[_0xc8a9('0x23')](respondWithFilteredResult(_0x3eb776,_0x44a1a7))[_0xc8a9('0x44')](handleError(_0x3eb776,null));};exports[_0xc8a9('0x45')]=function(_0x37dae9,_0x1f0bf8){var _0x2cf3c7={'raw':![],'where':{'id':_0x37dae9[_0xc8a9('0x46')]['id']}},_0x3248f2={};_0x3248f2[_0xc8a9('0x31')]=_['keys'](db[_0xc8a9('0x2d')][_0xc8a9('0x2e')]);_0x3248f2['query']=_[_0xc8a9('0x33')](_0x37dae9['query']);_0x3248f2[_0xc8a9('0x34')]=_[_0xc8a9('0x35')](_0x3248f2[_0xc8a9('0x31')],_0x3248f2[_0xc8a9('0x32')]);_0x2cf3c7[_0xc8a9('0x37')]=_['intersection'](_0x3248f2['model'],qs['fields'](_0x37dae9[_0xc8a9('0x32')][_0xc8a9('0x36')]));_0x2cf3c7['attributes']=_0x2cf3c7[_0xc8a9('0x37')][_0xc8a9('0x47')]?_0x2cf3c7['attributes']:_0x3248f2[_0xc8a9('0x31')];if(_0x37dae9['query'][_0xc8a9('0x48')]){_0x2cf3c7['include']=[{'all':!![]}];}_0x2cf3c7=_[_0xc8a9('0x3e')]({},_0x2cf3c7,_0x37dae9[_0xc8a9('0x40')]);return db[_0xc8a9('0x2d')][_0xc8a9('0x49')](_0x2cf3c7)[_0xc8a9('0x23')](handleEntityNotFound(_0x1f0bf8,null))['then'](respondWithResult(_0x1f0bf8,null))['catch'](handleError(_0x1f0bf8,null));};exports['create']=function(_0x58d330,_0x350c5b){return db[_0xc8a9('0x2d')][_0xc8a9('0x4a')](_0x58d330[_0xc8a9('0x4b')],{})[_0xc8a9('0x23')](function(_0x212694){var _0x4ae3f8=_0x58d330[_0xc8a9('0x4c')][_0xc8a9('0x24')]({'plain':!![]});if(!_0x4ae3f8)throw new Error(_0xc8a9('0x4d'));if(_0x4ae3f8[_0xc8a9('0x4e')]===_0xc8a9('0x4c')){var _0x10561c=_0x212694[_0xc8a9('0x24')]({'plain':!![]});var _0xd81b64=_0xc8a9('0x25');return db['UserProfileSection']['find']({'where':{'name':_0xd81b64,'userProfileId':_0x4ae3f8[_0xc8a9('0x4f')]},'raw':!![]})[_0xc8a9('0x23')](function(_0x1409d2){if(_0x1409d2&&_0x1409d2[_0xc8a9('0x50')]===0x0){return db['UserProfileResource'][_0xc8a9('0x4a')]({'name':_0x10561c[_0xc8a9('0x2a')],'resourceId':_0x10561c['id'],'type':_0x1409d2[_0xc8a9('0x2a')],'sectionId':_0x1409d2['id']},{})[_0xc8a9('0x23')](function(){return _0x212694;});}else{return _0x212694;}})['catch'](function(_0x4e361a){logger['error'](_0xc8a9('0x51'),_0x4e361a);throw _0x4e361a;});}return _0x212694;})[_0xc8a9('0x23')](respondWithResult(_0x350c5b,0xc9))[_0xc8a9('0x44')](handleError(_0x350c5b,null));};exports[_0xc8a9('0x22')]=function(_0x3de934,_0x1eb46c){if(_0x3de934[_0xc8a9('0x4b')]['id']){delete _0x3de934[_0xc8a9('0x4b')]['id'];}return db[_0xc8a9('0x2d')]['find']({'where':{'id':_0x3de934[_0xc8a9('0x46')]['id']}})[_0xc8a9('0x23')](handleEntityNotFound(_0x1eb46c,null))[_0xc8a9('0x23')](saveUpdates(_0x3de934[_0xc8a9('0x4b')],null))[_0xc8a9('0x23')](respondWithResult(_0x1eb46c,null))[_0xc8a9('0x44')](handleError(_0x1eb46c,null));};exports[_0xc8a9('0x52')]=function(_0x14f2d5,_0x2fe4a9){return db[_0xc8a9('0x2d')][_0xc8a9('0x49')]({'where':{'id':_0x14f2d5['params']['id']}})[_0xc8a9('0x23')](handleEntityNotFound(_0x2fe4a9,null))['then'](removeEntity(_0x2fe4a9,null))[_0xc8a9('0x44')](handleError(_0x2fe4a9,null));};exports[_0xc8a9('0x53')]=function(_0x26abda,_0x51cad5,_0x2dc220){if(_0x26abda['body']['id']){delete _0x26abda[_0xc8a9('0x4b')]['id'];}return db[_0xc8a9('0x2d')][_0xc8a9('0x49')]({'where':{'id':_0x26abda['params']['id']}})['then'](handleEntityNotFound(_0x51cad5,null))[_0xc8a9('0x23')](function(_0x5ec1be){if(_0x5ec1be){_0x26abda['body'][_0xc8a9('0x54')]=_0x5ec1be['id'];return db[_0xc8a9('0x55')][_0xc8a9('0x4a')](_0x26abda[_0xc8a9('0x4b')]);}})['then'](respondWithResult(_0x51cad5,null))[_0xc8a9('0x44')](handleError(_0x51cad5,null));};exports[_0xc8a9('0x56')]=function(_0x6e7bd7,_0x18bee0,_0x21f895){if(_0x6e7bd7[_0xc8a9('0x4b')]['id']){delete _0x6e7bd7[_0xc8a9('0x4b')]['id'];}return db['Trigger'][_0xc8a9('0x49')]({'where':{'id':_0x6e7bd7[_0xc8a9('0x46')]['id']}})[_0xc8a9('0x23')](handleEntityNotFound(_0x18bee0,null))['then'](function(_0x4ff00){if(_0x4ff00){_0x6e7bd7['body']['TriggerAnyId']=_0x4ff00['id'];return db[_0xc8a9('0x55')][_0xc8a9('0x4a')](_0x6e7bd7[_0xc8a9('0x4b')]);}})[_0xc8a9('0x23')](respondWithResult(_0x18bee0,null))[_0xc8a9('0x44')](handleError(_0x18bee0,null));};exports['getAllConditions']=function(_0x2d6fe4,_0x5e1f6a,_0x16bae9){var _0x58f233={};var _0x479d25={};var _0x5057d8;var _0x50bbe8;return db[_0xc8a9('0x2d')]['findOne']({'where':{'id':_0x2d6fe4[_0xc8a9('0x46')]['id']}})[_0xc8a9('0x23')](handleEntityNotFound(_0x5e1f6a,null))[_0xc8a9('0x23')](function(_0x487457){if(_0x487457){_0x5057d8=_0x487457;_0x479d25[_0xc8a9('0x31')]=_['keys'](db[_0xc8a9('0x55')][_0xc8a9('0x2e')]);_0x479d25['query']=_['keys'](_0x2d6fe4[_0xc8a9('0x32')]);_0x479d25[_0xc8a9('0x34')]=_[_0xc8a9('0x35')](_0x479d25[_0xc8a9('0x31')],_0x479d25[_0xc8a9('0x32')]);_0x58f233[_0xc8a9('0x37')]=_[_0xc8a9('0x35')](_0x479d25[_0xc8a9('0x31')],qs['fields'](_0x2d6fe4['query']['fields']));_0x58f233[_0xc8a9('0x37')]=_0x58f233[_0xc8a9('0x37')]['length']?_0x58f233[_0xc8a9('0x37')]:_0x479d25['model'];_0x58f233[_0xc8a9('0x3a')]=qs[_0xc8a9('0x3b')](_0x2d6fe4[_0xc8a9('0x32')][_0xc8a9('0x3b')]);_0x58f233[_0xc8a9('0x3c')]=qs[_0xc8a9('0x34')](_[_0xc8a9('0x3d')](_0x2d6fe4['query'],_0x479d25[_0xc8a9('0x34')]));if(_0x2d6fe4[_0xc8a9('0x32')]['filter']){_0x58f233[_0xc8a9('0x3c')]=_[_0xc8a9('0x3e')](_0x58f233[_0xc8a9('0x3c')],{'$or':_[_0xc8a9('0x2c')](_0x58f233[_0xc8a9('0x37')],function(_0x28ce3d){var _0x148abc={};_0x148abc[_0x28ce3d]={'$like':'%'+_0x2d6fe4[_0xc8a9('0x32')][_0xc8a9('0x3f')]+'%'};return _0x148abc;})});}_0x58f233=_[_0xc8a9('0x3e')]({},_0x58f233,_0x2d6fe4[_0xc8a9('0x40')]);return _0x5057d8[_0xc8a9('0x57')](_0x58f233);}})[_0xc8a9('0x23')](function(_0x6a9d0a){if(_0x6a9d0a){_0x50bbe8=_0x6a9d0a[_0xc8a9('0x47')];if(!_0x2d6fe4[_0xc8a9('0x32')][_0xc8a9('0x38')]('nolimit')){_0x58f233['limit']=qs[_0xc8a9('0x1e')](_0x2d6fe4[_0xc8a9('0x32')]['limit']);_0x58f233[_0xc8a9('0x1b')]=qs[_0xc8a9('0x1b')](_0x2d6fe4[_0xc8a9('0x32')]['offset']);}return _0x5057d8[_0xc8a9('0x57')](_0x58f233);}})[_0xc8a9('0x23')](function(_0x3b0a09){if(_0x3b0a09){return _0x3b0a09?{'count':_0x50bbe8,'rows':_0x3b0a09}:null;}})[_0xc8a9('0x23')](respondWithResult(_0x5e1f6a,null))['catch'](handleError(_0x5e1f6a,null));};exports[_0xc8a9('0x58')]=function(_0x51d1d3,_0x51edbe,_0x13a08b){var _0x629ba7={};var _0x3a2319={};var _0x5ea0ce;var _0x339657;return db['Trigger'][_0xc8a9('0x59')]({'where':{'id':_0x51d1d3[_0xc8a9('0x46')]['id']}})[_0xc8a9('0x23')](handleEntityNotFound(_0x51edbe,null))['then'](function(_0x384b0b){if(_0x384b0b){_0x5ea0ce=_0x384b0b;_0x3a2319[_0xc8a9('0x31')]=_[_0xc8a9('0x33')](db['Condition'][_0xc8a9('0x2e')]);_0x3a2319['query']=_[_0xc8a9('0x33')](_0x51d1d3[_0xc8a9('0x32')]);_0x3a2319[_0xc8a9('0x34')]=_['intersection'](_0x3a2319['model'],_0x3a2319['query']);_0x629ba7['attributes']=_[_0xc8a9('0x35')](_0x3a2319[_0xc8a9('0x31')],qs[_0xc8a9('0x36')](_0x51d1d3[_0xc8a9('0x32')][_0xc8a9('0x36')]));_0x629ba7[_0xc8a9('0x37')]=_0x629ba7['attributes'][_0xc8a9('0x47')]?_0x629ba7['attributes']:_0x3a2319['model'];_0x629ba7[_0xc8a9('0x3a')]=qs[_0xc8a9('0x3b')](_0x51d1d3[_0xc8a9('0x32')][_0xc8a9('0x3b')]);_0x629ba7['where']=qs[_0xc8a9('0x34')](_['pick'](_0x51d1d3[_0xc8a9('0x32')],_0x3a2319['filters']));if(_0x51d1d3['query'][_0xc8a9('0x3f')]){_0x629ba7[_0xc8a9('0x3c')]=_['merge'](_0x629ba7[_0xc8a9('0x3c')],{'$or':_[_0xc8a9('0x2c')](_0x629ba7[_0xc8a9('0x37')],function(_0x4dcfeb){var _0x4e67bc={};_0x4e67bc[_0x4dcfeb]={'$like':'%'+_0x51d1d3[_0xc8a9('0x32')][_0xc8a9('0x3f')]+'%'};return _0x4e67bc;})});}_0x629ba7=_[_0xc8a9('0x3e')]({},_0x629ba7,_0x51d1d3[_0xc8a9('0x40')]);return _0x5ea0ce[_0xc8a9('0x58')](_0x629ba7);}})[_0xc8a9('0x23')](function(_0x186944){if(_0x186944){_0x339657=_0x186944[_0xc8a9('0x47')];if(!_0x51d1d3['query']['hasOwnProperty'](_0xc8a9('0x39'))){_0x629ba7[_0xc8a9('0x1e')]=qs[_0xc8a9('0x1e')](_0x51d1d3['query']['limit']);_0x629ba7['offset']=qs['offset'](_0x51d1d3[_0xc8a9('0x32')][_0xc8a9('0x1b')]);}return _0x5ea0ce[_0xc8a9('0x58')](_0x629ba7);}})[_0xc8a9('0x23')](function(_0x2d6646){if(_0x2d6646){return _0x2d6646?{'count':_0x339657,'rows':_0x2d6646}:null;}})[_0xc8a9('0x23')](respondWithResult(_0x51edbe,null))['catch'](handleError(_0x51edbe,null));};exports[_0xc8a9('0x5a')]=function(_0x36da56,_0x59253e,_0x31c3c4){if(_0x36da56[_0xc8a9('0x4b')]['id']){delete _0x36da56[_0xc8a9('0x4b')]['id'];}return db[_0xc8a9('0x2d')][_0xc8a9('0x49')]({'where':{'id':_0x36da56['params']['id']}})[_0xc8a9('0x23')](handleEntityNotFound(_0x59253e,null))['then'](function(_0x1eed3f){if(_0x1eed3f){_0x36da56[_0xc8a9('0x4b')][_0xc8a9('0x5b')]=_0x1eed3f['id'];return db[_0xc8a9('0x5c')][_0xc8a9('0x4a')](_0x36da56[_0xc8a9('0x4b')]);}})['then'](respondWithResult(_0x59253e,null))['catch'](handleError(_0x59253e,null));};exports[_0xc8a9('0x5d')]=function(_0x4613a6,_0x153f75,_0x5cae00){var _0xc85b07={};var _0x449afd={};var _0x21df1f;var _0x3e7608;return db[_0xc8a9('0x2d')][_0xc8a9('0x59')]({'where':{'id':_0x4613a6[_0xc8a9('0x46')]['id']}})[_0xc8a9('0x23')](handleEntityNotFound(_0x153f75,null))[_0xc8a9('0x23')](function(_0x2f6503){if(_0x2f6503){_0x21df1f=_0x2f6503;_0x449afd['model']=_['keys'](db['Action'][_0xc8a9('0x2e')]);_0x449afd['query']=_[_0xc8a9('0x33')](_0x4613a6[_0xc8a9('0x32')]);_0x449afd[_0xc8a9('0x34')]=_[_0xc8a9('0x35')](_0x449afd['model'],_0x449afd[_0xc8a9('0x32')]);_0xc85b07['attributes']=_['intersection'](_0x449afd['model'],qs[_0xc8a9('0x36')](_0x4613a6[_0xc8a9('0x32')][_0xc8a9('0x36')]));_0xc85b07['attributes']=_0xc85b07[_0xc8a9('0x37')][_0xc8a9('0x47')]?_0xc85b07[_0xc8a9('0x37')]:_0x449afd[_0xc8a9('0x31')];_0xc85b07[_0xc8a9('0x3a')]=qs[_0xc8a9('0x3b')](_0x4613a6['query'][_0xc8a9('0x3b')]);_0xc85b07[_0xc8a9('0x3c')]=qs[_0xc8a9('0x34')](_[_0xc8a9('0x3d')](_0x4613a6[_0xc8a9('0x32')],_0x449afd['filters']));if(_0x4613a6[_0xc8a9('0x32')]['filter']){_0xc85b07['where']=_[_0xc8a9('0x3e')](_0xc85b07[_0xc8a9('0x3c')],{'$or':_[_0xc8a9('0x2c')](_0xc85b07[_0xc8a9('0x37')],function(_0x3d44b5){var _0x40b26b={};_0x40b26b[_0x3d44b5]={'$like':'%'+_0x4613a6[_0xc8a9('0x32')]['filter']+'%'};return _0x40b26b;})});}_0xc85b07=_[_0xc8a9('0x3e')]({},_0xc85b07,_0x4613a6[_0xc8a9('0x40')]);return _0x21df1f[_0xc8a9('0x5d')](_0xc85b07);}})[_0xc8a9('0x23')](function(_0x32a019){if(_0x32a019){_0x3e7608=_0x32a019[_0xc8a9('0x47')];if(!_0x4613a6[_0xc8a9('0x32')][_0xc8a9('0x38')](_0xc8a9('0x39'))){_0xc85b07[_0xc8a9('0x1e')]=qs[_0xc8a9('0x1e')](_0x4613a6[_0xc8a9('0x32')][_0xc8a9('0x1e')]);_0xc85b07[_0xc8a9('0x1b')]=qs[_0xc8a9('0x1b')](_0x4613a6[_0xc8a9('0x32')][_0xc8a9('0x1b')]);}return _0x21df1f[_0xc8a9('0x5d')](_0xc85b07);}})['then'](function(_0x52db51){if(_0x52db51){return _0x52db51?{'count':_0x3e7608,'rows':_0x52db51}:null;}})[_0xc8a9('0x23')](respondWithResult(_0x153f75,null))[_0xc8a9('0x44')](handleError(_0x153f75,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 428329e..af29350 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 _0x4b1f=['api','moment','bluebird','path','rimraf','../../config/environment','define','Trigger','tools_triggers','lodash','util'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x4b1f,0x195));var _0xf4b1=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x4b1f[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xf4b1('0x0'));var util=require(_0xf4b1('0x1'));var logger=require('../../config/logger')(_0xf4b1('0x2'));var moment=require(_0xf4b1('0x3'));var BPromise=require(_0xf4b1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf4b1('0x5'));var rimraf=require(_0xf4b1('0x6'));var config=require(_0xf4b1('0x7'));var attributes=require('./trigger.attributes');module['exports']=function(_0x1ab96b,_0x4b676){return _0x1ab96b[_0xf4b1('0x8')](_0xf4b1('0x9'),attributes,{'tableName':_0xf4b1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe6c1=['util','../../config/logger','api','request-promise','path','rimraf','define','Trigger','tools_triggers'];(function(_0x57cd47,_0x2b404f){var _0x3cffb2=function(_0x84b2f5){while(--_0x84b2f5){_0x57cd47['push'](_0x57cd47['shift']());}};_0x3cffb2(++_0x2b404f);}(_0xe6c1,0xd8));var _0x1e6c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe6c1[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x1e6c('0x0'));var logger=require(_0x1e6c('0x1'))(_0x1e6c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1e6c('0x3'));var fs=require('fs');var path=require(_0x1e6c('0x4'));var rimraf=require(_0x1e6c('0x5'));var config=require('../../config/environment');var attributes=require('./trigger.attributes');module['exports']=function(_0x59b172,_0x45e724){return _0x59b172[_0x1e6c('0x6')](_0x1e6c('0x7'),attributes,{'tableName':_0x1e6c('0x8'),'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 e2fe411..311abac 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 _0x5aba=['message','result','GetTrigger','Trigger','options','raw','where','attributes','limit','include','model','map','then','stringify','catch','ShowTrigger','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error'];(function(_0x462a58,_0x1349aa){var _0x426f8d=function(_0x244c22){while(--_0x244c22){_0x462a58['push'](_0x462a58['shift']());}};_0x426f8d(++_0x1349aa);}(_0x5aba,0x179));var _0xa5ab=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x5aba[_0x4dc7b9];return _0x3ab114;};'use strict';var _=require(_0xa5ab('0x0'));var util=require(_0xa5ab('0x1'));var moment=require('moment');var BPromise=require(_0xa5ab('0x2'));var rs=require(_0xa5ab('0x3'));var fs=require('fs');var Redis=require(_0xa5ab('0x4'));var db=require(_0xa5ab('0x5'))['db'];var utils=require(_0xa5ab('0x6'));var logger=require('../../config/logger')(_0xa5ab('0x7'));var config=require(_0xa5ab('0x8'));var jayson=require(_0xa5ab('0x9'));var client=jayson[_0xa5ab('0xa')][_0xa5ab('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd62193,_0xe245cd,_0xbd61){return new BPromise(function(_0xaf16ca,_0x39099f){return client[_0xa5ab('0xc')](_0xd62193,_0xbd61)['then'](function(_0xfb45cc){logger[_0xa5ab('0xd')](_0xa5ab('0xe'),_0xe245cd,_0xa5ab('0xf'));logger[_0xa5ab('0x10')](_0xa5ab('0x11'),_0xe245cd,_0xa5ab('0xf'),JSON['stringify'](_0xfb45cc));if(_0xfb45cc[_0xa5ab('0x12')]){if(_0xfb45cc[_0xa5ab('0x12')]['code']===0x1f4){logger['error'](_0xa5ab('0xe'),_0xe245cd,_0xfb45cc[_0xa5ab('0x12')][_0xa5ab('0x13')]);return _0x39099f(_0xfb45cc[_0xa5ab('0x12')][_0xa5ab('0x13')]);}logger['error'](_0xa5ab('0xe'),_0xe245cd,_0xfb45cc[_0xa5ab('0x12')]['message']);return _0xaf16ca(_0xfb45cc[_0xa5ab('0x12')]['message']);}else{logger[_0xa5ab('0xd')](_0xa5ab('0xe'),_0xe245cd,_0xa5ab('0xf'));_0xaf16ca(_0xfb45cc[_0xa5ab('0x14')]['message']);}})['catch'](function(_0x451947){logger[_0xa5ab('0x12')](_0xa5ab('0xe'),_0xe245cd,_0x451947);_0x39099f(_0x451947);});});}exports[_0xa5ab('0x15')]=function(_0x3487f3){var _0x57146c=this;return new Promise(function(_0x28c6a7,_0x29b341){return db[_0xa5ab('0x16')]['findAll']({'raw':_0x3487f3['options']?_0x3487f3[_0xa5ab('0x17')][_0xa5ab('0x18')]===undefined?!![]:![]:!![],'where':_0x3487f3[_0xa5ab('0x17')]?_0x3487f3[_0xa5ab('0x17')][_0xa5ab('0x19')]||null:null,'attributes':_0x3487f3[_0xa5ab('0x17')]?_0x3487f3[_0xa5ab('0x17')][_0xa5ab('0x1a')]||null:null,'limit':_0x3487f3[_0xa5ab('0x17')]?_0x3487f3[_0xa5ab('0x17')][_0xa5ab('0x1b')]||null:null,'include':_0x3487f3[_0xa5ab('0x17')]?_0x3487f3[_0xa5ab('0x17')][_0xa5ab('0x1c')]?_['map'](_0x3487f3[_0xa5ab('0x17')]['include'],function(_0x2fa39b){return{'model':db[_0x2fa39b[_0xa5ab('0x1d')]],'as':_0x2fa39b['as'],'attributes':_0x2fa39b[_0xa5ab('0x1a')],'include':_0x2fa39b['include']?_[_0xa5ab('0x1e')](_0x2fa39b[_0xa5ab('0x1c')],function(_0x1f3920){return{'model':db[_0x1f3920[_0xa5ab('0x1d')]],'as':_0x1f3920['as'],'attributes':_0x1f3920[_0xa5ab('0x1a')],'include':_0x1f3920[_0xa5ab('0x1c')]?_[_0xa5ab('0x1e')](_0x1f3920[_0xa5ab('0x1c')],function(_0x51b501){return{'model':db[_0x51b501[_0xa5ab('0x1d')]],'as':_0x51b501['as'],'attributes':_0x51b501[_0xa5ab('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa5ab('0x1f')](function(_0x212150){logger[_0xa5ab('0xd')](_0xa5ab('0x15'),_0x3487f3);logger[_0xa5ab('0x10')](_0xa5ab('0x15'),_0x3487f3,JSON[_0xa5ab('0x20')](_0x212150));_0x28c6a7(_0x212150);})[_0xa5ab('0x21')](function(_0xb0c175){logger[_0xa5ab('0x12')](_0xa5ab('0x15'),_0xb0c175[_0xa5ab('0x13')],_0x3487f3);_0x29b341(_0x57146c[_0xa5ab('0x12')](0x1f4,_0xb0c175[_0xa5ab('0x13')]));});});};exports[_0xa5ab('0x22')]=function(_0x46b2e8){var _0x439ae4=this;return new Promise(function(_0x1cc8a1,_0x29a18b){return db['Trigger'][_0xa5ab('0x23')]({'raw':_0x46b2e8['options']?_0x46b2e8['options'][_0xa5ab('0x18')]===undefined?!![]:![]:!![],'where':_0x46b2e8[_0xa5ab('0x17')]?_0x46b2e8['options'][_0xa5ab('0x19')]||null:null,'attributes':_0x46b2e8[_0xa5ab('0x17')]?_0x46b2e8[_0xa5ab('0x17')][_0xa5ab('0x1a')]||null:null,'include':_0x46b2e8['options']?_0x46b2e8[_0xa5ab('0x17')][_0xa5ab('0x1c')]?_['map'](_0x46b2e8[_0xa5ab('0x17')][_0xa5ab('0x1c')],function(_0x21db50){return{'model':db[_0x21db50[_0xa5ab('0x1d')]],'as':_0x21db50['as'],'attributes':_0x21db50[_0xa5ab('0x1a')],'include':_0x21db50[_0xa5ab('0x1c')]?_['map'](_0x21db50[_0xa5ab('0x1c')],function(_0x5021b9){return{'model':db[_0x5021b9[_0xa5ab('0x1d')]],'as':_0x5021b9['as'],'attributes':_0x5021b9[_0xa5ab('0x1a')],'include':_0x5021b9[_0xa5ab('0x1c')]?_[_0xa5ab('0x1e')](_0x5021b9[_0xa5ab('0x1c')],function(_0x399675){return{'model':db[_0x399675[_0xa5ab('0x1d')]],'as':_0x399675['as'],'attributes':_0x399675[_0xa5ab('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa5ab('0x1f')](function(_0x16ac10){logger[_0xa5ab('0xd')]('ShowTrigger',_0x46b2e8);logger[_0xa5ab('0x10')]('ShowTrigger',_0x46b2e8,JSON[_0xa5ab('0x20')](_0x16ac10));_0x1cc8a1(_0x16ac10);})[_0xa5ab('0x21')](function(_0x1bd2bc){logger['error'](_0xa5ab('0x22'),_0x1bd2bc[_0xa5ab('0x13')],_0x46b2e8);_0x29a18b(_0x439ae4[_0xa5ab('0x12')](0x1f4,_0x1bd2bc[_0xa5ab('0x13')]));});});}; \ No newline at end of file +var _0x2baf=['Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','error','code','message','catch','Trigger','findAll','options','where','limit','include','map','attributes','model','GetTrigger','ShowTrigger','find','stringify','util','moment','ioredis','../../mysqldb','jayson/promise','client','request','then','info'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x2baf,0x119));var _0xf2ba=function(_0x27d8bc,_0x19e010){_0x27d8bc=_0x27d8bc-0x0;var _0x4b04cb=_0x2baf[_0x27d8bc];return _0x4b04cb;};'use strict';var _=require('lodash');var util=require(_0xf2ba('0x0'));var moment=require(_0xf2ba('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf2ba('0x2'));var db=require(_0xf2ba('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf2ba('0x4'));var client=jayson[_0xf2ba('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b8d67,_0x4cf2f2,_0x2dd520){return new BPromise(function(_0xd9744c,_0x18849a){return client[_0xf2ba('0x6')](_0x2b8d67,_0x2dd520)[_0xf2ba('0x7')](function(_0x2b10dd){logger[_0xf2ba('0x8')](_0xf2ba('0x9'),_0x4cf2f2,_0xf2ba('0xa'));logger['debug'](_0xf2ba('0xb'),_0x4cf2f2,_0xf2ba('0xa'),JSON['stringify'](_0x2b10dd));if(_0x2b10dd[_0xf2ba('0xc')]){if(_0x2b10dd[_0xf2ba('0xc')][_0xf2ba('0xd')]===0x1f4){logger['error'](_0xf2ba('0x9'),_0x4cf2f2,_0x2b10dd[_0xf2ba('0xc')]['message']);return _0x18849a(_0x2b10dd[_0xf2ba('0xc')][_0xf2ba('0xe')]);}logger[_0xf2ba('0xc')](_0xf2ba('0x9'),_0x4cf2f2,_0x2b10dd['error'][_0xf2ba('0xe')]);return _0xd9744c(_0x2b10dd[_0xf2ba('0xc')][_0xf2ba('0xe')]);}else{logger['info'](_0xf2ba('0x9'),_0x4cf2f2,'request\x20sent');_0xd9744c(_0x2b10dd['result'][_0xf2ba('0xe')]);}})[_0xf2ba('0xf')](function(_0xeb095d){logger['error'](_0xf2ba('0x9'),_0x4cf2f2,_0xeb095d);_0x18849a(_0xeb095d);});});}exports['GetTrigger']=function(_0x31bcd4){var _0x46a7a9=this;return new Promise(function(_0xe34d55,_0x307a86){return db[_0xf2ba('0x10')][_0xf2ba('0x11')]({'raw':_0x31bcd4['options']?_0x31bcd4[_0xf2ba('0x12')]['raw']===undefined?!![]:![]:!![],'where':_0x31bcd4[_0xf2ba('0x12')]?_0x31bcd4[_0xf2ba('0x12')][_0xf2ba('0x13')]||null:null,'attributes':_0x31bcd4['options']?_0x31bcd4[_0xf2ba('0x12')]['attributes']||null:null,'limit':_0x31bcd4[_0xf2ba('0x12')]?_0x31bcd4['options'][_0xf2ba('0x14')]||null:null,'include':_0x31bcd4['options']?_0x31bcd4[_0xf2ba('0x12')][_0xf2ba('0x15')]?_[_0xf2ba('0x16')](_0x31bcd4[_0xf2ba('0x12')][_0xf2ba('0x15')],function(_0x1d81a2){return{'model':db[_0x1d81a2['model']],'as':_0x1d81a2['as'],'attributes':_0x1d81a2[_0xf2ba('0x17')],'include':_0x1d81a2[_0xf2ba('0x15')]?_['map'](_0x1d81a2['include'],function(_0x746bf){return{'model':db[_0x746bf[_0xf2ba('0x18')]],'as':_0x746bf['as'],'attributes':_0x746bf['attributes'],'include':_0x746bf[_0xf2ba('0x15')]?_['map'](_0x746bf[_0xf2ba('0x15')],function(_0x26ecf9){return{'model':db[_0x26ecf9[_0xf2ba('0x18')]],'as':_0x26ecf9['as'],'attributes':_0x26ecf9[_0xf2ba('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4af08d){logger[_0xf2ba('0x8')](_0xf2ba('0x19'),_0x31bcd4);logger['debug'](_0xf2ba('0x19'),_0x31bcd4,JSON['stringify'](_0x4af08d));_0xe34d55(_0x4af08d);})[_0xf2ba('0xf')](function(_0x58bf66){logger[_0xf2ba('0xc')](_0xf2ba('0x19'),_0x58bf66[_0xf2ba('0xe')],_0x31bcd4);_0x307a86(_0x46a7a9[_0xf2ba('0xc')](0x1f4,_0x58bf66[_0xf2ba('0xe')]));});});};exports[_0xf2ba('0x1a')]=function(_0x18f29a){var _0x332e79=this;return new Promise(function(_0x454361,_0x2ae324){return db[_0xf2ba('0x10')][_0xf2ba('0x1b')]({'raw':_0x18f29a[_0xf2ba('0x12')]?_0x18f29a[_0xf2ba('0x12')]['raw']===undefined?!![]:![]:!![],'where':_0x18f29a[_0xf2ba('0x12')]?_0x18f29a['options'][_0xf2ba('0x13')]||null:null,'attributes':_0x18f29a['options']?_0x18f29a[_0xf2ba('0x12')]['attributes']||null:null,'include':_0x18f29a[_0xf2ba('0x12')]?_0x18f29a[_0xf2ba('0x12')][_0xf2ba('0x15')]?_[_0xf2ba('0x16')](_0x18f29a[_0xf2ba('0x12')]['include'],function(_0xde813c){return{'model':db[_0xde813c[_0xf2ba('0x18')]],'as':_0xde813c['as'],'attributes':_0xde813c[_0xf2ba('0x17')],'include':_0xde813c[_0xf2ba('0x15')]?_[_0xf2ba('0x16')](_0xde813c[_0xf2ba('0x15')],function(_0xff4930){return{'model':db[_0xff4930[_0xf2ba('0x18')]],'as':_0xff4930['as'],'attributes':_0xff4930['attributes'],'include':_0xff4930[_0xf2ba('0x15')]?_[_0xf2ba('0x16')](_0xff4930[_0xf2ba('0x15')],function(_0x38a260){return{'model':db[_0x38a260['model']],'as':_0x38a260['as'],'attributes':_0x38a260[_0xf2ba('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5424a5){logger[_0xf2ba('0x8')](_0xf2ba('0x1a'),_0x18f29a);logger['debug'](_0xf2ba('0x1a'),_0x18f29a,JSON[_0xf2ba('0x1c')](_0x5424a5));_0x454361(_0x5424a5);})['catch'](function(_0x4d886c){logger[_0xf2ba('0xc')](_0xf2ba('0x1a'),_0x4d886c[_0xf2ba('0xe')],_0x18f29a);_0x2ae324(_0x332e79[_0xf2ba('0xc')](0x1f4,_0x4d886c[_0xf2ba('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index ebfbc9b..487d3cb 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 _0xe057=['clone','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','/:id/clone'];(function(_0x4987a4,_0xbf3604){var _0xdc268d=function(_0x1b6857){while(--_0x1b6857){_0x4987a4['push'](_0x4987a4['shift']());}};_0xdc268d(++_0xbf3604);}(_0xe057,0xb1));var _0x7e05=function(_0x2a287b,_0x306d90){_0x2a287b=_0x2a287b-0x0;var _0x55c414=_0xe057[_0x2a287b];return _0x55c414;};'use strict';var multer=require(_0x7e05('0x0'));var util=require('util');var path=require(_0x7e05('0x1'));var timeout=require(_0x7e05('0x2'));var express=require(_0x7e05('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7e05('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7e05('0x5'));var controller=require('./trunk.controller');router[_0x7e05('0x6')]('/',auth[_0x7e05('0x7')](),controller[_0x7e05('0x8')]);router[_0x7e05('0x6')](_0x7e05('0x9'),auth[_0x7e05('0x7')](),controller[_0x7e05('0xa')]);router[_0x7e05('0xb')](_0x7e05('0xc'),auth[_0x7e05('0x7')](),controller[_0x7e05('0xd')]);router[_0x7e05('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7e05('0xe')](_0x7e05('0x9'),auth[_0x7e05('0x7')](),controller[_0x7e05('0xf')]);router[_0x7e05('0x10')](_0x7e05('0x9'),auth[_0x7e05('0x7')](),controller[_0x7e05('0x11')]);module[_0x7e05('0x12')]=router; \ No newline at end of file +var _0x59cd=['../../config/environment','./trunk.controller','isAuthenticated','index','get','/:id','post','clone','create','put','update','exports','util','path','connect-timeout','express','../../components/interaction/service'];(function(_0x3e6d5d,_0x264c7a){var _0x238923=function(_0x201b19){while(--_0x201b19){_0x3e6d5d['push'](_0x3e6d5d['shift']());}};_0x238923(++_0x264c7a);}(_0x59cd,0x83));var _0xd59c=function(_0x1af0e5,_0x152990){_0x1af0e5=_0x1af0e5-0x0;var _0x3c444a=_0x59cd[_0x1af0e5];return _0x3c444a;};'use strict';var multer=require('multer');var util=require(_0xd59c('0x0'));var path=require(_0xd59c('0x1'));var timeout=require(_0xd59c('0x2'));var express=require(_0xd59c('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd59c('0x4'));var config=require(_0xd59c('0x5'));var controller=require(_0xd59c('0x6'));router['get']('/',auth[_0xd59c('0x7')](),controller[_0xd59c('0x8')]);router[_0xd59c('0x9')](_0xd59c('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xd59c('0xb')]('/:id/clone',auth[_0xd59c('0x7')](),controller[_0xd59c('0xc')]);router[_0xd59c('0xb')]('/',auth[_0xd59c('0x7')](),controller[_0xd59c('0xd')]);router[_0xd59c('0xe')](_0xd59c('0xa'),auth['isAuthenticated'](),controller[_0xd59c('0xf')]);router['delete'](_0xd59c('0xa'),auth[_0xd59c('0x7')](),controller['destroy']);module[_0xd59c('0x10')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 05aa4e3..89ab691 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 _0x1524=['exports','STRING','name','ENUM','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','yes','nonat','update','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','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]','never','INTEGER','\x22\x22\x20<>','always','accept','originate','pai','fingerprint','certificate','active','passive','dynamic','update,nonat','BOOLEAN','sequelize'];(function(_0x5607ec,_0x2576b5){var _0x1b2caa=function(_0x9370f7){while(--_0x9370f7){_0x5607ec['push'](_0x5607ec['shift']());}};_0x1b2caa(++_0x2576b5);}(_0x1524,0x103));var _0x4152=function(_0x528b92,_0x2a3971){_0x528b92=_0x528b92-0x0;var _0x171eba=_0x1524[_0x528b92];return _0x171eba;};'use strict';var Sequelize=require(_0x4152('0x0'));module[_0x4152('0x1')]={'name':{'type':Sequelize[_0x4152('0x2')],'allowNull':![],'unique':_0x4152('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x4152('0x4')]('friend',_0x4152('0x5'),_0x4152('0x6')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x4152('0x2')],'allowNull':![],'defaultValue':_0x4152('0x7')},'callingpres':{'type':Sequelize[_0x4152('0x4')](_0x4152('0x8'),_0x4152('0x9'),_0x4152('0xa'),'ALLOWED',_0x4152('0xb'),_0x4152('0xc'),_0x4152('0xd'),_0x4152('0xe'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x4152('0x2')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x4152('0x2')]},'remotesecret':{'type':Sequelize[_0x4152('0x2')]},'transport':{'type':Sequelize[_0x4152('0x2')],'defaultValue':_0x4152('0xf'),'set':function(_0x2e80f2){this[_0x4152('0x10')](_0x4152('0x11'),_0x2e80f2?_0x2e80f2[_0x4152('0x12')](','):null);},'get':function(){return this[_0x4152('0x13')](_0x4152('0x11'))?this[_0x4152('0x13')](_0x4152('0x11'))['split'](','):null;},'comment':_0x4152('0x14')},'dtmfmode':{'type':Sequelize[_0x4152('0x4')]('rfc2833',_0x4152('0x15'),_0x4152('0x16'),_0x4152('0x17'),_0x4152('0x18')),'defaultValue':_0x4152('0x19')},'directmedia':{'type':Sequelize[_0x4152('0x4')](_0x4152('0x1a'),'no',_0x4152('0x1b'),_0x4152('0x1c'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x4152('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x4152('0x2')]},'directmediadeny':{'type':Sequelize[_0x4152('0x2')]},'nat':{'type':Sequelize[_0x4152('0x2')],'defaultValue':_0x4152('0x1d'),'set':function(_0x38e3a7){this[_0x4152('0x10')](_0x4152('0x1e'),_0x38e3a7?_0x38e3a7['join'](','):null);},'get':function(){return this[_0x4152('0x13')]('nat')?this[_0x4152('0x13')]('nat')[_0x4152('0x1f')](','):null;},'comment':_0x4152('0x20')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x4152('0x2')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x4152('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x4152('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x4152('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize[_0x4152('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x20ce82){this[_0x4152('0x10')](_0x4152('0x21'),_0x20ce82?_0x20ce82[_0x4152('0x12')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue']('allow')?this[_0x4152('0x13')]('allow')[_0x4152('0x1f')](';'):null;},'comment':_0x4152('0x22')},'autoframing':{'type':Sequelize['ENUM'](_0x4152('0x1a'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x4152('0x23'),'set':function(_0x53bd3c){this['setDataValue']('insecure',_0x53bd3c?_0x53bd3c[_0x4152('0x12')](','):null);},'get':function(){return this[_0x4152('0x13')]('insecure')?this[_0x4152('0x13')](_0x4152('0x24'))[_0x4152('0x1f')](','):null;},'comment':_0x4152('0x25')},'trustrpid':{'type':Sequelize[_0x4152('0x4')](_0x4152('0x1a'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x4152('0x1a'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x4152('0x1a'),'no',_0x4152('0x26'))},'promiscredir':{'type':Sequelize[_0x4152('0x4')]('yes','no')},'useclientcode':{'type':Sequelize[_0x4152('0x4')]('yes','no')},'accountcode':{'type':Sequelize[_0x4152('0x27')](0xb)},'setvar':{'type':Sequelize[_0x4152('0x2')]},'callerid':{'type':Sequelize[_0x4152('0x2')],'defaultValue':_0x4152('0x28')},'amaflags':{'type':Sequelize[_0x4152('0x2')]},'callcounter':{'type':Sequelize[_0x4152('0x4')](_0x4152('0x1a'),'no'),'defaultValue':_0x4152('0x1a')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x4152('0x4')](_0x4152('0x1a'),'no')},'allowsubscribe':{'type':Sequelize[_0x4152('0x4')]('yes','no')},'allowtransfer':{'type':Sequelize[_0x4152('0x4')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x4152('0x4')]('yes','no')},'subscribecontext':{'type':Sequelize[_0x4152('0x2')]},'template':{'type':Sequelize[_0x4152('0x2')]},'videosupport':{'type':Sequelize[_0x4152('0x4')](_0x4152('0x1a'),'no',_0x4152('0x29')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x4152('0x4')]('yes','no')},'mailbox':{'type':Sequelize[_0x4152('0x2')]},'session_timers':{'type':Sequelize[_0x4152('0x4')](_0x4152('0x2a'),'refuse',_0x4152('0x2b'))},'session_expires':{'type':Sequelize[_0x4152('0x27')](0xb)},'session_minse':{'type':Sequelize[_0x4152('0x27')](0xb)},'session_refresher':{'type':Sequelize[_0x4152('0x4')]('uac','uas'),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x4152('0x2')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x4152('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x4152('0x4')]('yes','no'),'defaultValue':_0x4152('0x1a')},'keepalive':{'type':Sequelize[_0x4152('0x27')](0xb)},'defaultip':{'type':Sequelize[_0x4152('0x2')]},'defaultuser':{'type':Sequelize[_0x4152('0x2')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x4152('0x27')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x4152('0x1a'),'no',_0x4152('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x4152('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x4152('0x27')](0xb)},'timerb':{'type':Sequelize[_0x4152('0x27')](0xb)},'qualifyfreq':{'type':Sequelize[_0x4152('0x27')](0xb)},'contactpermit':{'type':Sequelize[_0x4152('0x2')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x4152('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x4152('0x2')]},'use_q850_reason':{'type':Sequelize[_0x4152('0x2')]},'maxforwards':{'type':Sequelize[_0x4152('0x27')](0xb)},'encryption':{'type':Sequelize[_0x4152('0x4')](_0x4152('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x4152('0x4')](_0x4152('0x1a'),'no')},'force_avp':{'type':Sequelize[_0x4152('0x4')]('yes','no')},'icesupport':{'type':Sequelize[_0x4152('0x4')](_0x4152('0x1a'),'no')},'dtlsenable':{'type':Sequelize[_0x4152('0x4')]('yes','no')},'dtlsverify':{'type':Sequelize[_0x4152('0x4')](_0x4152('0x1a'),'no',_0x4152('0x2d'),_0x4152('0x2e'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x4152('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x4152('0x2')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x4152('0x2')]},'dtlscapath':{'type':Sequelize[_0x4152('0x2')]},'dtlssetup':{'type':Sequelize['ENUM'](_0x4152('0x2f'),_0x4152('0x30'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x4152('0x2')]},'usereqphone':{'type':Sequelize[_0x4152('0x4')](_0x4152('0x1a'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x4152('0x2')]},'recordofffeature':{'type':Sequelize[_0x4152('0x2')]},'call_limit':{'type':Sequelize[_0x4152('0x27')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x4152('0x4')](_0x4152('0x1a'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x4152('0x1a'),'no')},'vmexten':{'type':Sequelize[_0x4152('0x2')]},'mohinterpret':{'type':Sequelize[_0x4152('0x2')]},'mohsuggest':{'type':Sequelize[_0x4152('0x2')]},'parkinglot':{'type':Sequelize[_0x4152('0x2')]},'description':{'type':Sequelize[_0x4152('0x2')]},'host':{'type':Sequelize[_0x4152('0x2')],'defaultValue':_0x4152('0x31')},'canreinvite':{'type':Sequelize[_0x4152('0x4')](_0x4152('0x1a'),'no',_0x4152('0x1b'),_0x4152('0x1c'),_0x4152('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x4152('0x2')]},'otherFields':{'type':Sequelize[_0x4152('0x2')]},'active':{'type':Sequelize[_0x4152('0x33')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x4152('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0x6c08=['accept','uac','uas','pai','fingerprint','active','nonat','update,nonat','BOOLEAN','exports','STRING','user','peer','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','update','yes','force_rport,comedia','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]','never','INTEGER','\x22\x22\x20<>'];(function(_0x1e8988,_0x4c1f9c){var _0x181702=function(_0x30fde2){while(--_0x30fde2){_0x1e8988['push'](_0x1e8988['shift']());}};_0x181702(++_0x4c1f9c);}(_0x6c08,0x1cb));var _0x86c0=function(_0x433d71,_0x3c289a){_0x433d71=_0x433d71-0x0;var _0x23fdf3=_0x6c08[_0x433d71];return _0x23fdf3;};'use strict';var Sequelize=require('sequelize');module[_0x86c0('0x0')]={'name':{'type':Sequelize[_0x86c0('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('friend',_0x86c0('0x2'),_0x86c0('0x3')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x86c0('0x1')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x86c0('0x4')](_0x86c0('0x5'),'ALLOWED_PASSED_SCREEN',_0x86c0('0x6'),_0x86c0('0x7'),_0x86c0('0x8'),_0x86c0('0x9'),'PROHIB_FAILED_SCREEN',_0x86c0('0xa'))},'deny':{'type':Sequelize[_0x86c0('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x86c0('0x1')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x86c0('0x1')]},'transport':{'type':Sequelize[_0x86c0('0x1')],'defaultValue':'udp','set':function(_0x723965){this[_0x86c0('0xb')](_0x86c0('0xc'),_0x723965?_0x723965[_0x86c0('0xd')](','):null);},'get':function(){return this[_0x86c0('0xe')](_0x86c0('0xc'))?this['getDataValue'](_0x86c0('0xc'))[_0x86c0('0xf')](','):null;},'comment':_0x86c0('0x10')},'dtmfmode':{'type':Sequelize['ENUM'](_0x86c0('0x11'),_0x86c0('0x12'),_0x86c0('0x13'),_0x86c0('0x14'),_0x86c0('0x15')),'defaultValue':_0x86c0('0x11')},'directmedia':{'type':Sequelize[_0x86c0('0x4')]('yes','no','nonat',_0x86c0('0x16'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x86c0('0x4')](_0x86c0('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x86c0('0x1')]},'nat':{'type':Sequelize[_0x86c0('0x1')],'defaultValue':_0x86c0('0x18'),'set':function(_0x25faee){this[_0x86c0('0xb')]('nat',_0x25faee?_0x25faee[_0x86c0('0xd')](','):null);},'get':function(){return this[_0x86c0('0xe')]('nat')?this[_0x86c0('0xe')](_0x86c0('0x19'))[_0x86c0('0xf')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x86c0('0x1')]},'namedcallgroup':{'type':Sequelize[_0x86c0('0x1')]},'pickupgroup':{'type':Sequelize[_0x86c0('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x86c0('0x1')]},'language':{'type':Sequelize[_0x86c0('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x86c0('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x86c0('0x1')],'defaultValue':_0x86c0('0x1a')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x2e5dee){this[_0x86c0('0xb')]('allow',_0x2e5dee?_0x2e5dee[_0x86c0('0xd')](';'):_0x86c0('0x1b'));},'get':function(){return this[_0x86c0('0xe')](_0x86c0('0x1c'))?this['getDataValue'](_0x86c0('0x1c'))[_0x86c0('0xf')](';'):null;},'comment':_0x86c0('0x1d')},'autoframing':{'type':Sequelize[_0x86c0('0x4')](_0x86c0('0x17'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x86c0('0x1e'),'set':function(_0x86163c){this[_0x86c0('0xb')](_0x86c0('0x1f'),_0x86163c?_0x86163c[_0x86c0('0xd')](','):null);},'get':function(){return this['getDataValue']('insecure')?this['getDataValue'](_0x86c0('0x1f'))[_0x86c0('0xf')](','):null;},'comment':_0x86c0('0x20')},'trustrpid':{'type':Sequelize[_0x86c0('0x4')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x86c0('0x4')](_0x86c0('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x86c0('0x4')](_0x86c0('0x17'),'no',_0x86c0('0x21'))},'promiscredir':{'type':Sequelize['ENUM'](_0x86c0('0x17'),'no')},'useclientcode':{'type':Sequelize[_0x86c0('0x4')](_0x86c0('0x17'),'no')},'accountcode':{'type':Sequelize[_0x86c0('0x22')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x86c0('0x1')],'defaultValue':_0x86c0('0x23')},'amaflags':{'type':Sequelize[_0x86c0('0x1')]},'callcounter':{'type':Sequelize[_0x86c0('0x4')](_0x86c0('0x17'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x86c0('0x22')](0xb)},'allowoverlap':{'type':Sequelize[_0x86c0('0x4')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x86c0('0x4')](_0x86c0('0x17'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x86c0('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0x86c0('0x4')](_0x86c0('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0x86c0('0x1')]},'template':{'type':Sequelize[_0x86c0('0x1')]},'videosupport':{'type':Sequelize[_0x86c0('0x4')]('yes','no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x86c0('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x86c0('0x4')](_0x86c0('0x17'),'no')},'mailbox':{'type':Sequelize[_0x86c0('0x1')]},'session_timers':{'type':Sequelize['ENUM'](_0x86c0('0x24'),'refuse','originate')},'session_expires':{'type':Sequelize[_0x86c0('0x22')](0xb)},'session_minse':{'type':Sequelize[_0x86c0('0x22')](0xb)},'session_refresher':{'type':Sequelize[_0x86c0('0x4')](_0x86c0('0x25'),_0x86c0('0x26')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x86c0('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x86c0('0x1')]},'fromuser':{'type':Sequelize[_0x86c0('0x1')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x86c0('0x4')](_0x86c0('0x17'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x86c0('0x22')](0xb)},'defaultip':{'type':Sequelize[_0x86c0('0x1')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x86c0('0x22')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x86c0('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x86c0('0x22')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x86c0('0x17'),'no',_0x86c0('0x27')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x86c0('0x1')]},'callbackextension':{'type':Sequelize[_0x86c0('0x1')]},'timert1':{'type':Sequelize[_0x86c0('0x22')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x86c0('0x22')](0xb)},'contactpermit':{'type':Sequelize[_0x86c0('0x1')]},'contactdeny':{'type':Sequelize[_0x86c0('0x1')]},'contactacl':{'type':Sequelize[_0x86c0('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x86c0('0x1')]},'use_q850_reason':{'type':Sequelize[_0x86c0('0x1')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x86c0('0x4')](_0x86c0('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x86c0('0x17'),'no')},'force_avp':{'type':Sequelize[_0x86c0('0x4')](_0x86c0('0x17'),'no')},'icesupport':{'type':Sequelize[_0x86c0('0x4')](_0x86c0('0x17'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x86c0('0x17'),'no')},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0x86c0('0x28'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x86c0('0x22')](0xb)},'dtlscertfile':{'type':Sequelize[_0x86c0('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x86c0('0x1')]},'dtlscipher':{'type':Sequelize[_0x86c0('0x1')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x86c0('0x1')]},'dtlssetup':{'type':Sequelize[_0x86c0('0x4')](_0x86c0('0x29'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x86c0('0x1')]},'usereqphone':{'type':Sequelize[_0x86c0('0x4')](_0x86c0('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x86c0('0x1')]},'recordofffeature':{'type':Sequelize[_0x86c0('0x1')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x86c0('0x4')](_0x86c0('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0x86c0('0x4')](_0x86c0('0x17'),'no')},'vmexten':{'type':Sequelize[_0x86c0('0x1')]},'mohinterpret':{'type':Sequelize[_0x86c0('0x1')]},'mohsuggest':{'type':Sequelize[_0x86c0('0x1')]},'parkinglot':{'type':Sequelize[_0x86c0('0x1')]},'description':{'type':Sequelize[_0x86c0('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x86c0('0x4')](_0x86c0('0x17'),'no',_0x86c0('0x2a'),_0x86c0('0x16'),_0x86c0('0x2b')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x86c0('0x1')]},'active':{'type':Sequelize[_0x86c0('0x2c')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x86c0('0x1')],'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 9df6d9c..7239a59 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 _0x00bb=['includeAll','findAll','rows','params','find','clone','rawAttributes','include','omit','createdAt','body','updatedAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','Reload','chan_sip.so','/etc/asterisk/sip_xcally_registers.conf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','jayson/promise','client','http','request','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','Trunk,\x20%s,\x20%s','result','catch','sendStatus','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','get','Trunks','UserProfileResource','status','stack','name','index','map','Trunk','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options'];(function(_0x42700c,_0x354543){var _0x336922=function(_0x45fc3d){while(--_0x45fc3d){_0x42700c['push'](_0x42700c['shift']());}};_0x336922(++_0x354543);}(_0x00bb,0x1d8));var _0xb00b=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x00bb[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];var jayson=require(_0xb00b('0x15'));var client=jayson[_0xb00b('0x16')][_0xb00b('0x17')]({'port':0x232a});function respondWithRpcPromise(_0xef5d52,_0x1f1c1d,_0x4ada81,_0x218de2){return new BPromise(function(_0xb0d42e,_0x482fe6){var _0x88d95e=_0x218de2||client;return _0x88d95e[_0xb00b('0x18')](_0xef5d52,_0x4ada81)['then'](function(_0x5da36b){logger[_0xb00b('0x19')]('Trunk,\x20%s,\x20%s',_0x1f1c1d,'request\x20sent');logger[_0xb00b('0x1a')](_0xb00b('0x1b'),_0x1f1c1d,_0xb00b('0x1c'),JSON[_0xb00b('0x1d')](_0x5da36b));if(_0x5da36b['error']){if(_0x5da36b[_0xb00b('0x1e')]['code']===0x1f4){logger[_0xb00b('0x1e')]('Trunk,\x20%s,\x20%s',_0x1f1c1d,_0x5da36b[_0xb00b('0x1e')]['message']);return _0x482fe6(_0x5da36b[_0xb00b('0x1e')][_0xb00b('0x1f')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x1f1c1d,_0x5da36b[_0xb00b('0x1e')]['message']);return _0xb0d42e(_0x5da36b[_0xb00b('0x1e')][_0xb00b('0x1f')]);}else{logger[_0xb00b('0x19')](_0xb00b('0x20'),_0x1f1c1d,'request\x20sent');_0xb0d42e(_0x5da36b[_0xb00b('0x21')]['message']);}})[_0xb00b('0x22')](function(_0x121ec7){logger['error'](_0xb00b('0x20'),_0x1f1c1d,_0x121ec7);_0x482fe6(_0x121ec7);});});}function respondWithStatusCode(_0x2896d1,_0x520444){_0x520444=_0x520444||0xcc;return function(_0x3ab3cc){if(_0x3ab3cc){return _0x2896d1[_0xb00b('0x23')](_0x520444);}return _0x2896d1['status'](_0x520444)[_0xb00b('0x24')]();};}function respondWithResult(_0x243fdb,_0x3c9500){_0x3c9500=_0x3c9500||0xc8;return function(_0x8caadf){if(_0x8caadf){return _0x243fdb['status'](_0x3c9500)['json'](_0x8caadf);}};}function respondWithFilteredResult(_0x3785e9,_0x490380){return function(_0x550587){if(_0x550587){var _0x4a635e=typeof _0x490380[_0xb00b('0x25')]===_0xb00b('0x26')&&typeof _0x490380[_0xb00b('0x27')]===_0xb00b('0x26');var _0x1f14fa=_0x550587[_0xb00b('0x28')];var _0x15d3b9=_0x4a635e?0x0:_0x490380['offset'];var _0x22c22d=_0x4a635e?_0x550587['count']:_0x490380[_0xb00b('0x25')]+_0x490380[_0xb00b('0x27')];var _0x5424ca;if(_0x22c22d>=_0x1f14fa){_0x22c22d=_0x1f14fa;_0x5424ca=0xc8;}else{_0x5424ca=0xce;}_0x3785e9['status'](_0x5424ca);return _0x3785e9[_0xb00b('0x29')](_0xb00b('0x2a'),_0x15d3b9+'-'+_0x22c22d+'/'+_0x1f14fa)[_0xb00b('0x2b')](_0x550587);}return null;};}function patchUpdates(_0x183233){return function(_0x303625){try{jsonpatch[_0xb00b('0x2c')](_0x303625,_0x183233,!![]);}catch(_0x2e160a){return BPromise[_0xb00b('0x2d')](_0x2e160a);}return _0x303625[_0xb00b('0x2e')]();};}function saveUpdates(_0x54e247,_0x2b5f41){return function(_0x44918d){if(_0x44918d){return _0x44918d['update'](_0x54e247)[_0xb00b('0x2f')](function(_0x2f3b37){return _0x2f3b37;});}return null;};}function removeEntity(_0x5a5e5a,_0x456241){return function(_0x4d2ee5){if(_0x4d2ee5){return _0x4d2ee5[_0xb00b('0x30')]()[_0xb00b('0x2f')](function(){var _0x322879=_0x4d2ee5[_0xb00b('0x31')]({'plain':!![]});var _0x338864=_0xb00b('0x32');return db[_0xb00b('0x33')]['destroy']({'where':{'type':_0x338864,'resourceId':_0x322879['id']}})['then'](function(){return _0x4d2ee5;});})['then'](function(){_0x5a5e5a[_0xb00b('0x34')](0xcc)[_0xb00b('0x24')]();});}};}function handleEntityNotFound(_0x45dcda,_0x2589cb){return function(_0x5cfa60){if(!_0x5cfa60){_0x45dcda[_0xb00b('0x23')](0x194);}return _0x5cfa60;};}function handleError(_0x266f8e,_0x341f46){_0x341f46=_0x341f46||0x1f4;return function(_0x1c7a9f){logger[_0xb00b('0x1e')](_0x1c7a9f[_0xb00b('0x35')]);if(_0x1c7a9f[_0xb00b('0x36')]){delete _0x1c7a9f[_0xb00b('0x36')];}_0x266f8e['status'](_0x341f46)['send'](_0x1c7a9f);};}exports[_0xb00b('0x37')]=function(_0x56022e,_0x1c8258){var _0x1c5400={},_0x29579b={},_0x45ca74={'count':0x0,'rows':[]};var _0x37c017=_[_0xb00b('0x38')](db[_0xb00b('0x39')]['rawAttributes'],function(_0x35f1ca){return{'name':_0x35f1ca[_0xb00b('0x3a')],'type':_0x35f1ca[_0xb00b('0x3b')][_0xb00b('0x3c')]};});_0x29579b[_0xb00b('0x3d')]=_[_0xb00b('0x38')](_0x37c017,'name');_0x29579b[_0xb00b('0x3e')]=_[_0xb00b('0x3f')](_0x56022e['query']);_0x29579b[_0xb00b('0x40')]=_[_0xb00b('0x41')](_0x29579b[_0xb00b('0x3d')],_0x29579b[_0xb00b('0x3e')]);_0x1c5400[_0xb00b('0x42')]=_['intersection'](_0x29579b[_0xb00b('0x3d')],qs[_0xb00b('0x43')](_0x56022e[_0xb00b('0x3e')][_0xb00b('0x43')]));_0x1c5400['attributes']=_0x1c5400['attributes'][_0xb00b('0x44')]?_0x1c5400[_0xb00b('0x42')]:_0x29579b[_0xb00b('0x3d')];if(!_0x56022e[_0xb00b('0x3e')][_0xb00b('0x45')](_0xb00b('0x46'))){_0x1c5400[_0xb00b('0x27')]=qs['limit'](_0x56022e[_0xb00b('0x3e')][_0xb00b('0x27')]);_0x1c5400[_0xb00b('0x25')]=qs[_0xb00b('0x25')](_0x56022e[_0xb00b('0x3e')][_0xb00b('0x25')]);}_0x1c5400[_0xb00b('0x47')]=qs[_0xb00b('0x48')](_0x56022e[_0xb00b('0x3e')][_0xb00b('0x48')]);_0x1c5400[_0xb00b('0x49')]=qs[_0xb00b('0x40')](_['pick'](_0x56022e[_0xb00b('0x3e')],_0x29579b[_0xb00b('0x40')]),_0x37c017);if(_0x56022e[_0xb00b('0x3e')][_0xb00b('0x4a')]){_0x1c5400[_0xb00b('0x49')]=_[_0xb00b('0x4b')](_0x1c5400[_0xb00b('0x49')],{'$or':_[_0xb00b('0x38')](_0x37c017,function(_0x10ba60){if(_0x10ba60[_0xb00b('0x3b')]!==_0xb00b('0x4c')){var _0x3b3031={};_0x3b3031[_0x10ba60['name']]={'$like':'%'+_0x56022e['query']['filter']+'%'};return _0x3b3031;}})});}_0x1c5400=_[_0xb00b('0x4b')]({},_0x1c5400,_0x56022e[_0xb00b('0x4d')]);var _0x481154={'where':_0x1c5400[_0xb00b('0x49')]};return db[_0xb00b('0x39')][_0xb00b('0x28')](_0x481154)[_0xb00b('0x2f')](function(_0x4b62b3){_0x45ca74['count']=_0x4b62b3;if(_0x56022e[_0xb00b('0x3e')][_0xb00b('0x4e')]){_0x1c5400['include']=[{'all':!![]}];}return db['Trunk'][_0xb00b('0x4f')](_0x1c5400);})[_0xb00b('0x2f')](function(_0x4e0be4){_0x45ca74[_0xb00b('0x50')]=_0x4e0be4;return _0x45ca74;})['then'](respondWithFilteredResult(_0x1c8258,_0x1c5400))['catch'](handleError(_0x1c8258,null));};exports['show']=function(_0x465d90,_0x481515){var _0x1f7b86={'raw':![],'where':{'id':_0x465d90[_0xb00b('0x51')]['id']}},_0x3178aa={};_0x3178aa[_0xb00b('0x3d')]=_[_0xb00b('0x3f')](db[_0xb00b('0x39')]['rawAttributes']);_0x3178aa['query']=_[_0xb00b('0x3f')](_0x465d90[_0xb00b('0x3e')]);_0x3178aa['filters']=_[_0xb00b('0x41')](_0x3178aa[_0xb00b('0x3d')],_0x3178aa['query']);_0x1f7b86[_0xb00b('0x42')]=_[_0xb00b('0x41')](_0x3178aa[_0xb00b('0x3d')],qs['fields'](_0x465d90['query'][_0xb00b('0x43')]));_0x1f7b86[_0xb00b('0x42')]=_0x1f7b86[_0xb00b('0x42')][_0xb00b('0x44')]?_0x1f7b86['attributes']:_0x3178aa[_0xb00b('0x3d')];if(_0x465d90[_0xb00b('0x3e')]['includeAll']){_0x1f7b86['include']=[{'all':!![]}];}_0x1f7b86=_[_0xb00b('0x4b')]({},_0x1f7b86,_0x465d90['options']);return db[_0xb00b('0x39')][_0xb00b('0x52')](_0x1f7b86)[_0xb00b('0x2f')](handleEntityNotFound(_0x481515,null))[_0xb00b('0x2f')](respondWithResult(_0x481515,null))[_0xb00b('0x22')](handleError(_0x481515,null));};exports[_0xb00b('0x53')]=function(_0x5a3b85,_0x5d52a5){var _0x51c9e3={'where':{'id':_0x5a3b85[_0xb00b('0x51')]['id']}},_0x37d4d2={};_0x37d4d2[_0xb00b('0x3d')]=_['keys'](db[_0xb00b('0x39')][_0xb00b('0x54')]);_0x51c9e3[_0xb00b('0x42')]=_['intersection'](_0x37d4d2[_0xb00b('0x3d')],qs[_0xb00b('0x43')](_0x5a3b85[_0xb00b('0x3e')][_0xb00b('0x43')]));_0x51c9e3[_0xb00b('0x42')]=_0x51c9e3[_0xb00b('0x42')][_0xb00b('0x44')]?_0x51c9e3[_0xb00b('0x42')]:_0x37d4d2['model'];if(_0x5a3b85[_0xb00b('0x3e')][_0xb00b('0x4e')]){_0x51c9e3[_0xb00b('0x55')]=[{'all':!![]}];}_0x51c9e3=_['merge']({},_0x51c9e3,_0x5a3b85[_0xb00b('0x4d')]);return db[_0xb00b('0x39')][_0xb00b('0x52')](_0x51c9e3)[_0xb00b('0x2f')](handleEntityNotFound(_0x5d52a5,null))[_0xb00b('0x2f')](function(_0x4bfe0b){if(_0x4bfe0b){var _0xfd4ecc=_0x4bfe0b[_0xb00b('0x31')]({'plain':!![]});_0xfd4ecc=qs[_0xb00b('0x56')](_0xfd4ecc,['id',_0xb00b('0x57'),'updatedAt']);_0x5a3b85[_0xb00b('0x58')]=_[_0xb00b('0x56')](_0x5a3b85[_0xb00b('0x58')],['id',_0xb00b('0x57'),_0xb00b('0x59')]);return db[_0xb00b('0x39')][_0xb00b('0x5a')](_['merge'](_0xfd4ecc,_0x5a3b85[_0xb00b('0x58')]),{'include':_0x5a3b85['query'][_0xb00b('0x4e')]?[{'all':!![]}]:undefined})['then'](function(_0x3b3272){var _0x530d4a=_0x5a3b85[_0xb00b('0x5b')]['get']({'plain':!![]});if(!_0x530d4a)throw new Error(_0xb00b('0x5c'));if(_0x530d4a[_0xb00b('0x5d')]===_0xb00b('0x5b')){var _0x4d1cec=_0x3b3272['get']({'plain':!![]});var _0x4f7a59=_0xb00b('0x32');return db[_0xb00b('0x5e')][_0xb00b('0x52')]({'where':{'name':_0x4f7a59,'userProfileId':_0x530d4a['userProfileId']},'raw':!![]})[_0xb00b('0x2f')](function(_0x37ae88){if(_0x37ae88&&_0x37ae88[_0xb00b('0x5f')]===0x0){return db[_0xb00b('0x33')][_0xb00b('0x5a')]({'name':_0x4d1cec['name'],'resourceId':_0x4d1cec['id'],'type':_0x37ae88[_0xb00b('0x36')],'sectionId':_0x37ae88['id']},{})[_0xb00b('0x2f')](function(){return _0x3b3272;});}else{return _0x3b3272;}})['catch'](function(_0xe1316d){logger[_0xb00b('0x1e')](_0xb00b('0x60'),_0xe1316d);throw _0xe1316d;});}return _0x3b3272;});}})['then'](respondWithResult(_0x5d52a5,0xc9))['catch'](handleError(_0x5d52a5,null));};exports[_0xb00b('0x5a')]=function(_0x188da7,_0x23762e,_0x49f0a2){var _0x5aac5f;return db['Trunk']['create'](_0x188da7[_0xb00b('0x58')],{'raw':!![]})['then'](function(_0x2434a0){_0x5aac5f=_0x2434a0;return db[_0xb00b('0x39')]['findAll']({'raw':!![]});})[_0xb00b('0x2f')](function(_0x1e7f3a){var _0x2d21ec=fs[_0xb00b('0x61')](path[_0xb00b('0x62')](config['root'],_0xb00b('0x63')),_0xb00b('0x64'));var _0x3d4482=fs[_0xb00b('0x61')](path[_0xb00b('0x62')](config[_0xb00b('0x65')],_0xb00b('0x66')),'utf8');var _0x27b3ae=ejs[_0xb00b('0x67')](_0x2d21ec,{'trunks':_0x1e7f3a||[]});fs[_0xb00b('0x68')](_0xb00b('0x69'),_0x27b3ae);if(_0x5aac5f[_0xb00b('0x6a')]){var _0x432b68=ejs[_0xb00b('0x67')](_0x3d4482,{'trunks':_0x1e7f3a||[]});fs[_0xb00b('0x68')]('/etc/asterisk/sip_xcally_registers.conf',_0x432b68);}})[_0xb00b('0x2f')](function(){return respondWithRpcPromise(_0xb00b('0x6b'),_0xb00b('0x5a'),{'module':_0xb00b('0x6c')});})[_0xb00b('0x2f')](function(){var _0xfb2b68=_0x188da7[_0xb00b('0x5b')][_0xb00b('0x31')]({'plain':!![]});if(!_0xfb2b68)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfb2b68[_0xb00b('0x5d')]===_0xb00b('0x5b')){var _0x7803a0=_0x5aac5f[_0xb00b('0x31')]({'plain':!![]});return db[_0xb00b('0x5e')][_0xb00b('0x52')]({'where':{'name':_0xb00b('0x32'),'userProfileId':_0xfb2b68['userProfileId']},'raw':!![]})[_0xb00b('0x2f')](function(_0x37a4c0){if(_0x37a4c0&&_0x37a4c0[_0xb00b('0x5f')]===0x0){return db[_0xb00b('0x33')][_0xb00b('0x5a')]({'name':_0x7803a0[_0xb00b('0x36')],'resourceId':_0x7803a0['id'],'type':_0x37a4c0['name'],'sectionId':_0x37a4c0['id']},{})[_0xb00b('0x2f')](function(){return _0x5aac5f;});}else{return _0x5aac5f;}})['catch'](function(_0x135cbf){logger['error'](_0xb00b('0x60'),_0x135cbf);throw _0x135cbf;});}return _0x5aac5f;})[_0xb00b('0x2f')](respondWithResult(_0x23762e,0xc9))[_0xb00b('0x22')](handleError(_0x23762e,null));};exports['update']=function(_0x5287cc,_0x9ad1c6,_0x3c4850){var _0x33a483;return db[_0xb00b('0x39')][_0xb00b('0x52')]({'where':{'id':_0x5287cc[_0xb00b('0x51')]['id']}})[_0xb00b('0x2f')](handleEntityNotFound(_0x9ad1c6,null))[_0xb00b('0x2f')](saveUpdates(_0x5287cc[_0xb00b('0x58')],null))[_0xb00b('0x2f')](function(_0x257430){if(_0x257430){_0x33a483=_0x257430;return db[_0xb00b('0x39')][_0xb00b('0x4f')]({'raw':!![]});}})[_0xb00b('0x2f')](function(_0x4eb17d){if(_0x4eb17d){var _0x59503c=fs[_0xb00b('0x61')](path[_0xb00b('0x62')](config['root'],'server/files/templates/trunk.ejs'),_0xb00b('0x64'));var _0x391e98=fs[_0xb00b('0x61')](path['join'](config[_0xb00b('0x65')],_0xb00b('0x66')),_0xb00b('0x64'));var _0x45c9cd=ejs[_0xb00b('0x67')](_0x59503c,{'trunks':_0x4eb17d||[]});fs[_0xb00b('0x68')](_0xb00b('0x69'),_0x45c9cd);var _0x4a9125=ejs[_0xb00b('0x67')](_0x391e98,{'trunks':_0x4eb17d||[]});fs['writeFileSync'](_0xb00b('0x6d'),_0x4a9125);return respondWithRpcPromise(_0xb00b('0x6b'),'update',{'module':_0xb00b('0x6c')});}return null;})[_0xb00b('0x2f')](function(_0xe80a21){if(_0xe80a21){return _0x33a483;}})[_0xb00b('0x2f')](respondWithResult(_0x9ad1c6,null))[_0xb00b('0x22')](handleError(_0x9ad1c6,null));};exports[_0xb00b('0x30')]=function(_0xc41c1f,_0x2423b2,_0x36ba5c){var _0x383d16;return db[_0xb00b('0x39')][_0xb00b('0x52')]({'where':{'id':_0xc41c1f['params']['id']}})[_0xb00b('0x2f')](handleEntityNotFound(_0x2423b2,null))[_0xb00b('0x2f')](removeEntity(_0x2423b2,null))[_0xb00b('0x2f')](function(){return db[_0xb00b('0x39')]['findAll']({'raw':!![]});})[_0xb00b('0x2f')](function(_0x17503d){var _0x32508b=fs[_0xb00b('0x61')](path[_0xb00b('0x62')](config['root'],_0xb00b('0x63')),_0xb00b('0x64'));var _0xa4fe1e=fs[_0xb00b('0x61')](path['join'](config[_0xb00b('0x65')],'server/files/templates/registry.ejs'),_0xb00b('0x64'));var _0x202d5f=ejs[_0xb00b('0x67')](_0x32508b,{'trunks':_0x17503d});var _0x165442=ejs[_0xb00b('0x67')](_0xa4fe1e,{'trunks':_0x17503d});fs[_0xb00b('0x68')](_0xb00b('0x69'),_0x202d5f);fs[_0xb00b('0x68')](_0xb00b('0x6d'),_0x165442);return respondWithRpcPromise(_0xb00b('0x6b'),_0xb00b('0x30'),{'module':'chan_sip.so'});})[_0xb00b('0x22')](handleError(_0x2423b2,null));}; \ No newline at end of file +var _0x24ca=['lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','get','Trunks','UserProfileResource','destroy','then','end','name','send','map','Trunk','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','rawAttributes','keys','find','clone','length','omit','createdAt','updatedAt','create','user','role','userProfileId','autoAssociation','body','join','root','server/files/templates/trunk.ejs','readFileSync','server/files/templates/registry.ejs','utf8','writeFileSync','registry','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','/etc/asterisk/sip_xcally_trunks.conf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x1e9e9b,_0x5b351a){var _0x2b3a9a=function(_0x3645ba){while(--_0x3645ba){_0x1e9e9b['push'](_0x1e9e9b['shift']());}};_0x2b3a9a(++_0x5b351a);}(_0x24ca,0x1bc));var _0xa24c=function(_0x336ca2,_0x1a813a){_0x336ca2=_0x336ca2-0x0;var _0xda59a6=_0x24ca[_0x336ca2];return _0xda59a6;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];var jayson=require(_0xa24c('0x1b'));var client=jayson[_0xa24c('0x1c')][_0xa24c('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5a9486,_0x3ad0bf,_0x3c23fc,_0x26ff28){return new BPromise(function(_0x2fcd8b,_0x1cb08e){var _0x2d185c=_0x26ff28||client;return _0x2d185c[_0xa24c('0x1e')](_0x5a9486,_0x3c23fc)['then'](function(_0x47a063){logger[_0xa24c('0x1f')](_0xa24c('0x20'),_0x3ad0bf,'request\x20sent');logger['debug'](_0xa24c('0x21'),_0x3ad0bf,_0xa24c('0x22'),JSON['stringify'](_0x47a063));if(_0x47a063[_0xa24c('0x23')]){if(_0x47a063['error'][_0xa24c('0x24')]===0x1f4){logger[_0xa24c('0x23')](_0xa24c('0x20'),_0x3ad0bf,_0x47a063[_0xa24c('0x23')]['message']);return _0x1cb08e(_0x47a063[_0xa24c('0x23')][_0xa24c('0x25')]);}logger[_0xa24c('0x23')]('Trunk,\x20%s,\x20%s',_0x3ad0bf,_0x47a063['error']['message']);return _0x2fcd8b(_0x47a063['error'][_0xa24c('0x25')]);}else{logger[_0xa24c('0x1f')](_0xa24c('0x20'),_0x3ad0bf,_0xa24c('0x22'));_0x2fcd8b(_0x47a063['result'][_0xa24c('0x25')]);}})['catch'](function(_0x224bca){logger[_0xa24c('0x23')]('Trunk,\x20%s,\x20%s',_0x3ad0bf,_0x224bca);_0x1cb08e(_0x224bca);});});}function respondWithStatusCode(_0x346ee8,_0x363d52){_0x363d52=_0x363d52||0xcc;return function(_0x43a0c0){if(_0x43a0c0){return _0x346ee8[_0xa24c('0x26')](_0x363d52);}return _0x346ee8[_0xa24c('0x27')](_0x363d52)['end']();};}function respondWithResult(_0xec9167,_0x5cc9cb){_0x5cc9cb=_0x5cc9cb||0xc8;return function(_0x2365f9){if(_0x2365f9){return _0xec9167[_0xa24c('0x27')](_0x5cc9cb)[_0xa24c('0x28')](_0x2365f9);}};}function respondWithFilteredResult(_0x51dc3f,_0x1beb55){return function(_0x31c4d9){if(_0x31c4d9){var _0x14fd5a=typeof _0x1beb55[_0xa24c('0x29')]===_0xa24c('0x2a')&&typeof _0x1beb55[_0xa24c('0x2b')]===_0xa24c('0x2a');var _0x5b23f4=_0x31c4d9[_0xa24c('0x2c')];var _0x28675f=_0x14fd5a?0x0:_0x1beb55[_0xa24c('0x29')];var _0x12dbdc=_0x14fd5a?_0x31c4d9['count']:_0x1beb55[_0xa24c('0x29')]+_0x1beb55[_0xa24c('0x2b')];var _0x97c08;if(_0x12dbdc>=_0x5b23f4){_0x12dbdc=_0x5b23f4;_0x97c08=0xc8;}else{_0x97c08=0xce;}_0x51dc3f['status'](_0x97c08);return _0x51dc3f[_0xa24c('0x2d')](_0xa24c('0x2e'),_0x28675f+'-'+_0x12dbdc+'/'+_0x5b23f4)[_0xa24c('0x28')](_0x31c4d9);}return null;};}function patchUpdates(_0x4ae35c){return function(_0x245fb2){try{jsonpatch['apply'](_0x245fb2,_0x4ae35c,!![]);}catch(_0x1102ab){return BPromise[_0xa24c('0x2f')](_0x1102ab);}return _0x245fb2[_0xa24c('0x30')]();};}function saveUpdates(_0x5d025a,_0x1f52f8){return function(_0x53f90){if(_0x53f90){return _0x53f90[_0xa24c('0x31')](_0x5d025a)['then'](function(_0x1c1ed3){return _0x1c1ed3;});}return null;};}function removeEntity(_0x57c340,_0xa20091){return function(_0x42ba21){if(_0x42ba21){return _0x42ba21['destroy']()['then'](function(){var _0x20a276=_0x42ba21[_0xa24c('0x32')]({'plain':!![]});var _0x182e86=_0xa24c('0x33');return db[_0xa24c('0x34')][_0xa24c('0x35')]({'where':{'type':_0x182e86,'resourceId':_0x20a276['id']}})[_0xa24c('0x36')](function(){return _0x42ba21;});})['then'](function(){_0x57c340[_0xa24c('0x27')](0xcc)[_0xa24c('0x37')]();});}};}function handleEntityNotFound(_0x12825d,_0xbd24c0){return function(_0xc6337b){if(!_0xc6337b){_0x12825d[_0xa24c('0x26')](0x194);}return _0xc6337b;};}function handleError(_0x86902f,_0x81d471){_0x81d471=_0x81d471||0x1f4;return function(_0x1ea166){logger[_0xa24c('0x23')](_0x1ea166['stack']);if(_0x1ea166[_0xa24c('0x38')]){delete _0x1ea166[_0xa24c('0x38')];}_0x86902f[_0xa24c('0x27')](_0x81d471)[_0xa24c('0x39')](_0x1ea166);};}exports['index']=function(_0x56a485,_0x19a65f){var _0x56ef4d={},_0xb690b5={},_0x13f272={'count':0x0,'rows':[]};var _0x22a316=_[_0xa24c('0x3a')](db[_0xa24c('0x3b')]['rawAttributes'],function(_0x532875){return{'name':_0x532875[_0xa24c('0x3c')],'type':_0x532875[_0xa24c('0x3d')][_0xa24c('0x3e')]};});_0xb690b5[_0xa24c('0x3f')]=_[_0xa24c('0x3a')](_0x22a316,_0xa24c('0x38'));_0xb690b5['query']=_['keys'](_0x56a485[_0xa24c('0x40')]);_0xb690b5[_0xa24c('0x41')]=_[_0xa24c('0x42')](_0xb690b5[_0xa24c('0x3f')],_0xb690b5[_0xa24c('0x40')]);_0x56ef4d['attributes']=_[_0xa24c('0x42')](_0xb690b5[_0xa24c('0x3f')],qs['fields'](_0x56a485['query'][_0xa24c('0x43')]));_0x56ef4d[_0xa24c('0x44')]=_0x56ef4d[_0xa24c('0x44')]['length']?_0x56ef4d['attributes']:_0xb690b5[_0xa24c('0x3f')];if(!_0x56a485[_0xa24c('0x40')][_0xa24c('0x45')](_0xa24c('0x46'))){_0x56ef4d[_0xa24c('0x2b')]=qs[_0xa24c('0x2b')](_0x56a485[_0xa24c('0x40')][_0xa24c('0x2b')]);_0x56ef4d['offset']=qs['offset'](_0x56a485[_0xa24c('0x40')][_0xa24c('0x29')]);}_0x56ef4d[_0xa24c('0x47')]=qs['sort'](_0x56a485[_0xa24c('0x40')][_0xa24c('0x48')]);_0x56ef4d[_0xa24c('0x49')]=qs[_0xa24c('0x41')](_[_0xa24c('0x4a')](_0x56a485[_0xa24c('0x40')],_0xb690b5[_0xa24c('0x41')]),_0x22a316);if(_0x56a485[_0xa24c('0x40')][_0xa24c('0x4b')]){_0x56ef4d[_0xa24c('0x49')]=_['merge'](_0x56ef4d[_0xa24c('0x49')],{'$or':_[_0xa24c('0x3a')](_0x22a316,function(_0x39a6cd){if(_0x39a6cd['type']!==_0xa24c('0x4c')){var _0x247d2c={};_0x247d2c[_0x39a6cd[_0xa24c('0x38')]]={'$like':'%'+_0x56a485[_0xa24c('0x40')][_0xa24c('0x4b')]+'%'};return _0x247d2c;}})});}_0x56ef4d=_[_0xa24c('0x4d')]({},_0x56ef4d,_0x56a485[_0xa24c('0x4e')]);var _0x46f725={'where':_0x56ef4d[_0xa24c('0x49')]};return db[_0xa24c('0x3b')][_0xa24c('0x2c')](_0x46f725)['then'](function(_0x29a84d){_0x13f272[_0xa24c('0x2c')]=_0x29a84d;if(_0x56a485[_0xa24c('0x40')][_0xa24c('0x4f')]){_0x56ef4d[_0xa24c('0x50')]=[{'all':!![]}];}return db[_0xa24c('0x3b')][_0xa24c('0x51')](_0x56ef4d);})[_0xa24c('0x36')](function(_0x184179){_0x13f272['rows']=_0x184179;return _0x13f272;})['then'](respondWithFilteredResult(_0x19a65f,_0x56ef4d))[_0xa24c('0x52')](handleError(_0x19a65f,null));};exports['show']=function(_0xc078ef,_0x1f436c){var _0x4ec677={'raw':![],'where':{'id':_0xc078ef[_0xa24c('0x53')]['id']}},_0x24b3df={};_0x24b3df[_0xa24c('0x3f')]=_['keys'](db['Trunk'][_0xa24c('0x54')]);_0x24b3df['query']=_[_0xa24c('0x55')](_0xc078ef[_0xa24c('0x40')]);_0x24b3df[_0xa24c('0x41')]=_[_0xa24c('0x42')](_0x24b3df[_0xa24c('0x3f')],_0x24b3df[_0xa24c('0x40')]);_0x4ec677[_0xa24c('0x44')]=_[_0xa24c('0x42')](_0x24b3df[_0xa24c('0x3f')],qs[_0xa24c('0x43')](_0xc078ef['query'][_0xa24c('0x43')]));_0x4ec677[_0xa24c('0x44')]=_0x4ec677[_0xa24c('0x44')]['length']?_0x4ec677['attributes']:_0x24b3df['model'];if(_0xc078ef[_0xa24c('0x40')]['includeAll']){_0x4ec677[_0xa24c('0x50')]=[{'all':!![]}];}_0x4ec677=_[_0xa24c('0x4d')]({},_0x4ec677,_0xc078ef['options']);return db[_0xa24c('0x3b')][_0xa24c('0x56')](_0x4ec677)[_0xa24c('0x36')](handleEntityNotFound(_0x1f436c,null))[_0xa24c('0x36')](respondWithResult(_0x1f436c,null))[_0xa24c('0x52')](handleError(_0x1f436c,null));};exports[_0xa24c('0x57')]=function(_0x3816f7,_0xbeab78){var _0x518c2a={'where':{'id':_0x3816f7['params']['id']}},_0x172645={};_0x172645['model']=_['keys'](db['Trunk']['rawAttributes']);_0x518c2a[_0xa24c('0x44')]=_['intersection'](_0x172645[_0xa24c('0x3f')],qs[_0xa24c('0x43')](_0x3816f7[_0xa24c('0x40')][_0xa24c('0x43')]));_0x518c2a[_0xa24c('0x44')]=_0x518c2a[_0xa24c('0x44')][_0xa24c('0x58')]?_0x518c2a[_0xa24c('0x44')]:_0x172645[_0xa24c('0x3f')];if(_0x3816f7[_0xa24c('0x40')][_0xa24c('0x4f')]){_0x518c2a[_0xa24c('0x50')]=[{'all':!![]}];}_0x518c2a=_[_0xa24c('0x4d')]({},_0x518c2a,_0x3816f7[_0xa24c('0x4e')]);return db[_0xa24c('0x3b')]['find'](_0x518c2a)[_0xa24c('0x36')](handleEntityNotFound(_0xbeab78,null))[_0xa24c('0x36')](function(_0x5264a7){if(_0x5264a7){var _0x1e08bb=_0x5264a7[_0xa24c('0x32')]({'plain':!![]});_0x1e08bb=qs[_0xa24c('0x59')](_0x1e08bb,['id',_0xa24c('0x5a'),'updatedAt']);_0x3816f7['body']=_[_0xa24c('0x59')](_0x3816f7['body'],['id','createdAt',_0xa24c('0x5b')]);return db[_0xa24c('0x3b')][_0xa24c('0x5c')](_[_0xa24c('0x4d')](_0x1e08bb,_0x3816f7['body']),{'include':_0x3816f7['query'][_0xa24c('0x4f')]?[{'all':!![]}]:undefined})['then'](function(_0x52a895){var _0xfcc193=_0x3816f7[_0xa24c('0x5d')][_0xa24c('0x32')]({'plain':!![]});if(!_0xfcc193)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfcc193[_0xa24c('0x5e')]===_0xa24c('0x5d')){var _0x5c3285=_0x52a895[_0xa24c('0x32')]({'plain':!![]});var _0x3f306d=_0xa24c('0x33');return db['UserProfileSection'][_0xa24c('0x56')]({'where':{'name':_0x3f306d,'userProfileId':_0xfcc193[_0xa24c('0x5f')]},'raw':!![]})[_0xa24c('0x36')](function(_0x7aab6e){if(_0x7aab6e&&_0x7aab6e[_0xa24c('0x60')]===0x0){return db['UserProfileResource'][_0xa24c('0x5c')]({'name':_0x5c3285[_0xa24c('0x38')],'resourceId':_0x5c3285['id'],'type':_0x7aab6e[_0xa24c('0x38')],'sectionId':_0x7aab6e['id']},{})[_0xa24c('0x36')](function(){return _0x52a895;});}else{return _0x52a895;}})[_0xa24c('0x52')](function(_0x2ca3fa){logger[_0xa24c('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ca3fa);throw _0x2ca3fa;});}return _0x52a895;});}})[_0xa24c('0x36')](respondWithResult(_0xbeab78,0xc9))[_0xa24c('0x52')](handleError(_0xbeab78,null));};exports['create']=function(_0xb1048a,_0x3e455b,_0x14da5e){var _0xb460b4;return db[_0xa24c('0x3b')][_0xa24c('0x5c')](_0xb1048a[_0xa24c('0x61')],{'raw':!![]})[_0xa24c('0x36')](function(_0x38cc30){_0xb460b4=_0x38cc30;return db[_0xa24c('0x3b')]['findAll']({'raw':!![]});})[_0xa24c('0x36')](function(_0x3a4abd){var _0x3b894f=fs['readFileSync'](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x64')),'utf8');var _0x3ac3a0=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x66')),_0xa24c('0x67'));var _0x4f9b56=ejs['render'](_0x3b894f,{'trunks':_0x3a4abd||[]});fs[_0xa24c('0x68')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4f9b56);if(_0xb460b4[_0xa24c('0x69')]){var _0x1879ae=ejs[_0xa24c('0x6a')](_0x3ac3a0,{'trunks':_0x3a4abd||[]});fs[_0xa24c('0x68')](_0xa24c('0x6b'),_0x1879ae);}})['then'](function(){return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x5c'),{'module':_0xa24c('0x6d')});})[_0xa24c('0x36')](function(){var _0x987aca=_0xb1048a[_0xa24c('0x5d')]['get']({'plain':!![]});if(!_0x987aca)throw new Error(_0xa24c('0x6e'));if(_0x987aca[_0xa24c('0x5e')]===_0xa24c('0x5d')){var _0x5b9ad7=_0xb460b4['get']({'plain':!![]});return db[_0xa24c('0x6f')]['find']({'where':{'name':_0xa24c('0x33'),'userProfileId':_0x987aca[_0xa24c('0x5f')]},'raw':!![]})[_0xa24c('0x36')](function(_0x180da2){if(_0x180da2&&_0x180da2['autoAssociation']===0x0){return db[_0xa24c('0x34')][_0xa24c('0x5c')]({'name':_0x5b9ad7['name'],'resourceId':_0x5b9ad7['id'],'type':_0x180da2[_0xa24c('0x38')],'sectionId':_0x180da2['id']},{})[_0xa24c('0x36')](function(){return _0xb460b4;});}else{return _0xb460b4;}})[_0xa24c('0x52')](function(_0x3e0c08){logger[_0xa24c('0x23')](_0xa24c('0x70'),_0x3e0c08);throw _0x3e0c08;});}return _0xb460b4;})[_0xa24c('0x36')](respondWithResult(_0x3e455b,0xc9))[_0xa24c('0x52')](handleError(_0x3e455b,null));};exports['update']=function(_0x12508e,_0x3c2726,_0x2cae90){var _0x28c3ff;return db[_0xa24c('0x3b')][_0xa24c('0x56')]({'where':{'id':_0x12508e[_0xa24c('0x53')]['id']}})[_0xa24c('0x36')](handleEntityNotFound(_0x3c2726,null))[_0xa24c('0x36')](saveUpdates(_0x12508e[_0xa24c('0x61')],null))[_0xa24c('0x36')](function(_0x5b0127){if(_0x5b0127){_0x28c3ff=_0x5b0127;return db[_0xa24c('0x3b')][_0xa24c('0x51')]({'raw':!![]});}})['then'](function(_0x141ccf){if(_0x141ccf){var _0x3f212f=fs[_0xa24c('0x65')](path['join'](config['root'],_0xa24c('0x64')),_0xa24c('0x67'));var _0x53928f=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x66')),_0xa24c('0x67'));var _0x336898=ejs['render'](_0x3f212f,{'trunks':_0x141ccf||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x336898);var _0x263dab=ejs['render'](_0x53928f,{'trunks':_0x141ccf||[]});fs['writeFileSync'](_0xa24c('0x6b'),_0x263dab);return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x31'),{'module':_0xa24c('0x6d')});}return null;})[_0xa24c('0x36')](function(_0x45b2fe){if(_0x45b2fe){return _0x28c3ff;}})[_0xa24c('0x36')](respondWithResult(_0x3c2726,null))[_0xa24c('0x52')](handleError(_0x3c2726,null));};exports[_0xa24c('0x35')]=function(_0x4ee10d,_0x3897ca,_0xa077c8){var _0x16e1db;return db[_0xa24c('0x3b')][_0xa24c('0x56')]({'where':{'id':_0x4ee10d[_0xa24c('0x53')]['id']}})[_0xa24c('0x36')](handleEntityNotFound(_0x3897ca,null))[_0xa24c('0x36')](removeEntity(_0x3897ca,null))[_0xa24c('0x36')](function(){return db[_0xa24c('0x3b')][_0xa24c('0x51')]({'raw':!![]});})[_0xa24c('0x36')](function(_0x4ecbe9){var _0x1fe0f3=fs[_0xa24c('0x65')](path['join'](config[_0xa24c('0x63')],_0xa24c('0x64')),_0xa24c('0x67'));var _0x4af78f=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config['root'],_0xa24c('0x66')),_0xa24c('0x67'));var _0x4c108f=ejs['render'](_0x1fe0f3,{'trunks':_0x4ecbe9});var _0x124d52=ejs[_0xa24c('0x6a')](_0x4af78f,{'trunks':_0x4ecbe9});fs[_0xa24c('0x68')](_0xa24c('0x71'),_0x4c108f);fs['writeFileSync'](_0xa24c('0x6b'),_0x124d52);return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x35'),{'module':'chan_sip.so'});})['catch'](handleError(_0x3897ca,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 0695cda..bff5436 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 _0x096c=['path','rimraf','../../config/environment','./trunk.attributes','define','Trunk','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x4f8b72,_0x570dc1){var _0x51d92f=function(_0x88854f){while(--_0x88854f){_0x4f8b72['push'](_0x4f8b72['shift']());}};_0x51d92f(++_0x570dc1);}(_0x096c,0x19e));var _0xc096=function(_0xbfbef0,_0x218b21){_0xbfbef0=_0xbfbef0-0x0;var _0x3fdf6f=_0x096c[_0xbfbef0];return _0x3fdf6f;};'use strict';var _=require(_0xc096('0x0'));var util=require(_0xc096('0x1'));var logger=require(_0xc096('0x2'))(_0xc096('0x3'));var moment=require(_0xc096('0x4'));var BPromise=require('bluebird');var rp=require(_0xc096('0x5'));var fs=require('fs');var path=require(_0xc096('0x6'));var rimraf=require(_0xc096('0x7'));var config=require(_0xc096('0x8'));var attributes=require(_0xc096('0x9'));module['exports']=function(_0x87d975,_0x25abc4){return _0x87d975[_0xc096('0xa')](_0xc096('0xb'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6c34=['request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2dce89,_0x128696){var _0x7fd031=function(_0x32fea1){while(--_0x32fea1){_0x2dce89['push'](_0x2dce89['shift']());}};_0x7fd031(++_0x128696);}(_0x6c34,0x89));var _0x46c3=function(_0x5af2b5,_0x3f6ac7){_0x5af2b5=_0x5af2b5-0x0;var _0x51b7fb=_0x6c34[_0x5af2b5];return _0x51b7fb;};'use strict';var _=require(_0x46c3('0x0'));var util=require(_0x46c3('0x1'));var logger=require(_0x46c3('0x2'))(_0x46c3('0x3'));var moment=require(_0x46c3('0x4'));var BPromise=require(_0x46c3('0x5'));var rp=require(_0x46c3('0x6'));var fs=require('fs');var path=require(_0x46c3('0x7'));var rimraf=require(_0x46c3('0x8'));var config=require(_0x46c3('0x9'));var attributes=require(_0x46c3('0xa'));module[_0x46c3('0xb')]=function(_0x268923,_0x36a24e){return _0x268923[_0x46c3('0xc')]('Trunk',attributes,{'tableName':'tools_trunks','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 2c70440..55f8372 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 _0x991e=['result','GetTrunk','Trunk','options','raw','where','attributes','limit','include','map','model','then','catch','ShowTrunk','stringify','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','Trunk,\x20%s,\x20%s','error','message'];(function(_0x156a53,_0x35995e){var _0x57ca64=function(_0x498198){while(--_0x498198){_0x156a53['push'](_0x156a53['shift']());}};_0x57ca64(++_0x35995e);}(_0x991e,0x6f));var _0xe991=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x991e[_0x122096];return _0x3d1966;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe991('0x0'));var BPromise=require(_0xe991('0x1'));var rs=require(_0xe991('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe991('0x3'))['db'];var utils=require(_0xe991('0x4'));var logger=require(_0xe991('0x5'))(_0xe991('0x6'));var config=require('../../config/environment');var jayson=require(_0xe991('0x7'));var client=jayson['client'][_0xe991('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1eddc8,_0x2b1abc,_0x5f276e){return new BPromise(function(_0x3bc7a2,_0x268404){return client[_0xe991('0x9')](_0x1eddc8,_0x5f276e)['then'](function(_0x436325){logger[_0xe991('0xa')]('Trunk,\x20%s,\x20%s',_0x2b1abc,_0xe991('0xb'));logger[_0xe991('0xc')](_0xe991('0xd'),_0x2b1abc,_0xe991('0xb'),JSON['stringify'](_0x436325));if(_0x436325['error']){if(_0x436325['error']['code']===0x1f4){logger['error'](_0xe991('0xe'),_0x2b1abc,_0x436325[_0xe991('0xf')][_0xe991('0x10')]);return _0x268404(_0x436325[_0xe991('0xf')]['message']);}logger[_0xe991('0xf')]('Trunk,\x20%s,\x20%s',_0x2b1abc,_0x436325[_0xe991('0xf')][_0xe991('0x10')]);return _0x3bc7a2(_0x436325[_0xe991('0xf')][_0xe991('0x10')]);}else{logger[_0xe991('0xa')](_0xe991('0xe'),_0x2b1abc,'request\x20sent');_0x3bc7a2(_0x436325[_0xe991('0x11')][_0xe991('0x10')]);}})['catch'](function(_0x548d07){logger[_0xe991('0xf')](_0xe991('0xe'),_0x2b1abc,_0x548d07);_0x268404(_0x548d07);});});}exports[_0xe991('0x12')]=function(_0x722184){var _0x12acfd=this;return new Promise(function(_0x2eface,_0x1f0251){return db[_0xe991('0x13')]['findAll']({'raw':_0x722184[_0xe991('0x14')]?_0x722184[_0xe991('0x14')][_0xe991('0x15')]===undefined?!![]:![]:!![],'where':_0x722184[_0xe991('0x14')]?_0x722184['options'][_0xe991('0x16')]||null:null,'attributes':_0x722184[_0xe991('0x14')]?_0x722184['options'][_0xe991('0x17')]||null:null,'limit':_0x722184[_0xe991('0x14')]?_0x722184['options'][_0xe991('0x18')]||null:null,'include':_0x722184[_0xe991('0x14')]?_0x722184[_0xe991('0x14')][_0xe991('0x19')]?_[_0xe991('0x1a')](_0x722184[_0xe991('0x14')][_0xe991('0x19')],function(_0x5c6942){return{'model':db[_0x5c6942[_0xe991('0x1b')]],'as':_0x5c6942['as'],'attributes':_0x5c6942[_0xe991('0x17')],'include':_0x5c6942[_0xe991('0x19')]?_[_0xe991('0x1a')](_0x5c6942['include'],function(_0x5d74eb){return{'model':db[_0x5d74eb[_0xe991('0x1b')]],'as':_0x5d74eb['as'],'attributes':_0x5d74eb[_0xe991('0x17')],'include':_0x5d74eb['include']?_[_0xe991('0x1a')](_0x5d74eb[_0xe991('0x19')],function(_0x4ae71f){return{'model':db[_0x4ae71f[_0xe991('0x1b')]],'as':_0x4ae71f['as'],'attributes':_0x4ae71f[_0xe991('0x17')]};}):[]};}):[]};}):[]:[]})[_0xe991('0x1c')](function(_0x2e3e2f){logger[_0xe991('0xa')]('GetTrunk',_0x722184);logger[_0xe991('0xc')](_0xe991('0x12'),_0x722184,JSON['stringify'](_0x2e3e2f));_0x2eface(_0x2e3e2f);})[_0xe991('0x1d')](function(_0x2454c5){logger[_0xe991('0xf')](_0xe991('0x12'),_0x2454c5[_0xe991('0x10')],_0x722184);_0x1f0251(_0x12acfd[_0xe991('0xf')](0x1f4,_0x2454c5[_0xe991('0x10')]));});});};exports[_0xe991('0x1e')]=function(_0x12ee92){var _0x3e22df=this;return new Promise(function(_0x543912,_0x37fbd3){return db[_0xe991('0x13')]['find']({'raw':_0x12ee92[_0xe991('0x14')]?_0x12ee92[_0xe991('0x14')][_0xe991('0x15')]===undefined?!![]:![]:!![],'where':_0x12ee92[_0xe991('0x14')]?_0x12ee92['options'][_0xe991('0x16')]||null:null,'attributes':_0x12ee92[_0xe991('0x14')]?_0x12ee92[_0xe991('0x14')][_0xe991('0x17')]||null:null,'include':_0x12ee92[_0xe991('0x14')]?_0x12ee92[_0xe991('0x14')][_0xe991('0x19')]?_[_0xe991('0x1a')](_0x12ee92[_0xe991('0x14')][_0xe991('0x19')],function(_0x2212fb){return{'model':db[_0x2212fb[_0xe991('0x1b')]],'as':_0x2212fb['as'],'attributes':_0x2212fb[_0xe991('0x17')],'include':_0x2212fb['include']?_[_0xe991('0x1a')](_0x2212fb['include'],function(_0x15baa3){return{'model':db[_0x15baa3['model']],'as':_0x15baa3['as'],'attributes':_0x15baa3['attributes'],'include':_0x15baa3[_0xe991('0x19')]?_['map'](_0x15baa3['include'],function(_0x21b911){return{'model':db[_0x21b911[_0xe991('0x1b')]],'as':_0x21b911['as'],'attributes':_0x21b911[_0xe991('0x17')]};}):[]};}):[]};}):[]:[]})[_0xe991('0x1c')](function(_0x1e8dfd){logger[_0xe991('0xa')](_0xe991('0x1e'),_0x12ee92);logger[_0xe991('0xc')](_0xe991('0x1e'),_0x12ee92,JSON[_0xe991('0x1f')](_0x1e8dfd));_0x543912(_0x1e8dfd);})[_0xe991('0x1d')](function(_0x1877e1){logger[_0xe991('0xf')]('ShowTrunk',_0x1877e1[_0xe991('0x10')],_0x12ee92);_0x37fbd3(_0x3e22df['error'](0x1f4,_0x1877e1[_0xe991('0x10')]));});});}; \ No newline at end of file +var _0xe0fb=['attributes','limit','include','map','model','Trunk','find','ShowTrunk','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','request\x20sent','debug','stringify','error','code','Trunk,\x20%s,\x20%s','message','info','result','catch','GetTrunk','options','raw','where'];(function(_0x4b46ee,_0x263f6b){var _0x14f485=function(_0xfd26e8){while(--_0xfd26e8){_0x4b46ee['push'](_0x4b46ee['shift']());}};_0x14f485(++_0x263f6b);}(_0xe0fb,0x6e));var _0xbe0f=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xe0fb[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xbe0f('0x0'));var util=require(_0xbe0f('0x1'));var moment=require(_0xbe0f('0x2'));var BPromise=require(_0xbe0f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbe0f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe0f('0x5'));var logger=require(_0xbe0f('0x6'))(_0xbe0f('0x7'));var config=require('../../config/environment');var jayson=require(_0xbe0f('0x8'));var client=jayson['client'][_0xbe0f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52bdf7,_0x3ee630,_0x9c2115){return new BPromise(function(_0x4210ae,_0x49e01d){return client[_0xbe0f('0xa')](_0x52bdf7,_0x9c2115)[_0xbe0f('0xb')](function(_0x1e7b28){logger['info']('Trunk,\x20%s,\x20%s',_0x3ee630,_0xbe0f('0xc'));logger[_0xbe0f('0xd')]('Trunk,\x20%s,\x20%s,\x20%s',_0x3ee630,_0xbe0f('0xc'),JSON[_0xbe0f('0xe')](_0x1e7b28));if(_0x1e7b28[_0xbe0f('0xf')]){if(_0x1e7b28[_0xbe0f('0xf')][_0xbe0f('0x10')]===0x1f4){logger[_0xbe0f('0xf')](_0xbe0f('0x11'),_0x3ee630,_0x1e7b28['error']['message']);return _0x49e01d(_0x1e7b28['error']['message']);}logger[_0xbe0f('0xf')](_0xbe0f('0x11'),_0x3ee630,_0x1e7b28['error'][_0xbe0f('0x12')]);return _0x4210ae(_0x1e7b28[_0xbe0f('0xf')][_0xbe0f('0x12')]);}else{logger[_0xbe0f('0x13')](_0xbe0f('0x11'),_0x3ee630,_0xbe0f('0xc'));_0x4210ae(_0x1e7b28[_0xbe0f('0x14')][_0xbe0f('0x12')]);}})[_0xbe0f('0x15')](function(_0x433b12){logger[_0xbe0f('0xf')](_0xbe0f('0x11'),_0x3ee630,_0x433b12);_0x49e01d(_0x433b12);});});}exports[_0xbe0f('0x16')]=function(_0x4eb3e0){var _0x20945f=this;return new Promise(function(_0x30e355,_0x442594){return db['Trunk']['findAll']({'raw':_0x4eb3e0[_0xbe0f('0x17')]?_0x4eb3e0[_0xbe0f('0x17')][_0xbe0f('0x18')]===undefined?!![]:![]:!![],'where':_0x4eb3e0[_0xbe0f('0x17')]?_0x4eb3e0['options'][_0xbe0f('0x19')]||null:null,'attributes':_0x4eb3e0[_0xbe0f('0x17')]?_0x4eb3e0['options'][_0xbe0f('0x1a')]||null:null,'limit':_0x4eb3e0[_0xbe0f('0x17')]?_0x4eb3e0[_0xbe0f('0x17')][_0xbe0f('0x1b')]||null:null,'include':_0x4eb3e0['options']?_0x4eb3e0[_0xbe0f('0x17')][_0xbe0f('0x1c')]?_[_0xbe0f('0x1d')](_0x4eb3e0[_0xbe0f('0x17')][_0xbe0f('0x1c')],function(_0x5afc63){return{'model':db[_0x5afc63[_0xbe0f('0x1e')]],'as':_0x5afc63['as'],'attributes':_0x5afc63['attributes'],'include':_0x5afc63['include']?_[_0xbe0f('0x1d')](_0x5afc63[_0xbe0f('0x1c')],function(_0x564f0e){return{'model':db[_0x564f0e[_0xbe0f('0x1e')]],'as':_0x564f0e['as'],'attributes':_0x564f0e[_0xbe0f('0x1a')],'include':_0x564f0e[_0xbe0f('0x1c')]?_[_0xbe0f('0x1d')](_0x564f0e[_0xbe0f('0x1c')],function(_0x34ce24){return{'model':db[_0x34ce24[_0xbe0f('0x1e')]],'as':_0x34ce24['as'],'attributes':_0x34ce24[_0xbe0f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbe0f('0xb')](function(_0x37737e){logger[_0xbe0f('0x13')](_0xbe0f('0x16'),_0x4eb3e0);logger[_0xbe0f('0xd')](_0xbe0f('0x16'),_0x4eb3e0,JSON[_0xbe0f('0xe')](_0x37737e));_0x30e355(_0x37737e);})[_0xbe0f('0x15')](function(_0x3d04f6){logger[_0xbe0f('0xf')](_0xbe0f('0x16'),_0x3d04f6[_0xbe0f('0x12')],_0x4eb3e0);_0x442594(_0x20945f[_0xbe0f('0xf')](0x1f4,_0x3d04f6[_0xbe0f('0x12')]));});});};exports['ShowTrunk']=function(_0xbcfdfc){var _0x3feafa=this;return new Promise(function(_0x1997a9,_0x3e65b4){return db[_0xbe0f('0x1f')][_0xbe0f('0x20')]({'raw':_0xbcfdfc[_0xbe0f('0x17')]?_0xbcfdfc['options'][_0xbe0f('0x18')]===undefined?!![]:![]:!![],'where':_0xbcfdfc[_0xbe0f('0x17')]?_0xbcfdfc['options']['where']||null:null,'attributes':_0xbcfdfc[_0xbe0f('0x17')]?_0xbcfdfc[_0xbe0f('0x17')][_0xbe0f('0x1a')]||null:null,'include':_0xbcfdfc['options']?_0xbcfdfc['options'][_0xbe0f('0x1c')]?_[_0xbe0f('0x1d')](_0xbcfdfc[_0xbe0f('0x17')][_0xbe0f('0x1c')],function(_0x160ae2){return{'model':db[_0x160ae2['model']],'as':_0x160ae2['as'],'attributes':_0x160ae2[_0xbe0f('0x1a')],'include':_0x160ae2['include']?_[_0xbe0f('0x1d')](_0x160ae2[_0xbe0f('0x1c')],function(_0x40bb9f){return{'model':db[_0x40bb9f[_0xbe0f('0x1e')]],'as':_0x40bb9f['as'],'attributes':_0x40bb9f[_0xbe0f('0x1a')],'include':_0x40bb9f['include']?_['map'](_0x40bb9f['include'],function(_0x2d3be4){return{'model':db[_0x2d3be4[_0xbe0f('0x1e')]],'as':_0x2d3be4['as'],'attributes':_0x2d3be4['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe0f('0xb')](function(_0x2dfc12){logger[_0xbe0f('0x13')](_0xbe0f('0x21'),_0xbcfdfc);logger['debug']('ShowTrunk',_0xbcfdfc,JSON[_0xbe0f('0xe')](_0x2dfc12));_0x1997a9(_0x2dfc12);})[_0xbe0f('0x15')](function(_0x2d1d94){logger[_0xbe0f('0xf')](_0xbe0f('0x21'),_0x2d1d94['message'],_0xbcfdfc);_0x3e65b4(_0x3feafa[_0xbe0f('0xf')](0x1f4,_0x2d1d94['message']));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index c65b590..2f55df9 100644 --- a/server/api/user-setting/index.js +++ b/server/api/user-setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xefab=['update','exports','express','Router','put','isAuthenticated'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0xefab,0x68));var _0xbefa=function(_0x10156d,_0x5a451a){_0x10156d=_0x10156d-0x0;var _0x4ba0c6=_0xefab[_0x10156d];return _0x4ba0c6;};'use strict';var express=require(_0xbefa('0x0'));var router=express[_0xbefa('0x1')]();var auth=require('../../components/auth/service');var controller=require('./user-setting.controller');router[_0xbefa('0x2')]('/:id',auth[_0xbefa('0x3')](),controller[_0xbefa('0x4')]);module[_0xbefa('0x5')]=router; \ No newline at end of file +var _0x7df8=['isAuthenticated','update','express','Router','./user-setting.controller','put'];(function(_0x5df049,_0x260c2a){var _0x4886e2=function(_0x346d66){while(--_0x346d66){_0x5df049['push'](_0x5df049['shift']());}};_0x4886e2(++_0x260c2a);}(_0x7df8,0xf2));var _0x87df=function(_0x556a47,_0x3119a0){_0x556a47=_0x556a47-0x0;var _0x58c91c=_0x7df8[_0x556a47];return _0x58c91c;};'use strict';var express=require(_0x87df('0x0'));var router=express[_0x87df('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x87df('0x2'));router[_0x87df('0x3')]('/:id',auth[_0x87df('0x4')](),controller[_0x87df('0x5')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index 7163f44..8577941 100644 --- a/server/api/user-setting/user-setting.attributes.js +++ b/server/api/user-setting/user-setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xffad=['sequelize','error','info','debug','exports','ENUM','BOOLEAN','DATE','INTEGER'];(function(_0x19c7ab,_0xddef10){var _0x4bf4c1=function(_0x454f54){while(--_0x454f54){_0x19c7ab['push'](_0x19c7ab['shift']());}};_0x4bf4c1(++_0xddef10);}(_0xffad,0x156));var _0xdffa=function(_0x1ed80f,_0x2582b5){_0x1ed80f=_0x1ed80f-0x0;var _0x5f4e50=_0xffad[_0x1ed80f];return _0x5f4e50;};'use strict';var Sequelize=require(_0xdffa('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xdffa('0x1'),'warning',_0xdffa('0x2'),_0xdffa('0x3')];module[_0xdffa('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0xdffa('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xdffa('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xdffa('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xdffa('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xdffa('0x8')],'unique':'UserId'}}; \ No newline at end of file +var _0x9e34=['DATE','INTEGER','UserId','error','warning','info','debug','BOOLEAN','TEXT'];(function(_0x59347a,_0x1dd138){var _0x487c22=function(_0x3a6fc7){while(--_0x3a6fc7){_0x59347a['push'](_0x59347a['shift']());}};_0x487c22(++_0x1dd138);}(_0x9e34,0x198));var _0x49e3=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x9e34[_0x500419];return _0x241c1a;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0x49e3('0x0'),_0x49e3('0x1'),_0x49e3('0x2'),_0x49e3('0x3')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x49e3('0x0'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x49e3('0x4')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x49e3('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x49e3('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x49e3('0x7')],'unique':_0x49e3('0x8')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index 091210f..0efa9fa 100644 --- a/server/api/user-setting/user-setting.controller.js +++ b/server/api/user-setting/user-setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe13e=['defaults','status','update','then','sendStatus','name','send','user','role','Unauthorized','params','Invalid\x20user\x20setting\x20id','find','body','catch','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','register'];(function(_0xefc533,_0x3d7f4b){var _0xfdd018=function(_0x305a1b){while(--_0x305a1b){_0xefc533['push'](_0xefc533['shift']());}};_0xfdd018(++_0x3d7f4b);}(_0xe13e,0xde));var _0xee13=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe13e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var Redis=require('ioredis');var logger=require(_0xee13('0x0'))(_0xee13('0x1'));var config=require(_0xee13('0x2'));var db=require(_0xee13('0x3'))['db'];var socket=require(_0xee13('0x4'))(new Redis(config[_0xee13('0x5')]));require(_0xee13('0x6'))[_0xee13('0x7')](socket);config[_0xee13('0x5')]=_[_0xee13('0x8')](config[_0xee13('0x5')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x8f606d,_0x3ae6e2){_0x3ae6e2=_0x3ae6e2||0xc8;return function(_0xfdb836){if(_0xfdb836){return _0x8f606d[_0xee13('0x9')](_0x3ae6e2)['json'](_0xfdb836);}};}function saveUpdates(_0xf90a9a){return function(_0x29f96f){if(_0x29f96f){return _0x29f96f[_0xee13('0xa')](_0xf90a9a)[_0xee13('0xb')](function(_0x2a7207){return _0x2a7207;});}return null;};}function handleEntityNotFound(_0x4ac50b){return function(_0x2a378b){if(!_0x2a378b){_0x4ac50b[_0xee13('0xc')](0x194);}return _0x2a378b;};}function handleError(_0x508f3f,_0x3f1404){_0x3f1404=_0x3f1404||0x1f4;return function(_0x5ea66f){logger['error'](_0x5ea66f['stack']);if(_0x5ea66f[_0xee13('0xd')]){delete _0x5ea66f['name'];}_0x508f3f[_0xee13('0x9')](_0x3f1404)[_0xee13('0xe')](_0x5ea66f);};}exports[_0xee13('0xa')]=function(_0x364961,_0x1ac90c){if(_0x364961[_0xee13('0xf')][_0xee13('0x10')]!=='admin')throw new Error(_0xee13('0x11'));if(isNaN(Number(_0x364961[_0xee13('0x12')]['id'])))throw new Error(_0xee13('0x13'));return db['UserSetting'][_0xee13('0x14')]({'where':{'id':_0x364961[_0xee13('0x12')]['id']}})['then'](handleEntityNotFound(_0x1ac90c,null))[_0xee13('0xb')](saveUpdates(_0x364961[_0xee13('0x15')],null))[_0xee13('0xb')](respondWithResult(_0x1ac90c,null))[_0xee13('0x16')](handleError(_0x1ac90c,null));}; \ No newline at end of file +var _0xadec=['admin','params','Invalid\x20user\x20setting\x20id','find','body','catch','lodash','ioredis','../../config/logger','api','../../config/environment','./user-setting.socket','register','redis','status','update','then','sendStatus','error','stack','name','send','user','role'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xadec,0x156));var _0xcade=function(_0x468f9e,_0x1654c4){_0x468f9e=_0x468f9e-0x0;var _0x69a41=_0xadec[_0x468f9e];return _0x69a41;};'use strict';var _=require(_0xcade('0x0'));var Redis=require(_0xcade('0x1'));var logger=require(_0xcade('0x2'))(_0xcade('0x3'));var config=require(_0xcade('0x4'));var db=require('../../mysqldb')['db'];var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcade('0x5'))[_0xcade('0x6')](socket);config[_0xcade('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});function respondWithResult(_0x51d665,_0x1fe48f){_0x1fe48f=_0x1fe48f||0xc8;return function(_0x4c36e8){if(_0x4c36e8){return _0x51d665[_0xcade('0x8')](_0x1fe48f)['json'](_0x4c36e8);}};}function saveUpdates(_0x4d3f87){return function(_0x3a12db){if(_0x3a12db){return _0x3a12db[_0xcade('0x9')](_0x4d3f87)[_0xcade('0xa')](function(_0x581f6a){return _0x581f6a;});}return null;};}function handleEntityNotFound(_0x1d7e8a){return function(_0x8b52cb){if(!_0x8b52cb){_0x1d7e8a[_0xcade('0xb')](0x194);}return _0x8b52cb;};}function handleError(_0x148930,_0x15f6f8){_0x15f6f8=_0x15f6f8||0x1f4;return function(_0x2ad733){logger[_0xcade('0xc')](_0x2ad733[_0xcade('0xd')]);if(_0x2ad733[_0xcade('0xe')]){delete _0x2ad733[_0xcade('0xe')];}_0x148930[_0xcade('0x8')](_0x15f6f8)[_0xcade('0xf')](_0x2ad733);};}exports[_0xcade('0x9')]=function(_0x40c5c7,_0x5a1af6){if(_0x40c5c7[_0xcade('0x10')][_0xcade('0x11')]!==_0xcade('0x12'))throw new Error('Unauthorized');if(isNaN(Number(_0x40c5c7[_0xcade('0x13')]['id'])))throw new Error(_0xcade('0x14'));return db['UserSetting'][_0xcade('0x15')]({'where':{'id':_0x40c5c7[_0xcade('0x13')]['id']}})[_0xcade('0xa')](handleEntityNotFound(_0x5a1af6,null))['then'](saveUpdates(_0x40c5c7[_0xcade('0x16')],null))[_0xcade('0xa')](respondWithResult(_0x5a1af6,null))[_0xcade('0x17')](handleError(_0x5a1af6,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index 3de953d..c4b99d1 100644 --- a/server/api/user-setting/user-setting.events.js +++ b/server/api/user-setting/user-setting.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2fe0=['save','update','remove','emit','hasOwnProperty','hook','../../mysqldb','UserSetting','setMaxListeners'];(function(_0xacdb50,_0x26811f){var _0x2bd602=function(_0x475752){while(--_0x475752){_0xacdb50['push'](_0xacdb50['shift']());}};_0x2bd602(++_0x26811f);}(_0x2fe0,0x9f));var _0x02fe=function(_0x171a90,_0x3848b8){_0x171a90=_0x171a90-0x0;var _0x2681c0=_0x2fe0[_0x171a90];return _0x2681c0;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x02fe('0x0'))['db'][_0x02fe('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x02fe('0x2')](0x0);var events={'afterCreate':_0x02fe('0x3'),'afterUpdate':_0x02fe('0x4'),'afterDestroy':_0x02fe('0x5')};function emitEvent(_0x45a115){return function(_0x114c26,_0xdef879,_0x52c237){UserSettingEvents[_0x02fe('0x6')](_0x45a115+':'+_0x114c26['id'],_0x114c26);UserSettingEvents[_0x02fe('0x6')](_0x45a115,_0x114c26);_0x52c237(null);};}for(var e in events){if(events[_0x02fe('0x7')](e)){var event=events[e];UserSetting[_0x02fe('0x8')](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file +var _0xb064=['exports','events','../../mysqldb','setMaxListeners','update','remove','emit'];(function(_0x481939,_0x417eee){var _0x508f1e=function(_0x51d3c3){while(--_0x51d3c3){_0x481939['push'](_0x481939['shift']());}};_0x508f1e(++_0x417eee);}(_0xb064,0x19e));var _0x4b06=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xb064[_0x28947d];return _0x12d2ee;};'use strict';var EventEmitter=require(_0x4b06('0x0'));var UserSetting=require(_0x4b06('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x4b06('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4b06('0x3'),'afterDestroy':_0x4b06('0x4')};function emitEvent(_0x4c83f3){return function(_0x2766f5,_0x47f9e1,_0x28f6e8){UserSettingEvents[_0x4b06('0x5')](_0x4c83f3+':'+_0x2766f5['id'],_0x2766f5);UserSettingEvents[_0x4b06('0x5')](_0x4c83f3,_0x2766f5);_0x28f6e8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0x4b06('0x6')]=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index a775aef..6bfee5a 100644 --- a/server/api/user-setting/user-setting.model.js +++ b/server/api/user-setting/user-setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa25c=['clientSideLoggingEnabledSince','exports','define','UserSetting','user_settings','clientSideLoggingEnabled'];(function(_0xf49ae5,_0x441624){var _0x4732f2=function(_0x3c0285){while(--_0x3c0285){_0xf49ae5['push'](_0xf49ae5['shift']());}};_0x4732f2(++_0x441624);}(_0xa25c,0x13f));var _0xca25=function(_0x3dd996,_0x3c677a){_0x3dd996=_0x3dd996-0x0;var _0x265129=_0xa25c[_0x3dd996];return _0x265129;};'use strict';var attributes=require('./user-setting.attributes');module[_0xca25('0x0')]=function(_0x3c0ed9){return _0x3c0ed9[_0xca25('0x1')](_0xca25('0x2'),attributes,{'tableName':_0xca25('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xc361f1){if(!_0xc361f1[_0xca25('0x4')])_0xc361f1[_0xca25('0x5')]=null;else if(_0xc361f1['clientSideLoggingEnabledSince']===null)_0xc361f1[_0xca25('0x5')]=new Date();}}});}; \ No newline at end of file +var _0xcffe=['UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports','define'];(function(_0x5898d1,_0x44768d){var _0x57fd7f=function(_0x1d9b2b){while(--_0x1d9b2b){_0x5898d1['push'](_0x5898d1['shift']());}};_0x57fd7f(++_0x44768d);}(_0xcffe,0x1a1));var _0xecff=function(_0x50667a,_0x86eb28){_0x50667a=_0x50667a-0x0;var _0x4987e5=_0xcffe[_0x50667a];return _0x4987e5;};'use strict';var attributes=require(_0xecff('0x0'));module[_0xecff('0x1')]=function(_0x1946a1){return _0x1946a1[_0xecff('0x2')](_0xecff('0x3'),attributes,{'tableName':_0xecff('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xfe1d81){if(!_0xfe1d81[_0xecff('0x5')])_0xfe1d81[_0xecff('0x6')]=null;else if(_0xfe1d81[_0xecff('0x6')]===null)_0xfe1d81['clientSideLoggingEnabledSince']=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index 91b04a5..4419eda 100644 --- a/server/api/user-setting/user-setting.socket.js +++ b/server/api/user-setting/user-setting.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b6d=['user-setting:update','user-setting:update:user-','UserId','register','length','user-setting:','./user-setting.events','save','update','emit'];(function(_0x1c7502,_0x5d2c70){var _0x2165fa=function(_0x5a64a2){while(--_0x5a64a2){_0x1c7502['push'](_0x1c7502['shift']());}};_0x2165fa(++_0x5d2c70);}(_0x2b6d,0x178));var _0xd2b6=function(_0x2b7340,_0x5dc485){_0x2b7340=_0x2b7340-0x0;var _0x37aa62=_0x2b6d[_0x2b7340];return _0x37aa62;};'use strict';var UserSettingEvents=require(_0xd2b6('0x0'));var events=[_0xd2b6('0x1'),'remove',_0xd2b6('0x2')];function createListener(_0x48be4f,_0x267965){return function(_0x413034){_0x267965[_0xd2b6('0x3')](_0x48be4f,_0x413034);if(_0x48be4f===_0xd2b6('0x4')){_0x267965[_0xd2b6('0x3')](_0xd2b6('0x5')+_0x413034[_0xd2b6('0x6')],_0x413034);}};}exports[_0xd2b6('0x7')]=function(_0xf072db){for(var _0x4aa202=0x0,_0x2a2ecc=events[_0xd2b6('0x8')];_0x4aa202<_0x2a2ecc;_0x4aa202++){var _0xb85321=events[_0x4aa202];var _0x2313b0=createListener(_0xd2b6('0x9')+_0xb85321,_0xf072db);UserSettingEvents['on'](_0xb85321,_0x2313b0);}}; \ No newline at end of file +var _0x28df=['save','remove','update','emit','user-setting:update','user-setting:update:user-','register','length','./user-setting.events'];(function(_0x506ecf,_0x119a67){var _0x264298=function(_0x10db67){while(--_0x10db67){_0x506ecf['push'](_0x506ecf['shift']());}};_0x264298(++_0x119a67);}(_0x28df,0x1ee));var _0xf28d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x28df[_0x20a584];return _0x4b41a8;};'use strict';var UserSettingEvents=require(_0xf28d('0x0'));var events=[_0xf28d('0x1'),_0xf28d('0x2'),_0xf28d('0x3')];function createListener(_0x5e2d34,_0x2ea55e){return function(_0x560faf){_0x2ea55e[_0xf28d('0x4')](_0x5e2d34,_0x560faf);if(_0x5e2d34===_0xf28d('0x5')){_0x2ea55e['emit'](_0xf28d('0x6')+_0x560faf['UserId'],_0x560faf);}};}exports[_0xf28d('0x7')]=function(_0x190033){for(var _0x22de29=0x0,_0x9bb1e0=events[_0xf28d('0x8')];_0x22de29<_0x9bb1e0;_0x22de29++){var _0x4ef1ac=events[_0x22de29];var _0x5312d2=createListener('user-setting:'+_0x4ef1ac,_0x190033);UserSettingEvents['on'](_0x4ef1ac,_0x5312d2);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index bc39f38..75df7f5 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 _0x8093=['/:id/lists','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','/:id/contacts','addContacts','post','create','/create_many','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','/:id/login','login','pause','/:id/unpause','/:id/teams','addTeams','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','/:id/whatsapp_accounts','createApiKey','put','/:id/password','changePassword','delete','removeTeams','/:id','destroy','removeMailInteractions','removeSmsInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeApiKey','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','whoami','/presence','/:id/avatar','getAvatar','getOpenTabs','/:id/queues','getVoiceQueuesRt','/:id/groups','getGroups','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/whatsapp/interactions','getTeams'];(function(_0x1c571c,_0x11b68f){var _0x3b060f=function(_0x528e39){while(--_0x528e39){_0x1c571c['push'](_0x1c571c['shift']());}};_0x3b060f(++_0x11b68f);}(_0x8093,0xa9));var _0x3809=function(_0x41bee3,_0x2315fb){_0x41bee3=_0x41bee3-0x0;var _0x2596ac=_0x8093[_0x41bee3];return _0x2596ac;};'use strict';var multer=require(_0x3809('0x0'));var util=require(_0x3809('0x1'));var path=require(_0x3809('0x2'));var timeout=require(_0x3809('0x3'));var express=require(_0x3809('0x4'));var router=express[_0x3809('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3809('0x6'));var interaction=require(_0x3809('0x7'));var config=require(_0x3809('0x8'));var controller=require(_0x3809('0x9'));router[_0x3809('0xa')]('/',auth[_0x3809('0xb')](),controller[_0x3809('0xc')]);router[_0x3809('0xa')](_0x3809('0xd'),auth[_0x3809('0xb')](),controller[_0x3809('0xe')]);router[_0x3809('0xa')]('/whoami',auth[_0x3809('0xb')](),controller[_0x3809('0xf')]);router[_0x3809('0xa')](_0x3809('0x10'),auth['isAuthenticated'](),controller['getPresence']);router[_0x3809('0xa')]('/:id',auth[_0x3809('0xb')](),controller['show']);router['get'](_0x3809('0x11'),controller[_0x3809('0x12')]);router[_0x3809('0xa')]('/:id/open_tabs',auth[_0x3809('0xb')](),controller[_0x3809('0x13')]);router[_0x3809('0xa')]('/:id/contacts',auth['isAuthenticated'](),controller['getContacts']);router[_0x3809('0xa')](_0x3809('0x14'),auth[_0x3809('0xb')](),controller['getQueues']);router[_0x3809('0xa')]('/:id/queues_rt',auth[_0x3809('0xb')](),controller[_0x3809('0x15')]);router[_0x3809('0xa')](_0x3809('0x16'),auth[_0x3809('0xb')](),controller[_0x3809('0x17')]);router['get']('/:id/recordings',auth['isAuthenticated'](),controller['getRecordings']);router['get']('/:id/screen_recordings',auth['isAuthenticated'](),controller[_0x3809('0x18')]);router['get'](_0x3809('0x19'),auth['isAuthenticated'](),controller[_0x3809('0x1a')]);router[_0x3809('0xa')](_0x3809('0x1b'),auth[_0x3809('0xb')](),controller[_0x3809('0x1c')]);router['get'](_0x3809('0x1d'),auth[_0x3809('0xb')](),controller[_0x3809('0x1e')]);router[_0x3809('0xa')](_0x3809('0x1f'),auth[_0x3809('0xb')](),controller[_0x3809('0x20')]);router[_0x3809('0xa')]('/:id/fax/interactions',auth['isAuthenticated'](),controller['getFaxInteractions']);router[_0x3809('0xa')](_0x3809('0x21'),auth[_0x3809('0xb')](),controller['getWhatsappInteractions']);router[_0x3809('0xa')]('/:id/teams',auth[_0x3809('0xb')](),controller[_0x3809('0x22')]);router[_0x3809('0xa')](_0x3809('0x23'),auth[_0x3809('0xb')](),controller['getLists']);router['get'](_0x3809('0x24'),auth['isAuthenticated'](),controller[_0x3809('0x25')]);router['get']('/:id/prefixes',auth[_0x3809('0xb')](),controller[_0x3809('0x26')]);router[_0x3809('0xa')](_0x3809('0x27'),auth[_0x3809('0xb')](),controller[_0x3809('0x28')]);router['get'](_0x3809('0x29'),auth['isAuthenticated'](),controller[_0x3809('0x2a')]);router[_0x3809('0xa')](_0x3809('0x2b'),auth['isAuthenticated'](),controller[_0x3809('0x2c')]);router[_0x3809('0xa')](_0x3809('0x2d'),auth[_0x3809('0xb')](),controller[_0x3809('0x2e')]);router[_0x3809('0xa')]('/:id/chat_websites',auth[_0x3809('0xb')](),controller[_0x3809('0x2f')]);router['get']('/:id/whatsapp_accounts',auth[_0x3809('0xb')](),controller['getWhatsappAccounts']);router[_0x3809('0xa')](_0x3809('0x30'),auth['isAuthenticated'](),controller[_0x3809('0x31')]);router['get'](_0x3809('0x32'),auth['isAuthenticated'](),controller['getApiKey']);router['post'](_0x3809('0x33'),auth['isAuthenticated'](),controller[_0x3809('0x34')]);router[_0x3809('0x35')]('/',auth[_0x3809('0xb')](),controller[_0x3809('0x36')]);router['post'](_0x3809('0x37'),auth['isAuthenticated'](),controller['bulkCreate']);router[_0x3809('0x35')]('/:id/queues',auth[_0x3809('0xb')](),controller['addQueues']);var upload=multer({'storage':multer[_0x3809('0x38')]({'destination':function(_0x3b4aa8,_0x4d4eb6,_0x5b220e){_0x5b220e(null,path[_0x3809('0x39')](config[_0x3809('0x3a')],_0x3809('0x3b')));},'filename':function(_0x30114c,_0x464cc6,_0x2ea83e){_0x2ea83e(null,util[_0x3809('0x3c')](_0x3809('0x3d'),Date[_0x3809('0x3e')](),_0x464cc6[_0x3809('0x3f')]));}})});router[_0x3809('0x35')](_0x3809('0x11'),upload[_0x3809('0x40')](_0x3809('0x41')),controller['addAvatar']);router[_0x3809('0x35')](_0x3809('0x42'),auth[_0x3809('0xb')](),controller[_0x3809('0x43')]);router[_0x3809('0x35')]('/:id/logout',auth['isAuthenticated'](),controller['logout']);router['post']('/:id/pause',auth['isAuthenticated'](),controller[_0x3809('0x44')]);router['post'](_0x3809('0x45'),auth[_0x3809('0xb')](),controller['unpause']);router['post'](_0x3809('0x46'),auth[_0x3809('0xb')](),controller[_0x3809('0x47')]);router['post'](_0x3809('0x48'),auth['isAuthenticated'](),controller['addChatInteractions']);router[_0x3809('0x35')](_0x3809('0x49'),auth[_0x3809('0xb')](),controller[_0x3809('0x4a')]);router[_0x3809('0x35')]('/:id/fax_interactions',auth[_0x3809('0xb')](),controller[_0x3809('0x4b')]);router[_0x3809('0x35')](_0x3809('0x4c'),auth[_0x3809('0xb')](),controller['addSmsInteractions']);router[_0x3809('0x35')](_0x3809('0x4d'),auth[_0x3809('0xb')](),controller['addOpenchannelInteractions']);router[_0x3809('0x35')]('/:id/whatsapp_interactions',auth[_0x3809('0xb')](),controller[_0x3809('0x4e')]);router[_0x3809('0x35')](_0x3809('0x27'),auth[_0x3809('0xb')](),controller[_0x3809('0x4f')]);router['post'](_0x3809('0x29'),auth[_0x3809('0xb')](),controller[_0x3809('0x50')]);router['post'](_0x3809('0x2b'),auth['isAuthenticated'](),controller['addOpenchannelAccounts']);router['post']('/:id/sms_accounts',auth[_0x3809('0xb')](),controller[_0x3809('0x51')]);router['post'](_0x3809('0x52'),auth[_0x3809('0xb')](),controller[_0x3809('0x53')]);router[_0x3809('0x35')](_0x3809('0x54'),auth[_0x3809('0xb')](),controller['addWhatsappAccounts']);router[_0x3809('0x35')](_0x3809('0x32'),auth[_0x3809('0xb')](),controller[_0x3809('0x55')]);router[_0x3809('0x56')]('/:id',auth[_0x3809('0xb')](),controller['update']);router['put'](_0x3809('0x57'),auth['isAuthenticated'](),controller[_0x3809('0x58')]);router[_0x3809('0x59')](_0x3809('0x14'),auth[_0x3809('0xb')](),controller['removeQueues']);router[_0x3809('0x59')](_0x3809('0x46'),auth['isAuthenticated'](),controller[_0x3809('0x5a')]);router[_0x3809('0x59')](_0x3809('0x5b'),auth['isAuthenticated'](),controller[_0x3809('0x5c')]);router['delete'](_0x3809('0x48'),auth[_0x3809('0xb')](),controller['removeChatInteractions']);router[_0x3809('0x59')](_0x3809('0x49'),auth['isAuthenticated'](),controller[_0x3809('0x5d')]);router['delete']('/:id/fax_interactions',auth[_0x3809('0xb')](),controller['removeFaxInteractions']);router[_0x3809('0x59')](_0x3809('0x4c'),auth[_0x3809('0xb')](),controller[_0x3809('0x5e')]);router[_0x3809('0x59')](_0x3809('0x4d'),auth['isAuthenticated'](),controller['removeOpenchannelInteractions']);router[_0x3809('0x59')](_0x3809('0x5f'),auth[_0x3809('0xb')](),controller[_0x3809('0x60')]);router[_0x3809('0x59')](_0x3809('0x27'),auth[_0x3809('0xb')](),controller[_0x3809('0x61')]);router[_0x3809('0x59')](_0x3809('0x29'),auth['isAuthenticated'](),controller[_0x3809('0x62')]);router[_0x3809('0x59')](_0x3809('0x2b'),auth['isAuthenticated'](),controller['removeOpenchannelAccounts']);router[_0x3809('0x59')](_0x3809('0x2d'),auth['isAuthenticated'](),controller[_0x3809('0x63')]);router[_0x3809('0x59')]('/:id/chat_websites',auth[_0x3809('0xb')](),controller[_0x3809('0x64')]);router[_0x3809('0x59')](_0x3809('0x54'),auth[_0x3809('0xb')](),controller['removeWhatsappAccounts']);router[_0x3809('0x59')](_0x3809('0x32'),auth[_0x3809('0xb')](),controller[_0x3809('0x65')]);module['exports']=router; \ No newline at end of file +var _0xb3b8=['bulkCreate','/:id/queues','addQueues','join','root','server/files/images/','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','/:id/pause','pause','/:id/unpause','unpause','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','addMailAccounts','/:id/sms_accounts','addSmsAccounts','/:id/whatsapp_accounts','addWhatsappAccounts','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeSmsAccounts','/:id/chat_websites','removeChatWebsites','exports','util','path','fs-extra','../../components/auth/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/presence','getPresence','show','/:id/avatar','getAvatar','getOpenTabs','getContacts','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/lists','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','getChatWebsites','getWhatsappAccounts','getScheduledCalls','/:id/api_key','getApiKey','post','/:id/contacts','addContacts','create'];(function(_0xc0af3,_0x7f5baf){var _0x1a3f58=function(_0x23782d){while(--_0x23782d){_0xc0af3['push'](_0xc0af3['shift']());}};_0x1a3f58(++_0x7f5baf);}(_0xb3b8,0x108));var _0x8b3b=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xb3b8[_0x2aec52];return _0x3b8835;};'use strict';var multer=require('multer');var util=require(_0x8b3b('0x0'));var path=require(_0x8b3b('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8b3b('0x2'));var auth=require(_0x8b3b('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x8b3b('0x4'));var controller=require(_0x8b3b('0x5'));router[_0x8b3b('0x6')]('/',auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x8')]);router['get'](_0x8b3b('0x9'),auth[_0x8b3b('0x7')](),controller[_0x8b3b('0xa')]);router[_0x8b3b('0x6')]('/whoami',auth[_0x8b3b('0x7')](),controller['whoami']);router[_0x8b3b('0x6')](_0x8b3b('0xb'),auth[_0x8b3b('0x7')](),controller[_0x8b3b('0xc')]);router[_0x8b3b('0x6')]('/:id',auth[_0x8b3b('0x7')](),controller[_0x8b3b('0xd')]);router['get'](_0x8b3b('0xe'),controller[_0x8b3b('0xf')]);router['get']('/:id/open_tabs',auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x10')]);router['get']('/:id/contacts',auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x11')]);router[_0x8b3b('0x6')]('/:id/queues',auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x12')]);router[_0x8b3b('0x6')](_0x8b3b('0x13'),auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x14')]);router[_0x8b3b('0x6')](_0x8b3b('0x15'),auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x16')]);router[_0x8b3b('0x6')](_0x8b3b('0x17'),auth[_0x8b3b('0x7')](),controller['getRecordings']);router[_0x8b3b('0x6')](_0x8b3b('0x18'),auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x19')]);router[_0x8b3b('0x6')](_0x8b3b('0x1a'),auth['isAuthenticated'](),controller[_0x8b3b('0x1b')]);router[_0x8b3b('0x6')]('/:id/openchannel/interactions',auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x1c')]);router['get'](_0x8b3b('0x1d'),auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x1e')]);router[_0x8b3b('0x6')]('/:id/sms/interactions',auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x1f')]);router['get'](_0x8b3b('0x20'),auth['isAuthenticated'](),controller['getFaxInteractions']);router[_0x8b3b('0x6')](_0x8b3b('0x21'),auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x22')]);router['get']('/:id/teams',auth[_0x8b3b('0x7')](),controller['getTeams']);router[_0x8b3b('0x6')](_0x8b3b('0x23'),auth[_0x8b3b('0x7')](),controller['getLists']);router[_0x8b3b('0x6')](_0x8b3b('0x24'),auth[_0x8b3b('0x7')](),controller['getAgents']);router[_0x8b3b('0x6')](_0x8b3b('0x25'),auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x26')]);router[_0x8b3b('0x6')](_0x8b3b('0x27'),auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x28')]);router[_0x8b3b('0x6')](_0x8b3b('0x29'),auth[_0x8b3b('0x7')](),controller['getMailAccounts']);router['get'](_0x8b3b('0x2a'),auth['isAuthenticated'](),controller[_0x8b3b('0x2b')]);router['get']('/:id/sms_accounts',auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x2c')]);router[_0x8b3b('0x6')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x8b3b('0x2d')]);router[_0x8b3b('0x6')]('/:id/whatsapp_accounts',auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x2e')]);router[_0x8b3b('0x6')]('/:id/scheduled_calls',auth['isAuthenticated'](),controller[_0x8b3b('0x2f')]);router[_0x8b3b('0x6')](_0x8b3b('0x30'),auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x31')]);router[_0x8b3b('0x32')](_0x8b3b('0x33'),auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x34')]);router['post']('/',auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x35')]);router[_0x8b3b('0x32')]('/create_many',auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x36')]);router[_0x8b3b('0x32')](_0x8b3b('0x37'),auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x38')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x43d660,_0x18f4b5,_0x5239ee){_0x5239ee(null,path[_0x8b3b('0x39')](config[_0x8b3b('0x3a')],_0x8b3b('0x3b')));},'filename':function(_0x3b7027,_0x33504f,_0x47fbf8){_0x47fbf8(null,util['format'](_0x8b3b('0x3c'),Date[_0x8b3b('0x3d')](),_0x33504f[_0x8b3b('0x3e')]));}})});router[_0x8b3b('0x32')](_0x8b3b('0xe'),upload[_0x8b3b('0x3f')](_0x8b3b('0x40')),controller[_0x8b3b('0x41')]);router['post'](_0x8b3b('0x42'),auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x43')]);router[_0x8b3b('0x32')](_0x8b3b('0x44'),auth[_0x8b3b('0x7')](),controller['logout']);router['post'](_0x8b3b('0x45'),auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x46')]);router[_0x8b3b('0x32')](_0x8b3b('0x47'),auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x48')]);router[_0x8b3b('0x32')]('/:id/teams',auth[_0x8b3b('0x7')](),controller['addTeams']);router[_0x8b3b('0x32')](_0x8b3b('0x49'),auth[_0x8b3b('0x7')](),controller['addChatInteractions']);router[_0x8b3b('0x32')](_0x8b3b('0x4a'),auth['isAuthenticated'](),controller[_0x8b3b('0x4b')]);router['post'](_0x8b3b('0x4c'),auth['isAuthenticated'](),controller[_0x8b3b('0x4d')]);router['post'](_0x8b3b('0x4e'),auth['isAuthenticated'](),controller[_0x8b3b('0x4f')]);router[_0x8b3b('0x32')](_0x8b3b('0x50'),auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x51')]);router[_0x8b3b('0x32')]('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller['addWhatsappInteractions']);router[_0x8b3b('0x32')](_0x8b3b('0x27'),auth['isAuthenticated'](),controller[_0x8b3b('0x52')]);router['post'](_0x8b3b('0x29'),auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x53')]);router[_0x8b3b('0x32')](_0x8b3b('0x2a'),auth[_0x8b3b('0x7')](),controller['addOpenchannelAccounts']);router[_0x8b3b('0x32')](_0x8b3b('0x54'),auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x55')]);router[_0x8b3b('0x32')]('/:id/chat_websites',auth['isAuthenticated'](),controller['addChatWebsites']);router[_0x8b3b('0x32')](_0x8b3b('0x56'),auth['isAuthenticated'](),controller[_0x8b3b('0x57')]);router['post']('/:id/api_key',auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x58')]);router[_0x8b3b('0x59')]('/:id',auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x5a')]);router[_0x8b3b('0x59')](_0x8b3b('0x5b'),auth['isAuthenticated'](),controller[_0x8b3b('0x5c')]);router[_0x8b3b('0x5d')]('/:id/queues',auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x5e')]);router[_0x8b3b('0x5d')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router[_0x8b3b('0x5d')]('/:id',auth['isAuthenticated'](),controller[_0x8b3b('0x5f')]);router['delete']('/:id/chat_interactions',auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x60')]);router['delete']('/:id/mail_interactions',auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x61')]);router[_0x8b3b('0x5d')]('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0x8b3b('0x62')]);router[_0x8b3b('0x5d')](_0x8b3b('0x4e'),auth[_0x8b3b('0x7')](),controller['removeSmsInteractions']);router[_0x8b3b('0x5d')](_0x8b3b('0x50'),auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x63')]);router[_0x8b3b('0x5d')](_0x8b3b('0x64'),auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x65')]);router[_0x8b3b('0x5d')](_0x8b3b('0x27'),auth[_0x8b3b('0x7')](),controller['removeFaxAccounts']);router[_0x8b3b('0x5d')]('/:id/mail_accounts',auth[_0x8b3b('0x7')](),controller['removeMailAccounts']);router[_0x8b3b('0x5d')](_0x8b3b('0x2a'),auth['isAuthenticated'](),controller['removeOpenchannelAccounts']);router['delete'](_0x8b3b('0x54'),auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x66')]);router['delete'](_0x8b3b('0x67'),auth[_0x8b3b('0x7')](),controller[_0x8b3b('0x68')]);router['delete']('/:id/whatsapp_accounts',auth[_0x8b3b('0x7')](),controller['removeWhatsappAccounts']);router[_0x8b3b('0x5d')](_0x8b3b('0x30'),auth[_0x8b3b('0x7')](),controller['removeApiKey']);module[_0x8b3b('0x69')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 2bd1591..7e491f6 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 _0xedd9=['rfc2833','info','shortinfo','inband','auto','yes','update','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uas','certificate','active','passive','actpass','nonat','update,nonat','DATE','showWebBar','get','isArray','wss','encryption','force_avp','icesupport','dtlsverify','rtcp_mux','dtlsenable','dtlssetup','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','format','\x22%s\x22\x20<%s>','internal','email','ENUM','admin','user','agent','telephone','local','accountcode','getDataValue','fullname','BOOLEAN','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'];(function(_0x3de716,_0x5e0fd9){var _0x201cdc=function(_0x4d5ec6){while(--_0x4d5ec6){_0x3de716['push'](_0x3de716['shift']());}};_0x201cdc(++_0x5e0fd9);}(_0xedd9,0xfc));var _0x9edd=function(_0x10fde7,_0x45be17){_0x10fde7=_0x10fde7-0x0;var _0x224407=_0xedd9[_0x10fde7];return _0x224407;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9edd('0x0'));var util=require(_0x9edd('0x1'));var _=require(_0x9edd('0x2'));module[_0x9edd('0x3')]={'name':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'unique':_0x9edd('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x3e6d3a){this[_0x9edd('0x6')]('name',_0x3e6d3a);this[_0x9edd('0x6')](_0x9edd('0x7'),_0x3e6d3a);},'comment':_0x9edd('0x8')},'fullname':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'set':function(_0x5319f7){this[_0x9edd('0x6')]('fullname',_0x5319f7);this[_0x9edd('0x6')](_0x9edd('0x9'),util[_0x9edd('0xa')](_0x9edd('0xb'),_0x5319f7,this['getDataValue'](_0x9edd('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'unique':_0x9edd('0xd'),'validate':{'isEmail':!![]},'set':function(_0x523026){if(_0x523026){this[_0x9edd('0x6')](_0x9edd('0xd'),_0x523026['toLowerCase']());}}},'role':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0xf'),_0x9edd('0x10'),_0x9edd('0x11'),_0x9edd('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':_0x9edd('0x13')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x9edd('0xc'),'set':function(_0x44fc7c){this[_0x9edd('0x6')](_0x9edd('0xc'),_0x44fc7c);this[_0x9edd('0x6')](_0x9edd('0x14'),_0x44fc7c);this[_0x9edd('0x6')](_0x9edd('0x9'),util['format'](_0x9edd('0xb'),this[_0x9edd('0x15')](_0x9edd('0x16')),_0x44fc7c));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x9edd('0x4')]},'mobile':{'type':Sequelize[_0x9edd('0x4')]},'address':{'type':Sequelize[_0x9edd('0x4')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x9edd('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x9edd('0x4')]},'online':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x9edd('0x18')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x9edd('0x19')},'ipaddr':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x9edd('0x18')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x1a'),'user',_0x9edd('0x1b')),'allowNull':!![],'defaultValue':_0x9edd('0x1a')},'context':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':_0x9edd('0x1c')},'callingpres':{'type':Sequelize['ENUM'](_0x9edd('0x1d'),_0x9edd('0x1e'),_0x9edd('0x1f'),_0x9edd('0x20'),_0x9edd('0x21'),_0x9edd('0x22'),_0x9edd('0x23'),_0x9edd('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':_0x9edd('0x25'),'set':function(_0x5af178){this[_0x9edd('0x6')](_0x9edd('0x26'),_0x5af178?_0x5af178[_0x9edd('0x27')](','):null);},'get':function(){return this['getDataValue'](_0x9edd('0x26'))?this[_0x9edd('0x15')](_0x9edd('0x26'))[_0x9edd('0x28')](','):null;},'comment':_0x9edd('0x29')},'dtmfmode':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2a'),_0x9edd('0x2b'),_0x9edd('0x2c'),_0x9edd('0x2d'),_0x9edd('0x2e')),'allowNull':!![],'defaultValue':_0x9edd('0x2a')},'directmedia':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no','nonat',_0x9edd('0x30'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x6de835){this[_0x9edd('0x6')](_0x9edd('0x31'),_0x6de835?_0x6de835[_0x9edd('0x27')](','):null);},'get':function(){return this[_0x9edd('0x15')](_0x9edd('0x31'))?this[_0x9edd('0x15')](_0x9edd('0x31'))[_0x9edd('0x28')](','):null;},'comment':_0x9edd('0x32')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x9edd('0x4')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x9edd('0x4')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x9edd('0x4')]},'disallow':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'defaultValue':_0x9edd('0x33')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9edd('0x34'),'set':function(_0xcbd0ef){this[_0x9edd('0x6')]('allow',_0xcbd0ef?_0xcbd0ef[_0x9edd('0x27')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x9edd('0x15')](_0x9edd('0x35'))?this['getDataValue'](_0x9edd('0x35'))[_0x9edd('0x28')](';'):null;},'comment':_0x9edd('0x36')},'autoframing':{'type':Sequelize[_0x9edd('0xe')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'set':function(_0x5bbdf8){this[_0x9edd('0x6')](_0x9edd('0x37'),_0x5bbdf8?_0x5bbdf8['join'](','):null);},'get':function(){return this[_0x9edd('0x15')]('insecure')?this['getDataValue'](_0x9edd('0x37'))[_0x9edd('0x28')](','):null;},'comment':_0x9edd('0x38')},'trustrpid':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no',_0x9edd('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':_0x9edd('0x3a')},'amaflags':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':_0x9edd('0x2f')},'busylevel':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no',_0x9edd('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x3c'),_0x9edd('0x3d'),_0x9edd('0x3e')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x9edd('0xe')]('uac',_0x9edd('0x3f')),'allowNull':!![],'defaultValue':_0x9edd('0x3f')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':_0x9edd('0x2f')},'keepalive':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no','fingerprint',_0x9edd('0x40')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x41'),_0x9edd('0x42'),_0x9edd('0x43')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x9edd('0xe')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no',_0x9edd('0x44'),_0x9edd('0x30'),_0x9edd('0x45')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x9edd('0x46')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0,'set':function(_0x3e9a3e){this[_0x9edd('0x6')](_0x9edd('0x47'),_0x3e9a3e);var _0x5df1d7=this[_0x9edd('0x48')]({'plain':!![]});switch(_0x3e9a3e){case 0x0:case 0x1:var _0x507cce=_0x5df1d7[_0x9edd('0x26')]?_[_0x9edd('0x49')](_0x5df1d7[_0x9edd('0x26')])?_0x5df1d7['transport'][_0x9edd('0x27')]():_0x5df1d7['transport']:_0x9edd('0x25');if(_0x507cce===_0x9edd('0x4a')){_0x507cce='udp';}this[_0x9edd('0x6')]('transport',_0x507cce);this[_0x9edd('0x6')](_0x9edd('0x4b'),'no');this[_0x9edd('0x6')]('avpf',null);this[_0x9edd('0x6')](_0x9edd('0x4c'),null);this[_0x9edd('0x6')](_0x9edd('0x4d'),null);this[_0x9edd('0x6')]('dtlsenable',null);this['setDataValue'](_0x9edd('0x4e'),null);this[_0x9edd('0x6')]('dtlssetup',null);this['setDataValue']('dtlscertfile',null);this[_0x9edd('0x6')]('dtlsprivatekey',null);this['setDataValue'](_0x9edd('0x4f'),'no');break;case 0x2:this[_0x9edd('0x6')]('transport',_0x9edd('0x4a'));this[_0x9edd('0x6')](_0x9edd('0x4b'),'yes');this[_0x9edd('0x6')]('avpf',_0x9edd('0x2f'));this[_0x9edd('0x6')]('force_avp',_0x9edd('0x2f'));this[_0x9edd('0x6')]('icesupport',_0x9edd('0x2f'));this[_0x9edd('0x6')](_0x9edd('0x50'),_0x9edd('0x2f'));this['setDataValue'](_0x9edd('0x4e'),'no');this['setDataValue'](_0x9edd('0x51'),_0x9edd('0x43'));this[_0x9edd('0x6')]('dtlscertfile',_0x5df1d7[_0x9edd('0x52')]||_0x9edd('0x53'));this[_0x9edd('0x6')](_0x9edd('0x54'),_0x5df1d7[_0x9edd('0x54')]||_0x9edd('0x55'));this[_0x9edd('0x6')]('rtcp_mux','yes');break;default:}}},'permissions':{'type':Sequelize[_0x9edd('0x56')],'set':function(_0x3c7874){this[_0x9edd('0x6')](_0x9edd('0x57'),_0x3c7874?_0x3c7874[_0x9edd('0x27')](','):[]);},'get':function(){return this['getDataValue'](_0x9edd('0x57'))?_[_0x9edd('0x58')](this[_0x9edd('0x15')]('permissions')[_0x9edd('0x28')](','),function(_0x29d70d){return parseInt(_0x29d70d,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x9edd('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x9edd('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x9edd('0xe')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x9edd('0x4')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x9edd('0x59')],'get':function(){return this[_0x9edd('0x15')](_0x9edd('0x5a'))?this['getDataValue']('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![],'set':function(_0x1eabcd){if(typeof _0x1eabcd===_0x9edd('0x5b')){var _0xef1397=_0x1eabcd==='1'?!![]:_0x1eabcd==='0'?![]:_0x1eabcd==='true'?!![]:_0x1eabcd===_0x9edd('0x5c')?![]:![];this[_0x9edd('0x6')](_0x9edd('0x5d'),_0xef1397);}else{this[_0x9edd('0x6')](_0x9edd('0x5d'),_0x1eabcd);}}},'blocked':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![],'set':function(_0x14fa8a){this['setDataValue'](_0x9edd('0x5e'),_0x14fa8a);if(_0x14fa8a===!![]){this[_0x9edd('0x6')]('blockedAt',moment());this[_0x9edd('0x6')](_0x9edd('0x5f'),0x0);}else{this['setDataValue'](_0x9edd('0x60'),null);}}},'blockedAt':{'type':Sequelize[_0x9edd('0x46')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x9edd('0x18')](0x5)[_0x9edd('0x61')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe706=['admin','user','agent','telephone','local','accountcode','BOOLEAN','DATE','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','insecure','\x22\x22\x20<>','always','accept','uac','uas','certificate','active','passive','actpass','update,nonat','showWebBar','get','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','wss','avpf','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','blocked','blockedAt','UNSIGNED','sequelize','moment','util','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','ENUM'];(function(_0x5ba6ad,_0x55e0fd){var _0x951646=function(_0xd8ede2){while(--_0xd8ede2){_0x5ba6ad['push'](_0x5ba6ad['shift']());}};_0x951646(++_0x55e0fd);}(_0xe706,0xa3));var _0x6e70=function(_0x331a31,_0x116709){_0x331a31=_0x331a31-0x0;var _0x521de0=_0xe706[_0x331a31];return _0x521de0;};'use strict';var Sequelize=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));var util=require(_0x6e70('0x2'));var _=require('lodash');module[_0x6e70('0x3')]={'name':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'unique':_0x6e70('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x7dfbc3){this[_0x6e70('0x6')](_0x6e70('0x5'),_0x7dfbc3);this[_0x6e70('0x6')](_0x6e70('0x7'),_0x7dfbc3);},'comment':_0x6e70('0x8')},'fullname':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'set':function(_0x36357b){this[_0x6e70('0x6')](_0x6e70('0x9'),_0x36357b);this[_0x6e70('0x6')](_0x6e70('0xa'),util[_0x6e70('0xb')](_0x6e70('0xc'),_0x36357b,this[_0x6e70('0xd')](_0x6e70('0xe'))));}},'alias':{'type':Sequelize[_0x6e70('0x4')]},'email':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'unique':_0x6e70('0xf'),'validate':{'isEmail':!![]},'set':function(_0x37b3e0){if(_0x37b3e0){this[_0x6e70('0x6')]('email',_0x37b3e0['toLowerCase']());}}},'role':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x11'),_0x6e70('0x12'),_0x6e70('0x13'),_0x6e70('0x14')),'allowNull':![]},'password':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':_0x6e70('0x15')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':'internal','set':function(_0x48bc72){this[_0x6e70('0x6')]('internal',_0x48bc72);this['setDataValue'](_0x6e70('0x16'),_0x48bc72);this[_0x6e70('0x6')]('callerid',util[_0x6e70('0xb')]('\x22%s\x22\x20<%s>',this[_0x6e70('0xd')](_0x6e70('0x9')),_0x48bc72));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x6e70('0x4')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x6e70('0x4')]},'userpic':{'type':Sequelize[_0x6e70('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x6e70('0x18')]},'voicePause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x6e70('0x18')]},'chatCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6e70('0x1a')},'ipaddr':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x6e70('0x19')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x1b'),'user',_0x6e70('0x1c')),'allowNull':!![],'defaultValue':_0x6e70('0x1b')},'context':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'defaultValue':_0x6e70('0x1d')},'callingpres':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x1e'),_0x6e70('0x1f'),_0x6e70('0x20'),_0x6e70('0x21'),_0x6e70('0x22'),'PROHIB_PASSED_SCREEN',_0x6e70('0x23'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6e70('0x24'),'set':function(_0x42b094){this['setDataValue'](_0x6e70('0x25'),_0x42b094?_0x42b094[_0x6e70('0x26')](','):null);},'get':function(){return this['getDataValue'](_0x6e70('0x25'))?this[_0x6e70('0xd')](_0x6e70('0x25'))[_0x6e70('0x27')](','):null;},'comment':_0x6e70('0x28')},'dtmfmode':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x29'),_0x6e70('0x2a'),_0x6e70('0x2b'),_0x6e70('0x2c'),'auto'),'allowNull':!![],'defaultValue':_0x6e70('0x29')},'directmedia':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no',_0x6e70('0x2e'),_0x6e70('0x2f'),_0x6e70('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'defaultValue':_0x6e70('0x31'),'set':function(_0x2a5444){this[_0x6e70('0x6')](_0x6e70('0x32'),_0x2a5444?_0x2a5444['join'](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x6e70('0xd')](_0x6e70('0x32'))[_0x6e70('0x27')](','):null;},'comment':_0x6e70('0x33')},'callgroup':{'type':Sequelize[_0x6e70('0x4')]},'namedcallgroup':{'type':Sequelize[_0x6e70('0x4')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x6e70('0x4')]},'language':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x6e70('0x4')]},'disallow':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'defaultValue':_0x6e70('0x34')},'allow':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'defaultValue':_0x6e70('0x35'),'set':function(_0x16fc7d){this['setDataValue'](_0x6e70('0x36'),_0x16fc7d?_0x16fc7d[_0x6e70('0x26')](';'):_0x6e70('0x35'));},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x36'))?this[_0x6e70('0xd')](_0x6e70('0x36'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'set':function(_0x83847b){this[_0x6e70('0x6')](_0x6e70('0x37'),_0x83847b?_0x83847b['join'](','):null);},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x37'))?this[_0x6e70('0xd')]('insecure')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6e70('0x38')},'amaflags':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x6e70('0x2d')},'busylevel':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x6e70('0x10')]('yes','no',_0x6e70('0x39')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x3a'),'refuse','originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x3b'),_0x6e70('0x3c')),'allowNull':!![],'defaultValue':_0x6e70('0x3c')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no','fingerprint',_0x6e70('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x3e'),_0x6e70('0x3f'),_0x6e70('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no','nonat',_0x6e70('0x2f'),_0x6e70('0x41')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x6e70('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x6e70('0x18')]},'passwordResetAt':{'type':Sequelize[_0x6e70('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x2f9be4){this[_0x6e70('0x6')](_0x6e70('0x42'),_0x2f9be4);var _0x41a861=this[_0x6e70('0x43')]({'plain':!![]});switch(_0x2f9be4){case 0x0:case 0x1:var _0x739946=_0x41a861[_0x6e70('0x25')]?_['isArray'](_0x41a861['transport'])?_0x41a861[_0x6e70('0x25')][_0x6e70('0x26')]():_0x41a861[_0x6e70('0x25')]:_0x6e70('0x24');if(_0x739946==='wss'){_0x739946='udp';}this[_0x6e70('0x6')](_0x6e70('0x25'),_0x739946);this['setDataValue']('encryption','no');this[_0x6e70('0x6')]('avpf',null);this[_0x6e70('0x6')](_0x6e70('0x44'),null);this[_0x6e70('0x6')](_0x6e70('0x45'),null);this[_0x6e70('0x6')](_0x6e70('0x46'),null);this[_0x6e70('0x6')](_0x6e70('0x47'),null);this['setDataValue'](_0x6e70('0x48'),null);this[_0x6e70('0x6')](_0x6e70('0x49'),null);this[_0x6e70('0x6')](_0x6e70('0x4a'),null);this['setDataValue']('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0x6e70('0x25'),_0x6e70('0x4b'));this[_0x6e70('0x6')]('encryption','yes');this[_0x6e70('0x6')](_0x6e70('0x4c'),_0x6e70('0x2d'));this[_0x6e70('0x6')](_0x6e70('0x44'),_0x6e70('0x2d'));this['setDataValue'](_0x6e70('0x45'),_0x6e70('0x2d'));this[_0x6e70('0x6')](_0x6e70('0x46'),'yes');this[_0x6e70('0x6')]('dtlsverify','no');this['setDataValue'](_0x6e70('0x48'),_0x6e70('0x40'));this[_0x6e70('0x6')](_0x6e70('0x49'),_0x41a861[_0x6e70('0x49')]||_0x6e70('0x4d'));this['setDataValue'](_0x6e70('0x4a'),_0x41a861[_0x6e70('0x4a')]||_0x6e70('0x4e'));this[_0x6e70('0x6')](_0x6e70('0x4f'),_0x6e70('0x2d'));break;default:}}},'permissions':{'type':Sequelize[_0x6e70('0x50')],'set':function(_0xd9b4a9){this[_0x6e70('0x6')](_0x6e70('0x51'),_0xd9b4a9?_0xd9b4a9['join'](','):[]);},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x51'))?_[_0x6e70('0x52')](this['getDataValue']('permissions')[_0x6e70('0x27')](','),function(_0x18ecf0){return parseInt(_0x18ecf0,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x6e70('0x53')],'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x54'))?this[_0x6e70('0xd')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x576069){if(typeof _0x576069===_0x6e70('0x55')){var _0x21e4c2=_0x576069==='1'?!![]:_0x576069==='0'?![]:_0x576069===_0x6e70('0x56')?!![]:_0x576069==='false'?![]:![];this['setDataValue']('screenrecording',_0x21e4c2);}else{this[_0x6e70('0x6')]('screenrecording',_0x576069);}}},'blocked':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![],'set':function(_0x34237d){this[_0x6e70('0x6')](_0x6e70('0x57'),_0x34237d);if(_0x34237d===!![]){this[_0x6e70('0x6')](_0x6e70('0x58'),moment());this[_0x6e70('0x6')]('loginAttempts',0x0);}else{this[_0x6e70('0x6')](_0x6e70('0x58'),null);}}},'blockedAt':{'type':Sequelize[_0x6e70('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x6e70('0x19')](0x5)[_0x6e70('0x59')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 0a88ee8..632e59d 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 _0x3c81=['login','phone','mobile','loginInPause','intrf','user:%s','user:forcelogout','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','UserVoiceQueue.penalty','upsert','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGININPAUSE','resolve','logout','pause','QueuePause','PAUSE','DEFAULT\x20PAUSE','unpause','mailPause','faxPause','smsPause','whatsappPause','pauseType','lastPauseAt','getTeams','Team','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','User\x20with\x20id\x20%s\x20not\x20found','transaction','getAssociatedQueues','addAgent','getDataValue','TeamVoicePrefix','Queue:save','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','flattenDeep','removeAgent','UserVoicePrefix','VoicePrefixId','getLists','getAgents','getVoiceQueues','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','CmHopper','$and','$or','$gt','$gte','$lt','$ne','$not','$between','$notBetween','$in','$notIn','$notLike','$iLike','$notILike','$like','$overlap','$contains','$contained','firstName','Contact','dialActive','getApiKey','retrieveApiKey','generateApiKey','nonce','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyNonce','apiKeyIat','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','queues','inbound','flatten','col','toString','desc','asc','substring','uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unavailable','ringing','voiceStatus','slice','charAt','toUpperCase','select','field','ui.','InteractionId','user_has_','_interactions','OpenTabs','moment','util','lodash','jayson/promise','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','APIBadRequestError','../../errors/api','APINotFoundError','handleError','socket.io-emitter','redis','register','defaults','localhost','client','http','request','then','info','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','User,\x20%s,\x20%s','message','result','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','emit','userNotification:recalc:','destroy','get','Users','user','Agents','agent','Telephones','telephone','filter','map','value','includes','role','name','UserProfileResource','stack','send','index','User','rawAttributes','type','key','password','salt','includeAll','include','userSetting','true','attributes','rows','query','openTabs','length','push','chat','dataValues','sms','fax','openchannel','whatsapp','all','catch','show','model','keys','intersection','fields','UserSetting','merge','options','body','find','params','describe','addContacts','ids','omit','securePassword','internal','min_internal','isNil','sequelize','QueryTypes','SELECT','from','voicemail','mailbox','email','permissions','101','102','113','110','104','105','107','100','111','115','create','Unauthorized','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','VoiceMail','UserProfileSection','userProfileId','autoAssociation','bulkCreate','some','isEmpty','compact','changePassword','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues','channel','online','voicePause','interface','isValidChannel','Unknown\x20channel','add','Queues','penalty','spread','capitalize','toLowerCase','voice','VoiceQueue','findAll','format','SIP/%s','UserVoiceQueueRt','removeQueues','isArray','Queue:remove','QueueId','userpic','server/files/images/logos/default_profile.png','download','existsSync','join','root','server/files/images/','mail','ChatOpenTabs','CHAT','FaxOpenTabs','FAX','createdAt','MailOpenTabs','SmsOpenTabs','WhatsappOpenTabs','concat','getContacts','CmContact','filters','order','sort','where','hasOwnProperty','CmList','List','Tag','Tags','color','tag','nolimit','Queue','getVoiceQueuesRt','pick','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction'];(function(_0x48ea0e,_0x402b32){var _0x1fc0d2=function(_0x5227af){while(--_0x5227af){_0x48ea0e['push'](_0x48ea0e['shift']());}};_0x1fc0d2(++_0x402b32);}(_0x3c81,0xa1));var _0x13c8=function(_0x40cae7,_0x410962){_0x40cae7=_0x40cae7-0x0;var _0x19bde9=_0x3c81[_0x40cae7];return _0x19bde9;};'use strict';var moment=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var path=require('path');var fs=require('fs');var _=require(_0x13c8('0x2'));var squel=require('squel');var jayson=require(_0x13c8('0x3'));var Redis=require(_0x13c8('0x4'));var authService=require('../../components/auth/service');var qs=require(_0x13c8('0x5'));var logger=require(_0x13c8('0x6'))(_0x13c8('0x7'));var utils=require(_0x13c8('0x8'));var config=require('../../config/environment');var licenseUtil=require(_0x13c8('0x9'));var APIBadRequestError=require('../../errors/api')[_0x13c8('0xa')];var APINotFoundError=require(_0x13c8('0xb'))[_0x13c8('0xc')];var APIHandleError=require(_0x13c8('0xb'))[_0x13c8('0xd')];var db=require('../../mysqldb')['db'];var socket=require(_0x13c8('0xe'))(new Redis(config[_0x13c8('0xf')]));require('./user.socket')[_0x13c8('0x10')](socket);config[_0x13c8('0xf')]=_[_0x13c8('0x11')](config[_0x13c8('0xf')],{'host':_0x13c8('0x12'),'port':0x18eb});var amiClient=jayson[_0x13c8('0x13')][_0x13c8('0x14')]({'port':0x232a});var values;function respondWithRpcPromise(_0x5de781,_0xdcaae2,_0x260727,_0x235668){return new Promise(function(_0x533695,_0x220ba9){var _0x7d3705=_0x235668||amiClient;return _0x7d3705[_0x13c8('0x15')](_0x5de781,_0x260727)[_0x13c8('0x16')](function(_0x385184){logger[_0x13c8('0x17')]('User,\x20%s,\x20%s',_0xdcaae2,_0x13c8('0x18'));logger[_0x13c8('0x19')](_0x13c8('0x1a'),_0xdcaae2,'request\x20sent',JSON[_0x13c8('0x1b')](_0x385184));if(_0x385184['error']){if(_0x385184[_0x13c8('0x1c')][_0x13c8('0x1d')]===0x1f4){logger[_0x13c8('0x1c')](_0x13c8('0x1e'),_0xdcaae2,_0x385184[_0x13c8('0x1c')][_0x13c8('0x1f')]);return _0x220ba9(_0x385184['error']['message']);}logger[_0x13c8('0x1c')](_0x13c8('0x1e'),_0xdcaae2,_0x385184['error']['message']);return _0x533695(_0x385184['error'][_0x13c8('0x1f')]);}else{logger[_0x13c8('0x17')](_0x13c8('0x1e'),_0xdcaae2,'request\x20sent');_0x533695(_0x385184[_0x13c8('0x20')][_0x13c8('0x1f')]);}})['catch'](function(_0x5655ab){logger[_0x13c8('0x1c')](_0x13c8('0x1e'),_0xdcaae2,_0x5655ab);_0x220ba9(_0x5655ab);});});}function respondWithStatusCode(_0x3172c0,_0x467d1a){_0x467d1a=_0x467d1a||0xcc;return function(_0x55a150){if(_0x55a150){return _0x3172c0[_0x13c8('0x21')](_0x467d1a);}return _0x3172c0[_0x13c8('0x22')](_0x467d1a)[_0x13c8('0x23')]();};}function respondWithResult(_0x4210f9,_0x37e487){_0x37e487=_0x37e487||0xc8;return function(_0x4c78ad){if(_0x4c78ad){return _0x4210f9[_0x13c8('0x22')](_0x37e487)['json'](_0x4c78ad);}};}function respondWithFilteredResult(_0x1c3b1e,_0x464483){return function(_0x58021a){if(_0x58021a){var _0x43f67a=typeof _0x464483[_0x13c8('0x24')]===_0x13c8('0x25')&&typeof _0x464483[_0x13c8('0x26')]==='undefined';var _0x1328d5=_0x58021a[_0x13c8('0x27')];var _0x4a94d1=_0x43f67a?0x0:_0x464483[_0x13c8('0x24')];var _0x438bad=_0x43f67a?_0x58021a[_0x13c8('0x27')]:_0x464483[_0x13c8('0x24')]+_0x464483[_0x13c8('0x26')];var _0x3ca73a;if(_0x438bad>=_0x1328d5){_0x438bad=_0x1328d5;_0x3ca73a=0xc8;}else{_0x3ca73a=0xce;}_0x1c3b1e[_0x13c8('0x22')](_0x3ca73a);return _0x1c3b1e[_0x13c8('0x28')](_0x13c8('0x29'),_0x4a94d1+'-'+_0x438bad+'/'+_0x1328d5)[_0x13c8('0x2a')](_0x58021a);}return null;};}function saveUpdates(_0x1434ab){return function(_0x25f5b9){if(_0x25f5b9){return _0x25f5b9[_0x13c8('0x2b')](_0x1434ab)[_0x13c8('0x16')](function(_0x2e7886){if(_0x2e7886['role']==='agent'){socket[_0x13c8('0x2c')](_0x13c8('0x2d')+_0x2e7886['id'],_0x2e7886);}return _0x2e7886;});}return null;};}function removeEntity(_0x118e2f){return function(_0x5ccc23){if(_0x5ccc23){return _0x5ccc23[_0x13c8('0x2e')]()[_0x13c8('0x16')](function(){var _0x5fd219=_0x5ccc23[_0x13c8('0x2f')]({'plain':!![]});if(_0x5fd219['role']==='admin')return;var _0x64385e=[{'name':_0x13c8('0x30'),'value':_0x13c8('0x31'),'ignore':!![]},{'name':_0x13c8('0x32'),'value':_0x13c8('0x33'),'ignore':![]},{'name':_0x13c8('0x34'),'value':_0x13c8('0x35'),'ignore':![]}];var _0x5e71f0=_(_0x64385e)[_0x13c8('0x36')]('ignore')[_0x13c8('0x37')](_0x13c8('0x38'))[_0x13c8('0x38')]();if(_[_0x13c8('0x39')](_0x5e71f0,_0x5fd219[_0x13c8('0x3a')])){return;}var _0x2b7966=_['find'](_0x64385e,['value',_0x5fd219[_0x13c8('0x3a')]])[_0x13c8('0x3b')];return db[_0x13c8('0x3c')]['destroy']({'where':{'type':_0x2b7966,'resourceId':_0x5fd219['id']}})[_0x13c8('0x16')](function(){return _0x5ccc23;});})[_0x13c8('0x16')](function(){_0x118e2f[_0x13c8('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x224c27){return function(_0x41a72d){if(!_0x41a72d){_0x224c27[_0x13c8('0x21')](0x194);}return _0x41a72d;};}function handleError(_0x88a212,_0x2eac58){_0x2eac58=_0x2eac58||0x1f4;return function(_0x59bb8b){logger[_0x13c8('0x1c')](_0x59bb8b[_0x13c8('0x3d')]);if(_0x59bb8b[_0x13c8('0x3b')]){delete _0x59bb8b[_0x13c8('0x3b')];}_0x88a212[_0x13c8('0x22')](_0x2eac58)[_0x13c8('0x3e')](_0x59bb8b);};}exports[_0x13c8('0x3f')]=function(_0x2aae06,_0xae0bab){var _0x4169d4={},_0x110f9a={'count':0x0,'rows':[]};var _0x3b1ff9=_(db[_0x13c8('0x40')][_0x13c8('0x41')])[_0x13c8('0x37')](function(_0x469aae){return{'name':_0x469aae['fieldName'],'type':_0x469aae[_0x13c8('0x42')][_0x13c8('0x43')]};})['filter'](function(_0xad8404){return!_[_0x13c8('0x39')]([_0x13c8('0x44'),_0x13c8('0x45')],_0xad8404[_0x13c8('0x3b')]);})['value']();_0x4169d4=qs['getOptions'](_0x3b1ff9,_0x2aae06);var _0x4d1884={'where':_0x4169d4['where']};return db[_0x13c8('0x40')]['count'](_0x4d1884)[_0x13c8('0x16')](function(_0x57273e){_0x110f9a[_0x13c8('0x27')]=_0x57273e;if(_0x2aae06['query'][_0x13c8('0x46')]){_0x4169d4[_0x13c8('0x47')]=[{'all':!![]}];}if(_0x2aae06['query'][_0x13c8('0x48')]===_0x13c8('0x49')){_0x4169d4['include']=[{'model':db['UserSetting'],'as':_0x13c8('0x48')}];}if(!_[_0x13c8('0x39')](_0x4169d4[_0x13c8('0x4a')],'id')){_0x4169d4['attributes']['push']('id');}return db[_0x13c8('0x40')]['findAll'](_0x4169d4);})['then'](function(_0x30d08d){_0x110f9a[_0x13c8('0x4b')]=_0x30d08d;if(_0x2aae06[_0x13c8('0x4c')][_0x13c8('0x4d')]===_0x13c8('0x49')){var _0x2d2eb2=[];for(var _0x25e444=0x0;_0x25e444<_0x110f9a[_0x13c8('0x4b')][_0x13c8('0x4e')];_0x25e444++){_0x2d2eb2[_0x13c8('0x4f')](get_open_tabs(_0x13c8('0x50'),_0x110f9a['rows'][_0x25e444][_0x13c8('0x51')]));_0x2d2eb2['push'](get_open_tabs(_0x13c8('0x52'),_0x110f9a[_0x13c8('0x4b')][_0x25e444][_0x13c8('0x51')]));_0x2d2eb2[_0x13c8('0x4f')](get_open_tabs(_0x13c8('0x53'),_0x110f9a['rows'][_0x25e444]['dataValues']));_0x2d2eb2['push'](get_open_tabs('mail',_0x110f9a['rows'][_0x25e444][_0x13c8('0x51')]));_0x2d2eb2[_0x13c8('0x4f')](get_open_tabs(_0x13c8('0x54'),_0x110f9a[_0x13c8('0x4b')][_0x25e444]['dataValues']));_0x2d2eb2['push'](get_open_tabs(_0x13c8('0x55'),_0x110f9a[_0x13c8('0x4b')][_0x25e444]['dataValues']));}return Promise[_0x13c8('0x56')](_0x2d2eb2)[_0x13c8('0x16')](function(){return _0x110f9a;});}else{return _0x110f9a;}})[_0x13c8('0x16')](respondWithFilteredResult(_0xae0bab,_0x4169d4))[_0x13c8('0x57')](handleError(_0xae0bab,null));};exports[_0x13c8('0x58')]=function(_0x3ccb03,_0x2228a0){var _0x1d6939={'raw':![],'where':{'id':_0x3ccb03['params']['id']}},_0x1a7a74={};_0x1a7a74[_0x13c8('0x59')]=_['differenceBy'](_[_0x13c8('0x5a')](db['User']['rawAttributes']),[_0x13c8('0x44'),_0x13c8('0x45')]);_0x1a7a74[_0x13c8('0x4c')]=_[_0x13c8('0x5a')](_0x3ccb03['query']);_0x1a7a74['filters']=_[_0x13c8('0x5b')](_0x1a7a74[_0x13c8('0x59')],_0x1a7a74[_0x13c8('0x4c')]);_0x1d6939[_0x13c8('0x4a')]=_[_0x13c8('0x5b')](_0x1a7a74[_0x13c8('0x59')],qs['fields'](_0x3ccb03[_0x13c8('0x4c')][_0x13c8('0x5c')]));_0x1d6939[_0x13c8('0x4a')]=_0x1d6939[_0x13c8('0x4a')]['length']?_0x1d6939[_0x13c8('0x4a')]:_0x1a7a74['model'];if(_0x3ccb03[_0x13c8('0x4c')][_0x13c8('0x46')]){_0x1d6939['include']=[{'all':!![]}];}if(_0x3ccb03[_0x13c8('0x4c')][_0x13c8('0x48')]===_0x13c8('0x49')){_0x1d6939['include']=[{'model':db[_0x13c8('0x5d')],'as':'userSetting'}];}_0x1d6939=_[_0x13c8('0x5e')]({},_0x1d6939,_0x3ccb03[_0x13c8('0x5f')]);if(!_[_0x13c8('0x39')](_0x1d6939['attributes'],'id')){_0x1d6939[_0x13c8('0x4a')][_0x13c8('0x4f')]('id');}return db[_0x13c8('0x40')]['find'](_0x1d6939)[_0x13c8('0x16')](handleEntityNotFound(_0x2228a0,null))[_0x13c8('0x16')](function(_0x1564b8){var _0xf15fa1=[];values=_0x1564b8;if(_0x3ccb03[_0x13c8('0x4c')][_0x13c8('0x4d')]===_0x13c8('0x49')){_0xf15fa1['push'](get_open_tabs(_0x13c8('0x50'),_0x1564b8[_0x13c8('0x51')]));_0xf15fa1['push'](get_open_tabs(_0x13c8('0x52'),_0x1564b8[_0x13c8('0x51')]));_0xf15fa1[_0x13c8('0x4f')](get_open_tabs(_0x13c8('0x54'),_0x1564b8[_0x13c8('0x51')]));_0xf15fa1[_0x13c8('0x4f')](get_open_tabs('whatsapp',_0x1564b8[_0x13c8('0x51')]));_0xf15fa1[_0x13c8('0x4f')](get_open_tabs('fax',_0x1564b8[_0x13c8('0x51')]));_0xf15fa1[_0x13c8('0x4f')](get_open_tabs('mail',_0x1564b8[_0x13c8('0x51')]));return Promise['all'](_0xf15fa1);}else{return values;}})[_0x13c8('0x16')](function(){return values;})[_0x13c8('0x16')](respondWithResult(_0x2228a0,null))['catch'](handleError(_0x2228a0,null));};exports['update']=function(_0x38fc7a,_0x245332){if(_0x38fc7a['body']['id']){delete _0x38fc7a[_0x13c8('0x60')]['id'];}delete _0x38fc7a[_0x13c8('0x60')]['role'];return db[_0x13c8('0x40')][_0x13c8('0x61')]({'where':{'id':_0x38fc7a[_0x13c8('0x62')]['id']}})['then'](handleEntityNotFound(_0x245332,null))[_0x13c8('0x16')](saveUpdates(_0x38fc7a[_0x13c8('0x60')],null))[_0x13c8('0x16')](respondWithResult(_0x245332,null))['catch'](handleError(_0x245332,null));};exports[_0x13c8('0x63')]=function(_0x14e912,_0x2d6184){return db[_0x13c8('0x40')][_0x13c8('0x63')]()['then'](respondWithResult(_0x2d6184,null))[_0x13c8('0x57')](handleError(_0x2d6184,null));};exports[_0x13c8('0x64')]=function(_0x42ade9,_0xf10b20){return db['User'][_0x13c8('0x61')]({'where':{'id':_0x42ade9['params']['id']}})[_0x13c8('0x16')](handleEntityNotFound(_0xf10b20,null))[_0x13c8('0x16')](function(_0x220722){if(_0x220722){return _0x220722[_0x13c8('0x64')](_0x42ade9[_0x13c8('0x60')][_0x13c8('0x65')],_[_0x13c8('0x66')](_0x42ade9[_0x13c8('0x60')],['ids','id'])||{});}})['then'](respondWithResult(_0xf10b20,null))[_0x13c8('0x57')](handleError(_0xf10b20,null));};function validateUser(_0x302570){return new Promise(function(_0x2ea0b0,_0x4f867f){if(_0x302570['internal'])return _0x2ea0b0(_0x302570);return db['Setting']['findById'](0x1)['then'](function(_0x12d64e){if(_0x12d64e[_0x13c8('0x67')])authService['validatePasswordPattern'](_0x302570[_0x13c8('0x44')]);db[_0x13c8('0x40')]['max'](_0x13c8('0x68'))[_0x13c8('0x16')](function(_0x25455d){if(_['isNil'](_0x25455d)){_0x302570['internal']=_0x12d64e[_0x13c8('0x69')]||0x1;return;}if(_[_0x13c8('0x6a')](_0x12d64e[_0x13c8('0x69')])||_0x12d64e[_0x13c8('0x69')]===_0x25455d){_0x302570[_0x13c8('0x68')]=_0x25455d+0x1;return;}if(_0x12d64e[_0x13c8('0x69')]>_0x25455d){_0x302570[_0x13c8('0x68')]=_0x12d64e[_0x13c8('0x69')];return;}return db[_0x13c8('0x6b')][_0x13c8('0x4c')]('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[_0x13c8('0x6b')][_0x13c8('0x6c')][_0x13c8('0x6d')]})[_0x13c8('0x16')](function(_0x381c02){if(_0x381c02&&_0x381c02[_0x13c8('0x4e')]){for(var _0x1cd004=0x0,_0x8d0c8d=_0x381c02[_0x13c8('0x4e')];_0x1cd004<_0x8d0c8d&&_[_0x13c8('0x6a')](_0x302570[_0x13c8('0x68')]);_0x1cd004++){if(_0x12d64e[_0x13c8('0x69')]<=_0x381c02[_0x1cd004][_0x13c8('0x6e')]){_0x302570[_0x13c8('0x68')]=_0x381c02[_0x1cd004][_0x13c8('0x6e')];}else if(_0x12d64e[_0x13c8('0x69')]>_0x381c02[_0x1cd004][_0x13c8('0x6e')]&&_0x12d64e[_0x13c8('0x69')]<=_0x381c02[_0x1cd004]['to']){_0x302570[_0x13c8('0x68')]=_0x12d64e[_0x13c8('0x69')];}}}if(_[_0x13c8('0x6a')](_0x302570['internal'])){_0x302570['internal']=_0x25455d+0x1;}return _0x2ea0b0(_0x302570);});});})['catch'](function(_0x5a9c38){_0x4f867f(_0x5a9c38);});});}function updateUser(_0x3669c5){return new Promise(function(_0x25edc8,_0x550b49){try{if(_0x3669c5[_0x13c8('0x6f')]){_0x3669c5[_0x13c8('0x70')]=_0x3669c5[_0x13c8('0x68')];_0x3669c5['VoiceMail']={'mailbox':_0x3669c5[_0x13c8('0x68')],'password':_0x3669c5[_0x13c8('0x44')],'fullname':_0x3669c5['fullname'],'email':_0x3669c5[_0x13c8('0x71')]};}if(_0x3669c5[_0x13c8('0x3a')]==='agent'){if(!_0x3669c5[_0x13c8('0x72')])_0x3669c5[_0x13c8('0x72')]=[_0x13c8('0x73'),_0x13c8('0x74'),'103',_0x13c8('0x75'),_0x13c8('0x76'),_0x13c8('0x77'),_0x13c8('0x78'),'106',_0x13c8('0x79'),'108','109',_0x13c8('0x7a'),_0x13c8('0x7b'),'114',_0x13c8('0x7c')];}_0x25edc8(_0x3669c5);}catch(_0x7e1821){_0x550b49(_0x7e1821);}});}exports[_0x13c8('0x7d')]=function(_0xf69d9f,_0x17dad7){if(_0xf69d9f[_0x13c8('0x31')][_0x13c8('0x3a')]==='agent')throw new Error(_0x13c8('0x7e'));if(_0xf69d9f[_0x13c8('0x60')]['role']===_0x13c8('0x31')&&_0xf69d9f[_0x13c8('0x31')]['role']!==_0x13c8('0x7f')){throw new Error(_0x13c8('0x80'));}if(_0xf69d9f[_0x13c8('0x60')][_0x13c8('0x3a')]==='admin'&&_0xf69d9f[_0x13c8('0x31')][_0x13c8('0x3a')]!==_0x13c8('0x7f')){throw new Error(_0x13c8('0x81'));}return licenseUtil[_0x13c8('0x82')]([_0xf69d9f['body']])[_0x13c8('0x16')](function(){return validateUser(_0xf69d9f[_0x13c8('0x60')]);})[_0x13c8('0x16')](function(_0x45ca73){return updateUser(_0x45ca73)[_0x13c8('0x16')](function(_0x3236ed){if(_0x3236ed[_0x13c8('0x3a')]==='admin'){_0x3236ed[_0x13c8('0x83')]=_0xf69d9f[_0x13c8('0x31')][_0x13c8('0x83')];delete _0x3236ed['userProfileId'];}return _0x3236ed;});})['then'](function(_0x5f1f67){return db[_0x13c8('0x40')][_0x13c8('0x7d')](_0x5f1f67,{'include':[{'model':db[_0x13c8('0x84')],'as':'VoiceMail'}]});})[_0x13c8('0x16')](function(_0x2f5145){if(_0xf69d9f[_0x13c8('0x60')][_0x13c8('0x3a')]==='user')return _0x2f5145;if(_0xf69d9f[_0x13c8('0x31')][_0x13c8('0x3a')]!=='user')return _0x2f5145;return db[_0x13c8('0x85')][_0x13c8('0x61')]({'where':{'name':_0x2f5145[_0x13c8('0x3a')]===_0x13c8('0x33')?_0x13c8('0x32'):_0x13c8('0x34'),'userProfileId':_0xf69d9f[_0x13c8('0x31')][_0x13c8('0x86')]},'raw':!![]})[_0x13c8('0x16')](function(_0x371b40){if(!_0x371b40||_0x371b40[_0x13c8('0x87')]!=0x0)return _0x2f5145;return db['UserProfileResource'][_0x13c8('0x7d')]({'name':_0x2f5145[_0x13c8('0x3b')],'resourceId':_0x2f5145['id'],'type':_0x371b40[_0x13c8('0x3b')],'sectionId':_0x371b40['id']},{})[_0x13c8('0x16')](function(){return _0x2f5145;});})[_0x13c8('0x57')](function(_0x26fd12){logger[_0x13c8('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x26fd12);throw _0x26fd12;});})[_0x13c8('0x16')](respondWithResult(_0x17dad7,0xc9))['catch'](handleError(_0x17dad7,null));};exports[_0x13c8('0x88')]=function(_0x34bb16,_0x4294f7){var _0x683010=_0x34bb16[_0x13c8('0x60')];var _0x2b41e1=[];if(_0x34bb16[_0x13c8('0x31')][_0x13c8('0x3a')]==='agent')throw new Error(_0x13c8('0x7e'));if(_[_0x13c8('0x89')](_0x683010,[_0x13c8('0x3a'),_0x13c8('0x31')])&&_0x34bb16[_0x13c8('0x31')][_0x13c8('0x3a')]!==_0x13c8('0x7f')){throw new Error(_0x13c8('0x80'));}if(_['some'](_0x683010,[_0x13c8('0x3a'),_0x13c8('0x7f')])&&_0x34bb16[_0x13c8('0x31')]['role']!==_0x13c8('0x7f')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0x13c8('0x82')](_0x683010)[_0x13c8('0x16')](function(){return validateUser(_0x683010[0x0]);})[_0x13c8('0x16')](function(){for(var _0x5aac27=0x1;_0x5aac27<_0x683010[_0x13c8('0x4e')];_0x5aac27++){var _0x2eaa38=_0x683010[_0x5aac27-0x1][_0x13c8('0x68')];if(!_0x683010[_0x5aac27][_0x13c8('0x68')])_0x683010[_0x5aac27]['internal']=_0x2eaa38+0x1;_0x2b41e1[_0x13c8('0x4f')](validateUser(_0x683010[_0x5aac27]));}return Promise['all'](_0x2b41e1);})[_0x13c8('0x16')](function(){_0x2b41e1=[];for(var _0xddb141=0x0;_0xddb141<_0x683010[_0x13c8('0x4e')];_0xddb141++){_0x2b41e1[_0x13c8('0x4f')](updateUser(_0x683010[_0xddb141]));}return Promise['all'](_0x2b41e1);})['then'](function(){_0x2b41e1=_0x683010[_0x13c8('0x37')](function(_0x3f503b){return db[_0x13c8('0x40')][_0x13c8('0x7d')](_0x3f503b,{'include':[{'model':db[_0x13c8('0x84')],'as':_0x13c8('0x84')}]})[_0x13c8('0x16')](function(_0x486d2b){_0x3f503b['id']=_0x486d2b['id'];return _0x3f503b;});});return Promise['all'](_0x2b41e1);})[_0x13c8('0x16')](function(_0x2fb97e){if(_0x34bb16['body'][_0x13c8('0x3a')]===_0x13c8('0x31'))return _0x2fb97e;if(_0x34bb16['user'][_0x13c8('0x3a')]!=='user')return _0x2fb97e;var _0x3a2a69=_[_0x13c8('0x89')](_0x2fb97e,function(_0x205018){return _0x205018['role']===_0x13c8('0x33')||_0x205018['role']===_0x13c8('0x35');});if(!_0x3a2a69)return _0x2fb97e;return db[_0x13c8('0x85')]['findAll']({'where':{'name':{'$or':['Agents',_0x13c8('0x34')]},'userProfileId':_0x34bb16[_0x13c8('0x31')][_0x13c8('0x86')]},'raw':!![]})[_0x13c8('0x16')](function(_0x3bee70){if(_[_0x13c8('0x8a')](_0x3bee70)||!_[_0x13c8('0x89')](_0x3bee70,[_0x13c8('0x87'),0x0]))return _0x2fb97e;_0x2b41e1=[];var _0x199bc1=_(_0x3bee70)[_0x13c8('0x37')](function(_0x17f4df){if(_0x17f4df[_0x13c8('0x87')]===0x1)return;return _0x17f4df['name']==='Agents'?_0x13c8('0x33'):_0x13c8('0x35');})[_0x13c8('0x8b')]()['value']();for(var _0x271d78=0x0;_0x271d78<_0x2fb97e[_0x13c8('0x4e')];_0x271d78++){if(!_['includes'](_0x199bc1,_0x2fb97e[_0x271d78][_0x13c8('0x3a')]))return;var _0x58f6f0=_0x2fb97e[_0x271d78][_0x13c8('0x3a')]===_0x13c8('0x33')?_0x13c8('0x32'):'Telephones';_0x2b41e1[_0x13c8('0x4f')](db['UserProfileResource'][_0x13c8('0x7d')]({'name':_0x2fb97e[_0x271d78]['name'],'resourceId':_0x2fb97e[_0x271d78]['id'],'type':_0x58f6f0,'sectionId':_['find'](_0x3bee70,['name',_0x58f6f0])['id']},{}));}return Promise['all'](_0x2b41e1);});})[_0x13c8('0x16')](respondWithResult(_0x4294f7,0xc9))[_0x13c8('0x57')](handleError(_0x4294f7,null));};exports[_0x13c8('0x8c')]=function(_0xd34a66,_0x5a525c){if(_0xd34a66[_0x13c8('0x60')]['id']){delete _0xd34a66[_0x13c8('0x60')]['id'];}return db['User'][_0x13c8('0x61')]({'where':{'id':_0xd34a66[_0x13c8('0x62')]['id']}})[_0x13c8('0x16')](function(_0x134b05){if(!_0x134b05)return null;if(_0x134b05['id']===_0xd34a66[_0x13c8('0x31')]['id']){if(!_0xd34a66['body'][_0x13c8('0x8d')]||!_0xd34a66[_0x13c8('0x60')][_0x13c8('0x8e')]){throw new db[(_0x13c8('0x8f'))][(_0x13c8('0x90'))](_0x13c8('0x91'));}if(!_0x134b05[_0x13c8('0x92')](_0xd34a66[_0x13c8('0x60')][_0x13c8('0x8d')])){throw new db[(_0x13c8('0x8f'))][(_0x13c8('0x90'))](_0x13c8('0x93'));}if(_0xd34a66[_0x13c8('0x60')]['oldPassword']===_0xd34a66[_0x13c8('0x60')][_0x13c8('0x8e')]){throw new db['Sequelize'][(_0x13c8('0x90'))](_0x13c8('0x94'));}}else if(_0xd34a66[_0x13c8('0x31')][_0x13c8('0x3a')]==='admin'){if(!_0xd34a66['body'][_0x13c8('0x8e')]){throw new db['Sequelize'][(_0x13c8('0x90'))](_0x13c8('0x95'));}}else if(_0xd34a66[_0x13c8('0x31')]['role']===_0x13c8('0x31')){if(!_0xd34a66[_0x13c8('0x60')][_0x13c8('0x8e')]){throw new db[(_0x13c8('0x8f'))][(_0x13c8('0x90'))](_0x13c8('0x95'));}if(_0x134b05[_0x13c8('0x3a')]!==_0x13c8('0x33')){throw new db['Sequelize'][(_0x13c8('0x90'))](_0x13c8('0x7e'));}}else{throw new db[(_0x13c8('0x8f'))]['ValidationError'](_0x13c8('0x7e'));}return _0x134b05;})['then'](handleEntityNotFound(_0x5a525c,null))[_0x13c8('0x16')](function(_0xca6428){return db['Setting'][_0x13c8('0x96')]({'attributes':['id',_0x13c8('0x67'),'enforcePasswordHistory','passwordHistoryLimit']})[_0x13c8('0x16')](function(_0x1d1406){if(_0x1d1406[_0x13c8('0x67')])authService['validatePasswordPattern'](_0xd34a66[_0x13c8('0x60')][_0x13c8('0x8e')]);if(!_0x1d1406[_0x13c8('0x97')]||!_0xca6428[_0x13c8('0x98')])return _0xca6428;authService[_0x13c8('0x99')](_0xd34a66[_0x13c8('0x60')]['newPassword'],_0xca6428[_0x13c8('0x98')],_0x1d1406['passwordHistoryLimit']);return _0xca6428;})['then'](saveUpdates({'password':_0xd34a66[_0x13c8('0x60')][_0x13c8('0x8e')],'passwordResetAt':_0xd34a66[_0x13c8('0x31')]['id']==_0xd34a66[_0x13c8('0x62')]['id']?moment():null,'previousPasswords':authService[_0x13c8('0x9a')](_0xd34a66['body'][_0x13c8('0x8e')],_0xca6428[_0x13c8('0x98')])},null));})['then'](respondWithResult(_0x5a525c,null))[_0x13c8('0x57')](handleError(_0x5a525c,null));};exports[_0x13c8('0x9b')]=function(_0x2ae8fd,_0x518e75){var _0x16fff8=_0x2ae8fd['body'][_0x13c8('0x9c')];return db['User']['find']({'where':{'id':_0x2ae8fd[_0x13c8('0x62')]['id']},'attributes':['id',_0x13c8('0x3b'),'role',_0x13c8('0x9d'),'loginInPause',_0x13c8('0x9e'),_0x13c8('0x9f')]})[_0x13c8('0x16')](handleEntityNotFound(_0x518e75,null))[_0x13c8('0x16')](function(_0x133a10){if(_0x133a10){if(!utils[_0x13c8('0xa0')](_0x16fff8)){throw new db[(_0x13c8('0x8f'))]['ValidationError'](_0x13c8('0xa1'));}return _0x133a10[_0x13c8('0xa2')+_['capitalize'](_0x16fff8['toLowerCase']())+_0x13c8('0xa3')](_0x2ae8fd[_0x13c8('0x60')][_0x13c8('0x65')],{'penalty':_0x2ae8fd[_0x13c8('0x60')][_0x13c8('0xa4')]||0x0})[_0x13c8('0xa5')](function(_0x13a840){for(var _0x4041e6=0x0;_0x4041e6<_0x2ae8fd['body']['ids'][_0x13c8('0x4e')];_0x4041e6+=0x1){var _0x483170={'UserId':Number(_0x2ae8fd[_0x13c8('0x62')]['id'])};_0x483170[_[_0x13c8('0xa6')](_0x16fff8[_0x13c8('0xa7')]())+'QueueId']=Number(_0x2ae8fd[_0x13c8('0x60')][_0x13c8('0x65')][_0x4041e6]);socket[_0x13c8('0x2c')](_0x13c8('0x31')+_['capitalize'](_0x16fff8[_0x13c8('0xa7')]())+'Queue:save',_0x483170);}return _0x13a840;})['then'](function(){if(_0x16fff8===_0x13c8('0xa8')){return db[_0x13c8('0xa9')][_0x13c8('0xaa')]({'where':{'id':_0x2ae8fd[_0x13c8('0x60')][_0x13c8('0x65')]||[]},'raw':!![],'attributes':['id',_0x13c8('0x3b')]});}})[_0x13c8('0x16')](function(_0x1053f4){var _0x578915=_0x133a10[_0x13c8('0x2f')]({'plain':!![]});var _0x1e4b48=[];if(_0x16fff8===_0x13c8('0xa8')&&_0x578915[_0x13c8('0x3a')]===_0x13c8('0x33')&&_0x578915['online']){for(let _0x221aa6=0x0;_0x221aa6<_0x1053f4[_0x13c8('0x4e')];_0x221aa6+=0x1){_0x1e4b48['push']({'membername':_0x578915[_0x13c8('0x3b')],'UserId':_0x578915['id'],'queue_name':_0x1053f4[_0x221aa6][_0x13c8('0x3b')],'VoiceQueueId':_0x1053f4[_0x221aa6]['id'],'interface':_['isNil'](_0x578915['interface'])?util[_0x13c8('0xab')](_0x13c8('0xac'),_0x578915[_0x13c8('0x3b')]):_0x578915['interface'],'paused':_0x578915[_0x13c8('0x9e')]||![],'penalty':_0x2ae8fd[_0x13c8('0x60')]['penalty']||0x0});}return Promise['all'](_0x1e4b48[_0x13c8('0x37')](function(_0x100803){return db[_0x13c8('0xad')]['upsert'](_0x100803);}));}return _0x133a10;});}})[_0x13c8('0x16')](respondWithStatusCode(_0x518e75,null))[_0x13c8('0x57')](handleError(_0x518e75,null));};exports[_0x13c8('0xae')]=function(_0x34fb66,_0x4bb728){var _0x5d5056,_0x239764;return db[_0x13c8('0x40')][_0x13c8('0x61')]({'where':{'id':_0x34fb66['params']['id']},'attributes':['id',_0x13c8('0x3b'),'role']})[_0x13c8('0x16')](handleEntityNotFound(_0x4bb728,null))['then'](function(_0x2c964d){if(_0x2c964d){_0x5d5056=_0x2c964d;if(!_0x34fb66[_0x13c8('0x4c')][_0x13c8('0x9c')]||!utils[_0x13c8('0xa0')](_0x34fb66[_0x13c8('0x4c')][_0x13c8('0x9c')])){throw new db[(_0x13c8('0x8f'))][(_0x13c8('0x90'))](_0x13c8('0xa1'));}return _0x2c964d['remove'+_['capitalize'](_0x34fb66[_0x13c8('0x4c')]['channel'][_0x13c8('0xa7')]())+_0x13c8('0xa3')](_0x34fb66['query'][_0x13c8('0x65')]);}})[_0x13c8('0x16')](function(_0xd73f5b){if(_[_0x13c8('0xaf')](_0x34fb66[_0x13c8('0x4c')][_0x13c8('0x65')])){for(var _0x39d127=0x0;_0x39d127<_0x34fb66[_0x13c8('0x4c')]['ids']['length'];_0x39d127+=0x1){_0x239764={'UserId':Number(_0x34fb66[_0x13c8('0x62')]['id'])};_0x239764[_[_0x13c8('0xa6')](_0x34fb66[_0x13c8('0x4c')][_0x13c8('0x9c')][_0x13c8('0xa7')]())+'QueueId']=Number(_0x34fb66[_0x13c8('0x4c')][_0x13c8('0x65')][_0x39d127]);socket[_0x13c8('0x2c')](_0x13c8('0x31')+_[_0x13c8('0xa6')](_0x34fb66['query'][_0x13c8('0x9c')]['toLowerCase']())+_0x13c8('0xb0'),_0x239764);}}else{_0x239764={'UserId':Number(_0x34fb66[_0x13c8('0x62')]['id'])};_0x239764[_[_0x13c8('0xa6')](_0x34fb66[_0x13c8('0x4c')][_0x13c8('0x9c')][_0x13c8('0xa7')]())+_0x13c8('0xb1')]=Number(_0x34fb66[_0x13c8('0x4c')]['ids']);socket['emit'](_0x13c8('0x31')+_[_0x13c8('0xa6')](_0x34fb66[_0x13c8('0x4c')][_0x13c8('0x9c')][_0x13c8('0xa7')]())+'Queue:remove',_0x239764);}return _0xd73f5b;})['then'](function(){if(_0x34fb66['query'][_0x13c8('0x9c')]===_0x13c8('0xa8')){return db[_0x13c8('0xad')][_0x13c8('0x2e')]({'where':{'UserId':_0x34fb66[_0x13c8('0x62')]['id'],'VoiceQueueId':_0x34fb66[_0x13c8('0x4c')][_0x13c8('0x65')]},'individualHooks':!![]})[_0x13c8('0x16')](function(){return _0x5d5056;});}return _0x5d5056;})['then'](respondWithStatusCode(_0x4bb728,null))[_0x13c8('0x57')](handleError(_0x4bb728,null));};exports['addAvatar']=function(_0x30bddb,_0x44f978){_0x30bddb['body'][_0x13c8('0xb2')]=_0x30bddb['file']['filename'];return db[_0x13c8('0x40')][_0x13c8('0x61')]({'where':{'id':_0x30bddb[_0x13c8('0x62')]['id']}})[_0x13c8('0x16')](handleEntityNotFound(_0x44f978,null))[_0x13c8('0x16')](saveUpdates(_0x30bddb[_0x13c8('0x60')],null))[_0x13c8('0x16')](respondWithResult(_0x44f978,null))[_0x13c8('0x57')](handleError(_0x44f978,null));};exports['getAvatar']=function(_0x1c4216,_0x427f13){var _0x1b1cb4=path['join'](config['root'],_0x13c8('0xb3'));return db[_0x13c8('0x40')][_0x13c8('0x61')]({'where':{'id':_0x1c4216['params']['id']},'attributes':['id',_0x13c8('0xb2')],'raw':!![]})[_0x13c8('0x16')](handleEntityNotFound(_0x427f13,null))['then'](function(_0x38f2a9){if(_0x38f2a9){if(_[_0x13c8('0x6a')](_0x38f2a9[_0x13c8('0xb2')])){return _0x427f13[_0x13c8('0xb4')](_0x1b1cb4);}else{if(!fs[_0x13c8('0xb5')](path[_0x13c8('0xb6')](config[_0x13c8('0xb7')],_0x13c8('0xb8'),_0x38f2a9[_0x13c8('0xb2')]))){return _0x427f13['download'](_0x1b1cb4);}return _0x427f13[_0x13c8('0xb4')](path[_0x13c8('0xb6')](config[_0x13c8('0xb7')],'server/files/images/',_0x38f2a9[_0x13c8('0xb2')]));}}})[_0x13c8('0x57')](handleError(_0x427f13,null));};exports['getOpenTabs']=function(_0x4d9092,_0x416084){return db[_0x13c8('0x40')]['find']({'where':{'id':_0x4d9092['params']['id']},'attributes':['id']})[_0x13c8('0x16')](handleEntityNotFound(_0x416084,null))[_0x13c8('0x16')](function(_0x28c1a0){var _0x452438=[];values=_0x28c1a0[_0x13c8('0x51')];_0x452438['push'](get_open_tabs('chat',_0x28c1a0['dataValues']));_0x452438[_0x13c8('0x4f')](get_open_tabs(_0x13c8('0x52'),_0x28c1a0[_0x13c8('0x51')]));_0x452438['push'](get_open_tabs(_0x13c8('0x54'),_0x28c1a0[_0x13c8('0x51')]));_0x452438[_0x13c8('0x4f')](get_open_tabs(_0x13c8('0x55'),_0x28c1a0[_0x13c8('0x51')]));_0x452438['push'](get_open_tabs(_0x13c8('0x53'),_0x28c1a0[_0x13c8('0x51')]));_0x452438['push'](get_open_tabs(_0x13c8('0xb9'),_0x28c1a0[_0x13c8('0x51')]));return Promise['all'](_0x452438);})[_0x13c8('0x16')](function(_0x4bb041){if(_0x4bb041){var _0x215f96=_['map'](values[_0x13c8('0xba')],function(_0xec74e6){return{'channel':_0x13c8('0xbb'),'id':_0xec74e6['id'],'createdAt':_0xec74e6['createdAt']};});var _0x4e6a56=_[_0x13c8('0x37')](values[_0x13c8('0xbc')],function(_0x43b927){return{'channel':_0x13c8('0xbd'),'id':_0x43b927['id'],'createdAt':_0x43b927[_0x13c8('0xbe')]};});var _0x34aaf6=_[_0x13c8('0x37')](values['OpenchannelOpenTabs'],function(_0x124dec){return{'channel':'OPENCHANNEL','id':_0x124dec['id'],'createdAt':_0x124dec[_0x13c8('0xbe')]};});var _0x3e6b94=_[_0x13c8('0x37')](values[_0x13c8('0xbf')],function(_0x49859b){return{'channel':'MAIL','id':_0x49859b['id'],'createdAt':_0x49859b[_0x13c8('0xbe')]};});var _0x35b7a0=_[_0x13c8('0x37')](values[_0x13c8('0xc0')],function(_0xee639){return{'channel':'SMS','id':_0xee639['id'],'createdAt':_0xee639[_0x13c8('0xbe')]};});var _0x5bb3a9=_[_0x13c8('0x37')](values[_0x13c8('0xc1')],function(_0x26b95a){return{'channel':'WHATSAPP','id':_0x26b95a['id'],'createdAt':_0x26b95a[_0x13c8('0xbe')]};});var _0x394591=_[_0x13c8('0xc2')](_0x215f96,_0x4e6a56,_0x34aaf6,_0x3e6b94,_0x35b7a0,_0x5bb3a9);var _0x9f22fe={'count':_0x394591[_0x13c8('0x4e')],'rows':_0x394591};return _0x9f22fe;}else return null;})[_0x13c8('0x16')](respondWithResult(_0x416084,null))[_0x13c8('0x57')](handleError(_0x416084,null));};exports[_0x13c8('0xc3')]=function(_0x2cf0dd,_0x2c4244){var _0x51f15b={};var _0x4becaa={};var _0x116452;var _0x1bbd40;return db[_0x13c8('0x40')]['findOne']({'where':{'id':_0x2cf0dd['params']['id']}})[_0x13c8('0x16')](handleEntityNotFound(_0x2c4244,null))[_0x13c8('0x16')](function(_0x5b40d6){if(_0x5b40d6){_0x116452=_0x5b40d6;_0x4becaa[_0x13c8('0x59')]=_[_0x13c8('0x5a')](db[_0x13c8('0xc4')][_0x13c8('0x41')]);_0x4becaa[_0x13c8('0x4c')]=_[_0x13c8('0x5a')](_0x2cf0dd[_0x13c8('0x4c')]);_0x4becaa[_0x13c8('0xc5')]=_[_0x13c8('0x5b')](_0x4becaa[_0x13c8('0x59')],_0x4becaa['query']);_0x51f15b[_0x13c8('0x4a')]=_['intersection'](_0x4becaa['model'],qs[_0x13c8('0x5c')](_0x2cf0dd['query'][_0x13c8('0x5c')]));_0x51f15b[_0x13c8('0x4a')]=_0x51f15b['attributes'][_0x13c8('0x4e')]?_0x51f15b[_0x13c8('0x4a')]:_0x4becaa['model'];_0x51f15b[_0x13c8('0xc6')]=qs[_0x13c8('0xc7')](_0x2cf0dd[_0x13c8('0x4c')]['sort']);_0x51f15b[_0x13c8('0xc8')]=qs[_0x13c8('0xc5')](_['pick'](_0x2cf0dd[_0x13c8('0x4c')],_0x4becaa[_0x13c8('0xc5')]));if(_0x2cf0dd[_0x13c8('0x4c')][_0x13c8('0x36')]){_0x51f15b[_0x13c8('0xc8')]=_[_0x13c8('0x5e')](_0x51f15b[_0x13c8('0xc8')],{'$or':_[_0x13c8('0x37')](_0x51f15b[_0x13c8('0x4a')],function(_0x3f21f0){var _0x272f19={};_0x272f19[_0x3f21f0]={'$like':'%'+_0x2cf0dd[_0x13c8('0x4c')][_0x13c8('0x36')]+'%'};return _0x272f19;})});}_0x51f15b=_[_0x13c8('0x5e')]({},_0x51f15b,_0x2cf0dd[_0x13c8('0x5f')]);return _0x116452[_0x13c8('0xc3')](_0x51f15b);}})[_0x13c8('0x16')](function(_0x1dbc2f){if(_0x1dbc2f){_0x1bbd40=_0x1dbc2f[_0x13c8('0x4e')];if(_0x2cf0dd['query'][_0x13c8('0xc9')](_0x13c8('0x46'))){_0x51f15b['include']=[{'model':db[_0x13c8('0xca')],'as':_0x13c8('0xcb'),'required':![]},{'model':db[_0x13c8('0xcc')],'as':_0x13c8('0xcd'),'attributes':['id',_0x13c8('0x3b'),_0x13c8('0xce')],'where':_0x2cf0dd[_0x13c8('0x4c')][_0x13c8('0xcf')]?{'id':_0x2cf0dd[_0x13c8('0x4c')][_0x13c8('0xcf')]}:undefined,'required':_0x2cf0dd[_0x13c8('0x4c')][_0x13c8('0xcf')]?!![]:![]}];}if(!_0x2cf0dd[_0x13c8('0x4c')][_0x13c8('0xc9')](_0x13c8('0xd0'))){_0x51f15b[_0x13c8('0x26')]=qs['limit'](_0x2cf0dd[_0x13c8('0x4c')][_0x13c8('0x26')]);_0x51f15b[_0x13c8('0x24')]=qs[_0x13c8('0x24')](_0x2cf0dd[_0x13c8('0x4c')][_0x13c8('0x24')]);}return _0x116452['getContacts'](_0x51f15b);}})[_0x13c8('0x16')](function(_0x152372){if(_0x152372){return _0x152372?{'count':_0x1bbd40,'rows':_0x152372}:null;}})[_0x13c8('0x16')](respondWithResult(_0x2c4244,null))[_0x13c8('0x57')](handleError(_0x2c4244,null));};exports['getQueues']=function(_0x2ab360,_0x1475d5){var _0x2745c4;var _0x5a5bad={};var _0x2f4556;return db[_0x13c8('0x40')][_0x13c8('0x96')]({'where':{'id':_0x2ab360[_0x13c8('0x62')]['id']},'attributes':['id',_0x13c8('0x3b'),_0x13c8('0x3a')]})[_0x13c8('0x16')](handleEntityNotFound(_0x1475d5,null))['then'](function(_0x1f3b6c){if(!utils[_0x13c8('0xa0')](_0x2ab360['query']['channel'])){throw new db['Sequelize'][(_0x13c8('0x90'))]('Unknown\x20channel');}_0x2745c4=_0x1f3b6c;var _0x6ff2e4={};_0x6ff2e4[_0x13c8('0x59')]=_[_0x13c8('0x5a')](db[_[_0x13c8('0xa6')](_0x2ab360[_0x13c8('0x4c')][_0x13c8('0x9c')])+_0x13c8('0xd1')][_0x13c8('0x41')]);_0x6ff2e4['query']=_[_0x13c8('0x5a')](_0x2ab360[_0x13c8('0x4c')]);_0x6ff2e4['filters']=_[_0x13c8('0x5b')](_0x6ff2e4[_0x13c8('0x59')],_0x6ff2e4[_0x13c8('0x4c')]);_0x5a5bad[_0x13c8('0x4a')]=_[_0x13c8('0x5b')](_0x6ff2e4[_0x13c8('0x59')],qs['fields'](_0x2ab360[_0x13c8('0x4c')][_0x13c8('0x5c')]));_0x5a5bad['attributes']=_0x5a5bad[_0x13c8('0x4a')]['length']?_0x5a5bad['attributes']:_0x6ff2e4['model'];_0x5a5bad[_0x13c8('0xc6')]=qs[_0x13c8('0xc7')](_0x2ab360[_0x13c8('0x4c')]['sort']);_0x5a5bad[_0x13c8('0xc8')]=qs[_0x13c8('0xc5')](_['pick'](_0x2ab360['query'],_0x6ff2e4['filters']));if(_0x2ab360[_0x13c8('0x4c')][_0x13c8('0x36')]){_0x5a5bad[_0x13c8('0xc8')]=_['merge'](_0x5a5bad['where'],{'$or':_[_0x13c8('0x37')](_0x5a5bad['attributes'],function(_0x165c5b){var _0x3682cd={};_0x3682cd[_0x165c5b]={'$like':'%'+_0x2ab360[_0x13c8('0x4c')][_0x13c8('0x36')]+'%'};return _0x3682cd;})});}_0x5a5bad=_[_0x13c8('0x5e')]({},_0x5a5bad,_0x2ab360[_0x13c8('0x5f')]);switch(_0x2745c4[_0x13c8('0x3a')]){case _0x13c8('0x7f'):return db[_[_0x13c8('0xa6')](_0x2ab360[_0x13c8('0x4c')][_0x13c8('0x9c')])+_0x13c8('0xd1')][_0x13c8('0xaa')](_0x5a5bad);case _0x13c8('0x31'):case _0x13c8('0x33'):return _0x2745c4[_0x13c8('0x2f')+_[_0x13c8('0xa6')](_0x2ab360[_0x13c8('0x4c')]['channel'])+_0x13c8('0xa3')](_0x5a5bad);default:throw new db[(_0x13c8('0x8f'))][(_0x13c8('0x90'))]('Unknown\x20role');}})[_0x13c8('0x16')](function(_0x4f4a57){_0x2f4556=_0x4f4a57[_0x13c8('0x4e')];if(!_0x2ab360[_0x13c8('0x4c')][_0x13c8('0xc9')](_0x13c8('0xd0'))){_0x5a5bad[_0x13c8('0x26')]=qs[_0x13c8('0x26')](_0x2ab360[_0x13c8('0x4c')][_0x13c8('0x26')]);_0x5a5bad[_0x13c8('0x24')]=qs[_0x13c8('0x24')](_0x2ab360[_0x13c8('0x4c')][_0x13c8('0x24')]);}switch(_0x2745c4[_0x13c8('0x3a')]){case _0x13c8('0x7f'):return db[_[_0x13c8('0xa6')](_0x2ab360[_0x13c8('0x4c')]['channel'])+_0x13c8('0xd1')]['findAll'](_0x5a5bad);case'user':case'agent':return _0x2745c4['get'+_[_0x13c8('0xa6')](_0x2ab360['query'][_0x13c8('0x9c')])+_0x13c8('0xa3')](_0x5a5bad);}})[_0x13c8('0x16')](function(_0x20bc06){return{'count':_0x2f4556,'rows':_0x20bc06};})[_0x13c8('0x16')](respondWithResult(_0x1475d5,null))['catch'](handleError(_0x1475d5,null));};exports[_0x13c8('0xd2')]=function(_0x598bae,_0x513fd6){var _0x7ded00={};var _0x5463c9={};var _0x3a7095;var _0x283d79;return db['User']['findOne']({'where':{'id':_0x598bae[_0x13c8('0x62')]['id']}})[_0x13c8('0x16')](handleEntityNotFound(_0x513fd6,null))[_0x13c8('0x16')](function(_0x34ca5f){if(_0x34ca5f){_0x3a7095=_0x34ca5f;_0x5463c9['model']=_['keys'](db[_0x13c8('0xad')][_0x13c8('0x41')]);_0x5463c9[_0x13c8('0x4c')]=_[_0x13c8('0x5a')](_0x598bae[_0x13c8('0x4c')]);_0x5463c9[_0x13c8('0xc5')]=_['intersection'](_0x5463c9['model'],_0x5463c9['query']);_0x7ded00[_0x13c8('0x4a')]=_[_0x13c8('0x5b')](_0x5463c9[_0x13c8('0x59')],qs[_0x13c8('0x5c')](_0x598bae['query'][_0x13c8('0x5c')]));_0x7ded00[_0x13c8('0x4a')]=_0x7ded00[_0x13c8('0x4a')][_0x13c8('0x4e')]?_0x7ded00[_0x13c8('0x4a')]:_0x5463c9['model'];_0x7ded00[_0x13c8('0xc6')]=qs[_0x13c8('0xc7')](_0x598bae[_0x13c8('0x4c')][_0x13c8('0xc7')]);_0x7ded00['where']=qs['filters'](_[_0x13c8('0xd3')](_0x598bae[_0x13c8('0x4c')],_0x5463c9[_0x13c8('0xc5')]));if(_0x598bae[_0x13c8('0x4c')][_0x13c8('0x36')]){_0x7ded00[_0x13c8('0xc8')]=_['merge'](_0x7ded00[_0x13c8('0xc8')],{'$or':_[_0x13c8('0x37')](_0x7ded00['attributes'],function(_0x4ec1f6){var _0x1dbecc={};_0x1dbecc[_0x4ec1f6]={'$like':'%'+_0x598bae[_0x13c8('0x4c')][_0x13c8('0x36')]+'%'};return _0x1dbecc;})});}_0x7ded00=_[_0x13c8('0x5e')]({},_0x7ded00,_0x598bae[_0x13c8('0x5f')]);return _0x3a7095[_0x13c8('0xd2')](_0x7ded00);}})[_0x13c8('0x16')](function(_0x1a1640){if(_0x1a1640){_0x283d79=_0x1a1640[_0x13c8('0x4e')];if(!_0x598bae[_0x13c8('0x4c')][_0x13c8('0xc9')](_0x13c8('0xd0'))){_0x7ded00['limit']=qs[_0x13c8('0x26')](_0x598bae[_0x13c8('0x4c')][_0x13c8('0x26')]);_0x7ded00[_0x13c8('0x24')]=qs[_0x13c8('0x24')](_0x598bae[_0x13c8('0x4c')]['offset']);}return _0x3a7095[_0x13c8('0xd2')](_0x7ded00);}})[_0x13c8('0x16')](function(_0x4dc38e){if(_0x4dc38e){return _0x4dc38e?{'count':_0x283d79,'rows':_0x4dc38e}:null;}})[_0x13c8('0x16')](respondWithResult(_0x513fd6,null))['catch'](handleError(_0x513fd6,null));};exports[_0x13c8('0xd4')]=function(_0x4425d8,_0x3622a1){var _0x5e821c={};var _0x5472f9={};var _0x3ea27e;var _0x587b66;return db[_0x13c8('0x40')][_0x13c8('0x96')]({'where':{'id':_0x4425d8[_0x13c8('0x62')]['id']}})[_0x13c8('0x16')](handleEntityNotFound(_0x3622a1,null))['then'](function(_0x4ff9cd){if(_0x4ff9cd){_0x3ea27e=_0x4ff9cd;_0x5472f9[_0x13c8('0x59')]=_[_0x13c8('0x5a')](db[_0x13c8('0xd5')][_0x13c8('0x41')]);_0x5472f9['query']=_[_0x13c8('0x5a')](_0x4425d8['query']);_0x5472f9[_0x13c8('0xc5')]=_[_0x13c8('0x5b')](_0x5472f9[_0x13c8('0x59')],_0x5472f9[_0x13c8('0x4c')]);_0x5e821c[_0x13c8('0x4a')]=_['intersection'](_0x5472f9[_0x13c8('0x59')],qs[_0x13c8('0x5c')](_0x4425d8[_0x13c8('0x4c')][_0x13c8('0x5c')]));_0x5e821c[_0x13c8('0x4a')]=_0x5e821c['attributes']['length']?_0x5e821c[_0x13c8('0x4a')]:_0x5472f9[_0x13c8('0x59')];_0x5e821c[_0x13c8('0xc6')]=qs[_0x13c8('0xc7')](_0x4425d8[_0x13c8('0x4c')]['sort']);_0x5e821c['where']=qs[_0x13c8('0xc5')](_[_0x13c8('0xd3')](_0x4425d8[_0x13c8('0x4c')],_0x5472f9['filters']));if(_0x4425d8[_0x13c8('0x4c')][_0x13c8('0x36')]){_0x5e821c['where']=_[_0x13c8('0x5e')](_0x5e821c[_0x13c8('0xc8')],{'$or':_['map'](_0x5e821c[_0x13c8('0x4a')],function(_0x1b3073){var _0x293f08={};_0x293f08[_0x1b3073]={'$like':'%'+_0x4425d8[_0x13c8('0x4c')][_0x13c8('0x36')]+'%'};return _0x293f08;})});}_0x5e821c=_[_0x13c8('0x5e')]({},_0x5e821c,_0x4425d8[_0x13c8('0x5f')]);return _0x3ea27e[_0x13c8('0xd4')](_0x5e821c);}})['then'](function(_0x175465){if(_0x175465){_0x587b66=_0x175465[_0x13c8('0x4e')];if(!_0x4425d8['query'][_0x13c8('0xc9')](_0x13c8('0xd0'))){_0x5e821c[_0x13c8('0x26')]=qs[_0x13c8('0x26')](_0x4425d8[_0x13c8('0x4c')][_0x13c8('0x26')]);_0x5e821c[_0x13c8('0x24')]=qs['offset'](_0x4425d8[_0x13c8('0x4c')][_0x13c8('0x24')]);}return _0x3ea27e[_0x13c8('0xd4')](_0x5e821c);}})[_0x13c8('0x16')](function(_0x22011b){if(_0x22011b){return _0x22011b?{'count':_0x587b66,'rows':_0x22011b}:null;}})[_0x13c8('0x16')](respondWithResult(_0x3622a1,null))[_0x13c8('0x57')](handleError(_0x3622a1,null));};exports[_0x13c8('0xd6')]=function(_0x2c3f45,_0x6f94c3){var _0x3e8cc5={'raw':!![],'where':{}};var _0x42fbfc={};var _0x250487={'count':0x0,'rows':[]};return db[_0x13c8('0x40')][_0x13c8('0x96')]({'where':{'id':_0x2c3f45[_0x13c8('0x62')]['id']}})[_0x13c8('0x16')](handleEntityNotFound(_0x6f94c3,null))[_0x13c8('0x16')](function(_0x5edd45){if(_0x5edd45){_0x42fbfc[_0x13c8('0x59')]=_['keys'](db[_0x13c8('0xd7')]['rawAttributes']);_0x42fbfc['query']=_[_0x13c8('0x5a')](_0x2c3f45[_0x13c8('0x4c')]);_0x42fbfc[_0x13c8('0xc5')]=_['intersection'](_0x42fbfc[_0x13c8('0x59')],_0x42fbfc[_0x13c8('0x4c')]);_0x3e8cc5[_0x13c8('0x4a')]=_[_0x13c8('0x5b')](_0x42fbfc[_0x13c8('0x59')],qs[_0x13c8('0x5c')](_0x2c3f45['query'][_0x13c8('0x5c')]));_0x3e8cc5[_0x13c8('0x4a')]=_0x3e8cc5[_0x13c8('0x4a')][_0x13c8('0x4e')]?_0x3e8cc5[_0x13c8('0x4a')]:_0x42fbfc[_0x13c8('0x59')];if(!_0x2c3f45[_0x13c8('0x4c')]['hasOwnProperty'](_0x13c8('0xd0'))){_0x3e8cc5[_0x13c8('0x26')]=qs[_0x13c8('0x26')](_0x2c3f45[_0x13c8('0x4c')][_0x13c8('0x26')]);_0x3e8cc5[_0x13c8('0x24')]=qs[_0x13c8('0x24')](_0x2c3f45[_0x13c8('0x4c')][_0x13c8('0x24')]);}_0x3e8cc5[_0x13c8('0xc6')]=qs[_0x13c8('0xc7')](_0x2c3f45['query'][_0x13c8('0xc7')]);_0x3e8cc5['where']=qs[_0x13c8('0xc5')](_[_0x13c8('0xd3')](_0x2c3f45['query'],_0x42fbfc['filters']));_0x3e8cc5[_0x13c8('0xc8')][_0x13c8('0xd8')]=_0x5edd45['id'];if(_0x2c3f45[_0x13c8('0x4c')][_0x13c8('0x36')]){_0x3e8cc5['where']=_[_0x13c8('0x5e')](_0x3e8cc5[_0x13c8('0xc8')],{'$or':_[_0x13c8('0x37')](_0x3e8cc5[_0x13c8('0x4a')],function(_0x1fc324){var _0x5c57fe={};_0x5c57fe[_0x1fc324]={'$like':'%'+_0x2c3f45[_0x13c8('0x4c')][_0x13c8('0x36')]+'%'};return _0x5c57fe;})});}_0x3e8cc5=_[_0x13c8('0x5e')]({},_0x3e8cc5,_0x2c3f45[_0x13c8('0x5f')]);return db[_0x13c8('0xd7')][_0x13c8('0x27')]({'where':_0x3e8cc5[_0x13c8('0xc8')]})[_0x13c8('0x16')](function(_0xec1247){_0x250487[_0x13c8('0x27')]=_0xec1247;if(_0x2c3f45[_0x13c8('0x4c')][_0x13c8('0x46')]){_0x3e8cc5[_0x13c8('0x47')]=[{'all':!![]}];}return db[_0x13c8('0xd7')][_0x13c8('0xaa')](_0x3e8cc5);})[_0x13c8('0x16')](function(_0x4295cd){_0x250487[_0x13c8('0x4b')]=_0x4295cd;return _0x250487;});}})[_0x13c8('0x16')](respondWithFilteredResult(_0x6f94c3,_0x3e8cc5))[_0x13c8('0x57')](handleError(_0x6f94c3,null));};exports[_0x13c8('0xd9')]=function(_0x46399a,_0x3b595a){var _0x10f975={'raw':!![],'where':{}};var _0x50bbcb={};var _0x48ca7b={'count':0x0,'rows':[]};return db[_0x13c8('0x40')]['findOne']({'where':{'id':_0x46399a['params']['id']}})[_0x13c8('0x16')](handleEntityNotFound(_0x3b595a,null))['then'](function(_0x34b4a9){if(_0x34b4a9){_0x50bbcb[_0x13c8('0x59')]=_[_0x13c8('0x5a')](db[_0x13c8('0xda')][_0x13c8('0x41')]);_0x50bbcb[_0x13c8('0x4c')]=_[_0x13c8('0x5a')](_0x46399a[_0x13c8('0x4c')]);_0x50bbcb[_0x13c8('0xc5')]=_[_0x13c8('0x5b')](_0x50bbcb[_0x13c8('0x59')],_0x50bbcb[_0x13c8('0x4c')]);_0x10f975[_0x13c8('0x4a')]=_['intersection'](_0x50bbcb['model'],qs[_0x13c8('0x5c')](_0x46399a[_0x13c8('0x4c')]['fields']));_0x10f975[_0x13c8('0x4a')]=_0x10f975[_0x13c8('0x4a')][_0x13c8('0x4e')]?_0x10f975[_0x13c8('0x4a')]:_0x50bbcb[_0x13c8('0x59')];if(!_0x46399a[_0x13c8('0x4c')][_0x13c8('0xc9')](_0x13c8('0xd0'))){_0x10f975[_0x13c8('0x26')]=qs[_0x13c8('0x26')](_0x46399a[_0x13c8('0x4c')]['limit']);_0x10f975[_0x13c8('0x24')]=qs[_0x13c8('0x24')](_0x46399a[_0x13c8('0x4c')][_0x13c8('0x24')]);}_0x10f975['order']=qs[_0x13c8('0xc7')](_0x46399a[_0x13c8('0x4c')]['sort']);_0x10f975['where']=qs['filters'](_['pick'](_0x46399a[_0x13c8('0x4c')],_0x50bbcb[_0x13c8('0xc5')]));_0x10f975[_0x13c8('0xc8')][_0x13c8('0xd8')]=_0x34b4a9['id'];if(_0x46399a[_0x13c8('0x4c')][_0x13c8('0x36')]){_0x10f975['where']=_[_0x13c8('0x5e')](_0x10f975[_0x13c8('0xc8')],{'$or':_[_0x13c8('0x37')](_0x10f975['attributes'],function(_0x5793e7){var _0xad4e75={};_0xad4e75[_0x5793e7]={'$like':'%'+_0x46399a[_0x13c8('0x4c')][_0x13c8('0x36')]+'%'};return _0xad4e75;})});}_0x10f975=_[_0x13c8('0x5e')]({},_0x10f975,_0x46399a[_0x13c8('0x5f')]);return db['ScreenRecording'][_0x13c8('0x27')]({'where':_0x10f975['where']})[_0x13c8('0x16')](function(_0x708a7d){_0x48ca7b[_0x13c8('0x27')]=_0x708a7d;if(_0x46399a[_0x13c8('0x4c')][_0x13c8('0x46')]){_0x10f975['include']=[{'all':!![]}];}return db[_0x13c8('0xda')]['findAll'](_0x10f975);})[_0x13c8('0x16')](function(_0xb37fb){_0x48ca7b[_0x13c8('0x4b')]=_0xb37fb;return _0x48ca7b;});}})['then'](respondWithFilteredResult(_0x3b595a,_0x10f975))[_0x13c8('0x57')](handleError(_0x3b595a,null));};exports[_0x13c8('0xdb')]=function(_0x222a1f,_0x4e243b){var _0x3d6f58={};var _0xb84447={};var _0x4e0d5a;var _0x3406f4;return db['User'][_0x13c8('0x96')]({'where':{'id':_0x222a1f['params']['id']}})[_0x13c8('0x16')](handleEntityNotFound(_0x4e243b,null))[_0x13c8('0x16')](function(_0x15dbcd){if(_0x15dbcd){_0x4e0d5a=_0x15dbcd;_0xb84447[_0x13c8('0x59')]=_[_0x13c8('0x5a')](db['ChatInteraction'][_0x13c8('0x41')]);_0xb84447['query']=_[_0x13c8('0x5a')](_0x222a1f[_0x13c8('0x4c')]);_0xb84447[_0x13c8('0xc5')]=_[_0x13c8('0x5b')](_0xb84447[_0x13c8('0x59')],_0xb84447[_0x13c8('0x4c')]);_0x3d6f58[_0x13c8('0x4a')]=_['intersection'](_0xb84447['model'],qs[_0x13c8('0x5c')](_0x222a1f[_0x13c8('0x4c')][_0x13c8('0x5c')]));_0x3d6f58['attributes']=_0x3d6f58[_0x13c8('0x4a')]['length']?_0x3d6f58[_0x13c8('0x4a')]:_0xb84447['model'];_0x3d6f58[_0x13c8('0xc6')]=qs[_0x13c8('0xc7')](_0x222a1f[_0x13c8('0x4c')][_0x13c8('0xc7')]);_0x3d6f58['where']=qs['filters'](_['pick'](_0x222a1f[_0x13c8('0x4c')],_0xb84447[_0x13c8('0xc5')]));if(_0x222a1f['query']['filter']){_0x3d6f58[_0x13c8('0xc8')]=_[_0x13c8('0x5e')](_0x3d6f58[_0x13c8('0xc8')],{'$or':_[_0x13c8('0x37')](_0x3d6f58[_0x13c8('0x4a')],function(_0x5ebd26){var _0x7934e={};_0x7934e[_0x5ebd26]={'$like':'%'+_0x222a1f[_0x13c8('0x4c')][_0x13c8('0x36')]+'%'};return _0x7934e;})});}_0x3d6f58=_['merge']({},_0x3d6f58,_0x222a1f['options']);return _0x4e0d5a[_0x13c8('0xdb')](_0x3d6f58);}})['then'](function(_0x190a06){if(_0x190a06){_0x3406f4=_0x190a06['length'];if(!_0x222a1f[_0x13c8('0x4c')][_0x13c8('0xc9')](_0x13c8('0xd0'))){_0x3d6f58[_0x13c8('0x26')]=qs['limit'](_0x222a1f[_0x13c8('0x4c')]['limit']);_0x3d6f58[_0x13c8('0x24')]=qs[_0x13c8('0x24')](_0x222a1f['query'][_0x13c8('0x24')]);}return _0x4e0d5a[_0x13c8('0xdb')](_0x3d6f58);}})['then'](function(_0x1852b3){if(_0x1852b3){return _0x1852b3?{'count':_0x3406f4,'rows':_0x1852b3}:null;}})[_0x13c8('0x16')](respondWithResult(_0x4e243b,null))[_0x13c8('0x57')](handleError(_0x4e243b,null));};exports['getOpenchannelInteractions']=function(_0x30fdf5,_0x4d4d03){var _0x1b422d={};var _0x19a9ed={};var _0x4c8315;var _0x10f44b;return db[_0x13c8('0x40')][_0x13c8('0x96')]({'where':{'id':_0x30fdf5[_0x13c8('0x62')]['id']}})[_0x13c8('0x16')](handleEntityNotFound(_0x4d4d03,null))['then'](function(_0x18c39d){if(_0x18c39d){_0x4c8315=_0x18c39d;_0x19a9ed[_0x13c8('0x59')]=_[_0x13c8('0x5a')](db['OpenchannelInteraction']['rawAttributes']);_0x19a9ed[_0x13c8('0x4c')]=_['keys'](_0x30fdf5[_0x13c8('0x4c')]);_0x19a9ed[_0x13c8('0xc5')]=_['intersection'](_0x19a9ed[_0x13c8('0x59')],_0x19a9ed[_0x13c8('0x4c')]);_0x1b422d['attributes']=_[_0x13c8('0x5b')](_0x19a9ed[_0x13c8('0x59')],qs['fields'](_0x30fdf5[_0x13c8('0x4c')]['fields']));_0x1b422d[_0x13c8('0x4a')]=_0x1b422d[_0x13c8('0x4a')][_0x13c8('0x4e')]?_0x1b422d[_0x13c8('0x4a')]:_0x19a9ed[_0x13c8('0x59')];_0x1b422d[_0x13c8('0xc6')]=qs[_0x13c8('0xc7')](_0x30fdf5['query']['sort']);_0x1b422d[_0x13c8('0xc8')]=qs['filters'](_[_0x13c8('0xd3')](_0x30fdf5[_0x13c8('0x4c')],_0x19a9ed[_0x13c8('0xc5')]));if(_0x30fdf5[_0x13c8('0x4c')][_0x13c8('0x36')]){_0x1b422d[_0x13c8('0xc8')]=_[_0x13c8('0x5e')](_0x1b422d['where'],{'$or':_[_0x13c8('0x37')](_0x1b422d[_0x13c8('0x4a')],function(_0x1402b6){var _0x4614c4={};_0x4614c4[_0x1402b6]={'$like':'%'+_0x30fdf5[_0x13c8('0x4c')][_0x13c8('0x36')]+'%'};return _0x4614c4;})});}_0x1b422d=_[_0x13c8('0x5e')]({},_0x1b422d,_0x30fdf5[_0x13c8('0x5f')]);return _0x4c8315[_0x13c8('0xdc')](_0x1b422d);}})[_0x13c8('0x16')](function(_0x115670){if(_0x115670){_0x10f44b=_0x115670[_0x13c8('0x4e')];if(!_0x30fdf5[_0x13c8('0x4c')][_0x13c8('0xc9')]('nolimit')){_0x1b422d[_0x13c8('0x26')]=qs[_0x13c8('0x26')](_0x30fdf5[_0x13c8('0x4c')]['limit']);_0x1b422d[_0x13c8('0x24')]=qs[_0x13c8('0x24')](_0x30fdf5['query'][_0x13c8('0x24')]);}return _0x4c8315[_0x13c8('0xdc')](_0x1b422d);}})['then'](function(_0x561704){if(_0x561704){return _0x561704?{'count':_0x10f44b,'rows':_0x561704}:null;}})[_0x13c8('0x16')](respondWithResult(_0x4d4d03,null))[_0x13c8('0x57')](handleError(_0x4d4d03,null));};exports[_0x13c8('0xdd')]=function(_0x4e5bc1,_0x19b3b5){var _0xf34897={'raw':!![],'where':{}};var _0x351331={};var _0x184613={'count':0x0,'rows':[]};return db['User'][_0x13c8('0x96')]({'where':{'id':_0x4e5bc1[_0x13c8('0x62')]['id']}})[_0x13c8('0x16')](handleEntityNotFound(_0x19b3b5,null))[_0x13c8('0x16')](function(_0x3268a5){if(_0x3268a5){_0x351331[_0x13c8('0x59')]=_[_0x13c8('0x5a')](db['MailInteraction'][_0x13c8('0x41')]);_0x351331[_0x13c8('0x4c')]=_['keys'](_0x4e5bc1[_0x13c8('0x4c')]);_0x351331[_0x13c8('0xc5')]=_[_0x13c8('0x5b')](_0x351331[_0x13c8('0x59')],_0x351331[_0x13c8('0x4c')]);_0xf34897['attributes']=_[_0x13c8('0x5b')](_0x351331[_0x13c8('0x59')],qs[_0x13c8('0x5c')](_0x4e5bc1['query'][_0x13c8('0x5c')]));_0xf34897[_0x13c8('0x4a')]=_0xf34897[_0x13c8('0x4a')][_0x13c8('0x4e')]?_0xf34897[_0x13c8('0x4a')]:_0x351331[_0x13c8('0x59')];if(!_0x4e5bc1[_0x13c8('0x4c')][_0x13c8('0xc9')]('nolimit')){_0xf34897[_0x13c8('0x26')]=qs['limit'](_0x4e5bc1['query'][_0x13c8('0x26')]);_0xf34897[_0x13c8('0x24')]=qs[_0x13c8('0x24')](_0x4e5bc1[_0x13c8('0x4c')][_0x13c8('0x24')]);}_0xf34897['order']=qs[_0x13c8('0xc7')](_0x4e5bc1[_0x13c8('0x4c')]['sort']);_0xf34897[_0x13c8('0xc8')]=qs['filters'](_[_0x13c8('0xd3')](_0x4e5bc1[_0x13c8('0x4c')],_0x351331['filters']));_0xf34897['where'][_0x13c8('0xd8')]=_0x3268a5['id'];if(_0x4e5bc1[_0x13c8('0x4c')][_0x13c8('0x36')]){_0xf34897[_0x13c8('0xc8')]=_[_0x13c8('0x5e')](_0xf34897[_0x13c8('0xc8')],{'$or':_['map'](_0xf34897[_0x13c8('0x4a')],function(_0x232589){var _0x375c9e={};_0x375c9e[_0x232589]={'$like':'%'+_0x4e5bc1[_0x13c8('0x4c')][_0x13c8('0x36')]+'%'};return _0x375c9e;})});}_0xf34897=_[_0x13c8('0x5e')]({},_0xf34897,_0x4e5bc1[_0x13c8('0x5f')]);return db[_0x13c8('0xde')][_0x13c8('0x27')]({'where':_0xf34897[_0x13c8('0xc8')]})[_0x13c8('0x16')](function(_0x54b36f){_0x184613[_0x13c8('0x27')]=_0x54b36f;if(_0x4e5bc1[_0x13c8('0x4c')][_0x13c8('0x46')]){_0xf34897[_0x13c8('0x47')]=[{'all':!![]}];}return db[_0x13c8('0xde')][_0x13c8('0xaa')](_0xf34897);})[_0x13c8('0x16')](function(_0x4164bd){_0x184613[_0x13c8('0x4b')]=_0x4164bd;return _0x184613;});}})['then'](respondWithFilteredResult(_0x19b3b5,_0xf34897))['catch'](handleError(_0x19b3b5,null));};exports[_0x13c8('0xdf')]=function(_0x41086d,_0x4bb072){var _0x3ccbf4={};var _0x5d2c58={};var _0x1d0c15;var _0x263786;return db['User'][_0x13c8('0x96')]({'where':{'id':_0x41086d[_0x13c8('0x62')]['id']}})[_0x13c8('0x16')](handleEntityNotFound(_0x4bb072,null))['then'](function(_0x24f3a8){if(_0x24f3a8){_0x1d0c15=_0x24f3a8;_0x5d2c58['model']=_[_0x13c8('0x5a')](db[_0x13c8('0xe0')]['rawAttributes']);_0x5d2c58['query']=_['keys'](_0x41086d['query']);_0x5d2c58[_0x13c8('0xc5')]=_[_0x13c8('0x5b')](_0x5d2c58[_0x13c8('0x59')],_0x5d2c58[_0x13c8('0x4c')]);_0x3ccbf4[_0x13c8('0x4a')]=_[_0x13c8('0x5b')](_0x5d2c58[_0x13c8('0x59')],qs['fields'](_0x41086d[_0x13c8('0x4c')]['fields']));_0x3ccbf4[_0x13c8('0x4a')]=_0x3ccbf4[_0x13c8('0x4a')][_0x13c8('0x4e')]?_0x3ccbf4[_0x13c8('0x4a')]:_0x5d2c58['model'];_0x3ccbf4['order']=qs[_0x13c8('0xc7')](_0x41086d[_0x13c8('0x4c')][_0x13c8('0xc7')]);_0x3ccbf4['where']=qs[_0x13c8('0xc5')](_[_0x13c8('0xd3')](_0x41086d['query'],_0x5d2c58[_0x13c8('0xc5')]));if(_0x41086d[_0x13c8('0x4c')][_0x13c8('0x36')]){_0x3ccbf4[_0x13c8('0xc8')]=_[_0x13c8('0x5e')](_0x3ccbf4[_0x13c8('0xc8')],{'$or':_[_0x13c8('0x37')](_0x3ccbf4[_0x13c8('0x4a')],function(_0x28dbd6){var _0x5a3847={};_0x5a3847[_0x28dbd6]={'$like':'%'+_0x41086d[_0x13c8('0x4c')][_0x13c8('0x36')]+'%'};return _0x5a3847;})});}_0x3ccbf4=_[_0x13c8('0x5e')]({},_0x3ccbf4,_0x41086d[_0x13c8('0x5f')]);return _0x1d0c15['getSmsInteractions'](_0x3ccbf4);}})[_0x13c8('0x16')](function(_0x79241a){if(_0x79241a){_0x263786=_0x79241a[_0x13c8('0x4e')];if(!_0x41086d['query'][_0x13c8('0xc9')](_0x13c8('0xd0'))){_0x3ccbf4[_0x13c8('0x26')]=qs['limit'](_0x41086d[_0x13c8('0x4c')][_0x13c8('0x26')]);_0x3ccbf4[_0x13c8('0x24')]=qs[_0x13c8('0x24')](_0x41086d[_0x13c8('0x4c')]['offset']);}return _0x1d0c15['getSmsInteractions'](_0x3ccbf4);}})['then'](function(_0x3687b2){if(_0x3687b2){return _0x3687b2?{'count':_0x263786,'rows':_0x3687b2}:null;}})['then'](respondWithResult(_0x4bb072,null))[_0x13c8('0x57')](handleError(_0x4bb072,null));};exports[_0x13c8('0xe1')]=function(_0x462885,_0x527d17){var _0x5b676b={};var _0x336e48={};var _0x588f8d;var _0x2fde54;return db['User'][_0x13c8('0x96')]({'where':{'id':_0x462885[_0x13c8('0x62')]['id']}})['then'](handleEntityNotFound(_0x527d17,null))[_0x13c8('0x16')](function(_0x487ab0){if(_0x487ab0){_0x588f8d=_0x487ab0;_0x336e48[_0x13c8('0x59')]=_[_0x13c8('0x5a')](db[_0x13c8('0xe2')][_0x13c8('0x41')]);_0x336e48[_0x13c8('0x4c')]=_[_0x13c8('0x5a')](_0x462885['query']);_0x336e48[_0x13c8('0xc5')]=_['intersection'](_0x336e48[_0x13c8('0x59')],_0x336e48[_0x13c8('0x4c')]);_0x5b676b[_0x13c8('0x4a')]=_[_0x13c8('0x5b')](_0x336e48[_0x13c8('0x59')],qs['fields'](_0x462885['query'][_0x13c8('0x5c')]));_0x5b676b['attributes']=_0x5b676b[_0x13c8('0x4a')]['length']?_0x5b676b[_0x13c8('0x4a')]:_0x336e48[_0x13c8('0x59')];_0x5b676b[_0x13c8('0xc6')]=qs[_0x13c8('0xc7')](_0x462885['query'][_0x13c8('0xc7')]);_0x5b676b[_0x13c8('0xc8')]=qs[_0x13c8('0xc5')](_[_0x13c8('0xd3')](_0x462885['query'],_0x336e48[_0x13c8('0xc5')]));if(_0x462885['query'][_0x13c8('0x36')]){_0x5b676b['where']=_['merge'](_0x5b676b[_0x13c8('0xc8')],{'$or':_[_0x13c8('0x37')](_0x5b676b['attributes'],function(_0x259189){var _0xb53e6a={};_0xb53e6a[_0x259189]={'$like':'%'+_0x462885[_0x13c8('0x4c')][_0x13c8('0x36')]+'%'};return _0xb53e6a;})});}_0x5b676b=_[_0x13c8('0x5e')]({},_0x5b676b,_0x462885[_0x13c8('0x5f')]);return _0x588f8d['getFaxInteractions'](_0x5b676b);}})[_0x13c8('0x16')](function(_0x3e73a5){if(_0x3e73a5){_0x2fde54=_0x3e73a5[_0x13c8('0x4e')];if(!_0x462885[_0x13c8('0x4c')][_0x13c8('0xc9')](_0x13c8('0xd0'))){_0x5b676b[_0x13c8('0x26')]=qs[_0x13c8('0x26')](_0x462885['query'][_0x13c8('0x26')]);_0x5b676b[_0x13c8('0x24')]=qs[_0x13c8('0x24')](_0x462885['query'][_0x13c8('0x24')]);}return _0x588f8d['getFaxInteractions'](_0x5b676b);}})[_0x13c8('0x16')](function(_0x572ddc){if(_0x572ddc){return _0x572ddc?{'count':_0x2fde54,'rows':_0x572ddc}:null;}})[_0x13c8('0x16')](respondWithResult(_0x527d17,null))[_0x13c8('0x57')](handleError(_0x527d17,null));};exports[_0x13c8('0xe3')]=function(_0x553a15,_0x4e9b4a){var _0x449eb9={};var _0x22a249={};var _0x1f3842;var _0x1e429b;return db[_0x13c8('0x40')][_0x13c8('0x96')]({'where':{'id':_0x553a15['params']['id']}})[_0x13c8('0x16')](handleEntityNotFound(_0x4e9b4a,null))[_0x13c8('0x16')](function(_0x4817ae){if(_0x4817ae){_0x1f3842=_0x4817ae;_0x22a249[_0x13c8('0x59')]=_[_0x13c8('0x5a')](db[_0x13c8('0xe4')]['rawAttributes']);_0x22a249[_0x13c8('0x4c')]=_[_0x13c8('0x5a')](_0x553a15[_0x13c8('0x4c')]);_0x22a249[_0x13c8('0xc5')]=_[_0x13c8('0x5b')](_0x22a249[_0x13c8('0x59')],_0x22a249[_0x13c8('0x4c')]);_0x449eb9[_0x13c8('0x4a')]=_[_0x13c8('0x5b')](_0x22a249['model'],qs[_0x13c8('0x5c')](_0x553a15['query'][_0x13c8('0x5c')]));_0x449eb9[_0x13c8('0x4a')]=_0x449eb9[_0x13c8('0x4a')]['length']?_0x449eb9[_0x13c8('0x4a')]:_0x22a249[_0x13c8('0x59')];_0x449eb9[_0x13c8('0xc6')]=qs['sort'](_0x553a15[_0x13c8('0x4c')][_0x13c8('0xc7')]);_0x449eb9[_0x13c8('0xc8')]=qs['filters'](_['pick'](_0x553a15[_0x13c8('0x4c')],_0x22a249[_0x13c8('0xc5')]));if(_0x553a15[_0x13c8('0x4c')][_0x13c8('0x36')]){_0x449eb9[_0x13c8('0xc8')]=_['merge'](_0x449eb9['where'],{'$or':_[_0x13c8('0x37')](_0x449eb9[_0x13c8('0x4a')],function(_0x209809){var _0x49e772={};_0x49e772[_0x209809]={'$like':'%'+_0x553a15[_0x13c8('0x4c')]['filter']+'%'};return _0x49e772;})});}_0x449eb9=_[_0x13c8('0x5e')]({},_0x449eb9,_0x553a15[_0x13c8('0x5f')]);return _0x1f3842[_0x13c8('0xe3')](_0x449eb9);}})[_0x13c8('0x16')](function(_0x4a7b95){if(_0x4a7b95){_0x1e429b=_0x4a7b95[_0x13c8('0x4e')];if(!_0x553a15[_0x13c8('0x4c')]['hasOwnProperty']('nolimit')){_0x449eb9[_0x13c8('0x26')]=qs[_0x13c8('0x26')](_0x553a15['query'][_0x13c8('0x26')]);_0x449eb9['offset']=qs[_0x13c8('0x24')](_0x553a15[_0x13c8('0x4c')][_0x13c8('0x24')]);}return _0x1f3842[_0x13c8('0xe3')](_0x449eb9);}})[_0x13c8('0x16')](function(_0x58f73f){if(_0x58f73f){return _0x58f73f?{'count':_0x1e429b,'rows':_0x58f73f}:null;}})[_0x13c8('0x16')](respondWithResult(_0x4e9b4a,null))[_0x13c8('0x57')](handleError(_0x4e9b4a,null));};exports[_0x13c8('0xe5')]=function(_0x31d89a,_0x4c1cf1,_0x32bde1){var _0x41ce5c;var _0xea206b;var _0x264565;var _0x546235=!_[_0x13c8('0x6a')](_0x31d89a[_0x13c8('0x62')]['id'])?_0x31d89a[_0x13c8('0x62')]['id']:!_[_0x13c8('0x6a')](_0x31d89a[_0x13c8('0x31')]['id'])?_0x31d89a['user']['id']:null;return db[_0x13c8('0x40')][_0x13c8('0x61')]({'where':{'id':_0x546235,'role':{'$or':[_0x13c8('0x7f'),'user',_0x13c8('0x33')]}},'attributes':['id',_0x13c8('0x3b'),_0x13c8('0xe6'),_0x13c8('0xe7'),_0x13c8('0x3a'),'internal',_0x13c8('0xe8')]})[_0x13c8('0x16')](function(_0x3664bc){if(_0x3664bc){if(_0x3664bc[_0x13c8('0x3a')]==='agent'){_0x41ce5c=_0x3664bc;if(_0x31d89a[_0x13c8('0x60')][_0x13c8('0x9f')]){_0x264565=util[_0x13c8('0xab')]('LOCAL/%s@from-sip/n',_0x41ce5c[_0x31d89a[_0x13c8('0x60')][_0x13c8('0x9f')]]);}else if(_0x31d89a[_0x13c8('0x60')][_0x13c8('0xe9')]){_0x264565=util[_0x13c8('0xab')](_0x13c8('0xac'),_0x31d89a[_0x13c8('0x60')][_0x13c8('0xe9')]);}else{_0x264565=util['format']('SIP/%s',_0x41ce5c[_0x13c8('0x3b')]);}socket['to'](util['format'](_0x13c8('0xea'),_0x41ce5c[_0x13c8('0x3b')]))[_0x13c8('0x2c')](_0x13c8('0xeb'),{'user':{'id':_0x41ce5c['id'],'name':_0x41ce5c['name']},'ip':_0x31d89a['headers']['x-forwarded-for']||_0x31d89a[_0x13c8('0xec')][_0x13c8('0xed')]||_0x31d89a[_0x13c8('0xee')][_0x13c8('0xed')]||_0x31d89a[_0x13c8('0xec')]['socket'][_0x13c8('0xed')]});return db[_0x13c8('0xad')]['destroy']({'where':{'membername':_0x41ce5c[_0x13c8('0x3b')]},'individualHooks':!![]});}}else{throw new db[(_0x13c8('0x8f'))][(_0x13c8('0x90'))](_0x13c8('0xef'));}})[_0x13c8('0x16')](function(){if(_0x41ce5c){return _0x41ce5c['getVoiceQueues']({'raw':!![]});}})[_0x13c8('0x16')](function(_0x33a459){if(_0x41ce5c){if(_0x33a459){_0xea206b=_0x33a459;if(_0xea206b[_0x13c8('0x4e')]){var _0x22ba54=_0xea206b[_0x13c8('0x37')](function(_0x1b2c46){var _0x5f050d={'membername':_0x41ce5c[_0x13c8('0x3b')],'UserId':_0x41ce5c['id'],'queue_name':_0x1b2c46['name'],'VoiceQueueId':_0x1b2c46['id'],'interface':_0x264565,'paused':_0x41ce5c['loginInPause']||![],'penalty':_0x1b2c46[_0x13c8('0xf0')]||0x0};return db['UserVoiceQueueRt'][_0x13c8('0xf1')](_0x5f050d);});return Promise[_0x13c8('0x56')](_0x22ba54);}}}})['then'](function(){if(_0x41ce5c){return db[_0x13c8('0xf2')][_0x13c8('0xaa')]({'where':{'membername':_0x41ce5c[_0x13c8('0x3b')],'exitAt':null}});}})[_0x13c8('0x16')](function(_0x3aa204){if(_0x41ce5c){var _0x20159e=[];_0x3aa204[_0x13c8('0xf3')](function(_0x4c4011){_0x20159e[_0x13c8('0x4f')](_0x4c4011[_0x13c8('0x2b')]({'exitAt':moment()[_0x13c8('0xab')](_0x13c8('0xf4'))}));});return Promise[_0x13c8('0x56')](_0x20159e);}})['then'](function(){if(_0x41ce5c){var _0x518b4f=[];var _0x137d9a=[];var _0x5ee503=utils[_0x13c8('0xf5')]();var _0x4fe9ff={'membername':_0x41ce5c[_0x13c8('0x3b')],'interface':_0x264565,'enterAt':moment()[_0x13c8('0xab')](_0x13c8('0xf4')),'role':_0x41ce5c[_0x13c8('0x3a')],'internal':_0x41ce5c[_0x13c8('0x68')]};_0x5ee503[_0x13c8('0xf3')](function(_0x2a91a3){_0x518b4f['push'](_['merge']({'channel':_0x2a91a3,'type':'LOGIN','data1':_0x31d89a[_0x13c8('0x60')]['device'],'data2':_0x264565},_0x4fe9ff));if(_0x41ce5c[_0x13c8('0xe8')]){_0x137d9a['push'](_[_0x13c8('0x5e')]({'channel':_0x2a91a3,'type':'PAUSE','data1':_0x13c8('0xf6')},_0x4fe9ff));}});return db[_0x13c8('0xf2')][_0x13c8('0x88')](_0x518b4f[_0x13c8('0xc2')](_0x137d9a),{'individualHooks':!![]});}})[_0x13c8('0x16')](function(){if(_0x41ce5c){return _0x41ce5c[_0x13c8('0x2b')]({'online':!![],'lastLoginAt':moment()['format'](_0x13c8('0xf4')),'voicePause':_0x41ce5c[_0x13c8('0xe8')]||![],'mailPause':_0x41ce5c[_0x13c8('0xe8')]||![],'chatPause':_0x41ce5c[_0x13c8('0xe8')]||![],'faxPause':_0x41ce5c[_0x13c8('0xe8')]||![],'smsPause':_0x41ce5c[_0x13c8('0xe8')]||![],'openchannelPause':_0x41ce5c[_0x13c8('0xe8')]||![],'whatsappPause':_0x41ce5c[_0x13c8('0xe8')]||![],'pauseType':_0x41ce5c[_0x13c8('0xe8')]?_0x13c8('0xf6'):null,'interface':_0x264565,'lastPauseAt':moment()[_0x13c8('0xab')](_0x13c8('0xf4'))});}})['then'](function(_0x3df0fd){if(_0x31d89a['isMiddleware']){return _0x32bde1();}else{return Promise[_0x13c8('0xf7')](_0x3df0fd)['then'](respondWithResult(_0x4c1cf1,null));}})[_0x13c8('0x57')](handleError(_0x4c1cf1,null));};exports[_0x13c8('0xf8')]=function(_0x50fbaf,_0x280436){var _0x2e22f7;return db[_0x13c8('0x40')][_0x13c8('0x61')]({'where':{'id':_0x50fbaf[_0x13c8('0x62')]['id'],'role':_0x13c8('0x33')},'attributes':['id','name',_0x13c8('0x3a')]})[_0x13c8('0x16')](handleEntityNotFound(_0x280436,null))['then'](function(_0x5b6274){if(_0x5b6274){_0x2e22f7=_0x5b6274;return db[_0x13c8('0xad')][_0x13c8('0x2e')]({'where':{'membername':_0x2e22f7[_0x13c8('0x3b')]},'individualHooks':!![]});}})['then'](function(){return db[_0x13c8('0xf2')][_0x13c8('0xaa')]({'where':{'membername':_0x2e22f7[_0x13c8('0x3b')],'exitAt':null}});})[_0x13c8('0x16')](function(_0x4e700e){var _0x5e92c2=[];_0x4e700e[_0x13c8('0xf3')](function(_0x6bbcc2){_0x5e92c2['push'](_0x6bbcc2[_0x13c8('0x2b')]({'exitAt':moment()[_0x13c8('0xab')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x13c8('0x56')](_0x5e92c2);})['then'](function(){return _0x2e22f7[_0x13c8('0x2b')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x13c8('0x16')](respondWithResult(_0x280436,null))[_0x13c8('0x57')](handleError(_0x280436,null));};exports[_0x13c8('0xf9')]=function(_0x216ad9,_0x47272d){var _0x1b7b92;return db['UserVoiceQueueRt'][_0x13c8('0x2b')]({'paused':0x1},{'where':{'UserId':_0x216ad9['params']['id']},'individualHooks':!![]})[_0x13c8('0x16')](function(){return db['User'][_0x13c8('0x61')]({'where':{'id':_0x216ad9[_0x13c8('0x62')]['id'],'role':_0x13c8('0x33')},'attributes':['id',_0x13c8('0x3b'),_0x13c8('0x3a'),_0x13c8('0x68'),_0x13c8('0x9f'),'online']});})['then'](handleEntityNotFound(_0x47272d,null))['then'](function(_0x204028){if(_0x204028){_0x1b7b92=_0x204028;return respondWithRpcPromise(_0x13c8('0xfa'),_0x13c8('0xf9'),{'id':_0x1b7b92['id'],'name':_0x1b7b92[_0x13c8('0x3b')],'pause':!![]});}})['then'](function(){if(_0x1b7b92){return db[_0x13c8('0xf2')][_0x13c8('0xaa')]({'where':{'membername':_0x1b7b92[_0x13c8('0x3b')],'type':_0x13c8('0xfb'),'exitAt':null}});}})[_0x13c8('0x16')](function(_0x1a467a){if(_0x1a467a[_0x13c8('0x4e')]){var _0x3bb29f=moment()[_0x13c8('0xab')](_0x13c8('0xf4'));for(var _0x454142=0x0,_0x48cdfd=_0x1a467a[_0x13c8('0x4e')];_0x454142<_0x48cdfd;_0x454142++){_0x1a467a[_0x454142]['updateAttributes']({'exitAt':_0x3bb29f});}}})[_0x13c8('0x16')](function(){var _0x38a372=[];var _0x143a4e=utils[_0x13c8('0xf5')]();_0x143a4e[_0x13c8('0xf3')](function(_0x4035c6){_0x38a372['push']({'channel':_0x4035c6,'membername':_0x1b7b92['name'],'interface':_[_0x13c8('0x6a')](_0x1b7b92['interface'])?util[_0x13c8('0xab')]('SIP/%s',_0x1b7b92[_0x13c8('0x3b')]):_0x1b7b92[_0x13c8('0x9f')],'type':_0x13c8('0xfb'),'enterAt':moment()[_0x13c8('0xab')](_0x13c8('0xf4')),'data1':_0x216ad9[_0x13c8('0x60')]['type']||_0x13c8('0xfc'),'role':_0x1b7b92[_0x13c8('0x3a')],'internal':_0x1b7b92[_0x13c8('0x68')]});});return db[_0x13c8('0xf2')][_0x13c8('0x88')](_0x38a372,{'individualHooks':!![]});})[_0x13c8('0x16')](function(){return _0x1b7b92[_0x13c8('0x2b')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x216ad9['body']['type']||_0x13c8('0xfc'),'lastPauseAt':moment()[_0x13c8('0xab')](_0x13c8('0xf4'))});})[_0x13c8('0x16')](respondWithResult(_0x47272d,null))[_0x13c8('0x57')](handleError(_0x47272d,null));};exports[_0x13c8('0xfd')]=function(_0x51ed92,_0x6004bd){if(_0x51ed92['body'][_0x13c8('0x9c')]&&!utils[_0x13c8('0xa0')](_0x51ed92[_0x13c8('0x60')][_0x13c8('0x9c')])){throw new APIBadRequestError(util[_0x13c8('0xab')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x51ed92['body'][_0x13c8('0x9c')]));}return db[_0x13c8('0x40')]['find']({'where':{'id':_0x51ed92[_0x13c8('0x62')]['id']},'attributes':['id',_0x13c8('0x3b'),'role','internal','interface','online',_0x13c8('0x9e'),_0x13c8('0xfe'),'chatPause',_0x13c8('0xff'),'openchannelPause',_0x13c8('0x100'),_0x13c8('0x101'),_0x13c8('0x102'),_0x13c8('0x103')]})[_0x13c8('0x16')](function(_0x421b12){if(!_0x421b12){throw new APINotFoundError(util[_0x13c8('0xab')]('User\x20with\x20id\x20%s\x20not\x20found',_0x51ed92[_0x13c8('0x62')]['id']));}return _0x421b12[_0x13c8('0xfd')](_0x51ed92[_0x13c8('0x60')][_0x13c8('0x9c')]);})[_0x13c8('0x16')](respondWithResult(_0x6004bd,null))['catch'](APIHandleError(_0x6004bd));};exports[_0x13c8('0x104')]=function(_0x5b4d36,_0x5bbb1e){var _0x4e2aee={};var _0x285737={};var _0x19bda3;var _0xd5b838;return db[_0x13c8('0x40')][_0x13c8('0x96')]({'where':{'id':_0x5b4d36[_0x13c8('0x62')]['id']}})[_0x13c8('0x16')](handleEntityNotFound(_0x5bbb1e,null))[_0x13c8('0x16')](function(_0x48af62){if(_0x48af62){_0x19bda3=_0x48af62;_0x285737[_0x13c8('0x59')]=_[_0x13c8('0x5a')](db[_0x13c8('0x105')][_0x13c8('0x41')]);_0x285737[_0x13c8('0x4c')]=_[_0x13c8('0x5a')](_0x5b4d36['query']);_0x285737[_0x13c8('0xc5')]=_['intersection'](_0x285737['model'],_0x285737[_0x13c8('0x4c')]);_0x4e2aee[_0x13c8('0x4a')]=_[_0x13c8('0x5b')](_0x285737[_0x13c8('0x59')],qs[_0x13c8('0x5c')](_0x5b4d36[_0x13c8('0x4c')][_0x13c8('0x5c')]));_0x4e2aee[_0x13c8('0x4a')]=_0x4e2aee[_0x13c8('0x4a')]['length']?_0x4e2aee[_0x13c8('0x4a')]:_0x285737[_0x13c8('0x59')];_0x4e2aee[_0x13c8('0xc6')]=qs[_0x13c8('0xc7')](_0x5b4d36['query'][_0x13c8('0xc7')]);_0x4e2aee['where']=qs['filters'](_[_0x13c8('0xd3')](_0x5b4d36[_0x13c8('0x4c')],_0x285737['filters']));if(_0x5b4d36[_0x13c8('0x4c')][_0x13c8('0x36')]){_0x4e2aee['where']=_[_0x13c8('0x5e')](_0x4e2aee[_0x13c8('0xc8')],{'$or':_[_0x13c8('0x37')](_0x4e2aee['attributes'],function(_0x408604){var _0x57a32e={};_0x57a32e[_0x408604]={'$like':'%'+_0x5b4d36[_0x13c8('0x4c')]['filter']+'%'};return _0x57a32e;})});}_0x4e2aee=_['merge']({},_0x4e2aee,_0x5b4d36[_0x13c8('0x5f')]);return _0x19bda3[_0x13c8('0x104')](_0x4e2aee);}})['then'](function(_0x42cd65){if(_0x42cd65){_0xd5b838=_0x42cd65[_0x13c8('0x4e')];if(!_0x5b4d36['query'][_0x13c8('0xc9')](_0x13c8('0xd0'))){_0x4e2aee[_0x13c8('0x26')]=qs[_0x13c8('0x26')](_0x5b4d36[_0x13c8('0x4c')][_0x13c8('0x26')]);_0x4e2aee['offset']=qs[_0x13c8('0x24')](_0x5b4d36[_0x13c8('0x4c')][_0x13c8('0x24')]);}return _0x19bda3[_0x13c8('0x104')](_0x4e2aee);}})[_0x13c8('0x16')](function(_0x381774){if(_0x381774){return _0x381774?{'count':_0xd5b838,'rows':_0x381774}:null;}})['then'](respondWithResult(_0x5bbb1e,null))[_0x13c8('0x57')](handleError(_0x5bbb1e,null));};exports[_0x13c8('0x106')]=function(_0x58a204,_0x4c5aab){var _0x306a7b=_0x58a204[_0x13c8('0x62')]['id'];var _0x38219a=_0x58a204[_0x13c8('0x60')]?_0x58a204[_0x13c8('0x60')][_0x13c8('0x65')]:null;var _0x771a50=[];return Promise[_0x13c8('0xf7')]()['then'](function(){if(!_0x38219a)throw new APIBadRequestError(_0x13c8('0x107'));})[_0x13c8('0x16')](function(){return db[_0x13c8('0x40')][_0x13c8('0x96')]({'where':{'id':_0x306a7b}});})[_0x13c8('0x16')](function(_0x5184a7){if(!_0x5184a7)throw new APINotFoundError(util['format'](_0x13c8('0x108'),_0x58a204[_0x13c8('0x62')]['id']));return db[_0x13c8('0x6b')][_0x13c8('0x109')](function(_0x20645d){return _0x5184a7[_0x13c8('0x106')](_0x38219a,{'transaction':_0x20645d})[_0x13c8('0x16')](function(){return db[_0x13c8('0x105')][_0x13c8('0xaa')]({'where':{'id':{'$in':_0x38219a}}});})[_0x13c8('0x16')](function(_0x3fdd79){var _0x266a1a=_[_0x13c8('0x37')](_0x3fdd79,function(_0x5b2111){return _0x5b2111[_0x13c8('0x10a')]();});return Promise[_0x13c8('0x56')](_0x266a1a);})[_0x13c8('0x16')](function(_0x16c745){_0x771a50=_['flattenDeep'](_0x16c745);var _0x3c5b6f=_[_0x13c8('0x37')](_0x771a50,function(_0x23813a){return _0x23813a[_0x13c8('0x10b')](_0x5184a7['id'],{'transaction':_0x20645d});});return Promise['all'](_0x3c5b6f);})[_0x13c8('0x16')](function(){if(!_0x5184a7['online'])return;var _0x533f6e=_[_0x13c8('0x36')](_0x771a50,function(_0x4b5949){return _0x4b5949[_0x13c8('0x10c')](_0x13c8('0x9c'))==='Voice';});var _0x5549ee=_['map'](_0x533f6e,function(_0x36f4f9){return db['UserVoiceQueueRt'][_0x13c8('0xf1')]({'membername':_0x5184a7['name'],'UserId':_0x5184a7['id'],'queue_name':_0x36f4f9[_0x13c8('0x3b')],'VoiceQueueId':_0x36f4f9['id'],'interface':_['isNil'](_0x5184a7[_0x13c8('0x9f')])?util['format']('SIP/%s',_0x5184a7[_0x13c8('0x3b')]):_0x5184a7[_0x13c8('0x9f')],'paused':_0x5184a7[_0x13c8('0x9e')]||![],'penalty':_0x5184a7['penalty']},{'transaction':_0x20645d});});return Promise[_0x13c8('0x56')](_0x5549ee);})[_0x13c8('0x16')](function(){return db[_0x13c8('0x10d')][_0x13c8('0xaa')]({'where':{'teamId':{'$in':_0x38219a}}});})[_0x13c8('0x16')](function(_0x217bd1){var _0x322402=_[_0x13c8('0x37')](_0x217bd1,function(_0x4a692c){return db['UserVoicePrefix'][_0x13c8('0x7d')]({'UserId':_0x5184a7['id'],'VoicePrefixId':_0x4a692c['VoicePrefixId']},{'transaction':_0x20645d});});return Promise['all'](_0x322402);});});})[_0x13c8('0x16')](function(){for(var _0x146df1=0x0;_0x146df1<_0x771a50[_0x13c8('0x4e')];_0x146df1++){var _0x2fb8e5=_0x771a50[_0x146df1]['getDataValue']('channel');var _0x227472=_0x2fb8e5+_0x13c8('0xb1');socket[_0x13c8('0x2c')]('user'+_0x2fb8e5+_0x13c8('0x10e'),{'UserId':_0x306a7b,['queueField']:_0x771a50[_0x146df1]['id']});}})[_0x13c8('0x16')](respondWithStatusCode(_0x4c5aab,null))[_0x13c8('0x57')](APIHandleError(_0x4c5aab));};exports[_0x13c8('0x10f')]=function(_0x5d36dd,_0x2fd733){var _0xd6ad=_0x5d36dd[_0x13c8('0x62')]['id'];var _0x47e9c1=null;if(_0x5d36dd[_0x13c8('0x4c')][_0x13c8('0x65')]){_0x47e9c1=_[_0x13c8('0xaf')](_0x5d36dd[_0x13c8('0x4c')][_0x13c8('0x65')])?_0x5d36dd[_0x13c8('0x4c')]['ids']:[_0x5d36dd[_0x13c8('0x4c')][_0x13c8('0x65')]];}var _0xc27d2d=[];return Promise[_0x13c8('0xf7')]()[_0x13c8('0x16')](function(){if(!_0x47e9c1)throw new APIBadRequestError(_0x13c8('0x110'));})[_0x13c8('0x16')](function(){return db[_0x13c8('0x40')][_0x13c8('0x96')]({'where':{'id':_0xd6ad}});})['then'](function(_0x243db7){if(!_0x243db7)throw new APINotFoundError(util[_0x13c8('0xab')](_0x13c8('0x108'),_0x5d36dd[_0x13c8('0x62')]['id']));return db[_0x13c8('0x6b')][_0x13c8('0x109')](function(_0xc8a01d){return _0x243db7['removeTeams'](_0x47e9c1,{'transaction':_0xc8a01d})[_0x13c8('0x16')](function(){return db[_0x13c8('0x105')][_0x13c8('0xaa')]({'where':{'id':{'$in':_0x47e9c1}}});})['then'](function(_0x478d4f){var _0x28ec06=_['map'](_0x478d4f,function(_0x133c19){return _0x133c19['getAssociatedQueues']();});return Promise[_0x13c8('0x56')](_0x28ec06);})[_0x13c8('0x16')](function(_0x1c134a){_0xc27d2d=_[_0x13c8('0x111')](_0x1c134a);var _0x51e233=_[_0x13c8('0x37')](_0xc27d2d,function(_0x1f3ff0){return _0x1f3ff0[_0x13c8('0x112')](_0x243db7['id'],{'transaction':_0xc8a01d});});return Promise['all'](_0x51e233);})[_0x13c8('0x16')](function(){if(!_0x243db7[_0x13c8('0x9d')])return;var _0x53701a=_[_0x13c8('0x36')](_0xc27d2d,function(_0x19eddf){return _0x19eddf[_0x13c8('0x10c')](_0x13c8('0x9c'))==='Voice';});var _0x4ccff8=_[_0x13c8('0x37')](_0x53701a,function(_0x2b9ef6){return db[_0x13c8('0xad')][_0x13c8('0x2e')]({'where':{'VoiceQueueId':_0x2b9ef6['id'],'UserId':_0x243db7['id']},'transaction':_0xc8a01d});});return Promise[_0x13c8('0x56')](_0x4ccff8);})['then'](function(){return db[_0x13c8('0x10d')][_0x13c8('0xaa')]({'where':{'teamId':{'$in':_0x47e9c1}}});})['then'](function(_0x36d4e4){var _0x549950=_[_0x13c8('0x37')](_0x36d4e4,function(_0x377b83){return db[_0x13c8('0x113')][_0x13c8('0x2e')]({'where':{'UserId':_0x243db7['id'],'VoicePrefixId':_0x377b83[_0x13c8('0x114')]}},{'transaction':_0xc8a01d});});return Promise['all'](_0x549950);});});})['then'](function(){for(var _0x385594=0x0;_0x385594<_0xc27d2d['length'];_0x385594++){var _0xf017c=_0xc27d2d[_0x385594]['getDataValue'](_0x13c8('0x9c'));var _0x1e540b=_0xf017c+_0x13c8('0xb1');socket['emit'](_0x13c8('0x31')+_0xf017c+'Queue:remove',{'UserId':_0xd6ad,['queueField']:_0xc27d2d[_0x385594]['id']});}})['then'](respondWithStatusCode(_0x2fd733,null))[_0x13c8('0x57')](APIHandleError(_0x2fd733));};exports[_0x13c8('0x115')]=function(_0x189f24,_0xa4c331){var _0x1f0e86={};var _0x4d0be5={};var _0xe748c;var _0x2aa4ee;return db[_0x13c8('0x40')]['findOne']({'where':{'id':_0x189f24[_0x13c8('0x62')]['id']}})[_0x13c8('0x16')](handleEntityNotFound(_0xa4c331,null))['then'](function(_0x57dfad){if(_0x57dfad){_0xe748c=_0x57dfad;_0x4d0be5[_0x13c8('0x59')]=_[_0x13c8('0x5a')](db['CmList']['rawAttributes']);_0x4d0be5[_0x13c8('0x4c')]=_['keys'](_0x189f24['query']);_0x4d0be5['filters']=_['intersection'](_0x4d0be5['model'],_0x4d0be5[_0x13c8('0x4c')]);_0x1f0e86['attributes']=_[_0x13c8('0x5b')](_0x4d0be5[_0x13c8('0x59')],qs['fields'](_0x189f24['query'][_0x13c8('0x5c')]));_0x1f0e86['attributes']=_0x1f0e86[_0x13c8('0x4a')][_0x13c8('0x4e')]?_0x1f0e86[_0x13c8('0x4a')]:_0x4d0be5[_0x13c8('0x59')];_0x1f0e86[_0x13c8('0xc6')]=qs['sort'](_0x189f24[_0x13c8('0x4c')]['sort']);_0x1f0e86[_0x13c8('0xc8')]=qs[_0x13c8('0xc5')](_['pick'](_0x189f24['query'],_0x4d0be5[_0x13c8('0xc5')]));if(_0x189f24[_0x13c8('0x4c')][_0x13c8('0x36')]){_0x1f0e86[_0x13c8('0xc8')]=_[_0x13c8('0x5e')](_0x1f0e86[_0x13c8('0xc8')],{'$or':_[_0x13c8('0x37')](_0x1f0e86['attributes'],function(_0x3694fb){var _0x3f3899={};_0x3f3899[_0x3694fb]={'$like':'%'+_0x189f24[_0x13c8('0x4c')][_0x13c8('0x36')]+'%'};return _0x3f3899;})});}_0x1f0e86=_[_0x13c8('0x5e')]({},_0x1f0e86,_0x189f24[_0x13c8('0x5f')]);return _0xe748c['getLists'](_0x1f0e86);}})['then'](function(_0x265df4){if(_0x265df4){_0x2aa4ee=_0x265df4[_0x13c8('0x4e')];if(!_0x189f24[_0x13c8('0x4c')]['hasOwnProperty'](_0x13c8('0xd0'))){_0x1f0e86['limit']=qs[_0x13c8('0x26')](_0x189f24['query'][_0x13c8('0x26')]);_0x1f0e86[_0x13c8('0x24')]=qs['offset'](_0x189f24[_0x13c8('0x4c')][_0x13c8('0x24')]);}return _0xe748c[_0x13c8('0x115')](_0x1f0e86);}})[_0x13c8('0x16')](function(_0x57ec41){if(_0x57ec41){return _0x57ec41?{'count':_0x2aa4ee,'rows':_0x57ec41}:null;}})['then'](respondWithResult(_0xa4c331,null))['catch'](handleError(_0xa4c331,null));};exports[_0x13c8('0x116')]=function(_0x55d3b1,_0x149a22){var _0x1bb63f={};var _0x57147c={};var _0x251454;return db[_0x13c8('0x40')][_0x13c8('0x96')]({'where':{'id':_0x55d3b1['params']['id']}})['then'](handleEntityNotFound(_0x149a22,null))['then'](function(_0x395d83){if(_0x395d83){_0x251454=_0x395d83;_0x57147c['model']=_[_0x13c8('0x5a')](db['User']['rawAttributes']);_0x57147c[_0x13c8('0x4c')]=_['keys'](_0x55d3b1[_0x13c8('0x4c')]);_0x57147c[_0x13c8('0xc5')]=_[_0x13c8('0x5b')](_0x57147c[_0x13c8('0x59')],_0x57147c[_0x13c8('0x4c')]);_0x1bb63f[_0x13c8('0x4a')]=_[_0x13c8('0x5b')](_0x57147c[_0x13c8('0x59')],qs[_0x13c8('0x5c')](_0x55d3b1['query'][_0x13c8('0x5c')]));_0x1bb63f[_0x13c8('0x4a')]=_0x1bb63f[_0x13c8('0x4a')][_0x13c8('0x4e')]?_0x1bb63f['attributes']:_0x57147c[_0x13c8('0x59')];_0x1bb63f[_0x13c8('0xc6')]=qs[_0x13c8('0xc7')](_0x55d3b1[_0x13c8('0x4c')][_0x13c8('0xc7')]);_0x1bb63f[_0x13c8('0xc8')]=qs[_0x13c8('0xc5')](_[_0x13c8('0xd3')](_0x55d3b1[_0x13c8('0x4c')],_0x57147c[_0x13c8('0xc5')]));if(_0x55d3b1[_0x13c8('0x4c')][_0x13c8('0x36')]){_0x1bb63f[_0x13c8('0xc8')]=_[_0x13c8('0x5e')](_0x1bb63f[_0x13c8('0xc8')],{'$or':_['map'](_0x1bb63f[_0x13c8('0x4a')],function(_0x5d0a83){var _0x1fcee6={};_0x1fcee6[_0x5d0a83]={'$like':'%'+_0x55d3b1[_0x13c8('0x4c')][_0x13c8('0x36')]+'%'};return _0x1fcee6;})});}_0x1bb63f['model']=db[_0x13c8('0x40')];_0x1bb63f['as']='Agents';_0x1bb63f=_[_0x13c8('0x5e')]({},_0x1bb63f,_0x55d3b1[_0x13c8('0x5f')]);return _0x251454[_0x13c8('0x117')]({'include':[_0x1bb63f]});}})['then'](function(_0x356a3b){if(_0x356a3b){var _0x57cea9={},_0xb6708d=[];for(var _0x5cbc40=0x0;_0x5cbc40<_0x356a3b[_0x13c8('0x4e')];_0x5cbc40+=0x1){for(var _0x111515=0x0,_0x4bcd38;_0x111515<_0x356a3b[_0x5cbc40][_0x13c8('0x32')][_0x13c8('0x4e')];_0x111515+=0x1){_0x4bcd38=_0x356a3b[_0x5cbc40]['Agents'][_0x111515][_0x13c8('0x2f')]({'plain':!![]});_0x57cea9[_0x4bcd38['id']]=_0x4bcd38;}}_0x57cea9=_[_0x13c8('0x118')](_0x57cea9);for(var _0x28fece=qs['offset'](_0x55d3b1[_0x13c8('0x4c')][_0x13c8('0x24')]);_0x28fece<_0x57cea9[_0x13c8('0x4e')]&&_0xb6708d[_0x13c8('0x4e')]=_0x3690d2){_0x2ca7db=_0x3690d2;_0x5635db=0xc8;}else{_0x5635db=0xce;}_0x282b4f[_0x8f8b('0x23')](_0x5635db);return _0x282b4f['set'](_0x8f8b('0x2a'),_0x3452f3+'-'+_0x2ca7db+'/'+_0x3690d2)['json'](_0x304c7f);}return null;};}function saveUpdates(_0x2d15cf){return function(_0x4e8fd4){if(_0x4e8fd4){return _0x4e8fd4[_0x8f8b('0x2b')](_0x2d15cf)[_0x8f8b('0x16')](function(_0x3208df){if(_0x3208df[_0x8f8b('0x2c')]===_0x8f8b('0x2d')){socket[_0x8f8b('0x2e')](_0x8f8b('0x2f')+_0x3208df['id'],_0x3208df);}return _0x3208df;});}return null;};}function removeEntity(_0x5c6730){return function(_0x20632d){if(_0x20632d){return _0x20632d[_0x8f8b('0x30')]()[_0x8f8b('0x16')](function(){var _0x241635=_0x20632d[_0x8f8b('0x31')]({'plain':!![]});if(_0x241635[_0x8f8b('0x2c')]===_0x8f8b('0x32'))return;var _0x559e6e=[{'name':'Users','value':_0x8f8b('0x33'),'ignore':!![]},{'name':'Agents','value':_0x8f8b('0x2d'),'ignore':![]},{'name':_0x8f8b('0x34'),'value':_0x8f8b('0x35'),'ignore':![]}];var _0x2756fd=_(_0x559e6e)[_0x8f8b('0x36')]('ignore')[_0x8f8b('0x37')](_0x8f8b('0x38'))['value']();if(_['includes'](_0x2756fd,_0x241635[_0x8f8b('0x2c')])){return;}var _0x54048d=_[_0x8f8b('0x39')](_0x559e6e,['value',_0x241635[_0x8f8b('0x2c')]])[_0x8f8b('0x3a')];return db[_0x8f8b('0x3b')][_0x8f8b('0x30')]({'where':{'type':_0x54048d,'resourceId':_0x241635['id']}})[_0x8f8b('0x16')](function(){return _0x20632d;});})[_0x8f8b('0x16')](function(){_0x5c6730[_0x8f8b('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cb46b){return function(_0x1b680b){if(!_0x1b680b){_0x5cb46b[_0x8f8b('0x22')](0x194);}return _0x1b680b;};}function handleError(_0x325a1a,_0x51f2b5){_0x51f2b5=_0x51f2b5||0x1f4;return function(_0x1ef778){logger[_0x8f8b('0x1d')](_0x1ef778[_0x8f8b('0x3c')]);if(_0x1ef778[_0x8f8b('0x3a')]){delete _0x1ef778[_0x8f8b('0x3a')];}_0x325a1a[_0x8f8b('0x23')](_0x51f2b5)[_0x8f8b('0x3d')](_0x1ef778);};}exports['index']=function(_0x52b5ff,_0xdedb6f){var _0x52d3b0={},_0x32a424={'count':0x0,'rows':[]};var _0x37e321=_(db[_0x8f8b('0x3e')][_0x8f8b('0x3f')])[_0x8f8b('0x37')](function(_0x4bd751){return{'name':_0x4bd751['fieldName'],'type':_0x4bd751['type'][_0x8f8b('0x40')]};})[_0x8f8b('0x36')](function(_0x42dc8f){return!_[_0x8f8b('0x41')]([_0x8f8b('0x42'),_0x8f8b('0x43')],_0x42dc8f[_0x8f8b('0x3a')]);})['value']();_0x52d3b0=qs[_0x8f8b('0x44')](_0x37e321,_0x52b5ff);var _0x1b6e00={'where':_0x52d3b0[_0x8f8b('0x45')]};return db[_0x8f8b('0x3e')][_0x8f8b('0x29')](_0x1b6e00)[_0x8f8b('0x16')](function(_0x11bbf4){_0x32a424[_0x8f8b('0x29')]=_0x11bbf4;if(_0x52b5ff['query'][_0x8f8b('0x46')]){_0x52d3b0['include']=[{'all':!![]}];}if(_0x52b5ff[_0x8f8b('0x47')]['userSetting']===_0x8f8b('0x48')){_0x52d3b0['include']=[{'model':db['UserSetting'],'as':_0x8f8b('0x49')}];}if(!_[_0x8f8b('0x41')](_0x52d3b0['attributes'],'id')){_0x52d3b0[_0x8f8b('0x4a')]['push']('id');}return db[_0x8f8b('0x3e')]['findAll'](_0x52d3b0);})[_0x8f8b('0x16')](function(_0x56ad0a){_0x32a424[_0x8f8b('0x4b')]=_0x56ad0a;if(_0x52b5ff[_0x8f8b('0x47')][_0x8f8b('0x4c')]===_0x8f8b('0x48')){var _0x5a9cdc=[];for(var _0x2a70f3=0x0;_0x2a70f3<_0x32a424['rows']['length'];_0x2a70f3++){_0x5a9cdc[_0x8f8b('0x4d')](get_open_tabs(_0x8f8b('0x4e'),_0x32a424['rows'][_0x2a70f3][_0x8f8b('0x4f')]));_0x5a9cdc[_0x8f8b('0x4d')](get_open_tabs('sms',_0x32a424[_0x8f8b('0x4b')][_0x2a70f3][_0x8f8b('0x4f')]));_0x5a9cdc[_0x8f8b('0x4d')](get_open_tabs('fax',_0x32a424[_0x8f8b('0x4b')][_0x2a70f3][_0x8f8b('0x4f')]));_0x5a9cdc[_0x8f8b('0x4d')](get_open_tabs(_0x8f8b('0x50'),_0x32a424[_0x8f8b('0x4b')][_0x2a70f3][_0x8f8b('0x4f')]));_0x5a9cdc[_0x8f8b('0x4d')](get_open_tabs('openchannel',_0x32a424[_0x8f8b('0x4b')][_0x2a70f3][_0x8f8b('0x4f')]));_0x5a9cdc['push'](get_open_tabs('whatsapp',_0x32a424[_0x8f8b('0x4b')][_0x2a70f3][_0x8f8b('0x4f')]));}return Promise[_0x8f8b('0x51')](_0x5a9cdc)[_0x8f8b('0x16')](function(){return _0x32a424;});}else{return _0x32a424;}})[_0x8f8b('0x16')](respondWithFilteredResult(_0xdedb6f,_0x52d3b0))['catch'](handleError(_0xdedb6f,null));};exports[_0x8f8b('0x52')]=function(_0x2e24f9,_0x3a1869){var _0xde0c31={'raw':![],'where':{'id':_0x2e24f9[_0x8f8b('0x53')]['id']}},_0x496675={};_0x496675[_0x8f8b('0x54')]=_[_0x8f8b('0x55')](_[_0x8f8b('0x56')](db[_0x8f8b('0x3e')]['rawAttributes']),[_0x8f8b('0x42'),'salt']);_0x496675[_0x8f8b('0x47')]=_[_0x8f8b('0x56')](_0x2e24f9[_0x8f8b('0x47')]);_0x496675['filters']=_[_0x8f8b('0x57')](_0x496675[_0x8f8b('0x54')],_0x496675[_0x8f8b('0x47')]);_0xde0c31[_0x8f8b('0x4a')]=_['intersection'](_0x496675[_0x8f8b('0x54')],qs['fields'](_0x2e24f9['query']['fields']));_0xde0c31[_0x8f8b('0x4a')]=_0xde0c31[_0x8f8b('0x4a')][_0x8f8b('0x58')]?_0xde0c31['attributes']:_0x496675[_0x8f8b('0x54')];if(_0x2e24f9[_0x8f8b('0x47')]['includeAll']){_0xde0c31[_0x8f8b('0x59')]=[{'all':!![]}];}if(_0x2e24f9['query'][_0x8f8b('0x49')]===_0x8f8b('0x48')){_0xde0c31[_0x8f8b('0x59')]=[{'model':db[_0x8f8b('0x5a')],'as':_0x8f8b('0x49')}];}_0xde0c31=_['merge']({},_0xde0c31,_0x2e24f9[_0x8f8b('0x5b')]);if(!_['includes'](_0xde0c31[_0x8f8b('0x4a')],'id')){_0xde0c31[_0x8f8b('0x4a')][_0x8f8b('0x4d')]('id');}return db[_0x8f8b('0x3e')]['find'](_0xde0c31)[_0x8f8b('0x16')](handleEntityNotFound(_0x3a1869,null))['then'](function(_0x443c20){var _0x3a7768=[];values=_0x443c20;if(_0x2e24f9[_0x8f8b('0x47')]['openTabs']===_0x8f8b('0x48')){_0x3a7768[_0x8f8b('0x4d')](get_open_tabs(_0x8f8b('0x4e'),_0x443c20[_0x8f8b('0x4f')]));_0x3a7768[_0x8f8b('0x4d')](get_open_tabs(_0x8f8b('0x5c'),_0x443c20['dataValues']));_0x3a7768[_0x8f8b('0x4d')](get_open_tabs(_0x8f8b('0x5d'),_0x443c20[_0x8f8b('0x4f')]));_0x3a7768[_0x8f8b('0x4d')](get_open_tabs(_0x8f8b('0x5e'),_0x443c20[_0x8f8b('0x4f')]));_0x3a7768[_0x8f8b('0x4d')](get_open_tabs(_0x8f8b('0x5f'),_0x443c20[_0x8f8b('0x4f')]));_0x3a7768['push'](get_open_tabs(_0x8f8b('0x50'),_0x443c20['dataValues']));return Promise[_0x8f8b('0x51')](_0x3a7768);}else{return values;}})['then'](function(){return values;})[_0x8f8b('0x16')](respondWithResult(_0x3a1869,null))[_0x8f8b('0x21')](handleError(_0x3a1869,null));};exports[_0x8f8b('0x2b')]=function(_0x51c2a1,_0x34b77e){if(_0x51c2a1['body']['id']){delete _0x51c2a1[_0x8f8b('0x60')]['id'];}delete _0x51c2a1[_0x8f8b('0x60')][_0x8f8b('0x2c')];return db[_0x8f8b('0x3e')][_0x8f8b('0x39')]({'where':{'id':_0x51c2a1[_0x8f8b('0x53')]['id']}})[_0x8f8b('0x16')](handleEntityNotFound(_0x34b77e,null))[_0x8f8b('0x16')](saveUpdates(_0x51c2a1[_0x8f8b('0x60')],null))[_0x8f8b('0x16')](respondWithResult(_0x34b77e,null))['catch'](handleError(_0x34b77e,null));};exports[_0x8f8b('0x61')]=function(_0x1780ea,_0x52ba87){return db[_0x8f8b('0x3e')][_0x8f8b('0x61')]()[_0x8f8b('0x16')](respondWithResult(_0x52ba87,null))[_0x8f8b('0x21')](handleError(_0x52ba87,null));};exports[_0x8f8b('0x62')]=function(_0x497892,_0x190ebe){return db['User'][_0x8f8b('0x39')]({'where':{'id':_0x497892[_0x8f8b('0x53')]['id']}})[_0x8f8b('0x16')](handleEntityNotFound(_0x190ebe,null))[_0x8f8b('0x16')](function(_0xb945bc){if(_0xb945bc){return _0xb945bc[_0x8f8b('0x62')](_0x497892[_0x8f8b('0x60')][_0x8f8b('0x63')],_[_0x8f8b('0x64')](_0x497892[_0x8f8b('0x60')],['ids','id'])||{});}})[_0x8f8b('0x16')](respondWithResult(_0x190ebe,null))[_0x8f8b('0x21')](handleError(_0x190ebe,null));};function validateUser(_0xe1fa3a){return new Promise(function(_0x306db6,_0x4d416a){if(_0xe1fa3a[_0x8f8b('0x65')])return _0x306db6(_0xe1fa3a);return db['Setting'][_0x8f8b('0x66')](0x1)[_0x8f8b('0x16')](function(_0x796a9f){if(_0x796a9f[_0x8f8b('0x67')])authService['validatePasswordPattern'](_0xe1fa3a['password']);db['User']['max']('internal')[_0x8f8b('0x16')](function(_0x16628a){if(_[_0x8f8b('0x68')](_0x16628a)){_0xe1fa3a['internal']=_0x796a9f[_0x8f8b('0x69')]||0x1;return;}if(_[_0x8f8b('0x68')](_0x796a9f[_0x8f8b('0x69')])||_0x796a9f[_0x8f8b('0x69')]===_0x16628a){_0xe1fa3a[_0x8f8b('0x65')]=_0x16628a+0x1;return;}if(_0x796a9f[_0x8f8b('0x69')]>_0x16628a){_0xe1fa3a[_0x8f8b('0x65')]=_0x796a9f[_0x8f8b('0x69')];return;}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[_0x8f8b('0x6a')]['QueryTypes'][_0x8f8b('0x6b')]})['then'](function(_0x35193a){if(_0x35193a&&_0x35193a[_0x8f8b('0x58')]){for(var _0x15f3fd=0x0,_0x2efea0=_0x35193a[_0x8f8b('0x58')];_0x15f3fd<_0x2efea0&&_[_0x8f8b('0x68')](_0xe1fa3a[_0x8f8b('0x65')]);_0x15f3fd++){if(_0x796a9f[_0x8f8b('0x69')]<=_0x35193a[_0x15f3fd][_0x8f8b('0x6c')]){_0xe1fa3a[_0x8f8b('0x65')]=_0x35193a[_0x15f3fd]['from'];}else if(_0x796a9f[_0x8f8b('0x69')]>_0x35193a[_0x15f3fd]['from']&&_0x796a9f[_0x8f8b('0x69')]<=_0x35193a[_0x15f3fd]['to']){_0xe1fa3a[_0x8f8b('0x65')]=_0x796a9f[_0x8f8b('0x69')];}}}if(_[_0x8f8b('0x68')](_0xe1fa3a[_0x8f8b('0x65')])){_0xe1fa3a[_0x8f8b('0x65')]=_0x16628a+0x1;}return _0x306db6(_0xe1fa3a);});});})[_0x8f8b('0x21')](function(_0x4f0c43){_0x4d416a(_0x4f0c43);});});}function updateUser(_0x1e71e4){return new Promise(function(_0x44b78d,_0x4f4b7c){try{if(_0x1e71e4[_0x8f8b('0x6d')]){_0x1e71e4[_0x8f8b('0x6e')]=_0x1e71e4[_0x8f8b('0x65')];_0x1e71e4[_0x8f8b('0x6f')]={'mailbox':_0x1e71e4[_0x8f8b('0x65')],'password':_0x1e71e4[_0x8f8b('0x42')],'fullname':_0x1e71e4['fullname'],'email':_0x1e71e4['email']};}if(_0x1e71e4['role']===_0x8f8b('0x2d')){if(!_0x1e71e4[_0x8f8b('0x70')])_0x1e71e4[_0x8f8b('0x70')]=[_0x8f8b('0x71'),_0x8f8b('0x72'),'103',_0x8f8b('0x73'),_0x8f8b('0x74'),'104','105',_0x8f8b('0x75'),_0x8f8b('0x76'),'108',_0x8f8b('0x77'),'100',_0x8f8b('0x78'),_0x8f8b('0x79'),_0x8f8b('0x7a')];}_0x44b78d(_0x1e71e4);}catch(_0x3ef34d){_0x4f4b7c(_0x3ef34d);}});}exports[_0x8f8b('0x7b')]=function(_0x108f15,_0x4f4f89){if(_0x108f15[_0x8f8b('0x33')][_0x8f8b('0x2c')]==='agent')throw new Error('Unauthorized');if(_0x108f15[_0x8f8b('0x60')][_0x8f8b('0x2c')]===_0x8f8b('0x33')&&_0x108f15[_0x8f8b('0x33')][_0x8f8b('0x2c')]!==_0x8f8b('0x32')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x108f15[_0x8f8b('0x60')]['role']===_0x8f8b('0x32')&&_0x108f15[_0x8f8b('0x33')][_0x8f8b('0x2c')]!==_0x8f8b('0x32')){throw new Error(_0x8f8b('0x7c'));}return licenseUtil[_0x8f8b('0x7d')]([_0x108f15[_0x8f8b('0x60')]])[_0x8f8b('0x16')](function(){return validateUser(_0x108f15['body']);})['then'](function(_0x330ddb){return updateUser(_0x330ddb)['then'](function(_0x45c1de){if(_0x45c1de[_0x8f8b('0x2c')]==='admin'){_0x45c1de[_0x8f8b('0x7e')]=_0x108f15['user']['settingsEnabled'];delete _0x45c1de[_0x8f8b('0x7f')];}return _0x45c1de;});})['then'](function(_0x40b574){return db[_0x8f8b('0x3e')]['create'](_0x40b574,{'include':[{'model':db[_0x8f8b('0x6f')],'as':'VoiceMail'}]});})[_0x8f8b('0x16')](function(_0x3a5b79){if(_0x108f15[_0x8f8b('0x60')][_0x8f8b('0x2c')]==='user')return _0x3a5b79;if(_0x108f15[_0x8f8b('0x33')][_0x8f8b('0x2c')]!=='user')return _0x3a5b79;return db['UserProfileSection']['find']({'where':{'name':_0x3a5b79[_0x8f8b('0x2c')]===_0x8f8b('0x2d')?_0x8f8b('0x80'):'Telephones','userProfileId':_0x108f15['user'][_0x8f8b('0x7f')]},'raw':!![]})['then'](function(_0xa952b3){if(!_0xa952b3||_0xa952b3[_0x8f8b('0x81')]!=0x0)return _0x3a5b79;return db[_0x8f8b('0x3b')][_0x8f8b('0x7b')]({'name':_0x3a5b79[_0x8f8b('0x3a')],'resourceId':_0x3a5b79['id'],'type':_0xa952b3[_0x8f8b('0x3a')],'sectionId':_0xa952b3['id']},{})[_0x8f8b('0x16')](function(){return _0x3a5b79;});})['catch'](function(_0x58dab3){logger[_0x8f8b('0x1d')](_0x8f8b('0x82'),_0x58dab3);throw _0x58dab3;});})[_0x8f8b('0x16')](respondWithResult(_0x4f4f89,0xc9))['catch'](handleError(_0x4f4f89,null));};exports['bulkCreate']=function(_0x32e80d,_0x1eb177){var _0x1bd5aa=_0x32e80d[_0x8f8b('0x60')];var _0x46d29e=[];if(_0x32e80d['user'][_0x8f8b('0x2c')]===_0x8f8b('0x2d'))throw new Error(_0x8f8b('0x83'));if(_[_0x8f8b('0x84')](_0x1bd5aa,[_0x8f8b('0x2c'),'user'])&&_0x32e80d[_0x8f8b('0x33')][_0x8f8b('0x2c')]!==_0x8f8b('0x32')){throw new Error(_0x8f8b('0x85'));}if(_[_0x8f8b('0x84')](_0x1bd5aa,[_0x8f8b('0x2c'),_0x8f8b('0x32')])&&_0x32e80d['user']['role']!==_0x8f8b('0x32')){throw new Error(_0x8f8b('0x86'));}return licenseUtil[_0x8f8b('0x7d')](_0x1bd5aa)[_0x8f8b('0x16')](function(){return validateUser(_0x1bd5aa[0x0]);})[_0x8f8b('0x16')](function(){for(var _0x33aff5=0x1;_0x33aff5<_0x1bd5aa['length'];_0x33aff5++){var _0x2b178a=_0x1bd5aa[_0x33aff5-0x1]['internal'];if(!_0x1bd5aa[_0x33aff5][_0x8f8b('0x65')])_0x1bd5aa[_0x33aff5][_0x8f8b('0x65')]=_0x2b178a+0x1;_0x46d29e['push'](validateUser(_0x1bd5aa[_0x33aff5]));}return Promise[_0x8f8b('0x51')](_0x46d29e);})[_0x8f8b('0x16')](function(){_0x46d29e=[];for(var _0x135596=0x0;_0x135596<_0x1bd5aa['length'];_0x135596++){_0x46d29e[_0x8f8b('0x4d')](updateUser(_0x1bd5aa[_0x135596]));}return Promise[_0x8f8b('0x51')](_0x46d29e);})['then'](function(){_0x46d29e=_0x1bd5aa[_0x8f8b('0x37')](function(_0x3cd75d){return db['User'][_0x8f8b('0x7b')](_0x3cd75d,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]})[_0x8f8b('0x16')](function(_0x29c6d6){_0x3cd75d['id']=_0x29c6d6['id'];return _0x3cd75d;});});return Promise[_0x8f8b('0x51')](_0x46d29e);})['then'](function(_0x5c42b2){if(_0x32e80d[_0x8f8b('0x60')][_0x8f8b('0x2c')]===_0x8f8b('0x33'))return _0x5c42b2;if(_0x32e80d[_0x8f8b('0x33')]['role']!==_0x8f8b('0x33'))return _0x5c42b2;var _0x14d14a=_['some'](_0x5c42b2,function(_0x544878){return _0x544878[_0x8f8b('0x2c')]===_0x8f8b('0x2d')||_0x544878[_0x8f8b('0x2c')]===_0x8f8b('0x35');});if(!_0x14d14a)return _0x5c42b2;return db['UserProfileSection']['findAll']({'where':{'name':{'$or':['Agents','Telephones']},'userProfileId':_0x32e80d['user']['userProfileId']},'raw':!![]})[_0x8f8b('0x16')](function(_0x547d46){if(_[_0x8f8b('0x87')](_0x547d46)||!_[_0x8f8b('0x84')](_0x547d46,[_0x8f8b('0x81'),0x0]))return _0x5c42b2;_0x46d29e=[];var _0x23a099=_(_0x547d46)[_0x8f8b('0x37')](function(_0x5796b1){if(_0x5796b1[_0x8f8b('0x81')]===0x1)return;return _0x5796b1[_0x8f8b('0x3a')]===_0x8f8b('0x80')?_0x8f8b('0x2d'):'telephone';})[_0x8f8b('0x88')]()[_0x8f8b('0x38')]();for(var _0x4272a6=0x0;_0x4272a6<_0x5c42b2[_0x8f8b('0x58')];_0x4272a6++){if(!_[_0x8f8b('0x41')](_0x23a099,_0x5c42b2[_0x4272a6][_0x8f8b('0x2c')]))return;var _0x588b36=_0x5c42b2[_0x4272a6][_0x8f8b('0x2c')]===_0x8f8b('0x2d')?_0x8f8b('0x80'):_0x8f8b('0x34');_0x46d29e[_0x8f8b('0x4d')](db[_0x8f8b('0x3b')]['create']({'name':_0x5c42b2[_0x4272a6][_0x8f8b('0x3a')],'resourceId':_0x5c42b2[_0x4272a6]['id'],'type':_0x588b36,'sectionId':_[_0x8f8b('0x39')](_0x547d46,[_0x8f8b('0x3a'),_0x588b36])['id']},{}));}return Promise[_0x8f8b('0x51')](_0x46d29e);});})['then'](respondWithResult(_0x1eb177,0xc9))[_0x8f8b('0x21')](handleError(_0x1eb177,null));};exports[_0x8f8b('0x89')]=function(_0x4b08f1,_0x492501){if(_0x4b08f1[_0x8f8b('0x60')]['id']){delete _0x4b08f1[_0x8f8b('0x60')]['id'];}return db[_0x8f8b('0x3e')][_0x8f8b('0x39')]({'where':{'id':_0x4b08f1['params']['id']}})['then'](function(_0xde03dc){if(!_0xde03dc)return null;if(_0xde03dc['id']===_0x4b08f1[_0x8f8b('0x33')]['id']){if(!_0x4b08f1[_0x8f8b('0x60')][_0x8f8b('0x8a')]||!_0x4b08f1[_0x8f8b('0x60')]['newPassword']){throw new db[(_0x8f8b('0x8b'))][(_0x8f8b('0x8c'))](_0x8f8b('0x8d'));}if(!_0xde03dc[_0x8f8b('0x8e')](_0x4b08f1[_0x8f8b('0x60')][_0x8f8b('0x8a')])){throw new db['Sequelize']['ValidationError']('Wrong\x20credentials');}if(_0x4b08f1['body'][_0x8f8b('0x8a')]===_0x4b08f1[_0x8f8b('0x60')][_0x8f8b('0x8f')]){throw new db[(_0x8f8b('0x8b'))][(_0x8f8b('0x8c'))](_0x8f8b('0x90'));}}else if(_0x4b08f1[_0x8f8b('0x33')][_0x8f8b('0x2c')]===_0x8f8b('0x32')){if(!_0x4b08f1[_0x8f8b('0x60')][_0x8f8b('0x8f')]){throw new db[(_0x8f8b('0x8b'))]['ValidationError'](_0x8f8b('0x91'));}}else if(_0x4b08f1['user'][_0x8f8b('0x2c')]===_0x8f8b('0x33')){if(!_0x4b08f1[_0x8f8b('0x60')][_0x8f8b('0x8f')]){throw new db[(_0x8f8b('0x8b'))]['ValidationError'](_0x8f8b('0x91'));}if(_0xde03dc[_0x8f8b('0x2c')]!==_0x8f8b('0x2d')){throw new db[(_0x8f8b('0x8b'))]['ValidationError']('Unauthorized');}}else{throw new db[(_0x8f8b('0x8b'))]['ValidationError'](_0x8f8b('0x83'));}return _0xde03dc;})[_0x8f8b('0x16')](handleEntityNotFound(_0x492501,null))[_0x8f8b('0x16')](function(_0x169d51){return db[_0x8f8b('0x92')][_0x8f8b('0x93')]({'attributes':['id',_0x8f8b('0x67'),_0x8f8b('0x94'),_0x8f8b('0x95')]})[_0x8f8b('0x16')](function(_0x5d1e0b){if(_0x5d1e0b['securePassword'])authService[_0x8f8b('0x96')](_0x4b08f1[_0x8f8b('0x60')][_0x8f8b('0x8f')]);if(!_0x5d1e0b[_0x8f8b('0x94')]||!_0x169d51[_0x8f8b('0x97')])return _0x169d51;authService['validatePasswordHistory'](_0x4b08f1[_0x8f8b('0x60')][_0x8f8b('0x8f')],_0x169d51[_0x8f8b('0x97')],_0x5d1e0b[_0x8f8b('0x95')]);return _0x169d51;})[_0x8f8b('0x16')](saveUpdates({'password':_0x4b08f1[_0x8f8b('0x60')][_0x8f8b('0x8f')],'passwordResetAt':_0x4b08f1[_0x8f8b('0x33')]['id']==_0x4b08f1[_0x8f8b('0x53')]['id']?moment():null,'previousPasswords':authService[_0x8f8b('0x98')](_0x4b08f1[_0x8f8b('0x60')][_0x8f8b('0x8f')],_0x169d51[_0x8f8b('0x97')])},null));})[_0x8f8b('0x16')](respondWithResult(_0x492501,null))[_0x8f8b('0x21')](handleError(_0x492501,null));};exports[_0x8f8b('0x99')]=function(_0x185508,_0x51d13d){var _0x271fba=_0x185508[_0x8f8b('0x60')][_0x8f8b('0x9a')];return db[_0x8f8b('0x3e')][_0x8f8b('0x39')]({'where':{'id':_0x185508[_0x8f8b('0x53')]['id']},'attributes':['id',_0x8f8b('0x3a'),_0x8f8b('0x2c'),_0x8f8b('0x9b'),_0x8f8b('0x9c'),_0x8f8b('0x9d'),_0x8f8b('0x9e')]})[_0x8f8b('0x16')](handleEntityNotFound(_0x51d13d,null))[_0x8f8b('0x16')](function(_0x2a470c){if(_0x2a470c){if(!utils[_0x8f8b('0x9f')](_0x271fba)){throw new db['Sequelize'][(_0x8f8b('0x8c'))](_0x8f8b('0xa0'));}return _0x2a470c[_0x8f8b('0xa1')+_[_0x8f8b('0xa2')](_0x271fba['toLowerCase']())+'Queues'](_0x185508[_0x8f8b('0x60')]['ids'],{'penalty':_0x185508[_0x8f8b('0x60')][_0x8f8b('0xa3')]||0x0})[_0x8f8b('0xa4')](function(_0x4fafa3){for(var _0x29891f=0x0;_0x29891f<_0x185508['body'][_0x8f8b('0x63')][_0x8f8b('0x58')];_0x29891f+=0x1){var _0x248671={'UserId':Number(_0x185508[_0x8f8b('0x53')]['id'])};_0x248671[_[_0x8f8b('0xa2')](_0x271fba[_0x8f8b('0xa5')]())+_0x8f8b('0xa6')]=Number(_0x185508[_0x8f8b('0x60')][_0x8f8b('0x63')][_0x29891f]);socket['emit'](_0x8f8b('0x33')+_[_0x8f8b('0xa2')](_0x271fba['toLowerCase']())+_0x8f8b('0xa7'),_0x248671);}return _0x4fafa3;})[_0x8f8b('0x16')](function(){if(_0x271fba===_0x8f8b('0xa8')){return db[_0x8f8b('0xa9')][_0x8f8b('0xaa')]({'where':{'id':_0x185508[_0x8f8b('0x60')]['ids']||[]},'raw':!![],'attributes':['id',_0x8f8b('0x3a')]});}})[_0x8f8b('0x16')](function(_0x484ef0){var _0x5c130e=_0x2a470c[_0x8f8b('0x31')]({'plain':!![]});var _0x34c797=[];if(_0x271fba===_0x8f8b('0xa8')&&_0x5c130e[_0x8f8b('0x2c')]===_0x8f8b('0x2d')&&_0x5c130e[_0x8f8b('0x9b')]){for(let _0x2dc7ea=0x0;_0x2dc7ea<_0x484ef0['length'];_0x2dc7ea+=0x1){_0x34c797['push']({'membername':_0x5c130e['name'],'UserId':_0x5c130e['id'],'queue_name':_0x484ef0[_0x2dc7ea][_0x8f8b('0x3a')],'VoiceQueueId':_0x484ef0[_0x2dc7ea]['id'],'interface':_[_0x8f8b('0x68')](_0x5c130e[_0x8f8b('0x9e')])?util[_0x8f8b('0xab')]('SIP/%s',_0x5c130e[_0x8f8b('0x3a')]):_0x5c130e[_0x8f8b('0x9e')],'paused':_0x5c130e['voicePause']||![],'penalty':_0x185508['body'][_0x8f8b('0xa3')]||0x0});}return Promise[_0x8f8b('0x51')](_0x34c797[_0x8f8b('0x37')](function(_0x3497e7){return db['UserVoiceQueueRt'][_0x8f8b('0xac')](_0x3497e7);}));}return _0x2a470c;});}})['then'](respondWithStatusCode(_0x51d13d,null))[_0x8f8b('0x21')](handleError(_0x51d13d,null));};exports['removeQueues']=function(_0x466918,_0x344d99){var _0x5f2b7f,_0x114ee2;return db[_0x8f8b('0x3e')]['find']({'where':{'id':_0x466918[_0x8f8b('0x53')]['id']},'attributes':['id',_0x8f8b('0x3a'),_0x8f8b('0x2c')]})[_0x8f8b('0x16')](handleEntityNotFound(_0x344d99,null))['then'](function(_0xd8c98e){if(_0xd8c98e){_0x5f2b7f=_0xd8c98e;if(!_0x466918[_0x8f8b('0x47')][_0x8f8b('0x9a')]||!utils['isValidChannel'](_0x466918[_0x8f8b('0x47')][_0x8f8b('0x9a')])){throw new db['Sequelize'][(_0x8f8b('0x8c'))](_0x8f8b('0xa0'));}return _0xd8c98e[_0x8f8b('0xad')+_[_0x8f8b('0xa2')](_0x466918[_0x8f8b('0x47')][_0x8f8b('0x9a')][_0x8f8b('0xa5')]())+_0x8f8b('0xae')](_0x466918['query']['ids']);}})[_0x8f8b('0x16')](function(_0x3f998e){if(_[_0x8f8b('0xaf')](_0x466918['query'][_0x8f8b('0x63')])){for(var _0x563a33=0x0;_0x563a33<_0x466918[_0x8f8b('0x47')][_0x8f8b('0x63')][_0x8f8b('0x58')];_0x563a33+=0x1){_0x114ee2={'UserId':Number(_0x466918[_0x8f8b('0x53')]['id'])};_0x114ee2[_[_0x8f8b('0xa2')](_0x466918[_0x8f8b('0x47')][_0x8f8b('0x9a')][_0x8f8b('0xa5')]())+_0x8f8b('0xa6')]=Number(_0x466918[_0x8f8b('0x47')][_0x8f8b('0x63')][_0x563a33]);socket[_0x8f8b('0x2e')](_0x8f8b('0x33')+_[_0x8f8b('0xa2')](_0x466918[_0x8f8b('0x47')][_0x8f8b('0x9a')][_0x8f8b('0xa5')]())+'Queue:remove',_0x114ee2);}}else{_0x114ee2={'UserId':Number(_0x466918['params']['id'])};_0x114ee2[_[_0x8f8b('0xa2')](_0x466918['query'][_0x8f8b('0x9a')][_0x8f8b('0xa5')]())+'QueueId']=Number(_0x466918[_0x8f8b('0x47')][_0x8f8b('0x63')]);socket[_0x8f8b('0x2e')](_0x8f8b('0x33')+_[_0x8f8b('0xa2')](_0x466918[_0x8f8b('0x47')]['channel'][_0x8f8b('0xa5')]())+_0x8f8b('0xb0'),_0x114ee2);}return _0x3f998e;})[_0x8f8b('0x16')](function(){if(_0x466918['query'][_0x8f8b('0x9a')]===_0x8f8b('0xa8')){return db[_0x8f8b('0xb1')][_0x8f8b('0x30')]({'where':{'UserId':_0x466918[_0x8f8b('0x53')]['id'],'VoiceQueueId':_0x466918[_0x8f8b('0x47')]['ids']},'individualHooks':!![]})[_0x8f8b('0x16')](function(){return _0x5f2b7f;});}return _0x5f2b7f;})[_0x8f8b('0x16')](respondWithStatusCode(_0x344d99,null))[_0x8f8b('0x21')](handleError(_0x344d99,null));};exports['addAvatar']=function(_0x3c4eb9,_0x5865e0){_0x3c4eb9[_0x8f8b('0x60')][_0x8f8b('0xb2')]=_0x3c4eb9[_0x8f8b('0xb3')][_0x8f8b('0xb4')];return db[_0x8f8b('0x3e')][_0x8f8b('0x39')]({'where':{'id':_0x3c4eb9[_0x8f8b('0x53')]['id']}})[_0x8f8b('0x16')](handleEntityNotFound(_0x5865e0,null))['then'](saveUpdates(_0x3c4eb9['body'],null))[_0x8f8b('0x16')](respondWithResult(_0x5865e0,null))[_0x8f8b('0x21')](handleError(_0x5865e0,null));};exports[_0x8f8b('0xb5')]=function(_0x26ba32,_0x1bc737){var _0x27ad6d=path[_0x8f8b('0xb6')](config['root'],'server/files/images/logos/default_profile.png');return db['User']['find']({'where':{'id':_0x26ba32[_0x8f8b('0x53')]['id']},'attributes':['id',_0x8f8b('0xb2')],'raw':!![]})[_0x8f8b('0x16')](handleEntityNotFound(_0x1bc737,null))[_0x8f8b('0x16')](function(_0x46d15f){if(_0x46d15f){if(_['isNil'](_0x46d15f[_0x8f8b('0xb2')])){return _0x1bc737[_0x8f8b('0xb7')](_0x27ad6d);}else{if(!fs['existsSync'](path[_0x8f8b('0xb6')](config[_0x8f8b('0xb8')],_0x8f8b('0xb9'),_0x46d15f[_0x8f8b('0xb2')]))){return _0x1bc737[_0x8f8b('0xb7')](_0x27ad6d);}return _0x1bc737[_0x8f8b('0xb7')](path[_0x8f8b('0xb6')](config[_0x8f8b('0xb8')],_0x8f8b('0xb9'),_0x46d15f[_0x8f8b('0xb2')]));}}})[_0x8f8b('0x21')](handleError(_0x1bc737,null));};exports['getOpenTabs']=function(_0x3152cd,_0x5bce50){return db[_0x8f8b('0x3e')]['find']({'where':{'id':_0x3152cd[_0x8f8b('0x53')]['id']},'attributes':['id']})[_0x8f8b('0x16')](handleEntityNotFound(_0x5bce50,null))[_0x8f8b('0x16')](function(_0x12e375){var _0x16f98a=[];values=_0x12e375[_0x8f8b('0x4f')];_0x16f98a['push'](get_open_tabs(_0x8f8b('0x4e'),_0x12e375['dataValues']));_0x16f98a[_0x8f8b('0x4d')](get_open_tabs(_0x8f8b('0x5c'),_0x12e375[_0x8f8b('0x4f')]));_0x16f98a[_0x8f8b('0x4d')](get_open_tabs(_0x8f8b('0x5d'),_0x12e375[_0x8f8b('0x4f')]));_0x16f98a['push'](get_open_tabs(_0x8f8b('0x5e'),_0x12e375[_0x8f8b('0x4f')]));_0x16f98a[_0x8f8b('0x4d')](get_open_tabs('fax',_0x12e375[_0x8f8b('0x4f')]));_0x16f98a[_0x8f8b('0x4d')](get_open_tabs(_0x8f8b('0x50'),_0x12e375[_0x8f8b('0x4f')]));return Promise['all'](_0x16f98a);})['then'](function(_0x2886fa){if(_0x2886fa){var _0xb30a7f=_[_0x8f8b('0x37')](values['ChatOpenTabs'],function(_0x85f369){return{'channel':_0x8f8b('0xba'),'id':_0x85f369['id'],'createdAt':_0x85f369[_0x8f8b('0xbb')]};});var _0x5c4f3b=_[_0x8f8b('0x37')](values[_0x8f8b('0xbc')],function(_0x3a3737){return{'channel':'FAX','id':_0x3a3737['id'],'createdAt':_0x3a3737[_0x8f8b('0xbb')]};});var _0x4e6143=_[_0x8f8b('0x37')](values['OpenchannelOpenTabs'],function(_0x2fbf6d){return{'channel':_0x8f8b('0xbd'),'id':_0x2fbf6d['id'],'createdAt':_0x2fbf6d[_0x8f8b('0xbb')]};});var _0x48f4e4=_[_0x8f8b('0x37')](values['MailOpenTabs'],function(_0x324c5a){return{'channel':_0x8f8b('0xbe'),'id':_0x324c5a['id'],'createdAt':_0x324c5a[_0x8f8b('0xbb')]};});var _0x23671f=_[_0x8f8b('0x37')](values[_0x8f8b('0xbf')],function(_0x8ebd54){return{'channel':_0x8f8b('0xc0'),'id':_0x8ebd54['id'],'createdAt':_0x8ebd54[_0x8f8b('0xbb')]};});var _0x448c9b=_[_0x8f8b('0x37')](values[_0x8f8b('0xc1')],function(_0x1d67bb){return{'channel':'WHATSAPP','id':_0x1d67bb['id'],'createdAt':_0x1d67bb[_0x8f8b('0xbb')]};});var _0x506335=_[_0x8f8b('0xc2')](_0xb30a7f,_0x5c4f3b,_0x4e6143,_0x48f4e4,_0x23671f,_0x448c9b);var _0x3cf4b6={'count':_0x506335[_0x8f8b('0x58')],'rows':_0x506335};return _0x3cf4b6;}else return null;})['then'](respondWithResult(_0x5bce50,null))['catch'](handleError(_0x5bce50,null));};exports[_0x8f8b('0xc3')]=function(_0x5875fd,_0xa5cd40){var _0x1ea3b4={};var _0xea0295={};var _0x3f1da6;var _0x1c44e6;return db['User']['findOne']({'where':{'id':_0x5875fd[_0x8f8b('0x53')]['id']}})['then'](handleEntityNotFound(_0xa5cd40,null))['then'](function(_0x43c97d){if(_0x43c97d){_0x3f1da6=_0x43c97d;_0xea0295[_0x8f8b('0x54')]=_['keys'](db[_0x8f8b('0xc4')][_0x8f8b('0x3f')]);_0xea0295[_0x8f8b('0x47')]=_[_0x8f8b('0x56')](_0x5875fd[_0x8f8b('0x47')]);_0xea0295[_0x8f8b('0xc5')]=_['intersection'](_0xea0295[_0x8f8b('0x54')],_0xea0295['query']);_0x1ea3b4[_0x8f8b('0x4a')]=_[_0x8f8b('0x57')](_0xea0295[_0x8f8b('0x54')],qs[_0x8f8b('0xc6')](_0x5875fd[_0x8f8b('0x47')][_0x8f8b('0xc6')]));_0x1ea3b4[_0x8f8b('0x4a')]=_0x1ea3b4[_0x8f8b('0x4a')][_0x8f8b('0x58')]?_0x1ea3b4[_0x8f8b('0x4a')]:_0xea0295[_0x8f8b('0x54')];_0x1ea3b4[_0x8f8b('0xc7')]=qs[_0x8f8b('0xc8')](_0x5875fd['query'][_0x8f8b('0xc8')]);_0x1ea3b4[_0x8f8b('0x45')]=qs[_0x8f8b('0xc5')](_[_0x8f8b('0xc9')](_0x5875fd[_0x8f8b('0x47')],_0xea0295[_0x8f8b('0xc5')]));if(_0x5875fd[_0x8f8b('0x47')]['filter']){_0x1ea3b4[_0x8f8b('0x45')]=_[_0x8f8b('0xca')](_0x1ea3b4['where'],{'$or':_[_0x8f8b('0x37')](_0x1ea3b4[_0x8f8b('0x4a')],function(_0x1d70ab){var _0x360e5e={};_0x360e5e[_0x1d70ab]={'$like':'%'+_0x5875fd[_0x8f8b('0x47')]['filter']+'%'};return _0x360e5e;})});}_0x1ea3b4=_['merge']({},_0x1ea3b4,_0x5875fd[_0x8f8b('0x5b')]);return _0x3f1da6[_0x8f8b('0xc3')](_0x1ea3b4);}})['then'](function(_0x3e091a){if(_0x3e091a){_0x1c44e6=_0x3e091a[_0x8f8b('0x58')];if(_0x5875fd[_0x8f8b('0x47')][_0x8f8b('0xcb')](_0x8f8b('0x46'))){_0x1ea3b4[_0x8f8b('0x59')]=[{'model':db[_0x8f8b('0xcc')],'as':'List','required':![]},{'model':db[_0x8f8b('0xcd')],'as':_0x8f8b('0xce'),'attributes':['id',_0x8f8b('0x3a'),_0x8f8b('0xcf')],'where':_0x5875fd[_0x8f8b('0x47')][_0x8f8b('0xd0')]?{'id':_0x5875fd[_0x8f8b('0x47')][_0x8f8b('0xd0')]}:undefined,'required':_0x5875fd['query'][_0x8f8b('0xd0')]?!![]:![]}];}if(!_0x5875fd[_0x8f8b('0x47')][_0x8f8b('0xcb')](_0x8f8b('0xd1'))){_0x1ea3b4['limit']=qs['limit'](_0x5875fd['query'][_0x8f8b('0x27')]);_0x1ea3b4['offset']=qs[_0x8f8b('0x28')](_0x5875fd[_0x8f8b('0x47')][_0x8f8b('0x28')]);}return _0x3f1da6[_0x8f8b('0xc3')](_0x1ea3b4);}})[_0x8f8b('0x16')](function(_0x4d2c77){if(_0x4d2c77){return _0x4d2c77?{'count':_0x1c44e6,'rows':_0x4d2c77}:null;}})[_0x8f8b('0x16')](respondWithResult(_0xa5cd40,null))[_0x8f8b('0x21')](handleError(_0xa5cd40,null));};exports[_0x8f8b('0xd2')]=function(_0x2b42d2,_0x2b0ed1){var _0xf16c93;var _0x58f2e3={};var _0x209f97;return db[_0x8f8b('0x3e')]['findOne']({'where':{'id':_0x2b42d2[_0x8f8b('0x53')]['id']},'attributes':['id',_0x8f8b('0x3a'),_0x8f8b('0x2c')]})[_0x8f8b('0x16')](handleEntityNotFound(_0x2b0ed1,null))[_0x8f8b('0x16')](function(_0x31fa91){if(!utils['isValidChannel'](_0x2b42d2[_0x8f8b('0x47')]['channel'])){throw new db['Sequelize'][(_0x8f8b('0x8c'))](_0x8f8b('0xa0'));}_0xf16c93=_0x31fa91;var _0x7ae575={};_0x7ae575[_0x8f8b('0x54')]=_['keys'](db[_['capitalize'](_0x2b42d2[_0x8f8b('0x47')]['channel'])+'Queue'][_0x8f8b('0x3f')]);_0x7ae575[_0x8f8b('0x47')]=_[_0x8f8b('0x56')](_0x2b42d2[_0x8f8b('0x47')]);_0x7ae575[_0x8f8b('0xc5')]=_[_0x8f8b('0x57')](_0x7ae575[_0x8f8b('0x54')],_0x7ae575[_0x8f8b('0x47')]);_0x58f2e3[_0x8f8b('0x4a')]=_[_0x8f8b('0x57')](_0x7ae575['model'],qs['fields'](_0x2b42d2[_0x8f8b('0x47')][_0x8f8b('0xc6')]));_0x58f2e3[_0x8f8b('0x4a')]=_0x58f2e3['attributes'][_0x8f8b('0x58')]?_0x58f2e3[_0x8f8b('0x4a')]:_0x7ae575[_0x8f8b('0x54')];_0x58f2e3['order']=qs[_0x8f8b('0xc8')](_0x2b42d2[_0x8f8b('0x47')][_0x8f8b('0xc8')]);_0x58f2e3['where']=qs[_0x8f8b('0xc5')](_['pick'](_0x2b42d2[_0x8f8b('0x47')],_0x7ae575['filters']));if(_0x2b42d2[_0x8f8b('0x47')][_0x8f8b('0x36')]){_0x58f2e3['where']=_[_0x8f8b('0xca')](_0x58f2e3[_0x8f8b('0x45')],{'$or':_[_0x8f8b('0x37')](_0x58f2e3[_0x8f8b('0x4a')],function(_0x33db36){var _0xf8b0f6={};_0xf8b0f6[_0x33db36]={'$like':'%'+_0x2b42d2['query']['filter']+'%'};return _0xf8b0f6;})});}_0x58f2e3=_[_0x8f8b('0xca')]({},_0x58f2e3,_0x2b42d2[_0x8f8b('0x5b')]);switch(_0xf16c93['role']){case _0x8f8b('0x32'):return db[_[_0x8f8b('0xa2')](_0x2b42d2[_0x8f8b('0x47')]['channel'])+_0x8f8b('0xd3')]['findAll'](_0x58f2e3);case _0x8f8b('0x33'):case _0x8f8b('0x2d'):return _0xf16c93['get'+_[_0x8f8b('0xa2')](_0x2b42d2[_0x8f8b('0x47')]['channel'])+_0x8f8b('0xae')](_0x58f2e3);default:throw new db['Sequelize'][(_0x8f8b('0x8c'))](_0x8f8b('0xd4'));}})[_0x8f8b('0x16')](function(_0x329d4f){_0x209f97=_0x329d4f[_0x8f8b('0x58')];if(!_0x2b42d2[_0x8f8b('0x47')]['hasOwnProperty'](_0x8f8b('0xd1'))){_0x58f2e3[_0x8f8b('0x27')]=qs['limit'](_0x2b42d2[_0x8f8b('0x47')]['limit']);_0x58f2e3[_0x8f8b('0x28')]=qs[_0x8f8b('0x28')](_0x2b42d2['query']['offset']);}switch(_0xf16c93['role']){case _0x8f8b('0x32'):return db[_['capitalize'](_0x2b42d2[_0x8f8b('0x47')][_0x8f8b('0x9a')])+_0x8f8b('0xd3')][_0x8f8b('0xaa')](_0x58f2e3);case _0x8f8b('0x33'):case _0x8f8b('0x2d'):return _0xf16c93[_0x8f8b('0x31')+_[_0x8f8b('0xa2')](_0x2b42d2[_0x8f8b('0x47')][_0x8f8b('0x9a')])+'Queues'](_0x58f2e3);}})[_0x8f8b('0x16')](function(_0x8e964b){return{'count':_0x209f97,'rows':_0x8e964b};})['then'](respondWithResult(_0x2b0ed1,null))[_0x8f8b('0x21')](handleError(_0x2b0ed1,null));};exports[_0x8f8b('0xd5')]=function(_0x24e18a,_0x394b39){var _0x1b231b={};var _0x4772ff={};var _0x19f856;var _0x5a861c;return db['User'][_0x8f8b('0x93')]({'where':{'id':_0x24e18a['params']['id']}})[_0x8f8b('0x16')](handleEntityNotFound(_0x394b39,null))[_0x8f8b('0x16')](function(_0x2819ee){if(_0x2819ee){_0x19f856=_0x2819ee;_0x4772ff['model']=_['keys'](db[_0x8f8b('0xb1')][_0x8f8b('0x3f')]);_0x4772ff[_0x8f8b('0x47')]=_[_0x8f8b('0x56')](_0x24e18a[_0x8f8b('0x47')]);_0x4772ff[_0x8f8b('0xc5')]=_[_0x8f8b('0x57')](_0x4772ff['model'],_0x4772ff[_0x8f8b('0x47')]);_0x1b231b['attributes']=_[_0x8f8b('0x57')](_0x4772ff['model'],qs['fields'](_0x24e18a[_0x8f8b('0x47')][_0x8f8b('0xc6')]));_0x1b231b[_0x8f8b('0x4a')]=_0x1b231b['attributes']['length']?_0x1b231b['attributes']:_0x4772ff[_0x8f8b('0x54')];_0x1b231b[_0x8f8b('0xc7')]=qs[_0x8f8b('0xc8')](_0x24e18a['query'][_0x8f8b('0xc8')]);_0x1b231b[_0x8f8b('0x45')]=qs['filters'](_[_0x8f8b('0xc9')](_0x24e18a[_0x8f8b('0x47')],_0x4772ff[_0x8f8b('0xc5')]));if(_0x24e18a[_0x8f8b('0x47')][_0x8f8b('0x36')]){_0x1b231b['where']=_['merge'](_0x1b231b['where'],{'$or':_[_0x8f8b('0x37')](_0x1b231b[_0x8f8b('0x4a')],function(_0x1e96c7){var _0x4076d8={};_0x4076d8[_0x1e96c7]={'$like':'%'+_0x24e18a[_0x8f8b('0x47')]['filter']+'%'};return _0x4076d8;})});}_0x1b231b=_['merge']({},_0x1b231b,_0x24e18a[_0x8f8b('0x5b')]);return _0x19f856[_0x8f8b('0xd5')](_0x1b231b);}})[_0x8f8b('0x16')](function(_0x128181){if(_0x128181){_0x5a861c=_0x128181[_0x8f8b('0x58')];if(!_0x24e18a[_0x8f8b('0x47')][_0x8f8b('0xcb')](_0x8f8b('0xd1'))){_0x1b231b[_0x8f8b('0x27')]=qs[_0x8f8b('0x27')](_0x24e18a[_0x8f8b('0x47')][_0x8f8b('0x27')]);_0x1b231b[_0x8f8b('0x28')]=qs[_0x8f8b('0x28')](_0x24e18a[_0x8f8b('0x47')]['offset']);}return _0x19f856[_0x8f8b('0xd5')](_0x1b231b);}})[_0x8f8b('0x16')](function(_0x485c52){if(_0x485c52){return _0x485c52?{'count':_0x5a861c,'rows':_0x485c52}:null;}})['then'](respondWithResult(_0x394b39,null))['catch'](handleError(_0x394b39,null));};exports[_0x8f8b('0xd6')]=function(_0x211eaf,_0x17b8ca){var _0xc1b36e={};var _0x4b3757={};var _0x109d19;var _0x15dfb2;return db[_0x8f8b('0x3e')]['findOne']({'where':{'id':_0x211eaf['params']['id']}})[_0x8f8b('0x16')](handleEntityNotFound(_0x17b8ca,null))['then'](function(_0x1dbfe9){if(_0x1dbfe9){_0x109d19=_0x1dbfe9;_0x4b3757['model']=_[_0x8f8b('0x56')](db[_0x8f8b('0xd7')]['rawAttributes']);_0x4b3757[_0x8f8b('0x47')]=_['keys'](_0x211eaf[_0x8f8b('0x47')]);_0x4b3757[_0x8f8b('0xc5')]=_[_0x8f8b('0x57')](_0x4b3757['model'],_0x4b3757[_0x8f8b('0x47')]);_0xc1b36e[_0x8f8b('0x4a')]=_['intersection'](_0x4b3757[_0x8f8b('0x54')],qs[_0x8f8b('0xc6')](_0x211eaf[_0x8f8b('0x47')][_0x8f8b('0xc6')]));_0xc1b36e[_0x8f8b('0x4a')]=_0xc1b36e[_0x8f8b('0x4a')][_0x8f8b('0x58')]?_0xc1b36e[_0x8f8b('0x4a')]:_0x4b3757[_0x8f8b('0x54')];_0xc1b36e[_0x8f8b('0xc7')]=qs[_0x8f8b('0xc8')](_0x211eaf[_0x8f8b('0x47')]['sort']);_0xc1b36e[_0x8f8b('0x45')]=qs['filters'](_['pick'](_0x211eaf['query'],_0x4b3757[_0x8f8b('0xc5')]));if(_0x211eaf['query']['filter']){_0xc1b36e['where']=_[_0x8f8b('0xca')](_0xc1b36e['where'],{'$or':_[_0x8f8b('0x37')](_0xc1b36e[_0x8f8b('0x4a')],function(_0x3ae273){var _0x1f6bf5={};_0x1f6bf5[_0x3ae273]={'$like':'%'+_0x211eaf[_0x8f8b('0x47')][_0x8f8b('0x36')]+'%'};return _0x1f6bf5;})});}_0xc1b36e=_[_0x8f8b('0xca')]({},_0xc1b36e,_0x211eaf['options']);return _0x109d19[_0x8f8b('0xd6')](_0xc1b36e);}})['then'](function(_0x28ad85){if(_0x28ad85){_0x15dfb2=_0x28ad85['length'];if(!_0x211eaf[_0x8f8b('0x47')][_0x8f8b('0xcb')](_0x8f8b('0xd1'))){_0xc1b36e[_0x8f8b('0x27')]=qs[_0x8f8b('0x27')](_0x211eaf[_0x8f8b('0x47')][_0x8f8b('0x27')]);_0xc1b36e[_0x8f8b('0x28')]=qs[_0x8f8b('0x28')](_0x211eaf['query'][_0x8f8b('0x28')]);}return _0x109d19[_0x8f8b('0xd6')](_0xc1b36e);}})[_0x8f8b('0x16')](function(_0x1482c8){if(_0x1482c8){return _0x1482c8?{'count':_0x15dfb2,'rows':_0x1482c8}:null;}})[_0x8f8b('0x16')](respondWithResult(_0x17b8ca,null))[_0x8f8b('0x21')](handleError(_0x17b8ca,null));};exports[_0x8f8b('0xd8')]=function(_0x5abbd2,_0x218914){var _0x1d0b2a={'raw':!![],'where':{}};var _0x40fab4={};var _0xfc4670={'count':0x0,'rows':[]};return db[_0x8f8b('0x3e')][_0x8f8b('0x93')]({'where':{'id':_0x5abbd2[_0x8f8b('0x53')]['id']}})[_0x8f8b('0x16')](handleEntityNotFound(_0x218914,null))[_0x8f8b('0x16')](function(_0xb8eb62){if(_0xb8eb62){_0x40fab4[_0x8f8b('0x54')]=_[_0x8f8b('0x56')](db[_0x8f8b('0xd9')][_0x8f8b('0x3f')]);_0x40fab4[_0x8f8b('0x47')]=_[_0x8f8b('0x56')](_0x5abbd2['query']);_0x40fab4[_0x8f8b('0xc5')]=_[_0x8f8b('0x57')](_0x40fab4[_0x8f8b('0x54')],_0x40fab4['query']);_0x1d0b2a[_0x8f8b('0x4a')]=_[_0x8f8b('0x57')](_0x40fab4[_0x8f8b('0x54')],qs['fields'](_0x5abbd2[_0x8f8b('0x47')][_0x8f8b('0xc6')]));_0x1d0b2a['attributes']=_0x1d0b2a[_0x8f8b('0x4a')][_0x8f8b('0x58')]?_0x1d0b2a[_0x8f8b('0x4a')]:_0x40fab4['model'];if(!_0x5abbd2['query'][_0x8f8b('0xcb')](_0x8f8b('0xd1'))){_0x1d0b2a[_0x8f8b('0x27')]=qs[_0x8f8b('0x27')](_0x5abbd2['query'][_0x8f8b('0x27')]);_0x1d0b2a[_0x8f8b('0x28')]=qs[_0x8f8b('0x28')](_0x5abbd2[_0x8f8b('0x47')][_0x8f8b('0x28')]);}_0x1d0b2a[_0x8f8b('0xc7')]=qs[_0x8f8b('0xc8')](_0x5abbd2[_0x8f8b('0x47')][_0x8f8b('0xc8')]);_0x1d0b2a[_0x8f8b('0x45')]=qs[_0x8f8b('0xc5')](_[_0x8f8b('0xc9')](_0x5abbd2[_0x8f8b('0x47')],_0x40fab4[_0x8f8b('0xc5')]));_0x1d0b2a[_0x8f8b('0x45')][_0x8f8b('0xda')]=_0xb8eb62['id'];if(_0x5abbd2[_0x8f8b('0x47')][_0x8f8b('0x36')]){_0x1d0b2a[_0x8f8b('0x45')]=_['merge'](_0x1d0b2a[_0x8f8b('0x45')],{'$or':_[_0x8f8b('0x37')](_0x1d0b2a[_0x8f8b('0x4a')],function(_0x1ebccf){var _0x5d3c72={};_0x5d3c72[_0x1ebccf]={'$like':'%'+_0x5abbd2['query']['filter']+'%'};return _0x5d3c72;})});}_0x1d0b2a=_['merge']({},_0x1d0b2a,_0x5abbd2[_0x8f8b('0x5b')]);return db[_0x8f8b('0xd9')][_0x8f8b('0x29')]({'where':_0x1d0b2a[_0x8f8b('0x45')]})[_0x8f8b('0x16')](function(_0xd58104){_0xfc4670[_0x8f8b('0x29')]=_0xd58104;if(_0x5abbd2[_0x8f8b('0x47')][_0x8f8b('0x46')]){_0x1d0b2a['include']=[{'all':!![]}];}return db[_0x8f8b('0xd9')]['findAll'](_0x1d0b2a);})[_0x8f8b('0x16')](function(_0x8e02ed){_0xfc4670['rows']=_0x8e02ed;return _0xfc4670;});}})['then'](respondWithFilteredResult(_0x218914,_0x1d0b2a))[_0x8f8b('0x21')](handleError(_0x218914,null));};exports[_0x8f8b('0xdb')]=function(_0x148292,_0x175052){var _0x4c7258={'raw':!![],'where':{}};var _0x200433={};var _0x2958bf={'count':0x0,'rows':[]};return db['User'][_0x8f8b('0x93')]({'where':{'id':_0x148292[_0x8f8b('0x53')]['id']}})['then'](handleEntityNotFound(_0x175052,null))[_0x8f8b('0x16')](function(_0x54a931){if(_0x54a931){_0x200433[_0x8f8b('0x54')]=_[_0x8f8b('0x56')](db[_0x8f8b('0xdc')][_0x8f8b('0x3f')]);_0x200433[_0x8f8b('0x47')]=_[_0x8f8b('0x56')](_0x148292[_0x8f8b('0x47')]);_0x200433[_0x8f8b('0xc5')]=_[_0x8f8b('0x57')](_0x200433['model'],_0x200433['query']);_0x4c7258[_0x8f8b('0x4a')]=_[_0x8f8b('0x57')](_0x200433[_0x8f8b('0x54')],qs[_0x8f8b('0xc6')](_0x148292[_0x8f8b('0x47')]['fields']));_0x4c7258[_0x8f8b('0x4a')]=_0x4c7258[_0x8f8b('0x4a')][_0x8f8b('0x58')]?_0x4c7258['attributes']:_0x200433['model'];if(!_0x148292[_0x8f8b('0x47')]['hasOwnProperty']('nolimit')){_0x4c7258[_0x8f8b('0x27')]=qs[_0x8f8b('0x27')](_0x148292[_0x8f8b('0x47')][_0x8f8b('0x27')]);_0x4c7258[_0x8f8b('0x28')]=qs[_0x8f8b('0x28')](_0x148292[_0x8f8b('0x47')][_0x8f8b('0x28')]);}_0x4c7258['order']=qs[_0x8f8b('0xc8')](_0x148292[_0x8f8b('0x47')][_0x8f8b('0xc8')]);_0x4c7258[_0x8f8b('0x45')]=qs[_0x8f8b('0xc5')](_[_0x8f8b('0xc9')](_0x148292['query'],_0x200433['filters']));_0x4c7258[_0x8f8b('0x45')][_0x8f8b('0xda')]=_0x54a931['id'];if(_0x148292[_0x8f8b('0x47')][_0x8f8b('0x36')]){_0x4c7258[_0x8f8b('0x45')]=_[_0x8f8b('0xca')](_0x4c7258['where'],{'$or':_[_0x8f8b('0x37')](_0x4c7258['attributes'],function(_0x5368c4){var _0x90ce24={};_0x90ce24[_0x5368c4]={'$like':'%'+_0x148292[_0x8f8b('0x47')][_0x8f8b('0x36')]+'%'};return _0x90ce24;})});}_0x4c7258=_['merge']({},_0x4c7258,_0x148292[_0x8f8b('0x5b')]);return db[_0x8f8b('0xdc')][_0x8f8b('0x29')]({'where':_0x4c7258[_0x8f8b('0x45')]})[_0x8f8b('0x16')](function(_0xfc2ddd){_0x2958bf[_0x8f8b('0x29')]=_0xfc2ddd;if(_0x148292[_0x8f8b('0x47')][_0x8f8b('0x46')]){_0x4c7258[_0x8f8b('0x59')]=[{'all':!![]}];}return db[_0x8f8b('0xdc')][_0x8f8b('0xaa')](_0x4c7258);})['then'](function(_0x4aa283){_0x2958bf[_0x8f8b('0x4b')]=_0x4aa283;return _0x2958bf;});}})[_0x8f8b('0x16')](respondWithFilteredResult(_0x175052,_0x4c7258))[_0x8f8b('0x21')](handleError(_0x175052,null));};exports[_0x8f8b('0xdd')]=function(_0x23f5c4,_0xe61e19){var _0x141b45={};var _0x5a13a8={};var _0x1b1dd6;var _0x5425fc;return db[_0x8f8b('0x3e')][_0x8f8b('0x93')]({'where':{'id':_0x23f5c4[_0x8f8b('0x53')]['id']}})[_0x8f8b('0x16')](handleEntityNotFound(_0xe61e19,null))['then'](function(_0x56a569){if(_0x56a569){_0x1b1dd6=_0x56a569;_0x5a13a8['model']=_[_0x8f8b('0x56')](db[_0x8f8b('0xde')][_0x8f8b('0x3f')]);_0x5a13a8[_0x8f8b('0x47')]=_['keys'](_0x23f5c4[_0x8f8b('0x47')]);_0x5a13a8[_0x8f8b('0xc5')]=_[_0x8f8b('0x57')](_0x5a13a8[_0x8f8b('0x54')],_0x5a13a8[_0x8f8b('0x47')]);_0x141b45['attributes']=_['intersection'](_0x5a13a8['model'],qs[_0x8f8b('0xc6')](_0x23f5c4[_0x8f8b('0x47')][_0x8f8b('0xc6')]));_0x141b45[_0x8f8b('0x4a')]=_0x141b45['attributes'][_0x8f8b('0x58')]?_0x141b45[_0x8f8b('0x4a')]:_0x5a13a8[_0x8f8b('0x54')];_0x141b45['order']=qs[_0x8f8b('0xc8')](_0x23f5c4[_0x8f8b('0x47')][_0x8f8b('0xc8')]);_0x141b45[_0x8f8b('0x45')]=qs['filters'](_[_0x8f8b('0xc9')](_0x23f5c4['query'],_0x5a13a8[_0x8f8b('0xc5')]));if(_0x23f5c4['query'][_0x8f8b('0x36')]){_0x141b45[_0x8f8b('0x45')]=_[_0x8f8b('0xca')](_0x141b45[_0x8f8b('0x45')],{'$or':_[_0x8f8b('0x37')](_0x141b45[_0x8f8b('0x4a')],function(_0x65a471){var _0x254c66={};_0x254c66[_0x65a471]={'$like':'%'+_0x23f5c4['query'][_0x8f8b('0x36')]+'%'};return _0x254c66;})});}_0x141b45=_[_0x8f8b('0xca')]({},_0x141b45,_0x23f5c4[_0x8f8b('0x5b')]);return _0x1b1dd6[_0x8f8b('0xdd')](_0x141b45);}})[_0x8f8b('0x16')](function(_0x12ab8b){if(_0x12ab8b){_0x5425fc=_0x12ab8b[_0x8f8b('0x58')];if(!_0x23f5c4[_0x8f8b('0x47')][_0x8f8b('0xcb')](_0x8f8b('0xd1'))){_0x141b45[_0x8f8b('0x27')]=qs[_0x8f8b('0x27')](_0x23f5c4[_0x8f8b('0x47')]['limit']);_0x141b45[_0x8f8b('0x28')]=qs[_0x8f8b('0x28')](_0x23f5c4[_0x8f8b('0x47')]['offset']);}return _0x1b1dd6['getChatInteractions'](_0x141b45);}})[_0x8f8b('0x16')](function(_0x4edc08){if(_0x4edc08){return _0x4edc08?{'count':_0x5425fc,'rows':_0x4edc08}:null;}})[_0x8f8b('0x16')](respondWithResult(_0xe61e19,null))[_0x8f8b('0x21')](handleError(_0xe61e19,null));};exports[_0x8f8b('0xdf')]=function(_0x27b097,_0x44b165){var _0x1eefb7={};var _0x3a7da2={};var _0x170221;var _0x2deb99;return db['User'][_0x8f8b('0x93')]({'where':{'id':_0x27b097['params']['id']}})['then'](handleEntityNotFound(_0x44b165,null))[_0x8f8b('0x16')](function(_0x1ca4fe){if(_0x1ca4fe){_0x170221=_0x1ca4fe;_0x3a7da2[_0x8f8b('0x54')]=_[_0x8f8b('0x56')](db[_0x8f8b('0xe0')]['rawAttributes']);_0x3a7da2[_0x8f8b('0x47')]=_[_0x8f8b('0x56')](_0x27b097['query']);_0x3a7da2[_0x8f8b('0xc5')]=_[_0x8f8b('0x57')](_0x3a7da2[_0x8f8b('0x54')],_0x3a7da2[_0x8f8b('0x47')]);_0x1eefb7[_0x8f8b('0x4a')]=_[_0x8f8b('0x57')](_0x3a7da2[_0x8f8b('0x54')],qs['fields'](_0x27b097['query'][_0x8f8b('0xc6')]));_0x1eefb7[_0x8f8b('0x4a')]=_0x1eefb7[_0x8f8b('0x4a')][_0x8f8b('0x58')]?_0x1eefb7[_0x8f8b('0x4a')]:_0x3a7da2[_0x8f8b('0x54')];_0x1eefb7[_0x8f8b('0xc7')]=qs[_0x8f8b('0xc8')](_0x27b097['query']['sort']);_0x1eefb7[_0x8f8b('0x45')]=qs[_0x8f8b('0xc5')](_['pick'](_0x27b097[_0x8f8b('0x47')],_0x3a7da2[_0x8f8b('0xc5')]));if(_0x27b097[_0x8f8b('0x47')]['filter']){_0x1eefb7[_0x8f8b('0x45')]=_[_0x8f8b('0xca')](_0x1eefb7[_0x8f8b('0x45')],{'$or':_['map'](_0x1eefb7[_0x8f8b('0x4a')],function(_0x35a73e){var _0x2ee84f={};_0x2ee84f[_0x35a73e]={'$like':'%'+_0x27b097[_0x8f8b('0x47')][_0x8f8b('0x36')]+'%'};return _0x2ee84f;})});}_0x1eefb7=_[_0x8f8b('0xca')]({},_0x1eefb7,_0x27b097[_0x8f8b('0x5b')]);return _0x170221[_0x8f8b('0xdf')](_0x1eefb7);}})['then'](function(_0x20b679){if(_0x20b679){_0x2deb99=_0x20b679[_0x8f8b('0x58')];if(!_0x27b097['query'][_0x8f8b('0xcb')](_0x8f8b('0xd1'))){_0x1eefb7['limit']=qs[_0x8f8b('0x27')](_0x27b097[_0x8f8b('0x47')]['limit']);_0x1eefb7['offset']=qs['offset'](_0x27b097[_0x8f8b('0x47')][_0x8f8b('0x28')]);}return _0x170221[_0x8f8b('0xdf')](_0x1eefb7);}})[_0x8f8b('0x16')](function(_0x46a9be){if(_0x46a9be){return _0x46a9be?{'count':_0x2deb99,'rows':_0x46a9be}:null;}})['then'](respondWithResult(_0x44b165,null))[_0x8f8b('0x21')](handleError(_0x44b165,null));};exports[_0x8f8b('0xe1')]=function(_0x306e23,_0x46f75f){var _0x128b20={'raw':!![],'where':{}};var _0x379cf9={};var _0x321aa6={'count':0x0,'rows':[]};return db[_0x8f8b('0x3e')][_0x8f8b('0x93')]({'where':{'id':_0x306e23[_0x8f8b('0x53')]['id']}})[_0x8f8b('0x16')](handleEntityNotFound(_0x46f75f,null))['then'](function(_0x4edb17){if(_0x4edb17){_0x379cf9[_0x8f8b('0x54')]=_[_0x8f8b('0x56')](db[_0x8f8b('0xe2')][_0x8f8b('0x3f')]);_0x379cf9[_0x8f8b('0x47')]=_['keys'](_0x306e23[_0x8f8b('0x47')]);_0x379cf9[_0x8f8b('0xc5')]=_[_0x8f8b('0x57')](_0x379cf9[_0x8f8b('0x54')],_0x379cf9['query']);_0x128b20['attributes']=_[_0x8f8b('0x57')](_0x379cf9['model'],qs[_0x8f8b('0xc6')](_0x306e23['query'][_0x8f8b('0xc6')]));_0x128b20[_0x8f8b('0x4a')]=_0x128b20['attributes'][_0x8f8b('0x58')]?_0x128b20[_0x8f8b('0x4a')]:_0x379cf9[_0x8f8b('0x54')];if(!_0x306e23[_0x8f8b('0x47')]['hasOwnProperty'](_0x8f8b('0xd1'))){_0x128b20[_0x8f8b('0x27')]=qs['limit'](_0x306e23['query']['limit']);_0x128b20[_0x8f8b('0x28')]=qs[_0x8f8b('0x28')](_0x306e23[_0x8f8b('0x47')][_0x8f8b('0x28')]);}_0x128b20[_0x8f8b('0xc7')]=qs['sort'](_0x306e23['query'][_0x8f8b('0xc8')]);_0x128b20[_0x8f8b('0x45')]=qs[_0x8f8b('0xc5')](_[_0x8f8b('0xc9')](_0x306e23[_0x8f8b('0x47')],_0x379cf9[_0x8f8b('0xc5')]));_0x128b20[_0x8f8b('0x45')][_0x8f8b('0xda')]=_0x4edb17['id'];if(_0x306e23[_0x8f8b('0x47')][_0x8f8b('0x36')]){_0x128b20[_0x8f8b('0x45')]=_[_0x8f8b('0xca')](_0x128b20['where'],{'$or':_['map'](_0x128b20[_0x8f8b('0x4a')],function(_0x4b75bb){var _0x4487a0={};_0x4487a0[_0x4b75bb]={'$like':'%'+_0x306e23[_0x8f8b('0x47')][_0x8f8b('0x36')]+'%'};return _0x4487a0;})});}_0x128b20=_['merge']({},_0x128b20,_0x306e23['options']);return db['MailInteraction'][_0x8f8b('0x29')]({'where':_0x128b20[_0x8f8b('0x45')]})[_0x8f8b('0x16')](function(_0x1709df){_0x321aa6[_0x8f8b('0x29')]=_0x1709df;if(_0x306e23[_0x8f8b('0x47')][_0x8f8b('0x46')]){_0x128b20[_0x8f8b('0x59')]=[{'all':!![]}];}return db[_0x8f8b('0xe2')][_0x8f8b('0xaa')](_0x128b20);})[_0x8f8b('0x16')](function(_0x23afc5){_0x321aa6[_0x8f8b('0x4b')]=_0x23afc5;return _0x321aa6;});}})['then'](respondWithFilteredResult(_0x46f75f,_0x128b20))[_0x8f8b('0x21')](handleError(_0x46f75f,null));};exports[_0x8f8b('0xe3')]=function(_0x269450,_0x537f3b){var _0x2eddd5={};var _0x56a0f6={};var _0xfe277c;var _0x578b6b;return db['User']['findOne']({'where':{'id':_0x269450[_0x8f8b('0x53')]['id']}})['then'](handleEntityNotFound(_0x537f3b,null))[_0x8f8b('0x16')](function(_0x4a3a14){if(_0x4a3a14){_0xfe277c=_0x4a3a14;_0x56a0f6[_0x8f8b('0x54')]=_[_0x8f8b('0x56')](db[_0x8f8b('0xe4')][_0x8f8b('0x3f')]);_0x56a0f6[_0x8f8b('0x47')]=_['keys'](_0x269450[_0x8f8b('0x47')]);_0x56a0f6[_0x8f8b('0xc5')]=_[_0x8f8b('0x57')](_0x56a0f6[_0x8f8b('0x54')],_0x56a0f6['query']);_0x2eddd5[_0x8f8b('0x4a')]=_['intersection'](_0x56a0f6[_0x8f8b('0x54')],qs[_0x8f8b('0xc6')](_0x269450['query'][_0x8f8b('0xc6')]));_0x2eddd5[_0x8f8b('0x4a')]=_0x2eddd5[_0x8f8b('0x4a')]['length']?_0x2eddd5[_0x8f8b('0x4a')]:_0x56a0f6[_0x8f8b('0x54')];_0x2eddd5[_0x8f8b('0xc7')]=qs['sort'](_0x269450[_0x8f8b('0x47')]['sort']);_0x2eddd5[_0x8f8b('0x45')]=qs['filters'](_[_0x8f8b('0xc9')](_0x269450[_0x8f8b('0x47')],_0x56a0f6[_0x8f8b('0xc5')]));if(_0x269450['query'][_0x8f8b('0x36')]){_0x2eddd5[_0x8f8b('0x45')]=_[_0x8f8b('0xca')](_0x2eddd5[_0x8f8b('0x45')],{'$or':_[_0x8f8b('0x37')](_0x2eddd5['attributes'],function(_0x5ee28b){var _0x5e7de5={};_0x5e7de5[_0x5ee28b]={'$like':'%'+_0x269450['query'][_0x8f8b('0x36')]+'%'};return _0x5e7de5;})});}_0x2eddd5=_[_0x8f8b('0xca')]({},_0x2eddd5,_0x269450[_0x8f8b('0x5b')]);return _0xfe277c[_0x8f8b('0xe3')](_0x2eddd5);}})[_0x8f8b('0x16')](function(_0x1a01b6){if(_0x1a01b6){_0x578b6b=_0x1a01b6['length'];if(!_0x269450[_0x8f8b('0x47')]['hasOwnProperty'](_0x8f8b('0xd1'))){_0x2eddd5[_0x8f8b('0x27')]=qs[_0x8f8b('0x27')](_0x269450[_0x8f8b('0x47')][_0x8f8b('0x27')]);_0x2eddd5[_0x8f8b('0x28')]=qs[_0x8f8b('0x28')](_0x269450['query'][_0x8f8b('0x28')]);}return _0xfe277c[_0x8f8b('0xe3')](_0x2eddd5);}})['then'](function(_0x1ce0e8){if(_0x1ce0e8){return _0x1ce0e8?{'count':_0x578b6b,'rows':_0x1ce0e8}:null;}})[_0x8f8b('0x16')](respondWithResult(_0x537f3b,null))[_0x8f8b('0x21')](handleError(_0x537f3b,null));};exports[_0x8f8b('0xe5')]=function(_0x5abe6a,_0x354a34){var _0x1e0ddd={};var _0x45cbae={};var _0x50ce6e;var _0x396237;return db[_0x8f8b('0x3e')]['findOne']({'where':{'id':_0x5abe6a[_0x8f8b('0x53')]['id']}})[_0x8f8b('0x16')](handleEntityNotFound(_0x354a34,null))['then'](function(_0x3127fe){if(_0x3127fe){_0x50ce6e=_0x3127fe;_0x45cbae['model']=_[_0x8f8b('0x56')](db[_0x8f8b('0xe6')][_0x8f8b('0x3f')]);_0x45cbae[_0x8f8b('0x47')]=_['keys'](_0x5abe6a[_0x8f8b('0x47')]);_0x45cbae[_0x8f8b('0xc5')]=_['intersection'](_0x45cbae[_0x8f8b('0x54')],_0x45cbae[_0x8f8b('0x47')]);_0x1e0ddd[_0x8f8b('0x4a')]=_[_0x8f8b('0x57')](_0x45cbae[_0x8f8b('0x54')],qs['fields'](_0x5abe6a['query'][_0x8f8b('0xc6')]));_0x1e0ddd['attributes']=_0x1e0ddd[_0x8f8b('0x4a')][_0x8f8b('0x58')]?_0x1e0ddd[_0x8f8b('0x4a')]:_0x45cbae[_0x8f8b('0x54')];_0x1e0ddd[_0x8f8b('0xc7')]=qs[_0x8f8b('0xc8')](_0x5abe6a[_0x8f8b('0x47')][_0x8f8b('0xc8')]);_0x1e0ddd[_0x8f8b('0x45')]=qs[_0x8f8b('0xc5')](_[_0x8f8b('0xc9')](_0x5abe6a['query'],_0x45cbae[_0x8f8b('0xc5')]));if(_0x5abe6a[_0x8f8b('0x47')][_0x8f8b('0x36')]){_0x1e0ddd[_0x8f8b('0x45')]=_[_0x8f8b('0xca')](_0x1e0ddd[_0x8f8b('0x45')],{'$or':_['map'](_0x1e0ddd[_0x8f8b('0x4a')],function(_0x2f2dfc){var _0x1b87e6={};_0x1b87e6[_0x2f2dfc]={'$like':'%'+_0x5abe6a[_0x8f8b('0x47')]['filter']+'%'};return _0x1b87e6;})});}_0x1e0ddd=_['merge']({},_0x1e0ddd,_0x5abe6a[_0x8f8b('0x5b')]);return _0x50ce6e['getFaxInteractions'](_0x1e0ddd);}})['then'](function(_0x301d4d){if(_0x301d4d){_0x396237=_0x301d4d[_0x8f8b('0x58')];if(!_0x5abe6a[_0x8f8b('0x47')][_0x8f8b('0xcb')](_0x8f8b('0xd1'))){_0x1e0ddd[_0x8f8b('0x27')]=qs['limit'](_0x5abe6a['query'][_0x8f8b('0x27')]);_0x1e0ddd['offset']=qs[_0x8f8b('0x28')](_0x5abe6a['query']['offset']);}return _0x50ce6e[_0x8f8b('0xe5')](_0x1e0ddd);}})[_0x8f8b('0x16')](function(_0x126313){if(_0x126313){return _0x126313?{'count':_0x396237,'rows':_0x126313}:null;}})[_0x8f8b('0x16')](respondWithResult(_0x354a34,null))[_0x8f8b('0x21')](handleError(_0x354a34,null));};exports[_0x8f8b('0xe7')]=function(_0x2fb681,_0x4a9a5c){var _0x322149={};var _0x2df375={};var _0x116d65;var _0x18221c;return db[_0x8f8b('0x3e')][_0x8f8b('0x93')]({'where':{'id':_0x2fb681[_0x8f8b('0x53')]['id']}})['then'](handleEntityNotFound(_0x4a9a5c,null))['then'](function(_0x5819c2){if(_0x5819c2){_0x116d65=_0x5819c2;_0x2df375[_0x8f8b('0x54')]=_[_0x8f8b('0x56')](db['WhatsappInteraction'][_0x8f8b('0x3f')]);_0x2df375[_0x8f8b('0x47')]=_['keys'](_0x2fb681[_0x8f8b('0x47')]);_0x2df375[_0x8f8b('0xc5')]=_[_0x8f8b('0x57')](_0x2df375[_0x8f8b('0x54')],_0x2df375[_0x8f8b('0x47')]);_0x322149[_0x8f8b('0x4a')]=_[_0x8f8b('0x57')](_0x2df375[_0x8f8b('0x54')],qs['fields'](_0x2fb681[_0x8f8b('0x47')][_0x8f8b('0xc6')]));_0x322149['attributes']=_0x322149[_0x8f8b('0x4a')]['length']?_0x322149[_0x8f8b('0x4a')]:_0x2df375[_0x8f8b('0x54')];_0x322149[_0x8f8b('0xc7')]=qs[_0x8f8b('0xc8')](_0x2fb681[_0x8f8b('0x47')][_0x8f8b('0xc8')]);_0x322149[_0x8f8b('0x45')]=qs[_0x8f8b('0xc5')](_[_0x8f8b('0xc9')](_0x2fb681[_0x8f8b('0x47')],_0x2df375[_0x8f8b('0xc5')]));if(_0x2fb681[_0x8f8b('0x47')][_0x8f8b('0x36')]){_0x322149['where']=_[_0x8f8b('0xca')](_0x322149[_0x8f8b('0x45')],{'$or':_[_0x8f8b('0x37')](_0x322149[_0x8f8b('0x4a')],function(_0x3bce20){var _0x3fda38={};_0x3fda38[_0x3bce20]={'$like':'%'+_0x2fb681['query']['filter']+'%'};return _0x3fda38;})});}_0x322149=_[_0x8f8b('0xca')]({},_0x322149,_0x2fb681[_0x8f8b('0x5b')]);return _0x116d65['getWhatsappInteractions'](_0x322149);}})['then'](function(_0x2a5216){if(_0x2a5216){_0x18221c=_0x2a5216['length'];if(!_0x2fb681['query'][_0x8f8b('0xcb')](_0x8f8b('0xd1'))){_0x322149[_0x8f8b('0x27')]=qs[_0x8f8b('0x27')](_0x2fb681[_0x8f8b('0x47')][_0x8f8b('0x27')]);_0x322149[_0x8f8b('0x28')]=qs[_0x8f8b('0x28')](_0x2fb681['query']['offset']);}return _0x116d65['getWhatsappInteractions'](_0x322149);}})[_0x8f8b('0x16')](function(_0x2af979){if(_0x2af979){return _0x2af979?{'count':_0x18221c,'rows':_0x2af979}:null;}})['then'](respondWithResult(_0x4a9a5c,null))[_0x8f8b('0x21')](handleError(_0x4a9a5c,null));};exports[_0x8f8b('0xe8')]=function(_0x24db2e,_0x1a2ad5,_0x555a47){var _0x24ce24;var _0x9980a8;var _0x293f48;var _0xc11b87=!_[_0x8f8b('0x68')](_0x24db2e[_0x8f8b('0x53')]['id'])?_0x24db2e[_0x8f8b('0x53')]['id']:!_[_0x8f8b('0x68')](_0x24db2e[_0x8f8b('0x33')]['id'])?_0x24db2e[_0x8f8b('0x33')]['id']:null;return db[_0x8f8b('0x3e')][_0x8f8b('0x39')]({'where':{'id':_0xc11b87,'role':{'$or':['admin',_0x8f8b('0x33'),_0x8f8b('0x2d')]}},'attributes':['id',_0x8f8b('0x3a'),_0x8f8b('0xe9'),_0x8f8b('0xea'),_0x8f8b('0x2c'),_0x8f8b('0x65'),'loginInPause']})[_0x8f8b('0x16')](function(_0x357f0c){if(_0x357f0c){if(_0x357f0c[_0x8f8b('0x2c')]===_0x8f8b('0x2d')){_0x24ce24=_0x357f0c;if(_0x24db2e[_0x8f8b('0x60')][_0x8f8b('0x9e')]){_0x293f48=util['format'](_0x8f8b('0xeb'),_0x24ce24[_0x24db2e['body'][_0x8f8b('0x9e')]]);}else if(_0x24db2e[_0x8f8b('0x60')][_0x8f8b('0xec')]){_0x293f48=util[_0x8f8b('0xab')](_0x8f8b('0xed'),_0x24db2e[_0x8f8b('0x60')][_0x8f8b('0xec')]);}else{_0x293f48=util[_0x8f8b('0xab')](_0x8f8b('0xed'),_0x24ce24['name']);}socket['to'](util[_0x8f8b('0xab')]('user:%s',_0x24ce24[_0x8f8b('0x3a')]))[_0x8f8b('0x2e')](_0x8f8b('0xee'),{'user':{'id':_0x24ce24['id'],'name':_0x24ce24[_0x8f8b('0x3a')]},'ip':_0x24db2e[_0x8f8b('0xef')][_0x8f8b('0xf0')]||_0x24db2e[_0x8f8b('0xf1')][_0x8f8b('0xf2')]||_0x24db2e['socket'][_0x8f8b('0xf2')]||_0x24db2e[_0x8f8b('0xf1')][_0x8f8b('0xf3')][_0x8f8b('0xf2')]});return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x24ce24[_0x8f8b('0x3a')]},'individualHooks':!![]});}}else{throw new db[(_0x8f8b('0x8b'))][(_0x8f8b('0x8c'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0x8f8b('0x16')](function(){if(_0x24ce24){return _0x24ce24[_0x8f8b('0xf4')]({'raw':!![]});}})[_0x8f8b('0x16')](function(_0xab165a){if(_0x24ce24){if(_0xab165a){_0x9980a8=_0xab165a;if(_0x9980a8['length']){var _0x32b185=_0x9980a8[_0x8f8b('0x37')](function(_0x2997b6){var _0x3f0e6b={'membername':_0x24ce24['name'],'UserId':_0x24ce24['id'],'queue_name':_0x2997b6[_0x8f8b('0x3a')],'VoiceQueueId':_0x2997b6['id'],'interface':_0x293f48,'paused':_0x24ce24[_0x8f8b('0x9c')]||![],'penalty':_0x2997b6['UserVoiceQueue.penalty']||0x0};return db[_0x8f8b('0xb1')][_0x8f8b('0xac')](_0x3f0e6b);});return Promise[_0x8f8b('0x51')](_0x32b185);}}}})['then'](function(){if(_0x24ce24){return db['MemberReport']['findAll']({'where':{'membername':_0x24ce24['name'],'exitAt':null}});}})[_0x8f8b('0x16')](function(_0xadd9dd){if(_0x24ce24){var _0x2339d5=[];_0xadd9dd[_0x8f8b('0xf5')](function(_0x105ae6){_0x2339d5['push'](_0x105ae6[_0x8f8b('0x2b')]({'exitAt':moment()['format'](_0x8f8b('0xf6'))}));});return Promise['all'](_0x2339d5);}})['then'](function(){if(_0x24ce24){var _0x357a80=[];var _0x37c5bc=[];var _0x219755=utils[_0x8f8b('0xf7')]();var _0x589f65={'membername':_0x24ce24[_0x8f8b('0x3a')],'interface':_0x293f48,'enterAt':moment()[_0x8f8b('0xab')](_0x8f8b('0xf6')),'role':_0x24ce24['role'],'internal':_0x24ce24[_0x8f8b('0x65')]};_0x219755[_0x8f8b('0xf5')](function(_0xe0a243){_0x357a80[_0x8f8b('0x4d')](_[_0x8f8b('0xca')]({'channel':_0xe0a243,'type':_0x8f8b('0xf8'),'data1':_0x24db2e[_0x8f8b('0x60')][_0x8f8b('0xf9')],'data2':_0x293f48},_0x589f65));if(_0x24ce24[_0x8f8b('0x9c')]){_0x37c5bc[_0x8f8b('0x4d')](_[_0x8f8b('0xca')]({'channel':_0xe0a243,'type':_0x8f8b('0xfa'),'data1':_0x8f8b('0xfb')},_0x589f65));}});return db[_0x8f8b('0xfc')]['bulkCreate'](_0x357a80[_0x8f8b('0xc2')](_0x37c5bc),{'individualHooks':!![]});}})['then'](function(){if(_0x24ce24){return _0x24ce24['update']({'online':!![],'lastLoginAt':moment()[_0x8f8b('0xab')](_0x8f8b('0xf6')),'voicePause':_0x24ce24[_0x8f8b('0x9c')]||![],'mailPause':_0x24ce24['loginInPause']||![],'chatPause':_0x24ce24['loginInPause']||![],'faxPause':_0x24ce24[_0x8f8b('0x9c')]||![],'smsPause':_0x24ce24[_0x8f8b('0x9c')]||![],'openchannelPause':_0x24ce24[_0x8f8b('0x9c')]||![],'whatsappPause':_0x24ce24[_0x8f8b('0x9c')]||![],'pauseType':_0x24ce24['loginInPause']?'LOGININPAUSE':null,'interface':_0x293f48,'lastPauseAt':moment()['format'](_0x8f8b('0xf6'))});}})[_0x8f8b('0x16')](function(_0x564abf){if(_0x24db2e['isMiddleware']){return _0x555a47();}else{return Promise[_0x8f8b('0xfd')](_0x564abf)[_0x8f8b('0x16')](respondWithResult(_0x1a2ad5,null));}})[_0x8f8b('0x21')](handleError(_0x1a2ad5,null));};exports['logout']=function(_0x194dec,_0x1d83e6){var _0x19d2e5;return db[_0x8f8b('0x3e')]['find']({'where':{'id':_0x194dec['params']['id'],'role':_0x8f8b('0x2d')},'attributes':['id',_0x8f8b('0x3a'),_0x8f8b('0x2c')]})[_0x8f8b('0x16')](handleEntityNotFound(_0x1d83e6,null))[_0x8f8b('0x16')](function(_0x231840){if(_0x231840){_0x19d2e5=_0x231840;return db[_0x8f8b('0xb1')][_0x8f8b('0x30')]({'where':{'membername':_0x19d2e5['name']},'individualHooks':!![]});}})[_0x8f8b('0x16')](function(){return db[_0x8f8b('0xfc')]['findAll']({'where':{'membername':_0x19d2e5[_0x8f8b('0x3a')],'exitAt':null}});})[_0x8f8b('0x16')](function(_0x529610){var _0x4576ed=[];_0x529610[_0x8f8b('0xf5')](function(_0x43a2d3){_0x4576ed[_0x8f8b('0x4d')](_0x43a2d3[_0x8f8b('0x2b')]({'exitAt':moment()[_0x8f8b('0xab')](_0x8f8b('0xf6'))}));});return Promise[_0x8f8b('0x51')](_0x4576ed);})[_0x8f8b('0x16')](function(){return _0x19d2e5[_0x8f8b('0x2b')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x8f8b('0x16')](respondWithResult(_0x1d83e6,null))[_0x8f8b('0x21')](handleError(_0x1d83e6,null));};exports[_0x8f8b('0xfe')]=function(_0x7f16e0,_0x1f1580){var _0x4bf9fd;return db[_0x8f8b('0xb1')][_0x8f8b('0x2b')]({'paused':0x1},{'where':{'UserId':_0x7f16e0[_0x8f8b('0x53')]['id']},'individualHooks':!![]})[_0x8f8b('0x16')](function(){return db[_0x8f8b('0x3e')][_0x8f8b('0x39')]({'where':{'id':_0x7f16e0['params']['id'],'role':_0x8f8b('0x2d')},'attributes':['id',_0x8f8b('0x3a'),_0x8f8b('0x2c'),_0x8f8b('0x65'),_0x8f8b('0x9e'),_0x8f8b('0x9b')]});})[_0x8f8b('0x16')](handleEntityNotFound(_0x1f1580,null))[_0x8f8b('0x16')](function(_0x3e6d5e){if(_0x3e6d5e){_0x4bf9fd=_0x3e6d5e;return respondWithRpcPromise(_0x8f8b('0xff'),_0x8f8b('0xfe'),{'id':_0x4bf9fd['id'],'name':_0x4bf9fd[_0x8f8b('0x3a')],'pause':!![]});}})['then'](function(){if(_0x4bf9fd){return db[_0x8f8b('0xfc')][_0x8f8b('0xaa')]({'where':{'membername':_0x4bf9fd[_0x8f8b('0x3a')],'type':_0x8f8b('0xfa'),'exitAt':null}});}})[_0x8f8b('0x16')](function(_0xcf9d81){if(_0xcf9d81[_0x8f8b('0x58')]){var _0x5ac309=moment()[_0x8f8b('0xab')](_0x8f8b('0xf6'));for(var _0x246f33=0x0,_0x5e9d45=_0xcf9d81[_0x8f8b('0x58')];_0x246f33<_0x5e9d45;_0x246f33++){_0xcf9d81[_0x246f33]['updateAttributes']({'exitAt':_0x5ac309});}}})[_0x8f8b('0x16')](function(){var _0x29daa6=[];var _0x3010d0=utils[_0x8f8b('0xf7')]();_0x3010d0[_0x8f8b('0xf5')](function(_0x3501c4){_0x29daa6[_0x8f8b('0x4d')]({'channel':_0x3501c4,'membername':_0x4bf9fd[_0x8f8b('0x3a')],'interface':_[_0x8f8b('0x68')](_0x4bf9fd[_0x8f8b('0x9e')])?util[_0x8f8b('0xab')](_0x8f8b('0xed'),_0x4bf9fd[_0x8f8b('0x3a')]):_0x4bf9fd[_0x8f8b('0x9e')],'type':'PAUSE','enterAt':moment()[_0x8f8b('0xab')](_0x8f8b('0xf6')),'data1':_0x7f16e0[_0x8f8b('0x60')][_0x8f8b('0x100')]||_0x8f8b('0x101'),'role':_0x4bf9fd[_0x8f8b('0x2c')],'internal':_0x4bf9fd[_0x8f8b('0x65')]});});return db[_0x8f8b('0xfc')][_0x8f8b('0x102')](_0x29daa6,{'individualHooks':!![]});})['then'](function(){return _0x4bf9fd['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x7f16e0[_0x8f8b('0x60')][_0x8f8b('0x100')]||_0x8f8b('0x101'),'lastPauseAt':moment()[_0x8f8b('0xab')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x8f8b('0x16')](respondWithResult(_0x1f1580,null))['catch'](handleError(_0x1f1580,null));};exports[_0x8f8b('0x103')]=function(_0x549268,_0x5a8992){if(_0x549268[_0x8f8b('0x60')][_0x8f8b('0x9a')]&&!utils['isValidChannel'](_0x549268[_0x8f8b('0x60')][_0x8f8b('0x9a')])){throw new APIBadRequestError(util['format']('Channel\x20parameter\x20%s\x20is\x20invalid',_0x549268['body'][_0x8f8b('0x9a')]));}return db[_0x8f8b('0x3e')]['find']({'where':{'id':_0x549268[_0x8f8b('0x53')]['id']},'attributes':['id',_0x8f8b('0x3a'),'role',_0x8f8b('0x65'),'interface',_0x8f8b('0x9b'),_0x8f8b('0x9d'),_0x8f8b('0x104'),_0x8f8b('0x105'),_0x8f8b('0x106'),_0x8f8b('0x107'),_0x8f8b('0x108'),'whatsappPause',_0x8f8b('0x109'),'lastPauseAt']})['then'](function(_0x54173b){if(!_0x54173b){throw new APINotFoundError(util[_0x8f8b('0xab')](_0x8f8b('0x10a'),_0x549268[_0x8f8b('0x53')]['id']));}return _0x54173b[_0x8f8b('0x103')](_0x549268['body'][_0x8f8b('0x9a')]);})['then'](respondWithResult(_0x5a8992,null))[_0x8f8b('0x21')](APIHandleError(_0x5a8992));};exports[_0x8f8b('0x10b')]=function(_0x432fde,_0x5f1b5c){var _0x4f7e41={};var _0x42a813={};var _0x17d3fa;var _0x46af50;return db[_0x8f8b('0x3e')][_0x8f8b('0x93')]({'where':{'id':_0x432fde[_0x8f8b('0x53')]['id']}})[_0x8f8b('0x16')](handleEntityNotFound(_0x5f1b5c,null))[_0x8f8b('0x16')](function(_0x2d0b4c){if(_0x2d0b4c){_0x17d3fa=_0x2d0b4c;_0x42a813[_0x8f8b('0x54')]=_[_0x8f8b('0x56')](db[_0x8f8b('0x10c')][_0x8f8b('0x3f')]);_0x42a813['query']=_[_0x8f8b('0x56')](_0x432fde['query']);_0x42a813[_0x8f8b('0xc5')]=_[_0x8f8b('0x57')](_0x42a813[_0x8f8b('0x54')],_0x42a813[_0x8f8b('0x47')]);_0x4f7e41[_0x8f8b('0x4a')]=_[_0x8f8b('0x57')](_0x42a813['model'],qs[_0x8f8b('0xc6')](_0x432fde['query'][_0x8f8b('0xc6')]));_0x4f7e41[_0x8f8b('0x4a')]=_0x4f7e41[_0x8f8b('0x4a')][_0x8f8b('0x58')]?_0x4f7e41[_0x8f8b('0x4a')]:_0x42a813['model'];_0x4f7e41['order']=qs['sort'](_0x432fde[_0x8f8b('0x47')][_0x8f8b('0xc8')]);_0x4f7e41['where']=qs[_0x8f8b('0xc5')](_['pick'](_0x432fde[_0x8f8b('0x47')],_0x42a813['filters']));if(_0x432fde[_0x8f8b('0x47')]['filter']){_0x4f7e41['where']=_[_0x8f8b('0xca')](_0x4f7e41[_0x8f8b('0x45')],{'$or':_[_0x8f8b('0x37')](_0x4f7e41['attributes'],function(_0x7025db){var _0x1bd68b={};_0x1bd68b[_0x7025db]={'$like':'%'+_0x432fde[_0x8f8b('0x47')]['filter']+'%'};return _0x1bd68b;})});}_0x4f7e41=_[_0x8f8b('0xca')]({},_0x4f7e41,_0x432fde[_0x8f8b('0x5b')]);return _0x17d3fa[_0x8f8b('0x10b')](_0x4f7e41);}})[_0x8f8b('0x16')](function(_0x5c5bd8){if(_0x5c5bd8){_0x46af50=_0x5c5bd8[_0x8f8b('0x58')];if(!_0x432fde['query']['hasOwnProperty'](_0x8f8b('0xd1'))){_0x4f7e41[_0x8f8b('0x27')]=qs[_0x8f8b('0x27')](_0x432fde['query']['limit']);_0x4f7e41['offset']=qs[_0x8f8b('0x28')](_0x432fde[_0x8f8b('0x47')][_0x8f8b('0x28')]);}return _0x17d3fa['getTeams'](_0x4f7e41);}})[_0x8f8b('0x16')](function(_0x46c7c8){if(_0x46c7c8){return _0x46c7c8?{'count':_0x46af50,'rows':_0x46c7c8}:null;}})[_0x8f8b('0x16')](respondWithResult(_0x5f1b5c,null))[_0x8f8b('0x21')](handleError(_0x5f1b5c,null));};exports[_0x8f8b('0x10d')]=function(_0x4c4b2f,_0x4874eb){var _0x125724=_0x4c4b2f[_0x8f8b('0x53')]['id'];var _0x43a66c=_0x4c4b2f[_0x8f8b('0x60')]?_0x4c4b2f[_0x8f8b('0x60')]['ids']:null;var _0x2aa430=[];return Promise[_0x8f8b('0xfd')]()['then'](function(){if(!_0x43a66c)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x8f8b('0x16')](function(){return db[_0x8f8b('0x3e')][_0x8f8b('0x93')]({'where':{'id':_0x125724}});})['then'](function(_0x47b040){if(!_0x47b040)throw new APINotFoundError(util[_0x8f8b('0xab')](_0x8f8b('0x10a'),_0x4c4b2f[_0x8f8b('0x53')]['id']));return db[_0x8f8b('0x6a')][_0x8f8b('0x10e')](function(_0x239718){return _0x47b040[_0x8f8b('0x10d')](_0x43a66c,{'transaction':_0x239718})[_0x8f8b('0x16')](function(){return db[_0x8f8b('0x10c')][_0x8f8b('0xaa')]({'where':{'id':{'$in':_0x43a66c}}});})['then'](function(_0x4b1e27){var _0x414e04=_[_0x8f8b('0x37')](_0x4b1e27,function(_0x8d020a){return _0x8d020a['getAssociatedQueues']();});return Promise[_0x8f8b('0x51')](_0x414e04);})[_0x8f8b('0x16')](function(_0x4df6b5){_0x2aa430=_['flattenDeep'](_0x4df6b5);var _0x2037ea=_['map'](_0x2aa430,function(_0x408913){return _0x408913[_0x8f8b('0x10f')](_0x47b040['id'],{'transaction':_0x239718});});return Promise['all'](_0x2037ea);})[_0x8f8b('0x16')](function(){if(!_0x47b040[_0x8f8b('0x9b')])return;var _0xa0e3d5=_['filter'](_0x2aa430,function(_0x443cdf){return _0x443cdf[_0x8f8b('0x110')](_0x8f8b('0x9a'))===_0x8f8b('0x111');});var _0x85b726=_[_0x8f8b('0x37')](_0xa0e3d5,function(_0x520118){return db[_0x8f8b('0xb1')][_0x8f8b('0xac')]({'membername':_0x47b040[_0x8f8b('0x3a')],'UserId':_0x47b040['id'],'queue_name':_0x520118[_0x8f8b('0x3a')],'VoiceQueueId':_0x520118['id'],'interface':_[_0x8f8b('0x68')](_0x47b040[_0x8f8b('0x9e')])?util[_0x8f8b('0xab')](_0x8f8b('0xed'),_0x47b040['name']):_0x47b040['interface'],'paused':_0x47b040[_0x8f8b('0x9d')]||![],'penalty':_0x47b040['penalty']},{'transaction':_0x239718});});return Promise['all'](_0x85b726);})[_0x8f8b('0x16')](function(){return db[_0x8f8b('0x112')]['findAll']({'where':{'teamId':{'$in':_0x43a66c}}});})['then'](function(_0x23ad58){var _0x1d444b=_[_0x8f8b('0x37')](_0x23ad58,function(_0x52ae31){return db['UserVoicePrefix'][_0x8f8b('0x7b')]({'UserId':_0x47b040['id'],'VoicePrefixId':_0x52ae31[_0x8f8b('0x113')]},{'transaction':_0x239718});});return Promise['all'](_0x1d444b);});});})['then'](function(){for(var _0x44de74=0x0;_0x44de74<_0x2aa430['length'];_0x44de74++){var _0x23407e=_0x2aa430[_0x44de74][_0x8f8b('0x110')](_0x8f8b('0x9a'));var _0x1882ce=_0x23407e+_0x8f8b('0xa6');socket[_0x8f8b('0x2e')](_0x8f8b('0x33')+_0x23407e+'Queue:save',{'UserId':_0x125724,['queueField']:_0x2aa430[_0x44de74]['id']});}})[_0x8f8b('0x16')](respondWithStatusCode(_0x4874eb,null))[_0x8f8b('0x21')](APIHandleError(_0x4874eb));};exports['removeTeams']=function(_0x4cf863,_0x51ebe1){var _0x5c02ff=_0x4cf863[_0x8f8b('0x53')]['id'];var _0x24c1a2=null;if(_0x4cf863[_0x8f8b('0x47')]['ids']){_0x24c1a2=_['isArray'](_0x4cf863['query']['ids'])?_0x4cf863['query'][_0x8f8b('0x63')]:[_0x4cf863[_0x8f8b('0x47')][_0x8f8b('0x63')]];}var _0x4e20a=[];return Promise[_0x8f8b('0xfd')]()['then'](function(){if(!_0x24c1a2)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})['then'](function(){return db[_0x8f8b('0x3e')]['findOne']({'where':{'id':_0x5c02ff}});})['then'](function(_0x1cd211){if(!_0x1cd211)throw new APINotFoundError(util['format'](_0x8f8b('0x10a'),_0x4cf863[_0x8f8b('0x53')]['id']));return db['sequelize'][_0x8f8b('0x10e')](function(_0x46660b){return _0x1cd211['removeTeams'](_0x24c1a2,{'transaction':_0x46660b})[_0x8f8b('0x16')](function(){return db['Team']['findAll']({'where':{'id':{'$in':_0x24c1a2}}});})[_0x8f8b('0x16')](function(_0x5e39c1){var _0x1ef719=_[_0x8f8b('0x37')](_0x5e39c1,function(_0x4aa861){return _0x4aa861[_0x8f8b('0x114')]();});return Promise[_0x8f8b('0x51')](_0x1ef719);})[_0x8f8b('0x16')](function(_0xb6997e){_0x4e20a=_[_0x8f8b('0x115')](_0xb6997e);var _0x24862e=_['map'](_0x4e20a,function(_0x5eb5f7){return _0x5eb5f7[_0x8f8b('0x116')](_0x1cd211['id'],{'transaction':_0x46660b});});return Promise[_0x8f8b('0x51')](_0x24862e);})[_0x8f8b('0x16')](function(){if(!_0x1cd211[_0x8f8b('0x9b')])return;var _0x997782=_[_0x8f8b('0x36')](_0x4e20a,function(_0x5a80de){return _0x5a80de[_0x8f8b('0x110')](_0x8f8b('0x9a'))===_0x8f8b('0x111');});var _0x5515ff=_[_0x8f8b('0x37')](_0x997782,function(_0x4f0f00){return db['UserVoiceQueueRt'][_0x8f8b('0x30')]({'where':{'VoiceQueueId':_0x4f0f00['id'],'UserId':_0x1cd211['id']},'transaction':_0x46660b});});return Promise['all'](_0x5515ff);})[_0x8f8b('0x16')](function(){return db[_0x8f8b('0x112')][_0x8f8b('0xaa')]({'where':{'teamId':{'$in':_0x24c1a2}}});})[_0x8f8b('0x16')](function(_0x2aace0){var _0x181864=_['map'](_0x2aace0,function(_0x498c9d){return db[_0x8f8b('0x117')]['destroy']({'where':{'UserId':_0x1cd211['id'],'VoicePrefixId':_0x498c9d[_0x8f8b('0x113')]}},{'transaction':_0x46660b});});return Promise[_0x8f8b('0x51')](_0x181864);});});})[_0x8f8b('0x16')](function(){for(var _0x4b029c=0x0;_0x4b029c<_0x4e20a[_0x8f8b('0x58')];_0x4b029c++){var _0x3017d5=_0x4e20a[_0x4b029c][_0x8f8b('0x110')](_0x8f8b('0x9a'));var _0x425815=_0x3017d5+_0x8f8b('0xa6');socket[_0x8f8b('0x2e')](_0x8f8b('0x33')+_0x3017d5+'Queue:remove',{'UserId':_0x5c02ff,['queueField']:_0x4e20a[_0x4b029c]['id']});}})[_0x8f8b('0x16')](respondWithStatusCode(_0x51ebe1,null))[_0x8f8b('0x21')](APIHandleError(_0x51ebe1));};exports[_0x8f8b('0x118')]=function(_0x1c4715,_0x52e7f3){var _0x31a942={};var _0x5a1815={};var _0xb10687;var _0x2159b1;return db[_0x8f8b('0x3e')][_0x8f8b('0x93')]({'where':{'id':_0x1c4715[_0x8f8b('0x53')]['id']}})['then'](handleEntityNotFound(_0x52e7f3,null))['then'](function(_0x11755e){if(_0x11755e){_0xb10687=_0x11755e;_0x5a1815[_0x8f8b('0x54')]=_['keys'](db[_0x8f8b('0xcc')][_0x8f8b('0x3f')]);_0x5a1815[_0x8f8b('0x47')]=_[_0x8f8b('0x56')](_0x1c4715[_0x8f8b('0x47')]);_0x5a1815[_0x8f8b('0xc5')]=_[_0x8f8b('0x57')](_0x5a1815[_0x8f8b('0x54')],_0x5a1815[_0x8f8b('0x47')]);_0x31a942['attributes']=_['intersection'](_0x5a1815[_0x8f8b('0x54')],qs['fields'](_0x1c4715[_0x8f8b('0x47')][_0x8f8b('0xc6')]));_0x31a942['attributes']=_0x31a942['attributes']['length']?_0x31a942[_0x8f8b('0x4a')]:_0x5a1815[_0x8f8b('0x54')];_0x31a942[_0x8f8b('0xc7')]=qs[_0x8f8b('0xc8')](_0x1c4715['query'][_0x8f8b('0xc8')]);_0x31a942[_0x8f8b('0x45')]=qs[_0x8f8b('0xc5')](_[_0x8f8b('0xc9')](_0x1c4715['query'],_0x5a1815[_0x8f8b('0xc5')]));if(_0x1c4715[_0x8f8b('0x47')][_0x8f8b('0x36')]){_0x31a942['where']=_['merge'](_0x31a942[_0x8f8b('0x45')],{'$or':_[_0x8f8b('0x37')](_0x31a942[_0x8f8b('0x4a')],function(_0x51bde5){var _0x568558={};_0x568558[_0x51bde5]={'$like':'%'+_0x1c4715['query'][_0x8f8b('0x36')]+'%'};return _0x568558;})});}_0x31a942=_[_0x8f8b('0xca')]({},_0x31a942,_0x1c4715[_0x8f8b('0x5b')]);return _0xb10687[_0x8f8b('0x118')](_0x31a942);}})[_0x8f8b('0x16')](function(_0x5ab8fb){if(_0x5ab8fb){_0x2159b1=_0x5ab8fb[_0x8f8b('0x58')];if(!_0x1c4715[_0x8f8b('0x47')][_0x8f8b('0xcb')](_0x8f8b('0xd1'))){_0x31a942[_0x8f8b('0x27')]=qs[_0x8f8b('0x27')](_0x1c4715[_0x8f8b('0x47')][_0x8f8b('0x27')]);_0x31a942[_0x8f8b('0x28')]=qs['offset'](_0x1c4715[_0x8f8b('0x47')][_0x8f8b('0x28')]);}return _0xb10687[_0x8f8b('0x118')](_0x31a942);}})[_0x8f8b('0x16')](function(_0x105bb1){if(_0x105bb1){return _0x105bb1?{'count':_0x2159b1,'rows':_0x105bb1}:null;}})[_0x8f8b('0x16')](respondWithResult(_0x52e7f3,null))['catch'](handleError(_0x52e7f3,null));};exports[_0x8f8b('0x119')]=function(_0x53e71f,_0x30d627){var _0x2f5d48={};var _0x16ddf2={};var _0x394d1c;return db[_0x8f8b('0x3e')][_0x8f8b('0x93')]({'where':{'id':_0x53e71f[_0x8f8b('0x53')]['id']}})['then'](handleEntityNotFound(_0x30d627,null))['then'](function(_0x8f0692){if(_0x8f0692){_0x394d1c=_0x8f0692;_0x16ddf2[_0x8f8b('0x54')]=_['keys'](db[_0x8f8b('0x3e')][_0x8f8b('0x3f')]);_0x16ddf2['query']=_['keys'](_0x53e71f['query']);_0x16ddf2[_0x8f8b('0xc5')]=_[_0x8f8b('0x57')](_0x16ddf2['model'],_0x16ddf2[_0x8f8b('0x47')]);_0x2f5d48[_0x8f8b('0x4a')]=_['intersection'](_0x16ddf2[_0x8f8b('0x54')],qs['fields'](_0x53e71f['query']['fields']));_0x2f5d48[_0x8f8b('0x4a')]=_0x2f5d48['attributes']['length']?_0x2f5d48[_0x8f8b('0x4a')]:_0x16ddf2[_0x8f8b('0x54')];_0x2f5d48[_0x8f8b('0xc7')]=qs[_0x8f8b('0xc8')](_0x53e71f[_0x8f8b('0x47')]['sort']);_0x2f5d48[_0x8f8b('0x45')]=qs[_0x8f8b('0xc5')](_['pick'](_0x53e71f[_0x8f8b('0x47')],_0x16ddf2[_0x8f8b('0xc5')]));if(_0x53e71f[_0x8f8b('0x47')][_0x8f8b('0x36')]){_0x2f5d48[_0x8f8b('0x45')]=_[_0x8f8b('0xca')](_0x2f5d48[_0x8f8b('0x45')],{'$or':_[_0x8f8b('0x37')](_0x2f5d48[_0x8f8b('0x4a')],function(_0x153c17){var _0x51dbc5={};_0x51dbc5[_0x153c17]={'$like':'%'+_0x53e71f[_0x8f8b('0x47')][_0x8f8b('0x36')]+'%'};return _0x51dbc5;})});}_0x2f5d48['model']=db[_0x8f8b('0x3e')];_0x2f5d48['as']=_0x8f8b('0x80');_0x2f5d48=_['merge']({},_0x2f5d48,_0x53e71f[_0x8f8b('0x5b')]);return _0x394d1c[_0x8f8b('0xf4')]({'include':[_0x2f5d48]});}})[_0x8f8b('0x16')](function(_0x1a24a5){if(_0x1a24a5){var _0x343941={},_0x186dc5=[];for(var _0x2a688c=0x0;_0x2a688c<_0x1a24a5[_0x8f8b('0x58')];_0x2a688c+=0x1){for(var _0x26b136=0x0,_0x7819d3;_0x26b136<_0x1a24a5[_0x2a688c][_0x8f8b('0x80')][_0x8f8b('0x58')];_0x26b136+=0x1){_0x7819d3=_0x1a24a5[_0x2a688c]['Agents'][_0x26b136][_0x8f8b('0x31')]({'plain':!![]});_0x343941[_0x7819d3['id']]=_0x7819d3;}}_0x343941=_[_0x8f8b('0x11a')](_0x343941);for(var _0x13a4e4=qs[_0x8f8b('0x28')](_0x53e71f[_0x8f8b('0x47')]['offset']);_0x13a4e4<_0x343941[_0x8f8b('0x58')]&&_0x186dc5[_0x8f8b('0x58')]=_0x271db7[_0x9d3d('0x4f')]){throw new Error(_0x9d3d('0x50'));}})['then'](function(){if(_0x5f45da){return db[_0x9d3d('0x24')][_0x9d3d('0x45')]({'where':{'membername':_0x5f45da[_0x9d3d('0x1e')]},'individualHooks':!![]});}})[_0x9d3d('0x16')](function(){if(_0x5f45da){return _0x5f45da['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x94f3b0){if(_0x5f45da){if(_0x94f3b0){var _0x552269=[];_0x12568a=_0x94f3b0;if(_0x12568a[_0x9d3d('0x28')]){for(var _0x62a5cb=0x0;_0x62a5cb<_0x12568a['length'];_0x62a5cb++){_0x552269[_0x9d3d('0x2c')](db[_0x9d3d('0x24')][_0x9d3d('0x51')]({'membername':_0x5f45da[_0x9d3d('0x1e')],'UserId':_0x5f45da['id'],'queue_name':_0x12568a[_0x62a5cb][_0x9d3d('0x1e')],'VoiceQueueId':_0x12568a[_0x62a5cb]['id'],'interface':_0x55ed23,'paused':_0x5f45da['loginInPause']||![],'penalty':_0x12568a[_0x62a5cb][_0x9d3d('0x52')]||0x0}));}return BPromise[_0x9d3d('0x47')](_0x552269);}}}})[_0x9d3d('0x16')](function(){if(_0x5f45da){return db[_0x9d3d('0x25')]['findAll']({'where':{'membername':_0x5f45da[_0x9d3d('0x1e')],'exitAt':null}});}})[_0x9d3d('0x16')](function(_0x4d0110){if(_0x5f45da){if(_0x4d0110&&_0x4d0110['length']){var _0x35816f=[];_0x4d0110[_0x9d3d('0x2b')](function(_0x1f2831){_0x35816f[_0x9d3d('0x2c')](_0x1f2831['update']({'exitAt':moment()[_0x9d3d('0x21')](_0x9d3d('0x27'))}));});return BPromise[_0x9d3d('0x47')](_0x35816f);}}})['then'](function(){if(_0x5f45da){var _0xe0cb49=[];var _0x10e72f=[];var _0x3bad0d=utils[_0x9d3d('0x2a')]();var _0xffc451={'membername':_0x5f45da[_0x9d3d('0x1e')],'interface':_0x55ed23,'enterAt':moment()[_0x9d3d('0x21')](_0x9d3d('0x27')),'role':_0x5f45da[_0x9d3d('0x1f')],'internal':_0x5f45da[_0x9d3d('0x20')]};_0x3bad0d[_0x9d3d('0x2b')](function(_0x5e7063){_0xe0cb49['push'](_[_0x9d3d('0x53')]({'channel':_0x5e7063,'type':'LOGIN','data1':_0x9d3d('0x54'),'data2':_0x55ed23},_0xffc451));if(_0x5f45da[_0x9d3d('0x4b')]){_0x10e72f[_0x9d3d('0x2c')](_['merge']({'channel':_0x5e7063,'type':_0x9d3d('0x30'),'data1':'LOGININPAUSE'},_0xffc451));}});return db[_0x9d3d('0x25')][_0x9d3d('0x34')](_0xe0cb49[_0x9d3d('0x55')](_0x10e72f),{'individualHooks':!![]});}})[_0x9d3d('0x16')](function(){if(_0x5f45da){return _0x5f45da[_0x9d3d('0x46')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x5f45da[_0x9d3d('0x4b')]||![],'mailPause':_0x5f45da[_0x9d3d('0x4b')]||![],'chatPause':_0x5f45da[_0x9d3d('0x4b')]||![],'faxPause':_0x5f45da[_0x9d3d('0x4b')]||![],'smsPause':_0x5f45da[_0x9d3d('0x4b')]||![],'openchannelPause':_0x5f45da[_0x9d3d('0x4b')]||![],'pauseType':_0x5f45da[_0x9d3d('0x4b')]?_0x9d3d('0x56'):null,'lastPauseAt':moment()[_0x9d3d('0x21')](_0x9d3d('0x27')),'interface':_0x55ed23});}})[_0x9d3d('0x16')](function(_0x5e5ca3){_0x347dff(_0x5e5ca3);})[_0x9d3d('0x17')](function(_0x5e201c){_0x301548(_0x314347[_0x9d3d('0x18')](0x1f4,_0x5e201c[_0x9d3d('0x1c')]));});});}; \ No newline at end of file +var _0x05ed=['YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','isNil','SIP/%s','interface','PAUSE','body','type','DEFAULT\x20PAUSE','role','uniqueid','bulkCreate','resolve','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','online','voicePause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','unpause','system','LogoutUser','findOne','destroy','push','all','LoginUser','phone','loginInPause','agent','../../config/license/util','getLicense','agents','upsert','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','GetUser','User','findAll','options','raw','where','attributes','limit','map','include','model','info','debug','stringify','catch','error','message','find','then','ShowUser','PauseUser','name','internal','format','User\x20with\x20id\x20%s\x20not\x20found','UserVoiceQueueRt','update','MemberReport','length'];(function(_0x396bfb,_0x19774c){var _0x1dbde7=function(_0x16e410){while(--_0x16e410){_0x396bfb['push'](_0x396bfb['shift']());}};_0x1dbde7(++_0x19774c);}(_0x05ed,0x136));var _0xd05e=function(_0x430524,_0x23b611){_0x430524=_0x430524-0x0;var _0x3a726d=_0x05ed[_0x430524];return _0x3a726d;};'use strict';var _=require(_0xd05e('0x0'));var util=require(_0xd05e('0x1'));var moment=require(_0xd05e('0x2'));var BPromise=require(_0xd05e('0x3'));var Redis=require('ioredis');var db=require(_0xd05e('0x4'))['db'];var utils=require(_0xd05e('0x5'));var logger=require(_0xd05e('0x6'))(_0xd05e('0x7'));var config=require(_0xd05e('0x8'));config[_0xd05e('0x9')]=_[_0xd05e('0xa')](config['redis'],{'host':_0xd05e('0xb'),'port':0x18eb});var socket=require(_0xd05e('0xc'))(new Redis(config[_0xd05e('0x9')]));require('./user.socket')['register'](socket);exports[_0xd05e('0xd')]=function(_0x2bf2eb){var _0x5d97c4=this;return new Promise(function(_0x19033e,_0x49266b){return db[_0xd05e('0xe')][_0xd05e('0xf')]({'raw':_0x2bf2eb[_0xd05e('0x10')]?_0x2bf2eb['options'][_0xd05e('0x11')]===undefined?!![]:![]:!![],'where':_0x2bf2eb['options']?_0x2bf2eb[_0xd05e('0x10')][_0xd05e('0x12')]||null:null,'attributes':_0x2bf2eb[_0xd05e('0x10')]?_0x2bf2eb['options'][_0xd05e('0x13')]||null:null,'limit':_0x2bf2eb['options']?_0x2bf2eb['options'][_0xd05e('0x14')]||null:null,'include':_0x2bf2eb[_0xd05e('0x10')]?_0x2bf2eb['options']['include']?_[_0xd05e('0x15')](_0x2bf2eb[_0xd05e('0x10')][_0xd05e('0x16')],function(_0x528d9f){return{'model':db[_0x528d9f[_0xd05e('0x17')]],'as':_0x528d9f['as'],'attributes':_0x528d9f['attributes'],'include':_0x528d9f[_0xd05e('0x16')]?_['map'](_0x528d9f[_0xd05e('0x16')],function(_0x587707){return{'model':db[_0x587707[_0xd05e('0x17')]],'as':_0x587707['as'],'attributes':_0x587707[_0xd05e('0x13')],'include':_0x587707[_0xd05e('0x16')]?_[_0xd05e('0x15')](_0x587707[_0xd05e('0x16')],function(_0x2b066f){return{'model':db[_0x2b066f[_0xd05e('0x17')]],'as':_0x2b066f['as'],'attributes':_0x2b066f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x8358a7){logger[_0xd05e('0x18')](_0xd05e('0xd'),_0x2bf2eb);logger[_0xd05e('0x19')](_0xd05e('0xd'),_0x2bf2eb,JSON[_0xd05e('0x1a')](_0x8358a7));_0x19033e(_0x8358a7);})[_0xd05e('0x1b')](function(_0x3a4087){logger['error'](_0xd05e('0xd'),_0x3a4087['message'],_0x2bf2eb);_0x49266b(_0x5d97c4[_0xd05e('0x1c')](0x1f4,_0x3a4087[_0xd05e('0x1d')]));});});};exports['ShowUser']=function(_0x8b86d6){var _0x157974=this;return new Promise(function(_0x3c6cad,_0x4b8af4){return db[_0xd05e('0xe')][_0xd05e('0x1e')]({'raw':_0x8b86d6[_0xd05e('0x10')]?_0x8b86d6['options'][_0xd05e('0x11')]===undefined?!![]:![]:!![],'where':_0x8b86d6[_0xd05e('0x10')]?_0x8b86d6[_0xd05e('0x10')][_0xd05e('0x12')]||null:null,'attributes':_0x8b86d6[_0xd05e('0x10')]?_0x8b86d6[_0xd05e('0x10')]['attributes']||null:null,'include':_0x8b86d6[_0xd05e('0x10')]?_0x8b86d6[_0xd05e('0x10')][_0xd05e('0x16')]?_['map'](_0x8b86d6[_0xd05e('0x10')][_0xd05e('0x16')],function(_0x4e8227){return{'model':db[_0x4e8227[_0xd05e('0x17')]],'as':_0x4e8227['as'],'attributes':_0x4e8227['attributes'],'include':_0x4e8227['include']?_[_0xd05e('0x15')](_0x4e8227[_0xd05e('0x16')],function(_0x18b93f){return{'model':db[_0x18b93f[_0xd05e('0x17')]],'as':_0x18b93f['as'],'attributes':_0x18b93f[_0xd05e('0x13')],'include':_0x18b93f['include']?_['map'](_0x18b93f[_0xd05e('0x16')],function(_0x81ce63){return{'model':db[_0x81ce63['model']],'as':_0x81ce63['as'],'attributes':_0x81ce63[_0xd05e('0x13')]};}):[]};}):[]};}):[]:[]})[_0xd05e('0x1f')](function(_0x44ec60){logger[_0xd05e('0x18')](_0xd05e('0x20'),_0x8b86d6);logger[_0xd05e('0x19')](_0xd05e('0x20'),_0x8b86d6,JSON[_0xd05e('0x1a')](_0x44ec60));_0x3c6cad(_0x44ec60);})['catch'](function(_0xd1ebc2){logger[_0xd05e('0x1c')](_0xd05e('0x20'),_0xd1ebc2[_0xd05e('0x1d')],_0x8b86d6);_0x4b8af4(_0x157974[_0xd05e('0x1c')](0x1f4,_0xd1ebc2[_0xd05e('0x1d')]));});});};exports[_0xd05e('0x21')]=function(_0x38ae79){var _0x10a267;return db[_0xd05e('0xe')][_0xd05e('0x1e')]({'where':_0x38ae79['options'][_0xd05e('0x12')]||{},'attributes':['id',_0xd05e('0x22'),'role',_0xd05e('0x23'),'interface']})[_0xd05e('0x1f')](function(_0x57d978){if(!_0x57d978){throw new Error(util[_0xd05e('0x24')](_0xd05e('0x25'),_0x38ae79['params']['id']));}_0x10a267=_0x57d978;return db[_0xd05e('0x26')][_0xd05e('0x27')]({'paused':0x1},{'where':{'UserId':_0x10a267['id']},'individualHooks':!![]});})[_0xd05e('0x1f')](function(){return db[_0xd05e('0x28')][_0xd05e('0xf')]({'where':{'membername':_0x10a267['name'],'type':'PAUSE','exitAt':null}});})[_0xd05e('0x1f')](function(_0x1abcbe){if(_0x1abcbe&&_0x1abcbe[_0xd05e('0x29')]){var _0x3ce59f=moment()[_0xd05e('0x24')](_0xd05e('0x2a'));for(var _0x18562f=0x0,_0x1287a3=_0x1abcbe[_0xd05e('0x29')];_0x18562f<_0x1287a3;_0x18562f++){_0x1abcbe[_0x18562f][_0xd05e('0x2b')]({'exitAt':_0x3ce59f});}}})['then'](function(){var _0x16493d=[];var _0x53911e=utils[_0xd05e('0x2c')]();_0x53911e[_0xd05e('0x2d')](function(_0xd10777){_0x16493d['push']({'channel':_0xd10777,'membername':_0x10a267[_0xd05e('0x22')],'interface':_[_0xd05e('0x2e')](_0x10a267['interface'])?util['format'](_0xd05e('0x2f'),_0x10a267[_0xd05e('0x22')]):_0x10a267[_0xd05e('0x30')],'type':_0xd05e('0x31'),'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x38ae79[_0xd05e('0x32')][_0xd05e('0x33')]||_0xd05e('0x34'),'role':_0x10a267[_0xd05e('0x35')],'internal':_0x10a267[_0xd05e('0x23')],'uniqueid':_0x38ae79['body'][_0xd05e('0x36')]||null});});return db[_0xd05e('0x28')][_0xd05e('0x37')](_0x16493d,{'individualHooks':!![]});})[_0xd05e('0x1f')](function(){return _0x10a267[_0xd05e('0x27')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x38ae79[_0xd05e('0x32')]['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xd05e('0x24')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xd05e('0x1b')](function(_0x346bcd){throw _0x346bcd;});};exports['UnpauseUser']=function(_0x213841){return Promise[_0xd05e('0x38')]()['then'](function(){if(_0x213841[_0xd05e('0x32')][_0xd05e('0x39')]&&!utils[_0xd05e('0x3a')](_0x213841['body']['channel'])){throw new Error(util[_0xd05e('0x24')](_0xd05e('0x3b'),_0x213841[_0xd05e('0x32')][_0xd05e('0x39')]));}return db[_0xd05e('0xe')]['findOne']({'where':_0x213841['options'][_0xd05e('0x12')]||{},'attributes':['id',_0xd05e('0x22'),_0xd05e('0x35'),_0xd05e('0x23'),_0xd05e('0x30'),_0xd05e('0x3c'),_0xd05e('0x3d'),_0xd05e('0x3e'),_0xd05e('0x3f'),_0xd05e('0x40'),_0xd05e('0x41'),_0xd05e('0x42'),_0xd05e('0x43'),'pauseType','lastPauseAt']});})[_0xd05e('0x1f')](function(_0x2e2963){if(!_0x2e2963){throw new Error(util[_0xd05e('0x24')](_0xd05e('0x25'),_0x213841['params']['id']));}return _0x2e2963[_0xd05e('0x44')](_0x213841[_0xd05e('0x32')][_0xd05e('0x39')],_0xd05e('0x45'));})[_0xd05e('0x1b')](function(_0x1204ce){throw _0x1204ce;});};exports[_0xd05e('0x46')]=function(_0xb375e3){var _0x22ad7c=this;return new Promise(function(_0x22cef7,_0x5e6742){var _0x31f1ef;return db[_0xd05e('0xe')][_0xd05e('0x47')]({'where':_0xb375e3[_0xd05e('0x10')][_0xd05e('0x12')]||{},'attributes':['id',_0xd05e('0x22')]})['then'](function(_0x49ac33){if(_0x49ac33){_0x31f1ef=_0x49ac33;return db['UserVoiceQueueRt'][_0xd05e('0x48')]({'where':{'membername':_0x31f1ef[_0xd05e('0x22')]},'individualHooks':!![]});}})[_0xd05e('0x1f')](function(){if(_0x31f1ef){return db['MemberReport'][_0xd05e('0xf')]({'where':{'membername':_0x31f1ef['name'],'exitAt':null}});}})['then'](function(_0x2ef04c){if(_0x31f1ef){if(_0x2ef04c&&_0x2ef04c[_0xd05e('0x29')]){var _0x317820=[];_0x2ef04c[_0xd05e('0x2d')](function(_0x1a407e){_0x317820[_0xd05e('0x49')](_0x1a407e[_0xd05e('0x27')]({'exitAt':moment()[_0xd05e('0x24')](_0xd05e('0x2a'))}));});return BPromise[_0xd05e('0x4a')](_0x317820);}}})[_0xd05e('0x1f')](function(){if(_0x31f1ef){return _0x31f1ef['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xd05e('0x1f')](function(_0x2dd285){_0x22cef7(_0x2dd285);})[_0xd05e('0x1b')](function(_0xb215c4){_0x5e6742(_0x22ad7c[_0xd05e('0x1c')](0x1f4,_0xb215c4[_0xd05e('0x1d')]));});});};exports[_0xd05e('0x4b')]=function(_0x5017c9){var _0x5216b8=this;return new Promise(function(_0x885b1f,_0x3518be){var _0x38d529;var _0x34fcf8;var _0x335226;var _0x3380cd;return db[_0xd05e('0xe')][_0xd05e('0x47')]({'where':_0x5017c9[_0xd05e('0x10')]['where']||{},'attributes':['id',_0xd05e('0x22'),_0xd05e('0x35'),'mobile',_0xd05e('0x4c'),_0xd05e('0x23'),_0xd05e('0x4d'),_0xd05e('0x30')]})[_0xd05e('0x1f')](function(_0x515dc7){if(_0x515dc7){_0x38d529=_0x515dc7;_0x3380cd=_0x5017c9['body'][_0xd05e('0x30')]?_0x5017c9[_0xd05e('0x32')][_0xd05e('0x30')]:util[_0xd05e('0x24')](_0xd05e('0x2f'),_0x38d529[_0xd05e('0x22')]);return db[_0xd05e('0xe')]['count']({'where':{'role':_0xd05e('0x4e'),'online':!![],'id':{'$ne':_0x38d529['id']}}});}})[_0xd05e('0x1f')](function(_0x4a5b65){if(_0x4a5b65){_0x335226=_0x4a5b65;return require(_0xd05e('0x4f'))[_0xd05e('0x50')]();}})['then'](function(_0x678ebb){if(_0x678ebb&&_0x678ebb[_0xd05e('0x51')]&&_0x335226>=_0x678ebb[_0xd05e('0x51')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0xd05e('0x1f')](function(){if(_0x38d529){return db[_0xd05e('0x26')][_0xd05e('0x48')]({'where':{'membername':_0x38d529[_0xd05e('0x22')]},'individualHooks':!![]});}})[_0xd05e('0x1f')](function(){if(_0x38d529){return _0x38d529['getVoiceQueues']({'raw':!![]});}})[_0xd05e('0x1f')](function(_0x53c790){if(_0x38d529){if(_0x53c790){var _0x49bf6=[];_0x34fcf8=_0x53c790;if(_0x34fcf8[_0xd05e('0x29')]){for(var _0x8b8b08=0x0;_0x8b8b08<_0x34fcf8[_0xd05e('0x29')];_0x8b8b08++){_0x49bf6['push'](db[_0xd05e('0x26')][_0xd05e('0x52')]({'membername':_0x38d529[_0xd05e('0x22')],'UserId':_0x38d529['id'],'queue_name':_0x34fcf8[_0x8b8b08]['name'],'VoiceQueueId':_0x34fcf8[_0x8b8b08]['id'],'interface':_0x3380cd,'paused':_0x38d529['loginInPause']||![],'penalty':_0x34fcf8[_0x8b8b08][_0xd05e('0x53')]||0x0}));}return BPromise[_0xd05e('0x4a')](_0x49bf6);}}}})[_0xd05e('0x1f')](function(){if(_0x38d529){return db[_0xd05e('0x28')][_0xd05e('0xf')]({'where':{'membername':_0x38d529['name'],'exitAt':null}});}})[_0xd05e('0x1f')](function(_0xb6282){if(_0x38d529){if(_0xb6282&&_0xb6282[_0xd05e('0x29')]){var _0x5895e4=[];_0xb6282[_0xd05e('0x2d')](function(_0x37e1b5){_0x5895e4[_0xd05e('0x49')](_0x37e1b5[_0xd05e('0x27')]({'exitAt':moment()[_0xd05e('0x24')](_0xd05e('0x2a'))}));});return BPromise[_0xd05e('0x4a')](_0x5895e4);}}})[_0xd05e('0x1f')](function(){if(_0x38d529){var _0x638a07=[];var _0x5c85c8=[];var _0x356f6d=utils[_0xd05e('0x2c')]();var _0x3e47a7={'membername':_0x38d529['name'],'interface':_0x3380cd,'enterAt':moment()[_0xd05e('0x24')](_0xd05e('0x2a')),'role':_0x38d529['role'],'internal':_0x38d529['internal']};_0x356f6d[_0xd05e('0x2d')](function(_0x31b147){_0x638a07['push'](_[_0xd05e('0x54')]({'channel':_0x31b147,'type':_0xd05e('0x55'),'data1':_0xd05e('0x56'),'data2':_0x3380cd},_0x3e47a7));if(_0x38d529[_0xd05e('0x4d')]){_0x5c85c8[_0xd05e('0x49')](_[_0xd05e('0x54')]({'channel':_0x31b147,'type':'PAUSE','data1':_0xd05e('0x57')},_0x3e47a7));}});return db['MemberReport'][_0xd05e('0x37')](_0x638a07['concat'](_0x5c85c8),{'individualHooks':!![]});}})[_0xd05e('0x1f')](function(){if(_0x38d529){return _0x38d529[_0xd05e('0x27')]({'online':!![],'lastLoginAt':moment()[_0xd05e('0x24')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x38d529[_0xd05e('0x4d')]||![],'mailPause':_0x38d529['loginInPause']||![],'chatPause':_0x38d529[_0xd05e('0x4d')]||![],'faxPause':_0x38d529[_0xd05e('0x4d')]||![],'smsPause':_0x38d529['loginInPause']||![],'openchannelPause':_0x38d529[_0xd05e('0x4d')]||![],'pauseType':_0x38d529[_0xd05e('0x4d')]?_0xd05e('0x57'):null,'lastPauseAt':moment()['format'](_0xd05e('0x2a')),'interface':_0x3380cd});}})[_0xd05e('0x1f')](function(_0x3b1fe1){_0x885b1f(_0x3b1fe1);})[_0xd05e('0x1b')](function(_0x49f412){_0x3518be(_0x5216b8[_0xd05e('0x1c')](0x1f4,_0x49f412['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 7cb7798..c1648c0 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 _0x6d49=['register','length','./user.events','remove','update','emit','removeListener'];(function(_0x42be43,_0x1fa50b){var _0x41ede7=function(_0x49e65f){while(--_0x49e65f){_0x42be43['push'](_0x42be43['shift']());}};_0x41ede7(++_0x1fa50b);}(_0x6d49,0x1b4));var _0x96d4=function(_0x11d19f,_0x38986e){_0x11d19f=_0x11d19f-0x0;var _0x26dbfb=_0x6d49[_0x11d19f];return _0x26dbfb;};'use strict';var UserEvents=require(_0x96d4('0x0'));var events=['save',_0x96d4('0x1'),_0x96d4('0x2')];function createListener(_0x2a2b1a,_0x365406){return function(_0x5beef1){_0x365406[_0x96d4('0x3')](_0x2a2b1a,_0x5beef1);};}function removeListener(_0x3778d5,_0x29ed35){return function(){UserEvents[_0x96d4('0x4')](_0x3778d5,_0x29ed35);};}exports[_0x96d4('0x5')]=function(_0x2dd1fc){for(var _0x3c6358=0x0,_0x23704f=events[_0x96d4('0x6')];_0x3c6358<_0x23704f;_0x3c6358++){var _0x5bd89b=events[_0x3c6358];var _0x27f09d=createListener('user:'+_0x5bd89b,_0x2dd1fc);UserEvents['on'](_0x5bd89b,_0x27f09d);}}; \ No newline at end of file +var _0xa013=['update','emit','removeListener','register','length','./user.events','save','remove'];(function(_0x3d7b6d,_0x45756a){var _0x30991e=function(_0x182e42){while(--_0x182e42){_0x3d7b6d['push'](_0x3d7b6d['shift']());}};_0x30991e(++_0x45756a);}(_0xa013,0x105));var _0x3a01=function(_0x382c73,_0x199cab){_0x382c73=_0x382c73-0x0;var _0x1dd0bf=_0xa013[_0x382c73];return _0x1dd0bf;};'use strict';var UserEvents=require(_0x3a01('0x0'));var events=[_0x3a01('0x1'),_0x3a01('0x2'),_0x3a01('0x3')];function createListener(_0x34f922,_0x43bce9){return function(_0x2b4e0e){_0x43bce9[_0x3a01('0x4')](_0x34f922,_0x2b4e0e);};}function removeListener(_0x2ec694,_0x7b2091){return function(){UserEvents[_0x3a01('0x5')](_0x2ec694,_0x7b2091);};}exports[_0x3a01('0x6')]=function(_0x3586ce){for(var _0x47babb=0x0,_0x369db1=events[_0x3a01('0x7')];_0x47babb<_0x369db1;_0x47babb++){var _0x1b24ce=events[_0x47babb];var _0x2f9b8e=createListener('user:'+_0x1b24ce,_0x3586ce);UserEvents['on'](_0x1b24ce,_0x2f9b8e);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 6a5a5e0..39deaf1 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x43f9da,_0x36241f){var _0x4d92a3=function(_0x183b5f){while(--_0x183b5f){_0x43f9da['push'](_0x43f9da['shift']());}};_0x4d92a3(++_0x36241f);}(_0xedd9,0xfc));var _0x9edd=function(_0x10f6c4,_0x31517b){_0x10f6c4=_0x10f6c4-0x0;var _0x139a91=_0xedd9[_0x10f6c4];return _0x139a91;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x184ed0,_0x36b0ab){var _0x3aece9=function(_0x46c624){while(--_0x46c624){_0x184ed0['push'](_0x184ed0['shift']());}};_0x3aece9(++_0x36b0ab);}(_0xedd9,0xfc));var _0x9edd=function(_0x206566,_0x537496){_0x206566=_0x206566-0x0;var _0x17bbc5=_0xedd9[_0x206566];return _0x17bbc5;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index b26beef..56fafd8 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 _0xeea5=['sequelize','exports','INTEGER'];(function(_0x51bc98,_0x2a364c){var _0x7e5529=function(_0x5655c7){while(--_0x5655c7){_0x51bc98['push'](_0x51bc98['shift']());}};_0x7e5529(++_0x2a364c);}(_0xeea5,0x177));var _0x5eea=function(_0x171d26,_0x1dcf74){_0x171d26=_0x171d26-0x0;var _0x1c3c83=_0xeea5[_0x171d26];return _0x1c3c83;};'use strict';var Sequelize=require(_0x5eea('0x0'));module[_0x5eea('0x1')]={'penalty':{'type':Sequelize[_0x5eea('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xff3e=['INTEGER'];(function(_0x39d0ae,_0x4ca009){var _0x54c82a=function(_0x41abff){while(--_0x41abff){_0x39d0ae['push'](_0x39d0ae['shift']());}};_0x54c82a(++_0x4ca009);}(_0xff3e,0x166));var _0xeff3=function(_0x12db20,_0x493c1a){_0x12db20=_0x12db20-0x0;var _0xf129aa=_0xff3e[_0x12db20];return _0xf129aa;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xeff3('0x0')],'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 8251b63..c0a4603 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 _0xb6b9=['exports','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./userChatQueue.attributes'];(function(_0x2c6bad,_0x29ffed){var _0x5f5435=function(_0x23f89b){while(--_0x23f89b){_0x2c6bad['push'](_0x2c6bad['shift']());}};_0x5f5435(++_0x29ffed);}(_0xb6b9,0xad));var _0x9b6b=function(_0x27f2b8,_0x26a1e5){_0x27f2b8=_0x27f2b8-0x0;var _0x2eecac=_0xb6b9[_0x27f2b8];return _0x2eecac;};'use strict';var _=require(_0x9b6b('0x0'));var util=require(_0x9b6b('0x1'));var logger=require(_0x9b6b('0x2'))(_0x9b6b('0x3'));var moment=require(_0x9b6b('0x4'));var BPromise=require(_0x9b6b('0x5'));var rp=require(_0x9b6b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9b6b('0x7'));var attributes=require(_0x9b6b('0x8'));module[_0x9b6b('0x9')]=function(_0x1ef6f4,_0x2c2d87){return _0x1ef6f4[_0x9b6b('0xa')](_0x9b6b('0xb'),attributes,{'tableName':_0x9b6b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedc2=['../../config/environment','./userChatQueue.attributes','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment'];(function(_0x53bd51,_0x1e4cb7){var _0x53a629=function(_0x412b2d){while(--_0x412b2d){_0x53bd51['push'](_0x53bd51['shift']());}};_0x53a629(++_0x1e4cb7);}(_0xedc2,0x109));var _0x2edc=function(_0x97c623,_0x2c3d02){_0x97c623=_0x97c623-0x0;var _0x1bca45=_0xedc2[_0x97c623];return _0x1bca45;};'use strict';var _=require(_0x2edc('0x0'));var util=require(_0x2edc('0x1'));var logger=require(_0x2edc('0x2'))(_0x2edc('0x3'));var moment=require(_0x2edc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2edc('0x5'));var attributes=require(_0x2edc('0x6'));module['exports']=function(_0x4821ec,_0x31ac79){return _0x4821ec[_0x2edc('0x7')](_0x2edc('0x8'),attributes,{'tableName':_0x2edc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 3a27e5f..fa04095 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 _0xf0c6=['catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x446dea,_0x44b6e0){var _0x19d2f1=function(_0x1bbee0){while(--_0x1bbee0){_0x446dea['push'](_0x446dea['shift']());}};_0x19d2f1(++_0x44b6e0);}(_0xf0c6,0x144));var _0x6f0c=function(_0x45244a,_0x2d3d7e){_0x45244a=_0x45244a-0x0;var _0x433d8e=_0xf0c6[_0x45244a];return _0x433d8e;};'use strict';var _=require(_0x6f0c('0x0'));var util=require(_0x6f0c('0x1'));var moment=require(_0x6f0c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f0c('0x3'));var db=require(_0x6f0c('0x4'))['db'];var utils=require(_0x6f0c('0x5'));var logger=require(_0x6f0c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x6f0c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x18e613,_0x485936,_0x9044eb){return new BPromise(function(_0x4a0c6f,_0x143e2c){return client['request'](_0x18e613,_0x9044eb)['then'](function(_0x36158e){logger[_0x6f0c('0x8')](_0x6f0c('0x9'),_0x485936,'request\x20sent');logger[_0x6f0c('0xa')](_0x6f0c('0xb'),_0x485936,'request\x20sent',JSON['stringify'](_0x36158e));if(_0x36158e[_0x6f0c('0xc')]){if(_0x36158e[_0x6f0c('0xc')][_0x6f0c('0xd')]===0x1f4){logger[_0x6f0c('0xc')](_0x6f0c('0x9'),_0x485936,_0x36158e[_0x6f0c('0xc')][_0x6f0c('0xe')]);return _0x143e2c(_0x36158e[_0x6f0c('0xc')]['message']);}logger[_0x6f0c('0xc')](_0x6f0c('0x9'),_0x485936,_0x36158e['error']['message']);return _0x4a0c6f(_0x36158e[_0x6f0c('0xc')][_0x6f0c('0xe')]);}else{logger['info'](_0x6f0c('0x9'),_0x485936,'request\x20sent');_0x4a0c6f(_0x36158e[_0x6f0c('0xf')][_0x6f0c('0xe')]);}})[_0x6f0c('0x10')](function(_0x166e75){logger[_0x6f0c('0xc')]('UserChatQueue,\x20%s,\x20%s',_0x485936,_0x166e75);_0x143e2c(_0x166e75);});});} \ No newline at end of file +var _0x1faf=['error','message','info','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s'];(function(_0x59f7a7,_0xce39b2){var _0x15da0d=function(_0x1e0e64){while(--_0x1e0e64){_0x59f7a7['push'](_0x59f7a7['shift']());}};_0x15da0d(++_0xce39b2);}(_0x1faf,0x180));var _0xf1fa=function(_0x1e68a7,_0x35e482){_0x1e68a7=_0x1e68a7-0x0;var _0x5f4b47=_0x1faf[_0x1e68a7];return _0x5f4b47;};'use strict';var _=require('lodash');var util=require(_0xf1fa('0x0'));var moment=require('moment');var BPromise=require(_0xf1fa('0x1'));var rs=require(_0xf1fa('0x2'));var fs=require('fs');var Redis=require(_0xf1fa('0x3'));var db=require(_0xf1fa('0x4'))['db'];var utils=require(_0xf1fa('0x5'));var logger=require(_0xf1fa('0x6'))(_0xf1fa('0x7'));var config=require(_0xf1fa('0x8'));var jayson=require(_0xf1fa('0x9'));var client=jayson[_0xf1fa('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30dd9a,_0x196fd6,_0x38778b){return new BPromise(function(_0x108e21,_0x54ea65){return client['request'](_0x30dd9a,_0x38778b)['then'](function(_0x18e31d){logger['info'](_0xf1fa('0xb'),_0x196fd6,_0xf1fa('0xc'));logger[_0xf1fa('0xd')](_0xf1fa('0xe'),_0x196fd6,_0xf1fa('0xc'),JSON['stringify'](_0x18e31d));if(_0x18e31d[_0xf1fa('0xf')]){if(_0x18e31d[_0xf1fa('0xf')]['code']===0x1f4){logger[_0xf1fa('0xf')](_0xf1fa('0xb'),_0x196fd6,_0x18e31d[_0xf1fa('0xf')]['message']);return _0x54ea65(_0x18e31d['error'][_0xf1fa('0x10')]);}logger['error'](_0xf1fa('0xb'),_0x196fd6,_0x18e31d['error'][_0xf1fa('0x10')]);return _0x108e21(_0x18e31d[_0xf1fa('0xf')][_0xf1fa('0x10')]);}else{logger[_0xf1fa('0x11')](_0xf1fa('0xb'),_0x196fd6,_0xf1fa('0xc'));_0x108e21(_0x18e31d['result']['message']);}})[_0xf1fa('0x12')](function(_0x2e08bd){logger['error'](_0xf1fa('0xb'),_0x196fd6,_0x2e08bd);_0x54ea65(_0x2e08bd);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 3c93b9e..377ed94 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2f1747,_0x2e6b77){var _0xecbca7=function(_0xf58911){while(--_0xf58911){_0x2f1747['push'](_0x2f1747['shift']());}};_0xecbca7(++_0x2e6b77);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x59b9e9,_0x401896){var _0x44ca5c=function(_0x3a95b4){while(--_0x3a95b4){_0x59b9e9['push'](_0x59b9e9['shift']());}};_0x44ca5c(++_0x401896);}(_0x70e0,0x17b));var _0x070e=function(_0xe50576,_0x35c6f9){_0xe50576=_0xe50576-0x0;var _0x2071ee=_0x70e0[_0xe50576];return _0x2071ee;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 247385f..12c8571 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 _0x69f4=['sequelize','exports','INTEGER','STRING'];(function(_0x45a4f2,_0x11dd99){var _0x480901=function(_0x3dbb63){while(--_0x3dbb63){_0x45a4f2['push'](_0x45a4f2['shift']());}};_0x480901(++_0x11dd99);}(_0x69f4,0x90));var _0x469f=function(_0x173a3f,_0x3681b6){_0x173a3f=_0x173a3f-0x0;var _0x6f031b=_0x69f4[_0x173a3f];return _0x6f031b;};'use strict';var Sequelize=require(_0x469f('0x0'));module[_0x469f('0x1')]={'penalty':{'type':Sequelize[_0x469f('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x469f('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x469f('0x3')]}}; \ No newline at end of file +var _0x8abc=['sequelize','exports','INTEGER','STRING'];(function(_0x183f4f,_0x2c5ea9){var _0x450fdc=function(_0x13e19c){while(--_0x13e19c){_0x183f4f['push'](_0x183f4f['shift']());}};_0x450fdc(++_0x2c5ea9);}(_0x8abc,0x140));var _0xc8ab=function(_0x2073f6,_0x1fbaf9){_0x2073f6=_0x2073f6-0x0;var _0x15a388=_0x8abc[_0x2073f6];return _0x15a388;};'use strict';var Sequelize=require(_0xc8ab('0x0'));module[_0xc8ab('0x1')]={'penalty':{'type':Sequelize[_0xc8ab('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0xc8ab('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index e25adbf..9ff5fd8 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 _0x0eef=['exports','define','UserFaxQueue','user_has_fax_queues','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x1d4219,_0x2cad93){var _0x413f97=function(_0x5e707f){while(--_0x5e707f){_0x1d4219['push'](_0x1d4219['shift']());}};_0x413f97(++_0x2cad93);}(_0x0eef,0x118));var _0xf0ee=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x0eef[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xf0ee('0x0'));var util=require('util');var logger=require(_0xf0ee('0x1'))(_0xf0ee('0x2'));var moment=require(_0xf0ee('0x3'));var BPromise=require('bluebird');var rp=require(_0xf0ee('0x4'));var fs=require('fs');var path=require(_0xf0ee('0x5'));var rimraf=require(_0xf0ee('0x6'));var config=require(_0xf0ee('0x7'));var attributes=require('./userFaxQueue.attributes');module[_0xf0ee('0x8')]=function(_0x3feb94,_0xec5d74){return _0x3feb94[_0xf0ee('0x9')](_0xf0ee('0xa'),attributes,{'tableName':_0xf0ee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x05ef=['request-promise','path','../../config/environment','./userFaxQueue.attributes','define','UserFaxQueue','user_has_fax_queues','lodash','util','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x05ef,0x67));var _0xf05e=function(_0x5cf3a3,_0x29327c){_0x5cf3a3=_0x5cf3a3-0x0;var _0x349b78=_0x05ef[_0x5cf3a3];return _0x349b78;};'use strict';var _=require(_0xf05e('0x0'));var util=require(_0xf05e('0x1'));var logger=require('../../config/logger')(_0xf05e('0x2'));var moment=require(_0xf05e('0x3'));var BPromise=require(_0xf05e('0x4'));var rp=require(_0xf05e('0x5'));var fs=require('fs');var path=require(_0xf05e('0x6'));var rimraf=require('rimraf');var config=require(_0xf05e('0x7'));var attributes=require(_0xf05e('0x8'));module['exports']=function(_0x18bc83,_0x425384){return _0x18bc83[_0xf05e('0x9')](_0xf05e('0xa'),attributes,{'tableName':_0xf05e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 0be2c00..344882a 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 _0x904e=['jayson/promise','client','request','then','UserFaxQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x24ad12,_0x20e6dc){var _0x588961=function(_0x493e1d){while(--_0x493e1d){_0x24ad12['push'](_0x24ad12['shift']());}};_0x588961(++_0x20e6dc);}(_0x904e,0x7b));var _0xe904=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x904e[_0x160c73];return _0xd9302;};'use strict';var _=require(_0xe904('0x0'));var util=require(_0xe904('0x1'));var moment=require(_0xe904('0x2'));var BPromise=require(_0xe904('0x3'));var rs=require(_0xe904('0x4'));var fs=require('fs');var Redis=require(_0xe904('0x5'));var db=require(_0xe904('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe904('0x7'))(_0xe904('0x8'));var config=require('../../config/environment');var jayson=require(_0xe904('0x9'));var client=jayson[_0xe904('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x538f90,_0x2789f3,_0x48c738){return new BPromise(function(_0x1bc3d6,_0x18935b){return client[_0xe904('0xb')](_0x538f90,_0x48c738)[_0xe904('0xc')](function(_0xc621a1){logger['info'](_0xe904('0xd'),_0x2789f3,'request\x20sent');logger[_0xe904('0xe')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x2789f3,_0xe904('0xf'),JSON[_0xe904('0x10')](_0xc621a1));if(_0xc621a1[_0xe904('0x11')]){if(_0xc621a1[_0xe904('0x11')][_0xe904('0x12')]===0x1f4){logger[_0xe904('0x11')](_0xe904('0xd'),_0x2789f3,_0xc621a1[_0xe904('0x11')][_0xe904('0x13')]);return _0x18935b(_0xc621a1[_0xe904('0x11')][_0xe904('0x13')]);}logger[_0xe904('0x11')](_0xe904('0xd'),_0x2789f3,_0xc621a1['error'][_0xe904('0x13')]);return _0x1bc3d6(_0xc621a1[_0xe904('0x11')][_0xe904('0x13')]);}else{logger['info'](_0xe904('0xd'),_0x2789f3,_0xe904('0xf'));_0x1bc3d6(_0xc621a1[_0xe904('0x14')][_0xe904('0x13')]);}})[_0xe904('0x15')](function(_0x1c3c43){logger[_0xe904('0x11')](_0xe904('0xd'),_0x2789f3,_0x1c3c43);_0x18935b(_0x1c3c43);});});} \ No newline at end of file +var _0x34cd=['catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1d734a,_0xf7cfec){var _0x3eef41=function(_0x5a8d18){while(--_0x5a8d18){_0x1d734a['push'](_0x1d734a['shift']());}};_0x3eef41(++_0xf7cfec);}(_0x34cd,0x1e1));var _0xd34c=function(_0x2644ba,_0x46bc79){_0x2644ba=_0x2644ba-0x0;var _0x2f57a9=_0x34cd[_0x2644ba];return _0x2f57a9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd34c('0x0'));var BPromise=require(_0xd34c('0x1'));var rs=require(_0xd34c('0x2'));var fs=require('fs');var Redis=require(_0xd34c('0x3'));var db=require(_0xd34c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd34c('0x5'))(_0xd34c('0x6'));var config=require('../../config/environment');var jayson=require(_0xd34c('0x7'));var client=jayson[_0xd34c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f0e10,_0x218668,_0x28784b){return new BPromise(function(_0x453928,_0x3db44a){return client[_0xd34c('0x9')](_0x3f0e10,_0x28784b)[_0xd34c('0xa')](function(_0x338ccc){logger[_0xd34c('0xb')](_0xd34c('0xc'),_0x218668,_0xd34c('0xd'));logger['debug'](_0xd34c('0xe'),_0x218668,'request\x20sent',JSON[_0xd34c('0xf')](_0x338ccc));if(_0x338ccc[_0xd34c('0x10')]){if(_0x338ccc[_0xd34c('0x10')][_0xd34c('0x11')]===0x1f4){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x218668,_0x338ccc['error'][_0xd34c('0x12')]);return _0x3db44a(_0x338ccc['error'][_0xd34c('0x12')]);}logger['error'](_0xd34c('0xc'),_0x218668,_0x338ccc['error']['message']);return _0x453928(_0x338ccc[_0xd34c('0x10')]['message']);}else{logger['info'](_0xd34c('0xc'),_0x218668,_0xd34c('0xd'));_0x453928(_0x338ccc['result'][_0xd34c('0x12')]);}})[_0xd34c('0x13')](function(_0x56fe05){logger[_0xd34c('0x10')](_0xd34c('0xc'),_0x218668,_0x56fe05);_0x3db44a(_0x56fe05);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 9a16ed7..b2f0340 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x345901,_0x547fc5){var _0x336446=function(_0x2ed32e){while(--_0x2ed32e){_0x345901['push'](_0x345901['shift']());}};_0x336446(++_0x547fc5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x13594e,_0x6f0ed0){_0x13594e=_0x13594e-0x0;var _0x1a4f42=_0xcb91[_0x13594e];return _0x1a4f42;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x16fd1d,_0x179d46){var _0xcd8eec=function(_0x4e593e){while(--_0x4e593e){_0x16fd1d['push'](_0x16fd1d['shift']());}};_0xcd8eec(++_0x179d46);}(_0xedd9,0xfc));var _0x9edd=function(_0x47c5fe,_0x59f051){_0x47c5fe=_0x47c5fe-0x0;var _0x39c985=_0xedd9[_0x47c5fe];return _0x39c985;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index dc1a9c4..0e328a9 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 _0x3870=['sequelize','exports'];(function(_0x125425,_0x4b6bab){var _0xd04dc4=function(_0x37fc01){while(--_0x37fc01){_0x125425['push'](_0x125425['shift']());}};_0xd04dc4(++_0x4b6bab);}(_0x3870,0x19e));var _0x0387=function(_0x4fcb34,_0x52f140){_0x4fcb34=_0x4fcb34-0x0;var _0x4f67c1=_0x3870[_0x4fcb34];return _0x4f67c1;};'use strict';var Sequelize=require(_0x0387('0x0'));module[_0x0387('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xefe7=['sequelize','INTEGER'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xefe7,0x168));var _0x7efe=function(_0x56b0e6,_0x2441fa){_0x56b0e6=_0x56b0e6-0x0;var _0x54f8fa=_0xefe7[_0x56b0e6];return _0x54f8fa;};'use strict';var Sequelize=require(_0x7efe('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x7efe('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index b84d842..7a2c48f 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 _0xc093=['moment','bluebird','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','../../config/logger','api'];(function(_0x232cf2,_0x4ffb79){var _0x463cec=function(_0x581b60){while(--_0x581b60){_0x232cf2['push'](_0x232cf2['shift']());}};_0x463cec(++_0x4ffb79);}(_0xc093,0xa6));var _0x3c09=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0xc093[_0x409353];return _0x4f4b59;};'use strict';var _=require(_0x3c09('0x0'));var util=require('util');var logger=require(_0x3c09('0x1'))(_0x3c09('0x2'));var moment=require(_0x3c09('0x3'));var BPromise=require(_0x3c09('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3c09('0x5'));var rimraf=require(_0x3c09('0x6'));var config=require(_0x3c09('0x7'));var attributes=require(_0x3c09('0x8'));module[_0x3c09('0x9')]=function(_0x287e5f,_0x5182b9){return _0x287e5f[_0x3c09('0xa')](_0x3c09('0xb'),attributes,{'tableName':_0x3c09('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x86ca=['util','api','moment','bluebird','request-promise','path','rimraf','exports','define','UserMailQueue','user_has_mail_queues','lodash'];(function(_0x2a4bff,_0x141a12){var _0x5ede61=function(_0x561158){while(--_0x561158){_0x2a4bff['push'](_0x2a4bff['shift']());}};_0x5ede61(++_0x141a12);}(_0x86ca,0x167));var _0xa86c=function(_0x130384,_0x51ad81){_0x130384=_0x130384-0x0;var _0x4478ab=_0x86ca[_0x130384];return _0x4478ab;};'use strict';var _=require(_0xa86c('0x0'));var util=require(_0xa86c('0x1'));var logger=require('../../config/logger')(_0xa86c('0x2'));var moment=require(_0xa86c('0x3'));var BPromise=require(_0xa86c('0x4'));var rp=require(_0xa86c('0x5'));var fs=require('fs');var path=require(_0xa86c('0x6'));var rimraf=require(_0xa86c('0x7'));var config=require('../../config/environment');var attributes=require('./userMailQueue.attributes');module[_0xa86c('0x8')]=function(_0x1e04f1,_0x4fa98e){return _0x1e04f1[_0xa86c('0x9')](_0xa86c('0xa'),attributes,{'tableName':_0xa86c('0xb'),'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 fb6db5d..76bff44 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 _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x4ef0ee,_0x154a3f){var _0x17c640=function(_0x2626d1){while(--_0x2626d1){_0x4ef0ee['push'](_0x4ef0ee['shift']());}};_0x17c640(++_0x154a3f);}(_0xe14b,0x93));var _0xbe14=function(_0x2dc89d,_0x1cef93){_0x2dc89d=_0x2dc89d-0x0;var _0x294caa=_0xe14b[_0x2dc89d];return _0x294caa;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file +var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x7217,0x19e));var _0x7721=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x7217[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index db0a4d6..bad38b8 100644 --- a/server/api/userNotification/index.js +++ b/server/api/userNotification/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe40a=['util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./userNotification.controller','isAuthenticated','sendUserNotification','exports'];(function(_0x5203ff,_0x4ecc5c){var _0x563c9d=function(_0x3e9e46){while(--_0x3e9e46){_0x5203ff['push'](_0x5203ff['shift']());}};_0x563c9d(++_0x4ecc5c);}(_0xe40a,0x78));var _0xae40=function(_0x14974c,_0x3418a4){_0x14974c=_0x14974c-0x0;var _0x25f0d9=_0xe40a[_0x14974c];return _0x25f0d9;};'use strict';var multer=require('multer');var util=require(_0xae40('0x0'));var path=require('path');var timeout=require(_0xae40('0x1'));var express=require(_0xae40('0x2'));var router=express['Router']();var fs_extra=require(_0xae40('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xae40('0x4'));var config=require(_0xae40('0x5'));var controller=require(_0xae40('0x6'));router['post']('/',auth[_0xae40('0x7')](),controller[_0xae40('0x8')]);module[_0xae40('0x9')]=router; \ No newline at end of file +var _0xbcf3=['post','isAuthenticated','sendUserNotification','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x434634,_0x2b232d){var _0x5d866b=function(_0x5d2691){while(--_0x5d2691){_0x434634['push'](_0x434634['shift']());}};_0x5d866b(++_0x2b232d);}(_0xbcf3,0x1d9));var _0x3bcf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbcf3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3bcf('0x0'));var util=require(_0x3bcf('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3bcf('0x2'));var router=express[_0x3bcf('0x3')]();var fs_extra=require(_0x3bcf('0x4'));var auth=require(_0x3bcf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3bcf('0x6'));var controller=require('./userNotification.controller');router[_0x3bcf('0x7')]('/',auth[_0x3bcf('0x8')](),controller[_0x3bcf('0x9')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 6bdf224..87e4a78 100644 --- a/server/api/userNotification/userNotification.attributes.js +++ b/server/api/userNotification/userNotification.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x44d4=['TEXT','STRING','BOOLEAN'];(function(_0x52827d,_0xca8a3e){var _0x2e583a=function(_0x5c81e1){while(--_0x5c81e1){_0x52827d['push'](_0x52827d['shift']());}};_0x2e583a(++_0xca8a3e);}(_0x44d4,0x198));var _0x444d=function(_0x42653f,_0x531aed){_0x42653f=_0x42653f-0x0;var _0x55185f=_0x44d4[_0x42653f];return _0x55185f;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x444d('0x0')]},'senderName':{'type':Sequelize[_0x444d('0x1')]},'recipientsId':{'type':Sequelize[_0x444d('0x0')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x444d('0x2')]}}; \ No newline at end of file +var _0x274b=['exports','TEXT','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x274b,0x18b));var _0xb274=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x274b[_0x3511d3];return _0x5d6321;};'use strict';var Sequelize=require(_0xb274('0x0'));module[_0xb274('0x1')]={'body':{'type':Sequelize[_0xb274('0x2')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0xb274('0x2')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0xb274('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index ffef60a..6ed1afb 100644 --- a/server/api/userNotification/userNotification.controller.js +++ b/server/api/userNotification/userNotification.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2dee=['../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','then','error','stack','name','send','body','text','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','hasOwnProperty','Sequelize','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','whatsappqueue','team','user','some','includes','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','beep','SenderId','recipientsId','UserNotification','create','forEach','recipient','userNotification:send','catch','html','Invalid\x20\x27TemplateId\x27\x20parameter','view','model','toLowerCase','User','union','ids','queue','replace','Queue','all','getAgents','eml-format','rimraf','zip-dir','request-promise','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis'];(function(_0x32fb5a,_0x565a38){var _0x2f212c=function(_0x597960){while(--_0x597960){_0x32fb5a['push'](_0x32fb5a['shift']());}};_0x2f212c(++_0x565a38);}(_0x2dee,0x1a9));var _0xe2de=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x2dee[_0x1035c1];return _0x308d67;};'use strict';var emlformat=require(_0xe2de('0x0'));var rimraf=require(_0xe2de('0x1'));var zipdir=require(_0xe2de('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe2de('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xe2de('0x4'));var sox=require('sox');var csv=require(_0xe2de('0x5'));var ejs=require(_0xe2de('0x6'));var fs=require('fs');var fs_extra=require(_0xe2de('0x7'));var _=require(_0xe2de('0x8'));var squel=require(_0xe2de('0x9'));var crypto=require(_0xe2de('0xa'));var jsforce=require(_0xe2de('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe2de('0x5'));var querystring=require(_0xe2de('0xc'));var Papa=require(_0xe2de('0xd'));var Redis=require(_0xe2de('0xe'));var authService=require(_0xe2de('0xf'));var qs=require(_0xe2de('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe2de('0x11'))(_0xe2de('0x12'));var utils=require(_0xe2de('0x13'));var config=require(_0xe2de('0x14'));var licenseUtil=require(_0xe2de('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xe2de('0x16')](config[_0xe2de('0x17')],{'host':_0xe2de('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe2de('0x17')]));require(_0xe2de('0x19'))[_0xe2de('0x1a')](socket);function respondWithStatusCode(_0xdf166f,_0x295e3c){_0x295e3c=_0x295e3c||0xcc;return function(_0x1102e0){if(_0x1102e0){return _0xdf166f[_0xe2de('0x1b')](_0x295e3c);}return _0xdf166f[_0xe2de('0x1c')](_0x295e3c)[_0xe2de('0x1d')]();};}function respondWithResult(_0x17ed46,_0x3ecc84){_0x3ecc84=_0x3ecc84||0xc8;return function(_0x4f2aab){if(_0x4f2aab){return _0x17ed46[_0xe2de('0x1c')](_0x3ecc84)[_0xe2de('0x1e')](_0x4f2aab);}};}function respondWithFilteredResult(_0x3603b1,_0x39dcbb){return function(_0x446bd5){if(_0x446bd5){var _0x4572a0=typeof _0x39dcbb[_0xe2de('0x1f')]==='undefined'&&typeof _0x39dcbb['limit']===_0xe2de('0x20');var _0x34d30d=_0x446bd5['count'];var _0x24e707=_0x4572a0?0x0:_0x39dcbb[_0xe2de('0x1f')];var _0x440676=_0x4572a0?_0x446bd5[_0xe2de('0x21')]:_0x39dcbb['offset']+_0x39dcbb[_0xe2de('0x22')];var _0x40fb7c;if(_0x440676>=_0x34d30d){_0x440676=_0x34d30d;_0x40fb7c=0xc8;}else{_0x40fb7c=0xce;}_0x3603b1['status'](_0x40fb7c);return _0x3603b1[_0xe2de('0x23')](_0xe2de('0x24'),_0x24e707+'-'+_0x440676+'/'+_0x34d30d)[_0xe2de('0x1e')](_0x446bd5);}return null;};}function patchUpdates(_0x55e901){return function(_0x5ac460){try{jsonpatch[_0xe2de('0x25')](_0x5ac460,_0x55e901,!![]);}catch(_0x4ef465){return BPromise['reject'](_0x4ef465);}return _0x5ac460['save']();};}function saveUpdates(_0x581d60,_0x5bca45){return function(_0x1d3742){if(_0x1d3742){return _0x1d3742['update'](_0x581d60)[_0xe2de('0x26')](function(_0x907a68){return _0x907a68;});}return null;};}function removeEntity(_0x47ad62,_0x3e276c){return function(_0x38a445){if(_0x38a445){return _0x38a445['destroy']()['then'](function(){_0x47ad62['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x212264,_0x145dfc){return function(_0x21dff9){if(!_0x21dff9){_0x212264[_0xe2de('0x1b')](0x194);}return _0x21dff9;};}function handleError(_0x2af503,_0x350578){_0x350578=_0x350578||0x1f4;return function(_0x4c5e9a){logger[_0xe2de('0x27')](_0x4c5e9a[_0xe2de('0x28')]);if(_0x4c5e9a['name']){delete _0x4c5e9a[_0xe2de('0x29')];}_0x2af503['status'](_0x350578)[_0xe2de('0x2a')](_0x4c5e9a);};}exports['sendUserNotification']=function(_0x2c432e,_0x305efc,_0xce001d){if(!_0x2c432e[_0xe2de('0x2b')]['hasOwnProperty'](_0xe2de('0x2c'))&&!_0x2c432e[_0xe2de('0x2b')]['hasOwnProperty'](_0xe2de('0x2d'))){throw new db['Sequelize'][(_0xe2de('0x2e'))](_0xe2de('0x2f'));}else{if(_0x2c432e['body'][_0xe2de('0x30')]('TemplateId')&&!_0x2c432e[_0xe2de('0x2b')]['hasOwnProperty']('view')){throw new db[(_0xe2de('0x31'))]['ValidationError']('Missing\x20\x27view\x27\x20parameter');}if(!_0x2c432e[_0xe2de('0x2b')][_0xe2de('0x30')](_0xe2de('0x32'))){throw new db['Sequelize'][(_0xe2de('0x2e'))](_0xe2de('0x33'));}else{try{var _0x1ddfbd=JSON[_0xe2de('0x34')](_0x2c432e[_0xe2de('0x2b')][_0xe2de('0x32')]);}catch(_0x1e792c){logger['error'](_0x1e792c);throw new db['Sequelize'][(_0xe2de('0x2e'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x54a50d=[_0xe2de('0x35'),_0xe2de('0x36'),_0xe2de('0x37'),_0xe2de('0x38'),_0xe2de('0x39'),'voicequeue',_0xe2de('0x3a'),_0xe2de('0x3b'),_0xe2de('0x3c')];if(_[_0xe2de('0x3d')](_0x1ddfbd,function(_0x77dddf){return!_[_0xe2de('0x3e')](_0x54a50d,_0x77dddf['model']['toLowerCase']());})){throw new db[(_0xe2de('0x31'))][(_0xe2de('0x2e'))](_0xe2de('0x3f'));}}}var _0x4ddf79={};_0x4ddf79[_0xe2de('0x40')]=_0x2c432e[_0xe2de('0x2b')]['hasOwnProperty']('senderName')?_0x2c432e[_0xe2de('0x2b')]['senderName']:_0x2c432e['user']['fullname'];_0x4ddf79[_0xe2de('0x41')]=_['isEmpty'](_0x2c432e[_0xe2de('0x2b')][_0xe2de('0x41')])?null:_0x2c432e[_0xe2de('0x2b')][_0xe2de('0x41')];_0x4ddf79[_0xe2de('0x42')]=_0x2c432e[_0xe2de('0x2b')][_0xe2de('0x42')]||![];_0x4ddf79[_0xe2de('0x43')]=_0x2c432e['user']['id'];return getContent(_0x2c432e['body'])['then'](function(_0x32f918){_0x4ddf79[_0xe2de('0x2b')]=_0x32f918;return getRecipients(_0x1ddfbd);})[_0xe2de('0x26')](function(_0x4db149){_0x4ddf79[_0xe2de('0x44')]=_['sortBy'](_0x4db149)['join'](',');return db['sequelize']['transaction'](function(_0x12fc36){return db[_0xe2de('0x45')][_0xe2de('0x46')](_0x4ddf79,{'raw':!![],'transaction':_0x12fc36})[_0xe2de('0x26')](function(_0x3101df){var _0x261341={'sender':_0x4ddf79[_0xe2de('0x40')],'description':_0x4ddf79[_0xe2de('0x41')],'content':_0x4ddf79['body'],'beep':_0x4ddf79['beep']};_0x4db149[_0xe2de('0x47')](function(_0x5545a3){_0x261341[_0xe2de('0x48')]=_0x5545a3;socket['emit'](_0xe2de('0x49'),_0x261341);});return _0x3101df;});});})['then'](respondWithResult(_0x305efc,0xc9))[_0xe2de('0x4a')](handleError(_0x305efc,null));};function getContent(_0x23105b){return new BPromise(function(_0x16fcf2,_0x5840f2){if(_0x23105b['text']){_0x16fcf2(_0x23105b[_0xe2de('0x2c')]);return;}return db['Template']['findOne']({'attributes':[_0xe2de('0x4b')],'where':{'id':_0x23105b[_0xe2de('0x2d')]},'raw':!![]})[_0xe2de('0x26')](function(_0xf035da){if(!_0xf035da)throw new db[(_0xe2de('0x31'))][(_0xe2de('0x2e'))](_0xe2de('0x4c'));var _0xb27d67=Mustache['render'](_0xf035da[_0xe2de('0x4b')],_0x23105b[_0xe2de('0x4d')]);_0x16fcf2(_0xb27d67);})['catch'](function(_0x55e50e){_0x5840f2(_0x55e50e);});});}function getRecipients(_0x4e9561){return new BPromise(function(_0x15f7ce,_0x188211){var _0x343f5c=[];var _0x17fbd9=[];_0x4e9561[_0xe2de('0x47')](function(_0x2edc65){var _0x17c915=_['startCase'](_0x2edc65[_0xe2de('0x4e')][_0xe2de('0x4f')]());if(_0x17c915===_0xe2de('0x50')){_0x343f5c=_[_0xe2de('0x51')](_0x343f5c,_0x2edc65[_0xe2de('0x52')]);}else{if(_[_0xe2de('0x3e')](_0x17c915,_0xe2de('0x53')))_0x17c915=_0x17c915[_0xe2de('0x54')](_0xe2de('0x53'),_0xe2de('0x55'));_0x2edc65['ids'][_0xe2de('0x47')](function(_0x4bfe45){_0x17fbd9['push'](getAgents(_0x17c915,_0x4bfe45));});}});return BPromise[_0xe2de('0x56')](_0x17fbd9)[_0xe2de('0x26')](function(_0x51825e){_0x343f5c=_['union'](_0x343f5c,_['flatten'](_0x51825e));_0x15f7ce(_0x343f5c);})[_0xe2de('0x4a')](function(_0x52c03f){_0x188211(_0x52c03f);});});}function getAgents(_0x32811b,_0x1fce2a){return new BPromise(function(_0x18fac6,_0x32855f){return db[_0x32811b]['findOne']({'where':{'id':_0x1fce2a}})['then'](function(_0x4e33d9){return _0x4e33d9[_0xe2de('0x57')]({'attributes':['id'],'raw':!![]})[_0xe2de('0x26')](function(_0x1986f3){var _0x431c86=_['map'](_0x1986f3,'id');_0x18fac6(_0x431c86);});})[_0xe2de('0x4a')](function(_0x3c03ad){_0x32855f(_0x3c03ad);});});} \ No newline at end of file +var _0x72b6=['undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','smsqueue','voicequeue','whatsappqueue','user','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','isEmpty','recipientsDescription','beep','SenderId','recipientsId','sortBy','sequelize','transaction','UserNotification','forEach','recipient','emit','userNotification:send','catch','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','model','User','union','ids','includes','queue','replace','Queue','all','flatten','getAgents','map','eml-format','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset'];(function(_0x52b6da,_0x316a8b){var _0x29c969=function(_0x33b478){while(--_0x33b478){_0x52b6da['push'](_0x52b6da['shift']());}};_0x29c969(++_0x316a8b);}(_0x72b6,0x1c1));var _0x672b=function(_0x2ca682,_0x251f21){_0x2ca682=_0x2ca682-0x0;var _0xcb0a59=_0x72b6[_0x2ca682];return _0xcb0a59;};'use strict';var emlformat=require(_0x672b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x672b('0x1'));var rp=require('request-promise');var moment=require(_0x672b('0x2'));var BPromise=require(_0x672b('0x3'));var Mustache=require(_0x672b('0x4'));var util=require(_0x672b('0x5'));var path=require('path');var sox=require(_0x672b('0x6'));var csv=require(_0x672b('0x7'));var ejs=require(_0x672b('0x8'));var fs=require('fs');var fs_extra=require(_0x672b('0x9'));var _=require(_0x672b('0xa'));var squel=require(_0x672b('0xb'));var crypto=require(_0x672b('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x672b('0x7'));var querystring=require(_0x672b('0xd'));var Papa=require(_0x672b('0xe'));var Redis=require('ioredis');var authService=require(_0x672b('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x672b('0x10'));var logger=require(_0x672b('0x11'))('api');var utils=require(_0x672b('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x672b('0x13'));var db=require(_0x672b('0x14'))['db'];config[_0x672b('0x15')]=_[_0x672b('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x672b('0x17'))(new Redis(config[_0x672b('0x15')]));require(_0x672b('0x18'))[_0x672b('0x19')](socket);function respondWithStatusCode(_0x55e909,_0x462155){_0x462155=_0x462155||0xcc;return function(_0x249453){if(_0x249453){return _0x55e909[_0x672b('0x1a')](_0x462155);}return _0x55e909[_0x672b('0x1b')](_0x462155)[_0x672b('0x1c')]();};}function respondWithResult(_0x4c7959,_0x2f6744){_0x2f6744=_0x2f6744||0xc8;return function(_0x4f7526){if(_0x4f7526){return _0x4c7959[_0x672b('0x1b')](_0x2f6744)[_0x672b('0x1d')](_0x4f7526);}};}function respondWithFilteredResult(_0xe5abf5,_0x5641b6){return function(_0x829840){if(_0x829840){var _0x3c7a65=typeof _0x5641b6[_0x672b('0x1e')]===_0x672b('0x1f')&&typeof _0x5641b6[_0x672b('0x20')]===_0x672b('0x1f');var _0x5c11b2=_0x829840[_0x672b('0x21')];var _0x411d6a=_0x3c7a65?0x0:_0x5641b6[_0x672b('0x1e')];var _0x45f7b9=_0x3c7a65?_0x829840[_0x672b('0x21')]:_0x5641b6['offset']+_0x5641b6[_0x672b('0x20')];var _0x315239;if(_0x45f7b9>=_0x5c11b2){_0x45f7b9=_0x5c11b2;_0x315239=0xc8;}else{_0x315239=0xce;}_0xe5abf5[_0x672b('0x1b')](_0x315239);return _0xe5abf5[_0x672b('0x22')](_0x672b('0x23'),_0x411d6a+'-'+_0x45f7b9+'/'+_0x5c11b2)[_0x672b('0x1d')](_0x829840);}return null;};}function patchUpdates(_0x50a688){return function(_0x2b4350){try{jsonpatch['apply'](_0x2b4350,_0x50a688,!![]);}catch(_0x4cea46){return BPromise[_0x672b('0x24')](_0x4cea46);}return _0x2b4350[_0x672b('0x25')]();};}function saveUpdates(_0x27422a,_0x404b6b){return function(_0x4e4cd2){if(_0x4e4cd2){return _0x4e4cd2[_0x672b('0x26')](_0x27422a)[_0x672b('0x27')](function(_0x2dba07){return _0x2dba07;});}return null;};}function removeEntity(_0x257b09,_0x30a8be){return function(_0x36743d){if(_0x36743d){return _0x36743d[_0x672b('0x28')]()['then'](function(){_0x257b09[_0x672b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc2cc9c,_0x50d2c4){return function(_0x2b4da){if(!_0x2b4da){_0xc2cc9c[_0x672b('0x1a')](0x194);}return _0x2b4da;};}function handleError(_0x3aef5d,_0xeb47cd){_0xeb47cd=_0xeb47cd||0x1f4;return function(_0x18f106){logger['error'](_0x18f106[_0x672b('0x29')]);if(_0x18f106['name']){delete _0x18f106['name'];}_0x3aef5d[_0x672b('0x1b')](_0xeb47cd)['send'](_0x18f106);};}exports[_0x672b('0x2a')]=function(_0x236a4f,_0x5edbef,_0xb36df4){if(!_0x236a4f[_0x672b('0x2b')][_0x672b('0x2c')](_0x672b('0x2d'))&&!_0x236a4f['body']['hasOwnProperty'](_0x672b('0x2e'))){throw new db[(_0x672b('0x2f'))][(_0x672b('0x30'))](_0x672b('0x31'));}else{if(_0x236a4f[_0x672b('0x2b')][_0x672b('0x2c')](_0x672b('0x2e'))&&!_0x236a4f['body']['hasOwnProperty'](_0x672b('0x32'))){throw new db[(_0x672b('0x2f'))]['ValidationError']('Missing\x20\x27view\x27\x20parameter');}if(!_0x236a4f[_0x672b('0x2b')][_0x672b('0x2c')](_0x672b('0x33'))){throw new db[(_0x672b('0x2f'))]['ValidationError'](_0x672b('0x34'));}else{try{var _0x2f89a2=JSON[_0x672b('0x35')](_0x236a4f['body'][_0x672b('0x33')]);}catch(_0x36d26f){logger[_0x672b('0x36')](_0x36d26f);throw new db[(_0x672b('0x2f'))][(_0x672b('0x30'))](_0x672b('0x37'));}var _0x2defa5=[_0x672b('0x38'),_0x672b('0x39'),_0x672b('0x3a'),'openchannelqueue',_0x672b('0x3b'),_0x672b('0x3c'),_0x672b('0x3d'),'team',_0x672b('0x3e')];if(_['some'](_0x2f89a2,function(_0x2f0716){return!_['includes'](_0x2defa5,_0x2f0716['model'][_0x672b('0x3f')]());})){throw new db['Sequelize'][(_0x672b('0x30'))](_0x672b('0x40'));}}}var _0x4559be={};_0x4559be[_0x672b('0x41')]=_0x236a4f[_0x672b('0x2b')][_0x672b('0x2c')](_0x672b('0x41'))?_0x236a4f[_0x672b('0x2b')][_0x672b('0x41')]:_0x236a4f[_0x672b('0x3e')]['fullname'];_0x4559be['recipientsDescription']=_[_0x672b('0x42')](_0x236a4f[_0x672b('0x2b')][_0x672b('0x43')])?null:_0x236a4f[_0x672b('0x2b')]['recipientsDescription'];_0x4559be['beep']=_0x236a4f[_0x672b('0x2b')][_0x672b('0x44')]||![];_0x4559be[_0x672b('0x45')]=_0x236a4f[_0x672b('0x3e')]['id'];return getContent(_0x236a4f['body'])[_0x672b('0x27')](function(_0x53827c){_0x4559be['body']=_0x53827c;return getRecipients(_0x2f89a2);})[_0x672b('0x27')](function(_0x213593){_0x4559be[_0x672b('0x46')]=_[_0x672b('0x47')](_0x213593)['join'](',');return db[_0x672b('0x48')][_0x672b('0x49')](function(_0xd61b57){return db[_0x672b('0x4a')]['create'](_0x4559be,{'raw':!![],'transaction':_0xd61b57})['then'](function(_0x55220f){var _0x4fe833={'sender':_0x4559be[_0x672b('0x41')],'description':_0x4559be['recipientsDescription'],'content':_0x4559be[_0x672b('0x2b')],'beep':_0x4559be[_0x672b('0x44')]};_0x213593[_0x672b('0x4b')](function(_0xa4251e){_0x4fe833[_0x672b('0x4c')]=_0xa4251e;socket[_0x672b('0x4d')](_0x672b('0x4e'),_0x4fe833);});return _0x55220f;});});})[_0x672b('0x27')](respondWithResult(_0x5edbef,0xc9))[_0x672b('0x4f')](handleError(_0x5edbef,null));};function getContent(_0x42d1f1){return new BPromise(function(_0x2c5c21,_0x2f1a35){if(_0x42d1f1[_0x672b('0x2d')]){_0x2c5c21(_0x42d1f1[_0x672b('0x2d')]);return;}return db['Template'][_0x672b('0x50')]({'attributes':[_0x672b('0x51')],'where':{'id':_0x42d1f1[_0x672b('0x2e')]},'raw':!![]})[_0x672b('0x27')](function(_0x598e47){if(!_0x598e47)throw new db[(_0x672b('0x2f'))][(_0x672b('0x30'))](_0x672b('0x52'));var _0xd1b380=Mustache[_0x672b('0x53')](_0x598e47['html'],_0x42d1f1[_0x672b('0x32')]);_0x2c5c21(_0xd1b380);})[_0x672b('0x4f')](function(_0x45d0c0){_0x2f1a35(_0x45d0c0);});});}function getRecipients(_0x5349c2){return new BPromise(function(_0x2d682e,_0x3ebfd3){var _0x9bcaaf=[];var _0x36ad07=[];_0x5349c2[_0x672b('0x4b')](function(_0x520e49){var _0x41c25f=_['startCase'](_0x520e49[_0x672b('0x54')][_0x672b('0x3f')]());if(_0x41c25f===_0x672b('0x55')){_0x9bcaaf=_[_0x672b('0x56')](_0x9bcaaf,_0x520e49[_0x672b('0x57')]);}else{if(_[_0x672b('0x58')](_0x41c25f,_0x672b('0x59')))_0x41c25f=_0x41c25f[_0x672b('0x5a')]('queue',_0x672b('0x5b'));_0x520e49[_0x672b('0x57')][_0x672b('0x4b')](function(_0x4a3dc6){_0x36ad07['push'](getAgents(_0x41c25f,_0x4a3dc6));});}});return BPromise[_0x672b('0x5c')](_0x36ad07)[_0x672b('0x27')](function(_0x43652a){_0x9bcaaf=_[_0x672b('0x56')](_0x9bcaaf,_[_0x672b('0x5d')](_0x43652a));_0x2d682e(_0x9bcaaf);})[_0x672b('0x4f')](function(_0x406be8){_0x3ebfd3(_0x406be8);});});}function getAgents(_0x1710f1,_0x5caba7){return new BPromise(function(_0x1337c3,_0x5dfecc){return db[_0x1710f1][_0x672b('0x50')]({'where':{'id':_0x5caba7}})[_0x672b('0x27')](function(_0x555954){return _0x555954[_0x672b('0x5e')]({'attributes':['id'],'raw':!![]})['then'](function(_0x588dd7){var _0x5cf982=_[_0x672b('0x5f')](_0x588dd7,'id');_0x1337c3(_0x5cf982);});})[_0x672b('0x4f')](function(_0x3d3817){_0x5dfecc(_0x3d3817);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 57a6de1..c8f18ce 100644 --- a/server/api/userNotification/userNotification.events.js +++ b/server/api/userNotification/userNotification.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3550=['exports','../../mysqldb','UserNotification','save','update','hasOwnProperty'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3550,0x85));var _0x0355=function(_0x310b81,_0x14c079){_0x310b81=_0x310b81-0x0;var _0x5a3258=_0x3550[_0x310b81];return _0x5a3258;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x0355('0x0'))['db'][_0x0355('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0355('0x2'),'afterUpdate':_0x0355('0x3'),'afterDestroy':'remove'};function emitEvent(_0x18d7a6){return function(_0x22c497,_0x49821c,_0x4f032c){UserNotificationEvents['emit'](_0x18d7a6+':'+_0x22c497['id'],_0x22c497);UserNotificationEvents['emit'](_0x18d7a6,_0x22c497);_0x4f032c(null);};}for(var e in events){if(events[_0x0355('0x4')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x0355('0x5')]=UserNotificationEvents; \ No newline at end of file +var _0x9d3b=['save','update','emit','hasOwnProperty','hook','../../mysqldb','UserNotification'];(function(_0xf71a93,_0x4cfb81){var _0x413946=function(_0x77b74c){while(--_0x77b74c){_0xf71a93['push'](_0xf71a93['shift']());}};_0x413946(++_0x4cfb81);}(_0x9d3b,0x139));var _0xb9d3=function(_0x503950,_0x5022eb){_0x503950=_0x503950-0x0;var _0x1657a9=_0x9d3b[_0x503950];return _0x1657a9;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0xb9d3('0x0'))['db'][_0xb9d3('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb9d3('0x2'),'afterUpdate':_0xb9d3('0x3'),'afterDestroy':'remove'};function emitEvent(_0x583d5f){return function(_0x53f0eb,_0x18b3fb,_0x3f2756){UserNotificationEvents['emit'](_0x583d5f+':'+_0x53f0eb['id'],_0x53f0eb);UserNotificationEvents[_0xb9d3('0x4')](_0x583d5f,_0x53f0eb);_0x3f2756(null);};}for(var e in events){if(events[_0xb9d3('0x5')](e)){var event=events[e];UserNotification[_0xb9d3('0x6')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index b92b9b5..f41fef8 100644 --- a/server/api/userNotification/userNotification.model.js +++ b/server/api/userNotification/userNotification.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9173=['api','moment','bluebird','path','../../config/environment','./userNotification.attributes','exports','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x1d3791,_0x51c613){var _0x40fbf5=function(_0xe5d147){while(--_0xe5d147){_0x1d3791['push'](_0x1d3791['shift']());}};_0x40fbf5(++_0x51c613);}(_0x9173,0xb4));var _0x3917=function(_0xa35c5d,_0x6c8ec0){_0xa35c5d=_0xa35c5d-0x0;var _0x2d5899=_0x9173[_0xa35c5d];return _0x2d5899;};'use strict';var _=require(_0x3917('0x0'));var util=require(_0x3917('0x1'));var logger=require('../../config/logger')(_0x3917('0x2'));var moment=require(_0x3917('0x3'));var BPromise=require(_0x3917('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3917('0x5'));var rimraf=require('rimraf');var config=require(_0x3917('0x6'));var attributes=require(_0x3917('0x7'));module[_0x3917('0x8')]=function(_0x403e03,_0x2dace9){return _0x403e03['define'](_0x3917('0x9'),attributes,{'tableName':_0x3917('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3917('0xb'),'collate':_0x3917('0xc')});}; \ No newline at end of file +var _0xa594=['./userNotification.attributes','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x54d49e,_0x5d9911){var _0x4af0f1=function(_0xf117b3){while(--_0xf117b3){_0x54d49e['push'](_0x54d49e['shift']());}};_0x4af0f1(++_0x5d9911);}(_0xa594,0x1cd));var _0x4a59=function(_0x37c8ef,_0x334449){_0x37c8ef=_0x37c8ef-0x0;var _0x5eaee9=_0xa594[_0x37c8ef];return _0x5eaee9;};'use strict';var _=require('lodash');var util=require(_0x4a59('0x0'));var logger=require(_0x4a59('0x1'))('api');var moment=require(_0x4a59('0x2'));var BPromise=require(_0x4a59('0x3'));var rp=require(_0x4a59('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4a59('0x5'));var config=require(_0x4a59('0x6'));var attributes=require(_0x4a59('0x7'));module['exports']=function(_0x288341,_0x21d1dc){return _0x288341['define'](_0x4a59('0x8'),attributes,{'tableName':_0x4a59('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4a59('0xa'),'collate':_0x4a59('0xb')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index f94299c..baccab3 100644 --- a/server/api/userNotification/userNotification.rpc.js +++ b/server/api/userNotification/userNotification.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe33=['message','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','register','request','then','info','UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x507671,_0x4afc30){var _0x4d758d=function(_0x10ec66){while(--_0x10ec66){_0x507671['push'](_0x507671['shift']());}};_0x4d758d(++_0x4afc30);}(_0xfe33,0xcc));var _0x3fe3=function(_0x2d72ab,_0x5a97f5){_0x2d72ab=_0x2d72ab-0x0;var _0x256423=_0xfe33[_0x2d72ab];return _0x256423;};'use strict';var _=require('lodash');var util=require(_0x3fe3('0x0'));var moment=require(_0x3fe3('0x1'));var BPromise=require(_0x3fe3('0x2'));var rs=require(_0x3fe3('0x3'));var fs=require('fs');var Redis=require(_0x3fe3('0x4'));var db=require(_0x3fe3('0x5'))['db'];var utils=require(_0x3fe3('0x6'));var logger=require(_0x3fe3('0x7'))('rpc');var config=require(_0x3fe3('0x8'));var jayson=require(_0x3fe3('0x9'));var client=jayson['client'][_0x3fe3('0xa')]({'port':0x232a});config['redis']=_[_0x3fe3('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userNotification.socket')[_0x3fe3('0xc')](socket);function respondWithRpcPromise(_0x1bbe77,_0x466be1,_0x32c3ee){return new BPromise(function(_0x21a7d4,_0x4ac5ac){return client[_0x3fe3('0xd')](_0x1bbe77,_0x32c3ee)[_0x3fe3('0xe')](function(_0x3cc104){logger[_0x3fe3('0xf')](_0x3fe3('0x10'),_0x466be1,'request\x20sent');logger[_0x3fe3('0x11')](_0x3fe3('0x12'),_0x466be1,'request\x20sent',JSON[_0x3fe3('0x13')](_0x3cc104));if(_0x3cc104[_0x3fe3('0x14')]){if(_0x3cc104[_0x3fe3('0x14')]['code']===0x1f4){logger[_0x3fe3('0x14')](_0x3fe3('0x10'),_0x466be1,_0x3cc104[_0x3fe3('0x14')][_0x3fe3('0x15')]);return _0x4ac5ac(_0x3cc104[_0x3fe3('0x14')][_0x3fe3('0x15')]);}logger['error'](_0x3fe3('0x10'),_0x466be1,_0x3cc104[_0x3fe3('0x14')][_0x3fe3('0x15')]);return _0x21a7d4(_0x3cc104[_0x3fe3('0x14')][_0x3fe3('0x15')]);}else{logger[_0x3fe3('0xf')]('UserNotification,\x20%s,\x20%s',_0x466be1,_0x3fe3('0x16'));_0x21a7d4(_0x3cc104[_0x3fe3('0x17')][_0x3fe3('0x15')]);}})[_0x3fe3('0x18')](function(_0x165e3d){logger[_0x3fe3('0x14')](_0x3fe3('0x10'),_0x466be1,_0x165e3d);_0x4ac5ac(_0x165e3d);});});} \ No newline at end of file +var _0xf453=['debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','UserNotification,\x20%s,\x20%s','request\x20sent','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./userNotification.socket','register','request','info'];(function(_0x826a19,_0x4cc774){var _0x2ca312=function(_0x24bd22){while(--_0x24bd22){_0x826a19['push'](_0x826a19['shift']());}};_0x2ca312(++_0x4cc774);}(_0xf453,0x1ee));var _0x3f45=function(_0x26406a,_0x6454de){_0x26406a=_0x26406a-0x0;var _0xdd46c6=_0xf453[_0x26406a];return _0xdd46c6;};'use strict';var _=require(_0x3f45('0x0'));var util=require('util');var moment=require(_0x3f45('0x1'));var BPromise=require(_0x3f45('0x2'));var rs=require(_0x3f45('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f45('0x4'))['db'];var utils=require(_0x3f45('0x5'));var logger=require(_0x3f45('0x6'))(_0x3f45('0x7'));var config=require(_0x3f45('0x8'));var jayson=require(_0x3f45('0x9'));var client=jayson[_0x3f45('0xa')][_0x3f45('0xb')]({'port':0x232a});config['redis']=_[_0x3f45('0xc')](config[_0x3f45('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x3f45('0xe'))(new Redis(config[_0x3f45('0xd')]));require(_0x3f45('0xf'))[_0x3f45('0x10')](socket);function respondWithRpcPromise(_0x15677a,_0x1ee07b,_0x59ea6e){return new BPromise(function(_0x5080a2,_0x500a68){return client[_0x3f45('0x11')](_0x15677a,_0x59ea6e)['then'](function(_0x464602){logger[_0x3f45('0x12')]('UserNotification,\x20%s,\x20%s',_0x1ee07b,'request\x20sent');logger[_0x3f45('0x13')](_0x3f45('0x14'),_0x1ee07b,'request\x20sent',JSON[_0x3f45('0x15')](_0x464602));if(_0x464602[_0x3f45('0x16')]){if(_0x464602['error']['code']===0x1f4){logger['error']('UserNotification,\x20%s,\x20%s',_0x1ee07b,_0x464602[_0x3f45('0x16')][_0x3f45('0x17')]);return _0x500a68(_0x464602[_0x3f45('0x16')][_0x3f45('0x17')]);}logger[_0x3f45('0x16')](_0x3f45('0x18'),_0x1ee07b,_0x464602[_0x3f45('0x16')]['message']);return _0x5080a2(_0x464602[_0x3f45('0x16')][_0x3f45('0x17')]);}else{logger[_0x3f45('0x12')](_0x3f45('0x18'),_0x1ee07b,_0x3f45('0x19'));_0x5080a2(_0x464602['result'][_0x3f45('0x17')]);}})[_0x3f45('0x1a')](function(_0x5d3439){logger[_0x3f45('0x16')]('UserNotification,\x20%s,\x20%s',_0x1ee07b,_0x5d3439);_0x500a68(_0x5d3439);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 6876525..116f809 100644 --- a/server/api/userNotification/userNotification.socket.js +++ b/server/api/userNotification/userNotification.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b46=['userNotification:','./userNotification.events','remove','update','emit','removeListener','register','length'];(function(_0x930ac2,_0x326c6b){var _0x430e18=function(_0x514b86){while(--_0x514b86){_0x930ac2['push'](_0x930ac2['shift']());}};_0x430e18(++_0x326c6b);}(_0x6b46,0x141));var _0x66b4=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x6b46[_0x4b369d];return _0x571a98;};'use strict';var UserNotificationEvents=require(_0x66b4('0x0'));var events=['save',_0x66b4('0x1'),_0x66b4('0x2')];function createListener(_0xc6bcce,_0x31bd70){return function(_0xa0b322){_0x31bd70[_0x66b4('0x3')](_0xc6bcce,_0xa0b322);};}function removeListener(_0x5ac77f,_0x31b98b){return function(){UserNotificationEvents[_0x66b4('0x4')](_0x5ac77f,_0x31b98b);};}exports[_0x66b4('0x5')]=function(_0x2e7190){for(var _0x3c61e1=0x0,_0x175143=events[_0x66b4('0x6')];_0x3c61e1<_0x175143;_0x3c61e1++){var _0x545463=events[_0x3c61e1];var _0x44bea9=createListener(_0x66b4('0x7')+_0x545463,_0x2e7190);UserNotificationEvents['on'](_0x545463,_0x44bea9);}}; \ No newline at end of file +var _0x1f5f=['removeListener','register','length','userNotification:','save','update','emit'];(function(_0x68bb01,_0x402071){var _0xf806ff=function(_0x2f796d){while(--_0x2f796d){_0x68bb01['push'](_0x68bb01['shift']());}};_0xf806ff(++_0x402071);}(_0x1f5f,0x169));var _0xf1f5=function(_0x1f7acf,_0x8d6757){_0x1f7acf=_0x1f7acf-0x0;var _0xab408e=_0x1f5f[_0x1f7acf];return _0xab408e;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0xf1f5('0x0'),'remove',_0xf1f5('0x1')];function createListener(_0x58c164,_0x584a9d){return function(_0x39a25e){_0x584a9d[_0xf1f5('0x2')](_0x58c164,_0x39a25e);};}function removeListener(_0x16999c,_0x5b1088){return function(){UserNotificationEvents[_0xf1f5('0x3')](_0x16999c,_0x5b1088);};}exports[_0xf1f5('0x4')]=function(_0x18907a){for(var _0x10bf4a=0x0,_0x131820=events[_0xf1f5('0x5')];_0x10bf4a<_0x131820;_0x10bf4a++){var _0x50c21c=events[_0x10bf4a];var _0x5ebac3=createListener(_0xf1f5('0x6')+_0x50c21c,_0x18907a);UserNotificationEvents['on'](_0x50c21c,_0x5ebac3);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index d603cb1..de1ebf9 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3f03e6,_0x5beba3){var _0x44aa18=function(_0x580f74){while(--_0x580f74){_0x3f03e6['push'](_0x3f03e6['shift']());}};_0x44aa18(++_0x5beba3);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x424a50,_0x1fd66d){var _0x1427b2=function(_0x35f2a0){while(--_0x35f2a0){_0x424a50['push'](_0x424a50['shift']());}};_0x1427b2(++_0x1fd66d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 0f21680..b19e8d5 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 _0x63e2=['INTEGER','sequelize'];(function(_0x4b3e37,_0x164d07){var _0x5ca518=function(_0x246c85){while(--_0x246c85){_0x4b3e37['push'](_0x4b3e37['shift']());}};_0x5ca518(++_0x164d07);}(_0x63e2,0x143));var _0x263e=function(_0x5c2cc7,_0x30feee){_0x5c2cc7=_0x5c2cc7-0x0;var _0xecbc6=_0x63e2[_0x5c2cc7];return _0xecbc6;};'use strict';var Sequelize=require(_0x263e('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x263e('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd42b=['sequelize','exports','INTEGER'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xd42b,0x156));var _0xbd42=function(_0x39fd11,_0x5d7883){_0x39fd11=_0x39fd11-0x0;var _0x302799=_0xd42b[_0x39fd11];return _0x302799;};'use strict';var Sequelize=require(_0xbd42('0x0'));module[_0xbd42('0x1')]={'penalty':{'type':Sequelize[_0xbd42('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 30ec303..6caf079 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 _0x9477=['util','api','bluebird','request-promise','path','rimraf','./userOpenchannelQueue.attributes','exports','define','user_has_openchannel_queues','lodash'];(function(_0x5743e3,_0x4a2aab){var _0x24d100=function(_0x10737c){while(--_0x10737c){_0x5743e3['push'](_0x5743e3['shift']());}};_0x24d100(++_0x4a2aab);}(_0x9477,0xc5));var _0x7947=function(_0xc5074d,_0x29970b){_0xc5074d=_0xc5074d-0x0;var _0x41182c=_0x9477[_0xc5074d];return _0x41182c;};'use strict';var _=require(_0x7947('0x0'));var util=require(_0x7947('0x1'));var logger=require('../../config/logger')(_0x7947('0x2'));var moment=require('moment');var BPromise=require(_0x7947('0x3'));var rp=require(_0x7947('0x4'));var fs=require('fs');var path=require(_0x7947('0x5'));var rimraf=require(_0x7947('0x6'));var config=require('../../config/environment');var attributes=require(_0x7947('0x7'));module[_0x7947('0x8')]=function(_0x4d3fe6,_0x176990){return _0x4d3fe6[_0x7947('0x9')]('UserOpenchannelQueue',attributes,{'tableName':_0x7947('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa7cc=['user_has_openchannel_queues','util','../../config/logger','bluebird','request-promise','rimraf','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue'];(function(_0x30a9b1,_0x511d6b){var _0xcb8978=function(_0x11ac04){while(--_0x11ac04){_0x30a9b1['push'](_0x30a9b1['shift']());}};_0xcb8978(++_0x511d6b);}(_0xa7cc,0x1cd));var _0xca7c=function(_0x3e5694,_0x396d43){_0x3e5694=_0x3e5694-0x0;var _0x1b7948=_0xa7cc[_0x3e5694];return _0x1b7948;};'use strict';var _=require('lodash');var util=require(_0xca7c('0x0'));var logger=require(_0xca7c('0x1'))('api');var moment=require('moment');var BPromise=require(_0xca7c('0x2'));var rp=require(_0xca7c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xca7c('0x4'));var config=require('../../config/environment');var attributes=require(_0xca7c('0x5'));module[_0xca7c('0x6')]=function(_0x524dc8,_0x3c729a){return _0x524dc8[_0xca7c('0x7')](_0xca7c('0x8'),attributes,{'tableName':_0xca7c('0x9'),'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 785f7f7..e6c2b2d 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 _0x131c=['UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','ioredis','rpc','jayson/promise','client','http','then','info'];(function(_0x124cf0,_0x53365a){var _0x54dcc1=function(_0x37a38c){while(--_0x37a38c){_0x124cf0['push'](_0x124cf0['shift']());}};_0x54dcc1(++_0x53365a);}(_0x131c,0x143));var _0xc131=function(_0x40f669,_0x142c5a){_0x40f669=_0x40f669-0x0;var _0xbacd7e=_0x131c[_0x40f669];return _0xbacd7e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc131('0x0'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc131('0x1'));var config=require('../../config/environment');var jayson=require(_0xc131('0x2'));var client=jayson[_0xc131('0x3')][_0xc131('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x1257ec,_0x2de16a,_0x3dc695){return new BPromise(function(_0x378dcc,_0x4140bf){return client['request'](_0x1257ec,_0x3dc695)[_0xc131('0x5')](function(_0x1d5f73){logger[_0xc131('0x6')](_0xc131('0x7'),_0x2de16a,_0xc131('0x8'));logger[_0xc131('0x9')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x2de16a,'request\x20sent',JSON[_0xc131('0xa')](_0x1d5f73));if(_0x1d5f73[_0xc131('0xb')]){if(_0x1d5f73[_0xc131('0xb')][_0xc131('0xc')]===0x1f4){logger[_0xc131('0xb')](_0xc131('0x7'),_0x2de16a,_0x1d5f73[_0xc131('0xb')][_0xc131('0xd')]);return _0x4140bf(_0x1d5f73['error'][_0xc131('0xd')]);}logger[_0xc131('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2de16a,_0x1d5f73[_0xc131('0xb')][_0xc131('0xd')]);return _0x378dcc(_0x1d5f73['error']['message']);}else{logger[_0xc131('0x6')](_0xc131('0x7'),_0x2de16a,_0xc131('0x8'));_0x378dcc(_0x1d5f73[_0xc131('0xe')]['message']);}})['catch'](function(_0x23d7c4){logger[_0xc131('0xb')](_0xc131('0x7'),_0x2de16a,_0x23d7c4);_0x4140bf(_0x23d7c4);});});} \ No newline at end of file +var _0xd3df=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x355e2b,_0x1e99eb){var _0x2b59bb=function(_0x14f698){while(--_0x14f698){_0x355e2b['push'](_0x355e2b['shift']());}};_0x2b59bb(++_0x1e99eb);}(_0xd3df,0x1f0));var _0xfd3d=function(_0x1f4521,_0x22467f){_0x1f4521=_0x1f4521-0x0;var _0xc8c29f=_0xd3df[_0x1f4521];return _0xc8c29f;};'use strict';var _=require(_0xfd3d('0x0'));var util=require(_0xfd3d('0x1'));var moment=require(_0xfd3d('0x2'));var BPromise=require(_0xfd3d('0x3'));var rs=require(_0xfd3d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfd3d('0x5'))['db'];var utils=require(_0xfd3d('0x6'));var logger=require('../../config/logger')(_0xfd3d('0x7'));var config=require(_0xfd3d('0x8'));var jayson=require(_0xfd3d('0x9'));var client=jayson[_0xfd3d('0xa')][_0xfd3d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c5905,_0x55dc29,_0x18dd5d){return new BPromise(function(_0xe8a9ab,_0x202168){return client[_0xfd3d('0xc')](_0x4c5905,_0x18dd5d)[_0xfd3d('0xd')](function(_0x29e425){logger['info'](_0xfd3d('0xe'),_0x55dc29,_0xfd3d('0xf'));logger[_0xfd3d('0x10')](_0xfd3d('0x11'),_0x55dc29,_0xfd3d('0xf'),JSON[_0xfd3d('0x12')](_0x29e425));if(_0x29e425[_0xfd3d('0x13')]){if(_0x29e425[_0xfd3d('0x13')][_0xfd3d('0x14')]===0x1f4){logger[_0xfd3d('0x13')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x55dc29,_0x29e425[_0xfd3d('0x13')][_0xfd3d('0x15')]);return _0x202168(_0x29e425['error'][_0xfd3d('0x15')]);}logger[_0xfd3d('0x13')](_0xfd3d('0xe'),_0x55dc29,_0x29e425['error'][_0xfd3d('0x15')]);return _0xe8a9ab(_0x29e425['error'][_0xfd3d('0x15')]);}else{logger[_0xfd3d('0x16')](_0xfd3d('0xe'),_0x55dc29,'request\x20sent');_0xe8a9ab(_0x29e425[_0xfd3d('0x17')]['message']);}})[_0xfd3d('0x18')](function(_0xb47377){logger[_0xfd3d('0x13')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x55dc29,_0xb47377);_0x202168(_0xb47377);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 2bec8cd..daceef0 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 _0xadcb=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfile.controller','isAuthenticated','index','/describe','describe','show','get','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','addResources','update','delete','destroy','/:id/sections','removeSections','removeResources','exports','multer','path'];(function(_0x20ff9f,_0x4adecd){var _0x4de921=function(_0x57fd79){while(--_0x57fd79){_0x20ff9f['push'](_0x20ff9f['shift']());}};_0x4de921(++_0x4adecd);}(_0xadcb,0x1a2));var _0xbadc=function(_0x4727b8,_0x52a05a){_0x4727b8=_0x4727b8-0x0;var _0x152b05=_0xadcb[_0x4727b8];return _0x152b05;};'use strict';var multer=require(_0xbadc('0x0'));var util=require('util');var path=require(_0xbadc('0x1'));var timeout=require(_0xbadc('0x2'));var express=require('express');var router=express[_0xbadc('0x3')]();var fs_extra=require(_0xbadc('0x4'));var auth=require(_0xbadc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbadc('0x6'));var controller=require(_0xbadc('0x7'));router['get']('/',auth[_0xbadc('0x8')](),controller[_0xbadc('0x9')]);router['get'](_0xbadc('0xa'),auth[_0xbadc('0x8')](),controller[_0xbadc('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xbadc('0xc')]);router[_0xbadc('0xd')]('/:id/sections',auth['isAuthenticated'](),controller[_0xbadc('0xe')]);router[_0xbadc('0xd')](_0xbadc('0xf'),auth['isAuthenticated'](),controller[_0xbadc('0x10')]);router[_0xbadc('0x11')]('/',auth[_0xbadc('0x8')](),controller[_0xbadc('0x12')]);router[_0xbadc('0x11')](_0xbadc('0x13'),auth[_0xbadc('0x8')](),controller[_0xbadc('0x14')]);router[_0xbadc('0x11')]('/:id/sections',auth[_0xbadc('0x8')](),controller[_0xbadc('0x15')]);router['post'](_0xbadc('0xf'),auth[_0xbadc('0x8')](),controller[_0xbadc('0x16')]);router['put']('/:id',auth[_0xbadc('0x8')](),controller[_0xbadc('0x17')]);router[_0xbadc('0x18')]('/:id',auth[_0xbadc('0x8')](),controller[_0xbadc('0x19')]);router['delete'](_0xbadc('0x1a'),auth[_0xbadc('0x8')](),controller[_0xbadc('0x1b')]);router[_0xbadc('0x18')]('/:id/resources',auth[_0xbadc('0x8')](),controller[_0xbadc('0x1c')]);module[_0xbadc('0x1d')]=router; \ No newline at end of file +var _0x9f10=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/sections','getSections','getResources','post','create','/:id/clone','clone','addSections','/:id/resources','addResources','put','delete','destroy','removeSections','exports','multer','util','connect-timeout','express'];(function(_0x3e16d3,_0x2ec9ab){var _0x5336f1=function(_0x114e38){while(--_0x114e38){_0x3e16d3['push'](_0x3e16d3['shift']());}};_0x5336f1(++_0x2ec9ab);}(_0x9f10,0xf4));var _0x09f1=function(_0x39d4a1,_0x46ba00){_0x39d4a1=_0x39d4a1-0x0;var _0x13c306=_0x9f10[_0x39d4a1];return _0x13c306;};'use strict';var multer=require(_0x09f1('0x0'));var util=require(_0x09f1('0x1'));var path=require('path');var timeout=require(_0x09f1('0x2'));var express=require(_0x09f1('0x3'));var router=express[_0x09f1('0x4')]();var fs_extra=require(_0x09f1('0x5'));var auth=require(_0x09f1('0x6'));var interaction=require(_0x09f1('0x7'));var config=require(_0x09f1('0x8'));var controller=require(_0x09f1('0x9'));router[_0x09f1('0xa')]('/',auth[_0x09f1('0xb')](),controller[_0x09f1('0xc')]);router['get'](_0x09f1('0xd'),auth[_0x09f1('0xb')](),controller[_0x09f1('0xe')]);router[_0x09f1('0xa')](_0x09f1('0xf'),auth[_0x09f1('0xb')](),controller['show']);router['get'](_0x09f1('0x10'),auth['isAuthenticated'](),controller[_0x09f1('0x11')]);router[_0x09f1('0xa')]('/:id/resources',auth[_0x09f1('0xb')](),controller[_0x09f1('0x12')]);router[_0x09f1('0x13')]('/',auth[_0x09f1('0xb')](),controller[_0x09f1('0x14')]);router['post'](_0x09f1('0x15'),auth['isAuthenticated'](),controller[_0x09f1('0x16')]);router['post'](_0x09f1('0x10'),auth['isAuthenticated'](),controller[_0x09f1('0x17')]);router[_0x09f1('0x13')](_0x09f1('0x18'),auth['isAuthenticated'](),controller[_0x09f1('0x19')]);router[_0x09f1('0x1a')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x09f1('0x1b')](_0x09f1('0xf'),auth[_0x09f1('0xb')](),controller[_0x09f1('0x1c')]);router['delete'](_0x09f1('0x10'),auth[_0x09f1('0xb')](),controller[_0x09f1('0x1d')]);router[_0x09f1('0x1b')]('/:id/resources',auth[_0x09f1('0xb')](),controller['removeResources']);module[_0x09f1('0x1e')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index ff71827..d40be6d 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 _0x1ce1=['setDataValue','crudPermissions','getDataValue','split','BOOLEAN','sequelize','exports','STRING'];(function(_0x5d67a7,_0x18bc1e){var _0x564427=function(_0x54c278){while(--_0x54c278){_0x5d67a7['push'](_0x5d67a7['shift']());}};_0x564427(++_0x18bc1e);}(_0x1ce1,0x7d));var _0x11ce=function(_0x123018,_0x9ee0){_0x123018=_0x123018-0x0;var _0x11cb7c=_0x1ce1[_0x123018];return _0x11cb7c;};'use strict';var Sequelize=require(_0x11ce('0x0'));module[_0x11ce('0x1')]={'name':{'type':Sequelize[_0x11ce('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x22fbec){this[_0x11ce('0x3')]('crudPermissions',_0x22fbec?_0x22fbec['join'](''):[]);},'get':function(){return this['getDataValue'](_0x11ce('0x4'))?this[_0x11ce('0x5')](_0x11ce('0x4'))[_0x11ce('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x11ce('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x11ce('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x11ce('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x11ce('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x11ce('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x11ce('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x11ce('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5fbc=['crudPermissions','join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue'];(function(_0x42a0f6,_0x4ee755){var _0x259bdb=function(_0x238e0e){while(--_0x238e0e){_0x42a0f6['push'](_0x42a0f6['shift']());}};_0x259bdb(++_0x4ee755);}(_0x5fbc,0x1d1));var _0xc5fb=function(_0x4552c0,_0x4072b1){_0x4552c0=_0x4552c0-0x0;var _0x39b8c2=_0x5fbc[_0x4552c0];return _0x39b8c2;};'use strict';var Sequelize=require(_0xc5fb('0x0'));module[_0xc5fb('0x1')]={'name':{'type':Sequelize[_0xc5fb('0x2')],'allowNull':![],'unique':_0xc5fb('0x3')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0xb38949){this[_0xc5fb('0x4')](_0xc5fb('0x5'),_0xb38949?_0xb38949[_0xc5fb('0x6')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0xc5fb('0x7')]('crudPermissions')[_0xc5fb('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xc5fb('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xc5fb('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xc5fb('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xc5fb('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xc5fb('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xc5fb('0x9')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 088ac0e..140f600 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 _0xf7f0=['redis','./userProfile.socket','register','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','UserProfile','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','create','body','params','find','get','omit','createdAt','crudPermissions','sequelize','each','autoAssociation','UserProfileResource','sectionId','updatedAt','userProfileId','Resources','UserProfileSection','describe','transaction','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','concat','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','localhost','socket.io-emitter'];(function(_0x382651,_0x95ac66){var _0x5e8e6a=function(_0x4267f0){while(--_0x4267f0){_0x382651['push'](_0x382651['shift']());}};_0x5e8e6a(++_0x95ac66);}(_0xf7f0,0xcb));var _0x0f7f=function(_0x4697b1,_0x4b9cfd){_0x4697b1=_0x4697b1-0x0;var _0x429280=_0xf7f0[_0x4697b1];return _0x429280;};'use strict';var emlformat=require(_0x0f7f('0x0'));var rimraf=require(_0x0f7f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0f7f('0x2'));var rp=require(_0x0f7f('0x3'));var moment=require(_0x0f7f('0x4'));var BPromise=require(_0x0f7f('0x5'));var Mustache=require('mustache');var util=require(_0x0f7f('0x6'));var path=require(_0x0f7f('0x7'));var sox=require(_0x0f7f('0x8'));var csv=require(_0x0f7f('0x9'));var ejs=require(_0x0f7f('0xa'));var fs=require('fs');var fs_extra=require(_0x0f7f('0xb'));var _=require(_0x0f7f('0xc'));var squel=require(_0x0f7f('0xd'));var crypto=require(_0x0f7f('0xe'));var jsforce=require(_0x0f7f('0xf'));var deskjs=require(_0x0f7f('0x10'));var toCsv=require(_0x0f7f('0x9'));var querystring=require('querystring');var Papa=require(_0x0f7f('0x11'));var Redis=require(_0x0f7f('0x12'));var authService=require(_0x0f7f('0x13'));var qs=require(_0x0f7f('0x14'));var as=require(_0x0f7f('0x15'));var hardwareService=require(_0x0f7f('0x16'));var logger=require(_0x0f7f('0x17'))(_0x0f7f('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0f7f('0x19'));var db=require(_0x0f7f('0x1a'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x0f7f('0x1b'),'port':0x18eb});var socket=require(_0x0f7f('0x1c'))(new Redis(config[_0x0f7f('0x1d')]));require(_0x0f7f('0x1e'))[_0x0f7f('0x1f')](socket);function respondWithStatusCode(_0x3a6047,_0x153175){_0x153175=_0x153175||0xcc;return function(_0x4814ad){if(_0x4814ad){return _0x3a6047['sendStatus'](_0x153175);}return _0x3a6047[_0x0f7f('0x20')](_0x153175)[_0x0f7f('0x21')]();};}function respondWithResult(_0x5ba4e6,_0x4d6ffc){_0x4d6ffc=_0x4d6ffc||0xc8;return function(_0x320445){if(_0x320445){return _0x5ba4e6[_0x0f7f('0x20')](_0x4d6ffc)[_0x0f7f('0x22')](_0x320445);}};}function respondWithFilteredResult(_0x338fcd,_0x160b1a){return function(_0x274669){if(_0x274669){var _0x13aba1=typeof _0x160b1a[_0x0f7f('0x23')]==='undefined'&&typeof _0x160b1a[_0x0f7f('0x24')]===_0x0f7f('0x25');var _0xedfe34=_0x274669['count'];var _0x5be574=_0x13aba1?0x0:_0x160b1a[_0x0f7f('0x23')];var _0x56d1f9=_0x13aba1?_0x274669['count']:_0x160b1a[_0x0f7f('0x23')]+_0x160b1a[_0x0f7f('0x24')];var _0x4ead0e;if(_0x56d1f9>=_0xedfe34){_0x56d1f9=_0xedfe34;_0x4ead0e=0xc8;}else{_0x4ead0e=0xce;}_0x338fcd[_0x0f7f('0x20')](_0x4ead0e);return _0x338fcd[_0x0f7f('0x26')](_0x0f7f('0x27'),_0x5be574+'-'+_0x56d1f9+'/'+_0xedfe34)[_0x0f7f('0x22')](_0x274669);}return null;};}function patchUpdates(_0x40f6e1){return function(_0x2f19c7){try{jsonpatch[_0x0f7f('0x28')](_0x2f19c7,_0x40f6e1,!![]);}catch(_0x2332c1){return BPromise[_0x0f7f('0x29')](_0x2332c1);}return _0x2f19c7[_0x0f7f('0x2a')]();};}function saveUpdates(_0x59b63f,_0x4afafd){return function(_0x15183b){if(_0x15183b){return _0x15183b[_0x0f7f('0x2b')](_0x59b63f)[_0x0f7f('0x2c')](function(_0x48e341){return _0x48e341;});}return null;};}function removeEntity(_0xc3d107,_0x229b0f){return function(_0x2aae44){if(_0x2aae44){return _0x2aae44[_0x0f7f('0x2d')]()[_0x0f7f('0x2c')](function(){_0xc3d107['status'](0xcc)[_0x0f7f('0x21')]();});}};}function handleEntityNotFound(_0x4b523d,_0x4d9f96){return function(_0x2a721f){if(!_0x2a721f){_0x4b523d['sendStatus'](0x194);}return _0x2a721f;};}function handleError(_0x283983,_0x4df3e9){_0x4df3e9=_0x4df3e9||0x1f4;return function(_0x1c895a){logger[_0x0f7f('0x2e')](_0x1c895a['stack']);if(_0x1c895a[_0x0f7f('0x2f')]){delete _0x1c895a[_0x0f7f('0x2f')];}_0x283983[_0x0f7f('0x20')](_0x4df3e9)[_0x0f7f('0x30')](_0x1c895a);};}exports['index']=function(_0x316bd6,_0x13e5c8){var _0x58dbe2={},_0x2b5e23={},_0x1cff2f={'count':0x0,'rows':[]};var _0x1fa019=_['map'](db[_0x0f7f('0x31')][_0x0f7f('0x32')],function(_0x41c684){return{'name':_0x41c684['fieldName'],'type':_0x41c684[_0x0f7f('0x33')][_0x0f7f('0x34')]};});_0x2b5e23[_0x0f7f('0x35')]=_[_0x0f7f('0x36')](_0x1fa019,_0x0f7f('0x2f'));_0x2b5e23[_0x0f7f('0x37')]=_[_0x0f7f('0x38')](_0x316bd6[_0x0f7f('0x37')]);_0x2b5e23[_0x0f7f('0x39')]=_[_0x0f7f('0x3a')](_0x2b5e23[_0x0f7f('0x35')],_0x2b5e23[_0x0f7f('0x37')]);_0x58dbe2[_0x0f7f('0x3b')]=_[_0x0f7f('0x3a')](_0x2b5e23[_0x0f7f('0x35')],qs[_0x0f7f('0x3c')](_0x316bd6[_0x0f7f('0x37')][_0x0f7f('0x3c')]));_0x58dbe2[_0x0f7f('0x3b')]=_0x58dbe2[_0x0f7f('0x3b')][_0x0f7f('0x3d')]?_0x58dbe2[_0x0f7f('0x3b')]:_0x2b5e23['model'];if(!_0x316bd6[_0x0f7f('0x37')][_0x0f7f('0x3e')]('nolimit')){_0x58dbe2[_0x0f7f('0x24')]=qs[_0x0f7f('0x24')](_0x316bd6[_0x0f7f('0x37')][_0x0f7f('0x24')]);_0x58dbe2['offset']=qs[_0x0f7f('0x23')](_0x316bd6['query'][_0x0f7f('0x23')]);}_0x58dbe2['order']=qs[_0x0f7f('0x3f')](_0x316bd6[_0x0f7f('0x37')][_0x0f7f('0x3f')]);_0x58dbe2[_0x0f7f('0x40')]=qs[_0x0f7f('0x39')](_[_0x0f7f('0x41')](_0x316bd6[_0x0f7f('0x37')],_0x2b5e23[_0x0f7f('0x39')]),_0x1fa019);if(_0x316bd6[_0x0f7f('0x37')][_0x0f7f('0x42')]){_0x58dbe2[_0x0f7f('0x40')]=_[_0x0f7f('0x43')](_0x58dbe2[_0x0f7f('0x40')],{'$or':_['map'](_0x1fa019,function(_0x10ae6c){if(_0x10ae6c[_0x0f7f('0x33')]!=='VIRTUAL'){var _0x3b4103={};_0x3b4103[_0x10ae6c['name']]={'$like':'%'+_0x316bd6['query'][_0x0f7f('0x42')]+'%'};return _0x3b4103;}})});}_0x58dbe2=_[_0x0f7f('0x43')]({},_0x58dbe2,_0x316bd6[_0x0f7f('0x44')]);var _0x1d7475={'where':_0x58dbe2[_0x0f7f('0x40')]};return db[_0x0f7f('0x31')][_0x0f7f('0x45')](_0x1d7475)[_0x0f7f('0x2c')](function(_0x329a8){_0x1cff2f['count']=_0x329a8;if(_0x316bd6[_0x0f7f('0x37')][_0x0f7f('0x46')]){_0x58dbe2[_0x0f7f('0x47')]=[{'all':!![]}];}return db[_0x0f7f('0x31')][_0x0f7f('0x48')](_0x58dbe2);})[_0x0f7f('0x2c')](function(_0x559afb){_0x1cff2f[_0x0f7f('0x49')]=_0x559afb;return _0x1cff2f;})[_0x0f7f('0x2c')](respondWithFilteredResult(_0x13e5c8,_0x58dbe2))[_0x0f7f('0x4a')](handleError(_0x13e5c8,null));};exports[_0x0f7f('0x4b')]=function(_0x1cebb9,_0x182a70){var _0x314069={'raw':![],'where':{'id':_0x1cebb9['params']['id']}},_0x1290e4={};_0x1290e4[_0x0f7f('0x35')]=_['keys'](db[_0x0f7f('0x31')][_0x0f7f('0x32')]);_0x1290e4[_0x0f7f('0x37')]=_['keys'](_0x1cebb9[_0x0f7f('0x37')]);_0x1290e4[_0x0f7f('0x39')]=_[_0x0f7f('0x3a')](_0x1290e4['model'],_0x1290e4[_0x0f7f('0x37')]);_0x314069[_0x0f7f('0x3b')]=_[_0x0f7f('0x3a')](_0x1290e4[_0x0f7f('0x35')],qs[_0x0f7f('0x3c')](_0x1cebb9[_0x0f7f('0x37')][_0x0f7f('0x3c')]));_0x314069[_0x0f7f('0x3b')]=_0x314069[_0x0f7f('0x3b')]['length']?_0x314069['attributes']:_0x1290e4[_0x0f7f('0x35')];if(_0x1cebb9[_0x0f7f('0x37')]['includeAll']){_0x314069['include']=[{'all':!![]}];}_0x314069=_['merge']({},_0x314069,_0x1cebb9[_0x0f7f('0x44')]);return db[_0x0f7f('0x31')]['find'](_0x314069)[_0x0f7f('0x2c')](handleEntityNotFound(_0x182a70,null))[_0x0f7f('0x2c')](respondWithResult(_0x182a70,null))[_0x0f7f('0x4a')](handleError(_0x182a70,null));};exports['create']=function(_0x5dde62,_0x1b5180){return db['UserProfile'][_0x0f7f('0x4c')](_0x5dde62[_0x0f7f('0x4d')],{})[_0x0f7f('0x2c')](respondWithResult(_0x1b5180,0xc9))[_0x0f7f('0x4a')](handleError(_0x1b5180,null));};exports['clone']=function(_0xec62a0,_0x4a804a){var _0x1b835c={'where':{'id':_0xec62a0[_0x0f7f('0x4e')]['id']}},_0x1a7e4b={};_0x1a7e4b[_0x0f7f('0x35')]=_[_0x0f7f('0x38')](db[_0x0f7f('0x31')][_0x0f7f('0x32')]);_0x1b835c[_0x0f7f('0x3b')]=_[_0x0f7f('0x3a')](_0x1a7e4b[_0x0f7f('0x35')],qs[_0x0f7f('0x3c')](_0xec62a0[_0x0f7f('0x37')][_0x0f7f('0x3c')]));_0x1b835c[_0x0f7f('0x3b')]=_0x1b835c[_0x0f7f('0x3b')][_0x0f7f('0x3d')]?_0x1b835c['attributes']:_0x1a7e4b[_0x0f7f('0x35')];if(_0xec62a0[_0x0f7f('0x37')][_0x0f7f('0x46')]){_0x1b835c[_0x0f7f('0x47')]=[{'all':!![]}];}_0x1b835c=_[_0x0f7f('0x43')]({},_0x1b835c,_0xec62a0['options']);return db[_0x0f7f('0x31')][_0x0f7f('0x4f')](_0x1b835c)[_0x0f7f('0x2c')](handleEntityNotFound(_0x4a804a,null))[_0x0f7f('0x2c')](function(_0x44345d){if(_0x44345d){var _0x33af78=_0x44345d[_0x0f7f('0x50')]({'plain':!![]});_0x33af78=qs[_0x0f7f('0x51')](_0x33af78,['id',_0x0f7f('0x52'),'updatedAt',_0x0f7f('0x53')]);_0xec62a0[_0x0f7f('0x4d')]=_[_0x0f7f('0x51')](_0xec62a0['body'],['id',_0x0f7f('0x52'),'updatedAt']);return db[_0x0f7f('0x54')]['transaction'](function(_0x3c952c){return db[_0x0f7f('0x31')][_0x0f7f('0x4c')](_['merge'](_0x33af78,_0xec62a0[_0x0f7f('0x4d')]),{'include':_0xec62a0[_0x0f7f('0x37')][_0x0f7f('0x46')]?[{'all':!![]}]:undefined,'transaction':_0x3c952c})[_0x0f7f('0x2c')](function(_0x126e1f){var _0x278b01=_0x126e1f['get']({'plain':!![]});return db['UserProfileSection'][_0x0f7f('0x48')]({'where':{'userProfileId':_0xec62a0[_0x0f7f('0x4e')]['id']},'raw':!![]})[_0x0f7f('0x2c')](function(_0x303efc){if(_0x303efc){return BPromise[_0x0f7f('0x55')](_0x303efc,function(_0x3231f7){return new BPromise(function(_0x3a982e,_0x2b1035){if(_0x3231f7[_0x0f7f('0x56')]===null||_0x3231f7[_0x0f7f('0x56')]===0x1)_0x3a982e(null);return db[_0x0f7f('0x57')][_0x0f7f('0x48')]({'where':{'sectionId':_0x3231f7['id']},'raw':!![]})[_0x0f7f('0x2c')](function(_0x7392bf){var _0x1700f1=_[_0x0f7f('0x36')](_0x7392bf,function(_0x5f3a7b){return qs['omit'](_0x5f3a7b,['id','createdAt','updatedAt',_0x0f7f('0x58')]);});_0x3a982e(_0x1700f1);})[_0x0f7f('0x4a')](function(_0x16b9a8){_0x2b1035(_0x16b9a8);});})[_0x0f7f('0x2c')](function(_0xaf5fcf){var _0x26ce83=qs[_0x0f7f('0x51')](_0x3231f7,['id',_0x0f7f('0x52'),_0x0f7f('0x59')]);_0x26ce83[_0x0f7f('0x5a')]=_0x278b01['id'];if(_0xaf5fcf)_0x26ce83[_0x0f7f('0x5b')]=_0xaf5fcf;return _0x26ce83;})[_0x0f7f('0x2c')](function(_0x52e346){return db[_0x0f7f('0x5c')][_0x0f7f('0x4c')](_0x52e346,{'include':[{'model':db[_0x0f7f('0x57')],'as':_0x0f7f('0x5b')}],'raw':!![],'transaction':_0x3c952c});});})[_0x0f7f('0x2c')](function(){return _0x278b01;});}});});});}})['then'](respondWithResult(_0x4a804a,0xc9))[_0x0f7f('0x4a')](handleError(_0x4a804a,null));};exports[_0x0f7f('0x2b')]=function(_0x29f481,_0x49f67e){if(_0x29f481[_0x0f7f('0x4d')]['id']){delete _0x29f481[_0x0f7f('0x4d')]['id'];}return db[_0x0f7f('0x31')][_0x0f7f('0x4f')]({'where':{'id':_0x29f481[_0x0f7f('0x4e')]['id']}})[_0x0f7f('0x2c')](handleEntityNotFound(_0x49f67e,null))[_0x0f7f('0x2c')](saveUpdates(_0x29f481[_0x0f7f('0x4d')],null))[_0x0f7f('0x2c')](respondWithResult(_0x49f67e,null))[_0x0f7f('0x4a')](handleError(_0x49f67e,null));};exports[_0x0f7f('0x2d')]=function(_0x3e2adc,_0x3bd099){return db['UserProfile']['find']({'where':{'id':_0x3e2adc[_0x0f7f('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3bd099,null))[_0x0f7f('0x2c')](removeEntity(_0x3bd099,null))[_0x0f7f('0x4a')](handleError(_0x3bd099,null));};exports[_0x0f7f('0x5d')]=function(_0x4aa902,_0x58c840){return db['UserProfile'][_0x0f7f('0x5d')]()[_0x0f7f('0x2c')](respondWithResult(_0x58c840,null))[_0x0f7f('0x4a')](handleError(_0x58c840,null));};exports['addSections']=function(_0x2ba847,_0x5a9342){var _0x4a72ec=_0x2ba847['body'];return db[_0x0f7f('0x31')]['find']({'where':{'id':_0x2ba847[_0x0f7f('0x4e')]['id']}})[_0x0f7f('0x2c')](handleEntityNotFound(_0x5a9342,null))['then'](function(_0x81dc0c){if(_0x81dc0c){return db['sequelize'][_0x0f7f('0x5e')](function(_0x7b68a2){return db[_0x0f7f('0x5c')]['destroy']({'where':{'userProfileId':_0x2ba847['params']['id'],'sectionId':_[_0x0f7f('0x36')](_0x4a72ec,function(_0x216b78){return _0x216b78[_0x0f7f('0x58')];})},'transaction':_0x7b68a2})[_0x0f7f('0x2c')](function(){var _0x5630ef=_[_0x0f7f('0x36')](_0x4a72ec,function(_0x42c5c7){_0x42c5c7[_0x0f7f('0x5a')]=_0x2ba847['params']['id'];return _0x42c5c7;});var _0x28f847=[];return BPromise[_0x0f7f('0x55')](_0x5630ef,function(_0x41475a){return db[_0x0f7f('0x5c')]['create'](_0x41475a,{'include':[{'model':db[_0x0f7f('0x57')],'as':_0x0f7f('0x5b')}],'raw':!![],'transaction':_0x7b68a2})[_0x0f7f('0x2c')](function(_0x47c34c){_0x28f847[_0x0f7f('0x5f')](_0x47c34c[_0x0f7f('0x50')]({'plain':!![]}));});})[_0x0f7f('0x2c')](function(){return _0x28f847;});});});}})['then'](function(_0x51960a){return _0x51960a;})[_0x0f7f('0x2c')](respondWithResult(_0x5a9342,null))[_0x0f7f('0x4a')](handleError(_0x5a9342,null));};exports[_0x0f7f('0x60')]=function(_0x1f6762,_0x29f390){var _0x4b3374;return db['UserProfile'][_0x0f7f('0x4f')]({'where':{'id':_0x1f6762[_0x0f7f('0x4e')]['id']},'attributes':['id',_0x0f7f('0x2f')]})[_0x0f7f('0x2c')](handleEntityNotFound(_0x29f390,null))['then'](function(_0x77b3af){if(_0x77b3af){_0x4b3374=_0x77b3af;return db[_0x0f7f('0x5c')]['destroy']({'where':{'userProfileId':_0x1f6762['params']['id'],'sectionId':_0x1f6762[_0x0f7f('0x37')][_0x0f7f('0x61')]}});}})[_0x0f7f('0x2c')](function(){return _0x4b3374;})[_0x0f7f('0x2c')](respondWithStatusCode(_0x29f390,null))[_0x0f7f('0x4a')](handleError(_0x29f390,null));};exports[_0x0f7f('0x62')]=function(_0x456268,_0x1917d5){var _0x4abca0=[];var _0x3a3aa2=[];return db[_0x0f7f('0x5c')][_0x0f7f('0x48')]({'where':{'userProfileId':_0x456268['params']['id']},'raw':!![]})[_0x0f7f('0x2c')](function(_0x12de97){_0x4abca0=_[_0x0f7f('0x42')](_0x12de97,function(_0x1cdeab){return _0x1cdeab[_0x0f7f('0x63')]===0x1||_[_0x0f7f('0x64')]([0x3eb,0x709],_0x1cdeab[_0x0f7f('0x58')]);});if(!_[_0x0f7f('0x65')](_0x4abca0)){return _[_0x0f7f('0x36')](_0x4abca0,function(_0x1fa591){return _0x1fa591[_0x0f7f('0x58')];});}else{return;}})['then'](function(_0x470a72){if(_0x470a72)_0x3a3aa2=_0x470a72;if(_[_0x0f7f('0x64')](_0x3a3aa2,0x64)){var _0x58ca98=_[_0x0f7f('0x4f')](_0x4abca0,{'sectionId':0x64});return hasDefaultDashboard(_0x58ca98)[_0x0f7f('0x2c')](function(_0x5f1c02){return _[_0x0f7f('0x36')](_0x4abca0,function(_0x414ebe){if(_0x414ebe[_0x0f7f('0x58')]===0x64){_0x414ebe[_0x0f7f('0x66')]=_0x5f1c02;}return _0x414ebe;});});}else{return;}})['then'](function(_0x2b2d10){if(_0x2b2d10)_0x4abca0=_0x2b2d10;if(_[_0x0f7f('0x64')](_0x3a3aa2,0x3eb)){var _0x264617=_[_0x0f7f('0x4f')](_0x4abca0,{'sectionId':0x3eb});return getCustomDashboards(_0x264617)[_0x0f7f('0x2c')](function(_0x418bbe){return _[_0x0f7f('0x36')](_0x4abca0,function(_0x3bd03a){if(_0x264617[_0x0f7f('0x63')]){if(_0x3bd03a[_0x0f7f('0x58')]===0x3eb){_0x3bd03a['subsections']=_0x418bbe;}}else{if(_0x3bd03a[_0x0f7f('0x58')]===0x64){if(!_0x3bd03a[_0x0f7f('0x66')]){_0x3bd03a[_0x0f7f('0x66')]=[];}_0x3bd03a['subsections']=_0x3bd03a[_0x0f7f('0x66')][_0x0f7f('0x67')](_0x418bbe);}}return _0x3bd03a;});});}else{return;}})[_0x0f7f('0x2c')](function(_0x207e1d){if(_0x207e1d)_0x4abca0=_0x207e1d;if(_['includes'](_0x3a3aa2,0x709)){var _0x368327=_[_0x0f7f('0x4f')](_0x4abca0,{'sectionId':0x709});return getPlugins(_0x368327)[_0x0f7f('0x2c')](function(_0x2e9de9){if(_0x368327['enabled']){return _[_0x0f7f('0x36')](_0x4abca0,function(_0x5ec6c2){if(_0x5ec6c2[_0x0f7f('0x58')]===0x709){_0x5ec6c2[_0x0f7f('0x66')]=_0x2e9de9;}return _0x5ec6c2;});}else{var _0x5aaceb={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2e9de9};var _0x3bb1c0=_['map'](_0x4abca0);_0x3bb1c0[_0x0f7f('0x5f')](_0x5aaceb);return _0x3bb1c0;}});}else{return;}})[_0x0f7f('0x2c')](function(_0x3633c2){if(_0x3633c2)_0x4abca0=_0x3633c2;return _[_0x0f7f('0x42')](_0x4abca0,[_0x0f7f('0x63'),0x1]);})[_0x0f7f('0x2c')](respondWithResult(_0x1917d5,null))[_0x0f7f('0x4a')](handleError(_0x1917d5,null));};function hasDefaultDashboard(_0x22ad9a){var _0x5c1639=[0x65];return new BPromise(function(_0x4e1cee,_0xfd6e0f){try{if(_0x22ad9a[_0x0f7f('0x56')]){_0x4e1cee(_0x5c1639);}else{return db['UserProfileResource'][_0x0f7f('0x68')]({'where':{'sectionId':_0x22ad9a['id']},'raw':!![]})[_0x0f7f('0x2c')](function(_0x260809){_0x260809?_0x4e1cee(_0x5c1639):_0x4e1cee();});}}catch(_0x35d941){_0xfd6e0f(_0x35d941);}});}function getCustomDashboards(_0x133755){var _0x4193fb=[];return new BPromise(function(_0x2924b4,_0x40cf19){try{if(_0x133755[_0x0f7f('0x56')]){return db[_0x0f7f('0x69')][_0x0f7f('0x48')]({'raw':!![]})[_0x0f7f('0x2c')](function(_0x515ae6){_0x515ae6[_0x0f7f('0x6a')](function(_0x5ed418){_0x4193fb['push'](_0x5ed418['id']+0x1869f);});_0x2924b4(_0x4193fb);});}else{return db[_0x0f7f('0x57')]['findAll']({'where':{'sectionId':_0x133755['id']},'raw':!![]})['then'](function(_0x2bbe63){_0x2bbe63[_0x0f7f('0x6a')](function(_0x552015){_0x4193fb[_0x0f7f('0x5f')](_0x552015[_0x0f7f('0x6b')]+0x1869f);});_0x2924b4(_0x4193fb);});}}catch(_0x20df71){_0x40cf19(_0x20df71);}});}function getPlugins(_0x53ee61){var _0x4787b9=[];return new BPromise(function(_0x4966fb,_0x4d0657){try{if(_0x53ee61[_0x0f7f('0x56')]){return db[_0x0f7f('0x6c')][_0x0f7f('0x48')]({'raw':!![]})['then'](function(_0x502e31){_0x502e31['forEach'](function(_0x2852a3){_0x4787b9[_0x0f7f('0x5f')](_0x2852a3['id']+0x15b38);});_0x4966fb(_0x4787b9);});}else{return db['UserProfileResource'][_0x0f7f('0x48')]({'where':{'sectionId':_0x53ee61['id']},'raw':!![]})[_0x0f7f('0x2c')](function(_0x4b284b){_0x4b284b[_0x0f7f('0x6a')](function(_0x53a48c){_0x4787b9[_0x0f7f('0x5f')](_0x53a48c[_0x0f7f('0x6b')]+0x15b38);});_0x4966fb(_0x4787b9);});}}catch(_0x38739c){_0x4d0657(_0x38739c);}});}exports[_0x0f7f('0x6d')]=function(_0x587fdd,_0x34cdb2){return db[_0x0f7f('0x31')]['find']({'where':{'id':_0x587fdd[_0x0f7f('0x4e')]['id']}})[_0x0f7f('0x2c')](handleEntityNotFound(_0x34cdb2,null))[_0x0f7f('0x2c')](function(_0x495447){if(_0x495447){return db['sequelize']['transaction'](function(_0x3f4a04){return db[_0x0f7f('0x5c')][_0x0f7f('0x48')]({'where':{'userProfileId':_0x587fdd[_0x0f7f('0x4e')]['id']},'attributes':['id'],'raw':!![]})[_0x0f7f('0x2c')](function(_0x442e3c){if(_0x442e3c){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x587fdd['params']['id'],'id':_['map'](_0x442e3c,function(_0xd07e6d){return _0xd07e6d['id'];})},'transaction':_0x3f4a04});}})[_0x0f7f('0x2c')](function(_0x1ea18f){var _0x1fa5f4=_['map'](_0x587fdd[_0x0f7f('0x4d')],function(_0x119f67){_0x119f67[_0x0f7f('0x5a')]=_0x587fdd[_0x0f7f('0x4e')]['id'];return _0x119f67;});return db[_0x0f7f('0x5c')][_0x0f7f('0x6e')](_0x1fa5f4,{'raw':!![],'transaction':_0x3f4a04});})[_0x0f7f('0x2c')](function(_0x114f4c){var _0x2e480b=_['filter'](_['map'](_0x114f4c,function(_0x2e24ba){return _0x2e24ba[_0x0f7f('0x50')]({'plain':!![]});}),{'includeAll':![]});if(_0x2e480b){return db['UserProfileSection'][_0x0f7f('0x48')]({'where':{'userProfileId':_0x587fdd[_0x0f7f('0x4e')]['id'],'sectionId':_[_0x0f7f('0x36')](_0x2e480b,function(_0x522665){return _0x522665[_0x0f7f('0x58')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x0f7f('0x2c')](function(_0x3fcc90){var _0xc3a53=_[_0x0f7f('0x36')](_0x587fdd['body'],function(_0x4a7624){_0x4a7624['userProfileId']=_0x587fdd[_0x0f7f('0x4e')]['id'];return _0x4a7624;});return db[_0x0f7f('0x57')][_0x0f7f('0x6e')](_0xc3a53,{'raw':!![],'transaction':_0x3f4a04});});}})[_0x0f7f('0x4a')](handleError(_0x34cdb2,null));});}})[_0x0f7f('0x2c')](function(_0x5408a4){var _0x14ebc5=_[_0x0f7f('0x36')](_0x5408a4,function(_0x401d17){return _0x401d17[_0x0f7f('0x50')]({'plain':!![]});});})[_0x0f7f('0x2c')](respondWithResult(_0x34cdb2,null))[_0x0f7f('0x4a')](handleError(_0x34cdb2,null));};exports['removeResources']=function(_0x4ccee7,_0x2acb2a,_0xab361c){return db[_0x0f7f('0x31')]['find']({'where':{'id':_0x4ccee7[_0x0f7f('0x4e')]['id']}})[_0x0f7f('0x2c')](handleEntityNotFound(_0x2acb2a,null))[_0x0f7f('0x2c')](function(_0x147b76){if(_0x147b76){return _0x147b76[_0x0f7f('0x6f')](_0x4ccee7[_0x0f7f('0x37')][_0x0f7f('0x61')]);}})[_0x0f7f('0x2c')](respondWithStatusCode(_0x2acb2a,null))[_0x0f7f('0x4a')](handleError(_0x2acb2a,null));};exports[_0x0f7f('0x70')]=function(_0xeef63b,_0x423b56){var _0x19ca6c={};if(!_0xeef63b[_0x0f7f('0x37')][_0x0f7f('0x71')])throw new Error(_0x0f7f('0x72'));if(!_0xeef63b[_0x0f7f('0x37')]['hasOwnProperty']('nolimit')){_0x19ca6c['limit']=qs[_0x0f7f('0x24')](_0xeef63b[_0x0f7f('0x37')][_0x0f7f('0x24')]);_0x19ca6c[_0x0f7f('0x23')]=qs['offset'](_0xeef63b['query'][_0x0f7f('0x23')]);}return db['UserProfile'][_0x0f7f('0x4f')]({'where':{'id':_0xeef63b[_0x0f7f('0x4e')]['id']}})[_0x0f7f('0x2c')](function(_0x174ef0){if(!_0x174ef0)throw new Error(_0x0f7f('0x73')+_0xeef63b[_0x0f7f('0x4e')]['id']);return db[_0x0f7f('0x31')]['getResources'](_0xeef63b);})[_0x0f7f('0x2c')](respondWithFilteredResult(_0x423b56,_0x19ca6c))[_0x0f7f('0x4a')](handleError(_0x423b56,null));}; \ No newline at end of file +var _0x79e0=['bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','then','destroy','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','body','get','omit','createdAt','updatedAt','sequelize','transaction','create','UserProfileSection','each','autoAssociation','sectionId','userProfileId','Resources','UserProfileResource','describe','addSections','push','removeSections','isEmpty','includes','subsections','enabled','concat','findOne','Dashboard','forEach','Plugin','resourceId','addResources','bulkCreate','removeResources','getResources','section','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x5142b8,_0x1def06){var _0x4d3dde=function(_0x449d0b){while(--_0x449d0b){_0x5142b8['push'](_0x5142b8['shift']());}};_0x4d3dde(++_0x1def06);}(_0x79e0,0x6b));var _0x079e=function(_0x4e93a9,_0x413f30){_0x4e93a9=_0x4e93a9-0x0;var _0x43013c=_0x79e0[_0x4e93a9];return _0x43013c;};'use strict';var emlformat=require(_0x079e('0x0'));var rimraf=require(_0x079e('0x1'));var zipdir=require(_0x079e('0x2'));var jsonpatch=require(_0x079e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x079e('0x4'));var Mustache=require(_0x079e('0x5'));var util=require('util');var path=require(_0x079e('0x6'));var sox=require('sox');var csv=require(_0x079e('0x7'));var ejs=require(_0x079e('0x8'));var fs=require('fs');var fs_extra=require(_0x079e('0x9'));var _=require(_0x079e('0xa'));var squel=require(_0x079e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x079e('0xc'));var toCsv=require(_0x079e('0x7'));var querystring=require(_0x079e('0xd'));var Papa=require('papaparse');var Redis=require(_0x079e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x079e('0xf'));var as=require(_0x079e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x079e('0x11'))('api');var utils=require(_0x079e('0x12'));var config=require(_0x079e('0x13'));var licenseUtil=require(_0x079e('0x14'));var db=require('../../mysqldb')['db'];config[_0x079e('0x15')]=_[_0x079e('0x16')](config[_0x079e('0x15')],{'host':_0x079e('0x17'),'port':0x18eb});var socket=require(_0x079e('0x18'))(new Redis(config[_0x079e('0x15')]));require('./userProfile.socket')[_0x079e('0x19')](socket);function respondWithStatusCode(_0x139754,_0x16ce67){_0x16ce67=_0x16ce67||0xcc;return function(_0x3b50bd){if(_0x3b50bd){return _0x139754[_0x079e('0x1a')](_0x16ce67);}return _0x139754[_0x079e('0x1b')](_0x16ce67)[_0x079e('0x1c')]();};}function respondWithResult(_0x58f661,_0x41bdf2){_0x41bdf2=_0x41bdf2||0xc8;return function(_0x34f29c){if(_0x34f29c){return _0x58f661[_0x079e('0x1b')](_0x41bdf2)[_0x079e('0x1d')](_0x34f29c);}};}function respondWithFilteredResult(_0x19f7a3,_0x2227fd){return function(_0xd93c7e){if(_0xd93c7e){var _0x149a82=typeof _0x2227fd[_0x079e('0x1e')]===_0x079e('0x1f')&&typeof _0x2227fd[_0x079e('0x20')]===_0x079e('0x1f');var _0x507884=_0xd93c7e[_0x079e('0x21')];var _0x36257c=_0x149a82?0x0:_0x2227fd[_0x079e('0x1e')];var _0x48e02b=_0x149a82?_0xd93c7e[_0x079e('0x21')]:_0x2227fd[_0x079e('0x1e')]+_0x2227fd[_0x079e('0x20')];var _0x3a41d0;if(_0x48e02b>=_0x507884){_0x48e02b=_0x507884;_0x3a41d0=0xc8;}else{_0x3a41d0=0xce;}_0x19f7a3[_0x079e('0x1b')](_0x3a41d0);return _0x19f7a3[_0x079e('0x22')]('Content-Range',_0x36257c+'-'+_0x48e02b+'/'+_0x507884)[_0x079e('0x1d')](_0xd93c7e);}return null;};}function patchUpdates(_0x1b337e){return function(_0x755401){try{jsonpatch[_0x079e('0x23')](_0x755401,_0x1b337e,!![]);}catch(_0x7b3b1e){return BPromise['reject'](_0x7b3b1e);}return _0x755401['save']();};}function saveUpdates(_0x1a4c55,_0x3d9e45){return function(_0xf88bda){if(_0xf88bda){return _0xf88bda[_0x079e('0x24')](_0x1a4c55)[_0x079e('0x25')](function(_0x9f4ebe){return _0x9f4ebe;});}return null;};}function removeEntity(_0x50582b,_0x259319){return function(_0x2c672f){if(_0x2c672f){return _0x2c672f[_0x079e('0x26')]()[_0x079e('0x25')](function(){_0x50582b[_0x079e('0x1b')](0xcc)[_0x079e('0x1c')]();});}};}function handleEntityNotFound(_0x167aa0,_0x526f10){return function(_0x30a5a1){if(!_0x30a5a1){_0x167aa0[_0x079e('0x1a')](0x194);}return _0x30a5a1;};}function handleError(_0x186578,_0x356f4a){_0x356f4a=_0x356f4a||0x1f4;return function(_0x306df0){logger[_0x079e('0x27')](_0x306df0[_0x079e('0x28')]);if(_0x306df0[_0x079e('0x29')]){delete _0x306df0[_0x079e('0x29')];}_0x186578[_0x079e('0x1b')](_0x356f4a)[_0x079e('0x2a')](_0x306df0);};}exports[_0x079e('0x2b')]=function(_0xd184dc,_0x3bafa7){var _0x411d8f={},_0x59c4a0={},_0x85e397={'count':0x0,'rows':[]};var _0x350f83=_[_0x079e('0x2c')](db[_0x079e('0x2d')][_0x079e('0x2e')],function(_0x403d66){return{'name':_0x403d66[_0x079e('0x2f')],'type':_0x403d66[_0x079e('0x30')][_0x079e('0x31')]};});_0x59c4a0[_0x079e('0x32')]=_[_0x079e('0x2c')](_0x350f83,_0x079e('0x29'));_0x59c4a0[_0x079e('0x33')]=_['keys'](_0xd184dc['query']);_0x59c4a0[_0x079e('0x34')]=_[_0x079e('0x35')](_0x59c4a0[_0x079e('0x32')],_0x59c4a0[_0x079e('0x33')]);_0x411d8f['attributes']=_[_0x079e('0x35')](_0x59c4a0[_0x079e('0x32')],qs[_0x079e('0x36')](_0xd184dc['query']['fields']));_0x411d8f[_0x079e('0x37')]=_0x411d8f[_0x079e('0x37')][_0x079e('0x38')]?_0x411d8f[_0x079e('0x37')]:_0x59c4a0[_0x079e('0x32')];if(!_0xd184dc[_0x079e('0x33')][_0x079e('0x39')](_0x079e('0x3a'))){_0x411d8f[_0x079e('0x20')]=qs['limit'](_0xd184dc[_0x079e('0x33')][_0x079e('0x20')]);_0x411d8f[_0x079e('0x1e')]=qs[_0x079e('0x1e')](_0xd184dc[_0x079e('0x33')]['offset']);}_0x411d8f[_0x079e('0x3b')]=qs[_0x079e('0x3c')](_0xd184dc[_0x079e('0x33')][_0x079e('0x3c')]);_0x411d8f[_0x079e('0x3d')]=qs['filters'](_[_0x079e('0x3e')](_0xd184dc[_0x079e('0x33')],_0x59c4a0['filters']),_0x350f83);if(_0xd184dc['query'][_0x079e('0x3f')]){_0x411d8f[_0x079e('0x3d')]=_[_0x079e('0x40')](_0x411d8f[_0x079e('0x3d')],{'$or':_[_0x079e('0x2c')](_0x350f83,function(_0x73976a){if(_0x73976a[_0x079e('0x30')]!==_0x079e('0x41')){var _0x37f21c={};_0x37f21c[_0x73976a['name']]={'$like':'%'+_0xd184dc['query'][_0x079e('0x3f')]+'%'};return _0x37f21c;}})});}_0x411d8f=_['merge']({},_0x411d8f,_0xd184dc[_0x079e('0x42')]);var _0x591170={'where':_0x411d8f[_0x079e('0x3d')]};return db['UserProfile'][_0x079e('0x21')](_0x591170)['then'](function(_0x2c0359){_0x85e397[_0x079e('0x21')]=_0x2c0359;if(_0xd184dc[_0x079e('0x33')][_0x079e('0x43')]){_0x411d8f[_0x079e('0x44')]=[{'all':!![]}];}return db[_0x079e('0x2d')][_0x079e('0x45')](_0x411d8f);})[_0x079e('0x25')](function(_0x49296d){_0x85e397[_0x079e('0x46')]=_0x49296d;return _0x85e397;})['then'](respondWithFilteredResult(_0x3bafa7,_0x411d8f))[_0x079e('0x47')](handleError(_0x3bafa7,null));};exports[_0x079e('0x48')]=function(_0x31d3ed,_0x18ced3){var _0x391f8e={'raw':![],'where':{'id':_0x31d3ed[_0x079e('0x49')]['id']}},_0x186e7a={};_0x186e7a[_0x079e('0x32')]=_[_0x079e('0x4a')](db[_0x079e('0x2d')][_0x079e('0x2e')]);_0x186e7a['query']=_[_0x079e('0x4a')](_0x31d3ed[_0x079e('0x33')]);_0x186e7a[_0x079e('0x34')]=_['intersection'](_0x186e7a['model'],_0x186e7a[_0x079e('0x33')]);_0x391f8e[_0x079e('0x37')]=_['intersection'](_0x186e7a[_0x079e('0x32')],qs[_0x079e('0x36')](_0x31d3ed['query'][_0x079e('0x36')]));_0x391f8e[_0x079e('0x37')]=_0x391f8e['attributes'][_0x079e('0x38')]?_0x391f8e[_0x079e('0x37')]:_0x186e7a[_0x079e('0x32')];if(_0x31d3ed[_0x079e('0x33')][_0x079e('0x43')]){_0x391f8e['include']=[{'all':!![]}];}_0x391f8e=_[_0x079e('0x40')]({},_0x391f8e,_0x31d3ed[_0x079e('0x42')]);return db['UserProfile'][_0x079e('0x4b')](_0x391f8e)[_0x079e('0x25')](handleEntityNotFound(_0x18ced3,null))[_0x079e('0x25')](respondWithResult(_0x18ced3,null))['catch'](handleError(_0x18ced3,null));};exports['create']=function(_0x2efd05,_0x7b7dc7){return db[_0x079e('0x2d')]['create'](_0x2efd05[_0x079e('0x4c')],{})['then'](respondWithResult(_0x7b7dc7,0xc9))[_0x079e('0x47')](handleError(_0x7b7dc7,null));};exports['clone']=function(_0x5b2290,_0x35649b){var _0x4a78b3={'where':{'id':_0x5b2290['params']['id']}},_0x339423={};_0x339423[_0x079e('0x32')]=_[_0x079e('0x4a')](db[_0x079e('0x2d')][_0x079e('0x2e')]);_0x4a78b3[_0x079e('0x37')]=_['intersection'](_0x339423[_0x079e('0x32')],qs[_0x079e('0x36')](_0x5b2290[_0x079e('0x33')][_0x079e('0x36')]));_0x4a78b3['attributes']=_0x4a78b3[_0x079e('0x37')][_0x079e('0x38')]?_0x4a78b3[_0x079e('0x37')]:_0x339423[_0x079e('0x32')];if(_0x5b2290[_0x079e('0x33')][_0x079e('0x43')]){_0x4a78b3[_0x079e('0x44')]=[{'all':!![]}];}_0x4a78b3=_[_0x079e('0x40')]({},_0x4a78b3,_0x5b2290[_0x079e('0x42')]);return db[_0x079e('0x2d')]['find'](_0x4a78b3)[_0x079e('0x25')](handleEntityNotFound(_0x35649b,null))['then'](function(_0x15c877){if(_0x15c877){var _0x39ffc0=_0x15c877[_0x079e('0x4d')]({'plain':!![]});_0x39ffc0=qs[_0x079e('0x4e')](_0x39ffc0,['id',_0x079e('0x4f'),_0x079e('0x50'),'crudPermissions']);_0x5b2290[_0x079e('0x4c')]=_[_0x079e('0x4e')](_0x5b2290[_0x079e('0x4c')],['id','createdAt',_0x079e('0x50')]);return db[_0x079e('0x51')][_0x079e('0x52')](function(_0x3fe6a4){return db['UserProfile'][_0x079e('0x53')](_[_0x079e('0x40')](_0x39ffc0,_0x5b2290[_0x079e('0x4c')]),{'include':_0x5b2290[_0x079e('0x33')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x3fe6a4})[_0x079e('0x25')](function(_0x325dde){var _0x22332e=_0x325dde[_0x079e('0x4d')]({'plain':!![]});return db[_0x079e('0x54')][_0x079e('0x45')]({'where':{'userProfileId':_0x5b2290[_0x079e('0x49')]['id']},'raw':!![]})[_0x079e('0x25')](function(_0x503dcb){if(_0x503dcb){return BPromise[_0x079e('0x55')](_0x503dcb,function(_0x7acd37){return new BPromise(function(_0xc84654,_0x26ab21){if(_0x7acd37['autoAssociation']===null||_0x7acd37[_0x079e('0x56')]===0x1)_0xc84654(null);return db['UserProfileResource'][_0x079e('0x45')]({'where':{'sectionId':_0x7acd37['id']},'raw':!![]})[_0x079e('0x25')](function(_0x16f14d){var _0x59fb24=_['map'](_0x16f14d,function(_0x5b7cc3){return qs[_0x079e('0x4e')](_0x5b7cc3,['id',_0x079e('0x4f'),_0x079e('0x50'),_0x079e('0x57')]);});_0xc84654(_0x59fb24);})['catch'](function(_0x24734a){_0x26ab21(_0x24734a);});})[_0x079e('0x25')](function(_0x270d8c){var _0x3256c8=qs[_0x079e('0x4e')](_0x7acd37,['id',_0x079e('0x4f'),_0x079e('0x50')]);_0x3256c8[_0x079e('0x58')]=_0x22332e['id'];if(_0x270d8c)_0x3256c8[_0x079e('0x59')]=_0x270d8c;return _0x3256c8;})[_0x079e('0x25')](function(_0x38ed47){return db[_0x079e('0x54')]['create'](_0x38ed47,{'include':[{'model':db[_0x079e('0x5a')],'as':'Resources'}],'raw':!![],'transaction':_0x3fe6a4});});})[_0x079e('0x25')](function(){return _0x22332e;});}});});});}})[_0x079e('0x25')](respondWithResult(_0x35649b,0xc9))[_0x079e('0x47')](handleError(_0x35649b,null));};exports['update']=function(_0x47207a,_0x14f3a2){if(_0x47207a[_0x079e('0x4c')]['id']){delete _0x47207a[_0x079e('0x4c')]['id'];}return db[_0x079e('0x2d')][_0x079e('0x4b')]({'where':{'id':_0x47207a[_0x079e('0x49')]['id']}})[_0x079e('0x25')](handleEntityNotFound(_0x14f3a2,null))[_0x079e('0x25')](saveUpdates(_0x47207a[_0x079e('0x4c')],null))['then'](respondWithResult(_0x14f3a2,null))[_0x079e('0x47')](handleError(_0x14f3a2,null));};exports[_0x079e('0x26')]=function(_0x33163b,_0x58c800){return db[_0x079e('0x2d')][_0x079e('0x4b')]({'where':{'id':_0x33163b[_0x079e('0x49')]['id']}})[_0x079e('0x25')](handleEntityNotFound(_0x58c800,null))[_0x079e('0x25')](removeEntity(_0x58c800,null))['catch'](handleError(_0x58c800,null));};exports[_0x079e('0x5b')]=function(_0x1187a2,_0x2f8d81){return db['UserProfile'][_0x079e('0x5b')]()['then'](respondWithResult(_0x2f8d81,null))['catch'](handleError(_0x2f8d81,null));};exports[_0x079e('0x5c')]=function(_0x37bad8,_0x2ed349){var _0x239747=_0x37bad8[_0x079e('0x4c')];return db['UserProfile']['find']({'where':{'id':_0x37bad8[_0x079e('0x49')]['id']}})[_0x079e('0x25')](handleEntityNotFound(_0x2ed349,null))['then'](function(_0x3e2e5b){if(_0x3e2e5b){return db['sequelize'][_0x079e('0x52')](function(_0x5c9211){return db[_0x079e('0x54')][_0x079e('0x26')]({'where':{'userProfileId':_0x37bad8['params']['id'],'sectionId':_[_0x079e('0x2c')](_0x239747,function(_0x5a7a20){return _0x5a7a20['sectionId'];})},'transaction':_0x5c9211})[_0x079e('0x25')](function(){var _0x54e26b=_['map'](_0x239747,function(_0x5b0a17){_0x5b0a17['userProfileId']=_0x37bad8[_0x079e('0x49')]['id'];return _0x5b0a17;});var _0x6ffac3=[];return BPromise[_0x079e('0x55')](_0x54e26b,function(_0x431765){return db[_0x079e('0x54')][_0x079e('0x53')](_0x431765,{'include':[{'model':db[_0x079e('0x5a')],'as':_0x079e('0x59')}],'raw':!![],'transaction':_0x5c9211})['then'](function(_0x42233c){_0x6ffac3[_0x079e('0x5d')](_0x42233c[_0x079e('0x4d')]({'plain':!![]}));});})[_0x079e('0x25')](function(){return _0x6ffac3;});});});}})[_0x079e('0x25')](function(_0x3af82b){return _0x3af82b;})['then'](respondWithResult(_0x2ed349,null))['catch'](handleError(_0x2ed349,null));};exports[_0x079e('0x5e')]=function(_0x218113,_0x5d3c18){var _0x2b32b9;return db[_0x079e('0x2d')]['find']({'where':{'id':_0x218113[_0x079e('0x49')]['id']},'attributes':['id',_0x079e('0x29')]})[_0x079e('0x25')](handleEntityNotFound(_0x5d3c18,null))[_0x079e('0x25')](function(_0x4a1557){if(_0x4a1557){_0x2b32b9=_0x4a1557;return db[_0x079e('0x54')][_0x079e('0x26')]({'where':{'userProfileId':_0x218113[_0x079e('0x49')]['id'],'sectionId':_0x218113[_0x079e('0x33')]['ids']}});}})[_0x079e('0x25')](function(){return _0x2b32b9;})[_0x079e('0x25')](respondWithStatusCode(_0x5d3c18,null))['catch'](handleError(_0x5d3c18,null));};exports['getSections']=function(_0x250745,_0x13ae68){var _0x1b11c4=[];var _0x46ed63=[];return db[_0x079e('0x54')][_0x079e('0x45')]({'where':{'userProfileId':_0x250745[_0x079e('0x49')]['id']},'raw':!![]})[_0x079e('0x25')](function(_0x2ab674){_0x1b11c4=_[_0x079e('0x3f')](_0x2ab674,function(_0x148a6d){return _0x148a6d['enabled']===0x1||_['includes']([0x3eb,0x709],_0x148a6d[_0x079e('0x57')]);});if(!_[_0x079e('0x5f')](_0x1b11c4)){return _[_0x079e('0x2c')](_0x1b11c4,function(_0x4a1df9){return _0x4a1df9['sectionId'];});}else{return;}})[_0x079e('0x25')](function(_0x5d0ffb){if(_0x5d0ffb)_0x46ed63=_0x5d0ffb;if(_[_0x079e('0x60')](_0x46ed63,0x64)){var _0xa1224b=_[_0x079e('0x4b')](_0x1b11c4,{'sectionId':0x64});return hasDefaultDashboard(_0xa1224b)['then'](function(_0x5b4c36){return _[_0x079e('0x2c')](_0x1b11c4,function(_0x41df39){if(_0x41df39['sectionId']===0x64){_0x41df39[_0x079e('0x61')]=_0x5b4c36;}return _0x41df39;});});}else{return;}})[_0x079e('0x25')](function(_0x1cdce7){if(_0x1cdce7)_0x1b11c4=_0x1cdce7;if(_[_0x079e('0x60')](_0x46ed63,0x3eb)){var _0x118e21=_[_0x079e('0x4b')](_0x1b11c4,{'sectionId':0x3eb});return getCustomDashboards(_0x118e21)[_0x079e('0x25')](function(_0x480989){return _['map'](_0x1b11c4,function(_0xbb8ece){if(_0x118e21[_0x079e('0x62')]){if(_0xbb8ece[_0x079e('0x57')]===0x3eb){_0xbb8ece[_0x079e('0x61')]=_0x480989;}}else{if(_0xbb8ece[_0x079e('0x57')]===0x64){if(!_0xbb8ece[_0x079e('0x61')]){_0xbb8ece[_0x079e('0x61')]=[];}_0xbb8ece[_0x079e('0x61')]=_0xbb8ece[_0x079e('0x61')][_0x079e('0x63')](_0x480989);}}return _0xbb8ece;});});}else{return;}})[_0x079e('0x25')](function(_0x598537){if(_0x598537)_0x1b11c4=_0x598537;if(_['includes'](_0x46ed63,0x709)){var _0x310f18=_['find'](_0x1b11c4,{'sectionId':0x709});return getPlugins(_0x310f18)[_0x079e('0x25')](function(_0x3ee35c){if(_0x310f18[_0x079e('0x62')]){return _[_0x079e('0x2c')](_0x1b11c4,function(_0x2dfb3b){if(_0x2dfb3b[_0x079e('0x57')]===0x709){_0x2dfb3b[_0x079e('0x61')]=_0x3ee35c;}return _0x2dfb3b;});}else{var _0x13193a={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3ee35c};var _0x5a2d77=_['map'](_0x1b11c4);_0x5a2d77['push'](_0x13193a);return _0x5a2d77;}});}else{return;}})[_0x079e('0x25')](function(_0xe0d036){if(_0xe0d036)_0x1b11c4=_0xe0d036;return _['filter'](_0x1b11c4,['enabled',0x1]);})[_0x079e('0x25')](respondWithResult(_0x13ae68,null))[_0x079e('0x47')](handleError(_0x13ae68,null));};function hasDefaultDashboard(_0x43d246){var _0x3957e4=[0x65];return new BPromise(function(_0xbcc86e,_0x3932a8){try{if(_0x43d246['autoAssociation']){_0xbcc86e(_0x3957e4);}else{return db[_0x079e('0x5a')][_0x079e('0x64')]({'where':{'sectionId':_0x43d246['id']},'raw':!![]})[_0x079e('0x25')](function(_0x2e938a){_0x2e938a?_0xbcc86e(_0x3957e4):_0xbcc86e();});}}catch(_0x2e1f33){_0x3932a8(_0x2e1f33);}});}function getCustomDashboards(_0x556d7e){var _0x5e6d42=[];return new BPromise(function(_0x22b32c,_0x239abe){try{if(_0x556d7e['autoAssociation']){return db[_0x079e('0x65')][_0x079e('0x45')]({'raw':!![]})[_0x079e('0x25')](function(_0x47fb07){_0x47fb07[_0x079e('0x66')](function(_0x77f87c){_0x5e6d42[_0x079e('0x5d')](_0x77f87c['id']+0x1869f);});_0x22b32c(_0x5e6d42);});}else{return db['UserProfileResource'][_0x079e('0x45')]({'where':{'sectionId':_0x556d7e['id']},'raw':!![]})[_0x079e('0x25')](function(_0x18044e){_0x18044e[_0x079e('0x66')](function(_0x224c6b){_0x5e6d42[_0x079e('0x5d')](_0x224c6b['resourceId']+0x1869f);});_0x22b32c(_0x5e6d42);});}}catch(_0x4d2a88){_0x239abe(_0x4d2a88);}});}function getPlugins(_0x2237fa){var _0x231b66=[];return new BPromise(function(_0x18f6e0,_0x4b0b2c){try{if(_0x2237fa[_0x079e('0x56')]){return db[_0x079e('0x67')][_0x079e('0x45')]({'raw':!![]})[_0x079e('0x25')](function(_0x3a910c){_0x3a910c[_0x079e('0x66')](function(_0x2ea05f){_0x231b66[_0x079e('0x5d')](_0x2ea05f['id']+0x15b38);});_0x18f6e0(_0x231b66);});}else{return db[_0x079e('0x5a')][_0x079e('0x45')]({'where':{'sectionId':_0x2237fa['id']},'raw':!![]})[_0x079e('0x25')](function(_0x294cde){_0x294cde[_0x079e('0x66')](function(_0x4aa86c){_0x231b66['push'](_0x4aa86c[_0x079e('0x68')]+0x15b38);});_0x18f6e0(_0x231b66);});}}catch(_0x2c3e9f){_0x4b0b2c(_0x2c3e9f);}});}exports[_0x079e('0x69')]=function(_0x360a37,_0x5ed8b4){return db[_0x079e('0x2d')][_0x079e('0x4b')]({'where':{'id':_0x360a37['params']['id']}})[_0x079e('0x25')](handleEntityNotFound(_0x5ed8b4,null))['then'](function(_0x2e5eb6){if(_0x2e5eb6){return db[_0x079e('0x51')][_0x079e('0x52')](function(_0x180b90){return db[_0x079e('0x54')][_0x079e('0x45')]({'where':{'userProfileId':_0x360a37[_0x079e('0x49')]['id']},'attributes':['id'],'raw':!![]})[_0x079e('0x25')](function(_0x11262f){if(_0x11262f){return db[_0x079e('0x54')][_0x079e('0x26')]({'where':{'userProfileId':_0x360a37['params']['id'],'id':_['map'](_0x11262f,function(_0x24f4d9){return _0x24f4d9['id'];})},'transaction':_0x180b90});}})['then'](function(_0x12ed3e){var _0x403b07=_[_0x079e('0x2c')](_0x360a37[_0x079e('0x4c')],function(_0xc03143){_0xc03143[_0x079e('0x58')]=_0x360a37[_0x079e('0x49')]['id'];return _0xc03143;});return db[_0x079e('0x54')][_0x079e('0x6a')](_0x403b07,{'raw':!![],'transaction':_0x180b90});})[_0x079e('0x25')](function(_0x148ab7){var _0x125be2=_[_0x079e('0x3f')](_[_0x079e('0x2c')](_0x148ab7,function(_0x2443c2){return _0x2443c2[_0x079e('0x4d')]({'plain':!![]});}),{'includeAll':![]});if(_0x125be2){return db[_0x079e('0x54')]['findAll']({'where':{'userProfileId':_0x360a37[_0x079e('0x49')]['id'],'sectionId':_['map'](_0x125be2,function(_0x410839){return _0x410839[_0x079e('0x57')];})},'attributes':['id',_0x079e('0x57')],'raw':!![]})['then'](function(_0xb2cfbe){var _0x49c014=_[_0x079e('0x2c')](_0x360a37[_0x079e('0x4c')],function(_0xe2835e){_0xe2835e[_0x079e('0x58')]=_0x360a37[_0x079e('0x49')]['id'];return _0xe2835e;});return db[_0x079e('0x5a')][_0x079e('0x6a')](_0x49c014,{'raw':!![],'transaction':_0x180b90});});}})[_0x079e('0x47')](handleError(_0x5ed8b4,null));});}})[_0x079e('0x25')](function(_0x341cd5){var _0x5c72de=_[_0x079e('0x2c')](_0x341cd5,function(_0x3ed1dc){return _0x3ed1dc[_0x079e('0x4d')]({'plain':!![]});});})['then'](respondWithResult(_0x5ed8b4,null))['catch'](handleError(_0x5ed8b4,null));};exports[_0x079e('0x6b')]=function(_0x3fba70,_0x43ff67,_0x8690ae){return db[_0x079e('0x2d')][_0x079e('0x4b')]({'where':{'id':_0x3fba70[_0x079e('0x49')]['id']}})[_0x079e('0x25')](handleEntityNotFound(_0x43ff67,null))[_0x079e('0x25')](function(_0x4c2ec2){if(_0x4c2ec2){return _0x4c2ec2['removeResources'](_0x3fba70[_0x079e('0x33')]['ids']);}})['then'](respondWithStatusCode(_0x43ff67,null))[_0x079e('0x47')](handleError(_0x43ff67,null));};exports[_0x079e('0x6c')]=function(_0x3b4c8a,_0x21093f){var _0x507733={};if(!_0x3b4c8a[_0x079e('0x33')][_0x079e('0x6d')])throw new Error('Missing\x20section\x20parameter');if(!_0x3b4c8a['query'][_0x079e('0x39')](_0x079e('0x3a'))){_0x507733[_0x079e('0x20')]=qs[_0x079e('0x20')](_0x3b4c8a[_0x079e('0x33')]['limit']);_0x507733[_0x079e('0x1e')]=qs[_0x079e('0x1e')](_0x3b4c8a[_0x079e('0x33')][_0x079e('0x1e')]);}return db['UserProfile'][_0x079e('0x4b')]({'where':{'id':_0x3b4c8a[_0x079e('0x49')]['id']}})['then'](function(_0x536cbf){if(!_0x536cbf)throw new Error(_0x079e('0x6e')+_0x3b4c8a[_0x079e('0x49')]['id']);return db[_0x079e('0x2d')]['getResources'](_0x3b4c8a);})[_0x079e('0x25')](respondWithFilteredResult(_0x21093f,_0x507733))['catch'](handleError(_0x21093f,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 1fa8c46..fecbc7c 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 _0xc2a2=['../../mysqldb','UserProfile','setMaxListeners','update','remove','emit','events'];(function(_0xb99dcd,_0x1ada90){var _0x3b3b42=function(_0x4c2284){while(--_0x4c2284){_0xb99dcd['push'](_0xb99dcd['shift']());}};_0x3b3b42(++_0x1ada90);}(_0xc2a2,0x84));var _0x2c2a=function(_0x3b251c,_0xb7afa4){_0x3b251c=_0x3b251c-0x0;var _0x3cdb98=_0xc2a2[_0x3b251c];return _0x3cdb98;};'use strict';var EventEmitter=require(_0x2c2a('0x0'));var UserProfile=require(_0x2c2a('0x1'))['db'][_0x2c2a('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x2c2a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2c2a('0x4'),'afterDestroy':_0x2c2a('0x5')};function emitEvent(_0x39315d){return function(_0x5615d4,_0x3e3647,_0x42ad9b){UserProfileEvents[_0x2c2a('0x6')](_0x39315d+':'+_0x5615d4['id'],_0x5615d4);UserProfileEvents[_0x2c2a('0x6')](_0x39315d,_0x5615d4);_0x42ad9b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0xaf5a=['setMaxListeners','save','update','remove','emit','hasOwnProperty','../../mysqldb','UserProfile'];(function(_0x512661,_0x4b4012){var _0x1debde=function(_0x1ed401){while(--_0x1ed401){_0x512661['push'](_0x512661['shift']());}};_0x1debde(++_0x4b4012);}(_0xaf5a,0x116));var _0xaaf5=function(_0x4ae5d3,_0x3f65fe){_0x4ae5d3=_0x4ae5d3-0x0;var _0x38bb02=_0xaf5a[_0x4ae5d3];return _0x38bb02;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xaaf5('0x0'))['db'][_0xaaf5('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xaaf5('0x2')](0x0);var events={'afterCreate':_0xaaf5('0x3'),'afterUpdate':_0xaaf5('0x4'),'afterDestroy':_0xaaf5('0x5')};function emitEvent(_0x5c55af){return function(_0x1bdf16,_0x4ae9ed,_0x23fbd9){UserProfileEvents[_0xaaf5('0x6')](_0x5c55af+':'+_0x1bdf16['id'],_0x1bdf16);UserProfileEvents[_0xaaf5('0x6')](_0x5c55af,_0x1bdf16);_0x23fbd9(null);};}for(var e in events){if(events[_0xaaf5('0x7')](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 8db9358..ed99e91 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 _0x4bde=['inboundroutes','internalroutes','VoiceExtension','contexts','VoiceContext','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','agent','Telephones','role','telephone','VoiceQueues','queue','VoiceQueue','QueueCampaigns','outbound','musiconholds','chanspies','VoiceChanSpy','ivrcampaigns','Campaign','mailqueues','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','WhatsappAccount','teams','Team','voicequeues','users','agents','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','Disposition','customdashboards','Dashboard','intervals','Pause','scheduler','sounds','Sound','tags','Tag','templates','triggers','Trigger','trunks','Trunk','Variable','Plugin','Reports','reportId','metrics','charAt','slice','QueryTypes','select','ui.','ui.createdAt','from','user_has_','_interactions','ui.UserId\x20=\x20?','sequelize','query','define','UserProfile','user_profiles','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','UserProfileSection','find','all','union','ignore','push','autoAssociation','rawAttributes','model','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','offset','sort','where','pick','key','VIRTUAL','foreignKey','forEach','merge','includeAll','default','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','include','color','tag','ThroughTags','openTabs','true','chat','dataValues','sms','fax','openchannel','./userProfile.attributes','exports','models','filter','field','value','findAll','then','map','catch','associatedResources','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','CmContact','Lists','ListId','CmList','companies','CmCompany','globalcustomfields','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount'];(function(_0x1faaa1,_0x1568dd){var _0x994ec=function(_0x298ef4){while(--_0x298ef4){_0x1faaa1['push'](_0x1faaa1['shift']());}};_0x994ec(++_0x1568dd);}(_0x4bde,0x153));var _0xe4bd=function(_0x5770d1,_0x53fab1){_0x5770d1=_0x5770d1-0x0;var _0x593a4c=_0x4bde[_0x5770d1];return _0x593a4c;};'use strict';var _=require('lodash');var attributes=require(_0xe4bd('0x0'));var qs=require('../../components/parsers/qs');var squel=require('squel');module[_0xe4bd('0x1')]=function(_0x4baa7d){var _0x21047a=_0x4baa7d[_0xe4bd('0x2')];function _0x3583f2(_0x32a165,_0x1719da){return new Promise(function(_0x5c4c86,_0x4b3603){if(!_0x1719da)return _0x5c4c86(null);var _0x3c761b=_0x1719da[_0xe4bd('0x3')]?{[_0x1719da[_0xe4bd('0x3')][_0xe4bd('0x4')]]:_0x1719da[_0xe4bd('0x3')][_0xe4bd('0x5')]}:undefined;return _0x21047a[_0x32a165][_0xe4bd('0x6')]({'where':_0x3c761b,'raw':!![]})[_0xe4bd('0x7')](function(_0x365dbe){_0x1719da['associatedResources']=_[_0xe4bd('0x8')](_0x365dbe,'id');_0x5c4c86(_0x1719da);})[_0xe4bd('0x9')](function(_0x58818f){_0x4b3603(_0x58818f);});});}function _0x19a7d9(_0x3652c3,_0x4fbcb6){return new Promise(function(_0x97ed75,_0x188d2e){var _0x341410=_0x3652c3[_0xe4bd('0x3')]?{[_0x3652c3[_0xe4bd('0x3')][_0xe4bd('0x4')]]:_0x3652c3[_0xe4bd('0x3')][_0xe4bd('0x5')]}:undefined;return _0x21047a[_0x3652c3['model']][_0xe4bd('0x6')]({'where':_0x341410,'raw':!![]})[_0xe4bd('0x7')](function(_0x1bbd4c){_0x4fbcb6[_0xe4bd('0xa')]=_[_0xe4bd('0x8')](_0x1bbd4c,function(_0x51d7b2){return _0x51d7b2[_0xe4bd('0xb')];});_0x97ed75(_0x4fbcb6);})[_0xe4bd('0x9')](function(_0x1d560a){_0x188d2e(_0x1d560a);});});}function _0xa0e03(_0x46beed,_0x3bf6df,_0x4fbdf8){if(!_0x3bf6df)return Promise[_0xe4bd('0xc')](null);return new Promise(function(_0x4b444c,_0x148c2e){return _0x21047a[_0xe4bd('0xd')][_0xe4bd('0x6')]({'where':{'sectionId':_0x3bf6df['id']},'raw':!![]})[_0xe4bd('0x7')](function(_0x14b2e8){if(_0x46beed[_0xe4bd('0x4')]&&_0x46beed[_0xe4bd('0x4')]!=='id'){_0x3bf6df[_0xe4bd('0xa')]=_[_0xe4bd('0x8')](_0x14b2e8,function(_0x23f8c2){return _0x23f8c2[_0x46beed[_0xe4bd('0x4')]];});}else{if(_0x4fbdf8===_0xe4bd('0xe')){_0x3bf6df[_0xe4bd('0xa')]=_['map'](_0x14b2e8,function(_0x590ab3){return{'id':_0x590ab3[_0xe4bd('0xf')],'type':_0x590ab3[_0xe4bd('0x10')]};});}else{_0x3bf6df[_0xe4bd('0xa')]=_[_0xe4bd('0x8')](_0x14b2e8,function(_0x20bb33){return _0x20bb33[_0xe4bd('0xf')];});}}_0x4b444c(_0x3bf6df);})[_0xe4bd('0x9')](function(_0x4ee215){_0x148c2e(_0x4ee215);});});}function _0x2a9b11(_0x1b2323,_0x3a9620){var _0x5d9454={'parentSections':[]};switch(_0x1b2323[_0xe4bd('0x11')]()){case _0xe4bd('0x12'):_0x5d9454[_0xe4bd('0x13')]=_0xe4bd('0x14');break;case _0xe4bd('0x15'):_0x5d9454['childModel']=_0xe4bd('0x16');break;case _0xe4bd('0x17'):_0x5d9454[_0xe4bd('0x13')]=_0xe4bd('0x18');_0x5d9454[_0xe4bd('0x19')]=[{'name':_0xe4bd('0x1a'),'field':'name','foreignKey':_0xe4bd('0x1b')}];break;case _0xe4bd('0x1c'):_0x5d9454[_0xe4bd('0x13')]=_0xe4bd('0x1d');break;case'contacts':_0x5d9454[_0xe4bd('0x13')]=_0xe4bd('0x1e');_0x5d9454[_0xe4bd('0x19')]=[{'name':_0xe4bd('0x1f'),'field':'id','foreignKey':_0xe4bd('0x20')}];break;case'lists':_0x5d9454[_0xe4bd('0x13')]=_0xe4bd('0x21');break;case _0xe4bd('0x22'):_0x5d9454['childModel']=_0xe4bd('0x23');break;case _0xe4bd('0x24'):_0x5d9454['childModel']='CmCustomField';break;case _0xe4bd('0x25'):_0x5d9454[_0xe4bd('0x13')]=_0xe4bd('0x26');break;case _0xe4bd('0x27'):_0x5d9454[_0xe4bd('0x13')]=_0xe4bd('0x28');break;case _0xe4bd('0x29'):_0x5d9454['childModel']=_0xe4bd('0x2a');break;case _0xe4bd('0x2b'):_0x5d9454[_0xe4bd('0x13')]=_0xe4bd('0x2c');break;case _0xe4bd('0x2d'):case _0xe4bd('0x2e'):case'outboundroutes':_0x5d9454[_0xe4bd('0x13')]=_0xe4bd('0x2f');break;case _0xe4bd('0x30'):_0x5d9454[_0xe4bd('0x13')]=_0xe4bd('0x31');break;case'voicemails':_0x5d9454['childModel']=_0xe4bd('0x32');break;case _0xe4bd('0x33'):_0x5d9454[_0xe4bd('0x13')]=_0xe4bd('0x34');_0x5d9454[_0xe4bd('0x19')]=[{'name':_0xe4bd('0x35'),'field':_0xe4bd('0xb'),'foreignKey':_0xe4bd('0x36'),'model':_0xe4bd('0x37'),'filter':{'field':'role','value':[_0xe4bd('0x38')]}},{'name':_0xe4bd('0x39'),'field':_0xe4bd('0xb'),'foreignKey':'membername','model':_0xe4bd('0x37'),'filter':{'field':_0xe4bd('0x3a'),'value':[_0xe4bd('0x3b')]}},{'name':_0xe4bd('0x3c'),'field':'name','foreignKey':_0xe4bd('0x3d'),'model':_0xe4bd('0x3e'),'filter':{'field':_0xe4bd('0x10'),'value':['inbound']}},{'name':_0xe4bd('0x3f'),'field':_0xe4bd('0xb'),'foreignKey':'queue','model':_0xe4bd('0x3e'),'filter':{'field':'type','value':[_0xe4bd('0x40')]}}];break;case _0xe4bd('0x41'):_0x5d9454[_0xe4bd('0x13')]='VoiceMusicOnHold';break;case _0xe4bd('0x42'):_0x5d9454[_0xe4bd('0x13')]=_0xe4bd('0x43');break;case'voiceprefixes':_0x5d9454[_0xe4bd('0x13')]='VoicePrefix';break;case _0xe4bd('0x44'):_0x5d9454['childModel']=_0xe4bd('0x45');break;case _0xe4bd('0x46'):_0x5d9454[_0xe4bd('0x13')]='MailQueue';break;case _0xe4bd('0x47'):_0x5d9454[_0xe4bd('0x13')]=_0xe4bd('0x48');break;case _0xe4bd('0x49'):_0x5d9454['childModel']=_0xe4bd('0x4a');break;case'openchannelqueues':_0x5d9454[_0xe4bd('0x13')]=_0xe4bd('0x4b');break;case _0xe4bd('0x4c'):_0x5d9454[_0xe4bd('0x13')]=_0xe4bd('0x4d');break;case'smsqueues':_0x5d9454[_0xe4bd('0x13')]='SmsQueue';break;case _0xe4bd('0x4e'):_0x5d9454[_0xe4bd('0x13')]=_0xe4bd('0x4f');break;case _0xe4bd('0x50'):_0x5d9454[_0xe4bd('0x13')]=_0xe4bd('0x51');break;case'whatsappaccounts':_0x5d9454[_0xe4bd('0x13')]=_0xe4bd('0x52');break;case _0xe4bd('0x53'):_0x5d9454[_0xe4bd('0x13')]=_0xe4bd('0x54');break;case _0xe4bd('0x55'):case'queuecampaigns':_0x5d9454['childModel']=_0xe4bd('0x3e');if(_0x3a9620){_0x5d9454[_0xe4bd('0x19')]=[{'name':_0xe4bd('0x3c')},{'name':_0xe4bd('0x3f')}];}break;case _0xe4bd('0x56'):case _0xe4bd('0x57'):case'telephones':_0x5d9454[_0xe4bd('0x13')]=_0xe4bd('0x37');if(_0x3a9620){_0x5d9454['parentSections']=[{'name':_0xe4bd('0x58'),'filter':{'field':_0xe4bd('0x3a'),'value':[_0xe4bd('0x59'),_0xe4bd('0x5a')]},'ignore':!![]},{'name':_0xe4bd('0x35')},{'name':_0xe4bd('0x39')}];}break;case _0xe4bd('0x5b'):_0x5d9454[_0xe4bd('0x13')]=_0xe4bd('0x5c');break;case _0xe4bd('0x5d'):_0x5d9454[_0xe4bd('0x13')]=_0xe4bd('0x5e');break;case _0xe4bd('0x5f'):_0x5d9454['childModel']=_0xe4bd('0x60');break;case _0xe4bd('0x61'):_0x5d9454[_0xe4bd('0x13')]=_0xe4bd('0x62');break;case'deskaccounts':_0x5d9454['childModel']=_0xe4bd('0x63');break;case'zohoaccounts':_0x5d9454[_0xe4bd('0x13')]=_0xe4bd('0x64');break;case _0xe4bd('0x65'):_0x5d9454['childModel']='User';break;case _0xe4bd('0x66'):_0x5d9454[_0xe4bd('0x13')]=_0xe4bd('0x67');break;case'dispositions':_0x5d9454[_0xe4bd('0x13')]=_0xe4bd('0x68');break;case _0xe4bd('0x69'):_0x5d9454[_0xe4bd('0x13')]=_0xe4bd('0x6a');break;case _0xe4bd('0x6b'):_0x5d9454['childModel']='Interval';break;case'pauses':_0x5d9454[_0xe4bd('0x13')]=_0xe4bd('0x6c');break;case _0xe4bd('0x6d'):_0x5d9454[_0xe4bd('0x13')]='Schedule';break;case _0xe4bd('0x6e'):_0x5d9454[_0xe4bd('0x13')]=_0xe4bd('0x6f');break;case _0xe4bd('0x70'):_0x5d9454[_0xe4bd('0x13')]=_0xe4bd('0x71');break;case _0xe4bd('0x72'):_0x5d9454[_0xe4bd('0x13')]='Template';break;case _0xe4bd('0x73'):_0x5d9454['childModel']=_0xe4bd('0x74');break;case _0xe4bd('0x75'):_0x5d9454[_0xe4bd('0x13')]=_0xe4bd('0x76');break;case'variables':_0x5d9454['childModel']=_0xe4bd('0x77');break;case'plugins':_0x5d9454['childModel']=_0xe4bd('0x78');break;case'extractedreports':_0x5d9454[_0xe4bd('0x13')]=_0xe4bd('0xe');_0x5d9454[_0xe4bd('0x19')]=[{'name':_0xe4bd('0x79'),'field':'id','foreignKey':_0xe4bd('0x7a')}];break;case _0xe4bd('0x7b'):_0x5d9454[_0xe4bd('0x13')]='AnalyticMetric';break;}return _0x5d9454;}function _0x863230(_0x4abdb4,_0x125f5f){var _0x6b6910=_0x4abdb4[_0xe4bd('0x7c')](0x0)['toUpperCase']()+_0x4abdb4[_0xe4bd('0x7d')](0x1);var _0x5f4645={'type':_0x21047a['Sequelize'][_0xe4bd('0x7e')]['SELECT'],'raw':!![]};return new Promise(function(_0x2a3e53,_0x308a9e){var _0xf454=squel[_0xe4bd('0x7f')]()[_0xe4bd('0x4')](_0xe4bd('0x80')+_0x6b6910+'InteractionId','id')[_0xe4bd('0x4')](_0xe4bd('0x81'))[_0xe4bd('0x82')](_0xe4bd('0x83')+_0x4abdb4+_0xe4bd('0x84'),'ui')['where'](_0xe4bd('0x85'),_0x125f5f['id']);return _0x21047a[_0xe4bd('0x86')][_0xe4bd('0x87')](_0xf454['toString'](),_0x5f4645)['then'](function(_0x59df02){_0x125f5f[_0x6b6910+'OpenTabs']=_0x59df02;_0x2a3e53(_0x59df02);})[_0xe4bd('0x9')](function(_0xc511c2){_0x308a9e(_0xc511c2);});});}return _0x4baa7d[_0xe4bd('0x88')](_0xe4bd('0x89'),attributes,{'tableName':_0xe4bd('0x8a'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x17f3cc){var _0x86e42={'raw':_0x17f3cc[_0xe4bd('0x87')][_0xe4bd('0x8b')],'where':{}};var _0x5e06df={};var _0x3a4bc9={'count':0x0,'rows':[]};var _0xc8416e=_0x17f3cc[_0xe4bd('0x87')][_0xe4bd('0x8c')];var _0x2b23d0=_0x17f3cc[_0xe4bd('0x87')][_0xe4bd('0x8d')]||![];var _0x12cda1=_0x2a9b11(_0xc8416e,_0x2b23d0);if(!_0x12cda1[_0xe4bd('0x13')])throw new Error(_0xe4bd('0x8e')+_0xc8416e+'\x27');var _0xfb50c6=[{'name':_0xc8416e}];if(!_[_0xe4bd('0x8f')](_0x12cda1[_0xe4bd('0x19')]))_0xfb50c6=_0x12cda1[_0xe4bd('0x19')];var _0x50a4c4=[];for(var _0x440059=0x0;_0x440059<_0xfb50c6[_0xe4bd('0x90')];_0x440059++){_0x50a4c4['push'](_0x21047a[_0xe4bd('0x91')][_0xe4bd('0x92')]({'where':{'userProfileId':_0x17f3cc['params']['id'],'name':_0xfb50c6[_0x440059][_0xe4bd('0xb')]},'raw':!![]}));}return Promise[_0xe4bd('0x93')](_0x50a4c4)[_0xe4bd('0x7')](function(_0x7ae2a9){var _0x508ee5=_[_0xe4bd('0x3')](_0x7ae2a9,function(_0x36ced6){return _0x36ced6?_0x36ced6:undefined;});var _0x2c2660=_[_0xe4bd('0x3')](_0xfb50c6,['ignore',!![]]);var _0x86d2dd=_[_0xe4bd('0x8f')](_0x508ee5)&&_[_0xe4bd('0x8f')](_0x2c2660)?null:_[_0xe4bd('0x94')](_0x2c2660,_0x508ee5);if(!_0x86d2dd)return null;var _0x1aa720=[];for(var _0x4a14fd=0x0;_0x4a14fd<_0x86d2dd['length'];_0x4a14fd++){var _0x20f2ea=_[_0xe4bd('0x92')](_0xfb50c6,function(_0x339576){return _0x86d2dd[_0x4a14fd]?_0x339576[_0xe4bd('0xb')]===_0x86d2dd[_0x4a14fd][_0xe4bd('0xb')]:null;});if(_0x20f2ea){if(_0x86d2dd[_0x4a14fd][_0xe4bd('0x95')]){_0x1aa720[_0xe4bd('0x96')](_0x3583f2(_0x12cda1[_0xe4bd('0x13')],_0x86d2dd[_0x4a14fd]));}else{if(!_0x86d2dd[_0x4a14fd][_0xe4bd('0x97')]){_0x1aa720[_0xe4bd('0x96')](_0xa0e03(_0x20f2ea,_0x86d2dd[_0x4a14fd],_0x12cda1['childModel']));}else{if(_0x20f2ea['model']){_0x1aa720[_0xe4bd('0x96')](_0x19a7d9(_0x20f2ea,_0x86d2dd[_0x4a14fd]));}}}}}return Promise['all'](_0x1aa720);})[_0xe4bd('0x7')](function(_0x4c8f9a){var _0x2302e0=_0x4c8f9a;var _0x406fa5=null;if(_0x2302e0){_0x406fa5=_0x2302e0[_0xe4bd('0x90')]===0x1?_0x2302e0[0x0]:null;}if(!_0x406fa5&&!_0x2302e0)return _0x3a4bc9;var _0x31b443=_0x21047a[_0x12cda1[_0xe4bd('0x13')]][_0xe4bd('0x98')];_0x5e06df[_0xe4bd('0x99')]=_[_0xe4bd('0x9a')](_0x31b443);_0x5e06df[_0xe4bd('0x87')]=_[_0xe4bd('0x9a')](_0x17f3cc['query']);_0x5e06df[_0xe4bd('0x9b')]=_['intersection'](_0x5e06df[_0xe4bd('0x99')],_0x5e06df['query']);_0x86e42[_0xe4bd('0x9c')]=_[_0xe4bd('0x9d')](_0x5e06df[_0xe4bd('0x99')],qs[_0xe4bd('0x9e')](_0x17f3cc[_0xe4bd('0x87')][_0xe4bd('0x9e')]));_0x86e42['attributes']=_0x86e42['attributes'][_0xe4bd('0x90')]?_0x86e42[_0xe4bd('0x9c')]:_0x5e06df[_0xe4bd('0x99')];if(!_0x17f3cc[_0xe4bd('0x87')][_0xe4bd('0x9f')](_0xe4bd('0xa0'))){_0x86e42[_0xe4bd('0xa1')]=qs[_0xe4bd('0xa1')](_0x17f3cc['query'][_0xe4bd('0xa1')]);_0x86e42[_0xe4bd('0xa2')]=qs[_0xe4bd('0xa2')](_0x17f3cc['query']['offset']);}_0x86e42['order']=qs[_0xe4bd('0xa3')](_0x17f3cc['query'][_0xe4bd('0xa3')]);_0x86e42[_0xe4bd('0xa4')]=qs['filters'](_[_0xe4bd('0xa5')](_0x17f3cc['query'],_0x5e06df[_0xe4bd('0x9b')]));if(_0x17f3cc['query']['filter']){_0x86e42[_0xe4bd('0xa4')]=_['merge'](_0x86e42[_0xe4bd('0xa4')],{'$or':_[_0xe4bd('0x8')](_0x31b443,function(_0x81b46d){if(_0x81b46d['type'][_0xe4bd('0xa6')]!==_0xe4bd('0xa7')){var _0x4ec337={};_0x4ec337[_0x81b46d[_0xe4bd('0x4')]]={'$like':'%'+_0x17f3cc[_0xe4bd('0x87')][_0xe4bd('0x3')]+'%'};return _0x4ec337;}})});}var _0x2e67a0=[];var _0x596c81=null;var _0x5cd5bf={};if(_0x406fa5){_0x596c81=_[_0xe4bd('0x92')](_0xfb50c6,[_0xe4bd('0xb'),_0x406fa5['name']]);if(_0x596c81[_0xe4bd('0x4')]){_0x5cd5bf={};if(_0x12cda1[_0xe4bd('0x13')]===_0xe4bd('0xe')){_0x5cd5bf[_0x596c81[_0xe4bd('0xa8')]]=_[_0xe4bd('0x8')](_0x406fa5['associatedResources'],'id');}else{_0x5cd5bf[_0x596c81[_0xe4bd('0xa8')]]=_0x406fa5['associatedResources'];}_0x2e67a0[_0xe4bd('0x96')](_0x5cd5bf);}else{_0x86e42['where']['id']=_0x406fa5[_0xe4bd('0xa')];}}else{for(var _0x27a65b=0x0;_0x27a65b<_0x2302e0['length'];_0x27a65b++){_0x596c81=_['find'](_0xfb50c6,[_0xe4bd('0xb'),_0x2302e0[_0x27a65b][_0xe4bd('0xb')]]);if(_0x596c81[_0xe4bd('0x4')]){_0x5cd5bf={};_0x5cd5bf[_0x596c81[_0xe4bd('0xa8')]]=_0x2302e0[_0x27a65b]['associatedResources'];_0x2e67a0[_0xe4bd('0x96')](_0x5cd5bf);}else{if(!_0x86e42['where']['id'])_0x86e42[_0xe4bd('0xa4')]['id']=[];_0x2302e0[_0x27a65b]['associatedResources'][_0xe4bd('0xa9')](function(_0x539b15){_0x86e42[_0xe4bd('0xa4')]['id'][_0xe4bd('0x96')](_0x539b15);});}}}if(!_[_0xe4bd('0x8f')](_0x2e67a0)){_0x86e42[_0xe4bd('0xa4')]=_[_0xe4bd('0xaa')](_0x86e42['where'],{'$and':{'$or':_0x2e67a0}});}_0x86e42=_[_0xe4bd('0xaa')]({},_0x86e42,_0x17f3cc['options']);if(_0x406fa5&&!_0x406fa5[_0xe4bd('0x97')]&&_0x12cda1[_0xe4bd('0x13')]===_0xe4bd('0xe')){if(_0x17f3cc[_0xe4bd('0x87')][_0xe4bd('0xab')]){_0x86e42['include']=[{'all':!![]}];}return _0x21047a[_0x12cda1[_0xe4bd('0x13')]][_0xe4bd('0x6')](_0x86e42)['then'](function(_0x29099e){var _0x41037d=[];_0x29099e[_0xe4bd('0xa9')](function(_0x386bea){var _0x111b3e;switch(_0x386bea['reportType']){case _0xe4bd('0xac'):_0x111b3e=_[_0xe4bd('0x92')](_0x406fa5[_0xe4bd('0xa')],function(_0x493c9b){return _0x493c9b['id']===_0x386bea[_0xe4bd('0x7a')]&&_0x493c9b[_0xe4bd('0x10')]===_0xe4bd('0xad');});break;case _0xe4bd('0xae'):_0x111b3e=_[_0xe4bd('0x92')](_0x406fa5[_0xe4bd('0xa')],function(_0x50d836){return _0x50d836['id']===_0x386bea[_0xe4bd('0x7a')]&&_0x50d836[_0xe4bd('0x10')]===_0xe4bd('0xaf');});break;}if(_0x111b3e)_0x41037d[_0xe4bd('0x96')](_0x386bea);});_0x3a4bc9[_0xe4bd('0xb0')]=_0x41037d[_0xe4bd('0x90')];_0x3a4bc9[_0xe4bd('0xb1')]=_0x41037d;return _0x3a4bc9;});}else{if(!_[_0xe4bd('0x8f')](_0x17f3cc[_0xe4bd('0x87')][_0xe4bd('0xb2')])){_0x86e42[_0xe4bd('0xa4')]['id']=_0x86e42[_0xe4bd('0xa4')]['id']?_[_0xe4bd('0x9d')](_0x86e42[_0xe4bd('0xa4')]['id'],_0x17f3cc[_0xe4bd('0x87')][_0xe4bd('0xb2')]):_0x17f3cc[_0xe4bd('0x87')][_0xe4bd('0xb2')];if(_0x17f3cc[_0xe4bd('0x87')][_0xe4bd('0xb3')]){_0x86e42['order']=_0x17f3cc['query'][_0xe4bd('0xb3')];}}if(_0x17f3cc[_0xe4bd('0x87')][_0xe4bd('0xb4')]){_0x86e42[_0xe4bd('0xa4')]=_[_0xe4bd('0xaa')](_0x86e42['where'],{'$and':_0x17f3cc[_0xe4bd('0x87')]['extraQueryConditions']});}return _0x21047a[_0x12cda1[_0xe4bd('0x13')]]['count']({'where':_0x86e42[_0xe4bd('0xa4')]})[_0xe4bd('0x7')](function(_0x52e799){_0x3a4bc9[_0xe4bd('0xb0')]=_0x52e799;if(_0x17f3cc[_0xe4bd('0x87')][_0xe4bd('0xab')]){if(_0x12cda1['childModel']===_0xe4bd('0x1e')){_0x86e42[_0xe4bd('0xb5')]=[{'model':_0x21047a[_0xe4bd('0x71')],'as':'Tags','attributes':['id','name',_0xe4bd('0xb6')],'required':_0x17f3cc[_0xe4bd('0x87')][_0xe4bd('0xb7')]?!![]:![]},{'model':_0x21047a[_0xe4bd('0x71')],'as':_0xe4bd('0xb8'),'attributes':['id',_0xe4bd('0xb'),_0xe4bd('0xb6')],'through':_0x17f3cc[_0xe4bd('0x87')][_0xe4bd('0xb7')]?{'attributes':[],'where':{'TagId':_0x17f3cc[_0xe4bd('0x87')][_0xe4bd('0xb7')]||undefined}}:{},'required':_0x17f3cc['query'][_0xe4bd('0xb7')]?!![]:![]}];}else{_0x86e42[_0xe4bd('0xb5')]=[{'all':!![]}];}}return _0x21047a[_0x12cda1[_0xe4bd('0x13')]][_0xe4bd('0x6')](_0x86e42);})[_0xe4bd('0x7')](function(_0x1ecc3a){_0x3a4bc9[_0xe4bd('0xb1')]=_0x1ecc3a;if(_0xc8416e===_0xe4bd('0x35')&&_0x17f3cc[_0xe4bd('0x87')][_0xe4bd('0xb9')]===_0xe4bd('0xba')){var _0x35fc09=[];for(var _0x251760=0x0;_0x251760<_0x3a4bc9[_0xe4bd('0xb1')][_0xe4bd('0x90')];_0x251760++){_0x35fc09[_0xe4bd('0x96')](_0x863230(_0xe4bd('0xbb'),_0x3a4bc9[_0xe4bd('0xb1')][_0x251760][_0xe4bd('0xbc')]));_0x35fc09['push'](_0x863230(_0xe4bd('0xbd'),_0x3a4bc9[_0xe4bd('0xb1')][_0x251760][_0xe4bd('0xbc')]));_0x35fc09[_0xe4bd('0x96')](_0x863230(_0xe4bd('0xbe'),_0x3a4bc9['rows'][_0x251760][_0xe4bd('0xbc')]));_0x35fc09[_0xe4bd('0x96')](_0x863230('mail',_0x3a4bc9[_0xe4bd('0xb1')][_0x251760][_0xe4bd('0xbc')]));_0x35fc09[_0xe4bd('0x96')](_0x863230(_0xe4bd('0xbf'),_0x3a4bc9[_0xe4bd('0xb1')][_0x251760]['dataValues']));_0x35fc09[_0xe4bd('0x96')](_0x863230('whatsapp',_0x3a4bc9[_0xe4bd('0xb1')][_0x251760][_0xe4bd('0xbc')]));}return Promise[_0xe4bd('0x93')](_0x35fc09)[_0xe4bd('0x7')](function(){return _0x3a4bc9;});}return _0x3a4bc9;});}});}}});}; \ No newline at end of file +var _0x3a02=['OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','voicequeues','queuecampaigns','users','agents','telephones','role','admin','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','intervals','Interval','pauses','scheduler','sounds','Sound','tags','Tag','Template','triggers','Trigger','trunks','Trunk','Variable','Plugin','extractedreports','AnalyticExtractedReport','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','SELECT','select','ui.','from','user_has_','_interactions','where','sequelize','toString','OpenTabs','define','UserProfile','query','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','UserProfileSection','find','params','ignore','union','length','autoAssociation','push','all','rawAttributes','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','pick','key','foreignKey','forEach','merge','includeAll','include','reportType','DefaultReports','CustomReports','rows','ids','customSorting','count','Tags','color','ThroughTags','tag','openTabs','true','sms','dataValues','fax','mail','openchannel','whatsapp','./userProfile.attributes','squel','exports','models','filter','field','value','findAll','associatedResources','map','catch','model','then','name','resolve','UserProfileResource','resourceId','toLowerCase','squareprojects','SquareProject','odbc','childModel','SquareOdbc','squarerecordings','SquareRecording','parentSections','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','CmCustomField','chatqueues','ChatQueue','FaxQueue','faxaccounts','FaxAccount','inboundroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','membername','agent','Telephones','User','VoiceQueues','queue','VoiceQueue','type','inbound','VoiceMusicOnHold','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailsubstatuses','MailSubstatus','openchannelqueues'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x3a02,0x7d));var _0x23a0=function(_0x51525a,_0x21c5e4){_0x51525a=_0x51525a-0x0;var _0x1503c8=_0x3a02[_0x51525a];return _0x1503c8;};'use strict';var _=require('lodash');var attributes=require(_0x23a0('0x0'));var qs=require('../../components/parsers/qs');var squel=require(_0x23a0('0x1'));module[_0x23a0('0x2')]=function(_0x3a1532){var _0x1cdc50=_0x3a1532[_0x23a0('0x3')];function _0x667c05(_0xa95e67,_0x496d38){return new Promise(function(_0x2a831b,_0x484302){if(!_0x496d38)return _0x2a831b(null);var _0x2c2269=_0x496d38[_0x23a0('0x4')]?{[_0x496d38[_0x23a0('0x4')][_0x23a0('0x5')]]:_0x496d38[_0x23a0('0x4')][_0x23a0('0x6')]}:undefined;return _0x1cdc50[_0xa95e67][_0x23a0('0x7')]({'where':_0x2c2269,'raw':!![]})['then'](function(_0x3cb070){_0x496d38[_0x23a0('0x8')]=_[_0x23a0('0x9')](_0x3cb070,'id');_0x2a831b(_0x496d38);})[_0x23a0('0xa')](function(_0x18ca27){_0x484302(_0x18ca27);});});}function _0x41abca(_0x1c31c3,_0x582a3c){return new Promise(function(_0x2b6171,_0x19b444){var _0x398464=_0x1c31c3[_0x23a0('0x4')]?{[_0x1c31c3[_0x23a0('0x4')]['field']]:_0x1c31c3[_0x23a0('0x4')][_0x23a0('0x6')]}:undefined;return _0x1cdc50[_0x1c31c3[_0x23a0('0xb')]]['findAll']({'where':_0x398464,'raw':!![]})[_0x23a0('0xc')](function(_0x17551d){_0x582a3c[_0x23a0('0x8')]=_[_0x23a0('0x9')](_0x17551d,function(_0xaa6e2f){return _0xaa6e2f[_0x23a0('0xd')];});_0x2b6171(_0x582a3c);})[_0x23a0('0xa')](function(_0x264589){_0x19b444(_0x264589);});});}function _0x572582(_0x28dd96,_0x4a08be,_0x47e6bf){if(!_0x4a08be)return Promise[_0x23a0('0xe')](null);return new Promise(function(_0x4c13dc,_0x5ca432){return _0x1cdc50[_0x23a0('0xf')][_0x23a0('0x7')]({'where':{'sectionId':_0x4a08be['id']},'raw':!![]})['then'](function(_0x4e8d7a){if(_0x28dd96['field']&&_0x28dd96[_0x23a0('0x5')]!=='id'){_0x4a08be[_0x23a0('0x8')]=_[_0x23a0('0x9')](_0x4e8d7a,function(_0x43258b){return _0x43258b[_0x28dd96[_0x23a0('0x5')]];});}else{if(_0x47e6bf==='AnalyticExtractedReport'){_0x4a08be[_0x23a0('0x8')]=_[_0x23a0('0x9')](_0x4e8d7a,function(_0x563ed3){return{'id':_0x563ed3[_0x23a0('0x10')],'type':_0x563ed3['type']};});}else{_0x4a08be[_0x23a0('0x8')]=_[_0x23a0('0x9')](_0x4e8d7a,function(_0x267281){return _0x267281[_0x23a0('0x10')];});}}_0x4c13dc(_0x4a08be);})[_0x23a0('0xa')](function(_0x4386e2){_0x5ca432(_0x4386e2);});});}function _0x502f86(_0x48e52a,_0x5c768f){var _0x4deffe={'parentSections':[]};switch(_0x48e52a[_0x23a0('0x11')]()){case _0x23a0('0x12'):_0x4deffe['childModel']=_0x23a0('0x13');break;case _0x23a0('0x14'):_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x16');break;case _0x23a0('0x17'):_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x18');_0x4deffe[_0x23a0('0x19')]=[{'name':'SquareProjects','field':_0x23a0('0xd'),'foreignKey':'projectName'}];break;case _0x23a0('0x1a'):_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x1b');break;case _0x23a0('0x1c'):_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x1d');_0x4deffe[_0x23a0('0x19')]=[{'name':_0x23a0('0x1e'),'field':'id','foreignKey':_0x23a0('0x1f')}];break;case _0x23a0('0x20'):_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x21');break;case _0x23a0('0x22'):_0x4deffe['childModel']=_0x23a0('0x23');break;case'globalcustomfields':_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x24');break;case _0x23a0('0x25'):_0x4deffe['childModel']=_0x23a0('0x26');break;case'chatwebsites':_0x4deffe[_0x23a0('0x15')]='ChatWebsite';break;case'faxqueues':_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x27');break;case _0x23a0('0x28'):_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x29');break;case _0x23a0('0x2a'):case'internalroutes':case _0x23a0('0x2b'):_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x2c');break;case _0x23a0('0x2d'):_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x2e');break;case _0x23a0('0x2f'):_0x4deffe['childModel']='VoiceMail';break;case _0x23a0('0x30'):_0x4deffe['childModel']=_0x23a0('0x31');_0x4deffe[_0x23a0('0x19')]=[{'name':_0x23a0('0x32'),'field':_0x23a0('0xd'),'foreignKey':_0x23a0('0x33'),'model':'User','filter':{'field':'role','value':[_0x23a0('0x34')]}},{'name':_0x23a0('0x35'),'field':_0x23a0('0xd'),'foreignKey':_0x23a0('0x33'),'model':_0x23a0('0x36'),'filter':{'field':'role','value':['telephone']}},{'name':_0x23a0('0x37'),'field':_0x23a0('0xd'),'foreignKey':_0x23a0('0x38'),'model':_0x23a0('0x39'),'filter':{'field':_0x23a0('0x3a'),'value':[_0x23a0('0x3b')]}},{'name':'QueueCampaigns','field':_0x23a0('0xd'),'foreignKey':_0x23a0('0x38'),'model':_0x23a0('0x39'),'filter':{'field':_0x23a0('0x3a'),'value':['outbound']}}];break;case'musiconholds':_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x3c');break;case'chanspies':_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x3d');break;case'voiceprefixes':_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x3e');break;case _0x23a0('0x3f'):_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x40');break;case _0x23a0('0x41'):_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x42');break;case'mailaccounts':_0x4deffe['childModel']='MailAccount';break;case _0x23a0('0x43'):_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x44');break;case _0x23a0('0x45'):_0x4deffe['childModel']=_0x23a0('0x46');break;case _0x23a0('0x47'):_0x4deffe['childModel']=_0x23a0('0x48');break;case _0x23a0('0x49'):_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x4a');break;case _0x23a0('0x4b'):_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x4c');break;case _0x23a0('0x4d'):_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x4e');break;case _0x23a0('0x4f'):_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x50');break;case _0x23a0('0x51'):_0x4deffe[_0x23a0('0x15')]='Team';break;case _0x23a0('0x52'):case _0x23a0('0x53'):_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x39');if(_0x5c768f){_0x4deffe[_0x23a0('0x19')]=[{'name':_0x23a0('0x37')},{'name':'QueueCampaigns'}];}break;case _0x23a0('0x54'):case _0x23a0('0x55'):case _0x23a0('0x56'):_0x4deffe[_0x23a0('0x15')]='User';if(_0x5c768f){_0x4deffe[_0x23a0('0x19')]=[{'name':'Users','filter':{'field':_0x23a0('0x57'),'value':[_0x23a0('0x58'),'user']},'ignore':!![]},{'name':_0x23a0('0x32')},{'name':'Telephones'}];}break;case _0x23a0('0x59'):_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x5a');break;case _0x23a0('0x5b'):_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x5c');break;case _0x23a0('0x5d'):_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x5e');break;case'sugarcrmaccounts':_0x4deffe['childModel']=_0x23a0('0x5f');break;case _0x23a0('0x60'):_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x61');break;case _0x23a0('0x62'):_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x63');break;case _0x23a0('0x64'):_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x36');break;case _0x23a0('0x65'):_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x66');break;case _0x23a0('0x67'):_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x68');break;case _0x23a0('0x69'):_0x4deffe[_0x23a0('0x15')]='Dashboard';break;case _0x23a0('0x6a'):_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x6b');break;case _0x23a0('0x6c'):_0x4deffe[_0x23a0('0x15')]='Pause';break;case _0x23a0('0x6d'):_0x4deffe[_0x23a0('0x15')]='Schedule';break;case _0x23a0('0x6e'):_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x6f');break;case _0x23a0('0x70'):_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x71');break;case'templates':_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x72');break;case _0x23a0('0x73'):_0x4deffe['childModel']=_0x23a0('0x74');break;case _0x23a0('0x75'):_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x76');break;case'variables':_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x77');break;case'plugins':_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x78');break;case _0x23a0('0x79'):_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x7a');_0x4deffe[_0x23a0('0x19')]=[{'name':_0x23a0('0x7b'),'field':'id','foreignKey':_0x23a0('0x7c')}];break;case _0x23a0('0x7d'):_0x4deffe[_0x23a0('0x15')]=_0x23a0('0x7e');break;}return _0x4deffe;}function _0xa0d59a(_0x9867fd,_0x57f342){var _0x4116db=_0x9867fd[_0x23a0('0x7f')](0x0)[_0x23a0('0x80')]()+_0x9867fd[_0x23a0('0x81')](0x1);var _0x3757f8={'type':_0x1cdc50[_0x23a0('0x82')]['QueryTypes'][_0x23a0('0x83')],'raw':!![]};return new Promise(function(_0xa26522,_0xa25b0){var _0x57a8e4=squel[_0x23a0('0x84')]()['field'](_0x23a0('0x85')+_0x4116db+'InteractionId','id')[_0x23a0('0x5')]('ui.createdAt')[_0x23a0('0x86')](_0x23a0('0x87')+_0x9867fd+_0x23a0('0x88'),'ui')[_0x23a0('0x89')]('ui.UserId\x20=\x20?',_0x57f342['id']);return _0x1cdc50[_0x23a0('0x8a')]['query'](_0x57a8e4[_0x23a0('0x8b')](),_0x3757f8)[_0x23a0('0xc')](function(_0x2e9c2d){_0x57f342[_0x4116db+_0x23a0('0x8c')]=_0x2e9c2d;_0xa26522(_0x2e9c2d);})[_0x23a0('0xa')](function(_0x19cf75){_0xa25b0(_0x19cf75);});});}return _0x3a1532[_0x23a0('0x8d')](_0x23a0('0x8e'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x3fdb11){var _0x103584={'raw':_0x3fdb11[_0x23a0('0x8f')][_0x23a0('0x90')],'where':{}};var _0x4bb540={};var _0x4d2212={'count':0x0,'rows':[]};var _0x23209f=_0x3fdb11[_0x23a0('0x8f')][_0x23a0('0x91')];var _0xc9477d=_0x3fdb11[_0x23a0('0x8f')][_0x23a0('0x92')]||![];var _0x5e8c69=_0x502f86(_0x23209f,_0xc9477d);if(!_0x5e8c69[_0x23a0('0x15')])throw new Error(_0x23a0('0x93')+_0x23209f+'\x27');var _0x3ba7cc=[{'name':_0x23209f}];if(!_[_0x23a0('0x94')](_0x5e8c69[_0x23a0('0x19')]))_0x3ba7cc=_0x5e8c69[_0x23a0('0x19')];var _0x31b044=[];for(var _0x1687b5=0x0;_0x1687b5<_0x3ba7cc['length'];_0x1687b5++){_0x31b044['push'](_0x1cdc50[_0x23a0('0x95')][_0x23a0('0x96')]({'where':{'userProfileId':_0x3fdb11[_0x23a0('0x97')]['id'],'name':_0x3ba7cc[_0x1687b5][_0x23a0('0xd')]},'raw':!![]}));}return Promise['all'](_0x31b044)[_0x23a0('0xc')](function(_0x4792a9){var _0xfc4af2=_[_0x23a0('0x4')](_0x4792a9,function(_0x40334b){return _0x40334b?_0x40334b:undefined;});var _0x53a839=_[_0x23a0('0x4')](_0x3ba7cc,[_0x23a0('0x98'),!![]]);var _0x296695=_[_0x23a0('0x94')](_0xfc4af2)&&_[_0x23a0('0x94')](_0x53a839)?null:_[_0x23a0('0x99')](_0x53a839,_0xfc4af2);if(!_0x296695)return null;var _0x171963=[];for(var _0x46f6e9=0x0;_0x46f6e9<_0x296695[_0x23a0('0x9a')];_0x46f6e9++){var _0x36b560=_[_0x23a0('0x96')](_0x3ba7cc,function(_0x40d1b6){return _0x296695[_0x46f6e9]?_0x40d1b6[_0x23a0('0xd')]===_0x296695[_0x46f6e9][_0x23a0('0xd')]:null;});if(_0x36b560){if(_0x296695[_0x46f6e9]['ignore']){_0x171963['push'](_0x667c05(_0x5e8c69[_0x23a0('0x15')],_0x296695[_0x46f6e9]));}else{if(!_0x296695[_0x46f6e9][_0x23a0('0x9b')]){_0x171963[_0x23a0('0x9c')](_0x572582(_0x36b560,_0x296695[_0x46f6e9],_0x5e8c69[_0x23a0('0x15')]));}else{if(_0x36b560[_0x23a0('0xb')]){_0x171963[_0x23a0('0x9c')](_0x41abca(_0x36b560,_0x296695[_0x46f6e9]));}}}}}return Promise[_0x23a0('0x9d')](_0x171963);})['then'](function(_0x1f7dd2){var _0x2cae88=_0x1f7dd2;var _0x1db960=null;if(_0x2cae88){_0x1db960=_0x2cae88[_0x23a0('0x9a')]===0x1?_0x2cae88[0x0]:null;}if(!_0x1db960&&!_0x2cae88)return _0x4d2212;var _0x723663=_0x1cdc50[_0x5e8c69[_0x23a0('0x15')]][_0x23a0('0x9e')];_0x4bb540[_0x23a0('0xb')]=_[_0x23a0('0x9f')](_0x723663);_0x4bb540[_0x23a0('0x8f')]=_[_0x23a0('0x9f')](_0x3fdb11[_0x23a0('0x8f')]);_0x4bb540[_0x23a0('0xa0')]=_[_0x23a0('0xa1')](_0x4bb540[_0x23a0('0xb')],_0x4bb540[_0x23a0('0x8f')]);_0x103584['attributes']=_[_0x23a0('0xa1')](_0x4bb540['model'],qs[_0x23a0('0xa2')](_0x3fdb11[_0x23a0('0x8f')][_0x23a0('0xa2')]));_0x103584[_0x23a0('0xa3')]=_0x103584[_0x23a0('0xa3')]['length']?_0x103584[_0x23a0('0xa3')]:_0x4bb540['model'];if(!_0x3fdb11['query'][_0x23a0('0xa4')](_0x23a0('0xa5'))){_0x103584[_0x23a0('0xa6')]=qs[_0x23a0('0xa6')](_0x3fdb11[_0x23a0('0x8f')][_0x23a0('0xa6')]);_0x103584[_0x23a0('0xa7')]=qs[_0x23a0('0xa7')](_0x3fdb11['query'][_0x23a0('0xa7')]);}_0x103584[_0x23a0('0xa8')]=qs['sort'](_0x3fdb11['query']['sort']);_0x103584[_0x23a0('0x89')]=qs[_0x23a0('0xa0')](_[_0x23a0('0xa9')](_0x3fdb11[_0x23a0('0x8f')],_0x4bb540['filters']));if(_0x3fdb11[_0x23a0('0x8f')]['filter']){_0x103584[_0x23a0('0x89')]=_['merge'](_0x103584[_0x23a0('0x89')],{'$or':_['map'](_0x723663,function(_0x20dd3b){if(_0x20dd3b[_0x23a0('0x3a')][_0x23a0('0xaa')]!=='VIRTUAL'){var _0x20f52c={};_0x20f52c[_0x20dd3b[_0x23a0('0x5')]]={'$like':'%'+_0x3fdb11['query']['filter']+'%'};return _0x20f52c;}})});}var _0x1337f0=[];var _0x45e9e8=null;var _0x4bedb9={};if(_0x1db960){_0x45e9e8=_[_0x23a0('0x96')](_0x3ba7cc,[_0x23a0('0xd'),_0x1db960[_0x23a0('0xd')]]);if(_0x45e9e8[_0x23a0('0x5')]){_0x4bedb9={};if(_0x5e8c69[_0x23a0('0x15')]==='AnalyticExtractedReport'){_0x4bedb9[_0x45e9e8['foreignKey']]=_['map'](_0x1db960[_0x23a0('0x8')],'id');}else{_0x4bedb9[_0x45e9e8[_0x23a0('0xab')]]=_0x1db960['associatedResources'];}_0x1337f0[_0x23a0('0x9c')](_0x4bedb9);}else{_0x103584['where']['id']=_0x1db960['associatedResources'];}}else{for(var _0x336eb5=0x0;_0x336eb5<_0x2cae88[_0x23a0('0x9a')];_0x336eb5++){_0x45e9e8=_[_0x23a0('0x96')](_0x3ba7cc,[_0x23a0('0xd'),_0x2cae88[_0x336eb5][_0x23a0('0xd')]]);if(_0x45e9e8['field']){_0x4bedb9={};_0x4bedb9[_0x45e9e8[_0x23a0('0xab')]]=_0x2cae88[_0x336eb5][_0x23a0('0x8')];_0x1337f0['push'](_0x4bedb9);}else{if(!_0x103584['where']['id'])_0x103584[_0x23a0('0x89')]['id']=[];_0x2cae88[_0x336eb5][_0x23a0('0x8')][_0x23a0('0xac')](function(_0xce64c3){_0x103584['where']['id']['push'](_0xce64c3);});}}}if(!_[_0x23a0('0x94')](_0x1337f0)){_0x103584[_0x23a0('0x89')]=_['merge'](_0x103584[_0x23a0('0x89')],{'$and':{'$or':_0x1337f0}});}_0x103584=_[_0x23a0('0xad')]({},_0x103584,_0x3fdb11['options']);if(_0x1db960&&!_0x1db960[_0x23a0('0x9b')]&&_0x5e8c69[_0x23a0('0x15')]===_0x23a0('0x7a')){if(_0x3fdb11[_0x23a0('0x8f')][_0x23a0('0xae')]){_0x103584[_0x23a0('0xaf')]=[{'all':!![]}];}return _0x1cdc50[_0x5e8c69[_0x23a0('0x15')]][_0x23a0('0x7')](_0x103584)[_0x23a0('0xc')](function(_0x3c657f){var _0x32c6da=[];_0x3c657f[_0x23a0('0xac')](function(_0x5bad05){var _0x3032c5;switch(_0x5bad05[_0x23a0('0xb0')]){case'default':_0x3032c5=_['find'](_0x1db960[_0x23a0('0x8')],function(_0x666236){return _0x666236['id']===_0x5bad05[_0x23a0('0x7c')]&&_0x666236[_0x23a0('0x3a')]===_0x23a0('0xb1');});break;case'custom':_0x3032c5=_['find'](_0x1db960['associatedResources'],function(_0x280252){return _0x280252['id']===_0x5bad05[_0x23a0('0x7c')]&&_0x280252['type']===_0x23a0('0xb2');});break;}if(_0x3032c5)_0x32c6da['push'](_0x5bad05);});_0x4d2212['count']=_0x32c6da[_0x23a0('0x9a')];_0x4d2212[_0x23a0('0xb3')]=_0x32c6da;return _0x4d2212;});}else{if(!_[_0x23a0('0x94')](_0x3fdb11[_0x23a0('0x8f')][_0x23a0('0xb4')])){_0x103584[_0x23a0('0x89')]['id']=_0x103584['where']['id']?_[_0x23a0('0xa1')](_0x103584[_0x23a0('0x89')]['id'],_0x3fdb11[_0x23a0('0x8f')][_0x23a0('0xb4')]):_0x3fdb11[_0x23a0('0x8f')][_0x23a0('0xb4')];if(_0x3fdb11[_0x23a0('0x8f')]['customSorting']){_0x103584[_0x23a0('0xa8')]=_0x3fdb11[_0x23a0('0x8f')][_0x23a0('0xb5')];}}if(_0x3fdb11['query']['extraQueryConditions']){_0x103584[_0x23a0('0x89')]=_[_0x23a0('0xad')](_0x103584['where'],{'$and':_0x3fdb11[_0x23a0('0x8f')]['extraQueryConditions']});}return _0x1cdc50[_0x5e8c69[_0x23a0('0x15')]][_0x23a0('0xb6')]({'where':_0x103584[_0x23a0('0x89')]})[_0x23a0('0xc')](function(_0x4e5ec8){_0x4d2212[_0x23a0('0xb6')]=_0x4e5ec8;if(_0x3fdb11['query'][_0x23a0('0xae')]){if(_0x5e8c69['childModel']===_0x23a0('0x1d')){_0x103584[_0x23a0('0xaf')]=[{'model':_0x1cdc50[_0x23a0('0x71')],'as':_0x23a0('0xb7'),'attributes':['id',_0x23a0('0xd'),_0x23a0('0xb8')],'required':_0x3fdb11['query']['tag']?!![]:![]},{'model':_0x1cdc50['Tag'],'as':_0x23a0('0xb9'),'attributes':['id',_0x23a0('0xd'),_0x23a0('0xb8')],'through':_0x3fdb11[_0x23a0('0x8f')][_0x23a0('0xba')]?{'attributes':[],'where':{'TagId':_0x3fdb11[_0x23a0('0x8f')][_0x23a0('0xba')]||undefined}}:{},'required':_0x3fdb11['query'][_0x23a0('0xba')]?!![]:![]}];}else{_0x103584[_0x23a0('0xaf')]=[{'all':!![]}];}}return _0x1cdc50[_0x5e8c69[_0x23a0('0x15')]]['findAll'](_0x103584);})[_0x23a0('0xc')](function(_0x52cb1b){_0x4d2212[_0x23a0('0xb3')]=_0x52cb1b;if(_0x23209f==='Agents'&&_0x3fdb11[_0x23a0('0x8f')][_0x23a0('0xbb')]===_0x23a0('0xbc')){var _0x3a9709=[];for(var _0x61a56d=0x0;_0x61a56d<_0x4d2212[_0x23a0('0xb3')]['length'];_0x61a56d++){_0x3a9709[_0x23a0('0x9c')](_0xa0d59a('chat',_0x4d2212['rows'][_0x61a56d]['dataValues']));_0x3a9709[_0x23a0('0x9c')](_0xa0d59a(_0x23a0('0xbd'),_0x4d2212[_0x23a0('0xb3')][_0x61a56d][_0x23a0('0xbe')]));_0x3a9709[_0x23a0('0x9c')](_0xa0d59a(_0x23a0('0xbf'),_0x4d2212[_0x23a0('0xb3')][_0x61a56d][_0x23a0('0xbe')]));_0x3a9709[_0x23a0('0x9c')](_0xa0d59a(_0x23a0('0xc0'),_0x4d2212[_0x23a0('0xb3')][_0x61a56d][_0x23a0('0xbe')]));_0x3a9709[_0x23a0('0x9c')](_0xa0d59a(_0x23a0('0xc1'),_0x4d2212[_0x23a0('0xb3')][_0x61a56d][_0x23a0('0xbe')]));_0x3a9709[_0x23a0('0x9c')](_0xa0d59a(_0x23a0('0xc2'),_0x4d2212['rows'][_0x61a56d][_0x23a0('0xbe')]));}return Promise[_0x23a0('0x9d')](_0x3a9709)['then'](function(){return _0x4d2212;});}return _0x4d2212;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 353952e..1162595 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 _0x4f81=['localhost','socket.io-emitter','./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults'];(function(_0x3a607e,_0x54d530){var _0x37b106=function(_0x1becae){while(--_0x1becae){_0x3a607e['push'](_0x3a607e['shift']());}};_0x37b106(++_0x54d530);}(_0x4f81,0x1e3));var _0x14f8=function(_0x565a5c,_0x487888){_0x565a5c=_0x565a5c-0x0;var _0x1e0da1=_0x4f81[_0x565a5c];return _0x1e0da1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x14f8('0x0'));var BPromise=require('bluebird');var rs=require(_0x14f8('0x1'));var fs=require('fs');var Redis=require(_0x14f8('0x2'));var db=require(_0x14f8('0x3'))['db'];var utils=require(_0x14f8('0x4'));var logger=require(_0x14f8('0x5'))(_0x14f8('0x6'));var config=require(_0x14f8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x14f8('0x8')]['http']({'port':0x232a});config[_0x14f8('0x9')]=_[_0x14f8('0xa')](config['redis'],{'host':_0x14f8('0xb'),'port':0x18eb});var socket=require(_0x14f8('0xc'))(new Redis(config['redis']));require(_0x14f8('0xd'))['register'](socket);function respondWithRpcPromise(_0x496303,_0x19a1d0,_0x40a43d){return new BPromise(function(_0xbfbf2a,_0xd10497){return client[_0x14f8('0xe')](_0x496303,_0x40a43d)[_0x14f8('0xf')](function(_0x1fa3e8){logger[_0x14f8('0x10')](_0x14f8('0x11'),_0x19a1d0,_0x14f8('0x12'));logger[_0x14f8('0x13')](_0x14f8('0x14'),_0x19a1d0,'request\x20sent',JSON[_0x14f8('0x15')](_0x1fa3e8));if(_0x1fa3e8[_0x14f8('0x16')]){if(_0x1fa3e8[_0x14f8('0x16')][_0x14f8('0x17')]===0x1f4){logger[_0x14f8('0x16')](_0x14f8('0x11'),_0x19a1d0,_0x1fa3e8[_0x14f8('0x16')][_0x14f8('0x18')]);return _0xd10497(_0x1fa3e8[_0x14f8('0x16')][_0x14f8('0x18')]);}logger['error'](_0x14f8('0x11'),_0x19a1d0,_0x1fa3e8[_0x14f8('0x16')][_0x14f8('0x18')]);return _0xbfbf2a(_0x1fa3e8[_0x14f8('0x16')][_0x14f8('0x18')]);}else{logger[_0x14f8('0x10')](_0x14f8('0x11'),_0x19a1d0,'request\x20sent');_0xbfbf2a(_0x1fa3e8[_0x14f8('0x19')][_0x14f8('0x18')]);}})['catch'](function(_0x4f5720){logger['error'](_0x14f8('0x11'),_0x19a1d0,_0x4f5720);_0xd10497(_0x4f5720);});});} \ No newline at end of file +var _0x0b78=['result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserProfile,\x20%s,\x20%s','message'];(function(_0x156576,_0x588966){var _0x1acff0=function(_0x2a1f7a){while(--_0x2a1f7a){_0x156576['push'](_0x156576['shift']());}};_0x1acff0(++_0x588966);}(_0x0b78,0x1d6));var _0x80b7=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x0b78[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require(_0x80b7('0x0'));var moment=require(_0x80b7('0x1'));var BPromise=require(_0x80b7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x80b7('0x3'));var db=require(_0x80b7('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x80b7('0x5'));var jayson=require(_0x80b7('0x6'));var client=jayson[_0x80b7('0x7')][_0x80b7('0x8')]({'port':0x232a});config[_0x80b7('0x9')]=_[_0x80b7('0xa')](config['redis'],{'host':_0x80b7('0xb'),'port':0x18eb});var socket=require(_0x80b7('0xc'))(new Redis(config[_0x80b7('0x9')]));require('./userProfile.socket')['register'](socket);function respondWithRpcPromise(_0xf705da,_0x5169e9,_0x475976){return new BPromise(function(_0x273f5a,_0x47910c){return client[_0x80b7('0xd')](_0xf705da,_0x475976)[_0x80b7('0xe')](function(_0x1e8046){logger[_0x80b7('0xf')]('UserProfile,\x20%s,\x20%s',_0x5169e9,'request\x20sent');logger[_0x80b7('0x10')](_0x80b7('0x11'),_0x5169e9,_0x80b7('0x12'),JSON[_0x80b7('0x13')](_0x1e8046));if(_0x1e8046[_0x80b7('0x14')]){if(_0x1e8046[_0x80b7('0x14')][_0x80b7('0x15')]===0x1f4){logger[_0x80b7('0x14')](_0x80b7('0x16'),_0x5169e9,_0x1e8046['error']['message']);return _0x47910c(_0x1e8046['error']['message']);}logger[_0x80b7('0x14')](_0x80b7('0x16'),_0x5169e9,_0x1e8046[_0x80b7('0x14')][_0x80b7('0x17')]);return _0x273f5a(_0x1e8046[_0x80b7('0x14')][_0x80b7('0x17')]);}else{logger[_0x80b7('0xf')](_0x80b7('0x16'),_0x5169e9,_0x80b7('0x12'));_0x273f5a(_0x1e8046[_0x80b7('0x18')][_0x80b7('0x17')]);}})[_0x80b7('0x19')](function(_0x196948){logger['error'](_0x80b7('0x16'),_0x5169e9,_0x196948);_0x47910c(_0x196948);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index a126ace..5109a4d 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 _0x680b=['save','remove','update','emit','removeListener','register'];(function(_0x338046,_0x51df14){var _0x11fbc8=function(_0x3c730d){while(--_0x3c730d){_0x338046['push'](_0x338046['shift']());}};_0x11fbc8(++_0x51df14);}(_0x680b,0x1bc));var _0xb680=function(_0x4d3c9b,_0x1b1567){_0x4d3c9b=_0x4d3c9b-0x0;var _0x2e8444=_0x680b[_0x4d3c9b];return _0x2e8444;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xb680('0x0'),_0xb680('0x1'),_0xb680('0x2')];function createListener(_0x37443f,_0xb4cbac){return function(_0x1692fd){_0xb4cbac[_0xb680('0x3')](_0x37443f,_0x1692fd);};}function removeListener(_0x5eeb9c,_0x158c5b){return function(){UserProfileEvents[_0xb680('0x4')](_0x5eeb9c,_0x158c5b);};}exports[_0xb680('0x5')]=function(_0x1bfe9a){for(var _0xc57bbf=0x0,_0x11122d=events['length'];_0xc57bbf<_0x11122d;_0xc57bbf++){var _0x44fd0e=events[_0xc57bbf];var _0x56033b=createListener('userProfile:'+_0x44fd0e,_0x1bfe9a);UserProfileEvents['on'](_0x44fd0e,_0x56033b);}}; \ No newline at end of file +var _0x76d5=['removeListener','length','userProfile:','./userProfile.events','save','remove','update','emit'];(function(_0x32cc1f,_0x8b4c5c){var _0x4d8a73=function(_0x53d4d2){while(--_0x53d4d2){_0x32cc1f['push'](_0x32cc1f['shift']());}};_0x4d8a73(++_0x8b4c5c);}(_0x76d5,0x10b));var _0x576d=function(_0x2e0c54,_0x1ecb7d){_0x2e0c54=_0x2e0c54-0x0;var _0x10867d=_0x76d5[_0x2e0c54];return _0x10867d;};'use strict';var UserProfileEvents=require(_0x576d('0x0'));var events=[_0x576d('0x1'),_0x576d('0x2'),_0x576d('0x3')];function createListener(_0x268c93,_0x265537){return function(_0x495de1){_0x265537[_0x576d('0x4')](_0x268c93,_0x495de1);};}function removeListener(_0x338f41,_0x856659){return function(){UserProfileEvents[_0x576d('0x5')](_0x338f41,_0x856659);};}exports['register']=function(_0x31f128){for(var _0xa8e24c=0x0,_0x54dba7=events[_0x576d('0x6')];_0xa8e24c<_0x54dba7;_0xa8e24c++){var _0x3a6543=events[_0xa8e24c];var _0x43657c=createListener(_0x576d('0x7')+_0x3a6543,_0x31f128);UserProfileEvents['on'](_0x3a6543,_0x43657c);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index a82afbc..119d096 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 _0x081a=['./userProfileResource.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x081a,0x16e));var _0xa081=function(_0x589656,_0x1b87ca){_0x589656=_0x589656-0x0;var _0x5e3e8d=_0x081a[_0x589656];return _0x5e3e8d;};'use strict';var multer=require(_0xa081('0x0'));var util=require('util');var path=require(_0xa081('0x1'));var timeout=require(_0xa081('0x2'));var express=require(_0xa081('0x3'));var router=express['Router']();var fs_extra=require(_0xa081('0x4'));var auth=require(_0xa081('0x5'));var interaction=require(_0xa081('0x6'));var config=require(_0xa081('0x7'));var controller=require(_0xa081('0x8'));router[_0xa081('0x9')]('/',auth[_0xa081('0xa')](),controller['index']);router[_0xa081('0x9')](_0xa081('0xb'),auth['isAuthenticated'](),controller[_0xa081('0xc')]);router[_0xa081('0x9')](_0xa081('0xd'),auth[_0xa081('0xa')](),controller[_0xa081('0xe')]);router[_0xa081('0xf')]('/',auth[_0xa081('0xa')](),controller[_0xa081('0x10')]);router[_0xa081('0x11')](_0xa081('0xd'),auth[_0xa081('0xa')](),controller[_0xa081('0x12')]);router[_0xa081('0x13')](_0xa081('0xd'),auth[_0xa081('0xa')](),controller[_0xa081('0x14')]);module[_0xa081('0x15')]=router; \ No newline at end of file +var _0x4f79=['../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service'];(function(_0x78ec82,_0x191dfb){var _0x1c3e9b=function(_0x13ac6c){while(--_0x13ac6c){_0x78ec82['push'](_0x78ec82['shift']());}};_0x1c3e9b(++_0x191dfb);}(_0x4f79,0x78));var _0x94f7=function(_0x1a637a,_0x51bf57){_0x1a637a=_0x1a637a-0x0;var _0x45c2de=_0x4f79[_0x1a637a];return _0x45c2de;};'use strict';var multer=require(_0x94f7('0x0'));var util=require(_0x94f7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x94f7('0x2'));var router=express[_0x94f7('0x3')]();var fs_extra=require(_0x94f7('0x4'));var auth=require(_0x94f7('0x5'));var interaction=require(_0x94f7('0x6'));var config=require(_0x94f7('0x7'));var controller=require(_0x94f7('0x8'));router[_0x94f7('0x9')]('/',auth[_0x94f7('0xa')](),controller[_0x94f7('0xb')]);router[_0x94f7('0x9')](_0x94f7('0xc'),auth[_0x94f7('0xa')](),controller['describe']);router[_0x94f7('0x9')](_0x94f7('0xd'),auth[_0x94f7('0xa')](),controller[_0x94f7('0xe')]);router[_0x94f7('0xf')]('/',auth[_0x94f7('0xa')](),controller[_0x94f7('0x10')]);router[_0x94f7('0x11')](_0x94f7('0xd'),auth[_0x94f7('0xa')](),controller['update']);router[_0x94f7('0x12')](_0x94f7('0xd'),auth[_0x94f7('0xa')](),controller[_0x94f7('0x13')]);module[_0x94f7('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index a85fd49..2ca3da6 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 _0x923b=['exports','STRING','sequelize'];(function(_0x57486e,_0x32283b){var _0x5f110b=function(_0xa18fc3){while(--_0xa18fc3){_0x57486e['push'](_0x57486e['shift']());}};_0x5f110b(++_0x32283b);}(_0x923b,0x9e));var _0xb923=function(_0xf58718,_0x33541a){_0xf58718=_0xf58718-0x0;var _0x5aea10=_0x923b[_0xf58718];return _0x5aea10;};'use strict';var Sequelize=require(_0xb923('0x0'));module[_0xb923('0x1')]={'name':{'type':Sequelize[_0xb923('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0xb923('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xd0d5=['exports','sequelize'];(function(_0x1e05c3,_0x17d02e){var _0x5466cf=function(_0xa2219c){while(--_0xa2219c){_0x1e05c3['push'](_0x1e05c3['shift']());}};_0x5466cf(++_0x17d02e);}(_0xd0d5,0xaf));var _0x5d0d=function(_0xe3869b,_0x3797b5){_0xe3869b=_0xe3869b-0x0;var _0x277304=_0xd0d5[_0xe3869b];return _0x277304;};'use strict';var Sequelize=require(_0x5d0d('0x0'));module[_0x5d0d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'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 00b5d69..207e8c0 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 _0x4991=['hasOwnProperty','nolimit','order','sort','where','merge','type','filter','options','UserProfileResource','includeAll','include','findAll','rows','show','params','keys','find','create','body','catch','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length'];(function(_0x1de3f4,_0xb82d77){var _0x389243=function(_0x43dd6a){while(--_0x43dd6a){_0x1de3f4['push'](_0x1de3f4['shift']());}};_0x389243(++_0xb82d77);}(_0x4991,0xf7));var _0x1499=function(_0x5ea4b9,_0x1a62b6){_0x5ea4b9=_0x5ea4b9-0x0;var _0x3d375f=_0x4991[_0x5ea4b9];return _0x3d375f;};'use strict';var emlformat=require(_0x1499('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1499('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1499('0x2'));var moment=require(_0x1499('0x3'));var BPromise=require(_0x1499('0x4'));var Mustache=require(_0x1499('0x5'));var util=require(_0x1499('0x6'));var path=require(_0x1499('0x7'));var sox=require(_0x1499('0x8'));var csv=require(_0x1499('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1499('0xa'));var _=require(_0x1499('0xb'));var squel=require(_0x1499('0xc'));var crypto=require(_0x1499('0xd'));var jsforce=require(_0x1499('0xe'));var deskjs=require(_0x1499('0xf'));var toCsv=require(_0x1499('0x9'));var querystring=require(_0x1499('0x10'));var Papa=require('papaparse');var Redis=require(_0x1499('0x11'));var authService=require(_0x1499('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1499('0x13'));var hardwareService=require(_0x1499('0x14'));var logger=require('../../config/logger')(_0x1499('0x15'));var utils=require(_0x1499('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3039ce,_0x274bc1){_0x274bc1=_0x274bc1||0xcc;return function(_0x34a928){if(_0x34a928){return _0x3039ce[_0x1499('0x17')](_0x274bc1);}return _0x3039ce[_0x1499('0x18')](_0x274bc1)['end']();};}function respondWithResult(_0x5f34f2,_0x308177){_0x308177=_0x308177||0xc8;return function(_0x4e5195){if(_0x4e5195){return _0x5f34f2[_0x1499('0x18')](_0x308177)[_0x1499('0x19')](_0x4e5195);}};}function respondWithFilteredResult(_0x308318,_0x3ab605){return function(_0x48f654){if(_0x48f654){var _0x1ed43b=typeof _0x3ab605[_0x1499('0x1a')]==='undefined'&&typeof _0x3ab605[_0x1499('0x1b')]===_0x1499('0x1c');var _0x46b364=_0x48f654[_0x1499('0x1d')];var _0x1e45a9=_0x1ed43b?0x0:_0x3ab605[_0x1499('0x1a')];var _0x5b9859=_0x1ed43b?_0x48f654['count']:_0x3ab605['offset']+_0x3ab605[_0x1499('0x1b')];var _0xad534b;if(_0x5b9859>=_0x46b364){_0x5b9859=_0x46b364;_0xad534b=0xc8;}else{_0xad534b=0xce;}_0x308318['status'](_0xad534b);return _0x308318[_0x1499('0x1e')](_0x1499('0x1f'),_0x1e45a9+'-'+_0x5b9859+'/'+_0x46b364)[_0x1499('0x19')](_0x48f654);}return null;};}function patchUpdates(_0x18e4a6){return function(_0x21e887){try{jsonpatch[_0x1499('0x20')](_0x21e887,_0x18e4a6,!![]);}catch(_0x2b0458){return BPromise[_0x1499('0x21')](_0x2b0458);}return _0x21e887[_0x1499('0x22')]();};}function saveUpdates(_0x15bcd4,_0x2bb71f){return function(_0x836081){if(_0x836081){return _0x836081[_0x1499('0x23')](_0x15bcd4)[_0x1499('0x24')](function(_0x4ec57a){return _0x4ec57a;});}return null;};}function removeEntity(_0x1e2c51,_0x2c7f57){return function(_0x5615b4){if(_0x5615b4){return _0x5615b4[_0x1499('0x25')]()[_0x1499('0x24')](function(){_0x1e2c51[_0x1499('0x18')](0xcc)[_0x1499('0x26')]();});}};}function handleEntityNotFound(_0x3968e0,_0x16d036){return function(_0x54f3c2){if(!_0x54f3c2){_0x3968e0['sendStatus'](0x194);}return _0x54f3c2;};}function handleError(_0x12739b,_0x3c9aca){_0x3c9aca=_0x3c9aca||0x1f4;return function(_0x3b9259){logger[_0x1499('0x27')](_0x3b9259[_0x1499('0x28')]);if(_0x3b9259['name']){delete _0x3b9259[_0x1499('0x29')];}_0x12739b['status'](_0x3c9aca)['send'](_0x3b9259);};}exports['index']=function(_0x21d204,_0x103efa){var _0x40932a={},_0x1b460b={},_0x3dad86={'count':0x0,'rows':[]};var _0x388513=_[_0x1499('0x2a')](db['UserProfileResource'][_0x1499('0x2b')],function(_0x1a2c99){return{'name':_0x1a2c99[_0x1499('0x2c')],'type':_0x1a2c99['type'][_0x1499('0x2d')]};});_0x1b460b[_0x1499('0x2e')]=_['map'](_0x388513,_0x1499('0x29'));_0x1b460b[_0x1499('0x2f')]=_['keys'](_0x21d204[_0x1499('0x2f')]);_0x1b460b[_0x1499('0x30')]=_[_0x1499('0x31')](_0x1b460b[_0x1499('0x2e')],_0x1b460b[_0x1499('0x2f')]);_0x40932a[_0x1499('0x32')]=_[_0x1499('0x31')](_0x1b460b[_0x1499('0x2e')],qs[_0x1499('0x33')](_0x21d204[_0x1499('0x2f')][_0x1499('0x33')]));_0x40932a[_0x1499('0x32')]=_0x40932a[_0x1499('0x32')][_0x1499('0x34')]?_0x40932a[_0x1499('0x32')]:_0x1b460b[_0x1499('0x2e')];if(!_0x21d204[_0x1499('0x2f')][_0x1499('0x35')](_0x1499('0x36'))){_0x40932a[_0x1499('0x1b')]=qs['limit'](_0x21d204[_0x1499('0x2f')][_0x1499('0x1b')]);_0x40932a[_0x1499('0x1a')]=qs[_0x1499('0x1a')](_0x21d204[_0x1499('0x2f')][_0x1499('0x1a')]);}_0x40932a[_0x1499('0x37')]=qs[_0x1499('0x38')](_0x21d204[_0x1499('0x2f')][_0x1499('0x38')]);_0x40932a[_0x1499('0x39')]=qs['filters'](_['pick'](_0x21d204[_0x1499('0x2f')],_0x1b460b['filters']),_0x388513);if(_0x21d204[_0x1499('0x2f')]['filter']){_0x40932a[_0x1499('0x39')]=_[_0x1499('0x3a')](_0x40932a[_0x1499('0x39')],{'$or':_[_0x1499('0x2a')](_0x388513,function(_0x531933){if(_0x531933[_0x1499('0x3b')]!=='VIRTUAL'){var _0x2f9c59={};_0x2f9c59[_0x531933[_0x1499('0x29')]]={'$like':'%'+_0x21d204[_0x1499('0x2f')][_0x1499('0x3c')]+'%'};return _0x2f9c59;}})});}_0x40932a=_['merge']({},_0x40932a,_0x21d204[_0x1499('0x3d')]);var _0x815a99={'where':_0x40932a[_0x1499('0x39')]};return db[_0x1499('0x3e')]['count'](_0x815a99)[_0x1499('0x24')](function(_0x4cc411){_0x3dad86[_0x1499('0x1d')]=_0x4cc411;if(_0x21d204[_0x1499('0x2f')][_0x1499('0x3f')]){_0x40932a[_0x1499('0x40')]=[{'all':!![]}];}return db[_0x1499('0x3e')][_0x1499('0x41')](_0x40932a);})[_0x1499('0x24')](function(_0xcb85eb){_0x3dad86[_0x1499('0x42')]=_0xcb85eb;return _0x3dad86;})[_0x1499('0x24')](respondWithFilteredResult(_0x103efa,_0x40932a))['catch'](handleError(_0x103efa,null));};exports[_0x1499('0x43')]=function(_0x5dd36c,_0x2cfdaf){var _0x1af1a1={'raw':![],'where':{'id':_0x5dd36c[_0x1499('0x44')]['id']}},_0x5646cf={};_0x5646cf[_0x1499('0x2e')]=_[_0x1499('0x45')](db[_0x1499('0x3e')][_0x1499('0x2b')]);_0x5646cf['query']=_['keys'](_0x5dd36c[_0x1499('0x2f')]);_0x5646cf[_0x1499('0x30')]=_['intersection'](_0x5646cf[_0x1499('0x2e')],_0x5646cf[_0x1499('0x2f')]);_0x1af1a1['attributes']=_['intersection'](_0x5646cf[_0x1499('0x2e')],qs[_0x1499('0x33')](_0x5dd36c[_0x1499('0x2f')]['fields']));_0x1af1a1[_0x1499('0x32')]=_0x1af1a1[_0x1499('0x32')][_0x1499('0x34')]?_0x1af1a1[_0x1499('0x32')]:_0x5646cf['model'];if(_0x5dd36c[_0x1499('0x2f')][_0x1499('0x3f')]){_0x1af1a1[_0x1499('0x40')]=[{'all':!![]}];}_0x1af1a1=_[_0x1499('0x3a')]({},_0x1af1a1,_0x5dd36c['options']);return db[_0x1499('0x3e')][_0x1499('0x46')](_0x1af1a1)[_0x1499('0x24')](handleEntityNotFound(_0x2cfdaf,null))['then'](respondWithResult(_0x2cfdaf,null))['catch'](handleError(_0x2cfdaf,null));};exports[_0x1499('0x47')]=function(_0x491777,_0x7fa101){return db[_0x1499('0x3e')][_0x1499('0x47')](_0x491777[_0x1499('0x48')],{})[_0x1499('0x24')](respondWithResult(_0x7fa101,0xc9))[_0x1499('0x49')](handleError(_0x7fa101,null));};exports[_0x1499('0x23')]=function(_0x591aa8,_0x420d16){if(_0x591aa8['body']['id']){delete _0x591aa8[_0x1499('0x48')]['id'];}return db[_0x1499('0x3e')]['find']({'where':{'id':_0x591aa8[_0x1499('0x44')]['id']}})[_0x1499('0x24')](handleEntityNotFound(_0x420d16,null))[_0x1499('0x24')](saveUpdates(_0x591aa8['body'],null))[_0x1499('0x24')](respondWithResult(_0x420d16,null))[_0x1499('0x49')](handleError(_0x420d16,null));};exports[_0x1499('0x25')]=function(_0x29ac0f,_0x305599){return db[_0x1499('0x3e')][_0x1499('0x46')]({'where':{'id':_0x29ac0f[_0x1499('0x44')]['id']}})[_0x1499('0x24')](handleEntityNotFound(_0x305599,null))[_0x1499('0x24')](removeEntity(_0x305599,null))['catch'](handleError(_0x305599,null));};exports[_0x1499('0x4a')]=function(_0x9f0520,_0x278178){return db['UserProfileResource'][_0x1499('0x4a')]()[_0x1499('0x24')](respondWithResult(_0x278178,null))['catch'](handleError(_0x278178,null));}; \ No newline at end of file +var _0x1a85=['describe','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','pick','map','VIRTUAL','merge','options','include','findAll','rows','catch','show','fields','includeAll','find','create','body','params','destroy'];(function(_0x4a5188,_0x2b178d){var _0x460a16=function(_0x1bb403){while(--_0x1bb403){_0x4a5188['push'](_0x4a5188['shift']());}};_0x460a16(++_0x2b178d);}(_0x1a85,0x178));var _0x51a8=function(_0x4cb9d5,_0x187d5a){_0x4cb9d5=_0x4cb9d5-0x0;var _0x444523=_0x1a85[_0x4cb9d5];return _0x444523;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x51a8('0x0'));var jsonpatch=require(_0x51a8('0x1'));var rp=require(_0x51a8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x51a8('0x3'));var util=require(_0x51a8('0x4'));var path=require(_0x51a8('0x5'));var sox=require('sox');var csv=require(_0x51a8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51a8('0x7'));var _=require('lodash');var squel=require(_0x51a8('0x8'));var crypto=require(_0x51a8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x51a8('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51a8('0xb'));var Redis=require(_0x51a8('0xc'));var authService=require(_0x51a8('0xd'));var qs=require(_0x51a8('0xe'));var as=require(_0x51a8('0xf'));var hardwareService=require(_0x51a8('0x10'));var logger=require(_0x51a8('0x11'))(_0x51a8('0x12'));var utils=require(_0x51a8('0x13'));var config=require(_0x51a8('0x14'));var licenseUtil=require(_0x51a8('0x15'));var db=require(_0x51a8('0x16'))['db'];function respondWithStatusCode(_0x38a1d2,_0x1827e6){_0x1827e6=_0x1827e6||0xcc;return function(_0x43c042){if(_0x43c042){return _0x38a1d2[_0x51a8('0x17')](_0x1827e6);}return _0x38a1d2[_0x51a8('0x18')](_0x1827e6)['end']();};}function respondWithResult(_0x461f5c,_0x7a4c36){_0x7a4c36=_0x7a4c36||0xc8;return function(_0xaec066){if(_0xaec066){return _0x461f5c['status'](_0x7a4c36)[_0x51a8('0x19')](_0xaec066);}};}function respondWithFilteredResult(_0x547d40,_0x10584b){return function(_0x2b8d37){if(_0x2b8d37){var _0x39cd45=typeof _0x10584b[_0x51a8('0x1a')]===_0x51a8('0x1b')&&typeof _0x10584b[_0x51a8('0x1c')]===_0x51a8('0x1b');var _0x516abc=_0x2b8d37[_0x51a8('0x1d')];var _0x45a433=_0x39cd45?0x0:_0x10584b[_0x51a8('0x1a')];var _0x23539e=_0x39cd45?_0x2b8d37[_0x51a8('0x1d')]:_0x10584b[_0x51a8('0x1a')]+_0x10584b['limit'];var _0x1df8c2;if(_0x23539e>=_0x516abc){_0x23539e=_0x516abc;_0x1df8c2=0xc8;}else{_0x1df8c2=0xce;}_0x547d40[_0x51a8('0x18')](_0x1df8c2);return _0x547d40[_0x51a8('0x1e')](_0x51a8('0x1f'),_0x45a433+'-'+_0x23539e+'/'+_0x516abc)[_0x51a8('0x19')](_0x2b8d37);}return null;};}function patchUpdates(_0x3bc044){return function(_0x28aea0){try{jsonpatch[_0x51a8('0x20')](_0x28aea0,_0x3bc044,!![]);}catch(_0x5ac1c0){return BPromise[_0x51a8('0x21')](_0x5ac1c0);}return _0x28aea0['save']();};}function saveUpdates(_0xfe0ddb,_0x12c029){return function(_0x8bda40){if(_0x8bda40){return _0x8bda40[_0x51a8('0x22')](_0xfe0ddb)['then'](function(_0xae3588){return _0xae3588;});}return null;};}function removeEntity(_0x4b9cdd,_0x47f063){return function(_0x23d26a){if(_0x23d26a){return _0x23d26a['destroy']()[_0x51a8('0x23')](function(){_0x4b9cdd[_0x51a8('0x18')](0xcc)[_0x51a8('0x24')]();});}};}function handleEntityNotFound(_0x18e2f3,_0x157554){return function(_0x2f2f05){if(!_0x2f2f05){_0x18e2f3[_0x51a8('0x17')](0x194);}return _0x2f2f05;};}function handleError(_0x1326a2,_0x5b3f49){_0x5b3f49=_0x5b3f49||0x1f4;return function(_0x273ce2){logger[_0x51a8('0x25')](_0x273ce2[_0x51a8('0x26')]);if(_0x273ce2[_0x51a8('0x27')]){delete _0x273ce2[_0x51a8('0x27')];}_0x1326a2[_0x51a8('0x18')](_0x5b3f49)[_0x51a8('0x28')](_0x273ce2);};}exports[_0x51a8('0x29')]=function(_0xec08ae,_0x4b5cda){var _0x20c6b5={},_0x347a02={},_0x4a1548={'count':0x0,'rows':[]};var _0x2f9d53=_['map'](db[_0x51a8('0x2a')][_0x51a8('0x2b')],function(_0x143f46){return{'name':_0x143f46[_0x51a8('0x2c')],'type':_0x143f46[_0x51a8('0x2d')]['key']};});_0x347a02[_0x51a8('0x2e')]=_['map'](_0x2f9d53,_0x51a8('0x27'));_0x347a02[_0x51a8('0x2f')]=_[_0x51a8('0x30')](_0xec08ae['query']);_0x347a02[_0x51a8('0x31')]=_['intersection'](_0x347a02[_0x51a8('0x2e')],_0x347a02[_0x51a8('0x2f')]);_0x20c6b5[_0x51a8('0x32')]=_[_0x51a8('0x33')](_0x347a02[_0x51a8('0x2e')],qs['fields'](_0xec08ae[_0x51a8('0x2f')]['fields']));_0x20c6b5[_0x51a8('0x32')]=_0x20c6b5[_0x51a8('0x32')][_0x51a8('0x34')]?_0x20c6b5['attributes']:_0x347a02[_0x51a8('0x2e')];if(!_0xec08ae[_0x51a8('0x2f')][_0x51a8('0x35')](_0x51a8('0x36'))){_0x20c6b5[_0x51a8('0x1c')]=qs['limit'](_0xec08ae['query']['limit']);_0x20c6b5[_0x51a8('0x1a')]=qs[_0x51a8('0x1a')](_0xec08ae['query'][_0x51a8('0x1a')]);}_0x20c6b5['order']=qs[_0x51a8('0x37')](_0xec08ae[_0x51a8('0x2f')][_0x51a8('0x37')]);_0x20c6b5[_0x51a8('0x38')]=qs[_0x51a8('0x31')](_[_0x51a8('0x39')](_0xec08ae['query'],_0x347a02['filters']),_0x2f9d53);if(_0xec08ae[_0x51a8('0x2f')]['filter']){_0x20c6b5['where']=_['merge'](_0x20c6b5[_0x51a8('0x38')],{'$or':_[_0x51a8('0x3a')](_0x2f9d53,function(_0x3cbf97){if(_0x3cbf97['type']!==_0x51a8('0x3b')){var _0x25d772={};_0x25d772[_0x3cbf97[_0x51a8('0x27')]]={'$like':'%'+_0xec08ae[_0x51a8('0x2f')]['filter']+'%'};return _0x25d772;}})});}_0x20c6b5=_[_0x51a8('0x3c')]({},_0x20c6b5,_0xec08ae[_0x51a8('0x3d')]);var _0x1b0333={'where':_0x20c6b5['where']};return db[_0x51a8('0x2a')]['count'](_0x1b0333)[_0x51a8('0x23')](function(_0x1e637a){_0x4a1548[_0x51a8('0x1d')]=_0x1e637a;if(_0xec08ae[_0x51a8('0x2f')]['includeAll']){_0x20c6b5[_0x51a8('0x3e')]=[{'all':!![]}];}return db[_0x51a8('0x2a')][_0x51a8('0x3f')](_0x20c6b5);})[_0x51a8('0x23')](function(_0xa33fc){_0x4a1548[_0x51a8('0x40')]=_0xa33fc;return _0x4a1548;})[_0x51a8('0x23')](respondWithFilteredResult(_0x4b5cda,_0x20c6b5))[_0x51a8('0x41')](handleError(_0x4b5cda,null));};exports[_0x51a8('0x42')]=function(_0x4b8467,_0x22e6e6){var _0x2afb74={'raw':![],'where':{'id':_0x4b8467['params']['id']}},_0x4c7c67={};_0x4c7c67[_0x51a8('0x2e')]=_[_0x51a8('0x30')](db[_0x51a8('0x2a')][_0x51a8('0x2b')]);_0x4c7c67[_0x51a8('0x2f')]=_[_0x51a8('0x30')](_0x4b8467[_0x51a8('0x2f')]);_0x4c7c67[_0x51a8('0x31')]=_[_0x51a8('0x33')](_0x4c7c67[_0x51a8('0x2e')],_0x4c7c67['query']);_0x2afb74[_0x51a8('0x32')]=_[_0x51a8('0x33')](_0x4c7c67[_0x51a8('0x2e')],qs[_0x51a8('0x43')](_0x4b8467[_0x51a8('0x2f')][_0x51a8('0x43')]));_0x2afb74['attributes']=_0x2afb74[_0x51a8('0x32')]['length']?_0x2afb74[_0x51a8('0x32')]:_0x4c7c67[_0x51a8('0x2e')];if(_0x4b8467[_0x51a8('0x2f')][_0x51a8('0x44')]){_0x2afb74[_0x51a8('0x3e')]=[{'all':!![]}];}_0x2afb74=_['merge']({},_0x2afb74,_0x4b8467['options']);return db[_0x51a8('0x2a')][_0x51a8('0x45')](_0x2afb74)[_0x51a8('0x23')](handleEntityNotFound(_0x22e6e6,null))[_0x51a8('0x23')](respondWithResult(_0x22e6e6,null))[_0x51a8('0x41')](handleError(_0x22e6e6,null));};exports['create']=function(_0x504a43,_0xcbd998){return db[_0x51a8('0x2a')][_0x51a8('0x46')](_0x504a43[_0x51a8('0x47')],{})[_0x51a8('0x23')](respondWithResult(_0xcbd998,0xc9))[_0x51a8('0x41')](handleError(_0xcbd998,null));};exports[_0x51a8('0x22')]=function(_0x1103a3,_0x301578){if(_0x1103a3['body']['id']){delete _0x1103a3['body']['id'];}return db['UserProfileResource'][_0x51a8('0x45')]({'where':{'id':_0x1103a3[_0x51a8('0x48')]['id']}})[_0x51a8('0x23')](handleEntityNotFound(_0x301578,null))['then'](saveUpdates(_0x1103a3[_0x51a8('0x47')],null))[_0x51a8('0x23')](respondWithResult(_0x301578,null))['catch'](handleError(_0x301578,null));};exports[_0x51a8('0x49')]=function(_0x4fb93c,_0x50a2f8){return db[_0x51a8('0x2a')][_0x51a8('0x45')]({'where':{'id':_0x4fb93c[_0x51a8('0x48')]['id']}})['then'](handleEntityNotFound(_0x50a2f8,null))['then'](removeEntity(_0x50a2f8,null))[_0x51a8('0x41')](handleError(_0x50a2f8,null));};exports['describe']=function(_0x21c4da,_0xc89617){return db[_0x51a8('0x2a')][_0x51a8('0x4a')]()[_0x51a8('0x23')](respondWithResult(_0xc89617,null))[_0x51a8('0x41')](handleError(_0xc89617,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index eb6c11a..658ee83 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 _0x319a=['UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x1b6ad0,_0x4afd3c){var _0xfc06d8=function(_0x11ed09){while(--_0x11ed09){_0x1b6ad0['push'](_0x1b6ad0['shift']());}};_0xfc06d8(++_0x4afd3c);}(_0x319a,0xe1));var _0xa319=function(_0x5f21eb,_0x348c16){_0x5f21eb=_0x5f21eb-0x0;var _0x3c939f=_0x319a[_0x5f21eb];return _0x3c939f;};'use strict';var _=require(_0xa319('0x0'));var util=require(_0xa319('0x1'));var logger=require(_0xa319('0x2'))(_0xa319('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa319('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa319('0x5'));var config=require(_0xa319('0x6'));var attributes=require('./userProfileResource.attributes');module[_0xa319('0x7')]=function(_0x4d249f,_0x40a797){return _0x4d249f[_0xa319('0x8')](_0xa319('0x9'),attributes,{'tableName':_0xa319('0xa'),'paranoid':![],'indexes':[{'name':_0xa319('0xb'),'fields':[_0xa319('0xc'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1837=['compositeIndex','resourceId','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','define','UserProfileResource','user_profile_has_resources'];(function(_0x161a8f,_0x2945bc){var _0x257ae9=function(_0x574cde){while(--_0x574cde){_0x161a8f['push'](_0x161a8f['shift']());}};_0x257ae9(++_0x2945bc);}(_0x1837,0x8e));var _0x7183=function(_0x3507ca,_0x549aa1){_0x3507ca=_0x3507ca-0x0;var _0xf0b4e1=_0x1837[_0x3507ca];return _0xf0b4e1;};'use strict';var _=require(_0x7183('0x0'));var util=require(_0x7183('0x1'));var logger=require(_0x7183('0x2'))(_0x7183('0x3'));var moment=require(_0x7183('0x4'));var BPromise=require('bluebird');var rp=require(_0x7183('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7183('0x6'));var config=require(_0x7183('0x7'));var attributes=require('./userProfileResource.attributes');module[_0x7183('0x8')]=function(_0x5db881,_0x888e70){return _0x5db881[_0x7183('0x9')](_0x7183('0xa'),attributes,{'tableName':_0x7183('0xb'),'paranoid':![],'indexes':[{'name':_0x7183('0xc'),'fields':[_0x7183('0xd'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 00e9b3b..00ac89d 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 _0xc0d3=['http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xc0d3,0x8f));var _0x3c0d=function(_0x1255e9,_0x43c0e7){_0x1255e9=_0x1255e9-0x0;var _0x2ef99e=_0xc0d3[_0x1255e9];return _0x2ef99e;};'use strict';var _=require(_0x3c0d('0x0'));var util=require(_0x3c0d('0x1'));var moment=require(_0x3c0d('0x2'));var BPromise=require('bluebird');var rs=require(_0x3c0d('0x3'));var fs=require('fs');var Redis=require(_0x3c0d('0x4'));var db=require(_0x3c0d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3c0d('0x6'))(_0x3c0d('0x7'));var config=require(_0x3c0d('0x8'));var jayson=require(_0x3c0d('0x9'));var client=jayson[_0x3c0d('0xa')][_0x3c0d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x56b19d,_0x37df70,_0x46e322){return new BPromise(function(_0x3c0665,_0x198583){return client[_0x3c0d('0xc')](_0x56b19d,_0x46e322)[_0x3c0d('0xd')](function(_0x25da19){logger[_0x3c0d('0xe')](_0x3c0d('0xf'),_0x37df70,_0x3c0d('0x10'));logger['debug'](_0x3c0d('0x11'),_0x37df70,_0x3c0d('0x10'),JSON[_0x3c0d('0x12')](_0x25da19));if(_0x25da19[_0x3c0d('0x13')]){if(_0x25da19['error']['code']===0x1f4){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x37df70,_0x25da19[_0x3c0d('0x13')][_0x3c0d('0x14')]);return _0x198583(_0x25da19['error'][_0x3c0d('0x14')]);}logger[_0x3c0d('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x37df70,_0x25da19['error'][_0x3c0d('0x14')]);return _0x3c0665(_0x25da19['error']['message']);}else{logger[_0x3c0d('0xe')](_0x3c0d('0xf'),_0x37df70,'request\x20sent');_0x3c0665(_0x25da19[_0x3c0d('0x15')]['message']);}})['catch'](function(_0x577e13){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x37df70,_0x577e13);_0x198583(_0x577e13);});});} \ No newline at end of file +var _0x2cf0=['../../config/environment','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3f73ba,_0x43f4b6){var _0x5ec10d=function(_0x2be5ca){while(--_0x2be5ca){_0x3f73ba['push'](_0x3f73ba['shift']());}};_0x5ec10d(++_0x43f4b6);}(_0x2cf0,0x1ad));var _0x02cf=function(_0x57f3e9,_0x5468cc){_0x57f3e9=_0x57f3e9-0x0;var _0x5387c3=_0x2cf0[_0x57f3e9];return _0x5387c3;};'use strict';var _=require(_0x02cf('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x02cf('0x1'));var rs=require(_0x02cf('0x2'));var fs=require('fs');var Redis=require(_0x02cf('0x3'));var db=require(_0x02cf('0x4'))['db'];var utils=require(_0x02cf('0x5'));var logger=require(_0x02cf('0x6'))(_0x02cf('0x7'));var config=require(_0x02cf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x02cf('0x9')][_0x02cf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50034e,_0x32b36e,_0x1a66e1){return new BPromise(function(_0x5c415f,_0x1d2793){return client[_0x02cf('0xb')](_0x50034e,_0x1a66e1)[_0x02cf('0xc')](function(_0x2c2afe){logger[_0x02cf('0xd')](_0x02cf('0xe'),_0x32b36e,_0x02cf('0xf'));logger[_0x02cf('0x10')](_0x02cf('0x11'),_0x32b36e,_0x02cf('0xf'),JSON['stringify'](_0x2c2afe));if(_0x2c2afe[_0x02cf('0x12')]){if(_0x2c2afe[_0x02cf('0x12')][_0x02cf('0x13')]===0x1f4){logger[_0x02cf('0x12')](_0x02cf('0xe'),_0x32b36e,_0x2c2afe[_0x02cf('0x12')]['message']);return _0x1d2793(_0x2c2afe[_0x02cf('0x12')][_0x02cf('0x14')]);}logger['error']('UserProfileResource,\x20%s,\x20%s',_0x32b36e,_0x2c2afe[_0x02cf('0x12')]['message']);return _0x5c415f(_0x2c2afe['error'][_0x02cf('0x14')]);}else{logger[_0x02cf('0xd')](_0x02cf('0xe'),_0x32b36e,_0x02cf('0xf'));_0x5c415f(_0x2c2afe[_0x02cf('0x15')][_0x02cf('0x14')]);}})[_0x02cf('0x16')](function(_0x61e48c){logger[_0x02cf('0x12')](_0x02cf('0xe'),_0x32b36e,_0x61e48c);_0x1d2793(_0x61e48c);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 8c02dbe..510190c 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 _0x15a2=['put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','/describe','describe','get','show'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x15a2,0x11d));var _0x215a=function(_0x2ff252,_0x222a1b){_0x2ff252=_0x2ff252-0x0;var _0x327741=_0x15a2[_0x2ff252];return _0x327741;};'use strict';var multer=require(_0x215a('0x0'));var util=require(_0x215a('0x1'));var path=require(_0x215a('0x2'));var timeout=require(_0x215a('0x3'));var express=require(_0x215a('0x4'));var router=express[_0x215a('0x5')]();var fs_extra=require(_0x215a('0x6'));var auth=require(_0x215a('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x215a('0x8'));var controller=require('./userProfileSection.controller');router['get']('/',auth[_0x215a('0x9')](),controller[_0x215a('0xa')]);router['get'](_0x215a('0xb'),auth[_0x215a('0x9')](),controller[_0x215a('0xc')]);router[_0x215a('0xd')]('/:id',auth[_0x215a('0x9')](),controller[_0x215a('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x215a('0xf')](_0x215a('0x10'),auth[_0x215a('0x9')](),controller[_0x215a('0x11')]);router[_0x215a('0x12')](_0x215a('0x10'),auth[_0x215a('0x9')](),controller['destroy']);module[_0x215a('0x13')]=router; \ No newline at end of file +var _0xdf4b=['delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update'];(function(_0x11d95f,_0x34f442){var _0x2b1a14=function(_0x3a4fa5){while(--_0x3a4fa5){_0x11d95f['push'](_0x11d95f['shift']());}};_0x2b1a14(++_0x34f442);}(_0xdf4b,0x67));var _0xbdf4=function(_0x41b50e,_0x535ba9){_0x41b50e=_0x41b50e-0x0;var _0x53eb51=_0xdf4b[_0x41b50e];return _0x53eb51;};'use strict';var multer=require('multer');var util=require(_0xbdf4('0x0'));var path=require('path');var timeout=require(_0xbdf4('0x1'));var express=require(_0xbdf4('0x2'));var router=express[_0xbdf4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbdf4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbdf4('0x5'));var controller=require(_0xbdf4('0x6'));router[_0xbdf4('0x7')]('/',auth[_0xbdf4('0x8')](),controller[_0xbdf4('0x9')]);router['get'](_0xbdf4('0xa'),auth[_0xbdf4('0x8')](),controller[_0xbdf4('0xb')]);router[_0xbdf4('0x7')](_0xbdf4('0xc'),auth[_0xbdf4('0x8')](),controller[_0xbdf4('0xd')]);router['post']('/',auth[_0xbdf4('0x8')](),controller[_0xbdf4('0xe')]);router[_0xbdf4('0xf')](_0xbdf4('0xc'),auth[_0xbdf4('0x8')](),controller[_0xbdf4('0x10')]);router[_0xbdf4('0x11')](_0xbdf4('0xc'),auth[_0xbdf4('0x8')](),controller[_0xbdf4('0x12')]);module[_0xbdf4('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 4386a7e..77df84e 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 _0xeffd=['STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','sequelize'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0xeffd,0x6b));var _0xdeff=function(_0x3fabcd,_0x1d7ccb){_0x3fabcd=_0x3fabcd-0x0;var _0x5496d4=_0xeffd[_0x3fabcd];return _0x5496d4;};'use strict';var Sequelize=require(_0xdeff('0x0'));module['exports']={'name':{'type':Sequelize[_0xdeff('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0xdeff('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xdeff('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0xdeff('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xdeff('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xdeff('0x1')],'set':function(_0x298274){this[_0xdeff('0x4')](_0xdeff('0x5'),_0x298274?_0x298274[_0xdeff('0x6')](''):[]);},'get':function(){return this[_0xdeff('0x7')](_0xdeff('0x5'))?this[_0xdeff('0x7')](_0xdeff('0x5'))[_0xdeff('0x8')](''):[];}}}; \ No newline at end of file +var _0x8f59=['INTEGER','BOOLEAN','setDataValue','crudPermissions','getDataValue','sequelize','exports','STRING'];(function(_0x14bcca,_0xa15a5c){var _0x35050f=function(_0x583f1a){while(--_0x583f1a){_0x14bcca['push'](_0x14bcca['shift']());}};_0x35050f(++_0xa15a5c);}(_0x8f59,0x11d));var _0x98f5=function(_0x22ca01,_0x4aae04){_0x22ca01=_0x22ca01-0x0;var _0xc5baf7=_0x8f59[_0x22ca01];return _0xc5baf7;};'use strict';var Sequelize=require(_0x98f5('0x0'));module[_0x98f5('0x1')]={'name':{'type':Sequelize[_0x98f5('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x98f5('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x98f5('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x98f5('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x98f5('0x2')],'set':function(_0x320235){this[_0x98f5('0x5')](_0x98f5('0x6'),_0x320235?_0x320235['join'](''):[]);},'get':function(){return this[_0x98f5('0x7')](_0x98f5('0x6'))?this[_0x98f5('0x7')]('crudPermissions')['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 495f558..65ec44f 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 _0x9961=['error','stack','name','send','index','map','UserProfileSection','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','filter','findAll','rows','catch','show','include','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','destroy'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x9961,0x135));var _0x1996=function(_0x1f37d0,_0x5d1c0e){_0x1f37d0=_0x1f37d0-0x0;var _0x4ea78d=_0x9961[_0x1f37d0];return _0x4ea78d;};'use strict';var emlformat=require(_0x1996('0x0'));var rimraf=require(_0x1996('0x1'));var zipdir=require(_0x1996('0x2'));var jsonpatch=require(_0x1996('0x3'));var rp=require(_0x1996('0x4'));var moment=require(_0x1996('0x5'));var BPromise=require(_0x1996('0x6'));var Mustache=require(_0x1996('0x7'));var util=require('util');var path=require(_0x1996('0x8'));var sox=require(_0x1996('0x9'));var csv=require(_0x1996('0xa'));var ejs=require(_0x1996('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1996('0xc'));var jsforce=require(_0x1996('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1996('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1996('0xe'));var authService=require(_0x1996('0xf'));var qs=require(_0x1996('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1996('0x11'));var logger=require(_0x1996('0x12'))(_0x1996('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1996('0x14'));var db=require(_0x1996('0x15'))['db'];function respondWithStatusCode(_0x40d960,_0x2828f6){_0x2828f6=_0x2828f6||0xcc;return function(_0x396ba7){if(_0x396ba7){return _0x40d960[_0x1996('0x16')](_0x2828f6);}return _0x40d960['status'](_0x2828f6)[_0x1996('0x17')]();};}function respondWithResult(_0x8bf45f,_0x41598b){_0x41598b=_0x41598b||0xc8;return function(_0xa2f3a5){if(_0xa2f3a5){return _0x8bf45f[_0x1996('0x18')](_0x41598b)[_0x1996('0x19')](_0xa2f3a5);}};}function respondWithFilteredResult(_0x1311ad,_0x59c06e){return function(_0x48acdd){if(_0x48acdd){var _0x593c6a=typeof _0x59c06e[_0x1996('0x1a')]===_0x1996('0x1b')&&typeof _0x59c06e['limit']==='undefined';var _0x1eb119=_0x48acdd[_0x1996('0x1c')];var _0x1fab2=_0x593c6a?0x0:_0x59c06e['offset'];var _0x203bec=_0x593c6a?_0x48acdd[_0x1996('0x1c')]:_0x59c06e[_0x1996('0x1a')]+_0x59c06e[_0x1996('0x1d')];var _0x890802;if(_0x203bec>=_0x1eb119){_0x203bec=_0x1eb119;_0x890802=0xc8;}else{_0x890802=0xce;}_0x1311ad[_0x1996('0x18')](_0x890802);return _0x1311ad['set'](_0x1996('0x1e'),_0x1fab2+'-'+_0x203bec+'/'+_0x1eb119)[_0x1996('0x19')](_0x48acdd);}return null;};}function patchUpdates(_0xa69698){return function(_0x2d87f3){try{jsonpatch['apply'](_0x2d87f3,_0xa69698,!![]);}catch(_0x19d25c){return BPromise[_0x1996('0x1f')](_0x19d25c);}return _0x2d87f3[_0x1996('0x20')]();};}function saveUpdates(_0x3d1532,_0x255c59){return function(_0x2c1106){if(_0x2c1106){return _0x2c1106[_0x1996('0x21')](_0x3d1532)[_0x1996('0x22')](function(_0x62d93){return _0x62d93;});}return null;};}function removeEntity(_0x528edf,_0x3a3d6b){return function(_0x9233af){if(_0x9233af){return _0x9233af[_0x1996('0x23')]()[_0x1996('0x22')](function(){_0x528edf[_0x1996('0x18')](0xcc)[_0x1996('0x17')]();});}};}function handleEntityNotFound(_0xce3368,_0x449cca){return function(_0x398ca2){if(!_0x398ca2){_0xce3368[_0x1996('0x16')](0x194);}return _0x398ca2;};}function handleError(_0x54f7d7,_0x5cd7af){_0x5cd7af=_0x5cd7af||0x1f4;return function(_0x42b632){logger[_0x1996('0x24')](_0x42b632[_0x1996('0x25')]);if(_0x42b632['name']){delete _0x42b632[_0x1996('0x26')];}_0x54f7d7[_0x1996('0x18')](_0x5cd7af)[_0x1996('0x27')](_0x42b632);};}exports[_0x1996('0x28')]=function(_0x10af13,_0x357e8f){var _0x1be922={},_0xf70fc9={},_0x1cea85={'count':0x0,'rows':[]};var _0x55fb36=_[_0x1996('0x29')](db[_0x1996('0x2a')][_0x1996('0x2b')],function(_0x2c9ef5){return{'name':_0x2c9ef5['fieldName'],'type':_0x2c9ef5['type'][_0x1996('0x2c')]};});_0xf70fc9[_0x1996('0x2d')]=_['map'](_0x55fb36,_0x1996('0x26'));_0xf70fc9['query']=_['keys'](_0x10af13[_0x1996('0x2e')]);_0xf70fc9[_0x1996('0x2f')]=_[_0x1996('0x30')](_0xf70fc9[_0x1996('0x2d')],_0xf70fc9['query']);_0x1be922[_0x1996('0x31')]=_[_0x1996('0x30')](_0xf70fc9[_0x1996('0x2d')],qs[_0x1996('0x32')](_0x10af13[_0x1996('0x2e')][_0x1996('0x32')]));_0x1be922[_0x1996('0x31')]=_0x1be922[_0x1996('0x31')][_0x1996('0x33')]?_0x1be922[_0x1996('0x31')]:_0xf70fc9['model'];if(!_0x10af13[_0x1996('0x2e')][_0x1996('0x34')]('nolimit')){_0x1be922[_0x1996('0x1d')]=qs[_0x1996('0x1d')](_0x10af13['query'][_0x1996('0x1d')]);_0x1be922['offset']=qs[_0x1996('0x1a')](_0x10af13[_0x1996('0x2e')][_0x1996('0x1a')]);}_0x1be922[_0x1996('0x35')]=qs[_0x1996('0x36')](_0x10af13['query']['sort']);_0x1be922[_0x1996('0x37')]=qs[_0x1996('0x2f')](_['pick'](_0x10af13['query'],_0xf70fc9[_0x1996('0x2f')]),_0x55fb36);if(_0x10af13['query']['filter']){_0x1be922[_0x1996('0x37')]=_[_0x1996('0x38')](_0x1be922[_0x1996('0x37')],{'$or':_[_0x1996('0x29')](_0x55fb36,function(_0x3319c8){if(_0x3319c8['type']!=='VIRTUAL'){var _0x293ebe={};_0x293ebe[_0x3319c8[_0x1996('0x26')]]={'$like':'%'+_0x10af13[_0x1996('0x2e')][_0x1996('0x39')]+'%'};return _0x293ebe;}})});}_0x1be922=_[_0x1996('0x38')]({},_0x1be922,_0x10af13['options']);var _0x777d07={'where':_0x1be922[_0x1996('0x37')]};return db[_0x1996('0x2a')][_0x1996('0x1c')](_0x777d07)[_0x1996('0x22')](function(_0x239695){_0x1cea85[_0x1996('0x1c')]=_0x239695;if(_0x10af13[_0x1996('0x2e')]['includeAll']){_0x1be922['include']=[{'all':!![]}];}return db[_0x1996('0x2a')][_0x1996('0x3a')](_0x1be922);})[_0x1996('0x22')](function(_0x4dfe08){_0x1cea85[_0x1996('0x3b')]=_0x4dfe08;return _0x1cea85;})[_0x1996('0x22')](respondWithFilteredResult(_0x357e8f,_0x1be922))[_0x1996('0x3c')](handleError(_0x357e8f,null));};exports[_0x1996('0x3d')]=function(_0x3b6f5a,_0x4ba676){var _0x381218={'raw':![],'where':{'id':_0x3b6f5a['params']['id']}},_0x2c53c2={};_0x2c53c2[_0x1996('0x2d')]=_['keys'](db[_0x1996('0x2a')][_0x1996('0x2b')]);_0x2c53c2[_0x1996('0x2e')]=_['keys'](_0x3b6f5a[_0x1996('0x2e')]);_0x2c53c2[_0x1996('0x2f')]=_[_0x1996('0x30')](_0x2c53c2[_0x1996('0x2d')],_0x2c53c2[_0x1996('0x2e')]);_0x381218['attributes']=_[_0x1996('0x30')](_0x2c53c2[_0x1996('0x2d')],qs['fields'](_0x3b6f5a[_0x1996('0x2e')]['fields']));_0x381218['attributes']=_0x381218[_0x1996('0x31')]['length']?_0x381218['attributes']:_0x2c53c2['model'];if(_0x3b6f5a[_0x1996('0x2e')]['includeAll']){_0x381218[_0x1996('0x3e')]=[{'all':!![]}];}_0x381218=_[_0x1996('0x38')]({},_0x381218,_0x3b6f5a[_0x1996('0x3f')]);return db[_0x1996('0x2a')][_0x1996('0x40')](_0x381218)[_0x1996('0x22')](handleEntityNotFound(_0x4ba676,null))[_0x1996('0x22')](respondWithResult(_0x4ba676,null))['catch'](handleError(_0x4ba676,null));};exports[_0x1996('0x41')]=function(_0x518873,_0x4caefe){return db[_0x1996('0x2a')][_0x1996('0x41')](_0x518873[_0x1996('0x42')],{})[_0x1996('0x22')](respondWithResult(_0x4caefe,0xc9))['catch'](handleError(_0x4caefe,null));};exports['update']=function(_0x492664,_0x3969c3){if(_0x492664[_0x1996('0x42')]['id']){delete _0x492664['body']['id'];}return db[_0x1996('0x2a')][_0x1996('0x40')]({'where':{'id':_0x492664['params']['id']}})[_0x1996('0x22')](handleEntityNotFound(_0x3969c3,null))['then'](saveUpdates(_0x492664[_0x1996('0x42')],null))['then'](respondWithResult(_0x3969c3,null))[_0x1996('0x3c')](handleError(_0x3969c3,null));};exports[_0x1996('0x23')]=function(_0x52714e,_0x31bf84){return db['UserProfileSection'][_0x1996('0x40')]({'where':{'id':_0x52714e[_0x1996('0x43')]['id']}})['then'](handleEntityNotFound(_0x31bf84,null))['then'](removeEntity(_0x31bf84,null))[_0x1996('0x3c')](handleError(_0x31bf84,null));};exports[_0x1996('0x44')]=function(_0x3be211,_0x491ecc){return db[_0x1996('0x2a')][_0x1996('0x44')]()[_0x1996('0x22')](respondWithResult(_0x491ecc,null))[_0x1996('0x3c')](handleError(_0x491ecc,null));}; \ No newline at end of file +var _0xa004=['attributes','length','nolimit','order','sort','pick','where','merge','map','VIRTUAL','filter','options','includeAll','include','catch','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','count','offset','limit','set','apply','reject','save','update','then','destroy','status','end','error','stack','name','send','index','UserProfileSection','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields'];(function(_0x143166,_0x8903d){var _0x439c6b=function(_0x3044b1){while(--_0x3044b1){_0x143166['push'](_0x143166['shift']());}};_0x439c6b(++_0x8903d);}(_0xa004,0xab));var _0x4a00=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa004[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x4a00('0x0'));var rimraf=require(_0x4a00('0x1'));var zipdir=require(_0x4a00('0x2'));var jsonpatch=require(_0x4a00('0x3'));var rp=require(_0x4a00('0x4'));var moment=require('moment');var BPromise=require(_0x4a00('0x5'));var Mustache=require('mustache');var util=require(_0x4a00('0x6'));var path=require('path');var sox=require(_0x4a00('0x7'));var csv=require(_0x4a00('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4a00('0x9'));var _=require(_0x4a00('0xa'));var squel=require(_0x4a00('0xb'));var crypto=require(_0x4a00('0xc'));var jsforce=require(_0x4a00('0xd'));var deskjs=require(_0x4a00('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4a00('0xf'));var Papa=require(_0x4a00('0x10'));var Redis=require(_0x4a00('0x11'));var authService=require(_0x4a00('0x12'));var qs=require(_0x4a00('0x13'));var as=require(_0x4a00('0x14'));var hardwareService=require(_0x4a00('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x4a00('0x16'));var config=require(_0x4a00('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x4a00('0x18'))['db'];function respondWithStatusCode(_0x2c471e,_0x1ce877){_0x1ce877=_0x1ce877||0xcc;return function(_0x386ea0){if(_0x386ea0){return _0x2c471e[_0x4a00('0x19')](_0x1ce877);}return _0x2c471e['status'](_0x1ce877)['end']();};}function respondWithResult(_0x55c28c,_0x2d41e5){_0x2d41e5=_0x2d41e5||0xc8;return function(_0x1c202b){if(_0x1c202b){return _0x55c28c['status'](_0x2d41e5)[_0x4a00('0x1a')](_0x1c202b);}};}function respondWithFilteredResult(_0x5e7795,_0x26a22f){return function(_0x3cce4e){if(_0x3cce4e){var _0x1a6181=typeof _0x26a22f['offset']==='undefined'&&typeof _0x26a22f['limit']==='undefined';var _0x180d67=_0x3cce4e[_0x4a00('0x1b')];var _0x3c6e97=_0x1a6181?0x0:_0x26a22f[_0x4a00('0x1c')];var _0x371939=_0x1a6181?_0x3cce4e[_0x4a00('0x1b')]:_0x26a22f[_0x4a00('0x1c')]+_0x26a22f[_0x4a00('0x1d')];var _0x4f08f8;if(_0x371939>=_0x180d67){_0x371939=_0x180d67;_0x4f08f8=0xc8;}else{_0x4f08f8=0xce;}_0x5e7795['status'](_0x4f08f8);return _0x5e7795[_0x4a00('0x1e')]('Content-Range',_0x3c6e97+'-'+_0x371939+'/'+_0x180d67)['json'](_0x3cce4e);}return null;};}function patchUpdates(_0x3bb1fa){return function(_0x1e37e4){try{jsonpatch[_0x4a00('0x1f')](_0x1e37e4,_0x3bb1fa,!![]);}catch(_0x4aa77f){return BPromise[_0x4a00('0x20')](_0x4aa77f);}return _0x1e37e4[_0x4a00('0x21')]();};}function saveUpdates(_0x262dff,_0x8d975d){return function(_0x2fd512){if(_0x2fd512){return _0x2fd512[_0x4a00('0x22')](_0x262dff)[_0x4a00('0x23')](function(_0x326db4){return _0x326db4;});}return null;};}function removeEntity(_0x22eae8,_0x57d062){return function(_0x185e1c){if(_0x185e1c){return _0x185e1c[_0x4a00('0x24')]()['then'](function(){_0x22eae8[_0x4a00('0x25')](0xcc)[_0x4a00('0x26')]();});}};}function handleEntityNotFound(_0x1d987,_0x198e13){return function(_0x1c8043){if(!_0x1c8043){_0x1d987[_0x4a00('0x19')](0x194);}return _0x1c8043;};}function handleError(_0x471a2b,_0xd50342){_0xd50342=_0xd50342||0x1f4;return function(_0xc5da70){logger[_0x4a00('0x27')](_0xc5da70[_0x4a00('0x28')]);if(_0xc5da70[_0x4a00('0x29')]){delete _0xc5da70[_0x4a00('0x29')];}_0x471a2b[_0x4a00('0x25')](_0xd50342)[_0x4a00('0x2a')](_0xc5da70);};}exports[_0x4a00('0x2b')]=function(_0x573be2,_0x3f4332){var _0x26f5cb={},_0x1abd99={},_0x1003d1={'count':0x0,'rows':[]};var _0x5f190f=_['map'](db[_0x4a00('0x2c')][_0x4a00('0x2d')],function(_0xcfb7b){return{'name':_0xcfb7b[_0x4a00('0x2e')],'type':_0xcfb7b[_0x4a00('0x2f')][_0x4a00('0x30')]};});_0x1abd99['model']=_['map'](_0x5f190f,_0x4a00('0x29'));_0x1abd99[_0x4a00('0x31')]=_['keys'](_0x573be2[_0x4a00('0x31')]);_0x1abd99[_0x4a00('0x32')]=_[_0x4a00('0x33')](_0x1abd99['model'],_0x1abd99[_0x4a00('0x31')]);_0x26f5cb['attributes']=_[_0x4a00('0x33')](_0x1abd99[_0x4a00('0x34')],qs[_0x4a00('0x35')](_0x573be2[_0x4a00('0x31')][_0x4a00('0x35')]));_0x26f5cb[_0x4a00('0x36')]=_0x26f5cb[_0x4a00('0x36')][_0x4a00('0x37')]?_0x26f5cb['attributes']:_0x1abd99[_0x4a00('0x34')];if(!_0x573be2['query']['hasOwnProperty'](_0x4a00('0x38'))){_0x26f5cb[_0x4a00('0x1d')]=qs[_0x4a00('0x1d')](_0x573be2[_0x4a00('0x31')][_0x4a00('0x1d')]);_0x26f5cb[_0x4a00('0x1c')]=qs[_0x4a00('0x1c')](_0x573be2['query'][_0x4a00('0x1c')]);}_0x26f5cb[_0x4a00('0x39')]=qs[_0x4a00('0x3a')](_0x573be2[_0x4a00('0x31')][_0x4a00('0x3a')]);_0x26f5cb['where']=qs[_0x4a00('0x32')](_[_0x4a00('0x3b')](_0x573be2[_0x4a00('0x31')],_0x1abd99['filters']),_0x5f190f);if(_0x573be2[_0x4a00('0x31')]['filter']){_0x26f5cb[_0x4a00('0x3c')]=_[_0x4a00('0x3d')](_0x26f5cb[_0x4a00('0x3c')],{'$or':_[_0x4a00('0x3e')](_0x5f190f,function(_0x1139b9){if(_0x1139b9[_0x4a00('0x2f')]!==_0x4a00('0x3f')){var _0xe5b624={};_0xe5b624[_0x1139b9[_0x4a00('0x29')]]={'$like':'%'+_0x573be2['query'][_0x4a00('0x40')]+'%'};return _0xe5b624;}})});}_0x26f5cb=_[_0x4a00('0x3d')]({},_0x26f5cb,_0x573be2[_0x4a00('0x41')]);var _0x6fd122={'where':_0x26f5cb[_0x4a00('0x3c')]};return db[_0x4a00('0x2c')][_0x4a00('0x1b')](_0x6fd122)[_0x4a00('0x23')](function(_0x4cabed){_0x1003d1[_0x4a00('0x1b')]=_0x4cabed;if(_0x573be2['query'][_0x4a00('0x42')]){_0x26f5cb[_0x4a00('0x43')]=[{'all':!![]}];}return db['UserProfileSection']['findAll'](_0x26f5cb);})[_0x4a00('0x23')](function(_0x2f094d){_0x1003d1['rows']=_0x2f094d;return _0x1003d1;})[_0x4a00('0x23')](respondWithFilteredResult(_0x3f4332,_0x26f5cb))[_0x4a00('0x44')](handleError(_0x3f4332,null));};exports['show']=function(_0x809a2,_0x4a7af7){var _0x2ffa6b={'raw':![],'where':{'id':_0x809a2[_0x4a00('0x45')]['id']}},_0x516e59={};_0x516e59[_0x4a00('0x34')]=_[_0x4a00('0x46')](db[_0x4a00('0x2c')]['rawAttributes']);_0x516e59[_0x4a00('0x31')]=_['keys'](_0x809a2['query']);_0x516e59[_0x4a00('0x32')]=_[_0x4a00('0x33')](_0x516e59[_0x4a00('0x34')],_0x516e59[_0x4a00('0x31')]);_0x2ffa6b[_0x4a00('0x36')]=_[_0x4a00('0x33')](_0x516e59[_0x4a00('0x34')],qs[_0x4a00('0x35')](_0x809a2[_0x4a00('0x31')]['fields']));_0x2ffa6b['attributes']=_0x2ffa6b[_0x4a00('0x36')][_0x4a00('0x37')]?_0x2ffa6b[_0x4a00('0x36')]:_0x516e59[_0x4a00('0x34')];if(_0x809a2[_0x4a00('0x31')][_0x4a00('0x42')]){_0x2ffa6b[_0x4a00('0x43')]=[{'all':!![]}];}_0x2ffa6b=_[_0x4a00('0x3d')]({},_0x2ffa6b,_0x809a2[_0x4a00('0x41')]);return db[_0x4a00('0x2c')][_0x4a00('0x47')](_0x2ffa6b)['then'](handleEntityNotFound(_0x4a7af7,null))[_0x4a00('0x23')](respondWithResult(_0x4a7af7,null))['catch'](handleError(_0x4a7af7,null));};exports[_0x4a00('0x48')]=function(_0x358159,_0x4689f0){return db[_0x4a00('0x2c')][_0x4a00('0x48')](_0x358159[_0x4a00('0x49')],{})[_0x4a00('0x23')](respondWithResult(_0x4689f0,0xc9))[_0x4a00('0x44')](handleError(_0x4689f0,null));};exports[_0x4a00('0x22')]=function(_0x3fbf43,_0xa71c1f){if(_0x3fbf43[_0x4a00('0x49')]['id']){delete _0x3fbf43[_0x4a00('0x49')]['id'];}return db[_0x4a00('0x2c')][_0x4a00('0x47')]({'where':{'id':_0x3fbf43[_0x4a00('0x45')]['id']}})['then'](handleEntityNotFound(_0xa71c1f,null))[_0x4a00('0x23')](saveUpdates(_0x3fbf43[_0x4a00('0x49')],null))[_0x4a00('0x23')](respondWithResult(_0xa71c1f,null))[_0x4a00('0x44')](handleError(_0xa71c1f,null));};exports['destroy']=function(_0x22abc3,_0x1d63f3){return db[_0x4a00('0x2c')]['find']({'where':{'id':_0x22abc3[_0x4a00('0x45')]['id']}})[_0x4a00('0x23')](handleEntityNotFound(_0x1d63f3,null))[_0x4a00('0x23')](removeEntity(_0x1d63f3,null))[_0x4a00('0x44')](handleError(_0x1d63f3,null));};exports[_0x4a00('0x4a')]=function(_0x43acfd,_0xe6d66d){return db['UserProfileSection'][_0x4a00('0x4a')]()[_0x4a00('0x23')](respondWithResult(_0xe6d66d,null))['catch'](handleError(_0xe6d66d,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index be3b101..5f5fe7e 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 _0x56de=['bluebird','request-promise','rimraf','../../config/environment','./userProfileSection.attributes','exports','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','api','moment'];(function(_0x35b88f,_0x3432b8){var _0x2440bb=function(_0x252861){while(--_0x252861){_0x35b88f['push'](_0x35b88f['shift']());}};_0x2440bb(++_0x3432b8);}(_0x56de,0x123));var _0xe56d=function(_0x4bfbbf,_0x35a65f){_0x4bfbbf=_0x4bfbbf-0x0;var _0x118c93=_0x56de[_0x4bfbbf];return _0x118c93;};'use strict';var _=require(_0xe56d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe56d('0x1'));var moment=require(_0xe56d('0x2'));var BPromise=require(_0xe56d('0x3'));var rp=require(_0xe56d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe56d('0x5'));var config=require(_0xe56d('0x6'));var attributes=require(_0xe56d('0x7'));module[_0xe56d('0x8')]=function(_0x34b746,_0x266bc1){return _0x34b746['define'](_0xe56d('0x9'),attributes,{'tableName':_0xe56d('0xa'),'paranoid':![],'indexes':[{'name':_0xe56d('0xb'),'fields':[_0xe56d('0xc'),_0xe56d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x413c=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./userProfileSection.attributes','define','compositeIndex','sectionId','userProfileId'];(function(_0x551f1a,_0x40d0af){var _0x508697=function(_0x58d30e){while(--_0x58d30e){_0x551f1a['push'](_0x551f1a['shift']());}};_0x508697(++_0x40d0af);}(_0x413c,0x104));var _0xc413=function(_0x3dcb8d,_0x3187a7){_0x3dcb8d=_0x3dcb8d-0x0;var _0x49d82f=_0x413c[_0x3dcb8d];return _0x49d82f;};'use strict';var _=require(_0xc413('0x0'));var util=require(_0xc413('0x1'));var logger=require(_0xc413('0x2'))(_0xc413('0x3'));var moment=require(_0xc413('0x4'));var BPromise=require(_0xc413('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc413('0x6'));var rimraf=require(_0xc413('0x7'));var config=require('../../config/environment');var attributes=require(_0xc413('0x8'));module['exports']=function(_0x4d6be1,_0x8c6855){return _0x4d6be1[_0xc413('0x9')]('UserProfileSection',attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0xc413('0xa'),'fields':[_0xc413('0xb'),_0xc413('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index ca43c64..0455f70 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 _0xca6c=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0x25b6d7,_0x118288){var _0x4a70af=function(_0x321635){while(--_0x321635){_0x25b6d7['push'](_0x25b6d7['shift']());}};_0x4a70af(++_0x118288);}(_0xca6c,0x1c9));var _0xcca6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xca6c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcca6('0x0'));var util=require('util');var moment=require(_0xcca6('0x1'));var BPromise=require(_0xcca6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcca6('0x3'));var db=require(_0xcca6('0x4'))['db'];var utils=require(_0xcca6('0x5'));var logger=require(_0xcca6('0x6'))(_0xcca6('0x7'));var config=require(_0xcca6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcca6('0x9')][_0xcca6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a93a1,_0x383602,_0x26cd91){return new BPromise(function(_0x6408a5,_0xb0035){return client[_0xcca6('0xb')](_0x5a93a1,_0x26cd91)[_0xcca6('0xc')](function(_0x36aece){logger[_0xcca6('0xd')](_0xcca6('0xe'),_0x383602,_0xcca6('0xf'));logger[_0xcca6('0x10')](_0xcca6('0x11'),_0x383602,'request\x20sent',JSON[_0xcca6('0x12')](_0x36aece));if(_0x36aece['error']){if(_0x36aece[_0xcca6('0x13')]['code']===0x1f4){logger[_0xcca6('0x13')](_0xcca6('0xe'),_0x383602,_0x36aece['error']['message']);return _0xb0035(_0x36aece[_0xcca6('0x13')]['message']);}logger['error'](_0xcca6('0xe'),_0x383602,_0x36aece['error'][_0xcca6('0x14')]);return _0x6408a5(_0x36aece['error'][_0xcca6('0x14')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x383602,_0xcca6('0xf'));_0x6408a5(_0x36aece['result'][_0xcca6('0x14')]);}})[_0xcca6('0x15')](function(_0x4821ed){logger[_0xcca6('0x13')]('UserProfileSection,\x20%s,\x20%s',_0x383602,_0x4821ed);_0xb0035(_0x4821ed);});});} \ No newline at end of file +var _0xd072=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x135fb4,_0x50e172){var _0x1b7f11=function(_0x3d10e0){while(--_0x3d10e0){_0x135fb4['push'](_0x135fb4['shift']());}};_0x1b7f11(++_0x50e172);}(_0xd072,0x132));var _0x2d07=function(_0x446564,_0x193171){_0x446564=_0x446564-0x0;var _0x15461c=_0xd072[_0x446564];return _0x15461c;};'use strict';var _=require(_0x2d07('0x0'));var util=require(_0x2d07('0x1'));var moment=require(_0x2d07('0x2'));var BPromise=require(_0x2d07('0x3'));var rs=require(_0x2d07('0x4'));var fs=require('fs');var Redis=require(_0x2d07('0x5'));var db=require(_0x2d07('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2d07('0x7'))(_0x2d07('0x8'));var config=require(_0x2d07('0x9'));var jayson=require(_0x2d07('0xa'));var client=jayson[_0x2d07('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a992a,_0x429d2c,_0x367834){return new BPromise(function(_0x19d04c,_0x167c61){return client[_0x2d07('0xc')](_0x1a992a,_0x367834)[_0x2d07('0xd')](function(_0x4bcba8){logger[_0x2d07('0xe')](_0x2d07('0xf'),_0x429d2c,_0x2d07('0x10'));logger[_0x2d07('0x11')](_0x2d07('0x12'),_0x429d2c,_0x2d07('0x10'),JSON[_0x2d07('0x13')](_0x4bcba8));if(_0x4bcba8[_0x2d07('0x14')]){if(_0x4bcba8[_0x2d07('0x14')][_0x2d07('0x15')]===0x1f4){logger[_0x2d07('0x14')](_0x2d07('0xf'),_0x429d2c,_0x4bcba8[_0x2d07('0x14')][_0x2d07('0x16')]);return _0x167c61(_0x4bcba8[_0x2d07('0x14')][_0x2d07('0x16')]);}logger[_0x2d07('0x14')](_0x2d07('0xf'),_0x429d2c,_0x4bcba8[_0x2d07('0x14')][_0x2d07('0x16')]);return _0x19d04c(_0x4bcba8[_0x2d07('0x14')][_0x2d07('0x16')]);}else{logger[_0x2d07('0xe')](_0x2d07('0xf'),_0x429d2c,_0x2d07('0x10'));_0x19d04c(_0x4bcba8['result'][_0x2d07('0x16')]);}})[_0x2d07('0x17')](function(_0x3d47e5){logger[_0x2d07('0x14')](_0x2d07('0xf'),_0x429d2c,_0x3d47e5);_0x167c61(_0x3d47e5);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 54d6f20..143a3ce 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x22ee70,_0x48ffab){var _0x38a75a=function(_0x3200dd){while(--_0x3200dd){_0x22ee70['push'](_0x22ee70['shift']());}};_0x38a75a(++_0x48ffab);}(_0x70e0,0x17b));var _0x070e=function(_0x3591f9,_0x5b3a11){_0x3591f9=_0x3591f9-0x0;var _0x27452f=_0x70e0[_0x3591f9];return _0x27452f;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2bf5f2,_0x36b1cb){var _0x24335a=function(_0x157c5f){while(--_0x157c5f){_0x2bf5f2['push'](_0x2bf5f2['shift']());}};_0x24335a(++_0x36b1cb);}(_0x9c44,0x178));var _0x49c4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9c44[_0x465a0c];return _0x1e202e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index b399991..9c05bb3 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 _0x3f14=['sequelize','exports','INTEGER'];(function(_0x4d5625,_0x4aadb2){var _0x30f1ca=function(_0x44c80c){while(--_0x44c80c){_0x4d5625['push'](_0x4d5625['shift']());}};_0x30f1ca(++_0x4aadb2);}(_0x3f14,0x87));var _0x43f1=function(_0xff5df6,_0x514e73){_0xff5df6=_0xff5df6-0x0;var _0x2634bb=_0x3f14[_0xff5df6];return _0x2634bb;};'use strict';var Sequelize=require(_0x43f1('0x0'));module[_0x43f1('0x1')]={'penalty':{'type':Sequelize[_0x43f1('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7499=['sequelize','exports'];(function(_0xaa55c2,_0x19c329){var _0x2a9891=function(_0x1cfd73){while(--_0x1cfd73){_0xaa55c2['push'](_0xaa55c2['shift']());}};_0x2a9891(++_0x19c329);}(_0x7499,0x162));var _0x9749=function(_0xd98ca3,_0x38fbd9){_0xd98ca3=_0xd98ca3-0x0;var _0x35960d=_0x7499[_0xd98ca3];return _0x35960d;};'use strict';var Sequelize=require(_0x9749('0x0'));module[_0x9749('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 6913773..0bb7886 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 _0x33af=['request-promise','path','rimraf','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','util','api','moment','bluebird'];(function(_0x5b6cf1,_0x32fdcd){var _0x46278c=function(_0x53fd9b){while(--_0x53fd9b){_0x5b6cf1['push'](_0x5b6cf1['shift']());}};_0x46278c(++_0x32fdcd);}(_0x33af,0xec));var _0xf33a=function(_0x934754,_0x15bd40){_0x934754=_0x934754-0x0;var _0x5cf1fc=_0x33af[_0x934754];return _0x5cf1fc;};'use strict';var _=require('lodash');var util=require(_0xf33a('0x0'));var logger=require('../../config/logger')(_0xf33a('0x1'));var moment=require(_0xf33a('0x2'));var BPromise=require(_0xf33a('0x3'));var rp=require(_0xf33a('0x4'));var fs=require('fs');var path=require(_0xf33a('0x5'));var rimraf=require(_0xf33a('0x6'));var config=require('../../config/environment');var attributes=require(_0xf33a('0x7'));module[_0xf33a('0x8')]=function(_0x583e54,_0xc0dd13){return _0x583e54[_0xf33a('0x9')](_0xf33a('0xa'),attributes,{'tableName':_0xf33a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1261=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','define','user_has_sms_queues'];(function(_0x12f78e,_0x2e9d7b){var _0x4a7241=function(_0x21c1f7){while(--_0x21c1f7){_0x12f78e['push'](_0x12f78e['shift']());}};_0x4a7241(++_0x2e9d7b);}(_0x1261,0x144));var _0x1126=function(_0xc6299d,_0x4e893e){_0xc6299d=_0xc6299d-0x0;var _0x278de4=_0x1261[_0xc6299d];return _0x278de4;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('UserSmsQueue',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 7ede4c2..d252e2f 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 _0x1030=['result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x952708,_0x4fd8e0){var _0x17724f=function(_0x1616a7){while(--_0x1616a7){_0x952708['push'](_0x952708['shift']());}};_0x17724f(++_0x4fd8e0);}(_0x1030,0x189));var _0x0103=function(_0x5dbc6d,_0x159509){_0x5dbc6d=_0x5dbc6d-0x0;var _0x591f2f=_0x1030[_0x5dbc6d];return _0x591f2f;};'use strict';var _=require(_0x0103('0x0'));var util=require(_0x0103('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0103('0x2'));var fs=require('fs');var Redis=require(_0x0103('0x3'));var db=require(_0x0103('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0103('0x5'))(_0x0103('0x6'));var config=require(_0x0103('0x7'));var jayson=require(_0x0103('0x8'));var client=jayson[_0x0103('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12dfd2,_0x1375dd,_0x2a908c){return new BPromise(function(_0x18cd11,_0x485ee6){return client[_0x0103('0xa')](_0x12dfd2,_0x2a908c)[_0x0103('0xb')](function(_0x23d880){logger['info'](_0x0103('0xc'),_0x1375dd,_0x0103('0xd'));logger[_0x0103('0xe')](_0x0103('0xf'),_0x1375dd,'request\x20sent',JSON[_0x0103('0x10')](_0x23d880));if(_0x23d880['error']){if(_0x23d880[_0x0103('0x11')][_0x0103('0x12')]===0x1f4){logger[_0x0103('0x11')](_0x0103('0xc'),_0x1375dd,_0x23d880[_0x0103('0x11')][_0x0103('0x13')]);return _0x485ee6(_0x23d880[_0x0103('0x11')]['message']);}logger['error'](_0x0103('0xc'),_0x1375dd,_0x23d880[_0x0103('0x11')][_0x0103('0x13')]);return _0x18cd11(_0x23d880[_0x0103('0x11')][_0x0103('0x13')]);}else{logger[_0x0103('0x14')](_0x0103('0xc'),_0x1375dd,_0x0103('0xd'));_0x18cd11(_0x23d880[_0x0103('0x15')][_0x0103('0x13')]);}})[_0x0103('0x16')](function(_0xdc57ff){logger['error'](_0x0103('0xc'),_0x1375dd,_0xdc57ff);_0x485ee6(_0xdc57ff);});});} \ No newline at end of file +var _0xe20a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','bluebird','randomstring','ioredis'];(function(_0x5f41ce,_0x3cdebf){var _0x5ad089=function(_0x5e1a26){while(--_0x5e1a26){_0x5f41ce['push'](_0x5f41ce['shift']());}};_0x5ad089(++_0x3cdebf);}(_0xe20a,0xa7));var _0xae20=function(_0x41377d,_0x165011){_0x41377d=_0x41377d-0x0;var _0x24703d=_0xe20a[_0x41377d];return _0x24703d;};'use strict';var _=require(_0xae20('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xae20('0x1'));var rs=require(_0xae20('0x2'));var fs=require('fs');var Redis=require(_0xae20('0x3'));var db=require(_0xae20('0x4'))['db'];var utils=require(_0xae20('0x5'));var logger=require(_0xae20('0x6'))(_0xae20('0x7'));var config=require(_0xae20('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xae20('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xaba725,_0x34a65a,_0x32369c){return new BPromise(function(_0x13b811,_0x4652d3){return client[_0xae20('0xa')](_0xaba725,_0x32369c)['then'](function(_0x4f1cc9){logger[_0xae20('0xb')](_0xae20('0xc'),_0x34a65a,_0xae20('0xd'));logger[_0xae20('0xe')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x34a65a,'request\x20sent',JSON[_0xae20('0xf')](_0x4f1cc9));if(_0x4f1cc9[_0xae20('0x10')]){if(_0x4f1cc9[_0xae20('0x10')]['code']===0x1f4){logger['error'](_0xae20('0xc'),_0x34a65a,_0x4f1cc9[_0xae20('0x10')]['message']);return _0x4652d3(_0x4f1cc9[_0xae20('0x10')][_0xae20('0x11')]);}logger[_0xae20('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x34a65a,_0x4f1cc9[_0xae20('0x10')][_0xae20('0x11')]);return _0x13b811(_0x4f1cc9[_0xae20('0x10')][_0xae20('0x11')]);}else{logger[_0xae20('0xb')](_0xae20('0xc'),_0x34a65a,_0xae20('0xd'));_0x13b811(_0x4f1cc9['result'][_0xae20('0x11')]);}})[_0xae20('0x12')](function(_0x543d05){logger['error'](_0xae20('0xc'),_0x34a65a,_0x543d05);_0x4652d3(_0x543d05);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index ed8ffed..cd82c18 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.attributes.js +++ b/server/api/userVoicePrefix/userVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe40d=['INTEGER','exports'];(function(_0x266bf1,_0x25006f){var _0x170de6=function(_0x1a6a3f){while(--_0x1a6a3f){_0x266bf1['push'](_0x266bf1['shift']());}};_0x170de6(++_0x25006f);}(_0xe40d,0x1d5));var _0xde40=function(_0x2be03c,_0x21134a){_0x2be03c=_0x2be03c-0x0;var _0x9eb45b=_0xe40d[_0x2be03c];return _0x9eb45b;};'use strict';var Sequelize=require('sequelize');module[_0xde40('0x0')]={'UserId':{'type':Sequelize[_0xde40('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x72f8=['INTEGER','sequelize','exports'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x72f8,0x19c));var _0x872f=function(_0x2c7dc6,_0x3c4ce0){_0x2c7dc6=_0x2c7dc6-0x0;var _0x10002b=_0x72f8[_0x2c7dc6];return _0x10002b;};'use strict';var Sequelize=require(_0x872f('0x0'));module[_0x872f('0x1')]={'UserId':{'type':Sequelize[_0x872f('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index c058e8c..89f61ff 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.model.js +++ b/server/api/userVoicePrefix/userVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x1fdb19,_0x40e5e9){var _0x259153=function(_0x5bac67){while(--_0x5bac67){_0x1fdb19['push'](_0x1fdb19['shift']());}};_0x259153(++_0x40e5e9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x148efa,_0x2e99cc){var _0x55d4a9=function(_0x3bbda2){while(--_0x3bbda2){_0x148efa['push'](_0x148efa['shift']());}};_0x55d4a9(++_0x2e99cc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 1a33aaa..3f45d7d 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x33fe50,_0x1464c8){var _0x20b544=function(_0x9becc5){while(--_0x9becc5){_0x33fe50['push'](_0x33fe50['shift']());}};_0x20b544(++_0x1464c8);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x18c9ab,_0x6ba7e7){var _0x17fc37=function(_0x57783c){while(--_0x57783c){_0x18c9ab['push'](_0x18c9ab['shift']());}};_0x17fc37(++_0x6ba7e7);}(_0x9c44,0x178));var _0x49c4=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9c44[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index e153bed..dc5ad74 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 _0xac76=['INTEGER'];(function(_0x189084,_0x5ddb86){var _0x495cf9=function(_0x533b4e){while(--_0x533b4e){_0x189084['push'](_0x189084['shift']());}};_0x495cf9(++_0x5ddb86);}(_0xac76,0x12b));var _0x6ac7=function(_0x1dfe96,_0xacd7bf){_0x1dfe96=_0x1dfe96-0x0;var _0x23bb8a=_0xac76[_0x1dfe96];return _0x23bb8a;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x6ac7('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0xfe7f=['sequelize','exports','INTEGER'];(function(_0x729406,_0x19c3df){var _0x4e9f82=function(_0x4e0d1b){while(--_0x4e0d1b){_0x729406['push'](_0x729406['shift']());}};_0x4e9f82(++_0x19c3df);}(_0xfe7f,0x99));var _0xffe7=function(_0x2a7698,_0x3be6f7){_0x2a7698=_0x2a7698-0x0;var _0x508730=_0xfe7f[_0x2a7698];return _0x508730;};'use strict';var Sequelize=require(_0xffe7('0x0'));module[_0xffe7('0x1')]={'penalty':{'type':Sequelize[_0xffe7('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index ebbcc27..2913023 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 _0xf99a=['moment','bluebird','request-promise','path','rimraf','./userVoiceQueue.attributes','exports','UserVoiceQueue','user_has_voice_queues','../../config/logger'];(function(_0x10fc03,_0x36249b){var _0x2572a7=function(_0x2cf611){while(--_0x2cf611){_0x10fc03['push'](_0x10fc03['shift']());}};_0x2572a7(++_0x36249b);}(_0xf99a,0x15d));var _0xaf99=function(_0x2395a9,_0x133846){_0x2395a9=_0x2395a9-0x0;var _0xaa974b=_0xf99a[_0x2395a9];return _0xaa974b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xaf99('0x0'))('api');var moment=require(_0xaf99('0x1'));var BPromise=require(_0xaf99('0x2'));var rp=require(_0xaf99('0x3'));var fs=require('fs');var path=require(_0xaf99('0x4'));var rimraf=require(_0xaf99('0x5'));var config=require('../../config/environment');var attributes=require(_0xaf99('0x6'));module[_0xaf99('0x7')]=function(_0x5c048c,_0x1b3c96){return _0x5c048c['define'](_0xaf99('0x8'),attributes,{'tableName':_0xaf99('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8452=['user_has_voice_queues','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x72c526,_0x20a693){var _0x593cb9=function(_0x4f5b4b){while(--_0x4f5b4b){_0x72c526['push'](_0x72c526['shift']());}};_0x593cb9(++_0x20a693);}(_0x8452,0x91));var _0x2845=function(_0x2ce9d,_0x4ff962){_0x2ce9d=_0x2ce9d-0x0;var _0x578428=_0x8452[_0x2ce9d];return _0x578428;};'use strict';var _=require(_0x2845('0x0'));var util=require('util');var logger=require(_0x2845('0x1'))(_0x2845('0x2'));var moment=require('moment');var BPromise=require(_0x2845('0x3'));var rp=require(_0x2845('0x4'));var fs=require('fs');var path=require(_0x2845('0x5'));var rimraf=require('rimraf');var config=require(_0x2845('0x6'));var attributes=require('./userVoiceQueue.attributes');module[_0x2845('0x7')]=function(_0x19c5f2,_0x291efd){return _0x19c5f2['define']('UserVoiceQueue',attributes,{'tableName':_0x2845('0x8'),'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 062bb26..bc393e1 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 _0x925f=['error','code','message','UserVoiceQueue,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','info','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x39ba04,_0x49737e){var _0x3cca26=function(_0x535c6d){while(--_0x535c6d){_0x39ba04['push'](_0x39ba04['shift']());}};_0x3cca26(++_0x49737e);}(_0x925f,0x15a));var _0xf925=function(_0x6f041d,_0x4029b4){_0x6f041d=_0x6f041d-0x0;var _0x4609b8=_0x925f[_0x6f041d];return _0x4609b8;};'use strict';var _=require(_0xf925('0x0'));var util=require(_0xf925('0x1'));var moment=require(_0xf925('0x2'));var BPromise=require(_0xf925('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf925('0x4'));var db=require(_0xf925('0x5'))['db'];var utils=require(_0xf925('0x6'));var logger=require('../../config/logger')(_0xf925('0x7'));var config=require(_0xf925('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf925('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45d8ee,_0x12ffe1,_0xb1d81d){return new BPromise(function(_0x4dde90,_0x5d5e9d){return client['request'](_0x45d8ee,_0xb1d81d)['then'](function(_0x286148){logger[_0xf925('0xa')]('UserVoiceQueue,\x20%s,\x20%s',_0x12ffe1,_0xf925('0xb'));logger['debug'](_0xf925('0xc'),_0x12ffe1,_0xf925('0xb'),JSON[_0xf925('0xd')](_0x286148));if(_0x286148['error']){if(_0x286148[_0xf925('0xe')][_0xf925('0xf')]===0x1f4){logger[_0xf925('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x12ffe1,_0x286148[_0xf925('0xe')]['message']);return _0x5d5e9d(_0x286148[_0xf925('0xe')]['message']);}logger[_0xf925('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x12ffe1,_0x286148['error'][_0xf925('0x10')]);return _0x4dde90(_0x286148[_0xf925('0xe')][_0xf925('0x10')]);}else{logger['info'](_0xf925('0x11'),_0x12ffe1,_0xf925('0xb'));_0x4dde90(_0x286148[_0xf925('0x12')][_0xf925('0x10')]);}})[_0xf925('0x13')](function(_0x59ddce){logger[_0xf925('0xe')](_0xf925('0x11'),_0x12ffe1,_0x59ddce);_0x5d5e9d(_0x59ddce);});});} \ No newline at end of file +var _0xa2fe=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x342a3e,_0x473ac9){var _0x506072=function(_0x3587b1){while(--_0x3587b1){_0x342a3e['push'](_0x342a3e['shift']());}};_0x506072(++_0x473ac9);}(_0xa2fe,0x1a1));var _0xea2f=function(_0x4c9d58,_0x1c83f0){_0x4c9d58=_0x4c9d58-0x0;var _0x3ad22d=_0xa2fe[_0x4c9d58];return _0x3ad22d;};'use strict';var _=require(_0xea2f('0x0'));var util=require('util');var moment=require(_0xea2f('0x1'));var BPromise=require('bluebird');var rs=require(_0xea2f('0x2'));var fs=require('fs');var Redis=require(_0xea2f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xea2f('0x4'));var logger=require(_0xea2f('0x5'))(_0xea2f('0x6'));var config=require(_0xea2f('0x7'));var jayson=require(_0xea2f('0x8'));var client=jayson['client'][_0xea2f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c0201,_0x18676f,_0x37eef4){return new BPromise(function(_0x15f4c2,_0x1ae315){return client[_0xea2f('0xa')](_0x5c0201,_0x37eef4)['then'](function(_0x57c01e){logger['info'](_0xea2f('0xb'),_0x18676f,_0xea2f('0xc'));logger[_0xea2f('0xd')](_0xea2f('0xe'),_0x18676f,_0xea2f('0xc'),JSON[_0xea2f('0xf')](_0x57c01e));if(_0x57c01e[_0xea2f('0x10')]){if(_0x57c01e[_0xea2f('0x10')][_0xea2f('0x11')]===0x1f4){logger[_0xea2f('0x10')](_0xea2f('0xb'),_0x18676f,_0x57c01e[_0xea2f('0x10')][_0xea2f('0x12')]);return _0x1ae315(_0x57c01e['error']['message']);}logger[_0xea2f('0x10')](_0xea2f('0xb'),_0x18676f,_0x57c01e[_0xea2f('0x10')][_0xea2f('0x12')]);return _0x15f4c2(_0x57c01e[_0xea2f('0x10')][_0xea2f('0x12')]);}else{logger[_0xea2f('0x13')](_0xea2f('0xb'),_0x18676f,_0xea2f('0xc'));_0x15f4c2(_0x57c01e[_0xea2f('0x14')][_0xea2f('0x12')]);}})[_0xea2f('0x15')](function(_0x455c3c){logger[_0xea2f('0x10')](_0xea2f('0xb'),_0x18676f,_0x455c3c);_0x1ae315(_0x455c3c);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index c67e0d6..76a433d 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4e6a1f,_0x41698c){var _0xe52f59=function(_0x31f882){while(--_0x31f882){_0x4e6a1f['push'](_0x4e6a1f['shift']());}};_0xe52f59(++_0x41698c);}(_0x70e0,0x17b));var _0x070e=function(_0xf25ef8,_0x268db4){_0xf25ef8=_0xf25ef8-0x0;var _0x22f4ef=_0x70e0[_0xf25ef8];return _0x22f4ef;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x571f8e,_0x28b6ec){var _0x25061e=function(_0x38cbb0){while(--_0x38cbb0){_0x571f8e['push'](_0x571f8e['shift']());}};_0x25061e(++_0x28b6ec);}(_0x70e0,0x17b));var _0x070e=function(_0x3b36d9,_0x48ae4e){_0x3b36d9=_0x3b36d9-0x0;var _0x1389af=_0x70e0[_0x3b36d9];return _0x1389af;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 5b4d466..850ef75 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 _0x9688=['queue_interface','exports','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x1ec2ee,_0x35bed8){var _0x34ccae=function(_0x8c389e){while(--_0x8c389e){_0x1ec2ee['push'](_0x1ec2ee['shift']());}};_0x34ccae(++_0x35bed8);}(_0x9688,0xce));var _0x8968=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9688[_0x422905];return _0x33dc6c;};'use strict';var Sequelize=require('sequelize');module[_0x8968('0x0')]={'uniqueid':{'type':Sequelize[_0x8968('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x8968('0x2')},'membername':{'type':Sequelize[_0x8968('0x3')],'allowNull':![],'comment':_0x8968('0x2')},'UserId':{'type':Sequelize[_0x8968('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8968('0x4'),'comment':_0x8968('0x2')},'VoiceQueueId':{'type':Sequelize[_0x8968('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x8968('0x3')],'allowNull':![],'unique':_0x8968('0x4'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x8968('0x2')},'paused':{'type':Sequelize[_0x8968('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0xea78=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0xa28c8f,_0x4ab22f){var _0x5964bb=function(_0x28e924){while(--_0x28e924){_0xa28c8f['push'](_0xa28c8f['shift']());}};_0x5964bb(++_0x4ab22f);}(_0xea78,0x162));var _0x8ea7=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xea78[_0x11005e];return _0x29338f;};'use strict';var Sequelize=require(_0x8ea7('0x0'));module[_0x8ea7('0x1')]={'uniqueid':{'type':Sequelize[_0x8ea7('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x8ea7('0x3')},'UserId':{'type':Sequelize[_0x8ea7('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x8ea7('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0x8ea7('0x3')},'VoiceQueueId':{'type':Sequelize[_0x8ea7('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8ea7('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x8ea7('0x2')](0xb),'defaultValue':0x0,'comment':_0x8ea7('0x3')},'paused':{'type':Sequelize[_0x8ea7('0x2')](0xb),'defaultValue':0x0,'comment':_0x8ea7('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index cea3812..e1b05cd 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 _0x20be=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','UserVoiceQueueRt'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x20be,0x8e));var _0xe20b=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x20be[_0xfae23b];return _0x200640;};'use strict';var EventEmitter=require(_0xe20b('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0xe20b('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xe20b('0x2')](0x0);var events={'afterCreate':_0xe20b('0x3'),'afterUpdate':_0xe20b('0x4'),'afterDestroy':_0xe20b('0x5')};function emitEvent(_0x4dddc1){return function(_0xfbace3,_0x5afff3,_0xed3ed1){UserVoiceQueueRtEvents[_0xe20b('0x6')](_0x4dddc1+':'+_0xfbace3['id'],_0xfbace3);UserVoiceQueueRtEvents[_0xe20b('0x6')](_0x4dddc1,_0xfbace3);_0xed3ed1(null);};}for(var e in events){if(events[_0xe20b('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0xe20b('0x8')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x8f7e=['../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x1cb81c,_0x429ed1){var _0x38a2af=function(_0x31c222){while(--_0x31c222){_0x1cb81c['push'](_0x1cb81c['shift']());}};_0x38a2af(++_0x429ed1);}(_0x8f7e,0x1e9));var _0xe8f7=function(_0x2e3ccb,_0x2caa85){_0x2e3ccb=_0x2e3ccb-0x0;var _0x68b4f0=_0x8f7e[_0x2e3ccb];return _0x68b4f0;};'use strict';var EventEmitter=require(_0xe8f7('0x0'));var UserVoiceQueueRt=require(_0xe8f7('0x1'))['db'][_0xe8f7('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xe8f7('0x3')](0x0);var events={'afterCreate':_0xe8f7('0x4'),'afterUpdate':_0xe8f7('0x5'),'afterDestroy':_0xe8f7('0x6')};function emitEvent(_0x57a1ca){return function(_0x56ee81,_0x3c4a13,_0x553d47){UserVoiceQueueRtEvents[_0xe8f7('0x7')](_0x57a1ca+':'+_0x56ee81['id'],_0x56ee81);UserVoiceQueueRtEvents['emit'](_0x57a1ca,_0x56ee81);_0x553d47(null);};}for(var e in events){if(events[_0xe8f7('0x8')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0xe8f7('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 2032f1a..adf3c7b 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 _0xdcd3=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt'];(function(_0x17ccbf,_0x4933e3){var _0x35ebc4=function(_0x4c05b4){while(--_0x4c05b4){_0x17ccbf['push'](_0x17ccbf['shift']());}};_0x35ebc4(++_0x4933e3);}(_0xdcd3,0x12c));var _0x3dcd=function(_0x429a5a,_0x2ebde8){_0x429a5a=_0x429a5a-0x0;var _0x2a22f8=_0xdcd3[_0x429a5a];return _0x2a22f8;};'use strict';var _=require('lodash');var util=require(_0x3dcd('0x0'));var logger=require(_0x3dcd('0x1'))('api');var moment=require(_0x3dcd('0x2'));var BPromise=require(_0x3dcd('0x3'));var rp=require(_0x3dcd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3dcd('0x5'));var config=require(_0x3dcd('0x6'));var attributes=require(_0x3dcd('0x7'));module[_0x3dcd('0x8')]=function(_0x4721a8,_0x355fd2){return _0x4721a8[_0x3dcd('0x9')](_0x3dcd('0xa'),attributes,{'tableName':_0x3dcd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x52b7=['define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./userVoiceQueueRt.attributes','exports'];(function(_0x5ee823,_0x24650b){var _0x209bd2=function(_0xa72379){while(--_0xa72379){_0x5ee823['push'](_0x5ee823['shift']());}};_0x209bd2(++_0x24650b);}(_0x52b7,0x9f));var _0x752b=function(_0x31aefb,_0x1df648){_0x31aefb=_0x31aefb-0x0;var _0x16cda6=_0x52b7[_0x31aefb];return _0x16cda6;};'use strict';var _=require(_0x752b('0x0'));var util=require(_0x752b('0x1'));var logger=require(_0x752b('0x2'))(_0x752b('0x3'));var moment=require(_0x752b('0x4'));var BPromise=require('bluebird');var rp=require(_0x752b('0x5'));var fs=require('fs');var path=require(_0x752b('0x6'));var rimraf=require('rimraf');var config=require(_0x752b('0x7'));var attributes=require(_0x752b('0x8'));module[_0x752b('0x9')]=function(_0x42642e,_0x37a614){return _0x42642e[_0x752b('0xa')](_0x752b('0xb'),attributes,{'tableName':_0x752b('0xc'),'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 ff12e78..fb33be2 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 _0x884e=['`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','info','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','register','then','request\x20sent','debug','stringify','error','UserVoiceQueueRt,\x20%s,\x20%s','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','literal'];(function(_0x1e2321,_0x3ae1c5){var _0x1d346d=function(_0x24f171){while(--_0x24f171){_0x1e2321['push'](_0x1e2321['shift']());}};_0x1d346d(++_0x3ae1c5);}(_0x884e,0x13e));var _0xe884=function(_0xe8f14a,_0x58b807){_0xe8f14a=_0xe8f14a-0x0;var _0x521c0c=_0x884e[_0xe8f14a];return _0x521c0c;};'use strict';var _=require(_0xe884('0x0'));var util=require(_0xe884('0x1'));var moment=require(_0xe884('0x2'));var BPromise=require('bluebird');var rs=require(_0xe884('0x3'));var fs=require('fs');var Redis=require(_0xe884('0x4'));var db=require(_0xe884('0x5'))['db'];var utils=require(_0xe884('0x6'));var logger=require('../../config/logger')(_0xe884('0x7'));var config=require('../../config/environment');var jayson=require(_0xe884('0x8'));var client=jayson['client'][_0xe884('0x9')]({'port':0x232a});config[_0xe884('0xa')]=_[_0xe884('0xb')](config[_0xe884('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xe884('0xc'))(new Redis(config[_0xe884('0xa')]));require(_0xe884('0xd'))[_0xe884('0xe')](socket);function respondWithRpcPromise(_0x1addcf,_0x4808b0,_0x450810){return new BPromise(function(_0x2f91ce,_0x4a96a8){return client['request'](_0x1addcf,_0x450810)[_0xe884('0xf')](function(_0x583cbc){logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x4808b0,_0xe884('0x10'));logger[_0xe884('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x4808b0,'request\x20sent',JSON[_0xe884('0x12')](_0x583cbc));if(_0x583cbc['error']){if(_0x583cbc[_0xe884('0x13')]['code']===0x1f4){logger[_0xe884('0x13')](_0xe884('0x14'),_0x4808b0,_0x583cbc[_0xe884('0x13')][_0xe884('0x15')]);return _0x4a96a8(_0x583cbc[_0xe884('0x13')]['message']);}logger[_0xe884('0x13')](_0xe884('0x14'),_0x4808b0,_0x583cbc[_0xe884('0x13')][_0xe884('0x15')]);return _0x2f91ce(_0x583cbc[_0xe884('0x13')][_0xe884('0x15')]);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x4808b0,_0xe884('0x10'));_0x2f91ce(_0x583cbc[_0xe884('0x16')][_0xe884('0x15')]);}})[_0xe884('0x17')](function(_0x4a4a50){logger[_0xe884('0x13')](_0xe884('0x14'),_0x4808b0,_0x4a4a50);_0x4a96a8(_0x4a4a50);});});}exports[_0xe884('0x18')]=function(_0x529784){var _0x53dcc1=this;return new Promise(function(_0x70b693,_0x1a6fee){return db[_0xe884('0x19')][_0xe884('0x1a')]({'raw':_0x529784[_0xe884('0x1b')]?_0x529784[_0xe884('0x1b')][_0xe884('0x1c')]===undefined?!![]:![]:!![],'where':_0x529784[_0xe884('0x1b')]?_0x529784[_0xe884('0x1b')][_0xe884('0x1d')]||null:null,'attributes':[[db[_0xe884('0x1e')]['fn']('COUNT',db[_0xe884('0x1e')]['fn']('IF',db['sequelize'][_0xe884('0x1f')](_0xe884('0x20')))),_0xe884('0x21')]]})[_0xe884('0xf')](function(_0x3c5b6f){logger[_0xe884('0x22')]('GetVoiceQueueRtPauses',_0x529784);logger['debug'](_0xe884('0x18'),_0x529784,JSON['stringify'](_0x3c5b6f));_0x70b693(_0x3c5b6f);})[_0xe884('0x17')](function(_0x41a991){logger[_0xe884('0x13')](_0xe884('0x18'),_0x41a991[_0xe884('0x15')],_0x529784);_0x1a6fee(_0x53dcc1[_0xe884('0x13')](0x1f4,_0x41a991['message']));});});}; \ No newline at end of file +var _0xb0c1=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request','info','UserVoiceQueueRt,\x20%s,\x20%s','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','options','raw','where','sequelize','literal','outboundQueuePauses','then','GetVoiceQueueRtPauses','util','randomstring'];(function(_0x443cef,_0x2cd289){var _0x147c47=function(_0x56c979){while(--_0x56c979){_0x443cef['push'](_0x443cef['shift']());}};_0x147c47(++_0x2cd289);}(_0xb0c1,0x9e));var _0x1b0c=function(_0x79fea2,_0xa7d847){_0x79fea2=_0x79fea2-0x0;var _0x286a50=_0xb0c1[_0x79fea2];return _0x286a50;};'use strict';var _=require('lodash');var util=require(_0x1b0c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1b0c('0x1'));var fs=require('fs');var Redis=require(_0x1b0c('0x2'));var db=require(_0x1b0c('0x3'))['db'];var utils=require(_0x1b0c('0x4'));var logger=require(_0x1b0c('0x5'))(_0x1b0c('0x6'));var config=require('../../config/environment');var jayson=require(_0x1b0c('0x7'));var client=jayson['client'][_0x1b0c('0x8')]({'port':0x232a});config[_0x1b0c('0x9')]=_[_0x1b0c('0xa')](config[_0x1b0c('0x9')],{'host':_0x1b0c('0xb'),'port':0x18eb});var socket=require(_0x1b0c('0xc'))(new Redis(config[_0x1b0c('0x9')]));require(_0x1b0c('0xd'))['register'](socket);function respondWithRpcPromise(_0x4c00c5,_0x5adf3b,_0x5e6cfb){return new BPromise(function(_0x4b8998,_0x47dbbe){return client[_0x1b0c('0xe')](_0x4c00c5,_0x5e6cfb)['then'](function(_0x5dfadd){logger[_0x1b0c('0xf')](_0x1b0c('0x10'),_0x5adf3b,'request\x20sent');logger['debug'](_0x1b0c('0x11'),_0x5adf3b,_0x1b0c('0x12'),JSON[_0x1b0c('0x13')](_0x5dfadd));if(_0x5dfadd[_0x1b0c('0x14')]){if(_0x5dfadd['error'][_0x1b0c('0x15')]===0x1f4){logger[_0x1b0c('0x14')](_0x1b0c('0x10'),_0x5adf3b,_0x5dfadd[_0x1b0c('0x14')][_0x1b0c('0x16')]);return _0x47dbbe(_0x5dfadd['error'][_0x1b0c('0x16')]);}logger[_0x1b0c('0x14')](_0x1b0c('0x10'),_0x5adf3b,_0x5dfadd['error'][_0x1b0c('0x16')]);return _0x4b8998(_0x5dfadd['error'][_0x1b0c('0x16')]);}else{logger[_0x1b0c('0xf')](_0x1b0c('0x10'),_0x5adf3b,_0x1b0c('0x12'));_0x4b8998(_0x5dfadd['result']['message']);}})[_0x1b0c('0x17')](function(_0x3c3f06){logger[_0x1b0c('0x14')](_0x1b0c('0x10'),_0x5adf3b,_0x3c3f06);_0x47dbbe(_0x3c3f06);});});}exports['GetVoiceQueueRtPauses']=function(_0x32c8fb){var _0x4d9b16=this;return new Promise(function(_0x5b51a8,_0x4ddfe9){return db['UserVoiceQueueRt']['findAll']({'raw':_0x32c8fb[_0x1b0c('0x18')]?_0x32c8fb[_0x1b0c('0x18')][_0x1b0c('0x19')]===undefined?!![]:![]:!![],'where':_0x32c8fb[_0x1b0c('0x18')]?_0x32c8fb[_0x1b0c('0x18')][_0x1b0c('0x1a')]||null:null,'attributes':[[db[_0x1b0c('0x1b')]['fn']('COUNT',db[_0x1b0c('0x1b')]['fn']('IF',db['sequelize'][_0x1b0c('0x1c')]('`paused`\x20=\x201,\x201,\x20null'))),_0x1b0c('0x1d')]]})[_0x1b0c('0x1e')](function(_0x193355){logger[_0x1b0c('0xf')]('GetVoiceQueueRtPauses',_0x32c8fb);logger['debug'](_0x1b0c('0x1f'),_0x32c8fb,JSON['stringify'](_0x193355));_0x5b51a8(_0x193355);})[_0x1b0c('0x17')](function(_0x1aa96c){logger['error'](_0x1b0c('0x1f'),_0x1aa96c[_0x1b0c('0x16')],_0x32c8fb);_0x4ddfe9(_0x4d9b16[_0x1b0c('0x14')](0x1f4,_0x1aa96c['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 883e2fd..69b7822 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 _0xc359=['emit','register','userVoiceQueueRt:','save','update'];(function(_0x5c5c23,_0x52e384){var _0x218324=function(_0x5299c2){while(--_0x5299c2){_0x5c5c23['push'](_0x5c5c23['shift']());}};_0x218324(++_0x52e384);}(_0xc359,0x1d9));var _0x9c35=function(_0x4b6830,_0x2bf6fb){_0x4b6830=_0x4b6830-0x0;var _0x239e4a=_0xc359[_0x4b6830];return _0x239e4a;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x9c35('0x0'),'remove',_0x9c35('0x1')];function createListener(_0x9e8600,_0xf6c007){return function(_0x47cf0e){_0xf6c007[_0x9c35('0x2')](_0x9e8600,_0x47cf0e);};}function removeListener(_0x53a490,_0x1540b4){return function(){UserVoiceQueueRtEvents['removeListener'](_0x53a490,_0x1540b4);};}exports[_0x9c35('0x3')]=function(_0x5b3ada){for(var _0x490409=0x0,_0x53d9d7=events['length'];_0x490409<_0x53d9d7;_0x490409++){var _0x279ba9=events[_0x490409];var _0x2993da=createListener(_0x9c35('0x4')+_0x279ba9,_0x5b3ada);UserVoiceQueueRtEvents['on'](_0x279ba9,_0x2993da);}}; \ No newline at end of file +var _0xd6bb=['update','removeListener','length','userVoiceQueueRt:','./userVoiceQueueRt.events','remove'];(function(_0x4d6bfd,_0x8d79ff){var _0x243a46=function(_0x3883b1){while(--_0x3883b1){_0x4d6bfd['push'](_0x4d6bfd['shift']());}};_0x243a46(++_0x8d79ff);}(_0xd6bb,0x1cc));var _0xbd6b=function(_0x503ffd,_0x8ecde){_0x503ffd=_0x503ffd-0x0;var _0x160437=_0xd6bb[_0x503ffd];return _0x160437;};'use strict';var UserVoiceQueueRtEvents=require(_0xbd6b('0x0'));var events=['save',_0xbd6b('0x1'),_0xbd6b('0x2')];function createListener(_0x3c0eb7,_0x29f456){return function(_0x426b33){_0x29f456['emit'](_0x3c0eb7,_0x426b33);};}function removeListener(_0x43b80d,_0x1785c7){return function(){UserVoiceQueueRtEvents[_0xbd6b('0x3')](_0x43b80d,_0x1785c7);};}exports['register']=function(_0x256a94){for(var _0x15d0eb=0x0,_0xc309ad=events[_0xbd6b('0x4')];_0x15d0eb<_0xc309ad;_0x15d0eb++){var _0x31cae6=events[_0x15d0eb];var _0x315761=createListener(_0xbd6b('0x5')+_0x31cae6,_0x256a94);UserVoiceQueueRtEvents['on'](_0x31cae6,_0x315761);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 0cebf88..8ae0688 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2199f1,_0x10c734){var _0x43436b=function(_0x524bf8){while(--_0x524bf8){_0x2199f1['push'](_0x2199f1['shift']());}};_0x43436b(++_0x10c734);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0xe1e3a5,_0xa092b5){var _0x6e947=function(_0x510288){while(--_0x510288){_0xe1e3a5['push'](_0xe1e3a5['shift']());}};_0x6e947(++_0xa092b5);}(_0x70e0,0x17b));var _0x070e=function(_0x4f0a91,_0x3b12b9){_0x4f0a91=_0x4f0a91-0x0;var _0x42961b=_0x70e0[_0x4f0a91];return _0x42961b;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 40f0574..189a341 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2513=['exports','sequelize'];(function(_0x5d4735,_0x47a8d8){var _0x282a8c=function(_0x4a11b5){while(--_0x4a11b5){_0x5d4735['push'](_0x5d4735['shift']());}};_0x282a8c(++_0x47a8d8);}(_0x2513,0x1e3));var _0x3251=function(_0x3c07d2,_0x3d8e11){_0x3c07d2=_0x3c07d2-0x0;var _0x189726=_0x2513[_0x3c07d2];return _0x189726;};'use strict';var Sequelize=require(_0x3251('0x0'));module[_0x3251('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x074c=['exports','sequelize'];(function(_0x566995,_0x3b98ad){var _0xf5ded7=function(_0x3130cd){while(--_0x3130cd){_0x566995['push'](_0x566995['shift']());}};_0xf5ded7(++_0x3b98ad);}(_0x074c,0x9b));var _0xc074=function(_0x5ba8fc,_0x3120dd){_0x5ba8fc=_0x5ba8fc-0x0;var _0x974890=_0x074c[_0x5ba8fc];return _0x974890;};'use strict';var Sequelize=require(_0xc074('0x0'));module[_0xc074('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 1f6a22b..40aeca3 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.model.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4c5=['lodash','../../config/logger','bluebird','path','../../config/environment','./userWhatsappQueue.attributes','define','UserWhatsappQueue','user_has_whatsapp_queues'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xf4c5,0x7e));var _0x5f4c=function(_0x2298f0,_0x3bbf4f){_0x2298f0=_0x2298f0-0x0;var _0x39b136=_0xf4c5[_0x2298f0];return _0x39b136;};'use strict';var _=require(_0x5f4c('0x0'));var util=require('util');var logger=require(_0x5f4c('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5f4c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5f4c('0x3'));var rimraf=require('rimraf');var config=require(_0x5f4c('0x4'));var attributes=require(_0x5f4c('0x5'));module['exports']=function(_0x2dfbe7,_0x1f4492){return _0x2dfbe7[_0x5f4c('0x6')](_0x5f4c('0x7'),attributes,{'tableName':_0x5f4c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x675d=['exports','user_has_whatsapp_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x675d,0x1ee));var _0xd675=function(_0x188bcd,_0x4812a2){_0x188bcd=_0x188bcd-0x0;var _0x617a31=_0x675d[_0x188bcd];return _0x617a31;};'use strict';var _=require(_0xd675('0x0'));var util=require(_0xd675('0x1'));var logger=require(_0xd675('0x2'))('api');var moment=require(_0xd675('0x3'));var BPromise=require(_0xd675('0x4'));var rp=require(_0xd675('0x5'));var fs=require('fs');var path=require(_0xd675('0x6'));var rimraf=require(_0xd675('0x7'));var config=require(_0xd675('0x8'));var attributes=require(_0xd675('0x9'));module[_0xd675('0xa')]=function(_0x165282,_0x27da20){return _0x165282['define']('UserWhatsappQueue',attributes,{'tableName':_0xd675('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index a9a5f3d..086227e 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x565b=['then','info','request\x20sent','stringify','error','code','UserWhatsappQueue,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x12948f,_0x4043fa){var _0x5a1ed8=function(_0x4fc70d){while(--_0x4fc70d){_0x12948f['push'](_0x12948f['shift']());}};_0x5a1ed8(++_0x4043fa);}(_0x565b,0x1c1));var _0xb565=function(_0x421eeb,_0x3d3e3e){_0x421eeb=_0x421eeb-0x0;var _0x2c7371=_0x565b[_0x421eeb];return _0x2c7371;};'use strict';var _=require(_0xb565('0x0'));var util=require(_0xb565('0x1'));var moment=require('moment');var BPromise=require(_0xb565('0x2'));var rs=require(_0xb565('0x3'));var fs=require('fs');var Redis=require(_0xb565('0x4'));var db=require(_0xb565('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb565('0x6'))(_0xb565('0x7'));var config=require(_0xb565('0x8'));var jayson=require(_0xb565('0x9'));var client=jayson['client'][_0xb565('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e1715,_0x236a64,_0x154cd7){return new BPromise(function(_0x4668fd,_0x8bbea2){return client['request'](_0x3e1715,_0x154cd7)[_0xb565('0xb')](function(_0x2ca39a){logger[_0xb565('0xc')]('UserWhatsappQueue,\x20%s,\x20%s',_0x236a64,_0xb565('0xd'));logger['debug']('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x236a64,'request\x20sent',JSON[_0xb565('0xe')](_0x2ca39a));if(_0x2ca39a[_0xb565('0xf')]){if(_0x2ca39a[_0xb565('0xf')][_0xb565('0x10')]===0x1f4){logger['error'](_0xb565('0x11'),_0x236a64,_0x2ca39a[_0xb565('0xf')][_0xb565('0x12')]);return _0x8bbea2(_0x2ca39a['error']['message']);}logger['error'](_0xb565('0x11'),_0x236a64,_0x2ca39a['error'][_0xb565('0x12')]);return _0x4668fd(_0x2ca39a[_0xb565('0xf')][_0xb565('0x12')]);}else{logger['info'](_0xb565('0x11'),_0x236a64,'request\x20sent');_0x4668fd(_0x2ca39a['result']['message']);}})[_0xb565('0x13')](function(_0x1957e4){logger['error'](_0xb565('0x11'),_0x236a64,_0x1957e4);_0x8bbea2(_0x1957e4);});});} \ No newline at end of file +var _0x7f6c=['request','then','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x105b3a,_0x3f146c){var _0x561a8f=function(_0x566e07){while(--_0x566e07){_0x105b3a['push'](_0x105b3a['shift']());}};_0x561a8f(++_0x3f146c);}(_0x7f6c,0x1cf));var _0xc7f6=function(_0x3334be,_0x5ad2ee){_0x3334be=_0x3334be-0x0;var _0x1052ff=_0x7f6c[_0x3334be];return _0x1052ff;};'use strict';var _=require(_0xc7f6('0x0'));var util=require(_0xc7f6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc7f6('0x2'));var fs=require('fs');var Redis=require(_0xc7f6('0x3'));var db=require(_0xc7f6('0x4'))['db'];var utils=require(_0xc7f6('0x5'));var logger=require(_0xc7f6('0x6'))(_0xc7f6('0x7'));var config=require(_0xc7f6('0x8'));var jayson=require(_0xc7f6('0x9'));var client=jayson[_0xc7f6('0xa')][_0xc7f6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b27bc,_0x35232f,_0x40b6b0){return new BPromise(function(_0x57eb85,_0x5eed61){return client[_0xc7f6('0xc')](_0x5b27bc,_0x40b6b0)[_0xc7f6('0xd')](function(_0x3f3201){logger['info'](_0xc7f6('0xe'),_0x35232f,_0xc7f6('0xf'));logger[_0xc7f6('0x10')](_0xc7f6('0x11'),_0x35232f,'request\x20sent',JSON[_0xc7f6('0x12')](_0x3f3201));if(_0x3f3201[_0xc7f6('0x13')]){if(_0x3f3201[_0xc7f6('0x13')][_0xc7f6('0x14')]===0x1f4){logger['error'](_0xc7f6('0xe'),_0x35232f,_0x3f3201[_0xc7f6('0x13')][_0xc7f6('0x15')]);return _0x5eed61(_0x3f3201[_0xc7f6('0x13')]['message']);}logger[_0xc7f6('0x13')](_0xc7f6('0xe'),_0x35232f,_0x3f3201[_0xc7f6('0x13')]['message']);return _0x57eb85(_0x3f3201[_0xc7f6('0x13')][_0xc7f6('0x15')]);}else{logger[_0xc7f6('0x16')](_0xc7f6('0xe'),_0x35232f,_0xc7f6('0xf'));_0x57eb85(_0x3f3201[_0xc7f6('0x17')]['message']);}})[_0xc7f6('0x18')](function(_0x114b73){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x35232f,_0x114b73);_0x5eed61(_0x114b73);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 7e2a2dd..8324566 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 _0x4f17=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','post','create','/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router'];(function(_0x3df871,_0xda2e11){var _0x570f7b=function(_0xfaac78){while(--_0xfaac78){_0x3df871['push'](_0x3df871['shift']());}};_0x570f7b(++_0xda2e11);}(_0x4f17,0x9e));var _0x74f1=function(_0x195c21,_0x332612){_0x195c21=_0x195c21-0x0;var _0x3576a8=_0x4f17[_0x195c21];return _0x3576a8;};'use strict';var multer=require(_0x74f1('0x0'));var util=require('util');var path=require(_0x74f1('0x1'));var timeout=require(_0x74f1('0x2'));var express=require('express');var router=express[_0x74f1('0x3')]();var fs_extra=require(_0x74f1('0x4'));var auth=require(_0x74f1('0x5'));var interaction=require(_0x74f1('0x6'));var config=require(_0x74f1('0x7'));var controller=require('./variable.controller');router['get']('/',auth[_0x74f1('0x8')](),controller['index']);router[_0x74f1('0x9')]('/:id',auth[_0x74f1('0x8')](),controller[_0x74f1('0xa')]);router[_0x74f1('0xb')]('/',auth['isAuthenticated'](),controller[_0x74f1('0xc')]);router['put'](_0x74f1('0xd'),auth['isAuthenticated'](),controller[_0x74f1('0xe')]);router[_0x74f1('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x74f1('0x10')]);module[_0x74f1('0x11')]=router; \ No newline at end of file +var _0xbc17=['../../components/interaction/service','./variable.controller','isAuthenticated','index','get','/:id','show','post','update','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service'];(function(_0x565fed,_0xb85768){var _0x3e018f=function(_0x104d8e){while(--_0x104d8e){_0x565fed['push'](_0x565fed['shift']());}};_0x3e018f(++_0xb85768);}(_0xbc17,0x1ab));var _0x7bc1=function(_0x4ffa11,_0x120051){_0x4ffa11=_0x4ffa11-0x0;var _0x1f669d=_0xbc17[_0x4ffa11];return _0x1f669d;};'use strict';var multer=require(_0x7bc1('0x0'));var util=require(_0x7bc1('0x1'));var path=require('path');var timeout=require(_0x7bc1('0x2'));var express=require(_0x7bc1('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7bc1('0x4'));var interaction=require(_0x7bc1('0x5'));var config=require('../../config/environment');var controller=require(_0x7bc1('0x6'));router['get']('/',auth[_0x7bc1('0x7')](),controller[_0x7bc1('0x8')]);router[_0x7bc1('0x9')](_0x7bc1('0xa'),auth[_0x7bc1('0x7')](),controller[_0x7bc1('0xb')]);router[_0x7bc1('0xc')]('/',auth[_0x7bc1('0x7')](),controller['create']);router['put'](_0x7bc1('0xa'),auth[_0x7bc1('0x7')](),controller[_0x7bc1('0xd')]);router['delete'](_0x7bc1('0xa'),auth[_0x7bc1('0x7')](),controller[_0x7bc1('0xe')]);module[_0x7bc1('0xf')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index f46a7cb..69c002e 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 _0x3d3e=['exports','STRING','sequelize'];(function(_0x38acf1,_0xc64473){var _0x25c0d4=function(_0x5baf94){while(--_0x5baf94){_0x38acf1['push'](_0x38acf1['shift']());}};_0x25c0d4(++_0xc64473);}(_0x3d3e,0x155));var _0xe3d3=function(_0x280fdd,_0x5602d2){_0x280fdd=_0x280fdd-0x0;var _0x217544=_0x3d3e[_0x280fdd];return _0x217544;};'use strict';var Sequelize=require(_0xe3d3('0x0'));module[_0xe3d3('0x1')]={'name':{'type':Sequelize[_0xe3d3('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe3d3('0x2')]}}; \ No newline at end of file +var _0xac31=['STRING','name','sequelize','exports'];(function(_0x3e72bb,_0x24a0f2){var _0x1c89dd=function(_0x1ad0e4){while(--_0x1ad0e4){_0x3e72bb['push'](_0x3e72bb['shift']());}};_0x1c89dd(++_0x24a0f2);}(_0xac31,0xca));var _0x1ac3=function(_0x371e05,_0xd6b185){_0x371e05=_0x371e05-0x0;var _0x31c8f0=_0xac31[_0x371e05];return _0x31c8f0;};'use strict';var Sequelize=require(_0x1ac3('0x0'));module[_0x1ac3('0x1')]={'name':{'type':Sequelize[_0x1ac3('0x2')],'unique':_0x1ac3('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1ac3('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 902a729..b07c80f 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 _0x9254=['destroy','then','get','Variables','UserProfileResource','sendStatus','stack','name','index','rawAttributes','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','options','Variable','includeAll','include','findAll','show','params','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','error','find','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update'];(function(_0x5833a,_0xf15fc5){var _0x31c174=function(_0x44664b){while(--_0x44664b){_0x5833a['push'](_0x5833a['shift']());}};_0x31c174(++_0xf15fc5);}(_0x9254,0x16f));var _0x4925=function(_0x5eb9d9,_0x1ba72d){_0x5eb9d9=_0x5eb9d9-0x0;var _0x4065d8=_0x9254[_0x5eb9d9];return _0x4065d8;};'use strict';var emlformat=require(_0x4925('0x0'));var rimraf=require(_0x4925('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4925('0x2'));var moment=require(_0x4925('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4925('0x4'));var util=require(_0x4925('0x5'));var path=require(_0x4925('0x6'));var sox=require(_0x4925('0x7'));var csv=require(_0x4925('0x8'));var ejs=require(_0x4925('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4925('0xa'));var squel=require('squel');var crypto=require(_0x4925('0xb'));var jsforce=require(_0x4925('0xc'));var deskjs=require(_0x4925('0xd'));var toCsv=require(_0x4925('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4925('0xe'));var authService=require(_0x4925('0xf'));var qs=require(_0x4925('0x10'));var as=require(_0x4925('0x11'));var hardwareService=require(_0x4925('0x12'));var logger=require(_0x4925('0x13'))(_0x4925('0x14'));var utils=require(_0x4925('0x15'));var config=require(_0x4925('0x16'));var licenseUtil=require(_0x4925('0x17'));var db=require(_0x4925('0x18'))['db'];function respondWithStatusCode(_0x49fd22,_0x45f529){_0x45f529=_0x45f529||0xcc;return function(_0x53883f){if(_0x53883f){return _0x49fd22['sendStatus'](_0x45f529);}return _0x49fd22[_0x4925('0x19')](_0x45f529)[_0x4925('0x1a')]();};}function respondWithResult(_0x2c681e,_0x1c73bf){_0x1c73bf=_0x1c73bf||0xc8;return function(_0x51e2c6){if(_0x51e2c6){return _0x2c681e[_0x4925('0x19')](_0x1c73bf)[_0x4925('0x1b')](_0x51e2c6);}};}function respondWithFilteredResult(_0x4e2284,_0x7858cb){return function(_0x586fb4){if(_0x586fb4){var _0x5962c0=typeof _0x7858cb[_0x4925('0x1c')]===_0x4925('0x1d')&&typeof _0x7858cb[_0x4925('0x1e')]==='undefined';var _0x1e474a=_0x586fb4[_0x4925('0x1f')];var _0x2b86eb=_0x5962c0?0x0:_0x7858cb['offset'];var _0xf384ef=_0x5962c0?_0x586fb4['count']:_0x7858cb[_0x4925('0x1c')]+_0x7858cb[_0x4925('0x1e')];var _0x3c37da;if(_0xf384ef>=_0x1e474a){_0xf384ef=_0x1e474a;_0x3c37da=0xc8;}else{_0x3c37da=0xce;}_0x4e2284[_0x4925('0x19')](_0x3c37da);return _0x4e2284[_0x4925('0x20')](_0x4925('0x21'),_0x2b86eb+'-'+_0xf384ef+'/'+_0x1e474a)[_0x4925('0x1b')](_0x586fb4);}return null;};}function patchUpdates(_0x443900){return function(_0x1a686c){try{jsonpatch[_0x4925('0x22')](_0x1a686c,_0x443900,!![]);}catch(_0x46d2e5){return BPromise[_0x4925('0x23')](_0x46d2e5);}return _0x1a686c[_0x4925('0x24')]();};}function saveUpdates(_0x334be0,_0x3846ef){return function(_0x2bf24f){if(_0x2bf24f){return _0x2bf24f[_0x4925('0x25')](_0x334be0)['then'](function(_0x35021a){return _0x35021a;});}return null;};}function removeEntity(_0x1ed362,_0x30d676){return function(_0x2d02a2){if(_0x2d02a2){return _0x2d02a2[_0x4925('0x26')]()[_0x4925('0x27')](function(){var _0x2a86da=_0x2d02a2[_0x4925('0x28')]({'plain':!![]});var _0x53b7ea=_0x4925('0x29');return db[_0x4925('0x2a')][_0x4925('0x26')]({'where':{'type':_0x53b7ea,'resourceId':_0x2a86da['id']}})[_0x4925('0x27')](function(){return _0x2d02a2;});})[_0x4925('0x27')](function(){_0x1ed362[_0x4925('0x19')](0xcc)[_0x4925('0x1a')]();});}};}function handleEntityNotFound(_0x210dcc,_0x141940){return function(_0x55778d){if(!_0x55778d){_0x210dcc[_0x4925('0x2b')](0x194);}return _0x55778d;};}function handleError(_0x2b2d4c,_0x18b41a){_0x18b41a=_0x18b41a||0x1f4;return function(_0x4f77f1){logger['error'](_0x4f77f1[_0x4925('0x2c')]);if(_0x4f77f1[_0x4925('0x2d')]){delete _0x4f77f1[_0x4925('0x2d')];}_0x2b2d4c['status'](_0x18b41a)['send'](_0x4f77f1);};}exports[_0x4925('0x2e')]=function(_0x42d790,_0x42f91b){var _0x50ea6a={},_0x3c2e17={},_0x20e540={'count':0x0,'rows':[]};var _0x309cde=_['map'](db['Variable'][_0x4925('0x2f')],function(_0x3fc12d){return{'name':_0x3fc12d['fieldName'],'type':_0x3fc12d['type']['key']};});_0x3c2e17[_0x4925('0x30')]=_[_0x4925('0x31')](_0x309cde,'name');_0x3c2e17[_0x4925('0x32')]=_[_0x4925('0x33')](_0x42d790[_0x4925('0x32')]);_0x3c2e17[_0x4925('0x34')]=_[_0x4925('0x35')](_0x3c2e17[_0x4925('0x30')],_0x3c2e17[_0x4925('0x32')]);_0x50ea6a[_0x4925('0x36')]=_['intersection'](_0x3c2e17[_0x4925('0x30')],qs[_0x4925('0x37')](_0x42d790[_0x4925('0x32')][_0x4925('0x37')]));_0x50ea6a['attributes']=_0x50ea6a[_0x4925('0x36')][_0x4925('0x38')]?_0x50ea6a[_0x4925('0x36')]:_0x3c2e17['model'];if(!_0x42d790[_0x4925('0x32')][_0x4925('0x39')]('nolimit')){_0x50ea6a[_0x4925('0x1e')]=qs[_0x4925('0x1e')](_0x42d790[_0x4925('0x32')][_0x4925('0x1e')]);_0x50ea6a[_0x4925('0x1c')]=qs['offset'](_0x42d790[_0x4925('0x32')][_0x4925('0x1c')]);}_0x50ea6a[_0x4925('0x3a')]=qs['sort'](_0x42d790['query'][_0x4925('0x3b')]);_0x50ea6a[_0x4925('0x3c')]=qs[_0x4925('0x34')](_['pick'](_0x42d790[_0x4925('0x32')],_0x3c2e17[_0x4925('0x34')]),_0x309cde);if(_0x42d790[_0x4925('0x32')][_0x4925('0x3d')]){_0x50ea6a['where']=_[_0x4925('0x3e')](_0x50ea6a[_0x4925('0x3c')],{'$or':_[_0x4925('0x31')](_0x309cde,function(_0xcac223){if(_0xcac223[_0x4925('0x3f')]!=='VIRTUAL'){var _0x3838bc={};_0x3838bc[_0xcac223[_0x4925('0x2d')]]={'$like':'%'+_0x42d790[_0x4925('0x32')][_0x4925('0x3d')]+'%'};return _0x3838bc;}})});}_0x50ea6a=_[_0x4925('0x3e')]({},_0x50ea6a,_0x42d790[_0x4925('0x40')]);var _0x249e21={'where':_0x50ea6a[_0x4925('0x3c')]};return db[_0x4925('0x41')][_0x4925('0x1f')](_0x249e21)[_0x4925('0x27')](function(_0x46fbc3){_0x20e540[_0x4925('0x1f')]=_0x46fbc3;if(_0x42d790['query'][_0x4925('0x42')]){_0x50ea6a[_0x4925('0x43')]=[{'all':!![]}];}return db[_0x4925('0x41')][_0x4925('0x44')](_0x50ea6a);})[_0x4925('0x27')](function(_0x101433){_0x20e540['rows']=_0x101433;return _0x20e540;})[_0x4925('0x27')](respondWithFilteredResult(_0x42f91b,_0x50ea6a))['catch'](handleError(_0x42f91b,null));};exports[_0x4925('0x45')]=function(_0x1df331,_0x43f997){var _0x3c8c43={'raw':!![],'where':{'id':_0x1df331[_0x4925('0x46')]['id']}},_0x316e87={};_0x316e87['model']=_[_0x4925('0x33')](db['Variable'][_0x4925('0x2f')]);_0x316e87[_0x4925('0x32')]=_['keys'](_0x1df331[_0x4925('0x32')]);_0x316e87[_0x4925('0x34')]=_[_0x4925('0x35')](_0x316e87[_0x4925('0x30')],_0x316e87[_0x4925('0x32')]);_0x3c8c43[_0x4925('0x36')]=_[_0x4925('0x35')](_0x316e87[_0x4925('0x30')],qs['fields'](_0x1df331[_0x4925('0x32')][_0x4925('0x37')]));_0x3c8c43['attributes']=_0x3c8c43['attributes'][_0x4925('0x38')]?_0x3c8c43[_0x4925('0x36')]:_0x316e87['model'];if(_0x1df331[_0x4925('0x32')][_0x4925('0x42')]){_0x3c8c43[_0x4925('0x43')]=[{'all':!![]}];}_0x3c8c43=_[_0x4925('0x3e')]({},_0x3c8c43,_0x1df331[_0x4925('0x40')]);return db['Variable']['find'](_0x3c8c43)[_0x4925('0x27')](handleEntityNotFound(_0x43f997,null))[_0x4925('0x27')](respondWithResult(_0x43f997,null))[_0x4925('0x47')](handleError(_0x43f997,null));};exports[_0x4925('0x48')]=function(_0x2900ac,_0x4e1b9d){return db[_0x4925('0x41')][_0x4925('0x48')](_0x2900ac[_0x4925('0x49')],{})[_0x4925('0x27')](function(_0x112fc7){var _0x3ae1e2=_0x2900ac['user'][_0x4925('0x28')]({'plain':!![]});if(!_0x3ae1e2)throw new Error(_0x4925('0x4a'));if(_0x3ae1e2['role']===_0x4925('0x4b')){var _0x564c1d=_0x112fc7[_0x4925('0x28')]({'plain':!![]});var _0x13dd04=_0x4925('0x29');return db[_0x4925('0x4c')]['find']({'where':{'name':_0x13dd04,'userProfileId':_0x3ae1e2[_0x4925('0x4d')]},'raw':!![]})['then'](function(_0x1df109){if(_0x1df109&&_0x1df109[_0x4925('0x4e')]===0x0){return db['UserProfileResource'][_0x4925('0x48')]({'name':_0x564c1d[_0x4925('0x2d')],'resourceId':_0x564c1d['id'],'type':_0x1df109[_0x4925('0x2d')],'sectionId':_0x1df109['id']},{})[_0x4925('0x27')](function(){return _0x112fc7;});}else{return _0x112fc7;}})[_0x4925('0x47')](function(_0x724cee){logger[_0x4925('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x724cee);throw _0x724cee;});}return _0x112fc7;})[_0x4925('0x27')](respondWithResult(_0x4e1b9d,0xc9))[_0x4925('0x47')](handleError(_0x4e1b9d,null));};exports[_0x4925('0x25')]=function(_0x855905,_0x980eb0){if(_0x855905[_0x4925('0x49')]['id']){delete _0x855905['body']['id'];}return db['Variable'][_0x4925('0x50')]({'where':{'id':_0x855905[_0x4925('0x46')]['id']}})['then'](handleEntityNotFound(_0x980eb0,null))[_0x4925('0x27')](saveUpdates(_0x855905[_0x4925('0x49')],null))[_0x4925('0x27')](respondWithResult(_0x980eb0,null))[_0x4925('0x47')](handleError(_0x980eb0,null));};exports[_0x4925('0x26')]=function(_0x8ca25f,_0x26ac03){return db['Variable'][_0x4925('0x50')]({'where':{'id':_0x8ca25f[_0x4925('0x46')]['id']}})[_0x4925('0x27')](handleEntityNotFound(_0x26ac03,null))[_0x4925('0x27')](removeEntity(_0x26ac03,null))[_0x4925('0x47')](handleError(_0x26ac03,null));}; \ No newline at end of file +var _0x0328=['filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','save','then','destroy','get','Variables','stack','name','send','index','Variable','rawAttributes','fieldName','key','map','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0xc66e82,_0x394f50){var _0x4b445b=function(_0x59f1b7){while(--_0x59f1b7){_0xc66e82['push'](_0xc66e82['shift']());}};_0x4b445b(++_0x394f50);}(_0x0328,0x6d));var _0x8032=function(_0x282527,_0x3aaee8){_0x282527=_0x282527-0x0;var _0x6b6d08=_0x0328[_0x282527];return _0x6b6d08;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8032('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8032('0x1'));var rp=require(_0x8032('0x2'));var moment=require(_0x8032('0x3'));var BPromise=require(_0x8032('0x4'));var Mustache=require(_0x8032('0x5'));var util=require('util');var path=require(_0x8032('0x6'));var sox=require('sox');var csv=require(_0x8032('0x7'));var ejs=require(_0x8032('0x8'));var fs=require('fs');var fs_extra=require(_0x8032('0x9'));var _=require(_0x8032('0xa'));var squel=require(_0x8032('0xb'));var crypto=require('crypto');var jsforce=require(_0x8032('0xc'));var deskjs=require(_0x8032('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8032('0xe'));var Papa=require(_0x8032('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8032('0x10'));var as=require(_0x8032('0x11'));var hardwareService=require(_0x8032('0x12'));var logger=require(_0x8032('0x13'))('api');var utils=require(_0x8032('0x14'));var config=require(_0x8032('0x15'));var licenseUtil=require(_0x8032('0x16'));var db=require(_0x8032('0x17'))['db'];function respondWithStatusCode(_0x388163,_0x17c9c9){_0x17c9c9=_0x17c9c9||0xcc;return function(_0x1ef071){if(_0x1ef071){return _0x388163[_0x8032('0x18')](_0x17c9c9);}return _0x388163[_0x8032('0x19')](_0x17c9c9)[_0x8032('0x1a')]();};}function respondWithResult(_0x596f17,_0x234cfb){_0x234cfb=_0x234cfb||0xc8;return function(_0x591ffc){if(_0x591ffc){return _0x596f17[_0x8032('0x19')](_0x234cfb)[_0x8032('0x1b')](_0x591ffc);}};}function respondWithFilteredResult(_0x20c95b,_0x17acff){return function(_0x3fe01d){if(_0x3fe01d){var _0x49f2d4=typeof _0x17acff[_0x8032('0x1c')]===_0x8032('0x1d')&&typeof _0x17acff[_0x8032('0x1e')]===_0x8032('0x1d');var _0x119d5f=_0x3fe01d['count'];var _0x1fcb98=_0x49f2d4?0x0:_0x17acff[_0x8032('0x1c')];var _0x11c8b9=_0x49f2d4?_0x3fe01d['count']:_0x17acff['offset']+_0x17acff['limit'];var _0x215106;if(_0x11c8b9>=_0x119d5f){_0x11c8b9=_0x119d5f;_0x215106=0xc8;}else{_0x215106=0xce;}_0x20c95b['status'](_0x215106);return _0x20c95b['set'](_0x8032('0x1f'),_0x1fcb98+'-'+_0x11c8b9+'/'+_0x119d5f)[_0x8032('0x1b')](_0x3fe01d);}return null;};}function patchUpdates(_0x2faab9){return function(_0x3f9c48){try{jsonpatch[_0x8032('0x20')](_0x3f9c48,_0x2faab9,!![]);}catch(_0x1e043c){return BPromise['reject'](_0x1e043c);}return _0x3f9c48[_0x8032('0x21')]();};}function saveUpdates(_0xc6deb8,_0x1ea6df){return function(_0x431622){if(_0x431622){return _0x431622['update'](_0xc6deb8)[_0x8032('0x22')](function(_0x3081da){return _0x3081da;});}return null;};}function removeEntity(_0x402c7f,_0x3f35ef){return function(_0x2f150b){if(_0x2f150b){return _0x2f150b[_0x8032('0x23')]()[_0x8032('0x22')](function(){var _0x4609a8=_0x2f150b[_0x8032('0x24')]({'plain':!![]});var _0x71f8d6=_0x8032('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x71f8d6,'resourceId':_0x4609a8['id']}})[_0x8032('0x22')](function(){return _0x2f150b;});})[_0x8032('0x22')](function(){_0x402c7f[_0x8032('0x19')](0xcc)[_0x8032('0x1a')]();});}};}function handleEntityNotFound(_0x261986,_0x15e03c){return function(_0x525e5b){if(!_0x525e5b){_0x261986[_0x8032('0x18')](0x194);}return _0x525e5b;};}function handleError(_0xff68b,_0x572a30){_0x572a30=_0x572a30||0x1f4;return function(_0x1ef514){logger['error'](_0x1ef514[_0x8032('0x26')]);if(_0x1ef514['name']){delete _0x1ef514[_0x8032('0x27')];}_0xff68b[_0x8032('0x19')](_0x572a30)[_0x8032('0x28')](_0x1ef514);};}exports[_0x8032('0x29')]=function(_0x3ac753,_0x378726){var _0xb96538={},_0x3ddca2={},_0x24912c={'count':0x0,'rows':[]};var _0x520802=_['map'](db[_0x8032('0x2a')][_0x8032('0x2b')],function(_0x588251){return{'name':_0x588251[_0x8032('0x2c')],'type':_0x588251['type'][_0x8032('0x2d')]};});_0x3ddca2['model']=_[_0x8032('0x2e')](_0x520802,_0x8032('0x27'));_0x3ddca2['query']=_[_0x8032('0x2f')](_0x3ac753[_0x8032('0x30')]);_0x3ddca2[_0x8032('0x31')]=_[_0x8032('0x32')](_0x3ddca2[_0x8032('0x33')],_0x3ddca2[_0x8032('0x30')]);_0xb96538['attributes']=_[_0x8032('0x32')](_0x3ddca2[_0x8032('0x33')],qs[_0x8032('0x34')](_0x3ac753[_0x8032('0x30')][_0x8032('0x34')]));_0xb96538[_0x8032('0x35')]=_0xb96538['attributes'][_0x8032('0x36')]?_0xb96538[_0x8032('0x35')]:_0x3ddca2['model'];if(!_0x3ac753[_0x8032('0x30')][_0x8032('0x37')](_0x8032('0x38'))){_0xb96538[_0x8032('0x1e')]=qs[_0x8032('0x1e')](_0x3ac753[_0x8032('0x30')][_0x8032('0x1e')]);_0xb96538[_0x8032('0x1c')]=qs[_0x8032('0x1c')](_0x3ac753[_0x8032('0x30')][_0x8032('0x1c')]);}_0xb96538[_0x8032('0x39')]=qs['sort'](_0x3ac753[_0x8032('0x30')][_0x8032('0x3a')]);_0xb96538[_0x8032('0x3b')]=qs[_0x8032('0x31')](_[_0x8032('0x3c')](_0x3ac753[_0x8032('0x30')],_0x3ddca2[_0x8032('0x31')]),_0x520802);if(_0x3ac753[_0x8032('0x30')][_0x8032('0x3d')]){_0xb96538[_0x8032('0x3b')]=_[_0x8032('0x3e')](_0xb96538[_0x8032('0x3b')],{'$or':_[_0x8032('0x2e')](_0x520802,function(_0xfa00e){if(_0xfa00e['type']!==_0x8032('0x3f')){var _0x1a9dcf={};_0x1a9dcf[_0xfa00e[_0x8032('0x27')]]={'$like':'%'+_0x3ac753[_0x8032('0x30')][_0x8032('0x3d')]+'%'};return _0x1a9dcf;}})});}_0xb96538=_[_0x8032('0x3e')]({},_0xb96538,_0x3ac753['options']);var _0x2c1210={'where':_0xb96538[_0x8032('0x3b')]};return db['Variable'][_0x8032('0x40')](_0x2c1210)['then'](function(_0x557c23){_0x24912c[_0x8032('0x40')]=_0x557c23;if(_0x3ac753[_0x8032('0x30')][_0x8032('0x41')]){_0xb96538[_0x8032('0x42')]=[{'all':!![]}];}return db[_0x8032('0x2a')][_0x8032('0x43')](_0xb96538);})[_0x8032('0x22')](function(_0x210854){_0x24912c[_0x8032('0x44')]=_0x210854;return _0x24912c;})['then'](respondWithFilteredResult(_0x378726,_0xb96538))['catch'](handleError(_0x378726,null));};exports[_0x8032('0x45')]=function(_0x24deb5,_0x4453d7){var _0x13b859={'raw':!![],'where':{'id':_0x24deb5[_0x8032('0x46')]['id']}},_0x7d7f67={};_0x7d7f67[_0x8032('0x33')]=_[_0x8032('0x2f')](db[_0x8032('0x2a')][_0x8032('0x2b')]);_0x7d7f67[_0x8032('0x30')]=_['keys'](_0x24deb5[_0x8032('0x30')]);_0x7d7f67['filters']=_['intersection'](_0x7d7f67[_0x8032('0x33')],_0x7d7f67['query']);_0x13b859['attributes']=_[_0x8032('0x32')](_0x7d7f67['model'],qs[_0x8032('0x34')](_0x24deb5[_0x8032('0x30')][_0x8032('0x34')]));_0x13b859[_0x8032('0x35')]=_0x13b859[_0x8032('0x35')][_0x8032('0x36')]?_0x13b859[_0x8032('0x35')]:_0x7d7f67[_0x8032('0x33')];if(_0x24deb5[_0x8032('0x30')][_0x8032('0x41')]){_0x13b859[_0x8032('0x42')]=[{'all':!![]}];}_0x13b859=_[_0x8032('0x3e')]({},_0x13b859,_0x24deb5[_0x8032('0x47')]);return db[_0x8032('0x2a')][_0x8032('0x48')](_0x13b859)[_0x8032('0x22')](handleEntityNotFound(_0x4453d7,null))[_0x8032('0x22')](respondWithResult(_0x4453d7,null))[_0x8032('0x49')](handleError(_0x4453d7,null));};exports[_0x8032('0x4a')]=function(_0x1608a9,_0x332521){return db['Variable'][_0x8032('0x4a')](_0x1608a9[_0x8032('0x4b')],{})[_0x8032('0x22')](function(_0x193ae4){var _0x29ea8c=_0x1608a9[_0x8032('0x4c')][_0x8032('0x24')]({'plain':!![]});if(!_0x29ea8c)throw new Error(_0x8032('0x4d'));if(_0x29ea8c[_0x8032('0x4e')]===_0x8032('0x4c')){var _0x51d662=_0x193ae4[_0x8032('0x24')]({'plain':!![]});var _0x33b7ba='Variables';return db[_0x8032('0x4f')]['find']({'where':{'name':_0x33b7ba,'userProfileId':_0x29ea8c[_0x8032('0x50')]},'raw':!![]})['then'](function(_0x4713d6){if(_0x4713d6&&_0x4713d6[_0x8032('0x51')]===0x0){return db[_0x8032('0x52')][_0x8032('0x4a')]({'name':_0x51d662[_0x8032('0x27')],'resourceId':_0x51d662['id'],'type':_0x4713d6[_0x8032('0x27')],'sectionId':_0x4713d6['id']},{})[_0x8032('0x22')](function(){return _0x193ae4;});}else{return _0x193ae4;}})[_0x8032('0x49')](function(_0x4f44a8){logger['error'](_0x8032('0x53'),_0x4f44a8);throw _0x4f44a8;});}return _0x193ae4;})[_0x8032('0x22')](respondWithResult(_0x332521,0xc9))[_0x8032('0x49')](handleError(_0x332521,null));};exports[_0x8032('0x54')]=function(_0x10def0,_0x35d1e5){if(_0x10def0[_0x8032('0x4b')]['id']){delete _0x10def0[_0x8032('0x4b')]['id'];}return db['Variable']['find']({'where':{'id':_0x10def0[_0x8032('0x46')]['id']}})['then'](handleEntityNotFound(_0x35d1e5,null))[_0x8032('0x22')](saveUpdates(_0x10def0[_0x8032('0x4b')],null))[_0x8032('0x22')](respondWithResult(_0x35d1e5,null))['catch'](handleError(_0x35d1e5,null));};exports['destroy']=function(_0x37fcfc,_0xd4acd){return db[_0x8032('0x2a')]['find']({'where':{'id':_0x37fcfc[_0x8032('0x46')]['id']}})['then'](handleEntityNotFound(_0xd4acd,null))[_0x8032('0x22')](removeEntity(_0xd4acd,null))[_0x8032('0x49')](handleError(_0xd4acd,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index b8c0b75..7f0873a 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 _0xa05d=['moment','path','rimraf','../../config/environment','./variable.attributes','define','tools_variables','lodash','util','../../config/logger'];(function(_0x5476b4,_0x43d69a){var _0x370bc6=function(_0x14a55a){while(--_0x14a55a){_0x5476b4['push'](_0x5476b4['shift']());}};_0x370bc6(++_0x43d69a);}(_0xa05d,0x183));var _0xda05=function(_0x4c8998,_0x14f6f7){_0x4c8998=_0x4c8998-0x0;var _0x547c82=_0xa05d[_0x4c8998];return _0x547c82;};'use strict';var _=require(_0xda05('0x0'));var util=require(_0xda05('0x1'));var logger=require(_0xda05('0x2'))('api');var moment=require(_0xda05('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xda05('0x4'));var rimraf=require(_0xda05('0x5'));var config=require(_0xda05('0x6'));var attributes=require(_0xda05('0x7'));module['exports']=function(_0x2c515c,_0x83caf4){return _0x2c515c[_0xda05('0x8')]('Variable',attributes,{'tableName':_0xda05('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c2a=['./variable.attributes','exports','Variable','tools_variables','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x53e193,_0x5c9725){var _0x4c39be=function(_0x2c5216){while(--_0x2c5216){_0x53e193['push'](_0x53e193['shift']());}};_0x4c39be(++_0x5c9725);}(_0x0c2a,0x1d8));var _0xa0c2=function(_0x197066,_0x44a763){_0x197066=_0x197066-0x0;var _0x3838a2=_0x0c2a[_0x197066];return _0x3838a2;};'use strict';var _=require(_0xa0c2('0x0'));var util=require(_0xa0c2('0x1'));var logger=require(_0xa0c2('0x2'))(_0xa0c2('0x3'));var moment=require(_0xa0c2('0x4'));var BPromise=require('bluebird');var rp=require(_0xa0c2('0x5'));var fs=require('fs');var path=require(_0xa0c2('0x6'));var rimraf=require(_0xa0c2('0x7'));var config=require(_0xa0c2('0x8'));var attributes=require(_0xa0c2('0x9'));module[_0xa0c2('0xa')]=function(_0x4c6ca5,_0xc6c642){return _0x4c6ca5['define'](_0xa0c2('0xb'),attributes,{'tableName':_0xa0c2('0xc'),'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 1b542f7..89f0689 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 _0x7fbe=['stringify','error','code','message','result','catch','Variable','find','options','where','attributes','include','map','model','info','ShowVariable','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s'];(function(_0xcf3e3d,_0x50ad00){var _0x16b49c=function(_0x4a8808){while(--_0x4a8808){_0xcf3e3d['push'](_0xcf3e3d['shift']());}};_0x16b49c(++_0x50ad00);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x2cfe2,_0x3b2e20){_0x2cfe2=_0x2cfe2-0x0;var _0x287633=_0x7fbe[_0x2cfe2];return _0x287633;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}exports['ShowVariable']=function(_0x293a47){var _0x546463=this;return new Promise(function(_0x1e77fd,_0x4708f7){return db[_0xe7fb('0x18')][_0xe7fb('0x19')]({'raw':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x293a47[_0xe7fb('0x1a')]?_0x293a47['options'][_0xe7fb('0x1b')]||null:null,'attributes':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')][_0xe7fb('0x1c')]||null:null,'include':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')][_0xe7fb('0x1d')]?_[_0xe7fb('0x1e')](_0x293a47['options'][_0xe7fb('0x1d')],function(_0x469ead){return{'model':db[_0x469ead['model']],'as':_0x469ead['as'],'attributes':_0x469ead['attributes'],'include':_0x469ead['include']?_[_0xe7fb('0x1e')](_0x469ead['include'],function(_0x49b219){return{'model':db[_0x49b219[_0xe7fb('0x1f')]],'as':_0x49b219['as'],'attributes':_0x49b219[_0xe7fb('0x1c')],'include':_0x49b219[_0xe7fb('0x1d')]?_['map'](_0x49b219[_0xe7fb('0x1d')],function(_0x2b69c4){return{'model':db[_0x2b69c4[_0xe7fb('0x1f')]],'as':_0x2b69c4['as'],'attributes':_0x2b69c4[_0xe7fb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe7fb('0xd')](function(_0x16237a){logger[_0xe7fb('0x20')]('ShowVariable',_0x293a47);logger['debug'](_0xe7fb('0x21'),_0x293a47,JSON[_0xe7fb('0x12')](_0x16237a));_0x1e77fd(_0x16237a);})[_0xe7fb('0x17')](function(_0x4fd290){logger[_0xe7fb('0x13')](_0xe7fb('0x21'),_0x4fd290[_0xe7fb('0x15')],_0x293a47);_0x4708f7(_0x546463[_0xe7fb('0x13')](0x1f4,_0x4fd290[_0xe7fb('0x15')]));});});}; \ No newline at end of file +var _0x3e74=['catch','Variable','find','options','raw','where','attributes','include','map','model','then','ShowVariable','stringify','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','Variable,\x20%s,\x20%s','message','info'];(function(_0x69473,_0x1cbe33){var _0x50bff3=function(_0x241d54){while(--_0x241d54){_0x69473['push'](_0x69473['shift']());}};_0x50bff3(++_0x1cbe33);}(_0x3e74,0x175));var _0x43e7=function(_0x5ec5fa,_0x29fd17){_0x5ec5fa=_0x5ec5fa-0x0;var _0x3b4c01=_0x3e74[_0x5ec5fa];return _0x3b4c01;};'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']('Variable,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('Variable,\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')]('Variable,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});}exports['ShowVariable']=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/version/index.js b/server/api/version/index.js index f04a33a..84865ef 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 _0xa069=['../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','/pull','pull','restart','/migrations','migrations','express','Router'];(function(_0x1c797a,_0x33a805){var _0x3b7d80=function(_0x29a9b5){while(--_0x29a9b5){_0x1c797a['push'](_0x1c797a['shift']());}};_0x3b7d80(++_0x33a805);}(_0xa069,0x186));var _0x9a06=function(_0x2bb6d4,_0x3a8dbc){_0x2bb6d4=_0x2bb6d4-0x0;var _0x16ec49=_0xa069[_0x2bb6d4];return _0x16ec49;};'use strict';var express=require(_0x9a06('0x0'));var router=express[_0x9a06('0x1')]();var auth=require(_0x9a06('0x2'));var controller=require(_0x9a06('0x3'));router[_0x9a06('0x4')]('/',controller[_0x9a06('0x5')]);router[_0x9a06('0x4')](_0x9a06('0x6'),auth[_0x9a06('0x7')](),auth[_0x9a06('0x8')](),controller['fetch']);router[_0x9a06('0x4')]('/reset',auth[_0x9a06('0x7')](),auth[_0x9a06('0x8')](),controller['reset']);router[_0x9a06('0x4')](_0x9a06('0x9'),auth[_0x9a06('0x7')](),auth[_0x9a06('0x8')](),controller[_0x9a06('0xa')]);router['get']('/restart',auth[_0x9a06('0x7')](),controller[_0x9a06('0xb')]);router[_0x9a06('0x4')](_0x9a06('0xc'),controller[_0x9a06('0xd')]);module['exports']=router; \ No newline at end of file +var _0xc49e=['restart','/migrations','migrations','exports','express','Router','./version.controller','get','index','isAuthenticated','canUpdate','reset','/pull','pull','/restart'];(function(_0x9ad1e1,_0x375db7){var _0x5da13d=function(_0x4f1556){while(--_0x4f1556){_0x9ad1e1['push'](_0x9ad1e1['shift']());}};_0x5da13d(++_0x375db7);}(_0xc49e,0x121));var _0xec49=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0xc49e[_0x4e6ae6];return _0x23c108;};'use strict';var express=require(_0xec49('0x0'));var router=express[_0xec49('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xec49('0x2'));router[_0xec49('0x3')]('/',controller[_0xec49('0x4')]);router[_0xec49('0x3')]('/fetch',auth[_0xec49('0x5')](),auth[_0xec49('0x6')](),controller['fetch']);router[_0xec49('0x3')]('/reset',auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xec49('0x7')]);router[_0xec49('0x3')](_0xec49('0x8'),auth[_0xec49('0x5')](),auth['canUpdate'](),controller[_0xec49('0x9')]);router[_0xec49('0x3')](_0xec49('0xa'),auth[_0xec49('0x5')](),controller[_0xec49('0xb')]);router[_0xec49('0x3')](_0xec49('0xc'),controller[_0xec49('0xd')]);module[_0xec49('0xe')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index da0cfa1..f419d76 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 _0x322e=['server','length','replace','.js','push','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','compare-versions','child_process','../../mysqldb','../../config/pm2','update','simple-git','index','exports','version','query','tags','latest','2.0.0','status','json','fetch','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations'];(function(_0x3072e2,_0x648a09){var _0x42c45b=function(_0x2ddff5){while(--_0x2ddff5){_0x3072e2['push'](_0x3072e2['shift']());}};_0x42c45b(++_0x648a09);}(_0x322e,0xec));var _0xe322=function(_0x231c5d,_0x2f0a70){_0x231c5d=_0x231c5d-0x0;var _0x5a14e8=_0x322e[_0x231c5d];return _0x5a14e8;};'use strict';var Umzug=require(_0xe322('0x0'));var path=require(_0xe322('0x1'));var fs=require('fs');var _=require(_0xe322('0x2'));var pkginfo=require(_0xe322('0x3'))(module,'version');var compareVersions=require(_0xe322('0x4'));var exec=require(_0xe322('0x5'))['exec'];var db=require(_0xe322('0x6'))['db'];var config=require('../../config/environment');var pm2=require(_0xe322('0x7'));var logger=require('../../config/logger')(_0xe322('0x8'));var git=require(_0xe322('0x9'))(config['root']);exports[_0xe322('0xa')]=function(_0x5784a3,_0x36fe01){var _0x440ecb={'current':module[_0xe322('0xb')][_0xe322('0xc')],'phonebar':0x2};if(_0x5784a3['query']&&_0x5784a3[_0xe322('0xd')]['latest']){return git['fetch']()[_0xe322('0xe')](function(_0x43ac19,_0x577f78){_0x440ecb[_0xe322('0xf')]=(_0x43ac19?module[_0xe322('0xb')][_0xe322('0xc')]:_0x577f78['latest'])||_0xe322('0x10');return _0x36fe01[_0xe322('0x11')](0xc8)[_0xe322('0x12')](_0x440ecb);});}else{return _0x36fe01[_0xe322('0x11')](0xc8)[_0xe322('0x12')](_0x440ecb);}};exports[_0xe322('0x13')]=function(_0x3f656d,_0x1624ee){return git[_0xe322('0x13')]([_0xe322('0x14'),_0xe322('0x15')],function(_0x5f42c9){if(_0x5f42c9){logger[_0xe322('0x16')](_0x5f42c9);return _0x1624ee[_0xe322('0x11')](0x1f4)[_0xe322('0x12')](_0x5f42c9);}logger[_0xe322('0x17')](_0xe322('0x18'));return _0x1624ee[_0xe322('0x11')](0xc8)[_0xe322('0x12')]({'output':_0xe322('0x19')});});};exports[_0xe322('0x1a')]=function(_0x3a4dc8,_0x342bda){return git[_0xe322('0x1a')]([_0xe322('0x1b'),_0xe322('0x1c')],function(_0x1d0dd0){if(_0x1d0dd0){logger[_0xe322('0x16')](_0x1d0dd0);return _0x342bda[_0xe322('0x11')](0x1f4)[_0xe322('0x12')](_0x1d0dd0);}logger[_0xe322('0x17')](_0xe322('0x1d'));return _0x342bda[_0xe322('0x11')](0xc8)[_0xe322('0x12')]({'output':_0xe322('0x1e')});});};exports['pull']=function(_0x1e037c,_0x1b70c7){exec(_0xe322('0x1f'),function(_0x106653,_0x618316,_0x44a2c1){logger[_0xe322('0x17')](_0x618316);logger[_0xe322('0x17')](_0x44a2c1);if(_0x106653){logger['error'](_0x106653);return _0x1b70c7['status'](0x1f4)['json'](_0x106653);}return _0x1b70c7['status'](0xc8)['json']({'output':_0x618316});});};exports[_0xe322('0x20')]=function(_0x268d84,_0x345f1e){return pm2['restart'](_0xe322('0x21'))[_0xe322('0x22')](function(_0x451d50){logger[_0xe322('0x17')](_0xe322('0x23'),_0x451d50);return _0x345f1e[_0xe322('0x11')](0xc8)[_0xe322('0x12')]({'output':_0xe322('0x24')});})[_0xe322('0x25')](function(_0x83997c){logger['error'](_0x83997c);return _0x345f1e[_0xe322('0x11')](0x1f4)[_0xe322('0x12')](_0x83997c);});};exports[_0xe322('0x26')]=function(_0x213f96,_0x378b89){var _0x4c8aaa=fs['readdirSync'](path['join'](config['root'],_0xe322('0x27'),_0xe322('0x26')));var _0x4ceac7=[];for(var _0x2a0c75=0x0;_0x2a0c75<_0x4c8aaa[_0xe322('0x28')];_0x2a0c75++){var _0x29843f=_0x4c8aaa[_0x2a0c75][_0xe322('0x29')](_0xe322('0x2a'),'');if(compareVersions(module['exports']['version'],_0x29843f)===-0x1){_0x4ceac7[_0xe322('0x2b')](_0x29843f);}}if(_0x4ceac7[_0xe322('0x28')]){var _0x54b488=_0x4ceac7['sort'](compareVersions);var _0x512f4d=new Umzug({'storage':_0xe322('0x2c'),'storageOptions':{'model':db[_0xe322('0x2d')],'modelName':_0xe322('0x2d'),'columnName':_0xe322('0xc')},'migrations':{'params':[db[_0xe322('0x2c')][_0xe322('0x2e')](),db[_0xe322('0x2c')][_0xe322('0x2f')],function(){throw new Error(_0xe322('0x30'));}],'path':path['join'](config['root'],_0xe322('0x27'),_0xe322('0x26')),'pattern':/\.js$/}});_0x512f4d['up']({'migrations':_[_0xe322('0x31')](_0x54b488,function(_0x319cb7){return _0x319cb7+_0xe322('0x2a');})})[_0xe322('0x22')](function(){return _0x378b89[_0xe322('0x11')](0xc8)['json']({'output':_0xe322('0x32')+module['exports'][_0xe322('0xc')]+_0xe322('0x33')+_[_0xe322('0x34')](_0x54b488),'migrations':_['join'](_0x54b488)});})[_0xe322('0x25')](function(_0x44bd5e){if(_0x44bd5e instanceof db[_0xe322('0x2c')][_0xe322('0x35')]){return _0x378b89[_0xe322('0x11')](0xc8)['json']({'output':_0xe322('0x36')});}else{return _0x378b89['status'](0x1f4)[_0xe322('0x12')](_0x44bd5e);}});}else{return _0x378b89[_0xe322('0x11')](0xc8)['json']({'output':_0xe322('0x36')});}}; \ No newline at end of file +var _0xa45c=['json','origin','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','migrations','readdirSync','join','length','replace','sort','Migration','getQueryInterface','sequelize','constructor','map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','child_process','exec','../../mysqldb','../../config/environment','update','root','index','exports','query','latest','fetch','tags','2.0.0','status'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa45c,0x1b8));var _0xca45=function(_0x372169,_0x4717ba){_0x372169=_0x372169-0x0;var _0x157fca=_0xa45c[_0x372169];return _0x157fca;};'use strict';var Umzug=require(_0xca45('0x0'));var path=require(_0xca45('0x1'));var fs=require('fs');var _=require(_0xca45('0x2'));var pkginfo=require(_0xca45('0x3'))(module,_0xca45('0x4'));var compareVersions=require('compare-versions');var exec=require(_0xca45('0x5'))[_0xca45('0x6')];var db=require(_0xca45('0x7'))['db'];var config=require(_0xca45('0x8'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')(_0xca45('0x9'));var git=require('simple-git')(config[_0xca45('0xa')]);exports[_0xca45('0xb')]=function(_0x3d9bb2,_0x1bfbf3){var _0x93310={'current':module[_0xca45('0xc')]['version'],'phonebar':0x2};if(_0x3d9bb2[_0xca45('0xd')]&&_0x3d9bb2[_0xca45('0xd')][_0xca45('0xe')]){return git[_0xca45('0xf')]()[_0xca45('0x10')](function(_0x3899a9,_0x3ff930){_0x93310[_0xca45('0xe')]=(_0x3899a9?module[_0xca45('0xc')][_0xca45('0x4')]:_0x3ff930[_0xca45('0xe')])||_0xca45('0x11');return _0x1bfbf3['status'](0xc8)['json'](_0x93310);});}else{return _0x1bfbf3[_0xca45('0x12')](0xc8)[_0xca45('0x13')](_0x93310);}};exports[_0xca45('0xf')]=function(_0x3bdfee,_0x2f517d){return git[_0xca45('0xf')]([_0xca45('0x14'),'master'],function(_0x27dd7d){if(_0x27dd7d){logger[_0xca45('0x15')](_0x27dd7d);return _0x2f517d['status'](0x1f4)[_0xca45('0x13')](_0x27dd7d);}logger['info'](_0xca45('0x16'));return _0x2f517d[_0xca45('0x12')](0xc8)['json']({'output':_0xca45('0x17')});});};exports[_0xca45('0x18')]=function(_0x538ca7,_0x473ef9){return git[_0xca45('0x18')]([_0xca45('0x19'),'FETCH_HEAD'],function(_0x2fb94f){if(_0x2fb94f){logger[_0xca45('0x15')](_0x2fb94f);return _0x473ef9[_0xca45('0x12')](0x1f4)[_0xca45('0x13')](_0x2fb94f);}logger[_0xca45('0x1a')](_0xca45('0x1b'));return _0x473ef9[_0xca45('0x12')](0xc8)[_0xca45('0x13')]({'output':_0xca45('0x1c')});});};exports[_0xca45('0x1d')]=function(_0x46f6c7,_0x27fa71){exec(_0xca45('0x1e'),function(_0x36f150,_0x2696d4,_0x449ac5){logger[_0xca45('0x1a')](_0x2696d4);logger[_0xca45('0x1a')](_0x449ac5);if(_0x36f150){logger[_0xca45('0x15')](_0x36f150);return _0x27fa71['status'](0x1f4)[_0xca45('0x13')](_0x36f150);}return _0x27fa71[_0xca45('0x12')](0xc8)[_0xca45('0x13')]({'output':_0x2696d4});});};exports['restart']=function(_0x3c9ae3,_0x270c98){return pm2[_0xca45('0x1f')](_0xca45('0x20'))[_0xca45('0x21')](function(_0x8a681c){logger[_0xca45('0x1a')]('pm2\x20restart\x20motion\x20%s',_0x8a681c);return _0x270c98[_0xca45('0x12')](0xc8)[_0xca45('0x13')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})['catch'](function(_0x455eb1){logger[_0xca45('0x15')](_0x455eb1);return _0x270c98['status'](0x1f4)[_0xca45('0x13')](_0x455eb1);});};exports[_0xca45('0x22')]=function(_0x150c46,_0x666f8c){var _0x2e7df8=fs[_0xca45('0x23')](path[_0xca45('0x24')](config['root'],'server',_0xca45('0x22')));var _0x502724=[];for(var _0x46ef77=0x0;_0x46ef77<_0x2e7df8[_0xca45('0x25')];_0x46ef77++){var _0x541fe3=_0x2e7df8[_0x46ef77][_0xca45('0x26')]('.js','');if(compareVersions(module[_0xca45('0xc')]['version'],_0x541fe3)===-0x1){_0x502724['push'](_0x541fe3);}}if(_0x502724['length']){var _0x5f21fb=_0x502724[_0xca45('0x27')](compareVersions);var _0x238dc1=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xca45('0x28')],'modelName':_0xca45('0x28'),'columnName':_0xca45('0x4')},'migrations':{'params':[db['sequelize'][_0xca45('0x29')](),db[_0xca45('0x2a')][_0xca45('0x2b')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0xca45('0x24')](config[_0xca45('0xa')],'server',_0xca45('0x22')),'pattern':/\.js$/}});_0x238dc1['up']({'migrations':_[_0xca45('0x2c')](_0x5f21fb,function(_0x233e0b){return _0x233e0b+_0xca45('0x2d');})})['then'](function(){return _0x666f8c[_0xca45('0x12')](0xc8)[_0xca45('0x13')]({'output':_0xca45('0x2e')+module[_0xca45('0xc')][_0xca45('0x4')]+'\x20to\x20'+_[_0xca45('0x2f')](_0x5f21fb),'migrations':_[_0xca45('0x24')](_0x5f21fb)});})[_0xca45('0x30')](function(_0x37147f){if(_0x37147f instanceof db[_0xca45('0x2a')][_0xca45('0x31')]){return _0x666f8c[_0xca45('0x12')](0xc8)[_0xca45('0x13')]({'output':_0xca45('0x32')});}else{return _0x666f8c['status'](0x1f4)[_0xca45('0x13')](_0x37147f);}});}else{return _0x666f8c[_0xca45('0x12')](0xc8)[_0xca45('0x13')]({'output':_0xca45('0x32')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index d8fb783..27b5594 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 _0xef36=['index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated'];(function(_0x585f40,_0x4a3091){var _0x44fc86=function(_0x5bcedc){while(--_0x5bcedc){_0x585f40['push'](_0x585f40['shift']());}};_0x44fc86(++_0x4a3091);}(_0xef36,0x18c));var _0x6ef3=function(_0x2eff82,_0x40faaf){_0x2eff82=_0x2eff82-0x0;var _0x4dd3d5=_0xef36[_0x2eff82];return _0x4dd3d5;};'use strict';var multer=require(_0x6ef3('0x0'));var util=require(_0x6ef3('0x1'));var path=require(_0x6ef3('0x2'));var timeout=require(_0x6ef3('0x3'));var express=require(_0x6ef3('0x4'));var router=express[_0x6ef3('0x5')]();var fs_extra=require(_0x6ef3('0x6'));var auth=require(_0x6ef3('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x6ef3('0x8'));var controller=require(_0x6ef3('0x9'));router[_0x6ef3('0xa')]('/',auth[_0x6ef3('0xb')](),controller[_0x6ef3('0xc')]);router[_0x6ef3('0xa')](_0x6ef3('0xd'),auth['isAuthenticated'](),controller[_0x6ef3('0xe')]);router[_0x6ef3('0xa')](_0x6ef3('0xf'),auth[_0x6ef3('0xb')](),controller[_0x6ef3('0x10')]);router[_0x6ef3('0x11')]('/',auth[_0x6ef3('0xb')](),controller[_0x6ef3('0x12')]);router[_0x6ef3('0x13')](_0x6ef3('0xf'),auth[_0x6ef3('0xb')](),controller[_0x6ef3('0x14')]);router[_0x6ef3('0x15')](_0x6ef3('0xf'),auth['isAuthenticated'](),controller[_0x6ef3('0x16')]);module[_0x6ef3('0x17')]=router; \ No newline at end of file +var _0x0a58=['post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x57ef8c,_0x45968b){var _0x44aa40=function(_0x2aa9e2){while(--_0x2aa9e2){_0x57ef8c['push'](_0x57ef8c['shift']());}};_0x44aa40(++_0x45968b);}(_0x0a58,0x10f));var _0x80a5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0a58[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x80a5('0x0'));var util=require(_0x80a5('0x1'));var path=require(_0x80a5('0x2'));var timeout=require(_0x80a5('0x3'));var express=require(_0x80a5('0x4'));var router=express[_0x80a5('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x80a5('0x6'));var config=require(_0x80a5('0x7'));var controller=require(_0x80a5('0x8'));router[_0x80a5('0x9')]('/',auth[_0x80a5('0xa')](),controller[_0x80a5('0xb')]);router['get'](_0x80a5('0xc'),auth[_0x80a5('0xa')](),controller[_0x80a5('0xd')]);router[_0x80a5('0x9')]('/:id',auth[_0x80a5('0xa')](),controller[_0x80a5('0xe')]);router[_0x80a5('0xf')]('/',auth[_0x80a5('0xa')](),controller[_0x80a5('0x10')]);router[_0x80a5('0x11')](_0x80a5('0x12'),auth[_0x80a5('0xa')](),controller[_0x80a5('0x13')]);router[_0x80a5('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x80a5('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 8755884..8ae0016 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 _0x5f66=['INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE','BOOLEAN'];(function(_0x48d6a3,_0x37c848){var _0x38bfa0=function(_0x3fba2e){while(--_0x3fba2e){_0x48d6a3['push'](_0x48d6a3['shift']());}};_0x38bfa0(++_0x37c848);}(_0x5f66,0x1a0));var _0x65f6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5f66[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x65f6('0x1')]},'calleridnum':{'type':Sequelize[_0x65f6('0x1')]},'calleridname':{'type':Sequelize[_0x65f6('0x1')]},'queue':{'type':Sequelize[_0x65f6('0x1')]},'interface':{'type':Sequelize[_0x65f6('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x65f6('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x65f6('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x65f6('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x65f6('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x65f6('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x65f6('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x65f6('0x4')]},'agentacw':{'type':Sequelize[_0x65f6('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x65f6('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x65f6('0x1')]},'channelstate':{'type':Sequelize[_0x65f6('0x4')]},'channelstatedesc':{'type':Sequelize[_0x65f6('0x1')]},'connectedlinenum':{'type':Sequelize[_0x65f6('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x65f6('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x65f6('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x65f6('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x65f6('0x1')]},'destcalleridnum':{'type':Sequelize[_0x65f6('0x1')]},'destcalleridname':{'type':Sequelize[_0x65f6('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x65f6('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x65f6('0x1')]},'destlanguage':{'type':Sequelize[_0x65f6('0x1')]},'destaccountcode':{'type':Sequelize[_0x65f6('0x1')]},'destcontext':{'type':Sequelize[_0x65f6('0x1')]},'destexten':{'type':Sequelize[_0x65f6('0x1')]},'destpriority':{'type':Sequelize[_0x65f6('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x65f6('0x1')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x65f6('0x1')],'comment':_0x65f6('0x5')},'transferexten':{'type':Sequelize[_0x65f6('0x1')]},'transferuniqueid':{'type':Sequelize[_0x65f6('0x1')]},'agententerreason':{'type':Sequelize[_0x65f6('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6a95=['BOOLEAN','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x12395b,_0x3d5929){var _0x5b555a=function(_0x27b98e){while(--_0x27b98e){_0x12395b['push'](_0x12395b['shift']());}};_0x5b555a(++_0x3d5929);}(_0x6a95,0x1db));var _0x56a9=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x6a95[_0x32d457];return _0x338386;};'use strict';var Sequelize=require(_0x56a9('0x0'));module[_0x56a9('0x1')]={'type':{'type':Sequelize[_0x56a9('0x2')]},'uniqueid':{'type':Sequelize[_0x56a9('0x2')]},'calleridnum':{'type':Sequelize[_0x56a9('0x2')]},'calleridname':{'type':Sequelize[_0x56a9('0x2')]},'queue':{'type':Sequelize[_0x56a9('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x56a9('0x3')]},'agentconnectAt':{'type':Sequelize[_0x56a9('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x56a9('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x56a9('0x3')]},'agentdumpAt':{'type':Sequelize[_0x56a9('0x3')]},'holdtime':{'type':Sequelize[_0x56a9('0x4')]},'agentcomplete':{'type':Sequelize[_0x56a9('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x56a9('0x4')]},'agentacw':{'type':Sequelize[_0x56a9('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x56a9('0x2')]},'lastevent':{'type':Sequelize[_0x56a9('0x2')]},'channel':{'type':Sequelize[_0x56a9('0x2')]},'channelstate':{'type':Sequelize[_0x56a9('0x4')]},'channelstatedesc':{'type':Sequelize[_0x56a9('0x2')]},'connectedlinenum':{'type':Sequelize[_0x56a9('0x2')]},'connectedlinename':{'type':Sequelize[_0x56a9('0x2')]},'language':{'type':Sequelize[_0x56a9('0x2')]},'accountcode':{'type':Sequelize[_0x56a9('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x56a9('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x56a9('0x2')]},'destchannelstate':{'type':Sequelize[_0x56a9('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x56a9('0x2')]},'destcalleridnum':{'type':Sequelize[_0x56a9('0x2')]},'destcalleridname':{'type':Sequelize[_0x56a9('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x56a9('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x56a9('0x2')]},'destlanguage':{'type':Sequelize[_0x56a9('0x2')]},'destaccountcode':{'type':Sequelize[_0x56a9('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x56a9('0x2')]},'destuniqueid':{'type':Sequelize[_0x56a9('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x56a9('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x56a9('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x56a9('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x56a9('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 9f64646..8be525b 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.controller.js +++ b/server/api/voiceAgentReport/voiceAgentReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file +var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index fa32be3..bdb5081 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 _0xc18a=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0xc18a,0x1cf));var _0xac18=function(_0x488796,_0x1a7c21){_0x488796=_0x488796-0x0;var _0x41c5d4=_0xc18a[_0x488796];return _0x41c5d4;};'use strict';var _=require(_0xac18('0x0'));var util=require(_0xac18('0x1'));var logger=require(_0xac18('0x2'))(_0xac18('0x3'));var moment=require('moment');var BPromise=require(_0xac18('0x4'));var rp=require(_0xac18('0x5'));var fs=require('fs');var path=require(_0xac18('0x6'));var rimraf=require(_0xac18('0x7'));var config=require(_0xac18('0x8'));var attributes=require(_0xac18('0x9'));module[_0xac18('0xa')]=function(_0x395493,_0x49136f){return _0x395493[_0xac18('0xb')](_0xac18('0xc'),attributes,{'tableName':_0xac18('0xd'),'paranoid':![],'indexes':[{'fields':[_0xac18('0xe'),_0xac18('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6f47=['../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','uniqueid','destuniqueid','util','../../config/logger','moment','request-promise','rimraf'];(function(_0x49b8bc,_0x2e5cf4){var _0x18c302=function(_0x4e7fc3){while(--_0x4e7fc3){_0x49b8bc['push'](_0x49b8bc['shift']());}};_0x18c302(++_0x2e5cf4);}(_0x6f47,0xc7));var _0x76f4=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x6f47[_0x4a3898];return _0x25ceb0;};'use strict';var _=require('lodash');var util=require(_0x76f4('0x0'));var logger=require(_0x76f4('0x1'))('api');var moment=require(_0x76f4('0x2'));var BPromise=require('bluebird');var rp=require(_0x76f4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x76f4('0x4'));var config=require(_0x76f4('0x5'));var attributes=require(_0x76f4('0x6'));module[_0x76f4('0x7')]=function(_0x5754ca,_0x35602f){return _0x5754ca[_0x76f4('0x8')](_0x76f4('0x9'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x76f4('0xa'),_0x76f4('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index f18d1ff..eca916e 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 _0x1ce0=['debug','stringify','update','options','where','limit','UpdateVoiceAgentReport','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','body','raw'];(function(_0x2c63aa,_0x1d67b0){var _0x3e66a9=function(_0x68f3ad){while(--_0x68f3ad){_0x2c63aa['push'](_0x2c63aa['shift']());}};_0x3e66a9(++_0x1d67b0);}(_0x1ce0,0x18f));var _0x01ce=function(_0x366e99,_0x15d82d){_0x366e99=_0x366e99-0x0;var _0x180bbe=_0x1ce0[_0x366e99];return _0x180bbe;};'use strict';var _=require('lodash');var util=require(_0x01ce('0x0'));var moment=require(_0x01ce('0x1'));var BPromise=require(_0x01ce('0x2'));var rs=require(_0x01ce('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x01ce('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x01ce('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x01ce('0x6'));var client=jayson[_0x01ce('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e46e7,_0x517573,_0x3da4e2){return new BPromise(function(_0x1efd12,_0x3b96c0){return client['request'](_0x2e46e7,_0x3da4e2)[_0x01ce('0x8')](function(_0x42ebce){logger[_0x01ce('0x9')](_0x01ce('0xa'),_0x517573,_0x01ce('0xb'));logger['debug']('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x517573,_0x01ce('0xb'),JSON['stringify'](_0x42ebce));if(_0x42ebce[_0x01ce('0xc')]){if(_0x42ebce[_0x01ce('0xc')][_0x01ce('0xd')]===0x1f4){logger[_0x01ce('0xc')](_0x01ce('0xa'),_0x517573,_0x42ebce[_0x01ce('0xc')][_0x01ce('0xe')]);return _0x3b96c0(_0x42ebce[_0x01ce('0xc')]['message']);}logger[_0x01ce('0xc')]('VoiceAgentReport,\x20%s,\x20%s',_0x517573,_0x42ebce[_0x01ce('0xc')]['message']);return _0x1efd12(_0x42ebce['error'][_0x01ce('0xe')]);}else{logger[_0x01ce('0x9')](_0x01ce('0xa'),_0x517573,_0x01ce('0xb'));_0x1efd12(_0x42ebce[_0x01ce('0xf')][_0x01ce('0xe')]);}})[_0x01ce('0x10')](function(_0x35df0f){logger['error'](_0x01ce('0xa'),_0x517573,_0x35df0f);_0x3b96c0(_0x35df0f);});});}exports[_0x01ce('0x11')]=function(_0x14efe9){var _0x1cc6c6=this;return new Promise(function(_0x4e02e4,_0x3e4332){return db[_0x01ce('0x12')]['create'](_0x14efe9[_0x01ce('0x13')],{'raw':_0x14efe9['options']?_0x14efe9['options'][_0x01ce('0x14')]===undefined?!![]:![]:!![]})[_0x01ce('0x8')](function(_0x2713f8){logger[_0x01ce('0x9')]('CreateVoiceAgentReport',_0x14efe9);logger[_0x01ce('0x15')](_0x01ce('0x11'),_0x14efe9,JSON[_0x01ce('0x16')](_0x2713f8));_0x4e02e4(_0x2713f8);})[_0x01ce('0x10')](function(_0x4519aa){logger['error']('CreateVoiceAgentReport',_0x4519aa[_0x01ce('0xe')],_0x14efe9);_0x3e4332(_0x1cc6c6['error'](0x1f4,_0x4519aa['message']));});});};exports['UpdateVoiceAgentReport']=function(_0x494b5c){var _0x35a165=this;return new Promise(function(_0x5fc46f,_0x20f25a){return db[_0x01ce('0x12')][_0x01ce('0x17')](_0x494b5c[_0x01ce('0x13')],{'raw':_0x494b5c[_0x01ce('0x18')]?_0x494b5c[_0x01ce('0x18')][_0x01ce('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x494b5c['options']?_0x494b5c[_0x01ce('0x18')][_0x01ce('0x19')]||null:null,'attributes':_0x494b5c[_0x01ce('0x18')]?_0x494b5c['options']['attributes']||null:null,'limit':_0x494b5c[_0x01ce('0x18')]?_0x494b5c[_0x01ce('0x18')][_0x01ce('0x1a')]||null:null})['then'](function(_0x46ce02){logger['info'](_0x01ce('0x1b'),_0x494b5c);logger[_0x01ce('0x15')](_0x01ce('0x1b'),_0x494b5c,JSON[_0x01ce('0x16')](_0x46ce02));_0x5fc46f(_0x46ce02);})[_0x01ce('0x10')](function(_0x49e04c){logger[_0x01ce('0xc')]('UpdateVoiceAgentReport',_0x49e04c[_0x01ce('0xe')],_0x494b5c);_0x20f25a(_0x35a165[_0x01ce('0xc')](0x1f4,_0x49e04c[_0x01ce('0xe')]));});});}; \ No newline at end of file +var _0x2ada=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','debug','UpdateVoiceAgentReport','where','attributes','limit'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2ada,0x1ce));var _0xa2ad=function(_0x476c7,_0x298ee0){_0x476c7=_0x476c7-0x0;var _0x47ae56=_0x2ada[_0x476c7];return _0x47ae56;};'use strict';var _=require(_0xa2ad('0x0'));var util=require(_0xa2ad('0x1'));var moment=require('moment');var BPromise=require(_0xa2ad('0x2'));var rs=require(_0xa2ad('0x3'));var fs=require('fs');var Redis=require(_0xa2ad('0x4'));var db=require(_0xa2ad('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa2ad('0x6'))(_0xa2ad('0x7'));var config=require(_0xa2ad('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa2ad('0x9')][_0xa2ad('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x149804,_0x40f0f7,_0x2bbbe8){return new BPromise(function(_0x331531,_0x21e14d){return client[_0xa2ad('0xb')](_0x149804,_0x2bbbe8)[_0xa2ad('0xc')](function(_0x572ae7){logger[_0xa2ad('0xd')](_0xa2ad('0xe'),_0x40f0f7,_0xa2ad('0xf'));logger['debug']('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x40f0f7,_0xa2ad('0xf'),JSON[_0xa2ad('0x10')](_0x572ae7));if(_0x572ae7[_0xa2ad('0x11')]){if(_0x572ae7['error'][_0xa2ad('0x12')]===0x1f4){logger[_0xa2ad('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x40f0f7,_0x572ae7['error']['message']);return _0x21e14d(_0x572ae7[_0xa2ad('0x11')][_0xa2ad('0x13')]);}logger[_0xa2ad('0x11')](_0xa2ad('0xe'),_0x40f0f7,_0x572ae7[_0xa2ad('0x11')][_0xa2ad('0x13')]);return _0x331531(_0x572ae7[_0xa2ad('0x11')]['message']);}else{logger[_0xa2ad('0xd')](_0xa2ad('0xe'),_0x40f0f7,'request\x20sent');_0x331531(_0x572ae7[_0xa2ad('0x14')]['message']);}})[_0xa2ad('0x15')](function(_0x3b867e){logger[_0xa2ad('0x11')](_0xa2ad('0xe'),_0x40f0f7,_0x3b867e);_0x21e14d(_0x3b867e);});});}exports[_0xa2ad('0x16')]=function(_0x4c8f5b){var _0x4fb831=this;return new Promise(function(_0x69e571,_0xf53390){return db[_0xa2ad('0x17')][_0xa2ad('0x18')](_0x4c8f5b[_0xa2ad('0x19')],{'raw':_0x4c8f5b[_0xa2ad('0x1a')]?_0x4c8f5b[_0xa2ad('0x1a')][_0xa2ad('0x1b')]===undefined?!![]:![]:!![]})[_0xa2ad('0xc')](function(_0x8a357d){logger[_0xa2ad('0xd')](_0xa2ad('0x16'),_0x4c8f5b);logger[_0xa2ad('0x1c')](_0xa2ad('0x16'),_0x4c8f5b,JSON[_0xa2ad('0x10')](_0x8a357d));_0x69e571(_0x8a357d);})[_0xa2ad('0x15')](function(_0x346cbc){logger[_0xa2ad('0x11')]('CreateVoiceAgentReport',_0x346cbc[_0xa2ad('0x13')],_0x4c8f5b);_0xf53390(_0x4fb831['error'](0x1f4,_0x346cbc['message']));});});};exports[_0xa2ad('0x1d')]=function(_0x384e53){var _0x31a5a6=this;return new Promise(function(_0x3011f3,_0x48b3f4){return db[_0xa2ad('0x17')]['update'](_0x384e53[_0xa2ad('0x19')],{'raw':_0x384e53[_0xa2ad('0x1a')]?_0x384e53['options'][_0xa2ad('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x384e53[_0xa2ad('0x1a')]?_0x384e53[_0xa2ad('0x1a')][_0xa2ad('0x1e')]||null:null,'attributes':_0x384e53[_0xa2ad('0x1a')]?_0x384e53[_0xa2ad('0x1a')][_0xa2ad('0x1f')]||null:null,'limit':_0x384e53[_0xa2ad('0x1a')]?_0x384e53[_0xa2ad('0x1a')][_0xa2ad('0x20')]||null:null})[_0xa2ad('0xc')](function(_0x4847c2){logger['info'](_0xa2ad('0x1d'),_0x384e53);logger[_0xa2ad('0x1c')](_0xa2ad('0x1d'),_0x384e53,JSON['stringify'](_0x4847c2));_0x3011f3(_0x4847c2);})[_0xa2ad('0x15')](function(_0x55fdfd){logger[_0xa2ad('0x11')]('UpdateVoiceAgentReport',_0x55fdfd['message'],_0x384e53);_0x48b3f4(_0x31a5a6[_0xa2ad('0x11')](0x1f4,_0x55fdfd[_0xa2ad('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 63ab3f5..e73c473 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 _0x3baf=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x584d87,_0x4d5023){var _0x3f8db5=function(_0x122bb2){while(--_0x122bb2){_0x584d87['push'](_0x584d87['shift']());}};_0x3f8db5(++_0x4d5023);}(_0x3baf,0xf7));var _0xf3ba=function(_0x71bca8,_0x46656e){_0x71bca8=_0x71bca8-0x0;var _0x2691f5=_0x3baf[_0x71bca8];return _0x2691f5;};'use strict';var multer=require(_0xf3ba('0x0'));var util=require(_0xf3ba('0x1'));var path=require(_0xf3ba('0x2'));var timeout=require(_0xf3ba('0x3'));var express=require(_0xf3ba('0x4'));var router=express[_0xf3ba('0x5')]();var fs_extra=require(_0xf3ba('0x6'));var auth=require(_0xf3ba('0x7'));var interaction=require(_0xf3ba('0x8'));var config=require(_0xf3ba('0x9'));var controller=require(_0xf3ba('0xa'));router[_0xf3ba('0xb')]('/',auth[_0xf3ba('0xc')](),controller[_0xf3ba('0xd')]);router[_0xf3ba('0xb')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xf3ba('0xb')]('/:id',auth[_0xf3ba('0xc')](),controller[_0xf3ba('0xe')]);router[_0xf3ba('0xf')]('/',auth[_0xf3ba('0xc')](),controller[_0xf3ba('0x10')]);router[_0xf3ba('0x11')](_0xf3ba('0x12'),auth[_0xf3ba('0xc')](),controller[_0xf3ba('0x13')]);router[_0xf3ba('0x14')](_0xf3ba('0x12'),auth[_0xf3ba('0xc')](),controller[_0xf3ba('0x15')]);module[_0xf3ba('0x16')]=router; \ No newline at end of file +var _0x0e85=['/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','index'];(function(_0x3a6e4b,_0x118cd9){var _0x36572d=function(_0x2a53cf){while(--_0x2a53cf){_0x3a6e4b['push'](_0x3a6e4b['shift']());}};_0x36572d(++_0x118cd9);}(_0x0e85,0x7c));var _0x50e8=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x0e85[_0x500419];return _0x241c1a;};'use strict';var multer=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var path=require('path');var timeout=require(_0x50e8('0x2'));var express=require(_0x50e8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x50e8('0x4'));var config=require('../../config/environment');var controller=require(_0x50e8('0x5'));router[_0x50e8('0x6')]('/',auth[_0x50e8('0x7')](),controller[_0x50e8('0x8')]);router['get'](_0x50e8('0x9'),auth[_0x50e8('0x7')](),controller[_0x50e8('0xa')]);router[_0x50e8('0x6')](_0x50e8('0xb'),auth[_0x50e8('0x7')](),controller['show']);router[_0x50e8('0xc')]('/',auth[_0x50e8('0x7')](),controller[_0x50e8('0xd')]);router[_0x50e8('0xe')](_0x50e8('0xb'),auth[_0x50e8('0x7')](),controller[_0x50e8('0xf')]);router[_0x50e8('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x50e8('0x11')]);module[_0x50e8('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 69aad9b..d82bade 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 _0x20e8=['exports','STRING','ENUM','inbound','internal','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize'];(function(_0x402755,_0x4a65ed){var _0x508c7c=function(_0x3305a6){while(--_0x3305a6){_0x402755['push'](_0x402755['shift']());}};_0x508c7c(++_0x4a65ed);}(_0x20e8,0x6b));var _0x820e=function(_0x369de9,_0x3c5d03){_0x369de9=_0x369de9-0x0;var _0x9634f=_0x20e8[_0x369de9];return _0x9634f;};'use strict';var Sequelize=require(_0x820e('0x0'));module[_0x820e('0x1')]={'uniqueid':{'type':Sequelize[_0x820e('0x2')]},'type':{'type':Sequelize[_0x820e('0x3')](_0x820e('0x4'),_0x820e('0x5'),'outbound',_0x820e('0x6'),_0x820e('0x7'),_0x820e('0x8'))},'tag':{'type':Sequelize[_0x820e('0x2')]},'accountcode':{'type':Sequelize[_0x820e('0x2')]},'source':{'type':Sequelize[_0x820e('0x2')]},'destination':{'type':Sequelize[_0x820e('0x2')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x820e('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x820e('0x9')]},'starttime':{'type':Sequelize[_0x820e('0xa')]},'systemanswertime':{'type':Sequelize[_0x820e('0xa')]},'answertime':{'type':Sequelize[_0x820e('0xa')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x820e('0xb')]},'billableseconds':{'type':Sequelize[_0x820e('0xb')]},'mohtime':{'type':Sequelize[_0x820e('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x820e('0x2')]},'amaflags':{'type':Sequelize[_0x820e('0x2')]},'userfield':{'type':Sequelize[_0x820e('0x2')]},'userDisposition':{'type':Sequelize[_0x820e('0x2')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0x820e('0x2')]},'note':{'type':Sequelize[_0x820e('0x2')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x820e('0xb')]},'sipcallid':{'type':Sequelize[_0x820e('0x2')]}}; \ No newline at end of file +var _0x8107=['outbound-fax','dialer','DATE','INTEGER','STRING','ENUM','inbound','internal','outbound'];(function(_0x111bc4,_0x342e2a){var _0x11dee6=function(_0x1e8f85){while(--_0x1e8f85){_0x111bc4['push'](_0x111bc4['shift']());}};_0x11dee6(++_0x342e2a);}(_0x8107,0x109));var _0x7810=function(_0x9f721,_0x14bcc5){_0x9f721=_0x9f721-0x0;var _0x20052d=_0x8107[_0x9f721];return _0x20052d;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x7810('0x0')]},'type':{'type':Sequelize[_0x7810('0x1')](_0x7810('0x2'),_0x7810('0x3'),_0x7810('0x4'),'inbound-fax',_0x7810('0x5'),_0x7810('0x6'))},'tag':{'type':Sequelize[_0x7810('0x0')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x7810('0x0')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x7810('0x0')]},'destinationchannel':{'type':Sequelize[_0x7810('0x0')]},'lastapplication':{'type':Sequelize[_0x7810('0x0')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x7810('0x7')]},'systemanswertime':{'type':Sequelize[_0x7810('0x7')]},'answertime':{'type':Sequelize[_0x7810('0x7')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x7810('0x8')]},'billableseconds':{'type':Sequelize[_0x7810('0x8')]},'mohtime':{'type':Sequelize[_0x7810('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x7810('0x0')]},'amaflags':{'type':Sequelize[_0x7810('0x0')]},'userfield':{'type':Sequelize[_0x7810('0x0')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x7810('0x0')]},'userThirdDisposition':{'type':Sequelize[_0x7810('0x0')]},'note':{'type':Sequelize[_0x7810('0x0')]},'prefix':{'type':Sequelize[_0x7810('0x0')]},'routeid':{'type':Sequelize[_0x7810('0x8')]},'sipcallid':{'type':Sequelize[_0x7810('0x0')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 901969a..1ab9e1a 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0x37b7b6,_0x165a5c){var _0x10c4c3=function(_0x16d71e){while(--_0x16d71e){_0x37b7b6['push'](_0x37b7b6['shift']());}};_0x10c4c3(++_0x165a5c);}(_0xadb5,0xad));var _0x5adb=function(_0x446a4,_0x138bbe){_0x446a4=_0x446a4-0x0;var _0x54b0b5=_0xadb5[_0x446a4];return _0x54b0b5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));}; \ No newline at end of file +var _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x57643b,_0x1706fe){var _0x53a35b=function(_0x2625e8){while(--_0x2625e8){_0x57643b['push'](_0x57643b['shift']());}};_0x53a35b(++_0x1706fe);}(_0x5f2f,0x73));var _0xf5f2=function(_0x73fb2e,_0x15e27b){_0x73fb2e=_0x73fb2e-0x0;var _0x5e7f30=_0x5f2f[_0x73fb2e];return _0x5e7f30;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index c1ce8f1..542e241 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 _0x301d=['./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x39e9f6,_0x19869e){var _0x5a81d3=function(_0x194dfe){while(--_0x194dfe){_0x39e9f6['push'](_0x39e9f6['shift']());}};_0x5a81d3(++_0x19869e);}(_0x301d,0xe6));var _0xd301=function(_0x37d04a,_0x2110cc){_0x37d04a=_0x37d04a-0x0;var _0x4327cc=_0x301d[_0x37d04a];return _0x4327cc;};'use strict';var _=require(_0xd301('0x0'));var util=require(_0xd301('0x1'));var logger=require(_0xd301('0x2'))(_0xd301('0x3'));var moment=require(_0xd301('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd301('0x5'));var rimraf=require(_0xd301('0x6'));var config=require(_0xd301('0x7'));var attributes=require(_0xd301('0x8'));module[_0xd301('0x9')]=function(_0x43ec72,_0x58e879){return _0x43ec72[_0xd301('0xa')](_0xd301('0xb'),attributes,{'tableName':_0xd301('0xc'),'paranoid':![],'indexes':[{'fields':[_0xd301('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa88e=['VoiceCallReport','lodash','util','bluebird','request-promise','path','rimraf','./voiceCallReport.attributes','exports','define'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xa88e,0x8d));var _0xea88=function(_0x3e96ba,_0x471e0b){_0x3e96ba=_0x3e96ba-0x0;var _0x216814=_0xa88e[_0x3e96ba];return _0x216814;};'use strict';var _=require(_0xea88('0x0'));var util=require(_0xea88('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xea88('0x2'));var rp=require(_0xea88('0x3'));var fs=require('fs');var path=require(_0xea88('0x4'));var rimraf=require(_0xea88('0x5'));var config=require('../../config/environment');var attributes=require(_0xea88('0x6'));module[_0xea88('0x7')]=function(_0x8f7bb1,_0x1b5f38){return _0x8f7bb1[_0xea88('0x8')](_0xea88('0x9'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 1de7b02..77c1ef1 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 _0x8348=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','VoiceCallReport','findAll','options','raw','attributes','limit','include','map','model','GetVoiceCallReport','CreateVoiceCallReport','create','update','body','where','UpdateVoiceCallReport','lodash','util'];(function(_0x451353,_0x19710b){var _0x102315=function(_0x51204c){while(--_0x51204c){_0x451353['push'](_0x451353['shift']());}};_0x102315(++_0x19710b);}(_0x8348,0x184));var _0x8834=function(_0x952677,_0x3714c0){_0x952677=_0x952677-0x0;var _0x1446c5=_0x8348[_0x952677];return _0x1446c5;};'use strict';var _=require(_0x8834('0x0'));var util=require(_0x8834('0x1'));var moment=require('moment');var BPromise=require(_0x8834('0x2'));var rs=require(_0x8834('0x3'));var fs=require('fs');var Redis=require(_0x8834('0x4'));var db=require(_0x8834('0x5'))['db'];var utils=require(_0x8834('0x6'));var logger=require('../../config/logger')(_0x8834('0x7'));var config=require(_0x8834('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8834('0x9')][_0x8834('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36e3b2,_0x2cd0c3,_0x3667c9){return new BPromise(function(_0x4cf706,_0x298658){return client[_0x8834('0xb')](_0x36e3b2,_0x3667c9)[_0x8834('0xc')](function(_0x5aa3d2){logger[_0x8834('0xd')](_0x8834('0xe'),_0x2cd0c3,_0x8834('0xf'));logger[_0x8834('0x10')](_0x8834('0x11'),_0x2cd0c3,_0x8834('0xf'),JSON[_0x8834('0x12')](_0x5aa3d2));if(_0x5aa3d2['error']){if(_0x5aa3d2[_0x8834('0x13')]['code']===0x1f4){logger[_0x8834('0x13')]('VoiceCallReport,\x20%s,\x20%s',_0x2cd0c3,_0x5aa3d2[_0x8834('0x13')]['message']);return _0x298658(_0x5aa3d2[_0x8834('0x13')][_0x8834('0x14')]);}logger[_0x8834('0x13')]('VoiceCallReport,\x20%s,\x20%s',_0x2cd0c3,_0x5aa3d2[_0x8834('0x13')][_0x8834('0x14')]);return _0x4cf706(_0x5aa3d2[_0x8834('0x13')][_0x8834('0x14')]);}else{logger[_0x8834('0xd')](_0x8834('0xe'),_0x2cd0c3,_0x8834('0xf'));_0x4cf706(_0x5aa3d2[_0x8834('0x15')][_0x8834('0x14')]);}})[_0x8834('0x16')](function(_0x121b3e){logger['error'](_0x8834('0xe'),_0x2cd0c3,_0x121b3e);_0x298658(_0x121b3e);});});}exports['GetVoiceCallReport']=function(_0xc1a8c7){var _0x45a1fd=this;return new Promise(function(_0x2e342c,_0x52be69){return db[_0x8834('0x17')][_0x8834('0x18')]({'raw':_0xc1a8c7[_0x8834('0x19')]?_0xc1a8c7[_0x8834('0x19')][_0x8834('0x1a')]===undefined?!![]:![]:!![],'where':_0xc1a8c7[_0x8834('0x19')]?_0xc1a8c7[_0x8834('0x19')]['where']||null:null,'attributes':_0xc1a8c7['options']?_0xc1a8c7[_0x8834('0x19')][_0x8834('0x1b')]||null:null,'limit':_0xc1a8c7['options']?_0xc1a8c7[_0x8834('0x19')][_0x8834('0x1c')]||null:null,'include':_0xc1a8c7[_0x8834('0x19')]?_0xc1a8c7[_0x8834('0x19')][_0x8834('0x1d')]?_[_0x8834('0x1e')](_0xc1a8c7[_0x8834('0x19')]['include'],function(_0x29c942){return{'model':db[_0x29c942[_0x8834('0x1f')]],'as':_0x29c942['as'],'attributes':_0x29c942[_0x8834('0x1b')],'include':_0x29c942['include']?_['map'](_0x29c942[_0x8834('0x1d')],function(_0x524721){return{'model':db[_0x524721[_0x8834('0x1f')]],'as':_0x524721['as'],'attributes':_0x524721[_0x8834('0x1b')],'include':_0x524721[_0x8834('0x1d')]?_[_0x8834('0x1e')](_0x524721[_0x8834('0x1d')],function(_0x680f8a){return{'model':db[_0x680f8a['model']],'as':_0x680f8a['as'],'attributes':_0x680f8a[_0x8834('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8834('0xc')](function(_0x29e215){logger['info']('GetVoiceCallReport',_0xc1a8c7);logger[_0x8834('0x10')](_0x8834('0x20'),_0xc1a8c7,JSON['stringify'](_0x29e215));_0x2e342c(_0x29e215);})[_0x8834('0x16')](function(_0x8f9b45){logger[_0x8834('0x13')](_0x8834('0x20'),_0x8f9b45[_0x8834('0x14')],_0xc1a8c7);_0x52be69(_0x45a1fd['error'](0x1f4,_0x8f9b45[_0x8834('0x14')]));});});};exports[_0x8834('0x21')]=function(_0x5e86df){var _0x719530=this;return new Promise(function(_0x46e132,_0x265089){return db['VoiceCallReport'][_0x8834('0x22')](_0x5e86df['body'],{'raw':_0x5e86df[_0x8834('0x19')]?_0x5e86df[_0x8834('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8834('0xc')](function(_0x2677ec){logger[_0x8834('0xd')]('CreateVoiceCallReport',_0x5e86df);logger[_0x8834('0x10')](_0x8834('0x21'),_0x5e86df,JSON[_0x8834('0x12')](_0x2677ec));_0x46e132(_0x2677ec);})[_0x8834('0x16')](function(_0x1aeb59){logger[_0x8834('0x13')](_0x8834('0x21'),_0x1aeb59[_0x8834('0x14')],_0x5e86df);_0x265089(_0x719530[_0x8834('0x13')](0x1f4,_0x1aeb59[_0x8834('0x14')]));});});};exports['UpdateVoiceCallReport']=function(_0x51e6fb){var _0x32f52f=this;return new Promise(function(_0x410448,_0x4a1ab0){return db[_0x8834('0x17')][_0x8834('0x23')](_0x51e6fb[_0x8834('0x24')],{'raw':_0x51e6fb['options']?_0x51e6fb[_0x8834('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51e6fb[_0x8834('0x19')]?_0x51e6fb['options'][_0x8834('0x25')]||null:null,'attributes':_0x51e6fb[_0x8834('0x19')]?_0x51e6fb['options'][_0x8834('0x1b')]||null:null,'limit':_0x51e6fb['options']?_0x51e6fb[_0x8834('0x19')][_0x8834('0x1c')]||null:null})[_0x8834('0xc')](function(_0x351668){logger[_0x8834('0xd')](_0x8834('0x26'),_0x51e6fb);logger[_0x8834('0x10')]('UpdateVoiceCallReport',_0x51e6fb,JSON[_0x8834('0x12')](_0x351668));_0x410448(_0x351668);})[_0x8834('0x16')](function(_0x530d06){logger[_0x8834('0x13')]('UpdateVoiceCallReport',_0x530d06[_0x8834('0x14')],_0x51e6fb);_0x4a1ab0(_0x32f52f[_0x8834('0x13')](0x1f4,_0x530d06[_0x8834('0x14')]));});});}; \ No newline at end of file +var _0xbb48=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','include','map','model','attributes','then','body','CreateVoiceCallReport','UpdateVoiceCallReport','update','limit','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x16216e,_0x2801de){var _0x330df1=function(_0x330b66){while(--_0x330b66){_0x16216e['push'](_0x16216e['shift']());}};_0x330df1(++_0x2801de);}(_0xbb48,0xbd));var _0x8bb4=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xbb48[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x8bb4('0x0'));var util=require('util');var moment=require(_0x8bb4('0x1'));var BPromise=require(_0x8bb4('0x2'));var rs=require(_0x8bb4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8bb4('0x4'))['db'];var utils=require(_0x8bb4('0x5'));var logger=require(_0x8bb4('0x6'))(_0x8bb4('0x7'));var config=require(_0x8bb4('0x8'));var jayson=require(_0x8bb4('0x9'));var client=jayson[_0x8bb4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a7362,_0x409887,_0x318b33){return new BPromise(function(_0x20c792,_0x2f7cdd){return client[_0x8bb4('0xb')](_0x4a7362,_0x318b33)['then'](function(_0x3bc028){logger[_0x8bb4('0xc')](_0x8bb4('0xd'),_0x409887,'request\x20sent');logger[_0x8bb4('0xe')](_0x8bb4('0xf'),_0x409887,_0x8bb4('0x10'),JSON[_0x8bb4('0x11')](_0x3bc028));if(_0x3bc028[_0x8bb4('0x12')]){if(_0x3bc028[_0x8bb4('0x12')][_0x8bb4('0x13')]===0x1f4){logger[_0x8bb4('0x12')](_0x8bb4('0xd'),_0x409887,_0x3bc028[_0x8bb4('0x12')][_0x8bb4('0x14')]);return _0x2f7cdd(_0x3bc028['error'][_0x8bb4('0x14')]);}logger[_0x8bb4('0x12')](_0x8bb4('0xd'),_0x409887,_0x3bc028[_0x8bb4('0x12')][_0x8bb4('0x14')]);return _0x20c792(_0x3bc028[_0x8bb4('0x12')][_0x8bb4('0x14')]);}else{logger[_0x8bb4('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x409887,_0x8bb4('0x10'));_0x20c792(_0x3bc028[_0x8bb4('0x15')][_0x8bb4('0x14')]);}})[_0x8bb4('0x16')](function(_0x26ce1a){logger['error'](_0x8bb4('0xd'),_0x409887,_0x26ce1a);_0x2f7cdd(_0x26ce1a);});});}exports[_0x8bb4('0x17')]=function(_0x18afb8){var _0x1fe79a=this;return new Promise(function(_0x550dea,_0x3730d0){return db[_0x8bb4('0x18')][_0x8bb4('0x19')]({'raw':_0x18afb8[_0x8bb4('0x1a')]?_0x18afb8['options'][_0x8bb4('0x1b')]===undefined?!![]:![]:!![],'where':_0x18afb8[_0x8bb4('0x1a')]?_0x18afb8['options'][_0x8bb4('0x1c')]||null:null,'attributes':_0x18afb8[_0x8bb4('0x1a')]?_0x18afb8[_0x8bb4('0x1a')]['attributes']||null:null,'limit':_0x18afb8[_0x8bb4('0x1a')]?_0x18afb8[_0x8bb4('0x1a')]['limit']||null:null,'include':_0x18afb8[_0x8bb4('0x1a')]?_0x18afb8[_0x8bb4('0x1a')][_0x8bb4('0x1d')]?_[_0x8bb4('0x1e')](_0x18afb8[_0x8bb4('0x1a')]['include'],function(_0x11db0b){return{'model':db[_0x11db0b[_0x8bb4('0x1f')]],'as':_0x11db0b['as'],'attributes':_0x11db0b[_0x8bb4('0x20')],'include':_0x11db0b[_0x8bb4('0x1d')]?_[_0x8bb4('0x1e')](_0x11db0b['include'],function(_0x577e6c){return{'model':db[_0x577e6c[_0x8bb4('0x1f')]],'as':_0x577e6c['as'],'attributes':_0x577e6c['attributes'],'include':_0x577e6c['include']?_[_0x8bb4('0x1e')](_0x577e6c[_0x8bb4('0x1d')],function(_0x11c073){return{'model':db[_0x11c073[_0x8bb4('0x1f')]],'as':_0x11c073['as'],'attributes':_0x11c073['attributes']};}):[]};}):[]};}):[]:[]})[_0x8bb4('0x21')](function(_0x152ca5){logger[_0x8bb4('0xc')](_0x8bb4('0x17'),_0x18afb8);logger[_0x8bb4('0xe')](_0x8bb4('0x17'),_0x18afb8,JSON[_0x8bb4('0x11')](_0x152ca5));_0x550dea(_0x152ca5);})[_0x8bb4('0x16')](function(_0x3b87e6){logger['error'](_0x8bb4('0x17'),_0x3b87e6['message'],_0x18afb8);_0x3730d0(_0x1fe79a[_0x8bb4('0x12')](0x1f4,_0x3b87e6[_0x8bb4('0x14')]));});});};exports['CreateVoiceCallReport']=function(_0x34f7ae){var _0x3c0727=this;return new Promise(function(_0xcee283,_0x2a2d4c){return db[_0x8bb4('0x18')]['create'](_0x34f7ae[_0x8bb4('0x22')],{'raw':_0x34f7ae[_0x8bb4('0x1a')]?_0x34f7ae[_0x8bb4('0x1a')][_0x8bb4('0x1b')]===undefined?!![]:![]:!![]})[_0x8bb4('0x21')](function(_0x508b63){logger[_0x8bb4('0xc')](_0x8bb4('0x23'),_0x34f7ae);logger[_0x8bb4('0xe')]('CreateVoiceCallReport',_0x34f7ae,JSON[_0x8bb4('0x11')](_0x508b63));_0xcee283(_0x508b63);})[_0x8bb4('0x16')](function(_0x47fa5d){logger[_0x8bb4('0x12')](_0x8bb4('0x23'),_0x47fa5d[_0x8bb4('0x14')],_0x34f7ae);_0x2a2d4c(_0x3c0727['error'](0x1f4,_0x47fa5d[_0x8bb4('0x14')]));});});};exports[_0x8bb4('0x24')]=function(_0x274c5b){var _0x7d2279=this;return new Promise(function(_0x3884cd,_0x4cbed6){return db['VoiceCallReport'][_0x8bb4('0x25')](_0x274c5b[_0x8bb4('0x22')],{'raw':_0x274c5b[_0x8bb4('0x1a')]?_0x274c5b[_0x8bb4('0x1a')][_0x8bb4('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x274c5b[_0x8bb4('0x1a')]?_0x274c5b['options'][_0x8bb4('0x1c')]||null:null,'attributes':_0x274c5b[_0x8bb4('0x1a')]?_0x274c5b[_0x8bb4('0x1a')][_0x8bb4('0x20')]||null:null,'limit':_0x274c5b[_0x8bb4('0x1a')]?_0x274c5b[_0x8bb4('0x1a')][_0x8bb4('0x26')]||null:null})[_0x8bb4('0x21')](function(_0x14a36e){logger[_0x8bb4('0xc')](_0x8bb4('0x24'),_0x274c5b);logger[_0x8bb4('0xe')](_0x8bb4('0x24'),_0x274c5b,JSON[_0x8bb4('0x11')](_0x14a36e));_0x3884cd(_0x14a36e);})[_0x8bb4('0x16')](function(_0x7d226f){logger[_0x8bb4('0x12')](_0x8bb4('0x24'),_0x7d226f[_0x8bb4('0x14')],_0x274c5b);_0x4cbed6(_0x7d2279[_0x8bb4('0x12')](0x1f4,_0x7d226f[_0x8bb4('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 1defaaf..b154806 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 _0xa5d5=['show','post','create','put','/:id','update','delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated'];(function(_0x415682,_0x466881){var _0x1aa806=function(_0x558360){while(--_0x558360){_0x415682['push'](_0x415682['shift']());}};_0x1aa806(++_0x466881);}(_0xa5d5,0x1a6));var _0x5a5d=function(_0x21786b,_0x5426a9){_0x21786b=_0x21786b-0x0;var _0x3ea31a=_0xa5d5[_0x21786b];return _0x3ea31a;};'use strict';var multer=require(_0x5a5d('0x0'));var util=require(_0x5a5d('0x1'));var path=require('path');var timeout=require(_0x5a5d('0x2'));var express=require('express');var router=express[_0x5a5d('0x3')]();var fs_extra=require(_0x5a5d('0x4'));var auth=require(_0x5a5d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5a5d('0x6'));var controller=require(_0x5a5d('0x7'));router[_0x5a5d('0x8')]('/',auth[_0x5a5d('0x9')](),controller['index']);router[_0x5a5d('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x5a5d('0xa')]);router[_0x5a5d('0xb')]('/',auth[_0x5a5d('0x9')](),controller[_0x5a5d('0xc')]);router[_0x5a5d('0xd')](_0x5a5d('0xe'),auth[_0x5a5d('0x9')](),controller[_0x5a5d('0xf')]);router[_0x5a5d('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x5a5d('0x11')]);module['exports']=router; \ No newline at end of file +var _0x8414=['destroy','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','update','delete'];(function(_0x3f8344,_0x50f77e){var _0x5812a9=function(_0x339d56){while(--_0x339d56){_0x3f8344['push'](_0x3f8344['shift']());}};_0x5812a9(++_0x50f77e);}(_0x8414,0xc4));var _0x4841=function(_0xfcfc24,_0x48ca53){_0xfcfc24=_0xfcfc24-0x0;var _0x58f773=_0x8414[_0xfcfc24];return _0x58f773;};'use strict';var multer=require('multer');var util=require(_0x4841('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4841('0x1'));var router=express[_0x4841('0x2')]();var fs_extra=require(_0x4841('0x3'));var auth=require(_0x4841('0x4'));var interaction=require(_0x4841('0x5'));var config=require(_0x4841('0x6'));var controller=require(_0x4841('0x7'));router[_0x4841('0x8')]('/',auth[_0x4841('0x9')](),controller[_0x4841('0xa')]);router[_0x4841('0x8')](_0x4841('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x4841('0x9')](),controller['create']);router['put']('/:id',auth[_0x4841('0x9')](),controller[_0x4841('0xc')]);router[_0x4841('0xd')](_0x4841('0xb'),auth['isAuthenticated'](),controller[_0x4841('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index c91f4b8..c9a1804 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 _0x9226=['BOOLEAN','sequelize','exports','name','STRING','setDataValue','options','join','getDataValue','split'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9226,0x1eb));var _0x6922=function(_0x179ed3,_0x5e6645){_0x179ed3=_0x179ed3-0x0;var _0x4d66b8=_0x9226[_0x179ed3];return _0x4d66b8;};'use strict';var Sequelize=require(_0x6922('0x0'));module[_0x6922('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING'],'unique':_0x6922('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x6922('0x3')],'set':function(_0x186ca0){this[_0x6922('0x4')](_0x6922('0x5'),_0x186ca0?_0x186ca0[_0x6922('0x6')](''):[]);},'get':function(){return this[_0x6922('0x7')](_0x6922('0x5'))?this[_0x6922('0x7')](_0x6922('0x5'))[_0x6922('0x8')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x6922('0x3')]},'record':{'type':Sequelize[_0x6922('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x6922('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf196=['options','join','getDataValue','split','sequelize','exports','STRING','name'];(function(_0x2101ad,_0x2a0cd1){var _0x3fe0ab=function(_0x1dc1d4){while(--_0x1dc1d4){_0x2101ad['push'](_0x2101ad['shift']());}};_0x3fe0ab(++_0x2a0cd1);}(_0xf196,0x6c));var _0x6f19=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf196[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x6f19('0x0'));module[_0x6f19('0x1')]={'name':{'type':Sequelize[_0x6f19('0x2')]},'prefix':{'type':Sequelize[_0x6f19('0x2')],'unique':_0x6f19('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x6f19('0x2')],'set':function(_0x2ccbc4){this['setDataValue'](_0x6f19('0x4'),_0x2ccbc4?_0x2ccbc4[_0x6f19('0x5')](''):[]);},'get':function(){return this['getDataValue']('options')?this[_0x6f19('0x6')](_0x6f19('0x4'))[_0x6f19('0x7')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x6f19('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index b816ce1..63aa2cf 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 _0x0b96=['userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','save','update','destroy','get','ChanSpies','then','error','stack','name','send','map','VoiceChanSpy','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','model','fields','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','rows','params','length','includeAll','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x45dbe3,_0xd2bf96){var _0x1e71cf=function(_0x47d46d){while(--_0x47d46d){_0x45dbe3['push'](_0x45dbe3['shift']());}};_0x1e71cf(++_0xd2bf96);}(_0x0b96,0xa5));var _0x60b9=function(_0xd4e6b4,_0x14394e){_0xd4e6b4=_0xd4e6b4-0x0;var _0x63f282=_0x0b96[_0xd4e6b4];return _0x63f282;};'use strict';var emlformat=require(_0x60b9('0x0'));var rimraf=require(_0x60b9('0x1'));var zipdir=require(_0x60b9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x60b9('0x3'));var moment=require(_0x60b9('0x4'));var BPromise=require(_0x60b9('0x5'));var Mustache=require('mustache');var util=require(_0x60b9('0x6'));var path=require(_0x60b9('0x7'));var sox=require('sox');var csv=require(_0x60b9('0x8'));var ejs=require(_0x60b9('0x9'));var fs=require('fs');var fs_extra=require(_0x60b9('0xa'));var _=require(_0x60b9('0xb'));var squel=require(_0x60b9('0xc'));var crypto=require(_0x60b9('0xd'));var jsforce=require(_0x60b9('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x60b9('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x60b9('0xf'));var authService=require(_0x60b9('0x10'));var qs=require(_0x60b9('0x11'));var as=require(_0x60b9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x60b9('0x13'))(_0x60b9('0x14'));var utils=require(_0x60b9('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x60b9('0x16'));var db=require(_0x60b9('0x17'))['db'];function respondWithStatusCode(_0x1b2d06,_0xa4144b){_0xa4144b=_0xa4144b||0xcc;return function(_0x243e4a){if(_0x243e4a){return _0x1b2d06[_0x60b9('0x18')](_0xa4144b);}return _0x1b2d06[_0x60b9('0x19')](_0xa4144b)[_0x60b9('0x1a')]();};}function respondWithResult(_0x3cc030,_0xd5e23a){_0xd5e23a=_0xd5e23a||0xc8;return function(_0x443435){if(_0x443435){return _0x3cc030['status'](_0xd5e23a)[_0x60b9('0x1b')](_0x443435);}};}function respondWithFilteredResult(_0x3c5da0,_0x991547){return function(_0x20834a){if(_0x20834a){var _0x2d4995=typeof _0x991547['offset']===_0x60b9('0x1c')&&typeof _0x991547[_0x60b9('0x1d')]===_0x60b9('0x1c');var _0x265402=_0x20834a['count'];var _0x5b127c=_0x2d4995?0x0:_0x991547[_0x60b9('0x1e')];var _0x32a999=_0x2d4995?_0x20834a[_0x60b9('0x1f')]:_0x991547[_0x60b9('0x1e')]+_0x991547[_0x60b9('0x1d')];var _0x1ab9e2;if(_0x32a999>=_0x265402){_0x32a999=_0x265402;_0x1ab9e2=0xc8;}else{_0x1ab9e2=0xce;}_0x3c5da0[_0x60b9('0x19')](_0x1ab9e2);return _0x3c5da0['set'](_0x60b9('0x20'),_0x5b127c+'-'+_0x32a999+'/'+_0x265402)['json'](_0x20834a);}return null;};}function patchUpdates(_0xe1f747){return function(_0x293bb6){try{jsonpatch[_0x60b9('0x21')](_0x293bb6,_0xe1f747,!![]);}catch(_0x1bbab3){return BPromise['reject'](_0x1bbab3);}return _0x293bb6[_0x60b9('0x22')]();};}function saveUpdates(_0x305e0b,_0x33da87){return function(_0x54a11f){if(_0x54a11f){return _0x54a11f[_0x60b9('0x23')](_0x305e0b)['then'](function(_0x28fada){return _0x28fada;});}return null;};}function removeEntity(_0x12a6e8,_0x237ab5){return function(_0x285c05){if(_0x285c05){return _0x285c05[_0x60b9('0x24')]()['then'](function(){var _0x127ff4=_0x285c05[_0x60b9('0x25')]({'plain':!![]});var _0x353b08=_0x60b9('0x26');return db['UserProfileResource'][_0x60b9('0x24')]({'where':{'type':_0x353b08,'resourceId':_0x127ff4['id']}})['then'](function(){return _0x285c05;});})[_0x60b9('0x27')](function(){_0x12a6e8[_0x60b9('0x19')](0xcc)[_0x60b9('0x1a')]();});}};}function handleEntityNotFound(_0x2a0fcb,_0x91a998){return function(_0x42929c){if(!_0x42929c){_0x2a0fcb[_0x60b9('0x18')](0x194);}return _0x42929c;};}function handleError(_0x4b608e,_0x5cac7d){_0x5cac7d=_0x5cac7d||0x1f4;return function(_0x37e8a4){logger[_0x60b9('0x28')](_0x37e8a4[_0x60b9('0x29')]);if(_0x37e8a4[_0x60b9('0x2a')]){delete _0x37e8a4['name'];}_0x4b608e[_0x60b9('0x19')](_0x5cac7d)[_0x60b9('0x2b')](_0x37e8a4);};}exports['index']=function(_0x54cb0c,_0x22d4ef){var _0x3580af={},_0xdd2e62={},_0x42d8a3={'count':0x0,'rows':[]};var _0x5df123=_[_0x60b9('0x2c')](db[_0x60b9('0x2d')][_0x60b9('0x2e')],function(_0xd31a4f){return{'name':_0xd31a4f[_0x60b9('0x2f')],'type':_0xd31a4f[_0x60b9('0x30')][_0x60b9('0x31')]};});_0xdd2e62['model']=_[_0x60b9('0x2c')](_0x5df123,_0x60b9('0x2a'));_0xdd2e62[_0x60b9('0x32')]=_[_0x60b9('0x33')](_0x54cb0c[_0x60b9('0x32')]);_0xdd2e62[_0x60b9('0x34')]=_['intersection'](_0xdd2e62['model'],_0xdd2e62[_0x60b9('0x32')]);_0x3580af[_0x60b9('0x35')]=_[_0x60b9('0x36')](_0xdd2e62[_0x60b9('0x37')],qs[_0x60b9('0x38')](_0x54cb0c['query'][_0x60b9('0x38')]));_0x3580af[_0x60b9('0x35')]=_0x3580af[_0x60b9('0x35')]['length']?_0x3580af[_0x60b9('0x35')]:_0xdd2e62['model'];if(!_0x54cb0c['query'][_0x60b9('0x39')](_0x60b9('0x3a'))){_0x3580af[_0x60b9('0x1d')]=qs[_0x60b9('0x1d')](_0x54cb0c['query'][_0x60b9('0x1d')]);_0x3580af[_0x60b9('0x1e')]=qs[_0x60b9('0x1e')](_0x54cb0c[_0x60b9('0x32')][_0x60b9('0x1e')]);}_0x3580af['order']=qs['sort'](_0x54cb0c[_0x60b9('0x32')][_0x60b9('0x3b')]);_0x3580af[_0x60b9('0x3c')]=qs[_0x60b9('0x34')](_['pick'](_0x54cb0c[_0x60b9('0x32')],_0xdd2e62[_0x60b9('0x34')]),_0x5df123);if(_0x54cb0c[_0x60b9('0x32')][_0x60b9('0x3d')]){_0x3580af[_0x60b9('0x3c')]=_['merge'](_0x3580af[_0x60b9('0x3c')],{'$or':_[_0x60b9('0x2c')](_0x5df123,function(_0xa97764){if(_0xa97764[_0x60b9('0x30')]!==_0x60b9('0x3e')){var _0x267a3e={};_0x267a3e[_0xa97764[_0x60b9('0x2a')]]={'$like':'%'+_0x54cb0c[_0x60b9('0x32')]['filter']+'%'};return _0x267a3e;}})});}_0x3580af=_[_0x60b9('0x3f')]({},_0x3580af,_0x54cb0c[_0x60b9('0x40')]);var _0x4b8c1f={'where':_0x3580af[_0x60b9('0x3c')]};return db['VoiceChanSpy'][_0x60b9('0x1f')](_0x4b8c1f)[_0x60b9('0x27')](function(_0x2505b7){_0x42d8a3['count']=_0x2505b7;if(_0x54cb0c[_0x60b9('0x32')]['includeAll']){_0x3580af['include']=[{'all':!![]}];}return db[_0x60b9('0x2d')]['findAll'](_0x3580af);})[_0x60b9('0x27')](function(_0x492205){_0x42d8a3[_0x60b9('0x41')]=_0x492205;return _0x42d8a3;})['then'](respondWithFilteredResult(_0x22d4ef,_0x3580af))['catch'](handleError(_0x22d4ef,null));};exports['show']=function(_0x1915db,_0x5aceb){var _0x16f29f={'raw':![],'where':{'id':_0x1915db[_0x60b9('0x42')]['id']}},_0x52405f={};_0x52405f[_0x60b9('0x37')]=_['keys'](db[_0x60b9('0x2d')][_0x60b9('0x2e')]);_0x52405f['query']=_[_0x60b9('0x33')](_0x1915db[_0x60b9('0x32')]);_0x52405f[_0x60b9('0x34')]=_[_0x60b9('0x36')](_0x52405f['model'],_0x52405f[_0x60b9('0x32')]);_0x16f29f['attributes']=_[_0x60b9('0x36')](_0x52405f[_0x60b9('0x37')],qs[_0x60b9('0x38')](_0x1915db[_0x60b9('0x32')]['fields']));_0x16f29f[_0x60b9('0x35')]=_0x16f29f['attributes'][_0x60b9('0x43')]?_0x16f29f['attributes']:_0x52405f[_0x60b9('0x37')];if(_0x1915db[_0x60b9('0x32')][_0x60b9('0x44')]){_0x16f29f[_0x60b9('0x45')]=[{'all':!![]}];}_0x16f29f=_['merge']({},_0x16f29f,_0x1915db['options']);return db[_0x60b9('0x2d')][_0x60b9('0x46')](_0x16f29f)['then'](handleEntityNotFound(_0x5aceb,null))['then'](respondWithResult(_0x5aceb,null))[_0x60b9('0x47')](handleError(_0x5aceb,null));};exports[_0x60b9('0x48')]=function(_0x5c8d06,_0x56ee08){return db[_0x60b9('0x2d')][_0x60b9('0x48')](_0x5c8d06[_0x60b9('0x49')],{})[_0x60b9('0x27')](function(_0x5d68d7){var _0x3a5362=_0x5c8d06[_0x60b9('0x4a')][_0x60b9('0x25')]({'plain':!![]});if(!_0x3a5362)throw new Error(_0x60b9('0x4b'));if(_0x3a5362[_0x60b9('0x4c')]==='user'){var _0x354992=_0x5d68d7[_0x60b9('0x25')]({'plain':!![]});var _0x31702a='ChanSpies';return db[_0x60b9('0x4d')][_0x60b9('0x46')]({'where':{'name':_0x31702a,'userProfileId':_0x3a5362[_0x60b9('0x4e')]},'raw':!![]})['then'](function(_0x4c7b47){if(_0x4c7b47&&_0x4c7b47['autoAssociation']===0x0){return db[_0x60b9('0x4f')][_0x60b9('0x48')]({'name':_0x354992[_0x60b9('0x2a')],'resourceId':_0x354992['id'],'type':_0x4c7b47[_0x60b9('0x2a')],'sectionId':_0x4c7b47['id']},{})[_0x60b9('0x27')](function(){return _0x5d68d7;});}else{return _0x5d68d7;}})[_0x60b9('0x47')](function(_0x22252a){logger['error'](_0x60b9('0x50'),_0x22252a);throw _0x22252a;});}return _0x5d68d7;})[_0x60b9('0x27')](respondWithResult(_0x56ee08,0xc9))['catch'](handleError(_0x56ee08,null));};exports[_0x60b9('0x23')]=function(_0x1fc6dd,_0x3f8f26){if(_0x1fc6dd[_0x60b9('0x49')]['id']){delete _0x1fc6dd[_0x60b9('0x49')]['id'];}return db[_0x60b9('0x2d')][_0x60b9('0x46')]({'where':{'id':_0x1fc6dd['params']['id']}})[_0x60b9('0x27')](handleEntityNotFound(_0x3f8f26,null))['then'](saveUpdates(_0x1fc6dd[_0x60b9('0x49')],null))[_0x60b9('0x27')](respondWithResult(_0x3f8f26,null))[_0x60b9('0x47')](handleError(_0x3f8f26,null));};exports[_0x60b9('0x24')]=function(_0x59c1d6,_0x2e60b6){return db[_0x60b9('0x2d')]['find']({'where':{'id':_0x59c1d6[_0x60b9('0x42')]['id']}})[_0x60b9('0x27')](handleEntityNotFound(_0x2e60b6,null))[_0x60b9('0x27')](removeEntity(_0x2e60b6,null))[_0x60b9('0x47')](handleError(_0x2e60b6,null));}; \ No newline at end of file +var _0xd136=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','ChanSpies','UserProfileResource','end','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse'];(function(_0x388096,_0x50b7c8){var _0x38c620=function(_0x58a1a6){while(--_0x58a1a6){_0x388096['push'](_0x388096['shift']());}};_0x38c620(++_0x50b7c8);}(_0xd136,0x94));var _0x6d13=function(_0x7bbce5,_0x2e19a4){_0x7bbce5=_0x7bbce5-0x0;var _0x4afde4=_0xd136[_0x7bbce5];return _0x4afde4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6d13('0x0'));var zipdir=require(_0x6d13('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6d13('0x2'));var moment=require(_0x6d13('0x3'));var BPromise=require(_0x6d13('0x4'));var Mustache=require(_0x6d13('0x5'));var util=require(_0x6d13('0x6'));var path=require(_0x6d13('0x7'));var sox=require(_0x6d13('0x8'));var csv=require(_0x6d13('0x9'));var ejs=require(_0x6d13('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6d13('0xb'));var squel=require(_0x6d13('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6d13('0xd'));var toCsv=require(_0x6d13('0x9'));var querystring=require(_0x6d13('0xe'));var Papa=require(_0x6d13('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6d13('0x10'));var as=require(_0x6d13('0x11'));var hardwareService=require(_0x6d13('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x6d13('0x13'));var config=require(_0x6d13('0x14'));var licenseUtil=require(_0x6d13('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b4cc3,_0x5ef7e6){_0x5ef7e6=_0x5ef7e6||0xcc;return function(_0x37d3c1){if(_0x37d3c1){return _0x1b4cc3[_0x6d13('0x16')](_0x5ef7e6);}return _0x1b4cc3['status'](_0x5ef7e6)['end']();};}function respondWithResult(_0x4ca95d,_0x37efd8){_0x37efd8=_0x37efd8||0xc8;return function(_0x10709d){if(_0x10709d){return _0x4ca95d[_0x6d13('0x17')](_0x37efd8)[_0x6d13('0x18')](_0x10709d);}};}function respondWithFilteredResult(_0x2f4c2b,_0x4f1bdf){return function(_0xf27049){if(_0xf27049){var _0x405368=typeof _0x4f1bdf[_0x6d13('0x19')]===_0x6d13('0x1a')&&typeof _0x4f1bdf[_0x6d13('0x1b')]===_0x6d13('0x1a');var _0xb17857=_0xf27049[_0x6d13('0x1c')];var _0xc6c2b=_0x405368?0x0:_0x4f1bdf['offset'];var _0x276fdd=_0x405368?_0xf27049[_0x6d13('0x1c')]:_0x4f1bdf[_0x6d13('0x19')]+_0x4f1bdf[_0x6d13('0x1b')];var _0x1f3603;if(_0x276fdd>=_0xb17857){_0x276fdd=_0xb17857;_0x1f3603=0xc8;}else{_0x1f3603=0xce;}_0x2f4c2b[_0x6d13('0x17')](_0x1f3603);return _0x2f4c2b[_0x6d13('0x1d')](_0x6d13('0x1e'),_0xc6c2b+'-'+_0x276fdd+'/'+_0xb17857)[_0x6d13('0x18')](_0xf27049);}return null;};}function patchUpdates(_0x427bb8){return function(_0x40f629){try{jsonpatch[_0x6d13('0x1f')](_0x40f629,_0x427bb8,!![]);}catch(_0x18889d){return BPromise[_0x6d13('0x20')](_0x18889d);}return _0x40f629[_0x6d13('0x21')]();};}function saveUpdates(_0x208876,_0x5619fc){return function(_0x387de2){if(_0x387de2){return _0x387de2['update'](_0x208876)[_0x6d13('0x22')](function(_0x204438){return _0x204438;});}return null;};}function removeEntity(_0x151aa4,_0x5bbc9d){return function(_0x1b0f94){if(_0x1b0f94){return _0x1b0f94[_0x6d13('0x23')]()[_0x6d13('0x22')](function(){var _0x4366a0=_0x1b0f94[_0x6d13('0x24')]({'plain':!![]});var _0x361432=_0x6d13('0x25');return db[_0x6d13('0x26')]['destroy']({'where':{'type':_0x361432,'resourceId':_0x4366a0['id']}})[_0x6d13('0x22')](function(){return _0x1b0f94;});})['then'](function(){_0x151aa4['status'](0xcc)[_0x6d13('0x27')]();});}};}function handleEntityNotFound(_0x588c40,_0x37b3fd){return function(_0x2618e5){if(!_0x2618e5){_0x588c40[_0x6d13('0x16')](0x194);}return _0x2618e5;};}function handleError(_0x49e74a,_0x3a17c3){_0x3a17c3=_0x3a17c3||0x1f4;return function(_0xd469b6){logger['error'](_0xd469b6[_0x6d13('0x28')]);if(_0xd469b6[_0x6d13('0x29')]){delete _0xd469b6[_0x6d13('0x29')];}_0x49e74a[_0x6d13('0x17')](_0x3a17c3)[_0x6d13('0x2a')](_0xd469b6);};}exports[_0x6d13('0x2b')]=function(_0x907f2f,_0x34abc4){var _0x531e8c={},_0x3857f9={},_0xa0024d={'count':0x0,'rows':[]};var _0x56b554=_[_0x6d13('0x2c')](db[_0x6d13('0x2d')][_0x6d13('0x2e')],function(_0x58ab35){return{'name':_0x58ab35[_0x6d13('0x2f')],'type':_0x58ab35[_0x6d13('0x30')][_0x6d13('0x31')]};});_0x3857f9[_0x6d13('0x32')]=_[_0x6d13('0x2c')](_0x56b554,_0x6d13('0x29'));_0x3857f9[_0x6d13('0x33')]=_['keys'](_0x907f2f[_0x6d13('0x33')]);_0x3857f9['filters']=_[_0x6d13('0x34')](_0x3857f9[_0x6d13('0x32')],_0x3857f9[_0x6d13('0x33')]);_0x531e8c[_0x6d13('0x35')]=_[_0x6d13('0x34')](_0x3857f9[_0x6d13('0x32')],qs['fields'](_0x907f2f['query'][_0x6d13('0x36')]));_0x531e8c[_0x6d13('0x35')]=_0x531e8c[_0x6d13('0x35')][_0x6d13('0x37')]?_0x531e8c[_0x6d13('0x35')]:_0x3857f9[_0x6d13('0x32')];if(!_0x907f2f['query'][_0x6d13('0x38')](_0x6d13('0x39'))){_0x531e8c[_0x6d13('0x1b')]=qs[_0x6d13('0x1b')](_0x907f2f[_0x6d13('0x33')][_0x6d13('0x1b')]);_0x531e8c[_0x6d13('0x19')]=qs[_0x6d13('0x19')](_0x907f2f[_0x6d13('0x33')][_0x6d13('0x19')]);}_0x531e8c['order']=qs['sort'](_0x907f2f[_0x6d13('0x33')]['sort']);_0x531e8c['where']=qs[_0x6d13('0x3a')](_[_0x6d13('0x3b')](_0x907f2f[_0x6d13('0x33')],_0x3857f9['filters']),_0x56b554);if(_0x907f2f[_0x6d13('0x33')][_0x6d13('0x3c')]){_0x531e8c[_0x6d13('0x3d')]=_['merge'](_0x531e8c[_0x6d13('0x3d')],{'$or':_['map'](_0x56b554,function(_0x296098){if(_0x296098['type']!=='VIRTUAL'){var _0x29e6c3={};_0x29e6c3[_0x296098[_0x6d13('0x29')]]={'$like':'%'+_0x907f2f['query']['filter']+'%'};return _0x29e6c3;}})});}_0x531e8c=_[_0x6d13('0x3e')]({},_0x531e8c,_0x907f2f[_0x6d13('0x3f')]);var _0x2a6d57={'where':_0x531e8c[_0x6d13('0x3d')]};return db['VoiceChanSpy'][_0x6d13('0x1c')](_0x2a6d57)[_0x6d13('0x22')](function(_0x4b4cc5){_0xa0024d[_0x6d13('0x1c')]=_0x4b4cc5;if(_0x907f2f[_0x6d13('0x33')][_0x6d13('0x40')]){_0x531e8c[_0x6d13('0x41')]=[{'all':!![]}];}return db[_0x6d13('0x2d')][_0x6d13('0x42')](_0x531e8c);})[_0x6d13('0x22')](function(_0x5f1238){_0xa0024d[_0x6d13('0x43')]=_0x5f1238;return _0xa0024d;})[_0x6d13('0x22')](respondWithFilteredResult(_0x34abc4,_0x531e8c))[_0x6d13('0x44')](handleError(_0x34abc4,null));};exports[_0x6d13('0x45')]=function(_0x3f3746,_0x1b43b1){var _0x29b07e={'raw':![],'where':{'id':_0x3f3746[_0x6d13('0x46')]['id']}},_0x4bd115={};_0x4bd115['model']=_[_0x6d13('0x47')](db[_0x6d13('0x2d')][_0x6d13('0x2e')]);_0x4bd115[_0x6d13('0x33')]=_[_0x6d13('0x47')](_0x3f3746[_0x6d13('0x33')]);_0x4bd115[_0x6d13('0x3a')]=_[_0x6d13('0x34')](_0x4bd115['model'],_0x4bd115[_0x6d13('0x33')]);_0x29b07e['attributes']=_[_0x6d13('0x34')](_0x4bd115[_0x6d13('0x32')],qs[_0x6d13('0x36')](_0x3f3746[_0x6d13('0x33')][_0x6d13('0x36')]));_0x29b07e[_0x6d13('0x35')]=_0x29b07e[_0x6d13('0x35')][_0x6d13('0x37')]?_0x29b07e[_0x6d13('0x35')]:_0x4bd115[_0x6d13('0x32')];if(_0x3f3746[_0x6d13('0x33')]['includeAll']){_0x29b07e[_0x6d13('0x41')]=[{'all':!![]}];}_0x29b07e=_[_0x6d13('0x3e')]({},_0x29b07e,_0x3f3746[_0x6d13('0x3f')]);return db['VoiceChanSpy']['find'](_0x29b07e)[_0x6d13('0x22')](handleEntityNotFound(_0x1b43b1,null))[_0x6d13('0x22')](respondWithResult(_0x1b43b1,null))[_0x6d13('0x44')](handleError(_0x1b43b1,null));};exports['create']=function(_0x3ac978,_0x31872b){return db[_0x6d13('0x2d')]['create'](_0x3ac978[_0x6d13('0x48')],{})[_0x6d13('0x22')](function(_0x4de130){var _0x50134a=_0x3ac978[_0x6d13('0x49')][_0x6d13('0x24')]({'plain':!![]});if(!_0x50134a)throw new Error(_0x6d13('0x4a'));if(_0x50134a[_0x6d13('0x4b')]===_0x6d13('0x49')){var _0x3d3244=_0x4de130['get']({'plain':!![]});var _0x48f88a=_0x6d13('0x25');return db[_0x6d13('0x4c')][_0x6d13('0x4d')]({'where':{'name':_0x48f88a,'userProfileId':_0x50134a[_0x6d13('0x4e')]},'raw':!![]})[_0x6d13('0x22')](function(_0x5a9131){if(_0x5a9131&&_0x5a9131[_0x6d13('0x4f')]===0x0){return db['UserProfileResource'][_0x6d13('0x50')]({'name':_0x3d3244[_0x6d13('0x29')],'resourceId':_0x3d3244['id'],'type':_0x5a9131[_0x6d13('0x29')],'sectionId':_0x5a9131['id']},{})['then'](function(){return _0x4de130;});}else{return _0x4de130;}})[_0x6d13('0x44')](function(_0x53854e){logger['error'](_0x6d13('0x51'),_0x53854e);throw _0x53854e;});}return _0x4de130;})['then'](respondWithResult(_0x31872b,0xc9))[_0x6d13('0x44')](handleError(_0x31872b,null));};exports['update']=function(_0x13c342,_0x4962cd){if(_0x13c342[_0x6d13('0x48')]['id']){delete _0x13c342[_0x6d13('0x48')]['id'];}return db['VoiceChanSpy'][_0x6d13('0x4d')]({'where':{'id':_0x13c342['params']['id']}})[_0x6d13('0x22')](handleEntityNotFound(_0x4962cd,null))[_0x6d13('0x22')](saveUpdates(_0x13c342[_0x6d13('0x48')],null))[_0x6d13('0x22')](respondWithResult(_0x4962cd,null))['catch'](handleError(_0x4962cd,null));};exports[_0x6d13('0x23')]=function(_0x37bada,_0x35db79){return db[_0x6d13('0x2d')][_0x6d13('0x4d')]({'where':{'id':_0x37bada[_0x6d13('0x46')]['id']}})[_0x6d13('0x22')](handleEntityNotFound(_0x35db79,null))[_0x6d13('0x22')](removeEntity(_0x35db79,null))['catch'](handleError(_0x35db79,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index c798641..5d80a46 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 _0xea14=['name','User','findAll','then','catch','exports','models','define','VoiceExtension','bulkCreate','destroy','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','system','Set','CDR(type)=%s','chanspy','record','push','merge','auth','password','ChanSpy','SIP/%s,%s','options','join','StopMixMonitor','length','concat','internal'];(function(_0x48a9e0,_0x59203f){var _0x501683=function(_0x51cb16){while(--_0x51cb16){_0x48a9e0['push'](_0x48a9e0['shift']());}};_0x501683(++_0x59203f);}(_0xea14,0x15f));var _0x4ea1=function(_0x40120d,_0x2b9151){_0x40120d=_0x40120d-0x0;var _0x263a3e=_0xea14[_0x40120d];return _0x263a3e;};'use strict';var _=require('lodash');var util=require(_0x4ea1('0x0'));var BPromise=require(_0x4ea1('0x1'));var attributes=require(_0x4ea1('0x2'));var getUserApplications=function(_0x30c095,_0x519a99,_0x3ecc74){var _0x1f21b9=0x1;var _0x50ec94=[];var _0x3798f8={'context':_0x519a99[_0x4ea1('0x3')]||_0x4ea1('0x4'),'exten':util[_0x4ea1('0x5')]('%s%s',_0x30c095['prefix'],_0x3ecc74),'type':_0x4ea1('0x6'),'isApp':![],'ChanSpyId':_0x30c095['id'],'UserId':_0x519a99['id']};_0x50ec94['push'](_['merge']({'app':_0x4ea1('0x7'),'appdata':util['format'](_0x4ea1('0x8'),_0x4ea1('0x9')),'priority':_0x1f21b9++},_0x3798f8));if(_0x30c095[_0x4ea1('0xa')]){_0x50ec94[_0x4ea1('0xb')](_[_0x4ea1('0xc')]({'app':'MixMonitor','appdata':util[_0x4ea1('0x5')]('${UNIQUEID}.%s,a',_0x30c095['recordingFormat']),'priority':_0x1f21b9++},_0x3798f8));}if(_0x30c095[_0x4ea1('0xd')]){_0x50ec94[_0x4ea1('0xb')](_[_0x4ea1('0xc')]({'app':'Authenticate','appdata':_0x30c095[_0x4ea1('0xe')],'priority':_0x1f21b9++},_0x3798f8));}_0x50ec94[_0x4ea1('0xb')](_[_0x4ea1('0xc')]({'app':_0x4ea1('0xf'),'appdata':util[_0x4ea1('0x5')](_0x4ea1('0x10'),_0x519a99['name'],_0x30c095[_0x4ea1('0x11')]?_0x30c095[_0x4ea1('0x11')][_0x4ea1('0x12')](''):''),'priority':_0x1f21b9++},_0x3798f8));if(_0x30c095[_0x4ea1('0xa')]){_0x50ec94[_0x4ea1('0xb')](_['merge']({'app':_0x4ea1('0x13'),'priority':_0x1f21b9++},_0x3798f8));}return _0x50ec94;};var getChanSpyApplications=function(_0x51684f,_0x21e41b){var _0x188eda=[];for(var _0x46a823=0x0,_0x6b99c8=0x1;_0x46a823<_0x21e41b[_0x4ea1('0x14')];_0x46a823++,_0x6b99c8=0x1){_0x188eda=_0x188eda[_0x4ea1('0x15')](getUserApplications(_0x51684f,_0x21e41b[_0x46a823],_0x21e41b[_0x46a823]['internal']));if(_0x21e41b[_0x46a823][_0x4ea1('0x16')]!=_0x21e41b[_0x46a823][_0x4ea1('0x17')]){_0x188eda=_0x188eda[_0x4ea1('0x15')](getUserApplications(_0x51684f,_0x21e41b[_0x46a823],_0x21e41b[_0x46a823][_0x4ea1('0x17')]));}}return _0x188eda;};var getChanSpyPromise=function(_0xe46917,_0x2c792a){return new BPromise(function(_0x444644,_0x2429bf){return _0xe46917[_0x4ea1('0x18')][_0x4ea1('0x19')]({'attributes':['id',_0x4ea1('0x17'),_0x4ea1('0x16')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x4ea1('0x1a')](function(_0x360028){if(_0x360028){return _0x444644(getChanSpyApplications(_0x2c792a,_0x360028));}return _0x444644([]);})[_0x4ea1('0x1b')](function(_0x4d8c7e){_0x2429bf(_0x4d8c7e);});});};module[_0x4ea1('0x1c')]=function(_0x402947,_0x37826e){var _0x38c60d=_0x402947[_0x4ea1('0x1d')];return _0x402947[_0x4ea1('0x1e')]('VoiceChanSpy',attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xe8e8c5,_0x3814fe,_0x429fb6){return getChanSpyPromise(_0x38c60d,_0xe8e8c5)[_0x4ea1('0x1a')](function(_0x4d1ddf){if(_0x4d1ddf&&_0x4d1ddf['length']){return _0x38c60d[_0x4ea1('0x1f')][_0x4ea1('0x20')](_0x4d1ddf);}})[_0x4ea1('0x1a')](function(){_0x429fb6();})[_0x4ea1('0x1b')](function(_0x236264){_0x429fb6(_0x236264);});},'afterUpdate':function(_0x5bdd09,_0x44118a,_0x2664c3){return _0x38c60d[_0x4ea1('0x1f')][_0x4ea1('0x21')]({'where':{'ChanSpyId':_0x5bdd09['id']}})[_0x4ea1('0x1a')](function(){return getChanSpyPromise(_0x38c60d,_0x5bdd09);})['then'](function(_0x30d7ad){if(_0x30d7ad&&_0x30d7ad[_0x4ea1('0x14')]){return _0x38c60d[_0x4ea1('0x1f')]['bulkCreate'](_0x30d7ad);}})[_0x4ea1('0x1a')](function(){_0x2664c3();})['catch'](function(_0x280cd8){_0x2664c3(_0x280cd8);});},'afterDestroy':function(_0x42150f,_0x4f556e,_0x134603){return _0x38c60d[_0x4ea1('0x1f')][_0x4ea1('0x21')]({'where':{'ChanSpyId':_0x42150f['id']}})[_0x4ea1('0x1a')](function(){_0x134603();})['catch'](function(_0x346c0c){_0x134603(_0x346c0c);});}}});}; \ No newline at end of file +var _0xc496=['format','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','options','join','length','concat','internal','name','User','then','exports','models','define','voice_chanspy','bulkCreate','catch','VoiceExtension','destroy','bluebird','./voiceChanSpy.attributes','context','from-sip'];(function(_0x1544a6,_0x37a542){var _0xe4bd5b=function(_0xc52f4f){while(--_0xc52f4f){_0x1544a6['push'](_0x1544a6['shift']());}};_0xe4bd5b(++_0x37a542);}(_0xc496,0x8c));var _0x6c49=function(_0x53e3de,_0x13da7b){_0x53e3de=_0x53e3de-0x0;var _0x7b905b=_0xc496[_0x53e3de];return _0x7b905b;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0x6c49('0x0'));var attributes=require(_0x6c49('0x1'));var getUserApplications=function(_0x26edd2,_0x4bb3f5,_0x4696f4){var _0x25a4d7=0x1;var _0x23b9a6=[];var _0x55a3c8={'context':_0x4bb3f5[_0x6c49('0x2')]||_0x6c49('0x3'),'exten':util[_0x6c49('0x4')]('%s%s',_0x26edd2[_0x6c49('0x5')],_0x4696f4),'type':_0x6c49('0x6'),'isApp':![],'ChanSpyId':_0x26edd2['id'],'UserId':_0x4bb3f5['id']};_0x23b9a6[_0x6c49('0x7')](_[_0x6c49('0x8')]({'app':_0x6c49('0x9'),'appdata':util[_0x6c49('0x4')](_0x6c49('0xa'),_0x6c49('0xb')),'priority':_0x25a4d7++},_0x55a3c8));if(_0x26edd2['record']){_0x23b9a6[_0x6c49('0x7')](_[_0x6c49('0x8')]({'app':_0x6c49('0xc'),'appdata':util[_0x6c49('0x4')](_0x6c49('0xd'),_0x26edd2[_0x6c49('0xe')]),'priority':_0x25a4d7++},_0x55a3c8));}if(_0x26edd2[_0x6c49('0xf')]){_0x23b9a6[_0x6c49('0x7')](_[_0x6c49('0x8')]({'app':_0x6c49('0x10'),'appdata':_0x26edd2[_0x6c49('0x11')],'priority':_0x25a4d7++},_0x55a3c8));}_0x23b9a6[_0x6c49('0x7')](_[_0x6c49('0x8')]({'app':_0x6c49('0x12'),'appdata':util[_0x6c49('0x4')](_0x6c49('0x13'),_0x4bb3f5['name'],_0x26edd2[_0x6c49('0x14')]?_0x26edd2[_0x6c49('0x14')][_0x6c49('0x15')](''):''),'priority':_0x25a4d7++},_0x55a3c8));if(_0x26edd2['record']){_0x23b9a6[_0x6c49('0x7')](_['merge']({'app':'StopMixMonitor','priority':_0x25a4d7++},_0x55a3c8));}return _0x23b9a6;};var getChanSpyApplications=function(_0x14d9f0,_0x56cd53){var _0x1b9a83=[];for(var _0x14677d=0x0,_0x189d75=0x1;_0x14677d<_0x56cd53[_0x6c49('0x16')];_0x14677d++,_0x189d75=0x1){_0x1b9a83=_0x1b9a83[_0x6c49('0x17')](getUserApplications(_0x14d9f0,_0x56cd53[_0x14677d],_0x56cd53[_0x14677d]['internal']));if(_0x56cd53[_0x14677d][_0x6c49('0x18')]!=_0x56cd53[_0x14677d][_0x6c49('0x19')]){_0x1b9a83=_0x1b9a83[_0x6c49('0x17')](getUserApplications(_0x14d9f0,_0x56cd53[_0x14677d],_0x56cd53[_0x14677d][_0x6c49('0x19')]));}}return _0x1b9a83;};var getChanSpyPromise=function(_0x5aaa82,_0x1a3e50){return new BPromise(function(_0x1e0128,_0x3e3dcd){return _0x5aaa82[_0x6c49('0x1a')]['findAll']({'attributes':['id',_0x6c49('0x19'),_0x6c49('0x18')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x6c49('0x1b')](function(_0x4a5775){if(_0x4a5775){return _0x1e0128(getChanSpyApplications(_0x1a3e50,_0x4a5775));}return _0x1e0128([]);})['catch'](function(_0x6618dd){_0x3e3dcd(_0x6618dd);});});};module[_0x6c49('0x1c')]=function(_0x3a43da,_0x24c807){var _0x1f2a9c=_0x3a43da[_0x6c49('0x1d')];return _0x3a43da[_0x6c49('0x1e')]('VoiceChanSpy',attributes,{'tableName':_0x6c49('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2fdecf,_0x1c9367,_0x4c4543){return getChanSpyPromise(_0x1f2a9c,_0x2fdecf)[_0x6c49('0x1b')](function(_0xcf2154){if(_0xcf2154&&_0xcf2154[_0x6c49('0x16')]){return _0x1f2a9c['VoiceExtension'][_0x6c49('0x20')](_0xcf2154);}})['then'](function(){_0x4c4543();})[_0x6c49('0x21')](function(_0x5c43df){_0x4c4543(_0x5c43df);});},'afterUpdate':function(_0x43c093,_0x36e9c3,_0x30f972){return _0x1f2a9c[_0x6c49('0x22')][_0x6c49('0x23')]({'where':{'ChanSpyId':_0x43c093['id']}})['then'](function(){return getChanSpyPromise(_0x1f2a9c,_0x43c093);})[_0x6c49('0x1b')](function(_0x1f1c26){if(_0x1f1c26&&_0x1f1c26['length']){return _0x1f2a9c[_0x6c49('0x22')][_0x6c49('0x20')](_0x1f1c26);}})[_0x6c49('0x1b')](function(){_0x30f972();})[_0x6c49('0x21')](function(_0x2e77e8){_0x30f972(_0x2e77e8);});},'afterDestroy':function(_0x448603,_0x326f5c,_0x543a45){return _0x1f2a9c[_0x6c49('0x22')][_0x6c49('0x23')]({'where':{'ChanSpyId':_0x448603['id']}})['then'](function(){_0x543a45();})[_0x6c49('0x21')](function(_0x28289f){_0x543a45(_0x28289f);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 1267ee8..0d3999a 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 _0xa25c=['message','VoiceChanSpy,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x2d5161,_0x48e363){var _0x54f588=function(_0x1ad028){while(--_0x1ad028){_0x2d5161['push'](_0x2d5161['shift']());}};_0x54f588(++_0x48e363);}(_0xa25c,0x13f));var _0xca25=function(_0x222a0f,_0x1b97cd){_0x222a0f=_0x222a0f-0x0;var _0x126665=_0xa25c[_0x222a0f];return _0x126665;};'use strict';var _=require('lodash');var util=require(_0xca25('0x0'));var moment=require(_0xca25('0x1'));var BPromise=require(_0xca25('0x2'));var rs=require(_0xca25('0x3'));var fs=require('fs');var Redis=require(_0xca25('0x4'));var db=require(_0xca25('0x5'))['db'];var utils=require(_0xca25('0x6'));var logger=require(_0xca25('0x7'))('rpc');var config=require(_0xca25('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xca25('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e9352,_0xb2fc94,_0x3cee89){return new BPromise(function(_0x2c0b8c,_0x42a97a){return client[_0xca25('0xa')](_0x4e9352,_0x3cee89)['then'](function(_0x5d820c){logger[_0xca25('0xb')]('VoiceChanSpy,\x20%s,\x20%s',_0xb2fc94,_0xca25('0xc'));logger[_0xca25('0xd')](_0xca25('0xe'),_0xb2fc94,'request\x20sent',JSON['stringify'](_0x5d820c));if(_0x5d820c['error']){if(_0x5d820c[_0xca25('0xf')][_0xca25('0x10')]===0x1f4){logger[_0xca25('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0xb2fc94,_0x5d820c['error'][_0xca25('0x11')]);return _0x42a97a(_0x5d820c['error'][_0xca25('0x11')]);}logger[_0xca25('0xf')](_0xca25('0x12'),_0xb2fc94,_0x5d820c[_0xca25('0xf')][_0xca25('0x11')]);return _0x2c0b8c(_0x5d820c[_0xca25('0xf')][_0xca25('0x11')]);}else{logger[_0xca25('0xb')](_0xca25('0x12'),_0xb2fc94,_0xca25('0xc'));_0x2c0b8c(_0x5d820c[_0xca25('0x13')]['message']);}})[_0xca25('0x14')](function(_0x340c9b){logger['error'](_0xca25('0x12'),_0xb2fc94,_0x340c9b);_0x42a97a(_0x340c9b);});});} \ No newline at end of file +var _0x94d2=['request\x20sent','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x595f65,_0x204254){var _0x22e00e=function(_0x2c1169){while(--_0x2c1169){_0x595f65['push'](_0x595f65['shift']());}};_0x22e00e(++_0x204254);}(_0x94d2,0x1cd));var _0x294d=function(_0x4599b6,_0x40c254){_0x4599b6=_0x4599b6-0x0;var _0x2e014c=_0x94d2[_0x4599b6];return _0x2e014c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x294d('0x0'));var BPromise=require(_0x294d('0x1'));var rs=require(_0x294d('0x2'));var fs=require('fs');var Redis=require(_0x294d('0x3'));var db=require(_0x294d('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x294d('0x5'));var config=require(_0x294d('0x6'));var jayson=require(_0x294d('0x7'));var client=jayson[_0x294d('0x8')][_0x294d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e023f,_0x5c3d7c,_0x2cf111){return new BPromise(function(_0x6653fc,_0x1cd249){return client[_0x294d('0xa')](_0x5e023f,_0x2cf111)[_0x294d('0xb')](function(_0x49923f){logger[_0x294d('0xc')](_0x294d('0xd'),_0x5c3d7c,'request\x20sent');logger[_0x294d('0xe')](_0x294d('0xf'),_0x5c3d7c,'request\x20sent',JSON['stringify'](_0x49923f));if(_0x49923f[_0x294d('0x10')]){if(_0x49923f[_0x294d('0x10')][_0x294d('0x11')]===0x1f4){logger['error'](_0x294d('0xd'),_0x5c3d7c,_0x49923f[_0x294d('0x10')][_0x294d('0x12')]);return _0x1cd249(_0x49923f[_0x294d('0x10')]['message']);}logger[_0x294d('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x5c3d7c,_0x49923f['error'][_0x294d('0x12')]);return _0x6653fc(_0x49923f[_0x294d('0x10')][_0x294d('0x12')]);}else{logger[_0x294d('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x5c3d7c,_0x294d('0x13'));_0x6653fc(_0x49923f['result']['message']);}})['catch'](function(_0x4f2436){logger[_0x294d('0x10')](_0x294d('0xd'),_0x5c3d7c,_0x4f2436);_0x1cd249(_0x4f2436);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 0d2b8a3..1d3c672 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 _0x811a=['express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','get','index','/:id','show','post','isAuthenticated','create','update','multer','connect-timeout'];(function(_0x2f2768,_0x3c82ea){var _0x41aa5e=function(_0x173c60){while(--_0x173c60){_0x2f2768['push'](_0x2f2768['shift']());}};_0x41aa5e(++_0x3c82ea);}(_0x811a,0xd0));var _0xa811=function(_0x38400b,_0x5dc014){_0x38400b=_0x38400b-0x0;var _0x4e2695=_0x811a[_0x38400b];return _0x4e2695;};'use strict';var multer=require(_0xa811('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa811('0x1'));var express=require(_0xa811('0x2'));var router=express['Router']();var fs_extra=require(_0xa811('0x3'));var auth=require(_0xa811('0x4'));var interaction=require(_0xa811('0x5'));var config=require('../../config/environment');var controller=require(_0xa811('0x6'));router[_0xa811('0x7')]('/',auth['isAuthenticated'](),controller[_0xa811('0x8')]);router[_0xa811('0x7')](_0xa811('0x9'),auth['isAuthenticated'](),controller[_0xa811('0xa')]);router[_0xa811('0xb')]('/',auth[_0xa811('0xc')](),controller[_0xa811('0xd')]);router['put'](_0xa811('0x9'),auth[_0xa811('0xc')](),controller[_0xa811('0xe')]);router['delete'](_0xa811('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7bfd=['get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller'];(function(_0x4be576,_0x329945){var _0x330fe6=function(_0x5acb71){while(--_0x5acb71){_0x4be576['push'](_0x4be576['shift']());}};_0x330fe6(++_0x329945);}(_0x7bfd,0x19a));var _0xd7bf=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7bfd[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xd7bf('0x0'));var util=require(_0xd7bf('0x1'));var path=require(_0xd7bf('0x2'));var timeout=require(_0xd7bf('0x3'));var express=require(_0xd7bf('0x4'));var router=express[_0xd7bf('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd7bf('0x6'));var interaction=require(_0xd7bf('0x7'));var config=require(_0xd7bf('0x8'));var controller=require(_0xd7bf('0x9'));router[_0xd7bf('0xa')]('/',auth[_0xd7bf('0xb')](),controller[_0xd7bf('0xc')]);router['get'](_0xd7bf('0xd'),auth['isAuthenticated'](),controller[_0xd7bf('0xe')]);router['post']('/',auth[_0xd7bf('0xb')](),controller[_0xd7bf('0xf')]);router[_0xd7bf('0x10')](_0xd7bf('0xd'),auth[_0xd7bf('0xb')](),controller[_0xd7bf('0x11')]);router[_0xd7bf('0x12')](_0xd7bf('0xd'),auth[_0xd7bf('0xb')](),controller[_0xd7bf('0x13')]);module[_0xd7bf('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 61e2cd6..aafa32e 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 _0x0cbe=['name','BOOLEAN','exports','STRING'];(function(_0x1e2869,_0x1da400){var _0x347c84=function(_0xc82ceb){while(--_0xc82ceb){_0x1e2869['push'](_0x1e2869['shift']());}};_0x347c84(++_0x1da400);}(_0x0cbe,0x132));var _0xe0cb=function(_0x316968,_0x1259bd){_0x316968=_0x316968-0x0;var _0x48e388=_0x0cbe[_0x316968];return _0x48e388;};'use strict';var Sequelize=require('sequelize');module[_0xe0cb('0x0')]={'name':{'type':Sequelize[_0xe0cb('0x1')],'unique':_0xe0cb('0x2')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xe0cb('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7978=['BOOLEAN','sequelize','exports'];(function(_0x4f11e6,_0x456877){var _0x9311b8=function(_0x1d414b){while(--_0x1d414b){_0x4f11e6['push'](_0x4f11e6['shift']());}};_0x9311b8(++_0x456877);}(_0x7978,0xa0));var _0x8797=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0x7978[_0x56916d];return _0x2b7f1f;};'use strict';var Sequelize=require(_0x8797('0x0'));module[_0x8797('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x8797('0x2')],'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 1a2f9d6..f2c7856 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 _0x9784=['limit','count','set','Content-Range','apply','save','update','Contexts','UserProfileResource','destroy','stack','name','send','index','map','VoiceContext','fieldName','key','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','show','rawAttributes','length','options','find','create','body','join','root','server/files/templates/context.ejs','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','readFileSync','utf8','Reload','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','client','http','request','then','info','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','undefined'];(function(_0x546395,_0x69afaa){var _0x10c6db=function(_0x1aef82){while(--_0x1aef82){_0x546395['push'](_0x546395['shift']());}};_0x10c6db(++_0x69afaa);}(_0x9784,0x17c));var _0x4978=function(_0x31da32,_0x5c631a){_0x31da32=_0x31da32-0x0;var _0x1c1034=_0x9784[_0x31da32];return _0x1c1034;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4978('0x0'));var zipdir=require(_0x4978('0x1'));var jsonpatch=require(_0x4978('0x2'));var rp=require('request-promise');var moment=require(_0x4978('0x3'));var BPromise=require(_0x4978('0x4'));var Mustache=require(_0x4978('0x5'));var util=require(_0x4978('0x6'));var path=require(_0x4978('0x7'));var sox=require(_0x4978('0x8'));var csv=require(_0x4978('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4978('0xa'));var _=require(_0x4978('0xb'));var squel=require(_0x4978('0xc'));var crypto=require(_0x4978('0xd'));var jsforce=require(_0x4978('0xe'));var deskjs=require(_0x4978('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4978('0x10'));var Redis=require(_0x4978('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4978('0x12'));var as=require(_0x4978('0x13'));var hardwareService=require(_0x4978('0x14'));var logger=require('../../config/logger')(_0x4978('0x15'));var utils=require(_0x4978('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4978('0x17'));var db=require(_0x4978('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x4978('0x19')][_0x4978('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x41a6e9,_0x218474,_0x1eaf51,_0x2df77e){return new BPromise(function(_0x1c3e37,_0x209849){var _0x1bd58e=_0x2df77e||client;return _0x1bd58e[_0x4978('0x1b')](_0x41a6e9,_0x1eaf51)[_0x4978('0x1c')](function(_0x1eef64){logger[_0x4978('0x1d')]('VoiceContext,\x20%s,\x20%s',_0x218474,_0x4978('0x1e'));logger['debug'](_0x4978('0x1f'),_0x218474,'request\x20sent',JSON[_0x4978('0x20')](_0x1eef64));if(_0x1eef64['error']){if(_0x1eef64[_0x4978('0x21')]['code']===0x1f4){logger[_0x4978('0x21')](_0x4978('0x22'),_0x218474,_0x1eef64[_0x4978('0x21')][_0x4978('0x23')]);return _0x209849(_0x1eef64[_0x4978('0x21')][_0x4978('0x23')]);}logger[_0x4978('0x21')](_0x4978('0x22'),_0x218474,_0x1eef64[_0x4978('0x21')][_0x4978('0x23')]);return _0x1c3e37(_0x1eef64[_0x4978('0x21')][_0x4978('0x23')]);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x218474,_0x4978('0x1e'));_0x1c3e37(_0x1eef64[_0x4978('0x24')][_0x4978('0x23')]);}})[_0x4978('0x25')](function(_0x58d1df){logger[_0x4978('0x21')]('VoiceContext,\x20%s,\x20%s',_0x218474,_0x58d1df);_0x209849(_0x58d1df);});});}function respondWithStatusCode(_0x3b37e0,_0x1550af){_0x1550af=_0x1550af||0xcc;return function(_0x3d8b72){if(_0x3d8b72){return _0x3b37e0[_0x4978('0x26')](_0x1550af);}return _0x3b37e0['status'](_0x1550af)[_0x4978('0x27')]();};}function respondWithResult(_0x18bf5c,_0x4f2120){_0x4f2120=_0x4f2120||0xc8;return function(_0x16569f){if(_0x16569f){return _0x18bf5c[_0x4978('0x28')](_0x4f2120)[_0x4978('0x29')](_0x16569f);}};}function respondWithFilteredResult(_0x582c49,_0x3faaa3){return function(_0x27aade){if(_0x27aade){var _0x55c50e=typeof _0x3faaa3[_0x4978('0x2a')]===_0x4978('0x2b')&&typeof _0x3faaa3[_0x4978('0x2c')]===_0x4978('0x2b');var _0x3e4600=_0x27aade['count'];var _0x2b18c0=_0x55c50e?0x0:_0x3faaa3[_0x4978('0x2a')];var _0x2c3810=_0x55c50e?_0x27aade[_0x4978('0x2d')]:_0x3faaa3[_0x4978('0x2a')]+_0x3faaa3[_0x4978('0x2c')];var _0x556765;if(_0x2c3810>=_0x3e4600){_0x2c3810=_0x3e4600;_0x556765=0xc8;}else{_0x556765=0xce;}_0x582c49[_0x4978('0x28')](_0x556765);return _0x582c49[_0x4978('0x2e')](_0x4978('0x2f'),_0x2b18c0+'-'+_0x2c3810+'/'+_0x3e4600)[_0x4978('0x29')](_0x27aade);}return null;};}function patchUpdates(_0x1cd0c0){return function(_0x62ad90){try{jsonpatch[_0x4978('0x30')](_0x62ad90,_0x1cd0c0,!![]);}catch(_0x4de1ca){return BPromise['reject'](_0x4de1ca);}return _0x62ad90[_0x4978('0x31')]();};}function saveUpdates(_0x1dadc9,_0x237fef){return function(_0x1078fa){if(_0x1078fa){return _0x1078fa[_0x4978('0x32')](_0x1dadc9)[_0x4978('0x1c')](function(_0x149dc7){return _0x149dc7;});}return null;};}function removeEntity(_0xb78934,_0x2cf7d8){return function(_0x2868f2){if(_0x2868f2){return _0x2868f2['destroy']()[_0x4978('0x1c')](function(){var _0x3218e3=_0x2868f2['get']({'plain':!![]});var _0x508cf9=_0x4978('0x33');return db[_0x4978('0x34')][_0x4978('0x35')]({'where':{'type':_0x508cf9,'resourceId':_0x3218e3['id']}})[_0x4978('0x1c')](function(){return _0x2868f2;});})['then'](function(){_0xb78934['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c0bff,_0x38e8a9){return function(_0x1a024a){if(!_0x1a024a){_0x3c0bff[_0x4978('0x26')](0x194);}return _0x1a024a;};}function handleError(_0x1be31d,_0x46a463){_0x46a463=_0x46a463||0x1f4;return function(_0x3a5e2e){logger[_0x4978('0x21')](_0x3a5e2e[_0x4978('0x36')]);if(_0x3a5e2e['name']){delete _0x3a5e2e[_0x4978('0x37')];}_0x1be31d[_0x4978('0x28')](_0x46a463)[_0x4978('0x38')](_0x3a5e2e);};}exports[_0x4978('0x39')]=function(_0x33817c,_0x48f0df){var _0x27d3ee={},_0x1ca950={},_0xbdc6dd={'count':0x0,'rows':[]};var _0x310400=_[_0x4978('0x3a')](db[_0x4978('0x3b')]['rawAttributes'],function(_0x2b25b1){return{'name':_0x2b25b1[_0x4978('0x3c')],'type':_0x2b25b1['type'][_0x4978('0x3d')]};});_0x1ca950[_0x4978('0x3e')]=_['map'](_0x310400,_0x4978('0x37'));_0x1ca950[_0x4978('0x3f')]=_[_0x4978('0x40')](_0x33817c['query']);_0x1ca950[_0x4978('0x41')]=_[_0x4978('0x42')](_0x1ca950[_0x4978('0x3e')],_0x1ca950[_0x4978('0x3f')]);_0x27d3ee[_0x4978('0x43')]=_[_0x4978('0x42')](_0x1ca950[_0x4978('0x3e')],qs[_0x4978('0x44')](_0x33817c[_0x4978('0x3f')][_0x4978('0x44')]));_0x27d3ee[_0x4978('0x43')]=_0x27d3ee[_0x4978('0x43')]['length']?_0x27d3ee[_0x4978('0x43')]:_0x1ca950['model'];if(!_0x33817c[_0x4978('0x3f')]['hasOwnProperty']('nolimit')){_0x27d3ee[_0x4978('0x2c')]=qs[_0x4978('0x2c')](_0x33817c[_0x4978('0x3f')][_0x4978('0x2c')]);_0x27d3ee['offset']=qs[_0x4978('0x2a')](_0x33817c[_0x4978('0x3f')][_0x4978('0x2a')]);}_0x27d3ee[_0x4978('0x45')]=qs[_0x4978('0x46')](_0x33817c[_0x4978('0x3f')][_0x4978('0x46')]);_0x27d3ee[_0x4978('0x47')]=qs[_0x4978('0x41')](_[_0x4978('0x48')](_0x33817c[_0x4978('0x3f')],_0x1ca950[_0x4978('0x41')]),_0x310400);if(_0x33817c['query'][_0x4978('0x49')]){_0x27d3ee[_0x4978('0x47')]=_['merge'](_0x27d3ee[_0x4978('0x47')],{'$or':_[_0x4978('0x3a')](_0x310400,function(_0xd92a8d){if(_0xd92a8d[_0x4978('0x4a')]!==_0x4978('0x4b')){var _0x3deea8={};_0x3deea8[_0xd92a8d[_0x4978('0x37')]]={'$like':'%'+_0x33817c[_0x4978('0x3f')]['filter']+'%'};return _0x3deea8;}})});}_0x27d3ee=_[_0x4978('0x4c')]({},_0x27d3ee,_0x33817c['options']);var _0x2d9fdc={'where':_0x27d3ee[_0x4978('0x47')]};return db[_0x4978('0x3b')][_0x4978('0x2d')](_0x2d9fdc)[_0x4978('0x1c')](function(_0x128307){_0xbdc6dd[_0x4978('0x2d')]=_0x128307;if(_0x33817c[_0x4978('0x3f')][_0x4978('0x4d')]){_0x27d3ee[_0x4978('0x4e')]=[{'all':!![]}];}return db[_0x4978('0x3b')][_0x4978('0x4f')](_0x27d3ee);})[_0x4978('0x1c')](function(_0x4b3c8b){_0xbdc6dd[_0x4978('0x50')]=_0x4b3c8b;return _0xbdc6dd;})[_0x4978('0x1c')](respondWithFilteredResult(_0x48f0df,_0x27d3ee))['catch'](handleError(_0x48f0df,null));};exports[_0x4978('0x51')]=function(_0x4f6dfd,_0x305546){var _0x4e81c8={'raw':![],'where':{'id':_0x4f6dfd['params']['id']}},_0x513213={};_0x513213[_0x4978('0x3e')]=_[_0x4978('0x40')](db[_0x4978('0x3b')][_0x4978('0x52')]);_0x513213[_0x4978('0x3f')]=_[_0x4978('0x40')](_0x4f6dfd['query']);_0x513213[_0x4978('0x41')]=_[_0x4978('0x42')](_0x513213[_0x4978('0x3e')],_0x513213[_0x4978('0x3f')]);_0x4e81c8[_0x4978('0x43')]=_[_0x4978('0x42')](_0x513213[_0x4978('0x3e')],qs['fields'](_0x4f6dfd[_0x4978('0x3f')]['fields']));_0x4e81c8['attributes']=_0x4e81c8[_0x4978('0x43')][_0x4978('0x53')]?_0x4e81c8[_0x4978('0x43')]:_0x513213[_0x4978('0x3e')];if(_0x4f6dfd['query'][_0x4978('0x4d')]){_0x4e81c8['include']=[{'all':!![]}];}_0x4e81c8=_[_0x4978('0x4c')]({},_0x4e81c8,_0x4f6dfd[_0x4978('0x54')]);return db['VoiceContext'][_0x4978('0x55')](_0x4e81c8)['then'](handleEntityNotFound(_0x305546,null))[_0x4978('0x1c')](respondWithResult(_0x305546,null))[_0x4978('0x25')](handleError(_0x305546,null));};exports[_0x4978('0x56')]=function(_0x14b18a,_0x22b3f9,_0x382d54){var _0x4e7679;return db['VoiceContext'][_0x4978('0x56')](_0x14b18a[_0x4978('0x57')],{'raw':!![]})[_0x4978('0x1c')](function(_0x3d5c41){_0x4e7679=_0x3d5c41;return db[_0x4978('0x3b')][_0x4978('0x4f')]({'raw':!![]});})[_0x4978('0x1c')](function(_0x2dd8f2){var _0x548310=fs['readFileSync'](path[_0x4978('0x58')](config[_0x4978('0x59')],_0x4978('0x5a')),'utf8');var _0x394d8d=ejs[_0x4978('0x5b')](_0x548310,{'contexts':_0x2dd8f2||[]});fs[_0x4978('0x5c')](_0x4978('0x5d'),_0x394d8d);})[_0x4978('0x1c')](function(){return respondWithRpcPromise('Reload',_0x4978('0x56'),{'module':_0x4978('0x5e')});})['then'](function(){var _0x102387=_0x14b18a[_0x4978('0x5f')][_0x4978('0x60')]({'plain':!![]});if(!_0x102387)throw new Error(_0x4978('0x61'));if(_0x102387[_0x4978('0x62')]==='user'){var _0x1364c0=_0x4e7679[_0x4978('0x60')]({'plain':!![]});return db[_0x4978('0x63')][_0x4978('0x55')]({'where':{'name':_0x4978('0x33'),'userProfileId':_0x102387[_0x4978('0x64')]},'raw':!![]})[_0x4978('0x1c')](function(_0x51f5ea){if(_0x51f5ea&&_0x51f5ea['autoAssociation']===0x0){return db[_0x4978('0x34')][_0x4978('0x56')]({'name':_0x1364c0[_0x4978('0x37')],'resourceId':_0x1364c0['id'],'type':_0x51f5ea[_0x4978('0x37')],'sectionId':_0x51f5ea['id']},{})[_0x4978('0x1c')](function(){return _0x4e7679;});}else{return _0x4e7679;}})[_0x4978('0x25')](function(_0x4be6ef){logger[_0x4978('0x21')](_0x4978('0x65'),_0x4be6ef);throw _0x4be6ef;});}return _0x4e7679;})[_0x4978('0x1c')](respondWithResult(_0x22b3f9,0xc9))['catch'](handleError(_0x22b3f9,null));};exports[_0x4978('0x32')]=function(_0x234a87,_0x15d07d,_0x12f2a3){var _0x49e8ad;return db[_0x4978('0x3b')][_0x4978('0x55')]({'where':{'id':_0x234a87[_0x4978('0x66')]['id']}})['then'](handleEntityNotFound(_0x15d07d,null))[_0x4978('0x1c')](saveUpdates(_0x234a87['body'],null))[_0x4978('0x1c')](function(_0x448c4b){if(_0x448c4b){_0x49e8ad=_0x448c4b;return db[_0x4978('0x3b')][_0x4978('0x4f')]({'raw':!![]});}})[_0x4978('0x1c')](function(_0x5c42d3){var _0x9cffde=fs[_0x4978('0x67')](path[_0x4978('0x58')](config[_0x4978('0x59')],_0x4978('0x5a')),_0x4978('0x68'));var _0x210e77=ejs[_0x4978('0x5b')](_0x9cffde,{'contexts':_0x5c42d3||[]});fs[_0x4978('0x5c')](_0x4978('0x5d'),_0x210e77);})[_0x4978('0x1c')](function(){return respondWithRpcPromise(_0x4978('0x69'),_0x4978('0x32'),{'module':_0x4978('0x5e')});})[_0x4978('0x1c')](function(){return _0x49e8ad;})[_0x4978('0x1c')](respondWithResult(_0x15d07d,null))[_0x4978('0x25')](handleError(_0x15d07d,null));};exports['destroy']=function(_0x2f73a7,_0x258348,_0x251228){var _0x539188;return db[_0x4978('0x3b')][_0x4978('0x55')]({'where':{'id':_0x2f73a7[_0x4978('0x66')]['id']}})[_0x4978('0x1c')](handleEntityNotFound(_0x258348,null))[_0x4978('0x1c')](removeEntity(_0x258348,null))[_0x4978('0x1c')](function(){return db[_0x4978('0x3b')][_0x4978('0x4f')]({'raw':!![]});})[_0x4978('0x1c')](function(_0x2735bf){var _0xdec60c=fs[_0x4978('0x67')](path['join'](config['root'],'server/files/templates/context.ejs'),_0x4978('0x68'));var _0x1fe101=ejs[_0x4978('0x5b')](_0xdec60c,{'contexts':_0x2735bf});fs[_0x4978('0x5c')](_0x4978('0x5d'),_0x1fe101);return respondWithRpcPromise(_0x4978('0x69'),_0x4978('0x35'),{'module':_0x4978('0x5e')});})[_0x4978('0x25')](handleError(_0x258348,null));}; \ No newline at end of file +var _0xe907=['fieldName','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','include','rows','show','params','includeAll','create','body','findAll','join','root','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','readFileSync','server/files/templates/context.ejs','utf8','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','squel','crypto','jsforce','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','get','Contexts','UserProfileResource','end','stack','name','index','map','VoiceContext','rawAttributes'];(function(_0x5df67c,_0x5b6aea){var _0x854a88=function(_0x4cf3b1){while(--_0x4cf3b1){_0x5df67c['push'](_0x5df67c['shift']());}};_0x854a88(++_0x5b6aea);}(_0xe907,0x93));var _0x7e90=function(_0x345fb4,_0x2b604f){_0x345fb4=_0x345fb4-0x0;var _0x1cb927=_0xe907[_0x345fb4];return _0x1cb927;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7e90('0x0'));var zipdir=require(_0x7e90('0x1'));var jsonpatch=require(_0x7e90('0x2'));var rp=require(_0x7e90('0x3'));var moment=require(_0x7e90('0x4'));var BPromise=require(_0x7e90('0x5'));var Mustache=require('mustache');var util=require(_0x7e90('0x6'));var path=require('path');var sox=require(_0x7e90('0x7'));var csv=require(_0x7e90('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7e90('0x9'));var _=require('lodash');var squel=require(_0x7e90('0xa'));var crypto=require(_0x7e90('0xb'));var jsforce=require(_0x7e90('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7e90('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7e90('0xd'));var as=require(_0x7e90('0xe'));var hardwareService=require(_0x7e90('0xf'));var logger=require(_0x7e90('0x10'))(_0x7e90('0x11'));var utils=require(_0x7e90('0x12'));var config=require(_0x7e90('0x13'));var licenseUtil=require(_0x7e90('0x14'));var db=require(_0x7e90('0x15'))['db'];var jayson=require(_0x7e90('0x16'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x505b88,_0x4602c1,_0xec377b,_0x54080a){return new BPromise(function(_0x3eef09,_0x43f224){var _0x14b5b0=_0x54080a||client;return _0x14b5b0[_0x7e90('0x17')](_0x505b88,_0xec377b)[_0x7e90('0x18')](function(_0x1f9ec7){logger[_0x7e90('0x19')](_0x7e90('0x1a'),_0x4602c1,_0x7e90('0x1b'));logger['debug'](_0x7e90('0x1c'),_0x4602c1,'request\x20sent',JSON[_0x7e90('0x1d')](_0x1f9ec7));if(_0x1f9ec7[_0x7e90('0x1e')]){if(_0x1f9ec7[_0x7e90('0x1e')][_0x7e90('0x1f')]===0x1f4){logger[_0x7e90('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x4602c1,_0x1f9ec7['error'][_0x7e90('0x20')]);return _0x43f224(_0x1f9ec7[_0x7e90('0x1e')]['message']);}logger[_0x7e90('0x1e')](_0x7e90('0x1a'),_0x4602c1,_0x1f9ec7[_0x7e90('0x1e')][_0x7e90('0x20')]);return _0x3eef09(_0x1f9ec7[_0x7e90('0x1e')][_0x7e90('0x20')]);}else{logger['info'](_0x7e90('0x1a'),_0x4602c1,_0x7e90('0x1b'));_0x3eef09(_0x1f9ec7[_0x7e90('0x21')][_0x7e90('0x20')]);}})[_0x7e90('0x22')](function(_0x10c33d){logger[_0x7e90('0x1e')](_0x7e90('0x1a'),_0x4602c1,_0x10c33d);_0x43f224(_0x10c33d);});});}function respondWithStatusCode(_0x25d18a,_0x27546b){_0x27546b=_0x27546b||0xcc;return function(_0x1c5bd2){if(_0x1c5bd2){return _0x25d18a[_0x7e90('0x23')](_0x27546b);}return _0x25d18a[_0x7e90('0x24')](_0x27546b)['end']();};}function respondWithResult(_0x2ec567,_0x210adb){_0x210adb=_0x210adb||0xc8;return function(_0x47069b){if(_0x47069b){return _0x2ec567[_0x7e90('0x24')](_0x210adb)['json'](_0x47069b);}};}function respondWithFilteredResult(_0x321967,_0x5c843a){return function(_0x5b3b1a){if(_0x5b3b1a){var _0x3a1a05=typeof _0x5c843a[_0x7e90('0x25')]===_0x7e90('0x26')&&typeof _0x5c843a[_0x7e90('0x27')]===_0x7e90('0x26');var _0x54e7a9=_0x5b3b1a[_0x7e90('0x28')];var _0x140b2b=_0x3a1a05?0x0:_0x5c843a[_0x7e90('0x25')];var _0x176749=_0x3a1a05?_0x5b3b1a[_0x7e90('0x28')]:_0x5c843a[_0x7e90('0x25')]+_0x5c843a[_0x7e90('0x27')];var _0x227ff2;if(_0x176749>=_0x54e7a9){_0x176749=_0x54e7a9;_0x227ff2=0xc8;}else{_0x227ff2=0xce;}_0x321967[_0x7e90('0x24')](_0x227ff2);return _0x321967[_0x7e90('0x29')](_0x7e90('0x2a'),_0x140b2b+'-'+_0x176749+'/'+_0x54e7a9)[_0x7e90('0x2b')](_0x5b3b1a);}return null;};}function patchUpdates(_0x3180c3){return function(_0x51edc2){try{jsonpatch[_0x7e90('0x2c')](_0x51edc2,_0x3180c3,!![]);}catch(_0x2f535a){return BPromise[_0x7e90('0x2d')](_0x2f535a);}return _0x51edc2[_0x7e90('0x2e')]();};}function saveUpdates(_0x1ec649,_0xce13cd){return function(_0x2a7ff8){if(_0x2a7ff8){return _0x2a7ff8[_0x7e90('0x2f')](_0x1ec649)[_0x7e90('0x18')](function(_0x5035de){return _0x5035de;});}return null;};}function removeEntity(_0x205409,_0xdc87b){return function(_0x6b2caa){if(_0x6b2caa){return _0x6b2caa[_0x7e90('0x30')]()['then'](function(){var _0x35b51c=_0x6b2caa[_0x7e90('0x31')]({'plain':!![]});var _0x1d7a6a=_0x7e90('0x32');return db[_0x7e90('0x33')][_0x7e90('0x30')]({'where':{'type':_0x1d7a6a,'resourceId':_0x35b51c['id']}})[_0x7e90('0x18')](function(){return _0x6b2caa;});})[_0x7e90('0x18')](function(){_0x205409[_0x7e90('0x24')](0xcc)[_0x7e90('0x34')]();});}};}function handleEntityNotFound(_0x53cb8a,_0x4e0fd2){return function(_0x47e0e3){if(!_0x47e0e3){_0x53cb8a[_0x7e90('0x23')](0x194);}return _0x47e0e3;};}function handleError(_0x4d00cf,_0x56fdbe){_0x56fdbe=_0x56fdbe||0x1f4;return function(_0x2b4ba9){logger['error'](_0x2b4ba9[_0x7e90('0x35')]);if(_0x2b4ba9[_0x7e90('0x36')]){delete _0x2b4ba9[_0x7e90('0x36')];}_0x4d00cf[_0x7e90('0x24')](_0x56fdbe)['send'](_0x2b4ba9);};}exports[_0x7e90('0x37')]=function(_0x58e441,_0x422605){var _0x358903={},_0x15d218={},_0x39a802={'count':0x0,'rows':[]};var _0x2796a4=_[_0x7e90('0x38')](db[_0x7e90('0x39')][_0x7e90('0x3a')],function(_0x5ac8c0){return{'name':_0x5ac8c0[_0x7e90('0x3b')],'type':_0x5ac8c0['type'][_0x7e90('0x3c')]};});_0x15d218['model']=_[_0x7e90('0x38')](_0x2796a4,_0x7e90('0x36'));_0x15d218['query']=_[_0x7e90('0x3d')](_0x58e441[_0x7e90('0x3e')]);_0x15d218[_0x7e90('0x3f')]=_[_0x7e90('0x40')](_0x15d218['model'],_0x15d218[_0x7e90('0x3e')]);_0x358903[_0x7e90('0x41')]=_[_0x7e90('0x40')](_0x15d218[_0x7e90('0x42')],qs[_0x7e90('0x43')](_0x58e441['query'][_0x7e90('0x43')]));_0x358903['attributes']=_0x358903[_0x7e90('0x41')][_0x7e90('0x44')]?_0x358903[_0x7e90('0x41')]:_0x15d218[_0x7e90('0x42')];if(!_0x58e441[_0x7e90('0x3e')][_0x7e90('0x45')](_0x7e90('0x46'))){_0x358903[_0x7e90('0x27')]=qs[_0x7e90('0x27')](_0x58e441['query'][_0x7e90('0x27')]);_0x358903[_0x7e90('0x25')]=qs[_0x7e90('0x25')](_0x58e441['query'][_0x7e90('0x25')]);}_0x358903[_0x7e90('0x47')]=qs[_0x7e90('0x48')](_0x58e441[_0x7e90('0x3e')][_0x7e90('0x48')]);_0x358903[_0x7e90('0x49')]=qs[_0x7e90('0x3f')](_['pick'](_0x58e441[_0x7e90('0x3e')],_0x15d218['filters']),_0x2796a4);if(_0x58e441[_0x7e90('0x3e')][_0x7e90('0x4a')]){_0x358903[_0x7e90('0x49')]=_[_0x7e90('0x4b')](_0x358903[_0x7e90('0x49')],{'$or':_[_0x7e90('0x38')](_0x2796a4,function(_0x45f337){if(_0x45f337[_0x7e90('0x4c')]!==_0x7e90('0x4d')){var _0x5beeb0={};_0x5beeb0[_0x45f337[_0x7e90('0x36')]]={'$like':'%'+_0x58e441[_0x7e90('0x3e')][_0x7e90('0x4a')]+'%'};return _0x5beeb0;}})});}_0x358903=_[_0x7e90('0x4b')]({},_0x358903,_0x58e441[_0x7e90('0x4e')]);var _0x537628={'where':_0x358903[_0x7e90('0x49')]};return db[_0x7e90('0x39')][_0x7e90('0x28')](_0x537628)[_0x7e90('0x18')](function(_0x383c25){_0x39a802[_0x7e90('0x28')]=_0x383c25;if(_0x58e441[_0x7e90('0x3e')]['includeAll']){_0x358903[_0x7e90('0x4f')]=[{'all':!![]}];}return db[_0x7e90('0x39')]['findAll'](_0x358903);})[_0x7e90('0x18')](function(_0x39f4fd){_0x39a802[_0x7e90('0x50')]=_0x39f4fd;return _0x39a802;})[_0x7e90('0x18')](respondWithFilteredResult(_0x422605,_0x358903))[_0x7e90('0x22')](handleError(_0x422605,null));};exports[_0x7e90('0x51')]=function(_0x50740e,_0x3e3f46){var _0x242080={'raw':![],'where':{'id':_0x50740e[_0x7e90('0x52')]['id']}},_0x4bf4ba={};_0x4bf4ba[_0x7e90('0x42')]=_[_0x7e90('0x3d')](db['VoiceContext']['rawAttributes']);_0x4bf4ba[_0x7e90('0x3e')]=_[_0x7e90('0x3d')](_0x50740e['query']);_0x4bf4ba['filters']=_[_0x7e90('0x40')](_0x4bf4ba[_0x7e90('0x42')],_0x4bf4ba[_0x7e90('0x3e')]);_0x242080['attributes']=_[_0x7e90('0x40')](_0x4bf4ba[_0x7e90('0x42')],qs['fields'](_0x50740e[_0x7e90('0x3e')][_0x7e90('0x43')]));_0x242080[_0x7e90('0x41')]=_0x242080[_0x7e90('0x41')][_0x7e90('0x44')]?_0x242080[_0x7e90('0x41')]:_0x4bf4ba[_0x7e90('0x42')];if(_0x50740e[_0x7e90('0x3e')][_0x7e90('0x53')]){_0x242080['include']=[{'all':!![]}];}_0x242080=_[_0x7e90('0x4b')]({},_0x242080,_0x50740e[_0x7e90('0x4e')]);return db[_0x7e90('0x39')]['find'](_0x242080)[_0x7e90('0x18')](handleEntityNotFound(_0x3e3f46,null))[_0x7e90('0x18')](respondWithResult(_0x3e3f46,null))[_0x7e90('0x22')](handleError(_0x3e3f46,null));};exports[_0x7e90('0x54')]=function(_0x1ec982,_0x5b472e,_0xd2c85){var _0x2a54ca;return db[_0x7e90('0x39')][_0x7e90('0x54')](_0x1ec982[_0x7e90('0x55')],{'raw':!![]})[_0x7e90('0x18')](function(_0x2f022a){_0x2a54ca=_0x2f022a;return db[_0x7e90('0x39')][_0x7e90('0x56')]({'raw':!![]});})[_0x7e90('0x18')](function(_0x4c3c4e){var _0x5634c3=fs['readFileSync'](path[_0x7e90('0x57')](config[_0x7e90('0x58')],'server/files/templates/context.ejs'),'utf8');var _0x48097=ejs[_0x7e90('0x59')](_0x5634c3,{'contexts':_0x4c3c4e||[]});fs[_0x7e90('0x5a')](_0x7e90('0x5b'),_0x48097);})['then'](function(){return respondWithRpcPromise(_0x7e90('0x5c'),'create',{'module':_0x7e90('0x5d')});})['then'](function(){var _0x43f6ca=_0x1ec982[_0x7e90('0x5e')][_0x7e90('0x31')]({'plain':!![]});if(!_0x43f6ca)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x43f6ca[_0x7e90('0x5f')]===_0x7e90('0x5e')){var _0x3947a9=_0x2a54ca[_0x7e90('0x31')]({'plain':!![]});return db[_0x7e90('0x60')]['find']({'where':{'name':'Contexts','userProfileId':_0x43f6ca[_0x7e90('0x61')]},'raw':!![]})['then'](function(_0x4b9f4e){if(_0x4b9f4e&&_0x4b9f4e['autoAssociation']===0x0){return db[_0x7e90('0x33')]['create']({'name':_0x3947a9[_0x7e90('0x36')],'resourceId':_0x3947a9['id'],'type':_0x4b9f4e['name'],'sectionId':_0x4b9f4e['id']},{})[_0x7e90('0x18')](function(){return _0x2a54ca;});}else{return _0x2a54ca;}})[_0x7e90('0x22')](function(_0x10c3eb){logger[_0x7e90('0x1e')](_0x7e90('0x62'),_0x10c3eb);throw _0x10c3eb;});}return _0x2a54ca;})[_0x7e90('0x18')](respondWithResult(_0x5b472e,0xc9))[_0x7e90('0x22')](handleError(_0x5b472e,null));};exports[_0x7e90('0x2f')]=function(_0x555a2c,_0x3894bd,_0x180f08){var _0x2d339e;return db[_0x7e90('0x39')][_0x7e90('0x63')]({'where':{'id':_0x555a2c[_0x7e90('0x52')]['id']}})[_0x7e90('0x18')](handleEntityNotFound(_0x3894bd,null))[_0x7e90('0x18')](saveUpdates(_0x555a2c['body'],null))[_0x7e90('0x18')](function(_0x1fb540){if(_0x1fb540){_0x2d339e=_0x1fb540;return db[_0x7e90('0x39')]['findAll']({'raw':!![]});}})[_0x7e90('0x18')](function(_0xf23a3e){var _0x148c6e=fs[_0x7e90('0x64')](path['join'](config[_0x7e90('0x58')],_0x7e90('0x65')),'utf8');var _0x2ef135=ejs[_0x7e90('0x59')](_0x148c6e,{'contexts':_0xf23a3e||[]});fs[_0x7e90('0x5a')](_0x7e90('0x5b'),_0x2ef135);})[_0x7e90('0x18')](function(){return respondWithRpcPromise(_0x7e90('0x5c'),_0x7e90('0x2f'),{'module':'chan_sip.so'});})[_0x7e90('0x18')](function(){return _0x2d339e;})['then'](respondWithResult(_0x3894bd,null))[_0x7e90('0x22')](handleError(_0x3894bd,null));};exports['destroy']=function(_0x3169ef,_0xacf968,_0x802103){var _0x5a96ed;return db[_0x7e90('0x39')]['find']({'where':{'id':_0x3169ef['params']['id']}})[_0x7e90('0x18')](handleEntityNotFound(_0xacf968,null))[_0x7e90('0x18')](removeEntity(_0xacf968,null))[_0x7e90('0x18')](function(){return db[_0x7e90('0x39')][_0x7e90('0x56')]({'raw':!![]});})['then'](function(_0x5c8538){var _0x18e322=fs[_0x7e90('0x64')](path[_0x7e90('0x57')](config['root'],_0x7e90('0x65')),_0x7e90('0x66'));var _0xdbb527=ejs[_0x7e90('0x59')](_0x18e322,{'contexts':_0x5c8538});fs[_0x7e90('0x5a')](_0x7e90('0x5b'),_0xdbb527);return respondWithRpcPromise(_0x7e90('0x5c'),_0x7e90('0x30'),{'module':_0x7e90('0x5d')});})[_0x7e90('0x22')](handleError(_0xacf968,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index cdb95ad..3048f87 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 _0xade0=['./voiceContext.attributes','exports','define','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x426711,_0x12264c){var _0x592991=function(_0x564614){while(--_0x564614){_0x426711['push'](_0x426711['shift']());}};_0x592991(++_0x12264c);}(_0xade0,0x163));var _0x0ade=function(_0x4ec9e3,_0x15fbf4){_0x4ec9e3=_0x4ec9e3-0x0;var _0x2883ce=_0xade0[_0x4ec9e3];return _0x2883ce;};'use strict';var _=require(_0x0ade('0x0'));var util=require(_0x0ade('0x1'));var logger=require('../../config/logger')(_0x0ade('0x2'));var moment=require(_0x0ade('0x3'));var BPromise=require(_0x0ade('0x4'));var rp=require(_0x0ade('0x5'));var fs=require('fs');var path=require(_0x0ade('0x6'));var rimraf=require(_0x0ade('0x7'));var config=require('../../config/environment');var attributes=require(_0x0ade('0x8'));module[_0x0ade('0x9')]=function(_0x4c144d,_0x90eccb){return _0x4c144d[_0x0ade('0xa')]('VoiceContext',attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd2f8=['../../config/environment','./voiceContext.attributes','exports','VoiceContext','voice_contexts','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x48b0d8,_0x3521f9){var _0x25134b=function(_0x3bba37){while(--_0x3bba37){_0x48b0d8['push'](_0x48b0d8['shift']());}};_0x25134b(++_0x3521f9);}(_0xd2f8,0x95));var _0x8d2f=function(_0x12c076,_0x5bef17){_0x12c076=_0x12c076-0x0;var _0x2ddd18=_0xd2f8[_0x12c076];return _0x2ddd18;};'use strict';var _=require(_0x8d2f('0x0'));var util=require(_0x8d2f('0x1'));var logger=require(_0x8d2f('0x2'))(_0x8d2f('0x3'));var moment=require(_0x8d2f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d2f('0x5'));var rimraf=require(_0x8d2f('0x6'));var config=require(_0x8d2f('0x7'));var attributes=require(_0x8d2f('0x8'));module[_0x8d2f('0x9')]=function(_0x3ab9e0,_0x1113e1){return _0x3ab9e0['define'](_0x8d2f('0xa'),attributes,{'tableName':_0x8d2f('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 cf556c3..f23b2c5 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 _0x0419=['bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','VoiceContext,\x20%s,\x20%s','message','result','catch','moment'];(function(_0x4ee7f0,_0x5902ec){var _0x278513=function(_0x3ad40b){while(--_0x3ad40b){_0x4ee7f0['push'](_0x4ee7f0['shift']());}};_0x278513(++_0x5902ec);}(_0x0419,0x153));var _0x9041=function(_0x9ae292,_0x130cef){_0x9ae292=_0x9ae292-0x0;var _0xadefdd=_0x0419[_0x9ae292];return _0xadefdd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9041('0x0'));var BPromise=require(_0x9041('0x1'));var rs=require(_0x9041('0x2'));var fs=require('fs');var Redis=require(_0x9041('0x3'));var db=require(_0x9041('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9041('0x5'));var config=require(_0x9041('0x6'));var jayson=require(_0x9041('0x7'));var client=jayson[_0x9041('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x118c44,_0x11a488,_0x5457be){return new BPromise(function(_0x48ac45,_0x39296c){return client[_0x9041('0x9')](_0x118c44,_0x5457be)[_0x9041('0xa')](function(_0x5afe95){logger[_0x9041('0xb')]('VoiceContext,\x20%s,\x20%s',_0x11a488,_0x9041('0xc'));logger[_0x9041('0xd')](_0x9041('0xe'),_0x11a488,'request\x20sent',JSON['stringify'](_0x5afe95));if(_0x5afe95[_0x9041('0xf')]){if(_0x5afe95[_0x9041('0xf')]['code']===0x1f4){logger['error'](_0x9041('0x10'),_0x11a488,_0x5afe95[_0x9041('0xf')][_0x9041('0x11')]);return _0x39296c(_0x5afe95[_0x9041('0xf')][_0x9041('0x11')]);}logger[_0x9041('0xf')](_0x9041('0x10'),_0x11a488,_0x5afe95[_0x9041('0xf')][_0x9041('0x11')]);return _0x48ac45(_0x5afe95[_0x9041('0xf')][_0x9041('0x11')]);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x11a488,'request\x20sent');_0x48ac45(_0x5afe95[_0x9041('0x12')][_0x9041('0x11')]);}})[_0x9041('0x13')](function(_0x54c323){logger[_0x9041('0xf')](_0x9041('0x10'),_0x11a488,_0x54c323);_0x39296c(_0x54c323);});});} \ No newline at end of file +var _0xe7a0=['code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x37f065,_0x5bdd02){var _0x4bc31e=function(_0x2b1c5e){while(--_0x2b1c5e){_0x37f065['push'](_0x37f065['shift']());}};_0x4bc31e(++_0x5bdd02);}(_0xe7a0,0x10d));var _0x0e7a=function(_0x33f5a3,_0x18554b){_0x33f5a3=_0x33f5a3-0x0;var _0x41dcc4=_0xe7a0[_0x33f5a3];return _0x41dcc4;};'use strict';var _=require(_0x0e7a('0x0'));var util=require(_0x0e7a('0x1'));var moment=require(_0x0e7a('0x2'));var BPromise=require(_0x0e7a('0x3'));var rs=require(_0x0e7a('0x4'));var fs=require('fs');var Redis=require(_0x0e7a('0x5'));var db=require(_0x0e7a('0x6'))['db'];var utils=require(_0x0e7a('0x7'));var logger=require('../../config/logger')(_0x0e7a('0x8'));var config=require(_0x0e7a('0x9'));var jayson=require(_0x0e7a('0xa'));var client=jayson[_0x0e7a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57fe01,_0x1cd00c,_0x1418ed){return new BPromise(function(_0x446e1a,_0x26a3f9){return client[_0x0e7a('0xc')](_0x57fe01,_0x1418ed)[_0x0e7a('0xd')](function(_0x311dc3){logger['info'](_0x0e7a('0xe'),_0x1cd00c,_0x0e7a('0xf'));logger['debug'](_0x0e7a('0x10'),_0x1cd00c,_0x0e7a('0xf'),JSON[_0x0e7a('0x11')](_0x311dc3));if(_0x311dc3[_0x0e7a('0x12')]){if(_0x311dc3[_0x0e7a('0x12')][_0x0e7a('0x13')]===0x1f4){logger[_0x0e7a('0x12')]('VoiceContext,\x20%s,\x20%s',_0x1cd00c,_0x311dc3[_0x0e7a('0x12')][_0x0e7a('0x14')]);return _0x26a3f9(_0x311dc3['error'][_0x0e7a('0x14')]);}logger[_0x0e7a('0x12')](_0x0e7a('0xe'),_0x1cd00c,_0x311dc3[_0x0e7a('0x12')][_0x0e7a('0x14')]);return _0x446e1a(_0x311dc3[_0x0e7a('0x12')]['message']);}else{logger[_0x0e7a('0x15')](_0x0e7a('0xe'),_0x1cd00c,_0x0e7a('0xf'));_0x446e1a(_0x311dc3[_0x0e7a('0x16')][_0x0e7a('0x14')]);}})[_0x0e7a('0x17')](function(_0x1bd4c0){logger['error']('VoiceContext,\x20%s,\x20%s',_0x1cd00c,_0x1bd4c0);_0x26a3f9(_0x1bd4c0);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 58bf92d..83a1e6b 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 _0xf911=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x53447d,_0x2b6495){var _0x3c105a=function(_0x50c066){while(--_0x50c066){_0x53447d['push'](_0x53447d['shift']());}};_0x3c105a(++_0x2b6495);}(_0xf911,0xe2));var _0x1f91=function(_0x3c3128,_0x117d7d){_0x3c3128=_0x3c3128-0x0;var _0x26b55e=_0xf911[_0x3c3128];return _0x26b55e;};'use strict';var multer=require(_0x1f91('0x0'));var util=require(_0x1f91('0x1'));var path=require(_0x1f91('0x2'));var timeout=require(_0x1f91('0x3'));var express=require(_0x1f91('0x4'));var router=express[_0x1f91('0x5')]();var fs_extra=require(_0x1f91('0x6'));var auth=require(_0x1f91('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1f91('0x8'));var controller=require(_0x1f91('0x9'));router[_0x1f91('0xa')]('/',auth[_0x1f91('0xb')](),controller[_0x1f91('0xc')]);router[_0x1f91('0xa')](_0x1f91('0xd'),auth['isAuthenticated'](),controller[_0x1f91('0xe')]);router[_0x1f91('0xa')](_0x1f91('0xf'),auth[_0x1f91('0xb')](),controller[_0x1f91('0x10')]);router[_0x1f91('0x11')]('/',auth[_0x1f91('0xb')](),controller[_0x1f91('0x12')]);router[_0x1f91('0x13')]('/:id',auth[_0x1f91('0xb')](),controller[_0x1f91('0x14')]);router[_0x1f91('0x15')](_0x1f91('0xf'),auth[_0x1f91('0xb')](),controller['destroy']);module[_0x1f91('0x16')]=router; \ No newline at end of file +var _0x88e9=['express','Router','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','destroy','path','connect-timeout'];(function(_0x4db963,_0x49a6c6){var _0xe0475=function(_0x58414e){while(--_0x58414e){_0x4db963['push'](_0x4db963['shift']());}};_0xe0475(++_0x49a6c6);}(_0x88e9,0x141));var _0x988e=function(_0x20cb79,_0x11e512){_0x20cb79=_0x20cb79-0x0;var _0x5e3f60=_0x88e9[_0x20cb79];return _0x5e3f60;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x988e('0x0'));var timeout=require(_0x988e('0x1'));var express=require(_0x988e('0x2'));var router=express[_0x988e('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x988e('0x4'));var config=require(_0x988e('0x5'));var controller=require(_0x988e('0x6'));router[_0x988e('0x7')]('/',auth[_0x988e('0x8')](),controller['index']);router['get'](_0x988e('0x9'),auth[_0x988e('0x8')](),controller[_0x988e('0xa')]);router[_0x988e('0x7')](_0x988e('0xb'),auth[_0x988e('0x8')](),controller[_0x988e('0xc')]);router[_0x988e('0xd')]('/',auth[_0x988e('0x8')](),controller[_0x988e('0xe')]);router[_0x988e('0xf')](_0x988e('0xb'),auth[_0x988e('0x8')](),controller['update']);router['delete'](_0x988e('0xb'),auth[_0x988e('0x8')](),controller[_0x988e('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index ff1eed7..9841c49 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 _0x9f62=['exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x7c9fba,_0x10b015){var _0x5cceed=function(_0x4ae29a){while(--_0x4ae29a){_0x7c9fba['push'](_0x7c9fba['shift']());}};_0x5cceed(++_0x10b015);}(_0x9f62,0x154));var _0x29f6=function(_0xd06854,_0x441d8d){_0xd06854=_0xd06854-0x0;var _0x3391df=_0x9f62[_0xd06854];return _0x3391df;};'use strict';var Sequelize=require('sequelize');module[_0x29f6('0x0')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x29f6('0x1')]},'channelstate':{'type':Sequelize[_0x29f6('0x2')]},'channelstatedesc':{'type':Sequelize[_0x29f6('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x29f6('0x1')]},'connectedlinename':{'type':Sequelize[_0x29f6('0x1')]},'language':{'type':Sequelize[_0x29f6('0x1')]},'accountcode':{'type':Sequelize[_0x29f6('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x29f6('0x1')]},'priority':{'type':Sequelize[_0x29f6('0x2')]},'uniqueid':{'type':Sequelize[_0x29f6('0x1')]},'linkedid':{'type':Sequelize[_0x29f6('0x1')]},'destchannel':{'type':Sequelize[_0x29f6('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x29f6('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x29f6('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x29f6('0x1')]},'destexten':{'type':Sequelize[_0x29f6('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x29f6('0x1')]},'destlinkedid':{'type':Sequelize[_0x29f6('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x29f6('0x3')]},'lastevent':{'type':Sequelize[_0x29f6('0x1')],'comment':_0x29f6('0x4')},'routeId':{'type':Sequelize[_0x29f6('0x2')]},'duration':{'type':Sequelize[_0x29f6('0x2')]},'holdtime':{'type':Sequelize[_0x29f6('0x2')]},'billableseconds':{'type':Sequelize[_0x29f6('0x2')]}}; \ No newline at end of file +var _0x9c44=['STRING','INTEGER','DATE','called,connect,complete'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x9c44,0x178));var _0x49c4=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x9c44[_0x3b0731];return _0x4204d7;};'use strict';var Sequelize=require('sequelize');module['exports']={'privilege':{'type':Sequelize[_0x49c4('0x0')]},'channel':{'type':Sequelize[_0x49c4('0x0')]},'channelstate':{'type':Sequelize[_0x49c4('0x1')]},'channelstatedesc':{'type':Sequelize[_0x49c4('0x0')]},'calleridnum':{'type':Sequelize[_0x49c4('0x0')]},'calleridname':{'type':Sequelize[_0x49c4('0x0')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x49c4('0x0')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x49c4('0x0')]},'exten':{'type':Sequelize[_0x49c4('0x0')]},'priority':{'type':Sequelize[_0x49c4('0x1')]},'uniqueid':{'type':Sequelize[_0x49c4('0x0')]},'linkedid':{'type':Sequelize[_0x49c4('0x0')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x49c4('0x1')]},'destchannelstatedesc':{'type':Sequelize[_0x49c4('0x0')]},'destcalleridnum':{'type':Sequelize[_0x49c4('0x0')]},'destcalleridname':{'type':Sequelize[_0x49c4('0x0')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x49c4('0x0')]},'destaccountcode':{'type':Sequelize[_0x49c4('0x0')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x49c4('0x0')]},'destpriority':{'type':Sequelize[_0x49c4('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x49c4('0x0')]},'dialstatus':{'type':Sequelize[_0x49c4('0x0')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x49c4('0x2')]},'endtime':{'type':Sequelize[_0x49c4('0x2')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x49c4('0x3')},'routeId':{'type':Sequelize[_0x49c4('0x1')]},'duration':{'type':Sequelize[_0x49c4('0x1')]},'holdtime':{'type':Sequelize[_0x49c4('0x1')]},'billableseconds':{'type':Sequelize[_0x49c4('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 340dcb6..cce0dda 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 _0xa1d1=['apply','reject','save','update','error','stack','name','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','then','include','catch','show','params','includeAll','create','body','destroy','find','describe','rimraf','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x265210,_0x14b773){var _0x431790=function(_0xf0640f){while(--_0xf0640f){_0x265210['push'](_0x265210['shift']());}};_0x431790(++_0x14b773);}(_0xa1d1,0x1e5));var _0x1a1d=function(_0x311834,_0x1243ff){_0x311834=_0x311834-0x0;var _0x10e3d5=_0xa1d1[_0x311834];return _0x10e3d5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1a1d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1a1d('0x1'));var Mustache=require(_0x1a1d('0x2'));var util=require(_0x1a1d('0x3'));var path=require(_0x1a1d('0x4'));var sox=require(_0x1a1d('0x5'));var csv=require(_0x1a1d('0x6'));var ejs=require(_0x1a1d('0x7'));var fs=require('fs');var fs_extra=require(_0x1a1d('0x8'));var _=require('lodash');var squel=require(_0x1a1d('0x9'));var crypto=require('crypto');var jsforce=require(_0x1a1d('0xa'));var deskjs=require(_0x1a1d('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1a1d('0xc'));var Redis=require(_0x1a1d('0xd'));var authService=require(_0x1a1d('0xe'));var qs=require(_0x1a1d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1a1d('0x10'));var logger=require(_0x1a1d('0x11'))(_0x1a1d('0x12'));var utils=require(_0x1a1d('0x13'));var config=require(_0x1a1d('0x14'));var licenseUtil=require(_0x1a1d('0x15'));var db=require(_0x1a1d('0x16'))['db'];function respondWithStatusCode(_0x100708,_0x1e4d84){_0x1e4d84=_0x1e4d84||0xcc;return function(_0x33f6e4){if(_0x33f6e4){return _0x100708[_0x1a1d('0x17')](_0x1e4d84);}return _0x100708['status'](_0x1e4d84)[_0x1a1d('0x18')]();};}function respondWithResult(_0xb37913,_0x2edbea){_0x2edbea=_0x2edbea||0xc8;return function(_0x5b3648){if(_0x5b3648){return _0xb37913[_0x1a1d('0x19')](_0x2edbea)[_0x1a1d('0x1a')](_0x5b3648);}};}function respondWithFilteredResult(_0x2cf444,_0x15fd7){return function(_0x4aec2b){if(_0x4aec2b){var _0x3736ec=typeof _0x15fd7[_0x1a1d('0x1b')]===_0x1a1d('0x1c')&&typeof _0x15fd7[_0x1a1d('0x1d')]===_0x1a1d('0x1c');var _0x15de24=_0x4aec2b[_0x1a1d('0x1e')];var _0x4201c3=_0x3736ec?0x0:_0x15fd7[_0x1a1d('0x1b')];var _0x371f8e=_0x3736ec?_0x4aec2b[_0x1a1d('0x1e')]:_0x15fd7[_0x1a1d('0x1b')]+_0x15fd7['limit'];var _0x5444be;if(_0x371f8e>=_0x15de24){_0x371f8e=_0x15de24;_0x5444be=0xc8;}else{_0x5444be=0xce;}_0x2cf444[_0x1a1d('0x19')](_0x5444be);return _0x2cf444[_0x1a1d('0x1f')](_0x1a1d('0x20'),_0x4201c3+'-'+_0x371f8e+'/'+_0x15de24)['json'](_0x4aec2b);}return null;};}function patchUpdates(_0x5ba7d7){return function(_0x3452cd){try{jsonpatch[_0x1a1d('0x21')](_0x3452cd,_0x5ba7d7,!![]);}catch(_0x3f0973){return BPromise[_0x1a1d('0x22')](_0x3f0973);}return _0x3452cd[_0x1a1d('0x23')]();};}function saveUpdates(_0x53694c,_0x3157e9){return function(_0x37528e){if(_0x37528e){return _0x37528e[_0x1a1d('0x24')](_0x53694c)['then'](function(_0x14fdaa){return _0x14fdaa;});}return null;};}function removeEntity(_0x5c410e,_0x15f162){return function(_0x2930a0){if(_0x2930a0){return _0x2930a0['destroy']()['then'](function(){_0x5c410e['status'](0xcc)[_0x1a1d('0x18')]();});}};}function handleEntityNotFound(_0x2df74c,_0x323299){return function(_0x1de321){if(!_0x1de321){_0x2df74c[_0x1a1d('0x17')](0x194);}return _0x1de321;};}function handleError(_0x36ff15,_0x1b53fe){_0x1b53fe=_0x1b53fe||0x1f4;return function(_0x1bfe3c){logger[_0x1a1d('0x25')](_0x1bfe3c[_0x1a1d('0x26')]);if(_0x1bfe3c[_0x1a1d('0x27')]){delete _0x1bfe3c[_0x1a1d('0x27')];}_0x36ff15[_0x1a1d('0x19')](_0x1b53fe)['send'](_0x1bfe3c);};}exports['index']=function(_0x40ba40,_0x2e0117){var _0x10a2c3={},_0xe768d4={},_0x59d609={'count':0x0,'rows':[]};var _0x2fb003=_[_0x1a1d('0x28')](db[_0x1a1d('0x29')][_0x1a1d('0x2a')],function(_0x260a2d){return{'name':_0x260a2d[_0x1a1d('0x2b')],'type':_0x260a2d[_0x1a1d('0x2c')][_0x1a1d('0x2d')]};});_0xe768d4[_0x1a1d('0x2e')]=_[_0x1a1d('0x28')](_0x2fb003,_0x1a1d('0x27'));_0xe768d4[_0x1a1d('0x2f')]=_[_0x1a1d('0x30')](_0x40ba40['query']);_0xe768d4['filters']=_[_0x1a1d('0x31')](_0xe768d4[_0x1a1d('0x2e')],_0xe768d4[_0x1a1d('0x2f')]);_0x10a2c3['attributes']=_['intersection'](_0xe768d4[_0x1a1d('0x2e')],qs['fields'](_0x40ba40[_0x1a1d('0x2f')][_0x1a1d('0x32')]));_0x10a2c3[_0x1a1d('0x33')]=_0x10a2c3[_0x1a1d('0x33')][_0x1a1d('0x34')]?_0x10a2c3[_0x1a1d('0x33')]:_0xe768d4[_0x1a1d('0x2e')];if(!_0x40ba40[_0x1a1d('0x2f')][_0x1a1d('0x35')](_0x1a1d('0x36'))){_0x10a2c3[_0x1a1d('0x1d')]=qs[_0x1a1d('0x1d')](_0x40ba40[_0x1a1d('0x2f')][_0x1a1d('0x1d')]);_0x10a2c3[_0x1a1d('0x1b')]=qs[_0x1a1d('0x1b')](_0x40ba40['query'][_0x1a1d('0x1b')]);}_0x10a2c3['order']=qs[_0x1a1d('0x37')](_0x40ba40[_0x1a1d('0x2f')][_0x1a1d('0x37')]);_0x10a2c3[_0x1a1d('0x38')]=qs[_0x1a1d('0x39')](_[_0x1a1d('0x3a')](_0x40ba40[_0x1a1d('0x2f')],_0xe768d4['filters']),_0x2fb003);if(_0x40ba40['query'][_0x1a1d('0x3b')]){_0x10a2c3[_0x1a1d('0x38')]=_[_0x1a1d('0x3c')](_0x10a2c3['where'],{'$or':_[_0x1a1d('0x28')](_0x2fb003,function(_0x46b63e){if(_0x46b63e['type']!==_0x1a1d('0x3d')){var _0x173bdf={};_0x173bdf[_0x46b63e[_0x1a1d('0x27')]]={'$like':'%'+_0x40ba40[_0x1a1d('0x2f')][_0x1a1d('0x3b')]+'%'};return _0x173bdf;}})});}_0x10a2c3=_[_0x1a1d('0x3c')]({},_0x10a2c3,_0x40ba40[_0x1a1d('0x3e')]);var _0x452269={'where':_0x10a2c3[_0x1a1d('0x38')]};return db['VoiceDialReport']['count'](_0x452269)[_0x1a1d('0x3f')](function(_0x710f85){_0x59d609[_0x1a1d('0x1e')]=_0x710f85;if(_0x40ba40[_0x1a1d('0x2f')]['includeAll']){_0x10a2c3[_0x1a1d('0x40')]=[{'all':!![]}];}return db[_0x1a1d('0x29')]['findAll'](_0x10a2c3);})[_0x1a1d('0x3f')](function(_0x392ef3){_0x59d609['rows']=_0x392ef3;return _0x59d609;})[_0x1a1d('0x3f')](respondWithFilteredResult(_0x2e0117,_0x10a2c3))[_0x1a1d('0x41')](handleError(_0x2e0117,null));};exports[_0x1a1d('0x42')]=function(_0x30f84b,_0x5255ae){var _0x42b25c={'raw':!![],'where':{'id':_0x30f84b[_0x1a1d('0x43')]['id']}},_0x853bb3={};_0x853bb3[_0x1a1d('0x2e')]=_[_0x1a1d('0x30')](db[_0x1a1d('0x29')][_0x1a1d('0x2a')]);_0x853bb3['query']=_[_0x1a1d('0x30')](_0x30f84b['query']);_0x853bb3['filters']=_[_0x1a1d('0x31')](_0x853bb3[_0x1a1d('0x2e')],_0x853bb3['query']);_0x42b25c[_0x1a1d('0x33')]=_['intersection'](_0x853bb3[_0x1a1d('0x2e')],qs[_0x1a1d('0x32')](_0x30f84b[_0x1a1d('0x2f')]['fields']));_0x42b25c['attributes']=_0x42b25c[_0x1a1d('0x33')][_0x1a1d('0x34')]?_0x42b25c[_0x1a1d('0x33')]:_0x853bb3[_0x1a1d('0x2e')];if(_0x30f84b['query'][_0x1a1d('0x44')]){_0x42b25c[_0x1a1d('0x40')]=[{'all':!![]}];}_0x42b25c=_[_0x1a1d('0x3c')]({},_0x42b25c,_0x30f84b[_0x1a1d('0x3e')]);return db[_0x1a1d('0x29')]['find'](_0x42b25c)[_0x1a1d('0x3f')](handleEntityNotFound(_0x5255ae,null))[_0x1a1d('0x3f')](respondWithResult(_0x5255ae,null))[_0x1a1d('0x41')](handleError(_0x5255ae,null));};exports[_0x1a1d('0x45')]=function(_0xe83236,_0x259618){return db[_0x1a1d('0x29')][_0x1a1d('0x45')](_0xe83236['body'],{})[_0x1a1d('0x3f')](respondWithResult(_0x259618,0xc9))['catch'](handleError(_0x259618,null));};exports[_0x1a1d('0x24')]=function(_0x142f8c,_0x3ea2b5){if(_0x142f8c[_0x1a1d('0x46')]['id']){delete _0x142f8c[_0x1a1d('0x46')]['id'];}return db['VoiceDialReport']['find']({'where':{'id':_0x142f8c[_0x1a1d('0x43')]['id']}})[_0x1a1d('0x3f')](handleEntityNotFound(_0x3ea2b5,null))[_0x1a1d('0x3f')](saveUpdates(_0x142f8c[_0x1a1d('0x46')],null))[_0x1a1d('0x3f')](respondWithResult(_0x3ea2b5,null))[_0x1a1d('0x41')](handleError(_0x3ea2b5,null));};exports[_0x1a1d('0x47')]=function(_0x3bf4e2,_0x5bf896){return db[_0x1a1d('0x29')][_0x1a1d('0x48')]({'where':{'id':_0x3bf4e2[_0x1a1d('0x43')]['id']}})[_0x1a1d('0x3f')](handleEntityNotFound(_0x5bf896,null))[_0x1a1d('0x3f')](removeEntity(_0x5bf896,null))[_0x1a1d('0x41')](handleError(_0x5bf896,null));};exports[_0x1a1d('0x49')]=function(_0x3a439a,_0x44e2a2){return db['VoiceDialReport'][_0x1a1d('0x49')]()[_0x1a1d('0x3f')](respondWithResult(_0x44e2a2,null))[_0x1a1d('0x41')](handleError(_0x44e2a2,null));}; \ No newline at end of file +var _0x9145=['nolimit','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','reject','save','update','then','destroy','error','stack','name','send','map','VoiceDialReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x2c7fb9,_0x33f18a){var _0x33fa50=function(_0x2f0a07){while(--_0x2f0a07){_0x2c7fb9['push'](_0x2c7fb9['shift']());}};_0x33fa50(++_0x33f18a);}(_0x9145,0xf5));var _0x5914=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9145[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x5914('0x0'));var rimraf=require(_0x5914('0x1'));var zipdir=require(_0x5914('0x2'));var jsonpatch=require(_0x5914('0x3'));var rp=require(_0x5914('0x4'));var moment=require(_0x5914('0x5'));var BPromise=require(_0x5914('0x6'));var Mustache=require(_0x5914('0x7'));var util=require(_0x5914('0x8'));var path=require(_0x5914('0x9'));var sox=require(_0x5914('0xa'));var csv=require('to-csv');var ejs=require(_0x5914('0xb'));var fs=require('fs');var fs_extra=require(_0x5914('0xc'));var _=require(_0x5914('0xd'));var squel=require(_0x5914('0xe'));var crypto=require('crypto');var jsforce=require(_0x5914('0xf'));var deskjs=require(_0x5914('0x10'));var toCsv=require(_0x5914('0x11'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5914('0x12'));var authService=require(_0x5914('0x13'));var qs=require(_0x5914('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5914('0x15'));var logger=require(_0x5914('0x16'))(_0x5914('0x17'));var utils=require(_0x5914('0x18'));var config=require(_0x5914('0x19'));var licenseUtil=require(_0x5914('0x1a'));var db=require(_0x5914('0x1b'))['db'];function respondWithStatusCode(_0x5a8ca2,_0x1f5417){_0x1f5417=_0x1f5417||0xcc;return function(_0x30357a){if(_0x30357a){return _0x5a8ca2[_0x5914('0x1c')](_0x1f5417);}return _0x5a8ca2[_0x5914('0x1d')](_0x1f5417)[_0x5914('0x1e')]();};}function respondWithResult(_0x2dfae8,_0x504f03){_0x504f03=_0x504f03||0xc8;return function(_0x2e1858){if(_0x2e1858){return _0x2dfae8[_0x5914('0x1d')](_0x504f03)['json'](_0x2e1858);}};}function respondWithFilteredResult(_0x248438,_0x4d44d1){return function(_0x20b2dd){if(_0x20b2dd){var _0x862e64=typeof _0x4d44d1[_0x5914('0x1f')]===_0x5914('0x20')&&typeof _0x4d44d1[_0x5914('0x21')]==='undefined';var _0x3414c7=_0x20b2dd[_0x5914('0x22')];var _0x31e05e=_0x862e64?0x0:_0x4d44d1[_0x5914('0x1f')];var _0x6b6b6c=_0x862e64?_0x20b2dd[_0x5914('0x22')]:_0x4d44d1[_0x5914('0x1f')]+_0x4d44d1['limit'];var _0x327bb4;if(_0x6b6b6c>=_0x3414c7){_0x6b6b6c=_0x3414c7;_0x327bb4=0xc8;}else{_0x327bb4=0xce;}_0x248438['status'](_0x327bb4);return _0x248438['set']('Content-Range',_0x31e05e+'-'+_0x6b6b6c+'/'+_0x3414c7)[_0x5914('0x23')](_0x20b2dd);}return null;};}function patchUpdates(_0x540ca3){return function(_0xc4b189){try{jsonpatch['apply'](_0xc4b189,_0x540ca3,!![]);}catch(_0x470f2f){return BPromise[_0x5914('0x24')](_0x470f2f);}return _0xc4b189[_0x5914('0x25')]();};}function saveUpdates(_0x11cea2,_0x1e61a3){return function(_0x4b5d59){if(_0x4b5d59){return _0x4b5d59[_0x5914('0x26')](_0x11cea2)[_0x5914('0x27')](function(_0x16735f){return _0x16735f;});}return null;};}function removeEntity(_0x5a9aab,_0x164495){return function(_0x203a72){if(_0x203a72){return _0x203a72[_0x5914('0x28')]()[_0x5914('0x27')](function(){_0x5a9aab[_0x5914('0x1d')](0xcc)[_0x5914('0x1e')]();});}};}function handleEntityNotFound(_0x17a668,_0x4826bb){return function(_0x2ba229){if(!_0x2ba229){_0x17a668[_0x5914('0x1c')](0x194);}return _0x2ba229;};}function handleError(_0x18095b,_0x3e5e93){_0x3e5e93=_0x3e5e93||0x1f4;return function(_0x2ebf4d){logger[_0x5914('0x29')](_0x2ebf4d[_0x5914('0x2a')]);if(_0x2ebf4d[_0x5914('0x2b')]){delete _0x2ebf4d[_0x5914('0x2b')];}_0x18095b[_0x5914('0x1d')](_0x3e5e93)[_0x5914('0x2c')](_0x2ebf4d);};}exports['index']=function(_0x413ab3,_0x366b70){var _0x3ff202={},_0x36b9a2={},_0x39576c={'count':0x0,'rows':[]};var _0x208ac9=_[_0x5914('0x2d')](db[_0x5914('0x2e')][_0x5914('0x2f')],function(_0x45381a){return{'name':_0x45381a[_0x5914('0x30')],'type':_0x45381a['type'][_0x5914('0x31')]};});_0x36b9a2[_0x5914('0x32')]=_['map'](_0x208ac9,'name');_0x36b9a2[_0x5914('0x33')]=_[_0x5914('0x34')](_0x413ab3['query']);_0x36b9a2[_0x5914('0x35')]=_['intersection'](_0x36b9a2[_0x5914('0x32')],_0x36b9a2[_0x5914('0x33')]);_0x3ff202[_0x5914('0x36')]=_[_0x5914('0x37')](_0x36b9a2[_0x5914('0x32')],qs[_0x5914('0x38')](_0x413ab3[_0x5914('0x33')][_0x5914('0x38')]));_0x3ff202[_0x5914('0x36')]=_0x3ff202[_0x5914('0x36')][_0x5914('0x39')]?_0x3ff202[_0x5914('0x36')]:_0x36b9a2[_0x5914('0x32')];if(!_0x413ab3[_0x5914('0x33')][_0x5914('0x3a')](_0x5914('0x3b'))){_0x3ff202[_0x5914('0x21')]=qs['limit'](_0x413ab3['query'][_0x5914('0x21')]);_0x3ff202[_0x5914('0x1f')]=qs[_0x5914('0x1f')](_0x413ab3[_0x5914('0x33')][_0x5914('0x1f')]);}_0x3ff202['order']=qs['sort'](_0x413ab3[_0x5914('0x33')]['sort']);_0x3ff202['where']=qs[_0x5914('0x35')](_[_0x5914('0x3c')](_0x413ab3[_0x5914('0x33')],_0x36b9a2[_0x5914('0x35')]),_0x208ac9);if(_0x413ab3[_0x5914('0x33')][_0x5914('0x3d')]){_0x3ff202[_0x5914('0x3e')]=_[_0x5914('0x3f')](_0x3ff202[_0x5914('0x3e')],{'$or':_['map'](_0x208ac9,function(_0x40135f){if(_0x40135f['type']!==_0x5914('0x40')){var _0x7eb6cc={};_0x7eb6cc[_0x40135f[_0x5914('0x2b')]]={'$like':'%'+_0x413ab3['query']['filter']+'%'};return _0x7eb6cc;}})});}_0x3ff202=_['merge']({},_0x3ff202,_0x413ab3[_0x5914('0x41')]);var _0x40aaab={'where':_0x3ff202[_0x5914('0x3e')]};return db[_0x5914('0x2e')][_0x5914('0x22')](_0x40aaab)['then'](function(_0x54b45){_0x39576c['count']=_0x54b45;if(_0x413ab3[_0x5914('0x33')]['includeAll']){_0x3ff202[_0x5914('0x42')]=[{'all':!![]}];}return db[_0x5914('0x2e')][_0x5914('0x43')](_0x3ff202);})[_0x5914('0x27')](function(_0x110940){_0x39576c[_0x5914('0x44')]=_0x110940;return _0x39576c;})[_0x5914('0x27')](respondWithFilteredResult(_0x366b70,_0x3ff202))['catch'](handleError(_0x366b70,null));};exports[_0x5914('0x45')]=function(_0x37582f,_0x459b3d){var _0xbc5ca7={'raw':!![],'where':{'id':_0x37582f[_0x5914('0x46')]['id']}},_0xdf328a={};_0xdf328a[_0x5914('0x32')]=_[_0x5914('0x34')](db[_0x5914('0x2e')]['rawAttributes']);_0xdf328a[_0x5914('0x33')]=_[_0x5914('0x34')](_0x37582f[_0x5914('0x33')]);_0xdf328a[_0x5914('0x35')]=_['intersection'](_0xdf328a[_0x5914('0x32')],_0xdf328a[_0x5914('0x33')]);_0xbc5ca7[_0x5914('0x36')]=_['intersection'](_0xdf328a['model'],qs['fields'](_0x37582f[_0x5914('0x33')][_0x5914('0x38')]));_0xbc5ca7[_0x5914('0x36')]=_0xbc5ca7['attributes'][_0x5914('0x39')]?_0xbc5ca7['attributes']:_0xdf328a['model'];if(_0x37582f[_0x5914('0x33')]['includeAll']){_0xbc5ca7['include']=[{'all':!![]}];}_0xbc5ca7=_['merge']({},_0xbc5ca7,_0x37582f[_0x5914('0x41')]);return db[_0x5914('0x2e')][_0x5914('0x47')](_0xbc5ca7)[_0x5914('0x27')](handleEntityNotFound(_0x459b3d,null))[_0x5914('0x27')](respondWithResult(_0x459b3d,null))[_0x5914('0x48')](handleError(_0x459b3d,null));};exports[_0x5914('0x49')]=function(_0x134c1f,_0x5236af){return db[_0x5914('0x2e')][_0x5914('0x49')](_0x134c1f['body'],{})[_0x5914('0x27')](respondWithResult(_0x5236af,0xc9))[_0x5914('0x48')](handleError(_0x5236af,null));};exports[_0x5914('0x26')]=function(_0xa3f03,_0x99892f){if(_0xa3f03[_0x5914('0x4a')]['id']){delete _0xa3f03[_0x5914('0x4a')]['id'];}return db[_0x5914('0x2e')][_0x5914('0x47')]({'where':{'id':_0xa3f03[_0x5914('0x46')]['id']}})[_0x5914('0x27')](handleEntityNotFound(_0x99892f,null))['then'](saveUpdates(_0xa3f03[_0x5914('0x4a')],null))['then'](respondWithResult(_0x99892f,null))[_0x5914('0x48')](handleError(_0x99892f,null));};exports['destroy']=function(_0x5cea37,_0xa09129){return db[_0x5914('0x2e')][_0x5914('0x47')]({'where':{'id':_0x5cea37[_0x5914('0x46')]['id']}})[_0x5914('0x27')](handleEntityNotFound(_0xa09129,null))[_0x5914('0x27')](removeEntity(_0xa09129,null))[_0x5914('0x48')](handleError(_0xa09129,null));};exports[_0x5914('0x4b')]=function(_0x16b679,_0x3da1e5){return db['VoiceDialReport']['describe']()[_0x5914('0x27')](respondWithResult(_0x3da1e5,null))[_0x5914('0x48')](handleError(_0x3da1e5,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 858b2ec..b91f915 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 _0x60c2=['rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3231fb,_0x2c82fe){var _0x5b1970=function(_0x2a93db){while(--_0x2a93db){_0x3231fb['push'](_0x3231fb['shift']());}};_0x5b1970(++_0x2c82fe);}(_0x60c2,0x8f));var _0x260c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x60c2[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x260c('0x0'));var logger=require(_0x260c('0x1'))(_0x260c('0x2'));var moment=require(_0x260c('0x3'));var BPromise=require(_0x260c('0x4'));var rp=require(_0x260c('0x5'));var fs=require('fs');var path=require(_0x260c('0x6'));var rimraf=require(_0x260c('0x7'));var config=require(_0x260c('0x8'));var attributes=require(_0x260c('0x9'));module[_0x260c('0xa')]=function(_0x13c7d0,_0x558b0c){return _0x13c7d0[_0x260c('0xb')](_0x260c('0xc'),attributes,{'tableName':_0x260c('0xd'),'paranoid':![],'indexes':[{'fields':[_0x260c('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x861c=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x25d467,_0x10b801){var _0x399ff6=function(_0x5b595d){while(--_0x5b595d){_0x25d467['push'](_0x25d467['shift']());}};_0x399ff6(++_0x10b801);}(_0x861c,0xdb));var _0xc861=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x861c[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xc861('0x0'));var util=require(_0xc861('0x1'));var logger=require(_0xc861('0x2'))(_0xc861('0x3'));var moment=require(_0xc861('0x4'));var BPromise=require(_0xc861('0x5'));var rp=require(_0xc861('0x6'));var fs=require('fs');var path=require(_0xc861('0x7'));var rimraf=require(_0xc861('0x8'));var config=require(_0xc861('0x9'));var attributes=require(_0xc861('0xa'));module[_0xc861('0xb')]=function(_0x562f12,_0xc3b5fd){return _0x562f12[_0xc861('0xc')](_0xc861('0xd'),attributes,{'tableName':_0xc861('0xe'),'paranoid':![],'indexes':[{'fields':[_0xc861('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 7708a90..305d233 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 _0x9231=['error','code','message','CreateVoiceDialReport','VoiceDialReport','create','body','options','catch','UpdateVoiceDialReport','update','where','attributes','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x9231,0x12d));var _0x1923=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9231[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1923('0x0'));var util=require('util');var moment=require(_0x1923('0x1'));var BPromise=require(_0x1923('0x2'));var rs=require(_0x1923('0x3'));var fs=require('fs');var Redis=require(_0x1923('0x4'));var db=require(_0x1923('0x5'))['db'];var utils=require(_0x1923('0x6'));var logger=require(_0x1923('0x7'))('rpc');var config=require(_0x1923('0x8'));var jayson=require(_0x1923('0x9'));var client=jayson['client'][_0x1923('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57f34c,_0xf7b71d,_0x19dafc){return new BPromise(function(_0x454aa3,_0x5a723a){return client[_0x1923('0xb')](_0x57f34c,_0x19dafc)[_0x1923('0xc')](function(_0x4bcbb9){logger[_0x1923('0xd')](_0x1923('0xe'),_0xf7b71d,_0x1923('0xf'));logger[_0x1923('0x10')](_0x1923('0x11'),_0xf7b71d,_0x1923('0xf'),JSON[_0x1923('0x12')](_0x4bcbb9));if(_0x4bcbb9[_0x1923('0x13')]){if(_0x4bcbb9['error'][_0x1923('0x14')]===0x1f4){logger[_0x1923('0x13')](_0x1923('0xe'),_0xf7b71d,_0x4bcbb9[_0x1923('0x13')]['message']);return _0x5a723a(_0x4bcbb9[_0x1923('0x13')][_0x1923('0x15')]);}logger[_0x1923('0x13')](_0x1923('0xe'),_0xf7b71d,_0x4bcbb9[_0x1923('0x13')][_0x1923('0x15')]);return _0x454aa3(_0x4bcbb9[_0x1923('0x13')][_0x1923('0x15')]);}else{logger[_0x1923('0xd')](_0x1923('0xe'),_0xf7b71d,_0x1923('0xf'));_0x454aa3(_0x4bcbb9['result'][_0x1923('0x15')]);}})['catch'](function(_0x444140){logger['error'](_0x1923('0xe'),_0xf7b71d,_0x444140);_0x5a723a(_0x444140);});});}exports[_0x1923('0x16')]=function(_0x1b147b){var _0x40787e=this;return new Promise(function(_0x275b0d,_0x12e1e2){return db[_0x1923('0x17')][_0x1923('0x18')](_0x1b147b[_0x1923('0x19')],{'raw':_0x1b147b[_0x1923('0x1a')]?_0x1b147b[_0x1923('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x1923('0xc')](function(_0x478a10){logger[_0x1923('0xd')]('CreateVoiceDialReport',_0x1b147b);logger[_0x1923('0x10')](_0x1923('0x16'),_0x1b147b,JSON[_0x1923('0x12')](_0x478a10));_0x275b0d(_0x478a10);})[_0x1923('0x1b')](function(_0x4b1314){logger[_0x1923('0x13')]('CreateVoiceDialReport',_0x4b1314['message'],_0x1b147b);_0x12e1e2(_0x40787e['error'](0x1f4,_0x4b1314[_0x1923('0x15')]));});});};exports[_0x1923('0x1c')]=function(_0x5ef0b0){var _0x40763f=this;return new Promise(function(_0x5babf8,_0x571dbb){return db[_0x1923('0x17')][_0x1923('0x1d')](_0x5ef0b0[_0x1923('0x19')],{'raw':_0x5ef0b0[_0x1923('0x1a')]?_0x5ef0b0[_0x1923('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ef0b0['options']?_0x5ef0b0[_0x1923('0x1a')][_0x1923('0x1e')]||null:null,'attributes':_0x5ef0b0[_0x1923('0x1a')]?_0x5ef0b0['options'][_0x1923('0x1f')]||null:null,'limit':_0x5ef0b0[_0x1923('0x1a')]?_0x5ef0b0[_0x1923('0x1a')]['limit']||null:null})['then'](function(_0xbc0720){logger[_0x1923('0xd')](_0x1923('0x1c'),_0x5ef0b0);logger[_0x1923('0x10')](_0x1923('0x1c'),_0x5ef0b0,JSON['stringify'](_0xbc0720));_0x5babf8(_0xbc0720);})['catch'](function(_0x119d79){logger[_0x1923('0x13')](_0x1923('0x1c'),_0x119d79[_0x1923('0x15')],_0x5ef0b0);_0x571dbb(_0x40763f[_0x1923('0x13')](0x1f4,_0x119d79[_0x1923('0x15')]));});});}; \ No newline at end of file +var _0xb9e0=['debug','request\x20sent','stringify','error','code','message','info','result','body','options','CreateVoiceDialReport','UpdateVoiceDialReport','VoiceDialReport','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','request','then','VoiceDialReport,\x20%s,\x20%s'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0xb9e0,0x6b));var _0x0b9e=function(_0x2508db,_0x4ee279){_0x2508db=_0x2508db-0x0;var _0x4a548c=_0xb9e0[_0x2508db];return _0x4a548c;};'use strict';var _=require(_0x0b9e('0x0'));var util=require(_0x0b9e('0x1'));var moment=require(_0x0b9e('0x2'));var BPromise=require(_0x0b9e('0x3'));var rs=require(_0x0b9e('0x4'));var fs=require('fs');var Redis=require(_0x0b9e('0x5'));var db=require(_0x0b9e('0x6'))['db'];var utils=require(_0x0b9e('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x0b9e('0x8'));var client=jayson['client'][_0x0b9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x38ea5a,_0xd7b412,_0x1745a0){return new BPromise(function(_0x31b5be,_0x2cda4f){return client[_0x0b9e('0xa')](_0x38ea5a,_0x1745a0)[_0x0b9e('0xb')](function(_0xa1cdc){logger['info'](_0x0b9e('0xc'),_0xd7b412,'request\x20sent');logger[_0x0b9e('0xd')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0xd7b412,_0x0b9e('0xe'),JSON[_0x0b9e('0xf')](_0xa1cdc));if(_0xa1cdc[_0x0b9e('0x10')]){if(_0xa1cdc[_0x0b9e('0x10')][_0x0b9e('0x11')]===0x1f4){logger[_0x0b9e('0x10')](_0x0b9e('0xc'),_0xd7b412,_0xa1cdc[_0x0b9e('0x10')]['message']);return _0x2cda4f(_0xa1cdc[_0x0b9e('0x10')][_0x0b9e('0x12')]);}logger[_0x0b9e('0x10')](_0x0b9e('0xc'),_0xd7b412,_0xa1cdc[_0x0b9e('0x10')]['message']);return _0x31b5be(_0xa1cdc[_0x0b9e('0x10')][_0x0b9e('0x12')]);}else{logger[_0x0b9e('0x13')](_0x0b9e('0xc'),_0xd7b412,_0x0b9e('0xe'));_0x31b5be(_0xa1cdc[_0x0b9e('0x14')][_0x0b9e('0x12')]);}})['catch'](function(_0x35a2ce){logger[_0x0b9e('0x10')](_0x0b9e('0xc'),_0xd7b412,_0x35a2ce);_0x2cda4f(_0x35a2ce);});});}exports['CreateVoiceDialReport']=function(_0x49c8ca){var _0xa434c9=this;return new Promise(function(_0x25d18f,_0x424633){return db['VoiceDialReport']['create'](_0x49c8ca[_0x0b9e('0x15')],{'raw':_0x49c8ca[_0x0b9e('0x16')]?_0x49c8ca[_0x0b9e('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x0b9e('0xb')](function(_0x3441aa){logger['info'](_0x0b9e('0x17'),_0x49c8ca);logger[_0x0b9e('0xd')](_0x0b9e('0x17'),_0x49c8ca,JSON['stringify'](_0x3441aa));_0x25d18f(_0x3441aa);})['catch'](function(_0x2f7263){logger['error'](_0x0b9e('0x17'),_0x2f7263[_0x0b9e('0x12')],_0x49c8ca);_0x424633(_0xa434c9['error'](0x1f4,_0x2f7263[_0x0b9e('0x12')]));});});};exports[_0x0b9e('0x18')]=function(_0x1b2865){var _0x1cdcc0=this;return new Promise(function(_0x4f85cc,_0x452092){return db[_0x0b9e('0x19')]['update'](_0x1b2865['body'],{'raw':_0x1b2865[_0x0b9e('0x16')]?_0x1b2865[_0x0b9e('0x16')][_0x0b9e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b2865[_0x0b9e('0x16')]?_0x1b2865[_0x0b9e('0x16')][_0x0b9e('0x1b')]||null:null,'attributes':_0x1b2865[_0x0b9e('0x16')]?_0x1b2865[_0x0b9e('0x16')][_0x0b9e('0x1c')]||null:null,'limit':_0x1b2865[_0x0b9e('0x16')]?_0x1b2865['options'][_0x0b9e('0x1d')]||null:null})[_0x0b9e('0xb')](function(_0x3017ab){logger[_0x0b9e('0x13')](_0x0b9e('0x18'),_0x1b2865);logger['debug'](_0x0b9e('0x18'),_0x1b2865,JSON[_0x0b9e('0xf')](_0x3017ab));_0x4f85cc(_0x3017ab);})['catch'](function(_0x579f25){logger[_0x0b9e('0x10')]('UpdateVoiceDialReport',_0x579f25[_0x0b9e('0x12')],_0x1b2865);_0x452092(_0x1cdcc0[_0x0b9e('0x10')](0x1f4,_0x579f25[_0x0b9e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index deca6ce..8462349 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 _0x2aa6=['/:id/applications','addApplications','put','/:id','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceExtension.controller','get','isAuthenticated','index','show','post','create'];(function(_0x1e6db3,_0x5643ac){var _0x1de886=function(_0x351318){while(--_0x351318){_0x1e6db3['push'](_0x1e6db3['shift']());}};_0x1de886(++_0x5643ac);}(_0x2aa6,0x1ac));var _0x62aa=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x2aa6[_0x1e4360];return _0x31e6b4;};'use strict';var multer=require('multer');var util=require(_0x62aa('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x62aa('0x1'));var router=express[_0x62aa('0x2')]();var fs_extra=require(_0x62aa('0x3'));var auth=require(_0x62aa('0x4'));var interaction=require(_0x62aa('0x5'));var config=require('../../config/environment');var controller=require(_0x62aa('0x6'));router[_0x62aa('0x7')]('/',auth[_0x62aa('0x8')](),controller[_0x62aa('0x9')]);router[_0x62aa('0x7')]('/:id',auth[_0x62aa('0x8')](),controller[_0x62aa('0xa')]);router[_0x62aa('0xb')]('/',auth[_0x62aa('0x8')](),controller[_0x62aa('0xc')]);router[_0x62aa('0xb')](_0x62aa('0xd'),auth[_0x62aa('0x8')](),controller[_0x62aa('0xe')]);router[_0x62aa('0xf')](_0x62aa('0x10'),auth[_0x62aa('0x8')](),controller[_0x62aa('0x11')]);router[_0x62aa('0x12')]('/:id',auth[_0x62aa('0x8')](),controller[_0x62aa('0x13')]);module[_0x62aa('0x14')]=router; \ No newline at end of file +var _0xf754=['Router','fs-extra','../../components/interaction/service','get','index','/:id','show','create','post','/:id/applications','isAuthenticated','addApplications','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x1d4e5b,_0x3d19e8){var _0x24764b=function(_0x57cda6){while(--_0x57cda6){_0x1d4e5b['push'](_0x1d4e5b['shift']());}};_0x24764b(++_0x3d19e8);}(_0xf754,0x122));var _0x4f75=function(_0x5009c6,_0x109ba0){_0x5009c6=_0x5009c6-0x0;var _0x477d43=_0xf754[_0x5009c6];return _0x477d43;};'use strict';var multer=require(_0x4f75('0x0'));var util=require(_0x4f75('0x1'));var path=require(_0x4f75('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f75('0x3'));var router=express[_0x4f75('0x4')]();var fs_extra=require(_0x4f75('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4f75('0x6'));var config=require('../../config/environment');var controller=require('./voiceExtension.controller');router[_0x4f75('0x7')]('/',auth['isAuthenticated'](),controller[_0x4f75('0x8')]);router[_0x4f75('0x7')](_0x4f75('0x9'),auth['isAuthenticated'](),controller[_0x4f75('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4f75('0xb')]);router[_0x4f75('0xc')](_0x4f75('0xd'),auth[_0x4f75('0xe')](),controller[_0x4f75('0xf')]);router[_0x4f75('0x10')](_0x4f75('0x9'),auth['isAuthenticated'](),controller[_0x4f75('0x11')]);router[_0x4f75('0x12')]('/:id',auth[_0x4f75('0xe')](),controller[_0x4f75('0x13')]);module[_0x4f75('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 095435a..d3b6c8b 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 _0xa86a=['wav','getDataValue','exten','sequelize','exports','compositeIndex','STRING','NoOp','ENUM','inbound','outbound','internal','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN'];(function(_0xf3e176,_0x1a1261){var _0xeb9ebd=function(_0x7e6080){while(--_0x7e6080){_0xf3e176['push'](_0xf3e176['shift']());}};_0xeb9ebd(++_0x1a1261);}(_0xa86a,0x18f));var _0xaa86=function(_0x57dafe,_0x41ee37){_0x57dafe=_0x57dafe-0x0;var _0x3b9d40=_0xa86a[_0x57dafe];return _0x3b9d40;};'use strict';var Sequelize=require(_0xaa86('0x0'));module[_0xaa86('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xaa86('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xaa86('0x3')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0xaa86('0x3')],'allowNull':![],'defaultValue':'1','unique':_0xaa86('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xaa86('0x3')],'allowNull':![],'defaultValue':_0xaa86('0x4')},'appdata':{'type':Sequelize[_0xaa86('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xaa86('0x5')](_0xaa86('0x6'),_0xaa86('0x7'),_0xaa86('0x8'),'inbound-fax',_0xaa86('0x9'),_0xaa86('0xa'),_0xaa86('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0xaa86('0x3')]},'interval':{'type':Sequelize[_0xaa86('0x3')],'allowNull':![],'defaultValue':_0xaa86('0xc')},'IntervalId':{'type':Sequelize[_0xaa86('0xd')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xaa86('0x3')],'defaultValue':null},'callerID':{'type':Sequelize[_0xaa86('0x3')],'allowNull':!![]},'record':{'type':Sequelize[_0xaa86('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xaa86('0xd')]},'recordingFormat':{'type':Sequelize[_0xaa86('0x3')],'defaultValue':_0xaa86('0xf')},'answer':{'type':Sequelize[_0xaa86('0xe')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xac2f35){return this[_0xaa86('0x10')](_0xaa86('0x11'));}},'alias':{'type':Sequelize[_0xaa86('0x3')],'allowNull':!![]}}; \ No newline at end of file +var _0x5eb4=['outbound','*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','exten','sequelize','exports','STRING','compositeIndex','ENUM','inbound'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5eb4,0x7e));var _0x45eb=function(_0x577d28,_0x52d364){_0x577d28=_0x577d28-0x0;var _0x4d02df=_0x5eb4[_0x577d28];return _0x4d02df;};'use strict';var Sequelize=require(_0x45eb('0x0'));module[_0x45eb('0x1')]={'context':{'type':Sequelize[_0x45eb('0x2')],'allowNull':![],'unique':_0x45eb('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x45eb('0x3')},'priority':{'type':Sequelize[_0x45eb('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x45eb('0x3')},'tag':{'type':Sequelize[_0x45eb('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x45eb('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0x45eb('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x45eb('0x4')](_0x45eb('0x5'),_0x45eb('0x6'),'internal','inbound-fax','outbound-fax','system','any'),'allowNull':![]},'description':{'type':Sequelize[_0x45eb('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x45eb('0x7')},'IntervalId':{'type':Sequelize[_0x45eb('0x8')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x45eb('0x9')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x45eb('0x8')]},'recordingFormat':{'type':Sequelize[_0x45eb('0x2')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x45eb('0x9')],'defaultValue':!![]},'name':{'type':Sequelize[_0x45eb('0xa')],'get':function(_0x10130d){return this['getDataValue'](_0x45eb('0xb'));}},'alias':{'type':Sequelize[_0x45eb('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index e0cceef..b9fba1b 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 _0x995d=['createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','end','status','json','offset','limit','undefined','count','set','Content-Range','destroy','then','get','InboundRoutes','inbound','outbound','internal','filter','value','includes','type','find','name','UserProfileResource','sendStatus','error','stack','send','index','VoiceExtension','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','merge','options','includeAll','rows','length','include','catch','create','body','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OutboundRoutes','InternalRoutes','UserProfileSection','userProfileId','update','params','pick','context','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','Transaction','ISOLATION_LEVELS','VoiceExtensionId','isApp'];(function(_0x44fb65,_0x150d4d){var _0x3e8fe1=function(_0x47012e){while(--_0x47012e){_0x44fb65['push'](_0x44fb65['shift']());}};_0x3e8fe1(++_0x150d4d);}(_0x995d,0x1d1));var _0xd995=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x995d[_0x22f8ab];return _0x2a70e5;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0xd995('0x0'));var logger=require(_0xd995('0x1'))(_0xd995('0x2'));var config=require(_0xd995('0x3'));var db=require(_0xd995('0x4'))['db'];config['redis']=_[_0xd995('0x5')](config[_0xd995('0x6')],{'host':_0xd995('0x7'),'port':0x18eb});var socket=require(_0xd995('0x8'))(new Redis(config[_0xd995('0x6')]));require(_0xd995('0x9'))[_0xd995('0xa')](socket);function respondWithStatusCode(_0x465314,_0x4fcba6){_0x4fcba6=_0x4fcba6||0xcc;return function(_0x1beb87){if(_0x1beb87){return _0x465314['sendStatus'](_0x4fcba6);}return _0x465314['status'](_0x4fcba6)[_0xd995('0xb')]();};}function respondWithResult(_0x3b294d,_0x380c20){_0x380c20=_0x380c20||0xc8;return function(_0x51a90a){if(_0x51a90a){return _0x3b294d[_0xd995('0xc')](_0x380c20)[_0xd995('0xd')](_0x51a90a);}};}function respondWithFilteredResult(_0x56a8c9,_0x334b1a){return function(_0x4b6280){if(_0x4b6280){var _0x532c00=typeof _0x334b1a[_0xd995('0xe')]==='undefined'&&typeof _0x334b1a[_0xd995('0xf')]===_0xd995('0x10');var _0x418a92=_0x4b6280[_0xd995('0x11')];var _0x10426a=_0x532c00?0x0:_0x334b1a['offset'];var _0x58a988=_0x532c00?_0x4b6280[_0xd995('0x11')]:_0x334b1a[_0xd995('0xe')]+_0x334b1a[_0xd995('0xf')];var _0x4575f0;if(_0x58a988>=_0x418a92){_0x58a988=_0x418a92;_0x4575f0=0xc8;}else{_0x4575f0=0xce;}_0x56a8c9[_0xd995('0xc')](_0x4575f0);return _0x56a8c9[_0xd995('0x12')](_0xd995('0x13'),_0x10426a+'-'+_0x58a988+'/'+_0x418a92)[_0xd995('0xd')](_0x4b6280);}return null;};}function removeEntity(_0x32f3ff){return function(_0x844d7d){if(_0x844d7d){return _0x844d7d[_0xd995('0x14')]()[_0xd995('0x15')](function(){var _0x22b1a6=_0x844d7d[_0xd995('0x16')]({'plain':!![]});var _0x4d11de=[{'name':_0xd995('0x17'),'value':_0xd995('0x18'),'ignore':![]},{'name':'OutboundRoutes','value':_0xd995('0x19'),'ignore':![]},{'name':'InternalRoutes','value':_0xd995('0x1a'),'ignore':![]}];var _0x5b4770=_(_0x4d11de)[_0xd995('0x1b')]('ignore')['map'](_0xd995('0x1c'))[_0xd995('0x1c')]();if(_[_0xd995('0x1d')](_0x5b4770,_0x22b1a6[_0xd995('0x1e')])){return;}var _0x4d5b90=_[_0xd995('0x1f')](_0x4d11de,[_0xd995('0x1c'),_0x22b1a6[_0xd995('0x1e')]])[_0xd995('0x20')];return db[_0xd995('0x21')]['destroy']({'where':{'type':_0x4d5b90,'resourceId':_0x22b1a6['id']}})[_0xd995('0x15')](function(){return _0x844d7d;});})[_0xd995('0x15')](function(){_0x32f3ff['status'](0xcc)[_0xd995('0xb')]();});}};}function handleEntityNotFound(_0x87f060){return function(_0x5ada5c){if(!_0x5ada5c){_0x87f060[_0xd995('0x22')](0x194);}return _0x5ada5c;};}function handleError(_0x51906b,_0x51d731){_0x51d731=_0x51d731||0x1f4;return function(_0xe076c0){logger[_0xd995('0x23')](_0xe076c0[_0xd995('0x24')]);if(_0xe076c0[_0xd995('0x20')]){delete _0xe076c0['name'];}_0x51906b['status'](_0x51d731)[_0xd995('0x25')](_0xe076c0);};}exports[_0xd995('0x26')]=function(_0x2818d0,_0x1f0acd){var _0x1221c7={},_0x254f3f={},_0x20ca48={'count':0x0,'rows':[]};var _0x3da695=_['map'](db[_0xd995('0x27')][_0xd995('0x28')],function(_0x2c13d5){return{'name':_0x2c13d5[_0xd995('0x29')],'type':_0x2c13d5[_0xd995('0x1e')][_0xd995('0x2a')]};});_0x254f3f[_0xd995('0x2b')]=_[_0xd995('0x2c')](_0x3da695,'name');_0x254f3f[_0xd995('0x2d')]=_[_0xd995('0x2e')](_0x2818d0[_0xd995('0x2d')]);_0x254f3f[_0xd995('0x2f')]=_[_0xd995('0x30')](_0x254f3f[_0xd995('0x2b')],_0x254f3f[_0xd995('0x2d')]);_0x1221c7[_0xd995('0x31')]=_['intersection'](_0x254f3f['model'],qs[_0xd995('0x32')](_0x2818d0[_0xd995('0x2d')][_0xd995('0x32')]));_0x1221c7[_0xd995('0x31')]=_0x1221c7['attributes']['length']?_0x1221c7[_0xd995('0x31')]:_0x254f3f[_0xd995('0x2b')];if(!_0x2818d0[_0xd995('0x2d')]['hasOwnProperty'](_0xd995('0x33'))){_0x1221c7[_0xd995('0xf')]=qs['limit'](_0x2818d0[_0xd995('0x2d')][_0xd995('0xf')]);_0x1221c7[_0xd995('0xe')]=qs[_0xd995('0xe')](_0x2818d0[_0xd995('0x2d')]['offset']);}_0x1221c7[_0xd995('0x34')]=qs['sort'](_0x2818d0[_0xd995('0x2d')][_0xd995('0x35')]);_0x1221c7[_0xd995('0x36')]=qs[_0xd995('0x2f')](_['pick'](_0x2818d0[_0xd995('0x2d')],_0x254f3f[_0xd995('0x2f')]),_0x3da695);if(_0x2818d0['query'][_0xd995('0x1b')]){_0x1221c7['where']=_[_0xd995('0x37')](_0x1221c7[_0xd995('0x36')],{'$or':_[_0xd995('0x2c')](_0x3da695,function(_0x33ac6b){if(_0x33ac6b[_0xd995('0x1e')]!=='VIRTUAL'){var _0x3255c6={};_0x3255c6[_0x33ac6b[_0xd995('0x20')]]={'$like':'%'+_0x2818d0[_0xd995('0x2d')][_0xd995('0x1b')]+'%'};return _0x3255c6;}})});}_0x1221c7=_[_0xd995('0x37')]({},_0x1221c7,_0x2818d0[_0xd995('0x38')]);var _0x552172={'where':_0x1221c7[_0xd995('0x36')]};return db[_0xd995('0x27')][_0xd995('0x11')](_0x552172)[_0xd995('0x15')](function(_0x3a2333){_0x20ca48[_0xd995('0x11')]=_0x3a2333;if(_0x2818d0['query'][_0xd995('0x39')]){_0x1221c7['include']=[{'all':!![]}];}return db[_0xd995('0x27')]['findAll'](_0x1221c7);})[_0xd995('0x15')](function(_0x87d492){_0x20ca48[_0xd995('0x3a')]=_0x87d492;return _0x20ca48;})[_0xd995('0x15')](respondWithFilteredResult(_0x1f0acd,_0x1221c7))['catch'](handleError(_0x1f0acd,null));};exports['show']=function(_0x5a1cd2,_0x19c9ba){var _0x6e6288={'raw':![],'where':{'id':_0x5a1cd2['params']['id']}},_0x1fb17={};_0x1fb17['model']=_[_0xd995('0x2e')](db[_0xd995('0x27')]['rawAttributes']);_0x1fb17[_0xd995('0x2d')]=_[_0xd995('0x2e')](_0x5a1cd2['query']);_0x1fb17[_0xd995('0x2f')]=_[_0xd995('0x30')](_0x1fb17[_0xd995('0x2b')],_0x1fb17['query']);_0x6e6288['attributes']=_['intersection'](_0x1fb17[_0xd995('0x2b')],qs[_0xd995('0x32')](_0x5a1cd2[_0xd995('0x2d')]['fields']));_0x6e6288[_0xd995('0x31')]=_0x6e6288['attributes'][_0xd995('0x3b')]?_0x6e6288['attributes']:_0x1fb17[_0xd995('0x2b')];if(_0x5a1cd2[_0xd995('0x2d')][_0xd995('0x39')]){_0x6e6288[_0xd995('0x3c')]=[{'all':!![]}];}_0x6e6288=_[_0xd995('0x37')]({},_0x6e6288,_0x5a1cd2[_0xd995('0x38')]);return db[_0xd995('0x27')][_0xd995('0x1f')](_0x6e6288)[_0xd995('0x15')](handleEntityNotFound(_0x19c9ba,null))[_0xd995('0x15')](respondWithResult(_0x19c9ba,null))['catch'](handleError(_0x19c9ba,null));};exports[_0xd995('0x14')]=function(_0x17b81a,_0x755d71){return db[_0xd995('0x27')][_0xd995('0x1f')]({'where':{'id':_0x17b81a['params']['id']}})['then'](handleEntityNotFound(_0x755d71,null))[_0xd995('0x15')](removeEntity(_0x755d71,null))[_0xd995('0x3d')](handleError(_0x755d71,null));};exports[_0xd995('0x3e')]=function(_0x18ca69,_0x58aec2){if(_0x18ca69[_0xd995('0x3f')]['type']===_0xd995('0x19')&&!_['startsWith'](_0x18ca69[_0xd995('0x3f')][_0xd995('0x40')],'_')){_0x18ca69[_0xd995('0x3f')]['exten']='_'[_0xd995('0x41')](_0x18ca69[_0xd995('0x3f')][_0xd995('0x40')]);}return db[_0xd995('0x27')][_0xd995('0x3e')](_0x18ca69['body'],{'raw':![]})[_0xd995('0x15')](function(_0x221d34){var _0x101bfb=_0x18ca69[_0xd995('0x42')][_0xd995('0x16')]({'plain':!![]});if(!_0x101bfb)throw new Error(_0xd995('0x43'));if(_0x101bfb[_0xd995('0x44')]===_0xd995('0x42')){var _0x24a80a=_0x221d34[_0xd995('0x16')]({'plain':!![]});var _0x1bfd3c=[{'name':_0xd995('0x17'),'value':_0xd995('0x18')},{'name':_0xd995('0x45'),'value':_0xd995('0x19')},{'name':_0xd995('0x46'),'value':_0xd995('0x1a')}];var _0x55829f=_[_0xd995('0x1f')](_0x1bfd3c,[_0xd995('0x1c'),_0x24a80a[_0xd995('0x1e')]])['name'];return db[_0xd995('0x47')]['find']({'where':{'name':_0x55829f,'userProfileId':_0x101bfb[_0xd995('0x48')]},'raw':!![]})['then'](function(_0x3f3f56){if(_0x3f3f56&&_0x3f3f56['autoAssociation']===0x0){return db[_0xd995('0x21')][_0xd995('0x3e')]({'name':_0x24a80a[_0xd995('0x20')],'resourceId':_0x24a80a['id'],'type':_0x3f3f56[_0xd995('0x20')],'sectionId':_0x3f3f56['id']},{})[_0xd995('0x15')](function(){return _0x221d34;});}else{return _0x221d34;}})[_0xd995('0x3d')](function(_0x4cca91){logger[_0xd995('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4cca91);throw _0x4cca91;});}return _0x221d34;})[_0xd995('0x15')](respondWithResult(_0x58aec2,0xc9))[_0xd995('0x3d')](handleError(_0x58aec2,null));};exports[_0xd995('0x49')]=function(_0x3c0093,_0x3f5e5a){if(_0x3c0093[_0xd995('0x3f')]['id']){delete _0x3c0093[_0xd995('0x3f')]['id'];}return db['VoiceExtension']['find']({'where':{'id':_0x3c0093[_0xd995('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3f5e5a,null))[_0xd995('0x15')](function(_0x1f6f27){if(_0x1f6f27){return db[_0xd995('0x27')][_0xd995('0x49')](_[_0xd995('0x4b')](_0x3c0093['body'],[_0xd995('0x40'),_0xd995('0x4c'),'description',_0xd995('0x4d'),_0xd995('0x4e'),_0xd995('0x4f'),_0xd995('0x50')]),{'where':{'context':_0x1f6f27[_0xd995('0x4c')],'exten':_0x1f6f27[_0xd995('0x40')]},'individualHooks':!![]})[_0xd995('0x15')](function(_0x31f97c){return _0x31f97c;});}return null;})[_0xd995('0x15')](respondWithStatusCode(_0x3f5e5a,null))['catch'](handleError(_0x3f5e5a,null));};exports[_0xd995('0x51')]=function(_0x195a6f,_0x4b373e){var _0x198eb3=_0x195a6f[_0xd995('0x4a')]['id'];var _0x10613f=_0x195a6f[_0xd995('0x3f')];var _0xbaad0c=0xc8;var _0x26108d=null;return db['sequelize']['transaction']({'isolationLevel':db[_0xd995('0x52')][_0xd995('0x53')][_0xd995('0x54')]['READ_COMMITTED']},function(_0x3fcb5a){return db[_0xd995('0x27')]['findOne']({'where':{'id':_0x198eb3},'transaction':_0x3fcb5a})[_0xd995('0x15')](function(_0x202ec5){if(_0x202ec5){return db[_0xd995('0x27')][_0xd995('0x14')]({'where':{'VoiceExtensionId':_0x198eb3},'transaction':_0x3fcb5a})['then'](function(){var _0x347460=_[_0xd995('0x2c')](_0x10613f,function(_0x2b0615){_0x2b0615[_0xd995('0x55')]=_0x198eb3;_0x2b0615[_0xd995('0x56')]=!![];return _0x2b0615;});return _0x202ec5[_0xd995('0x57')](_0x347460);})[_0xd995('0x15')](function(_0x473bb6){return db[_0xd995('0x27')][_0xd995('0x58')](_0x473bb6,{'transaction':_0x3fcb5a});});}else{_0xbaad0c=0x194;_0x26108d=[];}});})[_0xd995('0x15')](function(){if(_0xbaad0c!==0x194){return db[_0xd995('0x27')][_0xd995('0x59')]({'where':{'isApp':!![],'VoiceExtensionId':_0x198eb3},'order':_0xd995('0x5a')})[_0xd995('0x15')](function(_0xbf6370){_0x26108d=_0xbf6370;});}})[_0xd995('0x3d')](function(_0x36cee4){_0xbaad0c=0x1f4;logger[_0xd995('0x23')](_0x36cee4[_0xd995('0x24')]);if(_0x36cee4[_0xd995('0x20')]){delete _0x36cee4[_0xd995('0x20')];}_0x26108d=_0x36cee4;})[_0xd995('0x5b')](function(){if(_0x26108d===null){_0x4b373e['sendStatus'](_0xbaad0c);}else{if(_0xbaad0c===0x1f4){_0x4b373e[_0xd995('0xc')](_0xbaad0c)[_0xd995('0x25')](_0x26108d);}else{_0x4b373e['status'](_0xbaad0c)[_0xd995('0xd')](_0x26108d);}}});}; \ No newline at end of file +var _0xb137=['map','value','type','find','name','UserProfileResource','end','error','stack','index','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','VoiceExtension','includeAll','include','findAll','rows','catch','params','rawAttributes','destroy','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','mandatoryDisposition','alias','addApplications','transaction','Transaction','READ_COMMITTED','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore'];(function(_0x141587,_0x30cb09){var _0x456d12=function(_0x3bb241){while(--_0x3bb241){_0x141587['push'](_0x141587['shift']());}};_0x456d12(++_0x30cb09);}(_0xb137,0x15a));var _0x7b13=function(_0x320b8e,_0x1da3fe){_0x320b8e=_0x320b8e-0x0;var _0x55a10a=_0xb137[_0x320b8e];return _0x55a10a;};'use strict';var _=require(_0x7b13('0x0'));var Redis=require(_0x7b13('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x7b13('0x2'))(_0x7b13('0x3'));var config=require(_0x7b13('0x4'));var db=require(_0x7b13('0x5'))['db'];config[_0x7b13('0x6')]=_['defaults'](config['redis'],{'host':_0x7b13('0x7'),'port':0x18eb});var socket=require(_0x7b13('0x8'))(new Redis(config[_0x7b13('0x6')]));require(_0x7b13('0x9'))[_0x7b13('0xa')](socket);function respondWithStatusCode(_0x32f0f7,_0x450cb0){_0x450cb0=_0x450cb0||0xcc;return function(_0x3f9e4a){if(_0x3f9e4a){return _0x32f0f7[_0x7b13('0xb')](_0x450cb0);}return _0x32f0f7[_0x7b13('0xc')](_0x450cb0)['end']();};}function respondWithResult(_0x3b9908,_0x54aebe){_0x54aebe=_0x54aebe||0xc8;return function(_0x4f63af){if(_0x4f63af){return _0x3b9908[_0x7b13('0xc')](_0x54aebe)[_0x7b13('0xd')](_0x4f63af);}};}function respondWithFilteredResult(_0x25cec2,_0x234842){return function(_0x2e1cdf){if(_0x2e1cdf){var _0x3c3aba=typeof _0x234842['offset']===_0x7b13('0xe')&&typeof _0x234842[_0x7b13('0xf')]==='undefined';var _0x445822=_0x2e1cdf['count'];var _0x9050a9=_0x3c3aba?0x0:_0x234842['offset'];var _0x4a70a4=_0x3c3aba?_0x2e1cdf[_0x7b13('0x10')]:_0x234842[_0x7b13('0x11')]+_0x234842[_0x7b13('0xf')];var _0x1c0adc;if(_0x4a70a4>=_0x445822){_0x4a70a4=_0x445822;_0x1c0adc=0xc8;}else{_0x1c0adc=0xce;}_0x25cec2['status'](_0x1c0adc);return _0x25cec2[_0x7b13('0x12')](_0x7b13('0x13'),_0x9050a9+'-'+_0x4a70a4+'/'+_0x445822)[_0x7b13('0xd')](_0x2e1cdf);}return null;};}function removeEntity(_0x381fa3){return function(_0x38c6ab){if(_0x38c6ab){return _0x38c6ab['destroy']()[_0x7b13('0x14')](function(){var _0x46c44c=_0x38c6ab[_0x7b13('0x15')]({'plain':!![]});var _0x2f3a83=[{'name':_0x7b13('0x16'),'value':_0x7b13('0x17'),'ignore':![]},{'name':_0x7b13('0x18'),'value':_0x7b13('0x19'),'ignore':![]},{'name':_0x7b13('0x1a'),'value':_0x7b13('0x1b'),'ignore':![]}];var _0x1ac8a1=_(_0x2f3a83)[_0x7b13('0x1c')](_0x7b13('0x1d'))[_0x7b13('0x1e')](_0x7b13('0x1f'))[_0x7b13('0x1f')]();if(_['includes'](_0x1ac8a1,_0x46c44c[_0x7b13('0x20')])){return;}var _0xa16972=_[_0x7b13('0x21')](_0x2f3a83,[_0x7b13('0x1f'),_0x46c44c[_0x7b13('0x20')]])[_0x7b13('0x22')];return db[_0x7b13('0x23')]['destroy']({'where':{'type':_0xa16972,'resourceId':_0x46c44c['id']}})[_0x7b13('0x14')](function(){return _0x38c6ab;});})[_0x7b13('0x14')](function(){_0x381fa3[_0x7b13('0xc')](0xcc)[_0x7b13('0x24')]();});}};}function handleEntityNotFound(_0x1707e7){return function(_0x24475e){if(!_0x24475e){_0x1707e7[_0x7b13('0xb')](0x194);}return _0x24475e;};}function handleError(_0x433175,_0x44a15d){_0x44a15d=_0x44a15d||0x1f4;return function(_0x100285){logger[_0x7b13('0x25')](_0x100285[_0x7b13('0x26')]);if(_0x100285[_0x7b13('0x22')]){delete _0x100285[_0x7b13('0x22')];}_0x433175[_0x7b13('0xc')](_0x44a15d)['send'](_0x100285);};}exports[_0x7b13('0x27')]=function(_0x451822,_0x4bea67){var _0x60fff7={},_0x2e1878={},_0x261d11={'count':0x0,'rows':[]};var _0x1d8bfd=_['map'](db['VoiceExtension']['rawAttributes'],function(_0x3343bc){return{'name':_0x3343bc[_0x7b13('0x28')],'type':_0x3343bc[_0x7b13('0x20')][_0x7b13('0x29')]};});_0x2e1878[_0x7b13('0x2a')]=_['map'](_0x1d8bfd,'name');_0x2e1878[_0x7b13('0x2b')]=_[_0x7b13('0x2c')](_0x451822[_0x7b13('0x2b')]);_0x2e1878[_0x7b13('0x2d')]=_[_0x7b13('0x2e')](_0x2e1878[_0x7b13('0x2a')],_0x2e1878[_0x7b13('0x2b')]);_0x60fff7[_0x7b13('0x2f')]=_[_0x7b13('0x2e')](_0x2e1878[_0x7b13('0x2a')],qs[_0x7b13('0x30')](_0x451822['query'][_0x7b13('0x30')]));_0x60fff7[_0x7b13('0x2f')]=_0x60fff7[_0x7b13('0x2f')][_0x7b13('0x31')]?_0x60fff7[_0x7b13('0x2f')]:_0x2e1878['model'];if(!_0x451822[_0x7b13('0x2b')]['hasOwnProperty'](_0x7b13('0x32'))){_0x60fff7[_0x7b13('0xf')]=qs['limit'](_0x451822[_0x7b13('0x2b')][_0x7b13('0xf')]);_0x60fff7[_0x7b13('0x11')]=qs[_0x7b13('0x11')](_0x451822['query'][_0x7b13('0x11')]);}_0x60fff7[_0x7b13('0x33')]=qs['sort'](_0x451822['query'][_0x7b13('0x34')]);_0x60fff7[_0x7b13('0x35')]=qs['filters'](_[_0x7b13('0x36')](_0x451822['query'],_0x2e1878[_0x7b13('0x2d')]),_0x1d8bfd);if(_0x451822[_0x7b13('0x2b')][_0x7b13('0x1c')]){_0x60fff7[_0x7b13('0x35')]=_[_0x7b13('0x37')](_0x60fff7[_0x7b13('0x35')],{'$or':_['map'](_0x1d8bfd,function(_0x3faa5c){if(_0x3faa5c['type']!==_0x7b13('0x38')){var _0xbb27c7={};_0xbb27c7[_0x3faa5c['name']]={'$like':'%'+_0x451822[_0x7b13('0x2b')][_0x7b13('0x1c')]+'%'};return _0xbb27c7;}})});}_0x60fff7=_[_0x7b13('0x37')]({},_0x60fff7,_0x451822[_0x7b13('0x39')]);var _0x18ae5c={'where':_0x60fff7['where']};return db[_0x7b13('0x3a')]['count'](_0x18ae5c)[_0x7b13('0x14')](function(_0x5cd15d){_0x261d11[_0x7b13('0x10')]=_0x5cd15d;if(_0x451822['query'][_0x7b13('0x3b')]){_0x60fff7[_0x7b13('0x3c')]=[{'all':!![]}];}return db[_0x7b13('0x3a')][_0x7b13('0x3d')](_0x60fff7);})[_0x7b13('0x14')](function(_0x3aa1a7){_0x261d11[_0x7b13('0x3e')]=_0x3aa1a7;return _0x261d11;})['then'](respondWithFilteredResult(_0x4bea67,_0x60fff7))[_0x7b13('0x3f')](handleError(_0x4bea67,null));};exports['show']=function(_0xb6dbfb,_0x15a328){var _0x5a41ab={'raw':![],'where':{'id':_0xb6dbfb[_0x7b13('0x40')]['id']}},_0x460a5a={};_0x460a5a['model']=_[_0x7b13('0x2c')](db[_0x7b13('0x3a')][_0x7b13('0x41')]);_0x460a5a[_0x7b13('0x2b')]=_['keys'](_0xb6dbfb['query']);_0x460a5a[_0x7b13('0x2d')]=_[_0x7b13('0x2e')](_0x460a5a[_0x7b13('0x2a')],_0x460a5a[_0x7b13('0x2b')]);_0x5a41ab[_0x7b13('0x2f')]=_['intersection'](_0x460a5a[_0x7b13('0x2a')],qs['fields'](_0xb6dbfb['query'][_0x7b13('0x30')]));_0x5a41ab[_0x7b13('0x2f')]=_0x5a41ab[_0x7b13('0x2f')][_0x7b13('0x31')]?_0x5a41ab[_0x7b13('0x2f')]:_0x460a5a[_0x7b13('0x2a')];if(_0xb6dbfb['query'][_0x7b13('0x3b')]){_0x5a41ab['include']=[{'all':!![]}];}_0x5a41ab=_['merge']({},_0x5a41ab,_0xb6dbfb['options']);return db[_0x7b13('0x3a')][_0x7b13('0x21')](_0x5a41ab)[_0x7b13('0x14')](handleEntityNotFound(_0x15a328,null))[_0x7b13('0x14')](respondWithResult(_0x15a328,null))[_0x7b13('0x3f')](handleError(_0x15a328,null));};exports[_0x7b13('0x42')]=function(_0x39ab65,_0x3ce0ed){return db[_0x7b13('0x3a')][_0x7b13('0x21')]({'where':{'id':_0x39ab65[_0x7b13('0x40')]['id']}})[_0x7b13('0x14')](handleEntityNotFound(_0x3ce0ed,null))['then'](removeEntity(_0x3ce0ed,null))['catch'](handleError(_0x3ce0ed,null));};exports[_0x7b13('0x43')]=function(_0x4c4487,_0x57e467){if(_0x4c4487[_0x7b13('0x44')][_0x7b13('0x20')]===_0x7b13('0x19')&&!_[_0x7b13('0x45')](_0x4c4487['body'][_0x7b13('0x46')],'_')){_0x4c4487['body'][_0x7b13('0x46')]='_'[_0x7b13('0x47')](_0x4c4487['body'][_0x7b13('0x46')]);}return db[_0x7b13('0x3a')][_0x7b13('0x43')](_0x4c4487[_0x7b13('0x44')],{'raw':![]})[_0x7b13('0x14')](function(_0x547bd8){var _0x326cc9=_0x4c4487[_0x7b13('0x48')]['get']({'plain':!![]});if(!_0x326cc9)throw new Error(_0x7b13('0x49'));if(_0x326cc9[_0x7b13('0x4a')]===_0x7b13('0x48')){var _0x447623=_0x547bd8['get']({'plain':!![]});var _0x168d2a=[{'name':_0x7b13('0x16'),'value':_0x7b13('0x17')},{'name':_0x7b13('0x18'),'value':'outbound'},{'name':_0x7b13('0x1a'),'value':_0x7b13('0x1b')}];var _0x7b3f02=_['find'](_0x168d2a,[_0x7b13('0x1f'),_0x447623[_0x7b13('0x20')]])[_0x7b13('0x22')];return db['UserProfileSection'][_0x7b13('0x21')]({'where':{'name':_0x7b3f02,'userProfileId':_0x326cc9[_0x7b13('0x4b')]},'raw':!![]})[_0x7b13('0x14')](function(_0x36af06){if(_0x36af06&&_0x36af06[_0x7b13('0x4c')]===0x0){return db[_0x7b13('0x23')][_0x7b13('0x43')]({'name':_0x447623[_0x7b13('0x22')],'resourceId':_0x447623['id'],'type':_0x36af06[_0x7b13('0x22')],'sectionId':_0x36af06['id']},{})['then'](function(){return _0x547bd8;});}else{return _0x547bd8;}})[_0x7b13('0x3f')](function(_0x2f6460){logger['error'](_0x7b13('0x4d'),_0x2f6460);throw _0x2f6460;});}return _0x547bd8;})[_0x7b13('0x14')](respondWithResult(_0x57e467,0xc9))[_0x7b13('0x3f')](handleError(_0x57e467,null));};exports['update']=function(_0x1f5756,_0x40dc88){if(_0x1f5756[_0x7b13('0x44')]['id']){delete _0x1f5756['body']['id'];}return db[_0x7b13('0x3a')][_0x7b13('0x21')]({'where':{'id':_0x1f5756[_0x7b13('0x40')]['id']}})['then'](handleEntityNotFound(_0x40dc88,null))[_0x7b13('0x14')](function(_0x4fdeee){if(_0x4fdeee){return db[_0x7b13('0x3a')][_0x7b13('0x4e')](_[_0x7b13('0x36')](_0x1f5756[_0x7b13('0x44')],[_0x7b13('0x46'),_0x7b13('0x4f'),_0x7b13('0x50'),'recordingFormat','cutdigits',_0x7b13('0x51'),_0x7b13('0x52')]),{'where':{'context':_0x4fdeee[_0x7b13('0x4f')],'exten':_0x4fdeee['exten']},'individualHooks':!![]})[_0x7b13('0x14')](function(_0x542960){return _0x542960;});}return null;})[_0x7b13('0x14')](respondWithStatusCode(_0x40dc88,null))[_0x7b13('0x3f')](handleError(_0x40dc88,null));};exports[_0x7b13('0x53')]=function(_0xab884c,_0x2468ec){var _0x49e7f2=_0xab884c['params']['id'];var _0x1afe42=_0xab884c['body'];var _0x310184=0xc8;var _0x5843f8=null;return db['sequelize'][_0x7b13('0x54')]({'isolationLevel':db['sequelize'][_0x7b13('0x55')]['ISOLATION_LEVELS'][_0x7b13('0x56')]},function(_0x3384f1){return db['VoiceExtension']['findOne']({'where':{'id':_0x49e7f2},'transaction':_0x3384f1})[_0x7b13('0x14')](function(_0x1a0a84){if(_0x1a0a84){return db[_0x7b13('0x3a')]['destroy']({'where':{'VoiceExtensionId':_0x49e7f2},'transaction':_0x3384f1})[_0x7b13('0x14')](function(){var _0x5cfd67=_[_0x7b13('0x1e')](_0x1afe42,function(_0x1a8055){_0x1a8055[_0x7b13('0x57')]=_0x49e7f2;_0x1a8055[_0x7b13('0x58')]=!![];return _0x1a8055;});return _0x1a0a84[_0x7b13('0x59')](_0x5cfd67);})['then'](function(_0x3b3551){return db[_0x7b13('0x3a')][_0x7b13('0x5a')](_0x3b3551,{'transaction':_0x3384f1});});}else{_0x310184=0x194;_0x5843f8=[];}});})[_0x7b13('0x14')](function(){if(_0x310184!==0x194){return db[_0x7b13('0x3a')][_0x7b13('0x5b')]({'where':{'isApp':!![],'VoiceExtensionId':_0x49e7f2},'order':_0x7b13('0x5c')})[_0x7b13('0x14')](function(_0x5c8e06){_0x5843f8=_0x5c8e06;});}})[_0x7b13('0x3f')](function(_0x5e7442){_0x310184=0x1f4;logger['error'](_0x5e7442[_0x7b13('0x26')]);if(_0x5e7442[_0x7b13('0x22')]){delete _0x5e7442[_0x7b13('0x22')];}_0x5843f8=_0x5e7442;})[_0x7b13('0x5d')](function(){if(_0x5843f8===null){_0x2468ec['sendStatus'](_0x310184);}else{if(_0x310184===0x1f4){_0x2468ec[_0x7b13('0xc')](_0x310184)['send'](_0x5843f8);}else{_0x2468ec['status'](_0x310184)[_0x7b13('0xd')](_0x5843f8);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index de8d2b1..7fa34e2 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 _0x86f9=['exports','../../mysqldb','VoiceExtension','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x1c1dbb,_0x3e950d){var _0x33363e=function(_0x19395e){while(--_0x19395e){_0x1c1dbb['push'](_0x1c1dbb['shift']());}};_0x33363e(++_0x3e950d);}(_0x86f9,0xc7));var _0x986f=function(_0x3d5df9,_0x5b3623){_0x3d5df9=_0x3d5df9-0x0;var _0x50ba39=_0x86f9[_0x3d5df9];return _0x50ba39;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x986f('0x0'))['db'][_0x986f('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x986f('0x2'),'afterUpdate':_0x986f('0x3'),'afterDestroy':_0x986f('0x4')};function emitEvent(_0x3ce05b){return function(_0x2374a0,_0x191a9a,_0x579fbb){VoiceExtensionEvents[_0x986f('0x5')](_0x3ce05b+':'+_0x2374a0['id'],_0x2374a0);VoiceExtensionEvents[_0x986f('0x5')](_0x3ce05b,_0x2374a0);_0x579fbb(null);};}for(var e in events){if(events[_0x986f('0x6')](e)){var event=events[e];VoiceExtension[_0x986f('0x7')](e,emitEvent(event));}}module[_0x986f('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0xc136=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','emit'];(function(_0x4f9646,_0x75327b){var _0x596579=function(_0x5666dc){while(--_0x5666dc){_0x4f9646['push'](_0x4f9646['shift']());}};_0x596579(++_0x75327b);}(_0xc136,0xbe));var _0x6c13=function(_0x22a14e,_0xa5496d){_0x22a14e=_0x22a14e-0x0;var _0x8f4d48=_0xc136[_0x22a14e];return _0x8f4d48;};'use strict';var EventEmitter=require(_0x6c13('0x0'));var VoiceExtension=require(_0x6c13('0x1'))['db'][_0x6c13('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x6c13('0x3')](0x0);var events={'afterCreate':_0x6c13('0x4'),'afterUpdate':_0x6c13('0x5'),'afterDestroy':_0x6c13('0x6')};function emitEvent(_0x23711d){return function(_0x7b5d98,_0x598efb,_0x2ac37d){VoiceExtensionEvents[_0x6c13('0x7')](_0x23711d+':'+_0x7b5d98['id'],_0x7b5d98);VoiceExtensionEvents['emit'](_0x23711d,_0x7b5d98);_0x2ac37d(null);};}for(var e in events){if(events[_0x6c13('0x8')](e)){var event=events[e];VoiceExtension[_0x6c13('0x9')](e,emitEvent(event));}}module[_0x6c13('0xa')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 5fafe69..02e1473 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 _0x0e6a=[',${EXTEN},','outboundDial','appdata','priority','last','concat','catch','define','voice_extensions','get','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','alias','NoOp','CDR(routeAlias)=','context','exten','inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','No\x20alias\x20set','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','length','name','param','prefix','phone','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','filter','tag','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','queue','playback','includes','app','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x0e6a,0x100));var _0xa0e6=function(_0x199394,_0x3d0297){_0x199394=_0x199394-0x0;var _0x61e770=_0x0e6a[_0x199394];return _0x61e770;};'use strict';var _=require('lodash');var attributes=require(_0xa0e6('0x0'));module[_0xa0e6('0x1')]=function(_0x35d9f6){var _0xc880d9=_0x35d9f6[_0xa0e6('0x2')];function _0x40b6c7(_0x4b9ee9){var _0xcd5884=0x2;var _0x19cadf=[{'type':_0x4b9ee9[_0xa0e6('0x3')],'app':_0xa0e6('0x4'),'appdata':_0xa0e6('0x5')+_0x4b9ee9[_0xa0e6('0x3')],'context':_0x4b9ee9['context'],'exten':_0x4b9ee9['exten'],'priority':_0xcd5884++,'VoiceExtensionId':_0x4b9ee9['id']},{'type':_0x4b9ee9[_0xa0e6('0x3')],'app':_0x4b9ee9[_0xa0e6('0x6')]?_0xa0e6('0x4'):_0xa0e6('0x7'),'appdata':_0x4b9ee9[_0xa0e6('0x6')]?_0xa0e6('0x8')+_0x4b9ee9['alias']:'No\x20alias\x20set','context':_0x4b9ee9[_0xa0e6('0x9')],'exten':_0x4b9ee9[_0xa0e6('0xa')],'priority':_0xcd5884++,'VoiceExtensionId':_0x4b9ee9['id']}];if(_0x4b9ee9['type']===_0xa0e6('0xb')){_0x19cadf['push']({'type':_0xa0e6('0xb'),'app':_0xa0e6('0x4'),'appdata':'CDR(routeid)='+_0x4b9ee9['id'],'context':_0x4b9ee9['context'],'exten':_0x4b9ee9[_0xa0e6('0xa')],'priority':_0xcd5884++,'VoiceExtensionId':_0x4b9ee9['id']});}_0x19cadf[_0xa0e6('0xc')]({'type':_0x4b9ee9[_0xa0e6('0x3')],'app':_0xa0e6('0x4'),'appdata':_0xa0e6('0xd'),'context':_0x4b9ee9['context'],'exten':_0x4b9ee9[_0xa0e6('0xa')],'priority':_0xcd5884++,'VoiceExtensionId':_0x4b9ee9['id']},{'type':_0x4b9ee9['type'],'app':_0xa0e6('0x4'),'appdata':_0xa0e6('0xe'),'context':_0x4b9ee9['context'],'exten':_0x4b9ee9[_0xa0e6('0xa')],'priority':_0xcd5884++,'VoiceExtensionId':_0x4b9ee9['id']},{'type':_0x4b9ee9[_0xa0e6('0x3')],'app':_0xa0e6('0x4'),'appdata':_0xa0e6('0xf'),'context':_0x4b9ee9[_0xa0e6('0x9')],'exten':_0x4b9ee9[_0xa0e6('0xa')],'priority':_0xcd5884++,'VoiceExtensionId':_0x4b9ee9['id']});return _0x19cadf;}function _0x30e924(_0x4e8006){var _0x5b4294=0x2;var _0x535e39=[{'type':_0xa0e6('0x10'),'app':_0xa0e6('0x4'),'appdata':'CDR(type)=outbound','context':_0x4e8006[_0xa0e6('0x9')],'exten':_0x4e8006[_0xa0e6('0xa')],'priority':_0x5b4294++,'VoiceExtensionId':_0x4e8006['id']},{'type':_0xa0e6('0x10'),'app':_0x4e8006['alias']?'Set':_0xa0e6('0x7'),'appdata':_0x4e8006[_0xa0e6('0x6')]?'CDR(routeAlias)='+_0x4e8006[_0xa0e6('0x6')]:_0xa0e6('0x11'),'context':_0x4e8006['context'],'exten':_0x4e8006[_0xa0e6('0xa')],'priority':_0x5b4294++,'VoiceExtensionId':_0x4e8006['id']},{'type':_0xa0e6('0x10'),'app':'Set','appdata':_0xa0e6('0x12')+(_0x4e8006['cutdigits']?_0xa0e6('0x13')+_0x4e8006[_0xa0e6('0x14')]+'}':_0xa0e6('0x15')),'context':_0x4e8006[_0xa0e6('0x9')],'exten':_0x4e8006[_0xa0e6('0xa')],'priority':_0x5b4294++,'VoiceExtensionId':_0x4e8006['id']},{'type':_0xa0e6('0x10'),'app':_0xa0e6('0x4'),'appdata':_0xa0e6('0x16')+_0x4e8006['id'],'context':_0x4e8006[_0xa0e6('0x9')],'exten':_0x4e8006[_0xa0e6('0xa')],'priority':_0x5b4294++,'VoiceExtensionId':_0x4e8006['id']},{'type':_0xa0e6('0x10'),'app':_0xa0e6('0x17'),'appdata':_0xa0e6('0x18')+(_0x5b4294+0x2)+_0xa0e6('0x19')+(_0x5b4294+0x1)+')','context':_0x4e8006[_0xa0e6('0x9')],'exten':_0x4e8006[_0xa0e6('0xa')],'priority':_0x5b4294++,'VoiceExtensionId':_0x4e8006['id']},{'type':_0xa0e6('0x10'),'app':_0xa0e6('0x4'),'appdata':_0x4e8006[_0xa0e6('0x14')]?'CDR(prefix)=${EXTEN:0:'+_0x4e8006[_0xa0e6('0x14')]+'}':_0xa0e6('0x1a'),'context':_0x4e8006[_0xa0e6('0x9')],'exten':_0x4e8006[_0xa0e6('0xa')],'priority':_0x5b4294++,'VoiceExtensionId':_0x4e8006['id']},{'type':_0xa0e6('0x10'),'app':_0xa0e6('0x4'),'appdata':_0xa0e6('0xd'),'context':_0x4e8006['context'],'exten':_0x4e8006['exten'],'priority':_0x5b4294++,'VoiceExtensionId':_0x4e8006['id']},{'type':_0xa0e6('0x10'),'app':_0xa0e6('0x4'),'appdata':_0xa0e6('0xe'),'context':_0x4e8006[_0xa0e6('0x9')],'exten':_0x4e8006[_0xa0e6('0xa')],'priority':_0x5b4294++,'VoiceExtensionId':_0x4e8006['id']},{'type':_0xa0e6('0x10'),'app':_0xa0e6('0x4'),'appdata':_0xa0e6('0xf'),'context':_0x4e8006[_0xa0e6('0x9')],'exten':_0x4e8006[_0xa0e6('0xa')],'priority':_0x5b4294++,'VoiceExtensionId':_0x4e8006['id']},{'type':_0xa0e6('0x10'),'app':'Set','appdata':'outboundrouteid='+_0x4e8006['id'],'context':_0x4e8006['context'],'exten':_0x4e8006[_0xa0e6('0xa')],'priority':_0x5b4294++,'VoiceExtensionId':_0x4e8006['id']}];if(_0x4e8006[_0xa0e6('0x1b')](_0xa0e6('0x1c'))&&_0x4e8006[_0xa0e6('0x1c')]!=='none'){_0x535e39[_0xa0e6('0xc')]({'type':'outbound','app':_0xa0e6('0x4'),'appdata':_0xa0e6('0x1d'),'context':_0x4e8006[_0xa0e6('0x9')],'exten':_0x4e8006[_0xa0e6('0xa')],'priority':_0x5b4294++,'VoiceExtensionId':_0x4e8006['id']},{'type':'outbound','app':'Set','appdata':_0xa0e6('0x1e')+_0x4e8006[_0xa0e6('0x1c')]||_0xa0e6('0x1f'),'context':_0x4e8006['context'],'exten':_0x4e8006[_0xa0e6('0xa')],'priority':_0x5b4294++,'VoiceExtensionId':_0x4e8006['id']});}return _0x535e39;}function _0x1cb97f(_0x8bd974,_0x298111){var _0x39eed7=[{'name':_0xa0e6('0x20'),'param':0x0},{'name':_0xa0e6('0x21'),'param':0x1},{'name':_0xa0e6('0x22'),'param':0x2},{'name':_0xa0e6('0x23'),'param':0x3}];var _0x1fa63d={};var _0x5def82=_0x298111[_0xa0e6('0x24')](',');var _0x2ca990=[];for(var _0x4421b1=0x0;_0x4421b1<_0x39eed7[_0xa0e6('0x25')];_0x4421b1++){switch(_0x39eed7[_0x4421b1][_0xa0e6('0x26')]){case _0xa0e6('0x20'):_0x1fa63d[_0xa0e6('0x20')]=_0x5def82[_0x39eed7[_0x4421b1][_0xa0e6('0x27')]][_0xa0e6('0x24')]('/')[0x1];_0x1fa63d['phone']=_0x5def82[_0x39eed7[_0x4421b1][_0xa0e6('0x27')]][_0xa0e6('0x24')]('/')[0x2];_0x1fa63d[_0xa0e6('0x28')]=_0x1fa63d[_0xa0e6('0x29')]?_0x1fa63d[_0xa0e6('0x29')][_0xa0e6('0x24')]('$')[0x0]:undefined;_0x1fa63d[_0xa0e6('0x29')]=_0x8bd974['cutdigits']?(_0x1fa63d[_0xa0e6('0x28')]||'')+_0xa0e6('0x13')+_0x8bd974[_0xa0e6('0x14')]+'}':(_0x1fa63d[_0xa0e6('0x28')]||'')+_0xa0e6('0x15');_0x2ca990[_0x39eed7[_0x4421b1][_0xa0e6('0x27')]]=[_0xa0e6('0x2a'),_0x1fa63d[_0xa0e6('0x20')],_0x1fa63d['phone']][_0xa0e6('0x2b')]('/');break;case _0xa0e6('0x22'):_0x1fa63d[_0xa0e6('0x22')]=_0x5def82[_0x39eed7[_0x4421b1][_0xa0e6('0x27')]];if(_0x8bd974['recordingFormat']!=='none'){if(_0x1fa63d[_0xa0e6('0x22')][_0xa0e6('0x2c')](_0xa0e6('0x2d'))<0x0){_0x1fa63d[_0xa0e6('0x22')]+=_0xa0e6('0x2d');}}else{_0x1fa63d[_0xa0e6('0x22')]=_0x1fa63d['options'][_0xa0e6('0x2e')]('U(xcally-mixmonitor-context)','');}_0x2ca990[_0x39eed7[_0x4421b1][_0xa0e6('0x27')]]=_0x1fa63d[_0xa0e6('0x22')];break;default:_0x2ca990[_0x39eed7[_0x4421b1][_0xa0e6('0x27')]]=_0x5def82[_0x39eed7[_0x4421b1][_0xa0e6('0x27')]];}}return _0x2ca990[_0xa0e6('0x2b')](',');}function _0x26bda8(_0x102bc9,_0x252f69,_0x251a94){return new Promise(function(_0x2758c8,_0x453563){var _0x27e4bd=[];if(_['isEmpty'](_0x252f69))return _0x2758c8(_0x27e4bd);_0xc880d9[_0xa0e6('0x2f')][_0xa0e6('0x30')]({'attributes':['id',_0xa0e6('0x31'),_0xa0e6('0x32')],'raw':!![]})[_0xa0e6('0x33')](function(_0x573eeb){for(var _0x1cd2ed=0x0,_0x375bf4=0x0;_0x1cd2ed<_0x252f69[_0xa0e6('0x25')];_0x1cd2ed++,_0x375bf4=0x0){var _0x1ce3f9=_0x252f69[_0x1cd2ed];var _0x4225b7=[];var _0xedb69a=[];delete _0x1ce3f9['id'];if(_0x1ce3f9[_0xa0e6('0x31')]!==_0xa0e6('0x34')){_0x1ce3f9[_0xa0e6('0x35')]=[_0x1ce3f9[_0xa0e6('0x31')]];}else{_0x1ce3f9[_0xa0e6('0x35')]=_0x1ce3f9['IntervalId']?_['map'](_[_0xa0e6('0x36')](_0x573eeb,{'IntervalId':_0x1ce3f9[_0xa0e6('0x32')]}),_0xa0e6('0x31')):[];}_0x1ce3f9[_0xa0e6('0x9')]=_0x102bc9['context'];_0x1ce3f9[_0xa0e6('0xa')]=_0x102bc9[_0xa0e6('0xa')];if(_0x1ce3f9[_0xa0e6('0x3')])_0x1ce3f9[_0xa0e6('0x3')]=_0x1ce3f9['type']['toLowerCase']();if(_0x102bc9[_0xa0e6('0x3')]==='outbound'){if(_0x1ce3f9[_0xa0e6('0x1b')](_0xa0e6('0x37'))&&_0x1ce3f9['tag']&&_0x1ce3f9[_0xa0e6('0x37')]!=='--'){_0x4225b7['push']({'type':_0x1ce3f9[_0xa0e6('0x3')][_0xa0e6('0x38')](),'app':'Set','appdata':_0xa0e6('0x39')+_0x1ce3f9[_0xa0e6('0x37')],'context':_0x102bc9[_0xa0e6('0x9')],'exten':_0x102bc9[_0xa0e6('0xa')],'priority':_0x1ce3f9[_0xa0e6('0x35')][_0xa0e6('0x25')]+_0x251a94+_0x375bf4++,'VoiceExtensionId':_0x102bc9['id']});}_0x4225b7[_0xa0e6('0xc')]({'type':_0x1ce3f9[_0xa0e6('0x3')][_0xa0e6('0x38')](),'app':_0xa0e6('0x17'),'appdata':_0xa0e6('0x3a')+(_0x1ce3f9[_0xa0e6('0x3b')]?'Set(CALLERID(all)='+_0x1ce3f9['callerID']+')':_0xa0e6('0x3c')),'context':_0x102bc9['context'],'exten':_0x102bc9[_0xa0e6('0xa')],'priority':_0x1ce3f9[_0xa0e6('0x35')][_0xa0e6('0x25')]+_0x251a94+_0x375bf4++,'VoiceExtensionId':_0x102bc9['id']});}else{if(_0x1ce3f9[_0xa0e6('0x1b')]('answer')){if([_0xa0e6('0x3d'),_0xa0e6('0x3e')][_0xa0e6('0x3f')](_0x1ce3f9[_0xa0e6('0x40')][_0xa0e6('0x38')]())&&_0x1ce3f9[_0xa0e6('0x41')]!==_0xa0e6('0x42')){if(_0x1ce3f9[_0xa0e6('0x43')]){_0x4225b7[_0xa0e6('0xc')]({'type':_0x1ce3f9[_0xa0e6('0x3')][_0xa0e6('0x38')](),'app':_0xa0e6('0x17'),'appdata':_0xa0e6('0x44'),'context':_0x102bc9[_0xa0e6('0x9')],'exten':_0x102bc9['exten'],'priority':_0x1ce3f9[_0xa0e6('0x35')][_0xa0e6('0x25')]+_0x251a94+_0x375bf4++,'VoiceExtensionId':_0x102bc9['id']});_0x4225b7[_0xa0e6('0xc')]({'type':_0x1ce3f9[_0xa0e6('0x3')][_0xa0e6('0x38')](),'app':'Set','appdata':_0xa0e6('0x45'),'context':_0x102bc9[_0xa0e6('0x9')],'exten':_0x102bc9[_0xa0e6('0xa')],'priority':_0x1ce3f9['intervals'][_0xa0e6('0x25')]+_0x251a94+_0x375bf4++,'VoiceExtensionId':_0x102bc9['id']});}else{_0x4225b7[_0xa0e6('0xc')]({'type':_0x1ce3f9[_0xa0e6('0x3')][_0xa0e6('0x38')](),'app':_0xa0e6('0x17'),'appdata':_0xa0e6('0x46'),'context':_0x102bc9['context'],'exten':_0x102bc9[_0xa0e6('0xa')],'priority':_0x1ce3f9[_0xa0e6('0x35')][_0xa0e6('0x25')]+_0x251a94+_0x375bf4++,'VoiceExtensionId':_0x102bc9['id']});_0x4225b7[_0xa0e6('0xc')]({'type':_0x1ce3f9['type'][_0xa0e6('0x38')](),'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x102bc9[_0xa0e6('0x9')],'exten':_0x102bc9[_0xa0e6('0xa')],'priority':_0x1ce3f9['intervals'][_0xa0e6('0x25')]+_0x251a94+_0x375bf4++,'VoiceExtensionId':_0x102bc9['id']});}}}}for(var _0x70e21f=0x0;_0x70e21f<_0x1ce3f9[_0xa0e6('0x35')][_0xa0e6('0x25')];_0x70e21f++){var _0x435967=_0x251a94+_0x1ce3f9[_0xa0e6('0x35')]['length'];var _0x400193=_0x70e21f===_0x1ce3f9[_0xa0e6('0x35')][_0xa0e6('0x25')]-0x1?_0x251a94+_0x4225b7['length']+_0xedb69a[_0xa0e6('0x25')]+0x2:_0x251a94+_0x70e21f+0x1;_0x4225b7[_0xa0e6('0x47')](_0x70e21f,0x0,{'type':_0x102bc9[_0xa0e6('0x3')],'app':'GotoIfTime','appdata':_0x1ce3f9[_0xa0e6('0x35')][_0x70e21f]+'?'+_0x102bc9[_0xa0e6('0x9')]+_0xa0e6('0x48')+_0x435967+':'+_0x102bc9[_0xa0e6('0x9')]+_0xa0e6('0x48')+_0x400193,'exten':_0x102bc9[_0xa0e6('0xa')],'context':_0x102bc9[_0xa0e6('0x9')],'priority':_0x251a94+_0x70e21f,'VoiceExtensionId':_0x102bc9['id']});}if(_0x1ce3f9[_0xa0e6('0x41')]===_0xa0e6('0x49'))_0x1ce3f9[_0xa0e6('0x4a')]=_0x1cb97f(_0x102bc9,_0x1ce3f9[_0xa0e6('0x4a')]);_0x1ce3f9[_0xa0e6('0x4b')]=_0x4225b7[_0xa0e6('0x25')]?_[_0xa0e6('0x4c')](_0x4225b7)[_0xa0e6('0x4b')]+0x1:_0x251a94;_0x27e4bd=_[_0xa0e6('0x4d')](_0x27e4bd,_0x4225b7,[_0x1ce3f9],_0xedb69a);_0x251a94=_[_0xa0e6('0x4c')](_0x27e4bd)[_0xa0e6('0x4b')]+0x1;}return _0x2758c8(_0x27e4bd);})[_0xa0e6('0x4e')](function(_0x930552){_0x453563(_0x930552);});});}return _0x35d9f6[_0xa0e6('0x4f')]('VoiceExtension',attributes,{'tableName':_0xa0e6('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0xecb5e4){var _0x6f255b=this[_0xa0e6('0x51')]({'plain':!![]});var _0x58d057=_0x6f255b[_0xa0e6('0x3')]==='outbound'?_0x30e924(_0x6f255b):_0x40b6c7(_0x6f255b);return _0x26bda8(_0x6f255b,_0xecb5e4,_[_0xa0e6('0x4c')](_0x58d057)[_0xa0e6('0x4b')]+0x1)['then'](function(_0x32d919){var _0x2207b8=_['concat'](_0x58d057,_0x32d919);_0x2207b8[_0xa0e6('0xc')]({'type':_0x6f255b[_0xa0e6('0x3')],'app':'Hangup','exten':_0x6f255b[_0xa0e6('0xa')],'context':_0x6f255b[_0xa0e6('0x9')],'priority':_[_0xa0e6('0x4c')](_0x2207b8)['priority']+0x1,'VoiceExtensionId':_0x6f255b['id']});return _0x2207b8;});}}});}; \ No newline at end of file +var _0xbbd7=['CDR(routeid)=','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','NoOp','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','trunk','timeout','options','url','split','length','phone','param','prefix','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','interval','IntervalId','then','intervals','map','toLowerCase','hasOwnProperty','tag','ExecIf','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice',',${EXTEN},','outboundDial','appdata','last','priority','catch','VoiceExtension','voice_extensions','get','concat','Hangup','./voiceExtension.attributes','exports','type','Set','CDR(type)=','context','exten','alias','CDR(routeAlias)=','No\x20alias\x20set','inbound','push'];(function(_0x5a3d19,_0x450ddd){var _0x33039f=function(_0x569864){while(--_0x569864){_0x5a3d19['push'](_0x5a3d19['shift']());}};_0x33039f(++_0x450ddd);}(_0xbbd7,0x8c));var _0x7bbd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbbd7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var attributes=require(_0x7bbd('0x0'));module[_0x7bbd('0x1')]=function(_0x4c82c9){var _0x5d5d6b=_0x4c82c9['models'];function _0x3f78a5(_0x2c5d1f){var _0xf52fd0=0x2;var _0xd082df=[{'type':_0x2c5d1f[_0x7bbd('0x2')],'app':_0x7bbd('0x3'),'appdata':_0x7bbd('0x4')+_0x2c5d1f['type'],'context':_0x2c5d1f[_0x7bbd('0x5')],'exten':_0x2c5d1f[_0x7bbd('0x6')],'priority':_0xf52fd0++,'VoiceExtensionId':_0x2c5d1f['id']},{'type':_0x2c5d1f[_0x7bbd('0x2')],'app':_0x2c5d1f[_0x7bbd('0x7')]?'Set':'NoOp','appdata':_0x2c5d1f[_0x7bbd('0x7')]?_0x7bbd('0x8')+_0x2c5d1f['alias']:_0x7bbd('0x9'),'context':_0x2c5d1f[_0x7bbd('0x5')],'exten':_0x2c5d1f['exten'],'priority':_0xf52fd0++,'VoiceExtensionId':_0x2c5d1f['id']}];if(_0x2c5d1f[_0x7bbd('0x2')]===_0x7bbd('0xa')){_0xd082df[_0x7bbd('0xb')]({'type':_0x7bbd('0xa'),'app':_0x7bbd('0x3'),'appdata':_0x7bbd('0xc')+_0x2c5d1f['id'],'context':_0x2c5d1f['context'],'exten':_0x2c5d1f['exten'],'priority':_0xf52fd0++,'VoiceExtensionId':_0x2c5d1f['id']});}_0xd082df[_0x7bbd('0xb')]({'type':_0x2c5d1f[_0x7bbd('0x2')],'app':_0x7bbd('0x3'),'appdata':_0x7bbd('0xd'),'context':_0x2c5d1f[_0x7bbd('0x5')],'exten':_0x2c5d1f[_0x7bbd('0x6')],'priority':_0xf52fd0++,'VoiceExtensionId':_0x2c5d1f['id']},{'type':_0x2c5d1f[_0x7bbd('0x2')],'app':_0x7bbd('0x3'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x2c5d1f[_0x7bbd('0x5')],'exten':_0x2c5d1f[_0x7bbd('0x6')],'priority':_0xf52fd0++,'VoiceExtensionId':_0x2c5d1f['id']},{'type':_0x2c5d1f['type'],'app':_0x7bbd('0x3'),'appdata':_0x7bbd('0xe'),'context':_0x2c5d1f[_0x7bbd('0x5')],'exten':_0x2c5d1f[_0x7bbd('0x6')],'priority':_0xf52fd0++,'VoiceExtensionId':_0x2c5d1f['id']});return _0xd082df;}function _0x269faa(_0x10d5c8){var _0x55b3b5=0x2;var _0x4752a5=[{'type':_0x7bbd('0xf'),'app':'Set','appdata':_0x7bbd('0x10'),'context':_0x10d5c8[_0x7bbd('0x5')],'exten':_0x10d5c8[_0x7bbd('0x6')],'priority':_0x55b3b5++,'VoiceExtensionId':_0x10d5c8['id']},{'type':_0x7bbd('0xf'),'app':_0x10d5c8[_0x7bbd('0x7')]?_0x7bbd('0x3'):_0x7bbd('0x11'),'appdata':_0x10d5c8['alias']?_0x7bbd('0x8')+_0x10d5c8[_0x7bbd('0x7')]:_0x7bbd('0x9'),'context':_0x10d5c8[_0x7bbd('0x5')],'exten':_0x10d5c8['exten'],'priority':_0x55b3b5++,'VoiceExtensionId':_0x10d5c8['id']},{'type':'outbound','app':_0x7bbd('0x3'),'appdata':_0x7bbd('0x12')+(_0x10d5c8['cutdigits']?_0x7bbd('0x13')+_0x10d5c8[_0x7bbd('0x14')]+'}':_0x7bbd('0x15')),'context':_0x10d5c8[_0x7bbd('0x5')],'exten':_0x10d5c8[_0x7bbd('0x6')],'priority':_0x55b3b5++,'VoiceExtensionId':_0x10d5c8['id']},{'type':_0x7bbd('0xf'),'app':_0x7bbd('0x3'),'appdata':_0x7bbd('0xc')+_0x10d5c8['id'],'context':_0x10d5c8['context'],'exten':_0x10d5c8[_0x7bbd('0x6')],'priority':_0x55b3b5++,'VoiceExtensionId':_0x10d5c8['id']},{'type':_0x7bbd('0xf'),'app':'ExecIf','appdata':_0x7bbd('0x16')+(_0x55b3b5+0x2)+'):Goto('+(_0x55b3b5+0x1)+')','context':_0x10d5c8['context'],'exten':_0x10d5c8['exten'],'priority':_0x55b3b5++,'VoiceExtensionId':_0x10d5c8['id']},{'type':_0x7bbd('0xf'),'app':'Set','appdata':_0x10d5c8['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x10d5c8[_0x7bbd('0x14')]+'}':_0x7bbd('0x17'),'context':_0x10d5c8[_0x7bbd('0x5')],'exten':_0x10d5c8[_0x7bbd('0x6')],'priority':_0x55b3b5++,'VoiceExtensionId':_0x10d5c8['id']},{'type':_0x7bbd('0xf'),'app':_0x7bbd('0x3'),'appdata':_0x7bbd('0xd'),'context':_0x10d5c8['context'],'exten':_0x10d5c8[_0x7bbd('0x6')],'priority':_0x55b3b5++,'VoiceExtensionId':_0x10d5c8['id']},{'type':_0x7bbd('0xf'),'app':_0x7bbd('0x3'),'appdata':_0x7bbd('0x18'),'context':_0x10d5c8[_0x7bbd('0x5')],'exten':_0x10d5c8[_0x7bbd('0x6')],'priority':_0x55b3b5++,'VoiceExtensionId':_0x10d5c8['id']},{'type':'outbound','app':_0x7bbd('0x3'),'appdata':'MONITOR_OPTIONS=ab','context':_0x10d5c8[_0x7bbd('0x5')],'exten':_0x10d5c8['exten'],'priority':_0x55b3b5++,'VoiceExtensionId':_0x10d5c8['id']},{'type':_0x7bbd('0xf'),'app':_0x7bbd('0x3'),'appdata':_0x7bbd('0x19')+_0x10d5c8['id'],'context':_0x10d5c8[_0x7bbd('0x5')],'exten':_0x10d5c8['exten'],'priority':_0x55b3b5++,'VoiceExtensionId':_0x10d5c8['id']}];if(_0x10d5c8['hasOwnProperty'](_0x7bbd('0x1a'))&&_0x10d5c8[_0x7bbd('0x1a')]!==_0x7bbd('0x1b')){_0x4752a5[_0x7bbd('0xb')]({'type':_0x7bbd('0xf'),'app':_0x7bbd('0x3'),'appdata':_0x7bbd('0x1c'),'context':_0x10d5c8[_0x7bbd('0x5')],'exten':_0x10d5c8['exten'],'priority':_0x55b3b5++,'VoiceExtensionId':_0x10d5c8['id']},{'type':'outbound','app':_0x7bbd('0x3'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x10d5c8[_0x7bbd('0x1a')]||_0x7bbd('0x1d'),'context':_0x10d5c8[_0x7bbd('0x5')],'exten':_0x10d5c8[_0x7bbd('0x6')],'priority':_0x55b3b5++,'VoiceExtensionId':_0x10d5c8['id']});}return _0x4752a5;}function _0x21ed16(_0x41a549,_0x2e4f3c){var _0x32636d=[{'name':_0x7bbd('0x1e'),'param':0x0},{'name':_0x7bbd('0x1f'),'param':0x1},{'name':_0x7bbd('0x20'),'param':0x2},{'name':_0x7bbd('0x21'),'param':0x3}];var _0x1339de={};var _0x4dea53=_0x2e4f3c[_0x7bbd('0x22')](',');var _0x1de6a6=[];for(var _0x3cf62f=0x0;_0x3cf62f<_0x32636d[_0x7bbd('0x23')];_0x3cf62f++){switch(_0x32636d[_0x3cf62f]['name']){case'trunk':_0x1339de[_0x7bbd('0x1e')]=_0x4dea53[_0x32636d[_0x3cf62f]['param']]['split']('/')[0x1];_0x1339de[_0x7bbd('0x24')]=_0x4dea53[_0x32636d[_0x3cf62f][_0x7bbd('0x25')]][_0x7bbd('0x22')]('/')[0x2];_0x1339de['prefix']=_0x1339de[_0x7bbd('0x24')]?_0x1339de[_0x7bbd('0x24')][_0x7bbd('0x22')]('$')[0x0]:undefined;_0x1339de[_0x7bbd('0x24')]=_0x41a549[_0x7bbd('0x14')]?(_0x1339de['prefix']||'')+_0x7bbd('0x13')+_0x41a549[_0x7bbd('0x14')]+'}':(_0x1339de[_0x7bbd('0x26')]||'')+_0x7bbd('0x15');_0x1de6a6[_0x32636d[_0x3cf62f]['param']]=[_0x7bbd('0x27'),_0x1339de[_0x7bbd('0x1e')],_0x1339de['phone']][_0x7bbd('0x28')]('/');break;case _0x7bbd('0x20'):_0x1339de[_0x7bbd('0x20')]=_0x4dea53[_0x32636d[_0x3cf62f][_0x7bbd('0x25')]];if(_0x41a549['recordingFormat']!=='none'){if(_0x1339de[_0x7bbd('0x20')][_0x7bbd('0x29')]('U(xcally-mixmonitor-context)')<0x0){_0x1339de[_0x7bbd('0x20')]+=_0x7bbd('0x2a');}}else{_0x1339de[_0x7bbd('0x20')]=_0x1339de['options'][_0x7bbd('0x2b')](_0x7bbd('0x2a'),'');}_0x1de6a6[_0x32636d[_0x3cf62f][_0x7bbd('0x25')]]=_0x1339de['options'];break;default:_0x1de6a6[_0x32636d[_0x3cf62f][_0x7bbd('0x25')]]=_0x4dea53[_0x32636d[_0x3cf62f][_0x7bbd('0x25')]];}}return _0x1de6a6[_0x7bbd('0x28')](',');}function _0x3dbbb9(_0x436857,_0x3e396e,_0x526e94){return new Promise(function(_0x28551e,_0x285e81){var _0x17cd2b=[];if(_[_0x7bbd('0x2c')](_0x3e396e))return _0x28551e(_0x17cd2b);_0x5d5d6b[_0x7bbd('0x2d')]['findAll']({'attributes':['id',_0x7bbd('0x2e'),_0x7bbd('0x2f')],'raw':!![]})[_0x7bbd('0x30')](function(_0x539ae9){for(var _0x58bc69=0x0,_0x39310b=0x0;_0x58bc69<_0x3e396e[_0x7bbd('0x23')];_0x58bc69++,_0x39310b=0x0){var _0x429f9c=_0x3e396e[_0x58bc69];var _0x3f71cd=[];var _0x4e956a=[];delete _0x429f9c['id'];if(_0x429f9c['interval']!=='*,*,*,*'){_0x429f9c[_0x7bbd('0x31')]=[_0x429f9c[_0x7bbd('0x2e')]];}else{_0x429f9c['intervals']=_0x429f9c['IntervalId']?_[_0x7bbd('0x32')](_['filter'](_0x539ae9,{'IntervalId':_0x429f9c['IntervalId']}),_0x7bbd('0x2e')):[];}_0x429f9c[_0x7bbd('0x5')]=_0x436857['context'];_0x429f9c[_0x7bbd('0x6')]=_0x436857[_0x7bbd('0x6')];if(_0x429f9c[_0x7bbd('0x2')])_0x429f9c['type']=_0x429f9c[_0x7bbd('0x2')][_0x7bbd('0x33')]();if(_0x436857[_0x7bbd('0x2')]===_0x7bbd('0xf')){if(_0x429f9c[_0x7bbd('0x34')](_0x7bbd('0x35'))&&_0x429f9c['tag']&&_0x429f9c['tag']!=='--'){_0x3f71cd['push']({'type':_0x429f9c[_0x7bbd('0x2')][_0x7bbd('0x33')](),'app':_0x7bbd('0x3'),'appdata':'CDR(tag)='+_0x429f9c[_0x7bbd('0x35')],'context':_0x436857[_0x7bbd('0x5')],'exten':_0x436857[_0x7bbd('0x6')],'priority':_0x429f9c[_0x7bbd('0x31')][_0x7bbd('0x23')]+_0x526e94+_0x39310b++,'VoiceExtensionId':_0x436857['id']});}_0x3f71cd[_0x7bbd('0xb')]({'type':_0x429f9c[_0x7bbd('0x2')][_0x7bbd('0x33')](),'app':_0x7bbd('0x36'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x429f9c[_0x7bbd('0x37')]?_0x7bbd('0x38')+_0x429f9c[_0x7bbd('0x37')]+')':_0x7bbd('0x39')),'context':_0x436857[_0x7bbd('0x5')],'exten':_0x436857[_0x7bbd('0x6')],'priority':_0x429f9c[_0x7bbd('0x31')][_0x7bbd('0x23')]+_0x526e94+_0x39310b++,'VoiceExtensionId':_0x436857['id']});}else{if(_0x429f9c['hasOwnProperty'](_0x7bbd('0x3a'))){if(['queue','playback']['includes'](_0x429f9c[_0x7bbd('0x3b')]['toLowerCase']())&&_0x429f9c[_0x7bbd('0x3c')]!==_0x7bbd('0x3d')){if(_0x429f9c[_0x7bbd('0x3a')]){_0x3f71cd[_0x7bbd('0xb')]({'type':_0x429f9c[_0x7bbd('0x2')][_0x7bbd('0x33')](),'app':_0x7bbd('0x36'),'appdata':_0x7bbd('0x3e'),'context':_0x436857[_0x7bbd('0x5')],'exten':_0x436857[_0x7bbd('0x6')],'priority':_0x429f9c[_0x7bbd('0x31')][_0x7bbd('0x23')]+_0x526e94+_0x39310b++,'VoiceExtensionId':_0x436857['id']});_0x3f71cd[_0x7bbd('0xb')]({'type':_0x429f9c['type'][_0x7bbd('0x33')](),'app':_0x7bbd('0x3'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x436857[_0x7bbd('0x5')],'exten':_0x436857[_0x7bbd('0x6')],'priority':_0x429f9c[_0x7bbd('0x31')][_0x7bbd('0x23')]+_0x526e94+_0x39310b++,'VoiceExtensionId':_0x436857['id']});}else{_0x3f71cd[_0x7bbd('0xb')]({'type':_0x429f9c[_0x7bbd('0x2')][_0x7bbd('0x33')](),'app':_0x7bbd('0x36'),'appdata':_0x7bbd('0x3f'),'context':_0x436857[_0x7bbd('0x5')],'exten':_0x436857[_0x7bbd('0x6')],'priority':_0x429f9c['intervals'][_0x7bbd('0x23')]+_0x526e94+_0x39310b++,'VoiceExtensionId':_0x436857['id']});_0x3f71cd[_0x7bbd('0xb')]({'type':_0x429f9c[_0x7bbd('0x2')]['toLowerCase'](),'app':_0x7bbd('0x3'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x436857['context'],'exten':_0x436857['exten'],'priority':_0x429f9c[_0x7bbd('0x31')][_0x7bbd('0x23')]+_0x526e94+_0x39310b++,'VoiceExtensionId':_0x436857['id']});}}}}for(var _0x42aebc=0x0;_0x42aebc<_0x429f9c['intervals']['length'];_0x42aebc++){var _0x21e04a=_0x526e94+_0x429f9c['intervals'][_0x7bbd('0x23')];var _0x541310=_0x42aebc===_0x429f9c[_0x7bbd('0x31')][_0x7bbd('0x23')]-0x1?_0x526e94+_0x3f71cd[_0x7bbd('0x23')]+_0x4e956a[_0x7bbd('0x23')]+0x2:_0x526e94+_0x42aebc+0x1;_0x3f71cd[_0x7bbd('0x40')](_0x42aebc,0x0,{'type':_0x436857[_0x7bbd('0x2')],'app':'GotoIfTime','appdata':_0x429f9c[_0x7bbd('0x31')][_0x42aebc]+'?'+_0x436857[_0x7bbd('0x5')]+',${EXTEN},'+_0x21e04a+':'+_0x436857[_0x7bbd('0x5')]+_0x7bbd('0x41')+_0x541310,'exten':_0x436857['exten'],'context':_0x436857['context'],'priority':_0x526e94+_0x42aebc,'VoiceExtensionId':_0x436857['id']});}if(_0x429f9c[_0x7bbd('0x3c')]===_0x7bbd('0x42'))_0x429f9c['appdata']=_0x21ed16(_0x436857,_0x429f9c[_0x7bbd('0x43')]);_0x429f9c['priority']=_0x3f71cd[_0x7bbd('0x23')]?_[_0x7bbd('0x44')](_0x3f71cd)[_0x7bbd('0x45')]+0x1:_0x526e94;_0x17cd2b=_['concat'](_0x17cd2b,_0x3f71cd,[_0x429f9c],_0x4e956a);_0x526e94=_['last'](_0x17cd2b)[_0x7bbd('0x45')]+0x1;}return _0x28551e(_0x17cd2b);})[_0x7bbd('0x46')](function(_0x56d828){_0x285e81(_0x56d828);});});}return _0x4c82c9['define'](_0x7bbd('0x47'),attributes,{'tableName':_0x7bbd('0x48'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x47554e){var _0x439b0b=this[_0x7bbd('0x49')]({'plain':!![]});var _0x1e0f2d=_0x439b0b[_0x7bbd('0x2')]===_0x7bbd('0xf')?_0x269faa(_0x439b0b):_0x3f78a5(_0x439b0b);return _0x3dbbb9(_0x439b0b,_0x47554e,_['last'](_0x1e0f2d)[_0x7bbd('0x45')]+0x1)['then'](function(_0x3561e0){var _0x3df747=_[_0x7bbd('0x4a')](_0x1e0f2d,_0x3561e0);_0x3df747[_0x7bbd('0xb')]({'type':_0x439b0b[_0x7bbd('0x2')],'app':_0x7bbd('0x4b'),'exten':_0x439b0b[_0x7bbd('0x6')],'context':_0x439b0b[_0x7bbd('0x5')],'priority':_['last'](_0x3df747)[_0x7bbd('0x45')]+0x1,'VoiceExtensionId':_0x439b0b['id']});return _0x3df747;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index e1d7523..b81031f 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 _0x15c6=['attributes','map','model','GetVoiceExtension','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','then','info','VoiceExtension,\x20%s,\x20%s','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','options','raw','limit','include'];(function(_0x45b36c,_0x4efbfe){var _0x1dad2f=function(_0x1532af){while(--_0x1532af){_0x45b36c['push'](_0x45b36c['shift']());}};_0x1dad2f(++_0x4efbfe);}(_0x15c6,0x1cd));var _0x615c=function(_0x4f027d,_0x3f9587){_0x4f027d=_0x4f027d-0x0;var _0xc46890=_0x15c6[_0x4f027d];return _0xc46890;};'use strict';var _=require(_0x615c('0x0'));var util=require(_0x615c('0x1'));var moment=require(_0x615c('0x2'));var BPromise=require(_0x615c('0x3'));var rs=require(_0x615c('0x4'));var fs=require('fs');var Redis=require(_0x615c('0x5'));var db=require(_0x615c('0x6'))['db'];var utils=require(_0x615c('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x615c('0x8'));var client=jayson[_0x615c('0x9')][_0x615c('0xa')]({'port':0x232a});config['redis']=_[_0x615c('0xb')](config[_0x615c('0xc')],{'host':_0x615c('0xd'),'port':0x18eb});var socket=require(_0x615c('0xe'))(new Redis(config['redis']));require(_0x615c('0xf'))['register'](socket);function respondWithRpcPromise(_0x3df139,_0x19f033,_0x2af037){return new BPromise(function(_0x8f4a1e,_0x51f114){return client['request'](_0x3df139,_0x2af037)[_0x615c('0x10')](function(_0x286731){logger[_0x615c('0x11')](_0x615c('0x12'),_0x19f033,'request\x20sent');logger['debug'](_0x615c('0x13'),_0x19f033,_0x615c('0x14'),JSON['stringify'](_0x286731));if(_0x286731[_0x615c('0x15')]){if(_0x286731['error']['code']===0x1f4){logger[_0x615c('0x15')](_0x615c('0x12'),_0x19f033,_0x286731[_0x615c('0x15')][_0x615c('0x16')]);return _0x51f114(_0x286731[_0x615c('0x15')][_0x615c('0x16')]);}logger['error'](_0x615c('0x12'),_0x19f033,_0x286731[_0x615c('0x15')][_0x615c('0x16')]);return _0x8f4a1e(_0x286731['error'][_0x615c('0x16')]);}else{logger[_0x615c('0x11')](_0x615c('0x12'),_0x19f033,_0x615c('0x14'));_0x8f4a1e(_0x286731[_0x615c('0x17')][_0x615c('0x16')]);}})[_0x615c('0x18')](function(_0x341344){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x19f033,_0x341344);_0x51f114(_0x341344);});});}exports['GetVoiceExtension']=function(_0x2cbe15){var _0x1179a3=this;return new Promise(function(_0x348280,_0x146c58){return db['VoiceExtension']['findAll']({'raw':_0x2cbe15[_0x615c('0x19')]?_0x2cbe15['options'][_0x615c('0x1a')]===undefined?!![]:![]:!![],'where':_0x2cbe15['options']?_0x2cbe15[_0x615c('0x19')]['where']||null:null,'attributes':_0x2cbe15[_0x615c('0x19')]?_0x2cbe15[_0x615c('0x19')]['attributes']||null:null,'limit':_0x2cbe15['options']?_0x2cbe15[_0x615c('0x19')][_0x615c('0x1b')]||null:null,'include':_0x2cbe15[_0x615c('0x19')]?_0x2cbe15[_0x615c('0x19')][_0x615c('0x1c')]?_['map'](_0x2cbe15[_0x615c('0x19')][_0x615c('0x1c')],function(_0x5968aa){return{'model':db[_0x5968aa['model']],'as':_0x5968aa['as'],'attributes':_0x5968aa[_0x615c('0x1d')],'include':_0x5968aa[_0x615c('0x1c')]?_[_0x615c('0x1e')](_0x5968aa['include'],function(_0x32ce76){return{'model':db[_0x32ce76[_0x615c('0x1f')]],'as':_0x32ce76['as'],'attributes':_0x32ce76[_0x615c('0x1d')],'include':_0x32ce76[_0x615c('0x1c')]?_['map'](_0x32ce76[_0x615c('0x1c')],function(_0x174259){return{'model':db[_0x174259[_0x615c('0x1f')]],'as':_0x174259['as'],'attributes':_0x174259[_0x615c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x615c('0x10')](function(_0x266e46){logger[_0x615c('0x11')](_0x615c('0x20'),_0x2cbe15);logger[_0x615c('0x21')](_0x615c('0x20'),_0x2cbe15,JSON[_0x615c('0x22')](_0x266e46));_0x348280(_0x266e46);})[_0x615c('0x18')](function(_0x391211){logger[_0x615c('0x15')]('GetVoiceExtension',_0x391211[_0x615c('0x16')],_0x2cbe15);_0x146c58(_0x1179a3[_0x615c('0x15')](0x1f4,_0x391211[_0x615c('0x16')]));});});}; \ No newline at end of file +var _0x56e7=['findAll','options','raw','where','limit','include','attributes','map','model','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./voiceExtension.socket','register','request','info','debug','request\x20sent','stringify','error','code','message','VoiceExtension,\x20%s,\x20%s','result','catch','GetVoiceExtension','VoiceExtension'];(function(_0xf34b0a,_0x11e116){var _0x5021e1=function(_0x4eff67){while(--_0x4eff67){_0xf34b0a['push'](_0xf34b0a['shift']());}};_0x5021e1(++_0x11e116);}(_0x56e7,0x7b));var _0x756e=function(_0x450aaf,_0x1c1a8c){_0x450aaf=_0x450aaf-0x0;var _0x199a88=_0x56e7[_0x450aaf];return _0x199a88;};'use strict';var _=require('lodash');var util=require(_0x756e('0x0'));var moment=require(_0x756e('0x1'));var BPromise=require('bluebird');var rs=require(_0x756e('0x2'));var fs=require('fs');var Redis=require(_0x756e('0x3'));var db=require(_0x756e('0x4'))['db'];var utils=require(_0x756e('0x5'));var logger=require(_0x756e('0x6'))(_0x756e('0x7'));var config=require(_0x756e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x756e('0x9')][_0x756e('0xa')]({'port':0x232a});config[_0x756e('0xb')]=_[_0x756e('0xc')](config['redis'],{'host':_0x756e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x756e('0xb')]));require(_0x756e('0xe'))[_0x756e('0xf')](socket);function respondWithRpcPromise(_0x4738dc,_0x4adf8f,_0x5d5b90){return new BPromise(function(_0x324d36,_0x2be615){return client[_0x756e('0x10')](_0x4738dc,_0x5d5b90)['then'](function(_0x330076){logger[_0x756e('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x4adf8f,'request\x20sent');logger[_0x756e('0x12')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x4adf8f,_0x756e('0x13'),JSON[_0x756e('0x14')](_0x330076));if(_0x330076[_0x756e('0x15')]){if(_0x330076[_0x756e('0x15')][_0x756e('0x16')]===0x1f4){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x4adf8f,_0x330076[_0x756e('0x15')][_0x756e('0x17')]);return _0x2be615(_0x330076[_0x756e('0x15')]['message']);}logger['error'](_0x756e('0x18'),_0x4adf8f,_0x330076[_0x756e('0x15')][_0x756e('0x17')]);return _0x324d36(_0x330076[_0x756e('0x15')][_0x756e('0x17')]);}else{logger[_0x756e('0x11')](_0x756e('0x18'),_0x4adf8f,_0x756e('0x13'));_0x324d36(_0x330076[_0x756e('0x19')]['message']);}})[_0x756e('0x1a')](function(_0x47c3c4){logger['error'](_0x756e('0x18'),_0x4adf8f,_0x47c3c4);_0x2be615(_0x47c3c4);});});}exports[_0x756e('0x1b')]=function(_0x30bc11){var _0xe26ae=this;return new Promise(function(_0x191e6c,_0x4e99a2){return db[_0x756e('0x1c')][_0x756e('0x1d')]({'raw':_0x30bc11[_0x756e('0x1e')]?_0x30bc11[_0x756e('0x1e')][_0x756e('0x1f')]===undefined?!![]:![]:!![],'where':_0x30bc11[_0x756e('0x1e')]?_0x30bc11[_0x756e('0x1e')][_0x756e('0x20')]||null:null,'attributes':_0x30bc11[_0x756e('0x1e')]?_0x30bc11[_0x756e('0x1e')]['attributes']||null:null,'limit':_0x30bc11[_0x756e('0x1e')]?_0x30bc11['options'][_0x756e('0x21')]||null:null,'include':_0x30bc11[_0x756e('0x1e')]?_0x30bc11[_0x756e('0x1e')][_0x756e('0x22')]?_['map'](_0x30bc11[_0x756e('0x1e')][_0x756e('0x22')],function(_0x2f4db8){return{'model':db[_0x2f4db8['model']],'as':_0x2f4db8['as'],'attributes':_0x2f4db8[_0x756e('0x23')],'include':_0x2f4db8[_0x756e('0x22')]?_[_0x756e('0x24')](_0x2f4db8['include'],function(_0xf09ae3){return{'model':db[_0xf09ae3[_0x756e('0x25')]],'as':_0xf09ae3['as'],'attributes':_0xf09ae3['attributes'],'include':_0xf09ae3[_0x756e('0x22')]?_[_0x756e('0x24')](_0xf09ae3[_0x756e('0x22')],function(_0x5a1cf0){return{'model':db[_0x5a1cf0[_0x756e('0x25')]],'as':_0x5a1cf0['as'],'attributes':_0x5a1cf0[_0x756e('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x20543c){logger[_0x756e('0x11')]('GetVoiceExtension',_0x30bc11);logger[_0x756e('0x12')](_0x756e('0x1b'),_0x30bc11,JSON[_0x756e('0x14')](_0x20543c));_0x191e6c(_0x20543c);})[_0x756e('0x1a')](function(_0x3fb38d){logger['error'](_0x756e('0x1b'),_0x3fb38d['message'],_0x30bc11);_0x4e99a2(_0xe26ae['error'](0x1f4,_0x3fb38d[_0x756e('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 6e27a1a..2c2405d 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 _0x7fbe=['length','voiceExtension:','remove','update','emit','removeListener','register'];(function(_0x44655e,_0x26a292){var _0xb1a018=function(_0x1fbeed){while(--_0x1fbeed){_0x44655e['push'](_0x44655e['shift']());}};_0xb1a018(++_0x26a292);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x563a8e,_0x4dd781){_0x563a8e=_0x563a8e-0x0;var _0x45baa0=_0x7fbe[_0x563a8e];return _0x45baa0;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=['save',_0xe7fb('0x0'),_0xe7fb('0x1')];function createListener(_0x294c21,_0x1703d5){return function(_0x517d3a){_0x1703d5[_0xe7fb('0x2')](_0x294c21,_0x517d3a);};}function removeListener(_0x11d2c4,_0x4524ff){return function(){VoiceExtensionEvents[_0xe7fb('0x3')](_0x11d2c4,_0x4524ff);};}exports[_0xe7fb('0x4')]=function(_0x290172){for(var _0x12d1b0=0x0,_0x24cd67=events[_0xe7fb('0x5')];_0x12d1b0<_0x24cd67;_0x12d1b0++){var _0x5ad75b=events[_0x12d1b0];var _0x213ebc=createListener(_0xe7fb('0x6')+_0x5ad75b,_0x290172);VoiceExtensionEvents['on'](_0x5ad75b,_0x213ebc);}}; \ No newline at end of file +var _0x326f=['update','emit','removeListener','register','length','./voiceExtension.events'];(function(_0xcc31fc,_0xc9e9d8){var _0x22e100=function(_0x48db3a){while(--_0x48db3a){_0xcc31fc['push'](_0xcc31fc['shift']());}};_0x22e100(++_0xc9e9d8);}(_0x326f,0xd1));var _0xf326=function(_0x2ef379,_0x68f85b){_0x2ef379=_0x2ef379-0x0;var _0x418942=_0x326f[_0x2ef379];return _0x418942;};'use strict';var VoiceExtensionEvents=require(_0xf326('0x0'));var events=['save','remove',_0xf326('0x1')];function createListener(_0x330ddb,_0x22aabf){return function(_0x408257){_0x22aabf[_0xf326('0x2')](_0x330ddb,_0x408257);};}function removeListener(_0x120a26,_0x9445c6){return function(){VoiceExtensionEvents[_0xf326('0x3')](_0x120a26,_0x9445c6);};}exports[_0xf326('0x4')]=function(_0x3ace29){for(var _0x4c2249=0x0,_0x3c254d=events[_0xf326('0x5')];_0x4c2249<_0x3c254d;_0x4c2249++){var _0x165f95=events[_0x4c2249];var _0x1e7b8a=createListener('voiceExtension:'+_0x165f95,_0x3ace29);VoiceExtensionEvents['on'](_0x165f95,_0x1e7b8a);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 39a1f47..fd1624a 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 _0xf2e3=['/:id','show','/:id/messages','getMessages','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','isAuthenticated','index','get'];(function(_0x7135f,_0x44ad70){var _0x1357c7=function(_0x142f31){while(--_0x142f31){_0x7135f['push'](_0x7135f['shift']());}};_0x1357c7(++_0x44ad70);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xf2e3[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x3f2e('0x0'));var util=require('util');var path=require(_0x3f2e('0x1'));var timeout=require(_0x3f2e('0x2'));var express=require(_0x3f2e('0x3'));var router=express[_0x3f2e('0x4')]();var fs_extra=require(_0x3f2e('0x5'));var auth=require(_0x3f2e('0x6'));var interaction=require(_0x3f2e('0x7'));var config=require(_0x3f2e('0x8'));var controller=require(_0x3f2e('0x9'));router['get']('/',auth[_0x3f2e('0xa')](),controller[_0x3f2e('0xb')]);router[_0x3f2e('0xc')](_0x3f2e('0xd'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0xe')]);router[_0x3f2e('0xc')](_0x3f2e('0xf'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x10')]);router[_0x3f2e('0x11')]('/',auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x12')]);router[_0x3f2e('0x13')](_0x3f2e('0xd'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x14')]);router[_0x3f2e('0x15')](_0x3f2e('0xd'),auth['isAuthenticated'](),controller[_0x3f2e('0x16')]);module[_0x3f2e('0x17')]=router; \ No newline at end of file +var _0xacf4=['index','/:id','isAuthenticated','show','post','create','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get'];(function(_0x3d258c,_0x3853bb){var _0x29e0bf=function(_0x5b31e5){while(--_0x5b31e5){_0x3d258c['push'](_0x3d258c['shift']());}};_0x29e0bf(++_0x3853bb);}(_0xacf4,0xe7));var _0x4acf=function(_0x53a57d,_0x278e27){_0x53a57d=_0x53a57d-0x0;var _0xd56c79=_0xacf4[_0x53a57d];return _0xd56c79;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4acf('0x0'));var timeout=require(_0x4acf('0x1'));var express=require(_0x4acf('0x2'));var router=express[_0x4acf('0x3')]();var fs_extra=require(_0x4acf('0x4'));var auth=require(_0x4acf('0x5'));var interaction=require(_0x4acf('0x6'));var config=require('../../config/environment');var controller=require(_0x4acf('0x7'));router[_0x4acf('0x8')]('/',auth['isAuthenticated'](),controller[_0x4acf('0x9')]);router[_0x4acf('0x8')](_0x4acf('0xa'),auth[_0x4acf('0xb')](),controller[_0x4acf('0xc')]);router['get']('/:id/messages',auth[_0x4acf('0xb')](),controller['getMessages']);router[_0x4acf('0xd')]('/',auth[_0x4acf('0xb')](),controller[_0x4acf('0xe')]);router['put'](_0x4acf('0xa'),auth[_0x4acf('0xb')](),controller['update']);router['delete'](_0x4acf('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x4acf('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index a7ea2d2..4af4cb6 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 _0xc253=['fullname','\x20-\x20','mailbox','sequelize','STRING','contest_mailbox','setDataValue','email','string','trim','central','yes','ENUM','TINYINT(4)','INTEGER','getDataValue'];(function(_0xc4d1aa,_0x4520a0){var _0x2c031c=function(_0x550c92){while(--_0x550c92){_0xc4d1aa['push'](_0xc4d1aa['shift']());}};_0x2c031c(++_0x4520a0);}(_0xc253,0x103));var _0x3c25=function(_0x11c4b6,_0x572fdb){_0x11c4b6=_0x11c4b6-0x0;var _0x2cb405=_0xc253[_0x11c4b6];return _0x2cb405;};'use strict';var Sequelize=require(_0x3c25('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x3c25('0x1')]},'context':{'type':Sequelize[_0x3c25('0x1')],'defaultValue':'from-voicemail','unique':_0x3c25('0x2')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x3c25('0x1')]},'fullname':{'type':Sequelize[_0x3c25('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x26961a){this[_0x3c25('0x3')](_0x3c25('0x4'),typeof _0x26961a===_0x3c25('0x5')&&_0x26961a[_0x3c25('0x6')]()?_0x26961a[_0x3c25('0x6')]():null);}},'pager':{'type':Sequelize[_0x3c25('0x1')]},'tz':{'type':Sequelize[_0x3c25('0x1')],'defaultValue':_0x3c25('0x7')},'attach':{'type':Sequelize['ENUM'](_0x3c25('0x8'),'no'),'defaultValue':_0x3c25('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0x3c25('0x9')](_0x3c25('0x8'),'no'),'defaultValue':_0x3c25('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0x3c25('0x1')]},'callback':{'type':Sequelize[_0x3c25('0x1')]},'review':{'type':Sequelize[_0x3c25('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x3c25('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x3c25('0x9')](_0x3c25('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x3c25('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x3c25('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x3c25('0x9')](_0x3c25('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x3c25('0x9')](_0x3c25('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x3c25('0x8'),'no'),'defaultValue':_0x3c25('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0x3c25('0x9')](_0x3c25('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x3c25('0x9')](_0x3c25('0x8'),'no'),'defaultValue':_0x3c25('0x8'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x3c25('0x1')]},'emailbody':{'type':Sequelize[_0x3c25('0x1')]},'maxsecs':{'type':Sequelize[_0x3c25('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x3c25('0xc')](_0x3c25('0xd'))+_0x3c25('0xe')+this[_0x3c25('0xc')](_0x3c25('0xf'));}}}; \ No newline at end of file +var _0xd26a=['email','trim','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','fullname','\x20-\x20','getDataValue','mailbox','STRING','contest_mailbox','setDataValue'];(function(_0x34893c,_0xad327f){var _0x4689ac=function(_0x56c609){while(--_0x56c609){_0x34893c['push'](_0x34893c['shift']());}};_0x4689ac(++_0xad327f);}(_0xd26a,0x156));var _0xad26=function(_0x5e3fae,_0x449c16){_0x5e3fae=_0x5e3fae-0x0;var _0x183ef9=_0xd26a[_0x5e3fae];return _0x183ef9;};'use strict';var Sequelize=require('sequelize');module['exports']={'customer_id':{'type':Sequelize[_0xad26('0x0')]},'context':{'type':Sequelize[_0xad26('0x0')],'defaultValue':'from-voicemail','unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0xad26('0x0')],'defaultValue':'','allowNull':![],'unique':_0xad26('0x1')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0xad26('0x0')]},'email':{'type':Sequelize[_0xad26('0x0')],'validate':{'isEmail':!![]},'set':function(_0x2e23bc){this[_0xad26('0x2')](_0xad26('0x3'),typeof _0x2e23bc==='string'&&_0x2e23bc[_0xad26('0x4')]()?_0x2e23bc['trim']():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0xad26('0x0')],'defaultValue':'central'},'attach':{'type':Sequelize[_0xad26('0x5')]('yes','no'),'defaultValue':_0xad26('0x6'),'allowNull':![]},'saycid':{'type':Sequelize[_0xad26('0x5')]('yes','no'),'defaultValue':_0xad26('0x6'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0xad26('0x5')](_0xad26('0x6'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xad26('0x5')](_0xad26('0x6'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xad26('0x5')](_0xad26('0x6'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xad26('0x7'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xad26('0x5')](_0xad26('0x6'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xad26('0x5')](_0xad26('0x6'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xad26('0x5')](_0xad26('0x6'),'no'),'defaultValue':_0xad26('0x6'),'allowNull':![]},'forcename':{'type':Sequelize[_0xad26('0x5')](_0xad26('0x6'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xad26('0x5')](_0xad26('0x6'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xad26('0x5')]('yes','no'),'defaultValue':_0xad26('0x6'),'allowNull':![]},'stamp':{'type':_0xad26('0x8')},'emailsubject':{'type':Sequelize[_0xad26('0x0')]},'emailbody':{'type':Sequelize[_0xad26('0x0')]},'maxsecs':{'type':Sequelize[_0xad26('0x9')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xad26('0x9')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xad26('0xa')],'get':function(){return this['getDataValue'](_0xad26('0xb'))+_0xad26('0xc')+this[_0xad26('0xd')](_0xad26('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 90a8e9e..b8deb31 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 _0x13f6=['destroy','Voicemails','error','send','index','map','VoiceMail','rawAttributes','fieldName','type','model','name','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','user','get','UserProfileSection','userProfileId','UserProfileResource','getMessages','findOne','VoiceMailMessage','pick','findAndCountAll','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then'];(function(_0x2cd4b0,_0x140e06){var _0x3180bc=function(_0x33abab){while(--_0x33abab){_0x2cd4b0['push'](_0x2cd4b0['shift']());}};_0x3180bc(++_0x140e06);}(_0x13f6,0x124));var _0x613f=function(_0x39d19e,_0x1925b8){_0x39d19e=_0x39d19e-0x0;var _0x18ab95=_0x13f6[_0x39d19e];return _0x18ab95;};'use strict';var emlformat=require(_0x613f('0x0'));var rimraf=require(_0x613f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x613f('0x2'));var moment=require(_0x613f('0x3'));var BPromise=require(_0x613f('0x4'));var Mustache=require('mustache');var util=require(_0x613f('0x5'));var path=require(_0x613f('0x6'));var sox=require(_0x613f('0x7'));var csv=require('to-csv');var ejs=require(_0x613f('0x8'));var fs=require('fs');var fs_extra=require(_0x613f('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x613f('0xa'));var toCsv=require(_0x613f('0xb'));var querystring=require(_0x613f('0xc'));var Papa=require(_0x613f('0xd'));var Redis=require('ioredis');var authService=require(_0x613f('0xe'));var qs=require(_0x613f('0xf'));var as=require(_0x613f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x613f('0x11'))(_0x613f('0x12'));var utils=require(_0x613f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x613f('0x14'));var db=require(_0x613f('0x15'))['db'];function respondWithStatusCode(_0x542230,_0x4c2a85){_0x4c2a85=_0x4c2a85||0xcc;return function(_0x517f57){if(_0x517f57){return _0x542230[_0x613f('0x16')](_0x4c2a85);}return _0x542230[_0x613f('0x17')](_0x4c2a85)[_0x613f('0x18')]();};}function respondWithResult(_0x375db1,_0x329fcf){_0x329fcf=_0x329fcf||0xc8;return function(_0x4a6fc){if(_0x4a6fc){return _0x375db1[_0x613f('0x17')](_0x329fcf)[_0x613f('0x19')](_0x4a6fc);}};}function respondWithFilteredResult(_0x2eee4d,_0x1d68fd){return function(_0x548218){if(_0x548218){var _0x3c9edf=typeof _0x1d68fd['offset']==='undefined'&&typeof _0x1d68fd[_0x613f('0x1a')]===_0x613f('0x1b');var _0x544eca=_0x548218[_0x613f('0x1c')];var _0x4f9dae=_0x3c9edf?0x0:_0x1d68fd[_0x613f('0x1d')];var _0x1e5a11=_0x3c9edf?_0x548218[_0x613f('0x1c')]:_0x1d68fd[_0x613f('0x1d')]+_0x1d68fd[_0x613f('0x1a')];var _0x1ba35f;if(_0x1e5a11>=_0x544eca){_0x1e5a11=_0x544eca;_0x1ba35f=0xc8;}else{_0x1ba35f=0xce;}_0x2eee4d['status'](_0x1ba35f);return _0x2eee4d['set'](_0x613f('0x1e'),_0x4f9dae+'-'+_0x1e5a11+'/'+_0x544eca)['json'](_0x548218);}return null;};}function patchUpdates(_0x48493c){return function(_0x3c9b58){try{jsonpatch[_0x613f('0x1f')](_0x3c9b58,_0x48493c,!![]);}catch(_0x4f5a5a){return BPromise[_0x613f('0x20')](_0x4f5a5a);}return _0x3c9b58[_0x613f('0x21')]();};}function saveUpdates(_0x2aa14b,_0x48b28a){return function(_0x5401c2){if(_0x5401c2){return _0x5401c2[_0x613f('0x22')](_0x2aa14b)[_0x613f('0x23')](function(_0x2acfcf){return _0x2acfcf;});}return null;};}function removeEntity(_0x51f376,_0x41104e){return function(_0x33e0c6){if(_0x33e0c6){return _0x33e0c6[_0x613f('0x24')]()[_0x613f('0x23')](function(){var _0x3013a1=_0x33e0c6['get']({'plain':!![]});var _0x30fb15=_0x613f('0x25');return db['UserProfileResource'][_0x613f('0x24')]({'where':{'type':_0x30fb15,'resourceId':_0x3013a1['id']}})[_0x613f('0x23')](function(){return _0x33e0c6;});})[_0x613f('0x23')](function(){_0x51f376['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a4a8b,_0x379920){return function(_0x594c28){if(!_0x594c28){_0x5a4a8b[_0x613f('0x16')](0x194);}return _0x594c28;};}function handleError(_0x1767db,_0x4ca372){_0x4ca372=_0x4ca372||0x1f4;return function(_0x121241){logger[_0x613f('0x26')](_0x121241['stack']);if(_0x121241['name']){delete _0x121241['name'];}_0x1767db[_0x613f('0x17')](_0x4ca372)[_0x613f('0x27')](_0x121241);};}exports[_0x613f('0x28')]=function(_0x47f4af,_0x23eda8){var _0x439478={},_0xd335a6={},_0x19bb8f={'count':0x0,'rows':[]};var _0x4f8500=_[_0x613f('0x29')](db[_0x613f('0x2a')][_0x613f('0x2b')],function(_0x728f45){return{'name':_0x728f45[_0x613f('0x2c')],'type':_0x728f45[_0x613f('0x2d')]['key']};});_0xd335a6[_0x613f('0x2e')]=_[_0x613f('0x29')](_0x4f8500,_0x613f('0x2f'));_0xd335a6['query']=_[_0x613f('0x30')](_0x47f4af['query']);_0xd335a6[_0x613f('0x31')]=_[_0x613f('0x32')](_0xd335a6[_0x613f('0x2e')],_0xd335a6[_0x613f('0x33')]);_0x439478[_0x613f('0x34')]=_[_0x613f('0x32')](_0xd335a6['model'],qs[_0x613f('0x35')](_0x47f4af[_0x613f('0x33')][_0x613f('0x35')]));_0x439478[_0x613f('0x34')]=_0x439478[_0x613f('0x34')]['length']?_0x439478['attributes']:_0xd335a6['model'];if(!_0x47f4af[_0x613f('0x33')][_0x613f('0x36')](_0x613f('0x37'))){_0x439478[_0x613f('0x1a')]=qs['limit'](_0x47f4af[_0x613f('0x33')][_0x613f('0x1a')]);_0x439478['offset']=qs[_0x613f('0x1d')](_0x47f4af['query'][_0x613f('0x1d')]);}_0x439478['order']=qs[_0x613f('0x38')](_0x47f4af['query'][_0x613f('0x38')]);_0x439478[_0x613f('0x39')]=qs[_0x613f('0x31')](_['pick'](_0x47f4af[_0x613f('0x33')],_0xd335a6[_0x613f('0x31')]),_0x4f8500);if(_0x47f4af[_0x613f('0x33')][_0x613f('0x3a')]){_0x439478[_0x613f('0x39')]=_[_0x613f('0x3b')](_0x439478[_0x613f('0x39')],{'$or':_[_0x613f('0x29')](_0x4f8500,function(_0x1f71f3){if(_0x1f71f3[_0x613f('0x2d')]!=='VIRTUAL'){var _0x28b1bc={};_0x28b1bc[_0x1f71f3[_0x613f('0x2f')]]={'$like':'%'+_0x47f4af[_0x613f('0x33')][_0x613f('0x3a')]+'%'};return _0x28b1bc;}})});}_0x439478=_[_0x613f('0x3b')]({},_0x439478,_0x47f4af[_0x613f('0x3c')]);var _0xa76fff={'where':_0x439478['where']};return db[_0x613f('0x2a')][_0x613f('0x1c')](_0xa76fff)[_0x613f('0x23')](function(_0x3d2d7b){_0x19bb8f[_0x613f('0x1c')]=_0x3d2d7b;if(_0x47f4af[_0x613f('0x33')][_0x613f('0x3d')]){_0x439478['include']=[{'all':!![]}];}return db[_0x613f('0x2a')][_0x613f('0x3e')](_0x439478);})[_0x613f('0x23')](function(_0x2f584e){_0x19bb8f[_0x613f('0x3f')]=_0x2f584e;return _0x19bb8f;})[_0x613f('0x23')](respondWithFilteredResult(_0x23eda8,_0x439478))[_0x613f('0x40')](handleError(_0x23eda8,null));};exports[_0x613f('0x41')]=function(_0x403feb,_0x2d2574){var _0x12647a={'raw':!![],'where':{'id':_0x403feb[_0x613f('0x42')]['id']}},_0x258a71={};_0x258a71['model']=_[_0x613f('0x30')](db[_0x613f('0x2a')][_0x613f('0x2b')]);_0x258a71[_0x613f('0x33')]=_['keys'](_0x403feb[_0x613f('0x33')]);_0x258a71[_0x613f('0x31')]=_[_0x613f('0x32')](_0x258a71[_0x613f('0x2e')],_0x258a71[_0x613f('0x33')]);_0x12647a[_0x613f('0x34')]=_[_0x613f('0x32')](_0x258a71[_0x613f('0x2e')],qs[_0x613f('0x35')](_0x403feb[_0x613f('0x33')]['fields']));_0x12647a['attributes']=_0x12647a[_0x613f('0x34')][_0x613f('0x43')]?_0x12647a['attributes']:_0x258a71[_0x613f('0x2e')];if(_0x403feb[_0x613f('0x33')][_0x613f('0x3d')]){_0x12647a[_0x613f('0x44')]=[{'all':!![]}];}_0x12647a=_[_0x613f('0x3b')]({},_0x12647a,_0x403feb[_0x613f('0x3c')]);return db[_0x613f('0x2a')][_0x613f('0x45')](_0x12647a)[_0x613f('0x23')](handleEntityNotFound(_0x2d2574,null))[_0x613f('0x23')](respondWithResult(_0x2d2574,null))[_0x613f('0x40')](handleError(_0x2d2574,null));};exports[_0x613f('0x46')]=function(_0x174e22,_0x17f8e5){return db[_0x613f('0x2a')][_0x613f('0x46')](_0x174e22[_0x613f('0x47')],{})[_0x613f('0x23')](function(_0x5a4079){var _0x47c84b=_0x174e22[_0x613f('0x48')][_0x613f('0x49')]({'plain':!![]});if(!_0x47c84b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47c84b['role']===_0x613f('0x48')){var _0x51729a=_0x5a4079['get']({'plain':!![]});var _0x6e006b=_0x613f('0x25');return db[_0x613f('0x4a')]['find']({'where':{'name':_0x6e006b,'userProfileId':_0x47c84b[_0x613f('0x4b')]},'raw':!![]})[_0x613f('0x23')](function(_0x4f59b6){if(_0x4f59b6&&_0x4f59b6['autoAssociation']===0x0){return db[_0x613f('0x4c')][_0x613f('0x46')]({'name':_0x51729a[_0x613f('0x2f')],'resourceId':_0x51729a['id'],'type':_0x4f59b6[_0x613f('0x2f')],'sectionId':_0x4f59b6['id']},{})[_0x613f('0x23')](function(){return _0x5a4079;});}else{return _0x5a4079;}})[_0x613f('0x40')](function(_0x24d162){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24d162);throw _0x24d162;});}return _0x5a4079;})[_0x613f('0x23')](respondWithResult(_0x17f8e5,0xc9))['catch'](handleError(_0x17f8e5,null));};exports['update']=function(_0x387913,_0x52c2a6){if(_0x387913[_0x613f('0x47')]['id']){delete _0x387913['body']['id'];}return db[_0x613f('0x2a')][_0x613f('0x45')]({'where':{'id':_0x387913[_0x613f('0x42')]['id']}})[_0x613f('0x23')](handleEntityNotFound(_0x52c2a6,null))[_0x613f('0x23')](saveUpdates(_0x387913[_0x613f('0x47')],null))[_0x613f('0x23')](respondWithResult(_0x52c2a6,null))['catch'](handleError(_0x52c2a6,null));};exports[_0x613f('0x24')]=function(_0x4ff3ad,_0x3ce3dd){return db[_0x613f('0x2a')][_0x613f('0x45')]({'where':{'id':_0x4ff3ad[_0x613f('0x42')]['id']}})[_0x613f('0x23')](handleEntityNotFound(_0x3ce3dd,null))[_0x613f('0x23')](removeEntity(_0x3ce3dd,null))[_0x613f('0x40')](handleError(_0x3ce3dd,null));};exports[_0x613f('0x4d')]=function(_0x214d01,_0x49637d,_0x2ebce1){return db[_0x613f('0x2a')][_0x613f('0x4e')]({'where':{'id':_0x214d01['params']['id']}})['then'](handleEntityNotFound(_0x49637d,null))[_0x613f('0x23')](function(_0x4b6eb3){var _0xcb1c9d;var _0x3c3cd7={},_0x42a72b={};_0x42a72b[_0x613f('0x2e')]=_[_0x613f('0x30')](db[_0x613f('0x4f')][_0x613f('0x2b')]);_0x42a72b[_0x613f('0x33')]=_[_0x613f('0x30')](_0x214d01[_0x613f('0x33')]);_0x42a72b[_0x613f('0x31')]=_['intersection'](_0x42a72b[_0x613f('0x2e')],_0x42a72b[_0x613f('0x33')]);_0x3c3cd7[_0x613f('0x34')]=_[_0x613f('0x32')](_0x42a72b['model'],qs[_0x613f('0x35')](_0x214d01[_0x613f('0x33')]['fields']));_0x3c3cd7['attributes']=_0x3c3cd7[_0x613f('0x34')]['length']?_0x3c3cd7['attributes']:_0x42a72b['model'];if(!_0x214d01[_0x613f('0x33')]['hasOwnProperty']('nolimit')){_0x3c3cd7['limit']=qs[_0x613f('0x1a')](_0x214d01[_0x613f('0x33')]['limit']);_0x3c3cd7[_0x613f('0x1d')]=qs[_0x613f('0x1d')](_0x214d01[_0x613f('0x33')][_0x613f('0x1d')]);}_0x3c3cd7['order']=qs[_0x613f('0x38')](_0x214d01[_0x613f('0x33')]['sort']);_0x3c3cd7[_0x613f('0x39')]=qs[_0x613f('0x31')](_[_0x613f('0x50')](_0x214d01[_0x613f('0x33')],_0x42a72b[_0x613f('0x31')]));if(_0x214d01[_0x613f('0x33')][_0x613f('0x3a')]){_0x3c3cd7[_0x613f('0x39')]=_[_0x613f('0x3b')](_0x3c3cd7[_0x613f('0x39')],{'$or':_[_0x613f('0x29')](_0x3c3cd7[_0x613f('0x34')],function(_0x50d7ca){var _0x1c4e48={};_0x1c4e48[_0x50d7ca]={'$like':'%'+_0x214d01[_0x613f('0x33')][_0x613f('0x3a')]+'%'};return _0x1c4e48;})});}_0x3c3cd7[_0x613f('0x39')]=_[_0x613f('0x3b')](_0x3c3cd7[_0x613f('0x39')],{'mailboxuser':_0x4b6eb3['mailbox']});_0x3c3cd7=_[_0x613f('0x3b')]({},_0x3c3cd7,_0x214d01[_0x613f('0x3c')]);return db[_0x613f('0x4f')][_0x613f('0x51')](_0x3c3cd7)[_0x613f('0x23')](respondWithFilteredResult(_0x49637d,_0x3c3cd7));})[_0x613f('0x40')](handleError(_0x49637d,null));}; \ No newline at end of file +var _0x6c76=['save','then','destroy','get','Voicemails','UserProfileResource','error','name','send','index','map','VoiceMail','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','count','includeAll','include','rows','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','update','getMessages','VoiceMailMessage','pick','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','apply','reject'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x6c76,0x184));var _0x66c7=function(_0x1125ef,_0x89658){_0x1125ef=_0x1125ef-0x0;var _0x5155e8=_0x6c76[_0x1125ef];return _0x5155e8;};'use strict';var emlformat=require(_0x66c7('0x0'));var rimraf=require(_0x66c7('0x1'));var zipdir=require(_0x66c7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x66c7('0x3'));var moment=require(_0x66c7('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x66c7('0x5'));var path=require(_0x66c7('0x6'));var sox=require('sox');var csv=require(_0x66c7('0x7'));var ejs=require(_0x66c7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x66c7('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x66c7('0xa'));var deskjs=require(_0x66c7('0xb'));var toCsv=require(_0x66c7('0x7'));var querystring=require('querystring');var Papa=require(_0x66c7('0xc'));var Redis=require(_0x66c7('0xd'));var authService=require(_0x66c7('0xe'));var qs=require(_0x66c7('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x66c7('0x10'));var logger=require(_0x66c7('0x11'))(_0x66c7('0x12'));var utils=require(_0x66c7('0x13'));var config=require(_0x66c7('0x14'));var licenseUtil=require(_0x66c7('0x15'));var db=require(_0x66c7('0x16'))['db'];function respondWithStatusCode(_0x5176a3,_0x18c309){_0x18c309=_0x18c309||0xcc;return function(_0x760e36){if(_0x760e36){return _0x5176a3[_0x66c7('0x17')](_0x18c309);}return _0x5176a3[_0x66c7('0x18')](_0x18c309)[_0x66c7('0x19')]();};}function respondWithResult(_0x1e91d1,_0x618bd7){_0x618bd7=_0x618bd7||0xc8;return function(_0xf3b04){if(_0xf3b04){return _0x1e91d1[_0x66c7('0x18')](_0x618bd7)['json'](_0xf3b04);}};}function respondWithFilteredResult(_0x110f6d,_0x4dd902){return function(_0x208010){if(_0x208010){var _0x39f951=typeof _0x4dd902[_0x66c7('0x1a')]===_0x66c7('0x1b')&&typeof _0x4dd902[_0x66c7('0x1c')]==='undefined';var _0x5cf913=_0x208010['count'];var _0x5129f6=_0x39f951?0x0:_0x4dd902[_0x66c7('0x1a')];var _0x19f29d=_0x39f951?_0x208010['count']:_0x4dd902['offset']+_0x4dd902[_0x66c7('0x1c')];var _0x9b65cf;if(_0x19f29d>=_0x5cf913){_0x19f29d=_0x5cf913;_0x9b65cf=0xc8;}else{_0x9b65cf=0xce;}_0x110f6d[_0x66c7('0x18')](_0x9b65cf);return _0x110f6d[_0x66c7('0x1d')]('Content-Range',_0x5129f6+'-'+_0x19f29d+'/'+_0x5cf913)['json'](_0x208010);}return null;};}function patchUpdates(_0x1853b2){return function(_0x237177){try{jsonpatch[_0x66c7('0x1e')](_0x237177,_0x1853b2,!![]);}catch(_0x1c43c4){return BPromise[_0x66c7('0x1f')](_0x1c43c4);}return _0x237177[_0x66c7('0x20')]();};}function saveUpdates(_0x4804cf,_0x4ddbd2){return function(_0x366e9b){if(_0x366e9b){return _0x366e9b['update'](_0x4804cf)[_0x66c7('0x21')](function(_0x8b96b1){return _0x8b96b1;});}return null;};}function removeEntity(_0x44bdef,_0x1fc9d3){return function(_0x5bfaf6){if(_0x5bfaf6){return _0x5bfaf6[_0x66c7('0x22')]()[_0x66c7('0x21')](function(){var _0x5b28e6=_0x5bfaf6[_0x66c7('0x23')]({'plain':!![]});var _0x11a6b9=_0x66c7('0x24');return db[_0x66c7('0x25')][_0x66c7('0x22')]({'where':{'type':_0x11a6b9,'resourceId':_0x5b28e6['id']}})['then'](function(){return _0x5bfaf6;});})['then'](function(){_0x44bdef['status'](0xcc)[_0x66c7('0x19')]();});}};}function handleEntityNotFound(_0x542ff1,_0x5c5e42){return function(_0x9afd50){if(!_0x9afd50){_0x542ff1[_0x66c7('0x17')](0x194);}return _0x9afd50;};}function handleError(_0x205b7e,_0xb4b65b){_0xb4b65b=_0xb4b65b||0x1f4;return function(_0x36a830){logger[_0x66c7('0x26')](_0x36a830['stack']);if(_0x36a830[_0x66c7('0x27')]){delete _0x36a830[_0x66c7('0x27')];}_0x205b7e[_0x66c7('0x18')](_0xb4b65b)[_0x66c7('0x28')](_0x36a830);};}exports[_0x66c7('0x29')]=function(_0x592f0e,_0x263b48){var _0x4f1a34={},_0xfbd97={},_0x543fbf={'count':0x0,'rows':[]};var _0x296875=_[_0x66c7('0x2a')](db[_0x66c7('0x2b')][_0x66c7('0x2c')],function(_0xb26028){return{'name':_0xb26028[_0x66c7('0x2d')],'type':_0xb26028['type']['key']};});_0xfbd97[_0x66c7('0x2e')]=_[_0x66c7('0x2a')](_0x296875,_0x66c7('0x27'));_0xfbd97[_0x66c7('0x2f')]=_[_0x66c7('0x30')](_0x592f0e[_0x66c7('0x2f')]);_0xfbd97[_0x66c7('0x31')]=_[_0x66c7('0x32')](_0xfbd97[_0x66c7('0x2e')],_0xfbd97[_0x66c7('0x2f')]);_0x4f1a34[_0x66c7('0x33')]=_[_0x66c7('0x32')](_0xfbd97['model'],qs['fields'](_0x592f0e[_0x66c7('0x2f')][_0x66c7('0x34')]));_0x4f1a34[_0x66c7('0x33')]=_0x4f1a34[_0x66c7('0x33')][_0x66c7('0x35')]?_0x4f1a34[_0x66c7('0x33')]:_0xfbd97[_0x66c7('0x2e')];if(!_0x592f0e['query'][_0x66c7('0x36')](_0x66c7('0x37'))){_0x4f1a34[_0x66c7('0x1c')]=qs[_0x66c7('0x1c')](_0x592f0e[_0x66c7('0x2f')][_0x66c7('0x1c')]);_0x4f1a34[_0x66c7('0x1a')]=qs[_0x66c7('0x1a')](_0x592f0e[_0x66c7('0x2f')][_0x66c7('0x1a')]);}_0x4f1a34[_0x66c7('0x38')]=qs['sort'](_0x592f0e['query'][_0x66c7('0x39')]);_0x4f1a34[_0x66c7('0x3a')]=qs[_0x66c7('0x31')](_['pick'](_0x592f0e['query'],_0xfbd97[_0x66c7('0x31')]),_0x296875);if(_0x592f0e[_0x66c7('0x2f')]['filter']){_0x4f1a34[_0x66c7('0x3a')]=_[_0x66c7('0x3b')](_0x4f1a34[_0x66c7('0x3a')],{'$or':_['map'](_0x296875,function(_0x20374a){if(_0x20374a[_0x66c7('0x3c')]!==_0x66c7('0x3d')){var _0x14d59c={};_0x14d59c[_0x20374a[_0x66c7('0x27')]]={'$like':'%'+_0x592f0e[_0x66c7('0x2f')][_0x66c7('0x3e')]+'%'};return _0x14d59c;}})});}_0x4f1a34=_[_0x66c7('0x3b')]({},_0x4f1a34,_0x592f0e[_0x66c7('0x3f')]);var _0x5f34ed={'where':_0x4f1a34[_0x66c7('0x3a')]};return db[_0x66c7('0x2b')][_0x66c7('0x40')](_0x5f34ed)[_0x66c7('0x21')](function(_0x3f169e){_0x543fbf[_0x66c7('0x40')]=_0x3f169e;if(_0x592f0e[_0x66c7('0x2f')][_0x66c7('0x41')]){_0x4f1a34[_0x66c7('0x42')]=[{'all':!![]}];}return db[_0x66c7('0x2b')]['findAll'](_0x4f1a34);})['then'](function(_0x528f5c){_0x543fbf[_0x66c7('0x43')]=_0x528f5c;return _0x543fbf;})[_0x66c7('0x21')](respondWithFilteredResult(_0x263b48,_0x4f1a34))['catch'](handleError(_0x263b48,null));};exports['show']=function(_0x34d002,_0x3cd3ab){var _0x44d637={'raw':!![],'where':{'id':_0x34d002[_0x66c7('0x44')]['id']}},_0x900ee7={};_0x900ee7['model']=_[_0x66c7('0x30')](db['VoiceMail']['rawAttributes']);_0x900ee7[_0x66c7('0x2f')]=_[_0x66c7('0x30')](_0x34d002[_0x66c7('0x2f')]);_0x900ee7[_0x66c7('0x31')]=_['intersection'](_0x900ee7['model'],_0x900ee7[_0x66c7('0x2f')]);_0x44d637['attributes']=_['intersection'](_0x900ee7[_0x66c7('0x2e')],qs[_0x66c7('0x34')](_0x34d002[_0x66c7('0x2f')][_0x66c7('0x34')]));_0x44d637['attributes']=_0x44d637[_0x66c7('0x33')][_0x66c7('0x35')]?_0x44d637[_0x66c7('0x33')]:_0x900ee7['model'];if(_0x34d002[_0x66c7('0x2f')][_0x66c7('0x41')]){_0x44d637[_0x66c7('0x42')]=[{'all':!![]}];}_0x44d637=_[_0x66c7('0x3b')]({},_0x44d637,_0x34d002[_0x66c7('0x3f')]);return db[_0x66c7('0x2b')][_0x66c7('0x45')](_0x44d637)[_0x66c7('0x21')](handleEntityNotFound(_0x3cd3ab,null))['then'](respondWithResult(_0x3cd3ab,null))[_0x66c7('0x46')](handleError(_0x3cd3ab,null));};exports[_0x66c7('0x47')]=function(_0x23d0eb,_0x1386a2){return db[_0x66c7('0x2b')][_0x66c7('0x47')](_0x23d0eb[_0x66c7('0x48')],{})[_0x66c7('0x21')](function(_0x1b3dc2){var _0x2d8eeb=_0x23d0eb[_0x66c7('0x49')][_0x66c7('0x23')]({'plain':!![]});if(!_0x2d8eeb)throw new Error(_0x66c7('0x4a'));if(_0x2d8eeb[_0x66c7('0x4b')]==='user'){var _0x43d4db=_0x1b3dc2[_0x66c7('0x23')]({'plain':!![]});var _0x27070b=_0x66c7('0x24');return db['UserProfileSection'][_0x66c7('0x45')]({'where':{'name':_0x27070b,'userProfileId':_0x2d8eeb[_0x66c7('0x4c')]},'raw':!![]})['then'](function(_0x275a20){if(_0x275a20&&_0x275a20[_0x66c7('0x4d')]===0x0){return db[_0x66c7('0x25')][_0x66c7('0x47')]({'name':_0x43d4db[_0x66c7('0x27')],'resourceId':_0x43d4db['id'],'type':_0x275a20[_0x66c7('0x27')],'sectionId':_0x275a20['id']},{})[_0x66c7('0x21')](function(){return _0x1b3dc2;});}else{return _0x1b3dc2;}})['catch'](function(_0x933dd6){logger[_0x66c7('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x933dd6);throw _0x933dd6;});}return _0x1b3dc2;})[_0x66c7('0x21')](respondWithResult(_0x1386a2,0xc9))[_0x66c7('0x46')](handleError(_0x1386a2,null));};exports[_0x66c7('0x4e')]=function(_0x5df6d1,_0x382a48){if(_0x5df6d1[_0x66c7('0x48')]['id']){delete _0x5df6d1[_0x66c7('0x48')]['id'];}return db[_0x66c7('0x2b')][_0x66c7('0x45')]({'where':{'id':_0x5df6d1[_0x66c7('0x44')]['id']}})[_0x66c7('0x21')](handleEntityNotFound(_0x382a48,null))[_0x66c7('0x21')](saveUpdates(_0x5df6d1['body'],null))[_0x66c7('0x21')](respondWithResult(_0x382a48,null))[_0x66c7('0x46')](handleError(_0x382a48,null));};exports['destroy']=function(_0x23f865,_0x167968){return db[_0x66c7('0x2b')]['find']({'where':{'id':_0x23f865['params']['id']}})[_0x66c7('0x21')](handleEntityNotFound(_0x167968,null))['then'](removeEntity(_0x167968,null))[_0x66c7('0x46')](handleError(_0x167968,null));};exports[_0x66c7('0x4f')]=function(_0x45e5a2,_0x106b1e,_0xebff6b){return db[_0x66c7('0x2b')]['findOne']({'where':{'id':_0x45e5a2['params']['id']}})[_0x66c7('0x21')](handleEntityNotFound(_0x106b1e,null))[_0x66c7('0x21')](function(_0x5e6e32){var _0x5a4908;var _0x157369={},_0x5004aa={};_0x5004aa[_0x66c7('0x2e')]=_[_0x66c7('0x30')](db[_0x66c7('0x50')][_0x66c7('0x2c')]);_0x5004aa['query']=_[_0x66c7('0x30')](_0x45e5a2[_0x66c7('0x2f')]);_0x5004aa[_0x66c7('0x31')]=_[_0x66c7('0x32')](_0x5004aa[_0x66c7('0x2e')],_0x5004aa[_0x66c7('0x2f')]);_0x157369['attributes']=_[_0x66c7('0x32')](_0x5004aa[_0x66c7('0x2e')],qs[_0x66c7('0x34')](_0x45e5a2['query'][_0x66c7('0x34')]));_0x157369['attributes']=_0x157369[_0x66c7('0x33')][_0x66c7('0x35')]?_0x157369[_0x66c7('0x33')]:_0x5004aa[_0x66c7('0x2e')];if(!_0x45e5a2[_0x66c7('0x2f')][_0x66c7('0x36')]('nolimit')){_0x157369[_0x66c7('0x1c')]=qs[_0x66c7('0x1c')](_0x45e5a2[_0x66c7('0x2f')][_0x66c7('0x1c')]);_0x157369[_0x66c7('0x1a')]=qs['offset'](_0x45e5a2[_0x66c7('0x2f')][_0x66c7('0x1a')]);}_0x157369[_0x66c7('0x38')]=qs[_0x66c7('0x39')](_0x45e5a2[_0x66c7('0x2f')][_0x66c7('0x39')]);_0x157369[_0x66c7('0x3a')]=qs[_0x66c7('0x31')](_[_0x66c7('0x51')](_0x45e5a2[_0x66c7('0x2f')],_0x5004aa[_0x66c7('0x31')]));if(_0x45e5a2[_0x66c7('0x2f')]['filter']){_0x157369[_0x66c7('0x3a')]=_[_0x66c7('0x3b')](_0x157369[_0x66c7('0x3a')],{'$or':_[_0x66c7('0x2a')](_0x157369[_0x66c7('0x33')],function(_0x419b49){var _0x237d7a={};_0x237d7a[_0x419b49]={'$like':'%'+_0x45e5a2['query'][_0x66c7('0x3e')]+'%'};return _0x237d7a;})});}_0x157369[_0x66c7('0x3a')]=_[_0x66c7('0x3b')](_0x157369[_0x66c7('0x3a')],{'mailboxuser':_0x5e6e32[_0x66c7('0x52')]});_0x157369=_[_0x66c7('0x3b')]({},_0x157369,_0x45e5a2[_0x66c7('0x3f')]);return db[_0x66c7('0x50')][_0x66c7('0x53')](_0x157369)[_0x66c7('0x21')](respondWithFilteredResult(_0x106b1e,_0x157369));})[_0x66c7('0x46')](handleError(_0x106b1e,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index fc61e13..a8a1da9 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 _0x92e2=['exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','../../config/logger','api','moment','bluebird','path','../../config/environment','./voiceMail.attributes'];(function(_0x5606ad,_0x3b265b){var _0x1ee1b0=function(_0x123753){while(--_0x123753){_0x5606ad['push'](_0x5606ad['shift']());}};_0x1ee1b0(++_0x3b265b);}(_0x92e2,0x1b9));var _0x292e=function(_0x39de58,_0x158a4c){_0x39de58=_0x39de58-0x0;var _0x5ce2d1=_0x92e2[_0x39de58];return _0x5ce2d1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x292e('0x0'))(_0x292e('0x1'));var moment=require(_0x292e('0x2'));var BPromise=require(_0x292e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x292e('0x4'));var rimraf=require('rimraf');var config=require(_0x292e('0x5'));var attributes=require(_0x292e('0x6'));module[_0x292e('0x7')]=function(_0x1afe01,_0x58f790){return _0x1afe01[_0x292e('0x8')](_0x292e('0x9'),attributes,{'tableName':_0x292e('0xa'),'paranoid':![],'indexes':[{'name':_0x292e('0xb'),'fields':[_0x292e('0xc'),_0x292e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa527=['request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','define','VoiceMail','voice_voicemail','mailbox_context','context','lodash','util','../../config/logger','api','bluebird'];(function(_0x1d30b8,_0x20f46f){var _0x51874b=function(_0x429241){while(--_0x429241){_0x1d30b8['push'](_0x1d30b8['shift']());}};_0x51874b(++_0x20f46f);}(_0xa527,0x109));var _0x7a52=function(_0x2cee2b,_0x248339){_0x2cee2b=_0x2cee2b-0x0;var _0x1114d0=_0xa527[_0x2cee2b];return _0x1114d0;};'use strict';var _=require(_0x7a52('0x0'));var util=require(_0x7a52('0x1'));var logger=require(_0x7a52('0x2'))(_0x7a52('0x3'));var moment=require('moment');var BPromise=require(_0x7a52('0x4'));var rp=require(_0x7a52('0x5'));var fs=require('fs');var path=require(_0x7a52('0x6'));var rimraf=require(_0x7a52('0x7'));var config=require(_0x7a52('0x8'));var attributes=require(_0x7a52('0x9'));module['exports']=function(_0x5adaf6,_0x3e3a00){return _0x5adaf6[_0x7a52('0xa')](_0x7a52('0xb'),attributes,{'tableName':_0x7a52('0xc'),'paranoid':![],'indexes':[{'name':_0x7a52('0xd'),'fields':['mailbox',_0x7a52('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index f2fefd0..8b9f747 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 _0x30a9=['request\x20sent','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x30a9,0xf8));var _0x930a=function(_0x3088e3,_0x11c19e){_0x3088e3=_0x3088e3-0x0;var _0x40da97=_0x30a9[_0x3088e3];return _0x40da97;};'use strict';var _=require(_0x930a('0x0'));var util=require(_0x930a('0x1'));var moment=require(_0x930a('0x2'));var BPromise=require('bluebird');var rs=require(_0x930a('0x3'));var fs=require('fs');var Redis=require(_0x930a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x930a('0x5'));var logger=require(_0x930a('0x6'))(_0x930a('0x7'));var config=require('../../config/environment');var jayson=require(_0x930a('0x8'));var client=jayson['client'][_0x930a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x51d40,_0x159fdc,_0xe62f1a){return new BPromise(function(_0x856d68,_0x2bb244){return client[_0x930a('0xa')](_0x51d40,_0xe62f1a)[_0x930a('0xb')](function(_0x33e20e){logger[_0x930a('0xc')](_0x930a('0xd'),_0x159fdc,'request\x20sent');logger[_0x930a('0xe')](_0x930a('0xf'),_0x159fdc,_0x930a('0x10'),JSON['stringify'](_0x33e20e));if(_0x33e20e['error']){if(_0x33e20e[_0x930a('0x11')][_0x930a('0x12')]===0x1f4){logger[_0x930a('0x11')](_0x930a('0xd'),_0x159fdc,_0x33e20e[_0x930a('0x11')][_0x930a('0x13')]);return _0x2bb244(_0x33e20e[_0x930a('0x11')][_0x930a('0x13')]);}logger['error'](_0x930a('0xd'),_0x159fdc,_0x33e20e['error'][_0x930a('0x13')]);return _0x856d68(_0x33e20e[_0x930a('0x11')][_0x930a('0x13')]);}else{logger[_0x930a('0xc')](_0x930a('0xd'),_0x159fdc,'request\x20sent');_0x856d68(_0x33e20e[_0x930a('0x14')][_0x930a('0x13')]);}})[_0x930a('0x15')](function(_0x45b98a){logger[_0x930a('0x11')](_0x930a('0xd'),_0x159fdc,_0x45b98a);_0x2bb244(_0x45b98a);});});} \ No newline at end of file +var _0x32c0=['debug','VoiceMail,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent'];(function(_0x3145af,_0x53a1d5){var _0x37758a=function(_0x4b1627){while(--_0x4b1627){_0x3145af['push'](_0x3145af['shift']());}};_0x37758a(++_0x53a1d5);}(_0x32c0,0x91));var _0x032c=function(_0x4f9884,_0x1939c3){_0x4f9884=_0x4f9884-0x0;var _0x1e2fcc=_0x32c0[_0x4f9884];return _0x1e2fcc;};'use strict';var _=require(_0x032c('0x0'));var util=require(_0x032c('0x1'));var moment=require('moment');var BPromise=require(_0x032c('0x2'));var rs=require(_0x032c('0x3'));var fs=require('fs');var Redis=require(_0x032c('0x4'));var db=require(_0x032c('0x5'))['db'];var utils=require(_0x032c('0x6'));var logger=require('../../config/logger')(_0x032c('0x7'));var config=require(_0x032c('0x8'));var jayson=require(_0x032c('0x9'));var client=jayson['client'][_0x032c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c794d,_0x10b22e,_0x7995b4){return new BPromise(function(_0x59973c,_0xb17c35){return client[_0x032c('0xb')](_0x2c794d,_0x7995b4)[_0x032c('0xc')](function(_0x256939){logger[_0x032c('0xd')](_0x032c('0xe'),_0x10b22e,_0x032c('0xf'));logger[_0x032c('0x10')](_0x032c('0x11'),_0x10b22e,_0x032c('0xf'),JSON['stringify'](_0x256939));if(_0x256939['error']){if(_0x256939['error'][_0x032c('0x12')]===0x1f4){logger[_0x032c('0x13')](_0x032c('0xe'),_0x10b22e,_0x256939[_0x032c('0x13')][_0x032c('0x14')]);return _0xb17c35(_0x256939[_0x032c('0x13')]['message']);}logger['error'](_0x032c('0xe'),_0x10b22e,_0x256939[_0x032c('0x13')]['message']);return _0x59973c(_0x256939[_0x032c('0x13')][_0x032c('0x14')]);}else{logger[_0x032c('0xd')]('VoiceMail,\x20%s,\x20%s',_0x10b22e,'request\x20sent');_0x59973c(_0x256939[_0x032c('0x15')][_0x032c('0x14')]);}})[_0x032c('0x16')](function(_0x248632){logger[_0x032c('0x13')]('VoiceMail,\x20%s,\x20%s',_0x10b22e,_0x248632);_0xb17c35(_0x248632);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index dab8723..e833a34 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 _0x60bc=['download','post','create','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','index','/:id','isAuthenticated','show','/:id/download'];(function(_0x4740d6,_0x4284c9){var _0x57e851=function(_0x1fc74c){while(--_0x1fc74c){_0x4740d6['push'](_0x4740d6['shift']());}};_0x57e851(++_0x4284c9);}(_0x60bc,0x133));var _0xc60b=function(_0x50cd41,_0x4874a7){_0x50cd41=_0x50cd41-0x0;var _0x399475=_0x60bc[_0x50cd41];return _0x399475;};'use strict';var multer=require('multer');var util=require(_0xc60b('0x0'));var path=require(_0xc60b('0x1'));var timeout=require('connect-timeout');var express=require(_0xc60b('0x2'));var router=express[_0xc60b('0x3')]();var fs_extra=require(_0xc60b('0x4'));var auth=require(_0xc60b('0x5'));var interaction=require(_0xc60b('0x6'));var config=require(_0xc60b('0x7'));var controller=require(_0xc60b('0x8'));router[_0xc60b('0x9')]('/',auth['isAuthenticated'](),controller[_0xc60b('0xa')]);router['get'](_0xc60b('0xb'),auth[_0xc60b('0xc')](),controller[_0xc60b('0xd')]);router['get'](_0xc60b('0xe'),auth['isAuthenticated'](),controller[_0xc60b('0xf')]);router[_0xc60b('0x10')]('/',auth[_0xc60b('0xc')](),controller[_0xc60b('0x11')]);router[_0xc60b('0x12')]('/:id',auth[_0xc60b('0xc')](),controller[_0xc60b('0x13')]);router[_0xc60b('0x14')](_0xc60b('0xb'),auth[_0xc60b('0xc')](),controller[_0xc60b('0x15')]);module[_0xc60b('0x16')]=router; \ No newline at end of file +var _0x491e=['destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create','put','update','delete'];(function(_0x57bea2,_0x565e1b){var _0x3afebe=function(_0x595a71){while(--_0x595a71){_0x57bea2['push'](_0x57bea2['shift']());}};_0x3afebe(++_0x565e1b);}(_0x491e,0x1a4));var _0xe491=function(_0x48e1ec,_0x35f468){_0x48e1ec=_0x48e1ec-0x0;var _0x3b33eb=_0x491e[_0x48e1ec];return _0x3b33eb;};'use strict';var multer=require(_0xe491('0x0'));var util=require('util');var path=require(_0xe491('0x1'));var timeout=require(_0xe491('0x2'));var express=require('express');var router=express[_0xe491('0x3')]();var fs_extra=require(_0xe491('0x4'));var auth=require(_0xe491('0x5'));var interaction=require(_0xe491('0x6'));var config=require(_0xe491('0x7'));var controller=require('./voiceMailMessage.controller');router[_0xe491('0x8')]('/',auth['isAuthenticated'](),controller[_0xe491('0x9')]);router[_0xe491('0x8')](_0xe491('0xa'),auth[_0xe491('0xb')](),controller[_0xe491('0xc')]);router[_0xe491('0x8')](_0xe491('0xd'),auth[_0xe491('0xb')](),controller[_0xe491('0xe')]);router[_0xe491('0xf')]('/',auth[_0xe491('0xb')](),controller[_0xe491('0x10')]);router[_0xe491('0x11')]('/:id',auth[_0xe491('0xb')](),controller[_0xe491('0x12')]);router[_0xe491('0x13')](_0xe491('0xa'),auth[_0xe491('0xb')](),controller[_0xe491('0x14')]);module[_0xe491('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index ce59054..6573f90 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 _0xd029=['STRING','BLOB','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x22bf74,_0x13feab){var _0x1f97e8=function(_0x1ede80){while(--_0x1ede80){_0x22bf74['push'](_0x22bf74['shift']());}};_0x1f97e8(++_0x13feab);}(_0xd029,0xb0));var _0x9d02=function(_0x37d18e,_0x319a6f){_0x37d18e=_0x37d18e-0x0;var _0x30c476=_0xd029[_0x37d18e];return _0x30c476;};'use strict';var Sequelize=require(_0x9d02('0x0'));module[_0x9d02('0x1')]={'name':{'type':Sequelize[_0x9d02('0x2')],'get':function(_0x158b30){return this[_0x9d02('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x9d02('0x4')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x9d02('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x9d02('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x9d02('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x9d02('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x9d02('0x5')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x9d02('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x9d02('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x273f=['STRING','BLOB','TIMESTAMP','literal','exports','getDataValue','INTEGER'];(function(_0x51f812,_0x36212c){var _0x1ad290=function(_0x1f03b7){while(--_0x1f03b7){_0x51f812['push'](_0x51f812['shift']());}};_0x1ad290(++_0x36212c);}(_0x273f,0x10e));var _0xf273=function(_0x174ffa,_0x3e2924){_0x174ffa=_0x174ffa-0x0;var _0x30d5a4=_0x273f[_0x174ffa];return _0x30d5a4;};'use strict';var Sequelize=require('sequelize');module[_0xf273('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xc51d09){return this[_0xf273('0x1')]('id');}},'msgnum':{'type':Sequelize[_0xf273('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xf273('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0xf273('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xf273('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0xf273('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0xf273('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xf273('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xf273('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0xf273('0x4')]('long'),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0xf273('0x5'),'defaultValue':Sequelize[_0xf273('0x6')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index e871a47..155dabd 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 _0xf5c3=['type','model','differenceBy','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','rawAttributes','find','create','body','params','download','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','send','index','map','VoiceMailMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf5c3,0x1e0));var _0x3f5c=function(_0x490d36,_0x1693be){_0x490d36=_0x490d36-0x0;var _0x322bd7=_0xf5c3[_0x490d36];return _0x322bd7;};'use strict';var emlformat=require(_0x3f5c('0x0'));var rimraf=require(_0x3f5c('0x1'));var zipdir=require(_0x3f5c('0x2'));var jsonpatch=require(_0x3f5c('0x3'));var rp=require(_0x3f5c('0x4'));var moment=require(_0x3f5c('0x5'));var BPromise=require(_0x3f5c('0x6'));var Mustache=require(_0x3f5c('0x7'));var util=require('util');var path=require(_0x3f5c('0x8'));var sox=require(_0x3f5c('0x9'));var csv=require(_0x3f5c('0xa'));var ejs=require(_0x3f5c('0xb'));var fs=require('fs');var fs_extra=require(_0x3f5c('0xc'));var _=require(_0x3f5c('0xd'));var squel=require(_0x3f5c('0xe'));var crypto=require(_0x3f5c('0xf'));var jsforce=require(_0x3f5c('0x10'));var deskjs=require(_0x3f5c('0x11'));var toCsv=require(_0x3f5c('0xa'));var querystring=require(_0x3f5c('0x12'));var Papa=require(_0x3f5c('0x13'));var Redis=require('ioredis');var authService=require(_0x3f5c('0x14'));var qs=require(_0x3f5c('0x15'));var as=require(_0x3f5c('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3f5c('0x17'))(_0x3f5c('0x18'));var utils=require(_0x3f5c('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4af4cc,_0x3b20e8){_0x3b20e8=_0x3b20e8||0xcc;return function(_0x1be004){if(_0x1be004){return _0x4af4cc[_0x3f5c('0x1a')](_0x3b20e8);}return _0x4af4cc['status'](_0x3b20e8)['end']();};}function respondWithResult(_0x5b7eb9,_0x20938e){_0x20938e=_0x20938e||0xc8;return function(_0x5b1c98){if(_0x5b1c98){return _0x5b7eb9['status'](_0x20938e)[_0x3f5c('0x1b')](_0x5b1c98);}};}function respondWithFilteredResult(_0x510106,_0x523924){return function(_0x33be16){if(_0x33be16){var _0x458098=typeof _0x523924[_0x3f5c('0x1c')]===_0x3f5c('0x1d')&&typeof _0x523924[_0x3f5c('0x1e')]===_0x3f5c('0x1d');var _0x2b75ca=_0x33be16['count'];var _0x5852b6=_0x458098?0x0:_0x523924[_0x3f5c('0x1c')];var _0x6caf5=_0x458098?_0x33be16[_0x3f5c('0x1f')]:_0x523924[_0x3f5c('0x1c')]+_0x523924[_0x3f5c('0x1e')];var _0x47f8eb;if(_0x6caf5>=_0x2b75ca){_0x6caf5=_0x2b75ca;_0x47f8eb=0xc8;}else{_0x47f8eb=0xce;}_0x510106[_0x3f5c('0x20')](_0x47f8eb);return _0x510106[_0x3f5c('0x21')](_0x3f5c('0x22'),_0x5852b6+'-'+_0x6caf5+'/'+_0x2b75ca)[_0x3f5c('0x1b')](_0x33be16);}return null;};}function patchUpdates(_0x26dd38){return function(_0x5c9739){try{jsonpatch[_0x3f5c('0x23')](_0x5c9739,_0x26dd38,!![]);}catch(_0x109fcb){return BPromise[_0x3f5c('0x24')](_0x109fcb);}return _0x5c9739[_0x3f5c('0x25')]();};}function saveUpdates(_0x2bfcde,_0x15939b){return function(_0x4088b3){if(_0x4088b3){return _0x4088b3[_0x3f5c('0x26')](_0x2bfcde)['then'](function(_0xf66c3e){return _0xf66c3e;});}return null;};}function removeEntity(_0xeafb43,_0x10785e){return function(_0x1628e9){if(_0x1628e9){return _0x1628e9[_0x3f5c('0x27')]()[_0x3f5c('0x28')](function(){_0xeafb43[_0x3f5c('0x20')](0xcc)[_0x3f5c('0x29')]();});}};}function handleEntityNotFound(_0x3325de,_0x17b328){return function(_0x2d13dc){if(!_0x2d13dc){_0x3325de[_0x3f5c('0x1a')](0x194);}return _0x2d13dc;};}function handleError(_0x95126f,_0x3496dc){_0x3496dc=_0x3496dc||0x1f4;return function(_0x5c7db1){logger[_0x3f5c('0x2a')](_0x5c7db1[_0x3f5c('0x2b')]);if(_0x5c7db1['name']){delete _0x5c7db1['name'];}_0x95126f['status'](_0x3496dc)[_0x3f5c('0x2c')](_0x5c7db1);};}exports[_0x3f5c('0x2d')]=function(_0x1c7d6b,_0x20ee86){var _0x599de0={},_0x2ccbd3={},_0xb73dee={'count':0x0,'rows':[]};var _0x1dbed9=_[_0x3f5c('0x2e')](db[_0x3f5c('0x2f')]['rawAttributes'],function(_0x595c50){return{'name':_0x595c50['fieldName'],'type':_0x595c50[_0x3f5c('0x30')]['key']};});_0x2ccbd3[_0x3f5c('0x31')]=_[_0x3f5c('0x32')](_['map'](_0x1dbed9,_0x3f5c('0x33')),[_0x3f5c('0x33')]);_0x2ccbd3[_0x3f5c('0x34')]=_[_0x3f5c('0x35')](_0x1c7d6b[_0x3f5c('0x34')]);_0x2ccbd3[_0x3f5c('0x36')]=_[_0x3f5c('0x37')](_0x2ccbd3[_0x3f5c('0x31')],_0x2ccbd3['query']);_0x599de0[_0x3f5c('0x38')]=_[_0x3f5c('0x37')](_0x2ccbd3['model'],qs['fields'](_0x1c7d6b[_0x3f5c('0x34')][_0x3f5c('0x39')]));_0x599de0[_0x3f5c('0x38')]=_0x599de0[_0x3f5c('0x38')][_0x3f5c('0x3a')]?_0x599de0[_0x3f5c('0x38')]:_0x2ccbd3['model'];if(!_0x1c7d6b[_0x3f5c('0x34')][_0x3f5c('0x3b')](_0x3f5c('0x3c'))){_0x599de0['limit']=qs[_0x3f5c('0x1e')](_0x1c7d6b['query']['limit']);_0x599de0[_0x3f5c('0x1c')]=qs[_0x3f5c('0x1c')](_0x1c7d6b[_0x3f5c('0x34')][_0x3f5c('0x1c')]);}_0x599de0[_0x3f5c('0x3d')]=qs[_0x3f5c('0x3e')](_0x1c7d6b[_0x3f5c('0x34')][_0x3f5c('0x3e')]);_0x599de0[_0x3f5c('0x3f')]=qs['filters'](_[_0x3f5c('0x40')](_0x1c7d6b['query'],_0x2ccbd3[_0x3f5c('0x36')]),_0x1dbed9);if(_0x1c7d6b[_0x3f5c('0x34')][_0x3f5c('0x41')]){_0x599de0['where']=_[_0x3f5c('0x42')](_0x599de0[_0x3f5c('0x3f')],{'$or':_[_0x3f5c('0x2e')](_0x1dbed9,function(_0x1cea16){if(_0x1cea16[_0x3f5c('0x30')]!==_0x3f5c('0x43')){var _0x468a6e={};_0x468a6e[_0x1cea16[_0x3f5c('0x33')]]={'$like':'%'+_0x1c7d6b[_0x3f5c('0x34')][_0x3f5c('0x41')]+'%'};return _0x468a6e;}})});}_0x599de0=_[_0x3f5c('0x42')]({},_0x599de0,_0x1c7d6b['options']);var _0x178287={'where':_0x599de0[_0x3f5c('0x3f')]};return db['VoiceMailMessage']['count'](_0x178287)['then'](function(_0xecabc0){_0xb73dee['count']=_0xecabc0;if(_0x1c7d6b['query'][_0x3f5c('0x44')]){_0x599de0[_0x3f5c('0x45')]=[{'all':!![]}];}return db[_0x3f5c('0x2f')]['findAll'](_0x599de0);})['then'](function(_0x528ad9){_0xb73dee[_0x3f5c('0x46')]=_0x528ad9;return _0xb73dee;})[_0x3f5c('0x28')](respondWithFilteredResult(_0x20ee86,_0x599de0))[_0x3f5c('0x47')](handleError(_0x20ee86,null));};exports[_0x3f5c('0x48')]=function(_0x26087d,_0x3e5756){var _0x67dbbe={'raw':!![],'where':{'id':_0x26087d['params']['id']}},_0x700310={};_0x700310[_0x3f5c('0x31')]=_['keys'](db[_0x3f5c('0x2f')][_0x3f5c('0x49')]);_0x700310['query']=_[_0x3f5c('0x35')](_0x26087d['query']);_0x700310[_0x3f5c('0x36')]=_['intersection'](_0x700310['model'],_0x700310['query']);_0x67dbbe['attributes']=_[_0x3f5c('0x37')](_0x700310[_0x3f5c('0x31')],qs[_0x3f5c('0x39')](_0x26087d[_0x3f5c('0x34')][_0x3f5c('0x39')]));_0x67dbbe[_0x3f5c('0x38')]=_0x67dbbe['attributes'][_0x3f5c('0x3a')]?_0x67dbbe[_0x3f5c('0x38')]:_0x700310[_0x3f5c('0x31')];if(_0x26087d[_0x3f5c('0x34')][_0x3f5c('0x44')]){_0x67dbbe['include']=[{'all':!![]}];}_0x67dbbe=_[_0x3f5c('0x42')]({},_0x67dbbe,_0x26087d['options']);return db[_0x3f5c('0x2f')][_0x3f5c('0x4a')](_0x67dbbe)[_0x3f5c('0x28')](handleEntityNotFound(_0x3e5756,null))[_0x3f5c('0x28')](respondWithResult(_0x3e5756,null))[_0x3f5c('0x47')](handleError(_0x3e5756,null));};exports[_0x3f5c('0x4b')]=function(_0x3d4d90,_0xfcd15e){return db['VoiceMailMessage'][_0x3f5c('0x4b')](_0x3d4d90['body'],{})[_0x3f5c('0x28')](respondWithResult(_0xfcd15e,0xc9))[_0x3f5c('0x47')](handleError(_0xfcd15e,null));};exports[_0x3f5c('0x26')]=function(_0xbe44c2,_0x46a80d){if(_0xbe44c2[_0x3f5c('0x4c')]['id']){delete _0xbe44c2[_0x3f5c('0x4c')]['id'];}return db[_0x3f5c('0x2f')][_0x3f5c('0x4a')]({'where':{'id':_0xbe44c2[_0x3f5c('0x4d')]['id']}})[_0x3f5c('0x28')](handleEntityNotFound(_0x46a80d,null))[_0x3f5c('0x28')](saveUpdates(_0xbe44c2[_0x3f5c('0x4c')],null))['then'](respondWithResult(_0x46a80d,null))[_0x3f5c('0x47')](handleError(_0x46a80d,null));};exports[_0x3f5c('0x27')]=function(_0x400317,_0x12446c){return db[_0x3f5c('0x2f')][_0x3f5c('0x4a')]({'where':{'id':_0x400317['params']['id']}})[_0x3f5c('0x28')](handleEntityNotFound(_0x12446c,null))[_0x3f5c('0x28')](removeEntity(_0x12446c,null))[_0x3f5c('0x47')](handleError(_0x12446c,null));};exports[_0x3f5c('0x4e')]=function(_0x82cb59,_0x5daff5,_0x263305){return db['VoiceMailMessage'][_0x3f5c('0x4a')]({'where':{'id':_0x82cb59['params']['id']},'attributes':['id',_0x3f5c('0x4f'),_0x3f5c('0x50')]})[_0x3f5c('0x28')](handleEntityNotFound(_0x5daff5,null))['then'](function(_0x1d6d7c){if(_0x1d6d7c){if(!_0x1d6d7c[_0x3f5c('0x4f')]){throw new db['Sequelize'][(_0x3f5c('0x51'))](_0x3f5c('0x52'));}var _0xe81219={'Content-Type':_0x3f5c('0x53'),'Content-Disposition':_0x3f5c('0x54')};if(_0x1d6d7c['msg_id']){_0xe81219[_0x3f5c('0x55')]=_0x3f5c('0x56')+_0x1d6d7c[_0x3f5c('0x50')]+_0x3f5c('0x57');}_0x5daff5[_0x3f5c('0x21')](_0xe81219);return _0x5daff5[_0x3f5c('0x2c')](new Buffer(_0x1d6d7c[_0x3f5c('0x4f')]));}})['catch'](handleError(_0x5daff5,null));}; \ No newline at end of file +var _0xdd28=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','error','stack','index','VoiceMailMessage','rawAttributes','type','key','model','differenceBy','map','name','query','keys','filters','attributes','intersection','order','sort','where','filter','merge','count','include','findAll','then','rows','catch','show','params','fields','length','includeAll','options','find','create','body','download','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','attachment;\x20filename=\x22','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x5ad29a,_0x47278f){var _0xa19d5e=function(_0x28efb7){while(--_0x28efb7){_0x5ad29a['push'](_0x5ad29a['shift']());}};_0xa19d5e(++_0x47278f);}(_0xdd28,0x16c));var _0x8dd2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd28[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8dd2('0x0'));var zipdir=require(_0x8dd2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8dd2('0x2'));var moment=require(_0x8dd2('0x3'));var BPromise=require(_0x8dd2('0x4'));var Mustache=require(_0x8dd2('0x5'));var util=require('util');var path=require(_0x8dd2('0x6'));var sox=require(_0x8dd2('0x7'));var csv=require(_0x8dd2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8dd2('0x9'));var jsforce=require(_0x8dd2('0xa'));var deskjs=require(_0x8dd2('0xb'));var toCsv=require(_0x8dd2('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8dd2('0xc'));var as=require(_0x8dd2('0xd'));var hardwareService=require(_0x8dd2('0xe'));var logger=require('../../config/logger')(_0x8dd2('0xf'));var utils=require(_0x8dd2('0x10'));var config=require(_0x8dd2('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x8dd2('0x12'))['db'];function respondWithStatusCode(_0x4921d5,_0x334913){_0x334913=_0x334913||0xcc;return function(_0x7af09e){if(_0x7af09e){return _0x4921d5[_0x8dd2('0x13')](_0x334913);}return _0x4921d5[_0x8dd2('0x14')](_0x334913)[_0x8dd2('0x15')]();};}function respondWithResult(_0x598383,_0x48839e){_0x48839e=_0x48839e||0xc8;return function(_0x89a8cd){if(_0x89a8cd){return _0x598383[_0x8dd2('0x14')](_0x48839e)[_0x8dd2('0x16')](_0x89a8cd);}};}function respondWithFilteredResult(_0x141db0,_0x41c6a3){return function(_0x54a716){if(_0x54a716){var _0x540a42=typeof _0x41c6a3[_0x8dd2('0x17')]===_0x8dd2('0x18')&&typeof _0x41c6a3['limit']===_0x8dd2('0x18');var _0x131403=_0x54a716['count'];var _0x3387ca=_0x540a42?0x0:_0x41c6a3[_0x8dd2('0x17')];var _0xe63b62=_0x540a42?_0x54a716['count']:_0x41c6a3[_0x8dd2('0x17')]+_0x41c6a3[_0x8dd2('0x19')];var _0x24d8cb;if(_0xe63b62>=_0x131403){_0xe63b62=_0x131403;_0x24d8cb=0xc8;}else{_0x24d8cb=0xce;}_0x141db0[_0x8dd2('0x14')](_0x24d8cb);return _0x141db0[_0x8dd2('0x1a')](_0x8dd2('0x1b'),_0x3387ca+'-'+_0xe63b62+'/'+_0x131403)[_0x8dd2('0x16')](_0x54a716);}return null;};}function patchUpdates(_0x43049e){return function(_0x194528){try{jsonpatch[_0x8dd2('0x1c')](_0x194528,_0x43049e,!![]);}catch(_0x52ae79){return BPromise[_0x8dd2('0x1d')](_0x52ae79);}return _0x194528[_0x8dd2('0x1e')]();};}function saveUpdates(_0x138bce,_0x4cece0){return function(_0x1f3e93){if(_0x1f3e93){return _0x1f3e93[_0x8dd2('0x1f')](_0x138bce)['then'](function(_0x29ecc0){return _0x29ecc0;});}return null;};}function removeEntity(_0x1dc567,_0xaa9797){return function(_0x4865e2){if(_0x4865e2){return _0x4865e2['destroy']()['then'](function(){_0x1dc567[_0x8dd2('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e7fbe,_0x5404b8){return function(_0x598645){if(!_0x598645){_0x2e7fbe[_0x8dd2('0x13')](0x194);}return _0x598645;};}function handleError(_0xcc9ac,_0x5e562e){_0x5e562e=_0x5e562e||0x1f4;return function(_0x535c89){logger[_0x8dd2('0x20')](_0x535c89[_0x8dd2('0x21')]);if(_0x535c89['name']){delete _0x535c89['name'];}_0xcc9ac[_0x8dd2('0x14')](_0x5e562e)['send'](_0x535c89);};}exports[_0x8dd2('0x22')]=function(_0x1c4f27,_0x4f639e){var _0x407a4e={},_0x373e19={},_0xd739cc={'count':0x0,'rows':[]};var _0x51f2dc=_['map'](db[_0x8dd2('0x23')][_0x8dd2('0x24')],function(_0x536044){return{'name':_0x536044['fieldName'],'type':_0x536044[_0x8dd2('0x25')][_0x8dd2('0x26')]};});_0x373e19[_0x8dd2('0x27')]=_[_0x8dd2('0x28')](_[_0x8dd2('0x29')](_0x51f2dc,'name'),[_0x8dd2('0x2a')]);_0x373e19[_0x8dd2('0x2b')]=_[_0x8dd2('0x2c')](_0x1c4f27[_0x8dd2('0x2b')]);_0x373e19[_0x8dd2('0x2d')]=_['intersection'](_0x373e19[_0x8dd2('0x27')],_0x373e19[_0x8dd2('0x2b')]);_0x407a4e[_0x8dd2('0x2e')]=_[_0x8dd2('0x2f')](_0x373e19[_0x8dd2('0x27')],qs['fields'](_0x1c4f27[_0x8dd2('0x2b')]['fields']));_0x407a4e[_0x8dd2('0x2e')]=_0x407a4e[_0x8dd2('0x2e')]['length']?_0x407a4e[_0x8dd2('0x2e')]:_0x373e19[_0x8dd2('0x27')];if(!_0x1c4f27['query']['hasOwnProperty']('nolimit')){_0x407a4e['limit']=qs[_0x8dd2('0x19')](_0x1c4f27[_0x8dd2('0x2b')]['limit']);_0x407a4e[_0x8dd2('0x17')]=qs[_0x8dd2('0x17')](_0x1c4f27['query'][_0x8dd2('0x17')]);}_0x407a4e[_0x8dd2('0x30')]=qs[_0x8dd2('0x31')](_0x1c4f27['query']['sort']);_0x407a4e[_0x8dd2('0x32')]=qs[_0x8dd2('0x2d')](_['pick'](_0x1c4f27['query'],_0x373e19[_0x8dd2('0x2d')]),_0x51f2dc);if(_0x1c4f27['query'][_0x8dd2('0x33')]){_0x407a4e['where']=_[_0x8dd2('0x34')](_0x407a4e[_0x8dd2('0x32')],{'$or':_[_0x8dd2('0x29')](_0x51f2dc,function(_0x96c338){if(_0x96c338[_0x8dd2('0x25')]!=='VIRTUAL'){var _0xa49668={};_0xa49668[_0x96c338[_0x8dd2('0x2a')]]={'$like':'%'+_0x1c4f27[_0x8dd2('0x2b')]['filter']+'%'};return _0xa49668;}})});}_0x407a4e=_['merge']({},_0x407a4e,_0x1c4f27['options']);var _0x47c505={'where':_0x407a4e['where']};return db['VoiceMailMessage'][_0x8dd2('0x35')](_0x47c505)['then'](function(_0x4f8e13){_0xd739cc['count']=_0x4f8e13;if(_0x1c4f27[_0x8dd2('0x2b')]['includeAll']){_0x407a4e[_0x8dd2('0x36')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x8dd2('0x37')](_0x407a4e);})[_0x8dd2('0x38')](function(_0x242cc1){_0xd739cc[_0x8dd2('0x39')]=_0x242cc1;return _0xd739cc;})[_0x8dd2('0x38')](respondWithFilteredResult(_0x4f639e,_0x407a4e))[_0x8dd2('0x3a')](handleError(_0x4f639e,null));};exports[_0x8dd2('0x3b')]=function(_0x437e49,_0x3aff7c){var _0x30b7f0={'raw':!![],'where':{'id':_0x437e49[_0x8dd2('0x3c')]['id']}},_0x52a549={};_0x52a549[_0x8dd2('0x27')]=_['keys'](db[_0x8dd2('0x23')][_0x8dd2('0x24')]);_0x52a549['query']=_[_0x8dd2('0x2c')](_0x437e49[_0x8dd2('0x2b')]);_0x52a549['filters']=_['intersection'](_0x52a549[_0x8dd2('0x27')],_0x52a549['query']);_0x30b7f0['attributes']=_['intersection'](_0x52a549['model'],qs[_0x8dd2('0x3d')](_0x437e49['query'][_0x8dd2('0x3d')]));_0x30b7f0[_0x8dd2('0x2e')]=_0x30b7f0[_0x8dd2('0x2e')][_0x8dd2('0x3e')]?_0x30b7f0[_0x8dd2('0x2e')]:_0x52a549['model'];if(_0x437e49[_0x8dd2('0x2b')][_0x8dd2('0x3f')]){_0x30b7f0[_0x8dd2('0x36')]=[{'all':!![]}];}_0x30b7f0=_['merge']({},_0x30b7f0,_0x437e49[_0x8dd2('0x40')]);return db[_0x8dd2('0x23')][_0x8dd2('0x41')](_0x30b7f0)[_0x8dd2('0x38')](handleEntityNotFound(_0x3aff7c,null))[_0x8dd2('0x38')](respondWithResult(_0x3aff7c,null))[_0x8dd2('0x3a')](handleError(_0x3aff7c,null));};exports[_0x8dd2('0x42')]=function(_0xc4d3dd,_0x24ceb0){return db[_0x8dd2('0x23')][_0x8dd2('0x42')](_0xc4d3dd[_0x8dd2('0x43')],{})[_0x8dd2('0x38')](respondWithResult(_0x24ceb0,0xc9))[_0x8dd2('0x3a')](handleError(_0x24ceb0,null));};exports['update']=function(_0x27936b,_0x3f91ac){if(_0x27936b[_0x8dd2('0x43')]['id']){delete _0x27936b[_0x8dd2('0x43')]['id'];}return db['VoiceMailMessage'][_0x8dd2('0x41')]({'where':{'id':_0x27936b['params']['id']}})[_0x8dd2('0x38')](handleEntityNotFound(_0x3f91ac,null))[_0x8dd2('0x38')](saveUpdates(_0x27936b[_0x8dd2('0x43')],null))[_0x8dd2('0x38')](respondWithResult(_0x3f91ac,null))[_0x8dd2('0x3a')](handleError(_0x3f91ac,null));};exports['destroy']=function(_0x4ecaf4,_0x5b5fa5){return db[_0x8dd2('0x23')][_0x8dd2('0x41')]({'where':{'id':_0x4ecaf4['params']['id']}})[_0x8dd2('0x38')](handleEntityNotFound(_0x5b5fa5,null))['then'](removeEntity(_0x5b5fa5,null))[_0x8dd2('0x3a')](handleError(_0x5b5fa5,null));};exports[_0x8dd2('0x44')]=function(_0x5a2175,_0x577e67,_0x23e7ad){return db['VoiceMailMessage'][_0x8dd2('0x41')]({'where':{'id':_0x5a2175['params']['id']},'attributes':['id',_0x8dd2('0x45'),_0x8dd2('0x46')]})[_0x8dd2('0x38')](handleEntityNotFound(_0x577e67,null))['then'](function(_0xa858cc){if(_0xa858cc){if(!_0xa858cc[_0x8dd2('0x45')]){throw new db['Sequelize'][(_0x8dd2('0x47'))](_0x8dd2('0x48'));}var _0x49ab43={'Content-Type':_0x8dd2('0x49'),'Content-Disposition':_0x8dd2('0x4a')};if(_0xa858cc[_0x8dd2('0x46')]){_0x49ab43['Content-Disposition']=_0x8dd2('0x4b')+_0xa858cc[_0x8dd2('0x46')]+'.wav\x22';}_0x577e67[_0x8dd2('0x1a')](_0x49ab43);return _0x577e67['send'](new Buffer(_0xa858cc[_0x8dd2('0x45')]));}})[_0x8dd2('0x3a')](handleError(_0x577e67,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 9e6e698..59f09cd 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 _0xb7c8=['dir','lodash','../../config/logger','api','moment','request-promise','rimraf','./voiceMailMessage.attributes','exports','VoiceMailMessage','voice_voicemail_messages'];(function(_0x3edde7,_0x4db6f8){var _0x384de2=function(_0x313bfc){while(--_0x313bfc){_0x3edde7['push'](_0x3edde7['shift']());}};_0x384de2(++_0x4db6f8);}(_0xb7c8,0xe8));var _0x8b7c=function(_0x30af29,_0x5669d3){_0x30af29=_0x30af29-0x0;var _0xa0268e=_0xb7c8[_0x30af29];return _0xa0268e;};'use strict';var _=require(_0x8b7c('0x0'));var util=require('util');var logger=require(_0x8b7c('0x1'))(_0x8b7c('0x2'));var moment=require(_0x8b7c('0x3'));var BPromise=require('bluebird');var rp=require(_0x8b7c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b7c('0x5'));var config=require('../../config/environment');var attributes=require(_0x8b7c('0x6'));module[_0x8b7c('0x7')]=function(_0x5720f9,_0x42285e){return _0x5720f9['define'](_0x8b7c('0x8'),attributes,{'tableName':_0x8b7c('0x9'),'paranoid':![],'indexes':[{'name':_0x8b7c('0xa'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0x2237=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','api'];(function(_0xfe3aed,_0x1558b2){var _0x8cbbc2=function(_0x57f204){while(--_0x57f204){_0xfe3aed['push'](_0xfe3aed['shift']());}};_0x8cbbc2(++_0x1558b2);}(_0x2237,0x19d));var _0x7223=function(_0x264cb4,_0x208843){_0x264cb4=_0x264cb4-0x0;var _0x31f277=_0x2237[_0x264cb4];return _0x31f277;};'use strict';var _=require(_0x7223('0x0'));var util=require(_0x7223('0x1'));var logger=require('../../config/logger')(_0x7223('0x2'));var moment=require('moment');var BPromise=require(_0x7223('0x3'));var rp=require(_0x7223('0x4'));var fs=require('fs');var path=require(_0x7223('0x5'));var rimraf=require(_0x7223('0x6'));var config=require(_0x7223('0x7'));var attributes=require(_0x7223('0x8'));module['exports']=function(_0x162761,_0x105821){return _0x162761[_0x7223('0x9')](_0x7223('0xa'),attributes,{'tableName':_0x7223('0xb'),'paranoid':![],'indexes':[{'name':_0x7223('0xc'),'fields':[_0x7223('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 440fe61..9690015 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 _0x082b=['bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash'];(function(_0x40c462,_0x5814ba){var _0x2da340=function(_0x44965d){while(--_0x44965d){_0x40c462['push'](_0x40c462['shift']());}};_0x2da340(++_0x5814ba);}(_0x082b,0x13f));var _0xb082=function(_0x549a81,_0x28f9c7){_0x549a81=_0x549a81-0x0;var _0x514df1=_0x082b[_0x549a81];return _0x514df1;};'use strict';var _=require(_0xb082('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb082('0x1'));var rs=require(_0xb082('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb082('0x3'));var logger=require(_0xb082('0x4'))('rpc');var config=require(_0xb082('0x5'));var jayson=require(_0xb082('0x6'));var client=jayson[_0xb082('0x7')][_0xb082('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe19316,_0x239780,_0x2017d7){return new BPromise(function(_0x38cc82,_0x16b6b4){return client[_0xb082('0x9')](_0xe19316,_0x2017d7)['then'](function(_0x1ec057){logger['info'](_0xb082('0xa'),_0x239780,'request\x20sent');logger[_0xb082('0xb')](_0xb082('0xc'),_0x239780,_0xb082('0xd'),JSON[_0xb082('0xe')](_0x1ec057));if(_0x1ec057['error']){if(_0x1ec057[_0xb082('0xf')][_0xb082('0x10')]===0x1f4){logger[_0xb082('0xf')](_0xb082('0xa'),_0x239780,_0x1ec057['error'][_0xb082('0x11')]);return _0x16b6b4(_0x1ec057[_0xb082('0xf')][_0xb082('0x11')]);}logger[_0xb082('0xf')](_0xb082('0xa'),_0x239780,_0x1ec057[_0xb082('0xf')]['message']);return _0x38cc82(_0x1ec057[_0xb082('0xf')][_0xb082('0x11')]);}else{logger[_0xb082('0x12')](_0xb082('0xa'),_0x239780,_0xb082('0xd'));_0x38cc82(_0x1ec057[_0xb082('0x13')]['message']);}})['catch'](function(_0xc6a22f){logger[_0xb082('0xf')](_0xb082('0xa'),_0x239780,_0xc6a22f);_0x16b6b4(_0xc6a22f);});});} \ No newline at end of file +var _0x0f0a=['code','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x3d2b6d,_0x3d9319){var _0x1130ae=function(_0x37055e){while(--_0x37055e){_0x3d2b6d['push'](_0x3d2b6d['shift']());}};_0x1130ae(++_0x3d9319);}(_0x0f0a,0x17d));var _0xa0f0=function(_0x593fb7,_0x122c35){_0x593fb7=_0x593fb7-0x0;var _0x4376d2=_0x0f0a[_0x593fb7];return _0x4376d2;};'use strict';var _=require(_0xa0f0('0x0'));var util=require('util');var moment=require(_0xa0f0('0x1'));var BPromise=require('bluebird');var rs=require(_0xa0f0('0x2'));var fs=require('fs');var Redis=require(_0xa0f0('0x3'));var db=require(_0xa0f0('0x4'))['db'];var utils=require(_0xa0f0('0x5'));var logger=require('../../config/logger')(_0xa0f0('0x6'));var config=require('../../config/environment');var jayson=require(_0xa0f0('0x7'));var client=jayson[_0xa0f0('0x8')][_0xa0f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17835d,_0x391988,_0x54ac99){return new BPromise(function(_0x428645,_0x5432a8){return client['request'](_0x17835d,_0x54ac99)['then'](function(_0x401ab7){logger[_0xa0f0('0xa')](_0xa0f0('0xb'),_0x391988,_0xa0f0('0xc'));logger[_0xa0f0('0xd')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x391988,_0xa0f0('0xc'),JSON['stringify'](_0x401ab7));if(_0x401ab7[_0xa0f0('0xe')]){if(_0x401ab7[_0xa0f0('0xe')][_0xa0f0('0xf')]===0x1f4){logger[_0xa0f0('0xe')]('VoiceMailMessage,\x20%s,\x20%s',_0x391988,_0x401ab7['error'][_0xa0f0('0x10')]);return _0x5432a8(_0x401ab7['error'][_0xa0f0('0x10')]);}logger[_0xa0f0('0xe')]('VoiceMailMessage,\x20%s,\x20%s',_0x391988,_0x401ab7[_0xa0f0('0xe')][_0xa0f0('0x10')]);return _0x428645(_0x401ab7[_0xa0f0('0xe')][_0xa0f0('0x10')]);}else{logger[_0xa0f0('0xa')]('VoiceMailMessage,\x20%s,\x20%s',_0x391988,_0xa0f0('0xc'));_0x428645(_0x401ab7[_0xa0f0('0x11')]['message']);}})['catch'](function(_0x28601b){logger[_0xa0f0('0xe')](_0xa0f0('0xb'),_0x391988,_0x28601b);_0x5432a8(_0x28601b);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 4eddc51..49e146a 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 _0x5626=['path','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','post','addSound','put','update','delete','/:id/sounds/:id2','exports','util'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5626,0x1df));var _0x6562=function(_0xb70118,_0x4e43cd){_0xb70118=_0xb70118-0x0;var _0x4bf351=_0x5626[_0xb70118];return _0x4bf351;};'use strict';var multer=require('multer');var util=require(_0x6562('0x0'));var path=require(_0x6562('0x1'));var timeout=require('connect-timeout');var express=require(_0x6562('0x2'));var router=express['Router']();var fs_extra=require(_0x6562('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x6562('0x4'));var config=require(_0x6562('0x5'));var controller=require('./voiceMusicOnHold.controller');router[_0x6562('0x6')]('/',auth[_0x6562('0x7')](),controller[_0x6562('0x8')]);router['get'](_0x6562('0x9'),auth[_0x6562('0x7')](),controller[_0x6562('0xa')]);router['get'](_0x6562('0xb'),auth['isAuthenticated'](),controller[_0x6562('0xc')]);router[_0x6562('0xd')]('/',auth[_0x6562('0x7')](),controller['create']);router[_0x6562('0xd')](_0x6562('0xb'),auth[_0x6562('0x7')](),controller[_0x6562('0xe')]);router[_0x6562('0xf')](_0x6562('0x9'),auth[_0x6562('0x7')](),controller[_0x6562('0x10')]);router['delete']('/:id',auth[_0x6562('0x7')](),controller['destroy']);router[_0x6562('0x11')](_0x6562('0x12'),auth[_0x6562('0x7')](),controller['removeSound']);module[_0x6562('0x13')]=router; \ No newline at end of file +var _0x02ab=['../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller','get','/:id','isAuthenticated','/:id/sounds','getSounds','create','post','addSound','put','update','delete','/:id/sounds/:id2','removeSound','multer','connect-timeout','express','Router','fs-extra'];(function(_0x141ddd,_0x153546){var _0x11e554=function(_0x36251d){while(--_0x36251d){_0x141ddd['push'](_0x141ddd['shift']());}};_0x11e554(++_0x153546);}(_0x02ab,0x121));var _0xb02a=function(_0x46ed8c,_0x3c606f){_0x46ed8c=_0x46ed8c-0x0;var _0x4d83f9=_0x02ab[_0x46ed8c];return _0x4d83f9;};'use strict';var multer=require(_0xb02a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb02a('0x1'));var express=require(_0xb02a('0x2'));var router=express[_0xb02a('0x3')]();var fs_extra=require(_0xb02a('0x4'));var auth=require(_0xb02a('0x5'));var interaction=require(_0xb02a('0x6'));var config=require('../../config/environment');var controller=require(_0xb02a('0x7'));router[_0xb02a('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb02a('0x9'),auth[_0xb02a('0xa')](),controller['show']);router['get'](_0xb02a('0xb'),auth['isAuthenticated'](),controller[_0xb02a('0xc')]);router['post']('/',auth[_0xb02a('0xa')](),controller[_0xb02a('0xd')]);router[_0xb02a('0xe')]('/:id/sounds',auth[_0xb02a('0xa')](),controller[_0xb02a('0xf')]);router[_0xb02a('0x10')](_0xb02a('0x9'),auth[_0xb02a('0xa')](),controller[_0xb02a('0x11')]);router[_0xb02a('0x12')](_0xb02a('0x9'),auth[_0xb02a('0xa')](),controller['destroy']);router[_0xb02a('0x12')](_0xb02a('0x13'),auth[_0xb02a('0xa')](),controller[_0xb02a('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index f000f7a..6029f6d 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 _0xbf17=['BOOLEAN','sequelize','exports','STRING','name','ENUM','custom','files','mp3nb','quietmp3','mp3','alpha','TIMESTAMP'];(function(_0x5d6e50,_0x5cb19e){var _0xbd5536=function(_0x4a841d){while(--_0x4a841d){_0x5d6e50['push'](_0x5d6e50['shift']());}};_0xbd5536(++_0x5cb19e);}(_0xbf17,0xc4));var _0x7bf1=function(_0x27baa0,_0x38af8f){_0x27baa0=_0x27baa0-0x0;var _0x2498a1=_0xbf17[_0x27baa0];return _0x2498a1;};'use strict';var Sequelize=require(_0x7bf1('0x0'));module[_0x7bf1('0x1')]={'name':{'type':Sequelize[_0x7bf1('0x2')],'allowNull':![],'unique':_0x7bf1('0x3')},'mode':{'type':Sequelize[_0x7bf1('0x4')](_0x7bf1('0x5'),_0x7bf1('0x6'),_0x7bf1('0x7'),'quietmp3nb',_0x7bf1('0x8'),_0x7bf1('0x9')),'allowNull':!![],'defaultValue':_0x7bf1('0x6')},'directory':{'type':Sequelize[_0x7bf1('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x7bf1('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x7bf1('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x7bf1('0x2')],'allowNull':!![],'defaultValue':_0x7bf1('0xa')},'format':{'type':Sequelize[_0x7bf1('0x2')],'allowNull':!![]},'stamp':{'type':_0x7bf1('0xb')},'defaultEntry':{'type':Sequelize[_0x7bf1('0xc')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbad2=['custom','files','quietmp3','mp3','alpha','BOOLEAN','sequelize','exports','STRING','name','ENUM'];(function(_0x1e5db8,_0x44ef41){var _0x219a51=function(_0x5b86a3){while(--_0x5b86a3){_0x1e5db8['push'](_0x1e5db8['shift']());}};_0x219a51(++_0x44ef41);}(_0xbad2,0x15b));var _0x2bad=function(_0x5b1cf4,_0xc612d0){_0x5b1cf4=_0x5b1cf4-0x0;var _0x4e2646=_0xbad2[_0x5b1cf4];return _0x4e2646;};'use strict';var Sequelize=require(_0x2bad('0x0'));module[_0x2bad('0x1')]={'name':{'type':Sequelize[_0x2bad('0x2')],'allowNull':![],'unique':_0x2bad('0x3')},'mode':{'type':Sequelize[_0x2bad('0x4')](_0x2bad('0x5'),_0x2bad('0x6'),'mp3nb','quietmp3nb',_0x2bad('0x7'),_0x2bad('0x8')),'allowNull':!![],'defaultValue':_0x2bad('0x6')},'directory':{'type':Sequelize[_0x2bad('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x2bad('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x2bad('0x2')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x2bad('0x9')},'format':{'type':Sequelize[_0x2bad('0x2')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x2bad('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 5b930ed..de98fd6 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 _0x494c=['send','index','VoiceMusicOnHold','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','body','sequelize','mode','files','root','server/files/moh','create','mkdirSync','directory','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MusicOnHolds','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','unlinkSync','rmdirSync','Sequelize','ValidationError','addSound','Sound','findOne','save_name','converted_format','join','server/files/sounds/converted','%s.%s','symlinkSync','message','removeSound','id2','createdAt','getSounds','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x494c,0x19a));var _0xc494=function(_0x19732f,_0x1ad51b){_0x19732f=_0x19732f-0x0;var _0x52ae37=_0x494c[_0x19732f];return _0x52ae37;};'use strict';var emlformat=require(_0xc494('0x0'));var rimraf=require(_0xc494('0x1'));var zipdir=require(_0xc494('0x2'));var jsonpatch=require(_0xc494('0x3'));var rp=require(_0xc494('0x4'));var moment=require(_0xc494('0x5'));var BPromise=require(_0xc494('0x6'));var Mustache=require(_0xc494('0x7'));var util=require(_0xc494('0x8'));var path=require(_0xc494('0x9'));var sox=require('sox');var csv=require(_0xc494('0xa'));var ejs=require(_0xc494('0xb'));var fs=require('fs');var fs_extra=require(_0xc494('0xc'));var _=require(_0xc494('0xd'));var squel=require('squel');var crypto=require(_0xc494('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc494('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc494('0x10'));var Papa=require(_0xc494('0x11'));var Redis=require(_0xc494('0x12'));var authService=require(_0xc494('0x13'));var qs=require(_0xc494('0x14'));var as=require(_0xc494('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc494('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc494('0x17'));var db=require(_0xc494('0x18'))['db'];function respondWithStatusCode(_0x4c8b90,_0x5234f3){_0x5234f3=_0x5234f3||0xcc;return function(_0x1b0140){if(_0x1b0140){return _0x4c8b90['sendStatus'](_0x5234f3);}return _0x4c8b90[_0xc494('0x19')](_0x5234f3)[_0xc494('0x1a')]();};}function respondWithResult(_0x2ff48b,_0x27bd2c){_0x27bd2c=_0x27bd2c||0xc8;return function(_0x47969e){if(_0x47969e){return _0x2ff48b[_0xc494('0x19')](_0x27bd2c)[_0xc494('0x1b')](_0x47969e);}};}function respondWithFilteredResult(_0x3a30e9,_0x1c604c){return function(_0x50158e){if(_0x50158e){var _0xc8256b=typeof _0x1c604c['offset']==='undefined'&&typeof _0x1c604c['limit']===_0xc494('0x1c');var _0x47e95a=_0x50158e['count'];var _0x225f6c=_0xc8256b?0x0:_0x1c604c[_0xc494('0x1d')];var _0x4af87f=_0xc8256b?_0x50158e[_0xc494('0x1e')]:_0x1c604c[_0xc494('0x1d')]+_0x1c604c[_0xc494('0x1f')];var _0x1262c0;if(_0x4af87f>=_0x47e95a){_0x4af87f=_0x47e95a;_0x1262c0=0xc8;}else{_0x1262c0=0xce;}_0x3a30e9['status'](_0x1262c0);return _0x3a30e9[_0xc494('0x20')](_0xc494('0x21'),_0x225f6c+'-'+_0x4af87f+'/'+_0x47e95a)[_0xc494('0x1b')](_0x50158e);}return null;};}function patchUpdates(_0x3df3f1){return function(_0x432299){try{jsonpatch[_0xc494('0x22')](_0x432299,_0x3df3f1,!![]);}catch(_0x409ca9){return BPromise[_0xc494('0x23')](_0x409ca9);}return _0x432299[_0xc494('0x24')]();};}function saveUpdates(_0x482db5,_0x333d28){return function(_0x13f546){if(_0x13f546){return _0x13f546[_0xc494('0x25')](_0x482db5)[_0xc494('0x26')](function(_0x283756){return _0x283756;});}return null;};}function removeEntity(_0x4cd5e6,_0x2b58ef){return function(_0x399d4b){if(_0x399d4b){return _0x399d4b[_0xc494('0x27')]()['then'](function(){var _0x2e1b4f=_0x399d4b[_0xc494('0x28')]({'plain':!![]});var _0x4a396f='MusicOnHolds';return db[_0xc494('0x29')][_0xc494('0x27')]({'where':{'type':_0x4a396f,'resourceId':_0x2e1b4f['id']}})[_0xc494('0x26')](function(){return _0x399d4b;});})[_0xc494('0x26')](function(){_0x4cd5e6[_0xc494('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x385697,_0x35978c){return function(_0x39016f){if(!_0x39016f){_0x385697[_0xc494('0x2a')](0x194);}return _0x39016f;};}function handleError(_0x205c5f,_0x2c5182){_0x2c5182=_0x2c5182||0x1f4;return function(_0x48fd5a){logger[_0xc494('0x2b')](_0x48fd5a[_0xc494('0x2c')]);if(_0x48fd5a[_0xc494('0x2d')]){delete _0x48fd5a[_0xc494('0x2d')];}_0x205c5f[_0xc494('0x19')](_0x2c5182)[_0xc494('0x2e')](_0x48fd5a);};}exports[_0xc494('0x2f')]=function(_0x5deb82,_0x2abc74){var _0x49a9a8={},_0x7e797f={},_0x17dd05={'count':0x0,'rows':[]};var _0xf1beea=_['map'](db[_0xc494('0x30')][_0xc494('0x31')],function(_0x4a601f){return{'name':_0x4a601f[_0xc494('0x32')],'type':_0x4a601f['type'][_0xc494('0x33')]};});_0x7e797f[_0xc494('0x34')]=_[_0xc494('0x35')](_0xf1beea,_0xc494('0x2d'));_0x7e797f[_0xc494('0x36')]=_[_0xc494('0x37')](_0x5deb82[_0xc494('0x36')]);_0x7e797f['filters']=_[_0xc494('0x38')](_0x7e797f[_0xc494('0x34')],_0x7e797f['query']);_0x49a9a8[_0xc494('0x39')]=_[_0xc494('0x38')](_0x7e797f[_0xc494('0x34')],qs[_0xc494('0x3a')](_0x5deb82[_0xc494('0x36')]['fields']));_0x49a9a8['attributes']=_0x49a9a8[_0xc494('0x39')][_0xc494('0x3b')]?_0x49a9a8[_0xc494('0x39')]:_0x7e797f[_0xc494('0x34')];if(!_0x5deb82[_0xc494('0x36')][_0xc494('0x3c')](_0xc494('0x3d'))){_0x49a9a8[_0xc494('0x1f')]=qs[_0xc494('0x1f')](_0x5deb82[_0xc494('0x36')][_0xc494('0x1f')]);_0x49a9a8[_0xc494('0x1d')]=qs['offset'](_0x5deb82[_0xc494('0x36')][_0xc494('0x1d')]);}_0x49a9a8[_0xc494('0x3e')]=qs[_0xc494('0x3f')](_0x5deb82[_0xc494('0x36')][_0xc494('0x3f')]);delete _0x5deb82[_0xc494('0x36')][_0xc494('0x3f')];_0x49a9a8[_0xc494('0x40')]=qs['filters'](_[_0xc494('0x41')](_0x5deb82['query'],_0x7e797f[_0xc494('0x42')]),_0xf1beea);if(_0x5deb82[_0xc494('0x36')][_0xc494('0x43')]){_0x49a9a8['where']=_[_0xc494('0x44')](_0x49a9a8[_0xc494('0x40')],{'$or':_['map'](_0xf1beea,function(_0x34a1b3){if(_0x34a1b3['type']!==_0xc494('0x45')){var _0x3459ad={};_0x3459ad[_0x34a1b3[_0xc494('0x2d')]]={'$like':'%'+_0x5deb82[_0xc494('0x36')][_0xc494('0x43')]+'%'};return _0x3459ad;}})});}_0x49a9a8=_[_0xc494('0x44')]({},_0x49a9a8,_0x5deb82[_0xc494('0x46')]);var _0x26e72d={'where':_0x49a9a8['where']};return db[_0xc494('0x30')][_0xc494('0x1e')](_0x26e72d)['then'](function(_0x1cb9f3){_0x17dd05['count']=_0x1cb9f3;if(_0x5deb82[_0xc494('0x36')][_0xc494('0x47')]){_0x49a9a8[_0xc494('0x48')]=[{'all':!![]}];}return db[_0xc494('0x30')][_0xc494('0x49')](_0x49a9a8);})[_0xc494('0x26')](function(_0x511b74){_0x17dd05[_0xc494('0x4a')]=_0x511b74;return _0x17dd05;})['then'](respondWithFilteredResult(_0x2abc74,_0x49a9a8))[_0xc494('0x4b')](handleError(_0x2abc74,null));};exports['show']=function(_0x5ecf63,_0xe32e1){var _0x5aa153={'raw':![],'where':{'id':_0x5ecf63[_0xc494('0x4c')]['id']}},_0x1ab1da={};_0x1ab1da['model']=_['keys'](db[_0xc494('0x30')][_0xc494('0x31')]);_0x1ab1da[_0xc494('0x36')]=_[_0xc494('0x37')](_0x5ecf63[_0xc494('0x36')]);_0x1ab1da[_0xc494('0x42')]=_['intersection'](_0x1ab1da[_0xc494('0x34')],_0x1ab1da[_0xc494('0x36')]);_0x5aa153['attributes']=_[_0xc494('0x38')](_0x1ab1da['model'],qs[_0xc494('0x3a')](_0x5ecf63[_0xc494('0x36')]['fields']));_0x5aa153[_0xc494('0x39')]=_0x5aa153[_0xc494('0x39')]['length']?_0x5aa153['attributes']:_0x1ab1da[_0xc494('0x34')];if(_0x5ecf63[_0xc494('0x36')][_0xc494('0x47')]){_0x5aa153[_0xc494('0x48')]=[{'all':!![]}];}_0x5aa153=_[_0xc494('0x44')]({},_0x5aa153,_0x5ecf63[_0xc494('0x46')]);return db[_0xc494('0x30')][_0xc494('0x4d')](_0x5aa153)[_0xc494('0x26')](handleEntityNotFound(_0xe32e1,null))[_0xc494('0x26')](respondWithResult(_0xe32e1,null))[_0xc494('0x4b')](handleError(_0xe32e1,null));};exports[_0xc494('0x25')]=function(_0x448177,_0x3ee207){if(_0x448177[_0xc494('0x4e')]['id']){delete _0x448177['body']['id'];}return db['VoiceMusicOnHold']['find']({'where':{'id':_0x448177['params']['id']}})[_0xc494('0x26')](handleEntityNotFound(_0x3ee207,null))[_0xc494('0x26')](saveUpdates(_0x448177['body'],null))[_0xc494('0x26')](respondWithResult(_0x3ee207,null))[_0xc494('0x4b')](handleError(_0x3ee207,null));};exports['create']=function(_0x3bc736,_0x407ab4,_0x3f24eb){return db[_0xc494('0x4f')]['transaction'](function(_0x54cc6d){if(_0x3bc736[_0xc494('0x4e')][_0xc494('0x50')]===_0xc494('0x51')){_0x3bc736[_0xc494('0x4e')]['directory']=path['join'](config[_0xc494('0x52')],_0xc494('0x53'),_0x3bc736[_0xc494('0x4e')][_0xc494('0x2d')]);}return db['VoiceMusicOnHold'][_0xc494('0x54')](_0x3bc736[_0xc494('0x4e')],{'transaction':_0x54cc6d})[_0xc494('0x26')](function(_0x465333){if(_0x3bc736[_0xc494('0x4e')]['mode']===_0xc494('0x51')){fs[_0xc494('0x55')](_0x465333[_0xc494('0x56')],parseInt(_0xc494('0x57'),0x8));}var _0x4a1279=_0x3bc736[_0xc494('0x58')][_0xc494('0x28')]({'plain':!![]});if(!_0x4a1279)throw new Error(_0xc494('0x59'));if(_0x4a1279[_0xc494('0x5a')]===_0xc494('0x58')){var _0xbcb46b=_0x465333[_0xc494('0x28')]({'plain':!![]});return db[_0xc494('0x5b')][_0xc494('0x4d')]({'where':{'name':_0xc494('0x5c'),'userProfileId':_0x4a1279[_0xc494('0x5d')]},'raw':!![]})['then'](function(_0x3b6ce9){if(_0x3b6ce9&&_0x3b6ce9['autoAssociation']===0x0){return db[_0xc494('0x29')][_0xc494('0x54')]({'name':_0xbcb46b[_0xc494('0x2d')],'resourceId':_0xbcb46b['id'],'type':_0x3b6ce9[_0xc494('0x2d')],'sectionId':_0x3b6ce9['id']},{})[_0xc494('0x26')](function(){return _0x465333;});}else{return _0x465333;}})[_0xc494('0x4b')](function(_0x308379){logger['error'](_0xc494('0x5e'),_0x308379);});}return _0x465333;});})[_0xc494('0x26')](respondWithResult(_0x407ab4,0xc9))['catch'](handleError(_0x407ab4,null));};exports[_0xc494('0x27')]=function(_0x406996,_0x21cd70,_0x390340){var _0x3a520b;return db['VoiceMusicOnHold'][_0xc494('0x4d')]({'where':{'id':_0x406996['params']['id']}})[_0xc494('0x26')](function(_0x50cb60){if(_0x50cb60){return db[_0xc494('0x4f')][_0xc494('0x5f')](function(_0x13d682){return _0x50cb60[_0xc494('0x27')]({'transaction':_0x13d682,'raw':!![]})['then'](function(_0x2d7ac8){if(_0x2d7ac8['directory']){fs['readdirSync'](_0x2d7ac8[_0xc494('0x56')])['forEach'](function(_0x2acb6b){fs[_0xc494('0x60')](path['join'](_0x2d7ac8[_0xc494('0x56')],_0x2acb6b));});fs[_0xc494('0x61')](_0x2d7ac8[_0xc494('0x56')]);}return _0x2d7ac8;});})[_0xc494('0x4b')](function(_0x11de47){throw new db[(_0xc494('0x62'))][(_0xc494('0x63'))](_0x11de47['message']);});}})['then'](handleEntityNotFound(_0x21cd70,null))['then'](removeEntity(_0x21cd70,null))[_0xc494('0x4b')](handleError(_0x21cd70,null));};exports['addSound']=function(_0x1b4b10,_0x5aec64,_0x5e5b26){return db[_0xc494('0x4f')]['transaction'](function(_0x331afd){var _0x480ced;return db[_0xc494('0x30')][_0xc494('0x4d')]({'where':{'id':_0x1b4b10[_0xc494('0x4c')]['id']}})[_0xc494('0x26')](function(_0x4e8758){if(_0x4e8758){_0x480ced=_0x4e8758;return _0x4e8758[_0xc494('0x64')](_0x1b4b10[_0xc494('0x4e')]['id'],{'transaction':_0x331afd});}})['then'](function(_0x20228f){if(_0x20228f){return db[_0xc494('0x65')][_0xc494('0x66')]({'where':{'id':_0x1b4b10[_0xc494('0x4e')]['id']},'attributes':['id',_0xc494('0x2d'),_0xc494('0x67'),_0xc494('0x68'),'createdAt'],'raw':!![]});}})[_0xc494('0x26')](function(_0x4935fe){if(_0x4935fe){var _0x1b6bd0=path[_0xc494('0x69')](config[_0xc494('0x52')],_0xc494('0x6a'),util['format'](_0xc494('0x6b'),path['basename'](_0x4935fe[_0xc494('0x67')],path['extname'](_0x4935fe[_0xc494('0x67')])),_0x4935fe[_0xc494('0x68')]));var _0x18987c=path[_0xc494('0x69')](config[_0xc494('0x52')],_0xc494('0x53'),_0x480ced['name'],util['format']('%s.%s',_0x4935fe[_0xc494('0x2d')],_0x4935fe['converted_format']));fs[_0xc494('0x6c')](_0x1b6bd0,_0x18987c);return _0x4935fe;}})[_0xc494('0x4b')](function(_0x4779a5){throw new db[(_0xc494('0x62'))][(_0xc494('0x63'))](_0x4779a5[_0xc494('0x6d')]);});})[_0xc494('0x26')](handleEntityNotFound(_0x5aec64,null))[_0xc494('0x26')](respondWithResult(_0x5aec64,0xc9))[_0xc494('0x4b')](handleError(_0x5aec64,null));};exports[_0xc494('0x6e')]=function(_0x2db413,_0x3fda7b,_0x1a948d){return db['sequelize'][_0xc494('0x5f')](function(_0x4cb68d){var _0x16de14;return db[_0xc494('0x30')][_0xc494('0x66')]({'where':{'id':_0x2db413['params']['id']}})[_0xc494('0x26')](handleEntityNotFound(_0x3fda7b,null))[_0xc494('0x26')](function(_0x195b03){if(_0x195b03){_0x16de14=_0x195b03;return _0x195b03[_0xc494('0x6e')](_0x2db413['params'][_0xc494('0x6f')]);}})[_0xc494('0x26')](function(_0x1ae5c2){if(_0x1ae5c2){return db[_0xc494('0x65')][_0xc494('0x66')]({'where':{'id':_0x2db413[_0xc494('0x4c')]['id2']},'attributes':['id',_0xc494('0x2d'),_0xc494('0x67'),_0xc494('0x68'),_0xc494('0x70')],'raw':!![]});}})[_0xc494('0x26')](function(_0x44c5d8){if(_0x44c5d8){fs[_0xc494('0x60')](path[_0xc494('0x69')](_0x16de14[_0xc494('0x56')],util['format']('%s.%s',_0x44c5d8[_0xc494('0x2d')],_0x44c5d8[_0xc494('0x68')])));return _0x44c5d8;}})[_0xc494('0x4b')](function(_0x3d5127){throw new db[(_0xc494('0x62'))][(_0xc494('0x63'))](_0x3d5127[_0xc494('0x6d')]);});})[_0xc494('0x26')](handleEntityNotFound(_0x3fda7b,null))[_0xc494('0x26')](respondWithStatusCode(_0x3fda7b,0xcc))[_0xc494('0x4b')](handleError(_0x3fda7b,null));};exports[_0xc494('0x71')]=function(_0x10d4fe,_0x536f7f,_0x386fd4){var _0x4fed08={};var _0x122332={};var _0x5b4fac;var _0x20129c;return db[_0xc494('0x30')][_0xc494('0x66')]({'where':{'id':_0x10d4fe[_0xc494('0x4c')]['id']}})[_0xc494('0x26')](handleEntityNotFound(_0x536f7f,null))[_0xc494('0x26')](function(_0x2769b7){if(_0x2769b7){_0x5b4fac=_0x2769b7;_0x122332[_0xc494('0x34')]=_[_0xc494('0x37')](db['Sound'][_0xc494('0x31')]);_0x122332['query']=_[_0xc494('0x37')](_0x10d4fe[_0xc494('0x36')]);_0x122332[_0xc494('0x42')]=_[_0xc494('0x38')](_0x122332['model'],_0x122332['query']);_0x4fed08[_0xc494('0x39')]=_[_0xc494('0x38')](_0x122332[_0xc494('0x34')],qs[_0xc494('0x3a')](_0x10d4fe[_0xc494('0x36')][_0xc494('0x3a')]));_0x4fed08[_0xc494('0x39')]=_0x4fed08[_0xc494('0x39')][_0xc494('0x3b')]?_0x4fed08[_0xc494('0x39')]:_0x122332[_0xc494('0x34')];_0x4fed08['order']=qs[_0xc494('0x3f')](_0x10d4fe[_0xc494('0x36')][_0xc494('0x3f')]);_0x4fed08[_0xc494('0x40')]=qs['filters'](_['pick'](_0x10d4fe[_0xc494('0x36')],_0x122332[_0xc494('0x42')]));if(_0x10d4fe[_0xc494('0x36')][_0xc494('0x43')]){_0x4fed08[_0xc494('0x40')]=_[_0xc494('0x44')](_0x4fed08[_0xc494('0x40')],{'$or':_[_0xc494('0x35')](_0x4fed08['attributes'],function(_0x3523d2){var _0x26cb71={};_0x26cb71[_0x3523d2]={'$like':'%'+_0x10d4fe[_0xc494('0x36')][_0xc494('0x43')]+'%'};return _0x26cb71;})});}_0x4fed08=_[_0xc494('0x44')]({},_0x4fed08,_0x10d4fe[_0xc494('0x46')]);return _0x5b4fac['getSounds'](_0x4fed08);}})[_0xc494('0x26')](function(_0x205cea){if(_0x205cea){_0x20129c=_0x205cea[_0xc494('0x3b')];if(!_0x10d4fe['query'][_0xc494('0x3c')]('nolimit')){_0x4fed08[_0xc494('0x1f')]=qs['limit'](_0x10d4fe[_0xc494('0x36')][_0xc494('0x1f')]);_0x4fed08['offset']=qs[_0xc494('0x1d')](_0x10d4fe[_0xc494('0x36')]['offset']);}return _0x5b4fac[_0xc494('0x71')](_0x4fed08);}})[_0xc494('0x26')](function(_0xc44815){if(_0xc44815){return _0xc44815?{'count':_0x20129c,'rows':_0xc44815}:null;}})[_0xc494('0x26')](respondWithResult(_0x536f7f,null))[_0xc494('0x4b')](handleError(_0x536f7f,null));}; \ No newline at end of file +var _0xba70=['destroy','get','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','keys','find','body','create','transaction','mode','files','directory','join','root','server/files/moh','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','unlinkSync','rmdirSync','Sequelize','message','addSound','sequelize','findOne','save_name','createdAt','server/files/sounds/converted','%s.%s','basename','extname','format','converted_format','symlinkSync','removeSound','id2','ValidationError','getSounds','hasOwnProperty','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','then'];(function(_0x37bed5,_0x4fcea4){var _0xfd86c3=function(_0x28d4fa){while(--_0x28d4fa){_0x37bed5['push'](_0x37bed5['shift']());}};_0xfd86c3(++_0x4fcea4);}(_0xba70,0x1aa));var _0x0ba7=function(_0x3eced2,_0x1626a5){_0x3eced2=_0x3eced2-0x0;var _0x383945=_0xba70[_0x3eced2];return _0x383945;};'use strict';var emlformat=require(_0x0ba7('0x0'));var rimraf=require(_0x0ba7('0x1'));var zipdir=require(_0x0ba7('0x2'));var jsonpatch=require(_0x0ba7('0x3'));var rp=require('request-promise');var moment=require(_0x0ba7('0x4'));var BPromise=require(_0x0ba7('0x5'));var Mustache=require(_0x0ba7('0x6'));var util=require(_0x0ba7('0x7'));var path=require(_0x0ba7('0x8'));var sox=require(_0x0ba7('0x9'));var csv=require(_0x0ba7('0xa'));var ejs=require(_0x0ba7('0xb'));var fs=require('fs');var fs_extra=require(_0x0ba7('0xc'));var _=require(_0x0ba7('0xd'));var squel=require(_0x0ba7('0xe'));var crypto=require('crypto');var jsforce=require(_0x0ba7('0xf'));var deskjs=require(_0x0ba7('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0ba7('0x11'));var Papa=require(_0x0ba7('0x12'));var Redis=require('ioredis');var authService=require(_0x0ba7('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0ba7('0x14'));var hardwareService=require(_0x0ba7('0x15'));var logger=require('../../config/logger')(_0x0ba7('0x16'));var utils=require(_0x0ba7('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0ba7('0x18'));var db=require(_0x0ba7('0x19'))['db'];function respondWithStatusCode(_0x30c4d5,_0x4cd01d){_0x4cd01d=_0x4cd01d||0xcc;return function(_0x5453db){if(_0x5453db){return _0x30c4d5[_0x0ba7('0x1a')](_0x4cd01d);}return _0x30c4d5[_0x0ba7('0x1b')](_0x4cd01d)[_0x0ba7('0x1c')]();};}function respondWithResult(_0x1634f5,_0x54e8ad){_0x54e8ad=_0x54e8ad||0xc8;return function(_0x5507c6){if(_0x5507c6){return _0x1634f5[_0x0ba7('0x1b')](_0x54e8ad)['json'](_0x5507c6);}};}function respondWithFilteredResult(_0x32daef,_0x418c60){return function(_0x48a556){if(_0x48a556){var _0x3cfb26=typeof _0x418c60['offset']===_0x0ba7('0x1d')&&typeof _0x418c60['limit']===_0x0ba7('0x1d');var _0x3e9ff3=_0x48a556[_0x0ba7('0x1e')];var _0x37ee68=_0x3cfb26?0x0:_0x418c60[_0x0ba7('0x1f')];var _0x3ba87d=_0x3cfb26?_0x48a556[_0x0ba7('0x1e')]:_0x418c60[_0x0ba7('0x1f')]+_0x418c60[_0x0ba7('0x20')];var _0x176bff;if(_0x3ba87d>=_0x3e9ff3){_0x3ba87d=_0x3e9ff3;_0x176bff=0xc8;}else{_0x176bff=0xce;}_0x32daef['status'](_0x176bff);return _0x32daef[_0x0ba7('0x21')](_0x0ba7('0x22'),_0x37ee68+'-'+_0x3ba87d+'/'+_0x3e9ff3)[_0x0ba7('0x23')](_0x48a556);}return null;};}function patchUpdates(_0x2a678f){return function(_0x2ccc34){try{jsonpatch[_0x0ba7('0x24')](_0x2ccc34,_0x2a678f,!![]);}catch(_0x481bbf){return BPromise['reject'](_0x481bbf);}return _0x2ccc34['save']();};}function saveUpdates(_0x3d93e3,_0x2f8166){return function(_0x5411c7){if(_0x5411c7){return _0x5411c7['update'](_0x3d93e3)[_0x0ba7('0x25')](function(_0x507d57){return _0x507d57;});}return null;};}function removeEntity(_0x32531d,_0x317e9d){return function(_0x530e34){if(_0x530e34){return _0x530e34[_0x0ba7('0x26')]()[_0x0ba7('0x25')](function(){var _0x279a50=_0x530e34[_0x0ba7('0x27')]({'plain':!![]});var _0x367e7b='MusicOnHolds';return db['UserProfileResource'][_0x0ba7('0x26')]({'where':{'type':_0x367e7b,'resourceId':_0x279a50['id']}})[_0x0ba7('0x25')](function(){return _0x530e34;});})[_0x0ba7('0x25')](function(){_0x32531d[_0x0ba7('0x1b')](0xcc)[_0x0ba7('0x1c')]();});}};}function handleEntityNotFound(_0x24be14,_0x3ad8e6){return function(_0x24f0ea){if(!_0x24f0ea){_0x24be14[_0x0ba7('0x1a')](0x194);}return _0x24f0ea;};}function handleError(_0x3ff244,_0x44e407){_0x44e407=_0x44e407||0x1f4;return function(_0x43ca62){logger[_0x0ba7('0x28')](_0x43ca62[_0x0ba7('0x29')]);if(_0x43ca62[_0x0ba7('0x2a')]){delete _0x43ca62[_0x0ba7('0x2a')];}_0x3ff244[_0x0ba7('0x1b')](_0x44e407)[_0x0ba7('0x2b')](_0x43ca62);};}exports[_0x0ba7('0x2c')]=function(_0xf7852e,_0x1ced17){var _0x4acb15={},_0x313daf={},_0x5dabf0={'count':0x0,'rows':[]};var _0x12b55a=_[_0x0ba7('0x2d')](db[_0x0ba7('0x2e')][_0x0ba7('0x2f')],function(_0x239595){return{'name':_0x239595[_0x0ba7('0x30')],'type':_0x239595[_0x0ba7('0x31')][_0x0ba7('0x32')]};});_0x313daf[_0x0ba7('0x33')]=_[_0x0ba7('0x2d')](_0x12b55a,_0x0ba7('0x2a'));_0x313daf[_0x0ba7('0x34')]=_['keys'](_0xf7852e[_0x0ba7('0x34')]);_0x313daf['filters']=_[_0x0ba7('0x35')](_0x313daf[_0x0ba7('0x33')],_0x313daf[_0x0ba7('0x34')]);_0x4acb15[_0x0ba7('0x36')]=_[_0x0ba7('0x35')](_0x313daf['model'],qs['fields'](_0xf7852e[_0x0ba7('0x34')][_0x0ba7('0x37')]));_0x4acb15[_0x0ba7('0x36')]=_0x4acb15['attributes'][_0x0ba7('0x38')]?_0x4acb15[_0x0ba7('0x36')]:_0x313daf[_0x0ba7('0x33')];if(!_0xf7852e[_0x0ba7('0x34')]['hasOwnProperty']('nolimit')){_0x4acb15[_0x0ba7('0x20')]=qs['limit'](_0xf7852e[_0x0ba7('0x34')]['limit']);_0x4acb15['offset']=qs[_0x0ba7('0x1f')](_0xf7852e[_0x0ba7('0x34')][_0x0ba7('0x1f')]);}_0x4acb15[_0x0ba7('0x39')]=qs[_0x0ba7('0x3a')](_0xf7852e[_0x0ba7('0x34')][_0x0ba7('0x3a')]);delete _0xf7852e[_0x0ba7('0x34')][_0x0ba7('0x3a')];_0x4acb15[_0x0ba7('0x3b')]=qs[_0x0ba7('0x3c')](_[_0x0ba7('0x3d')](_0xf7852e[_0x0ba7('0x34')],_0x313daf[_0x0ba7('0x3c')]),_0x12b55a);if(_0xf7852e['query']['filter']){_0x4acb15['where']=_[_0x0ba7('0x3e')](_0x4acb15['where'],{'$or':_[_0x0ba7('0x2d')](_0x12b55a,function(_0x40d2b1){if(_0x40d2b1['type']!==_0x0ba7('0x3f')){var _0x3499ad={};_0x3499ad[_0x40d2b1['name']]={'$like':'%'+_0xf7852e[_0x0ba7('0x34')][_0x0ba7('0x40')]+'%'};return _0x3499ad;}})});}_0x4acb15=_[_0x0ba7('0x3e')]({},_0x4acb15,_0xf7852e[_0x0ba7('0x41')]);var _0x48d16f={'where':_0x4acb15[_0x0ba7('0x3b')]};return db[_0x0ba7('0x2e')]['count'](_0x48d16f)[_0x0ba7('0x25')](function(_0x54b570){_0x5dabf0['count']=_0x54b570;if(_0xf7852e[_0x0ba7('0x34')][_0x0ba7('0x42')]){_0x4acb15[_0x0ba7('0x43')]=[{'all':!![]}];}return db[_0x0ba7('0x2e')]['findAll'](_0x4acb15);})[_0x0ba7('0x25')](function(_0x560476){_0x5dabf0[_0x0ba7('0x44')]=_0x560476;return _0x5dabf0;})[_0x0ba7('0x25')](respondWithFilteredResult(_0x1ced17,_0x4acb15))[_0x0ba7('0x45')](handleError(_0x1ced17,null));};exports[_0x0ba7('0x46')]=function(_0x5ca5c2,_0x229354){var _0x2a1543={'raw':![],'where':{'id':_0x5ca5c2[_0x0ba7('0x47')]['id']}},_0x4a1219={};_0x4a1219['model']=_[_0x0ba7('0x48')](db[_0x0ba7('0x2e')][_0x0ba7('0x2f')]);_0x4a1219[_0x0ba7('0x34')]=_['keys'](_0x5ca5c2[_0x0ba7('0x34')]);_0x4a1219['filters']=_[_0x0ba7('0x35')](_0x4a1219['model'],_0x4a1219[_0x0ba7('0x34')]);_0x2a1543['attributes']=_[_0x0ba7('0x35')](_0x4a1219[_0x0ba7('0x33')],qs[_0x0ba7('0x37')](_0x5ca5c2[_0x0ba7('0x34')][_0x0ba7('0x37')]));_0x2a1543[_0x0ba7('0x36')]=_0x2a1543[_0x0ba7('0x36')]['length']?_0x2a1543[_0x0ba7('0x36')]:_0x4a1219[_0x0ba7('0x33')];if(_0x5ca5c2[_0x0ba7('0x34')][_0x0ba7('0x42')]){_0x2a1543[_0x0ba7('0x43')]=[{'all':!![]}];}_0x2a1543=_[_0x0ba7('0x3e')]({},_0x2a1543,_0x5ca5c2['options']);return db['VoiceMusicOnHold'][_0x0ba7('0x49')](_0x2a1543)[_0x0ba7('0x25')](handleEntityNotFound(_0x229354,null))['then'](respondWithResult(_0x229354,null))[_0x0ba7('0x45')](handleError(_0x229354,null));};exports['update']=function(_0x4d2921,_0x235d8a){if(_0x4d2921[_0x0ba7('0x4a')]['id']){delete _0x4d2921[_0x0ba7('0x4a')]['id'];}return db['VoiceMusicOnHold'][_0x0ba7('0x49')]({'where':{'id':_0x4d2921['params']['id']}})[_0x0ba7('0x25')](handleEntityNotFound(_0x235d8a,null))[_0x0ba7('0x25')](saveUpdates(_0x4d2921[_0x0ba7('0x4a')],null))[_0x0ba7('0x25')](respondWithResult(_0x235d8a,null))['catch'](handleError(_0x235d8a,null));};exports[_0x0ba7('0x4b')]=function(_0xcd386a,_0x3dd206,_0x251f63){return db['sequelize'][_0x0ba7('0x4c')](function(_0x166ea5){if(_0xcd386a[_0x0ba7('0x4a')][_0x0ba7('0x4d')]===_0x0ba7('0x4e')){_0xcd386a[_0x0ba7('0x4a')][_0x0ba7('0x4f')]=path[_0x0ba7('0x50')](config[_0x0ba7('0x51')],_0x0ba7('0x52'),_0xcd386a[_0x0ba7('0x4a')][_0x0ba7('0x2a')]);}return db[_0x0ba7('0x2e')][_0x0ba7('0x4b')](_0xcd386a['body'],{'transaction':_0x166ea5})[_0x0ba7('0x25')](function(_0x18c675){if(_0xcd386a[_0x0ba7('0x4a')][_0x0ba7('0x4d')]===_0x0ba7('0x4e')){fs[_0x0ba7('0x53')](_0x18c675[_0x0ba7('0x4f')],parseInt(_0x0ba7('0x54'),0x8));}var _0x3bb44c=_0xcd386a[_0x0ba7('0x55')]['get']({'plain':!![]});if(!_0x3bb44c)throw new Error(_0x0ba7('0x56'));if(_0x3bb44c[_0x0ba7('0x57')]===_0x0ba7('0x55')){var _0x154476=_0x18c675[_0x0ba7('0x27')]({'plain':!![]});return db[_0x0ba7('0x58')][_0x0ba7('0x49')]({'where':{'name':'MusicOnHolds','userProfileId':_0x3bb44c[_0x0ba7('0x59')]},'raw':!![]})['then'](function(_0x434f82){if(_0x434f82&&_0x434f82[_0x0ba7('0x5a')]===0x0){return db[_0x0ba7('0x5b')]['create']({'name':_0x154476[_0x0ba7('0x2a')],'resourceId':_0x154476['id'],'type':_0x434f82[_0x0ba7('0x2a')],'sectionId':_0x434f82['id']},{})[_0x0ba7('0x25')](function(){return _0x18c675;});}else{return _0x18c675;}})[_0x0ba7('0x45')](function(_0x3c6275){logger[_0x0ba7('0x28')](_0x0ba7('0x5c'),_0x3c6275);});}return _0x18c675;});})[_0x0ba7('0x25')](respondWithResult(_0x3dd206,0xc9))[_0x0ba7('0x45')](handleError(_0x3dd206,null));};exports[_0x0ba7('0x26')]=function(_0x5df80a,_0x365cb8,_0x77450){var _0x46fd8b;return db[_0x0ba7('0x2e')][_0x0ba7('0x49')]({'where':{'id':_0x5df80a[_0x0ba7('0x47')]['id']}})[_0x0ba7('0x25')](function(_0x214b6d){if(_0x214b6d){return db['sequelize'][_0x0ba7('0x4c')](function(_0x5b0330){return _0x214b6d[_0x0ba7('0x26')]({'transaction':_0x5b0330,'raw':!![]})[_0x0ba7('0x25')](function(_0x1140e5){if(_0x1140e5[_0x0ba7('0x4f')]){fs['readdirSync'](_0x1140e5[_0x0ba7('0x4f')])[_0x0ba7('0x5d')](function(_0x4b08f1){fs[_0x0ba7('0x5e')](path[_0x0ba7('0x50')](_0x1140e5[_0x0ba7('0x4f')],_0x4b08f1));});fs[_0x0ba7('0x5f')](_0x1140e5['directory']);}return _0x1140e5;});})[_0x0ba7('0x45')](function(_0x1539da){throw new db[(_0x0ba7('0x60'))]['ValidationError'](_0x1539da[_0x0ba7('0x61')]);});}})[_0x0ba7('0x25')](handleEntityNotFound(_0x365cb8,null))[_0x0ba7('0x25')](removeEntity(_0x365cb8,null))['catch'](handleError(_0x365cb8,null));};exports[_0x0ba7('0x62')]=function(_0x384962,_0x1e3af0,_0x2f3a3f){return db[_0x0ba7('0x63')][_0x0ba7('0x4c')](function(_0x24a443){var _0x15e840;return db[_0x0ba7('0x2e')]['find']({'where':{'id':_0x384962[_0x0ba7('0x47')]['id']}})[_0x0ba7('0x25')](function(_0x43ffb4){if(_0x43ffb4){_0x15e840=_0x43ffb4;return _0x43ffb4['addSound'](_0x384962[_0x0ba7('0x4a')]['id'],{'transaction':_0x24a443});}})[_0x0ba7('0x25')](function(_0x24c914){if(_0x24c914){return db['Sound'][_0x0ba7('0x64')]({'where':{'id':_0x384962[_0x0ba7('0x4a')]['id']},'attributes':['id',_0x0ba7('0x2a'),_0x0ba7('0x65'),'converted_format',_0x0ba7('0x66')],'raw':!![]});}})[_0x0ba7('0x25')](function(_0x5e99fc){if(_0x5e99fc){var _0x4b7cb7=path[_0x0ba7('0x50')](config[_0x0ba7('0x51')],_0x0ba7('0x67'),util['format'](_0x0ba7('0x68'),path[_0x0ba7('0x69')](_0x5e99fc[_0x0ba7('0x65')],path[_0x0ba7('0x6a')](_0x5e99fc['save_name'])),_0x5e99fc['converted_format']));var _0x39126e=path['join'](config[_0x0ba7('0x51')],_0x0ba7('0x52'),_0x15e840['name'],util[_0x0ba7('0x6b')](_0x0ba7('0x68'),_0x5e99fc[_0x0ba7('0x2a')],_0x5e99fc[_0x0ba7('0x6c')]));fs[_0x0ba7('0x6d')](_0x4b7cb7,_0x39126e);return _0x5e99fc;}})['catch'](function(_0x4ab44e){throw new db['Sequelize']['ValidationError'](_0x4ab44e[_0x0ba7('0x61')]);});})['then'](handleEntityNotFound(_0x1e3af0,null))['then'](respondWithResult(_0x1e3af0,0xc9))[_0x0ba7('0x45')](handleError(_0x1e3af0,null));};exports[_0x0ba7('0x6e')]=function(_0x54d76c,_0x5c44d1,_0x2b2d9c){return db[_0x0ba7('0x63')]['transaction'](function(_0x85feb0){var _0x452aa8;return db[_0x0ba7('0x2e')][_0x0ba7('0x64')]({'where':{'id':_0x54d76c['params']['id']}})[_0x0ba7('0x25')](handleEntityNotFound(_0x5c44d1,null))[_0x0ba7('0x25')](function(_0x1121a3){if(_0x1121a3){_0x452aa8=_0x1121a3;return _0x1121a3[_0x0ba7('0x6e')](_0x54d76c[_0x0ba7('0x47')][_0x0ba7('0x6f')]);}})[_0x0ba7('0x25')](function(_0x5f0b91){if(_0x5f0b91){return db['Sound']['findOne']({'where':{'id':_0x54d76c[_0x0ba7('0x47')][_0x0ba7('0x6f')]},'attributes':['id','name',_0x0ba7('0x65'),_0x0ba7('0x6c'),'createdAt'],'raw':!![]});}})[_0x0ba7('0x25')](function(_0x125f9a){if(_0x125f9a){fs[_0x0ba7('0x5e')](path[_0x0ba7('0x50')](_0x452aa8[_0x0ba7('0x4f')],util[_0x0ba7('0x6b')](_0x0ba7('0x68'),_0x125f9a['name'],_0x125f9a[_0x0ba7('0x6c')])));return _0x125f9a;}})[_0x0ba7('0x45')](function(_0x57aa89){throw new db[(_0x0ba7('0x60'))][(_0x0ba7('0x70'))](_0x57aa89[_0x0ba7('0x61')]);});})[_0x0ba7('0x25')](handleEntityNotFound(_0x5c44d1,null))['then'](respondWithStatusCode(_0x5c44d1,0xcc))['catch'](handleError(_0x5c44d1,null));};exports['getSounds']=function(_0x589b5c,_0x1f0492,_0x2ec811){var _0x1979b2={};var _0x402814={};var _0x3d9369;var _0x46bc93;return db[_0x0ba7('0x2e')]['findOne']({'where':{'id':_0x589b5c[_0x0ba7('0x47')]['id']}})[_0x0ba7('0x25')](handleEntityNotFound(_0x1f0492,null))['then'](function(_0x10c2a2){if(_0x10c2a2){_0x3d9369=_0x10c2a2;_0x402814[_0x0ba7('0x33')]=_[_0x0ba7('0x48')](db['Sound'][_0x0ba7('0x2f')]);_0x402814['query']=_['keys'](_0x589b5c[_0x0ba7('0x34')]);_0x402814[_0x0ba7('0x3c')]=_[_0x0ba7('0x35')](_0x402814[_0x0ba7('0x33')],_0x402814[_0x0ba7('0x34')]);_0x1979b2[_0x0ba7('0x36')]=_['intersection'](_0x402814[_0x0ba7('0x33')],qs[_0x0ba7('0x37')](_0x589b5c[_0x0ba7('0x34')]['fields']));_0x1979b2[_0x0ba7('0x36')]=_0x1979b2[_0x0ba7('0x36')][_0x0ba7('0x38')]?_0x1979b2[_0x0ba7('0x36')]:_0x402814['model'];_0x1979b2[_0x0ba7('0x39')]=qs[_0x0ba7('0x3a')](_0x589b5c[_0x0ba7('0x34')][_0x0ba7('0x3a')]);_0x1979b2[_0x0ba7('0x3b')]=qs['filters'](_[_0x0ba7('0x3d')](_0x589b5c[_0x0ba7('0x34')],_0x402814['filters']));if(_0x589b5c[_0x0ba7('0x34')][_0x0ba7('0x40')]){_0x1979b2[_0x0ba7('0x3b')]=_['merge'](_0x1979b2['where'],{'$or':_[_0x0ba7('0x2d')](_0x1979b2[_0x0ba7('0x36')],function(_0x4c4b74){var _0x134048={};_0x134048[_0x4c4b74]={'$like':'%'+_0x589b5c[_0x0ba7('0x34')][_0x0ba7('0x40')]+'%'};return _0x134048;})});}_0x1979b2=_[_0x0ba7('0x3e')]({},_0x1979b2,_0x589b5c[_0x0ba7('0x41')]);return _0x3d9369[_0x0ba7('0x71')](_0x1979b2);}})['then'](function(_0x5a1b6e){if(_0x5a1b6e){_0x46bc93=_0x5a1b6e[_0x0ba7('0x38')];if(!_0x589b5c['query'][_0x0ba7('0x72')](_0x0ba7('0x73'))){_0x1979b2['limit']=qs['limit'](_0x589b5c[_0x0ba7('0x34')][_0x0ba7('0x20')]);_0x1979b2['offset']=qs[_0x0ba7('0x1f')](_0x589b5c[_0x0ba7('0x34')][_0x0ba7('0x1f')]);}return _0x3d9369[_0x0ba7('0x71')](_0x1979b2);}})['then'](function(_0x4bbc28){if(_0x4bbc28){return _0x4bbc28?{'count':_0x46bc93,'rows':_0x4bbc28}:null;}})[_0x0ba7('0x25')](respondWithResult(_0x1f0492,null))['catch'](handleError(_0x1f0492,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index a2c7386..464e3a6 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 _0xbded=['exports','define','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./voiceMusicOnHold.attributes'];(function(_0x874cf1,_0x2a4954){var _0x233579=function(_0xa6e939){while(--_0xa6e939){_0x874cf1['push'](_0x874cf1['shift']());}};_0x233579(++_0x2a4954);}(_0xbded,0xc8));var _0xdbde=function(_0x4a2089,_0xcf3082){_0x4a2089=_0x4a2089-0x0;var _0x31c79e=_0xbded[_0x4a2089];return _0x31c79e;};'use strict';var _=require(_0xdbde('0x0'));var util=require(_0xdbde('0x1'));var logger=require(_0xdbde('0x2'))(_0xdbde('0x3'));var moment=require(_0xdbde('0x4'));var BPromise=require('bluebird');var rp=require(_0xdbde('0x5'));var fs=require('fs');var path=require(_0xdbde('0x6'));var rimraf=require(_0xdbde('0x7'));var config=require('../../config/environment');var attributes=require(_0xdbde('0x8'));module[_0xdbde('0x9')]=function(_0x2772df,_0x22412e){return _0x2772df[_0xdbde('0xa')]('VoiceMusicOnHold',attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4341=['rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','util','../../config/logger','moment','bluebird','path'];(function(_0x1ce712,_0x11536c){var _0x5ebfd7=function(_0x4708ec){while(--_0x4708ec){_0x1ce712['push'](_0x1ce712['shift']());}};_0x5ebfd7(++_0x11536c);}(_0x4341,0x187));var _0x1434=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x4341[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var util=require(_0x1434('0x0'));var logger=require(_0x1434('0x1'))('api');var moment=require(_0x1434('0x2'));var BPromise=require(_0x1434('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1434('0x4'));var rimraf=require(_0x1434('0x5'));var config=require(_0x1434('0x6'));var attributes=require(_0x1434('0x7'));module[_0x1434('0x8')]=function(_0x5d7bad,_0x20fa76){return _0x5d7bad[_0x1434('0x9')](_0x1434('0xa'),attributes,{'tableName':_0x1434('0xb'),'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 c1b8820..7c61aac 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 _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x524ad9,_0x372284){var _0x574889=function(_0x26ee1f){while(--_0x26ee1f){_0x524ad9['push'](_0x524ad9['shift']());}};_0x574889(++_0x372284);}(_0x70e0,0x17b));var _0x070e=function(_0x3dbd87,_0x5d9fd7){_0x3dbd87=_0x3dbd87-0x0;var _0x43c225=_0x70e0[_0x3dbd87];return _0x43c225;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5991ae,_0xc13a9c){var _0x579f93=function(_0x397cc8){while(--_0x397cc8){_0x5991ae['push'](_0x5991ae['shift']());}};_0x579f93(++_0xc13a9c);}(_0x70e0,0x17b));var _0x070e=function(_0x14b68c,_0x1a343d){_0x14b68c=_0x14b68c-0x0;var _0x26c03a=_0x70e0[_0x14b68c];return _0x26c03a;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 0d271a8..a410501 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 _0xcb99=['/:id/users','/:id/teams','addTeams','put','update','delete','destroy','removeAgents','exports','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./voicePrefix.controller','isAuthenticated','get','/describe','describe','/:id','show','getAgents','getTeams','create','post'];(function(_0x1049e5,_0x280bab){var _0x2e37f8=function(_0x26e2d0){while(--_0x26e2d0){_0x1049e5['push'](_0x1049e5['shift']());}};_0x2e37f8(++_0x280bab);}(_0xcb99,0x8b));var _0x9cb9=function(_0x2847ec,_0x40ce19){_0x2847ec=_0x2847ec-0x0;var _0x507988=_0xcb99[_0x2847ec];return _0x507988;};'use strict';var multer=require(_0x9cb9('0x0'));var util=require('util');var path=require(_0x9cb9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9cb9('0x2')]();var fs_extra=require(_0x9cb9('0x3'));var auth=require(_0x9cb9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9cb9('0x5'));var controller=require(_0x9cb9('0x6'));router['get']('/',auth[_0x9cb9('0x7')](),controller['index']);router[_0x9cb9('0x8')](_0x9cb9('0x9'),auth[_0x9cb9('0x7')](),controller[_0x9cb9('0xa')]);router[_0x9cb9('0x8')](_0x9cb9('0xb'),auth[_0x9cb9('0x7')](),controller[_0x9cb9('0xc')]);router['get']('/:id/users',auth[_0x9cb9('0x7')](),controller[_0x9cb9('0xd')]);router[_0x9cb9('0x8')]('/:id/teams',auth[_0x9cb9('0x7')](),controller[_0x9cb9('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9cb9('0xf')]);router[_0x9cb9('0x10')](_0x9cb9('0x11'),auth[_0x9cb9('0x7')](),controller['addAgents']);router[_0x9cb9('0x10')](_0x9cb9('0x12'),auth[_0x9cb9('0x7')](),controller[_0x9cb9('0x13')]);router[_0x9cb9('0x14')](_0x9cb9('0xb'),auth[_0x9cb9('0x7')](),controller[_0x9cb9('0x15')]);router[_0x9cb9('0x16')](_0x9cb9('0xb'),auth[_0x9cb9('0x7')](),controller[_0x9cb9('0x17')]);router[_0x9cb9('0x16')](_0x9cb9('0x11'),auth[_0x9cb9('0x7')](),controller[_0x9cb9('0x18')]);router[_0x9cb9('0x16')](_0x9cb9('0x12'),auth['isAuthenticated'](),controller['removeTeams']);module[_0x9cb9('0x19')]=router; \ No newline at end of file +var _0x5a52=['create','addAgents','addTeams','delete','destroy','removeTeams','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/users','getAgents','/:id/teams','getTeams','post'];(function(_0x4b2d55,_0xf0783b){var _0x457a6e=function(_0x1ec896){while(--_0x1ec896){_0x4b2d55['push'](_0x4b2d55['shift']());}};_0x457a6e(++_0xf0783b);}(_0x5a52,0x18d));var _0x25a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a52[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x25a5('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x25a5('0x1'));var router=express[_0x25a5('0x2')]();var fs_extra=require(_0x25a5('0x3'));var auth=require(_0x25a5('0x4'));var interaction=require(_0x25a5('0x5'));var config=require(_0x25a5('0x6'));var controller=require(_0x25a5('0x7'));router[_0x25a5('0x8')]('/',auth['isAuthenticated'](),controller[_0x25a5('0x9')]);router['get'](_0x25a5('0xa'),auth[_0x25a5('0xb')](),controller[_0x25a5('0xc')]);router[_0x25a5('0x8')](_0x25a5('0xd'),auth[_0x25a5('0xb')](),controller['show']);router['get'](_0x25a5('0xe'),auth[_0x25a5('0xb')](),controller[_0x25a5('0xf')]);router[_0x25a5('0x8')](_0x25a5('0x10'),auth[_0x25a5('0xb')](),controller[_0x25a5('0x11')]);router[_0x25a5('0x12')]('/',auth['isAuthenticated'](),controller[_0x25a5('0x13')]);router[_0x25a5('0x12')](_0x25a5('0xe'),auth['isAuthenticated'](),controller[_0x25a5('0x14')]);router['post'](_0x25a5('0x10'),auth[_0x25a5('0xb')](),controller[_0x25a5('0x15')]);router['put']('/:id',auth[_0x25a5('0xb')](),controller['update']);router[_0x25a5('0x16')](_0x25a5('0xd'),auth[_0x25a5('0xb')](),controller[_0x25a5('0x17')]);router['delete'](_0x25a5('0xe'),auth['isAuthenticated'](),controller['removeAgents']);router[_0x25a5('0x16')](_0x25a5('0x10'),auth[_0x25a5('0xb')](),controller[_0x25a5('0x18')]);module[_0x25a5('0x19')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index d3e18ce..7f53e01 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 _0x41bd=['INTEGER','sequelize','name','system-','STRING'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x41bd,0x1e6));var _0xd41b=function(_0x114dc4,_0x262575){_0x114dc4=_0x114dc4-0x0;var _0x9b4f2c=_0x41bd[_0x114dc4];return _0x9b4f2c;};'use strict';var Sequelize=require(_0xd41b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd41b('0x1')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x5a5de4){return _0xd41b('0x2')+this['getDataValue'](_0xd41b('0x1'))+'-';}},'description':{'type':Sequelize[_0xd41b('0x3')]},'callerIdAll':{'type':Sequelize[_0xd41b('0x3')]},'VoiceExtensionId':{'type':Sequelize[_0xd41b('0x4')]}}; \ No newline at end of file +var _0x3388=['name','VIRTUAL','getDataValue','INTEGER','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3388,0x17e));var _0x8338=function(_0x467aba,_0xecc43c){_0x467aba=_0x467aba-0x0;var _0x350faf=_0x3388[_0x467aba];return _0x350faf;};'use strict';var Sequelize=require('sequelize');module[_0x8338('0x0')]={'name':{'type':Sequelize[_0x8338('0x1')],'allowNull':![],'unique':_0x8338('0x2')},'prefix':{'type':Sequelize[_0x8338('0x3')],'get':function(_0x42b528){return'system-'+this[_0x8338('0x4')]('name')+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x8338('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x8338('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index f329ac9..1699a4b 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 _0xb9be=['addAgents','emit','userVoicePrefix:save','ids','isArray','userVoicePrefix:remove','getAgents','findOne','order','Team','pick','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','removeTeams','User','select','field','tq.TeamId','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','union','compact','value','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','./voicePrefix.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','VoicePrefixes','error','name','index','map','VoicePrefix','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','create','sequelize','transaction','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','VoicePrefixId','VoiceExtension','bulkCreate','prefix','push','CDR(prefix)=','Set','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-'];(function(_0x22c393,_0x1f2389){var _0x161580=function(_0x3bd765){while(--_0x3bd765){_0x22c393['push'](_0x22c393['shift']());}};_0x161580(++_0x1f2389);}(_0xb9be,0xc5));var _0xeb9b=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0xb9be[_0x2aecb2];return _0x3ebb80;};'use strict';var emlformat=require(_0xeb9b('0x0'));var rimraf=require(_0xeb9b('0x1'));var zipdir=require(_0xeb9b('0x2'));var jsonpatch=require(_0xeb9b('0x3'));var rp=require(_0xeb9b('0x4'));var moment=require(_0xeb9b('0x5'));var BPromise=require(_0xeb9b('0x6'));var Mustache=require(_0xeb9b('0x7'));var util=require(_0xeb9b('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xeb9b('0x9'));var ejs=require(_0xeb9b('0xa'));var fs=require('fs');var fs_extra=require(_0xeb9b('0xb'));var _=require('lodash');var squel=require(_0xeb9b('0xc'));var crypto=require(_0xeb9b('0xd'));var jsforce=require(_0xeb9b('0xe'));var deskjs=require(_0xeb9b('0xf'));var toCsv=require(_0xeb9b('0x9'));var querystring=require(_0xeb9b('0x10'));var Papa=require(_0xeb9b('0x11'));var Redis=require(_0xeb9b('0x12'));var authService=require(_0xeb9b('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xeb9b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xeb9b('0x15'));var utils=require(_0xeb9b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xeb9b('0x17'));var db=require(_0xeb9b('0x18'))['db'];config[_0xeb9b('0x19')]=_[_0xeb9b('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeb9b('0x19')]));require(_0xeb9b('0x1b'))[_0xeb9b('0x1c')](socket);function respondWithStatusCode(_0x4ec46d,_0x5926e1){_0x5926e1=_0x5926e1||0xcc;return function(_0x4f8182){if(_0x4f8182){return _0x4ec46d[_0xeb9b('0x1d')](_0x5926e1);}return _0x4ec46d[_0xeb9b('0x1e')](_0x5926e1)[_0xeb9b('0x1f')]();};}function respondWithResult(_0x3fa308,_0x2c9aa6){_0x2c9aa6=_0x2c9aa6||0xc8;return function(_0x10da6e){if(_0x10da6e){return _0x3fa308[_0xeb9b('0x1e')](_0x2c9aa6)['json'](_0x10da6e);}};}function respondWithFilteredResult(_0x2e8645,_0x36e871){return function(_0x21aca6){if(_0x21aca6){var _0x3a11e3=typeof _0x36e871[_0xeb9b('0x20')]===_0xeb9b('0x21')&&typeof _0x36e871[_0xeb9b('0x22')]===_0xeb9b('0x21');var _0x2c199f=_0x21aca6[_0xeb9b('0x23')];var _0x4f436e=_0x3a11e3?0x0:_0x36e871[_0xeb9b('0x20')];var _0x5a7ffd=_0x3a11e3?_0x21aca6['count']:_0x36e871[_0xeb9b('0x20')]+_0x36e871[_0xeb9b('0x22')];var _0x4ab4b8;if(_0x5a7ffd>=_0x2c199f){_0x5a7ffd=_0x2c199f;_0x4ab4b8=0xc8;}else{_0x4ab4b8=0xce;}_0x2e8645[_0xeb9b('0x1e')](_0x4ab4b8);return _0x2e8645[_0xeb9b('0x24')](_0xeb9b('0x25'),_0x4f436e+'-'+_0x5a7ffd+'/'+_0x2c199f)[_0xeb9b('0x26')](_0x21aca6);}return null;};}function patchUpdates(_0x3c8be7){return function(_0x43dab8){try{jsonpatch[_0xeb9b('0x27')](_0x43dab8,_0x3c8be7,!![]);}catch(_0x15e5b8){return BPromise[_0xeb9b('0x28')](_0x15e5b8);}return _0x43dab8[_0xeb9b('0x29')]();};}function saveUpdates(_0x61c86d,_0x296f95){return function(_0x1a4faf){if(_0x1a4faf){return _0x1a4faf[_0xeb9b('0x2a')](_0x61c86d)[_0xeb9b('0x2b')](function(_0x434461){return _0x434461;});}return null;};}function removeEntity(_0x4c997e,_0xd57390){return function(_0x4ed960){if(_0x4ed960){return _0x4ed960[_0xeb9b('0x2c')]()['then'](function(){var _0x347ec1=_0x4ed960[_0xeb9b('0x2d')]({'plain':!![]});var _0x7e0134=_0xeb9b('0x2e');return db['UserProfileResource'][_0xeb9b('0x2c')]({'where':{'type':_0x7e0134,'resourceId':_0x347ec1['id']}})[_0xeb9b('0x2b')](function(){return _0x4ed960;});})['then'](function(){_0x4c997e[_0xeb9b('0x1e')](0xcc)[_0xeb9b('0x1f')]();});}};}function handleEntityNotFound(_0x5ce745,_0x2a4b51){return function(_0x2ea20f){if(!_0x2ea20f){_0x5ce745[_0xeb9b('0x1d')](0x194);}return _0x2ea20f;};}function handleError(_0x48c5f4,_0x309bad){_0x309bad=_0x309bad||0x1f4;return function(_0x5336f2){logger[_0xeb9b('0x2f')](_0x5336f2['stack']);if(_0x5336f2[_0xeb9b('0x30')]){delete _0x5336f2['name'];}_0x48c5f4[_0xeb9b('0x1e')](_0x309bad)['send'](_0x5336f2);};}exports[_0xeb9b('0x31')]=function(_0x4c8e4c,_0x25b8da){var _0x370dbe={},_0x20e577={},_0x2e6034={'count':0x0,'rows':[]};var _0x112129=_[_0xeb9b('0x32')](db[_0xeb9b('0x33')][_0xeb9b('0x34')],function(_0x41e6c4){return{'name':_0x41e6c4[_0xeb9b('0x35')],'type':_0x41e6c4['type'][_0xeb9b('0x36')]};});_0x20e577[_0xeb9b('0x37')]=_[_0xeb9b('0x32')](_0x112129,_0xeb9b('0x30'));_0x20e577[_0xeb9b('0x38')]=_[_0xeb9b('0x39')](_0x4c8e4c[_0xeb9b('0x38')]);_0x20e577['filters']=_[_0xeb9b('0x3a')](_0x20e577[_0xeb9b('0x37')],_0x20e577[_0xeb9b('0x38')]);_0x370dbe['attributes']=_[_0xeb9b('0x3a')](_0x20e577[_0xeb9b('0x37')],qs[_0xeb9b('0x3b')](_0x4c8e4c[_0xeb9b('0x38')][_0xeb9b('0x3b')]));_0x370dbe[_0xeb9b('0x3c')]=_0x370dbe['attributes'][_0xeb9b('0x3d')]?_0x370dbe[_0xeb9b('0x3c')]:_0x20e577['model'];if(!_0x4c8e4c[_0xeb9b('0x38')][_0xeb9b('0x3e')](_0xeb9b('0x3f'))){_0x370dbe[_0xeb9b('0x22')]=qs[_0xeb9b('0x22')](_0x4c8e4c[_0xeb9b('0x38')][_0xeb9b('0x22')]);_0x370dbe['offset']=qs[_0xeb9b('0x20')](_0x4c8e4c[_0xeb9b('0x38')][_0xeb9b('0x20')]);}_0x370dbe['order']=qs['sort'](_0x4c8e4c['query'][_0xeb9b('0x40')]);_0x370dbe[_0xeb9b('0x41')]=qs[_0xeb9b('0x42')](_['pick'](_0x4c8e4c[_0xeb9b('0x38')],_0x20e577[_0xeb9b('0x42')]),_0x112129);if(_0x4c8e4c[_0xeb9b('0x38')][_0xeb9b('0x43')]){_0x370dbe[_0xeb9b('0x41')]=_[_0xeb9b('0x44')](_0x370dbe[_0xeb9b('0x41')],{'$or':_['map'](_0x112129,function(_0x5e597a){if(_0x5e597a[_0xeb9b('0x45')]!==_0xeb9b('0x46')){var _0x4ee3cd={};_0x4ee3cd[_0x5e597a['name']]={'$like':'%'+_0x4c8e4c[_0xeb9b('0x38')][_0xeb9b('0x43')]+'%'};return _0x4ee3cd;}})});}_0x370dbe=_['merge']({},_0x370dbe,_0x4c8e4c[_0xeb9b('0x47')]);var _0x535e73={'where':_0x370dbe[_0xeb9b('0x41')]};return db[_0xeb9b('0x33')][_0xeb9b('0x23')](_0x535e73)[_0xeb9b('0x2b')](function(_0xbee63e){_0x2e6034[_0xeb9b('0x23')]=_0xbee63e;if(_0x4c8e4c[_0xeb9b('0x38')][_0xeb9b('0x48')]){_0x370dbe[_0xeb9b('0x49')]=[{'all':!![]}];}return db[_0xeb9b('0x33')][_0xeb9b('0x4a')](_0x370dbe);})[_0xeb9b('0x2b')](function(_0x5e270a){_0x2e6034['rows']=_0x5e270a;return _0x2e6034;})[_0xeb9b('0x2b')](respondWithFilteredResult(_0x25b8da,_0x370dbe))['catch'](handleError(_0x25b8da,null));};exports[_0xeb9b('0x4b')]=function(_0x232731,_0x2c00ed){var _0x5eee9b={'raw':![],'where':{'id':_0x232731[_0xeb9b('0x4c')]['id']}},_0x1e2d25={};_0x1e2d25['model']=_[_0xeb9b('0x39')](db[_0xeb9b('0x33')][_0xeb9b('0x34')]);_0x1e2d25[_0xeb9b('0x38')]=_[_0xeb9b('0x39')](_0x232731[_0xeb9b('0x38')]);_0x1e2d25[_0xeb9b('0x42')]=_[_0xeb9b('0x3a')](_0x1e2d25['model'],_0x1e2d25['query']);_0x5eee9b[_0xeb9b('0x3c')]=_['intersection'](_0x1e2d25['model'],qs[_0xeb9b('0x3b')](_0x232731[_0xeb9b('0x38')][_0xeb9b('0x3b')]));_0x5eee9b[_0xeb9b('0x3c')]=_0x5eee9b[_0xeb9b('0x3c')][_0xeb9b('0x3d')]?_0x5eee9b['attributes']:_0x1e2d25['model'];if(_0x232731['query'][_0xeb9b('0x48')]){_0x5eee9b['include']=[{'all':!![]}];}_0x5eee9b=_[_0xeb9b('0x44')]({},_0x5eee9b,_0x232731[_0xeb9b('0x47')]);return db[_0xeb9b('0x33')][_0xeb9b('0x4d')](_0x5eee9b)[_0xeb9b('0x2b')](handleEntityNotFound(_0x2c00ed,null))[_0xeb9b('0x2b')](respondWithResult(_0x2c00ed,null))[_0xeb9b('0x4e')](handleError(_0x2c00ed,null));};exports[_0xeb9b('0x2c')]=function(_0x34755f,_0x28968b){return db['VoicePrefix']['find']({'where':{'id':_0x34755f[_0xeb9b('0x4c')]['id']}})[_0xeb9b('0x2b')](handleEntityNotFound(_0x28968b,null))['then'](removeEntity(_0x28968b,null))[_0xeb9b('0x4e')](handleError(_0x28968b,null));};exports['describe']=function(_0x2ceb23,_0x1f7b31){return db['VoicePrefix']['describe']()['then'](respondWithResult(_0x1f7b31,null))[_0xeb9b('0x4e')](handleError(_0x1f7b31,null));};exports[_0xeb9b('0x4f')]=function(_0x263453,_0x4fe9d0){var _0x4ded40;return db[_0xeb9b('0x50')][_0xeb9b('0x51')](function(_0x3e6e73){return db[_0xeb9b('0x33')][_0xeb9b('0x4f')](_0x263453[_0xeb9b('0x52')],{'transaction':_0x3e6e73})['then'](function(_0x20dbea){_0x4ded40=_0x20dbea[_0xeb9b('0x2d')]({'plain':!![]});return db['VoiceExtension'][_0xeb9b('0x4d')]({'where':{'id':_0x4ded40['VoiceExtensionId']},'raw':!![]})[_0xeb9b('0x2b')](function(_0x12f8d6){return createVoicePrefixExtensions(_0x4ded40,_0x12f8d6,_0x3e6e73);});});})['then'](function(){var _0x396aa9=_0x263453['user'][_0xeb9b('0x2d')]({'plain':!![]});if(!_0x396aa9)throw new Error(_0xeb9b('0x53'));if(_0x396aa9[_0xeb9b('0x54')]===_0xeb9b('0x55')){var _0x5c769e=_0x4ded40;return db['UserProfileSection'][_0xeb9b('0x4d')]({'where':{'name':_0xeb9b('0x2e'),'userProfileId':_0x396aa9[_0xeb9b('0x56')]},'raw':!![]})['then'](function(_0x3126d9){if(_0x3126d9&&_0x3126d9[_0xeb9b('0x57')]===0x0){return db[_0xeb9b('0x58')][_0xeb9b('0x4f')]({'name':_0x5c769e[_0xeb9b('0x30')],'resourceId':_0x5c769e['id'],'type':_0x3126d9[_0xeb9b('0x30')],'sectionId':_0x3126d9['id']},{})[_0xeb9b('0x2b')](function(){return _0x4ded40;});}else{return _0x4ded40;}})[_0xeb9b('0x4e')](function(_0x2f8b0f){logger[_0xeb9b('0x2f')](_0xeb9b('0x59'),_0x2f8b0f);throw _0x2f8b0f;});}return _0x4ded40;})['then'](respondWithResult(_0x4fe9d0,null))['catch'](handleError(_0x4fe9d0,null));};function Extension(_0x4b2506,_0x83d48a,_0x4cf8bf,_0x34ff5f){this[_0xeb9b('0x5a')]=_0xeb9b('0x5b');this['exten']=_0x4b2506;this[_0xeb9b('0x5c')]=_0x4cf8bf;this[_0xeb9b('0x45')]=_0xeb9b('0x5d');this[_0xeb9b('0x5e')]=_0xeb9b('0x5f');this[_0xeb9b('0x60')]=_0x83d48a;this[_0xeb9b('0x61')]=_0x34ff5f;}function createVoicePrefixExtensions(_0x295d81,_0x58a3e2,_0x5b55a6){return new BPromise(function(_0x27a445,_0x37f20c){var _0xa0146b=new Extension(formatPrefixName(_0x295d81['prefix']),0x1,_0xeb9b('0x62'),'Voice\x20Prefix');_0xa0146b[_0xeb9b('0x63')]=_0x295d81['id'];return db['VoiceExtension'][_0xeb9b('0x4f')](_0xa0146b,{'transaction':_0x5b55a6})[_0xeb9b('0x2b')](function(_0x3d223f){var _0x1b2a7a=_0x3d223f[_0xeb9b('0x2d')]({'plain':!![]});var _0x4be938=_[_0xeb9b('0x32')](addVoicePrefixExtensions(_0x295d81,_0x58a3e2),function(_0x1c7569){_0x1c7569['VoiceExtensionId']=_0x1b2a7a['id'];_0x1c7569['VoicePrefixId']=_0x295d81['id'];return _0x1c7569;});return db[_0xeb9b('0x64')][_0xeb9b('0x65')](_0x4be938,{'transaction':_0x5b55a6})['then'](function(_0xeb81b9){if(!_0xeb81b9){return _0x37f20c('Extensions\x20creation\x20failed');}else{return _0x27a445(_0xeb81b9);}})[_0xeb9b('0x4e')](function(_0x515a97){return _0x37f20c(_0x515a97);});});;});};function addVoicePrefixExtensions(_0x36376f,_0x382d3a){var _0x417221=[];var _0x1fea34=formatPrefixName(_0x36376f[_0xeb9b('0x66')]);_0x417221[_0xeb9b('0x67')](new Extension(_0x1fea34,0x2,'Set',_0xeb9b('0x68')+_0x36376f[_0xeb9b('0x30')]));if(_0x36376f['callerIdAll']){_0x417221[_0xeb9b('0x67')](new Extension(_0x1fea34,0x3,_0xeb9b('0x69'),_0xeb9b('0x6a')+_0x36376f[_0xeb9b('0x6b')]));}else{_0x417221['push'](new Extension(_0x1fea34,0x3,_0xeb9b('0x62'),_0xeb9b('0x6c')));}_0x417221['push'](new Extension(_0x1fea34,0x4,_0xeb9b('0x6d'),_0x382d3a[_0xeb9b('0x5a')]+','+_0xeb9b('0x6e')+(0x8+_0x36376f[_0xeb9b('0x30')][_0xeb9b('0x3d')])+'}'+','+0x1));return _0x417221;}function formatPrefixName(_0x48b0ec){var _0x3f9ce0='_';for(var _0x4a48f6=0x0;_0x4a48f6<_0x48b0ec[_0xeb9b('0x3d')];_0x4a48f6++){if(_0x48b0ec[_0xeb9b('0x6f')](_0x4a48f6)=='-'){_0x3f9ce0+=_0x48b0ec['charAt'](_0x4a48f6);}else{_0x3f9ce0+='['+_0x48b0ec[_0xeb9b('0x6f')](_0x4a48f6)+']';}}_0x3f9ce0+='.';return _0x3f9ce0;}exports[_0xeb9b('0x2a')]=function(_0x2fb07e,_0x25398e,_0x51de75){var _0xb0080f=_0x2fb07e[_0xeb9b('0x52')];_0xb0080f[_0xeb9b('0x66')]=_0xeb9b('0x70')+_0xb0080f[_0xeb9b('0x30')]+'-';return db[_0xeb9b('0x50')][_0xeb9b('0x51')](function(_0x3836bd){return db[_0xeb9b('0x33')][_0xeb9b('0x2a')](_0xb0080f,{'where':{'id':_0xb0080f['id']},'transaction':_0x3836bd})[_0xeb9b('0x2b')](function(){return db[_0xeb9b('0x64')][_0xeb9b('0x2c')]({'where':{'VoicePrefixId':_0xb0080f['id']},'transaction':_0x3836bd})[_0xeb9b('0x2b')](function(){return db[_0xeb9b('0x64')][_0xeb9b('0x4d')]({'where':{'id':_0xb0080f['VoiceExtensionId']},'raw':!![]})[_0xeb9b('0x2b')](function(_0x3e4ef2){return createVoicePrefixExtensions(_0xb0080f,_0x3e4ef2,_0x3836bd);});});});})[_0xeb9b('0x2b')](function(){return db['VoicePrefix']['findById'](_0xb0080f['id']);})[_0xeb9b('0x2b')](respondWithResult(_0x25398e,null))['catch'](handleError(_0x25398e,null));};exports[_0xeb9b('0x71')]=function(_0x463767,_0x279f71,_0x12a271){return db[_0xeb9b('0x33')][_0xeb9b('0x4d')]({'where':{'id':_0x463767[_0xeb9b('0x4c')]['id']}})[_0xeb9b('0x2b')](handleEntityNotFound(_0x279f71,null))[_0xeb9b('0x2b')](function(_0x46ce60){if(_0x46ce60){return _0x46ce60[_0xeb9b('0x71')](_0x463767[_0xeb9b('0x52')]['ids'],_['omit'](_0x463767[_0xeb9b('0x52')],['ids','id'])||{})['spread'](function(_0x95e1d0){for(var _0x4bdaf5=0x0;_0x4bdaf5<_0x463767['body']['ids'][_0xeb9b('0x3d')];_0x4bdaf5+=0x1){socket[_0xeb9b('0x72')](_0xeb9b('0x73'),{'UserId':Number(_0x463767[_0xeb9b('0x52')]['ids'][_0x4bdaf5]),'VoicePrefixId':Number(_0x463767[_0xeb9b('0x4c')]['id'])});}return _0x95e1d0;});}})[_0xeb9b('0x2b')](respondWithResult(_0x279f71,null))[_0xeb9b('0x4e')](handleError(_0x279f71,null));};exports['removeAgents']=function(_0x5c010d,_0x3ea644,_0x4ffa9e){return db[_0xeb9b('0x33')]['find']({'where':{'id':_0x5c010d['params']['id']}})[_0xeb9b('0x2b')](handleEntityNotFound(_0x3ea644,null))['then'](function(_0x3aca78){if(_0x3aca78){return _0x3aca78['removeAgents'](_0x5c010d['query'][_0xeb9b('0x74')])[_0xeb9b('0x2b')](function(){if(_[_0xeb9b('0x75')](_0x5c010d[_0xeb9b('0x38')]['ids'])){for(var _0x193ffc=0x0;_0x193ffc<_0x5c010d[_0xeb9b('0x38')][_0xeb9b('0x74')][_0xeb9b('0x3d')];_0x193ffc+=0x1){socket[_0xeb9b('0x72')](_0xeb9b('0x76'),{'UserId':Number(_0x5c010d['query'][_0xeb9b('0x74')][_0x193ffc]),'VoicePrefixId':Number(_0x5c010d['params']['id'])});}}else{socket[_0xeb9b('0x72')](_0xeb9b('0x76'),{'UserId':Number(_0x5c010d['query'][_0xeb9b('0x74')]),'VoicePrefixId':Number(_0x5c010d['params']['id'])});}});}})[_0xeb9b('0x2b')](respondWithStatusCode(_0x3ea644,null))['catch'](handleError(_0x3ea644,null));};exports[_0xeb9b('0x77')]=function(_0x36af5a,_0x41af31,_0x14db1d){var _0x31b0c5={};var _0x24bac5={};var _0x462fa2;var _0x5bf4a4;return db[_0xeb9b('0x33')][_0xeb9b('0x78')]({'where':{'id':_0x36af5a['params']['id']}})[_0xeb9b('0x2b')](handleEntityNotFound(_0x41af31,null))[_0xeb9b('0x2b')](function(_0x16f500){if(_0x16f500){_0x462fa2=_0x16f500;_0x24bac5['model']=_['keys'](db['User'][_0xeb9b('0x34')]);_0x24bac5[_0xeb9b('0x38')]=_['keys'](_0x36af5a[_0xeb9b('0x38')]);_0x24bac5[_0xeb9b('0x42')]=_[_0xeb9b('0x3a')](_0x24bac5[_0xeb9b('0x37')],_0x24bac5[_0xeb9b('0x38')]);_0x31b0c5[_0xeb9b('0x3c')]=_['intersection'](_0x24bac5[_0xeb9b('0x37')],qs[_0xeb9b('0x3b')](_0x36af5a[_0xeb9b('0x38')][_0xeb9b('0x3b')]));_0x31b0c5[_0xeb9b('0x3c')]=_0x31b0c5[_0xeb9b('0x3c')][_0xeb9b('0x3d')]?_0x31b0c5[_0xeb9b('0x3c')]:_0x24bac5[_0xeb9b('0x37')];_0x31b0c5[_0xeb9b('0x79')]=qs[_0xeb9b('0x40')](_0x36af5a['query'][_0xeb9b('0x40')]);_0x31b0c5[_0xeb9b('0x41')]=qs['filters'](_['pick'](_0x36af5a[_0xeb9b('0x38')],_0x24bac5[_0xeb9b('0x42')]));if(_0x36af5a['query'][_0xeb9b('0x43')]){_0x31b0c5[_0xeb9b('0x41')]=_[_0xeb9b('0x44')](_0x31b0c5[_0xeb9b('0x41')],{'$or':_[_0xeb9b('0x32')](_0x31b0c5[_0xeb9b('0x3c')],function(_0x3cb938){var _0x44562a={};_0x44562a[_0x3cb938]={'$like':'%'+_0x36af5a[_0xeb9b('0x38')]['filter']+'%'};return _0x44562a;})});}_0x31b0c5=_[_0xeb9b('0x44')]({},_0x31b0c5,_0x36af5a[_0xeb9b('0x47')]);return _0x462fa2[_0xeb9b('0x77')](_0x31b0c5);}})[_0xeb9b('0x2b')](function(_0x4d894e){if(_0x4d894e){_0x5bf4a4=_0x4d894e[_0xeb9b('0x3d')];if(!_0x36af5a['query']['hasOwnProperty'](_0xeb9b('0x3f'))){_0x31b0c5[_0xeb9b('0x22')]=qs[_0xeb9b('0x22')](_0x36af5a[_0xeb9b('0x38')][_0xeb9b('0x22')]);_0x31b0c5['offset']=qs[_0xeb9b('0x20')](_0x36af5a['query'][_0xeb9b('0x20')]);}return _0x462fa2[_0xeb9b('0x77')](_0x31b0c5);}})[_0xeb9b('0x2b')](function(_0x51628d){if(_0x51628d){return _0x51628d?{'count':_0x5bf4a4,'rows':_0x51628d}:null;}})[_0xeb9b('0x2b')](respondWithResult(_0x41af31,null))['catch'](handleError(_0x41af31,null));};exports['getTeams']=function(_0x3f9806,_0x3332ba,_0x25e684){var _0x841fc6={};var _0x175afe={};var _0x57a99e;var _0x2ee62d;return db[_0xeb9b('0x33')]['findOne']({'where':{'id':_0x3f9806[_0xeb9b('0x4c')]['id']}})[_0xeb9b('0x2b')](handleEntityNotFound(_0x3332ba,null))[_0xeb9b('0x2b')](function(_0x4c303d){if(_0x4c303d){_0x57a99e=_0x4c303d;_0x175afe[_0xeb9b('0x37')]=_[_0xeb9b('0x39')](db[_0xeb9b('0x7a')][_0xeb9b('0x34')]);_0x175afe[_0xeb9b('0x38')]=_[_0xeb9b('0x39')](_0x3f9806['query']);_0x175afe[_0xeb9b('0x42')]=_[_0xeb9b('0x3a')](_0x175afe[_0xeb9b('0x37')],_0x175afe[_0xeb9b('0x38')]);_0x841fc6[_0xeb9b('0x3c')]=_[_0xeb9b('0x3a')](_0x175afe[_0xeb9b('0x37')],qs[_0xeb9b('0x3b')](_0x3f9806[_0xeb9b('0x38')][_0xeb9b('0x3b')]));_0x841fc6[_0xeb9b('0x3c')]=_0x841fc6['attributes'][_0xeb9b('0x3d')]?_0x841fc6[_0xeb9b('0x3c')]:_0x175afe[_0xeb9b('0x37')];_0x841fc6[_0xeb9b('0x79')]=qs['sort'](_0x3f9806['query'][_0xeb9b('0x40')]);_0x841fc6[_0xeb9b('0x41')]=qs[_0xeb9b('0x42')](_[_0xeb9b('0x7b')](_0x3f9806[_0xeb9b('0x38')],_0x175afe[_0xeb9b('0x42')]));if(_0x3f9806[_0xeb9b('0x38')][_0xeb9b('0x43')]){_0x841fc6[_0xeb9b('0x41')]=_[_0xeb9b('0x44')](_0x841fc6[_0xeb9b('0x41')],{'$or':_[_0xeb9b('0x32')](_0x841fc6[_0xeb9b('0x3c')],function(_0x5b456a){var _0x13db61={};_0x13db61[_0x5b456a]={'$like':'%'+_0x3f9806[_0xeb9b('0x38')]['filter']+'%'};return _0x13db61;})});}_0x841fc6=_[_0xeb9b('0x44')]({},_0x841fc6,_0x3f9806[_0xeb9b('0x47')]);return _0x57a99e[_0xeb9b('0x7c')](_0x841fc6);}})['then'](function(_0x5c0da1){if(_0x5c0da1){_0x2ee62d=_0x5c0da1[_0xeb9b('0x3d')];if(!_0x3f9806['query'][_0xeb9b('0x3e')](_0xeb9b('0x3f'))){_0x841fc6[_0xeb9b('0x22')]=qs[_0xeb9b('0x22')](_0x3f9806[_0xeb9b('0x38')][_0xeb9b('0x22')]);_0x841fc6[_0xeb9b('0x20')]=qs[_0xeb9b('0x20')](_0x3f9806['query'][_0xeb9b('0x20')]);}return _0x57a99e[_0xeb9b('0x7c')](_0x841fc6);}})[_0xeb9b('0x2b')](function(_0x5e7146){if(_0x5e7146){return _0x5e7146?{'count':_0x2ee62d,'rows':_0x5e7146}:null;}})[_0xeb9b('0x2b')](respondWithResult(_0x3332ba,null))['catch'](handleError(_0x3332ba,null));};exports[_0xeb9b('0x7d')]=function(_0x26d380,_0x3d3b2c,_0x50dae3){var _0x461392=_0x26d380[_0xeb9b('0x52')]['ids'];var _0x33adad;return db[_0xeb9b('0x7a')]['findAll']({'where':{'id':_0x461392},'attributes':['id'],'include':[{'model':db['User'],'as':_0xeb9b('0x7e'),'attributes':['id',_0xeb9b('0x30'),_0xeb9b('0x7f'),_0xeb9b('0x80'),_0xeb9b('0x81')],'raw':!![]}]})[_0xeb9b('0x2b')](function(_0x1a49a7){if(_0x1a49a7){_0x33adad=_0x1a49a7;var _0x40c30f=_[_0xeb9b('0x82')](_0x1a49a7,function(_0xcda621){var _0xb409e0=_0xcda621[_0xeb9b('0x2d')]({'plain':!![]});return _0xb409e0[_0xeb9b('0x7e')];});return db['VoicePrefix'][_0xeb9b('0x4d')]({'where':{'id':_0x26d380[_0xeb9b('0x4c')]['id']}})[_0xeb9b('0x2b')](function(_0x52bd7a){return db[_0xeb9b('0x50')][_0xeb9b('0x51')](function(_0x33e5c3){return _0x52bd7a[_0xeb9b('0x7d')](_0x461392,{'transaction':_0x33e5c3})[_0xeb9b('0x2b')](function(){return BPromise[_0xeb9b('0x83')](_0x33adad,function(_0x45b94f){return db[_0xeb9b('0x84')]['upsert']({'TeamId':_0x45b94f['id'],'VoicePrefixId':_0x26d380[_0xeb9b('0x4c')]['id']},{'transaction':_0x33e5c3});});})[_0xeb9b('0x2b')](function(){return BPromise[_0xeb9b('0x83')](_0x40c30f,function(_0x193304){return db[_0xeb9b('0x85')][_0xeb9b('0x86')]({'where':{'UserId':_0x193304['id'],'VoicePrefixId':_0x26d380['params']['id']},'transaction':_0x33e5c3});});})[_0xeb9b('0x2b')](function(){_0x40c30f[_0xeb9b('0x87')](function(_0xe7dcc5){socket['emit']('userVoicePrefix:save',{'UserId':_0xe7dcc5['id'],'VoicePrefixId':_0x52bd7a['id']});});});});});}})[_0xeb9b('0x2b')](respondWithStatusCode(_0x3d3b2c,null))[_0xeb9b('0x4e')](handleError(_0x3d3b2c,null));};exports[_0xeb9b('0x88')]=function(_0x122550,_0x3e804b,_0x41659f){return db[_0xeb9b('0x7a')][_0xeb9b('0x4a')]({'where':{'id':_0x122550[_0xeb9b('0x38')][_0xeb9b('0x74')]},'attributes':['id'],'include':[{'model':db[_0xeb9b('0x89')],'as':_0xeb9b('0x7e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3e804b,null))[_0xeb9b('0x2b')](function(_0x4b273d){var _0x16c4a5=_['map'](_0x4b273d,'id');var _0x4d39a7=[];var _0x384fba=[];var _0x23893b=squel[_0xeb9b('0x8a')]();_0x23893b[_0xeb9b('0x8b')](_0xeb9b('0x8c'))['from'](_0xeb9b('0x8d'),'tq')['join'](_0xeb9b('0x8e'),'ut',_0xeb9b('0x8f'))[_0xeb9b('0x41')](_0xeb9b('0x90'),_0x122550['params']['id']);for(var _0x1a9933=0x0;_0x1a9933<_0x4b273d[_0xeb9b('0x3d')];_0x1a9933+=0x1){let _0x2bc3b5=_0x4b273d[_0x1a9933];for(var _0x3b28ef=0x0;_0x3b28ef<_0x2bc3b5[_0xeb9b('0x7e')][_0xeb9b('0x3d')];_0x3b28ef+=0x1){let _0x427672=_0x2bc3b5['Agents'][_0x3b28ef];var _0x276e1f=_0x23893b[_0xeb9b('0x91')]();_0x276e1f[_0xeb9b('0x41')](_0xeb9b('0x92'),_0x427672['id']);_0x384fba['push'](db[_0xeb9b('0x50')][_0xeb9b('0x38')](_0x276e1f[_0xeb9b('0x93')](),{'type':db[_0xeb9b('0x50')]['QueryTypes'][_0xeb9b('0x94')]})[_0xeb9b('0x2b')](function(_0x519eff){if(_0x519eff['length']===0x1){return _0x427672['id'];}else{var _0x564125=_[_0xeb9b('0x95')](_['map'](_0x519eff,_0xeb9b('0x96')),function(_0x44ba4b){return _['includes'](_0x16c4a5,_0x44ba4b);});if(_0x564125){return _0x427672['id'];}}}));}}return BPromise['all'](_0x384fba)[_0xeb9b('0x2b')](function(_0x245892){_0x4d39a7=_(_0x4d39a7)[_0xeb9b('0x97')](_0x245892)[_0xeb9b('0x98')]()[_0xeb9b('0x99')]();return db[_0xeb9b('0x33')][_0xeb9b('0x4d')]({'where':{'id':_0x122550[_0xeb9b('0x4c')]['id']}})[_0xeb9b('0x2b')](function(_0x4d5919){return db[_0xeb9b('0x50')][_0xeb9b('0x51')](function(_0x5d3fdf){return _0x4d5919[_0xeb9b('0x88')](_0x122550['query'][_0xeb9b('0x74')],{'transaction':_0x5d3fdf})[_0xeb9b('0x2b')](function(){if(!_[_0xeb9b('0x9a')](_0x4d39a7)){return _0x4d5919['removeAgents'](_0x4d39a7,{'transaction':_0x5d3fdf});}})['then'](function(){_0x4d39a7['forEach'](function(_0x8680da){socket[_0xeb9b('0x72')]('userVoicePrefix:remove',{'UserId':_0x8680da,'VoicePrefixId':_0x4d5919['id']});});});});});});})[_0xeb9b('0x2b')](respondWithStatusCode(_0x3e804b,null))[_0xeb9b('0x4e')](handleError(_0x3e804b,null));}; \ No newline at end of file +var _0x32b6=['request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','destroy','get','VoicePrefixes','UserProfileResource','then','error','stack','name','send','index','VoicePrefix','rawAttributes','fieldName','key','map','keys','query','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','type','merge','options','includeAll','include','rows','params','find','catch','describe','create','sequelize','transaction','body','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','system','priority','appdata','prefix','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','NoOp','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','findById','ids','omit','spread','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','emit','getAgents','findOne','User','nolimit','getTeams','hasOwnProperty','addTeams','Team','findAll','Agents','online','voicePause','interface','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','from','team_has_voice_prefixes','join','VoicePrefixId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','includes','all','union','compact','isEmpty','eml-format','rimraf','fast-json-patch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x32b6,0x1d1));var _0x632b=function(_0x5cdb60,_0x3645c9){_0x5cdb60=_0x5cdb60-0x0;var _0x47b34d=_0x32b6[_0x5cdb60];return _0x47b34d;};'use strict';var emlformat=require(_0x632b('0x0'));var rimraf=require(_0x632b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x632b('0x2'));var rp=require(_0x632b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x632b('0x4'));var util=require(_0x632b('0x5'));var path=require(_0x632b('0x6'));var sox=require(_0x632b('0x7'));var csv=require(_0x632b('0x8'));var ejs=require(_0x632b('0x9'));var fs=require('fs');var fs_extra=require(_0x632b('0xa'));var _=require(_0x632b('0xb'));var squel=require(_0x632b('0xc'));var crypto=require(_0x632b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x632b('0xe'));var toCsv=require(_0x632b('0x8'));var querystring=require(_0x632b('0xf'));var Papa=require(_0x632b('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x632b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x632b('0x12'))(_0x632b('0x13'));var utils=require(_0x632b('0x14'));var config=require(_0x632b('0x15'));var licenseUtil=require(_0x632b('0x16'));var db=require(_0x632b('0x17'))['db'];config[_0x632b('0x18')]=_[_0x632b('0x19')](config[_0x632b('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x632b('0x1a'))(new Redis(config[_0x632b('0x18')]));require(_0x632b('0x1b'))['register'](socket);function respondWithStatusCode(_0x721883,_0x1a3a60){_0x1a3a60=_0x1a3a60||0xcc;return function(_0x108249){if(_0x108249){return _0x721883[_0x632b('0x1c')](_0x1a3a60);}return _0x721883[_0x632b('0x1d')](_0x1a3a60)[_0x632b('0x1e')]();};}function respondWithResult(_0x4efe39,_0x17ddc5){_0x17ddc5=_0x17ddc5||0xc8;return function(_0x52f353){if(_0x52f353){return _0x4efe39['status'](_0x17ddc5)[_0x632b('0x1f')](_0x52f353);}};}function respondWithFilteredResult(_0x5afa1e,_0x2c8340){return function(_0x3bb27f){if(_0x3bb27f){var _0x28c472=typeof _0x2c8340['offset']===_0x632b('0x20')&&typeof _0x2c8340[_0x632b('0x21')]===_0x632b('0x20');var _0x3683e4=_0x3bb27f['count'];var _0x472e34=_0x28c472?0x0:_0x2c8340[_0x632b('0x22')];var _0x4f377f=_0x28c472?_0x3bb27f[_0x632b('0x23')]:_0x2c8340['offset']+_0x2c8340['limit'];var _0x1b1092;if(_0x4f377f>=_0x3683e4){_0x4f377f=_0x3683e4;_0x1b1092=0xc8;}else{_0x1b1092=0xce;}_0x5afa1e['status'](_0x1b1092);return _0x5afa1e[_0x632b('0x24')](_0x632b('0x25'),_0x472e34+'-'+_0x4f377f+'/'+_0x3683e4)[_0x632b('0x1f')](_0x3bb27f);}return null;};}function patchUpdates(_0x540bfb){return function(_0x10fc32){try{jsonpatch[_0x632b('0x26')](_0x10fc32,_0x540bfb,!![]);}catch(_0x59d83a){return BPromise[_0x632b('0x27')](_0x59d83a);}return _0x10fc32[_0x632b('0x28')]();};}function saveUpdates(_0x30ffb9,_0x1e448c){return function(_0x45d017){if(_0x45d017){return _0x45d017[_0x632b('0x29')](_0x30ffb9)['then'](function(_0x5e7b20){return _0x5e7b20;});}return null;};}function removeEntity(_0x11fe61,_0x4d3a70){return function(_0x4ebd26){if(_0x4ebd26){return _0x4ebd26[_0x632b('0x2a')]()['then'](function(){var _0x273e89=_0x4ebd26[_0x632b('0x2b')]({'plain':!![]});var _0x29d9aa=_0x632b('0x2c');return db[_0x632b('0x2d')][_0x632b('0x2a')]({'where':{'type':_0x29d9aa,'resourceId':_0x273e89['id']}})[_0x632b('0x2e')](function(){return _0x4ebd26;});})[_0x632b('0x2e')](function(){_0x11fe61[_0x632b('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bb484,_0x35348e){return function(_0x1819fa){if(!_0x1819fa){_0x1bb484[_0x632b('0x1c')](0x194);}return _0x1819fa;};}function handleError(_0x17a5ba,_0x2a34fa){_0x2a34fa=_0x2a34fa||0x1f4;return function(_0x3c5dc9){logger[_0x632b('0x2f')](_0x3c5dc9[_0x632b('0x30')]);if(_0x3c5dc9[_0x632b('0x31')]){delete _0x3c5dc9[_0x632b('0x31')];}_0x17a5ba[_0x632b('0x1d')](_0x2a34fa)[_0x632b('0x32')](_0x3c5dc9);};}exports[_0x632b('0x33')]=function(_0x227497,_0x3dff99){var _0x18efab={},_0x36936d={},_0x3f3dc4={'count':0x0,'rows':[]};var _0x12f00=_['map'](db[_0x632b('0x34')][_0x632b('0x35')],function(_0x397f36){return{'name':_0x397f36[_0x632b('0x36')],'type':_0x397f36['type'][_0x632b('0x37')]};});_0x36936d['model']=_[_0x632b('0x38')](_0x12f00,_0x632b('0x31'));_0x36936d['query']=_[_0x632b('0x39')](_0x227497[_0x632b('0x3a')]);_0x36936d[_0x632b('0x3b')]=_[_0x632b('0x3c')](_0x36936d[_0x632b('0x3d')],_0x36936d[_0x632b('0x3a')]);_0x18efab[_0x632b('0x3e')]=_[_0x632b('0x3c')](_0x36936d['model'],qs['fields'](_0x227497[_0x632b('0x3a')][_0x632b('0x3f')]));_0x18efab[_0x632b('0x3e')]=_0x18efab[_0x632b('0x3e')][_0x632b('0x40')]?_0x18efab[_0x632b('0x3e')]:_0x36936d[_0x632b('0x3d')];if(!_0x227497[_0x632b('0x3a')]['hasOwnProperty']('nolimit')){_0x18efab[_0x632b('0x21')]=qs['limit'](_0x227497[_0x632b('0x3a')][_0x632b('0x21')]);_0x18efab[_0x632b('0x22')]=qs[_0x632b('0x22')](_0x227497[_0x632b('0x3a')][_0x632b('0x22')]);}_0x18efab[_0x632b('0x41')]=qs[_0x632b('0x42')](_0x227497[_0x632b('0x3a')][_0x632b('0x42')]);_0x18efab[_0x632b('0x43')]=qs[_0x632b('0x3b')](_[_0x632b('0x44')](_0x227497[_0x632b('0x3a')],_0x36936d[_0x632b('0x3b')]),_0x12f00);if(_0x227497[_0x632b('0x3a')][_0x632b('0x45')]){_0x18efab['where']=_['merge'](_0x18efab['where'],{'$or':_['map'](_0x12f00,function(_0x57f099){if(_0x57f099[_0x632b('0x46')]!=='VIRTUAL'){var _0x5529cb={};_0x5529cb[_0x57f099['name']]={'$like':'%'+_0x227497[_0x632b('0x3a')][_0x632b('0x45')]+'%'};return _0x5529cb;}})});}_0x18efab=_[_0x632b('0x47')]({},_0x18efab,_0x227497[_0x632b('0x48')]);var _0x5a1017={'where':_0x18efab[_0x632b('0x43')]};return db[_0x632b('0x34')][_0x632b('0x23')](_0x5a1017)['then'](function(_0x15bb30){_0x3f3dc4[_0x632b('0x23')]=_0x15bb30;if(_0x227497[_0x632b('0x3a')][_0x632b('0x49')]){_0x18efab[_0x632b('0x4a')]=[{'all':!![]}];}return db[_0x632b('0x34')]['findAll'](_0x18efab);})[_0x632b('0x2e')](function(_0x2b90c8){_0x3f3dc4[_0x632b('0x4b')]=_0x2b90c8;return _0x3f3dc4;})[_0x632b('0x2e')](respondWithFilteredResult(_0x3dff99,_0x18efab))['catch'](handleError(_0x3dff99,null));};exports['show']=function(_0x39b17c,_0x26b35b){var _0x70ddc9={'raw':![],'where':{'id':_0x39b17c[_0x632b('0x4c')]['id']}},_0x3566e7={};_0x3566e7[_0x632b('0x3d')]=_['keys'](db[_0x632b('0x34')][_0x632b('0x35')]);_0x3566e7[_0x632b('0x3a')]=_[_0x632b('0x39')](_0x39b17c[_0x632b('0x3a')]);_0x3566e7[_0x632b('0x3b')]=_[_0x632b('0x3c')](_0x3566e7[_0x632b('0x3d')],_0x3566e7['query']);_0x70ddc9[_0x632b('0x3e')]=_['intersection'](_0x3566e7[_0x632b('0x3d')],qs['fields'](_0x39b17c[_0x632b('0x3a')][_0x632b('0x3f')]));_0x70ddc9[_0x632b('0x3e')]=_0x70ddc9[_0x632b('0x3e')][_0x632b('0x40')]?_0x70ddc9['attributes']:_0x3566e7[_0x632b('0x3d')];if(_0x39b17c[_0x632b('0x3a')][_0x632b('0x49')]){_0x70ddc9['include']=[{'all':!![]}];}_0x70ddc9=_[_0x632b('0x47')]({},_0x70ddc9,_0x39b17c[_0x632b('0x48')]);return db[_0x632b('0x34')][_0x632b('0x4d')](_0x70ddc9)[_0x632b('0x2e')](handleEntityNotFound(_0x26b35b,null))['then'](respondWithResult(_0x26b35b,null))[_0x632b('0x4e')](handleError(_0x26b35b,null));};exports['destroy']=function(_0x33da2b,_0x369cdc){return db[_0x632b('0x34')][_0x632b('0x4d')]({'where':{'id':_0x33da2b[_0x632b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x369cdc,null))['then'](removeEntity(_0x369cdc,null))[_0x632b('0x4e')](handleError(_0x369cdc,null));};exports[_0x632b('0x4f')]=function(_0x3ad524,_0xdc6242){return db[_0x632b('0x34')][_0x632b('0x4f')]()['then'](respondWithResult(_0xdc6242,null))[_0x632b('0x4e')](handleError(_0xdc6242,null));};exports[_0x632b('0x50')]=function(_0x3ff81c,_0x4dc021){var _0x33e428;return db[_0x632b('0x51')][_0x632b('0x52')](function(_0x1a79fa){return db['VoicePrefix'][_0x632b('0x50')](_0x3ff81c[_0x632b('0x53')],{'transaction':_0x1a79fa})[_0x632b('0x2e')](function(_0x92884f){_0x33e428=_0x92884f[_0x632b('0x2b')]({'plain':!![]});return db['VoiceExtension'][_0x632b('0x4d')]({'where':{'id':_0x33e428[_0x632b('0x54')]},'raw':!![]})[_0x632b('0x2e')](function(_0x36a7c5){return createVoicePrefixExtensions(_0x33e428,_0x36a7c5,_0x1a79fa);});});})[_0x632b('0x2e')](function(){var _0x5d1d05=_0x3ff81c[_0x632b('0x55')][_0x632b('0x2b')]({'plain':!![]});if(!_0x5d1d05)throw new Error(_0x632b('0x56'));if(_0x5d1d05[_0x632b('0x57')]===_0x632b('0x55')){var _0x9accea=_0x33e428;return db[_0x632b('0x58')][_0x632b('0x4d')]({'where':{'name':_0x632b('0x2c'),'userProfileId':_0x5d1d05[_0x632b('0x59')]},'raw':!![]})[_0x632b('0x2e')](function(_0x5ca000){if(_0x5ca000&&_0x5ca000[_0x632b('0x5a')]===0x0){return db[_0x632b('0x2d')][_0x632b('0x50')]({'name':_0x9accea[_0x632b('0x31')],'resourceId':_0x9accea['id'],'type':_0x5ca000[_0x632b('0x31')],'sectionId':_0x5ca000['id']},{})['then'](function(){return _0x33e428;});}else{return _0x33e428;}})[_0x632b('0x4e')](function(_0x2239ec){logger[_0x632b('0x2f')](_0x632b('0x5b'),_0x2239ec);throw _0x2239ec;});}return _0x33e428;})[_0x632b('0x2e')](respondWithResult(_0x4dc021,null))[_0x632b('0x4e')](handleError(_0x4dc021,null));};function Extension(_0x3e14d0,_0x4ffa35,_0x14ee44,_0x4b7307){this[_0x632b('0x5c')]='from-sip';this[_0x632b('0x5d')]=_0x3e14d0;this['app']=_0x14ee44;this[_0x632b('0x46')]=_0x632b('0x5e');this['description']='Voice\x20Prefix\x20Extension';this[_0x632b('0x5f')]=_0x4ffa35;this[_0x632b('0x60')]=_0x4b7307;}function createVoicePrefixExtensions(_0x1618b3,_0xbbaf46,_0x52eed9){return new BPromise(function(_0x1420d9,_0x20672b){var _0x5abf95=new Extension(formatPrefixName(_0x1618b3[_0x632b('0x61')]),0x1,'NoOp',_0x632b('0x62'));_0x5abf95[_0x632b('0x63')]=_0x1618b3['id'];return db['VoiceExtension'][_0x632b('0x50')](_0x5abf95,{'transaction':_0x52eed9})[_0x632b('0x2e')](function(_0x32cc27){var _0x1bf6f4=_0x32cc27['get']({'plain':!![]});var _0x2711d5=_[_0x632b('0x38')](addVoicePrefixExtensions(_0x1618b3,_0xbbaf46),function(_0x3d1ac3){_0x3d1ac3[_0x632b('0x54')]=_0x1bf6f4['id'];_0x3d1ac3['VoicePrefixId']=_0x1618b3['id'];return _0x3d1ac3;});return db[_0x632b('0x64')][_0x632b('0x65')](_0x2711d5,{'transaction':_0x52eed9})[_0x632b('0x2e')](function(_0x3fd888){if(!_0x3fd888){return _0x20672b(_0x632b('0x66'));}else{return _0x1420d9(_0x3fd888);}})[_0x632b('0x4e')](function(_0x5c614e){return _0x20672b(_0x5c614e);});});;});};function addVoicePrefixExtensions(_0x132223,_0x83d8f9){var _0x307132=[];var _0x5b0c6d=formatPrefixName(_0x132223['prefix']);_0x307132[_0x632b('0x67')](new Extension(_0x5b0c6d,0x2,_0x632b('0x68'),_0x632b('0x69')+_0x132223[_0x632b('0x31')]));if(_0x132223[_0x632b('0x6a')]){_0x307132[_0x632b('0x67')](new Extension(_0x5b0c6d,0x3,_0x632b('0x68'),'PREFIX-CALLERIDALL='+_0x132223[_0x632b('0x6a')]));}else{_0x307132[_0x632b('0x67')](new Extension(_0x5b0c6d,0x3,_0x632b('0x6b'),_0x632b('0x6c')));}_0x307132[_0x632b('0x67')](new Extension(_0x5b0c6d,0x4,_0x632b('0x6d'),_0x83d8f9['context']+','+_0x632b('0x6e')+(0x8+_0x132223[_0x632b('0x31')][_0x632b('0x40')])+'}'+','+0x1));return _0x307132;}function formatPrefixName(_0x14b55f){var _0x51cb45='_';for(var _0x3a3f80=0x0;_0x3a3f80<_0x14b55f[_0x632b('0x40')];_0x3a3f80++){if(_0x14b55f[_0x632b('0x6f')](_0x3a3f80)=='-'){_0x51cb45+=_0x14b55f['charAt'](_0x3a3f80);}else{_0x51cb45+='['+_0x14b55f[_0x632b('0x6f')](_0x3a3f80)+']';}}_0x51cb45+='.';return _0x51cb45;}exports[_0x632b('0x29')]=function(_0x3aa6ca,_0x26f891,_0x225d81){var _0x4599fc=_0x3aa6ca['body'];_0x4599fc[_0x632b('0x61')]=_0x632b('0x70')+_0x4599fc['name']+'-';return db['sequelize']['transaction'](function(_0x3605b6){return db[_0x632b('0x34')][_0x632b('0x29')](_0x4599fc,{'where':{'id':_0x4599fc['id']},'transaction':_0x3605b6})[_0x632b('0x2e')](function(){return db[_0x632b('0x64')]['destroy']({'where':{'VoicePrefixId':_0x4599fc['id']},'transaction':_0x3605b6})['then'](function(){return db[_0x632b('0x64')][_0x632b('0x4d')]({'where':{'id':_0x4599fc['VoiceExtensionId']},'raw':!![]})['then'](function(_0x11cc11){return createVoicePrefixExtensions(_0x4599fc,_0x11cc11,_0x3605b6);});});});})[_0x632b('0x2e')](function(){return db['VoicePrefix'][_0x632b('0x71')](_0x4599fc['id']);})[_0x632b('0x2e')](respondWithResult(_0x26f891,null))[_0x632b('0x4e')](handleError(_0x26f891,null));};exports['addAgents']=function(_0x495a99,_0x563cfa,_0x2ff526){return db[_0x632b('0x34')][_0x632b('0x4d')]({'where':{'id':_0x495a99['params']['id']}})['then'](handleEntityNotFound(_0x563cfa,null))['then'](function(_0x38190c){if(_0x38190c){return _0x38190c['addAgents'](_0x495a99[_0x632b('0x53')][_0x632b('0x72')],_[_0x632b('0x73')](_0x495a99[_0x632b('0x53')],[_0x632b('0x72'),'id'])||{})[_0x632b('0x74')](function(_0xa87c08){for(var _0x360796=0x0;_0x360796<_0x495a99[_0x632b('0x53')][_0x632b('0x72')]['length'];_0x360796+=0x1){socket['emit'](_0x632b('0x75'),{'UserId':Number(_0x495a99['body'][_0x632b('0x72')][_0x360796]),'VoicePrefixId':Number(_0x495a99[_0x632b('0x4c')]['id'])});}return _0xa87c08;});}})[_0x632b('0x2e')](respondWithResult(_0x563cfa,null))[_0x632b('0x4e')](handleError(_0x563cfa,null));};exports['removeAgents']=function(_0x2a3d8f,_0x4febe2,_0x57edcb){return db['VoicePrefix'][_0x632b('0x4d')]({'where':{'id':_0x2a3d8f['params']['id']}})[_0x632b('0x2e')](handleEntityNotFound(_0x4febe2,null))[_0x632b('0x2e')](function(_0x48ccd3){if(_0x48ccd3){return _0x48ccd3[_0x632b('0x76')](_0x2a3d8f[_0x632b('0x3a')]['ids'])['then'](function(){if(_[_0x632b('0x77')](_0x2a3d8f[_0x632b('0x3a')][_0x632b('0x72')])){for(var _0xff7d0b=0x0;_0xff7d0b<_0x2a3d8f[_0x632b('0x3a')][_0x632b('0x72')][_0x632b('0x40')];_0xff7d0b+=0x1){socket['emit'](_0x632b('0x78'),{'UserId':Number(_0x2a3d8f[_0x632b('0x3a')]['ids'][_0xff7d0b]),'VoicePrefixId':Number(_0x2a3d8f['params']['id'])});}}else{socket[_0x632b('0x79')]('userVoicePrefix:remove',{'UserId':Number(_0x2a3d8f['query'][_0x632b('0x72')]),'VoicePrefixId':Number(_0x2a3d8f['params']['id'])});}});}})[_0x632b('0x2e')](respondWithStatusCode(_0x4febe2,null))['catch'](handleError(_0x4febe2,null));};exports[_0x632b('0x7a')]=function(_0x590e68,_0x4393e9,_0x3669d9){var _0x57a2a6={};var _0x10c901={};var _0x64f45a;var _0x1e07da;return db[_0x632b('0x34')][_0x632b('0x7b')]({'where':{'id':_0x590e68[_0x632b('0x4c')]['id']}})[_0x632b('0x2e')](handleEntityNotFound(_0x4393e9,null))[_0x632b('0x2e')](function(_0x5a90f7){if(_0x5a90f7){_0x64f45a=_0x5a90f7;_0x10c901['model']=_[_0x632b('0x39')](db[_0x632b('0x7c')][_0x632b('0x35')]);_0x10c901[_0x632b('0x3a')]=_[_0x632b('0x39')](_0x590e68[_0x632b('0x3a')]);_0x10c901['filters']=_[_0x632b('0x3c')](_0x10c901['model'],_0x10c901[_0x632b('0x3a')]);_0x57a2a6['attributes']=_[_0x632b('0x3c')](_0x10c901[_0x632b('0x3d')],qs[_0x632b('0x3f')](_0x590e68[_0x632b('0x3a')]['fields']));_0x57a2a6[_0x632b('0x3e')]=_0x57a2a6[_0x632b('0x3e')]['length']?_0x57a2a6[_0x632b('0x3e')]:_0x10c901[_0x632b('0x3d')];_0x57a2a6[_0x632b('0x41')]=qs[_0x632b('0x42')](_0x590e68[_0x632b('0x3a')]['sort']);_0x57a2a6[_0x632b('0x43')]=qs[_0x632b('0x3b')](_['pick'](_0x590e68[_0x632b('0x3a')],_0x10c901['filters']));if(_0x590e68[_0x632b('0x3a')]['filter']){_0x57a2a6[_0x632b('0x43')]=_['merge'](_0x57a2a6[_0x632b('0x43')],{'$or':_[_0x632b('0x38')](_0x57a2a6[_0x632b('0x3e')],function(_0x1f5d21){var _0x405b3c={};_0x405b3c[_0x1f5d21]={'$like':'%'+_0x590e68['query'][_0x632b('0x45')]+'%'};return _0x405b3c;})});}_0x57a2a6=_[_0x632b('0x47')]({},_0x57a2a6,_0x590e68['options']);return _0x64f45a[_0x632b('0x7a')](_0x57a2a6);}})['then'](function(_0x1bbb23){if(_0x1bbb23){_0x1e07da=_0x1bbb23['length'];if(!_0x590e68[_0x632b('0x3a')]['hasOwnProperty'](_0x632b('0x7d'))){_0x57a2a6[_0x632b('0x21')]=qs[_0x632b('0x21')](_0x590e68['query'][_0x632b('0x21')]);_0x57a2a6[_0x632b('0x22')]=qs[_0x632b('0x22')](_0x590e68[_0x632b('0x3a')][_0x632b('0x22')]);}return _0x64f45a[_0x632b('0x7a')](_0x57a2a6);}})[_0x632b('0x2e')](function(_0x31eee9){if(_0x31eee9){return _0x31eee9?{'count':_0x1e07da,'rows':_0x31eee9}:null;}})[_0x632b('0x2e')](respondWithResult(_0x4393e9,null))[_0x632b('0x4e')](handleError(_0x4393e9,null));};exports[_0x632b('0x7e')]=function(_0xf1a293,_0x1fcb2a,_0x55c36d){var _0x23385d={};var _0x376112={};var _0x1e6905;var _0x3293be;return db[_0x632b('0x34')][_0x632b('0x7b')]({'where':{'id':_0xf1a293[_0x632b('0x4c')]['id']}})[_0x632b('0x2e')](handleEntityNotFound(_0x1fcb2a,null))[_0x632b('0x2e')](function(_0x40fb13){if(_0x40fb13){_0x1e6905=_0x40fb13;_0x376112[_0x632b('0x3d')]=_[_0x632b('0x39')](db['Team'][_0x632b('0x35')]);_0x376112[_0x632b('0x3a')]=_[_0x632b('0x39')](_0xf1a293[_0x632b('0x3a')]);_0x376112[_0x632b('0x3b')]=_[_0x632b('0x3c')](_0x376112[_0x632b('0x3d')],_0x376112[_0x632b('0x3a')]);_0x23385d['attributes']=_[_0x632b('0x3c')](_0x376112[_0x632b('0x3d')],qs[_0x632b('0x3f')](_0xf1a293[_0x632b('0x3a')][_0x632b('0x3f')]));_0x23385d[_0x632b('0x3e')]=_0x23385d[_0x632b('0x3e')][_0x632b('0x40')]?_0x23385d[_0x632b('0x3e')]:_0x376112['model'];_0x23385d[_0x632b('0x41')]=qs[_0x632b('0x42')](_0xf1a293[_0x632b('0x3a')][_0x632b('0x42')]);_0x23385d[_0x632b('0x43')]=qs[_0x632b('0x3b')](_['pick'](_0xf1a293[_0x632b('0x3a')],_0x376112[_0x632b('0x3b')]));if(_0xf1a293[_0x632b('0x3a')]['filter']){_0x23385d['where']=_[_0x632b('0x47')](_0x23385d[_0x632b('0x43')],{'$or':_[_0x632b('0x38')](_0x23385d[_0x632b('0x3e')],function(_0x16c798){var _0x384439={};_0x384439[_0x16c798]={'$like':'%'+_0xf1a293[_0x632b('0x3a')]['filter']+'%'};return _0x384439;})});}_0x23385d=_[_0x632b('0x47')]({},_0x23385d,_0xf1a293['options']);return _0x1e6905[_0x632b('0x7e')](_0x23385d);}})['then'](function(_0x4d3bb7){if(_0x4d3bb7){_0x3293be=_0x4d3bb7[_0x632b('0x40')];if(!_0xf1a293[_0x632b('0x3a')][_0x632b('0x7f')]('nolimit')){_0x23385d['limit']=qs[_0x632b('0x21')](_0xf1a293[_0x632b('0x3a')][_0x632b('0x21')]);_0x23385d['offset']=qs['offset'](_0xf1a293[_0x632b('0x3a')][_0x632b('0x22')]);}return _0x1e6905[_0x632b('0x7e')](_0x23385d);}})[_0x632b('0x2e')](function(_0x66cbf3){if(_0x66cbf3){return _0x66cbf3?{'count':_0x3293be,'rows':_0x66cbf3}:null;}})[_0x632b('0x2e')](respondWithResult(_0x1fcb2a,null))['catch'](handleError(_0x1fcb2a,null));};exports[_0x632b('0x80')]=function(_0x352ba8,_0x3b7be7,_0x32facd){var _0x366643=_0x352ba8[_0x632b('0x53')]['ids'];var _0x5db842;return db[_0x632b('0x81')][_0x632b('0x82')]({'where':{'id':_0x366643},'attributes':['id'],'include':[{'model':db['User'],'as':_0x632b('0x83'),'attributes':['id',_0x632b('0x31'),_0x632b('0x84'),_0x632b('0x85'),_0x632b('0x86')],'raw':!![]}]})[_0x632b('0x2e')](function(_0x17bfa2){if(_0x17bfa2){_0x5db842=_0x17bfa2;var _0x28b626=_['flatMap'](_0x17bfa2,function(_0x4ce406){var _0x1b274d=_0x4ce406[_0x632b('0x2b')]({'plain':!![]});return _0x1b274d['Agents'];});return db[_0x632b('0x34')][_0x632b('0x4d')]({'where':{'id':_0x352ba8[_0x632b('0x4c')]['id']}})[_0x632b('0x2e')](function(_0x36564e){return db['sequelize']['transaction'](function(_0x824140){return _0x36564e[_0x632b('0x80')](_0x366643,{'transaction':_0x824140})[_0x632b('0x2e')](function(){return BPromise[_0x632b('0x87')](_0x5db842,function(_0x214851){return db[_0x632b('0x88')]['upsert']({'TeamId':_0x214851['id'],'VoicePrefixId':_0x352ba8[_0x632b('0x4c')]['id']},{'transaction':_0x824140});});})['then'](function(){return BPromise[_0x632b('0x87')](_0x28b626,function(_0x26e1a9){return db[_0x632b('0x89')][_0x632b('0x8a')]({'where':{'UserId':_0x26e1a9['id'],'VoicePrefixId':_0x352ba8[_0x632b('0x4c')]['id']},'transaction':_0x824140});});})[_0x632b('0x2e')](function(){_0x28b626[_0x632b('0x8b')](function(_0x19d11e){socket[_0x632b('0x79')](_0x632b('0x75'),{'UserId':_0x19d11e['id'],'VoicePrefixId':_0x36564e['id']});});});});});}})['then'](respondWithStatusCode(_0x3b7be7,null))[_0x632b('0x4e')](handleError(_0x3b7be7,null));};exports[_0x632b('0x8c')]=function(_0x36244e,_0x1cc52f,_0x5cd2b7){return db[_0x632b('0x81')][_0x632b('0x82')]({'where':{'id':_0x36244e['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x632b('0x83'),'attributes':['id'],'raw':!![]}]})[_0x632b('0x2e')](handleEntityNotFound(_0x1cc52f,null))[_0x632b('0x2e')](function(_0x2a45f3){var _0x56d205=_[_0x632b('0x38')](_0x2a45f3,'id');var _0x392b6b=[];var _0x1cfc20=[];var _0x5bd1bb=squel[_0x632b('0x8d')]();_0x5bd1bb['field']('tq.TeamId')[_0x632b('0x8e')](_0x632b('0x8f'),'tq')[_0x632b('0x90')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x632b('0x91'),_0x36244e[_0x632b('0x4c')]['id']);for(var _0x2d0712=0x0;_0x2d0712<_0x2a45f3['length'];_0x2d0712+=0x1){let _0x1f9cb4=_0x2a45f3[_0x2d0712];for(var _0x90b25c=0x0;_0x90b25c<_0x1f9cb4[_0x632b('0x83')][_0x632b('0x40')];_0x90b25c+=0x1){let _0x163ad2=_0x1f9cb4['Agents'][_0x90b25c];var _0x21af7a=_0x5bd1bb['clone']();_0x21af7a['where'](_0x632b('0x92'),_0x163ad2['id']);_0x1cfc20[_0x632b('0x67')](db['sequelize']['query'](_0x21af7a[_0x632b('0x93')](),{'type':db[_0x632b('0x51')][_0x632b('0x94')]['SELECT']})[_0x632b('0x2e')](function(_0x53c0c4){if(_0x53c0c4['length']===0x1){return _0x163ad2['id'];}else{var _0x112ecc=_[_0x632b('0x95')](_[_0x632b('0x38')](_0x53c0c4,_0x632b('0x96')),function(_0x4e5523){return _[_0x632b('0x97')](_0x56d205,_0x4e5523);});if(_0x112ecc){return _0x163ad2['id'];}}}));}}return BPromise[_0x632b('0x98')](_0x1cfc20)[_0x632b('0x2e')](function(_0x350a1b){_0x392b6b=_(_0x392b6b)[_0x632b('0x99')](_0x350a1b)[_0x632b('0x9a')]()['value']();return db[_0x632b('0x34')]['find']({'where':{'id':_0x36244e[_0x632b('0x4c')]['id']}})['then'](function(_0x460dce){return db[_0x632b('0x51')][_0x632b('0x52')](function(_0x2c88a){return _0x460dce[_0x632b('0x8c')](_0x36244e[_0x632b('0x3a')][_0x632b('0x72')],{'transaction':_0x2c88a})[_0x632b('0x2e')](function(){if(!_[_0x632b('0x9b')](_0x392b6b)){return _0x460dce[_0x632b('0x76')](_0x392b6b,{'transaction':_0x2c88a});}})[_0x632b('0x2e')](function(){_0x392b6b[_0x632b('0x8b')](function(_0x3784d2){socket[_0x632b('0x79')](_0x632b('0x78'),{'UserId':_0x3784d2,'VoicePrefixId':_0x460dce['id']});});});});});});})['then'](respondWithStatusCode(_0x1cc52f,null))[_0x632b('0x4e')](handleError(_0x1cc52f,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 260b30e..5f8d6c9 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 _0x3936=['update','remove','emit','hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','save'];(function(_0x2a786a,_0x1125fd){var _0x5327da=function(_0x38a348){while(--_0x38a348){_0x2a786a['push'](_0x2a786a['shift']());}};_0x5327da(++_0x1125fd);}(_0x3936,0x1e5));var _0x6393=function(_0x1bb161,_0x25b93c){_0x1bb161=_0x1bb161-0x0;var _0x2d4246=_0x3936[_0x1bb161];return _0x2d4246;};'use strict';var EventEmitter=require(_0x6393('0x0'));var VoicePrefix=require(_0x6393('0x1'))['db'][_0x6393('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x6393('0x3')](0x0);var events={'afterCreate':_0x6393('0x4'),'afterUpdate':_0x6393('0x5'),'afterDestroy':_0x6393('0x6')};function emitEvent(_0x5775f4){return function(_0x4308cc,_0x1c685b,_0x2e0609){VoicePrefixEvents[_0x6393('0x7')](_0x5775f4+':'+_0x4308cc['id'],_0x4308cc);VoicePrefixEvents['emit'](_0x5775f4,_0x4308cc);_0x2e0609(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x6393('0x8')](e,emitEvent(event));}}module[_0x6393('0x9')]=VoicePrefixEvents; \ No newline at end of file +var _0x4fee=['hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove','emit'];(function(_0x3a422a,_0x8c26d1){var _0x302ffe=function(_0x543913){while(--_0x543913){_0x3a422a['push'](_0x3a422a['shift']());}};_0x302ffe(++_0x8c26d1);}(_0x4fee,0x198));var _0xe4fe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4fee[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xe4fe('0x0'));var VoicePrefix=require('../../mysqldb')['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xe4fe('0x1')](0x0);var events={'afterCreate':_0xe4fe('0x2'),'afterUpdate':_0xe4fe('0x3'),'afterDestroy':_0xe4fe('0x4')};function emitEvent(_0x377ad9){return function(_0x42a272,_0x20401a,_0x56b8f1){VoicePrefixEvents[_0xe4fe('0x5')](_0x377ad9+':'+_0x42a272['id'],_0x42a272);VoicePrefixEvents[_0xe4fe('0x5')](_0x377ad9,_0x42a272);_0x56b8f1(null);};}for(var e in events){if(events[_0xe4fe('0x6')](e)){var event=events[e];VoicePrefix[_0xe4fe('0x7')](e,emitEvent(event));}}module[_0xe4fe('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 70eefe1..2651248 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 _0xfec1=['./voicePrefix.attributes','define','VoicePrefix','voice_prefixes','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x53345e,_0xaf3ffe){var _0x5a6279=function(_0x22fa1c){while(--_0x22fa1c){_0x53345e['push'](_0x53345e['shift']());}};_0x5a6279(++_0xaf3ffe);}(_0xfec1,0xbf));var _0x1fec=function(_0x43402a,_0x513317){_0x43402a=_0x43402a-0x0;var _0x483ebf=_0xfec1[_0x43402a];return _0x483ebf;};'use strict';var _=require('lodash');var util=require(_0x1fec('0x0'));var logger=require(_0x1fec('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1fec('0x2'));var rp=require(_0x1fec('0x3'));var fs=require('fs');var path=require(_0x1fec('0x4'));var rimraf=require(_0x1fec('0x5'));var config=require(_0x1fec('0x6'));var attributes=require(_0x1fec('0x7'));module['exports']=function(_0x1460c3,_0x394ea0){return _0x1460c3[_0x1fec('0x8')](_0x1fec('0x9'),attributes,{'tableName':_0x1fec('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc79=['api','moment','request-promise','rimraf','../../config/environment','./voicePrefix.attributes','define','voice_prefixes','util','../../config/logger'];(function(_0x271060,_0x3f86b1){var _0x40540b=function(_0x1735a7){while(--_0x1735a7){_0x271060['push'](_0x271060['shift']());}};_0x40540b(++_0x3f86b1);}(_0xdc79,0x148));var _0x9dc7=function(_0x42da4f,_0x378423){_0x42da4f=_0x42da4f-0x0;var _0x1c2da5=_0xdc79[_0x42da4f];return _0x1c2da5;};'use strict';var _=require('lodash');var util=require(_0x9dc7('0x0'));var logger=require(_0x9dc7('0x1'))(_0x9dc7('0x2'));var moment=require(_0x9dc7('0x3'));var BPromise=require('bluebird');var rp=require(_0x9dc7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9dc7('0x5'));var config=require(_0x9dc7('0x6'));var attributes=require(_0x9dc7('0x7'));module['exports']=function(_0x33128a,_0x6dbf16){return _0x33128a[_0x9dc7('0x8')]('VoicePrefix',attributes,{'tableName':_0x9dc7('0x9'),'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 73b0a76..385aa24 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 _0xdbb1=['VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','lodash','randomstring','../../config/utils','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','register','request','then','info','VoicePrefix,\x20%s,\x20%s','debug'];(function(_0xa58505,_0x53eb9c){var _0x38615c=function(_0x5f4417){while(--_0x5f4417){_0xa58505['push'](_0xa58505['shift']());}};_0x38615c(++_0x53eb9c);}(_0xdbb1,0x105));var _0x1dbb=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xdbb1[_0x13e741];return _0x3f8bb3;};'use strict';var _=require(_0x1dbb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1dbb('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1dbb('0x2'));var logger=require('../../config/logger')(_0x1dbb('0x3'));var config=require(_0x1dbb('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1dbb('0x5')]({'port':0x232a});config[_0x1dbb('0x6')]=_[_0x1dbb('0x7')](config[_0x1dbb('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x1dbb('0x8'))(new Redis(config[_0x1dbb('0x6')]));require('./voicePrefix.socket')[_0x1dbb('0x9')](socket);function respondWithRpcPromise(_0x232c1c,_0x1e7ac5,_0x3ce7e9){return new BPromise(function(_0x40b115,_0x183120){return client[_0x1dbb('0xa')](_0x232c1c,_0x3ce7e9)[_0x1dbb('0xb')](function(_0x3e71bd){logger[_0x1dbb('0xc')](_0x1dbb('0xd'),_0x1e7ac5,'request\x20sent');logger[_0x1dbb('0xe')](_0x1dbb('0xf'),_0x1e7ac5,_0x1dbb('0x10'),JSON[_0x1dbb('0x11')](_0x3e71bd));if(_0x3e71bd['error']){if(_0x3e71bd['error'][_0x1dbb('0x12')]===0x1f4){logger[_0x1dbb('0x13')](_0x1dbb('0xd'),_0x1e7ac5,_0x3e71bd[_0x1dbb('0x13')][_0x1dbb('0x14')]);return _0x183120(_0x3e71bd['error'][_0x1dbb('0x14')]);}logger[_0x1dbb('0x13')](_0x1dbb('0xd'),_0x1e7ac5,_0x3e71bd['error'][_0x1dbb('0x14')]);return _0x40b115(_0x3e71bd[_0x1dbb('0x13')]['message']);}else{logger[_0x1dbb('0xc')](_0x1dbb('0xd'),_0x1e7ac5,_0x1dbb('0x10'));_0x40b115(_0x3e71bd[_0x1dbb('0x15')][_0x1dbb('0x14')]);}})[_0x1dbb('0x16')](function(_0x2ae3f2){logger[_0x1dbb('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x1e7ac5,_0x2ae3f2);_0x183120(_0x2ae3f2);});});} \ No newline at end of file +var _0xca84=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voicePrefix.socket','request','then','info','request\x20sent','error','VoicePrefix,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xca84,0xf5));var _0x4ca8=function(_0x5035d2,_0x396968){_0x5035d2=_0x5035d2-0x0;var _0xeea02a=_0xca84[_0x5035d2];return _0xeea02a;};'use strict';var _=require(_0x4ca8('0x0'));var util=require(_0x4ca8('0x1'));var moment=require(_0x4ca8('0x2'));var BPromise=require('bluebird');var rs=require(_0x4ca8('0x3'));var fs=require('fs');var Redis=require(_0x4ca8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4ca8('0x5'));var logger=require(_0x4ca8('0x6'))(_0x4ca8('0x7'));var config=require(_0x4ca8('0x8'));var jayson=require(_0x4ca8('0x9'));var client=jayson[_0x4ca8('0xa')][_0x4ca8('0xb')]({'port':0x232a});config[_0x4ca8('0xc')]=_[_0x4ca8('0xd')](config[_0x4ca8('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x4ca8('0xe'))(new Redis(config['redis']));require(_0x4ca8('0xf'))['register'](socket);function respondWithRpcPromise(_0x2f1198,_0x57db27,_0x41991d){return new BPromise(function(_0x53ffa,_0x3cc932){return client[_0x4ca8('0x10')](_0x2f1198,_0x41991d)[_0x4ca8('0x11')](function(_0x45e7d0){logger[_0x4ca8('0x12')]('VoicePrefix,\x20%s,\x20%s',_0x57db27,'request\x20sent');logger['debug']('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x57db27,_0x4ca8('0x13'),JSON['stringify'](_0x45e7d0));if(_0x45e7d0[_0x4ca8('0x14')]){if(_0x45e7d0[_0x4ca8('0x14')]['code']===0x1f4){logger['error'](_0x4ca8('0x15'),_0x57db27,_0x45e7d0[_0x4ca8('0x14')][_0x4ca8('0x16')]);return _0x3cc932(_0x45e7d0[_0x4ca8('0x14')][_0x4ca8('0x16')]);}logger[_0x4ca8('0x14')](_0x4ca8('0x15'),_0x57db27,_0x45e7d0[_0x4ca8('0x14')][_0x4ca8('0x16')]);return _0x53ffa(_0x45e7d0[_0x4ca8('0x14')][_0x4ca8('0x16')]);}else{logger[_0x4ca8('0x12')]('VoicePrefix,\x20%s,\x20%s',_0x57db27,_0x4ca8('0x13'));_0x53ffa(_0x45e7d0[_0x4ca8('0x17')][_0x4ca8('0x16')]);}})[_0x4ca8('0x18')](function(_0x28fe2b){logger['error'](_0x4ca8('0x15'),_0x57db27,_0x28fe2b);_0x3cc932(_0x28fe2b);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 09a486b..1390fd4 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 _0x65d2=['length','voicePrefix:','./voicePrefix.events','save','update','emit','register'];(function(_0x55b358,_0x255f7c){var _0x77ed88=function(_0x204b91){while(--_0x204b91){_0x55b358['push'](_0x55b358['shift']());}};_0x77ed88(++_0x255f7c);}(_0x65d2,0xb8));var _0x265d=function(_0x4298a5,_0x1fa5c3){_0x4298a5=_0x4298a5-0x0;var _0x174939=_0x65d2[_0x4298a5];return _0x174939;};'use strict';var VoicePrefixEvents=require(_0x265d('0x0'));var events=[_0x265d('0x1'),'remove',_0x265d('0x2')];function createListener(_0x12fc9b,_0x3a315b){return function(_0x59c81e){_0x3a315b[_0x265d('0x3')](_0x12fc9b,_0x59c81e);};}function removeListener(_0x233dd9,_0x2f91bf){return function(){VoicePrefixEvents['removeListener'](_0x233dd9,_0x2f91bf);};}exports[_0x265d('0x4')]=function(_0xd49e24){for(var _0x27dc2d=0x0,_0x1020fa=events[_0x265d('0x5')];_0x27dc2d<_0x1020fa;_0x27dc2d++){var _0x5ca577=events[_0x27dc2d];var _0x36bf91=createListener(_0x265d('0x6')+_0x5ca577,_0xd49e24);VoicePrefixEvents['on'](_0x5ca577,_0x36bf91);}}; \ No newline at end of file +var _0x4a3d=['removeListener','register','length','voicePrefix:','./voicePrefix.events','save','remove','update','emit'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x4a3d,0x79));var _0xd4a3=function(_0x1b43c8,_0x25cd3e){_0x1b43c8=_0x1b43c8-0x0;var _0xbb4815=_0x4a3d[_0x1b43c8];return _0xbb4815;};'use strict';var VoicePrefixEvents=require(_0xd4a3('0x0'));var events=[_0xd4a3('0x1'),_0xd4a3('0x2'),_0xd4a3('0x3')];function createListener(_0x314a8a,_0x34fd01){return function(_0x1f44cb){_0x34fd01[_0xd4a3('0x4')](_0x314a8a,_0x1f44cb);};}function removeListener(_0xcae31b,_0x8ff04a){return function(){VoicePrefixEvents[_0xd4a3('0x5')](_0xcae31b,_0x8ff04a);};}exports[_0xd4a3('0x6')]=function(_0x52ffaf){for(var _0x523038=0x0,_0x2449da=events[_0xd4a3('0x7')];_0x523038<_0x2449da;_0x523038++){var _0x5910aa=events[_0x523038];var _0x490bc1=createListener(_0xd4a3('0x8')+_0x5910aa,_0x52ffaf);VoicePrefixEvents['on'](_0x5910aa,_0x490bc1);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 16c2d9b..e846a8f 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x104112,_0x342eb6){var _0x394ab4=function(_0x48db18){while(--_0x48db18){_0x104112['push'](_0x104112['shift']());}};_0x394ab4(++_0x342eb6);}(_0xb10b,0x12a));var _0xbb10=function(_0x12e31d,_0x4b76fb){_0x12e31d=_0x12e31d-0x0;var _0x506d58=_0xb10b[_0x12e31d];return _0x506d58;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file +var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x138b2c,_0x142181){var _0xa8b921=function(_0xc1799e){while(--_0xc1799e){_0x138b2c['push'](_0x138b2c['shift']());}};_0xa8b921(++_0x142181);}(_0xb10b,0x12a));var _0xbb10=function(_0x357979,_0x56feef){_0x357979=_0x357979-0x0;var _0xabb42f=_0xb10b[_0x357979];return _0xabb42f;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index d7274b1..4d95bc3 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 _0x82c0=['predictive','booked','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','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)','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)','never','onlyIfOpen','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','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','STRING','name','ENUM','inbound','default','ringall','leastrecent','random','rrmemory','wrandom','setDataValue','strategy','getDataValue','dialMethod','preview','roundrobin','INTEGER','yes','all','TEXT','periodic_announce','split','joinempty','join','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign'];(function(_0x44aee0,_0x38cb22){var _0x4b877f=function(_0x3a66b8){while(--_0x3a66b8){_0x44aee0['push'](_0x44aee0['shift']());}};_0x4b877f(++_0x38cb22);}(_0x82c0,0x11b));var _0x082c=function(_0x34c408,_0x430c87){_0x34c408=_0x34c408-0x0;var _0x485c58=_0x82c0[_0x34c408];return _0x485c58;};'use strict';var Sequelize=require(_0x082c('0x0'));module['exports']={'name':{'type':Sequelize[_0x082c('0x1')],'allowNull':![],'unique':_0x082c('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x082c('0x3')](_0x082c('0x4'),'outbound'),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x082c('0x5')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x082c('0x6'),_0x082c('0x7'),'fewestcalls',_0x082c('0x8'),_0x082c('0x9'),'linear',_0x082c('0xa'),'rrordered'),'allowNull':![],'defaultValue':_0x082c('0x6'),'set':function(_0x49635c){this[_0x082c('0xb')](_0x082c('0xc'),_0x49635c?_0x49635c:_0x082c('0x9'));},'get':function(){var _0x39ef24=this[_0x082c('0xd')]('type');var _0x3e3794=this['getDataValue'](_0x082c('0xe'));var _0x304624=this['getDataValue'](_0x082c('0xc'));if(_0x39ef24==='outbound'){if(_0x3e3794===_0x082c('0xf')){return null;}if(_0x3e3794==='booked'&&!['rrmemory',_0x082c('0x10')]['includes'](_0x304624)){this[_0x082c('0xb')](_0x082c('0xc'),_0x082c('0x9'));}}return _0x304624;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x082c('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x082c('0x11')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x082c('0x1')]},'weight':{'type':Sequelize[_0x082c('0x11')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x082c('0x11')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x082c('0x12')},'autopause':{'type':Sequelize[_0x082c('0x3')]('yes','no',_0x082c('0x13')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x082c('0x11')](0xb)},'autopausebusy':{'type':Sequelize[_0x082c('0x3')](_0x082c('0x12'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x082c('0x3')](_0x082c('0x12'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x082c('0x11')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x082c('0x3')](_0x082c('0x12'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x082c('0x3')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x082c('0x12'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x082c('0x3')](_0x082c('0x12'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x082c('0x11')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x082c('0x3')](_0x082c('0x12'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x082c('0x3')]('yes','no'),'defaultValue':_0x082c('0x12')},'announce_holdtime':{'type':Sequelize[_0x082c('0x3')]('yes','no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x082c('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x082c('0x12'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x082c('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x082c('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x082c('0x1')]},'queue_youarenext':{'type':Sequelize[_0x082c('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x082c('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x082c('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x082c('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x082c('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x082c('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x082c('0x1')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x082c('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0x082c('0x1')]},'queue_less_than':{'type':Sequelize[_0x082c('0x1')]},'periodic_announce':{'type':Sequelize[_0x082c('0x14')],'set':function(_0x12d926){this[_0x082c('0xb')](_0x082c('0x15'),_0x12d926?_0x12d926['join'](','):[]);},'get':function(){return this[_0x082c('0xd')]('periodic_announce')?this[_0x082c('0xd')]('periodic_announce')[_0x082c('0x16')](','):[];}},'joinempty':{'type':Sequelize[_0x082c('0x1')],'defaultValue':_0x082c('0x12'),'set':function(_0x38404f){this[_0x082c('0xb')](_0x082c('0x17'),_0x38404f?_0x38404f[_0x082c('0x18')](','):undefined);},'get':function(){return this[_0x082c('0xd')](_0x082c('0x17'))?this[_0x082c('0xd')](_0x082c('0x17'))[_0x082c('0x16')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x082c('0x1')],'defaultValue':'no','set':function(_0x225b7d){this[_0x082c('0xb')]('leavewhenempty',_0x225b7d?_0x225b7d['join'](','):undefined);},'get':function(){return this['getDataValue'](_0x082c('0x19'))?this[_0x082c('0xd')](_0x082c('0x19'))[_0x082c('0x16')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x082c('0x3')](_0x082c('0x12'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x082c('0x3')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x082c('0x3')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x082c('0x1')]},'description':{'type':Sequelize[_0x082c('0x1')]},'acw':{'type':Sequelize[_0x082c('0x1a')],'defaultValue':0x0,'set':function(_0x56ea97){this[_0x082c('0xb')]('acw',_0x56ea97);if(_0x56ea97){if(this[_0x082c('0xd')]('wrapuptime')<0x2){this[_0x082c('0xb')](_0x082c('0x1b'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x082c('0x11')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x082c('0x1a')],'defaultValue':0x0,'comment':_0x082c('0x1c')},'dialMethod':{'type':Sequelize['ENUM'](_0x082c('0xf'),'progressive','power',_0x082c('0x1d'),_0x082c('0x1e')),'defaultValue':_0x082c('0x1f'),'comment':_0x082c('0x20')},'dialLimitChannel':{'type':Sequelize[_0x082c('0x11')](0x4)[_0x082c('0x21')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x082c('0x22')},'dialLimitQueue':{'type':Sequelize[_0x082c('0x11')](0x4)[_0x082c('0x21')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x082c('0x23')},'dialPowerLevel':{'type':Sequelize[_0x082c('0x24')](0x2)[_0x082c('0x21')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x082c('0x25')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x082c('0x26'),'dropRate'),'defaultValue':_0x082c('0x27'),'comment':_0x082c('0x28')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x082c('0x11')](0x3)[_0x082c('0x21')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x082c('0x29')},'dialOriginateCallerIdName':{'type':Sequelize[_0x082c('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x082c('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x082c('0x11')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x082c('0x2a')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x082c('0x2b'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x082c('0x11')](0x3)[_0x082c('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x082c('0x2c')},'dialQueueProject':{'type':Sequelize[_0x082c('0x1')],'comment':_0x082c('0x2d')},'dialCongestionMaxRetry':{'type':Sequelize[_0x082c('0x11')](0x3)[_0x082c('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x082c('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x082c('0x2e')},'dialBusyMaxRetry':{'type':Sequelize[_0x082c('0x11')](0x3)[_0x082c('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x082c('0x2f')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x082c('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x082c('0x30')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x082c('0x11')](0x3)[_0x082c('0x21')],'defaultValue':0x3,'comment':_0x082c('0x31')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x082c('0x11')](0x5)[_0x082c('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x082c('0x21')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x082c('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x082c('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x082c('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x082c('0x3')]('always',_0x082c('0x32'),_0x082c('0x33')),'defaultValue':_0x082c('0x34')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x082c('0x35')},'dialAMDInitialSilence':{'type':Sequelize[_0x082c('0x11')](0x9)[_0x082c('0x21')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x082c('0x11')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x082c('0x36')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x082c('0x11')](0x9)[_0x082c('0x21')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x082c('0x37')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x082c('0x21')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x082c('0x38')},'dialAMDMinWordLength':{'type':Sequelize[_0x082c('0x11')](0x9)[_0x082c('0x21')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x082c('0x39')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x082c('0x11')](0x9)[_0x082c('0x21')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x082c('0x3a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x082c('0x21')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x082c('0x3b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x082c('0x11')](0x5)[_0x082c('0x21')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x082c('0x11')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x082c('0x3c')},'dialRecallMeTimeout':{'type':Sequelize[_0x082c('0x11')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x082c('0x3d')},'dialRecallInQueue':{'type':Sequelize[_0x082c('0x1a')],'defaultValue':0x0,'comment':_0x082c('0x3e')},'dialOrderByScheduledAt':{'type':Sequelize[_0x082c('0x3')](_0x082c('0x3f'),_0x082c('0x40')),'defaultValue':_0x082c('0x3f')},'dialQueueProject2':{'type':Sequelize[_0x082c('0x1')],'comment':_0x082c('0x2d')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x082c('0x1a')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x082c('0x1a')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x082c('0x11')](0x3)[_0x082c('0x21')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x082c('0x11')](0x3)[_0x082c('0x21')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x082c('0x41')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x082c('0x11')](0x3)[_0x082c('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x082c('0x42')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x082c('0x11')](0x5)[_0x082c('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x082c('0x43')},'dialDropMaxRetry':{'type':Sequelize[_0x082c('0x11')](0x3)[_0x082c('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x082c('0x44')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x082c('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x082c('0x45')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x082c('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x082c('0x46')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x082c('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x082c('0x47')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x082c('0x48')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x082c('0x11')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x082c('0x49')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x082c('0x11')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x082c('0x4a')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0x082c('0x4b')},'mandatoryDisposition':{'type':Sequelize[_0x082c('0x1a')],'defaultValue':![],'comment':_0x082c('0x4c'),'set':function(_0x30a22e){if(!_0x30a22e)this[_0x082c('0xb')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x082c('0x4d'),_0x30a22e);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x082c('0x11')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x082c('0x11')](0x3)[_0x082c('0x21')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x082c('0x11')](0x3)[_0x082c('0x21')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xa828=['DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','sequelize','exports','STRING','name','outbound','default','ringall','leastrecent','fewestcalls','random','linear','wrandom','rrordered','setDataValue','strategy','rrmemory','getDataValue','type','dialMethod','preview','roundrobin','INTEGER','ENUM','yes','all','join','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','progressive','power','predictive','booked','UNSIGNED','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','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','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','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue'];(function(_0x4feb87,_0x3d4a6c){var _0x37b08c=function(_0x1d9a43){while(--_0x1d9a43){_0x4feb87['push'](_0x4feb87['shift']());}};_0x37b08c(++_0x3d4a6c);}(_0xa828,0x1db));var _0x8a82=function(_0x34ed99,_0x3e346d){_0x34ed99=_0x34ed99-0x0;var _0x35d584=_0xa828[_0x34ed99];return _0x35d584;};'use strict';var Sequelize=require(_0x8a82('0x0'));module[_0x8a82('0x1')]={'name':{'type':Sequelize[_0x8a82('0x2')],'allowNull':![],'unique':_0x8a82('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound',_0x8a82('0x4')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x8a82('0x2')],'defaultValue':_0x8a82('0x5')},'announce':{'type':Sequelize[_0x8a82('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x8a82('0x6'),_0x8a82('0x7'),_0x8a82('0x8'),_0x8a82('0x9'),'rrmemory',_0x8a82('0xa'),_0x8a82('0xb'),_0x8a82('0xc')),'allowNull':![],'defaultValue':_0x8a82('0x6'),'set':function(_0x2952e8){this[_0x8a82('0xd')](_0x8a82('0xe'),_0x2952e8?_0x2952e8:_0x8a82('0xf'));},'get':function(){var _0x3ef331=this[_0x8a82('0x10')](_0x8a82('0x11'));var _0x2528be=this['getDataValue'](_0x8a82('0x12'));var _0x3f69e7=this['getDataValue'](_0x8a82('0xe'));if(_0x3ef331===_0x8a82('0x4')){if(_0x2528be===_0x8a82('0x13')){return null;}if(_0x2528be==='booked'&&!['rrmemory',_0x8a82('0x14')]['includes'](_0x3f69e7)){this[_0x8a82('0xd')]('strategy',_0x8a82('0xf'));}}return _0x3f69e7;}},'servicelevel':{'type':Sequelize[_0x8a82('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x8a82('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x8a82('0x15')](0xb)},'timeout':{'type':Sequelize[_0x8a82('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x8a82('0x2')]},'weight':{'type':Sequelize[_0x8a82('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x8a82('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x8a82('0x16')](_0x8a82('0x17'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x8a82('0x16')](_0x8a82('0x17'),'no',_0x8a82('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x8a82('0x16')](_0x8a82('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x8a82('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x8a82('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x8a82('0x16')](_0x8a82('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x8a82('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x8a82('0x16')](_0x8a82('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x8a82('0x16')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x8a82('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x8a82('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x8a82('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x8a82('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x8a82('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x8a82('0x16')](_0x8a82('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x8a82('0x17'),'no'),'defaultValue':_0x8a82('0x17')},'announce_holdtime':{'type':Sequelize[_0x8a82('0x16')](_0x8a82('0x17'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x8a82('0x16')](_0x8a82('0x17'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x8a82('0x16')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x8a82('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x8a82('0x2')]},'queue_youarenext':{'type':Sequelize[_0x8a82('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x8a82('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x8a82('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x8a82('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x8a82('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x8a82('0x2')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x8a82('0x2')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x8a82('0x2')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x58b064){this[_0x8a82('0xd')]('periodic_announce',_0x58b064?_0x58b064[_0x8a82('0x19')](','):[]);},'get':function(){return this[_0x8a82('0x10')](_0x8a82('0x1a'))?this['getDataValue'](_0x8a82('0x1a'))[_0x8a82('0x1b')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x8a82('0x17'),'set':function(_0x500891){this[_0x8a82('0xd')](_0x8a82('0x1c'),_0x500891?_0x500891[_0x8a82('0x19')](','):undefined);},'get':function(){return this[_0x8a82('0x10')](_0x8a82('0x1c'))?this[_0x8a82('0x10')]('joinempty')[_0x8a82('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x8a82('0x2')],'defaultValue':'no','set':function(_0x29a6e5){this[_0x8a82('0xd')](_0x8a82('0x1d'),_0x29a6e5?_0x29a6e5[_0x8a82('0x19')](','):undefined);},'get':function(){return this[_0x8a82('0x10')](_0x8a82('0x1d'))?this['getDataValue']('leavewhenempty')['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x8a82('0x16')](_0x8a82('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x8a82('0x16')](_0x8a82('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x8a82('0x16')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8a82('0x2')]},'acw':{'type':Sequelize[_0x8a82('0x1e')],'defaultValue':0x0,'set':function(_0x401d61){this[_0x8a82('0xd')](_0x8a82('0x1f'),_0x401d61);if(_0x401d61){if(this[_0x8a82('0x10')](_0x8a82('0x20'))<0x2){this['setDataValue'](_0x8a82('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x8a82('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x8a82('0x1e')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x8a82('0x16')](_0x8a82('0x13'),_0x8a82('0x21'),_0x8a82('0x22'),_0x8a82('0x23'),_0x8a82('0x24')),'defaultValue':'progressive','comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x8a82('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x8a82('0x15')](0x4)[_0x8a82('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x8a82('0x26')},'dialPowerLevel':{'type':Sequelize[_0x8a82('0x27')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x8a82('0x16')](_0x8a82('0x28'),_0x8a82('0x29')),'defaultValue':'dropRate','comment':_0x8a82('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x8a82('0x27')](0x2)[_0x8a82('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x8a82('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0x8a82('0x15')](0x3)[_0x8a82('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x8a82('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0x8a82('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x8a82('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x8a82('0x15')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8a82('0x2d')},'dialQueueOptions':{'type':Sequelize[_0x8a82('0x2')],'defaultValue':'tTxX','comment':_0x8a82('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0x8a82('0x15')](0x3)[_0x8a82('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x8a82('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x8a82('0x15')](0x3)[_0x8a82('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x8a82('0x15')](0x5)[_0x8a82('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8a82('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x8a82('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8a82('0x30')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x8a82('0x15')](0x3)[_0x8a82('0x25')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8a82('0x31')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8a82('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x8a82('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x8a82('0x2')],'defaultValue':_0x8a82('0x32')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x8a82('0x33'),_0x8a82('0x34'),_0x8a82('0x35')),'defaultValue':_0x8a82('0x33')},'dialAMDActive':{'type':Sequelize[_0x8a82('0x1e')],'defaultValue':0x0,'comment':_0x8a82('0x36')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x8a82('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x8a82('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8a82('0x37')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x8a82('0x15')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x8a82('0x38')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x8a82('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x8a82('0x15')](0x9)[_0x8a82('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x8a82('0x39')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x8a82('0x15')](0x9)[_0x8a82('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x8a82('0x3a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x8a82('0x15')](0x9)[_0x8a82('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x8a82('0x3b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x8a82('0x15')](0x5)[_0x8a82('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x8a82('0x3c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x8a82('0x15')](0x9)[_0x8a82('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8a82('0x3d')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x8a82('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x8a82('0x3e')},'dialRecallInQueue':{'type':Sequelize[_0x8a82('0x1e')],'defaultValue':0x0,'comment':_0x8a82('0x3f')},'dialOrderByScheduledAt':{'type':Sequelize[_0x8a82('0x16')](_0x8a82('0x40'),_0x8a82('0x41')),'defaultValue':_0x8a82('0x40')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x8a82('0x42')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x8a82('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x8a82('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x8a82('0x15')](0x3)[_0x8a82('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8a82('0x43')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8a82('0x44')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8a82('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8a82('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8a82('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x8a82('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x8a82('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8a82('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x8a82('0x15')](0x3)[_0x8a82('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x8a82('0x15')](0x5)[_0x8a82('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8a82('0x47')},'dialMachineMaxRetry':{'type':Sequelize[_0x8a82('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8a82('0x48')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8a82('0x49')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x8a82('0x15')](0x3)[_0x8a82('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8a82('0x4a')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x8a82('0x15')](0x5)[_0x8a82('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8a82('0x15')],'allowNull':!![],'comment':_0x8a82('0x4b')},'mandatoryDisposition':{'type':Sequelize[_0x8a82('0x1e')],'defaultValue':![],'comment':_0x8a82('0x4c'),'set':function(_0x225a12){if(!_0x225a12)this[_0x8a82('0xd')]('mandatoryDispositionPauseId',null);this[_0x8a82('0xd')]('mandatoryDisposition',_0x225a12);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x8a82('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x8a82('0x1e')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x8a82('0x15')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 44dbe66..75570a3 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 _0xcfcb=['options','includeAll','include','findAll','rows','catch','show','params','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','VoiceQueues','QueueCampaigns','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','body','role','autoAssociation','getHoppers','findOne','CmHopper','VoiceQueueId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','online','voicePause','flatMap','Agents','forEach','penalty','sequelize','transaction','TeamVoiceQueue','upsert','each','UserVoiceQueue','UserVoiceQueueRt','interface','SIP/%s','emit','userVoiceQueue:save','removeTeams','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','all','union','compact','ids','isEmpty','userVoiceQueue:remove','addAgents','isNil','format','removeAgents','isArray','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','spread','dialCheckDuplicateType','insert','into','phone','ContactId','ListId','field','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','scheduledAt','cm_hopper_additional_phones','fromQuery','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','then','get','inbound','outbound','filter','ignore','map','value','includes','type','find','UserProfileResource','stack','name','send','VoiceQueue','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xcfcb,0x7a));var _0xbcfc=function(_0x8ec6b4,_0x31ef52){_0x8ec6b4=_0x8ec6b4-0x0;var _0x52c0d0=_0xcfcb[_0x8ec6b4];return _0x52c0d0;};'use strict';var emlformat=require(_0xbcfc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbcfc('0x1'));var moment=require(_0xbcfc('0x2'));var BPromise=require(_0xbcfc('0x3'));var Mustache=require(_0xbcfc('0x4'));var util=require(_0xbcfc('0x5'));var path=require(_0xbcfc('0x6'));var sox=require(_0xbcfc('0x7'));var csv=require(_0xbcfc('0x8'));var ejs=require(_0xbcfc('0x9'));var fs=require('fs');var fs_extra=require(_0xbcfc('0xa'));var _=require(_0xbcfc('0xb'));var squel=require(_0xbcfc('0xc'));var crypto=require(_0xbcfc('0xd'));var jsforce=require(_0xbcfc('0xe'));var deskjs=require(_0xbcfc('0xf'));var toCsv=require(_0xbcfc('0x8'));var querystring=require(_0xbcfc('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbcfc('0x11'));var hardwareService=require(_0xbcfc('0x12'));var logger=require(_0xbcfc('0x13'))(_0xbcfc('0x14'));var utils=require(_0xbcfc('0x15'));var config=require(_0xbcfc('0x16'));var licenseUtil=require(_0xbcfc('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xbcfc('0x18')](config[_0xbcfc('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xbcfc('0x1a'))(new Redis(config['redis']));require(_0xbcfc('0x1b'))[_0xbcfc('0x1c')](socket);function respondWithStatusCode(_0x53dff7,_0x2b54b8){_0x2b54b8=_0x2b54b8||0xcc;return function(_0x391720){if(_0x391720){return _0x53dff7[_0xbcfc('0x1d')](_0x2b54b8);}return _0x53dff7[_0xbcfc('0x1e')](_0x2b54b8)[_0xbcfc('0x1f')]();};}function respondWithResult(_0x175407,_0x4cbac8){_0x4cbac8=_0x4cbac8||0xc8;return function(_0x3ec18c){if(_0x3ec18c){return _0x175407[_0xbcfc('0x1e')](_0x4cbac8)['json'](_0x3ec18c);}};}function respondWithFilteredResult(_0x1b38ec,_0xd1ed96){return function(_0x521978){if(_0x521978){var _0x5550a6=typeof _0xd1ed96[_0xbcfc('0x20')]===_0xbcfc('0x21')&&typeof _0xd1ed96[_0xbcfc('0x22')]==='undefined';var _0x35ce65=_0x521978[_0xbcfc('0x23')];var _0xa81743=_0x5550a6?0x0:_0xd1ed96[_0xbcfc('0x20')];var _0x2eb72a=_0x5550a6?_0x521978['count']:_0xd1ed96[_0xbcfc('0x20')]+_0xd1ed96[_0xbcfc('0x22')];var _0x250a25;if(_0x2eb72a>=_0x35ce65){_0x2eb72a=_0x35ce65;_0x250a25=0xc8;}else{_0x250a25=0xce;}_0x1b38ec['status'](_0x250a25);return _0x1b38ec['set'](_0xbcfc('0x24'),_0xa81743+'-'+_0x2eb72a+'/'+_0x35ce65)[_0xbcfc('0x25')](_0x521978);}return null;};}function patchUpdates(_0x43f168){return function(_0x2c9f8b){try{jsonpatch[_0xbcfc('0x26')](_0x2c9f8b,_0x43f168,!![]);}catch(_0x265ec6){return BPromise[_0xbcfc('0x27')](_0x265ec6);}return _0x2c9f8b['save']();};}function saveUpdates(_0x3a90a7,_0x46f05a){return function(_0x4990b9){if(_0x4990b9){return _0x4990b9[_0xbcfc('0x28')](_0x3a90a7)['then'](function(_0x9a013f){return _0x9a013f;});}return null;};}function removeEntity(_0x34fbf2,_0x58295c){return function(_0x31a504){if(_0x31a504){return _0x31a504[_0xbcfc('0x29')]()[_0xbcfc('0x2a')](function(){var _0x3db2ec=_0x31a504[_0xbcfc('0x2b')]({'plain':!![]});var _0x13fa0d=[{'name':'VoiceQueues','value':_0xbcfc('0x2c'),'ignore':![]},{'name':'QueueCampaigns','value':_0xbcfc('0x2d'),'ignore':![]}];var _0x4a35dd=_(_0x13fa0d)[_0xbcfc('0x2e')](_0xbcfc('0x2f'))[_0xbcfc('0x30')](_0xbcfc('0x31'))[_0xbcfc('0x31')]();if(_[_0xbcfc('0x32')](_0x4a35dd,_0x3db2ec[_0xbcfc('0x33')])){return;}var _0x157663=_[_0xbcfc('0x34')](_0x13fa0d,[_0xbcfc('0x31'),_0x3db2ec[_0xbcfc('0x33')]])['name'];return db[_0xbcfc('0x35')]['destroy']({'where':{'type':_0x157663,'resourceId':_0x3db2ec['id']}})[_0xbcfc('0x2a')](function(){return _0x31a504;});})[_0xbcfc('0x2a')](function(){_0x34fbf2[_0xbcfc('0x1e')](0xcc)[_0xbcfc('0x1f')]();});}};}function handleEntityNotFound(_0xd04938,_0x59077b){return function(_0x3eef74){if(!_0x3eef74){_0xd04938[_0xbcfc('0x1d')](0x194);}return _0x3eef74;};}function handleError(_0x15f9d9,_0x3063bc){_0x3063bc=_0x3063bc||0x1f4;return function(_0x36be70){logger['error'](_0x36be70[_0xbcfc('0x36')]);if(_0x36be70[_0xbcfc('0x37')]){delete _0x36be70['name'];}_0x15f9d9[_0xbcfc('0x1e')](_0x3063bc)[_0xbcfc('0x38')](_0x36be70);};}exports['index']=function(_0x5cdc5d,_0xbb0f2b){var _0x378d2d={},_0x257024={},_0x2cbdac={'count':0x0,'rows':[]};var _0x18d520=_[_0xbcfc('0x30')](db[_0xbcfc('0x39')][_0xbcfc('0x3a')],function(_0x1c4bb7){return{'name':_0x1c4bb7[_0xbcfc('0x3b')],'type':_0x1c4bb7['type'][_0xbcfc('0x3c')]};});_0x257024[_0xbcfc('0x3d')]=_['map'](_0x18d520,_0xbcfc('0x37'));_0x257024['query']=_[_0xbcfc('0x3e')](_0x5cdc5d[_0xbcfc('0x3f')]);_0x257024[_0xbcfc('0x40')]=_['intersection'](_0x257024['model'],_0x257024[_0xbcfc('0x3f')]);_0x378d2d[_0xbcfc('0x41')]=_[_0xbcfc('0x42')](_0x257024['model'],qs[_0xbcfc('0x43')](_0x5cdc5d[_0xbcfc('0x3f')]['fields']));_0x378d2d['attributes']=_0x378d2d['attributes']['length']?_0x378d2d['attributes']:_0x257024['model'];if(!_0x5cdc5d['query'][_0xbcfc('0x44')](_0xbcfc('0x45'))){_0x378d2d['limit']=qs['limit'](_0x5cdc5d['query'][_0xbcfc('0x22')]);_0x378d2d[_0xbcfc('0x20')]=qs[_0xbcfc('0x20')](_0x5cdc5d['query']['offset']);}_0x378d2d[_0xbcfc('0x46')]=qs[_0xbcfc('0x47')](_0x5cdc5d[_0xbcfc('0x3f')][_0xbcfc('0x47')]);_0x378d2d['where']=qs['filters'](_[_0xbcfc('0x48')](_0x5cdc5d['query'],_0x257024['filters']),_0x18d520);if(_0x5cdc5d['query'][_0xbcfc('0x2e')]){_0x378d2d[_0xbcfc('0x49')]=_[_0xbcfc('0x4a')](_0x378d2d[_0xbcfc('0x49')],{'$or':_['map'](_0x18d520,function(_0x372fa8){if(_0x372fa8[_0xbcfc('0x33')]!==_0xbcfc('0x4b')){var _0x56032c={};_0x56032c[_0x372fa8[_0xbcfc('0x37')]]={'$like':'%'+_0x5cdc5d[_0xbcfc('0x3f')][_0xbcfc('0x2e')]+'%'};return _0x56032c;}})});}_0x378d2d=_[_0xbcfc('0x4a')]({},_0x378d2d,_0x5cdc5d[_0xbcfc('0x4c')]);var _0x1fc62e={'where':_0x378d2d['where']};return db[_0xbcfc('0x39')][_0xbcfc('0x23')](_0x1fc62e)[_0xbcfc('0x2a')](function(_0x35a605){_0x2cbdac[_0xbcfc('0x23')]=_0x35a605;if(_0x5cdc5d['query'][_0xbcfc('0x4d')]){_0x378d2d[_0xbcfc('0x4e')]=[{'all':!![]}];}return db['VoiceQueue'][_0xbcfc('0x4f')](_0x378d2d);})[_0xbcfc('0x2a')](function(_0x531b48){_0x2cbdac[_0xbcfc('0x50')]=_0x531b48;return _0x2cbdac;})[_0xbcfc('0x2a')](respondWithFilteredResult(_0xbb0f2b,_0x378d2d))[_0xbcfc('0x51')](handleError(_0xbb0f2b,null));};exports[_0xbcfc('0x52')]=function(_0x33d946,_0x5a4207){var _0x258c17={'raw':![],'where':{'id':_0x33d946[_0xbcfc('0x53')]['id']}},_0x134f0d={};_0x134f0d[_0xbcfc('0x3d')]=_['keys'](db[_0xbcfc('0x39')][_0xbcfc('0x3a')]);_0x134f0d['query']=_['keys'](_0x33d946[_0xbcfc('0x3f')]);_0x134f0d[_0xbcfc('0x40')]=_[_0xbcfc('0x42')](_0x134f0d[_0xbcfc('0x3d')],_0x134f0d[_0xbcfc('0x3f')]);_0x258c17[_0xbcfc('0x41')]=_['intersection'](_0x134f0d[_0xbcfc('0x3d')],qs[_0xbcfc('0x43')](_0x33d946[_0xbcfc('0x3f')]['fields']));_0x258c17[_0xbcfc('0x41')]=_0x258c17[_0xbcfc('0x41')][_0xbcfc('0x54')]?_0x258c17[_0xbcfc('0x41')]:_0x134f0d[_0xbcfc('0x3d')];if(_0x33d946[_0xbcfc('0x3f')][_0xbcfc('0x4d')]){_0x258c17['include']=[{'all':!![]}];}_0x258c17=_[_0xbcfc('0x4a')]({},_0x258c17,_0x33d946[_0xbcfc('0x4c')]);return db[_0xbcfc('0x39')][_0xbcfc('0x34')](_0x258c17)[_0xbcfc('0x2a')](handleEntityNotFound(_0x5a4207,null))[_0xbcfc('0x2a')](respondWithResult(_0x5a4207,null))[_0xbcfc('0x51')](handleError(_0x5a4207,null));};exports[_0xbcfc('0x55')]=function(_0x1ba1d5,_0x4469b8){return db[_0xbcfc('0x39')][_0xbcfc('0x55')](_0x1ba1d5['body'],{})[_0xbcfc('0x2a')](function(_0x3ff36b){var _0x3524f9=_0x1ba1d5[_0xbcfc('0x56')][_0xbcfc('0x2b')]({'plain':!![]});if(!_0x3524f9)throw new Error(_0xbcfc('0x57'));if(_0x3524f9['role']===_0xbcfc('0x56')){var _0x1a3d0f=_0x3ff36b[_0xbcfc('0x2b')]({'plain':!![]});var _0xc88673=[{'name':_0xbcfc('0x58'),'value':_0xbcfc('0x2c')},{'name':_0xbcfc('0x59'),'value':_0xbcfc('0x2d')}];var _0x558a93=_['find'](_0xc88673,['value',_0x1a3d0f[_0xbcfc('0x33')]])[_0xbcfc('0x37')];return db[_0xbcfc('0x5a')]['find']({'where':{'name':_0x558a93,'userProfileId':_0x3524f9[_0xbcfc('0x5b')]},'raw':!![]})[_0xbcfc('0x2a')](function(_0x4081b9){if(_0x4081b9&&_0x4081b9['autoAssociation']===0x0){return db['UserProfileResource'][_0xbcfc('0x55')]({'name':_0x1a3d0f[_0xbcfc('0x37')],'resourceId':_0x1a3d0f['id'],'type':_0x4081b9['name'],'sectionId':_0x4081b9['id']},{})[_0xbcfc('0x2a')](function(){return _0x3ff36b;});}else{return _0x3ff36b;}})['catch'](function(_0x33ccae){logger[_0xbcfc('0x5c')](_0xbcfc('0x5d'),_0x33ccae);throw _0x33ccae;});}return _0x3ff36b;})[_0xbcfc('0x2a')](respondWithResult(_0x4469b8,0xc9))['catch'](handleError(_0x4469b8,null));};exports['clone']=function(_0xcacfa2,_0x55b7e2){var _0x3109bf={'where':{'id':_0xcacfa2[_0xbcfc('0x53')]['id']}},_0x590b8e={};_0x590b8e[_0xbcfc('0x3d')]=_['keys'](db[_0xbcfc('0x39')][_0xbcfc('0x3a')]);_0x3109bf['attributes']=_['intersection'](_0x590b8e[_0xbcfc('0x3d')],qs[_0xbcfc('0x43')](_0xcacfa2[_0xbcfc('0x3f')][_0xbcfc('0x43')]));_0x3109bf[_0xbcfc('0x41')]=_0x3109bf[_0xbcfc('0x41')][_0xbcfc('0x54')]?_0x3109bf[_0xbcfc('0x41')]:_0x590b8e[_0xbcfc('0x3d')];if(_0xcacfa2[_0xbcfc('0x3f')][_0xbcfc('0x4d')]){_0x3109bf[_0xbcfc('0x4e')]=[{'all':!![]}];}_0x3109bf=_[_0xbcfc('0x4a')]({},_0x3109bf,_0xcacfa2[_0xbcfc('0x4c')]);return db[_0xbcfc('0x39')]['find'](_0x3109bf)[_0xbcfc('0x2a')](handleEntityNotFound(_0x55b7e2,null))[_0xbcfc('0x2a')](function(_0x46dafd){if(_0x46dafd){var _0x473383=_0x46dafd[_0xbcfc('0x2b')]({'plain':!![]});_0x473383=qs[_0xbcfc('0x5e')](_0x473383,['id',_0xbcfc('0x5f'),_0xbcfc('0x60')]);_0xcacfa2[_0xbcfc('0x61')]=_[_0xbcfc('0x5e')](_0xcacfa2[_0xbcfc('0x61')],['id',_0xbcfc('0x5f'),'updatedAt']);return db[_0xbcfc('0x39')]['create'](_[_0xbcfc('0x4a')](_0x473383,_0xcacfa2['body']),{'include':_0xcacfa2['query'][_0xbcfc('0x4d')]?[{'all':!![]}]:undefined})[_0xbcfc('0x2a')](function(_0x41c979){var _0x1de3ef=_0xcacfa2[_0xbcfc('0x56')]['get']({'plain':!![]});if(!_0x1de3ef)throw new Error(_0xbcfc('0x57'));if(_0x1de3ef[_0xbcfc('0x62')]===_0xbcfc('0x56')){var _0x2411b9=_0x41c979['get']({'plain':!![]});var _0x3601c5=[{'name':'VoiceQueues','value':'inbound'},{'name':'QueueCampaigns','value':_0xbcfc('0x2d')}];var _0x52a829=_[_0xbcfc('0x34')](_0x3601c5,[_0xbcfc('0x31'),_0x2411b9[_0xbcfc('0x33')]])['name'];return db[_0xbcfc('0x5a')][_0xbcfc('0x34')]({'where':{'name':_0x52a829,'userProfileId':_0x1de3ef[_0xbcfc('0x5b')]},'raw':!![]})[_0xbcfc('0x2a')](function(_0x134143){if(_0x134143&&_0x134143[_0xbcfc('0x63')]===0x0){return db['UserProfileResource']['create']({'name':_0x2411b9['name'],'resourceId':_0x2411b9['id'],'type':_0x134143['name'],'sectionId':_0x134143['id']},{})[_0xbcfc('0x2a')](function(){return _0x41c979;});}else{return _0x41c979;}})[_0xbcfc('0x51')](function(_0x3d7892){logger[_0xbcfc('0x5c')](_0xbcfc('0x5d'),_0x3d7892);throw _0x3d7892;});}return _0x41c979;});}})[_0xbcfc('0x2a')](respondWithResult(_0x55b7e2,0xc9))[_0xbcfc('0x51')](handleError(_0x55b7e2,null));};exports['update']=function(_0xb22ced,_0x4c088b){if(_0xb22ced[_0xbcfc('0x61')]['id']){delete _0xb22ced[_0xbcfc('0x61')]['id'];}return db[_0xbcfc('0x39')][_0xbcfc('0x34')]({'where':{'id':_0xb22ced[_0xbcfc('0x53')]['id']}})['then'](handleEntityNotFound(_0x4c088b,null))[_0xbcfc('0x2a')](saveUpdates(_0xb22ced[_0xbcfc('0x61')],null))[_0xbcfc('0x2a')](respondWithResult(_0x4c088b,null))[_0xbcfc('0x51')](handleError(_0x4c088b,null));};exports[_0xbcfc('0x29')]=function(_0x32333c,_0xb2e9dc){return db['VoiceQueue']['find']({'where':{'id':_0x32333c[_0xbcfc('0x53')]['id']}})[_0xbcfc('0x2a')](handleEntityNotFound(_0xb2e9dc,null))['then'](removeEntity(_0xb2e9dc,null))[_0xbcfc('0x51')](handleError(_0xb2e9dc,null));};exports[_0xbcfc('0x64')]=function(_0x34ac3c,_0x3544f5,_0x46a5e0){var _0x48846a={'raw':![],'where':{}};var _0x1baf3e={};var _0x457b73={'count':0x0,'rows':[]};return db[_0xbcfc('0x39')][_0xbcfc('0x65')]({'where':{'id':_0x34ac3c[_0xbcfc('0x53')]['id']}})[_0xbcfc('0x2a')](handleEntityNotFound(_0x3544f5,null))['then'](function(_0x1f388a){if(_0x1f388a){_0x1baf3e[_0xbcfc('0x3d')]=_['keys'](db[_0xbcfc('0x66')][_0xbcfc('0x3a')]);_0x1baf3e[_0xbcfc('0x3f')]=_[_0xbcfc('0x3e')](_0x34ac3c[_0xbcfc('0x3f')]);_0x1baf3e[_0xbcfc('0x40')]=_[_0xbcfc('0x42')](_0x1baf3e[_0xbcfc('0x3d')],_0x1baf3e['query']);_0x48846a['attributes']=_[_0xbcfc('0x42')](_0x1baf3e['model'],qs['fields'](_0x34ac3c[_0xbcfc('0x3f')][_0xbcfc('0x43')]));_0x48846a[_0xbcfc('0x41')]=_0x48846a[_0xbcfc('0x41')]['length']?_0x48846a['attributes']:_0x1baf3e[_0xbcfc('0x3d')];if(!_0x34ac3c[_0xbcfc('0x3f')]['hasOwnProperty'](_0xbcfc('0x45'))){_0x48846a[_0xbcfc('0x22')]=qs[_0xbcfc('0x22')](_0x34ac3c['query'][_0xbcfc('0x22')]);_0x48846a[_0xbcfc('0x20')]=qs[_0xbcfc('0x20')](_0x34ac3c[_0xbcfc('0x3f')][_0xbcfc('0x20')]);}_0x48846a[_0xbcfc('0x46')]=qs[_0xbcfc('0x47')](_0x34ac3c[_0xbcfc('0x3f')][_0xbcfc('0x47')]);_0x48846a['where']=qs[_0xbcfc('0x40')](_[_0xbcfc('0x48')](_0x34ac3c[_0xbcfc('0x3f')],_0x1baf3e[_0xbcfc('0x40')]));_0x48846a[_0xbcfc('0x49')][_0xbcfc('0x67')]=_0x1f388a['id'];if(_0x34ac3c['query'][_0xbcfc('0x2e')]){_0x48846a['where']=_[_0xbcfc('0x4a')](_0x48846a[_0xbcfc('0x49')],{'$or':_['map'](_0x48846a[_0xbcfc('0x41')],function(_0x15d102){var _0x34ec5a={};_0x34ec5a[_0x15d102]={'$like':'%'+_0x34ac3c[_0xbcfc('0x3f')]['filter']+'%'};return _0x34ec5a;})});}_0x48846a=_['merge']({},_0x48846a,_0x34ac3c[_0xbcfc('0x4c')]);return db[_0xbcfc('0x66')][_0xbcfc('0x23')]({'where':_0x48846a['where']})[_0xbcfc('0x2a')](function(_0x598f80){_0x457b73[_0xbcfc('0x23')]=_0x598f80;if(_0x34ac3c[_0xbcfc('0x3f')][_0xbcfc('0x4d')]){_0x48846a[_0xbcfc('0x4e')]=[{'all':!![]}];}return db[_0xbcfc('0x66')][_0xbcfc('0x4f')](_0x48846a);})[_0xbcfc('0x2a')](function(_0x6724d){_0x457b73[_0xbcfc('0x50')]=_0x6724d;return _0x457b73;});}})['then'](respondWithFilteredResult(_0x3544f5,_0x48846a))[_0xbcfc('0x51')](handleError(_0x3544f5,null));};exports['getHopperHistories']=function(_0x387b2,_0x2d2b1b,_0x4c1867){var _0x40e8b3={'raw':!![],'where':{}};var _0x55aaf5={};var _0xf8a02b={'count':0x0,'rows':[]};return db[_0xbcfc('0x39')][_0xbcfc('0x65')]({'where':{'id':_0x387b2[_0xbcfc('0x53')]['id']}})[_0xbcfc('0x2a')](handleEntityNotFound(_0x2d2b1b,null))['then'](function(_0x24c1bb){if(_0x24c1bb){_0x55aaf5[_0xbcfc('0x3d')]=_[_0xbcfc('0x3e')](db[_0xbcfc('0x68')]['rawAttributes']);_0x55aaf5[_0xbcfc('0x3f')]=_[_0xbcfc('0x3e')](_0x387b2['query']);_0x55aaf5[_0xbcfc('0x40')]=_['intersection'](_0x55aaf5[_0xbcfc('0x3d')],_0x55aaf5['query']);_0x40e8b3['attributes']=_['intersection'](_0x55aaf5[_0xbcfc('0x3d')],qs[_0xbcfc('0x43')](_0x387b2[_0xbcfc('0x3f')][_0xbcfc('0x43')]));_0x40e8b3['attributes']=_0x40e8b3[_0xbcfc('0x41')][_0xbcfc('0x54')]?_0x40e8b3['attributes']:_0x55aaf5[_0xbcfc('0x3d')];if(!_0x387b2[_0xbcfc('0x3f')][_0xbcfc('0x44')](_0xbcfc('0x45'))){_0x40e8b3[_0xbcfc('0x22')]=qs[_0xbcfc('0x22')](_0x387b2[_0xbcfc('0x3f')]['limit']);_0x40e8b3[_0xbcfc('0x20')]=qs[_0xbcfc('0x20')](_0x387b2[_0xbcfc('0x3f')][_0xbcfc('0x20')]);}_0x40e8b3[_0xbcfc('0x46')]=qs['sort'](_0x387b2[_0xbcfc('0x3f')][_0xbcfc('0x47')]);_0x40e8b3[_0xbcfc('0x49')]=qs[_0xbcfc('0x40')](_[_0xbcfc('0x48')](_0x387b2[_0xbcfc('0x3f')],_0x55aaf5[_0xbcfc('0x40')]));_0x40e8b3['where'][_0xbcfc('0x67')]=_0x24c1bb['id'];if(_0x387b2[_0xbcfc('0x3f')][_0xbcfc('0x2e')]){_0x40e8b3[_0xbcfc('0x49')]=_[_0xbcfc('0x4a')](_0x40e8b3[_0xbcfc('0x49')],{'$or':_[_0xbcfc('0x30')](_0x40e8b3[_0xbcfc('0x41')],function(_0x407d4e){var _0x24c048={};_0x24c048[_0x407d4e]={'$like':'%'+_0x387b2['query']['filter']+'%'};return _0x24c048;})});}_0x40e8b3=_[_0xbcfc('0x4a')]({},_0x40e8b3,_0x387b2[_0xbcfc('0x4c')]);return db[_0xbcfc('0x68')][_0xbcfc('0x23')]({'where':_0x40e8b3[_0xbcfc('0x49')]})[_0xbcfc('0x2a')](function(_0x336021){_0xf8a02b[_0xbcfc('0x23')]=_0x336021;if(_0x387b2[_0xbcfc('0x3f')]['includeAll']){_0x40e8b3[_0xbcfc('0x4e')]=[{'all':!![]}];}return db[_0xbcfc('0x68')][_0xbcfc('0x4f')](_0x40e8b3);})['then'](function(_0x183df3){_0xf8a02b[_0xbcfc('0x50')]=_0x183df3;return _0xf8a02b;});}})[_0xbcfc('0x2a')](respondWithFilteredResult(_0x2d2b1b,_0x40e8b3))[_0xbcfc('0x51')](handleError(_0x2d2b1b,null));};exports[_0xbcfc('0x69')]=function(_0x2b1da7,_0x333e6d,_0x1e356e){var _0x6f7373={'raw':!![],'where':{}};var _0x39d098={};var _0x349461={'count':0x0,'rows':[]};return db[_0xbcfc('0x39')][_0xbcfc('0x65')]({'where':{'id':_0x2b1da7['params']['id']}})[_0xbcfc('0x2a')](handleEntityNotFound(_0x333e6d,null))[_0xbcfc('0x2a')](function(_0x394619){if(_0x394619){_0x39d098[_0xbcfc('0x3d')]=_['keys'](db[_0xbcfc('0x6a')][_0xbcfc('0x3a')]);_0x39d098[_0xbcfc('0x3f')]=_['keys'](_0x2b1da7[_0xbcfc('0x3f')]);_0x39d098[_0xbcfc('0x40')]=_[_0xbcfc('0x42')](_0x39d098[_0xbcfc('0x3d')],_0x39d098['query']);_0x6f7373[_0xbcfc('0x41')]=_[_0xbcfc('0x42')](_0x39d098['model'],qs['fields'](_0x2b1da7[_0xbcfc('0x3f')][_0xbcfc('0x43')]));_0x6f7373[_0xbcfc('0x41')]=_0x6f7373[_0xbcfc('0x41')][_0xbcfc('0x54')]?_0x6f7373[_0xbcfc('0x41')]:_0x39d098['model'];if(!_0x2b1da7[_0xbcfc('0x3f')][_0xbcfc('0x44')](_0xbcfc('0x45'))){_0x6f7373[_0xbcfc('0x22')]=qs[_0xbcfc('0x22')](_0x2b1da7[_0xbcfc('0x3f')][_0xbcfc('0x22')]);_0x6f7373[_0xbcfc('0x20')]=qs[_0xbcfc('0x20')](_0x2b1da7[_0xbcfc('0x3f')][_0xbcfc('0x20')]);}_0x6f7373[_0xbcfc('0x46')]=qs[_0xbcfc('0x47')](_0x2b1da7['query'][_0xbcfc('0x47')]);_0x6f7373['where']=qs[_0xbcfc('0x40')](_[_0xbcfc('0x48')](_0x2b1da7[_0xbcfc('0x3f')],_0x39d098['filters']));_0x6f7373[_0xbcfc('0x49')][_0xbcfc('0x67')]=_0x394619['id'];if(_0x2b1da7['query'][_0xbcfc('0x2e')]){_0x6f7373[_0xbcfc('0x49')]=_[_0xbcfc('0x4a')](_0x6f7373[_0xbcfc('0x49')],{'$or':_['map'](_0x6f7373[_0xbcfc('0x41')],function(_0x1d0d7c){var _0x5c28da={};_0x5c28da[_0x1d0d7c]={'$like':'%'+_0x2b1da7[_0xbcfc('0x3f')][_0xbcfc('0x2e')]+'%'};return _0x5c28da;})});}_0x6f7373=_[_0xbcfc('0x4a')]({},_0x6f7373,_0x2b1da7[_0xbcfc('0x4c')]);return db[_0xbcfc('0x6a')][_0xbcfc('0x23')]({'where':_0x6f7373[_0xbcfc('0x49')]})[_0xbcfc('0x2a')](function(_0xcecc2e){_0x349461[_0xbcfc('0x23')]=_0xcecc2e;if(_0x2b1da7['query'][_0xbcfc('0x4d')]){_0x6f7373[_0xbcfc('0x4e')]=[{'all':!![]}];}return db[_0xbcfc('0x6a')]['findAll'](_0x6f7373);})[_0xbcfc('0x2a')](function(_0x3b46cf){_0x349461['rows']=_0x3b46cf;return _0x349461;});}})[_0xbcfc('0x2a')](respondWithFilteredResult(_0x333e6d,_0x6f7373))[_0xbcfc('0x51')](handleError(_0x333e6d,null));};exports[_0xbcfc('0x6b')]=function(_0x1d056a,_0x21b213,_0x1503cb){var _0x57c7e2={'raw':!![],'where':{}};var _0x1690fa={};var _0x404985={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xbcfc('0x65')]({'where':{'id':_0x1d056a[_0xbcfc('0x53')]['id']}})[_0xbcfc('0x2a')](handleEntityNotFound(_0x21b213,null))[_0xbcfc('0x2a')](function(_0x5521cc){if(_0x5521cc){_0x1690fa[_0xbcfc('0x3d')]=_[_0xbcfc('0x3e')](db[_0xbcfc('0x6c')][_0xbcfc('0x3a')]);_0x1690fa[_0xbcfc('0x3f')]=_['keys'](_0x1d056a['query']);_0x1690fa[_0xbcfc('0x40')]=_[_0xbcfc('0x42')](_0x1690fa[_0xbcfc('0x3d')],_0x1690fa[_0xbcfc('0x3f')]);_0x57c7e2[_0xbcfc('0x41')]=_[_0xbcfc('0x42')](_0x1690fa[_0xbcfc('0x3d')],qs[_0xbcfc('0x43')](_0x1d056a[_0xbcfc('0x3f')][_0xbcfc('0x43')]));_0x57c7e2[_0xbcfc('0x41')]=_0x57c7e2[_0xbcfc('0x41')][_0xbcfc('0x54')]?_0x57c7e2[_0xbcfc('0x41')]:_0x1690fa[_0xbcfc('0x3d')];if(!_0x1d056a[_0xbcfc('0x3f')][_0xbcfc('0x44')](_0xbcfc('0x45'))){_0x57c7e2[_0xbcfc('0x22')]=qs[_0xbcfc('0x22')](_0x1d056a['query'][_0xbcfc('0x22')]);_0x57c7e2['offset']=qs[_0xbcfc('0x20')](_0x1d056a[_0xbcfc('0x3f')][_0xbcfc('0x20')]);}_0x57c7e2[_0xbcfc('0x46')]=qs[_0xbcfc('0x47')](_0x1d056a[_0xbcfc('0x3f')][_0xbcfc('0x47')]);_0x57c7e2[_0xbcfc('0x49')]=qs[_0xbcfc('0x40')](_[_0xbcfc('0x48')](_0x1d056a[_0xbcfc('0x3f')],_0x1690fa[_0xbcfc('0x40')]));_0x57c7e2[_0xbcfc('0x49')]['VoiceQueueId']=_0x5521cc['id'];if(_0x1d056a['query'][_0xbcfc('0x2e')]){_0x57c7e2[_0xbcfc('0x49')]=_[_0xbcfc('0x4a')](_0x57c7e2[_0xbcfc('0x49')],{'$or':_['map'](_0x57c7e2[_0xbcfc('0x41')],function(_0x2a824d){var _0x1f5a8c={};_0x1f5a8c[_0x2a824d]={'$like':'%'+_0x1d056a[_0xbcfc('0x3f')]['filter']+'%'};return _0x1f5a8c;})});}_0x57c7e2=_[_0xbcfc('0x4a')]({},_0x57c7e2,_0x1d056a[_0xbcfc('0x4c')]);return db[_0xbcfc('0x6c')][_0xbcfc('0x23')]({'where':_0x57c7e2[_0xbcfc('0x49')]})[_0xbcfc('0x2a')](function(_0x15bf28){_0x404985[_0xbcfc('0x23')]=_0x15bf28;if(_0x1d056a['query'][_0xbcfc('0x4d')]){_0x57c7e2[_0xbcfc('0x4e')]=[{'all':!![]}];}return db[_0xbcfc('0x6c')][_0xbcfc('0x4f')](_0x57c7e2);})[_0xbcfc('0x2a')](function(_0x43c7f6){_0x404985[_0xbcfc('0x50')]=_0x43c7f6;return _0x404985;});}})['then'](respondWithFilteredResult(_0x21b213,_0x57c7e2))[_0xbcfc('0x51')](handleError(_0x21b213,null));};exports[_0xbcfc('0x6d')]=function(_0x484888,_0x159f23,_0x96aaff){var _0x208ed6={};var _0x48d120={};var _0x186672;var _0x3326c2;return db[_0xbcfc('0x39')][_0xbcfc('0x65')]({'where':{'id':_0x484888[_0xbcfc('0x53')]['id']}})['then'](handleEntityNotFound(_0x159f23,null))[_0xbcfc('0x2a')](function(_0x225c5b){if(_0x225c5b){_0x186672=_0x225c5b;_0x48d120[_0xbcfc('0x3d')]=_[_0xbcfc('0x3e')](db[_0xbcfc('0x6e')][_0xbcfc('0x3a')]);_0x48d120[_0xbcfc('0x3f')]=_[_0xbcfc('0x3e')](_0x484888[_0xbcfc('0x3f')]);_0x48d120[_0xbcfc('0x40')]=_['intersection'](_0x48d120[_0xbcfc('0x3d')],_0x48d120[_0xbcfc('0x3f')]);_0x208ed6[_0xbcfc('0x41')]=_['intersection'](_0x48d120[_0xbcfc('0x3d')],qs[_0xbcfc('0x43')](_0x484888[_0xbcfc('0x3f')][_0xbcfc('0x43')]));_0x208ed6[_0xbcfc('0x41')]=_0x208ed6[_0xbcfc('0x41')][_0xbcfc('0x54')]?_0x208ed6[_0xbcfc('0x41')]:_0x48d120[_0xbcfc('0x3d')];_0x208ed6['order']=qs['sort'](_0x484888[_0xbcfc('0x3f')][_0xbcfc('0x47')]);_0x208ed6[_0xbcfc('0x49')]=qs[_0xbcfc('0x40')](_['pick'](_0x484888['query'],_0x48d120[_0xbcfc('0x40')]));if(_0x484888['query'][_0xbcfc('0x2e')]){_0x208ed6[_0xbcfc('0x49')]=_[_0xbcfc('0x4a')](_0x208ed6['where'],{'$or':_[_0xbcfc('0x30')](_0x208ed6[_0xbcfc('0x41')],function(_0x47c375){var _0x5eec87={};_0x5eec87[_0x47c375]={'$like':'%'+_0x484888[_0xbcfc('0x3f')][_0xbcfc('0x2e')]+'%'};return _0x5eec87;})});}_0x208ed6=_[_0xbcfc('0x4a')]({},_0x208ed6,_0x484888[_0xbcfc('0x4c')]);return _0x186672['getTeams'](_0x208ed6);}})['then'](function(_0x4972cf){if(_0x4972cf){_0x3326c2=_0x4972cf[_0xbcfc('0x54')];if(!_0x484888[_0xbcfc('0x3f')][_0xbcfc('0x44')]('nolimit')){_0x208ed6['limit']=qs[_0xbcfc('0x22')](_0x484888[_0xbcfc('0x3f')][_0xbcfc('0x22')]);_0x208ed6[_0xbcfc('0x20')]=qs[_0xbcfc('0x20')](_0x484888[_0xbcfc('0x3f')]['offset']);}return _0x186672[_0xbcfc('0x6d')](_0x208ed6);}})[_0xbcfc('0x2a')](function(_0x32db2f){if(_0x32db2f){return _0x32db2f?{'count':_0x3326c2,'rows':_0x32db2f}:null;}})[_0xbcfc('0x2a')](respondWithResult(_0x159f23,null))['catch'](handleError(_0x159f23,null));};exports[_0xbcfc('0x6f')]=function(_0x48ff4f,_0x2a862b,_0x8de279){var _0x3fa332=_0x48ff4f['body'][_0xbcfc('0x70')];var _0x3fbc02=_[_0xbcfc('0x30')](_0x3fa332,'id');return db[_0xbcfc('0x6e')][_0xbcfc('0x4f')]({'where':{'id':_0x3fbc02},'attributes':['id'],'include':[{'model':db[_0xbcfc('0x71')],'as':'Agents','attributes':['id',_0xbcfc('0x37'),_0xbcfc('0x72'),_0xbcfc('0x73'),'interface'],'raw':!![]}]})[_0xbcfc('0x2a')](function(_0x312665){if(_0x312665){var _0x274ac8=_[_0xbcfc('0x74')](_0x312665,function(_0x31fe39){var _0x307057=_0x31fe39[_0xbcfc('0x2b')]({'plain':!![]});_0x307057[_0xbcfc('0x75')][_0xbcfc('0x76')](function(_0x525f0b){_0x525f0b[_0xbcfc('0x77')]=_[_0xbcfc('0x34')](_0x3fa332,{'id':_0x307057['id']})[_0xbcfc('0x77')];});return _0x307057['Agents'];});return db[_0xbcfc('0x39')][_0xbcfc('0x34')]({'where':{'id':_0x48ff4f['params']['id']}})[_0xbcfc('0x2a')](function(_0x371813){return db[_0xbcfc('0x78')][_0xbcfc('0x79')](function(_0x1b2e23){return _0x371813[_0xbcfc('0x6f')](_0x3fbc02,{'transaction':_0x1b2e23})[_0xbcfc('0x2a')](function(){return BPromise['each'](_0x3fa332,function(_0x567030){return db[_0xbcfc('0x7a')][_0xbcfc('0x7b')]({'TeamId':_0x567030['id'],'VoiceQueueId':_0x48ff4f[_0xbcfc('0x53')]['id'],'penalty':_0x567030[_0xbcfc('0x77')]},{'transaction':_0x1b2e23});});})['then'](function(){return BPromise[_0xbcfc('0x7c')](_0x274ac8,function(_0x3ff362){return db[_0xbcfc('0x7d')]['findOrCreate']({'where':{'UserId':_0x3ff362['id'],'VoiceQueueId':_0x48ff4f[_0xbcfc('0x53')]['id']},'defaults':{'penalty':_0x3ff362['penalty']},'transaction':_0x1b2e23});});})[_0xbcfc('0x2a')](function(){return BPromise['each'](_[_0xbcfc('0x2e')](_0x274ac8,{'online':!![]}),function(_0x5cf2d1){return db[_0xbcfc('0x7e')][_0xbcfc('0x7b')]({'membername':_0x5cf2d1['name'],'UserId':_0x5cf2d1['id'],'queue_name':_0x371813[_0xbcfc('0x37')],'VoiceQueueId':_0x371813['id'],'interface':_['isNil'](_0x5cf2d1[_0xbcfc('0x7f')])?util['format'](_0xbcfc('0x80'),_0x5cf2d1[_0xbcfc('0x37')]):_0x5cf2d1[_0xbcfc('0x7f')],'paused':_0x5cf2d1[_0xbcfc('0x73')]||![],'penalty':_0x5cf2d1['penalty']},{'transaction':_0x1b2e23});});})[_0xbcfc('0x2a')](function(){_0x274ac8[_0xbcfc('0x76')](function(_0x28ef21){socket[_0xbcfc('0x81')](_0xbcfc('0x82'),{'UserId':_0x28ef21['id'],'VoiceQueueId':_0x371813['id']});});});});});}})[_0xbcfc('0x2a')](respondWithStatusCode(_0x2a862b,null))[_0xbcfc('0x51')](handleError(_0x2a862b,null));};exports[_0xbcfc('0x83')]=function(_0x41fa91,_0x172752,_0x35a8f4){return db[_0xbcfc('0x6e')][_0xbcfc('0x4f')]({'where':{'id':_0x41fa91[_0xbcfc('0x3f')]['ids']},'attributes':['id'],'include':[{'model':db[_0xbcfc('0x71')],'as':_0xbcfc('0x75'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x172752,null))[_0xbcfc('0x2a')](function(_0x326df8){var _0xe3eaaa=_[_0xbcfc('0x30')](_0x326df8,'id');var _0x147e27=[];var _0x2c5b27=[];var _0x4d9489=squel['select']();_0x4d9489['field'](_0xbcfc('0x84'))[_0xbcfc('0x85')](_0xbcfc('0x86'),'tq')[_0xbcfc('0x87')](_0xbcfc('0x88'),'ut',_0xbcfc('0x89'))[_0xbcfc('0x49')](_0xbcfc('0x8a'),_0x41fa91['params']['id']);for(var _0x1d9570=0x0;_0x1d9570<_0x326df8[_0xbcfc('0x54')];_0x1d9570+=0x1){let _0x46d03e=_0x326df8[_0x1d9570];for(var _0x5531c5=0x0;_0x5531c5<_0x46d03e[_0xbcfc('0x75')][_0xbcfc('0x54')];_0x5531c5+=0x1){let _0x421476=_0x46d03e['Agents'][_0x5531c5];var _0x4ac6d5=_0x4d9489[_0xbcfc('0x8b')]();_0x4ac6d5[_0xbcfc('0x49')](_0xbcfc('0x8c'),_0x421476['id']);_0x2c5b27[_0xbcfc('0x8d')](db['sequelize'][_0xbcfc('0x3f')](_0x4ac6d5['toString'](),{'type':db['sequelize'][_0xbcfc('0x8e')][_0xbcfc('0x8f')]})[_0xbcfc('0x2a')](function(_0x5e648b){if(_0x5e648b[_0xbcfc('0x54')]===0x1){return _0x421476['id'];}else{var _0x24d0b9=_[_0xbcfc('0x90')](_[_0xbcfc('0x30')](_0x5e648b,_0xbcfc('0x91')),function(_0x9a8d33){return _[_0xbcfc('0x32')](_0xe3eaaa,_0x9a8d33);});if(_0x24d0b9){return _0x421476['id'];}}}));}}return BPromise[_0xbcfc('0x92')](_0x2c5b27)[_0xbcfc('0x2a')](function(_0x1de22d){_0x147e27=_(_0x147e27)[_0xbcfc('0x93')](_0x1de22d)[_0xbcfc('0x94')]()[_0xbcfc('0x31')]();return db[_0xbcfc('0x39')][_0xbcfc('0x34')]({'where':{'id':_0x41fa91['params']['id']}})[_0xbcfc('0x2a')](function(_0x457584){return db['sequelize']['transaction'](function(_0x2598bd){return _0x457584[_0xbcfc('0x83')](_0x41fa91[_0xbcfc('0x3f')][_0xbcfc('0x95')],{'transaction':_0x2598bd})[_0xbcfc('0x2a')](function(){if(!_[_0xbcfc('0x96')](_0x147e27)){return _0x457584['removeAgents'](_0x147e27,{'transaction':_0x2598bd})[_0xbcfc('0x2a')](function(){return db[_0xbcfc('0x7e')][_0xbcfc('0x29')]({'where':{'VoiceQueueId':_0x41fa91[_0xbcfc('0x53')]['id'],'UserId':_0x147e27},'transaction':_0x2598bd});});}})[_0xbcfc('0x2a')](function(){_0x147e27[_0xbcfc('0x76')](function(_0x568ad9){socket[_0xbcfc('0x81')](_0xbcfc('0x97'),{'UserId':_0x568ad9,'VoiceQueueId':_0x457584['id']});});});});});});})[_0xbcfc('0x2a')](respondWithStatusCode(_0x172752,null))[_0xbcfc('0x51')](handleError(_0x172752,null));};exports[_0xbcfc('0x98')]=function(_0x2fa026,_0xa5bcd6,_0x22b016){var _0xf37db8,_0x3e3aa1;return db[_0xbcfc('0x39')][_0xbcfc('0x34')]({'where':{'id':_0x2fa026['params']['id']}})[_0xbcfc('0x2a')](handleEntityNotFound(_0xa5bcd6,null))['then'](function(_0x4d3ba0){if(_0x4d3ba0){_0x3e3aa1=_0x4d3ba0;return _0x4d3ba0[_0xbcfc('0x98')](_0x2fa026[_0xbcfc('0x61')][_0xbcfc('0x95')],_[_0xbcfc('0x5e')](_0x2fa026[_0xbcfc('0x61')],[_0xbcfc('0x95'),'id'])||{})['spread'](function(_0x3320f6){for(var _0x30ce0b=0x0;_0x30ce0b<_0x2fa026['body'][_0xbcfc('0x95')][_0xbcfc('0x54')];_0x30ce0b+=0x1){socket['emit']('userVoiceQueue:save',{'UserId':Number(_0x2fa026[_0xbcfc('0x61')][_0xbcfc('0x95')][_0x30ce0b]),'VoiceQueueId':Number(_0x2fa026['params']['id'])});}return _0x3320f6;});}})[_0xbcfc('0x2a')](function(_0x5c8b6a){_0xf37db8=_0x5c8b6a||[];if(_0x3e3aa1){return db[_0xbcfc('0x71')][_0xbcfc('0x4f')]({'where':{'id':_0x2fa026[_0xbcfc('0x61')]['ids']},'attributes':['id',_0xbcfc('0x37'),_0xbcfc('0x72'),'voicePause',_0xbcfc('0x7f')],'raw':!![]});}})[_0xbcfc('0x2a')](function(_0x5b83d2){if(!_[_0xbcfc('0x96')](_0x5b83d2)){var _0x19ca4a=[];for(var _0x30a681=0x0;_0x30a681<_0x5b83d2['length'];_0x30a681++){if(_0x5b83d2[_0x30a681][_0xbcfc('0x72')]){_0x19ca4a[_0xbcfc('0x8d')](db[_0xbcfc('0x7e')][_0xbcfc('0x7b')]({'membername':_0x5b83d2[_0x30a681][_0xbcfc('0x37')],'UserId':_0x5b83d2[_0x30a681]['id'],'queue_name':_0x3e3aa1[_0xbcfc('0x37')],'VoiceQueueId':_0x3e3aa1['id'],'interface':_[_0xbcfc('0x99')](_0x5b83d2[_0x30a681]['interface'])?util[_0xbcfc('0x9a')](_0xbcfc('0x80'),_0x5b83d2[_0x30a681][_0xbcfc('0x37')]):_0x5b83d2[_0x30a681][_0xbcfc('0x7f')],'paused':_0x5b83d2[_0x30a681][_0xbcfc('0x73')]||![],'penalty':_0x2fa026[_0xbcfc('0x61')]['penalty']||0x0}));}}return BPromise[_0xbcfc('0x92')](_0x19ca4a);}})[_0xbcfc('0x2a')](function(){return _0xf37db8;})[_0xbcfc('0x2a')](respondWithResult(_0xa5bcd6,null))[_0xbcfc('0x51')](handleError(_0xa5bcd6,null));};exports[_0xbcfc('0x9b')]=function(_0xb9d394,_0x865f5,_0x3a9db2){return db[_0xbcfc('0x39')][_0xbcfc('0x34')]({'where':{'id':_0xb9d394[_0xbcfc('0x53')]['id']}})[_0xbcfc('0x2a')](handleEntityNotFound(_0x865f5,null))['then'](function(_0x1584c6){if(_0x1584c6){return _0x1584c6[_0xbcfc('0x9b')](_0xb9d394['query'][_0xbcfc('0x95')])[_0xbcfc('0x2a')](function(){if(_[_0xbcfc('0x9c')](_0xb9d394['query']['ids'])){for(var _0xdfc6af=0x0;_0xdfc6af<_0xb9d394[_0xbcfc('0x3f')][_0xbcfc('0x95')][_0xbcfc('0x54')];_0xdfc6af+=0x1){socket[_0xbcfc('0x81')](_0xbcfc('0x97'),{'UserId':Number(_0xb9d394['query'][_0xbcfc('0x95')][_0xdfc6af]),'VoiceQueueId':Number(_0xb9d394[_0xbcfc('0x53')]['id'])});}}else{socket[_0xbcfc('0x81')](_0xbcfc('0x97'),{'UserId':Number(_0xb9d394['query'][_0xbcfc('0x95')]),'VoiceQueueId':Number(_0xb9d394[_0xbcfc('0x53')]['id'])});}});}})[_0xbcfc('0x2a')](function(_0x26697f){return db[_0xbcfc('0x7e')]['destroy']({'where':{'VoiceQueueId':_0xb9d394['params']['id'],'UserId':_0xb9d394['query'][_0xbcfc('0x95')]}})[_0xbcfc('0x2a')](function(){return _0x26697f;});})[_0xbcfc('0x2a')](respondWithStatusCode(_0x865f5,null))[_0xbcfc('0x51')](handleError(_0x865f5,null));};exports[_0xbcfc('0x9d')]=function(_0x4bdda6,_0x49e415,_0xe6f2d4){var _0x4c6a8d={};var _0x4019af={};var _0xf08e82;var _0x56f1e7;return db[_0xbcfc('0x39')][_0xbcfc('0x65')]({'where':{'id':_0x4bdda6['params']['id']}})[_0xbcfc('0x2a')](handleEntityNotFound(_0x49e415,null))[_0xbcfc('0x2a')](function(_0x44bcb8){if(_0x44bcb8){_0xf08e82=_0x44bcb8;_0x4019af['model']=_[_0xbcfc('0x3e')](db[_0xbcfc('0x71')][_0xbcfc('0x3a')]);_0x4019af[_0xbcfc('0x3f')]=_[_0xbcfc('0x3e')](_0x4bdda6[_0xbcfc('0x3f')]);_0x4019af[_0xbcfc('0x40')]=_[_0xbcfc('0x42')](_0x4019af[_0xbcfc('0x3d')],_0x4019af[_0xbcfc('0x3f')]);_0x4c6a8d[_0xbcfc('0x41')]=_[_0xbcfc('0x42')](_0x4019af[_0xbcfc('0x3d')],qs['fields'](_0x4bdda6['query'][_0xbcfc('0x43')]));_0x4c6a8d[_0xbcfc('0x41')]=_0x4c6a8d[_0xbcfc('0x41')][_0xbcfc('0x54')]?_0x4c6a8d[_0xbcfc('0x41')]:_0x4019af[_0xbcfc('0x3d')];_0x4c6a8d[_0xbcfc('0x46')]=qs['sort'](_0x4bdda6[_0xbcfc('0x3f')][_0xbcfc('0x47')]);_0x4c6a8d['where']=qs[_0xbcfc('0x40')](_['pick'](_0x4bdda6[_0xbcfc('0x3f')],_0x4019af[_0xbcfc('0x40')]));if(_0x4bdda6[_0xbcfc('0x3f')][_0xbcfc('0x2e')]){_0x4c6a8d[_0xbcfc('0x49')]=_[_0xbcfc('0x4a')](_0x4c6a8d[_0xbcfc('0x49')],{'$or':_[_0xbcfc('0x30')](_0x4c6a8d[_0xbcfc('0x41')],function(_0x43bd52){var _0x19b6ba={};_0x19b6ba[_0x43bd52]={'$like':'%'+_0x4bdda6[_0xbcfc('0x3f')][_0xbcfc('0x2e')]+'%'};return _0x19b6ba;})});}_0x4c6a8d=_[_0xbcfc('0x4a')]({},_0x4c6a8d,_0x4bdda6[_0xbcfc('0x4c')]);return _0xf08e82['getAgents'](_0x4c6a8d);}})['then'](function(_0x313ca9){if(_0x313ca9){_0x56f1e7=_0x313ca9['length'];if(!_0x4bdda6[_0xbcfc('0x3f')][_0xbcfc('0x44')](_0xbcfc('0x45'))){_0x4c6a8d[_0xbcfc('0x22')]=qs[_0xbcfc('0x22')](_0x4bdda6[_0xbcfc('0x3f')]['limit']);_0x4c6a8d[_0xbcfc('0x20')]=qs['offset'](_0x4bdda6[_0xbcfc('0x3f')][_0xbcfc('0x20')]);}return _0xf08e82[_0xbcfc('0x9d')](_0x4c6a8d);}})[_0xbcfc('0x2a')](function(_0x12f997){if(_0x12f997){return _0x12f997?{'count':_0x56f1e7,'rows':_0x12f997}:null;}})[_0xbcfc('0x2a')](respondWithResult(_0x49e415,null))[_0xbcfc('0x51')](handleError(_0x49e415,null));};exports[_0xbcfc('0x9e')]=function(_0xa0fd25,_0x10e041,_0x5c82fa){var _0x5a0323={};var _0x2b0e9b={};var _0x108f40;var _0x1e31f2;return db[_0xbcfc('0x39')][_0xbcfc('0x65')]({'where':{'id':_0xa0fd25[_0xbcfc('0x53')]['id']}})['then'](handleEntityNotFound(_0x10e041,null))[_0xbcfc('0x2a')](function(_0x4c4202){if(_0x4c4202){_0x108f40=_0x4c4202;_0x2b0e9b[_0xbcfc('0x3d')]=_[_0xbcfc('0x3e')](db[_0xbcfc('0x7e')][_0xbcfc('0x3a')]);_0x2b0e9b[_0xbcfc('0x3f')]=_[_0xbcfc('0x3e')](_0xa0fd25['query']);_0x2b0e9b[_0xbcfc('0x40')]=_[_0xbcfc('0x42')](_0x2b0e9b[_0xbcfc('0x3d')],_0x2b0e9b[_0xbcfc('0x3f')]);_0x5a0323[_0xbcfc('0x41')]=_[_0xbcfc('0x42')](_0x2b0e9b[_0xbcfc('0x3d')],qs[_0xbcfc('0x43')](_0xa0fd25[_0xbcfc('0x3f')]['fields']));_0x5a0323[_0xbcfc('0x41')]=_0x5a0323[_0xbcfc('0x41')]['length']?_0x5a0323['attributes']:_0x2b0e9b[_0xbcfc('0x3d')];_0x5a0323[_0xbcfc('0x46')]=qs[_0xbcfc('0x47')](_0xa0fd25[_0xbcfc('0x3f')][_0xbcfc('0x47')]);_0x5a0323[_0xbcfc('0x49')]=qs['filters'](_['pick'](_0xa0fd25[_0xbcfc('0x3f')],_0x2b0e9b['filters']));if(_0xa0fd25[_0xbcfc('0x3f')][_0xbcfc('0x2e')]){_0x5a0323[_0xbcfc('0x49')]=_[_0xbcfc('0x4a')](_0x5a0323[_0xbcfc('0x49')],{'$or':_['map'](_0x5a0323[_0xbcfc('0x41')],function(_0x4793b8){var _0x15121c={};_0x15121c[_0x4793b8]={'$like':'%'+_0xa0fd25[_0xbcfc('0x3f')][_0xbcfc('0x2e')]+'%'};return _0x15121c;})});}_0x5a0323=_[_0xbcfc('0x4a')]({},_0x5a0323,_0xa0fd25[_0xbcfc('0x4c')]);return _0x108f40[_0xbcfc('0x9e')](_0x5a0323);}})['then'](function(_0x376384){if(_0x376384){_0x1e31f2=_0x376384[_0xbcfc('0x54')];if(!_0xa0fd25[_0xbcfc('0x3f')][_0xbcfc('0x44')](_0xbcfc('0x45'))){_0x5a0323[_0xbcfc('0x22')]=qs['limit'](_0xa0fd25[_0xbcfc('0x3f')][_0xbcfc('0x22')]);_0x5a0323['offset']=qs[_0xbcfc('0x20')](_0xa0fd25[_0xbcfc('0x3f')][_0xbcfc('0x20')]);}return _0x108f40[_0xbcfc('0x9e')](_0x5a0323);}})[_0xbcfc('0x2a')](function(_0x26954e){return _0x26954e?{'count':_0x1e31f2,'rows':_0x26954e}:null;})[_0xbcfc('0x2a')](respondWithResult(_0x10e041,null))['catch'](handleError(_0x10e041,null));};exports[_0xbcfc('0x9f')]=function(_0x5cc63,_0x57e0c5,_0x7f39ab){var _0x3cb916={};var _0xd62691={};var _0x15535a;var _0x1f8df4;return db[_0xbcfc('0x39')]['findOne']({'where':{'id':_0x5cc63[_0xbcfc('0x53')]['id']}})[_0xbcfc('0x2a')](handleEntityNotFound(_0x57e0c5,null))[_0xbcfc('0x2a')](function(_0x46f78a){if(_0x46f78a){_0x15535a=_0x46f78a;_0xd62691[_0xbcfc('0x3d')]=_[_0xbcfc('0x3e')](db[_0xbcfc('0xa0')]['rawAttributes']);_0xd62691[_0xbcfc('0x3f')]=_[_0xbcfc('0x3e')](_0x5cc63[_0xbcfc('0x3f')]);_0xd62691[_0xbcfc('0x40')]=_['intersection'](_0xd62691['model'],_0xd62691[_0xbcfc('0x3f')]);_0x3cb916[_0xbcfc('0x41')]=_[_0xbcfc('0x42')](_0xd62691[_0xbcfc('0x3d')],qs['fields'](_0x5cc63[_0xbcfc('0x3f')][_0xbcfc('0x43')]));_0x3cb916[_0xbcfc('0x41')]=_0x3cb916[_0xbcfc('0x41')]['length']?_0x3cb916[_0xbcfc('0x41')]:_0xd62691[_0xbcfc('0x3d')];_0x3cb916[_0xbcfc('0x46')]=qs[_0xbcfc('0x47')](_0x5cc63[_0xbcfc('0x3f')]['sort']);_0x3cb916[_0xbcfc('0x49')]=qs[_0xbcfc('0x40')](_[_0xbcfc('0x48')](_0x5cc63[_0xbcfc('0x3f')],_0xd62691[_0xbcfc('0x40')]));if(_0x5cc63['query'][_0xbcfc('0x2e')]){_0x3cb916[_0xbcfc('0x49')]=_[_0xbcfc('0x4a')](_0x3cb916[_0xbcfc('0x49')],{'$or':_[_0xbcfc('0x30')](_0x3cb916[_0xbcfc('0x41')],function(_0x52a293){var _0x3034e3={};_0x3034e3[_0x52a293]={'$like':'%'+_0x5cc63[_0xbcfc('0x3f')][_0xbcfc('0x2e')]+'%'};return _0x3034e3;})});}_0x3cb916=_[_0xbcfc('0x4a')]({},_0x3cb916,_0x5cc63[_0xbcfc('0x4c')]);return _0x15535a[_0xbcfc('0x9f')](_0x3cb916);}})['then'](function(_0x443120){if(_0x443120){_0x1f8df4=_0x443120[_0xbcfc('0x54')];if(!_0x5cc63[_0xbcfc('0x3f')]['hasOwnProperty']('nolimit')){_0x3cb916[_0xbcfc('0x22')]=qs[_0xbcfc('0x22')](_0x5cc63[_0xbcfc('0x3f')][_0xbcfc('0x22')]);_0x3cb916[_0xbcfc('0x20')]=qs[_0xbcfc('0x20')](_0x5cc63[_0xbcfc('0x3f')][_0xbcfc('0x20')]);}return _0x15535a[_0xbcfc('0x9f')](_0x3cb916);}})['then'](function(_0x3ad2f8){if(_0x3ad2f8){return _0x3ad2f8?{'count':_0x1f8df4,'rows':_0x3ad2f8}:null;}})['then'](respondWithResult(_0x57e0c5,null))['catch'](handleError(_0x57e0c5,null));};exports[_0xbcfc('0xa1')]=function(_0x3ab5ea,_0x3c2098,_0x1b51c2){var _0x4ae5cf=moment()['format'](_0xbcfc('0xa2'));var _0x524809,_0x3ccd4b;return db[_0xbcfc('0x39')][_0xbcfc('0x34')]({'where':{'id':_0x3ab5ea[_0xbcfc('0x53')]['id']}})[_0xbcfc('0x2a')](handleEntityNotFound(_0x3c2098,null))[_0xbcfc('0x2a')](function(_0x406c9e){if(_0x406c9e){_0x3ccd4b=_0x406c9e;return _0x406c9e['addLists'](_0x3ab5ea[_0xbcfc('0x61')][_0xbcfc('0x95')],_[_0xbcfc('0x5e')](_0x3ab5ea[_0xbcfc('0x61')],[_0xbcfc('0x95'),'id'])||{});}return null;})[_0xbcfc('0xa3')](function(_0x91c821){var _0xbd73cd;_0x524809=_0x91c821||[];var _0x486600=[];if(_0x91c821){for(var _0x2370e9=0x0;_0x2370e9<_0x91c821[_0xbcfc('0x54')];_0x2370e9+=0x1){var _0x177817=_0x91c821[_0x2370e9]['get']({'plain':!![]});_0x3ccd4b[_0xbcfc('0xa4')]=_0x3ab5ea['body'][_0xbcfc('0xa4')]?_0x3ab5ea[_0xbcfc('0x61')][_0xbcfc('0xa4')]:_0x3ccd4b[_0xbcfc('0xa4')];switch(_0x3ccd4b['dialCheckDuplicateType']){case'always':_0xbd73cd=squel[_0xbcfc('0xa5')]()[_0xbcfc('0xa6')]('cm_hopper')['fromQuery']([_0xbcfc('0xa7'),'scheduledAt',_0xbcfc('0xa8'),_0xbcfc('0xa9'),_0xbcfc('0x67'),'createdAt',_0xbcfc('0x60')],squel['select']()[_0xbcfc('0xaa')](_0xbcfc('0xa7'),'phone')[_0xbcfc('0xaa')]('\x27'+_0x4ae5cf+'\x27','scheduledAt')[_0xbcfc('0xaa')]('id','ContactId')[_0xbcfc('0xaa')](_0x177817[_0xbcfc('0xab')][_0xbcfc('0xac')](),_0xbcfc('0xa9'))[_0xbcfc('0xaa')](_0x3ab5ea['params']['id'][_0xbcfc('0xac')](),_0xbcfc('0x67'))[_0xbcfc('0xaa')]('\x27'+_0x4ae5cf+'\x27',_0xbcfc('0x5f'))[_0xbcfc('0xaa')]('\x27'+_0x4ae5cf+'\x27','updatedAt')[_0xbcfc('0x85')](_0xbcfc('0xad'))[_0xbcfc('0x49')](_0xbcfc('0xae'))['where'](_0xbcfc('0xaf'),_0x177817[_0xbcfc('0xab')]['toString']())[_0xbcfc('0x49')](_0xbcfc('0xb0'))['where'](_0xbcfc('0xb1'),squel[_0xbcfc('0xb2')]()[_0xbcfc('0xaa')]('COALESCE(calleridnum,\x27\x27)')[_0xbcfc('0x85')]('cm_hopper_final')[_0xbcfc('0x49')](_0xbcfc('0x8a'),_0x3ab5ea[_0xbcfc('0x53')]['id']['toString']()))[_0xbcfc('0x49')]('phone\x20NOT\x20IN\x20(?)',squel[_0xbcfc('0xb2')]()['field'](_0xbcfc('0xb3'))[_0xbcfc('0x85')](_0xbcfc('0xb4'))['where'](_0xbcfc('0x8a'),_0x3ab5ea[_0xbcfc('0x53')]['id'][_0xbcfc('0xac')]())))[_0xbcfc('0xac')]();break;case _0xbcfc('0xb5'):_0xbd73cd=squel[_0xbcfc('0xa5')]()[_0xbcfc('0xa6')]('cm_hopper')['fromQuery']([_0xbcfc('0xa7'),_0xbcfc('0xb6'),'ContactId',_0xbcfc('0xa9'),_0xbcfc('0x67'),_0xbcfc('0x5f'),'updatedAt'],squel[_0xbcfc('0xb2')]()['field'](_0xbcfc('0xa7'),'phone')['field']('\x27'+_0x4ae5cf+'\x27',_0xbcfc('0xb6'))[_0xbcfc('0xaa')]('id',_0xbcfc('0xa8'))[_0xbcfc('0xaa')](_0x177817[_0xbcfc('0xab')]['toString'](),_0xbcfc('0xa9'))[_0xbcfc('0xaa')](_0x3ab5ea[_0xbcfc('0x53')]['id'][_0xbcfc('0xac')](),_0xbcfc('0x67'))[_0xbcfc('0xaa')]('\x27'+_0x4ae5cf+'\x27',_0xbcfc('0x5f'))['field']('\x27'+_0x4ae5cf+'\x27',_0xbcfc('0x60'))['from'](_0xbcfc('0xad'))[_0xbcfc('0x49')](_0xbcfc('0xae'))['where']('ListId\x20=\x20?',_0x177817['CmListId'][_0xbcfc('0xac')]())['where'](_0xbcfc('0xb0'))[_0xbcfc('0x49')](_0xbcfc('0xb1'),squel[_0xbcfc('0xb2')]()[_0xbcfc('0xaa')](_0xbcfc('0xb3'))[_0xbcfc('0x85')](_0xbcfc('0xb4'))[_0xbcfc('0x49')]('VoiceQueueId\x20=\x20?',_0x3ab5ea['params']['id'][_0xbcfc('0xac')]())))['toString']();break;default:_0xbd73cd=squel[_0xbcfc('0xa5')]()['into'](_0xbcfc('0xb4'))['fromQuery']([_0xbcfc('0xa7'),_0xbcfc('0xb6'),_0xbcfc('0xa8'),_0xbcfc('0xa9'),_0xbcfc('0x67'),_0xbcfc('0x5f'),'updatedAt'],squel[_0xbcfc('0xb2')]()[_0xbcfc('0xaa')](_0xbcfc('0xa7'),_0xbcfc('0xa7'))[_0xbcfc('0xaa')]('\x27'+_0x4ae5cf+'\x27',_0xbcfc('0xb6'))['field']('id','ContactId')[_0xbcfc('0xaa')](_0x177817['CmListId'][_0xbcfc('0xac')](),_0xbcfc('0xa9'))['field'](_0x3ab5ea['params']['id'][_0xbcfc('0xac')](),_0xbcfc('0x67'))['field']('\x27'+_0x4ae5cf+'\x27',_0xbcfc('0x5f'))[_0xbcfc('0xaa')]('\x27'+_0x4ae5cf+'\x27',_0xbcfc('0x60'))[_0xbcfc('0x85')](_0xbcfc('0xad'))[_0xbcfc('0x49')]('deletedAt\x20IS\x20NULL')[_0xbcfc('0x49')]('ListId\x20=\x20?',_0x177817['CmListId']['toString']())[_0xbcfc('0x49')](_0xbcfc('0xb0')))[_0xbcfc('0xac')]();}_0x486600[_0xbcfc('0x8d')](db['sequelize'][_0xbcfc('0x3f')](_0xbd73cd));}return BPromise[_0xbcfc('0x92')](_0x486600);}})[_0xbcfc('0x2a')](function(){var _0x2f0151=[];var _0x4fc18b=squel['insert']()['into'](_0xbcfc('0xb7'))[_0xbcfc('0xb8')](['CmHopperId',_0xbcfc('0xa7'),'OrderBy',_0xbcfc('0x5f'),_0xbcfc('0x60')],squel[_0xbcfc('0xb2')]()['field']('h.id')[_0xbcfc('0xaa')](_0xbcfc('0xb9'))[_0xbcfc('0xaa')](_0xbcfc('0xba'))['field']('\x27'+_0x4ae5cf+'\x27',_0xbcfc('0x5f'))['field']('\x27'+_0x4ae5cf+'\x27',_0xbcfc('0x60'))[_0xbcfc('0x85')](_0xbcfc('0xbb'),'ci')[_0xbcfc('0x87')](_0xbcfc('0xb4'),'h',_0xbcfc('0xbc'))['where'](_0xbcfc('0xbd'),_0x4ae5cf)[_0xbcfc('0x49')](_0xbcfc('0xbe'),_0xbcfc('0xbf')))[_0xbcfc('0xac')]();_0x2f0151[_0xbcfc('0x8d')](db[_0xbcfc('0x78')][_0xbcfc('0x3f')](_0x4fc18b));return BPromise[_0xbcfc('0x92')](_0x2f0151);})[_0xbcfc('0x2a')](function(){return _0x524809;})[_0xbcfc('0x2a')](respondWithResult(_0x3c2098,null))['catch'](handleError(_0x3c2098,null));};exports[_0xbcfc('0xc0')]=function(_0x52cc95,_0x395bb3,_0x5ab356){return db['VoiceQueue']['find']({'where':{'id':_0x52cc95[_0xbcfc('0x53')]['id']}})[_0xbcfc('0x2a')](handleEntityNotFound(_0x395bb3,null))[_0xbcfc('0x2a')](function(_0x4c3223){if(_0x4c3223){return _0x4c3223[_0xbcfc('0xc0')](_0x52cc95[_0xbcfc('0x3f')]['ids']);}})[_0xbcfc('0x2a')](function(_0x5be00c){if(_0x5be00c){return db['CmHopper'][_0xbcfc('0x29')]({'where':{'ListId':_0x52cc95['query'][_0xbcfc('0x95')],'VoiceQueueId':_0x52cc95[_0xbcfc('0x53')]['id']}})[_0xbcfc('0x2a')](function(){return _0x5be00c;});}})['then'](respondWithStatusCode(_0x395bb3,null))['catch'](handleError(_0x395bb3,null));};exports[_0xbcfc('0xc1')]=function(_0x33a1c3,_0x217c24,_0x23941d){var _0x8bba8e={};var _0x482b72={};var _0x5c2248;var _0x37ddb6;return db[_0xbcfc('0x39')][_0xbcfc('0x65')]({'where':{'id':_0x33a1c3[_0xbcfc('0x53')]['id']}})[_0xbcfc('0x2a')](handleEntityNotFound(_0x217c24,null))[_0xbcfc('0x2a')](function(_0x577ae7){if(_0x577ae7){_0x5c2248=_0x577ae7;_0x482b72[_0xbcfc('0x3d')]=_[_0xbcfc('0x3e')](db[_0xbcfc('0xa0')][_0xbcfc('0x3a')]);_0x482b72[_0xbcfc('0x3f')]=_[_0xbcfc('0x3e')](_0x33a1c3['query']);_0x482b72[_0xbcfc('0x40')]=_['intersection'](_0x482b72[_0xbcfc('0x3d')],_0x482b72[_0xbcfc('0x3f')]);_0x8bba8e[_0xbcfc('0x41')]=_[_0xbcfc('0x42')](_0x482b72['model'],qs[_0xbcfc('0x43')](_0x33a1c3[_0xbcfc('0x3f')][_0xbcfc('0x43')]));_0x8bba8e[_0xbcfc('0x41')]=_0x8bba8e[_0xbcfc('0x41')]['length']?_0x8bba8e[_0xbcfc('0x41')]:_0x482b72[_0xbcfc('0x3d')];_0x8bba8e[_0xbcfc('0x46')]=qs[_0xbcfc('0x47')](_0x33a1c3[_0xbcfc('0x3f')][_0xbcfc('0x47')]);_0x8bba8e[_0xbcfc('0x49')]=qs[_0xbcfc('0x40')](_[_0xbcfc('0x48')](_0x33a1c3['query'],_0x482b72[_0xbcfc('0x40')]));if(_0x33a1c3['query'][_0xbcfc('0x2e')]){_0x8bba8e['where']=_[_0xbcfc('0x4a')](_0x8bba8e[_0xbcfc('0x49')],{'$or':_['map'](_0x8bba8e[_0xbcfc('0x41')],function(_0x30039c){var _0x1b82d5={};_0x1b82d5[_0x30039c]={'$like':'%'+_0x33a1c3[_0xbcfc('0x3f')][_0xbcfc('0x2e')]+'%'};return _0x1b82d5;})});}_0x8bba8e=_[_0xbcfc('0x4a')]({},_0x8bba8e,_0x33a1c3[_0xbcfc('0x4c')]);return _0x5c2248[_0xbcfc('0xc1')](_0x8bba8e);}})[_0xbcfc('0x2a')](function(_0x4179ed){if(_0x4179ed){_0x37ddb6=_0x4179ed[_0xbcfc('0x54')];if(!_0x33a1c3['query'][_0xbcfc('0x44')](_0xbcfc('0x45'))){_0x8bba8e[_0xbcfc('0x22')]=qs[_0xbcfc('0x22')](_0x33a1c3[_0xbcfc('0x3f')][_0xbcfc('0x22')]);_0x8bba8e['offset']=qs['offset'](_0x33a1c3[_0xbcfc('0x3f')]['offset']);}return _0x5c2248[_0xbcfc('0xc1')](_0x8bba8e);}})[_0xbcfc('0x2a')](function(_0x9a41d1){if(_0x9a41d1){return _0x9a41d1?{'count':_0x37ddb6,'rows':_0x9a41d1}:null;}})['then'](respondWithResult(_0x217c24,null))[_0xbcfc('0x51')](handleError(_0x217c24,null));};exports['addBlackLists']=function(_0x416526,_0x4ed64b,_0x5bf5d9){var _0x16570c,_0x90c5ce;return db[_0xbcfc('0x39')][_0xbcfc('0x34')]({'where':{'id':_0x416526[_0xbcfc('0x53')]['id']}})[_0xbcfc('0x2a')](handleEntityNotFound(_0x4ed64b,null))['then'](function(_0x4e4908){if(_0x4e4908){_0x90c5ce=_0x4e4908;return _0x4e4908[_0xbcfc('0xc2')](_0x416526[_0xbcfc('0x61')]['ids'],_['omit'](_0x416526[_0xbcfc('0x61')],[_0xbcfc('0x95'),'id'])||{});}return null;})['spread'](function(_0x10dd5d){var _0x173929;_0x16570c=_0x10dd5d||[];var _0x3385b4=[];if(_0x10dd5d){for(var _0x43e820=0x0;_0x43e820<_0x10dd5d['length'];_0x43e820+=0x1){var _0x1e82ea=_0x10dd5d[_0x43e820][_0xbcfc('0x2b')]({'plain':!![]});_0x173929=squel['insert']()['into'](_0xbcfc('0xc3'))['fromQuery']([_0xbcfc('0xa7'),_0xbcfc('0xa8'),'ListId',_0xbcfc('0x67'),_0xbcfc('0x5f'),'updatedAt'],squel[_0xbcfc('0xb2')]()[_0xbcfc('0xaa')]('phone',_0xbcfc('0xa7'))['field']('id',_0xbcfc('0xa8'))[_0xbcfc('0xaa')](_0x1e82ea['CmListId']['toString'](),_0xbcfc('0xa9'))['field'](_0x416526[_0xbcfc('0x53')]['id'][_0xbcfc('0xac')](),_0xbcfc('0x67'))[_0xbcfc('0xaa')]('NOW()',_0xbcfc('0x5f'))[_0xbcfc('0xaa')](_0xbcfc('0xc4'),_0xbcfc('0x60'))[_0xbcfc('0x85')](_0xbcfc('0xad'))[_0xbcfc('0x49')]('deletedAt\x20IS\x20NULL')[_0xbcfc('0x49')](_0xbcfc('0xaf'),_0x1e82ea[_0xbcfc('0xab')][_0xbcfc('0xac')]())[_0xbcfc('0x49')]('phone\x20IS\x20NOT\x20NULL'))[_0xbcfc('0xac')]();_0x3385b4[_0xbcfc('0x8d')](db['sequelize'][_0xbcfc('0x3f')](_0x173929));}return BPromise[_0xbcfc('0x92')](_0x3385b4);}})[_0xbcfc('0x2a')](function(){return _0x16570c;})[_0xbcfc('0x2a')](respondWithResult(_0x4ed64b,null))[_0xbcfc('0x51')](handleError(_0x4ed64b,null));};exports[_0xbcfc('0xc5')]=function(_0x252c07,_0x5bdec2,_0x46aa1d){return db[_0xbcfc('0x39')][_0xbcfc('0x34')]({'where':{'id':_0x252c07['params']['id']}})[_0xbcfc('0x2a')](handleEntityNotFound(_0x5bdec2,null))['then'](function(_0x379538){if(_0x379538){return _0x379538[_0xbcfc('0xc5')](_0x252c07['query'][_0xbcfc('0x95')]);}})[_0xbcfc('0x2a')](function(_0x52ce0c){if(_0x52ce0c){return db[_0xbcfc('0x6c')]['destroy']({'where':{'ListId':_0x252c07['query']['ids'],'VoiceQueueId':_0x252c07['params']['id']}})[_0xbcfc('0x2a')](function(){return _0x52ce0c;});}})[_0xbcfc('0x2a')](respondWithStatusCode(_0x5bdec2,null))[_0xbcfc('0x51')](handleError(_0x5bdec2,null));}; \ No newline at end of file +var _0x44ff=['interface','format','SIP/%s','userVoiceQueue:save','removeTeams','ids','select','tq.TeamId','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','union','compact','isEmpty','removeAgents','emit','addAgents','spread','online','all','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','CmListId','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','onlyIfOpen','into','cm_contacts','cm_hopper_additional_phones','h.id','ci.OrderBy+1','cm_contact_has_items','join','h.scheduledat=?','ci.ItemClass=?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','rimraf','zip-dir','fast-json-patch','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','offset','limit','Content-Range','apply','reject','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','ignore','map','includes','type','find','name','error','send','index','VoiceQueue','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','count','includeAll','include','rows','catch','create','body','user','outbound','value','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','clone','params','updatedAt','omit','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','pick','VoiceQueueId','findAll','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','Team','User','Agents','voicePause','flatMap','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil'];(function(_0x4774e6,_0x1a2a6f){var _0xef1fa3=function(_0x4a0ec2){while(--_0x4a0ec2){_0x4774e6['push'](_0x4774e6['shift']());}};_0xef1fa3(++_0x1a2a6f);}(_0x44ff,0x1c3));var _0xf44f=function(_0x563308,_0x113e59){_0x563308=_0x563308-0x0;var _0x4fba04=_0x44ff[_0x563308];return _0x4fba04;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf44f('0x0'));var zipdir=require(_0xf44f('0x1'));var jsonpatch=require(_0xf44f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf44f('0x3'));var path=require(_0xf44f('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf44f('0x5'));var fs=require('fs');var fs_extra=require(_0xf44f('0x6'));var _=require(_0xf44f('0x7'));var squel=require('squel');var crypto=require(_0xf44f('0x8'));var jsforce=require(_0xf44f('0x9'));var deskjs=require(_0xf44f('0xa'));var toCsv=require('to-csv');var querystring=require(_0xf44f('0xb'));var Papa=require(_0xf44f('0xc'));var Redis=require(_0xf44f('0xd'));var authService=require(_0xf44f('0xe'));var qs=require(_0xf44f('0xf'));var as=require(_0xf44f('0x10'));var hardwareService=require(_0xf44f('0x11'));var logger=require(_0xf44f('0x12'))(_0xf44f('0x13'));var utils=require(_0xf44f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf44f('0x15'));var db=require(_0xf44f('0x16'))['db'];config[_0xf44f('0x17')]=_[_0xf44f('0x18')](config[_0xf44f('0x17')],{'host':_0xf44f('0x19'),'port':0x18eb});var socket=require(_0xf44f('0x1a'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0xf44f('0x1b')](socket);function respondWithStatusCode(_0x5f20aa,_0x4a3277){_0x4a3277=_0x4a3277||0xcc;return function(_0x5afc15){if(_0x5afc15){return _0x5f20aa[_0xf44f('0x1c')](_0x4a3277);}return _0x5f20aa[_0xf44f('0x1d')](_0x4a3277)[_0xf44f('0x1e')]();};}function respondWithResult(_0x1a5ce4,_0x52171b){_0x52171b=_0x52171b||0xc8;return function(_0x36d3c1){if(_0x36d3c1){return _0x1a5ce4['status'](_0x52171b)[_0xf44f('0x1f')](_0x36d3c1);}};}function respondWithFilteredResult(_0x40e414,_0x43c57d){return function(_0x15e5b6){if(_0x15e5b6){var _0x542786=typeof _0x43c57d['offset']==='undefined'&&typeof _0x43c57d['limit']===_0xf44f('0x20');var _0x4f0292=_0x15e5b6['count'];var _0x395bfe=_0x542786?0x0:_0x43c57d[_0xf44f('0x21')];var _0xb4600b=_0x542786?_0x15e5b6['count']:_0x43c57d[_0xf44f('0x21')]+_0x43c57d[_0xf44f('0x22')];var _0x5eb768;if(_0xb4600b>=_0x4f0292){_0xb4600b=_0x4f0292;_0x5eb768=0xc8;}else{_0x5eb768=0xce;}_0x40e414[_0xf44f('0x1d')](_0x5eb768);return _0x40e414['set'](_0xf44f('0x23'),_0x395bfe+'-'+_0xb4600b+'/'+_0x4f0292)[_0xf44f('0x1f')](_0x15e5b6);}return null;};}function patchUpdates(_0x3e0b9c){return function(_0x511661){try{jsonpatch[_0xf44f('0x24')](_0x511661,_0x3e0b9c,!![]);}catch(_0x1b9dc9){return BPromise[_0xf44f('0x25')](_0x1b9dc9);}return _0x511661['save']();};}function saveUpdates(_0x1ba9c0,_0x5687d1){return function(_0x367f90){if(_0x367f90){return _0x367f90[_0xf44f('0x26')](_0x1ba9c0)[_0xf44f('0x27')](function(_0x5313f5){return _0x5313f5;});}return null;};}function removeEntity(_0x3c04fe,_0x2a17e0){return function(_0x17f1a4){if(_0x17f1a4){return _0x17f1a4[_0xf44f('0x28')]()['then'](function(){var _0x1af2a2=_0x17f1a4[_0xf44f('0x29')]({'plain':!![]});var _0x36e7a9=[{'name':_0xf44f('0x2a'),'value':_0xf44f('0x2b'),'ignore':![]},{'name':_0xf44f('0x2c'),'value':'outbound','ignore':![]}];var _0x202f7c=_(_0x36e7a9)['filter'](_0xf44f('0x2d'))[_0xf44f('0x2e')]('value')['value']();if(_[_0xf44f('0x2f')](_0x202f7c,_0x1af2a2[_0xf44f('0x30')])){return;}var _0x3aa3a7=_[_0xf44f('0x31')](_0x36e7a9,['value',_0x1af2a2[_0xf44f('0x30')]])[_0xf44f('0x32')];return db['UserProfileResource'][_0xf44f('0x28')]({'where':{'type':_0x3aa3a7,'resourceId':_0x1af2a2['id']}})[_0xf44f('0x27')](function(){return _0x17f1a4;});})[_0xf44f('0x27')](function(){_0x3c04fe[_0xf44f('0x1d')](0xcc)[_0xf44f('0x1e')]();});}};}function handleEntityNotFound(_0x57085e,_0x39641a){return function(_0x46a1a0){if(!_0x46a1a0){_0x57085e[_0xf44f('0x1c')](0x194);}return _0x46a1a0;};}function handleError(_0x31e847,_0x4853ed){_0x4853ed=_0x4853ed||0x1f4;return function(_0x2419d8){logger[_0xf44f('0x33')](_0x2419d8['stack']);if(_0x2419d8[_0xf44f('0x32')]){delete _0x2419d8[_0xf44f('0x32')];}_0x31e847[_0xf44f('0x1d')](_0x4853ed)[_0xf44f('0x34')](_0x2419d8);};}exports[_0xf44f('0x35')]=function(_0x583fa2,_0x1678ed){var _0x19f3ac={},_0x220749={},_0x18ee71={'count':0x0,'rows':[]};var _0x35e5c6=_[_0xf44f('0x2e')](db[_0xf44f('0x36')][_0xf44f('0x37')],function(_0x28cfe7){return{'name':_0x28cfe7['fieldName'],'type':_0x28cfe7[_0xf44f('0x30')][_0xf44f('0x38')]};});_0x220749[_0xf44f('0x39')]=_[_0xf44f('0x2e')](_0x35e5c6,_0xf44f('0x32'));_0x220749[_0xf44f('0x3a')]=_[_0xf44f('0x3b')](_0x583fa2[_0xf44f('0x3a')]);_0x220749[_0xf44f('0x3c')]=_[_0xf44f('0x3d')](_0x220749[_0xf44f('0x39')],_0x220749[_0xf44f('0x3a')]);_0x19f3ac[_0xf44f('0x3e')]=_[_0xf44f('0x3d')](_0x220749[_0xf44f('0x39')],qs[_0xf44f('0x3f')](_0x583fa2[_0xf44f('0x3a')][_0xf44f('0x3f')]));_0x19f3ac[_0xf44f('0x3e')]=_0x19f3ac[_0xf44f('0x3e')][_0xf44f('0x40')]?_0x19f3ac[_0xf44f('0x3e')]:_0x220749[_0xf44f('0x39')];if(!_0x583fa2['query'][_0xf44f('0x41')](_0xf44f('0x42'))){_0x19f3ac[_0xf44f('0x22')]=qs[_0xf44f('0x22')](_0x583fa2['query'][_0xf44f('0x22')]);_0x19f3ac['offset']=qs['offset'](_0x583fa2[_0xf44f('0x3a')][_0xf44f('0x21')]);}_0x19f3ac[_0xf44f('0x43')]=qs[_0xf44f('0x44')](_0x583fa2[_0xf44f('0x3a')]['sort']);_0x19f3ac[_0xf44f('0x45')]=qs[_0xf44f('0x3c')](_['pick'](_0x583fa2[_0xf44f('0x3a')],_0x220749[_0xf44f('0x3c')]),_0x35e5c6);if(_0x583fa2[_0xf44f('0x3a')]['filter']){_0x19f3ac[_0xf44f('0x45')]=_['merge'](_0x19f3ac[_0xf44f('0x45')],{'$or':_[_0xf44f('0x2e')](_0x35e5c6,function(_0x526112){if(_0x526112[_0xf44f('0x30')]!==_0xf44f('0x46')){var _0x39b23d={};_0x39b23d[_0x526112[_0xf44f('0x32')]]={'$like':'%'+_0x583fa2[_0xf44f('0x3a')][_0xf44f('0x47')]+'%'};return _0x39b23d;}})});}_0x19f3ac=_[_0xf44f('0x48')]({},_0x19f3ac,_0x583fa2[_0xf44f('0x49')]);var _0x5c4933={'where':_0x19f3ac[_0xf44f('0x45')]};return db[_0xf44f('0x36')][_0xf44f('0x4a')](_0x5c4933)[_0xf44f('0x27')](function(_0x3c52e7){_0x18ee71[_0xf44f('0x4a')]=_0x3c52e7;if(_0x583fa2['query'][_0xf44f('0x4b')]){_0x19f3ac[_0xf44f('0x4c')]=[{'all':!![]}];}return db[_0xf44f('0x36')]['findAll'](_0x19f3ac);})[_0xf44f('0x27')](function(_0x5e6243){_0x18ee71[_0xf44f('0x4d')]=_0x5e6243;return _0x18ee71;})[_0xf44f('0x27')](respondWithFilteredResult(_0x1678ed,_0x19f3ac))[_0xf44f('0x4e')](handleError(_0x1678ed,null));};exports['show']=function(_0x36aa74,_0x3589d9){var _0x44f7d6={'raw':![],'where':{'id':_0x36aa74['params']['id']}},_0x509bdc={};_0x509bdc[_0xf44f('0x39')]=_[_0xf44f('0x3b')](db[_0xf44f('0x36')][_0xf44f('0x37')]);_0x509bdc[_0xf44f('0x3a')]=_[_0xf44f('0x3b')](_0x36aa74[_0xf44f('0x3a')]);_0x509bdc['filters']=_[_0xf44f('0x3d')](_0x509bdc[_0xf44f('0x39')],_0x509bdc['query']);_0x44f7d6['attributes']=_['intersection'](_0x509bdc[_0xf44f('0x39')],qs[_0xf44f('0x3f')](_0x36aa74[_0xf44f('0x3a')]['fields']));_0x44f7d6['attributes']=_0x44f7d6[_0xf44f('0x3e')][_0xf44f('0x40')]?_0x44f7d6[_0xf44f('0x3e')]:_0x509bdc[_0xf44f('0x39')];if(_0x36aa74[_0xf44f('0x3a')]['includeAll']){_0x44f7d6[_0xf44f('0x4c')]=[{'all':!![]}];}_0x44f7d6=_[_0xf44f('0x48')]({},_0x44f7d6,_0x36aa74['options']);return db[_0xf44f('0x36')]['find'](_0x44f7d6)[_0xf44f('0x27')](handleEntityNotFound(_0x3589d9,null))[_0xf44f('0x27')](respondWithResult(_0x3589d9,null))[_0xf44f('0x4e')](handleError(_0x3589d9,null));};exports[_0xf44f('0x4f')]=function(_0xe99573,_0x3827ad){return db[_0xf44f('0x36')]['create'](_0xe99573[_0xf44f('0x50')],{})[_0xf44f('0x27')](function(_0x3b2210){var _0x3eefc8=_0xe99573['user']['get']({'plain':!![]});if(!_0x3eefc8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3eefc8['role']===_0xf44f('0x51')){var _0x427ffc=_0x3b2210[_0xf44f('0x29')]({'plain':!![]});var _0x4bfaa5=[{'name':_0xf44f('0x2a'),'value':_0xf44f('0x2b')},{'name':'QueueCampaigns','value':_0xf44f('0x52')}];var _0x592aa7=_[_0xf44f('0x31')](_0x4bfaa5,[_0xf44f('0x53'),_0x427ffc[_0xf44f('0x30')]])[_0xf44f('0x32')];return db[_0xf44f('0x54')][_0xf44f('0x31')]({'where':{'name':_0x592aa7,'userProfileId':_0x3eefc8[_0xf44f('0x55')]},'raw':!![]})[_0xf44f('0x27')](function(_0x3fdaac){if(_0x3fdaac&&_0x3fdaac[_0xf44f('0x56')]===0x0){return db[_0xf44f('0x57')][_0xf44f('0x4f')]({'name':_0x427ffc['name'],'resourceId':_0x427ffc['id'],'type':_0x3fdaac[_0xf44f('0x32')],'sectionId':_0x3fdaac['id']},{})['then'](function(){return _0x3b2210;});}else{return _0x3b2210;}})[_0xf44f('0x4e')](function(_0x322357){logger[_0xf44f('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x322357);throw _0x322357;});}return _0x3b2210;})['then'](respondWithResult(_0x3827ad,0xc9))[_0xf44f('0x4e')](handleError(_0x3827ad,null));};exports[_0xf44f('0x58')]=function(_0x1fa774,_0x269612){var _0x3b639b={'where':{'id':_0x1fa774[_0xf44f('0x59')]['id']}},_0xf1cdea={};_0xf1cdea[_0xf44f('0x39')]=_['keys'](db[_0xf44f('0x36')][_0xf44f('0x37')]);_0x3b639b[_0xf44f('0x3e')]=_['intersection'](_0xf1cdea[_0xf44f('0x39')],qs['fields'](_0x1fa774[_0xf44f('0x3a')][_0xf44f('0x3f')]));_0x3b639b[_0xf44f('0x3e')]=_0x3b639b[_0xf44f('0x3e')]['length']?_0x3b639b['attributes']:_0xf1cdea['model'];if(_0x1fa774['query'][_0xf44f('0x4b')]){_0x3b639b[_0xf44f('0x4c')]=[{'all':!![]}];}_0x3b639b=_[_0xf44f('0x48')]({},_0x3b639b,_0x1fa774['options']);return db[_0xf44f('0x36')][_0xf44f('0x31')](_0x3b639b)[_0xf44f('0x27')](handleEntityNotFound(_0x269612,null))[_0xf44f('0x27')](function(_0x13347d){if(_0x13347d){var _0x323489=_0x13347d[_0xf44f('0x29')]({'plain':!![]});_0x323489=qs['omit'](_0x323489,['id','createdAt',_0xf44f('0x5a')]);_0x1fa774['body']=_[_0xf44f('0x5b')](_0x1fa774[_0xf44f('0x50')],['id',_0xf44f('0x5c'),_0xf44f('0x5a')]);return db['VoiceQueue'][_0xf44f('0x4f')](_[_0xf44f('0x48')](_0x323489,_0x1fa774['body']),{'include':_0x1fa774['query'][_0xf44f('0x4b')]?[{'all':!![]}]:undefined})[_0xf44f('0x27')](function(_0x44347a){var _0x4e1404=_0x1fa774['user'][_0xf44f('0x29')]({'plain':!![]});if(!_0x4e1404)throw new Error(_0xf44f('0x5d'));if(_0x4e1404[_0xf44f('0x5e')]===_0xf44f('0x51')){var _0x5c3b86=_0x44347a[_0xf44f('0x29')]({'plain':!![]});var _0x27dca0=[{'name':_0xf44f('0x2a'),'value':'inbound'},{'name':'QueueCampaigns','value':_0xf44f('0x52')}];var _0x9dfe6=_[_0xf44f('0x31')](_0x27dca0,[_0xf44f('0x53'),_0x5c3b86[_0xf44f('0x30')]])[_0xf44f('0x32')];return db[_0xf44f('0x54')][_0xf44f('0x31')]({'where':{'name':_0x9dfe6,'userProfileId':_0x4e1404[_0xf44f('0x55')]},'raw':!![]})[_0xf44f('0x27')](function(_0xa2935b){if(_0xa2935b&&_0xa2935b[_0xf44f('0x56')]===0x0){return db[_0xf44f('0x57')][_0xf44f('0x4f')]({'name':_0x5c3b86[_0xf44f('0x32')],'resourceId':_0x5c3b86['id'],'type':_0xa2935b['name'],'sectionId':_0xa2935b['id']},{})['then'](function(){return _0x44347a;});}else{return _0x44347a;}})[_0xf44f('0x4e')](function(_0x2d29e2){logger[_0xf44f('0x33')](_0xf44f('0x5f'),_0x2d29e2);throw _0x2d29e2;});}return _0x44347a;});}})[_0xf44f('0x27')](respondWithResult(_0x269612,0xc9))['catch'](handleError(_0x269612,null));};exports[_0xf44f('0x26')]=function(_0x1a25be,_0x394078){if(_0x1a25be['body']['id']){delete _0x1a25be['body']['id'];}return db[_0xf44f('0x36')]['find']({'where':{'id':_0x1a25be['params']['id']}})['then'](handleEntityNotFound(_0x394078,null))[_0xf44f('0x27')](saveUpdates(_0x1a25be['body'],null))[_0xf44f('0x27')](respondWithResult(_0x394078,null))[_0xf44f('0x4e')](handleError(_0x394078,null));};exports[_0xf44f('0x28')]=function(_0x515c7a,_0x2ca7a4){return db[_0xf44f('0x36')][_0xf44f('0x31')]({'where':{'id':_0x515c7a['params']['id']}})[_0xf44f('0x27')](handleEntityNotFound(_0x2ca7a4,null))[_0xf44f('0x27')](removeEntity(_0x2ca7a4,null))[_0xf44f('0x4e')](handleError(_0x2ca7a4,null));};exports[_0xf44f('0x60')]=function(_0x474adc,_0x56848a,_0x4f1226){var _0x950219={'raw':![],'where':{}};var _0x5ee0a8={};var _0x3e1be2={'count':0x0,'rows':[]};return db[_0xf44f('0x36')][_0xf44f('0x61')]({'where':{'id':_0x474adc[_0xf44f('0x59')]['id']}})['then'](handleEntityNotFound(_0x56848a,null))['then'](function(_0x1a70e6){if(_0x1a70e6){_0x5ee0a8[_0xf44f('0x39')]=_[_0xf44f('0x3b')](db[_0xf44f('0x62')][_0xf44f('0x37')]);_0x5ee0a8[_0xf44f('0x3a')]=_[_0xf44f('0x3b')](_0x474adc[_0xf44f('0x3a')]);_0x5ee0a8['filters']=_['intersection'](_0x5ee0a8[_0xf44f('0x39')],_0x5ee0a8[_0xf44f('0x3a')]);_0x950219[_0xf44f('0x3e')]=_[_0xf44f('0x3d')](_0x5ee0a8[_0xf44f('0x39')],qs['fields'](_0x474adc['query'][_0xf44f('0x3f')]));_0x950219['attributes']=_0x950219[_0xf44f('0x3e')][_0xf44f('0x40')]?_0x950219[_0xf44f('0x3e')]:_0x5ee0a8[_0xf44f('0x39')];if(!_0x474adc['query'][_0xf44f('0x41')](_0xf44f('0x42'))){_0x950219[_0xf44f('0x22')]=qs[_0xf44f('0x22')](_0x474adc['query'][_0xf44f('0x22')]);_0x950219['offset']=qs[_0xf44f('0x21')](_0x474adc['query'][_0xf44f('0x21')]);}_0x950219[_0xf44f('0x43')]=qs[_0xf44f('0x44')](_0x474adc['query'][_0xf44f('0x44')]);_0x950219[_0xf44f('0x45')]=qs['filters'](_[_0xf44f('0x63')](_0x474adc[_0xf44f('0x3a')],_0x5ee0a8['filters']));_0x950219[_0xf44f('0x45')][_0xf44f('0x64')]=_0x1a70e6['id'];if(_0x474adc[_0xf44f('0x3a')][_0xf44f('0x47')]){_0x950219[_0xf44f('0x45')]=_[_0xf44f('0x48')](_0x950219[_0xf44f('0x45')],{'$or':_[_0xf44f('0x2e')](_0x950219['attributes'],function(_0x46cd0d){var _0x5db584={};_0x5db584[_0x46cd0d]={'$like':'%'+_0x474adc[_0xf44f('0x3a')][_0xf44f('0x47')]+'%'};return _0x5db584;})});}_0x950219=_[_0xf44f('0x48')]({},_0x950219,_0x474adc[_0xf44f('0x49')]);return db['CmHopper'][_0xf44f('0x4a')]({'where':_0x950219['where']})[_0xf44f('0x27')](function(_0x1108ef){_0x3e1be2['count']=_0x1108ef;if(_0x474adc[_0xf44f('0x3a')][_0xf44f('0x4b')]){_0x950219[_0xf44f('0x4c')]=[{'all':!![]}];}return db[_0xf44f('0x62')][_0xf44f('0x65')](_0x950219);})[_0xf44f('0x27')](function(_0x34d955){_0x3e1be2['rows']=_0x34d955;return _0x3e1be2;});}})[_0xf44f('0x27')](respondWithFilteredResult(_0x56848a,_0x950219))[_0xf44f('0x4e')](handleError(_0x56848a,null));};exports['getHopperHistories']=function(_0x49d6f8,_0x61d2cf,_0x15b637){var _0xe2d05={'raw':!![],'where':{}};var _0x80b41c={};var _0x1eb115={'count':0x0,'rows':[]};return db[_0xf44f('0x36')][_0xf44f('0x61')]({'where':{'id':_0x49d6f8[_0xf44f('0x59')]['id']}})[_0xf44f('0x27')](handleEntityNotFound(_0x61d2cf,null))[_0xf44f('0x27')](function(_0x4abe25){if(_0x4abe25){_0x80b41c[_0xf44f('0x39')]=_[_0xf44f('0x3b')](db[_0xf44f('0x66')]['rawAttributes']);_0x80b41c['query']=_[_0xf44f('0x3b')](_0x49d6f8[_0xf44f('0x3a')]);_0x80b41c['filters']=_[_0xf44f('0x3d')](_0x80b41c['model'],_0x80b41c[_0xf44f('0x3a')]);_0xe2d05[_0xf44f('0x3e')]=_['intersection'](_0x80b41c[_0xf44f('0x39')],qs[_0xf44f('0x3f')](_0x49d6f8['query'][_0xf44f('0x3f')]));_0xe2d05[_0xf44f('0x3e')]=_0xe2d05[_0xf44f('0x3e')][_0xf44f('0x40')]?_0xe2d05['attributes']:_0x80b41c[_0xf44f('0x39')];if(!_0x49d6f8['query'][_0xf44f('0x41')](_0xf44f('0x42'))){_0xe2d05['limit']=qs[_0xf44f('0x22')](_0x49d6f8[_0xf44f('0x3a')][_0xf44f('0x22')]);_0xe2d05['offset']=qs['offset'](_0x49d6f8[_0xf44f('0x3a')][_0xf44f('0x21')]);}_0xe2d05[_0xf44f('0x43')]=qs['sort'](_0x49d6f8[_0xf44f('0x3a')]['sort']);_0xe2d05[_0xf44f('0x45')]=qs['filters'](_[_0xf44f('0x63')](_0x49d6f8[_0xf44f('0x3a')],_0x80b41c['filters']));_0xe2d05[_0xf44f('0x45')][_0xf44f('0x64')]=_0x4abe25['id'];if(_0x49d6f8[_0xf44f('0x3a')][_0xf44f('0x47')]){_0xe2d05[_0xf44f('0x45')]=_[_0xf44f('0x48')](_0xe2d05[_0xf44f('0x45')],{'$or':_['map'](_0xe2d05[_0xf44f('0x3e')],function(_0x3a6b8f){var _0x554683={};_0x554683[_0x3a6b8f]={'$like':'%'+_0x49d6f8[_0xf44f('0x3a')]['filter']+'%'};return _0x554683;})});}_0xe2d05=_[_0xf44f('0x48')]({},_0xe2d05,_0x49d6f8[_0xf44f('0x49')]);return db[_0xf44f('0x66')]['count']({'where':_0xe2d05[_0xf44f('0x45')]})[_0xf44f('0x27')](function(_0x101e2e){_0x1eb115[_0xf44f('0x4a')]=_0x101e2e;if(_0x49d6f8[_0xf44f('0x3a')][_0xf44f('0x4b')]){_0xe2d05[_0xf44f('0x4c')]=[{'all':!![]}];}return db[_0xf44f('0x66')][_0xf44f('0x65')](_0xe2d05);})['then'](function(_0x4b24ce){_0x1eb115[_0xf44f('0x4d')]=_0x4b24ce;return _0x1eb115;});}})[_0xf44f('0x27')](respondWithFilteredResult(_0x61d2cf,_0xe2d05))[_0xf44f('0x4e')](handleError(_0x61d2cf,null));};exports[_0xf44f('0x67')]=function(_0x333119,_0x4cd41a,_0x2ed936){var _0x3ace45={'raw':!![],'where':{}};var _0x275496={};var _0x4d5036={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xf44f('0x61')]({'where':{'id':_0x333119[_0xf44f('0x59')]['id']}})[_0xf44f('0x27')](handleEntityNotFound(_0x4cd41a,null))['then'](function(_0x52408c){if(_0x52408c){_0x275496[_0xf44f('0x39')]=_[_0xf44f('0x3b')](db[_0xf44f('0x68')][_0xf44f('0x37')]);_0x275496['query']=_[_0xf44f('0x3b')](_0x333119[_0xf44f('0x3a')]);_0x275496[_0xf44f('0x3c')]=_['intersection'](_0x275496[_0xf44f('0x39')],_0x275496['query']);_0x3ace45[_0xf44f('0x3e')]=_[_0xf44f('0x3d')](_0x275496[_0xf44f('0x39')],qs[_0xf44f('0x3f')](_0x333119[_0xf44f('0x3a')][_0xf44f('0x3f')]));_0x3ace45[_0xf44f('0x3e')]=_0x3ace45[_0xf44f('0x3e')][_0xf44f('0x40')]?_0x3ace45[_0xf44f('0x3e')]:_0x275496[_0xf44f('0x39')];if(!_0x333119[_0xf44f('0x3a')][_0xf44f('0x41')](_0xf44f('0x42'))){_0x3ace45[_0xf44f('0x22')]=qs[_0xf44f('0x22')](_0x333119[_0xf44f('0x3a')][_0xf44f('0x22')]);_0x3ace45[_0xf44f('0x21')]=qs[_0xf44f('0x21')](_0x333119[_0xf44f('0x3a')][_0xf44f('0x21')]);}_0x3ace45['order']=qs['sort'](_0x333119[_0xf44f('0x3a')][_0xf44f('0x44')]);_0x3ace45[_0xf44f('0x45')]=qs[_0xf44f('0x3c')](_[_0xf44f('0x63')](_0x333119[_0xf44f('0x3a')],_0x275496[_0xf44f('0x3c')]));_0x3ace45[_0xf44f('0x45')][_0xf44f('0x64')]=_0x52408c['id'];if(_0x333119[_0xf44f('0x3a')][_0xf44f('0x47')]){_0x3ace45[_0xf44f('0x45')]=_[_0xf44f('0x48')](_0x3ace45[_0xf44f('0x45')],{'$or':_['map'](_0x3ace45[_0xf44f('0x3e')],function(_0x52ca9c){var _0x46233c={};_0x46233c[_0x52ca9c]={'$like':'%'+_0x333119[_0xf44f('0x3a')][_0xf44f('0x47')]+'%'};return _0x46233c;})});}_0x3ace45=_['merge']({},_0x3ace45,_0x333119['options']);return db['CmHopperFinal'][_0xf44f('0x4a')]({'where':_0x3ace45[_0xf44f('0x45')]})[_0xf44f('0x27')](function(_0x3ad820){_0x4d5036[_0xf44f('0x4a')]=_0x3ad820;if(_0x333119['query']['includeAll']){_0x3ace45[_0xf44f('0x4c')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x3ace45);})[_0xf44f('0x27')](function(_0x1fcc72){_0x4d5036[_0xf44f('0x4d')]=_0x1fcc72;return _0x4d5036;});}})[_0xf44f('0x27')](respondWithFilteredResult(_0x4cd41a,_0x3ace45))[_0xf44f('0x4e')](handleError(_0x4cd41a,null));};exports[_0xf44f('0x69')]=function(_0x38d625,_0x3f193b,_0x54dab7){var _0xda5669={'raw':!![],'where':{}};var _0x2e9eb9={};var _0x19b8ca={'count':0x0,'rows':[]};return db[_0xf44f('0x36')][_0xf44f('0x61')]({'where':{'id':_0x38d625[_0xf44f('0x59')]['id']}})['then'](handleEntityNotFound(_0x3f193b,null))[_0xf44f('0x27')](function(_0x257fc1){if(_0x257fc1){_0x2e9eb9[_0xf44f('0x39')]=_['keys'](db[_0xf44f('0x6a')][_0xf44f('0x37')]);_0x2e9eb9[_0xf44f('0x3a')]=_[_0xf44f('0x3b')](_0x38d625[_0xf44f('0x3a')]);_0x2e9eb9[_0xf44f('0x3c')]=_['intersection'](_0x2e9eb9[_0xf44f('0x39')],_0x2e9eb9[_0xf44f('0x3a')]);_0xda5669['attributes']=_[_0xf44f('0x3d')](_0x2e9eb9[_0xf44f('0x39')],qs['fields'](_0x38d625[_0xf44f('0x3a')][_0xf44f('0x3f')]));_0xda5669['attributes']=_0xda5669[_0xf44f('0x3e')][_0xf44f('0x40')]?_0xda5669['attributes']:_0x2e9eb9[_0xf44f('0x39')];if(!_0x38d625[_0xf44f('0x3a')]['hasOwnProperty'](_0xf44f('0x42'))){_0xda5669[_0xf44f('0x22')]=qs[_0xf44f('0x22')](_0x38d625[_0xf44f('0x3a')][_0xf44f('0x22')]);_0xda5669[_0xf44f('0x21')]=qs[_0xf44f('0x21')](_0x38d625['query'][_0xf44f('0x21')]);}_0xda5669['order']=qs[_0xf44f('0x44')](_0x38d625['query']['sort']);_0xda5669[_0xf44f('0x45')]=qs[_0xf44f('0x3c')](_[_0xf44f('0x63')](_0x38d625[_0xf44f('0x3a')],_0x2e9eb9[_0xf44f('0x3c')]));_0xda5669['where'][_0xf44f('0x64')]=_0x257fc1['id'];if(_0x38d625[_0xf44f('0x3a')]['filter']){_0xda5669[_0xf44f('0x45')]=_[_0xf44f('0x48')](_0xda5669[_0xf44f('0x45')],{'$or':_[_0xf44f('0x2e')](_0xda5669[_0xf44f('0x3e')],function(_0x619e8a){var _0x1f44c4={};_0x1f44c4[_0x619e8a]={'$like':'%'+_0x38d625[_0xf44f('0x3a')]['filter']+'%'};return _0x1f44c4;})});}_0xda5669=_[_0xf44f('0x48')]({},_0xda5669,_0x38d625[_0xf44f('0x49')]);return db[_0xf44f('0x6a')][_0xf44f('0x4a')]({'where':_0xda5669[_0xf44f('0x45')]})[_0xf44f('0x27')](function(_0x52f4c9){_0x19b8ca['count']=_0x52f4c9;if(_0x38d625[_0xf44f('0x3a')][_0xf44f('0x4b')]){_0xda5669['include']=[{'all':!![]}];}return db[_0xf44f('0x6a')][_0xf44f('0x65')](_0xda5669);})[_0xf44f('0x27')](function(_0x1c9455){_0x19b8ca[_0xf44f('0x4d')]=_0x1c9455;return _0x19b8ca;});}})[_0xf44f('0x27')](respondWithFilteredResult(_0x3f193b,_0xda5669))[_0xf44f('0x4e')](handleError(_0x3f193b,null));};exports[_0xf44f('0x6b')]=function(_0x596211,_0x333255,_0x339b14){var _0xc3d446={};var _0x3e218d={};var _0x124316;var _0x418336;return db[_0xf44f('0x36')][_0xf44f('0x61')]({'where':{'id':_0x596211['params']['id']}})[_0xf44f('0x27')](handleEntityNotFound(_0x333255,null))['then'](function(_0x2478e9){if(_0x2478e9){_0x124316=_0x2478e9;_0x3e218d[_0xf44f('0x39')]=_['keys'](db['Team'][_0xf44f('0x37')]);_0x3e218d[_0xf44f('0x3a')]=_[_0xf44f('0x3b')](_0x596211['query']);_0x3e218d[_0xf44f('0x3c')]=_[_0xf44f('0x3d')](_0x3e218d['model'],_0x3e218d[_0xf44f('0x3a')]);_0xc3d446[_0xf44f('0x3e')]=_['intersection'](_0x3e218d[_0xf44f('0x39')],qs[_0xf44f('0x3f')](_0x596211['query']['fields']));_0xc3d446['attributes']=_0xc3d446[_0xf44f('0x3e')][_0xf44f('0x40')]?_0xc3d446[_0xf44f('0x3e')]:_0x3e218d[_0xf44f('0x39')];_0xc3d446[_0xf44f('0x43')]=qs[_0xf44f('0x44')](_0x596211[_0xf44f('0x3a')][_0xf44f('0x44')]);_0xc3d446[_0xf44f('0x45')]=qs[_0xf44f('0x3c')](_[_0xf44f('0x63')](_0x596211[_0xf44f('0x3a')],_0x3e218d[_0xf44f('0x3c')]));if(_0x596211[_0xf44f('0x3a')][_0xf44f('0x47')]){_0xc3d446[_0xf44f('0x45')]=_['merge'](_0xc3d446[_0xf44f('0x45')],{'$or':_[_0xf44f('0x2e')](_0xc3d446['attributes'],function(_0x4600a6){var _0x1cf2f5={};_0x1cf2f5[_0x4600a6]={'$like':'%'+_0x596211[_0xf44f('0x3a')][_0xf44f('0x47')]+'%'};return _0x1cf2f5;})});}_0xc3d446=_[_0xf44f('0x48')]({},_0xc3d446,_0x596211['options']);return _0x124316[_0xf44f('0x6b')](_0xc3d446);}})[_0xf44f('0x27')](function(_0x4ea251){if(_0x4ea251){_0x418336=_0x4ea251[_0xf44f('0x40')];if(!_0x596211[_0xf44f('0x3a')][_0xf44f('0x41')](_0xf44f('0x42'))){_0xc3d446[_0xf44f('0x22')]=qs[_0xf44f('0x22')](_0x596211['query']['limit']);_0xc3d446[_0xf44f('0x21')]=qs[_0xf44f('0x21')](_0x596211[_0xf44f('0x3a')]['offset']);}return _0x124316[_0xf44f('0x6b')](_0xc3d446);}})[_0xf44f('0x27')](function(_0x17d98a){if(_0x17d98a){return _0x17d98a?{'count':_0x418336,'rows':_0x17d98a}:null;}})[_0xf44f('0x27')](respondWithResult(_0x333255,null))[_0xf44f('0x4e')](handleError(_0x333255,null));};exports[_0xf44f('0x6c')]=function(_0xe7d6eb,_0x1f0890,_0x2cc1a4){var _0x1fe1c8=_0xe7d6eb['body']['teams'];var _0x5d44d9=_[_0xf44f('0x2e')](_0x1fe1c8,'id');return db[_0xf44f('0x6d')][_0xf44f('0x65')]({'where':{'id':_0x5d44d9},'attributes':['id'],'include':[{'model':db[_0xf44f('0x6e')],'as':_0xf44f('0x6f'),'attributes':['id','name','online',_0xf44f('0x70'),'interface'],'raw':!![]}]})[_0xf44f('0x27')](function(_0x54bf09){if(_0x54bf09){var _0x50d570=_[_0xf44f('0x71')](_0x54bf09,function(_0x51220c){var _0x1f3069=_0x51220c[_0xf44f('0x29')]({'plain':!![]});_0x1f3069[_0xf44f('0x6f')][_0xf44f('0x72')](function(_0x52e88e){_0x52e88e[_0xf44f('0x73')]=_[_0xf44f('0x31')](_0x1fe1c8,{'id':_0x1f3069['id']})[_0xf44f('0x73')];});return _0x1f3069['Agents'];});return db[_0xf44f('0x36')][_0xf44f('0x31')]({'where':{'id':_0xe7d6eb['params']['id']}})[_0xf44f('0x27')](function(_0x1330ad){return db[_0xf44f('0x74')][_0xf44f('0x75')](function(_0xf3a403){return _0x1330ad['addTeams'](_0x5d44d9,{'transaction':_0xf3a403})[_0xf44f('0x27')](function(){return BPromise[_0xf44f('0x76')](_0x1fe1c8,function(_0x31f055){return db[_0xf44f('0x77')][_0xf44f('0x78')]({'TeamId':_0x31f055['id'],'VoiceQueueId':_0xe7d6eb[_0xf44f('0x59')]['id'],'penalty':_0x31f055[_0xf44f('0x73')]},{'transaction':_0xf3a403});});})['then'](function(){return BPromise['each'](_0x50d570,function(_0x3b5a03){return db[_0xf44f('0x79')][_0xf44f('0x7a')]({'where':{'UserId':_0x3b5a03['id'],'VoiceQueueId':_0xe7d6eb[_0xf44f('0x59')]['id']},'defaults':{'penalty':_0x3b5a03[_0xf44f('0x73')]},'transaction':_0xf3a403});});})[_0xf44f('0x27')](function(){return BPromise[_0xf44f('0x76')](_[_0xf44f('0x47')](_0x50d570,{'online':!![]}),function(_0x18ef6f){return db[_0xf44f('0x7b')][_0xf44f('0x78')]({'membername':_0x18ef6f['name'],'UserId':_0x18ef6f['id'],'queue_name':_0x1330ad[_0xf44f('0x32')],'VoiceQueueId':_0x1330ad['id'],'interface':_[_0xf44f('0x7c')](_0x18ef6f[_0xf44f('0x7d')])?util[_0xf44f('0x7e')](_0xf44f('0x7f'),_0x18ef6f['name']):_0x18ef6f[_0xf44f('0x7d')],'paused':_0x18ef6f[_0xf44f('0x70')]||![],'penalty':_0x18ef6f['penalty']},{'transaction':_0xf3a403});});})[_0xf44f('0x27')](function(){_0x50d570[_0xf44f('0x72')](function(_0x1405bd){socket['emit'](_0xf44f('0x80'),{'UserId':_0x1405bd['id'],'VoiceQueueId':_0x1330ad['id']});});});});});}})[_0xf44f('0x27')](respondWithStatusCode(_0x1f0890,null))[_0xf44f('0x4e')](handleError(_0x1f0890,null));};exports[_0xf44f('0x81')]=function(_0x33b6f9,_0x95f235,_0x1bb5cb){return db[_0xf44f('0x6d')][_0xf44f('0x65')]({'where':{'id':_0x33b6f9[_0xf44f('0x3a')][_0xf44f('0x82')]},'attributes':['id'],'include':[{'model':db[_0xf44f('0x6e')],'as':_0xf44f('0x6f'),'attributes':['id'],'raw':!![]}]})[_0xf44f('0x27')](handleEntityNotFound(_0x95f235,null))[_0xf44f('0x27')](function(_0x497b64){var _0xe7ec6e=_[_0xf44f('0x2e')](_0x497b64,'id');var _0x2d10dd=[];var _0x1c9006=[];var _0x59159d=squel[_0xf44f('0x83')]();_0x59159d['field'](_0xf44f('0x84'))[_0xf44f('0x85')](_0xf44f('0x86'),'tq')['join'](_0xf44f('0x87'),'ut',_0xf44f('0x88'))[_0xf44f('0x45')](_0xf44f('0x89'),_0x33b6f9[_0xf44f('0x59')]['id']);for(var _0x344187=0x0;_0x344187<_0x497b64[_0xf44f('0x40')];_0x344187+=0x1){let _0x3f1f7e=_0x497b64[_0x344187];for(var _0x324ae7=0x0;_0x324ae7<_0x3f1f7e[_0xf44f('0x6f')][_0xf44f('0x40')];_0x324ae7+=0x1){let _0x173070=_0x3f1f7e[_0xf44f('0x6f')][_0x324ae7];var _0x421e69=_0x59159d[_0xf44f('0x58')]();_0x421e69[_0xf44f('0x45')](_0xf44f('0x8a'),_0x173070['id']);_0x1c9006[_0xf44f('0x8b')](db['sequelize'][_0xf44f('0x3a')](_0x421e69[_0xf44f('0x8c')](),{'type':db[_0xf44f('0x74')][_0xf44f('0x8d')][_0xf44f('0x8e')]})[_0xf44f('0x27')](function(_0x1feeff){if(_0x1feeff['length']===0x1){return _0x173070['id'];}else{var _0x33c8fb=_['every'](_[_0xf44f('0x2e')](_0x1feeff,'TeamId'),function(_0x14b2b4){return _[_0xf44f('0x2f')](_0xe7ec6e,_0x14b2b4);});if(_0x33c8fb){return _0x173070['id'];}}}));}}return BPromise['all'](_0x1c9006)['then'](function(_0x5188c8){_0x2d10dd=_(_0x2d10dd)[_0xf44f('0x8f')](_0x5188c8)[_0xf44f('0x90')]()[_0xf44f('0x53')]();return db[_0xf44f('0x36')][_0xf44f('0x31')]({'where':{'id':_0x33b6f9[_0xf44f('0x59')]['id']}})[_0xf44f('0x27')](function(_0x1a5750){return db[_0xf44f('0x74')]['transaction'](function(_0x361737){return _0x1a5750[_0xf44f('0x81')](_0x33b6f9[_0xf44f('0x3a')]['ids'],{'transaction':_0x361737})[_0xf44f('0x27')](function(){if(!_[_0xf44f('0x91')](_0x2d10dd)){return _0x1a5750[_0xf44f('0x92')](_0x2d10dd,{'transaction':_0x361737})[_0xf44f('0x27')](function(){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x33b6f9[_0xf44f('0x59')]['id'],'UserId':_0x2d10dd},'transaction':_0x361737});});}})[_0xf44f('0x27')](function(){_0x2d10dd[_0xf44f('0x72')](function(_0x316121){socket[_0xf44f('0x93')]('userVoiceQueue:remove',{'UserId':_0x316121,'VoiceQueueId':_0x1a5750['id']});});});});});});})['then'](respondWithStatusCode(_0x95f235,null))[_0xf44f('0x4e')](handleError(_0x95f235,null));};exports[_0xf44f('0x94')]=function(_0x5e10fc,_0x16a5a9,_0x2461c6){var _0x22aa12,_0x3d9aab;return db['VoiceQueue']['find']({'where':{'id':_0x5e10fc[_0xf44f('0x59')]['id']}})[_0xf44f('0x27')](handleEntityNotFound(_0x16a5a9,null))[_0xf44f('0x27')](function(_0x69d05b){if(_0x69d05b){_0x3d9aab=_0x69d05b;return _0x69d05b[_0xf44f('0x94')](_0x5e10fc[_0xf44f('0x50')][_0xf44f('0x82')],_[_0xf44f('0x5b')](_0x5e10fc[_0xf44f('0x50')],[_0xf44f('0x82'),'id'])||{})[_0xf44f('0x95')](function(_0x4404da){for(var _0x29b0de=0x0;_0x29b0de<_0x5e10fc[_0xf44f('0x50')][_0xf44f('0x82')]['length'];_0x29b0de+=0x1){socket['emit'](_0xf44f('0x80'),{'UserId':Number(_0x5e10fc['body'][_0xf44f('0x82')][_0x29b0de]),'VoiceQueueId':Number(_0x5e10fc['params']['id'])});}return _0x4404da;});}})[_0xf44f('0x27')](function(_0x3afc6c){_0x22aa12=_0x3afc6c||[];if(_0x3d9aab){return db[_0xf44f('0x6e')][_0xf44f('0x65')]({'where':{'id':_0x5e10fc['body'][_0xf44f('0x82')]},'attributes':['id',_0xf44f('0x32'),'online','voicePause','interface'],'raw':!![]});}})[_0xf44f('0x27')](function(_0x1b1bd1){if(!_[_0xf44f('0x91')](_0x1b1bd1)){var _0x152db5=[];for(var _0x29ca70=0x0;_0x29ca70<_0x1b1bd1[_0xf44f('0x40')];_0x29ca70++){if(_0x1b1bd1[_0x29ca70][_0xf44f('0x96')]){_0x152db5[_0xf44f('0x8b')](db[_0xf44f('0x7b')][_0xf44f('0x78')]({'membername':_0x1b1bd1[_0x29ca70][_0xf44f('0x32')],'UserId':_0x1b1bd1[_0x29ca70]['id'],'queue_name':_0x3d9aab[_0xf44f('0x32')],'VoiceQueueId':_0x3d9aab['id'],'interface':_['isNil'](_0x1b1bd1[_0x29ca70][_0xf44f('0x7d')])?util['format'](_0xf44f('0x7f'),_0x1b1bd1[_0x29ca70][_0xf44f('0x32')]):_0x1b1bd1[_0x29ca70][_0xf44f('0x7d')],'paused':_0x1b1bd1[_0x29ca70]['voicePause']||![],'penalty':_0x5e10fc[_0xf44f('0x50')]['penalty']||0x0}));}}return BPromise[_0xf44f('0x97')](_0x152db5);}})[_0xf44f('0x27')](function(){return _0x22aa12;})[_0xf44f('0x27')](respondWithResult(_0x16a5a9,null))[_0xf44f('0x4e')](handleError(_0x16a5a9,null));};exports[_0xf44f('0x92')]=function(_0x12eb0f,_0x1e48f8,_0x259392){return db[_0xf44f('0x36')][_0xf44f('0x31')]({'where':{'id':_0x12eb0f[_0xf44f('0x59')]['id']}})[_0xf44f('0x27')](handleEntityNotFound(_0x1e48f8,null))['then'](function(_0x1c7410){if(_0x1c7410){return _0x1c7410[_0xf44f('0x92')](_0x12eb0f[_0xf44f('0x3a')][_0xf44f('0x82')])['then'](function(){if(_[_0xf44f('0x98')](_0x12eb0f['query'][_0xf44f('0x82')])){for(var _0x4268d7=0x0;_0x4268d7<_0x12eb0f[_0xf44f('0x3a')][_0xf44f('0x82')][_0xf44f('0x40')];_0x4268d7+=0x1){socket[_0xf44f('0x93')](_0xf44f('0x99'),{'UserId':Number(_0x12eb0f[_0xf44f('0x3a')][_0xf44f('0x82')][_0x4268d7]),'VoiceQueueId':Number(_0x12eb0f[_0xf44f('0x59')]['id'])});}}else{socket[_0xf44f('0x93')](_0xf44f('0x99'),{'UserId':Number(_0x12eb0f[_0xf44f('0x3a')][_0xf44f('0x82')]),'VoiceQueueId':Number(_0x12eb0f[_0xf44f('0x59')]['id'])});}});}})['then'](function(_0x309e30){return db[_0xf44f('0x7b')][_0xf44f('0x28')]({'where':{'VoiceQueueId':_0x12eb0f['params']['id'],'UserId':_0x12eb0f[_0xf44f('0x3a')][_0xf44f('0x82')]}})['then'](function(){return _0x309e30;});})['then'](respondWithStatusCode(_0x1e48f8,null))[_0xf44f('0x4e')](handleError(_0x1e48f8,null));};exports[_0xf44f('0x9a')]=function(_0x2a3133,_0x37b060,_0x2bb4c8){var _0x12bf11={};var _0x3ef905={};var _0x4325e0;var _0x1dcb96;return db[_0xf44f('0x36')]['findOne']({'where':{'id':_0x2a3133[_0xf44f('0x59')]['id']}})[_0xf44f('0x27')](handleEntityNotFound(_0x37b060,null))[_0xf44f('0x27')](function(_0x1495f6){if(_0x1495f6){_0x4325e0=_0x1495f6;_0x3ef905['model']=_[_0xf44f('0x3b')](db[_0xf44f('0x6e')][_0xf44f('0x37')]);_0x3ef905[_0xf44f('0x3a')]=_[_0xf44f('0x3b')](_0x2a3133[_0xf44f('0x3a')]);_0x3ef905[_0xf44f('0x3c')]=_['intersection'](_0x3ef905[_0xf44f('0x39')],_0x3ef905[_0xf44f('0x3a')]);_0x12bf11[_0xf44f('0x3e')]=_[_0xf44f('0x3d')](_0x3ef905[_0xf44f('0x39')],qs[_0xf44f('0x3f')](_0x2a3133['query']['fields']));_0x12bf11['attributes']=_0x12bf11[_0xf44f('0x3e')]['length']?_0x12bf11[_0xf44f('0x3e')]:_0x3ef905['model'];_0x12bf11['order']=qs[_0xf44f('0x44')](_0x2a3133[_0xf44f('0x3a')][_0xf44f('0x44')]);_0x12bf11[_0xf44f('0x45')]=qs['filters'](_['pick'](_0x2a3133[_0xf44f('0x3a')],_0x3ef905['filters']));if(_0x2a3133[_0xf44f('0x3a')][_0xf44f('0x47')]){_0x12bf11['where']=_[_0xf44f('0x48')](_0x12bf11[_0xf44f('0x45')],{'$or':_[_0xf44f('0x2e')](_0x12bf11[_0xf44f('0x3e')],function(_0x710425){var _0x2b260d={};_0x2b260d[_0x710425]={'$like':'%'+_0x2a3133[_0xf44f('0x3a')][_0xf44f('0x47')]+'%'};return _0x2b260d;})});}_0x12bf11=_[_0xf44f('0x48')]({},_0x12bf11,_0x2a3133['options']);return _0x4325e0[_0xf44f('0x9a')](_0x12bf11);}})[_0xf44f('0x27')](function(_0x3d741c){if(_0x3d741c){_0x1dcb96=_0x3d741c[_0xf44f('0x40')];if(!_0x2a3133['query']['hasOwnProperty'](_0xf44f('0x42'))){_0x12bf11[_0xf44f('0x22')]=qs['limit'](_0x2a3133[_0xf44f('0x3a')][_0xf44f('0x22')]);_0x12bf11['offset']=qs[_0xf44f('0x21')](_0x2a3133[_0xf44f('0x3a')][_0xf44f('0x21')]);}return _0x4325e0['getAgents'](_0x12bf11);}})[_0xf44f('0x27')](function(_0xc87316){if(_0xc87316){return _0xc87316?{'count':_0x1dcb96,'rows':_0xc87316}:null;}})[_0xf44f('0x27')](respondWithResult(_0x37b060,null))['catch'](handleError(_0x37b060,null));};exports[_0xf44f('0x9b')]=function(_0x1dedff,_0x5a8aa1,_0x20568c){var _0x3752bb={};var _0x3138f5={};var _0x1c624d;var _0x27fbc7;return db[_0xf44f('0x36')][_0xf44f('0x61')]({'where':{'id':_0x1dedff['params']['id']}})[_0xf44f('0x27')](handleEntityNotFound(_0x5a8aa1,null))[_0xf44f('0x27')](function(_0x1d4a85){if(_0x1d4a85){_0x1c624d=_0x1d4a85;_0x3138f5['model']=_[_0xf44f('0x3b')](db['UserVoiceQueueRt'][_0xf44f('0x37')]);_0x3138f5[_0xf44f('0x3a')]=_[_0xf44f('0x3b')](_0x1dedff['query']);_0x3138f5[_0xf44f('0x3c')]=_[_0xf44f('0x3d')](_0x3138f5[_0xf44f('0x39')],_0x3138f5[_0xf44f('0x3a')]);_0x3752bb[_0xf44f('0x3e')]=_[_0xf44f('0x3d')](_0x3138f5['model'],qs['fields'](_0x1dedff[_0xf44f('0x3a')][_0xf44f('0x3f')]));_0x3752bb[_0xf44f('0x3e')]=_0x3752bb[_0xf44f('0x3e')][_0xf44f('0x40')]?_0x3752bb['attributes']:_0x3138f5[_0xf44f('0x39')];_0x3752bb[_0xf44f('0x43')]=qs[_0xf44f('0x44')](_0x1dedff[_0xf44f('0x3a')][_0xf44f('0x44')]);_0x3752bb[_0xf44f('0x45')]=qs[_0xf44f('0x3c')](_[_0xf44f('0x63')](_0x1dedff[_0xf44f('0x3a')],_0x3138f5[_0xf44f('0x3c')]));if(_0x1dedff[_0xf44f('0x3a')]['filter']){_0x3752bb[_0xf44f('0x45')]=_[_0xf44f('0x48')](_0x3752bb[_0xf44f('0x45')],{'$or':_[_0xf44f('0x2e')](_0x3752bb[_0xf44f('0x3e')],function(_0x247c2d){var _0x3ffde2={};_0x3ffde2[_0x247c2d]={'$like':'%'+_0x1dedff[_0xf44f('0x3a')][_0xf44f('0x47')]+'%'};return _0x3ffde2;})});}_0x3752bb=_[_0xf44f('0x48')]({},_0x3752bb,_0x1dedff[_0xf44f('0x49')]);return _0x1c624d[_0xf44f('0x9b')](_0x3752bb);}})[_0xf44f('0x27')](function(_0x46f2a2){if(_0x46f2a2){_0x27fbc7=_0x46f2a2[_0xf44f('0x40')];if(!_0x1dedff[_0xf44f('0x3a')][_0xf44f('0x41')](_0xf44f('0x42'))){_0x3752bb['limit']=qs['limit'](_0x1dedff['query'][_0xf44f('0x22')]);_0x3752bb[_0xf44f('0x21')]=qs[_0xf44f('0x21')](_0x1dedff[_0xf44f('0x3a')][_0xf44f('0x21')]);}return _0x1c624d[_0xf44f('0x9b')](_0x3752bb);}})['then'](function(_0x596645){return _0x596645?{'count':_0x27fbc7,'rows':_0x596645}:null;})['then'](respondWithResult(_0x5a8aa1,null))[_0xf44f('0x4e')](handleError(_0x5a8aa1,null));};exports[_0xf44f('0x9c')]=function(_0x49fd88,_0x176df3,_0x16eb9d){var _0x5de271={};var _0x3c9e35={};var _0x4378cc;var _0x25aa44;return db['VoiceQueue'][_0xf44f('0x61')]({'where':{'id':_0x49fd88[_0xf44f('0x59')]['id']}})[_0xf44f('0x27')](handleEntityNotFound(_0x176df3,null))[_0xf44f('0x27')](function(_0x507f5e){if(_0x507f5e){_0x4378cc=_0x507f5e;_0x3c9e35[_0xf44f('0x39')]=_['keys'](db[_0xf44f('0x9d')][_0xf44f('0x37')]);_0x3c9e35[_0xf44f('0x3a')]=_[_0xf44f('0x3b')](_0x49fd88[_0xf44f('0x3a')]);_0x3c9e35['filters']=_[_0xf44f('0x3d')](_0x3c9e35[_0xf44f('0x39')],_0x3c9e35['query']);_0x5de271[_0xf44f('0x3e')]=_[_0xf44f('0x3d')](_0x3c9e35[_0xf44f('0x39')],qs[_0xf44f('0x3f')](_0x49fd88[_0xf44f('0x3a')][_0xf44f('0x3f')]));_0x5de271['attributes']=_0x5de271[_0xf44f('0x3e')][_0xf44f('0x40')]?_0x5de271[_0xf44f('0x3e')]:_0x3c9e35[_0xf44f('0x39')];_0x5de271[_0xf44f('0x43')]=qs['sort'](_0x49fd88['query'][_0xf44f('0x44')]);_0x5de271[_0xf44f('0x45')]=qs[_0xf44f('0x3c')](_[_0xf44f('0x63')](_0x49fd88[_0xf44f('0x3a')],_0x3c9e35[_0xf44f('0x3c')]));if(_0x49fd88[_0xf44f('0x3a')]['filter']){_0x5de271[_0xf44f('0x45')]=_[_0xf44f('0x48')](_0x5de271[_0xf44f('0x45')],{'$or':_['map'](_0x5de271['attributes'],function(_0x30c54d){var _0x2d9843={};_0x2d9843[_0x30c54d]={'$like':'%'+_0x49fd88['query'][_0xf44f('0x47')]+'%'};return _0x2d9843;})});}_0x5de271=_['merge']({},_0x5de271,_0x49fd88['options']);return _0x4378cc[_0xf44f('0x9c')](_0x5de271);}})['then'](function(_0x3da60a){if(_0x3da60a){_0x25aa44=_0x3da60a[_0xf44f('0x40')];if(!_0x49fd88[_0xf44f('0x3a')][_0xf44f('0x41')](_0xf44f('0x42'))){_0x5de271[_0xf44f('0x22')]=qs[_0xf44f('0x22')](_0x49fd88[_0xf44f('0x3a')][_0xf44f('0x22')]);_0x5de271['offset']=qs['offset'](_0x49fd88[_0xf44f('0x3a')][_0xf44f('0x21')]);}return _0x4378cc[_0xf44f('0x9c')](_0x5de271);}})[_0xf44f('0x27')](function(_0x81bf3d){if(_0x81bf3d){return _0x81bf3d?{'count':_0x25aa44,'rows':_0x81bf3d}:null;}})['then'](respondWithResult(_0x176df3,null))['catch'](handleError(_0x176df3,null));};exports[_0xf44f('0x9e')]=function(_0x186224,_0x585795,_0x3aa745){var _0x3b9903=moment()[_0xf44f('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');var _0xd54193,_0x11de19;return db['VoiceQueue'][_0xf44f('0x31')]({'where':{'id':_0x186224[_0xf44f('0x59')]['id']}})[_0xf44f('0x27')](handleEntityNotFound(_0x585795,null))[_0xf44f('0x27')](function(_0x196342){if(_0x196342){_0x11de19=_0x196342;return _0x196342[_0xf44f('0x9e')](_0x186224[_0xf44f('0x50')][_0xf44f('0x82')],_['omit'](_0x186224['body'],[_0xf44f('0x82'),'id'])||{});}return null;})[_0xf44f('0x95')](function(_0x1af29b){var _0x422300;_0xd54193=_0x1af29b||[];var _0x19b0b0=[];if(_0x1af29b){for(var _0xc2ef5b=0x0;_0xc2ef5b<_0x1af29b[_0xf44f('0x40')];_0xc2ef5b+=0x1){var _0x1d394f=_0x1af29b[_0xc2ef5b][_0xf44f('0x29')]({'plain':!![]});_0x11de19[_0xf44f('0x9f')]=_0x186224[_0xf44f('0x50')]['dialCheckDuplicateType']?_0x186224[_0xf44f('0x50')][_0xf44f('0x9f')]:_0x11de19['dialCheckDuplicateType'];switch(_0x11de19['dialCheckDuplicateType']){case _0xf44f('0xa0'):_0x422300=squel[_0xf44f('0xa1')]()['into'](_0xf44f('0xa2'))[_0xf44f('0xa3')]([_0xf44f('0xa4'),_0xf44f('0xa5'),_0xf44f('0xa6'),_0xf44f('0xa7'),_0xf44f('0x64'),_0xf44f('0x5c'),_0xf44f('0x5a')],squel[_0xf44f('0x83')]()[_0xf44f('0xa8')]('phone','phone')[_0xf44f('0xa8')]('\x27'+_0x3b9903+'\x27',_0xf44f('0xa5'))[_0xf44f('0xa8')]('id',_0xf44f('0xa6'))[_0xf44f('0xa8')](_0x1d394f[_0xf44f('0xa9')][_0xf44f('0x8c')](),_0xf44f('0xa7'))['field'](_0x186224['params']['id']['toString'](),_0xf44f('0x64'))[_0xf44f('0xa8')]('\x27'+_0x3b9903+'\x27',_0xf44f('0x5c'))[_0xf44f('0xa8')]('\x27'+_0x3b9903+'\x27','updatedAt')[_0xf44f('0x85')]('cm_contacts')[_0xf44f('0x45')](_0xf44f('0xaa'))[_0xf44f('0x45')](_0xf44f('0xab'),_0x1d394f['CmListId'][_0xf44f('0x8c')]())[_0xf44f('0x45')](_0xf44f('0xac'))[_0xf44f('0x45')](_0xf44f('0xad'),squel['select']()[_0xf44f('0xa8')](_0xf44f('0xae'))['from']('cm_hopper_final')[_0xf44f('0x45')](_0xf44f('0x89'),_0x186224['params']['id'][_0xf44f('0x8c')]()))[_0xf44f('0x45')](_0xf44f('0xad'),squel['select']()[_0xf44f('0xa8')](_0xf44f('0xaf'))[_0xf44f('0x85')]('cm_hopper')[_0xf44f('0x45')](_0xf44f('0x89'),_0x186224[_0xf44f('0x59')]['id']['toString']())))[_0xf44f('0x8c')]();break;case _0xf44f('0xb0'):_0x422300=squel['insert']()[_0xf44f('0xb1')]('cm_hopper')[_0xf44f('0xa3')]([_0xf44f('0xa4'),_0xf44f('0xa5'),_0xf44f('0xa6'),'ListId','VoiceQueueId',_0xf44f('0x5c'),'updatedAt'],squel['select']()[_0xf44f('0xa8')](_0xf44f('0xa4'),'phone')['field']('\x27'+_0x3b9903+'\x27',_0xf44f('0xa5'))[_0xf44f('0xa8')]('id','ContactId')[_0xf44f('0xa8')](_0x1d394f['CmListId'][_0xf44f('0x8c')](),_0xf44f('0xa7'))[_0xf44f('0xa8')](_0x186224[_0xf44f('0x59')]['id']['toString'](),_0xf44f('0x64'))[_0xf44f('0xa8')]('\x27'+_0x3b9903+'\x27',_0xf44f('0x5c'))[_0xf44f('0xa8')]('\x27'+_0x3b9903+'\x27',_0xf44f('0x5a'))[_0xf44f('0x85')]('cm_contacts')['where'](_0xf44f('0xaa'))[_0xf44f('0x45')](_0xf44f('0xab'),_0x1d394f[_0xf44f('0xa9')][_0xf44f('0x8c')]())[_0xf44f('0x45')](_0xf44f('0xac'))[_0xf44f('0x45')](_0xf44f('0xad'),squel['select']()['field'](_0xf44f('0xaf'))[_0xf44f('0x85')]('cm_hopper')[_0xf44f('0x45')](_0xf44f('0x89'),_0x186224[_0xf44f('0x59')]['id']['toString']())))[_0xf44f('0x8c')]();break;default:_0x422300=squel[_0xf44f('0xa1')]()[_0xf44f('0xb1')]('cm_hopper')['fromQuery']([_0xf44f('0xa4'),_0xf44f('0xa5'),_0xf44f('0xa6'),_0xf44f('0xa7'),_0xf44f('0x64'),_0xf44f('0x5c'),_0xf44f('0x5a')],squel[_0xf44f('0x83')]()[_0xf44f('0xa8')](_0xf44f('0xa4'),_0xf44f('0xa4'))['field']('\x27'+_0x3b9903+'\x27',_0xf44f('0xa5'))['field']('id',_0xf44f('0xa6'))[_0xf44f('0xa8')](_0x1d394f[_0xf44f('0xa9')]['toString'](),_0xf44f('0xa7'))[_0xf44f('0xa8')](_0x186224[_0xf44f('0x59')]['id'][_0xf44f('0x8c')](),'VoiceQueueId')[_0xf44f('0xa8')]('\x27'+_0x3b9903+'\x27','createdAt')[_0xf44f('0xa8')]('\x27'+_0x3b9903+'\x27','updatedAt')[_0xf44f('0x85')](_0xf44f('0xb2'))[_0xf44f('0x45')]('deletedAt\x20IS\x20NULL')[_0xf44f('0x45')](_0xf44f('0xab'),_0x1d394f['CmListId'][_0xf44f('0x8c')]())[_0xf44f('0x45')](_0xf44f('0xac')))['toString']();}_0x19b0b0[_0xf44f('0x8b')](db[_0xf44f('0x74')][_0xf44f('0x3a')](_0x422300));}return BPromise[_0xf44f('0x97')](_0x19b0b0);}})['then'](function(){var _0x4c032e=[];var _0xd602ed=squel[_0xf44f('0xa1')]()[_0xf44f('0xb1')](_0xf44f('0xb3'))[_0xf44f('0xa3')](['CmHopperId',_0xf44f('0xa4'),'OrderBy','createdAt',_0xf44f('0x5a')],squel[_0xf44f('0x83')]()['field'](_0xf44f('0xb4'))[_0xf44f('0xa8')]('ci.item')[_0xf44f('0xa8')](_0xf44f('0xb5'))['field']('\x27'+_0x3b9903+'\x27',_0xf44f('0x5c'))[_0xf44f('0xa8')]('\x27'+_0x3b9903+'\x27',_0xf44f('0x5a'))[_0xf44f('0x85')](_0xf44f('0xb6'),'ci')[_0xf44f('0xb7')](_0xf44f('0xa2'),'h','h.ContactId=ci.CmContactId')[_0xf44f('0x45')](_0xf44f('0xb8'),_0x3b9903)[_0xf44f('0x45')](_0xf44f('0xb9'),'PHONE'))[_0xf44f('0x8c')]();_0x4c032e[_0xf44f('0x8b')](db[_0xf44f('0x74')][_0xf44f('0x3a')](_0xd602ed));return BPromise[_0xf44f('0x97')](_0x4c032e);})[_0xf44f('0x27')](function(){return _0xd54193;})[_0xf44f('0x27')](respondWithResult(_0x585795,null))['catch'](handleError(_0x585795,null));};exports[_0xf44f('0xba')]=function(_0x648c82,_0x26f809,_0x17fae4){return db[_0xf44f('0x36')][_0xf44f('0x31')]({'where':{'id':_0x648c82['params']['id']}})[_0xf44f('0x27')](handleEntityNotFound(_0x26f809,null))[_0xf44f('0x27')](function(_0x42e7c2){if(_0x42e7c2){return _0x42e7c2[_0xf44f('0xba')](_0x648c82[_0xf44f('0x3a')][_0xf44f('0x82')]);}})[_0xf44f('0x27')](function(_0x44f2ce){if(_0x44f2ce){return db[_0xf44f('0x62')][_0xf44f('0x28')]({'where':{'ListId':_0x648c82[_0xf44f('0x3a')][_0xf44f('0x82')],'VoiceQueueId':_0x648c82[_0xf44f('0x59')]['id']}})['then'](function(){return _0x44f2ce;});}})[_0xf44f('0x27')](respondWithStatusCode(_0x26f809,null))['catch'](handleError(_0x26f809,null));};exports[_0xf44f('0xbb')]=function(_0x54d5e7,_0x114ab8,_0x4733cc){var _0x1ed450={};var _0x4c1488={};var _0x432e96;var _0x113ecb;return db[_0xf44f('0x36')]['findOne']({'where':{'id':_0x54d5e7[_0xf44f('0x59')]['id']}})[_0xf44f('0x27')](handleEntityNotFound(_0x114ab8,null))['then'](function(_0x2463b1){if(_0x2463b1){_0x432e96=_0x2463b1;_0x4c1488[_0xf44f('0x39')]=_[_0xf44f('0x3b')](db[_0xf44f('0x9d')][_0xf44f('0x37')]);_0x4c1488[_0xf44f('0x3a')]=_[_0xf44f('0x3b')](_0x54d5e7[_0xf44f('0x3a')]);_0x4c1488[_0xf44f('0x3c')]=_[_0xf44f('0x3d')](_0x4c1488[_0xf44f('0x39')],_0x4c1488[_0xf44f('0x3a')]);_0x1ed450['attributes']=_[_0xf44f('0x3d')](_0x4c1488[_0xf44f('0x39')],qs[_0xf44f('0x3f')](_0x54d5e7[_0xf44f('0x3a')]['fields']));_0x1ed450[_0xf44f('0x3e')]=_0x1ed450[_0xf44f('0x3e')]['length']?_0x1ed450[_0xf44f('0x3e')]:_0x4c1488[_0xf44f('0x39')];_0x1ed450[_0xf44f('0x43')]=qs[_0xf44f('0x44')](_0x54d5e7[_0xf44f('0x3a')]['sort']);_0x1ed450[_0xf44f('0x45')]=qs[_0xf44f('0x3c')](_[_0xf44f('0x63')](_0x54d5e7[_0xf44f('0x3a')],_0x4c1488[_0xf44f('0x3c')]));if(_0x54d5e7[_0xf44f('0x3a')][_0xf44f('0x47')]){_0x1ed450['where']=_[_0xf44f('0x48')](_0x1ed450[_0xf44f('0x45')],{'$or':_[_0xf44f('0x2e')](_0x1ed450[_0xf44f('0x3e')],function(_0x56bdcf){var _0x1389e4={};_0x1389e4[_0x56bdcf]={'$like':'%'+_0x54d5e7[_0xf44f('0x3a')][_0xf44f('0x47')]+'%'};return _0x1389e4;})});}_0x1ed450=_['merge']({},_0x1ed450,_0x54d5e7[_0xf44f('0x49')]);return _0x432e96[_0xf44f('0xbb')](_0x1ed450);}})['then'](function(_0x5df2d5){if(_0x5df2d5){_0x113ecb=_0x5df2d5[_0xf44f('0x40')];if(!_0x54d5e7[_0xf44f('0x3a')][_0xf44f('0x41')](_0xf44f('0x42'))){_0x1ed450['limit']=qs[_0xf44f('0x22')](_0x54d5e7[_0xf44f('0x3a')][_0xf44f('0x22')]);_0x1ed450[_0xf44f('0x21')]=qs[_0xf44f('0x21')](_0x54d5e7[_0xf44f('0x3a')][_0xf44f('0x21')]);}return _0x432e96[_0xf44f('0xbb')](_0x1ed450);}})[_0xf44f('0x27')](function(_0x3d0964){if(_0x3d0964){return _0x3d0964?{'count':_0x113ecb,'rows':_0x3d0964}:null;}})[_0xf44f('0x27')](respondWithResult(_0x114ab8,null))['catch'](handleError(_0x114ab8,null));};exports[_0xf44f('0xbc')]=function(_0x1789fb,_0x2eb5e5,_0x963d86){var _0x1647db,_0x57bd5a;return db['VoiceQueue'][_0xf44f('0x31')]({'where':{'id':_0x1789fb[_0xf44f('0x59')]['id']}})[_0xf44f('0x27')](handleEntityNotFound(_0x2eb5e5,null))['then'](function(_0x1319d3){if(_0x1319d3){_0x57bd5a=_0x1319d3;return _0x1319d3[_0xf44f('0xbc')](_0x1789fb[_0xf44f('0x50')][_0xf44f('0x82')],_[_0xf44f('0x5b')](_0x1789fb[_0xf44f('0x50')],[_0xf44f('0x82'),'id'])||{});}return null;})[_0xf44f('0x95')](function(_0xe00df8){var _0x4aa7f6;_0x1647db=_0xe00df8||[];var _0x318c42=[];if(_0xe00df8){for(var _0x327514=0x0;_0x327514<_0xe00df8[_0xf44f('0x40')];_0x327514+=0x1){var _0x376d8d=_0xe00df8[_0x327514][_0xf44f('0x29')]({'plain':!![]});_0x4aa7f6=squel[_0xf44f('0xa1')]()[_0xf44f('0xb1')](_0xf44f('0xbd'))[_0xf44f('0xa3')]([_0xf44f('0xa4'),_0xf44f('0xa6'),_0xf44f('0xa7'),_0xf44f('0x64'),'createdAt','updatedAt'],squel[_0xf44f('0x83')]()[_0xf44f('0xa8')](_0xf44f('0xa4'),_0xf44f('0xa4'))[_0xf44f('0xa8')]('id',_0xf44f('0xa6'))['field'](_0x376d8d[_0xf44f('0xa9')][_0xf44f('0x8c')](),_0xf44f('0xa7'))[_0xf44f('0xa8')](_0x1789fb['params']['id'][_0xf44f('0x8c')](),_0xf44f('0x64'))[_0xf44f('0xa8')](_0xf44f('0xbe'),'createdAt')['field']('NOW()',_0xf44f('0x5a'))[_0xf44f('0x85')](_0xf44f('0xb2'))[_0xf44f('0x45')]('deletedAt\x20IS\x20NULL')[_0xf44f('0x45')](_0xf44f('0xab'),_0x376d8d[_0xf44f('0xa9')][_0xf44f('0x8c')]())[_0xf44f('0x45')](_0xf44f('0xac')))['toString']();_0x318c42['push'](db[_0xf44f('0x74')][_0xf44f('0x3a')](_0x4aa7f6));}return BPromise[_0xf44f('0x97')](_0x318c42);}})[_0xf44f('0x27')](function(){return _0x1647db;})[_0xf44f('0x27')](respondWithResult(_0x2eb5e5,null))[_0xf44f('0x4e')](handleError(_0x2eb5e5,null));};exports[_0xf44f('0xbf')]=function(_0x10bf1a,_0x1044dc,_0x5e0ae5){return db[_0xf44f('0x36')][_0xf44f('0x31')]({'where':{'id':_0x10bf1a[_0xf44f('0x59')]['id']}})[_0xf44f('0x27')](handleEntityNotFound(_0x1044dc,null))[_0xf44f('0x27')](function(_0x771dba){if(_0x771dba){return _0x771dba[_0xf44f('0xbf')](_0x10bf1a[_0xf44f('0x3a')]['ids']);}})[_0xf44f('0x27')](function(_0x408591){if(_0x408591){return db[_0xf44f('0x6a')]['destroy']({'where':{'ListId':_0x10bf1a[_0xf44f('0x3a')][_0xf44f('0x82')],'VoiceQueueId':_0x10bf1a[_0xf44f('0x59')]['id']}})['then'](function(){return _0x408591;});}})['then'](respondWithStatusCode(_0x1044dc,null))['catch'](handleError(_0x1044dc,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 32532ed..ff1ee1a 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 _0xeeba=['save','remove','hook','events','../../mysqldb','setMaxListeners'];(function(_0x5ecb16,_0x50f82b){var _0x279060=function(_0x3998be){while(--_0x3998be){_0x5ecb16['push'](_0x5ecb16['shift']());}};_0x279060(++_0x50f82b);}(_0xeeba,0x129));var _0xaeeb=function(_0x311392,_0x1a26d5){_0x311392=_0x311392-0x0;var _0x281f2a=_0xeeba[_0x311392];return _0x281f2a;};'use strict';var EventEmitter=require(_0xaeeb('0x0'));var VoiceQueue=require(_0xaeeb('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xaeeb('0x2')](0x0);var events={'afterCreate':_0xaeeb('0x3'),'afterUpdate':'update','afterDestroy':_0xaeeb('0x4')};function emitEvent(_0x4b8667){return function(_0x1d0f51,_0x472776,_0x161ef5){VoiceQueueEvents['emit'](_0x4b8667+':'+_0x1d0f51['id'],_0x1d0f51);VoiceQueueEvents['emit'](_0x4b8667,_0x1d0f51);_0x161ef5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xaeeb('0x5')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0xc541=['../../mysqldb','VoiceQueue','setMaxListeners','save','exports'];(function(_0x37bda0,_0xc16dd8){var _0x2e56b6=function(_0x858578){while(--_0x858578){_0x37bda0['push'](_0x37bda0['shift']());}};_0x2e56b6(++_0xc16dd8);}(_0xc541,0x6e));var _0x1c54=function(_0x23b57c,_0xdc7f98){_0x23b57c=_0x23b57c-0x0;var _0x4c3b1d=_0xc541[_0x23b57c];return _0x4c3b1d;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x1c54('0x0'))['db'][_0x1c54('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x1c54('0x2')](0x0);var events={'afterCreate':_0x1c54('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x152d41){return function(_0x5d4b5b,_0x1aa4e9,_0x44e569){VoiceQueueEvents['emit'](_0x152d41+':'+_0x5d4b5b['id'],_0x5d4b5b);VoiceQueueEvents['emit'](_0x152d41,_0x5d4b5b);_0x44e569(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x1c54('0x4')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index d0f44f1..63dff97 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 _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x6f3151,_0x406745){var _0x305fb8=function(_0x24e5a8){while(--_0x24e5a8){_0x6f3151['push'](_0x6f3151['shift']());}};_0x305fb8(++_0x406745);}(_0x70e0,0x17b));var _0x070e=function(_0x54f277,_0x399e54){_0x54f277=_0x54f277-0x0;var _0x32c530=_0x70e0[_0x54f277];return _0x32c530;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x338df3,_0x33803a){var _0x19d71a=function(_0x4bf78f){while(--_0x4bf78f){_0x338df3['push'](_0x338df3['shift']());}};_0x19d71a(++_0x33803a);}(_0x34e8,0x12c));var _0x834e=function(_0x50a6e0,_0x3dda64){_0x50a6e0=_0x50a6e0-0x0;var _0x203263=_0x34e8[_0x50a6e0];return _0x203263;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 7198615..d1460aa 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 _0xc637=['model','then','debug','catch','find','ShowVoiceQueue','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voiceQueue.socket','register','request','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x3a9584,_0x529fc2){var _0x3c8a84=function(_0x591764){while(--_0x591764){_0x3a9584['push'](_0x3a9584['shift']());}};_0x3c8a84(++_0x529fc2);}(_0xc637,0x1d4));var _0x7c63=function(_0x48b12f,_0x281609){_0x48b12f=_0x48b12f-0x0;var _0x4f455e=_0xc637[_0x48b12f];return _0x4f455e;};'use strict';var _=require(_0x7c63('0x0'));var util=require('util');var moment=require(_0x7c63('0x1'));var BPromise=require(_0x7c63('0x2'));var rs=require(_0x7c63('0x3'));var fs=require('fs');var Redis=require(_0x7c63('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7c63('0x5'));var logger=require('../../config/logger')(_0x7c63('0x6'));var config=require(_0x7c63('0x7'));var jayson=require(_0x7c63('0x8'));var client=jayson[_0x7c63('0x9')][_0x7c63('0xa')]({'port':0x232a});config[_0x7c63('0xb')]=_[_0x7c63('0xc')](config['redis'],{'host':_0x7c63('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7c63('0xb')]));require(_0x7c63('0xe'))[_0x7c63('0xf')](socket);function respondWithRpcPromise(_0x52d290,_0x4df092,_0x3cf448){return new BPromise(function(_0x1f0d98,_0x328d26){return client[_0x7c63('0x10')](_0x52d290,_0x3cf448)['then'](function(_0x7d18dd){logger[_0x7c63('0x11')](_0x7c63('0x12'),_0x4df092,_0x7c63('0x13'));logger['debug'](_0x7c63('0x14'),_0x4df092,_0x7c63('0x13'),JSON[_0x7c63('0x15')](_0x7d18dd));if(_0x7d18dd[_0x7c63('0x16')]){if(_0x7d18dd[_0x7c63('0x16')][_0x7c63('0x17')]===0x1f4){logger[_0x7c63('0x16')](_0x7c63('0x12'),_0x4df092,_0x7d18dd[_0x7c63('0x16')]['message']);return _0x328d26(_0x7d18dd[_0x7c63('0x16')][_0x7c63('0x18')]);}logger[_0x7c63('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x4df092,_0x7d18dd['error'][_0x7c63('0x18')]);return _0x1f0d98(_0x7d18dd[_0x7c63('0x16')][_0x7c63('0x18')]);}else{logger['info'](_0x7c63('0x12'),_0x4df092,_0x7c63('0x13'));_0x1f0d98(_0x7d18dd[_0x7c63('0x19')][_0x7c63('0x18')]);}})['catch'](function(_0x5a7e18){logger[_0x7c63('0x16')](_0x7c63('0x12'),_0x4df092,_0x5a7e18);_0x328d26(_0x5a7e18);});});}exports[_0x7c63('0x1a')]=function(_0x5769c5){var _0x26c56f=this;return new Promise(function(_0x10b1c,_0x41cfa9){return db[_0x7c63('0x1b')][_0x7c63('0x1c')]({'raw':_0x5769c5['options']?_0x5769c5[_0x7c63('0x1d')][_0x7c63('0x1e')]===undefined?!![]:![]:!![],'where':_0x5769c5[_0x7c63('0x1d')]?_0x5769c5[_0x7c63('0x1d')][_0x7c63('0x1f')]||null:null,'attributes':_0x5769c5[_0x7c63('0x1d')]?_0x5769c5[_0x7c63('0x1d')][_0x7c63('0x20')]||null:null,'limit':_0x5769c5[_0x7c63('0x1d')]?_0x5769c5['options'][_0x7c63('0x21')]||null:null,'include':_0x5769c5[_0x7c63('0x1d')]?_0x5769c5['options'][_0x7c63('0x22')]?_[_0x7c63('0x23')](_0x5769c5['options'][_0x7c63('0x22')],function(_0x2729aa){return{'model':db[_0x2729aa[_0x7c63('0x24')]],'as':_0x2729aa['as'],'attributes':_0x2729aa['attributes'],'include':_0x2729aa['include']?_['map'](_0x2729aa[_0x7c63('0x22')],function(_0x3924e7){return{'model':db[_0x3924e7['model']],'as':_0x3924e7['as'],'attributes':_0x3924e7[_0x7c63('0x20')],'include':_0x3924e7['include']?_[_0x7c63('0x23')](_0x3924e7['include'],function(_0x20b7b5){return{'model':db[_0x20b7b5[_0x7c63('0x24')]],'as':_0x20b7b5['as'],'attributes':_0x20b7b5['attributes']};}):[]};}):[]};}):[]:[]})[_0x7c63('0x25')](function(_0x429567){logger[_0x7c63('0x11')](_0x7c63('0x1a'),_0x5769c5);logger[_0x7c63('0x26')](_0x7c63('0x1a'),_0x5769c5,JSON[_0x7c63('0x15')](_0x429567));_0x10b1c(_0x429567);})[_0x7c63('0x27')](function(_0x5194db){logger['error'](_0x7c63('0x1a'),_0x5194db[_0x7c63('0x18')],_0x5769c5);_0x41cfa9(_0x26c56f[_0x7c63('0x16')](0x1f4,_0x5194db[_0x7c63('0x18')]));});});};exports['ShowVoiceQueue']=function(_0xd38d60){var _0x31fc2a=this;return new Promise(function(_0x585997,_0x56141f){return db[_0x7c63('0x1b')][_0x7c63('0x28')]({'raw':_0xd38d60[_0x7c63('0x1d')]?_0xd38d60[_0x7c63('0x1d')][_0x7c63('0x1e')]===undefined?!![]:![]:!![],'where':_0xd38d60[_0x7c63('0x1d')]?_0xd38d60['options']['where']||null:null,'attributes':_0xd38d60[_0x7c63('0x1d')]?_0xd38d60[_0x7c63('0x1d')]['attributes']||null:null,'include':_0xd38d60[_0x7c63('0x1d')]?_0xd38d60[_0x7c63('0x1d')][_0x7c63('0x22')]?_['map'](_0xd38d60[_0x7c63('0x1d')][_0x7c63('0x22')],function(_0x597e6c){return{'model':db[_0x597e6c['model']],'as':_0x597e6c['as'],'attributes':_0x597e6c[_0x7c63('0x20')],'include':_0x597e6c[_0x7c63('0x22')]?_['map'](_0x597e6c[_0x7c63('0x22')],function(_0x4a9546){return{'model':db[_0x4a9546['model']],'as':_0x4a9546['as'],'attributes':_0x4a9546[_0x7c63('0x20')],'include':_0x4a9546['include']?_['map'](_0x4a9546[_0x7c63('0x22')],function(_0x35b11e){return{'model':db[_0x35b11e[_0x7c63('0x24')]],'as':_0x35b11e['as'],'attributes':_0x35b11e[_0x7c63('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x339097){logger[_0x7c63('0x11')](_0x7c63('0x29'),_0xd38d60);logger['debug'](_0x7c63('0x29'),_0xd38d60,JSON['stringify'](_0x339097));_0x585997(_0x339097);})['catch'](function(_0xf9b939){logger[_0x7c63('0x16')](_0x7c63('0x29'),_0xf9b939[_0x7c63('0x18')],_0xd38d60);_0x56141f(_0x31fc2a['error'](0x1f4,_0xf9b939[_0x7c63('0x18')]));});});}; \ No newline at end of file +var _0xd12a=['debug','ShowVoiceQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','http','defaults','localhost','register','request','request\x20sent','stringify','error','VoiceQueue,\x20%s,\x20%s','message','info','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','include','map','model','attributes','then'];(function(_0x3ab599,_0xd7bb57){var _0x44874a=function(_0x350082){while(--_0x350082){_0x3ab599['push'](_0x3ab599['shift']());}};_0x44874a(++_0xd7bb57);}(_0xd12a,0x19b));var _0xad12=function(_0x12670a,_0x3f8b09){_0x12670a=_0x12670a-0x0;var _0x20f572=_0xd12a[_0x12670a];return _0x20f572;};'use strict';var _=require(_0xad12('0x0'));var util=require(_0xad12('0x1'));var moment=require(_0xad12('0x2'));var BPromise=require(_0xad12('0x3'));var rs=require(_0xad12('0x4'));var fs=require('fs');var Redis=require(_0xad12('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xad12('0x6'));var logger=require('../../config/logger')(_0xad12('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xad12('0x8')]({'port':0x232a});config['redis']=_[_0xad12('0x9')](config['redis'],{'host':_0xad12('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceQueue.socket')[_0xad12('0xb')](socket);function respondWithRpcPromise(_0x2ffd17,_0x24b0a3,_0x183d90){return new BPromise(function(_0x2b4677,_0x1a21ce){return client[_0xad12('0xc')](_0x2ffd17,_0x183d90)['then'](function(_0x4d2124){logger['info']('VoiceQueue,\x20%s,\x20%s',_0x24b0a3,_0xad12('0xd'));logger['debug']('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x24b0a3,_0xad12('0xd'),JSON[_0xad12('0xe')](_0x4d2124));if(_0x4d2124[_0xad12('0xf')]){if(_0x4d2124[_0xad12('0xf')]['code']===0x1f4){logger[_0xad12('0xf')](_0xad12('0x10'),_0x24b0a3,_0x4d2124[_0xad12('0xf')][_0xad12('0x11')]);return _0x1a21ce(_0x4d2124[_0xad12('0xf')]['message']);}logger[_0xad12('0xf')](_0xad12('0x10'),_0x24b0a3,_0x4d2124[_0xad12('0xf')][_0xad12('0x11')]);return _0x2b4677(_0x4d2124['error'][_0xad12('0x11')]);}else{logger[_0xad12('0x12')]('VoiceQueue,\x20%s,\x20%s',_0x24b0a3,_0xad12('0xd'));_0x2b4677(_0x4d2124[_0xad12('0x13')][_0xad12('0x11')]);}})[_0xad12('0x14')](function(_0x56cb){logger['error'](_0xad12('0x10'),_0x24b0a3,_0x56cb);_0x1a21ce(_0x56cb);});});}exports[_0xad12('0x15')]=function(_0x4113a3){var _0x51efb3=this;return new Promise(function(_0x326b42,_0x380f4d){return db[_0xad12('0x16')][_0xad12('0x17')]({'raw':_0x4113a3[_0xad12('0x18')]?_0x4113a3[_0xad12('0x18')][_0xad12('0x19')]===undefined?!![]:![]:!![],'where':_0x4113a3[_0xad12('0x18')]?_0x4113a3[_0xad12('0x18')]['where']||null:null,'attributes':_0x4113a3[_0xad12('0x18')]?_0x4113a3[_0xad12('0x18')]['attributes']||null:null,'limit':_0x4113a3['options']?_0x4113a3[_0xad12('0x18')]['limit']||null:null,'include':_0x4113a3[_0xad12('0x18')]?_0x4113a3[_0xad12('0x18')][_0xad12('0x1a')]?_[_0xad12('0x1b')](_0x4113a3[_0xad12('0x18')][_0xad12('0x1a')],function(_0x29c349){return{'model':db[_0x29c349[_0xad12('0x1c')]],'as':_0x29c349['as'],'attributes':_0x29c349[_0xad12('0x1d')],'include':_0x29c349[_0xad12('0x1a')]?_[_0xad12('0x1b')](_0x29c349[_0xad12('0x1a')],function(_0x5c0b84){return{'model':db[_0x5c0b84[_0xad12('0x1c')]],'as':_0x5c0b84['as'],'attributes':_0x5c0b84['attributes'],'include':_0x5c0b84[_0xad12('0x1a')]?_[_0xad12('0x1b')](_0x5c0b84['include'],function(_0x250c73){return{'model':db[_0x250c73['model']],'as':_0x250c73['as'],'attributes':_0x250c73[_0xad12('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xad12('0x1e')](function(_0x403e8b){logger[_0xad12('0x12')](_0xad12('0x15'),_0x4113a3);logger[_0xad12('0x1f')](_0xad12('0x15'),_0x4113a3,JSON[_0xad12('0xe')](_0x403e8b));_0x326b42(_0x403e8b);})['catch'](function(_0x4f409f){logger[_0xad12('0xf')](_0xad12('0x15'),_0x4f409f[_0xad12('0x11')],_0x4113a3);_0x380f4d(_0x51efb3['error'](0x1f4,_0x4f409f[_0xad12('0x11')]));});});};exports[_0xad12('0x20')]=function(_0x2f40c6){var _0xec6972=this;return new Promise(function(_0x29526d,_0x1a43ba){return db['VoiceQueue'][_0xad12('0x21')]({'raw':_0x2f40c6['options']?_0x2f40c6[_0xad12('0x18')][_0xad12('0x19')]===undefined?!![]:![]:!![],'where':_0x2f40c6[_0xad12('0x18')]?_0x2f40c6['options']['where']||null:null,'attributes':_0x2f40c6[_0xad12('0x18')]?_0x2f40c6['options'][_0xad12('0x1d')]||null:null,'include':_0x2f40c6['options']?_0x2f40c6[_0xad12('0x18')][_0xad12('0x1a')]?_['map'](_0x2f40c6[_0xad12('0x18')][_0xad12('0x1a')],function(_0x5f0477){return{'model':db[_0x5f0477['model']],'as':_0x5f0477['as'],'attributes':_0x5f0477[_0xad12('0x1d')],'include':_0x5f0477[_0xad12('0x1a')]?_['map'](_0x5f0477[_0xad12('0x1a')],function(_0x5544a0){return{'model':db[_0x5544a0[_0xad12('0x1c')]],'as':_0x5544a0['as'],'attributes':_0x5544a0['attributes'],'include':_0x5544a0[_0xad12('0x1a')]?_[_0xad12('0x1b')](_0x5544a0[_0xad12('0x1a')],function(_0x423715){return{'model':db[_0x423715[_0xad12('0x1c')]],'as':_0x423715['as'],'attributes':_0x423715[_0xad12('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xad12('0x1e')](function(_0x1ac45b){logger[_0xad12('0x12')](_0xad12('0x20'),_0x2f40c6);logger[_0xad12('0x1f')](_0xad12('0x20'),_0x2f40c6,JSON[_0xad12('0xe')](_0x1ac45b));_0x29526d(_0x1ac45b);})['catch'](function(_0x351d6e){logger[_0xad12('0xf')](_0xad12('0x20'),_0x351d6e[_0xad12('0x11')],_0x2f40c6);_0x1a43ba(_0xec6972['error'](0x1f4,_0x351d6e['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 5463a6d..13657da 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 _0x825b=['save','remove','update','emit','removeListener','register','voiceQueue:','./voiceQueue.events'];(function(_0x16771d,_0x224c60){var _0x386f11=function(_0x3d7a87){while(--_0x3d7a87){_0x16771d['push'](_0x16771d['shift']());}};_0x386f11(++_0x224c60);}(_0x825b,0x177));var _0xb825=function(_0x1a595a,_0x263824){_0x1a595a=_0x1a595a-0x0;var _0x33f008=_0x825b[_0x1a595a];return _0x33f008;};'use strict';var VoiceQueueEvents=require(_0xb825('0x0'));var events=[_0xb825('0x1'),_0xb825('0x2'),_0xb825('0x3')];function createListener(_0x4a4b71,_0xda3d7c){return function(_0xc5fc9b){_0xda3d7c[_0xb825('0x4')](_0x4a4b71,_0xc5fc9b);};}function removeListener(_0x5878d8,_0x855c95){return function(){VoiceQueueEvents[_0xb825('0x5')](_0x5878d8,_0x855c95);};}exports[_0xb825('0x6')]=function(_0x107bb3){for(var _0x26f5ea=0x0,_0x343c76=events['length'];_0x26f5ea<_0x343c76;_0x26f5ea++){var _0x594251=events[_0x26f5ea];var _0x50f613=createListener(_0xb825('0x7')+_0x594251,_0x107bb3);VoiceQueueEvents['on'](_0x594251,_0x50f613);}}; \ No newline at end of file +var _0x22be=['./voiceQueue.events','save','update','emit','removeListener','register','length'];(function(_0x37f5a1,_0x461925){var _0x3a97a5=function(_0x11f158){while(--_0x11f158){_0x37f5a1['push'](_0x37f5a1['shift']());}};_0x3a97a5(++_0x461925);}(_0x22be,0x150));var _0xe22b=function(_0x16938f,_0x35e57f){_0x16938f=_0x16938f-0x0;var _0x5c66e9=_0x22be[_0x16938f];return _0x5c66e9;};'use strict';var VoiceQueueEvents=require(_0xe22b('0x0'));var events=[_0xe22b('0x1'),'remove',_0xe22b('0x2')];function createListener(_0xb2d152,_0x201d3d){return function(_0x20678e){_0x201d3d[_0xe22b('0x3')](_0xb2d152,_0x20678e);};}function removeListener(_0x365627,_0x44c207){return function(){VoiceQueueEvents[_0xe22b('0x4')](_0x365627,_0x44c207);};}exports[_0xe22b('0x5')]=function(_0x4d4e42){for(var _0x538907=0x0,_0x2b5b1c=events[_0xe22b('0x6')];_0x538907<_0x2b5b1c;_0x538907++){var _0x4620ff=events[_0x538907];var _0x4c3d2e=createListener('voiceQueue:'+_0x4620ff,_0x4d4e42);VoiceQueueEvents['on'](_0x4620ff,_0x4c3d2e);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 9576f14..db08f1e 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 _0x6406=['get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','/:id','show','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x6406,0x149));var _0x6640=function(_0x1acc01,_0x5cb80c){_0x1acc01=_0x1acc01-0x0;var _0x5603f1=_0x6406[_0x1acc01];return _0x5603f1;};'use strict';var multer=require(_0x6640('0x0'));var util=require(_0x6640('0x1'));var path=require(_0x6640('0x2'));var timeout=require(_0x6640('0x3'));var express=require(_0x6640('0x4'));var router=express['Router']();var fs_extra=require(_0x6640('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6640('0x6'));var controller=require('./voiceQueueReport.controller');router[_0x6640('0x7')]('/',auth[_0x6640('0x8')](),controller[_0x6640('0x9')]);router[_0x6640('0x7')](_0x6640('0xa'),auth[_0x6640('0x8')](),controller[_0x6640('0xb')]);router[_0x6640('0x7')](_0x6640('0xc'),auth[_0x6640('0x8')](),controller[_0x6640('0xd')]);router[_0x6640('0x7')](_0x6640('0xe'),auth[_0x6640('0x8')](),controller[_0x6640('0xf')]);router['post']('/',auth[_0x6640('0x8')](),controller[_0x6640('0x10')]);router[_0x6640('0x11')](_0x6640('0xe'),auth[_0x6640('0x8')](),controller['update']);router[_0x6640('0x12')](_0x6640('0xe'),auth['isAuthenticated'](),controller[_0x6640('0x13')]);module[_0x6640('0x14')]=router; \ No newline at end of file +var _0xf5b6=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','index','get','describe','/index','isAuthenticated','getVoiceQueuesReport','/:id','show','post','create','put','update','delete','destroy','exports','path'];(function(_0x3f8501,_0x484ca){var _0x62ae9=function(_0x328b57){while(--_0x328b57){_0x3f8501['push'](_0x3f8501['shift']());}};_0x62ae9(++_0x484ca);}(_0xf5b6,0x1b4));var _0x6f5b=function(_0x21032e,_0x4c61cf){_0x21032e=_0x21032e-0x0;var _0x201c35=_0xf5b6[_0x21032e];return _0x201c35;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6f5b('0x0'));var timeout=require(_0x6f5b('0x1'));var express=require(_0x6f5b('0x2'));var router=express[_0x6f5b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6f5b('0x4'));var interaction=require(_0x6f5b('0x5'));var config=require(_0x6f5b('0x6'));var controller=require(_0x6f5b('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x6f5b('0x8')]);router[_0x6f5b('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x6f5b('0xa')]);router['get'](_0x6f5b('0xb'),auth[_0x6f5b('0xc')](),controller[_0x6f5b('0xd')]);router['get'](_0x6f5b('0xe'),auth['isAuthenticated'](),controller[_0x6f5b('0xf')]);router[_0x6f5b('0x10')]('/',auth[_0x6f5b('0xc')](),controller[_0x6f5b('0x11')]);router[_0x6f5b('0x12')]('/:id',auth[_0x6f5b('0xc')](),controller[_0x6f5b('0x13')]);router[_0x6f5b('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x6f5b('0x15')]);module[_0x6f5b('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 5a4035b..30f19cb 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 _0x7e70=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','INTEGER'];(function(_0x18d4ff,_0x58262a){var _0xa9b003=function(_0x42e84c){while(--_0x42e84c){_0x18d4ff['push'](_0x18d4ff['shift']());}};_0xa9b003(++_0x58262a);}(_0x7e70,0x18a));var _0x07e7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7e70[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x07e7('0x0'));var moment=require(_0x07e7('0x1'));module[_0x07e7('0x2')]={'type':{'type':Sequelize[_0x07e7('0x3')]},'uniqueid':{'type':Sequelize[_0x07e7('0x3')]},'calleridnum':{'type':Sequelize[_0x07e7('0x3')]},'calleridname':{'type':Sequelize[_0x07e7('0x3')]},'queue':{'type':Sequelize[_0x07e7('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x07e7('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x07e7('0x4')],'set':function(_0x1e79fa){var _0x5eab7c=moment(_0x1e79fa);var _0x15f0d8=moment(this['getDataValue'](_0x07e7('0x5')))['format'](_0x07e7('0x6'));var _0x859269=_0x5eab7c[_0x07e7('0x7')](_0x15f0d8,_0x07e7('0x8'));this[_0x07e7('0x9')](_0x07e7('0xa'),_0x1e79fa);this[_0x07e7('0x9')]('holdtime',_0x859269||null);}},'position':{'type':Sequelize[_0x07e7('0xb')]},'count':{'type':Sequelize[_0x07e7('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x07e7('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x07e7('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x07e7('0x3')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x07e7('0xb')]},'channel':{'type':Sequelize[_0x07e7('0x3')]},'connectedlinenum':{'type':Sequelize[_0x07e7('0x3')]},'connectedlinename':{'type':Sequelize[_0x07e7('0x3')]},'accountcode':{'type':Sequelize[_0x07e7('0x3')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x07e7('0x3')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x07e7('0xb')]},'mohtime':{'type':Sequelize[_0x07e7('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x07e7('0x3')]},'transfer':{'type':Sequelize[_0x07e7('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x07e7('0x3')],'comment':_0x07e7('0xd')},'transferexten':{'type':Sequelize[_0x07e7('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x07e7('0x3')]},'secondDisposition':{'type':Sequelize[_0x07e7('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x07e7('0xb')],'defaultValue':0x0},'note':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1c5a=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','setDataValue','holdtime','INTEGER'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x1c5a,0xce));var _0xa1c5=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x1c5a[_0x13e741];return _0x3f8bb3;};'use strict';var Sequelize=require(_0xa1c5('0x0'));var moment=require(_0xa1c5('0x1'));module[_0xa1c5('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xa1c5('0x3')]},'calleridnum':{'type':Sequelize[_0xa1c5('0x3')]},'calleridname':{'type':Sequelize[_0xa1c5('0x3')]},'queue':{'type':Sequelize[_0xa1c5('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0xa1c5('0x4')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x58ca11){var _0x13e121=moment(_0x58ca11);var _0x637841=moment(this[_0xa1c5('0x5')](_0xa1c5('0x6')))['format']('YYYY-MM-DD\x20HH:mm:ss');var _0xa211bd=_0x13e121['diff'](_0x637841,'seconds');this[_0xa1c5('0x7')]('queuecallerleaveAt',_0x58ca11);this[_0xa1c5('0x7')](_0xa1c5('0x8'),_0xa211bd||null);}},'position':{'type':Sequelize[_0xa1c5('0x9')]},'count':{'type':Sequelize[_0xa1c5('0x9')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xa1c5('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xa1c5('0x4')]},'queuecallerexit':{'type':Sequelize[_0xa1c5('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xa1c5('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0xa1c5('0x9')]},'channel':{'type':Sequelize[_0xa1c5('0x3')]},'connectedlinenum':{'type':Sequelize[_0xa1c5('0x3')]},'connectedlinename':{'type':Sequelize[_0xa1c5('0x3')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xa1c5('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xa1c5('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xa1c5('0x9')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xa1c5('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xa1c5('0x3')]},'transfer':{'type':Sequelize[_0xa1c5('0xa')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xa1c5('0x3')],'comment':_0xa1c5('0xb')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xa1c5('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xa1c5('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0xa1c5('0x9')],'defaultValue':0x0},'note':{'type':Sequelize[_0xa1c5('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index d4ece52..b8aacc4 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 _0xee58=['where','pick','filter','merge','VIRTUAL','options','include','rows','show','params','keys','intersection','length','includeAll','find','catch','create','body','describe','getVoiceQueuesReport','hasOwnProperty','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','filters','fields','attributes','nolimit','sort'];(function(_0x1c4e2b,_0x5ba69e){var _0x5a8213=function(_0x564059){while(--_0x564059){_0x1c4e2b['push'](_0x1c4e2b['shift']());}};_0x5a8213(++_0x5ba69e);}(_0xee58,0x16a));var _0x8ee5=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xee58[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x8ee5('0x0'));var rimraf=require(_0x8ee5('0x1'));var zipdir=require(_0x8ee5('0x2'));var jsonpatch=require(_0x8ee5('0x3'));var rp=require(_0x8ee5('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8ee5('0x5'));var util=require(_0x8ee5('0x6'));var path=require('path');var sox=require(_0x8ee5('0x7'));var csv=require(_0x8ee5('0x8'));var ejs=require(_0x8ee5('0x9'));var fs=require('fs');var fs_extra=require(_0x8ee5('0xa'));var _=require(_0x8ee5('0xb'));var squel=require(_0x8ee5('0xc'));var crypto=require(_0x8ee5('0xd'));var jsforce=require(_0x8ee5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8ee5('0x8'));var querystring=require(_0x8ee5('0xf'));var Papa=require(_0x8ee5('0x10'));var Redis=require(_0x8ee5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8ee5('0x12'));var as=require(_0x8ee5('0x13'));var hardwareService=require(_0x8ee5('0x14'));var logger=require(_0x8ee5('0x15'))(_0x8ee5('0x16'));var utils=require(_0x8ee5('0x17'));var config=require(_0x8ee5('0x18'));var licenseUtil=require(_0x8ee5('0x19'));var db=require(_0x8ee5('0x1a'))['db'];config[_0x8ee5('0x1b')]=_[_0x8ee5('0x1c')](config[_0x8ee5('0x1b')],{'host':_0x8ee5('0x1d'),'port':0x18eb});var socket=require(_0x8ee5('0x1e'))(new Redis(config[_0x8ee5('0x1b')]));require('./voiceQueueReport.socket')[_0x8ee5('0x1f')](socket);function respondWithStatusCode(_0x5dc65f,_0x4664d2){_0x4664d2=_0x4664d2||0xcc;return function(_0x52e43d){if(_0x52e43d){return _0x5dc65f[_0x8ee5('0x20')](_0x4664d2);}return _0x5dc65f[_0x8ee5('0x21')](_0x4664d2)['end']();};}function respondWithResult(_0x553f22,_0x5dbdde){_0x5dbdde=_0x5dbdde||0xc8;return function(_0x29f752){if(_0x29f752){return _0x553f22[_0x8ee5('0x21')](_0x5dbdde)[_0x8ee5('0x22')](_0x29f752);}};}function respondWithFilteredResult(_0x5789dc,_0x543e67){return function(_0x4740e9){if(_0x4740e9){var _0x3d2b1c=typeof _0x543e67[_0x8ee5('0x23')]===_0x8ee5('0x24')&&typeof _0x543e67[_0x8ee5('0x25')]===_0x8ee5('0x24');var _0x241c3d=_0x4740e9[_0x8ee5('0x26')];var _0x2384b8=_0x3d2b1c?0x0:_0x543e67[_0x8ee5('0x23')];var _0x1bca03=_0x3d2b1c?_0x4740e9['count']:_0x543e67[_0x8ee5('0x23')]+_0x543e67['limit'];var _0x25d0a7;if(_0x1bca03>=_0x241c3d){_0x1bca03=_0x241c3d;_0x25d0a7=0xc8;}else{_0x25d0a7=0xce;}_0x5789dc[_0x8ee5('0x21')](_0x25d0a7);return _0x5789dc[_0x8ee5('0x27')](_0x8ee5('0x28'),_0x2384b8+'-'+_0x1bca03+'/'+_0x241c3d)[_0x8ee5('0x22')](_0x4740e9);}return null;};}function patchUpdates(_0x123fe0){return function(_0x3c07a7){try{jsonpatch[_0x8ee5('0x29')](_0x3c07a7,_0x123fe0,!![]);}catch(_0x3f2f1d){return BPromise[_0x8ee5('0x2a')](_0x3f2f1d);}return _0x3c07a7[_0x8ee5('0x2b')]();};}function saveUpdates(_0x2b7eb6,_0x5b3336){return function(_0x7e3de3){if(_0x7e3de3){return _0x7e3de3[_0x8ee5('0x2c')](_0x2b7eb6)['then'](function(_0x749cd2){return _0x749cd2;});}return null;};}function removeEntity(_0x259804,_0x208e7f){return function(_0xfc75ae){if(_0xfc75ae){return _0xfc75ae[_0x8ee5('0x2d')]()[_0x8ee5('0x2e')](function(){_0x259804[_0x8ee5('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd6fe89,_0x47ab65){return function(_0x1e951e){if(!_0x1e951e){_0xd6fe89[_0x8ee5('0x20')](0x194);}return _0x1e951e;};}function handleError(_0x34ecb7,_0x51825a){_0x51825a=_0x51825a||0x1f4;return function(_0x26ad30){logger[_0x8ee5('0x2f')](_0x26ad30['stack']);if(_0x26ad30[_0x8ee5('0x30')]){delete _0x26ad30[_0x8ee5('0x30')];}_0x34ecb7[_0x8ee5('0x21')](_0x51825a)[_0x8ee5('0x31')](_0x26ad30);};}exports['index']=function(_0x2341d9,_0x7ba499){var _0x1d4a8e={},_0x581dba={},_0xf51e2e={'count':0x0,'rows':[]};var _0x54fa7e=_[_0x8ee5('0x32')](db[_0x8ee5('0x33')][_0x8ee5('0x34')],function(_0x18c80a){return{'name':_0x18c80a[_0x8ee5('0x35')],'type':_0x18c80a[_0x8ee5('0x36')][_0x8ee5('0x37')]};});_0x581dba[_0x8ee5('0x38')]=_[_0x8ee5('0x32')](_0x54fa7e,_0x8ee5('0x30'));_0x581dba[_0x8ee5('0x39')]=_['keys'](_0x2341d9['query']);_0x581dba[_0x8ee5('0x3a')]=_['intersection'](_0x581dba[_0x8ee5('0x38')],_0x581dba['query']);_0x1d4a8e['attributes']=_['intersection'](_0x581dba['model'],qs[_0x8ee5('0x3b')](_0x2341d9[_0x8ee5('0x39')][_0x8ee5('0x3b')]));_0x1d4a8e[_0x8ee5('0x3c')]=_0x1d4a8e[_0x8ee5('0x3c')]['length']?_0x1d4a8e[_0x8ee5('0x3c')]:_0x581dba[_0x8ee5('0x38')];if(!_0x2341d9['query']['hasOwnProperty'](_0x8ee5('0x3d'))){_0x1d4a8e[_0x8ee5('0x25')]=qs['limit'](_0x2341d9[_0x8ee5('0x39')][_0x8ee5('0x25')]);_0x1d4a8e['offset']=qs[_0x8ee5('0x23')](_0x2341d9[_0x8ee5('0x39')]['offset']);}_0x1d4a8e['order']=qs['sort'](_0x2341d9[_0x8ee5('0x39')][_0x8ee5('0x3e')]);_0x1d4a8e[_0x8ee5('0x3f')]=qs[_0x8ee5('0x3a')](_[_0x8ee5('0x40')](_0x2341d9[_0x8ee5('0x39')],_0x581dba[_0x8ee5('0x3a')]),_0x54fa7e);if(_0x2341d9[_0x8ee5('0x39')][_0x8ee5('0x41')]){_0x1d4a8e[_0x8ee5('0x3f')]=_[_0x8ee5('0x42')](_0x1d4a8e[_0x8ee5('0x3f')],{'$or':_['map'](_0x54fa7e,function(_0x43024d){if(_0x43024d['type']!==_0x8ee5('0x43')){var _0x23f0b8={};_0x23f0b8[_0x43024d[_0x8ee5('0x30')]]={'$like':'%'+_0x2341d9[_0x8ee5('0x39')][_0x8ee5('0x41')]+'%'};return _0x23f0b8;}})});}_0x1d4a8e=_[_0x8ee5('0x42')]({},_0x1d4a8e,_0x2341d9[_0x8ee5('0x44')]);var _0x19ec13={'where':_0x1d4a8e[_0x8ee5('0x3f')]};return db['VoiceQueueReport'][_0x8ee5('0x26')](_0x19ec13)['then'](function(_0x3c13fe){_0xf51e2e[_0x8ee5('0x26')]=_0x3c13fe;if(_0x2341d9[_0x8ee5('0x39')]['includeAll']){_0x1d4a8e[_0x8ee5('0x45')]=[{'all':!![]}];}return db[_0x8ee5('0x33')]['findAll'](_0x1d4a8e);})['then'](function(_0x5222d8){_0xf51e2e[_0x8ee5('0x46')]=_0x5222d8;return _0xf51e2e;})[_0x8ee5('0x2e')](respondWithFilteredResult(_0x7ba499,_0x1d4a8e))['catch'](handleError(_0x7ba499,null));};exports[_0x8ee5('0x47')]=function(_0x3340c7,_0x2391af){var _0x508a7f={'raw':![],'where':{'id':_0x3340c7[_0x8ee5('0x48')]['id']}},_0x5012ee={};_0x5012ee['model']=_[_0x8ee5('0x49')](db['VoiceQueueReport'][_0x8ee5('0x34')]);_0x5012ee['query']=_[_0x8ee5('0x49')](_0x3340c7[_0x8ee5('0x39')]);_0x5012ee[_0x8ee5('0x3a')]=_[_0x8ee5('0x4a')](_0x5012ee[_0x8ee5('0x38')],_0x5012ee[_0x8ee5('0x39')]);_0x508a7f[_0x8ee5('0x3c')]=_[_0x8ee5('0x4a')](_0x5012ee[_0x8ee5('0x38')],qs[_0x8ee5('0x3b')](_0x3340c7[_0x8ee5('0x39')]['fields']));_0x508a7f[_0x8ee5('0x3c')]=_0x508a7f['attributes'][_0x8ee5('0x4b')]?_0x508a7f[_0x8ee5('0x3c')]:_0x5012ee[_0x8ee5('0x38')];if(_0x3340c7['query'][_0x8ee5('0x4c')]){_0x508a7f['include']=[{'all':!![]}];}_0x508a7f=_[_0x8ee5('0x42')]({},_0x508a7f,_0x3340c7[_0x8ee5('0x44')]);return db[_0x8ee5('0x33')][_0x8ee5('0x4d')](_0x508a7f)[_0x8ee5('0x2e')](handleEntityNotFound(_0x2391af,null))[_0x8ee5('0x2e')](respondWithResult(_0x2391af,null))[_0x8ee5('0x4e')](handleError(_0x2391af,null));};exports[_0x8ee5('0x4f')]=function(_0x3d813d,_0x3b0f8d){return db[_0x8ee5('0x33')][_0x8ee5('0x4f')](_0x3d813d[_0x8ee5('0x50')],{})[_0x8ee5('0x2e')](respondWithResult(_0x3b0f8d,0xc9))[_0x8ee5('0x4e')](handleError(_0x3b0f8d,null));};exports[_0x8ee5('0x2c')]=function(_0x2a11f2,_0x5a36f6){if(_0x2a11f2['body']['id']){delete _0x2a11f2[_0x8ee5('0x50')]['id'];}return db[_0x8ee5('0x33')][_0x8ee5('0x4d')]({'where':{'id':_0x2a11f2[_0x8ee5('0x48')]['id']}})['then'](handleEntityNotFound(_0x5a36f6,null))[_0x8ee5('0x2e')](saveUpdates(_0x2a11f2['body'],null))[_0x8ee5('0x2e')](respondWithResult(_0x5a36f6,null))[_0x8ee5('0x4e')](handleError(_0x5a36f6,null));};exports[_0x8ee5('0x2d')]=function(_0x5e964f,_0x34ccba){return db[_0x8ee5('0x33')][_0x8ee5('0x4d')]({'where':{'id':_0x5e964f[_0x8ee5('0x48')]['id']}})[_0x8ee5('0x2e')](handleEntityNotFound(_0x34ccba,null))[_0x8ee5('0x2e')](removeEntity(_0x34ccba,null))[_0x8ee5('0x4e')](handleError(_0x34ccba,null));};exports[_0x8ee5('0x51')]=function(_0x266569,_0x5b2fbc){return db[_0x8ee5('0x33')][_0x8ee5('0x51')]()[_0x8ee5('0x2e')](respondWithResult(_0x5b2fbc,null))[_0x8ee5('0x4e')](handleError(_0x5b2fbc,null));};exports[_0x8ee5('0x52')]=function(_0xa74c09,_0x478668){var _0x8a8fea={},_0x462f26={},_0x105fbc={'count':0x0,'rows':[]};_0x462f26[_0x8ee5('0x38')]=_[_0x8ee5('0x49')](db['VoiceQueueReport'][_0x8ee5('0x34')]);_0x462f26[_0x8ee5('0x39')]=_[_0x8ee5('0x49')](_0xa74c09[_0x8ee5('0x39')]);_0x462f26[_0x8ee5('0x3a')]=_[_0x8ee5('0x4a')](_0x462f26[_0x8ee5('0x38')],_0x462f26['query']);_0x8a8fea[_0x8ee5('0x3c')]=_[_0x8ee5('0x4a')](_0x462f26[_0x8ee5('0x38')],qs[_0x8ee5('0x3b')](_0xa74c09[_0x8ee5('0x39')][_0x8ee5('0x3b')]));_0x8a8fea[_0x8ee5('0x3c')]=_0x8a8fea[_0x8ee5('0x3c')]['length']?_0x8a8fea[_0x8ee5('0x3c')]:_0x462f26['model'];if(!_0xa74c09[_0x8ee5('0x39')][_0x8ee5('0x53')](_0x8ee5('0x3d'))){_0x8a8fea[_0x8ee5('0x25')]=qs[_0x8ee5('0x25')](_0xa74c09[_0x8ee5('0x39')][_0x8ee5('0x25')]);_0x8a8fea[_0x8ee5('0x23')]=qs[_0x8ee5('0x23')](_0xa74c09[_0x8ee5('0x39')][_0x8ee5('0x23')]);}_0x8a8fea[_0x8ee5('0x54')]=qs[_0x8ee5('0x3e')](_0xa74c09[_0x8ee5('0x39')][_0x8ee5('0x3e')]);_0x8a8fea[_0x8ee5('0x3f')]=qs['filters'](_[_0x8ee5('0x40')](_0xa74c09[_0x8ee5('0x39')],_0x462f26[_0x8ee5('0x3a')]));if(_0xa74c09['query'][_0x8ee5('0x41')]){_0x8a8fea[_0x8ee5('0x3f')]=_[_0x8ee5('0x42')](_0x8a8fea[_0x8ee5('0x3f')],{'$or':_[_0x8ee5('0x32')](_0x8a8fea[_0x8ee5('0x3c')],function(_0x59f277){var _0x5e8a6d={};_0x5e8a6d[_0x59f277]={'$like':'%'+_0xa74c09[_0x8ee5('0x39')][_0x8ee5('0x41')]+'%'};return _0x5e8a6d;})});}_0x8a8fea=_[_0x8ee5('0x42')]({},_0x8a8fea,_0xa74c09[_0x8ee5('0x44')]);var _0x45475a={'where':_0x8a8fea[_0x8ee5('0x3f')]};return db['VoiceQueueReport'][_0x8ee5('0x26')](_0x45475a)['then'](function(_0x8bf71e){_0x105fbc[_0x8ee5('0x26')]=_0x8bf71e;if(_0xa74c09[_0x8ee5('0x39')]['includeAll']){_0x8a8fea['include']=[{'all':!![]}];}return db[_0x8ee5('0x33')]['findAll'](_0x8a8fea);})[_0x8ee5('0x2e')](function(_0x568a6b){_0x105fbc[_0x8ee5('0x46')]=_0x568a6b;return _0x105fbc;})['then'](respondWithFilteredResult(_0x478668,_0x8a8fea,'getVoiceQueuesReport'))[_0x8ee5('0x4e')](handleError(_0x478668,null,_0x8ee5('0x52')));}; \ No newline at end of file +var _0x8601=['moment','bluebird','mustache','util','to-csv','ejs','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voiceQueueReport.socket','register','status','json','offset','undefined','limit','count','Content-Range','reject','update','then','sendStatus','error','stack','name','send','index','VoiceQueueReport','fieldName','type','query','model','fields','attributes','length','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','rawAttributes','intersection','merge','find','create','body','destroy','describe','getVoiceQueuesReport','hasOwnProperty','map','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8601,0xe0));var _0x1860=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x8601[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1860('0x0'));var zipdir=require(_0x1860('0x1'));var jsonpatch=require(_0x1860('0x2'));var rp=require(_0x1860('0x3'));var moment=require(_0x1860('0x4'));var BPromise=require(_0x1860('0x5'));var Mustache=require(_0x1860('0x6'));var util=require(_0x1860('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x1860('0x8'));var ejs=require(_0x1860('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1860('0xa'));var crypto=require('crypto');var jsforce=require(_0x1860('0xb'));var deskjs=require(_0x1860('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1860('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1860('0xe'));var qs=require(_0x1860('0xf'));var as=require(_0x1860('0x10'));var hardwareService=require(_0x1860('0x11'));var logger=require('../../config/logger')(_0x1860('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1860('0x13'));var db=require(_0x1860('0x14'))['db'];config[_0x1860('0x15')]=_[_0x1860('0x16')](config[_0x1860('0x15')],{'host':_0x1860('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1860('0x15')]));require(_0x1860('0x18'))[_0x1860('0x19')](socket);function respondWithStatusCode(_0x372778,_0x5ae486){_0x5ae486=_0x5ae486||0xcc;return function(_0x904d23){if(_0x904d23){return _0x372778['sendStatus'](_0x5ae486);}return _0x372778[_0x1860('0x1a')](_0x5ae486)['end']();};}function respondWithResult(_0x179271,_0x21bc1f){_0x21bc1f=_0x21bc1f||0xc8;return function(_0x243ce3){if(_0x243ce3){return _0x179271['status'](_0x21bc1f)[_0x1860('0x1b')](_0x243ce3);}};}function respondWithFilteredResult(_0x2b5d1d,_0x463292){return function(_0xc32463){if(_0xc32463){var _0x48e9c4=typeof _0x463292[_0x1860('0x1c')]===_0x1860('0x1d')&&typeof _0x463292[_0x1860('0x1e')]==='undefined';var _0x3fec84=_0xc32463[_0x1860('0x1f')];var _0x5bb0f9=_0x48e9c4?0x0:_0x463292[_0x1860('0x1c')];var _0x3d4fb3=_0x48e9c4?_0xc32463['count']:_0x463292[_0x1860('0x1c')]+_0x463292[_0x1860('0x1e')];var _0x1831b8;if(_0x3d4fb3>=_0x3fec84){_0x3d4fb3=_0x3fec84;_0x1831b8=0xc8;}else{_0x1831b8=0xce;}_0x2b5d1d[_0x1860('0x1a')](_0x1831b8);return _0x2b5d1d['set'](_0x1860('0x20'),_0x5bb0f9+'-'+_0x3d4fb3+'/'+_0x3fec84)[_0x1860('0x1b')](_0xc32463);}return null;};}function patchUpdates(_0x41920b){return function(_0x33b62b){try{jsonpatch['apply'](_0x33b62b,_0x41920b,!![]);}catch(_0x4e46f4){return BPromise[_0x1860('0x21')](_0x4e46f4);}return _0x33b62b['save']();};}function saveUpdates(_0x31bf94,_0x201694){return function(_0x154d61){if(_0x154d61){return _0x154d61[_0x1860('0x22')](_0x31bf94)[_0x1860('0x23')](function(_0x4b1ef4){return _0x4b1ef4;});}return null;};}function removeEntity(_0x1f5b82,_0x3fd801){return function(_0x326b28){if(_0x326b28){return _0x326b28['destroy']()[_0x1860('0x23')](function(){_0x1f5b82['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x8eafdb,_0x234e93){return function(_0x3b545f){if(!_0x3b545f){_0x8eafdb[_0x1860('0x24')](0x194);}return _0x3b545f;};}function handleError(_0x55f375,_0x2ac556){_0x2ac556=_0x2ac556||0x1f4;return function(_0x84030a){logger[_0x1860('0x25')](_0x84030a[_0x1860('0x26')]);if(_0x84030a[_0x1860('0x27')]){delete _0x84030a[_0x1860('0x27')];}_0x55f375[_0x1860('0x1a')](_0x2ac556)[_0x1860('0x28')](_0x84030a);};}exports[_0x1860('0x29')]=function(_0x26114f,_0x3ead35){var _0x5139cf={},_0x341d2b={},_0x3494a6={'count':0x0,'rows':[]};var _0x2f10d5=_['map'](db[_0x1860('0x2a')]['rawAttributes'],function(_0x48bfc5){return{'name':_0x48bfc5[_0x1860('0x2b')],'type':_0x48bfc5[_0x1860('0x2c')]['key']};});_0x341d2b['model']=_['map'](_0x2f10d5,_0x1860('0x27'));_0x341d2b['query']=_['keys'](_0x26114f[_0x1860('0x2d')]);_0x341d2b['filters']=_['intersection'](_0x341d2b['model'],_0x341d2b[_0x1860('0x2d')]);_0x5139cf['attributes']=_['intersection'](_0x341d2b[_0x1860('0x2e')],qs['fields'](_0x26114f[_0x1860('0x2d')][_0x1860('0x2f')]));_0x5139cf['attributes']=_0x5139cf[_0x1860('0x30')][_0x1860('0x31')]?_0x5139cf[_0x1860('0x30')]:_0x341d2b[_0x1860('0x2e')];if(!_0x26114f[_0x1860('0x2d')]['hasOwnProperty'](_0x1860('0x32'))){_0x5139cf['limit']=qs['limit'](_0x26114f[_0x1860('0x2d')][_0x1860('0x1e')]);_0x5139cf[_0x1860('0x1c')]=qs[_0x1860('0x1c')](_0x26114f['query'][_0x1860('0x1c')]);}_0x5139cf[_0x1860('0x33')]=qs['sort'](_0x26114f[_0x1860('0x2d')][_0x1860('0x34')]);_0x5139cf['where']=qs[_0x1860('0x35')](_[_0x1860('0x36')](_0x26114f[_0x1860('0x2d')],_0x341d2b[_0x1860('0x35')]),_0x2f10d5);if(_0x26114f[_0x1860('0x2d')][_0x1860('0x37')]){_0x5139cf['where']=_['merge'](_0x5139cf[_0x1860('0x38')],{'$or':_['map'](_0x2f10d5,function(_0x1116a5){if(_0x1116a5[_0x1860('0x2c')]!==_0x1860('0x39')){var _0x223e6b={};_0x223e6b[_0x1116a5[_0x1860('0x27')]]={'$like':'%'+_0x26114f[_0x1860('0x2d')][_0x1860('0x37')]+'%'};return _0x223e6b;}})});}_0x5139cf=_['merge']({},_0x5139cf,_0x26114f[_0x1860('0x3a')]);var _0x4954c6={'where':_0x5139cf[_0x1860('0x38')]};return db['VoiceQueueReport'][_0x1860('0x1f')](_0x4954c6)[_0x1860('0x23')](function(_0x5bf82f){_0x3494a6[_0x1860('0x1f')]=_0x5bf82f;if(_0x26114f[_0x1860('0x2d')][_0x1860('0x3b')]){_0x5139cf['include']=[{'all':!![]}];}return db[_0x1860('0x2a')][_0x1860('0x3c')](_0x5139cf);})[_0x1860('0x23')](function(_0x30c276){_0x3494a6[_0x1860('0x3d')]=_0x30c276;return _0x3494a6;})['then'](respondWithFilteredResult(_0x3ead35,_0x5139cf))[_0x1860('0x3e')](handleError(_0x3ead35,null));};exports['show']=function(_0x402305,_0x46ba4b){var _0x1c1a22={'raw':![],'where':{'id':_0x402305[_0x1860('0x3f')]['id']}},_0x20809b={};_0x20809b['model']=_[_0x1860('0x40')](db['VoiceQueueReport'][_0x1860('0x41')]);_0x20809b['query']=_[_0x1860('0x40')](_0x402305['query']);_0x20809b['filters']=_['intersection'](_0x20809b[_0x1860('0x2e')],_0x20809b[_0x1860('0x2d')]);_0x1c1a22[_0x1860('0x30')]=_[_0x1860('0x42')](_0x20809b[_0x1860('0x2e')],qs['fields'](_0x402305[_0x1860('0x2d')]['fields']));_0x1c1a22['attributes']=_0x1c1a22[_0x1860('0x30')][_0x1860('0x31')]?_0x1c1a22[_0x1860('0x30')]:_0x20809b['model'];if(_0x402305['query'][_0x1860('0x3b')]){_0x1c1a22['include']=[{'all':!![]}];}_0x1c1a22=_[_0x1860('0x43')]({},_0x1c1a22,_0x402305[_0x1860('0x3a')]);return db[_0x1860('0x2a')][_0x1860('0x44')](_0x1c1a22)['then'](handleEntityNotFound(_0x46ba4b,null))[_0x1860('0x23')](respondWithResult(_0x46ba4b,null))[_0x1860('0x3e')](handleError(_0x46ba4b,null));};exports[_0x1860('0x45')]=function(_0x4c8c14,_0x148b9e){return db['VoiceQueueReport']['create'](_0x4c8c14[_0x1860('0x46')],{})[_0x1860('0x23')](respondWithResult(_0x148b9e,0xc9))[_0x1860('0x3e')](handleError(_0x148b9e,null));};exports[_0x1860('0x22')]=function(_0x9c387,_0x7b87d){if(_0x9c387[_0x1860('0x46')]['id']){delete _0x9c387['body']['id'];}return db[_0x1860('0x2a')][_0x1860('0x44')]({'where':{'id':_0x9c387[_0x1860('0x3f')]['id']}})[_0x1860('0x23')](handleEntityNotFound(_0x7b87d,null))[_0x1860('0x23')](saveUpdates(_0x9c387[_0x1860('0x46')],null))['then'](respondWithResult(_0x7b87d,null))['catch'](handleError(_0x7b87d,null));};exports[_0x1860('0x47')]=function(_0x261898,_0x272d54){return db[_0x1860('0x2a')][_0x1860('0x44')]({'where':{'id':_0x261898[_0x1860('0x3f')]['id']}})[_0x1860('0x23')](handleEntityNotFound(_0x272d54,null))['then'](removeEntity(_0x272d54,null))[_0x1860('0x3e')](handleError(_0x272d54,null));};exports[_0x1860('0x48')]=function(_0x31d93c,_0x5a0f30){return db[_0x1860('0x2a')][_0x1860('0x48')]()[_0x1860('0x23')](respondWithResult(_0x5a0f30,null))[_0x1860('0x3e')](handleError(_0x5a0f30,null));};exports[_0x1860('0x49')]=function(_0x240ab7,_0x499a79){var _0x59ef4a={},_0x6f8b9c={},_0x4f2eff={'count':0x0,'rows':[]};_0x6f8b9c[_0x1860('0x2e')]=_['keys'](db[_0x1860('0x2a')]['rawAttributes']);_0x6f8b9c[_0x1860('0x2d')]=_['keys'](_0x240ab7['query']);_0x6f8b9c[_0x1860('0x35')]=_[_0x1860('0x42')](_0x6f8b9c[_0x1860('0x2e')],_0x6f8b9c[_0x1860('0x2d')]);_0x59ef4a['attributes']=_[_0x1860('0x42')](_0x6f8b9c[_0x1860('0x2e')],qs[_0x1860('0x2f')](_0x240ab7['query'][_0x1860('0x2f')]));_0x59ef4a[_0x1860('0x30')]=_0x59ef4a[_0x1860('0x30')][_0x1860('0x31')]?_0x59ef4a[_0x1860('0x30')]:_0x6f8b9c[_0x1860('0x2e')];if(!_0x240ab7[_0x1860('0x2d')][_0x1860('0x4a')](_0x1860('0x32'))){_0x59ef4a[_0x1860('0x1e')]=qs[_0x1860('0x1e')](_0x240ab7[_0x1860('0x2d')]['limit']);_0x59ef4a[_0x1860('0x1c')]=qs[_0x1860('0x1c')](_0x240ab7[_0x1860('0x2d')][_0x1860('0x1c')]);}_0x59ef4a[_0x1860('0x33')]=qs[_0x1860('0x34')](_0x240ab7[_0x1860('0x2d')]['sort']);_0x59ef4a[_0x1860('0x38')]=qs['filters'](_[_0x1860('0x36')](_0x240ab7[_0x1860('0x2d')],_0x6f8b9c[_0x1860('0x35')]));if(_0x240ab7[_0x1860('0x2d')][_0x1860('0x37')]){_0x59ef4a[_0x1860('0x38')]=_['merge'](_0x59ef4a[_0x1860('0x38')],{'$or':_[_0x1860('0x4b')](_0x59ef4a['attributes'],function(_0x7aa0c6){var _0x8d9646={};_0x8d9646[_0x7aa0c6]={'$like':'%'+_0x240ab7[_0x1860('0x2d')]['filter']+'%'};return _0x8d9646;})});}_0x59ef4a=_[_0x1860('0x43')]({},_0x59ef4a,_0x240ab7['options']);var _0x211dc2={'where':_0x59ef4a[_0x1860('0x38')]};return db[_0x1860('0x2a')][_0x1860('0x1f')](_0x211dc2)[_0x1860('0x23')](function(_0x165960){_0x4f2eff[_0x1860('0x1f')]=_0x165960;if(_0x240ab7[_0x1860('0x2d')][_0x1860('0x3b')]){_0x59ef4a['include']=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x59ef4a);})[_0x1860('0x23')](function(_0x2ab71c){_0x4f2eff['rows']=_0x2ab71c;return _0x4f2eff;})[_0x1860('0x23')](respondWithFilteredResult(_0x499a79,_0x59ef4a,_0x1860('0x49')))['catch'](handleError(_0x499a79,null,'getVoiceQueuesReport'));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 89191eb..b2e3ca8 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 _0x861b=['../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','emit'];(function(_0x27ecf2,_0x25fa1a){var _0x4e643c=function(_0x1baf79){while(--_0x1baf79){_0x27ecf2['push'](_0x27ecf2['shift']());}};_0x4e643c(++_0x25fa1a);}(_0x861b,0x78));var _0xb861=function(_0x260073,_0xbe6af9){_0x260073=_0x260073-0x0;var _0x4ff033=_0x861b[_0x260073];return _0x4ff033;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0xb861('0x0'))['db'][_0xb861('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xb861('0x2')](0x0);var events={'afterCreate':_0xb861('0x3'),'afterUpdate':_0xb861('0x4'),'afterDestroy':'remove'};function emitEvent(_0x35c83d){return function(_0x412dd4,_0x1b0a27,_0x1a4b48){VoiceQueueReportEvents[_0xb861('0x5')](_0x35c83d+':'+_0x412dd4['id'],_0x412dd4);VoiceQueueReportEvents[_0xb861('0x5')](_0x35c83d,_0x412dd4);_0x1a4b48(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0x7d02=['save','emit','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners'];(function(_0x34b675,_0x5a5402){var _0x4ce0ea=function(_0xa295ae){while(--_0xa295ae){_0x34b675['push'](_0x34b675['shift']());}};_0x4ce0ea(++_0x5a5402);}(_0x7d02,0x11c));var _0x27d0=function(_0x3040f7,_0x393a18){_0x3040f7=_0x3040f7-0x0;var _0x18f0bc=_0x7d02[_0x3040f7];return _0x18f0bc;};'use strict';var EventEmitter=require(_0x27d0('0x0'));var VoiceQueueReport=require(_0x27d0('0x1'))['db'][_0x27d0('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x27d0('0x3')](0x0);var events={'afterCreate':_0x27d0('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x20d70e){return function(_0x1e0987,_0x5c1d13,_0x411ab4){VoiceQueueReportEvents[_0x27d0('0x5')](_0x20d70e+':'+_0x1e0987['id'],_0x1e0987);VoiceQueueReportEvents['emit'](_0x20d70e,_0x1e0987);_0x411ab4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x27d0('0x6')](e,emitEvent(event));}}module[_0x27d0('0x7')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 0340897..e9baff0 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 _0x515c=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceQueueReport.attributes','define','uniqueid'];(function(_0x52d68a,_0x2632a9){var _0xb6b9d9=function(_0x39caad){while(--_0x39caad){_0x52d68a['push'](_0x52d68a['shift']());}};_0xb6b9d9(++_0x2632a9);}(_0x515c,0x1bc));var _0xc515=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x515c[_0x432682];return _0x463d05;};'use strict';var _=require(_0xc515('0x0'));var util=require(_0xc515('0x1'));var logger=require(_0xc515('0x2'))(_0xc515('0x3'));var moment=require(_0xc515('0x4'));var BPromise=require(_0xc515('0x5'));var rp=require(_0xc515('0x6'));var fs=require('fs');var path=require(_0xc515('0x7'));var rimraf=require('rimraf');var config=require(_0xc515('0x8'));var attributes=require(_0xc515('0x9'));module['exports']=function(_0x2f7114,_0x399f71){return _0x2f7114[_0xc515('0xa')]('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xc515('0xb')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6d34=['bluebird','request-promise','rimraf','exports','define','calleridnum','lodash','util','api','moment'];(function(_0x2a3f07,_0x345c88){var _0x53f2ef=function(_0x1af778){while(--_0x1af778){_0x2a3f07['push'](_0x2a3f07['shift']());}};_0x53f2ef(++_0x345c88);}(_0x6d34,0xa6));var _0x46d3=function(_0xdd73b6,_0x2f8b65){_0xdd73b6=_0xdd73b6-0x0;var _0x2c9e90=_0x6d34[_0xdd73b6];return _0x2c9e90;};'use strict';var _=require(_0x46d3('0x0'));var util=require(_0x46d3('0x1'));var logger=require('../../config/logger')(_0x46d3('0x2'));var moment=require(_0x46d3('0x3'));var BPromise=require(_0x46d3('0x4'));var rp=require(_0x46d3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x46d3('0x6'));var config=require('../../config/environment');var attributes=require('./voiceQueueReport.attributes');module[_0x46d3('0x7')]=function(_0x1bd16e,_0x52cbb7){return _0x1bd16e[_0x46d3('0x8')]('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x46d3('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index d3da910..3192bff 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 _0x9fce=['catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','attributes','limit','include','map','model','then','CreateVoiceQueueReport','create','body','raw','UpdateVoiceQueueReport','update','where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','info','request\x20sent','result'];(function(_0x3f18c8,_0xb0ac0c){var _0x1a8171=function(_0x54f731){while(--_0x54f731){_0x3f18c8['push'](_0x3f18c8['shift']());}};_0x1a8171(++_0xb0ac0c);}(_0x9fce,0x6c));var _0xe9fc=function(_0x3f4cd0,_0x303070){_0x3f4cd0=_0x3f4cd0-0x0;var _0x3f9f01=_0x9fce[_0x3f4cd0];return _0x3f9f01;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe9fc('0x0'));var BPromise=require(_0xe9fc('0x1'));var rs=require(_0xe9fc('0x2'));var fs=require('fs');var Redis=require(_0xe9fc('0x3'));var db=require(_0xe9fc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe9fc('0x5'))(_0xe9fc('0x6'));var config=require(_0xe9fc('0x7'));var jayson=require(_0xe9fc('0x8'));var client=jayson[_0xe9fc('0x9')]['http']({'port':0x232a});config[_0xe9fc('0xa')]=_[_0xe9fc('0xb')](config['redis'],{'host':_0xe9fc('0xc'),'port':0x18eb});var socket=require(_0xe9fc('0xd'))(new Redis(config[_0xe9fc('0xa')]));require(_0xe9fc('0xe'))[_0xe9fc('0xf')](socket);function respondWithRpcPromise(_0x1f86a1,_0x4e6d46,_0xb0f75c){return new BPromise(function(_0x5d9021,_0x48844e){return client[_0xe9fc('0x10')](_0x1f86a1,_0xb0f75c)['then'](function(_0x2ca890){logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x4e6d46,'request\x20sent');logger[_0xe9fc('0x11')](_0xe9fc('0x12'),_0x4e6d46,'request\x20sent',JSON[_0xe9fc('0x13')](_0x2ca890));if(_0x2ca890[_0xe9fc('0x14')]){if(_0x2ca890[_0xe9fc('0x14')][_0xe9fc('0x15')]===0x1f4){logger[_0xe9fc('0x14')](_0xe9fc('0x16'),_0x4e6d46,_0x2ca890[_0xe9fc('0x14')][_0xe9fc('0x17')]);return _0x48844e(_0x2ca890['error'][_0xe9fc('0x17')]);}logger['error'](_0xe9fc('0x16'),_0x4e6d46,_0x2ca890['error'][_0xe9fc('0x17')]);return _0x5d9021(_0x2ca890[_0xe9fc('0x14')]['message']);}else{logger[_0xe9fc('0x18')](_0xe9fc('0x16'),_0x4e6d46,_0xe9fc('0x19'));_0x5d9021(_0x2ca890[_0xe9fc('0x1a')][_0xe9fc('0x17')]);}})[_0xe9fc('0x1b')](function(_0x757587){logger[_0xe9fc('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x4e6d46,_0x757587);_0x48844e(_0x757587);});});}exports[_0xe9fc('0x1c')]=function(_0x2026e9){var _0x5ac648=this;return new Promise(function(_0x217e8f,_0x39e3f7){return db[_0xe9fc('0x1d')][_0xe9fc('0x1e')]({'raw':_0x2026e9[_0xe9fc('0x1f')]?_0x2026e9[_0xe9fc('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x2026e9['options']?_0x2026e9[_0xe9fc('0x1f')]['where']||null:null,'attributes':_0x2026e9['options']?_0x2026e9[_0xe9fc('0x1f')][_0xe9fc('0x20')]||null:null,'limit':_0x2026e9[_0xe9fc('0x1f')]?_0x2026e9['options'][_0xe9fc('0x21')]||null:null,'include':_0x2026e9['options']?_0x2026e9[_0xe9fc('0x1f')][_0xe9fc('0x22')]?_[_0xe9fc('0x23')](_0x2026e9[_0xe9fc('0x1f')][_0xe9fc('0x22')],function(_0x3c3f27){return{'model':db[_0x3c3f27[_0xe9fc('0x24')]],'as':_0x3c3f27['as'],'attributes':_0x3c3f27[_0xe9fc('0x20')],'include':_0x3c3f27[_0xe9fc('0x22')]?_['map'](_0x3c3f27['include'],function(_0x3eabc7){return{'model':db[_0x3eabc7[_0xe9fc('0x24')]],'as':_0x3eabc7['as'],'attributes':_0x3eabc7[_0xe9fc('0x20')],'include':_0x3eabc7[_0xe9fc('0x22')]?_[_0xe9fc('0x23')](_0x3eabc7[_0xe9fc('0x22')],function(_0x574307){return{'model':db[_0x574307['model']],'as':_0x574307['as'],'attributes':_0x574307['attributes']};}):[]};}):[]};}):[]:[]})[_0xe9fc('0x25')](function(_0x196459){logger['info'](_0xe9fc('0x1c'),_0x2026e9);logger[_0xe9fc('0x11')](_0xe9fc('0x1c'),_0x2026e9,JSON[_0xe9fc('0x13')](_0x196459));_0x217e8f(_0x196459);})[_0xe9fc('0x1b')](function(_0x330fed){logger[_0xe9fc('0x14')](_0xe9fc('0x1c'),_0x330fed[_0xe9fc('0x17')],_0x2026e9);_0x39e3f7(_0x5ac648['error'](0x1f4,_0x330fed[_0xe9fc('0x17')]));});});};exports[_0xe9fc('0x26')]=function(_0x3d5800){var _0x4af351=this;return new Promise(function(_0x1b2177,_0xd8c74f){return db[_0xe9fc('0x1d')][_0xe9fc('0x27')](_0x3d5800[_0xe9fc('0x28')],{'raw':_0x3d5800[_0xe9fc('0x1f')]?_0x3d5800[_0xe9fc('0x1f')][_0xe9fc('0x29')]===undefined?!![]:![]:!![]})[_0xe9fc('0x25')](function(_0x451251){logger[_0xe9fc('0x18')]('CreateVoiceQueueReport',_0x3d5800);logger[_0xe9fc('0x11')](_0xe9fc('0x26'),_0x3d5800,JSON[_0xe9fc('0x13')](_0x451251));_0x1b2177(_0x451251);})[_0xe9fc('0x1b')](function(_0x587009){logger[_0xe9fc('0x14')](_0xe9fc('0x26'),_0x587009['message'],_0x3d5800);_0xd8c74f(_0x4af351[_0xe9fc('0x14')](0x1f4,_0x587009[_0xe9fc('0x17')]));});});};exports[_0xe9fc('0x2a')]=function(_0x11bee7){var _0x2f0bdf=this;return new Promise(function(_0x37a02d,_0x3b1b90){return db[_0xe9fc('0x1d')][_0xe9fc('0x2b')](_0x11bee7[_0xe9fc('0x28')],{'raw':_0x11bee7[_0xe9fc('0x1f')]?_0x11bee7[_0xe9fc('0x1f')][_0xe9fc('0x29')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11bee7[_0xe9fc('0x1f')]?_0x11bee7['options'][_0xe9fc('0x2c')]||null:null,'attributes':_0x11bee7[_0xe9fc('0x1f')]?_0x11bee7['options']['attributes']||null:null,'limit':_0x11bee7[_0xe9fc('0x1f')]?_0x11bee7[_0xe9fc('0x1f')]['limit']||null:null})[_0xe9fc('0x25')](function(_0x4b8a0a){logger['info']('UpdateVoiceQueueReport',_0x11bee7);logger[_0xe9fc('0x11')](_0xe9fc('0x2a'),_0x11bee7,JSON[_0xe9fc('0x13')](_0x4b8a0a));_0x37a02d(_0x4b8a0a);})[_0xe9fc('0x1b')](function(_0x2b216b){logger[_0xe9fc('0x14')](_0xe9fc('0x2a'),_0x2b216b[_0xe9fc('0x17')],_0x11bee7);_0x3b1b90(_0x2f0bdf[_0xe9fc('0x14')](0x1f4,_0x2b216b[_0xe9fc('0x17')]));});});}; \ No newline at end of file +var _0x30f8=['VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','attributes','limit','include','model','map','CreateVoiceQueueReport','body','update','raw','where','UpdateVoiceQueueReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','localhost','socket.io-emitter','redis','./voiceQueueReport.socket','register','then','info'];(function(_0x3e78e5,_0x413cd6){var _0x1dae35=function(_0x4f632d){while(--_0x4f632d){_0x3e78e5['push'](_0x3e78e5['shift']());}};_0x1dae35(++_0x413cd6);}(_0x30f8,0x1db));var _0x830f=function(_0x4c3ec0,_0x56acc1){_0x4c3ec0=_0x4c3ec0-0x0;var _0x27bb25=_0x30f8[_0x4c3ec0];return _0x27bb25;};'use strict';var _=require(_0x830f('0x0'));var util=require(_0x830f('0x1'));var moment=require(_0x830f('0x2'));var BPromise=require(_0x830f('0x3'));var rs=require(_0x830f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x830f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x830f('0x6'))(_0x830f('0x7'));var config=require(_0x830f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x830f('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x830f('0xa'),'port':0x18eb});var socket=require(_0x830f('0xb'))(new Redis(config[_0x830f('0xc')]));require(_0x830f('0xd'))[_0x830f('0xe')](socket);function respondWithRpcPromise(_0x2f51f0,_0xe016f5,_0x5c31aa){return new BPromise(function(_0x3d8f79,_0xf01951){return client['request'](_0x2f51f0,_0x5c31aa)[_0x830f('0xf')](function(_0x49264c){logger[_0x830f('0x10')](_0x830f('0x11'),_0xe016f5,'request\x20sent');logger[_0x830f('0x12')](_0x830f('0x13'),_0xe016f5,_0x830f('0x14'),JSON[_0x830f('0x15')](_0x49264c));if(_0x49264c[_0x830f('0x16')]){if(_0x49264c[_0x830f('0x16')]['code']===0x1f4){logger[_0x830f('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0xe016f5,_0x49264c['error'][_0x830f('0x17')]);return _0xf01951(_0x49264c[_0x830f('0x16')][_0x830f('0x17')]);}logger[_0x830f('0x16')](_0x830f('0x11'),_0xe016f5,_0x49264c[_0x830f('0x16')][_0x830f('0x17')]);return _0x3d8f79(_0x49264c[_0x830f('0x16')][_0x830f('0x17')]);}else{logger[_0x830f('0x10')](_0x830f('0x11'),_0xe016f5,'request\x20sent');_0x3d8f79(_0x49264c[_0x830f('0x18')]['message']);}})[_0x830f('0x19')](function(_0xcaf4df){logger[_0x830f('0x16')](_0x830f('0x11'),_0xe016f5,_0xcaf4df);_0xf01951(_0xcaf4df);});});}exports[_0x830f('0x1a')]=function(_0x33fdbf){var _0x42b891=this;return new Promise(function(_0xd06383,_0x1e6b53){return db[_0x830f('0x1b')][_0x830f('0x1c')]({'raw':_0x33fdbf['options']?_0x33fdbf[_0x830f('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x33fdbf[_0x830f('0x1d')]?_0x33fdbf['options']['where']||null:null,'attributes':_0x33fdbf[_0x830f('0x1d')]?_0x33fdbf[_0x830f('0x1d')][_0x830f('0x1e')]||null:null,'limit':_0x33fdbf['options']?_0x33fdbf[_0x830f('0x1d')][_0x830f('0x1f')]||null:null,'include':_0x33fdbf['options']?_0x33fdbf[_0x830f('0x1d')][_0x830f('0x20')]?_['map'](_0x33fdbf[_0x830f('0x1d')][_0x830f('0x20')],function(_0x2aa334){return{'model':db[_0x2aa334[_0x830f('0x21')]],'as':_0x2aa334['as'],'attributes':_0x2aa334[_0x830f('0x1e')],'include':_0x2aa334[_0x830f('0x20')]?_[_0x830f('0x22')](_0x2aa334[_0x830f('0x20')],function(_0x5c703f){return{'model':db[_0x5c703f[_0x830f('0x21')]],'as':_0x5c703f['as'],'attributes':_0x5c703f[_0x830f('0x1e')],'include':_0x5c703f[_0x830f('0x20')]?_[_0x830f('0x22')](_0x5c703f[_0x830f('0x20')],function(_0x3661ae){return{'model':db[_0x3661ae[_0x830f('0x21')]],'as':_0x3661ae['as'],'attributes':_0x3661ae[_0x830f('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x186904){logger[_0x830f('0x10')](_0x830f('0x1a'),_0x33fdbf);logger['debug'](_0x830f('0x1a'),_0x33fdbf,JSON[_0x830f('0x15')](_0x186904));_0xd06383(_0x186904);})[_0x830f('0x19')](function(_0x6d3a20){logger[_0x830f('0x16')](_0x830f('0x1a'),_0x6d3a20[_0x830f('0x17')],_0x33fdbf);_0x1e6b53(_0x42b891[_0x830f('0x16')](0x1f4,_0x6d3a20['message']));});});};exports[_0x830f('0x23')]=function(_0x33c4f9){var _0x47457b=this;return new Promise(function(_0x42c19d,_0x2cef60){return db[_0x830f('0x1b')]['create'](_0x33c4f9[_0x830f('0x24')],{'raw':_0x33c4f9[_0x830f('0x1d')]?_0x33c4f9['options']['raw']===undefined?!![]:![]:!![]})[_0x830f('0xf')](function(_0x28782e){logger['info'](_0x830f('0x23'),_0x33c4f9);logger[_0x830f('0x12')](_0x830f('0x23'),_0x33c4f9,JSON[_0x830f('0x15')](_0x28782e));_0x42c19d(_0x28782e);})[_0x830f('0x19')](function(_0x46e93e){logger[_0x830f('0x16')](_0x830f('0x23'),_0x46e93e[_0x830f('0x17')],_0x33c4f9);_0x2cef60(_0x47457b['error'](0x1f4,_0x46e93e[_0x830f('0x17')]));});});};exports['UpdateVoiceQueueReport']=function(_0x592cf9){var _0x3c56d1=this;return new Promise(function(_0x4c50cd,_0x4759fc){return db['VoiceQueueReport'][_0x830f('0x25')](_0x592cf9[_0x830f('0x24')],{'raw':_0x592cf9[_0x830f('0x1d')]?_0x592cf9[_0x830f('0x1d')][_0x830f('0x26')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x592cf9['options']?_0x592cf9['options'][_0x830f('0x27')]||null:null,'attributes':_0x592cf9[_0x830f('0x1d')]?_0x592cf9[_0x830f('0x1d')][_0x830f('0x1e')]||null:null,'limit':_0x592cf9['options']?_0x592cf9[_0x830f('0x1d')]['limit']||null:null})[_0x830f('0xf')](function(_0x43cb7b){logger[_0x830f('0x10')](_0x830f('0x28'),_0x592cf9);logger[_0x830f('0x12')](_0x830f('0x28'),_0x592cf9,JSON[_0x830f('0x15')](_0x43cb7b));_0x4c50cd(_0x43cb7b);})[_0x830f('0x19')](function(_0x337f2b){logger[_0x830f('0x16')](_0x830f('0x28'),_0x337f2b[_0x830f('0x17')],_0x592cf9);_0x4759fc(_0x3c56d1[_0x830f('0x16')](0x1f4,_0x337f2b[_0x830f('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index f5e4ffa..f7b4089 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 _0x0f16=['length','voiceQueueReport:','./voiceQueueReport.events','save','update','emit','removeListener','register'];(function(_0x393b81,_0x431149){var _0x418a37=function(_0x10e77f){while(--_0x10e77f){_0x393b81['push'](_0x393b81['shift']());}};_0x418a37(++_0x431149);}(_0x0f16,0x192));var _0x60f1=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x0f16[_0x3ab51d];return _0x29a04e;};'use strict';var VoiceQueueReportEvents=require(_0x60f1('0x0'));var events=[_0x60f1('0x1'),'remove',_0x60f1('0x2')];function createListener(_0x43740b,_0x2ed9f8){return function(_0x24baa4){_0x2ed9f8[_0x60f1('0x3')](_0x43740b,_0x24baa4);};}function removeListener(_0xa34b38,_0x52d41d){return function(){VoiceQueueReportEvents[_0x60f1('0x4')](_0xa34b38,_0x52d41d);};}exports[_0x60f1('0x5')]=function(_0x433569){for(var _0x1a6566=0x0,_0xb9f761=events[_0x60f1('0x6')];_0x1a6566<_0xb9f761;_0x1a6566++){var _0x37c3d8=events[_0x1a6566];var _0x533af3=createListener(_0x60f1('0x7')+_0x37c3d8,_0x433569);VoiceQueueReportEvents['on'](_0x37c3d8,_0x533af3);}}; \ No newline at end of file +var _0xcc30=['save','update','emit','register','length','./voiceQueueReport.events'];(function(_0x1b9d2e,_0x2a8eab){var _0x48b609=function(_0x19ae19){while(--_0x19ae19){_0x1b9d2e['push'](_0x1b9d2e['shift']());}};_0x48b609(++_0x2a8eab);}(_0xcc30,0x1a9));var _0x0cc3=function(_0x5f08a6,_0x400121){_0x5f08a6=_0x5f08a6-0x0;var _0x5d0641=_0xcc30[_0x5f08a6];return _0x5d0641;};'use strict';var VoiceQueueReportEvents=require(_0x0cc3('0x0'));var events=[_0x0cc3('0x1'),'remove',_0x0cc3('0x2')];function createListener(_0x383a20,_0x52621c){return function(_0x302798){_0x52621c[_0x0cc3('0x3')](_0x383a20,_0x302798);};}function removeListener(_0x2ea6a4,_0x3191b1){return function(){VoiceQueueReportEvents['removeListener'](_0x2ea6a4,_0x3191b1);};}exports[_0x0cc3('0x4')]=function(_0x469b2b){for(var _0x97227f=0x0,_0x1d64b9=events[_0x0cc3('0x5')];_0x97227f<_0x1d64b9;_0x97227f++){var _0x46a38d=events[_0x97227f];var _0x1fe792=createListener('voiceQueueReport:'+_0x46a38d,_0x469b2b);VoiceQueueReportEvents['on'](_0x46a38d,_0x1fe792);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index f65ba28..ddd1f19 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 _0xba0b=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','/:id','post','create','put','update','delete','exports'];(function(_0x429498,_0x5686ae){var _0x4a98cc=function(_0x385ea7){while(--_0x385ea7){_0x429498['push'](_0x429498['shift']());}};_0x4a98cc(++_0x5686ae);}(_0xba0b,0x110));var _0xbba0=function(_0x2de751,_0x271b9d){_0x2de751=_0x2de751-0x0;var _0x4a1090=_0xba0b[_0x2de751];return _0x4a1090;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xbba0('0x0'));var express=require(_0xbba0('0x1'));var router=express[_0xbba0('0x2')]();var fs_extra=require(_0xbba0('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xbba0('0x4'));var config=require(_0xbba0('0x5'));var controller=require(_0xbba0('0x6'));router[_0xbba0('0x7')]('/',auth[_0xbba0('0x8')](),controller['index']);router[_0xbba0('0x7')](_0xbba0('0x9'),auth[_0xbba0('0x8')](),controller['show']);router[_0xbba0('0xa')]('/',auth[_0xbba0('0x8')](),controller[_0xbba0('0xb')]);router[_0xbba0('0xc')](_0xbba0('0x9'),auth[_0xbba0('0x8')](),controller[_0xbba0('0xd')]);router[_0xbba0('0xe')](_0xbba0('0x9'),auth[_0xbba0('0x8')](),controller['destroy']);module[_0xbba0('0xf')]=router; \ No newline at end of file +var _0xd9d4=['isAuthenticated','index','/:id','show','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get'];(function(_0x5d5380,_0x1526f1){var _0x56565a=function(_0x281023){while(--_0x281023){_0x5d5380['push'](_0x5d5380['shift']());}};_0x56565a(++_0x1526f1);}(_0xd9d4,0x15c));var _0x4d9d=function(_0x4cee4b,_0x1dfff3){_0x4cee4b=_0x4cee4b-0x0;var _0x4d891d=_0xd9d4[_0x4cee4b];return _0x4d891d;};'use strict';var multer=require(_0x4d9d('0x0'));var util=require(_0x4d9d('0x1'));var path=require(_0x4d9d('0x2'));var timeout=require(_0x4d9d('0x3'));var express=require(_0x4d9d('0x4'));var router=express[_0x4d9d('0x5')]();var fs_extra=require(_0x4d9d('0x6'));var auth=require(_0x4d9d('0x7'));var interaction=require(_0x4d9d('0x8'));var config=require(_0x4d9d('0x9'));var controller=require(_0x4d9d('0xa'));router[_0x4d9d('0xb')]('/',auth[_0x4d9d('0xc')](),controller[_0x4d9d('0xd')]);router[_0x4d9d('0xb')](_0x4d9d('0xe'),auth[_0x4d9d('0xc')](),controller[_0x4d9d('0xf')]);router['post']('/',auth[_0x4d9d('0xc')](),controller[_0x4d9d('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x4d9d('0x11')](_0x4d9d('0xe'),auth['isAuthenticated'](),controller[_0x4d9d('0x12')]);module[_0x4d9d('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 29aea9e..db3b1aa 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 _0x7e10=['exports','STRING','DATE','literal','sequelize','moment'];(function(_0x577121,_0x58c7ed){var _0x5ac570=function(_0x4d2112){while(--_0x4d2112){_0x577121['push'](_0x577121['shift']());}};_0x5ac570(++_0x58c7ed);}(_0x7e10,0xd6));var _0x07e1=function(_0x2fee72,_0x5c36ef){_0x2fee72=_0x2fee72-0x0;var _0x3eb0a6=_0x7e10[_0x2fee72];return _0x3eb0a6;};'use strict';var Sequelize=require(_0x07e1('0x0'));var moment=require(_0x07e1('0x1'));module[_0x07e1('0x2')]={'time':{'type':Sequelize[_0x07e1('0x3')]},'callid':{'type':Sequelize[_0x07e1('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x07e1('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x07e1('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x07e1('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x07e1('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x07e1('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x07e1('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x07e1('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x07e1('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x07e1('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x07e1('0x4')],'allowNull':![],'defaultValue':Sequelize[_0x07e1('0x5')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x9bc3=['STRING','DATE','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','exports'];(function(_0x31bcba,_0x50cb13){var _0x37f680=function(_0x4f682f){while(--_0x4f682f){_0x31bcba['push'](_0x31bcba['shift']());}};_0x37f680(++_0x50cb13);}(_0x9bc3,0x1e3));var _0x39bc=function(_0x5e429d,_0x2aad4e){_0x5e429d=_0x5e429d-0x0;var _0x2c962e=_0x9bc3[_0x5e429d];return _0x2c962e;};'use strict';var Sequelize=require(_0x39bc('0x0'));var moment=require(_0x39bc('0x1'));module[_0x39bc('0x2')]={'time':{'type':Sequelize[_0x39bc('0x3')]},'callid':{'type':Sequelize[_0x39bc('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x39bc('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x39bc('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x39bc('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x39bc('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x39bc('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x39bc('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x39bc('0x4')],'allowNull':![],'defaultValue':Sequelize['literal'](_0x39bc('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index a3981e6..bb4a164 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 _0x85f1=['request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','stack','name','send','index','map','VoiceQueuesLog','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','rimraf','zip-dir','fast-json-patch'];(function(_0x532112,_0x37d94b){var _0x23e5fb=function(_0x690ac8){while(--_0x690ac8){_0x532112['push'](_0x532112['shift']());}};_0x23e5fb(++_0x37d94b);}(_0x85f1,0x1b3));var _0x185f=function(_0x2f71f6,_0x3a1f4d){_0x2f71f6=_0x2f71f6-0x0;var _0x2b23ea=_0x85f1[_0x2f71f6];return _0x2b23ea;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x185f('0x0'));var zipdir=require(_0x185f('0x1'));var jsonpatch=require(_0x185f('0x2'));var rp=require(_0x185f('0x3'));var moment=require(_0x185f('0x4'));var BPromise=require(_0x185f('0x5'));var Mustache=require(_0x185f('0x6'));var util=require(_0x185f('0x7'));var path=require('path');var sox=require(_0x185f('0x8'));var csv=require(_0x185f('0x9'));var ejs=require(_0x185f('0xa'));var fs=require('fs');var fs_extra=require(_0x185f('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x185f('0xc'));var deskjs=require(_0x185f('0xd'));var toCsv=require(_0x185f('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x185f('0xe'));var authService=require(_0x185f('0xf'));var qs=require(_0x185f('0x10'));var as=require(_0x185f('0x11'));var hardwareService=require(_0x185f('0x12'));var logger=require('../../config/logger')(_0x185f('0x13'));var utils=require('../../config/utils');var config=require(_0x185f('0x14'));var licenseUtil=require(_0x185f('0x15'));var db=require(_0x185f('0x16'))['db'];function respondWithStatusCode(_0x18b936,_0x5f587c){_0x5f587c=_0x5f587c||0xcc;return function(_0x228bff){if(_0x228bff){return _0x18b936['sendStatus'](_0x5f587c);}return _0x18b936['status'](_0x5f587c)[_0x185f('0x17')]();};}function respondWithResult(_0x4c6659,_0x38ada5){_0x38ada5=_0x38ada5||0xc8;return function(_0x2b4362){if(_0x2b4362){return _0x4c6659[_0x185f('0x18')](_0x38ada5)[_0x185f('0x19')](_0x2b4362);}};}function respondWithFilteredResult(_0x1e0d59,_0x47858d){return function(_0x42ccb5){if(_0x42ccb5){var _0x37c09e=typeof _0x47858d[_0x185f('0x1a')]===_0x185f('0x1b')&&typeof _0x47858d[_0x185f('0x1c')]===_0x185f('0x1b');var _0x303505=_0x42ccb5[_0x185f('0x1d')];var _0x48ab95=_0x37c09e?0x0:_0x47858d[_0x185f('0x1a')];var _0x574a37=_0x37c09e?_0x42ccb5[_0x185f('0x1d')]:_0x47858d[_0x185f('0x1a')]+_0x47858d['limit'];var _0x2651e0;if(_0x574a37>=_0x303505){_0x574a37=_0x303505;_0x2651e0=0xc8;}else{_0x2651e0=0xce;}_0x1e0d59[_0x185f('0x18')](_0x2651e0);return _0x1e0d59[_0x185f('0x1e')](_0x185f('0x1f'),_0x48ab95+'-'+_0x574a37+'/'+_0x303505)[_0x185f('0x19')](_0x42ccb5);}return null;};}function patchUpdates(_0x50da2f){return function(_0x202bff){try{jsonpatch[_0x185f('0x20')](_0x202bff,_0x50da2f,!![]);}catch(_0x58dcb2){return BPromise['reject'](_0x58dcb2);}return _0x202bff[_0x185f('0x21')]();};}function saveUpdates(_0x41b1e0,_0x1ba0c3){return function(_0xebe7ea){if(_0xebe7ea){return _0xebe7ea[_0x185f('0x22')](_0x41b1e0)[_0x185f('0x23')](function(_0x12a281){return _0x12a281;});}return null;};}function removeEntity(_0x42fcfb,_0xc46c67){return function(_0x4515bb){if(_0x4515bb){return _0x4515bb[_0x185f('0x24')]()['then'](function(){_0x42fcfb[_0x185f('0x18')](0xcc)[_0x185f('0x17')]();});}};}function handleEntityNotFound(_0x339cb6,_0x590a50){return function(_0x4a7dcb){if(!_0x4a7dcb){_0x339cb6[_0x185f('0x25')](0x194);}return _0x4a7dcb;};}function handleError(_0x768590,_0x117044){_0x117044=_0x117044||0x1f4;return function(_0x20d033){logger['error'](_0x20d033[_0x185f('0x26')]);if(_0x20d033[_0x185f('0x27')]){delete _0x20d033[_0x185f('0x27')];}_0x768590[_0x185f('0x18')](_0x117044)[_0x185f('0x28')](_0x20d033);};}exports[_0x185f('0x29')]=function(_0x19494d,_0x3ffe8e){var _0x1b82fc={},_0x4d0fc6={},_0x4a7e2c={'count':0x0,'rows':[]};var _0x2a87ee=_[_0x185f('0x2a')](db[_0x185f('0x2b')]['rawAttributes'],function(_0x52e9a6){return{'name':_0x52e9a6[_0x185f('0x2c')],'type':_0x52e9a6[_0x185f('0x2d')][_0x185f('0x2e')]};});_0x4d0fc6[_0x185f('0x2f')]=_['map'](_0x2a87ee,_0x185f('0x27'));_0x4d0fc6[_0x185f('0x30')]=_[_0x185f('0x31')](_0x19494d[_0x185f('0x30')]);_0x4d0fc6[_0x185f('0x32')]=_[_0x185f('0x33')](_0x4d0fc6[_0x185f('0x2f')],_0x4d0fc6[_0x185f('0x30')]);_0x1b82fc[_0x185f('0x34')]=_[_0x185f('0x33')](_0x4d0fc6[_0x185f('0x2f')],qs[_0x185f('0x35')](_0x19494d[_0x185f('0x30')][_0x185f('0x35')]));_0x1b82fc[_0x185f('0x34')]=_0x1b82fc['attributes']['length']?_0x1b82fc[_0x185f('0x34')]:_0x4d0fc6['model'];if(!_0x19494d[_0x185f('0x30')]['hasOwnProperty']('nolimit')){_0x1b82fc['limit']=qs[_0x185f('0x1c')](_0x19494d[_0x185f('0x30')]['limit']);_0x1b82fc['offset']=qs['offset'](_0x19494d['query'][_0x185f('0x1a')]);}_0x1b82fc[_0x185f('0x36')]=qs['sort'](_0x19494d[_0x185f('0x30')][_0x185f('0x37')]);_0x1b82fc[_0x185f('0x38')]=qs[_0x185f('0x32')](_[_0x185f('0x39')](_0x19494d[_0x185f('0x30')],_0x4d0fc6[_0x185f('0x32')]),_0x2a87ee);if(_0x19494d['query'][_0x185f('0x3a')]){_0x1b82fc['where']=_[_0x185f('0x3b')](_0x1b82fc[_0x185f('0x38')],{'$or':_[_0x185f('0x2a')](_0x2a87ee,function(_0x7a17cd){if(_0x7a17cd[_0x185f('0x2d')]!=='VIRTUAL'){var _0x42ac54={};_0x42ac54[_0x7a17cd[_0x185f('0x27')]]={'$like':'%'+_0x19494d[_0x185f('0x30')][_0x185f('0x3a')]+'%'};return _0x42ac54;}})});}_0x1b82fc=_[_0x185f('0x3b')]({},_0x1b82fc,_0x19494d[_0x185f('0x3c')]);var _0x3eeb2a={'where':_0x1b82fc[_0x185f('0x38')]};return db[_0x185f('0x2b')][_0x185f('0x1d')](_0x3eeb2a)[_0x185f('0x23')](function(_0x4a403a){_0x4a7e2c[_0x185f('0x1d')]=_0x4a403a;if(_0x19494d[_0x185f('0x30')][_0x185f('0x3d')]){_0x1b82fc[_0x185f('0x3e')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x185f('0x3f')](_0x1b82fc);})[_0x185f('0x23')](function(_0x1613fd){_0x4a7e2c[_0x185f('0x40')]=_0x1613fd;return _0x4a7e2c;})[_0x185f('0x23')](respondWithFilteredResult(_0x3ffe8e,_0x1b82fc))[_0x185f('0x41')](handleError(_0x3ffe8e,null));};exports[_0x185f('0x42')]=function(_0x3ddb60,_0x132bbb){var _0x1d1cac={'raw':!![],'where':{'id':_0x3ddb60[_0x185f('0x43')]['id']}},_0x2fdf13={};_0x2fdf13[_0x185f('0x2f')]=_[_0x185f('0x31')](db[_0x185f('0x2b')][_0x185f('0x44')]);_0x2fdf13[_0x185f('0x30')]=_[_0x185f('0x31')](_0x3ddb60['query']);_0x2fdf13['filters']=_[_0x185f('0x33')](_0x2fdf13[_0x185f('0x2f')],_0x2fdf13[_0x185f('0x30')]);_0x1d1cac[_0x185f('0x34')]=_[_0x185f('0x33')](_0x2fdf13[_0x185f('0x2f')],qs[_0x185f('0x35')](_0x3ddb60['query'][_0x185f('0x35')]));_0x1d1cac[_0x185f('0x34')]=_0x1d1cac[_0x185f('0x34')][_0x185f('0x45')]?_0x1d1cac[_0x185f('0x34')]:_0x2fdf13[_0x185f('0x2f')];if(_0x3ddb60[_0x185f('0x30')][_0x185f('0x3d')]){_0x1d1cac[_0x185f('0x3e')]=[{'all':!![]}];}_0x1d1cac=_[_0x185f('0x3b')]({},_0x1d1cac,_0x3ddb60['options']);return db[_0x185f('0x2b')][_0x185f('0x46')](_0x1d1cac)[_0x185f('0x23')](handleEntityNotFound(_0x132bbb,null))[_0x185f('0x23')](respondWithResult(_0x132bbb,null))[_0x185f('0x41')](handleError(_0x132bbb,null));};exports['create']=function(_0x24d546,_0x20f6af){return db['VoiceQueuesLog'][_0x185f('0x47')](_0x24d546[_0x185f('0x48')],{})[_0x185f('0x23')](respondWithResult(_0x20f6af,0xc9))[_0x185f('0x41')](handleError(_0x20f6af,null));};exports[_0x185f('0x22')]=function(_0x1b3403,_0x3f4515){if(_0x1b3403[_0x185f('0x48')]['id']){delete _0x1b3403[_0x185f('0x48')]['id'];}return db['VoiceQueuesLog'][_0x185f('0x46')]({'where':{'id':_0x1b3403[_0x185f('0x43')]['id']}})['then'](handleEntityNotFound(_0x3f4515,null))[_0x185f('0x23')](saveUpdates(_0x1b3403['body'],null))[_0x185f('0x23')](respondWithResult(_0x3f4515,null))[_0x185f('0x41')](handleError(_0x3f4515,null));};exports[_0x185f('0x24')]=function(_0x43e516,_0x1ed914){return db['VoiceQueuesLog']['find']({'where':{'id':_0x43e516[_0x185f('0x43')]['id']}})[_0x185f('0x23')](handleEntityNotFound(_0x1ed914,null))['then'](removeEntity(_0x1ed914,null))[_0x185f('0x41')](handleError(_0x1ed914,null));}; \ No newline at end of file +var _0x476a=['to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','error','stack','name','send','map','VoiceQueuesLog','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','update','rimraf','zip-dir','request-promise','bluebird','mustache','sox'];(function(_0x9e0cb3,_0x9cd497){var _0x5926b7=function(_0x30e82d){while(--_0x30e82d){_0x9e0cb3['push'](_0x9e0cb3['shift']());}};_0x5926b7(++_0x9cd497);}(_0x476a,0x116));var _0xa476=function(_0x565610,_0x1a4085){_0x565610=_0x565610-0x0;var _0x89951f=_0x476a[_0x565610];return _0x89951f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa476('0x0'));var zipdir=require(_0xa476('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa476('0x2'));var moment=require('moment');var BPromise=require(_0xa476('0x3'));var Mustache=require(_0xa476('0x4'));var util=require('util');var path=require('path');var sox=require(_0xa476('0x5'));var csv=require(_0xa476('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa476('0x7'));var _=require(_0xa476('0x8'));var squel=require('squel');var crypto=require(_0xa476('0x9'));var jsforce=require(_0xa476('0xa'));var deskjs=require(_0xa476('0xb'));var toCsv=require('to-csv');var querystring=require(_0xa476('0xc'));var Papa=require(_0xa476('0xd'));var Redis=require(_0xa476('0xe'));var authService=require(_0xa476('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa476('0x10'));var logger=require('../../config/logger')(_0xa476('0x11'));var utils=require(_0xa476('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa476('0x13'))['db'];function respondWithStatusCode(_0x44dcf1,_0x4d30b0){_0x4d30b0=_0x4d30b0||0xcc;return function(_0x1a72d5){if(_0x1a72d5){return _0x44dcf1[_0xa476('0x14')](_0x4d30b0);}return _0x44dcf1[_0xa476('0x15')](_0x4d30b0)[_0xa476('0x16')]();};}function respondWithResult(_0x400817,_0x66c41){_0x66c41=_0x66c41||0xc8;return function(_0x5eb757){if(_0x5eb757){return _0x400817[_0xa476('0x15')](_0x66c41)[_0xa476('0x17')](_0x5eb757);}};}function respondWithFilteredResult(_0x1b30c5,_0x1f2d4c){return function(_0x2535aa){if(_0x2535aa){var _0x4ca37f=typeof _0x1f2d4c[_0xa476('0x18')]===_0xa476('0x19')&&typeof _0x1f2d4c[_0xa476('0x1a')]===_0xa476('0x19');var _0x488a65=_0x2535aa[_0xa476('0x1b')];var _0x2126c2=_0x4ca37f?0x0:_0x1f2d4c['offset'];var _0x3aa52b=_0x4ca37f?_0x2535aa[_0xa476('0x1b')]:_0x1f2d4c[_0xa476('0x18')]+_0x1f2d4c[_0xa476('0x1a')];var _0x2fc88c;if(_0x3aa52b>=_0x488a65){_0x3aa52b=_0x488a65;_0x2fc88c=0xc8;}else{_0x2fc88c=0xce;}_0x1b30c5[_0xa476('0x15')](_0x2fc88c);return _0x1b30c5[_0xa476('0x1c')](_0xa476('0x1d'),_0x2126c2+'-'+_0x3aa52b+'/'+_0x488a65)[_0xa476('0x17')](_0x2535aa);}return null;};}function patchUpdates(_0x54aa20){return function(_0x146208){try{jsonpatch['apply'](_0x146208,_0x54aa20,!![]);}catch(_0x46ab75){return BPromise[_0xa476('0x1e')](_0x46ab75);}return _0x146208[_0xa476('0x1f')]();};}function saveUpdates(_0x509e82,_0x1d084b){return function(_0x3553ed){if(_0x3553ed){return _0x3553ed['update'](_0x509e82)[_0xa476('0x20')](function(_0x194e34){return _0x194e34;});}return null;};}function removeEntity(_0xdaecee,_0x1bae13){return function(_0x1457ce){if(_0x1457ce){return _0x1457ce['destroy']()[_0xa476('0x20')](function(){_0xdaecee[_0xa476('0x15')](0xcc)[_0xa476('0x16')]();});}};}function handleEntityNotFound(_0x49bb64,_0x5895f3){return function(_0x52b355){if(!_0x52b355){_0x49bb64[_0xa476('0x14')](0x194);}return _0x52b355;};}function handleError(_0x39feb8,_0x485dad){_0x485dad=_0x485dad||0x1f4;return function(_0x455fe2){logger[_0xa476('0x21')](_0x455fe2[_0xa476('0x22')]);if(_0x455fe2[_0xa476('0x23')]){delete _0x455fe2['name'];}_0x39feb8['status'](_0x485dad)[_0xa476('0x24')](_0x455fe2);};}exports['index']=function(_0x4116a7,_0x335528){var _0x891196={},_0x20a0fa={},_0x533ca={'count':0x0,'rows':[]};var _0x40445f=_[_0xa476('0x25')](db[_0xa476('0x26')]['rawAttributes'],function(_0x39154a){return{'name':_0x39154a[_0xa476('0x27')],'type':_0x39154a['type'][_0xa476('0x28')]};});_0x20a0fa[_0xa476('0x29')]=_['map'](_0x40445f,_0xa476('0x23'));_0x20a0fa[_0xa476('0x2a')]=_['keys'](_0x4116a7[_0xa476('0x2a')]);_0x20a0fa[_0xa476('0x2b')]=_[_0xa476('0x2c')](_0x20a0fa[_0xa476('0x29')],_0x20a0fa[_0xa476('0x2a')]);_0x891196[_0xa476('0x2d')]=_[_0xa476('0x2c')](_0x20a0fa['model'],qs['fields'](_0x4116a7[_0xa476('0x2a')][_0xa476('0x2e')]));_0x891196[_0xa476('0x2d')]=_0x891196[_0xa476('0x2d')][_0xa476('0x2f')]?_0x891196[_0xa476('0x2d')]:_0x20a0fa[_0xa476('0x29')];if(!_0x4116a7[_0xa476('0x2a')][_0xa476('0x30')](_0xa476('0x31'))){_0x891196[_0xa476('0x1a')]=qs['limit'](_0x4116a7[_0xa476('0x2a')]['limit']);_0x891196['offset']=qs['offset'](_0x4116a7[_0xa476('0x2a')][_0xa476('0x18')]);}_0x891196[_0xa476('0x32')]=qs['sort'](_0x4116a7[_0xa476('0x2a')][_0xa476('0x33')]);_0x891196[_0xa476('0x34')]=qs[_0xa476('0x2b')](_['pick'](_0x4116a7[_0xa476('0x2a')],_0x20a0fa[_0xa476('0x2b')]),_0x40445f);if(_0x4116a7['query'][_0xa476('0x35')]){_0x891196[_0xa476('0x34')]=_[_0xa476('0x36')](_0x891196[_0xa476('0x34')],{'$or':_[_0xa476('0x25')](_0x40445f,function(_0x5b90d6){if(_0x5b90d6[_0xa476('0x37')]!==_0xa476('0x38')){var _0x2527bd={};_0x2527bd[_0x5b90d6[_0xa476('0x23')]]={'$like':'%'+_0x4116a7[_0xa476('0x2a')][_0xa476('0x35')]+'%'};return _0x2527bd;}})});}_0x891196=_[_0xa476('0x36')]({},_0x891196,_0x4116a7[_0xa476('0x39')]);var _0x385503={'where':_0x891196[_0xa476('0x34')]};return db[_0xa476('0x26')][_0xa476('0x1b')](_0x385503)[_0xa476('0x20')](function(_0x12cbc9){_0x533ca[_0xa476('0x1b')]=_0x12cbc9;if(_0x4116a7[_0xa476('0x2a')][_0xa476('0x3a')]){_0x891196[_0xa476('0x3b')]=[{'all':!![]}];}return db[_0xa476('0x26')][_0xa476('0x3c')](_0x891196);})[_0xa476('0x20')](function(_0x22af5f){_0x533ca[_0xa476('0x3d')]=_0x22af5f;return _0x533ca;})[_0xa476('0x20')](respondWithFilteredResult(_0x335528,_0x891196))[_0xa476('0x3e')](handleError(_0x335528,null));};exports[_0xa476('0x3f')]=function(_0x484176,_0x2c3989){var _0x333be4={'raw':!![],'where':{'id':_0x484176[_0xa476('0x40')]['id']}},_0x2edfe3={};_0x2edfe3[_0xa476('0x29')]=_[_0xa476('0x41')](db['VoiceQueuesLog'][_0xa476('0x42')]);_0x2edfe3['query']=_[_0xa476('0x41')](_0x484176['query']);_0x2edfe3[_0xa476('0x2b')]=_[_0xa476('0x2c')](_0x2edfe3[_0xa476('0x29')],_0x2edfe3[_0xa476('0x2a')]);_0x333be4[_0xa476('0x2d')]=_[_0xa476('0x2c')](_0x2edfe3[_0xa476('0x29')],qs[_0xa476('0x2e')](_0x484176[_0xa476('0x2a')][_0xa476('0x2e')]));_0x333be4[_0xa476('0x2d')]=_0x333be4['attributes'][_0xa476('0x2f')]?_0x333be4[_0xa476('0x2d')]:_0x2edfe3[_0xa476('0x29')];if(_0x484176[_0xa476('0x2a')]['includeAll']){_0x333be4[_0xa476('0x3b')]=[{'all':!![]}];}_0x333be4=_[_0xa476('0x36')]({},_0x333be4,_0x484176['options']);return db[_0xa476('0x26')][_0xa476('0x43')](_0x333be4)[_0xa476('0x20')](handleEntityNotFound(_0x2c3989,null))[_0xa476('0x20')](respondWithResult(_0x2c3989,null))[_0xa476('0x3e')](handleError(_0x2c3989,null));};exports[_0xa476('0x44')]=function(_0x3b737b,_0x127ad5){return db[_0xa476('0x26')][_0xa476('0x44')](_0x3b737b[_0xa476('0x45')],{})[_0xa476('0x20')](respondWithResult(_0x127ad5,0xc9))[_0xa476('0x3e')](handleError(_0x127ad5,null));};exports[_0xa476('0x46')]=function(_0x191a65,_0xd69f4c){if(_0x191a65[_0xa476('0x45')]['id']){delete _0x191a65['body']['id'];}return db['VoiceQueuesLog']['find']({'where':{'id':_0x191a65[_0xa476('0x40')]['id']}})[_0xa476('0x20')](handleEntityNotFound(_0xd69f4c,null))['then'](saveUpdates(_0x191a65[_0xa476('0x45')],null))[_0xa476('0x20')](respondWithResult(_0xd69f4c,null))[_0xa476('0x3e')](handleError(_0xd69f4c,null));};exports['destroy']=function(_0x51ead9,_0x24c069){return db[_0xa476('0x26')]['find']({'where':{'id':_0x51ead9[_0xa476('0x40')]['id']}})['then'](handleEntityNotFound(_0x24c069,null))[_0xa476('0x20')](removeEntity(_0x24c069,null))[_0xa476('0x3e')](handleError(_0x24c069,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 53e4ee8..eda9945 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 _0x40b5=['./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','dtm','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x48866b,_0x3a9140){var _0x10119a=function(_0x34236f){while(--_0x34236f){_0x48866b['push'](_0x48866b['shift']());}};_0x10119a(++_0x3a9140);}(_0x40b5,0x1d7));var _0x540b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x40b5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x540b('0x0'));var util=require(_0x540b('0x1'));var logger=require(_0x540b('0x2'))(_0x540b('0x3'));var moment=require(_0x540b('0x4'));var BPromise=require(_0x540b('0x5'));var rp=require(_0x540b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x540b('0x7'));var config=require(_0x540b('0x8'));var attributes=require(_0x540b('0x9'));module[_0x540b('0xa')]=function(_0x5b75dc,_0x4e0a29){return _0x5b75dc[_0x540b('0xb')](_0x540b('0xc'),attributes,{'tableName':_0x540b('0xd'),'paranoid':![],'indexes':[{'name':_0x540b('0xe'),'fields':['event',_0x540b('0xf')]}],'timestamps':![]});}; \ No newline at end of file +var _0x1b81=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','event_dtm','event','util','../../config/logger'];(function(_0x273ace,_0x3b28bc){var _0x5a5548=function(_0x2d2aaf){while(--_0x2d2aaf){_0x273ace['push'](_0x273ace['shift']());}};_0x5a5548(++_0x3b28bc);}(_0x1b81,0x124));var _0x11b8=function(_0x4d92bf,_0x133024){_0x4d92bf=_0x4d92bf-0x0;var _0x51209d=_0x1b81[_0x4d92bf];return _0x51209d;};'use strict';var _=require('lodash');var util=require(_0x11b8('0x0'));var logger=require(_0x11b8('0x1'))('api');var moment=require(_0x11b8('0x2'));var BPromise=require(_0x11b8('0x3'));var rp=require(_0x11b8('0x4'));var fs=require('fs');var path=require(_0x11b8('0x5'));var rimraf=require(_0x11b8('0x6'));var config=require(_0x11b8('0x7'));var attributes=require(_0x11b8('0x8'));module[_0x11b8('0x9')]=function(_0x4f74a4,_0x14b308){return _0x4f74a4[_0x11b8('0xa')](_0x11b8('0xb'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x11b8('0xc'),'fields':[_0x11b8('0xd'),'dtm']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index a9fb3f4..b82da5d 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 _0xd0e4=['result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x50a291,_0x500e37){var _0xc48b3c=function(_0x11fdb1){while(--_0x11fdb1){_0x50a291['push'](_0x50a291['shift']());}};_0xc48b3c(++_0x500e37);}(_0xd0e4,0x1ba));var _0x4d0e=function(_0xe59404,_0xc31864){_0xe59404=_0xe59404-0x0;var _0x23a1e1=_0xd0e4[_0xe59404];return _0x23a1e1;};'use strict';var _=require(_0x4d0e('0x0'));var util=require(_0x4d0e('0x1'));var moment=require('moment');var BPromise=require(_0x4d0e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4d0e('0x3'));var db=require(_0x4d0e('0x4'))['db'];var utils=require(_0x4d0e('0x5'));var logger=require(_0x4d0e('0x6'))(_0x4d0e('0x7'));var config=require(_0x4d0e('0x8'));var jayson=require(_0x4d0e('0x9'));var client=jayson[_0x4d0e('0xa')][_0x4d0e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x22059c,_0x1fedcf,_0x61f045){return new BPromise(function(_0x13d8aa,_0x5431a7){return client[_0x4d0e('0xc')](_0x22059c,_0x61f045)['then'](function(_0x2d8b3c){logger['info'](_0x4d0e('0xd'),_0x1fedcf,_0x4d0e('0xe'));logger[_0x4d0e('0xf')](_0x4d0e('0x10'),_0x1fedcf,'request\x20sent',JSON['stringify'](_0x2d8b3c));if(_0x2d8b3c[_0x4d0e('0x11')]){if(_0x2d8b3c[_0x4d0e('0x11')]['code']===0x1f4){logger[_0x4d0e('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x1fedcf,_0x2d8b3c[_0x4d0e('0x11')][_0x4d0e('0x12')]);return _0x5431a7(_0x2d8b3c[_0x4d0e('0x11')][_0x4d0e('0x12')]);}logger['error'](_0x4d0e('0xd'),_0x1fedcf,_0x2d8b3c[_0x4d0e('0x11')]['message']);return _0x13d8aa(_0x2d8b3c[_0x4d0e('0x11')][_0x4d0e('0x12')]);}else{logger[_0x4d0e('0x13')](_0x4d0e('0xd'),_0x1fedcf,'request\x20sent');_0x13d8aa(_0x2d8b3c[_0x4d0e('0x14')][_0x4d0e('0x12')]);}})['catch'](function(_0x14227){logger[_0x4d0e('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x1fedcf,_0x14227);_0x5431a7(_0x14227);});});} \ No newline at end of file +var _0xa943=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message','VoiceQueuesLog,\x20%s,\x20%s'];(function(_0x7ee850,_0x43e545){var _0x112794=function(_0xb1ac75){while(--_0xb1ac75){_0x7ee850['push'](_0x7ee850['shift']());}};_0x112794(++_0x43e545);}(_0xa943,0x105));var _0x3a94=function(_0x5d549b,_0x3f9d7d){_0x5d549b=_0x5d549b-0x0;var _0x50e18e=_0xa943[_0x5d549b];return _0x50e18e;};'use strict';var _=require(_0x3a94('0x0'));var util=require(_0x3a94('0x1'));var moment=require('moment');var BPromise=require(_0x3a94('0x2'));var rs=require(_0x3a94('0x3'));var fs=require('fs');var Redis=require(_0x3a94('0x4'));var db=require(_0x3a94('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3a94('0x6'));var config=require(_0x3a94('0x7'));var jayson=require(_0x3a94('0x8'));var client=jayson[_0x3a94('0x9')][_0x3a94('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5890d9,_0x4cce69,_0x39c753){return new BPromise(function(_0x414414,_0xc95b4e){return client[_0x3a94('0xb')](_0x5890d9,_0x39c753)[_0x3a94('0xc')](function(_0x6de0d3){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x4cce69,_0x3a94('0xd'));logger['debug'](_0x3a94('0xe'),_0x4cce69,'request\x20sent',JSON['stringify'](_0x6de0d3));if(_0x6de0d3[_0x3a94('0xf')]){if(_0x6de0d3['error'][_0x3a94('0x10')]===0x1f4){logger[_0x3a94('0xf')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4cce69,_0x6de0d3['error']['message']);return _0xc95b4e(_0x6de0d3['error']['message']);}logger[_0x3a94('0xf')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4cce69,_0x6de0d3[_0x3a94('0xf')][_0x3a94('0x11')]);return _0x414414(_0x6de0d3[_0x3a94('0xf')][_0x3a94('0x11')]);}else{logger['info'](_0x3a94('0x12'),_0x4cce69,_0x3a94('0xd'));_0x414414(_0x6de0d3['result']['message']);}})[_0x3a94('0x13')](function(_0x5978a9){logger[_0x3a94('0xf')](_0x3a94('0x12'),_0x4cce69,_0x5978a9);_0xc95b4e(_0x5978a9);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 5ad1d95..cead88a 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 _0x9f47=['show','/:id/download','download','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','get','isAuthenticated','index','describe','/:id'];(function(_0xda75e1,_0x304c57){var _0x4b6baa=function(_0x480578){while(--_0x480578){_0xda75e1['push'](_0xda75e1['shift']());}};_0x4b6baa(++_0x304c57);}(_0x9f47,0x11c));var _0x79f4=function(_0x4aaf94,_0x1b899c){_0x4aaf94=_0x4aaf94-0x0;var _0x7f9e22=_0x9f47[_0x4aaf94];return _0x7f9e22;};'use strict';var multer=require(_0x79f4('0x0'));var util=require(_0x79f4('0x1'));var path=require(_0x79f4('0x2'));var timeout=require(_0x79f4('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x79f4('0x4'));var auth=require(_0x79f4('0x5'));var interaction=require(_0x79f4('0x6'));var config=require('../../config/environment');var controller=require(_0x79f4('0x7'));router[_0x79f4('0x8')]('/',auth[_0x79f4('0x9')](),controller[_0x79f4('0xa')]);router['get']('/describe',auth[_0x79f4('0x9')](),controller[_0x79f4('0xb')]);router['get'](_0x79f4('0xc'),auth[_0x79f4('0x9')](),controller[_0x79f4('0xd')]);router[_0x79f4('0x8')](_0x79f4('0xe'),auth[_0x79f4('0x9')](),controller[_0x79f4('0xf')]);router['get']('/:id/downloads',controller[_0x79f4('0x10')]);router[_0x79f4('0x8')](_0x79f4('0x11'),auth[_0x79f4('0x9')](),controller[_0x79f4('0x12')]);router[_0x79f4('0x13')]('/',auth[_0x79f4('0x9')](),controller[_0x79f4('0x14')]);router[_0x79f4('0x13')]('/:id/transcribe',auth['isAuthenticated'](),controller[_0x79f4('0x15')]);router[_0x79f4('0x16')]('/:id',auth[_0x79f4('0x9')](),controller[_0x79f4('0x17')]);router[_0x79f4('0x18')](_0x79f4('0xc'),auth[_0x79f4('0x9')](),controller[_0x79f4('0x19')]);module[_0x79f4('0x1a')]=router; \ No newline at end of file +var _0xb414=['../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','/:id/downloads','downloads','downloadTranscribe','post','create','/:id/transcribe','runTranscribe','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xb414,0xb0));var _0x4b41=function(_0x4c46c3,_0x473368){_0x4c46c3=_0x4c46c3-0x0;var _0x5548e8=_0xb414[_0x4c46c3];return _0x5548e8;};'use strict';var multer=require('multer');var util=require(_0x4b41('0x0'));var path=require(_0x4b41('0x1'));var timeout=require(_0x4b41('0x2'));var express=require('express');var router=express[_0x4b41('0x3')]();var fs_extra=require(_0x4b41('0x4'));var auth=require(_0x4b41('0x5'));var interaction=require(_0x4b41('0x6'));var config=require('../../config/environment');var controller=require('./voiceRecording.controller');router[_0x4b41('0x7')]('/',auth[_0x4b41('0x8')](),controller[_0x4b41('0x9')]);router['get'](_0x4b41('0xa'),auth[_0x4b41('0x8')](),controller[_0x4b41('0xb')]);router[_0x4b41('0x7')](_0x4b41('0xc'),auth[_0x4b41('0x8')](),controller[_0x4b41('0xd')]);router[_0x4b41('0x7')](_0x4b41('0xe'),auth[_0x4b41('0x8')](),controller['download']);router[_0x4b41('0x7')](_0x4b41('0xf'),controller[_0x4b41('0x10')]);router[_0x4b41('0x7')]('/:id/transcribe',auth[_0x4b41('0x8')](),controller[_0x4b41('0x11')]);router[_0x4b41('0x12')]('/',auth[_0x4b41('0x8')](),controller[_0x4b41('0x13')]);router[_0x4b41('0x12')](_0x4b41('0x14'),auth[_0x4b41('0x8')](),controller[_0x4b41('0x15')]);router['put']('/:id',auth[_0x4b41('0x8')](),controller[_0x4b41('0x16')]);router[_0x4b41('0x17')](_0x4b41('0xc'),auth[_0x4b41('0x8')](),controller[_0x4b41('0x18')]);module[_0x4b41('0x19')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 55036d2..4759d45 100644 --- a/server/api/voiceRecording/voiceRecording.attributes.js +++ b/server/api/voiceRecording/voiceRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index a947918..614e600 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 _0x8060=['readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','runSentiment','sentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','sendStatus','stack','name','send','index','VoiceRecording','fieldName','type','model','map','format','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','filters','filter','merge','where','VIRTUAL','options','includeAll','include','catch','params','rawAttributes','find','body','describe','download','uniqueid','value','%s.cypher','existsSync','decryptFile','recording','ValidationError','filename','extname','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','downloads','../../components/encryptor','sequelize','MD5','col','token','$and','push','secrets','Sequelize','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','File:\x20\x22','unlinkSync','destroy','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s'];(function(_0x3ecc13,_0x3cd7ee){var _0x11add3=function(_0x543c87){while(--_0x543c87){_0x3ecc13['push'](_0x3ecc13['shift']());}};_0x11add3(++_0x3cd7ee);}(_0x8060,0xc4));var _0x0806=function(_0xe7d07d,_0x52e4e3){_0xe7d07d=_0xe7d07d-0x0;var _0x229e46=_0x8060[_0xe7d07d];return _0x229e46;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0806('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0806('0x1'));var moment=require('moment');var BPromise=require(_0x0806('0x2'));var Mustache=require(_0x0806('0x3'));var util=require(_0x0806('0x4'));var path=require(_0x0806('0x5'));var sox=require(_0x0806('0x6'));var csv=require('to-csv');var ejs=require(_0x0806('0x7'));var fs=require('fs');var fs_extra=require(_0x0806('0x8'));var _=require('lodash');var squel=require(_0x0806('0x9'));var crypto=require(_0x0806('0xa'));var jsforce=require(_0x0806('0xb'));var deskjs=require(_0x0806('0xc'));var toCsv=require(_0x0806('0xd'));var querystring=require(_0x0806('0xe'));var Papa=require('papaparse');var AWS=require('aws-sdk');var uuidv4=require(_0x0806('0xf'));var Redis=require(_0x0806('0x10'));var authService=require(_0x0806('0x11'));var qs=require(_0x0806('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0806('0x13'));var logger=require(_0x0806('0x14'))(_0x0806('0x15'));var utils=require('../../config/utils');var config=require(_0x0806('0x16'));var licenseUtil=require(_0x0806('0x17'));var db=require(_0x0806('0x18'))['db'];function respondWithStatusCode(_0x54e215,_0x3bb23e){_0x3bb23e=_0x3bb23e||0xcc;return function(_0x111782){if(_0x111782){return _0x54e215['sendStatus'](_0x3bb23e);}return _0x54e215[_0x0806('0x19')](_0x3bb23e)[_0x0806('0x1a')]();};}function respondWithResult(_0x23674e,_0x5ed58c){_0x5ed58c=_0x5ed58c||0xc8;return function(_0x254ef7){if(_0x254ef7){return _0x23674e[_0x0806('0x19')](_0x5ed58c)[_0x0806('0x1b')](_0x254ef7);}};}function respondWithFilteredResult(_0x46fdd6,_0x1d7dad){return function(_0x56c376){if(_0x56c376){var _0x2907ef=typeof _0x1d7dad['offset']===_0x0806('0x1c')&&typeof _0x1d7dad[_0x0806('0x1d')]===_0x0806('0x1c');var _0x384710=_0x56c376[_0x0806('0x1e')];var _0x37ae3e=_0x2907ef?0x0:_0x1d7dad[_0x0806('0x1f')];var _0x27f8b9=_0x2907ef?_0x56c376['count']:_0x1d7dad['offset']+_0x1d7dad[_0x0806('0x1d')];var _0x47eab8;if(_0x27f8b9>=_0x384710){_0x27f8b9=_0x384710;_0x47eab8=0xc8;}else{_0x47eab8=0xce;}_0x46fdd6['status'](_0x47eab8);return _0x46fdd6[_0x0806('0x20')](_0x0806('0x21'),_0x37ae3e+'-'+_0x27f8b9+'/'+_0x384710)[_0x0806('0x1b')](_0x56c376);}return null;};}function patchUpdates(_0x3fa16a){return function(_0x1dad0e){try{jsonpatch['apply'](_0x1dad0e,_0x3fa16a,!![]);}catch(_0x300ec1){return BPromise[_0x0806('0x22')](_0x300ec1);}return _0x1dad0e[_0x0806('0x23')]();};}function saveUpdates(_0x236ff9,_0x3845e9){return function(_0x292b74){if(_0x292b74){return _0x292b74[_0x0806('0x24')](_0x236ff9)[_0x0806('0x25')](function(_0x3ab230){return _0x3ab230;});}return null;};}function removeEntity(_0x53665b,_0x2d1aca){return function(_0x27e840){if(_0x27e840){return _0x27e840['destroy']()['then'](function(){_0x53665b[_0x0806('0x19')](0xcc)[_0x0806('0x1a')]();});}};}function handleEntityNotFound(_0x4fa0e3,_0x359af7){return function(_0x7475b3){if(!_0x7475b3){_0x4fa0e3[_0x0806('0x26')](0x194);}return _0x7475b3;};}function handleError(_0x190c1e,_0x1f8172){_0x1f8172=_0x1f8172||0x1f4;return function(_0x1de19d){logger['error'](_0x1de19d[_0x0806('0x27')]);if(_0x1de19d['name']){delete _0x1de19d[_0x0806('0x28')];}_0x190c1e[_0x0806('0x19')](_0x1f8172)[_0x0806('0x29')](_0x1de19d);};}exports[_0x0806('0x2a')]=function(_0x12325a,_0xca8b1a){var _0x3a2cec={},_0x389a14={},_0x4c70be={'count':0x0,'rows':[]};var _0x17853c=_['map'](db[_0x0806('0x2b')]['rawAttributes'],function(_0x541318){return{'name':_0x541318[_0x0806('0x2c')],'type':_0x541318[_0x0806('0x2d')]['key']};});_0x389a14[_0x0806('0x2e')]=_['differenceBy'](_[_0x0806('0x2f')](_0x17853c,'name'),[_0x0806('0x30')]);_0x389a14[_0x0806('0x31')]=_[_0x0806('0x32')](_0x12325a[_0x0806('0x31')]);_0x389a14['filters']=_[_0x0806('0x33')](_0x389a14[_0x0806('0x2e')],_0x389a14[_0x0806('0x31')]);_0x3a2cec['attributes']=_[_0x0806('0x33')](_0x389a14[_0x0806('0x2e')],qs[_0x0806('0x34')](_0x12325a[_0x0806('0x31')][_0x0806('0x34')]));_0x3a2cec[_0x0806('0x35')]=_0x3a2cec['attributes'][_0x0806('0x36')]?_0x3a2cec['attributes']:_0x389a14[_0x0806('0x2e')];if(!_0x12325a['query'][_0x0806('0x37')](_0x0806('0x38'))){_0x3a2cec[_0x0806('0x1d')]=qs[_0x0806('0x1d')](_0x12325a[_0x0806('0x31')]['limit']);_0x3a2cec[_0x0806('0x1f')]=qs[_0x0806('0x1f')](_0x12325a['query']['offset']);}_0x3a2cec['order']=qs['sort'](_0x12325a[_0x0806('0x31')]['sort']);_0x3a2cec['where']=qs[_0x0806('0x39')](_['pick'](_0x12325a[_0x0806('0x31')],_0x389a14['filters']),_0x17853c);if(_0x12325a[_0x0806('0x31')][_0x0806('0x3a')]){_0x3a2cec['where']=_[_0x0806('0x3b')](_0x3a2cec[_0x0806('0x3c')],{'$or':_[_0x0806('0x2f')](_0x17853c,function(_0x44e662){if(_0x44e662['type']!==_0x0806('0x3d')){var _0x1feae3={};_0x1feae3[_0x44e662[_0x0806('0x28')]]={'$like':'%'+_0x12325a[_0x0806('0x31')][_0x0806('0x3a')]+'%'};return _0x1feae3;}})});}_0x3a2cec=_[_0x0806('0x3b')]({},_0x3a2cec,_0x12325a[_0x0806('0x3e')]);var _0x578107={'where':_0x3a2cec[_0x0806('0x3c')]};return db[_0x0806('0x2b')][_0x0806('0x1e')](_0x578107)['then'](function(_0x46ca6d){_0x4c70be[_0x0806('0x1e')]=_0x46ca6d;if(_0x12325a[_0x0806('0x31')][_0x0806('0x3f')]){_0x3a2cec[_0x0806('0x40')]=[{'all':!![]}];}return db[_0x0806('0x2b')]['findAll'](_0x3a2cec);})['then'](function(_0x70f44e){_0x4c70be['rows']=_0x70f44e;return _0x4c70be;})[_0x0806('0x25')](respondWithFilteredResult(_0xca8b1a,_0x3a2cec))[_0x0806('0x41')](handleError(_0xca8b1a,null));};exports['show']=function(_0x5e813a,_0x1c8284){var _0x4611a6={'raw':![],'where':{'id':_0x5e813a[_0x0806('0x42')]['id']}},_0x3aa8d6={};_0x3aa8d6[_0x0806('0x2e')]=_['keys'](db[_0x0806('0x2b')][_0x0806('0x43')]);_0x3aa8d6[_0x0806('0x31')]=_[_0x0806('0x32')](_0x5e813a[_0x0806('0x31')]);_0x3aa8d6['filters']=_[_0x0806('0x33')](_0x3aa8d6['model'],_0x3aa8d6[_0x0806('0x31')]);_0x4611a6[_0x0806('0x35')]=_[_0x0806('0x33')](_0x3aa8d6[_0x0806('0x2e')],qs['fields'](_0x5e813a['query'][_0x0806('0x34')]));_0x4611a6[_0x0806('0x35')]=_0x4611a6[_0x0806('0x35')]['length']?_0x4611a6['attributes']:_0x3aa8d6[_0x0806('0x2e')];if(_0x5e813a[_0x0806('0x31')][_0x0806('0x3f')]){_0x4611a6[_0x0806('0x40')]=[{'all':!![]}];}_0x4611a6=_[_0x0806('0x3b')]({},_0x4611a6,_0x5e813a[_0x0806('0x3e')]);return db[_0x0806('0x2b')][_0x0806('0x44')](_0x4611a6)['then'](handleEntityNotFound(_0x1c8284,null))[_0x0806('0x25')](respondWithResult(_0x1c8284,null))[_0x0806('0x41')](handleError(_0x1c8284,null));};exports['create']=function(_0x3e6048,_0x597ba7){return db[_0x0806('0x2b')]['create'](_0x3e6048[_0x0806('0x45')],{})[_0x0806('0x25')](respondWithResult(_0x597ba7,0xc9))[_0x0806('0x41')](handleError(_0x597ba7,null));};exports[_0x0806('0x24')]=function(_0x305c92,_0x5d268c){if(_0x305c92[_0x0806('0x45')]['id']){delete _0x305c92[_0x0806('0x45')]['id'];}return db[_0x0806('0x2b')][_0x0806('0x44')]({'where':{'id':_0x305c92['params']['id']}})['then'](handleEntityNotFound(_0x5d268c,null))['then'](saveUpdates(_0x305c92[_0x0806('0x45')],null))['then'](respondWithResult(_0x5d268c,null))[_0x0806('0x41')](handleError(_0x5d268c,null));};exports[_0x0806('0x46')]=function(_0x2ef0c2,_0x354dd4){return db[_0x0806('0x2b')][_0x0806('0x46')]()[_0x0806('0x25')](respondWithResult(_0x354dd4,null))[_0x0806('0x41')](handleError(_0x354dd4,null));};exports[_0x0806('0x47')]=function(_0x163435,_0x2c1d84,_0x509337){var _0x445d43=require('../../components/encryptor');var _0x5e9163=![];var _0x1ae787={};if(_0x163435[_0x0806('0x31')]['type']&&_0x163435[_0x0806('0x31')][_0x0806('0x2d')]===_0x0806('0x48')){_0x1ae787[_0x0806('0x48')]=_0x163435['params']['id'];}else{_0x1ae787['id']=_0x163435[_0x0806('0x42')]['id'];}return db[_0x0806('0x2b')][_0x0806('0x44')]({'where':_0x1ae787,'attributes':['id',_0x0806('0x49')],'raw':!![]})[_0x0806('0x25')](handleEntityNotFound(_0x2c1d84,null))['then'](function(_0x32b3e0){if(_0x32b3e0){var _0x945978=_0x32b3e0['value'];var _0x3fe384=util[_0x0806('0x30')](_0x0806('0x4a'),_0x945978);if(fs[_0x0806('0x4b')](_0x3fe384)){_0x5e9163=!![];return _0x445d43[_0x0806('0x4c')](_0x3fe384,_0x945978,config['secrets'][_0x0806('0x4d')])['then'](function(){return _0x32b3e0;});}return _0x32b3e0;}})[_0x0806('0x25')](function(_0x30bd56){if(_0x30bd56){var _0xcc4026=_0x30bd56[_0x0806('0x49')];if(!fs['existsSync'](_0xcc4026)){throw new db['Sequelize'][(_0x0806('0x4e'))]('VoiceRecording\x20not\x20found');}if(_0x30bd56[_0x0806('0x4f')]){return _0x2c1d84[_0x0806('0x47')](_0xcc4026,_0x30bd56['filename']+path[_0x0806('0x50')](_0xcc4026),function(){if(_0x5e9163){fs[_0x0806('0x51')](_0xcc4026);}});}else{return _0x2c1d84['download'](_0xcc4026,function(_0x533637){if(_0x5e9163){fs[_0x0806('0x51')](_0xcc4026);}});}}})[_0x0806('0x41')](function(_0x1fb76a){if(_0x1fb76a[_0x0806('0x52')]===_0x0806('0x53')){_0x2c1d84[_0x0806('0x19')](0x194)['send'](_0x0806('0x54'));}else{return handleError(_0x2c1d84,null);}});};exports[_0x0806('0x55')]=function(_0x5a0f6b,_0xf723e,_0x103eff){var _0x5dd755=require(_0x0806('0x56'));var _0x527878=![];var _0xf20d77={'$and':[db[_0x0806('0x57')][_0x0806('0x3c')](db[_0x0806('0x57')]['fn'](_0x0806('0x58'),db[_0x0806('0x57')][_0x0806('0x59')]('uniqueid')),_0x5a0f6b[_0x0806('0x31')][_0x0806('0x5a')])]};if(_0x5a0f6b[_0x0806('0x31')][_0x0806('0x2d')]&&_0x5a0f6b[_0x0806('0x31')]['type']===_0x0806('0x48')){_0xf20d77['$and']['push']({'uniqueid':_0x5a0f6b[_0x0806('0x42')]['id']});}else{_0xf20d77[_0x0806('0x5b')][_0x0806('0x5c')]({'id':_0x5a0f6b[_0x0806('0x42')]['id']});}return db['VoiceRecording'][_0x0806('0x44')]({'where':_0xf20d77,'attributes':['id','value'],'raw':!![]})[_0x0806('0x25')](handleEntityNotFound(_0xf723e,null))[_0x0806('0x25')](function(_0x2a894d){if(_0x2a894d){var _0x199089=util['format']('%s.cypher',_0x2a894d[_0x0806('0x49')]);if(fs[_0x0806('0x4b')](_0x199089)){_0x527878=!![];return _0x5dd755['decryptFile'](_0x199089,_0x2a894d[_0x0806('0x49')],config[_0x0806('0x5d')][_0x0806('0x4d')])[_0x0806('0x25')](function(){return _0x2a894d;});}return _0x2a894d;}})[_0x0806('0x25')](function(_0xab7c1d){if(_0xab7c1d){if(!fs[_0x0806('0x4b')](_0xab7c1d[_0x0806('0x49')])){throw new db[(_0x0806('0x5e'))][(_0x0806('0x4e'))](_0x0806('0x53'));}if(_0xab7c1d[_0x0806('0x4f')]){return _0xf723e[_0x0806('0x47')](_0xab7c1d[_0x0806('0x49')],_0xab7c1d[_0x0806('0x4f')]+path[_0x0806('0x50')](_0xab7c1d[_0x0806('0x49')]),function(){if(_0x527878){fs[_0x0806('0x51')](_0xab7c1d['value']);}});}else{return _0xf723e[_0x0806('0x47')](_0xab7c1d[_0x0806('0x49')],function(_0x4bd76b){if(_0x527878){fs[_0x0806('0x51')](_0xab7c1d[_0x0806('0x49')]);}});}}})[_0x0806('0x41')](handleError(_0xf723e,null));};exports['destroy']=function(_0x2c93c9,_0x357828){return db[_0x0806('0x2b')][_0x0806('0x44')]({'where':{'id':_0x2c93c9[_0x0806('0x42')]['id']}})[_0x0806('0x25')](function(_0xca8896){if(_[_0x0806('0x5f')](_0xca8896)){throw new ReferenceError(_0x0806('0x60'));}return _0xca8896;})[_0x0806('0x25')](function(_0xc3e714){var _0x1b5553=_0xc3e714[_0x0806('0x49')];logger[_0x0806('0x61')](_0x0806('0x62'),_0x1b5553);if(!_[_0x0806('0x5f')](_0xc3e714['value'])&&fs[_0x0806('0x4b')](_0x1b5553)){logger['info']('File:\x20\x22'+_0x1b5553+_0x0806('0x63'));fs['unlinkSync'](_0x1b5553);}_0x1b5553=_0x1b5553+_0x0806('0x64');if(!_[_0x0806('0x5f')](_0xc3e714[_0x0806('0x49')])&&fs[_0x0806('0x4b')](_0x1b5553)){logger['info'](_0x0806('0x65')+_0x1b5553+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x0806('0x66')](_0x1b5553);}return _0xc3e714;})[_0x0806('0x25')](function(_0x221982){if(!_0x221982)throw new InternalError();return _0x221982[_0x0806('0x67')]();})[_0x0806('0x25')](function(){_0x357828[_0x0806('0x19')](0xcc)[_0x0806('0x1a')]();})['catch'](handleError(_0x357828,null));};function getBucketslist(_0x3acd3d,_0x2a8e8d,_0xd9fce8){return new Promise(function(_0x2823e8,_0x460120){var _0xead3db=new AWS['S3']({'accessKeyId':_0x2a8e8d,'secretAccessKey':_0x3acd3d,'region':_0xd9fce8});_0xead3db[_0x0806('0x68')]({},function(_0x28bd1b,_0x20f606){if(_0x28bd1b){return _0x460120(_0x28bd1b);}else{return _0x2823e8(_0x20f606);}});});}function createBucket(_0x4e7cd3,_0x25cf30,_0x45c97f,_0x4873d0){return new Promise(function(_0x1edcbc,_0x50b093){var _0x3c1b68=new AWS['S3']({'accessKeyId':_0x25cf30,'secretAccessKey':_0x4e7cd3,'region':_0x45c97f});_0x3c1b68[_0x0806('0x69')]({'Bucket':_0x4873d0},function(_0x5b012e,_0x4381f2){if(_0x5b012e){return _0x50b093(_0x5b012e);}else{return _0x1edcbc(_0x4381f2);}});});}function uploadFile(_0x42f391,_0xe636a7,_0x4674ae,_0x1b5715,_0x47b230,_0x50e434){return new Promise(function(_0x17b7d9,_0x5a5800){var _0x5e0c1d=new AWS['S3']({'accessKeyId':_0xe636a7,'secretAccessKey':_0x42f391,'region':_0x4674ae});_0x5e0c1d[_0x0806('0x6a')]({'Bucket':_0x1b5715,'Key':_0x47b230,'Body':_0x50e434},function(_0x3ef0fa,_0x1472fc){if(_0x3ef0fa){return _0x5a5800(_0x3ef0fa);}else{return _0x17b7d9(_0x1472fc);}});});}function startTranscribe(_0x3fa24c,_0xa6096,_0x463ba8,_0x4fee7e,_0xfb50f8,_0x43e6ff){return new Promise(function(_0x917fe8,_0x53cbf0){var _0x3421bf=new AWS[(_0x0806('0x6b'))]({'accessKeyId':_0xa6096,'secretAccessKey':_0x3fa24c,'region':_0x463ba8});_0x3421bf[_0x0806('0x6c')]({'TranscriptionJobName':_0x4fee7e,'LanguageCode':_0xfb50f8,'Media':{'MediaFileUri':_0x43e6ff}},function(_0x398590,_0x1f1d46){if(_0x398590){return _0x53cbf0(_0x398590);}else{return _0x917fe8(_0x1f1d46);}});});}function transcribe(_0x43b216,_0x110f15,_0x58a90f,_0x59e63c,_0x173d0c,_0x96c2a3,_0x1c5dbc){return new Promise(function(_0x11bdfe,_0x44ce12){var _0x29c58f={};logger[_0x0806('0x61')](util['format'](_0x0806('0x6d'),_0x43b216,_0x173d0c));return uploadFile(_0x110f15,_0x58a90f,_0x59e63c,_0x173d0c,path['basename'](_0x96c2a3),fs[_0x0806('0x6e')](_0x96c2a3))[_0x0806('0x25')](function(_0x1e8f25){logger['info'](util[_0x0806('0x30')](_0x0806('0x6f'),_0x43b216,_0x173d0c,_0x1e8f25[_0x0806('0x70')]));_0x29c58f[_0x0806('0x71')]=_0x1e8f25[_0x0806('0x72')];_0x29c58f[_0x0806('0x73')]=_0x1e8f25['Location'];logger[_0x0806('0x61')](util[_0x0806('0x30')](_0x0806('0x74'),_0x43b216));return startTranscribe(_0x110f15,_0x58a90f,_0x59e63c,uuidv4(),_0x1c5dbc,_0x1e8f25[_0x0806('0x70')]);})['then'](function(_0x2a701c){logger[_0x0806('0x61')](util['format']('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x43b216,_0x2a701c[_0x0806('0x75')][_0x0806('0x76')]));_0x29c58f[_0x0806('0x77')]=_0x2a701c[_0x0806('0x75')][_0x0806('0x76')];_0x29c58f[_0x0806('0x78')]=_0x2a701c[_0x0806('0x75')][_0x0806('0x79')];return _0x11bdfe(_0x29c58f);})[_0x0806('0x41')](function(_0x236be1){return _0x44ce12(_0x236be1);});});}exports[_0x0806('0x7a')]=function(_0xa3b9ef,_0x31126f,_0x4c5bc0){var _0x4f1e08;var _0xdf7049;var _0x3a4841;var _0xd9f385=require('../../components/encryptor');return db[_0x0806('0x2b')][_0x0806('0x7b')]({'where':{'id':_0xa3b9ef[_0x0806('0x42')]['id']}})[_0x0806('0x25')](function(_0x294bbc){if(_0x294bbc){var _0x1d0894=util[_0x0806('0x30')](_0x0806('0x4a'),_0x294bbc['value']);if(fs[_0x0806('0x4b')](_0x1d0894)){cypher=!![];return _0xd9f385[_0x0806('0x4c')](_0x1d0894,_0x294bbc[_0x0806('0x49')],config['secrets'][_0x0806('0x4d')])['then'](function(){return _0x294bbc;});}return _0x294bbc;}})[_0x0806('0x25')](function(_0x304621){if(!_0x304621){throw new db[(_0x0806('0x5e'))]['ValidationError'](_0x0806('0x7c'));}_0xdf7049=_0x304621;return db[_0x0806('0x7d')][_0x0806('0x7b')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x31126f,null))['then'](function(_0x284c19){if(_0x284c19){_0x4f1e08=_0x284c19;if(!_0x4f1e08[_0x0806('0x7e')]||!_0x4f1e08[_0x0806('0x7f')]||!_0x4f1e08[_0x0806('0x80')]||!_0x4f1e08[_0x0806('0x81')]||!_0x4f1e08[_0x0806('0x71')]){throw new db[(_0x0806('0x5e'))][(_0x0806('0x4e'))]('Transcribe\x20not\x20configured');}if(_0xa3b9ef[_0x0806('0x45')][_0x0806('0x82')]&&(!_0x4f1e08[_0x0806('0x83')]||!_0x4f1e08['sentimentAccountId']||!_0x4f1e08[_0x0806('0x84')]||!_0x4f1e08[_0x0806('0x81')]||!_0x4f1e08['bucket'])){throw new db['Sequelize']['ValidationError'](_0x0806('0x85'));}return db[_0x0806('0x86')][_0x0806('0x7b')]({'where':{'id':_0x4f1e08[_0x0806('0x7f')]}});}})[_0x0806('0x25')](function(_0xf19732){if(!_0xf19732){throw new db[(_0x0806('0x5e'))][(_0x0806('0x4e'))](_0x0806('0x87'));}if(!_0xf19732[_0x0806('0x88')]||!_0xf19732['data2']){throw new db[(_0x0806('0x5e'))][(_0x0806('0x4e'))](_0x0806('0x89'));}_0x3a4841=_0xf19732;return getBucketslist(_0x3a4841[_0x0806('0x88')],_0x3a4841[_0x0806('0x8a')],_0x4f1e08[_0x0806('0x80')]);})[_0x0806('0x25')](function(_0x28d5ae){if(_0x28d5ae&&_0x28d5ae[_0x0806('0x8b')]){var _0x4ed2df=_[_0x0806('0x44')](_0x28d5ae[_0x0806('0x8b')],function(_0x5c1c57){return _0x5c1c57[_0x0806('0x8c')]===_0x4f1e08[_0x0806('0x71')];});if(!_0x4ed2df){logger[_0x0806('0x61')](util[_0x0806('0x30')](_0x0806('0x8d'),_0xa3b9ef[_0x0806('0x42')]['id'],_0x4f1e08[_0x0806('0x71')]));return createBucket(_0x3a4841['data1'],_0x3a4841['data2'],_0x4f1e08[_0x0806('0x80')],_0x4f1e08[_0x0806('0x71')]);}logger[_0x0806('0x61')](util[_0x0806('0x30')](_0x0806('0x8e'),_0xa3b9ef['params']['id'],_0x4f1e08['bucket']));return;}})[_0x0806('0x25')](function(_0x27644e){if(_0xdf7049[_0x0806('0x78')]===_0x0806('0x8f')){return transcribe(_0xa3b9ef['params']['id'],_0x3a4841[_0x0806('0x88')],_0x3a4841['data2'],_0x4f1e08[_0x0806('0x80')],_0x4f1e08['bucket'],_0xdf7049[_0x0806('0x49')],_0x4f1e08[_0x0806('0x81')]);}else{logger[_0x0806('0x61')](util[_0x0806('0x30')](_0x0806('0x90'),_0xa3b9ef[_0x0806('0x42')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x0806('0x25')](function(_0x517ba3){if(_0x517ba3){_0x517ba3[_0x0806('0x91')]=_0xa3b9ef[_0x0806('0x45')][_0x0806('0x82')];return _0xdf7049[_0x0806('0x92')](_0x517ba3);}})[_0x0806('0x25')](respondWithResult(_0x31126f,null))[_0x0806('0x41')](handleError(_0x31126f,null));};function writeFile(_0x557c68,_0x4ace05){return new Promise(function(_0x2326dc,_0x5b0f50){fs[_0x0806('0x93')](_0x4ace05,_0x557c68,function(_0x30bbb7,_0x145780){if(_0x30bbb7){return _0x5b0f50(_0x30bbb7);}else{return _0x2326dc(_0x145780);}});});}exports['downloadTranscribe']=function(_0x2727bc,_0xaecfe0,_0x58d4dc){return db[_0x0806('0x2b')]['findOne']({'where':{'id':_0x2727bc[_0x0806('0x42')]['id']}})[_0x0806('0x25')](handleEntityNotFound(_0xaecfe0))[_0x0806('0x25')](function(_0x242908){if(_0x242908&&_0x242908['fileText']){var _0x2c9525=_0x242908[_0x0806('0x94')];var _0x3e0f71=config[_0x0806('0x95')]+_0x0806('0x96')+_0x242908['id']+_0x0806('0x97');if(fs[_0x0806('0x4b')](_0x3e0f71)){return _0x3e0f71;}return writeFile(_0x2c9525,_0x3e0f71)[_0x0806('0x25')](function(){return _0x3e0f71;});}else{throw new db[(_0x0806('0x5e'))]['ValidationError'](_0x0806('0x98'));}})[_0x0806('0x25')](function(_0x42ed45){return _0xaecfe0[_0x0806('0x47')](_0x42ed45);})['catch'](handleError(_0xaecfe0));}; \ No newline at end of file +var _0x1f89=['[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','aws-sdk','uuid/v4','ioredis','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','VoiceRecording','rawAttributes','fieldName','key','model','differenceBy','format','query','intersection','fields','attributes','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','catch','show','params','keys','create','body','find','describe','../../components/encryptor','type','uniqueid','value','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','download','Not\x20found','downloads','sequelize','MD5','col','token','push','$and','secrets','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','createBucket','upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x1f89,0x13a));var _0x91f8=function(_0x27aaea,_0x319d88){_0x27aaea=_0x27aaea-0x0;var _0x13cd31=_0x1f89[_0x27aaea];return _0x13cd31;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x91f8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x91f8('0x1'));var rp=require('request-promise');var moment=require(_0x91f8('0x2'));var BPromise=require(_0x91f8('0x3'));var Mustache=require('mustache');var util=require(_0x91f8('0x4'));var path=require(_0x91f8('0x5'));var sox=require(_0x91f8('0x6'));var csv=require(_0x91f8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x91f8('0x8'));var _=require(_0x91f8('0x9'));var squel=require('squel');var crypto=require(_0x91f8('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x91f8('0xb'));var toCsv=require('to-csv');var querystring=require(_0x91f8('0xc'));var Papa=require('papaparse');var AWS=require(_0x91f8('0xd'));var uuidv4=require(_0x91f8('0xe'));var Redis=require(_0x91f8('0xf'));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(_0x91f8('0x10'))(_0x91f8('0x11'));var utils=require('../../config/utils');var config=require(_0x91f8('0x12'));var licenseUtil=require(_0x91f8('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x108270,_0x3faaf2){_0x3faaf2=_0x3faaf2||0xcc;return function(_0x2cf0ab){if(_0x2cf0ab){return _0x108270[_0x91f8('0x14')](_0x3faaf2);}return _0x108270['status'](_0x3faaf2)[_0x91f8('0x15')]();};}function respondWithResult(_0x1cae97,_0xdc6fe6){_0xdc6fe6=_0xdc6fe6||0xc8;return function(_0x54e9f4){if(_0x54e9f4){return _0x1cae97[_0x91f8('0x16')](_0xdc6fe6)[_0x91f8('0x17')](_0x54e9f4);}};}function respondWithFilteredResult(_0x526ef6,_0x31b79a){return function(_0x5e870d){if(_0x5e870d){var _0x3d8104=typeof _0x31b79a['offset']===_0x91f8('0x18')&&typeof _0x31b79a[_0x91f8('0x19')]===_0x91f8('0x18');var _0x22de21=_0x5e870d['count'];var _0x187c91=_0x3d8104?0x0:_0x31b79a[_0x91f8('0x1a')];var _0x3b2cc7=_0x3d8104?_0x5e870d[_0x91f8('0x1b')]:_0x31b79a[_0x91f8('0x1a')]+_0x31b79a['limit'];var _0x572d4e;if(_0x3b2cc7>=_0x22de21){_0x3b2cc7=_0x22de21;_0x572d4e=0xc8;}else{_0x572d4e=0xce;}_0x526ef6[_0x91f8('0x16')](_0x572d4e);return _0x526ef6[_0x91f8('0x1c')](_0x91f8('0x1d'),_0x187c91+'-'+_0x3b2cc7+'/'+_0x22de21)['json'](_0x5e870d);}return null;};}function patchUpdates(_0x1ca013){return function(_0x7b3f24){try{jsonpatch[_0x91f8('0x1e')](_0x7b3f24,_0x1ca013,!![]);}catch(_0x8074e6){return BPromise[_0x91f8('0x1f')](_0x8074e6);}return _0x7b3f24[_0x91f8('0x20')]();};}function saveUpdates(_0x348cf4,_0x292e35){return function(_0x1c04d6){if(_0x1c04d6){return _0x1c04d6['update'](_0x348cf4)[_0x91f8('0x21')](function(_0x142b0b){return _0x142b0b;});}return null;};}function removeEntity(_0x5ef14a,_0x333354){return function(_0x360292){if(_0x360292){return _0x360292[_0x91f8('0x22')]()[_0x91f8('0x21')](function(){_0x5ef14a[_0x91f8('0x16')](0xcc)[_0x91f8('0x15')]();});}};}function handleEntityNotFound(_0x596baa,_0x5248d6){return function(_0x1dbbea){if(!_0x1dbbea){_0x596baa[_0x91f8('0x14')](0x194);}return _0x1dbbea;};}function handleError(_0x3b1f66,_0x45f219){_0x45f219=_0x45f219||0x1f4;return function(_0x18b297){logger[_0x91f8('0x23')](_0x18b297[_0x91f8('0x24')]);if(_0x18b297[_0x91f8('0x25')]){delete _0x18b297[_0x91f8('0x25')];}_0x3b1f66[_0x91f8('0x16')](_0x45f219)[_0x91f8('0x26')](_0x18b297);};}exports['index']=function(_0x2f01f3,_0x18865c){var _0x2dc115={},_0x197539={},_0x5a5ebe={'count':0x0,'rows':[]};var _0x3f2707=_[_0x91f8('0x27')](db[_0x91f8('0x28')][_0x91f8('0x29')],function(_0x487b85){return{'name':_0x487b85[_0x91f8('0x2a')],'type':_0x487b85['type'][_0x91f8('0x2b')]};});_0x197539[_0x91f8('0x2c')]=_[_0x91f8('0x2d')](_['map'](_0x3f2707,_0x91f8('0x25')),[_0x91f8('0x2e')]);_0x197539[_0x91f8('0x2f')]=_['keys'](_0x2f01f3[_0x91f8('0x2f')]);_0x197539['filters']=_[_0x91f8('0x30')](_0x197539['model'],_0x197539['query']);_0x2dc115['attributes']=_[_0x91f8('0x30')](_0x197539[_0x91f8('0x2c')],qs[_0x91f8('0x31')](_0x2f01f3['query'][_0x91f8('0x31')]));_0x2dc115[_0x91f8('0x32')]=_0x2dc115[_0x91f8('0x32')]['length']?_0x2dc115[_0x91f8('0x32')]:_0x197539['model'];if(!_0x2f01f3[_0x91f8('0x2f')]['hasOwnProperty'](_0x91f8('0x33'))){_0x2dc115[_0x91f8('0x19')]=qs['limit'](_0x2f01f3[_0x91f8('0x2f')][_0x91f8('0x19')]);_0x2dc115[_0x91f8('0x1a')]=qs[_0x91f8('0x1a')](_0x2f01f3['query'][_0x91f8('0x1a')]);}_0x2dc115['order']=qs[_0x91f8('0x34')](_0x2f01f3[_0x91f8('0x2f')][_0x91f8('0x34')]);_0x2dc115[_0x91f8('0x35')]=qs[_0x91f8('0x36')](_[_0x91f8('0x37')](_0x2f01f3[_0x91f8('0x2f')],_0x197539['filters']),_0x3f2707);if(_0x2f01f3[_0x91f8('0x2f')][_0x91f8('0x38')]){_0x2dc115[_0x91f8('0x35')]=_[_0x91f8('0x39')](_0x2dc115[_0x91f8('0x35')],{'$or':_[_0x91f8('0x27')](_0x3f2707,function(_0x407dce){if(_0x407dce['type']!=='VIRTUAL'){var _0x20f6ed={};_0x20f6ed[_0x407dce[_0x91f8('0x25')]]={'$like':'%'+_0x2f01f3[_0x91f8('0x2f')][_0x91f8('0x38')]+'%'};return _0x20f6ed;}})});}_0x2dc115=_['merge']({},_0x2dc115,_0x2f01f3[_0x91f8('0x3a')]);var _0x54c15e={'where':_0x2dc115[_0x91f8('0x35')]};return db[_0x91f8('0x28')][_0x91f8('0x1b')](_0x54c15e)[_0x91f8('0x21')](function(_0x2b123b){_0x5a5ebe[_0x91f8('0x1b')]=_0x2b123b;if(_0x2f01f3[_0x91f8('0x2f')][_0x91f8('0x3b')]){_0x2dc115[_0x91f8('0x3c')]=[{'all':!![]}];}return db[_0x91f8('0x28')]['findAll'](_0x2dc115);})[_0x91f8('0x21')](function(_0x2beb3f){_0x5a5ebe['rows']=_0x2beb3f;return _0x5a5ebe;})[_0x91f8('0x21')](respondWithFilteredResult(_0x18865c,_0x2dc115))[_0x91f8('0x3d')](handleError(_0x18865c,null));};exports[_0x91f8('0x3e')]=function(_0x57266a,_0x40a282){var _0x5859bf={'raw':![],'where':{'id':_0x57266a[_0x91f8('0x3f')]['id']}},_0x3f4bc8={};_0x3f4bc8['model']=_['keys'](db['VoiceRecording'][_0x91f8('0x29')]);_0x3f4bc8[_0x91f8('0x2f')]=_[_0x91f8('0x40')](_0x57266a['query']);_0x3f4bc8[_0x91f8('0x36')]=_[_0x91f8('0x30')](_0x3f4bc8[_0x91f8('0x2c')],_0x3f4bc8[_0x91f8('0x2f')]);_0x5859bf[_0x91f8('0x32')]=_[_0x91f8('0x30')](_0x3f4bc8[_0x91f8('0x2c')],qs[_0x91f8('0x31')](_0x57266a[_0x91f8('0x2f')][_0x91f8('0x31')]));_0x5859bf[_0x91f8('0x32')]=_0x5859bf[_0x91f8('0x32')]['length']?_0x5859bf[_0x91f8('0x32')]:_0x3f4bc8[_0x91f8('0x2c')];if(_0x57266a[_0x91f8('0x2f')][_0x91f8('0x3b')]){_0x5859bf['include']=[{'all':!![]}];}_0x5859bf=_[_0x91f8('0x39')]({},_0x5859bf,_0x57266a[_0x91f8('0x3a')]);return db[_0x91f8('0x28')]['find'](_0x5859bf)[_0x91f8('0x21')](handleEntityNotFound(_0x40a282,null))['then'](respondWithResult(_0x40a282,null))['catch'](handleError(_0x40a282,null));};exports[_0x91f8('0x41')]=function(_0x386312,_0x5f372a){return db[_0x91f8('0x28')][_0x91f8('0x41')](_0x386312[_0x91f8('0x42')],{})[_0x91f8('0x21')](respondWithResult(_0x5f372a,0xc9))[_0x91f8('0x3d')](handleError(_0x5f372a,null));};exports['update']=function(_0x16119f,_0x117e36){if(_0x16119f[_0x91f8('0x42')]['id']){delete _0x16119f[_0x91f8('0x42')]['id'];}return db[_0x91f8('0x28')][_0x91f8('0x43')]({'where':{'id':_0x16119f[_0x91f8('0x3f')]['id']}})['then'](handleEntityNotFound(_0x117e36,null))[_0x91f8('0x21')](saveUpdates(_0x16119f[_0x91f8('0x42')],null))['then'](respondWithResult(_0x117e36,null))[_0x91f8('0x3d')](handleError(_0x117e36,null));};exports['describe']=function(_0x137db9,_0x2c0e2b){return db[_0x91f8('0x28')][_0x91f8('0x44')]()['then'](respondWithResult(_0x2c0e2b,null))[_0x91f8('0x3d')](handleError(_0x2c0e2b,null));};exports['download']=function(_0x108024,_0x134c45,_0x15ef20){var _0x5775b2=require(_0x91f8('0x45'));var _0x103508=![];var _0x301699={};if(_0x108024[_0x91f8('0x2f')]['type']&&_0x108024[_0x91f8('0x2f')][_0x91f8('0x46')]===_0x91f8('0x47')){_0x301699[_0x91f8('0x47')]=_0x108024['params']['id'];}else{_0x301699['id']=_0x108024[_0x91f8('0x3f')]['id'];}return db[_0x91f8('0x28')][_0x91f8('0x43')]({'where':_0x301699,'attributes':['id',_0x91f8('0x48')],'raw':!![]})[_0x91f8('0x21')](handleEntityNotFound(_0x134c45,null))[_0x91f8('0x21')](function(_0x383e72){if(_0x383e72){var _0x51f7e9=_0x383e72[_0x91f8('0x48')];var _0xad1756=util['format'](_0x91f8('0x49'),_0x51f7e9);if(fs[_0x91f8('0x4a')](_0xad1756)){_0x103508=!![];return _0x5775b2[_0x91f8('0x4b')](_0xad1756,_0x51f7e9,config['secrets'][_0x91f8('0x4c')])[_0x91f8('0x21')](function(){return _0x383e72;});}return _0x383e72;}})[_0x91f8('0x21')](function(_0x49c00c){if(_0x49c00c){var _0x44b9fb=_0x49c00c[_0x91f8('0x48')];if(!fs[_0x91f8('0x4a')](_0x44b9fb)){throw new db[(_0x91f8('0x4d'))][(_0x91f8('0x4e'))](_0x91f8('0x4f'));}if(_0x49c00c[_0x91f8('0x50')]){return _0x134c45['download'](_0x44b9fb,_0x49c00c['filename']+path[_0x91f8('0x51')](_0x44b9fb),function(){if(_0x103508){fs[_0x91f8('0x52')](_0x44b9fb);}});}else{return _0x134c45[_0x91f8('0x53')](_0x44b9fb,function(_0x50c150){if(_0x103508){fs['unlink'](_0x44b9fb);}});}}})[_0x91f8('0x3d')](function(_0x3c9ac0){if(_0x3c9ac0['message']===_0x91f8('0x4f')){_0x134c45['status'](0x194)[_0x91f8('0x26')](_0x91f8('0x54'));}else{return handleError(_0x134c45,null);}});};exports[_0x91f8('0x55')]=function(_0x485a91,_0x582c15,_0x732bf){var _0x4487e9=require(_0x91f8('0x45'));var _0x1035dd=![];var _0x4a2573={'$and':[db[_0x91f8('0x56')][_0x91f8('0x35')](db[_0x91f8('0x56')]['fn'](_0x91f8('0x57'),db[_0x91f8('0x56')][_0x91f8('0x58')](_0x91f8('0x47'))),_0x485a91[_0x91f8('0x2f')][_0x91f8('0x59')])]};if(_0x485a91[_0x91f8('0x2f')][_0x91f8('0x46')]&&_0x485a91[_0x91f8('0x2f')][_0x91f8('0x46')]===_0x91f8('0x47')){_0x4a2573['$and'][_0x91f8('0x5a')]({'uniqueid':_0x485a91[_0x91f8('0x3f')]['id']});}else{_0x4a2573[_0x91f8('0x5b')][_0x91f8('0x5a')]({'id':_0x485a91[_0x91f8('0x3f')]['id']});}return db[_0x91f8('0x28')]['find']({'where':_0x4a2573,'attributes':['id',_0x91f8('0x48')],'raw':!![]})[_0x91f8('0x21')](handleEntityNotFound(_0x582c15,null))['then'](function(_0x4a556f){if(_0x4a556f){var _0x171f4f=util[_0x91f8('0x2e')](_0x91f8('0x49'),_0x4a556f['value']);if(fs[_0x91f8('0x4a')](_0x171f4f)){_0x1035dd=!![];return _0x4487e9['decryptFile'](_0x171f4f,_0x4a556f['value'],config[_0x91f8('0x5c')]['recording'])[_0x91f8('0x21')](function(){return _0x4a556f;});}return _0x4a556f;}})[_0x91f8('0x21')](function(_0x113bb8){if(_0x113bb8){if(!fs[_0x91f8('0x4a')](_0x113bb8[_0x91f8('0x48')])){throw new db['Sequelize']['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x113bb8[_0x91f8('0x50')]){return _0x582c15[_0x91f8('0x53')](_0x113bb8['value'],_0x113bb8[_0x91f8('0x50')]+path[_0x91f8('0x51')](_0x113bb8[_0x91f8('0x48')]),function(){if(_0x1035dd){fs[_0x91f8('0x52')](_0x113bb8[_0x91f8('0x48')]);}});}else{return _0x582c15[_0x91f8('0x53')](_0x113bb8[_0x91f8('0x48')],function(_0x5df829){if(_0x1035dd){fs[_0x91f8('0x52')](_0x113bb8[_0x91f8('0x48')]);}});}}})[_0x91f8('0x3d')](handleError(_0x582c15,null));};exports['destroy']=function(_0x36a9d6,_0x421d22){return db['VoiceRecording'][_0x91f8('0x43')]({'where':{'id':_0x36a9d6['params']['id']}})[_0x91f8('0x21')](function(_0x5b280a){if(_[_0x91f8('0x5d')](_0x5b280a)){throw new ReferenceError(_0x91f8('0x5e'));}return _0x5b280a;})['then'](function(_0x10d571){var _0x1eb3f8=_0x10d571['value'];logger[_0x91f8('0x5f')](_0x91f8('0x60'),_0x1eb3f8);if(!_['isNil'](_0x10d571[_0x91f8('0x48')])&&fs[_0x91f8('0x4a')](_0x1eb3f8)){logger[_0x91f8('0x5f')](_0x91f8('0x61')+_0x1eb3f8+_0x91f8('0x62'));fs[_0x91f8('0x63')](_0x1eb3f8);}_0x1eb3f8=_0x1eb3f8+_0x91f8('0x64');if(!_[_0x91f8('0x5d')](_0x10d571[_0x91f8('0x48')])&&fs[_0x91f8('0x4a')](_0x1eb3f8)){logger[_0x91f8('0x5f')](_0x91f8('0x61')+_0x1eb3f8+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x91f8('0x63')](_0x1eb3f8);}return _0x10d571;})['then'](function(_0x2fab1f){if(!_0x2fab1f)throw new InternalError();return _0x2fab1f[_0x91f8('0x22')]();})['then'](function(){_0x421d22[_0x91f8('0x16')](0xcc)[_0x91f8('0x15')]();})[_0x91f8('0x3d')](handleError(_0x421d22,null));};function getBucketslist(_0x170b04,_0x58586b,_0xe5bb07){return new Promise(function(_0x425268,_0x285c73){var _0x5190ff=new AWS['S3']({'accessKeyId':_0x58586b,'secretAccessKey':_0x170b04,'region':_0xe5bb07});_0x5190ff['listBuckets']({},function(_0x346253,_0x7f8e2){if(_0x346253){return _0x285c73(_0x346253);}else{return _0x425268(_0x7f8e2);}});});}function createBucket(_0x1989e5,_0x2e5199,_0x304759,_0x5b2604){return new Promise(function(_0x557445,_0x470417){var _0xac3b7a=new AWS['S3']({'accessKeyId':_0x2e5199,'secretAccessKey':_0x1989e5,'region':_0x304759});_0xac3b7a[_0x91f8('0x65')]({'Bucket':_0x5b2604},function(_0x4290b6,_0x3d9c1d){if(_0x4290b6){return _0x470417(_0x4290b6);}else{return _0x557445(_0x3d9c1d);}});});}function uploadFile(_0xdc6924,_0x4a9628,_0x378b02,_0x450ba0,_0x2d5bb4,_0x11bd72){return new Promise(function(_0x4df479,_0x11a4e8){var _0x4d6320=new AWS['S3']({'accessKeyId':_0x4a9628,'secretAccessKey':_0xdc6924,'region':_0x378b02});_0x4d6320[_0x91f8('0x66')]({'Bucket':_0x450ba0,'Key':_0x2d5bb4,'Body':_0x11bd72},function(_0x3ba590,_0x4e404b){if(_0x3ba590){return _0x11a4e8(_0x3ba590);}else{return _0x4df479(_0x4e404b);}});});}function startTranscribe(_0x2c9ca2,_0x312186,_0x2a258b,_0x420706,_0x595b96,_0x3b0afa){return new Promise(function(_0x1a6c03,_0x344e04){var _0x54feb7=new AWS[(_0x91f8('0x67'))]({'accessKeyId':_0x312186,'secretAccessKey':_0x2c9ca2,'region':_0x2a258b});_0x54feb7['startTranscriptionJob']({'TranscriptionJobName':_0x420706,'LanguageCode':_0x595b96,'Media':{'MediaFileUri':_0x3b0afa}},function(_0x1789a1,_0x267933){if(_0x1789a1){return _0x344e04(_0x1789a1);}else{return _0x1a6c03(_0x267933);}});});}function transcribe(_0x377e83,_0x286769,_0x51e424,_0x36960a,_0x198f6f,_0x2ceac3,_0x3c0838){return new Promise(function(_0xab556b,_0x34f02e){var _0x45247a={};logger[_0x91f8('0x5f')](util[_0x91f8('0x2e')](_0x91f8('0x68'),_0x377e83,_0x198f6f));return uploadFile(_0x286769,_0x51e424,_0x36960a,_0x198f6f,path[_0x91f8('0x69')](_0x2ceac3),fs[_0x91f8('0x6a')](_0x2ceac3))[_0x91f8('0x21')](function(_0x9a0e68){logger[_0x91f8('0x5f')](util[_0x91f8('0x2e')](_0x91f8('0x6b'),_0x377e83,_0x198f6f,_0x9a0e68['Location']));_0x45247a[_0x91f8('0x6c')]=_0x9a0e68[_0x91f8('0x6d')];_0x45247a[_0x91f8('0x6e')]=_0x9a0e68[_0x91f8('0x6f')];logger[_0x91f8('0x5f')](util[_0x91f8('0x2e')](_0x91f8('0x70'),_0x377e83));return startTranscribe(_0x286769,_0x51e424,_0x36960a,uuidv4(),_0x3c0838,_0x9a0e68[_0x91f8('0x6f')]);})[_0x91f8('0x21')](function(_0x2b86c5){logger[_0x91f8('0x5f')](util[_0x91f8('0x2e')](_0x91f8('0x71'),_0x377e83,_0x2b86c5[_0x91f8('0x72')][_0x91f8('0x73')]));_0x45247a[_0x91f8('0x74')]=_0x2b86c5[_0x91f8('0x72')]['TranscriptionJobName'];_0x45247a[_0x91f8('0x75')]=_0x2b86c5[_0x91f8('0x72')][_0x91f8('0x76')];return _0xab556b(_0x45247a);})[_0x91f8('0x3d')](function(_0x48db2b){return _0x34f02e(_0x48db2b);});});}exports['runTranscribe']=function(_0x2f562d,_0x22efa8,_0x27ec5c){var _0x517ff7;var _0x4ecd8d;var _0x2f70b6;var _0xd16294=require('../../components/encryptor');return db[_0x91f8('0x28')][_0x91f8('0x77')]({'where':{'id':_0x2f562d['params']['id']}})[_0x91f8('0x21')](function(_0x5337f6){if(_0x5337f6){var _0x108f0b=util['format'](_0x91f8('0x49'),_0x5337f6[_0x91f8('0x48')]);if(fs[_0x91f8('0x4a')](_0x108f0b)){cypher=!![];return _0xd16294[_0x91f8('0x4b')](_0x108f0b,_0x5337f6['value'],config[_0x91f8('0x5c')][_0x91f8('0x4c')])['then'](function(){return _0x5337f6;});}return _0x5337f6;}})['then'](function(_0x46a1fc){if(!_0x46a1fc){throw new db[(_0x91f8('0x4d'))][(_0x91f8('0x4e'))](_0x91f8('0x78'));}_0x4ecd8d=_0x46a1fc;return db[_0x91f8('0x79')][_0x91f8('0x77')]({'where':{'id':0x1}});})[_0x91f8('0x21')](handleEntityNotFound(_0x22efa8,null))[_0x91f8('0x21')](function(_0x499527){if(_0x499527){_0x517ff7=_0x499527;if(!_0x517ff7[_0x91f8('0x7a')]||!_0x517ff7['transcribeAccountId']||!_0x517ff7[_0x91f8('0x7b')]||!_0x517ff7[_0x91f8('0x7c')]||!_0x517ff7['bucket']){throw new db['Sequelize']['ValidationError'](_0x91f8('0x7d'));}if(_0x2f562d[_0x91f8('0x42')][_0x91f8('0x7e')]&&(!_0x517ff7[_0x91f8('0x7f')]||!_0x517ff7[_0x91f8('0x80')]||!_0x517ff7[_0x91f8('0x81')]||!_0x517ff7[_0x91f8('0x7c')]||!_0x517ff7[_0x91f8('0x6c')])){throw new db['Sequelize'][(_0x91f8('0x4e'))](_0x91f8('0x82'));}return db[_0x91f8('0x83')][_0x91f8('0x77')]({'where':{'id':_0x517ff7[_0x91f8('0x84')]}});}})['then'](function(_0x342d7f){if(!_0x342d7f){throw new db[(_0x91f8('0x4d'))][(_0x91f8('0x4e'))](_0x91f8('0x85'));}if(!_0x342d7f[_0x91f8('0x86')]||!_0x342d7f[_0x91f8('0x87')]){throw new db['Sequelize'][(_0x91f8('0x4e'))]('Cloud\x20Provider\x20not\x20configured');}_0x2f70b6=_0x342d7f;return getBucketslist(_0x2f70b6['data1'],_0x2f70b6[_0x91f8('0x87')],_0x517ff7[_0x91f8('0x7b')]);})[_0x91f8('0x21')](function(_0x1cc35e){if(_0x1cc35e&&_0x1cc35e[_0x91f8('0x88')]){var _0x439652=_['find'](_0x1cc35e[_0x91f8('0x88')],function(_0x51e50d){return _0x51e50d[_0x91f8('0x89')]===_0x517ff7[_0x91f8('0x6c')];});if(!_0x439652){logger[_0x91f8('0x5f')](util[_0x91f8('0x2e')](_0x91f8('0x8a'),_0x2f562d[_0x91f8('0x3f')]['id'],_0x517ff7[_0x91f8('0x6c')]));return createBucket(_0x2f70b6[_0x91f8('0x86')],_0x2f70b6[_0x91f8('0x87')],_0x517ff7[_0x91f8('0x7b')],_0x517ff7[_0x91f8('0x6c')]);}logger[_0x91f8('0x5f')](util[_0x91f8('0x2e')](_0x91f8('0x8b'),_0x2f562d[_0x91f8('0x3f')]['id'],_0x517ff7[_0x91f8('0x6c')]));return;}})[_0x91f8('0x21')](function(_0xb9f202){if(_0x4ecd8d[_0x91f8('0x75')]===_0x91f8('0x8c')){return transcribe(_0x2f562d[_0x91f8('0x3f')]['id'],_0x2f70b6[_0x91f8('0x86')],_0x2f70b6[_0x91f8('0x87')],_0x517ff7[_0x91f8('0x7b')],_0x517ff7[_0x91f8('0x6c')],_0x4ecd8d[_0x91f8('0x48')],_0x517ff7[_0x91f8('0x7c')]);}else{logger[_0x91f8('0x5f')](util[_0x91f8('0x2e')](_0x91f8('0x8d'),_0x2f562d[_0x91f8('0x3f')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x91f8('0x21')](function(_0x34f273){if(_0x34f273){_0x34f273[_0x91f8('0x8e')]=_0x2f562d['body'][_0x91f8('0x7e')];return _0x4ecd8d[_0x91f8('0x8f')](_0x34f273);}})['then'](respondWithResult(_0x22efa8,null))[_0x91f8('0x3d')](handleError(_0x22efa8,null));};function writeFile(_0x27027f,_0x35cef4){return new Promise(function(_0x932b7f,_0x3adfdd){fs[_0x91f8('0x90')](_0x35cef4,_0x27027f,function(_0x55a9c9,_0x2c99b6){if(_0x55a9c9){return _0x3adfdd(_0x55a9c9);}else{return _0x932b7f(_0x2c99b6);}});});}exports[_0x91f8('0x91')]=function(_0x29a4bb,_0x42e3ad,_0x43d1bd){return db[_0x91f8('0x28')]['findOne']({'where':{'id':_0x29a4bb[_0x91f8('0x3f')]['id']}})[_0x91f8('0x21')](handleEntityNotFound(_0x42e3ad))[_0x91f8('0x21')](function(_0x2b11a6){if(_0x2b11a6&&_0x2b11a6['fileText']){var _0x1baa63=_0x2b11a6[_0x91f8('0x92')];var _0x24894c=config[_0x91f8('0x93')]+_0x91f8('0x94')+_0x2b11a6['id']+_0x91f8('0x95');if(fs[_0x91f8('0x4a')](_0x24894c)){return _0x24894c;}return writeFile(_0x1baa63,_0x24894c)[_0x91f8('0x21')](function(){return _0x24894c;});}else{throw new db['Sequelize'][(_0x91f8('0x4e'))](_0x91f8('0x96'));}})[_0x91f8('0x21')](function(_0x369c2d){return _0x42e3ad[_0x91f8('0x53')](_0x369c2d);})[_0x91f8('0x3d')](handleError(_0x42e3ad));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index a16bf2c..4962932 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 _0x777f=['define','VoiceRecording','voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes','exports'];(function(_0x10ea40,_0x5bbe06){var _0x15ae92=function(_0x243a1c){while(--_0x243a1c){_0x10ea40['push'](_0x10ea40['shift']());}};_0x15ae92(++_0x5bbe06);}(_0x777f,0x9f));var _0xf777=function(_0x4d1ee9,_0x394a78){_0x4d1ee9=_0x4d1ee9-0x0;var _0x9a5456=_0x777f[_0x4d1ee9];return _0x9a5456;};'use strict';var attributes=require(_0xf777('0x0'));module[_0xf777('0x1')]=function(_0x41dd3a,_0x37721a){return _0x41dd3a[_0xf777('0x2')](_0xf777('0x3'),attributes,{'tableName':_0xf777('0x4'),'paranoid':![],'indexes':[{'name':_0xf777('0x5'),'fields':['uniqueid']},{'name':_0xf777('0x6'),'fields':[_0xf777('0x6')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x238f=['VoiceRecording','voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes','exports','define'];(function(_0x4e3562,_0x560d16){var _0xbff0d0=function(_0x78401e){while(--_0x78401e){_0x4e3562['push'](_0x4e3562['shift']());}};_0xbff0d0(++_0x560d16);}(_0x238f,0xa5));var _0xf238=function(_0x5481b9,_0x274c4e){_0x5481b9=_0x5481b9-0x0;var _0x5e97c8=_0x238f[_0x5481b9];return _0x5e97c8;};'use strict';var attributes=require(_0xf238('0x0'));module[_0xf238('0x1')]=function(_0x14345d,_0x58ce89){return _0x14345d[_0xf238('0x2')](_0xf238('0x3'),attributes,{'tableName':_0xf238('0x4'),'paranoid':![],'indexes':[{'name':_0xf238('0x5'),'fields':[_0xf238('0x5')]},{'name':_0xf238('0x6'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 35ff1c8..e8a9703 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 _0x81c6=['unlink','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','UpdateVoiceRecording','VoiceRecording','update','options','raw','where','limit','../../components/encryptor','Setting','findOne','create','body','existsSync','value','%s.cypher','encryptFile','secrets'];(function(_0x213ff8,_0x40cefd){var _0x35c987=function(_0x333d8e){while(--_0x333d8e){_0x213ff8['push'](_0x213ff8['shift']());}};_0x35c987(++_0x40cefd);}(_0x81c6,0x1d5));var _0x681c=function(_0x45313f,_0x46caf4){_0x45313f=_0x45313f-0x0;var _0x402910=_0x81c6[_0x45313f];return _0x402910;};'use strict';var _=require('lodash');var util=require(_0x681c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x681c('0x1'));var db=require(_0x681c('0x2'))['db'];var utils=require(_0x681c('0x3'));var logger=require('../../config/logger')(_0x681c('0x4'));var config=require(_0x681c('0x5'));var jayson=require(_0x681c('0x6'));var client=jayson[_0x681c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45331,_0xdc57a5,_0x5624d7){return new BPromise(function(_0x5b5f22,_0x1750e2){return client[_0x681c('0x8')](_0x45331,_0x5624d7)[_0x681c('0x9')](function(_0x5de78e){logger['info'](_0x681c('0xa'),_0xdc57a5,'request\x20sent');logger[_0x681c('0xb')](_0x681c('0xc'),_0xdc57a5,_0x681c('0xd'),JSON[_0x681c('0xe')](_0x5de78e));if(_0x5de78e['error']){if(_0x5de78e['error'][_0x681c('0xf')]===0x1f4){logger[_0x681c('0x10')](_0x681c('0xa'),_0xdc57a5,_0x5de78e['error'][_0x681c('0x11')]);return _0x1750e2(_0x5de78e['error'][_0x681c('0x11')]);}logger['error'](_0x681c('0xa'),_0xdc57a5,_0x5de78e[_0x681c('0x10')][_0x681c('0x11')]);return _0x5b5f22(_0x5de78e[_0x681c('0x10')][_0x681c('0x11')]);}else{logger[_0x681c('0x12')]('VoiceRecording,\x20%s,\x20%s',_0xdc57a5,_0x681c('0xd'));_0x5b5f22(_0x5de78e[_0x681c('0x13')][_0x681c('0x11')]);}})[_0x681c('0x14')](function(_0x2fce11){logger[_0x681c('0x10')]('VoiceRecording,\x20%s,\x20%s',_0xdc57a5,_0x2fce11);_0x1750e2(_0x2fce11);});});}exports[_0x681c('0x15')]=function(_0x42f506){var _0x4a9192=this;return new Promise(function(_0x42304f,_0x5b03fd){return db[_0x681c('0x16')][_0x681c('0x17')](_0x42f506['body'],{'raw':_0x42f506[_0x681c('0x18')]?_0x42f506['options'][_0x681c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42f506[_0x681c('0x18')]?_0x42f506[_0x681c('0x18')][_0x681c('0x1a')]||null:null,'attributes':_0x42f506[_0x681c('0x18')]?_0x42f506['options']['attributes']||null:null,'limit':_0x42f506['options']?_0x42f506[_0x681c('0x18')][_0x681c('0x1b')]||null:null})[_0x681c('0x9')](function(_0x27b8a0){logger[_0x681c('0x12')](_0x681c('0x15'),_0x42f506);logger[_0x681c('0xb')](_0x681c('0x15'),_0x42f506,JSON[_0x681c('0xe')](_0x27b8a0));_0x42304f(_0x27b8a0);})[_0x681c('0x14')](function(_0x2be552){logger[_0x681c('0x10')](_0x681c('0x15'),_0x2be552[_0x681c('0x11')],_0x42f506);_0x5b03fd(_0x4a9192[_0x681c('0x10')](0x1f4,_0x2be552[_0x681c('0x11')]));});});};exports['CreateVoiceRecording']=function(_0x11063b){var _0x5705a7=this;return new Promise(function(_0x5f8d64,_0x4bf08e){var _0x583499=require(_0x681c('0x1c'));var _0x17ea7c;return db[_0x681c('0x1d')][_0x681c('0x1e')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x681c('0x9')](function(_0x39fca3){_0x17ea7c=_0x39fca3;return db[_0x681c('0x16')][_0x681c('0x1f')](_0x11063b[_0x681c('0x20')]);})[_0x681c('0x9')](function(_0x2c619f){if(_0x17ea7c['callRecordingEncryption']&&fs[_0x681c('0x21')](_0x2c619f[_0x681c('0x22')])){var _0x2e783d=util['format'](_0x681c('0x23'),_0x2c619f[_0x681c('0x22')]);return _0x583499[_0x681c('0x24')](_0x2c619f['value'],_0x2e783d,config[_0x681c('0x25')]['recording'])['then'](function(){fs[_0x681c('0x26')](_0x2c619f[_0x681c('0x22')]);logger[_0x681c('0x12')]('CreateVoiceRecording\x20file\x20encrypted');return _0x2c619f;});}return _0x2c619f;})[_0x681c('0x9')](function(_0x508fb9){logger[_0x681c('0x12')]('CreateVoiceRecording',_0x11063b);logger['debug']('CreateVoiceRecording',_0x11063b,JSON[_0x681c('0xe')](_0x508fb9));_0x5f8d64(_0x508fb9);})[_0x681c('0x14')](function(_0x5a349a){logger[_0x681c('0x10')]('CreateVoiceRecording',_0x5a349a['message'],_0x11063b);_0x4bf08e(_0x5705a7[_0x681c('0x10')](0x1f4,_0x5a349a['message']));});});}; \ No newline at end of file +var _0x6050=['existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','request','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','../../components/encryptor','Setting','findOne','callRecordingEncryption'];(function(_0x5af407,_0x531c8d){var _0x4301b1=function(_0x45f4ed){while(--_0x45f4ed){_0x5af407['push'](_0x5af407['shift']());}};_0x4301b1(++_0x531c8d);}(_0x6050,0x196));var _0x0605=function(_0x4a2bbe,_0x1e5d3b){_0x4a2bbe=_0x4a2bbe-0x0;var _0x326ded=_0x6050[_0x4a2bbe];return _0x326ded;};'use strict';var _=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var moment=require(_0x0605('0x2'));var BPromise=require(_0x0605('0x3'));var rs=require(_0x0605('0x4'));var fs=require('fs');var Redis=require(_0x0605('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0605('0x6'));var logger=require(_0x0605('0x7'))(_0x0605('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0605('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x578623,_0x58f7d2,_0x5660ad){return new BPromise(function(_0x1629bf,_0x11b8b5){return client[_0x0605('0xa')](_0x578623,_0x5660ad)[_0x0605('0xb')](function(_0x44fdd3){logger['info'](_0x0605('0xc'),_0x58f7d2,_0x0605('0xd'));logger[_0x0605('0xe')](_0x0605('0xf'),_0x58f7d2,_0x0605('0xd'),JSON[_0x0605('0x10')](_0x44fdd3));if(_0x44fdd3[_0x0605('0x11')]){if(_0x44fdd3[_0x0605('0x11')][_0x0605('0x12')]===0x1f4){logger[_0x0605('0x11')](_0x0605('0xc'),_0x58f7d2,_0x44fdd3[_0x0605('0x11')][_0x0605('0x13')]);return _0x11b8b5(_0x44fdd3[_0x0605('0x11')][_0x0605('0x13')]);}logger[_0x0605('0x11')](_0x0605('0xc'),_0x58f7d2,_0x44fdd3[_0x0605('0x11')][_0x0605('0x13')]);return _0x1629bf(_0x44fdd3['error'][_0x0605('0x13')]);}else{logger[_0x0605('0x14')](_0x0605('0xc'),_0x58f7d2,'request\x20sent');_0x1629bf(_0x44fdd3['result'][_0x0605('0x13')]);}})[_0x0605('0x15')](function(_0xa83443){logger[_0x0605('0x11')](_0x0605('0xc'),_0x58f7d2,_0xa83443);_0x11b8b5(_0xa83443);});});}exports[_0x0605('0x16')]=function(_0x2b7b5a){var _0x1d57ba=this;return new Promise(function(_0x193520,_0x40abb2){return db[_0x0605('0x17')][_0x0605('0x18')](_0x2b7b5a[_0x0605('0x19')],{'raw':_0x2b7b5a[_0x0605('0x1a')]?_0x2b7b5a['options'][_0x0605('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b7b5a[_0x0605('0x1a')]?_0x2b7b5a[_0x0605('0x1a')][_0x0605('0x1c')]||null:null,'attributes':_0x2b7b5a[_0x0605('0x1a')]?_0x2b7b5a[_0x0605('0x1a')][_0x0605('0x1d')]||null:null,'limit':_0x2b7b5a[_0x0605('0x1a')]?_0x2b7b5a[_0x0605('0x1a')]['limit']||null:null})[_0x0605('0xb')](function(_0x4fe293){logger[_0x0605('0x14')](_0x0605('0x16'),_0x2b7b5a);logger[_0x0605('0xe')](_0x0605('0x16'),_0x2b7b5a,JSON[_0x0605('0x10')](_0x4fe293));_0x193520(_0x4fe293);})[_0x0605('0x15')](function(_0x2ea61d){logger[_0x0605('0x11')](_0x0605('0x16'),_0x2ea61d[_0x0605('0x13')],_0x2b7b5a);_0x40abb2(_0x1d57ba[_0x0605('0x11')](0x1f4,_0x2ea61d[_0x0605('0x13')]));});});};exports['CreateVoiceRecording']=function(_0x6bc204){var _0x3c8e36=this;return new Promise(function(_0x4b1e0c,_0x4d9a31){var _0x55ebd8=require(_0x0605('0x1e'));var _0x226825;return db[_0x0605('0x1f')][_0x0605('0x20')]({'attributes':['id',_0x0605('0x21')],'where':{'id':0x1},'raw':!![]})[_0x0605('0xb')](function(_0x4e32ef){_0x226825=_0x4e32ef;return db[_0x0605('0x17')]['create'](_0x6bc204[_0x0605('0x19')]);})[_0x0605('0xb')](function(_0x421c26){if(_0x226825[_0x0605('0x21')]&&fs[_0x0605('0x22')](_0x421c26[_0x0605('0x23')])){var _0x56dd1a=util[_0x0605('0x24')](_0x0605('0x25'),_0x421c26[_0x0605('0x23')]);return _0x55ebd8[_0x0605('0x26')](_0x421c26[_0x0605('0x23')],_0x56dd1a,config[_0x0605('0x27')][_0x0605('0x28')])[_0x0605('0xb')](function(){fs[_0x0605('0x29')](_0x421c26[_0x0605('0x23')]);logger[_0x0605('0x14')](_0x0605('0x2a'));return _0x421c26;});}return _0x421c26;})[_0x0605('0xb')](function(_0x992e4f){logger[_0x0605('0x14')](_0x0605('0x2b'),_0x6bc204);logger[_0x0605('0xe')](_0x0605('0x2b'),_0x6bc204,JSON[_0x0605('0x10')](_0x992e4f));_0x4b1e0c(_0x992e4f);})[_0x0605('0x15')](function(_0x3a1c75){logger[_0x0605('0x11')](_0x0605('0x2b'),_0x3a1c75[_0x0605('0x13')],_0x6bc204);_0x4d9a31(_0x3c8e36[_0x0605('0x11')](0x1f4,_0x3a1c75[_0x0605('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index dca6513..50cccc2 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 _0xc9fa=['delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','create','update'];(function(_0x3a5f6d,_0x31ab94){var _0x53eb2d=function(_0x54fa5e){while(--_0x54fa5e){_0x3a5f6d['push'](_0x3a5f6d['shift']());}};_0x53eb2d(++_0x31ab94);}(_0xc9fa,0x146));var _0xac9f=function(_0xf6aec0,_0x51ffd6){_0xf6aec0=_0xf6aec0-0x0;var _0x59a51b=_0xc9fa[_0xf6aec0];return _0x59a51b;};'use strict';var multer=require(_0xac9f('0x0'));var util=require(_0xac9f('0x1'));var path=require(_0xac9f('0x2'));var timeout=require(_0xac9f('0x3'));var express=require('express');var router=express[_0xac9f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xac9f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xac9f('0x6'));var controller=require('./voiceTransferReport.controller');router[_0xac9f('0x7')]('/',auth[_0xac9f('0x8')](),controller['index']);router[_0xac9f('0x7')](_0xac9f('0x9'),auth[_0xac9f('0x8')](),controller['describe']);router[_0xac9f('0x7')](_0xac9f('0xa'),auth[_0xac9f('0x8')](),controller[_0xac9f('0xb')]);router['post']('/',auth[_0xac9f('0x8')](),controller[_0xac9f('0xc')]);router['put'](_0xac9f('0xa'),auth['isAuthenticated'](),controller[_0xac9f('0xd')]);router[_0xac9f('0xe')](_0xac9f('0xa'),auth[_0xac9f('0x8')](),controller[_0xac9f('0xf')]);module[_0xac9f('0x10')]=router; \ No newline at end of file +var _0xc1b8=['show','create','put','update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0xc1b8,0xaf));var _0x8c1b=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xc1b8[_0x47a7d0];return _0xb9bd08;};'use strict';var multer=require(_0x8c1b('0x0'));var util=require(_0x8c1b('0x1'));var path=require(_0x8c1b('0x2'));var timeout=require('connect-timeout');var express=require(_0x8c1b('0x3'));var router=express[_0x8c1b('0x4')]();var fs_extra=require(_0x8c1b('0x5'));var auth=require(_0x8c1b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8c1b('0x7'));var controller=require('./voiceTransferReport.controller');router[_0x8c1b('0x8')]('/',auth['isAuthenticated'](),controller[_0x8c1b('0x9')]);router[_0x8c1b('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x8c1b('0xa'),auth[_0x8c1b('0xb')](),controller[_0x8c1b('0xc')]);router['post']('/',auth[_0x8c1b('0xb')](),controller[_0x8c1b('0xd')]);router[_0x8c1b('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x8c1b('0xf')]);router['delete']('/:id',auth[_0x8c1b('0xb')](),controller['destroy']);module[_0x8c1b('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 3d4e742..c6577db 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 _0x839d=['Yes','sequelize','moment','exports','ENUM','attended','STRING'];(function(_0x169829,_0x20ef07){var _0x103c21=function(_0x38a06f){while(--_0x38a06f){_0x169829['push'](_0x169829['shift']());}};_0x103c21(++_0x20ef07);}(_0x839d,0xd3));var _0xd839=function(_0x2170e1,_0x46e775){_0x2170e1=_0x2170e1-0x0;var _0x2c5727=_0x839d[_0x2170e1];return _0x2c5727;};'use strict';var Sequelize=require(_0xd839('0x0'));var moment=require(_0xd839('0x1'));module[_0xd839('0x2')]={'type':{'type':Sequelize[_0xd839('0x3')]('blind',_0xd839('0x4'))},'result':{'type':Sequelize[_0xd839('0x5')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0xd839('0x5')]},'transferercalleridname':{'type':Sequelize[_0xd839('0x5')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0xd839('0x5')]},'transferercontext':{'type':Sequelize[_0xd839('0x5')]},'transfererexten':{'type':Sequelize[_0xd839('0x5')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xd839('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xd839('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xd839('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xd839('0x5')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0xd839('0x5')]},'transfereecontext':{'type':Sequelize[_0xd839('0x5')]},'transfereeexten':{'type':Sequelize[_0xd839('0x5')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM'](_0xd839('0x6'),'No')},'context':{'type':Sequelize[_0xd839('0x5')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1e83=['blind','attended','STRING','Yes','sequelize','moment','ENUM'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1e83,0x123));var _0x31e8=function(_0x19e8d3,_0x2ef3a7){_0x19e8d3=_0x19e8d3-0x0;var _0x51ab83=_0x1e83[_0x19e8d3];return _0x51ab83;};'use strict';var Sequelize=require(_0x31e8('0x0'));var moment=require(_0x31e8('0x1'));module['exports']={'type':{'type':Sequelize[_0x31e8('0x2')](_0x31e8('0x3'),_0x31e8('0x4'))},'result':{'type':Sequelize[_0x31e8('0x5')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x31e8('0x5')]},'transferercalleridname':{'type':Sequelize[_0x31e8('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x31e8('0x5')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x31e8('0x5')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x31e8('0x5')]},'transfereechannel':{'type':Sequelize[_0x31e8('0x5')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x31e8('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x31e8('0x5')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x31e8('0x5')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x31e8('0x5')]},'isexternal':{'type':Sequelize[_0x31e8('0x2')](_0x31e8('0x6'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x31e8('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 18cc0b7..c69ac69 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 _0x7caa=['destroy','params','describe','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','type','key','query','keys','filters','intersection','fields','attributes','model','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','length','includeAll','find','create','body'];(function(_0x2cfb48,_0x24b83b){var _0xc4594f=function(_0x3bc089){while(--_0x3bc089){_0x2cfb48['push'](_0x2cfb48['shift']());}};_0xc4594f(++_0x24b83b);}(_0x7caa,0x91));var _0xa7ca=function(_0x5440c9,_0x7fb26a){_0x5440c9=_0x5440c9-0x0;var _0x58a77=_0x7caa[_0x5440c9];return _0x58a77;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa7ca('0x0'));var zipdir=require(_0xa7ca('0x1'));var jsonpatch=require(_0xa7ca('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa7ca('0x3'));var Mustache=require(_0xa7ca('0x4'));var util=require('util');var path=require(_0xa7ca('0x5'));var sox=require('sox');var csv=require(_0xa7ca('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa7ca('0x7'));var _=require(_0xa7ca('0x8'));var squel=require(_0xa7ca('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa7ca('0xa'));var toCsv=require(_0xa7ca('0x6'));var querystring=require(_0xa7ca('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa7ca('0xc'));var qs=require(_0xa7ca('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa7ca('0xe'));var logger=require('../../config/logger')(_0xa7ca('0xf'));var utils=require('../../config/utils');var config=require(_0xa7ca('0x10'));var licenseUtil=require(_0xa7ca('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x162420,_0x530b3e){_0x530b3e=_0x530b3e||0xcc;return function(_0xf43100){if(_0xf43100){return _0x162420[_0xa7ca('0x12')](_0x530b3e);}return _0x162420[_0xa7ca('0x13')](_0x530b3e)[_0xa7ca('0x14')]();};}function respondWithResult(_0x2fab50,_0x34508b){_0x34508b=_0x34508b||0xc8;return function(_0xc8ff00){if(_0xc8ff00){return _0x2fab50[_0xa7ca('0x13')](_0x34508b)[_0xa7ca('0x15')](_0xc8ff00);}};}function respondWithFilteredResult(_0x1ca802,_0x1f68c2){return function(_0x47938c){if(_0x47938c){var _0x894509=typeof _0x1f68c2[_0xa7ca('0x16')]==='undefined'&&typeof _0x1f68c2[_0xa7ca('0x17')]===_0xa7ca('0x18');var _0x5c4a0d=_0x47938c[_0xa7ca('0x19')];var _0x79da73=_0x894509?0x0:_0x1f68c2['offset'];var _0x3c167e=_0x894509?_0x47938c[_0xa7ca('0x19')]:_0x1f68c2[_0xa7ca('0x16')]+_0x1f68c2[_0xa7ca('0x17')];var _0x3df717;if(_0x3c167e>=_0x5c4a0d){_0x3c167e=_0x5c4a0d;_0x3df717=0xc8;}else{_0x3df717=0xce;}_0x1ca802[_0xa7ca('0x13')](_0x3df717);return _0x1ca802[_0xa7ca('0x1a')](_0xa7ca('0x1b'),_0x79da73+'-'+_0x3c167e+'/'+_0x5c4a0d)[_0xa7ca('0x15')](_0x47938c);}return null;};}function patchUpdates(_0x4c7c76){return function(_0x4ac140){try{jsonpatch[_0xa7ca('0x1c')](_0x4ac140,_0x4c7c76,!![]);}catch(_0x375516){return BPromise[_0xa7ca('0x1d')](_0x375516);}return _0x4ac140[_0xa7ca('0x1e')]();};}function saveUpdates(_0x2e7cad,_0x1aeeee){return function(_0x44b645){if(_0x44b645){return _0x44b645[_0xa7ca('0x1f')](_0x2e7cad)[_0xa7ca('0x20')](function(_0x3fd965){return _0x3fd965;});}return null;};}function removeEntity(_0x36edb7,_0x5b65bf){return function(_0x552066){if(_0x552066){return _0x552066['destroy']()['then'](function(){_0x36edb7[_0xa7ca('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbf45ae,_0x51e191){return function(_0x1b7a3e){if(!_0x1b7a3e){_0xbf45ae['sendStatus'](0x194);}return _0x1b7a3e;};}function handleError(_0x18dc2d,_0x179f3b){_0x179f3b=_0x179f3b||0x1f4;return function(_0x5d6ff9){logger[_0xa7ca('0x21')](_0x5d6ff9[_0xa7ca('0x22')]);if(_0x5d6ff9[_0xa7ca('0x23')]){delete _0x5d6ff9['name'];}_0x18dc2d[_0xa7ca('0x13')](_0x179f3b)[_0xa7ca('0x24')](_0x5d6ff9);};}exports[_0xa7ca('0x25')]=function(_0x3440e0,_0x495cf5){var _0x2a65ae={},_0x243d1e={},_0x1ed092={'count':0x0,'rows':[]};var _0x3651ab=_[_0xa7ca('0x26')](db[_0xa7ca('0x27')][_0xa7ca('0x28')],function(_0x484833){return{'name':_0x484833['fieldName'],'type':_0x484833[_0xa7ca('0x29')][_0xa7ca('0x2a')]};});_0x243d1e['model']=_[_0xa7ca('0x26')](_0x3651ab,'name');_0x243d1e[_0xa7ca('0x2b')]=_[_0xa7ca('0x2c')](_0x3440e0[_0xa7ca('0x2b')]);_0x243d1e[_0xa7ca('0x2d')]=_['intersection'](_0x243d1e['model'],_0x243d1e['query']);_0x2a65ae['attributes']=_[_0xa7ca('0x2e')](_0x243d1e['model'],qs[_0xa7ca('0x2f')](_0x3440e0[_0xa7ca('0x2b')][_0xa7ca('0x2f')]));_0x2a65ae[_0xa7ca('0x30')]=_0x2a65ae[_0xa7ca('0x30')]['length']?_0x2a65ae[_0xa7ca('0x30')]:_0x243d1e[_0xa7ca('0x31')];if(!_0x3440e0[_0xa7ca('0x2b')]['hasOwnProperty'](_0xa7ca('0x32'))){_0x2a65ae['limit']=qs['limit'](_0x3440e0[_0xa7ca('0x2b')][_0xa7ca('0x17')]);_0x2a65ae[_0xa7ca('0x16')]=qs[_0xa7ca('0x16')](_0x3440e0[_0xa7ca('0x2b')][_0xa7ca('0x16')]);}_0x2a65ae['order']=qs['sort'](_0x3440e0[_0xa7ca('0x2b')][_0xa7ca('0x33')]);_0x2a65ae[_0xa7ca('0x34')]=qs[_0xa7ca('0x2d')](_[_0xa7ca('0x35')](_0x3440e0[_0xa7ca('0x2b')],_0x243d1e[_0xa7ca('0x2d')]),_0x3651ab);if(_0x3440e0['query'][_0xa7ca('0x36')]){_0x2a65ae[_0xa7ca('0x34')]=_['merge'](_0x2a65ae[_0xa7ca('0x34')],{'$or':_[_0xa7ca('0x26')](_0x3651ab,function(_0x315fc0){if(_0x315fc0['type']!==_0xa7ca('0x37')){var _0x3de0bf={};_0x3de0bf[_0x315fc0['name']]={'$like':'%'+_0x3440e0[_0xa7ca('0x2b')]['filter']+'%'};return _0x3de0bf;}})});}_0x2a65ae=_[_0xa7ca('0x38')]({},_0x2a65ae,_0x3440e0[_0xa7ca('0x39')]);var _0xa3597f={'where':_0x2a65ae[_0xa7ca('0x34')]};return db[_0xa7ca('0x27')][_0xa7ca('0x19')](_0xa3597f)[_0xa7ca('0x20')](function(_0x444fce){_0x1ed092[_0xa7ca('0x19')]=_0x444fce;if(_0x3440e0[_0xa7ca('0x2b')]['includeAll']){_0x2a65ae[_0xa7ca('0x3a')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0xa7ca('0x3b')](_0x2a65ae);})['then'](function(_0x1ab177){_0x1ed092[_0xa7ca('0x3c')]=_0x1ab177;return _0x1ed092;})['then'](respondWithFilteredResult(_0x495cf5,_0x2a65ae))[_0xa7ca('0x3d')](handleError(_0x495cf5,null));};exports[_0xa7ca('0x3e')]=function(_0x4d4603,_0x187acf){var _0x41b819={'raw':!![],'where':{'id':_0x4d4603['params']['id']}},_0x4964c9={};_0x4964c9[_0xa7ca('0x31')]=_[_0xa7ca('0x2c')](db[_0xa7ca('0x27')][_0xa7ca('0x28')]);_0x4964c9[_0xa7ca('0x2b')]=_[_0xa7ca('0x2c')](_0x4d4603[_0xa7ca('0x2b')]);_0x4964c9[_0xa7ca('0x2d')]=_[_0xa7ca('0x2e')](_0x4964c9[_0xa7ca('0x31')],_0x4964c9[_0xa7ca('0x2b')]);_0x41b819['attributes']=_[_0xa7ca('0x2e')](_0x4964c9['model'],qs['fields'](_0x4d4603['query'][_0xa7ca('0x2f')]));_0x41b819[_0xa7ca('0x30')]=_0x41b819['attributes'][_0xa7ca('0x3f')]?_0x41b819[_0xa7ca('0x30')]:_0x4964c9[_0xa7ca('0x31')];if(_0x4d4603[_0xa7ca('0x2b')][_0xa7ca('0x40')]){_0x41b819[_0xa7ca('0x3a')]=[{'all':!![]}];}_0x41b819=_[_0xa7ca('0x38')]({},_0x41b819,_0x4d4603[_0xa7ca('0x39')]);return db[_0xa7ca('0x27')][_0xa7ca('0x41')](_0x41b819)['then'](handleEntityNotFound(_0x187acf,null))[_0xa7ca('0x20')](respondWithResult(_0x187acf,null))['catch'](handleError(_0x187acf,null));};exports[_0xa7ca('0x42')]=function(_0x3d56ec,_0x2c6692){return db[_0xa7ca('0x27')][_0xa7ca('0x42')](_0x3d56ec[_0xa7ca('0x43')],{})[_0xa7ca('0x20')](respondWithResult(_0x2c6692,0xc9))['catch'](handleError(_0x2c6692,null));};exports[_0xa7ca('0x1f')]=function(_0x4037bb,_0x12cca9){if(_0x4037bb[_0xa7ca('0x43')]['id']){delete _0x4037bb[_0xa7ca('0x43')]['id'];}return db[_0xa7ca('0x27')][_0xa7ca('0x41')]({'where':{'id':_0x4037bb['params']['id']}})[_0xa7ca('0x20')](handleEntityNotFound(_0x12cca9,null))[_0xa7ca('0x20')](saveUpdates(_0x4037bb[_0xa7ca('0x43')],null))['then'](respondWithResult(_0x12cca9,null))['catch'](handleError(_0x12cca9,null));};exports[_0xa7ca('0x44')]=function(_0x5e070f,_0x244334){return db[_0xa7ca('0x27')][_0xa7ca('0x41')]({'where':{'id':_0x5e070f[_0xa7ca('0x45')]['id']}})[_0xa7ca('0x20')](handleEntityNotFound(_0x244334,null))[_0xa7ca('0x20')](removeEntity(_0x244334,null))['catch'](handleError(_0x244334,null));};exports[_0xa7ca('0x46')]=function(_0x32dd78,_0x77fbf7){return db['VoiceTransferReport'][_0xa7ca('0x46')]()[_0xa7ca('0x20')](respondWithResult(_0x77fbf7,null))[_0xa7ca('0x3d')](handleError(_0x77fbf7,null));}; \ No newline at end of file +var _0xe957=['options','includeAll','include','findAll','catch','show','params','find','body','update','describe','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','name','send','index','VoiceTransferReport','rawAttributes','fieldName','key','map','keys','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL'];(function(_0x4f43b1,_0x36e0e1){var _0x3c92c0=function(_0x3cfa83){while(--_0x3cfa83){_0x4f43b1['push'](_0x4f43b1['shift']());}};_0x3c92c0(++_0x36e0e1);}(_0xe957,0x169));var _0x7e95=function(_0x247ea6,_0x507bdb){_0x247ea6=_0x247ea6-0x0;var _0x23de8a=_0xe957[_0x247ea6];return _0x23de8a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7e95('0x0'));var zipdir=require(_0x7e95('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7e95('0x2'));var BPromise=require(_0x7e95('0x3'));var Mustache=require(_0x7e95('0x4'));var util=require(_0x7e95('0x5'));var path=require(_0x7e95('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7e95('0x7'));var fs=require('fs');var fs_extra=require(_0x7e95('0x8'));var _=require('lodash');var squel=require(_0x7e95('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7e95('0xa'));var toCsv=require('to-csv');var querystring=require(_0x7e95('0xb'));var Papa=require(_0x7e95('0xc'));var Redis=require('ioredis');var authService=require(_0x7e95('0xd'));var qs=require(_0x7e95('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7e95('0xf'));var logger=require(_0x7e95('0x10'))('api');var utils=require(_0x7e95('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x7e95('0x12'));var db=require(_0x7e95('0x13'))['db'];function respondWithStatusCode(_0x3a0943,_0x57ad34){_0x57ad34=_0x57ad34||0xcc;return function(_0x5857bc){if(_0x5857bc){return _0x3a0943['sendStatus'](_0x57ad34);}return _0x3a0943[_0x7e95('0x14')](_0x57ad34)[_0x7e95('0x15')]();};}function respondWithResult(_0x33cdef,_0x45d85f){_0x45d85f=_0x45d85f||0xc8;return function(_0x5e113a){if(_0x5e113a){return _0x33cdef[_0x7e95('0x14')](_0x45d85f)[_0x7e95('0x16')](_0x5e113a);}};}function respondWithFilteredResult(_0x5e72de,_0x3e502e){return function(_0x32e6fc){if(_0x32e6fc){var _0x5e1f26=typeof _0x3e502e[_0x7e95('0x17')]==='undefined'&&typeof _0x3e502e[_0x7e95('0x18')]===_0x7e95('0x19');var _0x276b20=_0x32e6fc['count'];var _0x16ed92=_0x5e1f26?0x0:_0x3e502e[_0x7e95('0x17')];var _0x6170f7=_0x5e1f26?_0x32e6fc[_0x7e95('0x1a')]:_0x3e502e[_0x7e95('0x17')]+_0x3e502e[_0x7e95('0x18')];var _0xbedbea;if(_0x6170f7>=_0x276b20){_0x6170f7=_0x276b20;_0xbedbea=0xc8;}else{_0xbedbea=0xce;}_0x5e72de[_0x7e95('0x14')](_0xbedbea);return _0x5e72de[_0x7e95('0x1b')](_0x7e95('0x1c'),_0x16ed92+'-'+_0x6170f7+'/'+_0x276b20)[_0x7e95('0x16')](_0x32e6fc);}return null;};}function patchUpdates(_0x1ac57d){return function(_0x280d61){try{jsonpatch[_0x7e95('0x1d')](_0x280d61,_0x1ac57d,!![]);}catch(_0x3eb2ce){return BPromise['reject'](_0x3eb2ce);}return _0x280d61[_0x7e95('0x1e')]();};}function saveUpdates(_0x6f4952,_0x253ff4){return function(_0x2ee27d){if(_0x2ee27d){return _0x2ee27d['update'](_0x6f4952)[_0x7e95('0x1f')](function(_0x544f3d){return _0x544f3d;});}return null;};}function removeEntity(_0x3851e0,_0x2c1444){return function(_0x3d796){if(_0x3d796){return _0x3d796[_0x7e95('0x20')]()[_0x7e95('0x1f')](function(){_0x3851e0[_0x7e95('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x180677,_0x336d6){return function(_0x13f821){if(!_0x13f821){_0x180677['sendStatus'](0x194);}return _0x13f821;};}function handleError(_0x202ff8,_0x3262f4){_0x3262f4=_0x3262f4||0x1f4;return function(_0x47bfa2){logger['error'](_0x47bfa2['stack']);if(_0x47bfa2[_0x7e95('0x21')]){delete _0x47bfa2[_0x7e95('0x21')];}_0x202ff8[_0x7e95('0x14')](_0x3262f4)[_0x7e95('0x22')](_0x47bfa2);};}exports[_0x7e95('0x23')]=function(_0xde6556,_0x478cc1){var _0x1781d8={},_0x55f33f={},_0x547557={'count':0x0,'rows':[]};var _0x31e47c=_['map'](db[_0x7e95('0x24')][_0x7e95('0x25')],function(_0x58a002){return{'name':_0x58a002[_0x7e95('0x26')],'type':_0x58a002['type'][_0x7e95('0x27')]};});_0x55f33f['model']=_[_0x7e95('0x28')](_0x31e47c,_0x7e95('0x21'));_0x55f33f['query']=_[_0x7e95('0x29')](_0xde6556['query']);_0x55f33f['filters']=_[_0x7e95('0x2a')](_0x55f33f[_0x7e95('0x2b')],_0x55f33f[_0x7e95('0x2c')]);_0x1781d8[_0x7e95('0x2d')]=_[_0x7e95('0x2a')](_0x55f33f[_0x7e95('0x2b')],qs[_0x7e95('0x2e')](_0xde6556[_0x7e95('0x2c')][_0x7e95('0x2e')]));_0x1781d8[_0x7e95('0x2d')]=_0x1781d8[_0x7e95('0x2d')][_0x7e95('0x2f')]?_0x1781d8[_0x7e95('0x2d')]:_0x55f33f['model'];if(!_0xde6556[_0x7e95('0x2c')][_0x7e95('0x30')](_0x7e95('0x31'))){_0x1781d8['limit']=qs[_0x7e95('0x18')](_0xde6556[_0x7e95('0x2c')]['limit']);_0x1781d8[_0x7e95('0x17')]=qs[_0x7e95('0x17')](_0xde6556[_0x7e95('0x2c')][_0x7e95('0x17')]);}_0x1781d8[_0x7e95('0x32')]=qs[_0x7e95('0x33')](_0xde6556[_0x7e95('0x2c')][_0x7e95('0x33')]);_0x1781d8[_0x7e95('0x34')]=qs[_0x7e95('0x35')](_[_0x7e95('0x36')](_0xde6556[_0x7e95('0x2c')],_0x55f33f['filters']),_0x31e47c);if(_0xde6556[_0x7e95('0x2c')][_0x7e95('0x37')]){_0x1781d8[_0x7e95('0x34')]=_[_0x7e95('0x38')](_0x1781d8[_0x7e95('0x34')],{'$or':_[_0x7e95('0x28')](_0x31e47c,function(_0x3e57e3){if(_0x3e57e3[_0x7e95('0x39')]!==_0x7e95('0x3a')){var _0x338f4f={};_0x338f4f[_0x3e57e3['name']]={'$like':'%'+_0xde6556['query']['filter']+'%'};return _0x338f4f;}})});}_0x1781d8=_['merge']({},_0x1781d8,_0xde6556[_0x7e95('0x3b')]);var _0x267e8b={'where':_0x1781d8['where']};return db['VoiceTransferReport'][_0x7e95('0x1a')](_0x267e8b)[_0x7e95('0x1f')](function(_0x2eb61d){_0x547557['count']=_0x2eb61d;if(_0xde6556['query'][_0x7e95('0x3c')]){_0x1781d8[_0x7e95('0x3d')]=[{'all':!![]}];}return db[_0x7e95('0x24')][_0x7e95('0x3e')](_0x1781d8);})[_0x7e95('0x1f')](function(_0x293800){_0x547557['rows']=_0x293800;return _0x547557;})['then'](respondWithFilteredResult(_0x478cc1,_0x1781d8))[_0x7e95('0x3f')](handleError(_0x478cc1,null));};exports[_0x7e95('0x40')]=function(_0x50f7f2,_0x1f33af){var _0x43dcf0={'raw':!![],'where':{'id':_0x50f7f2[_0x7e95('0x41')]['id']}},_0x131ad7={};_0x131ad7[_0x7e95('0x2b')]=_['keys'](db[_0x7e95('0x24')]['rawAttributes']);_0x131ad7[_0x7e95('0x2c')]=_[_0x7e95('0x29')](_0x50f7f2[_0x7e95('0x2c')]);_0x131ad7[_0x7e95('0x35')]=_[_0x7e95('0x2a')](_0x131ad7['model'],_0x131ad7[_0x7e95('0x2c')]);_0x43dcf0[_0x7e95('0x2d')]=_[_0x7e95('0x2a')](_0x131ad7[_0x7e95('0x2b')],qs['fields'](_0x50f7f2['query'][_0x7e95('0x2e')]));_0x43dcf0['attributes']=_0x43dcf0[_0x7e95('0x2d')][_0x7e95('0x2f')]?_0x43dcf0[_0x7e95('0x2d')]:_0x131ad7[_0x7e95('0x2b')];if(_0x50f7f2[_0x7e95('0x2c')][_0x7e95('0x3c')]){_0x43dcf0[_0x7e95('0x3d')]=[{'all':!![]}];}_0x43dcf0=_[_0x7e95('0x38')]({},_0x43dcf0,_0x50f7f2[_0x7e95('0x3b')]);return db[_0x7e95('0x24')][_0x7e95('0x42')](_0x43dcf0)[_0x7e95('0x1f')](handleEntityNotFound(_0x1f33af,null))['then'](respondWithResult(_0x1f33af,null))[_0x7e95('0x3f')](handleError(_0x1f33af,null));};exports['create']=function(_0x45690a,_0x546ce8){return db[_0x7e95('0x24')]['create'](_0x45690a[_0x7e95('0x43')],{})[_0x7e95('0x1f')](respondWithResult(_0x546ce8,0xc9))[_0x7e95('0x3f')](handleError(_0x546ce8,null));};exports[_0x7e95('0x44')]=function(_0x593781,_0x50671d){if(_0x593781[_0x7e95('0x43')]['id']){delete _0x593781[_0x7e95('0x43')]['id'];}return db['VoiceTransferReport']['find']({'where':{'id':_0x593781['params']['id']}})['then'](handleEntityNotFound(_0x50671d,null))[_0x7e95('0x1f')](saveUpdates(_0x593781[_0x7e95('0x43')],null))[_0x7e95('0x1f')](respondWithResult(_0x50671d,null))['catch'](handleError(_0x50671d,null));};exports[_0x7e95('0x20')]=function(_0x1b89c1,_0x366ee1){return db[_0x7e95('0x24')][_0x7e95('0x42')]({'where':{'id':_0x1b89c1['params']['id']}})[_0x7e95('0x1f')](handleEntityNotFound(_0x366ee1,null))[_0x7e95('0x1f')](removeEntity(_0x366ee1,null))[_0x7e95('0x3f')](handleError(_0x366ee1,null));};exports[_0x7e95('0x45')]=function(_0x1cb1b9,_0x105e37){return db[_0x7e95('0x24')][_0x7e95('0x45')]()[_0x7e95('0x1f')](respondWithResult(_0x105e37,null))[_0x7e95('0x3f')](handleError(_0x105e37,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index a738de2..f8be0c3 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 _0x841b=['VoiceTransferReport','report_call_transfer','api','moment','request-promise','path','rimraf','exports','define'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x841b,0x14f));var _0xb841=function(_0x255036,_0xf94145){_0x255036=_0x255036-0x0;var _0x3c4c56=_0x841b[_0x255036];return _0x3c4c56;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xb841('0x0'));var moment=require(_0xb841('0x1'));var BPromise=require('bluebird');var rp=require(_0xb841('0x2'));var fs=require('fs');var path=require(_0xb841('0x3'));var rimraf=require(_0xb841('0x4'));var config=require('../../config/environment');var attributes=require('./voiceTransferReport.attributes');module[_0xb841('0x5')]=function(_0x33b49f,_0x32214c){return _0x33b49f[_0xb841('0x6')](_0xb841('0x7'),attributes,{'tableName':_0xb841('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x388f=['request-promise','path','rimraf','../../config/environment','exports','define','VoiceTransferReport','lodash','util','../../config/logger','moment','bluebird'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x388f,0xc7));var _0xf388=function(_0x1e4f2d,_0x22e2bb){_0x1e4f2d=_0x1e4f2d-0x0;var _0xd05ce5=_0x388f[_0x1e4f2d];return _0xd05ce5;};'use strict';var _=require(_0xf388('0x0'));var util=require(_0xf388('0x1'));var logger=require(_0xf388('0x2'))('api');var moment=require(_0xf388('0x3'));var BPromise=require(_0xf388('0x4'));var rp=require(_0xf388('0x5'));var fs=require('fs');var path=require(_0xf388('0x6'));var rimraf=require(_0xf388('0x7'));var config=require(_0xf388('0x8'));var attributes=require('./voiceTransferReport.attributes');module[_0xf388('0x9')]=function(_0x549bf3,_0x30ba2c){return _0x549bf3[_0xf388('0xa')](_0xf388('0xb'),attributes,{'tableName':'report_call_transfer','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 f401e39..c3e250b 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 _0x82a3=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateVoiceTransferReport','VoiceTransferReport','options','raw'];(function(_0x1ce595,_0x1069cb){var _0x525dfe=function(_0xeee00a){while(--_0xeee00a){_0x1ce595['push'](_0x1ce595['shift']());}};_0x525dfe(++_0x1069cb);}(_0x82a3,0x15f));var _0x382a=function(_0x35b9ca,_0x5ef3ba){_0x35b9ca=_0x35b9ca-0x0;var _0x3b07cf=_0x82a3[_0x35b9ca];return _0x3b07cf;};'use strict';var _=require(_0x382a('0x0'));var util=require('util');var moment=require(_0x382a('0x1'));var BPromise=require(_0x382a('0x2'));var rs=require(_0x382a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x382a('0x4'))['db'];var utils=require(_0x382a('0x5'));var logger=require('../../config/logger')(_0x382a('0x6'));var config=require(_0x382a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x382a('0x8')][_0x382a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbea837,_0x2c29f3,_0x3b51cf){return new BPromise(function(_0x113af4,_0x344a35){return client[_0x382a('0xa')](_0xbea837,_0x3b51cf)[_0x382a('0xb')](function(_0x31858e){logger[_0x382a('0xc')](_0x382a('0xd'),_0x2c29f3,_0x382a('0xe'));logger['debug'](_0x382a('0xf'),_0x2c29f3,'request\x20sent',JSON[_0x382a('0x10')](_0x31858e));if(_0x31858e[_0x382a('0x11')]){if(_0x31858e[_0x382a('0x11')][_0x382a('0x12')]===0x1f4){logger[_0x382a('0x11')](_0x382a('0xd'),_0x2c29f3,_0x31858e['error'][_0x382a('0x13')]);return _0x344a35(_0x31858e['error'][_0x382a('0x13')]);}logger[_0x382a('0x11')](_0x382a('0xd'),_0x2c29f3,_0x31858e[_0x382a('0x11')]['message']);return _0x113af4(_0x31858e[_0x382a('0x11')][_0x382a('0x13')]);}else{logger[_0x382a('0xc')](_0x382a('0xd'),_0x2c29f3,'request\x20sent');_0x113af4(_0x31858e['result'][_0x382a('0x13')]);}})['catch'](function(_0x206443){logger[_0x382a('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x2c29f3,_0x206443);_0x344a35(_0x206443);});});}exports[_0x382a('0x14')]=function(_0x5eebc7){var _0x219815=this;return new Promise(function(_0x4725bd,_0x9c70da){return db[_0x382a('0x15')]['create'](_0x5eebc7['body'],{'raw':_0x5eebc7[_0x382a('0x16')]?_0x5eebc7[_0x382a('0x16')][_0x382a('0x17')]===undefined?!![]:![]:!![]})[_0x382a('0xb')](function(_0x5d1f16){logger[_0x382a('0xc')]('CreateVoiceTransferReport',_0x5eebc7);logger['debug'](_0x382a('0x14'),_0x5eebc7,JSON[_0x382a('0x10')](_0x5d1f16));_0x4725bd(_0x5d1f16);})[_0x382a('0x18')](function(_0x4761d9){logger['error'](_0x382a('0x14'),_0x4761d9[_0x382a('0x13')],_0x5eebc7);_0x9c70da(_0x219815['error'](0x1f4,_0x4761d9[_0x382a('0x13')]));});});}; \ No newline at end of file +var _0xeb64=['CreateVoiceTransferReport','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceTransferReport,\x20%s,\x20%s','message','result','VoiceTransferReport','body','options','raw'];(function(_0x154bd2,_0x80ec8d){var _0x3b1550=function(_0x2e0e59){while(--_0x2e0e59){_0x154bd2['push'](_0x154bd2['shift']());}};_0x3b1550(++_0x80ec8d);}(_0xeb64,0x8e));var _0x4eb6=function(_0x2a3de6,_0x58d643){_0x2a3de6=_0x2a3de6-0x0;var _0x461843=_0xeb64[_0x2a3de6];return _0x461843;};'use strict';var _=require(_0x4eb6('0x0'));var util=require(_0x4eb6('0x1'));var moment=require(_0x4eb6('0x2'));var BPromise=require('bluebird');var rs=require(_0x4eb6('0x3'));var fs=require('fs');var Redis=require(_0x4eb6('0x4'));var db=require(_0x4eb6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4eb6('0x6'))(_0x4eb6('0x7'));var config=require(_0x4eb6('0x8'));var jayson=require(_0x4eb6('0x9'));var client=jayson['client'][_0x4eb6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x459d62,_0x5a5bb6,_0x5cd0ed){return new BPromise(function(_0x1bb0ed,_0xbe7b20){return client[_0x4eb6('0xb')](_0x459d62,_0x5cd0ed)[_0x4eb6('0xc')](function(_0x18e374){logger[_0x4eb6('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x5a5bb6,_0x4eb6('0xe'));logger[_0x4eb6('0xf')](_0x4eb6('0x10'),_0x5a5bb6,'request\x20sent',JSON[_0x4eb6('0x11')](_0x18e374));if(_0x18e374['error']){if(_0x18e374['error']['code']===0x1f4){logger[_0x4eb6('0x12')](_0x4eb6('0x13'),_0x5a5bb6,_0x18e374[_0x4eb6('0x12')][_0x4eb6('0x14')]);return _0xbe7b20(_0x18e374[_0x4eb6('0x12')][_0x4eb6('0x14')]);}logger[_0x4eb6('0x12')](_0x4eb6('0x13'),_0x5a5bb6,_0x18e374[_0x4eb6('0x12')][_0x4eb6('0x14')]);return _0x1bb0ed(_0x18e374[_0x4eb6('0x12')]['message']);}else{logger['info'](_0x4eb6('0x13'),_0x5a5bb6,'request\x20sent');_0x1bb0ed(_0x18e374[_0x4eb6('0x15')][_0x4eb6('0x14')]);}})['catch'](function(_0x3afe0){logger[_0x4eb6('0x12')](_0x4eb6('0x13'),_0x5a5bb6,_0x3afe0);_0xbe7b20(_0x3afe0);});});}exports['CreateVoiceTransferReport']=function(_0x597be9){var _0x3fa9fa=this;return new Promise(function(_0x1231a3,_0x155dad){return db[_0x4eb6('0x16')]['create'](_0x597be9[_0x4eb6('0x17')],{'raw':_0x597be9[_0x4eb6('0x18')]?_0x597be9[_0x4eb6('0x18')][_0x4eb6('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x23908a){logger[_0x4eb6('0xd')](_0x4eb6('0x1a'),_0x597be9);logger['debug'](_0x4eb6('0x1a'),_0x597be9,JSON[_0x4eb6('0x11')](_0x23908a));_0x1231a3(_0x23908a);})[_0x4eb6('0x1b')](function(_0x197883){logger[_0x4eb6('0x12')](_0x4eb6('0x1a'),_0x197883[_0x4eb6('0x14')],_0x597be9);_0x155dad(_0x3fa9fa[_0x4eb6('0x12')](0x1f4,_0x197883[_0x4eb6('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index f325e20..971607c 100644 --- a/server/api/webbar/index.js +++ b/server/api/webbar/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['/answer','answer','/hold','/unhold','unhold','/transfer','transfer','exports','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','/hangup','hangup'];(function(_0x3718b7,_0x2da677){var _0xf8c91e=function(_0x2519b4){while(--_0x2519b4){_0x3718b7['push'](_0x3718b7['shift']());}};_0xf8c91e(++_0x2da677);}(_0x9c44,0x178));var _0x49c4=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x9c44[_0x4f9b18];return _0x29f20c;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x49c4('0x0'));var controller=require(_0x49c4('0x1'));router[_0x49c4('0x2')](_0x49c4('0x3'),auth[_0x49c4('0x4')](),auth[_0x49c4('0x5')](),controller['originate']);router['post'](_0x49c4('0x6'),auth['isAuthenticated'](),auth[_0x49c4('0x5')](),controller[_0x49c4('0x7')]);router[_0x49c4('0x2')](_0x49c4('0x8'),auth[_0x49c4('0x4')](),auth['isWebrtcLicence'](),controller[_0x49c4('0x9')]);router[_0x49c4('0x2')](_0x49c4('0xa'),auth[_0x49c4('0x4')](),auth['isWebrtcLicence'](),controller['hold']);router[_0x49c4('0x2')](_0x49c4('0xb'),auth['isAuthenticated'](),auth[_0x49c4('0x5')](),controller[_0x49c4('0xc')]);router['post']('/calls',auth[_0x49c4('0x4')](),auth[_0x49c4('0x5')](),controller['calls']);router[_0x49c4('0x2')](_0x49c4('0xd'),auth['isAuthenticated'](),auth[_0x49c4('0x5')](),controller[_0x49c4('0xe')]);module[_0x49c4('0xf')]=router; \ No newline at end of file +var _0xe706=['/transfer','express','Router','../../components/auth/service','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','/answer','answer','/hold','hold','/unhold','/calls','calls'];(function(_0x594897,_0x1ed9a0){var _0x47e74b=function(_0x553877){while(--_0x553877){_0x594897['push'](_0x594897['shift']());}};_0x47e74b(++_0x1ed9a0);}(_0xe706,0xa3));var _0x6e70=function(_0x12b830,_0xd66540){_0x12b830=_0x12b830-0x0;var _0x261dc4=_0xe706[_0x12b830];return _0x261dc4;};'use strict';var express=require(_0x6e70('0x0'));var router=express[_0x6e70('0x1')]();var auth=require(_0x6e70('0x2'));var controller=require('./webbar.controller');router[_0x6e70('0x3')](_0x6e70('0x4'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller[_0x6e70('0x7')]);router[_0x6e70('0x3')](_0x6e70('0x8'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller[_0x6e70('0x9')]);router[_0x6e70('0x3')](_0x6e70('0xa'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller[_0x6e70('0xb')]);router[_0x6e70('0x3')](_0x6e70('0xc'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller[_0x6e70('0xd')]);router[_0x6e70('0x3')](_0x6e70('0xe'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller['unhold']);router['post'](_0x6e70('0xf'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x3')](_0x6e70('0x11'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller['transfer']);module['exports']=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index eaaf134..6cdebb5 100644 --- a/server/api/webbar/webbar.controller.js +++ b/server/api/webbar/webbar.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf2cb=['all','filter','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','info','originate\x20fired:','body','json','userId','callerId','callbackUrl','entityFound:','format','webbar:originate','originate\x20executed!','user:%s','webbar:hangup','hangup\x20executed!','answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','unhold','webbar:unhold','unhold\x20executed!','calls','rows','conference','conference\x20executed!','transferNumber','webbar:transfer','lodash','../../config/environment','bluebird','client','http','ioredis','redis','defaults','socket.io-emitter','validate','string','callNumber\x20is\x20required','number','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','stringify','log','handleError:','error','name','status','send','NotFound','then','message','result','catch','findOne','agent','VoiceChannels'];(function(_0x4034af,_0x249955){var _0x597fa3=function(_0x13f503){while(--_0x13f503){_0x4034af['push'](_0x4034af['shift']());}};_0x597fa3(++_0x249955);}(_0xf2cb,0x130));var _0xbf2c=function(_0x33be18,_0x47dc32){_0x33be18=_0x33be18-0x0;var _0x245b5e=_0xf2cb[_0x33be18];return _0x245b5e;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0xbf2c('0x0'));var db=require('../../mysqldb')['db'];var config=require(_0xbf2c('0x1'));var util=require('util');var BPromise=require(_0xbf2c('0x2'));var jayson=require('jayson/promise');var amiClient=jayson[_0xbf2c('0x3')][_0xbf2c('0x4')]({'port':0x232a});var logger=require('../../config/logger')('webbarapi');var Redis=require(_0xbf2c('0x5'));config[_0xbf2c('0x6')]=_[_0xbf2c('0x7')](config[_0xbf2c('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xbf2c('0x8'))(new Redis(config['redis']));var Schema=require(_0xbf2c('0x9'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0xbf2c('0xa'),'required':[!![],_0xbf2c('0xb')]},'callerId':{'type':_0xbf2c('0xa')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0xbf2c('0xc'),'required':[!![],_0xbf2c('0xd')]},'sessionId':{'type':_0xbf2c('0xa'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xbf2c('0xc'),'required':[!![],_0xbf2c('0xd')]},'sessionId':{'type':_0xbf2c('0xa'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xbf2c('0xc'),'required':[!![],_0xbf2c('0xd')]},'sessionId':{'type':'string','required':[!![],_0xbf2c('0xe')]},'transferNumber':{'type':_0xbf2c('0xa'),'required':[!![],_0xbf2c('0xf')]}});var holdValidation=new Schema({'userId':{'type':_0xbf2c('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xbf2c('0xa'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xbf2c('0xa'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0xbf2c('0xc'),'required':[!![],_0xbf2c('0xd')]}});function emit(_0x2dc80e,_0x334900,_0x2af371){logger['info'](_0x2dc80e,_0x334900,JSON[_0xbf2c('0x10')](_0x2af371));io['to'](_0x2dc80e)['emit'](_0x334900,_0x2af371);}function handleError(_0x4ced7f){return function(_0x1df2ab){console[_0xbf2c('0x11')](_0xbf2c('0x12'),_0x1df2ab,_0x1df2ab instanceof RangeError);logger[_0xbf2c('0x13')](_0x1df2ab['stack']);if(_0x1df2ab instanceof RangeError){if(_0x1df2ab[_0xbf2c('0x14')]){delete _0x1df2ab[_0xbf2c('0x14')];}_0x4ced7f[_0xbf2c('0x15')](0x194)[_0xbf2c('0x16')](_0x1df2ab);}else{if(_0x1df2ab[_0xbf2c('0x14')]){delete _0x1df2ab[_0xbf2c('0x14')];}_0x4ced7f[_0xbf2c('0x15')](0x1f4)['send'](_0x1df2ab);}};}function checkError(){return function(_0x61248b){if(!_0x61248b){throw new RangeError(_0xbf2c('0x17'));}return _0x61248b;};}function respondWithRpcPromise(_0x96a759,_0xe6dad9){return new BPromise(function(_0x57873c,_0x2bc2ad){var _0x1f5515=amiClient;return _0x1f5515['request'](_0x96a759,_0xe6dad9)[_0xbf2c('0x18')](function(_0x356f26){if(_0x356f26[_0xbf2c('0x13')]){if(_0x356f26['error']['code']===0x1f4){return _0x2bc2ad(_0x356f26[_0xbf2c('0x13')][_0xbf2c('0x19')]);}return _0x57873c(_0x356f26[_0xbf2c('0x13')][_0xbf2c('0x19')]);}else{_0x57873c(_0x356f26[_0xbf2c('0x1a')]);}})[_0xbf2c('0x1b')](function(_0x11ffbe){_0x2bc2ad(_0x11ffbe);});});}function getAgent(_0x4df358){return db['User'][_0xbf2c('0x1c')]({'where':{'id':_0x4df358,'role':_0xbf2c('0x1d')}})[_0xbf2c('0x18')](checkError());}function getAgentCheckSession(_0x4314d6,_0x3ed68d){return new BPromise(function(_0x4a0257,_0x30ca){var _0x2976fa=respondWithRpcPromise(_0xbf2c('0x1e'));var _0x4f3191=getAgent(_0x4314d6);Promise[_0xbf2c('0x1f')]([_0x2976fa,_0x4f3191])['then'](function(_0x3a9130){var _0x3442fa=_0x3a9130[0x0];var _0x40e866=_0x3a9130[0x1];var _0x17238f=_[_0xbf2c('0x20')](_0x3442fa['rows'],function(_0x1e946c){return _0x1e946c[_0xbf2c('0x21')]==_0x40e866['id']&&_0x1e946c[_0xbf2c('0x22')]==_0x3ed68d;});if(_0x17238f[_0xbf2c('0x23')]==0x1){_0x4a0257(_0x40e866);}else{_0x30ca(new RangeError(_0xbf2c('0x24')+_0x3ed68d+_0xbf2c('0x25')));}});});}exports[_0xbf2c('0x26')]=function(_0x3462dd,_0x4d731d){logger[_0xbf2c('0x27')](_0xbf2c('0x28'),_0x3462dd[_0xbf2c('0x29')]);var _0x5b93aa=originateValidation['validate'](_0x3462dd[_0xbf2c('0x29')]);if(_0x5b93aa[_0xbf2c('0x23')]>0x0){return _0x4d731d[_0xbf2c('0x15')](0x190)[_0xbf2c('0x2a')](_0x5b93aa);}var _0x286634=_0x3462dd[_0xbf2c('0x29')][_0xbf2c('0x2b')];var _0x255cbc=_0x3462dd[_0xbf2c('0x29')]['callNumber'];var _0x218363=_0x3462dd[_0xbf2c('0x29')][_0xbf2c('0x2c')];var _0x3a0134=_0x3462dd[_0xbf2c('0x29')][_0xbf2c('0x2d')];return getAgent(_0x286634)[_0xbf2c('0x18')](function(_0x4722b3){logger['info'](_0xbf2c('0x2e'),_0x4722b3[_0xbf2c('0x14')]);emit(util[_0xbf2c('0x2f')]('user:%s',_0x4722b3[_0xbf2c('0x14')]),_0xbf2c('0x30'),{'callNumber':_0x255cbc,'callerId':_0x218363,'callbackUrl':_0x3a0134});return _0x4d731d[_0xbf2c('0x15')](0xc8)['json']({'error':![],'message':_0xbf2c('0x31')});})[_0xbf2c('0x1b')](handleError(_0x4d731d));};exports['hangup']=function(_0x5d683d,_0x47ab9a){logger['info']('hangup\x20fired:',_0x5d683d[_0xbf2c('0x29')]);var _0x13652a=hangupValidation[_0xbf2c('0x9')](_0x5d683d[_0xbf2c('0x29')]);if(_0x13652a[_0xbf2c('0x23')]>0x0){return _0x47ab9a[_0xbf2c('0x15')](0x190)[_0xbf2c('0x2a')](_0x13652a);}var _0x325581=_0x5d683d[_0xbf2c('0x29')][_0xbf2c('0x2b')];var _0x245eaf=_0x5d683d[_0xbf2c('0x29')][_0xbf2c('0x22')];return getAgent(_0x325581)[_0xbf2c('0x18')](function(_0x4776e0){logger[_0xbf2c('0x27')]('entityFound:',_0x4776e0[_0xbf2c('0x14')]);emit(util[_0xbf2c('0x2f')](_0xbf2c('0x32'),_0x4776e0[_0xbf2c('0x14')]),_0xbf2c('0x33'),{'sessionId':_0x245eaf});return _0x47ab9a[_0xbf2c('0x15')](0xc8)[_0xbf2c('0x2a')]({'error':![],'message':_0xbf2c('0x34')});})['catch'](handleError(_0x47ab9a));};exports[_0xbf2c('0x35')]=function(_0x2bccc2,_0x652066){logger[_0xbf2c('0x27')]('answer\x20fired:',_0x2bccc2[_0xbf2c('0x29')]);var _0x5067d2=answerValidation[_0xbf2c('0x9')](_0x2bccc2[_0xbf2c('0x29')]);if(_0x5067d2[_0xbf2c('0x23')]>0x0){return _0x652066[_0xbf2c('0x15')](0x190)[_0xbf2c('0x2a')](_0x5067d2);}var _0x14107c=_0x2bccc2['body'][_0xbf2c('0x2b')];var _0x55c3d7=_0x2bccc2['body'][_0xbf2c('0x22')];return getAgent(_0x14107c)['then'](function(_0x57ddb9){logger[_0xbf2c('0x27')](_0xbf2c('0x2e'),_0x57ddb9['name']);emit(util[_0xbf2c('0x2f')]('user:%s',_0x57ddb9[_0xbf2c('0x14')]),'webbar:answer',{'sessionId':_0x55c3d7});return _0x652066[_0xbf2c('0x15')](0xc8)[_0xbf2c('0x2a')]({'error':![],'message':_0xbf2c('0x36')});})[_0xbf2c('0x1b')](handleError(_0x652066));};exports[_0xbf2c('0x37')]=function(_0x4187cf,_0x54ce68){logger[_0xbf2c('0x27')](_0xbf2c('0x38'),_0x4187cf[_0xbf2c('0x29')]);var _0x1b50a6=holdValidation[_0xbf2c('0x9')](_0x4187cf['body']);if(_0x1b50a6['length']>0x0){return _0x54ce68[_0xbf2c('0x15')](0x190)['json'](_0x1b50a6);}var _0xa08482=_0x4187cf[_0xbf2c('0x29')][_0xbf2c('0x2b')];var _0x1750ec=_0x4187cf[_0xbf2c('0x29')][_0xbf2c('0x22')];return getAgent(_0xa08482)[_0xbf2c('0x18')](function(_0x1c3b78){logger[_0xbf2c('0x27')](_0xbf2c('0x2e'),_0x1c3b78[_0xbf2c('0x14')]);emit(util['format'](_0xbf2c('0x32'),_0x1c3b78[_0xbf2c('0x14')]),_0xbf2c('0x39'),{'sessionId':_0x1750ec});return _0x54ce68[_0xbf2c('0x15')](0xc8)['json']({'error':![],'message':'hold\x20executed!'});})['catch'](handleError(_0x54ce68));};exports[_0xbf2c('0x3a')]=function(_0x2451ba,_0x56c470){logger['info']('unhold\x20fired:',_0x2451ba[_0xbf2c('0x29')]);var _0x314f7b=unholdValidation[_0xbf2c('0x9')](_0x2451ba[_0xbf2c('0x29')]);if(_0x314f7b[_0xbf2c('0x23')]>0x0){return _0x56c470[_0xbf2c('0x15')](0x190)['json'](_0x314f7b);}var _0xfff73d=_0x2451ba[_0xbf2c('0x29')][_0xbf2c('0x2b')];var _0x3fa07e=_0x2451ba[_0xbf2c('0x29')][_0xbf2c('0x22')];return getAgent(_0xfff73d)[_0xbf2c('0x18')](function(_0x180aad){logger['info']('entityFound:',_0x180aad['name']);emit(util[_0xbf2c('0x2f')](_0xbf2c('0x32'),_0x180aad[_0xbf2c('0x14')]),_0xbf2c('0x3b'),{'sessionId':_0x3fa07e});return _0x56c470['status'](0xc8)[_0xbf2c('0x2a')]({'error':![],'message':_0xbf2c('0x3c')});})['catch'](handleError(_0x56c470));};exports[_0xbf2c('0x3d')]=function(_0xcbe3be,_0x20229f){logger['info']('calls\x20fired:',_0x20229f['body']);var _0x49cae6=callsValidation[_0xbf2c('0x9')](_0xcbe3be[_0xbf2c('0x29')]);if(_0x49cae6[_0xbf2c('0x23')]>0x0){return _0x20229f[_0xbf2c('0x15')](0x190)[_0xbf2c('0x2a')](_0x49cae6);}var _0x5c7321=_0xcbe3be[_0xbf2c('0x29')][_0xbf2c('0x2b')];var _0x58b66a=respondWithRpcPromise(_0xbf2c('0x1e'));var _0x3f0129=getAgent(_0x5c7321);return Promise['all']([_0x58b66a,_0x3f0129])['then'](function(_0x5062a3){var _0x363f77=_0x5062a3[0x0];var _0x5df133=_0x5062a3[0x1];var _0x5cf1df=_[_0xbf2c('0x20')](_0x363f77[_0xbf2c('0x3e')],function(_0x2b84c6){return _0x2b84c6[_0xbf2c('0x21')]==_0x5df133['id'];});return _0x20229f['status'](0xc8)['json']({'count':_0x5cf1df[_0xbf2c('0x23')],'rows':_0x5cf1df});})[_0xbf2c('0x1b')](handleError(_0x20229f));};exports[_0xbf2c('0x3f')]=function(_0x2960fc,_0x151341){logger['info']('conference\x20fired:',_0x2960fc[_0xbf2c('0x29')]);var _0x1a4bf7=conferenceValidation[_0xbf2c('0x9')](_0x2960fc[_0xbf2c('0x29')]);if(_0x1a4bf7[_0xbf2c('0x23')]>0x0){return _0x151341[_0xbf2c('0x15')](0x190)['json'](_0x1a4bf7);}var _0x5b37b1=_0x2960fc[_0xbf2c('0x29')][_0xbf2c('0x2b')];return getAgent(_0x5b37b1)[_0xbf2c('0x18')](function(_0x1b9f8d){logger[_0xbf2c('0x27')](_0xbf2c('0x2e'),_0x1b9f8d[_0xbf2c('0x14')]);emit(util[_0xbf2c('0x2f')](_0xbf2c('0x32'),_0x1b9f8d['name']),'webbar:conference');return _0x151341[_0xbf2c('0x15')](0xc8)[_0xbf2c('0x2a')]({'error':![],'message':_0xbf2c('0x40')});})[_0xbf2c('0x1b')](handleError(_0x151341));};exports['transfer']=function(_0x436c4d,_0x2a1816){logger[_0xbf2c('0x27')]('transfer\x20fired:',_0x436c4d[_0xbf2c('0x29')]);var _0x1aa7c3=transferValidation[_0xbf2c('0x9')](_0x436c4d[_0xbf2c('0x29')]);if(_0x1aa7c3['length']>0x0){return _0x2a1816[_0xbf2c('0x15')](0x190)[_0xbf2c('0x2a')](_0x1aa7c3);}var _0x425a46=_0x436c4d['body']['userId'];var _0x295790=_0x436c4d['body']['sessionId'];var _0x1e2d67=_0x436c4d[_0xbf2c('0x29')][_0xbf2c('0x41')];return getAgent(_0x425a46)[_0xbf2c('0x18')](function(_0x1d7bf8){logger['info']('entityFound:',_0x1d7bf8[_0xbf2c('0x14')]);emit(util[_0xbf2c('0x2f')]('user:%s',_0x1d7bf8[_0xbf2c('0x14')]),_0xbf2c('0x42'),{'sessionId':_0x295790,'transferNumber':_0x1e2d67});return _0x2a1816['status'](0xc8)[_0xbf2c('0x2a')]({'error':![],'message':'transfer\x20executed!'});})[_0xbf2c('0x1b')](handleError(_0x2a1816));}; \ No newline at end of file +var _0xc36d=['all','rows','sessionId','length','sessionId\x20','originate','originate\x20fired:','body','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','json','originate\x20executed!','hangup','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','calls','calls\x20fired:','filter','UserId','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','client','http','webbarapi','ioredis','redis','defaults','socket.io-emitter','validate','number','string','callNumber\x20is\x20required','userId\x20is\x20required','sessionId\x20is\x20required','info','stringify','log','handleError:','error','stack','name','status','NotFound','request','then','code','result','catch','User','findOne','agent','VoiceChannels'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc36d,0x7d));var _0xdc36=function(_0x705b98,_0x1c345b){_0x705b98=_0x705b98-0x0;var _0x47b72f=_0xc36d[_0x705b98];return _0x47b72f;};'use strict';var path=require(_0xdc36('0x0'));var fs=require('fs');var _=require(_0xdc36('0x1'));var db=require(_0xdc36('0x2'))['db'];var config=require(_0xdc36('0x3'));var util=require(_0xdc36('0x4'));var BPromise=require(_0xdc36('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0xdc36('0x6')][_0xdc36('0x7')]({'port':0x232a});var logger=require('../../config/logger')(_0xdc36('0x8'));var Redis=require(_0xdc36('0x9'));config[_0xdc36('0xa')]=_[_0xdc36('0xb')](config[_0xdc36('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0xdc36('0xc'))(new Redis(config[_0xdc36('0xa')]));var Schema=require(_0xdc36('0xd'));var originateValidation=new Schema({'userId':{'type':_0xdc36('0xe'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0xdc36('0xf'),'required':[!![],_0xdc36('0x10')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0xdc36('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0xdc36('0xe'),'required':[!![],_0xdc36('0x11')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0xdc36('0xe'),'required':[!![],_0xdc36('0x11')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0xdc36('0x11')]},'sessionId':{'type':_0xdc36('0xf'),'required':[!![],_0xdc36('0x12')]},'transferNumber':{'type':_0xdc36('0xf'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0xdc36('0xe'),'required':[!![],_0xdc36('0x11')]},'sessionId':{'type':_0xdc36('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xdc36('0xe'),'required':[!![],_0xdc36('0x11')]},'sessionId':{'type':_0xdc36('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xdc36('0xe'),'required':[!![],_0xdc36('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xdc36('0x11')]}});function emit(_0x526ac8,_0x4baf2e,_0x59c88f){logger[_0xdc36('0x13')](_0x526ac8,_0x4baf2e,JSON[_0xdc36('0x14')](_0x59c88f));io['to'](_0x526ac8)['emit'](_0x4baf2e,_0x59c88f);}function handleError(_0xd38826){return function(_0x219a73){console[_0xdc36('0x15')](_0xdc36('0x16'),_0x219a73,_0x219a73 instanceof RangeError);logger[_0xdc36('0x17')](_0x219a73[_0xdc36('0x18')]);if(_0x219a73 instanceof RangeError){if(_0x219a73['name']){delete _0x219a73[_0xdc36('0x19')];}_0xd38826[_0xdc36('0x1a')](0x194)['send'](_0x219a73);}else{if(_0x219a73[_0xdc36('0x19')]){delete _0x219a73[_0xdc36('0x19')];}_0xd38826[_0xdc36('0x1a')](0x1f4)['send'](_0x219a73);}};}function checkError(){return function(_0x10aafb){if(!_0x10aafb){throw new RangeError(_0xdc36('0x1b'));}return _0x10aafb;};}function respondWithRpcPromise(_0x5b9891,_0x388b1a){return new BPromise(function(_0x480277,_0x5a6e35){var _0x12f9d8=amiClient;return _0x12f9d8[_0xdc36('0x1c')](_0x5b9891,_0x388b1a)[_0xdc36('0x1d')](function(_0xda916b){if(_0xda916b[_0xdc36('0x17')]){if(_0xda916b[_0xdc36('0x17')][_0xdc36('0x1e')]===0x1f4){return _0x5a6e35(_0xda916b[_0xdc36('0x17')]['message']);}return _0x480277(_0xda916b[_0xdc36('0x17')]['message']);}else{_0x480277(_0xda916b[_0xdc36('0x1f')]);}})[_0xdc36('0x20')](function(_0x15e686){_0x5a6e35(_0x15e686);});});}function getAgent(_0x5c785b){return db[_0xdc36('0x21')][_0xdc36('0x22')]({'where':{'id':_0x5c785b,'role':_0xdc36('0x23')}})['then'](checkError());}function getAgentCheckSession(_0x28a005,_0x2f3b6a){return new BPromise(function(_0x2a596d,_0x5f3b20){var _0x3c39e3=respondWithRpcPromise(_0xdc36('0x24'));var _0x4b15b4=getAgent(_0x28a005);Promise[_0xdc36('0x25')]([_0x3c39e3,_0x4b15b4])[_0xdc36('0x1d')](function(_0x4ea2ad){var _0x21151b=_0x4ea2ad[0x0];var _0x5bba0b=_0x4ea2ad[0x1];var _0x49bbf2=_['filter'](_0x21151b[_0xdc36('0x26')],function(_0x2f2bb4){return _0x2f2bb4['UserId']==_0x5bba0b['id']&&_0x2f2bb4[_0xdc36('0x27')]==_0x2f3b6a;});if(_0x49bbf2[_0xdc36('0x28')]==0x1){_0x2a596d(_0x5bba0b);}else{_0x5f3b20(new RangeError(_0xdc36('0x29')+_0x2f3b6a+'\x20not\x20found!'));}});});}exports[_0xdc36('0x2a')]=function(_0xcfff77,_0x1d010c){logger[_0xdc36('0x13')](_0xdc36('0x2b'),_0xcfff77[_0xdc36('0x2c')]);var _0x1aa877=originateValidation['validate'](_0xcfff77[_0xdc36('0x2c')]);if(_0x1aa877[_0xdc36('0x28')]>0x0){return _0x1d010c['status'](0x190)['json'](_0x1aa877);}var _0x359e7c=_0xcfff77[_0xdc36('0x2c')][_0xdc36('0x2d')];var _0x58a899=_0xcfff77['body'][_0xdc36('0x2e')];var _0x1a2261=_0xcfff77[_0xdc36('0x2c')][_0xdc36('0x2f')];var _0x302d69=_0xcfff77[_0xdc36('0x2c')][_0xdc36('0x30')];return getAgent(_0x359e7c)[_0xdc36('0x1d')](function(_0x734ad6){logger[_0xdc36('0x13')](_0xdc36('0x31'),_0x734ad6['name']);emit(util[_0xdc36('0x32')](_0xdc36('0x33'),_0x734ad6[_0xdc36('0x19')]),_0xdc36('0x34'),{'callNumber':_0x58a899,'callerId':_0x1a2261,'callbackUrl':_0x302d69});return _0x1d010c['status'](0xc8)[_0xdc36('0x35')]({'error':![],'message':_0xdc36('0x36')});})[_0xdc36('0x20')](handleError(_0x1d010c));};exports[_0xdc36('0x37')]=function(_0x4c4105,_0x3c8bd5){logger['info']('hangup\x20fired:',_0x4c4105[_0xdc36('0x2c')]);var _0x169c1e=hangupValidation[_0xdc36('0xd')](_0x4c4105['body']);if(_0x169c1e[_0xdc36('0x28')]>0x0){return _0x3c8bd5['status'](0x190)[_0xdc36('0x35')](_0x169c1e);}var _0x34f6be=_0x4c4105[_0xdc36('0x2c')]['userId'];var _0x34fe4d=_0x4c4105[_0xdc36('0x2c')][_0xdc36('0x27')];return getAgent(_0x34f6be)[_0xdc36('0x1d')](function(_0x50cf7b){logger[_0xdc36('0x13')](_0xdc36('0x31'),_0x50cf7b[_0xdc36('0x19')]);emit(util['format']('user:%s',_0x50cf7b[_0xdc36('0x19')]),_0xdc36('0x38'),{'sessionId':_0x34fe4d});return _0x3c8bd5['status'](0xc8)['json']({'error':![],'message':_0xdc36('0x39')});})[_0xdc36('0x20')](handleError(_0x3c8bd5));};exports[_0xdc36('0x3a')]=function(_0x1c0a6c,_0x26fb8c){logger[_0xdc36('0x13')](_0xdc36('0x3b'),_0x1c0a6c[_0xdc36('0x2c')]);var _0x2f4c89=answerValidation[_0xdc36('0xd')](_0x1c0a6c[_0xdc36('0x2c')]);if(_0x2f4c89[_0xdc36('0x28')]>0x0){return _0x26fb8c[_0xdc36('0x1a')](0x190)[_0xdc36('0x35')](_0x2f4c89);}var _0x1f2604=_0x1c0a6c[_0xdc36('0x2c')][_0xdc36('0x2d')];var _0x16dcb7=_0x1c0a6c[_0xdc36('0x2c')][_0xdc36('0x27')];return getAgent(_0x1f2604)[_0xdc36('0x1d')](function(_0x608220){logger[_0xdc36('0x13')](_0xdc36('0x31'),_0x608220[_0xdc36('0x19')]);emit(util[_0xdc36('0x32')]('user:%s',_0x608220[_0xdc36('0x19')]),_0xdc36('0x3c'),{'sessionId':_0x16dcb7});return _0x26fb8c['status'](0xc8)['json']({'error':![],'message':_0xdc36('0x3d')});})['catch'](handleError(_0x26fb8c));};exports[_0xdc36('0x3e')]=function(_0x51a276,_0x19c7fe){logger[_0xdc36('0x13')](_0xdc36('0x3f'),_0x51a276[_0xdc36('0x2c')]);var _0x34af88=holdValidation[_0xdc36('0xd')](_0x51a276[_0xdc36('0x2c')]);if(_0x34af88[_0xdc36('0x28')]>0x0){return _0x19c7fe[_0xdc36('0x1a')](0x190)[_0xdc36('0x35')](_0x34af88);}var _0x3c27c7=_0x51a276[_0xdc36('0x2c')][_0xdc36('0x2d')];var _0x10d865=_0x51a276[_0xdc36('0x2c')][_0xdc36('0x27')];return getAgent(_0x3c27c7)[_0xdc36('0x1d')](function(_0x3399cc){logger['info']('entityFound:',_0x3399cc[_0xdc36('0x19')]);emit(util[_0xdc36('0x32')](_0xdc36('0x33'),_0x3399cc[_0xdc36('0x19')]),_0xdc36('0x40'),{'sessionId':_0x10d865});return _0x19c7fe[_0xdc36('0x1a')](0xc8)['json']({'error':![],'message':_0xdc36('0x41')});})[_0xdc36('0x20')](handleError(_0x19c7fe));};exports[_0xdc36('0x42')]=function(_0x49f456,_0x2c6856){logger[_0xdc36('0x13')](_0xdc36('0x43'),_0x49f456[_0xdc36('0x2c')]);var _0x3bfc00=unholdValidation[_0xdc36('0xd')](_0x49f456['body']);if(_0x3bfc00[_0xdc36('0x28')]>0x0){return _0x2c6856[_0xdc36('0x1a')](0x190)[_0xdc36('0x35')](_0x3bfc00);}var _0x18272a=_0x49f456[_0xdc36('0x2c')][_0xdc36('0x2d')];var _0x26775a=_0x49f456[_0xdc36('0x2c')]['sessionId'];return getAgent(_0x18272a)[_0xdc36('0x1d')](function(_0x5bdc6){logger[_0xdc36('0x13')](_0xdc36('0x31'),_0x5bdc6[_0xdc36('0x19')]);emit(util[_0xdc36('0x32')](_0xdc36('0x33'),_0x5bdc6[_0xdc36('0x19')]),'webbar:unhold',{'sessionId':_0x26775a});return _0x2c6856['status'](0xc8)[_0xdc36('0x35')]({'error':![],'message':_0xdc36('0x44')});})['catch'](handleError(_0x2c6856));};exports[_0xdc36('0x45')]=function(_0xd8af57,_0x502033){logger['info'](_0xdc36('0x46'),_0x502033['body']);var _0x4277b4=callsValidation['validate'](_0xd8af57[_0xdc36('0x2c')]);if(_0x4277b4['length']>0x0){return _0x502033['status'](0x190)[_0xdc36('0x35')](_0x4277b4);}var _0x5d139f=_0xd8af57[_0xdc36('0x2c')][_0xdc36('0x2d')];var _0x33b3d2=respondWithRpcPromise(_0xdc36('0x24'));var _0x396a6a=getAgent(_0x5d139f);return Promise['all']([_0x33b3d2,_0x396a6a])[_0xdc36('0x1d')](function(_0x379a72){var _0x42d0a6=_0x379a72[0x0];var _0x4e62c2=_0x379a72[0x1];var _0x4f7bf5=_[_0xdc36('0x47')](_0x42d0a6['rows'],function(_0x3c50ea){return _0x3c50ea[_0xdc36('0x48')]==_0x4e62c2['id'];});return _0x502033[_0xdc36('0x1a')](0xc8)[_0xdc36('0x35')]({'count':_0x4f7bf5['length'],'rows':_0x4f7bf5});})['catch'](handleError(_0x502033));};exports[_0xdc36('0x49')]=function(_0x1d4707,_0x3d8c56){logger[_0xdc36('0x13')](_0xdc36('0x4a'),_0x1d4707[_0xdc36('0x2c')]);var _0x2359bd=conferenceValidation[_0xdc36('0xd')](_0x1d4707[_0xdc36('0x2c')]);if(_0x2359bd[_0xdc36('0x28')]>0x0){return _0x3d8c56['status'](0x190)[_0xdc36('0x35')](_0x2359bd);}var _0x4ea344=_0x1d4707[_0xdc36('0x2c')][_0xdc36('0x2d')];return getAgent(_0x4ea344)[_0xdc36('0x1d')](function(_0x35adec){logger[_0xdc36('0x13')](_0xdc36('0x31'),_0x35adec[_0xdc36('0x19')]);emit(util[_0xdc36('0x32')](_0xdc36('0x33'),_0x35adec[_0xdc36('0x19')]),_0xdc36('0x4b'));return _0x3d8c56[_0xdc36('0x1a')](0xc8)[_0xdc36('0x35')]({'error':![],'message':_0xdc36('0x4c')});})[_0xdc36('0x20')](handleError(_0x3d8c56));};exports[_0xdc36('0x4d')]=function(_0x43e23e,_0x1994c6){logger[_0xdc36('0x13')](_0xdc36('0x4e'),_0x43e23e['body']);var _0x327c04=transferValidation[_0xdc36('0xd')](_0x43e23e[_0xdc36('0x2c')]);if(_0x327c04[_0xdc36('0x28')]>0x0){return _0x1994c6[_0xdc36('0x1a')](0x190)[_0xdc36('0x35')](_0x327c04);}var _0x5ae258=_0x43e23e[_0xdc36('0x2c')][_0xdc36('0x2d')];var _0x52e7f7=_0x43e23e['body'][_0xdc36('0x27')];var _0x271004=_0x43e23e[_0xdc36('0x2c')]['transferNumber'];return getAgent(_0x5ae258)['then'](function(_0x6888a8){logger[_0xdc36('0x13')]('entityFound:',_0x6888a8['name']);emit(util[_0xdc36('0x32')](_0xdc36('0x33'),_0x6888a8[_0xdc36('0x19')]),_0xdc36('0x4f'),{'sessionId':_0x52e7f7,'transferNumber':_0x271004});return _0x1994c6[_0xdc36('0x1a')](0xc8)[_0xdc36('0x35')]({'error':![],'message':_0xdc36('0x50')});})[_0xdc36('0x20')](handleError(_0x1994c6));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 86f66f5..a4788af 100644 --- a/server/api/whatsappAccount/index.js +++ b/server/api/whatsappAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7880=['/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addAgents','addApplications','notify','put','update','delete','removeDispositions','removeAnswers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x4b3300,_0x1137f1){var _0x2d26d3=function(_0x4678b5){while(--_0x4678b5){_0x4b3300['push'](_0x4b3300['shift']());}};_0x2d26d3(++_0x1137f1);}(_0x7880,0x1f4));var _0x0788=function(_0x2ec650,_0x24b011){_0x2ec650=_0x2ec650-0x0;var _0xdb00de=_0x7880[_0x2ec650];return _0xdb00de;};'use strict';var multer=require('multer');var util=require(_0x0788('0x0'));var path=require(_0x0788('0x1'));var timeout=require(_0x0788('0x2'));var express=require(_0x0788('0x3'));var router=express[_0x0788('0x4')]();var fs_extra=require(_0x0788('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var controller=require(_0x0788('0x8'));router[_0x0788('0x9')]('/',auth[_0x0788('0xa')](),controller[_0x0788('0xb')]);router[_0x0788('0x9')](_0x0788('0xc'),auth[_0x0788('0xa')](),controller[_0x0788('0xd')]);router['get'](_0x0788('0xe'),auth['isAuthenticated'](),controller[_0x0788('0xf')]);router['get'](_0x0788('0x10'),auth[_0x0788('0xa')](),controller[_0x0788('0x11')]);router[_0x0788('0x9')](_0x0788('0x12'),auth['isAuthenticated'](),controller[_0x0788('0x13')]);router[_0x0788('0x9')](_0x0788('0x14'),auth[_0x0788('0xa')](),controller[_0x0788('0x15')]);router[_0x0788('0x9')](_0x0788('0x16'),auth['isAuthenticated'](),controller[_0x0788('0x17')]);router[_0x0788('0x18')]('/',auth[_0x0788('0xa')](),controller[_0x0788('0x19')]);router['post'](_0x0788('0x10'),auth['isAuthenticated'](),controller[_0x0788('0x1a')]);router[_0x0788('0x18')](_0x0788('0x12'),auth[_0x0788('0xa')](),controller[_0x0788('0x1b')]);router[_0x0788('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0x0788('0x1c')]);router[_0x0788('0x18')]('/:id/applications',auth[_0x0788('0xa')](),controller[_0x0788('0x1d')]);router[_0x0788('0x18')]('/:id/notify',controller[_0x0788('0x1e')]);router[_0x0788('0x18')]('/:id/send',auth[_0x0788('0xa')](),controller['send']);router[_0x0788('0x1f')]('/:id',auth[_0x0788('0xa')](),controller[_0x0788('0x20')]);router[_0x0788('0x21')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller['destroy']);router['delete'](_0x0788('0x10'),auth[_0x0788('0xa')](),controller[_0x0788('0x22')]);router[_0x0788('0x21')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x0788('0x23')]);router[_0x0788('0x21')](_0x0788('0x14'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x0788('0x24')]=router; \ No newline at end of file +var _0x7096=['removeAgents','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/notify','/:id/send','send','/:id','update','delete','destroy','removeDispositions','removeAnswers'];(function(_0x1282c3,_0x4b684b){var _0x4a6499=function(_0x427bd9){while(--_0x427bd9){_0x1282c3['push'](_0x1282c3['shift']());}};_0x4a6499(++_0x4b684b);}(_0x7096,0x10c));var _0x6709=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x7096[_0x4e9628];return _0x27bc8c;};'use strict';var multer=require('multer');var util=require(_0x6709('0x0'));var path=require('path');var timeout=require(_0x6709('0x1'));var express=require('express');var router=express[_0x6709('0x2')]();var fs_extra=require(_0x6709('0x3'));var auth=require(_0x6709('0x4'));var interaction=require(_0x6709('0x5'));var config=require(_0x6709('0x6'));var controller=require(_0x6709('0x7'));router[_0x6709('0x8')]('/',auth[_0x6709('0x9')](),controller[_0x6709('0xa')]);router[_0x6709('0x8')](_0x6709('0xb'),auth[_0x6709('0x9')](),controller[_0x6709('0xc')]);router['get']('/:id',auth[_0x6709('0x9')](),controller[_0x6709('0xd')]);router[_0x6709('0x8')](_0x6709('0xe'),auth[_0x6709('0x9')](),controller[_0x6709('0xf')]);router['get']('/:id/canned_answers',auth[_0x6709('0x9')](),controller[_0x6709('0x10')]);router[_0x6709('0x8')](_0x6709('0x11'),auth[_0x6709('0x9')](),controller[_0x6709('0x12')]);router[_0x6709('0x8')](_0x6709('0x13'),auth['isAuthenticated'](),controller[_0x6709('0x14')]);router[_0x6709('0x15')]('/',auth[_0x6709('0x9')](),controller[_0x6709('0x16')]);router['post'](_0x6709('0xe'),auth['isAuthenticated'](),controller[_0x6709('0x17')]);router['post'](_0x6709('0x18'),auth[_0x6709('0x9')](),controller[_0x6709('0x19')]);router[_0x6709('0x15')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x6709('0x15')](_0x6709('0x13'),auth['isAuthenticated'](),controller[_0x6709('0x1a')]);router[_0x6709('0x15')](_0x6709('0x1b'),controller['notify']);router[_0x6709('0x15')](_0x6709('0x1c'),auth[_0x6709('0x9')](),controller[_0x6709('0x1d')]);router['put'](_0x6709('0x1e'),auth[_0x6709('0x9')](),controller[_0x6709('0x1f')]);router[_0x6709('0x20')](_0x6709('0x1e'),auth[_0x6709('0x9')](),controller[_0x6709('0x21')]);router[_0x6709('0x20')](_0x6709('0xe'),auth[_0x6709('0x9')](),controller[_0x6709('0x22')]);router[_0x6709('0x20')]('/:id/canned_answers',auth[_0x6709('0x9')](),controller[_0x6709('0x23')]);router[_0x6709('0x20')]('/:id/users',auth[_0x6709('0x9')](),controller[_0x6709('0x24')]);module[_0x6709('0x25')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index f8e8c26..7679d2a 100644 --- a/server/api/whatsappAccount/whatsappAccount.attributes.js +++ b/server/api/whatsappAccount/whatsappAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x21f1=['name','ENUM','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING'];(function(_0x565b08,_0x28d87c){var _0x4b2658=function(_0x693ec3){while(--_0x693ec3){_0x565b08['push'](_0x565b08['shift']());}};_0x4b2658(++_0x28d87c);}(_0x21f1,0x75));var _0x121f=function(_0x9311eb,_0x127ece){_0x9311eb=_0x9311eb-0x0;var _0x176508=_0x21f1[_0x9311eb];return _0x176508;};'use strict';var Sequelize=require(_0x121f('0x0'));var rs=require('randomstring');module[_0x121f('0x1')]={'name':{'type':Sequelize[_0x121f('0x2')],'unique':_0x121f('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x121f('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x121f('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x121f('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x121f('0x2')]},'type':{'type':Sequelize[_0x121f('0x4')]('twilio',_0x121f('0x5'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0x121f('0x2')]},'authToken':{'type':Sequelize[_0x121f('0x2')]},'notificationTemplate':{'type':Sequelize[_0x121f('0x6')],'defaultValue':function(){return _0x121f('0x7');}},'notificationSound':{'type':Sequelize[_0x121f('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x121f('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x121f('0x9')],'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['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x121f('0x9')],'comment':_0x121f('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x121f('0x8')],'defaultValue':![],'comment':_0x121f('0xb'),'set':function(_0x38a039){if(!_0x38a039){this[_0x121f('0xc')](_0x121f('0xd'),null);}this['setDataValue'](_0x121f('0xe'),_0x38a039);}},'description':{'type':Sequelize[_0x121f('0x2')]}}; \ No newline at end of file +var _0xfb6a=['ENUM','twilio','sinch','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','exports','name','STRING','generate'];(function(_0x1e2756,_0x54090b){var _0xdfce0=function(_0x494cb3){while(--_0x494cb3){_0x1e2756['push'](_0x1e2756['shift']());}};_0xdfce0(++_0x54090b);}(_0xfb6a,0x9b));var _0xafb6=function(_0x24f5b1,_0x350007){_0x24f5b1=_0x24f5b1-0x0;var _0x451a13=_0xfb6a[_0x24f5b1];return _0x451a13;};'use strict';var Sequelize=require(_0xafb6('0x0'));var rs=require('randomstring');module[_0xafb6('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xafb6('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xafb6('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xafb6('0x3')],'defaultValue':function(){return rs[_0xafb6('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xafb6('0x5')](_0xafb6('0x6'),_0xafb6('0x7'))},'accountSid':{'type':Sequelize[_0xafb6('0x3')]},'baseUrl':{'type':Sequelize[_0xafb6('0x3')]},'authToken':{'type':Sequelize[_0xafb6('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xafb6('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xafb6('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xafb6('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xafb6('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xafb6('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xafb6('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xafb6('0xa')],'comment':_0xafb6('0xb')},'mandatoryDisposition':{'type':Sequelize[_0xafb6('0x9')],'defaultValue':![],'comment':_0xafb6('0xc'),'set':function(_0xd28960){if(!_0xd28960){this[_0xafb6('0xd')](_0xafb6('0xe'),null);}this[_0xafb6('0xd')](_0xafb6('0xf'),_0xd28960);}},'description':{'type':Sequelize[_0xafb6('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index dc125a0..ffe9594 100644 --- a/server/api/whatsappAccount/whatsappAccount.controller.js +++ b/server/api/whatsappAccount/whatsappAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad80=['includeAll','include','findAll','rows','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','WhatsappAccountId','Disposition','getDispositions','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','addAgents','ids','omit','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','getAgents','findOne','addApplications','sequelize','transaction','Transaction','WhatsappApplication','bulkCreate','findAndCountAll','finally','send','getApplications','whatsapp','account','sinch','statuses','state','read','WhatsappMessage','timestamp','message_id','applications','orderBy','Applications','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','twilio','from','replace','whatsapp:','Body','messageId','MessageSid','notifications','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','DESC','list','mapKey','contact','WhatsappInteraction','spread','interaction','created','push','close','*,*,*,*','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','\x0a','to\x20is\x20mandatory','List','user','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','limit','count','set','apply','reject','update','destroy','get','WhatsappAccounts','UserProfileResource','end','sendStatus','stack','name','mandatoryDispositionPause','WhatsappAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xad80,0x6c));var _0x0ad8=function(_0x4f3d39,_0x52886b){_0x4f3d39=_0x4f3d39-0x0;var _0x277322=_0xad80[_0x4f3d39];return _0x277322;};'use strict';var emlformat=require(_0x0ad8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0ad8('0x1'));var jsonpatch=require(_0x0ad8('0x2'));var rp=require(_0x0ad8('0x3'));var moment=require(_0x0ad8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0ad8('0x5'));var util=require('util');var path=require(_0x0ad8('0x6'));var sox=require('sox');var csv=require(_0x0ad8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ad8('0x8'));var squel=require(_0x0ad8('0x9'));var crypto=require(_0x0ad8('0xa'));var jsforce=require(_0x0ad8('0xb'));var deskjs=require(_0x0ad8('0xc'));var toCsv=require(_0x0ad8('0x7'));var querystring=require(_0x0ad8('0xd'));var Papa=require('papaparse');var Redis=require(_0x0ad8('0xe'));var authService=require(_0x0ad8('0xf'));var qs=require(_0x0ad8('0x10'));var as=require(_0x0ad8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ad8('0x12'))(_0x0ad8('0x13'));var utils=require(_0x0ad8('0x14'));var config=require(_0x0ad8('0x15'));var licenseUtil=require(_0x0ad8('0x16'));var db=require(_0x0ad8('0x17'))['db'];config[_0x0ad8('0x18')]=_[_0x0ad8('0x19')](config[_0x0ad8('0x18')],{'host':_0x0ad8('0x1a'),'port':0x18eb});var socket=require(_0x0ad8('0x1b'))(new Redis(config['redis']));require(_0x0ad8('0x1c'))[_0x0ad8('0x1d')](socket);var jayson=require(_0x0ad8('0x1e'));var client=jayson['client'][_0x0ad8('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x1df0c2,_0x405e2a,_0x42b2ed,_0x232dee){return new BPromise(function(_0x371495,_0x265896){var _0x20fd95=_0x232dee||client;return _0x20fd95[_0x0ad8('0x20')](_0x1df0c2,_0x42b2ed)[_0x0ad8('0x21')](function(_0x277b77){logger[_0x0ad8('0x22')](_0x0ad8('0x23'),_0x405e2a,_0x0ad8('0x24'));logger[_0x0ad8('0x25')](_0x0ad8('0x26'),_0x405e2a,_0x0ad8('0x24'),JSON[_0x0ad8('0x27')](_0x277b77));if(_0x277b77[_0x0ad8('0x28')]){if(_0x277b77[_0x0ad8('0x28')][_0x0ad8('0x29')]===0x1f4){logger[_0x0ad8('0x28')](_0x0ad8('0x23'),_0x405e2a,_0x277b77[_0x0ad8('0x28')][_0x0ad8('0x2a')]);return _0x265896(_0x277b77[_0x0ad8('0x28')][_0x0ad8('0x2a')]);}logger['error'](_0x0ad8('0x23'),_0x405e2a,_0x277b77[_0x0ad8('0x28')]['message']);return _0x371495(_0x277b77['error'][_0x0ad8('0x2a')]);}else{logger[_0x0ad8('0x22')]('WhatsappAccount,\x20%s,\x20%s',_0x405e2a,'request\x20sent');_0x371495(_0x277b77[_0x0ad8('0x2b')][_0x0ad8('0x2a')]);}})[_0x0ad8('0x2c')](function(_0x2fe669){logger[_0x0ad8('0x28')](_0x0ad8('0x23'),_0x405e2a,_0x2fe669);_0x265896(_0x2fe669);});});}function respondWithStatusCode(_0x2506c3,_0x577d62){_0x577d62=_0x577d62||0xcc;return function(_0x44eb38){if(_0x44eb38){return _0x2506c3['sendStatus'](_0x577d62);}return _0x2506c3[_0x0ad8('0x2d')](_0x577d62)['end']();};}function respondWithResult(_0x2ba51c,_0x2e3c49){_0x2e3c49=_0x2e3c49||0xc8;return function(_0x1e3b8f){if(_0x1e3b8f){return _0x2ba51c[_0x0ad8('0x2d')](_0x2e3c49)[_0x0ad8('0x2e')](_0x1e3b8f);}};}function respondWithFilteredResult(_0x50dcce,_0xc04db4){return function(_0x383321){if(_0x383321){var _0x459535=typeof _0xc04db4[_0x0ad8('0x2f')]==='undefined'&&typeof _0xc04db4[_0x0ad8('0x30')]==='undefined';var _0x304ab8=_0x383321[_0x0ad8('0x31')];var _0xb4f0ba=_0x459535?0x0:_0xc04db4[_0x0ad8('0x2f')];var _0x375c3b=_0x459535?_0x383321[_0x0ad8('0x31')]:_0xc04db4[_0x0ad8('0x2f')]+_0xc04db4['limit'];var _0x44e6f6;if(_0x375c3b>=_0x304ab8){_0x375c3b=_0x304ab8;_0x44e6f6=0xc8;}else{_0x44e6f6=0xce;}_0x50dcce[_0x0ad8('0x2d')](_0x44e6f6);return _0x50dcce[_0x0ad8('0x32')]('Content-Range',_0xb4f0ba+'-'+_0x375c3b+'/'+_0x304ab8)[_0x0ad8('0x2e')](_0x383321);}return null;};}function patchUpdates(_0x11311b){return function(_0x4679ce){try{jsonpatch[_0x0ad8('0x33')](_0x4679ce,_0x11311b,!![]);}catch(_0x1967ad){return BPromise[_0x0ad8('0x34')](_0x1967ad);}return _0x4679ce['save']();};}function saveUpdates(_0x1e8323,_0x44616b){return function(_0x4fc8c7){if(_0x4fc8c7){return _0x4fc8c7[_0x0ad8('0x35')](_0x1e8323)[_0x0ad8('0x21')](function(_0x5d1c45){return _0x5d1c45;});}return null;};}function removeEntity(_0x5f147e,_0x1583d7){return function(_0x15c622){if(_0x15c622){return _0x15c622[_0x0ad8('0x36')]()[_0x0ad8('0x21')](function(){var _0x4d245f=_0x15c622[_0x0ad8('0x37')]({'plain':!![]});var _0xcef455=_0x0ad8('0x38');return db[_0x0ad8('0x39')][_0x0ad8('0x36')]({'where':{'type':_0xcef455,'resourceId':_0x4d245f['id']}})[_0x0ad8('0x21')](function(){return _0x15c622;});})[_0x0ad8('0x21')](function(){_0x5f147e[_0x0ad8('0x2d')](0xcc)[_0x0ad8('0x3a')]();});}};}function handleEntityNotFound(_0x2ae1aa,_0x7fee75){return function(_0x15fe07){if(!_0x15fe07){_0x2ae1aa[_0x0ad8('0x3b')](0x194);}return _0x15fe07;};}function handleError(_0x46d895,_0xf985ce){_0xf985ce=_0xf985ce||0x1f4;return function(_0x427595){logger[_0x0ad8('0x28')](_0x427595[_0x0ad8('0x3c')]);if(_0x427595[_0x0ad8('0x3d')]){delete _0x427595[_0x0ad8('0x3d')];}_0x46d895[_0x0ad8('0x2d')](_0xf985ce)['send'](_0x427595);};}exports['index']=function(_0x260a6,_0x8ab2da){var _0x23461f={'include':[{'model':db['Pause'],'as':_0x0ad8('0x3e')}]},_0x33e7ff={},_0x5d4580={'count':0x0,'rows':[]};var _0x210b05=_['map'](db[_0x0ad8('0x3f')][_0x0ad8('0x40')],function(_0xef7cb1){return{'name':_0xef7cb1[_0x0ad8('0x41')],'type':_0xef7cb1[_0x0ad8('0x42')][_0x0ad8('0x43')]};});_0x33e7ff[_0x0ad8('0x44')]=_[_0x0ad8('0x45')](_0x210b05,_0x0ad8('0x3d'));_0x33e7ff[_0x0ad8('0x46')]=_[_0x0ad8('0x47')](_0x260a6[_0x0ad8('0x46')]);_0x33e7ff[_0x0ad8('0x48')]=_[_0x0ad8('0x49')](_0x33e7ff[_0x0ad8('0x44')],_0x33e7ff[_0x0ad8('0x46')]);_0x23461f[_0x0ad8('0x4a')]=_[_0x0ad8('0x49')](_0x33e7ff['model'],qs[_0x0ad8('0x4b')](_0x260a6[_0x0ad8('0x46')][_0x0ad8('0x4b')]));_0x23461f[_0x0ad8('0x4a')]=_0x23461f[_0x0ad8('0x4a')][_0x0ad8('0x4c')]?_0x23461f[_0x0ad8('0x4a')]:_0x33e7ff[_0x0ad8('0x44')];if(!_0x260a6[_0x0ad8('0x46')][_0x0ad8('0x4d')](_0x0ad8('0x4e'))){_0x23461f[_0x0ad8('0x30')]=qs[_0x0ad8('0x30')](_0x260a6[_0x0ad8('0x46')]['limit']);_0x23461f['offset']=qs[_0x0ad8('0x2f')](_0x260a6['query'][_0x0ad8('0x2f')]);}_0x23461f[_0x0ad8('0x4f')]=qs[_0x0ad8('0x50')](_0x260a6['query'][_0x0ad8('0x50')]);_0x23461f[_0x0ad8('0x51')]=qs['filters'](_[_0x0ad8('0x52')](_0x260a6['query'],_0x33e7ff[_0x0ad8('0x48')]),_0x210b05);if(_0x260a6[_0x0ad8('0x46')][_0x0ad8('0x53')]){_0x23461f[_0x0ad8('0x51')]=_[_0x0ad8('0x54')](_0x23461f[_0x0ad8('0x51')],{'$or':_[_0x0ad8('0x45')](_0x210b05,function(_0x105947){if(_0x105947['type']!==_0x0ad8('0x55')){var _0x1fb079={};_0x1fb079[_0x105947[_0x0ad8('0x3d')]]={'$like':'%'+_0x260a6[_0x0ad8('0x46')][_0x0ad8('0x53')]+'%'};return _0x1fb079;}})});}_0x23461f=_['merge']({},_0x23461f,_0x260a6[_0x0ad8('0x56')]);var _0xf9b080={'where':_0x23461f['where']};return db[_0x0ad8('0x3f')]['count'](_0xf9b080)[_0x0ad8('0x21')](function(_0x1ea388){_0x5d4580[_0x0ad8('0x31')]=_0x1ea388;if(_0x260a6[_0x0ad8('0x46')][_0x0ad8('0x57')]){_0x23461f[_0x0ad8('0x58')]=[{'all':!![]}];}return db[_0x0ad8('0x3f')][_0x0ad8('0x59')](_0x23461f);})['then'](function(_0x259439){_0x5d4580[_0x0ad8('0x5a')]=_0x259439;return _0x5d4580;})[_0x0ad8('0x21')](respondWithFilteredResult(_0x8ab2da,_0x23461f))[_0x0ad8('0x2c')](handleError(_0x8ab2da,null));};exports[_0x0ad8('0x5b')]=function(_0x5e5ac8,_0x4dfd92){var _0x3b42f3={'raw':![],'where':{'id':_0x5e5ac8[_0x0ad8('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0x0ad8('0x3e')}]},_0x3b1fc1={};_0x3b1fc1[_0x0ad8('0x44')]=_[_0x0ad8('0x47')](db[_0x0ad8('0x3f')]['rawAttributes']);_0x3b1fc1[_0x0ad8('0x46')]=_[_0x0ad8('0x47')](_0x5e5ac8[_0x0ad8('0x46')]);_0x3b1fc1[_0x0ad8('0x48')]=_[_0x0ad8('0x49')](_0x3b1fc1[_0x0ad8('0x44')],_0x3b1fc1[_0x0ad8('0x46')]);_0x3b42f3[_0x0ad8('0x4a')]=_[_0x0ad8('0x49')](_0x3b1fc1['model'],qs[_0x0ad8('0x4b')](_0x5e5ac8[_0x0ad8('0x46')][_0x0ad8('0x4b')]));_0x3b42f3[_0x0ad8('0x4a')]=_0x3b42f3['attributes'][_0x0ad8('0x4c')]?_0x3b42f3[_0x0ad8('0x4a')]:_0x3b1fc1[_0x0ad8('0x44')];if(_0x5e5ac8['query'][_0x0ad8('0x57')]){_0x3b42f3['include']=[{'all':!![]}];}_0x3b42f3=_[_0x0ad8('0x54')]({},_0x3b42f3,_0x5e5ac8[_0x0ad8('0x56')]);return db[_0x0ad8('0x3f')]['find'](_0x3b42f3)[_0x0ad8('0x21')](handleEntityNotFound(_0x4dfd92,null))[_0x0ad8('0x21')](respondWithResult(_0x4dfd92,null))[_0x0ad8('0x2c')](handleError(_0x4dfd92,null));};exports[_0x0ad8('0x5d')]=function(_0x46321a,_0x16dd33){return db['WhatsappAccount'][_0x0ad8('0x5d')](_0x46321a[_0x0ad8('0x5e')],{})[_0x0ad8('0x21')](function(_0x421137){var _0x26513f=_0x46321a['user'][_0x0ad8('0x37')]({'plain':!![]});if(!_0x26513f)throw new Error(_0x0ad8('0x5f'));if(_0x26513f[_0x0ad8('0x60')]==='user'){var _0x285584=_0x421137[_0x0ad8('0x37')]({'plain':!![]});var _0x1fe63e='WhatsappAccounts';return db[_0x0ad8('0x61')][_0x0ad8('0x62')]({'where':{'name':_0x1fe63e,'userProfileId':_0x26513f[_0x0ad8('0x63')]},'raw':!![]})['then'](function(_0x52a021){if(_0x52a021&&_0x52a021['autoAssociation']===0x0){return db[_0x0ad8('0x39')][_0x0ad8('0x5d')]({'name':_0x285584[_0x0ad8('0x3d')],'resourceId':_0x285584['id'],'type':_0x52a021[_0x0ad8('0x3d')],'sectionId':_0x52a021['id']},{})[_0x0ad8('0x21')](function(){return _0x421137;});}else{return _0x421137;}})[_0x0ad8('0x2c')](function(_0x5b1e1f){logger['error'](_0x0ad8('0x64'),_0x5b1e1f);throw _0x5b1e1f;});}return _0x421137;})[_0x0ad8('0x21')](respondWithResult(_0x16dd33,0xc9))[_0x0ad8('0x2c')](handleError(_0x16dd33,null));};exports[_0x0ad8('0x35')]=function(_0x4fa2b3,_0x1fee04){if(_0x4fa2b3[_0x0ad8('0x5e')]['id']){delete _0x4fa2b3[_0x0ad8('0x5e')]['id'];}return db[_0x0ad8('0x3f')]['find']({'where':{'id':_0x4fa2b3[_0x0ad8('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0x0ad8('0x3e')}]})[_0x0ad8('0x21')](handleEntityNotFound(_0x1fee04,null))[_0x0ad8('0x21')](saveUpdates(_0x4fa2b3[_0x0ad8('0x5e')],null))['then'](respondWithResult(_0x1fee04,null))['catch'](handleError(_0x1fee04,null));};exports[_0x0ad8('0x36')]=function(_0x1d7ea3,_0x42a69c){return db[_0x0ad8('0x3f')][_0x0ad8('0x62')]({'where':{'id':_0x1d7ea3[_0x0ad8('0x5c')]['id']}})[_0x0ad8('0x21')](handleEntityNotFound(_0x42a69c,null))[_0x0ad8('0x21')](removeEntity(_0x42a69c,null))[_0x0ad8('0x2c')](handleError(_0x42a69c,null));};exports[_0x0ad8('0x65')]=function(_0x9101bd,_0x4a8ec6){return db[_0x0ad8('0x3f')]['describe']()[_0x0ad8('0x21')](respondWithResult(_0x4a8ec6,null))[_0x0ad8('0x2c')](handleError(_0x4a8ec6,null));};exports['addDisposition']=function(_0x1c0d68,_0x2259f2,_0x5540f2){if(_0x1c0d68['body']['id']){delete _0x1c0d68['body']['id'];}return db[_0x0ad8('0x3f')][_0x0ad8('0x62')]({'where':{'id':_0x1c0d68[_0x0ad8('0x5c')]['id']}})[_0x0ad8('0x21')](handleEntityNotFound(_0x2259f2,null))[_0x0ad8('0x21')](function(_0x317a15){if(_0x317a15){_0x1c0d68[_0x0ad8('0x5e')][_0x0ad8('0x66')]=_0x317a15['id'];return db[_0x0ad8('0x67')][_0x0ad8('0x5d')](_0x1c0d68[_0x0ad8('0x5e')]);}})[_0x0ad8('0x21')](respondWithResult(_0x2259f2,null))[_0x0ad8('0x2c')](handleError(_0x2259f2,null));};exports[_0x0ad8('0x68')]=function(_0x25b561,_0x5f6f75,_0x19ef17){var _0x1ca151={'raw':![],'where':{}};var _0x32bca4={};var _0x2c1ca9={'count':0x0,'rows':[]};return db[_0x0ad8('0x3f')]['findOne']({'where':{'id':_0x25b561[_0x0ad8('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5f6f75,null))[_0x0ad8('0x21')](function(_0x3c795b){if(_0x3c795b){_0x32bca4[_0x0ad8('0x44')]=_[_0x0ad8('0x47')](db[_0x0ad8('0x67')][_0x0ad8('0x40')]);_0x32bca4['query']=_[_0x0ad8('0x47')](_0x25b561['query']);_0x32bca4[_0x0ad8('0x48')]=_[_0x0ad8('0x49')](_0x32bca4[_0x0ad8('0x44')],_0x32bca4['query']);_0x1ca151[_0x0ad8('0x4a')]=_[_0x0ad8('0x49')](_0x32bca4[_0x0ad8('0x44')],qs[_0x0ad8('0x4b')](_0x25b561['query'][_0x0ad8('0x4b')]));_0x1ca151[_0x0ad8('0x4a')]=_0x1ca151['attributes'][_0x0ad8('0x4c')]?_0x1ca151[_0x0ad8('0x4a')]:_0x32bca4[_0x0ad8('0x44')];if(!_0x25b561[_0x0ad8('0x46')]['hasOwnProperty'](_0x0ad8('0x4e'))){_0x1ca151[_0x0ad8('0x30')]=qs[_0x0ad8('0x30')](_0x25b561['query'][_0x0ad8('0x30')]);_0x1ca151['offset']=qs[_0x0ad8('0x2f')](_0x25b561[_0x0ad8('0x46')][_0x0ad8('0x2f')]);}_0x1ca151[_0x0ad8('0x4f')]=qs[_0x0ad8('0x50')](_0x25b561[_0x0ad8('0x46')]['sort']);_0x1ca151[_0x0ad8('0x51')]=qs[_0x0ad8('0x48')](_[_0x0ad8('0x52')](_0x25b561[_0x0ad8('0x46')],_0x32bca4[_0x0ad8('0x48')]));_0x1ca151[_0x0ad8('0x51')][_0x0ad8('0x66')]=_0x3c795b['id'];if(_0x25b561[_0x0ad8('0x46')]['filter']){_0x1ca151[_0x0ad8('0x51')]=_[_0x0ad8('0x54')](_0x1ca151[_0x0ad8('0x51')],{'$or':_[_0x0ad8('0x45')](_0x1ca151['attributes'],function(_0x47f370){var _0x34f438={};_0x34f438[_0x47f370]={'$like':'%'+_0x25b561['query'][_0x0ad8('0x53')]+'%'};return _0x34f438;})});}_0x1ca151=_[_0x0ad8('0x54')]({},_0x1ca151,_0x25b561[_0x0ad8('0x56')]);return db['Disposition'][_0x0ad8('0x31')]({'where':_0x1ca151[_0x0ad8('0x51')]})[_0x0ad8('0x21')](function(_0x1f6f36){_0x2c1ca9[_0x0ad8('0x31')]=_0x1f6f36;if(_0x25b561[_0x0ad8('0x46')][_0x0ad8('0x57')]){_0x1ca151[_0x0ad8('0x58')]=[{'all':!![]}];}return db[_0x0ad8('0x67')]['findAll'](_0x1ca151);})[_0x0ad8('0x21')](function(_0x491ce4){_0x2c1ca9['rows']=_0x491ce4;return _0x2c1ca9;});}})[_0x0ad8('0x21')](respondWithFilteredResult(_0x5f6f75,_0x1ca151))[_0x0ad8('0x2c')](handleError(_0x5f6f75,null));};exports[_0x0ad8('0x69')]=function(_0x58950c,_0x1805d2,_0x46e1bf){return db[_0x0ad8('0x3f')]['find']({'where':{'id':_0x58950c[_0x0ad8('0x5c')]['id']}})[_0x0ad8('0x21')](handleEntityNotFound(_0x1805d2,null))[_0x0ad8('0x21')](function(_0x2a15c4){if(_0x2a15c4){return _0x2a15c4[_0x0ad8('0x69')](_0x58950c['query']['ids']);}})[_0x0ad8('0x21')](respondWithStatusCode(_0x1805d2,null))[_0x0ad8('0x2c')](handleError(_0x1805d2,null));};exports[_0x0ad8('0x6a')]=function(_0x28c001,_0x4f64c2,_0x450f63){if(_0x28c001[_0x0ad8('0x5e')]['id']){delete _0x28c001[_0x0ad8('0x5e')]['id'];}return db[_0x0ad8('0x3f')][_0x0ad8('0x62')]({'where':{'id':_0x28c001[_0x0ad8('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4f64c2,null))[_0x0ad8('0x21')](function(_0x8e6564){if(_0x8e6564){_0x28c001[_0x0ad8('0x5e')][_0x0ad8('0x66')]=_0x8e6564['id'];return db['CannedAnswer'][_0x0ad8('0x5d')](_0x28c001[_0x0ad8('0x5e')]);}})['then'](respondWithResult(_0x4f64c2,null))[_0x0ad8('0x2c')](handleError(_0x4f64c2,null));};exports[_0x0ad8('0x6b')]=function(_0x45b639,_0x204042,_0x442dc9){var _0x1c1cf4={'raw':![],'where':{}};var _0x42e6c4={};var _0x4db0ab={'count':0x0,'rows':[]};return db[_0x0ad8('0x3f')]['findOne']({'where':{'id':_0x45b639[_0x0ad8('0x5c')]['id']}})[_0x0ad8('0x21')](handleEntityNotFound(_0x204042,null))[_0x0ad8('0x21')](function(_0x26e730){if(_0x26e730){_0x42e6c4['model']=_[_0x0ad8('0x47')](db[_0x0ad8('0x6c')][_0x0ad8('0x40')]);_0x42e6c4[_0x0ad8('0x46')]=_[_0x0ad8('0x47')](_0x45b639[_0x0ad8('0x46')]);_0x42e6c4[_0x0ad8('0x48')]=_['intersection'](_0x42e6c4[_0x0ad8('0x44')],_0x42e6c4[_0x0ad8('0x46')]);_0x1c1cf4['attributes']=_[_0x0ad8('0x49')](_0x42e6c4['model'],qs['fields'](_0x45b639[_0x0ad8('0x46')][_0x0ad8('0x4b')]));_0x1c1cf4[_0x0ad8('0x4a')]=_0x1c1cf4[_0x0ad8('0x4a')][_0x0ad8('0x4c')]?_0x1c1cf4[_0x0ad8('0x4a')]:_0x42e6c4[_0x0ad8('0x44')];if(!_0x45b639['query'][_0x0ad8('0x4d')](_0x0ad8('0x4e'))){_0x1c1cf4[_0x0ad8('0x30')]=qs[_0x0ad8('0x30')](_0x45b639['query'][_0x0ad8('0x30')]);_0x1c1cf4['offset']=qs['offset'](_0x45b639['query'][_0x0ad8('0x2f')]);}_0x1c1cf4['order']=qs['sort'](_0x45b639[_0x0ad8('0x46')]['sort']);_0x1c1cf4[_0x0ad8('0x51')]=qs[_0x0ad8('0x48')](_[_0x0ad8('0x52')](_0x45b639[_0x0ad8('0x46')],_0x42e6c4[_0x0ad8('0x48')]));_0x1c1cf4[_0x0ad8('0x51')]['WhatsappAccountId']=_0x26e730['id'];if(_0x45b639[_0x0ad8('0x46')]['filter']){_0x1c1cf4[_0x0ad8('0x51')]=_[_0x0ad8('0x54')](_0x1c1cf4[_0x0ad8('0x51')],{'$or':_[_0x0ad8('0x45')](_0x1c1cf4[_0x0ad8('0x4a')],function(_0x19db48){var _0x3ffc78={};_0x3ffc78[_0x19db48]={'$like':'%'+_0x45b639[_0x0ad8('0x46')]['filter']+'%'};return _0x3ffc78;})});}_0x1c1cf4=_[_0x0ad8('0x54')]({},_0x1c1cf4,_0x45b639[_0x0ad8('0x56')]);return db[_0x0ad8('0x6c')][_0x0ad8('0x31')]({'where':_0x1c1cf4[_0x0ad8('0x51')]})[_0x0ad8('0x21')](function(_0x4520e6){_0x4db0ab[_0x0ad8('0x31')]=_0x4520e6;if(_0x45b639['query'][_0x0ad8('0x57')]){_0x1c1cf4[_0x0ad8('0x58')]=[{'all':!![]}];}return db[_0x0ad8('0x6c')][_0x0ad8('0x59')](_0x1c1cf4);})[_0x0ad8('0x21')](function(_0x2bd43b){_0x4db0ab[_0x0ad8('0x5a')]=_0x2bd43b;return _0x4db0ab;});}})[_0x0ad8('0x21')](respondWithFilteredResult(_0x204042,_0x1c1cf4))[_0x0ad8('0x2c')](handleError(_0x204042,null));};exports[_0x0ad8('0x6d')]=function(_0x23bc47,_0x3f491d,_0x2598d6){return db[_0x0ad8('0x3f')]['find']({'where':{'id':_0x23bc47['params']['id']}})[_0x0ad8('0x21')](handleEntityNotFound(_0x3f491d,null))['then'](function(_0x26dc09){if(_0x26dc09){return _0x26dc09[_0x0ad8('0x6d')](_0x23bc47['query']['ids']);}})[_0x0ad8('0x21')](respondWithStatusCode(_0x3f491d,null))['catch'](handleError(_0x3f491d,null));};exports[_0x0ad8('0x6e')]=function(_0x2d892d,_0x5079f0,_0x140ae2){return db[_0x0ad8('0x3f')][_0x0ad8('0x62')]({'where':{'id':_0x2d892d['params']['id']}})[_0x0ad8('0x21')](handleEntityNotFound(_0x5079f0,null))[_0x0ad8('0x21')](function(_0x27289b){if(_0x27289b){return _0x27289b['addAgents'](_0x2d892d[_0x0ad8('0x5e')][_0x0ad8('0x6f')],_[_0x0ad8('0x70')](_0x2d892d['body'],[_0x0ad8('0x6f'),'id'])||{})['spread'](function(_0x1e4c17){for(var _0x53a06f=0x0;_0x53a06f<_0x2d892d['body'][_0x0ad8('0x6f')][_0x0ad8('0x4c')];_0x53a06f+=0x1){socket[_0x0ad8('0x71')](_0x0ad8('0x72'),{'UserId':Number(_0x2d892d[_0x0ad8('0x5e')][_0x0ad8('0x6f')][_0x53a06f]),'WhatsappAccountId':Number(_0x2d892d['params']['id'])});}return _0x1e4c17;});}})[_0x0ad8('0x21')](respondWithResult(_0x5079f0,null))[_0x0ad8('0x2c')](handleError(_0x5079f0,null));};exports[_0x0ad8('0x73')]=function(_0x3cbf8b,_0xd95f4a,_0xa70fe9){return db[_0x0ad8('0x3f')][_0x0ad8('0x62')]({'where':{'id':_0x3cbf8b[_0x0ad8('0x5c')]['id']}})[_0x0ad8('0x21')](handleEntityNotFound(_0xd95f4a,null))[_0x0ad8('0x21')](function(_0x379466){if(_0x379466){return _0x379466[_0x0ad8('0x73')](_0x3cbf8b[_0x0ad8('0x46')][_0x0ad8('0x6f')])[_0x0ad8('0x21')](function(){if(_['isArray'](_0x3cbf8b[_0x0ad8('0x46')][_0x0ad8('0x6f')])){for(var _0x41c33c=0x0;_0x41c33c<_0x3cbf8b['query'][_0x0ad8('0x6f')][_0x0ad8('0x4c')];_0x41c33c+=0x1){socket[_0x0ad8('0x71')]('userWhatsappAccount:remove',{'UserId':Number(_0x3cbf8b['query'][_0x0ad8('0x6f')][_0x41c33c]),'WhatsappAccountId':Number(_0x3cbf8b[_0x0ad8('0x5c')]['id'])});}}else{socket['emit'](_0x0ad8('0x74'),{'UserId':Number(_0x3cbf8b[_0x0ad8('0x46')]['ids']),'WhatsappAccountId':Number(_0x3cbf8b[_0x0ad8('0x5c')]['id'])});}});}})[_0x0ad8('0x21')](respondWithStatusCode(_0xd95f4a,null))[_0x0ad8('0x2c')](handleError(_0xd95f4a,null));};exports[_0x0ad8('0x75')]=function(_0xe1e580,_0x215d0f,_0x136b58){var _0x594893={};var _0x14048a={};var _0x1fb909;var _0x5d475a;return db[_0x0ad8('0x3f')][_0x0ad8('0x76')]({'where':{'id':_0xe1e580[_0x0ad8('0x5c')]['id']}})['then'](handleEntityNotFound(_0x215d0f,null))['then'](function(_0x4dc930){if(_0x4dc930){_0x1fb909=_0x4dc930;_0x14048a[_0x0ad8('0x44')]=_[_0x0ad8('0x47')](db['User'][_0x0ad8('0x40')]);_0x14048a[_0x0ad8('0x46')]=_[_0x0ad8('0x47')](_0xe1e580['query']);_0x14048a['filters']=_[_0x0ad8('0x49')](_0x14048a[_0x0ad8('0x44')],_0x14048a[_0x0ad8('0x46')]);_0x594893['attributes']=_[_0x0ad8('0x49')](_0x14048a[_0x0ad8('0x44')],qs[_0x0ad8('0x4b')](_0xe1e580[_0x0ad8('0x46')][_0x0ad8('0x4b')]));_0x594893[_0x0ad8('0x4a')]=_0x594893[_0x0ad8('0x4a')]['length']?_0x594893[_0x0ad8('0x4a')]:_0x14048a[_0x0ad8('0x44')];_0x594893['order']=qs[_0x0ad8('0x50')](_0xe1e580['query'][_0x0ad8('0x50')]);_0x594893[_0x0ad8('0x51')]=qs['filters'](_[_0x0ad8('0x52')](_0xe1e580[_0x0ad8('0x46')],_0x14048a['filters']));if(_0xe1e580[_0x0ad8('0x46')]['filter']){_0x594893[_0x0ad8('0x51')]=_[_0x0ad8('0x54')](_0x594893['where'],{'$or':_[_0x0ad8('0x45')](_0x594893[_0x0ad8('0x4a')],function(_0x30bbc1){var _0x499753={};_0x499753[_0x30bbc1]={'$like':'%'+_0xe1e580[_0x0ad8('0x46')][_0x0ad8('0x53')]+'%'};return _0x499753;})});}_0x594893=_[_0x0ad8('0x54')]({},_0x594893,_0xe1e580[_0x0ad8('0x56')]);return _0x1fb909[_0x0ad8('0x75')](_0x594893);}})[_0x0ad8('0x21')](function(_0x20b92f){if(_0x20b92f){_0x5d475a=_0x20b92f['length'];if(!_0xe1e580[_0x0ad8('0x46')][_0x0ad8('0x4d')](_0x0ad8('0x4e'))){_0x594893['limit']=qs[_0x0ad8('0x30')](_0xe1e580[_0x0ad8('0x46')][_0x0ad8('0x30')]);_0x594893[_0x0ad8('0x2f')]=qs[_0x0ad8('0x2f')](_0xe1e580[_0x0ad8('0x46')][_0x0ad8('0x2f')]);}return _0x1fb909['getAgents'](_0x594893);}})[_0x0ad8('0x21')](function(_0x1b7147){if(_0x1b7147){return _0x1b7147?{'count':_0x5d475a,'rows':_0x1b7147}:null;}})[_0x0ad8('0x21')](respondWithResult(_0x215d0f,null))[_0x0ad8('0x2c')](handleError(_0x215d0f,null));};exports[_0x0ad8('0x77')]=function(_0x9a906c,_0x13b189){var _0x42b147=_0x9a906c[_0x0ad8('0x5c')]['id'];var _0x15653b=_0x9a906c[_0x0ad8('0x5e')];var _0x2c6f18=0xc8;var _0x3b0262=null;return db[_0x0ad8('0x78')][_0x0ad8('0x79')]({'isolationLevel':db[_0x0ad8('0x78')][_0x0ad8('0x7a')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x5962cd){return db['WhatsappAccount'][_0x0ad8('0x76')]({'where':{'id':_0x42b147},'transaction':_0x5962cd})[_0x0ad8('0x21')](function(_0x57deac){if(_0x57deac){return db[_0x0ad8('0x7b')][_0x0ad8('0x36')]({'where':{'WhatsappAccountId':_0x42b147},'transaction':_0x5962cd})['then'](function(){var _0x437a0a=_[_0x0ad8('0x45')](_0x15653b,function(_0x528609){_0x528609[_0x0ad8('0x66')]=_0x42b147;return _0x528609;});return db[_0x0ad8('0x7b')][_0x0ad8('0x7c')](_0x437a0a,{'transaction':_0x5962cd});});}else{_0x2c6f18=0x194;_0x3b0262=[];}});})['then'](function(){if(_0x2c6f18!==0x194){return db[_0x0ad8('0x7b')][_0x0ad8('0x7d')]({'where':{'WhatsappAccountId':_0x42b147},'order':'priority'})[_0x0ad8('0x21')](function(_0x1f8873){_0x3b0262=_0x1f8873;});}})['catch'](function(_0x137084){_0x2c6f18=0x1f4;logger['error'](_0x137084[_0x0ad8('0x3c')]);if(_0x137084[_0x0ad8('0x3d')]){delete _0x137084[_0x0ad8('0x3d')];}_0x3b0262=_0x137084;})[_0x0ad8('0x7e')](function(){if(_0x3b0262===null){_0x13b189[_0x0ad8('0x3b')](_0x2c6f18);}else{if(_0x2c6f18===0x1f4){_0x13b189[_0x0ad8('0x2d')](_0x2c6f18)[_0x0ad8('0x7f')](_0x3b0262);}else{_0x13b189[_0x0ad8('0x2d')](_0x2c6f18)[_0x0ad8('0x2e')](_0x3b0262);}}});};exports['getApplications']=function(_0x2721c0,_0x3f0280,_0x4a6bdd){var _0x56af64={};var _0x441463={};var _0x1644f9;var _0x343993;return db['WhatsappAccount']['findOne']({'where':{'id':_0x2721c0[_0x0ad8('0x5c')]['id']}})[_0x0ad8('0x21')](handleEntityNotFound(_0x3f0280,null))[_0x0ad8('0x21')](function(_0x31e4c6){if(_0x31e4c6){_0x1644f9=_0x31e4c6;_0x441463[_0x0ad8('0x44')]=_[_0x0ad8('0x47')](db[_0x0ad8('0x7b')][_0x0ad8('0x40')]);_0x441463['query']=_['keys'](_0x2721c0[_0x0ad8('0x46')]);_0x441463[_0x0ad8('0x48')]=_[_0x0ad8('0x49')](_0x441463[_0x0ad8('0x44')],_0x441463['query']);_0x56af64[_0x0ad8('0x4a')]=_[_0x0ad8('0x49')](_0x441463['model'],qs[_0x0ad8('0x4b')](_0x2721c0[_0x0ad8('0x46')]['fields']));_0x56af64[_0x0ad8('0x4a')]=_0x56af64[_0x0ad8('0x4a')][_0x0ad8('0x4c')]?_0x56af64[_0x0ad8('0x4a')]:_0x441463['model'];_0x56af64[_0x0ad8('0x4f')]=qs[_0x0ad8('0x50')](_0x2721c0[_0x0ad8('0x46')][_0x0ad8('0x50')]);_0x56af64[_0x0ad8('0x51')]=qs[_0x0ad8('0x48')](_['pick'](_0x2721c0[_0x0ad8('0x46')],_0x441463['filters']));if(_0x2721c0[_0x0ad8('0x46')]['filter']){_0x56af64[_0x0ad8('0x51')]=_['merge'](_0x56af64[_0x0ad8('0x51')],{'$or':_[_0x0ad8('0x45')](_0x56af64['attributes'],function(_0x4f502c){var _0x47138a={};_0x47138a[_0x4f502c]={'$like':'%'+_0x2721c0['query'][_0x0ad8('0x53')]+'%'};return _0x47138a;})});}_0x56af64=_[_0x0ad8('0x54')]({},_0x56af64,_0x2721c0[_0x0ad8('0x56')]);return _0x1644f9[_0x0ad8('0x80')](_0x56af64);}})[_0x0ad8('0x21')](function(_0x4d714f){if(_0x4d714f){_0x343993=_0x4d714f[_0x0ad8('0x4c')];if(!_0x2721c0[_0x0ad8('0x46')][_0x0ad8('0x4d')](_0x0ad8('0x4e'))){_0x56af64[_0x0ad8('0x30')]=qs[_0x0ad8('0x30')](_0x2721c0[_0x0ad8('0x46')][_0x0ad8('0x30')]);_0x56af64[_0x0ad8('0x2f')]=qs['offset'](_0x2721c0['query'][_0x0ad8('0x2f')]);}return _0x1644f9[_0x0ad8('0x80')](_0x56af64);}})[_0x0ad8('0x21')](function(_0x5eaed3){if(_0x5eaed3){return _0x5eaed3?{'count':_0x343993,'rows':_0x5eaed3}:null;}})[_0x0ad8('0x21')](respondWithResult(_0x3f0280,null))['catch'](handleError(_0x3f0280,null));};exports['notify']=function(_0x3e6c1c,_0x1996b0,_0x538648){var _0x4626cb={'channel':_0x0ad8('0x81')};var _0x4777da=[];var _0x4370e7=[];var _0x8bed8={};return db[_0x0ad8('0x3f')][_0x0ad8('0x62')]({'where':{'id':_0x3e6c1c[_0x0ad8('0x5c')]['id']},'include':[{'model':db[_0x0ad8('0x7b')],'as':'Applications'}]})[_0x0ad8('0x21')](handleEntityNotFound(_0x1996b0,null))['then'](function(_0xe19666){_0x4626cb[_0x0ad8('0x82')]=_0xe19666;if(_0x4626cb[_0x0ad8('0x82')]&&_0x4626cb[_0x0ad8('0x82')][_0x0ad8('0x42')]===_0x0ad8('0x83')&&_0x3e6c1c[_0x0ad8('0x5e')][_0x0ad8('0x84')]){if(_0x3e6c1c[_0x0ad8('0x5e')]['statuses'][_0x0ad8('0x4c')]===0x0)return;if(_0x3e6c1c[_0x0ad8('0x5e')][_0x0ad8('0x84')][0x0][_0x0ad8('0x85')]!==_0x0ad8('0x86'))return;return db[_0x0ad8('0x87')][_0x0ad8('0x35')]({'read':!![],'readAt':_0x3e6c1c[_0x0ad8('0x5e')][_0x0ad8('0x84')][0x0][_0x0ad8('0x88')]},{'where':{'messageId':_0x3e6c1c['body'][_0x0ad8('0x84')][0x0][_0x0ad8('0x89')]},'individualHooks':!![]})[_0x0ad8('0x21')](function(_0x236d4a){return _0x1996b0[_0x0ad8('0x2d')](0xc8)[_0x0ad8('0x2e')](_0x236d4a);});}_0x4626cb[_0x0ad8('0x8a')]=_[_0x0ad8('0x8b')](_0xe19666[_0x0ad8('0x8c')],['priority'],['asc']);if(_0x4626cb[_0x0ad8('0x82')][_0x0ad8('0x8c')]){delete _0x4626cb[_0x0ad8('0x82')][_0x0ad8('0x8c')];}return db[_0x0ad8('0x8d')][_0x0ad8('0x65')]()[_0x0ad8('0x21')](function(_0x342030){if(!_0x342030){throw new db[(_0x0ad8('0x8e'))][(_0x0ad8('0x8f'))](_0x0ad8('0x90'));}_0x4777da=_['difference'](_[_0x0ad8('0x47')](_0x342030),[_0x0ad8('0x91'),_0x0ad8('0x92')]);_0x4370e7=_[_0x0ad8('0x93')](_['keys'](_0x342030),[_0x0ad8('0x91'),_0x0ad8('0x92'),_0x0ad8('0x94'),'ListId']);_0x4626cb[_0x0ad8('0x5e')]={'mapKey':'mobile'};if(_0x4626cb['account']&&_0x4626cb[_0x0ad8('0x82')][_0x0ad8('0x42')]===_0x0ad8('0x95')){_0x4626cb[_0x0ad8('0x5e')][_0x0ad8('0x96')]=_0x3e6c1c[_0x0ad8('0x5e')]['From'][_0x0ad8('0x97')](_0x0ad8('0x98'),'');_0x4626cb[_0x0ad8('0x5e')]['body']=_0x3e6c1c[_0x0ad8('0x5e')][_0x0ad8('0x99')];_0x4626cb['body'][_0x0ad8('0x9a')]=_0x3e6c1c[_0x0ad8('0x5e')][_0x0ad8('0x9b')];}if(_0x4626cb[_0x0ad8('0x82')]&&_0x4626cb[_0x0ad8('0x82')][_0x0ad8('0x42')]===_0x0ad8('0x83')){_0x4626cb[_0x0ad8('0x5e')][_0x0ad8('0x96')]=_0x3e6c1c[_0x0ad8('0x5e')]['notifications'][0x0]['from'];_0x4626cb[_0x0ad8('0x5e')]['body']=_0x3e6c1c[_0x0ad8('0x5e')][_0x0ad8('0x9c')][0x0]['message'][_0x0ad8('0x5e')];_0x4626cb[_0x0ad8('0x5e')][_0x0ad8('0x9a')]=_0x3e6c1c[_0x0ad8('0x5e')][_0x0ad8('0x9c')][0x0][_0x0ad8('0x89')];}if(_0x4626cb[_0x0ad8('0x5e')]['id']){delete _0x4626cb[_0x0ad8('0x5e')]['id'];}if(_[_0x0ad8('0x9d')](_0x4626cb[_0x0ad8('0x5e')][_0x0ad8('0x96')])){throw new db[(_0x0ad8('0x8e'))][(_0x0ad8('0x8f'))](_0x0ad8('0x9e'));}if(_[_0x0ad8('0x9d')](_0x4626cb[_0x0ad8('0x5e')]['body'])||_0x4626cb[_0x0ad8('0x5e')]['body']===''){throw new db[(_0x0ad8('0x8e'))][(_0x0ad8('0x8f'))](_0x0ad8('0x9f'));}if(_[_0x0ad8('0x9d')](_0x4626cb['body']['mapKey'])){throw new db[(_0x0ad8('0x8e'))]['ValidationError'](_0x0ad8('0xa0')+_0x4370e7);}if(!_['includes'](_0x4370e7,_0x4626cb[_0x0ad8('0x5e')]['mapKey'])){throw new db[(_0x0ad8('0x8e'))]['ValidationError'](_0x0ad8('0xa1')+_0x4370e7);}_0x8bed8[_0x4626cb[_0x0ad8('0x5e')]['mapKey']]=_0x4626cb[_0x0ad8('0x5e')][_0x0ad8('0x96')];return db[_0x0ad8('0xa2')][_0x0ad8('0x62')]({'where':{'id':_0x4626cb[_0x0ad8('0x82')][_0x0ad8('0xa3')]},'include':[{'model':db[_0x0ad8('0x8d')],'as':_0x0ad8('0xa4'),'where':_0x8bed8,'limit':0x1,'order':[[_0x0ad8('0x92'),_0x0ad8('0xa5')]]}]});})[_0x0ad8('0x21')](handleEntityNotFound(_0x1996b0,null))[_0x0ad8('0x21')](function(_0x4c40c1){if(_0x4c40c1){_0x4626cb[_0x0ad8('0xa6')]=_['omit'](_0x4c40c1,[_0x0ad8('0xa4')]);if(_0x4c40c1[_0x0ad8('0xa4')][_0x0ad8('0x4c')]){return _0x4c40c1[_0x0ad8('0xa4')][0x0];}var _0x2d4000=_['defaults'](_0x4626cb[_0x0ad8('0x5e')],{'firstName':_0x4626cb[_0x0ad8('0x5e')][_0x0ad8('0x96')],'ListId':_0x4c40c1['id']});_0x2d4000[_0x4626cb[_0x0ad8('0x5e')][_0x0ad8('0xa7')]]=_0x4626cb[_0x0ad8('0x5e')][_0x0ad8('0x96')];return db[_0x0ad8('0x8d')][_0x0ad8('0x5d')](_0x2d4000,{'fields':_0x4777da,'raw':!![]});}})[_0x0ad8('0x21')](handleEntityNotFound(_0x1996b0,null))[_0x0ad8('0x21')](function(_0x32d9cb){if(_0x32d9cb){_0x4626cb[_0x0ad8('0xa8')]=_0x32d9cb;var _0x28c3be={'ContactId':_0x32d9cb['id'],'phone':_0x4626cb[_0x0ad8('0x5e')][_0x0ad8('0x96')],'WhatsappAccountId':_0x3e6c1c[_0x0ad8('0x5c')]['id']};var _0x405644={'ContactId':_0x32d9cb['id'],'WhatsappAccountId':_0x3e6c1c[_0x0ad8('0x5c')]['id'],'closed':![]};return db[_0x0ad8('0xa9')][_0x0ad8('0x62')]({'where':_0x405644})[_0x0ad8('0x21')](function(_0xbd16f9){if(_0xbd16f9){return[_0xbd16f9,![]];}return db[_0x0ad8('0xa9')][_0x0ad8('0x5d')](_0x28c3be)['then'](function(_0x34a52f){return[_0x34a52f,!![]];});});}})[_0x0ad8('0xaa')](function(_0x2f886d,_0x100b31){_0x4626cb[_0x0ad8('0xab')]=_0x2f886d[_0x0ad8('0x37')]({'plain':!![]});_0x4626cb['interaction'][_0x0ad8('0xac')]=![];if(_0x100b31){if(_0x4626cb[_0x0ad8('0x82')]['autoclose']){_0x4626cb[_0x0ad8('0x8a')][_0x0ad8('0xad')]({'id':0x0,'priority':_0x4626cb[_0x0ad8('0x8a')][_0x0ad8('0x4c')]+0x1,'app':_0x0ad8('0xae'),'appdata':'unmanaged','interval':_0x0ad8('0xaf')});}_0x4626cb['interaction'][_0x0ad8('0xac')]=!![];}return db[_0x0ad8('0x87')][_0x0ad8('0x5d')]({'phone':_0x4626cb[_0x0ad8('0x5e')]['from'],'messageId':_0x4626cb['body'][_0x0ad8('0x9a')],'body':_0x4626cb['body'][_0x0ad8('0x5e')],'WhatsappAccountId':_0x3e6c1c[_0x0ad8('0x5c')]['id'],'WhatsappInteractionId':_0x2f886d['id'],'direction':'in','ContactId':_0x2f886d[_0x0ad8('0xb0')],'AttachmentId':_0x4626cb[_0x0ad8('0x5e')][_0x0ad8('0xb1')]});})['then'](function(_0x149efe){_0x4626cb['message']=_0x149efe;if(_0x4626cb['interaction'][_0x0ad8('0xb2')]){return db[_0x0ad8('0xb3')][_0x0ad8('0x62')]({'attributes':['id',_0x0ad8('0x3d')],'where':{'id':_0x4626cb[_0x0ad8('0xab')]['UserId']}})['then'](function(_0x20c130){if(_0x20c130){_0x4626cb[_0x0ad8('0x8a')][_0x0ad8('0xb4')]({'id':0x0,'priority':0x0,'app':_0x0ad8('0xb5'),'appdata':_0x20c130[_0x0ad8('0x3d')]+','+(_0x4626cb[_0x0ad8('0x82')][_0x0ad8('0xb6')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x0ad8('0xb7'),_0x0ad8('0xb8'),_0x4626cb);});}return respondWithRpcPromise(_0x0ad8('0xb7'),_0x0ad8('0xb8'),_0x4626cb);})[_0x0ad8('0x21')](function(_0x43c491){if(_0x43c491){var _0x18f41b=0xc8;var _0x3c70e2=_0x0ad8('0xb9');logger[_0x0ad8('0x22')](_0x0ad8('0x26'),_0x3c70e2,_0x18f41b,_0x0ad8('0xba'));logger[_0x0ad8('0x25')](_0x0ad8('0xbb'),_0x3c70e2,_0x18f41b,_0x0ad8('0xba'),JSON[_0x0ad8('0x27')](_0x43c491));if(_0x4626cb[_0x0ad8('0x82')][_0x0ad8('0x42')]===_0x0ad8('0x95')){return _0x1996b0['status'](_0x18f41b)[_0x0ad8('0x32')](_0x0ad8('0xbc'),'text/xml')['send'](_0x0ad8('0xbd'));}else{return _0x1996b0[_0x0ad8('0x2d')](_0x18f41b)['json'](_0x43c491);}}});})[_0x0ad8('0x2c')](handleError(_0x1996b0,null));};exports[_0x0ad8('0x7f')]=function(_0x2f79dd,_0x5a49c7,_0x2eac74){var _0x3931ff,_0x178698,_0x334904;if(_[_0x0ad8('0x9d')](_0x2f79dd[_0x0ad8('0x5e')][_0x0ad8('0x5e')])||_0x2f79dd['body']['body']===''){throw new db[(_0x0ad8('0x8e'))][(_0x0ad8('0x8f'))](_0x0ad8('0x9f'));}if(_['isNil'](_0x2f79dd['body']['to'])){throw new db[(_0x0ad8('0x8e'))]['ValidationError'](_0x0ad8('0xbe'));}_0x3931ff=_0x2f79dd['body']['to'];return db['WhatsappAccount'][_0x0ad8('0x62')]({'where':{'id':_0x2f79dd[_0x0ad8('0x5c')]['id']},'include':[{'model':db[_0x0ad8('0xa2')],'as':_0x0ad8('0xbf'),'include':[{'model':db[_0x0ad8('0x8d')],'as':_0x0ad8('0xa4'),'where':{'mobile':_0x3931ff},'limit':0x1,'order':[[_0x0ad8('0x92'),_0x0ad8('0xa5')]]}]}]})[_0x0ad8('0x21')](handleEntityNotFound(_0x5a49c7,null))[_0x0ad8('0x21')](function(_0x3a313b){if(_0x3a313b&&_0x3a313b[_0x0ad8('0xbf')]){_0x178698=_0x3a313b[_0x0ad8('0x37')]({'plain':!![]});if(_0x178698[_0x0ad8('0xbf')]&&_0x178698[_0x0ad8('0xbf')][_0x0ad8('0xa4')][_0x0ad8('0x4c')]){return _0x178698[_0x0ad8('0xbf')][_0x0ad8('0xa4')][0x0];}return db[_0x0ad8('0x8d')][_0x0ad8('0x5d')](_[_0x0ad8('0x19')](_0x2f79dd['body'],{'firstName':_0x3931ff,'mobile':_0x3931ff,'phone':_0x3931ff,'ListId':_0x178698[_0x0ad8('0xa3')]}));}})[_0x0ad8('0x21')](handleEntityNotFound(_0x5a49c7,null))[_0x0ad8('0x21')](function(_0x4cba7d){if(_0x4cba7d){_0x334904=_0x4cba7d;return db[_0x0ad8('0xa9')][_0x0ad8('0x62')]({'where':{'ContactId':_0x334904['id'],'closed':![],'WhatsappAccountId':_0x178698['id']}})[_0x0ad8('0x21')](function(_0x5db6b8){if(_0x5db6b8){return[_0x5db6b8,![]];}return db[_0x0ad8('0xa9')][_0x0ad8('0x5d')]({'UserId':_0x2f79dd[_0x0ad8('0xc0')]['id'],'ContactId':_0x334904['id'],'WhatsappAccountId':_0x178698['id'],'phone':_0x3931ff,'firstMsgDirection':'out','Messages':[_[_0x0ad8('0x54')](_0x2f79dd[_0x0ad8('0x5e')],{'read':![],'body':_0x2f79dd[_0x0ad8('0x5e')][_0x0ad8('0x5e')],'phone':_0x3931ff,'WhatsappAccountId':_0x178698['id'],'UserId':_0x2f79dd[_0x0ad8('0xc0')]['id'],'ContactId':_0x334904['id']})]},{'include':[{'model':db[_0x0ad8('0x87')],'as':_0x0ad8('0xc1')}]})[_0x0ad8('0x21')](function(_0x22bb5d){return[_0x22bb5d,!![]];});});}})['spread'](function(_0x4df2b8,_0x11468b){if(_0x11468b){return _0x4df2b8;}return db[_0x0ad8('0x87')]['create'](_[_0x0ad8('0x54')](_0x2f79dd[_0x0ad8('0x5e')],{'read':![],'body':_0x2f79dd[_0x0ad8('0x5e')][_0x0ad8('0x5e')],'phone':_0x3931ff,'WhatsappAccountId':_0x178698['id'],'WhatsappInteractionId':_0x4df2b8['id'],'UserId':_0x2f79dd[_0x0ad8('0xc0')]['id'],'ContactId':_0x334904['id']}))[_0x0ad8('0x21')](function(_0x1a95e5){_0x4df2b8[_0x0ad8('0xc2')][_0x0ad8('0xc1')]=[];_0x4df2b8[_0x0ad8('0xc2')][_0x0ad8('0xc1')][_0x0ad8('0xad')](_0x1a95e5[_0x0ad8('0xc2')]);return _0x4df2b8;});})[_0x0ad8('0x21')](respondWithResult(_0x5a49c7,null))[_0x0ad8('0x2c')](handleError(_0x5a49c7,null));}; \ No newline at end of file +var _0xb17d=['emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','User','getAgents','hasOwnProperty','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','findAndCountAll','getApplications','whatsapp','sinch','statuses','state','read','WhatsappMessage','timestamp','message_id','applications','Applications','priority','asc','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','from','From','replace','Body','messageId','notifications','from\x20is\x20mandatory','isNil','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','ListId','Contacts','DESC','list','WhatsappInteraction','interaction','created','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','unshift','agent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','out','Messages','dataValues','push','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','./whatsappAccount.socket','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','WhatsappAccounts','UserProfileResource','destroy','stack','name','send','index','Pause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','mandatoryDispositionPause','describe','addDisposition','WhatsappAccountId','Disposition','findOne','keys','length','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','addAgents','omit','spread'];(function(_0x2c7da1,_0x295c32){var _0x26e6ad=function(_0x3e16b0){while(--_0x3e16b0){_0x2c7da1['push'](_0x2c7da1['shift']());}};_0x26e6ad(++_0x295c32);}(_0xb17d,0x111));var _0xdb17=function(_0x4382dd,_0x397c6c){_0x4382dd=_0x4382dd-0x0;var _0xdec80b=_0xb17d[_0x4382dd];return _0xdec80b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdb17('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdb17('0x1'));var rp=require(_0xdb17('0x2'));var moment=require(_0xdb17('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdb17('0x4'));var util=require('util');var path=require(_0xdb17('0x5'));var sox=require(_0xdb17('0x6'));var csv=require(_0xdb17('0x7'));var ejs=require(_0xdb17('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdb17('0x9'));var squel=require(_0xdb17('0xa'));var crypto=require(_0xdb17('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdb17('0x7'));var querystring=require(_0xdb17('0xc'));var Papa=require(_0xdb17('0xd'));var Redis=require(_0xdb17('0xe'));var authService=require(_0xdb17('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdb17('0x10'))(_0xdb17('0x11'));var utils=require(_0xdb17('0x12'));var config=require(_0xdb17('0x13'));var licenseUtil=require(_0xdb17('0x14'));var db=require(_0xdb17('0x15'))['db'];config['redis']=_[_0xdb17('0x16')](config['redis'],{'host':_0xdb17('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xdb17('0x18'))['register'](socket);var jayson=require(_0xdb17('0x19'));var client=jayson[_0xdb17('0x1a')][_0xdb17('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0xc7bda7,_0x46cf83,_0x1ddf4c,_0x11f74a){return new BPromise(function(_0x39b61d,_0x5192a3){var _0xf13727=_0x11f74a||client;return _0xf13727['request'](_0xc7bda7,_0x1ddf4c)[_0xdb17('0x1c')](function(_0x34c6c5){logger[_0xdb17('0x1d')]('WhatsappAccount,\x20%s,\x20%s',_0x46cf83,_0xdb17('0x1e'));logger[_0xdb17('0x1f')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x46cf83,'request\x20sent',JSON[_0xdb17('0x20')](_0x34c6c5));if(_0x34c6c5['error']){if(_0x34c6c5[_0xdb17('0x21')][_0xdb17('0x22')]===0x1f4){logger[_0xdb17('0x21')]('WhatsappAccount,\x20%s,\x20%s',_0x46cf83,_0x34c6c5[_0xdb17('0x21')]['message']);return _0x5192a3(_0x34c6c5[_0xdb17('0x21')]['message']);}logger[_0xdb17('0x21')](_0xdb17('0x23'),_0x46cf83,_0x34c6c5[_0xdb17('0x21')]['message']);return _0x39b61d(_0x34c6c5[_0xdb17('0x21')][_0xdb17('0x24')]);}else{logger['info'](_0xdb17('0x23'),_0x46cf83,_0xdb17('0x1e'));_0x39b61d(_0x34c6c5['result'][_0xdb17('0x24')]);}})['catch'](function(_0x553c94){logger[_0xdb17('0x21')]('WhatsappAccount,\x20%s,\x20%s',_0x46cf83,_0x553c94);_0x5192a3(_0x553c94);});});}function respondWithStatusCode(_0x2fb6f9,_0x192dd6){_0x192dd6=_0x192dd6||0xcc;return function(_0x3c9178){if(_0x3c9178){return _0x2fb6f9[_0xdb17('0x25')](_0x192dd6);}return _0x2fb6f9[_0xdb17('0x26')](_0x192dd6)[_0xdb17('0x27')]();};}function respondWithResult(_0x4dfa87,_0x4fa1eb){_0x4fa1eb=_0x4fa1eb||0xc8;return function(_0x785a49){if(_0x785a49){return _0x4dfa87['status'](_0x4fa1eb)[_0xdb17('0x28')](_0x785a49);}};}function respondWithFilteredResult(_0x54d283,_0x216f5c){return function(_0x1f2c35){if(_0x1f2c35){var _0x5cfbcb=typeof _0x216f5c[_0xdb17('0x29')]==='undefined'&&typeof _0x216f5c['limit']===_0xdb17('0x2a');var _0x21b7d6=_0x1f2c35[_0xdb17('0x2b')];var _0x3c834a=_0x5cfbcb?0x0:_0x216f5c[_0xdb17('0x29')];var _0x5ad0b4=_0x5cfbcb?_0x1f2c35['count']:_0x216f5c['offset']+_0x216f5c[_0xdb17('0x2c')];var _0x10c777;if(_0x5ad0b4>=_0x21b7d6){_0x5ad0b4=_0x21b7d6;_0x10c777=0xc8;}else{_0x10c777=0xce;}_0x54d283[_0xdb17('0x26')](_0x10c777);return _0x54d283[_0xdb17('0x2d')](_0xdb17('0x2e'),_0x3c834a+'-'+_0x5ad0b4+'/'+_0x21b7d6)[_0xdb17('0x28')](_0x1f2c35);}return null;};}function patchUpdates(_0x329a0b){return function(_0x109928){try{jsonpatch[_0xdb17('0x2f')](_0x109928,_0x329a0b,!![]);}catch(_0x3e1fe5){return BPromise[_0xdb17('0x30')](_0x3e1fe5);}return _0x109928[_0xdb17('0x31')]();};}function saveUpdates(_0x2df655,_0x388d04){return function(_0x15f423){if(_0x15f423){return _0x15f423['update'](_0x2df655)[_0xdb17('0x1c')](function(_0x252ccc){return _0x252ccc;});}return null;};}function removeEntity(_0x4da3ed,_0x144832){return function(_0x586eab){if(_0x586eab){return _0x586eab['destroy']()['then'](function(){var _0x3d60ea=_0x586eab['get']({'plain':!![]});var _0x1b8c2a=_0xdb17('0x32');return db[_0xdb17('0x33')][_0xdb17('0x34')]({'where':{'type':_0x1b8c2a,'resourceId':_0x3d60ea['id']}})[_0xdb17('0x1c')](function(){return _0x586eab;});})[_0xdb17('0x1c')](function(){_0x4da3ed[_0xdb17('0x26')](0xcc)[_0xdb17('0x27')]();});}};}function handleEntityNotFound(_0x1fbb49,_0x5b9627){return function(_0x2dc704){if(!_0x2dc704){_0x1fbb49[_0xdb17('0x25')](0x194);}return _0x2dc704;};}function handleError(_0x15c0aa,_0x29cf98){_0x29cf98=_0x29cf98||0x1f4;return function(_0x3ce7e6){logger[_0xdb17('0x21')](_0x3ce7e6[_0xdb17('0x35')]);if(_0x3ce7e6[_0xdb17('0x36')]){delete _0x3ce7e6[_0xdb17('0x36')];}_0x15c0aa[_0xdb17('0x26')](_0x29cf98)[_0xdb17('0x37')](_0x3ce7e6);};}exports[_0xdb17('0x38')]=function(_0x3dd938,_0x15d586){var _0xbe51a9={'include':[{'model':db[_0xdb17('0x39')],'as':'mandatoryDispositionPause'}]},_0x287dd6={},_0x4acb4c={'count':0x0,'rows':[]};var _0x2c419c=_[_0xdb17('0x3a')](db[_0xdb17('0x3b')][_0xdb17('0x3c')],function(_0x4d54c8){return{'name':_0x4d54c8[_0xdb17('0x3d')],'type':_0x4d54c8[_0xdb17('0x3e')][_0xdb17('0x3f')]};});_0x287dd6[_0xdb17('0x40')]=_['map'](_0x2c419c,_0xdb17('0x36'));_0x287dd6['query']=_['keys'](_0x3dd938[_0xdb17('0x41')]);_0x287dd6[_0xdb17('0x42')]=_[_0xdb17('0x43')](_0x287dd6[_0xdb17('0x40')],_0x287dd6[_0xdb17('0x41')]);_0xbe51a9['attributes']=_[_0xdb17('0x43')](_0x287dd6['model'],qs[_0xdb17('0x44')](_0x3dd938['query']['fields']));_0xbe51a9[_0xdb17('0x45')]=_0xbe51a9['attributes']['length']?_0xbe51a9[_0xdb17('0x45')]:_0x287dd6[_0xdb17('0x40')];if(!_0x3dd938[_0xdb17('0x41')]['hasOwnProperty'](_0xdb17('0x46'))){_0xbe51a9[_0xdb17('0x2c')]=qs['limit'](_0x3dd938[_0xdb17('0x41')][_0xdb17('0x2c')]);_0xbe51a9[_0xdb17('0x29')]=qs[_0xdb17('0x29')](_0x3dd938['query'][_0xdb17('0x29')]);}_0xbe51a9[_0xdb17('0x47')]=qs['sort'](_0x3dd938['query'][_0xdb17('0x48')]);_0xbe51a9[_0xdb17('0x49')]=qs[_0xdb17('0x42')](_[_0xdb17('0x4a')](_0x3dd938[_0xdb17('0x41')],_0x287dd6[_0xdb17('0x42')]),_0x2c419c);if(_0x3dd938[_0xdb17('0x41')][_0xdb17('0x4b')]){_0xbe51a9[_0xdb17('0x49')]=_[_0xdb17('0x4c')](_0xbe51a9[_0xdb17('0x49')],{'$or':_[_0xdb17('0x3a')](_0x2c419c,function(_0x22fc00){if(_0x22fc00[_0xdb17('0x3e')]!==_0xdb17('0x4d')){var _0x422a52={};_0x422a52[_0x22fc00[_0xdb17('0x36')]]={'$like':'%'+_0x3dd938['query']['filter']+'%'};return _0x422a52;}})});}_0xbe51a9=_[_0xdb17('0x4c')]({},_0xbe51a9,_0x3dd938[_0xdb17('0x4e')]);var _0x3f9b17={'where':_0xbe51a9[_0xdb17('0x49')]};return db['WhatsappAccount'][_0xdb17('0x2b')](_0x3f9b17)[_0xdb17('0x1c')](function(_0x3de720){_0x4acb4c[_0xdb17('0x2b')]=_0x3de720;if(_0x3dd938[_0xdb17('0x41')][_0xdb17('0x4f')]){_0xbe51a9[_0xdb17('0x50')]=[{'all':!![]}];}return db[_0xdb17('0x3b')][_0xdb17('0x51')](_0xbe51a9);})[_0xdb17('0x1c')](function(_0x2d18e5){_0x4acb4c[_0xdb17('0x52')]=_0x2d18e5;return _0x4acb4c;})[_0xdb17('0x1c')](respondWithFilteredResult(_0x15d586,_0xbe51a9))[_0xdb17('0x53')](handleError(_0x15d586,null));};exports[_0xdb17('0x54')]=function(_0x1e20e4,_0x188b4b){var _0x1f2f5a={'raw':![],'where':{'id':_0x1e20e4[_0xdb17('0x55')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0xdcfbf0={};_0xdcfbf0['model']=_['keys'](db[_0xdb17('0x3b')][_0xdb17('0x3c')]);_0xdcfbf0[_0xdb17('0x41')]=_['keys'](_0x1e20e4[_0xdb17('0x41')]);_0xdcfbf0[_0xdb17('0x42')]=_[_0xdb17('0x43')](_0xdcfbf0[_0xdb17('0x40')],_0xdcfbf0[_0xdb17('0x41')]);_0x1f2f5a[_0xdb17('0x45')]=_[_0xdb17('0x43')](_0xdcfbf0['model'],qs[_0xdb17('0x44')](_0x1e20e4[_0xdb17('0x41')][_0xdb17('0x44')]));_0x1f2f5a[_0xdb17('0x45')]=_0x1f2f5a['attributes']['length']?_0x1f2f5a['attributes']:_0xdcfbf0[_0xdb17('0x40')];if(_0x1e20e4[_0xdb17('0x41')][_0xdb17('0x4f')]){_0x1f2f5a['include']=[{'all':!![]}];}_0x1f2f5a=_[_0xdb17('0x4c')]({},_0x1f2f5a,_0x1e20e4[_0xdb17('0x4e')]);return db[_0xdb17('0x3b')][_0xdb17('0x56')](_0x1f2f5a)[_0xdb17('0x1c')](handleEntityNotFound(_0x188b4b,null))['then'](respondWithResult(_0x188b4b,null))[_0xdb17('0x53')](handleError(_0x188b4b,null));};exports[_0xdb17('0x57')]=function(_0x25c0d7,_0x58597f){return db[_0xdb17('0x3b')][_0xdb17('0x57')](_0x25c0d7[_0xdb17('0x58')],{})[_0xdb17('0x1c')](function(_0x519fc4){var _0x1ef7c0=_0x25c0d7[_0xdb17('0x59')][_0xdb17('0x5a')]({'plain':!![]});if(!_0x1ef7c0)throw new Error(_0xdb17('0x5b'));if(_0x1ef7c0[_0xdb17('0x5c')]===_0xdb17('0x59')){var _0x2f8cfb=_0x519fc4['get']({'plain':!![]});var _0x1345d1='WhatsappAccounts';return db[_0xdb17('0x5d')][_0xdb17('0x56')]({'where':{'name':_0x1345d1,'userProfileId':_0x1ef7c0[_0xdb17('0x5e')]},'raw':!![]})[_0xdb17('0x1c')](function(_0x283904){if(_0x283904&&_0x283904['autoAssociation']===0x0){return db[_0xdb17('0x33')]['create']({'name':_0x2f8cfb[_0xdb17('0x36')],'resourceId':_0x2f8cfb['id'],'type':_0x283904['name'],'sectionId':_0x283904['id']},{})[_0xdb17('0x1c')](function(){return _0x519fc4;});}else{return _0x519fc4;}})[_0xdb17('0x53')](function(_0x4e2e4e){logger['error'](_0xdb17('0x5f'),_0x4e2e4e);throw _0x4e2e4e;});}return _0x519fc4;})[_0xdb17('0x1c')](respondWithResult(_0x58597f,0xc9))[_0xdb17('0x53')](handleError(_0x58597f,null));};exports[_0xdb17('0x60')]=function(_0x32f342,_0x1d1c25){if(_0x32f342[_0xdb17('0x58')]['id']){delete _0x32f342[_0xdb17('0x58')]['id'];}return db[_0xdb17('0x3b')]['find']({'where':{'id':_0x32f342['params']['id']},'include':[{'model':db[_0xdb17('0x39')],'as':_0xdb17('0x61')}]})[_0xdb17('0x1c')](handleEntityNotFound(_0x1d1c25,null))['then'](saveUpdates(_0x32f342[_0xdb17('0x58')],null))[_0xdb17('0x1c')](respondWithResult(_0x1d1c25,null))['catch'](handleError(_0x1d1c25,null));};exports[_0xdb17('0x34')]=function(_0x16ffeb,_0x49bdbe){return db[_0xdb17('0x3b')][_0xdb17('0x56')]({'where':{'id':_0x16ffeb[_0xdb17('0x55')]['id']}})[_0xdb17('0x1c')](handleEntityNotFound(_0x49bdbe,null))['then'](removeEntity(_0x49bdbe,null))[_0xdb17('0x53')](handleError(_0x49bdbe,null));};exports[_0xdb17('0x62')]=function(_0x22348d,_0x5a3399){return db[_0xdb17('0x3b')]['describe']()[_0xdb17('0x1c')](respondWithResult(_0x5a3399,null))[_0xdb17('0x53')](handleError(_0x5a3399,null));};exports[_0xdb17('0x63')]=function(_0x57597c,_0x2af697,_0x5c47ae){if(_0x57597c[_0xdb17('0x58')]['id']){delete _0x57597c[_0xdb17('0x58')]['id'];}return db[_0xdb17('0x3b')]['find']({'where':{'id':_0x57597c['params']['id']}})[_0xdb17('0x1c')](handleEntityNotFound(_0x2af697,null))[_0xdb17('0x1c')](function(_0xaa11e5){if(_0xaa11e5){_0x57597c[_0xdb17('0x58')][_0xdb17('0x64')]=_0xaa11e5['id'];return db[_0xdb17('0x65')][_0xdb17('0x57')](_0x57597c[_0xdb17('0x58')]);}})[_0xdb17('0x1c')](respondWithResult(_0x2af697,null))[_0xdb17('0x53')](handleError(_0x2af697,null));};exports['getDispositions']=function(_0x511b49,_0x2285a2,_0x1addb9){var _0x3ae0f3={'raw':![],'where':{}};var _0x5f0913={};var _0x1945d4={'count':0x0,'rows':[]};return db[_0xdb17('0x3b')][_0xdb17('0x66')]({'where':{'id':_0x511b49[_0xdb17('0x55')]['id']}})[_0xdb17('0x1c')](handleEntityNotFound(_0x2285a2,null))[_0xdb17('0x1c')](function(_0x4716be){if(_0x4716be){_0x5f0913[_0xdb17('0x40')]=_[_0xdb17('0x67')](db[_0xdb17('0x65')][_0xdb17('0x3c')]);_0x5f0913['query']=_['keys'](_0x511b49[_0xdb17('0x41')]);_0x5f0913[_0xdb17('0x42')]=_[_0xdb17('0x43')](_0x5f0913[_0xdb17('0x40')],_0x5f0913[_0xdb17('0x41')]);_0x3ae0f3[_0xdb17('0x45')]=_['intersection'](_0x5f0913['model'],qs[_0xdb17('0x44')](_0x511b49[_0xdb17('0x41')][_0xdb17('0x44')]));_0x3ae0f3[_0xdb17('0x45')]=_0x3ae0f3[_0xdb17('0x45')][_0xdb17('0x68')]?_0x3ae0f3[_0xdb17('0x45')]:_0x5f0913[_0xdb17('0x40')];if(!_0x511b49[_0xdb17('0x41')]['hasOwnProperty'](_0xdb17('0x46'))){_0x3ae0f3['limit']=qs[_0xdb17('0x2c')](_0x511b49[_0xdb17('0x41')][_0xdb17('0x2c')]);_0x3ae0f3[_0xdb17('0x29')]=qs[_0xdb17('0x29')](_0x511b49[_0xdb17('0x41')]['offset']);}_0x3ae0f3['order']=qs[_0xdb17('0x48')](_0x511b49[_0xdb17('0x41')][_0xdb17('0x48')]);_0x3ae0f3['where']=qs['filters'](_['pick'](_0x511b49[_0xdb17('0x41')],_0x5f0913['filters']));_0x3ae0f3[_0xdb17('0x49')][_0xdb17('0x64')]=_0x4716be['id'];if(_0x511b49[_0xdb17('0x41')]['filter']){_0x3ae0f3[_0xdb17('0x49')]=_['merge'](_0x3ae0f3[_0xdb17('0x49')],{'$or':_[_0xdb17('0x3a')](_0x3ae0f3['attributes'],function(_0x1cc694){var _0x3550ad={};_0x3550ad[_0x1cc694]={'$like':'%'+_0x511b49[_0xdb17('0x41')][_0xdb17('0x4b')]+'%'};return _0x3550ad;})});}_0x3ae0f3=_[_0xdb17('0x4c')]({},_0x3ae0f3,_0x511b49['options']);return db[_0xdb17('0x65')]['count']({'where':_0x3ae0f3[_0xdb17('0x49')]})[_0xdb17('0x1c')](function(_0x5c142f){_0x1945d4[_0xdb17('0x2b')]=_0x5c142f;if(_0x511b49[_0xdb17('0x41')]['includeAll']){_0x3ae0f3[_0xdb17('0x50')]=[{'all':!![]}];}return db[_0xdb17('0x65')]['findAll'](_0x3ae0f3);})['then'](function(_0x359fcf){_0x1945d4['rows']=_0x359fcf;return _0x1945d4;});}})[_0xdb17('0x1c')](respondWithFilteredResult(_0x2285a2,_0x3ae0f3))[_0xdb17('0x53')](handleError(_0x2285a2,null));};exports[_0xdb17('0x69')]=function(_0x5a4c76,_0x3f705e,_0x573e73){return db[_0xdb17('0x3b')][_0xdb17('0x56')]({'where':{'id':_0x5a4c76[_0xdb17('0x55')]['id']}})['then'](handleEntityNotFound(_0x3f705e,null))[_0xdb17('0x1c')](function(_0x94706c){if(_0x94706c){return _0x94706c[_0xdb17('0x69')](_0x5a4c76[_0xdb17('0x41')]['ids']);}})[_0xdb17('0x1c')](respondWithStatusCode(_0x3f705e,null))[_0xdb17('0x53')](handleError(_0x3f705e,null));};exports['addAnswer']=function(_0x47f1c,_0x391bd3,_0xdd8535){if(_0x47f1c[_0xdb17('0x58')]['id']){delete _0x47f1c['body']['id'];}return db[_0xdb17('0x3b')][_0xdb17('0x56')]({'where':{'id':_0x47f1c[_0xdb17('0x55')]['id']}})[_0xdb17('0x1c')](handleEntityNotFound(_0x391bd3,null))['then'](function(_0x5d709f){if(_0x5d709f){_0x47f1c[_0xdb17('0x58')]['WhatsappAccountId']=_0x5d709f['id'];return db[_0xdb17('0x6a')][_0xdb17('0x57')](_0x47f1c[_0xdb17('0x58')]);}})[_0xdb17('0x1c')](respondWithResult(_0x391bd3,null))[_0xdb17('0x53')](handleError(_0x391bd3,null));};exports[_0xdb17('0x6b')]=function(_0x350992,_0x578c2a,_0x127ecf){var _0x364d13={'raw':![],'where':{}};var _0x25cd5d={};var _0x416ccb={'count':0x0,'rows':[]};return db[_0xdb17('0x3b')][_0xdb17('0x66')]({'where':{'id':_0x350992[_0xdb17('0x55')]['id']}})[_0xdb17('0x1c')](handleEntityNotFound(_0x578c2a,null))[_0xdb17('0x1c')](function(_0x240d1a){if(_0x240d1a){_0x25cd5d['model']=_[_0xdb17('0x67')](db[_0xdb17('0x6a')]['rawAttributes']);_0x25cd5d[_0xdb17('0x41')]=_[_0xdb17('0x67')](_0x350992[_0xdb17('0x41')]);_0x25cd5d['filters']=_['intersection'](_0x25cd5d['model'],_0x25cd5d[_0xdb17('0x41')]);_0x364d13[_0xdb17('0x45')]=_[_0xdb17('0x43')](_0x25cd5d[_0xdb17('0x40')],qs['fields'](_0x350992[_0xdb17('0x41')]['fields']));_0x364d13[_0xdb17('0x45')]=_0x364d13['attributes'][_0xdb17('0x68')]?_0x364d13[_0xdb17('0x45')]:_0x25cd5d[_0xdb17('0x40')];if(!_0x350992[_0xdb17('0x41')]['hasOwnProperty'](_0xdb17('0x46'))){_0x364d13[_0xdb17('0x2c')]=qs[_0xdb17('0x2c')](_0x350992[_0xdb17('0x41')][_0xdb17('0x2c')]);_0x364d13[_0xdb17('0x29')]=qs[_0xdb17('0x29')](_0x350992[_0xdb17('0x41')]['offset']);}_0x364d13[_0xdb17('0x47')]=qs[_0xdb17('0x48')](_0x350992[_0xdb17('0x41')]['sort']);_0x364d13[_0xdb17('0x49')]=qs['filters'](_[_0xdb17('0x4a')](_0x350992['query'],_0x25cd5d[_0xdb17('0x42')]));_0x364d13[_0xdb17('0x49')][_0xdb17('0x64')]=_0x240d1a['id'];if(_0x350992[_0xdb17('0x41')][_0xdb17('0x4b')]){_0x364d13[_0xdb17('0x49')]=_[_0xdb17('0x4c')](_0x364d13['where'],{'$or':_[_0xdb17('0x3a')](_0x364d13[_0xdb17('0x45')],function(_0x4326be){var _0x1cf308={};_0x1cf308[_0x4326be]={'$like':'%'+_0x350992[_0xdb17('0x41')][_0xdb17('0x4b')]+'%'};return _0x1cf308;})});}_0x364d13=_[_0xdb17('0x4c')]({},_0x364d13,_0x350992[_0xdb17('0x4e')]);return db[_0xdb17('0x6a')][_0xdb17('0x2b')]({'where':_0x364d13[_0xdb17('0x49')]})[_0xdb17('0x1c')](function(_0x19b7e8){_0x416ccb[_0xdb17('0x2b')]=_0x19b7e8;if(_0x350992[_0xdb17('0x41')][_0xdb17('0x4f')]){_0x364d13[_0xdb17('0x50')]=[{'all':!![]}];}return db[_0xdb17('0x6a')][_0xdb17('0x51')](_0x364d13);})[_0xdb17('0x1c')](function(_0x51acf5){_0x416ccb['rows']=_0x51acf5;return _0x416ccb;});}})[_0xdb17('0x1c')](respondWithFilteredResult(_0x578c2a,_0x364d13))[_0xdb17('0x53')](handleError(_0x578c2a,null));};exports[_0xdb17('0x6c')]=function(_0x3ddb44,_0x504b85,_0x48a49a){return db['WhatsappAccount'][_0xdb17('0x56')]({'where':{'id':_0x3ddb44['params']['id']}})[_0xdb17('0x1c')](handleEntityNotFound(_0x504b85,null))[_0xdb17('0x1c')](function(_0x1f286b){if(_0x1f286b){return _0x1f286b[_0xdb17('0x6c')](_0x3ddb44['query'][_0xdb17('0x6d')]);}})[_0xdb17('0x1c')](respondWithStatusCode(_0x504b85,null))[_0xdb17('0x53')](handleError(_0x504b85,null));};exports[_0xdb17('0x6e')]=function(_0x244092,_0x4b20fd,_0x1bdaea){return db[_0xdb17('0x3b')][_0xdb17('0x56')]({'where':{'id':_0x244092[_0xdb17('0x55')]['id']}})[_0xdb17('0x1c')](handleEntityNotFound(_0x4b20fd,null))[_0xdb17('0x1c')](function(_0x2813b1){if(_0x2813b1){return _0x2813b1[_0xdb17('0x6e')](_0x244092['body'][_0xdb17('0x6d')],_[_0xdb17('0x6f')](_0x244092[_0xdb17('0x58')],[_0xdb17('0x6d'),'id'])||{})[_0xdb17('0x70')](function(_0x21f86a){for(var _0x487955=0x0;_0x487955<_0x244092['body']['ids'][_0xdb17('0x68')];_0x487955+=0x1){socket[_0xdb17('0x71')](_0xdb17('0x72'),{'UserId':Number(_0x244092['body'][_0xdb17('0x6d')][_0x487955]),'WhatsappAccountId':Number(_0x244092[_0xdb17('0x55')]['id'])});}return _0x21f86a;});}})[_0xdb17('0x1c')](respondWithResult(_0x4b20fd,null))[_0xdb17('0x53')](handleError(_0x4b20fd,null));};exports['removeAgents']=function(_0x573580,_0x27c135,_0x4526b4){return db[_0xdb17('0x3b')]['find']({'where':{'id':_0x573580[_0xdb17('0x55')]['id']}})[_0xdb17('0x1c')](handleEntityNotFound(_0x27c135,null))['then'](function(_0x5e94a6){if(_0x5e94a6){return _0x5e94a6[_0xdb17('0x73')](_0x573580[_0xdb17('0x41')]['ids'])[_0xdb17('0x1c')](function(){if(_[_0xdb17('0x74')](_0x573580[_0xdb17('0x41')][_0xdb17('0x6d')])){for(var _0x1751ed=0x0;_0x1751ed<_0x573580[_0xdb17('0x41')][_0xdb17('0x6d')][_0xdb17('0x68')];_0x1751ed+=0x1){socket[_0xdb17('0x71')](_0xdb17('0x75'),{'UserId':Number(_0x573580[_0xdb17('0x41')][_0xdb17('0x6d')][_0x1751ed]),'WhatsappAccountId':Number(_0x573580[_0xdb17('0x55')]['id'])});}}else{socket[_0xdb17('0x71')](_0xdb17('0x75'),{'UserId':Number(_0x573580['query']['ids']),'WhatsappAccountId':Number(_0x573580[_0xdb17('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x27c135,null))[_0xdb17('0x53')](handleError(_0x27c135,null));};exports['getAgents']=function(_0x390b64,_0x27bbdc,_0x519b1e){var _0x25bd19={};var _0x1af3c6={};var _0x5658f0;var _0x125228;return db['WhatsappAccount'][_0xdb17('0x66')]({'where':{'id':_0x390b64[_0xdb17('0x55')]['id']}})['then'](handleEntityNotFound(_0x27bbdc,null))[_0xdb17('0x1c')](function(_0x16d826){if(_0x16d826){_0x5658f0=_0x16d826;_0x1af3c6[_0xdb17('0x40')]=_['keys'](db[_0xdb17('0x76')][_0xdb17('0x3c')]);_0x1af3c6[_0xdb17('0x41')]=_[_0xdb17('0x67')](_0x390b64['query']);_0x1af3c6[_0xdb17('0x42')]=_['intersection'](_0x1af3c6[_0xdb17('0x40')],_0x1af3c6[_0xdb17('0x41')]);_0x25bd19[_0xdb17('0x45')]=_['intersection'](_0x1af3c6['model'],qs[_0xdb17('0x44')](_0x390b64[_0xdb17('0x41')]['fields']));_0x25bd19[_0xdb17('0x45')]=_0x25bd19['attributes'][_0xdb17('0x68')]?_0x25bd19['attributes']:_0x1af3c6['model'];_0x25bd19[_0xdb17('0x47')]=qs[_0xdb17('0x48')](_0x390b64['query'][_0xdb17('0x48')]);_0x25bd19[_0xdb17('0x49')]=qs[_0xdb17('0x42')](_[_0xdb17('0x4a')](_0x390b64[_0xdb17('0x41')],_0x1af3c6[_0xdb17('0x42')]));if(_0x390b64['query'][_0xdb17('0x4b')]){_0x25bd19[_0xdb17('0x49')]=_[_0xdb17('0x4c')](_0x25bd19[_0xdb17('0x49')],{'$or':_[_0xdb17('0x3a')](_0x25bd19['attributes'],function(_0x4148a1){var _0x6581c7={};_0x6581c7[_0x4148a1]={'$like':'%'+_0x390b64[_0xdb17('0x41')][_0xdb17('0x4b')]+'%'};return _0x6581c7;})});}_0x25bd19=_[_0xdb17('0x4c')]({},_0x25bd19,_0x390b64['options']);return _0x5658f0[_0xdb17('0x77')](_0x25bd19);}})[_0xdb17('0x1c')](function(_0x579bc0){if(_0x579bc0){_0x125228=_0x579bc0[_0xdb17('0x68')];if(!_0x390b64[_0xdb17('0x41')][_0xdb17('0x78')](_0xdb17('0x46'))){_0x25bd19['limit']=qs[_0xdb17('0x2c')](_0x390b64[_0xdb17('0x41')]['limit']);_0x25bd19[_0xdb17('0x29')]=qs[_0xdb17('0x29')](_0x390b64['query']['offset']);}return _0x5658f0[_0xdb17('0x77')](_0x25bd19);}})[_0xdb17('0x1c')](function(_0x8e4fde){if(_0x8e4fde){return _0x8e4fde?{'count':_0x125228,'rows':_0x8e4fde}:null;}})[_0xdb17('0x1c')](respondWithResult(_0x27bbdc,null))[_0xdb17('0x53')](handleError(_0x27bbdc,null));};exports[_0xdb17('0x79')]=function(_0x4bedc6,_0x623db9){var _0x13c5b4=_0x4bedc6[_0xdb17('0x55')]['id'];var _0x27864d=_0x4bedc6['body'];var _0x50ca72=0xc8;var _0xbd802c=null;return db['sequelize']['transaction']({'isolationLevel':db[_0xdb17('0x7a')][_0xdb17('0x7b')][_0xdb17('0x7c')][_0xdb17('0x7d')]},function(_0x59dee0){return db[_0xdb17('0x3b')][_0xdb17('0x66')]({'where':{'id':_0x13c5b4},'transaction':_0x59dee0})[_0xdb17('0x1c')](function(_0x1ab336){if(_0x1ab336){return db[_0xdb17('0x7e')][_0xdb17('0x34')]({'where':{'WhatsappAccountId':_0x13c5b4},'transaction':_0x59dee0})[_0xdb17('0x1c')](function(){var _0x4e8b49=_[_0xdb17('0x3a')](_0x27864d,function(_0x12e340){_0x12e340[_0xdb17('0x64')]=_0x13c5b4;return _0x12e340;});return db[_0xdb17('0x7e')]['bulkCreate'](_0x4e8b49,{'transaction':_0x59dee0});});}else{_0x50ca72=0x194;_0xbd802c=[];}});})[_0xdb17('0x1c')](function(){if(_0x50ca72!==0x194){return db[_0xdb17('0x7e')][_0xdb17('0x7f')]({'where':{'WhatsappAccountId':_0x13c5b4},'order':'priority'})[_0xdb17('0x1c')](function(_0x3d0d27){_0xbd802c=_0x3d0d27;});}})['catch'](function(_0x3bad2e){_0x50ca72=0x1f4;logger[_0xdb17('0x21')](_0x3bad2e[_0xdb17('0x35')]);if(_0x3bad2e['name']){delete _0x3bad2e['name'];}_0xbd802c=_0x3bad2e;})['finally'](function(){if(_0xbd802c===null){_0x623db9[_0xdb17('0x25')](_0x50ca72);}else{if(_0x50ca72===0x1f4){_0x623db9[_0xdb17('0x26')](_0x50ca72)[_0xdb17('0x37')](_0xbd802c);}else{_0x623db9[_0xdb17('0x26')](_0x50ca72)[_0xdb17('0x28')](_0xbd802c);}}});};exports['getApplications']=function(_0x372ed0,_0x27c98f,_0x2474d8){var _0x10202b={};var _0x295c6={};var _0x5e6b79;var _0x50d242;return db[_0xdb17('0x3b')][_0xdb17('0x66')]({'where':{'id':_0x372ed0[_0xdb17('0x55')]['id']}})[_0xdb17('0x1c')](handleEntityNotFound(_0x27c98f,null))[_0xdb17('0x1c')](function(_0x5d4b05){if(_0x5d4b05){_0x5e6b79=_0x5d4b05;_0x295c6[_0xdb17('0x40')]=_[_0xdb17('0x67')](db[_0xdb17('0x7e')]['rawAttributes']);_0x295c6[_0xdb17('0x41')]=_['keys'](_0x372ed0['query']);_0x295c6['filters']=_[_0xdb17('0x43')](_0x295c6[_0xdb17('0x40')],_0x295c6[_0xdb17('0x41')]);_0x10202b[_0xdb17('0x45')]=_[_0xdb17('0x43')](_0x295c6[_0xdb17('0x40')],qs[_0xdb17('0x44')](_0x372ed0[_0xdb17('0x41')]['fields']));_0x10202b['attributes']=_0x10202b[_0xdb17('0x45')][_0xdb17('0x68')]?_0x10202b[_0xdb17('0x45')]:_0x295c6[_0xdb17('0x40')];_0x10202b[_0xdb17('0x47')]=qs['sort'](_0x372ed0[_0xdb17('0x41')]['sort']);_0x10202b['where']=qs[_0xdb17('0x42')](_['pick'](_0x372ed0[_0xdb17('0x41')],_0x295c6['filters']));if(_0x372ed0[_0xdb17('0x41')]['filter']){_0x10202b[_0xdb17('0x49')]=_[_0xdb17('0x4c')](_0x10202b[_0xdb17('0x49')],{'$or':_['map'](_0x10202b[_0xdb17('0x45')],function(_0x5ef214){var _0x37ee01={};_0x37ee01[_0x5ef214]={'$like':'%'+_0x372ed0['query'][_0xdb17('0x4b')]+'%'};return _0x37ee01;})});}_0x10202b=_['merge']({},_0x10202b,_0x372ed0['options']);return _0x5e6b79[_0xdb17('0x80')](_0x10202b);}})['then'](function(_0x57fed9){if(_0x57fed9){_0x50d242=_0x57fed9[_0xdb17('0x68')];if(!_0x372ed0[_0xdb17('0x41')][_0xdb17('0x78')](_0xdb17('0x46'))){_0x10202b[_0xdb17('0x2c')]=qs[_0xdb17('0x2c')](_0x372ed0[_0xdb17('0x41')][_0xdb17('0x2c')]);_0x10202b[_0xdb17('0x29')]=qs[_0xdb17('0x29')](_0x372ed0[_0xdb17('0x41')][_0xdb17('0x29')]);}return _0x5e6b79[_0xdb17('0x80')](_0x10202b);}})[_0xdb17('0x1c')](function(_0x3f2922){if(_0x3f2922){return _0x3f2922?{'count':_0x50d242,'rows':_0x3f2922}:null;}})[_0xdb17('0x1c')](respondWithResult(_0x27c98f,null))[_0xdb17('0x53')](handleError(_0x27c98f,null));};exports['notify']=function(_0x382653,_0xd8f986,_0x322817){var _0x5bd83a={'channel':_0xdb17('0x81')};var _0x4f6644=[];var _0x28551c=[];var _0x3c84ec={};return db[_0xdb17('0x3b')][_0xdb17('0x56')]({'where':{'id':_0x382653[_0xdb17('0x55')]['id']},'include':[{'model':db[_0xdb17('0x7e')],'as':'Applications'}]})[_0xdb17('0x1c')](handleEntityNotFound(_0xd8f986,null))[_0xdb17('0x1c')](function(_0x37bb41){_0x5bd83a['account']=_0x37bb41;if(_0x5bd83a['account']&&_0x5bd83a['account'][_0xdb17('0x3e')]===_0xdb17('0x82')&&_0x382653[_0xdb17('0x58')][_0xdb17('0x83')]){if(_0x382653[_0xdb17('0x58')][_0xdb17('0x83')][_0xdb17('0x68')]===0x0)return;if(_0x382653[_0xdb17('0x58')][_0xdb17('0x83')][0x0][_0xdb17('0x84')]!==_0xdb17('0x85'))return;return db[_0xdb17('0x86')][_0xdb17('0x60')]({'read':!![],'readAt':_0x382653[_0xdb17('0x58')]['statuses'][0x0][_0xdb17('0x87')]},{'where':{'messageId':_0x382653[_0xdb17('0x58')][_0xdb17('0x83')][0x0][_0xdb17('0x88')]},'individualHooks':!![]})['then'](function(_0x12ab62){return _0xd8f986[_0xdb17('0x26')](0xc8)[_0xdb17('0x28')](_0x12ab62);});}_0x5bd83a[_0xdb17('0x89')]=_['orderBy'](_0x37bb41[_0xdb17('0x8a')],[_0xdb17('0x8b')],[_0xdb17('0x8c')]);if(_0x5bd83a['account']['Applications']){delete _0x5bd83a[_0xdb17('0x8d')]['Applications'];}return db[_0xdb17('0x8e')][_0xdb17('0x62')]()['then'](function(_0xe5044a){if(!_0xe5044a){throw new db[(_0xdb17('0x8f'))][(_0xdb17('0x90'))](_0xdb17('0x91'));}_0x4f6644=_[_0xdb17('0x92')](_[_0xdb17('0x67')](_0xe5044a),[_0xdb17('0x93'),'updatedAt']);_0x28551c=_[_0xdb17('0x92')](_[_0xdb17('0x67')](_0xe5044a),['createdAt',_0xdb17('0x94'),_0xdb17('0x95'),'ListId']);_0x5bd83a[_0xdb17('0x58')]={'mapKey':_0xdb17('0x96')};if(_0x5bd83a['account']&&_0x5bd83a[_0xdb17('0x8d')][_0xdb17('0x3e')]==='twilio'){_0x5bd83a['body'][_0xdb17('0x97')]=_0x382653['body'][_0xdb17('0x98')][_0xdb17('0x99')]('whatsapp:','');_0x5bd83a[_0xdb17('0x58')][_0xdb17('0x58')]=_0x382653[_0xdb17('0x58')][_0xdb17('0x9a')];_0x5bd83a[_0xdb17('0x58')][_0xdb17('0x9b')]=_0x382653[_0xdb17('0x58')]['MessageSid'];}if(_0x5bd83a['account']&&_0x5bd83a[_0xdb17('0x8d')][_0xdb17('0x3e')]===_0xdb17('0x82')){_0x5bd83a[_0xdb17('0x58')][_0xdb17('0x97')]=_0x382653['body'][_0xdb17('0x9c')][0x0][_0xdb17('0x97')];_0x5bd83a[_0xdb17('0x58')][_0xdb17('0x58')]=_0x382653['body'][_0xdb17('0x9c')][0x0]['message'][_0xdb17('0x58')];_0x5bd83a[_0xdb17('0x58')][_0xdb17('0x9b')]=_0x382653[_0xdb17('0x58')][_0xdb17('0x9c')][0x0][_0xdb17('0x88')];}if(_0x5bd83a[_0xdb17('0x58')]['id']){delete _0x5bd83a[_0xdb17('0x58')]['id'];}if(_['isNil'](_0x5bd83a[_0xdb17('0x58')]['from'])){throw new db[(_0xdb17('0x8f'))][(_0xdb17('0x90'))](_0xdb17('0x9d'));}if(_[_0xdb17('0x9e')](_0x5bd83a['body'][_0xdb17('0x58')])||_0x5bd83a[_0xdb17('0x58')]['body']===''){throw new db[(_0xdb17('0x8f'))][(_0xdb17('0x90'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xdb17('0x9e')](_0x5bd83a[_0xdb17('0x58')]['mapKey'])){throw new db[(_0xdb17('0x8f'))][(_0xdb17('0x90'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x28551c);}if(!_['includes'](_0x28551c,_0x5bd83a[_0xdb17('0x58')]['mapKey'])){throw new db[(_0xdb17('0x8f'))][(_0xdb17('0x90'))](_0xdb17('0x9f')+_0x28551c);}_0x3c84ec[_0x5bd83a[_0xdb17('0x58')][_0xdb17('0xa0')]]=_0x5bd83a[_0xdb17('0x58')][_0xdb17('0x97')];return db[_0xdb17('0xa1')]['find']({'where':{'id':_0x5bd83a[_0xdb17('0x8d')][_0xdb17('0xa2')]},'include':[{'model':db[_0xdb17('0x8e')],'as':_0xdb17('0xa3'),'where':_0x3c84ec,'limit':0x1,'order':[['updatedAt',_0xdb17('0xa4')]]}]});})[_0xdb17('0x1c')](handleEntityNotFound(_0xd8f986,null))[_0xdb17('0x1c')](function(_0x5e5359){if(_0x5e5359){_0x5bd83a[_0xdb17('0xa5')]=_[_0xdb17('0x6f')](_0x5e5359,[_0xdb17('0xa3')]);if(_0x5e5359[_0xdb17('0xa3')][_0xdb17('0x68')]){return _0x5e5359[_0xdb17('0xa3')][0x0];}var _0x414f9d=_[_0xdb17('0x16')](_0x5bd83a[_0xdb17('0x58')],{'firstName':_0x5bd83a[_0xdb17('0x58')][_0xdb17('0x97')],'ListId':_0x5e5359['id']});_0x414f9d[_0x5bd83a['body'][_0xdb17('0xa0')]]=_0x5bd83a['body'][_0xdb17('0x97')];return db['CmContact'][_0xdb17('0x57')](_0x414f9d,{'fields':_0x4f6644,'raw':!![]});}})['then'](handleEntityNotFound(_0xd8f986,null))[_0xdb17('0x1c')](function(_0x2417b5){if(_0x2417b5){_0x5bd83a['contact']=_0x2417b5;var _0x318d6d={'ContactId':_0x2417b5['id'],'phone':_0x5bd83a[_0xdb17('0x58')][_0xdb17('0x97')],'WhatsappAccountId':_0x382653['params']['id']};var _0x348330={'ContactId':_0x2417b5['id'],'WhatsappAccountId':_0x382653['params']['id'],'closed':![]};return db[_0xdb17('0xa6')][_0xdb17('0x56')]({'where':_0x348330})[_0xdb17('0x1c')](function(_0x1a9dc8){if(_0x1a9dc8){return[_0x1a9dc8,![]];}return db[_0xdb17('0xa6')]['create'](_0x318d6d)[_0xdb17('0x1c')](function(_0x3425db){return[_0x3425db,!![]];});});}})[_0xdb17('0x70')](function(_0x37b812,_0x2b412b){_0x5bd83a[_0xdb17('0xa7')]=_0x37b812['get']({'plain':!![]});_0x5bd83a[_0xdb17('0xa7')][_0xdb17('0xa8')]=![];if(_0x2b412b){if(_0x5bd83a[_0xdb17('0x8d')]['autoclose']){_0x5bd83a[_0xdb17('0x89')]['push']({'id':0x0,'priority':_0x5bd83a[_0xdb17('0x89')][_0xdb17('0x68')]+0x1,'app':_0xdb17('0xa9'),'appdata':_0xdb17('0xaa'),'interval':_0xdb17('0xab')});}_0x5bd83a[_0xdb17('0xa7')]['created']=!![];}return db['WhatsappMessage']['create']({'phone':_0x5bd83a[_0xdb17('0x58')][_0xdb17('0x97')],'messageId':_0x5bd83a[_0xdb17('0x58')]['messageId'],'body':_0x5bd83a[_0xdb17('0x58')]['body'],'WhatsappAccountId':_0x382653[_0xdb17('0x55')]['id'],'WhatsappInteractionId':_0x37b812['id'],'direction':'in','ContactId':_0x37b812[_0xdb17('0xac')],'AttachmentId':_0x5bd83a[_0xdb17('0x58')][_0xdb17('0xad')]});})[_0xdb17('0x1c')](function(_0x303739){_0x5bd83a[_0xdb17('0x24')]=_0x303739;if(_0x5bd83a['interaction']['UserId']){return db[_0xdb17('0x76')]['find']({'attributes':['id',_0xdb17('0x36')],'where':{'id':_0x5bd83a['interaction'][_0xdb17('0xae')]}})[_0xdb17('0x1c')](function(_0x4dab52){if(_0x4dab52){_0x5bd83a[_0xdb17('0x89')][_0xdb17('0xaf')]({'id':0x0,'priority':0x0,'app':_0xdb17('0xb0'),'appdata':_0x4dab52['name']+','+(_0x5bd83a[_0xdb17('0x8d')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xdb17('0xb1'),_0xdb17('0xb2'),_0x5bd83a);});}return respondWithRpcPromise(_0xdb17('0xb1'),_0xdb17('0xb2'),_0x5bd83a);})['then'](function(_0xfb66d6){if(_0xfb66d6){var _0x568033=0xc8;var _0x2a80ee=_0xdb17('0xb3');logger[_0xdb17('0x1d')](_0xdb17('0xb4'),_0x2a80ee,_0x568033,_0xdb17('0xb5'));logger[_0xdb17('0x1f')](_0xdb17('0xb6'),_0x2a80ee,_0x568033,_0xdb17('0xb5'),JSON[_0xdb17('0x20')](_0xfb66d6));if(_0x5bd83a['account']['type']===_0xdb17('0xb7')){return _0xd8f986[_0xdb17('0x26')](_0x568033)[_0xdb17('0x2d')](_0xdb17('0xb8'),_0xdb17('0xb9'))['send'](_0xdb17('0xba'));}else{return _0xd8f986[_0xdb17('0x26')](_0x568033)[_0xdb17('0x28')](_0xfb66d6);}}});})[_0xdb17('0x53')](handleError(_0xd8f986,null));};exports[_0xdb17('0x37')]=function(_0x34c764,_0x39a7eb,_0x542619){var _0x3e925e,_0x50831d,_0x1a6043;if(_[_0xdb17('0x9e')](_0x34c764['body'][_0xdb17('0x58')])||_0x34c764['body'][_0xdb17('0x58')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xdb17('0x9e')](_0x34c764[_0xdb17('0x58')]['to'])){throw new db[(_0xdb17('0x8f'))][(_0xdb17('0x90'))](_0xdb17('0xbb'));}_0x3e925e=_0x34c764[_0xdb17('0x58')]['to'];return db['WhatsappAccount'][_0xdb17('0x56')]({'where':{'id':_0x34c764[_0xdb17('0x55')]['id']},'include':[{'model':db[_0xdb17('0xa1')],'as':'List','include':[{'model':db['CmContact'],'as':_0xdb17('0xa3'),'where':{'mobile':_0x3e925e},'limit':0x1,'order':[[_0xdb17('0x94'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x39a7eb,null))[_0xdb17('0x1c')](function(_0x4c1ec5){if(_0x4c1ec5&&_0x4c1ec5[_0xdb17('0xbc')]){_0x50831d=_0x4c1ec5[_0xdb17('0x5a')]({'plain':!![]});if(_0x50831d[_0xdb17('0xbc')]&&_0x50831d[_0xdb17('0xbc')][_0xdb17('0xa3')][_0xdb17('0x68')]){return _0x50831d[_0xdb17('0xbc')]['Contacts'][0x0];}return db['CmContact'][_0xdb17('0x57')](_[_0xdb17('0x16')](_0x34c764[_0xdb17('0x58')],{'firstName':_0x3e925e,'mobile':_0x3e925e,'phone':_0x3e925e,'ListId':_0x50831d[_0xdb17('0xa2')]}));}})['then'](handleEntityNotFound(_0x39a7eb,null))[_0xdb17('0x1c')](function(_0x227592){if(_0x227592){_0x1a6043=_0x227592;return db['WhatsappInteraction'][_0xdb17('0x56')]({'where':{'ContactId':_0x1a6043['id'],'closed':![],'WhatsappAccountId':_0x50831d['id']}})['then'](function(_0x378ff9){if(_0x378ff9){return[_0x378ff9,![]];}return db[_0xdb17('0xa6')][_0xdb17('0x57')]({'UserId':_0x34c764['user']['id'],'ContactId':_0x1a6043['id'],'WhatsappAccountId':_0x50831d['id'],'phone':_0x3e925e,'firstMsgDirection':_0xdb17('0xbd'),'Messages':[_['merge'](_0x34c764[_0xdb17('0x58')],{'read':![],'body':_0x34c764[_0xdb17('0x58')][_0xdb17('0x58')],'phone':_0x3e925e,'WhatsappAccountId':_0x50831d['id'],'UserId':_0x34c764[_0xdb17('0x59')]['id'],'ContactId':_0x1a6043['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0xdb17('0xbe')}]})[_0xdb17('0x1c')](function(_0x39ef88){return[_0x39ef88,!![]];});});}})['spread'](function(_0x1fbc19,_0x58bf3f){if(_0x58bf3f){return _0x1fbc19;}return db[_0xdb17('0x86')][_0xdb17('0x57')](_[_0xdb17('0x4c')](_0x34c764['body'],{'read':![],'body':_0x34c764[_0xdb17('0x58')][_0xdb17('0x58')],'phone':_0x3e925e,'WhatsappAccountId':_0x50831d['id'],'WhatsappInteractionId':_0x1fbc19['id'],'UserId':_0x34c764[_0xdb17('0x59')]['id'],'ContactId':_0x1a6043['id']}))[_0xdb17('0x1c')](function(_0x54ab60){_0x1fbc19[_0xdb17('0xbf')][_0xdb17('0xbe')]=[];_0x1fbc19[_0xdb17('0xbf')]['Messages'][_0xdb17('0xc0')](_0x54ab60[_0xdb17('0xbf')]);return _0x1fbc19;});})[_0xdb17('0x1c')](respondWithResult(_0x39a7eb,null))['catch'](handleError(_0x39a7eb,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 334b57b..c675b0f 100644 --- a/server/api/whatsappAccount/whatsappAccount.events.js +++ b/server/api/whatsappAccount/whatsappAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea72=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners'];(function(_0x1d22b8,_0x3de48e){var _0x46721f=function(_0x390e41){while(--_0x390e41){_0x1d22b8['push'](_0x1d22b8['shift']());}};_0x46721f(++_0x3de48e);}(_0xea72,0x1ac));var _0x2ea7=function(_0x91ccae,_0x14425a){_0x91ccae=_0x91ccae-0x0;var _0x208226=_0xea72[_0x91ccae];return _0x208226;};'use strict';var EventEmitter=require(_0x2ea7('0x0'));var WhatsappAccount=require(_0x2ea7('0x1'))['db'][_0x2ea7('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x2ea7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2ea7('0x4')};function emitEvent(_0xba6d4d){return function(_0x86e469,_0x3d3f15,_0x50c0ce){WhatsappAccountEvents[_0x2ea7('0x5')](_0xba6d4d+':'+_0x86e469['id'],_0x86e469);WhatsappAccountEvents[_0x2ea7('0x5')](_0xba6d4d,_0x86e469);_0x50c0ce(null);};}for(var e in events){if(events[_0x2ea7('0x6')](e)){var event=events[e];WhatsappAccount[_0x2ea7('0x7')](e,emitEvent(event));}}module[_0x2ea7('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0xfd84=['save','remove','emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xfd84,0x17f));var _0x4fd8=function(_0x596625,_0x3d8822){_0x596625=_0x596625-0x0;var _0x4b96fb=_0xfd84[_0x596625];return _0x4b96fb;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x4fd8('0x0'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x4fd8('0x1')](0x0);var events={'afterCreate':_0x4fd8('0x2'),'afterUpdate':'update','afterDestroy':_0x4fd8('0x3')};function emitEvent(_0x2c9465){return function(_0x4368b3,_0xa2f1a4,_0x5d8869){WhatsappAccountEvents[_0x4fd8('0x4')](_0x2c9465+':'+_0x4368b3['id'],_0x4368b3);WhatsappAccountEvents[_0x4fd8('0x4')](_0x2c9465,_0x4368b3);_0x5d8869(null);};}for(var e in events){if(events[_0x4fd8('0x5')](e)){var event=events[e];WhatsappAccount[_0x4fd8('0x6')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 7fb88dd..dd36ab8 100644 --- a/server/api/whatsappAccount/whatsappAccount.model.js +++ b/server/api/whatsappAccount/whatsappAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeafd=['WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define'];(function(_0x1ea470,_0x59d9f5){var _0x468422=function(_0x274ec8){while(--_0x274ec8){_0x1ea470['push'](_0x1ea470['shift']());}};_0x468422(++_0x59d9f5);}(_0xeafd,0x17c));var _0xdeaf=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xeafd[_0x164eca];return _0x2ce562;};'use strict';var _=require(_0xdeaf('0x0'));var util=require(_0xdeaf('0x1'));var logger=require(_0xdeaf('0x2'))(_0xdeaf('0x3'));var moment=require(_0xdeaf('0x4'));var BPromise=require(_0xdeaf('0x5'));var rp=require(_0xdeaf('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdeaf('0x7'));var config=require(_0xdeaf('0x8'));var attributes=require(_0xdeaf('0x9'));module[_0xdeaf('0xa')]=function(_0x306d7f,_0x5cb9a7){return _0x306d7f[_0xdeaf('0xb')](_0xdeaf('0xc'),attributes,{'tableName':_0xdeaf('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb5e=['api','request-promise','rimraf','exports','WhatsappAccount','whatsapp_accounts','lodash','../../config/logger'];(function(_0x379f44,_0x30198e){var _0x381ab4=function(_0x1a979a){while(--_0x1a979a){_0x379f44['push'](_0x379f44['shift']());}};_0x381ab4(++_0x30198e);}(_0xeb5e,0x1ce));var _0xeeb5=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xeb5e[_0x92c450];return _0x2a9599;};'use strict';var _=require(_0xeeb5('0x0'));var util=require('util');var logger=require(_0xeeb5('0x1'))(_0xeeb5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xeeb5('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeeb5('0x4'));var config=require('../../config/environment');var attributes=require('./whatsappAccount.attributes');module[_0xeeb5('0x5')]=function(_0x281407,_0x575035){return _0x281407['define'](_0xeeb5('0x6'),attributes,{'tableName':_0xeeb5('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index af19657..9ff90b3 100644 --- a/server/api/whatsappAccount/whatsappAccount.rpc.js +++ b/server/api/whatsappAccount/whatsappAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x30ad=['WhatsappAccount','find','options','raw','attributes','include','map','model','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','request','then','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent','result','catch','ShowWhatsappAccount'];(function(_0xa49ef2,_0x47fdca){var _0x2b08ed=function(_0x3c55a5){while(--_0x3c55a5){_0xa49ef2['push'](_0xa49ef2['shift']());}};_0x2b08ed(++_0x47fdca);}(_0x30ad,0xb7));var _0xd30a=function(_0x385c7d,_0xf94b65){_0x385c7d=_0x385c7d-0x0;var _0x130fa4=_0x30ad[_0x385c7d];return _0x130fa4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd30a('0x0'));var BPromise=require(_0xd30a('0x1'));var rs=require(_0xd30a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd30a('0x3'))['db'];var utils=require(_0xd30a('0x4'));var logger=require('../../config/logger')(_0xd30a('0x5'));var config=require(_0xd30a('0x6'));var jayson=require(_0xd30a('0x7'));var client=jayson[_0xd30a('0x8')][_0xd30a('0x9')]({'port':0x232a});config['redis']=_[_0xd30a('0xa')](config[_0xd30a('0xb')],{'host':_0xd30a('0xc'),'port':0x18eb});var socket=require(_0xd30a('0xd'))(new Redis(config['redis']));require('./whatsappAccount.socket')['register'](socket);function respondWithRpcPromise(_0x1e6d5c,_0x518156,_0x5817b6){return new BPromise(function(_0x412d90,_0x994ddd){return client[_0xd30a('0xe')](_0x1e6d5c,_0x5817b6)[_0xd30a('0xf')](function(_0x2a7102){logger['info'](_0xd30a('0x10'),_0x518156,'request\x20sent');logger[_0xd30a('0x11')](_0xd30a('0x12'),_0x518156,'request\x20sent',JSON['stringify'](_0x2a7102));if(_0x2a7102[_0xd30a('0x13')]){if(_0x2a7102['error'][_0xd30a('0x14')]===0x1f4){logger[_0xd30a('0x13')](_0xd30a('0x10'),_0x518156,_0x2a7102[_0xd30a('0x13')][_0xd30a('0x15')]);return _0x994ddd(_0x2a7102[_0xd30a('0x13')]['message']);}logger[_0xd30a('0x13')](_0xd30a('0x10'),_0x518156,_0x2a7102['error'][_0xd30a('0x15')]);return _0x412d90(_0x2a7102[_0xd30a('0x13')]['message']);}else{logger[_0xd30a('0x16')](_0xd30a('0x10'),_0x518156,_0xd30a('0x17'));_0x412d90(_0x2a7102[_0xd30a('0x18')][_0xd30a('0x15')]);}})[_0xd30a('0x19')](function(_0x365568){logger[_0xd30a('0x13')](_0xd30a('0x10'),_0x518156,_0x365568);_0x994ddd(_0x365568);});});}exports[_0xd30a('0x1a')]=function(_0x241e7c){var _0x96208d=this;return new Promise(function(_0x2870c2,_0x491a35){return db[_0xd30a('0x1b')][_0xd30a('0x1c')]({'raw':_0x241e7c[_0xd30a('0x1d')]?_0x241e7c[_0xd30a('0x1d')][_0xd30a('0x1e')]===undefined?!![]:![]:!![],'where':_0x241e7c[_0xd30a('0x1d')]?_0x241e7c['options']['where']||null:null,'attributes':_0x241e7c[_0xd30a('0x1d')]?_0x241e7c[_0xd30a('0x1d')][_0xd30a('0x1f')]||null:null,'include':_0x241e7c[_0xd30a('0x1d')]?_0x241e7c[_0xd30a('0x1d')][_0xd30a('0x20')]?_[_0xd30a('0x21')](_0x241e7c[_0xd30a('0x1d')]['include'],function(_0x4bf30b){return{'model':db[_0x4bf30b[_0xd30a('0x22')]],'as':_0x4bf30b['as'],'attributes':_0x4bf30b[_0xd30a('0x1f')],'include':_0x4bf30b[_0xd30a('0x20')]?_[_0xd30a('0x21')](_0x4bf30b[_0xd30a('0x20')],function(_0x9110e2){return{'model':db[_0x9110e2[_0xd30a('0x22')]],'as':_0x9110e2['as'],'attributes':_0x9110e2[_0xd30a('0x1f')],'include':_0x9110e2[_0xd30a('0x20')]?_[_0xd30a('0x21')](_0x9110e2[_0xd30a('0x20')],function(_0x13bf7a){return{'model':db[_0x13bf7a['model']],'as':_0x13bf7a['as'],'attributes':_0x13bf7a[_0xd30a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd30a('0xf')](function(_0x2a86fe){logger[_0xd30a('0x16')](_0xd30a('0x1a'),_0x241e7c);logger[_0xd30a('0x11')](_0xd30a('0x1a'),_0x241e7c,JSON['stringify'](_0x2a86fe));_0x2870c2(_0x2a86fe);})['catch'](function(_0x3eb367){logger[_0xd30a('0x13')]('ShowWhatsappAccount',_0x3eb367[_0xd30a('0x15')],_0x241e7c);_0x491a35(_0x96208d['error'](0x1f4,_0x3eb367['message']));});});}; \ No newline at end of file +var _0x2abb=['options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowWhatsappAccount','WhatsappAccount','find'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x2abb,0x7f));var _0xb2ab=function(_0x4d8a60,_0x3588b0){_0x4d8a60=_0x4d8a60-0x0;var _0x39b5e3=_0x2abb[_0x4d8a60];return _0x39b5e3;};'use strict';var _=require(_0xb2ab('0x0'));var util=require(_0xb2ab('0x1'));var moment=require(_0xb2ab('0x2'));var BPromise=require(_0xb2ab('0x3'));var rs=require(_0xb2ab('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb2ab('0x5'))['db'];var utils=require(_0xb2ab('0x6'));var logger=require(_0xb2ab('0x7'))(_0xb2ab('0x8'));var config=require('../../config/environment');var jayson=require(_0xb2ab('0x9'));var client=jayson[_0xb2ab('0xa')][_0xb2ab('0xb')]({'port':0x232a});config[_0xb2ab('0xc')]=_[_0xb2ab('0xd')](config[_0xb2ab('0xc')],{'host':_0xb2ab('0xe'),'port':0x18eb});var socket=require(_0xb2ab('0xf'))(new Redis(config[_0xb2ab('0xc')]));require(_0xb2ab('0x10'))[_0xb2ab('0x11')](socket);function respondWithRpcPromise(_0x1f94a2,_0x59f692,_0x520992){return new BPromise(function(_0x1ce68a,_0x32e5a6){return client[_0xb2ab('0x12')](_0x1f94a2,_0x520992)[_0xb2ab('0x13')](function(_0x31ef6e){logger[_0xb2ab('0x14')](_0xb2ab('0x15'),_0x59f692,_0xb2ab('0x16'));logger[_0xb2ab('0x17')](_0xb2ab('0x18'),_0x59f692,_0xb2ab('0x16'),JSON[_0xb2ab('0x19')](_0x31ef6e));if(_0x31ef6e[_0xb2ab('0x1a')]){if(_0x31ef6e[_0xb2ab('0x1a')][_0xb2ab('0x1b')]===0x1f4){logger[_0xb2ab('0x1a')](_0xb2ab('0x15'),_0x59f692,_0x31ef6e[_0xb2ab('0x1a')][_0xb2ab('0x1c')]);return _0x32e5a6(_0x31ef6e['error']['message']);}logger['error'](_0xb2ab('0x15'),_0x59f692,_0x31ef6e[_0xb2ab('0x1a')][_0xb2ab('0x1c')]);return _0x1ce68a(_0x31ef6e[_0xb2ab('0x1a')][_0xb2ab('0x1c')]);}else{logger[_0xb2ab('0x14')]('WhatsappAccount,\x20%s,\x20%s',_0x59f692,_0xb2ab('0x16'));_0x1ce68a(_0x31ef6e['result'][_0xb2ab('0x1c')]);}})[_0xb2ab('0x1d')](function(_0x52edf3){logger[_0xb2ab('0x1a')](_0xb2ab('0x15'),_0x59f692,_0x52edf3);_0x32e5a6(_0x52edf3);});});}exports[_0xb2ab('0x1e')]=function(_0x3a05a1){var _0x56be56=this;return new Promise(function(_0x98a936,_0x94570){return db[_0xb2ab('0x1f')][_0xb2ab('0x20')]({'raw':_0x3a05a1['options']?_0x3a05a1[_0xb2ab('0x21')][_0xb2ab('0x22')]===undefined?!![]:![]:!![],'where':_0x3a05a1[_0xb2ab('0x21')]?_0x3a05a1[_0xb2ab('0x21')][_0xb2ab('0x23')]||null:null,'attributes':_0x3a05a1[_0xb2ab('0x21')]?_0x3a05a1['options'][_0xb2ab('0x24')]||null:null,'include':_0x3a05a1[_0xb2ab('0x21')]?_0x3a05a1[_0xb2ab('0x21')][_0xb2ab('0x25')]?_[_0xb2ab('0x26')](_0x3a05a1['options'][_0xb2ab('0x25')],function(_0x44bda2){return{'model':db[_0x44bda2[_0xb2ab('0x27')]],'as':_0x44bda2['as'],'attributes':_0x44bda2[_0xb2ab('0x24')],'include':_0x44bda2[_0xb2ab('0x25')]?_[_0xb2ab('0x26')](_0x44bda2['include'],function(_0xdd2cd7){return{'model':db[_0xdd2cd7['model']],'as':_0xdd2cd7['as'],'attributes':_0xdd2cd7[_0xb2ab('0x24')],'include':_0xdd2cd7[_0xb2ab('0x25')]?_[_0xb2ab('0x26')](_0xdd2cd7[_0xb2ab('0x25')],function(_0x23247c){return{'model':db[_0x23247c[_0xb2ab('0x27')]],'as':_0x23247c['as'],'attributes':_0x23247c[_0xb2ab('0x24')]};}):[]};}):[]};}):[]:[]})[_0xb2ab('0x13')](function(_0x3d11f2){logger['info'](_0xb2ab('0x1e'),_0x3a05a1);logger[_0xb2ab('0x17')](_0xb2ab('0x1e'),_0x3a05a1,JSON['stringify'](_0x3d11f2));_0x98a936(_0x3d11f2);})[_0xb2ab('0x1d')](function(_0x187925){logger[_0xb2ab('0x1a')](_0xb2ab('0x1e'),_0x187925['message'],_0x3a05a1);_0x94570(_0x56be56[_0xb2ab('0x1a')](0x1f4,_0x187925['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index df3c48e..4a1661b 100644 --- a/server/api/whatsappAccount/whatsappAccount.socket.js +++ b/server/api/whatsappAccount/whatsappAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe61f=['emit','removeListener','register','length','whatsappAccount:','./whatsappAccount.events','save','update'];(function(_0x35b7d4,_0x5a5c43){var _0x4e8cee=function(_0x66859c){while(--_0x66859c){_0x35b7d4['push'](_0x35b7d4['shift']());}};_0x4e8cee(++_0x5a5c43);}(_0xe61f,0x85));var _0xfe61=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe61f[_0x321bb2];return _0x9c12ed;};'use strict';var WhatsappAccountEvents=require(_0xfe61('0x0'));var events=[_0xfe61('0x1'),'remove',_0xfe61('0x2')];function createListener(_0x1f6de4,_0x26d7d0){return function(_0x21fbe0){_0x26d7d0[_0xfe61('0x3')](_0x1f6de4,_0x21fbe0);};}function removeListener(_0xa1e0d3,_0x3f6e9d){return function(){WhatsappAccountEvents[_0xfe61('0x4')](_0xa1e0d3,_0x3f6e9d);};}exports[_0xfe61('0x5')]=function(_0x2f97a6){for(var _0x1442b1=0x0,_0x4bac7f=events[_0xfe61('0x6')];_0x1442b1<_0x4bac7f;_0x1442b1++){var _0x1dd9bd=events[_0x1442b1];var _0x3ce5b6=createListener(_0xfe61('0x7')+_0x1dd9bd,_0x2f97a6);WhatsappAccountEvents['on'](_0x1dd9bd,_0x3ce5b6);}}; \ No newline at end of file +var _0x60bf=['removeListener','register','length','./whatsappAccount.events','remove','update','emit'];(function(_0x25ff4a,_0x423dd3){var _0x5a689b=function(_0x5b6f90){while(--_0x5b6f90){_0x25ff4a['push'](_0x25ff4a['shift']());}};_0x5a689b(++_0x423dd3);}(_0x60bf,0xc0));var _0xf60b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x60bf[_0xa464c9];return _0x3d73c4;};'use strict';var WhatsappAccountEvents=require(_0xf60b('0x0'));var events=['save',_0xf60b('0x1'),_0xf60b('0x2')];function createListener(_0x562717,_0x2a116a){return function(_0x244086){_0x2a116a[_0xf60b('0x3')](_0x562717,_0x244086);};}function removeListener(_0x530c44,_0x24b253){return function(){WhatsappAccountEvents[_0xf60b('0x4')](_0x530c44,_0x24b253);};}exports[_0xf60b('0x5')]=function(_0x40c48f){for(var _0x16e471=0x0,_0x39aa3a=events[_0xf60b('0x6')];_0x16e471<_0x39aa3a;_0x16e471++){var _0x189561=events[_0x16e471];var _0x30f8e1=createListener('whatsappAccount:'+_0x189561,_0x40c48f);WhatsappAccountEvents['on'](_0x189561,_0x30f8e1);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 57407ec..65bddcd 100644 --- a/server/api/whatsappApplication/index.js +++ b/server/api/whatsappApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9104=['create','put','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappApplication.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x3d29a1,_0x38307f){var _0x459919=function(_0x21be1d){while(--_0x21be1d){_0x3d29a1['push'](_0x3d29a1['shift']());}};_0x459919(++_0x38307f);}(_0x9104,0xfb));var _0x4910=function(_0x96fcb9,_0x2bd5f1){_0x96fcb9=_0x96fcb9-0x0;var _0x137c13=_0x9104[_0x96fcb9];return _0x137c13;};'use strict';var multer=require(_0x4910('0x0'));var util=require(_0x4910('0x1'));var path=require(_0x4910('0x2'));var timeout=require(_0x4910('0x3'));var express=require('express');var router=express[_0x4910('0x4')]();var fs_extra=require(_0x4910('0x5'));var auth=require(_0x4910('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4910('0x7'));var controller=require(_0x4910('0x8'));router['get']('/',auth[_0x4910('0x9')](),controller[_0x4910('0xa')]);router[_0x4910('0xb')](_0x4910('0xc'),auth[_0x4910('0x9')](),controller[_0x4910('0xd')]);router[_0x4910('0xe')]('/',auth[_0x4910('0x9')](),controller[_0x4910('0xf')]);router[_0x4910('0x10')]('/:id',auth[_0x4910('0x9')](),controller[_0x4910('0x11')]);router[_0x4910('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9ad9=['/:id','show','create','destroy','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x5f0c8c,_0x1f9ee0){var _0xbe7ad3=function(_0x2366e6){while(--_0x2366e6){_0x5f0c8c['push'](_0x5f0c8c['shift']());}};_0xbe7ad3(++_0x1f9ee0);}(_0x9ad9,0x1f2));var _0x99ad=function(_0x430a54,_0x1912b){_0x430a54=_0x430a54-0x0;var _0x50e04f=_0x9ad9[_0x430a54];return _0x50e04f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x99ad('0x0'));var express=require(_0x99ad('0x1'));var router=express[_0x99ad('0x2')]();var fs_extra=require(_0x99ad('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x99ad('0x4'));var config=require(_0x99ad('0x5'));var controller=require('./whatsappApplication.controller');router[_0x99ad('0x6')]('/',auth[_0x99ad('0x7')](),controller[_0x99ad('0x8')]);router[_0x99ad('0x6')](_0x99ad('0x9'),auth[_0x99ad('0x7')](),controller[_0x99ad('0xa')]);router['post']('/',auth[_0x99ad('0x7')](),controller[_0x99ad('0xb')]);router['put'](_0x99ad('0x9'),auth[_0x99ad('0x7')](),controller['update']);router['delete'](_0x99ad('0x9'),auth[_0x99ad('0x7')](),controller[_0x99ad('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index d4b8a45..d0506e2 100644 --- a/server/api/whatsappApplication/whatsappApplication.attributes.js +++ b/server/api/whatsappApplication/whatsappApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xec2c=['INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x5670f4,_0x2c2c31){var _0x2afcf1=function(_0x279fe4){while(--_0x279fe4){_0x5670f4['push'](_0x5670f4['shift']());}};_0x2afcf1(++_0x2c2c31);}(_0xec2c,0xa0));var _0xcec2=function(_0x44fef1,_0x132cf4){_0x44fef1=_0x44fef1-0x0;var _0x3c3a04=_0xec2c[_0x44fef1];return _0x3c3a04;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xcec2('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xcec2('0x1')],'allowNull':![],'defaultValue':_0xcec2('0x2')},'appdata':{'type':Sequelize[_0xcec2('0x3')]()},'description':{'type':Sequelize[_0xcec2('0x1')]},'interval':{'type':Sequelize[_0xcec2('0x1')],'defaultValue':_0xcec2('0x4')}}; \ No newline at end of file +var _0x87fd=['noop','*,*,*,*','sequelize','exports','STRING'];(function(_0x325ba9,_0x3ddbe6){var _0x31457b=function(_0x15b374){while(--_0x15b374){_0x325ba9['push'](_0x325ba9['shift']());}};_0x31457b(++_0x3ddbe6);}(_0x87fd,0x89));var _0xd87f=function(_0x207416,_0x1ea882){_0x207416=_0x207416-0x0;var _0xbcc5a9=_0x87fd[_0x207416];return _0xbcc5a9;};'use strict';var Sequelize=require(_0xd87f('0x0'));module[_0xd87f('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xd87f('0x2')],'allowNull':![],'defaultValue':_0xd87f('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xd87f('0x2')],'defaultValue':_0xd87f('0x4')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 62bd0a1..0080e59 100644 --- a/server/api/whatsappApplication/whatsappApplication.controller.js +++ b/server/api/whatsappApplication/whatsappApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00f0=['intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','include','rows','catch','show','params','includeAll','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','end','offset','undefined','limit','count','set','json','apply','reject','then','destroy','sendStatus','error','stack','name','send','WhatsappApplication','rawAttributes','fieldName','type','model','map','query','keys','filters'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x00f0,0xec));var _0x000f=function(_0x286c79,_0xd2f120){_0x286c79=_0x286c79-0x0;var _0x59573e=_0x00f0[_0x286c79];return _0x59573e;};'use strict';var emlformat=require(_0x000f('0x0'));var rimraf=require(_0x000f('0x1'));var zipdir=require(_0x000f('0x2'));var jsonpatch=require(_0x000f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x000f('0x4'));var Mustache=require('mustache');var util=require(_0x000f('0x5'));var path=require('path');var sox=require(_0x000f('0x6'));var csv=require(_0x000f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x000f('0x8'));var _=require(_0x000f('0x9'));var squel=require(_0x000f('0xa'));var crypto=require(_0x000f('0xb'));var jsforce=require(_0x000f('0xc'));var deskjs=require(_0x000f('0xd'));var toCsv=require(_0x000f('0x7'));var querystring=require(_0x000f('0xe'));var Papa=require(_0x000f('0xf'));var Redis=require(_0x000f('0x10'));var authService=require(_0x000f('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x000f('0x12'));var logger=require(_0x000f('0x13'))('api');var utils=require(_0x000f('0x14'));var config=require(_0x000f('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11f9c2,_0x442695){_0x442695=_0x442695||0xcc;return function(_0x5ddeb0){if(_0x5ddeb0){return _0x11f9c2['sendStatus'](_0x442695);}return _0x11f9c2[_0x000f('0x16')](_0x442695)[_0x000f('0x17')]();};}function respondWithResult(_0x3f29cc,_0x2f1002){_0x2f1002=_0x2f1002||0xc8;return function(_0x4a7ed8){if(_0x4a7ed8){return _0x3f29cc[_0x000f('0x16')](_0x2f1002)['json'](_0x4a7ed8);}};}function respondWithFilteredResult(_0x4a6f6d,_0x3a9e55){return function(_0x4d2b59){if(_0x4d2b59){var _0x1870b3=typeof _0x3a9e55[_0x000f('0x18')]===_0x000f('0x19')&&typeof _0x3a9e55[_0x000f('0x1a')]===_0x000f('0x19');var _0x1fb6e9=_0x4d2b59[_0x000f('0x1b')];var _0x86ac21=_0x1870b3?0x0:_0x3a9e55[_0x000f('0x18')];var _0x1e396b=_0x1870b3?_0x4d2b59[_0x000f('0x1b')]:_0x3a9e55[_0x000f('0x18')]+_0x3a9e55[_0x000f('0x1a')];var _0x4f0d93;if(_0x1e396b>=_0x1fb6e9){_0x1e396b=_0x1fb6e9;_0x4f0d93=0xc8;}else{_0x4f0d93=0xce;}_0x4a6f6d[_0x000f('0x16')](_0x4f0d93);return _0x4a6f6d[_0x000f('0x1c')]('Content-Range',_0x86ac21+'-'+_0x1e396b+'/'+_0x1fb6e9)[_0x000f('0x1d')](_0x4d2b59);}return null;};}function patchUpdates(_0x51e8c7){return function(_0x4d9752){try{jsonpatch[_0x000f('0x1e')](_0x4d9752,_0x51e8c7,!![]);}catch(_0x1b1ad9){return BPromise[_0x000f('0x1f')](_0x1b1ad9);}return _0x4d9752['save']();};}function saveUpdates(_0x53046d,_0x3b3b20){return function(_0x860334){if(_0x860334){return _0x860334['update'](_0x53046d)[_0x000f('0x20')](function(_0x5ae592){return _0x5ae592;});}return null;};}function removeEntity(_0x3c793c,_0x548751){return function(_0x2a0ce4){if(_0x2a0ce4){return _0x2a0ce4[_0x000f('0x21')]()[_0x000f('0x20')](function(){_0x3c793c[_0x000f('0x16')](0xcc)[_0x000f('0x17')]();});}};}function handleEntityNotFound(_0x2b2b22,_0x5ed9ec){return function(_0x461d33){if(!_0x461d33){_0x2b2b22[_0x000f('0x22')](0x194);}return _0x461d33;};}function handleError(_0x6a6401,_0x55d962){_0x55d962=_0x55d962||0x1f4;return function(_0x12578c){logger[_0x000f('0x23')](_0x12578c[_0x000f('0x24')]);if(_0x12578c[_0x000f('0x25')]){delete _0x12578c[_0x000f('0x25')];}_0x6a6401[_0x000f('0x16')](_0x55d962)[_0x000f('0x26')](_0x12578c);};}exports['index']=function(_0x11c2a2,_0x3dfe25){var _0x42e13f={},_0x43e318={},_0x49ac76={'count':0x0,'rows':[]};var _0x8bc0ff=_['map'](db[_0x000f('0x27')][_0x000f('0x28')],function(_0x3cd2c2){return{'name':_0x3cd2c2[_0x000f('0x29')],'type':_0x3cd2c2[_0x000f('0x2a')]['key']};});_0x43e318[_0x000f('0x2b')]=_[_0x000f('0x2c')](_0x8bc0ff,'name');_0x43e318[_0x000f('0x2d')]=_[_0x000f('0x2e')](_0x11c2a2[_0x000f('0x2d')]);_0x43e318[_0x000f('0x2f')]=_[_0x000f('0x30')](_0x43e318[_0x000f('0x2b')],_0x43e318[_0x000f('0x2d')]);_0x42e13f[_0x000f('0x31')]=_['intersection'](_0x43e318[_0x000f('0x2b')],qs['fields'](_0x11c2a2['query'][_0x000f('0x32')]));_0x42e13f[_0x000f('0x31')]=_0x42e13f[_0x000f('0x31')][_0x000f('0x33')]?_0x42e13f[_0x000f('0x31')]:_0x43e318[_0x000f('0x2b')];if(!_0x11c2a2['query'][_0x000f('0x34')]('nolimit')){_0x42e13f['limit']=qs[_0x000f('0x1a')](_0x11c2a2[_0x000f('0x2d')]['limit']);_0x42e13f['offset']=qs[_0x000f('0x18')](_0x11c2a2['query']['offset']);}_0x42e13f[_0x000f('0x35')]=qs[_0x000f('0x36')](_0x11c2a2[_0x000f('0x2d')]['sort']);_0x42e13f['where']=qs[_0x000f('0x2f')](_[_0x000f('0x37')](_0x11c2a2[_0x000f('0x2d')],_0x43e318[_0x000f('0x2f')]),_0x8bc0ff);if(_0x11c2a2['query']['filter']){_0x42e13f[_0x000f('0x38')]=_[_0x000f('0x39')](_0x42e13f['where'],{'$or':_['map'](_0x8bc0ff,function(_0x2e02fb){if(_0x2e02fb[_0x000f('0x2a')]!==_0x000f('0x3a')){var _0x54c56c={};_0x54c56c[_0x2e02fb['name']]={'$like':'%'+_0x11c2a2['query'][_0x000f('0x3b')]+'%'};return _0x54c56c;}})});}_0x42e13f=_['merge']({},_0x42e13f,_0x11c2a2[_0x000f('0x3c')]);var _0x275904={'where':_0x42e13f[_0x000f('0x38')]};return db[_0x000f('0x27')][_0x000f('0x1b')](_0x275904)['then'](function(_0x5d0d6a){_0x49ac76[_0x000f('0x1b')]=_0x5d0d6a;if(_0x11c2a2[_0x000f('0x2d')]['includeAll']){_0x42e13f[_0x000f('0x3d')]=[{'all':!![]}];}return db['WhatsappApplication']['findAll'](_0x42e13f);})['then'](function(_0x729d24){_0x49ac76[_0x000f('0x3e')]=_0x729d24;return _0x49ac76;})[_0x000f('0x20')](respondWithFilteredResult(_0x3dfe25,_0x42e13f))[_0x000f('0x3f')](handleError(_0x3dfe25,null));};exports[_0x000f('0x40')]=function(_0x888afb,_0x2c82ef){var _0x4c5d38={'raw':!![],'where':{'id':_0x888afb[_0x000f('0x41')]['id']}},_0x52b393={};_0x52b393['model']=_[_0x000f('0x2e')](db[_0x000f('0x27')][_0x000f('0x28')]);_0x52b393['query']=_[_0x000f('0x2e')](_0x888afb['query']);_0x52b393[_0x000f('0x2f')]=_[_0x000f('0x30')](_0x52b393[_0x000f('0x2b')],_0x52b393['query']);_0x4c5d38[_0x000f('0x31')]=_[_0x000f('0x30')](_0x52b393['model'],qs[_0x000f('0x32')](_0x888afb[_0x000f('0x2d')][_0x000f('0x32')]));_0x4c5d38[_0x000f('0x31')]=_0x4c5d38[_0x000f('0x31')][_0x000f('0x33')]?_0x4c5d38[_0x000f('0x31')]:_0x52b393['model'];if(_0x888afb['query'][_0x000f('0x42')]){_0x4c5d38[_0x000f('0x3d')]=[{'all':!![]}];}_0x4c5d38=_[_0x000f('0x39')]({},_0x4c5d38,_0x888afb[_0x000f('0x3c')]);return db[_0x000f('0x27')][_0x000f('0x43')](_0x4c5d38)[_0x000f('0x20')](handleEntityNotFound(_0x2c82ef,null))[_0x000f('0x20')](respondWithResult(_0x2c82ef,null))[_0x000f('0x3f')](handleError(_0x2c82ef,null));};exports[_0x000f('0x44')]=function(_0x9952c3,_0x2a8e7f){return db[_0x000f('0x27')][_0x000f('0x44')](_0x9952c3[_0x000f('0x45')],{})[_0x000f('0x20')](respondWithResult(_0x2a8e7f,0xc9))[_0x000f('0x3f')](handleError(_0x2a8e7f,null));};exports[_0x000f('0x46')]=function(_0x2d3700,_0x5257de){if(_0x2d3700[_0x000f('0x45')]['id']){delete _0x2d3700[_0x000f('0x45')]['id'];}return db[_0x000f('0x27')][_0x000f('0x43')]({'where':{'id':_0x2d3700[_0x000f('0x41')]['id']}})[_0x000f('0x20')](handleEntityNotFound(_0x5257de,null))['then'](saveUpdates(_0x2d3700['body'],null))[_0x000f('0x20')](respondWithResult(_0x5257de,null))[_0x000f('0x3f')](handleError(_0x5257de,null));};exports[_0x000f('0x21')]=function(_0x53467d,_0x1331c3){return db[_0x000f('0x27')][_0x000f('0x43')]({'where':{'id':_0x53467d[_0x000f('0x41')]['id']}})[_0x000f('0x20')](handleEntityNotFound(_0x1331c3,null))['then'](removeEntity(_0x1331c3,null))[_0x000f('0x3f')](handleError(_0x1331c3,null));}; \ No newline at end of file +var _0x0b78=['WhatsappApplication','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','include','rows','catch','show','params','keys','find','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index'];(function(_0x1bd78f,_0x375e67){var _0x49b5eb=function(_0x4ef8bb){while(--_0x4ef8bb){_0x1bd78f['push'](_0x1bd78f['shift']());}};_0x49b5eb(++_0x375e67);}(_0x0b78,0x1d6));var _0x80b7=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x0b78[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x80b7('0x0'));var zipdir=require(_0x80b7('0x1'));var jsonpatch=require(_0x80b7('0x2'));var rp=require('request-promise');var moment=require(_0x80b7('0x3'));var BPromise=require(_0x80b7('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x80b7('0x5'));var csv=require(_0x80b7('0x6'));var ejs=require(_0x80b7('0x7'));var fs=require('fs');var fs_extra=require(_0x80b7('0x8'));var _=require(_0x80b7('0x9'));var squel=require(_0x80b7('0xa'));var crypto=require('crypto');var jsforce=require(_0x80b7('0xb'));var deskjs=require(_0x80b7('0xc'));var toCsv=require(_0x80b7('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x80b7('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x80b7('0xe'));var as=require(_0x80b7('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x80b7('0x10'))(_0x80b7('0x11'));var utils=require(_0x80b7('0x12'));var config=require(_0x80b7('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ac007,_0x1bbe9f){_0x1bbe9f=_0x1bbe9f||0xcc;return function(_0x16976c){if(_0x16976c){return _0x3ac007[_0x80b7('0x14')](_0x1bbe9f);}return _0x3ac007[_0x80b7('0x15')](_0x1bbe9f)[_0x80b7('0x16')]();};}function respondWithResult(_0x3d71a0,_0x32cecc){_0x32cecc=_0x32cecc||0xc8;return function(_0x416d32){if(_0x416d32){return _0x3d71a0['status'](_0x32cecc)['json'](_0x416d32);}};}function respondWithFilteredResult(_0x5c64df,_0x57e428){return function(_0x2c6bff){if(_0x2c6bff){var _0x459f67=typeof _0x57e428[_0x80b7('0x17')]===_0x80b7('0x18')&&typeof _0x57e428[_0x80b7('0x19')]===_0x80b7('0x18');var _0x262cd5=_0x2c6bff[_0x80b7('0x1a')];var _0x22abaa=_0x459f67?0x0:_0x57e428[_0x80b7('0x17')];var _0x25b5e9=_0x459f67?_0x2c6bff[_0x80b7('0x1a')]:_0x57e428[_0x80b7('0x17')]+_0x57e428['limit'];var _0x2165df;if(_0x25b5e9>=_0x262cd5){_0x25b5e9=_0x262cd5;_0x2165df=0xc8;}else{_0x2165df=0xce;}_0x5c64df[_0x80b7('0x15')](_0x2165df);return _0x5c64df[_0x80b7('0x1b')](_0x80b7('0x1c'),_0x22abaa+'-'+_0x25b5e9+'/'+_0x262cd5)[_0x80b7('0x1d')](_0x2c6bff);}return null;};}function patchUpdates(_0x3ebdd6){return function(_0x220133){try{jsonpatch[_0x80b7('0x1e')](_0x220133,_0x3ebdd6,!![]);}catch(_0x3da240){return BPromise[_0x80b7('0x1f')](_0x3da240);}return _0x220133[_0x80b7('0x20')]();};}function saveUpdates(_0x1ef249,_0x53046f){return function(_0x55bf6e){if(_0x55bf6e){return _0x55bf6e[_0x80b7('0x21')](_0x1ef249)[_0x80b7('0x22')](function(_0x158b65){return _0x158b65;});}return null;};}function removeEntity(_0x5e8093,_0x9fccdc){return function(_0x390d8a){if(_0x390d8a){return _0x390d8a[_0x80b7('0x23')]()[_0x80b7('0x22')](function(){_0x5e8093[_0x80b7('0x15')](0xcc)[_0x80b7('0x16')]();});}};}function handleEntityNotFound(_0x44ab49,_0xea1ea0){return function(_0x23a876){if(!_0x23a876){_0x44ab49[_0x80b7('0x14')](0x194);}return _0x23a876;};}function handleError(_0x1221c7,_0x4cb8c9){_0x4cb8c9=_0x4cb8c9||0x1f4;return function(_0x328c15){logger[_0x80b7('0x24')](_0x328c15[_0x80b7('0x25')]);if(_0x328c15[_0x80b7('0x26')]){delete _0x328c15[_0x80b7('0x26')];}_0x1221c7[_0x80b7('0x15')](_0x4cb8c9)[_0x80b7('0x27')](_0x328c15);};}exports[_0x80b7('0x28')]=function(_0x479335,_0x42e7a6){var _0x23958b={},_0x1dc2df={},_0x396144={'count':0x0,'rows':[]};var _0x46b76b=_['map'](db[_0x80b7('0x29')][_0x80b7('0x2a')],function(_0x2cc6f7){return{'name':_0x2cc6f7[_0x80b7('0x2b')],'type':_0x2cc6f7[_0x80b7('0x2c')][_0x80b7('0x2d')]};});_0x1dc2df[_0x80b7('0x2e')]=_['map'](_0x46b76b,_0x80b7('0x26'));_0x1dc2df[_0x80b7('0x2f')]=_['keys'](_0x479335[_0x80b7('0x2f')]);_0x1dc2df[_0x80b7('0x30')]=_[_0x80b7('0x31')](_0x1dc2df[_0x80b7('0x2e')],_0x1dc2df[_0x80b7('0x2f')]);_0x23958b[_0x80b7('0x32')]=_['intersection'](_0x1dc2df[_0x80b7('0x2e')],qs[_0x80b7('0x33')](_0x479335[_0x80b7('0x2f')]['fields']));_0x23958b[_0x80b7('0x32')]=_0x23958b[_0x80b7('0x32')][_0x80b7('0x34')]?_0x23958b['attributes']:_0x1dc2df[_0x80b7('0x2e')];if(!_0x479335[_0x80b7('0x2f')][_0x80b7('0x35')](_0x80b7('0x36'))){_0x23958b[_0x80b7('0x19')]=qs[_0x80b7('0x19')](_0x479335[_0x80b7('0x2f')][_0x80b7('0x19')]);_0x23958b['offset']=qs['offset'](_0x479335[_0x80b7('0x2f')][_0x80b7('0x17')]);}_0x23958b[_0x80b7('0x37')]=qs[_0x80b7('0x38')](_0x479335['query']['sort']);_0x23958b[_0x80b7('0x39')]=qs[_0x80b7('0x30')](_[_0x80b7('0x3a')](_0x479335[_0x80b7('0x2f')],_0x1dc2df['filters']),_0x46b76b);if(_0x479335[_0x80b7('0x2f')][_0x80b7('0x3b')]){_0x23958b['where']=_[_0x80b7('0x3c')](_0x23958b['where'],{'$or':_[_0x80b7('0x3d')](_0x46b76b,function(_0x490b91){if(_0x490b91['type']!==_0x80b7('0x3e')){var _0x76ffba={};_0x76ffba[_0x490b91[_0x80b7('0x26')]]={'$like':'%'+_0x479335[_0x80b7('0x2f')]['filter']+'%'};return _0x76ffba;}})});}_0x23958b=_['merge']({},_0x23958b,_0x479335[_0x80b7('0x3f')]);var _0x4f50ca={'where':_0x23958b[_0x80b7('0x39')]};return db[_0x80b7('0x29')]['count'](_0x4f50ca)['then'](function(_0x15fe0d){_0x396144[_0x80b7('0x1a')]=_0x15fe0d;if(_0x479335[_0x80b7('0x2f')]['includeAll']){_0x23958b[_0x80b7('0x40')]=[{'all':!![]}];}return db['WhatsappApplication']['findAll'](_0x23958b);})[_0x80b7('0x22')](function(_0x1b2fda){_0x396144[_0x80b7('0x41')]=_0x1b2fda;return _0x396144;})[_0x80b7('0x22')](respondWithFilteredResult(_0x42e7a6,_0x23958b))[_0x80b7('0x42')](handleError(_0x42e7a6,null));};exports[_0x80b7('0x43')]=function(_0xa12f05,_0x2070fc){var _0xa5d1bf={'raw':!![],'where':{'id':_0xa12f05[_0x80b7('0x44')]['id']}},_0x190d41={};_0x190d41[_0x80b7('0x2e')]=_['keys'](db[_0x80b7('0x29')][_0x80b7('0x2a')]);_0x190d41[_0x80b7('0x2f')]=_[_0x80b7('0x45')](_0xa12f05[_0x80b7('0x2f')]);_0x190d41[_0x80b7('0x30')]=_[_0x80b7('0x31')](_0x190d41[_0x80b7('0x2e')],_0x190d41[_0x80b7('0x2f')]);_0xa5d1bf[_0x80b7('0x32')]=_[_0x80b7('0x31')](_0x190d41['model'],qs[_0x80b7('0x33')](_0xa12f05['query'][_0x80b7('0x33')]));_0xa5d1bf[_0x80b7('0x32')]=_0xa5d1bf[_0x80b7('0x32')][_0x80b7('0x34')]?_0xa5d1bf['attributes']:_0x190d41[_0x80b7('0x2e')];if(_0xa12f05[_0x80b7('0x2f')]['includeAll']){_0xa5d1bf[_0x80b7('0x40')]=[{'all':!![]}];}_0xa5d1bf=_[_0x80b7('0x3c')]({},_0xa5d1bf,_0xa12f05['options']);return db[_0x80b7('0x29')][_0x80b7('0x46')](_0xa5d1bf)['then'](handleEntityNotFound(_0x2070fc,null))['then'](respondWithResult(_0x2070fc,null))[_0x80b7('0x42')](handleError(_0x2070fc,null));};exports[_0x80b7('0x47')]=function(_0xb75a61,_0x29bee7){return db[_0x80b7('0x29')][_0x80b7('0x47')](_0xb75a61[_0x80b7('0x48')],{})['then'](respondWithResult(_0x29bee7,0xc9))['catch'](handleError(_0x29bee7,null));};exports['update']=function(_0x599205,_0x52fd0b){if(_0x599205['body']['id']){delete _0x599205[_0x80b7('0x48')]['id'];}return db[_0x80b7('0x29')][_0x80b7('0x46')]({'where':{'id':_0x599205['params']['id']}})[_0x80b7('0x22')](handleEntityNotFound(_0x52fd0b,null))[_0x80b7('0x22')](saveUpdates(_0x599205[_0x80b7('0x48')],null))['then'](respondWithResult(_0x52fd0b,null))[_0x80b7('0x42')](handleError(_0x52fd0b,null));};exports['destroy']=function(_0x1e7536,_0x2a642e){return db[_0x80b7('0x29')]['find']({'where':{'id':_0x1e7536[_0x80b7('0x44')]['id']}})['then'](handleEntityNotFound(_0x2a642e,null))['then'](removeEntity(_0x2a642e,null))[_0x80b7('0x42')](handleError(_0x2a642e,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 0ae508a..e036248 100644 --- a/server/api/whatsappApplication/whatsappApplication.model.js +++ b/server/api/whatsappApplication/whatsappApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc43c=['rimraf','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xc43c,0x152));var _0xcc43=function(_0x4ebb33,_0xa340a4){_0x4ebb33=_0x4ebb33-0x0;var _0x370d08=_0xc43c[_0x4ebb33];return _0x370d08;};'use strict';var _=require(_0xcc43('0x0'));var util=require(_0xcc43('0x1'));var logger=require(_0xcc43('0x2'))(_0xcc43('0x3'));var moment=require(_0xcc43('0x4'));var BPromise=require(_0xcc43('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcc43('0x6'));var rimraf=require(_0xcc43('0x7'));var config=require('../../config/environment');var attributes=require(_0xcc43('0x8'));module[_0xcc43('0x9')]=function(_0x217a5e,_0x17d1a2){return _0x217a5e[_0xcc43('0xa')](_0xcc43('0xb'),attributes,{'tableName':_0xcc43('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcc43('0xd'),'collate':_0xcc43('0xe')});}; \ No newline at end of file +var _0x9b9b=['path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','util','moment','bluebird','request-promise'];(function(_0x43b95e,_0x19bc79){var _0x1ae40e=function(_0x294cc1){while(--_0x294cc1){_0x43b95e['push'](_0x43b95e['shift']());}};_0x1ae40e(++_0x19bc79);}(_0x9b9b,0x114));var _0xb9b9=function(_0x16af15,_0x55bc76){_0x16af15=_0x16af15-0x0;var _0xfeda8a=_0x9b9b[_0x16af15];return _0xfeda8a;};'use strict';var _=require('lodash');var util=require(_0xb9b9('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xb9b9('0x1'));var BPromise=require(_0xb9b9('0x2'));var rp=require(_0xb9b9('0x3'));var fs=require('fs');var path=require(_0xb9b9('0x4'));var rimraf=require(_0xb9b9('0x5'));var config=require(_0xb9b9('0x6'));var attributes=require(_0xb9b9('0x7'));module[_0xb9b9('0x8')]=function(_0x79dd,_0x3d1a95){return _0x79dd[_0xb9b9('0x9')](_0xb9b9('0xa'),attributes,{'tableName':_0xb9b9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb9b9('0xc'),'collate':_0xb9b9('0xd')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 77561b2..260b594 100644 --- a/server/api/whatsappApplication/whatsappApplication.rpc.js +++ b/server/api/whatsappApplication/whatsappApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d0e=['info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then'];(function(_0x1aea6f,_0x2ca010){var _0x5adb18=function(_0x40cf67){while(--_0x40cf67){_0x1aea6f['push'](_0x1aea6f['shift']());}};_0x5adb18(++_0x2ca010);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x345a26,_0x1561a5){_0x345a26=_0x345a26-0x0;var _0x44ad49=_0x8d0e[_0x345a26];return _0x44ad49;};'use strict';var _=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var moment=require(_0xe8d0('0x2'));var BPromise=require(_0xe8d0('0x3'));var rs=require(_0xe8d0('0x4'));var fs=require('fs');var Redis=require(_0xe8d0('0x5'));var db=require(_0xe8d0('0x6'))['db'];var utils=require(_0xe8d0('0x7'));var logger=require(_0xe8d0('0x8'))('rpc');var config=require(_0xe8d0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe8d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x92483d,_0x469d37,_0xcc03d0){return new BPromise(function(_0x2b6dce,_0x13aa63){return client[_0xe8d0('0xb')](_0x92483d,_0xcc03d0)[_0xe8d0('0xc')](function(_0x5605a0){logger[_0xe8d0('0xd')](_0xe8d0('0xe'),_0x469d37,_0xe8d0('0xf'));logger['debug']('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x469d37,_0xe8d0('0xf'),JSON[_0xe8d0('0x10')](_0x5605a0));if(_0x5605a0[_0xe8d0('0x11')]){if(_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x12')]===0x1f4){logger[_0xe8d0('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x469d37,_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);return _0x13aa63(_0x5605a0['error'][_0xe8d0('0x13')]);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x469d37,_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);return _0x2b6dce(_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);}else{logger[_0xe8d0('0xd')](_0xe8d0('0xe'),_0x469d37,'request\x20sent');_0x2b6dce(_0x5605a0[_0xe8d0('0x14')]['message']);}})[_0xe8d0('0x15')](function(_0x3c526c){logger[_0xe8d0('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x469d37,_0x3c526c);_0x13aa63(_0x3c526c);});});} \ No newline at end of file +var _0x5636=['code','WhatsappApplication,\x20%s,\x20%s','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','error'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5636,0x102));var _0x6563=function(_0x1604c9,_0x28c6b5){_0x1604c9=_0x1604c9-0x0;var _0x1567b7=_0x5636[_0x1604c9];return _0x1567b7;};'use strict';var _=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6563('0x2'));var db=require(_0x6563('0x3'))['db'];var utils=require(_0x6563('0x4'));var logger=require('../../config/logger')(_0x6563('0x5'));var config=require(_0x6563('0x6'));var jayson=require(_0x6563('0x7'));var client=jayson[_0x6563('0x8')][_0x6563('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x193942,_0x9884a9,_0x2d57d5){return new BPromise(function(_0x2d0d5b,_0x98fcd4){return client[_0x6563('0xa')](_0x193942,_0x2d57d5)[_0x6563('0xb')](function(_0x3ccb4e){logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x9884a9,_0x6563('0xc'));logger[_0x6563('0xd')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x9884a9,'request\x20sent',JSON['stringify'](_0x3ccb4e));if(_0x3ccb4e[_0x6563('0xe')]){if(_0x3ccb4e[_0x6563('0xe')][_0x6563('0xf')]===0x1f4){logger[_0x6563('0xe')](_0x6563('0x10'),_0x9884a9,_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);return _0x98fcd4(_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);}logger['error'](_0x6563('0x10'),_0x9884a9,_0x3ccb4e['error'][_0x6563('0x11')]);return _0x2d0d5b(_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);}else{logger[_0x6563('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x9884a9,_0x6563('0xc'));_0x2d0d5b(_0x3ccb4e[_0x6563('0x13')][_0x6563('0x11')]);}})[_0x6563('0x14')](function(_0x4e7282){logger[_0x6563('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x9884a9,_0x4e7282);_0x98fcd4(_0x4e7282);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 015edf7..cbac3af 100644 --- a/server/api/whatsappInteraction/index.js +++ b/server/api/whatsappInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc6ac=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','update','delete','whatsappinteraction:destroy','destroy','/:id/tags','exports','multer','util','path'];(function(_0xd3c016,_0x521957){var _0x536f3d=function(_0x2c5903){while(--_0x2c5903){_0xd3c016['push'](_0xd3c016['shift']());}};_0x536f3d(++_0x521957);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x331ed3,_0x20b3ea){_0x331ed3=_0x331ed3-0x0;var _0x4cc327=_0xc6ac[_0x331ed3];return _0x4cc327;};'use strict';var multer=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var path=require(_0xcc6a('0x2'));var timeout=require(_0xcc6a('0x3'));var express=require(_0xcc6a('0x4'));var router=express[_0xcc6a('0x5')]();var fs_extra=require(_0xcc6a('0x6'));var auth=require(_0xcc6a('0x7'));var interaction=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var controller=require(_0xcc6a('0xa'));router[_0xcc6a('0xb')]('/',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xd')]);router['get'](_0xcc6a('0xe'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xf')]);router['get'](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x11')]);router[_0xcc6a('0xb')](_0xcc6a('0x12'),auth['isAuthenticated'](),controller[_0xcc6a('0x13')]);router[_0xcc6a('0xb')](_0xcc6a('0x14'),auth['isAuthenticated'](),controller[_0xcc6a('0x15')]);router[_0xcc6a('0x16')]('/',auth[_0xcc6a('0xc')](),controller['create']);router['post'](_0xcc6a('0x12'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x17')]);router['post']('/:id/tags',auth[_0xcc6a('0xc')](),interaction[_0xcc6a('0x18')](_0xcc6a('0x19'),_0xcc6a('0x1a')),controller[_0xcc6a('0x1b')]);router[_0xcc6a('0x1c')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),interaction['tracked']('whatsapp','whatsappinteraction:update'),controller[_0xcc6a('0x1d')]);router[_0xcc6a('0x1e')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),interaction[_0xcc6a('0x18')](_0xcc6a('0x19'),_0xcc6a('0x1f')),controller[_0xcc6a('0x20')]);router[_0xcc6a('0x1e')](_0xcc6a('0x21'),auth[_0xcc6a('0xc')](),controller['removeTags']);module[_0xcc6a('0x22')]=router; \ No newline at end of file +var _0x1261=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','index','get','isAuthenticated','describe','/:id','/:id/messages','download','create','post','addMessage','/:id/tags','whatsappinteraction:addtags','addTags','put','whatsapp','whatsappinteraction:update','update','whatsappinteraction:destroy','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x21692c,_0x4d5b1d){var _0x4785f7=function(_0xe46b34){while(--_0xe46b34){_0x21692c['push'](_0x21692c['shift']());}};_0x4785f7(++_0x4d5b1d);}(_0x1261,0x144));var _0x1126=function(_0x372047,_0x7f5c2b){_0x372047=_0x372047-0x0;var _0x44f282=_0x1261[_0x372047];return _0x44f282;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/describe',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['show']);router[_0x1126('0xb')](_0x1126('0xf'),auth[_0x1126('0xc')](),controller['getMessages']);router[_0x1126('0xb')]('/:id/download',auth['isAuthenticated'](),controller[_0x1126('0x10')]);router['post']('/',auth[_0x1126('0xc')](),controller[_0x1126('0x11')]);router[_0x1126('0x12')](_0x1126('0xf'),auth[_0x1126('0xc')](),controller[_0x1126('0x13')]);router[_0x1126('0x12')](_0x1126('0x14'),auth[_0x1126('0xc')](),interaction['tracked']('whatsapp',_0x1126('0x15')),controller[_0x1126('0x16')]);router[_0x1126('0x17')]('/:id',auth[_0x1126('0xc')](),interaction['tracked'](_0x1126('0x18'),_0x1126('0x19')),controller[_0x1126('0x1a')]);router['delete'](_0x1126('0xe'),auth[_0x1126('0xc')](),interaction['tracked']('whatsapp',_0x1126('0x1b')),controller[_0x1126('0x1c')]);router['delete']('/:id/tags',auth[_0x1126('0xc')](),controller['removeTags']);module[_0x1126('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index e8acb2e..bbaf8e3 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.attributes.js +++ b/server/api/whatsappInteraction/whatsappInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb66=['ENUM','out','moment','exports','BOOLEAN','DATE','STRING'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xcb66,0x19f));var _0x6cb6=function(_0xf73c09,_0x4e424e){_0xf73c09=_0xf73c09-0x0;var _0xa8923c=_0xcb66[_0xf73c09];return _0xa8923c;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x6cb6('0x0'));module[_0x6cb6('0x1')]={'closed':{'type':Sequelize[_0x6cb6('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6cb6('0x3')]},'disposition':{'type':Sequelize[_0x6cb6('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x6cb6('0x4')]},'note':{'type':Sequelize[_0x6cb6('0x4')]},'phone':{'type':Sequelize[_0x6cb6('0x4')]},'read1stAt':{'type':Sequelize[_0x6cb6('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x6cb6('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x6cb6('0x5')]('in',_0x6cb6('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x6cb6('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x6eed=['moment','exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x2c8456,_0x670bdc){var _0xd93598=function(_0x168419){while(--_0x168419){_0x2c8456['push'](_0x2c8456['shift']());}};_0xd93598(++_0x670bdc);}(_0x6eed,0xff));var _0xd6ee=function(_0x3be221,_0x4663d0){_0x3be221=_0x3be221-0x0;var _0x293b2c=_0x6eed[_0x3be221];return _0x293b2c;};'use strict';var Sequelize=require(_0xd6ee('0x0'));var moment=require(_0xd6ee('0x1'));module[_0xd6ee('0x2')]={'closed':{'type':Sequelize[_0xd6ee('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd6ee('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xd6ee('0x5')]},'thirdDisposition':{'type':Sequelize[_0xd6ee('0x5')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xd6ee('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xd6ee('0x6')]('in',_0xd6ee('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd6ee('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xd6ee('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index bf964f9..ed2d7dd 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.controller.js +++ b/server/api/whatsappInteraction/whatsappInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x130d=['toString','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','createdAt','direction','secret','read','WhatsappAccount','Account','Owner','Whatsapp','N.A.','closedAt','disposition','Messages','basename','existsSync','createReadStream','pipe','out','System','renderFile','views','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','getOptions','findAll','whatsapp','query','user','catch','show','params','model','WhatsappInteraction','keys','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','describe','WhatsappMessage','addMessage','ids','omit','getMessages','findOne','filters','hasOwnProperty','order','where','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','addTags','spread','color','emit','removeTags','download','unix'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x130d,0x19d));var _0xd130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x130d[_0x3dd15e];return _0x231fd0;};'use strict';var rimraf=require(_0xd130('0x0'));var zipdir=require(_0xd130('0x1'));var moment=require(_0xd130('0x2'));var BPromise=require('bluebird');var util=require('util');var path=require(_0xd130('0x3'));var ejs=require(_0xd130('0x4'));var fs=require('fs');var _=require(_0xd130('0x5'));var Redis=require(_0xd130('0x6'));var interaction=require(_0xd130('0x7'));var qs=require(_0xd130('0x8'));var pdf=require(_0xd130('0x9'));var logger=require(_0xd130('0xa'))('api');var config=require(_0xd130('0xb'));var db=require(_0xd130('0xc'))['db'];config['redis']=_[_0xd130('0xd')](config['redis'],{'host':_0xd130('0xe'),'port':0x18eb});var socket=require(_0xd130('0xf'))(new Redis(config[_0xd130('0x10')]));require('./whatsappInteraction.socket')[_0xd130('0x11')](socket);function respondWithStatusCode(_0x4832f5,_0x1a018c){_0x1a018c=_0x1a018c||0xcc;return function(_0x46e8b6){if(_0x46e8b6){return _0x4832f5[_0xd130('0x12')](_0x1a018c);}return _0x4832f5['status'](_0x1a018c)[_0xd130('0x13')]();};}function respondWithResult(_0x42a677,_0x15ab64){_0x15ab64=_0x15ab64||0xc8;return function(_0x3e9b65){if(_0x3e9b65){return _0x42a677[_0xd130('0x14')](_0x15ab64)[_0xd130('0x15')](_0x3e9b65);}};}function respondWithFilteredResult(_0x1b2552,_0x1dc7e6){return function(_0x128f1a){if(_0x128f1a){var _0x5e0577=typeof _0x1dc7e6[_0xd130('0x16')]===_0xd130('0x17')&&typeof _0x1dc7e6[_0xd130('0x18')]==='undefined';var _0x352949=_0x128f1a['count'];var _0x4e5577=_0x5e0577?0x0:_0x1dc7e6['offset'];var _0x32c602=_0x5e0577?_0x128f1a[_0xd130('0x19')]:_0x1dc7e6[_0xd130('0x16')]+_0x1dc7e6['limit'];var _0x3b20b9;if(_0x32c602>=_0x352949){_0x32c602=_0x352949;_0x3b20b9=0xc8;}else{_0x3b20b9=0xce;}_0x1b2552[_0xd130('0x14')](_0x3b20b9);return _0x1b2552[_0xd130('0x1a')](_0xd130('0x1b'),_0x4e5577+'-'+_0x32c602+'/'+_0x352949)[_0xd130('0x15')](_0x128f1a);}return null;};}function saveUpdates(_0x52a921){return function(_0x561035){if(_0x561035){return _0x561035[_0xd130('0x1c')](_0x52a921)[_0xd130('0x1d')](function(_0x2129bf){return _0x2129bf;});}return null;};}function removeEntity(_0x18e340){return function(_0x136b40){if(_0x136b40){return _0x136b40[_0xd130('0x1e')]()[_0xd130('0x1d')](function(){_0x18e340[_0xd130('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6e5138){return function(_0x3142e1){if(!_0x3142e1){_0x6e5138['sendStatus'](0x194);}return _0x3142e1;};}function handleError(_0x1f944b,_0x55d2b7){_0x55d2b7=_0x55d2b7||0x1f4;return function(_0x216871){logger[_0xd130('0x1f')](_0x216871[_0xd130('0x20')]);if(_0x216871[_0xd130('0x21')]){delete _0x216871[_0xd130('0x21')];}_0x1f944b[_0xd130('0x14')](_0x55d2b7)[_0xd130('0x22')](_0x216871);};}exports['index']=function(_0x2274dd,_0x228ba9){var _0x23d735={};var _0x4165ca=_[_0xd130('0x23')](db['WhatsappInteraction'][_0xd130('0x24')],function(_0x15fc7f){return{'name':_0x15fc7f[_0xd130('0x25')],'type':_0x15fc7f['type']['key']};});_0x23d735=qs[_0xd130('0x26')](_0x4165ca,_0x2274dd);return interaction[_0xd130('0x27')](_0xd130('0x28'),_0x2274dd[_0xd130('0x29')],_0x2274dd[_0xd130('0x2a')],_0x23d735,_0x4165ca)['then'](respondWithFilteredResult(_0x228ba9,_0x23d735))[_0xd130('0x2b')](handleError(_0x228ba9,null));};exports[_0xd130('0x2c')]=function(_0x22a30d,_0x17468b){var _0x501c32={'raw':![],'where':{'id':_0x22a30d[_0xd130('0x2d')]['id']}},_0x1e9e9a={};_0x1e9e9a[_0xd130('0x2e')]=_['keys'](db[_0xd130('0x2f')]['rawAttributes']);_0x1e9e9a[_0xd130('0x29')]=_[_0xd130('0x30')](_0x22a30d[_0xd130('0x29')]);_0x1e9e9a['filters']=_[_0xd130('0x31')](_0x1e9e9a[_0xd130('0x2e')],_0x1e9e9a['query']);_0x501c32[_0xd130('0x32')]=_[_0xd130('0x31')](_0x1e9e9a[_0xd130('0x2e')],qs['fields'](_0x22a30d[_0xd130('0x29')][_0xd130('0x33')]));_0x501c32[_0xd130('0x32')]=_0x501c32[_0xd130('0x32')][_0xd130('0x34')]?_0x501c32[_0xd130('0x32')]:_0x1e9e9a[_0xd130('0x2e')];if(_0x22a30d['query'][_0xd130('0x35')]){_0x501c32[_0xd130('0x36')]=[{'all':!![]}];}_0x501c32=_[_0xd130('0x37')]({},_0x501c32,_0x22a30d[_0xd130('0x38')]);return db[_0xd130('0x2f')][_0xd130('0x39')](_0x501c32)[_0xd130('0x1d')](handleEntityNotFound(_0x17468b,null))[_0xd130('0x1d')](respondWithResult(_0x17468b,null))[_0xd130('0x2b')](handleError(_0x17468b,null));};exports['create']=function(_0x38db60,_0x108cd4){return db[_0xd130('0x2f')][_0xd130('0x3a')](_0x38db60[_0xd130('0x3b')],{})['then'](respondWithResult(_0x108cd4,0xc9))['catch'](handleError(_0x108cd4,null));};exports[_0xd130('0x1c')]=function(_0x191eb0,_0x16894f){if(_0x191eb0['body']['id']){delete _0x191eb0[_0xd130('0x3b')]['id'];}return db[_0xd130('0x2f')][_0xd130('0x39')]({'where':{'id':_0x191eb0[_0xd130('0x2d')]['id']}})[_0xd130('0x1d')](handleEntityNotFound(_0x16894f,null))['then'](saveUpdates(_0x191eb0[_0xd130('0x3b')],null))['then'](respondWithResult(_0x16894f,null))[_0xd130('0x2b')](handleError(_0x16894f,null));};exports[_0xd130('0x1e')]=function(_0xd2f5ff,_0x62a6){return db[_0xd130('0x2f')]['find']({'where':{'id':_0xd2f5ff['params']['id']}})[_0xd130('0x1d')](handleEntityNotFound(_0x62a6,null))['then'](removeEntity(_0x62a6,null))['catch'](handleError(_0x62a6,null));};exports[_0xd130('0x3c')]=function(_0x5726f7,_0x4d1db8){return db[_0xd130('0x2f')][_0xd130('0x3c')]()[_0xd130('0x1d')](respondWithResult(_0x4d1db8,null))[_0xd130('0x2b')](handleError(_0x4d1db8,null));};exports['addMessage']=function(_0x50a4f9,_0x5ba3bf){return db[_0xd130('0x3d')][_0xd130('0x39')]({'where':{'id':_0x50a4f9[_0xd130('0x2d')]['id']}})['then'](handleEntityNotFound(_0x5ba3bf,null))[_0xd130('0x1d')](function(_0x4ab090){if(_0x4ab090){return _0x4ab090[_0xd130('0x3e')](_0x50a4f9[_0xd130('0x3b')][_0xd130('0x3f')],_[_0xd130('0x40')](_0x50a4f9[_0xd130('0x3b')],[_0xd130('0x3f'),'id'])||{});}})['then'](respondWithResult(_0x5ba3bf,null))[_0xd130('0x2b')](handleError(_0x5ba3bf,null));};exports[_0xd130('0x41')]=function(_0xe19cbc,_0x1e7c81){var _0x59efc9={'raw':![],'where':{}};var _0x40bd8f={};var _0x812e5={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0xd130('0x42')]({'where':{'id':_0xe19cbc[_0xd130('0x2d')]['id']}})[_0xd130('0x1d')](handleEntityNotFound(_0x1e7c81,null))[_0xd130('0x1d')](function(_0x32581c){if(_0x32581c){_0x40bd8f[_0xd130('0x2e')]=_[_0xd130('0x30')](db[_0xd130('0x3d')][_0xd130('0x24')]);_0x40bd8f['query']=_[_0xd130('0x30')](_0xe19cbc[_0xd130('0x29')]);_0x40bd8f[_0xd130('0x43')]=_[_0xd130('0x31')](_0x40bd8f[_0xd130('0x2e')],_0x40bd8f[_0xd130('0x29')]);_0x59efc9[_0xd130('0x32')]=_[_0xd130('0x31')](_0x40bd8f[_0xd130('0x2e')],qs[_0xd130('0x33')](_0xe19cbc[_0xd130('0x29')][_0xd130('0x33')]));_0x59efc9[_0xd130('0x32')]=_0x59efc9['attributes']['length']?_0x59efc9['attributes']:_0x40bd8f[_0xd130('0x2e')];if(!_0xe19cbc['query'][_0xd130('0x44')]('nolimit')){_0x59efc9['limit']=qs[_0xd130('0x18')](_0xe19cbc['query']['limit']);_0x59efc9[_0xd130('0x16')]=qs[_0xd130('0x16')](_0xe19cbc[_0xd130('0x29')][_0xd130('0x16')]);}_0x59efc9[_0xd130('0x45')]=qs['sort'](_0xe19cbc[_0xd130('0x29')]['sort']);_0x59efc9['where']=qs['filters'](_['pick'](_0xe19cbc[_0xd130('0x29')],_0x40bd8f[_0xd130('0x43')]));_0x59efc9[_0xd130('0x46')]['WhatsappInteractionId']=_0x32581c['id'];if(_0xe19cbc[_0xd130('0x29')][_0xd130('0x47')]){_0x59efc9['where']=_[_0xd130('0x37')](_0x59efc9[_0xd130('0x46')],{'$or':_[_0xd130('0x23')](_0x59efc9[_0xd130('0x32')],function(_0x2987d4){var _0x2ada54={};_0x2ada54[_0x2987d4]={'$like':'%'+_0xe19cbc[_0xd130('0x29')][_0xd130('0x47')]+'%'};return _0x2ada54;})});}if(_0xe19cbc[_0xd130('0x29')][_0xd130('0x48')]){var _0x17494e=_0xe19cbc[_0xd130('0x29')][_0xd130('0x48')][_0xd130('0x49')](',');var _0x14646c={};_0x14646c[_0x17494e[0x0]]={'$gte':moment(_0x17494e[0x1])[_0xd130('0x4a')](_0xd130('0x4b'))};_0x59efc9[_0xd130('0x46')]=_['merge'](_0x59efc9[_0xd130('0x46')],_0x14646c);}_0x59efc9=_[_0xd130('0x37')]({},_0x59efc9,_0xe19cbc['options']);return db[_0xd130('0x3d')][_0xd130('0x19')]({'where':_0x59efc9[_0xd130('0x46')]})[_0xd130('0x1d')](function(_0x236df9){_0x812e5[_0xd130('0x19')]=_0x236df9;if(_0xe19cbc[_0xd130('0x29')]['includeAll']){_0x59efc9[_0xd130('0x36')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xd130('0x27')](_0x59efc9);})['then'](function(_0x36adcf){_0x812e5['rows']=_0x36adcf;return _0x812e5;});}})['then'](respondWithFilteredResult(_0x1e7c81,_0x59efc9))[_0xd130('0x2b')](handleError(_0x1e7c81,null));};exports[_0xd130('0x4c')]=function(_0x290871,_0x22f258){return db['WhatsappInteraction'][_0xd130('0x39')]({'where':{'id':_0x290871[_0xd130('0x2d')]['id']}})[_0xd130('0x1d')](handleEntityNotFound(_0x22f258,null))[_0xd130('0x1d')](function(_0x52df19){if(_0x52df19){return _0x52df19['setTags'](_0x290871['body']['ids'],_[_0xd130('0x40')](_0x290871[_0xd130('0x3b')],[_0xd130('0x3f'),'id'])||{})[_0xd130('0x4d')](function(){return db['Tag'][_0xd130('0x27')]({'attributes':['id',_0xd130('0x21'),_0xd130('0x4e')],'where':{'id':_0x290871[_0xd130('0x3b')][_0xd130('0x3f')]}});})[_0xd130('0x1d')](function(_0x43642f){socket[_0xd130('0x4f')]('whatsappInteractionTags:save',{'id':Number(_0x290871['params']['id']),'tags':_0x43642f||[]});return{'id':Number(_0x290871[_0xd130('0x2d')]['id']),'tags':_0x43642f||[]};});}})[_0xd130('0x1d')](respondWithResult(_0x22f258,null))[_0xd130('0x2b')](handleError(_0x22f258,null));};exports['removeTags']=function(_0x40e149,_0x1d258f){return db['WhatsappInteraction'][_0xd130('0x39')]({'where':{'id':_0x40e149['params']['id']}})[_0xd130('0x1d')](handleEntityNotFound(_0x1d258f,null))[_0xd130('0x1d')](function(_0x5426cc){if(_0x5426cc){return _0x5426cc[_0xd130('0x50')](_0x40e149['query']['ids']);}})['then'](respondWithStatusCode(_0x1d258f,null))[_0xd130('0x2b')](handleError(_0x1d258f,null));};exports[_0xd130('0x51')]=function(_0x38fe61,_0x3656f5){var _0x80578f=moment()[_0xd130('0x52')]()[_0xd130('0x53')]();var _0x32cd1c=path[_0xd130('0x54')](config['root'],_0xd130('0x55'),_0xd130('0x56'),_0xd130('0x57'));var _0x59aa75=path[_0xd130('0x54')](config[_0xd130('0x58')],_0xd130('0x55'),_0xd130('0x56'),_0xd130('0x59'));var _0x51538c=path['join'](_0x32cd1c,_0x80578f);var _0x20a6a9=util[_0xd130('0x4a')](_0xd130('0x5a'),_0x38fe61['params']['id'],_0x80578f);var _0x342866=path[_0xd130('0x54')](_0x32cd1c,_0x20a6a9);var _0x115822=[];_0x115822[_0xd130('0x5b')]({'model':db[_0xd130('0x5c')],'as':_0xd130('0x5c'),'attributes':['id',_0xd130('0x5d')],'raw':!![]});_0x115822[_0xd130('0x5b')]({'model':db[_0xd130('0x5e')],'as':_0xd130('0x5f'),'attributes':['id',_0xd130('0x60'),_0xd130('0x61')],'raw':!![]});if(_0x38fe61[_0xd130('0x29')][_0xd130('0x59')]){_0x115822[_0xd130('0x5b')]({'model':db['Attachment'],'as':_0xd130('0x62'),'raw':!![]});}var _0x533cb7=[{'model':db['WhatsappMessage'],'as':'Messages','attributes':['id',_0xd130('0x3b'),_0xd130('0x63'),_0xd130('0x64'),_0xd130('0x65'),_0xd130('0x66')],'include':_0x115822}];_0x533cb7[_0xd130('0x5b')]({'model':db[_0xd130('0x67')],'as':_0xd130('0x68'),'attributes':['id','name']});_0x533cb7['push']({'model':db[_0xd130('0x5c')],'as':_0xd130('0x69'),'attributes':['id','fullname']});return db[_0xd130('0x2f')][_0xd130('0x39')]({'where':{'id':_0x38fe61[_0xd130('0x2d')]['id']},'include':_0x533cb7})[_0xd130('0x1d')](handleEntityNotFound(_0x3656f5,null))[_0xd130('0x1d')](function(_0x522b2b){if(_0x522b2b){var _0x529fb0=_0x522b2b['get']({'plain':!![]});fs['mkdirSync'](_0x51538c);var _0x43d6a6={'channel':_0xd130('0x6a'),'account':_0x529fb0['Account'][_0xd130('0x21')],'agent':_0x529fb0[_0xd130('0x69')]?_0x529fb0['Owner'][_0xd130('0x5d')]:_0xd130('0x6b'),'createdAt':moment(_0x529fb0['createdAt'])[_0xd130('0x4a')](_0xd130('0x4b'))[_0xd130('0x53')](),'closedAt':_0x529fb0['closed']?moment(_0x529fb0[_0xd130('0x6c')])[_0xd130('0x4a')](_0xd130('0x4b'))[_0xd130('0x53')]():'','disposition':_0x529fb0[_0xd130('0x6d')],'messages':_(_0x529fb0[_0xd130('0x6e')])[_0xd130('0x47')]({'secret':![]})[_0xd130('0x23')](function(_0x2a1c91){if(_0x2a1c91[_0xd130('0x62')]){var _0x2237fc=path[_0xd130('0x54')](_0x59aa75,_0x2a1c91[_0xd130('0x62')][_0xd130('0x6f')]);if(fs[_0xd130('0x70')](_0x2237fc)){fs[_0xd130('0x71')](_0x2237fc)[_0xd130('0x72')](fs['createWriteStream'](path[_0xd130('0x54')](_0x51538c,_0x2a1c91['Attachment'][_0xd130('0x6f')])));}}return{'date':moment(_0x2a1c91['createdAt'])[_0xd130('0x4a')](_0xd130('0x4b'))[_0xd130('0x53')](),'sender':_0x2a1c91[_0xd130('0x64')]===_0xd130('0x73')?_0x2a1c91[_0xd130('0x5c')]?_0x2a1c91[_0xd130('0x5c')][_0xd130('0x5d')]:_0xd130('0x74'):_0x2a1c91[_0xd130('0x5f')][_0xd130('0x60')]+(_0x2a1c91[_0xd130('0x5f')][_0xd130('0x61')]?'\x20'+_0x2a1c91['Contact'][_0xd130('0x61')]:''),'body':_0x2a1c91[_0xd130('0x62')]?_0x2a1c91['Attachment'][_0xd130('0x6f')]:_0x2a1c91[_0xd130('0x3b')],'direction':_0x2a1c91[_0xd130('0x64')]===_0xd130('0x73')?'A':'C','secret':_0x2a1c91[_0xd130('0x65')],'read':_0x2a1c91['read'],'attachment':_0x2a1c91[_0xd130('0x62')]};})['value']()};return ejs[_0xd130('0x75')](path[_0xd130('0x54')](config[_0xd130('0x58')],_0xd130('0x55'),_0xd130('0x76'),'downloadInteraction.ejs'),{'interaction':_0x43d6a6})[_0xd130('0x1d')](function(_0x1e2f98){var _0x5c3f50=path['join'](_0x51538c,_0xd130('0x77')+_0x529fb0['id']+'-'+_0x80578f+_0xd130('0x78'));var _0x436832={'path':_0x5c3f50,'channel':_0xd130('0x6a'),'interactionId':_0x529fb0['id']};return pdf[_0xd130('0x79')](_0x1e2f98,_0x436832);})['then'](function(){return new BPromise(function(_0x3126a0,_0x560d85){zipdir(_0x51538c,{'saveTo':_0x342866},function(_0x519e63,_0x201654){if(_0x519e63)return _0x560d85(_0x519e63);return _0x3126a0(_0x201654);});})[_0xd130('0x1d')](function(){return new BPromise(function(_0x5d257a,_0x2eb72e){rimraf(_0x51538c,function(_0x2b42ca){if(_0x2b42ca)_0x2eb72e(_0x2b42ca);return _0x5d257a();});});})['then'](function(){return _0x3656f5[_0xd130('0x51')](_0x342866,_0x20a6a9,function(_0x8f6bc1){if(_0x8f6bc1){console['log'](_0xd130('0x7a'),_0x8f6bc1);}else{fs[_0xd130('0x7b')](_0x342866);}});});});}else{return _0x3656f5[_0xd130('0x12')](0xc8);}})[_0xd130('0x2b')](handleError(_0x3656f5,null));}; \ No newline at end of file +var _0xbd23=['zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','sendStatus','status','undefined','limit','count','offset','set','json','update','then','destroy','end','error','stack','name','send','index','map','WhatsappInteraction','rawAttributes','key','findAll','whatsapp','query','user','catch','show','params','model','keys','filters','attributes','intersection','fields','length','merge','options','find','create','body','describe','addMessage','ids','findOne','WhatsappMessage','hasOwnProperty','nolimit','order','sort','where','pick','WhatsappInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','setTags','omit','color','emit','whatsappInteractionTags:save','removeTags','download','unix','toString','join','server','files','tmp','root','transcript-%d-%s.zip','User','fullname','push','Contact','firstName','lastName','attachments','Attachment','Messages','createdAt','direction','read','WhatsappAccount','Account','Owner','closed','closedAt','disposition','basename','existsSync','pipe','out','System','secret','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Whatsapp','createPdfFromHTML','err','unlinkSync','rimraf'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xbd23,0x7b));var _0x3bd2=function(_0x100533,_0x118bb8){_0x100533=_0x100533-0x0;var _0x4b41f7=_0xbd23[_0x100533];return _0x4b41f7;};'use strict';var rimraf=require(_0x3bd2('0x0'));var zipdir=require(_0x3bd2('0x1'));var moment=require(_0x3bd2('0x2'));var BPromise=require('bluebird');var util=require(_0x3bd2('0x3'));var path=require(_0x3bd2('0x4'));var ejs=require(_0x3bd2('0x5'));var fs=require('fs');var _=require(_0x3bd2('0x6'));var Redis=require(_0x3bd2('0x7'));var interaction=require(_0x3bd2('0x8'));var qs=require(_0x3bd2('0x9'));var pdf=require('../../components/export/pdf');var logger=require(_0x3bd2('0xa'))(_0x3bd2('0xb'));var config=require('../../config/environment');var db=require(_0x3bd2('0xc'))['db'];config[_0x3bd2('0xd')]=_[_0x3bd2('0xe')](config['redis'],{'host':_0x3bd2('0xf'),'port':0x18eb});var socket=require(_0x3bd2('0x10'))(new Redis(config[_0x3bd2('0xd')]));require(_0x3bd2('0x11'))['register'](socket);function respondWithStatusCode(_0x51471b,_0xb3f9c4){_0xb3f9c4=_0xb3f9c4||0xcc;return function(_0x16472e){if(_0x16472e){return _0x51471b[_0x3bd2('0x12')](_0xb3f9c4);}return _0x51471b[_0x3bd2('0x13')](_0xb3f9c4)['end']();};}function respondWithResult(_0x3493da,_0x46a39f){_0x46a39f=_0x46a39f||0xc8;return function(_0x28a83f){if(_0x28a83f){return _0x3493da[_0x3bd2('0x13')](_0x46a39f)['json'](_0x28a83f);}};}function respondWithFilteredResult(_0x40c49a,_0x559e7e){return function(_0x414cdf){if(_0x414cdf){var _0x17a88b=typeof _0x559e7e['offset']===_0x3bd2('0x14')&&typeof _0x559e7e[_0x3bd2('0x15')]===_0x3bd2('0x14');var _0x1fa1dc=_0x414cdf[_0x3bd2('0x16')];var _0x595b98=_0x17a88b?0x0:_0x559e7e[_0x3bd2('0x17')];var _0x5d204c=_0x17a88b?_0x414cdf['count']:_0x559e7e[_0x3bd2('0x17')]+_0x559e7e[_0x3bd2('0x15')];var _0x31cd41;if(_0x5d204c>=_0x1fa1dc){_0x5d204c=_0x1fa1dc;_0x31cd41=0xc8;}else{_0x31cd41=0xce;}_0x40c49a[_0x3bd2('0x13')](_0x31cd41);return _0x40c49a[_0x3bd2('0x18')]('Content-Range',_0x595b98+'-'+_0x5d204c+'/'+_0x1fa1dc)[_0x3bd2('0x19')](_0x414cdf);}return null;};}function saveUpdates(_0x4b2188){return function(_0x5e2d75){if(_0x5e2d75){return _0x5e2d75[_0x3bd2('0x1a')](_0x4b2188)[_0x3bd2('0x1b')](function(_0x1a69db){return _0x1a69db;});}return null;};}function removeEntity(_0x5efaee){return function(_0x54963d){if(_0x54963d){return _0x54963d[_0x3bd2('0x1c')]()[_0x3bd2('0x1b')](function(){_0x5efaee[_0x3bd2('0x13')](0xcc)[_0x3bd2('0x1d')]();});}};}function handleEntityNotFound(_0x520287){return function(_0x53d211){if(!_0x53d211){_0x520287[_0x3bd2('0x12')](0x194);}return _0x53d211;};}function handleError(_0x446221,_0x5f59a1){_0x5f59a1=_0x5f59a1||0x1f4;return function(_0x32f6eb){logger[_0x3bd2('0x1e')](_0x32f6eb[_0x3bd2('0x1f')]);if(_0x32f6eb['name']){delete _0x32f6eb[_0x3bd2('0x20')];}_0x446221['status'](_0x5f59a1)[_0x3bd2('0x21')](_0x32f6eb);};}exports[_0x3bd2('0x22')]=function(_0x29f4d6,_0x4deb76){var _0x5c8d72={};var _0x2062d3=_[_0x3bd2('0x23')](db[_0x3bd2('0x24')][_0x3bd2('0x25')],function(_0x1b8631){return{'name':_0x1b8631['fieldName'],'type':_0x1b8631['type'][_0x3bd2('0x26')]};});_0x5c8d72=qs['getOptions'](_0x2062d3,_0x29f4d6);return interaction[_0x3bd2('0x27')](_0x3bd2('0x28'),_0x29f4d6[_0x3bd2('0x29')],_0x29f4d6[_0x3bd2('0x2a')],_0x5c8d72,_0x2062d3)[_0x3bd2('0x1b')](respondWithFilteredResult(_0x4deb76,_0x5c8d72))[_0x3bd2('0x2b')](handleError(_0x4deb76,null));};exports[_0x3bd2('0x2c')]=function(_0x2d8ad5,_0x2a9e18){var _0x5aa691={'raw':![],'where':{'id':_0x2d8ad5[_0x3bd2('0x2d')]['id']}},_0x53bad0={};_0x53bad0[_0x3bd2('0x2e')]=_[_0x3bd2('0x2f')](db[_0x3bd2('0x24')]['rawAttributes']);_0x53bad0[_0x3bd2('0x29')]=_['keys'](_0x2d8ad5[_0x3bd2('0x29')]);_0x53bad0[_0x3bd2('0x30')]=_['intersection'](_0x53bad0[_0x3bd2('0x2e')],_0x53bad0['query']);_0x5aa691[_0x3bd2('0x31')]=_[_0x3bd2('0x32')](_0x53bad0[_0x3bd2('0x2e')],qs[_0x3bd2('0x33')](_0x2d8ad5['query'][_0x3bd2('0x33')]));_0x5aa691[_0x3bd2('0x31')]=_0x5aa691[_0x3bd2('0x31')][_0x3bd2('0x34')]?_0x5aa691[_0x3bd2('0x31')]:_0x53bad0[_0x3bd2('0x2e')];if(_0x2d8ad5[_0x3bd2('0x29')]['includeAll']){_0x5aa691['include']=[{'all':!![]}];}_0x5aa691=_[_0x3bd2('0x35')]({},_0x5aa691,_0x2d8ad5[_0x3bd2('0x36')]);return db[_0x3bd2('0x24')][_0x3bd2('0x37')](_0x5aa691)[_0x3bd2('0x1b')](handleEntityNotFound(_0x2a9e18,null))[_0x3bd2('0x1b')](respondWithResult(_0x2a9e18,null))[_0x3bd2('0x2b')](handleError(_0x2a9e18,null));};exports['create']=function(_0x4070f8,_0x3ab263){return db[_0x3bd2('0x24')][_0x3bd2('0x38')](_0x4070f8[_0x3bd2('0x39')],{})[_0x3bd2('0x1b')](respondWithResult(_0x3ab263,0xc9))[_0x3bd2('0x2b')](handleError(_0x3ab263,null));};exports[_0x3bd2('0x1a')]=function(_0x5aaac3,_0x2661d4){if(_0x5aaac3[_0x3bd2('0x39')]['id']){delete _0x5aaac3['body']['id'];}return db[_0x3bd2('0x24')][_0x3bd2('0x37')]({'where':{'id':_0x5aaac3['params']['id']}})[_0x3bd2('0x1b')](handleEntityNotFound(_0x2661d4,null))[_0x3bd2('0x1b')](saveUpdates(_0x5aaac3[_0x3bd2('0x39')],null))[_0x3bd2('0x1b')](respondWithResult(_0x2661d4,null))[_0x3bd2('0x2b')](handleError(_0x2661d4,null));};exports[_0x3bd2('0x1c')]=function(_0x5df001,_0x186310){return db[_0x3bd2('0x24')]['find']({'where':{'id':_0x5df001[_0x3bd2('0x2d')]['id']}})[_0x3bd2('0x1b')](handleEntityNotFound(_0x186310,null))[_0x3bd2('0x1b')](removeEntity(_0x186310,null))[_0x3bd2('0x2b')](handleError(_0x186310,null));};exports[_0x3bd2('0x3a')]=function(_0x4fe671,_0x36770b){return db[_0x3bd2('0x24')]['describe']()[_0x3bd2('0x1b')](respondWithResult(_0x36770b,null))[_0x3bd2('0x2b')](handleError(_0x36770b,null));};exports[_0x3bd2('0x3b')]=function(_0x3948d7,_0x2ccd4a){return db['WhatsappMessage'][_0x3bd2('0x37')]({'where':{'id':_0x3948d7[_0x3bd2('0x2d')]['id']}})[_0x3bd2('0x1b')](handleEntityNotFound(_0x2ccd4a,null))[_0x3bd2('0x1b')](function(_0x44c06c){if(_0x44c06c){return _0x44c06c['addMessage'](_0x3948d7['body'][_0x3bd2('0x3c')],_['omit'](_0x3948d7[_0x3bd2('0x39')],[_0x3bd2('0x3c'),'id'])||{});}})[_0x3bd2('0x1b')](respondWithResult(_0x2ccd4a,null))[_0x3bd2('0x2b')](handleError(_0x2ccd4a,null));};exports['getMessages']=function(_0x51a1e4,_0x5f2c5c){var _0xc73398={'raw':![],'where':{}};var _0x59c1aa={};var _0x5c0172={'count':0x0,'rows':[]};return db[_0x3bd2('0x24')][_0x3bd2('0x3d')]({'where':{'id':_0x51a1e4['params']['id']}})[_0x3bd2('0x1b')](handleEntityNotFound(_0x5f2c5c,null))[_0x3bd2('0x1b')](function(_0x317953){if(_0x317953){_0x59c1aa['model']=_[_0x3bd2('0x2f')](db[_0x3bd2('0x3e')][_0x3bd2('0x25')]);_0x59c1aa[_0x3bd2('0x29')]=_['keys'](_0x51a1e4['query']);_0x59c1aa[_0x3bd2('0x30')]=_[_0x3bd2('0x32')](_0x59c1aa[_0x3bd2('0x2e')],_0x59c1aa[_0x3bd2('0x29')]);_0xc73398[_0x3bd2('0x31')]=_[_0x3bd2('0x32')](_0x59c1aa[_0x3bd2('0x2e')],qs['fields'](_0x51a1e4[_0x3bd2('0x29')]['fields']));_0xc73398[_0x3bd2('0x31')]=_0xc73398[_0x3bd2('0x31')][_0x3bd2('0x34')]?_0xc73398['attributes']:_0x59c1aa[_0x3bd2('0x2e')];if(!_0x51a1e4['query'][_0x3bd2('0x3f')](_0x3bd2('0x40'))){_0xc73398[_0x3bd2('0x15')]=qs['limit'](_0x51a1e4[_0x3bd2('0x29')][_0x3bd2('0x15')]);_0xc73398[_0x3bd2('0x17')]=qs['offset'](_0x51a1e4[_0x3bd2('0x29')][_0x3bd2('0x17')]);}_0xc73398[_0x3bd2('0x41')]=qs[_0x3bd2('0x42')](_0x51a1e4[_0x3bd2('0x29')][_0x3bd2('0x42')]);_0xc73398[_0x3bd2('0x43')]=qs[_0x3bd2('0x30')](_[_0x3bd2('0x44')](_0x51a1e4[_0x3bd2('0x29')],_0x59c1aa[_0x3bd2('0x30')]));_0xc73398[_0x3bd2('0x43')][_0x3bd2('0x45')]=_0x317953['id'];if(_0x51a1e4[_0x3bd2('0x29')][_0x3bd2('0x46')]){_0xc73398[_0x3bd2('0x43')]=_['merge'](_0xc73398['where'],{'$or':_['map'](_0xc73398['attributes'],function(_0x5de516){var _0x456708={};_0x456708[_0x5de516]={'$like':'%'+_0x51a1e4[_0x3bd2('0x29')]['filter']+'%'};return _0x456708;})});}if(_0x51a1e4['query'][_0x3bd2('0x47')]){var _0x334568=_0x51a1e4['query'][_0x3bd2('0x47')]['split'](',');var _0x34bc4d={};_0x34bc4d[_0x334568[0x0]]={'$gte':moment(_0x334568[0x1])['format'](_0x3bd2('0x48'))};_0xc73398[_0x3bd2('0x43')]=_[_0x3bd2('0x35')](_0xc73398[_0x3bd2('0x43')],_0x34bc4d);}_0xc73398=_[_0x3bd2('0x35')]({},_0xc73398,_0x51a1e4[_0x3bd2('0x36')]);return db['WhatsappMessage'][_0x3bd2('0x16')]({'where':_0xc73398['where']})[_0x3bd2('0x1b')](function(_0x31c2f2){_0x5c0172[_0x3bd2('0x16')]=_0x31c2f2;if(_0x51a1e4['query'][_0x3bd2('0x49')]){_0xc73398['include']=[{'all':!![]}];}return db[_0x3bd2('0x3e')][_0x3bd2('0x27')](_0xc73398);})[_0x3bd2('0x1b')](function(_0x385b04){_0x5c0172[_0x3bd2('0x4a')]=_0x385b04;return _0x5c0172;});}})[_0x3bd2('0x1b')](respondWithFilteredResult(_0x5f2c5c,_0xc73398))['catch'](handleError(_0x5f2c5c,null));};exports['addTags']=function(_0x640852,_0x1956c2){return db[_0x3bd2('0x24')][_0x3bd2('0x37')]({'where':{'id':_0x640852['params']['id']}})[_0x3bd2('0x1b')](handleEntityNotFound(_0x1956c2,null))[_0x3bd2('0x1b')](function(_0x36841f){if(_0x36841f){return _0x36841f[_0x3bd2('0x4b')](_0x640852[_0x3bd2('0x39')][_0x3bd2('0x3c')],_[_0x3bd2('0x4c')](_0x640852[_0x3bd2('0x39')],['ids','id'])||{})['spread'](function(){return db['Tag'][_0x3bd2('0x27')]({'attributes':['id',_0x3bd2('0x20'),_0x3bd2('0x4d')],'where':{'id':_0x640852[_0x3bd2('0x39')][_0x3bd2('0x3c')]}});})[_0x3bd2('0x1b')](function(_0x30ca59){socket[_0x3bd2('0x4e')](_0x3bd2('0x4f'),{'id':Number(_0x640852[_0x3bd2('0x2d')]['id']),'tags':_0x30ca59||[]});return{'id':Number(_0x640852[_0x3bd2('0x2d')]['id']),'tags':_0x30ca59||[]};});}})[_0x3bd2('0x1b')](respondWithResult(_0x1956c2,null))[_0x3bd2('0x2b')](handleError(_0x1956c2,null));};exports[_0x3bd2('0x50')]=function(_0x5c6ad7,_0x5134fd){return db['WhatsappInteraction'][_0x3bd2('0x37')]({'where':{'id':_0x5c6ad7[_0x3bd2('0x2d')]['id']}})['then'](handleEntityNotFound(_0x5134fd,null))['then'](function(_0x4625a4){if(_0x4625a4){return _0x4625a4[_0x3bd2('0x50')](_0x5c6ad7[_0x3bd2('0x29')]['ids']);}})[_0x3bd2('0x1b')](respondWithStatusCode(_0x5134fd,null))[_0x3bd2('0x2b')](handleError(_0x5134fd,null));};exports[_0x3bd2('0x51')]=function(_0x3841b4,_0x200194){var _0x346ad4=moment()[_0x3bd2('0x52')]()[_0x3bd2('0x53')]();var _0x587260=path[_0x3bd2('0x54')](config['root'],_0x3bd2('0x55'),_0x3bd2('0x56'),_0x3bd2('0x57'));var _0x41913b=path[_0x3bd2('0x54')](config[_0x3bd2('0x58')],_0x3bd2('0x55'),_0x3bd2('0x56'),'attachments');var _0x193789=path['join'](_0x587260,_0x346ad4);var _0x3d8853=util['format'](_0x3bd2('0x59'),_0x3841b4[_0x3bd2('0x2d')]['id'],_0x346ad4);var _0x4a852e=path['join'](_0x587260,_0x3d8853);var _0x2ff7be=[];_0x2ff7be['push']({'model':db[_0x3bd2('0x5a')],'as':_0x3bd2('0x5a'),'attributes':['id',_0x3bd2('0x5b')],'raw':!![]});_0x2ff7be[_0x3bd2('0x5c')]({'model':db['CmContact'],'as':_0x3bd2('0x5d'),'attributes':['id',_0x3bd2('0x5e'),_0x3bd2('0x5f')],'raw':!![]});if(_0x3841b4[_0x3bd2('0x29')][_0x3bd2('0x60')]){_0x2ff7be['push']({'model':db['Attachment'],'as':_0x3bd2('0x61'),'raw':!![]});}var _0x692fa1=[{'model':db['WhatsappMessage'],'as':_0x3bd2('0x62'),'attributes':['id',_0x3bd2('0x39'),_0x3bd2('0x63'),_0x3bd2('0x64'),'secret',_0x3bd2('0x65')],'include':_0x2ff7be}];_0x692fa1[_0x3bd2('0x5c')]({'model':db[_0x3bd2('0x66')],'as':_0x3bd2('0x67'),'attributes':['id',_0x3bd2('0x20')]});_0x692fa1['push']({'model':db[_0x3bd2('0x5a')],'as':_0x3bd2('0x68'),'attributes':['id',_0x3bd2('0x5b')]});return db[_0x3bd2('0x24')][_0x3bd2('0x37')]({'where':{'id':_0x3841b4[_0x3bd2('0x2d')]['id']},'include':_0x692fa1})[_0x3bd2('0x1b')](handleEntityNotFound(_0x200194,null))[_0x3bd2('0x1b')](function(_0x3e1875){if(_0x3e1875){var _0x327e65=_0x3e1875['get']({'plain':!![]});fs['mkdirSync'](_0x193789);var _0x57847a={'channel':'Whatsapp','account':_0x327e65[_0x3bd2('0x67')][_0x3bd2('0x20')],'agent':_0x327e65[_0x3bd2('0x68')]?_0x327e65[_0x3bd2('0x68')]['fullname']:'N.A.','createdAt':moment(_0x327e65['createdAt'])['format'](_0x3bd2('0x48'))['toString'](),'closedAt':_0x327e65[_0x3bd2('0x69')]?moment(_0x327e65[_0x3bd2('0x6a')])['format'](_0x3bd2('0x48'))[_0x3bd2('0x53')]():'','disposition':_0x327e65[_0x3bd2('0x6b')],'messages':_(_0x327e65[_0x3bd2('0x62')])['filter']({'secret':![]})['map'](function(_0x14f134){if(_0x14f134[_0x3bd2('0x61')]){var _0x44d551=path['join'](_0x41913b,_0x14f134[_0x3bd2('0x61')][_0x3bd2('0x6c')]);if(fs[_0x3bd2('0x6d')](_0x44d551)){fs['createReadStream'](_0x44d551)[_0x3bd2('0x6e')](fs['createWriteStream'](path[_0x3bd2('0x54')](_0x193789,_0x14f134[_0x3bd2('0x61')]['basename'])));}}return{'date':moment(_0x14f134[_0x3bd2('0x63')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x3bd2('0x53')](),'sender':_0x14f134[_0x3bd2('0x64')]===_0x3bd2('0x6f')?_0x14f134[_0x3bd2('0x5a')]?_0x14f134['User'][_0x3bd2('0x5b')]:_0x3bd2('0x70'):_0x14f134[_0x3bd2('0x5d')][_0x3bd2('0x5e')]+(_0x14f134[_0x3bd2('0x5d')][_0x3bd2('0x5f')]?'\x20'+_0x14f134[_0x3bd2('0x5d')][_0x3bd2('0x5f')]:''),'body':_0x14f134['Attachment']?_0x14f134[_0x3bd2('0x61')]['basename']:_0x14f134[_0x3bd2('0x39')],'direction':_0x14f134['direction']===_0x3bd2('0x6f')?'A':'C','secret':_0x14f134[_0x3bd2('0x71')],'read':_0x14f134['read'],'attachment':_0x14f134[_0x3bd2('0x61')]};})[_0x3bd2('0x72')]()};return ejs[_0x3bd2('0x73')](path[_0x3bd2('0x54')](config['root'],_0x3bd2('0x55'),_0x3bd2('0x74'),_0x3bd2('0x75')),{'interaction':_0x57847a})[_0x3bd2('0x1b')](function(_0x4647bb){var _0x2dd4f7=path[_0x3bd2('0x54')](_0x193789,_0x3bd2('0x76')+_0x327e65['id']+'-'+_0x346ad4+_0x3bd2('0x77'));var _0x26147c={'path':_0x2dd4f7,'channel':_0x3bd2('0x78'),'interactionId':_0x327e65['id']};return pdf[_0x3bd2('0x79')](_0x4647bb,_0x26147c);})['then'](function(){return new BPromise(function(_0x23d8fe,_0x179d2e){zipdir(_0x193789,{'saveTo':_0x4a852e},function(_0x3b6a2b,_0x3ebfbb){if(_0x3b6a2b)return _0x179d2e(_0x3b6a2b);return _0x23d8fe(_0x3ebfbb);});})[_0x3bd2('0x1b')](function(){return new BPromise(function(_0x5303ae,_0x461bdf){rimraf(_0x193789,function(_0x4e8456){if(_0x4e8456)_0x461bdf(_0x4e8456);return _0x5303ae();});});})[_0x3bd2('0x1b')](function(){return _0x200194[_0x3bd2('0x51')](_0x4a852e,_0x3d8853,function(_0x35a3d6){if(_0x35a3d6){console['log'](_0x3bd2('0x7a'),_0x35a3d6);}else{fs[_0x3bd2('0x7b')](_0x4a852e);}});});});}else{return _0x200194['sendStatus'](0xc8);}})[_0x3bd2('0x2b')](handleError(_0x200194,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index eb1648c..b138ee8 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.events.js +++ b/server/api/whatsappInteraction/whatsappInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4fdc=['then','unreadMessages','length','emit','catch','exports','../../mysqldb','WhatsappMessage','setMaxListeners','update','remove','getUsers','setDataValue','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4fdc,0x84));var _0xc4fd=function(_0x2d27ae,_0x73ceff){_0x2d27ae=_0x2d27ae-0x0;var _0x5da60e=_0x4fdc[_0x2d27ae];return _0x5da60e;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0xc4fd('0x0'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xc4fd('0x0'))['db'][_0xc4fd('0x1')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xc4fd('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc4fd('0x3'),'afterDestroy':_0xc4fd('0x4')};function emitEvent(_0x363bd1){return function(_0x14c82a,_0x447f96,_0x2547d5){_0x14c82a[_0xc4fd('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x473a38){_0x14c82a[_0xc4fd('0x6')]('Users',_0x473a38[_0xc4fd('0x7')](function(_0x5b1df4){return{'id':_0x5b1df4['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x14c82a['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc4fd('0x8')](function(_0x3b058e){_0x14c82a[_0xc4fd('0x6')](_0xc4fd('0x9'),_0x3b058e[_0xc4fd('0xa')]);WhatsappInteractionEvents[_0xc4fd('0xb')](_0x363bd1+':'+_0x14c82a['id'],_0x14c82a);WhatsappInteractionEvents[_0xc4fd('0xb')](_0x363bd1,_0x14c82a);_0x2547d5(null);})[_0xc4fd('0xc')](_0x2547d5(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0xc4fd('0xd')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x0490=['findAll','unreadMessages','length','emit','catch','hook','exports','../../mysqldb','save','update','remove','getUsers','then','setDataValue','Users','map'];(function(_0x5ce8b9,_0x5cded8){var _0xe34be0=function(_0xe3d4e5){while(--_0xe3d4e5){_0x5ce8b9['push'](_0x5ce8b9['shift']());}};_0xe34be0(++_0x5cded8);}(_0x0490,0x147));var _0x0049=function(_0x2c86f7,_0x1c010f){_0x2c86f7=_0x2c86f7-0x0;var _0x3e8f1b=_0x0490[_0x2c86f7];return _0x3e8f1b;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x0049('0x0'))['db']['WhatsappInteraction'];var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0049('0x1'),'afterUpdate':_0x0049('0x2'),'afterDestroy':_0x0049('0x3')};function emitEvent(_0x1f3b3c){return function(_0x2872ec,_0x4a59b9,_0x2957b6){_0x2872ec[_0x0049('0x4')]({'attributes':['id'],'raw':!![]})[_0x0049('0x5')](function(_0x57fca5){_0x2872ec[_0x0049('0x6')](_0x0049('0x7'),_0x57fca5[_0x0049('0x8')](function(_0x58f233){return{'id':_0x58f233['id']};}));return WhatsappMessage[_0x0049('0x9')]({'where':{'WhatsappInteractionId':_0x2872ec['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0049('0x5')](function(_0x4165c2){_0x2872ec[_0x0049('0x6')](_0x0049('0xa'),_0x4165c2[_0x0049('0xb')]);WhatsappInteractionEvents[_0x0049('0xc')](_0x1f3b3c+':'+_0x2872ec['id'],_0x2872ec);WhatsappInteractionEvents[_0x0049('0xc')](_0x1f3b3c,_0x2872ec);_0x2957b6(null);})[_0x0049('0xd')](_0x2957b6(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x0049('0xe')](e,emitEvent(event));}}module[_0x0049('0xf')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 264a433..b79d78d 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.model.js +++ b/server/api/whatsappInteraction/whatsappInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x74df=['path','rimraf','../../config/environment','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x74df,0x8b));var _0xf74d=function(_0x4d4608,_0x30a5c6){_0x4d4608=_0x4d4608-0x0;var _0x57c412=_0x74df[_0x4d4608];return _0x57c412;};'use strict';var _=require(_0xf74d('0x0'));var util=require('util');var logger=require(_0xf74d('0x1'))('api');var moment=require(_0xf74d('0x2'));var BPromise=require(_0xf74d('0x3'));var rp=require(_0xf74d('0x4'));var fs=require('fs');var path=require(_0xf74d('0x5'));var rimraf=require(_0xf74d('0x6'));var config=require(_0xf74d('0x7'));var attributes=require('./whatsappInteraction.attributes');module[_0xf74d('0x8')]=function(_0x4f53a3,_0x8b83d1){return _0x4f53a3[_0xf74d('0x9')](_0xf74d('0xa'),attributes,{'tableName':_0xf74d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2d95d3,_0x34c464,_0x2d5fcd){if(_0x2d95d3[_0xf74d('0xc')]('closed')){_0x2d95d3[_0xf74d('0xd')]=moment()[_0xf74d('0xe')](_0xf74d('0xf'));}_0x2d5fcd(null,_0x2d95d3);}}});}; \ No newline at end of file +var _0x7a8b=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappInteraction.attributes','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x3a1fa5,_0x5671ee){var _0x4f99bf=function(_0x77a178){while(--_0x77a178){_0x3a1fa5['push'](_0x3a1fa5['shift']());}};_0x4f99bf(++_0x5671ee);}(_0x7a8b,0x153));var _0xb7a8=function(_0x3f6048,_0x24d122){_0x3f6048=_0x3f6048-0x0;var _0x31d18b=_0x7a8b[_0x3f6048];return _0x31d18b;};'use strict';var _=require(_0xb7a8('0x0'));var util=require(_0xb7a8('0x1'));var logger=require(_0xb7a8('0x2'))(_0xb7a8('0x3'));var moment=require(_0xb7a8('0x4'));var BPromise=require(_0xb7a8('0x5'));var rp=require(_0xb7a8('0x6'));var fs=require('fs');var path=require(_0xb7a8('0x7'));var rimraf=require('rimraf');var config=require(_0xb7a8('0x8'));var attributes=require(_0xb7a8('0x9'));module['exports']=function(_0x366caa,_0x2553f0){return _0x366caa[_0xb7a8('0xa')](_0xb7a8('0xb'),attributes,{'tableName':_0xb7a8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x34b632,_0x118a2e,_0x322f7f){if(_0x34b632[_0xb7a8('0xd')](_0xb7a8('0xe'))){_0x34b632[_0xb7a8('0xf')]=moment()['format'](_0xb7a8('0x10'));}_0x322f7f(null,_0x34b632);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 7bb50ca..3de1b6a 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.rpc.js +++ b/server/api/whatsappInteraction/whatsappInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6412=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','request\x20sent','debug','error','code','message','WhatsappInteraction,\x20%s,\x20%s','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','body','options','raw','where','limit','stringify','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis'];(function(_0x13f9ed,_0x5a8e5e){var _0x94008a=function(_0x19676c){while(--_0x19676c){_0x13f9ed['push'](_0x13f9ed['shift']());}};_0x94008a(++_0x5a8e5e);}(_0x6412,0x14b));var _0x2641=function(_0x5d9223,_0x321924){_0x5d9223=_0x5d9223-0x0;var _0x545225=_0x6412[_0x5d9223];return _0x545225;};'use strict';var _=require('lodash');var util=require(_0x2641('0x0'));var moment=require(_0x2641('0x1'));var BPromise=require(_0x2641('0x2'));var rs=require(_0x2641('0x3'));var fs=require('fs');var Redis=require(_0x2641('0x4'));var db=require(_0x2641('0x5'))['db'];var utils=require(_0x2641('0x6'));var logger=require(_0x2641('0x7'))(_0x2641('0x8'));var config=require('../../config/environment');var jayson=require(_0x2641('0x9'));var client=jayson['client'][_0x2641('0xa')]({'port':0x232a});config[_0x2641('0xb')]=_[_0x2641('0xc')](config[_0x2641('0xb')],{'host':_0x2641('0xd'),'port':0x18eb});var socket=require(_0x2641('0xe'))(new Redis(config[_0x2641('0xb')]));require(_0x2641('0xf'))[_0x2641('0x10')](socket);function respondWithRpcPromise(_0x1197ee,_0x421f38,_0x2965a6){return new BPromise(function(_0x2b8224,_0x4b36c4){return client[_0x2641('0x11')](_0x1197ee,_0x2965a6)[_0x2641('0x12')](function(_0x19c8c4){logger[_0x2641('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x421f38,_0x2641('0x14'));logger[_0x2641('0x15')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x421f38,_0x2641('0x14'),JSON['stringify'](_0x19c8c4));if(_0x19c8c4[_0x2641('0x16')]){if(_0x19c8c4['error'][_0x2641('0x17')]===0x1f4){logger[_0x2641('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0x421f38,_0x19c8c4[_0x2641('0x16')][_0x2641('0x18')]);return _0x4b36c4(_0x19c8c4[_0x2641('0x16')][_0x2641('0x18')]);}logger[_0x2641('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0x421f38,_0x19c8c4[_0x2641('0x16')][_0x2641('0x18')]);return _0x2b8224(_0x19c8c4[_0x2641('0x16')][_0x2641('0x18')]);}else{logger[_0x2641('0x13')](_0x2641('0x19'),_0x421f38,'request\x20sent');_0x2b8224(_0x19c8c4[_0x2641('0x1a')][_0x2641('0x18')]);}})[_0x2641('0x1b')](function(_0x46f694){logger[_0x2641('0x16')](_0x2641('0x19'),_0x421f38,_0x46f694);_0x4b36c4(_0x46f694);});});}exports[_0x2641('0x1c')]=function(_0x30b8ac){var _0x4ae379=this;return new Promise(function(_0xd8776c,_0x5bc68f){return db[_0x2641('0x1d')]['update'](_0x30b8ac[_0x2641('0x1e')],{'raw':_0x30b8ac[_0x2641('0x1f')]?_0x30b8ac[_0x2641('0x1f')][_0x2641('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30b8ac[_0x2641('0x1f')]?_0x30b8ac[_0x2641('0x1f')][_0x2641('0x21')]||null:null,'attributes':_0x30b8ac[_0x2641('0x1f')]?_0x30b8ac[_0x2641('0x1f')]['attributes']||null:null,'limit':_0x30b8ac[_0x2641('0x1f')]?_0x30b8ac[_0x2641('0x1f')][_0x2641('0x22')]||null:null})[_0x2641('0x12')](function(_0x330073){logger[_0x2641('0x13')](_0x2641('0x1c'),_0x30b8ac);logger[_0x2641('0x15')](_0x2641('0x1c'),_0x30b8ac,JSON[_0x2641('0x23')](_0x330073));_0xd8776c(_0x330073);})[_0x2641('0x1b')](function(_0x46c971){logger[_0x2641('0x16')]('UpdateWhatsappInteraction',_0x46c971[_0x2641('0x18')],_0x30b8ac);_0x5bc68f(_0x4ae379[_0x2641('0x16')](0x1f4,_0x46c971[_0x2641('0x18')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x3f794d){return new Promise(function(_0xd4588e,_0x5b263c){return db[_0x2641('0x1d')][_0x2641('0x24')]({'where':_0x3f794d[_0x2641('0x1f')]?_0x3f794d['options'][_0x2641('0x21')]||null:null})[_0x2641('0x12')](function(_0x3fbab9){if(_0x3fbab9){return _0x3fbab9[_0x2641('0x25')](_0x3f794d[_0x2641('0x1e')][_0x2641('0x26')],_[_0x2641('0x27')](_0x3f794d['body'],[_0x2641('0x26'),'id'])||{});}})[_0x2641('0x28')](function(_0x135b85){logger['info'](_0x2641('0x29'),_0x3f794d);logger[_0x2641('0x15')](_0x2641('0x29'),_0x3f794d,JSON[_0x2641('0x23')](_0x135b85));_0xd4588e(_0x135b85);})[_0x2641('0x1b')](function(_0x1680ce){logger[_0x2641('0x16')]('AddTags',_0x1680ce[_0x2641('0x18')],_0x3f794d);_0x5b263c(_this[_0x2641('0x16')](0x1f4,_0x1680ce['message']));});});}; \ No newline at end of file +var _0x70a4=['moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','./whatsappInteraction.socket','register','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','raw','options','where','limit','stringify','AddTagsToWhatsappInteraction','find','addTags','ids','spread','AddTags','util'];(function(_0x9f27a3,_0x3716d9){var _0x1e712e=function(_0x5cb75a){while(--_0x5cb75a){_0x9f27a3['push'](_0x9f27a3['shift']());}};_0x1e712e(++_0x3716d9);}(_0x70a4,0x71));var _0x470a=function(_0x8ef16d,_0x37ab0c){_0x8ef16d=_0x8ef16d-0x0;var _0x4f26c6=_0x70a4[_0x8ef16d];return _0x4f26c6;};'use strict';var _=require('lodash');var util=require(_0x470a('0x0'));var moment=require(_0x470a('0x1'));var BPromise=require(_0x470a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x470a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x470a('0x4'));var config=require(_0x470a('0x5'));var jayson=require(_0x470a('0x6'));var client=jayson[_0x470a('0x7')]['http']({'port':0x232a});config['redis']=_[_0x470a('0x8')](config[_0x470a('0x9')],{'host':_0x470a('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x470a('0x9')]));require(_0x470a('0xb'))[_0x470a('0xc')](socket);function respondWithRpcPromise(_0x29e044,_0x403f76,_0x211d5c){return new BPromise(function(_0x29424f,_0xd2d125){return client['request'](_0x29e044,_0x211d5c)[_0x470a('0xd')](function(_0x2b6f77){logger['info'](_0x470a('0xe'),_0x403f76,_0x470a('0xf'));logger[_0x470a('0x10')](_0x470a('0x11'),_0x403f76,_0x470a('0xf'),JSON['stringify'](_0x2b6f77));if(_0x2b6f77[_0x470a('0x12')]){if(_0x2b6f77['error']['code']===0x1f4){logger[_0x470a('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x403f76,_0x2b6f77[_0x470a('0x12')][_0x470a('0x13')]);return _0xd2d125(_0x2b6f77[_0x470a('0x12')][_0x470a('0x13')]);}logger[_0x470a('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x403f76,_0x2b6f77['error']['message']);return _0x29424f(_0x2b6f77[_0x470a('0x12')][_0x470a('0x13')]);}else{logger[_0x470a('0x14')](_0x470a('0xe'),_0x403f76,_0x470a('0xf'));_0x29424f(_0x2b6f77[_0x470a('0x15')][_0x470a('0x13')]);}})[_0x470a('0x16')](function(_0x479461){logger[_0x470a('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x403f76,_0x479461);_0xd2d125(_0x479461);});});}exports[_0x470a('0x17')]=function(_0x7e4eba){var _0x3e48a2=this;return new Promise(function(_0x604170,_0x44b091){return db[_0x470a('0x18')][_0x470a('0x19')](_0x7e4eba[_0x470a('0x1a')],{'raw':_0x7e4eba['options']?_0x7e4eba['options'][_0x470a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7e4eba[_0x470a('0x1c')]?_0x7e4eba['options'][_0x470a('0x1d')]||null:null,'attributes':_0x7e4eba[_0x470a('0x1c')]?_0x7e4eba[_0x470a('0x1c')]['attributes']||null:null,'limit':_0x7e4eba[_0x470a('0x1c')]?_0x7e4eba['options'][_0x470a('0x1e')]||null:null})[_0x470a('0xd')](function(_0x2ef41b){logger['info'](_0x470a('0x17'),_0x7e4eba);logger[_0x470a('0x10')](_0x470a('0x17'),_0x7e4eba,JSON[_0x470a('0x1f')](_0x2ef41b));_0x604170(_0x2ef41b);})[_0x470a('0x16')](function(_0x4a4213){logger['error'](_0x470a('0x17'),_0x4a4213[_0x470a('0x13')],_0x7e4eba);_0x44b091(_0x3e48a2[_0x470a('0x12')](0x1f4,_0x4a4213[_0x470a('0x13')]));});});};exports[_0x470a('0x20')]=function(_0x2f5ea8){return new Promise(function(_0x2ba687,_0x2fc37a){return db[_0x470a('0x18')][_0x470a('0x21')]({'where':_0x2f5ea8['options']?_0x2f5ea8[_0x470a('0x1c')][_0x470a('0x1d')]||null:null})[_0x470a('0xd')](function(_0x147db4){if(_0x147db4){return _0x147db4[_0x470a('0x22')](_0x2f5ea8[_0x470a('0x1a')][_0x470a('0x23')],_['omit'](_0x2f5ea8[_0x470a('0x1a')],[_0x470a('0x23'),'id'])||{});}})[_0x470a('0x24')](function(_0x19eabe){logger[_0x470a('0x14')](_0x470a('0x25'),_0x2f5ea8);logger[_0x470a('0x10')](_0x470a('0x25'),_0x2f5ea8,JSON[_0x470a('0x1f')](_0x19eabe));_0x2ba687(_0x19eabe);})[_0x470a('0x16')](function(_0x11656e){logger[_0x470a('0x12')](_0x470a('0x25'),_0x11656e[_0x470a('0x13')],_0x2f5ea8);_0x2fc37a(_this[_0x470a('0x12')](0x1f4,_0x11656e['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 954e6ab..95b6b55 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.socket.js +++ b/server/api/whatsappInteraction/whatsappInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb888=['whatsappInteraction:','./whatsappInteraction.events','update','emit','length'];(function(_0x31cf9b,_0x5de5fb){var _0x29950b=function(_0x3c9b21){while(--_0x3c9b21){_0x31cf9b['push'](_0x31cf9b['shift']());}};_0x29950b(++_0x5de5fb);}(_0xb888,0x173));var _0x8b88=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb888[_0x321bb2];return _0x9c12ed;};'use strict';var WhatsappInteractionEvents=require(_0x8b88('0x0'));var events=['save','remove',_0x8b88('0x1')];function createListener(_0x1104fd,_0x5739d9){return function(_0x30b5db){_0x5739d9[_0x8b88('0x2')](_0x1104fd,_0x30b5db);};}function removeListener(_0x45fc1a,_0x4f0adf){return function(){WhatsappInteractionEvents['removeListener'](_0x45fc1a,_0x4f0adf);};}exports['register']=function(_0x35b064){for(var _0xf6b3f=0x0,_0x5cb59a=events[_0x8b88('0x3')];_0xf6b3f<_0x5cb59a;_0xf6b3f++){var _0x33450f=events[_0xf6b3f];var _0x3d44d6=createListener(_0x8b88('0x4')+_0x33450f,_0x35b064);WhatsappInteractionEvents['on'](_0x33450f,_0x3d44d6);}}; \ No newline at end of file +var _0xaf71=['./whatsappInteraction.events','save','remove','update','register','length'];(function(_0x492b4f,_0x39c84c){var _0x480b68=function(_0x1e5e65){while(--_0x1e5e65){_0x492b4f['push'](_0x492b4f['shift']());}};_0x480b68(++_0x39c84c);}(_0xaf71,0x1d4));var _0x1af7=function(_0x4580d4,_0xb4514f){_0x4580d4=_0x4580d4-0x0;var _0x48ce72=_0xaf71[_0x4580d4];return _0x48ce72;};'use strict';var WhatsappInteractionEvents=require(_0x1af7('0x0'));var events=[_0x1af7('0x1'),_0x1af7('0x2'),_0x1af7('0x3')];function createListener(_0x4658c2,_0x3ab533){return function(_0x3df292){_0x3ab533['emit'](_0x4658c2,_0x3df292);};}function removeListener(_0x1e435f,_0xab0c29){return function(){WhatsappInteractionEvents['removeListener'](_0x1e435f,_0xab0c29);};}exports[_0x1af7('0x4')]=function(_0x132088){for(var _0x39151d=0x0,_0x51dbc8=events[_0x1af7('0x5')];_0x39151d<_0x51dbc8;_0x39151d++){var _0xade44f=events[_0x39151d];var _0x17aec6=createListener('whatsappInteraction:'+_0xade44f,_0x132088);WhatsappInteractionEvents['on'](_0xade44f,_0x17aec6);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index fc963f2..4af116f 100644 --- a/server/api/whatsappMessage/index.js +++ b/server/api/whatsappMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc82e=['whatsappmessage:create','post','/:id/status','put','update','/:id/accept','accept','/:id/reject','reject','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','get','isAuthenticated','/describe','describe','/:id','tracked','whatsapp'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xc82e,0x1d5));var _0xec82=function(_0x456c2a,_0x2aa589){_0x456c2a=_0x456c2a-0x0;var _0x4997c2=_0xc82e[_0x456c2a];return _0x4997c2;};'use strict';var multer=require(_0xec82('0x0'));var util=require(_0xec82('0x1'));var path=require(_0xec82('0x2'));var timeout=require(_0xec82('0x3'));var express=require(_0xec82('0x4'));var router=express[_0xec82('0x5')]();var fs_extra=require(_0xec82('0x6'));var auth=require(_0xec82('0x7'));var interaction=require(_0xec82('0x8'));var config=require('../../config/environment');var controller=require(_0xec82('0x9'));router[_0xec82('0xa')]('/',auth[_0xec82('0xb')](),controller['index']);router[_0xec82('0xa')](_0xec82('0xc'),auth[_0xec82('0xb')](),controller[_0xec82('0xd')]);router[_0xec82('0xa')](_0xec82('0xe'),auth[_0xec82('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),interaction[_0xec82('0xf')](_0xec82('0x10'),_0xec82('0x11')),controller['create']);router[_0xec82('0x12')](_0xec82('0x13'),controller['status']);router[_0xec82('0x14')]('/:id',auth[_0xec82('0xb')](),controller[_0xec82('0x15')]);router['put'](_0xec82('0x16'),auth[_0xec82('0xb')](),controller[_0xec82('0x17')]);router[_0xec82('0x14')](_0xec82('0x18'),auth[_0xec82('0xb')](),controller[_0xec82('0x19')]);router['delete'](_0xec82('0xe'),auth[_0xec82('0xb')](),controller['destroy']);module[_0xec82('0x1a')]=router; \ No newline at end of file +var _0x1e34=['describe','/:id','show','post','tracked','whatsappmessage:create','create','/:id/status','status','put','update','/:id/accept','accept','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe'];(function(_0x53dd6c,_0x33a01c){var _0xbd4dfd=function(_0x1e2d9d){while(--_0x1e2d9d){_0x53dd6c['push'](_0x53dd6c['shift']());}};_0xbd4dfd(++_0x33a01c);}(_0x1e34,0x142));var _0x41e3=function(_0x3ca537,_0x134673){_0x3ca537=_0x3ca537-0x0;var _0x526676=_0x1e34[_0x3ca537];return _0x526676;};'use strict';var multer=require(_0x41e3('0x0'));var util=require(_0x41e3('0x1'));var path=require(_0x41e3('0x2'));var timeout=require(_0x41e3('0x3'));var express=require(_0x41e3('0x4'));var router=express[_0x41e3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x41e3('0x6'));var interaction=require(_0x41e3('0x7'));var config=require(_0x41e3('0x8'));var controller=require(_0x41e3('0x9'));router[_0x41e3('0xa')]('/',auth[_0x41e3('0xb')](),controller[_0x41e3('0xc')]);router[_0x41e3('0xa')](_0x41e3('0xd'),auth[_0x41e3('0xb')](),controller[_0x41e3('0xe')]);router[_0x41e3('0xa')](_0x41e3('0xf'),auth[_0x41e3('0xb')](),controller[_0x41e3('0x10')]);router[_0x41e3('0x11')]('/',auth['isAuthenticated'](),interaction[_0x41e3('0x12')]('whatsapp',_0x41e3('0x13')),controller[_0x41e3('0x14')]);router[_0x41e3('0x11')](_0x41e3('0x15'),controller[_0x41e3('0x16')]);router[_0x41e3('0x17')](_0x41e3('0xf'),auth[_0x41e3('0xb')](),controller[_0x41e3('0x18')]);router[_0x41e3('0x17')](_0x41e3('0x19'),auth[_0x41e3('0xb')](),controller[_0x41e3('0x1a')]);router[_0x41e3('0x17')]('/:id/reject',auth[_0x41e3('0xb')](),controller['reject']);router['delete'](_0x41e3('0xf'),auth[_0x41e3('0xb')](),controller['destroy']);module[_0x41e3('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 9f6f3e2..f983c1e 100644 --- a/server/api/whatsappMessage/whatsappMessage.attributes.js +++ b/server/api/whatsappMessage/whatsappMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac95=['sequelize','exports','TEXT','medium','out','STRING','DATE'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0xac95,0xa8));var _0x5ac9=function(_0x7e3f8c,_0x2b2263){_0x7e3f8c=_0x7e3f8c-0x0;var _0x5120db=_0xac95[_0x7e3f8c];return _0x5120db;};'use strict';var Sequelize=require(_0x5ac9('0x0'));module[_0x5ac9('0x1')]={'body':{'type':Sequelize[_0x5ac9('0x2')](_0x5ac9('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x5ac9('0x4')),'defaultValue':_0x5ac9('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x5ac9('0x5')]},'readAt':{'type':Sequelize[_0x5ac9('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x5ac9('0x5')]},'providerResponse':{'type':Sequelize[_0x5ac9('0x2')]}}; \ No newline at end of file +var _0x0dee=['STRING','DATE','sequelize','exports','medium','ENUM','out'];(function(_0x405a85,_0x3c6aa1){var _0xd9104b=function(_0x4cb15a){while(--_0x4cb15a){_0x405a85['push'](_0x405a85['shift']());}};_0xd9104b(++_0x3c6aa1);}(_0x0dee,0xf7));var _0xe0de=function(_0x330198,_0x2ab7d6){_0x330198=_0x330198-0x0;var _0x2ea21a=_0x0dee[_0x330198];return _0x2ea21a;};'use strict';var Sequelize=require(_0xe0de('0x0'));module[_0xe0de('0x1')]={'body':{'type':Sequelize['TEXT'](_0xe0de('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xe0de('0x3')]('in',_0xe0de('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xe0de('0x5')](0xbe)},'phone':{'type':Sequelize[_0xe0de('0x5')]},'readAt':{'type':Sequelize[_0xe0de('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xe0de('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index c356d46..3d7d9af 100644 --- a/server/api/whatsappMessage/whatsappMessage.controller.js +++ b/server/api/whatsappMessage/whatsappMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcc93=['../../config/logger','whatsapp-interactions','accept','whatsapp','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','SELECT','event','reject','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','inspect','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','client','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','end','stack','name','send','index','map','WhatsappMessage','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','create','body'];(function(_0xd06df9,_0x42eb29){var _0x144a22=function(_0x4634a2){while(--_0x4634a2){_0xd06df9['push'](_0xd06df9['shift']());}};_0x144a22(++_0x42eb29);}(_0xcc93,0x149));var _0x3cc9=function(_0x4824e0,_0x14b881){_0x4824e0=_0x4824e0-0x0;var _0x281b25=_0xcc93[_0x4824e0];return _0x281b25;};'use strict';var emlformat=require(_0x3cc9('0x0'));var rimraf=require(_0x3cc9('0x1'));var zipdir=require(_0x3cc9('0x2'));var jsonpatch=require(_0x3cc9('0x3'));var rp=require(_0x3cc9('0x4'));var moment=require(_0x3cc9('0x5'));var BPromise=require(_0x3cc9('0x6'));var Mustache=require(_0x3cc9('0x7'));var util=require('util');var path=require(_0x3cc9('0x8'));var sox=require('sox');var csv=require(_0x3cc9('0x9'));var ejs=require(_0x3cc9('0xa'));var fs=require('fs');var fs_extra=require(_0x3cc9('0xb'));var _=require('lodash');var squel=require(_0x3cc9('0xc'));var crypto=require(_0x3cc9('0xd'));var jsforce=require(_0x3cc9('0xe'));var deskjs=require(_0x3cc9('0xf'));var toCsv=require(_0x3cc9('0x9'));var querystring=require(_0x3cc9('0x10'));var Papa=require(_0x3cc9('0x11'));var Redis=require('ioredis');var authService=require(_0x3cc9('0x12'));var qs=require(_0x3cc9('0x13'));var as=require(_0x3cc9('0x14'));var hardwareService=require(_0x3cc9('0x15'));var logger=require('../../config/logger')(_0x3cc9('0x16'));var utils=require('../../config/utils');var config=require(_0x3cc9('0x17'));var licenseUtil=require(_0x3cc9('0x18'));var db=require(_0x3cc9('0x19'))['db'];config[_0x3cc9('0x1a')]=_[_0x3cc9('0x1b')](config['redis'],{'host':_0x3cc9('0x1c'),'port':0x18eb});var socket=require(_0x3cc9('0x1d'))(new Redis(config[_0x3cc9('0x1a')]));require('./whatsappMessage.socket')[_0x3cc9('0x1e')](socket);var jayson=require(_0x3cc9('0x1f'));var client=jayson['client'][_0x3cc9('0x20')]({'port':0x232c});var client9002=jayson[_0x3cc9('0x21')][_0x3cc9('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x673839,_0x177684,_0x40a9bc,_0x346cd6){return new BPromise(function(_0x535120,_0x15a1d5){var _0x36a45f=_0x346cd6||client;return _0x36a45f[_0x3cc9('0x22')](_0x673839,_0x40a9bc)['then'](function(_0x4183d8){logger[_0x3cc9('0x23')](_0x3cc9('0x24'),_0x177684,_0x3cc9('0x25'));logger[_0x3cc9('0x26')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x177684,_0x3cc9('0x25'),JSON[_0x3cc9('0x27')](_0x4183d8));if(_0x4183d8[_0x3cc9('0x28')]){if(_0x4183d8['error'][_0x3cc9('0x29')]===0x1f4){logger[_0x3cc9('0x28')](_0x3cc9('0x24'),_0x177684,_0x4183d8[_0x3cc9('0x28')][_0x3cc9('0x2a')]);return _0x15a1d5(_0x4183d8[_0x3cc9('0x28')][_0x3cc9('0x2a')]);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x177684,_0x4183d8[_0x3cc9('0x28')]['message']);return _0x535120(_0x4183d8['error'][_0x3cc9('0x2a')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x177684,_0x3cc9('0x25'));_0x535120(_0x4183d8[_0x3cc9('0x2b')][_0x3cc9('0x2a')]);}})[_0x3cc9('0x2c')](function(_0x591da4){logger['error'](_0x3cc9('0x24'),_0x177684,_0x591da4);_0x15a1d5(_0x591da4);});});}function respondWithStatusCode(_0x1695d4,_0x1f3952){_0x1f3952=_0x1f3952||0xcc;return function(_0x10fb31){if(_0x10fb31){return _0x1695d4[_0x3cc9('0x2d')](_0x1f3952);}return _0x1695d4['status'](_0x1f3952)['end']();};}function respondWithResult(_0x4bbbe8,_0x1e4923){_0x1e4923=_0x1e4923||0xc8;return function(_0x3b46e){if(_0x3b46e){return _0x4bbbe8[_0x3cc9('0x2e')](_0x1e4923)[_0x3cc9('0x2f')](_0x3b46e);}};}function respondWithFilteredResult(_0x83df48,_0x21823e){return function(_0x589e09){if(_0x589e09){var _0x3e1139=typeof _0x21823e['offset']===_0x3cc9('0x30')&&typeof _0x21823e[_0x3cc9('0x31')]===_0x3cc9('0x30');var _0x40e124=_0x589e09[_0x3cc9('0x32')];var _0x59a827=_0x3e1139?0x0:_0x21823e[_0x3cc9('0x33')];var _0x18f692=_0x3e1139?_0x589e09[_0x3cc9('0x32')]:_0x21823e[_0x3cc9('0x33')]+_0x21823e[_0x3cc9('0x31')];var _0x4575bd;if(_0x18f692>=_0x40e124){_0x18f692=_0x40e124;_0x4575bd=0xc8;}else{_0x4575bd=0xce;}_0x83df48['status'](_0x4575bd);return _0x83df48[_0x3cc9('0x34')](_0x3cc9('0x35'),_0x59a827+'-'+_0x18f692+'/'+_0x40e124)[_0x3cc9('0x2f')](_0x589e09);}return null;};}function patchUpdates(_0x3bdfbe){return function(_0x46575e){try{jsonpatch[_0x3cc9('0x36')](_0x46575e,_0x3bdfbe,!![]);}catch(_0x326266){return BPromise['reject'](_0x326266);}return _0x46575e[_0x3cc9('0x37')]();};}function saveUpdates(_0xf307ba,_0x4cf950){return function(_0x526d9d){if(_0x526d9d){return _0x526d9d[_0x3cc9('0x38')](_0xf307ba)[_0x3cc9('0x39')](function(_0x4ebcf5){return _0x4ebcf5;});}return null;};}function removeEntity(_0x2decd0,_0x2f083a){return function(_0x119c57){if(_0x119c57){return _0x119c57[_0x3cc9('0x3a')]()[_0x3cc9('0x39')](function(){_0x2decd0[_0x3cc9('0x2e')](0xcc)[_0x3cc9('0x3b')]();});}};}function handleEntityNotFound(_0x4c771b,_0x3aa7da){return function(_0x1b6352){if(!_0x1b6352){_0x4c771b['sendStatus'](0x194);}return _0x1b6352;};}function handleError(_0x4f1cf1,_0x482b93){_0x482b93=_0x482b93||0x1f4;return function(_0x538d1c){logger[_0x3cc9('0x28')](_0x538d1c[_0x3cc9('0x3c')]);if(_0x538d1c['name']){delete _0x538d1c[_0x3cc9('0x3d')];}_0x4f1cf1['status'](_0x482b93)[_0x3cc9('0x3e')](_0x538d1c);};}exports[_0x3cc9('0x3f')]=function(_0x3d0756,_0x5ba243){var _0x581b12={},_0x2bac21={},_0x3c5c3b={'count':0x0,'rows':[]};var _0x18fef1=_[_0x3cc9('0x40')](db[_0x3cc9('0x41')][_0x3cc9('0x42')],function(_0x17a50f){return{'name':_0x17a50f['fieldName'],'type':_0x17a50f[_0x3cc9('0x43')]['key']};});_0x2bac21[_0x3cc9('0x44')]=_[_0x3cc9('0x40')](_0x18fef1,_0x3cc9('0x3d'));_0x2bac21[_0x3cc9('0x45')]=_[_0x3cc9('0x46')](_0x3d0756[_0x3cc9('0x45')]);_0x2bac21[_0x3cc9('0x47')]=_[_0x3cc9('0x48')](_0x2bac21[_0x3cc9('0x44')],_0x2bac21[_0x3cc9('0x45')]);_0x581b12[_0x3cc9('0x49')]=_[_0x3cc9('0x48')](_0x2bac21[_0x3cc9('0x44')],qs[_0x3cc9('0x4a')](_0x3d0756[_0x3cc9('0x45')][_0x3cc9('0x4a')]));_0x581b12[_0x3cc9('0x49')]=_0x581b12[_0x3cc9('0x49')][_0x3cc9('0x4b')]?_0x581b12[_0x3cc9('0x49')]:_0x2bac21['model'];if(!_0x3d0756[_0x3cc9('0x45')][_0x3cc9('0x4c')](_0x3cc9('0x4d'))){_0x581b12[_0x3cc9('0x31')]=qs[_0x3cc9('0x31')](_0x3d0756[_0x3cc9('0x45')][_0x3cc9('0x31')]);_0x581b12[_0x3cc9('0x33')]=qs[_0x3cc9('0x33')](_0x3d0756[_0x3cc9('0x45')][_0x3cc9('0x33')]);}_0x581b12[_0x3cc9('0x4e')]=qs[_0x3cc9('0x4f')](_0x3d0756[_0x3cc9('0x45')][_0x3cc9('0x4f')]);_0x581b12[_0x3cc9('0x50')]=qs[_0x3cc9('0x47')](_['pick'](_0x3d0756[_0x3cc9('0x45')],_0x2bac21['filters']),_0x18fef1);if(_0x3d0756[_0x3cc9('0x45')]['filter']){_0x581b12[_0x3cc9('0x50')]=_[_0x3cc9('0x51')](_0x581b12[_0x3cc9('0x50')],{'$or':_[_0x3cc9('0x40')](_0x18fef1,function(_0x55a836){if(_0x55a836['type']!==_0x3cc9('0x52')){var _0x11410f={};_0x11410f[_0x55a836[_0x3cc9('0x3d')]]={'$like':'%'+_0x3d0756[_0x3cc9('0x45')][_0x3cc9('0x53')]+'%'};return _0x11410f;}})});}_0x581b12=_[_0x3cc9('0x51')]({},_0x581b12,_0x3d0756[_0x3cc9('0x54')]);var _0x130dc4={'where':_0x581b12[_0x3cc9('0x50')]};return db[_0x3cc9('0x41')]['count'](_0x130dc4)[_0x3cc9('0x39')](function(_0x393bbf){_0x3c5c3b[_0x3cc9('0x32')]=_0x393bbf;if(_0x3d0756[_0x3cc9('0x45')][_0x3cc9('0x55')]){_0x581b12[_0x3cc9('0x56')]=[{'all':!![]}];}return db[_0x3cc9('0x41')][_0x3cc9('0x57')](_0x581b12);})[_0x3cc9('0x39')](function(_0xfcde47){_0x3c5c3b[_0x3cc9('0x58')]=_0xfcde47;return _0x3c5c3b;})[_0x3cc9('0x39')](respondWithFilteredResult(_0x5ba243,_0x581b12))[_0x3cc9('0x2c')](handleError(_0x5ba243,null));};exports[_0x3cc9('0x59')]=function(_0x445ba5,_0xf2ff8d){var _0x2f69df={'raw':!![],'where':{'id':_0x445ba5[_0x3cc9('0x5a')]['id']}},_0x9c64be={};_0x9c64be[_0x3cc9('0x44')]=_['keys'](db[_0x3cc9('0x41')][_0x3cc9('0x42')]);_0x9c64be[_0x3cc9('0x45')]=_[_0x3cc9('0x46')](_0x445ba5['query']);_0x9c64be['filters']=_[_0x3cc9('0x48')](_0x9c64be[_0x3cc9('0x44')],_0x9c64be[_0x3cc9('0x45')]);_0x2f69df[_0x3cc9('0x49')]=_[_0x3cc9('0x48')](_0x9c64be['model'],qs['fields'](_0x445ba5['query']['fields']));_0x2f69df[_0x3cc9('0x49')]=_0x2f69df[_0x3cc9('0x49')][_0x3cc9('0x4b')]?_0x2f69df['attributes']:_0x9c64be[_0x3cc9('0x44')];if(_0x445ba5['query'][_0x3cc9('0x55')]){_0x2f69df[_0x3cc9('0x56')]=[{'all':!![]}];}_0x2f69df=_['merge']({},_0x2f69df,_0x445ba5['options']);return db[_0x3cc9('0x41')][_0x3cc9('0x5b')](_0x2f69df)[_0x3cc9('0x39')](handleEntityNotFound(_0xf2ff8d,null))[_0x3cc9('0x39')](respondWithResult(_0xf2ff8d,null))[_0x3cc9('0x2c')](handleError(_0xf2ff8d,null));};exports[_0x3cc9('0x5c')]=function(_0x3f9f95,_0x27d0aa){return db['WhatsappMessage'][_0x3cc9('0x5c')](_0x3f9f95[_0x3cc9('0x5d')],{})['then'](respondWithResult(_0x27d0aa,0xc9))['catch'](handleError(_0x27d0aa,null));};exports['update']=function(_0x3de567,_0x250ebd){if(_0x3de567[_0x3cc9('0x5d')]['id']){delete _0x3de567[_0x3cc9('0x5d')]['id'];}return db['WhatsappMessage']['find']({'where':{'id':_0x3de567[_0x3cc9('0x5a')]['id']}})['then'](handleEntityNotFound(_0x250ebd,null))[_0x3cc9('0x39')](saveUpdates(_0x3de567[_0x3cc9('0x5d')],null))['then'](respondWithResult(_0x250ebd,null))[_0x3cc9('0x2c')](handleError(_0x250ebd,null));};exports[_0x3cc9('0x3a')]=function(_0x799d1f,_0x34221c){return db['WhatsappMessage']['find']({'where':{'id':_0x799d1f['params']['id']}})[_0x3cc9('0x39')](handleEntityNotFound(_0x34221c,null))[_0x3cc9('0x39')](removeEntity(_0x34221c,null))[_0x3cc9('0x2c')](handleError(_0x34221c,null));};exports['describe']=function(_0x233304,_0x170d88){return db[_0x3cc9('0x41')]['describe']()['then'](respondWithResult(_0x170d88,null))['catch'](handleError(_0x170d88,null));};var interaction_log=require(_0x3cc9('0x5e'))(_0x3cc9('0x5f'));exports[_0x3cc9('0x60')]=function(_0x2a79ba,_0x475b77,_0x289049){var _0x48c56c={'agent':{},'channel':_0x3cc9('0x61')};if(_0x2a79ba[_0x3cc9('0x5d')]['id']){delete _0x2a79ba['body']['id'];}_0x2a79ba[_0x3cc9('0x5d')][_0x3cc9('0x62')]=!![];_0x2a79ba[_0x3cc9('0x5d')]['readAt']=moment()[_0x3cc9('0x63')](_0x3cc9('0x64'));_0x2a79ba[_0x3cc9('0x5d')][_0x3cc9('0x65')]=_0x2a79ba['body'][_0x3cc9('0x65')]||_0x2a79ba['user']['id'];_0x48c56c[_0x3cc9('0x66')]['id']=_0x2a79ba[_0x3cc9('0x5d')][_0x3cc9('0x65')];return db[_0x3cc9('0x41')][_0x3cc9('0x5b')]({'where':{'id':_0x2a79ba[_0x3cc9('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x475b77,null))[_0x3cc9('0x39')](saveUpdates(_0x2a79ba[_0x3cc9('0x5d')],null))[_0x3cc9('0x39')](function(_0x33152d){if(_0x33152d){_0x48c56c[_0x3cc9('0x2a')]=_0x33152d[_0x3cc9('0x67')]({'plain':!![]});return db[_0x3cc9('0x68')][_0x3cc9('0x5b')]({'where':{'id':_0x33152d[_0x3cc9('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x475b77,null))['then'](function(_0x138d52){if(_0x138d52){return _0x138d52[_0x3cc9('0x38')]({'UserId':_0x2a79ba['body']['UserId'],'read1stAt':_[_0x3cc9('0x6a')](_0x138d52['read1stAt'])?moment()[_0x3cc9('0x63')](_0x3cc9('0x64')):undefined});}return null;})[_0x3cc9('0x39')](function(_0x53436b){if(_0x53436b){_0x48c56c[_0x3cc9('0x6b')]=_0x53436b['get']({'plain':!![]});interaction_log[_0x3cc9('0x23')](_0x3cc9('0x6c'),_0x2a79ba[_0x3cc9('0x6d')]['id'],_0x2a79ba['user'][_0x3cc9('0x3d')],_0x2a79ba[_0x3cc9('0x6d')]['role'],_0x48c56c[_0x3cc9('0x6b')]['id'],_0x2a79ba['body']?JSON['stringify'](_0x2a79ba[_0x3cc9('0x5d')]):_0x3cc9('0x6e'));return respondWithRpcPromise(_0x3cc9('0x6f'),'acceptMessage',_0x48c56c);}return null;})[_0x3cc9('0x39')](function(_0x439e58){var _0x2cfecf=_0x3cc9('0x70')+_0x439e58[_0x3cc9('0x2a')][_0x3cc9('0x71')];return db[_0x3cc9('0x72')]['query'](_0x2cfecf,{'type':db['Sequelize'][_0x3cc9('0x73')]['SELECT'],'raw':!![]})['then'](function(_0x2516bc){return _0x2516bc;});})[_0x3cc9('0x39')](function(_0xa51014){if(_0xa51014){_0x48c56c[_0x3cc9('0x2a')][_0x3cc9('0x74')]=_0xa51014[0x0];if(!_0x2a79ba[_0x3cc9('0x5d')][_0x3cc9('0x65')])return;return db['User']['find']({'where':{'id':_0x2a79ba[_0x3cc9('0x5d')][_0x3cc9('0x65')],'role':'agent'},'attributes':['id',_0x3cc9('0x3d'),_0x3cc9('0x75'),_0x3cc9('0x76'),_0x3cc9('0x77')],'raw':!![]});}return null;})[_0x3cc9('0x39')](function(_0x1198b5){if(!_0x1198b5)return null;_0x48c56c[_0x3cc9('0x2a')]['agent']=_0x1198b5;return _0x48c56c;})[_0x3cc9('0x39')](function(_0x4af76f){if(_0x4af76f){if(_0x2a79ba[_0x3cc9('0x5d')][_0x3cc9('0x78')]){_0x48c56c[_0x3cc9('0x2a')][_0x3cc9('0x79')]=util[_0x3cc9('0x63')](_0x3cc9('0x7a'),_0x2a79ba[_0x3cc9('0x6d')]['name']);_0x48c56c[_0x3cc9('0x2a')][_0x3cc9('0x7b')]=_0x48c56c[_0x3cc9('0x7b')];_0x48c56c[_0x3cc9('0x2a')][_0x3cc9('0x7c')]=_0x48c56c['channel'];_0x48c56c[_0x3cc9('0x2a')]['event']=_0x3cc9('0x60');return respondWithRpcPromise(_0x3cc9('0x7d'),_0x3cc9('0x7d'),{'event':'acceptmessage','message':_0x48c56c['message']},client9002)[_0x3cc9('0x39')](function(){return _0x48c56c;});}return _0x48c56c;}return null;})[_0x3cc9('0x39')](respondWithResult(_0x475b77,null))[_0x3cc9('0x2c')](handleError(_0x475b77,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports['reject']=function(_0x4aba3e,_0x597258,_0x20af55){var _0x5a00ae={'agent':{},'channel':_0x3cc9('0x61')};if(_0x4aba3e['body']['id']){delete _0x4aba3e[_0x3cc9('0x5d')]['id'];}_0x4aba3e[_0x3cc9('0x5d')][_0x3cc9('0x65')]=_0x4aba3e[_0x3cc9('0x5d')][_0x3cc9('0x65')]||_0x4aba3e[_0x3cc9('0x6d')]['id'];_0x5a00ae[_0x3cc9('0x66')]['id']=_0x4aba3e['body'][_0x3cc9('0x65')];return db[_0x3cc9('0x41')][_0x3cc9('0x5b')]({'where':{'id':_0x4aba3e[_0x3cc9('0x5a')]['id'],'UserId':null}})[_0x3cc9('0x39')](handleEntityNotFound(_0x597258,null))['then'](function(_0xb9bf90){if(_0xb9bf90){_0x5a00ae[_0x3cc9('0x2a')]=_0xb9bf90[_0x3cc9('0x67')]({'plain':!![]});return db[_0x3cc9('0x68')][_0x3cc9('0x5b')]({'where':{'id':_0xb9bf90[_0x3cc9('0x69')]}});}return null;})[_0x3cc9('0x39')](handleEntityNotFound(_0x597258,null))[_0x3cc9('0x39')](function(_0x580f53){if(_0x580f53){_0x5a00ae['interaction']=_0x580f53[_0x3cc9('0x67')]({'plain':!![]});interaction_log[_0x3cc9('0x23')](_0x3cc9('0x7e'),_0x4aba3e[_0x3cc9('0x6d')]['id'],_0x4aba3e[_0x3cc9('0x6d')][_0x3cc9('0x3d')],_0x4aba3e[_0x3cc9('0x6d')][_0x3cc9('0x7f')],_0x5a00ae['interaction']['id'],_0x4aba3e[_0x3cc9('0x5d')]?JSON['stringify'](_0x4aba3e[_0x3cc9('0x5d')]):_0x3cc9('0x6e'));return respondWithRpcPromise('RejectMessage',_0x3cc9('0x80'),_0x5a00ae);}return null;})['then'](function(_0x411d87){var _0x1f08a1=_0x3cc9('0x70')+_0x411d87[_0x3cc9('0x2a')]['ContactId'];return db[_0x3cc9('0x72')][_0x3cc9('0x45')](_0x1f08a1,{'type':db['Sequelize']['QueryTypes'][_0x3cc9('0x81')],'raw':!![]})[_0x3cc9('0x39')](function(_0x1ca3fc){return _0x1ca3fc;});})[_0x3cc9('0x39')](function(_0x46e511){if(_0x46e511){_0x5a00ae[_0x3cc9('0x2a')][_0x3cc9('0x74')]=_0x46e511[0x0];if(!_0x4aba3e[_0x3cc9('0x5d')]['UserId'])return;return db['User'][_0x3cc9('0x5b')]({'where':{'id':_0x4aba3e[_0x3cc9('0x5d')]['UserId'],'role':'agent'},'attributes':['id','name',_0x3cc9('0x75'),'email',_0x3cc9('0x77')],'raw':!![]});}return null;})[_0x3cc9('0x39')](function(_0x32808f){if(!_0x32808f)return null;_0x5a00ae[_0x3cc9('0x2a')][_0x3cc9('0x66')]=_0x32808f;return _0x5a00ae;})[_0x3cc9('0x39')](function(_0x26465b){if(_0x26465b){_0x26465b[_0x3cc9('0x2a')]['interface']=util['format'](_0x3cc9('0x7a'),_0x4aba3e[_0x3cc9('0x6d')][_0x3cc9('0x3d')]);_0x26465b[_0x3cc9('0x2a')]['channel']=_0x5a00ae['channel'];_0x26465b[_0x3cc9('0x2a')][_0x3cc9('0x7c')]=_0x5a00ae[_0x3cc9('0x7b')];_0x26465b[_0x3cc9('0x2a')][_0x3cc9('0x82')]=_0x3cc9('0x83');respondWithRpcPromise('EventManager',_0x3cc9('0x7d'),{'event':_0x3cc9('0x84'),'message':_0x26465b[_0x3cc9('0x2a')]},client9002);return _0x5a00ae;}return null;})['then'](respondWithResult(_0x597258,null))[_0x3cc9('0x2c')](handleError(_0x597258,null));};exports[_0x3cc9('0x2e')]=function(_0xa5d94,_0x3b3689,_0x18213c){if(_0xa5d94[_0x3cc9('0x5d')]['id']){delete _0xa5d94['body']['id'];}var _0x424d62;return db[_0x3cc9('0x41')]['find']({'where':{'id':_0xa5d94[_0x3cc9('0x5a')]['id']}})[_0x3cc9('0x39')](handleEntityNotFound(_0x3b3689,null))[_0x3cc9('0x39')](function(_0x5bfc00){if(_0x5bfc00){_0x424d62=_0x5bfc00;return db[_0x3cc9('0x85')][_0x3cc9('0x5b')]({'where':{'id':_0x5bfc00[_0x3cc9('0x86')]}});}})[_0x3cc9('0x39')](handleEntityNotFound(_0x3b3689,null))['then'](function(_0x4056b7){if(_0x4056b7){logger[_0x3cc9('0x26')](_0x3cc9('0x87'),'status',_0x3cc9('0x88'),_0x4056b7[_0x3cc9('0x43')],util['inspect'](_0xa5d94[_0x3cc9('0x5d')],{'showHidden':![],'depth':null}));switch(_0x4056b7[_0x3cc9('0x43')]){case'twilio':if(_0xa5d94[_0x3cc9('0x5d')]['MessageSid']&&_0xa5d94['body']['MessageSid']===_0x424d62['messageId']&&_0xa5d94['body'][_0x3cc9('0x89')]&&_0xa5d94[_0x3cc9('0x5d')][_0x3cc9('0x89')]===_0x3cc9('0x62')){return _0x424d62['update']({'read':!![]});}else{logger['error'](_0x3cc9('0x8a'),_0x3cc9('0x2e'),_0x3cc9('0x8b'),util[_0x3cc9('0x8c')](_0xa5d94['body'],{'showHidden':![],'depth':null}));}break;}return _0x424d62;}})[_0x3cc9('0x39')](respondWithResult(_0x3b3689,null))[_0x3cc9('0x2c')](handleError(_0x3b3689,null));}; \ No newline at end of file +var _0x1a9e=['AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','contact','User','fullname','email','manual','interface','channel','motionChannel','event','EventManager','whatsapp','null','RejectMessage','rejectMessage','sequelize','Sequelize','internal','SIP/%s','rejectmessage','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','client','http','request','then','info','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','WhatsappMessage,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','includeAll','findAll','rows','params','include','find','create','body','describe','whatsapp-interactions','accept','read','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role'];(function(_0x512661,_0x4b4012){var _0x1debde=function(_0x1ed401){while(--_0x1ed401){_0x512661['push'](_0x512661['shift']());}};_0x1debde(++_0x4b4012);}(_0x1a9e,0x1c2));var _0xe1a9=function(_0x36e423,_0x516ec5){_0x36e423=_0x36e423-0x0;var _0x50667d=_0x1a9e[_0x36e423];return _0x50667d;};'use strict';var emlformat=require(_0xe1a9('0x0'));var rimraf=require(_0xe1a9('0x1'));var zipdir=require(_0xe1a9('0x2'));var jsonpatch=require(_0xe1a9('0x3'));var rp=require(_0xe1a9('0x4'));var moment=require(_0xe1a9('0x5'));var BPromise=require(_0xe1a9('0x6'));var Mustache=require(_0xe1a9('0x7'));var util=require(_0xe1a9('0x8'));var path=require(_0xe1a9('0x9'));var sox=require(_0xe1a9('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe1a9('0xb'));var squel=require('squel');var crypto=require(_0xe1a9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe1a9('0xd'));var toCsv=require(_0xe1a9('0xe'));var querystring=require(_0xe1a9('0xf'));var Papa=require(_0xe1a9('0x10'));var Redis=require(_0xe1a9('0x11'));var authService=require(_0xe1a9('0x12'));var qs=require(_0xe1a9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe1a9('0x14'))(_0xe1a9('0x15'));var utils=require(_0xe1a9('0x16'));var config=require(_0xe1a9('0x17'));var licenseUtil=require(_0xe1a9('0x18'));var db=require(_0xe1a9('0x19'))['db'];config['redis']=_[_0xe1a9('0x1a')](config['redis'],{'host':_0xe1a9('0x1b'),'port':0x18eb});var socket=require(_0xe1a9('0x1c'))(new Redis(config['redis']));require(_0xe1a9('0x1d'))[_0xe1a9('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xe1a9('0x1f')][_0xe1a9('0x20')]({'port':0x232c});var client9002=jayson[_0xe1a9('0x1f')][_0xe1a9('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x57dbe5,_0x123e52,_0x4f2ac0,_0x4464ea){return new BPromise(function(_0x2e4686,_0x203c55){var _0x597760=_0x4464ea||client;return _0x597760[_0xe1a9('0x21')](_0x57dbe5,_0x4f2ac0)[_0xe1a9('0x22')](function(_0x2028ab){logger[_0xe1a9('0x23')]('WhatsappMessage,\x20%s,\x20%s',_0x123e52,'request\x20sent');logger[_0xe1a9('0x24')](_0xe1a9('0x25'),_0x123e52,_0xe1a9('0x26'),JSON[_0xe1a9('0x27')](_0x2028ab));if(_0x2028ab[_0xe1a9('0x28')]){if(_0x2028ab[_0xe1a9('0x28')][_0xe1a9('0x29')]===0x1f4){logger[_0xe1a9('0x28')]('WhatsappMessage,\x20%s,\x20%s',_0x123e52,_0x2028ab[_0xe1a9('0x28')]['message']);return _0x203c55(_0x2028ab[_0xe1a9('0x28')][_0xe1a9('0x2a')]);}logger[_0xe1a9('0x28')](_0xe1a9('0x2b'),_0x123e52,_0x2028ab['error'][_0xe1a9('0x2a')]);return _0x2e4686(_0x2028ab['error'][_0xe1a9('0x2a')]);}else{logger[_0xe1a9('0x23')](_0xe1a9('0x2b'),_0x123e52,_0xe1a9('0x26'));_0x2e4686(_0x2028ab[_0xe1a9('0x2c')][_0xe1a9('0x2a')]);}})[_0xe1a9('0x2d')](function(_0x8e11f){logger[_0xe1a9('0x28')](_0xe1a9('0x2b'),_0x123e52,_0x8e11f);_0x203c55(_0x8e11f);});});}function respondWithStatusCode(_0x3f3b93,_0x53b7af){_0x53b7af=_0x53b7af||0xcc;return function(_0xa9f6a1){if(_0xa9f6a1){return _0x3f3b93[_0xe1a9('0x2e')](_0x53b7af);}return _0x3f3b93[_0xe1a9('0x2f')](_0x53b7af)[_0xe1a9('0x30')]();};}function respondWithResult(_0x182494,_0x55bef5){_0x55bef5=_0x55bef5||0xc8;return function(_0x24775b){if(_0x24775b){return _0x182494['status'](_0x55bef5)[_0xe1a9('0x31')](_0x24775b);}};}function respondWithFilteredResult(_0x48befc,_0x4a824b){return function(_0x1c7d3f){if(_0x1c7d3f){var _0x1f0c9a=typeof _0x4a824b[_0xe1a9('0x32')]===_0xe1a9('0x33')&&typeof _0x4a824b[_0xe1a9('0x34')]==='undefined';var _0x952665=_0x1c7d3f[_0xe1a9('0x35')];var _0x47db97=_0x1f0c9a?0x0:_0x4a824b['offset'];var _0x19812f=_0x1f0c9a?_0x1c7d3f['count']:_0x4a824b[_0xe1a9('0x32')]+_0x4a824b[_0xe1a9('0x34')];var _0x305345;if(_0x19812f>=_0x952665){_0x19812f=_0x952665;_0x305345=0xc8;}else{_0x305345=0xce;}_0x48befc['status'](_0x305345);return _0x48befc[_0xe1a9('0x36')](_0xe1a9('0x37'),_0x47db97+'-'+_0x19812f+'/'+_0x952665)[_0xe1a9('0x31')](_0x1c7d3f);}return null;};}function patchUpdates(_0x38f5ec){return function(_0x196764){try{jsonpatch['apply'](_0x196764,_0x38f5ec,!![]);}catch(_0x51fa2e){return BPromise[_0xe1a9('0x38')](_0x51fa2e);}return _0x196764[_0xe1a9('0x39')]();};}function saveUpdates(_0x18fa9,_0x27bfa9){return function(_0x31a631){if(_0x31a631){return _0x31a631[_0xe1a9('0x3a')](_0x18fa9)[_0xe1a9('0x22')](function(_0x2d6b01){return _0x2d6b01;});}return null;};}function removeEntity(_0x3f6bf9,_0x4298e1){return function(_0x2caae0){if(_0x2caae0){return _0x2caae0[_0xe1a9('0x3b')]()[_0xe1a9('0x22')](function(){_0x3f6bf9[_0xe1a9('0x2f')](0xcc)[_0xe1a9('0x30')]();});}};}function handleEntityNotFound(_0x237d13,_0x388778){return function(_0x55fae0){if(!_0x55fae0){_0x237d13['sendStatus'](0x194);}return _0x55fae0;};}function handleError(_0x535fd3,_0x8d33e8){_0x8d33e8=_0x8d33e8||0x1f4;return function(_0x461a73){logger[_0xe1a9('0x28')](_0x461a73[_0xe1a9('0x3c')]);if(_0x461a73[_0xe1a9('0x3d')]){delete _0x461a73[_0xe1a9('0x3d')];}_0x535fd3[_0xe1a9('0x2f')](_0x8d33e8)[_0xe1a9('0x3e')](_0x461a73);};}exports[_0xe1a9('0x3f')]=function(_0x2e0d33,_0x362ce9){var _0x16d98d={},_0x223baf={},_0xd6987c={'count':0x0,'rows':[]};var _0x3d9c57=_[_0xe1a9('0x40')](db[_0xe1a9('0x41')][_0xe1a9('0x42')],function(_0x321b94){return{'name':_0x321b94[_0xe1a9('0x43')],'type':_0x321b94['type'][_0xe1a9('0x44')]};});_0x223baf[_0xe1a9('0x45')]=_[_0xe1a9('0x40')](_0x3d9c57,_0xe1a9('0x3d'));_0x223baf[_0xe1a9('0x46')]=_[_0xe1a9('0x47')](_0x2e0d33['query']);_0x223baf['filters']=_[_0xe1a9('0x48')](_0x223baf[_0xe1a9('0x45')],_0x223baf[_0xe1a9('0x46')]);_0x16d98d[_0xe1a9('0x49')]=_['intersection'](_0x223baf['model'],qs['fields'](_0x2e0d33[_0xe1a9('0x46')][_0xe1a9('0x4a')]));_0x16d98d['attributes']=_0x16d98d['attributes'][_0xe1a9('0x4b')]?_0x16d98d[_0xe1a9('0x49')]:_0x223baf[_0xe1a9('0x45')];if(!_0x2e0d33['query'][_0xe1a9('0x4c')](_0xe1a9('0x4d'))){_0x16d98d[_0xe1a9('0x34')]=qs[_0xe1a9('0x34')](_0x2e0d33[_0xe1a9('0x46')][_0xe1a9('0x34')]);_0x16d98d[_0xe1a9('0x32')]=qs[_0xe1a9('0x32')](_0x2e0d33[_0xe1a9('0x46')][_0xe1a9('0x32')]);}_0x16d98d[_0xe1a9('0x4e')]=qs[_0xe1a9('0x4f')](_0x2e0d33['query']['sort']);_0x16d98d[_0xe1a9('0x50')]=qs[_0xe1a9('0x51')](_[_0xe1a9('0x52')](_0x2e0d33[_0xe1a9('0x46')],_0x223baf[_0xe1a9('0x51')]),_0x3d9c57);if(_0x2e0d33[_0xe1a9('0x46')][_0xe1a9('0x53')]){_0x16d98d[_0xe1a9('0x50')]=_['merge'](_0x16d98d['where'],{'$or':_[_0xe1a9('0x40')](_0x3d9c57,function(_0x26ad9c){if(_0x26ad9c[_0xe1a9('0x54')]!==_0xe1a9('0x55')){var _0x5098e2={};_0x5098e2[_0x26ad9c['name']]={'$like':'%'+_0x2e0d33[_0xe1a9('0x46')][_0xe1a9('0x53')]+'%'};return _0x5098e2;}})});}_0x16d98d=_[_0xe1a9('0x56')]({},_0x16d98d,_0x2e0d33['options']);var _0x159ab0={'where':_0x16d98d[_0xe1a9('0x50')]};return db[_0xe1a9('0x41')][_0xe1a9('0x35')](_0x159ab0)[_0xe1a9('0x22')](function(_0x59c48f){_0xd6987c['count']=_0x59c48f;if(_0x2e0d33[_0xe1a9('0x46')][_0xe1a9('0x57')]){_0x16d98d['include']=[{'all':!![]}];}return db[_0xe1a9('0x41')][_0xe1a9('0x58')](_0x16d98d);})[_0xe1a9('0x22')](function(_0x173f6f){_0xd6987c[_0xe1a9('0x59')]=_0x173f6f;return _0xd6987c;})['then'](respondWithFilteredResult(_0x362ce9,_0x16d98d))[_0xe1a9('0x2d')](handleError(_0x362ce9,null));};exports['show']=function(_0x3c10c7,_0x1dc05c){var _0x1a587f={'raw':!![],'where':{'id':_0x3c10c7[_0xe1a9('0x5a')]['id']}},_0x2dfeeb={};_0x2dfeeb[_0xe1a9('0x45')]=_[_0xe1a9('0x47')](db[_0xe1a9('0x41')]['rawAttributes']);_0x2dfeeb['query']=_[_0xe1a9('0x47')](_0x3c10c7['query']);_0x2dfeeb[_0xe1a9('0x51')]=_[_0xe1a9('0x48')](_0x2dfeeb[_0xe1a9('0x45')],_0x2dfeeb[_0xe1a9('0x46')]);_0x1a587f[_0xe1a9('0x49')]=_[_0xe1a9('0x48')](_0x2dfeeb[_0xe1a9('0x45')],qs[_0xe1a9('0x4a')](_0x3c10c7[_0xe1a9('0x46')][_0xe1a9('0x4a')]));_0x1a587f[_0xe1a9('0x49')]=_0x1a587f['attributes']['length']?_0x1a587f[_0xe1a9('0x49')]:_0x2dfeeb[_0xe1a9('0x45')];if(_0x3c10c7[_0xe1a9('0x46')][_0xe1a9('0x57')]){_0x1a587f[_0xe1a9('0x5b')]=[{'all':!![]}];}_0x1a587f=_[_0xe1a9('0x56')]({},_0x1a587f,_0x3c10c7['options']);return db['WhatsappMessage'][_0xe1a9('0x5c')](_0x1a587f)['then'](handleEntityNotFound(_0x1dc05c,null))[_0xe1a9('0x22')](respondWithResult(_0x1dc05c,null))[_0xe1a9('0x2d')](handleError(_0x1dc05c,null));};exports[_0xe1a9('0x5d')]=function(_0xe5068c,_0x2a0360){return db[_0xe1a9('0x41')][_0xe1a9('0x5d')](_0xe5068c[_0xe1a9('0x5e')],{})[_0xe1a9('0x22')](respondWithResult(_0x2a0360,0xc9))[_0xe1a9('0x2d')](handleError(_0x2a0360,null));};exports[_0xe1a9('0x3a')]=function(_0x40f7b4,_0x1eac35){if(_0x40f7b4[_0xe1a9('0x5e')]['id']){delete _0x40f7b4[_0xe1a9('0x5e')]['id'];}return db[_0xe1a9('0x41')][_0xe1a9('0x5c')]({'where':{'id':_0x40f7b4[_0xe1a9('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1eac35,null))['then'](saveUpdates(_0x40f7b4[_0xe1a9('0x5e')],null))[_0xe1a9('0x22')](respondWithResult(_0x1eac35,null))['catch'](handleError(_0x1eac35,null));};exports[_0xe1a9('0x3b')]=function(_0x4cd6c5,_0x1242cc){return db['WhatsappMessage'][_0xe1a9('0x5c')]({'where':{'id':_0x4cd6c5[_0xe1a9('0x5a')]['id']}})[_0xe1a9('0x22')](handleEntityNotFound(_0x1242cc,null))[_0xe1a9('0x22')](removeEntity(_0x1242cc,null))[_0xe1a9('0x2d')](handleError(_0x1242cc,null));};exports[_0xe1a9('0x5f')]=function(_0x283a4a,_0xdc797d){return db['WhatsappMessage']['describe']()[_0xe1a9('0x22')](respondWithResult(_0xdc797d,null))['catch'](handleError(_0xdc797d,null));};var interaction_log=require(_0xe1a9('0x14'))(_0xe1a9('0x60'));exports[_0xe1a9('0x61')]=function(_0x36a469,_0x516c67,_0x125a94){var _0x222a4c={'agent':{},'channel':'whatsapp'};if(_0x36a469[_0xe1a9('0x5e')]['id']){delete _0x36a469[_0xe1a9('0x5e')]['id'];}_0x36a469[_0xe1a9('0x5e')][_0xe1a9('0x62')]=!![];_0x36a469['body']['readAt']=moment()['format'](_0xe1a9('0x63'));_0x36a469[_0xe1a9('0x5e')][_0xe1a9('0x64')]=_0x36a469[_0xe1a9('0x5e')][_0xe1a9('0x64')]||_0x36a469['user']['id'];_0x222a4c[_0xe1a9('0x65')]['id']=_0x36a469[_0xe1a9('0x5e')][_0xe1a9('0x64')];return db[_0xe1a9('0x41')][_0xe1a9('0x5c')]({'where':{'id':_0x36a469['params']['id'],'UserId':null}})[_0xe1a9('0x22')](handleEntityNotFound(_0x516c67,null))['then'](saveUpdates(_0x36a469[_0xe1a9('0x5e')],null))[_0xe1a9('0x22')](function(_0x10d209){if(_0x10d209){_0x222a4c[_0xe1a9('0x2a')]=_0x10d209[_0xe1a9('0x66')]({'plain':!![]});return db[_0xe1a9('0x67')][_0xe1a9('0x5c')]({'where':{'id':_0x10d209[_0xe1a9('0x68')]}});}return null;})[_0xe1a9('0x22')](handleEntityNotFound(_0x516c67,null))[_0xe1a9('0x22')](function(_0x429d7b){if(_0x429d7b){return _0x429d7b[_0xe1a9('0x3a')]({'UserId':_0x36a469[_0xe1a9('0x5e')][_0xe1a9('0x64')],'read1stAt':_[_0xe1a9('0x69')](_0x429d7b['read1stAt'])?moment()['format'](_0xe1a9('0x63')):undefined});}return null;})[_0xe1a9('0x22')](function(_0x3ebd50){if(_0x3ebd50){_0x222a4c[_0xe1a9('0x6a')]=_0x3ebd50[_0xe1a9('0x66')]({'plain':!![]});interaction_log['info'](_0xe1a9('0x6b'),_0x36a469[_0xe1a9('0x6c')]['id'],_0x36a469[_0xe1a9('0x6c')][_0xe1a9('0x3d')],_0x36a469[_0xe1a9('0x6c')][_0xe1a9('0x6d')],_0x222a4c['interaction']['id'],_0x36a469[_0xe1a9('0x5e')]?JSON[_0xe1a9('0x27')](_0x36a469[_0xe1a9('0x5e')]):'null');return respondWithRpcPromise(_0xe1a9('0x6e'),'acceptMessage',_0x222a4c);}return null;})[_0xe1a9('0x22')](function(_0x5c7ef5){var _0x49fd4d=_0xe1a9('0x6f')+_0x5c7ef5['message']['ContactId'];return db['sequelize']['query'](_0x49fd4d,{'type':db['Sequelize']['QueryTypes'][_0xe1a9('0x70')],'raw':!![]})[_0xe1a9('0x22')](function(_0x7ba4cd){return _0x7ba4cd;});})[_0xe1a9('0x22')](function(_0x567097){if(_0x567097){_0x222a4c[_0xe1a9('0x2a')][_0xe1a9('0x71')]=_0x567097[0x0];if(!_0x36a469['body']['UserId'])return;return db[_0xe1a9('0x72')][_0xe1a9('0x5c')]({'where':{'id':_0x36a469[_0xe1a9('0x5e')]['UserId'],'role':_0xe1a9('0x65')},'attributes':['id',_0xe1a9('0x3d'),_0xe1a9('0x73'),_0xe1a9('0x74'),'internal'],'raw':!![]});}return null;})[_0xe1a9('0x22')](function(_0x4e852c){if(!_0x4e852c)return null;_0x222a4c[_0xe1a9('0x2a')][_0xe1a9('0x65')]=_0x4e852c;return _0x222a4c;})['then'](function(_0xfb4d34){if(_0xfb4d34){if(_0x36a469[_0xe1a9('0x5e')][_0xe1a9('0x75')]){_0x222a4c[_0xe1a9('0x2a')][_0xe1a9('0x76')]=util['format']('SIP/%s',_0x36a469[_0xe1a9('0x6c')]['name']);_0x222a4c[_0xe1a9('0x2a')][_0xe1a9('0x77')]=_0x222a4c['channel'];_0x222a4c['message'][_0xe1a9('0x78')]=_0x222a4c[_0xe1a9('0x77')];_0x222a4c['message'][_0xe1a9('0x79')]=_0xe1a9('0x61');return respondWithRpcPromise(_0xe1a9('0x7a'),'EventManager',{'event':'acceptmessage','message':_0x222a4c['message']},client9002)[_0xe1a9('0x22')](function(){return _0x222a4c;});}return _0x222a4c;}return null;})[_0xe1a9('0x22')](respondWithResult(_0x516c67,null))[_0xe1a9('0x2d')](handleError(_0x516c67,null));};var interaction_log=require('../../config/logger')(_0xe1a9('0x60'));exports[_0xe1a9('0x38')]=function(_0x449218,_0x12f28a,_0x515ea0){var _0x22ac0d={'agent':{},'channel':_0xe1a9('0x7b')};if(_0x449218[_0xe1a9('0x5e')]['id']){delete _0x449218[_0xe1a9('0x5e')]['id'];}_0x449218['body']['UserId']=_0x449218[_0xe1a9('0x5e')]['UserId']||_0x449218['user']['id'];_0x22ac0d[_0xe1a9('0x65')]['id']=_0x449218[_0xe1a9('0x5e')]['UserId'];return db[_0xe1a9('0x41')]['find']({'where':{'id':_0x449218['params']['id'],'UserId':null}})[_0xe1a9('0x22')](handleEntityNotFound(_0x12f28a,null))[_0xe1a9('0x22')](function(_0x59843c){if(_0x59843c){_0x22ac0d[_0xe1a9('0x2a')]=_0x59843c[_0xe1a9('0x66')]({'plain':!![]});return db[_0xe1a9('0x67')]['find']({'where':{'id':_0x59843c['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x12f28a,null))['then'](function(_0x274118){if(_0x274118){_0x22ac0d[_0xe1a9('0x6a')]=_0x274118[_0xe1a9('0x66')]({'plain':!![]});interaction_log[_0xe1a9('0x23')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x449218['user']['id'],_0x449218[_0xe1a9('0x6c')][_0xe1a9('0x3d')],_0x449218['user']['role'],_0x22ac0d[_0xe1a9('0x6a')]['id'],_0x449218[_0xe1a9('0x5e')]?JSON[_0xe1a9('0x27')](_0x449218[_0xe1a9('0x5e')]):_0xe1a9('0x7c'));return respondWithRpcPromise(_0xe1a9('0x7d'),_0xe1a9('0x7e'),_0x22ac0d);}return null;})['then'](function(_0x1a8412){var _0x270635=_0xe1a9('0x6f')+_0x1a8412[_0xe1a9('0x2a')]['ContactId'];return db[_0xe1a9('0x7f')][_0xe1a9('0x46')](_0x270635,{'type':db[_0xe1a9('0x80')]['QueryTypes'][_0xe1a9('0x70')],'raw':!![]})[_0xe1a9('0x22')](function(_0xf5e21c){return _0xf5e21c;});})[_0xe1a9('0x22')](function(_0x518695){if(_0x518695){_0x22ac0d[_0xe1a9('0x2a')][_0xe1a9('0x71')]=_0x518695[0x0];if(!_0x449218[_0xe1a9('0x5e')][_0xe1a9('0x64')])return;return db[_0xe1a9('0x72')][_0xe1a9('0x5c')]({'where':{'id':_0x449218[_0xe1a9('0x5e')][_0xe1a9('0x64')],'role':_0xe1a9('0x65')},'attributes':['id','name','fullname',_0xe1a9('0x74'),_0xe1a9('0x81')],'raw':!![]});}return null;})['then'](function(_0x9afc75){if(!_0x9afc75)return null;_0x22ac0d[_0xe1a9('0x2a')][_0xe1a9('0x65')]=_0x9afc75;return _0x22ac0d;})[_0xe1a9('0x22')](function(_0x2bf7d4){if(_0x2bf7d4){_0x2bf7d4[_0xe1a9('0x2a')][_0xe1a9('0x76')]=util['format'](_0xe1a9('0x82'),_0x449218[_0xe1a9('0x6c')][_0xe1a9('0x3d')]);_0x2bf7d4[_0xe1a9('0x2a')]['channel']=_0x22ac0d['channel'];_0x2bf7d4['message']['motionChannel']=_0x22ac0d[_0xe1a9('0x77')];_0x2bf7d4[_0xe1a9('0x2a')]['event']='reject';respondWithRpcPromise(_0xe1a9('0x7a'),_0xe1a9('0x7a'),{'event':_0xe1a9('0x83'),'message':_0x2bf7d4[_0xe1a9('0x2a')]},client9002);return _0x22ac0d;}return null;})[_0xe1a9('0x22')](respondWithResult(_0x12f28a,null))[_0xe1a9('0x2d')](handleError(_0x12f28a,null));};exports[_0xe1a9('0x2f')]=function(_0xc4ffeb,_0x534a3e,_0x15213b){if(_0xc4ffeb[_0xe1a9('0x5e')]['id']){delete _0xc4ffeb['body']['id'];}var _0x32983b;return db[_0xe1a9('0x41')][_0xe1a9('0x5c')]({'where':{'id':_0xc4ffeb[_0xe1a9('0x5a')]['id']}})[_0xe1a9('0x22')](handleEntityNotFound(_0x534a3e,null))[_0xe1a9('0x22')](function(_0xb2128f){if(_0xb2128f){_0x32983b=_0xb2128f;return db[_0xe1a9('0x84')][_0xe1a9('0x5c')]({'where':{'id':_0xb2128f['WhatsappAccountId']}});}})[_0xe1a9('0x22')](handleEntityNotFound(_0x534a3e,null))['then'](function(_0x161b11){if(_0x161b11){logger['debug'](_0xe1a9('0x85'),'status','received\x20delivery\x20report\x20from',_0x161b11[_0xe1a9('0x54')],util[_0xe1a9('0x86')](_0xc4ffeb['body'],{'showHidden':![],'depth':null}));switch(_0x161b11['type']){case _0xe1a9('0x87'):if(_0xc4ffeb['body'][_0xe1a9('0x88')]&&_0xc4ffeb[_0xe1a9('0x5e')]['MessageSid']===_0x32983b[_0xe1a9('0x89')]&&_0xc4ffeb['body'][_0xe1a9('0x8a')]&&_0xc4ffeb['body'][_0xe1a9('0x8a')]===_0xe1a9('0x62')){return _0x32983b['update']({'read':!![]});}else{logger[_0xe1a9('0x28')](_0xe1a9('0x8b'),'status',_0xe1a9('0x87'),util[_0xe1a9('0x86')](_0xc4ffeb[_0xe1a9('0x5e')],{'showHidden':![],'depth':null}));}break;}return _0x32983b;}})[_0xe1a9('0x22')](respondWithResult(_0x534a3e,null))[_0xe1a9('0x2d')](handleError(_0x534a3e,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index fcb143b..c3c1cf6 100644 --- a/server/api/whatsappMessage/whatsappMessage.events.js +++ b/server/api/whatsappMessage/whatsappMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1752=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappMessage','setMaxListeners','save','update'];(function(_0x25cc14,_0x2b1785){var _0x2baf24=function(_0x19a0da){while(--_0x19a0da){_0x25cc14['push'](_0x25cc14['shift']());}};_0x2baf24(++_0x2b1785);}(_0x1752,0xa5));var _0x2175=function(_0x19f5e2,_0x39f0e3){_0x19f5e2=_0x19f5e2-0x0;var _0x2ce888=_0x1752[_0x19f5e2];return _0x2ce888;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x2175('0x0'))['db'][_0x2175('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x2175('0x2')](0x0);var events={'afterCreate':_0x2175('0x3'),'afterUpdate':_0x2175('0x4'),'afterDestroy':_0x2175('0x5')};function emitEvent(_0x56c315){return function(_0x1ee277,_0x22c167,_0x12b8d9){WhatsappMessageEvents[_0x2175('0x6')](_0x56c315+':'+_0x1ee277['id'],_0x1ee277);WhatsappMessageEvents[_0x2175('0x6')](_0x56c315,_0x1ee277);_0x12b8d9(null);};}for(var e in events){if(events[_0x2175('0x7')](e)){var event=events[e];WhatsappMessage[_0x2175('0x8')](e,emitEvent(event));}}module[_0x2175('0x9')]=WhatsappMessageEvents; \ No newline at end of file +var _0x39cb=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappMessage','save'];(function(_0x49d8ab,_0x7e24db){var _0x3c1bf6=function(_0x433b86){while(--_0x433b86){_0x49d8ab['push'](_0x49d8ab['shift']());}};_0x3c1bf6(++_0x7e24db);}(_0x39cb,0x1bd));var _0xb39c=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x39cb[_0xfae23b];return _0x200640;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0xb39c('0x0'))['db'][_0xb39c('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb39c('0x2'),'afterUpdate':_0xb39c('0x3'),'afterDestroy':'remove'};function emitEvent(_0x412f1c){return function(_0x285eca,_0x398d07,_0x2bca14){WhatsappMessageEvents[_0xb39c('0x4')](_0x412f1c+':'+_0x285eca['id'],_0x285eca);WhatsappMessageEvents['emit'](_0x412f1c,_0x285eca);_0x2bca14(null);};}for(var e in events){if(events[_0xb39c('0x5')](e)){var event=events[e];WhatsappMessage[_0xb39c('0x6')](e,emitEvent(event));}}module[_0xb39c('0x7')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 21abb28..1fefd89 100644 --- a/server/api/whatsappMessage/whatsappMessage.model.js +++ b/server/api/whatsappMessage/whatsappMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1063=['update','catch','error','secret','WhatsappAccount','find','WhatsappAccountId','then','type','twilio','authToken','phone','messages','create','whatsapp:','/api/whatsapp/messages/','/status?token=','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','accountSid','baseUrl','/messages/','text','POST','Bearer\x20','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','node-fetch','path','rimraf','../../config/environment','exports','define','WhatsappMessage','whatsapp_messages','messageId','body','FULLTEXT','models','get','direction','toLowerCase','out','UserId','WhatsappInteraction','findOne','WhatsappInteractionId'];(function(_0xd86c8,_0x573b58){var _0x206c94=function(_0xfe20ec){while(--_0xfe20ec){_0xd86c8['push'](_0xd86c8['shift']());}};_0x206c94(++_0x573b58);}(_0x1063,0x184));var _0x3106=function(_0x233520,_0x4ffd96){_0x233520=_0x233520-0x0;var _0x293657=_0x1063[_0x233520];return _0x293657;};'use strict';var _=require(_0x3106('0x0'));var util=require(_0x3106('0x1'));var logger=require(_0x3106('0x2'))(_0x3106('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3106('0x4'));var fetch=require(_0x3106('0x5'));var fs=require('fs');var path=require(_0x3106('0x6'));var rimraf=require(_0x3106('0x7'));var config=require(_0x3106('0x8'));var attributes=require('./whatsappMessage.attributes');module[_0x3106('0x9')]=function(_0x44003d,_0x23c4a){return _0x44003d[_0x3106('0xa')](_0x3106('0xb'),attributes,{'tableName':_0x3106('0xc'),'paranoid':![],'indexes':[{'name':_0x3106('0xd'),'fields':[_0x3106('0xd')]},{'name':'fti_whatsapp_messages','fields':[_0x3106('0xe')],'type':_0x3106('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1d469e,_0x12031c,_0x4cabc5){var _0x2aa5a8=_0x44003d[_0x3106('0x10')];var _0x2fa422=_0x1d469e[_0x3106('0x11')]({'plain':!![]});if(_0x2fa422[_0x3106('0x12')][_0x3106('0x13')]()==='in'||_0x2fa422[_0x3106('0x12')]['toLowerCase']()===_0x3106('0x14')&&!_0x2fa422['secret']&&!_['isNil'](_0x2fa422[_0x3106('0x15')])){_0x2aa5a8[_0x3106('0x16')][_0x3106('0x17')]({'where':{'id':_0x2fa422[_0x3106('0x18')]}})['then'](function(_0x5f534d){if(_0x5f534d){_0x5f534d[_0x3106('0x19')]({'lastMsgAt':_0x2fa422['createdAt'],'lastMsgDirection':_0x2fa422['direction'][_0x3106('0x13')]()});}})[_0x3106('0x1a')](function(_0x39734e){console[_0x3106('0x1b')](_0x39734e);});}if(_0x2fa422[_0x3106('0x12')]===_0x3106('0x14')&&!_0x2fa422[_0x3106('0x1c')]){var _0x31256a;_0x2aa5a8[_0x3106('0x1d')][_0x3106('0x1e')]({'where':{'id':_0x2fa422[_0x3106('0x1f')]},'raw':!![]})[_0x3106('0x20')](function(_0x52dfbd){_0x31256a=_0x52dfbd;if(_0x31256a&&_0x31256a['type']){switch(_0x31256a[_0x3106('0x21')]){case _0x3106('0x22'):var _0xb9881b=require(_0x3106('0x22'));if(_0x31256a['accountSid']&&_0x31256a[_0x3106('0x23')]&&_0x31256a[_0x3106('0x24')]){var _0x6de6a9=new _0xb9881b(_0x31256a['accountSid'],_0x31256a[_0x3106('0x23')]);_0x6de6a9[_0x3106('0x25')][_0x3106('0x26')]({'body':_0x2fa422[_0x3106('0xe')],'to':_0x3106('0x27')+_0x2fa422[_0x3106('0x24')],'from':_0x3106('0x27')+_0x31256a[_0x3106('0x24')],'statusCallback':_0x31256a['remote']+_0x3106('0x28')+_0x2fa422['id']+_0x3106('0x29')+_0x31256a['token']})[_0x3106('0x20')](function(_0x1cf56b){if(_0x1cf56b[_0x3106('0x2a')]){return _0x1d469e[_0x3106('0x19')]({'messageId':_0x1cf56b[_0x3106('0x2a')]});}})[_0x3106('0x1a')](function(_0x1be165){logger['error'](_0x3106('0x2b'),_0x3106('0x2c'),_0x3106('0x22'),util['inspect'](_0x1be165,{'showHidden':![],'depth':null}));});}else{logger[_0x3106('0x1b')](_0x3106('0x2b'),_0x3106('0x2c'),_0x3106('0x22'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'sinch':var _0x13c2f4=_0x31256a[_0x3106('0x2d')];var _0x563cff=_0x31256a[_0x3106('0x23')];var _0xaf84ce=_0x31256a[_0x3106('0x2e')]+'/whatsapp/v1/'+_0x13c2f4+_0x3106('0x2f');var _0x4cdcb4={'to':[_0x2fa422['phone']],'message':{'type':_0x3106('0x30'),'text':_0x2fa422['body']}};var _0x2cbab3={'method':_0x3106('0x31'),'uri':_0xaf84ce,'headers':{'Authorization':_0x3106('0x32')+_0x563cff,'Content-Type':_0x3106('0x33')},'body':_0x4cdcb4,'json':!![]};rp(_0x2cbab3)[_0x3106('0x20')](function(_0x53e1c7){if(_0x53e1c7[_0x3106('0x34')][0x0][_0x3106('0x35')]){return _0x1d469e[_0x3106('0x19')]({'messageId':_0x53e1c7[_0x3106('0x34')][0x0]['message_id']});}})['catch'](function(_0x425238){logger[_0x3106('0x36')](_0x3106('0x37'),_0x425238);});break;}}})[_0x3106('0x38')](function(){_0x4cabc5();});}else{_0x4cabc5();}}},'charset':_0x3106('0x39'),'collate':_0x3106('0x3a')});}; \ No newline at end of file +var _0x98b4=['WhatsappInteraction','findOne','WhatsappInteractionId','update','createdAt','error','out','WhatsappAccount','WhatsappAccountId','then','type','twilio','authToken','phone','accountSid','messages','create','whatsapp:','token','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','/messages/','text','message_id','statuses','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','whatsapp_messages','messageId','body','FULLTEXT','models','direction','toLowerCase','secret','isNil','UserId'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0x98b4,0x93));var _0x498b=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x98b4[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x498b('0x0'));var util=require('util');var logger=require(_0x498b('0x1'))(_0x498b('0x2'));var moment=require(_0x498b('0x3'));var BPromise=require(_0x498b('0x4'));var rp=require('request-promise');var fetch=require(_0x498b('0x5'));var fs=require('fs');var path=require(_0x498b('0x6'));var rimraf=require(_0x498b('0x7'));var config=require(_0x498b('0x8'));var attributes=require(_0x498b('0x9'));module[_0x498b('0xa')]=function(_0x4be8d3,_0x558de1){return _0x4be8d3['define']('WhatsappMessage',attributes,{'tableName':_0x498b('0xb'),'paranoid':![],'indexes':[{'name':_0x498b('0xc'),'fields':[_0x498b('0xc')]},{'name':'fti_whatsapp_messages','fields':[_0x498b('0xd')],'type':_0x498b('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x16d45d,_0x1babf0,_0x5064e3){var _0xd96794=_0x4be8d3[_0x498b('0xf')];var _0x2eb3c4=_0x16d45d['get']({'plain':!![]});if(_0x2eb3c4[_0x498b('0x10')][_0x498b('0x11')]()==='in'||_0x2eb3c4[_0x498b('0x10')][_0x498b('0x11')]()==='out'&&!_0x2eb3c4[_0x498b('0x12')]&&!_[_0x498b('0x13')](_0x2eb3c4[_0x498b('0x14')])){_0xd96794[_0x498b('0x15')][_0x498b('0x16')]({'where':{'id':_0x2eb3c4[_0x498b('0x17')]}})['then'](function(_0x30c942){if(_0x30c942){_0x30c942[_0x498b('0x18')]({'lastMsgAt':_0x2eb3c4[_0x498b('0x19')],'lastMsgDirection':_0x2eb3c4['direction'][_0x498b('0x11')]()});}})['catch'](function(_0xab852c){console[_0x498b('0x1a')](_0xab852c);});}if(_0x2eb3c4[_0x498b('0x10')]===_0x498b('0x1b')&&!_0x2eb3c4['secret']){var _0x203edb;_0xd96794[_0x498b('0x1c')]['find']({'where':{'id':_0x2eb3c4[_0x498b('0x1d')]},'raw':!![]})[_0x498b('0x1e')](function(_0x504626){_0x203edb=_0x504626;if(_0x203edb&&_0x203edb[_0x498b('0x1f')]){switch(_0x203edb[_0x498b('0x1f')]){case'twilio':var _0x5e36ba=require(_0x498b('0x20'));if(_0x203edb['accountSid']&&_0x203edb[_0x498b('0x21')]&&_0x203edb[_0x498b('0x22')]){var _0x347776=new _0x5e36ba(_0x203edb[_0x498b('0x23')],_0x203edb[_0x498b('0x21')]);_0x347776[_0x498b('0x24')][_0x498b('0x25')]({'body':_0x2eb3c4[_0x498b('0xd')],'to':_0x498b('0x26')+_0x2eb3c4[_0x498b('0x22')],'from':'whatsapp:'+_0x203edb[_0x498b('0x22')],'statusCallback':_0x203edb['remote']+'/api/whatsapp/messages/'+_0x2eb3c4['id']+'/status?token='+_0x203edb[_0x498b('0x27')]})['then'](function(_0x19073e){if(_0x19073e[_0x498b('0x28')]){return _0x16d45d[_0x498b('0x18')]({'messageId':_0x19073e['sid']});}})[_0x498b('0x29')](function(_0x3ea0d5){logger[_0x498b('0x1a')](_0x498b('0x2a'),_0x498b('0x2b'),_0x498b('0x20'),util[_0x498b('0x2c')](_0x3ea0d5,{'showHidden':![],'depth':null}));});}else{logger[_0x498b('0x1a')]('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio',_0x498b('0x2d'));}break;case _0x498b('0x2e'):var _0xd16a7=_0x203edb[_0x498b('0x23')];var _0x111246=_0x203edb['authToken'];var _0x43dc90=_0x203edb['baseUrl']+'/whatsapp/v1/'+_0xd16a7+_0x498b('0x2f');var _0x437f8f={'to':[_0x2eb3c4[_0x498b('0x22')]],'message':{'type':_0x498b('0x30'),'text':_0x2eb3c4[_0x498b('0xd')]}};var _0x5675df={'method':'POST','uri':_0x43dc90,'headers':{'Authorization':'Bearer\x20'+_0x111246,'Content-Type':'application/json'},'body':_0x437f8f,'json':!![]};rp(_0x5675df)[_0x498b('0x1e')](function(_0x420543){if(_0x420543['statuses'][0x0][_0x498b('0x31')]){return _0x16d45d[_0x498b('0x18')]({'messageId':_0x420543[_0x498b('0x32')][0x0][_0x498b('0x31')]});}})[_0x498b('0x29')](function(_0x4d6e8e){logger[_0x498b('0x33')](_0x498b('0x34'),_0x4d6e8e);});break;}}})[_0x498b('0x35')](function(){_0x5064e3();});}else{_0x5064e3();}}},'charset':_0x498b('0x36'),'collate':_0x498b('0x37')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index f71002c..fcc1c52 100644 --- a/server/api/whatsappMessage/whatsappMessage.rpc.js +++ b/server/api/whatsappMessage/whatsappMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa74c=['CreateWhatsappMessage','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','redis','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','WhatsappMessage','create','body','options','raw'];(function(_0x39ffd1,_0x299703){var _0x31267e=function(_0x11b420){while(--_0x11b420){_0x39ffd1['push'](_0x39ffd1['shift']());}};_0x31267e(++_0x299703);}(_0xa74c,0x101));var _0xca74=function(_0x4cdb18,_0x449404){_0x4cdb18=_0x4cdb18-0x0;var _0x413661=_0xa74c[_0x4cdb18];return _0x413661;};'use strict';var _=require(_0xca74('0x0'));var util=require(_0xca74('0x1'));var moment=require(_0xca74('0x2'));var BPromise=require(_0xca74('0x3'));var rs=require(_0xca74('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca74('0x5'))['db'];var utils=require(_0xca74('0x6'));var logger=require('../../config/logger')(_0xca74('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xca74('0x8')]['http']({'port':0x232a});config[_0xca74('0x9')]=_['defaults'](config[_0xca74('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xca74('0xa'))(new Redis(config[_0xca74('0x9')]));require(_0xca74('0xb'))[_0xca74('0xc')](socket);function respondWithRpcPromise(_0x742503,_0x2a5e8e,_0x488c9b){return new BPromise(function(_0x15837c,_0x48aa3e){return client[_0xca74('0xd')](_0x742503,_0x488c9b)[_0xca74('0xe')](function(_0x464321){logger[_0xca74('0xf')](_0xca74('0x10'),_0x2a5e8e,_0xca74('0x11'));logger[_0xca74('0x12')](_0xca74('0x13'),_0x2a5e8e,_0xca74('0x11'),JSON[_0xca74('0x14')](_0x464321));if(_0x464321[_0xca74('0x15')]){if(_0x464321[_0xca74('0x15')][_0xca74('0x16')]===0x1f4){logger[_0xca74('0x15')](_0xca74('0x10'),_0x2a5e8e,_0x464321['error'][_0xca74('0x17')]);return _0x48aa3e(_0x464321[_0xca74('0x15')][_0xca74('0x17')]);}logger[_0xca74('0x15')](_0xca74('0x10'),_0x2a5e8e,_0x464321[_0xca74('0x15')]['message']);return _0x15837c(_0x464321[_0xca74('0x15')][_0xca74('0x17')]);}else{logger[_0xca74('0xf')](_0xca74('0x10'),_0x2a5e8e,_0xca74('0x11'));_0x15837c(_0x464321[_0xca74('0x18')][_0xca74('0x17')]);}})[_0xca74('0x19')](function(_0x44eb20){logger['error'](_0xca74('0x10'),_0x2a5e8e,_0x44eb20);_0x48aa3e(_0x44eb20);});});}exports['CreateWhatsappMessage']=function(_0x147c77){var _0x5eafc1=this;return new Promise(function(_0x205a3d,_0x12bc4b){return db[_0xca74('0x1a')][_0xca74('0x1b')](_0x147c77[_0xca74('0x1c')],{'raw':_0x147c77[_0xca74('0x1d')]?_0x147c77[_0xca74('0x1d')][_0xca74('0x1e')]===undefined?!![]:![]:!![]})[_0xca74('0xe')](function(_0x1cf521){logger[_0xca74('0xf')]('CreateWhatsappMessage',_0x147c77);logger[_0xca74('0x12')]('CreateWhatsappMessage',_0x147c77,JSON[_0xca74('0x14')](_0x1cf521));_0x205a3d(_0x1cf521);})['catch'](function(_0x310bb8){logger[_0xca74('0x15')](_0xca74('0x1f'),_0x310bb8[_0xca74('0x17')],_0x147c77);_0x12bc4b(_0x5eafc1[_0xca74('0x15')](0x1f4,_0x310bb8[_0xca74('0x17')]));});});}; \ No newline at end of file +var _0xb222=['bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','WhatsappMessage','body','options','then','CreateWhatsappMessage','catch','lodash','util','moment'];(function(_0x35b1c2,_0x2f0f1a){var _0x44e095=function(_0x288631){while(--_0x288631){_0x35b1c2['push'](_0x35b1c2['shift']());}};_0x44e095(++_0x2f0f1a);}(_0xb222,0x15d));var _0x2b22=function(_0x4ad011,_0x518534){_0x4ad011=_0x4ad011-0x0;var _0x2269d2=_0xb222[_0x4ad011];return _0x2269d2;};'use strict';var _=require(_0x2b22('0x0'));var util=require(_0x2b22('0x1'));var moment=require(_0x2b22('0x2'));var BPromise=require(_0x2b22('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2b22('0x4'));var db=require(_0x2b22('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2b22('0x6'))('rpc');var config=require(_0x2b22('0x7'));var jayson=require(_0x2b22('0x8'));var client=jayson[_0x2b22('0x9')][_0x2b22('0xa')]({'port':0x232a});config['redis']=_[_0x2b22('0xb')](config[_0x2b22('0xc')],{'host':_0x2b22('0xd'),'port':0x18eb});var socket=require(_0x2b22('0xe'))(new Redis(config[_0x2b22('0xc')]));require(_0x2b22('0xf'))[_0x2b22('0x10')](socket);function respondWithRpcPromise(_0x43056b,_0x2c139e,_0x567ec1){return new BPromise(function(_0x3f4132,_0x2e5264){return client[_0x2b22('0x11')](_0x43056b,_0x567ec1)['then'](function(_0x2b0199){logger[_0x2b22('0x12')](_0x2b22('0x13'),_0x2c139e,_0x2b22('0x14'));logger[_0x2b22('0x15')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x2c139e,_0x2b22('0x14'),JSON[_0x2b22('0x16')](_0x2b0199));if(_0x2b0199[_0x2b22('0x17')]){if(_0x2b0199[_0x2b22('0x17')][_0x2b22('0x18')]===0x1f4){logger[_0x2b22('0x17')](_0x2b22('0x13'),_0x2c139e,_0x2b0199[_0x2b22('0x17')][_0x2b22('0x19')]);return _0x2e5264(_0x2b0199[_0x2b22('0x17')]['message']);}logger['error'](_0x2b22('0x13'),_0x2c139e,_0x2b0199[_0x2b22('0x17')]['message']);return _0x3f4132(_0x2b0199[_0x2b22('0x17')][_0x2b22('0x19')]);}else{logger[_0x2b22('0x12')](_0x2b22('0x13'),_0x2c139e,_0x2b22('0x14'));_0x3f4132(_0x2b0199['result'][_0x2b22('0x19')]);}})['catch'](function(_0x520521){logger[_0x2b22('0x17')](_0x2b22('0x13'),_0x2c139e,_0x520521);_0x2e5264(_0x520521);});});}exports['CreateWhatsappMessage']=function(_0x6347dd){var _0x42d5cf=this;return new Promise(function(_0x9bb074,_0x37c211){return db[_0x2b22('0x1a')]['create'](_0x6347dd[_0x2b22('0x1b')],{'raw':_0x6347dd['options']?_0x6347dd[_0x2b22('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x2b22('0x1d')](function(_0x46f1eb){logger[_0x2b22('0x12')](_0x2b22('0x1e'),_0x6347dd);logger[_0x2b22('0x15')]('CreateWhatsappMessage',_0x6347dd,JSON[_0x2b22('0x16')](_0x46f1eb));_0x9bb074(_0x46f1eb);})[_0x2b22('0x1f')](function(_0x2c30a2){logger[_0x2b22('0x17')](_0x2b22('0x1e'),_0x2c30a2[_0x2b22('0x19')],_0x6347dd);_0x37c211(_0x42d5cf['error'](0x1f4,_0x2c30a2[_0x2b22('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 502ae3b..aedcf77 100644 --- a/server/api/whatsappMessage/whatsappMessage.socket.js +++ b/server/api/whatsappMessage/whatsappMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4418=['register','length','whatsappMessage:','./whatsappMessage.events','save','emit','removeListener'];(function(_0x56a326,_0x59ff7d){var _0x5a6d11=function(_0x2ea7cf){while(--_0x2ea7cf){_0x56a326['push'](_0x56a326['shift']());}};_0x5a6d11(++_0x59ff7d);}(_0x4418,0xd5));var _0x8441=function(_0x173f10,_0x35db61){_0x173f10=_0x173f10-0x0;var _0x53142d=_0x4418[_0x173f10];return _0x53142d;};'use strict';var WhatsappMessageEvents=require(_0x8441('0x0'));var events=[_0x8441('0x1'),'remove','update'];function createListener(_0x1e6cea,_0x303424){return function(_0x3ab54c){_0x303424[_0x8441('0x2')](_0x1e6cea,_0x3ab54c);};}function removeListener(_0x4ec14f,_0x5f479e){return function(){WhatsappMessageEvents[_0x8441('0x3')](_0x4ec14f,_0x5f479e);};}exports[_0x8441('0x4')]=function(_0x5d158a){for(var _0x3ada2f=0x0,_0x398e05=events[_0x8441('0x5')];_0x3ada2f<_0x398e05;_0x3ada2f++){var _0x3fdd5b=events[_0x3ada2f];var _0x5aadfe=createListener(_0x8441('0x6')+_0x3fdd5b,_0x5d158a);WhatsappMessageEvents['on'](_0x3fdd5b,_0x5aadfe);}}; \ No newline at end of file +var _0x7216=['register','length','./whatsappMessage.events','save','remove','update','removeListener'];(function(_0x4e9916,_0x2a200b){var _0xab1b23=function(_0x3992fa){while(--_0x3992fa){_0x4e9916['push'](_0x4e9916['shift']());}};_0xab1b23(++_0x2a200b);}(_0x7216,0x1c9));var _0x6721=function(_0x52502a,_0x31f097){_0x52502a=_0x52502a-0x0;var _0x3213b7=_0x7216[_0x52502a];return _0x3213b7;};'use strict';var WhatsappMessageEvents=require(_0x6721('0x0'));var events=[_0x6721('0x1'),_0x6721('0x2'),_0x6721('0x3')];function createListener(_0x3ffefa,_0xd7f00c){return function(_0x1261ee){_0xd7f00c['emit'](_0x3ffefa,_0x1261ee);};}function removeListener(_0x27b4f7,_0x467565){return function(){WhatsappMessageEvents[_0x6721('0x4')](_0x27b4f7,_0x467565);};}exports[_0x6721('0x5')]=function(_0x4f0cb6){for(var _0x2a63c3=0x0,_0x3735f4=events[_0x6721('0x6')];_0x2a63c3<_0x3735f4;_0x2a63c3++){var _0x684e99=events[_0x2a63c3];var _0x33495b=createListener('whatsappMessage:'+_0x684e99,_0x4f0cb6);WhatsappMessageEvents['on'](_0x684e99,_0x33495b);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 4b85623..15c13e9 100644 --- a/server/api/whatsappQueue/index.js +++ b/server/api/whatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc0f4=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','show','getMembers','getTeams','/:id/users','post','/:id/teams','addTeams','addAgents','put','/:id','delete','removeTeams','removeAgents','exports','multer'];(function(_0x39caaa,_0x1f37bc){var _0x9b9c7d=function(_0x2da02c){while(--_0x2da02c){_0x39caaa['push'](_0x39caaa['shift']());}};_0x9b9c7d(++_0x1f37bc);}(_0xc0f4,0x1cf));var _0x4c0f=function(_0xadeeb8,_0x1b8631){_0xadeeb8=_0xadeeb8-0x0;var _0x32de39=_0xc0f4[_0xadeeb8];return _0x32de39;};'use strict';var multer=require(_0x4c0f('0x0'));var util=require(_0x4c0f('0x1'));var path=require(_0x4c0f('0x2'));var timeout=require(_0x4c0f('0x3'));var express=require(_0x4c0f('0x4'));var router=express[_0x4c0f('0x5')]();var fs_extra=require(_0x4c0f('0x6'));var auth=require(_0x4c0f('0x7'));var interaction=require(_0x4c0f('0x8'));var config=require(_0x4c0f('0x9'));var controller=require(_0x4c0f('0xa'));router[_0x4c0f('0xb')]('/',auth[_0x4c0f('0xc')](),controller[_0x4c0f('0xd')]);router[_0x4c0f('0xb')](_0x4c0f('0xe'),auth['isAuthenticated'](),controller['describe']);router[_0x4c0f('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x4c0f('0xf')]);router[_0x4c0f('0xb')]('/:id/members',auth[_0x4c0f('0xc')](),controller[_0x4c0f('0x10')]);router[_0x4c0f('0xb')]('/:id/teams',auth[_0x4c0f('0xc')](),controller[_0x4c0f('0x11')]);router['get'](_0x4c0f('0x12'),auth[_0x4c0f('0xc')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x4c0f('0x13')](_0x4c0f('0x14'),auth[_0x4c0f('0xc')](),controller[_0x4c0f('0x15')]);router[_0x4c0f('0x13')]('/:id/users',auth[_0x4c0f('0xc')](),controller[_0x4c0f('0x16')]);router[_0x4c0f('0x17')](_0x4c0f('0x18'),auth['isAuthenticated'](),controller['update']);router[_0x4c0f('0x19')](_0x4c0f('0x18'),auth[_0x4c0f('0xc')](),controller['destroy']);router[_0x4c0f('0x19')](_0x4c0f('0x14'),auth['isAuthenticated'](),controller[_0x4c0f('0x1a')]);router[_0x4c0f('0x19')](_0x4c0f('0x12'),auth[_0x4c0f('0xc')](),controller[_0x4c0f('0x1b')]);module[_0x4c0f('0x1c')]=router; \ No newline at end of file +var _0x50a3=['/:id/users','getAgents','post','create','put','destroy','delete','removeTeams','removeAgents','exports','connect-timeout','express','Router','fs-extra','../../config/environment','./whatsappQueue.controller','isAuthenticated','get','/describe','/:id','getMembers','/:id/teams','getTeams'];(function(_0x114984,_0x5c9593){var _0x44822b=function(_0x10af37){while(--_0x10af37){_0x114984['push'](_0x114984['shift']());}};_0x44822b(++_0x5c9593);}(_0x50a3,0x1d6));var _0x350a=function(_0x51d129,_0x175d7d){_0x51d129=_0x51d129-0x0;var _0x44c377=_0x50a3[_0x51d129];return _0x44c377;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x350a('0x0'));var express=require(_0x350a('0x1'));var router=express[_0x350a('0x2')]();var fs_extra=require(_0x350a('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x350a('0x4'));var controller=require(_0x350a('0x5'));router['get']('/',auth[_0x350a('0x6')](),controller['index']);router[_0x350a('0x7')](_0x350a('0x8'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x350a('0x9'),auth[_0x350a('0x6')](),controller['show']);router[_0x350a('0x7')]('/:id/members',auth[_0x350a('0x6')](),controller[_0x350a('0xa')]);router[_0x350a('0x7')](_0x350a('0xb'),auth['isAuthenticated'](),controller[_0x350a('0xc')]);router['get'](_0x350a('0xd'),auth[_0x350a('0x6')](),controller[_0x350a('0xe')]);router[_0x350a('0xf')]('/',auth['isAuthenticated'](),controller[_0x350a('0x10')]);router[_0x350a('0xf')](_0x350a('0xb'),auth['isAuthenticated'](),controller['addTeams']);router[_0x350a('0xf')](_0x350a('0xd'),auth[_0x350a('0x6')](),controller['addAgents']);router[_0x350a('0x11')](_0x350a('0x9'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x350a('0x6')](),controller[_0x350a('0x12')]);router[_0x350a('0x13')]('/:id/teams',auth[_0x350a('0x6')](),controller[_0x350a('0x14')]);router[_0x350a('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0x350a('0x15')]);module[_0x350a('0x16')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index d08fe3e..dbe780a 100644 --- a/server/api/whatsappQueue/whatsappQueue.attributes.js +++ b/server/api/whatsappQueue/whatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb6b8=['roundrobin','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x220f8d,_0x459aa7){var _0x45e016=function(_0x3d5a23){while(--_0x3d5a23){_0x220f8d['push'](_0x220f8d['shift']());}};_0x45e016(++_0x459aa7);}(_0xb6b8,0xc5));var _0x8b6b=function(_0x29cbaa,_0x30c794){_0x29cbaa=_0x29cbaa-0x0;var _0x32415f=_0xb6b8[_0x29cbaa];return _0x32415f;};'use strict';var Sequelize=require('sequelize');module[_0x8b6b('0x0')]={'name':{'type':Sequelize[_0x8b6b('0x1')],'unique':_0x8b6b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x8b6b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8b6b('0x4')](_0x8b6b('0x5'),'beepall',_0x8b6b('0x6'))},'description':{'type':Sequelize[_0x8b6b('0x1')]}}; \ No newline at end of file +var _0xffaa=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','ENUM'];(function(_0xb00082,_0x4d60e5){var _0x19af20=function(_0x16d4a5){while(--_0x16d4a5){_0xb00082['push'](_0xb00082['shift']());}};_0x19af20(++_0x4d60e5);}(_0xffaa,0x130));var _0xaffa=function(_0x4e2d1e,_0x2bdff0){_0x4e2d1e=_0x4e2d1e-0x0;var _0xd9399d=_0xffaa[_0x4e2d1e];return _0xd9399d;};'use strict';var Sequelize=require(_0xaffa('0x0'));module[_0xaffa('0x1')]={'name':{'type':Sequelize[_0xaffa('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xaffa('0x3')](_0xaffa('0x4'),_0xaffa('0x5'),_0xaffa('0x6'))},'description':{'type':Sequelize[_0xaffa('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index a7564d0..b3a9cd1 100644 --- a/server/api/whatsappQueue/whatsappQueue.controller.js +++ b/server/api/whatsappQueue/whatsappQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f46=['pick','merge','where','type','VIRTUAL','filter','options','include','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','getMembers','findOne','UserWhatsappQueue','hasOwnProperty','User','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','Team','getTeams','addTeams','ids','Agents','voicePause','interface','flatMap','findOrCreate','forEach','emit','removeTeams','field','from','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','SELECT','includes','all','union','compact','value','transaction','isEmpty','removeAgents','addAgents','omit','spread','userWhatsappQueue:save','isArray','userWhatsappQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','json','offset','limit','count','status','set','apply','reject','save','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','send','index','WhatsappQueue','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort'];(function(_0xdc8ff2,_0x4b55dd){var _0x4ad4f1=function(_0x456332){while(--_0x456332){_0xdc8ff2['push'](_0xdc8ff2['shift']());}};_0x4ad4f1(++_0x4b55dd);}(_0x6f46,0x15d));var _0x66f4=function(_0x50225d,_0x388b12){_0x50225d=_0x50225d-0x0;var _0x5baa86=_0x6f46[_0x50225d];return _0x5baa86;};'use strict';var emlformat=require(_0x66f4('0x0'));var rimraf=require(_0x66f4('0x1'));var zipdir=require(_0x66f4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x66f4('0x3'));var moment=require(_0x66f4('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x66f4('0x5'));var path=require(_0x66f4('0x6'));var sox=require('sox');var csv=require(_0x66f4('0x7'));var ejs=require(_0x66f4('0x8'));var fs=require('fs');var fs_extra=require(_0x66f4('0x9'));var _=require(_0x66f4('0xa'));var squel=require(_0x66f4('0xb'));var crypto=require(_0x66f4('0xc'));var jsforce=require(_0x66f4('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x66f4('0xe'));var Papa=require(_0x66f4('0xf'));var Redis=require(_0x66f4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x66f4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x66f4('0x12'));var logger=require(_0x66f4('0x13'))(_0x66f4('0x14'));var utils=require('../../config/utils');var config=require(_0x66f4('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x66f4('0x16'))['db'];config[_0x66f4('0x17')]=_[_0x66f4('0x18')](config[_0x66f4('0x17')],{'host':_0x66f4('0x19'),'port':0x18eb});var socket=require(_0x66f4('0x1a'))(new Redis(config[_0x66f4('0x17')]));require('./whatsappQueue.socket')[_0x66f4('0x1b')](socket);function respondWithStatusCode(_0x1ab20c,_0x22c6e5){_0x22c6e5=_0x22c6e5||0xcc;return function(_0xf71ee8){if(_0xf71ee8){return _0x1ab20c[_0x66f4('0x1c')](_0x22c6e5);}return _0x1ab20c['status'](_0x22c6e5)[_0x66f4('0x1d')]();};}function respondWithResult(_0x30a03d,_0x39a9b3){_0x39a9b3=_0x39a9b3||0xc8;return function(_0x4bba64){if(_0x4bba64){return _0x30a03d['status'](_0x39a9b3)[_0x66f4('0x1e')](_0x4bba64);}};}function respondWithFilteredResult(_0xfd0eb6,_0x3ea0a1){return function(_0x2df2c6){if(_0x2df2c6){var _0x306250=typeof _0x3ea0a1[_0x66f4('0x1f')]==='undefined'&&typeof _0x3ea0a1[_0x66f4('0x20')]==='undefined';var _0x58a48e=_0x2df2c6[_0x66f4('0x21')];var _0x368885=_0x306250?0x0:_0x3ea0a1[_0x66f4('0x1f')];var _0xeab7bd=_0x306250?_0x2df2c6[_0x66f4('0x21')]:_0x3ea0a1['offset']+_0x3ea0a1[_0x66f4('0x20')];var _0xd40da4;if(_0xeab7bd>=_0x58a48e){_0xeab7bd=_0x58a48e;_0xd40da4=0xc8;}else{_0xd40da4=0xce;}_0xfd0eb6[_0x66f4('0x22')](_0xd40da4);return _0xfd0eb6[_0x66f4('0x23')]('Content-Range',_0x368885+'-'+_0xeab7bd+'/'+_0x58a48e)[_0x66f4('0x1e')](_0x2df2c6);}return null;};}function patchUpdates(_0x294193){return function(_0x483844){try{jsonpatch[_0x66f4('0x24')](_0x483844,_0x294193,!![]);}catch(_0x436a84){return BPromise[_0x66f4('0x25')](_0x436a84);}return _0x483844[_0x66f4('0x26')]();};}function saveUpdates(_0x37003d,_0x560352){return function(_0x50bb0b){if(_0x50bb0b){return _0x50bb0b['update'](_0x37003d)[_0x66f4('0x27')](function(_0x392033){return _0x392033;});}return null;};}function removeEntity(_0x38d836,_0x65dd8a){return function(_0x3e5db5){if(_0x3e5db5){return _0x3e5db5[_0x66f4('0x28')]()['then'](function(){var _0x159b84=_0x3e5db5[_0x66f4('0x29')]({'plain':!![]});var _0x112d48=_0x66f4('0x2a');return db[_0x66f4('0x2b')][_0x66f4('0x28')]({'where':{'type':_0x112d48,'resourceId':_0x159b84['id']}})['then'](function(){return _0x3e5db5;});})['then'](function(){_0x38d836[_0x66f4('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5861c4,_0xaed7de){return function(_0x195a81){if(!_0x195a81){_0x5861c4['sendStatus'](0x194);}return _0x195a81;};}function handleError(_0x3d7fa8,_0x156190){_0x156190=_0x156190||0x1f4;return function(_0x82a54a){logger[_0x66f4('0x2c')](_0x82a54a[_0x66f4('0x2d')]);if(_0x82a54a[_0x66f4('0x2e')]){delete _0x82a54a[_0x66f4('0x2e')];}_0x3d7fa8[_0x66f4('0x22')](_0x156190)[_0x66f4('0x2f')](_0x82a54a);};}exports[_0x66f4('0x30')]=function(_0xbcb4df,_0x2e2f3c){var _0x1a8e18={},_0x1fe9ec={},_0x524e7b={'count':0x0,'rows':[]};var _0x539cfe=_['map'](db[_0x66f4('0x31')][_0x66f4('0x32')],function(_0xa0bcc){return{'name':_0xa0bcc[_0x66f4('0x33')],'type':_0xa0bcc['type'][_0x66f4('0x34')]};});_0x1fe9ec[_0x66f4('0x35')]=_[_0x66f4('0x36')](_0x539cfe,_0x66f4('0x2e'));_0x1fe9ec[_0x66f4('0x37')]=_[_0x66f4('0x38')](_0xbcb4df[_0x66f4('0x37')]);_0x1fe9ec[_0x66f4('0x39')]=_[_0x66f4('0x3a')](_0x1fe9ec['model'],_0x1fe9ec['query']);_0x1a8e18[_0x66f4('0x3b')]=_[_0x66f4('0x3a')](_0x1fe9ec[_0x66f4('0x35')],qs['fields'](_0xbcb4df[_0x66f4('0x37')][_0x66f4('0x3c')]));_0x1a8e18['attributes']=_0x1a8e18[_0x66f4('0x3b')][_0x66f4('0x3d')]?_0x1a8e18[_0x66f4('0x3b')]:_0x1fe9ec[_0x66f4('0x35')];if(!_0xbcb4df[_0x66f4('0x37')]['hasOwnProperty'](_0x66f4('0x3e'))){_0x1a8e18[_0x66f4('0x20')]=qs[_0x66f4('0x20')](_0xbcb4df['query'][_0x66f4('0x20')]);_0x1a8e18[_0x66f4('0x1f')]=qs[_0x66f4('0x1f')](_0xbcb4df[_0x66f4('0x37')][_0x66f4('0x1f')]);}_0x1a8e18[_0x66f4('0x3f')]=qs[_0x66f4('0x40')](_0xbcb4df['query'][_0x66f4('0x40')]);_0x1a8e18['where']=qs[_0x66f4('0x39')](_[_0x66f4('0x41')](_0xbcb4df[_0x66f4('0x37')],_0x1fe9ec['filters']),_0x539cfe);if(_0xbcb4df[_0x66f4('0x37')]['filter']){_0x1a8e18['where']=_[_0x66f4('0x42')](_0x1a8e18[_0x66f4('0x43')],{'$or':_[_0x66f4('0x36')](_0x539cfe,function(_0x3e4d52){if(_0x3e4d52[_0x66f4('0x44')]!==_0x66f4('0x45')){var _0x19b774={};_0x19b774[_0x3e4d52[_0x66f4('0x2e')]]={'$like':'%'+_0xbcb4df['query'][_0x66f4('0x46')]+'%'};return _0x19b774;}})});}_0x1a8e18=_['merge']({},_0x1a8e18,_0xbcb4df[_0x66f4('0x47')]);var _0x465640={'where':_0x1a8e18[_0x66f4('0x43')]};return db[_0x66f4('0x31')][_0x66f4('0x21')](_0x465640)[_0x66f4('0x27')](function(_0x9537a){_0x524e7b[_0x66f4('0x21')]=_0x9537a;if(_0xbcb4df[_0x66f4('0x37')]['includeAll']){_0x1a8e18[_0x66f4('0x48')]=[{'all':!![]}];}return db['WhatsappQueue'][_0x66f4('0x49')](_0x1a8e18);})['then'](function(_0x48aceb){_0x524e7b[_0x66f4('0x4a')]=_0x48aceb;return _0x524e7b;})['then'](respondWithFilteredResult(_0x2e2f3c,_0x1a8e18))[_0x66f4('0x4b')](handleError(_0x2e2f3c,null));};exports[_0x66f4('0x4c')]=function(_0x1cc083,_0x38f7db){var _0x2ea0a0={'raw':!![],'where':{'id':_0x1cc083['params']['id']}},_0x13ddf7={};_0x13ddf7[_0x66f4('0x35')]=_[_0x66f4('0x38')](db['WhatsappQueue']['rawAttributes']);_0x13ddf7[_0x66f4('0x37')]=_[_0x66f4('0x38')](_0x1cc083[_0x66f4('0x37')]);_0x13ddf7[_0x66f4('0x39')]=_[_0x66f4('0x3a')](_0x13ddf7[_0x66f4('0x35')],_0x13ddf7[_0x66f4('0x37')]);_0x2ea0a0[_0x66f4('0x3b')]=_[_0x66f4('0x3a')](_0x13ddf7['model'],qs[_0x66f4('0x3c')](_0x1cc083[_0x66f4('0x37')][_0x66f4('0x3c')]));_0x2ea0a0[_0x66f4('0x3b')]=_0x2ea0a0[_0x66f4('0x3b')][_0x66f4('0x3d')]?_0x2ea0a0['attributes']:_0x13ddf7['model'];if(_0x1cc083[_0x66f4('0x37')]['includeAll']){_0x2ea0a0['include']=[{'all':!![]}];}_0x2ea0a0=_['merge']({},_0x2ea0a0,_0x1cc083[_0x66f4('0x47')]);return db[_0x66f4('0x31')][_0x66f4('0x4d')](_0x2ea0a0)[_0x66f4('0x27')](handleEntityNotFound(_0x38f7db,null))[_0x66f4('0x27')](respondWithResult(_0x38f7db,null))[_0x66f4('0x4b')](handleError(_0x38f7db,null));};exports[_0x66f4('0x4e')]=function(_0x3e9d69,_0x4267ba){return db[_0x66f4('0x31')][_0x66f4('0x4e')](_0x3e9d69[_0x66f4('0x4f')],{})[_0x66f4('0x27')](function(_0x5da791){var _0x5d0c37=_0x3e9d69[_0x66f4('0x50')][_0x66f4('0x29')]({'plain':!![]});if(!_0x5d0c37)throw new Error(_0x66f4('0x51'));if(_0x5d0c37[_0x66f4('0x52')]==='user'){var _0x2b0602=_0x5da791[_0x66f4('0x29')]({'plain':!![]});var _0xf388d6='WhatsappQueues';return db[_0x66f4('0x53')]['find']({'where':{'name':_0xf388d6,'userProfileId':_0x5d0c37[_0x66f4('0x54')]},'raw':!![]})[_0x66f4('0x27')](function(_0x54bbd9){if(_0x54bbd9&&_0x54bbd9['autoAssociation']===0x0){return db[_0x66f4('0x2b')][_0x66f4('0x4e')]({'name':_0x2b0602[_0x66f4('0x2e')],'resourceId':_0x2b0602['id'],'type':_0x54bbd9['name'],'sectionId':_0x54bbd9['id']},{})[_0x66f4('0x27')](function(){return _0x5da791;});}else{return _0x5da791;}})['catch'](function(_0x22a19b){logger[_0x66f4('0x2c')](_0x66f4('0x55'),_0x22a19b);throw _0x22a19b;});}return _0x5da791;})['then'](respondWithResult(_0x4267ba,0xc9))[_0x66f4('0x4b')](handleError(_0x4267ba,null));};exports[_0x66f4('0x56')]=function(_0x4c3a60,_0x5e6de1){if(_0x4c3a60[_0x66f4('0x4f')]['id']){delete _0x4c3a60['body']['id'];}return db['WhatsappQueue'][_0x66f4('0x4d')]({'where':{'id':_0x4c3a60[_0x66f4('0x57')]['id']}})[_0x66f4('0x27')](handleEntityNotFound(_0x5e6de1,null))[_0x66f4('0x27')](saveUpdates(_0x4c3a60[_0x66f4('0x4f')],null))[_0x66f4('0x27')](respondWithResult(_0x5e6de1,null))[_0x66f4('0x4b')](handleError(_0x5e6de1,null));};exports['destroy']=function(_0x2eae7d,_0x40aaa5){return db[_0x66f4('0x31')][_0x66f4('0x4d')]({'where':{'id':_0x2eae7d['params']['id']}})[_0x66f4('0x27')](handleEntityNotFound(_0x40aaa5,null))[_0x66f4('0x27')](removeEntity(_0x40aaa5,null))[_0x66f4('0x4b')](handleError(_0x40aaa5,null));};exports['describe']=function(_0xba35ba,_0x1b29e9){return db[_0x66f4('0x31')][_0x66f4('0x58')]()[_0x66f4('0x27')](respondWithResult(_0x1b29e9,null))['catch'](handleError(_0x1b29e9,null));};exports[_0x66f4('0x59')]=function(_0x3c37b3,_0x2987c2,_0x596996){var _0x40b61b={'raw':!![],'where':{}},_0xbf2346={},_0x1f837b;return db[_0x66f4('0x31')][_0x66f4('0x5a')]({'where':{'id':_0x3c37b3[_0x66f4('0x57')]['id']}})[_0x66f4('0x27')](handleEntityNotFound(_0x2987c2,null))[_0x66f4('0x27')](function(_0x37680e){if(_0x37680e){_0x1f837b=_0x37680e[_0x66f4('0x29')]({'plain':!![]});_0xbf2346[_0x66f4('0x35')]=_[_0x66f4('0x38')](db[_0x66f4('0x5b')][_0x66f4('0x32')]);_0xbf2346[_0x66f4('0x37')]=_[_0x66f4('0x38')](_0x3c37b3[_0x66f4('0x37')]);_0xbf2346[_0x66f4('0x39')]=_[_0x66f4('0x3a')](_0xbf2346[_0x66f4('0x35')],_0xbf2346['query']);_0x40b61b[_0x66f4('0x3b')]=_['intersection'](_0xbf2346[_0x66f4('0x35')],qs[_0x66f4('0x3c')](_0x3c37b3[_0x66f4('0x37')]['fields']));_0x40b61b[_0x66f4('0x3b')]=_0x40b61b[_0x66f4('0x3b')][_0x66f4('0x3d')]?_0x40b61b[_0x66f4('0x3b')]:_0xbf2346['model'];if(!_0x3c37b3[_0x66f4('0x37')][_0x66f4('0x5c')]('nolimit')){_0x40b61b[_0x66f4('0x20')]=qs[_0x66f4('0x20')](_0x3c37b3[_0x66f4('0x37')][_0x66f4('0x20')]);_0x40b61b[_0x66f4('0x1f')]=qs['offset'](_0x3c37b3[_0x66f4('0x37')][_0x66f4('0x1f')]);}_0x40b61b[_0x66f4('0x3f')]=qs['sort'](_0x3c37b3[_0x66f4('0x37')][_0x66f4('0x40')]);_0x40b61b['where']=qs['filters'](_[_0x66f4('0x41')](_0x3c37b3['query'],_0xbf2346[_0x66f4('0x39')]));_0x40b61b[_0x66f4('0x43')]['WhatsappQueueId']=_0x37680e['id'];if(_0x3c37b3[_0x66f4('0x37')][_0x66f4('0x46')]){_0x40b61b[_0x66f4('0x43')]=_['merge'](_0x40b61b['where'],{'$or':_[_0x66f4('0x36')](_0x40b61b[_0x66f4('0x3b')],function(_0x5c0a4a){var _0x564ec8={};_0x564ec8[_0x5c0a4a]={'$like':'%'+_0x3c37b3['query']['filter']+'%'};return _0x564ec8;})});}_0x40b61b=_[_0x66f4('0x42')]({},_0x40b61b,_0x3c37b3[_0x66f4('0x47')]);return db['UserWhatsappQueue'][_0x66f4('0x49')](_0x40b61b);}})[_0x66f4('0x27')](function(_0x49ae15){if(_0x49ae15){return db[_0x66f4('0x5d')]['findAndCountAll']({'where':{'id':_[_0x66f4('0x36')](_0x49ae15,_0x66f4('0x5e')),'role':_0x66f4('0x5f')},'attributes':['id',_0x66f4('0x2e'),_0x66f4('0x60'),_0x66f4('0x61'),_0x66f4('0x62')]});}})[_0x66f4('0x27')](function(_0x31aadc){if(_0x31aadc){return{'count':_0x31aadc[_0x66f4('0x21')],'rows':_[_0x66f4('0x36')](_0x31aadc[_0x66f4('0x4a')],function(_0x462e65){return{'membername':_0x462e65[_0x66f4('0x2e')],'UserId':_0x462e65['id'],'queue_name':_0x1f837b['name'],'WhatsappQueueId':_0x1f837b['id'],'interface':util[_0x66f4('0x63')](_0x66f4('0x64'),'SIP',_0x462e65[_0x66f4('0x2e')]),'penalty':0x0,'paused':_0x462e65[_0x66f4('0x60')],'createdAt':_0x462e65[_0x66f4('0x62')],'updatedAt':_0x462e65['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2987c2,_0x40b61b))[_0x66f4('0x4b')](handleError(_0x2987c2,null));};exports['getTeams']=function(_0x1865af,_0xbc9b2c,_0x4833cc){var _0x59187f={};var _0x1ef21c={};var _0x3beaf6;var _0x237769;return db['WhatsappQueue'][_0x66f4('0x5a')]({'where':{'id':_0x1865af[_0x66f4('0x57')]['id']}})[_0x66f4('0x27')](handleEntityNotFound(_0xbc9b2c,null))[_0x66f4('0x27')](function(_0x42b358){if(_0x42b358){_0x3beaf6=_0x42b358;_0x1ef21c[_0x66f4('0x35')]=_[_0x66f4('0x38')](db[_0x66f4('0x65')][_0x66f4('0x32')]);_0x1ef21c[_0x66f4('0x37')]=_['keys'](_0x1865af[_0x66f4('0x37')]);_0x1ef21c[_0x66f4('0x39')]=_[_0x66f4('0x3a')](_0x1ef21c[_0x66f4('0x35')],_0x1ef21c[_0x66f4('0x37')]);_0x59187f[_0x66f4('0x3b')]=_['intersection'](_0x1ef21c[_0x66f4('0x35')],qs['fields'](_0x1865af['query'][_0x66f4('0x3c')]));_0x59187f[_0x66f4('0x3b')]=_0x59187f['attributes']['length']?_0x59187f[_0x66f4('0x3b')]:_0x1ef21c['model'];_0x59187f['order']=qs[_0x66f4('0x40')](_0x1865af[_0x66f4('0x37')][_0x66f4('0x40')]);_0x59187f[_0x66f4('0x43')]=qs[_0x66f4('0x39')](_[_0x66f4('0x41')](_0x1865af[_0x66f4('0x37')],_0x1ef21c[_0x66f4('0x39')]));if(_0x1865af[_0x66f4('0x37')]['filter']){_0x59187f[_0x66f4('0x43')]=_[_0x66f4('0x42')](_0x59187f[_0x66f4('0x43')],{'$or':_[_0x66f4('0x36')](_0x59187f['attributes'],function(_0x18c9cb){var _0x4390d9={};_0x4390d9[_0x18c9cb]={'$like':'%'+_0x1865af[_0x66f4('0x37')]['filter']+'%'};return _0x4390d9;})});}_0x59187f=_[_0x66f4('0x42')]({},_0x59187f,_0x1865af['options']);return _0x3beaf6[_0x66f4('0x66')](_0x59187f);}})['then'](function(_0x3c0809){if(_0x3c0809){_0x237769=_0x3c0809[_0x66f4('0x3d')];if(!_0x1865af[_0x66f4('0x37')][_0x66f4('0x5c')]('nolimit')){_0x59187f['limit']=qs['limit'](_0x1865af[_0x66f4('0x37')]['limit']);_0x59187f[_0x66f4('0x1f')]=qs['offset'](_0x1865af['query'][_0x66f4('0x1f')]);}return _0x3beaf6[_0x66f4('0x66')](_0x59187f);}})[_0x66f4('0x27')](function(_0x2da651){if(_0x2da651){return _0x2da651?{'count':_0x237769,'rows':_0x2da651}:null;}})['then'](respondWithResult(_0xbc9b2c,null))[_0x66f4('0x4b')](handleError(_0xbc9b2c,null));};exports[_0x66f4('0x67')]=function(_0x293a10,_0x2c3e11,_0x54fa7f){var _0x59e611=_0x293a10[_0x66f4('0x4f')][_0x66f4('0x68')];return db[_0x66f4('0x65')][_0x66f4('0x49')]({'where':{'id':_0x59e611},'attributes':['id'],'include':[{'model':db['User'],'as':_0x66f4('0x69'),'attributes':['id',_0x66f4('0x2e'),'online',_0x66f4('0x6a'),_0x66f4('0x6b')],'raw':!![]}]})[_0x66f4('0x27')](function(_0x285528){if(_0x285528){var _0x3ff5dd=_[_0x66f4('0x6c')](_0x285528,function(_0x403ef8){var _0x35e4f0=_0x403ef8[_0x66f4('0x29')]({'plain':!![]});return _0x35e4f0[_0x66f4('0x69')];});return db[_0x66f4('0x31')][_0x66f4('0x4d')]({'where':{'id':_0x293a10[_0x66f4('0x57')]['id']}})[_0x66f4('0x27')](function(_0x1ded8a){return db['sequelize']['transaction'](function(_0x2bbb44){return _0x1ded8a[_0x66f4('0x67')](_0x59e611,{'transaction':_0x2bbb44})['then'](function(){return BPromise['each'](_0x3ff5dd,function(_0x34bf1e){return db['UserWhatsappQueue'][_0x66f4('0x6d')]({'where':{'UserId':_0x34bf1e['id'],'WhatsappQueueId':_0x293a10['params']['id']},'transaction':_0x2bbb44});});})[_0x66f4('0x27')](function(){_0x3ff5dd[_0x66f4('0x6e')](function(_0x2794b1){socket[_0x66f4('0x6f')]('userWhatsappQueue:save',{'UserId':_0x2794b1['id'],'WhatsappQueueId':_0x1ded8a['id']});});});});});}})['then'](respondWithStatusCode(_0x2c3e11,null))['catch'](handleError(_0x2c3e11,null));};exports[_0x66f4('0x70')]=function(_0x20f58c,_0x5c80d1,_0x27783f){return db[_0x66f4('0x65')][_0x66f4('0x49')]({'where':{'id':_0x20f58c[_0x66f4('0x37')][_0x66f4('0x68')]},'attributes':['id'],'include':[{'model':db[_0x66f4('0x5d')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x66f4('0x27')](handleEntityNotFound(_0x5c80d1,null))[_0x66f4('0x27')](function(_0x1e562f){var _0x1eefac=_[_0x66f4('0x36')](_0x1e562f,'id');var _0x3854c3=[];var _0x417081=[];var _0x75c3c9=squel['select']();_0x75c3c9[_0x66f4('0x71')]('tq.TeamId')[_0x66f4('0x72')](_0x66f4('0x73'),'tq')[_0x66f4('0x74')]('user_has_teams','ut',_0x66f4('0x75'))['where'](_0x66f4('0x76'),_0x20f58c['params']['id']);for(var _0x49f8b2=0x0;_0x49f8b2<_0x1e562f['length'];_0x49f8b2+=0x1){let _0xa37aee=_0x1e562f[_0x49f8b2];for(var _0x1d3fd6=0x0;_0x1d3fd6<_0xa37aee[_0x66f4('0x69')][_0x66f4('0x3d')];_0x1d3fd6+=0x1){let _0x824b27=_0xa37aee['Agents'][_0x1d3fd6];var _0x48318f=_0x75c3c9[_0x66f4('0x77')]();_0x48318f['where'](_0x66f4('0x78'),_0x824b27['id']);_0x417081['push'](db[_0x66f4('0x79')][_0x66f4('0x37')](_0x48318f['toString'](),{'type':db['sequelize']['QueryTypes'][_0x66f4('0x7a')]})[_0x66f4('0x27')](function(_0x4e415b){if(_0x4e415b[_0x66f4('0x3d')]===0x1){return _0x824b27['id'];}else{var _0x3c96d3=_['every'](_['map'](_0x4e415b,'TeamId'),function(_0x4d455d){return _[_0x66f4('0x7b')](_0x1eefac,_0x4d455d);});if(_0x3c96d3){return _0x824b27['id'];}}}));}}return BPromise[_0x66f4('0x7c')](_0x417081)[_0x66f4('0x27')](function(_0x141c38){_0x3854c3=_(_0x3854c3)[_0x66f4('0x7d')](_0x141c38)[_0x66f4('0x7e')]()[_0x66f4('0x7f')]();return db[_0x66f4('0x31')][_0x66f4('0x4d')]({'where':{'id':_0x20f58c[_0x66f4('0x57')]['id']}})[_0x66f4('0x27')](function(_0x385149){return db[_0x66f4('0x79')][_0x66f4('0x80')](function(_0x34ef42){return _0x385149[_0x66f4('0x70')](_0x20f58c[_0x66f4('0x37')]['ids'],{'transaction':_0x34ef42})[_0x66f4('0x27')](function(){if(!_[_0x66f4('0x81')](_0x3854c3)){return _0x385149[_0x66f4('0x82')](_0x3854c3,{'transaction':_0x34ef42});}})['then'](function(){_0x3854c3['forEach'](function(_0x5ab68d){socket['emit']('userWhatsappQueue:remove',{'UserId':_0x5ab68d,'WhatsappQueueId':_0x385149['id']});});});});});});})[_0x66f4('0x27')](respondWithStatusCode(_0x5c80d1,null))['catch'](handleError(_0x5c80d1,null));};exports[_0x66f4('0x83')]=function(_0x1471ba,_0x58e28a,_0x4708ce){return db[_0x66f4('0x31')][_0x66f4('0x4d')]({'where':{'id':_0x1471ba['params']['id']}})['then'](handleEntityNotFound(_0x58e28a,null))[_0x66f4('0x27')](function(_0x582bb6){if(_0x582bb6){return _0x582bb6[_0x66f4('0x83')](_0x1471ba['body'][_0x66f4('0x68')],_[_0x66f4('0x84')](_0x1471ba[_0x66f4('0x4f')],[_0x66f4('0x68'),'id'])||{})[_0x66f4('0x85')](function(_0x205ea8){for(var _0x7be28f=0x0;_0x7be28f<_0x1471ba['body'][_0x66f4('0x68')][_0x66f4('0x3d')];_0x7be28f+=0x1){socket['emit'](_0x66f4('0x86'),{'UserId':Number(_0x1471ba[_0x66f4('0x4f')]['ids'][_0x7be28f]),'WhatsappQueueId':Number(_0x1471ba[_0x66f4('0x57')]['id'])});}return _0x205ea8;});}})[_0x66f4('0x27')](respondWithResult(_0x58e28a,null))['catch'](handleError(_0x58e28a,null));};exports[_0x66f4('0x82')]=function(_0x3d681e,_0x9a4d5f,_0x16d0a3){return db['WhatsappQueue'][_0x66f4('0x4d')]({'where':{'id':_0x3d681e[_0x66f4('0x57')]['id']}})[_0x66f4('0x27')](handleEntityNotFound(_0x9a4d5f,null))[_0x66f4('0x27')](function(_0x1803a9){if(_0x1803a9){return _0x1803a9[_0x66f4('0x82')](_0x3d681e['query'][_0x66f4('0x68')])[_0x66f4('0x27')](function(){if(_[_0x66f4('0x87')](_0x3d681e[_0x66f4('0x37')][_0x66f4('0x68')])){for(var _0x420c6d=0x0;_0x420c6d<_0x3d681e[_0x66f4('0x37')]['ids'][_0x66f4('0x3d')];_0x420c6d+=0x1){socket[_0x66f4('0x6f')](_0x66f4('0x88'),{'UserId':Number(_0x3d681e['query']['ids'][_0x420c6d]),'WhatsappQueueId':Number(_0x3d681e['params']['id'])});}}else{socket[_0x66f4('0x6f')](_0x66f4('0x88'),{'UserId':Number(_0x3d681e['query']['ids']),'WhatsappQueueId':Number(_0x3d681e[_0x66f4('0x57')]['id'])});}});}})[_0x66f4('0x27')](respondWithStatusCode(_0x9a4d5f,null))['catch'](handleError(_0x9a4d5f,null));};exports[_0x66f4('0x89')]=function(_0x3f52db,_0x25f3ed,_0xde1e4d){var _0x5f3a34={};var _0x1fc837={};var _0x38a53c;var _0x2386a6;return db['WhatsappQueue'][_0x66f4('0x5a')]({'where':{'id':_0x3f52db[_0x66f4('0x57')]['id']}})[_0x66f4('0x27')](handleEntityNotFound(_0x25f3ed,null))[_0x66f4('0x27')](function(_0x208daf){if(_0x208daf){_0x38a53c=_0x208daf;_0x1fc837[_0x66f4('0x35')]=_[_0x66f4('0x38')](db[_0x66f4('0x5d')]['rawAttributes']);_0x1fc837[_0x66f4('0x37')]=_[_0x66f4('0x38')](_0x3f52db[_0x66f4('0x37')]);_0x1fc837[_0x66f4('0x39')]=_[_0x66f4('0x3a')](_0x1fc837['model'],_0x1fc837['query']);_0x5f3a34[_0x66f4('0x3b')]=_[_0x66f4('0x3a')](_0x1fc837[_0x66f4('0x35')],qs['fields'](_0x3f52db[_0x66f4('0x37')]['fields']));_0x5f3a34[_0x66f4('0x3b')]=_0x5f3a34[_0x66f4('0x3b')]['length']?_0x5f3a34['attributes']:_0x1fc837[_0x66f4('0x35')];_0x5f3a34[_0x66f4('0x3f')]=qs[_0x66f4('0x40')](_0x3f52db[_0x66f4('0x37')]['sort']);_0x5f3a34[_0x66f4('0x43')]=qs[_0x66f4('0x39')](_[_0x66f4('0x41')](_0x3f52db[_0x66f4('0x37')],_0x1fc837['filters']));if(_0x3f52db[_0x66f4('0x37')][_0x66f4('0x46')]){_0x5f3a34[_0x66f4('0x43')]=_[_0x66f4('0x42')](_0x5f3a34[_0x66f4('0x43')],{'$or':_[_0x66f4('0x36')](_0x5f3a34['attributes'],function(_0x35bde2){var _0x2b5530={};_0x2b5530[_0x35bde2]={'$like':'%'+_0x3f52db[_0x66f4('0x37')][_0x66f4('0x46')]+'%'};return _0x2b5530;})});}_0x5f3a34=_[_0x66f4('0x42')]({},_0x5f3a34,_0x3f52db[_0x66f4('0x47')]);return _0x38a53c[_0x66f4('0x89')](_0x5f3a34);}})[_0x66f4('0x27')](function(_0x4f1c76){if(_0x4f1c76){_0x2386a6=_0x4f1c76[_0x66f4('0x3d')];if(!_0x3f52db[_0x66f4('0x37')][_0x66f4('0x5c')](_0x66f4('0x3e'))){_0x5f3a34['limit']=qs[_0x66f4('0x20')](_0x3f52db[_0x66f4('0x37')]['limit']);_0x5f3a34[_0x66f4('0x1f')]=qs[_0x66f4('0x1f')](_0x3f52db['query'][_0x66f4('0x1f')]);}return _0x38a53c['getAgents'](_0x5f3a34);}})[_0x66f4('0x27')](function(_0x576317){if(_0x576317){return _0x576317?{'count':_0x2386a6,'rows':_0x576317}:null;}})['then'](respondWithResult(_0x25f3ed,null))['catch'](handleError(_0x25f3ed,null));}; \ No newline at end of file +var _0xdf17=['send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','WhatsappQueue','includeAll','include','findAll','rows','show','keys','length','find','catch','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserWhatsappQueue','User','UserId','agent','createdAt','format','whatsappPause','updatedAt','Team','getTeams','addTeams','online','voicePause','interface','flatMap','Agents','transaction','each','findOrCreate','emit','userWhatsappQueue:save','removeTeams','ids','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','union','compact','isEmpty','forEach','userWhatsappQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./whatsappQueue.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','destroy','then','get','WhatsappQueues','UserProfileResource','sendStatus','error','stack','name'];(function(_0x55b1f6,_0x16882b){var _0xa4b44f=function(_0x147a49){while(--_0x147a49){_0x55b1f6['push'](_0x55b1f6['shift']());}};_0xa4b44f(++_0x16882b);}(_0xdf17,0x173));var _0x7df1=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xdf17[_0x487b0c];return _0x1adbdc;};'use strict';var emlformat=require(_0x7df1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7df1('0x1'));var rp=require(_0x7df1('0x2'));var moment=require(_0x7df1('0x3'));var BPromise=require(_0x7df1('0x4'));var Mustache=require(_0x7df1('0x5'));var util=require('util');var path=require(_0x7df1('0x6'));var sox=require(_0x7df1('0x7'));var csv=require(_0x7df1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7df1('0x9'));var _=require(_0x7df1('0xa'));var squel=require('squel');var crypto=require(_0x7df1('0xb'));var jsforce=require(_0x7df1('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7df1('0x8'));var querystring=require('querystring');var Papa=require(_0x7df1('0xd'));var Redis=require(_0x7df1('0xe'));var authService=require(_0x7df1('0xf'));var qs=require(_0x7df1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7df1('0x11'))(_0x7df1('0x12'));var utils=require(_0x7df1('0x13'));var config=require(_0x7df1('0x14'));var licenseUtil=require(_0x7df1('0x15'));var db=require(_0x7df1('0x16'))['db'];config[_0x7df1('0x17')]=_[_0x7df1('0x18')](config[_0x7df1('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7df1('0x17')]));require(_0x7df1('0x19'))[_0x7df1('0x1a')](socket);function respondWithStatusCode(_0x33a438,_0x8d6f1c){_0x8d6f1c=_0x8d6f1c||0xcc;return function(_0x26d0e4){if(_0x26d0e4){return _0x33a438['sendStatus'](_0x8d6f1c);}return _0x33a438[_0x7df1('0x1b')](_0x8d6f1c)[_0x7df1('0x1c')]();};}function respondWithResult(_0x4a0f0a,_0x57738e){_0x57738e=_0x57738e||0xc8;return function(_0x95edf5){if(_0x95edf5){return _0x4a0f0a[_0x7df1('0x1b')](_0x57738e)[_0x7df1('0x1d')](_0x95edf5);}};}function respondWithFilteredResult(_0x358c61,_0x79a303){return function(_0x3a27f6){if(_0x3a27f6){var _0x30ef3c=typeof _0x79a303[_0x7df1('0x1e')]===_0x7df1('0x1f')&&typeof _0x79a303[_0x7df1('0x20')]===_0x7df1('0x1f');var _0xc632b2=_0x3a27f6['count'];var _0x3754bf=_0x30ef3c?0x0:_0x79a303['offset'];var _0x5bc9f1=_0x30ef3c?_0x3a27f6[_0x7df1('0x21')]:_0x79a303[_0x7df1('0x1e')]+_0x79a303[_0x7df1('0x20')];var _0x196655;if(_0x5bc9f1>=_0xc632b2){_0x5bc9f1=_0xc632b2;_0x196655=0xc8;}else{_0x196655=0xce;}_0x358c61[_0x7df1('0x1b')](_0x196655);return _0x358c61['set'](_0x7df1('0x22'),_0x3754bf+'-'+_0x5bc9f1+'/'+_0xc632b2)[_0x7df1('0x1d')](_0x3a27f6);}return null;};}function patchUpdates(_0x7e678b){return function(_0x4fb59b){try{jsonpatch[_0x7df1('0x23')](_0x4fb59b,_0x7e678b,!![]);}catch(_0x3eda40){return BPromise['reject'](_0x3eda40);}return _0x4fb59b['save']();};}function saveUpdates(_0x34d18e,_0x4cc42c){return function(_0x30de60){if(_0x30de60){return _0x30de60[_0x7df1('0x24')](_0x34d18e)['then'](function(_0x3230aa){return _0x3230aa;});}return null;};}function removeEntity(_0x21b65c,_0x4ea25f){return function(_0x381acc){if(_0x381acc){return _0x381acc[_0x7df1('0x25')]()[_0x7df1('0x26')](function(){var _0x15981d=_0x381acc[_0x7df1('0x27')]({'plain':!![]});var _0x1116de=_0x7df1('0x28');return db[_0x7df1('0x29')][_0x7df1('0x25')]({'where':{'type':_0x1116de,'resourceId':_0x15981d['id']}})[_0x7df1('0x26')](function(){return _0x381acc;});})[_0x7df1('0x26')](function(){_0x21b65c[_0x7df1('0x1b')](0xcc)[_0x7df1('0x1c')]();});}};}function handleEntityNotFound(_0x1f5256,_0x44810e){return function(_0xc409a){if(!_0xc409a){_0x1f5256[_0x7df1('0x2a')](0x194);}return _0xc409a;};}function handleError(_0x189961,_0x2f64df){_0x2f64df=_0x2f64df||0x1f4;return function(_0x2e8a60){logger[_0x7df1('0x2b')](_0x2e8a60[_0x7df1('0x2c')]);if(_0x2e8a60[_0x7df1('0x2d')]){delete _0x2e8a60['name'];}_0x189961[_0x7df1('0x1b')](_0x2f64df)[_0x7df1('0x2e')](_0x2e8a60);};}exports[_0x7df1('0x2f')]=function(_0x1bf0ee,_0x23df16){var _0x1d4243={},_0x26ce44={},_0x4b747c={'count':0x0,'rows':[]};var _0x281b19=_[_0x7df1('0x30')](db['WhatsappQueue'][_0x7df1('0x31')],function(_0x423e32){return{'name':_0x423e32[_0x7df1('0x32')],'type':_0x423e32[_0x7df1('0x33')][_0x7df1('0x34')]};});_0x26ce44[_0x7df1('0x35')]=_[_0x7df1('0x30')](_0x281b19,_0x7df1('0x2d'));_0x26ce44[_0x7df1('0x36')]=_['keys'](_0x1bf0ee[_0x7df1('0x36')]);_0x26ce44[_0x7df1('0x37')]=_[_0x7df1('0x38')](_0x26ce44[_0x7df1('0x35')],_0x26ce44['query']);_0x1d4243['attributes']=_[_0x7df1('0x38')](_0x26ce44[_0x7df1('0x35')],qs[_0x7df1('0x39')](_0x1bf0ee[_0x7df1('0x36')][_0x7df1('0x39')]));_0x1d4243[_0x7df1('0x3a')]=_0x1d4243[_0x7df1('0x3a')]['length']?_0x1d4243[_0x7df1('0x3a')]:_0x26ce44[_0x7df1('0x35')];if(!_0x1bf0ee['query'][_0x7df1('0x3b')](_0x7df1('0x3c'))){_0x1d4243[_0x7df1('0x20')]=qs[_0x7df1('0x20')](_0x1bf0ee[_0x7df1('0x36')][_0x7df1('0x20')]);_0x1d4243['offset']=qs[_0x7df1('0x1e')](_0x1bf0ee[_0x7df1('0x36')][_0x7df1('0x1e')]);}_0x1d4243[_0x7df1('0x3d')]=qs[_0x7df1('0x3e')](_0x1bf0ee[_0x7df1('0x36')][_0x7df1('0x3e')]);_0x1d4243[_0x7df1('0x3f')]=qs[_0x7df1('0x37')](_[_0x7df1('0x40')](_0x1bf0ee['query'],_0x26ce44[_0x7df1('0x37')]),_0x281b19);if(_0x1bf0ee[_0x7df1('0x36')][_0x7df1('0x41')]){_0x1d4243[_0x7df1('0x3f')]=_[_0x7df1('0x42')](_0x1d4243[_0x7df1('0x3f')],{'$or':_['map'](_0x281b19,function(_0x4241bd){if(_0x4241bd[_0x7df1('0x33')]!=='VIRTUAL'){var _0x512fe5={};_0x512fe5[_0x4241bd[_0x7df1('0x2d')]]={'$like':'%'+_0x1bf0ee[_0x7df1('0x36')][_0x7df1('0x41')]+'%'};return _0x512fe5;}})});}_0x1d4243=_[_0x7df1('0x42')]({},_0x1d4243,_0x1bf0ee[_0x7df1('0x43')]);var _0x27f99a={'where':_0x1d4243['where']};return db[_0x7df1('0x44')][_0x7df1('0x21')](_0x27f99a)[_0x7df1('0x26')](function(_0x251927){_0x4b747c['count']=_0x251927;if(_0x1bf0ee[_0x7df1('0x36')][_0x7df1('0x45')]){_0x1d4243[_0x7df1('0x46')]=[{'all':!![]}];}return db[_0x7df1('0x44')][_0x7df1('0x47')](_0x1d4243);})[_0x7df1('0x26')](function(_0x18b7bc){_0x4b747c[_0x7df1('0x48')]=_0x18b7bc;return _0x4b747c;})['then'](respondWithFilteredResult(_0x23df16,_0x1d4243))['catch'](handleError(_0x23df16,null));};exports[_0x7df1('0x49')]=function(_0x2503ea,_0x11e4e4){var _0x3ca7a6={'raw':!![],'where':{'id':_0x2503ea['params']['id']}},_0x21c83f={};_0x21c83f['model']=_[_0x7df1('0x4a')](db['WhatsappQueue']['rawAttributes']);_0x21c83f[_0x7df1('0x36')]=_['keys'](_0x2503ea['query']);_0x21c83f['filters']=_[_0x7df1('0x38')](_0x21c83f[_0x7df1('0x35')],_0x21c83f[_0x7df1('0x36')]);_0x3ca7a6['attributes']=_[_0x7df1('0x38')](_0x21c83f[_0x7df1('0x35')],qs[_0x7df1('0x39')](_0x2503ea[_0x7df1('0x36')][_0x7df1('0x39')]));_0x3ca7a6[_0x7df1('0x3a')]=_0x3ca7a6[_0x7df1('0x3a')][_0x7df1('0x4b')]?_0x3ca7a6[_0x7df1('0x3a')]:_0x21c83f[_0x7df1('0x35')];if(_0x2503ea[_0x7df1('0x36')]['includeAll']){_0x3ca7a6[_0x7df1('0x46')]=[{'all':!![]}];}_0x3ca7a6=_[_0x7df1('0x42')]({},_0x3ca7a6,_0x2503ea[_0x7df1('0x43')]);return db[_0x7df1('0x44')][_0x7df1('0x4c')](_0x3ca7a6)[_0x7df1('0x26')](handleEntityNotFound(_0x11e4e4,null))[_0x7df1('0x26')](respondWithResult(_0x11e4e4,null))[_0x7df1('0x4d')](handleError(_0x11e4e4,null));};exports[_0x7df1('0x4e')]=function(_0x1f259b,_0x463fa1){return db['WhatsappQueue'][_0x7df1('0x4e')](_0x1f259b[_0x7df1('0x4f')],{})['then'](function(_0x139afa){var _0x3bd6e9=_0x1f259b[_0x7df1('0x50')][_0x7df1('0x27')]({'plain':!![]});if(!_0x3bd6e9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3bd6e9['role']===_0x7df1('0x50')){var _0x1294ac=_0x139afa[_0x7df1('0x27')]({'plain':!![]});var _0x67d36f=_0x7df1('0x28');return db[_0x7df1('0x51')][_0x7df1('0x4c')]({'where':{'name':_0x67d36f,'userProfileId':_0x3bd6e9[_0x7df1('0x52')]},'raw':!![]})['then'](function(_0xca2f45){if(_0xca2f45&&_0xca2f45[_0x7df1('0x53')]===0x0){return db['UserProfileResource'][_0x7df1('0x4e')]({'name':_0x1294ac[_0x7df1('0x2d')],'resourceId':_0x1294ac['id'],'type':_0xca2f45[_0x7df1('0x2d')],'sectionId':_0xca2f45['id']},{})[_0x7df1('0x26')](function(){return _0x139afa;});}else{return _0x139afa;}})[_0x7df1('0x4d')](function(_0x21e18a){logger['error'](_0x7df1('0x54'),_0x21e18a);throw _0x21e18a;});}return _0x139afa;})[_0x7df1('0x26')](respondWithResult(_0x463fa1,0xc9))[_0x7df1('0x4d')](handleError(_0x463fa1,null));};exports['update']=function(_0x328803,_0x588ec8){if(_0x328803[_0x7df1('0x4f')]['id']){delete _0x328803[_0x7df1('0x4f')]['id'];}return db[_0x7df1('0x44')]['find']({'where':{'id':_0x328803[_0x7df1('0x55')]['id']}})[_0x7df1('0x26')](handleEntityNotFound(_0x588ec8,null))[_0x7df1('0x26')](saveUpdates(_0x328803[_0x7df1('0x4f')],null))[_0x7df1('0x26')](respondWithResult(_0x588ec8,null))[_0x7df1('0x4d')](handleError(_0x588ec8,null));};exports[_0x7df1('0x25')]=function(_0x3c85db,_0x65f523){return db['WhatsappQueue'][_0x7df1('0x4c')]({'where':{'id':_0x3c85db['params']['id']}})[_0x7df1('0x26')](handleEntityNotFound(_0x65f523,null))[_0x7df1('0x26')](removeEntity(_0x65f523,null))[_0x7df1('0x4d')](handleError(_0x65f523,null));};exports[_0x7df1('0x56')]=function(_0x2c468e,_0x1faf1f){return db[_0x7df1('0x44')]['describe']()['then'](respondWithResult(_0x1faf1f,null))[_0x7df1('0x4d')](handleError(_0x1faf1f,null));};exports[_0x7df1('0x57')]=function(_0x2c4ced,_0x38220c,_0x4c6d30){var _0x4f7d58={'raw':!![],'where':{}},_0x141b68={},_0x4d97d7;return db[_0x7df1('0x44')][_0x7df1('0x58')]({'where':{'id':_0x2c4ced['params']['id']}})['then'](handleEntityNotFound(_0x38220c,null))[_0x7df1('0x26')](function(_0xccb67a){if(_0xccb67a){_0x4d97d7=_0xccb67a[_0x7df1('0x27')]({'plain':!![]});_0x141b68['model']=_['keys'](db[_0x7df1('0x59')][_0x7df1('0x31')]);_0x141b68[_0x7df1('0x36')]=_[_0x7df1('0x4a')](_0x2c4ced['query']);_0x141b68[_0x7df1('0x37')]=_[_0x7df1('0x38')](_0x141b68[_0x7df1('0x35')],_0x141b68['query']);_0x4f7d58[_0x7df1('0x3a')]=_[_0x7df1('0x38')](_0x141b68[_0x7df1('0x35')],qs[_0x7df1('0x39')](_0x2c4ced[_0x7df1('0x36')][_0x7df1('0x39')]));_0x4f7d58['attributes']=_0x4f7d58[_0x7df1('0x3a')]['length']?_0x4f7d58[_0x7df1('0x3a')]:_0x141b68[_0x7df1('0x35')];if(!_0x2c4ced['query'][_0x7df1('0x3b')](_0x7df1('0x3c'))){_0x4f7d58[_0x7df1('0x20')]=qs[_0x7df1('0x20')](_0x2c4ced[_0x7df1('0x36')]['limit']);_0x4f7d58['offset']=qs[_0x7df1('0x1e')](_0x2c4ced['query']['offset']);}_0x4f7d58[_0x7df1('0x3d')]=qs[_0x7df1('0x3e')](_0x2c4ced[_0x7df1('0x36')]['sort']);_0x4f7d58['where']=qs[_0x7df1('0x37')](_['pick'](_0x2c4ced[_0x7df1('0x36')],_0x141b68['filters']));_0x4f7d58['where']['WhatsappQueueId']=_0xccb67a['id'];if(_0x2c4ced[_0x7df1('0x36')][_0x7df1('0x41')]){_0x4f7d58[_0x7df1('0x3f')]=_[_0x7df1('0x42')](_0x4f7d58[_0x7df1('0x3f')],{'$or':_[_0x7df1('0x30')](_0x4f7d58[_0x7df1('0x3a')],function(_0x351207){var _0x20e92b={};_0x20e92b[_0x351207]={'$like':'%'+_0x2c4ced[_0x7df1('0x36')][_0x7df1('0x41')]+'%'};return _0x20e92b;})});}_0x4f7d58=_[_0x7df1('0x42')]({},_0x4f7d58,_0x2c4ced[_0x7df1('0x43')]);return db[_0x7df1('0x59')][_0x7df1('0x47')](_0x4f7d58);}})[_0x7df1('0x26')](function(_0x33579f){if(_0x33579f){return db[_0x7df1('0x5a')]['findAndCountAll']({'where':{'id':_[_0x7df1('0x30')](_0x33579f,_0x7df1('0x5b')),'role':_0x7df1('0x5c')},'attributes':['id','name','whatsappPause','updatedAt',_0x7df1('0x5d')]});}})[_0x7df1('0x26')](function(_0x7b39c0){if(_0x7b39c0){return{'count':_0x7b39c0[_0x7df1('0x21')],'rows':_['map'](_0x7b39c0[_0x7df1('0x48')],function(_0x54f9a2){return{'membername':_0x54f9a2[_0x7df1('0x2d')],'UserId':_0x54f9a2['id'],'queue_name':_0x4d97d7[_0x7df1('0x2d')],'WhatsappQueueId':_0x4d97d7['id'],'interface':util[_0x7df1('0x5e')]('%s/%s','SIP',_0x54f9a2[_0x7df1('0x2d')]),'penalty':0x0,'paused':_0x54f9a2[_0x7df1('0x5f')],'createdAt':_0x54f9a2[_0x7df1('0x5d')],'updatedAt':_0x54f9a2[_0x7df1('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7df1('0x26')](respondWithFilteredResult(_0x38220c,_0x4f7d58))[_0x7df1('0x4d')](handleError(_0x38220c,null));};exports['getTeams']=function(_0x130eb1,_0x51096f,_0x6662c5){var _0x143277={};var _0x434ae0={};var _0x124b02;var _0x11fd1e;return db['WhatsappQueue'][_0x7df1('0x58')]({'where':{'id':_0x130eb1['params']['id']}})['then'](handleEntityNotFound(_0x51096f,null))[_0x7df1('0x26')](function(_0x3699de){if(_0x3699de){_0x124b02=_0x3699de;_0x434ae0[_0x7df1('0x35')]=_['keys'](db[_0x7df1('0x61')][_0x7df1('0x31')]);_0x434ae0[_0x7df1('0x36')]=_['keys'](_0x130eb1[_0x7df1('0x36')]);_0x434ae0[_0x7df1('0x37')]=_[_0x7df1('0x38')](_0x434ae0[_0x7df1('0x35')],_0x434ae0[_0x7df1('0x36')]);_0x143277[_0x7df1('0x3a')]=_[_0x7df1('0x38')](_0x434ae0['model'],qs[_0x7df1('0x39')](_0x130eb1[_0x7df1('0x36')][_0x7df1('0x39')]));_0x143277['attributes']=_0x143277[_0x7df1('0x3a')][_0x7df1('0x4b')]?_0x143277[_0x7df1('0x3a')]:_0x434ae0['model'];_0x143277['order']=qs[_0x7df1('0x3e')](_0x130eb1[_0x7df1('0x36')][_0x7df1('0x3e')]);_0x143277[_0x7df1('0x3f')]=qs[_0x7df1('0x37')](_['pick'](_0x130eb1[_0x7df1('0x36')],_0x434ae0[_0x7df1('0x37')]));if(_0x130eb1[_0x7df1('0x36')][_0x7df1('0x41')]){_0x143277['where']=_[_0x7df1('0x42')](_0x143277[_0x7df1('0x3f')],{'$or':_[_0x7df1('0x30')](_0x143277['attributes'],function(_0x1f5ca5){var _0x2dd6a1={};_0x2dd6a1[_0x1f5ca5]={'$like':'%'+_0x130eb1['query']['filter']+'%'};return _0x2dd6a1;})});}_0x143277=_[_0x7df1('0x42')]({},_0x143277,_0x130eb1[_0x7df1('0x43')]);return _0x124b02[_0x7df1('0x62')](_0x143277);}})[_0x7df1('0x26')](function(_0x152102){if(_0x152102){_0x11fd1e=_0x152102[_0x7df1('0x4b')];if(!_0x130eb1['query'][_0x7df1('0x3b')](_0x7df1('0x3c'))){_0x143277[_0x7df1('0x20')]=qs['limit'](_0x130eb1[_0x7df1('0x36')][_0x7df1('0x20')]);_0x143277[_0x7df1('0x1e')]=qs['offset'](_0x130eb1[_0x7df1('0x36')][_0x7df1('0x1e')]);}return _0x124b02[_0x7df1('0x62')](_0x143277);}})[_0x7df1('0x26')](function(_0x369fe7){if(_0x369fe7){return _0x369fe7?{'count':_0x11fd1e,'rows':_0x369fe7}:null;}})[_0x7df1('0x26')](respondWithResult(_0x51096f,null))[_0x7df1('0x4d')](handleError(_0x51096f,null));};exports[_0x7df1('0x63')]=function(_0x189baf,_0x430cf1,_0x389989){var _0x120e84=_0x189baf['body']['ids'];return db[_0x7df1('0x61')][_0x7df1('0x47')]({'where':{'id':_0x120e84},'attributes':['id'],'include':[{'model':db[_0x7df1('0x5a')],'as':'Agents','attributes':['id',_0x7df1('0x2d'),_0x7df1('0x64'),_0x7df1('0x65'),_0x7df1('0x66')],'raw':!![]}]})[_0x7df1('0x26')](function(_0x34663c){if(_0x34663c){var _0x129562=_[_0x7df1('0x67')](_0x34663c,function(_0x510cce){var _0x4f0ff9=_0x510cce['get']({'plain':!![]});return _0x4f0ff9[_0x7df1('0x68')];});return db[_0x7df1('0x44')]['find']({'where':{'id':_0x189baf[_0x7df1('0x55')]['id']}})[_0x7df1('0x26')](function(_0x1bb3d9){return db['sequelize'][_0x7df1('0x69')](function(_0x2334a8){return _0x1bb3d9[_0x7df1('0x63')](_0x120e84,{'transaction':_0x2334a8})[_0x7df1('0x26')](function(){return BPromise[_0x7df1('0x6a')](_0x129562,function(_0x170dd6){return db[_0x7df1('0x59')][_0x7df1('0x6b')]({'where':{'UserId':_0x170dd6['id'],'WhatsappQueueId':_0x189baf[_0x7df1('0x55')]['id']},'transaction':_0x2334a8});});})['then'](function(){_0x129562['forEach'](function(_0x319b13){socket[_0x7df1('0x6c')](_0x7df1('0x6d'),{'UserId':_0x319b13['id'],'WhatsappQueueId':_0x1bb3d9['id']});});});});});}})[_0x7df1('0x26')](respondWithStatusCode(_0x430cf1,null))[_0x7df1('0x4d')](handleError(_0x430cf1,null));};exports[_0x7df1('0x6e')]=function(_0x1e06c3,_0x6becab,_0x12c346){return db[_0x7df1('0x61')][_0x7df1('0x47')]({'where':{'id':_0x1e06c3[_0x7df1('0x36')][_0x7df1('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x7df1('0x5a')],'as':_0x7df1('0x68'),'attributes':['id'],'raw':!![]}]})[_0x7df1('0x26')](handleEntityNotFound(_0x6becab,null))[_0x7df1('0x26')](function(_0x41d92e){var _0x4fdf62=_['map'](_0x41d92e,'id');var _0x41cba3=[];var _0x31f05c=[];var _0x973f7c=squel['select']();_0x973f7c[_0x7df1('0x70')](_0x7df1('0x71'))[_0x7df1('0x72')](_0x7df1('0x73'),'tq')[_0x7df1('0x74')](_0x7df1('0x75'),'ut',_0x7df1('0x76'))[_0x7df1('0x3f')](_0x7df1('0x77'),_0x1e06c3[_0x7df1('0x55')]['id']);for(var _0x520079=0x0;_0x520079<_0x41d92e[_0x7df1('0x4b')];_0x520079+=0x1){let _0xed8076=_0x41d92e[_0x520079];for(var _0x591cf5=0x0;_0x591cf5<_0xed8076[_0x7df1('0x68')][_0x7df1('0x4b')];_0x591cf5+=0x1){let _0x3b7bb0=_0xed8076[_0x7df1('0x68')][_0x591cf5];var _0x3b390b=_0x973f7c[_0x7df1('0x78')]();_0x3b390b[_0x7df1('0x3f')](_0x7df1('0x79'),_0x3b7bb0['id']);_0x31f05c[_0x7df1('0x7a')](db[_0x7df1('0x7b')][_0x7df1('0x36')](_0x3b390b['toString'](),{'type':db[_0x7df1('0x7b')][_0x7df1('0x7c')][_0x7df1('0x7d')]})[_0x7df1('0x26')](function(_0x5becc8){if(_0x5becc8['length']===0x1){return _0x3b7bb0['id'];}else{var _0x1ae0cf=_[_0x7df1('0x7e')](_['map'](_0x5becc8,_0x7df1('0x7f')),function(_0x55d3a0){return _[_0x7df1('0x80')](_0x4fdf62,_0x55d3a0);});if(_0x1ae0cf){return _0x3b7bb0['id'];}}}));}}return BPromise['all'](_0x31f05c)[_0x7df1('0x26')](function(_0x532bf3){_0x41cba3=_(_0x41cba3)[_0x7df1('0x81')](_0x532bf3)[_0x7df1('0x82')]()['value']();return db['WhatsappQueue'][_0x7df1('0x4c')]({'where':{'id':_0x1e06c3[_0x7df1('0x55')]['id']}})[_0x7df1('0x26')](function(_0x3917a8){return db[_0x7df1('0x7b')][_0x7df1('0x69')](function(_0x473196){return _0x3917a8[_0x7df1('0x6e')](_0x1e06c3[_0x7df1('0x36')][_0x7df1('0x6f')],{'transaction':_0x473196})[_0x7df1('0x26')](function(){if(!_[_0x7df1('0x83')](_0x41cba3)){return _0x3917a8['removeAgents'](_0x41cba3,{'transaction':_0x473196});}})[_0x7df1('0x26')](function(){_0x41cba3[_0x7df1('0x84')](function(_0x4290fe){socket[_0x7df1('0x6c')](_0x7df1('0x85'),{'UserId':_0x4290fe,'WhatsappQueueId':_0x3917a8['id']});});});});});});})[_0x7df1('0x26')](respondWithStatusCode(_0x6becab,null))[_0x7df1('0x4d')](handleError(_0x6becab,null));};exports[_0x7df1('0x86')]=function(_0x395473,_0x29e0e4,_0x34c05f){return db[_0x7df1('0x44')][_0x7df1('0x4c')]({'where':{'id':_0x395473['params']['id']}})[_0x7df1('0x26')](handleEntityNotFound(_0x29e0e4,null))[_0x7df1('0x26')](function(_0x4d4a9c){if(_0x4d4a9c){return _0x4d4a9c[_0x7df1('0x86')](_0x395473['body'][_0x7df1('0x6f')],_[_0x7df1('0x87')](_0x395473['body'],[_0x7df1('0x6f'),'id'])||{})['spread'](function(_0x351a8b){for(var _0xa52a63=0x0;_0xa52a63<_0x395473[_0x7df1('0x4f')][_0x7df1('0x6f')][_0x7df1('0x4b')];_0xa52a63+=0x1){socket[_0x7df1('0x6c')]('userWhatsappQueue:save',{'UserId':Number(_0x395473['body']['ids'][_0xa52a63]),'WhatsappQueueId':Number(_0x395473[_0x7df1('0x55')]['id'])});}return _0x351a8b;});}})[_0x7df1('0x26')](respondWithResult(_0x29e0e4,null))[_0x7df1('0x4d')](handleError(_0x29e0e4,null));};exports[_0x7df1('0x88')]=function(_0x50790d,_0x168967,_0x5182a7){return db[_0x7df1('0x44')][_0x7df1('0x4c')]({'where':{'id':_0x50790d[_0x7df1('0x55')]['id']}})[_0x7df1('0x26')](handleEntityNotFound(_0x168967,null))[_0x7df1('0x26')](function(_0x392e0d){if(_0x392e0d){return _0x392e0d[_0x7df1('0x88')](_0x50790d[_0x7df1('0x36')][_0x7df1('0x6f')])[_0x7df1('0x26')](function(){if(_[_0x7df1('0x89')](_0x50790d['query']['ids'])){for(var _0x24080e=0x0;_0x24080e<_0x50790d[_0x7df1('0x36')]['ids']['length'];_0x24080e+=0x1){socket[_0x7df1('0x6c')]('userWhatsappQueue:remove',{'UserId':Number(_0x50790d[_0x7df1('0x36')][_0x7df1('0x6f')][_0x24080e]),'WhatsappQueueId':Number(_0x50790d[_0x7df1('0x55')]['id'])});}}else{socket[_0x7df1('0x6c')]('userWhatsappQueue:remove',{'UserId':Number(_0x50790d['query'][_0x7df1('0x6f')]),'WhatsappQueueId':Number(_0x50790d[_0x7df1('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x168967,null))[_0x7df1('0x4d')](handleError(_0x168967,null));};exports[_0x7df1('0x8a')]=function(_0x5d2197,_0x531b64,_0x20df48){var _0x5b0725={};var _0x39f2f6={};var _0x1962df;var _0x55a103;return db[_0x7df1('0x44')][_0x7df1('0x58')]({'where':{'id':_0x5d2197['params']['id']}})[_0x7df1('0x26')](handleEntityNotFound(_0x531b64,null))[_0x7df1('0x26')](function(_0x40b24b){if(_0x40b24b){_0x1962df=_0x40b24b;_0x39f2f6['model']=_[_0x7df1('0x4a')](db[_0x7df1('0x5a')][_0x7df1('0x31')]);_0x39f2f6[_0x7df1('0x36')]=_[_0x7df1('0x4a')](_0x5d2197[_0x7df1('0x36')]);_0x39f2f6[_0x7df1('0x37')]=_[_0x7df1('0x38')](_0x39f2f6[_0x7df1('0x35')],_0x39f2f6['query']);_0x5b0725['attributes']=_[_0x7df1('0x38')](_0x39f2f6['model'],qs['fields'](_0x5d2197[_0x7df1('0x36')][_0x7df1('0x39')]));_0x5b0725[_0x7df1('0x3a')]=_0x5b0725['attributes'][_0x7df1('0x4b')]?_0x5b0725[_0x7df1('0x3a')]:_0x39f2f6[_0x7df1('0x35')];_0x5b0725[_0x7df1('0x3d')]=qs[_0x7df1('0x3e')](_0x5d2197[_0x7df1('0x36')][_0x7df1('0x3e')]);_0x5b0725[_0x7df1('0x3f')]=qs[_0x7df1('0x37')](_[_0x7df1('0x40')](_0x5d2197[_0x7df1('0x36')],_0x39f2f6[_0x7df1('0x37')]));if(_0x5d2197['query']['filter']){_0x5b0725[_0x7df1('0x3f')]=_[_0x7df1('0x42')](_0x5b0725['where'],{'$or':_[_0x7df1('0x30')](_0x5b0725[_0x7df1('0x3a')],function(_0x48023d){var _0x20f261={};_0x20f261[_0x48023d]={'$like':'%'+_0x5d2197[_0x7df1('0x36')][_0x7df1('0x41')]+'%'};return _0x20f261;})});}_0x5b0725=_[_0x7df1('0x42')]({},_0x5b0725,_0x5d2197[_0x7df1('0x43')]);return _0x1962df[_0x7df1('0x8a')](_0x5b0725);}})[_0x7df1('0x26')](function(_0x2f819f){if(_0x2f819f){_0x55a103=_0x2f819f['length'];if(!_0x5d2197[_0x7df1('0x36')][_0x7df1('0x3b')]('nolimit')){_0x5b0725[_0x7df1('0x20')]=qs[_0x7df1('0x20')](_0x5d2197[_0x7df1('0x36')]['limit']);_0x5b0725[_0x7df1('0x1e')]=qs['offset'](_0x5d2197[_0x7df1('0x36')][_0x7df1('0x1e')]);}return _0x1962df[_0x7df1('0x8a')](_0x5b0725);}})[_0x7df1('0x26')](function(_0x12b2fc){if(_0x12b2fc){return _0x12b2fc?{'count':_0x55a103,'rows':_0x12b2fc}:null;}})[_0x7df1('0x26')](respondWithResult(_0x531b64,null))[_0x7df1('0x4d')](handleError(_0x531b64,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index b14321e..5ca3b49 100644 --- a/server/api/whatsappQueue/whatsappQueue.events.js +++ b/server/api/whatsappQueue/whatsappQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa5fa=['WhatsappQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0xa5fa,0x185));var _0xaa5f=function(_0x755c96,_0x3c3d43){_0x755c96=_0x755c96-0x0;var _0x1e5cea=_0xa5fa[_0x755c96];return _0x1e5cea;};'use strict';var EventEmitter=require(_0xaa5f('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0xaa5f('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xaa5f('0x2')](0x0);var events={'afterCreate':_0xaa5f('0x3'),'afterUpdate':_0xaa5f('0x4'),'afterDestroy':_0xaa5f('0x5')};function emitEvent(_0x46f109){return function(_0x2feff5,_0xb77c66,_0x4c0ecf){WhatsappQueueEvents[_0xaa5f('0x6')](_0x46f109+':'+_0x2feff5['id'],_0x2feff5);WhatsappQueueEvents[_0xaa5f('0x6')](_0x46f109,_0x2feff5);_0x4c0ecf(null);};}for(var e in events){if(events[_0xaa5f('0x7')](e)){var event=events[e];WhatsappQueue[_0xaa5f('0x8')](e,emitEvent(event));}}module[_0xaa5f('0x9')]=WhatsappQueueEvents; \ No newline at end of file +var _0x626d=['emit','hasOwnProperty','exports','events','WhatsappQueue','save'];(function(_0x2e846f,_0x57929a){var _0x42f147=function(_0x3fff97){while(--_0x3fff97){_0x2e846f['push'](_0x2e846f['shift']());}};_0x42f147(++_0x57929a);}(_0x626d,0x17d));var _0xd626=function(_0x397fba,_0x465dd1){_0x397fba=_0x397fba-0x0;var _0x3aa8b6=_0x626d[_0x397fba];return _0x3aa8b6;};'use strict';var EventEmitter=require(_0xd626('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0xd626('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd626('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5a59a1){return function(_0x4fe40b,_0x9551f,_0x22d7e6){WhatsappQueueEvents['emit'](_0x5a59a1+':'+_0x4fe40b['id'],_0x4fe40b);WhatsappQueueEvents[_0xd626('0x3')](_0x5a59a1,_0x4fe40b);_0x22d7e6(null);};}for(var e in events){if(events[_0xd626('0x4')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0xd626('0x5')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index cd6b20e..46735c8 100644 --- a/server/api/whatsappQueue/whatsappQueue.model.js +++ b/server/api/whatsappQueue/whatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac03=['bluebird','path','../../config/environment','./whatsappQueue.attributes','define','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api','moment'];(function(_0x3940a6,_0x13e033){var _0xc67026=function(_0x2dd168){while(--_0x2dd168){_0x3940a6['push'](_0x3940a6['shift']());}};_0xc67026(++_0x13e033);}(_0xac03,0xc7));var _0x3ac0=function(_0x3da841,_0xa5b566){_0x3da841=_0x3da841-0x0;var _0xbc23b7=_0xac03[_0x3da841];return _0xbc23b7;};'use strict';var _=require(_0x3ac0('0x0'));var util=require(_0x3ac0('0x1'));var logger=require(_0x3ac0('0x2'))(_0x3ac0('0x3'));var moment=require(_0x3ac0('0x4'));var BPromise=require(_0x3ac0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3ac0('0x6'));var rimraf=require('rimraf');var config=require(_0x3ac0('0x7'));var attributes=require(_0x3ac0('0x8'));module['exports']=function(_0x2204c6,_0x50845a){return _0x2204c6[_0x3ac0('0x9')](_0x3ac0('0xa'),attributes,{'tableName':_0x3ac0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe677=['exports','define','WhatsappQueue','whatsapp_queues','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0xe677,0x101));var _0x7e67=function(_0x43941d,_0x45fd0d){_0x43941d=_0x43941d-0x0;var _0x27b82a=_0xe677[_0x43941d];return _0x27b82a;};'use strict';var _=require(_0x7e67('0x0'));var util=require('util');var logger=require(_0x7e67('0x1'))(_0x7e67('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7e67('0x3'));var fs=require('fs');var path=require(_0x7e67('0x4'));var rimraf=require(_0x7e67('0x5'));var config=require(_0x7e67('0x6'));var attributes=require('./whatsappQueue.attributes');module[_0x7e67('0x7')]=function(_0x248bce,_0x1cea67){return _0x248bce[_0x7e67('0x8')](_0x7e67('0x9'),attributes,{'tableName':_0x7e67('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 824b3d4..b332618 100644 --- a/server/api/whatsappQueue/whatsappQueue.rpc.js +++ b/server/api/whatsappQueue/whatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeb08=['catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','attributes','limit','include','map','model','ShowWhatsappQueue','find','where','then','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x93cfe5,_0x2daa99){var _0x2f57d2=function(_0xcd1d98){while(--_0xcd1d98){_0x93cfe5['push'](_0x93cfe5['shift']());}};_0x2f57d2(++_0x2daa99);}(_0xeb08,0xd7));var _0x8eb0=function(_0x29dda1,_0x508e13){_0x29dda1=_0x29dda1-0x0;var _0x21b0ef=_0xeb08[_0x29dda1];return _0x21b0ef;};'use strict';var _=require(_0x8eb0('0x0'));var util=require(_0x8eb0('0x1'));var moment=require(_0x8eb0('0x2'));var BPromise=require(_0x8eb0('0x3'));var rs=require(_0x8eb0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8eb0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8eb0('0x6'));var config=require(_0x8eb0('0x7'));var jayson=require(_0x8eb0('0x8'));var client=jayson[_0x8eb0('0x9')][_0x8eb0('0xa')]({'port':0x232a});config[_0x8eb0('0xb')]=_[_0x8eb0('0xc')](config[_0x8eb0('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8eb0('0xd'))(new Redis(config[_0x8eb0('0xb')]));require(_0x8eb0('0xe'))[_0x8eb0('0xf')](socket);function respondWithRpcPromise(_0x31f32e,_0xa1b8da,_0x3f52ad){return new BPromise(function(_0x35c8df,_0x89e3ee){return client[_0x8eb0('0x10')](_0x31f32e,_0x3f52ad)['then'](function(_0x67efb9){logger[_0x8eb0('0x11')](_0x8eb0('0x12'),_0xa1b8da,_0x8eb0('0x13'));logger[_0x8eb0('0x14')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0xa1b8da,_0x8eb0('0x13'),JSON[_0x8eb0('0x15')](_0x67efb9));if(_0x67efb9[_0x8eb0('0x16')]){if(_0x67efb9[_0x8eb0('0x16')][_0x8eb0('0x17')]===0x1f4){logger[_0x8eb0('0x16')]('WhatsappQueue,\x20%s,\x20%s',_0xa1b8da,_0x67efb9[_0x8eb0('0x16')][_0x8eb0('0x18')]);return _0x89e3ee(_0x67efb9[_0x8eb0('0x16')][_0x8eb0('0x18')]);}logger[_0x8eb0('0x16')](_0x8eb0('0x12'),_0xa1b8da,_0x67efb9[_0x8eb0('0x16')][_0x8eb0('0x18')]);return _0x35c8df(_0x67efb9[_0x8eb0('0x16')][_0x8eb0('0x18')]);}else{logger[_0x8eb0('0x11')](_0x8eb0('0x12'),_0xa1b8da,_0x8eb0('0x13'));_0x35c8df(_0x67efb9['result']['message']);}})[_0x8eb0('0x19')](function(_0x21bf25){logger[_0x8eb0('0x16')]('WhatsappQueue,\x20%s,\x20%s',_0xa1b8da,_0x21bf25);_0x89e3ee(_0x21bf25);});});}exports[_0x8eb0('0x1a')]=function(_0x291f28){var _0x517e30=this;return new Promise(function(_0xf1acb7,_0x30111b){return db[_0x8eb0('0x1b')][_0x8eb0('0x1c')]({'raw':_0x291f28[_0x8eb0('0x1d')]?_0x291f28[_0x8eb0('0x1d')][_0x8eb0('0x1e')]===undefined?!![]:![]:!![],'where':_0x291f28[_0x8eb0('0x1d')]?_0x291f28[_0x8eb0('0x1d')]['where']||null:null,'attributes':_0x291f28['options']?_0x291f28[_0x8eb0('0x1d')][_0x8eb0('0x1f')]||null:null,'limit':_0x291f28['options']?_0x291f28[_0x8eb0('0x1d')][_0x8eb0('0x20')]||null:null,'include':_0x291f28[_0x8eb0('0x1d')]?_0x291f28[_0x8eb0('0x1d')][_0x8eb0('0x21')]?_[_0x8eb0('0x22')](_0x291f28['options'][_0x8eb0('0x21')],function(_0x4dc391){return{'model':db[_0x4dc391['model']],'as':_0x4dc391['as'],'attributes':_0x4dc391['attributes'],'include':_0x4dc391['include']?_[_0x8eb0('0x22')](_0x4dc391[_0x8eb0('0x21')],function(_0x40c00a){return{'model':db[_0x40c00a['model']],'as':_0x40c00a['as'],'attributes':_0x40c00a['attributes'],'include':_0x40c00a[_0x8eb0('0x21')]?_[_0x8eb0('0x22')](_0x40c00a[_0x8eb0('0x21')],function(_0x1acfd2){return{'model':db[_0x1acfd2[_0x8eb0('0x23')]],'as':_0x1acfd2['as'],'attributes':_0x1acfd2[_0x8eb0('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ef4c0){logger['info']('GetWhatsappQueue',_0x291f28);logger[_0x8eb0('0x14')]('GetWhatsappQueue',_0x291f28,JSON[_0x8eb0('0x15')](_0x1ef4c0));_0xf1acb7(_0x1ef4c0);})[_0x8eb0('0x19')](function(_0x4ae1fa){logger[_0x8eb0('0x16')](_0x8eb0('0x1a'),_0x4ae1fa['message'],_0x291f28);_0x30111b(_0x517e30[_0x8eb0('0x16')](0x1f4,_0x4ae1fa[_0x8eb0('0x18')]));});});};exports[_0x8eb0('0x24')]=function(_0x55a50e){var _0x510a99=this;return new Promise(function(_0x59c704,_0x4fd5e2){return db[_0x8eb0('0x1b')][_0x8eb0('0x25')]({'raw':_0x55a50e[_0x8eb0('0x1d')]?_0x55a50e[_0x8eb0('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x55a50e[_0x8eb0('0x1d')]?_0x55a50e[_0x8eb0('0x1d')][_0x8eb0('0x26')]||null:null,'attributes':_0x55a50e['options']?_0x55a50e[_0x8eb0('0x1d')][_0x8eb0('0x1f')]||null:null,'include':_0x55a50e[_0x8eb0('0x1d')]?_0x55a50e[_0x8eb0('0x1d')][_0x8eb0('0x21')]?_['map'](_0x55a50e[_0x8eb0('0x1d')][_0x8eb0('0x21')],function(_0x248b4a){return{'model':db[_0x248b4a['model']],'as':_0x248b4a['as'],'attributes':_0x248b4a['attributes'],'include':_0x248b4a['include']?_[_0x8eb0('0x22')](_0x248b4a[_0x8eb0('0x21')],function(_0x49b4a0){return{'model':db[_0x49b4a0['model']],'as':_0x49b4a0['as'],'attributes':_0x49b4a0[_0x8eb0('0x1f')],'include':_0x49b4a0['include']?_['map'](_0x49b4a0[_0x8eb0('0x21')],function(_0x38e143){return{'model':db[_0x38e143[_0x8eb0('0x23')]],'as':_0x38e143['as'],'attributes':_0x38e143[_0x8eb0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8eb0('0x27')](function(_0x2ad0a2){logger['info'](_0x8eb0('0x24'),_0x55a50e);logger[_0x8eb0('0x14')]('ShowWhatsappQueue',_0x55a50e,JSON[_0x8eb0('0x15')](_0x2ad0a2));_0x59c704(_0x2ad0a2);})[_0x8eb0('0x19')](function(_0x41962a){logger[_0x8eb0('0x16')](_0x8eb0('0x24'),_0x41962a[_0x8eb0('0x18')],_0x55a50e);_0x4fd5e2(_0x510a99[_0x8eb0('0x16')](0x1f4,_0x41962a['message']));});});}; \ No newline at end of file +var _0xb874=['stringify','error','message','result','catch','GetWhatsappQueue','findAll','options','raw','where','map','include','model','attributes','WhatsappQueue','find','ShowWhatsappQueue','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x161f4d,_0x8580f5){var _0x4a8ebc=function(_0x37df52){while(--_0x37df52){_0x161f4d['push'](_0x161f4d['shift']());}};_0x4a8ebc(++_0x8580f5);}(_0xb874,0xdd));var _0x4b87=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb874[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x4b87('0x0'));var moment=require('moment');var BPromise=require(_0x4b87('0x1'));var rs=require(_0x4b87('0x2'));var fs=require('fs');var Redis=require(_0x4b87('0x3'));var db=require(_0x4b87('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4b87('0x5'))('rpc');var config=require(_0x4b87('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4b87('0x7')][_0x4b87('0x8')]({'port':0x232a});config[_0x4b87('0x9')]=_[_0x4b87('0xa')](config[_0x4b87('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x4b87('0xb'))(new Redis(config[_0x4b87('0x9')]));require('./whatsappQueue.socket')['register'](socket);function respondWithRpcPromise(_0x5fa201,_0x16853d,_0x1205c1){return new BPromise(function(_0x2fb66c,_0xc050c4){return client['request'](_0x5fa201,_0x1205c1)[_0x4b87('0xc')](function(_0x2085c3){logger[_0x4b87('0xd')](_0x4b87('0xe'),_0x16853d,_0x4b87('0xf'));logger[_0x4b87('0x10')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x16853d,'request\x20sent',JSON[_0x4b87('0x11')](_0x2085c3));if(_0x2085c3['error']){if(_0x2085c3[_0x4b87('0x12')]['code']===0x1f4){logger[_0x4b87('0x12')](_0x4b87('0xe'),_0x16853d,_0x2085c3[_0x4b87('0x12')][_0x4b87('0x13')]);return _0xc050c4(_0x2085c3[_0x4b87('0x12')][_0x4b87('0x13')]);}logger[_0x4b87('0x12')]('WhatsappQueue,\x20%s,\x20%s',_0x16853d,_0x2085c3[_0x4b87('0x12')][_0x4b87('0x13')]);return _0x2fb66c(_0x2085c3[_0x4b87('0x12')][_0x4b87('0x13')]);}else{logger[_0x4b87('0xd')](_0x4b87('0xe'),_0x16853d,_0x4b87('0xf'));_0x2fb66c(_0x2085c3[_0x4b87('0x14')]['message']);}})[_0x4b87('0x15')](function(_0x87d4ad){logger[_0x4b87('0x12')]('WhatsappQueue,\x20%s,\x20%s',_0x16853d,_0x87d4ad);_0xc050c4(_0x87d4ad);});});}exports[_0x4b87('0x16')]=function(_0x489413){var _0x4f055d=this;return new Promise(function(_0x5714d3,_0x13ef05){return db['WhatsappQueue'][_0x4b87('0x17')]({'raw':_0x489413[_0x4b87('0x18')]?_0x489413[_0x4b87('0x18')][_0x4b87('0x19')]===undefined?!![]:![]:!![],'where':_0x489413[_0x4b87('0x18')]?_0x489413[_0x4b87('0x18')][_0x4b87('0x1a')]||null:null,'attributes':_0x489413[_0x4b87('0x18')]?_0x489413[_0x4b87('0x18')]['attributes']||null:null,'limit':_0x489413['options']?_0x489413[_0x4b87('0x18')]['limit']||null:null,'include':_0x489413['options']?_0x489413[_0x4b87('0x18')]['include']?_[_0x4b87('0x1b')](_0x489413[_0x4b87('0x18')][_0x4b87('0x1c')],function(_0x35ccb3){return{'model':db[_0x35ccb3[_0x4b87('0x1d')]],'as':_0x35ccb3['as'],'attributes':_0x35ccb3[_0x4b87('0x1e')],'include':_0x35ccb3['include']?_[_0x4b87('0x1b')](_0x35ccb3[_0x4b87('0x1c')],function(_0x372e14){return{'model':db[_0x372e14[_0x4b87('0x1d')]],'as':_0x372e14['as'],'attributes':_0x372e14['attributes'],'include':_0x372e14[_0x4b87('0x1c')]?_[_0x4b87('0x1b')](_0x372e14[_0x4b87('0x1c')],function(_0x50a1d1){return{'model':db[_0x50a1d1[_0x4b87('0x1d')]],'as':_0x50a1d1['as'],'attributes':_0x50a1d1[_0x4b87('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4b87('0xc')](function(_0x4de3f3){logger[_0x4b87('0xd')](_0x4b87('0x16'),_0x489413);logger[_0x4b87('0x10')](_0x4b87('0x16'),_0x489413,JSON[_0x4b87('0x11')](_0x4de3f3));_0x5714d3(_0x4de3f3);})[_0x4b87('0x15')](function(_0x5c45f4){logger['error'](_0x4b87('0x16'),_0x5c45f4[_0x4b87('0x13')],_0x489413);_0x13ef05(_0x4f055d[_0x4b87('0x12')](0x1f4,_0x5c45f4[_0x4b87('0x13')]));});});};exports['ShowWhatsappQueue']=function(_0x4d2f05){var _0x695f7f=this;return new Promise(function(_0x43bbd3,_0x329bb4){return db[_0x4b87('0x1f')][_0x4b87('0x20')]({'raw':_0x4d2f05[_0x4b87('0x18')]?_0x4d2f05['options']['raw']===undefined?!![]:![]:!![],'where':_0x4d2f05['options']?_0x4d2f05[_0x4b87('0x18')]['where']||null:null,'attributes':_0x4d2f05[_0x4b87('0x18')]?_0x4d2f05[_0x4b87('0x18')][_0x4b87('0x1e')]||null:null,'include':_0x4d2f05['options']?_0x4d2f05[_0x4b87('0x18')]['include']?_['map'](_0x4d2f05['options']['include'],function(_0x4b90da){return{'model':db[_0x4b90da[_0x4b87('0x1d')]],'as':_0x4b90da['as'],'attributes':_0x4b90da['attributes'],'include':_0x4b90da[_0x4b87('0x1c')]?_[_0x4b87('0x1b')](_0x4b90da[_0x4b87('0x1c')],function(_0x120c29){return{'model':db[_0x120c29[_0x4b87('0x1d')]],'as':_0x120c29['as'],'attributes':_0x120c29['attributes'],'include':_0x120c29[_0x4b87('0x1c')]?_[_0x4b87('0x1b')](_0x120c29['include'],function(_0x4412a0){return{'model':db[_0x4412a0[_0x4b87('0x1d')]],'as':_0x4412a0['as'],'attributes':_0x4412a0[_0x4b87('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4b87('0xc')](function(_0x225108){logger[_0x4b87('0xd')](_0x4b87('0x21'),_0x4d2f05);logger[_0x4b87('0x10')]('ShowWhatsappQueue',_0x4d2f05,JSON[_0x4b87('0x11')](_0x225108));_0x43bbd3(_0x225108);})['catch'](function(_0x1d7cad){logger['error'](_0x4b87('0x21'),_0x1d7cad[_0x4b87('0x13')],_0x4d2f05);_0x329bb4(_0x695f7f[_0x4b87('0x12')](0x1f4,_0x1d7cad[_0x4b87('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 0d5fddf..e9b40c1 100644 --- a/server/api/whatsappQueue/whatsappQueue.socket.js +++ b/server/api/whatsappQueue/whatsappQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x819b=['whatsappQueue:','./whatsappQueue.events','save','remove','emit','removeListener','register'];(function(_0x1e1020,_0x465673){var _0x1a15ac=function(_0x254017){while(--_0x254017){_0x1e1020['push'](_0x1e1020['shift']());}};_0x1a15ac(++_0x465673);}(_0x819b,0xd3));var _0xb819=function(_0x1e97a5,_0x37a2e9){_0x1e97a5=_0x1e97a5-0x0;var _0x42915d=_0x819b[_0x1e97a5];return _0x42915d;};'use strict';var WhatsappQueueEvents=require(_0xb819('0x0'));var events=[_0xb819('0x1'),_0xb819('0x2'),'update'];function createListener(_0x14f46a,_0x69d6e){return function(_0x36b49b){_0x69d6e[_0xb819('0x3')](_0x14f46a,_0x36b49b);};}function removeListener(_0x5446f5,_0x10bbcb){return function(){WhatsappQueueEvents[_0xb819('0x4')](_0x5446f5,_0x10bbcb);};}exports[_0xb819('0x5')]=function(_0xab30c1){for(var _0x493968=0x0,_0x4246e8=events['length'];_0x493968<_0x4246e8;_0x493968++){var _0x319b2e=events[_0x493968];var _0x27db48=createListener(_0xb819('0x6')+_0x319b2e,_0xab30c1);WhatsappQueueEvents['on'](_0x319b2e,_0x27db48);}}; \ No newline at end of file +var _0xd8f3=['emit','removeListener','length','whatsappQueue:','./whatsappQueue.events','save','remove'];(function(_0xcc8bdc,_0x104b88){var _0x2c31b5=function(_0x2e236c){while(--_0x2e236c){_0xcc8bdc['push'](_0xcc8bdc['shift']());}};_0x2c31b5(++_0x104b88);}(_0xd8f3,0x14d));var _0x3d8f=function(_0x42491b,_0x19e204){_0x42491b=_0x42491b-0x0;var _0x28a72c=_0xd8f3[_0x42491b];return _0x28a72c;};'use strict';var WhatsappQueueEvents=require(_0x3d8f('0x0'));var events=[_0x3d8f('0x1'),_0x3d8f('0x2'),'update'];function createListener(_0x517951,_0x4773e2){return function(_0x49acd5){_0x4773e2[_0x3d8f('0x3')](_0x517951,_0x49acd5);};}function removeListener(_0x51df87,_0x1e695c){return function(){WhatsappQueueEvents[_0x3d8f('0x4')](_0x51df87,_0x1e695c);};}exports['register']=function(_0x2fce75){for(var _0x404504=0x0,_0x743ff9=events[_0x3d8f('0x5')];_0x404504<_0x743ff9;_0x404504++){var _0x339134=events[_0x404504];var _0x3671cf=createListener(_0x3d8f('0x6')+_0x339134,_0x2fce75);WhatsappQueueEvents['on'](_0x339134,_0x3671cf);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index f8b97e1..535271b 100644 --- a/server/api/whatsappQueueReport/index.js +++ b/server/api/whatsappQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9862=['../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','create','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra'];(function(_0x4bdc9e,_0x2b8799){var _0x4c1baa=function(_0x2fd925){while(--_0x2fd925){_0x4bdc9e['push'](_0x4bdc9e['shift']());}};_0x4c1baa(++_0x2b8799);}(_0x9862,0x1c3));var _0x2986=function(_0x262871,_0x4b2ff7){_0x262871=_0x262871-0x0;var _0x3d27b0=_0x9862[_0x262871];return _0x3d27b0;};'use strict';var multer=require('multer');var util=require(_0x2986('0x0'));var path=require(_0x2986('0x1'));var timeout=require(_0x2986('0x2'));var express=require('express');var router=express[_0x2986('0x3')]();var fs_extra=require(_0x2986('0x4'));var auth=require(_0x2986('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2986('0x6'));var controller=require(_0x2986('0x7'));router['get']('/',auth[_0x2986('0x8')](),controller[_0x2986('0x9')]);router[_0x2986('0xa')](_0x2986('0xb'),auth[_0x2986('0x8')](),controller[_0x2986('0xc')]);router[_0x2986('0xa')](_0x2986('0xd'),auth['isAuthenticated'](),controller[_0x2986('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2986('0xf')]);router['put'](_0x2986('0xd'),auth[_0x2986('0x8')](),controller['update']);router[_0x2986('0x10')](_0x2986('0xd'),auth[_0x2986('0x8')](),controller[_0x2986('0x11')]);module[_0x2986('0x12')]=router; \ No newline at end of file +var _0x9949=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueueReport.controller','get','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x273ea9,_0x45686b){var _0x1fe13d=function(_0x43b04e){while(--_0x43b04e){_0x273ea9['push'](_0x273ea9['shift']());}};_0x1fe13d(++_0x45686b);}(_0x9949,0xd7));var _0x9994=function(_0x56739e,_0x4ef9c8){_0x56739e=_0x56739e-0x0;var _0x5081fa=_0x9949[_0x56739e];return _0x5081fa;};'use strict';var multer=require(_0x9994('0x0'));var util=require(_0x9994('0x1'));var path=require(_0x9994('0x2'));var timeout=require(_0x9994('0x3'));var express=require(_0x9994('0x4'));var router=express[_0x9994('0x5')]();var fs_extra=require(_0x9994('0x6'));var auth=require(_0x9994('0x7'));var interaction=require(_0x9994('0x8'));var config=require('../../config/environment');var controller=require(_0x9994('0x9'));router[_0x9994('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x9994('0xb')]);router[_0x9994('0xa')](_0x9994('0xc'),auth[_0x9994('0xd')](),controller[_0x9994('0xe')]);router[_0x9994('0xf')]('/',auth[_0x9994('0xd')](),controller[_0x9994('0x10')]);router[_0x9994('0x11')]('/:id',auth[_0x9994('0xd')](),controller[_0x9994('0x12')]);router[_0x9994('0x13')](_0x9994('0xc'),auth[_0x9994('0xd')](),controller[_0x9994('0x14')]);module[_0x9994('0x15')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 6a39211..f64f106 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x5b3c71,_0x5e5eca){var _0x48a074=function(_0x949a3b){while(--_0x949a3b){_0x5b3c71['push'](_0x5b3c71['shift']());}};_0x48a074(++_0x5e5eca);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x2b4916,_0x4c70f5){var _0x3e94f9=function(_0xc344e3){while(--_0xc344e3){_0x2b4916['push'](_0x2b4916['shift']());}};_0x3e94f9(++_0x4c70f5);}(_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')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 7073c16..7c530b3 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','name','map','WhatsappQueueReport','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','create','body','find','params','destroy','describe','eml-format','zip-dir','request-promise','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce'];(function(_0x5372a7,_0x3e91ec){var _0x3ab991=function(_0x319e14){while(--_0x319e14){_0x5372a7['push'](_0x5372a7['shift']());}};_0x3ab991(++_0x3e91ec);}(_0xb7e7,0x121));var _0x7b7e=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0xb7e7[_0x166d93];return _0xba708;};'use strict';var emlformat=require(_0x7b7e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b7e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7b7e('0x2'));var moment=require('moment');var BPromise=require(_0x7b7e('0x3'));var Mustache=require('mustache');var util=require(_0x7b7e('0x4'));var path=require(_0x7b7e('0x5'));var sox=require(_0x7b7e('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b7e('0x7'));var _=require(_0x7b7e('0x8'));var squel=require(_0x7b7e('0x9'));var crypto=require('crypto');var jsforce=require(_0x7b7e('0xa'));var deskjs=require(_0x7b7e('0xb'));var toCsv=require(_0x7b7e('0xc'));var querystring=require(_0x7b7e('0xd'));var Papa=require(_0x7b7e('0xe'));var Redis=require(_0x7b7e('0xf'));var authService=require(_0x7b7e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7b7e('0x11'));var hardwareService=require(_0x7b7e('0x12'));var logger=require(_0x7b7e('0x13'))(_0x7b7e('0x14'));var utils=require(_0x7b7e('0x15'));var config=require(_0x7b7e('0x16'));var licenseUtil=require(_0x7b7e('0x17'));var db=require(_0x7b7e('0x18'))['db'];function respondWithStatusCode(_0xaadda,_0x54d8ce){_0x54d8ce=_0x54d8ce||0xcc;return function(_0x267446){if(_0x267446){return _0xaadda[_0x7b7e('0x19')](_0x54d8ce);}return _0xaadda['status'](_0x54d8ce)[_0x7b7e('0x1a')]();};}function respondWithResult(_0x5976ac,_0x4c6011){_0x4c6011=_0x4c6011||0xc8;return function(_0x2889ed){if(_0x2889ed){return _0x5976ac[_0x7b7e('0x1b')](_0x4c6011)[_0x7b7e('0x1c')](_0x2889ed);}};}function respondWithFilteredResult(_0x457ec5,_0x3d2fb2){return function(_0x5703fd){if(_0x5703fd){var _0x51baf6=typeof _0x3d2fb2[_0x7b7e('0x1d')]===_0x7b7e('0x1e')&&typeof _0x3d2fb2[_0x7b7e('0x1f')]===_0x7b7e('0x1e');var _0x2cc400=_0x5703fd[_0x7b7e('0x20')];var _0x242368=_0x51baf6?0x0:_0x3d2fb2[_0x7b7e('0x1d')];var _0x2acb8c=_0x51baf6?_0x5703fd[_0x7b7e('0x20')]:_0x3d2fb2[_0x7b7e('0x1d')]+_0x3d2fb2[_0x7b7e('0x1f')];var _0x448980;if(_0x2acb8c>=_0x2cc400){_0x2acb8c=_0x2cc400;_0x448980=0xc8;}else{_0x448980=0xce;}_0x457ec5[_0x7b7e('0x1b')](_0x448980);return _0x457ec5[_0x7b7e('0x21')](_0x7b7e('0x22'),_0x242368+'-'+_0x2acb8c+'/'+_0x2cc400)[_0x7b7e('0x1c')](_0x5703fd);}return null;};}function patchUpdates(_0x49eddb){return function(_0x69262b){try{jsonpatch[_0x7b7e('0x23')](_0x69262b,_0x49eddb,!![]);}catch(_0x24718c){return BPromise['reject'](_0x24718c);}return _0x69262b[_0x7b7e('0x24')]();};}function saveUpdates(_0xbf0cb3,_0x14243b){return function(_0x200156){if(_0x200156){return _0x200156[_0x7b7e('0x25')](_0xbf0cb3)[_0x7b7e('0x26')](function(_0x28bf43){return _0x28bf43;});}return null;};}function removeEntity(_0x10a66a,_0x53bbb3){return function(_0x5d6215){if(_0x5d6215){return _0x5d6215['destroy']()[_0x7b7e('0x26')](function(){_0x10a66a[_0x7b7e('0x1b')](0xcc)[_0x7b7e('0x1a')]();});}};}function handleEntityNotFound(_0x483c6f,_0x51d3b1){return function(_0x5dadbb){if(!_0x5dadbb){_0x483c6f[_0x7b7e('0x19')](0x194);}return _0x5dadbb;};}function handleError(_0x3c8192,_0x16a3c7){_0x16a3c7=_0x16a3c7||0x1f4;return function(_0x7aa71){logger[_0x7b7e('0x27')](_0x7aa71['stack']);if(_0x7aa71[_0x7b7e('0x28')]){delete _0x7aa71[_0x7b7e('0x28')];}_0x3c8192['status'](_0x16a3c7)['send'](_0x7aa71);};}exports['index']=function(_0x12ef0b,_0x423832){var _0x503625={},_0x3db8c4={},_0x51d4b5={'count':0x0,'rows':[]};var _0x1b4341=_[_0x7b7e('0x29')](db[_0x7b7e('0x2a')]['rawAttributes'],function(_0x3960b8){return{'name':_0x3960b8[_0x7b7e('0x2b')],'type':_0x3960b8[_0x7b7e('0x2c')][_0x7b7e('0x2d')]};});_0x3db8c4[_0x7b7e('0x2e')]=_['map'](_0x1b4341,_0x7b7e('0x28'));_0x3db8c4['query']=_[_0x7b7e('0x2f')](_0x12ef0b[_0x7b7e('0x30')]);_0x3db8c4[_0x7b7e('0x31')]=_[_0x7b7e('0x32')](_0x3db8c4[_0x7b7e('0x2e')],_0x3db8c4[_0x7b7e('0x30')]);_0x503625[_0x7b7e('0x33')]=_['intersection'](_0x3db8c4['model'],qs[_0x7b7e('0x34')](_0x12ef0b[_0x7b7e('0x30')]['fields']));_0x503625[_0x7b7e('0x33')]=_0x503625[_0x7b7e('0x33')][_0x7b7e('0x35')]?_0x503625['attributes']:_0x3db8c4[_0x7b7e('0x2e')];if(!_0x12ef0b[_0x7b7e('0x30')][_0x7b7e('0x36')](_0x7b7e('0x37'))){_0x503625[_0x7b7e('0x1f')]=qs[_0x7b7e('0x1f')](_0x12ef0b[_0x7b7e('0x30')][_0x7b7e('0x1f')]);_0x503625[_0x7b7e('0x1d')]=qs[_0x7b7e('0x1d')](_0x12ef0b[_0x7b7e('0x30')][_0x7b7e('0x1d')]);}_0x503625[_0x7b7e('0x38')]=qs[_0x7b7e('0x39')](_0x12ef0b[_0x7b7e('0x30')][_0x7b7e('0x39')]);_0x503625['where']=qs[_0x7b7e('0x31')](_[_0x7b7e('0x3a')](_0x12ef0b[_0x7b7e('0x30')],_0x3db8c4[_0x7b7e('0x31')]),_0x1b4341);if(_0x12ef0b[_0x7b7e('0x30')][_0x7b7e('0x3b')]){_0x503625[_0x7b7e('0x3c')]=_[_0x7b7e('0x3d')](_0x503625[_0x7b7e('0x3c')],{'$or':_[_0x7b7e('0x29')](_0x1b4341,function(_0x5f3de5){if(_0x5f3de5[_0x7b7e('0x2c')]!==_0x7b7e('0x3e')){var _0x213a8c={};_0x213a8c[_0x5f3de5[_0x7b7e('0x28')]]={'$like':'%'+_0x12ef0b['query'][_0x7b7e('0x3b')]+'%'};return _0x213a8c;}})});}_0x503625=_[_0x7b7e('0x3d')]({},_0x503625,_0x12ef0b[_0x7b7e('0x3f')]);var _0x5c58c0={'where':_0x503625['where']};return db[_0x7b7e('0x2a')]['count'](_0x5c58c0)[_0x7b7e('0x26')](function(_0x3b16d7){_0x51d4b5['count']=_0x3b16d7;if(_0x12ef0b[_0x7b7e('0x30')][_0x7b7e('0x40')]){_0x503625[_0x7b7e('0x41')]=[{'all':!![]}];}return db[_0x7b7e('0x2a')][_0x7b7e('0x42')](_0x503625);})[_0x7b7e('0x26')](function(_0xc888e4){_0x51d4b5[_0x7b7e('0x43')]=_0xc888e4;return _0x51d4b5;})[_0x7b7e('0x26')](respondWithFilteredResult(_0x423832,_0x503625))['catch'](handleError(_0x423832,null));};exports['show']=function(_0x25b41e,_0x550ea6){var _0x41c8a6={'raw':!![],'where':{'id':_0x25b41e['params']['id']}},_0x5e8b5d={};_0x5e8b5d[_0x7b7e('0x2e')]=_['keys'](db[_0x7b7e('0x2a')]['rawAttributes']);_0x5e8b5d[_0x7b7e('0x30')]=_[_0x7b7e('0x2f')](_0x25b41e[_0x7b7e('0x30')]);_0x5e8b5d[_0x7b7e('0x31')]=_['intersection'](_0x5e8b5d[_0x7b7e('0x2e')],_0x5e8b5d[_0x7b7e('0x30')]);_0x41c8a6[_0x7b7e('0x33')]=_[_0x7b7e('0x32')](_0x5e8b5d[_0x7b7e('0x2e')],qs[_0x7b7e('0x34')](_0x25b41e['query']['fields']));_0x41c8a6['attributes']=_0x41c8a6[_0x7b7e('0x33')][_0x7b7e('0x35')]?_0x41c8a6[_0x7b7e('0x33')]:_0x5e8b5d[_0x7b7e('0x2e')];if(_0x25b41e[_0x7b7e('0x30')][_0x7b7e('0x40')]){_0x41c8a6['include']=[{'all':!![]}];}_0x41c8a6=_[_0x7b7e('0x3d')]({},_0x41c8a6,_0x25b41e[_0x7b7e('0x3f')]);return db['WhatsappQueueReport']['find'](_0x41c8a6)[_0x7b7e('0x26')](handleEntityNotFound(_0x550ea6,null))[_0x7b7e('0x26')](respondWithResult(_0x550ea6,null))[_0x7b7e('0x44')](handleError(_0x550ea6,null));};exports[_0x7b7e('0x45')]=function(_0x38b4d0,_0xb46776){return db['WhatsappQueueReport'][_0x7b7e('0x45')](_0x38b4d0['body'],{})[_0x7b7e('0x26')](respondWithResult(_0xb46776,0xc9))[_0x7b7e('0x44')](handleError(_0xb46776,null));};exports[_0x7b7e('0x25')]=function(_0x5874e2,_0x58e4e6){if(_0x5874e2[_0x7b7e('0x46')]['id']){delete _0x5874e2[_0x7b7e('0x46')]['id'];}return db[_0x7b7e('0x2a')][_0x7b7e('0x47')]({'where':{'id':_0x5874e2[_0x7b7e('0x48')]['id']}})['then'](handleEntityNotFound(_0x58e4e6,null))[_0x7b7e('0x26')](saveUpdates(_0x5874e2[_0x7b7e('0x46')],null))[_0x7b7e('0x26')](respondWithResult(_0x58e4e6,null))[_0x7b7e('0x44')](handleError(_0x58e4e6,null));};exports[_0x7b7e('0x49')]=function(_0x5a9697,_0x1d6d18){return db[_0x7b7e('0x2a')][_0x7b7e('0x47')]({'where':{'id':_0x5a9697[_0x7b7e('0x48')]['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x1d6d18,null))[_0x7b7e('0x26')](removeEntity(_0x1d6d18,null))[_0x7b7e('0x44')](handleError(_0x1d6d18,null));};exports['describe']=function(_0x433ec7,_0x5d7c89){return db[_0x7b7e('0x2a')][_0x7b7e('0x4a')]()['then'](respondWithResult(_0x5d7c89,null))[_0x7b7e('0x44')](handleError(_0x5d7c89,null));}; \ No newline at end of file +var _0x0bb5=['attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','merge','where','VIRTUAL','options','findAll','show','params','rawAttributes','includeAll','include','find','catch','create','body','update','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','end','name','send','index','map','WhatsappQueueReport','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x4d3866,_0x2be87b){var _0x1aa3be=function(_0xdee8f0){while(--_0xdee8f0){_0x4d3866['push'](_0x4d3866['shift']());}};_0x1aa3be(++_0x2be87b);}(_0x0bb5,0x148));var _0x50bb=function(_0x4df97f,_0x127df5){_0x4df97f=_0x4df97f-0x0;var _0x1952dd=_0x0bb5[_0x4df97f];return _0x1952dd;};'use strict';var emlformat=require(_0x50bb('0x0'));var rimraf=require(_0x50bb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x50bb('0x2'));var moment=require(_0x50bb('0x3'));var BPromise=require(_0x50bb('0x4'));var Mustache=require(_0x50bb('0x5'));var util=require(_0x50bb('0x6'));var path=require(_0x50bb('0x7'));var sox=require(_0x50bb('0x8'));var csv=require(_0x50bb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');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 licenseUtil=require(_0x50bb('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x226370,_0x58837d){_0x58837d=_0x58837d||0xcc;return function(_0x283f04){if(_0x283f04){return _0x226370[_0x50bb('0x19')](_0x58837d);}return _0x226370[_0x50bb('0x1a')](_0x58837d)['end']();};}function respondWithResult(_0x17007f,_0x309986){_0x309986=_0x309986||0xc8;return function(_0x3094f2){if(_0x3094f2){return _0x17007f['status'](_0x309986)[_0x50bb('0x1b')](_0x3094f2);}};}function respondWithFilteredResult(_0x5e8478,_0x21befa){return function(_0x3e1a51){if(_0x3e1a51){var _0x253073=typeof _0x21befa[_0x50bb('0x1c')]===_0x50bb('0x1d')&&typeof _0x21befa['limit']===_0x50bb('0x1d');var _0x174065=_0x3e1a51['count'];var _0x24ba19=_0x253073?0x0:_0x21befa['offset'];var _0x301f61=_0x253073?_0x3e1a51[_0x50bb('0x1e')]:_0x21befa['offset']+_0x21befa['limit'];var _0x43465b;if(_0x301f61>=_0x174065){_0x301f61=_0x174065;_0x43465b=0xc8;}else{_0x43465b=0xce;}_0x5e8478[_0x50bb('0x1a')](_0x43465b);return _0x5e8478[_0x50bb('0x1f')](_0x50bb('0x20'),_0x24ba19+'-'+_0x301f61+'/'+_0x174065)['json'](_0x3e1a51);}return null;};}function patchUpdates(_0x19dc5d){return function(_0x32bfc3){try{jsonpatch[_0x50bb('0x21')](_0x32bfc3,_0x19dc5d,!![]);}catch(_0x597e95){return BPromise[_0x50bb('0x22')](_0x597e95);}return _0x32bfc3[_0x50bb('0x23')]();};}function saveUpdates(_0x1344ec,_0x4825f8){return function(_0x1dbba2){if(_0x1dbba2){return _0x1dbba2['update'](_0x1344ec)[_0x50bb('0x24')](function(_0x3391da){return _0x3391da;});}return null;};}function removeEntity(_0x1a2a0b,_0x2ee87a){return function(_0x846311){if(_0x846311){return _0x846311[_0x50bb('0x25')]()['then'](function(){_0x1a2a0b[_0x50bb('0x1a')](0xcc)[_0x50bb('0x26')]();});}};}function handleEntityNotFound(_0x284a76,_0x3462c1){return function(_0x5234d7){if(!_0x5234d7){_0x284a76[_0x50bb('0x19')](0x194);}return _0x5234d7;};}function handleError(_0x4d38f7,_0x55e87b){_0x55e87b=_0x55e87b||0x1f4;return function(_0x2befd9){logger['error'](_0x2befd9['stack']);if(_0x2befd9[_0x50bb('0x27')]){delete _0x2befd9[_0x50bb('0x27')];}_0x4d38f7[_0x50bb('0x1a')](_0x55e87b)[_0x50bb('0x28')](_0x2befd9);};}exports[_0x50bb('0x29')]=function(_0x269479,_0x41a8ad){var _0x41d479={},_0x4f7514={},_0x44ce86={'count':0x0,'rows':[]};var _0x461cf3=_[_0x50bb('0x2a')](db[_0x50bb('0x2b')]['rawAttributes'],function(_0x13dc3c){return{'name':_0x13dc3c[_0x50bb('0x2c')],'type':_0x13dc3c[_0x50bb('0x2d')][_0x50bb('0x2e')]};});_0x4f7514[_0x50bb('0x2f')]=_[_0x50bb('0x2a')](_0x461cf3,_0x50bb('0x27'));_0x4f7514[_0x50bb('0x30')]=_[_0x50bb('0x31')](_0x269479[_0x50bb('0x30')]);_0x4f7514[_0x50bb('0x32')]=_[_0x50bb('0x33')](_0x4f7514['model'],_0x4f7514[_0x50bb('0x30')]);_0x41d479[_0x50bb('0x34')]=_[_0x50bb('0x33')](_0x4f7514[_0x50bb('0x2f')],qs[_0x50bb('0x35')](_0x269479[_0x50bb('0x30')][_0x50bb('0x35')]));_0x41d479[_0x50bb('0x34')]=_0x41d479[_0x50bb('0x34')][_0x50bb('0x36')]?_0x41d479[_0x50bb('0x34')]:_0x4f7514['model'];if(!_0x269479[_0x50bb('0x30')][_0x50bb('0x37')](_0x50bb('0x38'))){_0x41d479[_0x50bb('0x39')]=qs[_0x50bb('0x39')](_0x269479[_0x50bb('0x30')]['limit']);_0x41d479['offset']=qs[_0x50bb('0x1c')](_0x269479['query'][_0x50bb('0x1c')]);}_0x41d479[_0x50bb('0x3a')]=qs[_0x50bb('0x3b')](_0x269479[_0x50bb('0x30')][_0x50bb('0x3b')]);_0x41d479['where']=qs[_0x50bb('0x32')](_['pick'](_0x269479[_0x50bb('0x30')],_0x4f7514[_0x50bb('0x32')]),_0x461cf3);if(_0x269479[_0x50bb('0x30')]['filter']){_0x41d479['where']=_[_0x50bb('0x3c')](_0x41d479[_0x50bb('0x3d')],{'$or':_[_0x50bb('0x2a')](_0x461cf3,function(_0x21a180){if(_0x21a180['type']!==_0x50bb('0x3e')){var _0x4b75dc={};_0x4b75dc[_0x21a180['name']]={'$like':'%'+_0x269479[_0x50bb('0x30')]['filter']+'%'};return _0x4b75dc;}})});}_0x41d479=_[_0x50bb('0x3c')]({},_0x41d479,_0x269479[_0x50bb('0x3f')]);var _0x1ef231={'where':_0x41d479[_0x50bb('0x3d')]};return db[_0x50bb('0x2b')][_0x50bb('0x1e')](_0x1ef231)[_0x50bb('0x24')](function(_0x1cf782){_0x44ce86[_0x50bb('0x1e')]=_0x1cf782;if(_0x269479[_0x50bb('0x30')]['includeAll']){_0x41d479['include']=[{'all':!![]}];}return db[_0x50bb('0x2b')][_0x50bb('0x40')](_0x41d479);})[_0x50bb('0x24')](function(_0x1d929d){_0x44ce86['rows']=_0x1d929d;return _0x44ce86;})[_0x50bb('0x24')](respondWithFilteredResult(_0x41a8ad,_0x41d479))['catch'](handleError(_0x41a8ad,null));};exports[_0x50bb('0x41')]=function(_0x473a4c,_0x379944){var _0x40748d={'raw':!![],'where':{'id':_0x473a4c[_0x50bb('0x42')]['id']}},_0x1c438b={};_0x1c438b[_0x50bb('0x2f')]=_[_0x50bb('0x31')](db[_0x50bb('0x2b')][_0x50bb('0x43')]);_0x1c438b[_0x50bb('0x30')]=_[_0x50bb('0x31')](_0x473a4c[_0x50bb('0x30')]);_0x1c438b[_0x50bb('0x32')]=_[_0x50bb('0x33')](_0x1c438b[_0x50bb('0x2f')],_0x1c438b['query']);_0x40748d[_0x50bb('0x34')]=_['intersection'](_0x1c438b[_0x50bb('0x2f')],qs[_0x50bb('0x35')](_0x473a4c[_0x50bb('0x30')][_0x50bb('0x35')]));_0x40748d[_0x50bb('0x34')]=_0x40748d[_0x50bb('0x34')][_0x50bb('0x36')]?_0x40748d[_0x50bb('0x34')]:_0x1c438b[_0x50bb('0x2f')];if(_0x473a4c[_0x50bb('0x30')][_0x50bb('0x44')]){_0x40748d[_0x50bb('0x45')]=[{'all':!![]}];}_0x40748d=_[_0x50bb('0x3c')]({},_0x40748d,_0x473a4c[_0x50bb('0x3f')]);return db['WhatsappQueueReport'][_0x50bb('0x46')](_0x40748d)['then'](handleEntityNotFound(_0x379944,null))[_0x50bb('0x24')](respondWithResult(_0x379944,null))[_0x50bb('0x47')](handleError(_0x379944,null));};exports[_0x50bb('0x48')]=function(_0x35b440,_0x650e91){return db[_0x50bb('0x2b')][_0x50bb('0x48')](_0x35b440[_0x50bb('0x49')],{})['then'](respondWithResult(_0x650e91,0xc9))[_0x50bb('0x47')](handleError(_0x650e91,null));};exports[_0x50bb('0x4a')]=function(_0xf52a22,_0x13afe2){if(_0xf52a22[_0x50bb('0x49')]['id']){delete _0xf52a22['body']['id'];}return db[_0x50bb('0x2b')][_0x50bb('0x46')]({'where':{'id':_0xf52a22[_0x50bb('0x42')]['id']}})[_0x50bb('0x24')](handleEntityNotFound(_0x13afe2,null))[_0x50bb('0x24')](saveUpdates(_0xf52a22['body'],null))['then'](respondWithResult(_0x13afe2,null))[_0x50bb('0x47')](handleError(_0x13afe2,null));};exports['destroy']=function(_0x357d08,_0x57ee0e){return db[_0x50bb('0x2b')][_0x50bb('0x46')]({'where':{'id':_0x357d08[_0x50bb('0x42')]['id']}})['then'](handleEntityNotFound(_0x57ee0e,null))[_0x50bb('0x24')](removeEntity(_0x57ee0e,null))[_0x50bb('0x47')](handleError(_0x57ee0e,null));};exports['describe']=function(_0x184147,_0x1dff6a){return db[_0x50bb('0x2b')][_0x50bb('0x4b')]()['then'](respondWithResult(_0x1dff6a,null))[_0x50bb('0x47')](handleError(_0x1dff6a,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index f8e0c8e..c0d4f0a 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.model.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x343a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','../../config/logger','api'];(function(_0x262e43,_0x183bbf){var _0x3a58e1=function(_0x24a613){while(--_0x24a613){_0x262e43['push'](_0x262e43['shift']());}};_0x3a58e1(++_0x183bbf);}(_0x343a,0xde));var _0xa343=function(_0x3fec74,_0x2b21f8){_0x3fec74=_0x3fec74-0x0;var _0x3e4077=_0x343a[_0x3fec74];return _0x3e4077;};'use strict';var _=require(_0xa343('0x0'));var util=require('util');var logger=require(_0xa343('0x1'))(_0xa343('0x2'));var moment=require(_0xa343('0x3'));var BPromise=require(_0xa343('0x4'));var rp=require(_0xa343('0x5'));var fs=require('fs');var path=require(_0xa343('0x6'));var rimraf=require(_0xa343('0x7'));var config=require(_0xa343('0x8'));var attributes=require(_0xa343('0x9'));module[_0xa343('0xa')]=function(_0x520262,_0x2cfae4){return _0x520262[_0xa343('0xb')](_0xa343('0xc'),attributes,{'tableName':_0xa343('0xd'),'paranoid':![],'indexes':[{'name':_0xa343('0xe'),'fields':[_0xa343('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8ba1=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util'];(function(_0x150674,_0x13574e){var _0x22c2c2=function(_0x14745d){while(--_0x14745d){_0x150674['push'](_0x150674['shift']());}};_0x22c2c2(++_0x13574e);}(_0x8ba1,0x116));var _0x18ba=function(_0x17b384,_0x406c7e){_0x17b384=_0x17b384-0x0;var _0x2db707=_0x8ba1[_0x17b384];return _0x2db707;};'use strict';var _=require(_0x18ba('0x0'));var util=require(_0x18ba('0x1'));var logger=require(_0x18ba('0x2'))('api');var moment=require(_0x18ba('0x3'));var BPromise=require(_0x18ba('0x4'));var rp=require(_0x18ba('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x18ba('0x6'));var config=require(_0x18ba('0x7'));var attributes=require(_0x18ba('0x8'));module[_0x18ba('0x9')]=function(_0x23bb79,_0x29811c){return _0x23bb79[_0x18ba('0xa')](_0x18ba('0xb'),attributes,{'tableName':_0x18ba('0xc'),'paranoid':![],'indexes':[{'name':_0x18ba('0xd'),'fields':[_0x18ba('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index feb92c1..acea167 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc1a2=['catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','info','UpdateWhatsappQueueReport','update','where','attributes','limit','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x420c44,_0x11af5b){var _0x138afb=function(_0x3e52f5){while(--_0x3e52f5){_0x420c44['push'](_0x420c44['shift']());}};_0x138afb(++_0x11af5b);}(_0xc1a2,0x1a5));var _0x2c1a=function(_0x11aeb8,_0x1d2ed6){_0x11aeb8=_0x11aeb8-0x0;var _0x4283fb=_0xc1a2[_0x11aeb8];return _0x4283fb;};'use strict';var _=require(_0x2c1a('0x0'));var util=require(_0x2c1a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2c1a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2c1a('0x3'))['db'];var utils=require(_0x2c1a('0x4'));var logger=require(_0x2c1a('0x5'))(_0x2c1a('0x6'));var config=require(_0x2c1a('0x7'));var jayson=require(_0x2c1a('0x8'));var client=jayson['client'][_0x2c1a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f56fc,_0x134347,_0x19284e){return new BPromise(function(_0xa427c3,_0x4b1454){return client[_0x2c1a('0xa')](_0x5f56fc,_0x19284e)[_0x2c1a('0xb')](function(_0x14055b){logger['info'](_0x2c1a('0xc'),_0x134347,_0x2c1a('0xd'));logger[_0x2c1a('0xe')](_0x2c1a('0xf'),_0x134347,_0x2c1a('0xd'),JSON[_0x2c1a('0x10')](_0x14055b));if(_0x14055b[_0x2c1a('0x11')]){if(_0x14055b[_0x2c1a('0x11')][_0x2c1a('0x12')]===0x1f4){logger[_0x2c1a('0x11')](_0x2c1a('0xc'),_0x134347,_0x14055b[_0x2c1a('0x11')][_0x2c1a('0x13')]);return _0x4b1454(_0x14055b[_0x2c1a('0x11')][_0x2c1a('0x13')]);}logger[_0x2c1a('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0x134347,_0x14055b['error'][_0x2c1a('0x13')]);return _0xa427c3(_0x14055b['error'][_0x2c1a('0x13')]);}else{logger['info'](_0x2c1a('0xc'),_0x134347,_0x2c1a('0xd'));_0xa427c3(_0x14055b[_0x2c1a('0x14')][_0x2c1a('0x13')]);}})[_0x2c1a('0x15')](function(_0x4c26f8){logger[_0x2c1a('0x11')](_0x2c1a('0xc'),_0x134347,_0x4c26f8);_0x4b1454(_0x4c26f8);});});}exports[_0x2c1a('0x16')]=function(_0x4d22f0){var _0x4b8c2a=this;return new Promise(function(_0x30a808,_0x93b70c){return db[_0x2c1a('0x17')][_0x2c1a('0x18')](_0x4d22f0[_0x2c1a('0x19')],{'raw':_0x4d22f0[_0x2c1a('0x1a')]?_0x4d22f0['options'][_0x2c1a('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x4fc62f){logger[_0x2c1a('0x1c')]('CreateWhatsappQueueReport',_0x4d22f0);logger['debug'](_0x2c1a('0x16'),_0x4d22f0,JSON['stringify'](_0x4fc62f));_0x30a808(_0x4fc62f);})['catch'](function(_0x2b4528){logger[_0x2c1a('0x11')](_0x2c1a('0x16'),_0x2b4528[_0x2c1a('0x13')],_0x4d22f0);_0x93b70c(_0x4b8c2a[_0x2c1a('0x11')](0x1f4,_0x2b4528['message']));});});};exports[_0x2c1a('0x1d')]=function(_0xd8d550){var _0x2cb439=this;return new Promise(function(_0x11bc4f,_0x2e7976){return db[_0x2c1a('0x17')][_0x2c1a('0x1e')](_0xd8d550[_0x2c1a('0x19')],{'raw':_0xd8d550['options']?_0xd8d550[_0x2c1a('0x1a')][_0x2c1a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd8d550[_0x2c1a('0x1a')]?_0xd8d550[_0x2c1a('0x1a')][_0x2c1a('0x1f')]||null:null,'attributes':_0xd8d550[_0x2c1a('0x1a')]?_0xd8d550['options'][_0x2c1a('0x20')]||null:null,'limit':_0xd8d550[_0x2c1a('0x1a')]?_0xd8d550[_0x2c1a('0x1a')][_0x2c1a('0x21')]||null:null})[_0x2c1a('0xb')](function(_0x3b49de){logger['info']('UpdateWhatsappQueueReport',_0xd8d550);logger['debug'](_0x2c1a('0x1d'),_0xd8d550,JSON[_0x2c1a('0x10')](_0x3b49de));_0x11bc4f(_0x3b49de);})[_0x2c1a('0x15')](function(_0x5ade03){logger[_0x2c1a('0x11')](_0x2c1a('0x1d'),_0x5ade03[_0x2c1a('0x13')],_0xd8d550);_0x2e7976(_0x2cb439[_0x2c1a('0x11')](0x1f4,_0x5ade03[_0x2c1a('0x13')]));});});}; \ No newline at end of file +var _0x529b=['WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','options','raw','body','where','attributes','limit','UpdateWhatsappQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x221c64,_0x65199a){var _0x5acb83=function(_0x2a2186){while(--_0x2a2186){_0x221c64['push'](_0x221c64['shift']());}};_0x5acb83(++_0x65199a);}(_0x529b,0x100));var _0xb529=function(_0x27d46b,_0x2b1cf8){_0x27d46b=_0x27d46b-0x0;var _0xead63b=_0x529b[_0x27d46b];return _0xead63b;};'use strict';var _=require(_0xb529('0x0'));var util=require(_0xb529('0x1'));var moment=require(_0xb529('0x2'));var BPromise=require(_0xb529('0x3'));var rs=require(_0xb529('0x4'));var fs=require('fs');var Redis=require(_0xb529('0x5'));var db=require(_0xb529('0x6'))['db'];var utils=require(_0xb529('0x7'));var logger=require(_0xb529('0x8'))(_0xb529('0x9'));var config=require(_0xb529('0xa'));var jayson=require(_0xb529('0xb'));var client=jayson[_0xb529('0xc')][_0xb529('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3812fb,_0x24f62e,_0x2b2c7a){return new BPromise(function(_0x496487,_0x1bc2eb){return client['request'](_0x3812fb,_0x2b2c7a)[_0xb529('0xe')](function(_0x42ca7b){logger[_0xb529('0xf')](_0xb529('0x10'),_0x24f62e,_0xb529('0x11'));logger[_0xb529('0x12')](_0xb529('0x13'),_0x24f62e,_0xb529('0x11'),JSON[_0xb529('0x14')](_0x42ca7b));if(_0x42ca7b[_0xb529('0x15')]){if(_0x42ca7b['error']['code']===0x1f4){logger[_0xb529('0x15')](_0xb529('0x10'),_0x24f62e,_0x42ca7b[_0xb529('0x15')][_0xb529('0x16')]);return _0x1bc2eb(_0x42ca7b[_0xb529('0x15')][_0xb529('0x16')]);}logger[_0xb529('0x15')](_0xb529('0x10'),_0x24f62e,_0x42ca7b['error'][_0xb529('0x16')]);return _0x496487(_0x42ca7b[_0xb529('0x15')][_0xb529('0x16')]);}else{logger[_0xb529('0xf')](_0xb529('0x10'),_0x24f62e,_0xb529('0x11'));_0x496487(_0x42ca7b[_0xb529('0x17')][_0xb529('0x16')]);}})[_0xb529('0x18')](function(_0x1dc050){logger[_0xb529('0x15')]('WhatsappQueueReport,\x20%s,\x20%s',_0x24f62e,_0x1dc050);_0x1bc2eb(_0x1dc050);});});}exports[_0xb529('0x19')]=function(_0x5aa30d){var _0x2771a7=this;return new Promise(function(_0x143c10,_0x278d25){return db[_0xb529('0x1a')]['create'](_0x5aa30d['body'],{'raw':_0x5aa30d[_0xb529('0x1b')]?_0x5aa30d[_0xb529('0x1b')][_0xb529('0x1c')]===undefined?!![]:![]:!![]})[_0xb529('0xe')](function(_0x213a8f){logger[_0xb529('0xf')]('CreateWhatsappQueueReport',_0x5aa30d);logger[_0xb529('0x12')](_0xb529('0x19'),_0x5aa30d,JSON[_0xb529('0x14')](_0x213a8f));_0x143c10(_0x213a8f);})[_0xb529('0x18')](function(_0x2a9e87){logger[_0xb529('0x15')](_0xb529('0x19'),_0x2a9e87[_0xb529('0x16')],_0x5aa30d);_0x278d25(_0x2771a7['error'](0x1f4,_0x2a9e87[_0xb529('0x16')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x28fdb9){var _0xb39e42=this;return new Promise(function(_0x37a266,_0x5a70ee){return db[_0xb529('0x1a')]['update'](_0x28fdb9[_0xb529('0x1d')],{'raw':_0x28fdb9[_0xb529('0x1b')]?_0x28fdb9[_0xb529('0x1b')][_0xb529('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28fdb9[_0xb529('0x1b')]?_0x28fdb9[_0xb529('0x1b')][_0xb529('0x1e')]||null:null,'attributes':_0x28fdb9[_0xb529('0x1b')]?_0x28fdb9[_0xb529('0x1b')][_0xb529('0x1f')]||null:null,'limit':_0x28fdb9[_0xb529('0x1b')]?_0x28fdb9[_0xb529('0x1b')][_0xb529('0x20')]||null:null})['then'](function(_0x33fec1){logger[_0xb529('0xf')](_0xb529('0x21'),_0x28fdb9);logger[_0xb529('0x12')](_0xb529('0x21'),_0x28fdb9,JSON[_0xb529('0x14')](_0x33fec1));_0x37a266(_0x33fec1);})[_0xb529('0x18')](function(_0x306d19){logger[_0xb529('0x15')](_0xb529('0x21'),_0x306d19[_0xb529('0x16')],_0x28fdb9);_0x5a70ee(_0xb39e42[_0xb529('0x15')](0x1f4,_0x306d19[_0xb529('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index b01e2b7..84eac26 100644 --- a/server/api/whatsappTransferReport/index.js +++ b/server/api/whatsappTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x487a=['fs-extra','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','create','put','delete','util','path','connect-timeout','Router'];(function(_0x3ac49d,_0x9dc0a4){var _0x43144e=function(_0x1a1478){while(--_0x1a1478){_0x3ac49d['push'](_0x3ac49d['shift']());}};_0x43144e(++_0x9dc0a4);}(_0x487a,0x84));var _0xa487=function(_0x43b584,_0x20a6bd){_0x43b584=_0x43b584-0x0;var _0x48f27b=_0x487a[_0x43b584];return _0x48f27b;};'use strict';var multer=require('multer');var util=require(_0xa487('0x0'));var path=require(_0xa487('0x1'));var timeout=require(_0xa487('0x2'));var express=require('express');var router=express[_0xa487('0x3')]();var fs_extra=require(_0xa487('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa487('0x5'));var config=require(_0xa487('0x6'));var controller=require(_0xa487('0x7'));router[_0xa487('0x8')]('/',auth[_0xa487('0x9')](),controller[_0xa487('0xa')]);router[_0xa487('0x8')](_0xa487('0xb'),auth[_0xa487('0x9')](),controller[_0xa487('0xc')]);router['get'](_0xa487('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xa487('0x9')](),controller[_0xa487('0xe')]);router[_0xa487('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xa487('0x10')]('/:id',auth[_0xa487('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xca10=['../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3ef45e,_0xe84f33){var _0x69e7c=function(_0x43ba11){while(--_0x43ba11){_0x3ef45e['push'](_0x3ef45e['shift']());}};_0x69e7c(++_0xe84f33);}(_0xca10,0xd3));var _0x0ca1=function(_0x5a1f2d,_0x207962){_0x5a1f2d=_0x5a1f2d-0x0;var _0x3194bc=_0xca10[_0x5a1f2d];return _0x3194bc;};'use strict';var multer=require(_0x0ca1('0x0'));var util=require(_0x0ca1('0x1'));var path=require(_0x0ca1('0x2'));var timeout=require(_0x0ca1('0x3'));var express=require(_0x0ca1('0x4'));var router=express[_0x0ca1('0x5')]();var fs_extra=require(_0x0ca1('0x6'));var auth=require(_0x0ca1('0x7'));var interaction=require(_0x0ca1('0x8'));var config=require(_0x0ca1('0x9'));var controller=require('./whatsappTransferReport.controller');router[_0x0ca1('0xa')]('/',auth[_0x0ca1('0xb')](),controller['index']);router[_0x0ca1('0xa')](_0x0ca1('0xc'),auth[_0x0ca1('0xb')](),controller[_0x0ca1('0xd')]);router['get'](_0x0ca1('0xe'),auth[_0x0ca1('0xb')](),controller[_0x0ca1('0xf')]);router[_0x0ca1('0x10')]('/',auth[_0x0ca1('0xb')](),controller[_0x0ca1('0x11')]);router['put']('/:id',auth[_0x0ca1('0xb')](),controller[_0x0ca1('0x12')]);router[_0x0ca1('0x13')](_0x0ca1('0xe'),auth[_0x0ca1('0xb')](),controller[_0x0ca1('0x14')]);module[_0x0ca1('0x15')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 35b3e42..b0fe672 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1e24=['ENUM','agent','queue','DATE','sequelize','exports','STRING'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1e24,0x82));var _0x41e2=function(_0x2f53fc,_0x2a34d7){_0x2f53fc=_0x2f53fc-0x0;var _0xa911c2=_0x1e24[_0x2f53fc];return _0xa911c2;};'use strict';var Sequelize=require(_0x41e2('0x0'));module[_0x41e2('0x1')]={'uniqueid':{'type':Sequelize[_0x41e2('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x41e2('0x3')]('account',_0x41e2('0x4'),_0x41e2('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x41e2('0x6')]}}; \ No newline at end of file +var _0xd26f=['exports','account','agent','queue','DATE','sequelize'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xd26f,0x113));var _0xfd26=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xd26f[_0x1035c1];return _0x308d67;};'use strict';var Sequelize=require(_0xfd26('0x0'));module[_0xfd26('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xfd26('0x2'),_0xfd26('0x3'),_0xfd26('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xfd26('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index a48ce7c..31e6da9 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x116d=['map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','WhatsappTransferReport','rows','catch','show','params','merge','create','body','find','describe','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send'];(function(_0x5499ab,_0x4c1128){var _0x344478=function(_0x5d767e){while(--_0x5d767e){_0x5499ab['push'](_0x5499ab['shift']());}};_0x344478(++_0x4c1128);}(_0x116d,0x69));var _0xd116=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x116d[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0xd116('0x0'));var rimraf=require(_0xd116('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd116('0x2'));var BPromise=require(_0xd116('0x3'));var Mustache=require(_0xd116('0x4'));var util=require(_0xd116('0x5'));var path=require(_0xd116('0x6'));var sox=require(_0xd116('0x7'));var csv=require('to-csv');var ejs=require(_0xd116('0x8'));var fs=require('fs');var fs_extra=require(_0xd116('0x9'));var _=require(_0xd116('0xa'));var squel=require(_0xd116('0xb'));var crypto=require(_0xd116('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd116('0xd'));var toCsv=require(_0xd116('0xe'));var querystring=require(_0xd116('0xf'));var Papa=require('papaparse');var Redis=require(_0xd116('0x10'));var authService=require(_0xd116('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd116('0x12'));var config=require(_0xd116('0x13'));var licenseUtil=require(_0xd116('0x14'));var db=require(_0xd116('0x15'))['db'];function respondWithStatusCode(_0x5f6cc9,_0x9f6e24){_0x9f6e24=_0x9f6e24||0xcc;return function(_0x4b6263){if(_0x4b6263){return _0x5f6cc9[_0xd116('0x16')](_0x9f6e24);}return _0x5f6cc9['status'](_0x9f6e24)[_0xd116('0x17')]();};}function respondWithResult(_0x1ee9cd,_0x118b3b){_0x118b3b=_0x118b3b||0xc8;return function(_0x48803a){if(_0x48803a){return _0x1ee9cd[_0xd116('0x18')](_0x118b3b)['json'](_0x48803a);}};}function respondWithFilteredResult(_0x4804e4,_0x31d7aa){return function(_0x58d925){if(_0x58d925){var _0x293346=typeof _0x31d7aa['offset']==='undefined'&&typeof _0x31d7aa[_0xd116('0x19')]==='undefined';var _0x58469f=_0x58d925[_0xd116('0x1a')];var _0x24a422=_0x293346?0x0:_0x31d7aa[_0xd116('0x1b')];var _0x227c4b=_0x293346?_0x58d925[_0xd116('0x1a')]:_0x31d7aa[_0xd116('0x1b')]+_0x31d7aa[_0xd116('0x19')];var _0x242bec;if(_0x227c4b>=_0x58469f){_0x227c4b=_0x58469f;_0x242bec=0xc8;}else{_0x242bec=0xce;}_0x4804e4[_0xd116('0x18')](_0x242bec);return _0x4804e4[_0xd116('0x1c')](_0xd116('0x1d'),_0x24a422+'-'+_0x227c4b+'/'+_0x58469f)[_0xd116('0x1e')](_0x58d925);}return null;};}function patchUpdates(_0x51f3a8){return function(_0x1e94a8){try{jsonpatch[_0xd116('0x1f')](_0x1e94a8,_0x51f3a8,!![]);}catch(_0x45bf3f){return BPromise[_0xd116('0x20')](_0x45bf3f);}return _0x1e94a8[_0xd116('0x21')]();};}function saveUpdates(_0x4bb879,_0x3bab7a){return function(_0x434b41){if(_0x434b41){return _0x434b41[_0xd116('0x22')](_0x4bb879)[_0xd116('0x23')](function(_0x530337){return _0x530337;});}return null;};}function removeEntity(_0x30fa2b,_0x4c7085){return function(_0x37de79){if(_0x37de79){return _0x37de79[_0xd116('0x24')]()[_0xd116('0x23')](function(){_0x30fa2b[_0xd116('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b7421,_0x51d658){return function(_0x5df0e4){if(!_0x5df0e4){_0x3b7421[_0xd116('0x16')](0x194);}return _0x5df0e4;};}function handleError(_0x2b216f,_0x10ba98){_0x10ba98=_0x10ba98||0x1f4;return function(_0x4db4cf){logger[_0xd116('0x25')](_0x4db4cf[_0xd116('0x26')]);if(_0x4db4cf['name']){delete _0x4db4cf[_0xd116('0x27')];}_0x2b216f['status'](_0x10ba98)[_0xd116('0x28')](_0x4db4cf);};}exports['index']=function(_0x3a5082,_0x2c5268){var _0x521ae8={},_0x28ba5f={},_0xe9c7a6={'count':0x0,'rows':[]};var _0x18683a=_[_0xd116('0x29')](db['WhatsappTransferReport'][_0xd116('0x2a')],function(_0x5d844b){return{'name':_0x5d844b['fieldName'],'type':_0x5d844b['type'][_0xd116('0x2b')]};});_0x28ba5f[_0xd116('0x2c')]=_[_0xd116('0x29')](_0x18683a,_0xd116('0x27'));_0x28ba5f[_0xd116('0x2d')]=_[_0xd116('0x2e')](_0x3a5082[_0xd116('0x2d')]);_0x28ba5f[_0xd116('0x2f')]=_[_0xd116('0x30')](_0x28ba5f[_0xd116('0x2c')],_0x28ba5f[_0xd116('0x2d')]);_0x521ae8[_0xd116('0x31')]=_[_0xd116('0x30')](_0x28ba5f['model'],qs['fields'](_0x3a5082[_0xd116('0x2d')][_0xd116('0x32')]));_0x521ae8[_0xd116('0x31')]=_0x521ae8[_0xd116('0x31')][_0xd116('0x33')]?_0x521ae8[_0xd116('0x31')]:_0x28ba5f[_0xd116('0x2c')];if(!_0x3a5082[_0xd116('0x2d')][_0xd116('0x34')]('nolimit')){_0x521ae8[_0xd116('0x19')]=qs[_0xd116('0x19')](_0x3a5082['query'][_0xd116('0x19')]);_0x521ae8['offset']=qs[_0xd116('0x1b')](_0x3a5082[_0xd116('0x2d')][_0xd116('0x1b')]);}_0x521ae8[_0xd116('0x35')]=qs[_0xd116('0x36')](_0x3a5082[_0xd116('0x2d')][_0xd116('0x36')]);_0x521ae8[_0xd116('0x37')]=qs[_0xd116('0x2f')](_[_0xd116('0x38')](_0x3a5082[_0xd116('0x2d')],_0x28ba5f[_0xd116('0x2f')]),_0x18683a);if(_0x3a5082['query'][_0xd116('0x39')]){_0x521ae8[_0xd116('0x37')]=_['merge'](_0x521ae8['where'],{'$or':_[_0xd116('0x29')](_0x18683a,function(_0x583c19){if(_0x583c19[_0xd116('0x3a')]!==_0xd116('0x3b')){var _0x3f8925={};_0x3f8925[_0x583c19[_0xd116('0x27')]]={'$like':'%'+_0x3a5082['query']['filter']+'%'};return _0x3f8925;}})});}_0x521ae8=_['merge']({},_0x521ae8,_0x3a5082[_0xd116('0x3c')]);var _0x1fdd67={'where':_0x521ae8['where']};return db['WhatsappTransferReport'][_0xd116('0x1a')](_0x1fdd67)['then'](function(_0x399dde){_0xe9c7a6[_0xd116('0x1a')]=_0x399dde;if(_0x3a5082[_0xd116('0x2d')][_0xd116('0x3d')]){_0x521ae8[_0xd116('0x3e')]=[{'all':!![]}];}return db[_0xd116('0x3f')]['findAll'](_0x521ae8);})[_0xd116('0x23')](function(_0xda1653){_0xe9c7a6[_0xd116('0x40')]=_0xda1653;return _0xe9c7a6;})['then'](respondWithFilteredResult(_0x2c5268,_0x521ae8))[_0xd116('0x41')](handleError(_0x2c5268,null));};exports[_0xd116('0x42')]=function(_0x2f5fe6,_0x435758){var _0x2a6d7f={'raw':!![],'where':{'id':_0x2f5fe6[_0xd116('0x43')]['id']}},_0x33b92b={};_0x33b92b['model']=_[_0xd116('0x2e')](db[_0xd116('0x3f')]['rawAttributes']);_0x33b92b[_0xd116('0x2d')]=_[_0xd116('0x2e')](_0x2f5fe6['query']);_0x33b92b['filters']=_[_0xd116('0x30')](_0x33b92b[_0xd116('0x2c')],_0x33b92b[_0xd116('0x2d')]);_0x2a6d7f[_0xd116('0x31')]=_['intersection'](_0x33b92b['model'],qs[_0xd116('0x32')](_0x2f5fe6[_0xd116('0x2d')][_0xd116('0x32')]));_0x2a6d7f[_0xd116('0x31')]=_0x2a6d7f[_0xd116('0x31')][_0xd116('0x33')]?_0x2a6d7f[_0xd116('0x31')]:_0x33b92b[_0xd116('0x2c')];if(_0x2f5fe6[_0xd116('0x2d')][_0xd116('0x3d')]){_0x2a6d7f[_0xd116('0x3e')]=[{'all':!![]}];}_0x2a6d7f=_[_0xd116('0x44')]({},_0x2a6d7f,_0x2f5fe6[_0xd116('0x3c')]);return db[_0xd116('0x3f')]['find'](_0x2a6d7f)['then'](handleEntityNotFound(_0x435758,null))['then'](respondWithResult(_0x435758,null))[_0xd116('0x41')](handleError(_0x435758,null));};exports[_0xd116('0x45')]=function(_0x1f01bf,_0x38750d){return db[_0xd116('0x3f')][_0xd116('0x45')](_0x1f01bf[_0xd116('0x46')],{})[_0xd116('0x23')](respondWithResult(_0x38750d,0xc9))['catch'](handleError(_0x38750d,null));};exports[_0xd116('0x22')]=function(_0x1bf100,_0x41bb22){if(_0x1bf100[_0xd116('0x46')]['id']){delete _0x1bf100['body']['id'];}return db[_0xd116('0x3f')][_0xd116('0x47')]({'where':{'id':_0x1bf100[_0xd116('0x43')]['id']}})[_0xd116('0x23')](handleEntityNotFound(_0x41bb22,null))[_0xd116('0x23')](saveUpdates(_0x1bf100['body'],null))[_0xd116('0x23')](respondWithResult(_0x41bb22,null))[_0xd116('0x41')](handleError(_0x41bb22,null));};exports[_0xd116('0x24')]=function(_0x2522a7,_0x4f59c1){return db[_0xd116('0x3f')][_0xd116('0x47')]({'where':{'id':_0x2522a7['params']['id']}})[_0xd116('0x23')](handleEntityNotFound(_0x4f59c1,null))[_0xd116('0x23')](removeEntity(_0x4f59c1,null))[_0xd116('0x41')](handleError(_0x4f59c1,null));};exports[_0xd116('0x48')]=function(_0x313586,_0xa9816a){return db[_0xd116('0x3f')][_0xd116('0x48')]()[_0xd116('0x23')](respondWithResult(_0xa9816a,null))['catch'](handleError(_0xa9816a,null));}; \ No newline at end of file +var _0x3061=['sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','WhatsappTransferReport','rawAttributes','type','model','map','keys','query','filters','intersection','fields','attributes','length','nolimit','order'];(function(_0x221b07,_0x49d864){var _0xf4b5d8=function(_0x2c56c9){while(--_0x2c56c9){_0x221b07['push'](_0x221b07['shift']());}};_0xf4b5d8(++_0x49d864);}(_0x3061,0x1e0));var _0x1306=function(_0x3b7a0c,_0xf1a4c2){_0x3b7a0c=_0x3b7a0c-0x0;var _0x3bb70f=_0x3061[_0x3b7a0c];return _0x3bb70f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1306('0x0'));var rp=require('request-promise');var moment=require(_0x1306('0x1'));var BPromise=require(_0x1306('0x2'));var Mustache=require(_0x1306('0x3'));var util=require(_0x1306('0x4'));var path=require(_0x1306('0x5'));var sox=require(_0x1306('0x6'));var csv=require(_0x1306('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1306('0x8'));var _=require(_0x1306('0x9'));var squel=require(_0x1306('0xa'));var crypto=require(_0x1306('0xb'));var jsforce=require(_0x1306('0xc'));var deskjs=require(_0x1306('0xd'));var toCsv=require(_0x1306('0x7'));var querystring=require(_0x1306('0xe'));var Papa=require(_0x1306('0xf'));var Redis=require('ioredis');var authService=require(_0x1306('0x10'));var qs=require(_0x1306('0x11'));var as=require(_0x1306('0x12'));var hardwareService=require(_0x1306('0x13'));var logger=require(_0x1306('0x14'))(_0x1306('0x15'));var utils=require(_0x1306('0x16'));var config=require(_0x1306('0x17'));var licenseUtil=require(_0x1306('0x18'));var db=require(_0x1306('0x19'))['db'];function respondWithStatusCode(_0x360c8d,_0x74806f){_0x74806f=_0x74806f||0xcc;return function(_0x11cdcc){if(_0x11cdcc){return _0x360c8d[_0x1306('0x1a')](_0x74806f);}return _0x360c8d['status'](_0x74806f)['end']();};}function respondWithResult(_0x57a4ad,_0x5f2d2a){_0x5f2d2a=_0x5f2d2a||0xc8;return function(_0x3b704f){if(_0x3b704f){return _0x57a4ad[_0x1306('0x1b')](_0x5f2d2a)[_0x1306('0x1c')](_0x3b704f);}};}function respondWithFilteredResult(_0x1e4948,_0x52fea5){return function(_0x140b31){if(_0x140b31){var _0xd484cf=typeof _0x52fea5[_0x1306('0x1d')]==='undefined'&&typeof _0x52fea5[_0x1306('0x1e')]==='undefined';var _0x414784=_0x140b31[_0x1306('0x1f')];var _0xed7387=_0xd484cf?0x0:_0x52fea5[_0x1306('0x1d')];var _0x57d125=_0xd484cf?_0x140b31[_0x1306('0x1f')]:_0x52fea5[_0x1306('0x1d')]+_0x52fea5[_0x1306('0x1e')];var _0x8fdb2b;if(_0x57d125>=_0x414784){_0x57d125=_0x414784;_0x8fdb2b=0xc8;}else{_0x8fdb2b=0xce;}_0x1e4948[_0x1306('0x1b')](_0x8fdb2b);return _0x1e4948[_0x1306('0x20')](_0x1306('0x21'),_0xed7387+'-'+_0x57d125+'/'+_0x414784)['json'](_0x140b31);}return null;};}function patchUpdates(_0x1f12ee){return function(_0x54b1ed){try{jsonpatch[_0x1306('0x22')](_0x54b1ed,_0x1f12ee,!![]);}catch(_0x4c8653){return BPromise[_0x1306('0x23')](_0x4c8653);}return _0x54b1ed[_0x1306('0x24')]();};}function saveUpdates(_0x37bd96,_0x138a20){return function(_0x5ce7cc){if(_0x5ce7cc){return _0x5ce7cc['update'](_0x37bd96)[_0x1306('0x25')](function(_0x2a5fdc){return _0x2a5fdc;});}return null;};}function removeEntity(_0x5dbb0a,_0xc4063a){return function(_0x4ce78f){if(_0x4ce78f){return _0x4ce78f[_0x1306('0x26')]()[_0x1306('0x25')](function(){_0x5dbb0a[_0x1306('0x1b')](0xcc)[_0x1306('0x27')]();});}};}function handleEntityNotFound(_0x43fed0,_0x2ac5ab){return function(_0x108937){if(!_0x108937){_0x43fed0['sendStatus'](0x194);}return _0x108937;};}function handleError(_0x516190,_0x14ed87){_0x14ed87=_0x14ed87||0x1f4;return function(_0x54793e){logger[_0x1306('0x28')](_0x54793e[_0x1306('0x29')]);if(_0x54793e[_0x1306('0x2a')]){delete _0x54793e[_0x1306('0x2a')];}_0x516190['status'](_0x14ed87)[_0x1306('0x2b')](_0x54793e);};}exports[_0x1306('0x2c')]=function(_0x21254c,_0x1ad1c4){var _0x36c0d5={},_0x258863={},_0xb8f0db={'count':0x0,'rows':[]};var _0x4b139d=_['map'](db[_0x1306('0x2d')][_0x1306('0x2e')],function(_0x1028c1){return{'name':_0x1028c1['fieldName'],'type':_0x1028c1[_0x1306('0x2f')]['key']};});_0x258863[_0x1306('0x30')]=_[_0x1306('0x31')](_0x4b139d,_0x1306('0x2a'));_0x258863['query']=_[_0x1306('0x32')](_0x21254c[_0x1306('0x33')]);_0x258863[_0x1306('0x34')]=_['intersection'](_0x258863[_0x1306('0x30')],_0x258863[_0x1306('0x33')]);_0x36c0d5['attributes']=_[_0x1306('0x35')](_0x258863[_0x1306('0x30')],qs[_0x1306('0x36')](_0x21254c[_0x1306('0x33')][_0x1306('0x36')]));_0x36c0d5[_0x1306('0x37')]=_0x36c0d5[_0x1306('0x37')][_0x1306('0x38')]?_0x36c0d5[_0x1306('0x37')]:_0x258863['model'];if(!_0x21254c[_0x1306('0x33')]['hasOwnProperty'](_0x1306('0x39'))){_0x36c0d5['limit']=qs[_0x1306('0x1e')](_0x21254c[_0x1306('0x33')]['limit']);_0x36c0d5['offset']=qs[_0x1306('0x1d')](_0x21254c[_0x1306('0x33')]['offset']);}_0x36c0d5[_0x1306('0x3a')]=qs[_0x1306('0x3b')](_0x21254c[_0x1306('0x33')][_0x1306('0x3b')]);_0x36c0d5[_0x1306('0x3c')]=qs[_0x1306('0x34')](_[_0x1306('0x3d')](_0x21254c['query'],_0x258863[_0x1306('0x34')]),_0x4b139d);if(_0x21254c['query']['filter']){_0x36c0d5[_0x1306('0x3c')]=_['merge'](_0x36c0d5[_0x1306('0x3c')],{'$or':_['map'](_0x4b139d,function(_0x2e4e0f){if(_0x2e4e0f[_0x1306('0x2f')]!==_0x1306('0x3e')){var _0xc1e5bd={};_0xc1e5bd[_0x2e4e0f[_0x1306('0x2a')]]={'$like':'%'+_0x21254c[_0x1306('0x33')][_0x1306('0x3f')]+'%'};return _0xc1e5bd;}})});}_0x36c0d5=_[_0x1306('0x40')]({},_0x36c0d5,_0x21254c[_0x1306('0x41')]);var _0x508497={'where':_0x36c0d5['where']};return db[_0x1306('0x2d')]['count'](_0x508497)[_0x1306('0x25')](function(_0x40f7d9){_0xb8f0db['count']=_0x40f7d9;if(_0x21254c[_0x1306('0x33')][_0x1306('0x42')]){_0x36c0d5[_0x1306('0x43')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x1306('0x44')](_0x36c0d5);})['then'](function(_0x2f98cb){_0xb8f0db[_0x1306('0x45')]=_0x2f98cb;return _0xb8f0db;})[_0x1306('0x25')](respondWithFilteredResult(_0x1ad1c4,_0x36c0d5))[_0x1306('0x46')](handleError(_0x1ad1c4,null));};exports[_0x1306('0x47')]=function(_0x18ff65,_0x457401){var _0x3d6f90={'raw':!![],'where':{'id':_0x18ff65[_0x1306('0x48')]['id']}},_0x31f829={};_0x31f829[_0x1306('0x30')]=_[_0x1306('0x32')](db[_0x1306('0x2d')][_0x1306('0x2e')]);_0x31f829[_0x1306('0x33')]=_['keys'](_0x18ff65['query']);_0x31f829['filters']=_['intersection'](_0x31f829[_0x1306('0x30')],_0x31f829[_0x1306('0x33')]);_0x3d6f90[_0x1306('0x37')]=_['intersection'](_0x31f829[_0x1306('0x30')],qs[_0x1306('0x36')](_0x18ff65[_0x1306('0x33')][_0x1306('0x36')]));_0x3d6f90[_0x1306('0x37')]=_0x3d6f90[_0x1306('0x37')]['length']?_0x3d6f90[_0x1306('0x37')]:_0x31f829[_0x1306('0x30')];if(_0x18ff65[_0x1306('0x33')][_0x1306('0x42')]){_0x3d6f90['include']=[{'all':!![]}];}_0x3d6f90=_[_0x1306('0x40')]({},_0x3d6f90,_0x18ff65[_0x1306('0x41')]);return db['WhatsappTransferReport'][_0x1306('0x49')](_0x3d6f90)['then'](handleEntityNotFound(_0x457401,null))['then'](respondWithResult(_0x457401,null))['catch'](handleError(_0x457401,null));};exports[_0x1306('0x4a')]=function(_0x562095,_0xc2a4a6){return db[_0x1306('0x2d')]['create'](_0x562095[_0x1306('0x4b')],{})[_0x1306('0x25')](respondWithResult(_0xc2a4a6,0xc9))['catch'](handleError(_0xc2a4a6,null));};exports['update']=function(_0x2b09f5,_0x286f6a){if(_0x2b09f5[_0x1306('0x4b')]['id']){delete _0x2b09f5[_0x1306('0x4b')]['id'];}return db['WhatsappTransferReport'][_0x1306('0x49')]({'where':{'id':_0x2b09f5[_0x1306('0x48')]['id']}})[_0x1306('0x25')](handleEntityNotFound(_0x286f6a,null))[_0x1306('0x25')](saveUpdates(_0x2b09f5[_0x1306('0x4b')],null))[_0x1306('0x25')](respondWithResult(_0x286f6a,null))['catch'](handleError(_0x286f6a,null));};exports['destroy']=function(_0x54e8aa,_0x1ec04e){return db[_0x1306('0x2d')][_0x1306('0x49')]({'where':{'id':_0x54e8aa[_0x1306('0x48')]['id']}})['then'](handleEntityNotFound(_0x1ec04e,null))[_0x1306('0x25')](removeEntity(_0x1ec04e,null))[_0x1306('0x46')](handleError(_0x1ec04e,null));};exports[_0x1306('0x4c')]=function(_0x409956,_0x145e78){return db[_0x1306('0x2d')][_0x1306('0x4c')]()[_0x1306('0x25')](respondWithResult(_0x145e78,null))['catch'](handleError(_0x145e78,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 2800da4..fae2bc9 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.model.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeb39=['exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0xeb39,0x185));var _0x9eb3=function(_0x6d6a66,_0x2924af){_0x6d6a66=_0x6d6a66-0x0;var _0x11eb6e=_0xeb39[_0x6d6a66];return _0x11eb6e;};'use strict';var _=require(_0x9eb3('0x0'));var util=require('util');var logger=require(_0x9eb3('0x1'))('api');var moment=require(_0x9eb3('0x2'));var BPromise=require(_0x9eb3('0x3'));var rp=require(_0x9eb3('0x4'));var fs=require('fs');var path=require(_0x9eb3('0x5'));var rimraf=require('rimraf');var config=require(_0x9eb3('0x6'));var attributes=require('./whatsappTransferReport.attributes');module[_0x9eb3('0x7')]=function(_0x4c4ba1,_0x220c8c){return _0x4c4ba1[_0x9eb3('0x8')](_0x9eb3('0x9'),attributes,{'tableName':_0x9eb3('0xa'),'paranoid':![],'indexes':[{'name':_0x9eb3('0xb'),'fields':[_0x9eb3('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe643=['api','bluebird','request-promise','../../config/environment','./whatsappTransferReport.attributes','exports','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xe643,0x1c1));var _0x3e64=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xe643[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x3e64('0x0'));var util=require(_0x3e64('0x1'));var logger=require('../../config/logger')(_0x3e64('0x2'));var moment=require('moment');var BPromise=require(_0x3e64('0x3'));var rp=require(_0x3e64('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3e64('0x5'));var attributes=require(_0x3e64('0x6'));module[_0x3e64('0x7')]=function(_0xffd00a,_0x39e489){return _0xffd00a['define'](_0x3e64('0x8'),attributes,{'tableName':_0x3e64('0x9'),'paranoid':![],'indexes':[{'name':_0x3e64('0xa'),'fields':[_0x3e64('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 054a169..84fc7b8 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x60cb=['ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','WhatsappTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring'];(function(_0x41877d,_0x2b4fc5){var _0x124c30=function(_0x25e664){while(--_0x25e664){_0x41877d['push'](_0x41877d['shift']());}};_0x124c30(++_0x2b4fc5);}(_0x60cb,0x179));var _0xb60c=function(_0x11e7a0,_0x4591e1){_0x11e7a0=_0x11e7a0-0x0;var _0xe6b4a2=_0x60cb[_0x11e7a0];return _0xe6b4a2;};'use strict';var _=require(_0xb60c('0x0'));var util=require(_0xb60c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb60c('0x2'));var fs=require('fs');var Redis=require(_0xb60c('0x3'));var db=require(_0xb60c('0x4'))['db'];var utils=require(_0xb60c('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb60c('0x6'));var client=jayson[_0xb60c('0x7')][_0xb60c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4fe97d,_0x880418,_0x386005){return new BPromise(function(_0x11756d,_0x2ea79d){return client[_0xb60c('0x9')](_0x4fe97d,_0x386005)[_0xb60c('0xa')](function(_0x534aa2){logger[_0xb60c('0xb')]('WhatsappTransferReport,\x20%s,\x20%s',_0x880418,_0xb60c('0xc'));logger['debug']('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x880418,'request\x20sent',JSON[_0xb60c('0xd')](_0x534aa2));if(_0x534aa2['error']){if(_0x534aa2[_0xb60c('0xe')][_0xb60c('0xf')]===0x1f4){logger['error'](_0xb60c('0x10'),_0x880418,_0x534aa2[_0xb60c('0xe')][_0xb60c('0x11')]);return _0x2ea79d(_0x534aa2[_0xb60c('0xe')][_0xb60c('0x11')]);}logger[_0xb60c('0xe')]('WhatsappTransferReport,\x20%s,\x20%s',_0x880418,_0x534aa2[_0xb60c('0xe')][_0xb60c('0x11')]);return _0x11756d(_0x534aa2[_0xb60c('0xe')]['message']);}else{logger[_0xb60c('0xb')](_0xb60c('0x10'),_0x880418,'request\x20sent');_0x11756d(_0x534aa2[_0xb60c('0x12')][_0xb60c('0x11')]);}})[_0xb60c('0x13')](function(_0x484e65){logger[_0xb60c('0xe')](_0xb60c('0x10'),_0x880418,_0x484e65);_0x2ea79d(_0x484e65);});});} \ No newline at end of file +var _0xaad2=['then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','randomstring','../../config/utils','../../config/logger','jayson/promise','request'];(function(_0xd52464,_0x18c5ab){var _0x3963d6=function(_0x105a15){while(--_0x105a15){_0xd52464['push'](_0xd52464['shift']());}};_0x3963d6(++_0x18c5ab);}(_0xaad2,0x18a));var _0x2aad=function(_0x4ac60a,_0x503a99){_0x4ac60a=_0x4ac60a-0x0;var _0x4b22e8=_0xaad2[_0x4ac60a];return _0x4b22e8;};'use strict';var _=require(_0x2aad('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2aad('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2aad('0x2'));var logger=require(_0x2aad('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2aad('0x4'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x311a03,_0x10d29f,_0x363410){return new BPromise(function(_0x36b59c,_0x42ae2c){return client[_0x2aad('0x5')](_0x311a03,_0x363410)[_0x2aad('0x6')](function(_0x3c18c2){logger[_0x2aad('0x7')](_0x2aad('0x8'),_0x10d29f,_0x2aad('0x9'));logger[_0x2aad('0xa')](_0x2aad('0xb'),_0x10d29f,_0x2aad('0x9'),JSON[_0x2aad('0xc')](_0x3c18c2));if(_0x3c18c2['error']){if(_0x3c18c2[_0x2aad('0xd')]['code']===0x1f4){logger[_0x2aad('0xd')](_0x2aad('0x8'),_0x10d29f,_0x3c18c2[_0x2aad('0xd')][_0x2aad('0xe')]);return _0x42ae2c(_0x3c18c2[_0x2aad('0xd')]['message']);}logger[_0x2aad('0xd')](_0x2aad('0x8'),_0x10d29f,_0x3c18c2['error']['message']);return _0x36b59c(_0x3c18c2[_0x2aad('0xd')][_0x2aad('0xe')]);}else{logger[_0x2aad('0x7')](_0x2aad('0x8'),_0x10d29f,_0x2aad('0x9'));_0x36b59c(_0x3c18c2[_0x2aad('0xf')]['message']);}})['catch'](function(_0x313ef3){logger[_0x2aad('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x10d29f,_0x313ef3);_0x42ae2c(_0x313ef3);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index d5f9ba6..e9b7567 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf29c=['status','name','None','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','default','then','listen','info','start','filter','exitCode','length','map','pm2_env','Online\x20apps:','online','join'];(function(_0x13302e,_0x28cbf3){var _0x4a5198=function(_0x5a5460){while(--_0x5a5460){_0x13302e['push'](_0x13302e['shift']());}};_0x4a5198(++_0x28cbf3);}(_0xf29c,0xc7));var _0xcf29=function(_0x143fcf,_0xe28e94){_0x143fcf=_0x143fcf-0x0;var _0x37d699=_0xf29c[_0x143fcf];return _0x37d699;};'use strict';var _=require('lodash');var db=require(_0xcf29('0x0'))['db'];var seedDb=require(_0xcf29('0x1'));var checkLicense=require(_0xcf29('0x2'));var rpc=require(_0xcf29('0x3'));var config=require(_0xcf29('0x4'));var logger=require(_0xcf29('0x5'))(_0xcf29('0x6'));var pm2=require(_0xcf29('0x7'));var pm2Config=require(_0xcf29('0x8'));var schedule=require(_0xcf29('0x9'));var chat=require(_0xcf29('0xa'));var whatsapp=require(_0xcf29('0xb'));var transcribe=require(_0xcf29('0xc'));var provider=require(_0xcf29('0xd'));function main(){return db[_0xcf29('0xe')][_0xcf29('0xf')]()['then'](function(){if(config['seedDB']){return seedDb[_0xcf29('0x10')]();}})[_0xcf29('0x11')](function(){return checkLicense[_0xcf29('0x10')]();})[_0xcf29('0x11')](function(){return rpc[_0xcf29('0x12')]();})[_0xcf29('0x11')](function(_0x2ed7fa){logger[_0xcf29('0x13')](_0x2ed7fa);return chat[_0xcf29('0x14')]();})[_0xcf29('0x11')](function(){return whatsapp[_0xcf29('0x14')]();})[_0xcf29('0x11')](function(){return schedule['start']();})[_0xcf29('0x11')](function(){return transcribe[_0xcf29('0x14')]();})['then'](function(){return provider[_0xcf29('0x14')]();})['then'](function(_0x381735){logger[_0xcf29('0x13')](_0x381735);return pm2[_0xcf29('0x14')](pm2Config);})[_0xcf29('0x11')](function(_0xd49096){var _0x8486f3=_0xd49096[_0xcf29('0x15')](function(_0x3bc380){return typeof _0x3bc380[_0xcf29('0x16')]==='number'&&_0x3bc380[_0xcf29('0x16')]>=0x0;});if(_0x8486f3['length']>0x0){throw new Error(_0x8486f3[_0xcf29('0x17')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0xcf29('0x18')](_0x8486f3,function(_0x51f365){return'\x22'+_0x51f365[_0xcf29('0x19')]['name']+'\x22';}));}logger[_0xcf29('0x13')](_0xcf29('0x1a'),_['map'](_[_0xcf29('0x15')](_0xd49096,{'status':_0xcf29('0x1b')}),'name')[_0xcf29('0x1c')]());logger[_0xcf29('0x13')]('Offline\x20apps:',_['map'](_['filter'](_0xd49096,function(_0x4d484c){return _0x4d484c[_0xcf29('0x1d')]!==_0xcf29('0x1b');}),_0xcf29('0x1e'))[_0xcf29('0x1c')]()||_0xcf29('0x1f'));console[_0xcf29('0x20')](_0xcf29('0x21'));})[_0xcf29('0x22')](function(_0x283c87){console[_0xcf29('0x20')](_0xcf29('0x23'),_0x283c87);logger['error'](_0xcf29('0x24'),_0x283c87);process[_0xcf29('0x25')](0x1);});}main(); \ No newline at end of file +var _0x383d=['catch','error','./config/seedDB','./config/license','./rpc','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','default','listen','info','start','filter','exitCode','number','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','online','join','Offline\x20apps:','None','App\x20Ready!'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x383d,0x86));var _0xd383=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x383d[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var db=require('./mysqldb')['db'];var seedDb=require(_0xd383('0x0'));var checkLicense=require(_0xd383('0x1'));var rpc=require(_0xd383('0x2'));var config=require('./config/environment');var logger=require(_0xd383('0x3'))(_0xd383('0x4'));var pm2=require(_0xd383('0x5'));var pm2Config=require(_0xd383('0x6'));var schedule=require(_0xd383('0x7'));var chat=require(_0xd383('0x8'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0xd383('0x9'));var provider=require(_0xd383('0xa'));function main(){return db[_0xd383('0xb')][_0xd383('0xc')]()[_0xd383('0xd')](function(){if(config['seedDB']){return seedDb['default']();}})[_0xd383('0xd')](function(){return checkLicense[_0xd383('0xe')]();})['then'](function(){return rpc[_0xd383('0xf')]();})[_0xd383('0xd')](function(_0x12547b){logger[_0xd383('0x10')](_0x12547b);return chat[_0xd383('0x11')]();})[_0xd383('0xd')](function(){return whatsapp['start']();})[_0xd383('0xd')](function(){return schedule[_0xd383('0x11')]();})[_0xd383('0xd')](function(){return transcribe[_0xd383('0x11')]();})['then'](function(){return provider[_0xd383('0x11')]();})[_0xd383('0xd')](function(_0x208d82){logger[_0xd383('0x10')](_0x208d82);return pm2['start'](pm2Config);})[_0xd383('0xd')](function(_0x58081c){var _0x2ab5e8=_0x58081c[_0xd383('0x12')](function(_0xf2dcb6){return typeof _0xf2dcb6[_0xd383('0x13')]===_0xd383('0x14')&&_0xf2dcb6[_0xd383('0x13')]>=0x0;});if(_0x2ab5e8['length']>0x0){throw new Error(_0x2ab5e8['length']+_0xd383('0x15')+_[_0xd383('0x16')](_0x2ab5e8,function(_0x8639e8){return'\x22'+_0x8639e8[_0xd383('0x17')][_0xd383('0x18')]+'\x22';}));}logger[_0xd383('0x10')](_0xd383('0x19'),_[_0xd383('0x16')](_['filter'](_0x58081c,{'status':_0xd383('0x1a')}),_0xd383('0x18'))[_0xd383('0x1b')]());logger[_0xd383('0x10')](_0xd383('0x1c'),_[_0xd383('0x16')](_['filter'](_0x58081c,function(_0x4650db){return _0x4650db['status']!==_0xd383('0x1a');}),'name')[_0xd383('0x1b')]()||_0xd383('0x1d'));console['log'](_0xd383('0x1e'));})[_0xd383('0x1f')](function(_0x23de86){console['log']('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x23de86);logger[_0xd383('0x20')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x23de86);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 d75e1de..3c7a45a 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 _0x00bb=['lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarRemoteControl','interface','userProfileId','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadAttachments','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswer','smsAutoanswerDelay','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','isChatInteractionAuthorized','use','user','findOne','params','disposition','then','closed','unmanaged','Unmanaged.','Forbidden.','catch','isAuthenticated','headers','authorization','Basic','User','find','pass','status','Wrong\x20credentials.','Bearer','json','Unknown\x20authorization\x20format','query','getUuid','apikey','sub','Setting','allowedLoginAttempts','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','add','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','webrtc','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','send','isNil','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','unshift','encryptString','join','promisify','sign','secret','options','verify','toString','hex','floor','../../mysqldb','../../config/environment','../../config/license/hardware','../encryptor','jsonwebtoken','express-jwt','basic-auth','crypto','secrets','session','role','fullname','name','internal','permissions','md5secret','voicePause','chatPause','mailPause','smsPause'];(function(_0x63d91,_0x12800e){var _0x4f7c6b=function(_0x432086){while(--_0x432086){_0x63d91['push'](_0x63d91['shift']());}};_0x4f7c6b(++_0x12800e);}(_0x00bb,0x1d8));var _0xb00b=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x00bb[_0x37bd26];return _0xe83dc4;};'use strict';var db=require(_0xb00b('0x0'))['db'];var config=require(_0xb00b('0x1'));var hardwareConf=require(_0xb00b('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0xb00b('0x3'));var _=require('lodash');var jwt=require(_0xb00b('0x4'));var expressJwt=require(_0xb00b('0x5'));var compose=require('composable-middleware');var basicAuth=require(_0xb00b('0x6'));var crypto=require(_0xb00b('0x7'));var BPromise=require('bluebird');var util=require('util');var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0xb00b('0x8')][_0xb00b('0x9')]});var userAttributes=['id',_0xb00b('0xa'),_0xb00b('0xb'),_0xb00b('0xc'),_0xb00b('0xd'),'email','userpic',_0xb00b('0xe'),_0xb00b('0xf'),_0xb00b('0x10'),_0xb00b('0x11'),_0xb00b('0x12'),'faxPause',_0xb00b('0x13'),'openchannelPause','pauseType','showWebBar',_0xb00b('0x14'),_0xb00b('0x15'),_0xb00b('0x16'),_0xb00b('0x17'),_0xb00b('0x18'),_0xb00b('0x19'),'phoneBarAutoAnswer',_0xb00b('0x1a'),_0xb00b('0x1b'),'phoneBarEnableRecording',_0xb00b('0x1c'),_0xb00b('0x1d'),'phoneBarExpires','phoneBarPrefixRequired',_0xb00b('0x1e'),'phoneBarRemoteControlPort','hotdesk',_0xb00b('0x1f'),_0xb00b('0x20'),_0xb00b('0x21'),_0xb00b('0x22'),'wssPort',_0xb00b('0x23'),'downloadOmnichannelInteractions',_0xb00b('0x24'),'ignorePauseForPreviewCalls',_0xb00b('0x25'),'chatAutoanswer',_0xb00b('0x26'),_0xb00b('0x27'),'emailAutoanswerDelay','smsAutoanswer',_0xb00b('0x28'),'openchannelAutoanswer',_0xb00b('0x29'),_0xb00b('0x2a'),_0xb00b('0x2b'),_0xb00b('0x2c'),'whatsappAutoanswerDelay'];exports[_0xb00b('0x2d')]=function(){return this['isAuthenticated'](!![])[_0xb00b('0x2e')](function(_0x121ec7,_0x51b841,_0x231293){if(_0x121ec7[_0xb00b('0x2f')]){_0x231293();}else{return db['ChatInteraction'][_0xb00b('0x30')]({'where':{'id':_0x121ec7[_0xb00b('0x31')]['id']},'attributes':['id','closed',_0xb00b('0x32')],'raw':!![]})[_0xb00b('0x33')](function(_0x3c9500){if(_0x3c9500&&_0x3c9500[_0xb00b('0x34')]){return _0x51b841['status'](_0x3c9500['disposition']===_0xb00b('0x35')?0x195:0x193)['json']({'message':_0x3c9500['disposition']==='unmanaged'?_0xb00b('0x36'):_0xb00b('0x37')});}else{_0x231293();}})[_0xb00b('0x38')](function(_0x3825af){_0x231293(_0x3825af);});}});};exports[_0xb00b('0x39')]=function isAuthenticated(_0x197379){return compose()[_0xb00b('0x2e')](function(_0x4a8d2b,_0x22c22d,_0x503c9c){var _0x450129;if(_0x4a8d2b[_0xb00b('0x3a')][_0xb00b('0x3b')]){if(_['startsWith'](_0x4a8d2b[_0xb00b('0x3a')][_0xb00b('0x3b')],_0xb00b('0x3c'))){var _0x183233=basicAuth(_0x4a8d2b);db[_0xb00b('0x3d')][_0xb00b('0x3e')]({'where':{'name':_0x183233[_0xb00b('0xc')]}})[_0xb00b('0x33')](function(_0x149c1a){if(!_0x149c1a||!_0x149c1a['authenticate'](_0x183233[_0xb00b('0x3f')])){return _0x22c22d[_0xb00b('0x40')](0x191)['json']({'message':_0xb00b('0x41')});}_0x4a8d2b[_0xb00b('0x2f')]={'id':_0x149c1a['id']};_0x503c9c();})['catch'](function(_0x456241){_0x503c9c(_0x456241);});}else if(_['startsWith'](_0x4a8d2b[_0xb00b('0x3a')][_0xb00b('0x3b')],_0xb00b('0x42'))){validateJwt(_0x4a8d2b,_0x22c22d,_0x503c9c);}else{if(_0x197379){_0x503c9c();}else{return _0x22c22d[_0xb00b('0x40')](0x193)[_0xb00b('0x43')]({'message':_0xb00b('0x44')});}}}else if(_0x4a8d2b[_0xb00b('0x45')]['apikey']){try{var _0x57e8f9={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xb00b('0x46')]()};verifyJwt(_0x4a8d2b[_0xb00b('0x45')][_0xb00b('0x47')],_0x57e8f9)[_0xb00b('0x33')](function(_0x5cfa60){return db[_0xb00b('0x3d')][_0xb00b('0x3e')]({'where':{'id':_0x5cfa60[_0xb00b('0x48')]}})[_0xb00b('0x33')](function(_0x261c80){_0x450129=_0x261c80;return db[_0xb00b('0x49')][_0xb00b('0x30')]({'where':{'id':0x1},'attributes':[_0xb00b('0x4a'),'blockDuration'],'raw':!![]});})['then'](function(_0x2ea41d){if(!_0x450129||!_['isEqual'](_0x450129[_0xb00b('0x4b')],_0x5cfa60[_0xb00b('0x4c')])){return _0x22c22d[_0xb00b('0x40')](0x191)[_0xb00b('0x43')]({'message':_0xb00b('0x4d')});}if(_0x450129[_0xb00b('0x4e')]){return _0x22c22d[_0xb00b('0x40')](0x191)['json']({'message':_0xb00b('0x4f')});}if(_0x450129[_0xb00b('0x50')]){if(_0x2ea41d[_0xb00b('0x51')]>0x0){if(moment(_0x450129[_0xb00b('0x52')])[_0xb00b('0x53')](_0x2ea41d[_0xb00b('0x51')],'minutes')>moment()){return _0x22c22d[_0xb00b('0x40')](0x191)[_0xb00b('0x43')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x22c22d[_0xb00b('0x40')](0x191)[_0xb00b('0x43')]({'message':_0xb00b('0x4f')});}}_0x4a8d2b[_0xb00b('0x2f')]={'id':_0x450129['id']};_0x503c9c();});})[_0xb00b('0x38')](function(){return _0x22c22d['status'](0x191)[_0xb00b('0x43')]({'message':_0xb00b('0x4f')});});}catch(_0xb76ede){_0x503c9c(_0xb76ede);}}else if(_0x197379){_0x503c9c();}else{return _0x22c22d[_0xb00b('0x40')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}})[_0xb00b('0x2e')](function(_0xf6ae0c,_0x10a348,_0x152437){if(_0xf6ae0c[_0xb00b('0x2f')]){db[_0xb00b('0x3d')][_0xb00b('0x3e')]({'where':{'id':_0xf6ae0c['user']['id']},'attributes':userAttributes})[_0xb00b('0x33')](function(_0x3b72c4){if(!_0x3b72c4){return _0x10a348[_0xb00b('0x40')](0x194)[_0xb00b('0x43')]({'message':_0xb00b('0x54')});}_0xf6ae0c[_0xb00b('0x2f')]=_0x3b72c4;_0x152437();})[_0xb00b('0x38')](function(_0x974a29){_0x152437(_0x974a29);});}else if(_0x197379){_0x152437();}else{return _0x10a348[_0xb00b('0x40')](0x194)[_0xb00b('0x43')]({'message':_0xb00b('0x55')});}});};exports[_0xb00b('0x56')]=function canUpdate(){return compose()['use'](function(_0x3da23c,_0x35a0ba,_0xd07fb8){return licenseUtil[_0xb00b('0x57')]()[_0xb00b('0x33')](function(_0x2d9174){if(_0x2d9174[_0xb00b('0x58')]){_0xd07fb8();}else{return _0x35a0ba[_0xb00b('0x40')](0x193)[_0xb00b('0x43')]({'message':_0xb00b('0x59')});}})[_0xb00b('0x38')](function(_0x3b3031){_0xd07fb8(_0x3b3031);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()['use'](function(_0x47c6c0,_0x3f8f60,_0x23d858){return licenseUtil['getLicense']()[_0xb00b('0x33')](function(_0x3c0fa){if(_0x3c0fa[_0xb00b('0x5a')]){_0x23d858();}else{return _0x3f8f60[_0xb00b('0x40')](0x193)['json']({'message':'Forbidden'});}})[_0xb00b('0x38')](function(_0x40c2fd){_0x23d858(_0x40c2fd);});});};exports['isMiddleware']=function(_0x514c5b,_0x154759,_0x3a205d){_0x514c5b['isMiddleware']=!![];return _0x3a205d();};exports[_0xb00b('0x5b')]=function signToken(_0x47a814){return signJwt(_0x47a814);};exports['setTokenCookie']=function(_0x4bcc9e,_0x465d90){if(!_0x4bcc9e['user']){return _0x465d90[_0xb00b('0x40')](0x194)[_0xb00b('0x43')]({'message':_0xb00b('0x5c')});}var _0xe724a5={'payload':{'id':_0x4bcc9e[_0xb00b('0x2f')]['id'],'role':_0x4bcc9e[_0xb00b('0x2f')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0xe724a5)['then'](function(_0x1d2a0d){_0x465d90[_0xb00b('0x5d')]('motion.token',_0x1d2a0d);_0x465d90[_0xb00b('0x5e')](_0xb00b('0x5f'));})['catch'](function(_0x15dcbf){return _0x465d90[_0xb00b('0x40')](0x1f4)[_0xb00b('0x60')](_0x15dcbf);});};exports['retrieveApiKey']=function(_0x501cbe){if(_[_0xb00b('0x61')](_0x501cbe[_0xb00b('0x4b')])||_[_0xb00b('0x61')](_0x501cbe[_0xb00b('0x62')])){return null;}else{return createJwt(_0x501cbe);}};exports['generateApiKey']=function(_0x380acb){_0x380acb[_0xb00b('0x4b')]=generateNonce();_0x380acb['apiKeyIat']=generateIssuedAt();return createJwt(_0x380acb);};exports['regenerateApiKey']=function(_0x160965,_0x524b05){var _0x1ab196=_0x160965[_0xb00b('0x45')][_0xb00b('0x47')];if(_0x1ab196){var _0x222459={'nonce':_0x524b05[_0xb00b('0x4b')],'iat':_0x524b05[_0xb00b('0x62')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xb00b('0x46')]()};return verifyJwt(_0x1ab196,_0x222459)['then'](function(){return generateApiKey(_0x524b05);});}else{throw{'message':_0xb00b('0x63')};}};exports[_0xb00b('0x64')]=function(_0x4129ba){var _0x5ac79e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x5ac79e[_0xb00b('0x65')](_0x4129ba))throw new db[(_0xb00b('0x66'))][(_0xb00b('0x67'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0xb00b('0x68')]=function(_0x309ae6,_0x219b74,_0x385029){var _0x131848=encryptor[_0xb00b('0x69')](_0x219b74)[_0xb00b('0x6a')](',');for(var _0x3a0b90=0x0;_0x3a0b90<_0x385029;_0x3a0b90++){if(!_0x131848[_0x3a0b90])break;if(_0x309ae6['toLowerCase']()===_0x131848[_0x3a0b90][_0xb00b('0x6b')]()){var _0x2cbe80=util[_0xb00b('0x6c')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x385029);if(_0x385029===0x1){_0x2cbe80=_0xb00b('0x6d');}throw new db[(_0xb00b('0x66'))][(_0xb00b('0x67'))](_0x2cbe80);}}return;};exports[_0xb00b('0x6e')]=function(_0x1ad387,_0x4bfe0b){var _0xfd4ecc=_0x4bfe0b?encryptor[_0xb00b('0x69')](_0x4bfe0b)[_0xb00b('0x6a')](','):[];if(_0xfd4ecc[_0xb00b('0x6f')]===0x5){_0xfd4ecc['splice'](-0x1,0x1);}_0xfd4ecc[_0xb00b('0x70')](_0x1ad387);return encryptor[_0xb00b('0x71')](_0xfd4ecc[_0xb00b('0x72')](','));};function signJwt(_0x2d73bb){var _0x161216=BPromise[_0xb00b('0x73')](jwt[_0xb00b('0x74')],{'context':jwt});var _0x542223=_0x2d73bb[_0xb00b('0x75')]||config['secrets'][_0xb00b('0x9')];return new BPromise(function(_0x4c2186,_0x3b3272){_0x161216(_0x2d73bb['payload'],_0x542223,_0x2d73bb[_0xb00b('0x76')])['then'](function(_0x3dffaf){_0x4c2186(_0x3dffaf);})[_0xb00b('0x38')](function(_0x3bae02){_0x3b3272(_0x3bae02);});});}function verifyJwt(_0x4d1cec,_0x51fbe2,_0x4f7a59){var _0x21a53d=BPromise[_0xb00b('0x73')](jwt[_0xb00b('0x77')],{'context':jwt});var _0x49246b=_0x4f7a59||config[_0xb00b('0x8')][_0xb00b('0x9')];return new BPromise(function(_0xca87d4,_0x2ddba4){_0x21a53d(_0x4d1cec,_0x49246b,_0x51fbe2)[_0xb00b('0x33')](function(_0x485033){_0xca87d4(_0x485033);})[_0xb00b('0x38')](function(_0x27b13b){_0x2ddba4(_0x27b13b);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xb00b('0x78')](_0xb00b('0x79'));}function generateIssuedAt(){return Math[_0xb00b('0x7a')](Date['now']()/0x3e8)['toString']();}function createJwt(_0x359669){var _0x188da7={'payload':{'iat':_0x359669[_0xb00b('0x62')],'nonce':_0x359669['apiKeyNonce']},'options':{'algorithm':'HS512','subject':_0x359669['id']['toString'](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xb00b('0x46')]()}};return signJwt(_0x188da7)['then'](function(_0x2434a0){return{'iat':_0x359669[_0xb00b('0x62')],'nonce':_0x359669['apiKeyNonce'],'token':_0x2434a0};});} \ No newline at end of file +var _0x34e8=['validatePasswordPattern','test','Sequelize','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','length','splice','unshift','encryptString','join','promisify','sign','secret','secrets','payload','options','verify','toString','hex','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','moment','session','role','fullname','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastPauseAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswerDelay','faxAutoanswer','whatsappAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','user','ChatInteraction','params','closed','disposition','unmanaged','Unmanaged.','Forbidden.','catch','authorization','startsWith','headers','Basic','User','find','pass','status','json','Wrong\x20credentials.','Unknown\x20authorization\x20format','query','getUuid','then','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blockedAt','minutes','User\x20not\x20found.','canUpdate','use','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','/dashboards/general','send','isNil','apiKeyNonce','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'];(function(_0x482ac8,_0x2f437b){var _0x3b362f=function(_0x4437ec){while(--_0x4437ec){_0x482ac8['push'](_0x482ac8['shift']());}};_0x3b362f(++_0x2f437b);}(_0x34e8,0x12c));var _0x834e=function(_0x446532,_0x2448d8){_0x446532=_0x446532-0x0;var _0x167447=_0x34e8[_0x446532];return _0x167447;};'use strict';var db=require(_0x834e('0x0'))['db'];var config=require(_0x834e('0x1'));var hardwareConf=require(_0x834e('0x2'));var licenseUtil=require(_0x834e('0x3'));var encryptor=require('../encryptor');var _=require(_0x834e('0x4'));var jwt=require(_0x834e('0x5'));var expressJwt=require(_0x834e('0x6'));var compose=require(_0x834e('0x7'));var basicAuth=require(_0x834e('0x8'));var crypto=require(_0x834e('0x9'));var BPromise=require(_0x834e('0xa'));var util=require('util');var moment=require(_0x834e('0xb'));var validateJwt=expressJwt({'secret':config['secrets'][_0x834e('0xc')]});var userAttributes=['id',_0x834e('0xd'),_0x834e('0xe'),_0x834e('0xf'),_0x834e('0x10'),_0x834e('0x11'),_0x834e('0x12'),_0x834e('0x13'),_0x834e('0x14'),_0x834e('0x15'),_0x834e('0x16'),_0x834e('0x17'),_0x834e('0x18'),_0x834e('0x19'),_0x834e('0x1a'),_0x834e('0x1b'),_0x834e('0x1c'),'lastLoginAt',_0x834e('0x1d'),_0x834e('0x1e'),'allowmessenger',_0x834e('0x1f'),_0x834e('0x20'),_0x834e('0x21'),_0x834e('0x22'),'phoneBarDnd',_0x834e('0x23'),_0x834e('0x24'),'phoneBarEnableSettings',_0x834e('0x25'),'phoneBarPrefixRequired',_0x834e('0x26'),_0x834e('0x27'),'hotdesk',_0x834e('0x28'),_0x834e('0x29'),_0x834e('0x2a'),'settingsEnabled',_0x834e('0x2b'),_0x834e('0x2c'),_0x834e('0x2d'),_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x30'),_0x834e('0x31'),'chatAutoanswerDelay',_0x834e('0x32'),_0x834e('0x33'),_0x834e('0x34'),_0x834e('0x35'),'openchannelAutoanswer',_0x834e('0x36'),_0x834e('0x37'),'faxAutoanswerDelay',_0x834e('0x38'),_0x834e('0x39')];exports[_0x834e('0x3a')]=function(){return this['isAuthenticated'](!![])['use'](function(_0x231619,_0x34563b,_0x589dde){if(_0x231619[_0x834e('0x3b')]){_0x589dde();}else{return db[_0x834e('0x3c')]['findOne']({'where':{'id':_0x231619[_0x834e('0x3d')]['id']},'attributes':['id',_0x834e('0x3e'),_0x834e('0x3f')],'raw':!![]})['then'](function(_0x24fcf7){if(_0x24fcf7&&_0x24fcf7[_0x834e('0x3e')]){return _0x34563b['status'](_0x24fcf7['disposition']===_0x834e('0x40')?0x195:0x193)['json']({'message':_0x24fcf7[_0x834e('0x3f')]===_0x834e('0x40')?_0x834e('0x41'):_0x834e('0x42')});}else{_0x589dde();}})[_0x834e('0x43')](function(_0x130cc5){_0x589dde(_0x130cc5);});}});};exports['isAuthenticated']=function isAuthenticated(_0x510780){return compose()['use'](function(_0x58c1d7,_0x2c7a8d,_0x567cea){var _0x106d6a;if(_0x58c1d7['headers'][_0x834e('0x44')]){if(_[_0x834e('0x45')](_0x58c1d7[_0x834e('0x46')][_0x834e('0x44')],_0x834e('0x47'))){var _0x390119=basicAuth(_0x58c1d7);db[_0x834e('0x48')][_0x834e('0x49')]({'where':{'name':_0x390119[_0x834e('0xf')]}})['then'](function(_0xef9ec2){if(!_0xef9ec2||!_0xef9ec2['authenticate'](_0x390119[_0x834e('0x4a')])){return _0x2c7a8d[_0x834e('0x4b')](0x191)[_0x834e('0x4c')]({'message':_0x834e('0x4d')});}_0x58c1d7[_0x834e('0x3b')]={'id':_0xef9ec2['id']};_0x567cea();})[_0x834e('0x43')](function(_0x4696a1){_0x567cea(_0x4696a1);});}else if(_[_0x834e('0x45')](_0x58c1d7[_0x834e('0x46')][_0x834e('0x44')],'Bearer')){validateJwt(_0x58c1d7,_0x2c7a8d,_0x567cea);}else{if(_0x510780){_0x567cea();}else{return _0x2c7a8d[_0x834e('0x4b')](0x193)[_0x834e('0x4c')]({'message':_0x834e('0x4e')});}}}else if(_0x58c1d7[_0x834e('0x4f')]['apikey']){try{var _0x3f88ad={'audience':hardwareConf[_0x834e('0x50')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x58c1d7['query']['apikey'],_0x3f88ad)[_0x834e('0x51')](function(_0x41bf4d){return db[_0x834e('0x48')][_0x834e('0x49')]({'where':{'id':_0x41bf4d[_0x834e('0x52')]}})[_0x834e('0x51')](function(_0x4c2ef6){_0x106d6a=_0x4c2ef6;return db[_0x834e('0x53')]['findOne']({'where':{'id':0x1},'attributes':[_0x834e('0x54'),_0x834e('0x55')],'raw':!![]});})['then'](function(_0x18ac3b){if(!_0x106d6a||!_[_0x834e('0x56')](_0x106d6a['apiKeyNonce'],_0x41bf4d['nonce'])){return _0x2c7a8d[_0x834e('0x4b')](0x191)[_0x834e('0x4c')]({'message':_0x834e('0x57')});}if(_0x106d6a[_0x834e('0x58')]){return _0x2c7a8d[_0x834e('0x4b')](0x191)['json']({'message':_0x834e('0x59')});}if(_0x106d6a['blocked']){if(_0x18ac3b['blockDuration']>0x0){if(moment(_0x106d6a[_0x834e('0x5a')])['add'](_0x18ac3b[_0x834e('0x55')],_0x834e('0x5b'))>moment()){return _0x2c7a8d[_0x834e('0x4b')](0x191)[_0x834e('0x4c')]({'message':_0x834e('0x59')});}}else{return _0x2c7a8d['status'](0x191)[_0x834e('0x4c')]({'message':_0x834e('0x59')});}}_0x58c1d7[_0x834e('0x3b')]={'id':_0x106d6a['id']};_0x567cea();});})['catch'](function(){return _0x2c7a8d[_0x834e('0x4b')](0x191)[_0x834e('0x4c')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x1e3e71){_0x567cea(_0x1e3e71);}}else if(_0x510780){_0x567cea();}else{return _0x2c7a8d['status'](0x193)[_0x834e('0x4c')]({'message':_0x834e('0x4e')});}})['use'](function(_0x4a6942,_0x22ea21,_0x16969b){if(_0x4a6942[_0x834e('0x3b')]){db[_0x834e('0x48')][_0x834e('0x49')]({'where':{'id':_0x4a6942[_0x834e('0x3b')]['id']},'attributes':userAttributes})[_0x834e('0x51')](function(_0x4a3381){if(!_0x4a3381){return _0x22ea21[_0x834e('0x4b')](0x194)['json']({'message':_0x834e('0x5c')});}_0x4a6942['user']=_0x4a3381;_0x16969b();})[_0x834e('0x43')](function(_0x5a5807){_0x16969b(_0x5a5807);});}else if(_0x510780){_0x16969b();}else{return _0x22ea21[_0x834e('0x4b')](0x194)[_0x834e('0x4c')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x834e('0x5d')]=function canUpdate(){return compose()[_0x834e('0x5e')](function(_0xa880cb,_0xd55cc3,_0x252ea0){return licenseUtil[_0x834e('0x5f')]()[_0x834e('0x51')](function(_0x3ccd8e){if(_0x3ccd8e[_0x834e('0x60')]){_0x252ea0();}else{return _0xd55cc3[_0x834e('0x4b')](0x193)['json']({'message':_0x834e('0x61')});}})[_0x834e('0x43')](function(_0x47a8a9){_0x252ea0(_0x47a8a9);});});};exports[_0x834e('0x62')]=function isWebrtcLicence(){return compose()[_0x834e('0x5e')](function(_0x25b035,_0x2112d5,_0x19b5ef){return licenseUtil[_0x834e('0x5f')]()['then'](function(_0x59c855){if(_0x59c855[_0x834e('0x63')]){_0x19b5ef();}else{return _0x2112d5[_0x834e('0x4b')](0x193)[_0x834e('0x4c')]({'message':_0x834e('0x61')});}})[_0x834e('0x43')](function(_0xd1d83b){_0x19b5ef(_0xd1d83b);});});};exports[_0x834e('0x64')]=function(_0x43f599,_0x1419eb,_0x390c45){_0x43f599[_0x834e('0x64')]=!![];return _0x390c45();};exports[_0x834e('0x65')]=function signToken(_0x1a28f6){return signJwt(_0x1a28f6);};exports[_0x834e('0x66')]=function(_0x2aa072,_0x1a3855){if(!_0x2aa072[_0x834e('0x3b')]){return _0x1a3855[_0x834e('0x4b')](0x194)[_0x834e('0x4c')]({'message':_0x834e('0x67')});}var _0x4cfacd={'payload':{'id':_0x2aa072[_0x834e('0x3b')]['id'],'role':_0x2aa072[_0x834e('0x3b')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x4cfacd)[_0x834e('0x51')](function(_0x3b0988){_0x1a3855['cookie'](_0x834e('0x68'),_0x3b0988);_0x1a3855[_0x834e('0x69')](_0x834e('0x6a'));})[_0x834e('0x43')](function(_0x4288e4){return _0x1a3855[_0x834e('0x4b')](0x1f4)[_0x834e('0x6b')](_0x4288e4);});};exports['retrieveApiKey']=function(_0x1ad7fe){if(_[_0x834e('0x6c')](_0x1ad7fe[_0x834e('0x6d')])||_[_0x834e('0x6c')](_0x1ad7fe[_0x834e('0x6e')])){return null;}else{return createJwt(_0x1ad7fe);}};exports[_0x834e('0x6f')]=function(_0x344b51){_0x344b51[_0x834e('0x6d')]=generateNonce();_0x344b51['apiKeyIat']=generateIssuedAt();return createJwt(_0x344b51);};exports[_0x834e('0x70')]=function(_0x4dc104,_0x2f4bde){var _0x53a9ee=_0x4dc104[_0x834e('0x4f')]['apikey'];if(_0x53a9ee){var _0x527eef={'nonce':_0x2f4bde[_0x834e('0x6d')],'iat':_0x2f4bde[_0x834e('0x6e')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x53a9ee,_0x527eef)[_0x834e('0x51')](function(){return generateApiKey(_0x2f4bde);});}else{throw{'message':_0x834e('0x71')};}};exports[_0x834e('0x72')]=function(_0x387365){var _0x21c417=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x21c417[_0x834e('0x73')](_0x387365))throw new db[(_0x834e('0x74'))][(_0x834e('0x75'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0x834e('0x76')]=function(_0x3c70bf,_0x5d5ac2,_0x281342){var _0x4e2b22=encryptor[_0x834e('0x77')](_0x5d5ac2)[_0x834e('0x78')](',');for(var _0x5160c4=0x0;_0x5160c4<_0x281342;_0x5160c4++){if(!_0x4e2b22[_0x5160c4])break;if(_0x3c70bf[_0x834e('0x79')]()===_0x4e2b22[_0x5160c4][_0x834e('0x79')]()){var _0x2de29a=util[_0x834e('0x7a')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x281342);if(_0x281342===0x1){_0x2de29a=_0x834e('0x7b');}throw new db[(_0x834e('0x74'))][(_0x834e('0x75'))](_0x2de29a);}}return;};exports['updatePasswordsHistory']=function(_0x246b8e,_0x1fcae9){var _0x3a7683=_0x1fcae9?encryptor[_0x834e('0x77')](_0x1fcae9)[_0x834e('0x78')](','):[];if(_0x3a7683[_0x834e('0x7c')]===0x5){_0x3a7683[_0x834e('0x7d')](-0x1,0x1);}_0x3a7683[_0x834e('0x7e')](_0x246b8e);return encryptor[_0x834e('0x7f')](_0x3a7683[_0x834e('0x80')](','));};function signJwt(_0x1e4310){var _0x1dfa95=BPromise[_0x834e('0x81')](jwt[_0x834e('0x82')],{'context':jwt});var _0x460a7a=_0x1e4310[_0x834e('0x83')]||config[_0x834e('0x84')][_0x834e('0xc')];return new BPromise(function(_0x193a15,_0x3e3467){_0x1dfa95(_0x1e4310[_0x834e('0x85')],_0x460a7a,_0x1e4310[_0x834e('0x86')])['then'](function(_0x2145cf){_0x193a15(_0x2145cf);})[_0x834e('0x43')](function(_0x45bcc2){_0x3e3467(_0x45bcc2);});});}function verifyJwt(_0x36cc14,_0x4ca099,_0x30faa8){var _0x5a9c70=BPromise['promisify'](jwt[_0x834e('0x87')],{'context':jwt});var _0x2b1ec7=_0x30faa8||config[_0x834e('0x84')][_0x834e('0xc')];return new BPromise(function(_0x216105,_0x3821ad){_0x5a9c70(_0x36cc14,_0x2b1ec7,_0x4ca099)[_0x834e('0x51')](function(_0xe5c8f6){_0x216105(_0xe5c8f6);})['catch'](function(_0xdef8c4){_0x3821ad(_0xdef8c4);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x834e('0x88')](_0x834e('0x89'));}function generateIssuedAt(){return Math['floor'](Date['now']()/0x3e8)[_0x834e('0x88')]();}function createJwt(_0x82f2a7){var _0x363cc2={'payload':{'iat':_0x82f2a7[_0x834e('0x6e')],'nonce':_0x82f2a7[_0x834e('0x6d')]},'options':{'algorithm':'HS512','subject':_0x82f2a7['id'][_0x834e('0x88')](),'issuer':hardwareConf[_0x834e('0x50')](),'audience':hardwareConf[_0x834e('0x50')]()}};return signJwt(_0x363cc2)[_0x834e('0x51')](function(_0x3181af){return{'iat':_0x82f2a7[_0x834e('0x6e')],'nonce':_0x82f2a7[_0x834e('0x6d')],'token':_0x3181af};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index ef7e59e..608f09f 100644 --- a/server/components/contacts/index.js +++ b/server/components/contacts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['rows','catch','keys','filter','startsWith','cf_','map','CmCustomField','findOne','slice','length','fieldType','type','lodash','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','parseQueryParameters','where','fields','user','clause','tags','skip','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts'];(function(_0x17654c,_0x355069){var _0x51c124=function(_0x3e0971){while(--_0x3e0971){_0x17654c['push'](_0x17654c['shift']());}};_0x51c124(++_0x355069);}(_0x5f2f,0x73));var _0xf5f2=function(_0x27ab89,_0x527f6){_0x27ab89=_0x27ab89-0x0;var _0x5e63cc=_0x5f2f[_0x27ab89];return _0x5e63cc;};'use strict';var _=require(_0xf5f2('0x0'));var sqlUtils=require(_0xf5f2('0x1'));var db=require(_0xf5f2('0x2'))['db'];exports[_0xf5f2('0x3')]=function(_0x1172dd,_0x174bc7,_0x3c72ee,_0x107cf){var _0x501fbd={'count':0x0,'rows':[]};var _0x4854b6=sqlUtils[_0xf5f2('0x4')](_0x174bc7,_0x1172dd);if(_0x4854b6){return Promise[_0xf5f2('0x5')](_0x501fbd);}var _0xad7f65=sqlUtils[_0xf5f2('0x6')]();var _0x3133bc={};var _0x473100=![];var _0x5907aa=![];return Promise[_0xf5f2('0x5')]()[_0xf5f2('0x7')](function(){if(_0x1172dd[_0xf5f2('0x8')]){return sqlUtils['parseAdvancedSearchFilter'](_0x1172dd[_0xf5f2('0x8')],_0x107cf);}else{return sqlUtils[_0xf5f2('0x9')](_0x1172dd,_0x107cf);}})[_0xf5f2('0x7')](function(_0x4e0e6b){_0xad7f65[_0xf5f2('0xa')](_0x4e0e6b['default']);_0xad7f65['where'](_0x4e0e6b[_0xf5f2('0xb')]);_0xad7f65[_0xf5f2('0xa')](_0x4e0e6b['filter']);_0xad7f65[_0xf5f2('0xa')](_0x4e0e6b[_0xf5f2('0xc')][_0xf5f2('0xd')]);_0x3133bc=_0x4e0e6b[_0xf5f2('0xe')];_0x5907aa=_0x4e0e6b[_0xf5f2('0xc')][_0xf5f2('0xf')];return sqlUtils['checkListsRestrictions'](_0x174bc7,_0x1172dd,_0x5907aa);})[_0xf5f2('0x7')](function(_0xea612c){_0xad7f65[_0xf5f2('0xa')](_0xea612c);var _0x1c1a5c=_0x1172dd[_0xf5f2('0x8')]?_0x3133bc['ids']:_0x1172dd[_0xf5f2('0x10')];_0x473100=_0x1c1a5c?!![]:![];return sqlUtils[_0xf5f2('0x11')](_0xad7f65,_0x1c1a5c);})[_0xf5f2('0x7')](function(_0x1b6dd2){_0x501fbd[_0xf5f2('0x12')]=_0x1b6dd2;if(_0x501fbd[_0xf5f2('0x12')]===0x0){return;}return sqlUtils[_0xf5f2('0x13')](_0xad7f65,_0x1172dd[_0xf5f2('0xb')],_0x3c72ee,_0x473100,_0x3133bc[_0xf5f2('0xd')],_0x5907aa);})[_0xf5f2('0x7')](function(_0x20fccd){if(!_0x20fccd){return[];}return sqlUtils[_0xf5f2('0x14')](_0x20fccd,_0x1172dd,_0x3c72ee);})[_0xf5f2('0x7')](function(_0x3ee69){_0x501fbd[_0xf5f2('0x15')]=_0x3ee69;return _0x501fbd;})[_0xf5f2('0x16')](function(_0x1bf655){throw _0x1bf655;});};exports['describe']=function(){var _0x34706d={};var _0x47101e=[];return db['CmContact']['describe']()[_0xf5f2('0x7')](function(_0x388e6c){_0x34706d=_0x388e6c;var _0x4ae323=Object[_0xf5f2('0x17')](_0x34706d)[_0xf5f2('0x18')](function(_0x39e44a){return _[_0xf5f2('0x19')](_0x39e44a,_0xf5f2('0x1a'))?_0x39e44a:undefined;});var _0x4c691a=_0x4ae323[_0xf5f2('0x1b')](function(_0x4669a6){return db[_0xf5f2('0x1c')][_0xf5f2('0x1d')]({'where':{'id':_0x4669a6[_0xf5f2('0x1e')](0x3)},'raw':!![]});});return Promise['all'](_0x4c691a);})['then'](function(_0x5f1124){for(var _0x3f79d5=0x0;_0x3f79d5<_0x5f1124[_0xf5f2('0x1f')];_0x3f79d5++){if(_0x5f1124[_0x3f79d5]){var _0x1a5bb3=_0xf5f2('0x1a')+_0x5f1124[_0x3f79d5]['id'];_0x34706d[_0x1a5bb3][_0xf5f2('0x20')]=_0x5f1124[_0x3f79d5][_0xf5f2('0x21')];}}_0x47101e=_[_0xf5f2('0x1b')](Object[_0xf5f2('0x17')](_0x34706d),function(_0x4ab014){return{'name':_0x4ab014,'type':_0x34706d[_0x4ab014][_0xf5f2('0x21')]};});return _0x47101e;})[_0xf5f2('0x16')](function(_0x375ca8){throw _0x375ca8;});}; \ No newline at end of file +var _0x5f2f=['rows','catch','keys','filter','startsWith','cf_','map','CmCustomField','findOne','slice','length','fieldType','type','lodash','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','parseQueryParameters','where','fields','user','clause','tags','skip','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts'];(function(_0x127b1b,_0x39772c){var _0x1f10b9=function(_0x381326){while(--_0x381326){_0x127b1b['push'](_0x127b1b['shift']());}};_0x1f10b9(++_0x39772c);}(_0x5f2f,0x73));var _0xf5f2=function(_0x275f6f,_0x203a6c){_0x275f6f=_0x275f6f-0x0;var _0xea018e=_0x5f2f[_0x275f6f];return _0xea018e;};'use strict';var _=require(_0xf5f2('0x0'));var sqlUtils=require(_0xf5f2('0x1'));var db=require(_0xf5f2('0x2'))['db'];exports[_0xf5f2('0x3')]=function(_0x1172dd,_0x174bc7,_0x3c72ee,_0x107cf){var _0x501fbd={'count':0x0,'rows':[]};var _0x4854b6=sqlUtils[_0xf5f2('0x4')](_0x174bc7,_0x1172dd);if(_0x4854b6){return Promise[_0xf5f2('0x5')](_0x501fbd);}var _0xad7f65=sqlUtils[_0xf5f2('0x6')]();var _0x3133bc={};var _0x473100=![];var _0x5907aa=![];return Promise[_0xf5f2('0x5')]()[_0xf5f2('0x7')](function(){if(_0x1172dd[_0xf5f2('0x8')]){return sqlUtils['parseAdvancedSearchFilter'](_0x1172dd[_0xf5f2('0x8')],_0x107cf);}else{return sqlUtils[_0xf5f2('0x9')](_0x1172dd,_0x107cf);}})[_0xf5f2('0x7')](function(_0x4e0e6b){_0xad7f65[_0xf5f2('0xa')](_0x4e0e6b['default']);_0xad7f65['where'](_0x4e0e6b[_0xf5f2('0xb')]);_0xad7f65[_0xf5f2('0xa')](_0x4e0e6b['filter']);_0xad7f65[_0xf5f2('0xa')](_0x4e0e6b[_0xf5f2('0xc')][_0xf5f2('0xd')]);_0x3133bc=_0x4e0e6b[_0xf5f2('0xe')];_0x5907aa=_0x4e0e6b[_0xf5f2('0xc')][_0xf5f2('0xf')];return sqlUtils['checkListsRestrictions'](_0x174bc7,_0x1172dd,_0x5907aa);})[_0xf5f2('0x7')](function(_0xea612c){_0xad7f65[_0xf5f2('0xa')](_0xea612c);var _0x1c1a5c=_0x1172dd[_0xf5f2('0x8')]?_0x3133bc['ids']:_0x1172dd[_0xf5f2('0x10')];_0x473100=_0x1c1a5c?!![]:![];return sqlUtils[_0xf5f2('0x11')](_0xad7f65,_0x1c1a5c);})[_0xf5f2('0x7')](function(_0x1b6dd2){_0x501fbd[_0xf5f2('0x12')]=_0x1b6dd2;if(_0x501fbd[_0xf5f2('0x12')]===0x0){return;}return sqlUtils[_0xf5f2('0x13')](_0xad7f65,_0x1172dd[_0xf5f2('0xb')],_0x3c72ee,_0x473100,_0x3133bc[_0xf5f2('0xd')],_0x5907aa);})[_0xf5f2('0x7')](function(_0x20fccd){if(!_0x20fccd){return[];}return sqlUtils[_0xf5f2('0x14')](_0x20fccd,_0x1172dd,_0x3c72ee);})[_0xf5f2('0x7')](function(_0x3ee69){_0x501fbd[_0xf5f2('0x15')]=_0x3ee69;return _0x501fbd;})[_0xf5f2('0x16')](function(_0x1bf655){throw _0x1bf655;});};exports['describe']=function(){var _0x34706d={};var _0x47101e=[];return db['CmContact']['describe']()[_0xf5f2('0x7')](function(_0x388e6c){_0x34706d=_0x388e6c;var _0x4ae323=Object[_0xf5f2('0x17')](_0x34706d)[_0xf5f2('0x18')](function(_0x39e44a){return _[_0xf5f2('0x19')](_0x39e44a,_0xf5f2('0x1a'))?_0x39e44a:undefined;});var _0x4c691a=_0x4ae323[_0xf5f2('0x1b')](function(_0x4669a6){return db[_0xf5f2('0x1c')][_0xf5f2('0x1d')]({'where':{'id':_0x4669a6[_0xf5f2('0x1e')](0x3)},'raw':!![]});});return Promise['all'](_0x4c691a);})['then'](function(_0x5f1124){for(var _0x3f79d5=0x0;_0x3f79d5<_0x5f1124[_0xf5f2('0x1f')];_0x3f79d5++){if(_0x5f1124[_0x3f79d5]){var _0x1a5bb3=_0xf5f2('0x1a')+_0x5f1124[_0x3f79d5]['id'];_0x34706d[_0x1a5bb3][_0xf5f2('0x20')]=_0x5f1124[_0x3f79d5][_0xf5f2('0x21')];}}_0x47101e=_[_0xf5f2('0x1b')](Object[_0xf5f2('0x17')](_0x34706d),function(_0x4ab014){return{'name':_0x4ab014,'type':_0x34706d[_0x4ab014][_0xf5f2('0x21')]};});return _0x47101e;})[_0xf5f2('0x16')](function(_0x375ca8){throw _0x375ca8;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index f107d56..0723428 100644 --- a/server/components/contacts/sql-utils.js +++ b/server/components/contacts/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe6fc=['replace','split','length','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','dateOfBirth','fieldType','datetime','castTo','DATE','type','text','value','end','Tag','tags','clause','and','ids','uc.UserId\x20=\x20?','user','map','compact','Contact','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','resolve','then','fields','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','attributes','group','c.id','limit','offset','having','order','DESC','subqry.','color','keyBy','Sequelize','QueryTypes','query','Tags','TagIds','clone','COUNT(*)','isEmpty','where','SELECT','toString','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','role','agent','search','ListId','autocomplete','true','select','from','cm_contacts','c.deletedAt\x20IS\x20NULL','subqry','.id','left_join','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','firstName','lastName','mobile','fax','email','CompanyId','createdAt','updatedAt','deletedAt','includes','push','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe6fc,0x1e2));var _0xce6f=function(_0x5a145f,_0x57d031){_0x5a145f=_0x5a145f-0x0;var _0x3580a1=_0xe6fc[_0x5a145f];return _0x3580a1;};'use strict';var _=require(_0xce6f('0x0'));var squel=require(_0xce6f('0x1'));var as=require(_0xce6f('0x2'));var qs=require(_0xce6f('0x3'));var utils=require(_0xce6f('0x4'));var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x5132d1,_0x48adeb){var _0x326787=![];if(_0x5132d1[_0xce6f('0x5')]===_0xce6f('0x6')&&!_0x48adeb[_0xce6f('0x7')]&&!_0x48adeb[_0xce6f('0x8')]&&_0x48adeb[_0xce6f('0x9')]!==_0xce6f('0xa')){_0x326787=!![];}return _0x326787;}function getContactsSubquery(){return squel[_0xce6f('0xb')]()[_0xce6f('0xc')](_0xce6f('0xd'),'c')['where'](_0xce6f('0xe'));}function applyJoinClauses(_0x48c573,_0x1334dd){var _0xf00a10=_0x1334dd?'c':_0xce6f('0xf');_0x48c573['left_join']('cm_user_has_contacts','uc','uc.CmContactId\x20=\x20'+_0xf00a10+_0xce6f('0x10'))[_0xce6f('0x11')]('cm_contact_has_tags','ct',_0xce6f('0x12')+_0xf00a10+_0xce6f('0x10'))[_0xce6f('0x11')](_0xce6f('0x13'),'t',_0xce6f('0x14'));return _0x48c573;}function addFieldsToQuery(_0x2824b3,_0x161f56,_0x3a5802,_0x1ed214,_0x17481f){var _0x5ed119=_0x17481f?'c':'subqry';if(!_0x161f56){_0x161f56=['id',_0xce6f('0x15'),_0xce6f('0x16'),'phone',_0xce6f('0x17'),_0xce6f('0x18'),_0xce6f('0x19'),_0xce6f('0x8'),_0xce6f('0x1a'),_0xce6f('0x1b'),_0xce6f('0x1c'),_0xce6f('0x1d'),'TagIds'];}else if(!_0x161f56[_0xce6f('0x1e')]('id')){_0x161f56[_0xce6f('0x1f')]('id');}var _0x4b0f61=_0x3a5802&&_0x17481f||!_0x3a5802&&!_0x17481f;if(_0x1ed214){_0x4b0f61=_0x1ed214&&_0x17481f||!_0x1ed214&&!_0x17481f;}_0x161f56[_0xce6f('0x20')](function(_0x2fbc61){if(_0x2fbc61==='TagIds'){if(_0x4b0f61){_0x2824b3[_0xce6f('0x21')](_0xce6f('0x22'),_0x2fbc61);}else if(_0x3a5802||_0x1ed214){_0x2824b3['field'](_0x5ed119+'.'+_0x2fbc61);}}else{_0x2824b3[_0xce6f('0x21')](_0x5ed119+'.'+_0x2fbc61);}});return _0x2824b3;}function getSqlClauses(){var _0x5aa01e={'default':squel[_0xce6f('0x23')](),'fields':squel['expr'](),'filter':squel[_0xce6f('0x23')](),'tags':{'clause':squel[_0xce6f('0x23')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x5aa01e;}function parseTagParameter(_0x448f2a){var _0x5b7657=squel['expr']();if(_0x448f2a){var _0x3f5715=utils[_0xce6f('0x24')](_0x448f2a);_0x3f5715[_0xce6f('0x20')](function(_0x403727){_0x5b7657['or'](_0xce6f('0x25'),'%,'+_0x403727+',%');});}return _0x5b7657;}function parseSearchFilter(_0x27d763){var _0xbd25d9=squel[_0xce6f('0x23')]();if(_0x27d763){var _0x40d8a1=_0x27d763[_0xce6f('0x26')]('\x5c','\x5c\x5c')[_0xce6f('0x26')](/'/g,'\x27\x27');if(_0x40d8a1[_0xce6f('0x27')]('\x20')[_0xce6f('0x28')]>0x1){_0xbd25d9['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xce6f('0x29')](_0x40d8a1),null);}else{if(qs[_0xce6f('0x2a')](_0x40d8a1)){_0xbd25d9['or']('c.id\x20LIKE\x20?',_0x40d8a1+'%');_0xbd25d9['or'](_0xce6f('0x2b'),_0x40d8a1+'%');_0xbd25d9['or'](_0xce6f('0x2c'),_0x40d8a1+'%');_0xbd25d9['or'](_0xce6f('0x2d'),_0x40d8a1+'%');}else if(qs[_0xce6f('0x2e')](_0x40d8a1)){_0xbd25d9['or'](_0xce6f('0x2f'),_0x40d8a1+'%');}else{_0xbd25d9['or'](_0xce6f('0x30'),'%'+_0x40d8a1+'%');_0xbd25d9['or'](_0xce6f('0x31'),'%'+_0x40d8a1+'%');_0xbd25d9['or'](_0xce6f('0x2f'),'%'+_0x40d8a1+'%');}}}return _0xbd25d9;}function parseAdvancedSearchFilter(_0xdc27af,_0x2a6e04){var _0x48d1d8=getSqlClauses();var _0x536d39=as[_0xce6f('0x32')](_0xdc27af);var _0x2d244c=_0x536d39[_0xce6f('0x33')];for(var _0x7b16a0=0x0;_0x7b16a0<_0x536d39[_0xce6f('0x34')][_0xce6f('0x28')];_0x7b16a0++){var _0x2094dc=_0x536d39[_0xce6f('0x34')][_0x7b16a0];var _0x5afd81='c';var _0x5af1fe=_[_0xce6f('0x35')](_0x2a6e04,[_0xce6f('0x36'),_0x2094dc['field']]);if(_0x5af1fe){if(_0x2094dc[_0xce6f('0x21')]===_0xce6f('0x37')||_0x5af1fe[_0xce6f('0x38')]===_0xce6f('0x39')){_0x2094dc[_0xce6f('0x3a')]=_0xce6f('0x3b');}var _0xdb9b7e=as['buildExpression'](_0x5afd81,_0x5af1fe[_0xce6f('0x3c')],_0x2094dc);_0x48d1d8['default'][_0x2d244c](_0xdb9b7e[_0xce6f('0x3d')],_0xdb9b7e[_0xce6f('0x3e')]['start'],_0xdb9b7e['value'][_0xce6f('0x3f')]);}else{if(_0x2094dc[_0xce6f('0x21')]===_0xce6f('0x40')){var _0x6b9cf1=_0x2094dc[_0xce6f('0x3e')][_0xce6f('0x27')](',')['map'](function(_0x59f10b){return Number(_0x59f10b);});var _0x45212d=parseTagParameter(_0x6b9cf1);_0x48d1d8[_0xce6f('0x41')][_0xce6f('0x42')][_0xce6f('0x43')](_0x45212d);_0x48d1d8[_0xce6f('0x41')][_0xce6f('0x44')]=_0x6b9cf1;}else if(_0x2094dc[_0xce6f('0x21')]==='User'){_0x48d1d8['user'][_0xce6f('0x42')][_0xce6f('0x43')](_0xce6f('0x45'),_0x2094dc[_0xce6f('0x3e')]);_0x48d1d8[_0xce6f('0x46')]['skip']=!![];}}}return _0x48d1d8;}function parseModelFields(_0x13cd18,_0x1966e8){var _0x351c58=squel[_0xce6f('0x23')]();var _0x4dd728=_(_0x13cd18)['keys']()[_0xce6f('0x47')](function(_0x84b6cc){return _['some'](_0x1966e8,[_0xce6f('0x36'),_0x84b6cc])?_0x84b6cc:undefined;})[_0xce6f('0x48')]()['value']();if(_0x13cd18[_0xce6f('0x49')]){_0x4dd728['push'](_0xce6f('0x49'));}if(_0x4dd728['length']>0x0){_0x4dd728[_0xce6f('0x20')](function(_0x5505a8){if(_0x5505a8==='ListId'){_0x351c58[_0xce6f('0x43')]('c.ListId\x20IN\x20?',[]['concat'](_0x13cd18[_0x5505a8]));}else if(_0x5505a8===_0xce6f('0x49')){var _0x4b6c39='%'+_0x13cd18[_0x5505a8]+'%';_0x351c58[_0xce6f('0x43')](_0xce6f('0x4a'),_0x4b6c39);}else{_0x351c58[_0xce6f('0x43')]('c.'+_0x5505a8+'\x20=\x20?',_0x13cd18[_0x5505a8]);}});}return _0x351c58;}function parseQueryParameters(_0x170a86,_0x324614){var _0x33feaa=getSqlClauses();return Promise[_0xce6f('0x4b')]()[_0xce6f('0x4c')](function(){return parseModelFields(_0x170a86,_0x324614);})[_0xce6f('0x4c')](function(_0x14f368){_0x33feaa[_0xce6f('0x4d')][_0xce6f('0x43')](_0x14f368);return parseTagParameter(_0x170a86['tag']);})[_0xce6f('0x4c')](function(_0x30e201){_0x33feaa[_0xce6f('0x41')]['clause'][_0xce6f('0x43')](_0x30e201);return parseSearchFilter(_0x170a86['filter']);})[_0xce6f('0x4c')](function(_0x4af504){_0x33feaa['filter']=_0x4af504;return _0x33feaa;});}function checkListsRestrictions(_0x1f82e8,_0x37cb26,_0x3a1f51){var _0x48ec3a=squel[_0xce6f('0x23')]();return Promise[_0xce6f('0x4b')]()[_0xce6f('0x4c')](function(){if(_0x37cb26[_0xce6f('0x7')]&&_0x1f82e8[_0xce6f('0x5')]==='agent'&&!_0x3a1f51){return _0x1f82e8[_0xce6f('0x4e')]({'attributes':['id'],'raw':!![]});}})[_0xce6f('0x4c')](function(_0x2f617d){if(_0x2f617d){if(_0x2f617d[_0xce6f('0x28')]===0x0){_0x48ec3a['and'](_0xce6f('0x4f'));}else{_0x48ec3a[_0xce6f('0x43')](_0xce6f('0x50'),_[_0xce6f('0x47')](_0x2f617d,'id'));}}})[_0xce6f('0x4c')](function(){return _0x48ec3a;});}function buildContactsQuery(_0x45bec3,_0x58bd66,_0x17e1f7,_0x718004,_0x3bc432,_0xab3c00){if(_0x58bd66){_0x58bd66=_0x17e1f7[_0xce6f('0x51')];}_0x45bec3=addFieldsToQuery(_0x45bec3,_0x58bd66,_0x718004,_0xab3c00,!![]);var _0x17762d=squel[_0xce6f('0xb')]();_0x17762d=addFieldsToQuery(_0x17762d,_0x58bd66,_0x718004,_0xab3c00,![]);if(_0x718004||_0xab3c00){_0x45bec3=applyJoinClauses(_0x45bec3,!![]);_0x45bec3[_0xce6f('0x52')](_0xce6f('0x53'));if(_0x17e1f7[_0xce6f('0x54')]){_0x17762d[_0xce6f('0x54')](_0x17e1f7[_0xce6f('0x54')]);}if(_0x17e1f7['offset']){_0x17762d[_0xce6f('0x55')](_0x17e1f7[_0xce6f('0x55')]);}}else{_0x17762d=applyJoinClauses(_0x17762d,![]);_0x17762d[_0xce6f('0x52')]('subqry.id');if(_0x17e1f7['limit']){_0x45bec3[_0xce6f('0x54')](_0x17e1f7[_0xce6f('0x54')]);}if(_0x17e1f7[_0xce6f('0x55')]){_0x45bec3[_0xce6f('0x55')](_0x17e1f7[_0xce6f('0x55')]);}}_0x17762d[_0xce6f('0x56')](_0x3bc432);if(_0x17e1f7[_0xce6f('0x57')]){_0x17e1f7['order'][_0xce6f('0x20')](function(_0x3b1db8){_0x45bec3[_0xce6f('0x57')]('c.'+_0x3b1db8[0x0],_0x3b1db8[0x1]===_0xce6f('0x58')?![]:!![]);_0x17762d[_0xce6f('0x57')](_0xce6f('0x59')+_0x3b1db8[0x0],_0x3b1db8[0x1]==='DESC'?![]:!![]);});}_0x17762d[_0xce6f('0xc')](_0x45bec3,_0xce6f('0xf'));return _0x17762d;}function getFilteredContacts(_0x31241d){var _0x324d24=[];return db[_0xce6f('0x40')]['findAll']({'attributes':['id',_0xce6f('0x36'),_0xce6f('0x5a')],'raw':!![]})[_0xce6f('0x4c')](function(_0x110f55){_0x324d24=_[_0xce6f('0x5b')](_0x110f55,'id');var _0x5dff3d={'type':db[_0xce6f('0x5c')][_0xce6f('0x5d')]['SELECT'],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0xce6f('0x5e')](_0x31241d['toString'](),_0x5dff3d);})[_0xce6f('0x4c')](function(_0x355ca5){_0x355ca5[_0xce6f('0x20')](function(_0x5bf430){if(_0x5bf430['TagIds']){_0x5bf430[_0xce6f('0x5f')]=[];_0x5bf430[_0xce6f('0x60')][_0xce6f('0x27')](',')['forEach'](function(_0x551a78){_0x5bf430[_0xce6f('0x5f')][_0xce6f('0x1f')](_0x324d24[_0x551a78]);});}delete _0x5bf430[_0xce6f('0x60')];});return _0x355ca5;});}function countFilteredContacts(_0x4f532c,_0xb7bce0){var _0x33f647=_0x4f532c[_0xce6f('0x61')]();_0x33f647[_0xce6f('0x21')](_0xce6f('0x62'));_0x33f647=applyJoinClauses(_0x33f647,!![]);_0x4f532c[_0xce6f('0x52')](_0xce6f('0x53'));var _0x5e879d=utils[_0xce6f('0x24')](_0xb7bce0);if(!_[_0xce6f('0x63')](_0x5e879d)){_0x33f647[_0xce6f('0x64')]('t.id\x20IN\x20?',_0x5e879d);}var _0xb00319={'type':db[_0xce6f('0x5c')]['QueryTypes'][_0xce6f('0x65')],'raw':!![]};return db['sequelize']['query'](_0x33f647[_0xce6f('0x66')](),_0xb00319)[_0xce6f('0x4c')](function(_0x52078f){return _0x52078f[0x0][_0xce6f('0x62')];});}module[_0xce6f('0x67')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x6bac=['c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','sqlOperator','conditions','find','name','dateOfBirth','datetime','castTo','buildExpression','default','text','start','value','end','Tag','map','tags','clause','and','ids','User','user','skip','keys','compact','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','tag','filter','search','getLists','c.ListId\x20IS\x20NULL','attributes','group','c.id','limit','offset','subqry.id','order','DESC','keyBy','QueryTypes','CmContact','query','toString','Tags','clone','COUNT(*)','isEmpty','where','t.id\x20IN\x20?','sequelize','lodash','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','role','agent','ListId','autocomplete','true','select','from','cm_contacts','uc.CmContactId\x20=\x20','.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','subqry','firstName','lastName','phone','mobile','fax','email','push','TagIds','GROUP_CONCAT(DISTINCT\x20t.id)','field','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric'];(function(_0x1c695a,_0x186ab4){var _0x38b9e0=function(_0x1875e6){while(--_0x1875e6){_0x1c695a['push'](_0x1c695a['shift']());}};_0x38b9e0(++_0x186ab4);}(_0x6bac,0xa5));var _0xc6ba=function(_0x43a2af,_0x3a9202){_0x43a2af=_0x43a2af-0x0;var _0x5bc3e9=_0x6bac[_0x43a2af];return _0x5bc3e9;};'use strict';var _=require(_0xc6ba('0x0'));var squel=require('squel');var as=require(_0xc6ba('0x1'));var qs=require(_0xc6ba('0x2'));var utils=require(_0xc6ba('0x3'));var db=require(_0xc6ba('0x4'))['db'];function skipContactsQuery(_0x489037,_0x54f821){var _0x487ef1=![];if(_0x489037[_0xc6ba('0x5')]===_0xc6ba('0x6')&&!_0x54f821['search']&&!_0x54f821[_0xc6ba('0x7')]&&_0x54f821[_0xc6ba('0x8')]!==_0xc6ba('0x9')){_0x487ef1=!![];}return _0x487ef1;}function getContactsSubquery(){return squel[_0xc6ba('0xa')]()[_0xc6ba('0xb')](_0xc6ba('0xc'),'c')['where']('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x46e908,_0x481755){var _0x508603=_0x481755?'c':'subqry';_0x46e908['left_join']('cm_user_has_contacts','uc',_0xc6ba('0xd')+_0x508603+_0xc6ba('0xe'))[_0xc6ba('0xf')](_0xc6ba('0x10'),'ct',_0xc6ba('0x11')+_0x508603+'.id')['left_join'](_0xc6ba('0x12'),'t',_0xc6ba('0x13'));return _0x46e908;}function addFieldsToQuery(_0x31def2,_0x27b00a,_0x2c866f,_0x4e022a,_0x498aa1){var _0x595561=_0x498aa1?'c':_0xc6ba('0x14');if(!_0x27b00a){_0x27b00a=['id',_0xc6ba('0x15'),_0xc6ba('0x16'),_0xc6ba('0x17'),_0xc6ba('0x18'),_0xc6ba('0x19'),_0xc6ba('0x1a'),_0xc6ba('0x7'),'CompanyId','createdAt','updatedAt','deletedAt','TagIds'];}else if(!_0x27b00a['includes']('id')){_0x27b00a[_0xc6ba('0x1b')]('id');}var _0x15a135=_0x2c866f&&_0x498aa1||!_0x2c866f&&!_0x498aa1;if(_0x4e022a){_0x15a135=_0x4e022a&&_0x498aa1||!_0x4e022a&&!_0x498aa1;}_0x27b00a['forEach'](function(_0x485086){if(_0x485086===_0xc6ba('0x1c')){if(_0x15a135){_0x31def2['field'](_0xc6ba('0x1d'),_0x485086);}else if(_0x2c866f||_0x4e022a){_0x31def2[_0xc6ba('0x1e')](_0x595561+'.'+_0x485086);}}else{_0x31def2['field'](_0x595561+'.'+_0x485086);}});return _0x31def2;}function getSqlClauses(){var _0x3936e2={'default':squel[_0xc6ba('0x1f')](),'fields':squel['expr'](),'filter':squel[_0xc6ba('0x1f')](),'tags':{'clause':squel[_0xc6ba('0x1f')](),'ids':null},'user':{'clause':squel[_0xc6ba('0x1f')](),'skip':![]}};return _0x3936e2;}function parseTagParameter(_0x38aa22){var _0x28f8ba=squel[_0xc6ba('0x1f')]();if(_0x38aa22){var _0xc2de63=utils[_0xc6ba('0x20')](_0x38aa22);_0xc2de63[_0xc6ba('0x21')](function(_0x3c7edd){_0x28f8ba['or'](_0xc6ba('0x22'),'%,'+_0x3c7edd+',%');});}return _0x28f8ba;}function parseSearchFilter(_0xf326f9){var _0x4a2082=squel[_0xc6ba('0x1f')]();if(_0xf326f9){var _0x161d7e=_0xf326f9['replace']('\x5c','\x5c\x5c')[_0xc6ba('0x23')](/'/g,'\x27\x27');if(_0x161d7e[_0xc6ba('0x24')]('\x20')[_0xc6ba('0x25')]>0x1){_0x4a2082['or'](_0xc6ba('0x26'),qs[_0xc6ba('0x27')](_0x161d7e),null);}else{if(qs[_0xc6ba('0x28')](_0x161d7e)){_0x4a2082['or']('c.id\x20LIKE\x20?',_0x161d7e+'%');_0x4a2082['or'](_0xc6ba('0x29'),_0x161d7e+'%');_0x4a2082['or'](_0xc6ba('0x2a'),_0x161d7e+'%');_0x4a2082['or']('c.fax\x20LIKE\x20?',_0x161d7e+'%');}else if(qs[_0xc6ba('0x2b')](_0x161d7e)){_0x4a2082['or'](_0xc6ba('0x2c'),_0x161d7e+'%');}else{_0x4a2082['or']('c.firstName\x20LIKE\x20?','%'+_0x161d7e+'%');_0x4a2082['or'](_0xc6ba('0x2d'),'%'+_0x161d7e+'%');_0x4a2082['or']('c.email\x20LIKE\x20?','%'+_0x161d7e+'%');}}}return _0x4a2082;}function parseAdvancedSearchFilter(_0x3fea76,_0x2dd085){var _0x111ce4=getSqlClauses();var _0x393d4d=as['parseSearch'](_0x3fea76);var _0x4fe380=_0x393d4d[_0xc6ba('0x2e')];for(var _0x53655b=0x0;_0x53655b<_0x393d4d[_0xc6ba('0x2f')]['length'];_0x53655b++){var _0x3ffa66=_0x393d4d[_0xc6ba('0x2f')][_0x53655b];var _0x4cf6fb='c';var _0xa079a=_[_0xc6ba('0x30')](_0x2dd085,[_0xc6ba('0x31'),_0x3ffa66[_0xc6ba('0x1e')]]);if(_0xa079a){if(_0x3ffa66[_0xc6ba('0x1e')]===_0xc6ba('0x32')||_0xa079a['fieldType']===_0xc6ba('0x33')){_0x3ffa66[_0xc6ba('0x34')]='DATE';}var _0x31b983=as[_0xc6ba('0x35')](_0x4cf6fb,_0xa079a['type'],_0x3ffa66);_0x111ce4[_0xc6ba('0x36')][_0x4fe380](_0x31b983[_0xc6ba('0x37')],_0x31b983['value'][_0xc6ba('0x38')],_0x31b983[_0xc6ba('0x39')][_0xc6ba('0x3a')]);}else{if(_0x3ffa66[_0xc6ba('0x1e')]===_0xc6ba('0x3b')){var _0x1ca332=_0x3ffa66['value'][_0xc6ba('0x24')](',')[_0xc6ba('0x3c')](function(_0x355eca){return Number(_0x355eca);});var _0x4440e7=parseTagParameter(_0x1ca332);_0x111ce4[_0xc6ba('0x3d')][_0xc6ba('0x3e')][_0xc6ba('0x3f')](_0x4440e7);_0x111ce4[_0xc6ba('0x3d')][_0xc6ba('0x40')]=_0x1ca332;}else if(_0x3ffa66[_0xc6ba('0x1e')]===_0xc6ba('0x41')){_0x111ce4[_0xc6ba('0x42')][_0xc6ba('0x3e')][_0xc6ba('0x3f')]('uc.UserId\x20=\x20?',_0x3ffa66[_0xc6ba('0x39')]);_0x111ce4[_0xc6ba('0x42')][_0xc6ba('0x43')]=!![];}}}return _0x111ce4;}function parseModelFields(_0x5c2f18,_0x2b2964){var _0x5d25d0=squel[_0xc6ba('0x1f')]();var _0x52ce31=_(_0x5c2f18)[_0xc6ba('0x44')]()['map'](function(_0x7e786f){return _['some'](_0x2b2964,['name',_0x7e786f])?_0x7e786f:undefined;})[_0xc6ba('0x45')]()[_0xc6ba('0x39')]();if(_0x5c2f18[_0xc6ba('0x46')]){_0x52ce31[_0xc6ba('0x1b')]('Contact');}if(_0x52ce31[_0xc6ba('0x25')]>0x0){_0x52ce31[_0xc6ba('0x21')](function(_0x2bd768){if(_0x2bd768===_0xc6ba('0x7')){_0x5d25d0[_0xc6ba('0x3f')](_0xc6ba('0x47'),[][_0xc6ba('0x48')](_0x5c2f18[_0x2bd768]));}else if(_0x2bd768==='Contact'){var _0x2d9dd1='%'+_0x5c2f18[_0x2bd768]+'%';_0x5d25d0[_0xc6ba('0x3f')](_0xc6ba('0x49'),_0x2d9dd1);}else{_0x5d25d0[_0xc6ba('0x3f')]('c.'+_0x2bd768+_0xc6ba('0x4a'),_0x5c2f18[_0x2bd768]);}});}return _0x5d25d0;}function parseQueryParameters(_0x4985f8,_0x5af16c){var _0xc58daf=getSqlClauses();return Promise[_0xc6ba('0x4b')]()['then'](function(){return parseModelFields(_0x4985f8,_0x5af16c);})[_0xc6ba('0x4c')](function(_0x23e2d1){_0xc58daf[_0xc6ba('0x4d')][_0xc6ba('0x3f')](_0x23e2d1);return parseTagParameter(_0x4985f8[_0xc6ba('0x4e')]);})[_0xc6ba('0x4c')](function(_0x54b3d3){_0xc58daf['tags'][_0xc6ba('0x3e')][_0xc6ba('0x3f')](_0x54b3d3);return parseSearchFilter(_0x4985f8[_0xc6ba('0x4f')]);})['then'](function(_0x5cf1f5){_0xc58daf[_0xc6ba('0x4f')]=_0x5cf1f5;return _0xc58daf;});}function checkListsRestrictions(_0x433fd0,_0xc30ac5,_0x158eb8){var _0x333768=squel['expr']();return Promise[_0xc6ba('0x4b')]()[_0xc6ba('0x4c')](function(){if(_0xc30ac5[_0xc6ba('0x50')]&&_0x433fd0[_0xc6ba('0x5')]===_0xc6ba('0x6')&&!_0x158eb8){return _0x433fd0[_0xc6ba('0x51')]({'attributes':['id'],'raw':!![]});}})[_0xc6ba('0x4c')](function(_0x380278){if(_0x380278){if(_0x380278['length']===0x0){_0x333768[_0xc6ba('0x3f')](_0xc6ba('0x52'));}else{_0x333768[_0xc6ba('0x3f')]('c.ListId\x20IN\x20?',_[_0xc6ba('0x3c')](_0x380278,'id'));}}})[_0xc6ba('0x4c')](function(){return _0x333768;});}function buildContactsQuery(_0x25669a,_0x583124,_0x5a122a,_0x7b1fb9,_0xe4747e,_0x56add1){if(_0x583124){_0x583124=_0x5a122a[_0xc6ba('0x53')];}_0x25669a=addFieldsToQuery(_0x25669a,_0x583124,_0x7b1fb9,_0x56add1,!![]);var _0x22d3e5=squel[_0xc6ba('0xa')]();_0x22d3e5=addFieldsToQuery(_0x22d3e5,_0x583124,_0x7b1fb9,_0x56add1,![]);if(_0x7b1fb9||_0x56add1){_0x25669a=applyJoinClauses(_0x25669a,!![]);_0x25669a[_0xc6ba('0x54')](_0xc6ba('0x55'));if(_0x5a122a[_0xc6ba('0x56')]){_0x22d3e5[_0xc6ba('0x56')](_0x5a122a[_0xc6ba('0x56')]);}if(_0x5a122a['offset']){_0x22d3e5[_0xc6ba('0x57')](_0x5a122a['offset']);}}else{_0x22d3e5=applyJoinClauses(_0x22d3e5,![]);_0x22d3e5[_0xc6ba('0x54')](_0xc6ba('0x58'));if(_0x5a122a[_0xc6ba('0x56')]){_0x25669a[_0xc6ba('0x56')](_0x5a122a[_0xc6ba('0x56')]);}if(_0x5a122a['offset']){_0x25669a['offset'](_0x5a122a['offset']);}}_0x22d3e5['having'](_0xe4747e);if(_0x5a122a[_0xc6ba('0x59')]){_0x5a122a['order'][_0xc6ba('0x21')](function(_0x2e82d4){_0x25669a[_0xc6ba('0x59')]('c.'+_0x2e82d4[0x0],_0x2e82d4[0x1]===_0xc6ba('0x5a')?![]:!![]);_0x22d3e5['order']('subqry.'+_0x2e82d4[0x0],_0x2e82d4[0x1]===_0xc6ba('0x5a')?![]:!![]);});}_0x22d3e5[_0xc6ba('0xb')](_0x25669a,'subqry');return _0x22d3e5;}function getFilteredContacts(_0x23513d){var _0x32d5b6=[];return db[_0xc6ba('0x3b')]['findAll']({'attributes':['id',_0xc6ba('0x31'),'color'],'raw':!![]})[_0xc6ba('0x4c')](function(_0x4f9518){_0x32d5b6=_[_0xc6ba('0x5b')](_0x4f9518,'id');var _0x1fd7ed={'type':db['Sequelize'][_0xc6ba('0x5c')]['SELECT'],'model':db[_0xc6ba('0x5d')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0xc6ba('0x5e')](_0x23513d[_0xc6ba('0x5f')](),_0x1fd7ed);})['then'](function(_0x156043){_0x156043[_0xc6ba('0x21')](function(_0x103bb2){if(_0x103bb2[_0xc6ba('0x1c')]){_0x103bb2[_0xc6ba('0x60')]=[];_0x103bb2[_0xc6ba('0x1c')][_0xc6ba('0x24')](',')[_0xc6ba('0x21')](function(_0x48efde){_0x103bb2[_0xc6ba('0x60')][_0xc6ba('0x1b')](_0x32d5b6[_0x48efde]);});}delete _0x103bb2[_0xc6ba('0x1c')];});return _0x156043;});}function countFilteredContacts(_0x360f06,_0x470ca){var _0x559855=_0x360f06[_0xc6ba('0x61')]();_0x559855[_0xc6ba('0x1e')](_0xc6ba('0x62'));_0x559855=applyJoinClauses(_0x559855,!![]);_0x360f06[_0xc6ba('0x54')](_0xc6ba('0x55'));var _0x2020c3=utils[_0xc6ba('0x20')](_0x470ca);if(!_[_0xc6ba('0x63')](_0x2020c3)){_0x559855[_0xc6ba('0x64')](_0xc6ba('0x65'),_0x2020c3);}var _0x5d56f5={'type':db['Sequelize'][_0xc6ba('0x5c')]['SELECT'],'raw':!![]};return db[_0xc6ba('0x66')][_0xc6ba('0x5e')](_0x559855[_0xc6ba('0x5f')](),_0x5d56f5)[_0xc6ba('0x4c')](function(_0x111ad7){return _0x111ad7[0x0][_0xc6ba('0x62')];});}module['exports']={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index b43fca1..a43b30f 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 _0x9a99=['session','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','binary','write','final','unlink','decryptFile','createDecipher','update','end','encryptString','secret','utf8','base64','decryptString','bluebird'];(function(_0x15ad35,_0x15d3bd){var _0x45ccc4=function(_0x5a0147){while(--_0x5a0147){_0x15ad35['push'](_0x15ad35['shift']());}};_0x45ccc4(++_0x15d3bd);}(_0x9a99,0x185));var _0x99a9=function(_0x5a8c2d,_0x24332f){_0x5a8c2d=_0x5a8c2d-0x0;var _0x18ea1c=_0x9a99[_0x5a8c2d];return _0x18ea1c;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x99a9('0x0'));var _=require('lodash');var config=require('../../config/environment');var logger=require('../../config/logger')('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x99a9('0x1')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x99a9('0x2')};if(config[_0x99a9('0x3')]&&config[_0x99a9('0x3')][_0x99a9('0x4')]){var isSupported=isAlgorithmSupported(config['encrypt']['algorithm']);if(isSupported){fileOptions[_0x99a9('0x4')]=config['encrypt']['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0x99a9('0x5')](',\x20');logger[_0x99a9('0x6')](config['encrypt']['algorithm'],_0x99a9('0x7'),supportedAlgorithms);}}function isASupportedCipher(_0x253423){return AES_SUPPORTED_RX[_0x99a9('0x8')](_0x253423);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x99a9('0x9')](isASupportedCipher);}function isAlgorithmSupported(_0x434934){return getSupportedCiphers()[_0x99a9('0xa')](_0x434934)>-0x1;}function combineOptions(_0x292c29){var _0x475c99={};for(var _0x286b4b in fileOptions){if(fileOptions['hasOwnProperty'](_0x286b4b)){_0x475c99[_0x286b4b]=fileOptions[_0x286b4b];}}if(_0x292c29){for(var _0x12516f in _0x292c29){if(_0x292c29[_0x99a9('0xb')](_0x12516f)){_0x475c99[_0x12516f]=_0x292c29[_0x12516f];}}}return _0x475c99;}exports[_0x99a9('0xc')]=function(_0x31fa0c,_0x1a382f,_0x458186,_0x242fd9){return new BPromise(function(_0x37d8cd,_0x445524){_0x242fd9=combineOptions(_0x242fd9);var _0xb5831a=new Buffer(_0x458186);var _0x5f179c=fs[_0x99a9('0xd')](_0x31fa0c);var _0x284d00=fs[_0x99a9('0xe')](_0x1a382f);var _0x2385a8=crypto[_0x99a9('0xf')](_0x242fd9[_0x99a9('0x4')],_0xb5831a);_0x5f179c['on'](_0x99a9('0x10'),function(_0x2b04d8){var _0x28c353=new Buffer(_0x2385a8['update'](_0x2b04d8),_0x99a9('0x11'));_0x284d00[_0x99a9('0x12')](_0x28c353);});_0x5f179c['on']('end',function(){try{var _0x4fe2ea=new Buffer(_0x2385a8[_0x99a9('0x13')](_0x99a9('0x11')),'binary');_0x284d00[_0x99a9('0x12')](_0x4fe2ea);_0x284d00['end']();_0x284d00['on']('close',function(){return _0x37d8cd(_0x1a382f);});}catch(_0x4c893c){fs[_0x99a9('0x14')](_0x1a382f);return _0x445524(_0x4c893c);}});});};exports[_0x99a9('0x15')]=function(_0x8cb68f,_0x1b758f,_0x3f0819,_0x3021de){return new BPromise(function(_0x535de0,_0xe9f53a){_0x3021de=combineOptions(_0x3021de);var _0x217e07=new Buffer(_0x3f0819);var _0x17a3b7=fs[_0x99a9('0xd')](_0x8cb68f);var _0x28d912=fs[_0x99a9('0xe')](_0x1b758f);var _0x5af964=crypto[_0x99a9('0x16')](_0x3021de[_0x99a9('0x4')],_0x217e07);_0x17a3b7['on'](_0x99a9('0x10'),function(_0xb41f42){var _0x20aac5=new Buffer(_0x5af964[_0x99a9('0x17')](_0xb41f42),'binary');_0x28d912[_0x99a9('0x12')](_0x20aac5);});_0x17a3b7['on'](_0x99a9('0x18'),function(){try{var _0x1e4222=new Buffer(_0x5af964[_0x99a9('0x13')](_0x99a9('0x11')),_0x99a9('0x11'));_0x28d912[_0x99a9('0x12')](_0x1e4222);_0x28d912['end']();_0x28d912['on']('close',function(){return _0x535de0(_0x1b758f);});}catch(_0x2f9081){fs[_0x99a9('0x14')](_0x1b758f);return _0xe9f53a(_0x2f9081);}});});};exports[_0x99a9('0x19')]=function(_0x46aa00,_0x1f1ba4,_0x1972d3){var _0x4a4b75=_0x1972d3||stringOptions[_0x99a9('0x4')];var _0x7f3ce8=_0x1f1ba4||stringOptions[_0x99a9('0x1a')];var _0x9cb4a0=crypto[_0x99a9('0xf')](_0x4a4b75,_0x7f3ce8);var _0x4d2521=_0x9cb4a0[_0x99a9('0x17')](_0x46aa00,_0x99a9('0x1b'),'base64');_0x4d2521+=_0x9cb4a0[_0x99a9('0x13')](_0x99a9('0x1c'));return _0x4d2521;};exports[_0x99a9('0x1d')]=function(_0x49f22,_0x3e091f,_0x4d2a7b){var _0x1fd076=_0x4d2a7b||stringOptions[_0x99a9('0x4')];var _0xbc5ea3=_0x3e091f||stringOptions[_0x99a9('0x1a')];var _0x59177b=crypto[_0x99a9('0x16')](_0x1fd076,_0xbc5ea3);var _0x290377=_0x59177b[_0x99a9('0x17')](_0x49f22,_0x99a9('0x1c'),_0x99a9('0x1b'));_0x290377+=_0x59177b[_0x99a9('0x13')]('utf8');return _0x290377;}; \ No newline at end of file +var _0x3839=['unlink','utf8','decryptString','base64','crypto','lodash','../../config/logger','app','session','aes-256-ctr','encrypt','algorithm','getCiphers','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','write','end','final','close','decryptFile','createDecipher'];(function(_0x2a6a35,_0x11fea5){var _0x27c779=function(_0x41e9b3){while(--_0x41e9b3){_0x2a6a35['push'](_0x2a6a35['shift']());}};_0x27c779(++_0x11fea5);}(_0x3839,0x148));var _0x9383=function(_0x1bb831,_0x5d76be){_0x1bb831=_0x1bb831-0x0;var _0x4a94af=_0x3839[_0x1bb831];return _0x4a94af;};'use strict';var crypto=require(_0x9383('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x9383('0x1'));var config=require('../../config/environment');var logger=require(_0x9383('0x2'))(_0x9383('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x9383('0x4')],'algorithm':_0x9383('0x5')};const fileOptions={'algorithm':'aes192'};if(config['encrypt']&&config[_0x9383('0x6')][_0x9383('0x7')]){var isSupported=isAlgorithmSupported(config[_0x9383('0x6')][_0x9383('0x7')]);if(isSupported){fileOptions[_0x9383('0x7')]=config[_0x9383('0x6')][_0x9383('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger['error'](config[_0x9383('0x6')][_0x9383('0x7')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x58b0f4){return AES_SUPPORTED_RX['test'](_0x58b0f4);}function getSupportedCiphers(){return crypto[_0x9383('0x8')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x43d4ff){return getSupportedCiphers()['indexOf'](_0x43d4ff)>-0x1;}function combineOptions(_0x42b5f){var _0x232a7a={};for(var _0x35a9ba in fileOptions){if(fileOptions[_0x9383('0x9')](_0x35a9ba)){_0x232a7a[_0x35a9ba]=fileOptions[_0x35a9ba];}}if(_0x42b5f){for(var _0x46a023 in _0x42b5f){if(_0x42b5f[_0x9383('0x9')](_0x46a023)){_0x232a7a[_0x46a023]=_0x42b5f[_0x46a023];}}}return _0x232a7a;}exports[_0x9383('0xa')]=function(_0x7fef1b,_0x2ae9e7,_0x399ae4,_0xce7c7f){return new BPromise(function(_0x5615ce,_0x3e1b88){_0xce7c7f=combineOptions(_0xce7c7f);var _0x3d3ace=new Buffer(_0x399ae4);var _0x24b470=fs[_0x9383('0xb')](_0x7fef1b);var _0x1b9019=fs[_0x9383('0xc')](_0x2ae9e7);var _0x49e55f=crypto[_0x9383('0xd')](_0xce7c7f[_0x9383('0x7')],_0x3d3ace);_0x24b470['on'](_0x9383('0xe'),function(_0x47f23b){var _0x33f15f=new Buffer(_0x49e55f[_0x9383('0xf')](_0x47f23b),_0x9383('0x10'));_0x1b9019[_0x9383('0x11')](_0x33f15f);});_0x24b470['on'](_0x9383('0x12'),function(){try{var _0x199060=new Buffer(_0x49e55f[_0x9383('0x13')](_0x9383('0x10')),_0x9383('0x10'));_0x1b9019[_0x9383('0x11')](_0x199060);_0x1b9019[_0x9383('0x12')]();_0x1b9019['on'](_0x9383('0x14'),function(){return _0x5615ce(_0x2ae9e7);});}catch(_0x48a92c){fs['unlink'](_0x2ae9e7);return _0x3e1b88(_0x48a92c);}});});};exports[_0x9383('0x15')]=function(_0x587b42,_0x3b6a57,_0x5f2ab7,_0x120b4a){return new BPromise(function(_0x3cb3a2,_0x2bfb8e){_0x120b4a=combineOptions(_0x120b4a);var _0x307751=new Buffer(_0x5f2ab7);var _0xa56956=fs[_0x9383('0xb')](_0x587b42);var _0x3c4b72=fs[_0x9383('0xc')](_0x3b6a57);var _0xe1551f=crypto[_0x9383('0x16')](_0x120b4a[_0x9383('0x7')],_0x307751);_0xa56956['on']('data',function(_0x5f02ac){var _0xf4f5c1=new Buffer(_0xe1551f[_0x9383('0xf')](_0x5f02ac),_0x9383('0x10'));_0x3c4b72[_0x9383('0x11')](_0xf4f5c1);});_0xa56956['on'](_0x9383('0x12'),function(){try{var _0x225c2b=new Buffer(_0xe1551f['final'](_0x9383('0x10')),'binary');_0x3c4b72[_0x9383('0x11')](_0x225c2b);_0x3c4b72[_0x9383('0x12')]();_0x3c4b72['on'](_0x9383('0x14'),function(){return _0x3cb3a2(_0x3b6a57);});}catch(_0x971886){fs[_0x9383('0x17')](_0x3b6a57);return _0x2bfb8e(_0x971886);}});});};exports['encryptString']=function(_0x10a3c7,_0x3a67c4,_0x2e8288){var _0x2eff58=_0x2e8288||stringOptions[_0x9383('0x7')];var _0x43518e=_0x3a67c4||stringOptions['secret'];var _0x258a13=crypto[_0x9383('0xd')](_0x2eff58,_0x43518e);var _0x273c05=_0x258a13[_0x9383('0xf')](_0x10a3c7,_0x9383('0x18'),'base64');_0x273c05+=_0x258a13[_0x9383('0x13')]('base64');return _0x273c05;};exports[_0x9383('0x19')]=function(_0x4b81ed,_0x56c26e,_0x32e82a){var _0x303901=_0x32e82a||stringOptions[_0x9383('0x7')];var _0x54ac9b=_0x56c26e||stringOptions['secret'];var _0x393671=crypto['createDecipher'](_0x303901,_0x54ac9b);var _0x197384=_0x393671['update'](_0x4b81ed,_0x9383('0x1a'),'utf8');_0x197384+=_0x393671['final'](_0x9383('0x18'));return _0x197384;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index bf2c1f4..cfd950f 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 _0x1cb1=['Failed','finally','util','path','lodash','to-csv','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','split','splitSizeCsv','then','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','SELECT','Empty','length','range','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.csv','join','each','%s%d.%s','csv','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','%s.%s','zip','inspect'];(function(_0x53f049,_0x56af0b){var _0x1bf6ef=function(_0x68f16d){while(--_0x68f16d){_0x53f049['push'](_0x53f049['shift']());}};_0x1bf6ef(++_0x56af0b);}(_0x1cb1,0x1d8));var _0x11cb=function(_0x3235f6,_0x3b7e5d){_0x3235f6=_0x3235f6-0x0;var _0x15feba=_0x1cb1[_0x3235f6];return _0x15feba;};'use strict';var util=require(_0x11cb('0x0'));var path=require(_0x11cb('0x1'));var _=require(_0x11cb('0x2'));var csv=require(_0x11cb('0x3'));var fs=require('fs');var BPromise=require(_0x11cb('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x11cb('0x5'));var db=require(_0x11cb('0x6'))['db'];var dbH=require('../../mysqldb')[_0x11cb('0x7')];var logger=require(_0x11cb('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x11cb('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x11cb('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x498023,_0x47c74a){var _0x429f74={'status':_0x498023};var _0x40fa3e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x47c74a){_0x429f74[_0x11cb('0xa')]=_0x47c74a;}return db[_0x11cb('0xb')]['update'](_0x429f74,_0x40fa3e);}function main(){var _0x2a8f42=0x1388;var _0x5744e1;logger[_0x11cb('0xc')](util['format'](_0x11cb('0xd'),EXTRACTED_REPORT_ID,_0x11cb('0xe')));return db['Setting'][_0x11cb('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x11cb('0x10'),_0x11cb('0x11')]})[_0x11cb('0x12')](function(_0xee975f){if(_0xee975f){_0x5744e1=_0xee975f;_0x2a8f42=_0x5744e1[_0x11cb('0x11')]||0x1388;}})[_0x11cb('0x12')](function(){return dbH['sequelize'][_0x11cb('0x13')](util[_0x11cb('0x14')](_0x11cb('0x15'),QUERY),{'type':dbH[_0x11cb('0x16')]['QueryTypes'][_0x11cb('0x17')]});})[_0x11cb('0x12')](function(_0x45bf0a){if(!_0x45bf0a[0x0]['num']){return analyticExtractedReport(_0x11cb('0x18'));}var _0x1d6a9b=[];var _0x2c03f5=0x0;if(_0x5744e1['split']){if(_0x45bf0a&&_0x45bf0a[_0x11cb('0x19')]){var _0x4b3477=_[_0x11cb('0x1a')](_0x45bf0a[0x0][_0x11cb('0x1b')]/_0x2a8f42);var _0x579571=Number[_0x11cb('0x1c')](_0x45bf0a[0x0][_0x11cb('0x1b')]/_0x2a8f42)?_0x45bf0a[0x0][_0x11cb('0x1b')]%_0x2a8f42:0x0;_0x4b3477[_0x11cb('0x1d')](function(_0x5c3b7d){if(_0x5c3b7d>0x0){_0x2c03f5+=_0x2a8f42;}_0x1d6a9b[_0x11cb('0x1e')](dbH[_0x11cb('0x16')][_0x11cb('0x13')](util['format'](_0x11cb('0x1f'),QUERY,_0x2a8f42,_0x2c03f5),{'type':dbH[_0x11cb('0x16')][_0x11cb('0x20')]['SELECT']}));});if(_0x579571>0x0){_0x2c03f5+=_0x2a8f42;_0x1d6a9b['push'](dbH[_0x11cb('0x16')]['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x579571,_0x2c03f5),{'type':dbH['sequelize'][_0x11cb('0x20')]['SELECT']}));}}}else{_0x1d6a9b[_0x11cb('0x1e')](dbH['sequelize'][_0x11cb('0x13')](QUERY,{'type':dbH[_0x11cb('0x16')][_0x11cb('0x20')][_0x11cb('0x17')]}));}var _0x16bfac=path[_0x11cb('0x21')](PATH);var _0x4e4da6=path[_0x11cb('0x22')](PATH,_0x11cb('0x23'));var _0x37b46a=_0x5744e1['split']&&_0x1d6a9b['length']>0x1;var _0x294db8=[];if(!fs['existsSync'](path['join'](_0x16bfac,_0x4e4da6))&&_0x37b46a){fs['mkdirSync'](path[_0x11cb('0x24')](_0x16bfac,_0x4e4da6));}return BPromise[_0x11cb('0x25')](_0x1d6a9b,function(_0x5c3389){_0x294db8['push'](_0x5c3389);})[_0x11cb('0x12')](function(){for(var _0x1d1775=0x0;_0x1d1775<_0x294db8[_0x11cb('0x19')];_0x1d1775+=0x1){var _0x526e24;var _0x52fc36=_0x294db8[_0x1d1775];if(_0x37b46a){_0x526e24=path[_0x11cb('0x24')](_0x16bfac,_0x4e4da6,util[_0x11cb('0x14')](_0x11cb('0x26'),_0x4e4da6,_0x1d1775,_0x11cb('0x27')));}else{_0x526e24=path[_0x11cb('0x24')](_0x16bfac,util['format']('%s.%s',_0x4e4da6,_0x11cb('0x27')));}fs['writeFileSync'](_0x526e24,csv(_0x52fc36));}})[_0x11cb('0x12')](function(){if(_0x37b46a){return new Promise(function(_0xfbaf2c){zipdir(path[_0x11cb('0x24')](_0x16bfac,_0x4e4da6),{'saveTo':path['join'](_0x16bfac,util['format']('%s.%s',_0x4e4da6,'zip'))},function(_0x3a1355,_0x21d0cc){rimraf(path[_0x11cb('0x24')](_0x16bfac,_0x4e4da6),function(){});_0xfbaf2c('zip\x20finished');});});}})[_0x11cb('0x12')](function(){logger[_0x11cb('0xc')](util[_0x11cb('0x14')](_0x11cb('0x28'),EXTRACTED_REPORT_ID,_0x11cb('0xe')));return analyticExtractedReport(_0x11cb('0x29'),_0x37b46a?util['format'](_0x11cb('0x2a'),_0x4e4da6,_0x37b46a?_0x11cb('0x2b'):'csv'):null);});})['catch'](function(_0x599abe){logger[_0x11cb('0xc')](util[_0x11cb('0x14')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x11cb('0xe')),util[_0x11cb('0x2c')](_0x599abe,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x11cb('0x2d'));})[_0x11cb('0x2e')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x6723=['argv','savename','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','QueryTypes','SELECT','Empty','length','range','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','query','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','writeFileSync','%s.%s','zip','zip\x20finished','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','to-csv','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics'];(function(_0x22f3a1,_0x6fafe6){var _0xd1154c=function(_0x54a591){while(--_0x54a591){_0x22f3a1['push'](_0x22f3a1['shift']());}};_0xd1154c(++_0x6fafe6);}(_0x6723,0x1c1));var _0x3672=function(_0x17da30,_0xdc2b24){_0x17da30=_0x17da30-0x0;var _0x2794ff=_0x6723[_0x17da30];return _0x2794ff;};'use strict';var util=require(_0x3672('0x0'));var path=require(_0x3672('0x1'));var _=require(_0x3672('0x2'));var csv=require(_0x3672('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x3672('0x4'));var rimraf=require(_0x3672('0x5'));var db=require(_0x3672('0x6'))['db'];var dbH=require(_0x3672('0x6'))[_0x3672('0x7')];var logger=require(_0x3672('0x8'))(_0x3672('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x3672('0xa')][0x2]);var QUERY=process[_0x3672('0xa')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x16d24c,_0x1a3a1f){var _0x3b3955={'status':_0x16d24c};var _0x28d6a5={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1a3a1f){_0x3b3955[_0x3672('0xb')]=_0x1a3a1f;}return db['AnalyticExtractedReport']['update'](_0x3b3955,_0x28d6a5);}function main(){var _0x284840=0x1388;var _0x1b3274;logger[_0x3672('0xc')](util[_0x3672('0xd')](_0x3672('0xe'),EXTRACTED_REPORT_ID,_0x3672('0xf')));return db[_0x3672('0x10')][_0x3672('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x3672('0x12'),_0x3672('0x13')]})[_0x3672('0x14')](function(_0x309fab){if(_0x309fab){_0x1b3274=_0x309fab;_0x284840=_0x1b3274[_0x3672('0x13')]||0x1388;}})['then'](function(){return dbH[_0x3672('0x15')]['query'](util[_0x3672('0xd')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x3672('0x15')][_0x3672('0x16')][_0x3672('0x17')]});})[_0x3672('0x14')](function(_0x38e808){if(!_0x38e808[0x0]['num']){return analyticExtractedReport(_0x3672('0x18'));}var _0x22af93=[];var _0x16d70d=0x0;if(_0x1b3274[_0x3672('0x12')]){if(_0x38e808&&_0x38e808[_0x3672('0x19')]){var _0x513f1d=_[_0x3672('0x1a')](_0x38e808[0x0][_0x3672('0x1b')]/_0x284840);var _0x41f44f=Number[_0x3672('0x1c')](_0x38e808[0x0][_0x3672('0x1b')]/_0x284840)?_0x38e808[0x0][_0x3672('0x1b')]%_0x284840:0x0;_0x513f1d[_0x3672('0x1d')](function(_0x199ecc){if(_0x199ecc>0x0){_0x16d70d+=_0x284840;}_0x22af93[_0x3672('0x1e')](dbH[_0x3672('0x15')]['query'](util[_0x3672('0xd')](_0x3672('0x1f'),QUERY,_0x284840,_0x16d70d),{'type':dbH[_0x3672('0x15')][_0x3672('0x16')]['SELECT']}));});if(_0x41f44f>0x0){_0x16d70d+=_0x284840;_0x22af93[_0x3672('0x1e')](dbH[_0x3672('0x15')]['query'](util['format'](_0x3672('0x1f'),QUERY,_0x41f44f,_0x16d70d),{'type':dbH[_0x3672('0x15')][_0x3672('0x16')][_0x3672('0x17')]}));}}}else{_0x22af93[_0x3672('0x1e')](dbH[_0x3672('0x15')][_0x3672('0x20')](QUERY,{'type':dbH[_0x3672('0x15')][_0x3672('0x16')]['SELECT']}));}var _0x17f346=path['dirname'](PATH);var _0x5448d2=path[_0x3672('0x21')](PATH,_0x3672('0x22'));var _0x435253=_0x1b3274[_0x3672('0x12')]&&_0x22af93[_0x3672('0x19')]>0x1;var _0x195479=[];if(!fs[_0x3672('0x23')](path[_0x3672('0x24')](_0x17f346,_0x5448d2))&&_0x435253){fs[_0x3672('0x25')](path['join'](_0x17f346,_0x5448d2));}return BPromise[_0x3672('0x26')](_0x22af93,function(_0x3150cc){_0x195479[_0x3672('0x1e')](_0x3150cc);})[_0x3672('0x14')](function(){for(var _0x32eee1=0x0;_0x32eee1<_0x195479[_0x3672('0x19')];_0x32eee1+=0x1){var _0x353c50;var _0x3d332=_0x195479[_0x32eee1];if(_0x435253){_0x353c50=path[_0x3672('0x24')](_0x17f346,_0x5448d2,util['format'](_0x3672('0x27'),_0x5448d2,_0x32eee1,_0x3672('0x28')));}else{_0x353c50=path[_0x3672('0x24')](_0x17f346,util[_0x3672('0xd')]('%s.%s',_0x5448d2,'csv'));}fs[_0x3672('0x29')](_0x353c50,csv(_0x3d332));}})[_0x3672('0x14')](function(){if(_0x435253){return new Promise(function(_0x2cc0bf){zipdir(path[_0x3672('0x24')](_0x17f346,_0x5448d2),{'saveTo':path['join'](_0x17f346,util['format'](_0x3672('0x2a'),_0x5448d2,_0x3672('0x2b')))},function(_0x54d250,_0x410764){rimraf(path['join'](_0x17f346,_0x5448d2),function(){});_0x2cc0bf(_0x3672('0x2c'));});});}})['then'](function(){logger[_0x3672('0xc')](util[_0x3672('0xd')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x3672('0xf')));return analyticExtractedReport('Completed',_0x435253?util['format']('%s.%s',_0x5448d2,_0x435253?_0x3672('0x2b'):_0x3672('0x28')):null);});})[_0x3672('0x2d')](function(_0x618c76){logger['info'](util['format'](_0x3672('0x2e'),EXTRACTED_REPORT_ID,_0x3672('0xf')),util[_0x3672('0x2f')](_0x618c76,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x3672('0x30'));})[_0x3672('0x31')](function(){process[_0x3672('0x32')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index c061124..28db7c9 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 _0x6ae1=['pageBreak','before','landscape','\x20/\x20','footer','black','right','num','Empty','find','split','splitSizePdf','then','range','isInteger','query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','basename','.pdf','join','mkdirSync','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','%s\x20#%d','interactionId','YYYY-MM-DD','Arial','center','Interaction\x20Transcript','header','pipe','finish','error','lodash','util','path','moment','html-to-pdfmake','zip-dir','rimraf','jsdom','JSDOM','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','tableHeader','map','pick','toString','value','length','body','push','concat','chunk','keys','forEach','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s'];(function(_0x2915c1,_0x2d78fb){var _0x30062d=function(_0x4dd1cb){while(--_0x4dd1cb){_0x2915c1['push'](_0x2915c1['shift']());}};_0x30062d(++_0x2d78fb);}(_0x6ae1,0x1e5));var _0x16ae=function(_0x253d86,_0x472900){_0x253d86=_0x253d86-0x0;var _0x1c4201=_0x6ae1[_0x253d86];return _0x1c4201;};'use strict';var _=require(_0x16ae('0x0'));var fs=require('fs');var util=require(_0x16ae('0x1'));var path=require(_0x16ae('0x2'));var moment=require(_0x16ae('0x3'));var htmlToPdfmake=require(_0x16ae('0x4'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0x16ae('0x5'));var rimraf=require(_0x16ae('0x6'));var JSDOM=require(_0x16ae('0x7'))[_0x16ae('0x8')];var window=new JSDOM('')['window'];var BPromise=require('bluebird');var db=require(_0x16ae('0x9'))['db'];var dbH=require('../../mysqldb')[_0x16ae('0xa')];var logger=require(_0x16ae('0xb'))(_0x16ae('0xc'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x16ae('0xd')][0x3];var PATH=process[_0x16ae('0xd')][0x4];var NAME=process[_0x16ae('0xd')][0x5];var FORMAT=_0x16ae('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x2a4e57,_0x4236ce){var _0x2cb548={'status':_0x2a4e57};var _0x45d319={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4236ce){_0x2cb548[_0x16ae('0xf')]=_0x4236ce;}return db[_0x16ae('0x10')][_0x16ae('0x11')](_0x2cb548,_0x45d319);}function getHeaders(_0xe99950){return _['map'](_0xe99950,function(_0x288ca2){return{'text':_0x288ca2,'style':_0x16ae('0x12')};});}function getRows(_0x1be437,_0x2bcd5b){return _[_0x16ae('0x13')](_0x2bcd5b,function(_0x4b8fb2){return _(_0x4b8fb2)[_0x16ae('0x14')](_0x1be437)['map'](function(_0x1bca24){return _0x1bca24?_[_0x16ae('0x15')](_0x1bca24):'';})[_0x16ae('0x16')]();});}function createTable(_0xc1c676,_0xed3e79){var _0x2985d0={'widths':_['fill'](Array(_0xc1c676[_0x16ae('0x17')]),0x91),'heights':function(_0x2d4274){return _0x2d4274===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x380d14=getHeaders(_0xc1c676);_0x2985d0[_0x16ae('0x18')][_0x16ae('0x19')](_0x380d14);var _0x5aed17=getRows(_0xc1c676,_0xed3e79);_0x2985d0[_0x16ae('0x18')]=_0x2985d0[_0x16ae('0x18')][_0x16ae('0x1a')](_0x5aed17);return _0x2985d0;}function createTables(_0xcfe3d9){var _0x365562=[];var _0x1ca28b=_[_0x16ae('0x1b')](Object[_0x16ae('0x1c')](_0xcfe3d9[0x0]),0x5);_0x1ca28b[_0x16ae('0x1d')](function(_0x2bde31){_0x365562[_0x16ae('0x19')](createTable(_0x2bde31,_0xcfe3d9));});return _0x365562;}function getPDFDocDefinition(_0x394229){var _0x8e16c0=util['format'](_0x16ae('0x1e'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT['startDate'])['format'](FORMAT),moment(EXTRACTED_REPORT['endDate'])['format'](FORMAT));var _0x23d2ba=[];for(var _0x162421=0x0;_0x162421<_0x394229[_0x16ae('0x17')];_0x162421++){var _0x2babee=[];if(_0x162421===0x0){_0x2babee['push']({'text':_0x8e16c0,'style':'header'});}var _0x4e869c={'table':_0x394229[_0x162421]};if(_0x162421>0x0){_0x4e869c[_0x16ae('0x1f')]=_0x16ae('0x20');_0x4e869c['margin']=[0x0,0x46,0x0,0x0];}_0x2babee['push'](_0x4e869c);_0x23d2ba[_0x16ae('0x19')](_0x2babee);}return{'pageSize':'A4','pageOrientation':_0x16ae('0x21'),'content':_0x23d2ba,'footer':function(_0x5c13b9,_0x72ce1c){return{'text':_0x5c13b9[_0x16ae('0x15')]()+_0x16ae('0x22')+_0x72ce1c,'style':_0x16ae('0x23')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x16ae('0x24')},'footer':{'alignment':_0x16ae('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x1746fb){var _0x437e60=0x1388;var _0x41fd8b;if(!_0x1746fb[0x0][_0x16ae('0x26')]){return analyticExtractedReport(_0x16ae('0x27'));}return db['Setting'][_0x16ae('0x28')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x16ae('0x29'),_0x16ae('0x2a')]})[_0x16ae('0x2b')](function(_0x3fe9e5){if(_0x3fe9e5){_0x41fd8b=_0x3fe9e5;_0x437e60=_0x41fd8b[_0x16ae('0x2a')]||0x3e8;}})['then'](function(){var _0x14ae93=[];var _0x2a5230=0x0;if(_0x41fd8b[_0x16ae('0x29')]){if(_0x1746fb&&_0x1746fb[_0x16ae('0x17')]){var _0x132b2f=_[_0x16ae('0x2c')](_0x1746fb[0x0][_0x16ae('0x26')]/_0x437e60);var _0x3bf17a=Number[_0x16ae('0x2d')](_0x1746fb[0x0][_0x16ae('0x26')]/_0x437e60)?_0x1746fb[0x0]['num']%_0x437e60:0x0;_0x132b2f[_0x16ae('0x1d')](function(_0x4629fb){if(_0x4629fb>0x0){_0x2a5230+=_0x437e60;}_0x14ae93['push'](dbH['sequelize'][_0x16ae('0x2e')](util[_0x16ae('0x2f')](_0x16ae('0x30'),QUERY,_0x437e60,_0x2a5230),{'type':dbH[_0x16ae('0x31')][_0x16ae('0x32')][_0x16ae('0x33')]}));});if(_0x3bf17a>0x0){_0x2a5230+=_0x437e60;_0x14ae93[_0x16ae('0x19')](dbH[_0x16ae('0x31')][_0x16ae('0x2e')](util['format'](_0x16ae('0x30'),QUERY,_0x3bf17a,_0x2a5230),{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}}else{_0x14ae93[_0x16ae('0x19')](dbH[_0x16ae('0x31')][_0x16ae('0x2e')](QUERY,{'type':dbH['sequelize'][_0x16ae('0x32')][_0x16ae('0x33')]}));}var _0x357d94=path['dirname'](PATH);var _0x5d372b=path[_0x16ae('0x34')](PATH,_0x16ae('0x35'));var _0x5e403e=_0x41fd8b[_0x16ae('0x29')]&&_0x14ae93[_0x16ae('0x17')]>0x1;var _0x1c36b2=[];if(!fs['existsSync'](path[_0x16ae('0x36')](_0x357d94,_0x5d372b))&&_0x5e403e){fs[_0x16ae('0x37')](path[_0x16ae('0x36')](_0x357d94,_0x5d372b));}return BPromise[_0x16ae('0x38')](_0x14ae93,function(_0x4a6d83){_0x1c36b2[_0x16ae('0x19')](_0x4a6d83);})[_0x16ae('0x2b')](function(){var _0x4877a6=[];for(var _0x11b1a0=0x0;_0x11b1a0<_0x1c36b2[_0x16ae('0x17')];_0x11b1a0+=0x1){var _0x4785ab=_0x1c36b2[_0x11b1a0];var _0x3e27b9=createTables(_[_0x16ae('0x39')](_0x4785ab));var _0x333fde;var _0x475bec=getPDFDocDefinition(_0x3e27b9);var _0x2ffa3a=getPDFPrinter();var _0x424611=_0x2ffa3a[_0x16ae('0x3a')](_0x475bec);if(_0x5e403e){_0x333fde=path[_0x16ae('0x36')](_0x357d94,_0x5d372b,util[_0x16ae('0x2f')](_0x16ae('0x3b'),_0x5d372b,_0x11b1a0,_0x16ae('0x3c')));}else{_0x333fde=path[_0x16ae('0x36')](_0x357d94,util[_0x16ae('0x2f')](_0x16ae('0x3d'),_0x5d372b,_0x16ae('0x3c')));}_0x4877a6[_0x16ae('0x19')](writePDFDocument(_0x424611,_0x333fde));}return Promise['all'](_0x4877a6);})[_0x16ae('0x2b')](function(){if(_0x5e403e){return new Promise(function(_0x31f4d9){zipdir(path[_0x16ae('0x36')](_0x357d94,_0x5d372b),{'saveTo':path['join'](_0x357d94,util[_0x16ae('0x2f')](_0x16ae('0x3d'),_0x5d372b,'zip'))},function(){rimraf(path[_0x16ae('0x36')](_0x357d94,_0x5d372b),function(){});_0x31f4d9(_0x16ae('0x3e'));});});}})[_0x16ae('0x2b')](function(){if(!_0x5e403e)return;rimraf(path['join'](_0x357d94,_0x5d372b),function(){});})[_0x16ae('0x2b')](function(){logger[_0x16ae('0x3f')](util['format'](_0x16ae('0x40'),EXTRACTED_REPORT_ID,_0x16ae('0x41')));return analyticExtractedReport(_0x16ae('0x42'),_0x5e403e?util[_0x16ae('0x2f')](_0x16ae('0x3d'),_0x5d372b,_0x5e403e?_0x16ae('0x43'):_0x16ae('0x3c')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x16ae('0x3f')](util['format'](_0x16ae('0x44'),EXTRACTED_REPORT_ID,'PDF'));return db['AnalyticExtractedReport']['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x5bc3f0){EXTRACTED_REPORT=_0x5bc3f0;return dbH['sequelize']['query'](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x16ae('0x31')][_0x16ae('0x32')][_0x16ae('0x33')]});})[_0x16ae('0x2b')](extractReport)[_0x16ae('0x45')](function(_0x3d09bc){logger[_0x16ae('0x3f')](util[_0x16ae('0x2f')](_0x16ae('0x46'),EXTRACTED_REPORT_ID,_0x16ae('0x41')),util[_0x16ae('0x47')](_0x3d09bc,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x16ae('0x48'));})['finally'](function(){process[_0x16ae('0x49')](EXIT_CODE);});}main();function getPDFPrinter(){var _0xca5301=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x16ae('0x4a'),'italics':__dirname+_0x16ae('0x4b'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0xca5301;}function getPDFDocDefinitionFromHTML(_0x32d5d0,_0x4d3bf4){var _0x10dc1d=util[_0x16ae('0x2f')](_0x16ae('0x4c'),_0x4d3bf4['channel'],_0x4d3bf4[_0x16ae('0x4d')]);var _0x4393b4=moment()[_0x16ae('0x2f')](_0x16ae('0x4e'))[_0x16ae('0x15')]();var _0x2649d8=htmlToPdfmake(_0x32d5d0,{'window':window,'tableAutoSize':!![]});return{'content':[_0x2649d8],'defaultStyle':{'font':_0x16ae('0x4f')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x16ae('0x50')}},'header':function(){return[{'text':_0x16ae('0x51'),'style':_0x16ae('0x52')}];},'footer':function(_0x4b15b1,_0x5bcdb8){return[{'text':util[_0x16ae('0x2f')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x10dc1d,_0x4b15b1,_0x5bcdb8,_0x4393b4),'style':_0x16ae('0x23')}];}};}function writePDFDocument(_0x654bf5,_0x4f41ea){return new Promise(function(_0x439ed0,_0x4fdea3){var _0x24085d=_0x654bf5[_0x16ae('0x53')](fs['createWriteStream'](_0x4f41ea));_0x24085d['on'](_0x16ae('0x54'),function(){_0x439ed0(_0x16ae('0x54'));});_0x24085d['on'](_0x16ae('0x55'),function(_0x4b8878){_0x4fdea3(_0x4b8878);});_0x654bf5['end']();});}exports['createPdfFromHTML']=function(_0x8ad27b,_0x4cef91){var _0x468cb5=getPDFPrinter();var _0x10fcaa=getPDFDocDefinitionFromHTML(_0x8ad27b,_0x4cef91);var _0x2f0455=_0x468cb5[_0x16ae('0x3a')](_0x10fcaa);return writePDFDocument(_0x2f0455,_0x4cef91[_0x16ae('0x2')])[_0x16ae('0x45')](function(_0x4efa72){throw _0x4efa72;});}; \ No newline at end of file +var _0x0aac=['landscape','Arial','right','num','Empty','Setting','split','then','splitSizePdf','range','isInteger','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','query','dirname','.pdf','join','mkdirSync','each','flatten','createPdfKitDocument','%s.%s','pdf','all','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','catch','util','path','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','tableHeader','pick','map','toString','value','fill','length','body','push','concat','keys','forEach','format','name','startDate','endDate','header','pageBreak','before','margin'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0aac,0xea));var _0xc0aa=function(_0x1fddaf,_0x1968d7){_0x1fddaf=_0x1fddaf-0x0;var _0x22283d=_0x0aac[_0x1fddaf];return _0x22283d;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0xc0aa('0x0'));var path=require(_0xc0aa('0x1'));var moment=require('moment');var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0xc0aa('0x2'));var zipdir=require(_0xc0aa('0x3'));var rimraf=require(_0xc0aa('0x4'));var JSDOM=require(_0xc0aa('0x5'))[_0xc0aa('0x6')];var window=new JSDOM('')[_0xc0aa('0x7')];var BPromise=require('bluebird');var db=require(_0xc0aa('0x8'))['db'];var dbH=require(_0xc0aa('0x8'))[_0xc0aa('0x9')];var logger=require(_0xc0aa('0xa'))(_0xc0aa('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0xc0aa('0xc')][0x2]);var QUERY=process[_0xc0aa('0xc')][0x3];var PATH=process[_0xc0aa('0xc')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xc0aa('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x40e481,_0xb22afc){var _0x4ccba1={'status':_0x40e481};var _0x1ede48={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xb22afc){_0x4ccba1[_0xc0aa('0xe')]=_0xb22afc;}return db[_0xc0aa('0xf')]['update'](_0x4ccba1,_0x1ede48);}function getHeaders(_0x518ca3){return _['map'](_0x518ca3,function(_0xf615b9){return{'text':_0xf615b9,'style':_0xc0aa('0x10')};});}function getRows(_0x53f123,_0x36acfe){return _['map'](_0x36acfe,function(_0x474425){return _(_0x474425)[_0xc0aa('0x11')](_0x53f123)[_0xc0aa('0x12')](function(_0x2ea606){return _0x2ea606?_[_0xc0aa('0x13')](_0x2ea606):'';})[_0xc0aa('0x14')]();});}function createTable(_0x38deeb,_0x3ee1c8){var _0x1ea8a0={'widths':_[_0xc0aa('0x15')](Array(_0x38deeb[_0xc0aa('0x16')]),0x91),'heights':function(_0x7ddd8f){return _0x7ddd8f===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3ab895=getHeaders(_0x38deeb);_0x1ea8a0[_0xc0aa('0x17')][_0xc0aa('0x18')](_0x3ab895);var _0x280e3b=getRows(_0x38deeb,_0x3ee1c8);_0x1ea8a0['body']=_0x1ea8a0[_0xc0aa('0x17')][_0xc0aa('0x19')](_0x280e3b);return _0x1ea8a0;}function createTables(_0x419eef){var _0xebd6c7=[];var _0x585a9c=_['chunk'](Object[_0xc0aa('0x1a')](_0x419eef[0x0]),0x5);_0x585a9c[_0xc0aa('0x1b')](function(_0xe9ce68){_0xebd6c7['push'](createTable(_0xe9ce68,_0x419eef));});return _0xebd6c7;}function getPDFDocDefinition(_0x6d4dea){var _0x56675c=util[_0xc0aa('0x1c')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0xc0aa('0x1d')],moment(EXTRACTED_REPORT[_0xc0aa('0x1e')])[_0xc0aa('0x1c')](FORMAT),moment(EXTRACTED_REPORT[_0xc0aa('0x1f')])[_0xc0aa('0x1c')](FORMAT));var _0x1e0156=[];for(var _0x109167=0x0;_0x109167<_0x6d4dea[_0xc0aa('0x16')];_0x109167++){var _0x5d690e=[];if(_0x109167===0x0){_0x5d690e[_0xc0aa('0x18')]({'text':_0x56675c,'style':_0xc0aa('0x20')});}var _0xc7cc50={'table':_0x6d4dea[_0x109167]};if(_0x109167>0x0){_0xc7cc50[_0xc0aa('0x21')]=_0xc0aa('0x22');_0xc7cc50[_0xc0aa('0x23')]=[0x0,0x46,0x0,0x0];}_0x5d690e[_0xc0aa('0x18')](_0xc7cc50);_0x1e0156['push'](_0x5d690e);}return{'pageSize':'A4','pageOrientation':_0xc0aa('0x24'),'content':_0x1e0156,'footer':function(_0x3cada1,_0x562fd4){return{'text':_0x3cada1['toString']()+'\x20/\x20'+_0x562fd4,'style':'footer'};},'defaultStyle':{'font':_0xc0aa('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0xc0aa('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x4084d0){var _0x2ac09f=0x1388;var _0x3c28fa;if(!_0x4084d0[0x0][_0xc0aa('0x27')]){return analyticExtractedReport(_0xc0aa('0x28'));}return db[_0xc0aa('0x29')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xc0aa('0x2a'),'splitSizePdf']})[_0xc0aa('0x2b')](function(_0x5d1813){if(_0x5d1813){_0x3c28fa=_0x5d1813;_0x2ac09f=_0x3c28fa[_0xc0aa('0x2c')]||0x3e8;}})['then'](function(){var _0xf24144=[];var _0x1d06f5=0x0;if(_0x3c28fa[_0xc0aa('0x2a')]){if(_0x4084d0&&_0x4084d0[_0xc0aa('0x16')]){var _0x53db57=_[_0xc0aa('0x2d')](_0x4084d0[0x0]['num']/_0x2ac09f);var _0x293a1b=Number[_0xc0aa('0x2e')](_0x4084d0[0x0][_0xc0aa('0x27')]/_0x2ac09f)?_0x4084d0[0x0][_0xc0aa('0x27')]%_0x2ac09f:0x0;_0x53db57[_0xc0aa('0x1b')](function(_0x43156d){if(_0x43156d>0x0){_0x1d06f5+=_0x2ac09f;}_0xf24144['push'](dbH[_0xc0aa('0x2f')]['query'](util['format'](_0xc0aa('0x30'),QUERY,_0x2ac09f,_0x1d06f5),{'type':dbH[_0xc0aa('0x2f')][_0xc0aa('0x31')][_0xc0aa('0x32')]}));});if(_0x293a1b>0x0){_0x1d06f5+=_0x2ac09f;_0xf24144[_0xc0aa('0x18')](dbH['sequelize']['query'](util['format'](_0xc0aa('0x30'),QUERY,_0x293a1b,_0x1d06f5),{'type':dbH[_0xc0aa('0x2f')][_0xc0aa('0x31')]['SELECT']}));}}}else{_0xf24144[_0xc0aa('0x18')](dbH[_0xc0aa('0x2f')][_0xc0aa('0x33')](QUERY,{'type':dbH[_0xc0aa('0x2f')][_0xc0aa('0x31')][_0xc0aa('0x32')]}));}var _0x43a146=path[_0xc0aa('0x34')](PATH);var _0x35558c=path['basename'](PATH,_0xc0aa('0x35'));var _0x4d8458=_0x3c28fa[_0xc0aa('0x2a')]&&_0xf24144[_0xc0aa('0x16')]>0x1;var _0x3d0a39=[];if(!fs['existsSync'](path[_0xc0aa('0x36')](_0x43a146,_0x35558c))&&_0x4d8458){fs[_0xc0aa('0x37')](path['join'](_0x43a146,_0x35558c));}return BPromise[_0xc0aa('0x38')](_0xf24144,function(_0x2ee8f6){_0x3d0a39[_0xc0aa('0x18')](_0x2ee8f6);})['then'](function(){var _0x491d4d=[];for(var _0x81715e=0x0;_0x81715e<_0x3d0a39[_0xc0aa('0x16')];_0x81715e+=0x1){var _0x430948=_0x3d0a39[_0x81715e];var _0xaa32bb=createTables(_[_0xc0aa('0x39')](_0x430948));var _0xff1ac6;var _0xdc2840=getPDFDocDefinition(_0xaa32bb);var _0x3eadc6=getPDFPrinter();var _0x5189f3=_0x3eadc6[_0xc0aa('0x3a')](_0xdc2840);if(_0x4d8458){_0xff1ac6=path[_0xc0aa('0x36')](_0x43a146,_0x35558c,util[_0xc0aa('0x1c')]('%s%d.%s',_0x35558c,_0x81715e,'pdf'));}else{_0xff1ac6=path[_0xc0aa('0x36')](_0x43a146,util[_0xc0aa('0x1c')](_0xc0aa('0x3b'),_0x35558c,_0xc0aa('0x3c')));}_0x491d4d[_0xc0aa('0x18')](writePDFDocument(_0x5189f3,_0xff1ac6));}return Promise[_0xc0aa('0x3d')](_0x491d4d);})[_0xc0aa('0x2b')](function(){if(_0x4d8458){return new Promise(function(_0x3b0328){zipdir(path['join'](_0x43a146,_0x35558c),{'saveTo':path['join'](_0x43a146,util[_0xc0aa('0x1c')](_0xc0aa('0x3b'),_0x35558c,'zip'))},function(){rimraf(path[_0xc0aa('0x36')](_0x43a146,_0x35558c),function(){});_0x3b0328(_0xc0aa('0x3e'));});});}})[_0xc0aa('0x2b')](function(){if(!_0x4d8458)return;rimraf(path[_0xc0aa('0x36')](_0x43a146,_0x35558c),function(){});})['then'](function(){logger[_0xc0aa('0x3f')](util['format'](_0xc0aa('0x40'),EXTRACTED_REPORT_ID,_0xc0aa('0x41')));return analyticExtractedReport(_0xc0aa('0x42'),_0x4d8458?util[_0xc0aa('0x1c')]('%s.%s',_0x35558c,_0x4d8458?_0xc0aa('0x43'):_0xc0aa('0x3c')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xc0aa('0x3f')](util[_0xc0aa('0x1c')](_0xc0aa('0x44'),EXTRACTED_REPORT_ID,_0xc0aa('0x41')));return db['AnalyticExtractedReport']['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xc0aa('0x2b')](function(_0x307c8e){EXTRACTED_REPORT=_0x307c8e;return dbH[_0xc0aa('0x2f')][_0xc0aa('0x33')](util[_0xc0aa('0x1c')](_0xc0aa('0x45'),QUERY),{'type':dbH[_0xc0aa('0x2f')][_0xc0aa('0x31')][_0xc0aa('0x32')]});})['then'](extractReport)['catch'](function(_0x20f3f6){logger['info'](util[_0xc0aa('0x1c')](_0xc0aa('0x46'),EXTRACTED_REPORT_ID,_0xc0aa('0x41')),util[_0xc0aa('0x47')](_0x20f3f6,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xc0aa('0x48'));})[_0xc0aa('0x49')](function(){process[_0xc0aa('0x4a')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x4da765=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0xc0aa('0x4b'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x4da765;}function getPDFDocDefinitionFromHTML(_0x5d2216,_0x543459){var _0x55ed10=util[_0xc0aa('0x1c')](_0xc0aa('0x4c'),_0x543459[_0xc0aa('0x4d')],_0x543459[_0xc0aa('0x4e')]);var _0xf04ef9=moment()[_0xc0aa('0x1c')](_0xc0aa('0x4f'))[_0xc0aa('0x13')]();var _0x16e357=htmlToPdfmake(_0x5d2216,{'window':window,'tableAutoSize':!![]});return{'content':[_0x16e357],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xc0aa('0x50'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xc0aa('0x50')}},'header':function(){return[{'text':_0xc0aa('0x51'),'style':_0xc0aa('0x20')}];},'footer':function(_0x5610ad,_0x2d3938){return[{'text':util[_0xc0aa('0x1c')](_0xc0aa('0x52'),_0x55ed10,_0x5610ad,_0x2d3938,_0xf04ef9),'style':'footer'}];}};}function writePDFDocument(_0x32ffdb,_0x4ec335){return new Promise(function(_0x4290c0,_0x1680e8){var _0x48ed16=_0x32ffdb[_0xc0aa('0x53')](fs[_0xc0aa('0x54')](_0x4ec335));_0x48ed16['on']('finish',function(){_0x4290c0(_0xc0aa('0x55'));});_0x48ed16['on'](_0xc0aa('0x56'),function(_0x2edf27){_0x1680e8(_0x2edf27);});_0x32ffdb[_0xc0aa('0x57')]();});}exports[_0xc0aa('0x58')]=function(_0x31b276,_0x1db5b){var _0xcd5157=getPDFPrinter();var _0x5e232d=getPDFDocDefinitionFromHTML(_0x31b276,_0x1db5b);var _0x2ac03a=_0xcd5157[_0xc0aa('0x3a')](_0x5e232d);return writePDFDocument(_0x2ac03a,_0x1db5b['path'])[_0xc0aa('0x59')](function(_0x13aa04){throw _0x13aa04;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index a988833..8b376dc 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 _0x9679=['sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','then','length','range','num','isInteger','forEach','push','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','binary','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','%s.%s','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx'];(function(_0x36b9e7,_0xde358c){var _0xfbe4b5=function(_0x53f7e4){while(--_0x53f7e4){_0x36b9e7['push'](_0x36b9e7['shift']());}};_0xfbe4b5(++_0xde358c);}(_0x9679,0x15f));var _0x9967=function(_0x1a9c6a,_0x120d48){_0x1a9c6a=_0x1a9c6a-0x0;var _0x246e51=_0x9679[_0x1a9c6a];return _0x246e51;};'use strict';var util=require(_0x9967('0x0'));var path=require('path');var _=require('lodash');var fs=require('fs');var json2xls=require(_0x9967('0x1'));var BPromise=require(_0x9967('0x2'));var zipdir=require(_0x9967('0x3'));var rimraf=require(_0x9967('0x4'));var db=require(_0x9967('0x5'))['db'];var dbH=require(_0x9967('0x5'))[_0x9967('0x6')];var logger=require(_0x9967('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x9967('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x37b5d2,_0x4e5ed5){var _0x425d2a={'status':_0x37b5d2};var _0x47c431={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4e5ed5){_0x425d2a[_0x9967('0x9')]=_0x4e5ed5;}return db[_0x9967('0xa')][_0x9967('0xb')](_0x425d2a,_0x47c431);}function main(){var _0x2977f7=0x1388;var _0xff4630;logger[_0x9967('0xc')](util[_0x9967('0xd')](_0x9967('0xe'),EXTRACTED_REPORT_ID,_0x9967('0xf')));return db[_0x9967('0x10')][_0x9967('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9967('0x12'),_0x9967('0x13')]})['then'](function(_0x462ea9){if(_0x462ea9){_0xff4630=_0x462ea9;_0x2977f7=_0xff4630['splitSizeXlsx']||0x1388;}})['then'](function(){return dbH[_0x9967('0x14')][_0x9967('0x15')](util[_0x9967('0xd')](_0x9967('0x16'),QUERY),{'type':dbH[_0x9967('0x14')][_0x9967('0x17')]['SELECT']});})[_0x9967('0x18')](function(_0x1c8e9b){if(!_0x1c8e9b[0x0]['num']){return analyticExtractedReport('Empty');}var _0x58dad0=[];var _0x4e0687=0x0;if(_0xff4630[_0x9967('0x12')]){if(_0x1c8e9b&&_0x1c8e9b[_0x9967('0x19')]){var _0xcb403=_[_0x9967('0x1a')](_0x1c8e9b[0x0][_0x9967('0x1b')]/_0x2977f7);var _0xa1bd8e=Number[_0x9967('0x1c')](_0x1c8e9b[0x0][_0x9967('0x1b')]/_0x2977f7)?_0x1c8e9b[0x0][_0x9967('0x1b')]%_0x2977f7:0x0;_0xcb403[_0x9967('0x1d')](function(_0x3f351c){if(_0x3f351c>0x0){_0x4e0687+=_0x2977f7;}_0x58dad0[_0x9967('0x1e')](dbH[_0x9967('0x14')][_0x9967('0x15')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2977f7,_0x4e0687),{'type':dbH[_0x9967('0x14')][_0x9967('0x17')][_0x9967('0x1f')]}));});if(_0xa1bd8e>0x0){_0x4e0687+=_0x2977f7;_0x58dad0[_0x9967('0x1e')](dbH[_0x9967('0x14')][_0x9967('0x15')](util['format'](_0x9967('0x20'),QUERY,_0xa1bd8e,_0x4e0687),{'type':dbH[_0x9967('0x14')]['QueryTypes'][_0x9967('0x1f')]}));}}}else{_0x58dad0[_0x9967('0x1e')](dbH[_0x9967('0x14')]['query'](QUERY,{'type':dbH['sequelize'][_0x9967('0x17')]['SELECT']}));}var _0x4fd16c=path['dirname'](PATH);var _0x34595a=path[_0x9967('0x21')](PATH,_0x9967('0x22'));var _0x3f601f=_0xff4630[_0x9967('0x12')]&&_0x58dad0[_0x9967('0x19')]>0x1;var _0x17f2f3=[];if(!fs[_0x9967('0x23')](path[_0x9967('0x24')](_0x4fd16c,_0x34595a))&&_0x3f601f){fs[_0x9967('0x25')](path[_0x9967('0x24')](_0x4fd16c,_0x34595a));}return BPromise[_0x9967('0x26')](_0x58dad0,function(_0xe183df){_0x17f2f3[_0x9967('0x1e')](_0xe183df);})[_0x9967('0x18')](function(){for(var _0x237ba8=0x0;_0x237ba8<_0x17f2f3[_0x9967('0x19')];_0x237ba8+=0x1){var _0x7a6574;var _0x53f738=_0x17f2f3[_0x237ba8];if(_0x3f601f){_0x7a6574=path[_0x9967('0x24')](_0x4fd16c,_0x34595a,util[_0x9967('0xd')](_0x9967('0x27'),_0x34595a,_0x237ba8,_0x9967('0x28')));}else{_0x7a6574=path[_0x9967('0x24')](_0x4fd16c,util['format']('%s.%s',_0x34595a,_0x9967('0x28')));}fs['writeFileSync'](_0x7a6574,json2xls(_0x53f738),_0x9967('0x29'));}})[_0x9967('0x18')](function(){if(_0x3f601f){return new Promise(function(_0x402b1a){zipdir(path[_0x9967('0x24')](_0x4fd16c,_0x34595a),{'saveTo':path[_0x9967('0x24')](_0x4fd16c,util[_0x9967('0xd')]('%s.%s',_0x34595a,'zip'))},function(_0x53c0de,_0x518f0e){rimraf(path[_0x9967('0x24')](_0x4fd16c,_0x34595a),function(){});_0x402b1a(_0x9967('0x2a'));});});}})[_0x9967('0x18')](function(){logger['info'](util[_0x9967('0xd')](_0x9967('0x2b'),EXTRACTED_REPORT_ID,_0x9967('0xf')));return analyticExtractedReport(_0x9967('0x2c'),_0x3f601f?util['format'](_0x9967('0x2d'),_0x34595a,_0x3f601f?_0x9967('0x2e'):'xlsx'):null);});})[_0x9967('0x2f')](function(_0x2f5a31){logger[_0x9967('0xc')](util[_0x9967('0xd')](_0x9967('0x30'),EXTRACTED_REPORT_ID,_0x9967('0xf')),util[_0x9967('0x31')](_0x2f5a31,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x9967('0x32'));})[_0x9967('0x33')](function(){process[_0x9967('0x34')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xf619=['../../config/logger','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','split','length','range','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.xlsx','existsSync','join','each','%s%d.%s','xlsx','%s.%s','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','path','json2xls','bluebird','zip-dir','rimraf','dbH'];(function(_0x213364,_0x1c96b6){var _0x46b6d5=function(_0x14e023){while(--_0x14e023){_0x213364['push'](_0x213364['shift']());}};_0x46b6d5(++_0x1c96b6);}(_0xf619,0x17a));var _0x9f61=function(_0x1bdc9f,_0x1841e8){_0x1bdc9f=_0x1bdc9f-0x0;var _0x4c9976=_0xf619[_0x1bdc9f];return _0x4c9976;};'use strict';var util=require('util');var path=require(_0x9f61('0x0'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0x9f61('0x1'));var BPromise=require(_0x9f61('0x2'));var zipdir=require(_0x9f61('0x3'));var rimraf=require(_0x9f61('0x4'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x9f61('0x5')];var logger=require(_0x9f61('0x6'))(_0x9f61('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x9f61('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x9f61('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3d7600,_0x559bdd){var _0x43cfb1={'status':_0x3d7600};var _0x15771d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x559bdd){_0x43cfb1[_0x9f61('0x9')]=_0x559bdd;}return db['AnalyticExtractedReport'][_0x9f61('0xa')](_0x43cfb1,_0x15771d);}function main(){var _0x398a56=0x1388;var _0x56f018;logger[_0x9f61('0xb')](util[_0x9f61('0xc')](_0x9f61('0xd'),EXTRACTED_REPORT_ID,_0x9f61('0xe')));return db[_0x9f61('0xf')][_0x9f61('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x9f61('0x11')]})['then'](function(_0x582dad){if(_0x582dad){_0x56f018=_0x582dad;_0x398a56=_0x56f018['splitSizeXlsx']||0x1388;}})[_0x9f61('0x12')](function(){return dbH['sequelize'][_0x9f61('0x13')](util['format'](_0x9f61('0x14'),QUERY),{'type':dbH[_0x9f61('0x15')][_0x9f61('0x16')][_0x9f61('0x17')]});})[_0x9f61('0x12')](function(_0x125038){if(!_0x125038[0x0][_0x9f61('0x18')]){return analyticExtractedReport(_0x9f61('0x19'));}var _0x279ebb=[];var _0x350349=0x0;if(_0x56f018[_0x9f61('0x1a')]){if(_0x125038&&_0x125038[_0x9f61('0x1b')]){var _0x14bf6c=_[_0x9f61('0x1c')](_0x125038[0x0][_0x9f61('0x18')]/_0x398a56);var _0x12a567=Number[_0x9f61('0x1d')](_0x125038[0x0]['num']/_0x398a56)?_0x125038[0x0][_0x9f61('0x18')]%_0x398a56:0x0;_0x14bf6c['forEach'](function(_0x101458){if(_0x101458>0x0){_0x350349+=_0x398a56;}_0x279ebb[_0x9f61('0x1e')](dbH[_0x9f61('0x15')][_0x9f61('0x13')](util[_0x9f61('0xc')](_0x9f61('0x1f'),QUERY,_0x398a56,_0x350349),{'type':dbH[_0x9f61('0x15')][_0x9f61('0x16')][_0x9f61('0x17')]}));});if(_0x12a567>0x0){_0x350349+=_0x398a56;_0x279ebb[_0x9f61('0x1e')](dbH[_0x9f61('0x15')][_0x9f61('0x13')](util[_0x9f61('0xc')](_0x9f61('0x1f'),QUERY,_0x12a567,_0x350349),{'type':dbH['sequelize'][_0x9f61('0x16')][_0x9f61('0x17')]}));}}}else{_0x279ebb[_0x9f61('0x1e')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x9f61('0x15')][_0x9f61('0x16')]['SELECT']}));}var _0x3b240f=path['dirname'](PATH);var _0x55b768=path[_0x9f61('0x20')](PATH,_0x9f61('0x21'));var _0x5eb9d4=_0x56f018[_0x9f61('0x1a')]&&_0x279ebb[_0x9f61('0x1b')]>0x1;var _0x3dadb9=[];if(!fs[_0x9f61('0x22')](path['join'](_0x3b240f,_0x55b768))&&_0x5eb9d4){fs['mkdirSync'](path[_0x9f61('0x23')](_0x3b240f,_0x55b768));}return BPromise[_0x9f61('0x24')](_0x279ebb,function(_0x469579){_0x3dadb9['push'](_0x469579);})['then'](function(){for(var _0x3ee78b=0x0;_0x3ee78b<_0x3dadb9[_0x9f61('0x1b')];_0x3ee78b+=0x1){var _0x401c94;var _0x858565=_0x3dadb9[_0x3ee78b];if(_0x5eb9d4){_0x401c94=path['join'](_0x3b240f,_0x55b768,util['format'](_0x9f61('0x25'),_0x55b768,_0x3ee78b,_0x9f61('0x26')));}else{_0x401c94=path[_0x9f61('0x23')](_0x3b240f,util[_0x9f61('0xc')](_0x9f61('0x27'),_0x55b768,'xlsx'));}fs['writeFileSync'](_0x401c94,json2xls(_0x858565),'binary');}})[_0x9f61('0x12')](function(){if(_0x5eb9d4){return new Promise(function(_0x23629a){zipdir(path[_0x9f61('0x23')](_0x3b240f,_0x55b768),{'saveTo':path['join'](_0x3b240f,util[_0x9f61('0xc')](_0x9f61('0x27'),_0x55b768,'zip'))},function(_0x133e62,_0x599d09){rimraf(path[_0x9f61('0x23')](_0x3b240f,_0x55b768),function(){});_0x23629a(_0x9f61('0x28'));});});}})[_0x9f61('0x12')](function(){logger['info'](util[_0x9f61('0xc')](_0x9f61('0x29'),EXTRACTED_REPORT_ID,_0x9f61('0xe')));return analyticExtractedReport('Completed',_0x5eb9d4?util[_0x9f61('0xc')](_0x9f61('0x27'),_0x55b768,_0x5eb9d4?'zip':_0x9f61('0x26')):null);});})[_0x9f61('0x2a')](function(_0x2c0df5){logger[_0x9f61('0xb')](util[_0x9f61('0xc')](_0x9f61('0x2b'),EXTRACTED_REPORT_ID,_0x9f61('0xe')),util[_0x9f61('0x2c')](_0x2c0df5,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x9f61('0x2d'));})[_0x9f61('0x2e')](function(){process[_0x9f61('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index ac8ff9b..acb85dd 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 _0x3e81=['then','intervals','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','inbound','outbound','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','Hangup','concat','transaction','destroy','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll'];(function(_0x69e86e,_0xeb4dd0){var _0x9ca23a=function(_0x392875){while(--_0x392875){_0x69e86e['push'](_0x69e86e['shift']());}};_0x9ca23a(++_0xeb4dd0);}(_0x3e81,0x8f));var _0x13e8=function(_0x258c47,_0x864edd){_0x258c47=_0x258c47-0x0;var _0x239d3a=_0x3e81[_0x258c47];return _0x239d3a;};'use strict';var _=require(_0x13e8('0x0'));var util=require(_0x13e8('0x1'));function rewrite(_0x3cbc55,_0x38dd9c){var _0x16d85a=this;return _0x3cbc55[_0x13e8('0x2')][_0x13e8('0x3')][_0x13e8('0x4')]({'raw':!![]})[_0x13e8('0x5')](function(_0x59da02){_0x16d85a[_0x13e8('0x6')]=_0x59da02;return _0x3cbc55['models'][_0x13e8('0x7')]['findAll']({'where':{'IntervalId':_0x38dd9c[_0x13e8('0x8')]},'raw':!![]});})[_0x13e8('0x5')](function(_0x2dbc70){return _0x3cbc55['models'][_0x13e8('0x7')]['findAll']({'where':{'exten':{'$in':_[_0x13e8('0x9')](_[_0x13e8('0xa')](_0x2dbc70,_0x13e8('0xb')))}},'order':[{'raw':_0x13e8('0xc')}],'raw':!![]});})[_0x13e8('0x5')](function(_0x4b57d3){var _0x30ae0e=_['filter'](_0x4b57d3,{'priority':'1'});var _0x3fcccf=_[_0x13e8('0xd')](_0x4b57d3,{'isApp':0x1});var _0x2966d5=_[_0x13e8('0xe')](_0x3fcccf,_0x13e8('0xb'));var _0x2acfbc=[_0x13e8('0xf'),_0x13e8('0x10')];var _0x1e01b3=[];var _0x189785=[];for(var _0x5010e4 in _0x2966d5){if(_0x2966d5[_0x13e8('0x11')](_0x5010e4)){_0x16d85a[_0x13e8('0x12')]=0x2;_0x16d85a[_0x13e8('0x13')]=[];_0x16d85a[_0x13e8('0x14')]=_[_0x13e8('0x15')](_0x30ae0e,{'exten':_0x2966d5[_0x5010e4][0x0][_0x13e8('0xb')]});_0x16d85a['extensions'][_0x13e8('0x16')]({'type':_0x2966d5[_0x5010e4][0x0][_0x13e8('0x17')],'app':_0x13e8('0x18'),'appdata':util[_0x13e8('0x19')](_0x13e8('0x1a'),_0x2966d5[_0x5010e4][0x0]['type']),'context':_0x2966d5[_0x5010e4][0x0][_0x13e8('0x1b')],'exten':_0x2966d5[_0x5010e4][0x0]['exten'],'priority':_0x16d85a[_0x13e8('0x12')]++,'VoiceExtensionId':_0x2966d5[_0x5010e4][0x0][_0x13e8('0x1c')]});if(_0x2966d5[_0x5010e4][0x0]['type']===_0x13e8('0x1d')){_0x16d85a[_0x13e8('0x13')][_0x13e8('0x16')]({'type':_0x2966d5[_0x5010e4][0x0]['type'],'app':_0x13e8('0x18'),'appdata':'CDR(routeid)='+_0x2966d5[_0x5010e4][0x0]['VoiceExtensionId'],'context':_0x2966d5[_0x5010e4][0x0][_0x13e8('0x1b')],'exten':_0x2966d5[_0x5010e4][0x0][_0x13e8('0xb')],'priority':_0x16d85a['priority']++,'VoiceExtensionId':_0x2966d5[_0x5010e4][0x0][_0x13e8('0x1c')]});}else if(_0x2966d5[_0x5010e4][0x0]['type']===_0x13e8('0x1e')){if(_0x16d85a[_0x13e8('0x14')]){_0x16d85a[_0x13e8('0x13')]['push']({'type':_0x2966d5[_0x5010e4][0x0][_0x13e8('0x17')],'app':_0x13e8('0x18'),'appdata':_0x13e8('0x1f')+(_0x16d85a[_0x13e8('0x14')]['cutdigits']?_0x13e8('0x20')+_0x16d85a[_0x13e8('0x14')][_0x13e8('0x21')]+'}':_0x13e8('0x22')),'context':_0x2966d5[_0x5010e4][0x0][_0x13e8('0x1b')],'exten':_0x2966d5[_0x5010e4][0x0][_0x13e8('0xb')],'priority':_0x16d85a[_0x13e8('0x12')]++,'VoiceExtensionId':_0x2966d5[_0x5010e4][0x0][_0x13e8('0x1c')]});}_0x16d85a['extensions'][_0x13e8('0x16')]({'type':_0x2966d5[_0x5010e4][0x0][_0x13e8('0x17')],'app':'Set','appdata':'CDR(routeid)='+_0x2966d5[_0x5010e4][0x0][_0x13e8('0x1c')],'context':_0x2966d5[_0x5010e4][0x0]['context'],'exten':_0x2966d5[_0x5010e4][0x0][_0x13e8('0xb')],'priority':_0x16d85a[_0x13e8('0x12')]++,'VoiceExtensionId':_0x2966d5[_0x5010e4][0x0][_0x13e8('0x1c')]});var _0x5b9e2d=_0x16d85a[_0x13e8('0x12')]++;_0x16d85a['extensions'][_0x13e8('0x16')]({'type':_0x2966d5[_0x5010e4][0x0][_0x13e8('0x17')],'app':_0x13e8('0x23'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x5b9e2d+0x2)+_0x13e8('0x24')+(_0x5b9e2d+0x1)+')','context':_0x2966d5[_0x5010e4][0x0][_0x13e8('0x1b')],'exten':_0x2966d5[_0x5010e4][0x0][_0x13e8('0xb')],'priority':_0x5b9e2d,'VoiceExtensionId':_0x2966d5[_0x5010e4][0x0][_0x13e8('0x1c')]});if(_0x16d85a['extension']){_0x16d85a[_0x13e8('0x13')]['push']({'type':_0x2966d5[_0x5010e4][0x0]['type'],'app':'Set','appdata':_0x16d85a[_0x13e8('0x14')][_0x13e8('0x21')]?_0x13e8('0x25')+_0x16d85a[_0x13e8('0x14')][_0x13e8('0x21')]+'}':_0x13e8('0x26'),'context':_0x2966d5[_0x5010e4][0x0][_0x13e8('0x1b')],'exten':_0x2966d5[_0x5010e4][0x0][_0x13e8('0xb')],'priority':_0x16d85a[_0x13e8('0x12')]++,'VoiceExtensionId':_0x2966d5[_0x5010e4][0x0][_0x13e8('0x1c')]});}_0x16d85a['extensions'][_0x13e8('0x16')]({'type':_0x2966d5[_0x5010e4][0x0][_0x13e8('0x17')],'app':_0x13e8('0x18'),'appdata':_0x13e8('0x27')+_0x2966d5[_0x5010e4][0x0]['VoiceExtensionId'],'context':_0x2966d5[_0x5010e4][0x0][_0x13e8('0x1b')],'exten':_0x2966d5[_0x5010e4][0x0][_0x13e8('0xb')],'priority':_0x16d85a['priority']++,'VoiceExtensionId':_0x2966d5[_0x5010e4][0x0][_0x13e8('0x1c')]});if(_0x16d85a[_0x13e8('0x14')]&&_0x16d85a[_0x13e8('0x14')][_0x13e8('0x11')](_0x13e8('0x28'))&&_0x16d85a[_0x13e8('0x14')][_0x13e8('0x28')]!==_0x13e8('0x29')){_0x16d85a[_0x13e8('0x13')][_0x13e8('0x16')]({'type':_0x2966d5[_0x5010e4][0x0]['type'],'app':_0x13e8('0x18'),'appdata':_0x13e8('0x2a'),'context':_0x2966d5[_0x5010e4][0x0][_0x13e8('0x1b')],'exten':_0x2966d5[_0x5010e4][0x0]['exten'],'priority':_0x16d85a[_0x13e8('0x12')]++,'VoiceExtensionId':_0x2966d5[_0x5010e4][0x0][_0x13e8('0x1c')]});_0x16d85a['extensions'][_0x13e8('0x16')]({'type':_0x2966d5[_0x5010e4][0x0][_0x13e8('0x17')],'app':_0x13e8('0x18'),'appdata':_0x13e8('0x2b')+_0x16d85a[_0x13e8('0x14')][_0x13e8('0x28')]||'wav','context':_0x2966d5[_0x5010e4][0x0][_0x13e8('0x1b')],'exten':_0x2966d5[_0x5010e4][0x0][_0x13e8('0xb')],'priority':_0x16d85a['priority']++,'VoiceExtensionId':_0x2966d5[_0x5010e4][0x0]['VoiceExtensionId']});}}_0x16d85a[_0x13e8('0x13')][_0x13e8('0x16')]({'type':_0x2966d5[_0x5010e4][0x0][_0x13e8('0x17')],'app':_0x13e8('0x18'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x2966d5[_0x5010e4][0x0]['context'],'exten':_0x2966d5[_0x5010e4][0x0][_0x13e8('0xb')],'priority':_0x16d85a[_0x13e8('0x12')]++,'VoiceExtensionId':_0x2966d5[_0x5010e4][0x0][_0x13e8('0x1c')]});_0x16d85a[_0x13e8('0x13')]['push']({'type':_0x2966d5[_0x5010e4][0x0][_0x13e8('0x17')],'app':_0x13e8('0x18'),'appdata':_0x13e8('0x2c'),'context':_0x2966d5[_0x5010e4][0x0][_0x13e8('0x1b')],'exten':_0x2966d5[_0x5010e4][0x0][_0x13e8('0xb')],'priority':_0x16d85a['priority']++,'VoiceExtensionId':_0x2966d5[_0x5010e4][0x0]['VoiceExtensionId']});_0x16d85a[_0x13e8('0x13')][_0x13e8('0x16')]({'type':_0x2966d5[_0x5010e4][0x0]['type'],'app':_0x13e8('0x18'),'appdata':_0x13e8('0x2d'),'context':_0x2966d5[_0x5010e4][0x0][_0x13e8('0x1b')],'exten':_0x2966d5[_0x5010e4][0x0][_0x13e8('0xb')],'priority':_0x16d85a[_0x13e8('0x12')]++,'VoiceExtensionId':_0x2966d5[_0x5010e4][0x0][_0x13e8('0x1c')]});for(var _0x384644=0x0,_0x2a2061=0x0;_0x384644<_0x2966d5[_0x5010e4][_0x13e8('0x2e')];_0x384644+=0x1,_0x2a2061=0x0){var _0x3cf8ca=_0x2966d5[_0x5010e4][_0x384644];if(_0x3cf8ca['type']){_0x3cf8ca[_0x13e8('0x17')]=_0x3cf8ca[_0x13e8('0x17')][_0x13e8('0x2f')]();}var _0x31c50b=[];var _0x315b6c=[];delete _0x3cf8ca['id'];delete _0x3cf8ca[_0x13e8('0x30')];delete _0x3cf8ca[_0x13e8('0x31')];var _0x588eb5=_0x3cf8ca[_0x13e8('0x32')]!==_0x13e8('0x33')?[_0x3cf8ca[_0x13e8('0x32')]]:_0x3cf8ca[_0x13e8('0x8')]?_[_0x13e8('0xa')](_[_0x13e8('0xd')](_0x16d85a[_0x13e8('0x6')],{'IntervalId':_0x3cf8ca[_0x13e8('0x8')]}),_0x13e8('0x32')):[];if(_0x3cf8ca[_0x13e8('0x11')](_0x13e8('0x34'))){if(_0x3cf8ca[_0x13e8('0x34')]&&_0x3cf8ca['tag']!=='--'){_0x31c50b[_0x13e8('0x16')]({'type':_0x3cf8ca['type'],'app':_0x13e8('0x18'),'appdata':_0x13e8('0x35')+_0x3cf8ca['tag'],'context':_0x3cf8ca[_0x13e8('0x1b')],'exten':_0x3cf8ca[_0x13e8('0xb')],'priority':_0x588eb5['length']+_0x16d85a[_0x13e8('0x12')]+_0x2a2061++,'VoiceExtensionId':_0x3cf8ca[_0x13e8('0x1c')]});}}if(_0x3cf8ca['type']===_0x13e8('0x1e')&&_0x3cf8ca['hasOwnProperty'](_0x13e8('0x36'))){if(_0x3cf8ca[_0x13e8('0x36')]){_0x31c50b[_0x13e8('0x16')]({'type':_0x3cf8ca[_0x13e8('0x17')],'app':_0x13e8('0x23'),'appdata':_0x13e8('0x37')+_0x3cf8ca[_0x13e8('0x36')]+')','context':_0x3cf8ca[_0x13e8('0x1b')],'exten':_0x3cf8ca[_0x13e8('0xb')],'priority':_0x588eb5[_0x13e8('0x2e')]+_0x16d85a['priority']+_0x2a2061++,'VoiceExtensionId':_0x3cf8ca[_0x13e8('0x1c')]});}else{_0x31c50b[_0x13e8('0x16')]({'type':_0x3cf8ca[_0x13e8('0x17')],'app':_0x13e8('0x23'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x3cf8ca[_0x13e8('0x1b')],'exten':_0x3cf8ca['exten'],'priority':_0x588eb5[_0x13e8('0x2e')]+_0x16d85a[_0x13e8('0x12')]+_0x2a2061++,'VoiceExtensionId':_0x3cf8ca['VoiceExtensionId']});}}if(_0x3cf8ca[_0x13e8('0x11')](_0x13e8('0x38'))){if(_0x2acfbc['indexOf'](_0x3cf8ca[_0x13e8('0x39')]['toLowerCase']())>=0x0&&_0x3cf8ca[_0x13e8('0x3a')]!=='custom'){if(_0x3cf8ca[_0x13e8('0x38')]){_0x31c50b[_0x13e8('0x16')]({'type':_0x3cf8ca['type'],'app':_0x13e8('0x23'),'appdata':_0x13e8('0x3b'),'context':_0x3cf8ca[_0x13e8('0x1b')],'exten':_0x3cf8ca[_0x13e8('0xb')],'priority':_0x588eb5['length']+_0x16d85a[_0x13e8('0x12')]+_0x2a2061++,'VoiceExtensionId':_0x3cf8ca[_0x13e8('0x1c')]});_0x31c50b['push']({'type':_0x3cf8ca['type'],'app':'Set','appdata':_0x13e8('0x3c'),'context':_0x3cf8ca['context'],'exten':_0x3cf8ca[_0x13e8('0xb')],'priority':_0x588eb5['length']+_0x16d85a['priority']+_0x2a2061++,'VoiceExtensionId':_0x3cf8ca[_0x13e8('0x1c')]});}else{_0x31c50b['push']({'type':_0x3cf8ca['type'],'app':_0x13e8('0x23'),'appdata':_0x13e8('0x3d'),'context':_0x3cf8ca[_0x13e8('0x1b')],'exten':_0x3cf8ca[_0x13e8('0xb')],'priority':_0x588eb5['length']+_0x16d85a[_0x13e8('0x12')]+_0x2a2061++,'VoiceExtensionId':_0x3cf8ca[_0x13e8('0x1c')]});_0x31c50b[_0x13e8('0x16')]({'type':_0x3cf8ca[_0x13e8('0x17')],'app':_0x13e8('0x18'),'appdata':_0x13e8('0x3e'),'context':_0x3cf8ca[_0x13e8('0x1b')],'exten':_0x3cf8ca[_0x13e8('0xb')],'priority':_0x588eb5[_0x13e8('0x2e')]+_0x16d85a['priority']+_0x2a2061++,'VoiceExtensionId':_0x3cf8ca[_0x13e8('0x1c')]});}}}for(var _0x4724ec=0x0;_0x4724ec<_0x588eb5[_0x13e8('0x2e')];_0x4724ec+=0x1){var _0x52fb8f=_0x16d85a['priority']+_0x588eb5[_0x13e8('0x2e')];var _0x1c4663=_0x4724ec===_0x588eb5[_0x13e8('0x2e')]-0x1?_0x16d85a[_0x13e8('0x12')]+_0x31c50b[_0x13e8('0x2e')]+_0x315b6c[_0x13e8('0x2e')]+0x2:_0x16d85a['priority']+_0x4724ec+0x1;_0x31c50b['splice'](_0x4724ec,0x0,{'type':_0x3cf8ca[_0x13e8('0x17')],'app':_0x13e8('0x3f'),'appdata':_0x588eb5[_0x4724ec]+'?'+_0x3cf8ca[_0x13e8('0x1b')]+_0x13e8('0x40')+_0x52fb8f+':'+_0x3cf8ca[_0x13e8('0x1b')]+_0x13e8('0x40')+_0x1c4663,'exten':_0x3cf8ca['exten'],'context':_0x3cf8ca[_0x13e8('0x1b')],'priority':_0x16d85a[_0x13e8('0x12')]+_0x4724ec,'VoiceExtensionId':_0x2966d5[_0x5010e4][0x0][_0x13e8('0x1c')]});}_0x3cf8ca['priority']=_0x31c50b['length']?_[_0x13e8('0x41')](_0x31c50b)[_0x13e8('0x12')]+0x1:_0x16d85a[_0x13e8('0x12')];_0x16d85a[_0x13e8('0x12')]=(_0x315b6c[_0x13e8('0x2e')]?_['last'](_0x315b6c)['priority']:_0x3cf8ca['priority'])+0x1;_0x16d85a[_0x13e8('0x13')]=_['concat'](_0x16d85a[_0x13e8('0x13')],_0x31c50b,[_0x3cf8ca],_0x315b6c);}_0x16d85a['extensions'][_0x13e8('0x16')]({'type':_0x2966d5[_0x5010e4][0x0][_0x13e8('0x17')],'app':_0x13e8('0x42'),'exten':_0x2966d5[_0x5010e4][0x0][_0x13e8('0xb')],'context':_0x2966d5[_0x5010e4][0x0][_0x13e8('0x1b')],'priority':_0x16d85a['priority'],'VoiceExtensionId':_0x2966d5[_0x5010e4][0x0][_0x13e8('0x1c')]});_0x1e01b3[_0x13e8('0x16')](_0x2966d5[_0x5010e4][0x0][_0x13e8('0x1c')]);_0x189785=_[_0x13e8('0x43')](_0x189785,_0x16d85a[_0x13e8('0x13')]);}}return _0x3cbc55[_0x13e8('0x44')](function(_0x5d33b2){return _0x3cbc55['models'][_0x13e8('0x7')][_0x13e8('0x45')]({'where':{'VoiceExtensionId':{'$in':_0x1e01b3}},'transaction':_0x5d33b2})[_0x13e8('0x5')](function(_0x4a4efd){return _0x3cbc55[_0x13e8('0x2')][_0x13e8('0x7')]['bulkCreate'](_[_0x13e8('0x46')](_0x189785,_0x13e8('0x12')),{'transaction':_0x5d33b2});});});})[_0x13e8('0x47')](function(_0x3265b4){console[_0x13e8('0x48')](_0x3265b4);});}exports[_0x13e8('0x49')]=rewrite; \ No newline at end of file +var _0x1e91=['recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','interval','*,*,*,*','intervals','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','destroy','bulkCreate','catch','error','lodash','util','Interval','models','findAll','IntervalId','then','VoiceExtension','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','filter','exten','queue','playback','hasOwnProperty','extensions','extension','find','push','type','Set','format','CDR(type)=%s','context','priority','inbound','CDR(routeid)=','VoiceExtensionId','outbound','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid='];(function(_0xeb1a85,_0x5831ac){var _0x4aa6f8=function(_0x374467){while(--_0x374467){_0xeb1a85['push'](_0xeb1a85['shift']());}};_0x4aa6f8(++_0x5831ac);}(_0x1e91,0xf1));var _0x11e9=function(_0x5bfdbc,_0xf38754){_0x5bfdbc=_0x5bfdbc-0x0;var _0x138f51=_0x1e91[_0x5bfdbc];return _0x138f51;};'use strict';var _=require(_0x11e9('0x0'));var util=require(_0x11e9('0x1'));function rewrite(_0xf7f46b,_0x390e9a){var _0x4447b9=this;return _0xf7f46b['models'][_0x11e9('0x2')]['findAll']({'raw':!![]})['then'](function(_0x291372){_0x4447b9['intervals']=_0x291372;return _0xf7f46b[_0x11e9('0x3')]['VoiceExtension'][_0x11e9('0x4')]({'where':{'IntervalId':_0x390e9a[_0x11e9('0x5')]},'raw':!![]});})[_0x11e9('0x6')](function(_0x2761bb){return _0xf7f46b['models'][_0x11e9('0x7')][_0x11e9('0x4')]({'where':{'exten':{'$in':_[_0x11e9('0x8')](_[_0x11e9('0x9')](_0x2761bb,'exten'))}},'order':[{'raw':_0x11e9('0xa')}],'raw':!![]});})[_0x11e9('0x6')](function(_0x3b5ff1){var _0x34a103=_[_0x11e9('0xb')](_0x3b5ff1,{'priority':'1'});var _0x170bdf=_[_0x11e9('0xb')](_0x3b5ff1,{'isApp':0x1});var _0x58c3d7=_['groupBy'](_0x170bdf,_0x11e9('0xc'));var _0x256370=[_0x11e9('0xd'),_0x11e9('0xe')];var _0x5929e4=[];var _0x2d6a87=[];for(var _0x54a2c9 in _0x58c3d7){if(_0x58c3d7[_0x11e9('0xf')](_0x54a2c9)){_0x4447b9['priority']=0x2;_0x4447b9[_0x11e9('0x10')]=[];_0x4447b9[_0x11e9('0x11')]=_[_0x11e9('0x12')](_0x34a103,{'exten':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0xc')]});_0x4447b9[_0x11e9('0x10')][_0x11e9('0x13')]({'type':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x14')],'app':_0x11e9('0x15'),'appdata':util[_0x11e9('0x16')](_0x11e9('0x17'),_0x58c3d7[_0x54a2c9][0x0]['type']),'context':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x18')],'exten':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0xc')],'priority':_0x4447b9[_0x11e9('0x19')]++,'VoiceExtensionId':_0x58c3d7[_0x54a2c9][0x0]['VoiceExtensionId']});if(_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x14')]===_0x11e9('0x1a')){_0x4447b9[_0x11e9('0x10')][_0x11e9('0x13')]({'type':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x14')],'app':'Set','appdata':_0x11e9('0x1b')+_0x58c3d7[_0x54a2c9][0x0]['VoiceExtensionId'],'context':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x18')],'exten':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0xc')],'priority':_0x4447b9[_0x11e9('0x19')]++,'VoiceExtensionId':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x1c')]});}else if(_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x14')]===_0x11e9('0x1d')){if(_0x4447b9['extension']){_0x4447b9[_0x11e9('0x10')][_0x11e9('0x13')]({'type':_0x58c3d7[_0x54a2c9][0x0]['type'],'app':_0x11e9('0x15'),'appdata':_0x11e9('0x1e')+(_0x4447b9['extension']['cutdigits']?_0x11e9('0x1f')+_0x4447b9[_0x11e9('0x11')][_0x11e9('0x20')]+'}':_0x11e9('0x21')),'context':_0x58c3d7[_0x54a2c9][0x0]['context'],'exten':_0x58c3d7[_0x54a2c9][0x0]['exten'],'priority':_0x4447b9[_0x11e9('0x19')]++,'VoiceExtensionId':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x1c')]});}_0x4447b9['extensions']['push']({'type':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x14')],'app':_0x11e9('0x15'),'appdata':_0x11e9('0x1b')+_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x1c')],'context':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x18')],'exten':_0x58c3d7[_0x54a2c9][0x0]['exten'],'priority':_0x4447b9[_0x11e9('0x19')]++,'VoiceExtensionId':_0x58c3d7[_0x54a2c9][0x0]['VoiceExtensionId']});var _0x2dc633=_0x4447b9[_0x11e9('0x19')]++;_0x4447b9[_0x11e9('0x10')]['push']({'type':_0x58c3d7[_0x54a2c9][0x0]['type'],'app':_0x11e9('0x22'),'appdata':_0x11e9('0x23')+(_0x2dc633+0x2)+_0x11e9('0x24')+(_0x2dc633+0x1)+')','context':_0x58c3d7[_0x54a2c9][0x0]['context'],'exten':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0xc')],'priority':_0x2dc633,'VoiceExtensionId':_0x58c3d7[_0x54a2c9][0x0]['VoiceExtensionId']});if(_0x4447b9[_0x11e9('0x11')]){_0x4447b9[_0x11e9('0x10')][_0x11e9('0x13')]({'type':_0x58c3d7[_0x54a2c9][0x0]['type'],'app':_0x11e9('0x15'),'appdata':_0x4447b9[_0x11e9('0x11')][_0x11e9('0x20')]?'CDR(prefix)=${EXTEN:0:'+_0x4447b9[_0x11e9('0x11')][_0x11e9('0x20')]+'}':_0x11e9('0x25'),'context':_0x58c3d7[_0x54a2c9][0x0]['context'],'exten':_0x58c3d7[_0x54a2c9][0x0]['exten'],'priority':_0x4447b9[_0x11e9('0x19')]++,'VoiceExtensionId':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x1c')]});}_0x4447b9[_0x11e9('0x10')][_0x11e9('0x13')]({'type':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x14')],'app':'Set','appdata':_0x11e9('0x26')+_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x1c')],'context':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x18')],'exten':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0xc')],'priority':_0x4447b9['priority']++,'VoiceExtensionId':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x1c')]});if(_0x4447b9[_0x11e9('0x11')]&&_0x4447b9[_0x11e9('0x11')][_0x11e9('0xf')](_0x11e9('0x27'))&&_0x4447b9['extension'][_0x11e9('0x27')]!=='none'){_0x4447b9[_0x11e9('0x10')][_0x11e9('0x13')]({'type':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x14')],'app':_0x11e9('0x15'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x18')],'exten':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0xc')],'priority':_0x4447b9['priority']++,'VoiceExtensionId':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x1c')]});_0x4447b9[_0x11e9('0x10')][_0x11e9('0x13')]({'type':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x14')],'app':_0x11e9('0x15'),'appdata':_0x11e9('0x28')+_0x4447b9['extension'][_0x11e9('0x27')]||'wav','context':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x18')],'exten':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0xc')],'priority':_0x4447b9[_0x11e9('0x19')]++,'VoiceExtensionId':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x1c')]});}}_0x4447b9['extensions'][_0x11e9('0x13')]({'type':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x14')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x18')],'exten':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0xc')],'priority':_0x4447b9[_0x11e9('0x19')]++,'VoiceExtensionId':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x1c')]});_0x4447b9[_0x11e9('0x10')][_0x11e9('0x13')]({'type':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x14')],'app':_0x11e9('0x15'),'appdata':_0x11e9('0x29'),'context':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x18')],'exten':_0x58c3d7[_0x54a2c9][0x0]['exten'],'priority':_0x4447b9['priority']++,'VoiceExtensionId':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x1c')]});_0x4447b9[_0x11e9('0x10')][_0x11e9('0x13')]({'type':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x14')],'app':'Set','appdata':_0x11e9('0x2a'),'context':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x18')],'exten':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0xc')],'priority':_0x4447b9[_0x11e9('0x19')]++,'VoiceExtensionId':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x1c')]});for(var _0x2becb1=0x0,_0x2e4928=0x0;_0x2becb1<_0x58c3d7[_0x54a2c9][_0x11e9('0x2b')];_0x2becb1+=0x1,_0x2e4928=0x0){var _0x4655b9=_0x58c3d7[_0x54a2c9][_0x2becb1];if(_0x4655b9[_0x11e9('0x14')]){_0x4655b9['type']=_0x4655b9['type'][_0x11e9('0x2c')]();}var _0x522de4=[];var _0x1c1280=[];delete _0x4655b9['id'];delete _0x4655b9['createdAt'];delete _0x4655b9['updatedAt'];var _0x9ef818=_0x4655b9[_0x11e9('0x2d')]!==_0x11e9('0x2e')?[_0x4655b9[_0x11e9('0x2d')]]:_0x4655b9['IntervalId']?_[_0x11e9('0x9')](_[_0x11e9('0xb')](_0x4447b9[_0x11e9('0x2f')],{'IntervalId':_0x4655b9[_0x11e9('0x5')]}),_0x11e9('0x2d')):[];if(_0x4655b9[_0x11e9('0xf')]('tag')){if(_0x4655b9['tag']&&_0x4655b9[_0x11e9('0x30')]!=='--'){_0x522de4[_0x11e9('0x13')]({'type':_0x4655b9['type'],'app':_0x11e9('0x15'),'appdata':_0x11e9('0x31')+_0x4655b9['tag'],'context':_0x4655b9[_0x11e9('0x18')],'exten':_0x4655b9[_0x11e9('0xc')],'priority':_0x9ef818[_0x11e9('0x2b')]+_0x4447b9[_0x11e9('0x19')]+_0x2e4928++,'VoiceExtensionId':_0x4655b9[_0x11e9('0x1c')]});}}if(_0x4655b9[_0x11e9('0x14')]===_0x11e9('0x1d')&&_0x4655b9['hasOwnProperty'](_0x11e9('0x32'))){if(_0x4655b9[_0x11e9('0x32')]){_0x522de4['push']({'type':_0x4655b9[_0x11e9('0x14')],'app':_0x11e9('0x22'),'appdata':_0x11e9('0x33')+_0x4655b9['callerID']+')','context':_0x4655b9[_0x11e9('0x18')],'exten':_0x4655b9['exten'],'priority':_0x9ef818[_0x11e9('0x2b')]+_0x4447b9['priority']+_0x2e4928++,'VoiceExtensionId':_0x4655b9[_0x11e9('0x1c')]});}else{_0x522de4[_0x11e9('0x13')]({'type':_0x4655b9[_0x11e9('0x14')],'app':_0x11e9('0x22'),'appdata':_0x11e9('0x34'),'context':_0x4655b9[_0x11e9('0x18')],'exten':_0x4655b9[_0x11e9('0xc')],'priority':_0x9ef818['length']+_0x4447b9[_0x11e9('0x19')]+_0x2e4928++,'VoiceExtensionId':_0x4655b9[_0x11e9('0x1c')]});}}if(_0x4655b9[_0x11e9('0xf')](_0x11e9('0x35'))){if(_0x256370[_0x11e9('0x36')](_0x4655b9['app']['toLowerCase']())>=0x0&&_0x4655b9[_0x11e9('0x37')]!==_0x11e9('0x38')){if(_0x4655b9['answer']){_0x522de4[_0x11e9('0x13')]({'type':_0x4655b9['type'],'app':_0x11e9('0x22'),'appdata':_0x11e9('0x39'),'context':_0x4655b9['context'],'exten':_0x4655b9['exten'],'priority':_0x9ef818['length']+_0x4447b9[_0x11e9('0x19')]+_0x2e4928++,'VoiceExtensionId':_0x4655b9[_0x11e9('0x1c')]});_0x522de4[_0x11e9('0x13')]({'type':_0x4655b9[_0x11e9('0x14')],'app':_0x11e9('0x15'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x4655b9[_0x11e9('0x18')],'exten':_0x4655b9['exten'],'priority':_0x9ef818[_0x11e9('0x2b')]+_0x4447b9[_0x11e9('0x19')]+_0x2e4928++,'VoiceExtensionId':_0x4655b9[_0x11e9('0x1c')]});}else{_0x522de4[_0x11e9('0x13')]({'type':_0x4655b9[_0x11e9('0x14')],'app':'ExecIf','appdata':_0x11e9('0x3a'),'context':_0x4655b9['context'],'exten':_0x4655b9[_0x11e9('0xc')],'priority':_0x9ef818[_0x11e9('0x2b')]+_0x4447b9[_0x11e9('0x19')]+_0x2e4928++,'VoiceExtensionId':_0x4655b9[_0x11e9('0x1c')]});_0x522de4[_0x11e9('0x13')]({'type':_0x4655b9[_0x11e9('0x14')],'app':_0x11e9('0x15'),'appdata':_0x11e9('0x3b'),'context':_0x4655b9['context'],'exten':_0x4655b9[_0x11e9('0xc')],'priority':_0x9ef818[_0x11e9('0x2b')]+_0x4447b9[_0x11e9('0x19')]+_0x2e4928++,'VoiceExtensionId':_0x4655b9['VoiceExtensionId']});}}}for(var _0x379f2a=0x0;_0x379f2a<_0x9ef818[_0x11e9('0x2b')];_0x379f2a+=0x1){var _0x185102=_0x4447b9['priority']+_0x9ef818[_0x11e9('0x2b')];var _0x55e6eb=_0x379f2a===_0x9ef818[_0x11e9('0x2b')]-0x1?_0x4447b9[_0x11e9('0x19')]+_0x522de4['length']+_0x1c1280[_0x11e9('0x2b')]+0x2:_0x4447b9[_0x11e9('0x19')]+_0x379f2a+0x1;_0x522de4[_0x11e9('0x3c')](_0x379f2a,0x0,{'type':_0x4655b9[_0x11e9('0x14')],'app':_0x11e9('0x3d'),'appdata':_0x9ef818[_0x379f2a]+'?'+_0x4655b9[_0x11e9('0x18')]+_0x11e9('0x3e')+_0x185102+':'+_0x4655b9[_0x11e9('0x18')]+_0x11e9('0x3e')+_0x55e6eb,'exten':_0x4655b9[_0x11e9('0xc')],'context':_0x4655b9['context'],'priority':_0x4447b9[_0x11e9('0x19')]+_0x379f2a,'VoiceExtensionId':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x1c')]});}_0x4655b9[_0x11e9('0x19')]=_0x522de4[_0x11e9('0x2b')]?_[_0x11e9('0x3f')](_0x522de4)[_0x11e9('0x19')]+0x1:_0x4447b9[_0x11e9('0x19')];_0x4447b9['priority']=(_0x1c1280[_0x11e9('0x2b')]?_['last'](_0x1c1280)[_0x11e9('0x19')]:_0x4655b9[_0x11e9('0x19')])+0x1;_0x4447b9[_0x11e9('0x10')]=_[_0x11e9('0x40')](_0x4447b9[_0x11e9('0x10')],_0x522de4,[_0x4655b9],_0x1c1280);}_0x4447b9['extensions'][_0x11e9('0x13')]({'type':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x14')],'app':_0x11e9('0x41'),'exten':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0xc')],'context':_0x58c3d7[_0x54a2c9][0x0][_0x11e9('0x18')],'priority':_0x4447b9[_0x11e9('0x19')],'VoiceExtensionId':_0x58c3d7[_0x54a2c9][0x0]['VoiceExtensionId']});_0x5929e4[_0x11e9('0x13')](_0x58c3d7[_0x54a2c9][0x0]['VoiceExtensionId']);_0x2d6a87=_[_0x11e9('0x40')](_0x2d6a87,_0x4447b9['extensions']);}}return _0xf7f46b['transaction'](function(_0x4745fc){return _0xf7f46b[_0x11e9('0x3')][_0x11e9('0x7')][_0x11e9('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x5929e4}},'transaction':_0x4745fc})['then'](function(_0x2f5577){return _0xf7f46b['models'][_0x11e9('0x7')][_0x11e9('0x43')](_['sortBy'](_0x2d6a87,_0x11e9('0x19')),{'transaction':_0x4745fc});});});})[_0x11e9('0x44')](function(_0xaba923){console[_0x11e9('0x45')](_0xaba923);});}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 df3ff9b..d29740c 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 _0x5135=['join','data','firstName','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email\x20format\x20is\x20not\x20valid!','CompanyId','length','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','createdAt','select','field','NOW()','toString','updatedAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','insert','str','calleridnum','cm_hopper_final','\x20=\x20?','into','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','query','VoiceQueueId','onlyIfOpen','sequelize','all','Campaign','CampaignId','BlackLists','generalCheckHopper','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','parse','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','message'];(function(_0xc1872f,_0x551586){var _0x43eb74=function(_0x39d5b9){while(--_0x39d5b9){_0xc1872f['push'](_0xc1872f['shift']());}};_0x43eb74(++_0x551586);}(_0x5135,0xbe));var _0x5513=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x5135[_0x138f59];return _0x3d114d;};'use strict';var BPromise=require(_0x5513('0x0'));var util=require(_0x5513('0x1'));var _=require(_0x5513('0x2'));var fs=require('fs');var squel=require(_0x5513('0x3'));var Papa=require('papaparse');var Redis=require('ioredis');var db=require(_0x5513('0x4'))['db'];var config=require(_0x5513('0x5'));var logger=require(_0x5513('0x6'))(_0x5513('0x7'));config[_0x5513('0x8')]=_[_0x5513('0x9')](config[_0x5513('0x8')],{'host':_0x5513('0xa'),'port':0x18eb});var socket=require(_0x5513('0xb'))(new Redis(config[_0x5513('0x8')]));require(_0x5513('0xc'))[_0x5513('0xd')](socket);try{if(!process['argv'][0x2]||process[_0x5513('0xe')][0x2]===_0x5513('0xf')||process[_0x5513('0xe')][0x2]===_0x5513('0x10')){throw new Error(_0x5513('0x11'));}var FILEPATH=process['argv'][0x2];if(!process[_0x5513('0xe')][0x3]||process[_0x5513('0xe')][0x3]===_0x5513('0xf')||process[_0x5513('0xe')][0x3]===_0x5513('0x10')||!process[_0x5513('0xe')][0x4]||process['argv'][0x4]===_0x5513('0xf')||process[_0x5513('0xe')][0x4]===_0x5513('0x10')){throw new Error(_0x5513('0x12'));}var FIELDS=_[_0x5513('0x13')](process[_0x5513('0xe')][0x3]['split'](','),process[_0x5513('0xe')][0x4][_0x5513('0x14')](','));if(!process['argv'][0x5]||process[_0x5513('0xe')][0x5]===_0x5513('0xf')||process[_0x5513('0xe')][0x5]==='null'){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x5513('0xe')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x5513('0xe')][0x6]!==_0x5513('0xf')&&process['argv'][0x6]!==_0x5513('0x10')?process[_0x5513('0xe')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x5513('0xe')][0x7]!=='undefined'&&process['argv'][0x7]!==_0x5513('0x10')?process[_0x5513('0xe')][0x7]:null;if(!process[_0x5513('0xe')][0x8]||process[_0x5513('0xe')][0x8]===_0x5513('0xf')||process[_0x5513('0xe')][0x8]===_0x5513('0x10')){throw new Error(_0x5513('0x15'));}var SOCKET_TIMESTAMP=process[_0x5513('0xe')][0x8];}catch(_0x1ae0f3){logger[_0x5513('0x16')](_0x1ae0f3);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(_0x1e4e95,_0x192c9b,_0x4e6e84,_0x15afb8){var _0x155d7f={'message':_0x192c9b};_0x155d7f[_0x1e4e95]=!![];if(_0x4e6e84){_0x155d7f['contact']=_0x4e6e84;}if(_0x15afb8){_0x155d7f[_0x5513('0x17')]=_0x15afb8;}return _0x155d7f;}function isEmail(_0x50605b){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))*$/[_0x5513('0x18')](_0x50605b);}function checkRow(_0x28043e,_0x2e51f1,_0x5ebfcc){return new BPromise(function(_0x34c68f,_0xa32f45){if(_[_0x5513('0x19')](_0x28043e)){return _0xa32f45(handleCheckRowError(_0x5513('0x16'),_0x5513('0x1a'),null,_0x5ebfcc));}if(_0x28043e[_0x5513('0x1b')]&&_0x28043e['errors']['length']){var _0x45e958=_[_0x5513('0x1c')](_0x28043e[_0x5513('0x1b')],_0x5513('0x1d'))[_0x5513('0x1e')](';');return _0xa32f45(handleCheckRowError(_0x5513('0x16'),_0x45e958,null,_0x5ebfcc));}var _0x4123e8={};for(var _0x22526b in FIELDS){if(FIELDS['hasOwnProperty'](_0x22526b)&&FIELDS[_0x22526b]){_0x4123e8[_0x22526b]=_0x28043e[_0x5513('0x1f')][0x0][FIELDS[_0x22526b]]||_0x28043e['data'][0x0]['\ufeff'+FIELDS[_0x22526b]];}}if(!_0x4123e8[_0x5513('0x20')]){return _0xa32f45(handleCheckRowError(_0x5513('0x16'),'firstName\x20not\x20specified!',null,_0x5ebfcc));}if(!_0x4123e8[_0x5513('0x21')]){return _0xa32f45(handleCheckRowError(_0x5513('0x16'),_0x5513('0x22'),null,_0x5ebfcc));}if(_0x4123e8[_0x5513('0x23')]){var _0x285044=moment(_0x4123e8['birthDate'],_0x5513('0x24'));if(!_0x285044[_0x5513('0x25')]()){return _0xa32f45(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x5ebfcc));}}if(_0x4123e8['email']){if(!isEmail(_0x4123e8['email'])){return _0xa32f45(handleCheckRowError('error',_0x5513('0x26'),null,_0x5ebfcc));}}_0x4123e8['ListId']=LISTID;_0x4123e8[_0x5513('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x5513('0x28')]&&_0x2e51f1){var _0x499d1e={};for(var _0x559dd7=0x0,_0x3e79f6=DUPLICATES[_0x5513('0x28')];_0x559dd7<_0x3e79f6;_0x559dd7+=0x1){_0x499d1e[DUPLICATES[_0x559dd7]]=_0x4123e8[DUPLICATES[_0x559dd7]];}var _0x4ef883=_[_0x5513('0x29')](_0x2e51f1,_0x499d1e);if(_0x4ef883){return _0xa32f45(handleCheckRowError(_0x5513('0x2a'),_0x5513('0x2b'),_0x4ef883,_0x5ebfcc));}}return db[_0x5513('0x2c')][_0x5513('0x2d')](_0x4123e8,{'raw':!![],'hooks':![],'fields':_[_0x5513('0x2e')](_0x4123e8)})[_0x5513('0x2f')](function(_0x132564){if(DUPLICATES&&DUPLICATES['length']&&_0x2e51f1){_0x2e51f1[_0x5513('0x30')](_[_0x5513('0x31')](_0x4123e8,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x132564['id'];return _0x34c68f();})[_0x5513('0x32')](function(_0x33cd70){return _0xa32f45(handleCheckRowError('error',_0x5513('0x33')+(_0x33cd70[_0x5513('0x1d')]||JSON[_0x5513('0x34')](_0x33cd70)),null,_0x5ebfcc));});});}function checkHopper(){function _0x4d07e5(){return function(_0x44aff4){logger['error']('cmContact',_0x5513('0x35'),util['inspect'](_0x44aff4,{'showHidden':![],'depth':null}));};}var _0x4bb7f4=function(_0x15c112,_0x244d22){var _0x4be7e1=squel['insert']()['into'](_0x5513('0x36'))[_0x5513('0x37')]([_0x5513('0x21'),_0x5513('0x38'),_0x5513('0x39'),_0x5513('0x3a'),_0x244d22,_0x5513('0x3b'),'updatedAt'],squel[_0x5513('0x3c')]()[_0x5513('0x3d')](_0x5513('0x21'),'phone')[_0x5513('0x3d')](_0x5513('0x3e'),'scheduledAt')['field']('id',_0x5513('0x39'))[_0x5513('0x3d')](LISTID[_0x5513('0x3f')](),_0x5513('0x3a'))['field'](_0x15c112['id'][_0x5513('0x3f')](),_0x244d22)[_0x5513('0x3d')](_0x5513('0x3e'),_0x5513('0x3b'))[_0x5513('0x3d')](_0x5513('0x3e'),_0x5513('0x40'))[_0x5513('0x41')](_0x5513('0x42'))[_0x5513('0x43')](_0x5513('0x44'))[_0x5513('0x43')](_0x5513('0x45'),LISTID[_0x5513('0x3f')]())[_0x5513('0x43')](_0x5513('0x46'))[_0x5513('0x43')](_0x5513('0x47'),squel[_0x5513('0x3c')]()['field'](_0x5513('0x21'))['from'](_0x5513('0x36'))[_0x5513('0x43')](_0x244d22+'\x20=\x20?',_0x15c112['id'][_0x5513('0x3f')]())))[_0x5513('0x3f')]();return _0x4be7e1;};var _0xc8c9da=function(_0x194be5,_0x5d8f91){var _0x19add7=squel[_0x5513('0x48')]()['into'](_0x5513('0x36'))[_0x5513('0x37')]([_0x5513('0x21'),_0x5513('0x38'),_0x5513('0x39'),_0x5513('0x3a'),_0x5d8f91,'createdAt',_0x5513('0x40')],squel[_0x5513('0x3c')]()[_0x5513('0x3d')]('phone',_0x5513('0x21'))['field'](_0x5513('0x3e'),_0x5513('0x38'))['field']('id',_0x5513('0x39'))[_0x5513('0x3d')](LISTID[_0x5513('0x3f')](),_0x5513('0x3a'))[_0x5513('0x3d')](_0x194be5['id'][_0x5513('0x3f')](),_0x5d8f91)[_0x5513('0x3d')]('NOW()',_0x5513('0x3b'))[_0x5513('0x3d')](_0x5513('0x3e'),_0x5513('0x40'))[_0x5513('0x41')](_0x5513('0x42'))[_0x5513('0x43')](_0x5513('0x44'))[_0x5513('0x43')]('ListId\x20=\x20?',LISTID[_0x5513('0x3f')]())['where']('id\x20IN\x20?',squel[_0x5513('0x49')](hopperContacts))[_0x5513('0x43')]('phone\x20IS\x20NOT\x20NULL')[_0x5513('0x43')](_0x5513('0x47'),squel[_0x5513('0x3c')]()[_0x5513('0x3d')](_0x5513('0x4a'))['from'](_0x5513('0x4b'))[_0x5513('0x43')](_0x5d8f91+_0x5513('0x4c'),_0x194be5['id'][_0x5513('0x3f')]()))[_0x5513('0x43')](_0x5513('0x47'),squel['select']()[_0x5513('0x3d')]('phone')[_0x5513('0x41')](_0x5513('0x36'))[_0x5513('0x43')](_0x5d8f91+_0x5513('0x4c'),_0x194be5['id'][_0x5513('0x3f')]())))[_0x5513('0x3f')]();return _0x19add7;};function _0x4c5e6f(_0x2c1b5e,_0x2e6ca0){var _0x9e82b5=squel[_0x5513('0x48')]()[_0x5513('0x4d')]('cm_hopper')[_0x5513('0x37')]([_0x5513('0x21'),_0x5513('0x38'),_0x5513('0x39'),_0x5513('0x3a'),_0x2e6ca0,_0x5513('0x3b'),_0x5513('0x40')],squel[_0x5513('0x3c')]()[_0x5513('0x3d')](_0x5513('0x21'),_0x5513('0x21'))[_0x5513('0x3d')](_0x5513('0x3e'),_0x5513('0x38'))[_0x5513('0x3d')]('id','ContactId')['field'](LISTID['toString'](),'ListId')[_0x5513('0x3d')](_0x2c1b5e['id']['toString'](),_0x2e6ca0)['field']('NOW()',_0x5513('0x3b'))[_0x5513('0x3d')](_0x5513('0x3e'),_0x5513('0x40'))[_0x5513('0x41')](_0x5513('0x42'))['where'](_0x5513('0x44'))[_0x5513('0x43')]('ListId\x20=\x20?',LISTID[_0x5513('0x3f')]())['where']('id\x20IN\x20?',squel['str'](hopperContacts))[_0x5513('0x43')](_0x5513('0x46')))[_0x5513('0x3f')]();return _0x9e82b5;}function _0x4895ed(_0x298391,_0x37ab62){var _0x1f6af4=squel['insert']()['into'](_0x5513('0x4e'))[_0x5513('0x37')]([_0x5513('0x21'),'ContactId',_0x5513('0x3a'),_0x37ab62,_0x5513('0x3b'),_0x5513('0x40')],squel[_0x5513('0x3c')]()['field'](_0x5513('0x21'),_0x5513('0x21'))[_0x5513('0x3d')]('id','ContactId')[_0x5513('0x3d')](LISTID[_0x5513('0x3f')](),'ListId')[_0x5513('0x3d')](_0x298391['id']['toString'](),_0x37ab62)[_0x5513('0x3d')](_0x5513('0x3e'),'createdAt')[_0x5513('0x3d')](_0x5513('0x3e'),_0x5513('0x40'))[_0x5513('0x41')](_0x5513('0x42'))[_0x5513('0x43')](_0x5513('0x44'))[_0x5513('0x43')](_0x5513('0x45'),LISTID[_0x5513('0x3f')]())[_0x5513('0x43')]('id\x20IN\x20?',squel[_0x5513('0x49')](hopperContacts))[_0x5513('0x43')](_0x5513('0x46')))[_0x5513('0x3f')]();return _0x1f6af4;}return db[_0x5513('0x4f')][_0x5513('0x50')]({'where':{'type':_0x5513('0x51')},'attributes':['id',_0x5513('0x52')],'include':[{'model':db[_0x5513('0x53')],'as':_0x5513('0x54'),'where':{'id':LISTID}}]})[_0x5513('0x2f')](function(_0x700d3f){var _0x367e0c=[];if(_0x700d3f){var _0xbce236;for(var _0x119ffe=0x0,_0x5de2ce;_0x119ffe<_0x700d3f[_0x5513('0x28')];_0x119ffe+=0x1){_0x5de2ce=_0x700d3f[_0x119ffe][_0x5513('0x55')]({'plain':!![]});switch(_0x5de2ce[_0x5513('0x52')]){case _0x5513('0x56'):_0x367e0c[_0x5513('0x30')](db['sequelize'][_0x5513('0x57')](_0xc8c9da(_0x5de2ce,_0x5513('0x58')))[_0x5513('0x2f')](function(){})['catch'](_0x4d07e5()));break;case _0x5513('0x59'):_0x367e0c[_0x5513('0x30')](db[_0x5513('0x5a')]['query'](_0x4bb7f4(_0x5de2ce,_0x5513('0x58')))[_0x5513('0x2f')](function(){})['catch'](_0x4d07e5()));break;default:_0x367e0c[_0x5513('0x30')](db[_0x5513('0x5a')][_0x5513('0x57')](_0x4c5e6f(_0x5de2ce,_0x5513('0x58')))[_0x5513('0x2f')](function(){})['catch'](_0x4d07e5()));}}}return _0x367e0c;})['all']()[_0x5513('0x2f')](function(){return db[_0x5513('0x4f')][_0x5513('0x50')]({'where':{'type':_0x5513('0x51')},'attributes':['id'],'include':[{'model':db[_0x5513('0x53')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x5513('0x2f')](function(_0x14eff1){var _0x5967a2=[];if(_0x14eff1){var _0x505313;for(var _0x1e0727=0x0,_0x34181f;_0x1e0727<_0x14eff1[_0x5513('0x28')];_0x1e0727+=0x1){_0x34181f=_0x14eff1[_0x1e0727][_0x5513('0x55')]({'plain':!![]});_0x5967a2[_0x5513('0x30')](db[_0x5513('0x5a')]['query'](_0x4895ed(_0x34181f,_0x5513('0x58')))[_0x5513('0x2f')](function(){})[_0x5513('0x32')](_0x4d07e5()));}}return _0x5967a2;})[_0x5513('0x5b')]();})['then'](function(){return db[_0x5513('0x5c')][_0x5513('0x50')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0x5513('0x54'),'where':{'id':LISTID}}]})[_0x5513('0x2f')](function(_0x52a5ab){var _0x5d718a=[];if(_0x52a5ab){for(var _0x2b639f=0x0,_0x1ef665;_0x2b639f<_0x52a5ab[_0x5513('0x28')];_0x2b639f+=0x1){_0x1ef665=_0x52a5ab[_0x2b639f][_0x5513('0x55')]({'plain':!![]});switch(_0x1ef665[_0x5513('0x52')]){case _0x5513('0x56'):_0x5d718a[_0x5513('0x30')](db['sequelize'][_0x5513('0x57')](_0xc8c9da(_0x1ef665,_0x5513('0x5d')))['then'](function(){})[_0x5513('0x32')](_0x4d07e5()));break;case'onlyIfOpen':_0x5d718a[_0x5513('0x30')](db['sequelize']['query'](_0x4bb7f4(_0x1ef665,'CampaignId'))[_0x5513('0x2f')](function(){})[_0x5513('0x32')](_0x4d07e5()));break;default:_0x5d718a[_0x5513('0x30')](db['sequelize'][_0x5513('0x57')](_0x4c5e6f(_0x1ef665,'CampaignId'))[_0x5513('0x2f')](function(){})['catch'](_0x4d07e5()));}}}return _0x5d718a;})[_0x5513('0x5b')]();})[_0x5513('0x2f')](function(){return db[_0x5513('0x5c')][_0x5513('0x50')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x5513('0x5e'),'where':{'id':LISTID}}]})[_0x5513('0x2f')](function(_0x219c6c){var _0x3a416a=[];if(_0x219c6c){for(var _0x550db2=0x0,_0x1e966e;_0x550db2<_0x219c6c['length'];_0x550db2+=0x1){_0x1e966e=_0x219c6c[_0x550db2][_0x5513('0x55')]({'plain':!![]});_0x3a416a['push'](db[_0x5513('0x5a')]['query'](_0x4895ed(_0x1e966e,_0x5513('0x5d')))[_0x5513('0x2f')](function(){})[_0x5513('0x32')](_0x4d07e5()));}}return _0x3a416a;})[_0x5513('0x5b')]();})[_0x5513('0x32')](function(_0x11c33c){logger[_0x5513('0x16')]('cmContact,\x20%s,\x20%s',_0x5513('0x5f'),_0x11c33c[_0x5513('0x1d')]);});}var processPromises=function(_0xc65e5b){return BPromise[_0x5513('0x5b')](promises)['then'](function(_0x40173d){})['catch'](function(_0x4b0276){logger['error'](_0x5513('0x60'),JSON[_0x5513('0x34')](_0x4b0276));})['finally'](function(){socket[_0x5513('0x61')](_0x5513('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0xc65e5b){return _0xc65e5b[_0x5513('0x63')]();}});};var endCsv=function(){return BPromise[_0x5513('0x64')]()['then'](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket['emit'](_0x5513('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x5513('0x65')](FILEPATH);}catch(_0x186572){logger[_0x5513('0x16')](_0x5513('0x66'),JSON['stringify'](_0x186572));}finally{process[_0x5513('0x67')](0x0);}});};process['on'](_0x5513('0x68'),function(){logger[_0x5513('0x69')](_0x5513('0x6a'));endCsv();});function main(){return BPromise[_0x5513('0x64')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x5513('0x14')](',');return db['CmContact'][_0x5513('0x50')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x5513('0x2f')](function(_0x419dc9){var _0x1305dc=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x5513('0x6b')](_0x1305dc,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1eb49d,_0x3dc3d6){total+=0x1;var _0x2bad0a=total;promises['push'](checkRow(_0x1eb49d,_0x419dc9,_0x2bad0a)['then'](function(){success+=0x1;})[_0x5513('0x32')](function(_0x2eb76c){if(_0x2eb76c[_0x5513('0x16')]){errors+=0x1;delete _0x2eb76c['error'];}else if(_0x2eb76c[_0x5513('0x2a')]){duplicates+=0x1;delete _0x2eb76c['duplicate'];}rows[_0x5513('0x30')](_0x2eb76c);}));if(total%0xc8===0x0){_0x3dc3d6['pause']();return processPromises(_0x3dc3d6);}},'complete':function(){return processPromises()[_0x5513('0x2f')](function(){logger['info'](_0x5513('0x6c'));endCsv();});},'error':function(_0x56a41e,_0x3e2a6a){logger[_0x5513('0x69')]('CSV\x20parse\x20error',JSON[_0x5513('0x34')](_0x56a41e));endCsv();}});})[_0x5513('0x32')](function(_0x4d5830){logger[_0x5513('0x16')](_0x5513('0x6d'),JSON[_0x5513('0x34')](_0x4d5830));});}main(); \ No newline at end of file +var _0x4bf4=['BlackLists','Error\x20processing\x20rows\x20block:','stringify','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','CSV\x20import\x20process\x20stopped!','createReadStream','duplicate','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','util','lodash','squel','papaparse','ioredis','../../../config/environment','api','redis','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','test','isNil','errors','length','map','message','error','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','cmContact','checkHopper','inspect','insert','into','cm_hopper','phone','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','fromQuery','cm_contacts','id\x20IN\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','\x20=\x20?','str','cm_hopper_black','VoiceQueue','findAll','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','outbound','Campaign','CampaignId'];(function(_0x47fd54,_0x1097c6){var _0x98e1d7=function(_0x1f51eb){while(--_0x1f51eb){_0x47fd54['push'](_0x47fd54['shift']());}};_0x98e1d7(++_0x1097c6);}(_0x4bf4,0xed));var _0x44bf=function(_0x48092d,_0x4e1c8a){_0x48092d=_0x48092d-0x0;var _0x2cb71c=_0x4bf4[_0x48092d];return _0x2cb71c;};'use strict';var BPromise=require(_0x44bf('0x0'));var util=require(_0x44bf('0x1'));var _=require(_0x44bf('0x2'));var fs=require('fs');var squel=require(_0x44bf('0x3'));var Papa=require(_0x44bf('0x4'));var Redis=require(_0x44bf('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0x44bf('0x6'));var logger=require('../../../config/logger')(_0x44bf('0x7'));config[_0x44bf('0x8')]=_[_0x44bf('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x44bf('0xa'))(new Redis(config['redis']));require(_0x44bf('0xb'))['register'](socket);try{if(!process[_0x44bf('0xc')][0x2]||process[_0x44bf('0xc')][0x2]===_0x44bf('0xd')||process[_0x44bf('0xc')][0x2]===_0x44bf('0xe')){throw new Error(_0x44bf('0xf'));}var FILEPATH=process[_0x44bf('0xc')][0x2];if(!process['argv'][0x3]||process[_0x44bf('0xc')][0x3]===_0x44bf('0xd')||process[_0x44bf('0xc')][0x3]===_0x44bf('0xe')||!process[_0x44bf('0xc')][0x4]||process['argv'][0x4]===_0x44bf('0xd')||process[_0x44bf('0xc')][0x4]===_0x44bf('0xe')){throw new Error(_0x44bf('0x10'));}var FIELDS=_[_0x44bf('0x11')](process[_0x44bf('0xc')][0x3][_0x44bf('0x12')](','),process[_0x44bf('0xc')][0x4][_0x44bf('0x12')](','));if(!process[_0x44bf('0xc')][0x5]||process[_0x44bf('0xc')][0x5]===_0x44bf('0xd')||process['argv'][0x5]===_0x44bf('0xe')){throw new Error(_0x44bf('0x13'));}var LISTID=process[_0x44bf('0xc')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x44bf('0xc')][0x6]!==_0x44bf('0xd')&&process[_0x44bf('0xc')][0x6]!==_0x44bf('0xe')?process[_0x44bf('0xc')][0x6]:null;var DUPLICATES=process[_0x44bf('0xc')][0x7]&&process[_0x44bf('0xc')][0x7]!=='undefined'&&process[_0x44bf('0xc')][0x7]!==_0x44bf('0xe')?process['argv'][0x7]:null;if(!process[_0x44bf('0xc')][0x8]||process[_0x44bf('0xc')][0x8]==='undefined'||process[_0x44bf('0xc')][0x8]==='null'){throw new Error(_0x44bf('0x14'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x3560be){logger['error'](_0x3560be);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(_0x5b61f6,_0x476381,_0xcf8be2,_0x51f11a){var _0x16a516={'message':_0x476381};_0x16a516[_0x5b61f6]=!![];if(_0xcf8be2){_0x16a516[_0x44bf('0x15')]=_0xcf8be2;}if(_0x51f11a){_0x16a516['index']=_0x51f11a;}return _0x16a516;}function isEmail(_0x36388f){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))*$/[_0x44bf('0x16')](_0x36388f);}function checkRow(_0x5472a4,_0x274d3f,_0x1075a6){return new BPromise(function(_0x40d471,_0x21e2e1){if(_[_0x44bf('0x17')](_0x5472a4)){return _0x21e2e1(handleCheckRowError('error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x1075a6));}if(_0x5472a4[_0x44bf('0x18')]&&_0x5472a4[_0x44bf('0x18')][_0x44bf('0x19')]){var _0x4c10c5=_[_0x44bf('0x1a')](_0x5472a4[_0x44bf('0x18')],_0x44bf('0x1b'))['join'](';');return _0x21e2e1(handleCheckRowError(_0x44bf('0x1c'),_0x4c10c5,null,_0x1075a6));}var _0x4bc775={};for(var _0x44b503 in FIELDS){if(FIELDS[_0x44bf('0x1d')](_0x44b503)&&FIELDS[_0x44b503]){_0x4bc775[_0x44b503]=_0x5472a4[_0x44bf('0x1e')][0x0][FIELDS[_0x44b503]]||_0x5472a4[_0x44bf('0x1e')][0x0]['\ufeff'+FIELDS[_0x44b503]];}}if(!_0x4bc775[_0x44bf('0x1f')]){return _0x21e2e1(handleCheckRowError('error',_0x44bf('0x20'),null,_0x1075a6));}if(!_0x4bc775['phone']){return _0x21e2e1(handleCheckRowError(_0x44bf('0x1c'),_0x44bf('0x21'),null,_0x1075a6));}if(_0x4bc775[_0x44bf('0x22')]){var _0xcf2dd7=moment(_0x4bc775[_0x44bf('0x22')],'YYYY-MM-DD');if(!_0xcf2dd7[_0x44bf('0x23')]()){return _0x21e2e1(handleCheckRowError(_0x44bf('0x1c'),_0x44bf('0x24'),null,_0x1075a6));}}if(_0x4bc775[_0x44bf('0x25')]){if(!isEmail(_0x4bc775['email'])){return _0x21e2e1(handleCheckRowError('error',_0x44bf('0x26'),null,_0x1075a6));}}_0x4bc775[_0x44bf('0x27')]=LISTID;_0x4bc775[_0x44bf('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x44bf('0x19')]&&_0x274d3f){var _0x1790f5={};for(var _0x62cc5c=0x0,_0x4bca5c=DUPLICATES[_0x44bf('0x19')];_0x62cc5c<_0x4bca5c;_0x62cc5c+=0x1){_0x1790f5[DUPLICATES[_0x62cc5c]]=_0x4bc775[DUPLICATES[_0x62cc5c]];}var _0x354f31=_['find'](_0x274d3f,_0x1790f5);if(_0x354f31){return _0x21e2e1(handleCheckRowError('duplicate',_0x44bf('0x29'),_0x354f31,_0x1075a6));}}return db[_0x44bf('0x2a')][_0x44bf('0x2b')](_0x4bc775,{'raw':!![],'hooks':![],'fields':_[_0x44bf('0x2c')](_0x4bc775)})[_0x44bf('0x2d')](function(_0xee9b82){if(DUPLICATES&&DUPLICATES[_0x44bf('0x19')]&&_0x274d3f){_0x274d3f[_0x44bf('0x2e')](_[_0x44bf('0x2f')](_0x4bc775,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xee9b82['id'];return _0x40d471();})[_0x44bf('0x30')](function(_0x2651ca){return _0x21e2e1(handleCheckRowError(_0x44bf('0x1c'),_0x44bf('0x31')+(_0x2651ca[_0x44bf('0x1b')]||JSON['stringify'](_0x2651ca)),null,_0x1075a6));});});}function checkHopper(){function _0x1f76f3(){return function(_0x194222){logger[_0x44bf('0x1c')](_0x44bf('0x32'),_0x44bf('0x33'),util[_0x44bf('0x34')](_0x194222,{'showHidden':![],'depth':null}));};}var _0x57a736=function(_0x10b3d8,_0x26bd17){var _0x4c5b8b=squel[_0x44bf('0x35')]()[_0x44bf('0x36')](_0x44bf('0x37'))['fromQuery']([_0x44bf('0x38'),_0x44bf('0x39'),_0x44bf('0x3a'),'ListId',_0x26bd17,_0x44bf('0x3b'),_0x44bf('0x3c')],squel[_0x44bf('0x3d')]()['field'](_0x44bf('0x38'),_0x44bf('0x38'))[_0x44bf('0x3e')](_0x44bf('0x3f'),_0x44bf('0x39'))['field']('id','ContactId')[_0x44bf('0x3e')](LISTID[_0x44bf('0x40')](),_0x44bf('0x27'))[_0x44bf('0x3e')](_0x10b3d8['id']['toString'](),_0x26bd17)[_0x44bf('0x3e')](_0x44bf('0x3f'),'createdAt')[_0x44bf('0x3e')](_0x44bf('0x3f'),_0x44bf('0x3c'))[_0x44bf('0x41')]('cm_contacts')[_0x44bf('0x42')](_0x44bf('0x43'))[_0x44bf('0x42')](_0x44bf('0x44'),LISTID[_0x44bf('0x40')]())[_0x44bf('0x42')]('phone\x20IS\x20NOT\x20NULL')[_0x44bf('0x42')](_0x44bf('0x45'),squel[_0x44bf('0x3d')]()['field']('phone')['from'](_0x44bf('0x37'))['where'](_0x26bd17+'\x20=\x20?',_0x10b3d8['id'][_0x44bf('0x40')]())))['toString']();return _0x4c5b8b;};var _0xb475b1=function(_0x3c2214,_0x25d25e){var _0x95b63a=squel[_0x44bf('0x35')]()[_0x44bf('0x36')](_0x44bf('0x37'))[_0x44bf('0x46')]([_0x44bf('0x38'),_0x44bf('0x39'),'ContactId','ListId',_0x25d25e,_0x44bf('0x3b'),_0x44bf('0x3c')],squel[_0x44bf('0x3d')]()['field'](_0x44bf('0x38'),'phone')['field'](_0x44bf('0x3f'),'scheduledAt')[_0x44bf('0x3e')]('id',_0x44bf('0x3a'))[_0x44bf('0x3e')](LISTID[_0x44bf('0x40')](),'ListId')[_0x44bf('0x3e')](_0x3c2214['id'][_0x44bf('0x40')](),_0x25d25e)[_0x44bf('0x3e')](_0x44bf('0x3f'),_0x44bf('0x3b'))[_0x44bf('0x3e')]('NOW()',_0x44bf('0x3c'))[_0x44bf('0x41')](_0x44bf('0x47'))[_0x44bf('0x42')](_0x44bf('0x43'))[_0x44bf('0x42')](_0x44bf('0x44'),LISTID['toString']())[_0x44bf('0x42')](_0x44bf('0x48'),squel['str'](hopperContacts))[_0x44bf('0x42')](_0x44bf('0x49'))[_0x44bf('0x42')](_0x44bf('0x45'),squel[_0x44bf('0x3d')]()[_0x44bf('0x3e')]('calleridnum')[_0x44bf('0x41')](_0x44bf('0x4a'))[_0x44bf('0x42')](_0x25d25e+'\x20=\x20?',_0x3c2214['id'][_0x44bf('0x40')]()))[_0x44bf('0x42')](_0x44bf('0x45'),squel['select']()['field'](_0x44bf('0x38'))[_0x44bf('0x41')](_0x44bf('0x37'))[_0x44bf('0x42')](_0x25d25e+_0x44bf('0x4b'),_0x3c2214['id'][_0x44bf('0x40')]())))[_0x44bf('0x40')]();return _0x95b63a;};function _0x3d7fbb(_0x352c5c,_0x3ed702){var _0x547119=squel[_0x44bf('0x35')]()['into'](_0x44bf('0x37'))[_0x44bf('0x46')](['phone',_0x44bf('0x39'),_0x44bf('0x3a'),'ListId',_0x3ed702,'createdAt','updatedAt'],squel[_0x44bf('0x3d')]()['field']('phone',_0x44bf('0x38'))[_0x44bf('0x3e')](_0x44bf('0x3f'),_0x44bf('0x39'))[_0x44bf('0x3e')]('id',_0x44bf('0x3a'))[_0x44bf('0x3e')](LISTID['toString'](),_0x44bf('0x27'))[_0x44bf('0x3e')](_0x352c5c['id'][_0x44bf('0x40')](),_0x3ed702)['field'](_0x44bf('0x3f'),_0x44bf('0x3b'))['field'](_0x44bf('0x3f'),_0x44bf('0x3c'))['from'](_0x44bf('0x47'))[_0x44bf('0x42')](_0x44bf('0x43'))['where'](_0x44bf('0x44'),LISTID['toString']())[_0x44bf('0x42')](_0x44bf('0x48'),squel[_0x44bf('0x4c')](hopperContacts))[_0x44bf('0x42')]('phone\x20IS\x20NOT\x20NULL'))[_0x44bf('0x40')]();return _0x547119;}function _0x551e7e(_0x369e9c,_0x35c44d){var _0x584043=squel[_0x44bf('0x35')]()[_0x44bf('0x36')](_0x44bf('0x4d'))[_0x44bf('0x46')]([_0x44bf('0x38'),_0x44bf('0x3a'),_0x44bf('0x27'),_0x35c44d,_0x44bf('0x3b'),_0x44bf('0x3c')],squel['select']()[_0x44bf('0x3e')]('phone',_0x44bf('0x38'))[_0x44bf('0x3e')]('id',_0x44bf('0x3a'))['field'](LISTID[_0x44bf('0x40')](),'ListId')[_0x44bf('0x3e')](_0x369e9c['id']['toString'](),_0x35c44d)[_0x44bf('0x3e')](_0x44bf('0x3f'),_0x44bf('0x3b'))[_0x44bf('0x3e')](_0x44bf('0x3f'),_0x44bf('0x3c'))['from'](_0x44bf('0x47'))[_0x44bf('0x42')]('deletedAt\x20IS\x20NULL')[_0x44bf('0x42')](_0x44bf('0x44'),LISTID[_0x44bf('0x40')]())['where'](_0x44bf('0x48'),squel[_0x44bf('0x4c')](hopperContacts))[_0x44bf('0x42')]('phone\x20IS\x20NOT\x20NULL'))[_0x44bf('0x40')]();return _0x584043;}return db[_0x44bf('0x4e')][_0x44bf('0x4f')]({'where':{'type':'outbound'},'attributes':['id',_0x44bf('0x50')],'include':[{'model':db[_0x44bf('0x51')],'as':_0x44bf('0x52'),'where':{'id':LISTID}}]})[_0x44bf('0x2d')](function(_0x5aac6c){var _0x5171b3=[];if(_0x5aac6c){var _0xc11a68;for(var _0x2d9fc4=0x0,_0x449ef9;_0x2d9fc4<_0x5aac6c[_0x44bf('0x19')];_0x2d9fc4+=0x1){_0x449ef9=_0x5aac6c[_0x2d9fc4][_0x44bf('0x53')]({'plain':!![]});switch(_0x449ef9['dialCheckDuplicateType']){case _0x44bf('0x54'):_0x5171b3[_0x44bf('0x2e')](db[_0x44bf('0x55')][_0x44bf('0x56')](_0xb475b1(_0x449ef9,_0x44bf('0x57')))[_0x44bf('0x2d')](function(){})[_0x44bf('0x30')](_0x1f76f3()));break;case _0x44bf('0x58'):_0x5171b3[_0x44bf('0x2e')](db['sequelize'][_0x44bf('0x56')](_0x57a736(_0x449ef9,_0x44bf('0x57')))[_0x44bf('0x2d')](function(){})[_0x44bf('0x30')](_0x1f76f3()));break;default:_0x5171b3[_0x44bf('0x2e')](db[_0x44bf('0x55')][_0x44bf('0x56')](_0x3d7fbb(_0x449ef9,'VoiceQueueId'))[_0x44bf('0x2d')](function(){})[_0x44bf('0x30')](_0x1f76f3()));}}}return _0x5171b3;})[_0x44bf('0x59')]()[_0x44bf('0x2d')](function(){return db[_0x44bf('0x4e')][_0x44bf('0x4f')]({'where':{'type':_0x44bf('0x5a')},'attributes':['id'],'include':[{'model':db[_0x44bf('0x51')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x44bf('0x2d')](function(_0xe3481d){var _0x35e6af=[];if(_0xe3481d){var _0x30c135;for(var _0x2699d7=0x0,_0x2af20d;_0x2699d7<_0xe3481d[_0x44bf('0x19')];_0x2699d7+=0x1){_0x2af20d=_0xe3481d[_0x2699d7][_0x44bf('0x53')]({'plain':!![]});_0x35e6af[_0x44bf('0x2e')](db[_0x44bf('0x55')][_0x44bf('0x56')](_0x551e7e(_0x2af20d,'VoiceQueueId'))['then'](function(){})['catch'](_0x1f76f3()));}}return _0x35e6af;})[_0x44bf('0x59')]();})[_0x44bf('0x2d')](function(){return db[_0x44bf('0x5b')][_0x44bf('0x4f')]({'attributes':['id',_0x44bf('0x50')],'include':[{'model':db[_0x44bf('0x51')],'as':_0x44bf('0x52'),'where':{'id':LISTID}}]})[_0x44bf('0x2d')](function(_0x378936){var _0x1d1056=[];if(_0x378936){for(var _0x5a5496=0x0,_0x453223;_0x5a5496<_0x378936['length'];_0x5a5496+=0x1){_0x453223=_0x378936[_0x5a5496][_0x44bf('0x53')]({'plain':!![]});switch(_0x453223['dialCheckDuplicateType']){case _0x44bf('0x54'):_0x1d1056[_0x44bf('0x2e')](db['sequelize']['query'](_0xb475b1(_0x453223,_0x44bf('0x5c')))[_0x44bf('0x2d')](function(){})[_0x44bf('0x30')](_0x1f76f3()));break;case _0x44bf('0x58'):_0x1d1056[_0x44bf('0x2e')](db[_0x44bf('0x55')]['query'](_0x57a736(_0x453223,_0x44bf('0x5c')))['then'](function(){})[_0x44bf('0x30')](_0x1f76f3()));break;default:_0x1d1056[_0x44bf('0x2e')](db[_0x44bf('0x55')][_0x44bf('0x56')](_0x3d7fbb(_0x453223,_0x44bf('0x5c')))[_0x44bf('0x2d')](function(){})[_0x44bf('0x30')](_0x1f76f3()));}}}return _0x1d1056;})[_0x44bf('0x59')]();})['then'](function(){return db[_0x44bf('0x5b')][_0x44bf('0x4f')]({'attributes':['id'],'include':[{'model':db[_0x44bf('0x51')],'as':_0x44bf('0x5d'),'where':{'id':LISTID}}]})[_0x44bf('0x2d')](function(_0x1135c6){var _0x4eeb36=[];if(_0x1135c6){for(var _0x16438c=0x0,_0x400e31;_0x16438c<_0x1135c6[_0x44bf('0x19')];_0x16438c+=0x1){_0x400e31=_0x1135c6[_0x16438c][_0x44bf('0x53')]({'plain':!![]});_0x4eeb36[_0x44bf('0x2e')](db[_0x44bf('0x55')][_0x44bf('0x56')](_0x551e7e(_0x400e31,_0x44bf('0x5c')))[_0x44bf('0x2d')](function(){})[_0x44bf('0x30')](_0x1f76f3()));}}return _0x4eeb36;})[_0x44bf('0x59')]();})[_0x44bf('0x30')](function(_0x3134a1){logger[_0x44bf('0x1c')]('cmContact,\x20%s,\x20%s','generalCheckHopper',_0x3134a1[_0x44bf('0x1b')]);});}var processPromises=function(_0x240b0c){return BPromise[_0x44bf('0x59')](promises)[_0x44bf('0x2d')](function(_0xe32d43){})['catch'](function(_0x27515f){logger[_0x44bf('0x1c')](_0x44bf('0x5e'),JSON[_0x44bf('0x5f')](_0x27515f));})[_0x44bf('0x60')](function(){socket[_0x44bf('0x61')](_0x44bf('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x240b0c){return _0x240b0c[_0x44bf('0x63')]();}});};var endCsv=function(){return BPromise[_0x44bf('0x64')]()[_0x44bf('0x2d')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x44bf('0x61')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x44bf('0x65')](FILEPATH);}catch(_0xc547f5){logger[_0x44bf('0x1c')](_0x44bf('0x66'),JSON[_0x44bf('0x5f')](_0xc547f5));}finally{process[_0x44bf('0x67')](0x0);}});};process['on']('SIGINT',function(){logger[_0x44bf('0x68')](_0x44bf('0x69'));endCsv();});function main(){return BPromise[_0x44bf('0x64')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x44bf('0x2a')][_0x44bf('0x4f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x44bf('0x2d')](function(_0x4b00ba){var _0x98adff=fs[_0x44bf('0x6a')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x98adff,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1b73a6,_0x3ffe6b){total+=0x1;var _0x4619e6=total;promises[_0x44bf('0x2e')](checkRow(_0x1b73a6,_0x4b00ba,_0x4619e6)[_0x44bf('0x2d')](function(){success+=0x1;})['catch'](function(_0x3a11d5){if(_0x3a11d5[_0x44bf('0x1c')]){errors+=0x1;delete _0x3a11d5[_0x44bf('0x1c')];}else if(_0x3a11d5[_0x44bf('0x6b')]){duplicates+=0x1;delete _0x3a11d5[_0x44bf('0x6b')];}rows['push'](_0x3a11d5);}));if(total%0xc8===0x0){_0x3ffe6b['pause']();return processPromises(_0x3ffe6b);}},'complete':function(){return processPromises()[_0x44bf('0x2d')](function(){logger['info'](_0x44bf('0x6c'));endCsv();});},'error':function(_0x6bc6f9,_0x5bba46){logger['info'](_0x44bf('0x6d'),JSON[_0x44bf('0x5f')](_0x6bc6f9));endCsv();}});})[_0x44bf('0x30')](function(_0x523665){logger[_0x44bf('0x1c')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x44bf('0x5f')](_0x523665));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 96c8f12..a629ba4 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 _0x76d3=['CmHopperId','OrderBy','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','error','message','exit','errors','code','sequelize','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','utcOffset','set','offset','dialTimezone','query','main','stringify','send','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','includes','header','name','writeFileSync','createReadStream','data','find','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','itemTypeId','description','SystemRow','appendFileSync','rows','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','scheduledat',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','contactTypeId','VoiceQueueId','CampaignId','campaigns_has_cm_blacklists','voice_queues_has_cm_blacklists','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../config/environment','../../../config/environment/shared','../../../config/logger','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','then','length','push','all','split','isNil','CmContactHasItem','findOne','update','updated','create','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','createdAt','updatedAt','priority','UserId','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22onlyIfOpen\x22','\x22always\x22','toString','cm_contacts.phone','ContactId','ListId','fields','.CmListId\x20=\x20?','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','fromQuery','cm_contacts.ListId','cm_hopper_black','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt'];(function(_0x4d13cc,_0x4616d6){var _0x553e16=function(_0x5a060c){while(--_0x5a060c){_0x4d13cc['push'](_0x4d13cc['shift']());}};_0x553e16(++_0x4616d6);}(_0x76d3,0x12d));var _0x376d=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x76d3[_0x502c7d];return _0x30b7ed;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x376d('0x0'));var Papa=require(_0x376d('0x1'));var util=require(_0x376d('0x2'));var BPromise=require(_0x376d('0x3'));var moment=require(_0x376d('0x4'));var squel=require(_0x376d('0x5'));var Redis=require(_0x376d('0x6'));var db=require('../../../mysqldb')['db'];var config=require(_0x376d('0x7'));var shared=require(_0x376d('0x8'));var logger=require(_0x376d('0x9'))('import');config[_0x376d('0xa')]=_[_0x376d('0xb')](config[_0x376d('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x376d('0xc'))(new Redis(config[_0x376d('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x376d('0xd')](_0x376d('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0x376d('0xe'));function isEmail(_0x307cdb){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))*$/[_0x376d('0xf')](_0x307cdb);}function selectNotIn(_0x544c54,_0x101747,_0x427808,_0x5f00f6,_0x143f5d){return squel[_0x376d('0x10')]()[_0x376d('0x11')](_0x376d('0x12'))[_0x376d('0x13')](_0x5f00f6)[_0x376d('0x14')](_0x101747,null,_0x101747+_0x376d('0x15')+_0x5f00f6+'.'+_0x427808)[_0x376d('0x16')](_0x5f00f6+'.'+_0x427808+_0x376d('0x17')+_0x544c54+'.'+_0x427808)[_0x376d('0x16')](_0x101747+_0x376d('0x18')+_0x143f5d[_0x376d('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x46ae72,_0x378197){promisesAdditionalPhones=[];return db[_0x376d('0x19')][_0x376d('0x1a')]({'raw':!![],'attributes':['id',_0x376d('0x1b')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x376d('0x1c')](function(_0x5a4b62){if(_0x5a4b62!==null){var _0x267bd0=[];for(var _0x430587=0x0;_0x430587<_0x5a4b62[_0x376d('0x1d')];_0x430587++){var _0x436c40=_0x5a4b62[_0x430587];_0x267bd0[_0x376d('0x1e')](insertAdditionalPhones(_0x436c40));}}Promise[_0x376d('0x1f')](_0x267bd0)['then'](function(){_0x46ae72({'val':0x1});});});});}function insertAdditionalPhones(_0x399419){return new Promise(function(_0x60510b,_0x68b164){var _0x112dc7=_0x399419[_0x376d('0x1b')];var _0x29ee26=_0x112dc7[_0x376d('0x20')](';');var _0x1de39c=[];orderBy=0x0;for(var _0x17168a=0x0;_0x17168a<_0x29ee26[_0x376d('0x1d')];_0x17168a++){_0x1de39c[_0x376d('0x1e')](splitAdditionalPhone(_0x399419['id'],_0x29ee26[_0x17168a]));}Promise[_0x376d('0x1f')](_0x1de39c)['then'](function(){_0x60510b({'val':_0x29ee26['length']});});});}function splitAdditionalPhone(_0x3ec8c2,_0x2c9b48){return new Promise(function(_0x14d856,_0x1c0c30){var _0x4f6754=_0x2c9b48['split'](':');var _0x2924e1=_0x4f6754[0x0];var _0x54aafc=_0x4f6754[0x1];if(!_[_0x376d('0x21')](_0x54aafc)){var _0x5c0f91=_0x54aafc['split']('|');var _0x3ec3d5=[];for(var _0x405f40=0x0;_0x405f40<_0x5c0f91[_0x376d('0x1d')];_0x405f40++){if(_0x5c0f91[_0x405f40]!==''){var _0x6604a8=_['filter'](promisesAdditionalPhones,{'contactId':_0x3ec8c2,'phone':_0x5c0f91[_0x405f40]});if(_0x6604a8['length']==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x3ec8c2,'contactTypeId':_0x2924e1,'phone':_0x5c0f91[_0x405f40],'orderBy':orderBy});}}}_0x14d856({'ok':0x1});}else _0x14d856({'res':0x0});});}function createAdditionalPhone(_0x392b3d,_0x2efa7d,_0x43c5a9,_0x27eb31){var _0x18c369='';var _0x5f13da='';var _0x469ce5=_0x43c5a9['split']('§');_0x18c369=_0x469ce5[0x0];if(_0x469ce5[_0x376d('0x1d')]==0x2)_0x5f13da=_0x469ce5[0x1];return new Promise(function(_0x535125,_0x4fbae6){return db[_0x376d('0x22')][_0x376d('0x23')]({'where':{'CmContactId':_0x392b3d,'item':_0x18c369}})[_0x376d('0x1c')](function(_0x211c46){if(_0x211c46){return db[_0x376d('0x22')][_0x376d('0x24')]({'ItemTypeId':_0x2efa7d,'description':_0x5f13da,'OrderBy':_0x27eb31},{'where':{'CmContactId':_0x392b3d,'item':_0x18c369}})[_0x376d('0x1c')](function(_0x49e2ce){_0x535125({'res':_0x376d('0x25')});});}else{return db[_0x376d('0x22')][_0x376d('0x26')]({'CmContactId':_0x392b3d,'item':_0x18c369,'description':_0x5f13da,'ItemTypeId':_0x2efa7d,'OrderBy':_0x27eb31,'ItemClass':'PHONE'})['then'](function(_0x3dc236){_0x535125({'res':'inserted'});});}});});}function insertCmHopper(_0x5eb955,_0x2c4dcb,_0x33679b,_0x5138e5,_0x4b4f98){var _0x543540=['cm_contacts.phone',_0x376d('0x27'),_0x376d('0x28'),'cm_contacts.ListId',_0x2c4dcb+'.'+_0x5138e5,_0x376d('0x29'),_0x376d('0x2a'),_0x376d('0x2b'),_0x376d('0x2c'),'\x22'+_0x4b4f98+'\x22'];return squel[_0x376d('0x2d')]()[_0x376d('0x2e')]('cm_hopper')['fromQuery']([_0x376d('0x12'),'scheduledat','ContactId','ListId',_0x5138e5,_0x376d('0x2f'),_0x376d('0x30'),_0x376d('0x31'),_0x376d('0x32'),_0x376d('0x33')],squel['select']()['fields'](_0x543540)[_0x376d('0x13')](_0x2c4dcb)['join'](_0x376d('0x34'),null,_0x376d('0x35')+_0x2c4dcb+_0x376d('0x36'))['join'](_0x33679b,null,_0x33679b+'.id\x20=\x20'+_0x2c4dcb+'.'+_0x5138e5)[_0x376d('0x16')](_0x2c4dcb+'.CmListId\x20=\x20?',_0x5eb955)[_0x376d('0x16')](_0x376d('0x37'),NOW)[_0x376d('0x16')](_0x376d('0x38'),selectNotIn(_0x2c4dcb,_0x33679b,_0x5138e5,_0x376d('0x39'),['\x22always\x22',_0x376d('0x3a')]))[_0x376d('0x16')](_0x376d('0x38'),selectNotIn(_0x2c4dcb,_0x33679b,_0x5138e5,_0x376d('0x39'),[_0x376d('0x3b')])))[_0x376d('0x3c')]();}function insertCmHopperBlack(_0x8f4e5c,_0x34b143,_0x5152b4,_0x241888){var _0x47c4c8=[_0x376d('0x3d'),_0x376d('0x28'),'cm_contacts.ListId',_0x34b143+'.'+_0x241888,_0x376d('0x29'),_0x376d('0x2a')];return squel[_0x376d('0x2d')]()[_0x376d('0x2e')]('cm_hopper_black')['fromQuery'](['phone',_0x376d('0x3e'),_0x376d('0x3f'),_0x241888,_0x376d('0x2f'),'updatedAt'],squel[_0x376d('0x10')]()[_0x376d('0x40')](_0x47c4c8)['from'](_0x34b143)[_0x376d('0x14')](_0x376d('0x34'),null,_0x376d('0x35')+_0x34b143+_0x376d('0x36'))[_0x376d('0x14')](_0x5152b4,null,_0x5152b4+_0x376d('0x15')+_0x34b143+'.'+_0x241888)['where'](_0x34b143+_0x376d('0x41'),_0x8f4e5c)[_0x376d('0x16')](_0x376d('0x37'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x376d('0x10')]()[_0x376d('0x11')](_0x376d('0x12'))[_0x376d('0x13')]('cm_hopper_black')[_0x376d('0x16')](_0x376d('0x42'),_0x8f4e5c)[_0x376d('0x16')](_0x241888+_0x376d('0x17')+_0x34b143+'.'+_0x241888)))['toString']();}function insertTzCmHopper(_0x45c12e,_0x588e1e,_0x222d24,_0xbba296,_0x4f37ec,_0x3f9463){var _0x340125=[_0x376d('0x3d'),_0x376d('0x43')+_0x3f9463+_0x376d('0x44'),_0x376d('0x28'),'cm_contacts.ListId',_0x588e1e+'.'+_0xbba296,_0x376d('0x29'),_0x376d('0x2a'),'cm_contacts.priority',_0x376d('0x2c'),'\x22'+_0x4f37ec+'\x22'];var _0x5206a8=squel[_0x376d('0x2d')]()[_0x376d('0x2e')](_0x376d('0x39'))[_0x376d('0x45')](['phone','scheduledat',_0x376d('0x3e'),_0x376d('0x3f'),_0xbba296,_0x376d('0x2f'),_0x376d('0x30'),_0x376d('0x31'),_0x376d('0x32'),_0x376d('0x33')],squel[_0x376d('0x10')]()['fields'](_0x340125)['from'](_0x588e1e)[_0x376d('0x14')](_0x376d('0x34'),null,'cm_contacts.ListId\x20=\x20'+_0x588e1e+_0x376d('0x36'))[_0x376d('0x14')](_0x222d24,null,_0x222d24+_0x376d('0x15')+_0x588e1e+'.'+_0xbba296)[_0x376d('0x14')](_0x3f9463,null,_0x3f9463+_0x376d('0x15')+_0x588e1e+'.'+_0xbba296)['where'](_0x588e1e+'.CmListId\x20=\x20?',_0x45c12e)[_0x376d('0x16')](_0x376d('0x37'),NOW)[_0x376d('0x16')](_0x376d('0x38'),selectNotIn(_0x588e1e,_0x222d24,_0xbba296,_0x376d('0x39'),[_0x376d('0x3b'),_0x376d('0x3a')]))[_0x376d('0x16')](_0x376d('0x38'),selectNotIn(_0x588e1e,_0x222d24,_0xbba296,'cm_hopper',[_0x376d('0x3b')])))['toString']();return _0x5206a8;}function insertTzCmHopperBlack(_0x161498,_0x1c8bb6,_0x513611,_0x427a00){var _0x17592c=['cm_contacts.phone',_0x376d('0x28'),_0x376d('0x46'),_0x1c8bb6+'.'+_0x427a00,_0x376d('0x29'),_0x376d('0x2a')];return squel['insert']()['into']('cm_hopper_black')[_0x376d('0x45')](['phone',_0x376d('0x3e'),'ListId',_0x427a00,_0x376d('0x2f'),_0x376d('0x30')],squel[_0x376d('0x10')]()[_0x376d('0x40')](_0x17592c)[_0x376d('0x13')](_0x1c8bb6)['join'](_0x376d('0x34'),null,_0x376d('0x35')+_0x1c8bb6+_0x376d('0x36'))[_0x376d('0x14')](_0x513611,null,_0x513611+_0x376d('0x15')+_0x1c8bb6+'.'+_0x427a00)[_0x376d('0x16')](_0x1c8bb6+'.CmListId\x20=\x20?',_0x161498)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x376d('0x16')](_0x376d('0x38'),squel[_0x376d('0x10')]()[_0x376d('0x11')](_0x376d('0x12'))[_0x376d('0x13')](_0x376d('0x47'))[_0x376d('0x16')](_0x376d('0x42'),_0x161498)[_0x376d('0x16')](_0x427a00+_0x376d('0x17')+_0x1c8bb6+'.'+_0x427a00)))[_0x376d('0x3c')]();}function insertCmHopperAdditionalPhones(_0x190d02){var _0xd596a7=[_0x376d('0x48'),'cm_contact_has_items.item',_0x376d('0x49'),'cm_contact_has_items.createdAt',_0x376d('0x4a')];return squel['insert']()[_0x376d('0x2e')]('cm_hopper_additional_phones')[_0x376d('0x45')]([_0x376d('0x4b'),_0x376d('0x12'),_0x376d('0x4c'),'createdAt',_0x376d('0x30')],squel[_0x376d('0x10')]()[_0x376d('0x40')](_0xd596a7)[_0x376d('0x13')](_0x376d('0x39'))[_0x376d('0x14')]('cm_contacts',null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x376d('0x14')](_0x376d('0x4d'),null,_0x376d('0x4e'))['where'](_0x376d('0x4f'),_0x190d02)[_0x376d('0x16')](_0x376d('0x37'),NOW))[_0x376d('0x3c')]();}function insertCmContact(_0x54bb60,_0x8e1b83,_0x790d25,_0x3abeaf){var _0x118a96=_[_0x376d('0x50')](_[_0x376d('0x51')](_0x3abeaf),['ListId',_0x376d('0x52'),_0x376d('0x2f'),_0x376d('0x30')]);return squel['insert']()[_0x376d('0x2e')]('cm_contacts')[_0x376d('0x45')](_0x118a96,squel['select']()[_0x376d('0x40')](_0x118a96)[_0x376d('0x13')](_0x8e1b83)[_0x376d('0x16')]('('+_0x790d25[_0x376d('0x14')](',')+_0x376d('0x53'),squel[_0x376d('0x10')]()[_0x376d('0x40')](_0x790d25)[_0x376d('0x13')](_0x376d('0x34'))[_0x376d('0x16')](_0x376d('0x42'),_0x54bb60)[_0x376d('0x16')](_0x376d('0x54')))[_0x376d('0x16')](_0x376d('0x55'),squel['select']()['field'](_0x376d('0x56'),_0x376d('0x57'))[_0x376d('0x13')](_0x8e1b83)['group'](_0x790d25[_0x376d('0x14')](','))))['toString']();}function handleStop(){logger[_0x376d('0x58')](_0x376d('0x59'));stopped=!![];}function handleUncaughtException(_0x3d9e01){logger[_0x376d('0x5a')](_0x3d9e01[_0x376d('0x5b')]);process[_0x376d('0x5c')](0x1);}function handleError(_0x1ae566,_0x4baa6b){stats[_0x376d('0x5d')]['push']({'name':_0x4baa6b[_0x376d('0x5e')],'message':_0x4baa6b[_0x376d('0x5b')],'row':_0x1ae566});}function handleQuery(_0x3715e0){logger[_0x376d('0x58')](_0x3715e0);return db[_0x376d('0x5f')]['query'](_0x3715e0)[_0x376d('0x60')](function(_0xac4ad7){results[_0x376d('0x1e')](_0xac4ad7);})[_0x376d('0x61')](function(_0x3a5fb4){logger[_0x376d('0x5a')](_0x3a5fb4[_0x376d('0x5b')]);});}function updateTzCampaigns(_0x52949e){return new Promise(function(_0x4d3faf,_0x26ad76){var _0x5611c7=squel['select']()[_0x376d('0x40')]([_0x376d('0x62'),_0x376d('0x63')])[_0x376d('0x13')](_0x376d('0x64'))['join'](_0x376d('0x65'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')[_0x376d('0x16')]('campaigns_has_cm_lists.CmListId='+_0x52949e);db[_0x376d('0x5f')]['query'](_0x5611c7['toString']())['spread'](function(_0x215716){var _0x4eed9c=[];for(var _0x44cf5c=0x0;_0x44cf5c<_0x215716['length'];_0x44cf5c++){_0x4eed9c[_0x376d('0x1e')](getTimezoneData(_0x215716[_0x44cf5c],tmp_campaigns));}BPromise['all'](_0x4eed9c)['then'](function(){_0x4d3faf({'val':0x1});});})[_0x376d('0x61')](function(_0x2826f2){logger[_0x376d('0x5a')](_0x2826f2[_0x376d('0x5b')]);_0x4d3faf({'val':0x0});});});}function updateTzVoiceQueues(_0x563cbd){return new Promise(function(_0x1aa240,_0x44bf79){var _0x55c7d5=squel[_0x376d('0x10')]()['fields']([_0x376d('0x66'),_0x376d('0x67')])['from'](_0x376d('0x68'))[_0x376d('0x14')](_0x376d('0x69'),null,_0x376d('0x6a'))[_0x376d('0x16')](_0x376d('0x6b')+_0x563cbd);db['sequelize']['query'](_0x55c7d5['toString']())['spread'](function(_0x3ce31c){var _0x2a5594=[];for(var _0x202e89=0x0;_0x202e89<_0x3ce31c['length'];_0x202e89++){_0x2a5594[_0x376d('0x1e')](getTimezoneData(_0x3ce31c[_0x202e89],tmp_voice_queues));}BPromise['all'](_0x2a5594)[_0x376d('0x1c')](function(){_0x1aa240({'val':0x1});});})[_0x376d('0x61')](function(_0x23bf05){logger[_0x376d('0x5a')](_0x23bf05[_0x376d('0x5b')]);_0x1aa240({'val':0x0});});});}function getTimezoneData(_0x3ffd7f,_0x147f28){return new Promise(function(_0x222b3c,_0x271960){var _0x107c4e=shared[_0x376d('0x6c')];var _0x56c4cb=_0x107c4e[_0x3ffd7f['dialTimezone']];if(_[_0x376d('0x21')](_0x56c4cb)){_0x222b3c({'ret':0x1});}else{var _0x4b4adf=_0x56c4cb[_0x376d('0x6d')];var _0x160644=squel[_0x376d('0x2d')]()[_0x376d('0x2e')](_0x147f28)[_0x376d('0x6e')]('id',_0x3ffd7f['id'])[_0x376d('0x6e')](_0x376d('0x6f'),_0x4b4adf)[_0x376d('0x6e')](_0x376d('0x70'),_0x3ffd7f[_0x376d('0x70')])[_0x376d('0x3c')]();return db['sequelize']['query'](_0x160644)['spread'](function(_0x1cc701){_0x222b3c({'ret':0x1});})[_0x376d('0x61')](function(_0x17fe26){logger['error'](_0x17fe26[_0x376d('0x5b')]);_0x271960({'ret':0x1});});}});}function handleTZQuery(_0x2a992d){logger[_0x376d('0x58')](_0x2a992d);return db[_0x376d('0x5f')][_0x376d('0x71')](_0x2a992d)[_0x376d('0x60')](function(_0x59d39e){})[_0x376d('0x61')](function(_0x1253cd){logger[_0x376d('0x5a')](_0x1253cd['message']);});}function main(_0x3d0744,_0x884661,_0x2592ef,_0x4c7fa8){logger[_0x376d('0x58')](_0x376d('0x72'),_0x3d0744,JSON[_0x376d('0x73')](_0x884661));process[_0x376d('0x74')](_0x376d('0x75'));var _0x407697=_0x884661[_0x376d('0x76')];var _0x56251d=_[_0x376d('0x77')](_0x407697);var _0x36c362=_0x884661[_0x376d('0x78')];var _0x44d63c=path['join'](config[_0x376d('0x79')],_0x376d('0x7a'),_0x36c362+_0x376d('0x7b'));hasTZ=_[_0x376d('0x51')](_0x407697)[_0x376d('0x7c')](_0x376d('0x70'));var _0x246cfa=_['keys'](_0x407697)[_0x376d('0x14')]();logger[_0x376d('0x58')](_0x376d('0x7d'),_0x246cfa);db['ContactItemType'][_0x376d('0x1a')]({'raw':!![],'attributes':['id',_0x376d('0x7e')]})[_0x376d('0x1c')](function(_0x9cba17){for(var _0x498de2=0x0;_0x498de2<_0x9cba17[_0x376d('0x1d')];_0x498de2++){if(_0x9cba17[_0x498de2]['name']in _0x407697){contactItemTypes['push'](_0x9cba17[_0x498de2]);delete _0x56251d[_0x9cba17[_0x498de2]['name']];hasAdditionalPhones=!![];}for(var _0x4623cf in _0x407697){if(_0x9cba17[_0x498de2][_0x376d('0x7e')]+'_description'===_0x4623cf){phoneDescriptions['push']({'itemTypeId':_0x9cba17[_0x498de2]['id'],'description':_0x4623cf});delete _0x56251d[_0x4623cf];}}}if(hasAdditionalPhones)_0x56251d[_0x376d('0x1b')]='';var _0x4f4c40=_['keys'](_0x56251d)[_0x376d('0x14')]();logger[_0x376d('0x58')](_0x376d('0x7d'),_0x4f4c40);fs[_0x376d('0x7f')](_0x44d63c,_0x4f4c40+'\x0a');Papa['parse'](fs[_0x376d('0x80')](_0x3d0744),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1c1ff2,_0xb23580){try{for(var _0x3ef9b3=0x0,_0x5ae43d=[];_0x3ef9b3<_0x1c1ff2[_0x376d('0x81')][_0x376d('0x1d')];_0x3ef9b3++){stats['rows']+=0x1;if(_0x1c1ff2[_0x376d('0x5d')][_0x3ef9b3]){handleError(_0x1c1ff2[_0x376d('0x81')][_0x3ef9b3],_0x1c1ff2['errors'][_0x3ef9b3]);}else{var _0x3a3189=[];var _0x4a4ddf=[];var _0x39a83d={};for(var _0x52244f in _0x407697){let _0x190284=contactItemTypes[_0x376d('0x82')](_0x56ef87=>_0x56ef87[_0x376d('0x7e')]===_0x52244f);let _0x5d67bb=contactItemTypes['find'](_0x4a11fc=>_0x4a11fc[_0x376d('0x7e')]+'_description'===_0x52244f);if(_[_0x376d('0x21')](_0x190284)&&_['isNil'](_0x5d67bb)){if(_0x407697[_0x376d('0x83')](_0x52244f)){if(_0x1c1ff2[_0x376d('0x81')][_0x3ef9b3][_0x407697[_0x52244f]]){var _0x237ac2=_[_0x376d('0x84')](_0x1c1ff2[_0x376d('0x81')][_0x3ef9b3][_0x407697[_0x52244f]][_0x376d('0x85')](/"/g,'\x27'));switch(_0x52244f){case'scheduledat':var _0x1c6ed9=moment(_0x237ac2,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x1c6ed9[_0x376d('0x86')]()){_0x5ae43d[_0x376d('0x1e')]('\x22'+_0x237ac2+'\x22');}else{_0x3a3189[_0x376d('0x1e')](_0x376d('0x87'));}break;case _0x376d('0x31'):var _0x2fc121=parseInt(_0x237ac2);_0x237ac2=_['isNaN'](_0x2fc121)||_0x2fc121<0x0||_0x2fc121>0x4?_0x4c7fa8?0x3:0x2:_0x2fc121;_0x5ae43d[_0x376d('0x1e')]('\x22'+_0x237ac2+'\x22');break;case _0x376d('0x32'):var _0x2cfa58=parseInt(_0x237ac2);if(_['isNumber'](_0x2cfa58)&&_[_0x376d('0x7c')](_0x2592ef,_0x2cfa58)){_0x5ae43d[_0x376d('0x1e')]('\x22'+_0x2cfa58+'\x22');}else{_0x3a3189[_0x376d('0x1e')](_0x376d('0x88'));}break;case'email':if(isEmail(_0x237ac2)){_0x5ae43d[_0x376d('0x1e')]('\x22'+_0x237ac2+'\x22');}else{_0x3a3189[_0x376d('0x1e')](_0x376d('0x89'));}break;case _0x376d('0x8a'):var _0x2dc478=moment(_0x237ac2,'YYYY-MM-DD',!![]);if(_0x2dc478[_0x376d('0x86')]()){_0x5ae43d['push']('\x22'+_0x237ac2+'\x22');}else{_0x3a3189[_0x376d('0x1e')](_0x376d('0x8b'));}break;case'dialTimezone':var _0x3d5fd8=shared[_0x376d('0x6c')];var _0x29a9c5=_0x3d5fd8[_0x237ac2];if(!_[_0x376d('0x21')](_0x29a9c5)){var _0x35d157=_0x29a9c5[_0x376d('0x6d')];_0x5ae43d['push']('\x22'+_0x237ac2+'\x22');_0x5ae43d['push']('\x22'+_0x35d157+'\x22');}break;default:_0x5ae43d[_0x376d('0x1e')]('\x22'+_0x237ac2+'\x22');}}else{switch(_0x52244f){case _0x376d('0x8c'):case'phone':_0x3a3189[_0x376d('0x1e')](_0x52244f+_0x376d('0x8d'));break;default:_0x5ae43d[_0x376d('0x1e')]('\x22\x22');}}}}else{var _0x24901f='';if(!_[_0x376d('0x21')](_0x190284)){if(!_0x39a83d[_0x376d('0x83')](_0x190284['id'])){if(!_[_0x376d('0x21')](_0x1c1ff2[_0x376d('0x81')][_0x3ef9b3][_0x407697[_0x52244f]])){var _0x237ac2=_[_0x376d('0x84')](_0x1c1ff2['data'][_0x3ef9b3][_0x407697[_0x52244f]]['replace'](/"/g,'\x27'));var _0x2f5177=phoneDescriptions[_0x376d('0x82')](_0x134d3c=>_0x134d3c[_0x376d('0x8e')]===_0x190284['id']);if(!_[_0x376d('0x21')](_0x2f5177)){var _0xef63e2=_[_0x376d('0x84')](_0x1c1ff2[_0x376d('0x81')][_0x3ef9b3][_0x407697[_0x2f5177[_0x376d('0x8f')]]][_0x376d('0x85')](/"/g,'\x27'));if(!_[_0x376d('0x21')](_0xef63e2))_0x237ac2=_0x237ac2+'§'+_0xef63e2;}if(_0x24901f=='')_0x24901f=_0x237ac2;else _0x24901f+='|'+_0x237ac2;}_0x4a4ddf[_0x376d('0x1e')](_0x190284['id']+':'+_0x24901f);_0x39a83d[_0x190284['id']]=0x1;}}}}if(hasAdditionalPhones){_0x5ae43d[_0x376d('0x1e')]('\x22'+_0x4a4ddf['join'](';')+'\x22');}if(_0x3a3189[_0x376d('0x1d')]){handleError(_0x1c1ff2['data'][_0x3ef9b3],{'code':_0x376d('0x90'),'message':_0x3a3189['join']()});}else{fs[_0x376d('0x91')](_0x44d63c,_0x5ae43d[_0x376d('0x14')]()+'\x0a');}_0x5ae43d=[];}if(!(stats[_0x376d('0x92')]%0xc8)){socket[_0x376d('0x93')](_0x376d('0x94')+_0x36c362,stats);stats[_0x376d('0x5d')]=[];}}if(stopped){logger[_0x376d('0x58')](_0x376d('0x95'));_0xb23580[_0x376d('0x96')]();}}catch(_0x65df6d){handleError(_0x1c1ff2['data'][_0x3ef9b3],{'code':_0x376d('0x97'),'message':_0x65df6d[_0x376d('0x5b')]});logger[_0x376d('0x5a')](_0x376d('0x98'),_0x65df6d[_0x376d('0x5b')]);}},'complete':function(){try{var _0x5604c0=[];var _0x517dfc=[];var _0xeac3a2=_0x376d('0x34');if(_0x884661[_0x376d('0x99')]&&_0x884661['duplicates']['length']){_0xeac3a2=_0x376d('0x9a')+_0x36c362;_0x5604c0[_0x376d('0x1e')](_0x376d('0x9b')+_0xeac3a2+_0x376d('0x9c'));}tmp_campaigns='campaigns_'+_0x36c362;tmp_voice_queues=_0x376d('0x9d')+_0x36c362;_0x517dfc[_0x376d('0x1e')](_0x376d('0x9b')+tmp_campaigns+_0x376d('0x9e'));_0x517dfc[_0x376d('0x1e')]('CREATE\x20TABLE\x20'+tmp_voice_queues+_0x376d('0x9e'));BPromise[_0x376d('0x9f')](_0x517dfc,handleTZQuery)[_0x376d('0x1c')](function(_0x263092){updateTzCampaigns(_0x884661[_0x376d('0x3f')])[_0x376d('0x1c')](function(_0x3907cb){updateTzVoiceQueues(_0x884661[_0x376d('0x3f')])[_0x376d('0x1c')](function(_0x47b1aa){if(hasTZ)_0x4f4c40=_0x4f4c40[_0x376d('0x85')](_0x376d('0x70'),_0x376d('0xa0'));var _0x4319bd=util[_0x376d('0xd')](_0x376d('0xa1'),_0x44d63c,_0xeac3a2,_0x4f4c40,_0x884661[_0x376d('0x3f')],_0x884661[_0x376d('0x52')]||null,NOW,NOW);if(_[_0x376d('0x21')](_0x407697[_0x376d('0xa2')])){_0x4319bd+=_0x376d('0xa3');}_0x5604c0[_0x376d('0x1e')](_0x4319bd);if(_0x884661[_0x376d('0x99')]&&_0x884661['duplicates']['length']){_0x5604c0[_0x376d('0x1e')](insertCmContact(_0x884661['ListId'],_0xeac3a2,_0x884661[_0x376d('0x99')],_0x407697));_0x5604c0['push'](_0x376d('0xa4')+_0xeac3a2+';');}BPromise[_0x376d('0x9f')](_0x5604c0,handleQuery)[_0x376d('0x1c')](function(_0x2cab10){BPromise[_0x376d('0x1f')]([handleAdditionalPhones()])[_0x376d('0x1c')](function(){_0x5604c0=[];for(var _0xeee64a=0x0;_0xeee64a\x20\x20','server/files/tmp','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7769,0x15e));var _0x9776=function(_0x3e9879,_0x28ba1d){_0x3e9879=_0x3e9879-0x0;var _0x1d3d2f=_0x7769[_0x3e9879];return _0x1d3d2f;};'use strict';var fs=require('fs');var path=require(_0x9776('0x0'));var _=require(_0x9776('0x1'));var Papa=require(_0x9776('0x2'));var util=require(_0x9776('0x3'));var BPromise=require(_0x9776('0x4'));var moment=require(_0x9776('0x5'));var squel=require(_0x9776('0x6'));var Redis=require(_0x9776('0x7'));var db=require(_0x9776('0x8'))['db'];var config=require(_0x9776('0x9'));var shared=require(_0x9776('0xa'));var logger=require(_0x9776('0xb'))(_0x9776('0xc'));config[_0x9776('0xd')]=_[_0x9776('0xe')](config[_0x9776('0xd')],{'host':_0x9776('0xf'),'port':0x18eb});var socket=require(_0x9776('0x10'))(new Redis(config[_0x9776('0xd')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format'](_0x9776('0x11'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x9776('0x12')](_0x9776('0x11'));function isEmail(_0xbfc7bf){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))*$/[_0x9776('0x13')](_0xbfc7bf);}function selectNotIn(_0x269cbb,_0x1d9a5e,_0x5cb45d,_0x2eb15a,_0x5f1a68){return squel['select']()['field']('phone')[_0x9776('0x14')](_0x2eb15a)[_0x9776('0x15')](_0x1d9a5e,null,_0x1d9a5e+'.id\x20=\x20'+_0x2eb15a+'.'+_0x5cb45d)[_0x9776('0x16')](_0x2eb15a+'.'+_0x5cb45d+_0x9776('0x17')+_0x269cbb+'.'+_0x5cb45d)[_0x9776('0x16')](_0x1d9a5e+_0x9776('0x18')+_0x5f1a68[_0x9776('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x309c1f,_0x2f9bf4){promisesAdditionalPhones=[];return db['CmContact'][_0x9776('0x19')]({'raw':!![],'attributes':['id',_0x9776('0x1a')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x9776('0x1b')](function(_0x16647a){if(_0x16647a!==null){var _0x4d4196=[];for(var _0x103365=0x0;_0x103365<_0x16647a[_0x9776('0x1c')];_0x103365++){var _0x141eac=_0x16647a[_0x103365];_0x4d4196[_0x9776('0x1d')](insertAdditionalPhones(_0x141eac));}}Promise['all'](_0x4d4196)[_0x9776('0x1b')](function(){_0x309c1f({'val':0x1});});});});}function insertAdditionalPhones(_0x2dfcae){return new Promise(function(_0x950db9,_0x3f9de3){var _0x4b1203=_0x2dfcae[_0x9776('0x1a')];var _0x4d14a0=_0x4b1203[_0x9776('0x1e')](';');var _0x10a80a=[];orderBy=0x0;for(var _0x544863=0x0;_0x544863<_0x4d14a0[_0x9776('0x1c')];_0x544863++){_0x10a80a[_0x9776('0x1d')](splitAdditionalPhone(_0x2dfcae['id'],_0x4d14a0[_0x544863]));}Promise[_0x9776('0x1f')](_0x10a80a)['then'](function(){_0x950db9({'val':_0x4d14a0[_0x9776('0x1c')]});});});}function splitAdditionalPhone(_0x1eb065,_0x318bfc){return new Promise(function(_0x671623,_0x2ea392){var _0xb4c629=_0x318bfc[_0x9776('0x1e')](':');var _0x3bbc42=_0xb4c629[0x0];var _0x575142=_0xb4c629[0x1];if(!_[_0x9776('0x20')](_0x575142)){var _0x3879e4=_0x575142[_0x9776('0x1e')]('|');var _0x3b45a4=[];for(var _0x3d03d4=0x0;_0x3d03d4<_0x3879e4[_0x9776('0x1c')];_0x3d03d4++){if(_0x3879e4[_0x3d03d4]!==''){var _0x12b4b1=_['filter'](promisesAdditionalPhones,{'contactId':_0x1eb065,'phone':_0x3879e4[_0x3d03d4]});if(_0x12b4b1[_0x9776('0x1c')]==0x0){orderBy++;promisesAdditionalPhones[_0x9776('0x1d')]({'contactId':_0x1eb065,'contactTypeId':_0x3bbc42,'phone':_0x3879e4[_0x3d03d4],'orderBy':orderBy});}}}_0x671623({'ok':0x1});}else _0x671623({'res':0x0});});}function createAdditionalPhone(_0x4004e5,_0x24c2cc,_0x5630d1,_0x5878d1){var _0x12ed94='';var _0x1b17fa='';var _0x20f479=_0x5630d1[_0x9776('0x1e')]('§');_0x12ed94=_0x20f479[0x0];if(_0x20f479['length']==0x2)_0x1b17fa=_0x20f479[0x1];return new Promise(function(_0x46a93b,_0x11e9c8){return db[_0x9776('0x21')][_0x9776('0x22')]({'where':{'CmContactId':_0x4004e5,'item':_0x12ed94}})[_0x9776('0x1b')](function(_0x5dd9ab){if(_0x5dd9ab){return db['CmContactHasItem'][_0x9776('0x23')]({'ItemTypeId':_0x24c2cc,'description':_0x1b17fa,'OrderBy':_0x5878d1},{'where':{'CmContactId':_0x4004e5,'item':_0x12ed94}})[_0x9776('0x1b')](function(_0x4686ec){_0x46a93b({'res':_0x9776('0x24')});});}else{return db[_0x9776('0x21')]['create']({'CmContactId':_0x4004e5,'item':_0x12ed94,'description':_0x1b17fa,'ItemTypeId':_0x24c2cc,'OrderBy':_0x5878d1,'ItemClass':'PHONE'})[_0x9776('0x1b')](function(_0x1cbb07){_0x46a93b({'res':'inserted'});});}});});}function insertCmHopper(_0x1addeb,_0x53c742,_0x358c89,_0x54b379,_0x1cbbb6){var _0x30a5ab=[_0x9776('0x25'),_0x9776('0x26'),_0x9776('0x27'),_0x9776('0x28'),_0x53c742+'.'+_0x54b379,_0x9776('0x29'),'cm_contacts.updatedAt',_0x9776('0x2a'),'cm_contacts.UserId','\x22'+_0x1cbbb6+'\x22'];return squel[_0x9776('0x2b')]()[_0x9776('0x2c')](_0x9776('0x2d'))[_0x9776('0x2e')](['phone',_0x9776('0x2f'),'ContactId',_0x9776('0x30'),_0x54b379,_0x9776('0x31'),_0x9776('0x32'),'priority','UserId',_0x9776('0x33')],squel[_0x9776('0x34')]()[_0x9776('0x35')](_0x30a5ab)[_0x9776('0x14')](_0x53c742)[_0x9776('0x15')](_0x9776('0x36'),null,_0x9776('0x37')+_0x53c742+_0x9776('0x38'))['join'](_0x358c89,null,_0x358c89+_0x9776('0x39')+_0x53c742+'.'+_0x54b379)[_0x9776('0x16')](_0x53c742+_0x9776('0x3a'),_0x1addeb)[_0x9776('0x16')](_0x9776('0x3b'),NOW)[_0x9776('0x16')](_0x9776('0x3c'),selectNotIn(_0x53c742,_0x358c89,_0x54b379,_0x9776('0x2d'),[_0x9776('0x3d'),_0x9776('0x3e')]))[_0x9776('0x16')](_0x9776('0x3c'),selectNotIn(_0x53c742,_0x358c89,_0x54b379,_0x9776('0x2d'),[_0x9776('0x3d')])))[_0x9776('0x3f')]();}function insertCmHopperBlack(_0x4c20d1,_0x422405,_0x164fcf,_0x587f90){var _0x175564=['cm_contacts.phone',_0x9776('0x27'),_0x9776('0x28'),_0x422405+'.'+_0x587f90,_0x9776('0x29'),_0x9776('0x40')];return squel[_0x9776('0x2b')]()[_0x9776('0x2c')](_0x9776('0x41'))['fromQuery']([_0x9776('0x42'),_0x9776('0x43'),_0x9776('0x30'),_0x587f90,_0x9776('0x31'),_0x9776('0x32')],squel[_0x9776('0x34')]()[_0x9776('0x35')](_0x175564)[_0x9776('0x14')](_0x422405)[_0x9776('0x15')](_0x9776('0x36'),null,'cm_contacts.ListId\x20=\x20'+_0x422405+_0x9776('0x38'))[_0x9776('0x15')](_0x164fcf,null,_0x164fcf+'.id\x20=\x20'+_0x422405+'.'+_0x587f90)[_0x9776('0x16')](_0x422405+'.CmListId\x20=\x20?',_0x4c20d1)[_0x9776('0x16')](_0x9776('0x3b'),NOW)[_0x9776('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x9776('0x34')]()[_0x9776('0x44')](_0x9776('0x42'))[_0x9776('0x14')](_0x9776('0x41'))[_0x9776('0x16')](_0x9776('0x45'),_0x4c20d1)[_0x9776('0x16')](_0x587f90+_0x9776('0x17')+_0x422405+'.'+_0x587f90)))[_0x9776('0x3f')]();}function insertTzCmHopper(_0x26628f,_0x3cb5ef,_0x45b657,_0x1301b3,_0x25c98f,_0x47112b){var _0xbb139e=[_0x9776('0x25'),_0x9776('0x46')+_0x47112b+'.offset-cm_contacts.utcOffset\x20minute)',_0x9776('0x27'),'cm_contacts.ListId',_0x3cb5ef+'.'+_0x1301b3,_0x9776('0x29'),'cm_contacts.updatedAt',_0x9776('0x2a'),_0x9776('0x47'),'\x22'+_0x25c98f+'\x22'];var _0x53028e=squel[_0x9776('0x2b')]()[_0x9776('0x2c')](_0x9776('0x2d'))[_0x9776('0x2e')]([_0x9776('0x42'),_0x9776('0x2f'),'ContactId',_0x9776('0x30'),_0x1301b3,_0x9776('0x31'),_0x9776('0x32'),_0x9776('0x48'),'UserId',_0x9776('0x33')],squel['select']()['fields'](_0xbb139e)[_0x9776('0x14')](_0x3cb5ef)[_0x9776('0x15')](_0x9776('0x36'),null,_0x9776('0x37')+_0x3cb5ef+_0x9776('0x38'))['join'](_0x45b657,null,_0x45b657+_0x9776('0x39')+_0x3cb5ef+'.'+_0x1301b3)[_0x9776('0x15')](_0x47112b,null,_0x47112b+_0x9776('0x39')+_0x3cb5ef+'.'+_0x1301b3)['where'](_0x3cb5ef+'.CmListId\x20=\x20?',_0x26628f)['where'](_0x9776('0x3b'),NOW)[_0x9776('0x16')](_0x9776('0x3c'),selectNotIn(_0x3cb5ef,_0x45b657,_0x1301b3,_0x9776('0x2d'),[_0x9776('0x3d'),_0x9776('0x3e')]))['where'](_0x9776('0x3c'),selectNotIn(_0x3cb5ef,_0x45b657,_0x1301b3,_0x9776('0x2d'),[_0x9776('0x3d')])))[_0x9776('0x3f')]();return _0x53028e;}function insertTzCmHopperBlack(_0x4b495d,_0x5ce3a2,_0x31cedb,_0x5848cf){var _0x146db1=[_0x9776('0x25'),'cm_contacts.id','cm_contacts.ListId',_0x5ce3a2+'.'+_0x5848cf,'cm_contacts.createdAt',_0x9776('0x40')];return squel['insert']()['into'](_0x9776('0x41'))['fromQuery']([_0x9776('0x42'),_0x9776('0x43'),_0x9776('0x30'),_0x5848cf,'createdAt',_0x9776('0x32')],squel[_0x9776('0x34')]()[_0x9776('0x35')](_0x146db1)['from'](_0x5ce3a2)[_0x9776('0x15')](_0x9776('0x36'),null,_0x9776('0x37')+_0x5ce3a2+'.CmListId')[_0x9776('0x15')](_0x31cedb,null,_0x31cedb+_0x9776('0x39')+_0x5ce3a2+'.'+_0x5848cf)[_0x9776('0x16')](_0x5ce3a2+_0x9776('0x3a'),_0x4b495d)['where'](_0x9776('0x3b'),NOW)[_0x9776('0x16')](_0x9776('0x3c'),squel[_0x9776('0x34')]()['field']('phone')[_0x9776('0x14')](_0x9776('0x41'))[_0x9776('0x16')]('ListId\x20=\x20?',_0x4b495d)[_0x9776('0x16')](_0x5848cf+'\x20=\x20'+_0x5ce3a2+'.'+_0x5848cf)))[_0x9776('0x3f')]();}function insertCmHopperAdditionalPhones(_0x49b8ee){var _0xae1cd0=['cm_hopper.id','cm_contact_has_items.item',_0x9776('0x49'),'cm_contact_has_items.createdAt',_0x9776('0x4a')];return squel[_0x9776('0x2b')]()[_0x9776('0x2c')]('cm_hopper_additional_phones')[_0x9776('0x2e')]([_0x9776('0x4b'),'phone','OrderBy',_0x9776('0x31'),_0x9776('0x32')],squel[_0x9776('0x34')]()['fields'](_0xae1cd0)[_0x9776('0x14')](_0x9776('0x2d'))[_0x9776('0x15')]('cm_contacts',null,_0x9776('0x4c'))[_0x9776('0x15')](_0x9776('0x4d'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')['where'](_0x9776('0x4e'),_0x49b8ee)[_0x9776('0x16')](_0x9776('0x3b'),NOW))[_0x9776('0x3f')]();}function insertCmContact(_0x46a503,_0x1e95c9,_0xc09102,_0xce1d01){var _0x181749=_[_0x9776('0x4f')](_[_0x9776('0x50')](_0xce1d01),[_0x9776('0x30'),_0x9776('0x51'),_0x9776('0x31'),_0x9776('0x32')]);return squel[_0x9776('0x2b')]()[_0x9776('0x2c')](_0x9776('0x36'))[_0x9776('0x2e')](_0x181749,squel[_0x9776('0x34')]()['fields'](_0x181749)['from'](_0x1e95c9)[_0x9776('0x16')]('('+_0xc09102[_0x9776('0x15')](',')+_0x9776('0x52'),squel[_0x9776('0x34')]()[_0x9776('0x35')](_0xc09102)[_0x9776('0x14')](_0x9776('0x36'))[_0x9776('0x16')](_0x9776('0x45'),_0x46a503)[_0x9776('0x16')](_0x9776('0x53')))[_0x9776('0x16')](_0x9776('0x54'),squel['select']()['field']('MIN(id)',_0x9776('0x55'))[_0x9776('0x14')](_0x1e95c9)['group'](_0xc09102[_0x9776('0x15')](','))))[_0x9776('0x3f')]();}function handleStop(){logger[_0x9776('0x56')](_0x9776('0x57'));stopped=!![];}function handleUncaughtException(_0x183519){logger['error'](_0x183519[_0x9776('0x58')]);process[_0x9776('0x59')](0x1);}function handleError(_0x3d5c3c,_0xf0391){stats[_0x9776('0x5a')]['push']({'name':_0xf0391[_0x9776('0x5b')],'message':_0xf0391['message'],'row':_0x3d5c3c});}function handleQuery(_0x514495){logger[_0x9776('0x56')](_0x514495);return db[_0x9776('0x5c')][_0x9776('0x5d')](_0x514495)['spread'](function(_0x31745f){results[_0x9776('0x1d')](_0x31745f);})[_0x9776('0x5e')](function(_0x49aedb){logger[_0x9776('0x5f')](_0x49aedb[_0x9776('0x58')]);});}function updateTzCampaigns(_0x145589){return new Promise(function(_0x5bab27,_0x28c751){var _0x4c4956=squel['select']()[_0x9776('0x35')]([_0x9776('0x60'),_0x9776('0x61')])[_0x9776('0x14')](_0x9776('0x62'))[_0x9776('0x15')](_0x9776('0x63'),null,_0x9776('0x64'))['where'](_0x9776('0x65')+_0x145589);db[_0x9776('0x5c')]['query'](_0x4c4956[_0x9776('0x3f')]())['spread'](function(_0x539827){var _0x24c9a1=[];for(var _0x58d130=0x0;_0x58d130<_0x539827[_0x9776('0x1c')];_0x58d130++){_0x24c9a1[_0x9776('0x1d')](getTimezoneData(_0x539827[_0x58d130],tmp_campaigns));}BPromise['all'](_0x24c9a1)[_0x9776('0x1b')](function(){_0x5bab27({'val':0x1});});})[_0x9776('0x5e')](function(_0x244913){logger[_0x9776('0x5f')](_0x244913['message']);_0x5bab27({'val':0x0});});});}function updateTzVoiceQueues(_0x52e387){return new Promise(function(_0x652b17,_0x3c8a92){var _0x4f29b8=squel['select']()[_0x9776('0x35')](['voice_queues.id',_0x9776('0x66')])[_0x9776('0x14')]('voice_queues')[_0x9776('0x15')](_0x9776('0x67'),null,_0x9776('0x68'))[_0x9776('0x16')](_0x9776('0x69')+_0x52e387);db[_0x9776('0x5c')][_0x9776('0x5d')](_0x4f29b8[_0x9776('0x3f')]())[_0x9776('0x6a')](function(_0x174b3d){var _0x56a7bb=[];for(var _0x4b55a2=0x0;_0x4b55a2<_0x174b3d[_0x9776('0x1c')];_0x4b55a2++){_0x56a7bb[_0x9776('0x1d')](getTimezoneData(_0x174b3d[_0x4b55a2],tmp_voice_queues));}BPromise[_0x9776('0x1f')](_0x56a7bb)[_0x9776('0x1b')](function(){_0x652b17({'val':0x1});});})[_0x9776('0x5e')](function(_0x10ea94){logger[_0x9776('0x5f')](_0x10ea94[_0x9776('0x58')]);_0x652b17({'val':0x0});});});}function getTimezoneData(_0x28a749,_0x7e1314){return new Promise(function(_0x3cd97f,_0x363e6b){var _0x5f1027=shared[_0x9776('0x6b')];var _0x233ee4=_0x5f1027[_0x28a749[_0x9776('0x6c')]];if(_[_0x9776('0x20')](_0x233ee4)){_0x3cd97f({'ret':0x1});}else{var _0x22a213=_0x233ee4[_0x9776('0x6d')];var _0x140e5f=squel[_0x9776('0x2b')]()[_0x9776('0x2c')](_0x7e1314)[_0x9776('0x6e')]('id',_0x28a749['id'])[_0x9776('0x6e')](_0x9776('0x6f'),_0x22a213)[_0x9776('0x6e')](_0x9776('0x6c'),_0x28a749['dialTimezone'])['toString']();return db['sequelize'][_0x9776('0x5d')](_0x140e5f)['spread'](function(_0x44e9e9){_0x3cd97f({'ret':0x1});})['catch'](function(_0x2a3d6d){logger['error'](_0x2a3d6d[_0x9776('0x58')]);_0x363e6b({'ret':0x1});});}});}function handleTZQuery(_0xc7465c){logger[_0x9776('0x56')](_0xc7465c);return db[_0x9776('0x5c')]['query'](_0xc7465c)['spread'](function(_0x4a0e29){})[_0x9776('0x5e')](function(_0xd96776){logger[_0x9776('0x5f')](_0xd96776[_0x9776('0x58')]);});}function main(_0x14d34f,_0x1293c8,_0x3ab78d,_0x5d56fa){logger['info']('main',_0x14d34f,JSON[_0x9776('0x70')](_0x1293c8));process[_0x9776('0x71')](_0x9776('0x72'));var _0x92652=_0x1293c8[_0x9776('0x73')];var _0x2d9ab1=_['clone'](_0x92652);var _0x457806=_0x1293c8[_0x9776('0x74')];var _0x39ba0f=path[_0x9776('0x15')](config[_0x9776('0x75')],'server/files/tmp',_0x457806+_0x9776('0x76'));hasTZ=_['keys'](_0x92652)['includes']('dialTimezone');var _0x59d9dc=_[_0x9776('0x50')](_0x92652)[_0x9776('0x15')]();logger[_0x9776('0x56')](_0x9776('0x77'),_0x59d9dc);db['ContactItemType'][_0x9776('0x19')]({'raw':!![],'attributes':['id',_0x9776('0x78')]})[_0x9776('0x1b')](function(_0x3c698f){for(var _0x2a33de=0x0;_0x2a33de<_0x3c698f['length'];_0x2a33de++){if(_0x3c698f[_0x2a33de][_0x9776('0x78')]in _0x92652){contactItemTypes[_0x9776('0x1d')](_0x3c698f[_0x2a33de]);delete _0x2d9ab1[_0x3c698f[_0x2a33de][_0x9776('0x78')]];hasAdditionalPhones=!![];}for(var _0x2a8192 in _0x92652){if(_0x3c698f[_0x2a33de][_0x9776('0x78')]+_0x9776('0x79')===_0x2a8192){phoneDescriptions[_0x9776('0x1d')]({'itemTypeId':_0x3c698f[_0x2a33de]['id'],'description':_0x2a8192});delete _0x2d9ab1[_0x2a8192];}}}if(hasAdditionalPhones)_0x2d9ab1[_0x9776('0x1a')]='';var _0x383f83=_[_0x9776('0x50')](_0x2d9ab1)['join']();logger[_0x9776('0x56')](_0x9776('0x77'),_0x383f83);fs[_0x9776('0x7a')](_0x39ba0f,_0x383f83+'\x0a');Papa['parse'](fs[_0x9776('0x7b')](_0x14d34f),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1ab6a6,_0xa16cb5){try{for(var _0x1d2756=0x0,_0x198def=[];_0x1d2756<_0x1ab6a6[_0x9776('0x7c')][_0x9776('0x1c')];_0x1d2756++){stats[_0x9776('0x7d')]+=0x1;if(_0x1ab6a6[_0x9776('0x5a')][_0x1d2756]){handleError(_0x1ab6a6[_0x9776('0x7c')][_0x1d2756],_0x1ab6a6[_0x9776('0x5a')][_0x1d2756]);}else{var _0x4381c4=[];var _0x185e52=[];var _0x467cc3={};for(var _0x19ee7a in _0x92652){let _0x4cb6bf=contactItemTypes['find'](_0x392645=>_0x392645[_0x9776('0x78')]===_0x19ee7a);let _0x2b0e87=contactItemTypes[_0x9776('0x7e')](_0x283683=>_0x283683['name']+_0x9776('0x79')===_0x19ee7a);if(_['isNil'](_0x4cb6bf)&&_[_0x9776('0x20')](_0x2b0e87)){if(_0x92652[_0x9776('0x7f')](_0x19ee7a)){if(_0x1ab6a6[_0x9776('0x7c')][_0x1d2756][_0x92652[_0x19ee7a]]){var _0x1907e9=_[_0x9776('0x80')](_0x1ab6a6[_0x9776('0x7c')][_0x1d2756][_0x92652[_0x19ee7a]][_0x9776('0x81')](/"/g,'\x27'));switch(_0x19ee7a){case _0x9776('0x2f'):var _0x37589b=moment(_0x1907e9,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x37589b['isValid']()){_0x198def[_0x9776('0x1d')]('\x22'+_0x1907e9+'\x22');}else{_0x4381c4[_0x9776('0x1d')](_0x9776('0x82'));}break;case'priority':var _0x1516df=parseInt(_0x1907e9);_0x1907e9=_[_0x9776('0x83')](_0x1516df)||_0x1516df<0x0||_0x1516df>0x4?_0x5d56fa?0x3:0x2:_0x1516df;_0x198def['push']('\x22'+_0x1907e9+'\x22');break;case _0x9776('0x84'):var _0x205279=parseInt(_0x1907e9);if(_[_0x9776('0x85')](_0x205279)&&_[_0x9776('0x86')](_0x3ab78d,_0x205279)){_0x198def['push']('\x22'+_0x205279+'\x22');}else{_0x4381c4[_0x9776('0x1d')](_0x9776('0x87'));}break;case _0x9776('0x88'):if(isEmail(_0x1907e9)){_0x198def['push']('\x22'+_0x1907e9+'\x22');}else{_0x4381c4['push'](_0x9776('0x89'));}break;case'dateOfBirth':var _0x57930e=moment(_0x1907e9,'YYYY-MM-DD',!![]);if(_0x57930e[_0x9776('0x8a')]()){_0x198def[_0x9776('0x1d')]('\x22'+_0x1907e9+'\x22');}else{_0x4381c4[_0x9776('0x1d')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0x9776('0x6c'):var _0x5dadf8=shared['timezones'];var _0x52889d=_0x5dadf8[_0x1907e9];if(!_[_0x9776('0x20')](_0x52889d)){var _0x37c015=_0x52889d[_0x9776('0x6d')];_0x198def[_0x9776('0x1d')]('\x22'+_0x1907e9+'\x22');_0x198def['push']('\x22'+_0x37c015+'\x22');}break;default:_0x198def['push']('\x22'+_0x1907e9+'\x22');}}else{switch(_0x19ee7a){case'firstName':case _0x9776('0x42'):_0x4381c4[_0x9776('0x1d')](_0x19ee7a+'\x20not\x20specified');break;default:_0x198def[_0x9776('0x1d')]('\x22\x22');}}}}else{var _0x4bf3c1='';if(!_[_0x9776('0x20')](_0x4cb6bf)){if(!_0x467cc3[_0x9776('0x7f')](_0x4cb6bf['id'])){if(!_[_0x9776('0x20')](_0x1ab6a6[_0x9776('0x7c')][_0x1d2756][_0x92652[_0x19ee7a]])){var _0x1907e9=_[_0x9776('0x80')](_0x1ab6a6['data'][_0x1d2756][_0x92652[_0x19ee7a]][_0x9776('0x81')](/"/g,'\x27'));var _0x4f477a=phoneDescriptions[_0x9776('0x7e')](_0x28ddea=>_0x28ddea[_0x9776('0x8b')]===_0x4cb6bf['id']);if(!_['isNil'](_0x4f477a)){var _0x8c3b1f=_[_0x9776('0x80')](_0x1ab6a6[_0x9776('0x7c')][_0x1d2756][_0x92652[_0x4f477a[_0x9776('0x8c')]]][_0x9776('0x81')](/"/g,'\x27'));if(!_[_0x9776('0x20')](_0x8c3b1f))_0x1907e9=_0x1907e9+'§'+_0x8c3b1f;}if(_0x4bf3c1=='')_0x4bf3c1=_0x1907e9;else _0x4bf3c1+='|'+_0x1907e9;}_0x185e52[_0x9776('0x1d')](_0x4cb6bf['id']+':'+_0x4bf3c1);_0x467cc3[_0x4cb6bf['id']]=0x1;}}}}if(hasAdditionalPhones){_0x198def['push']('\x22'+_0x185e52[_0x9776('0x15')](';')+'\x22');}if(_0x4381c4[_0x9776('0x1c')]){handleError(_0x1ab6a6[_0x9776('0x7c')][_0x1d2756],{'code':'SystemRow','message':_0x4381c4[_0x9776('0x15')]()});}else{fs[_0x9776('0x8d')](_0x39ba0f,_0x198def['join']()+'\x0a');}_0x198def=[];}if(!(stats[_0x9776('0x7d')]%0xc8)){socket['emit'](_0x9776('0x8e')+_0x457806,stats);stats[_0x9776('0x5a')]=[];}}if(stopped){logger[_0x9776('0x56')](_0x9776('0x8f'));_0xa16cb5[_0x9776('0x90')]();}}catch(_0x476f4c){handleError(_0x1ab6a6['data'][_0x1d2756],{'code':_0x9776('0x91'),'message':_0x476f4c[_0x9776('0x58')]});logger['error'](_0x9776('0x92'),_0x476f4c['message']);}},'complete':function(){try{var _0x23643b=[];var _0x46f859=[];var _0x3a54c4=_0x9776('0x36');if(_0x1293c8[_0x9776('0x93')]&&_0x1293c8['duplicates'][_0x9776('0x1c')]){_0x3a54c4=_0x9776('0x94')+_0x457806;_0x23643b[_0x9776('0x1d')](_0x9776('0x95')+_0x3a54c4+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0x9776('0x96')+_0x457806;tmp_voice_queues=_0x9776('0x97')+_0x457806;_0x46f859[_0x9776('0x1d')](_0x9776('0x95')+tmp_campaigns+_0x9776('0x98'));_0x46f859[_0x9776('0x1d')](_0x9776('0x95')+tmp_voice_queues+_0x9776('0x98'));BPromise[_0x9776('0x99')](_0x46f859,handleTZQuery)[_0x9776('0x1b')](function(_0x32348b){updateTzCampaigns(_0x1293c8[_0x9776('0x30')])['then'](function(_0x57ef6a){updateTzVoiceQueues(_0x1293c8[_0x9776('0x30')])[_0x9776('0x1b')](function(_0x20eafe){if(hasTZ)_0x383f83=_0x383f83[_0x9776('0x81')](_0x9776('0x6c'),_0x9776('0x9a'));var _0x18dcd7=util[_0x9776('0x12')]('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',_0x39ba0f,_0x3a54c4,_0x383f83,_0x1293c8[_0x9776('0x30')],_0x1293c8[_0x9776('0x51')]||null,NOW,NOW);if(_[_0x9776('0x20')](_0x92652[_0x9776('0x2f')])){_0x18dcd7+=_0x9776('0x9b');}_0x23643b[_0x9776('0x1d')](_0x18dcd7);if(_0x1293c8[_0x9776('0x93')]&&_0x1293c8['duplicates'][_0x9776('0x1c')]){_0x23643b[_0x9776('0x1d')](insertCmContact(_0x1293c8[_0x9776('0x30')],_0x3a54c4,_0x1293c8[_0x9776('0x93')],_0x92652));_0x23643b[_0x9776('0x1d')](_0x9776('0x9c')+_0x3a54c4+';');}BPromise['each'](_0x23643b,handleQuery)[_0x9776('0x1b')](function(_0x190661){BPromise[_0x9776('0x1f')]([handleAdditionalPhones()])[_0x9776('0x1b')](function(){_0x23643b=[];for(var _0x1a2531=0x0;_0x1a2531\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','path','lodash','bluebird','ioredis','../../../mysqldb','../../../config/environment','import','redis','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','format','YYYYMMDDHHmmss','select','field','phone','join','.id\x20=\x20','where','\x20=\x20','sequelize','query','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','push','all','then','catch','message','split','filter','CmContactHasItem','findOne','update','create','PHONE','CmContact','CmHopper','cm_contacts.phone','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','cm_hopper','fromQuery','scheduledat','ContactId','ListId','priority','UserId','fields','cm_contacts'];(function(_0x3c81b5,_0x3f5ed7){var _0x5888c4=function(_0x4e65b0){while(--_0x4e65b0){_0x3c81b5['push'](_0x3c81b5['shift']());}};_0x5888c4(++_0x3f5ed7);}(_0x3b31,0x64));var _0x13b3=function(_0x4e4966,_0x31cfe6){_0x4e4966=_0x4e4966-0x0;var _0x485b84=_0x3b31[_0x4e4966];return _0x485b84;};'use strict';var fs=require('fs');var path=require(_0x13b3('0x0'));var _=require(_0x13b3('0x1'));var Papa=require('papaparse');var util=require('util');var BPromise=require(_0x13b3('0x2'));var moment=require('moment');var squel=require('squel');var Redis=require(_0x13b3('0x3'));var db=require(_0x13b3('0x4'))['db'];var config=require(_0x13b3('0x5'));var logger=require('../../../config/logger')(_0x13b3('0x6'));config['redis']=_['defaults'](config[_0x13b3('0x7')],{'host':_0x13b3('0x8'),'port':0x18eb});var socket=require(_0x13b3('0x9'))(new Redis(config[_0x13b3('0x7')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()['format'](_0x13b3('0xa'));var tempTableName=_0x13b3('0xb')+moment()[_0x13b3('0xc')](_0x13b3('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x9ebff8){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'](_0x9ebff8);}function selectNotIn(_0x4cc084,_0x1c25bc,_0x1aef50,_0x462364,_0x36652f){return squel[_0x13b3('0xe')]()[_0x13b3('0xf')](_0x13b3('0x10'))['from'](_0x462364)[_0x13b3('0x11')](_0x1c25bc,null,_0x1c25bc+_0x13b3('0x12')+_0x462364+'.'+_0x1aef50)[_0x13b3('0x13')](_0x462364+'.'+_0x1aef50+_0x13b3('0x14')+_0x4cc084+'.'+_0x1aef50)[_0x13b3('0x13')](_0x1c25bc+'.dialCheckDuplicateType\x20IN\x20('+_0x36652f[_0x13b3('0x11')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x46aa9d,_0x4b4bbb){promisesAdditionalPhones=[];promisesContact=[];return db[_0x13b3('0x15')][_0x13b3('0x16')](_0x13b3('0x17')+tempTableName)[_0x13b3('0x18')](function(_0x3dbe7a){if(_0x3dbe7a!==null){var _0x3c4834=[];for(var _0x416ebb=0x0;_0x416ebb<_0x3dbe7a[_0x13b3('0x19')];_0x416ebb++){var _0xf3e4df=_0x3dbe7a[_0x416ebb];if(!_[_0x13b3('0x1a')](_0xf3e4df[_0x13b3('0x10')])){if(!_[_0x13b3('0x1a')](_0xf3e4df[_0x13b3('0x1b')]))_0x3c4834['push'](insertAdditionalPhones(_0xf3e4df));promisesContact[_0x13b3('0x1c')]({'contact':_0xf3e4df});}}}Promise[_0x13b3('0x1d')](_0x3c4834)[_0x13b3('0x1e')](function(){_0x46aa9d({'val':0x1});});})[_0x13b3('0x1f')](function(_0x10b0fd){logger['error'](_0x10b0fd[_0x13b3('0x20')]);});});}function insertAdditionalPhones(_0xff5705){return new Promise(function(_0x1d4b88,_0x452fc0){var _0x51d83c=_0xff5705[_0x13b3('0x1b')];if(_[_0x13b3('0x1a')](_0x51d83c))_0x452fc0({'val':0x0});else{var _0x236bbe=_0x51d83c[_0x13b3('0x21')](';');var _0x541f53=[];orderBy=0x0;for(var _0x3baa08=0x0;_0x3baa08<_0x236bbe[_0x13b3('0x19')];_0x3baa08++){_0x541f53['push'](splitAdditionalPhone(_0xff5705['id'],_0x236bbe[_0x3baa08]));}Promise[_0x13b3('0x1d')](_0x541f53)[_0x13b3('0x1e')](function(){_0x1d4b88({'val':_0x236bbe[_0x13b3('0x19')]});});}});}function splitAdditionalPhone(_0x3ba2fe,_0x5bd08b){return new Promise(function(_0x52ddf5,_0x582505){var _0x52d4cf=_0x5bd08b[_0x13b3('0x21')](':');var _0x385854=_0x52d4cf[0x0];var _0x23d5ad=_0x52d4cf[0x1];if(_0x23d5ad!==''){var _0x28fdaf=_0x23d5ad[_0x13b3('0x21')]('|');var _0xa8f30f=[];for(var _0x253fea=0x0;_0x253fea<_0x28fdaf['length'];_0x253fea++){if(_0x28fdaf[_0x253fea]!==''){var _0x5e8d82=_[_0x13b3('0x22')](promisesAdditionalPhones,{'contactId':_0x3ba2fe,'phone':_0x28fdaf[_0x253fea]});if(_0x5e8d82[_0x13b3('0x19')]==0x0){orderBy++;promisesAdditionalPhones[_0x13b3('0x1c')]({'contactId':_0x3ba2fe,'contactTypeId':_0x385854,'phone':_0x28fdaf[_0x253fea],'orderBy':orderBy});}}}_0x52ddf5({'ok':0x1});}else _0x52ddf5({'res':0x0});});}function createAdditionalPhone(_0x3f38c5,_0x25a269,_0x563443,_0x429dcf){var _0x93d985='';var _0x47fa68='';var _0x2ceb81=_0x563443[_0x13b3('0x21')]('§');_0x93d985=_0x2ceb81[0x0];if(_0x2ceb81[_0x13b3('0x19')]==0x2)_0x47fa68=_0x2ceb81[0x1];return new Promise(function(_0x1c1bd0,_0x5babdc){return db[_0x13b3('0x23')][_0x13b3('0x24')]({'where':{'CmContactId':_0x3f38c5,'item':_0x93d985}})['then'](function(_0x46d0a1){if(_0x46d0a1){return db[_0x13b3('0x23')][_0x13b3('0x25')]({'ItemTypeId':_0x25a269,'description':_0x47fa68,'OrderBy':_0x429dcf},{'where':{'CmContactId':_0x3f38c5,'item':_0x93d985}})[_0x13b3('0x1e')](function(_0xa78083){_0x1c1bd0({'res':'updated'});});}else{return db[_0x13b3('0x23')][_0x13b3('0x26')]({'CmContactId':_0x3f38c5,'item':_0x93d985,'ItemTypeId':_0x25a269,'description':_0x47fa68,'OrderBy':_0x429dcf,'ItemClass':_0x13b3('0x27')})[_0x13b3('0x1e')](function(_0x745ea9){_0x1c1bd0({'res':'inserted'});});}});});}function updateContact(_0x48e261){return new Promise(function(_0x4f1142,_0xe7db7b){var _0x14906d=_0x48e261['id'];delete _0x48e261['id'];return db[_0x13b3('0x28')][_0x13b3('0x25')](_0x48e261,{'where':{'id':_0x14906d}})['then'](function(_0x55b3e2){updatedRows+=0x1;return db[_0x13b3('0x29')][_0x13b3('0x25')]({'phone':_0x48e261['phone']},{'where':{'ContactId':_0x14906d}})[_0x13b3('0x1e')](function(_0x178193){_0x4f1142({'ret':'OK'});});});});}function insertCmHopper(_0x115f55,_0x138589,_0x9e353d,_0xd7dc20,_0x33873a){var _0x2de517=[_0x13b3('0x2a'),'cm_contacts.scheduledat','cm_contacts.id',_0x13b3('0x2b'),_0x138589+'.'+_0xd7dc20,_0x13b3('0x2c'),_0x13b3('0x2d'),'cm_contacts.priority',_0x13b3('0x2e'),'\x22'+_0x33873a+'\x22'];return squel['insert']()['into'](_0x13b3('0x2f'))[_0x13b3('0x30')]([_0x13b3('0x10'),_0x13b3('0x31'),_0x13b3('0x32'),_0x13b3('0x33'),_0xd7dc20,'createdAt','updatedAt',_0x13b3('0x34'),_0x13b3('0x35'),'recallme'],squel[_0x13b3('0xe')]()[_0x13b3('0x36')](_0x2de517)['from'](_0x138589)[_0x13b3('0x11')](_0x13b3('0x37'),null,_0x13b3('0x38')+_0x138589+_0x13b3('0x39'))[_0x13b3('0x11')](_0x9e353d,null,_0x9e353d+'.id\x20=\x20'+_0x138589+'.'+_0xd7dc20)[_0x13b3('0x13')](_0x138589+_0x13b3('0x3a'),_0x115f55)[_0x13b3('0x13')](_0x13b3('0x3b'),NOW)[_0x13b3('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x138589,_0x9e353d,_0xd7dc20,_0x13b3('0x2f'),[_0x13b3('0x3c'),_0x13b3('0x3d')]))[_0x13b3('0x13')](_0x13b3('0x3e'),selectNotIn(_0x138589,_0x9e353d,_0xd7dc20,'cm_hopper',['\x22always\x22'])))[_0x13b3('0x3f')]();}function insertCmHopperBlack(_0x3bf424,_0x527446,_0x26aa0c,_0x584d57){var _0x10d984=[_0x13b3('0x2a'),_0x13b3('0x40'),_0x13b3('0x2b'),_0x527446+'.'+_0x584d57,_0x13b3('0x2c'),_0x13b3('0x2d')];return squel[_0x13b3('0x41')]()[_0x13b3('0x42')](_0x13b3('0x43'))[_0x13b3('0x30')](['phone',_0x13b3('0x32'),_0x13b3('0x33'),_0x584d57,_0x13b3('0x44'),_0x13b3('0x45')],squel['select']()[_0x13b3('0x36')](_0x10d984)['from'](_0x527446)[_0x13b3('0x11')](_0x13b3('0x37'),null,_0x13b3('0x38')+_0x527446+_0x13b3('0x39'))['join'](_0x26aa0c,null,_0x26aa0c+_0x13b3('0x12')+_0x527446+'.'+_0x584d57)[_0x13b3('0x13')](_0x527446+'.CmListId\x20=\x20?',_0x3bf424)[_0x13b3('0x13')](_0x13b3('0x3b'),NOW)[_0x13b3('0x13')](_0x13b3('0x3e'),squel[_0x13b3('0xe')]()['field'](_0x13b3('0x10'))[_0x13b3('0x46')](_0x13b3('0x43'))[_0x13b3('0x13')](_0x13b3('0x47'),_0x3bf424)[_0x13b3('0x13')](_0x584d57+'\x20=\x20?',_0x527446+'.'+_0x584d57)))[_0x13b3('0x3f')]();}function insertCmHopperAdditionalPhones(_0xa97642){var _0x4b8474=[_0x13b3('0x48'),_0x13b3('0x49'),_0x13b3('0x4a'),_0x13b3('0x4b'),_0x13b3('0x4c')];return squel['insert']()[_0x13b3('0x42')](_0x13b3('0x4d'))['fromQuery']([_0x13b3('0x4e'),_0x13b3('0x10'),_0x13b3('0x4f'),_0x13b3('0x44'),_0x13b3('0x45')],squel['select']()[_0x13b3('0x36')](_0x4b8474)[_0x13b3('0x46')](_0x13b3('0x2f'))[_0x13b3('0x11')](_0x13b3('0x37'),null,_0x13b3('0x50'))['join'](_0x13b3('0x51'),null,_0x13b3('0x52'))[_0x13b3('0x13')](_0x13b3('0x53'),_0xa97642)[_0x13b3('0x13')](_0x13b3('0x3b'),NOW))['toString']();}function insertCmContact(_0x6275e2,_0x4bbc0e,_0x3e7abd,_0x2b9066){var _0x45c3ef=_[_0x13b3('0x54')](_[_0x13b3('0x55')](_0x2b9066),[_0x13b3('0x33'),_0x13b3('0x56'),'createdAt',_0x13b3('0x45')]);return squel[_0x13b3('0x41')]()[_0x13b3('0x42')](_0x13b3('0x37'))[_0x13b3('0x30')](_0x45c3ef,squel[_0x13b3('0xe')]()[_0x13b3('0x36')](_0x45c3ef)[_0x13b3('0x46')](_0x4bbc0e)['where']('('+_0x3e7abd[_0x13b3('0x11')](',')+_0x13b3('0x57'),squel[_0x13b3('0xe')]()['fields'](_0x3e7abd)[_0x13b3('0x46')](_0x13b3('0x37'))[_0x13b3('0x13')](_0x13b3('0x47'),_0x6275e2))[_0x13b3('0x13')](_0x13b3('0x58'),squel[_0x13b3('0xe')]()[_0x13b3('0xf')](_0x13b3('0x59'),_0x13b3('0x5a'))[_0x13b3('0x46')](_0x4bbc0e)[_0x13b3('0x5b')](_0x3e7abd[_0x13b3('0x11')](','))))[_0x13b3('0x3f')]();}function handleStop(){logger[_0x13b3('0x5c')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x2fa894){logger[_0x13b3('0x5d')](_0x2fa894[_0x13b3('0x20')]);process[_0x13b3('0x5e')](0x1);}function handleError(_0x5e435f,_0x49d22c){stats['errors']['push']({'name':_0x49d22c['code'],'message':_0x49d22c['message'],'row':_0x5e435f});}function handleQuery(_0x118d00){logger['info'](_0x118d00);return db['sequelize'][_0x13b3('0x16')](_0x118d00)['spread'](function(_0x398a66){results[_0x13b3('0x1c')](_0x398a66);})[_0x13b3('0x1f')](function(_0x1650e8){logger[_0x13b3('0x5d')](_0x1650e8[_0x13b3('0x20')]);});}function main(_0x514887,_0x18e823,_0x1cdb27,_0x57d8bb){logger['info']('main',_0x514887,JSON[_0x13b3('0x5f')](_0x18e823));process[_0x13b3('0x60')](_0x13b3('0x61'));var _0x536ce9=_0x18e823[_0x13b3('0x62')];var _0x2cf27e=_[_0x13b3('0x63')](_0x536ce9);var _0x4a066e=_0x18e823['socket_timestamp'];var _0x4625bc=path['join'](config[_0x13b3('0x64')],_0x13b3('0x65'),_0x4a066e+_0x13b3('0x66'));logger[_0x13b3('0x5c')](_0x13b3('0x67'),_0x18e823);db['ContactItemType'][_0x13b3('0x68')]({'raw':!![],'attributes':['id','name']})[_0x13b3('0x1e')](function(_0xd3de2b){for(var _0x596d63=0x0;_0x596d63<_0xd3de2b[_0x13b3('0x19')];_0x596d63++){if(_0xd3de2b[_0x596d63][_0x13b3('0x69')]in _0x536ce9){contactItemTypes[_0x13b3('0x1c')](_0xd3de2b[_0x596d63]);delete _0x2cf27e[_0xd3de2b[_0x596d63][_0x13b3('0x69')]];hasAdditionalPhones=!![];}for(var _0x3ee189 in _0x536ce9){if(_0xd3de2b[_0x596d63][_0x13b3('0x69')]+_0x13b3('0x6a')===_0x3ee189){phoneDescriptions[_0x13b3('0x1c')]({'itemTypeId':_0xd3de2b[_0x596d63]['id'],'description':_0x3ee189});delete _0x2cf27e[_0x3ee189];}}}if(hasAdditionalPhones)_0x2cf27e[_0x13b3('0x1b')]='';var _0x11c1cb=_[_0x13b3('0x55')](_0x2cf27e)[_0x13b3('0x11')]();logger[_0x13b3('0x5c')]('header',_0x11c1cb);fs[_0x13b3('0x6b')](_0x4625bc,_0x11c1cb+'\x0a');Papa[_0x13b3('0x6c')](fs[_0x13b3('0x6d')](_0x514887),{'header':!![],'skipEmptyLines':!![],'step':function(_0xf759ac,_0x32afc1){try{for(var _0x1c7c4b=0x0,_0xe9ef4e=[];_0x1c7c4b<_0xf759ac[_0x13b3('0x6e')][_0x13b3('0x19')];_0x1c7c4b++){stats[_0x13b3('0x6f')]+=0x1;if(_0xf759ac[_0x13b3('0x70')][_0x1c7c4b]){handleError(_0xf759ac[_0x13b3('0x6e')][_0x1c7c4b],_0xf759ac[_0x13b3('0x70')][_0x1c7c4b]);}else{var _0x2cc13c=[];var _0x2cf7a9=[];var _0x53a223={};for(var _0x4caa54 in _0x536ce9){let _0x1931d2=contactItemTypes[_0x13b3('0x71')](_0x5922f1=>_0x5922f1[_0x13b3('0x69')]===_0x4caa54);let _0x29ba8d=contactItemTypes[_0x13b3('0x71')](_0x31180f=>_0x31180f[_0x13b3('0x69')]+_0x13b3('0x6a')===_0x4caa54);if(_[_0x13b3('0x1a')](_0x1931d2)&&_[_0x13b3('0x1a')](_0x29ba8d)){if(_0x536ce9['hasOwnProperty'](_0x4caa54)){if(_0xf759ac[_0x13b3('0x6e')][_0x1c7c4b][_0x536ce9[_0x4caa54]]){var _0x41f576=_['trim'](_0xf759ac[_0x13b3('0x6e')][_0x1c7c4b][_0x536ce9[_0x4caa54]]['replace'](/"/g,'\x27'));switch(_0x4caa54){case _0x13b3('0x31'):var _0x4b108b=moment(_0x41f576,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x4b108b[_0x13b3('0x72')]()){_0xe9ef4e['push']('\x22'+_0x41f576+'\x22');}else{_0x2cc13c[_0x13b3('0x1c')](_0x13b3('0x73'));}break;case'priority':var _0x78d25=parseInt(_0x41f576);_0x41f576=_[_0x13b3('0x74')](_0x78d25)||_0x78d25<0x0||_0x78d25>0x4?_0x57d8bb?0x3:0x2:_0x78d25;_0xe9ef4e['push']('\x22'+_0x41f576+'\x22');break;case'UserId':var _0x3aff1f=parseInt(_0x41f576);if(_['isNumber'](_0x3aff1f)&&_[_0x13b3('0x75')](_0x1cdb27,_0x3aff1f)){_0xe9ef4e[_0x13b3('0x1c')]('\x22'+_0x3aff1f+'\x22');}else{_0x2cc13c['push'](_0x13b3('0x76'));}break;case _0x13b3('0x77'):if(isEmail(_0x41f576)){_0xe9ef4e[_0x13b3('0x1c')]('\x22'+_0x41f576+'\x22');}else{_0x2cc13c[_0x13b3('0x1c')](_0x13b3('0x78'));}break;case'dateOfBirth':var _0x4a6b77=moment(_0x41f576,_0x13b3('0x79'),!![]);if(_0x4a6b77[_0x13b3('0x72')]()){_0xe9ef4e[_0x13b3('0x1c')]('\x22'+_0x41f576+'\x22');}else{_0x2cc13c[_0x13b3('0x1c')](_0x13b3('0x7a'));}break;default:_0xe9ef4e[_0x13b3('0x1c')]('\x22'+_0x41f576+'\x22');}}else{switch(_0x4caa54){case _0x13b3('0x7b'):case'phone':_0x2cc13c['push'](_0x4caa54+_0x13b3('0x7c'));break;default:_0xe9ef4e[_0x13b3('0x1c')]('\x22\x22');}}}}else{var _0x3028b3='';if(!_['isNil'](_0x1931d2)){if(!_0x53a223[_0x13b3('0x7d')](_0x1931d2['id'])){for(var _0x15b4d9=0x0;_0x15b4d9<_0x536ce9[_0x4caa54]['length'];_0x15b4d9++){var _0x41f576=_[_0x13b3('0x7e')](_0xf759ac[_0x13b3('0x6e')][_0x1c7c4b][_0x536ce9[_0x4caa54][_0x15b4d9]][_0x13b3('0x7f')](/"/g,'\x27'));var _0x5a5c68=phoneDescriptions[_0x13b3('0x71')](_0x4a991b=>_0x4a991b[_0x13b3('0x80')]===_0x1931d2['id']);if(!_['isNil'](_0x5a5c68)){var _0x5eb4ee=_[_0x13b3('0x7e')](_0xf759ac[_0x13b3('0x6e')][_0x1c7c4b][_0x536ce9[_0x5a5c68[_0x13b3('0x81')]][0x0]]['replace'](/"/g,'\x27'));if(!_[_0x13b3('0x1a')](_0x5eb4ee))_0x41f576=_0x41f576+'§'+_0x5eb4ee;}if(_0x3028b3=='')_0x3028b3=_0x41f576;else _0x3028b3+='|'+_0x41f576;}_0x2cf7a9[_0x13b3('0x1c')](_0x1931d2['id']+':'+_0x3028b3);_0x53a223[_0x1931d2['id']]=0x1;}}}}if(hasAdditionalPhones){_0xe9ef4e[_0x13b3('0x1c')]('\x22'+_0x2cf7a9[_0x13b3('0x11')](';')+'\x22');}if(_0x2cc13c['length']){handleError(_0xf759ac['data'][_0x1c7c4b],{'code':_0x13b3('0x82'),'message':_0x2cc13c['join']()});}else{fs[_0x13b3('0x83')](_0x4625bc,_0xe9ef4e['join']()+'\x0a');}_0xe9ef4e=[];}if(!(stats[_0x13b3('0x6f')]%0xc8)){socket['emit'](_0x13b3('0x84')+_0x4a066e,stats);stats[_0x13b3('0x70')]=[];}}if(stopped){logger[_0x13b3('0x5c')](_0x13b3('0x85'));_0x32afc1[_0x13b3('0x86')]();}}catch(_0x9053a3){handleError(_0xf759ac[_0x13b3('0x6e')][_0x1c7c4b],{'code':'SystemError','message':_0x9053a3['message']});logger['error'](_0x13b3('0x87'),_0x9053a3[_0x13b3('0x20')]);}},'complete':function(){try{var _0xa1c32d=[];var _0x4bb245=tempTableName;_0xa1c32d[_0x13b3('0x1c')]('CREATE\x20TABLE\x20'+_0x4bb245+_0x13b3('0x88'));logger[_0x13b3('0x5c')](_0x13b3('0x89'),contactItemTypes[_0x13b3('0x19')]);var _0x242954=util[_0x13b3('0xc')](_0x13b3('0x8a'),_0x4625bc,_0x4bb245,_0x11c1cb,_0x18e823[_0x13b3('0x33')],_0x18e823[_0x13b3('0x56')]||null,NOW,NOW);if(_[_0x13b3('0x1a')](_0x536ce9[_0x13b3('0x31')])){_0x242954+=',\x20scheduledAt\x20=\x20NOW()';}_0xa1c32d['push'](_0x242954);BPromise[_0x13b3('0x8b')](_0xa1c32d,handleQuery)[_0x13b3('0x1e')](function(_0x259163){BPromise[_0x13b3('0x1d')]([handleAdditionalPhones()])[_0x13b3('0x1e')](function(){_0xa1c32d=[];for(var _0x545dfe=0x0;_0x545dfe\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../config/environment','../../../config/logger','localhost','socket.io-emitter','redis','format','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','field','phone','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize'];(function(_0x211632,_0x378e2e){var _0x5a1da1=function(_0x44aff2){while(--_0x44aff2){_0x211632['push'](_0x211632['shift']());}};_0x5a1da1(++_0x378e2e);}(_0xfa28,0x1c6));var _0x8fa2=function(_0x53c256,_0x382a24){_0x53c256=_0x53c256-0x0;var _0x25feb6=_0xfa28[_0x53c256];return _0x25feb6;};'use strict';var fs=require('fs');var path=require(_0x8fa2('0x0'));var _=require(_0x8fa2('0x1'));var Papa=require(_0x8fa2('0x2'));var util=require(_0x8fa2('0x3'));var BPromise=require(_0x8fa2('0x4'));var moment=require(_0x8fa2('0x5'));var squel=require(_0x8fa2('0x6'));var Redis=require(_0x8fa2('0x7'));var db=require('../../../mysqldb')['db'];var config=require(_0x8fa2('0x8'));var logger=require(_0x8fa2('0x9'))('import');config['redis']=_['defaults'](config['redis'],{'host':_0x8fa2('0xa'),'port':0x18eb});var socket=require(_0x8fa2('0xb'))(new Redis(config[_0x8fa2('0xc')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x8fa2('0xd')]('YYYY-MM-DD\x20HH:mm:ss');var tempTableName=_0x8fa2('0xe')+moment()[_0x8fa2('0xd')](_0x8fa2('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x273962){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))*$/[_0x8fa2('0x10')](_0x273962);}function selectNotIn(_0x591cb3,_0x5a736b,_0x24e076,_0x2200f7,_0x23ab93){return squel[_0x8fa2('0x11')]()[_0x8fa2('0x12')](_0x8fa2('0x13'))['from'](_0x2200f7)[_0x8fa2('0x14')](_0x5a736b,null,_0x5a736b+_0x8fa2('0x15')+_0x2200f7+'.'+_0x24e076)[_0x8fa2('0x16')](_0x2200f7+'.'+_0x24e076+_0x8fa2('0x17')+_0x591cb3+'.'+_0x24e076)['where'](_0x5a736b+_0x8fa2('0x18')+_0x23ab93['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x132259,_0x15d207){promisesAdditionalPhones=[];promisesContact=[];return db[_0x8fa2('0x19')]['query'](_0x8fa2('0x1a')+tempTableName)[_0x8fa2('0x1b')](function(_0x28457d){if(_0x28457d!==null){var _0x1e7c4d=[];for(var _0x186a33=0x0;_0x186a33<_0x28457d[_0x8fa2('0x1c')];_0x186a33++){var _0x5c4551=_0x28457d[_0x186a33];if(!_[_0x8fa2('0x1d')](_0x5c4551['phone'])){if(!_[_0x8fa2('0x1d')](_0x5c4551[_0x8fa2('0x1e')]))_0x1e7c4d[_0x8fa2('0x1f')](insertAdditionalPhones(_0x5c4551));promisesContact[_0x8fa2('0x1f')]({'contact':_0x5c4551});}}}Promise['all'](_0x1e7c4d)['then'](function(){_0x132259({'val':0x1});});})[_0x8fa2('0x20')](function(_0x282252){logger[_0x8fa2('0x21')](_0x282252[_0x8fa2('0x22')]);});});}function insertAdditionalPhones(_0x56624a){return new Promise(function(_0x3c1263,_0x435b7b){var _0x535987=_0x56624a[_0x8fa2('0x1e')];if(_[_0x8fa2('0x1d')](_0x535987))_0x435b7b({'val':0x0});else{var _0x5b66ec=_0x535987['split'](';');var _0x4e3f59=[];orderBy=0x0;for(var _0xa590cb=0x0;_0xa590cb<_0x5b66ec[_0x8fa2('0x1c')];_0xa590cb++){_0x4e3f59[_0x8fa2('0x1f')](splitAdditionalPhone(_0x56624a['id'],_0x5b66ec[_0xa590cb]));}Promise[_0x8fa2('0x23')](_0x4e3f59)[_0x8fa2('0x24')](function(){_0x3c1263({'val':_0x5b66ec['length']});});}});}function splitAdditionalPhone(_0x3f5769,_0x30fe69){return new Promise(function(_0x54bac0,_0x4f1cfc){var _0x489abe=_0x30fe69['split'](':');var _0x9fa89=_0x489abe[0x0];var _0x2a9b83=_0x489abe[0x1];if(_0x2a9b83!==''){var _0x1998dc=_0x2a9b83['split']('|');var _0x57d197=[];for(var _0x3aafaf=0x0;_0x3aafaf<_0x1998dc[_0x8fa2('0x1c')];_0x3aafaf++){if(_0x1998dc[_0x3aafaf]!==''){var _0x470ee0=_[_0x8fa2('0x25')](promisesAdditionalPhones,{'contactId':_0x3f5769,'phone':_0x1998dc[_0x3aafaf]});if(_0x470ee0[_0x8fa2('0x1c')]==0x0){orderBy++;promisesAdditionalPhones[_0x8fa2('0x1f')]({'contactId':_0x3f5769,'contactTypeId':_0x9fa89,'phone':_0x1998dc[_0x3aafaf],'orderBy':orderBy});}}}_0x54bac0({'ok':0x1});}else _0x54bac0({'res':0x0});});}function createAdditionalPhone(_0x5108ea,_0x4e3911,_0x3b95e6,_0x3808e3){var _0x42baf8='';var _0x28c18d='';var _0x3ca12a=_0x3b95e6['split']('§');_0x42baf8=_0x3ca12a[0x0];if(_0x3ca12a[_0x8fa2('0x1c')]==0x2)_0x28c18d=_0x3ca12a[0x1];return new Promise(function(_0x1ea3f1,_0x424d0d){return db[_0x8fa2('0x26')]['findOne']({'where':{'CmContactId':_0x5108ea,'item':_0x42baf8}})[_0x8fa2('0x24')](function(_0x1f00fe){if(_0x1f00fe){return db[_0x8fa2('0x26')][_0x8fa2('0x27')]({'ItemTypeId':_0x4e3911,'description':_0x28c18d,'OrderBy':_0x3808e3},{'where':{'CmContactId':_0x5108ea,'item':_0x42baf8}})['then'](function(_0x3db866){_0x1ea3f1({'res':'updated'});});}else{return db['CmContactHasItem'][_0x8fa2('0x28')]({'CmContactId':_0x5108ea,'item':_0x42baf8,'ItemTypeId':_0x4e3911,'description':_0x28c18d,'OrderBy':_0x3808e3,'ItemClass':_0x8fa2('0x29')})[_0x8fa2('0x24')](function(_0x3fc8e8){_0x1ea3f1({'res':_0x8fa2('0x2a')});});}});});}function updateContact(_0x9174a1){return new Promise(function(_0x526a23,_0x502f84){var _0x61fac6=_0x9174a1['id'];delete _0x9174a1['id'];return db[_0x8fa2('0x2b')]['update'](_0x9174a1,{'where':{'id':_0x61fac6}})[_0x8fa2('0x24')](function(_0x55e59a){updatedRows+=0x1;return db[_0x8fa2('0x2c')][_0x8fa2('0x27')]({'phone':_0x9174a1['phone']},{'where':{'ContactId':_0x61fac6}})['then'](function(_0x5bb3dd){_0x526a23({'ret':'OK'});});});});}function insertCmHopper(_0x45b67a,_0x22ccaa,_0x48656b,_0x2130a5,_0x37e73d){var _0x5ea742=[_0x8fa2('0x2d'),'cm_contacts.scheduledat','cm_contacts.id',_0x8fa2('0x2e'),_0x22ccaa+'.'+_0x2130a5,_0x8fa2('0x2f'),_0x8fa2('0x30'),_0x8fa2('0x31'),'cm_contacts.UserId','\x22'+_0x37e73d+'\x22'];return squel['insert']()[_0x8fa2('0x32')]('cm_hopper')[_0x8fa2('0x33')](['phone','scheduledat',_0x8fa2('0x34'),'ListId',_0x2130a5,_0x8fa2('0x35'),_0x8fa2('0x36'),'priority','UserId',_0x8fa2('0x37')],squel['select']()['fields'](_0x5ea742)['from'](_0x22ccaa)[_0x8fa2('0x14')](_0x8fa2('0x38'),null,_0x8fa2('0x39')+_0x22ccaa+_0x8fa2('0x3a'))[_0x8fa2('0x14')](_0x48656b,null,_0x48656b+_0x8fa2('0x15')+_0x22ccaa+'.'+_0x2130a5)['where'](_0x22ccaa+_0x8fa2('0x3b'),_0x45b67a)[_0x8fa2('0x16')](_0x8fa2('0x3c'),NOW)[_0x8fa2('0x16')](_0x8fa2('0x3d'),selectNotIn(_0x22ccaa,_0x48656b,_0x2130a5,_0x8fa2('0x3e'),[_0x8fa2('0x3f'),'\x22onlyIfOpen\x22']))['where'](_0x8fa2('0x3d'),selectNotIn(_0x22ccaa,_0x48656b,_0x2130a5,_0x8fa2('0x3e'),['\x22always\x22'])))[_0x8fa2('0x40')]();}function insertCmHopperBlack(_0x5e908c,_0x1ff123,_0x1c658a,_0x4beeba){var _0x487327=['cm_contacts.phone',_0x8fa2('0x41'),'cm_contacts.ListId',_0x1ff123+'.'+_0x4beeba,'cm_contacts.createdAt',_0x8fa2('0x30')];return squel[_0x8fa2('0x42')]()['into'](_0x8fa2('0x43'))[_0x8fa2('0x33')]([_0x8fa2('0x13'),_0x8fa2('0x34'),'ListId',_0x4beeba,'createdAt',_0x8fa2('0x36')],squel[_0x8fa2('0x11')]()[_0x8fa2('0x44')](_0x487327)['from'](_0x1ff123)[_0x8fa2('0x14')](_0x8fa2('0x38'),null,_0x8fa2('0x39')+_0x1ff123+_0x8fa2('0x3a'))[_0x8fa2('0x14')](_0x1c658a,null,_0x1c658a+_0x8fa2('0x15')+_0x1ff123+'.'+_0x4beeba)[_0x8fa2('0x16')](_0x1ff123+_0x8fa2('0x3b'),_0x5e908c)[_0x8fa2('0x16')](_0x8fa2('0x3c'),NOW)[_0x8fa2('0x16')](_0x8fa2('0x3d'),squel[_0x8fa2('0x11')]()[_0x8fa2('0x12')](_0x8fa2('0x13'))[_0x8fa2('0x45')](_0x8fa2('0x43'))['where'](_0x8fa2('0x46'),_0x5e908c)['where'](_0x4beeba+_0x8fa2('0x47'),_0x1ff123+'.'+_0x4beeba)))[_0x8fa2('0x40')]();}function insertCmHopperAdditionalPhones(_0x225f9a){var _0x4ea128=['cm_hopper.id',_0x8fa2('0x48'),_0x8fa2('0x49'),_0x8fa2('0x4a'),_0x8fa2('0x4b')];return squel[_0x8fa2('0x42')]()[_0x8fa2('0x32')](_0x8fa2('0x4c'))[_0x8fa2('0x33')](['CmHopperId',_0x8fa2('0x13'),_0x8fa2('0x4d'),_0x8fa2('0x35'),_0x8fa2('0x36')],squel['select']()[_0x8fa2('0x44')](_0x4ea128)[_0x8fa2('0x45')](_0x8fa2('0x3e'))[_0x8fa2('0x14')](_0x8fa2('0x38'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x8fa2('0x14')]('cm_contact_has_items',null,_0x8fa2('0x4e'))[_0x8fa2('0x16')]('cm_hopper.ListId\x20=\x20?',_0x225f9a)[_0x8fa2('0x16')](_0x8fa2('0x3c'),NOW))[_0x8fa2('0x40')]();}function insertCmContact(_0x161d97,_0x2d7685,_0x2b7dd3,_0x3387eb){var _0x1abae2=_[_0x8fa2('0x4f')](_[_0x8fa2('0x50')](_0x3387eb),[_0x8fa2('0x51'),'CompanyId',_0x8fa2('0x35'),_0x8fa2('0x36')]);return squel[_0x8fa2('0x42')]()['into']('cm_contacts')[_0x8fa2('0x33')](_0x1abae2,squel['select']()[_0x8fa2('0x44')](_0x1abae2)['from'](_0x2d7685)['where']('('+_0x2b7dd3[_0x8fa2('0x14')](',')+_0x8fa2('0x52'),squel[_0x8fa2('0x11')]()[_0x8fa2('0x44')](_0x2b7dd3)['from'](_0x8fa2('0x38'))['where']('ListId\x20=\x20?',_0x161d97))[_0x8fa2('0x16')](_0x8fa2('0x53'),squel[_0x8fa2('0x11')]()[_0x8fa2('0x12')](_0x8fa2('0x54'),_0x8fa2('0x55'))[_0x8fa2('0x45')](_0x2d7685)[_0x8fa2('0x56')](_0x2b7dd3[_0x8fa2('0x14')](','))))[_0x8fa2('0x40')]();}function handleStop(){logger[_0x8fa2('0x57')](_0x8fa2('0x58'));stopped=!![];}function handleUncaughtException(_0x2c5fb0){logger[_0x8fa2('0x21')](_0x2c5fb0[_0x8fa2('0x22')]);process[_0x8fa2('0x59')](0x1);}function handleError(_0x488f91,_0x382776){stats[_0x8fa2('0x5a')][_0x8fa2('0x1f')]({'name':_0x382776[_0x8fa2('0x5b')],'message':_0x382776[_0x8fa2('0x22')],'row':_0x488f91});}function handleQuery(_0x2810a8){logger[_0x8fa2('0x57')](_0x2810a8);return db[_0x8fa2('0x19')][_0x8fa2('0x5c')](_0x2810a8)[_0x8fa2('0x1b')](function(_0x4b5184){results['push'](_0x4b5184);})['catch'](function(_0x5860b6){logger['error'](_0x5860b6[_0x8fa2('0x22')]);});}function main(_0x1fa00e,_0x3f3553,_0x39f32d,_0x4b38f5){logger['info'](_0x8fa2('0x5d'),_0x1fa00e,JSON[_0x8fa2('0x5e')](_0x3f3553));process[_0x8fa2('0x5f')](_0x8fa2('0x60'));var _0x2b61f2=_0x3f3553['binding'];var _0x372417=_[_0x8fa2('0x61')](_0x2b61f2);var _0x2a22e6=_0x3f3553['socket_timestamp'];var _0x2cc587=path['join'](config[_0x8fa2('0x62')],_0x8fa2('0x63'),_0x2a22e6+_0x8fa2('0x64'));logger[_0x8fa2('0x57')](_0x8fa2('0x65'),_0x3f3553);db['ContactItemType'][_0x8fa2('0x66')]({'raw':!![],'attributes':['id','name']})[_0x8fa2('0x24')](function(_0x27de2e){for(var _0x4ca69f=0x0;_0x4ca69f<_0x27de2e[_0x8fa2('0x1c')];_0x4ca69f++){if(_0x27de2e[_0x4ca69f][_0x8fa2('0x67')]in _0x2b61f2){contactItemTypes[_0x8fa2('0x1f')](_0x27de2e[_0x4ca69f]);delete _0x372417[_0x27de2e[_0x4ca69f]['name']];hasAdditionalPhones=!![];}for(var _0x41eeab in _0x2b61f2){if(_0x27de2e[_0x4ca69f][_0x8fa2('0x67')]+_0x8fa2('0x68')===_0x41eeab){phoneDescriptions['push']({'itemTypeId':_0x27de2e[_0x4ca69f]['id'],'description':_0x41eeab});delete _0x372417[_0x41eeab];}}}if(hasAdditionalPhones)_0x372417[_0x8fa2('0x1e')]='';var _0x4b2055=_[_0x8fa2('0x50')](_0x372417)['join']();logger[_0x8fa2('0x57')](_0x8fa2('0x69'),_0x4b2055);fs[_0x8fa2('0x6a')](_0x2cc587,_0x4b2055+'\x0a');Papa[_0x8fa2('0x6b')](fs[_0x8fa2('0x6c')](_0x1fa00e),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5a46b9,_0x28a149){try{for(var _0x3147f4=0x0,_0x5f2d84=[];_0x3147f4<_0x5a46b9['data'][_0x8fa2('0x1c')];_0x3147f4++){stats[_0x8fa2('0x6d')]+=0x1;if(_0x5a46b9['errors'][_0x3147f4]){handleError(_0x5a46b9[_0x8fa2('0x6e')][_0x3147f4],_0x5a46b9['errors'][_0x3147f4]);}else{var _0x1fb0a6=[];var _0x2df74e=[];var _0xbecb5e={};for(var _0x3f4967 in _0x2b61f2){let _0x3fdd04=contactItemTypes[_0x8fa2('0x6f')](_0xda3ddf=>_0xda3ddf[_0x8fa2('0x67')]===_0x3f4967);let _0x5313f2=contactItemTypes[_0x8fa2('0x6f')](_0x4de46f=>_0x4de46f[_0x8fa2('0x67')]+_0x8fa2('0x68')===_0x3f4967);if(_[_0x8fa2('0x1d')](_0x3fdd04)&&_[_0x8fa2('0x1d')](_0x5313f2)){if(_0x2b61f2['hasOwnProperty'](_0x3f4967)){if(_0x5a46b9[_0x8fa2('0x6e')][_0x3147f4][_0x2b61f2[_0x3f4967]]){var _0x1b8cd5=_[_0x8fa2('0x70')](_0x5a46b9[_0x8fa2('0x6e')][_0x3147f4][_0x2b61f2[_0x3f4967]]['replace'](/"/g,'\x27'));switch(_0x3f4967){case _0x8fa2('0x71'):var _0x98ef71=moment(_0x1b8cd5,_0x8fa2('0x72'),!![]);if(_0x98ef71['isValid']()){_0x5f2d84[_0x8fa2('0x1f')]('\x22'+_0x1b8cd5+'\x22');}else{_0x1fb0a6[_0x8fa2('0x1f')](_0x8fa2('0x73'));}break;case _0x8fa2('0x74'):var _0x145797=parseInt(_0x1b8cd5);_0x1b8cd5=_[_0x8fa2('0x75')](_0x145797)||_0x145797<0x0||_0x145797>0x4?_0x4b38f5?0x3:0x2:_0x145797;_0x5f2d84[_0x8fa2('0x1f')]('\x22'+_0x1b8cd5+'\x22');break;case _0x8fa2('0x76'):var _0x4caa7e=parseInt(_0x1b8cd5);if(_[_0x8fa2('0x77')](_0x4caa7e)&&_[_0x8fa2('0x78')](_0x39f32d,_0x4caa7e)){_0x5f2d84[_0x8fa2('0x1f')]('\x22'+_0x4caa7e+'\x22');}else{_0x1fb0a6['push'](_0x8fa2('0x79'));}break;case'email':if(isEmail(_0x1b8cd5)){_0x5f2d84[_0x8fa2('0x1f')]('\x22'+_0x1b8cd5+'\x22');}else{_0x1fb0a6[_0x8fa2('0x1f')]('email\x20wrong\x20format');}break;case _0x8fa2('0x7a'):var _0x27f39b=moment(_0x1b8cd5,'YYYY-MM-DD',!![]);if(_0x27f39b[_0x8fa2('0x7b')]()){_0x5f2d84['push']('\x22'+_0x1b8cd5+'\x22');}else{_0x1fb0a6[_0x8fa2('0x1f')](_0x8fa2('0x7c'));}break;default:_0x5f2d84['push']('\x22'+_0x1b8cd5+'\x22');}}else{switch(_0x3f4967){case _0x8fa2('0x7d'):case _0x8fa2('0x13'):_0x1fb0a6['push'](_0x3f4967+_0x8fa2('0x7e'));break;default:_0x5f2d84[_0x8fa2('0x1f')]('\x22\x22');}}}}else{var _0x45960f='';if(!_[_0x8fa2('0x1d')](_0x3fdd04)){if(!_0xbecb5e['hasOwnProperty'](_0x3fdd04['id'])){for(var _0x26b13f=0x0;_0x26b13f<_0x2b61f2[_0x3f4967][_0x8fa2('0x1c')];_0x26b13f++){var _0x1b8cd5=_['trim'](_0x5a46b9[_0x8fa2('0x6e')][_0x3147f4][_0x2b61f2[_0x3f4967][_0x26b13f]][_0x8fa2('0x7f')](/"/g,'\x27'));var _0x481b8f=phoneDescriptions[_0x8fa2('0x6f')](_0x5e00b5=>_0x5e00b5['itemTypeId']===_0x3fdd04['id']);if(!_[_0x8fa2('0x1d')](_0x481b8f)){var _0x5bec0a=_[_0x8fa2('0x70')](_0x5a46b9[_0x8fa2('0x6e')][_0x3147f4][_0x2b61f2[_0x481b8f[_0x8fa2('0x80')]][0x0]]['replace'](/"/g,'\x27'));if(!_[_0x8fa2('0x1d')](_0x5bec0a))_0x1b8cd5=_0x1b8cd5+'§'+_0x5bec0a;}if(_0x45960f=='')_0x45960f=_0x1b8cd5;else _0x45960f+='|'+_0x1b8cd5;}_0x2df74e[_0x8fa2('0x1f')](_0x3fdd04['id']+':'+_0x45960f);_0xbecb5e[_0x3fdd04['id']]=0x1;}}}}if(hasAdditionalPhones){_0x5f2d84[_0x8fa2('0x1f')]('\x22'+_0x2df74e[_0x8fa2('0x14')](';')+'\x22');}if(_0x1fb0a6[_0x8fa2('0x1c')]){handleError(_0x5a46b9[_0x8fa2('0x6e')][_0x3147f4],{'code':_0x8fa2('0x81'),'message':_0x1fb0a6[_0x8fa2('0x14')]()});}else{fs[_0x8fa2('0x82')](_0x2cc587,_0x5f2d84['join']()+'\x0a');}_0x5f2d84=[];}if(!(stats[_0x8fa2('0x6d')]%0xc8)){socket[_0x8fa2('0x83')](_0x8fa2('0x84')+_0x2a22e6,stats);stats[_0x8fa2('0x5a')]=[];}}if(stopped){logger['info'](_0x8fa2('0x85'));_0x28a149[_0x8fa2('0x86')]();}}catch(_0x25eb36){handleError(_0x5a46b9[_0x8fa2('0x6e')][_0x3147f4],{'code':_0x8fa2('0x87'),'message':_0x25eb36[_0x8fa2('0x22')]});logger[_0x8fa2('0x21')]('step',_0x25eb36['message']);}},'complete':function(){try{var _0x41e9bb=[];var _0x47b4fa=tempTableName;_0x41e9bb['push'](_0x8fa2('0x88')+_0x47b4fa+_0x8fa2('0x89'));logger[_0x8fa2('0x57')]('CIS\x20len',contactItemTypes[_0x8fa2('0x1c')]);var _0x1d2b31=util[_0x8fa2('0xd')](_0x8fa2('0x8a'),_0x2cc587,_0x47b4fa,_0x4b2055,_0x3f3553[_0x8fa2('0x51')],_0x3f3553[_0x8fa2('0x8b')]||null,NOW,NOW);if(_[_0x8fa2('0x1d')](_0x2b61f2[_0x8fa2('0x71')])){_0x1d2b31+=_0x8fa2('0x8c');}_0x41e9bb[_0x8fa2('0x1f')](_0x1d2b31);BPromise[_0x8fa2('0x8d')](_0x41e9bb,handleQuery)[_0x8fa2('0x24')](function(_0x569e00){BPromise[_0x8fa2('0x23')]([handleAdditionalPhones()])[_0x8fa2('0x24')](function(){_0x41e9bb=[];for(var _0x2a0926=0x0;_0x2a0926\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','sequelize','query','Setting','findOne','enableEmailPreview','all','clone','COUNT(*)','where','t.id\x20IN\x20?','Sequelize','QueryTypes','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','updateInteraction','../../mysqldb','getAccountFK','role','search','select','field','color','tools_tags','getInteractionFK','u.id','u.fullname','ui.','from','left_join','users','u.id\x20=\x20ui.UserId','length','getInteractionsTables','interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.','me.','interactionsTags','it.','\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','getSelectedTags'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc36d,0x7d));var _0xdc36=function(_0x15f3c0,_0x165a64){_0x15f3c0=_0x15f3c0-0x0;var _0x1adfe0=_0xc36d[_0x15f3c0];return _0x1adfe0;};'use strict';var _=require(_0xdc36('0x0'));var squel=require(_0xdc36('0x1'));var as=require(_0xdc36('0x2'));var qs=require(_0xdc36('0x3'));var updateInteraction=require(_0xdc36('0x4'))[_0xdc36('0x5')];var utils=require('./utils');var db=require(_0xdc36('0x6'))['db'];function skipInteractionsQuery(_0x3431f9,_0x53ac17,_0x18c8fe){var _0xbc5223=![];var _0x186c58=utils[_0xdc36('0x7')](_0x3431f9);if(_0x53ac17[_0xdc36('0x8')]==='agent'&&!_0x18c8fe[_0xdc36('0x9')]&&!_0x18c8fe[_0x186c58]){_0xbc5223=!![];}return _0xbc5223;}function getTagsQuery(){return squel[_0xdc36('0xa')]()[_0xdc36('0xb')]('id')[_0xdc36('0xb')]('name')[_0xdc36('0xb')](_0xdc36('0xc'))['from'](_0xdc36('0xd'));}function getUsersQuery(_0x1cb73d,_0x2483bd){var _0x4c0614=utils[_0xdc36('0xe')](_0x1cb73d);var _0x18707d='user_has_'+_0x1cb73d+'_interactions';var _0x3107bc=squel[_0xdc36('0xa')]()[_0xdc36('0xb')](_0xdc36('0xf'))['field'](_0xdc36('0x10'))[_0xdc36('0xb')](_0xdc36('0x11')+_0x4c0614)[_0xdc36('0x12')](_0x18707d,'ui')[_0xdc36('0x13')](_0xdc36('0x14'),'u',_0xdc36('0x15'));if(_0x2483bd[_0xdc36('0x16')]>0x0){_0x3107bc['where'](_0xdc36('0x11')+_0x4c0614+'\x20IN\x20?',_['map'](_0x2483bd,'id'));}return _0x3107bc;}function getInteractionsQuery(_0x59c88f){var _0x64f61e=utils[_0xdc36('0x17')](_0x59c88f);var _0x5a498f=utils[_0xdc36('0x7')](_0x59c88f);var _0x219a73=utils[_0xdc36('0xe')](_0x59c88f);return squel[_0xdc36('0xa')]()[_0xdc36('0x12')](_0x64f61e[_0xdc36('0x18')],'i')['left_join'](_0xdc36('0x19'),'c',_0xdc36('0x1a'))['left_join'](_0xdc36('0x14'),'o',_0xdc36('0x1b'))[_0xdc36('0x13')](_0x64f61e['accounts'],'a',_0xdc36('0x1c')+_0x5a498f)[_0xdc36('0x13')](_0x64f61e['messages'],'me',_0xdc36('0x1d')+_0x219a73+'\x20=\x20i.id')['left_join'](_0x64f61e[_0xdc36('0x1e')],'it',_0xdc36('0x1f')+_0x219a73+_0xdc36('0x20'))[_0xdc36('0x13')](_0xdc36('0xd'),'t',_0xdc36('0x21'));}function getSqlClauses(){var _0x14b595={'body':squel[_0xdc36('0x22')](),'contact':squel['expr'](),'default':squel[_0xdc36('0x22')](),'fields':squel['expr'](),'filter':squel[_0xdc36('0x22')](),'read':squel[_0xdc36('0x22')](),'tags':{'clause':squel[_0xdc36('0x22')](),'ids':null},'user':squel['expr']()};return _0x14b595;}function parseTagParameter(_0xbc4322){var _0x6e3906=squel[_0xdc36('0x22')]();if(_0xbc4322){var _0x525935=utils[_0xdc36('0x23')](_0xbc4322);_0x525935[_0xdc36('0x24')](function(_0x2a596d){_0x6e3906['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2a596d+',%');});}return _0x6e3906;}function parseReadParameter(_0x3c39e3){var _0x2dcef7='';if(_0x3c39e3){_0x2dcef7='unreadMessages\x20{OPERATOR}\x200';if(_0x3c39e3==='1'){_0x2dcef7=_0x2dcef7[_0xdc36('0x25')](_0xdc36('0x26'),'=');}else{_0x2dcef7=_0x2dcef7['replace'](_0xdc36('0x26'),'>');}}return _0x2dcef7;}function parseSearchFilter(_0x5bba0b,_0x49bbf2){var _0x57785d=squel[_0xdc36('0x22')]();if(_0x49bbf2){var _0x2f2bb4=_0x49bbf2['replace']('\x5c','\x5c\x5c')[_0xdc36('0x25')](/'/g,'\x27\x27');if(qs[_0xdc36('0x27')](_0x2f2bb4)){_0x57785d['or'](_0xdc36('0x28'),_0x2f2bb4+'%');if(['sms',_0xdc36('0x29')][_0xdc36('0x2a')](_0x5bba0b)){_0x57785d['or'](_0xdc36('0x2b'),_0x2f2bb4+'%');}else if(_0x5bba0b===_0xdc36('0x2c')){_0x57785d['or'](_0xdc36('0x2d'),_0x2f2bb4+'%');}else if(_0x5bba0b===_0xdc36('0x2e')){_0x57785d['or'](_0xdc36('0x2f'),_0x2f2bb4+'%');}}else if(_0x5bba0b==='mail'&&qs[_0xdc36('0x30')](_0x2f2bb4)){_0x57785d['or'](_0xdc36('0x31'),_0x2f2bb4+'%');}else{if(_0x5bba0b==='mail'){_0x57785d['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xdc36('0x32')](_0x2f2bb4))['or'](_0xdc36('0x33'),qs[_0xdc36('0x32')](_0x2f2bb4));}else{if(_0x5bba0b!=='fax'){_0x57785d['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xdc36('0x32')](_0x2f2bb4));}_0x57785d['or'](_0xdc36('0x34'),_0x2f2bb4+'%');}}}return _0x57785d;}function parseAdvancedSearchFilter(_0x82a0c2,_0x24207a){var _0x302d69=getSqlClauses();var _0x254f24=as[_0xdc36('0x35')](_0x82a0c2);var _0x16303c=_0x254f24[_0xdc36('0x36')];for(var _0x368c75=0x0;_0x368c75<_0x254f24[_0xdc36('0x37')]['length'];_0x368c75++){var _0x1026f5=_0x254f24[_0xdc36('0x37')][_0x368c75];var _0x3e33da='i';var _0x413a00=_['find'](_0x24207a,[_0xdc36('0x38'),_0x1026f5[_0xdc36('0xb')]]);if(_0x413a00){var _0x27e86c=as[_0xdc36('0x39')](_0x3e33da,_0x413a00['type'],_0x1026f5);_0x302d69[_0xdc36('0x3a')][_0x16303c](_0x27e86c['text'],_0x27e86c['value'][_0xdc36('0x3b')],_0x27e86c[_0xdc36('0x3c')][_0xdc36('0x3d')]);}else{switch(_0x1026f5['field']){case _0xdc36('0x3e'):var _0x5abb6a=parseReadParameter(_0x1026f5[_0xdc36('0x3c')]);_0x302d69[_0xdc36('0x3f')][_0xdc36('0x40')](_0x5abb6a);break;case'Contact':if(_0x1026f5[_0xdc36('0x41')]===_0xdc36('0x42')){if(_0x1026f5[_0xdc36('0x3c')][_0xdc36('0x43')]('\x20')['length']>0x1){_0x302d69[_0xdc36('0x44')][_0x16303c](_0xdc36('0x45'),qs[_0xdc36('0x32')](_0x1026f5['value']),null);}else{var _0x51a43a='%'+_0x1026f5[_0xdc36('0x3c')]+'%';_0x302d69[_0xdc36('0x44')][_0x16303c]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x51a43a,_0x51a43a,_0x51a43a);}}else{_0x413a00=_['find'](_0x24207a,[_0xdc36('0x38'),_0xdc36('0x46')]);_0x1026f5[_0xdc36('0xb')]=_0xdc36('0x46');_0x27e86c=as[_0xdc36('0x39')](_0x3e33da,_0x413a00[_0xdc36('0x47')],_0x1026f5);_0x302d69[_0xdc36('0x44')][_0x16303c](_0x27e86c[_0xdc36('0x48')],_0x27e86c[_0xdc36('0x3c')][_0xdc36('0x3b')],_0x27e86c[_0xdc36('0x3c')][_0xdc36('0x3d')]);}break;case _0xdc36('0x49'):var _0x17a716=_0x1026f5[_0xdc36('0x3c')][_0xdc36('0x43')](',')[_0xdc36('0x4a')](function(_0x16dcb7){return Number(_0x16dcb7);});var _0x3b4268=parseTagParameter(_0x17a716);_0x302d69[_0xdc36('0x4b')][_0xdc36('0x4c')][_0xdc36('0x40')](_0x3b4268);_0x302d69[_0xdc36('0x4b')][_0xdc36('0x4d')]=_0x17a716;break;case _0xdc36('0x4e'):if(_0x1026f5[_0xdc36('0x41')]==='$substring'){_0x302d69[_0xdc36('0x4f')][_0x16303c](_0xdc36('0x50'),'%'+_0x1026f5['value']+'%',null);}else{_0x413a00=_['find'](_0x24207a,[_0xdc36('0x38'),'UserId']);_0x1026f5[_0xdc36('0xb')]='UserId';_0x27e86c=as[_0xdc36('0x39')](_0x3e33da,_0x413a00[_0xdc36('0x47')],_0x1026f5);_0x302d69[_0xdc36('0x4f')][_0x16303c](_0x27e86c[_0xdc36('0x48')],_0x27e86c[_0xdc36('0x3c')][_0xdc36('0x3b')],_0x27e86c[_0xdc36('0x3c')][_0xdc36('0x3d')]);}break;case _0xdc36('0x51'):case _0xdc36('0x52'):_0x27e86c=as[_0xdc36('0x39')]('me',null,_0x1026f5);_0x302d69[_0xdc36('0x51')][_0x16303c](_0x27e86c[_0xdc36('0x48')],_0x27e86c[_0xdc36('0x3c')][_0xdc36('0x3b')],_0x27e86c[_0xdc36('0x3c')][_0xdc36('0x3d')]);break;}}}return _0x302d69;}function parseModelFields(_0x3399cc,_0x562c86,_0x58eaba){var _0x2263bb=utils[_0xdc36('0x7')](_0x3399cc);var _0x1dda57=squel[_0xdc36('0x22')]();var _0x205f76=_(_0x562c86)[_0xdc36('0x53')]()['map'](function(_0x1ff104){return _[_0xdc36('0x54')](_0x58eaba,[_0xdc36('0x38'),_0x1ff104])?_0x1ff104:undefined;})['compact']()[_0xdc36('0x3c')]();if(_0x205f76[_0xdc36('0x16')]>0x0){_0x205f76[_0xdc36('0x24')](function(_0xa07e3f){if(_0xa07e3f===_0x2263bb){_0x1dda57[_0xdc36('0x40')]('i.'+_0x2263bb+_0xdc36('0x55'),[]['concat'](_0x562c86[_0xa07e3f]));}else if(_0xa07e3f===_0xdc36('0x56')){var _0x31b52c=JSON[_0xdc36('0x57')](_0x562c86[_0xa07e3f])[_0xdc36('0x58')];var _0x2d7201=JSON[_0xdc36('0x57')](_0x562c86[_0xa07e3f])[_0xdc36('0x59')];_0x1dda57[_0xdc36('0x40')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x31b52c,_0x2d7201);}else{if(_0x562c86[_0xa07e3f]===_0xdc36('0x5a')){_0x1dda57[_0xdc36('0x40')]('i.'+_0xa07e3f+_0xdc36('0x5b'));}else{_0x1dda57[_0xdc36('0x40')]('i.'+_0xa07e3f+_0xdc36('0x5c'),_0x562c86[_0xa07e3f]);}}});}return _0x1dda57;}function parseQueryParameters(_0x187b00,_0x1e7332,_0xb26cf4){var _0x51d314=getSqlClauses();return Promise['resolve']()[_0xdc36('0x5d')](function(){return parseModelFields(_0x187b00,_0x1e7332,_0xb26cf4);})[_0xdc36('0x5d')](function(_0x5cb6cd){_0x51d314[_0xdc36('0x5e')][_0xdc36('0x40')](_0x5cb6cd);return parseReadParameter(_0x1e7332['read']);})['then'](function(_0x7a62c6){_0x51d314['read'][_0xdc36('0x40')](_0x7a62c6);return parseTagParameter(_0x1e7332['tag']);})[_0xdc36('0x5d')](function(_0x55c0c0){_0x51d314['tags'][_0xdc36('0x4c')]['and'](_0x55c0c0);return parseSearchFilter(_0x187b00,_0x1e7332[_0xdc36('0x5f')]);})[_0xdc36('0x5d')](function(_0x33b3d2){_0x51d314[_0xdc36('0x5f')]=_0x33b3d2;return _0x51d314;});}function checkAccountsRestrictions(_0x396a6a,_0x480937,_0xf47d2a){var _0x379a72=utils[_0xdc36('0x7')](_0x396a6a);var _0x4e62c2='get'+_[_0xdc36('0x60')](_0x396a6a)+(_0x396a6a==='chat'?_0xdc36('0x61'):_0xdc36('0x62'));var _0x3b9df0=squel[_0xdc36('0x22')]();return Promise['resolve']()['then'](function(){if(_0xf47d2a[_0xdc36('0x9')]&&_0x480937[_0xdc36('0x8')]===_0xdc36('0x63')){return _0x480937[_0x4e62c2]({'attributes':['id'],'raw':!![]});}})[_0xdc36('0x5d')](function(_0x22393e){if(_0x22393e){if(_0x22393e[_0xdc36('0x16')]===0x0){_0x3b9df0[_0xdc36('0x40')]('i.'+_0x379a72+_0xdc36('0x5b'));}else{_0x3b9df0[_0xdc36('0x40')]('i.'+_0x379a72+_0xdc36('0x55'),_['map'](_0x22393e,'id'));}}else if(!_0xf47d2a[_0x379a72]){_0x3b9df0[_0xdc36('0x40')]('i.'+_0x379a72+'\x20IS\x20NOT\x20NULL');}})[_0xdc36('0x5d')](function(){return _0x3b9df0;});}function getClosedOrderClause(_0x38fc44,_0x63528){var _0x35adec='';var _0x158a68=[_0xdc36('0x64'),_0xdc36('0x65'),_0xdc36('0x66')];if(_0x38fc44===_0xdc36('0x67')){_0x158a68[_0xdc36('0x68')](_0xdc36('0x69'));}if(_0x63528[_0xdc36('0x6a')]==='0'&&_0x38fc44===_0xdc36('0x67')){_0x35adec=_0xdc36('0x69');}else{if(_0x63528[_0xdc36('0x6a')]==='1'){_0x158a68[_0xdc36('0x6b')]();}_0x35adec=_0xdc36('0x6c')+_0x158a68[_0xdc36('0x6d')](',\x20')+')';}return _0x35adec;}function getFilteredInteractions(_0x414f5b,_0x25444e,_0x5e52e2,_0x327c04){var _0x26aa6a=utils[_0xdc36('0xe')](_0x414f5b);var _0x3f3767=_[_0xdc36('0x60')](_0x414f5b)+_0xdc36('0x6e');var _0x5ae258=[];var _0x2bf7cf=getTagsQuery();var _0xe0935e={'type':db['Sequelize']['QueryTypes'][_0xdc36('0x6f')],'raw':!![]};var _0x271004=[];var _0x9e867d=[];return db['sequelize']['query'](_0x2bf7cf[_0xdc36('0x70')](),_0xe0935e)[_0xdc36('0x5d')](function(_0x50a8ea){_0x5ae258=_['keyBy'](_0x50a8ea,'id');_0xe0935e=_[_0xdc36('0x71')](_0xe0935e,{'model':db[_0x3f3767],'mapToModel':!![],'nest':!![]});if(_0x5e52e2[_0xdc36('0x5e')]){_0x327c04[_0xdc36('0x72')][_0xdc36('0x24')](function(_0x118c99){_0x25444e[_0xdc36('0xb')]('i.'+_0x118c99);});}else{_0x25444e[_0xdc36('0xb')](_0xdc36('0x73'),'unreadMessages');_0x25444e[_0xdc36('0xb')]('a.key','Account.key');_0x25444e['field'](_0xdc36('0x74'),_0xdc36('0x75'));if(_0x414f5b===_0xdc36('0x67')){_0x25444e[_0xdc36('0xb')]('a.email',_0xdc36('0x76'));_0x25444e[_0xdc36('0xb')](_0xdc36('0x77'),_0xdc36('0x78'));_0x25444e[_0xdc36('0xb')]('i.id');_0x25444e['field']('i.createdAt');_0x25444e['field'](_0xdc36('0x79'));_0x25444e[_0xdc36('0xb')](_0xdc36('0x7a'));_0x25444e[_0xdc36('0xb')](_0xdc36('0x7b'));_0x25444e[_0xdc36('0xb')](_0xdc36('0x7c'));_0x25444e[_0xdc36('0xb')](_0xdc36('0x7d'));_0x25444e['field'](_0xdc36('0x7e'));_0x25444e[_0xdc36('0xb')]('i.subject');_0x25444e['field'](_0xdc36('0x66'));_0x25444e['field'](_0xdc36('0x65'));_0x25444e['field'](_0xdc36('0x64'));_0x25444e[_0xdc36('0xb')](_0xdc36('0x69'));_0x25444e['field']('i.to');_0x25444e['field'](_0xdc36('0x7f'));_0x25444e[_0xdc36('0xb')](_0xdc36('0x80'));_0x25444e[_0xdc36('0xb')](_0xdc36('0x81'));}else if(_0x414f5b==='openchannel'){_0x25444e[_0xdc36('0xb')](_0xdc36('0x82'),_0xdc36('0x78'));}else{_0x25444e['field']('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0xdc36('0x78'));}if(_0x414f5b!==_0xdc36('0x67')){_0x25444e[_0xdc36('0xb')](_0xdc36('0x83'));}_0x25444e[_0xdc36('0xb')](_0xdc36('0x84'),_0xdc36('0x85'));_0x25444e[_0xdc36('0xb')](_0xdc36('0x86'),_0xdc36('0x87'));_0x25444e['field']('c.email','Contact.email');_0x25444e['field'](_0xdc36('0x88'),_0xdc36('0x89'));_0x25444e[_0xdc36('0xb')]('c.mobile',_0xdc36('0x8a'));_0x25444e[_0xdc36('0xb')](_0xdc36('0x8b'),_0xdc36('0x8c'));_0x25444e['field'](_0xdc36('0x8d'),_0xdc36('0x8e'));_0x25444e[_0xdc36('0xb')](_0xdc36('0x8f'),_0xdc36('0x90'));_0x25444e[_0xdc36('0xb')](_0xdc36('0x91'),_0xdc36('0x92'));}if(_0x327c04[_0xdc36('0x93')]){_0x25444e[_0xdc36('0x93')](_0x327c04[_0xdc36('0x93')]);}if(_0x327c04[_0xdc36('0x94')]){_0x25444e['offset'](_0x327c04[_0xdc36('0x94')]);}return db[_0xdc36('0x95')][_0xdc36('0x96')](_0x25444e[_0xdc36('0x70')](),_0xe0935e);})[_0xdc36('0x5d')](function(_0x58cd17){_0x271004=_0x58cd17;var _0x391c7c=getUsersQuery(_0x414f5b,_0x271004);return db[_0xdc36('0x95')]['query'](_0x391c7c[_0xdc36('0x70')](),_0xe0935e);})[_0xdc36('0x5d')](function(_0x31ba3f){_0x9e867d=_['groupBy'](_0x31ba3f,_0x26aa6a);if(_0x414f5b===_0xdc36('0x67')){return db[_0xdc36('0x97')][_0xdc36('0x98')]({'attributes':[_0xdc36('0x99')],'raw':!![]});}})[_0xdc36('0x5d')](function(_0x2592ba){var _0x365f42=_0x2592ba?_0x2592ba[_0xdc36('0x99')]:undefined;var _0x5b9007=_0x271004[_0xdc36('0x4a')](function(_0x4d36d9){return updateInteraction(_0x4d36d9,_0x5ae258,_0x9e867d,_0x365f42);});return Promise[_0xdc36('0x9a')](_0x5b9007);});}function countFilteredInteractions(_0x3ab971,_0x3d2031){var _0x2634f1=_0x3ab971[_0xdc36('0x9b')]();_0x2634f1[_0xdc36('0xb')](_0xdc36('0x9c'));_0x2634f1['field'](_0xdc36('0x73'),_0xdc36('0x3e'));var _0x312fe0=utils[_0xdc36('0x23')](_0x3d2031);if(!_['isEmpty'](_0x312fe0)){_0x2634f1[_0xdc36('0x9d')](_0xdc36('0x9e'),_0x312fe0);}var _0x21a8e4={'type':db[_0xdc36('0x9f')][_0xdc36('0xa0')]['SELECT'],'raw':!![]};return db['sequelize'][_0xdc36('0x96')](_0x2634f1[_0xdc36('0x70')](),_0x21a8e4);}module['exports']={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x8d9b=['type','default','text','value','start','end','unreadMessages','Contact','operator','$substring','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','map','tags','clause','ids','UserId','user','body','plainBody','keys','compact','concat','createdAt','parse','$gte','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','resolve','then','fields','read','tag','filter','capitalize','chat','Websites','Accounts','search','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.secondDisposition','i.disposition','closed','i.substatus','shift','CONCAT_WS(\x27\x27,\x20','join','Interaction','Sequelize','SELECT','sequelize','query','toString','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','contactName','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgDirection','i.subject','i.to','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','Contact.firstName','c.lastName','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Owner.fullname','o.internal','Owner.internal','TagIds','limit','offset','Setting','enableEmailPreview','clone','isEmpty','t.id\x20IN\x20?','QueryTypes','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','../../mysqldb','role','field','name','color','from','tools_tags','getInteractionFK','user_has_','_interactions','select','u.id','u.fullname','ui.','left_join','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','getInteractionsTables','getAccountFK','interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','accounts','a.id\x20=\x20i.','messages','me.','interactionsTags','it.','\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','unreadMessages\x20{OPERATOR}\x200','{OPERATOR}','replace','isNumeric','i.id\x20LIKE\x20?','sms','includes','i.phone\x20LIKE\x20?','fax','openchannel','i.from\x20LIKE\x20?','mail','isEmail','c.email\x20LIKE\x20?','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','parseSearch','sqlOperator','conditions','buildExpression'];(function(_0x53fc15,_0xdc213b){var _0x51a8fd=function(_0xe5b415){while(--_0xe5b415){_0x53fc15['push'](_0x53fc15['shift']());}};_0x51a8fd(++_0xdc213b);}(_0x8d9b,0x104));var _0xb8d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d9b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb8d9('0x0'));var squel=require(_0xb8d9('0x1'));var as=require(_0xb8d9('0x2'));var qs=require(_0xb8d9('0x3'));var updateInteraction=require(_0xb8d9('0x4'))['updateInteraction'];var utils=require('./utils');var db=require(_0xb8d9('0x5'))['db'];function skipInteractionsQuery(_0x47b650,_0x2192ff,_0x3da7ad){var _0x56deeb=![];var _0x5996e9=utils['getAccountFK'](_0x47b650);if(_0x2192ff[_0xb8d9('0x6')]==='agent'&&!_0x3da7ad['search']&&!_0x3da7ad[_0x5996e9]){_0x56deeb=!![];}return _0x56deeb;}function getTagsQuery(){return squel['select']()[_0xb8d9('0x7')]('id')[_0xb8d9('0x7')](_0xb8d9('0x8'))[_0xb8d9('0x7')](_0xb8d9('0x9'))[_0xb8d9('0xa')](_0xb8d9('0xb'));}function getUsersQuery(_0x48f36d,_0x857f2a){var _0x59f638=utils[_0xb8d9('0xc')](_0x48f36d);var _0x2a60a4=_0xb8d9('0xd')+_0x48f36d+_0xb8d9('0xe');var _0x7f604f=squel[_0xb8d9('0xf')]()[_0xb8d9('0x7')](_0xb8d9('0x10'))[_0xb8d9('0x7')](_0xb8d9('0x11'))[_0xb8d9('0x7')](_0xb8d9('0x12')+_0x59f638)[_0xb8d9('0xa')](_0x2a60a4,'ui')[_0xb8d9('0x13')]('users','u',_0xb8d9('0x14'));if(_0x857f2a[_0xb8d9('0x15')]>0x0){_0x7f604f[_0xb8d9('0x16')](_0xb8d9('0x12')+_0x59f638+_0xb8d9('0x17'),_['map'](_0x857f2a,'id'));}return _0x7f604f;}function getInteractionsQuery(_0x542141){var _0x5b7d5a=utils[_0xb8d9('0x18')](_0x542141);var _0x2d1b34=utils[_0xb8d9('0x19')](_0x542141);var _0x1183e4=utils['getInteractionFK'](_0x542141);return squel[_0xb8d9('0xf')]()['from'](_0x5b7d5a[_0xb8d9('0x1a')],'i')[_0xb8d9('0x13')](_0xb8d9('0x1b'),'c',_0xb8d9('0x1c'))[_0xb8d9('0x13')]('users','o','o.id\x20=\x20i.UserId')['left_join'](_0x5b7d5a[_0xb8d9('0x1d')],'a',_0xb8d9('0x1e')+_0x2d1b34)[_0xb8d9('0x13')](_0x5b7d5a[_0xb8d9('0x1f')],'me',_0xb8d9('0x20')+_0x1183e4+'\x20=\x20i.id')[_0xb8d9('0x13')](_0x5b7d5a[_0xb8d9('0x21')],'it',_0xb8d9('0x22')+_0x1183e4+_0xb8d9('0x23'))[_0xb8d9('0x13')](_0xb8d9('0xb'),'t',_0xb8d9('0x24'));}function getSqlClauses(){var _0x3d1659={'body':squel[_0xb8d9('0x25')](),'contact':squel[_0xb8d9('0x25')](),'default':squel['expr'](),'fields':squel[_0xb8d9('0x25')](),'filter':squel['expr'](),'read':squel['expr'](),'tags':{'clause':squel[_0xb8d9('0x25')](),'ids':null},'user':squel[_0xb8d9('0x25')]()};return _0x3d1659;}function parseTagParameter(_0x43c9f1){var _0x33c75e=squel[_0xb8d9('0x25')]();if(_0x43c9f1){var _0x4885f2=utils[_0xb8d9('0x26')](_0x43c9f1);_0x4885f2[_0xb8d9('0x27')](function(_0x3111aa){_0x33c75e['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3111aa+',%');});}return _0x33c75e;}function parseReadParameter(_0x2d1439){var _0x1c9bd4='';if(_0x2d1439){_0x1c9bd4=_0xb8d9('0x28');if(_0x2d1439==='1'){_0x1c9bd4=_0x1c9bd4['replace'](_0xb8d9('0x29'),'=');}else{_0x1c9bd4=_0x1c9bd4[_0xb8d9('0x2a')]('{OPERATOR}','>');}}return _0x1c9bd4;}function parseSearchFilter(_0x344e27,_0x6cd7f6){var _0x2694f0=squel[_0xb8d9('0x25')]();if(_0x6cd7f6){var _0x358e4d=_0x6cd7f6[_0xb8d9('0x2a')]('\x5c','\x5c\x5c')[_0xb8d9('0x2a')](/'/g,'\x27\x27');if(qs[_0xb8d9('0x2b')](_0x358e4d)){_0x2694f0['or'](_0xb8d9('0x2c'),_0x358e4d+'%');if([_0xb8d9('0x2d'),'whatsapp'][_0xb8d9('0x2e')](_0x344e27)){_0x2694f0['or'](_0xb8d9('0x2f'),_0x358e4d+'%');}else if(_0x344e27===_0xb8d9('0x30')){_0x2694f0['or']('i.fax\x20LIKE\x20?',_0x358e4d+'%');}else if(_0x344e27===_0xb8d9('0x31')){_0x2694f0['or'](_0xb8d9('0x32'),_0x358e4d+'%');}}else if(_0x344e27===_0xb8d9('0x33')&&qs[_0xb8d9('0x34')](_0x358e4d)){_0x2694f0['or'](_0xb8d9('0x35'),_0x358e4d+'%');}else{if(_0x344e27===_0xb8d9('0x33')){_0x2694f0['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x358e4d))['or'](_0xb8d9('0x36'),qs[_0xb8d9('0x37')](_0x358e4d));}else{if(_0x344e27!==_0xb8d9('0x30')){_0x2694f0['or'](_0xb8d9('0x38'),qs[_0xb8d9('0x37')](_0x358e4d));}_0x2694f0['or'](_0xb8d9('0x39'),_0x358e4d+'%');}}}return _0x2694f0;}function parseAdvancedSearchFilter(_0x4f11e4,_0x4992a6){var _0x4425f3=getSqlClauses();var _0x3c1503=as[_0xb8d9('0x3a')](_0x4f11e4);var _0x499334=_0x3c1503[_0xb8d9('0x3b')];for(var _0x4fca56=0x0;_0x4fca56<_0x3c1503[_0xb8d9('0x3c')][_0xb8d9('0x15')];_0x4fca56++){var _0x1268ea=_0x3c1503['conditions'][_0x4fca56];var _0x3330e7='i';var _0x1ad60d=_['find'](_0x4992a6,['name',_0x1268ea[_0xb8d9('0x7')]]);if(_0x1ad60d){var _0x1af691=as[_0xb8d9('0x3d')](_0x3330e7,_0x1ad60d[_0xb8d9('0x3e')],_0x1268ea);_0x4425f3[_0xb8d9('0x3f')][_0x499334](_0x1af691[_0xb8d9('0x40')],_0x1af691[_0xb8d9('0x41')][_0xb8d9('0x42')],_0x1af691[_0xb8d9('0x41')][_0xb8d9('0x43')]);}else{switch(_0x1268ea[_0xb8d9('0x7')]){case _0xb8d9('0x44'):var _0x9f11f2=parseReadParameter(_0x1268ea[_0xb8d9('0x41')]);_0x4425f3['read']['and'](_0x9f11f2);break;case _0xb8d9('0x45'):if(_0x1268ea[_0xb8d9('0x46')]===_0xb8d9('0x47')){if(_0x1268ea[_0xb8d9('0x41')]['split']('\x20')['length']>0x1){_0x4425f3[_0xb8d9('0x48')][_0x499334]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xb8d9('0x37')](_0x1268ea['value']),null);}else{var _0x2356c5='%'+_0x1268ea['value']+'%';_0x4425f3[_0xb8d9('0x48')][_0x499334](_0xb8d9('0x49'),_0x2356c5,_0x2356c5,_0x2356c5);}}else{_0x1ad60d=_[_0xb8d9('0x4a')](_0x4992a6,['name',_0xb8d9('0x4b')]);_0x1268ea[_0xb8d9('0x7')]=_0xb8d9('0x4b');_0x1af691=as['buildExpression'](_0x3330e7,_0x1ad60d['type'],_0x1268ea);_0x4425f3['contact'][_0x499334](_0x1af691['text'],_0x1af691['value'][_0xb8d9('0x42')],_0x1af691[_0xb8d9('0x41')][_0xb8d9('0x43')]);}break;case'Tag':var _0x53eb73=_0x1268ea[_0xb8d9('0x41')]['split'](',')[_0xb8d9('0x4c')](function(_0x25ae38){return Number(_0x25ae38);});var _0x1a8498=parseTagParameter(_0x53eb73);_0x4425f3[_0xb8d9('0x4d')][_0xb8d9('0x4e')]['and'](_0x1a8498);_0x4425f3[_0xb8d9('0x4d')][_0xb8d9('0x4f')]=_0x53eb73;break;case'User':if(_0x1268ea[_0xb8d9('0x46')]===_0xb8d9('0x47')){_0x4425f3['user'][_0x499334]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x1268ea[_0xb8d9('0x41')]+'%',null);}else{_0x1ad60d=_[_0xb8d9('0x4a')](_0x4992a6,[_0xb8d9('0x8'),_0xb8d9('0x50')]);_0x1268ea[_0xb8d9('0x7')]='UserId';_0x1af691=as[_0xb8d9('0x3d')](_0x3330e7,_0x1ad60d[_0xb8d9('0x3e')],_0x1268ea);_0x4425f3[_0xb8d9('0x51')][_0x499334](_0x1af691[_0xb8d9('0x40')],_0x1af691[_0xb8d9('0x41')][_0xb8d9('0x42')],_0x1af691['value'][_0xb8d9('0x43')]);}break;case _0xb8d9('0x52'):case _0xb8d9('0x53'):_0x1af691=as[_0xb8d9('0x3d')]('me',null,_0x1268ea);_0x4425f3[_0xb8d9('0x52')][_0x499334](_0x1af691[_0xb8d9('0x40')],_0x1af691['value'][_0xb8d9('0x42')],_0x1af691[_0xb8d9('0x41')]['end']);break;}}}return _0x4425f3;}function parseModelFields(_0x212310,_0x41f38b,_0x4ae9e1){var _0x587bb8=utils[_0xb8d9('0x19')](_0x212310);var _0x423927=squel[_0xb8d9('0x25')]();var _0xca2c82=_(_0x41f38b)[_0xb8d9('0x54')]()[_0xb8d9('0x4c')](function(_0x328d1d){return _['some'](_0x4ae9e1,[_0xb8d9('0x8'),_0x328d1d])?_0x328d1d:undefined;})[_0xb8d9('0x55')]()[_0xb8d9('0x41')]();if(_0xca2c82['length']>0x0){_0xca2c82[_0xb8d9('0x27')](function(_0x1dee5c){if(_0x1dee5c===_0x587bb8){_0x423927['and']('i.'+_0x587bb8+'\x20IN\x20?',[][_0xb8d9('0x56')](_0x41f38b[_0x1dee5c]));}else if(_0x1dee5c===_0xb8d9('0x57')){var _0x4e9a10=JSON[_0xb8d9('0x58')](_0x41f38b[_0x1dee5c])[_0xb8d9('0x59')];var _0x124722=JSON[_0xb8d9('0x58')](_0x41f38b[_0x1dee5c])['$lte'];_0x423927[_0xb8d9('0x5a')](_0xb8d9('0x5b'),_0x4e9a10,_0x124722);}else{if(_0x41f38b[_0x1dee5c]===_0xb8d9('0x5c')){_0x423927[_0xb8d9('0x5a')]('i.'+_0x1dee5c+_0xb8d9('0x5d'));}else{_0x423927[_0xb8d9('0x5a')]('i.'+_0x1dee5c+_0xb8d9('0x5e'),_0x41f38b[_0x1dee5c]);}}});}return _0x423927;}function parseQueryParameters(_0x518bb4,_0x3101da,_0x5c3100){var _0x305d1b=getSqlClauses();return Promise[_0xb8d9('0x5f')]()[_0xb8d9('0x60')](function(){return parseModelFields(_0x518bb4,_0x3101da,_0x5c3100);})['then'](function(_0x181878){_0x305d1b[_0xb8d9('0x61')][_0xb8d9('0x5a')](_0x181878);return parseReadParameter(_0x3101da[_0xb8d9('0x62')]);})[_0xb8d9('0x60')](function(_0x34a11e){_0x305d1b[_0xb8d9('0x62')][_0xb8d9('0x5a')](_0x34a11e);return parseTagParameter(_0x3101da[_0xb8d9('0x63')]);})[_0xb8d9('0x60')](function(_0x24ff63){_0x305d1b['tags'][_0xb8d9('0x4e')][_0xb8d9('0x5a')](_0x24ff63);return parseSearchFilter(_0x518bb4,_0x3101da[_0xb8d9('0x64')]);})[_0xb8d9('0x60')](function(_0x5c1a14){_0x305d1b[_0xb8d9('0x64')]=_0x5c1a14;return _0x305d1b;});}function checkAccountsRestrictions(_0x20e625,_0x1cdc5b,_0x351ac8){var _0x3bb503=utils['getAccountFK'](_0x20e625);var _0x11ccbc='get'+_[_0xb8d9('0x65')](_0x20e625)+(_0x20e625===_0xb8d9('0x66')?_0xb8d9('0x67'):_0xb8d9('0x68'));var _0x24ccf4=squel[_0xb8d9('0x25')]();return Promise[_0xb8d9('0x5f')]()['then'](function(){if(_0x351ac8[_0xb8d9('0x69')]&&_0x1cdc5b[_0xb8d9('0x6')]==='agent'){return _0x1cdc5b[_0x11ccbc]({'attributes':['id'],'raw':!![]});}})[_0xb8d9('0x60')](function(_0x49c6af){if(_0x49c6af){if(_0x49c6af[_0xb8d9('0x15')]===0x0){_0x24ccf4[_0xb8d9('0x5a')]('i.'+_0x3bb503+'\x20IS\x20NULL');}else{_0x24ccf4[_0xb8d9('0x5a')]('i.'+_0x3bb503+_0xb8d9('0x17'),_['map'](_0x49c6af,'id'));}}else if(!_0x351ac8[_0x3bb503]){_0x24ccf4[_0xb8d9('0x5a')]('i.'+_0x3bb503+_0xb8d9('0x6a'));}})['then'](function(){return _0x24ccf4;});}function getClosedOrderClause(_0x8f7212,_0x54b53c){var _0xffeec3='';var _0x31a5e8=[_0xb8d9('0x6b'),_0xb8d9('0x6c'),_0xb8d9('0x6d')];if(_0x8f7212==='mail'){_0x31a5e8['unshift']('i.substatus');}if(_0x54b53c[_0xb8d9('0x6e')]==='0'&&_0x8f7212===_0xb8d9('0x33')){_0xffeec3=_0xb8d9('0x6f');}else{if(_0x54b53c[_0xb8d9('0x6e')]==='1'){_0x31a5e8[_0xb8d9('0x70')]();}_0xffeec3=_0xb8d9('0x71')+_0x31a5e8[_0xb8d9('0x72')](',\x20')+')';}return _0xffeec3;}function getFilteredInteractions(_0x24be60,_0x3cc52a,_0x5f37ae,_0x360b05){var _0x32e58f=utils[_0xb8d9('0xc')](_0x24be60);var _0x15d5ed=_['capitalize'](_0x24be60)+_0xb8d9('0x73');var _0x7a813f=[];var _0x91236=getTagsQuery();var _0x4379ae={'type':db[_0xb8d9('0x74')]['QueryTypes'][_0xb8d9('0x75')],'raw':!![]};var _0x2fb1a9=[];var _0x55e2eb=[];return db[_0xb8d9('0x76')][_0xb8d9('0x77')](_0x91236[_0xb8d9('0x78')](),_0x4379ae)['then'](function(_0x275708){_0x7a813f=_['keyBy'](_0x275708,'id');_0x4379ae=_[_0xb8d9('0x79')](_0x4379ae,{'model':db[_0x15d5ed],'mapToModel':!![],'nest':!![]});if(_0x5f37ae[_0xb8d9('0x61')]){_0x360b05[_0xb8d9('0x7a')][_0xb8d9('0x27')](function(_0x55b547){_0x3cc52a[_0xb8d9('0x7')]('i.'+_0x55b547);});}else{_0x3cc52a[_0xb8d9('0x7')](_0xb8d9('0x7b'),'unreadMessages');_0x3cc52a['field'](_0xb8d9('0x7c'),'Account.key');_0x3cc52a[_0xb8d9('0x7')](_0xb8d9('0x7d'),_0xb8d9('0x7e'));if(_0x24be60===_0xb8d9('0x33')){_0x3cc52a['field'](_0xb8d9('0x7f'),_0xb8d9('0x80'));_0x3cc52a['field']('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0xb8d9('0x81'));_0x3cc52a['field']('i.id');_0x3cc52a[_0xb8d9('0x7')](_0xb8d9('0x82'));_0x3cc52a[_0xb8d9('0x7')](_0xb8d9('0x83'));_0x3cc52a['field'](_0xb8d9('0x84'));_0x3cc52a[_0xb8d9('0x7')]('i.closedAt');_0x3cc52a[_0xb8d9('0x7')](_0xb8d9('0x85'));_0x3cc52a[_0xb8d9('0x7')]('i.lastMsgAt');_0x3cc52a['field'](_0xb8d9('0x86'));_0x3cc52a[_0xb8d9('0x7')](_0xb8d9('0x87'));_0x3cc52a[_0xb8d9('0x7')](_0xb8d9('0x6d'));_0x3cc52a[_0xb8d9('0x7')](_0xb8d9('0x6c'));_0x3cc52a['field'](_0xb8d9('0x6b'));_0x3cc52a[_0xb8d9('0x7')](_0xb8d9('0x6f'));_0x3cc52a[_0xb8d9('0x7')](_0xb8d9('0x88'));_0x3cc52a[_0xb8d9('0x7')](_0xb8d9('0x89'));_0x3cc52a['field'](_0xb8d9('0x8a'));_0x3cc52a['field'](_0xb8d9('0x8b'));}else if(_0x24be60===_0xb8d9('0x31')){_0x3cc52a[_0xb8d9('0x7')](_0xb8d9('0x8c'),_0xb8d9('0x81'));}else{_0x3cc52a['field'](_0xb8d9('0x8d'),'contactName');}if(_0x24be60!==_0xb8d9('0x33')){_0x3cc52a['field']('i.*');}_0x3cc52a[_0xb8d9('0x7')]('c.firstName',_0xb8d9('0x8e'));_0x3cc52a[_0xb8d9('0x7')](_0xb8d9('0x8f'),'Contact.lastName');_0x3cc52a[_0xb8d9('0x7')]('c.email',_0xb8d9('0x90'));_0x3cc52a[_0xb8d9('0x7')](_0xb8d9('0x91'),_0xb8d9('0x92'));_0x3cc52a['field'](_0xb8d9('0x93'),'Contact.mobile');_0x3cc52a[_0xb8d9('0x7')](_0xb8d9('0x94'),'Contact.fax');_0x3cc52a[_0xb8d9('0x7')]('o.fullname',_0xb8d9('0x95'));_0x3cc52a[_0xb8d9('0x7')](_0xb8d9('0x96'),_0xb8d9('0x97'));_0x3cc52a[_0xb8d9('0x7')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xb8d9('0x98'));}if(_0x360b05[_0xb8d9('0x99')]){_0x3cc52a[_0xb8d9('0x99')](_0x360b05['limit']);}if(_0x360b05[_0xb8d9('0x9a')]){_0x3cc52a['offset'](_0x360b05[_0xb8d9('0x9a')]);}return db[_0xb8d9('0x76')][_0xb8d9('0x77')](_0x3cc52a[_0xb8d9('0x78')](),_0x4379ae);})[_0xb8d9('0x60')](function(_0x2e8fc1){_0x2fb1a9=_0x2e8fc1;var _0x14b570=getUsersQuery(_0x24be60,_0x2fb1a9);return db[_0xb8d9('0x76')][_0xb8d9('0x77')](_0x14b570[_0xb8d9('0x78')](),_0x4379ae);})[_0xb8d9('0x60')](function(_0x410bf8){_0x55e2eb=_['groupBy'](_0x410bf8,_0x32e58f);if(_0x24be60==='mail'){return db[_0xb8d9('0x9b')]['findOne']({'attributes':[_0xb8d9('0x9c')],'raw':!![]});}})['then'](function(_0x1db29b){var _0x1a8d14=_0x1db29b?_0x1db29b[_0xb8d9('0x9c')]:undefined;var _0x3179af=_0x2fb1a9[_0xb8d9('0x4c')](function(_0x3190f0){return updateInteraction(_0x3190f0,_0x7a813f,_0x55e2eb,_0x1a8d14);});return Promise['all'](_0x3179af);});}function countFilteredInteractions(_0x29173c,_0x3c7b28){var _0x344f10=_0x29173c[_0xb8d9('0x9d')]();_0x344f10[_0xb8d9('0x7')]('COUNT(*)');_0x344f10[_0xb8d9('0x7')](_0xb8d9('0x7b'),_0xb8d9('0x44'));var _0x3356da=utils['getSelectedTags'](_0x3c7b28);if(!_[_0xb8d9('0x9e')](_0x3356da)){_0x344f10[_0xb8d9('0x16')](_0xb8d9('0x9f'),_0x3356da);}var _0x50cb30={'type':db['Sequelize'][_0xb8d9('0xa0')][_0xb8d9('0x75')],'raw':!![]};return db[_0xb8d9('0x76')]['query'](_0x344f10[_0xb8d9('0x78')](),_0x50cb30);}module['exports']={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index 2a11c0d..33586db 100644 --- a/server/components/interaction/update-interaction.js +++ b/server/components/interaction/update-interaction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf547=['trimStart','catch','Users','TagIds','Tags','lodash','fullname','split','forEach','waiting','talking','unmanaged','total','closed','disposition','abandoned','UserId','out','plainBody','-id','then','lastMsgText'];(function(_0x4368a1,_0x50704c){var _0x1cbf91=function(_0x2f466e){while(--_0x2f466e){_0x4368a1['push'](_0x4368a1['shift']());}};_0x1cbf91(++_0x50704c);}(_0xf547,0x9f));var _0x7f54=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xf547[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0x7f54('0x0'));var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x4d3b9b,_0x20d091){return new Promise(function(_0x3f48cd,_0xdd00ed){try{var _0x160fbf=[];if(_0x20d091[_0x4d3b9b]){_0x160fbf=_0x20d091[_0x4d3b9b]['map'](function(_0x2a52de){return{'id':_0x2a52de['id'],'fullname':_0x2a52de[_0x7f54('0x1')]};});}return _0x3f48cd(_0x160fbf);}catch(_0x3848bf){_0xdd00ed(_0x3848bf);}});}function getInteractionTags(_0x3d2a12,_0x50e99a){var _0x161da5=[];if(_0x3d2a12){_0x3d2a12[_0x7f54('0x2')](',')[_0x7f54('0x3')](function(_0xc0f633){_0x161da5['push'](_0x50e99a[_0xc0f633]);});}return _0x161da5;}function updateWaitingCounter(_0x354212){if(_0x354212[_0x7f54('0x4')]){_0x354212[_0x7f54('0x4')]-=0x1;}}function updateInteractionCounters(_0x346416){_0x346416['waiting']=0x0;_0x346416[_0x7f54('0x5')]=0x0;_0x346416['answered']=0x0;_0x346416[_0x7f54('0x6')]=0x0;_0x346416['abandoned']=0x0;_0x346416[_0x7f54('0x7')]=0x0;if(_0x346416[_0x7f54('0x8')]){if(_0x346416[_0x7f54('0x9')]===_0x7f54('0xa')){_0x346416[_0x7f54('0xa')]+=0x1;updateWaitingCounter(_0x346416);}if(_0x346416[_0x7f54('0xb')]){_0x346416['answered']+=0x1;if(_0x346416[_0x7f54('0x5')]){_0x346416[_0x7f54('0x5')]-=0x1;}}else{if(_0x346416[_0x7f54('0x9')]){_0x346416[_0x7f54('0x6')]+=0x1;updateWaitingCounter(_0x346416);}}}else{if(!_0x346416['UserId']){_0x346416[_0x7f54('0x4')]+=0x1;}if(_0x346416[_0x7f54('0xb')]){_0x346416[_0x7f54('0x5')]+=0x1;updateWaitingCounter(_0x346416);}}_0x346416[_0x7f54('0x7')]+=0x1;return _0x346416;}function getLastMessageText(_0x56d106){return db['MailMessage']['findOne']({'where':{'$and':[{'MailInteractionId':_0x56d106['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x7f54('0xc')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x7f54('0xd')],'order':_0x7f54('0xe'),'raw':!![]})[_0x7f54('0xf')](function(_0x4cf263){if(_0x4cf263&&_0x4cf263[_0x7f54('0xd')]){_0x56d106[_0x7f54('0x10')]=_[_0x7f54('0x11')](_0x4cf263[_0x7f54('0xd')]);}return _0x56d106;})[_0x7f54('0x12')](function(_0x1e273e){throw _0x1e273e;});}exports['updateInteraction']=function(_0x2be04d,_0x169ea8,_0x279460,_0x31ed55){return new Promise(function(_0x149d33,_0x1c8dc1){return getInteractionUsers(_0x2be04d['id'],_0x279460)[_0x7f54('0xf')](function(_0x3cca99){_0x2be04d[_0x7f54('0x13')]=_0x3cca99;return getInteractionTags(_0x2be04d[_0x7f54('0x14')],_0x169ea8);})[_0x7f54('0xf')](function(_0x10fdc0){_0x2be04d[_0x7f54('0x15')]=_0x10fdc0;delete _0x2be04d[_0x7f54('0x14')];return updateInteractionCounters(_0x2be04d);})[_0x7f54('0xf')](function(_0x5bca10){if(_0x31ed55){return getLastMessageText(_0x5bca10);}else{return _0x5bca10;}})[_0x7f54('0xf')](function(_0x62db5a){_0x149d33(_0x62db5a);})['catch'](function(_0x25af45){_0x1c8dc1(_0x25af45);});});}; \ No newline at end of file +var _0x7773=['lastMsgText','catch','updateInteraction','Users','Tags','lodash','../../mysqldb','map','fullname','split','forEach','push','waiting','talking','answered','abandoned','total','closed','UserId','disposition','unmanaged','out','plainBody','-id','then'];(function(_0x527361,_0x1d96b4){var _0x1fcb80=function(_0x4092fd){while(--_0x4092fd){_0x527361['push'](_0x527361['shift']());}};_0x1fcb80(++_0x1d96b4);}(_0x7773,0x131));var _0x3777=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x7773[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x3777('0x0'));var db=require(_0x3777('0x1'))['db'];function getInteractionUsers(_0x2328ab,_0x2da6d9){return new Promise(function(_0x157330,_0x527b72){try{var _0x29996a=[];if(_0x2da6d9[_0x2328ab]){_0x29996a=_0x2da6d9[_0x2328ab][_0x3777('0x2')](function(_0xa27cf3){return{'id':_0xa27cf3['id'],'fullname':_0xa27cf3[_0x3777('0x3')]};});}return _0x157330(_0x29996a);}catch(_0x2b2c3d){_0x527b72(_0x2b2c3d);}});}function getInteractionTags(_0x2b1139,_0x5791a7){var _0x35bf5c=[];if(_0x2b1139){_0x2b1139[_0x3777('0x4')](',')[_0x3777('0x5')](function(_0x17f799){_0x35bf5c[_0x3777('0x6')](_0x5791a7[_0x17f799]);});}return _0x35bf5c;}function updateWaitingCounter(_0x380e2b){if(_0x380e2b[_0x3777('0x7')]){_0x380e2b['waiting']-=0x1;}}function updateInteractionCounters(_0x428164){_0x428164[_0x3777('0x7')]=0x0;_0x428164[_0x3777('0x8')]=0x0;_0x428164[_0x3777('0x9')]=0x0;_0x428164['unmanaged']=0x0;_0x428164[_0x3777('0xa')]=0x0;_0x428164[_0x3777('0xb')]=0x0;if(_0x428164[_0x3777('0xc')]){if(_0x428164['disposition']===_0x3777('0xa')){_0x428164[_0x3777('0xa')]+=0x1;updateWaitingCounter(_0x428164);}if(_0x428164[_0x3777('0xd')]){_0x428164[_0x3777('0x9')]+=0x1;if(_0x428164[_0x3777('0x8')]){_0x428164[_0x3777('0x8')]-=0x1;}}else{if(_0x428164[_0x3777('0xe')]){_0x428164[_0x3777('0xf')]+=0x1;updateWaitingCounter(_0x428164);}}}else{if(!_0x428164[_0x3777('0xd')]){_0x428164['waiting']+=0x1;}if(_0x428164[_0x3777('0xd')]){_0x428164[_0x3777('0x8')]+=0x1;updateWaitingCounter(_0x428164);}}_0x428164[_0x3777('0xb')]+=0x1;return _0x428164;}function getLastMessageText(_0x260eef){return db['MailMessage']['findOne']({'where':{'$and':[{'MailInteractionId':_0x260eef['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x3777('0x10')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x3777('0x11')],'order':_0x3777('0x12'),'raw':!![]})[_0x3777('0x13')](function(_0x36a7aa){if(_0x36a7aa&&_0x36a7aa[_0x3777('0x11')]){_0x260eef[_0x3777('0x14')]=_['trimStart'](_0x36a7aa[_0x3777('0x11')]);}return _0x260eef;})[_0x3777('0x15')](function(_0x49f80a){throw _0x49f80a;});}exports[_0x3777('0x16')]=function(_0x23c514,_0x260d4d,_0x3f2eaf,_0x53df5b){return new Promise(function(_0x53e2d4,_0x58a8ed){return getInteractionUsers(_0x23c514['id'],_0x3f2eaf)[_0x3777('0x13')](function(_0x361bac){_0x23c514[_0x3777('0x17')]=_0x361bac;return getInteractionTags(_0x23c514['TagIds'],_0x260d4d);})[_0x3777('0x13')](function(_0x577f0e){_0x23c514[_0x3777('0x18')]=_0x577f0e;delete _0x23c514['TagIds'];return updateInteractionCounters(_0x23c514);})[_0x3777('0x13')](function(_0x44c1b2){if(_0x53df5b){return getLastMessageText(_0x44c1b2);}else{return _0x44c1b2;}})['then'](function(_0x266d55){_0x53e2d4(_0x266d55);})[_0x3777('0x15')](function(_0x56a699){_0x58a8ed(_0x56a699);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 62543a0..e8a91d4 100644 --- a/server/components/interaction/utils.js +++ b/server/components/interaction/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8298=['catch','error','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','chat-interactions','capitalize','Website','upperFirst','InteractionId','chat','accounts','_interactions','_interaction_has_tags','_messages','isArray','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','Interaction','then','update','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8298,0xb1));var _0x8829=function(_0x374a7b,_0x1a3dc8){_0x374a7b=_0x374a7b-0x0;var _0x549c97=_0x8298[_0x374a7b];return _0x549c97;};'use strict';var _=require(_0x8829('0x0'));var db=require(_0x8829('0x1'))['db'];var loggers={'openchannel':require(_0x8829('0x2'))(_0x8829('0x3')),'mail':require('../../config/logger')(_0x8829('0x4')),'fax':require(_0x8829('0x2'))('fax-interactions'),'sms':require('../../config/logger')(_0x8829('0x5')),'chat':require(_0x8829('0x2'))(_0x8829('0x6')),'whatsapp':require(_0x8829('0x2'))('whatsapp-interactions')};function getAccountFK(_0x47ae21){return _[_0x8829('0x7')](_0x47ae21)+(_0x47ae21==='chat'?_0x8829('0x8'):'Account')+'Id';}function getInteractionFK(_0x8b416){return _[_0x8829('0x7')](_0x8b416)+'InteractionId';}function getInteractionId(_0x30a2b8,_0xf7f17b,_0x42a8a6){if(_0x30a2b8&&_0x30a2b8[_[_0x8829('0x9')](_0x42a8a6)+_0x8829('0xa')]){return _0x30a2b8[_[_0x8829('0x9')](_0x42a8a6)+_0x8829('0xa')];}else if(_0x30a2b8&&_0x30a2b8['id']){return _0x30a2b8['id'];}else if(_0xf7f17b&&_0xf7f17b['id']){return _0xf7f17b['id'];}else{return'unknown';}}function getInteractionsTables(_0x1ed875){return{'accounts':_0x1ed875+'_'+(_0x1ed875===_0x8829('0xb')?'websites':_0x8829('0xc')),'interactions':_0x1ed875+_0x8829('0xd'),'interactionsTags':_0x1ed875+_0x8829('0xe'),'messages':_0x1ed875+_0x8829('0xf'),'userInteractions':'user_has_'+_0x1ed875+_0x8829('0xd')};}function getSelectedTags(_0x3ed8aa){var _0xabee11=[];if(_0x3ed8aa){_0xabee11=Array[_0x8829('0x10')](_0x3ed8aa)?_0x3ed8aa:[_0x3ed8aa];}return _0xabee11;}function log(_0x443a2d,_0x19cb30,_0x390461,_0x3ab859,_0x49dc9e,_0x364f74){loggers[_0x49dc9e['toLowerCase']()][_0x443a2d](_0x8829('0x11'),_0x364f74['toUpperCase'](),_0x19cb30?_0x19cb30['id']:null,_0x19cb30?_0x19cb30[_0x8829('0x12')]:null,_0x19cb30?_0x19cb30[_0x8829('0x13')]:null,getInteractionId(_0x390461,_0x3ab859,_0x49dc9e),_0x390461?JSON[_0x8829('0x14')](_0x390461):_0x8829('0x15'));}function updateUser(_0x5a2d79,_0x52c125,_0x345bdd,_0x2f6899,_0x3a6757){db[_['upperFirst'](_0x2f6899)+_0x8829('0x16')]['findOne']({'where':{'id':getInteractionId(_0x52c125,_0x345bdd,_0x2f6899)}})[_0x8829('0x17')](function(_0x4d3ac3){if(_0x4d3ac3){return _0x4d3ac3[_0x8829('0x18')]({'UserId':_0x5a2d79?_0x5a2d79['id']:null});}})[_0x8829('0x17')](function(_0x1ec108){if(_0x1ec108){log(_0x8829('0x19'),_0x5a2d79,_0x52c125,_0x345bdd,_0x2f6899,_0x3a6757);}})[_0x8829('0x1a')](function(){log(_0x8829('0x1b'),_0x5a2d79,_0x52c125,_0x345bdd,_0x2f6899,_0x3a6757);});}module[_0x8829('0x1c')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x501a=['capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','accounts','_interactions','_interaction_has_tags','user_has_','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne','then','update','catch','exports','lodash','../../mysqldb','openchannel-interactions','../../config/logger','sms-interactions'];(function(_0x53c5cf,_0x3ef208){var _0x3261aa=function(_0x69b1d){while(--_0x69b1d){_0x53c5cf['push'](_0x53c5cf['shift']());}};_0x3261aa(++_0x3ef208);}(_0x501a,0x183));var _0xa501=function(_0x1d006a,_0x2812b5){_0x1d006a=_0x1d006a-0x0;var _0x20a76b=_0x501a[_0x1d006a];return _0x20a76b;};'use strict';var _=require(_0xa501('0x0'));var db=require(_0xa501('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0xa501('0x2')),'mail':require('../../config/logger')('mail-interactions'),'fax':require('../../config/logger')('fax-interactions'),'sms':require(_0xa501('0x3'))(_0xa501('0x4')),'chat':require('../../config/logger')('chat-interactions'),'whatsapp':require(_0xa501('0x3'))('whatsapp-interactions')};function getAccountFK(_0x28e2ad){return _[_0xa501('0x5')](_0x28e2ad)+(_0x28e2ad===_0xa501('0x6')?_0xa501('0x7'):_0xa501('0x8'))+'Id';}function getInteractionFK(_0x3b6da5){return _[_0xa501('0x5')](_0x3b6da5)+_0xa501('0x9');}function getInteractionId(_0x3da777,_0x361fa9,_0xa45adb){if(_0x3da777&&_0x3da777[_[_0xa501('0xa')](_0xa45adb)+_0xa501('0x9')]){return _0x3da777[_[_0xa501('0xa')](_0xa45adb)+'InteractionId'];}else if(_0x3da777&&_0x3da777['id']){return _0x3da777['id'];}else if(_0x361fa9&&_0x361fa9['id']){return _0x361fa9['id'];}else{return _0xa501('0xb');}}function getInteractionsTables(_0xb2ec40){return{'accounts':_0xb2ec40+'_'+(_0xb2ec40===_0xa501('0x6')?'websites':_0xa501('0xc')),'interactions':_0xb2ec40+_0xa501('0xd'),'interactionsTags':_0xb2ec40+_0xa501('0xe'),'messages':_0xb2ec40+'_messages','userInteractions':_0xa501('0xf')+_0xb2ec40+_0xa501('0xd')};}function getSelectedTags(_0x3a6ed1){var _0xcac9c9=[];if(_0x3a6ed1){_0xcac9c9=Array['isArray'](_0x3a6ed1)?_0x3a6ed1:[_0x3a6ed1];}return _0xcac9c9;}function log(_0x2f8089,_0x271f8b,_0x88d08a,_0x301f64,_0x1a4501,_0x19aaee){loggers[_0x1a4501['toLowerCase']()][_0x2f8089](_0xa501('0x10'),_0x19aaee[_0xa501('0x11')](),_0x271f8b?_0x271f8b['id']:null,_0x271f8b?_0x271f8b[_0xa501('0x12')]:null,_0x271f8b?_0x271f8b[_0xa501('0x13')]:null,getInteractionId(_0x88d08a,_0x301f64,_0x1a4501),_0x88d08a?JSON[_0xa501('0x14')](_0x88d08a):_0xa501('0x15'));}function updateUser(_0x412f3b,_0x14e90f,_0x483284,_0x2d14af,_0x1d7f0e){db[_[_0xa501('0xa')](_0x2d14af)+_0xa501('0x16')][_0xa501('0x17')]({'where':{'id':getInteractionId(_0x14e90f,_0x483284,_0x2d14af)}})[_0xa501('0x18')](function(_0xba5c49){if(_0xba5c49){return _0xba5c49[_0xa501('0x19')]({'UserId':_0x412f3b?_0x412f3b['id']:null});}})[_0xa501('0x18')](function(_0x5e45bd){if(_0x5e45bd){log('info',_0x412f3b,_0x14e90f,_0x483284,_0x2d14af,_0x1d7f0e);}})[_0xa501('0x1a')](function(){log('error',_0x412f3b,_0x14e90f,_0x483284,_0x2d14af,_0x1d7f0e);});}module[_0xa501('0x1b')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index b47e222..02569c9 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 _0x3325=['license','split','createDecipher','format','%s:%s:%s','base64','utf8','final','hasOwnProperty','use','License','findOne','then','count','status','json','catch','admin','user','composable-middleware','../../mysqldb','../../config/environment','data1'];(function(_0x2962d5,_0x38deda){var _0x273406=function(_0x3e0775){while(--_0x3e0775){_0x2962d5['push'](_0x2962d5['shift']());}};_0x273406(++_0x38deda);}(_0x3325,0x155));var _0x5332=function(_0x2d9f8b,_0x1eca48){_0x2d9f8b=_0x2d9f8b-0x0;var _0x251209=_0x3325[_0x2d9f8b];return _0x251209;};'use strict';var crypto=require('crypto');var util=require('util');var compose=require(_0x5332('0x0'));var db=require(_0x5332('0x1'))['db'];var config=require(_0x5332('0x2'));function getValueFromLicense(_0x3e74ce,_0x3d48ec){if(_0x3e74ce&&_0x3d48ec){if(_0x3d48ec['data1']&&_0x3d48ec['license']){var _0x4ba8b2=_0x3d48ec[_0x5332('0x3')];var _0x1a6270=_0x3d48ec[_0x5332('0x4')];var _0xbc9d6b=_0x4ba8b2['split']('-')[0x4];var _0x2e23a3=_0x4ba8b2[_0x5332('0x5')]('-')[0x0];var _0x5af616=crypto[_0x5332('0x6')]('aes-256-ctr',util[_0x5332('0x7')](_0x5332('0x8'),_0xbc9d6b,_0x4ba8b2,_0x2e23a3));var _0x61a7c8=_0x5af616['update'](_0x1a6270,_0x5332('0x9'),_0x5332('0xa'));_0x61a7c8+=_0x5af616[_0x5332('0xb')]('utf8');var _0x1a6f0c=JSON['parse'](_0x61a7c8);return _0x1a6f0c[_0x5332('0xc')](_0x3e74ce)?_0x1a6f0c[_0x3e74ce]:null;}}return null;}function isLimit(_0x2b1442,_0x3ac0e5,_0x596b23,_0x37a8f0){var _0xba181f=_0x3ac0e5;return compose()[_0x5332('0xd')](function(_0x276a5b,_0x1a5e7d,_0x4802ae){return db[_0x5332('0xe')][_0x5332('0xf')]({'where':{'id':0x1},'raw':!![]})[_0x5332('0x10')](function(_0x4d9faf){var _0x49107b=getValueFromLicense(_0x2b1442,_0x4d9faf);return _0x49107b?_0x49107b:_0xba181f;})[_0x5332('0x10')](function(_0x42ccf2){_0xba181f=_0x42ccf2;return _0x596b23[_0x5332('0x11')](_0x37a8f0);})[_0x5332('0x10')](function(_0x4581bb){if(_0x4581bb>=_0xba181f){return _0x1a5e7d[_0x5332('0x12')](0x193)[_0x5332('0x13')]({'message':util['format']('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x2b1442)});}_0x4802ae();})[_0x5332('0x14')](function(_0x56e2bb){_0x4802ae(_0x56e2bb);});});}function isUserLimit(){return isLimit('users',0x1,db['User'],{'where':{'$or':[{'role':_0x5332('0x15')},{'role':_0x5332('0x16')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x058b=['aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','findOne','count','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','isUserLimit','crypto','util','composable-middleware','../../mysqldb','license','data1','split','createDecipher'];(function(_0x39e29f,_0x47fd48){var _0x2d4c70=function(_0x37a7f5){while(--_0x37a7f5){_0x39e29f['push'](_0x39e29f['shift']());}};_0x2d4c70(++_0x47fd48);}(_0x058b,0x148));var _0xb058=function(_0x420b24,_0x382adc){_0x420b24=_0x420b24-0x0;var _0x4da552=_0x058b[_0x420b24];return _0x4da552;};'use strict';var crypto=require(_0xb058('0x0'));var util=require(_0xb058('0x1'));var compose=require(_0xb058('0x2'));var db=require(_0xb058('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x568ec0,_0x3d1329){if(_0x568ec0&&_0x3d1329){if(_0x3d1329['data1']&&_0x3d1329[_0xb058('0x4')]){var _0x54c423=_0x3d1329[_0xb058('0x5')];var _0x48fac8=_0x3d1329['license'];var _0x551724=_0x54c423['split']('-')[0x4];var _0x4dd6a3=_0x54c423[_0xb058('0x6')]('-')[0x0];var _0x34acd8=crypto[_0xb058('0x7')](_0xb058('0x8'),util[_0xb058('0x9')](_0xb058('0xa'),_0x551724,_0x54c423,_0x4dd6a3));var _0x4384ee=_0x34acd8[_0xb058('0xb')](_0x48fac8,_0xb058('0xc'),_0xb058('0xd'));_0x4384ee+=_0x34acd8[_0xb058('0xe')](_0xb058('0xd'));var _0x1205d2=JSON[_0xb058('0xf')](_0x4384ee);return _0x1205d2[_0xb058('0x10')](_0x568ec0)?_0x1205d2[_0x568ec0]:null;}}return null;}function isLimit(_0xbbeab3,_0x14fd32,_0x4a8512,_0x6167d){var _0x378c1c=_0x14fd32;return compose()['use'](function(_0x43884d,_0x490430,_0x1d3971){return db['License'][_0xb058('0x11')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x1bfd09){var _0x3b4aad=getValueFromLicense(_0xbbeab3,_0x1bfd09);return _0x3b4aad?_0x3b4aad:_0x378c1c;})['then'](function(_0x41b906){_0x378c1c=_0x41b906;return _0x4a8512[_0xb058('0x12')](_0x6167d);})[_0xb058('0x13')](function(_0x56c92b){if(_0x56c92b>=_0x378c1c){return _0x490430[_0xb058('0x14')](0x193)[_0xb058('0x15')]({'message':util[_0xb058('0x9')](_0xb058('0x16'),_0xbbeab3)});}_0x1d3971();})[_0xb058('0x17')](function(_0x58d61e){_0x1d3971(_0x58d61e);});});}function isUserLimit(){return isLimit(_0xb058('0x18'),0x1,db[_0xb058('0x19')],{'where':{'$or':[{'role':_0xb058('0x1a')},{'role':'user'}]}});}exports[_0xb058('0x1b')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 6f3c3ec..3520609 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 _0xce50=['sqlOperator','startsWith','[$or]','and','replace','split','length','slice','forEach','match','filter','indexOf','map','conditions','push','buildExpression','DATE','operator','$eq','$between','value','includes','$gt','days','format','YYYY-MM-DD','castTo','text','CAST(','field','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','$substring','$startsWith','LIKE\x20?','>\x20?','$lte','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$endsWith','shift','pop','utcOffset','add','hours','minutes','lodash','moment','parseSearch'];(function(_0x390c42,_0x10e1ae){var _0x43894c=function(_0x510bd0){while(--_0x510bd0){_0x390c42['push'](_0x390c42['shift']());}};_0x43894c(++_0x10e1ae);}(_0xce50,0xe5));var _0x0ce5=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xce50[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x0ce5('0x0'));var moment=require(_0x0ce5('0x1'));exports[_0x0ce5('0x2')]=function(_0x1cfede){var _0x15994c={'conditions':[]};_0x15994c[_0x0ce5('0x3')]=_[_0x0ce5('0x4')](_0x1cfede,_0x0ce5('0x5'))?'or':_0x0ce5('0x6');var _0x3a99e6=_0x1cfede[_0x0ce5('0x7')]('[$and]','')['replace'](_0x0ce5('0x5'),'')[_0x0ce5('0x8')]('||');for(var _0x4ad742=0x0;_0x4ad742<_0x3a99e6[_0x0ce5('0x9')];_0x4ad742++){var _0x54df29=_0x3a99e6[_0x4ad742]['split'](':=');var _0x5d4e37=_0x54df29[0x0];var _0x39c519=_0x54df29[_0x0ce5('0xa')](0x1);_0x39c519[_0x0ce5('0xb')](function(_0x1c8d1b){var _0x58de15=_0x1c8d1b[_0x0ce5('0x8')]('[')['shift']();var _0x3bc47e=_0x1c8d1b[_0x0ce5('0xc')](/\[(.*?)\]/g);_0x3bc47e['forEach'](function(_0x31748c){var _0x42d89e=_0x31748c['split']('[')[_0x0ce5('0xd')](function(_0x33d2db){return _0x33d2db[_0x0ce5('0xe')](']')>-0x1;})[_0x0ce5('0xf')](function(_0x41c599){return _0x41c599[_0x0ce5('0x8')](']')[0x0];})[0x0];_0x15994c[_0x0ce5('0x10')][_0x0ce5('0x11')]({'field':_0x5d4e37,'operator':_0x58de15,'value':_0x42d89e});});});}return _0x15994c;};exports[_0x0ce5('0x12')]=function(_0x36703d,_0x153b57,_0x3fab82){var _0x520bc5={};if(_0x153b57===_0x0ce5('0x13')){if(_0x3fab82[_0x0ce5('0x14')]===_0x0ce5('0x15')){_0x3fab82[_0x0ce5('0x14')]=_0x0ce5('0x16');_0x3fab82[_0x0ce5('0x17')]+=','+_0x3fab82[_0x0ce5('0x17')];}else if(_[_0x0ce5('0x18')]([_0x0ce5('0x19'),'$lte'],_0x3fab82['operator'])){_0x3fab82[_0x0ce5('0x17')]=moment(_0x3fab82[_0x0ce5('0x17')])['add'](0x1,_0x0ce5('0x1a'))[_0x0ce5('0x1b')](_0x0ce5('0x1c'));}}if(_0x3fab82[_0x0ce5('0x1d')]){_0x153b57=_0x3fab82[_0x0ce5('0x1d')];_0x520bc5[_0x0ce5('0x1e')]=_0x0ce5('0x1f')+_0x36703d+'.'+_0x3fab82[_0x0ce5('0x20')]+'\x20AS\x20'+_0x3fab82[_0x0ce5('0x1d')]+')\x20'+parseOperator(_0x3fab82[_0x0ce5('0x14')]);}else{_0x520bc5['text']=_0x36703d+'.'+_0x3fab82[_0x0ce5('0x20')]+'\x20'+parseOperator(_0x3fab82[_0x0ce5('0x14')]);}if(_[_0x0ce5('0x18')]([_0x0ce5('0x21'),_0x0ce5('0x22')],_0x3fab82[_0x0ce5('0x14')]))_0x520bc5['text']='('+_0x520bc5[_0x0ce5('0x1e')]+_0x0ce5('0x23')+_0x36703d+'.'+_0x3fab82[_0x0ce5('0x20')]+_0x0ce5('0x24');_0x520bc5['value']=parseValue(_0x153b57,_0x3fab82['operator'],_0x3fab82[_0x0ce5('0x17')]);return _0x520bc5;};function parseOperator(_0x23e43b){var _0x48540d;switch(_0x23e43b){case _0x0ce5('0x25'):_0x48540d=_0x0ce5('0x26');break;case _0x0ce5('0x22'):_0x48540d=_0x0ce5('0x27');break;case _0x0ce5('0x15'):_0x48540d=_0x0ce5('0x28');break;case'$ne':_0x48540d='<>\x20?';break;case _0x0ce5('0x29'):case _0x0ce5('0x2a'):case'$endsWith':_0x48540d=_0x0ce5('0x2b');break;case'$lt':_0x48540d='<\x20?';break;case _0x0ce5('0x19'):_0x48540d=_0x0ce5('0x2c');break;case _0x0ce5('0x2d'):_0x48540d=_0x0ce5('0x2e');break;case _0x0ce5('0x2f'):_0x48540d=_0x0ce5('0x30');break;case _0x0ce5('0x16'):_0x48540d=_0x0ce5('0x31');break;}return _0x48540d;}function parseValue(_0x44b379,_0x12a7d8,_0x15b6a5){var _0x742454={'start':undefined,'end':undefined};switch(_0x12a7d8){case'$in':case _0x0ce5('0x22'):_0x742454['start']=_0x15b6a5[_0x0ce5('0x8')](',');break;case'$substring':_0x742454[_0x0ce5('0x32')]='%'+_0x15b6a5+'%';break;case'$startsWith':_0x742454[_0x0ce5('0x32')]=_0x15b6a5+'%';break;case _0x0ce5('0x33'):_0x742454[_0x0ce5('0x32')]='%'+_0x15b6a5;break;case _0x0ce5('0x16'):var _0x310922=_0x15b6a5[_0x0ce5('0x8')](',');var _0x15b6a5=_0x310922[_0x0ce5('0x34')]();var _0x205751=_0x310922[_0x0ce5('0x35')]();if(_0x44b379===_0x0ce5('0x13')){_0x15b6a5=moment(_0x15b6a5)[_0x0ce5('0x36')](0x0,!![])['format']();_0x205751=moment(_0x205751)[_0x0ce5('0x36')](0x0,!![])[_0x0ce5('0x37')](0x17,_0x0ce5('0x38'))[_0x0ce5('0x37')](0x3b,_0x0ce5('0x39'))[_0x0ce5('0x37')](0x3b,'seconds')['format']();}_0x742454={'start':_0x15b6a5,'end':_0x205751};break;default:_0x742454[_0x0ce5('0x32')]=_0x15b6a5;break;}return _0x742454;} \ No newline at end of file +var _0x08dc=['$notIn','\x20OR\x20','\x20IS\x20NULL)','IN\x20?','NOT\x20IN\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','$gte','BETWEEN\x20?\x20AND\x20?','$in','start','pop','utcOffset','hours','seconds','lodash','moment','parseSearch','sqlOperator','[$or]','and','replace','split','length','forEach','shift','filter','indexOf','map','conditions','push','buildExpression','DATE','operator','$eq','value','$lte','add','days','format','castTo','text','CAST(','field','includes','$ne'];(function(_0x2fb50c,_0x3852fd){var _0xb6b08d=function(_0x470b1f){while(--_0x470b1f){_0x2fb50c['push'](_0x2fb50c['shift']());}};_0xb6b08d(++_0x3852fd);}(_0x08dc,0x1ac));var _0xc08d=function(_0x162a3c,_0x54f601){_0x162a3c=_0x162a3c-0x0;var _0x57703d=_0x08dc[_0x162a3c];return _0x57703d;};'use strict';var _=require(_0xc08d('0x0'));var moment=require(_0xc08d('0x1'));exports[_0xc08d('0x2')]=function(_0xda69a1){var _0x2cc46d={'conditions':[]};_0x2cc46d[_0xc08d('0x3')]=_['startsWith'](_0xda69a1,_0xc08d('0x4'))?'or':_0xc08d('0x5');var _0x23b506=_0xda69a1[_0xc08d('0x6')]('[$and]','')[_0xc08d('0x6')](_0xc08d('0x4'),'')[_0xc08d('0x7')]('||');for(var _0x5f546a=0x0;_0x5f546a<_0x23b506[_0xc08d('0x8')];_0x5f546a++){var _0x12f7e3=_0x23b506[_0x5f546a][_0xc08d('0x7')](':=');var _0x4d34b0=_0x12f7e3[0x0];var _0x1c1211=_0x12f7e3['slice'](0x1);_0x1c1211[_0xc08d('0x9')](function(_0x3213c9){var _0x4dd53f=_0x3213c9[_0xc08d('0x7')]('[')[_0xc08d('0xa')]();var _0x4f8ae4=_0x3213c9['match'](/\[(.*?)\]/g);_0x4f8ae4[_0xc08d('0x9')](function(_0x529912){var _0xb87369=_0x529912[_0xc08d('0x7')]('[')[_0xc08d('0xb')](function(_0x317267){return _0x317267[_0xc08d('0xc')](']')>-0x1;})[_0xc08d('0xd')](function(_0x181248){return _0x181248[_0xc08d('0x7')](']')[0x0];})[0x0];_0x2cc46d[_0xc08d('0xe')][_0xc08d('0xf')]({'field':_0x4d34b0,'operator':_0x4dd53f,'value':_0xb87369});});});}return _0x2cc46d;};exports[_0xc08d('0x10')]=function(_0x2bdb8d,_0x53bebc,_0xc5ef56){var _0x4ee9ee={};if(_0x53bebc===_0xc08d('0x11')){if(_0xc5ef56[_0xc08d('0x12')]===_0xc08d('0x13')){_0xc5ef56[_0xc08d('0x12')]='$between';_0xc5ef56[_0xc08d('0x14')]+=','+_0xc5ef56['value'];}else if(_['includes'](['$gt',_0xc08d('0x15')],_0xc5ef56[_0xc08d('0x12')])){_0xc5ef56[_0xc08d('0x14')]=moment(_0xc5ef56[_0xc08d('0x14')])[_0xc08d('0x16')](0x1,_0xc08d('0x17'))[_0xc08d('0x18')]('YYYY-MM-DD');}}if(_0xc5ef56[_0xc08d('0x19')]){_0x53bebc=_0xc5ef56[_0xc08d('0x19')];_0x4ee9ee[_0xc08d('0x1a')]=_0xc08d('0x1b')+_0x2bdb8d+'.'+_0xc5ef56['field']+'\x20AS\x20'+_0xc5ef56[_0xc08d('0x19')]+')\x20'+parseOperator(_0xc5ef56[_0xc08d('0x12')]);}else{_0x4ee9ee[_0xc08d('0x1a')]=_0x2bdb8d+'.'+_0xc5ef56[_0xc08d('0x1c')]+'\x20'+parseOperator(_0xc5ef56[_0xc08d('0x12')]);}if(_[_0xc08d('0x1d')]([_0xc08d('0x1e'),_0xc08d('0x1f')],_0xc5ef56[_0xc08d('0x12')]))_0x4ee9ee[_0xc08d('0x1a')]='('+_0x4ee9ee[_0xc08d('0x1a')]+_0xc08d('0x20')+_0x2bdb8d+'.'+_0xc5ef56['field']+_0xc08d('0x21');_0x4ee9ee[_0xc08d('0x14')]=parseValue(_0x53bebc,_0xc5ef56[_0xc08d('0x12')],_0xc5ef56[_0xc08d('0x14')]);return _0x4ee9ee;};function parseOperator(_0xaa4166){var _0x76e773;switch(_0xaa4166){case'$in':_0x76e773=_0xc08d('0x22');break;case _0xc08d('0x1f'):_0x76e773=_0xc08d('0x23');break;case _0xc08d('0x13'):_0x76e773='=\x20?';break;case'$ne':_0x76e773=_0xc08d('0x24');break;case _0xc08d('0x25'):case _0xc08d('0x26'):case _0xc08d('0x27'):_0x76e773=_0xc08d('0x28');break;case _0xc08d('0x29'):_0x76e773=_0xc08d('0x2a');break;case'$gt':_0x76e773='>\x20?';break;case'$lte':_0x76e773='<=\x20?';break;case _0xc08d('0x2b'):_0x76e773='>=\x20?';break;case'$between':_0x76e773=_0xc08d('0x2c');break;}return _0x76e773;}function parseValue(_0x203ed7,_0x4b2050,_0x19d7ed){var _0x441dcb={'start':undefined,'end':undefined};switch(_0x4b2050){case _0xc08d('0x2d'):case _0xc08d('0x1f'):_0x441dcb[_0xc08d('0x2e')]=_0x19d7ed[_0xc08d('0x7')](',');break;case'$substring':_0x441dcb['start']='%'+_0x19d7ed+'%';break;case _0xc08d('0x26'):_0x441dcb['start']=_0x19d7ed+'%';break;case'$endsWith':_0x441dcb[_0xc08d('0x2e')]='%'+_0x19d7ed;break;case'$between':var _0x5d1e02=_0x19d7ed['split'](',');var _0x19d7ed=_0x5d1e02[_0xc08d('0xa')]();var _0x5bced1=_0x5d1e02[_0xc08d('0x2f')]();if(_0x203ed7==='DATE'){_0x19d7ed=moment(_0x19d7ed)[_0xc08d('0x30')](0x0,!![])['format']();_0x5bced1=moment(_0x5bced1)[_0xc08d('0x30')](0x0,!![])[_0xc08d('0x16')](0x17,_0xc08d('0x31'))[_0xc08d('0x16')](0x3b,'minutes')[_0xc08d('0x16')](0x3b,_0xc08d('0x32'))[_0xc08d('0x18')]();}_0x441dcb={'start':_0x19d7ed,'end':_0x5bced1};break;default:_0x441dcb[_0xc08d('0x2e')]=_0x19d7ed;break;}return _0x441dcb;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 1257eec..3cc51be 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 _0xb458=['query','$id','model','intersection','attributes','nolimit','order','where','pick','filter','includes','value','merge','lower','options','lodash','sequelize','moment','parse','keys','fields','split','filters','isEmpty','forOwn','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','subtract','name','uniqueid','isArray','limit','offset','sort','map','indexOf','priority','cast','unsigned','DESC','col','ASC','length','omit','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','forEach','replace','join','getOptions'];(function(_0x35a245,_0x31a4ed){var _0x54043d=function(_0x3fb139){while(--_0x3fb139){_0x35a245['push'](_0x35a245['shift']());}};_0x54043d(++_0x31a4ed);}(_0xb458,0x103));var _0x8b45=function(_0x1a983d,_0xa72c7b){_0x1a983d=_0x1a983d-0x0;var _0x58e9a3=_0xb458[_0x1a983d];return _0x58e9a3;};'use strict';var _=require(_0x8b45('0x0'));var sequelize=require(_0x8b45('0x1'));var moment=require(_0x8b45('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x494751){var _0x58a508=['ne'];try{var _0xdf89d4=JSON[_0x8b45('0x3')](_0x494751);var _0x141a44=Object[_0x8b45('0x4')](_0xdf89d4)[0x0];return _0x58a508['includes'](_0x141a44);}catch(_0x333bc7){return![];}}function getOperatorValue(_0x59cce3){var _0x5cc2d5=JSON[_0x8b45('0x3')](_0x59cce3);var _0x12bd05=Object[_0x8b45('0x4')](_0x5cc2d5)[0x0];var _0x3a8ccb=_0x5cc2d5[_0x12bd05];return{['$'+_0x12bd05]:_0x3a8ccb};}exports[_0x8b45('0x5')]=function(_0x4d1718){var _0xa54725=null;if(_0x4d1718){_0xa54725=_0x4d1718[_0x8b45('0x6')](',');}return _0xa54725;};exports[_0x8b45('0x7')]=function(_0x2bc809,_0x2f7117){var _0x499899={};if(!_[_0x8b45('0x8')](_0x2bc809)){_[_0x8b45('0x9')](_0x2bc809,function(_0x57faf9,_0x5316af){try{if(_0x2f7117){var _0x5bb708=_['find'](_0x2f7117,{'name':_0x5316af})||{};if(hasSequelizeOperator(_0x57faf9)){_0x499899[_0x5316af]=getOperatorValue(_0x57faf9);}else if(_0x5bb708[_0x8b45('0xa')]===_0x8b45('0xb')&&_[_0x8b45('0xc')](_0x57faf9)){var _0x52c4db=JSON[_0x8b45('0x3')](_0x57faf9);var _0x455ecf={'$gte':moment(moment(_0x52c4db[_0x8b45('0xd')])[_0x8b45('0xe')](_0x8b45('0xf')))[_0x8b45('0x10')]()['format'](),'$lte':moment(moment(_0x52c4db['$lte'])[_0x8b45('0xe')](_0x8b45('0xf')))[_0x8b45('0x10')]()[_0x8b45('0x11')](0x1,'s')[_0x8b45('0xe')]()};_0x499899[_0x5316af]=_0x455ecf;}else if(_0x5bb708[_0x8b45('0x12')]===_0x8b45('0x13')){_0x499899[_0x5316af]=_0x57faf9;}else{_0x499899[_0x5316af]=_[_0x8b45('0x14')](_0x57faf9)?_0x57faf9:JSON[_0x8b45('0x3')](_0x57faf9);}}else{_0x499899[_0x5316af]=_[_0x8b45('0x14')](_0x57faf9)?_0x57faf9:JSON[_0x8b45('0x3')](_0x57faf9);}}catch(_0x21d5b2){_0x499899[_0x5316af]=_0x57faf9[_0x8b45('0x6')](',');}});}return _0x499899;};exports[_0x8b45('0x15')]=function(_0x1623d8){_0x1623d8=parseInt(_0x1623d8,0xa);if(!_0x1623d8||_0x1623d8<0x0){_0x1623d8=LIMIT_VALUE;}return _0x1623d8;};exports[_0x8b45('0x16')]=function(_0x23c520){_0x23c520=parseInt(_0x23c520,0xa);if(!_0x23c520||_0x23c520<0x0){_0x23c520=0x0;}return _0x23c520;};exports[_0x8b45('0x17')]=function(_0x51f39a){var _0x25e8a1,_0x2db2d1=null;if(_0x51f39a){_0x25e8a1=_0x51f39a[_0x8b45('0x6')](',');_0x2db2d1=_[_0x8b45('0x18')](_0x25e8a1,function(_0x3e1438){if(_0x3e1438[_0x8b45('0x19')]('-')===0x0){return[_0x3e1438===_0x8b45('0x1a')?sequelize[_0x8b45('0x1b')](sequelize['col']('priority'),_0x8b45('0x1c')):_0x3e1438['substr'](0x1),_0x8b45('0x1d')];}else{return[_0x3e1438===_0x8b45('0x1a')?sequelize[_0x8b45('0x1b')](sequelize[_0x8b45('0x1e')](_0x8b45('0x1a')),_0x8b45('0x1c')):_0x3e1438,_0x8b45('0x1f')];}});}return _0x2db2d1;};exports['omit']=function(_0x59d36b,_0x11ffcc){if(_[_0x8b45('0x8')](_0x59d36b)){return _0x59d36b;}if(_['isArray'](_0x59d36b)){for(var _0x5723a2=0x0;_0x5723a2<_0x59d36b[_0x8b45('0x20')];_0x5723a2+=0x1){_0x59d36b[_0x5723a2]=this[_0x8b45('0x21')](_0x59d36b[_0x5723a2],_0x11ffcc);}return _0x59d36b;}if(!_[_0x8b45('0x22')](_0x59d36b)){return _0x59d36b;}if(_[_0x8b45('0x23')](_0x11ffcc)){_0x11ffcc=[_0x11ffcc];}if(!_['isArray'](_0x11ffcc)){return _0x59d36b;}for(var _0x3df287=0x0;_0x3df287<_0x11ffcc[_0x8b45('0x20')];_0x3df287+=0x1){_[_0x8b45('0x24')](_0x59d36b,_0x11ffcc[_0x3df287]);}for(var _0x9de2ad in _0x59d36b){if(_0x59d36b[_0x8b45('0x25')](_0x9de2ad)){_0x59d36b[_0x9de2ad]=this[_0x8b45('0x21')](_0x59d36b[_0x9de2ad],_0x11ffcc);}}return _0x59d36b;};exports[_0x8b45('0x26')]=function(_0x234f62){return _0x234f62[_0x8b45('0x27')](RegExp(_0x8b45('0x28')))?!![]:![];};exports[_0x8b45('0x29')]=function(_0x1ba2d4){return _0x1ba2d4[_0x8b45('0x27')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x1d98c3){var _0x36db96=[];_0x1d98c3[_0x8b45('0x6')](/[ ,]+/)[_0x8b45('0x2a')](function(_0x2eb4c2){_0x2eb4c2=_0x2eb4c2[_0x8b45('0x2b')](/([^:]")"+/g,'$1');_0x2eb4c2='+'+_0x2eb4c2+'*';var _0x1a8974=/[ `!@#$%^&*()_\-?~]/;if(_0x2eb4c2[_0x8b45('0x27')](_0x1a8974))_0x2eb4c2='\x22'+_0x2eb4c2+'\x22';_0x36db96['push'](_0x2eb4c2);});return _0x36db96[_0x8b45('0x2c')]('\x20');};exports[_0x8b45('0x2d')]=function(_0x50302,_0xc2ae94,_0x12b66d){var _0x502505={},_0x29fbec={};if(_0xc2ae94['query']['$id']){_0xc2ae94[_0x8b45('0x2e')]['id']=_0xc2ae94[_0x8b45('0x2e')][_0x8b45('0x2f')];delete _0xc2ae94[_0x8b45('0x2e')][_0x8b45('0x2f')];}_0x502505[_0x8b45('0x30')]=_['map'](_0x50302,_0x8b45('0x12'));_0x502505[_0x8b45('0x2e')]=_[_0x8b45('0x4')](_0xc2ae94[_0x8b45('0x2e')]);_0x502505['filters']=_[_0x8b45('0x31')](_0x502505[_0x8b45('0x30')],_0x502505[_0x8b45('0x2e')]);_0x29fbec['attributes']=_[_0x8b45('0x31')](_0x502505[_0x8b45('0x30')],this[_0x8b45('0x5')](_0xc2ae94['query'][_0x8b45('0x5')]));_0x29fbec[_0x8b45('0x32')]=_0x29fbec[_0x8b45('0x32')][_0x8b45('0x20')]?_0x29fbec['attributes']:_0x502505[_0x8b45('0x30')];if(!_0xc2ae94[_0x8b45('0x2e')][_0x8b45('0x25')](_0x8b45('0x33'))){_0x29fbec[_0x8b45('0x15')]=this[_0x8b45('0x15')](_0xc2ae94['query']['limit']);_0x29fbec[_0x8b45('0x16')]=this[_0x8b45('0x16')](_0xc2ae94[_0x8b45('0x2e')][_0x8b45('0x16')]);}_0x29fbec[_0x8b45('0x34')]=this['sort'](_0xc2ae94[_0x8b45('0x2e')]['sort']);_0x29fbec[_0x8b45('0x35')]=this[_0x8b45('0x7')](_[_0x8b45('0x36')](_0xc2ae94[_0x8b45('0x2e')],_0x502505[_0x8b45('0x7')]),_0x50302);if(_0xc2ae94[_0x8b45('0x2e')][_0x8b45('0x37')]){var _0x1e9d50=_0x50302;var _0x23631e=_0xc2ae94[_0x8b45('0x2e')][_0x8b45('0x37')];if(typeof _0x23631e==='object'){_0x1e9d50=_[_0x8b45('0x37')](_0x50302,function(_0x48ab38){return _[_0x8b45('0x38')](_0x23631e['columns'],_0x48ab38[_0x8b45('0x12')]);});_0x23631e=_0x23631e[_0x8b45('0x39')];}_0x29fbec[_0x8b45('0x35')]=_[_0x8b45('0x3a')](_0x29fbec[_0x8b45('0x35')],{'$or':_[_0x8b45('0x18')](_0x1e9d50,function(_0x58e663){if(_0x58e663[_0x8b45('0xa')]!=='VIRTUAL'){if(_0x12b66d){return sequelize['where'](sequelize['fn'](_0x8b45('0x3b'),sequelize[_0x8b45('0x1e')](_0x58e663[_0x8b45('0x12')])),{'$like':sequelize['fn']('lower','%'+_0xc2ae94[_0x8b45('0x2e')]['filter']+'%')});}else{var _0x13c36d={};_0x13c36d[_0x58e663[_0x8b45('0x12')]]={'$like':'%'+_0xc2ae94[_0x8b45('0x2e')][_0x8b45('0x37')]+'%'};return _0x13c36d;}}})});}_0x29fbec=_[_0x8b45('0x3a')]({},_0x29fbec,_0xc2ae94[_0x8b45('0x3c')]);return _0x29fbec;}; \ No newline at end of file +var _0xf873=['forOwn','find','type','DATE','isPlainObject','$gte','format','utc','$lte','YYYY-MM-DD','subtract','uniqueid','isArray','limit','offset','priority','cast','col','unsigned','substr','DESC','ASC','omit','length','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','push','join','getOptions','query','$id','name','filters','intersection','model','attributes','nolimit','order','where','filter','object','value','merge','map','VIRTUAL','lower','options','sequelize','moment','parse','keys','includes','fields','split','isEmpty'];(function(_0x2c91aa,_0x437bea){var _0x451778=function(_0x3e3254){while(--_0x3e3254){_0x2c91aa['push'](_0x2c91aa['shift']());}};_0x451778(++_0x437bea);}(_0xf873,0xb2));var _0x3f87=function(_0x56c973,_0x1c7058){_0x56c973=_0x56c973-0x0;var _0x3929e4=_0xf873[_0x56c973];return _0x3929e4;};'use strict';var _=require('lodash');var sequelize=require(_0x3f87('0x0'));var moment=require(_0x3f87('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x311101){var _0x3ef688=['ne'];try{var _0x1c56a3=JSON[_0x3f87('0x2')](_0x311101);var _0x2fbb4f=Object[_0x3f87('0x3')](_0x1c56a3)[0x0];return _0x3ef688[_0x3f87('0x4')](_0x2fbb4f);}catch(_0x4a909e){return![];}}function getOperatorValue(_0x2e2177){var _0x43c8e4=JSON[_0x3f87('0x2')](_0x2e2177);var _0x5a5e37=Object[_0x3f87('0x3')](_0x43c8e4)[0x0];var _0x2c7ccc=_0x43c8e4[_0x5a5e37];return{['$'+_0x5a5e37]:_0x2c7ccc};}exports[_0x3f87('0x5')]=function(_0x41faf2){var _0xd9391d=null;if(_0x41faf2){_0xd9391d=_0x41faf2[_0x3f87('0x6')](',');}return _0xd9391d;};exports['filters']=function(_0x1405ca,_0x435ca8){var _0x32e236={};if(!_[_0x3f87('0x7')](_0x1405ca)){_[_0x3f87('0x8')](_0x1405ca,function(_0xd41ca0,_0x2aa592){try{if(_0x435ca8){var _0x2b7ca0=_[_0x3f87('0x9')](_0x435ca8,{'name':_0x2aa592})||{};if(hasSequelizeOperator(_0xd41ca0)){_0x32e236[_0x2aa592]=getOperatorValue(_0xd41ca0);}else if(_0x2b7ca0[_0x3f87('0xa')]===_0x3f87('0xb')&&_[_0x3f87('0xc')](_0xd41ca0)){var _0xfd5b65=JSON[_0x3f87('0x2')](_0xd41ca0);var _0x5aff02={'$gte':moment(moment(_0xfd5b65[_0x3f87('0xd')])[_0x3f87('0xe')]('YYYY-MM-DD'))[_0x3f87('0xf')]()[_0x3f87('0xe')](),'$lte':moment(moment(_0xfd5b65[_0x3f87('0x10')])[_0x3f87('0xe')](_0x3f87('0x11')))[_0x3f87('0xf')]()[_0x3f87('0x12')](0x1,'s')[_0x3f87('0xe')]()};_0x32e236[_0x2aa592]=_0x5aff02;}else if(_0x2b7ca0['name']===_0x3f87('0x13')){_0x32e236[_0x2aa592]=_0xd41ca0;}else{_0x32e236[_0x2aa592]=_[_0x3f87('0x14')](_0xd41ca0)?_0xd41ca0:JSON[_0x3f87('0x2')](_0xd41ca0);}}else{_0x32e236[_0x2aa592]=_['isArray'](_0xd41ca0)?_0xd41ca0:JSON[_0x3f87('0x2')](_0xd41ca0);}}catch(_0x56d79e){_0x32e236[_0x2aa592]=_0xd41ca0[_0x3f87('0x6')](',');}});}return _0x32e236;};exports[_0x3f87('0x15')]=function(_0x285b2c){_0x285b2c=parseInt(_0x285b2c,0xa);if(!_0x285b2c||_0x285b2c<0x0){_0x285b2c=LIMIT_VALUE;}return _0x285b2c;};exports[_0x3f87('0x16')]=function(_0x3678bc){_0x3678bc=parseInt(_0x3678bc,0xa);if(!_0x3678bc||_0x3678bc<0x0){_0x3678bc=0x0;}return _0x3678bc;};exports['sort']=function(_0x12df6e){var _0x2372d3,_0x996eb8=null;if(_0x12df6e){_0x2372d3=_0x12df6e[_0x3f87('0x6')](',');_0x996eb8=_['map'](_0x2372d3,function(_0x4acd30){if(_0x4acd30['indexOf']('-')===0x0){return[_0x4acd30===_0x3f87('0x17')?sequelize[_0x3f87('0x18')](sequelize[_0x3f87('0x19')]('priority'),_0x3f87('0x1a')):_0x4acd30[_0x3f87('0x1b')](0x1),_0x3f87('0x1c')];}else{return[_0x4acd30===_0x3f87('0x17')?sequelize[_0x3f87('0x18')](sequelize[_0x3f87('0x19')](_0x3f87('0x17')),_0x3f87('0x1a')):_0x4acd30,_0x3f87('0x1d')];}});}return _0x996eb8;};exports[_0x3f87('0x1e')]=function(_0x5df86b,_0x37b8b9){if(_['isEmpty'](_0x5df86b)){return _0x5df86b;}if(_[_0x3f87('0x14')](_0x5df86b)){for(var _0x9ed827=0x0;_0x9ed827<_0x5df86b[_0x3f87('0x1f')];_0x9ed827+=0x1){_0x5df86b[_0x9ed827]=this['omit'](_0x5df86b[_0x9ed827],_0x37b8b9);}return _0x5df86b;}if(!_['isObject'](_0x5df86b)){return _0x5df86b;}if(_[_0x3f87('0x20')](_0x37b8b9)){_0x37b8b9=[_0x37b8b9];}if(!_[_0x3f87('0x14')](_0x37b8b9)){return _0x5df86b;}for(var _0x18df70=0x0;_0x18df70<_0x37b8b9[_0x3f87('0x1f')];_0x18df70+=0x1){_[_0x3f87('0x21')](_0x5df86b,_0x37b8b9[_0x18df70]);}for(var _0x148d8e in _0x5df86b){if(_0x5df86b[_0x3f87('0x22')](_0x148d8e)){_0x5df86b[_0x148d8e]=this[_0x3f87('0x1e')](_0x5df86b[_0x148d8e],_0x37b8b9);}}return _0x5df86b;};exports[_0x3f87('0x23')]=function(_0x2e18cb){return _0x2e18cb[_0x3f87('0x24')](RegExp(_0x3f87('0x25')))?!![]:![];};exports[_0x3f87('0x26')]=function(_0x241d88){return _0x241d88[_0x3f87('0x24')](/^\S+@\S+$/)?!![]:![];};exports[_0x3f87('0x27')]=function(_0x5d6fc2){var _0x150dbb=[];_0x5d6fc2[_0x3f87('0x6')](/[ ,]+/)[_0x3f87('0x28')](function(_0x2f0f05){_0x2f0f05=_0x2f0f05['replace'](/([^:]")"+/g,'$1');_0x2f0f05='+'+_0x2f0f05+'*';var _0x5c6082=/[ `!@#$%^&*()_\-?~]/;if(_0x2f0f05['match'](_0x5c6082))_0x2f0f05='\x22'+_0x2f0f05+'\x22';_0x150dbb[_0x3f87('0x29')](_0x2f0f05);});return _0x150dbb[_0x3f87('0x2a')]('\x20');};exports[_0x3f87('0x2b')]=function(_0x1d731a,_0x25e332,_0x5e4570){var _0x2d2d4c={},_0x50449c={};if(_0x25e332[_0x3f87('0x2c')][_0x3f87('0x2d')]){_0x25e332[_0x3f87('0x2c')]['id']=_0x25e332[_0x3f87('0x2c')][_0x3f87('0x2d')];delete _0x25e332[_0x3f87('0x2c')][_0x3f87('0x2d')];}_0x2d2d4c['model']=_['map'](_0x1d731a,_0x3f87('0x2e'));_0x2d2d4c[_0x3f87('0x2c')]=_[_0x3f87('0x3')](_0x25e332[_0x3f87('0x2c')]);_0x2d2d4c[_0x3f87('0x2f')]=_[_0x3f87('0x30')](_0x2d2d4c[_0x3f87('0x31')],_0x2d2d4c['query']);_0x50449c[_0x3f87('0x32')]=_['intersection'](_0x2d2d4c[_0x3f87('0x31')],this[_0x3f87('0x5')](_0x25e332[_0x3f87('0x2c')][_0x3f87('0x5')]));_0x50449c['attributes']=_0x50449c[_0x3f87('0x32')]['length']?_0x50449c[_0x3f87('0x32')]:_0x2d2d4c[_0x3f87('0x31')];if(!_0x25e332[_0x3f87('0x2c')][_0x3f87('0x22')](_0x3f87('0x33'))){_0x50449c['limit']=this['limit'](_0x25e332['query'][_0x3f87('0x15')]);_0x50449c[_0x3f87('0x16')]=this[_0x3f87('0x16')](_0x25e332[_0x3f87('0x2c')][_0x3f87('0x16')]);}_0x50449c[_0x3f87('0x34')]=this['sort'](_0x25e332[_0x3f87('0x2c')]['sort']);_0x50449c[_0x3f87('0x35')]=this[_0x3f87('0x2f')](_['pick'](_0x25e332[_0x3f87('0x2c')],_0x2d2d4c[_0x3f87('0x2f')]),_0x1d731a);if(_0x25e332[_0x3f87('0x2c')]['filter']){var _0x246976=_0x1d731a;var _0x588915=_0x25e332['query'][_0x3f87('0x36')];if(typeof _0x588915===_0x3f87('0x37')){_0x246976=_[_0x3f87('0x36')](_0x1d731a,function(_0x13a662){return _[_0x3f87('0x4')](_0x588915['columns'],_0x13a662[_0x3f87('0x2e')]);});_0x588915=_0x588915[_0x3f87('0x38')];}_0x50449c[_0x3f87('0x35')]=_[_0x3f87('0x39')](_0x50449c['where'],{'$or':_[_0x3f87('0x3a')](_0x246976,function(_0x458c79){if(_0x458c79[_0x3f87('0xa')]!==_0x3f87('0x3b')){if(_0x5e4570){return sequelize[_0x3f87('0x35')](sequelize['fn'](_0x3f87('0x3c'),sequelize[_0x3f87('0x19')](_0x458c79[_0x3f87('0x2e')])),{'$like':sequelize['fn']('lower','%'+_0x25e332['query'][_0x3f87('0x36')]+'%')});}else{var _0x2a234={};_0x2a234[_0x458c79[_0x3f87('0x2e')]]={'$like':'%'+_0x25e332[_0x3f87('0x2c')][_0x3f87('0x36')]+'%'};return _0x2a234;}}})});}_0x50449c=_[_0x3f87('0x39')]({},_0x50449c,_0x25e332[_0x3f87('0x3d')]);return _0x50449c;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 15f25ff..54d1e04 100644 --- a/server/components/realtime/agents.js +++ b/server/components/realtime/agents.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0c8c=['chatPause','mailPause','pauseType','getSortedAgentsIdsByStatus','fields','globalStatus','order','startsWith','DESC','ASC','getUpdatedSortOptions','internal','validateSortParameter','sort','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','mailStatus','chatStatusTime','mailStatusTime','smsStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableAutomaticScreenRecording','routealias','openchannelPause','pick','filterAgentAttributes','lodash','../../mysqldb','client','http','faxPause','smsPause','voicePause','whatsappPause','every','filter','length','idle','ringing','isNil','voiceStatus','pause','chatStatus','faxStatus','openchannelStatus','smsStatus','whatsappStatus','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','unknown','*pause','busy','getAgentStatus','isArray','startCase','findOne','getAgents','all','flatten','map','value','includes','getAgentIdsByStatus','resolve','User','name','fullname'];(function(_0x5d44db,_0x6a9346){var _0x94153e=function(_0x57bcd2){while(--_0x57bcd2){_0x5d44db['push'](_0x5d44db['shift']());}};_0x94153e(++_0x6a9346);}(_0x0c8c,0x8c));var _0xc0c8=function(_0x2aad8f,_0x5d9e35){_0x2aad8f=_0x2aad8f-0x0;var _0x27fdf5=_0x0c8c[_0x2aad8f];return _0x27fdf5;};'use strict';var _=require(_0xc0c8('0x0'));var jayson=require('jayson/promise');var db=require(_0xc0c8('0x1'))['db'];var amiClient=jayson[_0xc0c8('0x2')]['http']({'port':0x232a});var routingClient=jayson['client'][_0xc0c8('0x3')]({'port':0x232c});function isAgentPaused(_0x48190a,_0x363225){var _0x2556d8=[_0x48190a['chatPause'],_0x48190a[_0xc0c8('0x4')],_0x48190a['mailPause'],_0x48190a['openchannelPause'],_0x48190a[_0xc0c8('0x5')],_0x48190a[_0xc0c8('0x6')],_0x48190a[_0xc0c8('0x7')]];if(!_0x363225)return _[_0xc0c8('0x8')](_0x2556d8);var _0x413698=_[_0xc0c8('0x9')](_0x2556d8);return _0x413698['length']>0x0&&_0x413698[_0xc0c8('0xa')]<_0x2556d8[_0xc0c8('0xa')]?!![]:![];}function isIdle(_0x2a15c3){return _0x2a15c3===_0xc0c8('0xb')||_0x2a15c3==='unknown'||_0x2a15c3==='unavailable'||_0x2a15c3===_0xc0c8('0xc')||_[_0xc0c8('0xd')](_0x2a15c3);}function isAgentIdle(_0x30d8ed){if(_0x30d8ed[_0xc0c8('0xe')]!==_0xc0c8('0xb')&&_0x30d8ed[_0xc0c8('0x6')]){_0x30d8ed[_0xc0c8('0xe')]=_0xc0c8('0xf');return![];}return _[_0xc0c8('0x8')]([_0x30d8ed[_0xc0c8('0x10')],_0x30d8ed[_0xc0c8('0x11')],_0x30d8ed['mailStatus'],_0x30d8ed[_0xc0c8('0x12')],_0x30d8ed[_0xc0c8('0x13')],_0x30d8ed[_0xc0c8('0xe')],_0x30d8ed[_0xc0c8('0x14')]],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0xc0c8('0x15'),{})[_0xc0c8('0x16')](function(_0x3ed56c){if(_0x3ed56c[_0xc0c8('0x17')]){throw new Error(_0xc0c8('0x18'));}var _0x35096c=_0x3ed56c[_0xc0c8('0x19')];return routingClient[_0xc0c8('0x1a')]('Agents',{})['then'](function(_0x5ba0bf){if(_0x5ba0bf['error']){throw new Error(_0xc0c8('0x1b'));}var _0x3460a2=_0x5ba0bf[_0xc0c8('0x19')];return _[_0xc0c8('0x1c')]({},_0x35096c,_0x3460a2);});})[_0xc0c8('0x1d')](function(_0x3fa645){throw _0x3fa645;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x3b3e45){var _0x514aeb=_0xc0c8('0x1e');if(isAgentPaused(_0x3b3e45))_0x514aeb='pause';else if(isAgentPaused(_0x3b3e45,!![]))_0x514aeb=_0xc0c8('0x1f');else if(isAgentIdle(_0x3b3e45))_0x514aeb=_0xc0c8('0xb');else _0x514aeb=_0xc0c8('0x20');return _0x514aeb;}exports[_0xc0c8('0x21')]=getAgentStatus;function getAgentIdsByQueues(_0x501b6c,_0x2ed3eb){var _0x4f1cd1=_[_0xc0c8('0x22')](_0x501b6c)?_0x501b6c:[_0x501b6c];var _0x440a87=_[_0xc0c8('0x23')](_0x2ed3eb)+'Queue';var _0x5498b3=_['map'](_0x4f1cd1,function(_0x3731aa){return db[_0x440a87][_0xc0c8('0x24')]({'where':{'id':_0x3731aa}})['then'](function(_0x5d46ab){if(!_0x5d46ab)return[];return _0x5d46ab[_0xc0c8('0x25')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xc0c8('0x26')](_0x5498b3)[_0xc0c8('0x16')](function(_0x4c8763){var _0x22c47d=_(_0x4c8763)[_0xc0c8('0x27')]()[_0xc0c8('0x28')]('id')['uniq']()[_0xc0c8('0x29')]();return _0x22c47d;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x271895,_0xaa0039,_0x330281){try{if(_0xaa0039[_0xc0c8('0xa')]>0x0){_0x271895=_0x271895['filter'](function(_0x50b0ed){return _0xaa0039[_0xc0c8('0x2a')](_0x50b0ed['id']);});}var _0xd7f46c=_0x271895[_0xc0c8('0x9')](function(_0x3c5c30){var _0x3e4c33=_0xc0c8('0x20');if(isAgentIdle(_0x3c5c30)){_0x3e4c33=_0xc0c8('0xb');}return _0x3e4c33===_0x330281;});return _[_0xc0c8('0x28')](_0xd7f46c,'id');}catch(_0x5d0700){throw _0x5d0700;}}exports[_0xc0c8('0x2b')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x4ac5e7,_0x46a41a,_0x2aec5f){return Promise[_0xc0c8('0x2c')]()[_0xc0c8('0x16')](function(){if(_0x46a41a[_0xc0c8('0xa')]>0x0){_0x4ac5e7=_0x4ac5e7[_0xc0c8('0x9')](function(_0x39f7af){return _0x46a41a['includes'](_0x39f7af['id']);});}return _0x4ac5e7;})['then'](function(){return db[_0xc0c8('0x2d')]['findAll']({'attributes':['id',_0xc0c8('0x2e'),_0xc0c8('0x2f'),_0xc0c8('0x30'),_0xc0c8('0x4'),_0xc0c8('0x31'),'openchannelPause',_0xc0c8('0x5'),_0xc0c8('0x6'),_0xc0c8('0x7'),_0xc0c8('0x32')],'where':{'id':{'$in':_[_0xc0c8('0x28')](_0x4ac5e7,'id')}},'raw':!![]});})[_0xc0c8('0x16')](function(_0x5763ea){return _0x5763ea['map'](function(_0x53f143){var _0x5a13a2=_['find'](_0x4ac5e7,['id',_0x53f143['id']]);var _0x5fe372=filterAgentAttributes(_0x5a13a2);_['merge'](_0x53f143,_0x5fe372);_0x53f143['globalStatus']=getAgentStatus(_0x53f143);return _0x53f143;});})['then'](function(_0x567bf9){var _0x378cc0=sortAgentsByStatus(_0x567bf9,_0x2aec5f);return _[_0xc0c8('0x28')](_0x378cc0,'id');})[_0xc0c8('0x1d')](function(_0x5e7365){throw _0x5e7365;});}exports[_0xc0c8('0x33')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x266bb4){var _0x5c8063={'fields':[],'order':null};var _0x4aacc4=_0x266bb4['split'](',');_0x5c8063[_0xc0c8('0x34')]=_[_0xc0c8('0x9')](_0x4aacc4,function(_0x2d5ecc){if(!_0x2d5ecc[_0xc0c8('0x2a')](_0xc0c8('0x35'))){return!![];}_0x5c8063[_0xc0c8('0x36')]=_[_0xc0c8('0x37')](_0x2d5ecc,'-')?_0xc0c8('0x38'):_0xc0c8('0x39');return![];});return _0x5c8063;}exports[_0xc0c8('0x3a')]=getUpdatedSortOptions;function validateSortParameter(_0x5d857){if(_0x5d857['includes'](_0xc0c8('0x2f'))&&!_0x5d857[_0xc0c8('0x2a')](_0xc0c8('0x3b'))){var _0x5314d2=_0x5d857['substring'](0x0,_0x5d857['indexOf'](_0xc0c8('0x2f')));_0x5d857+=','+_0x5314d2+_0xc0c8('0x3b');}return _0x5d857;}exports[_0xc0c8('0x3c')]=validateSortParameter;function sortAgentsByStatus(_0x5db7f9,_0x316903){var _0x3f285e=_0x5db7f9[_0xc0c8('0x3d')](function(_0xdf65f8,_0x4795c5){if(_0xdf65f8[_0xc0c8('0x35')]===_0x4795c5[_0xc0c8('0x35')]){if(_0xdf65f8[_0xc0c8('0x35')]===_0xc0c8('0xf')){if(_0x316903===_0xc0c8('0x38')){return(_0xdf65f8[_0xc0c8('0x32')]||'')<(_0x4795c5[_0xc0c8('0x32')]||'')||_0xdf65f8['fullname']['toLowerCase']()>_0x4795c5[_0xc0c8('0x2f')][_0xc0c8('0x3e')]()?0x1:-0x1;}else{return(_0xdf65f8['pauseType']||'')<(_0x4795c5['pauseType']||'')||_0xdf65f8[_0xc0c8('0x2f')]['toLowerCase']()>_0x4795c5[_0xc0c8('0x2f')][_0xc0c8('0x3e')]()?-0x1:0x1;}}else{if(_0x316903==='DESC'){return _0xdf65f8[_0xc0c8('0x2f')][_0xc0c8('0x3e')]()<_0x4795c5[_0xc0c8('0x2f')]['toLowerCase']()?0x1:-0x1;}else{return _0xdf65f8['fullname'][_0xc0c8('0x3e')]()<_0x4795c5[_0xc0c8('0x2f')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0x316903===_0xc0c8('0x38')){return _0xdf65f8['globalStatus']<_0x4795c5['globalStatus']?0x1:-0x1;}else{return _0xdf65f8[_0xc0c8('0x35')]<_0x4795c5[_0xc0c8('0x35')]?-0x1:0x1;}}});return _0x3f285e;}exports[_0xc0c8('0x3f')]=sortAgentsByStatus;function filterAgentAttributes(_0x4b6018){var _0x337007=[_0xc0c8('0x40'),_0xc0c8('0x41'),_0xc0c8('0x42'),'lastPauseAt',_0xc0c8('0x32'),_0xc0c8('0x43'),_0xc0c8('0x3b'),_0xc0c8('0x44'),_0xc0c8('0x30'),'openchannelPause','mailPause',_0xc0c8('0x5'),_0xc0c8('0x7'),_0xc0c8('0x4'),'voicePause',_0xc0c8('0x45'),_0xc0c8('0x46'),_0xc0c8('0x47'),_0xc0c8('0x48'),_0xc0c8('0x49'),_0xc0c8('0x4a'),_0xc0c8('0x4b'),_0xc0c8('0x4c'),_0xc0c8('0x4d'),_0xc0c8('0x4e'),_0xc0c8('0x4f'),'faxCurrentCapacity',_0xc0c8('0x10'),_0xc0c8('0x12'),_0xc0c8('0x50'),_0xc0c8('0x13'),_0xc0c8('0x14'),_0xc0c8('0x11'),_0xc0c8('0xe'),_0xc0c8('0x51'),'openchannelStatusTime',_0xc0c8('0x52'),_0xc0c8('0x53'),'whatsappStatusTime',_0xc0c8('0x54'),_0xc0c8('0x55'),_0xc0c8('0x56'),_0xc0c8('0x57'),_0xc0c8('0x58'),'phoneBarEnableScreenRecordingByAgent',_0xc0c8('0x59'),_0xc0c8('0x5a')];var _0x48def8=[_0xc0c8('0x30'),_0xc0c8('0x5b'),_0xc0c8('0x31'),_0xc0c8('0x5'),_0xc0c8('0x7'),_0xc0c8('0x4'),'voicePause',_0xc0c8('0x41')];var _0x18612b=_(_0x4b6018)['omit'](_0x48def8)[_0xc0c8('0x5c')](_0x337007)[_0xc0c8('0x29')]();return _0x18612b;}exports[_0xc0c8('0x5d')]=filterAgentAttributes; \ No newline at end of file +var _0x606a=['every','length','unknown','unavailable','isNil','voiceStatus','pause','chatStatus','faxStatus','smsStatus','whatsappStatus','request','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Agents','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','getRealtimeAgents','*pause','idle','busy','getAgentStatus','isArray','startCase','map','findOne','all','flatten','uniq','value','filter','includes','getAgentIdsByStatus','User','findAll','name','chatPause','globalStatus','catch','getSortedAgentsIdsByStatus','split','fields','order','DESC','ASC','getUpdatedSortOptions','fullname','internal','substring','sort','pauseType','toLowerCase','sortAgentsByStatus','userpic','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','routealias','omit','pick','filterAgentAttributes','../../mysqldb','client','http','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause'];(function(_0x26db33,_0x81a2e9){var _0x87cd18=function(_0x787e99){while(--_0x787e99){_0x26db33['push'](_0x26db33['shift']());}};_0x87cd18(++_0x81a2e9);}(_0x606a,0x10b));var _0xa606=function(_0x4d772a,_0x5910c1){_0x4d772a=_0x4d772a-0x0;var _0x38a21f=_0x606a[_0x4d772a];return _0x38a21f;};'use strict';var _=require('lodash');var jayson=require('jayson/promise');var db=require(_0xa606('0x0'))['db'];var amiClient=jayson[_0xa606('0x1')][_0xa606('0x2')]({'port':0x232a});var routingClient=jayson[_0xa606('0x1')][_0xa606('0x2')]({'port':0x232c});function isAgentPaused(_0x183662,_0x3a8c97){var _0xfae00f=[_0x183662['chatPause'],_0x183662[_0xa606('0x3')],_0x183662[_0xa606('0x4')],_0x183662[_0xa606('0x5')],_0x183662[_0xa606('0x6')],_0x183662[_0xa606('0x7')],_0x183662[_0xa606('0x8')]];if(!_0x3a8c97)return _[_0xa606('0x9')](_0xfae00f);var _0x304864=_['filter'](_0xfae00f);return _0x304864[_0xa606('0xa')]>0x0&&_0x304864[_0xa606('0xa')]<_0xfae00f[_0xa606('0xa')]?!![]:![];}function isIdle(_0x2c885e){return _0x2c885e==='idle'||_0x2c885e===_0xa606('0xb')||_0x2c885e===_0xa606('0xc')||_0x2c885e==='ringing'||_[_0xa606('0xd')](_0x2c885e);}function isAgentIdle(_0x439356){if(_0x439356[_0xa606('0xe')]!=='idle'&&_0x439356[_0xa606('0x7')]){_0x439356[_0xa606('0xe')]=_0xa606('0xf');return![];}return _[_0xa606('0x9')]([_0x439356[_0xa606('0x10')],_0x439356[_0xa606('0x11')],_0x439356['mailStatus'],_0x439356['openchannelStatus'],_0x439356[_0xa606('0x12')],_0x439356[_0xa606('0xe')],_0x439356[_0xa606('0x13')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xa606('0x14')]('Agents',{})[_0xa606('0x15')](function(_0xfb588){if(_0xfb588['error']){throw new Error(_0xa606('0x16'));}var _0x4cf2d3=_0xfb588[_0xa606('0x17')];return routingClient['request'](_0xa606('0x18'),{})['then'](function(_0x13dedb){if(_0x13dedb[_0xa606('0x19')]){throw new Error(_0xa606('0x1a'));}var _0x48a76c=_0x13dedb[_0xa606('0x17')];return _[_0xa606('0x1b')]({},_0x4cf2d3,_0x48a76c);});})['catch'](function(_0x254bb4){throw _0x254bb4;});}exports[_0xa606('0x1c')]=getRealtimeAgents;function getAgentStatus(_0x57de48){var _0x2250a9=_0xa606('0xb');if(isAgentPaused(_0x57de48))_0x2250a9=_0xa606('0xf');else if(isAgentPaused(_0x57de48,!![]))_0x2250a9=_0xa606('0x1d');else if(isAgentIdle(_0x57de48))_0x2250a9=_0xa606('0x1e');else _0x2250a9=_0xa606('0x1f');return _0x2250a9;}exports[_0xa606('0x20')]=getAgentStatus;function getAgentIdsByQueues(_0x3ccb40,_0x207aaf){var _0x5a0f2e=_[_0xa606('0x21')](_0x3ccb40)?_0x3ccb40:[_0x3ccb40];var _0x48f560=_[_0xa606('0x22')](_0x207aaf)+'Queue';var _0x575022=_[_0xa606('0x23')](_0x5a0f2e,function(_0x221666){return db[_0x48f560][_0xa606('0x24')]({'where':{'id':_0x221666}})[_0xa606('0x15')](function(_0x47cf5c){if(!_0x47cf5c)return[];return _0x47cf5c['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0xa606('0x25')](_0x575022)['then'](function(_0xfc4f01){var _0x4797ce=_(_0xfc4f01)[_0xa606('0x26')]()['map']('id')[_0xa606('0x27')]()[_0xa606('0x28')]();return _0x4797ce;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x1dd26e,_0x32cfdd,_0x2490a4){try{if(_0x32cfdd[_0xa606('0xa')]>0x0){_0x1dd26e=_0x1dd26e[_0xa606('0x29')](function(_0x3437d8){return _0x32cfdd[_0xa606('0x2a')](_0x3437d8['id']);});}var _0x299c0b=_0x1dd26e[_0xa606('0x29')](function(_0x2d14ae){var _0x27e7ea=_0xa606('0x1f');if(isAgentIdle(_0x2d14ae)){_0x27e7ea=_0xa606('0x1e');}return _0x27e7ea===_0x2490a4;});return _[_0xa606('0x23')](_0x299c0b,'id');}catch(_0x5777a8){throw _0x5777a8;}}exports[_0xa606('0x2b')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x35f676,_0x4d38fb,_0x41537b){return Promise['resolve']()[_0xa606('0x15')](function(){if(_0x4d38fb[_0xa606('0xa')]>0x0){_0x35f676=_0x35f676[_0xa606('0x29')](function(_0x5141ef){return _0x4d38fb[_0xa606('0x2a')](_0x5141ef['id']);});}return _0x35f676;})['then'](function(){return db[_0xa606('0x2c')][_0xa606('0x2d')]({'attributes':['id',_0xa606('0x2e'),'fullname',_0xa606('0x2f'),_0xa606('0x3'),'mailPause',_0xa606('0x5'),_0xa606('0x6'),_0xa606('0x7'),_0xa606('0x8'),'pauseType'],'where':{'id':{'$in':_['map'](_0x35f676,'id')}},'raw':!![]});})['then'](function(_0x170f76){return _0x170f76[_0xa606('0x23')](function(_0x399781){var _0x1d33ed=_['find'](_0x35f676,['id',_0x399781['id']]);var _0x3377e5=filterAgentAttributes(_0x1d33ed);_[_0xa606('0x1b')](_0x399781,_0x3377e5);_0x399781[_0xa606('0x30')]=getAgentStatus(_0x399781);return _0x399781;});})['then'](function(_0x58b490){var _0x236f0b=sortAgentsByStatus(_0x58b490,_0x41537b);return _[_0xa606('0x23')](_0x236f0b,'id');})[_0xa606('0x31')](function(_0x48194c){throw _0x48194c;});}exports[_0xa606('0x32')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x21df65){var _0x52c16e={'fields':[],'order':null};var _0xc1279b=_0x21df65[_0xa606('0x33')](',');_0x52c16e[_0xa606('0x34')]=_['filter'](_0xc1279b,function(_0x58e30c){if(!_0x58e30c[_0xa606('0x2a')]('globalStatus')){return!![];}_0x52c16e[_0xa606('0x35')]=_['startsWith'](_0x58e30c,'-')?_0xa606('0x36'):_0xa606('0x37');return![];});return _0x52c16e;}exports[_0xa606('0x38')]=getUpdatedSortOptions;function validateSortParameter(_0x47d152){if(_0x47d152[_0xa606('0x2a')](_0xa606('0x39'))&&!_0x47d152[_0xa606('0x2a')](_0xa606('0x3a'))){var _0x2de95c=_0x47d152[_0xa606('0x3b')](0x0,_0x47d152['indexOf'](_0xa606('0x39')));_0x47d152+=','+_0x2de95c+_0xa606('0x3a');}return _0x47d152;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x4075cf,_0x531fdb){var _0x11c86f=_0x4075cf[_0xa606('0x3c')](function(_0x59812f,_0x106ac9){if(_0x59812f['globalStatus']===_0x106ac9[_0xa606('0x30')]){if(_0x59812f[_0xa606('0x30')]===_0xa606('0xf')){if(_0x531fdb===_0xa606('0x36')){return(_0x59812f[_0xa606('0x3d')]||'')<(_0x106ac9[_0xa606('0x3d')]||'')||_0x59812f[_0xa606('0x39')]['toLowerCase']()>_0x106ac9[_0xa606('0x39')][_0xa606('0x3e')]()?0x1:-0x1;}else{return(_0x59812f[_0xa606('0x3d')]||'')<(_0x106ac9[_0xa606('0x3d')]||'')||_0x59812f[_0xa606('0x39')][_0xa606('0x3e')]()>_0x106ac9[_0xa606('0x39')][_0xa606('0x3e')]()?-0x1:0x1;}}else{if(_0x531fdb===_0xa606('0x36')){return _0x59812f[_0xa606('0x39')][_0xa606('0x3e')]()<_0x106ac9[_0xa606('0x39')][_0xa606('0x3e')]()?0x1:-0x1;}else{return _0x59812f[_0xa606('0x39')][_0xa606('0x3e')]()<_0x106ac9[_0xa606('0x39')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0x531fdb==='DESC'){return _0x59812f['globalStatus']<_0x106ac9[_0xa606('0x30')]?0x1:-0x1;}else{return _0x59812f[_0xa606('0x30')]<_0x106ac9[_0xa606('0x30')]?-0x1:0x1;}}});return _0x11c86f;}exports[_0xa606('0x3f')]=sortAgentsByStatus;function filterAgentAttributes(_0x348256){var _0x188dfa=[_0xa606('0x40'),'online',_0xa606('0x41'),_0xa606('0x42'),_0xa606('0x3d'),'lastPauseAt','internal',_0xa606('0x43'),'chatPause',_0xa606('0x5'),_0xa606('0x4'),_0xa606('0x6'),_0xa606('0x8'),_0xa606('0x3'),_0xa606('0x7'),_0xa606('0x44'),_0xa606('0x45'),_0xa606('0x46'),_0xa606('0x47'),_0xa606('0x48'),_0xa606('0x49'),_0xa606('0x4a'),'openchannelCurrentCapacity','mailCurrentCapacity',_0xa606('0x4b'),_0xa606('0x4c'),_0xa606('0x4d'),_0xa606('0x10'),'openchannelStatus','mailStatus',_0xa606('0x12'),_0xa606('0x13'),'faxStatus','voiceStatus',_0xa606('0x4e'),_0xa606('0x4f'),_0xa606('0x50'),_0xa606('0x51'),_0xa606('0x52'),_0xa606('0x53'),_0xa606('0x54'),'queue',_0xa606('0x55'),_0xa606('0x56'),_0xa606('0x57'),'phoneBarEnableAutomaticScreenRecording',_0xa606('0x58')];var _0x4cbd82=[_0xa606('0x2f'),'openchannelPause','mailPause',_0xa606('0x6'),_0xa606('0x8'),_0xa606('0x3'),'voicePause','online'];var _0x1b7f6f=_(_0x348256)[_0xa606('0x59')](_0x4cbd82)[_0xa606('0x5a')](_0x188dfa)[_0xa606('0x28')]();return _0x1b7f6f;}exports[_0xa606('0x5b')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 6390f81..cc56118 100644 --- a/server/components/realtime/queues.js +++ b/server/components/realtime/queues.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb446=['Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','inbound','concat','outbound','map','get','waiting','originated','find','merge','pick','initializeQueues','lodash','jayson/promise','client','http','available','loggedIn','paused','busy','invalid','loggedInDb','notInUse','onHold','ringing','ringInUse','talking','unavailable','unknown','pTalking','message','dialActive','dialMethod','Trunk','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','voice','then','error','format'];(function(_0x4d8a7f,_0x158f93){var _0x2cb3ec=function(_0x326b9d){while(--_0x326b9d){_0x4d8a7f['push'](_0x4d8a7f['shift']());}};_0x2cb3ec(++_0x158f93);}(_0xb446,0xdb));var _0x6b44=function(_0x2aa8b6,_0x9ec21d){_0x2aa8b6=_0x2aa8b6-0x0;var _0x3505ed=_0xb446[_0x2aa8b6];return _0x3505ed;};'use strict';var _=require(_0x6b44('0x0'));var jayson=require(_0x6b44('0x1'));var util=require('util');var amiClient=jayson[_0x6b44('0x2')][_0x6b44('0x3')]({'port':0x232a});var routingClient=jayson[_0x6b44('0x2')]['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x6b44('0x4'),_0x6b44('0x5'),_0x6b44('0x6'),'waiting'];var VOICE_QUEUE_ATTRIBUTES=[_0x6b44('0x7'),'inUse',_0x6b44('0x8'),_0x6b44('0x9'),_0x6b44('0xa'),_0x6b44('0xb'),_0x6b44('0xc'),_0x6b44('0xd'),_0x6b44('0xe'),_0x6b44('0xf'),_0x6b44('0x10')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x6b44('0x11'),'originated',_0x6b44('0x12'),'statusMessage',_0x6b44('0x13'),_0x6b44('0x14'),_0x6b44('0x15'),'startPredictive',_0x6b44('0x16'),_0x6b44('0x17'),_0x6b44('0x18'),_0x6b44('0x19'),_0x6b44('0x1a'),'dialPredictiveInterval','dialPredictiveIntervalMaxThreshold',_0x6b44('0x1b'),_0x6b44('0x1c'),_0x6b44('0x1d'),_0x6b44('0x1e'),_0x6b44('0x1f'),'predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime'];function getRealtimeQueues(_0x2b9e77,_0x5bcd82){var _0x379136=_0x5bcd82===_0x6b44('0x20')?amiClient:routingClient;return _0x379136['request'](_['startCase'](_0x5bcd82)+'Queues',_0x2b9e77)[_0x6b44('0x21')](function(_0x3cdce5){if(_0x3cdce5[_0x6b44('0x22')])throw new Error(util[_0x6b44('0x23')](_0x6b44('0x24'),_0x5bcd82));return _0x3cdce5[_0x6b44('0x25')];})[_0x6b44('0x26')](function(_0x4509a6){throw _0x4509a6;});}exports[_0x6b44('0x27')]=getRealtimeQueues;function initializeQueues(_0x5464d5,_0x177b8e,_0x44bc24,_0x392a68){var _0x568a4c=DEFAULT_QUEUE_ATTRIBUTES;if(_0x44bc24===_0x6b44('0x20')){if(_0x392a68===_0x6b44('0x28')){_0x568a4c=_0x568a4c[_0x6b44('0x29')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x392a68===_0x6b44('0x2a')){_0x568a4c=_0x568a4c[_0x6b44('0x29')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x5464d5[_0x6b44('0x2b')](function(_0x36c197){var _0x2d8856=_0x36c197[_0x6b44('0x2c')]({'plain':!![]});_0x2d8856[_0x6b44('0x6')]=0x0;_0x2d8856[_0x6b44('0x9')]=0x0;_0x2d8856['loggedIn']=0x0;_0x2d8856[_0x6b44('0x4')]=0x0;_0x2d8856[_0x6b44('0x2d')]=0x0;if(_0x44bc24==='voice'){_0x2d8856[_0x6b44('0xe')]=0x0;_0x2d8856['busy']=0x0;if(_0x392a68===_0x6b44('0x2a')){_0x2d8856['pTalking']=0x0;_0x2d8856[_0x6b44('0x2e')]=0x0;}}var _0xcbf55d=_[_0x6b44('0x2f')](_0x177b8e,['id',_0x2d8856['id']]);if(_0xcbf55d){_[_0x6b44('0x30')](_0x2d8856,_[_0x6b44('0x31')](_0xcbf55d,_0x568a4c));}return _0x2d8856;});}exports[_0x6b44('0x32')]=initializeQueues; \ No newline at end of file +var _0xb6be=['message','dialActive','Trunk','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','voice','request','startCase','Queues','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','inbound','get','paused','loggedInDb','available','find','initializeQueues','jayson/promise','util','client','http','loggedIn','waiting','busy','invalid','onHold','ringing','talking','unknown','pTalking','originated'];(function(_0x1eba28,_0x401247){var _0x5a3d6d=function(_0xbe498a){while(--_0xbe498a){_0x1eba28['push'](_0x1eba28['shift']());}};_0x5a3d6d(++_0x401247);}(_0xb6be,0x126));var _0xeb6b=function(_0x21b359,_0x4dc80e){_0x21b359=_0x21b359-0x0;var _0x57b8e7=_0xb6be[_0x21b359];return _0x57b8e7;};'use strict';var _=require('lodash');var jayson=require(_0xeb6b('0x0'));var util=require(_0xeb6b('0x1'));var amiClient=jayson[_0xeb6b('0x2')]['http']({'port':0x232a});var routingClient=jayson['client'][_0xeb6b('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available',_0xeb6b('0x4'),'paused',_0xeb6b('0x5')];var VOICE_QUEUE_ATTRIBUTES=[_0xeb6b('0x6'),'inUse',_0xeb6b('0x7'),'loggedInDb','notInUse',_0xeb6b('0x8'),_0xeb6b('0x9'),'ringInUse',_0xeb6b('0xa'),'unavailable',_0xeb6b('0xb')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0xeb6b('0xc'),_0xeb6b('0xd'),_0xeb6b('0xe'),'statusMessage',_0xeb6b('0xf'),'dialMethod',_0xeb6b('0x10'),'startPredictive',_0xeb6b('0x11'),_0xeb6b('0x12'),_0xeb6b('0x13'),'erlangAbandonmentRate',_0xeb6b('0x14'),_0xeb6b('0x15'),_0xeb6b('0x16'),_0xeb6b('0x17'),_0xeb6b('0x18'),'predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls',_0xeb6b('0x19'),'predictiveIntervalDroppedCallsCallersExit',_0xeb6b('0x1a'),'predictiveIntervalAvgTalktime'];function getRealtimeQueues(_0x10ae1c,_0x2ec63e){var _0x231d71=_0x2ec63e===_0xeb6b('0x1b')?amiClient:routingClient;return _0x231d71[_0xeb6b('0x1c')](_[_0xeb6b('0x1d')](_0x2ec63e)+_0xeb6b('0x1e'),_0x10ae1c)['then'](function(_0x1ccd69){if(_0x1ccd69[_0xeb6b('0x1f')])throw new Error(util[_0xeb6b('0x20')](_0xeb6b('0x21'),_0x2ec63e));return _0x1ccd69[_0xeb6b('0x22')];})[_0xeb6b('0x23')](function(_0x323cc7){throw _0x323cc7;});}exports[_0xeb6b('0x24')]=getRealtimeQueues;function initializeQueues(_0x25aa23,_0x1cac96,_0x273b4e,_0x1a95d0){var _0x5ce304=DEFAULT_QUEUE_ATTRIBUTES;if(_0x273b4e==='voice'){if(_0x1a95d0===_0xeb6b('0x25')){_0x5ce304=_0x5ce304['concat'](VOICE_QUEUE_ATTRIBUTES);}else if(_0x1a95d0==='outbound'){_0x5ce304=_0x5ce304['concat'](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x25aa23['map'](function(_0x4e38fd){var _0x32d75a=_0x4e38fd[_0xeb6b('0x26')]({'plain':!![]});_0x32d75a[_0xeb6b('0x27')]=0x0;_0x32d75a[_0xeb6b('0x28')]=0x0;_0x32d75a[_0xeb6b('0x4')]=0x0;_0x32d75a[_0xeb6b('0x29')]=0x0;_0x32d75a[_0xeb6b('0x5')]=0x0;if(_0x273b4e===_0xeb6b('0x1b')){_0x32d75a[_0xeb6b('0xa')]=0x0;_0x32d75a[_0xeb6b('0x6')]=0x0;if(_0x1a95d0==='outbound'){_0x32d75a[_0xeb6b('0xc')]=0x0;_0x32d75a[_0xeb6b('0xd')]=0x0;}}var _0x5386a4=_[_0xeb6b('0x2a')](_0x1cac96,['id',_0x32d75a['id']]);if(_0x5386a4){_['merge'](_0x32d75a,_['pick'](_0x5386a4,_0x5ce304));}return _0x32d75a;});}exports[_0xeb6b('0x2b')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 0b5ed0d..f02e5fd 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x4b2471,_0xedb897){var _0x7a8c13=function(_0xbf3b7e){while(--_0xbf3b7e){_0x4b2471['push'](_0x4b2471['shift']());}};_0x7a8c13(++_0xedb897);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file +var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x440a9b,_0x19435a){var _0x4fe804=function(_0x984809){while(--_0x984809){_0x440a9b['push'](_0x440a9b['shift']());}};_0x4fe804(++_0x19435a);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index ecf4041..852d68f 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 _0xd726=['dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','ipAddress','update','substring','lodash','bimedia-machine-uuid','child_process','execSync','orderBy','keys','length','family','IPv4','head','mac','address','127.0.0.1','getFirstInterface','cpus','map','model','createHash','md5','digest','hex','getUuid','licenseToken'];(function(_0x579e9e,_0x434822){var _0x2cc65d=function(_0x2ce412){while(--_0x2ce412){_0x579e9e['push'](_0x579e9e['shift']());}};_0x2cc65d(++_0x434822);}(_0xd726,0x151));var _0x6d72=function(_0x178a23,_0x1c91be){_0x178a23=_0x178a23-0x0;var _0x4f38af=_0xd726[_0x178a23];return _0x4f38af;};'use strict';var _=require(_0x6d72('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x6d72('0x1'));var exec=require(_0x6d72('0x2'))[_0x6d72('0x3')];var config=require('../environment');function getInterfaces(){var _0x26b368=[];var _0x23d201=os['networkInterfaces']();var _0x3c3c1e=_[_0x6d72('0x4')](_[_0x6d72('0x5')](_0x23d201));for(var _0x212831=0x0;_0x212831<_0x3c3c1e[_0x6d72('0x6')];_0x212831++){var _0x114828=_0x23d201[_0x3c3c1e[_0x212831]]['filter'](function(_0x1c5458){return _0x1c5458[_0x6d72('0x7')]===_0x6d72('0x8')&&_0x1c5458['internal']===![];});_0x26b368=_0x26b368['concat'](_0x114828);}return _0x26b368;}function getFirstInterface(){var _0x2c754d=_[_0x6d72('0x9')](getInterfaces());return{'macAddress':_0x2c754d&&_0x2c754d['mac']?_0x2c754d[_0x6d72('0xa')]:'00:00:00:00:00:00','ipAddress':_0x2c754d&&_0x2c754d[_0x6d72('0xb')]?_0x2c754d[_0x6d72('0xb')]:_0x6d72('0xc')};}exports[_0x6d72('0xd')]=getFirstInterface;function getCPUhash(){var _0x3f38b0=_[_0x6d72('0x4')](os[_0x6d72('0xe')]()[_0x6d72('0xf')](function(_0x3e148f){return _0x3e148f[_0x6d72('0x10')];}))['join'](':');return crypto[_0x6d72('0x11')](_0x6d72('0x12'))['update'](_0x3f38b0)[_0x6d72('0x13')](_0x6d72('0x14'));}exports[_0x6d72('0x15')]=function(){var _0x1086c5=os['platform']();var _0xdfa452=/[0-9a-f-]{36}/;if(config[_0x6d72('0x16')]&&_0xdfa452['test'](config[_0x6d72('0x16')])){return config['licenseToken'];}else if(_0x1086c5==='win32'){return exec(_0x6d72('0x17'),{'encoding':_0x6d72('0x18')})[_0x6d72('0x19')]('\x0d\x0a','');}else{var _0x2e13c0=getFirstInterface();var _0xd36f69=getCPUhash();var _0x60e218=_0xd36f69+'|'+os[_0x6d72('0x1a')]()+'|'+_0x2e13c0['macAddress']+'|'+_0x2e13c0[_0x6d72('0x1b')];var _0x3cba4b=crypto[_0x6d72('0x11')](_0x6d72('0x12'))[_0x6d72('0x1c')](_0x60e218)['digest'](_0x6d72('0x14'));return _0x3cba4b[_0x6d72('0x1d')](0x0,0x8)+'-'+_0x3cba4b[_0x6d72('0x1d')](0x8,0xc)+'-'+_0x3cba4b[_0x6d72('0x1d')](0xc,0x10)+'-'+_0x3cba4b[_0x6d72('0x1d')](0x10,0x14)+'-'+_0x3cba4b['substring'](0x14);}}; \ No newline at end of file +var _0x3c1c=['digest','hex','getUuid','platform','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','hostname','macAddress','ipAddress','createHash','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','orderBy','family','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','md5','update'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x3c1c,0x178));var _0xc3c1=function(_0x56a871,_0x18b7fe){_0x56a871=_0x56a871-0x0;var _0x124954=_0x3c1c[_0x56a871];return _0x124954;};'use strict';var _=require(_0xc3c1('0x0'));var os=require('os');var crypto=require(_0xc3c1('0x1'));var machine=require(_0xc3c1('0x2'));var exec=require(_0xc3c1('0x3'))[_0xc3c1('0x4')];var config=require(_0xc3c1('0x5'));function getInterfaces(){var _0x1517ac=[];var _0x1ce61a=os['networkInterfaces']();var _0x599bb1=_[_0xc3c1('0x6')](_['keys'](_0x1ce61a));for(var _0x2386ce=0x0;_0x2386ce<_0x599bb1['length'];_0x2386ce++){var _0x2e81ed=_0x1ce61a[_0x599bb1[_0x2386ce]]['filter'](function(_0x495ee5){return _0x495ee5[_0xc3c1('0x7')]==='IPv4'&&_0x495ee5['internal']===![];});_0x1517ac=_0x1517ac[_0xc3c1('0x8')](_0x2e81ed);}return _0x1517ac;}function getFirstInterface(){var _0x4a81db=_[_0xc3c1('0x9')](getInterfaces());return{'macAddress':_0x4a81db&&_0x4a81db['mac']?_0x4a81db[_0xc3c1('0xa')]:_0xc3c1('0xb'),'ipAddress':_0x4a81db&&_0x4a81db[_0xc3c1('0xc')]?_0x4a81db[_0xc3c1('0xc')]:_0xc3c1('0xd')};}exports[_0xc3c1('0xe')]=getFirstInterface;function getCPUhash(){var _0x540fed=_[_0xc3c1('0x6')](os[_0xc3c1('0xf')]()[_0xc3c1('0x10')](function(_0x2a805f){return _0x2a805f[_0xc3c1('0x11')];}))['join'](':');return crypto['createHash'](_0xc3c1('0x12'))[_0xc3c1('0x13')](_0x540fed)[_0xc3c1('0x14')](_0xc3c1('0x15'));}exports[_0xc3c1('0x16')]=function(){var _0x27d38b=os[_0xc3c1('0x17')]();var _0x139a6d=/[0-9a-f-]{36}/;if(config[_0xc3c1('0x18')]&&_0x139a6d['test'](config['licenseToken'])){return config[_0xc3c1('0x18')];}else if(_0x27d38b===_0xc3c1('0x19')){return exec(_0xc3c1('0x1a'),{'encoding':_0xc3c1('0x1b')})['replace']('\x0d\x0a','');}else{var _0x33e6a6=getFirstInterface();var _0x34bea9=getCPUhash();var _0x133867=_0x34bea9+'|'+os[_0xc3c1('0x1c')]()+'|'+_0x33e6a6[_0xc3c1('0x1d')]+'|'+_0x33e6a6[_0xc3c1('0x1e')];var _0x35dc40=crypto[_0xc3c1('0x1f')]('md5')[_0xc3c1('0x13')](_0x133867)[_0xc3c1('0x14')](_0xc3c1('0x15'));return _0x35dc40[_0xc3c1('0x20')](0x0,0x8)+'-'+_0x35dc40['substring'](0x8,0xc)+'-'+_0x35dc40['substring'](0xc,0x10)+'-'+_0x35dc40[_0xc3c1('0x20')](0x10,0x14)+'-'+_0x35dc40['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index c9b4541..3fe8418 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 _0x89cb=['THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','catch','error','message','finally','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','moment','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','format','%s/api/servers/%s/check?version=%s','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','then','get','data1','data2','active','info'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x89cb,0x90));var _0xb89c=function(_0x3a76d9,_0x50fe49){_0x3a76d9=_0x3a76d9-0x0;var _0x14f61f=_0x89cb[_0x3a76d9];return _0x14f61f;};'use strict';var util=require(_0xb89c('0x0'));var moment=require(_0xb89c('0x1'));var rp=require('request-promise');var BPromise=require(_0xb89c('0x2'));var pkginfo=require(_0xb89c('0x3'))(module,_0xb89c('0x4'));var db=require(_0xb89c('0x5'))['db'];var encryptor=require(_0xb89c('0x6'));var hardware=require(_0xb89c('0x7'));var logger=require(_0xb89c('0x8'))(_0xb89c('0x9'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3365bd){return new BPromise(function(_0x800aad,_0x239df2){var _0x3b1047=util[_0xb89c('0xa')](_0xb89c('0xb'),HOST,_0x3365bd,module['exports'][_0xb89c('0x4')]);if(oldToken){_0x3b1047=util[_0xb89c('0xa')](_0xb89c('0xc'),HOST,_0x3365bd,module[_0xb89c('0xd')][_0xb89c('0x4')],oldToken);}var _0x87e300={'uri':_0x3b1047,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x87e300)[_0xb89c('0xe')](function(_0x1e0d20){_0x800aad(_0x1e0d20);})['catch'](function(_0x2be0ef){_0x239df2(_0x2be0ef);});});}function manageLicense(_0x27954e,_0x462bc8){var _0x569c32=_0x462bc8[_0xb89c('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x569c32[_0xb89c('0x10')]!==_0x27954e&&!_0x569c32[_0xb89c('0x11')]){oldToken=_0x569c32[_0xb89c('0x10')];}httpRequest(_0x27954e)[_0xb89c('0xe')](function(_0x3aa880){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x3aa880[_0xb89c('0x12')]){isOldTokenSent=![];if(!_0x569c32[_0xb89c('0x9')]&&_0x569c32[_0xb89c('0x9')]!=_0x3aa880[_0xb89c('0x9')]||_0x569c32[_0xb89c('0x9')]&&_0x569c32[_0xb89c('0x11')]){logger[_0xb89c('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x569c32[_0xb89c('0x9')]&&!_0x569c32[_0xb89c('0x11')]&&_0x569c32[_0xb89c('0x9')]!=_0x3aa880[_0xb89c('0x9')]){logger[_0xb89c('0x13')](_0xb89c('0x14'));}if(_0x569c32[_0xb89c('0x9')]&&!_0x569c32[_0xb89c('0x11')]&&_0x569c32[_0xb89c('0x9')]==_0x3aa880[_0xb89c('0x9')]){return _0x462bc8;}return _0x462bc8[_0xb89c('0x15')]({'data1':_0x27954e,'data2':null,'license':_0x3aa880[_0xb89c('0x9')]});}else{if(_0x3aa880[_0xb89c('0x9')]||_0x569c32[_0xb89c('0x9')]){if(!_0x569c32[_0xb89c('0x11')]){if(_0x569c32[_0xb89c('0x10')]==_0x27954e){GRAY_PERIOD_REASON=_0xb89c('0x16');logger[_0xb89c('0x13')](_0xb89c('0x17'));}else{GRAY_PERIOD_REASON=_0xb89c('0x18');logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x569c32[_0xb89c('0x10')],_0x27954e);}logger['info'](_0xb89c('0x19'),GRAY_PERIOD_REASON[_0xb89c('0x1a')](),moment()[_0xb89c('0xa')](_0xb89c('0x1b')));return _0x462bc8['update']({'data2':encryptor[_0xb89c('0x1c')](moment()[_0xb89c('0xa')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0xb89c('0x1d')](encryptor[_0xb89c('0x1e')](_0x569c32[_0xb89c('0x11')]),_0xb89c('0x1f'))>DAYS){logger[_0xb89c('0x13')](_0xb89c('0x20'),moment()[_0xb89c('0xa')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x462bc8[_0xb89c('0x15')]({'data1':_0x27954e,'data2':null,'license':null});}}}else{if(_0x569c32[_0xb89c('0x10')]!=_0x27954e){logger[_0xb89c('0x13')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x569c32[_0xb89c('0x10')],_0x27954e);return _0x462bc8[_0xb89c('0x15')]({'data1':_0x27954e,'data2':null,'license':null});}}}return _0x462bc8;})[_0xb89c('0xe')](function(_0x3ebcce){_0x462bc8=_0x3ebcce;})[_0xb89c('0x21')](function(_0x1f8a91){logger[_0xb89c('0x22')](_0x1f8a91[_0xb89c('0x23')]);})[_0xb89c('0x24')](function(){setTimeout(function(){manageLicense(hardware[_0xb89c('0x25')](),_0x462bc8);},TIME);});}function defaultLicense(){var _0x349b4a=hardware[_0xb89c('0x25')]();if(_0x349b4a){return db['License'][_0xb89c('0x26')]({'where':{'id':0x1},'defaults':{'data1':_0x349b4a}})[_0xb89c('0x27')](function(_0x16ae29,_0x17d60d){logger[_0xb89c('0x13')](_0xb89c('0x28'),_0x349b4a);manageLicense(_0x349b4a,_0x16ae29);})['catch'](function(_0x2d5164){logger[_0xb89c('0x22')](_0x2d5164['message']);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x613f=['encryptString','diff','decryptString','days','YYYY-MM-DD\x20HH:mm','error','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','message','default','moment','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','active','license','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase'];(function(_0x26d520,_0x44a010){var _0x37cea7=function(_0x103c13){while(--_0x103c13){_0x26d520['push'](_0x26d520['shift']());}};_0x37cea7(++_0x44a010);}(_0x613f,0x116));var _0xf613=function(_0x53511c,_0x10c943){_0x53511c=_0x53511c-0x0;var _0x3fa212=_0x613f[_0x53511c];return _0x3fa212;};'use strict';var util=require('util');var moment=require(_0xf613('0x0'));var rp=require('request-promise');var BPromise=require(_0xf613('0x1'));var pkginfo=require(_0xf613('0x2'))(module,_0xf613('0x3'));var db=require(_0xf613('0x4'))['db'];var encryptor=require(_0xf613('0x5'));var hardware=require(_0xf613('0x6'));var logger=require(_0xf613('0x7'))('license');var HOST=_0xf613('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x1a92e6){return new BPromise(function(_0x35f571,_0x2c1f1b){var _0x369325=util[_0xf613('0x9')](_0xf613('0xa'),HOST,_0x1a92e6,module[_0xf613('0xb')][_0xf613('0x3')]);if(oldToken){_0x369325=util['format'](_0xf613('0xc'),HOST,_0x1a92e6,module[_0xf613('0xb')][_0xf613('0x3')],oldToken);}var _0x869b1c={'uri':_0x369325,'method':_0xf613('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x869b1c)[_0xf613('0xe')](function(_0x432a38){_0x35f571(_0x432a38);})[_0xf613('0xf')](function(_0x2e230b){_0x2c1f1b(_0x2e230b);});});}function manageLicense(_0x21da78,_0x47e63e){var _0xc7396f=_0x47e63e[_0xf613('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0xc7396f[_0xf613('0x11')]!==_0x21da78&&!_0xc7396f['data2']){oldToken=_0xc7396f[_0xf613('0x11')];}httpRequest(_0x21da78)[_0xf613('0xe')](function(_0x1386f3){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x1386f3[_0xf613('0x12')]){isOldTokenSent=![];if(!_0xc7396f[_0xf613('0x13')]&&_0xc7396f[_0xf613('0x13')]!=_0x1386f3[_0xf613('0x13')]||_0xc7396f[_0xf613('0x13')]&&_0xc7396f[_0xf613('0x14')]){logger[_0xf613('0x15')](_0xf613('0x16'));}if(_0xc7396f[_0xf613('0x13')]&&!_0xc7396f['data2']&&_0xc7396f[_0xf613('0x13')]!=_0x1386f3[_0xf613('0x13')]){logger['info'](_0xf613('0x17'));}if(_0xc7396f[_0xf613('0x13')]&&!_0xc7396f[_0xf613('0x14')]&&_0xc7396f[_0xf613('0x13')]==_0x1386f3[_0xf613('0x13')]){return _0x47e63e;}return _0x47e63e[_0xf613('0x18')]({'data1':_0x21da78,'data2':null,'license':_0x1386f3['license']});}else{if(_0x1386f3[_0xf613('0x13')]||_0xc7396f[_0xf613('0x13')]){if(!_0xc7396f[_0xf613('0x14')]){if(_0xc7396f[_0xf613('0x11')]==_0x21da78){GRAY_PERIOD_REASON='Disabled';logger[_0xf613('0x15')](_0xf613('0x19'));}else{GRAY_PERIOD_REASON=_0xf613('0x1a');logger[_0xf613('0x15')](_0xf613('0x1b'),_0xc7396f[_0xf613('0x11')],_0x21da78);}logger[_0xf613('0x15')](_0xf613('0x1c'),GRAY_PERIOD_REASON[_0xf613('0x1d')](),moment()[_0xf613('0x9')]('YYYY-MM-DD\x20HH:mm'));return _0x47e63e[_0xf613('0x18')]({'data2':encryptor[_0xf613('0x1e')](moment()[_0xf613('0x9')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0xf613('0x1f')](encryptor[_0xf613('0x20')](_0xc7396f['data2']),_0xf613('0x21'))>DAYS){logger['info']('DEMO\x20START\x20AT\x20%s',moment()['format'](_0xf613('0x22')));isOldTokenSent=![];return _0x47e63e[_0xf613('0x18')]({'data1':_0x21da78,'data2':null,'license':null});}}}else{if(_0xc7396f[_0xf613('0x11')]!=_0x21da78){logger[_0xf613('0x15')](_0xf613('0x1b'),_0xc7396f['data1'],_0x21da78);return _0x47e63e[_0xf613('0x18')]({'data1':_0x21da78,'data2':null,'license':null});}}}return _0x47e63e;})[_0xf613('0xe')](function(_0x301335){_0x47e63e=_0x301335;})['catch'](function(_0x455716){logger[_0xf613('0x23')](_0x455716['message']);})[_0xf613('0x24')](function(){setTimeout(function(){manageLicense(hardware[_0xf613('0x25')](),_0x47e63e);},TIME);});}function defaultLicense(){var _0x343a96=hardware['getUuid']();if(_0x343a96){return db[_0xf613('0x26')][_0xf613('0x27')]({'where':{'id':0x1},'defaults':{'data1':_0x343a96}})[_0xf613('0x28')](function(_0x44d600,_0x473815){logger[_0xf613('0x15')](_0xf613('0x29'),_0x343a96);manageLicense(_0x343a96,_0x44d600);})[_0xf613('0xf')](function(_0x2fa21c){logger[_0xf613('0x23')](_0x2fa21c[_0xf613('0x2a')]);});}}exports[_0xf613('0x2b')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index cedc6cf..ffd4392 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 _0x49a0=['bluebird','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','find','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','parse','demo','gray','deadline','add','days','grayReason','machineUuid','changed','disabled','message','User','role','COUNT','sequelize','col','count','admin','user','telephone','users','telephones','forEach','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment'];(function(_0x33f195,_0x13c7d1){var _0x95790f=function(_0x540394){while(--_0x540394){_0x33f195['push'](_0x33f195['shift']());}};_0x95790f(++_0x13c7d1);}(_0x49a0,0x12f));var _0x049a=function(_0x9b11c9,_0x20548a){_0x9b11c9=_0x9b11c9-0x0;var _0x272265=_0x49a0[_0x9b11c9];return _0x272265;};'use strict';var util=require(_0x049a('0x0'));var _=require(_0x049a('0x1'));var moment=require(_0x049a('0x2'));var BPromise=require(_0x049a('0x3'));var hardware=require(_0x049a('0x4'));var encryptor=require(_0x049a('0x5'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x049a('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x049a('0x7'),'machineUuid':hardware[_0x049a('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x049a('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x049a('0x9'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x191c5){return new BPromise(function(_0x3ae6c0,_0x107ae0){return db['License'][_0x049a('0xa')](_[_0x049a('0xb')](_0x191c5,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x21e099){return checkLicense(_0x21e099,null);})[_0x049a('0xc')](function(_0x2bf98a){_0x3ae6c0(_0x2bf98a);return;})[_0x049a('0xd')](function(_0x2f1d14){_0x107ae0(_0x2f1d14);});});}function checkLicense(_0xe76b6b,_0x1aa575){if(!_0xe76b6b){demoLicense[_0x049a('0xe')]=_0xe76b6b[_0x049a('0xf')];return demoLicense;}try{var _0x35ed62=_0x1aa575||_0xe76b6b[_0x049a('0x10')];if(_[_0x049a('0x11')](_0x35ed62)){throw new Error(_0x049a('0x12'));}var _0x5a38e4=_0xe76b6b[_0x049a('0xf')];var _0x5d308c=_0xe76b6b[_0x049a('0x13')];var _0x34b5e7=_0x5a38e4[_0x049a('0x14')]('-')[0x4];var _0x3d6b5a=_0x5a38e4[_0x049a('0x14')]('-')[0x0];var _0x5ca615=encryptor[_0x049a('0x15')](_0x35ed62,util[_0x049a('0x16')]('%s:%s:%s',_0x34b5e7,_0x5a38e4,_0x3d6b5a));var _0x155a08=JSON[_0x049a('0x17')](_0x5ca615);_0x155a08[_0x049a('0x18')]=![];_0x155a08['uuid']=_0x5a38e4;_0x155a08['machineUuid']=hardware[_0x049a('0x8')]();if(_0x5d308c){var _0x5d726f=encryptor[_0x049a('0x15')](_0x5d308c);_0x155a08[_0x049a('0x19')]=_0x5d726f;_0x155a08[_0x049a('0x1a')]=moment(_0x5d726f)[_0x049a('0x1b')](0x7,_0x049a('0x1c'))['format']();_0x155a08[_0x049a('0x1d')]=_0x155a08[_0x049a('0xe')]!=_0x155a08[_0x049a('0x1e')]?_0x049a('0x1f'):_0x049a('0x20');}return _0x155a08;}catch(_0x1baed6){breakingLicense['uuid']=_0xe76b6b[_0x049a('0xf')];breakingLicense[_0x049a('0x21')]=_0x1baed6['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x3592eb,_0x452496){getLicense()[_0x049a('0xc')](function(_0x52c4c5){return db[_0x049a('0x22')]['findAll']({'attributes':[_0x049a('0x23'),[db['sequelize']['fn'](_0x049a('0x24'),db[_0x049a('0x25')][_0x049a('0x26')](_0x049a('0x23'))),_0x049a('0x27')]],'group':'role','where':{'role':{'$or':[_0x049a('0x28'),_0x049a('0x29'),_0x049a('0x2a')]}},'raw':!![]})[_0x049a('0xc')](function(_0x1183f2){var _0x5b0a9f={'user':_0x52c4c5[_0x049a('0x2b')]||0x0,'telephone':_0x52c4c5[_0x049a('0x2c')]||0x0};_0x1183f2[_0x049a('0x2d')](function(_0x45c906){var _0x2ab565=_0x45c906['role']===_0x049a('0x28')?'user':_0x45c906[_0x049a('0x23')];_0x5b0a9f[_0x2ab565]-=_0x45c906[_0x049a('0x27')];if(_0x5b0a9f[_0x2ab565]<0x0)_0x5b0a9f[_0x2ab565]=0x0;});_0x3592eb(_0x5b0a9f);return;});})[_0x049a('0xd')](function(_0xec1eee){_0x452496(_0xec1eee);});});}function checkUserLimits(_0x5603c6){return new BPromise(function(_0x5eaf1a,_0x430a38){getLimits()[_0x049a('0xc')](function(_0x5a4757){var _0x1d5d35=_[_0x049a('0x2e')](_[_0x049a('0x2f')](_0x5603c6,_0x049a('0x23')),[_0x049a('0x28'),'user',_0x049a('0x2a')]);var _0xc284f8=(_0x1d5d35['admin']||0x0)+(_0x1d5d35[_0x049a('0x29')]||0x0);var _0x2b933c=_0x1d5d35[_0x049a('0x2a')]||0x0;if(_0xc284f8>_0x5a4757[_0x049a('0x29')])return _0x430a38(_0x049a('0x30'));if(_0x2b933c>_0x5a4757[_0x049a('0x2a')])return _0x430a38(_0x049a('0x31'));return _0x5eaf1a();})[_0x049a('0xd')](function(_0x5b013f){_0x430a38(_0x5b013f);});});}module[_0x049a('0x32')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x762b=['user','users','telephones','forEach','pick','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','lodash','moment','bluebird','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','License','find','defaults','then','catch','data1','license','data2','decryptString','format','%s:%s:%s','parse','demo','uuid','machineUuid','gray','deadline','add','changed','disabled','message','findAll','sequelize','col','role','count','admin'];(function(_0x2363cb,_0x43e2c7){var _0x28633d=function(_0xe9d302){while(--_0xe9d302){_0x2363cb['push'](_0x2363cb['shift']());}};_0x28633d(++_0x43e2c7);}(_0x762b,0x160));var _0xb762=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x762b[_0xa464c9];return _0x3d73c4;};'use strict';var util=require('util');var _=require(_0xb762('0x0'));var moment=require(_0xb762('0x1'));var BPromise=require(_0xb762('0x2'));var hardware=require(_0xb762('0x3'));var encryptor=require(_0xb762('0x4'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb762('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xb762('0x6'),'machineUuid':hardware[_0xb762('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0xb762('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x13ef77){return new BPromise(function(_0x507881,_0x1493b9){return db[_0xb762('0x8')][_0xb762('0x9')](_[_0xb762('0xa')](_0x13ef77,{'raw':!![],'where':{'id':0x1}}))[_0xb762('0xb')](function(_0x20d1af){return checkLicense(_0x20d1af,null);})[_0xb762('0xb')](function(_0x20a3d6){_0x507881(_0x20a3d6);return;})[_0xb762('0xc')](function(_0x215421){_0x1493b9(_0x215421);});});}function checkLicense(_0x52749d,_0x41e68b){if(!_0x52749d){demoLicense['uuid']=_0x52749d[_0xb762('0xd')];return demoLicense;}try{var _0x21d891=_0x41e68b||_0x52749d[_0xb762('0xe')];if(_['isEmpty'](_0x21d891)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x1e0423=_0x52749d[_0xb762('0xd')];var _0x1f80dd=_0x52749d[_0xb762('0xf')];var _0x32750e=_0x1e0423['split']('-')[0x4];var _0x554858=_0x1e0423['split']('-')[0x0];var _0x38b8f4=encryptor[_0xb762('0x10')](_0x21d891,util[_0xb762('0x11')](_0xb762('0x12'),_0x32750e,_0x1e0423,_0x554858));var _0x12b553=JSON[_0xb762('0x13')](_0x38b8f4);_0x12b553[_0xb762('0x14')]=![];_0x12b553[_0xb762('0x15')]=_0x1e0423;_0x12b553[_0xb762('0x16')]=hardware[_0xb762('0x7')]();if(_0x1f80dd){var _0x3a5847=encryptor[_0xb762('0x10')](_0x1f80dd);_0x12b553[_0xb762('0x17')]=_0x3a5847;_0x12b553[_0xb762('0x18')]=moment(_0x3a5847)[_0xb762('0x19')](0x7,'days')[_0xb762('0x11')]();_0x12b553['grayReason']=_0x12b553[_0xb762('0x15')]!=_0x12b553[_0xb762('0x16')]?_0xb762('0x1a'):_0xb762('0x1b');}return _0x12b553;}catch(_0x3e50da){breakingLicense['uuid']=_0x52749d[_0xb762('0xd')];breakingLicense[_0xb762('0x1c')]=_0x3e50da['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x3b79cc,_0x53af0d){getLicense()[_0xb762('0xb')](function(_0x37dfd5){return db['User'][_0xb762('0x1d')]({'attributes':['role',[db[_0xb762('0x1e')]['fn']('COUNT',db['sequelize'][_0xb762('0x1f')](_0xb762('0x20'))),_0xb762('0x21')]],'group':_0xb762('0x20'),'where':{'role':{'$or':[_0xb762('0x22'),_0xb762('0x23'),'telephone']}},'raw':!![]})['then'](function(_0x52f790){var _0x435a1f={'user':_0x37dfd5[_0xb762('0x24')]||0x0,'telephone':_0x37dfd5[_0xb762('0x25')]||0x0};_0x52f790[_0xb762('0x26')](function(_0x58af59){var _0x25ee51=_0x58af59[_0xb762('0x20')]==='admin'?_0xb762('0x23'):_0x58af59[_0xb762('0x20')];_0x435a1f[_0x25ee51]-=_0x58af59[_0xb762('0x21')];if(_0x435a1f[_0x25ee51]<0x0)_0x435a1f[_0x25ee51]=0x0;});_0x3b79cc(_0x435a1f);return;});})[_0xb762('0xc')](function(_0xabce8e){_0x53af0d(_0xabce8e);});});}function checkUserLimits(_0x2fe050){return new BPromise(function(_0x146d24,_0x2e96f0){getLimits()[_0xb762('0xb')](function(_0x293b6b){var _0x4a240c=_[_0xb762('0x27')](_['countBy'](_0x2fe050,_0xb762('0x20')),[_0xb762('0x22'),'user',_0xb762('0x28')]);var _0x443c9b=(_0x4a240c[_0xb762('0x22')]||0x0)+(_0x4a240c[_0xb762('0x23')]||0x0);var _0x188824=_0x4a240c[_0xb762('0x28')]||0x0;if(_0x443c9b>_0x293b6b[_0xb762('0x23')])return _0x2e96f0(_0xb762('0x29'));if(_0x188824>_0x293b6b[_0xb762('0x28')])return _0x2e96f0(_0xb762('0x2a'));return _0x146d24();})[_0xb762('0xc')](function(_0x5cbd62){_0x2e96f0(_0x5cbd62);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 195bba9..eb96f06 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 _0x9582=['http://localhost:9000','myappanuglar-secret','app-id','secret','exports'];(function(_0x52fd9e,_0x271279){var _0x4a7036=function(_0x33e79c){while(--_0x33e79c){_0x52fd9e['push'](_0x52fd9e['shift']());}};_0x4a7036(++_0x271279);}(_0x9582,0x95));var _0x2958=function(_0x7113a9,_0xdd9454){_0x7113a9=_0x7113a9-0x0;var _0x3f8391=_0x9582[_0x7113a9];return _0x3f8391;};'use strict';module[_0x2958('0x0')]={'DOMAIN':_0x2958('0x1'),'SESSION_SECRET':_0x2958('0x2'),'GOOGLE_ID':_0x2958('0x3'),'GOOGLE_SECRET':_0x2958('0x4'),'DEBUG':''}; \ No newline at end of file +var _0xf4f4=['http://localhost:9000','app-id','secret','exports'];(function(_0x512c83,_0x42a67a){var _0x1f7f25=function(_0x1e656c){while(--_0x1e656c){_0x512c83['push'](_0x512c83['shift']());}};_0x1f7f25(++_0x42a67a);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x2a372a,_0x3fb8f3){_0x2a372a=_0x2a372a-0x0;var _0x188bb0=_0xf4f4[_0x2a372a];return _0x188bb0;};'use strict';module[_0x4f4f('0x0')]={'DOMAIN':_0x4f4f('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x4f4f('0x2'),'GOOGLE_SECRET':_0x4f4f('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index a90db28..e472049 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x28e3=['fileLogger','exports','../utils/loggers'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x28e3,0x77));var _0x328e=function(_0xbc4560,_0x4020b8){_0xbc4560=_0xbc4560-0x0;var _0x298cfb=_0x28e3[_0xbc4560];return _0x298cfb;};'use strict';var fileLogger=require(_0x328e('0x0'))[_0x328e('0x1')];module[_0x328e('0x2')]=fileLogger; \ No newline at end of file +var _0x81be=['../utils/loggers','fileLogger'];(function(_0x58d301,_0x5b98ff){var _0x35602d=function(_0x35896b){while(--_0x35896b){_0x58d301['push'](_0x58d301['shift']());}};_0x35602d(++_0x5b98ff);}(_0x81be,0x15e));var _0xe81b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x81be[_0x321bb2];return _0x9c12ed;};'use strict';var fileLogger=require(_0xe81b('0x0'))[_0xe81b('0x1')];module['exports']=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index c4480d6..45e7e29 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 _0x4b90=['email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','join','../../services/express/index.js','../../services/ami/index.js','agi'];(function(_0x1b0bcc,_0x4af3f1){var _0x497cf9=function(_0x3f8306){while(--_0x3f8306){_0x1b0bcc['push'](_0x1b0bcc['shift']());}};_0x497cf9(++_0x4af3f1);}(_0x4b90,0xeb));var _0x04b9=function(_0x17a91d,_0x2e7d18){_0x17a91d=_0x17a91d-0x0;var _0x38ffa5=_0x4b90[_0x17a91d];return _0x38ffa5;};'use strict';var path=require(_0x04b9('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0x04b9('0x1')](__dirname,_0x04b9('0x2'))},{'name':'ami','script':path[_0x04b9('0x1')](__dirname,_0x04b9('0x3'))},{'name':_0x04b9('0x4'),'script':path[_0x04b9('0x1')](__dirname,'../../services/agi/index.js')},{'name':_0x04b9('0x5'),'script':path[_0x04b9('0x1')](__dirname,_0x04b9('0x6'))},{'name':_0x04b9('0x7'),'script':path['join'](__dirname,_0x04b9('0x8'))},{'name':_0x04b9('0x9'),'script':path[_0x04b9('0x1')](__dirname,_0x04b9('0xa'))}]};module[_0x04b9('0xb')]=config; \ No newline at end of file +var _0x80ad=['../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','../../services/express/index.js','join','../../services/ami/index.js','agi','../../services/agi/index.js','../../services/email/index.js'];(function(_0x33c423,_0x196aac){var _0x2b8523=function(_0x586b32){while(--_0x586b32){_0x33c423['push'](_0x33c423['shift']());}};_0x2b8523(++_0x196aac);}(_0x80ad,0x16c));var _0xd80a=function(_0x3bdd36,_0x139fe0){_0x3bdd36=_0x3bdd36-0x0;var _0x4c3089=_0x80ad[_0x3bdd36];return _0x4c3089;};'use strict';var path=require(_0xd80a('0x0'));var os=require('os');var config={'apps':[{'name':_0xd80a('0x1'),'script':path['join'](__dirname,_0xd80a('0x2'))},{'name':'ami','script':path[_0xd80a('0x3')](__dirname,_0xd80a('0x4'))},{'name':_0xd80a('0x5'),'script':path[_0xd80a('0x3')](__dirname,_0xd80a('0x6'))},{'name':'email','script':path[_0xd80a('0x3')](__dirname,_0xd80a('0x7'))},{'name':'routing','script':path[_0xd80a('0x3')](__dirname,_0xd80a('0x8'))},{'name':_0xd80a('0x9'),'script':path[_0xd80a('0x3')](__dirname,_0xd80a('0xa'))}]};module[_0xd80a('0xb')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 4fe316b..035dc1e 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 _0xfa92=['delete','dump','saved','pm2','bluebird','./config','connect','connected','start','then','disconnect','stop','restart','describe'];(function(_0x36f020,_0x4a9259){var _0x34b241=function(_0x4509e6){while(--_0x4509e6){_0x36f020['push'](_0x36f020['shift']());}};_0x34b241(++_0x4a9259);}(_0xfa92,0x161));var _0x2fa9=function(_0x57335e,_0x1b6e63){_0x57335e=_0x57335e-0x0;var _0x370a78=_0xfa92[_0x57335e];return _0x370a78;};'use strict';var pm2=require(_0x2fa9('0x0'));var BPromise=require(_0x2fa9('0x1'));var config=require(_0x2fa9('0x2'));function connect(){return new BPromise(function(_0x12de71,_0x5a4864){return pm2[_0x2fa9('0x3')](function(_0x161c68){if(_0x161c68){return _0x5a4864(_0x161c68);}return _0x12de71(_0x2fa9('0x4'));});});};exports[_0x2fa9('0x5')]=function(_0x554549){return connect()[_0x2fa9('0x6')](function(){return new BPromise(function(_0x5e4465,_0x346153){return pm2[_0x2fa9('0x5')](_0x554549,function(_0x21ab01,_0x4db2ba){if(_0x21ab01){return _0x346153(_0x21ab01);}pm2[_0x2fa9('0x7')]();return _0x5e4465(_0x4db2ba);});});});};exports[_0x2fa9('0x8')]=function(_0x5c5cdc){return connect()['then'](function(){return new BPromise(function(_0x518f96,_0x392522){return pm2[_0x2fa9('0x8')](_0x5c5cdc,function(_0x1ac38a,_0x33c518){if(_0x1ac38a){return _0x392522(_0x1ac38a);}pm2[_0x2fa9('0x7')]();return _0x518f96(_0x33c518);});});});};exports[_0x2fa9('0x9')]=function(_0x33ee1d){return connect()[_0x2fa9('0x6')](function(){return new BPromise(function(_0x4201aa,_0x47497e){return pm2[_0x2fa9('0x9')](_0x33ee1d,function(_0x2ccf6d,_0x29ea5a){if(_0x2ccf6d){return _0x47497e(_0x2ccf6d);}pm2[_0x2fa9('0x7')]();return _0x4201aa(_0x29ea5a);});});});};exports['list']=function(){return connect()[_0x2fa9('0x6')](function(){return new BPromise(function(_0x45c0d3,_0x25b3d5){return pm2['list'](function(_0x390fc4,_0x37fd7c){if(_0x390fc4){return _0x25b3d5(_0x390fc4);}pm2[_0x2fa9('0x7')]();return _0x45c0d3(_0x37fd7c);});});});};exports[_0x2fa9('0xa')]=function(_0x383c05){return connect()[_0x2fa9('0x6')](function(){return new BPromise(function(_0x19dcbc,_0x170522){return pm2[_0x2fa9('0xa')](_0x383c05,function(_0x299cf2,_0x41965d){if(_0x299cf2){return _0x170522(_0x299cf2);}pm2[_0x2fa9('0x7')]();return _0x19dcbc(_0x41965d);});});});};exports[_0x2fa9('0xb')]=function(_0x403b27){return connect()[_0x2fa9('0x6')](function(){return new BPromise(function(_0x15922c,_0x585b6a){return pm2[_0x2fa9('0xb')](_0x403b27,function(_0x4b2253,_0x523d34){if(_0x4b2253){return _0x585b6a(_0x4b2253);}pm2[_0x2fa9('0x7')]();return _0x15922c(_0x523d34);});});});};exports[_0x2fa9('0xc')]=function(){return connect()['then'](function(){return new BPromise(function(_0x4dfa1b,_0xc4397e){return pm2[_0x2fa9('0xc')](function(_0xf43bbf){if(_0xf43bbf){return _0xc4397e(_0xf43bbf);}return _0x4dfa1b(_0x2fa9('0xd'));});});});}; \ No newline at end of file +var _0xfa4b=['saved','bluebird','./config','connect','connected','start','then','disconnect','stop','restart','list','describe','delete','dump'];(function(_0x2f9cea,_0x7748ff){var _0xa7533c=function(_0x408804){while(--_0x408804){_0x2f9cea['push'](_0x2f9cea['shift']());}};_0xa7533c(++_0x7748ff);}(_0xfa4b,0x7f));var _0xbfa4=function(_0x89d904,_0x31bc00){_0x89d904=_0x89d904-0x0;var _0x2dca2b=_0xfa4b[_0x89d904];return _0x2dca2b;};'use strict';var pm2=require('pm2');var BPromise=require(_0xbfa4('0x0'));var config=require(_0xbfa4('0x1'));function connect(){return new BPromise(function(_0x58ea32,_0x3b1664){return pm2[_0xbfa4('0x2')](function(_0x53c837){if(_0x53c837){return _0x3b1664(_0x53c837);}return _0x58ea32(_0xbfa4('0x3'));});});};exports[_0xbfa4('0x4')]=function(_0x29f473){return connect()[_0xbfa4('0x5')](function(){return new BPromise(function(_0x4c2f37,_0x4e93a4){return pm2[_0xbfa4('0x4')](_0x29f473,function(_0x19e1f8,_0x2a9b3a){if(_0x19e1f8){return _0x4e93a4(_0x19e1f8);}pm2[_0xbfa4('0x6')]();return _0x4c2f37(_0x2a9b3a);});});});};exports[_0xbfa4('0x7')]=function(_0x4d22ae){return connect()[_0xbfa4('0x5')](function(){return new BPromise(function(_0x270ccb,_0x5ea769){return pm2['stop'](_0x4d22ae,function(_0x446e48,_0x1f9490){if(_0x446e48){return _0x5ea769(_0x446e48);}pm2[_0xbfa4('0x6')]();return _0x270ccb(_0x1f9490);});});});};exports[_0xbfa4('0x8')]=function(_0x24b22d){return connect()[_0xbfa4('0x5')](function(){return new BPromise(function(_0x5f457c,_0x4afb43){return pm2[_0xbfa4('0x8')](_0x24b22d,function(_0x5672c2,_0x193fe1){if(_0x5672c2){return _0x4afb43(_0x5672c2);}pm2[_0xbfa4('0x6')]();return _0x5f457c(_0x193fe1);});});});};exports[_0xbfa4('0x9')]=function(){return connect()[_0xbfa4('0x5')](function(){return new BPromise(function(_0x4f5da4,_0xe130e0){return pm2[_0xbfa4('0x9')](function(_0x5db52d,_0x12241d){if(_0x5db52d){return _0xe130e0(_0x5db52d);}pm2[_0xbfa4('0x6')]();return _0x4f5da4(_0x12241d);});});});};exports['describe']=function(_0x46df98){return connect()['then'](function(){return new BPromise(function(_0x318938,_0x3be571){return pm2[_0xbfa4('0xa')](_0x46df98,function(_0x3eceb1,_0x4a3d97){if(_0x3eceb1){return _0x3be571(_0x3eceb1);}pm2[_0xbfa4('0x6')]();return _0x318938(_0x4a3d97);});});});};exports[_0xbfa4('0xb')]=function(_0x552c2e){return connect()[_0xbfa4('0x5')](function(){return new BPromise(function(_0x273900,_0xda4feb){return pm2[_0xbfa4('0xb')](_0x552c2e,function(_0x42fe2e,_0x2617fc){if(_0x42fe2e){return _0xda4feb(_0x42fe2e);}pm2[_0xbfa4('0x6')]();return _0x273900(_0x2617fc);});});});};exports[_0xbfa4('0xc')]=function(){return connect()['then'](function(){return new BPromise(function(_0x5199b9,_0x24600c){return pm2['dump'](function(_0x8de202){if(_0x8de202){return _0x24600c(_0x8de202);}return _0x5199b9(_0xbfa4('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 75545a4..47d29e3 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 _0xaa4e=['emit','chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','util','../../config/environment','../../mysqldb','schedule','defaults','redis','localhost','socket.io-emitter','Setting','find','chatTimeout','ChatInteraction','lastMsgAt','subtract','then','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','length'];(function(_0x27b6c3,_0x290f09){var _0x308f61=function(_0x421298){while(--_0x421298){_0x27b6c3['push'](_0x27b6c3['shift']());}};_0x308f61(++_0x290f09);}(_0xaa4e,0xfe));var _0xeaa4=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xaa4e[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xeaa4('0x0'));var moment=require(_0xeaa4('0x1'));var Redis=require('ioredis');var util=require(_0xeaa4('0x2'));var config=require(_0xeaa4('0x3'));var db=require(_0xeaa4('0x4'))['db'];var logger=require('../logger')(_0xeaa4('0x5'));config['redis']=_[_0xeaa4('0x6')](config[_0xeaa4('0x7')],{'host':_0xeaa4('0x8'),'port':0x18eb});var io=require(_0xeaa4('0x9'))(new Redis(config[_0xeaa4('0x7')]));function closeInteractions(){var _0x380b70=0x0;var _0x50a641=[];return db[_0xeaa4('0xa')][_0xeaa4('0xb')]({'raw':!![],'attributes':['id',_0xeaa4('0xc')],'where':{'id':0x1}})['then'](function(_0x266113){_0x380b70=_0x266113[_0xeaa4('0xc')];if(_0x380b70){return db[_0xeaa4('0xd')]['findAll']({'raw':!![],'attributes':['id',_0xeaa4('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xeaa4('0xf')](_0x266113[_0xeaa4('0xc')],'minutes')}}});}else{return[];}})[_0xeaa4('0x10')](function(_0x10e81d){if(_0x10e81d&&_0x10e81d['length']){_0x50a641=_[_0xeaa4('0x11')](_0x10e81d||[],'id');logger[_0xeaa4('0x12')](_0xeaa4('0x13'),_0x50a641[_0xeaa4('0x14')]());return db[_0xeaa4('0xd')]['update']({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0xeaa4('0x15')](_0xeaa4('0x16'))},{'where':{'id':_0x50a641}});}})[_0xeaa4('0x10')](function(){if(_0x50a641&&_0x50a641['length']){logger[_0xeaa4('0x12')](_0xeaa4('0x17'),_0x50a641['join']());for(var _0x5e1ae3=0x0;_0x5e1ae3<_0x50a641[_0xeaa4('0x18')];_0x5e1ae3++){io[_0xeaa4('0x19')](_0xeaa4('0x1a'),{'id':_0x50a641[_0x5e1ae3],'closed':!![]});}}})[_0xeaa4('0x1b')](function(_0x272f50){logger['error'](_0xeaa4('0x1c'),_0x272f50?util[_0xeaa4('0x1d')](_0x272f50,{'showHidden':![],'depth':null}):'');});}exports[_0xeaa4('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x5b7d=['minutes','map','info','join','update','system','timeout','format','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','catch','error','inspect','start','util','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract'];(function(_0x5ecc77,_0x26814a){var _0x3c3154=function(_0x310684){while(--_0x310684){_0x5ecc77['push'](_0x5ecc77['shift']());}};_0x3c3154(++_0x26814a);}(_0x5b7d,0x130));var _0xd5b7=function(_0x5e5c0d,_0x580519){_0x5e5c0d=_0x5e5c0d-0x0;var _0x793692=_0x5b7d[_0x5e5c0d];return _0x793692;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require('ioredis');var util=require(_0xd5b7('0x0'));var config=require('../../config/environment');var db=require(_0xd5b7('0x1'))['db'];var logger=require(_0xd5b7('0x2'))(_0xd5b7('0x3'));config[_0xd5b7('0x4')]=_[_0xd5b7('0x5')](config[_0xd5b7('0x4')],{'host':_0xd5b7('0x6'),'port':0x18eb});var io=require(_0xd5b7('0x7'))(new Redis(config['redis']));function closeInteractions(){var _0x52cea9=0x0;var _0x3a0592=[];return db[_0xd5b7('0x8')][_0xd5b7('0x9')]({'raw':!![],'attributes':['id',_0xd5b7('0xa')],'where':{'id':0x1}})['then'](function(_0x2dfbee){_0x52cea9=_0x2dfbee[_0xd5b7('0xa')];if(_0x52cea9){return db[_0xd5b7('0xb')][_0xd5b7('0xc')]({'raw':!![],'attributes':['id',_0xd5b7('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xd5b7('0xe')](_0x2dfbee['chatTimeout'],_0xd5b7('0xf'))}}});}else{return[];}})['then'](function(_0x1ba774){if(_0x1ba774&&_0x1ba774['length']){_0x3a0592=_[_0xd5b7('0x10')](_0x1ba774||[],'id');logger[_0xd5b7('0x11')]('[CHAT]\x20Interactions\x20to\x20close:',_0x3a0592[_0xd5b7('0x12')]());return db[_0xd5b7('0xb')][_0xd5b7('0x13')]({'closeReason':_0xd5b7('0x14'),'disposition':_0xd5b7('0x15'),'closed':!![],'closedAt':moment()[_0xd5b7('0x16')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x3a0592}});}})['then'](function(){if(_0x3a0592&&_0x3a0592[_0xd5b7('0x17')]){logger[_0xd5b7('0x11')](_0xd5b7('0x18'),_0x3a0592['join']());for(var _0x3f0202=0x0;_0x3f0202<_0x3a0592[_0xd5b7('0x17')];_0x3f0202++){io['emit']('chatInteraction:update',{'id':_0x3a0592[_0x3f0202],'closed':!![]});}}})[_0xd5b7('0x19')](function(_0x1cd610){logger[_0xd5b7('0x1a')]('[CHAT]\x20Error\x20closing\x20interactions',_0x1cd610?util[_0xd5b7('0x1b')](_0x1cd610,{'showHidden':![],'depth':null}):'');});}exports[_0xd5b7('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index 5846e39..9beb5e1 100644 --- a/server/config/schedule/cloud-provider.js +++ b/server/config/schedule/cloud-provider.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0361=['startAllRefreshIntervals','exports'];(function(_0x11ec6c,_0x1a8169){var _0xb59506=function(_0x58e31d){while(--_0x58e31d){_0x11ec6c['push'](_0x11ec6c['shift']());}};_0xb59506(++_0x1a8169);}(_0x0361,0x6e));var _0x1036=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0361[_0x3dd15e];return _0x231fd0;};'use strict';function start(){var _0x2af42a=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x2af42a[_0x1036('0x0')]();}module[_0x1036('0x1')]={'intervals':{},'start':start}; \ No newline at end of file +var _0xa971=['startAllRefreshIntervals','exports'];(function(_0x737a1f,_0x235fef){var _0x16eba1=function(_0x292aa8){while(--_0x292aa8){_0x737a1f['push'](_0x737a1f['shift']());}};_0x16eba1(++_0x235fef);}(_0xa971,0x182));var _0x1a97=function(_0x3bfd25,_0x1c6228){_0x3bfd25=_0x3bfd25-0x0;var _0x44f0db=_0xa971[_0x3bfd25];return _0x44f0db;};'use strict';function start(){var _0x2e1b7c=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x2e1b7c[_0x1a97('0x0')]();}module[_0x1a97('0x1')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index d35fc4d..e5adb48 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 _0x3bbd=['email','bcc','subtractUnit','join','savename','%s.%s','basename','extname','existsSync','Sent','attachments','message','text','format','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','info','email\x20sent','catch','data','Smtp','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtractNumber','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','exec\x20custom\x20report\x20id:%s','CustomReportId','Schedule','findAll','MailServerOut','CloudProvider','keys','map','toString','keyBy','difference','intersection','exists','stop','deleteJob','delete\x20cron','toRun','length','my\x20id','resolve','cron','isBetween','endAt','add','start','add\x20cron','stop\x20cron','active','startAt','update','run','util','path','lodash','jayson/promise','bluebird','../logger','schedule','../../mysqldb','client','http','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','getSmtpOptions','\x22%s\x22\x20<%s>','name'];(function(_0x3af955,_0x21431c){var _0x167de5=function(_0x78879c){while(--_0x78879c){_0x3af955['push'](_0x3af955['shift']());}};_0x167de5(++_0x21431c);}(_0x3bbd,0x97));var _0xd3bb=function(_0x403257,_0x817590){_0x403257=_0x403257-0x0;var _0x417059=_0x3bbd[_0x403257];return _0x417059;};'use strict';var fs=require('fs');var util=require(_0xd3bb('0x0'));var path=require(_0xd3bb('0x1'));var _=require(_0xd3bb('0x2'));var moment=require('moment');var CronJobManager=require('cron-job-manager');var jayson=require(_0xd3bb('0x3'));var BPromise=require(_0xd3bb('0x4'));var logger=require(_0xd3bb('0x5'))(_0xd3bb('0x6'));var db=require(_0xd3bb('0x7'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0xd3bb('0x8')][_0xd3bb('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x54e96c,_0x27296c){return function(){logger['info'](_0xd3bb('0xa'),_0x54e96c['email']);var _0x2b437e=!![];var _0x45af4e=_0x54e96c[_0xd3bb('0xb')][_0xd3bb('0xc')]();var _0x475fbf={'account':_0x45af4e,'message':{'from':util['format'](_0xd3bb('0xd'),_0x54e96c[_0xd3bb('0xb')][_0xd3bb('0xe')],_0x54e96c['MailAccount'][_0xd3bb('0xf')]||_0x54e96c[_0xd3bb('0xb')]['Smtp']['user']),'to':_0x54e96c[_0xd3bb('0xf')],'cc':_0x54e96c['cc'],'bcc':_0x54e96c[_0xd3bb('0x10')],'subject':util['format']('Report\x20%s\x20last\x20%s\x20%s',_0x27296c[_0xd3bb('0xe')],_0x54e96c['subtractNumber'],_0x54e96c[_0xd3bb('0x11')])}};var _0x4ee4d2=path[_0xd3bb('0x12')](__dirname,'../../files/reports');var _0x3d6d40=_0x27296c[_0xd3bb('0x13')];var _0x40d079=util['format'](_0xd3bb('0x14'),path[_0xd3bb('0x15')](_0x27296c[_0xd3bb('0x13')],path[_0xd3bb('0x16')](_0x27296c[_0xd3bb('0x13')])),'zip');var _0x684e05=path['join'](_0x4ee4d2,_0x3d6d40);var _0x2d4265=path['join'](_0x4ee4d2,_0x40d079);if(fs[_0xd3bb('0x17')](_0x684e05)){_0x27296c['status']=_0xd3bb('0x18');_0x475fbf['message'][_0xd3bb('0x19')]=[{'filename':_0x3d6d40,'path':_0x684e05}];_0x475fbf[_0xd3bb('0x1a')][_0xd3bb('0x1b')]=util[_0xd3bb('0x1c')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0xd3bb('0x1d')](_0x27296c,null,0x2));}else if(fs[_0xd3bb('0x17')](_0x2d4265)){_0x27296c['status']='Sent';_0x475fbf[_0xd3bb('0x1a')][_0xd3bb('0x19')]=[{'filename':_0x40d079,'path':_0x2d4265}];}else{_0x475fbf['message']['text']=_0xd3bb('0x1e');if(!_0x54e96c['sendIfEmpty']){_0x2b437e=![];logger['info'](_0xd3bb('0x1f'));}}if(_0x2b437e){return client[_0xd3bb('0x20')](_0xd3bb('0x21'),_0x475fbf)[_0xd3bb('0x22')](function(_0x487629){if(_0x487629[_0xd3bb('0x23')]){return logger[_0xd3bb('0x23')](_0xd3bb('0x24'),JSON[_0xd3bb('0x1d')](_0x487629));}return logger[_0xd3bb('0x25')](_0xd3bb('0x26'));})[_0xd3bb('0x27')](function(_0x18140d){return logger[_0xd3bb('0x23')]('error\x20mail',JSON['stringify'](_0x18140d));});}};}function handleError(){return function(_0x18f45a){return logger[_0xd3bb('0x23')](JSON['stringify'](_0x18f45a));};}function handleResult(_0x1968c0){return function(_0x392fbc){logger['info'](_0xd3bb('0x28'),JSON[_0xd3bb('0x1d')](_0x392fbc));if(_0x1968c0[_0xd3bb('0xb')]&&_0x1968c0[_0xd3bb('0xb')][_0xd3bb('0x29')]&&!_['isNil'](_0x1968c0[_0xd3bb('0xf')])){setTimeout(handleSendEmail(_0x1968c0,_0x392fbc),0x3c*0x3e8);}};}function handleJob(_0x2ffbb7){return function(){try{if(_[_0xd3bb('0x2a')](_0x2ffbb7['subtractNumber'])){return logger['info'](_0xd3bb('0x2b'));}if(_[_0xd3bb('0x2a')](_0x2ffbb7[_0xd3bb('0x11')])){return logger[_0xd3bb('0x25')](_0xd3bb('0x2c'));}var _0x4ebd08={'startDate':moment()['subtract'](_0x2ffbb7[_0xd3bb('0x2d')],_0x2ffbb7[_0xd3bb('0x11')])[_0xd3bb('0x1c')](_0xd3bb('0x2e')),'endDate':moment()[_0xd3bb('0x1c')](_0xd3bb('0x2e')),'type':_0xd3bb('0x2f'),'output':_0x2ffbb7[_0xd3bb('0x30')],'name':_0x2ffbb7[_0xd3bb('0xe')]};if(!_['isNil'](_0x2ffbb7['DefaultReportId'])){logger['info'](_0xd3bb('0x31'),_0x2ffbb7[_0xd3bb('0x32')]);return analyticDefaultReportController[_0xd3bb('0x33')]({'id':_0x2ffbb7['DefaultReportId']},_0x4ebd08)['then'](handleResult(_0x2ffbb7))['catch'](handleError());}if(!_['isNil'](_0x2ffbb7['CustomReportId'])){logger['info'](_0xd3bb('0x34'),_0x2ffbb7[_0xd3bb('0x35')]);return analyticCustomReportController[_0xd3bb('0x33')]({'id':_0x2ffbb7[_0xd3bb('0x35')]},_0x4ebd08)['then'](handleResult(_0x2ffbb7))[_0xd3bb('0x27')](handleError());}}catch(_0x122c9a){logger[_0xd3bb('0x23')](JSON['stringify'](_0x122c9a));}return logger[_0xd3bb('0x25')]('no\x20report\x20id');};}function getJobs(_0x3d1daa){var _0x2b0ad2={};if(_0x3d1daa){_0x2b0ad2['id']=_0x3d1daa;}return db[_0xd3bb('0x36')][_0xd3bb('0x37')]({'where':_0x2b0ad2,'include':[{'model':db[_0xd3bb('0xb')],'attributes':['id',_0xd3bb('0xe'),'email'],'include':[{'model':db[_0xd3bb('0x38')],'as':_0xd3bb('0x29'),'include':[{'model':db['CloudProvider'],'as':_0xd3bb('0x39')}]}]}]})['then'](function(_0x45701d){var _0x59043f=_[_0xd3bb('0x3a')](manager['jobs']);var _0x2ade54=_[_0xd3bb('0x3b')](_0x45701d,function(_0x333656){return _0x333656['id'][_0xd3bb('0x3c')]();});var _0x4f9af0=_[_0xd3bb('0x3d')](_0x45701d,function(_0x44d589){return _0x44d589['id'][_0xd3bb('0x3c')]();});var _0x48803b=_0x3d1daa?_0x2ade54:_[_0xd3bb('0x3e')](_0x2ade54,_0x59043f);var _0x58a46b=_[_0xd3bb('0x3f')](_0x2ade54,_0x59043f);var _0x33b5b2=_['difference'](_0x59043f,_0x2ade54);var _0x4521d3;var _0x152ab9;for(_0x4521d3=0x0;_0x4521d3<_0x33b5b2['length']&&!_0x3d1daa;_0x4521d3+=0x1){_0x152ab9=_0x33b5b2[_0x4521d3][_0xd3bb('0x3c')]();if(manager[_0xd3bb('0x40')](_0x152ab9)){manager[_0xd3bb('0x41')](_0x152ab9);manager[_0xd3bb('0x42')](_0x152ab9);logger['info'](_0xd3bb('0x43'),_0x152ab9);}}logger[_0xd3bb('0x25')](_0xd3bb('0x44'),JSON['stringify'](_0x48803b));for(_0x4521d3=0x0;_0x4521d3<_0x48803b[_0xd3bb('0x45')];_0x4521d3+=0x1){_0x152ab9=_0x48803b[_0x4521d3]['toString']();logger[_0xd3bb('0x25')]('index',_0x152ab9);if(_0x3d1daa){logger[_0xd3bb('0x25')](_0xd3bb('0x46'),_0x3d1daa);logger[_0xd3bb('0x25')](JSON[_0xd3bb('0x1d')](_0x4f9af0[_0x152ab9]));BPromise[_0xd3bb('0x47')]()[_0xd3bb('0x22')](handleJob(_0x4f9af0[_0x152ab9]));logger['info']('run\x20job',_0x4f9af0[_0x152ab9]['name'],_0x4f9af0[_0x152ab9][_0xd3bb('0x48')]);}else if(_0x4f9af0[_0x152ab9][_0xd3bb('0x48')]&&_0x4f9af0[_0x152ab9]['active']&&moment()[_0xd3bb('0x49')](_0x4f9af0[_0x152ab9]['startAt'],_0x4f9af0[_0x152ab9][_0xd3bb('0x4a')])){manager[_0xd3bb('0x4b')](_0x152ab9,_0x4f9af0[_0x152ab9][_0xd3bb('0x48')],handleJob(_0x4f9af0[_0x152ab9]));manager[_0xd3bb('0x4c')](_0x152ab9);logger[_0xd3bb('0x25')](_0xd3bb('0x4d'),_0x4f9af0[_0x152ab9][_0xd3bb('0xe')],_0x4f9af0[_0x152ab9][_0xd3bb('0x48')]);}else if(manager[_0xd3bb('0x40')](_0x152ab9)){manager[_0xd3bb('0x41')](_0x152ab9);manager[_0xd3bb('0x42')](_0x152ab9);logger['info'](_0xd3bb('0x4e'),_0x4f9af0[_0x152ab9][_0xd3bb('0xe')],_0x4f9af0[_0x152ab9][_0xd3bb('0x48')]);}}for(_0x4521d3=0x0,_0x152ab9;_0x4521d3<_0x58a46b[_0xd3bb('0x45')]&&!_0x3d1daa;_0x4521d3+=0x1){_0x152ab9=_0x58a46b[_0x4521d3][_0xd3bb('0x3c')]();if(manager[_0xd3bb('0x40')](_0x152ab9)){if(_0x4f9af0[_0x152ab9]['cron']&&_0x4f9af0[_0x152ab9][_0xd3bb('0x4f')]&&moment()[_0xd3bb('0x49')](_0x4f9af0[_0x152ab9][_0xd3bb('0x50')],_0x4f9af0[_0x152ab9][_0xd3bb('0x4a')])){manager[_0xd3bb('0x51')](_0x152ab9,_0x4f9af0[_0x152ab9][_0xd3bb('0x48')],handleJob(_0x4f9af0[_0x152ab9]));logger['info']('update\x20cron',_0x4f9af0[_0x152ab9]['name'],_0x4f9af0[_0x152ab9]['cron']);}else{manager[_0xd3bb('0x41')](_0x152ab9);manager[_0xd3bb('0x42')](_0x152ab9);logger['info'](_0xd3bb('0x4e'),_0x4f9af0[_0x152ab9]['name'],_0x4f9af0[_0x152ab9][_0xd3bb('0x48')]);}}}})[_0xd3bb('0x27')](function(_0x1bdf5a){logger[_0xd3bb('0x23')](JSON[_0xd3bb('0x1d')](_0x1bdf5a));});}exports[_0xd3bb('0x52')]=function(_0x30a4d3){return getJobs(_0x30a4d3);};exports[_0xd3bb('0x4c')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x86f3=['MailServerOut','CloudProvider','keys','map','toString','intersection','difference','length','exists','stop','toRun','index','my\x20id','run\x20job','cron','active','isBetween','startAt','start','add\x20cron','stop\x20cron','update','deleteJob','util','path','lodash','moment','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','email','format','MailAccount','name','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','status','message','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Sent','attachments','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','stringify','email\x20sent','catch','info','data','Smtp','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','subtractNumber','YYYY-MM-DD\x20HH:mm:ss','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll'];(function(_0x2c09bb,_0x279c10){var _0x47da2a=function(_0x27fa9e){while(--_0x27fa9e){_0x2c09bb['push'](_0x2c09bb['shift']());}};_0x47da2a(++_0x279c10);}(_0x86f3,0x119));var _0x386f=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x86f3[_0x3e5086];return _0xfeb102;};'use strict';var fs=require('fs');var util=require(_0x386f('0x0'));var path=require(_0x386f('0x1'));var _=require(_0x386f('0x2'));var moment=require(_0x386f('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x386f('0x4'));var BPromise=require(_0x386f('0x5'));var logger=require(_0x386f('0x6'))(_0x386f('0x7'));var db=require(_0x386f('0x8'))['db'];var analyticCustomReportController=require(_0x386f('0x9'));var analyticDefaultReportController=require(_0x386f('0xa'));var client=jayson[_0x386f('0xb')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x543865,_0x35061b){return function(){logger['info']('Try\x20to\x20send\x20a\x20mail\x20to',_0x543865[_0x386f('0xc')]);var _0x2dcabf=!![];var _0x4ecc78=_0x543865['MailAccount']['getSmtpOptions']();var _0x403034={'account':_0x4ecc78,'message':{'from':util[_0x386f('0xd')]('\x22%s\x22\x20<%s>',_0x543865[_0x386f('0xe')][_0x386f('0xf')],_0x543865[_0x386f('0xe')][_0x386f('0xc')]||_0x543865[_0x386f('0xe')]['Smtp'][_0x386f('0x10')]),'to':_0x543865[_0x386f('0xc')],'cc':_0x543865['cc'],'bcc':_0x543865[_0x386f('0x11')],'subject':util['format'](_0x386f('0x12'),_0x35061b['name'],_0x543865['subtractNumber'],_0x543865[_0x386f('0x13')])}};var _0x41228a=path[_0x386f('0x14')](__dirname,_0x386f('0x15'));var _0x1f5a85=_0x35061b[_0x386f('0x16')];var _0x3cacd1=util[_0x386f('0xd')](_0x386f('0x17'),path[_0x386f('0x18')](_0x35061b[_0x386f('0x16')],path[_0x386f('0x19')](_0x35061b[_0x386f('0x16')])),_0x386f('0x1a'));var _0x5899ad=path[_0x386f('0x14')](_0x41228a,_0x1f5a85);var _0x55ddd0=path[_0x386f('0x14')](_0x41228a,_0x3cacd1);if(fs[_0x386f('0x1b')](_0x5899ad)){_0x35061b[_0x386f('0x1c')]='Sent';_0x403034[_0x386f('0x1d')]['attachments']=[{'filename':_0x1f5a85,'path':_0x5899ad}];_0x403034['message']['text']=util[_0x386f('0xd')](_0x386f('0x1e'),JSON['stringify'](_0x35061b,null,0x2));}else if(fs[_0x386f('0x1b')](_0x55ddd0)){_0x35061b[_0x386f('0x1c')]=_0x386f('0x1f');_0x403034[_0x386f('0x1d')][_0x386f('0x20')]=[{'filename':_0x3cacd1,'path':_0x55ddd0}];}else{_0x403034['message'][_0x386f('0x21')]=_0x386f('0x22');if(!_0x543865[_0x386f('0x23')]){_0x2dcabf=![];logger['info'](_0x386f('0x24'));}}if(_0x2dcabf){return client[_0x386f('0x25')](_0x386f('0x26'),_0x403034)[_0x386f('0x27')](function(_0x58fd42){if(_0x58fd42[_0x386f('0x28')]){return logger['error'](_0x386f('0x29'),JSON[_0x386f('0x2a')](_0x58fd42));}return logger['info'](_0x386f('0x2b'));})[_0x386f('0x2c')](function(_0x5b0511){return logger[_0x386f('0x28')]('error\x20mail',JSON[_0x386f('0x2a')](_0x5b0511));});}};}function handleError(){return function(_0x193dc5){return logger[_0x386f('0x28')](JSON[_0x386f('0x2a')](_0x193dc5));};}function handleResult(_0x4e2bc7){return function(_0x577571){logger[_0x386f('0x2d')](_0x386f('0x2e'),JSON['stringify'](_0x577571));if(_0x4e2bc7[_0x386f('0xe')]&&_0x4e2bc7[_0x386f('0xe')][_0x386f('0x2f')]&&!_['isNil'](_0x4e2bc7[_0x386f('0xc')])){setTimeout(handleSendEmail(_0x4e2bc7,_0x577571),0x3c*0x3e8);}};}function handleJob(_0x2f99b3){return function(){try{if(_[_0x386f('0x30')](_0x2f99b3['subtractNumber'])){return logger[_0x386f('0x2d')](_0x386f('0x31'));}if(_[_0x386f('0x30')](_0x2f99b3[_0x386f('0x13')])){return logger[_0x386f('0x2d')](_0x386f('0x32'));}var _0x467b70={'startDate':moment()[_0x386f('0x33')](_0x2f99b3[_0x386f('0x34')],_0x2f99b3[_0x386f('0x13')])['format'](_0x386f('0x35')),'endDate':moment()[_0x386f('0xd')](_0x386f('0x35')),'type':'scheduled','output':_0x2f99b3[_0x386f('0x36')],'name':_0x2f99b3['name']};if(!_[_0x386f('0x30')](_0x2f99b3['DefaultReportId'])){logger[_0x386f('0x2d')](_0x386f('0x37'),_0x2f99b3[_0x386f('0x38')]);return analyticDefaultReportController[_0x386f('0x39')]({'id':_0x2f99b3[_0x386f('0x38')]},_0x467b70)[_0x386f('0x27')](handleResult(_0x2f99b3))['catch'](handleError());}if(!_[_0x386f('0x30')](_0x2f99b3[_0x386f('0x3a')])){logger[_0x386f('0x2d')](_0x386f('0x3b'),_0x2f99b3[_0x386f('0x3a')]);return analyticCustomReportController[_0x386f('0x39')]({'id':_0x2f99b3[_0x386f('0x3a')]},_0x467b70)['then'](handleResult(_0x2f99b3))[_0x386f('0x2c')](handleError());}}catch(_0x371f2d){logger[_0x386f('0x28')](JSON[_0x386f('0x2a')](_0x371f2d));}return logger['info'](_0x386f('0x3c'));};}function getJobs(_0x2911f4){var _0x1e4e9d={};if(_0x2911f4){_0x1e4e9d['id']=_0x2911f4;}return db[_0x386f('0x3d')][_0x386f('0x3e')]({'where':_0x1e4e9d,'include':[{'model':db[_0x386f('0xe')],'attributes':['id',_0x386f('0xf'),_0x386f('0xc')],'include':[{'model':db[_0x386f('0x3f')],'as':_0x386f('0x2f'),'include':[{'model':db[_0x386f('0x40')],'as':'CloudProvider'}]}]}]})['then'](function(_0x25ed8d){var _0x13dde5=_[_0x386f('0x41')](manager['jobs']);var _0x16d400=_[_0x386f('0x42')](_0x25ed8d,function(_0x323838){return _0x323838['id'][_0x386f('0x43')]();});var _0x52726d=_['keyBy'](_0x25ed8d,function(_0x5c8b4b){return _0x5c8b4b['id']['toString']();});var _0x949f95=_0x2911f4?_0x16d400:_['difference'](_0x16d400,_0x13dde5);var _0x33cdfc=_[_0x386f('0x44')](_0x16d400,_0x13dde5);var _0x1f45a0=_[_0x386f('0x45')](_0x13dde5,_0x16d400);var _0x147ead;var _0x1a66bd;for(_0x147ead=0x0;_0x147ead<_0x1f45a0[_0x386f('0x46')]&&!_0x2911f4;_0x147ead+=0x1){_0x1a66bd=_0x1f45a0[_0x147ead][_0x386f('0x43')]();if(manager[_0x386f('0x47')](_0x1a66bd)){manager[_0x386f('0x48')](_0x1a66bd);manager['deleteJob'](_0x1a66bd);logger[_0x386f('0x2d')]('delete\x20cron',_0x1a66bd);}}logger['info'](_0x386f('0x49'),JSON['stringify'](_0x949f95));for(_0x147ead=0x0;_0x147ead<_0x949f95[_0x386f('0x46')];_0x147ead+=0x1){_0x1a66bd=_0x949f95[_0x147ead]['toString']();logger[_0x386f('0x2d')](_0x386f('0x4a'),_0x1a66bd);if(_0x2911f4){logger[_0x386f('0x2d')](_0x386f('0x4b'),_0x2911f4);logger[_0x386f('0x2d')](JSON['stringify'](_0x52726d[_0x1a66bd]));BPromise['resolve']()[_0x386f('0x27')](handleJob(_0x52726d[_0x1a66bd]));logger[_0x386f('0x2d')](_0x386f('0x4c'),_0x52726d[_0x1a66bd][_0x386f('0xf')],_0x52726d[_0x1a66bd][_0x386f('0x4d')]);}else if(_0x52726d[_0x1a66bd][_0x386f('0x4d')]&&_0x52726d[_0x1a66bd][_0x386f('0x4e')]&&moment()[_0x386f('0x4f')](_0x52726d[_0x1a66bd][_0x386f('0x50')],_0x52726d[_0x1a66bd]['endAt'])){manager['add'](_0x1a66bd,_0x52726d[_0x1a66bd][_0x386f('0x4d')],handleJob(_0x52726d[_0x1a66bd]));manager[_0x386f('0x51')](_0x1a66bd);logger[_0x386f('0x2d')](_0x386f('0x52'),_0x52726d[_0x1a66bd]['name'],_0x52726d[_0x1a66bd][_0x386f('0x4d')]);}else if(manager[_0x386f('0x47')](_0x1a66bd)){manager[_0x386f('0x48')](_0x1a66bd);manager['deleteJob'](_0x1a66bd);logger[_0x386f('0x2d')](_0x386f('0x53'),_0x52726d[_0x1a66bd][_0x386f('0xf')],_0x52726d[_0x1a66bd]['cron']);}}for(_0x147ead=0x0,_0x1a66bd;_0x147ead<_0x33cdfc['length']&&!_0x2911f4;_0x147ead+=0x1){_0x1a66bd=_0x33cdfc[_0x147ead][_0x386f('0x43')]();if(manager[_0x386f('0x47')](_0x1a66bd)){if(_0x52726d[_0x1a66bd][_0x386f('0x4d')]&&_0x52726d[_0x1a66bd][_0x386f('0x4e')]&&moment()[_0x386f('0x4f')](_0x52726d[_0x1a66bd][_0x386f('0x50')],_0x52726d[_0x1a66bd]['endAt'])){manager[_0x386f('0x54')](_0x1a66bd,_0x52726d[_0x1a66bd][_0x386f('0x4d')],handleJob(_0x52726d[_0x1a66bd]));logger[_0x386f('0x2d')]('update\x20cron',_0x52726d[_0x1a66bd][_0x386f('0xf')],_0x52726d[_0x1a66bd][_0x386f('0x4d')]);}else{manager[_0x386f('0x48')](_0x1a66bd);manager[_0x386f('0x55')](_0x1a66bd);logger[_0x386f('0x2d')]('stop\x20cron',_0x52726d[_0x1a66bd][_0x386f('0xf')],_0x52726d[_0x1a66bd][_0x386f('0x4d')]);}}}})[_0x386f('0x2c')](function(_0x70da46){logger[_0x386f('0x28')](JSON[_0x386f('0x2a')](_0x70da46));});}exports['run']=function(_0x36cfcd){return getJobs(_0x36cfcd);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index ddf1bd1..1d81370 100644 --- a/server/config/schedule/transcribe.js +++ b/server/config/schedule/transcribe.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9af1=['bucket','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentiment','Transcript\x20not\x20available','findOne','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribe','forEach','all','catch','error','start','lodash','aws-sdk','request-promise','bluebird','../../mysqldb','../../config/logger','TranscribeService','Comprehend','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','transcribeRegion','transcribeName','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','TranscriptFileUri','format','[RECORDING:%d]\x20Get\x20transcript','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion'];(function(_0x28ee77,_0x5c1f4d){var _0xd4ad92=function(_0x312bcf){while(--_0x312bcf){_0x28ee77['push'](_0x28ee77['shift']());}};_0xd4ad92(++_0x5c1f4d);}(_0x9af1,0x68));var _0x19af=function(_0x35fb79,_0x47f0dc){_0x35fb79=_0x35fb79-0x0;var _0x1f6764=_0x9af1[_0x35fb79];return _0x1f6764;};var _=require(_0x19af('0x0'));var AWS=require(_0x19af('0x1'));var rp=require(_0x19af('0x2'));var util=require('util');var BPromise=require(_0x19af('0x3'));var db=require(_0x19af('0x4'))['db'];var logger=require(_0x19af('0x5'))('transcribe');function getTranscriptionJob(_0x4a3621,_0x3506ac,_0x4feb94,_0x11c0fc){return new Promise(function(_0x157fc9,_0x41a50f){var _0x46c2fe=new AWS[(_0x19af('0x6'))]({'accessKeyId':_0x3506ac,'secretAccessKey':_0x4a3621,'region':_0x4feb94});_0x46c2fe['getTranscriptionJob']({'TranscriptionJobName':_0x11c0fc},function(_0x3e7b4e,_0x4bd19e){if(_0x3e7b4e){return _0x41a50f(_0x3e7b4e);}else{return _0x157fc9(_0x4bd19e);}});});}function sentiment(_0x43c3ff,_0x55478b,_0x2720c7,_0x3f90b6,_0x49e7bc){return new Promise(function(_0x57a520,_0x1e3b6a){var _0x5d7f42=new AWS[(_0x19af('0x7'))]({'accessKeyId':_0x55478b,'secretAccessKey':_0x43c3ff,'region':_0x2720c7});_0x5d7f42['detectSentiment']({'Text':_0x3f90b6,'LanguageCode':_0x49e7bc[_0x19af('0x8')](0x0,0x2)},function(_0xb3be9,_0x47846d){if(_0xb3be9){return _0x1e3b6a(_0xb3be9);}else{return _0x57a520(_0x47846d);}});});}function checkTranscribeJob(_0x2fe283,_0x5c9096,_0x527040){var _0x2408e6;return new BPromise(function(_0x22d2f3,_0x54f6bc){logger[_0x19af('0x9')](util['format'](_0x19af('0xa'),_0x2fe283['id'],_0x2fe283['transcribeName']));return getTranscriptionJob(_0x527040[_0x19af('0xb')],_0x527040['data2'],_0x5c9096[_0x19af('0xc')],_0x2fe283[_0x19af('0xd')])['then'](function(_0x1c2ac2){logger[_0x19af('0x9')](util['format'](_0x19af('0xe'),_0x2fe283['id'],_0x2fe283['transcribeName'],_0x1c2ac2[_0x19af('0xf')][_0x19af('0x10')]));if(!_0x2fe283[_0x19af('0x11')]){switch(_0x1c2ac2['TranscriptionJob'][_0x19af('0x10')]){case _0x19af('0x12'):var _0x3b34d6={'transcribeStatus':_0x1c2ac2[_0x19af('0xf')]['TranscriptionJobStatus'],'fileUri':_0x1c2ac2[_0x19af('0xf')]['Transcript'][_0x19af('0x13')]};logger['info'](util[_0x19af('0x14')](_0x19af('0x15'),_0x2fe283['id']));return rp({'uri':_0x1c2ac2[_0x19af('0xf')]['Transcript'][_0x19af('0x13')],'json':!![]})[_0x19af('0x16')](function(_0xf05f34){logger[_0x19af('0x9')](util[_0x19af('0x14')](_0x19af('0x17'),_0x2fe283['id']));if(_0xf05f34&&_0xf05f34['results']&&_0xf05f34[_0x19af('0x18')]['transcripts']&&_0xf05f34[_0x19af('0x18')][_0x19af('0x19')][_0x19af('0x1a')]){_0x3b34d6[_0x19af('0x11')]='';for(var _0x125a48=0x0;_0x125a48<_0xf05f34[_0x19af('0x18')][_0x19af('0x19')][_0x19af('0x1a')];_0x125a48++){_0x3b34d6['fileText']+=_0xf05f34[_0x19af('0x18')][_0x19af('0x19')][_0x125a48][_0x19af('0x1b')]+'';}}return _0x2fe283[_0x19af('0x1c')](_0x3b34d6);})['then'](function(){logger[_0x19af('0x9')](util[_0x19af('0x14')](_0x19af('0x1d'),_0x2fe283['id']));if(!_0x2fe283[_0x19af('0x1e')]){throw new db[(_0x19af('0x1f'))][(_0x19af('0x20'))](_0x19af('0x21'));}if(!_0x5c9096['sentiment']||!_0x5c9096[_0x19af('0x22')]||!_0x5c9096[_0x19af('0x23')]||!_0x5c9096['language']||!_0x5c9096[_0x19af('0x24')]){throw new db[(_0x19af('0x1f'))]['ValidationError'](_0x19af('0x25'));}if(!_0x3b34d6[_0x19af('0x11')]){throw new Error('Transcript\x20not\x20available');}if(_0x5c9096[_0x19af('0x22')]===_0x527040['id']){return _0x527040;}else{return db[_0x19af('0x26')]['findOne']({'where':{'id':_settings[_0x19af('0x22')]}});}})[_0x19af('0x16')](function(_0x9396c4){if(!_0x9396c4){throw new db['Sequelize'][(_0x19af('0x20'))](_0x19af('0x27'));}if(!_0x9396c4[_0x19af('0xb')]||!_0x9396c4[_0x19af('0x28')]){throw new db[(_0x19af('0x1f'))]['ValidationError'](_0x19af('0x29'));}_0x2408e6=_0x9396c4;logger[_0x19af('0x9')](util['format'](_0x19af('0x2a'),_0x2fe283['id']));return sentiment(_0x2408e6[_0x19af('0xb')],_0x2408e6['data2'],_0x5c9096[_0x19af('0x23')],_0x3b34d6[_0x19af('0x11')],_0x5c9096[_0x19af('0x2b')]);})['then'](function(_0x1b01e8){logger['info'](util[_0x19af('0x14')](_0x19af('0x2c'),_0x2fe283['id']));return _0x2fe283[_0x19af('0x1c')]({'sentiment':_0x1b01e8[_0x19af('0x2d')],'sPositive':_0x1b01e8[_0x19af('0x2e')][_0x19af('0x2f')],'sNegative':_0x1b01e8[_0x19af('0x2e')][_0x19af('0x30')],'sMixed':_0x1b01e8['SentimentScore']['Mixed'],'sNeutral':_0x1b01e8[_0x19af('0x2e')][_0x19af('0x31')]});})['then'](function(){logger[_0x19af('0x9')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x2fe283['id']));_0x22d2f3();});case _0x19af('0x32'):return _0x2fe283['update']({'transcribeStatus':_0x19af('0x32'),'failureReason':_0x1c2ac2['TranscriptionJob'][_0x19af('0x33')]})['then'](function(){logger['info'](util[_0x19af('0x14')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x2fe283['id']));_0x22d2f3();});default:logger[_0x19af('0x9')](util['format'](_0x19af('0x34'),_0x2fe283['id']));break;}}else{return BPromise[_0x19af('0x35')]()['then'](function(){if(!_0x2fe283[_0x19af('0x1e')]){throw new db[(_0x19af('0x1f'))][(_0x19af('0x20'))](_0x19af('0x21'));}if(!_0x5c9096[_0x19af('0x36')]||!_0x5c9096[_0x19af('0x22')]||!_0x5c9096['sentimentRegion']||!_0x5c9096[_0x19af('0x2b')]||!_0x5c9096[_0x19af('0x24')]){throw new db[(_0x19af('0x1f'))][(_0x19af('0x20'))](_0x19af('0x25'));}if(!_0x2fe283['fileText']){throw new Error(_0x19af('0x37'));}if(_0x5c9096[_0x19af('0x22')]===_0x527040['id']){return _0x527040;}else{return db[_0x19af('0x26')][_0x19af('0x38')]({'where':{'id':_settings[_0x19af('0x22')]}});}})['then'](function(_0x2daa0a){if(!_0x2daa0a){throw new db[(_0x19af('0x1f'))][(_0x19af('0x20'))](_0x19af('0x27'));}if(!_0x2daa0a[_0x19af('0xb')]||!_0x2daa0a['data2']){throw new db[(_0x19af('0x1f'))][(_0x19af('0x20'))]('Cloud\x20Provider\x20not\x20configured');}_0x2408e6=_0x2daa0a;logger['info'](util[_0x19af('0x14')](_0x19af('0x2a'),_0x2fe283['id']));return sentiment(_0x2408e6[_0x19af('0xb')],_0x2408e6[_0x19af('0x28')],_0x5c9096[_0x19af('0x23')],_0x2fe283[_0x19af('0x11')],_0x5c9096[_0x19af('0x2b')]);})[_0x19af('0x16')](function(_0x1f0bd3){logger[_0x19af('0x9')](util[_0x19af('0x14')](_0x19af('0x2c'),_0x2fe283['id']));return _0x2fe283['update']({'sentiment':_0x1f0bd3[_0x19af('0x2d')],'sPositive':_0x1f0bd3['SentimentScore'][_0x19af('0x2f')],'sNegative':_0x1f0bd3[_0x19af('0x2e')][_0x19af('0x30')],'sMixed':_0x1f0bd3[_0x19af('0x2e')]['Mixed'],'sNeutral':_0x1f0bd3[_0x19af('0x2e')][_0x19af('0x31')],'transcribeStatus':_0x19af('0x12')});})['then'](function(){logger[_0x19af('0x9')](util[_0x19af('0x14')](_0x19af('0x1d'),_0x2fe283['id']));_0x22d2f3();});}})['catch'](function(_0x366933){if(_0x366933){if(!_0x366933[_0x19af('0x39')]||_0x366933['name']!==_0x19af('0x3a')){logger['error'](util[_0x19af('0x14')](_0x19af('0x3b'),_0x2fe283['id']),util['inspect'](_0x366933,{'showHidden':![],'depth':null}));}}_0x22d2f3();});});}function checkTranscribe(){var _0x237c4b;var _0x4e3f1f;var _0xffa8f4;return db['VoiceRecording'][_0x19af('0x3c')]({'where':{'transcribeStatus':_0x19af('0x3d')}})[_0x19af('0x16')](function(_0x554c06){if(!_0x554c06||!_0x554c06[_0x19af('0x1a')]){throw new db[(_0x19af('0x1f'))][(_0x19af('0x20'))](_0x19af('0x3e'));}_0x237c4b=_0x554c06;return db[_0x19af('0x3f')]['findOne']({'where':{'id':0x1}});})[_0x19af('0x16')](function(_0x39b457){if(!_0x39b457){throw new db[(_0x19af('0x1f'))][(_0x19af('0x20'))]('Settings\x20not\x20available');}_0x4e3f1f=_0x39b457;if(!_0x4e3f1f[_0x19af('0x40')]||!_0x4e3f1f['transcribeAccountId']||!_0x4e3f1f[_0x19af('0xc')]||!_0x4e3f1f[_0x19af('0x2b')]||!_0x4e3f1f[_0x19af('0x24')]){throw new db[(_0x19af('0x1f'))][(_0x19af('0x20'))]('Transcribe\x20not\x20configured');}return db['CloudProvider'][_0x19af('0x38')]({'where':{'id':_0x4e3f1f['transcribeAccountId']}});})['then'](function(_0x1ea572){if(!_0x1ea572){throw new db[(_0x19af('0x1f'))][(_0x19af('0x20'))](_0x19af('0x27'));}if(!_0x1ea572['data1']||!_0x1ea572['data2']){throw new db[(_0x19af('0x1f'))][(_0x19af('0x20'))](_0x19af('0x29'));}_0xffa8f4=_0x1ea572;var _0x7f84e=[];_0x237c4b[_0x19af('0x41')](function(_0x5eb9c1){_0x7f84e['push'](checkTranscribeJob(_0x5eb9c1,_0x4e3f1f,_0xffa8f4));});return BPromise[_0x19af('0x42')](_0x7f84e);})[_0x19af('0x43')](function(_0x522a93){if(_0x522a93){if(!_0x522a93['name']||_0x522a93[_0x19af('0x39')]!==_0x19af('0x3a')){logger[_0x19af('0x44')](util['inspect'](_0x522a93,{'showHidden':![],'depth':null}));}}});}exports[_0x19af('0x45')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x0664=['transcribeRegion','forEach','all','error','start','aws-sdk','util','bluebird','../../config/logger','transcribe','TranscribeService','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data2','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','then','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','language','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','data1','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Negative','Mixed','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','bucket','findOne','Cloud\x20Provider\x20not\x20available','Positive','Neutral','catch','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId'];(function(_0x722ddb,_0x5bbf28){var _0x488c42=function(_0x4f3ad0){while(--_0x4f3ad0){_0x722ddb['push'](_0x722ddb['shift']());}};_0x488c42(++_0x5bbf28);}(_0x0664,0x93));var _0x4066=function(_0x6f517d,_0x19178f){_0x6f517d=_0x6f517d-0x0;var _0x537e6d=_0x0664[_0x6f517d];return _0x537e6d;};var _=require('lodash');var AWS=require(_0x4066('0x0'));var rp=require('request-promise');var util=require(_0x4066('0x1'));var BPromise=require(_0x4066('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0x4066('0x3'))(_0x4066('0x4'));function getTranscriptionJob(_0x1479a6,_0x43d301,_0x362a79,_0x325e0e){return new Promise(function(_0x2febd3,_0x1e2bf0){var _0x143de5=new AWS[(_0x4066('0x5'))]({'accessKeyId':_0x43d301,'secretAccessKey':_0x1479a6,'region':_0x362a79});_0x143de5['getTranscriptionJob']({'TranscriptionJobName':_0x325e0e},function(_0x383df4,_0x5d360d){if(_0x383df4){return _0x1e2bf0(_0x383df4);}else{return _0x2febd3(_0x5d360d);}});});}function sentiment(_0x29a147,_0x2db4e6,_0x48333f,_0x5f3d44,_0x1da4d8){return new Promise(function(_0x3ea971,_0x16a1f7){var _0x41ad8b=new AWS['Comprehend']({'accessKeyId':_0x2db4e6,'secretAccessKey':_0x29a147,'region':_0x48333f});_0x41ad8b['detectSentiment']({'Text':_0x5f3d44,'LanguageCode':_0x1da4d8['substring'](0x0,0x2)},function(_0x4cbeb6,_0x2bac58){if(_0x4cbeb6){return _0x16a1f7(_0x4cbeb6);}else{return _0x3ea971(_0x2bac58);}});});}function checkTranscribeJob(_0x1b1712,_0x10c353,_0x12d36c){var _0x425456;return new BPromise(function(_0x3a0cf2,_0x38c65d){logger[_0x4066('0x6')](util['format'](_0x4066('0x7'),_0x1b1712['id'],_0x1b1712[_0x4066('0x8')]));return getTranscriptionJob(_0x12d36c['data1'],_0x12d36c[_0x4066('0x9')],_0x10c353['transcribeRegion'],_0x1b1712[_0x4066('0x8')])['then'](function(_0x50f71d){logger[_0x4066('0x6')](util[_0x4066('0xa')](_0x4066('0xb'),_0x1b1712['id'],_0x1b1712[_0x4066('0x8')],_0x50f71d[_0x4066('0xc')][_0x4066('0xd')]));if(!_0x1b1712[_0x4066('0xe')]){switch(_0x50f71d[_0x4066('0xc')][_0x4066('0xd')]){case _0x4066('0xf'):var _0x511cfa={'transcribeStatus':_0x50f71d['TranscriptionJob'][_0x4066('0xd')],'fileUri':_0x50f71d[_0x4066('0xc')]['Transcript'][_0x4066('0x10')]};logger[_0x4066('0x6')](util[_0x4066('0xa')](_0x4066('0x11'),_0x1b1712['id']));return rp({'uri':_0x50f71d[_0x4066('0xc')][_0x4066('0x12')]['TranscriptFileUri'],'json':!![]})['then'](function(_0x541306){logger['info'](util[_0x4066('0xa')](_0x4066('0x13'),_0x1b1712['id']));if(_0x541306&&_0x541306[_0x4066('0x14')]&&_0x541306[_0x4066('0x14')][_0x4066('0x15')]&&_0x541306['results'][_0x4066('0x15')][_0x4066('0x16')]){_0x511cfa[_0x4066('0xe')]='';for(var _0x2598c6=0x0;_0x2598c6<_0x541306[_0x4066('0x14')]['transcripts']['length'];_0x2598c6++){_0x511cfa[_0x4066('0xe')]+=_0x541306[_0x4066('0x14')][_0x4066('0x15')][_0x2598c6][_0x4066('0x17')]+'';}}return _0x1b1712[_0x4066('0x18')](_0x511cfa);})[_0x4066('0x19')](function(){logger[_0x4066('0x6')](util[_0x4066('0xa')](_0x4066('0x1a'),_0x1b1712['id']));if(!_0x1b1712[_0x4066('0x1b')]){throw new db[(_0x4066('0x1c'))][(_0x4066('0x1d'))](_0x4066('0x1e'));}if(!_0x10c353[_0x4066('0x1f')]||!_0x10c353[_0x4066('0x20')]||!_0x10c353['sentimentRegion']||!_0x10c353[_0x4066('0x21')]||!_0x10c353['bucket']){throw new db['Sequelize']['ValidationError'](_0x4066('0x22'));}if(!_0x511cfa['fileText']){throw new Error(_0x4066('0x23'));}if(_0x10c353[_0x4066('0x20')]===_0x12d36c['id']){return _0x12d36c;}else{return db[_0x4066('0x24')]['findOne']({'where':{'id':_settings[_0x4066('0x20')]}});}})['then'](function(_0x2468f0){if(!_0x2468f0){throw new db[(_0x4066('0x1c'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x2468f0[_0x4066('0x25')]||!_0x2468f0[_0x4066('0x9')]){throw new db['Sequelize'][(_0x4066('0x1d'))](_0x4066('0x26'));}_0x425456=_0x2468f0;logger[_0x4066('0x6')](util['format'](_0x4066('0x27'),_0x1b1712['id']));return sentiment(_0x425456['data1'],_0x425456[_0x4066('0x9')],_0x10c353[_0x4066('0x28')],_0x511cfa[_0x4066('0xe')],_0x10c353[_0x4066('0x21')]);})[_0x4066('0x19')](function(_0x255fd0){logger[_0x4066('0x6')](util[_0x4066('0xa')](_0x4066('0x29'),_0x1b1712['id']));return _0x1b1712[_0x4066('0x18')]({'sentiment':_0x255fd0[_0x4066('0x2a')],'sPositive':_0x255fd0[_0x4066('0x2b')]['Positive'],'sNegative':_0x255fd0[_0x4066('0x2b')][_0x4066('0x2c')],'sMixed':_0x255fd0['SentimentScore'][_0x4066('0x2d')],'sNeutral':_0x255fd0[_0x4066('0x2b')]['Neutral']});})[_0x4066('0x19')](function(){logger[_0x4066('0x6')](util[_0x4066('0xa')](_0x4066('0x1a'),_0x1b1712['id']));_0x3a0cf2();});case _0x4066('0x2e'):return _0x1b1712[_0x4066('0x18')]({'transcribeStatus':_0x4066('0x2e'),'failureReason':_0x50f71d[_0x4066('0xc')][_0x4066('0x2f')]})['then'](function(){logger[_0x4066('0x6')](util[_0x4066('0xa')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1b1712['id']));_0x3a0cf2();});default:logger[_0x4066('0x6')](util[_0x4066('0xa')](_0x4066('0x30'),_0x1b1712['id']));break;}}else{return BPromise['resolve']()[_0x4066('0x19')](function(){if(!_0x1b1712[_0x4066('0x1b')]){throw new db[(_0x4066('0x1c'))][(_0x4066('0x1d'))](_0x4066('0x1e'));}if(!_0x10c353[_0x4066('0x1f')]||!_0x10c353[_0x4066('0x20')]||!_0x10c353['sentimentRegion']||!_0x10c353[_0x4066('0x21')]||!_0x10c353[_0x4066('0x31')]){throw new db[(_0x4066('0x1c'))][(_0x4066('0x1d'))](_0x4066('0x22'));}if(!_0x1b1712['fileText']){throw new Error(_0x4066('0x23'));}if(_0x10c353[_0x4066('0x20')]===_0x12d36c['id']){return _0x12d36c;}else{return db['CloudProvider'][_0x4066('0x32')]({'where':{'id':_settings[_0x4066('0x20')]}});}})[_0x4066('0x19')](function(_0x1c3abb){if(!_0x1c3abb){throw new db[(_0x4066('0x1c'))]['ValidationError'](_0x4066('0x33'));}if(!_0x1c3abb[_0x4066('0x25')]||!_0x1c3abb['data2']){throw new db[(_0x4066('0x1c'))][(_0x4066('0x1d'))](_0x4066('0x26'));}_0x425456=_0x1c3abb;logger[_0x4066('0x6')](util[_0x4066('0xa')](_0x4066('0x27'),_0x1b1712['id']));return sentiment(_0x425456[_0x4066('0x25')],_0x425456['data2'],_0x10c353[_0x4066('0x28')],_0x1b1712[_0x4066('0xe')],_0x10c353[_0x4066('0x21')]);})[_0x4066('0x19')](function(_0x1c99a8){logger[_0x4066('0x6')](util['format'](_0x4066('0x29'),_0x1b1712['id']));return _0x1b1712['update']({'sentiment':_0x1c99a8[_0x4066('0x2a')],'sPositive':_0x1c99a8['SentimentScore'][_0x4066('0x34')],'sNegative':_0x1c99a8[_0x4066('0x2b')][_0x4066('0x2c')],'sMixed':_0x1c99a8[_0x4066('0x2b')]['Mixed'],'sNeutral':_0x1c99a8[_0x4066('0x2b')][_0x4066('0x35')],'transcribeStatus':'COMPLETED'});})[_0x4066('0x19')](function(){logger['info'](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1b1712['id']));_0x3a0cf2();});}})[_0x4066('0x36')](function(_0x3e7c11){if(_0x3e7c11){if(!_0x3e7c11[_0x4066('0x37')]||_0x3e7c11[_0x4066('0x37')]!==_0x4066('0x38')){logger['error'](util[_0x4066('0xa')](_0x4066('0x39'),_0x1b1712['id']),util[_0x4066('0x3a')](_0x3e7c11,{'showHidden':![],'depth':null}));}}_0x3a0cf2();});});}function checkTranscribe(){var _0x2dcad0;var _0x218d51;var _0x523396;return db[_0x4066('0x3b')][_0x4066('0x3c')]({'where':{'transcribeStatus':_0x4066('0x3d')}})[_0x4066('0x19')](function(_0x269ff0){if(!_0x269ff0||!_0x269ff0[_0x4066('0x16')]){throw new db[(_0x4066('0x1c'))]['ValidationError'](_0x4066('0x3e'));}_0x2dcad0=_0x269ff0;return db[_0x4066('0x3f')][_0x4066('0x32')]({'where':{'id':0x1}});})[_0x4066('0x19')](function(_0x3bfea2){if(!_0x3bfea2){throw new db['Sequelize'][(_0x4066('0x1d'))](_0x4066('0x40'));}_0x218d51=_0x3bfea2;if(!_0x218d51['transcribe']||!_0x218d51[_0x4066('0x41')]||!_0x218d51[_0x4066('0x42')]||!_0x218d51[_0x4066('0x21')]||!_0x218d51[_0x4066('0x31')]){throw new db[(_0x4066('0x1c'))][(_0x4066('0x1d'))]('Transcribe\x20not\x20configured');}return db[_0x4066('0x24')][_0x4066('0x32')]({'where':{'id':_0x218d51[_0x4066('0x41')]}});})['then'](function(_0xe0f43c){if(!_0xe0f43c){throw new db['Sequelize'][(_0x4066('0x1d'))](_0x4066('0x33'));}if(!_0xe0f43c['data1']||!_0xe0f43c['data2']){throw new db['Sequelize'][(_0x4066('0x1d'))](_0x4066('0x26'));}_0x523396=_0xe0f43c;var _0x1db0be=[];_0x2dcad0[_0x4066('0x43')](function(_0x4e677c){_0x1db0be['push'](checkTranscribeJob(_0x4e677c,_0x218d51,_0x523396));});return BPromise[_0x4066('0x44')](_0x1db0be);})[_0x4066('0x36')](function(_0x5886a1){if(_0x5886a1){if(!_0x5886a1['name']||_0x5886a1[_0x4066('0x37')]!=='SequelizeValidationError'){logger[_0x4066('0x45')](util['inspect'](_0x5886a1,{'showHidden':![],'depth':null}));}}});}exports[_0x4066('0x46')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index 98e2f29..7a9f52a 100644 --- a/server/config/schedule/whatsapp.js +++ b/server/config/schedule/whatsapp.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0741=['then','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','timeout','YYYY-MM-DD\x20HH:mm:ss','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','error','[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','moment','../../config/environment','../../mysqldb','schedule','redis','defaults','WhatsappInteraction','lastMsgAt','hours'];(function(_0xf6a1db,_0x37ea6a){var _0x300fb3=function(_0x32ab1f){while(--_0x32ab1f){_0xf6a1db['push'](_0xf6a1db['shift']());}};_0x300fb3(++_0x37ea6a);}(_0x0741,0x14f));var _0x1074=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x0741[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x1074('0x0'));var moment=require(_0x1074('0x1'));var Redis=require('ioredis');var util=require('util');var config=require(_0x1074('0x2'));var db=require(_0x1074('0x3'))['db'];var logger=require('../logger')(_0x1074('0x4'));config[_0x1074('0x5')]=_[_0x1074('0x6')](config[_0x1074('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x12459f=[];return db[_0x1074('0x7')]['findAll']({'raw':!![],'attributes':['id',_0x1074('0x8')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x1074('0x9'))}}})[_0x1074('0xa')](function(_0x4214f0){if(_0x4214f0&&_0x4214f0['length']){_0x12459f=_['map'](_0x4214f0||[],'id');logger[_0x1074('0xb')](_0x1074('0xc'),_0x12459f[_0x1074('0xd')]());return db[_0x1074('0x7')][_0x1074('0xe')]({'closeReason':'system','disposition':_0x1074('0xf'),'closed':!![],'closedAt':moment()['format'](_0x1074('0x10'))},{'where':{'id':_0x12459f}});}})[_0x1074('0xa')](function(){if(_0x12459f&&_0x12459f[_0x1074('0x11')]){logger[_0x1074('0xb')](_0x1074('0x12'),_0x12459f[_0x1074('0xd')]());for(var _0x285b5e=0x0;_0x285b5e<_0x12459f['length'];_0x285b5e++){io[_0x1074('0x13')]('whatsappInteraction:update',{'id':_0x12459f[_0x285b5e],'closed':!![]});}}})['catch'](function(_0x47b717){logger[_0x1074('0x14')](_0x1074('0x15'),_0x47b717?util['inspect'](_0x47b717,{'showHidden':![],'depth':null}):'');});}exports[_0x1074('0x16')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x9a3d=['then','length','map','info','join','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','inspect','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','redis','defaults','localhost','WhatsappInteraction','findAll','lastMsgAt','subtract','hours'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x9a3d,0x14e));var _0xd9a3=function(_0x279c37,_0x3d9b57){_0x279c37=_0x279c37-0x0;var _0x4d45ee=_0x9a3d[_0x279c37];return _0x4d45ee;};'use strict';var _=require('lodash');var moment=require(_0xd9a3('0x0'));var Redis=require(_0xd9a3('0x1'));var util=require(_0xd9a3('0x2'));var config=require(_0xd9a3('0x3'));var db=require(_0xd9a3('0x4'))['db'];var logger=require(_0xd9a3('0x5'))('schedule');config[_0xd9a3('0x6')]=_[_0xd9a3('0x7')](config[_0xd9a3('0x6')],{'host':_0xd9a3('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd9a3('0x6')]));function closeInteractions(){var _0x803bd5=[];return db[_0xd9a3('0x9')][_0xd9a3('0xa')]({'raw':!![],'attributes':['id',_0xd9a3('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xd9a3('0xc')](0x18,_0xd9a3('0xd'))}}})[_0xd9a3('0xe')](function(_0x4bff52){if(_0x4bff52&&_0x4bff52[_0xd9a3('0xf')]){_0x803bd5=_[_0xd9a3('0x10')](_0x4bff52||[],'id');logger[_0xd9a3('0x11')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x803bd5[_0xd9a3('0x12')]());return db[_0xd9a3('0x9')]['update']({'closeReason':_0xd9a3('0x13'),'disposition':_0xd9a3('0x14'),'closed':!![],'closedAt':moment()[_0xd9a3('0x15')](_0xd9a3('0x16'))},{'where':{'id':_0x803bd5}});}})[_0xd9a3('0xe')](function(){if(_0x803bd5&&_0x803bd5[_0xd9a3('0xf')]){logger[_0xd9a3('0x11')](_0xd9a3('0x17'),_0x803bd5['join']());for(var _0x139e66=0x0;_0x139e66<_0x803bd5[_0xd9a3('0xf')];_0x139e66++){io[_0xd9a3('0x18')](_0xd9a3('0x19'),{'id':_0x803bd5[_0x139e66],'closed':!![]});}}})[_0xd9a3('0x1a')](function(_0x320522){logger[_0xd9a3('0x1b')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x320522?util[_0xd9a3('0x1c')](_0x320522,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 98c505a..80e699f 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa846=['CmHopper','log','hopper1','CmContact','contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','now','@xcally.com','destroy','then','bulkCreate','finished\x20populating','contacts1'];(function(_0x2452c9,_0x5175b8){var _0x4cb8ce=function(_0x11c933){while(--_0x11c933){_0x2452c9['push'](_0x2452c9['shift']());}};_0x4cb8ce(++_0x5175b8);}(_0xa846,0x7f));var _0x6a84=function(_0x9ddc25,_0x55a6d0){_0x9ddc25=_0x9ddc25-0x0;var _0x4a1c5a=_0xa846[_0x9ddc25];return _0x4a1c5a;};'use strict';var util=require(_0x6a84('0x0'));var db=require(_0x6a84('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x6a84('0x2')]({'id':i,'firstName':_0x6a84('0x3')+i,'lastName':_0x6a84('0x4')+i,'phone':0xf879fb460+i,'email':_0x6a84('0x5')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x6a84('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x6a84('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6a84('0x6')](),'updatedAt':Date[_0x6a84('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x6a84('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x6a84('0x4')+i,'phone':0xf879fb460+i,'email':_0x6a84('0x5')+i+_0x6a84('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x6a84('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x6a84('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6a84('0x6')](),'updatedAt':Date[_0x6a84('0x6')]()});}db['CmContact'][_0x6a84('0x8')]({'where':{}})[_0x6a84('0x9')](function(){return db['CmContact'][_0x6a84('0xa')](contacts);})[_0x6a84('0x9')](function(){console['log'](_0x6a84('0xb'),_0x6a84('0xc'));return db[_0x6a84('0xd')][_0x6a84('0x8')]({'where':{}});})[_0x6a84('0x9')](function(){return db[_0x6a84('0xd')][_0x6a84('0xa')](hopper);})[_0x6a84('0x9')](function(){console[_0x6a84('0xe')](_0x6a84('0xb'),_0x6a84('0xf'));return db[_0x6a84('0x10')][_0x6a84('0xa')](contacts2);})['then'](function(){console[_0x6a84('0xe')]('finished\x20populating',_0x6a84('0x11'));return db['CmHopper'][_0x6a84('0xa')](hopper2);})[_0x6a84('0x9')](function(){console[_0x6a84('0xe')](_0x6a84('0xb'),_0x6a84('0x12'));})[_0x6a84('0x13')](function(_0x398894){console[_0x6a84('0xe')](_0x398894);}); \ No newline at end of file +var _0xd205=['then','finished\x20populating','contacts1','CmHopper','destroy','hopper1','log','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','bulkCreate'];(function(_0x471f62,_0x183f1d){var _0x2dedfd=function(_0x189bba){while(--_0x189bba){_0x471f62['push'](_0x471f62['shift']());}};_0x2dedfd(++_0x183f1d);}(_0xd205,0x170));var _0x5d20=function(_0x3604bc,_0x491f9a){_0x3604bc=_0x3604bc-0x0;var _0x4b873d=_0xd205[_0x3604bc];return _0x4b873d;};'use strict';var util=require(_0x5d20('0x0'));var db=require(_0x5d20('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x5d20('0x2')]({'id':i,'firstName':_0x5d20('0x3')+i,'lastName':_0x5d20('0x4')+i,'phone':0xf879fb460+i,'email':_0x5d20('0x5')+i+_0x5d20('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x5d20('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x5d20('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5d20('0x7')](),'updatedAt':Date[_0x5d20('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x5d20('0x2')]({'id':i,'firstName':_0x5d20('0x3')+i,'lastName':_0x5d20('0x4')+i,'phone':0xf879fb460+i,'email':_0x5d20('0x5')+i+_0x5d20('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x5d20('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5d20('0x7')](),'updatedAt':Date[_0x5d20('0x7')]()});}db[_0x5d20('0x8')]['destroy']({'where':{}})['then'](function(){return db['CmContact'][_0x5d20('0x9')](contacts);})[_0x5d20('0xa')](function(){console['log'](_0x5d20('0xb'),_0x5d20('0xc'));return db[_0x5d20('0xd')][_0x5d20('0xe')]({'where':{}});})['then'](function(){return db[_0x5d20('0xd')][_0x5d20('0x9')](hopper);})[_0x5d20('0xa')](function(){console['log'](_0x5d20('0xb'),_0x5d20('0xf'));return db['CmContact']['bulkCreate'](contacts2);})['then'](function(){console[_0x5d20('0x10')](_0x5d20('0xb'),'contacts2');return db[_0x5d20('0xd')][_0x5d20('0x9')](hopper2);})[_0x5d20('0xa')](function(){console[_0x5d20('0x10')](_0x5d20('0xb'),'hopper2');})[_0x5d20('0x11')](function(_0x74661f){console[_0x5d20('0x10')](_0x74661f);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index b87e4f1..e4ce4b5 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe2b6=['all','ulaw','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','bulkCreate','then','log','add\x20user','../mysqldb','push','%s%s','agent','format','password','friend','udp','wss'];(function(_0x2d982d,_0x121028){var _0x4f36b0=function(_0x11f3a9){while(--_0x11f3a9){_0x2d982d['push'](_0x2d982d['shift']());}};_0x4f36b0(++_0x121028);}(_0xe2b6,0x7c));var _0x6e2b=function(_0x52b0fe,_0x230012){_0x52b0fe=_0x52b0fe-0x0;var _0x41c7f2=_0xe2b6[_0x52b0fe];return _0x41c7f2;};'use strict';var util=require('util');var db=require(_0x6e2b('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x6e2b('0x1')]({'name':util['format'](_0x6e2b('0x2'),_0x6e2b('0x3'),i),'fullname':util[_0x6e2b('0x4')]('%s%s','agent',i),'email':util['format']('%s%s@xcally.com',_0x6e2b('0x3'),i),'role':_0x6e2b('0x3'),'password':_0x6e2b('0x5'),'internal':0xfa0+i,'type':_0x6e2b('0x6'),'transport':[_0x6e2b('0x7'),'ws',_0x6e2b('0x8')],'disallow':[_0x6e2b('0x9')],'allow':[_0x6e2b('0xa')],'defaultuser':util[_0x6e2b('0x4')](_0x6e2b('0x2'),_0x6e2b('0x3'),i),'encryption':_0x6e2b('0xb'),'avpf':_0x6e2b('0xb'),'force_avp':_0x6e2b('0xb'),'icesupport':'yes','dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x6e2b('0xc'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x6e2b('0xd'),'callerid':util[_0x6e2b('0x4')](_0x6e2b('0xe'),util[_0x6e2b('0x4')](_0x6e2b('0x2'),_0x6e2b('0x3'),i),0xfa0+i)});}db['User'][_0x6e2b('0xf')](users)[_0x6e2b('0x10')](function(){console[_0x6e2b('0x11')](_0x6e2b('0x12'));})['catch'](function(_0x2c9155){console['log'](_0x2c9155);}); \ No newline at end of file +var _0xfdce=['log','add\x20user','util','../mysqldb','push','format','agent','%s%s','password','friend','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate'];(function(_0x1fdc05,_0x3abaa8){var _0x171f5d=function(_0x1d2b08){while(--_0x1d2b08){_0x1fdc05['push'](_0x1fdc05['shift']());}};_0x171f5d(++_0x3abaa8);}(_0xfdce,0x9a));var _0xefdc=function(_0x13ee8d,_0x2e34b4){_0x13ee8d=_0x13ee8d-0x0;var _0x3a6f93=_0xfdce[_0x13ee8d];return _0x3a6f93;};'use strict';var util=require(_0xefdc('0x0'));var db=require(_0xefdc('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xefdc('0x2')]({'name':util[_0xefdc('0x3')]('%s%s',_0xefdc('0x4'),i),'fullname':util[_0xefdc('0x3')](_0xefdc('0x5'),_0xefdc('0x4'),i),'email':util[_0xefdc('0x3')]('%s%s@xcally.com',_0xefdc('0x4'),i),'role':_0xefdc('0x4'),'password':_0xefdc('0x6'),'internal':0xfa0+i,'type':_0xefdc('0x7'),'transport':['udp','ws',_0xefdc('0x8')],'disallow':['all'],'allow':[_0xefdc('0x9')],'defaultuser':util[_0xefdc('0x3')]('%s%s',_0xefdc('0x4'),i),'encryption':_0xefdc('0xa'),'avpf':_0xefdc('0xa'),'force_avp':_0xefdc('0xa'),'icesupport':_0xefdc('0xa'),'dtlsenable':_0xefdc('0xa'),'dtlsverify':'no','dtlscertfile':_0xefdc('0xb'),'dtlsprivatekey':_0xefdc('0xc'),'dtlssetup':_0xefdc('0xd'),'callerid':util['format'](_0xefdc('0xe'),util['format'](_0xefdc('0x5'),_0xefdc('0x4'),i),0xfa0+i)});}db[_0xefdc('0xf')][_0xefdc('0x10')](users)['then'](function(){console[_0xefdc('0x11')](_0xefdc('0x12'));})['catch'](function(_0x3d7a25){console[_0xefdc('0x11')](_0x3d7a25);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 0c1aa8c..59a61f4 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x597a=['Trunks','UserProfileResource','resourceId','map','telephone','Campaign','where','format','length','user:%s','query','find','userProfileId','handshake','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','voice:inbound','hasOwnProperty','include','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','Trunk','user','voice:outbound','VoiceQueues','VoiceQueue','FaxQueues','OpenchannelQueue','getVoiceQueues','getSmsQueues','getMailQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','whatsapp','telephone:%s','trunk:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','connection','setMaxListeners','address','remoteAddress','remotePort','connectedAt','nsp','disconnect','lodash','util','bluebird','../mysqldb','name','Agents','User','role','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','ChatQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll'];(function(_0x494ad9,_0x4a8869){var _0x13e061=function(_0x4f7623){while(--_0x4f7623){_0x494ad9['push'](_0x494ad9['shift']());}};_0x13e061(++_0x4a8869);}(_0x597a,0x10e));var _0xa597=function(_0x53d709,_0x1906f6){_0x53d709=_0x53d709-0x0;var _0xc1f741=_0x597a[_0x53d709];return _0xc1f741;};'use strict';var _=require(_0xa597('0x0'));var util=require(_0xa597('0x1'));var BPromise=require(_0xa597('0x2'));var db=require(_0xa597('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0xa597('0x4')],'include':[{'as':_0xa597('0x5'),'model':db[_0xa597('0x6')],'attributes':['id','name',_0xa597('0x7')],'raw':!![],'where':{'role':_0xa597('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xa597('0x4')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0xa597('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xa597('0x4')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0xa597('0x4'),_0xa597('0x9')],'where':{'type':_0xa597('0xa')}};function getAssociatedResources(_0x53ae75,_0x1cc504,_0x212dc2){return db[_0xa597('0xb')][_0xa597('0xc')]({'where':{'name':_0x53ae75,'userProfileId':_0x1cc504},'raw':!![]})[_0xa597('0xd')](function(_0x48e1b3){if(_0x48e1b3){if(_0x48e1b3[_0xa597('0xe')]){switch(_0x53ae75){case'VoiceQueues':case _0xa597('0xf'):case'FaxQueues':case _0xa597('0x10'):case'MailQueues':case _0xa597('0x11'):case _0xa597('0x12'):return db[_0x212dc2]['findAll'](queryQueues);case _0xa597('0x13'):return db[_0x212dc2][_0xa597('0x14')](queryTelephones);case _0xa597('0x15'):return db[_0x212dc2][_0xa597('0x14')](queryTrunks);case'IvrCampaigns':return db[_0x212dc2][_0xa597('0x14')](queryCampaigns);}}else{return db[_0xa597('0x16')]['findAll']({'attributes':[_0xa597('0x17')],'where':{'sectionId':_0x48e1b3['id']},'raw':!![]})[_0xa597('0xd')](function(_0x5cfa31){if(_0x5cfa31){var _0x34e167={'where':{'id':_[_0xa597('0x18')](_0x5cfa31,_0xa597('0x17'))},'raw':!![]};switch(_0x212dc2){case'User':_0x34e167['where'][_0xa597('0x7')]=_0xa597('0x19');break;case _0xa597('0x1a'):_0x34e167[_0xa597('0x1b')][_0xa597('0x9')]=_0xa597('0xa');break;}return db[_0x212dc2][_0xa597('0x14')](_0x34e167);}else{return[];}});}}else{return[];}})[_0xa597('0xd')](function(_0x486db9){return _0x486db9;});}function joinOrLeaveQueues(_0x2745a3,_0x31a606,_0x1166cf,_0x13f60a){_0x2745a3[_0x31a606](util[_0xa597('0x1c')]('%s:queue:%s',_0x1166cf,_0x13f60a[_0xa597('0x4')]));if(_0x13f60a['Agents']){for(var _0x42c787=0x0;_0x42c787<_0x13f60a[_0xa597('0x5')][_0xa597('0x1d')];_0x42c787+=0x1){_0x2745a3[_0x31a606](util[_0xa597('0x1c')](_0xa597('0x1e'),_0x13f60a[_0xa597('0x5')][_0x42c787][_0xa597('0x4')]));}}}function joinOrLeave(_0x1209ee,_0x34c057,_0x1f19ab){var _0x1571b8;if(_0x1209ee['handshake'][_0xa597('0x1f')]['id']){db[_0xa597('0x6')][_0xa597('0x20')]({'attributes':['id',_0xa597('0x4'),_0xa597('0x7'),_0xa597('0x21')],'where':{'id':_0x1209ee[_0xa597('0x22')][_0xa597('0x1f')]['id']},'include':[{'model':db[_0xa597('0x23')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xa597('0x24')],'as':_0xa597('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xa597('0x26')],'as':_0xa597('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xa597('0x28')],'as':_0xa597('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0xa597('0x2a')],'as':_0xa597('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0xa597('0x2c')],'as':_0xa597('0x2d'),'attributes':['id'],'raw':!![]}]})[_0xa597('0xd')](function(_0x28c54d){if(_0x28c54d){_0x1571b8=_0x28c54d;_0x1209ee[_0x34c057](util[_0xa597('0x1c')](_0xa597('0x1e'),_0x28c54d['name']));var _0x1e1892=[];switch(_0x28c54d['role']){case'admin':_0x1209ee[_0x34c057](_0xa597('0x2e'));_0x1209ee[_0x34c057]('voice:outbound');if(queryQueues[_0xa597('0x2f')](_0xa597('0x30'))){delete queryQueues[_0xa597('0x30')];}_0x1e1892['push'](db['VoiceQueue'][_0xa597('0x14')](queryQueues));_0x1e1892[_0xa597('0x31')](db[_0xa597('0x32')][_0xa597('0x14')](queryQueues));_0x1e1892[_0xa597('0x31')](db[_0xa597('0x33')][_0xa597('0x14')](queryQueues));_0x1e1892['push'](db[_0xa597('0x34')]['findAll'](queryQueues));_0x1e1892[_0xa597('0x31')](db[_0xa597('0x35')][_0xa597('0x14')](queryQueues));_0x1e1892[_0xa597('0x31')](db['OpenchannelQueue'][_0xa597('0x14')](queryQueues));_0x1e1892['push'](db['WhatsappQueue'][_0xa597('0x14')](queryQueues));_0x1e1892[_0xa597('0x31')](db[_0xa597('0x6')][_0xa597('0x14')](queryTelephones));_0x1e1892[_0xa597('0x31')](db[_0xa597('0x36')][_0xa597('0x14')](queryTrunks));_0x1e1892[_0xa597('0x31')](db['Campaign'][_0xa597('0x14')](queryCampaigns));_0x1e1892['push'](db[_0xa597('0x6')][_0xa597('0x14')](queryAgents));break;case _0xa597('0x37'):_0x1209ee[_0x34c057](_0xa597('0x2e'));_0x1209ee[_0x34c057](_0xa597('0x38'));_0x1e1892[_0xa597('0x31')](getAssociatedResources(_0xa597('0x39'),_0x28c54d[_0xa597('0x21')],_0xa597('0x3a')));_0x1e1892[_0xa597('0x31')](getAssociatedResources(_0xa597('0xf'),_0x28c54d[_0xa597('0x21')],_0xa597('0x32')));_0x1e1892['push'](getAssociatedResources(_0xa597('0x3b'),_0x28c54d['userProfileId'],_0xa597('0x33')));_0x1e1892[_0xa597('0x31')](getAssociatedResources('SmsQueues',_0x28c54d[_0xa597('0x21')],_0xa597('0x34')));_0x1e1892[_0xa597('0x31')](getAssociatedResources('MailQueues',_0x28c54d[_0xa597('0x21')],_0xa597('0x35')));_0x1e1892[_0xa597('0x31')](getAssociatedResources(_0xa597('0x11'),_0x28c54d[_0xa597('0x21')],_0xa597('0x3c')));_0x1e1892['push'](getAssociatedResources(_0xa597('0x12'),_0x28c54d[_0xa597('0x21')],'WhatsappQueue'));_0x1e1892[_0xa597('0x31')](getAssociatedResources(_0xa597('0x13'),_0x28c54d[_0xa597('0x21')],_0xa597('0x6')));_0x1e1892[_0xa597('0x31')](getAssociatedResources(_0xa597('0x15'),_0x28c54d['userProfileId'],'Trunk'));_0x1e1892['push'](getAssociatedResources('IvrCampaigns',_0x28c54d[_0xa597('0x21')],_0xa597('0x1a')));_0x1e1892[_0xa597('0x31')](db[_0xa597('0x6')][_0xa597('0x14')](queryAgents));break;case _0xa597('0x8'):_0x1209ee[_0x34c057](_0xa597('0x2e'));_0x1209ee[_0x34c057](_0xa597('0x38'));_0x1e1892[_0xa597('0x31')](_0x28c54d[_0xa597('0x3d')]({'attributes':['id','name']}));_0x1e1892[_0xa597('0x31')](_0x28c54d['getChatQueues']({'attributes':['id','name']}));_0x1e1892[_0xa597('0x31')](_0x28c54d['getFaxQueues']({'attributes':['id',_0xa597('0x4')]}));_0x1e1892[_0xa597('0x31')](_0x28c54d[_0xa597('0x3e')]({'attributes':['id',_0xa597('0x4')]}));_0x1e1892[_0xa597('0x31')](_0x28c54d[_0xa597('0x3f')]({'attributes':['id','name']}));_0x1e1892[_0xa597('0x31')](_0x28c54d['getOpenchannelQueues']({'attributes':['id',_0xa597('0x4')]}));_0x1e1892[_0xa597('0x31')](_0x28c54d[_0xa597('0x40')]({'attributes':['id','name']}));break;}return BPromise[_0xa597('0x41')](_0x1e1892);}})[_0xa597('0xd')](function(_0x460746){if(_0x460746&&_0x460746['length']){for(var _0x28d915=0x0;_0x28d915<_0x460746[_0xa597('0x1d')];_0x28d915+=0x1){for(var _0x213ac7=0x0;_0x213ac7<_0x460746[_0x28d915][_0xa597('0x1d')];_0x213ac7+=0x1){switch(_0x28d915){case 0x0:joinOrLeaveQueues(_0x1209ee,_0x34c057,_0xa597('0x42'),_0x460746[_0x28d915][_0x213ac7]);break;case 0x1:joinOrLeaveQueues(_0x1209ee,_0x34c057,_0xa597('0x43'),_0x460746[_0x28d915][_0x213ac7]);break;case 0x2:joinOrLeaveQueues(_0x1209ee,_0x34c057,_0xa597('0x44'),_0x460746[_0x28d915][_0x213ac7]);break;case 0x3:joinOrLeaveQueues(_0x1209ee,_0x34c057,_0xa597('0x45'),_0x460746[_0x28d915][_0x213ac7]);break;case 0x4:joinOrLeaveQueues(_0x1209ee,_0x34c057,_0xa597('0x46'),_0x460746[_0x28d915][_0x213ac7]);break;case 0x5:joinOrLeaveQueues(_0x1209ee,_0x34c057,'openchannel',_0x460746[_0x28d915][_0x213ac7]);break;case 0x6:joinOrLeaveQueues(_0x1209ee,_0x34c057,_0xa597('0x47'),_0x460746[_0x28d915][_0x213ac7]);break;case 0x7:if(_0x1571b8[_0xa597('0x7')]!==_0xa597('0x8'))_0x1209ee[_0x34c057](util[_0xa597('0x1c')](_0xa597('0x48'),_0x460746[_0x28d915][_0x213ac7][_0xa597('0x4')]));break;case 0x8:if(_0x1571b8[_0xa597('0x7')]!==_0xa597('0x8'))_0x1209ee[_0x34c057](util[_0xa597('0x1c')](_0xa597('0x49'),_0x460746[_0x28d915][_0x213ac7][_0xa597('0x4')]));break;case 0x9:if(_0x1571b8[_0xa597('0x7')]!=='agent')_0x1209ee[_0x34c057](util[_0xa597('0x1c')]('campaign:%s:%s',_0x460746[_0x28d915][_0x213ac7]['type'],_0x460746[_0x28d915][_0x213ac7][_0xa597('0x4')]));break;case 0xa:_0x1209ee[_0x34c057](util['format'](_0xa597('0x1e'),_0x460746[_0x28d915][_0x213ac7][_0xa597('0x4')]));break;}}}}})[_0xa597('0xd')](function(){if(_0x34c057===_0xa597('0x4a')){var _0x11b01e=_[_0xa597('0x18')](_0x1571b8['ChatInteractions'],'id');return _0x1571b8[_0xa597('0x4b')](_0x11b01e)[_0xa597('0xd')](function(){for(var _0x33a88a=0x0;_0x33a88a<_0x11b01e['length'];_0x33a88a+=0x1){_0x1f19ab[_0xa597('0x4c')](_0xa597('0x4d'),{'ChatInteractionId':Number(_0x11b01e[_0x33a88a]),'UserId':Number(_0x1571b8['id'])});}});}})[_0xa597('0xd')](function(){if(_0x34c057==='leave'){var _0x254336=_[_0xa597('0x18')](_0x1571b8[_0xa597('0x25')],'id');return _0x1571b8[_0xa597('0x4e')](_0x254336)['then'](function(){for(var _0x476471=0x0;_0x476471<_0x254336[_0xa597('0x1d')];_0x476471+=0x1){_0x1f19ab[_0xa597('0x4c')](_0xa597('0x4f'),{'MailInteractionId':Number(_0x254336[_0x476471]),'UserId':Number(_0x1571b8['id'])});}});}})[_0xa597('0xd')](function(){if(_0x34c057===_0xa597('0x4a')){var _0x1b739c=_[_0xa597('0x18')](_0x1571b8['FaxInteractions'],'id');return _0x1571b8[_0xa597('0x50')](_0x1b739c)[_0xa597('0xd')](function(){for(var _0x1ef35a=0x0;_0x1ef35a<_0x1b739c[_0xa597('0x1d')];_0x1ef35a+=0x1){_0x1f19ab[_0xa597('0x4c')](_0xa597('0x51'),{'FaxInteractionId':Number(_0x1b739c[_0x1ef35a]),'UserId':Number(_0x1571b8['id'])});}});}})[_0xa597('0xd')](function(){if(_0x34c057===_0xa597('0x4a')){var _0x3c7a4c=_[_0xa597('0x18')](_0x1571b8[_0xa597('0x29')],'id');return _0x1571b8[_0xa597('0x52')](_0x3c7a4c)[_0xa597('0xd')](function(){for(var _0x5b0735=0x0;_0x5b0735<_0x3c7a4c[_0xa597('0x1d')];_0x5b0735+=0x1){_0x1f19ab['emit'](_0xa597('0x53'),{'SmsInteractionId':Number(_0x3c7a4c[_0x5b0735]),'UserId':Number(_0x1571b8['id'])});}});}})['then'](function(){if(_0x34c057==='leave'){var _0x4e05fa=_[_0xa597('0x18')](_0x1571b8['OpenchannelInteractions'],'id');return _0x1571b8[_0xa597('0x54')](_0x4e05fa)[_0xa597('0xd')](function(){for(var _0x3f0d07=0x0;_0x3f0d07<_0x4e05fa[_0xa597('0x1d')];_0x3f0d07+=0x1){_0x1f19ab[_0xa597('0x4c')](_0xa597('0x55'),{'OpenchannelInteractionId':Number(_0x4e05fa[_0x3f0d07]),'UserId':Number(_0x1571b8['id'])});}});}})['then'](function(){if(_0x34c057===_0xa597('0x4a')){var _0x5edd16=_[_0xa597('0x18')](_0x1571b8[_0xa597('0x2d')],'id');return _0x1571b8[_0xa597('0x56')](_0x5edd16)['then'](function(){for(var _0x1d4eda=0x0;_0x1d4eda<_0x5edd16['length'];_0x1d4eda+=0x1){_0x1f19ab[_0xa597('0x4c')](_0xa597('0x57'),{'WhatsappInteractionId':Number(_0x5edd16[_0x1d4eda]),'UserId':Number(_0x1571b8['id'])});}});}})['catch'](function(_0x30dfec){_0x1209ee[_0xa597('0x58')](_0x30dfec);});}}function onDisconnect(_0x54fbc8,_0x2e9646){joinOrLeave(_0x54fbc8,'leave',_0x2e9646);}function onConnect(_0x5d9dbf){joinOrLeave(_0x5d9dbf,'join');}exports['default']=function(_0x3aa09c){_0x3aa09c['on'](_0xa597('0x59'),function(_0x3d85c7){_0x3d85c7[_0xa597('0x5a')](0x0);_0x3d85c7[_0xa597('0x5b')]=_0x3d85c7['request'][_0xa597('0x59')][_0xa597('0x5c')]+':'+_0x3d85c7['request'][_0xa597('0x59')][_0xa597('0x5d')];_0x3d85c7[_0xa597('0x5e')]=new Date();_0x3d85c7[_0xa597('0x58')]=function(_0x42efb7){console[_0xa597('0x58')]('SocketIO\x20'+_0x3d85c7[_0xa597('0x5f')]['name']+'['+_0x3d85c7[_0xa597('0x5b')]+']',_0x42efb7);};_0x3d85c7['on'](_0xa597('0x60'),function(){onDisconnect(_0x3d85c7,_0x3aa09c);_0x3d85c7[_0xa597('0x58')]('DISCONNECTED');});onConnect(_0x3d85c7);_0x3d85c7[_0xa597('0x58')]('CONNECTED');});}; \ No newline at end of file +var _0x3249=['chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','leave','removeChatInteractions','emit','removeMailInteractions','FaxInteractions','removeFaxInteractions','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','join','default','connection','address','request','connectedAt','log','SocketIO\x20','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','./environment','Agents','name','role','telephone','agent','ivr','UserProfileSection','findOne','then','VoiceQueues','ChatQueues','SmsQueues','MailQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','resourceId','map','User','type','format','%s:queue:%s','length','user:%s','handshake','query','find','userProfileId','ChatInteractions','MailInteractions','FaxInteraction','OpenchannelInteraction','WhatsappInteractions','admin','voice:inbound','hasOwnProperty','include','push','ChatQueue','FaxQueue','MailQueue','OpenchannelQueue','Campaign','user','voice:outbound','VoiceQueue','FaxQueues','SmsQueue','Trunks','Trunk','getVoiceQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice'];(function(_0x506d2f,_0x5ab76e){var _0x101255=function(_0x1596b1){while(--_0x1596b1){_0x506d2f['push'](_0x506d2f['shift']());}};_0x101255(++_0x5ab76e);}(_0x3249,0xdf));var _0x9324=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0x3249[_0x15c421];return _0x5e5ed5;};'use strict';var _=require(_0x9324('0x0'));var util=require(_0x9324('0x1'));var BPromise=require(_0x9324('0x2'));var db=require('../mysqldb')['db'];var config=require(_0x9324('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x9324('0x4'),'model':db['User'],'attributes':['id',_0x9324('0x5'),_0x9324('0x6')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x9324('0x5')],'where':{'role':_0x9324('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x9324('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0x9324('0x5')],'where':{'role':_0x9324('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x9324('0x5'),'type'],'where':{'type':_0x9324('0x9')}};function getAssociatedResources(_0x75ebf6,_0x557fc4,_0x194f92){return db[_0x9324('0xa')][_0x9324('0xb')]({'where':{'name':_0x75ebf6,'userProfileId':_0x557fc4},'raw':!![]})[_0x9324('0xc')](function(_0x515d45){if(_0x515d45){if(_0x515d45['autoAssociation']){switch(_0x75ebf6){case _0x9324('0xd'):case _0x9324('0xe'):case'FaxQueues':case _0x9324('0xf'):case _0x9324('0x10'):case'OpenchannelQueues':case'WhatsappQueues':return db[_0x194f92][_0x9324('0x11')](queryQueues);case _0x9324('0x12'):return db[_0x194f92][_0x9324('0x11')](queryTelephones);case'Trunks':return db[_0x194f92][_0x9324('0x11')](queryTrunks);case _0x9324('0x13'):return db[_0x194f92][_0x9324('0x11')](queryCampaigns);}}else{return db[_0x9324('0x14')]['findAll']({'attributes':[_0x9324('0x15')],'where':{'sectionId':_0x515d45['id']},'raw':!![]})[_0x9324('0xc')](function(_0x2edd75){if(_0x2edd75){var _0xbdf151={'where':{'id':_[_0x9324('0x16')](_0x2edd75,_0x9324('0x15'))},'raw':!![]};switch(_0x194f92){case _0x9324('0x17'):_0xbdf151['where'][_0x9324('0x6')]=_0x9324('0x7');break;case'Campaign':_0xbdf151['where'][_0x9324('0x18')]='ivr';break;}return db[_0x194f92][_0x9324('0x11')](_0xbdf151);}else{return[];}});}}else{return[];}})['then'](function(_0x1905a8){return _0x1905a8;});}function joinOrLeaveQueues(_0x3cf05b,_0x4a42b3,_0x37f6bd,_0x43e358){_0x3cf05b[_0x4a42b3](util[_0x9324('0x19')](_0x9324('0x1a'),_0x37f6bd,_0x43e358[_0x9324('0x5')]));if(_0x43e358['Agents']){for(var _0x1bfff5=0x0;_0x1bfff5<_0x43e358['Agents'][_0x9324('0x1b')];_0x1bfff5+=0x1){_0x3cf05b[_0x4a42b3](util[_0x9324('0x19')](_0x9324('0x1c'),_0x43e358[_0x9324('0x4')][_0x1bfff5]['name']));}}}function joinOrLeave(_0x126e4a,_0x4e547d,_0x52167d){var _0x4ee8d6;if(_0x126e4a[_0x9324('0x1d')][_0x9324('0x1e')]['id']){db[_0x9324('0x17')][_0x9324('0x1f')]({'attributes':['id','name',_0x9324('0x6'),_0x9324('0x20')],'where':{'id':_0x126e4a[_0x9324('0x1d')][_0x9324('0x1e')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x9324('0x21'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x9324('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x9324('0x23')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x9324('0x24')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x9324('0x25'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x4af562){if(_0x4af562){_0x4ee8d6=_0x4af562;_0x126e4a[_0x4e547d](util[_0x9324('0x19')](_0x9324('0x1c'),_0x4af562['name']));var _0x3aa2db=[];switch(_0x4af562['role']){case _0x9324('0x26'):_0x126e4a[_0x4e547d](_0x9324('0x27'));_0x126e4a[_0x4e547d]('voice:outbound');if(queryQueues[_0x9324('0x28')](_0x9324('0x29'))){delete queryQueues[_0x9324('0x29')];}_0x3aa2db[_0x9324('0x2a')](db['VoiceQueue'][_0x9324('0x11')](queryQueues));_0x3aa2db['push'](db[_0x9324('0x2b')][_0x9324('0x11')](queryQueues));_0x3aa2db[_0x9324('0x2a')](db[_0x9324('0x2c')]['findAll'](queryQueues));_0x3aa2db['push'](db['SmsQueue'][_0x9324('0x11')](queryQueues));_0x3aa2db[_0x9324('0x2a')](db[_0x9324('0x2d')][_0x9324('0x11')](queryQueues));_0x3aa2db[_0x9324('0x2a')](db[_0x9324('0x2e')][_0x9324('0x11')](queryQueues));_0x3aa2db[_0x9324('0x2a')](db['WhatsappQueue'][_0x9324('0x11')](queryQueues));_0x3aa2db[_0x9324('0x2a')](db[_0x9324('0x17')][_0x9324('0x11')](queryTelephones));_0x3aa2db[_0x9324('0x2a')](db['Trunk'][_0x9324('0x11')](queryTrunks));_0x3aa2db[_0x9324('0x2a')](db[_0x9324('0x2f')][_0x9324('0x11')](queryCampaigns));_0x3aa2db['push'](db[_0x9324('0x17')][_0x9324('0x11')](queryAgents));break;case _0x9324('0x30'):_0x126e4a[_0x4e547d]('voice:inbound');_0x126e4a[_0x4e547d](_0x9324('0x31'));_0x3aa2db[_0x9324('0x2a')](getAssociatedResources('VoiceQueues',_0x4af562['userProfileId'],_0x9324('0x32')));_0x3aa2db['push'](getAssociatedResources(_0x9324('0xe'),_0x4af562[_0x9324('0x20')],_0x9324('0x2b')));_0x3aa2db[_0x9324('0x2a')](getAssociatedResources(_0x9324('0x33'),_0x4af562[_0x9324('0x20')],_0x9324('0x2c')));_0x3aa2db[_0x9324('0x2a')](getAssociatedResources(_0x9324('0xf'),_0x4af562['userProfileId'],_0x9324('0x34')));_0x3aa2db[_0x9324('0x2a')](getAssociatedResources(_0x9324('0x10'),_0x4af562[_0x9324('0x20')],_0x9324('0x2d')));_0x3aa2db[_0x9324('0x2a')](getAssociatedResources('OpenchannelQueues',_0x4af562[_0x9324('0x20')],_0x9324('0x2e')));_0x3aa2db[_0x9324('0x2a')](getAssociatedResources('WhatsappQueues',_0x4af562['userProfileId'],'WhatsappQueue'));_0x3aa2db[_0x9324('0x2a')](getAssociatedResources('Telephones',_0x4af562[_0x9324('0x20')],'User'));_0x3aa2db[_0x9324('0x2a')](getAssociatedResources(_0x9324('0x35'),_0x4af562['userProfileId'],_0x9324('0x36')));_0x3aa2db[_0x9324('0x2a')](getAssociatedResources(_0x9324('0x13'),_0x4af562[_0x9324('0x20')],_0x9324('0x2f')));_0x3aa2db[_0x9324('0x2a')](db[_0x9324('0x17')][_0x9324('0x11')](queryAgents));break;case _0x9324('0x8'):_0x126e4a[_0x4e547d](_0x9324('0x27'));_0x126e4a[_0x4e547d](_0x9324('0x31'));_0x3aa2db['push'](_0x4af562[_0x9324('0x37')]({'attributes':['id',_0x9324('0x5')]}));_0x3aa2db[_0x9324('0x2a')](_0x4af562['getChatQueues']({'attributes':['id',_0x9324('0x5')]}));_0x3aa2db['push'](_0x4af562['getFaxQueues']({'attributes':['id',_0x9324('0x5')]}));_0x3aa2db[_0x9324('0x2a')](_0x4af562[_0x9324('0x38')]({'attributes':['id','name']}));_0x3aa2db[_0x9324('0x2a')](_0x4af562[_0x9324('0x39')]({'attributes':['id',_0x9324('0x5')]}));_0x3aa2db[_0x9324('0x2a')](_0x4af562[_0x9324('0x3a')]({'attributes':['id','name']}));_0x3aa2db[_0x9324('0x2a')](_0x4af562[_0x9324('0x3b')]({'attributes':['id',_0x9324('0x5')]}));break;}return BPromise[_0x9324('0x3c')](_0x3aa2db);}})[_0x9324('0xc')](function(_0x224b24){if(_0x224b24&&_0x224b24[_0x9324('0x1b')]){for(var _0xb0f451=0x0;_0xb0f451<_0x224b24['length'];_0xb0f451+=0x1){for(var _0x40ff28=0x0;_0x40ff28<_0x224b24[_0xb0f451][_0x9324('0x1b')];_0x40ff28+=0x1){switch(_0xb0f451){case 0x0:joinOrLeaveQueues(_0x126e4a,_0x4e547d,_0x9324('0x3d'),_0x224b24[_0xb0f451][_0x40ff28]);break;case 0x1:joinOrLeaveQueues(_0x126e4a,_0x4e547d,_0x9324('0x3e'),_0x224b24[_0xb0f451][_0x40ff28]);break;case 0x2:joinOrLeaveQueues(_0x126e4a,_0x4e547d,_0x9324('0x3f'),_0x224b24[_0xb0f451][_0x40ff28]);break;case 0x3:joinOrLeaveQueues(_0x126e4a,_0x4e547d,_0x9324('0x40'),_0x224b24[_0xb0f451][_0x40ff28]);break;case 0x4:joinOrLeaveQueues(_0x126e4a,_0x4e547d,_0x9324('0x41'),_0x224b24[_0xb0f451][_0x40ff28]);break;case 0x5:joinOrLeaveQueues(_0x126e4a,_0x4e547d,_0x9324('0x42'),_0x224b24[_0xb0f451][_0x40ff28]);break;case 0x6:joinOrLeaveQueues(_0x126e4a,_0x4e547d,_0x9324('0x43'),_0x224b24[_0xb0f451][_0x40ff28]);break;case 0x7:if(_0x4ee8d6[_0x9324('0x6')]!==_0x9324('0x8'))_0x126e4a[_0x4e547d](util[_0x9324('0x19')](_0x9324('0x44'),_0x224b24[_0xb0f451][_0x40ff28]['name']));break;case 0x8:if(_0x4ee8d6['role']!==_0x9324('0x8'))_0x126e4a[_0x4e547d](util[_0x9324('0x19')](_0x9324('0x45'),_0x224b24[_0xb0f451][_0x40ff28]['name']));break;case 0x9:if(_0x4ee8d6[_0x9324('0x6')]!=='agent')_0x126e4a[_0x4e547d](util[_0x9324('0x19')]('campaign:%s:%s',_0x224b24[_0xb0f451][_0x40ff28][_0x9324('0x18')],_0x224b24[_0xb0f451][_0x40ff28]['name']));break;case 0xa:_0x126e4a[_0x4e547d](util[_0x9324('0x19')]('user:%s',_0x224b24[_0xb0f451][_0x40ff28]['name']));break;}}}}})['then'](function(){if(_0x4e547d===_0x9324('0x46')){var _0x2c8a18=_[_0x9324('0x16')](_0x4ee8d6['ChatInteractions'],'id');return _0x4ee8d6[_0x9324('0x47')](_0x2c8a18)[_0x9324('0xc')](function(){for(var _0x50122a=0x0;_0x50122a<_0x2c8a18[_0x9324('0x1b')];_0x50122a+=0x1){_0x52167d[_0x9324('0x48')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x2c8a18[_0x50122a]),'UserId':Number(_0x4ee8d6['id'])});}});}})[_0x9324('0xc')](function(){if(_0x4e547d==='leave'){var _0x45c323=_[_0x9324('0x16')](_0x4ee8d6[_0x9324('0x22')],'id');return _0x4ee8d6[_0x9324('0x49')](_0x45c323)[_0x9324('0xc')](function(){for(var _0x5bf9fa=0x0;_0x5bf9fa<_0x45c323['length'];_0x5bf9fa+=0x1){_0x52167d[_0x9324('0x48')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x45c323[_0x5bf9fa]),'UserId':Number(_0x4ee8d6['id'])});}});}})[_0x9324('0xc')](function(){if(_0x4e547d===_0x9324('0x46')){var _0x46f952=_[_0x9324('0x16')](_0x4ee8d6[_0x9324('0x4a')],'id');return _0x4ee8d6[_0x9324('0x4b')](_0x46f952)[_0x9324('0xc')](function(){for(var _0x5acc4b=0x0;_0x5acc4b<_0x46f952[_0x9324('0x1b')];_0x5acc4b+=0x1){_0x52167d[_0x9324('0x48')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x46f952[_0x5acc4b]),'UserId':Number(_0x4ee8d6['id'])});}});}})[_0x9324('0xc')](function(){if(_0x4e547d===_0x9324('0x46')){var _0x3bdc8c=_['map'](_0x4ee8d6[_0x9324('0x4c')],'id');return _0x4ee8d6[_0x9324('0x4d')](_0x3bdc8c)[_0x9324('0xc')](function(){for(var _0x3ad6d3=0x0;_0x3ad6d3<_0x3bdc8c['length'];_0x3ad6d3+=0x1){_0x52167d[_0x9324('0x48')](_0x9324('0x4e'),{'SmsInteractionId':Number(_0x3bdc8c[_0x3ad6d3]),'UserId':Number(_0x4ee8d6['id'])});}});}})[_0x9324('0xc')](function(){if(_0x4e547d===_0x9324('0x46')){var _0x226f35=_[_0x9324('0x16')](_0x4ee8d6['OpenchannelInteractions'],'id');return _0x4ee8d6[_0x9324('0x4f')](_0x226f35)[_0x9324('0xc')](function(){for(var _0x227f42=0x0;_0x227f42<_0x226f35[_0x9324('0x1b')];_0x227f42+=0x1){_0x52167d[_0x9324('0x48')](_0x9324('0x50'),{'OpenchannelInteractionId':Number(_0x226f35[_0x227f42]),'UserId':Number(_0x4ee8d6['id'])});}});}})[_0x9324('0xc')](function(){if(_0x4e547d==='leave'){var _0x2ac11b=_['map'](_0x4ee8d6['WhatsappInteractions'],'id');return _0x4ee8d6[_0x9324('0x51')](_0x2ac11b)['then'](function(){for(var _0x5a9709=0x0;_0x5a9709<_0x2ac11b[_0x9324('0x1b')];_0x5a9709+=0x1){_0x52167d[_0x9324('0x48')](_0x9324('0x52'),{'WhatsappInteractionId':Number(_0x2ac11b[_0x5a9709]),'UserId':Number(_0x4ee8d6['id'])});}});}})[_0x9324('0x53')](function(_0xbb664a){_0x126e4a['log'](_0xbb664a);});}}function onDisconnect(_0x239fc5,_0x40ebc0){joinOrLeave(_0x239fc5,_0x9324('0x46'),_0x40ebc0);}function onConnect(_0x2c3d7f){joinOrLeave(_0x2c3d7f,_0x9324('0x54'));}exports[_0x9324('0x55')]=function(_0x533b53){_0x533b53['on'](_0x9324('0x56'),function(_0x58d68e){_0x58d68e['setMaxListeners'](0x0);_0x58d68e[_0x9324('0x57')]=_0x58d68e[_0x9324('0x58')][_0x9324('0x56')]['remoteAddress']+':'+_0x58d68e[_0x9324('0x58')][_0x9324('0x56')]['remotePort'];_0x58d68e[_0x9324('0x59')]=new Date();_0x58d68e[_0x9324('0x5a')]=function(_0x2fa8a5){console[_0x9324('0x5a')](_0x9324('0x5b')+_0x58d68e['nsp'][_0x9324('0x5')]+'['+_0x58d68e[_0x9324('0x57')]+']',_0x2fa8a5);};_0x58d68e['on'](_0x9324('0x5c'),function(){onDisconnect(_0x58d68e,_0x533b53);_0x58d68e[_0x9324('0x5a')](_0x9324('0x5d'));});onConnect(_0x58d68e);_0x58d68e[_0x9324('0x5a')](_0x9324('0x5e'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index e89e7a1..77a4515 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 _0xfab5=['code','catch','get','channel','motionChannel','direction','undefined','query','Sequelize','QueryTypes','SELECT','contact','UserId','format','SIP/%s','name','agent','incomingmessage','AfterCreateMessage','event','offlineMessage','opened','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','interface','AfterCreate','changed','closed','substatus','sequelize','AfterUpdate','find','fullname','email','internal','default','model','hook','callback','../../mysqldb','jayson/promise','triggers','client','http','Chat','ChatInteraction','afterCreate','closedinteraction','ChatMessage','newmessage','ChatOfflineMessage','SmsInteraction','newinteraction','Sms','afterUpdate','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error'];(function(_0x59df7b,_0x983c68){var _0x51e7f2=function(_0x40951e){while(--_0x40951e){_0x59df7b['push'](_0x59df7b['shift']());}};_0x51e7f2(++_0x983c68);}(_0xfab5,0x199));var _0x5fab=function(_0xb8a1d5,_0x4b63d6){_0xb8a1d5=_0xb8a1d5-0x0;var _0xc4fc3d=_0xfab5[_0xb8a1d5];return _0xc4fc3d;};'use strict';var util=require('util');var db=require(_0x5fab('0x0'))['db'];var jayson=require(_0x5fab('0x1'));var logger=require('../logger')(_0x5fab('0x2'));var client=jayson[_0x5fab('0x3')][_0x5fab('0x4')]({'port':0x232a});var triggers=[{'channel':_0x5fab('0x5'),'model':_0x5fab('0x6'),'event':_0x5fab('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x5fab('0x5'),'model':'ChatInteraction','event':'afterUpdate','condition':_0x5fab('0x8'),'callback':afterUpdate},{'channel':_0x5fab('0x5'),'model':_0x5fab('0x9'),'event':_0x5fab('0x7'),'condition':_0x5fab('0xa'),'callback':afterCreateMessage},{'channel':_0x5fab('0x5'),'model':_0x5fab('0xb'),'event':'afterCreate','condition':_0x5fab('0xa'),'callback':afterCreateOfflineMessage},{'channel':'Sms','model':_0x5fab('0xc'),'event':_0x5fab('0x7'),'condition':_0x5fab('0xd'),'callback':afterCreate},{'channel':_0x5fab('0xe'),'model':'SmsInteraction','event':_0x5fab('0xf'),'condition':_0x5fab('0x8'),'callback':afterUpdate},{'channel':'Sms','model':_0x5fab('0x10'),'event':_0x5fab('0x7'),'condition':_0x5fab('0xa'),'callback':afterCreateMessage},{'channel':_0x5fab('0x11'),'model':'WhatsappInteraction','event':_0x5fab('0x7'),'condition':_0x5fab('0xd'),'callback':afterCreate},{'channel':_0x5fab('0x11'),'model':_0x5fab('0x12'),'event':_0x5fab('0xf'),'condition':_0x5fab('0x8'),'callback':afterUpdate},{'channel':_0x5fab('0x11'),'model':_0x5fab('0x13'),'event':_0x5fab('0x7'),'condition':_0x5fab('0xa'),'callback':afterCreateMessage},{'channel':_0x5fab('0x14'),'model':_0x5fab('0x15'),'event':'afterCreate','condition':_0x5fab('0xd'),'callback':afterCreate},{'channel':_0x5fab('0x14'),'model':_0x5fab('0x15'),'event':_0x5fab('0xf'),'condition':_0x5fab('0x8'),'callback':afterUpdate},{'channel':_0x5fab('0x14'),'model':_0x5fab('0x16'),'event':_0x5fab('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x5fab('0x17'),'model':_0x5fab('0x18'),'event':'afterCreate','condition':_0x5fab('0xd'),'callback':afterCreate},{'channel':_0x5fab('0x17'),'model':_0x5fab('0x18'),'event':'afterUpdate','condition':_0x5fab('0x8'),'callback':afterUpdate},{'channel':'Mail','model':_0x5fab('0x19'),'event':_0x5fab('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x5fab('0x1a'),'model':_0x5fab('0x1b'),'event':_0x5fab('0x7'),'condition':_0x5fab('0xd'),'callback':afterCreate},{'channel':'Openchannel','model':_0x5fab('0x1b'),'event':_0x5fab('0xf'),'condition':_0x5fab('0x8'),'callback':afterUpdate},{'channel':_0x5fab('0x1a'),'model':_0x5fab('0x1c'),'event':_0x5fab('0x7'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x55dd1f){return client[_0x5fab('0x1d')](_0x5fab('0x1e'),_0x55dd1f)[_0x5fab('0x1f')](function(_0x4a3d65){logger[_0x5fab('0x20')](_0x5fab('0x21'),'EventManager',_0x4a3d65);if(_0x4a3d65[_0x5fab('0x22')]){if(_0x4a3d65['error'][_0x5fab('0x23')]===0x1f4){logger[_0x5fab('0x22')]('Trigger,\x20%s','EventManager',_0x4a3d65['error']);}}})[_0x5fab('0x24')](function(_0x121743){logger[_0x5fab('0x22')](_0x5fab('0x21'),_0x5fab('0x1e'),_0x121743);});}function afterCreateMessage(_0x3d53e9){return function(_0x236846){_0x236846=_0x236846[_0x5fab('0x25')]({'plain':!![]});_0x236846[_0x5fab('0x26')]=_0x3d53e9;_0x236846[_0x5fab('0x27')]=_0x3d53e9;_0x236846['event']=_0x236846[_0x5fab('0x28')];Promise['resolve']()[_0x5fab('0x1f')](function(){if(typeof _0x236846['ContactId']===_0x5fab('0x29'))return null;var _0x36ae61='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x236846['ContactId'];return db['sequelize'][_0x5fab('0x2a')](_0x36ae61,{'type':db[_0x5fab('0x2b')][_0x5fab('0x2c')][_0x5fab('0x2d')],'raw':!![]});})['then'](function(_0x4f0f73){if(_0x4f0f73){_0x236846[_0x5fab('0x2e')]=_0x4f0f73[0x0];}if(typeof _0x236846[_0x5fab('0x2f')]==='undefined')return;return getAgent(_0x236846[_0x5fab('0x2f')]);})['then'](function(_0xcd4373){if(_0xcd4373){_0x236846['interface']=util[_0x5fab('0x30')](_0x5fab('0x31'),_0xcd4373[_0x5fab('0x32')]);_0x236846[_0x5fab('0x33')]=_0xcd4373;_0x236846[_0x5fab('0x26')]=_0x3d53e9;return request({'event':_0x5fab('0x34'),'message':_0x236846});}else{return request({'event':'outgoingmessage','message':_0x236846});}})[_0x5fab('0x24')](function(_0x154c67){logger[_0x5fab('0x22')](_0x5fab('0x21'),_0x5fab('0x35'),_0x154c67);});};}function afterCreateOfflineMessage(_0x3f681f){return function(_0x179ec7){_0x179ec7=_0x179ec7[_0x5fab('0x25')]({'plain':!![]});_0x179ec7[_0x5fab('0x26')]=_0x3f681f;_0x179ec7[_0x5fab('0x27')]=_0x3f681f;_0x179ec7[_0x5fab('0x36')]=_0x5fab('0x37');return request({'event':_0x179ec7[_0x5fab('0x36')],'message':_0x179ec7});};}function afterCreate(_0x3ba3c5,_0x95fbd4){return function(_0x35b9f7){_0x35b9f7=_0x35b9f7[_0x5fab('0x25')]({'plain':!![]});_0x35b9f7[_0x5fab('0x26')]=_0x3ba3c5;_0x35b9f7[_0x5fab('0x27')]=_0x3ba3c5;_0x35b9f7[_0x5fab('0x36')]=_0x5fab('0x38');Promise['resolve']()[_0x5fab('0x1f')](function(){var _0x20bb3e=_0x5fab('0x39')+_0x35b9f7[_0x5fab('0x3a')];return db['sequelize'][_0x5fab('0x2a')](_0x20bb3e,{'type':db['Sequelize'][_0x5fab('0x2c')][_0x5fab('0x2d')],'raw':!![]});})[_0x5fab('0x1f')](function(_0x14a355){if(_0x14a355){_0x35b9f7[_0x5fab('0x2e')]=_0x14a355[0x0];}if(typeof _0x35b9f7[_0x5fab('0x2f')]==='undefined')return;return getAgent(_0x35b9f7['UserId']);})['then'](function(_0x28ac60){if(_0x28ac60){_0x35b9f7[_0x5fab('0x3b')]=util[_0x5fab('0x30')](_0x5fab('0x31'),_0x28ac60[_0x5fab('0x32')]);_0x35b9f7[_0x5fab('0x33')]=_0x28ac60;}return request({'event':_0x95fbd4,'message':_0x35b9f7});})['catch'](function(_0x2dbcd4){logger['error'](_0x5fab('0x21'),_0x5fab('0x3c'),_0x2dbcd4);});};}function afterUpdate(_0x272125){return function(_0x5ee739){var _0x4a1ed5=_0x5ee739[_0x5fab('0x3d')](_0x5fab('0x3e'))&&_0x5ee739[_0x5fab('0x3e')];var _0x3355b5=_0x5ee739[_0x5fab('0x3d')](_0x5fab('0x3f'));if(_0x4a1ed5||_0x3355b5){var _0x178a5a=_0x4a1ed5?_0x5fab('0x8'):_0x5fab('0x3f');var _0x45a059=_0x5ee739[_0x5fab('0x25')]({'plain':!![]});_0x45a059[_0x5fab('0x26')]=_0x272125;_0x45a059[_0x5fab('0x27')]=_0x272125;_0x45a059['event']=_0x4a1ed5?_0x5fab('0x3e'):_0x5fab('0x3f');var _0x818add='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x45a059['ContactId'];return db[_0x5fab('0x40')]['query'](_0x818add,{'type':db['Sequelize'][_0x5fab('0x2c')]['SELECT'],'raw':!![]})[_0x5fab('0x1f')](function(_0x3074f6){if(_0x3074f6){_0x45a059['contact']=_0x3074f6[0x0];}if(typeof _0x45a059[_0x5fab('0x2f')]==='undefined')return;return getAgent(_0x45a059[_0x5fab('0x2f')]);})[_0x5fab('0x1f')](function(_0x2cc39c){if(_0x2cc39c){_0x45a059['interface']=util[_0x5fab('0x30')](_0x5fab('0x31'),_0x2cc39c[_0x5fab('0x32')]);_0x45a059['agent']=_0x2cc39c;}return request({'event':_0x178a5a,'message':_0x45a059});})[_0x5fab('0x24')](function(_0x2b5ea1){logger['error'](_0x5fab('0x21'),_0x5fab('0x41'),_0x2b5ea1);});}};}function getAgent(_0x297437){return db['User'][_0x5fab('0x42')]({'where':{'id':_0x297437},'attributes':['id','name',_0x5fab('0x43'),_0x5fab('0x44'),_0x5fab('0x45')],'raw':!![]})['then'](function(_0x1c1908){return _0x1c1908;});}exports[_0x5fab('0x46')]=function(){for(var _0x41c107=0x0;_0x41c107=_0x109ce6[_0x4769('0x13')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0xa602a1(_0x418824);})[_0x4769('0x14')](function(_0xcde21){_0x4821fc(_0xcde21);});});}; \ No newline at end of file +var _0xc7b6=['agent','User','count','then','agents','catch','lodash','bluebird','./license/util','voice','mail','fax','sms','openchannel','getChannels','isValidChannel','toLowerCase','includes','isUndefined','updateAttributes','getLicense','role'];(function(_0x42f334,_0x693b11){var _0x28ee8e=function(_0x46c467){while(--_0x46c467){_0x42f334['push'](_0x42f334['shift']());}};_0x28ee8e(++_0x693b11);}(_0xc7b6,0xa0));var _0x6c7b=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xc7b6[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x6c7b('0x0'));var BPromise=require(_0x6c7b('0x1'));var db=require('../mysqldb')['db'];var util=require(_0x6c7b('0x2'));var channels=[_0x6c7b('0x3'),_0x6c7b('0x4'),'chat',_0x6c7b('0x5'),_0x6c7b('0x6'),'whatsapp',_0x6c7b('0x7')];exports[_0x6c7b('0x8')]=function(){return channels;};exports[_0x6c7b('0x9')]=function(_0x36880b){_0x36880b=_0x36880b[_0x6c7b('0xa')]();return _[_0x6c7b('0xb')](channels,_0x36880b);};exports['clearBlockUser']=function(_0x3bd10c,_0x31605d,_0x42fa83,_0x2348aa){var _0xb6ab42={'loginAttempts':_0x31605d,'blocked':_0x42fa83};if(!_[_0x6c7b('0xc')](_0x2348aa)){_0xb6ab42['blockedAt']=_0x2348aa;}return _0x3bd10c[_0x6c7b('0xd')](_0xb6ab42);};exports[_0x6c7b('0xe')]=function(_0x5dd296){return new BPromise(function(_0x5d77cb,_0x1abc29){var _0x1b1a54=0x0;if(_0x5dd296[_0x6c7b('0xf')]!==_0x6c7b('0x10')){_0x5d77cb(_0x5dd296);}db[_0x6c7b('0x11')][_0x6c7b('0x12')]({'where':{'role':_0x6c7b('0x10'),'online':!![],'id':{'$ne':_0x5dd296['id']}}})['then'](function(_0x3a6b1c){_0x1b1a54=_0x3a6b1c;return util[_0x6c7b('0xe')]();})[_0x6c7b('0x13')](function(_0x20f088){if(_0x20f088&&_0x20f088[_0x6c7b('0x14')]&&_0x1b1a54>=_0x20f088['agents']){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x5d77cb(_0x5dd296);})[_0x6c7b('0x15')](function(_0x4ebfde){_0x1abc29(_0x4ebfde);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 743859f..483032e 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x153f=['inherits','Forbidden','OutOfInterval','error','status','send','exports','util','../config/logger','api','message','Internal\x20Server\x20Error','Error','Bad\x20Request','name','Entity\x20not\x20found','Not\x20Found'];(function(_0x34f6de,_0x57ac16){var _0x7680e6=function(_0x157116){while(--_0x157116){_0x34f6de['push'](_0x34f6de['shift']());}};_0x7680e6(++_0x57ac16);}(_0x153f,0x15b));var _0xf153=function(_0xb1513f,_0x319b3d){_0xb1513f=_0xb1513f-0x0;var _0xf7ff8b=_0x153f[_0xb1513f];return _0xf7ff8b;};'use strict';var util=require(_0xf153('0x0'));var logger=require(_0xf153('0x1'))(_0xf153('0x2'));var APIError=function(_0x44cea3,_0x2afb9a){this[_0xf153('0x3')]=_0x44cea3||_0xf153('0x4');this['name']=_0x2afb9a||_0xf153('0x5');util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x1f9ead){this[_0xf153('0x3')]=_0x1f9ead||_0xf153('0x6');this[_0xf153('0x7')]=_0xf153('0x6');util['inherits'](APIBadRequestError,APIError);};var APINotFoundError=function(_0x17ba96){this[_0xf153('0x3')]=_0x17ba96||_0xf153('0x8');this[_0xf153('0x7')]=_0xf153('0x9');util[_0xf153('0xa')](APINotFoundError,APIError);};function getStatusCode(_0x44845c){switch(_0x44845c){case _0xf153('0x6'):return 0x190;case _0xf153('0xb'),_0xf153('0xc'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function handleError(_0x2b76eb){return function(_0x1c8de7){logger[_0xf153('0xd')](_0x1c8de7['stack']);var _0x3a8838=getStatusCode(_0x1c8de7[_0xf153('0x7')]);if(_0x1c8de7[_0xf153('0x7')])delete _0x1c8de7[_0xf153('0x7')];return _0x2b76eb[_0xf153('0xe')](_0x3a8838)[_0xf153('0xf')](_0x1c8de7);};}module[_0xf153('0x10')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xda3f=['inherits','message','Bad\x20Request','Entity\x20not\x20found','name','Not\x20Found','Forbidden','OutOfInterval','error','stack','send','exports','../config/logger','api','Internal\x20Server\x20Error','Error'];(function(_0x176491,_0x2be97f){var _0x228825=function(_0x4b7d97){while(--_0x4b7d97){_0x176491['push'](_0x176491['shift']());}};_0x228825(++_0x2be97f);}(_0xda3f,0xec));var _0xfda3=function(_0x3c722c,_0x490d38){_0x3c722c=_0x3c722c-0x0;var _0x5a6081=_0xda3f[_0x3c722c];return _0x5a6081;};'use strict';var util=require('util');var logger=require(_0xfda3('0x0'))(_0xfda3('0x1'));var APIError=function(_0x534697,_0x5299b0){this['message']=_0x534697||_0xfda3('0x2');this['name']=_0x5299b0||_0xfda3('0x3');util[_0xfda3('0x4')](APIError,Error);};var APIBadRequestError=function(_0x516500){this[_0xfda3('0x5')]=_0x516500||_0xfda3('0x6');this['name']='Bad\x20Request';util[_0xfda3('0x4')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x42476a){this[_0xfda3('0x5')]=_0x42476a||_0xfda3('0x7');this[_0xfda3('0x8')]=_0xfda3('0x9');util[_0xfda3('0x4')](APINotFoundError,APIError);};function getStatusCode(_0x1b1ea6){switch(_0x1b1ea6){case _0xfda3('0x6'):return 0x190;case _0xfda3('0xa'),_0xfda3('0xb'):return 0x193;case _0xfda3('0x9'):return 0x194;default:return 0x1f4;}}function handleError(_0x4d7841){return function(_0xe933f5){logger[_0xfda3('0xc')](_0xe933f5[_0xfda3('0xd')]);var _0x11afc1=getStatusCode(_0xe933f5[_0xfda3('0x8')]);if(_0xe933f5['name'])delete _0xe933f5[_0xfda3('0x8')];return _0x4d7841['status'](_0x11afc1)[_0xfda3('0xe')](_0xe933f5);};}module[_0xfda3('0xf')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index fc26445..2ae8ac2 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x24ff=['404','status','render','json','send'];(function(_0x3d388a,_0x12a591){var _0x3370fd=function(_0x5f109e){while(--_0x5f109e){_0x3d388a['push'](_0x3d388a['shift']());}};_0x3370fd(++_0x12a591);}(_0x24ff,0x78));var _0xf24f=function(_0x579911,_0x3f8537){_0x579911=_0x579911-0x0;var _0x5d5ec5=_0x24ff[_0x579911];return _0x5d5ec5;};'use strict';module['exports'][0x194]=function pageNotFound(_0x35d162,_0x504734){var _0x44b124=_0xf24f('0x0');var _0x3219e7=0x194;var _0x2147da={'status':_0x3219e7};_0x504734[_0xf24f('0x1')](_0x2147da[_0xf24f('0x1')]);_0x504734[_0xf24f('0x2')](_0x44b124,{},function(_0x51d6e4,_0x93dd96){if(_0x51d6e4){return _0x504734[_0xf24f('0x1')](_0x2147da[_0xf24f('0x1')])[_0xf24f('0x3')](_0x2147da);}_0x504734[_0xf24f('0x4')](_0x93dd96);});}; \ No newline at end of file +var _0x5d9d=['404','status','json','send'];(function(_0x561f25,_0x2d95c1){var _0x150e4c=function(_0x266e99){while(--_0x266e99){_0x561f25['push'](_0x561f25['shift']());}};_0x150e4c(++_0x2d95c1);}(_0x5d9d,0xcc));var _0xd5d9=function(_0x401407,_0x4e4422){_0x401407=_0x401407-0x0;var _0x49118e=_0x5d9d[_0x401407];return _0x49118e;};'use strict';module['exports'][0x194]=function pageNotFound(_0x370e46,_0x1cd89a){var _0x43d971=_0xd5d9('0x0');var _0x1259ae=0x194;var _0x25dde9={'status':_0x1259ae};_0x1cd89a[_0xd5d9('0x1')](_0x25dde9['status']);_0x1cd89a['render'](_0x43d971,{},function(_0x38f0e1,_0x5d7519){if(_0x38f0e1){return _0x1cd89a[_0xd5d9('0x1')](_0x25dde9[_0xd5d9('0x1')])[_0xd5d9('0x2')](_0x25dde9);}_0x1cd89a[_0xd5d9('0x3')](_0x5d7519);});}; \ No newline at end of file diff --git a/server/files/chat/iframe.ejs b/server/files/chat/iframe.ejs index 602699d..d0a4155 100644 --- a/server/files/chat/iframe.ejs +++ b/server/files/chat/iframe.ejs @@ -1,81 +1,21 @@ (function() { 'use strict'; - - const chatOrigin = '{{{remote}}}' - const chatPath = '/snippet/' - // Only for V2 and Proxy - const chatVersion = '3.1.0' - - // Iframe localstorage whitelisting - const allowedOrigins = [chatOrigin] - - function remoteLocalStorageEventHandler(event){ - if (allowedOrigins.includes(event.origin)) { - const { action, key, value } = event.data - const localStorage = window.localStorage - switch(action){ - case 'setItem': - { - localStorage.setItem(key, JSON.stringify(value)) - event.source.postMessage( - { - action: 'setItemResult', - key - }, event.origin) - } - break - case 'getItem': - { - let item = localStorage.getItem(key) - if(item){ - try { - item = JSON.parse(item) - } catch (error) { - console.error('Cannot read data from localstorage', error) - } - } - event.source.postMessage( - { - action: 'getItemResult', - key, - item - }, event.origin) - } - break - case 'removeItem': - { - localStorage.removeItem(key) - event.source.postMessage( - { - action: 'removeItemResult', - key - }, event.origin) - } - break - default: - typeof action === 'string' && console.debug('Unsupported action', action) - break; - } - } - } - - let iframe = document.createElement('iframe'); + var iframe = document.createElement('iframe'); // Attributes iframe['id'] = 'motion-chat-iframe'; - iframe['src'] = chatOrigin + chatPath + '?location=' + btoa(window.location.host) + '&version=' + chatVersion + '&{{{query}}}'; + iframe['src'] = '{{{remote}}}/snippet?location=' + btoa(window.location.host) + '&version=3.0.0&{{{query}}}'; - let alignment="<%=alignment%>"; - let verticalAlignment="<%=verticalAlignment%>"; - - let iframe_status = false; + var alignment="<%=alignment%>"; + var verticalAlignment="<%=verticalAlignment%>"; + var iframe_status = false; document.documentElement.style.setProperty('--xc-ws-div-color', '<%=div_color%>'); document.documentElement.style.setProperty('--xc-ws-text-color', '<%=text_color%>'); - document.documentElement.style.setProperty('--xc-ws-button-color', '<%=button_color%>'); + document.documentElement.style.setProperty('--xc-ws-button_color', '<%=button_color%>'); document.documentElement.style.setProperty('--xc-ws-background-color', '<%=background_color%>'); - let link_mobile = document.createElement('link'); - link_mobile.href = chatOrigin + chatPath + '/styles/mobile.css?version=' + chatVersion; + var link_mobile = document.createElement('link'); + link_mobile.href = '{{{remote}}}/snippet/styles/mobile.css?version=3.0.0'; link_mobile.rel='stylesheet'; link_mobile.type = "text/css"; document.head.appendChild(link_mobile); @@ -87,29 +27,29 @@ <% } else if (alignment == 'right') { -%> // Right iframe.className = 'motion-chat-iframe-right'; iframe.style['top'] = verticalAlignment+'%'; - let iframe_h = topIframe_calc(); + var iframe_h = topIframe_calc(); topIframe_set(iframe_h); - let div_tab = document.createElement('div'); + var div_tab = document.createElement('div'); div_tab['id'] = 'motion-chat-iframe-tab'; div_tab.className = 'motion-chat-div-right'; - let tab_status=0; + var tab_status=0; <% } else if (alignment == 'left') { -%> // Left iframe.className = 'motion-chat-iframe-left'; iframe.style['top'] = verticalAlignment+'%'; - let iframe_h = topIframe_calc(); + var iframe_h = topIframe_calc(); topIframe_set(iframe_h); - let div_tab = document.createElement('div'); + var div_tab = document.createElement('div'); div_tab.className = 'motion-chat-div-left'; div_tab['id'] ='motion-chat-iframe-tab'; - let tab_status=0; + var tab_status=0; <% } -%> <% if (alignment == 'right') { -%> // Right topChat_set(iframe_h, verticalAlignment); document.body.appendChild(div_tab); - let html = '
<
<%=labelText%>'; + var html = '
<
<%=labelText%>'; div_tab.innerHTML = html; div_tab.style.backgroundColor="<%=div_color%>"; @@ -130,7 +70,7 @@ div_tab.style.right = '295px'; iframe.style.right = '0px'; document.getElementById("chat_tab_arrow").innerHTML = " > "; - let iframeEl = document.getElementById('motion-chat-iframe'); + var iframeEl = document.getElementById('motion-chat-iframe'); iframeEl.contentWindow?.postMessage({"evt":"show"}, '*'); } @@ -139,7 +79,7 @@ div_tab.style.right = '0px'; iframe.style.right = '-312px'; document.getElementById("chat_tab_arrow").innerHTML = " < "; - let iframeEl = document.getElementById('motion-chat-iframe'); + var iframeEl = document.getElementById('motion-chat-iframe'); iframeEl.contentWindow?.postMessage({"evt":"hide"}, '*'); } @@ -157,7 +97,7 @@ <% } else if (alignment == 'left') { -%> topChat_set(iframe_h, verticalAlignment); document.body.appendChild(div_tab); - let html='
>
<%=labelText%>'; + var html='
>
<%=labelText%>'; div_tab.innerHTML=html; div_tab.style.backgroundColor="<%=div_color%>"; @@ -178,7 +118,7 @@ div_tab.style.left = '295px'; iframe.style.left = '0px'; document.getElementById("chat_tab_arrow").innerHTML = " < "; - let iframeEl = document.getElementById('motion-chat-iframe'); + var iframeEl = document.getElementById('motion-chat-iframe'); iframeEl.contentWindow?.postMessage({"evt":"show"}, '*'); } @@ -187,7 +127,7 @@ div_tab.style.left = '0px'; iframe.style.left = '-312px'; document.getElementById("chat_tab_arrow").innerHTML = " > "; - let iframeEl = document.getElementById('motion-chat-iframe'); + var iframeEl = document.getElementById('motion-chat-iframe'); iframeEl.contentWindow?.postMessage({"evt":"hide"}, '*'); } @@ -207,7 +147,6 @@ // START Events management window.addEventListener('message', function(evt) { - remoteLocalStorageEventHandler(evt) switch (evt.data.cmd) { case 'show': <% if (alignment == 'bottom_right') { -%> // Bottom, right @@ -250,11 +189,9 @@ // END Events management // START Proactive action management - <% proactiveActions.forEach(function(action, index) { -%> - <% if (action.type == 'timeout') { -%> + <% proactiveActions.forEach(function(action, index) { -%> <% if (action.type == 'timeout') { -%> setTimeout(function() { - <% if (alignment == 'right') { -%> - expandChatRight(); + <% if (alignment == 'right') { -%> expandChatRight(); tab_status++; <% } else if (alignment == 'left') { -%> expandChatLeft(); @@ -266,13 +203,10 @@ }, '*'); <% } -%> }, <%- action.timeout %> * 1000); - <% } -%> - <% if (action.type == 'mouseOver') { -%> - let elements<%- index %> = document.querySelectorAll("<%- action.selector %>"); - for (let i = 0; i < elements<%- index %>.length; i++) { + <% } -%> <% if (action.type == 'mouseOver') { -%> var elements<%- index %> = document.querySelectorAll("<%- action.selector %>"); + for (var i = 0; i < elements<%- index %>.length; i++) { elements<%- index %>[i].onmouseover = function() { - <% if (alignment == 'right') { -%> - expandChatRight(); + <% if (alignment == 'right') { -%> expandChatRight(); tab_status++; <% } else if (alignment == 'left') { -%> expandChatLeft(); @@ -285,15 +219,14 @@ <% } -%> } } - <% } -%> <% }); -%> - // END Proactive action management + <% } -%> <% }); -%> // END Proactive action management if (window.DeviceOrientationEvent) { window.addEventListener('orientationchange', function() { if (alignment == 'right'){ document.getElementById("chat_tab_arrow").innerHTML = " < "; - let iframeEl = document.getElementById('motion-chat-iframe'); + var iframeEl = document.getElementById('motion-chat-iframe'); iframeEl.contentWindow?.postMessage({"evt":"hide"}, '*'); tab_status = 0; iframe_h = topIframe_calc(); @@ -302,7 +235,7 @@ } else if (alignment == 'left'){ document.getElementById("chat_tab_arrow").innerHTML = " > "; - let iframeEl = document.getElementById('motion-chat-iframe'); + var iframeEl = document.getElementById('motion-chat-iframe'); iframeEl.contentWindow?.postMessage({"evt":"hide"}, '*'); tab_status = 0; iframe_h = topIframe_calc(); @@ -312,15 +245,15 @@ } window.addEventListener("resize", function(event) { - let iframe_h = topIframe_calc(); + var iframe_h = topIframe_calc(); topIframe_set(iframe_h); if(typeof div_tab != "undefined") topChat_set(iframe_h, verticalAlignment); }); function topIframe_calc(){ - let height_iframe - let heightD = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); - let iframeT = ((heightD/100)*verticalAlignment) + 450; + var height_iframe + var heightD = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); + var iframeT = ((heightD/100)*verticalAlignment) + 450; if (heightD < iframeT) { height_iframe = 450 - (iframeT - heightD); } @@ -356,7 +289,6 @@ } } - // hide chat <% if (hideWhenOffline && interval != null) { -%> // hide template document.getElementById("motion-chat-iframe-tab").style.display="none"; <% } -%> diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 46dda23..4ed623d 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfbe1=['../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','hasOne','cascade','UserId','userSetting','hasMany','Recordings','VoiceQueuesRt','VoiceExtension','Extensions','HopperFinals','HopperHistory','OpenchannelInteraction','ChatInteractions','FaxInteractions','MailInteractions','WhatsappInteraction','UserNotifications','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','SmsInteractions','OpenchannelInteractions','user_has_openchannel_interactions','WhatsappInteractions','user_has_whatsapp_interactions','MailQueues','ChatQueues','FaxQueues','SmsQueue','SmsQueues','OpenchannelQueues','WhatsappQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccount','OpenchannelAccounts','user_has_openchannel_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','ChanSpyId','VoiceContext','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','Trunk','TrunkId','TrunkBackup','TrunkBackupId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','VoiceMailMessage','mailbox','QueueCalls','uniqueid','AgentReports','MailServerIn','CloudProvider','CloudProviderId','MailAccountId','restrict','Imap','Dispositions','CannedAnswer','Answers','Interactions','List','ListId','team_has_mail_queues','Teams','MailInteractionId','Account','Contact','mail_interaction_has_tags','Tags','ThroughTags','Users','MailMessage','Attachments','Interaction','ChatWebsite','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','IntervalId','ContactId','MailQueueReport','Items','FaxAccountId','TagId','FaxInteractionId','Owner','fax_interaction_has_tags','user_has_fax_interactions','Attachment','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','user_has_sms_interactions','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','Applications','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','ProactiveActions','ChatQueueId','Website','ChatInteractionId','AttachmentId','team_has_chat_queues','CmCompany','Phones','CmContactId','HopperHistories','Company','CompanyId','cm_contact_has_tags','CmHopperId','Queue','CampaignId','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','ChatApplications','FaxApplications','SmsApplications','Schedule','AnalyticDefaultReport','DefaultReportId','AnalyticCustomReport','CustomReportId','Mohs','chat_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemTypeId','Hopper','AllCondition','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','SalesforceAccount','Configurations','AccountId','SalesforceField','Subjects','Descriptions','FieldId','Subject','SubjectId','DescriptionId','Field','VariableId','DeskAccount','int_desk_configuration_has_tags','ZohoConfiguration','Description','ZendeskConfiguration','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','SessionId','ProjectId','VoiceQueues','team_has_openchannel_queues','team_has_whatsapp_queues','VoicePrefixes','SquareProject','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToAccount','FromChatWebsiteId','ToChatWebsiteId','FromFaxAccountId','FromAgent','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','UserProfileSection','UserProfileSections','UserProfileResource','Resources','sectionId','WhatsappAccountId','WhatsappMessage','WhatsappInteractionId','ToWhatsappAccountId','ToQueueId','user','Smtp','exports','sequelize','jstz','determine','motion2','xcall','127.0.0.1','utf8mb4','name','utf8_general_ci','sequelizeHistory','xC@LL1234','mysql','utf8','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMail','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','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','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../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','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','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','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../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','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','../api/attachment/attachment.model','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','FaxTransferReport','OpenchannelTransferReport','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileResource/userProfileResource.model','UserNotification'];(function(_0x586f7e,_0x27aaff){var _0x4c64ed=function(_0x92e607){while(--_0x92e607){_0x586f7e['push'](_0x586f7e['shift']());}};_0x4c64ed(++_0x27aaff);}(_0xfbe1,0x10a));var _0x1fbe=function(_0x2e67e3,_0x3a7560){_0x2e67e3=_0x2e67e3-0x0;var _0x312bb8=_0xfbe1[_0x2e67e3];return _0x312bb8;};'use strict';var config=require('../config/environment');var Sequelize=require(_0x1fbe('0x0'));var _=require('lodash');var jstz=require(_0x1fbe('0x1'));var timezone=jstz[_0x1fbe('0x2')]();config[_0x1fbe('0x0')]=_['defaultsDeep'](config[_0x1fbe('0x0')],{'database':_0x1fbe('0x3'),'username':_0x1fbe('0x4'),'password':'xC@LL1234','options':{'host':_0x1fbe('0x5'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x1fbe('0x6')},'logging':![],'timezone':timezone[_0x1fbe('0x7')](),'define':{'charset':'utf8','collate':_0x1fbe('0x8')}}});config[_0x1fbe('0x9')]=_['defaultsDeep'](config['sequelizeHistory'],{'database':_0x1fbe('0x3'),'username':_0x1fbe('0x4'),'password':_0x1fbe('0xa'),'options':{'host':_0x1fbe('0x5'),'port':0xcea,'dialect':_0x1fbe('0xb'),'dialectOptions':{'charset':_0x1fbe('0x6')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x1fbe('0xc'),'collate':_0x1fbe('0x8')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x1fbe('0x0')][_0x1fbe('0xd')],config[_0x1fbe('0x0')][_0x1fbe('0xe')],config[_0x1fbe('0x0')][_0x1fbe('0xf')],config['sequelize'][_0x1fbe('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x1fbe('0x9')][_0x1fbe('0xd')],config[_0x1fbe('0x9')]['username'],config[_0x1fbe('0x9')][_0x1fbe('0xf')],config[_0x1fbe('0x9')][_0x1fbe('0x10')])};db[_0x1fbe('0x11')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x13'));db[_0x1fbe('0x14')]=db['sequelize'][_0x1fbe('0x12')](_0x1fbe('0x15'));db['VoiceContext']=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x16'));db['VoiceExtension']=db['sequelize'][_0x1fbe('0x12')]('../api/voiceExtension/voiceExtension.model');db[_0x1fbe('0x17')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x18'));db[_0x1fbe('0x19')]=db[_0x1fbe('0x0')]['import'](_0x1fbe('0x1a'));db[_0x1fbe('0x1b')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x1c'));db[_0x1fbe('0x1d')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')]('../api/screenRecording/screenRecording.model');db[_0x1fbe('0x1e')]=db['sequelize'][_0x1fbe('0x12')]('../api/voiceMail/voiceMail.model');db['VoiceMailMessage']=db['sequelize']['import'](_0x1fbe('0x1f'));db[_0x1fbe('0x20')]=db[_0x1fbe('0x0')]['import'](_0x1fbe('0x21'));db[_0x1fbe('0x22')]=db['sequelize']['import']('../api/voiceDialReport/voiceDialReport.model');db[_0x1fbe('0x23')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x24'));db[_0x1fbe('0x25')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x26'));db['MemberReport']=db[_0x1fbe('0x0')][_0x1fbe('0x12')]('../api/memberReport/memberReport.model');db['Trunk']=db['sequelize'][_0x1fbe('0x12')]('../api/trunk/trunk.model');db[_0x1fbe('0x27')]=db['sequelize']['import'](_0x1fbe('0x28'));db[_0x1fbe('0x29')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x2a'));db[_0x1fbe('0x2b')]=db['sequelize']['import'](_0x1fbe('0x2c'));db[_0x1fbe('0x2d')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x2e'));db[_0x1fbe('0x2f')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x30'));db[_0x1fbe('0x31')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')]('../api/userFaxQueue/userFaxQueue.model');db[_0x1fbe('0x32')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x33'));db[_0x1fbe('0x34')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x35'));db[_0x1fbe('0x36')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')]('../api/userWhatsappQueue/userWhatsappQueue.model');db['MailServerIn']=db[_0x1fbe('0x0')][_0x1fbe('0x12')]('../api/mailServerIn/mailServerIn.model');db[_0x1fbe('0x37')]=db['sequelize'][_0x1fbe('0x12')](_0x1fbe('0x38'));db[_0x1fbe('0x39')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x3a'));db[_0x1fbe('0x3b')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')]('../api/mailQueue/mailQueue.model');db[_0x1fbe('0x3c')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x3d'));db[_0x1fbe('0x3e')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x3f'));db['MailMessage']=db['sequelize']['import'](_0x1fbe('0x40'));db[_0x1fbe('0x41')]=db['sequelize']['import'](_0x1fbe('0x42'));db['MailQueueReport']=db[_0x1fbe('0x0')]['import'](_0x1fbe('0x43'));db[_0x1fbe('0x44')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')]('../api/dashboard/dashboard.model');db[_0x1fbe('0x45')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x46'));db[_0x1fbe('0x47')]=db[_0x1fbe('0x0')]['import'](_0x1fbe('0x48'));db[_0x1fbe('0x49')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')]('../api/faxApplication/faxApplication.model');db[_0x1fbe('0x4a')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x4b'));db[_0x1fbe('0x4c')]=db['sequelize']['import'](_0x1fbe('0x4d'));db[_0x1fbe('0x4e')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x4f'));db[_0x1fbe('0x50')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x51'));db[_0x1fbe('0x52')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')]('../api/smsAccount/smsAccount.model');db[_0x1fbe('0x53')]=db[_0x1fbe('0x0')]['import'](_0x1fbe('0x54'));db[_0x1fbe('0x55')]=db['sequelize'][_0x1fbe('0x12')](_0x1fbe('0x56'));db[_0x1fbe('0x57')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x58'));db['SmsQueue']=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x59'));db['OpenchannelAccount']=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x5a'));db[_0x1fbe('0x5b')]=db[_0x1fbe('0x0')]['import'](_0x1fbe('0x5c'));db['OpenchannelInteraction']=db[_0x1fbe('0x0')][_0x1fbe('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x1fbe('0x5d')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x5e'));db[_0x1fbe('0x5f')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x60'));db['ChatWebsite']=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x61'));db[_0x1fbe('0x62')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x63'));db[_0x1fbe('0x64')]=db[_0x1fbe('0x0')]['import']('../api/chatApplication/chatApplication.model');db[_0x1fbe('0x65')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x66'));db[_0x1fbe('0x67')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x68'));db['ChatOfflineMessage']=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x69'));db[_0x1fbe('0x6a')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')]('../api/chatQueue/chatQueue.model');db[_0x1fbe('0x6b')]=db[_0x1fbe('0x0')]['import'](_0x1fbe('0x6c'));db[_0x1fbe('0x6d')]=db[_0x1fbe('0x0')]['import'](_0x1fbe('0x6e'));db['CmCompany']=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x6f'));db[_0x1fbe('0x70')]=db['sequelize'][_0x1fbe('0x12')](_0x1fbe('0x71'));db[_0x1fbe('0x72')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x73'));db[_0x1fbe('0x74')]=db[_0x1fbe('0x0')]['import']('../api/cmHopperBlack/cmHopperBlack.model');db[_0x1fbe('0x75')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x76'));db[_0x1fbe('0x77')]=db['sequelize']['import'](_0x1fbe('0x78'));db[_0x1fbe('0x79')]=db['sequelize'][_0x1fbe('0x12')](_0x1fbe('0x7a'));db[_0x1fbe('0x7b')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x7c'));db[_0x1fbe('0x7d')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x7e'));db[_0x1fbe('0x7f')]=db[_0x1fbe('0x0')]['import'](_0x1fbe('0x80'));db['CannedAnswer']=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x81'));db[_0x1fbe('0x82')]=db['sequelize'][_0x1fbe('0x12')](_0x1fbe('0x83'));db[_0x1fbe('0x84')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x85'));db[_0x1fbe('0x86')]=db[_0x1fbe('0x0')]['import']('../api/interval/interval.model');db[_0x1fbe('0x87')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x88'));db[_0x1fbe('0x89')]=db[_0x1fbe('0x0')]['import']('../api/cdr/cdr.model');db[_0x1fbe('0x8a')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')]('../api/voiceQueuesLog/voiceQueuesLog.model');db['Schedule']=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x8b'));db[_0x1fbe('0x8c')]=db[_0x1fbe('0x0')]['import'](_0x1fbe('0x8d'));db[_0x1fbe('0x8e')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')]('../api/tag/tag.model');db[_0x1fbe('0x8f')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x90'));db['CmContactHasItem']=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x91'));db[_0x1fbe('0x92')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x1fbe('0x93')]=db[_0x1fbe('0x0')]['import'](_0x1fbe('0x94'));db[_0x1fbe('0x95')]=db['sequelize']['import'](_0x1fbe('0x96'));db[_0x1fbe('0x97')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x98'));db[_0x1fbe('0x99')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x9a'));db['IntegrationReport']=db[_0x1fbe('0x0')]['import'](_0x1fbe('0x9b'));db['AnalyticCustomReport']=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x9c'));db['AnalyticDefaultReport']=db[_0x1fbe('0x0')]['import'](_0x1fbe('0x9d'));db[_0x1fbe('0x9e')]=db['sequelize']['import'](_0x1fbe('0x9f'));db[_0x1fbe('0xa0')]=db['sequelize']['import'](_0x1fbe('0xa1'));db[_0x1fbe('0xa2')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0xa3'));db[_0x1fbe('0xa4')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0xa5'));db['SalesforceAccount']=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0xa6'));db[_0x1fbe('0xa7')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db['SalesforceField']=db[_0x1fbe('0x0')][_0x1fbe('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x1fbe('0xa8')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0xa9'));db[_0x1fbe('0xaa')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0xab'));db[_0x1fbe('0xac')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0xad'));db['DeskAccount']=db['sequelize']['import'](_0x1fbe('0xae'));db[_0x1fbe('0xaf')]=db['sequelize']['import'](_0x1fbe('0xb0'));db[_0x1fbe('0xb1')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0xb2'));db[_0x1fbe('0xb3')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0xb4'));db['ZohoConfiguration']=db[_0x1fbe('0x0')][_0x1fbe('0x12')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x1fbe('0xb5')]=db[_0x1fbe('0x0')]['import'](_0x1fbe('0xb6'));db[_0x1fbe('0xb7')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')]('../api/intZendeskAccount/intZendeskAccount.model');db['ZendeskConfiguration']=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0xb8'));db[_0x1fbe('0xb9')]=db[_0x1fbe('0x0')]['import'](_0x1fbe('0xba'));db[_0x1fbe('0xbb')]=db['sequelize'][_0x1fbe('0x12')](_0x1fbe('0xbc'));db[_0x1fbe('0xbd')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0xbe'));db[_0x1fbe('0xbf')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0xc0'));db['VtigerAccount']=db[_0x1fbe('0x0')]['import'](_0x1fbe('0xc1'));db[_0x1fbe('0xc2')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0xc3'));db[_0x1fbe('0xc4')]=db['sequelize'][_0x1fbe('0x12')](_0x1fbe('0xc5'));db[_0x1fbe('0xc6')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0xc7'));db[_0x1fbe('0xc8')]=db['sequelize'][_0x1fbe('0x12')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db['ServicenowField']=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0xc9'));db[_0x1fbe('0xca')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0xcb'));db[_0x1fbe('0xcc')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0xcd'));db[_0x1fbe('0xce')]=db[_0x1fbe('0x0')]['import'](_0x1fbe('0xcf'));db[_0x1fbe('0xd0')]=db[_0x1fbe('0x0')]['import'](_0x1fbe('0xd1'));db[_0x1fbe('0xd2')]=db['sequelize'][_0x1fbe('0x12')](_0x1fbe('0xd3'));db[_0x1fbe('0xd4')]=db[_0x1fbe('0x0')]['import'](_0x1fbe('0xd5'));db[_0x1fbe('0x99')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x9a'));db['Network']=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0xd6'));db[_0x1fbe('0xd7')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')]('../api/chatQueueReport/chatQueueReport.model');db[_0x1fbe('0xd8')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0xd9'));db[_0x1fbe('0xda')]=db['sequelize'][_0x1fbe('0x12')](_0x1fbe('0xdb'));db[_0x1fbe('0xdc')]=db['sequelize']['import'](_0x1fbe('0xdd'));db[_0x1fbe('0xde')]=db['sequelize'][_0x1fbe('0x12')](_0x1fbe('0xdf'));db[_0x1fbe('0xe0')]=db[_0x1fbe('0x0')]['import'](_0x1fbe('0xe1'));db[_0x1fbe('0xe2')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0xe3'));db[_0x1fbe('0xe4')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0xe5'));db[_0x1fbe('0xe6')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')]('../api/jscriptyProject/jscriptyProject.model');db[_0x1fbe('0xe7')]=db['sequelize'][_0x1fbe('0x12')]('../api/setting/setting.model');db[_0x1fbe('0xe8')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0xe9'));db['SquareProject']=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0xea'));db[_0x1fbe('0xeb')]=db['sequelize'][_0x1fbe('0x12')](_0x1fbe('0xec'));db[_0x1fbe('0xed')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0xee'));db['Team']=db[_0x1fbe('0x0')]['import'](_0x1fbe('0xef'));db[_0x1fbe('0xf0')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0xf1'));db[_0x1fbe('0xf2')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0xf3'));db['Migration']=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0xf4'));db['Attachment']=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0xf5'));db['Plugin']=db['sequelize'][_0x1fbe('0x12')](_0x1fbe('0xf6'));db[_0x1fbe('0xf7')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x1fbe('0xf8')]=db['sequelize'][_0x1fbe('0x12')]('../api/chatTransferReport/chatTransferReport.model');db[_0x1fbe('0xf9')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')]('../api/faxTransferReport/faxTransferReport.model');db[_0x1fbe('0xfa')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x1fbe('0xfb')]=db[_0x1fbe('0x0')]['import'](_0x1fbe('0xfc'));db[_0x1fbe('0xfd')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')]('../api/cmList/cmList.model');db[_0x1fbe('0xfe')]=db[_0x1fbe('0x0')]['import'](_0x1fbe('0xff'));db[_0x1fbe('0x100')]=db['sequelize'][_0x1fbe('0x12')](_0x1fbe('0x101'));db['UserProfileSection']=db[_0x1fbe('0x0')][_0x1fbe('0x12')]('../api/userProfileSection/userProfileSection.model');db['UserProfileResource']=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x102'));db[_0x1fbe('0x103')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x104'));db[_0x1fbe('0x105')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x106'));db[_0x1fbe('0x107')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x108'));db['WhatsappInteraction']=db[_0x1fbe('0x0')]['import'](_0x1fbe('0x109'));db['WhatsappMessage']=db[_0x1fbe('0x0')]['import'](_0x1fbe('0x10a'));db[_0x1fbe('0x10b')]=db[_0x1fbe('0x0')]['import'](_0x1fbe('0x10c'));db[_0x1fbe('0x10d')]=db[_0x1fbe('0x0')]['import'](_0x1fbe('0x10e'));db[_0x1fbe('0x10f')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x110'));db['CloudProvider']=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x111'));db[_0x1fbe('0x112')]=db[_0x1fbe('0x0')]['import'](_0x1fbe('0x113'));db[_0x1fbe('0x114')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x115'));db[_0x1fbe('0x116')]=db[_0x1fbe('0x0')][_0x1fbe('0x12')](_0x1fbe('0x117'));db[_0x1fbe('0x118')]=db[_0x1fbe('0x0')]['import'](_0x1fbe('0x119'));db[_0x1fbe('0x11')][_0x1fbe('0x11a')](db[_0x1fbe('0x1e')],{'as':_0x1fbe('0x1e'),'onDelete':_0x1fbe('0x11b'),'foreignKey':_0x1fbe('0x11c')});db['User'][_0x1fbe('0x11a')](db[_0x1fbe('0x118')],{'as':_0x1fbe('0x11d'),'onDelete':_0x1fbe('0x11b'),'foreignKey':_0x1fbe('0x11c')});db[_0x1fbe('0x11')][_0x1fbe('0x11e')](db[_0x1fbe('0x1b')],{'as':_0x1fbe('0x11f'),'foreignKey':_0x1fbe('0x11c')});db['User']['hasMany'](db[_0x1fbe('0x29')],{'as':_0x1fbe('0x120'),'foreignKey':_0x1fbe('0x11c')});db['User'][_0x1fbe('0x11e')](db[_0x1fbe('0x121')],{'as':_0x1fbe('0x122'),'onDelete':'cascade','hooks':!![]});db[_0x1fbe('0x11')][_0x1fbe('0x11e')](db[_0x1fbe('0x75')],{'as':_0x1fbe('0x123'),'foreignKey':_0x1fbe('0x11c')});db['User'][_0x1fbe('0x11e')](db['CmHopperHistory'],{'as':_0x1fbe('0x124'),'foreignKey':'UserId'});db[_0x1fbe('0x11')][_0x1fbe('0x11e')](db[_0x1fbe('0x79')],{'as':_0x1fbe('0x79'),'foreignKey':_0x1fbe('0x11c')});db[_0x1fbe('0x11')][_0x1fbe('0x11e')](db[_0x1fbe('0x125')],{'as':'OpenchannelInteractions','foreignKey':_0x1fbe('0x11c')});db[_0x1fbe('0x11')][_0x1fbe('0x11e')](db[_0x1fbe('0x65')],{'as':_0x1fbe('0x126'),'foreignKey':_0x1fbe('0x11c')});db[_0x1fbe('0x11')]['hasMany'](db[_0x1fbe('0x55')],{'as':'SmsInteractions','foreignKey':_0x1fbe('0x11c')});db[_0x1fbe('0x11')][_0x1fbe('0x11e')](db[_0x1fbe('0x4a')],{'as':_0x1fbe('0x127'),'foreignKey':_0x1fbe('0x11c')});db['User']['hasMany'](db['MailInteraction'],{'as':_0x1fbe('0x128'),'foreignKey':_0x1fbe('0x11c')});db['User'][_0x1fbe('0x11e')](db[_0x1fbe('0x129')],{'as':'WhatsappInteractions','foreignKey':_0x1fbe('0x11c')});db[_0x1fbe('0x11')][_0x1fbe('0x11e')](db[_0x1fbe('0x103')],{'as':_0x1fbe('0x12a'),'foreignKey':'SenderId'});db[_0x1fbe('0x11')][_0x1fbe('0x12b')](db[_0x1fbe('0x100')],{'as':_0x1fbe('0x100'),'foreignKey':_0x1fbe('0x12c')});db[_0x1fbe('0x11')][_0x1fbe('0x12d')](db[_0x1fbe('0x6b')],{'as':_0x1fbe('0x12e'),'through':_0x1fbe('0x12f')});db['User'][_0x1fbe('0x12d')](db[_0x1fbe('0x70')],{'as':_0x1fbe('0x130'),'through':_0x1fbe('0x131')});db[_0x1fbe('0x11')][_0x1fbe('0x12d')](db[_0x1fbe('0xfd')],{'as':_0x1fbe('0x132'),'through':_0x1fbe('0x133')});db[_0x1fbe('0x11')][_0x1fbe('0x12d')](db[_0x1fbe('0x134')],{'through':_0x1fbe('0x135')});db['User'][_0x1fbe('0x12d')](db[_0x1fbe('0x3e')],{'as':_0x1fbe('0x128'),'through':_0x1fbe('0x136')});db[_0x1fbe('0x11')]['belongsToMany'](db[_0x1fbe('0x65')],{'as':_0x1fbe('0x126'),'through':_0x1fbe('0x137')});db[_0x1fbe('0x11')][_0x1fbe('0x12d')](db['FaxInteraction'],{'as':'FaxInteractions','through':'user_has_fax_interactions'});db[_0x1fbe('0x11')][_0x1fbe('0x12d')](db[_0x1fbe('0x55')],{'as':_0x1fbe('0x138'),'through':'user_has_sms_interactions'});db[_0x1fbe('0x11')][_0x1fbe('0x12d')](db['OpenchannelInteraction'],{'as':_0x1fbe('0x139'),'through':_0x1fbe('0x13a')});db[_0x1fbe('0x11')][_0x1fbe('0x12d')](db['WhatsappInteraction'],{'as':_0x1fbe('0x13b'),'through':_0x1fbe('0x13c')});db['User'][_0x1fbe('0x12d')](db[_0x1fbe('0x19')],{'as':'VoiceQueues','through':_0x1fbe('0x2b'),'required':![]});db[_0x1fbe('0x11')][_0x1fbe('0x12d')](db[_0x1fbe('0xfe')],{'as':'VoicePrefixes','through':_0x1fbe('0x116'),'required':![]});db[_0x1fbe('0x11')][_0x1fbe('0x12d')](db['MailQueue'],{'as':_0x1fbe('0x13d'),'through':_0x1fbe('0x2f'),'required':![]});db[_0x1fbe('0x11')]['belongsToMany'](db[_0x1fbe('0x6a')],{'as':_0x1fbe('0x13e'),'through':_0x1fbe('0x2d'),'required':![],'hooks':!![]});db['User']['belongsToMany'](db[_0x1fbe('0x4e')],{'as':_0x1fbe('0x13f'),'through':_0x1fbe('0x31'),'required':![]});db['User'][_0x1fbe('0x12d')](db[_0x1fbe('0x140')],{'as':_0x1fbe('0x141'),'through':'UserSmsQueue','required':![]});db[_0x1fbe('0x11')][_0x1fbe('0x12d')](db[_0x1fbe('0x5f')],{'as':_0x1fbe('0x142'),'through':'UserOpenchannelQueue','required':![]});db[_0x1fbe('0x11')][_0x1fbe('0x12d')](db[_0x1fbe('0x10f')],{'as':_0x1fbe('0x143'),'through':'UserWhatsappQueue','required':![]});db[_0x1fbe('0x11')][_0x1fbe('0x12d')](db[_0x1fbe('0xfd')],{'through':_0x1fbe('0x133')});db['User'][_0x1fbe('0x12d')](db['ChatWebsite'],{'as':_0x1fbe('0x144'),'through':_0x1fbe('0x145')});db[_0x1fbe('0x11')][_0x1fbe('0x12d')](db[_0x1fbe('0x47')],{'as':_0x1fbe('0x146'),'through':_0x1fbe('0x147')});db[_0x1fbe('0x11')]['belongsToMany'](db[_0x1fbe('0x39')],{'as':_0x1fbe('0x148'),'through':_0x1fbe('0x149')});db[_0x1fbe('0x11')][_0x1fbe('0x12d')](db[_0x1fbe('0x14a')],{'as':_0x1fbe('0x14b'),'through':_0x1fbe('0x14c')});db[_0x1fbe('0x11')]['belongsToMany'](db[_0x1fbe('0x52')],{'as':'SmsAccounts','through':'user_has_sms_accounts'});db[_0x1fbe('0x11')][_0x1fbe('0x12d')](db[_0x1fbe('0x105')],{'as':_0x1fbe('0x14d'),'through':_0x1fbe('0x14e')});db[_0x1fbe('0x14')][_0x1fbe('0x11e')](db[_0x1fbe('0x121')],{'as':_0x1fbe('0x14f'),'onDelete':_0x1fbe('0x11b'),'foreignKey':_0x1fbe('0x150')});db[_0x1fbe('0x151')]['hasMany'](db['VoiceExtension'],{'onDelete':_0x1fbe('0x11b')});db['VoiceExtension'][_0x1fbe('0x11e')](db['VoiceExtension'],{'as':'Applications','onDelete':'cascade'});db[_0x1fbe('0x17')][_0x1fbe('0x12d')](db[_0x1fbe('0x8c')],{'as':_0x1fbe('0x152'),'through':_0x1fbe('0x153')});db['VoiceQueue']['hasMany'](db['UserVoiceQueueRt'],{'as':_0x1fbe('0x154'),'foreignKey':_0x1fbe('0x155')});db['VoiceQueue']['hasMany'](db[_0x1fbe('0x72')],{'as':_0x1fbe('0x156'),'foreignKey':'VoiceQueueId'});db[_0x1fbe('0x19')][_0x1fbe('0x11e')](db['CmHopperFinal'],{'as':_0x1fbe('0x123'),'foreignKey':_0x1fbe('0x155')});db[_0x1fbe('0x19')][_0x1fbe('0x11e')](db[_0x1fbe('0x77')],{'as':'HopperHistories','foreignKey':_0x1fbe('0x155')});db[_0x1fbe('0x19')][_0x1fbe('0x11e')](db[_0x1fbe('0x79')],{'as':_0x1fbe('0x79'),'foreignKey':_0x1fbe('0x155')});db[_0x1fbe('0x19')][_0x1fbe('0x11e')](db['CmHopperBlack'],{'as':_0x1fbe('0x157'),'foreignKey':'VoiceQueueId'});db['VoiceQueue']['hasMany'](db['JscriptySessionReport'],{'as':_0x1fbe('0x158'),'foreignKey':_0x1fbe('0x155')});db[_0x1fbe('0x19')][_0x1fbe('0x12b')](db[_0x1fbe('0x159')],{'as':_0x1fbe('0x159'),'foreignKey':_0x1fbe('0x15a')});db['VoiceQueue'][_0x1fbe('0x12b')](db['Trunk'],{'as':_0x1fbe('0x15b'),'foreignKey':_0x1fbe('0x15c')});db[_0x1fbe('0x19')][_0x1fbe('0x12b')](db[_0x1fbe('0x86')],{'as':_0x1fbe('0x86'),'foreignKey':'IntervalId'});db[_0x1fbe('0x19')][_0x1fbe('0x12b')](db['Pause'],{'as':_0x1fbe('0x15d'),'foreignKey':_0x1fbe('0x15e')});db['VoiceQueue']['belongsToMany'](db[_0x1fbe('0xfd')],{'as':'Lists','through':_0x1fbe('0x15f')});db[_0x1fbe('0x19')]['belongsToMany'](db[_0x1fbe('0x11')],{'as':_0x1fbe('0x160'),'through':_0x1fbe('0x2b')});db[_0x1fbe('0x19')][_0x1fbe('0x12d')](db[_0x1fbe('0x134')],{'as':'Teams','through':_0x1fbe('0x112')});db[_0x1fbe('0x19')][_0x1fbe('0x12d')](db[_0x1fbe('0xfd')],{'as':_0x1fbe('0x161'),'through':_0x1fbe('0x162')});db[_0x1fbe('0x1b')]['belongsTo'](db[_0x1fbe('0x11')],{'as':_0x1fbe('0x11'),'foreignKey':_0x1fbe('0x11c')});db[_0x1fbe('0x1d')][_0x1fbe('0x12b')](db[_0x1fbe('0x11')],{'as':_0x1fbe('0x11'),'foreignKey':_0x1fbe('0x11c')});db[_0x1fbe('0x1e')]['hasMany'](db['VoiceMailMessage'],{'as':_0x1fbe('0x163'),'onDelete':_0x1fbe('0x11b'),'foreignKey':_0x1fbe('0x164'),'sourceKey':'mailbox'});db[_0x1fbe('0x165')][_0x1fbe('0x12b')](db[_0x1fbe('0x1e')],{'foreignKey':_0x1fbe('0x164'),'targetKey':_0x1fbe('0x166')});db[_0x1fbe('0x20')][_0x1fbe('0x11e')](db[_0x1fbe('0x25')],{'as':_0x1fbe('0x167'),'foreignKey':_0x1fbe('0x168'),'constraints':![]});db['VoiceCallReport'][_0x1fbe('0x11e')](db[_0x1fbe('0x23')],{'as':_0x1fbe('0x169'),'foreignKey':_0x1fbe('0x168'),'constraints':![]});db[_0x1fbe('0x20')][_0x1fbe('0x12b')](db[_0x1fbe('0x11')],{'as':_0x1fbe('0x11'),'foreignKey':_0x1fbe('0x11c')});db[_0x1fbe('0x20')][_0x1fbe('0x12b')](db[_0x1fbe('0x70')],{'as':'Contact','foreignKey':'ContactId'});db[_0x1fbe('0x16a')][_0x1fbe('0x12b')](db[_0x1fbe('0x39')],{'as':_0x1fbe('0x39'),'foreignKey':'MailAccountId'});db[_0x1fbe('0x16a')][_0x1fbe('0x12b')](db[_0x1fbe('0x16b')],{'as':_0x1fbe('0x16b'),'foreignKey':_0x1fbe('0x16c'),'onDelete':'restrict'});db[_0x1fbe('0x37')][_0x1fbe('0x12b')](db[_0x1fbe('0x39')],{'as':_0x1fbe('0x39'),'foreignKey':_0x1fbe('0x16d')});db[_0x1fbe('0x37')][_0x1fbe('0x12b')](db['CloudProvider'],{'as':_0x1fbe('0x16b'),'foreignKey':'CloudProviderId','onDelete':_0x1fbe('0x16e')});db[_0x1fbe('0x39')]['hasOne'](db['MailServerIn'],{'as':_0x1fbe('0x16f'),'onDelete':_0x1fbe('0x11b')});db[_0x1fbe('0x39')][_0x1fbe('0x11a')](db[_0x1fbe('0x37')],{'as':'Smtp','onDelete':_0x1fbe('0x11b')});db['MailAccount'][_0x1fbe('0x11e')](db[_0x1fbe('0x82')],{'as':_0x1fbe('0x170'),'foreignKey':_0x1fbe('0x16d'),'onDelete':'cascade'});db['MailAccount'][_0x1fbe('0x11e')](db[_0x1fbe('0x171')],{'as':_0x1fbe('0x172'),'foreignKey':_0x1fbe('0x16d')});db[_0x1fbe('0x39')][_0x1fbe('0x11e')](db['MailMessage'],{'as':'Messages','foreignKey':_0x1fbe('0x16d')});db[_0x1fbe('0x39')][_0x1fbe('0x11e')](db[_0x1fbe('0x3e')],{'as':_0x1fbe('0x173')});db['MailAccount']['hasMany'](db[_0x1fbe('0x41')],{'as':'Applications'});db[_0x1fbe('0x39')][_0x1fbe('0x12b')](db['CmList'],{'as':_0x1fbe('0x174'),'foreignKey':_0x1fbe('0x175')});db[_0x1fbe('0x39')][_0x1fbe('0x12b')](db[_0x1fbe('0x93')],{'as':_0x1fbe('0x93'),'foreignKey':'TemplateId'});db['MailAccount'][_0x1fbe('0x12b')](db[_0x1fbe('0x87')],{'as':'mandatoryDispositionPause','foreignKey':_0x1fbe('0x15e')});db[_0x1fbe('0x39')]['belongsToMany'](db[_0x1fbe('0x11')],{'as':_0x1fbe('0x160'),'through':'user_has_mail_accounts'});db[_0x1fbe('0x3b')][_0x1fbe('0x12d')](db[_0x1fbe('0x11')],{'as':_0x1fbe('0x160'),'through':_0x1fbe('0x2f')});db[_0x1fbe('0x3b')][_0x1fbe('0x12d')](db[_0x1fbe('0x134')],{'through':_0x1fbe('0x176'),'as':_0x1fbe('0x177')});db[_0x1fbe('0x3e')][_0x1fbe('0x11e')](db['MailMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x1fbe('0x178')});db[_0x1fbe('0x3e')]['belongsTo'](db[_0x1fbe('0x39')],{'as':_0x1fbe('0x179'),'foreignKey':_0x1fbe('0x16d')});db[_0x1fbe('0x3e')]['belongsTo'](db['CmContact'],{'as':_0x1fbe('0x17a'),'foreignKey':'ContactId'});db['MailInteraction']['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x1fbe('0x11c')});db[_0x1fbe('0x3e')][_0x1fbe('0x12d')](db['Tag'],{'through':_0x1fbe('0x17b'),'as':_0x1fbe('0x17c')});db[_0x1fbe('0x3e')]['belongsToMany'](db[_0x1fbe('0x8e')],{'through':_0x1fbe('0x17b'),'as':_0x1fbe('0x17d')});db[_0x1fbe('0x3e')][_0x1fbe('0x12d')](db['User'],{'as':_0x1fbe('0x17e'),'through':'user_has_mail_interactions','foreignKey':_0x1fbe('0x178')});db[_0x1fbe('0x17f')][_0x1fbe('0x11e')](db['Attachment'],{'as':_0x1fbe('0x180'),'onDelete':_0x1fbe('0x11b')});db[_0x1fbe('0x17f')][_0x1fbe('0x12b')](db['User'],{'as':_0x1fbe('0x11')});db[_0x1fbe('0x17f')]['belongsTo'](db[_0x1fbe('0x70')],{'onDelete':_0x1fbe('0x11b'),'as':_0x1fbe('0x17a')});db['MailMessage'][_0x1fbe('0x12b')](db[_0x1fbe('0x3e')],{'as':_0x1fbe('0x181'),'foreignKey':_0x1fbe('0x178')});db[_0x1fbe('0x17f')][_0x1fbe('0x12b')](db[_0x1fbe('0x39')],{'as':_0x1fbe('0x179'),'foreignKey':_0x1fbe('0x16d')});db[_0x1fbe('0x17f')][_0x1fbe('0x12b')](db[_0x1fbe('0x182')],{'as':_0x1fbe('0x182'),'foreignKey':_0x1fbe('0x183')});db[_0x1fbe('0x17f')]['belongsTo'](db[_0x1fbe('0x184')],{'as':_0x1fbe('0x184'),'foreignKey':_0x1fbe('0x185')});db['MailApplication'][_0x1fbe('0x12b')](db[_0x1fbe('0x11')],{'onDelete':_0x1fbe('0x16e')});db[_0x1fbe('0x41')][_0x1fbe('0x12b')](db[_0x1fbe('0x3b')],{'onDelete':_0x1fbe('0x16e')});db[_0x1fbe('0x41')][_0x1fbe('0x12b')](db['MailAccount'],{'onDelete':_0x1fbe('0x16e')});db[_0x1fbe('0x41')]['belongsTo'](db[_0x1fbe('0x86')],{'onDelete':_0x1fbe('0x16e'),'foreignKey':_0x1fbe('0x186')});db[_0x1fbe('0x41')][_0x1fbe('0x12b')](db['Tag'],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport'][_0x1fbe('0x12b')](db[_0x1fbe('0x39')],{});db['MailQueueReport'][_0x1fbe('0x12b')](db[_0x1fbe('0xfd')],{'as':_0x1fbe('0x174'),'foreignKey':_0x1fbe('0x175')});db['MailQueueReport'][_0x1fbe('0x12b')](db[_0x1fbe('0x70')],{'as':_0x1fbe('0x17a'),'foreignKey':_0x1fbe('0x187')});db[_0x1fbe('0x188')][_0x1fbe('0x12b')](db[_0x1fbe('0x3e')],{});db[_0x1fbe('0x188')][_0x1fbe('0x12b')](db[_0x1fbe('0x17f')],{});db[_0x1fbe('0x188')][_0x1fbe('0x12b')](db[_0x1fbe('0x11')],{});db[_0x1fbe('0x188')][_0x1fbe('0x12b')](db[_0x1fbe('0x3b')],{});db[_0x1fbe('0x44')][_0x1fbe('0x11e')](db[_0x1fbe('0x45')],{'as':_0x1fbe('0x189'),'onDelete':'cascade'});db[_0x1fbe('0x47')][_0x1fbe('0x11e')](db[_0x1fbe('0x82')],{'as':_0x1fbe('0x170'),'foreignKey':_0x1fbe('0x18a'),'onDelete':_0x1fbe('0x11b')});db[_0x1fbe('0x47')][_0x1fbe('0x11e')](db[_0x1fbe('0x171')],{'as':_0x1fbe('0x172'),'foreignKey':_0x1fbe('0x18a')});db[_0x1fbe('0x47')][_0x1fbe('0x11e')](db[_0x1fbe('0x4a')],{'as':_0x1fbe('0x173')});db[_0x1fbe('0x47')][_0x1fbe('0x11e')](db[_0x1fbe('0x49')],{'as':'Applications'});db[_0x1fbe('0x47')][_0x1fbe('0x11e')](db[_0x1fbe('0x121')],{'as':'Exntensions','onDelete':'cascade'});db['FaxAccount'][_0x1fbe('0x11e')](db[_0x1fbe('0x4c')],{'as':'Messages'});db['FaxAccount']['belongsTo'](db[_0x1fbe('0x159')],{'as':'Trunk'});db[_0x1fbe('0x47')][_0x1fbe('0x12b')](db[_0x1fbe('0xfd')],{'as':'List','foreignKey':_0x1fbe('0x175')});db['FaxAccount'][_0x1fbe('0x12b')](db[_0x1fbe('0x87')],{'as':_0x1fbe('0x15d'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x1fbe('0x47')][_0x1fbe('0x12d')](db['User'],{'as':_0x1fbe('0x160'),'through':_0x1fbe('0x147')});db[_0x1fbe('0x49')][_0x1fbe('0x12b')](db[_0x1fbe('0x11')],{'onDelete':_0x1fbe('0x16e')});db['FaxApplication'][_0x1fbe('0x12b')](db[_0x1fbe('0x4e')],{'onDelete':_0x1fbe('0x16e')});db['FaxApplication'][_0x1fbe('0x12b')](db[_0x1fbe('0x47')],{'onDelete':_0x1fbe('0x16e')});db[_0x1fbe('0x49')][_0x1fbe('0x12b')](db[_0x1fbe('0x8e')],{'onDelete':_0x1fbe('0x16e'),'foreignKey':_0x1fbe('0x18b')});db['FaxInteraction'][_0x1fbe('0x11e')](db[_0x1fbe('0x4c')],{'as':_0x1fbe('0x163'),'onDelete':_0x1fbe('0x11b'),'foreignKey':_0x1fbe('0x18c')});db[_0x1fbe('0x4a')][_0x1fbe('0x12b')](db[_0x1fbe('0x47')],{'as':'Account','foreignKey':_0x1fbe('0x18a')});db[_0x1fbe('0x4a')][_0x1fbe('0x12b')](db['CmContact'],{'as':_0x1fbe('0x17a'),'foreignKey':_0x1fbe('0x187')});db['FaxInteraction'][_0x1fbe('0x12b')](db['User'],{'as':_0x1fbe('0x18d'),'foreignKey':_0x1fbe('0x11c')});db[_0x1fbe('0x4a')][_0x1fbe('0x12d')](db[_0x1fbe('0x8e')],{'through':'fax_interaction_has_tags','as':_0x1fbe('0x17c')});db['FaxInteraction'][_0x1fbe('0x12d')](db[_0x1fbe('0x8e')],{'through':_0x1fbe('0x18e'),'as':_0x1fbe('0x17d')});db[_0x1fbe('0x4a')][_0x1fbe('0x12d')](db[_0x1fbe('0x11')],{'as':_0x1fbe('0x17e'),'through':_0x1fbe('0x18f'),'foreignKey':_0x1fbe('0x18c')});db[_0x1fbe('0x4c')][_0x1fbe('0x12b')](db[_0x1fbe('0x11')],{'onDelete':'cascade','as':_0x1fbe('0x11')});db[_0x1fbe('0x4c')][_0x1fbe('0x12b')](db[_0x1fbe('0x4a')],{'as':'Interaction','foreignKey':'FaxInteractionId'});db['FaxMessage'][_0x1fbe('0x12b')](db[_0x1fbe('0x70')],{'onDelete':_0x1fbe('0x11b'),'as':'Contact'});db[_0x1fbe('0x4c')][_0x1fbe('0x12b')](db[_0x1fbe('0x190')],{'as':_0x1fbe('0x190'),'foreignKey':'AttachmentId'});db[_0x1fbe('0x4c')]['belongsTo'](db[_0x1fbe('0x47')],{'as':_0x1fbe('0x179'),'foreignKey':'FaxAccountId'});db['FaxQueue'][_0x1fbe('0x12d')](db[_0x1fbe('0x11')],{'as':_0x1fbe('0x160'),'through':_0x1fbe('0x31')});db['FaxQueue']['belongsToMany'](db[_0x1fbe('0x134')],{'through':_0x1fbe('0x191'),'as':_0x1fbe('0x177')});db[_0x1fbe('0x50')][_0x1fbe('0x12b')](db[_0x1fbe('0x47')],{});db[_0x1fbe('0x50')][_0x1fbe('0x12b')](db['CmList'],{'as':_0x1fbe('0x174'),'foreignKey':_0x1fbe('0x175')});db[_0x1fbe('0x50')][_0x1fbe('0x12b')](db[_0x1fbe('0x70')],{'as':'Contact','foreignKey':'ContactId'});db['FaxQueueReport']['belongsTo'](db[_0x1fbe('0x4a')],{});db[_0x1fbe('0x50')][_0x1fbe('0x12b')](db[_0x1fbe('0x4c')],{});db[_0x1fbe('0x50')]['belongsTo'](db[_0x1fbe('0x11')],{});db[_0x1fbe('0x50')][_0x1fbe('0x12b')](db[_0x1fbe('0x4e')],{});db[_0x1fbe('0x52')][_0x1fbe('0x11e')](db[_0x1fbe('0x82')],{'as':_0x1fbe('0x170'),'foreignKey':_0x1fbe('0x192'),'onDelete':'cascade'});db['SmsAccount']['hasMany'](db[_0x1fbe('0x171')],{'as':_0x1fbe('0x172'),'foreignKey':_0x1fbe('0x192')});db[_0x1fbe('0x52')][_0x1fbe('0x11e')](db[_0x1fbe('0x57')],{'as':_0x1fbe('0x163'),'foreignKey':'SmsAccountId'});db[_0x1fbe('0x52')][_0x1fbe('0x11e')](db[_0x1fbe('0x55')],{'as':_0x1fbe('0x173')});db['SmsAccount'][_0x1fbe('0x11e')](db[_0x1fbe('0x53')],{'as':'Applications'});db[_0x1fbe('0x52')][_0x1fbe('0x12b')](db['CmList'],{'as':_0x1fbe('0x174'),'foreignKey':_0x1fbe('0x175')});db['SmsAccount'][_0x1fbe('0x12b')](db[_0x1fbe('0x87')],{'as':'mandatoryDispositionPause','foreignKey':_0x1fbe('0x15e')});db[_0x1fbe('0x52')][_0x1fbe('0x12d')](db[_0x1fbe('0x11')],{'as':_0x1fbe('0x160'),'through':'user_has_sms_accounts'});db['SmsApplication'][_0x1fbe('0x12b')](db[_0x1fbe('0x11')],{'onDelete':_0x1fbe('0x16e')});db[_0x1fbe('0x53')][_0x1fbe('0x12b')](db[_0x1fbe('0x140')],{'onDelete':_0x1fbe('0x16e')});db[_0x1fbe('0x53')][_0x1fbe('0x12b')](db['SmsAccount'],{'onDelete':_0x1fbe('0x16e')});db[_0x1fbe('0x53')][_0x1fbe('0x12b')](db[_0x1fbe('0x86')],{'onDelete':_0x1fbe('0x16e'),'foreignKey':_0x1fbe('0x186')});db[_0x1fbe('0x53')][_0x1fbe('0x12b')](db['Tag'],{'onDelete':_0x1fbe('0x16e'),'foreignKey':_0x1fbe('0x18b')});db['SmsInteraction'][_0x1fbe('0x11e')](db['SmsMessage'],{'as':'Messages','onDelete':_0x1fbe('0x11b'),'foreignKey':_0x1fbe('0x193')});db[_0x1fbe('0x55')][_0x1fbe('0x12b')](db['SmsAccount'],{'as':_0x1fbe('0x179'),'foreignKey':'SmsAccountId'});db[_0x1fbe('0x55')][_0x1fbe('0x12b')](db[_0x1fbe('0x70')],{'as':'Contact','foreignKey':_0x1fbe('0x187')});db['SmsInteraction'][_0x1fbe('0x12b')](db[_0x1fbe('0x11')],{'as':_0x1fbe('0x18d'),'foreignKey':'UserId'});db[_0x1fbe('0x55')]['belongsToMany'](db[_0x1fbe('0x8e')],{'through':_0x1fbe('0x194'),'as':'Tags'});db[_0x1fbe('0x55')][_0x1fbe('0x12d')](db[_0x1fbe('0x8e')],{'through':'sms_interaction_has_tags','as':_0x1fbe('0x17d')});db[_0x1fbe('0x55')][_0x1fbe('0x12d')](db['User'],{'as':_0x1fbe('0x17e'),'through':_0x1fbe('0x195'),'foreignKey':_0x1fbe('0x193')});db[_0x1fbe('0x57')][_0x1fbe('0x12b')](db[_0x1fbe('0x11')],{'as':'User'});db['SmsMessage']['belongsTo'](db[_0x1fbe('0x70')],{'onDelete':'cascade','as':_0x1fbe('0x17a')});db[_0x1fbe('0x57')][_0x1fbe('0x12b')](db[_0x1fbe('0x55')],{'onDelete':'cascade','as':_0x1fbe('0x181'),'foreignKey':_0x1fbe('0x193')});db[_0x1fbe('0x57')][_0x1fbe('0x12b')](db[_0x1fbe('0x52')],{'as':_0x1fbe('0x179'),'foreignKey':_0x1fbe('0x192')});db[_0x1fbe('0x140')][_0x1fbe('0x12d')](db['User'],{'as':_0x1fbe('0x160'),'through':'UserSmsQueue','foreignKey':_0x1fbe('0x196')});db['SmsQueue'][_0x1fbe('0x12d')](db[_0x1fbe('0x134')],{'through':_0x1fbe('0x197'),'as':_0x1fbe('0x177')});db[_0x1fbe('0x14a')]['hasMany'](db[_0x1fbe('0x82')],{'as':_0x1fbe('0x170'),'foreignKey':'OpenchannelAccountId','onDelete':_0x1fbe('0x11b')});db[_0x1fbe('0x14a')][_0x1fbe('0x11e')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x1fbe('0x198')});db['OpenchannelAccount'][_0x1fbe('0x11e')](db['OpenchannelInteraction'],{'as':_0x1fbe('0x173'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount']['hasMany'](db['OpenchannelMessage'],{'as':_0x1fbe('0x163'),'foreignKey':_0x1fbe('0x198')});db[_0x1fbe('0x14a')]['hasMany'](db[_0x1fbe('0x5b')],{'as':_0x1fbe('0x199'),'foreignKey':_0x1fbe('0x198')});db[_0x1fbe('0x14a')]['belongsTo'](db['CmList'],{'as':_0x1fbe('0x174'),'foreignKey':_0x1fbe('0x175')});db[_0x1fbe('0x14a')][_0x1fbe('0x12b')](db[_0x1fbe('0x87')],{'as':_0x1fbe('0x15d'),'foreignKey':_0x1fbe('0x15e')});db[_0x1fbe('0x14a')][_0x1fbe('0x12d')](db[_0x1fbe('0x11')],{'as':_0x1fbe('0x160'),'through':_0x1fbe('0x14c')});db[_0x1fbe('0x5b')][_0x1fbe('0x12b')](db[_0x1fbe('0x11')],{'onDelete':_0x1fbe('0x16e')});db[_0x1fbe('0x5b')][_0x1fbe('0x12b')](db[_0x1fbe('0x5f')],{'onDelete':_0x1fbe('0x16e'),'foreignKey':_0x1fbe('0x19a')});db[_0x1fbe('0x5b')][_0x1fbe('0x12b')](db[_0x1fbe('0x14a')],{'onDelete':_0x1fbe('0x16e'),'foreignKey':_0x1fbe('0x198')});db[_0x1fbe('0x5b')][_0x1fbe('0x12b')](db[_0x1fbe('0x86')],{'onDelete':_0x1fbe('0x16e'),'foreignKey':'IntervalId'});db[_0x1fbe('0x5b')][_0x1fbe('0x12b')](db['Tag'],{'onDelete':_0x1fbe('0x16e'),'foreignKey':'TagId'});db[_0x1fbe('0x125')][_0x1fbe('0x11e')](db[_0x1fbe('0x5d')],{'as':_0x1fbe('0x163'),'onDelete':_0x1fbe('0x11b'),'foreignKey':_0x1fbe('0x19b')});db[_0x1fbe('0x125')][_0x1fbe('0x12b')](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0x1fbe('0x198')});db[_0x1fbe('0x125')][_0x1fbe('0x12b')](db[_0x1fbe('0x70')],{'as':_0x1fbe('0x17a'),'foreignKey':_0x1fbe('0x187')});db[_0x1fbe('0x125')][_0x1fbe('0x12b')](db['User'],{'as':_0x1fbe('0x18d'),'foreignKey':_0x1fbe('0x11c')});db['OpenchannelInteraction'][_0x1fbe('0x12d')](db[_0x1fbe('0x8e')],{'through':_0x1fbe('0x19c'),'as':_0x1fbe('0x17c')});db['OpenchannelInteraction'][_0x1fbe('0x12d')](db['Tag'],{'through':_0x1fbe('0x19c'),'as':_0x1fbe('0x17d')});db[_0x1fbe('0x125')][_0x1fbe('0x12d')](db[_0x1fbe('0x11')],{'as':'Users','through':_0x1fbe('0x13a'),'foreignKey':_0x1fbe('0x19b')});db[_0x1fbe('0x5d')][_0x1fbe('0x12b')](db[_0x1fbe('0x11')],{'onDelete':_0x1fbe('0x11b'),'as':'User'});db[_0x1fbe('0x5d')][_0x1fbe('0x12b')](db[_0x1fbe('0x70')],{'onDelete':_0x1fbe('0x11b'),'as':_0x1fbe('0x17a')});db[_0x1fbe('0x5d')][_0x1fbe('0x12b')](db[_0x1fbe('0x125')],{'onDelete':_0x1fbe('0x11b'),'as':_0x1fbe('0x181'),'foreignKey':_0x1fbe('0x19b')});db[_0x1fbe('0x5d')][_0x1fbe('0x12b')](db[_0x1fbe('0x190')],{'as':_0x1fbe('0x190'),'foreignKey':'AttachmentId'});db['OpenchannelMessage'][_0x1fbe('0x12b')](db['OpenchannelAccount'],{'as':_0x1fbe('0x179'),'foreignKey':_0x1fbe('0x198')});db['OpenchannelQueue'][_0x1fbe('0x12d')](db[_0x1fbe('0x11')],{'as':_0x1fbe('0x160'),'through':_0x1fbe('0x34'),'foreignKey':_0x1fbe('0x19a')});db[_0x1fbe('0x5f')]['belongsToMany'](db['Team'],{'through':'team_has_openchannel_queues','as':'Teams'});db[_0x1fbe('0x182')][_0x1fbe('0x11e')](db[_0x1fbe('0x82')],{'as':_0x1fbe('0x170'),'foreignKey':_0x1fbe('0x183'),'onDelete':_0x1fbe('0x11b')});db[_0x1fbe('0x182')][_0x1fbe('0x11e')](db[_0x1fbe('0x171')],{'as':_0x1fbe('0x172'),'foreignKey':'ChatWebsiteId'});db[_0x1fbe('0x182')][_0x1fbe('0x11e')](db[_0x1fbe('0x6d')],{'as':_0x1fbe('0x19d')});db[_0x1fbe('0x182')][_0x1fbe('0x11e')](db[_0x1fbe('0x65')],{'as':'Interactions'});db[_0x1fbe('0x182')]['hasMany'](db[_0x1fbe('0x64')],{'as':'Applications'});db[_0x1fbe('0x182')][_0x1fbe('0x11e')](db[_0x1fbe('0x67')],{'as':_0x1fbe('0x163')});db[_0x1fbe('0x182')][_0x1fbe('0x12b')](db[_0x1fbe('0xfd')],{'as':_0x1fbe('0x174'),'foreignKey':'ListId'});db[_0x1fbe('0x182')]['belongsTo'](db[_0x1fbe('0x86')],{'as':_0x1fbe('0x86'),'foreignKey':_0x1fbe('0x186')});db['ChatWebsite']['belongsTo'](db[_0x1fbe('0x39')],{'as':_0x1fbe('0x39'),'foreignKey':_0x1fbe('0x16d')});db[_0x1fbe('0x182')][_0x1fbe('0x12b')](db[_0x1fbe('0x87')],{'as':'mandatoryDispositionPause','foreignKey':_0x1fbe('0x15e')});db[_0x1fbe('0x182')][_0x1fbe('0x12d')](db[_0x1fbe('0x11')],{'as':_0x1fbe('0x160'),'through':_0x1fbe('0x145')});db['OpenchannelQueueReport']['belongsTo'](db[_0x1fbe('0x14a')],{});db[_0x1fbe('0x62')][_0x1fbe('0x12b')](db[_0x1fbe('0xfd')],{'as':'List','foreignKey':_0x1fbe('0x175')});db['OpenchannelQueueReport']['belongsTo'](db[_0x1fbe('0x70')],{'as':_0x1fbe('0x17a'),'foreignKey':_0x1fbe('0x187')});db['OpenchannelQueueReport'][_0x1fbe('0x12b')](db[_0x1fbe('0x125')],{});db[_0x1fbe('0x62')][_0x1fbe('0x12b')](db['OpenchannelMessage'],{});db[_0x1fbe('0x62')][_0x1fbe('0x12b')](db[_0x1fbe('0x11')],{});db[_0x1fbe('0x62')]['belongsTo'](db[_0x1fbe('0x5f')],{});db['ChatApplication'][_0x1fbe('0x12b')](db[_0x1fbe('0x11')],{'as':'Agent','foreignKey':_0x1fbe('0x11c'),'onDelete':_0x1fbe('0x16e')});db[_0x1fbe('0x64')][_0x1fbe('0x12b')](db['ChatQueue'],{'as':'Queue','foreignKey':_0x1fbe('0x19e'),'onDelete':_0x1fbe('0x16e')});db[_0x1fbe('0x64')][_0x1fbe('0x12b')](db['ChatWebsite'],{'as':_0x1fbe('0x19f'),'foreignKey':_0x1fbe('0x183'),'onDelete':_0x1fbe('0x16e')});db[_0x1fbe('0x64')][_0x1fbe('0x12b')](db[_0x1fbe('0x8e')],{'onDelete':'restrict','foreignKey':_0x1fbe('0x18b')});db[_0x1fbe('0x65')]['hasMany'](db['ChatMessage'],{'as':_0x1fbe('0x163'),'onDelete':_0x1fbe('0x11b'),'foreignKey':_0x1fbe('0x1a0')});db[_0x1fbe('0x65')][_0x1fbe('0x12b')](db[_0x1fbe('0x182')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x1fbe('0x65')][_0x1fbe('0x12b')](db[_0x1fbe('0x70')],{'as':'Contact','foreignKey':_0x1fbe('0x187')});db['ChatInteraction'][_0x1fbe('0x12b')](db[_0x1fbe('0x11')],{'as':_0x1fbe('0x18d'),'foreignKey':_0x1fbe('0x11c')});db['ChatInteraction']['belongsToMany'](db[_0x1fbe('0x8e')],{'through':'chat_interaction_has_tags','as':'Tags'});db['ChatInteraction']['belongsToMany'](db[_0x1fbe('0x8e')],{'through':'chat_interaction_has_tags','as':'ThroughTags'});db['ChatInteraction'][_0x1fbe('0x12d')](db[_0x1fbe('0x11')],{'as':_0x1fbe('0x17e'),'through':_0x1fbe('0x137'),'foreignKey':_0x1fbe('0x1a0')});db['ChatMessage'][_0x1fbe('0x12b')](db['User'],{'onDelete':_0x1fbe('0x11b'),'as':_0x1fbe('0x11')});db[_0x1fbe('0x67')][_0x1fbe('0x12b')](db['CmContact'],{'onDelete':_0x1fbe('0x11b'),'as':_0x1fbe('0x17a'),'foreignKey':_0x1fbe('0x187')});db[_0x1fbe('0x67')][_0x1fbe('0x12b')](db[_0x1fbe('0x65')],{'onDelete':_0x1fbe('0x11b'),'as':_0x1fbe('0x181'),'foreignKey':_0x1fbe('0x1a0')});db[_0x1fbe('0x67')]['belongsTo'](db['Attachment'],{'as':_0x1fbe('0x190'),'foreignKey':_0x1fbe('0x1a1')});db['ChatMessage'][_0x1fbe('0x12b')](db[_0x1fbe('0x182')],{'as':'Account','foreignKey':_0x1fbe('0x183')});db[_0x1fbe('0x184')][_0x1fbe('0x11e')](db[_0x1fbe('0x190')],{'as':_0x1fbe('0x180'),'foreignKey':_0x1fbe('0x185'),'onDelete':_0x1fbe('0x11b'),'hooks':!![]});db[_0x1fbe('0x184')]['belongsTo'](db[_0x1fbe('0x70')],{'onDelete':_0x1fbe('0x11b'),'as':_0x1fbe('0x17a'),'foreignKey':_0x1fbe('0x187')});db['ChatOfflineMessage']['belongsTo'](db[_0x1fbe('0x182')],{'as':_0x1fbe('0x179'),'foreignKey':_0x1fbe('0x183')});db[_0x1fbe('0x6a')]['belongsToMany'](db['User'],{'as':_0x1fbe('0x160'),'through':_0x1fbe('0x2d'),'hooks':!![]});db[_0x1fbe('0x6a')][_0x1fbe('0x12d')](db[_0x1fbe('0x134')],{'through':_0x1fbe('0x1a2'),'as':'Teams'});db[_0x1fbe('0x6b')][_0x1fbe('0x11e')](db[_0x1fbe('0xd8')],{'as':_0x1fbe('0x163'),'foreignKey':'ChatGroupId','onDelete':'cascade'});db['ChatGroup'][_0x1fbe('0x12d')](db[_0x1fbe('0x11')],{'as':_0x1fbe('0x154'),'through':'chat_group_has_users'});db[_0x1fbe('0x6d')]['belongsTo'](db['ChatWebsite'],{'as':'Website','foreignKey':_0x1fbe('0x183')});db[_0x1fbe('0x1a3')]['hasMany'](db[_0x1fbe('0x70')],{'as':'Contacts','foreignKey':'CompanyId'});db[_0x1fbe('0x70')][_0x1fbe('0x11e')](db['CmContactHasItem'],{'as':_0x1fbe('0x1a4'),'foreignKey':_0x1fbe('0x1a5')});db['CmContact'][_0x1fbe('0x11e')](db[_0x1fbe('0x72')],{'as':_0x1fbe('0x156'),'foreignKey':'ContactId'});db[_0x1fbe('0x70')][_0x1fbe('0x11e')](db[_0x1fbe('0x75')],{'as':'HopperFinals','foreignKey':_0x1fbe('0x187')});db[_0x1fbe('0x70')][_0x1fbe('0x11e')](db['CmHopperHistory'],{'as':_0x1fbe('0x1a6'),'foreignKey':_0x1fbe('0x187')});db['CmContact'][_0x1fbe('0x11e')](db[_0x1fbe('0x79')],{'as':'ReportAgentPreview','foreignKey':'ContactId'});db[_0x1fbe('0x70')]['hasMany'](db[_0x1fbe('0xde')],{'as':_0x1fbe('0x158'),'foreignKey':_0x1fbe('0x187')});db[_0x1fbe('0x70')][_0x1fbe('0x11e')](db[_0x1fbe('0x125')],{'as':_0x1fbe('0x139'),'foreignKey':_0x1fbe('0x187'),'onDelete':_0x1fbe('0x16e')});db[_0x1fbe('0x70')][_0x1fbe('0x11e')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0x1fbe('0x187'),'onDelete':_0x1fbe('0x16e')});db['CmContact'][_0x1fbe('0x11e')](db['SmsInteraction'],{'as':_0x1fbe('0x138'),'foreignKey':'ContactId','onDelete':_0x1fbe('0x16e')});db[_0x1fbe('0x70')][_0x1fbe('0x11e')](db[_0x1fbe('0x4a')],{'as':_0x1fbe('0x127'),'foreignKey':_0x1fbe('0x187'),'onDelete':_0x1fbe('0x16e')});db[_0x1fbe('0x70')][_0x1fbe('0x11e')](db[_0x1fbe('0x3e')],{'as':_0x1fbe('0x128'),'foreignKey':'ContactId','onDelete':_0x1fbe('0x16e')});db[_0x1fbe('0x70')][_0x1fbe('0x12b')](db['CmCompany'],{'as':_0x1fbe('0x1a7'),'foreignKey':_0x1fbe('0x1a8')});db[_0x1fbe('0x70')][_0x1fbe('0x12b')](db[_0x1fbe('0xfd')],{'as':_0x1fbe('0x174'),'foreignKey':_0x1fbe('0x175'),'onDelete':'cascade'});db[_0x1fbe('0x70')][_0x1fbe('0x12d')](db[_0x1fbe('0x11')],{'as':_0x1fbe('0x17e'),'through':_0x1fbe('0x131')});db['CmContact'][_0x1fbe('0x12d')](db[_0x1fbe('0x8e')],{'as':_0x1fbe('0x17c'),'through':_0x1fbe('0x1a9')});db[_0x1fbe('0x70')][_0x1fbe('0x12d')](db[_0x1fbe('0x8e')],{'through':_0x1fbe('0x1a9'),'as':_0x1fbe('0x17d')});db[_0x1fbe('0x72')][_0x1fbe('0x11e')](db[_0x1fbe('0x92')],{'as':'AdditionalPhones','foreignKey':_0x1fbe('0x1aa')});db['CmHopper'][_0x1fbe('0x12b')](db[_0x1fbe('0x70')],{'as':_0x1fbe('0x17a'),'foreignKey':_0x1fbe('0x187'),'onDelete':_0x1fbe('0x11b')});db[_0x1fbe('0x72')][_0x1fbe('0x12b')](db[_0x1fbe('0xfd')],{'as':'List','foreignKey':'ListId','onDelete':_0x1fbe('0x11b')});db[_0x1fbe('0x72')][_0x1fbe('0x12b')](db[_0x1fbe('0x11')],{'as':'Agent','foreignKey':_0x1fbe('0x11c')});db['CmHopper'][_0x1fbe('0x12b')](db[_0x1fbe('0x19')],{'as':_0x1fbe('0x1ab'),'foreignKey':_0x1fbe('0x155'),'onDelete':_0x1fbe('0x11b')});db[_0x1fbe('0x72')][_0x1fbe('0x12b')](db[_0x1fbe('0xf2')],{'as':_0x1fbe('0xf2'),'foreignKey':_0x1fbe('0x1ac'),'onDelete':_0x1fbe('0x11b')});db[_0x1fbe('0x72')]['belongsTo'](db[_0x1fbe('0x11')],{'as':'Owner','foreignKey':'OwnerId'});db[_0x1fbe('0x74')][_0x1fbe('0x12b')](db[_0x1fbe('0x70')],{'as':_0x1fbe('0x17a'),'foreignKey':_0x1fbe('0x187'),'onDelete':_0x1fbe('0x11b')});db['CmHopperBlack']['belongsTo'](db['CmList'],{'as':_0x1fbe('0x174'),'foreignKey':'ListId','onDelete':_0x1fbe('0x11b')});db[_0x1fbe('0x74')][_0x1fbe('0x12b')](db[_0x1fbe('0x19')],{'as':_0x1fbe('0x1ab'),'foreignKey':'VoiceQueueId','onDelete':_0x1fbe('0x11b')});db[_0x1fbe('0x74')][_0x1fbe('0x12b')](db[_0x1fbe('0xf2')],{'as':_0x1fbe('0xf2'),'foreignKey':_0x1fbe('0x1ac'),'onDelete':_0x1fbe('0x11b')});db[_0x1fbe('0x7f')][_0x1fbe('0x11e')](db[_0x1fbe('0x84')],{'as':{'plural':_0x1fbe('0x1ad'),'singular':_0x1fbe('0x1ae')},'foreignKey':_0x1fbe('0x1af'),'onDelete':_0x1fbe('0x11b'),'hooks':!![]});db[_0x1fbe('0x7f')][_0x1fbe('0x11e')](db[_0x1fbe('0x84')],{'as':{'plural':_0x1fbe('0x1b0'),'singular':_0x1fbe('0x1b1')},'foreignKey':_0x1fbe('0x1b2'),'onDelete':'cascade','hooks':!![]});db[_0x1fbe('0x7f')][_0x1fbe('0x11e')](db[_0x1fbe('0x7d')],{'as':_0x1fbe('0x1b3'),'foreignKey':_0x1fbe('0x1b4'),'onDelete':_0x1fbe('0x11b'),'hooks':!![]});db[_0x1fbe('0x82')]['hasMany'](db[_0x1fbe('0x82')],{'as':_0x1fbe('0x170'),'foreignKey':_0x1fbe('0x1b5'),'onDelete':_0x1fbe('0x11b')});db[_0x1fbe('0x86')]['hasMany'](db['Interval'],{'as':_0x1fbe('0x1b6'),'foreignKey':_0x1fbe('0x186'),'onDelete':_0x1fbe('0x11b'),'hooks':!![],'required':![]});db['Interval'][_0x1fbe('0x11e')](db[_0x1fbe('0x121')],{'as':'Extensions','foreignKey':'IntervalId','onDelete':_0x1fbe('0x16e')});db['Interval']['hasMany'](db['MailApplication'],{'as':'MailApplications','foreignKey':_0x1fbe('0x186')});db['Interval'][_0x1fbe('0x11e')](db[_0x1fbe('0x64')],{'as':_0x1fbe('0x1b7'),'foreignKey':_0x1fbe('0x186')});db[_0x1fbe('0x86')]['hasMany'](db[_0x1fbe('0x49')],{'as':_0x1fbe('0x1b8'),'foreignKey':_0x1fbe('0x186')});db[_0x1fbe('0x86')][_0x1fbe('0x11e')](db['SmsApplication'],{'as':_0x1fbe('0x1b9'),'foreignKey':_0x1fbe('0x186')});db[_0x1fbe('0x1ba')][_0x1fbe('0x12b')](db[_0x1fbe('0x39')],{});db[_0x1fbe('0x1ba')][_0x1fbe('0x12b')](db[_0x1fbe('0x1bb')],{'foreignKey':_0x1fbe('0x1bc')});db['Schedule'][_0x1fbe('0x12b')](db[_0x1fbe('0x1bd')],{'foreignKey':_0x1fbe('0x1be')});db[_0x1fbe('0x8c')][_0x1fbe('0x12d')](db['VoiceMusicOnHold'],{'as':_0x1fbe('0x1bf'),'through':_0x1fbe('0x153'),'onDelete':_0x1fbe('0x16e')});db[_0x1fbe('0x8e')][_0x1fbe('0x12d')](db[_0x1fbe('0x70')],{'through':_0x1fbe('0x1a9')});db[_0x1fbe('0x8e')][_0x1fbe('0x12d')](db[_0x1fbe('0x65')],{'through':_0x1fbe('0x1c0')});db[_0x1fbe('0x8e')][_0x1fbe('0x12d')](db[_0x1fbe('0x3e')],{'through':_0x1fbe('0x17b')});db[_0x1fbe('0x8e')]['belongsToMany'](db[_0x1fbe('0x55')],{'through':_0x1fbe('0x194')});db['Tag'][_0x1fbe('0x12d')](db[_0x1fbe('0x4a')],{'through':'fax_interaction_has_tags'});db['Tag'][_0x1fbe('0x12d')](db['OpenchannelInteraction'],{'through':_0x1fbe('0x19c')});db[_0x1fbe('0x8e')]['belongsToMany'](db[_0x1fbe('0x129')],{'through':_0x1fbe('0x1c1')});db[_0x1fbe('0x1c2')]['belongsTo'](db['ContactItemType'],{'as':'ItemType','foreignKey':_0x1fbe('0x1c3')});db[_0x1fbe('0x92')]['belongsTo'](db[_0x1fbe('0x72')],{'as':_0x1fbe('0x1c4'),'foreignKey':_0x1fbe('0x1aa')});db[_0x1fbe('0x1c2')][_0x1fbe('0x12b')](db[_0x1fbe('0x70')],{'as':'Contact','foreignKey':'CmContactId'});db[_0x1fbe('0x95')][_0x1fbe('0x11e')](db[_0x1fbe('0x84')],{'as':{'plural':'AllConditions','singular':_0x1fbe('0x1c5')},'foreignKey':'TriggerAllId','onDelete':_0x1fbe('0x11b'),'hooks':!![]});db[_0x1fbe('0x95')][_0x1fbe('0x11e')](db['Condition'],{'as':{'plural':_0x1fbe('0x1c6'),'singular':_0x1fbe('0x1c7')},'foreignKey':_0x1fbe('0x1c8'),'onDelete':_0x1fbe('0x11b'),'hooks':!![]});db[_0x1fbe('0x95')][_0x1fbe('0x11e')](db['Action'],{'as':_0x1fbe('0x1b3'),'foreignKey':_0x1fbe('0x1c9'),'onDelete':'cascade','hooks':!![]});db[_0x1fbe('0x1bd')][_0x1fbe('0x11e')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0x1fbe('0x11b'),'foreignKey':_0x1fbe('0x1be'),'hooks':!![]});db[_0x1fbe('0x1bb')][_0x1fbe('0x11e')](db[_0x1fbe('0xa2')],{'as':'Fields','onDelete':_0x1fbe('0x11b'),'foreignKey':_0x1fbe('0x1bc')});db[_0x1fbe('0xa0')][_0x1fbe('0x11e')](db[_0x1fbe('0xa2')],{'as':_0x1fbe('0x1ca'),'onDelete':_0x1fbe('0x11b'),'foreignKey':_0x1fbe('0x1cb')});db[_0x1fbe('0xa2')][_0x1fbe('0x12b')](db[_0x1fbe('0xa0')],{'foreignKey':_0x1fbe('0x1cb')});db[_0x1fbe('0x1cc')]['hasMany'](db[_0x1fbe('0xa7')],{'as':_0x1fbe('0x1cd'),'onDelete':_0x1fbe('0x11b'),'foreignKey':_0x1fbe('0x1ce')});db[_0x1fbe('0xa7')][_0x1fbe('0x11e')](db[_0x1fbe('0x1cf')],{'as':_0x1fbe('0x1d0'),'onDelete':_0x1fbe('0x11b'),'foreignKey':'SubjectId'});db[_0x1fbe('0xa7')][_0x1fbe('0x11e')](db['SalesforceField'],{'as':_0x1fbe('0x1d1'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['SalesforceConfiguration'][_0x1fbe('0x11e')](db[_0x1fbe('0x1cf')],{'as':_0x1fbe('0x1ca'),'onDelete':'cascade','foreignKey':_0x1fbe('0x1d2')});db[_0x1fbe('0xa7')][_0x1fbe('0x12b')](db['SalesforceAccount'],{'as':'Account','foreignKey':_0x1fbe('0x1ce')});db[_0x1fbe('0x1cf')][_0x1fbe('0x11e')](db[_0x1fbe('0x1cf')],{'as':_0x1fbe('0x1d3'),'foreignKey':_0x1fbe('0x1d4')});db['SalesforceField']['hasMany'](db[_0x1fbe('0x1cf')],{'as':'Description','foreignKey':_0x1fbe('0x1d5')});db[_0x1fbe('0x1cf')][_0x1fbe('0x11e')](db[_0x1fbe('0x1cf')],{'as':_0x1fbe('0x1d6'),'foreignKey':'FieldId'});db[_0x1fbe('0x1cf')][_0x1fbe('0x12b')](db[_0x1fbe('0x97')],{'as':'Variable','foreignKey':_0x1fbe('0x1d7')});db[_0x1fbe('0xa8')][_0x1fbe('0x11e')](db[_0x1fbe('0xaa')],{'as':_0x1fbe('0x1cd'),'onDelete':_0x1fbe('0x11b'),'foreignKey':_0x1fbe('0x1ce')});db[_0x1fbe('0xaa')]['hasMany'](db[_0x1fbe('0xac')],{'as':_0x1fbe('0x1d0'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x1fbe('0xaa')]['hasMany'](db[_0x1fbe('0xac')],{'as':_0x1fbe('0x1d1'),'onDelete':_0x1fbe('0x11b'),'foreignKey':_0x1fbe('0x1d5')});db['SugarcrmConfiguration'][_0x1fbe('0x11e')](db[_0x1fbe('0xac')],{'as':_0x1fbe('0x1ca'),'onDelete':_0x1fbe('0x11b'),'foreignKey':_0x1fbe('0x1d2')});db[_0x1fbe('0xaa')][_0x1fbe('0x12b')](db[_0x1fbe('0xa8')],{'as':_0x1fbe('0x179'),'foreignKey':_0x1fbe('0x1ce')});db[_0x1fbe('0xac')][_0x1fbe('0x11e')](db['SugarcrmField'],{'as':_0x1fbe('0x1d3'),'foreignKey':_0x1fbe('0x1d4')});db[_0x1fbe('0xac')]['hasMany'](db[_0x1fbe('0xac')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x1fbe('0xac')][_0x1fbe('0x11e')](db[_0x1fbe('0xac')],{'as':_0x1fbe('0x1d6'),'foreignKey':_0x1fbe('0x1d2')});db[_0x1fbe('0xac')]['belongsTo'](db['Variable'],{'as':_0x1fbe('0x97'),'foreignKey':_0x1fbe('0x1d7')});db['DeskAccount']['hasMany'](db['DeskConfiguration'],{'as':'Configurations','onDelete':_0x1fbe('0x11b'),'foreignKey':_0x1fbe('0x1ce')});db['DeskConfiguration']['hasMany'](db[_0x1fbe('0xb1')],{'as':_0x1fbe('0x1d0'),'onDelete':_0x1fbe('0x11b'),'foreignKey':'SubjectId'});db[_0x1fbe('0xaf')][_0x1fbe('0x11e')](db['DeskField'],{'as':_0x1fbe('0x1d1'),'onDelete':_0x1fbe('0x11b'),'foreignKey':_0x1fbe('0x1d5')});db[_0x1fbe('0xaf')][_0x1fbe('0x11e')](db[_0x1fbe('0xb1')],{'as':_0x1fbe('0x1ca'),'onDelete':_0x1fbe('0x11b'),'foreignKey':_0x1fbe('0x1d2')});db[_0x1fbe('0xaf')][_0x1fbe('0x12b')](db[_0x1fbe('0x1d8')],{'as':_0x1fbe('0x179'),'foreignKey':_0x1fbe('0x1ce')});db['DeskConfiguration'][_0x1fbe('0x12d')](db[_0x1fbe('0x8e')],{'through':_0x1fbe('0x1d9')});db[_0x1fbe('0xb1')][_0x1fbe('0x11e')](db[_0x1fbe('0xb1')],{'as':_0x1fbe('0x1d3'),'foreignKey':_0x1fbe('0x1d4')});db[_0x1fbe('0xb1')]['hasMany'](db['DeskField'],{'as':'Description','foreignKey':_0x1fbe('0x1d5')});db[_0x1fbe('0xb1')][_0x1fbe('0x11e')](db[_0x1fbe('0xb1')],{'as':_0x1fbe('0x1d6'),'foreignKey':_0x1fbe('0x1d2')});db['DeskField']['belongsTo'](db[_0x1fbe('0x97')],{'as':_0x1fbe('0x97'),'foreignKey':'VariableId'});db['ZohoAccount'][_0x1fbe('0x11e')](db[_0x1fbe('0x1da')],{'as':_0x1fbe('0x1cd'),'onDelete':'cascade','foreignKey':_0x1fbe('0x1ce')});db[_0x1fbe('0x1da')][_0x1fbe('0x11e')](db[_0x1fbe('0xb5')],{'as':_0x1fbe('0x1d0'),'onDelete':_0x1fbe('0x11b'),'foreignKey':_0x1fbe('0x1d4')});db[_0x1fbe('0x1da')][_0x1fbe('0x11e')](db[_0x1fbe('0xb5')],{'as':'Descriptions','onDelete':_0x1fbe('0x11b'),'foreignKey':'DescriptionId'});db['ZohoConfiguration'][_0x1fbe('0x11e')](db[_0x1fbe('0xb5')],{'as':_0x1fbe('0x1ca'),'onDelete':'cascade','foreignKey':_0x1fbe('0x1d2')});db[_0x1fbe('0x1da')][_0x1fbe('0x12b')](db['ZohoAccount'],{'as':'Account','foreignKey':_0x1fbe('0x1ce')});db[_0x1fbe('0xb5')][_0x1fbe('0x11e')](db[_0x1fbe('0xb5')],{'as':_0x1fbe('0x1d3'),'foreignKey':_0x1fbe('0x1d4')});db[_0x1fbe('0xb5')][_0x1fbe('0x11e')](db[_0x1fbe('0xb5')],{'as':_0x1fbe('0x1db'),'foreignKey':_0x1fbe('0x1d5')});db[_0x1fbe('0xb5')][_0x1fbe('0x11e')](db[_0x1fbe('0xb5')],{'as':'Field','foreignKey':'FieldId'});db[_0x1fbe('0xb5')]['belongsTo'](db[_0x1fbe('0x97')],{'as':_0x1fbe('0x97'),'foreignKey':'VariableId'});db[_0x1fbe('0xb7')]['hasMany'](db['ZendeskConfiguration'],{'as':_0x1fbe('0x1cd'),'onDelete':_0x1fbe('0x11b'),'foreignKey':_0x1fbe('0x1ce')});db[_0x1fbe('0x1dc')][_0x1fbe('0x11e')](db['ZendeskField'],{'as':_0x1fbe('0x1d0'),'foreignKey':_0x1fbe('0x1d4')});db['ZendeskConfiguration'][_0x1fbe('0x11e')](db['ZendeskField'],{'as':'Descriptions','foreignKey':_0x1fbe('0x1d5')});db[_0x1fbe('0x1dc')]['hasMany'](db['ZendeskField'],{'as':_0x1fbe('0x1ca'),'foreignKey':_0x1fbe('0x1d2')});db['ZendeskConfiguration'][_0x1fbe('0x12b')](db[_0x1fbe('0xb7')],{'as':'Account','foreignKey':_0x1fbe('0x1ce')});db[_0x1fbe('0x1dc')][_0x1fbe('0x12d')](db[_0x1fbe('0x8e')],{'through':_0x1fbe('0x1dd')});db[_0x1fbe('0xb9')][_0x1fbe('0x11e')](db[_0x1fbe('0xb9')],{'as':_0x1fbe('0x1d3'),'foreignKey':_0x1fbe('0x1d4')});db[_0x1fbe('0xb9')][_0x1fbe('0x11e')](db[_0x1fbe('0xb9')],{'as':_0x1fbe('0x1db'),'foreignKey':'DescriptionId'});db['ZendeskField'][_0x1fbe('0x11e')](db[_0x1fbe('0xb9')],{'as':_0x1fbe('0x1d6'),'foreignKey':_0x1fbe('0x1d2')});db['ZendeskField'][_0x1fbe('0x12b')](db[_0x1fbe('0x97')],{'as':_0x1fbe('0x97'),'foreignKey':'VariableId'});db['FreshdeskAccount'][_0x1fbe('0x11e')](db[_0x1fbe('0xbd')],{'as':_0x1fbe('0x1cd'),'onDelete':_0x1fbe('0x11b'),'foreignKey':_0x1fbe('0x1ce')});db[_0x1fbe('0xbd')][_0x1fbe('0x11e')](db[_0x1fbe('0xbf')],{'as':_0x1fbe('0x1d0'),'onDelete':'cascade','foreignKey':_0x1fbe('0x1d4')});db[_0x1fbe('0xbd')][_0x1fbe('0x11e')](db[_0x1fbe('0xbf')],{'as':_0x1fbe('0x1d1'),'onDelete':_0x1fbe('0x11b'),'foreignKey':_0x1fbe('0x1d5')});db['FreshdeskConfiguration'][_0x1fbe('0x11e')](db[_0x1fbe('0xbf')],{'as':_0x1fbe('0x1ca'),'onDelete':'cascade','foreignKey':_0x1fbe('0x1d2')});db[_0x1fbe('0xbd')]['belongsTo'](db[_0x1fbe('0xbb')],{'as':'Account','foreignKey':'AccountId'});db[_0x1fbe('0xbd')]['belongsToMany'](db[_0x1fbe('0x8e')],{'through':_0x1fbe('0x1de')});db[_0x1fbe('0xbf')]['hasMany'](db['FreshdeskField'],{'as':_0x1fbe('0x1d3'),'foreignKey':'SubjectId'});db[_0x1fbe('0xbf')][_0x1fbe('0x11e')](db[_0x1fbe('0xbf')],{'as':_0x1fbe('0x1db'),'foreignKey':_0x1fbe('0x1d5')});db['FreshdeskField']['hasMany'](db['FreshdeskField'],{'as':_0x1fbe('0x1d6'),'foreignKey':_0x1fbe('0x1d2')});db[_0x1fbe('0xbf')]['belongsTo'](db[_0x1fbe('0x97')],{'as':'Variable','foreignKey':'VariableId'});db[_0x1fbe('0x1df')][_0x1fbe('0x11e')](db[_0x1fbe('0xc2')],{'as':_0x1fbe('0x1cd'),'onDelete':_0x1fbe('0x11b'),'foreignKey':_0x1fbe('0x1ce')});db['VtigerConfiguration'][_0x1fbe('0x11e')](db['VtigerField'],{'as':'Subjects','foreignKey':_0x1fbe('0x1d4')});db[_0x1fbe('0xc2')][_0x1fbe('0x11e')](db[_0x1fbe('0xc4')],{'as':_0x1fbe('0x1d1'),'foreignKey':'DescriptionId'});db[_0x1fbe('0xc2')]['hasMany'](db['VtigerField'],{'as':_0x1fbe('0x1ca'),'foreignKey':_0x1fbe('0x1d2')});db[_0x1fbe('0xc2')][_0x1fbe('0x12b')](db[_0x1fbe('0x1df')],{'as':'Account','foreignKey':_0x1fbe('0x1ce')});db[_0x1fbe('0xc4')][_0x1fbe('0x11e')](db[_0x1fbe('0xc4')],{'as':_0x1fbe('0x1d3'),'foreignKey':_0x1fbe('0x1d4')});db['VtigerField'][_0x1fbe('0x11e')](db[_0x1fbe('0xc4')],{'as':'Description','foreignKey':_0x1fbe('0x1d5')});db['VtigerField'][_0x1fbe('0x11e')](db['VtigerField'],{'as':_0x1fbe('0x1d6'),'foreignKey':_0x1fbe('0x1d2')});db['VtigerField'][_0x1fbe('0x12b')](db[_0x1fbe('0x97')],{'as':_0x1fbe('0x97'),'foreignKey':_0x1fbe('0x1d7')});db['ServicenowAccount'][_0x1fbe('0x11e')](db[_0x1fbe('0xc8')],{'as':_0x1fbe('0x1cd'),'onDelete':'cascade','foreignKey':_0x1fbe('0x1ce')});db[_0x1fbe('0xc8')][_0x1fbe('0x11e')](db[_0x1fbe('0x1e0')],{'as':_0x1fbe('0x1d0'),'foreignKey':_0x1fbe('0x1d4')});db[_0x1fbe('0xc8')][_0x1fbe('0x11e')](db[_0x1fbe('0x1e0')],{'as':_0x1fbe('0x1d1'),'foreignKey':_0x1fbe('0x1d5')});db['ServicenowConfiguration'][_0x1fbe('0x11e')](db[_0x1fbe('0x1e0')],{'as':_0x1fbe('0x1ca'),'foreignKey':_0x1fbe('0x1d2')});db['ServicenowConfiguration'][_0x1fbe('0x12b')](db['ServicenowAccount'],{'as':'Account','foreignKey':_0x1fbe('0x1ce')});db[_0x1fbe('0x1e0')][_0x1fbe('0x11e')](db[_0x1fbe('0x1e0')],{'as':_0x1fbe('0x1d3'),'foreignKey':'SubjectId'});db[_0x1fbe('0x1e0')]['hasMany'](db[_0x1fbe('0x1e0')],{'as':_0x1fbe('0x1db'),'foreignKey':_0x1fbe('0x1d5')});db[_0x1fbe('0x1e0')][_0x1fbe('0x11e')](db[_0x1fbe('0x1e0')],{'as':'Field','foreignKey':'FieldId'});db[_0x1fbe('0x1e0')]['belongsTo'](db[_0x1fbe('0x97')],{'as':'Variable','foreignKey':_0x1fbe('0x1d7')});db['Dynamics365Account'][_0x1fbe('0x11e')](db['Dynamics365Configuration'],{'as':_0x1fbe('0x1cd'),'onDelete':_0x1fbe('0x11b'),'foreignKey':_0x1fbe('0x1ce')});db[_0x1fbe('0xca')][_0x1fbe('0x12b')](db[_0x1fbe('0x16b')],{'as':_0x1fbe('0x16b'),'foreignKey':_0x1fbe('0x16c')});db[_0x1fbe('0xcc')]['hasMany'](db[_0x1fbe('0xce')],{'as':_0x1fbe('0x1d0'),'onDelete':'cascade','foreignKey':_0x1fbe('0x1d4')});db['Dynamics365Configuration'][_0x1fbe('0x11e')](db[_0x1fbe('0xce')],{'as':_0x1fbe('0x1d1'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x1fbe('0xcc')][_0x1fbe('0x11e')](db[_0x1fbe('0xce')],{'as':_0x1fbe('0x1ca'),'onDelete':_0x1fbe('0x11b'),'foreignKey':_0x1fbe('0x1d2')});db['Dynamics365Configuration'][_0x1fbe('0x12b')](db[_0x1fbe('0xca')],{'as':'Account','foreignKey':_0x1fbe('0x1ce')});db['Dynamics365Field']['hasMany'](db[_0x1fbe('0xce')],{'as':_0x1fbe('0x1d3'),'foreignKey':'SubjectId'});db['Dynamics365Field']['hasMany'](db[_0x1fbe('0xce')],{'as':_0x1fbe('0x1db'),'foreignKey':_0x1fbe('0x1d5')});db[_0x1fbe('0xce')][_0x1fbe('0x11e')](db['Dynamics365Field'],{'as':'Field','foreignKey':'FieldId'});db[_0x1fbe('0xce')][_0x1fbe('0x12b')](db[_0x1fbe('0x97')],{'as':_0x1fbe('0x97'),'foreignKey':_0x1fbe('0x1d7')});db[_0x1fbe('0xd0')][_0x1fbe('0x11e')](db[_0x1fbe('0xd2')],{'as':_0x1fbe('0x1cd'),'onDelete':_0x1fbe('0x11b'),'foreignKey':_0x1fbe('0x1ce')});db[_0x1fbe('0xd2')][_0x1fbe('0x11e')](db[_0x1fbe('0xd4')],{'as':_0x1fbe('0x1d0'),'foreignKey':_0x1fbe('0x1d4')});db[_0x1fbe('0xd2')][_0x1fbe('0x11e')](db[_0x1fbe('0xd4')],{'as':_0x1fbe('0x1d1'),'foreignKey':_0x1fbe('0x1d5')});db[_0x1fbe('0xd2')]['hasMany'](db[_0x1fbe('0xd4')],{'as':_0x1fbe('0x1ca'),'foreignKey':_0x1fbe('0x1d2')});db[_0x1fbe('0xd2')][_0x1fbe('0x12b')](db[_0x1fbe('0xd0')],{'as':_0x1fbe('0x179'),'foreignKey':_0x1fbe('0x1ce')});db[_0x1fbe('0xd4')][_0x1fbe('0x11e')](db['FreshsalesField'],{'as':_0x1fbe('0x1d3'),'foreignKey':'SubjectId'});db[_0x1fbe('0xd4')][_0x1fbe('0x11e')](db[_0x1fbe('0xd4')],{'as':_0x1fbe('0x1db'),'foreignKey':_0x1fbe('0x1d5')});db['FreshsalesField'][_0x1fbe('0x11e')](db[_0x1fbe('0xd4')],{'as':_0x1fbe('0x1d6'),'foreignKey':_0x1fbe('0x1d2')});db[_0x1fbe('0xd4')]['belongsTo'](db[_0x1fbe('0x97')],{'as':_0x1fbe('0x97'),'foreignKey':_0x1fbe('0x1d7')});db[_0x1fbe('0xd7')]['belongsTo'](db[_0x1fbe('0x182')],{});db['ChatQueueReport'][_0x1fbe('0x12b')](db[_0x1fbe('0xfd')],{'as':'List','foreignKey':_0x1fbe('0x175')});db[_0x1fbe('0xd7')][_0x1fbe('0x12b')](db['CmContact'],{'as':_0x1fbe('0x17a'),'foreignKey':_0x1fbe('0x187')});db[_0x1fbe('0xd7')][_0x1fbe('0x12b')](db[_0x1fbe('0x65')],{});db[_0x1fbe('0xd7')][_0x1fbe('0x12b')](db[_0x1fbe('0x67')],{});db[_0x1fbe('0xd7')][_0x1fbe('0x12b')](db[_0x1fbe('0x11')],{});db[_0x1fbe('0xd7')]['belongsTo'](db['ChatQueue'],{});db[_0x1fbe('0xd8')][_0x1fbe('0x12b')](db[_0x1fbe('0x11')],{'onDelete':_0x1fbe('0x11b'),'foreignKey':'FromId'});db[_0x1fbe('0xd8')][_0x1fbe('0x12b')](db[_0x1fbe('0x11')],{'onDelete':_0x1fbe('0x11b'),'foreignKey':_0x1fbe('0x1e1')});db[_0x1fbe('0xde')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':'SessionId','onDelete':_0x1fbe('0x11b')});db[_0x1fbe('0xde')]['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':_0x1fbe('0x1e2'),'onDelete':_0x1fbe('0x11b')});db[_0x1fbe('0xe0')]['belongsTo'](db['SmsAccount'],{});db[_0x1fbe('0xe0')]['belongsTo'](db[_0x1fbe('0xfd')],{'as':'List','foreignKey':'ListId'});db[_0x1fbe('0xe0')][_0x1fbe('0x12b')](db['CmContact'],{'as':'Contact','foreignKey':_0x1fbe('0x187')});db['SmsQueueReport']['belongsTo'](db['SmsInteraction'],{});db[_0x1fbe('0xe0')][_0x1fbe('0x12b')](db[_0x1fbe('0x57')],{});db[_0x1fbe('0xe0')][_0x1fbe('0x12b')](db[_0x1fbe('0x11')],{});db[_0x1fbe('0xe0')][_0x1fbe('0x12b')](db['SmsQueue'],{});db['JscriptyProject'][_0x1fbe('0x11e')](db['JscriptySessionReport'],{'foreignKey':'ProjectId'});db['JscriptyProject'][_0x1fbe('0x11e')](db[_0x1fbe('0xdc')],{'foreignKey':_0x1fbe('0x1e3')});db[_0x1fbe('0xe6')][_0x1fbe('0x11e')](db[_0x1fbe('0xda')],{'foreignKey':_0x1fbe('0x1e3')});db['Team'][_0x1fbe('0x12d')](db[_0x1fbe('0x11')],{'as':_0x1fbe('0x160'),'through':'user_has_teams'});db['Team']['belongsToMany'](db[_0x1fbe('0x19')],{'through':_0x1fbe('0x112'),'as':_0x1fbe('0x1e4')});db[_0x1fbe('0x134')][_0x1fbe('0x12d')](db[_0x1fbe('0x3b')],{'through':_0x1fbe('0x176'),'as':_0x1fbe('0x13d')});db['Team'][_0x1fbe('0x12d')](db[_0x1fbe('0x6a')],{'through':_0x1fbe('0x1a2'),'as':'ChatQueues'});db[_0x1fbe('0x134')][_0x1fbe('0x12d')](db[_0x1fbe('0x4e')],{'through':'team_has_fax_queues','as':_0x1fbe('0x13f')});db[_0x1fbe('0x134')][_0x1fbe('0x12d')](db[_0x1fbe('0x140')],{'through':'team_has_sms_queues','as':_0x1fbe('0x141')});db[_0x1fbe('0x134')]['belongsToMany'](db[_0x1fbe('0x5f')],{'through':_0x1fbe('0x1e5'),'as':_0x1fbe('0x142')});db['Team'][_0x1fbe('0x12d')](db[_0x1fbe('0x10f')],{'through':_0x1fbe('0x1e6'),'as':_0x1fbe('0x143')});db[_0x1fbe('0x134')][_0x1fbe('0x12d')](db[_0x1fbe('0xfe')],{'through':_0x1fbe('0x114'),'as':_0x1fbe('0x1e7')});db['Campaign'][_0x1fbe('0x11e')](db[_0x1fbe('0x72')],{'as':_0x1fbe('0x156'),'foreignKey':'CampaignId'});db['Campaign'][_0x1fbe('0x11e')](db[_0x1fbe('0x75')],{'as':_0x1fbe('0x123'),'foreignKey':_0x1fbe('0x1ac')});db['Campaign'][_0x1fbe('0x11e')](db[_0x1fbe('0x77')],{'as':_0x1fbe('0x1a6'),'foreignKey':'CampaignId'});db['Campaign'][_0x1fbe('0x11e')](db[_0x1fbe('0x74')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db['Campaign'][_0x1fbe('0x12b')](db[_0x1fbe('0x159')],{'as':_0x1fbe('0x159'),'foreignKey':_0x1fbe('0x15a')});db[_0x1fbe('0xf2')]['belongsTo'](db['Trunk'],{'as':_0x1fbe('0x15b'),'foreignKey':'TrunkBackupId'});db[_0x1fbe('0xf2')][_0x1fbe('0x12b')](db[_0x1fbe('0x86')],{'as':_0x1fbe('0x86'),'foreignKey':'IntervalId'});db[_0x1fbe('0xf2')][_0x1fbe('0x12b')](db[_0x1fbe('0x1e8')],{'as':_0x1fbe('0x1e8'),'foreignKey':_0x1fbe('0x1e9')});db[_0x1fbe('0xf2')]['belongsToMany'](db[_0x1fbe('0xfd')],{'as':_0x1fbe('0x132'),'through':_0x1fbe('0x1ea')});db[_0x1fbe('0xf2')][_0x1fbe('0x12d')](db['CmList'],{'as':'BlackLists','through':_0x1fbe('0x1eb')});db[_0x1fbe('0x190')]['belongsTo'](db[_0x1fbe('0x184')],{'as':_0x1fbe('0x184'),'foreignKey':_0x1fbe('0x185')});db['MailTransferReport'][_0x1fbe('0x12b')](db[_0x1fbe('0x17f')],{});db[_0x1fbe('0xf7')][_0x1fbe('0x12b')](db[_0x1fbe('0x3e')],{});db[_0x1fbe('0xf7')][_0x1fbe('0x12b')](db['MailAccount'],{'foreignKey':_0x1fbe('0x1ec'),'as':_0x1fbe('0x1ed')});db[_0x1fbe('0xf7')]['belongsTo'](db['User'],{'foreignKey':_0x1fbe('0x1ee'),'as':'FromAgent'});db[_0x1fbe('0xf7')][_0x1fbe('0x12b')](db['User'],{'foreignKey':_0x1fbe('0x1ef'),'as':_0x1fbe('0x1f0')});db[_0x1fbe('0xf7')][_0x1fbe('0x12b')](db['MailQueue'],{'foreignKey':_0x1fbe('0x1f1'),'as':_0x1fbe('0x1f2')});db[_0x1fbe('0xf7')][_0x1fbe('0x12b')](db[_0x1fbe('0x39')],{'foreignKey':'ToMailAccountId','as':_0x1fbe('0x1f3')});db[_0x1fbe('0xf8')][_0x1fbe('0x12b')](db[_0x1fbe('0x67')],{});db['ChatTransferReport'][_0x1fbe('0x12b')](db[_0x1fbe('0x65')],{});db[_0x1fbe('0xf8')][_0x1fbe('0x12b')](db[_0x1fbe('0x182')],{'foreignKey':_0x1fbe('0x1f4'),'as':_0x1fbe('0x1ed')});db[_0x1fbe('0xf8')][_0x1fbe('0x12b')](db[_0x1fbe('0x11')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x1fbe('0xf8')][_0x1fbe('0x12b')](db[_0x1fbe('0x11')],{'foreignKey':_0x1fbe('0x1ef'),'as':_0x1fbe('0x1f0')});db['ChatTransferReport'][_0x1fbe('0x12b')](db[_0x1fbe('0x6a')],{'foreignKey':'ToChatQueueId','as':_0x1fbe('0x1f2')});db[_0x1fbe('0xf8')][_0x1fbe('0x12b')](db[_0x1fbe('0x182')],{'foreignKey':_0x1fbe('0x1f5'),'as':'ToAccount'});db[_0x1fbe('0xf9')][_0x1fbe('0x12b')](db[_0x1fbe('0x4c')],{});db[_0x1fbe('0xf9')]['belongsTo'](db['FaxInteraction'],{});db['FaxTransferReport']['belongsTo'](db[_0x1fbe('0x47')],{'foreignKey':_0x1fbe('0x1f6'),'as':_0x1fbe('0x1ed')});db[_0x1fbe('0xf9')][_0x1fbe('0x12b')](db[_0x1fbe('0x11')],{'foreignKey':'FromUserId','as':_0x1fbe('0x1f7')});db[_0x1fbe('0xf9')][_0x1fbe('0x12b')](db['User'],{'foreignKey':_0x1fbe('0x1ef'),'as':_0x1fbe('0x1f0')});db['FaxTransferReport'][_0x1fbe('0x12b')](db['FaxQueue'],{'foreignKey':_0x1fbe('0x1f8'),'as':_0x1fbe('0x1f2')});db[_0x1fbe('0xf9')]['belongsTo'](db[_0x1fbe('0x47')],{'foreignKey':_0x1fbe('0x1f9'),'as':_0x1fbe('0x1f3')});db['OpenchannelTransferReport'][_0x1fbe('0x12b')](db[_0x1fbe('0x5d')],{});db[_0x1fbe('0xfa')]['belongsTo'](db['OpenchannelInteraction'],{});db[_0x1fbe('0xfa')][_0x1fbe('0x12b')](db[_0x1fbe('0x14a')],{'foreignKey':_0x1fbe('0x1fa'),'as':_0x1fbe('0x1ed')});db[_0x1fbe('0xfa')][_0x1fbe('0x12b')](db[_0x1fbe('0x11')],{'foreignKey':'FromUserId','as':_0x1fbe('0x1f7')});db[_0x1fbe('0xfa')][_0x1fbe('0x12b')](db['User'],{'foreignKey':'ToUserId','as':_0x1fbe('0x1f0')});db[_0x1fbe('0xfa')][_0x1fbe('0x12b')](db[_0x1fbe('0x5f')],{'foreignKey':_0x1fbe('0x1fb'),'as':'ToQueue'});db[_0x1fbe('0xfa')][_0x1fbe('0x12b')](db[_0x1fbe('0x14a')],{'foreignKey':_0x1fbe('0x1fc'),'as':_0x1fbe('0x1f3')});db[_0x1fbe('0xfb')][_0x1fbe('0x12b')](db[_0x1fbe('0x57')],{});db['SmsTransferReport']['belongsTo'](db[_0x1fbe('0x55')],{});db[_0x1fbe('0xfb')][_0x1fbe('0x12b')](db['SmsAccount'],{'foreignKey':_0x1fbe('0x1fd'),'as':_0x1fbe('0x1ed')});db[_0x1fbe('0xfb')]['belongsTo'](db['User'],{'foreignKey':_0x1fbe('0x1ee'),'as':_0x1fbe('0x1f7')});db[_0x1fbe('0xfb')][_0x1fbe('0x12b')](db[_0x1fbe('0x11')],{'foreignKey':_0x1fbe('0x1ef'),'as':_0x1fbe('0x1f0')});db[_0x1fbe('0xfb')][_0x1fbe('0x12b')](db[_0x1fbe('0x140')],{'foreignKey':_0x1fbe('0x1fe'),'as':_0x1fbe('0x1f2')});db['SmsTransferReport'][_0x1fbe('0x12b')](db['SmsAccount'],{'foreignKey':_0x1fbe('0x1ff'),'as':_0x1fbe('0x1f3')});db[_0x1fbe('0xfd')]['hasMany'](db[_0x1fbe('0x82')],{'as':_0x1fbe('0x170'),'foreignKey':_0x1fbe('0x175'),'onDelete':_0x1fbe('0x11b')});db[_0x1fbe('0xfd')]['hasMany'](db[_0x1fbe('0x7b')],{'as':_0x1fbe('0x200'),'foreignKey':_0x1fbe('0x175')});db[_0x1fbe('0xfd')][_0x1fbe('0x11e')](db[_0x1fbe('0x70')],{'as':_0x1fbe('0x130'),'onDelete':_0x1fbe('0x11b'),'foreignKey':'ListId'});db[_0x1fbe('0xfd')][_0x1fbe('0x11e')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x1fbe('0x175')});db['CmList']['hasMany'](db[_0x1fbe('0x77')],{'as':_0x1fbe('0x124'),'foreignKey':'ListId'});db['CmList'][_0x1fbe('0x11e')](db['ReportAgentPreview'],{'as':_0x1fbe('0x79'),'foreignKey':_0x1fbe('0x175')});db['CmList'][_0x1fbe('0x12d')](db[_0x1fbe('0x19')],{'as':'Queues','through':_0x1fbe('0x15f')});db[_0x1fbe('0xfd')][_0x1fbe('0x12d')](db[_0x1fbe('0x11')],{'as':_0x1fbe('0x160'),'through':_0x1fbe('0x133')});db[_0x1fbe('0xfe')][_0x1fbe('0x11e')](db[_0x1fbe('0x121')],{'as':_0x1fbe('0x122'),'onDelete':_0x1fbe('0x11b')});db[_0x1fbe('0xfe')][_0x1fbe('0x12d')](db['User'],{'as':_0x1fbe('0x160'),'through':_0x1fbe('0x116')});db[_0x1fbe('0xfe')]['belongsToMany'](db['Team'],{'through':_0x1fbe('0x114'),'as':_0x1fbe('0x177')});db[_0x1fbe('0x100')][_0x1fbe('0x11e')](db[_0x1fbe('0x11')],{'as':_0x1fbe('0x17e'),'foreignKey':_0x1fbe('0x12c')});db['UserProfile']['hasMany'](db[_0x1fbe('0x201')],{'as':_0x1fbe('0x202'),'foreignKey':_0x1fbe('0x12c'),'onDelete':'cascade'});db[_0x1fbe('0x201')][_0x1fbe('0x11e')](db[_0x1fbe('0x203')],{'as':_0x1fbe('0x204'),'foreignKey':_0x1fbe('0x205'),'onDelete':_0x1fbe('0x11b')});db['WhatsappAccount'][_0x1fbe('0x11e')](db[_0x1fbe('0x82')],{'as':'Dispositions','foreignKey':_0x1fbe('0x206'),'onDelete':_0x1fbe('0x11b')});db[_0x1fbe('0x105')]['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x1fbe('0x206')});db[_0x1fbe('0x105')][_0x1fbe('0x11e')](db[_0x1fbe('0x207')],{'as':'Messages','foreignKey':_0x1fbe('0x206')});db[_0x1fbe('0x105')][_0x1fbe('0x11e')](db[_0x1fbe('0x129')],{'as':_0x1fbe('0x173')});db[_0x1fbe('0x105')][_0x1fbe('0x11e')](db[_0x1fbe('0x107')],{'as':_0x1fbe('0x199')});db[_0x1fbe('0x105')][_0x1fbe('0x12b')](db[_0x1fbe('0xfd')],{'as':_0x1fbe('0x174'),'foreignKey':'ListId'});db[_0x1fbe('0x105')]['belongsTo'](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x1fbe('0x15e')});db[_0x1fbe('0x105')]['belongsToMany'](db[_0x1fbe('0x11')],{'as':_0x1fbe('0x160'),'through':'user_has_whatsapp_accounts'});db['WhatsappApplication'][_0x1fbe('0x12b')](db['User'],{'onDelete':_0x1fbe('0x16e')});db[_0x1fbe('0x107')][_0x1fbe('0x12b')](db['WhatsappQueue'],{'onDelete':_0x1fbe('0x16e')});db[_0x1fbe('0x107')][_0x1fbe('0x12b')](db['WhatsappAccount'],{'onDelete':_0x1fbe('0x16e')});db['WhatsappApplication'][_0x1fbe('0x12b')](db[_0x1fbe('0x86')],{'onDelete':'restrict','foreignKey':_0x1fbe('0x186')});db[_0x1fbe('0x107')][_0x1fbe('0x12b')](db['Tag'],{'onDelete':_0x1fbe('0x16e'),'foreignKey':'TagId'});db[_0x1fbe('0x129')]['hasMany'](db[_0x1fbe('0x207')],{'as':'Messages','onDelete':_0x1fbe('0x11b'),'foreignKey':'WhatsappInteractionId'});db[_0x1fbe('0x129')][_0x1fbe('0x12b')](db['WhatsappAccount'],{'as':_0x1fbe('0x179'),'foreignKey':_0x1fbe('0x206')});db['WhatsappInteraction'][_0x1fbe('0x12b')](db[_0x1fbe('0x70')],{'as':_0x1fbe('0x17a'),'foreignKey':_0x1fbe('0x187')});db['WhatsappInteraction'][_0x1fbe('0x12b')](db[_0x1fbe('0x11')],{'as':_0x1fbe('0x18d'),'foreignKey':'UserId'});db[_0x1fbe('0x129')][_0x1fbe('0x12d')](db['Tag'],{'through':_0x1fbe('0x1c1'),'as':_0x1fbe('0x17c')});db[_0x1fbe('0x129')][_0x1fbe('0x12d')](db[_0x1fbe('0x8e')],{'through':_0x1fbe('0x1c1'),'as':_0x1fbe('0x17d')});db[_0x1fbe('0x129')][_0x1fbe('0x12d')](db[_0x1fbe('0x11')],{'as':_0x1fbe('0x17e'),'through':'user_has_whatsapp_interactions','foreignKey':_0x1fbe('0x208')});db[_0x1fbe('0x207')][_0x1fbe('0x12b')](db['User'],{'as':_0x1fbe('0x11')});db[_0x1fbe('0x207')][_0x1fbe('0x12b')](db[_0x1fbe('0x70')],{'onDelete':_0x1fbe('0x11b'),'as':_0x1fbe('0x17a')});db['WhatsappMessage'][_0x1fbe('0x12b')](db[_0x1fbe('0x129')],{'onDelete':_0x1fbe('0x11b'),'as':_0x1fbe('0x181'),'foreignKey':_0x1fbe('0x208')});db[_0x1fbe('0x207')][_0x1fbe('0x12b')](db['WhatsappAccount'],{'as':_0x1fbe('0x179'),'foreignKey':'WhatsappAccountId'});db[_0x1fbe('0x10b')]['belongsTo'](db[_0x1fbe('0x105')],{});db[_0x1fbe('0x10b')]['belongsTo'](db[_0x1fbe('0xfd')],{'as':_0x1fbe('0x174'),'foreignKey':_0x1fbe('0x175')});db[_0x1fbe('0x10b')]['belongsTo'](db[_0x1fbe('0x70')],{'as':_0x1fbe('0x17a'),'foreignKey':_0x1fbe('0x187')});db[_0x1fbe('0x10b')][_0x1fbe('0x12b')](db[_0x1fbe('0x129')],{});db[_0x1fbe('0x10b')][_0x1fbe('0x12b')](db[_0x1fbe('0x10f')],{});db['WhatsappQueueReport'][_0x1fbe('0x12b')](db[_0x1fbe('0x207')],{});db[_0x1fbe('0x10b')]['belongsTo'](db['User'],{});db[_0x1fbe('0x10d')][_0x1fbe('0x12b')](db[_0x1fbe('0x207')],{});db[_0x1fbe('0x10d')]['belongsTo'](db[_0x1fbe('0x129')],{});db['WhatsappTransferReport']['belongsTo'](db[_0x1fbe('0x105')],{'foreignKey':'FromWhatsappAccountId','as':_0x1fbe('0x1ed')});db[_0x1fbe('0x10d')][_0x1fbe('0x12b')](db[_0x1fbe('0x105')],{'foreignKey':_0x1fbe('0x209'),'as':_0x1fbe('0x1f3')});db[_0x1fbe('0x10d')][_0x1fbe('0x12b')](db[_0x1fbe('0x10f')],{'foreignKey':_0x1fbe('0x20a'),'as':_0x1fbe('0x1f2')});db[_0x1fbe('0x10d')][_0x1fbe('0x12b')](db['User'],{'foreignKey':'FromUserId','as':_0x1fbe('0x1f7')});db['WhatsappTransferReport']['belongsTo'](db[_0x1fbe('0x11')],{'foreignKey':_0x1fbe('0x1ef'),'as':_0x1fbe('0x1f0')});db[_0x1fbe('0x10f')][_0x1fbe('0x12d')](db[_0x1fbe('0x11')],{'as':_0x1fbe('0x160'),'through':_0x1fbe('0x36'),'foreignKey':'WhatsappQueueId'});db[_0x1fbe('0x10f')][_0x1fbe('0x12d')](db[_0x1fbe('0x134')],{'through':'team_has_whatsapp_queues','as':'Teams'});db['UserSetting'][_0x1fbe('0x12b')](db[_0x1fbe('0x11')],{'as':_0x1fbe('0x20b'),'foreignKey':_0x1fbe('0x11c'),'onDelete':'cascade','hooks':!![]});db[_0x1fbe('0x16b')][_0x1fbe('0x11a')](db['Dynamics365Account'],{'as':'Dynamics365Account','onDelete':_0x1fbe('0x16e')});db[_0x1fbe('0x16b')][_0x1fbe('0x11a')](db[_0x1fbe('0x16a')],{'as':'Imap','onDelete':_0x1fbe('0x16e')});db[_0x1fbe('0x16b')]['hasOne'](db[_0x1fbe('0x37')],{'as':_0x1fbe('0x20c'),'onDelete':_0x1fbe('0x16e')});module[_0x1fbe('0x20d')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xb229=['Groups','chat_group_has_users','CmContact','cm_user_has_contacts','Lists','cm_user_has_lists','belongsToMany','Team','user_has_teams','ChatInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_whatsapp_interactions','VoiceQueue','VoiceQueues','VoicePrefixes','MailQueues','ChatQueues','FaxQueues','WhatsappQueues','UserWhatsappQueue','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccount','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','CmHopper','VoiceQueueId','CmHopperBlack','TrunkId','TrunkBackup','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','Contact','ContactId','restrict','MailAccountId','CloudProviderId','Imap','Smtp','Dispositions','Answers','Interactions','MailApplication','List','ListId','team_has_mail_queues','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','user_has_mail_interactions','MailInteractionId','Attachments','Interaction','Account','ChatWebsiteId','ChatOfflineMessageId','TagId','MailQueueReport','Dashboard','DashboardItem','Items','CannedAnswer','FaxAccountId','FaxApplication','Exntensions','fax_interaction_has_tags','FaxInteractionId','team_has_fax_queues','SmsAccountId','SmsMessage','SmsApplication','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','user_has_openchannel_interactions','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','AttachmentId','team_has_chat_queues','ChatGroupId','Contacts','CompanyId','CmContactHasItem','Phones','Hoppers','JscriptySessionReport','JscriptySessions','MailInteractions','Company','cm_contact_has_tags','CmHopperAdditionalPhone','CmHopperId','OwnerId','Automation','All','OneAll','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','MailApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','AnyConditions','AnyCondition','TriggerAnyId','Fields','MetricId','Configurations','AccountId','Descriptions','FieldId','SubjectId','Description','DescriptionId','Field','VariableId','SugarcrmConfiguration','Subject','DeskConfiguration','int_desk_configuration_has_tags','ZohoField','Subjects','ZendeskConfiguration','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','FreshsalesAccount','FreshsalesField','FromId','ToId','JscriptyQuestionReport','SessionId','SmsQueueReport','JscriptyProject','ProjectId','team_has_sms_queues','SmsQueues','team_has_openchannel_queues','OpenchannelQueues','team_has_whatsapp_queues','TeamVoicePrefix','CampaignId','HopperBlacks','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToAgent','ToChatWebsiteId','FaxTransferReport','FromFaxAccountId','ToFaxQueueId','FromOpenchannelAccountId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','CustomFields','Queues','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappMessage','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','WhatsappQueueId','user','exports','lodash','jstz','determine','sequelize','defaultsDeep','motion2','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','sequelizeHistory','xcall','utf8_general_ci','database','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','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','SmsQueue','../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','OpenchannelQueueReport','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','../api/automation/automation.model','Disposition','Condition','../api/condition/condition.model','Interval','Pause','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/contactItemType/contactItemType.model','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','../api/squareMessage/squareMessage.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','UserSetting','hasOne','VoiceMail','hasMany','Recordings','VoiceQueuesRt','UserId','Extensions','cascade','HopperFinals','OpenchannelInteractions','SmsInteraction','SmsInteractions','FaxInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','userProfileId'];(function(_0x3f5dca,_0x59472b){var _0x5b833a=function(_0x1cb84b){while(--_0x1cb84b){_0x3f5dca['push'](_0x3f5dca['shift']());}};_0x5b833a(++_0x59472b);}(_0xb229,0xdd));var _0x9b22=function(_0x2aa66d,_0x514ebb){_0x2aa66d=_0x2aa66d-0x0;var _0xc49132=_0xb229[_0x2aa66d];return _0xc49132;};'use strict';var config=require('../config/environment');var Sequelize=require('sequelize');var _=require(_0x9b22('0x0'));var jstz=require(_0x9b22('0x1'));var timezone=jstz[_0x9b22('0x2')]();config[_0x9b22('0x3')]=_[_0x9b22('0x4')](config[_0x9b22('0x3')],{'database':_0x9b22('0x5'),'username':'xcall','password':_0x9b22('0x6'),'options':{'host':_0x9b22('0x7'),'port':0xcea,'dialect':_0x9b22('0x8'),'dialectOptions':{'charset':_0x9b22('0x9')},'logging':![],'timezone':timezone[_0x9b22('0xa')](),'define':{'charset':_0x9b22('0xb'),'collate':'utf8_general_ci'}}});config[_0x9b22('0xc')]=_[_0x9b22('0x4')](config[_0x9b22('0xc')],{'database':_0x9b22('0x5'),'username':_0x9b22('0xd'),'password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x9b22('0x9')},'logging':![],'timezone':timezone[_0x9b22('0xa')](),'define':{'charset':_0x9b22('0xb'),'collate':_0x9b22('0xe')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x9b22('0x3')][_0x9b22('0xf')],config[_0x9b22('0x3')]['username'],config[_0x9b22('0x3')][_0x9b22('0x10')],config[_0x9b22('0x3')][_0x9b22('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x9b22('0xc')][_0x9b22('0xf')],config[_0x9b22('0xc')]['username'],config['sequelizeHistory'][_0x9b22('0x10')],config[_0x9b22('0xc')][_0x9b22('0x11')])};db[_0x9b22('0x12')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x14'));db[_0x9b22('0x15')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x16'));db[_0x9b22('0x17')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x18'));db[_0x9b22('0x19')]=db['sequelize'][_0x9b22('0x13')](_0x9b22('0x1a'));db[_0x9b22('0x1b')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x1c'));db['VoiceQueue']=db[_0x9b22('0x3')][_0x9b22('0x13')]('../api/voiceQueue/voiceQueue.model');db[_0x9b22('0x1d')]=db['sequelize'][_0x9b22('0x13')](_0x9b22('0x1e'));db[_0x9b22('0x1f')]=db['sequelize'][_0x9b22('0x13')](_0x9b22('0x20'));db['VoiceMail']=db[_0x9b22('0x3')]['import'](_0x9b22('0x21'));db[_0x9b22('0x22')]=db['sequelize'][_0x9b22('0x13')](_0x9b22('0x23'));db[_0x9b22('0x24')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x25'));db[_0x9b22('0x26')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x27'));db['VoiceAgentReport']=db[_0x9b22('0x3')][_0x9b22('0x13')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0x9b22('0x28')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x29'));db[_0x9b22('0x2a')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x2b'));db[_0x9b22('0x2c')]=db['sequelize'][_0x9b22('0x13')]('../api/trunk/trunk.model');db['VoiceTransferReport']=db[_0x9b22('0x3')]['import']('../api/voiceTransferReport/voiceTransferReport.model');db[_0x9b22('0x2d')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x2e'));db[_0x9b22('0x2f')]=db[_0x9b22('0x3')]['import'](_0x9b22('0x30'));db[_0x9b22('0x31')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x32'));db[_0x9b22('0x33')]=db[_0x9b22('0x3')]['import'](_0x9b22('0x34'));db[_0x9b22('0x35')]=db[_0x9b22('0x3')]['import'](_0x9b22('0x36'));db[_0x9b22('0x37')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x38'));db[_0x9b22('0x39')]=db['sequelize'][_0x9b22('0x13')](_0x9b22('0x3a'));db['UserWhatsappQueue']=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x3b'));db[_0x9b22('0x3c')]=db['sequelize']['import'](_0x9b22('0x3d'));db[_0x9b22('0x3e')]=db[_0x9b22('0x3')][_0x9b22('0x13')]('../api/mailServerOut/mailServerOut.model');db[_0x9b22('0x3f')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x40'));db[_0x9b22('0x41')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x42'));db['MailSubstatus']=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x43'));db[_0x9b22('0x44')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x45'));db[_0x9b22('0x46')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x47'));db['MailApplication']=db[_0x9b22('0x3')][_0x9b22('0x13')]('../api/mailApplication/mailApplication.model');db['MailQueueReport']=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x48'));db['Dashboard']=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x49'));db['DashboardItem']=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x4a'));db[_0x9b22('0x4b')]=db[_0x9b22('0x3')]['import']('../api/faxAccount/faxAccount.model');db['FaxApplication']=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x4c'));db[_0x9b22('0x4d')]=db[_0x9b22('0x3')]['import'](_0x9b22('0x4e'));db[_0x9b22('0x4f')]=db[_0x9b22('0x3')]['import'](_0x9b22('0x50'));db[_0x9b22('0x51')]=db[_0x9b22('0x3')][_0x9b22('0x13')]('../api/faxQueue/faxQueue.model');db[_0x9b22('0x52')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x53'));db[_0x9b22('0x54')]=db[_0x9b22('0x3')]['import']('../api/smsAccount/smsAccount.model');db['SmsApplication']=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x55'));db['SmsInteraction']=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x56'));db['SmsMessage']=db[_0x9b22('0x3')]['import']('../api/smsMessage/smsMessage.model');db[_0x9b22('0x57')]=db[_0x9b22('0x3')][_0x9b22('0x13')]('../api/smsQueue/smsQueue.model');db['OpenchannelAccount']=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x58'));db[_0x9b22('0x59')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x5a'));db[_0x9b22('0x5b')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x5c'));db[_0x9b22('0x5d')]=db['sequelize'][_0x9b22('0x13')](_0x9b22('0x5e'));db[_0x9b22('0x5f')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x60'));db[_0x9b22('0x61')]=db[_0x9b22('0x3')][_0x9b22('0x13')]('../api/chatWebsite/chatWebsite.model');db[_0x9b22('0x62')]=db['sequelize'][_0x9b22('0x13')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x9b22('0x63')]=db[_0x9b22('0x3')][_0x9b22('0x13')]('../api/chatApplication/chatApplication.model');db[_0x9b22('0x64')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x65'));db[_0x9b22('0x66')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x67'));db[_0x9b22('0x68')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x69'));db[_0x9b22('0x6a')]=db[_0x9b22('0x3')]['import'](_0x9b22('0x6b'));db[_0x9b22('0x6c')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x6d'));db[_0x9b22('0x6e')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x6f'));db[_0x9b22('0x70')]=db['sequelize'][_0x9b22('0x13')](_0x9b22('0x71'));db['CmContact']=db['sequelize'][_0x9b22('0x13')]('../api/cmContact/cmContact.model');db['CmHopper']=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x72'));db['CmHopperBlack']=db['sequelize'][_0x9b22('0x13')](_0x9b22('0x73'));db[_0x9b22('0x74')]=db['sequelize'][_0x9b22('0x13')](_0x9b22('0x75'));db[_0x9b22('0x76')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x77'));db[_0x9b22('0x78')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x79'));db['CmCustomField']=db['sequelize'][_0x9b22('0x13')](_0x9b22('0x7a'));db[_0x9b22('0x7b')]=db[_0x9b22('0x3')][_0x9b22('0x13')]('../api/action/action.model');db['Automation']=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x7c'));db['CannedAnswer']=db[_0x9b22('0x3')][_0x9b22('0x13')]('../api/cannedAnswer/cannedAnswer.model');db[_0x9b22('0x7d')]=db[_0x9b22('0x3')][_0x9b22('0x13')]('../api/disposition/disposition.model');db[_0x9b22('0x7e')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x7f'));db[_0x9b22('0x80')]=db['sequelize'][_0x9b22('0x13')]('../api/interval/interval.model');db[_0x9b22('0x81')]=db['sequelize']['import']('../api/pause/pause.model');db['Cdr']=db['sequelize'][_0x9b22('0x13')](_0x9b22('0x82'));db['VoiceQueuesLog']=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x83'));db[_0x9b22('0x84')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x85'));db[_0x9b22('0x86')]=db[_0x9b22('0x3')]['import'](_0x9b22('0x87'));db[_0x9b22('0x88')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x89'));db['ContactItemType']=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x8a'));db['CmContactHasItem']=db[_0x9b22('0x3')]['import']('../api/cmContactHasItem/cmContactHasItem.model');db['CmHopperAdditionalPhone']=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x8b'));db[_0x9b22('0x8c')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x8d'));db[_0x9b22('0x8e')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x8f'));db[_0x9b22('0x90')]=db['sequelize'][_0x9b22('0x13')](_0x9b22('0x91'));db[_0x9b22('0x92')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x93'));db[_0x9b22('0x94')]=db['sequelize']['import'](_0x9b22('0x95'));db[_0x9b22('0x96')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x97'));db[_0x9b22('0x98')]=db['sequelize']['import'](_0x9b22('0x99'));db['AnalyticExtractedReport']=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x9a'));db[_0x9b22('0x9b')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x9c'));db[_0x9b22('0x9d')]=db['sequelize'][_0x9b22('0x13')](_0x9b22('0x9e'));db[_0x9b22('0x9f')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0xa0'));db[_0x9b22('0xa1')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0xa2'));db[_0x9b22('0xa3')]=db[_0x9b22('0x3')]['import'](_0x9b22('0xa4'));db[_0x9b22('0xa5')]=db['sequelize'][_0x9b22('0x13')](_0x9b22('0xa6'));db[_0x9b22('0xa7')]=db['sequelize'][_0x9b22('0x13')](_0x9b22('0xa8'));db['SugarcrmConfiguration']=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0xa9'));db[_0x9b22('0xaa')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0xab'));db[_0x9b22('0xac')]=db[_0x9b22('0x3')][_0x9b22('0x13')]('../api/intDeskAccount/intDeskAccount.model');db['DeskConfiguration']=db['sequelize'][_0x9b22('0x13')](_0x9b22('0xad'));db[_0x9b22('0xae')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0xaf'));db[_0x9b22('0xb0')]=db['sequelize'][_0x9b22('0x13')](_0x9b22('0xb1'));db[_0x9b22('0xb2')]=db[_0x9b22('0x3')][_0x9b22('0x13')]('../api/intZohoConfiguration/intZohoConfiguration.model');db['ZohoField']=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0xb3'));db[_0x9b22('0xb4')]=db[_0x9b22('0x3')][_0x9b22('0x13')]('../api/intZendeskAccount/intZendeskAccount.model');db['ZendeskConfiguration']=db['sequelize']['import'](_0x9b22('0xb5'));db[_0x9b22('0xb6')]=db['sequelize'][_0x9b22('0x13')](_0x9b22('0xb7'));db[_0x9b22('0xb8')]=db[_0x9b22('0x3')][_0x9b22('0x13')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0x9b22('0xb9')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0xba'));db[_0x9b22('0xbb')]=db[_0x9b22('0x3')]['import'](_0x9b22('0xbc'));db[_0x9b22('0xbd')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0xbe'));db[_0x9b22('0xbf')]=db[_0x9b22('0x3')]['import'](_0x9b22('0xc0'));db[_0x9b22('0xc1')]=db[_0x9b22('0x3')][_0x9b22('0x13')]('../api/intVtigerField/intVtigerField.model');db[_0x9b22('0xc2')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0xc3'));db[_0x9b22('0xc4')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0xc5'));db[_0x9b22('0xc6')]=db['sequelize']['import']('../api/intServicenowField/intServicenowField.model');db[_0x9b22('0xc7')]=db['sequelize'][_0x9b22('0x13')](_0x9b22('0xc8'));db[_0x9b22('0xc9')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0xca'));db[_0x9b22('0xcb')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0xcc'));db['FreshsalesAccount']=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0xcd'));db[_0x9b22('0xce')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0xcf'));db['FreshsalesField']=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0xd0'));db['Integration']=db[_0x9b22('0x3')][_0x9b22('0x13')]('../api/integration/integration.model');db['Network']=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0xd1'));db[_0x9b22('0xd2')]=db[_0x9b22('0x3')][_0x9b22('0x13')]('../api/chatQueueReport/chatQueueReport.model');db[_0x9b22('0xd3')]=db[_0x9b22('0x3')]['import'](_0x9b22('0xd4'));db[_0x9b22('0xd5')]=db[_0x9b22('0x3')]['import']('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db['JscriptyQuestionReport']=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0xd6'));db['JscriptySessionReport']=db[_0x9b22('0x3')]['import'](_0x9b22('0xd7'));db['SmsQueueReport']=db[_0x9b22('0x3')]['import'](_0x9b22('0xd8'));db[_0x9b22('0xd9')]=db[_0x9b22('0x3')]['import']('../api/squareReport/squareReport.model');db['SquareDetailsReport']=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0xda'));db['JscriptyProject']=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0xdb'));db[_0x9b22('0xdc')]=db[_0x9b22('0x3')]['import'](_0x9b22('0xdd'));db[_0x9b22('0xde')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0xdf'));db[_0x9b22('0xe0')]=db['sequelize'][_0x9b22('0x13')]('../api/squareProject/squareProject.model');db[_0x9b22('0xe1')]=db[_0x9b22('0x3')][_0x9b22('0x13')]('../api/squareRecording/squareRecording.model');db['SquareMessage']=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0xe2'));db['Team']=db[_0x9b22('0x3')][_0x9b22('0x13')]('../api/team/team.model');db[_0x9b22('0xe3')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0xe4'));db[_0x9b22('0xe5')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0xe6'));db['Migration']=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0xe7'));db[_0x9b22('0xe8')]=db[_0x9b22('0x3')][_0x9b22('0x13')]('../api/attachment/attachment.model');db[_0x9b22('0xe9')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0xea'));db[_0x9b22('0xeb')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0xec'));db[_0x9b22('0xed')]=db[_0x9b22('0x3')]['import'](_0x9b22('0xee'));db['FaxTransferReport']=db[_0x9b22('0x3')]['import'](_0x9b22('0xef'));db[_0x9b22('0xf0')]=db['sequelize'][_0x9b22('0x13')](_0x9b22('0xf1'));db[_0x9b22('0xf2')]=db[_0x9b22('0x3')]['import'](_0x9b22('0xf3'));db[_0x9b22('0xf4')]=db['sequelize'][_0x9b22('0x13')](_0x9b22('0xf5'));db[_0x9b22('0xf6')]=db[_0x9b22('0x3')]['import'](_0x9b22('0xf7'));db[_0x9b22('0xf8')]=db['sequelize'][_0x9b22('0x13')](_0x9b22('0xf9'));db[_0x9b22('0xfa')]=db[_0x9b22('0x3')]['import'](_0x9b22('0xfb'));db[_0x9b22('0xfc')]=db['sequelize']['import'](_0x9b22('0xfd'));db[_0x9b22('0xfe')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0xff'));db[_0x9b22('0x100')]=db[_0x9b22('0x3')]['import'](_0x9b22('0x101'));db[_0x9b22('0x102')]=db['sequelize'][_0x9b22('0x13')](_0x9b22('0x103'));db[_0x9b22('0x104')]=db[_0x9b22('0x3')]['import'](_0x9b22('0x105'));db['WhatsappMessage']=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x106'));db[_0x9b22('0x107')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x108'));db['WhatsappTransferReport']=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x109'));db[_0x9b22('0x10a')]=db[_0x9b22('0x3')][_0x9b22('0x13')](_0x9b22('0x10b'));db[_0x9b22('0x10c')]=db['sequelize'][_0x9b22('0x13')](_0x9b22('0x10d'));db[_0x9b22('0x10e')]=db[_0x9b22('0x3')][_0x9b22('0x13')]('../api/teamVoiceQueue/teamVoiceQueue.model');db['TeamVoicePrefix']=db['sequelize'][_0x9b22('0x13')](_0x9b22('0x10f'));db[_0x9b22('0x110')]=db['sequelize']['import']('../api/userVoicePrefix/userVoicePrefix.model');db[_0x9b22('0x111')]=db[_0x9b22('0x3')]['import']('../api/user-setting/user-setting.model');db[_0x9b22('0x12')][_0x9b22('0x112')](db[_0x9b22('0x113')],{'as':_0x9b22('0x113'),'onDelete':'cascade','foreignKey':'UserId'});db['User']['hasOne'](db['UserSetting'],{'as':'userSetting','onDelete':'cascade','foreignKey':'UserId'});db[_0x9b22('0x12')][_0x9b22('0x114')](db['VoiceRecording'],{'as':_0x9b22('0x115'),'foreignKey':'UserId'});db[_0x9b22('0x12')][_0x9b22('0x114')](db['UserVoiceQueueRt'],{'as':_0x9b22('0x116'),'foreignKey':_0x9b22('0x117')});db['User'][_0x9b22('0x114')](db[_0x9b22('0x19')],{'as':_0x9b22('0x118'),'onDelete':_0x9b22('0x119'),'hooks':!![]});db[_0x9b22('0x12')]['hasMany'](db[_0x9b22('0x74')],{'as':_0x9b22('0x11a'),'foreignKey':'UserId'});db[_0x9b22('0x12')]['hasMany'](db[_0x9b22('0x76')],{'as':'HopperHistory','foreignKey':_0x9b22('0x117')});db[_0x9b22('0x12')]['hasMany'](db['ReportAgentPreview'],{'as':_0x9b22('0x78'),'foreignKey':'UserId'});db['User'][_0x9b22('0x114')](db[_0x9b22('0x5b')],{'as':_0x9b22('0x11b'),'foreignKey':_0x9b22('0x117')});db[_0x9b22('0x12')][_0x9b22('0x114')](db[_0x9b22('0x64')],{'as':'ChatInteractions','foreignKey':_0x9b22('0x117')});db[_0x9b22('0x12')]['hasMany'](db[_0x9b22('0x11c')],{'as':_0x9b22('0x11d'),'foreignKey':_0x9b22('0x117')});db[_0x9b22('0x12')][_0x9b22('0x114')](db[_0x9b22('0x4d')],{'as':_0x9b22('0x11e'),'foreignKey':'UserId'});db['User'][_0x9b22('0x114')](db[_0x9b22('0x44')],{'as':'MailInteractions','foreignKey':_0x9b22('0x117')});db['User'][_0x9b22('0x114')](db[_0x9b22('0x104')],{'as':_0x9b22('0x11f'),'foreignKey':'UserId'});db['User'][_0x9b22('0x114')](db[_0x9b22('0xfe')],{'as':_0x9b22('0x120'),'foreignKey':_0x9b22('0x121')});db[_0x9b22('0x12')][_0x9b22('0x122')](db[_0x9b22('0xf8')],{'as':_0x9b22('0xf8'),'foreignKey':_0x9b22('0x123')});db[_0x9b22('0x12')]['belongsToMany'](db[_0x9b22('0x6c')],{'as':_0x9b22('0x124'),'through':_0x9b22('0x125')});db[_0x9b22('0x12')]['belongsToMany'](db[_0x9b22('0x126')],{'as':'Contacts','through':_0x9b22('0x127')});db['User']['belongsToMany'](db[_0x9b22('0xf4')],{'as':_0x9b22('0x128'),'through':_0x9b22('0x129')});db[_0x9b22('0x12')][_0x9b22('0x12a')](db[_0x9b22('0x12b')],{'through':_0x9b22('0x12c')});db[_0x9b22('0x12')][_0x9b22('0x12a')](db['MailInteraction'],{'as':'MailInteractions','through':'user_has_mail_interactions'});db[_0x9b22('0x12')][_0x9b22('0x12a')](db[_0x9b22('0x64')],{'as':_0x9b22('0x12d'),'through':'user_has_chat_interactions'});db[_0x9b22('0x12')][_0x9b22('0x12a')](db[_0x9b22('0x4d')],{'as':_0x9b22('0x11e'),'through':_0x9b22('0x12e')});db['User'][_0x9b22('0x12a')](db['SmsInteraction'],{'as':_0x9b22('0x11d'),'through':_0x9b22('0x12f')});db[_0x9b22('0x12')][_0x9b22('0x12a')](db[_0x9b22('0x5b')],{'as':_0x9b22('0x11b'),'through':'user_has_openchannel_interactions'});db[_0x9b22('0x12')][_0x9b22('0x12a')](db[_0x9b22('0x104')],{'as':_0x9b22('0x11f'),'through':_0x9b22('0x130')});db[_0x9b22('0x12')]['belongsToMany'](db[_0x9b22('0x131')],{'as':_0x9b22('0x132'),'through':'UserVoiceQueue','required':![]});db[_0x9b22('0x12')]['belongsToMany'](db[_0x9b22('0xf6')],{'as':_0x9b22('0x133'),'through':_0x9b22('0x110'),'required':![]});db[_0x9b22('0x12')][_0x9b22('0x12a')](db[_0x9b22('0x41')],{'as':_0x9b22('0x134'),'through':_0x9b22('0x33'),'required':![]});db[_0x9b22('0x12')][_0x9b22('0x12a')](db[_0x9b22('0x6a')],{'as':_0x9b22('0x135'),'through':_0x9b22('0x31'),'required':![],'hooks':!![]});db[_0x9b22('0x12')]['belongsToMany'](db[_0x9b22('0x51')],{'as':_0x9b22('0x136'),'through':_0x9b22('0x35'),'required':![]});db['User']['belongsToMany'](db[_0x9b22('0x57')],{'as':'SmsQueues','through':'UserSmsQueue','required':![]});db['User'][_0x9b22('0x12a')](db[_0x9b22('0x5f')],{'as':'OpenchannelQueues','through':'UserOpenchannelQueue','required':![]});db[_0x9b22('0x12')]['belongsToMany'](db[_0x9b22('0x10a')],{'as':_0x9b22('0x137'),'through':_0x9b22('0x138'),'required':![]});db['User'][_0x9b22('0x12a')](db['CmList'],{'through':'cm_user_has_lists'});db[_0x9b22('0x12')][_0x9b22('0x12a')](db[_0x9b22('0x61')],{'as':'ChatWebsites','through':_0x9b22('0x139')});db[_0x9b22('0x12')]['belongsToMany'](db[_0x9b22('0x4b')],{'as':_0x9b22('0x13a'),'through':_0x9b22('0x13b')});db['User'][_0x9b22('0x12a')](db['MailAccount'],{'as':_0x9b22('0x13c'),'through':_0x9b22('0x13d')});db[_0x9b22('0x12')]['belongsToMany'](db[_0x9b22('0x13e')],{'as':_0x9b22('0x13f'),'through':_0x9b22('0x140')});db['User'][_0x9b22('0x12a')](db[_0x9b22('0x54')],{'as':_0x9b22('0x141'),'through':_0x9b22('0x142')});db[_0x9b22('0x12')][_0x9b22('0x12a')](db[_0x9b22('0x100')],{'as':_0x9b22('0x143'),'through':_0x9b22('0x144')});db[_0x9b22('0x15')]['hasMany'](db[_0x9b22('0x19')],{'as':_0x9b22('0x145'),'onDelete':_0x9b22('0x119'),'foreignKey':_0x9b22('0x146')});db[_0x9b22('0x17')][_0x9b22('0x114')](db['VoiceExtension'],{'onDelete':'cascade'});db[_0x9b22('0x19')][_0x9b22('0x114')](db['VoiceExtension'],{'as':_0x9b22('0x147'),'onDelete':_0x9b22('0x119')});db['VoiceMusicOnHold']['belongsToMany'](db['Sound'],{'as':_0x9b22('0x148'),'through':_0x9b22('0x149')});db[_0x9b22('0x131')][_0x9b22('0x114')](db[_0x9b22('0x2d')],{'as':_0x9b22('0x14a'),'foreignKey':'VoiceQueueId'});db[_0x9b22('0x131')][_0x9b22('0x114')](db[_0x9b22('0x14b')],{'as':'Hoppers','foreignKey':_0x9b22('0x14c')});db[_0x9b22('0x131')][_0x9b22('0x114')](db[_0x9b22('0x74')],{'as':'HopperFinals','foreignKey':_0x9b22('0x14c')});db[_0x9b22('0x131')][_0x9b22('0x114')](db[_0x9b22('0x76')],{'as':'HopperHistories','foreignKey':_0x9b22('0x14c')});db[_0x9b22('0x131')][_0x9b22('0x114')](db[_0x9b22('0x78')],{'as':_0x9b22('0x78'),'foreignKey':_0x9b22('0x14c')});db['VoiceQueue'][_0x9b22('0x114')](db[_0x9b22('0x14d')],{'as':'HopperBlacks','foreignKey':_0x9b22('0x14c')});db[_0x9b22('0x131')][_0x9b22('0x114')](db['JscriptySessionReport'],{'as':'JscriptySessions','foreignKey':_0x9b22('0x14c')});db[_0x9b22('0x131')][_0x9b22('0x122')](db[_0x9b22('0x2c')],{'as':'Trunk','foreignKey':_0x9b22('0x14e')});db[_0x9b22('0x131')]['belongsTo'](db[_0x9b22('0x2c')],{'as':_0x9b22('0x14f'),'foreignKey':'TrunkBackupId'});db['VoiceQueue']['belongsTo'](db[_0x9b22('0x80')],{'as':_0x9b22('0x80'),'foreignKey':_0x9b22('0x150')});db['VoiceQueue'][_0x9b22('0x122')](db['Pause'],{'as':_0x9b22('0x151'),'foreignKey':_0x9b22('0x152')});db['VoiceQueue'][_0x9b22('0x12a')](db[_0x9b22('0xf4')],{'as':'Lists','through':_0x9b22('0x153')});db[_0x9b22('0x131')][_0x9b22('0x12a')](db['User'],{'as':_0x9b22('0x154'),'through':'UserVoiceQueue'});db[_0x9b22('0x131')][_0x9b22('0x12a')](db[_0x9b22('0x12b')],{'as':_0x9b22('0x155'),'through':_0x9b22('0x10e')});db['VoiceQueue'][_0x9b22('0x12a')](db[_0x9b22('0xf4')],{'as':_0x9b22('0x156'),'through':_0x9b22('0x157')});db[_0x9b22('0x1d')][_0x9b22('0x122')](db['User'],{'as':_0x9b22('0x12'),'foreignKey':'UserId'});db['ScreenRecording'][_0x9b22('0x122')](db[_0x9b22('0x12')],{'as':'User','foreignKey':'UserId'});db[_0x9b22('0x113')][_0x9b22('0x114')](db[_0x9b22('0x22')],{'as':_0x9b22('0x158'),'onDelete':_0x9b22('0x119'),'foreignKey':_0x9b22('0x159'),'sourceKey':'mailbox'});db[_0x9b22('0x22')][_0x9b22('0x122')](db['VoiceMail'],{'foreignKey':_0x9b22('0x159'),'targetKey':_0x9b22('0x15a')});db[_0x9b22('0x24')][_0x9b22('0x114')](db['VoiceQueueReport'],{'as':_0x9b22('0x15b'),'foreignKey':_0x9b22('0x15c'),'constraints':![]});db['VoiceCallReport'][_0x9b22('0x114')](db['VoiceAgentReport'],{'as':'AgentReports','foreignKey':_0x9b22('0x15c'),'constraints':![]});db[_0x9b22('0x24')]['belongsTo'](db[_0x9b22('0x12')],{'as':_0x9b22('0x12'),'foreignKey':_0x9b22('0x117')});db[_0x9b22('0x24')][_0x9b22('0x122')](db['CmContact'],{'as':_0x9b22('0x15d'),'foreignKey':_0x9b22('0x15e')});db[_0x9b22('0x3c')][_0x9b22('0x122')](db['MailAccount'],{'as':_0x9b22('0x3f'),'foreignKey':'MailAccountId'});db[_0x9b22('0x3c')]['belongsTo'](db[_0x9b22('0x10c')],{'as':'CloudProvider','foreignKey':'CloudProviderId','onDelete':_0x9b22('0x15f')});db[_0x9b22('0x3e')][_0x9b22('0x122')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0x9b22('0x160')});db[_0x9b22('0x3e')][_0x9b22('0x122')](db[_0x9b22('0x10c')],{'as':_0x9b22('0x10c'),'foreignKey':_0x9b22('0x161'),'onDelete':_0x9b22('0x15f')});db[_0x9b22('0x3f')][_0x9b22('0x112')](db[_0x9b22('0x3c')],{'as':_0x9b22('0x162'),'onDelete':_0x9b22('0x119')});db[_0x9b22('0x3f')][_0x9b22('0x112')](db[_0x9b22('0x3e')],{'as':_0x9b22('0x163'),'onDelete':'cascade'});db['MailAccount']['hasMany'](db[_0x9b22('0x7d')],{'as':_0x9b22('0x164'),'foreignKey':'MailAccountId','onDelete':_0x9b22('0x119')});db[_0x9b22('0x3f')][_0x9b22('0x114')](db['CannedAnswer'],{'as':_0x9b22('0x165'),'foreignKey':_0x9b22('0x160')});db[_0x9b22('0x3f')]['hasMany'](db[_0x9b22('0x46')],{'as':_0x9b22('0x158'),'foreignKey':'MailAccountId'});db['MailAccount'][_0x9b22('0x114')](db[_0x9b22('0x44')],{'as':_0x9b22('0x166')});db[_0x9b22('0x3f')][_0x9b22('0x114')](db[_0x9b22('0x167')],{'as':_0x9b22('0x147')});db['MailAccount'][_0x9b22('0x122')](db[_0x9b22('0xf4')],{'as':_0x9b22('0x168'),'foreignKey':_0x9b22('0x169')});db['MailAccount']['belongsTo'](db[_0x9b22('0x8c')],{'as':_0x9b22('0x8c'),'foreignKey':'TemplateId'});db[_0x9b22('0x3f')]['belongsTo'](db[_0x9b22('0x81')],{'as':_0x9b22('0x151'),'foreignKey':_0x9b22('0x152')});db[_0x9b22('0x3f')][_0x9b22('0x12a')](db['User'],{'as':_0x9b22('0x154'),'through':_0x9b22('0x13d')});db[_0x9b22('0x41')][_0x9b22('0x12a')](db[_0x9b22('0x12')],{'as':_0x9b22('0x154'),'through':_0x9b22('0x33')});db['MailQueue']['belongsToMany'](db[_0x9b22('0x12b')],{'through':_0x9b22('0x16a'),'as':_0x9b22('0x155')});db[_0x9b22('0x44')]['hasMany'](db[_0x9b22('0x46')],{'as':_0x9b22('0x158'),'onDelete':_0x9b22('0x119'),'foreignKey':'MailInteractionId'});db['MailInteraction'][_0x9b22('0x122')](db[_0x9b22('0x3f')],{'as':'Account','foreignKey':'MailAccountId'});db[_0x9b22('0x44')][_0x9b22('0x122')](db[_0x9b22('0x126')],{'as':_0x9b22('0x15d'),'foreignKey':_0x9b22('0x15e')});db[_0x9b22('0x44')][_0x9b22('0x122')](db[_0x9b22('0x12')],{'as':_0x9b22('0x16b'),'foreignKey':_0x9b22('0x117')});db[_0x9b22('0x44')][_0x9b22('0x12a')](db['Tag'],{'through':_0x9b22('0x16c'),'as':_0x9b22('0x16d')});db['MailInteraction']['belongsToMany'](db[_0x9b22('0x88')],{'through':_0x9b22('0x16c'),'as':_0x9b22('0x16e')});db[_0x9b22('0x44')][_0x9b22('0x12a')](db[_0x9b22('0x12')],{'as':_0x9b22('0x16f'),'through':_0x9b22('0x170'),'foreignKey':_0x9b22('0x171')});db[_0x9b22('0x46')]['hasMany'](db[_0x9b22('0xe8')],{'as':_0x9b22('0x172'),'onDelete':_0x9b22('0x119')});db[_0x9b22('0x46')][_0x9b22('0x122')](db[_0x9b22('0x12')],{'as':_0x9b22('0x12')});db['MailMessage'][_0x9b22('0x122')](db[_0x9b22('0x126')],{'onDelete':'cascade','as':_0x9b22('0x15d')});db['MailMessage'][_0x9b22('0x122')](db[_0x9b22('0x44')],{'as':_0x9b22('0x173'),'foreignKey':_0x9b22('0x171')});db[_0x9b22('0x46')]['belongsTo'](db['MailAccount'],{'as':_0x9b22('0x174'),'foreignKey':_0x9b22('0x160')});db[_0x9b22('0x46')][_0x9b22('0x122')](db[_0x9b22('0x61')],{'as':_0x9b22('0x61'),'foreignKey':_0x9b22('0x175')});db[_0x9b22('0x46')]['belongsTo'](db[_0x9b22('0x68')],{'as':_0x9b22('0x68'),'foreignKey':_0x9b22('0x176')});db[_0x9b22('0x167')][_0x9b22('0x122')](db[_0x9b22('0x12')],{'onDelete':_0x9b22('0x15f')});db[_0x9b22('0x167')][_0x9b22('0x122')](db[_0x9b22('0x41')],{'onDelete':_0x9b22('0x15f')});db['MailApplication'][_0x9b22('0x122')](db[_0x9b22('0x3f')],{'onDelete':_0x9b22('0x15f')});db['MailApplication'][_0x9b22('0x122')](db[_0x9b22('0x80')],{'onDelete':_0x9b22('0x15f'),'foreignKey':'IntervalId'});db[_0x9b22('0x167')][_0x9b22('0x122')](db['Tag'],{'onDelete':_0x9b22('0x15f'),'foreignKey':_0x9b22('0x177')});db[_0x9b22('0x178')][_0x9b22('0x122')](db[_0x9b22('0x3f')],{});db[_0x9b22('0x178')]['belongsTo'](db[_0x9b22('0xf4')],{'as':'List','foreignKey':_0x9b22('0x169')});db[_0x9b22('0x178')][_0x9b22('0x122')](db[_0x9b22('0x126')],{'as':_0x9b22('0x15d'),'foreignKey':_0x9b22('0x15e')});db['MailQueueReport']['belongsTo'](db[_0x9b22('0x44')],{});db['MailQueueReport'][_0x9b22('0x122')](db[_0x9b22('0x46')],{});db['MailQueueReport']['belongsTo'](db['User'],{});db['MailQueueReport'][_0x9b22('0x122')](db['MailQueue'],{});db[_0x9b22('0x179')][_0x9b22('0x114')](db[_0x9b22('0x17a')],{'as':_0x9b22('0x17b'),'onDelete':_0x9b22('0x119')});db['FaxAccount'][_0x9b22('0x114')](db['Disposition'],{'as':'Dispositions','foreignKey':'FaxAccountId','onDelete':_0x9b22('0x119')});db[_0x9b22('0x4b')][_0x9b22('0x114')](db[_0x9b22('0x17c')],{'as':_0x9b22('0x165'),'foreignKey':_0x9b22('0x17d')});db[_0x9b22('0x4b')][_0x9b22('0x114')](db[_0x9b22('0x4d')],{'as':_0x9b22('0x166')});db[_0x9b22('0x4b')]['hasMany'](db[_0x9b22('0x17e')],{'as':_0x9b22('0x147')});db[_0x9b22('0x4b')][_0x9b22('0x114')](db['VoiceExtension'],{'as':_0x9b22('0x17f'),'onDelete':_0x9b22('0x119')});db['FaxAccount'][_0x9b22('0x114')](db[_0x9b22('0x4f')],{'as':_0x9b22('0x158')});db[_0x9b22('0x4b')][_0x9b22('0x122')](db[_0x9b22('0x2c')],{'as':_0x9b22('0x2c')});db[_0x9b22('0x4b')][_0x9b22('0x122')](db[_0x9b22('0xf4')],{'as':_0x9b22('0x168'),'foreignKey':_0x9b22('0x169')});db[_0x9b22('0x4b')][_0x9b22('0x122')](db[_0x9b22('0x81')],{'as':'mandatoryDispositionPause','foreignKey':_0x9b22('0x152')});db[_0x9b22('0x4b')][_0x9b22('0x12a')](db[_0x9b22('0x12')],{'as':_0x9b22('0x154'),'through':'user_has_fax_accounts'});db[_0x9b22('0x17e')]['belongsTo'](db['User'],{'onDelete':_0x9b22('0x15f')});db[_0x9b22('0x17e')]['belongsTo'](db['FaxQueue'],{'onDelete':_0x9b22('0x15f')});db[_0x9b22('0x17e')][_0x9b22('0x122')](db[_0x9b22('0x4b')],{'onDelete':_0x9b22('0x15f')});db['FaxApplication'][_0x9b22('0x122')](db[_0x9b22('0x88')],{'onDelete':_0x9b22('0x15f'),'foreignKey':_0x9b22('0x177')});db['FaxInteraction'][_0x9b22('0x114')](db[_0x9b22('0x4f')],{'as':_0x9b22('0x158'),'onDelete':'cascade','foreignKey':'FaxInteractionId'});db[_0x9b22('0x4d')][_0x9b22('0x122')](db[_0x9b22('0x4b')],{'as':'Account','foreignKey':'FaxAccountId'});db[_0x9b22('0x4d')][_0x9b22('0x122')](db['CmContact'],{'as':_0x9b22('0x15d'),'foreignKey':_0x9b22('0x15e')});db['FaxInteraction'][_0x9b22('0x122')](db[_0x9b22('0x12')],{'as':_0x9b22('0x16b'),'foreignKey':'UserId'});db[_0x9b22('0x4d')]['belongsToMany'](db['Tag'],{'through':_0x9b22('0x180'),'as':_0x9b22('0x16d')});db['FaxInteraction'][_0x9b22('0x12a')](db[_0x9b22('0x88')],{'through':_0x9b22('0x180'),'as':_0x9b22('0x16e')});db['FaxInteraction'][_0x9b22('0x12a')](db[_0x9b22('0x12')],{'as':_0x9b22('0x16f'),'through':_0x9b22('0x12e'),'foreignKey':'FaxInteractionId'});db[_0x9b22('0x4f')][_0x9b22('0x122')](db[_0x9b22('0x12')],{'onDelete':_0x9b22('0x119'),'as':_0x9b22('0x12')});db[_0x9b22('0x4f')][_0x9b22('0x122')](db[_0x9b22('0x4d')],{'as':'Interaction','foreignKey':_0x9b22('0x181')});db['FaxMessage'][_0x9b22('0x122')](db[_0x9b22('0x126')],{'onDelete':'cascade','as':_0x9b22('0x15d')});db[_0x9b22('0x4f')][_0x9b22('0x122')](db[_0x9b22('0xe8')],{'as':'Attachment','foreignKey':'AttachmentId'});db['FaxMessage'][_0x9b22('0x122')](db[_0x9b22('0x4b')],{'as':_0x9b22('0x174'),'foreignKey':_0x9b22('0x17d')});db[_0x9b22('0x51')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x9b22('0x35')});db[_0x9b22('0x51')][_0x9b22('0x12a')](db[_0x9b22('0x12b')],{'through':_0x9b22('0x182'),'as':_0x9b22('0x155')});db[_0x9b22('0x52')][_0x9b22('0x122')](db[_0x9b22('0x4b')],{});db[_0x9b22('0x52')][_0x9b22('0x122')](db[_0x9b22('0xf4')],{'as':_0x9b22('0x168'),'foreignKey':_0x9b22('0x169')});db[_0x9b22('0x52')][_0x9b22('0x122')](db[_0x9b22('0x126')],{'as':_0x9b22('0x15d'),'foreignKey':'ContactId'});db['FaxQueueReport']['belongsTo'](db[_0x9b22('0x4d')],{});db[_0x9b22('0x52')]['belongsTo'](db[_0x9b22('0x4f')],{});db['FaxQueueReport']['belongsTo'](db[_0x9b22('0x12')],{});db[_0x9b22('0x52')][_0x9b22('0x122')](db[_0x9b22('0x51')],{});db[_0x9b22('0x54')]['hasMany'](db[_0x9b22('0x7d')],{'as':_0x9b22('0x164'),'foreignKey':_0x9b22('0x183'),'onDelete':_0x9b22('0x119')});db[_0x9b22('0x54')][_0x9b22('0x114')](db[_0x9b22('0x17c')],{'as':'Answers','foreignKey':'SmsAccountId'});db[_0x9b22('0x54')][_0x9b22('0x114')](db[_0x9b22('0x184')],{'as':_0x9b22('0x158'),'foreignKey':'SmsAccountId'});db['SmsAccount']['hasMany'](db['SmsInteraction'],{'as':_0x9b22('0x166')});db[_0x9b22('0x54')][_0x9b22('0x114')](db[_0x9b22('0x185')],{'as':'Applications'});db['SmsAccount']['belongsTo'](db[_0x9b22('0xf4')],{'as':_0x9b22('0x168'),'foreignKey':_0x9b22('0x169')});db[_0x9b22('0x54')][_0x9b22('0x122')](db[_0x9b22('0x81')],{'as':_0x9b22('0x151'),'foreignKey':_0x9b22('0x152')});db[_0x9b22('0x54')][_0x9b22('0x12a')](db[_0x9b22('0x12')],{'as':_0x9b22('0x154'),'through':'user_has_sms_accounts'});db['SmsApplication'][_0x9b22('0x122')](db[_0x9b22('0x12')],{'onDelete':_0x9b22('0x15f')});db[_0x9b22('0x185')]['belongsTo'](db[_0x9b22('0x57')],{'onDelete':_0x9b22('0x15f')});db[_0x9b22('0x185')][_0x9b22('0x122')](db[_0x9b22('0x54')],{'onDelete':_0x9b22('0x15f')});db[_0x9b22('0x185')][_0x9b22('0x122')](db[_0x9b22('0x80')],{'onDelete':_0x9b22('0x15f'),'foreignKey':_0x9b22('0x150')});db[_0x9b22('0x185')][_0x9b22('0x122')](db[_0x9b22('0x88')],{'onDelete':_0x9b22('0x15f'),'foreignKey':_0x9b22('0x177')});db[_0x9b22('0x11c')][_0x9b22('0x114')](db[_0x9b22('0x184')],{'as':_0x9b22('0x158'),'onDelete':_0x9b22('0x119'),'foreignKey':_0x9b22('0x186')});db['SmsInteraction'][_0x9b22('0x122')](db[_0x9b22('0x54')],{'as':_0x9b22('0x174'),'foreignKey':_0x9b22('0x183')});db[_0x9b22('0x11c')]['belongsTo'](db[_0x9b22('0x126')],{'as':'Contact','foreignKey':_0x9b22('0x15e')});db[_0x9b22('0x11c')][_0x9b22('0x122')](db[_0x9b22('0x12')],{'as':_0x9b22('0x16b'),'foreignKey':_0x9b22('0x117')});db[_0x9b22('0x11c')][_0x9b22('0x12a')](db[_0x9b22('0x88')],{'through':_0x9b22('0x187'),'as':_0x9b22('0x16d')});db[_0x9b22('0x11c')][_0x9b22('0x12a')](db[_0x9b22('0x88')],{'through':_0x9b22('0x187'),'as':_0x9b22('0x16e')});db[_0x9b22('0x11c')][_0x9b22('0x12a')](db[_0x9b22('0x12')],{'as':'Users','through':_0x9b22('0x12f'),'foreignKey':_0x9b22('0x186')});db[_0x9b22('0x184')][_0x9b22('0x122')](db[_0x9b22('0x12')],{'as':_0x9b22('0x12')});db[_0x9b22('0x184')][_0x9b22('0x122')](db[_0x9b22('0x126')],{'onDelete':_0x9b22('0x119'),'as':_0x9b22('0x15d')});db[_0x9b22('0x184')][_0x9b22('0x122')](db[_0x9b22('0x11c')],{'onDelete':_0x9b22('0x119'),'as':_0x9b22('0x173'),'foreignKey':'SmsInteractionId'});db[_0x9b22('0x184')]['belongsTo'](db['SmsAccount'],{'as':_0x9b22('0x174'),'foreignKey':_0x9b22('0x183')});db[_0x9b22('0x57')][_0x9b22('0x12a')](db['User'],{'as':_0x9b22('0x154'),'through':_0x9b22('0x37'),'foreignKey':_0x9b22('0x188')});db[_0x9b22('0x57')][_0x9b22('0x12a')](db[_0x9b22('0x12b')],{'through':'team_has_sms_queues','as':_0x9b22('0x155')});db['OpenchannelAccount'][_0x9b22('0x114')](db['Disposition'],{'as':_0x9b22('0x164'),'foreignKey':_0x9b22('0x189'),'onDelete':'cascade'});db[_0x9b22('0x13e')][_0x9b22('0x114')](db[_0x9b22('0x17c')],{'as':'Answers','foreignKey':_0x9b22('0x189')});db[_0x9b22('0x13e')]['hasMany'](db[_0x9b22('0x5b')],{'as':_0x9b22('0x166'),'foreignKey':_0x9b22('0x189')});db[_0x9b22('0x13e')][_0x9b22('0x114')](db[_0x9b22('0x5d')],{'as':_0x9b22('0x158'),'foreignKey':_0x9b22('0x189')});db[_0x9b22('0x13e')][_0x9b22('0x114')](db[_0x9b22('0x59')],{'as':_0x9b22('0x147'),'foreignKey':_0x9b22('0x189')});db[_0x9b22('0x13e')]['belongsTo'](db[_0x9b22('0xf4')],{'as':'List','foreignKey':_0x9b22('0x169')});db[_0x9b22('0x13e')][_0x9b22('0x122')](db['Pause'],{'as':_0x9b22('0x151'),'foreignKey':_0x9b22('0x152')});db[_0x9b22('0x13e')][_0x9b22('0x12a')](db['User'],{'as':_0x9b22('0x154'),'through':'user_has_openchannel_accounts'});db['OpenchannelApplication'][_0x9b22('0x122')](db[_0x9b22('0x12')],{'onDelete':'restrict'});db['OpenchannelApplication'][_0x9b22('0x122')](db[_0x9b22('0x5f')],{'onDelete':'restrict','foreignKey':_0x9b22('0x18a')});db[_0x9b22('0x59')][_0x9b22('0x122')](db[_0x9b22('0x13e')],{'onDelete':'restrict','foreignKey':'OpenchannelAccountId'});db[_0x9b22('0x59')][_0x9b22('0x122')](db['Interval'],{'onDelete':_0x9b22('0x15f'),'foreignKey':'IntervalId'});db[_0x9b22('0x59')]['belongsTo'](db['Tag'],{'onDelete':_0x9b22('0x15f'),'foreignKey':_0x9b22('0x177')});db['OpenchannelInteraction'][_0x9b22('0x114')](db['OpenchannelMessage'],{'as':_0x9b22('0x158'),'onDelete':_0x9b22('0x119'),'foreignKey':_0x9b22('0x18b')});db['OpenchannelInteraction'][_0x9b22('0x122')](db[_0x9b22('0x13e')],{'as':_0x9b22('0x174'),'foreignKey':_0x9b22('0x189')});db[_0x9b22('0x5b')]['belongsTo'](db[_0x9b22('0x126')],{'as':_0x9b22('0x15d'),'foreignKey':_0x9b22('0x15e')});db[_0x9b22('0x5b')]['belongsTo'](db['User'],{'as':_0x9b22('0x16b'),'foreignKey':_0x9b22('0x117')});db[_0x9b22('0x5b')]['belongsToMany'](db[_0x9b22('0x88')],{'through':'openchannel_interaction_has_tags','as':'Tags'});db[_0x9b22('0x5b')][_0x9b22('0x12a')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':'ThroughTags'});db['OpenchannelInteraction'][_0x9b22('0x12a')](db[_0x9b22('0x12')],{'as':'Users','through':_0x9b22('0x18c'),'foreignKey':_0x9b22('0x18b')});db[_0x9b22('0x5d')][_0x9b22('0x122')](db[_0x9b22('0x12')],{'onDelete':_0x9b22('0x119'),'as':'User'});db[_0x9b22('0x5d')]['belongsTo'](db['CmContact'],{'onDelete':_0x9b22('0x119'),'as':_0x9b22('0x15d')});db['OpenchannelMessage'][_0x9b22('0x122')](db['OpenchannelInteraction'],{'onDelete':_0x9b22('0x119'),'as':_0x9b22('0x173'),'foreignKey':_0x9b22('0x18b')});db[_0x9b22('0x5d')][_0x9b22('0x122')](db[_0x9b22('0xe8')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x9b22('0x5d')]['belongsTo'](db['OpenchannelAccount'],{'as':_0x9b22('0x174'),'foreignKey':_0x9b22('0x189')});db['OpenchannelQueue'][_0x9b22('0x12a')](db[_0x9b22('0x12')],{'as':_0x9b22('0x154'),'through':'UserOpenchannelQueue','foreignKey':_0x9b22('0x18a')});db[_0x9b22('0x5f')][_0x9b22('0x12a')](db[_0x9b22('0x12b')],{'through':'team_has_openchannel_queues','as':_0x9b22('0x155')});db['ChatWebsite'][_0x9b22('0x114')](db['Disposition'],{'as':_0x9b22('0x164'),'foreignKey':'ChatWebsiteId','onDelete':'cascade'});db[_0x9b22('0x61')][_0x9b22('0x114')](db[_0x9b22('0x17c')],{'as':_0x9b22('0x165'),'foreignKey':_0x9b22('0x175')});db[_0x9b22('0x61')]['hasMany'](db[_0x9b22('0x6e')],{'as':_0x9b22('0x18d')});db[_0x9b22('0x61')]['hasMany'](db[_0x9b22('0x64')],{'as':'Interactions'});db[_0x9b22('0x61')][_0x9b22('0x114')](db[_0x9b22('0x63')],{'as':_0x9b22('0x147')});db[_0x9b22('0x61')][_0x9b22('0x114')](db[_0x9b22('0x66')],{'as':_0x9b22('0x158')});db[_0x9b22('0x61')][_0x9b22('0x122')](db[_0x9b22('0xf4')],{'as':'List','foreignKey':_0x9b22('0x169')});db[_0x9b22('0x61')][_0x9b22('0x122')](db[_0x9b22('0x80')],{'as':_0x9b22('0x80'),'foreignKey':_0x9b22('0x150')});db[_0x9b22('0x61')][_0x9b22('0x122')](db[_0x9b22('0x3f')],{'as':'MailAccount','foreignKey':_0x9b22('0x160')});db[_0x9b22('0x61')][_0x9b22('0x122')](db[_0x9b22('0x81')],{'as':_0x9b22('0x151'),'foreignKey':'mandatoryDispositionPauseId'});db['ChatWebsite'][_0x9b22('0x12a')](db['User'],{'as':_0x9b22('0x154'),'through':'user_has_chat_websites'});db['OpenchannelQueueReport'][_0x9b22('0x122')](db[_0x9b22('0x13e')],{});db[_0x9b22('0x62')][_0x9b22('0x122')](db[_0x9b22('0xf4')],{'as':'List','foreignKey':_0x9b22('0x169')});db[_0x9b22('0x62')][_0x9b22('0x122')](db['CmContact'],{'as':_0x9b22('0x15d'),'foreignKey':'ContactId'});db[_0x9b22('0x62')][_0x9b22('0x122')](db[_0x9b22('0x5b')],{});db['OpenchannelQueueReport'][_0x9b22('0x122')](db[_0x9b22('0x5d')],{});db['OpenchannelQueueReport'][_0x9b22('0x122')](db['User'],{});db[_0x9b22('0x62')]['belongsTo'](db[_0x9b22('0x5f')],{});db[_0x9b22('0x63')]['belongsTo'](db['User'],{'as':_0x9b22('0x18e'),'foreignKey':'UserId','onDelete':_0x9b22('0x15f')});db['ChatApplication'][_0x9b22('0x122')](db['ChatQueue'],{'as':_0x9b22('0x18f'),'foreignKey':_0x9b22('0x190'),'onDelete':_0x9b22('0x15f')});db[_0x9b22('0x63')][_0x9b22('0x122')](db[_0x9b22('0x61')],{'as':_0x9b22('0x191'),'foreignKey':_0x9b22('0x175'),'onDelete':_0x9b22('0x15f')});db[_0x9b22('0x63')][_0x9b22('0x122')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x9b22('0x177')});db['ChatInteraction'][_0x9b22('0x114')](db[_0x9b22('0x66')],{'as':'Messages','onDelete':_0x9b22('0x119'),'foreignKey':_0x9b22('0x192')});db[_0x9b22('0x64')]['belongsTo'](db[_0x9b22('0x61')],{'as':_0x9b22('0x174'),'foreignKey':'ChatWebsiteId'});db[_0x9b22('0x64')]['belongsTo'](db[_0x9b22('0x126')],{'as':_0x9b22('0x15d'),'foreignKey':_0x9b22('0x15e')});db['ChatInteraction'][_0x9b22('0x122')](db[_0x9b22('0x12')],{'as':_0x9b22('0x16b'),'foreignKey':_0x9b22('0x117')});db[_0x9b22('0x64')][_0x9b22('0x12a')](db['Tag'],{'through':_0x9b22('0x193'),'as':_0x9b22('0x16d')});db[_0x9b22('0x64')][_0x9b22('0x12a')](db['Tag'],{'through':'chat_interaction_has_tags','as':_0x9b22('0x16e')});db[_0x9b22('0x64')]['belongsToMany'](db[_0x9b22('0x12')],{'as':_0x9b22('0x16f'),'through':'user_has_chat_interactions','foreignKey':'ChatInteractionId'});db[_0x9b22('0x66')][_0x9b22('0x122')](db[_0x9b22('0x12')],{'onDelete':_0x9b22('0x119'),'as':_0x9b22('0x12')});db[_0x9b22('0x66')]['belongsTo'](db[_0x9b22('0x126')],{'onDelete':_0x9b22('0x119'),'as':_0x9b22('0x15d'),'foreignKey':_0x9b22('0x15e')});db[_0x9b22('0x66')][_0x9b22('0x122')](db[_0x9b22('0x64')],{'onDelete':_0x9b22('0x119'),'as':_0x9b22('0x173'),'foreignKey':_0x9b22('0x192')});db['ChatMessage'][_0x9b22('0x122')](db[_0x9b22('0xe8')],{'as':_0x9b22('0xe8'),'foreignKey':_0x9b22('0x194')});db[_0x9b22('0x66')]['belongsTo'](db[_0x9b22('0x61')],{'as':_0x9b22('0x174'),'foreignKey':'ChatWebsiteId'});db[_0x9b22('0x68')][_0x9b22('0x114')](db[_0x9b22('0xe8')],{'as':'Attachments','foreignKey':_0x9b22('0x176'),'onDelete':_0x9b22('0x119'),'hooks':!![]});db[_0x9b22('0x68')][_0x9b22('0x122')](db[_0x9b22('0x126')],{'onDelete':_0x9b22('0x119'),'as':_0x9b22('0x15d'),'foreignKey':_0x9b22('0x15e')});db[_0x9b22('0x68')]['belongsTo'](db[_0x9b22('0x61')],{'as':'Account','foreignKey':_0x9b22('0x175')});db[_0x9b22('0x6a')]['belongsToMany'](db['User'],{'as':_0x9b22('0x154'),'through':_0x9b22('0x31'),'hooks':!![]});db['ChatQueue']['belongsToMany'](db[_0x9b22('0x12b')],{'through':_0x9b22('0x195'),'as':_0x9b22('0x155')});db[_0x9b22('0x6c')]['hasMany'](db[_0x9b22('0xd3')],{'as':_0x9b22('0x158'),'foreignKey':_0x9b22('0x196'),'onDelete':'cascade'});db[_0x9b22('0x6c')]['belongsToMany'](db[_0x9b22('0x12')],{'as':_0x9b22('0x14a'),'through':_0x9b22('0x125')});db[_0x9b22('0x6e')][_0x9b22('0x122')](db[_0x9b22('0x61')],{'as':'Website','foreignKey':_0x9b22('0x175')});db[_0x9b22('0x70')][_0x9b22('0x114')](db[_0x9b22('0x126')],{'as':_0x9b22('0x197'),'foreignKey':_0x9b22('0x198')});db[_0x9b22('0x126')][_0x9b22('0x114')](db[_0x9b22('0x199')],{'as':_0x9b22('0x19a'),'foreignKey':'CmContactId'});db[_0x9b22('0x126')][_0x9b22('0x114')](db['CmHopper'],{'as':_0x9b22('0x19b'),'foreignKey':_0x9b22('0x15e')});db[_0x9b22('0x126')][_0x9b22('0x114')](db['CmHopperFinal'],{'as':_0x9b22('0x11a'),'foreignKey':'ContactId'});db['CmContact']['hasMany'](db[_0x9b22('0x76')],{'as':'HopperHistories','foreignKey':'ContactId'});db['CmContact'][_0x9b22('0x114')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x9b22('0x15e')});db[_0x9b22('0x126')][_0x9b22('0x114')](db[_0x9b22('0x19c')],{'as':_0x9b22('0x19d'),'foreignKey':_0x9b22('0x15e')});db[_0x9b22('0x126')][_0x9b22('0x114')](db[_0x9b22('0x5b')],{'as':_0x9b22('0x11b'),'foreignKey':_0x9b22('0x15e'),'onDelete':_0x9b22('0x15f')});db[_0x9b22('0x126')][_0x9b22('0x114')](db[_0x9b22('0x64')],{'as':_0x9b22('0x12d'),'foreignKey':'ContactId','onDelete':_0x9b22('0x15f')});db[_0x9b22('0x126')]['hasMany'](db[_0x9b22('0x11c')],{'as':_0x9b22('0x11d'),'foreignKey':_0x9b22('0x15e'),'onDelete':_0x9b22('0x15f')});db[_0x9b22('0x126')][_0x9b22('0x114')](db['FaxInteraction'],{'as':_0x9b22('0x11e'),'foreignKey':_0x9b22('0x15e'),'onDelete':_0x9b22('0x15f')});db['CmContact']['hasMany'](db[_0x9b22('0x44')],{'as':_0x9b22('0x19e'),'foreignKey':_0x9b22('0x15e'),'onDelete':_0x9b22('0x15f')});db[_0x9b22('0x126')][_0x9b22('0x122')](db[_0x9b22('0x70')],{'as':_0x9b22('0x19f'),'foreignKey':_0x9b22('0x198')});db[_0x9b22('0x126')][_0x9b22('0x122')](db[_0x9b22('0xf4')],{'as':'List','foreignKey':_0x9b22('0x169'),'onDelete':_0x9b22('0x119')});db['CmContact']['belongsToMany'](db[_0x9b22('0x12')],{'as':'Users','through':'cm_user_has_contacts'});db[_0x9b22('0x126')][_0x9b22('0x12a')](db[_0x9b22('0x88')],{'as':'Tags','through':_0x9b22('0x1a0')});db[_0x9b22('0x126')][_0x9b22('0x12a')](db[_0x9b22('0x88')],{'through':_0x9b22('0x1a0'),'as':'ThroughTags'});db[_0x9b22('0x14b')]['hasMany'](db[_0x9b22('0x1a1')],{'as':'AdditionalPhones','foreignKey':_0x9b22('0x1a2')});db[_0x9b22('0x14b')][_0x9b22('0x122')](db[_0x9b22('0x126')],{'as':_0x9b22('0x15d'),'foreignKey':'ContactId','onDelete':_0x9b22('0x119')});db[_0x9b22('0x14b')][_0x9b22('0x122')](db['CmList'],{'as':_0x9b22('0x168'),'foreignKey':_0x9b22('0x169'),'onDelete':_0x9b22('0x119')});db['CmHopper'][_0x9b22('0x122')](db['User'],{'as':'Agent','foreignKey':_0x9b22('0x117')});db[_0x9b22('0x14b')][_0x9b22('0x122')](db[_0x9b22('0x131')],{'as':_0x9b22('0x18f'),'foreignKey':_0x9b22('0x14c'),'onDelete':_0x9b22('0x119')});db[_0x9b22('0x14b')][_0x9b22('0x122')](db['Campaign'],{'as':_0x9b22('0xe5'),'foreignKey':'CampaignId','onDelete':'cascade'});db[_0x9b22('0x14b')][_0x9b22('0x122')](db[_0x9b22('0x12')],{'as':'Owner','foreignKey':_0x9b22('0x1a3')});db[_0x9b22('0x14d')][_0x9b22('0x122')](db['CmContact'],{'as':_0x9b22('0x15d'),'foreignKey':'ContactId','onDelete':_0x9b22('0x119')});db[_0x9b22('0x14d')][_0x9b22('0x122')](db[_0x9b22('0xf4')],{'as':_0x9b22('0x168'),'foreignKey':_0x9b22('0x169'),'onDelete':'cascade'});db[_0x9b22('0x14d')][_0x9b22('0x122')](db[_0x9b22('0x131')],{'as':_0x9b22('0x18f'),'foreignKey':_0x9b22('0x14c'),'onDelete':_0x9b22('0x119')});db[_0x9b22('0x14d')][_0x9b22('0x122')](db[_0x9b22('0xe5')],{'as':_0x9b22('0xe5'),'foreignKey':'CampaignId','onDelete':_0x9b22('0x119')});db[_0x9b22('0x1a4')][_0x9b22('0x114')](db['Condition'],{'as':{'plural':_0x9b22('0x1a5'),'singular':_0x9b22('0x1a6')},'foreignKey':'AutomationAllId','onDelete':_0x9b22('0x119'),'hooks':!![]});db['Automation'][_0x9b22('0x114')](db[_0x9b22('0x7e')],{'as':{'plural':'Any','singular':_0x9b22('0x1a7')},'foreignKey':_0x9b22('0x1a8'),'onDelete':_0x9b22('0x119'),'hooks':!![]});db[_0x9b22('0x1a4')][_0x9b22('0x114')](db[_0x9b22('0x7b')],{'as':_0x9b22('0x1a9'),'foreignKey':_0x9b22('0x1aa'),'onDelete':'cascade','hooks':!![]});db['Disposition'][_0x9b22('0x114')](db[_0x9b22('0x7d')],{'as':_0x9b22('0x164'),'foreignKey':_0x9b22('0x1ab'),'onDelete':'cascade'});db[_0x9b22('0x80')]['hasMany'](db[_0x9b22('0x80')],{'as':_0x9b22('0x1ac'),'foreignKey':_0x9b22('0x150'),'onDelete':_0x9b22('0x119'),'hooks':!![],'required':![]});db[_0x9b22('0x80')][_0x9b22('0x114')](db[_0x9b22('0x19')],{'as':_0x9b22('0x118'),'foreignKey':_0x9b22('0x150'),'onDelete':_0x9b22('0x15f')});db[_0x9b22('0x80')][_0x9b22('0x114')](db[_0x9b22('0x167')],{'as':_0x9b22('0x1ad'),'foreignKey':_0x9b22('0x150')});db[_0x9b22('0x80')][_0x9b22('0x114')](db[_0x9b22('0x63')],{'as':'ChatApplications','foreignKey':'IntervalId'});db[_0x9b22('0x80')][_0x9b22('0x114')](db[_0x9b22('0x17e')],{'as':'FaxApplications','foreignKey':'IntervalId'});db[_0x9b22('0x80')][_0x9b22('0x114')](db[_0x9b22('0x185')],{'as':'SmsApplications','foreignKey':'IntervalId'});db['Schedule'][_0x9b22('0x122')](db[_0x9b22('0x3f')],{});db[_0x9b22('0x84')]['belongsTo'](db[_0x9b22('0x98')],{'foreignKey':_0x9b22('0x1ae')});db['Schedule'][_0x9b22('0x122')](db[_0x9b22('0x96')],{'foreignKey':_0x9b22('0x1af')});db[_0x9b22('0x86')][_0x9b22('0x12a')](db['VoiceMusicOnHold'],{'as':'Mohs','through':_0x9b22('0x149'),'onDelete':_0x9b22('0x15f')});db[_0x9b22('0x88')]['belongsToMany'](db[_0x9b22('0x126')],{'through':_0x9b22('0x1a0')});db['Tag']['belongsToMany'](db[_0x9b22('0x64')],{'through':'chat_interaction_has_tags'});db[_0x9b22('0x88')][_0x9b22('0x12a')](db[_0x9b22('0x44')],{'through':'mail_interaction_has_tags'});db[_0x9b22('0x88')][_0x9b22('0x12a')](db[_0x9b22('0x11c')],{'through':'sms_interaction_has_tags'});db[_0x9b22('0x88')][_0x9b22('0x12a')](db[_0x9b22('0x4d')],{'through':_0x9b22('0x180')});db[_0x9b22('0x88')][_0x9b22('0x12a')](db['OpenchannelInteraction'],{'through':_0x9b22('0x1b0')});db[_0x9b22('0x88')][_0x9b22('0x12a')](db[_0x9b22('0x104')],{'through':_0x9b22('0x1b1')});db['CmContactHasItem'][_0x9b22('0x122')](db['ContactItemType'],{'as':_0x9b22('0x1b2'),'foreignKey':_0x9b22('0x1b3')});db['CmHopperAdditionalPhone']['belongsTo'](db['CmHopper'],{'as':_0x9b22('0x1b4'),'foreignKey':'CmHopperId'});db[_0x9b22('0x199')]['belongsTo'](db[_0x9b22('0x126')],{'as':_0x9b22('0x15d'),'foreignKey':'CmContactId'});db[_0x9b22('0x8e')][_0x9b22('0x114')](db[_0x9b22('0x7e')],{'as':{'plural':_0x9b22('0x1b5'),'singular':_0x9b22('0x1b6')},'foreignKey':'TriggerAllId','onDelete':_0x9b22('0x119'),'hooks':!![]});db[_0x9b22('0x8e')][_0x9b22('0x114')](db[_0x9b22('0x7e')],{'as':{'plural':_0x9b22('0x1b7'),'singular':_0x9b22('0x1b8')},'foreignKey':_0x9b22('0x1b9'),'onDelete':_0x9b22('0x119'),'hooks':!![]});db['Trigger']['hasMany'](db['Action'],{'as':_0x9b22('0x1a9'),'foreignKey':'TriggerId','onDelete':'cascade','hooks':!![]});db[_0x9b22('0x96')][_0x9b22('0x114')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0x9b22('0x119'),'foreignKey':_0x9b22('0x1af'),'hooks':!![]});db['AnalyticDefaultReport'][_0x9b22('0x114')](db[_0x9b22('0x9d')],{'as':'Fields','onDelete':_0x9b22('0x119'),'foreignKey':_0x9b22('0x1ae')});db['AnalyticMetric'][_0x9b22('0x114')](db[_0x9b22('0x9d')],{'as':_0x9b22('0x1ba'),'onDelete':'cascade','foreignKey':_0x9b22('0x1bb')});db[_0x9b22('0x9d')][_0x9b22('0x122')](db[_0x9b22('0x9b')],{'foreignKey':_0x9b22('0x1bb')});db[_0x9b22('0xa1')][_0x9b22('0x114')](db[_0x9b22('0xa3')],{'as':_0x9b22('0x1bc'),'onDelete':_0x9b22('0x119'),'foreignKey':_0x9b22('0x1bd')});db['SalesforceConfiguration'][_0x9b22('0x114')](db['SalesforceField'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db['SalesforceConfiguration'][_0x9b22('0x114')](db[_0x9b22('0xa5')],{'as':_0x9b22('0x1be'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x9b22('0xa3')][_0x9b22('0x114')](db[_0x9b22('0xa5')],{'as':_0x9b22('0x1ba'),'onDelete':'cascade','foreignKey':_0x9b22('0x1bf')});db['SalesforceConfiguration']['belongsTo'](db[_0x9b22('0xa1')],{'as':_0x9b22('0x174'),'foreignKey':_0x9b22('0x1bd')});db['SalesforceField'][_0x9b22('0x114')](db['SalesforceField'],{'as':'Subject','foreignKey':_0x9b22('0x1c0')});db[_0x9b22('0xa5')]['hasMany'](db['SalesforceField'],{'as':_0x9b22('0x1c1'),'foreignKey':_0x9b22('0x1c2')});db['SalesforceField'][_0x9b22('0x114')](db['SalesforceField'],{'as':_0x9b22('0x1c3'),'foreignKey':'FieldId'});db[_0x9b22('0xa5')]['belongsTo'](db[_0x9b22('0x90')],{'as':_0x9b22('0x90'),'foreignKey':_0x9b22('0x1c4')});db[_0x9b22('0xa7')][_0x9b22('0x114')](db[_0x9b22('0x1c5')],{'as':_0x9b22('0x1bc'),'onDelete':_0x9b22('0x119'),'foreignKey':_0x9b22('0x1bd')});db[_0x9b22('0x1c5')][_0x9b22('0x114')](db['SugarcrmField'],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x9b22('0x1c0')});db['SugarcrmConfiguration']['hasMany'](db[_0x9b22('0xaa')],{'as':_0x9b22('0x1be'),'onDelete':_0x9b22('0x119'),'foreignKey':_0x9b22('0x1c2')});db[_0x9b22('0x1c5')]['hasMany'](db[_0x9b22('0xaa')],{'as':_0x9b22('0x1ba'),'onDelete':_0x9b22('0x119'),'foreignKey':'FieldId'});db[_0x9b22('0x1c5')]['belongsTo'](db['SugarcrmAccount'],{'as':'Account','foreignKey':_0x9b22('0x1bd')});db[_0x9b22('0xaa')][_0x9b22('0x114')](db[_0x9b22('0xaa')],{'as':_0x9b22('0x1c6'),'foreignKey':_0x9b22('0x1c0')});db[_0x9b22('0xaa')][_0x9b22('0x114')](db['SugarcrmField'],{'as':_0x9b22('0x1c1'),'foreignKey':'DescriptionId'});db['SugarcrmField'][_0x9b22('0x114')](db['SugarcrmField'],{'as':_0x9b22('0x1c3'),'foreignKey':_0x9b22('0x1bf')});db[_0x9b22('0xaa')][_0x9b22('0x122')](db[_0x9b22('0x90')],{'as':_0x9b22('0x90'),'foreignKey':_0x9b22('0x1c4')});db[_0x9b22('0xac')][_0x9b22('0x114')](db[_0x9b22('0x1c7')],{'as':_0x9b22('0x1bc'),'onDelete':_0x9b22('0x119'),'foreignKey':'AccountId'});db[_0x9b22('0x1c7')]['hasMany'](db[_0x9b22('0xae')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x9b22('0x1c0')});db[_0x9b22('0x1c7')][_0x9b22('0x114')](db[_0x9b22('0xae')],{'as':_0x9b22('0x1be'),'onDelete':_0x9b22('0x119'),'foreignKey':_0x9b22('0x1c2')});db['DeskConfiguration'][_0x9b22('0x114')](db['DeskField'],{'as':_0x9b22('0x1ba'),'onDelete':'cascade','foreignKey':_0x9b22('0x1bf')});db['DeskConfiguration']['belongsTo'](db['DeskAccount'],{'as':_0x9b22('0x174'),'foreignKey':_0x9b22('0x1bd')});db[_0x9b22('0x1c7')]['belongsToMany'](db[_0x9b22('0x88')],{'through':_0x9b22('0x1c8')});db[_0x9b22('0xae')][_0x9b22('0x114')](db['DeskField'],{'as':_0x9b22('0x1c6'),'foreignKey':_0x9b22('0x1c0')});db['DeskField'][_0x9b22('0x114')](db['DeskField'],{'as':_0x9b22('0x1c1'),'foreignKey':_0x9b22('0x1c2')});db['DeskField'][_0x9b22('0x114')](db[_0x9b22('0xae')],{'as':_0x9b22('0x1c3'),'foreignKey':'FieldId'});db[_0x9b22('0xae')][_0x9b22('0x122')](db['Variable'],{'as':_0x9b22('0x90'),'foreignKey':_0x9b22('0x1c4')});db['ZohoAccount'][_0x9b22('0x114')](db[_0x9b22('0xb2')],{'as':_0x9b22('0x1bc'),'onDelete':_0x9b22('0x119'),'foreignKey':'AccountId'});db[_0x9b22('0xb2')][_0x9b22('0x114')](db[_0x9b22('0x1c9')],{'as':_0x9b22('0x1ca'),'onDelete':_0x9b22('0x119'),'foreignKey':_0x9b22('0x1c0')});db[_0x9b22('0xb2')]['hasMany'](db['ZohoField'],{'as':'Descriptions','onDelete':_0x9b22('0x119'),'foreignKey':_0x9b22('0x1c2')});db[_0x9b22('0xb2')][_0x9b22('0x114')](db[_0x9b22('0x1c9')],{'as':_0x9b22('0x1ba'),'onDelete':_0x9b22('0x119'),'foreignKey':_0x9b22('0x1bf')});db[_0x9b22('0xb2')][_0x9b22('0x122')](db[_0x9b22('0xb0')],{'as':_0x9b22('0x174'),'foreignKey':_0x9b22('0x1bd')});db['ZohoField'][_0x9b22('0x114')](db[_0x9b22('0x1c9')],{'as':_0x9b22('0x1c6'),'foreignKey':_0x9b22('0x1c0')});db[_0x9b22('0x1c9')][_0x9b22('0x114')](db['ZohoField'],{'as':_0x9b22('0x1c1'),'foreignKey':_0x9b22('0x1c2')});db['ZohoField'][_0x9b22('0x114')](db[_0x9b22('0x1c9')],{'as':_0x9b22('0x1c3'),'foreignKey':_0x9b22('0x1bf')});db[_0x9b22('0x1c9')][_0x9b22('0x122')](db[_0x9b22('0x90')],{'as':_0x9b22('0x90'),'foreignKey':_0x9b22('0x1c4')});db[_0x9b22('0xb4')]['hasMany'](db[_0x9b22('0x1cb')],{'as':_0x9b22('0x1bc'),'onDelete':_0x9b22('0x119'),'foreignKey':_0x9b22('0x1bd')});db[_0x9b22('0x1cb')][_0x9b22('0x114')](db['ZendeskField'],{'as':_0x9b22('0x1ca'),'foreignKey':'SubjectId'});db[_0x9b22('0x1cb')][_0x9b22('0x114')](db['ZendeskField'],{'as':'Descriptions','foreignKey':_0x9b22('0x1c2')});db[_0x9b22('0x1cb')][_0x9b22('0x114')](db['ZendeskField'],{'as':_0x9b22('0x1ba'),'foreignKey':_0x9b22('0x1bf')});db[_0x9b22('0x1cb')][_0x9b22('0x122')](db['ZendeskAccount'],{'as':_0x9b22('0x174'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x9b22('0x12a')](db[_0x9b22('0x88')],{'through':_0x9b22('0x1cc')});db['ZendeskField'][_0x9b22('0x114')](db['ZendeskField'],{'as':'Subject','foreignKey':_0x9b22('0x1c0')});db[_0x9b22('0xb6')]['hasMany'](db[_0x9b22('0xb6')],{'as':_0x9b22('0x1c1'),'foreignKey':_0x9b22('0x1c2')});db[_0x9b22('0xb6')][_0x9b22('0x114')](db[_0x9b22('0xb6')],{'as':_0x9b22('0x1c3'),'foreignKey':_0x9b22('0x1bf')});db[_0x9b22('0xb6')][_0x9b22('0x122')](db[_0x9b22('0x90')],{'as':'Variable','foreignKey':_0x9b22('0x1c4')});db[_0x9b22('0xb8')]['hasMany'](db['FreshdeskConfiguration'],{'as':_0x9b22('0x1bc'),'onDelete':_0x9b22('0x119'),'foreignKey':_0x9b22('0x1bd')});db['FreshdeskConfiguration'][_0x9b22('0x114')](db['FreshdeskField'],{'as':_0x9b22('0x1ca'),'onDelete':'cascade','foreignKey':_0x9b22('0x1c0')});db[_0x9b22('0xb9')][_0x9b22('0x114')](db[_0x9b22('0xbb')],{'as':_0x9b22('0x1be'),'onDelete':_0x9b22('0x119'),'foreignKey':'DescriptionId'});db[_0x9b22('0xb9')][_0x9b22('0x114')](db[_0x9b22('0xbb')],{'as':_0x9b22('0x1ba'),'onDelete':_0x9b22('0x119'),'foreignKey':_0x9b22('0x1bf')});db[_0x9b22('0xb9')][_0x9b22('0x122')](db['FreshdeskAccount'],{'as':_0x9b22('0x174'),'foreignKey':'AccountId'});db[_0x9b22('0xb9')][_0x9b22('0x12a')](db[_0x9b22('0x88')],{'through':_0x9b22('0x1cd')});db[_0x9b22('0xbb')]['hasMany'](db['FreshdeskField'],{'as':_0x9b22('0x1c6'),'foreignKey':'SubjectId'});db[_0x9b22('0xbb')]['hasMany'](db['FreshdeskField'],{'as':_0x9b22('0x1c1'),'foreignKey':_0x9b22('0x1c2')});db[_0x9b22('0xbb')][_0x9b22('0x114')](db['FreshdeskField'],{'as':'Field','foreignKey':_0x9b22('0x1bf')});db[_0x9b22('0xbb')][_0x9b22('0x122')](db[_0x9b22('0x90')],{'as':'Variable','foreignKey':_0x9b22('0x1c4')});db[_0x9b22('0xbd')]['hasMany'](db['VtigerConfiguration'],{'as':_0x9b22('0x1bc'),'onDelete':_0x9b22('0x119'),'foreignKey':'AccountId'});db[_0x9b22('0xbf')][_0x9b22('0x114')](db[_0x9b22('0xc1')],{'as':'Subjects','foreignKey':_0x9b22('0x1c0')});db['VtigerConfiguration'][_0x9b22('0x114')](db[_0x9b22('0xc1')],{'as':'Descriptions','foreignKey':_0x9b22('0x1c2')});db[_0x9b22('0xbf')][_0x9b22('0x114')](db[_0x9b22('0xc1')],{'as':'Fields','foreignKey':_0x9b22('0x1bf')});db[_0x9b22('0xbf')]['belongsTo'](db[_0x9b22('0xbd')],{'as':_0x9b22('0x174'),'foreignKey':_0x9b22('0x1bd')});db[_0x9b22('0xc1')]['hasMany'](db[_0x9b22('0xc1')],{'as':_0x9b22('0x1c6'),'foreignKey':_0x9b22('0x1c0')});db[_0x9b22('0xc1')]['hasMany'](db['VtigerField'],{'as':'Description','foreignKey':_0x9b22('0x1c2')});db[_0x9b22('0xc1')][_0x9b22('0x114')](db[_0x9b22('0xc1')],{'as':_0x9b22('0x1c3'),'foreignKey':_0x9b22('0x1bf')});db[_0x9b22('0xc1')][_0x9b22('0x122')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db['ServicenowAccount'][_0x9b22('0x114')](db['ServicenowConfiguration'],{'as':'Configurations','onDelete':_0x9b22('0x119'),'foreignKey':'AccountId'});db['ServicenowConfiguration'][_0x9b22('0x114')](db[_0x9b22('0xc6')],{'as':_0x9b22('0x1ca'),'foreignKey':_0x9b22('0x1c0')});db[_0x9b22('0xc4')][_0x9b22('0x114')](db[_0x9b22('0xc6')],{'as':_0x9b22('0x1be'),'foreignKey':_0x9b22('0x1c2')});db[_0x9b22('0xc4')][_0x9b22('0x114')](db['ServicenowField'],{'as':_0x9b22('0x1ba'),'foreignKey':_0x9b22('0x1bf')});db[_0x9b22('0xc4')][_0x9b22('0x122')](db[_0x9b22('0xc2')],{'as':_0x9b22('0x174'),'foreignKey':_0x9b22('0x1bd')});db[_0x9b22('0xc6')][_0x9b22('0x114')](db[_0x9b22('0xc6')],{'as':_0x9b22('0x1c6'),'foreignKey':'SubjectId'});db[_0x9b22('0xc6')][_0x9b22('0x114')](db[_0x9b22('0xc6')],{'as':'Description','foreignKey':_0x9b22('0x1c2')});db['ServicenowField']['hasMany'](db[_0x9b22('0xc6')],{'as':'Field','foreignKey':_0x9b22('0x1bf')});db[_0x9b22('0xc6')][_0x9b22('0x122')](db[_0x9b22('0x90')],{'as':_0x9b22('0x90'),'foreignKey':'VariableId'});db['Dynamics365Account'][_0x9b22('0x114')](db[_0x9b22('0xc9')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x9b22('0x1bd')});db[_0x9b22('0xc7')][_0x9b22('0x122')](db[_0x9b22('0x10c')],{'as':'CloudProvider','foreignKey':_0x9b22('0x161')});db[_0x9b22('0xc9')][_0x9b22('0x114')](db['Dynamics365Field'],{'as':_0x9b22('0x1ca'),'onDelete':_0x9b22('0x119'),'foreignKey':'SubjectId'});db[_0x9b22('0xc9')][_0x9b22('0x114')](db[_0x9b22('0xcb')],{'as':_0x9b22('0x1be'),'onDelete':'cascade','foreignKey':_0x9b22('0x1c2')});db['Dynamics365Configuration'][_0x9b22('0x114')](db[_0x9b22('0xcb')],{'as':_0x9b22('0x1ba'),'onDelete':_0x9b22('0x119'),'foreignKey':_0x9b22('0x1bf')});db[_0x9b22('0xc9')][_0x9b22('0x122')](db[_0x9b22('0xc7')],{'as':_0x9b22('0x174'),'foreignKey':_0x9b22('0x1bd')});db[_0x9b22('0xcb')]['hasMany'](db['Dynamics365Field'],{'as':_0x9b22('0x1c6'),'foreignKey':_0x9b22('0x1c0')});db[_0x9b22('0xcb')][_0x9b22('0x114')](db[_0x9b22('0xcb')],{'as':'Description','foreignKey':_0x9b22('0x1c2')});db[_0x9b22('0xcb')][_0x9b22('0x114')](db[_0x9b22('0xcb')],{'as':_0x9b22('0x1c3'),'foreignKey':_0x9b22('0x1bf')});db[_0x9b22('0xcb')]['belongsTo'](db['Variable'],{'as':_0x9b22('0x90'),'foreignKey':_0x9b22('0x1c4')});db[_0x9b22('0x1ce')][_0x9b22('0x114')](db[_0x9b22('0xce')],{'as':'Configurations','onDelete':_0x9b22('0x119'),'foreignKey':_0x9b22('0x1bd')});db['FreshsalesConfiguration'][_0x9b22('0x114')](db[_0x9b22('0x1cf')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x9b22('0xce')]['hasMany'](db[_0x9b22('0x1cf')],{'as':_0x9b22('0x1be'),'foreignKey':_0x9b22('0x1c2')});db[_0x9b22('0xce')][_0x9b22('0x114')](db[_0x9b22('0x1cf')],{'as':'Fields','foreignKey':'FieldId'});db['FreshsalesConfiguration'][_0x9b22('0x122')](db[_0x9b22('0x1ce')],{'as':_0x9b22('0x174'),'foreignKey':'AccountId'});db[_0x9b22('0x1cf')][_0x9b22('0x114')](db['FreshsalesField'],{'as':_0x9b22('0x1c6'),'foreignKey':_0x9b22('0x1c0')});db[_0x9b22('0x1cf')][_0x9b22('0x114')](db[_0x9b22('0x1cf')],{'as':_0x9b22('0x1c1'),'foreignKey':_0x9b22('0x1c2')});db[_0x9b22('0x1cf')][_0x9b22('0x114')](db[_0x9b22('0x1cf')],{'as':_0x9b22('0x1c3'),'foreignKey':'FieldId'});db[_0x9b22('0x1cf')]['belongsTo'](db[_0x9b22('0x90')],{'as':'Variable','foreignKey':_0x9b22('0x1c4')});db[_0x9b22('0xd2')]['belongsTo'](db[_0x9b22('0x61')],{});db['ChatQueueReport'][_0x9b22('0x122')](db[_0x9b22('0xf4')],{'as':_0x9b22('0x168'),'foreignKey':_0x9b22('0x169')});db['ChatQueueReport'][_0x9b22('0x122')](db[_0x9b22('0x126')],{'as':'Contact','foreignKey':_0x9b22('0x15e')});db['ChatQueueReport'][_0x9b22('0x122')](db['ChatInteraction'],{});db['ChatQueueReport'][_0x9b22('0x122')](db[_0x9b22('0x66')],{});db[_0x9b22('0xd2')]['belongsTo'](db[_0x9b22('0x12')],{});db[_0x9b22('0xd2')][_0x9b22('0x122')](db['ChatQueue'],{});db[_0x9b22('0xd3')][_0x9b22('0x122')](db[_0x9b22('0x12')],{'onDelete':_0x9b22('0x119'),'foreignKey':_0x9b22('0x1d0')});db['ChatInternalMessage'][_0x9b22('0x122')](db[_0x9b22('0x12')],{'onDelete':_0x9b22('0x119'),'foreignKey':_0x9b22('0x1d1')});db[_0x9b22('0x19c')][_0x9b22('0x114')](db[_0x9b22('0x1d2')],{'foreignKey':_0x9b22('0x1d3'),'onDelete':'cascade'});db[_0x9b22('0x19c')][_0x9b22('0x114')](db['JscriptyAnswerReport'],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x9b22('0x1d4')][_0x9b22('0x122')](db[_0x9b22('0x54')],{});db['SmsQueueReport'][_0x9b22('0x122')](db[_0x9b22('0xf4')],{'as':_0x9b22('0x168'),'foreignKey':_0x9b22('0x169')});db[_0x9b22('0x1d4')][_0x9b22('0x122')](db['CmContact'],{'as':_0x9b22('0x15d'),'foreignKey':_0x9b22('0x15e')});db[_0x9b22('0x1d4')][_0x9b22('0x122')](db[_0x9b22('0x11c')],{});db['SmsQueueReport'][_0x9b22('0x122')](db['SmsMessage'],{});db[_0x9b22('0x1d4')]['belongsTo'](db[_0x9b22('0x12')],{});db[_0x9b22('0x1d4')][_0x9b22('0x122')](db[_0x9b22('0x57')],{});db[_0x9b22('0x1d5')][_0x9b22('0x114')](db[_0x9b22('0x19c')],{'foreignKey':_0x9b22('0x1d6')});db[_0x9b22('0x1d5')]['hasMany'](db[_0x9b22('0x1d2')],{'foreignKey':_0x9b22('0x1d6')});db[_0x9b22('0x1d5')][_0x9b22('0x114')](db[_0x9b22('0xd5')],{'foreignKey':_0x9b22('0x1d6')});db[_0x9b22('0x12b')][_0x9b22('0x12a')](db['User'],{'as':_0x9b22('0x154'),'through':_0x9b22('0x12c')});db[_0x9b22('0x12b')][_0x9b22('0x12a')](db[_0x9b22('0x131')],{'through':_0x9b22('0x10e'),'as':'VoiceQueues'});db[_0x9b22('0x12b')]['belongsToMany'](db['MailQueue'],{'through':'team_has_mail_queues','as':_0x9b22('0x134')});db[_0x9b22('0x12b')][_0x9b22('0x12a')](db['ChatQueue'],{'through':_0x9b22('0x195'),'as':_0x9b22('0x135')});db[_0x9b22('0x12b')]['belongsToMany'](db[_0x9b22('0x51')],{'through':_0x9b22('0x182'),'as':'FaxQueues'});db[_0x9b22('0x12b')]['belongsToMany'](db['SmsQueue'],{'through':_0x9b22('0x1d7'),'as':_0x9b22('0x1d8')});db[_0x9b22('0x12b')][_0x9b22('0x12a')](db['OpenchannelQueue'],{'through':_0x9b22('0x1d9'),'as':_0x9b22('0x1da')});db[_0x9b22('0x12b')][_0x9b22('0x12a')](db[_0x9b22('0x10a')],{'through':_0x9b22('0x1db'),'as':_0x9b22('0x137')});db['Team']['belongsToMany'](db['VoicePrefix'],{'through':_0x9b22('0x1dc'),'as':_0x9b22('0x133')});db[_0x9b22('0xe5')][_0x9b22('0x114')](db[_0x9b22('0x14b')],{'as':_0x9b22('0x19b'),'foreignKey':_0x9b22('0x1dd')});db[_0x9b22('0xe5')][_0x9b22('0x114')](db['CmHopperFinal'],{'as':_0x9b22('0x11a'),'foreignKey':'CampaignId'});db[_0x9b22('0xe5')][_0x9b22('0x114')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0x9b22('0x1dd')});db[_0x9b22('0xe5')][_0x9b22('0x114')](db[_0x9b22('0x14d')],{'as':_0x9b22('0x1de'),'foreignKey':_0x9b22('0x1dd')});db['Campaign'][_0x9b22('0x122')](db[_0x9b22('0x2c')],{'as':_0x9b22('0x2c'),'foreignKey':_0x9b22('0x14e')});db[_0x9b22('0xe5')][_0x9b22('0x122')](db[_0x9b22('0x2c')],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db['Campaign'][_0x9b22('0x122')](db['Interval'],{'as':_0x9b22('0x80'),'foreignKey':_0x9b22('0x150')});db['Campaign'][_0x9b22('0x122')](db['SquareProject'],{'as':'SquareProject','foreignKey':_0x9b22('0x1df')});db[_0x9b22('0xe5')][_0x9b22('0x12a')](db[_0x9b22('0xf4')],{'as':_0x9b22('0x128'),'through':_0x9b22('0x1e0')});db[_0x9b22('0xe5')][_0x9b22('0x12a')](db['CmList'],{'as':_0x9b22('0x156'),'through':_0x9b22('0x1e1')});db[_0x9b22('0xe8')]['belongsTo'](db[_0x9b22('0x68')],{'as':_0x9b22('0x68'),'foreignKey':_0x9b22('0x176')});db['MailTransferReport'][_0x9b22('0x122')](db[_0x9b22('0x46')],{});db[_0x9b22('0xeb')][_0x9b22('0x122')](db['MailInteraction'],{});db[_0x9b22('0xeb')][_0x9b22('0x122')](db[_0x9b22('0x3f')],{'foreignKey':_0x9b22('0x1e2'),'as':_0x9b22('0x1e3')});db[_0x9b22('0xeb')][_0x9b22('0x122')](db['User'],{'foreignKey':_0x9b22('0x1e4'),'as':_0x9b22('0x1e5')});db['MailTransferReport'][_0x9b22('0x122')](db[_0x9b22('0x12')],{'foreignKey':_0x9b22('0x1e6'),'as':'ToAgent'});db[_0x9b22('0xeb')][_0x9b22('0x122')](db['MailQueue'],{'foreignKey':'ToMailQueueId','as':_0x9b22('0x1e7')});db[_0x9b22('0xeb')][_0x9b22('0x122')](db[_0x9b22('0x3f')],{'foreignKey':_0x9b22('0x1e8'),'as':_0x9b22('0x1e9')});db[_0x9b22('0xed')][_0x9b22('0x122')](db[_0x9b22('0x66')],{});db[_0x9b22('0xed')][_0x9b22('0x122')](db['ChatInteraction'],{});db['ChatTransferReport']['belongsTo'](db[_0x9b22('0x61')],{'foreignKey':_0x9b22('0x1ea'),'as':_0x9b22('0x1e3')});db['ChatTransferReport'][_0x9b22('0x122')](db[_0x9b22('0x12')],{'foreignKey':'FromUserId','as':_0x9b22('0x1e5')});db['ChatTransferReport']['belongsTo'](db[_0x9b22('0x12')],{'foreignKey':_0x9b22('0x1e6'),'as':_0x9b22('0x1eb')});db['ChatTransferReport'][_0x9b22('0x122')](db[_0x9b22('0x6a')],{'foreignKey':'ToChatQueueId','as':_0x9b22('0x1e7')});db[_0x9b22('0xed')][_0x9b22('0x122')](db[_0x9b22('0x61')],{'foreignKey':_0x9b22('0x1ec'),'as':_0x9b22('0x1e9')});db[_0x9b22('0x1ed')]['belongsTo'](db[_0x9b22('0x4f')],{});db[_0x9b22('0x1ed')]['belongsTo'](db['FaxInteraction'],{});db[_0x9b22('0x1ed')][_0x9b22('0x122')](db[_0x9b22('0x4b')],{'foreignKey':_0x9b22('0x1ee'),'as':'FromAccount'});db[_0x9b22('0x1ed')][_0x9b22('0x122')](db[_0x9b22('0x12')],{'foreignKey':_0x9b22('0x1e4'),'as':_0x9b22('0x1e5')});db['FaxTransferReport'][_0x9b22('0x122')](db[_0x9b22('0x12')],{'foreignKey':'ToUserId','as':_0x9b22('0x1eb')});db[_0x9b22('0x1ed')][_0x9b22('0x122')](db['FaxQueue'],{'foreignKey':_0x9b22('0x1ef'),'as':_0x9b22('0x1e7')});db[_0x9b22('0x1ed')][_0x9b22('0x122')](db[_0x9b22('0x4b')],{'foreignKey':'ToFaxAccountId','as':'ToAccount'});db[_0x9b22('0xf0')]['belongsTo'](db[_0x9b22('0x5d')],{});db[_0x9b22('0xf0')][_0x9b22('0x122')](db[_0x9b22('0x5b')],{});db[_0x9b22('0xf0')][_0x9b22('0x122')](db[_0x9b22('0x13e')],{'foreignKey':_0x9b22('0x1f0'),'as':_0x9b22('0x1e3')});db[_0x9b22('0xf0')]['belongsTo'](db['User'],{'foreignKey':_0x9b22('0x1e4'),'as':_0x9b22('0x1e5')});db[_0x9b22('0xf0')][_0x9b22('0x122')](db[_0x9b22('0x12')],{'foreignKey':_0x9b22('0x1e6'),'as':_0x9b22('0x1eb')});db[_0x9b22('0xf0')][_0x9b22('0x122')](db[_0x9b22('0x5f')],{'foreignKey':'ToOpenchannelQueueId','as':_0x9b22('0x1e7')});db[_0x9b22('0xf0')]['belongsTo'](db[_0x9b22('0x13e')],{'foreignKey':_0x9b22('0x1f1'),'as':_0x9b22('0x1e9')});db['SmsTransferReport'][_0x9b22('0x122')](db[_0x9b22('0x184')],{});db[_0x9b22('0xf2')]['belongsTo'](db[_0x9b22('0x11c')],{});db['SmsTransferReport'][_0x9b22('0x122')](db['SmsAccount'],{'foreignKey':_0x9b22('0x1f2'),'as':_0x9b22('0x1e3')});db[_0x9b22('0xf2')][_0x9b22('0x122')](db[_0x9b22('0x12')],{'foreignKey':'FromUserId','as':_0x9b22('0x1e5')});db[_0x9b22('0xf2')][_0x9b22('0x122')](db[_0x9b22('0x12')],{'foreignKey':_0x9b22('0x1e6'),'as':_0x9b22('0x1eb')});db[_0x9b22('0xf2')]['belongsTo'](db[_0x9b22('0x57')],{'foreignKey':_0x9b22('0x1f3'),'as':_0x9b22('0x1e7')});db['SmsTransferReport']['belongsTo'](db[_0x9b22('0x54')],{'foreignKey':'ToSmsAccountId','as':_0x9b22('0x1e9')});db['CmList']['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':'ListId','onDelete':'cascade'});db[_0x9b22('0xf4')][_0x9b22('0x114')](db['CmCustomField'],{'as':_0x9b22('0x1f4'),'foreignKey':_0x9b22('0x169')});db[_0x9b22('0xf4')][_0x9b22('0x114')](db[_0x9b22('0x126')],{'as':_0x9b22('0x197'),'onDelete':_0x9b22('0x119'),'foreignKey':'ListId'});db[_0x9b22('0xf4')][_0x9b22('0x114')](db[_0x9b22('0x74')],{'as':_0x9b22('0x11a'),'foreignKey':_0x9b22('0x169')});db[_0x9b22('0xf4')][_0x9b22('0x114')](db[_0x9b22('0x76')],{'as':'HopperHistory','foreignKey':_0x9b22('0x169')});db[_0x9b22('0xf4')][_0x9b22('0x114')](db[_0x9b22('0x78')],{'as':_0x9b22('0x78'),'foreignKey':'ListId'});db[_0x9b22('0xf4')]['belongsToMany'](db['VoiceQueue'],{'as':_0x9b22('0x1f5'),'through':'voice_queues_has_cm_lists'});db[_0x9b22('0xf4')]['belongsToMany'](db['User'],{'as':_0x9b22('0x154'),'through':'cm_user_has_lists'});db['VoicePrefix']['hasMany'](db[_0x9b22('0x19')],{'as':'Extensions','onDelete':_0x9b22('0x119')});db[_0x9b22('0xf6')][_0x9b22('0x12a')](db['User'],{'as':_0x9b22('0x154'),'through':_0x9b22('0x110')});db[_0x9b22('0xf6')][_0x9b22('0x12a')](db[_0x9b22('0x12b')],{'through':_0x9b22('0x1dc'),'as':_0x9b22('0x155')});db['UserProfile']['hasMany'](db['User'],{'as':_0x9b22('0x16f'),'foreignKey':_0x9b22('0x123')});db[_0x9b22('0xf8')][_0x9b22('0x114')](db[_0x9b22('0xfa')],{'as':_0x9b22('0x1f6'),'foreignKey':_0x9b22('0x123'),'onDelete':_0x9b22('0x119')});db[_0x9b22('0xfa')][_0x9b22('0x114')](db['UserProfileResource'],{'as':_0x9b22('0x1f7'),'foreignKey':_0x9b22('0x1f8'),'onDelete':_0x9b22('0x119')});db[_0x9b22('0x100')][_0x9b22('0x114')](db[_0x9b22('0x7d')],{'as':_0x9b22('0x164'),'foreignKey':_0x9b22('0x1f9'),'onDelete':_0x9b22('0x119')});db[_0x9b22('0x100')][_0x9b22('0x114')](db[_0x9b22('0x17c')],{'as':_0x9b22('0x165'),'foreignKey':_0x9b22('0x1f9')});db['WhatsappAccount'][_0x9b22('0x114')](db[_0x9b22('0x1fa')],{'as':_0x9b22('0x158'),'foreignKey':_0x9b22('0x1f9')});db[_0x9b22('0x100')]['hasMany'](db[_0x9b22('0x104')],{'as':_0x9b22('0x166')});db['WhatsappAccount'][_0x9b22('0x114')](db['WhatsappApplication'],{'as':_0x9b22('0x147')});db['WhatsappAccount'][_0x9b22('0x122')](db['CmList'],{'as':_0x9b22('0x168'),'foreignKey':_0x9b22('0x169')});db[_0x9b22('0x100')][_0x9b22('0x122')](db[_0x9b22('0x81')],{'as':_0x9b22('0x151'),'foreignKey':_0x9b22('0x152')});db['WhatsappAccount'][_0x9b22('0x12a')](db[_0x9b22('0x12')],{'as':_0x9b22('0x154'),'through':_0x9b22('0x144')});db[_0x9b22('0x102')][_0x9b22('0x122')](db['User'],{'onDelete':'restrict'});db[_0x9b22('0x102')][_0x9b22('0x122')](db[_0x9b22('0x10a')],{'onDelete':_0x9b22('0x15f')});db[_0x9b22('0x102')]['belongsTo'](db['WhatsappAccount'],{'onDelete':'restrict'});db[_0x9b22('0x102')][_0x9b22('0x122')](db['Interval'],{'onDelete':_0x9b22('0x15f'),'foreignKey':_0x9b22('0x150')});db[_0x9b22('0x102')][_0x9b22('0x122')](db[_0x9b22('0x88')],{'onDelete':_0x9b22('0x15f'),'foreignKey':_0x9b22('0x177')});db[_0x9b22('0x104')][_0x9b22('0x114')](db[_0x9b22('0x1fa')],{'as':'Messages','onDelete':_0x9b22('0x119'),'foreignKey':_0x9b22('0x1fb')});db[_0x9b22('0x104')][_0x9b22('0x122')](db[_0x9b22('0x100')],{'as':_0x9b22('0x174'),'foreignKey':_0x9b22('0x1f9')});db[_0x9b22('0x104')][_0x9b22('0x122')](db['CmContact'],{'as':_0x9b22('0x15d'),'foreignKey':'ContactId'});db[_0x9b22('0x104')][_0x9b22('0x122')](db[_0x9b22('0x12')],{'as':'Owner','foreignKey':_0x9b22('0x117')});db['WhatsappInteraction'][_0x9b22('0x12a')](db[_0x9b22('0x88')],{'through':_0x9b22('0x1b1'),'as':'Tags'});db['WhatsappInteraction'][_0x9b22('0x12a')](db['Tag'],{'through':_0x9b22('0x1b1'),'as':'ThroughTags'});db[_0x9b22('0x104')]['belongsToMany'](db['User'],{'as':_0x9b22('0x16f'),'through':_0x9b22('0x130'),'foreignKey':_0x9b22('0x1fb')});db[_0x9b22('0x1fa')][_0x9b22('0x122')](db[_0x9b22('0x12')],{'as':'User'});db[_0x9b22('0x1fa')][_0x9b22('0x122')](db[_0x9b22('0x126')],{'onDelete':_0x9b22('0x119'),'as':'Contact'});db[_0x9b22('0x1fa')][_0x9b22('0x122')](db[_0x9b22('0x104')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x9b22('0x1fb')});db[_0x9b22('0x1fa')]['belongsTo'](db[_0x9b22('0x100')],{'as':_0x9b22('0x174'),'foreignKey':'WhatsappAccountId'});db[_0x9b22('0x107')]['belongsTo'](db[_0x9b22('0x100')],{});db['WhatsappQueueReport'][_0x9b22('0x122')](db[_0x9b22('0xf4')],{'as':_0x9b22('0x168'),'foreignKey':_0x9b22('0x169')});db[_0x9b22('0x107')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0x9b22('0x15e')});db[_0x9b22('0x107')][_0x9b22('0x122')](db['WhatsappInteraction'],{});db[_0x9b22('0x107')][_0x9b22('0x122')](db[_0x9b22('0x10a')],{});db[_0x9b22('0x107')][_0x9b22('0x122')](db[_0x9b22('0x1fa')],{});db[_0x9b22('0x107')][_0x9b22('0x122')](db[_0x9b22('0x12')],{});db['WhatsappTransferReport'][_0x9b22('0x122')](db[_0x9b22('0x1fa')],{});db[_0x9b22('0x1fc')][_0x9b22('0x122')](db['WhatsappInteraction'],{});db[_0x9b22('0x1fc')][_0x9b22('0x122')](db[_0x9b22('0x100')],{'foreignKey':_0x9b22('0x1fd'),'as':_0x9b22('0x1e3')});db[_0x9b22('0x1fc')][_0x9b22('0x122')](db[_0x9b22('0x100')],{'foreignKey':'ToWhatsappAccountId','as':'ToAccount'});db[_0x9b22('0x1fc')][_0x9b22('0x122')](db[_0x9b22('0x10a')],{'foreignKey':'ToQueueId','as':_0x9b22('0x1e7')});db[_0x9b22('0x1fc')][_0x9b22('0x122')](db[_0x9b22('0x12')],{'foreignKey':_0x9b22('0x1e4'),'as':'FromAgent'});db[_0x9b22('0x1fc')]['belongsTo'](db[_0x9b22('0x12')],{'foreignKey':'ToUserId','as':_0x9b22('0x1eb')});db[_0x9b22('0x10a')][_0x9b22('0x12a')](db[_0x9b22('0x12')],{'as':_0x9b22('0x154'),'through':_0x9b22('0x138'),'foreignKey':_0x9b22('0x1fe')});db['WhatsappQueue']['belongsToMany'](db[_0x9b22('0x12b')],{'through':_0x9b22('0x1db'),'as':_0x9b22('0x155')});db[_0x9b22('0x111')][_0x9b22('0x122')](db[_0x9b22('0x12')],{'as':_0x9b22('0x1ff'),'foreignKey':_0x9b22('0x117'),'onDelete':_0x9b22('0x119'),'hooks':!![]});db[_0x9b22('0x10c')][_0x9b22('0x112')](db['Dynamics365Account'],{'as':_0x9b22('0xc7'),'onDelete':_0x9b22('0x15f')});db['CloudProvider'][_0x9b22('0x112')](db[_0x9b22('0x3c')],{'as':_0x9b22('0x162'),'onDelete':_0x9b22('0x15f')});db[_0x9b22('0x10c')][_0x9b22('0x112')](db[_0x9b22('0x3e')],{'as':_0x9b22('0x163'),'onDelete':_0x9b22('0x15f')});module[_0x9b22('0x200')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 8decdd5..171a4c8 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0db6=['/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/contacts','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','./api/interval','/api/pauses','./api/pause','./api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','/api/version','./api/version','/api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','root','/www','/demo','join','/snippet','3.0.0','/plugins','/server/files/plugins','get','sendFile','resolve','appPath','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','default','use','/api/users','./api/user','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','/api/voice/queues/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/api/fax/queues','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/messages','./api/smsMessage','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction'];(function(_0x4c208c,_0x8ea3fb){var _0x1396e6=function(_0x19c3c8){while(--_0x19c3c8){_0x4c208c['push'](_0x4c208c['shift']());}};_0x1396e6(++_0x8ea3fb);}(_0x0db6,0x1d2));var _0x60db=function(_0x403f5f,_0x283f67){_0x403f5f=_0x403f5f-0x0;var _0x15b1cd=_0x0db6[_0x403f5f];return _0x15b1cd;};'use strict';var path=require(_0x60db('0x0'));var express=require(_0x60db('0x1'));var errors=require(_0x60db('0x2'));var config=require(_0x60db('0x3'));var setupLoggers=require(_0x60db('0x4'))[_0x60db('0x5')];var clientSideLogs=require('./api/client-side-logs');exports[_0x60db('0x6')]=function(_0x5e4c72){return setupLoggers(_0x5e4c72)['then'](function(){_0x5e4c72[_0x60db('0x7')](_0x60db('0x8'),require(_0x60db('0x9')));_0x5e4c72[_0x60db('0x7')]('/api/voice/chanspy',require(_0x60db('0xa')));_0x5e4c72[_0x60db('0x7')](_0x60db('0xb'),require(_0x60db('0xc')));_0x5e4c72['use'](_0x60db('0xd'),require(_0x60db('0xe')));_0x5e4c72[_0x60db('0x7')](_0x60db('0xf'),require(_0x60db('0x10')));_0x5e4c72['use'](_0x60db('0x11'),require(_0x60db('0x12')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x13'),require(_0x60db('0x14')));_0x5e4c72[_0x60db('0x7')]('/api/screen/recordings',require(_0x60db('0x15')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x16'),require(_0x60db('0x17')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x18'),require(_0x60db('0x19')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x1a'),require('./api/voiceCallReport'));_0x5e4c72[_0x60db('0x7')](_0x60db('0x1b'),require(_0x60db('0x1c')));_0x5e4c72[_0x60db('0x7')]('/api/voice/agents/reports',require(_0x60db('0x1d')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x1e'),require('./api/voiceQueueReport'));_0x5e4c72[_0x60db('0x7')]('/api/members/reports',require(_0x60db('0x1f')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x20'),require(_0x60db('0x21')));_0x5e4c72['use'](_0x60db('0x22'),require('./api/voiceTransferReport'));_0x5e4c72['use'](_0x60db('0x23'),require('./api/mailServerOut'));_0x5e4c72[_0x60db('0x7')](_0x60db('0x24'),require(_0x60db('0x25')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x26'),require(_0x60db('0x27')));_0x5e4c72['use'](_0x60db('0x28'),require(_0x60db('0x29')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x2a'),require(_0x60db('0x2b')));_0x5e4c72['use']('/api/mail/messages',require('./api/mailMessage'));_0x5e4c72['use']('/api/mail/applications',require('./api/mailApplication'));_0x5e4c72[_0x60db('0x7')](_0x60db('0x2c'),require(_0x60db('0x2d')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x2e'),require(_0x60db('0x2f')));_0x5e4c72['use'](_0x60db('0x30'),require(_0x60db('0x31')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x32'),require(_0x60db('0x33')));_0x5e4c72[_0x60db('0x7')]('/api/fax/applications',require(_0x60db('0x34')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x35'),require(_0x60db('0x36')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x37'),require('./api/faxMessage'));_0x5e4c72[_0x60db('0x7')](_0x60db('0x38'),require('./api/faxQueue'));_0x5e4c72['use'](_0x60db('0x39'),require(_0x60db('0x3a')));_0x5e4c72[_0x60db('0x7')]('/api/sms/accounts',require('./api/smsAccount'));_0x5e4c72[_0x60db('0x7')](_0x60db('0x3b'),require(_0x60db('0x3c')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x3d'),require('./api/smsInteraction'));_0x5e4c72['use'](_0x60db('0x3e'),require(_0x60db('0x3f')));_0x5e4c72[_0x60db('0x7')]('/api/sms/queues',require('./api/smsQueue'));_0x5e4c72[_0x60db('0x7')](_0x60db('0x40'),require(_0x60db('0x41')));_0x5e4c72[_0x60db('0x7')]('/api/openchannel/applications',require('./api/openchannelApplication'));_0x5e4c72[_0x60db('0x7')](_0x60db('0x42'),require(_0x60db('0x43')));_0x5e4c72['use'](_0x60db('0x44'),require(_0x60db('0x45')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x46'),require('./api/openchannelQueue'));_0x5e4c72[_0x60db('0x7')]('/api/chat/websites',require(_0x60db('0x47')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x48'),require(_0x60db('0x49')));_0x5e4c72['use'](_0x60db('0x4a'),require(_0x60db('0x4b')));_0x5e4c72['use'](_0x60db('0x4c'),require(_0x60db('0x4d')));_0x5e4c72['use'](_0x60db('0x4e'),require(_0x60db('0x4f')));_0x5e4c72['use']('/api/chat/offline_messages',require(_0x60db('0x50')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x51'),require(_0x60db('0x52')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x53'),require(_0x60db('0x54')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x55'),require(_0x60db('0x56')));_0x5e4c72['use']('/api/cm/companies',require('./api/cmCompany'));_0x5e4c72[_0x60db('0x7')](_0x60db('0x57'),require('./api/cmContact'));_0x5e4c72[_0x60db('0x7')]('/api/cm/hopper',require(_0x60db('0x58')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x59'),require(_0x60db('0x5a')));_0x5e4c72['use'](_0x60db('0x5b'),require(_0x60db('0x5c')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x5d'),require(_0x60db('0x5e')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x5f'),require(_0x60db('0x60')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x61'),require(_0x60db('0x62')));_0x5e4c72['use'](_0x60db('0x63'),require(_0x60db('0x64')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x65'),require(_0x60db('0x66')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x67'),require(_0x60db('0x68')));_0x5e4c72[_0x60db('0x7')]('/api/conditions',require(_0x60db('0x69')));_0x5e4c72[_0x60db('0x7')]('/api/intervals',require(_0x60db('0x6a')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x6b'),require(_0x60db('0x6c')));_0x5e4c72[_0x60db('0x7')]('/api/cdr',require(_0x60db('0x6d')));_0x5e4c72[_0x60db('0x7')]('/api/voiceQueuesLog',require(_0x60db('0x6e')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x6f'),require(_0x60db('0x70')));_0x5e4c72['use'](_0x60db('0x71'),require('./api/sound'));_0x5e4c72[_0x60db('0x7')](_0x60db('0x72'),require(_0x60db('0x73')));_0x5e4c72['use'](_0x60db('0x74'),require(_0x60db('0x75')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x76'),require(_0x60db('0x77')));_0x5e4c72['use']('/api/cm_hopper_additional_phones',require(_0x60db('0x78')));_0x5e4c72['use'](_0x60db('0x79'),require(_0x60db('0x7a')));_0x5e4c72[_0x60db('0x7')]('/api/triggers',require('./api/trigger'));_0x5e4c72[_0x60db('0x7')](_0x60db('0x7b'),require(_0x60db('0x7c')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x7d'),require(_0x60db('0x7e')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x7f'),require(_0x60db('0x80')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x81'),require(_0x60db('0x82')));_0x5e4c72['use'](_0x60db('0x83'),require(_0x60db('0x84')));_0x5e4c72['use'](_0x60db('0x85'),require(_0x60db('0x86')));_0x5e4c72[_0x60db('0x7')]('/api/analytics/metrics',require('./api/analyticMetric'));_0x5e4c72['use'](_0x60db('0x87'),require(_0x60db('0x88')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x89'),require(_0x60db('0x8a')));_0x5e4c72[_0x60db('0x7')]('/api/integrations/salesforce/accounts',require(_0x60db('0x8b')));_0x5e4c72['use'](_0x60db('0x8c'),require('./api/intSalesforceConfiguration'));_0x5e4c72[_0x60db('0x7')](_0x60db('0x8d'),require(_0x60db('0x8e')));_0x5e4c72[_0x60db('0x7')]('/api/integrations/sugarcrm/accounts',require('./api/intSugarcrmAccount'));_0x5e4c72[_0x60db('0x7')]('/api/integrations/sugarcrm/configurations',require('./api/intSugarcrmConfiguration'));_0x5e4c72[_0x60db('0x7')](_0x60db('0x8f'),require(_0x60db('0x90')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x91'),require('./api/intDeskAccount'));_0x5e4c72[_0x60db('0x7')](_0x60db('0x92'),require('./api/intDeskConfiguration'));_0x5e4c72[_0x60db('0x7')](_0x60db('0x93'),require(_0x60db('0x94')));_0x5e4c72['use'](_0x60db('0x95'),require(_0x60db('0x96')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x97'),require('./api/intZohoConfiguration'));_0x5e4c72['use']('/api/integrations/zoho/fields',require(_0x60db('0x98')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x99'),require(_0x60db('0x9a')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x9b'),require(_0x60db('0x9c')));_0x5e4c72['use'](_0x60db('0x9d'),require(_0x60db('0x9e')));_0x5e4c72[_0x60db('0x7')](_0x60db('0x9f'),require('./api/intFreshdeskAccount'));_0x5e4c72['use'](_0x60db('0xa0'),require('./api/intFreshdeskConfiguration'));_0x5e4c72['use']('/api/integrations/freshdesk/fields',require('./api/intFreshdeskField'));_0x5e4c72[_0x60db('0x7')](_0x60db('0xa1'),require('./api/intVtigerAccount'));_0x5e4c72[_0x60db('0x7')](_0x60db('0xa2'),require(_0x60db('0xa3')));_0x5e4c72[_0x60db('0x7')]('/api/integrations/vtiger/fields',require(_0x60db('0xa4')));_0x5e4c72[_0x60db('0x7')]('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0x5e4c72[_0x60db('0x7')]('/api/integrations/servicenow/configurations',require('./api/intServicenowConfiguration'));_0x5e4c72[_0x60db('0x7')]('/api/integrations/servicenow/fields',require(_0x60db('0xa5')));_0x5e4c72['use']('/api/integrations/dynamics365/accounts',require(_0x60db('0xa6')));_0x5e4c72[_0x60db('0x7')](_0x60db('0xa7'),require('./api/intDynamics365Configuration'));_0x5e4c72['use']('/api/integrations/dynamics365/fields',require(_0x60db('0xa8')));_0x5e4c72[_0x60db('0x7')](_0x60db('0xa9'),require(_0x60db('0xaa')));_0x5e4c72['use'](_0x60db('0xab'),require(_0x60db('0xac')));_0x5e4c72['use'](_0x60db('0xad'),require('./api/intFreshsalesField'));_0x5e4c72[_0x60db('0x7')](_0x60db('0xae'),require(_0x60db('0xaf')));_0x5e4c72[_0x60db('0x7')]('/api/chat/reports/queue',require(_0x60db('0xb0')));_0x5e4c72[_0x60db('0x7')](_0x60db('0xb1'),require('./api/chatInternalMessage'));_0x5e4c72[_0x60db('0x7')](_0x60db('0xb2'),require(_0x60db('0xb3')));_0x5e4c72[_0x60db('0x7')](_0x60db('0xb4'),require(_0x60db('0xb5')));_0x5e4c72['use'](_0x60db('0xb6'),require(_0x60db('0xb7')));_0x5e4c72[_0x60db('0x7')](_0x60db('0xb8'),require('./api/smsQueueReport'));_0x5e4c72[_0x60db('0x7')](_0x60db('0xb9'),require(_0x60db('0xba')));_0x5e4c72[_0x60db('0x7')](_0x60db('0xbb'),require(_0x60db('0xbc')));_0x5e4c72[_0x60db('0x7')]('/api/jscripty/projects',require(_0x60db('0xbd')));_0x5e4c72['use']('/api/settings',require(_0x60db('0xbe')));_0x5e4c72[_0x60db('0x7')](_0x60db('0xbf'),require(_0x60db('0xc0')));_0x5e4c72[_0x60db('0x7')](_0x60db('0xc1'),require(_0x60db('0xc2')));_0x5e4c72[_0x60db('0x7')](_0x60db('0xc3'),require(_0x60db('0xc4')));_0x5e4c72['use']('/api/square/messages',require(_0x60db('0xc5')));_0x5e4c72[_0x60db('0x7')](_0x60db('0xc6'),require(_0x60db('0xc7')));_0x5e4c72['use'](_0x60db('0xc8'),require(_0x60db('0xc9')));_0x5e4c72[_0x60db('0x7')](_0x60db('0xca'),require(_0x60db('0xcb')));_0x5e4c72[_0x60db('0x7')](_0x60db('0xcc'),require(_0x60db('0xcd')));_0x5e4c72['use'](_0x60db('0xce'),require(_0x60db('0xcf')));_0x5e4c72['use'](_0x60db('0xd0'),require(_0x60db('0xd1')));_0x5e4c72[_0x60db('0x7')](_0x60db('0xd2'),require(_0x60db('0xd3')));_0x5e4c72[_0x60db('0x7')](_0x60db('0xd4'),require(_0x60db('0xd5')));_0x5e4c72['use']('/api/fax/reports/transfer',require(_0x60db('0xd6')));_0x5e4c72['use'](_0x60db('0xd7'),require(_0x60db('0xd8')));_0x5e4c72[_0x60db('0x7')]('/api/sms/reports/transfer',require('./api/smsTransferReport'));_0x5e4c72[_0x60db('0x7')](_0x60db('0xd9'),require(_0x60db('0xda')));_0x5e4c72[_0x60db('0x7')]('/api/voice/prefixes',require(_0x60db('0xdb')));_0x5e4c72[_0x60db('0x7')](_0x60db('0xdc'),require(_0x60db('0xdd')));_0x5e4c72[_0x60db('0x7')](_0x60db('0xde'),require(_0x60db('0xdf')));_0x5e4c72['use'](_0x60db('0xe0'),require(_0x60db('0xe1')));_0x5e4c72[_0x60db('0x7')](_0x60db('0xe2'),require(_0x60db('0xe3')));_0x5e4c72[_0x60db('0x7')](_0x60db('0xe4'),require(_0x60db('0xe5')));_0x5e4c72[_0x60db('0x7')]('/api/whatsapp/applications',require(_0x60db('0xe6')));_0x5e4c72[_0x60db('0x7')](_0x60db('0xe7'),require(_0x60db('0xe8')));_0x5e4c72['use'](_0x60db('0xe9'),require('./api/whatsappMessage'));_0x5e4c72[_0x60db('0x7')](_0x60db('0xea'),require(_0x60db('0xeb')));_0x5e4c72['use'](_0x60db('0xec'),require(_0x60db('0xed')));_0x5e4c72['use']('/api/whatsapp/queues',require('./api/whatsappQueue'));_0x5e4c72[_0x60db('0x7')](_0x60db('0xee'),require(_0x60db('0xef')));_0x5e4c72['use'](_0x60db('0xf0'),require(_0x60db('0xf1')));_0x5e4c72[_0x60db('0x7')](_0x60db('0xf2'),require(_0x60db('0xf3')));_0x5e4c72['use'](_0x60db('0xf4'),require(_0x60db('0xf5')));_0x5e4c72['use']('/api/auth/google',require('./api/authGoogle'));_0x5e4c72[_0x60db('0x7')](_0x60db('0xf6'),require(_0x60db('0xf7')));_0x5e4c72[_0x60db('0x7')](_0x60db('0xf8'),require(_0x60db('0xf9')));_0x5e4c72[_0x60db('0x7')](_0x60db('0xfa'),require('./api/rpc'));_0x5e4c72[_0x60db('0x7')](_0x60db('0xfb'),require(_0x60db('0xfc')));_0x5e4c72[_0x60db('0x7')]('/api/system',require('./api/system'));_0x5e4c72[_0x60db('0x7')](_0x60db('0xfd'),require('./api/pm2'));_0x5e4c72[_0x60db('0x7')](_0x60db('0xfe'),require(_0x60db('0xff')));_0x5e4c72['use'](_0x60db('0x100'),clientSideLogs);_0x5e4c72[_0x60db('0x7')](_0x60db('0x101'),express[_0x60db('0x102')](path['join'](config[_0x60db('0x103')],'/apidoc')));_0x5e4c72[_0x60db('0x7')]('/www',express['static'](path['join'](config[_0x60db('0x103')],_0x60db('0x104'))));_0x5e4c72[_0x60db('0x7')](_0x60db('0x105'),express[_0x60db('0x102')](path[_0x60db('0x106')](config['root'],_0x60db('0x105'))));_0x5e4c72[_0x60db('0x7')](_0x60db('0x107'),express['static'](path[_0x60db('0x106')](config['root'],'snippet',_0x60db('0x108'))));_0x5e4c72[_0x60db('0x7')](_0x60db('0x109'),express[_0x60db('0x102')](path['join'](config[_0x60db('0x103')],_0x60db('0x10a'))));_0x5e4c72['route']('/:url(api|auth|components|app|bower_components|assets)/*')[_0x60db('0x10b')](errors[0x194]);_0x5e4c72['route']('/*')[_0x60db('0x10b')](function(_0x1cee8e,_0x5be8bf){_0x5be8bf[_0x60db('0x10c')](path[_0x60db('0x10d')](_0x5e4c72[_0x60db('0x10b')](_0x60db('0x10e'))+_0x60db('0x10f')));});return _0x5e4c72;});}; \ No newline at end of file +var _0x061a=['/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/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/smsQueueReport','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/attachment','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','./api/userNotification','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','./api/user-setting','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','./api/pm2','./api/webbar','/api/logs','static','join','root','/apidoc','/www','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','express','./errors','./config/environment','./api/client-side-logs','default','then','use','./api/user','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','/api/fax/accounts','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','./api/smsApplication','/api/sms/messages','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','./api/chatMessage','/api/chat/offline_messages','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','./api/template','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/analytics/custom_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount'];(function(_0x584f0d,_0x532838){var _0xc31bcc=function(_0x4ef661){while(--_0x4ef661){_0x584f0d['push'](_0x584f0d['shift']());}};_0xc31bcc(++_0x532838);}(_0x061a,0x18a));var _0xa061=function(_0x339b79,_0x145e88){_0x339b79=_0x339b79-0x0;var _0x5c122a=_0x061a[_0x339b79];return _0x5c122a;};'use strict';var path=require(_0xa061('0x0'));var express=require(_0xa061('0x1'));var errors=require(_0xa061('0x2'));var config=require(_0xa061('0x3'));var setupLoggers=require('./utils/client-side-logger')['setupLoggers'];var clientSideLogs=require(_0xa061('0x4'));exports[_0xa061('0x5')]=function(_0x31aa2c){return setupLoggers(_0x31aa2c)[_0xa061('0x6')](function(){_0x31aa2c[_0xa061('0x7')]('/api/users',require(_0xa061('0x8')));_0x31aa2c['use'](_0xa061('0x9'),require(_0xa061('0xa')));_0x31aa2c[_0xa061('0x7')]('/api/voice/contexts',require(_0xa061('0xb')));_0x31aa2c['use'](_0xa061('0xc'),require('./api/voiceExtension'));_0x31aa2c[_0xa061('0x7')](_0xa061('0xd'),require(_0xa061('0xe')));_0x31aa2c[_0xa061('0x7')](_0xa061('0xf'),require(_0xa061('0x10')));_0x31aa2c[_0xa061('0x7')]('/api/voice/recordings',require(_0xa061('0x11')));_0x31aa2c[_0xa061('0x7')]('/api/screen/recordings',require('./api/screenRecording'));_0x31aa2c[_0xa061('0x7')](_0xa061('0x12'),require('./api/voiceMail'));_0x31aa2c['use'](_0xa061('0x13'),require(_0xa061('0x14')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x15'),require(_0xa061('0x16')));_0x31aa2c['use'](_0xa061('0x17'),require(_0xa061('0x18')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x19'),require(_0xa061('0x1a')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x1b'),require('./api/voiceQueueReport'));_0x31aa2c['use'](_0xa061('0x1c'),require(_0xa061('0x1d')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x1e'),require(_0xa061('0x1f')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x20'),require(_0xa061('0x21')));_0x31aa2c['use']('/api/mail/out_servers',require(_0xa061('0x22')));_0x31aa2c['use']('/api/mail/accounts',require('./api/mailAccount'));_0x31aa2c[_0xa061('0x7')](_0xa061('0x23'),require(_0xa061('0x24')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x25'),require(_0xa061('0x26')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x27'),require(_0xa061('0x28')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x29'),require(_0xa061('0x2a')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x2b'),require('./api/mailApplication'));_0x31aa2c[_0xa061('0x7')](_0xa061('0x2c'),require(_0xa061('0x2d')));_0x31aa2c['use'](_0xa061('0x2e'),require(_0xa061('0x2f')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x30'),require('./api/dashboardItem'));_0x31aa2c[_0xa061('0x7')](_0xa061('0x31'),require('./api/faxAccount'));_0x31aa2c[_0xa061('0x7')](_0xa061('0x32'),require(_0xa061('0x33')));_0x31aa2c['use'](_0xa061('0x34'),require(_0xa061('0x35')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x36'),require(_0xa061('0x37')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x38'),require(_0xa061('0x39')));_0x31aa2c[_0xa061('0x7')]('/api/fax/reports/queue',require(_0xa061('0x3a')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x3b'),require('./api/smsAccount'));_0x31aa2c[_0xa061('0x7')](_0xa061('0x3c'),require(_0xa061('0x3d')));_0x31aa2c[_0xa061('0x7')]('/api/sms/interactions',require('./api/smsInteraction'));_0x31aa2c[_0xa061('0x7')](_0xa061('0x3e'),require(_0xa061('0x3f')));_0x31aa2c['use'](_0xa061('0x40'),require('./api/smsQueue'));_0x31aa2c['use'](_0xa061('0x41'),require(_0xa061('0x42')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x43'),require(_0xa061('0x44')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x45'),require(_0xa061('0x46')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x47'),require(_0xa061('0x48')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x49'),require(_0xa061('0x4a')));_0x31aa2c['use']('/api/chat/websites',require(_0xa061('0x4b')));_0x31aa2c[_0xa061('0x7')]('/api/openchannel/reports/queue',require(_0xa061('0x4c')));_0x31aa2c['use']('/api/chat/applications',require(_0xa061('0x4d')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x4e'),require('./api/chatInteraction'));_0x31aa2c[_0xa061('0x7')]('/api/chat/messages',require(_0xa061('0x4f')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x50'),require('./api/chatOfflineMessage'));_0x31aa2c[_0xa061('0x7')]('/api/chat/queues',require(_0xa061('0x51')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x52'),require(_0xa061('0x53')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x54'),require('./api/chatProactiveAction'));_0x31aa2c['use']('/api/cm/companies',require('./api/cmCompany'));_0x31aa2c[_0xa061('0x7')](_0xa061('0x55'),require(_0xa061('0x56')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x57'),require('./api/cmHopper'));_0x31aa2c[_0xa061('0x7')](_0xa061('0x58'),require('./api/cmHopperBlack'));_0x31aa2c['use']('/api/cm/hopper_final',require(_0xa061('0x59')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x5a'),require('./api/cmHopperHistory'));_0x31aa2c[_0xa061('0x7')](_0xa061('0x5b'),require(_0xa061('0x5c')));_0x31aa2c['use'](_0xa061('0x5d'),require(_0xa061('0x5e')));_0x31aa2c['use']('/api/automations',require(_0xa061('0x5f')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x60'),require(_0xa061('0x61')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x62'),require(_0xa061('0x63')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x64'),require('./api/condition'));_0x31aa2c[_0xa061('0x7')](_0xa061('0x65'),require(_0xa061('0x66')));_0x31aa2c['use'](_0xa061('0x67'),require('./api/pause'));_0x31aa2c[_0xa061('0x7')]('/api/cdr',require(_0xa061('0x68')));_0x31aa2c[_0xa061('0x7')]('/api/voiceQueuesLog',require(_0xa061('0x69')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x6a'),require(_0xa061('0x6b')));_0x31aa2c['use'](_0xa061('0x6c'),require(_0xa061('0x6d')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x6e'),require(_0xa061('0x6f')));_0x31aa2c[_0xa061('0x7')]('/api/contact_item_types',require(_0xa061('0x70')));_0x31aa2c['use'](_0xa061('0x71'),require(_0xa061('0x72')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x73'),require(_0xa061('0x74')));_0x31aa2c[_0xa061('0x7')]('/api/templates',require(_0xa061('0x75')));_0x31aa2c[_0xa061('0x7')]('/api/triggers',require(_0xa061('0x76')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x77'),require(_0xa061('0x78')));_0x31aa2c['use'](_0xa061('0x79'),require(_0xa061('0x7a')));_0x31aa2c['use']('/api/integrations/reports',require('./api/integrationReport'));_0x31aa2c[_0xa061('0x7')](_0xa061('0x7b'),require('./api/analyticCustomReport'));_0x31aa2c[_0xa061('0x7')]('/api/analytics/default_reports',require('./api/analyticDefaultReport'));_0x31aa2c['use'](_0xa061('0x7c'),require(_0xa061('0x7d')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x7e'),require(_0xa061('0x7f')));_0x31aa2c['use']('/api/analytics/field_reports',require(_0xa061('0x80')));_0x31aa2c[_0xa061('0x7')]('/api/analytics/tree_reports',require(_0xa061('0x81')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x82'),require('./api/intSalesforceAccount'));_0x31aa2c[_0xa061('0x7')](_0xa061('0x83'),require('./api/intSalesforceConfiguration'));_0x31aa2c[_0xa061('0x7')](_0xa061('0x84'),require(_0xa061('0x85')));_0x31aa2c['use'](_0xa061('0x86'),require('./api/intSugarcrmAccount'));_0x31aa2c[_0xa061('0x7')](_0xa061('0x87'),require(_0xa061('0x88')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x89'),require(_0xa061('0x8a')));_0x31aa2c[_0xa061('0x7')]('/api/integrations/desk/accounts',require(_0xa061('0x8b')));_0x31aa2c['use'](_0xa061('0x8c'),require(_0xa061('0x8d')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x8e'),require(_0xa061('0x8f')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x90'),require(_0xa061('0x91')));_0x31aa2c[_0xa061('0x7')]('/api/integrations/zoho/configurations',require(_0xa061('0x92')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x93'),require('./api/intZohoField'));_0x31aa2c[_0xa061('0x7')](_0xa061('0x94'),require('./api/intZendeskAccount'));_0x31aa2c[_0xa061('0x7')]('/api/integrations/zendesk/configurations',require(_0xa061('0x95')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x96'),require(_0xa061('0x97')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x98'),require(_0xa061('0x99')));_0x31aa2c['use'](_0xa061('0x9a'),require('./api/intFreshdeskConfiguration'));_0x31aa2c['use'](_0xa061('0x9b'),require(_0xa061('0x9c')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x9d'),require(_0xa061('0x9e')));_0x31aa2c[_0xa061('0x7')](_0xa061('0x9f'),require('./api/intVtigerConfiguration'));_0x31aa2c[_0xa061('0x7')](_0xa061('0xa0'),require(_0xa061('0xa1')));_0x31aa2c[_0xa061('0x7')]('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0x31aa2c['use'](_0xa061('0xa2'),require(_0xa061('0xa3')));_0x31aa2c[_0xa061('0x7')]('/api/integrations/servicenow/fields',require(_0xa061('0xa4')));_0x31aa2c[_0xa061('0x7')](_0xa061('0xa5'),require(_0xa061('0xa6')));_0x31aa2c[_0xa061('0x7')]('/api/integrations/dynamics365/configurations',require(_0xa061('0xa7')));_0x31aa2c[_0xa061('0x7')]('/api/integrations/dynamics365/fields',require(_0xa061('0xa8')));_0x31aa2c[_0xa061('0x7')](_0xa061('0xa9'),require(_0xa061('0xaa')));_0x31aa2c['use'](_0xa061('0xab'),require(_0xa061('0xac')));_0x31aa2c[_0xa061('0x7')](_0xa061('0xad'),require(_0xa061('0xae')));_0x31aa2c[_0xa061('0x7')]('/api/networks',require(_0xa061('0xaf')));_0x31aa2c[_0xa061('0x7')](_0xa061('0xb0'),require('./api/chatQueueReport'));_0x31aa2c[_0xa061('0x7')](_0xa061('0xb1'),require(_0xa061('0xb2')));_0x31aa2c[_0xa061('0x7')](_0xa061('0xb3'),require(_0xa061('0xb4')));_0x31aa2c[_0xa061('0x7')](_0xa061('0xb5'),require('./api/jscriptyQuestionReport'));_0x31aa2c[_0xa061('0x7')]('/api/jscripty/sessions/reports',require(_0xa061('0xb6')));_0x31aa2c[_0xa061('0x7')]('/api/sms/reports/queue',require(_0xa061('0xb7')));_0x31aa2c[_0xa061('0x7')](_0xa061('0xb8'),require(_0xa061('0xb9')));_0x31aa2c[_0xa061('0x7')]('/api/square/details/reports',require(_0xa061('0xba')));_0x31aa2c[_0xa061('0x7')](_0xa061('0xbb'),require('./api/jscriptyProject'));_0x31aa2c['use'](_0xa061('0xbc'),require(_0xa061('0xbd')));_0x31aa2c['use'](_0xa061('0xbe'),require(_0xa061('0xbf')));_0x31aa2c[_0xa061('0x7')](_0xa061('0xc0'),require(_0xa061('0xc1')));_0x31aa2c['use'](_0xa061('0xc2'),require(_0xa061('0xc3')));_0x31aa2c[_0xa061('0x7')]('/api/square/messages',require('./api/squareMessage'));_0x31aa2c[_0xa061('0x7')](_0xa061('0xc4'),require(_0xa061('0xc5')));_0x31aa2c[_0xa061('0x7')](_0xa061('0xc6'),require(_0xa061('0xc7')));_0x31aa2c['use'](_0xa061('0xc8'),require(_0xa061('0xc9')));_0x31aa2c[_0xa061('0x7')](_0xa061('0xca'),require('./api/migration'));_0x31aa2c['use']('/api/attachments',require(_0xa061('0xcb')));_0x31aa2c[_0xa061('0x7')](_0xa061('0xcc'),require('./api/plugin'));_0x31aa2c[_0xa061('0x7')](_0xa061('0xcd'),require(_0xa061('0xce')));_0x31aa2c['use']('/api/chat/reports/transfer',require(_0xa061('0xcf')));_0x31aa2c[_0xa061('0x7')](_0xa061('0xd0'),require(_0xa061('0xd1')));_0x31aa2c[_0xa061('0x7')]('/api/openchannel/reports/transfer',require('./api/openchannelTransferReport'));_0x31aa2c['use'](_0xa061('0xd2'),require(_0xa061('0xd3')));_0x31aa2c[_0xa061('0x7')]('/api/cm/lists',require(_0xa061('0xd4')));_0x31aa2c[_0xa061('0x7')](_0xa061('0xd5'),require('./api/voicePrefix'));_0x31aa2c[_0xa061('0x7')]('/api/userProfiles',require(_0xa061('0xd6')));_0x31aa2c[_0xa061('0x7')](_0xa061('0xd7'),require(_0xa061('0xd8')));_0x31aa2c[_0xa061('0x7')](_0xa061('0xd9'),require(_0xa061('0xda')));_0x31aa2c[_0xa061('0x7')]('/api/userNotifications',require(_0xa061('0xdb')));_0x31aa2c[_0xa061('0x7')]('/api/whatsapp/accounts',require(_0xa061('0xdc')));_0x31aa2c[_0xa061('0x7')](_0xa061('0xdd'),require(_0xa061('0xde')));_0x31aa2c[_0xa061('0x7')]('/api/whatsapp/interactions',require(_0xa061('0xdf')));_0x31aa2c[_0xa061('0x7')](_0xa061('0xe0'),require(_0xa061('0xe1')));_0x31aa2c['use'](_0xa061('0xe2'),require(_0xa061('0xe3')));_0x31aa2c[_0xa061('0x7')](_0xa061('0xe4'),require(_0xa061('0xe5')));_0x31aa2c['use'](_0xa061('0xe6'),require('./api/whatsappQueue'));_0x31aa2c[_0xa061('0x7')](_0xa061('0xe7'),require(_0xa061('0xe8')));_0x31aa2c['use'](_0xa061('0xe9'),require(_0xa061('0xea')));_0x31aa2c[_0xa061('0x7')]('/api/user-settings',require(_0xa061('0xeb')));_0x31aa2c[_0xa061('0x7')]('/api/auth/local',require('./api/authLocal'));_0x31aa2c['use']('/api/auth/google',require('./api/authGoogle'));_0x31aa2c[_0xa061('0x7')](_0xa061('0xec'),require(_0xa061('0xed')));_0x31aa2c['use'](_0xa061('0xee'),require(_0xa061('0xef')));_0x31aa2c[_0xa061('0x7')](_0xa061('0xf0'),require(_0xa061('0xf1')));_0x31aa2c[_0xa061('0x7')](_0xa061('0xf2'),require(_0xa061('0xf3')));_0x31aa2c['use'](_0xa061('0xf4'),require(_0xa061('0xf5')));_0x31aa2c[_0xa061('0x7')]('/api/pm2',require(_0xa061('0xf6')));_0x31aa2c[_0xa061('0x7')]('/api/webbar',require(_0xa061('0xf7')));_0x31aa2c[_0xa061('0x7')](_0xa061('0xf8'),clientSideLogs);_0x31aa2c[_0xa061('0x7')]('/apidoc',express[_0xa061('0xf9')](path[_0xa061('0xfa')](config[_0xa061('0xfb')],_0xa061('0xfc'))));_0x31aa2c[_0xa061('0x7')](_0xa061('0xfd'),express[_0xa061('0xf9')](path['join'](config[_0xa061('0xfb')],'/www')));_0x31aa2c[_0xa061('0x7')]('/demo',express[_0xa061('0xf9')](path[_0xa061('0xfa')](config[_0xa061('0xfb')],_0xa061('0xfe'))));_0x31aa2c[_0xa061('0x7')](_0xa061('0xff'),express[_0xa061('0xf9')](path[_0xa061('0xfa')](config[_0xa061('0xfb')],_0xa061('0x100'),_0xa061('0x101'))));_0x31aa2c[_0xa061('0x7')](_0xa061('0x102'),express['static'](path['join'](config[_0xa061('0xfb')],_0xa061('0x103'))));_0x31aa2c[_0xa061('0x104')](_0xa061('0x105'))[_0xa061('0x106')](errors[0x194]);_0x31aa2c[_0xa061('0x104')]('/*')[_0xa061('0x106')](function(_0x47e87b,_0x12ef6c){_0x12ef6c[_0xa061('0x107')](path[_0xa061('0x108')](_0x31aa2c[_0xa061('0x106')](_0xa061('0x109'))+_0xa061('0x10a')));});return _0x31aa2c;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index b72aeb9..ddbe724 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf771=['merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen'];(function(_0x1a1b6e,_0x3a07a9){var _0x571e2c=function(_0x6cea62){while(--_0x6cea62){_0x1a1b6e['push'](_0x1a1b6e['shift']());}};_0x571e2c(++_0x3a07a9);}(_0xf771,0x8e));var _0x1f77=function(_0x4f0441,_0x12b2d2){_0x4f0441=_0x4f0441-0x0;var _0x3b6818=_0xf771[_0x4f0441];return _0x3b6818;};'use strict';var jayson=require(_0x1f77('0x0'));var _=require(_0x1f77('0x1'));var config=require(_0x1f77('0x2'));exports[_0x1f77('0x3')]=function(){return new Promise(function(_0x1e80b0,_0x9aba4b){var _0x4f4bd9={};_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x5')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x6')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x7')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require('../api/voiceRecording/voiceRecording.rpc'));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x8')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x9')));_0x4f4bd9=_['merge'](_0x4f4bd9,require(_0x1f77('0xa')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0xb')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require('../api/memberReport/memberReport.rpc'));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0xc')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0xd')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0xe')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0xf')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x10')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x11')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x12')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x13')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x14')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require('../api/faxAccount/faxAccount.rpc'));_0x4f4bd9=_['merge'](_0x4f4bd9,require('../api/faxApplication/faxApplication.rpc'));_0x4f4bd9=_['merge'](_0x4f4bd9,require(_0x1f77('0x15')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x16')));_0x4f4bd9=_['merge'](_0x4f4bd9,require(_0x1f77('0x17')));_0x4f4bd9=_['merge'](_0x4f4bd9,require(_0x1f77('0x18')));_0x4f4bd9=_['merge'](_0x4f4bd9,require(_0x1f77('0x19')));_0x4f4bd9=_['merge'](_0x4f4bd9,require('../api/smsInteraction/smsInteraction.rpc'));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x1a')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x1b')));_0x4f4bd9=_['merge'](_0x4f4bd9,require(_0x1f77('0x1c')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x1d')));_0x4f4bd9=_['merge'](_0x4f4bd9,require(_0x1f77('0x1e')));_0x4f4bd9=_['merge'](_0x4f4bd9,require(_0x1f77('0x1f')));_0x4f4bd9=_['merge'](_0x4f4bd9,require(_0x1f77('0x20')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x21')));_0x4f4bd9=_['merge'](_0x4f4bd9,require(_0x1f77('0x22')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require('../api/chatQueue/chatQueue.rpc'));_0x4f4bd9=_['merge'](_0x4f4bd9,require('../api/cmContact/cmContact.rpc'));_0x4f4bd9=_['merge'](_0x4f4bd9,require('../api/cmHopper/cmHopper.rpc'));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x23')));_0x4f4bd9=_['merge'](_0x4f4bd9,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x24')));_0x4f4bd9=_['merge'](_0x4f4bd9,require(_0x1f77('0x25')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x26')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x27')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x28')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x29')));_0x4f4bd9=_['merge'](_0x4f4bd9,require(_0x1f77('0x2a')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x2b')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x2c')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x2d')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x4f4bd9=_['merge'](_0x4f4bd9,require(_0x1f77('0x2e')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x2f')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x30')));_0x4f4bd9=_['merge'](_0x4f4bd9,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x4f4bd9=_['merge'](_0x4f4bd9,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x31')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x32')));_0x4f4bd9=_['merge'](_0x4f4bd9,require(_0x1f77('0x33')));_0x4f4bd9=_['merge'](_0x4f4bd9,require('../api/setting/setting.rpc'));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x34')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x35')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x36')));_0x4f4bd9=_['merge'](_0x4f4bd9,require(_0x1f77('0x37')));_0x4f4bd9=_['merge'](_0x4f4bd9,require(_0x1f77('0x38')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x39')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x3a')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x3b')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x3c')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x3d')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x3e')));_0x4f4bd9=_[_0x1f77('0x4')](_0x4f4bd9,require(_0x1f77('0x3f')));var _0x330df9=jayson[_0x1f77('0x40')](_0x4f4bd9)[_0x1f77('0x41')]();var _0x221a83=config[_0x1f77('0x42')][_0x1f77('0x43')]||config[_0x1f77('0x43')]+0x1;var _0x4a9385=config[_0x1f77('0x42')]['ip']||_0x1f77('0x44');_0x330df9['on']('error',function(_0x3d047c){return _0x9aba4b(_0x3d047c);});_0x330df9['listen'](_0x221a83,_0x4a9385,function(){console[_0x1f77('0x45')](_0x1f77('0x46'),_0x4a9385,_0x221a83);require(_0x1f77('0x47'))['default']();return _0x1e80b0(_0x1f77('0x48')+_0x4a9385+':'+_0x221a83);});});}; \ No newline at end of file +var _0x80c3=['../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','port','localhost','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','listen','merge','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc'];(function(_0x4d5f8f,_0x6d2952){var _0x3ebcc2=function(_0x20b708){while(--_0x20b708){_0x4d5f8f['push'](_0x4d5f8f['shift']());}};_0x3ebcc2(++_0x6d2952);}(_0x80c3,0x18f));var _0x380c=function(_0x4e170e,_0x207e58){_0x4e170e=_0x4e170e-0x0;var _0x338291=_0x80c3[_0x4e170e];return _0x338291;};'use strict';var jayson=require(_0x380c('0x0'));var _=require('lodash');var config=require('../config/environment');exports[_0x380c('0x1')]=function(){return new Promise(function(_0x53f207,_0x3c1362){var _0x4202d4={};_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require('../api/user/user.rpc'));_0x4202d4=_['merge'](_0x4202d4,require('../api/voiceExtension/voiceExtension.rpc'));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require('../api/voiceQueue/voiceQueue.rpc'));_0x4202d4=_['merge'](_0x4202d4,require(_0x380c('0x3')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x4')));_0x4202d4=_['merge'](_0x4202d4,require(_0x380c('0x5')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x6')));_0x4202d4=_['merge'](_0x4202d4,require(_0x380c('0x7')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x8')));_0x4202d4=_['merge'](_0x4202d4,require(_0x380c('0x9')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0xa')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0xb')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0xc')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0xd')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require('../api/mailInteraction/mailInteraction.rpc'));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0xe')));_0x4202d4=_['merge'](_0x4202d4,require(_0x380c('0xf')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x10')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x11')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x12')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x13')));_0x4202d4=_['merge'](_0x4202d4,require(_0x380c('0x14')));_0x4202d4=_['merge'](_0x4202d4,require('../api/faxQueue/faxQueue.rpc'));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x4202d4=_['merge'](_0x4202d4,require('../api/smsAccount/smsAccount.rpc'));_0x4202d4=_['merge'](_0x4202d4,require(_0x380c('0x15')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x16')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x17')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x18')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x19')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x1a')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x1b')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x1c')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x1d')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x1e')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x1f')));_0x4202d4=_['merge'](_0x4202d4,require(_0x380c('0x20')));_0x4202d4=_['merge'](_0x4202d4,require(_0x380c('0x21')));_0x4202d4=_['merge'](_0x4202d4,require(_0x380c('0x22')));_0x4202d4=_['merge'](_0x4202d4,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x23')));_0x4202d4=_['merge'](_0x4202d4,require(_0x380c('0x24')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x25')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x26')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x27')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x28')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x29')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require('../api/variable/variable.rpc'));_0x4202d4=_['merge'](_0x4202d4,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x2a')));_0x4202d4=_['merge'](_0x4202d4,require(_0x380c('0x2b')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x2c')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x2d')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x2e')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x2f')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x30')));_0x4202d4=_['merge'](_0x4202d4,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x4202d4=_['merge'](_0x4202d4,require(_0x380c('0x31')));_0x4202d4=_['merge'](_0x4202d4,require(_0x380c('0x32')));_0x4202d4=_['merge'](_0x4202d4,require(_0x380c('0x33')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x34')));_0x4202d4=_['merge'](_0x4202d4,require(_0x380c('0x35')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x36')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require('../api/squareRecording/squareRecording.rpc'));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require('../api/squareMessage/squareMessage.rpc'));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require('../api/campaign/campaign.rpc'));_0x4202d4=_['merge'](_0x4202d4,require(_0x380c('0x37')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x38')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x39')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require(_0x380c('0x3a')));_0x4202d4=_[_0x380c('0x2')](_0x4202d4,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x306c61=jayson[_0x380c('0x3b')](_0x4202d4)[_0x380c('0x3c')]();var _0x3f8018=config['rpc'][_0x380c('0x3d')]||config[_0x380c('0x3d')]+0x1;var _0x31d880=config['rpc']['ip']||_0x380c('0x3e');_0x306c61['on'](_0x380c('0x3f'),function(_0x1c30bf){return _0x3c1362(_0x1c30bf);});_0x306c61[_0x380c('0x1')](_0x3f8018,_0x31d880,function(){console['log'](_0x380c('0x40'),_0x31d880,_0x3f8018);require(_0x380c('0x41'))[_0x380c('0x42')]();return _0x53f207(_0x380c('0x43')+_0x31d880+':'+_0x3f8018);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 29bd8bf..8d04d40 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 _0x1328=['command','write','destroy','inherits','prototype','sendRequest','sync','answer','ANSWER','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','exec','isArray','join','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','AGI','wait','WAIT','label','exports','util','lodash','EventEmitter','./reply','./error','utf8','headers','emit','ready','line','hangup','substring','520-Invalid','search','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x1328,0x11d));var _0x8132=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x1328[_0x1035c1];return _0x308d67;};'use strict';var util=require(_0x8132('0x0'));var _=require(_0x8132('0x1'));var EventEmitter=require('events')[_0x8132('0x2')];var AGIReply=require(_0x8132('0x3'));var AGIError=require(_0x8132('0x4'));function AGIChannel(_0x403649){var _0x20b1d7=this,_0x438566=new AGIReply(),_0x52c498=![],_0x1b9957={};EventEmitter['call'](_0x20b1d7);_0x403649['setEncoding'](_0x8132('0x5'));_0x403649['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x438566['setEncoding'](_0x8132('0x5'));_0x438566['on'](_0x8132('0x6'),function(_0x3018c5){for(var _0x3fbb66 in _0x3018c5){_0x20b1d7[_0x3fbb66]=_0x3018c5[_0x3fbb66];}_0x20b1d7[_0x8132('0x7')](_0x8132('0x8'));});_0x438566['on'](_0x8132('0x9'),function(_0x796ed1){if(_0x796ed1['toLowerCase']()==_0x8132('0xa')){_0x20b1d7['emit'](_0x8132('0xa'));return;}if(_0x796ed1[_0x8132('0xb')](0x0,0xb)==_0x8132('0xc')){_0x52c498=!![];}if(_0x52c498){_0x1b9957['rx']+=_0x796ed1+'\x0a';if(_0x796ed1[_0x8132('0xd')]('520\x20End\x20of\x20proper')!=-0x1){_0x52c498=![];}}else{_0x1b9957['rx']=_0x796ed1;}if(_0x52c498){return;}if(typeof _0x1b9957['cb']=='function'){var _0x722e7b=_0x1b9957['rx'][_0x8132('0xb')](0x0,0x3),_0x11813f=null,_0xd886ee=null;_0x722e7b=parseInt(_0x722e7b);if(isNaN(_0x722e7b)){_0x1b9957['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x8132('0xe')});return;}if(_0x722e7b!=0xc8){_0x1b9957['cb'](null,{'code':_0x722e7b,'result':-0x1,'extra':'KO'});return;}_0x11813f=_0x1b9957['rx']['substring'](0x4)[_0x8132('0xf')](_0x8132('0x10'),'');if(_0x11813f[_0x8132('0x11')]('\x20')!=-0x1){_0x11813f=_0x11813f[_0x8132('0x12')](0x0,_0x11813f[_0x8132('0x11')]('\x20'));}if(_[_0x8132('0x13')](_0x11813f,'-1')){_0x11813f=parseInt(_0x11813f);}_0xd886ee=_0x1b9957['rx'][_0x8132('0x14')]('\x20');if(_0xd886ee[_0x8132('0x15')]==0x3){_0xd886ee=_0xd886ee[0x2][_0x8132('0xb')](0x1,_0xd886ee[0x2][_0x8132('0x15')]-0x1);}else if(_0xd886ee[_0x8132('0x15')]>0x3){var _0x21d3bb=/\((.+)\)/;var _0x310c90=_0x1b9957['rx'][_0x8132('0x16')](_0x21d3bb);if(_0x310c90){_0xd886ee=_0x310c90[0x1];}else{_0xd886ee=null;}}else{_0xd886ee=null;}_0x1b9957['cb'](null,{'code':_0x722e7b,'result':_0x11813f,'extra':_0xd886ee});}});_0x403649['on'](_0x8132('0x17'),function(_0x33cba7){_0x20b1d7['emit'](_0x8132('0x17'),new AGIError(_0x8132('0x18'),_0x33cba7[_0x8132('0x19')]));});_0x403649['on'](_0x8132('0x1a'),function(){_0x20b1d7['emit'](_0x8132('0x1a'),new AGIError(_0x8132('0x1b')));});_0x403649['on'](_0x8132('0x1c'),function(){_0x20b1d7[_0x8132('0x7')](_0x8132('0x1c'),new AGIError(_0x8132('0x1d')));_0x403649['destroy']();});_0x403649[_0x8132('0x1e')](_0x438566);this[_0x8132('0x1f')]=function(_0x38a1c3,_0x227490){var _0x38a1c3=_0x38a1c3||'',_0x227490=typeof _0x227490=='function'?_0x227490:new Function();_0x1b9957={'tx':_0x38a1c3,'rx':'','cb':_0x227490};_0x403649[_0x8132('0x20')](_0x38a1c3+'\x0a');},this[_0x8132('0x1a')]=function(){_0x403649[_0x8132('0x21')]();};}util[_0x8132('0x22')](AGIChannel,EventEmitter);AGIChannel[_0x8132('0x23')][_0x8132('0x24')]=function(_0x10df9c){return this[_0x8132('0x1f')][_0x8132('0x25')](this,_0x10df9c);};AGIChannel['prototype'][_0x8132('0x26')]=function(){return this[_0x8132('0x24')](_0x8132('0x27'));};AGIChannel['prototype']['getData']=function(_0x596a24,_0x2db333,_0x110218){_0x596a24=_0x596a24===undefined?_0x8132('0x28'):_0x596a24;_0x2db333=_0x2db333===undefined?'5':_0x2db333;_0x110218=_0x110218===undefined?'1':_0x110218;return this['sendRequest'](util[_0x8132('0x29')](_0x8132('0x2a'),_0x596a24,_0x2db333*0x3e8,_0x110218));};AGIChannel[_0x8132('0x23')][_0x8132('0x2b')]=function(_0x457967){_0x457967=_0x457967||'NO\x20MESSAGE';return this[_0x8132('0x24')](util['format']('VERBOSE\x20\x22%s\x22',_0x457967));};AGIChannel[_0x8132('0x23')][_0x8132('0x2c')]=function(_0x2e70bc,_0x35b4cf){if(_[_0x8132('0x2d')](_0x35b4cf)){return this[_0x8132('0x24')](util[_0x8132('0x29')]('EXEC\x20%s\x20%s',_0x2e70bc,_0x35b4cf[_0x8132('0x2e')](',')));}return this[_0x8132('0x24')](util['format'](_0x8132('0x2f'),_0x2e70bc,_0x35b4cf));};AGIChannel[_0x8132('0x23')][_0x8132('0x30')]=function(_0x18956f){return this[_0x8132('0x24')](util[_0x8132('0x29')](_0x8132('0x31'),_0x18956f));};AGIChannel['prototype'][_0x8132('0x32')]=function(_0x56d273){return this['sendRequest'](util[_0x8132('0x29')](_0x8132('0x33'),_0x56d273));};AGIChannel[_0x8132('0x23')][_0x8132('0x34')]=function(_0x358b91){return this[_0x8132('0x24')](util[_0x8132('0x29')](_0x8132('0x35'),_0x358b91));};AGIChannel[_0x8132('0x23')][_0x8132('0xa')]=function(){return this[_0x8132('0x24')](_0x8132('0x36'));};AGIChannel['prototype'][_0x8132('0x37')]=function(_0x3bddda,_0x1a8257){var _0x1fddcd=_[_0x8132('0x38')](_0x1a8257)||_[_0x8132('0x39')](_0x1a8257)?_0x1a8257[_0x8132('0x3a')]():_0x1a8257;return this[_0x8132('0x24')](util[_0x8132('0x29')](_0x8132('0x3b'),_0x3bddda,_0x1fddcd?_0x1fddcd['toString']()[_0x8132('0xf')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x8132('0x23')][_0x8132('0x3c')]=function(_0x46488c,_0x54b0ec){return this['sendRequest'](util['format']('SAY\x20NUMBER\x20%s\x20%s',_0x46488c,_0x54b0ec));};AGIChannel[_0x8132('0x23')][_0x8132('0x3d')]=function(_0x5277cb,_0x87c3f3){return this[_0x8132('0x24')](util['format'](_0x8132('0x3e'),_0x5277cb,_0x87c3f3));};AGIChannel[_0x8132('0x23')][_0x8132('0x3f')]=function(_0x369e54,_0x31c73d){return this[_0x8132('0x24')](util[_0x8132('0x29')](_0x8132('0x40'),_0x369e54,_0x31c73d));};AGIChannel[_0x8132('0x23')][_0x8132('0x41')]=function(_0x4dad26,_0x2243f6,_0xd5d92c){_0x2243f6=_0x2243f6||this['extension'];_0xd5d92c=_0xd5d92c||0x1;this['setContext'](_0x4dad26);this['setExtension'](_0x2243f6);this[_0x8132('0x34')](_0xd5d92c);return this[_0x8132('0x2b')](util[_0x8132('0x29')](_0x8132('0x42'),_0x4dad26,_0x2243f6,_0xd5d92c));};AGIChannel['prototype'][_0x8132('0x43')]=function(_0x5d4c2d){return this[_0x8132('0x24')](util[_0x8132('0x29')](_0x8132('0x44'),_0x5d4c2d));};AGIChannel[_0x8132('0x23')][_0x8132('0x45')]=function(_0x54b9be,_0x2574c5,_0x3576c6,_0x1fee35,_0x44a498,_0x2f5e16){_0x2574c5=_0x2574c5||_0x8132('0x46');_0x3576c6=_0x3576c6||'';_0x1fee35=_0x1fee35===undefined?-0x1:_0x1fee35==='-1'?-0x1:_0x1fee35*0x3e8;_0x44a498=_0x44a498===undefined?'':'s='+_0x44a498;_0x2f5e16=_0x2f5e16?_0x8132('0x47'):'';return this[_0x8132('0x24')](util['format'](_0x8132('0x48'),_0x54b9be,_0x2574c5,_0x3576c6,_0x1fee35,_0x2f5e16,_0x44a498));};AGIChannel['prototype'][_0x8132('0x49')]=function(_0x686288,_0x598f5a){_0x598f5a=_0x598f5a||'';return this[_0x8132('0x24')](util[_0x8132('0x29')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x686288,_0x598f5a));};AGIChannel[_0x8132('0x23')]['agi']=function(_0x3e722b){return this[_0x8132('0x2c')](_0x8132('0x4a'),_0x3e722b);};AGIChannel[_0x8132('0x23')][_0x8132('0x4b')]=function(_0x1f2401){return this[_0x8132('0x2c')](_0x8132('0x4c'),_0x1f2401);};AGIChannel[_0x8132('0x23')][_0x8132('0x17')]=function(_0x1b695c,_0x434439){this['noop'](util[_0x8132('0x29')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x1b695c['id'],_0x1b695c[_0x8132('0x4d')],_0x434439));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x8132('0x4e')]=AGIChannel; \ No newline at end of file +var _0x75dd=['startsWith','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','function','inherits','prototype','sync','sendRequest','ANSWER','getData','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','format','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','replace','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayPhonetic','extension','noop','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','headers','ready','line','toLowerCase','hangup','emit','substring','search','520\x20End\x20of\x20proper','no\x20code','result=','indexOf','substr'];(function(_0x22b438,_0x59fca0){var _0x136271=function(_0x8937e9){while(--_0x8937e9){_0x22b438['push'](_0x22b438['shift']());}};_0x136271(++_0x59fca0);}(_0x75dd,0x1c9));var _0xd75d=function(_0x1eabab,_0x41426a){_0x1eabab=_0x1eabab-0x0;var _0x2a0d0a=_0x75dd[_0x1eabab];return _0x2a0d0a;};'use strict';var util=require(_0xd75d('0x0'));var _=require(_0xd75d('0x1'));var EventEmitter=require(_0xd75d('0x2'))[_0xd75d('0x3')];var AGIReply=require(_0xd75d('0x4'));var AGIError=require(_0xd75d('0x5'));function AGIChannel(_0x4bba27){var _0x8515ac=this,_0x1db51b=new AGIReply(),_0x468082=![],_0xcb99e={};EventEmitter[_0xd75d('0x6')](_0x8515ac);_0x4bba27[_0xd75d('0x7')](_0xd75d('0x8'));_0x4bba27[_0xd75d('0x9')](0x8*0x3c*0x3c*0x3e8);_0x1db51b['setEncoding'](_0xd75d('0x8'));_0x1db51b['on'](_0xd75d('0xa'),function(_0x22b9f1){for(var _0xd24f6b in _0x22b9f1){_0x8515ac[_0xd24f6b]=_0x22b9f1[_0xd24f6b];}_0x8515ac['emit'](_0xd75d('0xb'));});_0x1db51b['on'](_0xd75d('0xc'),function(_0x374105){if(_0x374105[_0xd75d('0xd')]()==_0xd75d('0xe')){_0x8515ac[_0xd75d('0xf')](_0xd75d('0xe'));return;}if(_0x374105[_0xd75d('0x10')](0x0,0xb)=='520-Invalid'){_0x468082=!![];}if(_0x468082){_0xcb99e['rx']+=_0x374105+'\x0a';if(_0x374105[_0xd75d('0x11')](_0xd75d('0x12'))!=-0x1){_0x468082=![];}}else{_0xcb99e['rx']=_0x374105;}if(_0x468082){return;}if(typeof _0xcb99e['cb']=='function'){var _0x2cd327=_0xcb99e['rx'][_0xd75d('0x10')](0x0,0x3),_0x2d6711=null,_0x4a7f67=null;_0x2cd327=parseInt(_0x2cd327);if(isNaN(_0x2cd327)){_0xcb99e['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xd75d('0x13')});return;}if(_0x2cd327!=0xc8){_0xcb99e['cb'](null,{'code':_0x2cd327,'result':-0x1,'extra':'KO'});return;}_0x2d6711=_0xcb99e['rx']['substring'](0x4)['replace'](_0xd75d('0x14'),'');if(_0x2d6711[_0xd75d('0x15')]('\x20')!=-0x1){_0x2d6711=_0x2d6711[_0xd75d('0x16')](0x0,_0x2d6711['indexOf']('\x20'));}if(_[_0xd75d('0x17')](_0x2d6711,'-1')){_0x2d6711=parseInt(_0x2d6711);}_0x4a7f67=_0xcb99e['rx']['split']('\x20');if(_0x4a7f67['length']==0x3){_0x4a7f67=_0x4a7f67[0x2]['substring'](0x1,_0x4a7f67[0x2][_0xd75d('0x18')]-0x1);}else if(_0x4a7f67[_0xd75d('0x18')]>0x3){var _0x5b1c56=/\((.+)\)/;var _0x5941c2=_0xcb99e['rx'][_0xd75d('0x19')](_0x5b1c56);if(_0x5941c2){_0x4a7f67=_0x5941c2[0x1];}else{_0x4a7f67=null;}}else{_0x4a7f67=null;}_0xcb99e['cb'](null,{'code':_0x2cd327,'result':_0x2d6711,'extra':_0x4a7f67});}});_0x4bba27['on'](_0xd75d('0x1a'),function(_0xb86bbf){_0x8515ac['emit'](_0xd75d('0x1a'),new AGIError('E_AGI_SOCKET_ERROR',_0xb86bbf[_0xd75d('0x1b')]));});_0x4bba27['on'](_0xd75d('0x1c'),function(){_0x8515ac[_0xd75d('0xf')](_0xd75d('0x1c'),new AGIError(_0xd75d('0x1d')));});_0x4bba27['on'](_0xd75d('0x1e'),function(){_0x8515ac['emit'](_0xd75d('0x1e'),new AGIError(_0xd75d('0x1f')));_0x4bba27[_0xd75d('0x20')]();});_0x4bba27[_0xd75d('0x21')](_0x1db51b);this[_0xd75d('0x22')]=function(_0x13ec15,_0x3d2c10){var _0x13ec15=_0x13ec15||'',_0x3d2c10=typeof _0x3d2c10==_0xd75d('0x23')?_0x3d2c10:new Function();_0xcb99e={'tx':_0x13ec15,'rx':'','cb':_0x3d2c10};_0x4bba27['write'](_0x13ec15+'\x0a');},this[_0xd75d('0x1c')]=function(){_0x4bba27[_0xd75d('0x20')]();};}util[_0xd75d('0x24')](AGIChannel,EventEmitter);AGIChannel[_0xd75d('0x25')]['sendRequest']=function(_0x4df9e1){return this[_0xd75d('0x22')][_0xd75d('0x26')](this,_0x4df9e1);};AGIChannel[_0xd75d('0x25')]['answer']=function(){return this[_0xd75d('0x27')](_0xd75d('0x28'));};AGIChannel[_0xd75d('0x25')][_0xd75d('0x29')]=function(_0x1945b5,_0x3e425b,_0x43ab02){_0x1945b5=_0x1945b5===undefined?'beep':_0x1945b5;_0x3e425b=_0x3e425b===undefined?'5':_0x3e425b;_0x43ab02=_0x43ab02===undefined?'1':_0x43ab02;return this[_0xd75d('0x27')](util['format'](_0xd75d('0x2a'),_0x1945b5,_0x3e425b*0x3e8,_0x43ab02));};AGIChannel['prototype']['noop']=function(_0x151cb1){_0x151cb1=_0x151cb1||'NO\x20MESSAGE';return this['sendRequest'](util[_0xd75d('0x2b')](_0xd75d('0x2c'),_0x151cb1));};AGIChannel[_0xd75d('0x25')]['exec']=function(_0x2868b2,_0x11eac3){if(_[_0xd75d('0x2d')](_0x11eac3)){return this[_0xd75d('0x27')](util['format'](_0xd75d('0x2e'),_0x2868b2,_0x11eac3[_0xd75d('0x2f')](',')));}return this[_0xd75d('0x27')](util['format'](_0xd75d('0x2e'),_0x2868b2,_0x11eac3));};AGIChannel['prototype'][_0xd75d('0x30')]=function(_0x1c7a5f){return this[_0xd75d('0x27')](util[_0xd75d('0x2b')](_0xd75d('0x31'),_0x1c7a5f));};AGIChannel[_0xd75d('0x25')][_0xd75d('0x32')]=function(_0x11baa2){return this['sendRequest'](util[_0xd75d('0x2b')](_0xd75d('0x33'),_0x11baa2));};AGIChannel[_0xd75d('0x25')][_0xd75d('0x34')]=function(_0x1a3797){return this['sendRequest'](util[_0xd75d('0x2b')](_0xd75d('0x35'),_0x1a3797));};AGIChannel[_0xd75d('0x25')][_0xd75d('0xe')]=function(){return this['sendRequest'](_0xd75d('0x36'));};AGIChannel[_0xd75d('0x25')][_0xd75d('0x37')]=function(_0x21bc4b,_0x5192e7){var _0x3e5312=_[_0xd75d('0x38')](_0x5192e7)||_['isNumber'](_0x5192e7)?_0x5192e7['toString']():_0x5192e7;return this[_0xd75d('0x27')](util['format'](_0xd75d('0x39'),_0x21bc4b,_0x3e5312?_0x3e5312[_0xd75d('0x3a')]()[_0xd75d('0x3b')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xd75d('0x25')][_0xd75d('0x3c')]=function(_0x2ea937,_0x22bf73){return this[_0xd75d('0x27')](util['format'](_0xd75d('0x3d'),_0x2ea937,_0x22bf73));};AGIChannel[_0xd75d('0x25')]['sayDigits']=function(_0x361403,_0xa67399){return this[_0xd75d('0x27')](util[_0xd75d('0x2b')]('SAY\x20DIGITS\x20%s\x20%s',_0x361403,_0xa67399));};AGIChannel[_0xd75d('0x25')][_0xd75d('0x3e')]=function(_0x13dcc3,_0xb882c6){return this[_0xd75d('0x27')](util[_0xd75d('0x2b')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x13dcc3,_0xb882c6));};AGIChannel['prototype']['continueAt']=function(_0x16fa19,_0x17789f,_0x52175c){_0x17789f=_0x17789f||this[_0xd75d('0x3f')];_0x52175c=_0x52175c||0x1;this[_0xd75d('0x30')](_0x16fa19);this[_0xd75d('0x32')](_0x17789f);this['setPriority'](_0x52175c);return this[_0xd75d('0x40')](util[_0xd75d('0x2b')](_0xd75d('0x41'),_0x16fa19,_0x17789f,_0x52175c));};AGIChannel[_0xd75d('0x25')][_0xd75d('0x42')]=function(_0x1b53f4){return this['sendRequest'](util[_0xd75d('0x2b')](_0xd75d('0x43'),_0x1b53f4));};AGIChannel[_0xd75d('0x25')]['recordFile']=function(_0x3f138f,_0x4dbfc4,_0x1f95ed,_0x3d7304,_0x5cbf63,_0x10e89c){_0x4dbfc4=_0x4dbfc4||_0xd75d('0x44');_0x1f95ed=_0x1f95ed||'';_0x3d7304=_0x3d7304===undefined?-0x1:_0x3d7304==='-1'?-0x1:_0x3d7304*0x3e8;_0x5cbf63=_0x5cbf63===undefined?'':'s='+_0x5cbf63;_0x10e89c=_0x10e89c?_0xd75d('0x45'):'';return this['sendRequest'](util[_0xd75d('0x2b')](_0xd75d('0x46'),_0x3f138f,_0x4dbfc4,_0x1f95ed,_0x3d7304,_0x10e89c,_0x5cbf63));};AGIChannel[_0xd75d('0x25')][_0xd75d('0x47')]=function(_0x5eb72e,_0x2e9b36){_0x2e9b36=_0x2e9b36||'';return this['sendRequest'](util['format'](_0xd75d('0x48'),_0x5eb72e,_0x2e9b36));};AGIChannel[_0xd75d('0x25')][_0xd75d('0x49')]=function(_0x4e52fd){return this['exec'](_0xd75d('0x4a'),_0x4e52fd);};AGIChannel[_0xd75d('0x25')][_0xd75d('0x4b')]=function(_0x4e9e01){return this['exec'](_0xd75d('0x4c'),_0x4e9e01);};AGIChannel[_0xd75d('0x25')][_0xd75d('0x1a')]=function(_0xbc8ef3,_0x39c139){this[_0xd75d('0x40')](util[_0xd75d('0x2b')](_0xd75d('0x4d'),_0xbc8ef3['id'],_0xbc8ef3[_0xd75d('0x4e')],_0x39c139));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xd75d('0x4f')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index f6c8a05..757638b 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 _0xe166=['Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','message','name','exports','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.'];(function(_0x5712bf,_0xa81c84){var _0x5704fa=function(_0x492f72){while(--_0x492f72){_0x5712bf['push'](_0x5712bf['shift']());}};_0x5704fa(++_0xa81c84);}(_0xe166,0xa6));var _0x6e16=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xe166[_0x6c993a];return _0x27f547;};'use strict';var util=require(_0x6e16('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0x6e16('0x1'),'E_AGI_SERVER_ERROR':_0x6e16('0x2'),'E_AGI_SERVER_CLOSE':_0x6e16('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x6e16('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x6e16('0x5'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x6e16('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x6e16('0x7'),'E_AGI_COMMAND_EMPTY':_0x6e16('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x6e16('0x9'),'E_AGI_IVR_ENTRY':_0x6e16('0xa')};function AGIError(_0x3ac544){var _0x3ac544=_0x3ac544||null,_0x26315d=_0x26315d||[],_0x222725=0x1,_0x1132c6='';if(!error[_0x3ac544]){_0x3ac544=_0x6e16('0xb');}_0x26315d[_0x6e16('0xc')](error[_0x3ac544]);while(arguments[_0x222725]){_0x26315d[_0x6e16('0xc')](arguments[_0x222725]);_0x222725++;}_0x1132c6=util['format']['apply'](util,_0x26315d);this[_0x6e16('0xd')]=_0x1132c6;this[_0x6e16('0xe')]=_0x3ac544;}module[_0x6e16('0xf')]=AGIError; \ No newline at end of file +var _0xe4b2=['Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','name','exports','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.'];(function(_0x2f1ff0,_0x227b6e){var _0x59beb2=function(_0x5acf7b){while(--_0x5acf7b){_0x2f1ff0['push'](_0x2f1ff0['shift']());}};_0x59beb2(++_0x227b6e);}(_0xe4b2,0x13e));var _0x2e4b=function(_0x458182,_0x377ad3){_0x458182=_0x458182-0x0;var _0x386ec4=_0xe4b2[_0x458182];return _0x386ec4;};'use strict';var util=require(_0x2e4b('0x0'));var error={'E_AGI_UNDEFINED':_0x2e4b('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x2e4b('0x2'),'E_AGI_SERVER_CLOSE':_0x2e4b('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x2e4b('0x4'),'E_AGI_SOCKET_ERROR':_0x2e4b('0x5'),'E_AGI_SOCKET_CLOSE':_0x2e4b('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x2e4b('0x7'),'E_AGI_COMMAND_EMPTY':_0x2e4b('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x2e4b('0x9'),'E_AGI_IVR_ENTRY':_0x2e4b('0xa')};function AGIError(_0x3f0c04){var _0x3f0c04=_0x3f0c04||null,_0x3a7b10=_0x3a7b10||[],_0x5ef817=0x1,_0x1c7559='';if(!error[_0x3f0c04]){_0x3f0c04=_0x2e4b('0xb');}_0x3a7b10['push'](error[_0x3f0c04]);while(arguments[_0x5ef817]){_0x3a7b10[_0x2e4b('0xc')](arguments[_0x5ef817]);_0x5ef817++;}_0x1c7559=util[_0x2e4b('0xd')][_0x2e4b('0xe')](util,_0x3a7b10);this[_0x2e4b('0xf')]=_0x1c7559;this[_0x2e4b('0x10')]=_0x3f0c04;}module[_0x2e4b('0x11')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 503f33e..35a1d66 100644 --- a/server/services/agi/events.js +++ b/server/services/agi/events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9e5d=['defaults','localhost','subscribe','agi','emit','error','E_AGI_SERVER_ERROR','parse','projectUpdate','lodash','events','ioredis','./error','redis'];(function(_0x4151db,_0x1ea37a){var _0x46f00e=function(_0x8666d3){while(--_0x8666d3){_0x4151db['push'](_0x4151db['shift']());}};_0x46f00e(++_0x1ea37a);}(_0x9e5d,0x113));var _0xd9e5=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x9e5d[_0x342baa];return _0x1208f3;};'use strict';var _=require(_0xd9e5('0x0'));var EventEmitter=require(_0xd9e5('0x1'))['EventEmitter'];var Redis=require(_0xd9e5('0x2'));var AGIError=require(_0xd9e5('0x3'));var config=require('../../config/environment');config[_0xd9e5('0x4')]=_[_0xd9e5('0x5')](config['redis'],{'host':_0xd9e5('0x6'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xd9e5('0x4')]);sub[_0xd9e5('0x7')](_0xd9e5('0x8'),function(_0x371eb0){if(_0x371eb0)return eventEmitter[_0xd9e5('0x9')](_0xd9e5('0xa'),new AGIError(_0xd9e5('0xb'),_0x371eb0));});sub['on']('message',function(_0x4dcc53,_0x3c24f1){if(_0x4dcc53!=='agi')return;try{var _0x13f737=JSON[_0xd9e5('0xc')](_0x3c24f1);eventEmitter[_0xd9e5('0x9')](_0xd9e5('0xd'),_0x13f737);}catch(_0x55bfdb){eventEmitter[_0xd9e5('0x9')](_0xd9e5('0xa'),new AGIError(_0xd9e5('0xb'),_0x55bfdb));}});module['exports']={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0xf206=['message','agi','parse','emit','projectUpdate','lodash','events','EventEmitter','ioredis','./error','../../config/environment','redis','localhost','subscribe','error','E_AGI_SERVER_ERROR'];(function(_0x98197,_0xea7356){var _0x5d9199=function(_0x135375){while(--_0x135375){_0x98197['push'](_0x98197['shift']());}};_0x5d9199(++_0xea7356);}(_0xf206,0x1a5));var _0x6f20=function(_0xb808bf,_0x5693ce){_0xb808bf=_0xb808bf-0x0;var _0x25e251=_0xf206[_0xb808bf];return _0x25e251;};'use strict';var _=require(_0x6f20('0x0'));var EventEmitter=require(_0x6f20('0x1'))[_0x6f20('0x2')];var Redis=require(_0x6f20('0x3'));var AGIError=require(_0x6f20('0x4'));var config=require(_0x6f20('0x5'));config[_0x6f20('0x6')]=_['defaults'](config[_0x6f20('0x6')],{'host':_0x6f20('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x6f20('0x6')]);sub[_0x6f20('0x8')]('agi',function(_0x48a0cf){if(_0x48a0cf)return eventEmitter['emit'](_0x6f20('0x9'),new AGIError(_0x6f20('0xa'),_0x48a0cf));});sub['on'](_0x6f20('0xb'),function(_0x35a026,_0x367e4e){if(_0x35a026!==_0x6f20('0xc'))return;try{var _0x8d52a3=JSON[_0x6f20('0xd')](_0x367e4e);eventEmitter[_0x6f20('0xe')](_0x6f20('0xf'),_0x8d52a3);}catch(_0x29ebb1){eventEmitter[_0x6f20('0xe')]('error',new AGIError(_0x6f20('0xa'),_0x29ebb1));}});module['exports']={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 4e657ec..d320849 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 _0x26aa=['exports','../../../config/logger','agi','menu','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','addEdge','push','size','getVertex','traverseBFS','no\x20vertex\x20found','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','vswitch','target','agicommand','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found'];(function(_0x1c30f2,_0xee0be8){var _0x9c37be=function(_0x38df4e){while(--_0x38df4e){_0x1c30f2['push'](_0x1c30f2['shift']());}};_0x9c37be(++_0xee0be8);}(_0x26aa,0x1ee));var _0xa26a=function(_0x1c49d5,_0x180bab){_0x1c49d5=_0x1c49d5-0x0;var _0xa2f5d3=_0x26aa[_0x1c49d5];return _0xa2f5d3;};'use strict';var _=require('lodash');var logger=require(_0xa26a('0x0'))(_0xa26a('0x1'));var verticesWithRetry=[_0xa26a('0x2'),_0xa26a('0x3'),_0xa26a('0x4')];var Graph=function(){this[_0xa26a('0x5')]={};this[_0xa26a('0x6')]={};this[_0xa26a('0x7')]=0x0;};Graph[_0xa26a('0x8')][_0xa26a('0x9')]=function(_0x5ace9f){this['vertices'][_0x5ace9f['id']]=_0x5ace9f;this[_0xa26a('0x6')][_0x5ace9f['id']]=[];};Graph['prototype'][_0xa26a('0xa')]=function(_0x237a16,_0xc3a6b7,_0x455c12){this[_0xa26a('0x6')][_0x237a16][_0xa26a('0xb')]({'target':_0xc3a6b7,'condition':_0x455c12});this['numberOfEdges']+=0x1;};Graph[_0xa26a('0x8')]['size']=function(){return _[_0xa26a('0xc')](this[_0xa26a('0x5')]);};Graph[_0xa26a('0x8')]['relations']=function(){return this[_0xa26a('0x7')];};Graph['prototype'][_0xa26a('0xd')]=function(_0xaa67c9){return this[_0xa26a('0x5')][_0xaa67c9];};Graph[_0xa26a('0x8')][_0xa26a('0xe')]=function(_0x49e97f,_0x1c96a2){if(!this[_0xa26a('0x5')][_0x49e97f]){return logger['info'](_0xa26a('0xf'));}var _0x56da5a=_0x1c96a2(this[_0xa26a('0x5')][_0x49e97f]);if(!_0x56da5a){return logger[_0xa26a('0x10')](_0xa26a('0x11'));}if(this['edges'][_0x49e97f][_0xa26a('0x12')]===0x0){return logger[_0xa26a('0x10')](_0xa26a('0x13'));}for(var _0x569798=0x0,_0x2f8dea=[],_0x285244=![];_0x569798\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','catch','hasOwnProperty','indexOf','agi_','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','hangup','find','handleNotFound','production','handleUnpublished','initialize','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','port','listening','connection','lodash','util','../../config/environment','../../config/license/util','./rpc','./project','./events','EventEmitter','agi','defaults','projectUpdate','nextTick','error','stack','deleted','splice','push','log','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message'];(function(_0x435839,_0x19af65){var _0x1add1d=function(_0x55d319){while(--_0x55d319){_0x435839['push'](_0x435839['shift']());}};_0x1add1d(++_0x19af65);}(_0xbb1c,0xa2));var _0xcbb1=function(_0x55ed53,_0x1c7f53){_0x55ed53=_0x55ed53-0x0;var _0x52b612=_0xbb1c[_0x55ed53];return _0x52b612;};'use strict';var _=require(_0xcbb1('0x0'));var syncho=require('syncho');var util=require(_0xcbb1('0x1'));var config=require(_0xcbb1('0x2'));var logger=require('../../config/logger')('agi');var utilLicense=require(_0xcbb1('0x3'));var rpc=require(_0xcbb1('0x4'));var Project=require(_0xcbb1('0x5'));var AGIEmitter=require(_0xcbb1('0x6'))[_0xcbb1('0x7')];var projects=[];config[_0xcbb1('0x8')]=_[_0xcbb1('0x9')](config['agi'],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on'](_0xcbb1('0xa'),projectUpdateHandler);function connectionHandler(_0x5a0d9c){process[_0xcbb1('0xb')](function(){syncho(function(){try{setChannelVariables(_0x5a0d9c);agiHandler(_0x5a0d9c);}catch(_0x173097){logger[_0xcbb1('0xc')](_0x173097[_0xcbb1('0xd')]);}});});}function projectUpdateHandler(_0x1da12d){try{var _0xc5f95f=_['findIndex'](projects,['id',_0x1da12d['id']]);if(_0xc5f95f>-0x1){if(_0x1da12d[_0xcbb1('0xe')]===!![]){projects[_0xcbb1('0xf')](_0xc5f95f,0x1);}else{projects[_0xc5f95f]=_0x1da12d;}}else{projects[_0xcbb1('0x10')](_0x1da12d);}}catch(_0x5d500c){logger['error'](_0x5d500c['stack']);}}function listeningHandler(){console[_0xcbb1('0x11')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config['agi']['port']);logger['info'](util[_0xcbb1('0x12')](_0xcbb1('0x13'),config['agi']['ip'],config[_0xcbb1('0x8')]['port']));}function errorHandler(_0x68342d){if(_0x68342d&&_0x68342d['name']&&_0x68342d[_0xcbb1('0x14')]){logger[_0xcbb1('0xc')](util[_0xcbb1('0x12')]('[%s]\x20%s',_0x68342d[_0xcbb1('0x15')],_0x68342d[_0xcbb1('0x14')]));}else{logger[_0xcbb1('0xc')](util[_0xcbb1('0x12')](_0xcbb1('0x16'),_0x68342d[_0xcbb1('0xd')]));}}function closeHandler(){logger[_0xcbb1('0x17')](util[_0xcbb1('0x12')](_0xcbb1('0x18'),this[_0xcbb1('0x19')],this[_0xcbb1('0x1a')],this[_0xcbb1('0x1b')],this[_0xcbb1('0x1c')],this['uniqueid']));try{createSquareReport(this);}catch(_0xe9c5a1){logger[_0xcbb1('0xc')](_0xe9c5a1[_0xcbb1('0xd')]);}}function timeoutHandler(){logger[_0xcbb1('0x17')](util[_0xcbb1('0x12')](_0xcbb1('0x1d'),this[_0xcbb1('0x19')],this[_0xcbb1('0x1a')],this[_0xcbb1('0x1b')],this[_0xcbb1('0x1c')],this[_0xcbb1('0x1e')]));}function hangupHandler(){logger['info'](util[_0xcbb1('0x12')](_0xcbb1('0x1f'),this[_0xcbb1('0x19')],this[_0xcbb1('0x1a')],this[_0xcbb1('0x1b')],this[_0xcbb1('0x1c')],this[_0xcbb1('0x1e')]));this[_0xcbb1('0x20')]=!![];}function createSquareReport(_0xccdafb,_0x29f761){rpc[_0xcbb1('0x21')](_0xccdafb)[_0xcbb1('0x22')](function(_0x536bab){if(_0x29f761){_0x29f761(null,_0x536bab);}})[_0xcbb1('0x23')](function(_0xcd253e){if(_0x29f761){_0x29f761(null,_0xcd253e);}});}function setChannelVariables(_0x484565){for(var _0x3a6ff7 in _0x484565){if(_0x484565[_0xcbb1('0x24')](_0x3a6ff7)){if(_0x3a6ff7[_0xcbb1('0x25')](_0xcbb1('0x26'))===0x0){_0x484565[_0x3a6ff7[_0xcbb1('0x27')](0x4)]=_0x484565[_0x3a6ff7];delete _0x484565[_0x3a6ff7];}}}}function agiHandler(_0x31973d){logger[_0xcbb1('0x28')](_0xcbb1('0x29'),JSON[_0xcbb1('0x2a')](_0x31973d,null,0x2));logger[_0xcbb1('0x17')](util[_0xcbb1('0x12')](_0xcbb1('0x2b'),_0x31973d[_0xcbb1('0x19')],_0x31973d[_0xcbb1('0x1a')],_0x31973d['callerid'],_0x31973d['dnid'],_0x31973d[_0xcbb1('0x1e')]));_0x31973d['on'](_0xcbb1('0xc'),errorHandler);_0x31973d['on'](_0xcbb1('0x2c'),closeHandler);_0x31973d['on']('timeout',timeoutHandler);_0x31973d[_0xcbb1('0x20')]=![];_0x31973d['on'](_0xcbb1('0x2d'),hangupHandler);var _0x7e3a42=_[_0xcbb1('0x2e')](projects,[_0xcbb1('0x15'),_0x31973d[_0xcbb1('0x19')]]);if(!_0x7e3a42)return Project[_0xcbb1('0x2f')](_0x31973d);if(!_0x7e3a42[_0xcbb1('0x30')])return Project[_0xcbb1('0x31')](_0x31973d);return Project[_0xcbb1('0x32')](_0x7e3a42,_0x31973d);}function main(){var _0x4638e6;return utilLicense[_0xcbb1('0x33')]()['then'](function(_0xcdd4a0){if(!_0xcdd4a0)return;if(_0xcdd4a0['voice']){if(_0xcdd4a0[_0xcbb1('0x34')]&&_0xcdd4a0[_0xcbb1('0x34')]>0x0){logger[_0xcbb1('0x17')](util['format'](_0xcbb1('0x35'),_0xcdd4a0[_0xcbb1('0x34')]));_0x4638e6=_0xcdd4a0['callysquare'];}else{logger['info'](_0xcbb1('0x36'));}}else{logger[_0xcbb1('0x17')](_0xcbb1('0x37'));_0x4638e6=-0x1;}})[_0xcbb1('0x22')](function(){return Project[_0xcbb1('0x38')]();})[_0xcbb1('0x22')](function(_0x2922bb){projects=_0x2922bb;return;})[_0xcbb1('0x23')](function(_0x2e5e0a){logger[_0xcbb1('0xc')](_0xcbb1('0x39'),_0x2e5e0a[_0xcbb1('0xd')]);})['finally'](function(){var _0x55ed5b=require('./server')(config['agi'][_0xcbb1('0x3a')],config[_0xcbb1('0x8')]['ip'],_0x4638e6);_0x55ed5b['on'](_0xcbb1('0xc'),errorHandler);_0x55ed5b['on'](_0xcbb1('0x3b'),listeningHandler);_0x55ed5b['on'](_0xcbb1('0x3c'),connectionHandler);_0x55ed5b['on'](_0xcbb1('0x2c'),closeHandler);});}main(); \ No newline at end of file +var _0x1765=['debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','find','handleNotFound','production','handleUnpublished','initialize','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','listening','connection','lodash','syncho','util','../../config/environment','../../config/logger','agi','./rpc','./project','./events','EventEmitter','defaults','127.0.0.1','error','stack','findIndex','deleted','splice','push','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','[%s]\x20%s','message','[ERROR]\x20%s','arg_1','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','catch','hasOwnProperty','indexOf'];(function(_0x195e10,_0x520045){var _0xfb3d8=function(_0x1aad38){while(--_0x1aad38){_0x195e10['push'](_0x195e10['shift']());}};_0xfb3d8(++_0x520045);}(_0x1765,0x142));var _0x5176=function(_0x4207f4,_0x1f778b){_0x4207f4=_0x4207f4-0x0;var _0x29a621=_0x1765[_0x4207f4];return _0x29a621;};'use strict';var _=require(_0x5176('0x0'));var syncho=require(_0x5176('0x1'));var util=require(_0x5176('0x2'));var config=require(_0x5176('0x3'));var logger=require(_0x5176('0x4'))(_0x5176('0x5'));var utilLicense=require('../../config/license/util');var rpc=require(_0x5176('0x6'));var Project=require(_0x5176('0x7'));var AGIEmitter=require(_0x5176('0x8'))[_0x5176('0x9')];var projects=[];config[_0x5176('0x5')]=_[_0x5176('0xa')](config['agi'],{'ip':_0x5176('0xb'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x550ffd){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x550ffd);agiHandler(_0x550ffd);}catch(_0x55d99e){logger[_0x5176('0xc')](_0x55d99e[_0x5176('0xd')]);}});});}function projectUpdateHandler(_0x5c8197){try{var _0xd5b8ef=_[_0x5176('0xe')](projects,['id',_0x5c8197['id']]);if(_0xd5b8ef>-0x1){if(_0x5c8197[_0x5176('0xf')]===!![]){projects[_0x5176('0x10')](_0xd5b8ef,0x1);}else{projects[_0xd5b8ef]=_0x5c8197;}}else{projects[_0x5176('0x11')](_0x5c8197);}}catch(_0x10b125){logger[_0x5176('0xc')](_0x10b125[_0x5176('0xd')]);}}function listeningHandler(){console['log']('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x5176('0x5')]['port']);logger[_0x5176('0x12')](util[_0x5176('0x13')](_0x5176('0x14'),config[_0x5176('0x5')]['ip'],config[_0x5176('0x5')][_0x5176('0x15')]));}function errorHandler(_0x6d96ad){if(_0x6d96ad&&_0x6d96ad[_0x5176('0x16')]&&_0x6d96ad['message']){logger['error'](util['format'](_0x5176('0x17'),_0x6d96ad[_0x5176('0x16')],_0x6d96ad[_0x5176('0x18')]));}else{logger['error'](util[_0x5176('0x13')](_0x5176('0x19'),_0x6d96ad[_0x5176('0xd')]));}}function closeHandler(){logger[_0x5176('0x12')](util[_0x5176('0x13')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x5176('0x1a')],this['calleridname'],this[_0x5176('0x1b')],this[_0x5176('0x1c')],this[_0x5176('0x1d')]));try{createSquareReport(this);}catch(_0x26e9d1){logger[_0x5176('0xc')](_0x26e9d1['stack']);}}function timeoutHandler(){logger[_0x5176('0x12')](util[_0x5176('0x13')](_0x5176('0x1e'),this[_0x5176('0x1a')],this[_0x5176('0x1f')],this[_0x5176('0x1b')],this[_0x5176('0x1c')],this[_0x5176('0x1d')]));}function hangupHandler(){logger[_0x5176('0x12')](util['format'](_0x5176('0x20'),this[_0x5176('0x1a')],this['calleridname'],this[_0x5176('0x1b')],this['dnid'],this['uniqueid']));this[_0x5176('0x21')]=!![];}function createSquareReport(_0x25d667,_0x465fe6){rpc[_0x5176('0x22')](_0x25d667)['then'](function(_0x1367db){if(_0x465fe6){_0x465fe6(null,_0x1367db);}})[_0x5176('0x23')](function(_0x5549b9){if(_0x465fe6){_0x465fe6(null,_0x5549b9);}});}function setChannelVariables(_0xf59c06){for(var _0x463a4a in _0xf59c06){if(_0xf59c06[_0x5176('0x24')](_0x463a4a)){if(_0x463a4a[_0x5176('0x25')]('agi_')===0x0){_0xf59c06[_0x463a4a['substring'](0x4)]=_0xf59c06[_0x463a4a];delete _0xf59c06[_0x463a4a];}}}}function agiHandler(_0x3e48a4){logger[_0x5176('0x26')](_0x5176('0x27'),JSON[_0x5176('0x28')](_0x3e48a4,null,0x2));logger[_0x5176('0x12')](util[_0x5176('0x13')](_0x5176('0x29'),_0x3e48a4[_0x5176('0x1a')],_0x3e48a4[_0x5176('0x1f')],_0x3e48a4[_0x5176('0x1b')],_0x3e48a4[_0x5176('0x1c')],_0x3e48a4[_0x5176('0x1d')]));_0x3e48a4['on'](_0x5176('0xc'),errorHandler);_0x3e48a4['on'](_0x5176('0x2a'),closeHandler);_0x3e48a4['on'](_0x5176('0x2b'),timeoutHandler);_0x3e48a4['evtHangup']=![];_0x3e48a4['on']('hangup',hangupHandler);var _0x54be65=_[_0x5176('0x2c')](projects,[_0x5176('0x16'),_0x3e48a4[_0x5176('0x1a')]]);if(!_0x54be65)return Project[_0x5176('0x2d')](_0x3e48a4);if(!_0x54be65[_0x5176('0x2e')])return Project[_0x5176('0x2f')](_0x3e48a4);return Project[_0x5176('0x30')](_0x54be65,_0x3e48a4);}function main(){var _0x5e1d3d;return utilLicense['getLicense']()[_0x5176('0x31')](function(_0x1dc1b8){if(!_0x1dc1b8)return;if(_0x1dc1b8[_0x5176('0x32')]){if(_0x1dc1b8[_0x5176('0x33')]&&_0x1dc1b8[_0x5176('0x33')]>0x0){logger[_0x5176('0x12')](util[_0x5176('0x13')](_0x5176('0x34'),_0x1dc1b8[_0x5176('0x33')]));_0x5e1d3d=_0x1dc1b8[_0x5176('0x33')];}else{logger[_0x5176('0x12')](_0x5176('0x35'));}}else{logger[_0x5176('0x12')](_0x5176('0x36'));_0x5e1d3d=-0x1;}})['then'](function(){return Project[_0x5176('0x37')]();})[_0x5176('0x31')](function(_0x5863e7){projects=_0x5863e7;return;})[_0x5176('0x23')](function(_0xf931dd){logger[_0x5176('0xc')](_0x5176('0x38'),_0xf931dd[_0x5176('0xd')]);})[_0x5176('0x39')](function(){var _0x47681d=require('./server')(config[_0x5176('0x5')][_0x5176('0x15')],config['agi']['ip'],_0x5e1d3d);_0x47681d['on']('error',errorHandler);_0x47681d['on'](_0x5176('0x3a'),listeningHandler);_0x47681d['on'](_0x5176('0x3b'),connectionHandler);_0x47681d['on'](_0x5176('0x2a'),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 139cb56..16a6c4a 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 _0xc9e8=['catch','sendMailMessage','SendMail','bluebird','client','http','request','then','error','message'];(function(_0x589b51,_0x55b2ac){var _0x3dbc4a=function(_0xb82e11){while(--_0xb82e11){_0x589b51['push'](_0x589b51['shift']());}};_0x3dbc4a(++_0x55b2ac);}(_0xc9e8,0xc1));var _0x8c9e=function(_0x5b04a3,_0xfda4fd){_0x5b04a3=_0x5b04a3-0x0;var _0x1adf11=_0xc9e8[_0x5b04a3];return _0x1adf11;};'use strict';var BPromise=require(_0x8c9e('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x8c9e('0x1')][_0x8c9e('0x2')]({'port':0x232b});function request(_0x2f155b,_0xc29aa9){return new BPromise(function(_0x3ed4d5,_0x1efa8c){return client[_0x8c9e('0x3')](_0x2f155b,_0xc29aa9)[_0x8c9e('0x4')](function(_0x1aa4f9){if(_0x1aa4f9[_0x8c9e('0x5')]){return _0x1efa8c(_0x1aa4f9['error'][_0x8c9e('0x6')]);}else{return _0x3ed4d5(_0x1aa4f9['result']);}})[_0x8c9e('0x7')](function(_0x3d761a){return _0x1efa8c(_0x3d761a);});});}exports[_0x8c9e('0x8')]=function(_0x20795b,_0x1b26fc){return request(_0x8c9e('0x9'),{'account':_0x20795b,'message':_0x1b26fc});}; \ No newline at end of file +var _0x105e=['error','message','result','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then'];(function(_0x34bf46,_0x25cbc4){var _0x401793=function(_0x40536c){while(--_0x40536c){_0x34bf46['push'](_0x34bf46['shift']());}};_0x401793(++_0x25cbc4);}(_0x105e,0xb5));var _0xe105=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x105e[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0xe105('0x0'));var jayson=require(_0xe105('0x1'));var client=jayson[_0xe105('0x2')][_0xe105('0x3')]({'port':0x232b});function request(_0x39fd8d,_0x3d108c){return new BPromise(function(_0xee9cf7,_0x4ce531){return client[_0xe105('0x4')](_0x39fd8d,_0x3d108c)[_0xe105('0x5')](function(_0x118750){if(_0x118750[_0xe105('0x6')]){return _0x4ce531(_0x118750[_0xe105('0x6')][_0xe105('0x7')]);}else{return _0xee9cf7(_0x118750[_0xe105('0x8')]);}})['catch'](function(_0x414a74){return _0x4ce531(_0x414a74);});});}exports[_0xe105('0x9')]=function(_0x268f0c,_0x55a1a0){return request(_0xe105('0xa'),{'account':_0x268f0c,'message':_0x55a1a0});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 5a56564..99d6a17 100644 --- a/server/services/agi/project.js +++ b/server/services/agi/project.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc67a=['priority','response','result','error','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','traverseBFS','isUndefined','toString','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','continueAt','lodash','moment','util','../../config/logger','agi','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','catch','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','retry','addVertex','mxCell','hasOwnProperty','isArray','length','source','addEdge','target','value','toJson','mxGraphModel','inspect','start','debug','root','stringify','YYYY-MM-DD\x20HH:mm:ss','omit','info','format','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension'];(function(_0x58ffc1,_0x2a3820){var _0x2239b1=function(_0xeeaf5b){while(--_0xeeaf5b){_0x58ffc1['push'](_0x58ffc1['shift']());}};_0x2239b1(++_0x2a3820);}(_0xc67a,0xcb));var _0xac67=function(_0x3715af,_0x47b82b){_0x3715af=_0x3715af-0x0;var _0x4fd267=_0xc67a[_0x3715af];return _0x4fd267;};'use strict';var _=require(_0xac67('0x0'));var moment=require(_0xac67('0x1'));var parser=require('xml2json');var util=require(_0xac67('0x2'));var logger=require(_0xac67('0x3'))(_0xac67('0x4'));var rpc=require(_0xac67('0x5'));var mailRpc=require(_0xac67('0x6'));var Graph=require(_0xac67('0x7'));var Vertices=require(_0xac67('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xac67('0x9')]()[_0xac67('0xa')](function(_0x4a789a){logger['error'](_0xac67('0xb'),_0x4a789a[_0xac67('0xc')]);return[];});}function addVertex(_0x261d5f,_0x16bb20,_0x493469){_0x16bb20[_0xac67('0xd')]=_0x493469;if(_0x16bb20['hasOwnProperty'](_0xac67('0xe'))){_0x16bb20['maxRetry']=parseInt(_0x16bb20[_0xac67('0xe')],0xa);}_0x261d5f[_0xac67('0xf')](_['omit'](_0x16bb20,_0xac67('0x10')));}function initGraph(_0x42e2ba,_0x42e05e){var _0x564f5c=new Graph();for(var _0x37995e in _0x42e2ba){if(_0x42e2ba[_0xac67('0x11')](_0x37995e)){if(_[_0xac67('0x12')](_0x42e2ba[_0x37995e])){for(var _0x376275=0x0;_0x376275<_0x42e2ba[_0x37995e]['length'];_0x376275+=0x1){addVertex(_0x564f5c,_0x42e2ba[_0x37995e][_0x376275],_0x37995e);}}else{addVertex(_0x564f5c,_0x42e2ba[_0x37995e],_0x37995e);}}}for(var _0x133385=0x0;_0x133385<_0x42e05e[_0xac67('0x13')];_0x133385+=0x1){if(_0x42e05e[_0x133385][_0xac67('0x14')]&&_0x42e05e[_0x133385]['target']){_0x564f5c[_0xac67('0x15')](_0x42e05e[_0x133385]['source'],_0x42e05e[_0x133385][_0xac67('0x16')],_0x42e05e[_0x133385][_0xac67('0x17')]);}}return _0x564f5c;}function getRoot(_0x228875){return parser[_0xac67('0x18')](_0x228875,{'object':!![]})[_0xac67('0x19')]['root'];}function inspect(_0xe5b92e){return util[_0xac67('0x1a')](_0xe5b92e,{'showHidden':![],'depth':null});}function initialize(_0x632c34,_0x8a620){var _0x14ff13=getRoot(_0x632c34['production']);if(!_0x14ff13||!_0x14ff13[_0xac67('0x1b')])return;var _0x1a2376,_0x147714,_0x11c172;logger[_0xac67('0x1c')](_0xac67('0x1d'),JSON[_0xac67('0x1e')](_0x14ff13,null,0x2));_0x8a620['joinAt']=moment()['format'](_0xac67('0x1f'));_0x1a2376=initGraph(_[_0xac67('0x20')](_0x14ff13,'mxCell'),_0x14ff13[_0xac67('0x10')]);_0x147714=new Vertices(_0x8a620,rpc,mailRpc);logger[_0xac67('0x21')](util[_0xac67('0x22')](_0xac67('0x23'),_0x8a620['arg_1'],_0x8a620[_0xac67('0x24')],_0x8a620[_0xac67('0x25')],_0x8a620[_0xac67('0x26')],_0x8a620['uniqueid']));_0x1a2376['traverseBFS'](_0x14ff13['start']['id'],function(_0x45f16c){try{_0x45f16c=_0x147714[_0xac67('0x27')](_0x45f16c);logger[_0xac67('0x1c')](_0xac67('0x28'),JSON[_0xac67('0x1e')](_0x45f16c,null,0x2));if(_0x45f16c[_0xac67('0xd')]===_0xac67('0x29')){logger[_0xac67('0x21')](_0xac67('0x2a'));_0x8a620['context']=_0x45f16c[_0xac67('0x2b')]||_0x8a620[_0xac67('0x2b')];_0x8a620[_0xac67('0x2c')]=_0x45f16c['extension'];_0x8a620[_0xac67('0x2d')]=_0x45f16c['priority']?_0x45f16c[_0xac67('0x2d')]-0x1:0x1;return null;}else if(_0x45f16c&&_0x147714[_0x45f16c[_0xac67('0xd')]]){_0x11c172=_0x147714[_0x45f16c[_0xac67('0xd')]](_0x45f16c);logger[_0xac67('0x21')](_0xac67('0x2e'),JSON[_0xac67('0x1e')](_0x11c172,null,0x2));if(_0x11c172&&_0x11c172['code']===AGI_CODE_SUCCESS&&_0x11c172[_0xac67('0x2f')]!==AGI_RESULT_ERROR&&!_0x8a620['evtHangup']){logger['debug'](_0xac67('0x2e'),inspect(_0x11c172));return _['isUndefined'](_0x11c172['result'])?null:_0x11c172[_0xac67('0x2f')]['toString']();}else{logger[_0xac67('0x30')](_0xac67('0x2e'),inspect(_0x11c172));return null;}}else{logger[_0xac67('0x30')](_0xac67('0x31'));return null;}}catch(_0x22e7f9){logger['error'](_0x22e7f9[_0xac67('0xc')]);return null;}});if(_0x14ff13[_0xac67('0x32')]){logger[_0xac67('0x21')](util[_0xac67('0x22')](_0xac67('0x33'),_0x8a620[_0xac67('0x34')],_0x8a620[_0xac67('0x24')],_0x8a620[_0xac67('0x25')],_0x8a620[_0xac67('0x26')],_0x8a620['uniqueid']));_0x1a2376[_0xac67('0x35')](_0x14ff13[_0xac67('0x32')]['id'],function(_0x2d271d){try{_0x2d271d=_0x147714['clear'](_0x2d271d);logger['debug'](_0xac67('0x28'),JSON['stringify'](_0x2d271d,null,0x2));if(_0x2d271d&&_0x147714[_0x2d271d['agicommand']]){_0x11c172=_0x147714[_0x2d271d['agicommand']](_0x2d271d);if(_0x11c172){logger[_0xac67('0x1c')](_0xac67('0x2e'),inspect(_0x11c172));return _[_0xac67('0x36')](_0x11c172['result'])?null:_0x11c172['result'][_0xac67('0x37')]();}else{logger[_0xac67('0x30')](_0xac67('0x2e'),inspect(_0x11c172));return null;}}else{logger[_0xac67('0x30')]('agicommand\x20not\x20found');return null;}}catch(_0x54a081){logger[_0xac67('0x30')](_0x54a081[_0xac67('0xc')]);return null;}});}logger['info'](util[_0xac67('0x22')](_0xac67('0x38'),_0x8a620[_0xac67('0x34')],_0x8a620[_0xac67('0x24')],_0x8a620[_0xac67('0x25')],_0x8a620[_0xac67('0x26')],_0x8a620[_0xac67('0x39')]));logger[_0xac67('0x21')](util['format']('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x8a620[_0xac67('0x2b')],_0x8a620['extension'],parseInt(_0x8a620['priority'],0xa)+0x1));_0x8a620['continueAt'](_0x8a620[_0xac67('0x2b')],_0x8a620['extension'],parseInt(_0x8a620[_0xac67('0x2d')],0xa)+0x1);_0x8a620[_0xac67('0x3a')]();}function handleNotFound(_0x411f54){logger['error'](util[_0xac67('0x22')](_0xac67('0x3b'),_0x411f54[_0xac67('0x34')]));_0x411f54['continueAt'](_0x411f54['context'],_0x411f54['extension'],parseInt(_0x411f54[_0xac67('0x2d')],0xa)+0x1);_0x411f54['close']();}function handleUnpublished(_0x520df1){logger['error'](util[_0xac67('0x22')](_0xac67('0x3c'),_0x520df1[_0xac67('0x34')]));_0x520df1[_0xac67('0x3d')](_0x520df1[_0xac67('0x2b')],_0x520df1[_0xac67('0x2c')],parseInt(_0x520df1['priority'],0xa)+0x1);_0x520df1[_0xac67('0x3a')]();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x9ebb=['response','code','result','evtHangup','isUndefined','toString','agicommand\x20not\x20found','stack','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','close','Project\x20%s\x20not\x20published','exports','lodash','xml2json','../../config/logger','agi','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','agicommand','hasOwnProperty','retry','maxRetry','addVertex','mxCell','isArray','length','source','target','value','toJson','inspect','root','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','omit','info','arg_1','calleridname','callerid','uniqueid','traverseBFS','clear','debug','vertex','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority'];(function(_0x32be82,_0x21b592){var _0x35aa04=function(_0x3d59ca){while(--_0x3d59ca){_0x32be82['push'](_0x32be82['shift']());}};_0x35aa04(++_0x21b592);}(_0x9ebb,0x100));var _0xb9eb=function(_0x81bb19,_0x207d0f){_0x81bb19=_0x81bb19-0x0;var _0x129773=_0x9ebb[_0x81bb19];return _0x129773;};'use strict';var _=require(_0xb9eb('0x0'));var moment=require('moment');var parser=require(_0xb9eb('0x1'));var util=require('util');var logger=require(_0xb9eb('0x2'))(_0xb9eb('0x3'));var rpc=require(_0xb9eb('0x4'));var mailRpc=require(_0xb9eb('0x5'));var Graph=require(_0xb9eb('0x6'));var Vertices=require(_0xb9eb('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xb9eb('0x8')]()[_0xb9eb('0x9')](function(_0x540549){logger[_0xb9eb('0xa')](_0xb9eb('0xb'),_0x540549['stack']);return[];});}function addVertex(_0x599885,_0x47f5e2,_0x3ab021){_0x47f5e2[_0xb9eb('0xc')]=_0x3ab021;if(_0x47f5e2[_0xb9eb('0xd')](_0xb9eb('0xe'))){_0x47f5e2[_0xb9eb('0xf')]=parseInt(_0x47f5e2[_0xb9eb('0xe')],0xa);}_0x599885[_0xb9eb('0x10')](_['omit'](_0x47f5e2,_0xb9eb('0x11')));}function initGraph(_0x39b833,_0x3f75a9){var _0x3ba3b7=new Graph();for(var _0x241bb2 in _0x39b833){if(_0x39b833['hasOwnProperty'](_0x241bb2)){if(_[_0xb9eb('0x12')](_0x39b833[_0x241bb2])){for(var _0x127e58=0x0;_0x127e58<_0x39b833[_0x241bb2][_0xb9eb('0x13')];_0x127e58+=0x1){addVertex(_0x3ba3b7,_0x39b833[_0x241bb2][_0x127e58],_0x241bb2);}}else{addVertex(_0x3ba3b7,_0x39b833[_0x241bb2],_0x241bb2);}}}for(var _0x2e7e93=0x0;_0x2e7e93<_0x3f75a9[_0xb9eb('0x13')];_0x2e7e93+=0x1){if(_0x3f75a9[_0x2e7e93][_0xb9eb('0x14')]&&_0x3f75a9[_0x2e7e93][_0xb9eb('0x15')]){_0x3ba3b7['addEdge'](_0x3f75a9[_0x2e7e93][_0xb9eb('0x14')],_0x3f75a9[_0x2e7e93][_0xb9eb('0x15')],_0x3f75a9[_0x2e7e93][_0xb9eb('0x16')]);}}return _0x3ba3b7;}function getRoot(_0x31ce74){return parser[_0xb9eb('0x17')](_0x31ce74,{'object':!![]})['mxGraphModel']['root'];}function inspect(_0x1216e0){return util[_0xb9eb('0x18')](_0x1216e0,{'showHidden':![],'depth':null});}function initialize(_0x5ea59c,_0x4cfcc2){var _0x309c6d=getRoot(_0x5ea59c['production']);if(!_0x309c6d||!_0x309c6d['start'])return;var _0x2f2799,_0x19a5dc,_0x1cd33c;logger['debug'](_0xb9eb('0x19'),JSON[_0xb9eb('0x1a')](_0x309c6d,null,0x2));_0x4cfcc2[_0xb9eb('0x1b')]=moment()[_0xb9eb('0x1c')](_0xb9eb('0x1d'));_0x2f2799=initGraph(_[_0xb9eb('0x1e')](_0x309c6d,_0xb9eb('0x11')),_0x309c6d[_0xb9eb('0x11')]);_0x19a5dc=new Vertices(_0x4cfcc2,rpc,mailRpc);logger[_0xb9eb('0x1f')](util[_0xb9eb('0x1c')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4cfcc2[_0xb9eb('0x20')],_0x4cfcc2[_0xb9eb('0x21')],_0x4cfcc2[_0xb9eb('0x22')],_0x4cfcc2['dnid'],_0x4cfcc2[_0xb9eb('0x23')]));_0x2f2799[_0xb9eb('0x24')](_0x309c6d['start']['id'],function(_0x433262){try{_0x433262=_0x19a5dc[_0xb9eb('0x25')](_0x433262);logger[_0xb9eb('0x26')](_0xb9eb('0x27'),JSON[_0xb9eb('0x1a')](_0x433262,null,0x2));if(_0x433262[_0xb9eb('0xc')]==='gotoc'){logger['info'](_0xb9eb('0x28'));_0x4cfcc2[_0xb9eb('0x29')]=_0x433262['context']||_0x4cfcc2['context'];_0x4cfcc2[_0xb9eb('0x2a')]=_0x433262['extension'];_0x4cfcc2[_0xb9eb('0x2b')]=_0x433262['priority']?_0x433262[_0xb9eb('0x2b')]-0x1:0x1;return null;}else if(_0x433262&&_0x19a5dc[_0x433262[_0xb9eb('0xc')]]){_0x1cd33c=_0x19a5dc[_0x433262[_0xb9eb('0xc')]](_0x433262);logger[_0xb9eb('0x1f')](_0xb9eb('0x2c'),JSON[_0xb9eb('0x1a')](_0x1cd33c,null,0x2));if(_0x1cd33c&&_0x1cd33c[_0xb9eb('0x2d')]===AGI_CODE_SUCCESS&&_0x1cd33c[_0xb9eb('0x2e')]!==AGI_RESULT_ERROR&&!_0x4cfcc2[_0xb9eb('0x2f')]){logger[_0xb9eb('0x26')]('response',inspect(_0x1cd33c));return _[_0xb9eb('0x30')](_0x1cd33c[_0xb9eb('0x2e')])?null:_0x1cd33c[_0xb9eb('0x2e')][_0xb9eb('0x31')]();}else{logger[_0xb9eb('0xa')](_0xb9eb('0x2c'),inspect(_0x1cd33c));return null;}}else{logger[_0xb9eb('0xa')](_0xb9eb('0x32'));return null;}}catch(_0x514f82){logger['error'](_0x514f82[_0xb9eb('0x33')]);return null;}});if(_0x309c6d[_0xb9eb('0x34')]){logger[_0xb9eb('0x1f')](util[_0xb9eb('0x1c')](_0xb9eb('0x35'),_0x4cfcc2[_0xb9eb('0x20')],_0x4cfcc2['calleridname'],_0x4cfcc2[_0xb9eb('0x22')],_0x4cfcc2[_0xb9eb('0x36')],_0x4cfcc2['uniqueid']));_0x2f2799['traverseBFS'](_0x309c6d[_0xb9eb('0x34')]['id'],function(_0x39447){try{_0x39447=_0x19a5dc[_0xb9eb('0x25')](_0x39447);logger[_0xb9eb('0x26')]('vertex',JSON[_0xb9eb('0x1a')](_0x39447,null,0x2));if(_0x39447&&_0x19a5dc[_0x39447['agicommand']]){_0x1cd33c=_0x19a5dc[_0x39447[_0xb9eb('0xc')]](_0x39447);if(_0x1cd33c){logger[_0xb9eb('0x26')](_0xb9eb('0x2c'),inspect(_0x1cd33c));return _[_0xb9eb('0x30')](_0x1cd33c['result'])?null:_0x1cd33c[_0xb9eb('0x2e')][_0xb9eb('0x31')]();}else{logger['error'](_0xb9eb('0x2c'),inspect(_0x1cd33c));return null;}}else{logger[_0xb9eb('0xa')](_0xb9eb('0x32'));return null;}}catch(_0x4660b5){logger[_0xb9eb('0xa')](_0x4660b5[_0xb9eb('0x33')]);return null;}});}logger['info'](util['format'](_0xb9eb('0x37'),_0x4cfcc2['arg_1'],_0x4cfcc2[_0xb9eb('0x21')],_0x4cfcc2[_0xb9eb('0x22')],_0x4cfcc2['dnid'],_0x4cfcc2[_0xb9eb('0x23')]));logger['info'](util[_0xb9eb('0x1c')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x4cfcc2['context'],_0x4cfcc2[_0xb9eb('0x2a')],parseInt(_0x4cfcc2[_0xb9eb('0x2b')],0xa)+0x1));_0x4cfcc2[_0xb9eb('0x38')](_0x4cfcc2[_0xb9eb('0x29')],_0x4cfcc2[_0xb9eb('0x2a')],parseInt(_0x4cfcc2[_0xb9eb('0x2b')],0xa)+0x1);_0x4cfcc2[_0xb9eb('0x39')]();}function handleNotFound(_0x1320d6){logger[_0xb9eb('0xa')](util[_0xb9eb('0x1c')]('Project\x20%s\x20not\x20found',_0x1320d6[_0xb9eb('0x20')]));_0x1320d6[_0xb9eb('0x38')](_0x1320d6[_0xb9eb('0x29')],_0x1320d6[_0xb9eb('0x2a')],parseInt(_0x1320d6[_0xb9eb('0x2b')],0xa)+0x1);_0x1320d6[_0xb9eb('0x39')]();}function handleUnpublished(_0x2d1b97){logger['error'](util[_0xb9eb('0x1c')](_0xb9eb('0x3a'),_0x2d1b97[_0xb9eb('0x20')]));_0x2d1b97[_0xb9eb('0x38')](_0x2d1b97[_0xb9eb('0x29')],_0x2d1b97[_0xb9eb('0x2a')],parseInt(_0x2d1b97['priority'],0xa)+0x1);_0x2d1b97[_0xb9eb('0x39')]();}module[_0xb9eb('0x3b')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 610b6fb..75e1d85 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 _0x0de3=['_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','substring','length','split','indexOf','trim','slice','exports','util','stream','call'];(function(_0x43cc51,_0x4362fd){var _0x3abf04=function(_0x5a1f00){while(--_0x5a1f00){_0x43cc51['push'](_0x43cc51['shift']());}};_0x3abf04(++_0x4362fd);}(_0x0de3,0x184));var _0x30de=function(_0x1dcc9b,_0x3ace4f){_0x1dcc9b=_0x1dcc9b-0x0;var _0x203c4f=_0x0de3[_0x1dcc9b];return _0x203c4f;};'use strict';var util=require(_0x30de('0x0'));var Transform=require(_0x30de('0x1'))['Transform'];function AGIReply(_0x243896){Transform[_0x30de('0x2')](this,_0x243896);this[_0x30de('0x3')]='';this[_0x30de('0x4')]=![];}util[_0x30de('0x5')](AGIReply,Transform);AGIReply[_0x30de('0x6')][_0x30de('0x7')]=function(_0xa44d71,_0x1687c4,_0x512874){var _0x55e5e9='\x0a',_0x281b9c=['\x0a\x0a',_0x30de('0x8')],_0x57975e=-0x1,_0x508d29=-0x1,_0x4c7de3='',_0x2761c2=0x0,_0x6c76c8='',_0xdccb9e='';this['_localBuffer']+=_0xa44d71[_0x30de('0x9')]();_0x6c76c8=this[_0x30de('0x3')];if(!this[_0x30de('0x4')]){_0x2761c2=0x0;while(_0x281b9c[_0x2761c2]){while((_0x508d29=_0x6c76c8['indexOf'](_0x281b9c[_0x2761c2]))!=-0x1){_0x4c7de3=_0x281b9c[_0x2761c2];_0xdccb9e=_0x6c76c8[_0x30de('0xa')](0x0,_0x508d29);_0x6c76c8=_0x6c76c8[_0x30de('0xa')](_0x508d29+_0x4c7de3[_0x30de('0xb')]);var _0x45520a=_0xdccb9e[_0x30de('0xc')](_0x55e5e9),_0x44f7dc=0x0,_0x1e65d1={},_0x3a5640='',_0xc34496='',_0x41e9d7=-0x1;while(_0x45520a[_0x44f7dc]){_0x41e9d7=_0x45520a[_0x44f7dc][_0x30de('0xd')](':');if(_0x41e9d7!=-0x1){_0x3a5640=_0x45520a[_0x44f7dc]['slice'](0x0,_0x41e9d7)[_0x30de('0xe')]();_0xc34496=_0x45520a[_0x44f7dc][_0x30de('0xf')](_0x41e9d7+0x1)[_0x30de('0xe')]();if(_0x3a5640[_0x30de('0xb')]>0x0){_0x1e65d1[_0x3a5640]=_0xc34496;}}else{}_0x44f7dc++;}this['emit']('headers',_0x1e65d1);this[_0x30de('0x4')]=!![];}_0x2761c2++;}this[_0x30de('0x3')]=_0x6c76c8;}else{while((_0x57975e=_0x6c76c8[_0x30de('0xd')](_0x55e5e9))!=-0x1){_0xdccb9e=_0x6c76c8['substring'](0x0,_0x57975e);this['emit']('line',_0xdccb9e);_0x6c76c8=_0x6c76c8[_0x30de('0xa')](_0x57975e+_0x55e5e9[_0x30de('0xb')]);}this['_localBuffer']=_0x6c76c8;}_0x512874();};module[_0x30de('0x10')]=AGIReply; \ No newline at end of file +var _0xd820=['length','slice','trim','emit','headers','_inBody','exports','util','stream','call','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring'];(function(_0x239137,_0x5e1e5f){var _0x1148c6=function(_0x90093){while(--_0x90093){_0x239137['push'](_0x239137['shift']());}};_0x1148c6(++_0x5e1e5f);}(_0xd820,0x16f));var _0x0d82=function(_0x33afcc,_0x283c67){_0x33afcc=_0x33afcc-0x0;var _0x13df92=_0xd820[_0x33afcc];return _0x13df92;};'use strict';var util=require(_0x0d82('0x0'));var Transform=require(_0x0d82('0x1'))['Transform'];function AGIReply(_0x1c5362){Transform[_0x0d82('0x2')](this,_0x1c5362);this['_localBuffer']='';this['_inBody']=![];}util[_0x0d82('0x3')](AGIReply,Transform);AGIReply[_0x0d82('0x4')][_0x0d82('0x5')]=function(_0x4f3d16,_0x5ac0ba,_0x429e30){var _0x1074d1='\x0a',_0x2b143e=['\x0a\x0a',_0x0d82('0x6')],_0x21c7a6=-0x1,_0x498585=-0x1,_0x36e7b4='',_0x7a3b8f=0x0,_0x56a3de='',_0x48a550='';this[_0x0d82('0x7')]+=_0x4f3d16[_0x0d82('0x8')]();_0x56a3de=this['_localBuffer'];if(!this['_inBody']){_0x7a3b8f=0x0;while(_0x2b143e[_0x7a3b8f]){while((_0x498585=_0x56a3de[_0x0d82('0x9')](_0x2b143e[_0x7a3b8f]))!=-0x1){_0x36e7b4=_0x2b143e[_0x7a3b8f];_0x48a550=_0x56a3de[_0x0d82('0xa')](0x0,_0x498585);_0x56a3de=_0x56a3de[_0x0d82('0xa')](_0x498585+_0x36e7b4[_0x0d82('0xb')]);var _0x130eda=_0x48a550['split'](_0x1074d1),_0x4f8cc1=0x0,_0x4b66e0={},_0x851dbc='',_0x7fdd7a='',_0x103e1d=-0x1;while(_0x130eda[_0x4f8cc1]){_0x103e1d=_0x130eda[_0x4f8cc1][_0x0d82('0x9')](':');if(_0x103e1d!=-0x1){_0x851dbc=_0x130eda[_0x4f8cc1][_0x0d82('0xc')](0x0,_0x103e1d)[_0x0d82('0xd')]();_0x7fdd7a=_0x130eda[_0x4f8cc1][_0x0d82('0xc')](_0x103e1d+0x1)[_0x0d82('0xd')]();if(_0x851dbc[_0x0d82('0xb')]>0x0){_0x4b66e0[_0x851dbc]=_0x7fdd7a;}}else{}_0x4f8cc1++;}this[_0x0d82('0xe')](_0x0d82('0xf'),_0x4b66e0);this[_0x0d82('0x10')]=!![];}_0x7a3b8f++;}this['_localBuffer']=_0x56a3de;}else{while((_0x21c7a6=_0x56a3de[_0x0d82('0x9')](_0x1074d1))!=-0x1){_0x48a550=_0x56a3de['substring'](0x0,_0x21c7a6);this[_0x0d82('0xe')]('line',_0x48a550);_0x56a3de=_0x56a3de[_0x0d82('0xa')](_0x21c7a6+_0x1074d1[_0x0d82('0xb')]);}this[_0x0d82('0x7')]=_0x56a3de;}_0x429e30();};module[_0x0d82('0x11')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 131f186..210e556 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 _0x782e=['createSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','jayson/promise','client','request','then','error','catch','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','getSquareProjectById','getVoiceQueueById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','ShowTrunk','save_name','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3c0016,_0xcff79){var _0x3ddf38=function(_0x41b3dc){while(--_0x41b3dc){_0x3c0016['push'](_0x3c0016['shift']());}};_0x3ddf38(++_0xcff79);}(_0x782e,0xb9));var _0xe782=function(_0x43985d,_0x363c98){_0x43985d=_0x43985d-0x0;var _0x390e29=_0x782e[_0x43985d];return _0x390e29;};'use strict';var _=require('lodash');var moment=require('moment');var jayson=require(_0xe782('0x0'));var client=jayson[_0xe782('0x1')]['http']({'port':0x2329});function request(_0x18c841,_0xe1b6db){return new Promise(function(_0x59020b,_0x26f960){return client[_0xe782('0x2')](_0x18c841,_0xe1b6db)[_0xe782('0x3')](function(_0x342a79){if(_0x342a79['error']){return _0x26f960(_0x342a79[_0xe782('0x4')]['message']);}else{return _0x59020b(_0x342a79['result']);}})[_0xe782('0x5')](function(_0x4c6dd1){return _0x26f960(_0x4c6dd1);});});}exports[_0xe782('0x6')]=function(){return request(_0xe782('0x7'),{'options':{'raw':![],'attributes':['id',_0xe782('0x8'),_0xe782('0x9')]}});};exports[_0xe782('0xa')]=function(_0x28dd87){return request(_0xe782('0xb'),{'options':{'raw':![],'where':{'name':_0x28dd87},'attributes':[_0xe782('0x9')]}});};exports[_0xe782('0xc')]=function(_0xec300d){return request(_0xe782('0xd'),{'options':{'raw':![],'where':{'id':_0xec300d},'include':[{'model':_0xe782('0xe'),'as':_0xe782('0xf'),'include':[{'model':_0xe782('0x10'),'as':'CloudProvider'}]}],'attributes':['id',_0xe782('0x8'),'email'],'smtp':!![]}});};exports[_0xe782('0x11')]=function(_0x356c18){return request(_0xe782('0xb'),{'options':{'where':{'id':_0x356c18},'attributes':[_0xe782('0x8')]}});};exports[_0xe782('0x12')]=function(_0xd57d73){return request('ShowVoiceQueue',{'options':{'where':{'id':_0xd57d73},'attributes':['name']}});};exports['getVariableById']=function(_0x15d85b){return request(_0xe782('0x13'),{'options':{'where':{'id':_0x15d85b},'attributes':['name']}});};exports[_0xe782('0x14')]=function(_0x35170a){return request(_0xe782('0x15'),{'options':{'where':{'id':_0x35170a},'attributes':[_0xe782('0x16')]}});};exports[_0xe782('0x17')]=function(_0x35fef7){return request(_0xe782('0x18'),{'options':{'where':{'id':_0x35fef7},'attributes':[_0xe782('0x8')]}});};exports[_0xe782('0x19')]=function(_0xeaf07c){return request(_0xe782('0x1a'),{'options':{'where':{'phone':_0xeaf07c[_0xe782('0x1b')]},'attributes':['id']}});};exports['getTrunkById']=function(_0xf1b118){return request(_0xe782('0x1c'),{'options':{'where':{'id':_0xf1b118},'attributes':[_0xe782('0x8')]}});};exports['getSoundById']=function(_0xa469c6){return request('ShowSound',{'options':{'where':{'id':_0xa469c6},'attributes':[_0xe782('0x1d')]}});};exports['getIntervalById']=function(_0x3f8684){return request(_0xe782('0x1e'),{'options':{'raw':![],'where':{'id':_0x3f8684},'include':[{'model':_0xe782('0x1f'),'as':'Intervals'}]}});};exports[_0xe782('0x20')]=function(_0x2f9335){return request(_0xe782('0x21'),{'options':{'where':{'id':_0x2f9335},'attributes':['id',_0xe782('0x8')]}});};exports['createSmsMessage']=function(_0x657761){return request('CreateSmsMessage',{'body':_0x657761});};exports[_0xe782('0x22')]=function(_0x2331c8){return request(_0xe782('0x23'),{'body':_0x2331c8});};exports[_0xe782('0x24')]=function(_0x382c9c){return request(_0xe782('0x25'),{'body':_[_0xe782('0x26')](_0x382c9c,{'project_name':_0x382c9c[_0xe782('0x27')],'prev_project_name':_0x382c9c[_0xe782('0x28')]||'','is_subproject':_0x382c9c[_0xe782('0x28')]?!![]:![],'leaveAt':moment()[_0xe782('0x29')](_0xe782('0x2a'))})});};exports[_0xe782('0x2b')]=function(_0x2502e9){return request('CreateSquareRecording',{'body':_0x2502e9});};exports[_0xe782('0x2c')]=function(_0x359745){return request(_0xe782('0x2d'),{'body':_0x359745});};exports['createCmContact']=function(_0x49073f){return request(_0xe782('0x2e'),{'options':{'raw':![],'where':{'phone':_0x49073f['phone'],'ListId':_0x49073f['ListId']}}})[_0xe782('0x3')](function(_0x3e9125){if(_0x3e9125){return _0x3e9125;}return request('CreateCmContact',{'body':_0x49073f});});};exports[_0xe782('0x2f')]=function(_0x14bf9c){return request(_0xe782('0x30'),{'options':{'where':{'id':_0x14bf9c},'attributes':[_0xe782('0x8')]}});};exports[_0xe782('0x31')]=function(_0x3d9b57,_0xfa2d2f){return request(_0xe782('0x32'),{'body':{'interface':_0xfa2d2f},'options':{'where':_0x3d9b57}});};exports[_0xe782('0x33')]=function(_0x18f608,_0x453614,_0x422b7b){return request(_0xe782('0x34'),{'body':{'type':_0x453614,'uniqueid':_0x422b7b},'options':{'where':_0x18f608}});};exports[_0xe782('0x35')]=function(_0xa21026){return request(_0xe782('0x36'),{'body':{},'options':{'where':_0xa21026}});};exports[_0xe782('0x37')]=function(_0x36bada){return request(_0xe782('0x38'),{'body':{},'options':{'where':_0x36bada}});}; \ No newline at end of file +var _0x303a=['request','then','error','message','result','GetSquareProjects','name','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','getTrunkById','ShowTrunk','getSoundById','ShowSound','getIntervalById','ShowInterval','Interval','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','CreateSquareMessage','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','LogoutUser','lodash','jayson/promise','client','http'];(function(_0x492cb9,_0x29c651){var _0x429da3=function(_0x175cab){while(--_0x175cab){_0x492cb9['push'](_0x492cb9['shift']());}};_0x429da3(++_0x29c651);}(_0x303a,0x1a0));var _0xa303=function(_0xd3bc07,_0x3a11a5){_0xd3bc07=_0xd3bc07-0x0;var _0x10aa85=_0x303a[_0xd3bc07];return _0x10aa85;};'use strict';var _=require(_0xa303('0x0'));var moment=require('moment');var jayson=require(_0xa303('0x1'));var client=jayson[_0xa303('0x2')][_0xa303('0x3')]({'port':0x2329});function request(_0x19d27a,_0x594b49){return new Promise(function(_0x46c56b,_0x26b47c){return client[_0xa303('0x4')](_0x19d27a,_0x594b49)[_0xa303('0x5')](function(_0x1c7fa3){if(_0x1c7fa3[_0xa303('0x6')]){return _0x26b47c(_0x1c7fa3[_0xa303('0x6')][_0xa303('0x7')]);}else{return _0x46c56b(_0x1c7fa3[_0xa303('0x8')]);}})['catch'](function(_0x51e1ee){return _0x26b47c(_0x51e1ee);});});}exports['getSquareProjects']=function(){return request(_0xa303('0x9'),{'options':{'raw':![],'attributes':['id',_0xa303('0xa'),'production']}});};exports[_0xa303('0xb')]=function(_0x51acca){return request(_0xa303('0xc'),{'options':{'raw':![],'where':{'name':_0x51acca},'attributes':['production']}});};exports[_0xa303('0xd')]=function(_0x17dfcd){return request(_0xa303('0xe'),{'options':{'raw':![],'where':{'id':_0x17dfcd},'include':[{'model':_0xa303('0xf'),'as':'Smtp','include':[{'model':_0xa303('0x10'),'as':'CloudProvider'}]}],'attributes':['id',_0xa303('0xa'),_0xa303('0x11')],'smtp':!![]}});};exports[_0xa303('0x12')]=function(_0x5b530d){return request(_0xa303('0xc'),{'options':{'where':{'id':_0x5b530d},'attributes':[_0xa303('0xa')]}});};exports[_0xa303('0x13')]=function(_0xfa522c){return request(_0xa303('0x14'),{'options':{'where':{'id':_0xfa522c},'attributes':[_0xa303('0xa')]}});};exports[_0xa303('0x15')]=function(_0x2d1110){return request('ShowVariable',{'options':{'where':{'id':_0x2d1110},'attributes':[_0xa303('0xa')]}});};exports[_0xa303('0x16')]=function(_0x1f3ede){return request(_0xa303('0x17'),{'options':{'where':{'id':_0x1f3ede},'attributes':[_0xa303('0x18')]}});};exports[_0xa303('0x19')]=function(_0x5ec243){return request(_0xa303('0x1a'),{'options':{'where':{'id':_0x5ec243},'attributes':['name']}});};exports[_0xa303('0x1b')]=function(_0x4cf535){return request(_0xa303('0x1c'),{'options':{'where':{'phone':_0x4cf535['phone']},'attributes':['id']}});};exports[_0xa303('0x1d')]=function(_0xe263f9){return request(_0xa303('0x1e'),{'options':{'where':{'id':_0xe263f9},'attributes':['name']}});};exports[_0xa303('0x1f')]=function(_0x188cb6){return request(_0xa303('0x20'),{'options':{'where':{'id':_0x188cb6},'attributes':['save_name']}});};exports[_0xa303('0x21')]=function(_0x3bc8c3){return request(_0xa303('0x22'),{'options':{'raw':![],'where':{'id':_0x3bc8c3},'include':[{'model':_0xa303('0x23'),'as':'Intervals'}]}});};exports[_0xa303('0x24')]=function(_0x2a2512){return request('ShowSmsAccount',{'options':{'where':{'id':_0x2a2512},'attributes':['id',_0xa303('0xa')]}});};exports[_0xa303('0x25')]=function(_0x25db9c){return request(_0xa303('0x26'),{'body':_0x25db9c});};exports[_0xa303('0x27')]=function(_0x577ea7){return request(_0xa303('0x28'),{'body':_0x577ea7});};exports[_0xa303('0x29')]=function(_0x35d287){return request('CreateSquareReport',{'body':_['merge'](_0x35d287,{'project_name':_0x35d287['arg_1'],'prev_project_name':_0x35d287['arg_2']||'','is_subproject':_0x35d287['arg_2']?!![]:![],'leaveAt':moment()[_0xa303('0x2a')](_0xa303('0x2b'))})});};exports[_0xa303('0x2c')]=function(_0xbb93f0){return request(_0xa303('0x2d'),{'body':_0xbb93f0});};exports['createSquareMessage']=function(_0x2d1341){return request(_0xa303('0x2e'),{'body':_0x2d1341});};exports['createCmContact']=function(_0x221f59){return request(_0xa303('0x2f'),{'options':{'raw':![],'where':{'phone':_0x221f59[_0xa303('0x30')],'ListId':_0x221f59[_0xa303('0x31')]}}})[_0xa303('0x5')](function(_0x221007){if(_0x221007){return _0x221007;}return request(_0xa303('0x32'),{'body':_0x221f59});});};exports[_0xa303('0x33')]=function(_0x411b42){return request(_0xa303('0x34'),{'options':{'where':{'id':_0x411b42},'attributes':[_0xa303('0xa')]}});};exports[_0xa303('0x35')]=function(_0x2f7775,_0x1a44fc){return request(_0xa303('0x36'),{'body':{'interface':_0x1a44fc},'options':{'where':_0x2f7775}});};exports[_0xa303('0x37')]=function(_0x228ae7,_0x5de180,_0x485c08){return request(_0xa303('0x38'),{'body':{'type':_0x5de180,'uniqueid':_0x485c08},'options':{'where':_0x228ae7}});};exports[_0xa303('0x39')]=function(_0xa69c59){return request(_0xa303('0x3a'),{'body':{},'options':{'where':_0xa69c59}});};exports['agentLogout']=function(_0x265550){return request(_0xa303('0x3b'),{'body':{},'options':{'where':_0x265550}});}; \ 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 90e4d34..021cc92 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 _0x9865=['exports','./polly','./lex'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x9865,0x1ba));var _0x5986=function(_0x3d7cd5,_0x57cc20){_0x3d7cd5=_0x3d7cd5-0x0;var _0x5f0a05=_0x9865[_0x3d7cd5];return _0x5f0a05;};var polly=require(_0x5986('0x0'));var lex=require(_0x5986('0x1'));module[_0x5986('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x00cd=['exports','./polly','./lex'];(function(_0x3f51b3,_0x44776c){var _0x80e74e=function(_0x52c585){while(--_0x52c585){_0x3f51b3['push'](_0x3f51b3['shift']());}};_0x80e74e(++_0x44776c);}(_0x00cd,0xee));var _0xd00c=function(_0x555069,_0x23d66a){_0x555069=_0x555069-0x0;var _0x100af7=_0x00cd[_0x555069];return _0x100af7;};var polly=require(_0xd00c('0x0'));var lex=require(_0xd00c('0x1'));module[_0xd00c('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 5bbb95e..0f76e27 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 _0x9c00=['./lib/api','exports'];(function(_0x3a3d96,_0x3ef34b){var _0xc8ad0b=function(_0x3249e5){while(--_0x3249e5){_0x3a3d96['push'](_0x3a3d96['shift']());}};_0xc8ad0b(++_0x3ef34b);}(_0x9c00,0x1a0));var _0x09c0=function(_0x4d8744,_0x203345){_0x4d8744=_0x4d8744-0x0;var _0x17fb37=_0x9c00[_0x4d8744];return _0x17fb37;};'use strict';var lex=require(_0x09c0('0x0'));module[_0x09c0('0x1')]=function(_0x4dff21,_0x5e32e7,_0xe0d293,_0x8c9907,_0x5d1967,_0x220c0c){return lex(_0x4dff21,_0x5e32e7,_0xe0d293,_0x8c9907,_0x5d1967,_0x220c0c);}; \ No newline at end of file +var _0x41bb=['exports','./lib/api'];(function(_0x532dd2,_0x14775a){var _0x2e0391=function(_0x1ec65a){while(--_0x1ec65a){_0x532dd2['push'](_0x532dd2['shift']());}};_0x2e0391(++_0x14775a);}(_0x41bb,0xc5));var _0xb41b=function(_0x1243cb,_0x4a132f){_0x1243cb=_0x1243cb-0x0;var _0x18f7cb=_0x41bb[_0x1243cb];return _0x18f7cb;};'use strict';var lex=require(_0xb41b('0x0'));module[_0xb41b('0x1')]=function(_0x4ef2f1,_0x428431,_0x4d5578,_0x30ea75,_0x1c9d36,_0x148333){return lex(_0x4ef2f1,_0x428431,_0x4d5578,_0x30ea75,_0x1c9d36,_0x148333);}; \ 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 223b1bd..3594688 100644 --- a/server/services/agi/scripts/aws/lex/lib/api.js +++ b/server/services/agi/scripts/aws/lex/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x420569,_0x57514f){var _0x5d42dd=function(_0x515de9){while(--_0x515de9){_0x420569['push'](_0x420569['shift']());}};_0x5d42dd(++_0x57514f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file +var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x3bcce0,_0x2cc896){var _0x4c21fd=function(_0x46c165){while(--_0x46c165){_0x3bcce0['push'](_0x3bcce0['shift']());}};_0x4c21fd(++_0x2cc896);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/polly/index.js b/server/services/agi/scripts/aws/polly/index.js index 75487ed..a541295 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 _0xb161=['./lib/api','exports'];(function(_0x1ac5de,_0x30e86f){var _0x4ec5b8=function(_0x594087){while(--_0x594087){_0x1ac5de['push'](_0x1ac5de['shift']());}};_0x4ec5b8(++_0x30e86f);}(_0xb161,0x8e));var _0x1b16=function(_0x4ded65,_0xc8d7c1){_0x4ded65=_0x4ded65-0x0;var _0x5864fb=_0xb161[_0x4ded65];return _0x5864fb;};'use strict';var polly=require(_0x1b16('0x0'));module[_0x1b16('0x1')]=function(_0x38753e,_0x4591e9,_0x3efb8d,_0xd2e56d,_0x179d30,_0x518cbc,_0x59a531){return polly(_0x38753e,_0x4591e9,_0x3efb8d,_0xd2e56d,_0x179d30,_0x518cbc,_0x59a531);}; \ No newline at end of file +var _0x1a1a=['./lib/api','exports'];(function(_0x30a457,_0x2aa6b5){var _0x2ae5cd=function(_0x1181e6){while(--_0x1181e6){_0x30a457['push'](_0x30a457['shift']());}};_0x2ae5cd(++_0x2aa6b5);}(_0x1a1a,0x6c));var _0xa1a1=function(_0x425e54,_0xa79df3){_0x425e54=_0x425e54-0x0;var _0x194093=_0x1a1a[_0x425e54];return _0x194093;};'use strict';var polly=require(_0xa1a1('0x0'));module[_0xa1a1('0x1')]=function(_0x34371e,_0x353995,_0x4a49e8,_0x8d11a1,_0x43fabb,_0x31fe9e,_0x4c70b3){return polly(_0x34371e,_0x353995,_0x4a49e8,_0x8d11a1,_0x43fabb,_0x31fe9e,_0x4c70b3);}; \ 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 3ebaba3..dbd0cad 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 _0x3d7a=['text','mp3','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly'];(function(_0x4f5761,_0x1e899f){var _0x1112bc=function(_0x156beb){while(--_0x156beb){_0x4f5761['push'](_0x4f5761['shift']());}};_0x1112bc(++_0x1e899f);}(_0x3d7a,0xf0));var _0xa3d7=function(_0x252328,_0x4c22f0){_0x252328=_0x252328-0x0;var _0xaa85b7=_0x3d7a[_0x252328];return _0xaa85b7;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require('bluebird');var rs=require('randomstring');var AWS=require('aws-sdk');function pollyResult(_0x146267,_0x474834,_0x1fa723){return new BPromise(function(_0x1868ab,_0x1b3e2e){_0x146267[_0xa3d7('0x0')](_0x474834,function(_0x250b7d,_0x5cd1f8){if(_0x250b7d){_0x1b3e2e(_0x250b7d);}else if(_0x5cd1f8){if(_0x5cd1f8[_0xa3d7('0x1')]instanceof Buffer){fs['writeFile'](_0x1fa723,_0x5cd1f8[_0xa3d7('0x1')],function(_0x20f54d){if(_0x20f54d){_0x1b3e2e(_0x20f54d);}else{_0x1868ab();}});}else{_0x1b3e2e(new Error(_0xa3d7('0x2')));}}else{_0x1b3e2e(new Error(_0xa3d7('0x3')));}});});}module['exports']=function(_0x278009,_0x6af94c,_0x4e007c,_0x535d38,_0x5ba219,_0x572302,_0x4fcc43){var _0x6086b8=new AWS[(_0xa3d7('0x4'))]({'accessKeyId':_0x278009,'secretAccessKey':_0x6af94c,'region':_0x4e007c});var _0x31cc2b={'Text':_0x5ba219,'TextType':_0x572302||_0xa3d7('0x5'),'OutputFormat':_0xa3d7('0x6'),'VoiceId':_0x535d38};return pollyResult(_0x6086b8,_0x31cc2b,_0x4fcc43);}; \ No newline at end of file +var _0xc76a=['randomstring','aws-sdk','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','path'];(function(_0x1d0559,_0x140cb5){var _0x160fd0=function(_0x367332){while(--_0x367332){_0x1d0559['push'](_0x1d0559['shift']());}};_0x160fd0(++_0x140cb5);}(_0xc76a,0xbd));var _0xac76=function(_0x1e5d6f,_0x97b732){_0x1e5d6f=_0x1e5d6f-0x0;var _0x2e8119=_0xc76a[_0x1e5d6f];return _0x2e8119;};'use strict';var fs=require('fs');var path=require(_0xac76('0x0'));var BPromise=require('bluebird');var rs=require(_0xac76('0x1'));var AWS=require(_0xac76('0x2'));function pollyResult(_0x158e18,_0xeaa29,_0x50f43e){return new BPromise(function(_0xc68989,_0x293c26){_0x158e18['synthesizeSpeech'](_0xeaa29,function(_0x1c0d05,_0x1e8b16){if(_0x1c0d05){_0x293c26(_0x1c0d05);}else if(_0x1e8b16){if(_0x1e8b16[_0xac76('0x3')]instanceof Buffer){fs[_0xac76('0x4')](_0x50f43e,_0x1e8b16['AudioStream'],function(_0x5e8d4c){if(_0x5e8d4c){_0x293c26(_0x5e8d4c);}else{_0xc68989();}});}else{_0x293c26(new Error(_0xac76('0x5')));}}else{_0x293c26(new Error(_0xac76('0x6')));}});});}module[_0xac76('0x7')]=function(_0x25c290,_0xcdd941,_0x4719cc,_0x141f1d,_0x408b11,_0x3270fc,_0x501e1d){var _0x37f70c=new AWS[(_0xac76('0x8'))]({'accessKeyId':_0x25c290,'secretAccessKey':_0xcdd941,'region':_0x4719cc});var _0x35ff09={'Text':_0x408b11,'TextType':_0x3270fc||_0xac76('0x9'),'OutputFormat':'mp3','VoiceId':_0x141f1d};return pollyResult(_0x37f70c,_0x35ff09,_0x501e1d);}; \ 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 8aa2397..54fa2cc 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 _0x069b=['exports','./lib/api'];(function(_0x27e56c,_0x989600){var _0x6fe8f3=function(_0x2a64ac){while(--_0x2a64ac){_0x27e56c['push'](_0x27e56c['shift']());}};_0x6fe8f3(++_0x989600);}(_0x069b,0x9b));var _0xb069=function(_0x2cee58,_0x18d876){_0x2cee58=_0x2cee58-0x0;var _0x1d17e2=_0x069b[_0x2cee58];return _0x1d17e2;};'use strict';var asr=require(_0xb069('0x0'));module[_0xb069('0x1')]=function(_0x338e26,_0x4dcca3,_0x4e0922,_0x28eb35){return asr(_0x338e26,_0x4dcca3,_0x4e0922);}; \ No newline at end of file +var _0x3907=['exports','./lib/api'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0x3907,0x79));var _0x7390=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x3907[_0x543084];return _0x306a57;};'use strict';var asr=require(_0x7390('0x0'));module[_0x7390('0x1')]=function(_0x2e618c,_0x5b05da,_0x52f9e4,_0x2070eb){return asr(_0x2e618c,_0x5b05da,_0x52f9e4);}; \ 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 6b3dd5f..bb9c23d 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 _0x5ff3=['filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','base64','POST','/v1/speech:recognize?key=','bluebird','exports','string','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ff3,0x17d));var _0x35ff=function(_0x426db8,_0x5ddf70){_0x426db8=_0x426db8-0x0;var _0x310d29=_0x5ff3[_0x426db8];return _0x310d29;};'use strict';var url=require('url');var BPromise=require(_0x35ff('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x35ff('0x1')]=function(_0x47c98d,_0x380f54,_0x1bb200){return new BPromise(function(_0x3bd66a,_0xd0846d){var _0x551514;if(typeof _0x47c98d!==_0x35ff('0x2')||_0x47c98d[_0x35ff('0x3')]===0x0){return _0xd0846d(_0x35ff('0x4'));}if(typeof _0x380f54!==_0x35ff('0x2')||_0x380f54[_0x35ff('0x3')]===0x0){return _0xd0846d('key\x20should\x20be\x20a\x20string');}if(typeof _0x1bb200!==_0x35ff('0x5')&&(typeof _0x1bb200!=='string'||_0x1bb200[_0x35ff('0x3')]===0x0)){return _0xd0846d(_0x35ff('0x6'));}try{_0x551514=fs[_0x35ff('0x7')](_0x47c98d)['toString'](_0x35ff('0x8'));}catch(_0x59ec4f){return _0xd0846d(_0x59ec4f);}return _0x3bd66a({'method':_0x35ff('0x9'),'uri':host+_0x35ff('0xa')+_0x380f54,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':'8000','languageCode':_0x1bb200},'audio':{'content':_0x551514}},'json':!![]});});}; \ No newline at end of file +var _0x94dc=['undefined','lang\x20should\x20be\x20a\x20string','readFileSync','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','https://speech.googleapis.com','string','length','filepath\x20should\x20be\x20a\x20string'];(function(_0x2e2e77,_0x25456d){var _0x583d06=function(_0x4422a2){while(--_0x4422a2){_0x2e2e77['push'](_0x2e2e77['shift']());}};_0x583d06(++_0x25456d);}(_0x94dc,0xb1));var _0xc94d=function(_0xac0602,_0x276864){_0xac0602=_0xac0602-0x0;var _0x4bde01=_0x94dc[_0xac0602];return _0x4bde01;};'use strict';var url=require(_0xc94d('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0xc94d('0x1');module['exports']=function(_0x1645b0,_0x1b2070,_0x40e7d8){return new BPromise(function(_0x4b2dcc,_0x306706){var _0x41d4ec;if(typeof _0x1645b0!==_0xc94d('0x2')||_0x1645b0[_0xc94d('0x3')]===0x0){return _0x306706(_0xc94d('0x4'));}if(typeof _0x1b2070!==_0xc94d('0x2')||_0x1b2070[_0xc94d('0x3')]===0x0){return _0x306706('key\x20should\x20be\x20a\x20string');}if(typeof _0x40e7d8!==_0xc94d('0x5')&&(typeof _0x40e7d8!==_0xc94d('0x2')||_0x40e7d8[_0xc94d('0x3')]===0x0)){return _0x306706(_0xc94d('0x6'));}try{_0x41d4ec=fs[_0xc94d('0x7')](_0x1645b0)['toString'](_0xc94d('0x8'));}catch(_0x13096c){return _0x306706(_0x13096c);}return _0x4b2dcc({'method':_0xc94d('0x9'),'uri':host+_0xc94d('0xa')+_0x1b2070,'body':{'config':{'encoding':_0xc94d('0xb'),'sampleRateHertz':_0xc94d('0xc'),'languageCode':_0x40e7d8},'audio':{'content':_0x41d4ec}},'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 f0ea830..a4301ee 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 _0x50b7=['exports','./asr'];(function(_0x5dbecf,_0x502128){var _0x3ce749=function(_0x1e968e){while(--_0x1e968e){_0x5dbecf['push'](_0x5dbecf['shift']());}};_0x3ce749(++_0x502128);}(_0x50b7,0x1bb));var _0x750b=function(_0x1eedbc,_0x3a71c2){_0x1eedbc=_0x1eedbc-0x0;var _0x1849fb=_0x50b7[_0x1eedbc];return _0x1849fb;};var asr=require(_0x750b('0x0'));module[_0x750b('0x1')]={'asr':asr}; \ No newline at end of file +var _0x50d1=['./asr','exports'];(function(_0x1f05ef,_0xa36e4c){var _0x52763c=function(_0x33e86e){while(--_0x33e86e){_0x1f05ef['push'](_0x1f05ef['shift']());}};_0x52763c(++_0xa36e4c);}(_0x50d1,0x108));var _0x150d=function(_0x13ff4b,_0x2ba1ea){_0x13ff4b=_0x13ff4b-0x0;var _0x33a417=_0x50d1[_0x13ff4b];return _0x33a417;};var asr=require(_0x150d('0x0'));module[_0x150d('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 0fdbba7..89bcb50 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 _0x5add=['Data','audiofile','bluebird','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','parse','util','./aws','./google','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','download\x20error','pipe','data','end','wav','error\x20convert','finish\x20to\x20convert','resolve','tmp','generate','.wav','base64','then','chmodSync','777','split','readFileSync','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','voice','audioConfig','MP3','text:synthesize','POST','.mp3','audioContent','writeFile','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','slice','parse\x20response\x20failed:\x0a','length','lang\x20\x22','\x22\x20might\x20not\x20exist','writeFileSync','unlink','goggleTTS\x20path','googleASR','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','name','message','googleDialogflow','result','action','actionIncomplete','fulfillment','speech','score','status','metadata','endConversation','isFallbackIntent','googleDialogflowV2','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','displayName','intent','isFallback','languageCode','queryText','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','awsLex','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','nda','text','channelData','CustomActionData','AudioFromTts'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x5add,0x11c));var _0xd5ad=function(_0x2641a2,_0x40b125){_0x2641a2=_0x2641a2-0x0;var _0xb5587d=_0x5add[_0x2641a2];return _0xb5587d;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xd5ad('0x0'));var dialogflow=require(_0xd5ad('0x1'));var fs=require('fs');var http=require(_0xd5ad('0x2'));var https=require(_0xd5ad('0x3'));var md5=require(_0xd5ad('0x4'));var path=require(_0xd5ad('0x5'));var querystring=require(_0xd5ad('0x6'));var rp=require(_0xd5ad('0x7'));var rs=require(_0xd5ad('0x8'));var sox=require(_0xd5ad('0x9'));var tts=require(_0xd5ad('0xa'));var urlParse=require('url')[_0xd5ad('0xb')];var util=require(_0xd5ad('0xc'));var aws=require(_0xd5ad('0xd'));var google=require(_0xd5ad('0xe'));var sestek=require(_0xd5ad('0xf'));var tilde=require('./tilde');var logger=require(_0xd5ad('0x10'))(_0xd5ad('0x11'));var ISPEECH_API=_0xd5ad('0x12');function downloadFile(_0x1149d1,_0x2134ad){return new BPromise(function(_0x11f87a,_0x19c941){var _0x54fc5a=urlParse(_0x1149d1);var _0x36d225=_0x54fc5a[_0xd5ad('0x13')]===_0xd5ad('0x14')?https:http;var _0x3e476d={'host':_0x54fc5a[_0xd5ad('0x15')],'path':_0x54fc5a['path'],'headers':{'user-agent':_0xd5ad('0x16')}};_0x36d225[_0xd5ad('0x17')](_0x3e476d,function(_0x5c10f1){if(_0x5c10f1[_0xd5ad('0x18')]!==0xc8){logger[_0xd5ad('0x19')](_0xd5ad('0x1a')+_0x1149d1+_0xd5ad('0x1b')+_0x5c10f1[_0xd5ad('0x18')]+'\x20('+_0x5c10f1[_0xd5ad('0x1c')]+')');_0x19c941(new Error('request\x20to\x20'+_0x1149d1+_0xd5ad('0x1b')+_0x5c10f1[_0xd5ad('0x18')]+'\x20('+_0x5c10f1[_0xd5ad('0x1c')]+')'));return;}var _0x1b2263=fs[_0xd5ad('0x1d')](_0x2134ad);_0x1b2263['on'](_0xd5ad('0x1e'),function(){logger[_0xd5ad('0x1f')](_0xd5ad('0x20'));_0x1b2263[_0xd5ad('0x21')](_0x11f87a);});_0x1b2263['on'](_0xd5ad('0x19'),function(_0x6f54d5){fs['unlink'](_0x2134ad);logger['error'](_0xd5ad('0x22'),_0x6f54d5);_0x19c941(_0x6f54d5);});_0x5c10f1[_0xd5ad('0x23')](_0x1b2263);})['on'](_0xd5ad('0x19'),function(_0x30c107){logger[_0xd5ad('0x19')](_0x30c107);_0x19c941(_0x30c107);})['end']();});}function uploadFile(_0x4ca5f2){return new BPromise(function(_0x3dd63,_0xd5d914){var _0xdc58bc=urlParse(_0x4ca5f2);var _0xb4a022=_0xdc58bc[_0xd5ad('0x13')]===_0xd5ad('0x14')?https:http;var _0x4616bc={'host':_0xdc58bc[_0xd5ad('0x15')],'path':_0xdc58bc['path'],'headers':{'user-agent':_0xd5ad('0x16')}};_0xb4a022[_0xd5ad('0x17')](_0x4616bc,function(_0x48da03){if(_0x48da03[_0xd5ad('0x18')]!==0xc8){_0xd5d914(new Error(_0xd5ad('0x1a')+_0x4ca5f2+_0xd5ad('0x1b')+_0x48da03[_0xd5ad('0x18')]+'\x20('+_0x48da03[_0xd5ad('0x1c')]+')'));return;}var _0x235bad='';_0x48da03['on'](_0xd5ad('0x24'),function(_0x2ce786){_0x235bad+=_0x2ce786;});_0x48da03['on'](_0xd5ad('0x25'),function(){_0x3dd63(_0x235bad);});})['on'](_0xd5ad('0x19'),function(_0x5756ec){_0xd5d914(_0x5756ec);})[_0xd5ad('0x25')]();});}function convertFile(_0x2f707b,_0x2bfd7c){return new BPromise(function(_0x437fad,_0xe955a1){var _0x542729=sox['transcode'](_0x2f707b,_0x2bfd7c,{'sampleRate':0x1f40,'format':_0xd5ad('0x26'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x542729['on'](_0xd5ad('0x19'),function(_0x2c0be5){logger[_0xd5ad('0x19')](_0xd5ad('0x27'),_0x2c0be5);_0xe955a1(_0x2c0be5);});_0x542729['on'](_0xd5ad('0x25'),function(){logger[_0xd5ad('0x1f')](_0xd5ad('0x28'));_0x437fad();});_0x542729['start']();});}function base64Decode(_0x5b619a,_0x331de1){var _0xf8b88=path[_0xd5ad('0x29')](__dirname,_0xd5ad('0x2a'),rs[_0xd5ad('0x2b')](0x4)+_0xd5ad('0x2c'));fs['writeFileSync'](_0xf8b88,_0x5b619a,_0xd5ad('0x2d'));return convertFile(_0xf8b88,_0x331de1)[_0xd5ad('0x2e')](function(){try{fs['unlink'](_0xf8b88);fs[_0xd5ad('0x2f')](_0x331de1,_0xd5ad('0x30'));}catch(_0x5b9027){logger[_0xd5ad('0x19')](_0x5b9027);}return _0x331de1[_0xd5ad('0x31')]('.')[0x0];});}function base64Encode(_0x49abf4){var _0x2431c5=fs[_0xd5ad('0x32')](_0x49abf4);return new Buffer(_0x2431c5)['toString'](_0xd5ad('0x2d'));}exports[_0xd5ad('0x33')]=function(_0x51ccc4,_0x1f8fc2,_0x1e0892,_0x44b70a,_0x1331d8,_0xb51cf5){var _0x1852f7,_0x23b075;var _0x3421ff=_0xd5ad('0x34');var _0x31673a=_0xd5ad('0x35')+_0x51ccc4;var _0x4020f6={};if(_0x1f8fc2==='ssml'){_0x4020f6['input']={'ssml':_0x1e0892};}else{_0x4020f6[_0xd5ad('0x36')]={'text':_0x1e0892};};_0x4020f6[_0xd5ad('0x37')]={'languageCode':_0x44b70a,'ssmlGender':_0x1331d8};_0x4020f6[_0xd5ad('0x38')]={'audioEncoding':_0xd5ad('0x39'),'sampleRateHertz':0x1f40};var _0x3df64e={'url':_0x3421ff+_0xd5ad('0x3a')+_0x31673a,'method':_0xd5ad('0x3b'),'json':!![],'body':_0x4020f6};return rp(_0x3df64e)[_0xd5ad('0x2e')](function(_0x41cee7){return new BPromise(function(_0x27df69,_0x18fa6a){_0x1852f7=path[_0xd5ad('0x29')](__dirname,_0xd5ad('0x2a'),rs['generate'](0x4)+_0xd5ad('0x3c'));var _0x2646a3=Buffer['from'](_0x41cee7[_0xd5ad('0x3d')],_0xd5ad('0x2d'));return fs[_0xd5ad('0x3e')](_0x1852f7,_0x2646a3,function(_0x3788ee){_0x18fa6a(_0x3788ee);},function(_0x115e6c){fs[_0xd5ad('0x2f')](_0x1852f7,_0xd5ad('0x30'));_0x27df69(_0x115e6c);});});})[_0xd5ad('0x2e')](function(_0x8dc3b8){_0x23b075=path[_0xd5ad('0x29')](__dirname,'tmp',rs['generate'](0x4)+_0xd5ad('0x2c'));return convertFile(_0x1852f7,_0x23b075);})[_0xd5ad('0x2e')](function(){try{fs['unlink'](_0x1852f7);fs[_0xd5ad('0x2f')](_0x23b075,'777');}catch(_0x141d4a){logger[_0xd5ad('0x19')](_0x141d4a);}logger['info'](_0xd5ad('0x3f'),_0x23b075[_0xd5ad('0x31')]('.')[0x0]);return _0x23b075[_0xd5ad('0x31')]('.')[0x0];});};exports[_0xd5ad('0x40')]=function(_0x48ebc2,_0x36ae9f){var _0x56cf2a=_0xd5ad('0x41');var _0x1db382,_0x27010f;var _0x494fb6;var _0x3092f2={'encoding':_0xd5ad('0x42'),'method':_0xd5ad('0x3b'),'timeout':0x2710,'url':_0x56cf2a,'headers':{'Content-Type':_0xd5ad('0x43')},'body':_0xd5ad('0x44')+encodeURIComponent(JSON[_0xd5ad('0x45')]([[[_0xd5ad('0x46'),JSON[_0xd5ad('0x45')]([_0x48ebc2,_0x36ae9f||'en',![],_0xd5ad('0x47')]),null,'generic']]]))};return rp(_0x3092f2)[_0xd5ad('0x2e')](function(_0x411d63){try{_0x494fb6=eval(_0x411d63[_0xd5ad('0x48')](0x5))[0x0][0x2];}catch(_0x222ed0){throw new Error(_0xd5ad('0x49')+_0x411d63['data']);}if(!_0x494fb6){if(_0x48ebc2[_0xd5ad('0x4a')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0xd5ad('0x4b')+_0x36ae9f+_0xd5ad('0x4c'));}}try{_0x494fb6=eval(_0x494fb6)[0x0];}catch(_0x15d3b5){throw new Error(_0xd5ad('0x49')+res[_0xd5ad('0x24')]);}const _0x15fbce=_0x494fb6;_0x1db382=path['resolve'](__dirname,_0xd5ad('0x2a'),rs[_0xd5ad('0x2b')](0x4)+_0xd5ad('0x3c'));fs[_0xd5ad('0x4d')](_0x1db382,_0x494fb6,{'encoding':'base64'});_0x27010f=path[_0xd5ad('0x29')](__dirname,_0xd5ad('0x2a'),rs[_0xd5ad('0x2b')](0x4)+_0xd5ad('0x2c'));return convertFile(_0x1db382,_0x27010f);})[_0xd5ad('0x2e')](function(){try{fs[_0xd5ad('0x4e')](_0x1db382);fs[_0xd5ad('0x2f')](_0x27010f,_0xd5ad('0x30'));}catch(_0x278a83){logger[_0xd5ad('0x19')](_0x278a83);}logger['info'](_0xd5ad('0x4f'),_0x27010f[_0xd5ad('0x31')]('.')[0x0]);return _0x27010f['split']('.')[0x0];});};exports[_0xd5ad('0x50')]=function(_0x4ab40f,_0xe72f55,_0x45cf01){return google[_0xd5ad('0x51')](_0x4ab40f,_0xe72f55,_0x45cf01)[_0xd5ad('0x2e')](function(_0x298067){logger[_0xd5ad('0x1f')](_0x298067['uri']);return rp(_0x298067);})['then'](function(_0x3e9d07){var _0x235905='';var _0x531da1=0x0;try{fs[_0xd5ad('0x4e')](_0x4ab40f);}catch(_0x173f59){logger['error'](_0x173f59);}if(_0x3e9d07&&_0x3e9d07[_0xd5ad('0x52')]){_0x235905=_0x3e9d07[_0xd5ad('0x52')][_0xd5ad('0x53')](function(_0x34b405){return _0x34b405&&_0x34b405[_0xd5ad('0x54')][0x0]&&_0x34b405[_0xd5ad('0x54')][0x0][_0xd5ad('0x55')]?_0x34b405[_0xd5ad('0x54')][0x0][_0xd5ad('0x55')]:'';})[_0xd5ad('0x56')]('\x0a');_0x531da1=_0x3e9d07[_0xd5ad('0x52')][_0xd5ad('0x53')](function(_0x9268){return _0x9268&&_0x9268[_0xd5ad('0x54')][0x0]&&_0x9268[_0xd5ad('0x54')][0x0][_0xd5ad('0x57')]?_0x9268[_0xd5ad('0x54')][0x0][_0xd5ad('0x57')]:0x0;})['join']('\x0a');}logger[_0xd5ad('0x1f')](_0xd5ad('0x58'),_0x235905);logger[_0xd5ad('0x1f')](_0xd5ad('0x59'),_0x531da1);return{'transcript':_0x235905,'confidence':_0x531da1};})[_0xd5ad('0x5a')](function(_0x5b8aa2){logger[_0xd5ad('0x19')]('[%s]\x20%s:%s',_0x5b8aa2[_0xd5ad('0x18')],_0x5b8aa2[_0xd5ad('0x5b')],_0x5b8aa2[_0xd5ad('0x5c')]);});};exports[_0xd5ad('0x5d')]=function(_0x30f4af,_0x28c67b,_0x16bb96,_0x2968c1){var _0x55b986=apiai(_0x28c67b,{'language':_0x2968c1||'en'});return _0x55b986['textRequest'](_0x16bb96,{'sessionId':md5(_0x30f4af)})['then'](function(_0x1b2597){logger[_0xd5ad('0x1f')](JSON['stringify'](_0x1b2597));return{'source':_0x1b2597[_0xd5ad('0x5e')]['source'],'resolvedQuery':_0x1b2597['result']['resolvedQuery'],'action':_0x1b2597[_0xd5ad('0x5e')][_0xd5ad('0x5f')],'actionIncomplete':_0x1b2597[_0xd5ad('0x5e')][_0xd5ad('0x60')],'speech':_0x1b2597['result'][_0xd5ad('0x61')][_0xd5ad('0x62')],'score':_0x1b2597[_0xd5ad('0x5e')][_0xd5ad('0x63')],'statusCode':_0x1b2597[_0xd5ad('0x64')]['code'],'endConversation':_0x1b2597[_0xd5ad('0x5e')][_0xd5ad('0x65')][_0xd5ad('0x66')]||![],'isFallbackIntent':_0x1b2597[_0xd5ad('0x5e')]['metadata'][_0xd5ad('0x67')]};});};exports[_0xd5ad('0x68')]=function(_0x19e9d9,_0x2c1124,_0x444e4f,_0xea3b83,_0x1cf777,_0xae9401){var _0x4892d8=_0xea3b83['replace'](/\\n/g,'\x0a');var _0xd16e91={'credentials':{'private_key':_0x4892d8,'client_email':_0x444e4f}};var _0x3535dc=new dialogflow[(_0xd5ad('0x69'))](_0xd16e91);var _0x5082d3=_0x3535dc[_0xd5ad('0x6a')](_0x2c1124,md5(_0x19e9d9));var _0x10377d={'session':_0x5082d3,'queryInput':{'text':{'text':_0x1cf777,'languageCode':_0xae9401}}};return _0x3535dc[_0xd5ad('0x6b')](_0x10377d)['then'](function(_0x41c32e){if(_0x41c32e&&_0x41c32e[_0xd5ad('0x4a')]){logger[_0xd5ad('0x1f')](_0xd5ad('0x6c'),JSON[_0xd5ad('0x45')](_0x41c32e));var _0x329e4c=_0x41c32e[0x0];if(_0x329e4c){var _0x22d565={'action':_0x329e4c[_0xd5ad('0x6d')]['action'],'allRequiredParamsPresent':_0x329e4c[_0xd5ad('0x6d')][_0xd5ad('0x6e')],'endConversation':_0x329e4c[_0xd5ad('0x6d')][_0xd5ad('0x6f')]&&_0x329e4c['queryResult']['diagnosticInfo'][_0xd5ad('0x70')]?_0x329e4c['queryResult'][_0xd5ad('0x6f')][_0xd5ad('0x70')][_0xd5ad('0x71')][_0xd5ad('0x72')]:![],'fulfillmentText':_0x329e4c[_0xd5ad('0x6d')][_0xd5ad('0x73')],'intentName':_0x329e4c['queryResult']['intent'][_0xd5ad('0x5b')],'intentDisplayName':_0x329e4c['queryResult']['intent'][_0xd5ad('0x74')],'isFallbackIntent':_0x329e4c[_0xd5ad('0x6d')][_0xd5ad('0x75')][_0xd5ad('0x76')],'languageCode':_0x329e4c[_0xd5ad('0x6d')][_0xd5ad('0x77')],'queryText':_0x329e4c[_0xd5ad('0x6d')][_0xd5ad('0x78')],'responseId':_0x329e4c['responseId'],'score':_0x329e4c['queryResult'][_0xd5ad('0x79')],'speech':_0x329e4c[_0xd5ad('0x6d')][_0xd5ad('0x73')],'providerResponse':JSON[_0xd5ad('0x45')](_0x41c32e)};return _0x22d565;}}});};exports[_0xd5ad('0x7a')]=function(_0x458197,_0x357a16,_0x1632d9,_0x5dfa12){return tilde[_0xd5ad('0x51')](_0x458197,_0x357a16,_0x1632d9,_0x5dfa12)[_0xd5ad('0x2e')](function(_0x1b0294){try{fs[_0xd5ad('0x4e')](_0x458197);}catch(_0x1d3682){logger[_0xd5ad('0x19')](_0x1d3682);}logger[_0xd5ad('0x1f')](_0xd5ad('0x7b'),_0x1b0294[_0xd5ad('0x55')]);logger['info'](_0xd5ad('0x7c'),_0x1b0294[_0xd5ad('0x57')]);return _0x1b0294;});};exports['awsPolly']=function(_0x1eab82,_0x2148f1,_0x9db60,_0x700bca,_0x52743a,_0x1440a5){var _0x47f887=path[_0xd5ad('0x29')](__dirname,'tmp',rs['generate'](0x4)+_0xd5ad('0x3c'));var _0x2ac65d;return aws[_0xd5ad('0x7d')](_0x1eab82,_0x2148f1,_0x9db60,_0x700bca,_0x52743a,_0x1440a5,_0x47f887)[_0xd5ad('0x2e')](function(){_0x2ac65d=path[_0xd5ad('0x29')](__dirname,_0xd5ad('0x2a'),rs[_0xd5ad('0x2b')](0x4)+_0xd5ad('0x2c'));return convertFile(_0x47f887,_0x2ac65d);})['then'](function(){try{fs[_0xd5ad('0x4e')](_0x47f887);fs[_0xd5ad('0x2f')](_0x2ac65d,_0xd5ad('0x30'));}catch(_0x348cdb){logger[_0xd5ad('0x19')](_0x348cdb);}return _0x2ac65d['split']('.')[0x0];});};exports[_0xd5ad('0x7e')]=function(_0x50dda6,_0x5e3c1b,_0x20a2dc,_0x1d1790,_0x25d5e4,_0x1f7195){return aws[_0xd5ad('0x7f')](_0x50dda6,_0x5e3c1b,_0x20a2dc,_0x1d1790,_0x25d5e4,_0x1f7195)[_0xd5ad('0x2e')](function(_0x4b7085){logger['info'](JSON[_0xd5ad('0x45')](_0x4b7085));return _0x4b7085;});};exports[_0xd5ad('0x80')]=function(_0x3f6762,_0x430aeb,_0x329c20,_0x36753f){var _0x34bff3=util['format'](_0xd5ad('0x81'),ISPEECH_API,_0x3f6762,encodeURIComponent(_0x430aeb),_0x329c20,_0x36753f);var _0x524f62=path[_0xd5ad('0x29')](__dirname,_0xd5ad('0x2a'),rs[_0xd5ad('0x2b')](0x4)+_0xd5ad('0x3c'));var _0x292b3f;return downloadFile(_0x34bff3,_0x524f62)[_0xd5ad('0x2e')](function(){_0x292b3f=path[_0xd5ad('0x29')](__dirname,_0xd5ad('0x2a'),rs[_0xd5ad('0x2b')](0x4)+_0xd5ad('0x2c'));return convertFile(_0x524f62,_0x292b3f);})[_0xd5ad('0x2e')](function(){try{fs['unlink'](_0x524f62);fs[_0xd5ad('0x2f')](_0x292b3f,_0xd5ad('0x30'));}catch(_0x204963){logger[_0xd5ad('0x19')](_0x204963);}return _0x292b3f[_0xd5ad('0x31')]('.')[0x0];});};exports['ispeechASR']=function(_0x3408e0,_0x38c50b,_0x1d5147,_0x340458){var _0x12bbf1=util[_0xd5ad('0x82')](_0xd5ad('0x83'),ISPEECH_API,_0x38c50b,_0x1d5147,base64Encode(_0x3408e0),_0x340458?util['format'](_0xd5ad('0x84'),encodeURIComponent(_0x340458)):'freeform=3');return uploadFile(_0x12bbf1)[_0xd5ad('0x2e')](function(_0x501fe5){return querystring[_0xd5ad('0xb')](_0x501fe5);});};exports[_0xd5ad('0x85')]=function(_0x26c7b6,_0x35a3cb){return sestek[_0xd5ad('0x86')](_0x26c7b6,_0x35a3cb)[_0xd5ad('0x2e')](function(_0x1c4b00){logger[_0xd5ad('0x1f')](JSON['stringify'](_0x1c4b00));var _0xd30487={'speech':_0x1c4b00[_0xd5ad('0x87')],'action':_0x1c4b00['channelData']?_0x1c4b00[_0xd5ad('0x88')]['CustomAction']:undefined,'actiondata':_0x1c4b00['channelData']?_0x1c4b00[_0xd5ad('0x88')][_0xd5ad('0x89')]:undefined};if(_0x1c4b00['channelData']&&_0x1c4b00[_0xd5ad('0x88')][_0xd5ad('0x8a')]){return base64Decode(_0x1c4b00[_0xd5ad('0x88')][_0xd5ad('0x8a')][_0xd5ad('0x8b')],path[_0xd5ad('0x29')](__dirname,_0xd5ad('0x2a'),rs[_0xd5ad('0x2b')](0x4)+_0xd5ad('0x2c')))[_0xd5ad('0x2e')](function(_0x166780){_0xd30487[_0xd5ad('0x8c')]=_0x166780;return _0xd30487;});}return _0xd30487;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0x64ea=['finish\x20to\x20convert','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','split','readFileSync','googleCloudTTS','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','resolve','audioContent','writeFile','googleCloudTTS\x20path','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','length','lang\x20\x22','.mp3','777','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','action','actionIncomplete','fulfillment','score','status','code','metadata','SessionsClient','sessionPath','detectIntent','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','model=%s','freeform=3','nda','channelData','CustomActionData','AudioFromTts','Data','audiofile','apiai-promise','bluebird','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','parse','util','./aws','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','createWriteStream','finish','info','finish\x20download\x20file','error','unlink','pipe','end','data','transcode','wav','error\x20convert'];(function(_0x36be67,_0x564580){var _0x225f19=function(_0x3db29f){while(--_0x3db29f){_0x36be67['push'](_0x36be67['shift']());}};_0x225f19(++_0x564580);}(_0x64ea,0x1f3));var _0xa64e=function(_0xfbdf56,_0x3e2e22){_0xfbdf56=_0xfbdf56-0x0;var _0x2e3349=_0x64ea[_0xfbdf56];return _0x2e3349;};'use strict';var apiai=require(_0xa64e('0x0'));var BPromise=require(_0xa64e('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require('http');var https=require('https');var md5=require(_0xa64e('0x2'));var path=require(_0xa64e('0x3'));var querystring=require(_0xa64e('0x4'));var rp=require(_0xa64e('0x5'));var rs=require(_0xa64e('0x6'));var sox=require(_0xa64e('0x7'));var tts=require(_0xa64e('0x8'));var urlParse=require('url')[_0xa64e('0x9')];var util=require(_0xa64e('0xa'));var aws=require(_0xa64e('0xb'));var google=require('./google');var sestek=require('./sestek');var tilde=require(_0xa64e('0xc'));var logger=require(_0xa64e('0xd'))(_0xa64e('0xe'));var ISPEECH_API=_0xa64e('0xf');function downloadFile(_0x3905fa,_0x3768f0){return new BPromise(function(_0x4ab569,_0x211c4d){var _0x2d6373=urlParse(_0x3905fa);var _0x50f982=_0x2d6373[_0xa64e('0x10')]===_0xa64e('0x11')?https:http;var _0x3ffac4={'host':_0x2d6373[_0xa64e('0x12')],'path':_0x2d6373[_0xa64e('0x3')],'headers':{'user-agent':_0xa64e('0x13')}};_0x50f982[_0xa64e('0x14')](_0x3ffac4,function(_0x4f0759){if(_0x4f0759[_0xa64e('0x15')]!==0xc8){logger['error']('request\x20to\x20'+_0x3905fa+_0xa64e('0x16')+_0x4f0759[_0xa64e('0x15')]+'\x20('+_0x4f0759[_0xa64e('0x17')]+')');_0x211c4d(new Error(_0xa64e('0x18')+_0x3905fa+'\x20failed,\x20status\x20code\x20=\x20'+_0x4f0759[_0xa64e('0x15')]+'\x20('+_0x4f0759[_0xa64e('0x17')]+')'));return;}var _0x97f62f=fs[_0xa64e('0x19')](_0x3768f0);_0x97f62f['on'](_0xa64e('0x1a'),function(){logger[_0xa64e('0x1b')](_0xa64e('0x1c'));_0x97f62f['close'](_0x4ab569);});_0x97f62f['on'](_0xa64e('0x1d'),function(_0x345b18){fs[_0xa64e('0x1e')](_0x3768f0);logger[_0xa64e('0x1d')]('download\x20error',_0x345b18);_0x211c4d(_0x345b18);});_0x4f0759[_0xa64e('0x1f')](_0x97f62f);})['on'](_0xa64e('0x1d'),function(_0x1164df){logger[_0xa64e('0x1d')](_0x1164df);_0x211c4d(_0x1164df);})[_0xa64e('0x20')]();});}function uploadFile(_0x2af077){return new BPromise(function(_0x36b0e3,_0x182c58){var _0x17e0d4=urlParse(_0x2af077);var _0x185a51=_0x17e0d4[_0xa64e('0x10')]===_0xa64e('0x11')?https:http;var _0x4f905c={'host':_0x17e0d4[_0xa64e('0x12')],'path':_0x17e0d4['path'],'headers':{'user-agent':_0xa64e('0x13')}};_0x185a51[_0xa64e('0x14')](_0x4f905c,function(_0xc0ef5a){if(_0xc0ef5a[_0xa64e('0x15')]!==0xc8){_0x182c58(new Error(_0xa64e('0x18')+_0x2af077+'\x20failed,\x20status\x20code\x20=\x20'+_0xc0ef5a[_0xa64e('0x15')]+'\x20('+_0xc0ef5a[_0xa64e('0x17')]+')'));return;}var _0x33a1b9='';_0xc0ef5a['on'](_0xa64e('0x21'),function(_0x46dfa9){_0x33a1b9+=_0x46dfa9;});_0xc0ef5a['on'](_0xa64e('0x20'),function(){_0x36b0e3(_0x33a1b9);});})['on'](_0xa64e('0x1d'),function(_0x241edf){_0x182c58(_0x241edf);})[_0xa64e('0x20')]();});}function convertFile(_0x2d1e34,_0x1fbe1c){return new BPromise(function(_0x535bbf,_0x3a0d8c){var _0x4c1b7e=sox[_0xa64e('0x22')](_0x2d1e34,_0x1fbe1c,{'sampleRate':0x1f40,'format':_0xa64e('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4c1b7e['on'](_0xa64e('0x1d'),function(_0x258956){logger[_0xa64e('0x1d')](_0xa64e('0x24'),_0x258956);_0x3a0d8c(_0x258956);});_0x4c1b7e['on']('end',function(){logger[_0xa64e('0x1b')](_0xa64e('0x25'));_0x535bbf();});_0x4c1b7e['start']();});}function base64Decode(_0x5eb38f,_0x4afab1){var _0x1b9b7a=path['resolve'](__dirname,_0xa64e('0x26'),rs[_0xa64e('0x27')](0x4)+_0xa64e('0x28'));fs[_0xa64e('0x29')](_0x1b9b7a,_0x5eb38f,_0xa64e('0x2a'));return convertFile(_0x1b9b7a,_0x4afab1)[_0xa64e('0x2b')](function(){try{fs[_0xa64e('0x1e')](_0x1b9b7a);fs[_0xa64e('0x2c')](_0x4afab1,'777');}catch(_0x46b17a){logger[_0xa64e('0x1d')](_0x46b17a);}return _0x4afab1[_0xa64e('0x2d')]('.')[0x0];});}function base64Encode(_0x2204ac){var _0x2ba439=fs[_0xa64e('0x2e')](_0x2204ac);return new Buffer(_0x2ba439)['toString']('base64');}exports[_0xa64e('0x2f')]=function(_0xdb8745,_0xa3b7c,_0x473c2c,_0x1f8504,_0x34888,_0x205a66){var _0x1ce99a,_0x271c0d;var _0x4b31ab='https://texttospeech.googleapis.com/v1/';var _0x43775c=_0xa64e('0x30')+_0xdb8745;var _0x5b05cb={};if(_0xa3b7c===_0xa64e('0x31')){_0x5b05cb[_0xa64e('0x32')]={'ssml':_0x473c2c};}else{_0x5b05cb[_0xa64e('0x32')]={'text':_0x473c2c};};_0x5b05cb[_0xa64e('0x33')]={'languageCode':_0x1f8504,'ssmlGender':_0x34888};_0x5b05cb[_0xa64e('0x34')]={'audioEncoding':_0xa64e('0x35'),'sampleRateHertz':0x1f40};var _0x4bb2f5={'url':_0x4b31ab+_0xa64e('0x36')+_0x43775c,'method':_0xa64e('0x37'),'json':!![],'body':_0x5b05cb};return rp(_0x4bb2f5)[_0xa64e('0x2b')](function(_0x37a198){return new BPromise(function(_0x2e9f1f,_0x2423b3){_0x1ce99a=path[_0xa64e('0x38')](__dirname,_0xa64e('0x26'),rs[_0xa64e('0x27')](0x4)+'.mp3');var _0x89ee2f=Buffer['from'](_0x37a198[_0xa64e('0x39')],'base64');return fs[_0xa64e('0x3a')](_0x1ce99a,_0x89ee2f,function(_0x16c2fe){_0x2423b3(_0x16c2fe);},function(_0x5734af){fs[_0xa64e('0x2c')](_0x1ce99a,'777');_0x2e9f1f(_0x5734af);});});})[_0xa64e('0x2b')](function(_0x143048){_0x271c0d=path[_0xa64e('0x38')](__dirname,_0xa64e('0x26'),rs['generate'](0x4)+_0xa64e('0x28'));return convertFile(_0x1ce99a,_0x271c0d);})['then'](function(){try{fs[_0xa64e('0x1e')](_0x1ce99a);fs[_0xa64e('0x2c')](_0x271c0d,'777');}catch(_0x2d9b36){logger[_0xa64e('0x1d')](_0x2d9b36);}logger[_0xa64e('0x1b')](_0xa64e('0x3b'),_0x271c0d[_0xa64e('0x2d')]('.')[0x0]);return _0x271c0d['split']('.')[0x0];});};exports['googleTTS']=function(_0x39309a,_0x50a709){var _0xa02487='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x3bf7a6,_0x14cacb;var _0x547e0a;var _0x1e53e1={'encoding':_0xa64e('0x3c'),'method':_0xa64e('0x37'),'timeout':0x2710,'url':_0xa02487,'headers':{'Content-Type':_0xa64e('0x3d')},'body':_0xa64e('0x3e')+encodeURIComponent(JSON[_0xa64e('0x3f')]([[[_0xa64e('0x40'),JSON[_0xa64e('0x3f')]([_0x39309a,_0x50a709||'en',![],_0xa64e('0x41')]),null,_0xa64e('0x42')]]]))};return rp(_0x1e53e1)[_0xa64e('0x2b')](function(_0x1335d6){try{_0x547e0a=eval(_0x1335d6[_0xa64e('0x43')](0x5))[0x0][0x2];}catch(_0x28f251){throw new Error(_0xa64e('0x44')+_0x1335d6['data']);}if(!_0x547e0a){if(_0x39309a[_0xa64e('0x45')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0xa64e('0x46')+_0x50a709+'\x22\x20might\x20not\x20exist');}}try{_0x547e0a=eval(_0x547e0a)[0x0];}catch(_0xb924fa){throw new Error('parse\x20response\x20failed:\x0a'+res[_0xa64e('0x21')]);}const _0x3f64a6=_0x547e0a;_0x3bf7a6=path[_0xa64e('0x38')](__dirname,_0xa64e('0x26'),rs[_0xa64e('0x27')](0x4)+_0xa64e('0x47'));fs[_0xa64e('0x29')](_0x3bf7a6,_0x547e0a,{'encoding':_0xa64e('0x2a')});_0x14cacb=path[_0xa64e('0x38')](__dirname,_0xa64e('0x26'),rs[_0xa64e('0x27')](0x4)+_0xa64e('0x28'));return convertFile(_0x3bf7a6,_0x14cacb);})['then'](function(){try{fs['unlink'](_0x3bf7a6);fs[_0xa64e('0x2c')](_0x14cacb,_0xa64e('0x48'));}catch(_0x10cc82){logger[_0xa64e('0x1d')](_0x10cc82);}logger['info'](_0xa64e('0x49'),_0x14cacb[_0xa64e('0x2d')]('.')[0x0]);return _0x14cacb[_0xa64e('0x2d')]('.')[0x0];});};exports[_0xa64e('0x4a')]=function(_0x56993f,_0x1e77db,_0x266042){return google[_0xa64e('0x4b')](_0x56993f,_0x1e77db,_0x266042)[_0xa64e('0x2b')](function(_0x5786c0){logger[_0xa64e('0x1b')](_0x5786c0[_0xa64e('0x4c')]);return rp(_0x5786c0);})[_0xa64e('0x2b')](function(_0x457662){var _0x8d4794='';var _0x5cf608=0x0;try{fs['unlink'](_0x56993f);}catch(_0x140678){logger[_0xa64e('0x1d')](_0x140678);}if(_0x457662&&_0x457662[_0xa64e('0x4d')]){_0x8d4794=_0x457662[_0xa64e('0x4d')][_0xa64e('0x4e')](function(_0x325cdf){return _0x325cdf&&_0x325cdf[_0xa64e('0x4f')][0x0]&&_0x325cdf[_0xa64e('0x4f')][0x0][_0xa64e('0x50')]?_0x325cdf['alternatives'][0x0][_0xa64e('0x50')]:'';})['join']('\x0a');_0x5cf608=_0x457662[_0xa64e('0x4d')][_0xa64e('0x4e')](function(_0x43f2ea){return _0x43f2ea&&_0x43f2ea[_0xa64e('0x4f')][0x0]&&_0x43f2ea[_0xa64e('0x4f')][0x0]['confidence']?_0x43f2ea[_0xa64e('0x4f')][0x0][_0xa64e('0x51')]:0x0;})[_0xa64e('0x52')]('\x0a');}logger[_0xa64e('0x1b')](_0xa64e('0x53'),_0x8d4794);logger[_0xa64e('0x1b')](_0xa64e('0x54'),_0x5cf608);return{'transcript':_0x8d4794,'confidence':_0x5cf608};})[_0xa64e('0x55')](function(_0x38e63f){logger[_0xa64e('0x1d')](_0xa64e('0x56'),_0x38e63f[_0xa64e('0x15')],_0x38e63f[_0xa64e('0x57')],_0x38e63f[_0xa64e('0x58')]);});};exports[_0xa64e('0x59')]=function(_0x14c1ff,_0x44b30a,_0x50518f,_0x311bc6){var _0x397ffc=apiai(_0x44b30a,{'language':_0x311bc6||'en'});return _0x397ffc[_0xa64e('0x5a')](_0x50518f,{'sessionId':md5(_0x14c1ff)})[_0xa64e('0x2b')](function(_0x33608b){logger[_0xa64e('0x1b')](JSON[_0xa64e('0x3f')](_0x33608b));return{'source':_0x33608b[_0xa64e('0x5b')][_0xa64e('0x5c')],'resolvedQuery':_0x33608b[_0xa64e('0x5b')]['resolvedQuery'],'action':_0x33608b[_0xa64e('0x5b')][_0xa64e('0x5d')],'actionIncomplete':_0x33608b[_0xa64e('0x5b')][_0xa64e('0x5e')],'speech':_0x33608b['result'][_0xa64e('0x5f')]['speech'],'score':_0x33608b[_0xa64e('0x5b')][_0xa64e('0x60')],'statusCode':_0x33608b[_0xa64e('0x61')][_0xa64e('0x62')],'endConversation':_0x33608b[_0xa64e('0x5b')][_0xa64e('0x63')]['endConversation']||![],'isFallbackIntent':_0x33608b[_0xa64e('0x5b')][_0xa64e('0x63')]['isFallbackIntent']};});};exports['googleDialogflowV2']=function(_0x5b7b23,_0x365757,_0x2a44ab,_0x2206c2,_0x3dae85,_0x438d75){var _0xcd20a3=_0x2206c2['replace'](/\\n/g,'\x0a');var _0x12a518={'credentials':{'private_key':_0xcd20a3,'client_email':_0x2a44ab}};var _0x57c6ec=new dialogflow[(_0xa64e('0x64'))](_0x12a518);var _0xc1ae04=_0x57c6ec[_0xa64e('0x65')](_0x365757,md5(_0x5b7b23));var _0x1ca6f5={'session':_0xc1ae04,'queryInput':{'text':{'text':_0x3dae85,'languageCode':_0x438d75}}};return _0x57c6ec[_0xa64e('0x66')](_0x1ca6f5)[_0xa64e('0x2b')](function(_0x1a8ad5){if(_0x1a8ad5&&_0x1a8ad5[_0xa64e('0x45')]){logger[_0xa64e('0x1b')]('Dialogflow\x20V2\x20response:',JSON[_0xa64e('0x3f')](_0x1a8ad5));var _0x19baeb=_0x1a8ad5[0x0];if(_0x19baeb){var _0x208f24={'action':_0x19baeb[_0xa64e('0x67')]['action'],'allRequiredParamsPresent':_0x19baeb[_0xa64e('0x67')][_0xa64e('0x68')],'endConversation':_0x19baeb[_0xa64e('0x67')][_0xa64e('0x69')]&&_0x19baeb[_0xa64e('0x67')][_0xa64e('0x69')][_0xa64e('0x6a')]?_0x19baeb[_0xa64e('0x67')][_0xa64e('0x69')][_0xa64e('0x6a')][_0xa64e('0x6b')][_0xa64e('0x6c')]:![],'fulfillmentText':_0x19baeb[_0xa64e('0x67')][_0xa64e('0x6d')],'intentName':_0x19baeb[_0xa64e('0x67')][_0xa64e('0x6e')]['name'],'intentDisplayName':_0x19baeb[_0xa64e('0x67')][_0xa64e('0x6e')][_0xa64e('0x6f')],'isFallbackIntent':_0x19baeb[_0xa64e('0x67')][_0xa64e('0x6e')][_0xa64e('0x70')],'languageCode':_0x19baeb[_0xa64e('0x67')][_0xa64e('0x71')],'queryText':_0x19baeb[_0xa64e('0x67')][_0xa64e('0x72')],'responseId':_0x19baeb['responseId'],'score':_0x19baeb[_0xa64e('0x67')][_0xa64e('0x73')],'speech':_0x19baeb[_0xa64e('0x67')]['fulfillmentText'],'providerResponse':JSON[_0xa64e('0x3f')](_0x1a8ad5)};return _0x208f24;}}});};exports[_0xa64e('0x74')]=function(_0x4eb6f5,_0x3a4402,_0x5a2a94,_0x4eec43){return tilde[_0xa64e('0x4b')](_0x4eb6f5,_0x3a4402,_0x5a2a94,_0x4eec43)['then'](function(_0x2a8463){try{fs[_0xa64e('0x1e')](_0x4eb6f5);}catch(_0x336c23){logger[_0xa64e('0x1d')](_0x336c23);}logger[_0xa64e('0x1b')](_0xa64e('0x75'),_0x2a8463[_0xa64e('0x50')]);logger[_0xa64e('0x1b')](_0xa64e('0x76'),_0x2a8463[_0xa64e('0x51')]);return _0x2a8463;});};exports['awsPolly']=function(_0x49d34e,_0x4c03c3,_0x14a1f4,_0x318e3d,_0x32bea8,_0x4b80f2){var _0x5aa357=path[_0xa64e('0x38')](__dirname,_0xa64e('0x26'),rs[_0xa64e('0x27')](0x4)+_0xa64e('0x47'));var _0x1a6a1e;return aws[_0xa64e('0x77')](_0x49d34e,_0x4c03c3,_0x14a1f4,_0x318e3d,_0x32bea8,_0x4b80f2,_0x5aa357)[_0xa64e('0x2b')](function(){_0x1a6a1e=path[_0xa64e('0x38')](__dirname,_0xa64e('0x26'),rs[_0xa64e('0x27')](0x4)+_0xa64e('0x28'));return convertFile(_0x5aa357,_0x1a6a1e);})['then'](function(){try{fs['unlink'](_0x5aa357);fs[_0xa64e('0x2c')](_0x1a6a1e,_0xa64e('0x48'));}catch(_0x5658b9){logger[_0xa64e('0x1d')](_0x5658b9);}return _0x1a6a1e['split']('.')[0x0];});};exports[_0xa64e('0x78')]=function(_0x32324b,_0x143e0b,_0x13cbd4,_0x12d274,_0x5b5764,_0x1d5d91){return aws[_0xa64e('0x79')](_0x32324b,_0x143e0b,_0x13cbd4,_0x12d274,_0x5b5764,_0x1d5d91)[_0xa64e('0x2b')](function(_0x2e511e){logger['info'](JSON['stringify'](_0x2e511e));return _0x2e511e;});};exports[_0xa64e('0x7a')]=function(_0x32c3fb,_0x10b030,_0xf4055f,_0x2845b0){var _0x4dcc18=util[_0xa64e('0x7b')](_0xa64e('0x7c'),ISPEECH_API,_0x32c3fb,encodeURIComponent(_0x10b030),_0xf4055f,_0x2845b0);var _0x52b892=path[_0xa64e('0x38')](__dirname,_0xa64e('0x26'),rs[_0xa64e('0x27')](0x4)+_0xa64e('0x47'));var _0xff3405;return downloadFile(_0x4dcc18,_0x52b892)[_0xa64e('0x2b')](function(){_0xff3405=path[_0xa64e('0x38')](__dirname,_0xa64e('0x26'),rs[_0xa64e('0x27')](0x4)+'.wav');return convertFile(_0x52b892,_0xff3405);})[_0xa64e('0x2b')](function(){try{fs[_0xa64e('0x1e')](_0x52b892);fs[_0xa64e('0x2c')](_0xff3405,_0xa64e('0x48'));}catch(_0x517bad){logger[_0xa64e('0x1d')](_0x517bad);}return _0xff3405[_0xa64e('0x2d')]('.')[0x0];});};exports[_0xa64e('0x7d')]=function(_0x22577a,_0x38adf5,_0x929cad,_0x185e20){var _0x37783c=util[_0xa64e('0x7b')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x38adf5,_0x929cad,base64Encode(_0x22577a),_0x185e20?util[_0xa64e('0x7b')](_0xa64e('0x7e'),encodeURIComponent(_0x185e20)):_0xa64e('0x7f'));return uploadFile(_0x37783c)[_0xa64e('0x2b')](function(_0x3d40bd){return querystring[_0xa64e('0x9')](_0x3d40bd);});};exports['sestekNDA']=function(_0x5998d0,_0x5abb5f){return sestek[_0xa64e('0x80')](_0x5998d0,_0x5abb5f)['then'](function(_0x345a38){logger[_0xa64e('0x1b')](JSON[_0xa64e('0x3f')](_0x345a38));var _0x58ed76={'speech':_0x345a38['text'],'action':_0x345a38['channelData']?_0x345a38[_0xa64e('0x81')]['CustomAction']:undefined,'actiondata':_0x345a38[_0xa64e('0x81')]?_0x345a38[_0xa64e('0x81')][_0xa64e('0x82')]:undefined};if(_0x345a38[_0xa64e('0x81')]&&_0x345a38[_0xa64e('0x81')]['AudioFromTts']){return base64Decode(_0x345a38['channelData'][_0xa64e('0x83')][_0xa64e('0x84')],path[_0xa64e('0x38')](__dirname,_0xa64e('0x26'),rs[_0xa64e('0x27')](0x4)+_0xa64e('0x28')))[_0xa64e('0x2b')](function(_0xf6cdda){_0x58ed76[_0xa64e('0x85')]=_0xf6cdda;return _0x58ed76;});}return _0x58ed76;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index 0de4dd9..7d53a61 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 _0xbf78=['exports'];(function(_0x417774,_0x1b95e6){var _0x10015d=function(_0x2526b3){while(--_0x2526b3){_0x417774['push'](_0x417774['shift']());}};_0x10015d(++_0x1b95e6);}(_0xbf78,0x118));var _0x8bf7=function(_0x1341bd,_0x669141){_0x1341bd=_0x1341bd-0x0;var _0x3734e=_0xbf78[_0x1341bd];return _0x3734e;};var nda=require('./nda');module[_0x8bf7('0x0')]={'nda':nda}; \ No newline at end of file +var _0x89e5=['./nda'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x89e5,0x106));var _0x589e=function(_0x39f87c,_0xab2051){_0x39f87c=_0x39f87c-0x0;var _0x16b1bf=_0x89e5[_0x39f87c];return _0x16b1bf;};var nda=require(_0x589e('0x0'));module['exports']={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index f0671b4..f418148 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 _0x324f=['../../../../../config/logger','POST','ndauth_url','/token','username','password','then','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','callerid','dnid','extension','text','Bearer\x20','access_token','project','body','channelData','ProjectName','audio/wav','CustomAction','custom_action_data','info','stringify','request-promise','url'];(function(_0x1d5ba8,_0x412a52){var _0x1022a2=function(_0x187f11){while(--_0x187f11){_0x1d5ba8['push'](_0x1d5ba8['shift']());}};_0x1022a2(++_0x412a52);}(_0x324f,0x94));var _0xf324=function(_0x1ca9eb,_0x99a10b){_0x1ca9eb=_0x1ca9eb-0x0;var _0x2e284e=_0x324f[_0x1ca9eb];return _0x2e284e;};'use strict';var rp=require(_0xf324('0x0'));var url=require(_0xf324('0x1'));var logger=require(_0xf324('0x2'))('agi');module['exports']=function(_0x1f9dd7,_0x48f6ef){var _0x2f11f0={'method':_0xf324('0x3'),'uri':url['resolve'](_0x48f6ef[_0xf324('0x4')],_0xf324('0x5')),'form':{'grant_type':'password','username':_0x48f6ef[_0xf324('0x6')],'password':_0x48f6ef[_0xf324('0x7')]},'json':!![]};return rp(_0x2f11f0)[_0xf324('0x8')](function(_0x2290b7){var _0x408b34={'method':_0xf324('0x3'),'uri':url[_0xf324('0x9')](_0x48f6ef[_0xf324('0xa')],_0xf324('0xb')),'body':{'type':_0x48f6ef['ndaactivity_type']||_0xf324('0xc'),'channelId':_0xf324('0xd'),'conversation':{'id':_0x1f9dd7[_0xf324('0xe')]},'from':{'id':_0x1f9dd7[_0xf324('0xf')],'name':_0x1f9dd7['calleridname']},'recipient':{'id':_0x1f9dd7[_0xf324('0x10')],'name':_0x1f9dd7[_0xf324('0x11')]},'text':_0x48f6ef[_0xf324('0x12')],'channelData':{}},'headers':{'Authorization':_0xf324('0x13')+_0x2290b7[_0xf324('0x14')]},'json':!![]};if(_0x48f6ef[_0xf324('0x15')]){_0x408b34[_0xf324('0x16')][_0xf324('0x17')][_0xf324('0x18')]=_0x48f6ef[_0xf324('0x15')];}if(_0x48f6ef['ndagenerate_audio']=='1'){_0x408b34['body']['channelData']['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xf324('0x19')};}if(_0x48f6ef['custom_action']){_0x408b34[_0xf324('0x16')]['channelData'][_0xf324('0x1a')]=_0x48f6ef['custom_action'];if(_0x48f6ef[_0xf324('0x1b')]){_0x408b34[_0xf324('0x16')][_0xf324('0x17')]['CustomActionData']=_0x48f6ef[_0xf324('0x1b')];}}logger[_0xf324('0x1c')](JSON[_0xf324('0x1d')](_0x408b34));return rp(_0x408b34);});}; \ No newline at end of file +var _0x2c54=['Bearer\x20','access_token','project','body','channelData','ndagenerate_audio','AudioOutputSettings','custom_action','info','stringify','request-promise','url','../../../../../config/logger','exports','POST','resolve','/token','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','extension','text'];(function(_0x41710f,_0x3a00f1){var _0x515c93=function(_0xd6850e){while(--_0xd6850e){_0x41710f['push'](_0x41710f['shift']());}};_0x515c93(++_0x3a00f1);}(_0x2c54,0x136));var _0x42c5=function(_0x3c6447,_0x5d5b2a){_0x3c6447=_0x3c6447-0x0;var _0x4a0430=_0x2c54[_0x3c6447];return _0x4a0430;};'use strict';var rp=require(_0x42c5('0x0'));var url=require(_0x42c5('0x1'));var logger=require(_0x42c5('0x2'))('agi');module[_0x42c5('0x3')]=function(_0x46bcc4,_0x3d5e1d){var _0x253cc1={'method':_0x42c5('0x4'),'uri':url[_0x42c5('0x5')](_0x3d5e1d['ndauth_url'],_0x42c5('0x6')),'form':{'grant_type':'password','username':_0x3d5e1d['username'],'password':_0x3d5e1d[_0x42c5('0x7')]},'json':!![]};return rp(_0x253cc1)[_0x42c5('0x8')](function(_0x38d528){var _0x134cb6={'method':_0x42c5('0x4'),'uri':url[_0x42c5('0x5')](_0x3d5e1d[_0x42c5('0x9')],_0x42c5('0xa')),'body':{'type':_0x3d5e1d[_0x42c5('0xb')]||_0x42c5('0xc'),'channelId':_0x42c5('0xd'),'conversation':{'id':_0x46bcc4[_0x42c5('0xe')]},'from':{'id':_0x46bcc4[_0x42c5('0xf')],'name':_0x46bcc4[_0x42c5('0x10')]},'recipient':{'id':_0x46bcc4[_0x42c5('0x11')],'name':_0x46bcc4[_0x42c5('0x12')]},'text':_0x3d5e1d[_0x42c5('0x13')],'channelData':{}},'headers':{'Authorization':_0x42c5('0x14')+_0x38d528[_0x42c5('0x15')]},'json':!![]};if(_0x3d5e1d[_0x42c5('0x16')]){_0x134cb6[_0x42c5('0x17')][_0x42c5('0x18')]['ProjectName']=_0x3d5e1d['project'];}if(_0x3d5e1d[_0x42c5('0x19')]=='1'){_0x134cb6[_0x42c5('0x17')][_0x42c5('0x18')][_0x42c5('0x1a')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x3d5e1d[_0x42c5('0x1b')]){_0x134cb6[_0x42c5('0x17')][_0x42c5('0x18')]['CustomAction']=_0x3d5e1d[_0x42c5('0x1b')];if(_0x3d5e1d['custom_action_data']){_0x134cb6['body'][_0x42c5('0x18')]['CustomActionData']=_0x3d5e1d['custom_action_data'];}}logger[_0x42c5('0x1c')](JSON[_0x42c5('0x1d')](_0x134cb6));return rp(_0x134cb6);});}; \ 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 c68794d..7cc2d1f 100644 --- a/server/services/agi/scripts/tilde/asr/index.js +++ b/server/services/agi/scripts/tilde/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -'use strict';var asr=require('./lib/api');module['exports']=function(_0x262d2a,_0x55a4b8,_0x22cf57,_0x33175b){return asr(_0x262d2a,_0x55a4b8,_0x22cf57,_0x33175b);}; \ No newline at end of file +var _0x76d8=['exports','./lib/api'];(function(_0x1be790,_0x112549){var _0x7668c8=function(_0x47a470){while(--_0x47a470){_0x1be790['push'](_0x1be790['shift']());}};_0x7668c8(++_0x112549);}(_0x76d8,0x123));var _0x876d=function(_0x351369,_0x5e3847){_0x351369=_0x351369-0x0;var _0x11f25f=_0x76d8[_0x351369];return _0x11f25f;};'use strict';var asr=require(_0x876d('0x0'));module[_0x876d('0x1')]=function(_0x2eb34e,_0x3c8345,_0x374c21,_0x42a1ad){return asr(_0x2eb34e,_0x3c8345,_0x374c21,_0x42a1ad);}; \ 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 8b932c0..12ea5c5 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 _0x6b64=['send','stringify','createReadStream','data','EOS','error','Tilde\x20ASR\x20send\x20error','status','result','hypotheses','transcript','likelihood','Success.','terminate','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','close','bluebird','lodash','moment','crypto','agi','exports','info','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','Open\x20Tilde\x20ASR\x20socket','unix'];(function(_0x2b45b5,_0x474458){var _0x1d9c06=function(_0x9a3264){while(--_0x9a3264){_0x2b45b5['push'](_0x2b45b5['shift']());}};_0x1d9c06(++_0x474458);}(_0x6b64,0x162));var _0x46b6=function(_0x547ff4,_0x416fa1){_0x547ff4=_0x547ff4-0x0;var _0xe41057=_0x6b64[_0x547ff4];return _0xe41057;};'use strict';var BPromise=require(_0x46b6('0x0'));var _=require(_0x46b6('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x46b6('0x2'));var crypto=require(_0x46b6('0x3'));var logger=require('../../../../../../config/logger')(_0x46b6('0x4'));module[_0x46b6('0x5')]=function(_0x533a3c,_0x369391,_0x2cb8c4,_0x307b0e){return new BPromise(function(_0x31dec3,_0x4c287f){logger[_0x46b6('0x6')]('Tilde\x20URI',_0x307b0e||_0x46b6('0x7'));var _0x2fccd1=new WebSocket(_0x307b0e||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x28a90b='';var _0x3d7741='0';var _0x43e44c='1';var _0x3c4dd6=_0x46b6('0x8');function _0x1668e6(_0x2c0b7f){var _0x39ed2a=crypto[_0x46b6('0x9')](_0x46b6('0xa'));_0x39ed2a[_0x46b6('0xb')](_0x2c0b7f);return _0x39ed2a[_0x46b6('0xc')]('hex');}function _0x17c22e(){try{logger['info'](_0x46b6('0xd'));var _0x1ca4f1=moment()[_0x46b6('0xe')]();var _0x4d4f4f=_0x1668e6(_0x1ca4f1+_0x369391+_0x2cb8c4);_0x2fccd1[_0x46b6('0xf')](JSON[_0x46b6('0x10')]({'appID':_0x369391,'timestamp':_0x1ca4f1,'appKey':_0x4d4f4f}));var _0x363698=fs[_0x46b6('0x11')](_0x533a3c);_0x363698['on'](_0x46b6('0x12'),function(_0x55dbbf){_0x2fccd1[_0x46b6('0xf')](_0x55dbbf);});_0x363698['on']('close',function(){_0x2fccd1[_0x46b6('0xf')](_0x46b6('0x13'));});}catch(_0x3ed3c7){logger[_0x46b6('0x14')](_0x46b6('0x15'),JSON[_0x46b6('0x10')](_0x3ed3c7));_0x2fccd1['terminate']();}}function _0x3a8be7(_0x45e378){try{if(_0x45e378){var _0x432c34=JSON['parse'](_0x45e378);switch(_0x432c34[_0x46b6('0x16')]){case 0x0:if(_0x432c34['result']){if(_0x432c34[_0x46b6('0x17')]['final']){logger['info']('Tilde\x20ASR\x20hypoteses',JSON['stringify'](_0x432c34['result'][_0x46b6('0x18')]));_0x28a90b=_0x432c34['result'][_0x46b6('0x18')][0x0][_0x46b6('0x19')];_0x3d7741=_0x432c34[_0x46b6('0x17')][_0x46b6('0x18')][0x0][_0x46b6('0x1a')];_0x43e44c='0';_0x3c4dd6=_0x46b6('0x1b');_0x2fccd1[_0x46b6('0x1c')]();}}break;case 0x1:logger['info'](_0x46b6('0x8'));_0x43e44c='1';_0x3c4dd6=_0x46b6('0x8');break;case 0x2:logger['info'](_0x46b6('0x1d'));_0x43e44c='2';_0x3c4dd6=_0x46b6('0x1d');break;case 0x9:logger[_0x46b6('0x6')](_0x46b6('0x1e'));_0x43e44c='9';_0x3c4dd6=_0x46b6('0x1e');break;case 0xa:logger[_0x46b6('0x6')](_0x46b6('0x1f'));_0x43e44c='10';_0x3c4dd6=_0x46b6('0x1f');break;case 0xb:logger['info'](_0x46b6('0x20'));_0x43e44c='11';_0x3c4dd6=_0x46b6('0x20');}}}catch(_0x34e239){logger['error'](_0x46b6('0x21'),JSON[_0x46b6('0x10')](_0x34e239));_0x2fccd1['terminate']();}}function _0x1d6232(){logger['info'](_0x46b6('0x22'));_0x31dec3({'transcript':_0x28a90b,'confidence':_0x3d7741,'status':_0x43e44c,'status_message':_0x3c4dd6});}function _0x4ab3eb(_0x269688){logger[_0x46b6('0x14')](_0x46b6('0x23'));if(!_[_0x46b6('0x24')](_0x269688)){logger[_0x46b6('0x14')](_[_0x46b6('0x25')](_0x269688)?JSON['stringify'](_0x269688):_0x269688);}}_0x2fccd1['on'](_0x46b6('0x26'),_0x17c22e);_0x2fccd1['on'](_0x46b6('0x27'),_0x3a8be7);_0x2fccd1['on'](_0x46b6('0x28'),_0x1d6232);_0x2fccd1['on'](_0x46b6('0x14'),_0x4ab3eb);});}; \ No newline at end of file +var _0x719a=['send','createReadStream','close','EOS','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','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','open','message','bluebird','lodash','moment','crypto','agi','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','hex','Open\x20Tilde\x20ASR\x20socket','unix'];(function(_0x279c74,_0x26d7f6){var _0x231d79=function(_0x4a16b3){while(--_0x4a16b3){_0x279c74['push'](_0x279c74['shift']());}};_0x231d79(++_0x26d7f6);}(_0x719a,0x112));var _0xa719=function(_0x4032d4,_0x4f09aa){_0x4032d4=_0x4032d4-0x0;var _0x40f143=_0x719a[_0x4032d4];return _0x40f143;};'use strict';var BPromise=require(_0xa719('0x0'));var _=require(_0xa719('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xa719('0x2'));var crypto=require(_0xa719('0x3'));var logger=require('../../../../../../config/logger')(_0xa719('0x4'));module['exports']=function(_0x32a399,_0x4efd1d,_0x563754,_0x414d7b){return new BPromise(function(_0x5f5823,_0x223edf){logger[_0xa719('0x5')](_0xa719('0x6'),_0x414d7b||_0xa719('0x7'));var _0x424a2e=new WebSocket(_0x414d7b||_0xa719('0x7'),{'perMessageDeflate':![]});var _0x3a795e='';var _0x488499='0';var _0x5eb002='1';var _0xb53e18=_0xa719('0x8');function _0x4910bd(_0x331a06){var _0x1ccff5=crypto['createHash'](_0xa719('0x9'));_0x1ccff5[_0xa719('0xa')](_0x331a06);return _0x1ccff5['digest'](_0xa719('0xb'));}function _0x4bdb0e(){try{logger['info'](_0xa719('0xc'));var _0x1fac1e=moment()[_0xa719('0xd')]();var _0x48d4b0=_0x4910bd(_0x1fac1e+_0x4efd1d+_0x563754);_0x424a2e[_0xa719('0xe')](JSON['stringify']({'appID':_0x4efd1d,'timestamp':_0x1fac1e,'appKey':_0x48d4b0}));var _0xa02b19=fs[_0xa719('0xf')](_0x32a399);_0xa02b19['on']('data',function(_0x48eff7){_0x424a2e['send'](_0x48eff7);});_0xa02b19['on'](_0xa719('0x10'),function(){_0x424a2e[_0xa719('0xe')](_0xa719('0x11'));});}catch(_0x119603){logger[_0xa719('0x12')](_0xa719('0x13'),JSON[_0xa719('0x14')](_0x119603));_0x424a2e[_0xa719('0x15')]();}}function _0x45d1ef(_0x28c4b9){try{if(_0x28c4b9){var _0x1d6938=JSON['parse'](_0x28c4b9);switch(_0x1d6938[_0xa719('0x16')]){case 0x0:if(_0x1d6938[_0xa719('0x17')]){if(_0x1d6938['result'][_0xa719('0x18')]){logger[_0xa719('0x5')](_0xa719('0x19'),JSON[_0xa719('0x14')](_0x1d6938[_0xa719('0x17')][_0xa719('0x1a')]));_0x3a795e=_0x1d6938[_0xa719('0x17')][_0xa719('0x1a')][0x0]['transcript'];_0x488499=_0x1d6938['result'][_0xa719('0x1a')][0x0]['likelihood'];_0x5eb002='0';_0xb53e18=_0xa719('0x1b');_0x424a2e['terminate']();}}break;case 0x1:logger['info'](_0xa719('0x8'));_0x5eb002='1';_0xb53e18=_0xa719('0x8');break;case 0x2:logger[_0xa719('0x5')](_0xa719('0x1c'));_0x5eb002='2';_0xb53e18=_0xa719('0x1c');break;case 0x9:logger['info']('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x5eb002='9';_0xb53e18='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger['info'](_0xa719('0x1d'));_0x5eb002='10';_0xb53e18=_0xa719('0x1d');break;case 0xb:logger[_0xa719('0x5')](_0xa719('0x1e'));_0x5eb002='11';_0xb53e18=_0xa719('0x1e');}}}catch(_0x4b2cbf){logger[_0xa719('0x12')]('Tilde\x20ASR\x20parse\x20error',JSON['stringify'](_0x4b2cbf));_0x424a2e[_0xa719('0x15')]();}}function _0x32244a(){logger['info'](_0xa719('0x1f'));_0x5f5823({'transcript':_0x3a795e,'confidence':_0x488499,'status':_0x5eb002,'status_message':_0xb53e18});}function _0x6b0b9b(_0x4d665b){logger[_0xa719('0x12')](_0xa719('0x20'));if(!_[_0xa719('0x21')](_0x4d665b)){logger[_0xa719('0x12')](_['isObject'](_0x4d665b)?JSON['stringify'](_0x4d665b):_0x4d665b);}}_0x424a2e['on'](_0xa719('0x22'),_0x4bdb0e);_0x424a2e['on'](_0xa719('0x23'),_0x45d1ef);_0x424a2e['on'](_0xa719('0x10'),_0x32244a);_0x424a2e['on'](_0xa719('0x12'),_0x6b0b9b);});}; \ 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 d5593f3..df22048 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 _0x7c05=['./asr','exports'];(function(_0x1d8d9e,_0x20b77b){var _0x151b9d=function(_0x206d5f){while(--_0x206d5f){_0x1d8d9e['push'](_0x1d8d9e['shift']());}};_0x151b9d(++_0x20b77b);}(_0x7c05,0xb2));var _0x57c0=function(_0x2534cf,_0x545be6){_0x2534cf=_0x2534cf-0x0;var _0x221461=_0x7c05[_0x2534cf];return _0x221461;};var asr=require(_0x57c0('0x0'));module[_0x57c0('0x1')]={'asr':asr}; \ No newline at end of file +var _0x2d8d=['exports','./asr'];(function(_0x13d7d2,_0x112501){var _0x334216=function(_0x339151){while(--_0x339151){_0x13d7d2['push'](_0x13d7d2['shift']());}};_0x334216(++_0x112501);}(_0x2d8d,0x1df));var _0xd2d8=function(_0x4d2f00,_0x4e94d5){_0x4d2f00=_0x4d2f00-0x0;var _0x2d7b7f=_0x2d8d[_0x4d2f00];return _0x2d7b7f;};var asr=require(_0xd2d8('0x0'));module[_0xd2d8('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index a7010ed..9afc6b7 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 _0x34e8=['E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','inherits','exports','util','net','events','EventEmitter','./channel','call','emit','error'];(function(_0x449842,_0x3d7507){var _0x99e21f=function(_0x29ab8d){while(--_0x29ab8d){_0x449842['push'](_0x449842['shift']());}};_0x99e21f(++_0x3d7507);}(_0x34e8,0x12c));var _0x834e=function(_0x2811ff,_0x4be227){_0x2811ff=_0x2811ff-0x0;var _0x491af2=_0x34e8[_0x2811ff];return _0x491af2;};'use strict';var util=require(_0x834e('0x0'));var net=require(_0x834e('0x1'));var EventEmitter=require(_0x834e('0x2'))[_0x834e('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x834e('0x4'));var AGIServer=function(_0x21e2e0,_0x472111,_0x31bf20){var _0x289ef2=this;var _0x19a3e0=null;var _0x398bee=0x0;if(!_0x21e2e0)_0x21e2e0=0x11dd;if(!_0x472111)_0x472111='127.0.0.1';EventEmitter[_0x834e('0x5')](_0x289ef2);function _0x52056d(){if(!_0x21e2e0){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0x8')));return![];}_0x19a3e0=net[_0x834e('0x9')]();_0x19a3e0[_0x834e('0xa')](_0x21e2e0,_0x472111);_0x19a3e0['on'](_0x834e('0xb'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xb'));});_0x19a3e0['on'](_0x834e('0xc'),function(_0x186b3b){_0x19a3e0[_0x834e('0xd')](function(_0x36e124,_0x14038b){if(_0x36e124){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x36e124));}else if(_0x31bf20&&_0x31bf20<0x0){_0x289ef2[_0x834e('0x6')]('error',new AGIError(_0x834e('0xf')));_0x186b3b[_0x834e('0x10')]();}else if(_0x31bf20&&_0x31bf20>0x0&&_0x31bf20<_0x14038b){_0x398bee+=0x1;_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0x11'),_0x398bee));_0x186b3b[_0x834e('0x10')]();}else{var _0x21cc0a=new AGIChannel(_0x186b3b);_0x21cc0a['on']('ready',function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xc'),_0x21cc0a);});}});});_0x19a3e0['on']('error',function(_0x316205){_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x316205['code']));});_0x19a3e0['on'](_0x834e('0x12'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x834e('0x13')](function(){_0x52056d();});};util[_0x834e('0x14')](AGIServer,EventEmitter);module[_0x834e('0x15')]=function(_0xb993a1,_0x237947,_0x254677){return new AGIServer(_0xb993a1,_0x237947,_0x254677);}; \ No newline at end of file +var _0x34e8=['E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','inherits','exports','util','net','events','EventEmitter','./channel','call','emit','error'];(function(_0x126d77,_0x2b217d){var _0x36266a=function(_0x3c6a9b){while(--_0x3c6a9b){_0x126d77['push'](_0x126d77['shift']());}};_0x36266a(++_0x2b217d);}(_0x34e8,0x12c));var _0x834e=function(_0x562c06,_0x58d485){_0x562c06=_0x562c06-0x0;var _0x38b718=_0x34e8[_0x562c06];return _0x38b718;};'use strict';var util=require(_0x834e('0x0'));var net=require(_0x834e('0x1'));var EventEmitter=require(_0x834e('0x2'))[_0x834e('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x834e('0x4'));var AGIServer=function(_0x21e2e0,_0x472111,_0x31bf20){var _0x289ef2=this;var _0x19a3e0=null;var _0x398bee=0x0;if(!_0x21e2e0)_0x21e2e0=0x11dd;if(!_0x472111)_0x472111='127.0.0.1';EventEmitter[_0x834e('0x5')](_0x289ef2);function _0x52056d(){if(!_0x21e2e0){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0x8')));return![];}_0x19a3e0=net[_0x834e('0x9')]();_0x19a3e0[_0x834e('0xa')](_0x21e2e0,_0x472111);_0x19a3e0['on'](_0x834e('0xb'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xb'));});_0x19a3e0['on'](_0x834e('0xc'),function(_0x186b3b){_0x19a3e0[_0x834e('0xd')](function(_0x36e124,_0x14038b){if(_0x36e124){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x36e124));}else if(_0x31bf20&&_0x31bf20<0x0){_0x289ef2[_0x834e('0x6')]('error',new AGIError(_0x834e('0xf')));_0x186b3b[_0x834e('0x10')]();}else if(_0x31bf20&&_0x31bf20>0x0&&_0x31bf20<_0x14038b){_0x398bee+=0x1;_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0x11'),_0x398bee));_0x186b3b[_0x834e('0x10')]();}else{var _0x21cc0a=new AGIChannel(_0x186b3b);_0x21cc0a['on']('ready',function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xc'),_0x21cc0a);});}});});_0x19a3e0['on']('error',function(_0x316205){_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x316205['code']));});_0x19a3e0['on'](_0x834e('0x12'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x834e('0x13')](function(){_0x52056d();});};util[_0x834e('0x14')](AGIServer,EventEmitter);module[_0x834e('0x15')]=function(_0xb993a1,_0x237947,_0x254677){return new AGIServer(_0xb993a1,_0x237947,_0x254677);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index ba1bde3..2ae86cf 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 _0xa5fa=['ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','getData','response','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','goal','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','Enter\x20in\x20GOTOIF\x20(%s)\x20block','true','false','EVAL\x20CONDITION\x20%s\x20%s','condition','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','getIntervals','interval_id','no\x20intervals\x20found','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','%s/recordings/%s','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','no\x20queue\x20selected','queue_id','getVoiceQueue','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','macro','gosub','Executed\x20command\x20%s\x20%s','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','\x22%s\x22\x20<%s>','Smtp','user','bcc','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','answer','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','voicemail','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','lodash','shelljs','odbc','randomstring','mustache','request-promise','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','prototype','getVariableById','then','name','catch','rpc','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSoundById','getSoundPath','getMailAccountById','sendMailMessage','mailRpc','getIntervalById','IntervalId','interval','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','createSquareRecording','callerid','calleridname','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','callback_','random','isEmpty','lastName','phone','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','agentPause','isNil','agentUnpause','agent','agentLogout','internal','%s/%s@from-sip/n','agentLogin','shellCommand','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','timeout','number','includes','PUT','method','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','stringify','headers','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','Amy','aws_text_type','aws_access_key_id','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isArray','length','isPlainObject','saveRestApiResult','%s.%s','setVariable','split','replaceAll','getVariable','extra','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','sync','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','exec','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','getAndSetVariable','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','debug','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','DIALOGFLOW_%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','no\x20anguage\x20configured','providerResponse','out','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block'];(function(_0x548ec6,_0x38c2e7){var _0x5de15e=function(_0x85507d){while(--_0x85507d){_0x548ec6['push'](_0x548ec6['shift']());}};_0x5de15e(++_0x38c2e7);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x3779da,_0x48d0dd){_0x3779da=_0x3779da-0x0;var _0x3c1185=_0xa5fa[_0x3779da];return _0x3c1185;};'use strict';var fs=require('fs');var util=require('util');var _=require(_0xaa5f('0x0'));var sh=require(_0xaa5f('0x1'));var odbc=require(_0xaa5f('0x2'))();var rs=require(_0xaa5f('0x3'));var moment=require('moment');var Mustache=require(_0xaa5f('0x4'));var rp=require(_0xaa5f('0x5'));var logger=require('../../config/logger')(_0xaa5f('0x6'));var config=require(_0xaa5f('0x7'));var shared=require(_0xaa5f('0x8'));var scripts=require(_0xaa5f('0x9'));var FILES_PATH=_0xaa5f('0xa');var recursiveMapAttributes=[_0xaa5f('0xb'),_0xaa5f('0xc')];var verticesWithRetry=[_0xaa5f('0xd'),_0xaa5f('0xe'),_0xaa5f('0xf')];var AGIVertices=function(_0xb96e0,_0x4e5257,_0x1674c2){this[_0xaa5f('0x10')]=_0xb96e0;this['rpc']=_0x4e5257;this['mailRpc']=_0x1674c2;};AGIVertices[_0xaa5f('0x11')]['getVariable']=function(_0x4c184a,_0x1f3b2e){this['rpc'][_0xaa5f('0x12')](_0x4c184a)[_0xaa5f('0x13')](function(_0x206ed3){_0x1f3b2e(null,_0x206ed3?_0x206ed3[_0xaa5f('0x14')]:![]);})[_0xaa5f('0x15')](function(_0x48d1d3){_0x1f3b2e(_0x48d1d3);});};AGIVertices[_0xaa5f('0x11')]['getVoiceQueue']=function(_0x372881,_0x23f872){this[_0xaa5f('0x16')][_0xaa5f('0x17')](_0x372881)[_0xaa5f('0x13')](function(_0x5a4c41){_0x23f872(null,_0x5a4c41?_0x5a4c41['name']:![]);})[_0xaa5f('0x15')](function(_0x291042){_0x23f872(_0x291042);});};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x18')]=function(_0x27fdca,_0x1fa36a){this[_0xaa5f('0x16')][_0xaa5f('0x19')](_0x27fdca)[_0xaa5f('0x13')](function(_0x3d874f){_0x1fa36a(null,_0x3d874f?_0x3d874f[_0xaa5f('0x14')]:![]);})[_0xaa5f('0x15')](function(_0x4f4cd5){_0x1fa36a(_0x4f4cd5);});};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x1a')]=function(_0x1cbab5,_0x358d2e){this[_0xaa5f('0x16')][_0xaa5f('0x1b')](_0x1cbab5)[_0xaa5f('0x13')](function(_0x194691){_0x358d2e(null,_0x194691?_0x194691[_0xaa5f('0x1c')]:![]);})[_0xaa5f('0x15')](function(_0x40c223){_0x358d2e(_0x40c223);});};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x1d')]=function(_0x5238a8,_0x1e917d){this['rpc'][_0xaa5f('0x1e')](_0x5238a8)[_0xaa5f('0x13')](function(_0x561381){_0x1e917d(null,_0x561381?_0x561381[_0xaa5f('0x14')]:![]);})[_0xaa5f('0x15')](function(_0x5b9f0b){_0x1e917d(_0x5b9f0b);});};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x1f')]=function(_0x32cd16,_0xa09273){this[_0xaa5f('0x16')][_0xaa5f('0x20')](_0x32cd16)[_0xaa5f('0x13')](function(_0x2fba7d){_0xa09273(null,_0x2fba7d?_0x2fba7d['name']:![]);})[_0xaa5f('0x15')](function(_0x3a66e8){_0xa09273(_0x3a66e8);});};AGIVertices[_0xaa5f('0x11')]['getSound']=function(_0x3b17b6,_0x269209){var _0x438165=this;this['rpc'][_0xaa5f('0x21')](_0x3b17b6)['then'](function(_0x5990d2){_0x269209(null,_0x5990d2?_0x438165[_0xaa5f('0x22')](_0x5990d2['save_name']):![]);})[_0xaa5f('0x15')](function(_0x4e0ec9){_0x269209(_0x4e0ec9);});};AGIVertices['prototype']['getMailAccount']=function(_0x26a90d,_0x4ddebd){this[_0xaa5f('0x16')][_0xaa5f('0x23')](_0x26a90d)['then'](function(_0x58f608){_0x4ddebd(null,_0x58f608?_0x58f608:![]);})[_0xaa5f('0x15')](function(_0x5e858a){_0x4ddebd(_0x5e858a);});};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x24')]=function(_0x52132c,_0xda1742,_0x1610b8){this[_0xaa5f('0x25')]['sendMailMessage'](_0x52132c,_0xda1742)[_0xaa5f('0x13')](function(){_0x1610b8(null);})[_0xaa5f('0x15')](function(_0x527866){_0x1610b8(_0x527866);});};AGIVertices['prototype']['getIntervals']=function(_0x4a0abe,_0xbfb2f2){this[_0xaa5f('0x16')][_0xaa5f('0x26')](_0x4a0abe)[_0xaa5f('0x13')](function(_0x462fe6){if(_0x462fe6){if(_0x462fe6[_0xaa5f('0x27')]){_0xbfb2f2(null,[_0x462fe6[_0xaa5f('0x28')]]);}else{_0xbfb2f2(null,_['map'](_0x462fe6[_0xaa5f('0x29')],_0xaa5f('0x28')));}}else{_0xbfb2f2(null,![]);}})[_0xaa5f('0x15')](function(_0x1f3268){_0xbfb2f2(_0x1f3268);});};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x22')]=function(_0x49442c){return util[_0xaa5f('0x2a')](_0xaa5f('0x2b'),FILES_PATH,_0x49442c);};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x2c')]=function(_0x3dc2f5,_0x56ac45,_0x4dd41a){odbc[_0xaa5f('0x2d')](_0x3dc2f5,function(_0x40bc33){if(_0x40bc33){logger[_0xaa5f('0x2e')](_0xaa5f('0x2f'),_0x40bc33);_0x4dd41a(_0x40bc33);}else{logger['info'](_0xaa5f('0x30'));odbc[_0xaa5f('0x31')](_0x56ac45,function(_0x1a59d2,_0xb16782){if(_0x1a59d2){logger[_0xaa5f('0x32')](_0xaa5f('0x33'),_0x56ac45);_0x4dd41a(_0x1a59d2);}else{logger[_0xaa5f('0x32')](_0xaa5f('0x34'),_0x56ac45);odbc[_0xaa5f('0x35')](function(_0xff553f){if(_0xff553f){logger[_0xaa5f('0x2e')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0xff553f);}_0x4dd41a(null,_0xb16782);});}});}});};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x36')]=function(_0xcd9c30,_0x2dd9bb){this[_0xaa5f('0x16')][_0xaa5f('0x37')](_0xcd9c30)[_0xaa5f('0x13')](function(_0xa490d9){_0x2dd9bb(null,_0xa490d9?_0xa490d9:![]);})[_0xaa5f('0x15')](function(_0x2dad6f){_0x2dd9bb(_0x2dad6f);});};AGIVertices['prototype'][_0xaa5f('0x38')]=function(_0x5830a8,_0x1cad95){this[_0xaa5f('0x16')][_0xaa5f('0x38')](_0x5830a8)['then'](function(_0x1e535f){_0x1cad95(null,_0x1e535f);})[_0xaa5f('0x15')](function(_0xe49f8){_0x1cad95(_0xe49f8);});};AGIVertices['prototype'][_0xaa5f('0x39')]=function(_0x179be8,_0x1ac9b6,_0x3a470d){this['rpc'][_0xaa5f('0x39')]({'uniqueid':this[_0xaa5f('0x10')][_0xaa5f('0x3a')],'node':_0x179be8[_0xaa5f('0x3b')],'application':_0x179be8[_0xaa5f('0x3c')],'data':_0x1ac9b6||null,'project_name':this[_0xaa5f('0x10')][_0xaa5f('0x3d')],'callerid':this[_0xaa5f('0x10')]['callerid']})[_0xaa5f('0x13')](function(_0x5529f3){if(_0x3a470d){_0x3a470d(null,_0x5529f3);}})[_0xaa5f('0x15')](function(_0x5341af){if(_0x3a470d){_0x3a470d(_0x5341af);}});};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x3e')]=function(_0x506789,_0x37a53b,_0x1530a1,_0x21cea0){this['rpc']['createSquareRecording']({'uniqueid':this['channel'][_0xaa5f('0x3a')],'callerid':this['channel'][_0xaa5f('0x3f')],'calleridname':this[_0xaa5f('0x10')][_0xaa5f('0x40')],'context':this[_0xaa5f('0x10')]['context'],'extension':this[_0xaa5f('0x10')][_0xaa5f('0x41')],'priority':this[_0xaa5f('0x10')][_0xaa5f('0x42')],'accountcode':this[_0xaa5f('0x10')][_0xaa5f('0x43')],'dnid':this[_0xaa5f('0x10')][_0xaa5f('0x44')],'projectName':this[_0xaa5f('0x10')][_0xaa5f('0x3d')],'saveName':_0x37a53b,'filename':_0x506789[_0xaa5f('0x45')]||_0x37a53b,'savePath':_0x1530a1})[_0xaa5f('0x13')](function(_0x2be44d){_0x21cea0(null,_0x2be44d);})[_0xaa5f('0x15')](function(_0x690fcc){_0x21cea0(_0x690fcc);});};AGIVertices[_0xaa5f('0x11')]['createSquareMessage']=function(_0x3412f8,_0x242cd3,_0x264dd6,_0x3c2094,_0x2bc7d5){this[_0xaa5f('0x16')][_0xaa5f('0x46')]({'uniqueid':this['channel'][_0xaa5f('0x3a')],'body':_0x3412f8,'direction':_0x242cd3,'providerName':_0x264dd6,'providerResponse':_0x3c2094})[_0xaa5f('0x13')](function(_0x2050dd){if(_0x2bc7d5){_0x2bc7d5(null,_0x2050dd);}})[_0xaa5f('0x15')](function(_0x552c5a){if(_0x2bc7d5){_0x2bc7d5(_0x552c5a);}});};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x47')]=function(_0x36c4aa,_0x575803){this['rpc']['createCmContact']({'firstName':_['isEmpty'](_0x36c4aa['name'])||_['isNil'](_0x36c4aa[_0xaa5f('0x14')])?_0xaa5f('0x48')+Math[_0xaa5f('0x49')]():_0x36c4aa[_0xaa5f('0x14')],'lastName':_[_0xaa5f('0x4a')](_0x36c4aa[_0xaa5f('0x4b')])||_['isNil'](_0x36c4aa['lastName'])?null:_0x36c4aa[_0xaa5f('0x4b')],'phone':_0x36c4aa[_0xaa5f('0x4c')],'ListId':_0x36c4aa['list_id'],'scheduledat':_0x36c4aa[_0xaa5f('0x4d')],'callbackUniqueid':this[_0xaa5f('0x10')][_0xaa5f('0x3a')],'tags':_0xaa5f('0x4e'),'description':_0xaa5f('0x4f')+_0x36c4aa[_0xaa5f('0x4d')][_0xaa5f('0x50')](),'priority':_0x36c4aa['callback_priority']})['then'](function(_0x1be4fa){_0x575803(null,_0x1be4fa);})[_0xaa5f('0x15')](function(_0x5da797){_0x575803(_0x5da797);});};AGIVertices['prototype']['getPause']=function(_0x138485,_0x5e9510){this[_0xaa5f('0x16')]['getPauseById'](_0x138485)['then'](function(_0x29b323){_0x5e9510(null,_0x29b323?_0x29b323[_0xaa5f('0x14')]:![]);})[_0xaa5f('0x15')](function(_0x5ad5c3){_0x5e9510(_0x5ad5c3);});};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x51')]=function(_0x24bcf2,_0x4fe60d,_0x21d494){var _0x2fd00c={'role':'agent'};_0x2fd00c[_0x24bcf2]=this[_0xaa5f('0x10')][_0xaa5f('0x3f')];this[_0xaa5f('0x16')][_0xaa5f('0x51')](_0x2fd00c,_0x4fe60d,this[_0xaa5f('0x10')][_0xaa5f('0x3a')])[_0xaa5f('0x13')](function(_0x41fb5a){_0x21d494(null,_[_0xaa5f('0x52')](_0x41fb5a)?![]:!![]);})['catch'](function(_0x7e4313){logger[_0xaa5f('0x2e')](_0x7e4313);_0x21d494(null,![]);});};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x53')]=function(_0x1cbc61,_0x13c832){var _0x7af53e={'role':_0xaa5f('0x54')};_0x7af53e[_0x1cbc61]=this['channel'][_0xaa5f('0x3f')];this['rpc'][_0xaa5f('0x53')](_0x7af53e)[_0xaa5f('0x13')](function(_0x1c0d69){_0x13c832(null,_[_0xaa5f('0x52')](_0x1c0d69)?![]:!![]);})['catch'](function(_0x45f4f4){logger[_0xaa5f('0x2e')](_0x45f4f4);_0x13c832(null,![]);});};AGIVertices[_0xaa5f('0x11')]['agentLogout']=function(_0x2c5b30,_0x524f42){var _0x42ea3b={'role':'agent'};_0x42ea3b[_0x2c5b30]=this[_0xaa5f('0x10')][_0xaa5f('0x3f')];this[_0xaa5f('0x16')][_0xaa5f('0x55')](_0x42ea3b)['then'](function(_0x3f5ced){_0x524f42(null,_[_0xaa5f('0x52')](_0x3f5ced)?![]:!![]);})['catch'](function(_0x4e0263){logger[_0xaa5f('0x2e')](_0x4e0263);_0x524f42(null,![]);});};AGIVertices[_0xaa5f('0x11')]['agentLogin']=function(_0x3168f6,_0x23c864){var _0x3047bd={'role':'agent'};_0x3047bd[_0x3168f6]=this[_0xaa5f('0x10')][_0xaa5f('0x3f')];var _0x50cbe8=_0x3168f6!=_0xaa5f('0x56')?util[_0xaa5f('0x2a')](_0xaa5f('0x57'),'LOCAL',this[_0xaa5f('0x10')][_0xaa5f('0x3f')]):undefined;this['rpc'][_0xaa5f('0x58')](_0x3047bd,_0x50cbe8)[_0xaa5f('0x13')](function(_0x2f1f32){_0x23c864(null,_[_0xaa5f('0x52')](_0x2f1f32)?![]:!![]);})[_0xaa5f('0x15')](function(_0x59ab20){logger[_0xaa5f('0x2e')](_0x59ab20);_0x23c864(null,![]);});};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x59')]=function(_0x216399,_0x2a1049){sh['exec'](_[_0xaa5f('0x5a')](_0x216399),function(_0x597b33,_0x1a5b7d){var _0x15afd2=_0x1a5b7d[_0xaa5f('0x5b')](/(\r\n|\n|\r)/gm,'');_0x2a1049(null,_0x15afd2);});};AGIVertices[_0xaa5f('0x11')]['googleCloudTTS']=function(_0x461686,_0xda4cc5){scripts[_0xaa5f('0x5c')](_0x461686[_0xaa5f('0x5d')],_0x461686[_0xaa5f('0x5e')]||_0xaa5f('0x5f'),_0x461686['text'],_0x461686['languageCode']||_0xaa5f('0x60'),_0x461686[_0xaa5f('0x61')]||_0xaa5f('0x62'),_0x461686[_0xaa5f('0x63')]||_0xaa5f('0x64'))['then'](function(_0x5ad3af){_0xda4cc5(null,_0x5ad3af);})[_0xaa5f('0x15')](function(_0x14e88d){_0xda4cc5(_0x14e88d);});};AGIVertices['prototype'][_0xaa5f('0x65')]=function(_0x5bbf49,_0x469f92){scripts[_0xaa5f('0x65')](_0x5bbf49['text'],_0x5bbf49[_0xaa5f('0x66')]||'en',0x1)[_0xaa5f('0x13')](function(_0x214f02){_0x469f92(null,_0x214f02);})[_0xaa5f('0x15')](function(_0x3c16cb){_0x469f92(_0x3c16cb);});};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x67')]=function(_0x59e2be,_0x5f86aa){var _0x2974bd={'uri':_0x59e2be[_0xaa5f('0x68')],'method':_0x59e2be['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x59e2be[_0xaa5f('0x69')])===_0xaa5f('0x6a')&&parseInt(_0x59e2be[_0xaa5f('0x69')])>=0x1?parseInt(_0x59e2be[_0xaa5f('0x69')])*0x3e8:0x5*0x3e8};if(_[_0xaa5f('0x6b')](['POST',_0xaa5f('0x6c')],_0x2974bd[_0xaa5f('0x6d')][_0xaa5f('0x6e')]())){try{_0x2974bd[_0xaa5f('0x6f')]=_0x59e2be[_0xaa5f('0xc')]?JSON[_0xaa5f('0x70')](_0x59e2be[_0xaa5f('0xc')]):{};}catch(_0x399b51){logger[_0xaa5f('0x2e')](_0xaa5f('0x71'),_0x399b51);}}try{_0x2974bd['headers']=_0x59e2be['rawHeaders']?JSON[_0xaa5f('0x70')](_0x59e2be[_0xaa5f('0xb')]):{};}catch(_0x2aa1c9){logger[_0xaa5f('0x2e')](_0xaa5f('0x72'),_0x2aa1c9);}if(_0x59e2be[_0xaa5f('0x73')]){try{var _0x38e920=require(_0x59e2be[_0xaa5f('0x73')])['sync'](this,_0x2974bd);_0x2974bd[_0xaa5f('0x74')]=Mustache[_0xaa5f('0x75')](_0x59e2be[_0xaa5f('0x68')],_0x38e920,{},['$$','$$']);if(_0x2974bd['headers']){_0x2974bd['headers']=JSON[_0xaa5f('0x70')](Mustache[_0xaa5f('0x75')](JSON[_0xaa5f('0x76')](_0x2974bd[_0xaa5f('0x77')]),_0x38e920,{},['$$','$$']));}if(_0x2974bd[_0xaa5f('0x6f')]){_0x2974bd[_0xaa5f('0x6f')]=JSON[_0xaa5f('0x70')](Mustache[_0xaa5f('0x75')](JSON[_0xaa5f('0x76')](_0x2974bd[_0xaa5f('0x6f')]),_0x38e920,{},['$$','$$']));}}catch(_0x57181b){logger[_0xaa5f('0x2e')](_0xaa5f('0x78'),_0x57181b);}}rp(_0x2974bd)[_0xaa5f('0x13')](function(_0x46ab86){var _0x273d60={'statusCode':_0x46ab86['statusCode']||0xc8,'statusMessage':_0x46ab86[_0xaa5f('0x79')]||'OK','headers':_0x46ab86[_0xaa5f('0x77')]||{},'body':_0x46ab86[_0xaa5f('0x6f')]||{}};_0x5f86aa(null,_0x273d60);})['catch'](function(_0x553447){var _0x5a9db0={'statusCode':_0x553447[_0xaa5f('0x7a')]||0x1f4,'statusMessage':_0x553447[_0xaa5f('0x7b')]||_0xaa5f('0x7c'),'headers':_0x553447[_0xaa5f('0x7d')]['headers']||{},'body':_0x553447[_0xaa5f('0x7d')][_0xaa5f('0x6f')]||{}};_0x5f86aa(null,_0x5a9db0);});};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x7e')]=function(_0x423481,_0x2f7997){scripts[_0xaa5f('0x7e')](this[_0xaa5f('0x10')][_0xaa5f('0x3a')],_0x423481[_0xaa5f('0x7f')],_0x423481[_0xaa5f('0x5f')],_0x423481[_0xaa5f('0x80')]||'en')[_0xaa5f('0x13')](function(_0x2541fb){_0x2f7997(null,_0x2541fb);})[_0xaa5f('0x15')](function(_0x9bae94){_0x2f7997(_0x9bae94);});};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x81')]=function(_0x680042,_0x55ddc6){scripts[_0xaa5f('0x81')](this[_0xaa5f('0x10')][_0xaa5f('0x3a')],_0x680042[_0xaa5f('0x82')],_0x680042[_0xaa5f('0x83')],_0x680042['private_key'],_0x680042[_0xaa5f('0x5f')],_0x680042['dialogflowV2_language']||'en')[_0xaa5f('0x13')](function(_0x1afca5){_0x55ddc6(null,_0x1afca5);})[_0xaa5f('0x15')](function(_0x3846c3){_0x55ddc6(_0x3846c3);});};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x84')]=function(_0x11d5f5,_0x532f28){scripts[_0xaa5f('0x84')](this['channel'],_0x11d5f5)[_0xaa5f('0x13')](function(_0x40f2fa){_0x532f28(null,_0x40f2fa);})[_0xaa5f('0x15')](function(_0x1a88c9){_0x532f28(_0x1a88c9);});};AGIVertices['prototype'][_0xaa5f('0x85')]=function(_0x4f334e,_0x43cc1f){scripts['ispeechTTS'](_0x4f334e[_0xaa5f('0x7f')],_0x4f334e['text'],_0x4f334e[_0xaa5f('0x86')]||_0xaa5f('0x60'),_0x4f334e[_0xaa5f('0x87')])[_0xaa5f('0x13')](function(_0x484f8c){_0x43cc1f(null,_0x484f8c);})[_0xaa5f('0x15')](function(_0x4c68b3){_0x43cc1f(_0x4c68b3);});};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x88')]=function(_0x28c0a4,_0x270b84,_0x2b584e){scripts['ispeechASR'](_0x270b84,_0x28c0a4[_0xaa5f('0x7f')],_0x28c0a4[_0xaa5f('0x89')]||_0xaa5f('0x60'),this[_0xaa5f('0x8a')](_0x28c0a4[_0xaa5f('0x8b')])?_0x28c0a4[_0xaa5f('0x8b')]:undefined)[_0xaa5f('0x13')](function(_0x7f4b1a){_0x2b584e(null,_0x7f4b1a);})[_0xaa5f('0x15')](function(_0x4f9806){_0x2b584e(_0x4f9806);});};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x8c')]=function(_0x2f966f,_0x277d88){scripts[_0xaa5f('0x8c')](_0x2f966f['aws_access_key_id'],_0x2f966f[_0xaa5f('0x8d')],_0x2f966f[_0xaa5f('0x8e')],_0x2f966f['aws_polly_voice']||_0xaa5f('0x8f'),_0x2f966f[_0xaa5f('0x5f')],_0x2f966f[_0xaa5f('0x90')]||'text')['then'](function(_0x130c6b){_0x277d88(null,_0x130c6b);})['catch'](function(_0x50cf00){_0x277d88(_0x50cf00);});};AGIVertices['prototype']['awsLex']=function(_0x51e696,_0x5ba04d){scripts['awsLex'](this['channel'][_0xaa5f('0x3a')],_0x51e696[_0xaa5f('0x91')],_0x51e696[_0xaa5f('0x8d')],_0x51e696['aws_lex_region'],_0x51e696[_0xaa5f('0x5f')],_0x51e696[_0xaa5f('0x92')])[_0xaa5f('0x13')](function(_0x52e4f1){_0x5ba04d(null,_0x52e4f1);})[_0xaa5f('0x15')](function(_0x2be9a2){_0x5ba04d(_0x2be9a2);});};AGIVertices[_0xaa5f('0x11')]['googleASR']=function(_0x317a54,_0x18ae92,_0x54948d){scripts[_0xaa5f('0x93')](_0x18ae92,_0x317a54[_0xaa5f('0x7f')],_0x317a54[_0xaa5f('0x94')]||_0xaa5f('0x60'))[_0xaa5f('0x13')](function(_0x144146){_0x54948d(null,_0x144146);})[_0xaa5f('0x15')](function(_0xa90a53){_0x54948d(_0xa90a53);});};AGIVertices[_0xaa5f('0x11')]['tildeASR']=function(_0x313eed,_0xa27e1b,_0x5e8819){scripts[_0xaa5f('0x95')](_0xa27e1b,_0x313eed[_0xaa5f('0x96')],_0x313eed[_0xaa5f('0x97')],_0x313eed[_0xaa5f('0x74')])['then'](function(_0x2acdd6){_0x5e8819(null,_0x2acdd6);})[_0xaa5f('0x15')](function(_0x3ae5ba){_0x5e8819(_0x3ae5ba);});};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x98')]=function(_0x27023b){var _0x371318=_['includes'](verticesWithRetry,_0x27023b['agicommand'])?_0x27023b:_[_0xaa5f('0x99')](_0x27023b);for(var _0x450ad7 in _0x371318){if(_0x371318[_0xaa5f('0x9a')](_0x450ad7)){if(_0x371318[_0x450ad7]&&_[_0xaa5f('0x9b')](_0x371318[_0x450ad7])){if(_[_0xaa5f('0x6b')](recursiveMapAttributes,_0x450ad7)){_0x371318[_0x450ad7]=this[_0xaa5f('0x9c')](_0x371318[_0x450ad7]);}else{_0x371318[_0x450ad7]=this[_0xaa5f('0x9d')](_0x371318[_0x450ad7]);}}}}return _0x371318;};AGIVertices[_0xaa5f('0x11')]['recursiveNodeIndex']=function(_0x4fd786){for(var _0x2b8d3c in _0x4fd786){if(_0x4fd786[_0xaa5f('0x9a')](_0x2b8d3c)){if(_['isPlainObject'](_0x4fd786[_0x2b8d3c])){this[_0xaa5f('0x9e')](_0x4fd786[_0x2b8d3c]);}else if(_[_0xaa5f('0x9f')](_0x4fd786[_0x2b8d3c])){for(var _0x52b4ce=0x0;_0x52b4ce<_0x4fd786[_0x2b8d3c][_0xaa5f('0xa0')];_0x52b4ce++){this[_0xaa5f('0x9e')](_0x4fd786[_0x2b8d3c][_0x52b4ce]);}}else if(_[_0xaa5f('0x9b')](_0x4fd786[_0x2b8d3c])){_0x4fd786[_0x2b8d3c]=this[_0xaa5f('0x9d')](_0x4fd786[_0x2b8d3c]);}}}};AGIVertices[_0xaa5f('0x11')]['saveRestApiResult']=function(_0x3c1095,_0x4c9c4f){for(var _0x27a6a3 in _0x3c1095){if(_0x3c1095[_0xaa5f('0x9a')](_0x27a6a3)){if(_[_0xaa5f('0xa1')](_0x3c1095[_0x27a6a3])){if(!_['isEmpty'](_0x3c1095[_0x27a6a3])){this[_0xaa5f('0xa2')](_0x3c1095[_0x27a6a3],util[_0xaa5f('0x2a')](_0xaa5f('0xa3'),_0x4c9c4f,_0x27a6a3));}}else if(_[_0xaa5f('0x9f')](_0x3c1095[_0x27a6a3])){for(var _0x191567=0x0;_0x191567<_0x3c1095[_0x27a6a3][_0xaa5f('0xa0')];_0x191567++){this[_0xaa5f('0xa2')](_0x3c1095[_0x27a6a3][_0x191567],util[_0xaa5f('0x2a')](_0xaa5f('0xa3'),_0x4c9c4f,_0x27a6a3+'['+_0x191567+']'));}}else{if(!_[_0xaa5f('0x52')](_0x3c1095[_0x27a6a3])){this['channel'][_0xaa5f('0xa4')](util[_0xaa5f('0x2a')](_0xaa5f('0xa3'),_0x4c9c4f,_0x27a6a3),_0x3c1095[_0x27a6a3]);}}}}};AGIVertices[_0xaa5f('0x11')]['replaceObjectAllVariables']=function(_0x35b39f){try{var _0x451972=JSON[_0xaa5f('0x70')](_0x35b39f);this[_0xaa5f('0x9e')](_0x451972);return JSON['stringify'](_0x451972);}catch(_0x583a60){return this[_0xaa5f('0x9d')](_0x35b39f);}};AGIVertices[_0xaa5f('0x11')]['replaceAllVariables']=function(_0x5dc9d4){var _0xcc51f5=_0x5dc9d4['split']('{');for(var _0x16887b=0x1;_0x16887b<_0xcc51f5[_0xaa5f('0xa0')];_0x16887b+=0x1){var _0x11fc30=_0xcc51f5[_0x16887b][_0xaa5f('0xa5')]('}');if(_0x11fc30[_0xaa5f('0xa0')]>0x1){_0x5dc9d4=_0x5dc9d4[_0xaa5f('0xa6')]('{'+_0x11fc30[0x0]+'}',this[_0xaa5f('0x10')][_0xaa5f('0xa7')](_0x11fc30[0x0])[_0xaa5f('0xa8')]||_0x11fc30[0x0]);}}if(_0xcc51f5[_0xaa5f('0xa0')]===0x1){return _0x5dc9d4['toString']();}return this[_0xaa5f('0x9d')](_0x5dc9d4);};AGIVertices[_0xaa5f('0x11')]['getAndSetVariable']=function(_0x22ab2e,_0x56edcd){var _0x5aefa7=this[_0xaa5f('0x10')][_0xaa5f('0xa7')](_0x22ab2e);if(_0x5aefa7[_0xaa5f('0xa9')]===-0x1){return _0x5aefa7;}logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0xaa'),_0x56edcd,_0x5aefa7[_0xaa5f('0xa8')]));return this['channel'][_0xaa5f('0xa4')](_0x56edcd,_0x5aefa7[_0xaa5f('0xa8')]);};AGIVertices['prototype'][_0xaa5f('0x8a')]=function(_0x46742c){return _0x46742c&&_0x46742c!=='0'&&_0x46742c!=='-1'&&_0x46742c!=='';};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0xab')]=function(_0xf4bae){this[_0xaa5f('0x39')][_0xaa5f('0xac')](this,_0xf4bae,'-');_0xf4bae['retry']=_0xf4bae[_0xaa5f('0xab')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0xaa5f('0xad')]=function(_0x4cbff8){logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0xae'),_0x4cbff8['label']));if(!this[_0xaa5f('0x8a')](_0x4cbff8['text'])){return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](_0xaa5f('0xb0'));}var _0x100844='\x22'+_0x4cbff8['text']+'\x22';if(this[_0xaa5f('0x8a')](_0x4cbff8[_0xaa5f('0x7d')])){_0x100844+=','+_0x4cbff8[_0xaa5f('0x7d')];}var _0x38e30a=this[_0xaa5f('0x10')][_0xaa5f('0xb1')]('MRCPSynth',_0x100844);if(_0x38e30a['result']===-0x1){return _0x38e30a;}return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util[_0xaa5f('0x2a')](_0xaa5f('0xb2'),_0x100844));};AGIVertices['prototype']['mrcprecog']=function(_0x3c01cb){logger[_0xaa5f('0x32')](util['format'](_0xaa5f('0xb3'),_0x3c01cb[_0xaa5f('0x3b')]));if(!this[_0xaa5f('0x8a')](_0x3c01cb[_0xaa5f('0xb4')])){return this['channel'][_0xaa5f('0xaf')](_0xaa5f('0xb5'));}var _0x5854e1=_0x3c01cb[_0xaa5f('0xb4')];if(this[_0xaa5f('0x8a')](_0x3c01cb[_0xaa5f('0x7d')])){_0x5854e1+=','+_0x3c01cb[_0xaa5f('0x7d')];}var _0x5a3e0a=this['channel'][_0xaa5f('0xb1')](_0xaa5f('0xb6'),_0x5854e1);if(_0x5a3e0a[_0xaa5f('0xa9')]===-0x1){return _0x5a3e0a;}var _0x21a54c=this[_0xaa5f('0xb7')]('RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE');if(_0x21a54c[_0xaa5f('0xa9')]===-0x1){return _0x21a54c;}var _0x56da46=this[_0xaa5f('0xb7')](_0xaa5f('0xb8'),_0xaa5f('0xb9'));if(_0x56da46[_0xaa5f('0xa9')]===-0x1){return _0x56da46;}var _0x528221=this['getAndSetVariable'](_0xaa5f('0xba'),'MRCP_RECOG_INSTANCE');if(_0x528221['result']===-0x1){return _0x528221;}return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util[_0xaa5f('0x2a')](_0xaa5f('0xbb'),_0x5854e1));};AGIVertices[_0xaa5f('0x11')]['agi']=function(_0x59fa62){logger['info'](util[_0xaa5f('0x2a')](_0xaa5f('0xbc'),_0x59fa62[_0xaa5f('0x3b')]));return this[_0xaa5f('0x10')][_0xaa5f('0x6')]([_0x59fa62[_0xaa5f('0xbd')],_0x59fa62[_0xaa5f('0xbe')]]);};AGIVertices[_0xaa5f('0x11')]['answer']=function(_0x41cf35){logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0xbf'),_0x41cf35[_0xaa5f('0x3b')]));if(this[_0xaa5f('0x8a')](_0x41cf35[_0xaa5f('0x69')])){logger[_0xaa5f('0x32')](util['format'](_0xaa5f('0xc0'),_0x41cf35[_0xaa5f('0x69')]));var _0x3b63b4=this['channel'][_0xaa5f('0xc1')](_0x41cf35[_0xaa5f('0x69')]);if(_0x3b63b4[_0xaa5f('0xa9')]===-0x1){return _0x3b63b4;}}return this[_0xaa5f('0x10')]['answer']();};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x4e')]=function(_0x520063){logger['info'](util[_0xaa5f('0x2a')](_0xaa5f('0xc2'),_0x520063['label']));if(!this[_0xaa5f('0x8a')](_0x520063[_0xaa5f('0xc3')])){return this[_0xaa5f('0x10')]['error'](_0x520063,_0xaa5f('0xc4'));}_0x520063['scheduledAt']=moment();if(this[_0xaa5f('0x8a')](_0x520063['delay'])){_0x520063[_0xaa5f('0x4d')]=moment()['add'](_0x520063[_0xaa5f('0xc5')],'minutes');}if(!this[_0xaa5f('0x8a')](_0x520063[_0xaa5f('0xc6')])){_0x520063[_0xaa5f('0xc6')]=0x2;}this['createCmContact'][_0xaa5f('0xac')](this,_0x520063);return this['channel']['noop'](util[_0xaa5f('0x2a')](_0xaa5f('0xc7'),_0x520063[_0xaa5f('0x4c')],_0x520063['list_id'],_0x520063[_0xaa5f('0x4d')]));};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0xc8')]=function(_0x2b8701){logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0xc9'),_0x2b8701[_0xaa5f('0x3b')]));var _0x1ed396=this[_0xaa5f('0x10')][_0xaa5f('0xb1')](_0x2b8701['application'],_0x2b8701[_0xaa5f('0x7d')]);if(_0x1ed396[_0xaa5f('0xa9')]===-0x1){return _0x1ed396;}return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util[_0xaa5f('0x2a')]('Executed\x20command\x20%s\x20%s',_0x2b8701[_0xaa5f('0xca')],_0x2b8701['options']));};AGIVertices[_0xaa5f('0x11')]['lumenvoxtts']=function(_0x3ae74f){logger['info'](util[_0xaa5f('0x2a')](_0xaa5f('0xcb'),_0x3ae74f[_0xaa5f('0x3b')]));if(!this[_0xaa5f('0x8a')](_0x3ae74f['text'])){return this['channel'][_0xaa5f('0xaf')](_0xaa5f('0xb0'));}var _0x5117a1='\x22'+_0x3ae74f[_0xaa5f('0x5f')]+'\x22';if(this[_0xaa5f('0x8a')](_0x3ae74f[_0xaa5f('0x7d')])){_0x5117a1+=','+_0x3ae74f[_0xaa5f('0x7d')];}var _0x2e8ff9=this[_0xaa5f('0x10')][_0xaa5f('0xb1')](_0xaa5f('0xcc'),_0x5117a1);if(_0x2e8ff9[_0xaa5f('0xa9')]===-0x1){return _0x2e8ff9;}return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util[_0xaa5f('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x5117a1));};AGIVertices['prototype']['sestektts']=function(_0x2b5c02){logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0xcd'),_0x2b5c02['label']));if(!this[_0xaa5f('0x8a')](_0x2b5c02[_0xaa5f('0x5f')])){return this[_0xaa5f('0x10')]['noop']('no\x20text\x20configured');}var _0x353cc8='\x22'+_0x2b5c02['text']+'\x22';if(this['isConfigured'](_0x2b5c02['options'])){_0x353cc8+=','+_0x2b5c02[_0xaa5f('0x7d')];}var _0x5168fb=this[_0xaa5f('0x10')][_0xaa5f('0xb1')](_0xaa5f('0xcc'),_0x353cc8);if(_0x5168fb[_0xaa5f('0xa9')]===-0x1){return _0x5168fb;}return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util[_0xaa5f('0x2a')](_0xaa5f('0xb2'),_0x353cc8));};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0xce')]=function(_0x598570){logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0xcf'),_0x598570[_0xaa5f('0x3b')]));if(!this['isConfigured'](_0x598570[_0xaa5f('0xb4')])){return this[_0xaa5f('0x10')]['noop'](_0xaa5f('0xb5'));}var _0x3cd604=_0x598570[_0xaa5f('0xb4')];if(this[_0xaa5f('0x8a')](_0x598570[_0xaa5f('0x7d')])){_0x3cd604+=','+_0x598570[_0xaa5f('0x7d')];}var _0x32bec6=this[_0xaa5f('0x10')][_0xaa5f('0xb1')](_0xaa5f('0xb6'),_0x3cd604);if(_0x32bec6['result']===-0x1){return _0x32bec6;}var _0x5c6de6=this[_0xaa5f('0xb7')](_0xaa5f('0xd0'),_0xaa5f('0xd1'));if(_0x5c6de6[_0xaa5f('0xa9')]===-0x1){return _0x5c6de6;}var _0x1f9d16=this[_0xaa5f('0xb7')](_0xaa5f('0xb8'),_0xaa5f('0xd2'));if(_0x1f9d16[_0xaa5f('0xa9')]===-0x1){return _0x1f9d16;}var _0x5186ea=this[_0xaa5f('0xb7')](_0xaa5f('0xba'),'LUMENVOX_ASR_INSTANCE');if(_0x5186ea[_0xaa5f('0xa9')]===-0x1){return _0x5186ea;}return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util[_0xaa5f('0x2a')](_0xaa5f('0xbb'),_0x3cd604));};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0xd3')]=function(_0x4db80a){logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0xd4'),_0x4db80a[_0xaa5f('0x3b')]));if(!this[_0xaa5f('0x8a')](_0x4db80a[_0xaa5f('0xb4')])){return this[_0xaa5f('0x10')][_0xaa5f('0xaf')]('no\x20grammar\x20configured');}var _0x483e6f=_0x4db80a['grammar'];if(this[_0xaa5f('0x8a')](_0x4db80a['options'])){_0x483e6f+=','+_0x4db80a[_0xaa5f('0x7d')];}var _0x280aa9=this[_0xaa5f('0x10')]['exec'](_0xaa5f('0xb6'),_0x483e6f);if(_0x280aa9[_0xaa5f('0xa9')]===-0x1){return _0x280aa9;}var _0x53a88a=this[_0xaa5f('0xb7')](_0xaa5f('0xd0'),_0xaa5f('0xd5'));if(_0x53a88a['result']===-0x1){return _0x53a88a;}var _0x8481da=this['getAndSetVariable'](_0xaa5f('0xb8'),'SESTEK_ASR_TRANSCRIPT');if(_0x8481da[_0xaa5f('0xa9')]===-0x1){return _0x8481da;}var _0x4fe6de=this['getAndSetVariable'](_0xaa5f('0xba'),_0xaa5f('0xd6'));if(_0x4fe6de[_0xaa5f('0xa9')]===-0x1){return _0x4fe6de;}return this['channel'][_0xaa5f('0xaf')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x483e6f));};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0xd7')]=function(_0x35aad9){logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0xd8'),_0x35aad9['label']));if(!this[_0xaa5f('0x8a')](_0x35aad9['odbc_id'])){return this[_0xaa5f('0x10')][_0xaa5f('0x2e')](_0x35aad9,_0xaa5f('0xd9'));}var _0x17b066=this[_0xaa5f('0x1a')][_0xaa5f('0xac')](this,_0x35aad9[_0xaa5f('0xda')]);if(!_0x17b066){return this[_0xaa5f('0x10')]['error'](_0x35aad9,_0xaa5f('0xdb'));}if(!this[_0xaa5f('0x8a')](_0x35aad9['query'])){return this[_0xaa5f('0x10')][_0xaa5f('0x2e')](_0x35aad9,_0xaa5f('0xdc'));}var _0x4ad337=_0x35aad9[_0xaa5f('0x31')][_0xaa5f('0x5b')](/(\r\n|\n|\r)/gm,'\x20');this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util['format']('query:\x20%s',_0x4ad337));var _0x448a2d=this[_0xaa5f('0x2c')][_0xaa5f('0xac')](this,_0x17b066,_0x4ad337);this['createSquareDetailsReport'][_0xaa5f('0xac')](this,_0x35aad9,_0x4ad337);if(!this[_0xaa5f('0x8a')](_0x35aad9['variable_id'])){return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](_0xaa5f('0xdd'));}var _0x9f45a4=this[_0xaa5f('0xa7')][_0xaa5f('0xac')](this,_0x35aad9[_0xaa5f('0xde')]);if(!_0x9f45a4){return this[_0xaa5f('0x10')]['error'](_0x35aad9,_0xaa5f('0xdf'));}var _0xb67c16=this;_0x448a2d[_0xaa5f('0xe0')](function(_0x95a76e,_0x7edd22){Object['keys'](_0x95a76e)[_0xaa5f('0xe0')](function(_0x417997){_0xb67c16[_0xaa5f('0x10')][_0xaa5f('0xa4')](util['format'](_0xaa5f('0xe1'),_0x9f45a4,_0x7edd22,_0x417997),_0x95a76e[_0x417997]);});});this[_0xaa5f('0x10')][_0xaa5f('0xa4')](util['format'](_0xaa5f('0xe2'),_0x9f45a4),_0x448a2d[_0xaa5f('0xa0')]);return this['channel'][_0xaa5f('0xaf')](util[_0xaa5f('0x2a')](_0xaa5f('0xe3'),_0x9f45a4));};AGIVertices[_0xaa5f('0x11')]['dial']=function(_0x90f8e9){logger[_0xaa5f('0xe4')](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x90f8e9[_0xaa5f('0x3b')]));if(!this[_0xaa5f('0x8a')](_0x90f8e9[_0xaa5f('0xe5')])){return this['channel'][_0xaa5f('0x2e')](_0x90f8e9,_0xaa5f('0xe6'));}var _0x4aa45d=this[_0xaa5f('0x1d')][_0xaa5f('0xac')](this,_0x90f8e9[_0xaa5f('0xe5')]);if(!_0x4aa45d){return this[_0xaa5f('0x10')][_0xaa5f('0x2e')](_0x90f8e9,_0xaa5f('0xe7'));}var _0x51d55d=this[_0xaa5f('0x10')]['exec'](_0xaa5f('0xe8'),[util['format'](_0xaa5f('0xe9'),_0x4aa45d),_0x90f8e9['timeout'],_0x90f8e9[_0xaa5f('0xea')],_0x90f8e9['url']]);if(_0x51d55d[_0xaa5f('0xa9')]===-0x1){return _0x51d55d;}return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util[_0xaa5f('0x2a')](_0xaa5f('0xeb'),_0xaa5f('0xe8')));};AGIVertices['prototype'][_0xaa5f('0xec')]=function(_0x48940f){logger['info'](util[_0xaa5f('0x2a')](_0xaa5f('0xed'),_0x48940f['label']));if(!this[_0xaa5f('0x8a')](_0x48940f['key'])){return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](_0xaa5f('0xee'));}if(!this['isConfigured'](_0x48940f['text'])){return this['channel']['noop'](_0xaa5f('0xb0'));}this['channel'][_0xaa5f('0xef')]=!![];this[_0xaa5f('0x39')](_0x48940f);this['createSquareMessage'](_0x48940f[_0xaa5f('0x5f')],'in','','');this['channel'][_0xaa5f('0xaf')](util['format']('Trying\x20Dialogflow:\x20%s',_0x48940f['text']));var _0x206a8a=this[_0xaa5f('0x7e')][_0xaa5f('0xac')](this,_0x48940f);if(_0x206a8a){for(var _0x2b1cf4 in _0x206a8a){if(_0x206a8a[_0xaa5f('0x9a')](_0x2b1cf4)){this[_0xaa5f('0x10')][_0xaa5f('0xa4')](util[_0xaa5f('0x2a')](_0xaa5f('0xf0'),_0x2b1cf4[_0xaa5f('0x6e')]()),_0x206a8a[_0x2b1cf4]);}}this['createSquareMessage'](_0x206a8a[_0xaa5f('0xf1')],'out',_0xaa5f('0xec'),'');return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util[_0xaa5f('0x2a')]('Dialogflow\x20Result\x20%s',_0x206a8a[_0xaa5f('0xf1')]));}return this[_0xaa5f('0x10')][_0xaa5f('0x2e')](_0x48940f,_0xaa5f('0xf2'));};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0xf3')]=function(_0x12a44b){logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0xf4'),_0x12a44b['label']));if(!this[_0xaa5f('0x8a')](_0x12a44b['dialogflowV2_project_id'])){return this['channel'][_0xaa5f('0xaf')](_0xaa5f('0xf5'));}if(!this['isConfigured'](_0x12a44b[_0xaa5f('0x83')])){return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](_0xaa5f('0xf6'));}if(!this[_0xaa5f('0x8a')](_0x12a44b[_0xaa5f('0xf7')])){return this['channel'][_0xaa5f('0xaf')](_0xaa5f('0xf8'));}if(!this[_0xaa5f('0x8a')](_0x12a44b['dialogflowV2_language'])){return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](_0xaa5f('0xf9'));}if(!this[_0xaa5f('0x8a')](_0x12a44b['text'])){return this['channel'][_0xaa5f('0xaf')](_0xaa5f('0xb0'));}this[_0xaa5f('0x10')][_0xaa5f('0xef')]=!![];this['createSquareDetailsReport'](_0x12a44b);this[_0xaa5f('0x46')](_0x12a44b['text'],'in','','');this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util['format']('Trying\x20DialogflowV2:\x20%s',_0x12a44b[_0xaa5f('0x5f')]));var _0x1323c4=this['googleDialogflowV2'][_0xaa5f('0xac')](this,_0x12a44b);if(_0x1323c4){for(var _0x3adb32 in _0x1323c4){if(_0x1323c4[_0xaa5f('0x9a')](_0x3adb32)){if(_0x3adb32!==_0xaa5f('0xfa')){this['channel'][_0xaa5f('0xa4')](util[_0xaa5f('0x2a')](_0xaa5f('0xf0'),_0x3adb32[_0xaa5f('0x6e')]()),_0x1323c4[_0x3adb32]);}}}this[_0xaa5f('0x46')](_0x1323c4[_0xaa5f('0xf1')],_0xaa5f('0xfb'),'dialogflowV2',_0x1323c4[_0xaa5f('0xfa')]);return this[_0xaa5f('0x10')]['noop'](util[_0xaa5f('0x2a')](_0xaa5f('0xfc'),_0x1323c4['speech']));}return this[_0xaa5f('0x10')][_0xaa5f('0x2e')](_0x12a44b,_0xaa5f('0xfd'));};AGIVertices['prototype'][_0xaa5f('0xfe')]=function(_0x62a348){logger['info'](util['format'](_0xaa5f('0xff'),_0x62a348[_0xaa5f('0x3b')]));if(!this[_0xaa5f('0x8a')](_0x62a348[_0xaa5f('0x100')])){return this['channel'][_0xaa5f('0xaf')](_0xaa5f('0x101'));}if(!this[_0xaa5f('0x8a')](_0x62a348[_0xaa5f('0x102')])){return this['channel'][_0xaa5f('0xaf')]('no\x20username\x20configured');}if(!this[_0xaa5f('0x8a')](_0x62a348[_0xaa5f('0x103')])){return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](_0xaa5f('0x104'));}if(!this['isConfigured'](_0x62a348[_0xaa5f('0x105')])){return this['channel'][_0xaa5f('0xaf')]('no\x20text\x20configured');}this[_0xaa5f('0x10')]['bot']=!![];this['createSquareDetailsReport'](_0x62a348);this['createSquareMessage'](_0x62a348[_0xaa5f('0x5f')],'in','','');this[_0xaa5f('0x10')]['noop'](util[_0xaa5f('0x2a')](_0xaa5f('0x106'),_0x62a348['text']));var _0xa6033b=this['sestekNDA'][_0xaa5f('0xac')](this,_0x62a348);if(_0xa6033b){for(var _0x5846ea in _0xa6033b){if(_0xa6033b[_0xaa5f('0x9a')](_0x5846ea)){this[_0xaa5f('0x10')]['setVariable'](util[_0xaa5f('0x2a')](_0xaa5f('0x107'),_0x5846ea['toUpperCase']()),_0xa6033b[_0x5846ea]);}}this['createSquareMessage'](_0xa6033b[_0xaa5f('0xf1')],_0xaa5f('0xfb'),_0xaa5f('0xfe'),'');if(_0xa6033b[_0xaa5f('0x108')]){this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util[_0xaa5f('0x2a')](_0xaa5f('0x109'),_0xa6033b[_0xaa5f('0x108')]));var _0x398313=this[_0xaa5f('0x10')][_0xaa5f('0x10a')](_0xa6033b['audiofile']);try{fs['unlink'](_0xa6033b[_0xaa5f('0x108')]+_0xaa5f('0x10b'));}catch(_0x3e0a14){logger[_0xaa5f('0x2e')](_0x3e0a14);}return _0x398313;}else{return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util['format'](_0xaa5f('0x10c'),_0xa6033b['speech']));}}return this[_0xaa5f('0x10')][_0xaa5f('0x2e')](_0x62a348,_0xaa5f('0x10d'));};AGIVertices['prototype'][_0xaa5f('0x10e')]=function(_0x1917a6){logger['info'](util['format'](_0xaa5f('0x10f'),_0x1917a6[_0xaa5f('0x3b')]));return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](_0xaa5f('0x10e'));};AGIVertices['prototype'][_0xaa5f('0x110')]=function(_0x372f34){logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0x111'),_0x372f34[_0xaa5f('0x3b')]));var _0x435ab1='';if(_0x372f34[_0xaa5f('0x112')]){if(!this[_0xaa5f('0x8a')](_0x372f34['trunk_id'])){return this[_0xaa5f('0x10')][_0xaa5f('0x2e')](_0x372f34,_0xaa5f('0x113'));}else{var _0x5c0fa8=parseInt(_0x372f34[_0xaa5f('0x112')],0xa);if(isNaN(_0x5c0fa8)){_0x435ab1=_0x372f34['trunk_id'];}else{_0x435ab1=this[_0xaa5f('0x1f')][_0xaa5f('0xac')](this,_0x372f34['trunk_id']);if(!_0x435ab1){return this['channel']['error'](_0x372f34,_0xaa5f('0x114'));}}}}else if(_0x372f34[_0xaa5f('0x115')]){_0x435ab1=_0x372f34['trunk_name'];}else{return this[_0xaa5f('0x10')][_0xaa5f('0x2e')](_0x372f34,'no\x20trunk\x20selected');}var _0x590fa3=this[_0xaa5f('0x10')][_0xaa5f('0xb1')](_0xaa5f('0xe8'),[util[_0xaa5f('0x2a')](_0xaa5f('0x116'),_0x435ab1,_0x372f34[_0xaa5f('0x4c')]),_0x372f34[_0xaa5f('0x69')],_0x372f34[_0xaa5f('0xea')],_0x372f34['url']]);if(_0x590fa3[_0xaa5f('0xa9')]===-0x1){return _0x590fa3;}return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util['format'](_0xaa5f('0xeb'),_0xaa5f('0xe8')));};AGIVertices[_0xaa5f('0x11')]['finally']=function(_0x3671a1){logger['info'](util[_0xaa5f('0x2a')](_0xaa5f('0x117'),_0x3671a1['label']));return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](_0xaa5f('0x118'));};AGIVertices[_0xaa5f('0x11')]['getdigits']=function(_0x21f956){logger['info'](util[_0xaa5f('0x2a')](_0xaa5f('0x119'),_0x21f956['label']));if(_0x21f956[_0xaa5f('0x11a')]===0x0){return this[_0xaa5f('0xab')](_0x21f956);}_0x21f956['retry']-=0x1;if(!this[_0xaa5f('0x8a')](_0x21f956[_0xaa5f('0x11b')])){return this[_0xaa5f('0x10')][_0xaa5f('0x2e')](_0x21f956,_0xaa5f('0x11c'));}var _0x76214b=this[_0xaa5f('0x11d')]['sync'](this,_0x21f956[_0xaa5f('0x11b')]);if(!_0x76214b){return this[_0xaa5f('0x10')][_0xaa5f('0x2e')](_0x21f956,_0xaa5f('0x11e'));}if(!this[_0xaa5f('0x8a')](_0x21f956[_0xaa5f('0xde')])){return this[_0xaa5f('0x10')][_0xaa5f('0x2e')](_0xaa5f('0xdd'));}var _0x1f9341=this[_0xaa5f('0x10')][_0xaa5f('0x11f')](_0x76214b,_0x21f956[_0xaa5f('0x120')],_0x21f956[_0xaa5f('0x121')]);var _0x13ea55=_0x1f9341['result']?_0x1f9341[_0xaa5f('0xa9')][_0xaa5f('0x50')]():'';logger['info']('test',JSON[_0xaa5f('0x76')](_0x1f9341));if(_0x1f9341['result']===-0x1){this[_0xaa5f('0x39')]['sync'](this,_0x21f956,_0x13ea55);return _0x1f9341;}else if(_0x1f9341[_0xaa5f('0xa8')]==='timeout'){_0x1f9341['result']=_0x13ea55[_0xaa5f('0xa0')]>=parseInt(_0x21f956[_0xaa5f('0x122')])?'x':'i';}else{_0x1f9341[_0xaa5f('0xa9')]=_0x13ea55[_0xaa5f('0xa0')]>=parseInt(_0x21f956[_0xaa5f('0x122')])&&_0x13ea55['length']<=parseInt(_0x21f956[_0xaa5f('0x121')])?'x':'i';}var _0x3bed0e=this[_0xaa5f('0xa7')][_0xaa5f('0xac')](this,_0x21f956['variable_id']);if(!_0x3bed0e){return this[_0xaa5f('0x10')][_0xaa5f('0x2e')](_0x21f956,_0xaa5f('0xdf'));}this['channel'][_0xaa5f('0xa4')](_0x3bed0e,_0x13ea55);if(this[_0xaa5f('0x8a')](_0x21f956[_0xaa5f('0x123')])){var _0x20c542=parseInt(_0x21f956['hiddendigitsnum'],0xa);var _0x58847a=rs[_0xaa5f('0x124')]({'charset':'*','length':_0x20c542});var _0x2fc451=_0x13ea55[_0xaa5f('0xa0')];if(_0x2fc451>0x0){if(_0x2fc451>_0x20c542){this[_0xaa5f('0x39')][_0xaa5f('0xac')](this,_0x21f956,_0x21f956[_0xaa5f('0x125')]===_0xaa5f('0x126')?_0x58847a+_0x13ea55[_0xaa5f('0x127')](_0x20c542):_0x13ea55[_0xaa5f('0x127')](0x0,_0x2fc451-_0x20c542)+_0x58847a);}else{this[_0xaa5f('0x39')][_0xaa5f('0xac')](this,_0x21f956,rs[_0xaa5f('0x124')]({'charset':'*','length':_0x2fc451}));}}else{this[_0xaa5f('0x39')][_0xaa5f('0xac')](this,_0x21f956,'');}}else{this[_0xaa5f('0x39')][_0xaa5f('0xac')](this,_0x21f956,_0x13ea55);}return _0x1f9341;};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0xf')]=function(_0x192a99){logger[_0xaa5f('0x32')](util['format']('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x192a99[_0xaa5f('0x3b')]));return this[_0xaa5f('0xe')](_0x192a99);};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x128')]=function(_0x281a82){logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x281a82['label']));this[_0xaa5f('0x39')][_0xaa5f('0xac')](this,_0x281a82,_0x281a82[_0xaa5f('0x129')]);return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util['format'](_0xaa5f('0x12a'),_0x281a82['goalname']));};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x12b')]=function(_0x144507){logger['info'](util['format'](_0xaa5f('0x12c'),_0x144507['label']));if(!this[_0xaa5f('0x8a')](_0x144507[_0xaa5f('0x91')])||!this['isConfigured'](_0x144507[_0xaa5f('0x8d')])){return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](_0xaa5f('0x12d'));}if(!this['isConfigured'](_0x144507[_0xaa5f('0x5f')])){return this[_0xaa5f('0x10')]['noop'](_0xaa5f('0xb0'));}this['channel'][_0xaa5f('0xaf')](util[_0xaa5f('0x2a')](_0xaa5f('0x12e'),_0x144507[_0xaa5f('0x5f')]));var _0x1fef81=this[_0xaa5f('0x8c')][_0xaa5f('0xac')](this,_0x144507);if(_0x1fef81){this[_0xaa5f('0x10')]['noop'](util[_0xaa5f('0x2a')](_0xaa5f('0x12f'),_0x1fef81));var _0x41b09b=this[_0xaa5f('0x10')][_0xaa5f('0x10a')](_0x1fef81);try{fs[_0xaa5f('0x130')](_0x1fef81+'.wav');}catch(_0x2afc26){logger['error'](_0x2afc26);}return _0x41b09b;}return this[_0xaa5f('0x10')][_0xaa5f('0x2e')](_0x144507,_0xaa5f('0x131'));};AGIVertices['prototype'][_0xaa5f('0x132')]=function(_0x120435){logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0x133'),_0x120435[_0xaa5f('0x3b')]));if(!this[_0xaa5f('0x8a')](_0x120435[_0xaa5f('0x91')])||!this['isConfigured'](_0x120435[_0xaa5f('0x8d')])){return this['channel'][_0xaa5f('0xaf')](_0xaa5f('0x12d'));}if(!this[_0xaa5f('0x8a')](_0x120435[_0xaa5f('0x92')])){return this[_0xaa5f('0x10')]['noop'](_0xaa5f('0x134'));}if(!this[_0xaa5f('0x8a')](_0x120435[_0xaa5f('0x5f')])){return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](_0xaa5f('0xb0'));}this[_0xaa5f('0x10')][_0xaa5f('0xef')]=!![];this[_0xaa5f('0x39')](_0x120435);this['createSquareMessage'](_0x120435[_0xaa5f('0x5f')],'in','','');this[_0xaa5f('0x10')]['noop'](util['format'](_0xaa5f('0x135'),_0x120435[_0xaa5f('0x5f')]));var _0xcfd421=this['awsLex'][_0xaa5f('0xac')](this,_0x120435);if(_0xcfd421){for(var _0x33494a in _0xcfd421){if(_0xcfd421[_0xaa5f('0x9a')](_0x33494a)&&_[_0xaa5f('0x9b')](_0xcfd421[_0x33494a])){this[_0xaa5f('0x10')][_0xaa5f('0xa4')](util['format'](_0xaa5f('0x136'),_0x33494a['toUpperCase']()),_0xcfd421[_0x33494a]);}}if(_['isNil'](_0xcfd421[_0xaa5f('0x7b')])){return this[_0xaa5f('0x10')][_0xaa5f('0xaf')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this['createSquareMessage'](_0xcfd421[_0xaa5f('0x7b')],_0xaa5f('0xfb'),_0xaa5f('0x137'),'');return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util[_0xaa5f('0x2a')]('Amazon\x20Lex\x20Result\x20%s',_0xcfd421[_0xaa5f('0x7b')]));}}return this[_0xaa5f('0x10')][_0xaa5f('0x2e')](_0x120435,_0xaa5f('0x138'));};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x139')]=function(_0x426569){logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0x13a'),_0x426569[_0xaa5f('0x3b')],_0x426569[_0xaa5f('0x69')]));if(!this[_0xaa5f('0x8a')](_0x426569['key'])){return this['channel']['noop']('no\x20key\x20configured');}var _0x5e5c8d=_0xaa5f('0x13b');var _0x48c522=util[_0xaa5f('0x2a')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0xb2bff=util['format']('%s.%s',_0x48c522,_0x5e5c8d);var _0x218ceb=!![];if(_0x426569[_0xaa5f('0x13c')]===_0xaa5f('0x13d')){_0x218ceb=![];}var _0x80d7bc=this[_0xaa5f('0x10')][_0xaa5f('0x13e')](_0x48c522,_0x5e5c8d,_0x426569[_0xaa5f('0x13f')],_0x426569['timeout'],undefined,_0x218ceb);if(_0x80d7bc[_0xaa5f('0xa9')]!==-0x1){this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util[_0xaa5f('0x2a')](_0xaa5f('0x140'),_0xb2bff));var _0xbe01f7=this[_0xaa5f('0x93')][_0xaa5f('0xac')](this,_0x426569,_0xb2bff);if(_0xbe01f7){for(var _0x5eef7a in _0xbe01f7){if(_0xbe01f7['hasOwnProperty'](_0x5eef7a)){this[_0xaa5f('0x10')]['setVariable'](util[_0xaa5f('0x2a')]('GOOGLE_ASR_%s',_0x5eef7a[_0xaa5f('0x6e')]()),_0xbe01f7[_0x5eef7a]);}}return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util[_0xaa5f('0x2a')](_0xaa5f('0x141'),JSON[_0xaa5f('0x76')](_0xbe01f7)));}}return _0x80d7bc;};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x142')]=function(_0x167c4f){logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0x143'),_0x167c4f[_0xaa5f('0x3b')]));if(!this[_0xaa5f('0x8a')](_0x167c4f[_0xaa5f('0x96')])){return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](_0xaa5f('0x144'));}if(!this[_0xaa5f('0x8a')](_0x167c4f['appsecret'])){return this[_0xaa5f('0x10')][_0xaa5f('0xaf')]('no\x20appsecret\x20configured');}var _0x442d20=_0xaa5f('0x13b');var _0x460779=util[_0xaa5f('0x2a')]('%s/recordings/%s',FILES_PATH,rs[_0xaa5f('0x124')](0x4));var _0x4f1e62=util[_0xaa5f('0x2a')](_0xaa5f('0xa3'),_0x460779,_0x442d20);var _0x1f1424=!![];if(_0x167c4f[_0xaa5f('0x13c')]===_0xaa5f('0x13d')){_0x1f1424=![];}var _0x355b29=this[_0xaa5f('0x10')][_0xaa5f('0x13e')](_0x460779,_0x442d20,_0x167c4f['intKey'],_0x167c4f[_0xaa5f('0x69')],undefined,_0x1f1424);if(_0x355b29['result']!==-0x1){this[_0xaa5f('0x10')]['noop'](util[_0xaa5f('0x2a')](_0xaa5f('0x145'),_0x4f1e62));var _0x40be67=this['tildeASR'][_0xaa5f('0xac')](this,_0x167c4f,_0x4f1e62);if(_0x40be67){for(var _0x41ad8c in _0x40be67){if(_0x40be67['hasOwnProperty'](_0x41ad8c)){this[_0xaa5f('0x10')]['setVariable'](util[_0xaa5f('0x2a')](_0xaa5f('0x146'),_0x41ad8c[_0xaa5f('0x6e')]()),_0x40be67[_0x41ad8c]);}}return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util[_0xaa5f('0x2a')](_0xaa5f('0x147'),JSON[_0xaa5f('0x76')](_0x40be67)));}}return _0x355b29;};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x148')]=function(_0x4bc971){logger[_0xaa5f('0x32')](util['format'](_0xaa5f('0x149'),_0x4bc971['label']));return this[_0xaa5f('0x10')][_0xaa5f('0x14a')](_0x4bc971[_0xaa5f('0x14b')],_0x4bc971[_0xaa5f('0x41')],_0x4bc971[_0xaa5f('0x42')]);};AGIVertices[_0xaa5f('0x11')]['gotoif']=function(_0x37be2c){logger['info'](util[_0xaa5f('0x2a')](_0xaa5f('0x14c'),_0x37be2c[_0xaa5f('0x3b')]));if(!this[_0xaa5f('0x8a')](_0x37be2c['condition'])){return this['channel'][_0xaa5f('0x2e')](_0x37be2c,'no\x20condition\x20configured');}try{var _0xc9c4f6=eval(_0x37be2c['condition'])?_0xaa5f('0x14d'):_0xaa5f('0x14e');this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util[_0xaa5f('0x2a')](_0xaa5f('0x14f'),_0x37be2c[_0xaa5f('0x150')],_0xc9c4f6));return{'code':0xc8,'result':_0xc9c4f6};}catch(_0x498bb8){return{'code':0xc8,'result':_0xaa5f('0x14e')};}};AGIVertices['prototype'][_0xaa5f('0x151')]=function(_0x30dcf8){logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0x152'),_0x30dcf8[_0xaa5f('0x3b')]));if(!this[_0xaa5f('0x8a')](_0x30dcf8['interval_id'])){return this[_0xaa5f('0x10')]['error'](_0x30dcf8,_0xaa5f('0x153'));}var _0xfb72d7=this[_0xaa5f('0x154')][_0xaa5f('0xac')](this,_0x30dcf8[_0xaa5f('0x155')]);if(!_0xfb72d7){return this['channel']['error'](_0x30dcf8,_0xaa5f('0x156'));}for(var _0xe81091=0x0;_0xe81091<_0xfb72d7[_0xaa5f('0xa0')];_0xe81091+=0x1){var _0x17eb13=this[_0xaa5f('0x10')][_0xaa5f('0xa7')](util[_0xaa5f('0x2a')]('IFTIME(%s?true:false)',_0xfb72d7[_0xe81091]));if(_0x17eb13[_0xaa5f('0xa9')]===-0x1){return _0x17eb13;}logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0x157'),_0xfb72d7[_0xe81091],_0x17eb13[_0xaa5f('0xa8')]));if(_0x17eb13[_0xaa5f('0xa8')]===_0xaa5f('0x14d')){logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0x157'),_0xfb72d7[_0xe81091],'true'));this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util['format'](_0xaa5f('0x157'),_0xfb72d7[_0xe81091],_0xaa5f('0x14d')));return{'code':0xc8,'result':_0xaa5f('0x14d')};}else{logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0x157'),_0xfb72d7[_0xe81091],'false'));this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util[_0xaa5f('0x2a')](_0xaa5f('0x157'),_0xfb72d7[_0xe81091],'false'));}}return{'code':0xc8,'result':_0xaa5f('0x14e')};};AGIVertices[_0xaa5f('0x11')]['hangup']=function(_0x3f376b){logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0x158'),_0x3f376b[_0xaa5f('0x3b')]));return this[_0xaa5f('0x10')]['hangup']();};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x159')]=function(_0x2184e4){logger[_0xaa5f('0x32')](util['format']('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x2184e4[_0xaa5f('0x3b')]));if(!this['isConfigured'](_0x2184e4[_0xaa5f('0x7f')])){return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](_0xaa5f('0xee'));}var _0x5c4830=_0xaa5f('0x13b');var _0xa87b2=util[_0xaa5f('0x2a')](_0xaa5f('0x15a'),FILES_PATH,rs[_0xaa5f('0x124')](0x4));var _0x2e8fab=util[_0xaa5f('0x2a')]('%s.%s',_0xa87b2,_0x5c4830);var _0xc75cff=!![];if(_0x2184e4[_0xaa5f('0x13c')]===_0xaa5f('0x13d')){_0xc75cff=![];}var _0x45c34e=this[_0xaa5f('0x10')][_0xaa5f('0x13e')](_0xa87b2,_0x5c4830,_0x2184e4[_0xaa5f('0x13f')],_0x2184e4[_0xaa5f('0x69')],undefined,_0xc75cff);if(_0x45c34e[_0xaa5f('0xa9')]!==-0x1){this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util['format'](_0xaa5f('0x15b'),_0x2e8fab));var _0xcdac38=this[_0xaa5f('0x88')][_0xaa5f('0xac')](this,_0x2184e4,_0x2e8fab);if(_0xcdac38){for(var _0x40ff50 in _0xcdac38){if(_0xcdac38[_0xaa5f('0x9a')](_0x40ff50)){this[_0xaa5f('0x10')][_0xaa5f('0xa4')](util[_0xaa5f('0x2a')](_0xaa5f('0x15c'),_0x40ff50[_0xaa5f('0x6e')]()),_0xcdac38[_0x40ff50]);}}return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util[_0xaa5f('0x2a')](_0xaa5f('0x15d'),JSON[_0xaa5f('0x76')](_0xcdac38)));}}return _0x45c34e;};AGIVertices['prototype']['ispeechtts']=function(_0x40214f){logger[_0xaa5f('0x32')](util['format'](_0xaa5f('0x15e'),_0x40214f[_0xaa5f('0x3b')]));if(!this[_0xaa5f('0x8a')](_0x40214f[_0xaa5f('0x7f')])){return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](_0xaa5f('0xee'));}if(!this[_0xaa5f('0x8a')](_0x40214f['text'])){return this['channel'][_0xaa5f('0xaf')](_0xaa5f('0xb0'));}this[_0xaa5f('0x10')]['noop'](util['format']('Trying\x20ispeech\x20TTS\x20%s',_0x40214f['text']));var _0x3f024f=this[_0xaa5f('0x85')][_0xaa5f('0xac')](this,_0x40214f);if(_0x3f024f){this['channel'][_0xaa5f('0xaf')](util['format'](_0xaa5f('0x15b'),_0x3f024f));var _0x491320=this[_0xaa5f('0x10')][_0xaa5f('0x10a')](_0x3f024f,_0x40214f[_0xaa5f('0x13f')]);try{fs['unlink'](_0x3f024f+_0xaa5f('0x10b'));}catch(_0x49aba5){logger['error'](_0x49aba5);}return _0x491320;}return this[_0xaa5f('0x10')]['error'](_0x40214f,_0xaa5f('0x15f'));};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x160')]=function(_0x41683f){logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0x161'),_0x41683f[_0xaa5f('0x3b')]));if(!this[_0xaa5f('0x8a')](_0x41683f[_0xaa5f('0x162')])){return this['channel']['error'](_0x41683f,_0xaa5f('0x163'));}logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0x164'),this['channel']['callerid'],_0x41683f[_0xaa5f('0x162')]));var _0x402dfe=this[_0xaa5f('0x58')][_0xaa5f('0xac')](this,_0x41683f[_0xaa5f('0x162')]);if(_0x402dfe){logger[_0xaa5f('0x32')](util['format'](_0xaa5f('0x165'),this[_0xaa5f('0x10')][_0xaa5f('0x3f')],_0x41683f[_0xaa5f('0x162')]));this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util[_0xaa5f('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xaa5f('0x3f')],_0x41683f['findBy']));return{'code':0xc8,'result':_0xaa5f('0x166')};}else{logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0x167'),this['channel']['callerid'],_0x41683f[_0xaa5f('0x162')]));this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util['format'](_0xaa5f('0x167'),this[_0xaa5f('0x10')][_0xaa5f('0x3f')],_0x41683f[_0xaa5f('0x162')]));return{'code':0xc8,'result':_0xaa5f('0x168')};}};AGIVertices[_0xaa5f('0x11')]['logout']=function(_0x527f04){logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0x169'),_0x527f04[_0xaa5f('0x3b')]));if(!this[_0xaa5f('0x8a')](_0x527f04[_0xaa5f('0x162')])){return this[_0xaa5f('0x10')][_0xaa5f('0x2e')](_0x527f04,'no\x20find\x20by\x20configured');}logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xaa5f('0x10')][_0xaa5f('0x3f')],_0x527f04[_0xaa5f('0x162')]));var _0xd64cc2=this[_0xaa5f('0x55')]['sync'](this,_0x527f04[_0xaa5f('0x162')]);if(_0xd64cc2){logger['info'](util[_0xaa5f('0x2a')](_0xaa5f('0x165'),this[_0xaa5f('0x10')][_0xaa5f('0x3f')],_0x527f04['findBy']));this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util[_0xaa5f('0x2a')](_0xaa5f('0x165'),this[_0xaa5f('0x10')][_0xaa5f('0x3f')],_0x527f04['findBy']));return{'code':0xc8,'result':_0xaa5f('0x166')};}else{logger[_0xaa5f('0x32')](util['format'](_0xaa5f('0x167'),this[_0xaa5f('0x10')][_0xaa5f('0x3f')],_0x527f04[_0xaa5f('0x162')]));this['channel'][_0xaa5f('0xaf')](util[_0xaa5f('0x2a')](_0xaa5f('0x167'),this[_0xaa5f('0x10')][_0xaa5f('0x3f')],_0x527f04[_0xaa5f('0x162')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x16a')]=function(_0x2342ad){logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x2342ad[_0xaa5f('0x3b')]));if(!this['isConfigured'](_0x2342ad[_0xaa5f('0x16b')])){return this[_0xaa5f('0x10')][_0xaa5f('0x2e')](_0x2342ad,_0xaa5f('0x16c'));}this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util[_0xaa5f('0x2a')](_0xaa5f('0x16d'),_0x2342ad[_0xaa5f('0x16b')]));var _0x5d8447=eval(_0x2342ad[_0xaa5f('0x16b')]);if(!this[_0xaa5f('0x8a')](_0x2342ad[_0xaa5f('0xde')])){return this[_0xaa5f('0x10')][_0xaa5f('0xaf')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x45eb3b=this['getVariable'][_0xaa5f('0xac')](this,_0x2342ad[_0xaa5f('0xde')]);if(!_0x45eb3b){return this[_0xaa5f('0x10')][_0xaa5f('0x2e')](_0x2342ad,_0xaa5f('0xdf'));}if(_[_0xaa5f('0x9f')](_0x5d8447)){var _0x2962f4=this;_0x5d8447['forEach'](function(_0x66d10a,_0x24bf4e){_0x2962f4[_0xaa5f('0x10')][_0xaa5f('0xa4')](util['format'](_0xaa5f('0x16e'),_0x45eb3b,_0x24bf4e),_0x66d10a);});return this[_0xaa5f('0x10')]['noop'](util[_0xaa5f('0x2a')]('variable\x20%s[key]\x20set',_0x45eb3b));}else{return this[_0xaa5f('0x10')][_0xaa5f('0xa4')](_0x45eb3b,_0x5d8447);}};AGIVertices['prototype'][_0xaa5f('0xd')]=function(_0x21350f){logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0x16f'),_0x21350f[_0xaa5f('0x3b')]));if(_0x21350f[_0xaa5f('0x11a')]===0x0){return this[_0xaa5f('0xab')](_0x21350f);}_0x21350f[_0xaa5f('0x11a')]-=0x1;if(!this['isConfigured'](_0x21350f[_0xaa5f('0x11b')])){return this[_0xaa5f('0x10')][_0xaa5f('0x2e')](_0x21350f,_0xaa5f('0x11c'));}var _0x2d49da=this['getSound'][_0xaa5f('0xac')](this,_0x21350f[_0xaa5f('0x11b')]);if(!_0x2d49da){return this[_0xaa5f('0x10')]['error'](_0x21350f,'no\x20file\x20audio\x20found');}var _0x388b03=this[_0xaa5f('0x10')][_0xaa5f('0x11f')](_0x2d49da,_0x21350f['response'],_0x21350f[_0xaa5f('0x170')]);var _0x58cacf=_0x388b03[_0xaa5f('0xa9')];if(_0x388b03['result']===-0x1){this['createSquareDetailsReport'][_0xaa5f('0xac')](this,_0x21350f,'-1');return _0x388b03;}else if(_0x388b03['extra']==='timeout'){_0x388b03['result']=_0x388b03['result'][_0xaa5f('0xa0')]>0x0?_0x388b03[_0xaa5f('0xa9')]:'t';}else if(_[_0xaa5f('0x4a')](_0x388b03['result'])){_0x388b03[_0xaa5f('0xa9')]='#';_0x58cacf='#';}if(!this[_0xaa5f('0x8a')](_0x21350f[_0xaa5f('0xde')])){this[_0xaa5f('0x10')][_0xaa5f('0xaf')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x4819fc=this[_0xaa5f('0xa7')][_0xaa5f('0xac')](this,_0x21350f[_0xaa5f('0xde')]);if(!_0x4819fc){return this[_0xaa5f('0x10')][_0xaa5f('0x2e')](_0x21350f,'no\x20variable\x20found');}this[_0xaa5f('0x10')][_0xaa5f('0xa4')](_0x4819fc,_0x58cacf);}this[_0xaa5f('0x39')]['sync'](this,_0x21350f,_0x58cacf);return _0x388b03;};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0xaf')]=function(_0xe1d168){logger[_0xaa5f('0x32')](util['format'](_0xaa5f('0x171'),_0xe1d168[_0xaa5f('0x3b')]));return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](_0xe1d168[_0xaa5f('0x172')]||_0xe1d168['label']);};AGIVertices['prototype'][_0xaa5f('0x173')]=function(_0x4e892c){logger[_0xaa5f('0x32')](util['format'](_0xaa5f('0x174'),_0x4e892c['label']));if(!this[_0xaa5f('0x8a')](_0x4e892c[_0xaa5f('0x162')])){return this[_0xaa5f('0x10')][_0xaa5f('0x2e')](_0x4e892c,'no\x20find\x20by\x20configured');}logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0x164'),this[_0xaa5f('0x10')][_0xaa5f('0x3f')],_0x4e892c[_0xaa5f('0x162')]));var _0x35968a=this['getPause'][_0xaa5f('0xac')](this,_0x4e892c['pause_id']);var _0xa7a2b8=this[_0xaa5f('0x51')][_0xaa5f('0xac')](this,_0x4e892c[_0xaa5f('0x162')],_0x35968a);if(_0xa7a2b8){logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xaa5f('0x10')][_0xaa5f('0x3f')],_0x4e892c[_0xaa5f('0x162')]));this[_0xaa5f('0x10')]['noop'](util[_0xaa5f('0x2a')](_0xaa5f('0x165'),this[_0xaa5f('0x10')][_0xaa5f('0x3f')],_0x4e892c[_0xaa5f('0x162')]));return{'code':0xc8,'result':_0xaa5f('0x166')};}else{logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0x167'),this[_0xaa5f('0x10')][_0xaa5f('0x3f')],_0x4e892c[_0xaa5f('0x162')]));this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util[_0xaa5f('0x2a')](_0xaa5f('0x165'),this[_0xaa5f('0x10')][_0xaa5f('0x3f')],_0x4e892c[_0xaa5f('0x162')]));return{'code':0xc8,'result':_0xaa5f('0x168')};}};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x175')]=function(_0x23c652){logger['info'](util['format'](_0xaa5f('0x176'),_0x23c652[_0xaa5f('0x3b')]));if(!this[_0xaa5f('0x8a')](_0x23c652[_0xaa5f('0x11b')])){return this['channel']['error'](_0x23c652,_0xaa5f('0x11c'));}var _0x547b01=this[_0xaa5f('0x11d')][_0xaa5f('0xac')](this,_0x23c652[_0xaa5f('0x11b')]);if(!_0x547b01){return this['channel'][_0xaa5f('0x2e')](_0x23c652,_0xaa5f('0x11e'));}var _0x2adc66=this[_0xaa5f('0x10')][_0xaa5f('0xb1')](_0xaa5f('0x177'),[_0x547b01,_0x23c652[_0xaa5f('0xea')]]);if(_0x2adc66[_0xaa5f('0xa9')]===-0x1){return _0x2adc66;}return this[_0xaa5f('0x10')]['noop'](util[_0xaa5f('0x2a')]('Executed\x20command\x20%s\x20%s',_0xaa5f('0x177'),_0x547b01));};AGIVertices['prototype'][_0xaa5f('0x178')]=function(_0x4259d8){logger[_0xaa5f('0x32')](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x4259d8['label']));if(!this[_0xaa5f('0x8a')](_0x4259d8['queue_id'])){return this['channel']['error'](_0x4259d8,_0xaa5f('0x179'));}var _0xb991ca='';var _0x5b8663=parseInt(_0x4259d8[_0xaa5f('0x17a')],0xa);if(isNaN(_0x5b8663)){_0xb991ca=_0x4259d8[_0xaa5f('0x17a')];}else{_0xb991ca=this[_0xaa5f('0x17b')][_0xaa5f('0xac')](this,_0x4259d8[_0xaa5f('0x17a')]);if(!_0xb991ca){return this[_0xaa5f('0x10')][_0xaa5f('0x2e')](_0x4259d8,_0xaa5f('0x17c'));}}var _0x4e69a8='';if(this[_0xaa5f('0x8a')](_0x4259d8['file_id'])){var _0x59ea7f=this['getSound']['sync'](this,_0x4259d8[_0xaa5f('0x11b')]);if(_0x59ea7f){_0x4e69a8=_0x59ea7f;}}this[_0xaa5f('0x39')]['sync'](this,_0x4259d8,_0xb991ca);if(_0x4259d8[_0xaa5f('0xea')][_0xaa5f('0x17d')]('x')<0x0){_0x4259d8[_0xaa5f('0xea')]+='x';}if(_0x4259d8[_0xaa5f('0xea')][_0xaa5f('0x17d')]('X')<0x0){_0x4259d8['opts']+='X';}this[_0xaa5f('0x10')][_0xaa5f('0xa4')]('XMCS-QUEUE',_0xb991ca?_0xb991ca[_0xaa5f('0x17e')]():'');var _0x5c6ac2=this[_0xaa5f('0x10')][_0xaa5f('0xb1')](_0xaa5f('0x17f'),[_0xb991ca,_0x4259d8[_0xaa5f('0xea')],_0x4259d8['url'],_0x4e69a8,_0x4259d8[_0xaa5f('0x69')],_0x4259d8['agi'],_0x4259d8[_0xaa5f('0x180')],_0x4259d8[_0xaa5f('0x181')],'',_0x4259d8['position']]);if(_0x5c6ac2[_0xaa5f('0xa9')]===-0x1){return _0x5c6ac2;}return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util[_0xaa5f('0x2a')](_0xaa5f('0x182'),_0xaa5f('0x17f'),_0xb991ca));};AGIVertices['prototype']['record']=function(_0x44c733){logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0x183'),_0x44c733[_0xaa5f('0x3b')]));var _0x5da7ab=_0x44c733[_0xaa5f('0x184')]||'wav';var _0x2705c5=util[_0xaa5f('0x2a')](_0xaa5f('0x185'),this[_0xaa5f('0x10')][_0xaa5f('0x3a')],rs[_0xaa5f('0x124')](0x5));var _0x32878b=util['format'](_0xaa5f('0x186'),FILES_PATH,_0x2705c5,_0x5da7ab);var _0x28bc55=util[_0xaa5f('0x2a')](_0xaa5f('0x15a'),FILES_PATH,_0x2705c5);this[_0xaa5f('0x3e')][_0xaa5f('0xac')](this,_0x44c733,_0x2705c5,_0x32878b);this[_0xaa5f('0x10')]['setVariable']('RECORDING_SAVENAME',_0x2705c5);logger[_0xaa5f('0x32')](_0xaa5f('0x187'),_0x28bc55,_0x5da7ab,_0x44c733[_0xaa5f('0x188')],_0x44c733['timeout']);return this[_0xaa5f('0x10')]['recordFile'](_0x28bc55,_0x5da7ab,_0x44c733['escape_digits'],_0x44c733[_0xaa5f('0x69')],undefined,!![]);};AGIVertices[_0xaa5f('0x11')]['restapi']=function(_0x5e10d1){logger['info'](util['format'](_0xaa5f('0x189'),_0x5e10d1[_0xaa5f('0x3b')]));if(!this[_0xaa5f('0x8a')](_0x5e10d1[_0xaa5f('0x68')])){return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](_0xaa5f('0x18a'));}var _0x3d67c7=this[_0xaa5f('0x67')][_0xaa5f('0xac')](this,_0x5e10d1);logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0x18b'),util[_0xaa5f('0x18c')](_0x3d67c7,{'showHidden':![],'depth':null})));if(!this[_0xaa5f('0x8a')](_0x5e10d1['variable_id'])){return this[_0xaa5f('0x10')]['noop'](_0xaa5f('0x18d'));}var _0x50a0bf=this[_0xaa5f('0xa7')][_0xaa5f('0xac')](this,_0x5e10d1[_0xaa5f('0xde')]);if(!_0x50a0bf){return this[_0xaa5f('0x10')][_0xaa5f('0x2e')](_0x5e10d1,'no\x20variable\x20found');}this[_0xaa5f('0x10')]['setVariable'](util[_0xaa5f('0x2a')](_0xaa5f('0x18e'),_0x50a0bf),_0x3d67c7[_0xaa5f('0x7a')]?_0x3d67c7['statusCode']:_0xaa5f('0x18f'));this[_0xaa5f('0x10')]['setVariable'](util[_0xaa5f('0x2a')](_0xaa5f('0x190'),_0x50a0bf),_0x3d67c7['statusMessage']?_0x3d67c7[_0xaa5f('0x79')]:'OK');if(_0x3d67c7[_0xaa5f('0x6f')]){try{this['saveRestApiResult'](_0x3d67c7[_0xaa5f('0x6f')],_0x50a0bf);}catch(_0x79a137){logger[_0xaa5f('0x2e')](util[_0xaa5f('0x2a')](_0xaa5f('0x191'),_0x50a0bf));}}return this['channel'][_0xaa5f('0xaf')](util[_0xaa5f('0x2a')](_0xaa5f('0xe3'),_0x50a0bf));};AGIVertices[_0xaa5f('0x11')]['saydigits']=function(_0x3eb9d3){logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x3eb9d3[_0xaa5f('0x3b')]));return this['channel'][_0xaa5f('0x192')](_0x3eb9d3[_0xaa5f('0x193')][_0xaa5f('0x5b')](/\s+/g,''),_0x3eb9d3[_0xaa5f('0x188')]);};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x194')]=function(_0x2dc670){logger['info'](util[_0xaa5f('0x2a')](_0xaa5f('0x195'),_0x2dc670[_0xaa5f('0x3b')]));return this[_0xaa5f('0x10')][_0xaa5f('0x196')](_0x2dc670['number'][_0xaa5f('0x5b')](/\s+/g,''),_0x2dc670[_0xaa5f('0x188')]);};AGIVertices['prototype']['sayphonetic']=function(_0x27ac44){logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0x197'),_0x27ac44['label']));return this[_0xaa5f('0x10')][_0xaa5f('0x198')](_0x27ac44['text'],_0x27ac44[_0xaa5f('0x188')]);};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x199')]=function(_0x1fd376){logger['info'](util[_0xaa5f('0x2a')](_0xaa5f('0x19a'),_0x1fd376[_0xaa5f('0x3b')]));if(!this['isConfigured'](_0x1fd376[_0xaa5f('0x19b')])){return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](_0xaa5f('0x19c'));}var _0x3b07cb=this[_0xaa5f('0x19d')]['sync'](this,_0x1fd376[_0xaa5f('0x19b')]);if(!_0x3b07cb||!_0x3b07cb['Smtp']){return this[_0xaa5f('0x10')]['error'](_0x1fd376,'no\x20mail\x20account\x20found');}var _0x47c174={'from':util['format'](_0xaa5f('0x19e'),_0x3b07cb[_0xaa5f('0x14')],_0x3b07cb['email']||_0x3b07cb[_0xaa5f('0x19f')][_0xaa5f('0x1a0')]),'to':_0x1fd376['to']||'','cc':_0x1fd376['cc']||'','bcc':_0x1fd376[_0xaa5f('0x1a1')]||'','subject':_0x1fd376['subject'],'html':_0x1fd376['text'],'text':_0x1fd376[_0xaa5f('0x5f')]};if(this[_0xaa5f('0x8a')](_0x1fd376[_0xaa5f('0x1a2')])){}logger[_0xaa5f('0xe4')](_0xaa5f('0x1a3'),JSON[_0xaa5f('0x76')](_0x47c174));this['createSquareDetailsReport'][_0xaa5f('0xac')](this,_0x1fd376,_0x1fd376[_0xaa5f('0x19b')]);this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util['format'](_0xaa5f('0x1a4'),_0x3b07cb[_0xaa5f('0x14')]));this['sendMailMessage'][_0xaa5f('0xac')](this,_0x3b07cb[_0xaa5f('0x1a5')],_0x47c174);return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](_0xaa5f('0x1a6'));};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x1a7')]=function(_0x1f43f5){logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0x1a8'),_0x1f43f5[_0xaa5f('0x3b')]));return this[_0xaa5f('0x10')]['noop'](_0xaa5f('0x1a9'));};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x1aa')]=function(_0x515978){logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0x1ab'),_0x515978[_0xaa5f('0x3b')]));if(!this[_0xaa5f('0x8a')](_0x515978[_0xaa5f('0x1ac')])){return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](_0xaa5f('0x1ad'));}var _0x1c8673=this[_0xaa5f('0x36')]['sync'](this,_0x515978[_0xaa5f('0x1ac')]);if(!_0x1c8673){return this[_0xaa5f('0x10')][_0xaa5f('0x2e')](_0x515978,'no\x20sms\x20account\x20found');}var _0x1cec14={'body':_0x515978['sms_text'],'phone':_0x515978['to']||'','SmsAccountId':_0x1c8673['id']};logger[_0xaa5f('0xe4')]('sendSMS\x20message',JSON[_0xaa5f('0x76')](_0x1cec14));this['createSquareDetailsReport'][_0xaa5f('0xac')](this,_0x515978,_0x515978[_0xaa5f('0x1ac')]);this['channel'][_0xaa5f('0xaf')](util['format'](_0xaa5f('0x1ae'),_0x1c8673[_0xaa5f('0x14')]));this[_0xaa5f('0x38')][_0xaa5f('0xac')](this,_0x1cec14);return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](_0xaa5f('0x1af'));};AGIVertices[_0xaa5f('0x11')]['set']=function(_0x10db30){logger['info'](util['format'](_0xaa5f('0x1b0'),_0x10db30[_0xaa5f('0x3b')]));if(!this[_0xaa5f('0x8a')](_0x10db30[_0xaa5f('0xde')])){return this[_0xaa5f('0x10')]['error'](_0x10db30,_0xaa5f('0x1b1'));}var _0x4e53af=this[_0xaa5f('0xa7')][_0xaa5f('0xac')](this,_0x10db30[_0xaa5f('0xde')]);if(!_0x4e53af){return this[_0xaa5f('0x10')][_0xaa5f('0x2e')](_0x10db30,_0xaa5f('0xdf'));}return this[_0xaa5f('0x10')][_0xaa5f('0xa4')](_0x4e53af,_0x10db30[_0xaa5f('0x1b2')]);};AGIVertices[_0xaa5f('0x11')]['start']=function(_0x269212){logger['info'](util[_0xaa5f('0x2a')](_0xaa5f('0x1b3'),_0x269212[_0xaa5f('0x3b')]));this[_0xaa5f('0x10')][_0xaa5f('0xaf')](_0xaa5f('0x1b4'));if(_0x269212[_0xaa5f('0x1b5')]==='yes'){this[_0xaa5f('0x10')][_0xaa5f('0xaf')](_0xaa5f('0x1b6'));return this['channel'][_0xaa5f('0x1b5')]();}return this['channel'][_0xaa5f('0xaf')](_0xaa5f('0x1b7'));};AGIVertices[_0xaa5f('0x11')]['subproject']=function(_0xb507a1){logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0x1b8'),_0xb507a1[_0xaa5f('0x3b')]));if(!this[_0xaa5f('0x8a')](_0xb507a1[_0xaa5f('0x1b9')])){return this['channel'][_0xaa5f('0x2e')](_0xb507a1,_0xaa5f('0x1ba'));}var _0x270ab1=this[_0xaa5f('0x18')]['sync'](this,_0xb507a1[_0xaa5f('0x1b9')]);if(!this['isConfigured'](_0x270ab1)){return this[_0xaa5f('0x10')][_0xaa5f('0x2e')](_0xb507a1,util[_0xaa5f('0x2a')](_0xaa5f('0x1bb'),_0xb507a1[_0xaa5f('0x1b9')]));}if(_0x270ab1===this[_0xaa5f('0x10')][_0xaa5f('0x3d')]){return this[_0xaa5f('0x10')][_0xaa5f('0x2e')](_0xb507a1,_0xaa5f('0x1bc'));}this[_0xaa5f('0x39')][_0xaa5f('0xac')](this,_0xb507a1,_0x270ab1);var _0x42cdb9=this[_0xaa5f('0x10')][_0xaa5f('0xb1')](_0xaa5f('0x1bd'),util[_0xaa5f('0x2a')](_0xaa5f('0x1be'),config[_0xaa5f('0x6')][_0xaa5f('0x1bf')]||'127.0.0.1',_0x270ab1,this[_0xaa5f('0x10')][_0xaa5f('0x3d')]));if(_0x42cdb9[_0xaa5f('0xa9')]===-0x1){return _0x42cdb9;}return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util[_0xaa5f('0x2a')](_0xaa5f('0x182'),_0xaa5f('0x1bd'),_0x270ab1));};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x1c0')]=function(_0xaa077f){logger['info'](util[_0xaa5f('0x2a')](_0xaa5f('0x1c1'),_0xaa077f[_0xaa5f('0x3b')]));var _0x4d7b13=this[_0xaa5f('0x59')][_0xaa5f('0xac')](this,_0xaa077f[_0xaa5f('0xbd')]);this[_0xaa5f('0x39')][_0xaa5f('0xac')](this,_0xaa077f,_0xaa077f[_0xaa5f('0xbd')]);if(this['isConfigured'](_0xaa077f[_0xaa5f('0xde')])){var _0x3f980c=this[_0xaa5f('0xa7')][_0xaa5f('0xac')](this,_0xaa077f[_0xaa5f('0xde')]);if(_0x3f980c){this['channel'][_0xaa5f('0xa4')](_0x3f980c,_0x4d7b13);return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util[_0xaa5f('0x2a')](_0xaa5f('0x1c2'),_0xaa077f[_0xaa5f('0xbd')],_0x3f980c));}}return this['channel'][_0xaa5f('0xaf')](util[_0xaa5f('0x2a')](_0xaa5f('0x1c3'),_0xaa077f[_0xaa5f('0xbd')]));};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x1c4')]=function(_0x2815bd){logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x2815bd['label']));_0x2815bd['text']=_0x2815bd[_0xaa5f('0x5f')][_0xaa5f('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xaa5f('0x8a')](_0x2815bd['apiKey'])){return this['channel'][_0xaa5f('0xaf')](_0xaa5f('0x1c5'));}if(!this[_0xaa5f('0x8a')](_0x2815bd[_0xaa5f('0x5f')])){return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](_0xaa5f('0xb0'));}this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util[_0xaa5f('0x2a')](_0xaa5f('0x1c6'),_0x2815bd[_0xaa5f('0x5f')]));var _0x20c0e3=this['googleCloudTTS']['sync'](this,_0x2815bd);if(_0x20c0e3){this['channel'][_0xaa5f('0xaf')](util[_0xaa5f('0x2a')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x20c0e3));var _0x1f0a5e=this['channel'][_0xaa5f('0x10a')](_0x20c0e3);try{fs[_0xaa5f('0x130')](_0x20c0e3+_0xaa5f('0x10b'));}catch(_0x4c0cb6){logger['error'](_0x4c0cb6);}return _0x1f0a5e;}return this[_0xaa5f('0x10')]['error'](_0x2815bd,_0xaa5f('0x1c7'));};AGIVertices['prototype'][_0xaa5f('0x1c8')]=function(_0x809f9f){logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0x1c9'),_0x809f9f[_0xaa5f('0x3b')]));_0x809f9f[_0xaa5f('0x5f')]=_0x809f9f['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xaa5f('0x8a')](_0x809f9f[_0xaa5f('0x5f')])){return this[_0xaa5f('0x10')]['noop'](_0xaa5f('0xb0'));}this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util['format'](_0xaa5f('0x1ca'),_0x809f9f[_0xaa5f('0x5f')]));var _0x4fca76=this[_0xaa5f('0x65')][_0xaa5f('0xac')](this,_0x809f9f);if(_0x4fca76){this['channel'][_0xaa5f('0xaf')](util['format'](_0xaa5f('0x1cb'),_0x4fca76));var _0x48abf1=this['channel'][_0xaa5f('0x10a')](_0x4fca76);try{fs[_0xaa5f('0x130')](_0x4fca76+_0xaa5f('0x10b'));}catch(_0x2db58e){logger[_0xaa5f('0x2e')](_0x2db58e);}return _0x48abf1;}return this['channel'][_0xaa5f('0x2e')](_0x809f9f,_0xaa5f('0x1cc'));};AGIVertices['prototype'][_0xaa5f('0x1cd')]=function(_0x503d32){logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x503d32[_0xaa5f('0x3b')]));if(!this[_0xaa5f('0x8a')](_0x503d32[_0xaa5f('0x162')])){return this[_0xaa5f('0x10')][_0xaa5f('0x2e')](_0x503d32,'no\x20find\x20by\x20configured');}logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0x164'),this[_0xaa5f('0x10')][_0xaa5f('0x3f')],_0x503d32[_0xaa5f('0x162')]));var _0x3d677c=this[_0xaa5f('0x53')][_0xaa5f('0xac')](this,_0x503d32['findBy']);if(_0x3d677c){logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0x165'),this['channel'][_0xaa5f('0x3f')],_0x503d32['findBy']));this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util[_0xaa5f('0x2a')](_0xaa5f('0x165'),this[_0xaa5f('0x10')][_0xaa5f('0x3f')],_0x503d32[_0xaa5f('0x162')]));return{'code':0xc8,'result':_0xaa5f('0x166')};}else{logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')](_0xaa5f('0x167'),this['channel']['callerid'],_0x503d32[_0xaa5f('0x162')]));this[_0xaa5f('0x10')]['noop'](util[_0xaa5f('0x2a')](_0xaa5f('0x167'),this['channel'][_0xaa5f('0x3f')],_0x503d32[_0xaa5f('0x162')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xaa5f('0x11')][_0xaa5f('0x1ce')]=function(_0x4cddd3){logger[_0xaa5f('0x32')](util[_0xaa5f('0x2a')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x4cddd3['label']));var _0x651435=this['channel'][_0xaa5f('0xb1')](_0xaa5f('0x1cf'),[_0x4cddd3['mailbox'],_0x4cddd3[_0xaa5f('0x7d')]]);if(_0x651435[_0xaa5f('0xa9')]===-0x1){return _0x651435;}return this[_0xaa5f('0x10')][_0xaa5f('0xaf')](util[_0xaa5f('0x2a')](_0xaa5f('0x182'),_0xaa5f('0x1cf'),_0x4cddd3[_0xaa5f('0x1d0')]));};AGIVertices[_0xaa5f('0x11')]['vswitch']=function(_0x28440e){logger[_0xaa5f('0x32')](util['format'](_0xaa5f('0x1d1'),_0x28440e['label']));if(!this[_0xaa5f('0x8a')](_0x28440e[_0xaa5f('0xde')])){return this[_0xaa5f('0x10')]['error'](_0x28440e,_0xaa5f('0x1b1'));}var _0x138efd=this['getVariable'][_0xaa5f('0xac')](this,_0x28440e['variable_id']);if(!_0x138efd){return this['channel'][_0xaa5f('0x2e')](_0x28440e,_0xaa5f('0xdf'));}var _0x1eb8cb=this[_0xaa5f('0x10')][_0xaa5f('0xa7')](_0x138efd);return{'code':0xc8,'result':_0x1eb8cb['extra']?_0x1eb8cb[_0xaa5f('0xa8')]:'-'};};String['prototype']['replaceAll']=function(_0x196834,_0x2cfe91){return this[_0xaa5f('0xa5')](_0x196834)[_0xaa5f('0x1d2')](_0x2cfe91);};module[_0xaa5f('0x1d3')]=AGIVertices; \ No newline at end of file +var _0x7be1=['ssmlGender','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','number','timeout','includes','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','rawHeaders','uri','render','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isArray','length','saveRestApiResult','isPlainObject','%s.%s','setVariable','split','replaceAll','getVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','maxRetry','sync','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','getAndSetVariable','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','Enter\x20in\x20AGI\x20(%s)\x20block','agi','command','wait','answer','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','forEach','%s[%s][%s]','%s_ROWS_COUNT','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','DIAL','SIP/%s','Executed\x20command\x20%s','dialogflow','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20client_email\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','retry','file_id','variable_id','getData','response','test','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','interval_id','no\x20interval\x20configured','getIntervals','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','no\x20key\x20configured','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','agentLogin','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','no\x20file\x20audio\x20selected','PLAYBACK','opts','queue','queue_id','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','variable\x20%s\x20set','saydigits','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','template_id','debug','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sms_account_id','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','subproject','project_id','no\x20subproject\x20selected','getSquareProject','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','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','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','vswitch','join','exports','util','lodash','shelljs','randomstring','moment','mustache','request-promise','../../config/logger','./scripts','/var/opt/motion2/server/files','rawBody','menu','getdigits','getsecretdigits','channel','mailRpc','prototype','rpc','getVariableById','catch','getVoiceQueue','then','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getTrunk','getTrunkById','name','getSound','getSoundById','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervalById','IntervalId','map','Intervals','getSoundPath','format','getQueryOdbc','open','error','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','arg_1','file','createSquareMessage','createCmContact','isEmpty','callback_','random','lastName','isNil','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','text','languageCode'];(function(_0x4e25a2,_0x57dd8f){var _0x350fa2=function(_0x2706f1){while(--_0x2706f1){_0x4e25a2['push'](_0x4e25a2['shift']());}};_0x350fa2(++_0x57dd8f);}(_0x7be1,0x165));var _0x17be=function(_0x2401fc,_0xbc7845){_0x2401fc=_0x2401fc-0x0;var _0x23bb42=_0x7be1[_0x2401fc];return _0x23bb42;};'use strict';var fs=require('fs');var util=require(_0x17be('0x0'));var _=require(_0x17be('0x1'));var sh=require(_0x17be('0x2'));var odbc=require('odbc')();var rs=require(_0x17be('0x3'));var moment=require(_0x17be('0x4'));var Mustache=require(_0x17be('0x5'));var rp=require(_0x17be('0x6'));var logger=require(_0x17be('0x7'))('agi');var config=require('../../config/environment');var shared=require('../../config/environment/shared');var scripts=require(_0x17be('0x8'));var FILES_PATH=_0x17be('0x9');var recursiveMapAttributes=['rawHeaders',_0x17be('0xa')];var verticesWithRetry=[_0x17be('0xb'),_0x17be('0xc'),_0x17be('0xd')];var AGIVertices=function(_0x4779a8,_0x16042b,_0x582848){this[_0x17be('0xe')]=_0x4779a8;this['rpc']=_0x16042b;this[_0x17be('0xf')]=_0x582848;};AGIVertices[_0x17be('0x10')]['getVariable']=function(_0x7000a4,_0x1b53c5){this[_0x17be('0x11')][_0x17be('0x12')](_0x7000a4)['then'](function(_0x431142){_0x1b53c5(null,_0x431142?_0x431142['name']:![]);})[_0x17be('0x13')](function(_0x4f4ad6){_0x1b53c5(_0x4f4ad6);});};AGIVertices[_0x17be('0x10')][_0x17be('0x14')]=function(_0x3ced9f,_0xf99f77){this[_0x17be('0x11')]['getVoiceQueueById'](_0x3ced9f)[_0x17be('0x15')](function(_0x497a95){_0xf99f77(null,_0x497a95?_0x497a95['name']:![]);})[_0x17be('0x13')](function(_0x514c45){_0xf99f77(_0x514c45);});};AGIVertices[_0x17be('0x10')]['getSquareProject']=function(_0x2aa9a6,_0x312b2e){this['rpc'][_0x17be('0x16')](_0x2aa9a6)['then'](function(_0x222009){_0x312b2e(null,_0x222009?_0x222009['name']:![]);})[_0x17be('0x13')](function(_0x165dfb){_0x312b2e(_0x165dfb);});};AGIVertices[_0x17be('0x10')][_0x17be('0x17')]=function(_0x445e9b,_0x4d5ecb){this[_0x17be('0x11')][_0x17be('0x18')](_0x445e9b)[_0x17be('0x15')](function(_0x19678b){_0x4d5ecb(null,_0x19678b?_0x19678b['dsn']:![]);})[_0x17be('0x13')](function(_0x5310a3){_0x4d5ecb(_0x5310a3);});};AGIVertices['prototype'][_0x17be('0x19')]=function(_0x3ffd1e,_0x19fbdb){this[_0x17be('0x11')]['getUserById'](_0x3ffd1e)[_0x17be('0x15')](function(_0x1aa54f){_0x19fbdb(null,_0x1aa54f?_0x1aa54f['name']:![]);})[_0x17be('0x13')](function(_0x484d71){_0x19fbdb(_0x484d71);});};AGIVertices[_0x17be('0x10')][_0x17be('0x1a')]=function(_0x47f00d,_0x3f92af){this['rpc'][_0x17be('0x1b')](_0x47f00d)['then'](function(_0x48ae1f){_0x3f92af(null,_0x48ae1f?_0x48ae1f[_0x17be('0x1c')]:![]);})['catch'](function(_0x39f237){_0x3f92af(_0x39f237);});};AGIVertices['prototype'][_0x17be('0x1d')]=function(_0x1efef0,_0x165046){var _0x27c672=this;this[_0x17be('0x11')][_0x17be('0x1e')](_0x1efef0)[_0x17be('0x15')](function(_0x22100){_0x165046(null,_0x22100?_0x27c672['getSoundPath'](_0x22100[_0x17be('0x1f')]):![]);})[_0x17be('0x13')](function(_0x1ab350){_0x165046(_0x1ab350);});};AGIVertices[_0x17be('0x10')][_0x17be('0x20')]=function(_0x564897,_0x233c28){this[_0x17be('0x11')][_0x17be('0x21')](_0x564897)['then'](function(_0x4fad3a){_0x233c28(null,_0x4fad3a?_0x4fad3a:![]);})[_0x17be('0x13')](function(_0x1df6d2){_0x233c28(_0x1df6d2);});};AGIVertices['prototype'][_0x17be('0x22')]=function(_0x48d695,_0x3ff594,_0x3de49b){this[_0x17be('0xf')][_0x17be('0x22')](_0x48d695,_0x3ff594)[_0x17be('0x15')](function(){_0x3de49b(null);})[_0x17be('0x13')](function(_0x3dfb1d){_0x3de49b(_0x3dfb1d);});};AGIVertices[_0x17be('0x10')]['getIntervals']=function(_0x281c98,_0x18d367){this['rpc'][_0x17be('0x23')](_0x281c98)[_0x17be('0x15')](function(_0x5c3655){if(_0x5c3655){if(_0x5c3655[_0x17be('0x24')]){_0x18d367(null,[_0x5c3655['interval']]);}else{_0x18d367(null,_[_0x17be('0x25')](_0x5c3655[_0x17be('0x26')],'interval'));}}else{_0x18d367(null,![]);}})[_0x17be('0x13')](function(_0x1eb47c){_0x18d367(_0x1eb47c);});};AGIVertices[_0x17be('0x10')][_0x17be('0x27')]=function(_0x2cb045){return util[_0x17be('0x28')]('%s/sounds/converted/%s',FILES_PATH,_0x2cb045);};AGIVertices[_0x17be('0x10')][_0x17be('0x29')]=function(_0x5ddcd5,_0x1972b0,_0x583000){odbc[_0x17be('0x2a')](_0x5ddcd5,function(_0x301529){if(_0x301529){logger[_0x17be('0x2b')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x301529);_0x583000(_0x301529);}else{logger[_0x17be('0x2c')](_0x17be('0x2d'));odbc[_0x17be('0x2e')](_0x1972b0,function(_0x420d6f,_0x31b745){if(_0x420d6f){logger[_0x17be('0x2c')](_0x17be('0x2f'),_0x1972b0);_0x583000(_0x420d6f);}else{logger[_0x17be('0x2c')](_0x17be('0x30'),_0x1972b0);odbc['close'](function(_0x4af4ff){if(_0x4af4ff){logger[_0x17be('0x2b')](_0x17be('0x31'),_0x4af4ff);}_0x583000(null,_0x31b745);});}});}});};AGIVertices[_0x17be('0x10')]['getSmsAccount']=function(_0x292617,_0x389960){this[_0x17be('0x11')]['getSmsAccountById'](_0x292617)[_0x17be('0x15')](function(_0x3d4121){_0x389960(null,_0x3d4121?_0x3d4121:![]);})[_0x17be('0x13')](function(_0x39d5a7){_0x389960(_0x39d5a7);});};AGIVertices['prototype'][_0x17be('0x32')]=function(_0x5750d2,_0x37b830){this[_0x17be('0x11')][_0x17be('0x32')](_0x5750d2)[_0x17be('0x15')](function(_0x3812c6){_0x37b830(null,_0x3812c6);})[_0x17be('0x13')](function(_0x59c7db){_0x37b830(_0x59c7db);});};AGIVertices[_0x17be('0x10')][_0x17be('0x33')]=function(_0x26bb98,_0x22cc60,_0x1536ca){this[_0x17be('0x11')][_0x17be('0x33')]({'uniqueid':this[_0x17be('0xe')][_0x17be('0x34')],'node':_0x26bb98[_0x17be('0x35')],'application':_0x26bb98[_0x17be('0x36')],'data':_0x22cc60||null,'project_name':this[_0x17be('0xe')]['arg_1'],'callerid':this[_0x17be('0xe')][_0x17be('0x37')]})[_0x17be('0x15')](function(_0xb13e66){if(_0x1536ca){_0x1536ca(null,_0xb13e66);}})[_0x17be('0x13')](function(_0x374bd3){if(_0x1536ca){_0x1536ca(_0x374bd3);}});};AGIVertices['prototype'][_0x17be('0x38')]=function(_0x81a890,_0x2ce6c5,_0x256eca,_0x450edd){this[_0x17be('0x11')][_0x17be('0x38')]({'uniqueid':this[_0x17be('0xe')][_0x17be('0x34')],'callerid':this['channel']['callerid'],'calleridname':this[_0x17be('0xe')][_0x17be('0x39')],'context':this[_0x17be('0xe')][_0x17be('0x3a')],'extension':this[_0x17be('0xe')][_0x17be('0x3b')],'priority':this[_0x17be('0xe')][_0x17be('0x3c')],'accountcode':this['channel'][_0x17be('0x3d')],'dnid':this[_0x17be('0xe')][_0x17be('0x3e')],'projectName':this[_0x17be('0xe')][_0x17be('0x3f')],'saveName':_0x2ce6c5,'filename':_0x81a890[_0x17be('0x40')]||_0x2ce6c5,'savePath':_0x256eca})['then'](function(_0x554849){_0x450edd(null,_0x554849);})[_0x17be('0x13')](function(_0x2e79d6){_0x450edd(_0x2e79d6);});};AGIVertices[_0x17be('0x10')]['createSquareMessage']=function(_0x3f576d,_0x4948ab,_0x4e73ba,_0x39d230,_0x3ff180){this[_0x17be('0x11')][_0x17be('0x41')]({'uniqueid':this[_0x17be('0xe')][_0x17be('0x34')],'body':_0x3f576d,'direction':_0x4948ab,'providerName':_0x4e73ba,'providerResponse':_0x39d230})[_0x17be('0x15')](function(_0x2b86fb){if(_0x3ff180){_0x3ff180(null,_0x2b86fb);}})[_0x17be('0x13')](function(_0x5a566e){if(_0x3ff180){_0x3ff180(_0x5a566e);}});};AGIVertices[_0x17be('0x10')]['createCmContact']=function(_0x9161d7,_0x580de5){this['rpc'][_0x17be('0x42')]({'firstName':_[_0x17be('0x43')](_0x9161d7[_0x17be('0x1c')])||_['isNil'](_0x9161d7[_0x17be('0x1c')])?_0x17be('0x44')+Math[_0x17be('0x45')]():_0x9161d7[_0x17be('0x1c')],'lastName':_[_0x17be('0x43')](_0x9161d7[_0x17be('0x46')])||_[_0x17be('0x47')](_0x9161d7[_0x17be('0x46')])?null:_0x9161d7[_0x17be('0x46')],'phone':_0x9161d7[_0x17be('0x48')],'ListId':_0x9161d7[_0x17be('0x49')],'scheduledat':_0x9161d7[_0x17be('0x4a')],'callbackUniqueid':this[_0x17be('0xe')][_0x17be('0x34')],'tags':'callback','description':_0x17be('0x4b')+_0x9161d7[_0x17be('0x4a')][_0x17be('0x4c')](),'priority':_0x9161d7[_0x17be('0x4d')]})[_0x17be('0x15')](function(_0x5a5bb5){_0x580de5(null,_0x5a5bb5);})[_0x17be('0x13')](function(_0x292c18){_0x580de5(_0x292c18);});};AGIVertices['prototype'][_0x17be('0x4e')]=function(_0x3ab6f4,_0x52e9d0){this[_0x17be('0x11')][_0x17be('0x4f')](_0x3ab6f4)[_0x17be('0x15')](function(_0x2e92d5){_0x52e9d0(null,_0x2e92d5?_0x2e92d5[_0x17be('0x1c')]:![]);})[_0x17be('0x13')](function(_0x29c7a0){_0x52e9d0(_0x29c7a0);});};AGIVertices[_0x17be('0x10')][_0x17be('0x50')]=function(_0x51e4ec,_0x586925,_0x57efb3){var _0x42fb45={'role':_0x17be('0x51')};_0x42fb45[_0x51e4ec]=this[_0x17be('0xe')]['callerid'];this[_0x17be('0x11')][_0x17be('0x50')](_0x42fb45,_0x586925,this[_0x17be('0xe')][_0x17be('0x34')])[_0x17be('0x15')](function(_0x518f1e){_0x57efb3(null,_['isNil'](_0x518f1e)?![]:!![]);})['catch'](function(_0xa87b5d){logger[_0x17be('0x2b')](_0xa87b5d);_0x57efb3(null,![]);});};AGIVertices[_0x17be('0x10')][_0x17be('0x52')]=function(_0x8f211f,_0x305e00){var _0x5b6212={'role':_0x17be('0x51')};_0x5b6212[_0x8f211f]=this[_0x17be('0xe')]['callerid'];this[_0x17be('0x11')]['agentUnpause'](_0x5b6212)[_0x17be('0x15')](function(_0x48414f){_0x305e00(null,_[_0x17be('0x47')](_0x48414f)?![]:!![]);})[_0x17be('0x13')](function(_0x5cc1b6){logger[_0x17be('0x2b')](_0x5cc1b6);_0x305e00(null,![]);});};AGIVertices['prototype']['agentLogout']=function(_0x21b2d3,_0x262cad){var _0x3a37de={'role':_0x17be('0x51')};_0x3a37de[_0x21b2d3]=this[_0x17be('0xe')]['callerid'];this[_0x17be('0x11')][_0x17be('0x53')](_0x3a37de)['then'](function(_0x5c8523){_0x262cad(null,_[_0x17be('0x47')](_0x5c8523)?![]:!![]);})['catch'](function(_0x5401a7){logger[_0x17be('0x2b')](_0x5401a7);_0x262cad(null,![]);});};AGIVertices[_0x17be('0x10')]['agentLogin']=function(_0xcf44e4,_0x789bd8){var _0xfb854a={'role':_0x17be('0x51')};_0xfb854a[_0xcf44e4]=this[_0x17be('0xe')][_0x17be('0x37')];var _0x343693=_0xcf44e4!=_0x17be('0x54')?util[_0x17be('0x28')](_0x17be('0x55'),_0x17be('0x56'),this[_0x17be('0xe')][_0x17be('0x37')]):undefined;this[_0x17be('0x11')]['agentLogin'](_0xfb854a,_0x343693)['then'](function(_0x19f885){_0x789bd8(null,_[_0x17be('0x47')](_0x19f885)?![]:!![]);})[_0x17be('0x13')](function(_0x22acc0){logger[_0x17be('0x2b')](_0x22acc0);_0x789bd8(null,![]);});};AGIVertices[_0x17be('0x10')][_0x17be('0x57')]=function(_0x4c3392,_0x3d95c5){sh[_0x17be('0x58')](_[_0x17be('0x59')](_0x4c3392),function(_0x230209,_0x56a4db){var _0x3821b8=_0x56a4db[_0x17be('0x5a')](/(\r\n|\n|\r)/gm,'');_0x3d95c5(null,_0x3821b8);});};AGIVertices['prototype'][_0x17be('0x5b')]=function(_0x57005c,_0x5c4ce0){scripts[_0x17be('0x5b')](_0x57005c['apiKey'],_0x57005c['google_cloud_tts_text_type']||'text',_0x57005c[_0x17be('0x5c')],_0x57005c[_0x17be('0x5d')]||'en-US',_0x57005c[_0x17be('0x5e')]||'MALE',_0x57005c[_0x17be('0x5f')]||_0x17be('0x60'))[_0x17be('0x15')](function(_0x3c3f27){_0x5c4ce0(null,_0x3c3f27);})[_0x17be('0x13')](function(_0x58f4cf){_0x5c4ce0(_0x58f4cf);});};AGIVertices['prototype']['googleTTS']=function(_0x5dfeb2,_0x19e91d){scripts[_0x17be('0x61')](_0x5dfeb2[_0x17be('0x5c')],_0x5dfeb2[_0x17be('0x62')]||'en',0x1)[_0x17be('0x15')](function(_0x4b23e3){_0x19e91d(null,_0x4b23e3);})[_0x17be('0x13')](function(_0x6635a0){_0x19e91d(_0x6635a0);});};AGIVertices[_0x17be('0x10')][_0x17be('0x63')]=function(_0x41b417,_0x4f8d6c){var _0x351aea={'uri':_0x41b417[_0x17be('0x64')],'method':_0x41b417[_0x17be('0x65')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x41b417['timeout'])===_0x17be('0x66')&&parseInt(_0x41b417[_0x17be('0x67')])>=0x1?parseInt(_0x41b417[_0x17be('0x67')])*0x3e8:0x5*0x3e8};if(_[_0x17be('0x68')]([_0x17be('0x69'),_0x17be('0x6a')],_0x351aea[_0x17be('0x65')][_0x17be('0x6b')]())){try{_0x351aea[_0x17be('0x6c')]=_0x41b417[_0x17be('0xa')]?JSON[_0x17be('0x6d')](_0x41b417[_0x17be('0xa')]):{};}catch(_0x51320e){logger[_0x17be('0x2b')](_0x17be('0x6e'),_0x51320e);}}try{_0x351aea['headers']=_0x41b417[_0x17be('0x6f')]?JSON[_0x17be('0x6d')](_0x41b417['rawHeaders']):{};}catch(_0x15c55f){logger[_0x17be('0x2b')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x15c55f);}if(_0x41b417['computedVariables']){try{var _0xbbd80=require(_0x41b417['computedVariables'])['sync'](this,_0x351aea);_0x351aea[_0x17be('0x70')]=Mustache[_0x17be('0x71')](_0x41b417[_0x17be('0x64')],_0xbbd80,{},['$$','$$']);if(_0x351aea[_0x17be('0x72')]){_0x351aea[_0x17be('0x72')]=JSON[_0x17be('0x6d')](Mustache[_0x17be('0x71')](JSON[_0x17be('0x73')](_0x351aea[_0x17be('0x72')]),_0xbbd80,{},['$$','$$']));}if(_0x351aea[_0x17be('0x6c')]){_0x351aea[_0x17be('0x6c')]=JSON[_0x17be('0x6d')](Mustache[_0x17be('0x71')](JSON['stringify'](_0x351aea[_0x17be('0x6c')]),_0xbbd80,{},['$$','$$']));}}catch(_0x590c29){logger[_0x17be('0x2b')](_0x17be('0x74'),_0x590c29);}}rp(_0x351aea)['then'](function(_0xede2dc){var _0x43e913={'statusCode':_0xede2dc[_0x17be('0x75')]||0xc8,'statusMessage':_0xede2dc[_0x17be('0x76')]||'OK','headers':_0xede2dc[_0x17be('0x72')]||{},'body':_0xede2dc[_0x17be('0x6c')]||{}};_0x4f8d6c(null,_0x43e913);})[_0x17be('0x13')](function(_0xbbdc99){var _0x42cb8e={'statusCode':_0xbbdc99[_0x17be('0x75')]||0x1f4,'statusMessage':_0xbbdc99[_0x17be('0x77')]||_0x17be('0x78'),'headers':_0xbbdc99[_0x17be('0x79')][_0x17be('0x72')]||{},'body':_0xbbdc99['options']['body']||{}};_0x4f8d6c(null,_0x42cb8e);});};AGIVertices['prototype'][_0x17be('0x7a')]=function(_0xf1d829,_0x341c66){scripts[_0x17be('0x7a')](this[_0x17be('0xe')]['uniqueid'],_0xf1d829[_0x17be('0x7b')],_0xf1d829[_0x17be('0x5c')],_0xf1d829[_0x17be('0x7c')]||'en')['then'](function(_0x376696){_0x341c66(null,_0x376696);})[_0x17be('0x13')](function(_0x5a859b){_0x341c66(_0x5a859b);});};AGIVertices[_0x17be('0x10')][_0x17be('0x7d')]=function(_0x304d32,_0x5ed603){scripts[_0x17be('0x7d')](this[_0x17be('0xe')][_0x17be('0x34')],_0x304d32[_0x17be('0x7e')],_0x304d32[_0x17be('0x7f')],_0x304d32[_0x17be('0x80')],_0x304d32[_0x17be('0x5c')],_0x304d32[_0x17be('0x81')]||'en')[_0x17be('0x15')](function(_0x15ebe1){_0x5ed603(null,_0x15ebe1);})['catch'](function(_0x479a8f){_0x5ed603(_0x479a8f);});};AGIVertices[_0x17be('0x10')][_0x17be('0x82')]=function(_0x19363b,_0x2fab50){scripts[_0x17be('0x82')](this[_0x17be('0xe')],_0x19363b)[_0x17be('0x15')](function(_0x2989c5){_0x2fab50(null,_0x2989c5);})[_0x17be('0x13')](function(_0x274673){_0x2fab50(_0x274673);});};AGIVertices[_0x17be('0x10')][_0x17be('0x83')]=function(_0x353379,_0x1d742d){scripts[_0x17be('0x83')](_0x353379['key'],_0x353379[_0x17be('0x5c')],_0x353379[_0x17be('0x84')]||_0x17be('0x85'),_0x353379[_0x17be('0x86')])[_0x17be('0x15')](function(_0x232722){_0x1d742d(null,_0x232722);})['catch'](function(_0x1801ea){_0x1d742d(_0x1801ea);});};AGIVertices[_0x17be('0x10')][_0x17be('0x87')]=function(_0x40ac2c,_0x554a9f,_0x4f77b5){scripts[_0x17be('0x87')](_0x554a9f,_0x40ac2c[_0x17be('0x7b')],_0x40ac2c['ispeech_asr_language']||_0x17be('0x85'),this[_0x17be('0x88')](_0x40ac2c[_0x17be('0x89')])?_0x40ac2c[_0x17be('0x89')]:undefined)[_0x17be('0x15')](function(_0x2ac1c7){_0x4f77b5(null,_0x2ac1c7);})[_0x17be('0x13')](function(_0x59eb8f){_0x4f77b5(_0x59eb8f);});};AGIVertices['prototype'][_0x17be('0x8a')]=function(_0x3e8a12,_0x392a59){scripts[_0x17be('0x8a')](_0x3e8a12[_0x17be('0x8b')],_0x3e8a12[_0x17be('0x8c')],_0x3e8a12[_0x17be('0x8d')],_0x3e8a12[_0x17be('0x8e')]||'Amy',_0x3e8a12[_0x17be('0x5c')],_0x3e8a12['aws_text_type']||_0x17be('0x5c'))[_0x17be('0x15')](function(_0x1854d5){_0x392a59(null,_0x1854d5);})[_0x17be('0x13')](function(_0x5cbd64){_0x392a59(_0x5cbd64);});};AGIVertices[_0x17be('0x10')][_0x17be('0x8f')]=function(_0x4d75c3,_0x1eca5c){scripts[_0x17be('0x8f')](this[_0x17be('0xe')]['uniqueid'],_0x4d75c3['aws_access_key_id'],_0x4d75c3['aws_secret_access_key'],_0x4d75c3[_0x17be('0x90')],_0x4d75c3[_0x17be('0x5c')],_0x4d75c3[_0x17be('0x91')])[_0x17be('0x15')](function(_0x4093af){_0x1eca5c(null,_0x4093af);})[_0x17be('0x13')](function(_0x13251c){_0x1eca5c(_0x13251c);});};AGIVertices['prototype'][_0x17be('0x92')]=function(_0x5ac6d6,_0x5902a4,_0xe763cf){scripts[_0x17be('0x92')](_0x5902a4,_0x5ac6d6['key'],_0x5ac6d6[_0x17be('0x93')]||'en-US')['then'](function(_0x26049e){_0xe763cf(null,_0x26049e);})[_0x17be('0x13')](function(_0x4ae7fb){_0xe763cf(_0x4ae7fb);});};AGIVertices[_0x17be('0x10')][_0x17be('0x94')]=function(_0x4782b9,_0x164f96,_0x4cd109){scripts[_0x17be('0x94')](_0x164f96,_0x4782b9[_0x17be('0x95')],_0x4782b9[_0x17be('0x96')],_0x4782b9['uri'])[_0x17be('0x15')](function(_0x49f256){_0x4cd109(null,_0x49f256);})[_0x17be('0x13')](function(_0x3e0264){_0x4cd109(_0x3e0264);});};AGIVertices[_0x17be('0x10')][_0x17be('0x97')]=function(_0x1fbd9f){var _0x56cb39=_['includes'](verticesWithRetry,_0x1fbd9f['agicommand'])?_0x1fbd9f:_['clone'](_0x1fbd9f);for(var _0x509b4d in _0x56cb39){if(_0x56cb39[_0x17be('0x98')](_0x509b4d)){if(_0x56cb39[_0x509b4d]&&_[_0x17be('0x99')](_0x56cb39[_0x509b4d])){if(_[_0x17be('0x68')](recursiveMapAttributes,_0x509b4d)){_0x56cb39[_0x509b4d]=this[_0x17be('0x9a')](_0x56cb39[_0x509b4d]);}else{_0x56cb39[_0x509b4d]=this[_0x17be('0x9b')](_0x56cb39[_0x509b4d]);}}}}return _0x56cb39;};AGIVertices[_0x17be('0x10')]['recursiveNodeIndex']=function(_0xe6ea97){for(var _0x4cf03a in _0xe6ea97){if(_0xe6ea97[_0x17be('0x98')](_0x4cf03a)){if(_['isPlainObject'](_0xe6ea97[_0x4cf03a])){this[_0x17be('0x9c')](_0xe6ea97[_0x4cf03a]);}else if(_[_0x17be('0x9d')](_0xe6ea97[_0x4cf03a])){for(var _0x4a0ab6=0x0;_0x4a0ab6<_0xe6ea97[_0x4cf03a][_0x17be('0x9e')];_0x4a0ab6++){this[_0x17be('0x9c')](_0xe6ea97[_0x4cf03a][_0x4a0ab6]);}}else if(_[_0x17be('0x99')](_0xe6ea97[_0x4cf03a])){_0xe6ea97[_0x4cf03a]=this[_0x17be('0x9b')](_0xe6ea97[_0x4cf03a]);}}}};AGIVertices[_0x17be('0x10')][_0x17be('0x9f')]=function(_0x249557,_0x3167ff){for(var _0x206c62 in _0x249557){if(_0x249557[_0x17be('0x98')](_0x206c62)){if(_[_0x17be('0xa0')](_0x249557[_0x206c62])){if(!_[_0x17be('0x43')](_0x249557[_0x206c62])){this[_0x17be('0x9f')](_0x249557[_0x206c62],util[_0x17be('0x28')](_0x17be('0xa1'),_0x3167ff,_0x206c62));}}else if(_[_0x17be('0x9d')](_0x249557[_0x206c62])){for(var _0x25d2d9=0x0;_0x25d2d9<_0x249557[_0x206c62][_0x17be('0x9e')];_0x25d2d9++){this['saveRestApiResult'](_0x249557[_0x206c62][_0x25d2d9],util[_0x17be('0x28')]('%s.%s',_0x3167ff,_0x206c62+'['+_0x25d2d9+']'));}}else{if(!_[_0x17be('0x47')](_0x249557[_0x206c62])){this[_0x17be('0xe')][_0x17be('0xa2')](util[_0x17be('0x28')](_0x17be('0xa1'),_0x3167ff,_0x206c62),_0x249557[_0x206c62]);}}}}};AGIVertices[_0x17be('0x10')][_0x17be('0x9a')]=function(_0x352db5){try{var _0x403992=JSON[_0x17be('0x6d')](_0x352db5);this['recursiveNodeIndex'](_0x403992);return JSON[_0x17be('0x73')](_0x403992);}catch(_0xecd578){return this['replaceAllVariables'](_0x352db5);}};AGIVertices[_0x17be('0x10')]['replaceAllVariables']=function(_0x4899ad){var _0xd57db=_0x4899ad[_0x17be('0xa3')]('{');for(var _0x4e4977=0x1;_0x4e4977<_0xd57db[_0x17be('0x9e')];_0x4e4977+=0x1){var _0x3f5e4f=_0xd57db[_0x4e4977]['split']('}');if(_0x3f5e4f[_0x17be('0x9e')]>0x1){_0x4899ad=_0x4899ad[_0x17be('0xa4')]('{'+_0x3f5e4f[0x0]+'}',this[_0x17be('0xe')][_0x17be('0xa5')](_0x3f5e4f[0x0])['extra']||_0x3f5e4f[0x0]);}}if(_0xd57db[_0x17be('0x9e')]===0x1){return _0x4899ad[_0x17be('0x4c')]();}return this[_0x17be('0x9b')](_0x4899ad);};AGIVertices[_0x17be('0x10')]['getAndSetVariable']=function(_0x432b02,_0x50a1d9){var _0x29c80d=this['channel'][_0x17be('0xa5')](_0x432b02);if(_0x29c80d[_0x17be('0xa6')]===-0x1){return _0x29c80d;}logger[_0x17be('0x2c')](util[_0x17be('0x28')](_0x17be('0xa7'),_0x50a1d9,_0x29c80d[_0x17be('0xa8')]));return this[_0x17be('0xe')][_0x17be('0xa2')](_0x50a1d9,_0x29c80d[_0x17be('0xa8')]);};AGIVertices[_0x17be('0x10')][_0x17be('0x88')]=function(_0x154188){return _0x154188&&_0x154188!=='0'&&_0x154188!=='-1'&&_0x154188!=='';};AGIVertices['prototype'][_0x17be('0xa9')]=function(_0x1c1f2f){this[_0x17be('0x33')][_0x17be('0xaa')](this,_0x1c1f2f,'-');_0x1c1f2f['retry']=_0x1c1f2f[_0x17be('0xa9')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x17be('0x10')][_0x17be('0xab')]=function(_0x23903c){logger[_0x17be('0x2c')](util['format'](_0x17be('0xac'),_0x23903c[_0x17be('0x35')]));if(!this['isConfigured'](_0x23903c[_0x17be('0x5c')])){return this[_0x17be('0xe')]['noop']('no\x20text\x20configured');}var _0xec219a='\x22'+_0x23903c[_0x17be('0x5c')]+'\x22';if(this[_0x17be('0x88')](_0x23903c[_0x17be('0x79')])){_0xec219a+=','+_0x23903c[_0x17be('0x79')];}var _0x261f4a=this[_0x17be('0xe')][_0x17be('0x58')]('MRCPSynth',_0xec219a);if(_0x261f4a['result']===-0x1){return _0x261f4a;}return this[_0x17be('0xe')][_0x17be('0xad')](util['format'](_0x17be('0xae'),_0xec219a));};AGIVertices[_0x17be('0x10')][_0x17be('0xaf')]=function(_0x1e5b25){logger['info'](util[_0x17be('0x28')](_0x17be('0xb0'),_0x1e5b25[_0x17be('0x35')]));if(!this['isConfigured'](_0x1e5b25[_0x17be('0xb1')])){return this[_0x17be('0xe')][_0x17be('0xad')](_0x17be('0xb2'));}var _0x4d6f1f=_0x1e5b25[_0x17be('0xb1')];if(this[_0x17be('0x88')](_0x1e5b25[_0x17be('0x79')])){_0x4d6f1f+=','+_0x1e5b25[_0x17be('0x79')];}var _0x51cf9c=this[_0x17be('0xe')][_0x17be('0x58')](_0x17be('0xb3'),_0x4d6f1f);if(_0x51cf9c[_0x17be('0xa6')]===-0x1){return _0x51cf9c;}var _0x893b64=this[_0x17be('0xb4')](_0x17be('0xb5'),_0x17be('0xb6'));if(_0x893b64['result']===-0x1){return _0x893b64;}var _0x383922=this[_0x17be('0xb4')](_0x17be('0xb7'),'MRCP_RECOG_TRANSCRIPT');if(_0x383922[_0x17be('0xa6')]===-0x1){return _0x383922;}var _0x2153fa=this[_0x17be('0xb4')]('RECOG_INSTANCE()','MRCP_RECOG_INSTANCE');if(_0x2153fa['result']===-0x1){return _0x2153fa;}return this[_0x17be('0xe')]['noop'](util[_0x17be('0x28')]('Executed\x20command\x20MRCPRecog\x20%s',_0x4d6f1f));};AGIVertices[_0x17be('0x10')]['agi']=function(_0x2264cd){logger[_0x17be('0x2c')](util['format'](_0x17be('0xb8'),_0x2264cd[_0x17be('0x35')]));return this[_0x17be('0xe')][_0x17be('0xb9')]([_0x2264cd[_0x17be('0xba')],_0x2264cd['args']]);};AGIVertices[_0x17be('0x10')]['answer']=function(_0x5abe10){logger[_0x17be('0x2c')](util['format']('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x5abe10['label']));if(this['isConfigured'](_0x5abe10['timeout'])){logger['info'](util[_0x17be('0x28')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x5abe10[_0x17be('0x67')]));var _0x20e204=this['channel'][_0x17be('0xbb')](_0x5abe10['timeout']);if(_0x20e204[_0x17be('0xa6')]===-0x1){return _0x20e204;}}return this['channel'][_0x17be('0xbc')]();};AGIVertices[_0x17be('0x10')][_0x17be('0xbd')]=function(_0x538021){logger[_0x17be('0x2c')](util['format'](_0x17be('0xbe'),_0x538021[_0x17be('0x35')]));if(!this[_0x17be('0x88')](_0x538021[_0x17be('0x49')])){return this['channel'][_0x17be('0x2b')](_0x538021,_0x17be('0xbf'));}_0x538021[_0x17be('0x4a')]=moment();if(this[_0x17be('0x88')](_0x538021[_0x17be('0xc0')])){_0x538021[_0x17be('0x4a')]=moment()[_0x17be('0xc1')](_0x538021[_0x17be('0xc0')],_0x17be('0xc2'));}if(!this[_0x17be('0x88')](_0x538021[_0x17be('0x4d')])){_0x538021['callback_priority']=0x2;}this[_0x17be('0x42')]['sync'](this,_0x538021);return this[_0x17be('0xe')][_0x17be('0xad')](util[_0x17be('0x28')](_0x17be('0xc3'),_0x538021[_0x17be('0x48')],_0x538021[_0x17be('0x49')],_0x538021['scheduledAt']));};AGIVertices[_0x17be('0x10')][_0x17be('0xc4')]=function(_0x23c9a9){logger['info'](util[_0x17be('0x28')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x23c9a9[_0x17be('0x35')]));var _0x26b005=this['channel'][_0x17be('0x58')](_0x23c9a9['application'],_0x23c9a9[_0x17be('0x79')]);if(_0x26b005[_0x17be('0xa6')]===-0x1){return _0x26b005;}return this[_0x17be('0xe')][_0x17be('0xad')](util[_0x17be('0x28')](_0x17be('0xc5'),_0x23c9a9['application'],_0x23c9a9[_0x17be('0x79')]));};AGIVertices['prototype'][_0x17be('0xc6')]=function(_0x10b13f){logger[_0x17be('0x2c')](util['format'](_0x17be('0xc7'),_0x10b13f[_0x17be('0x35')]));if(!this[_0x17be('0x88')](_0x10b13f[_0x17be('0x5c')])){return this[_0x17be('0xe')]['noop'](_0x17be('0xc8'));}var _0x39c1da='\x22'+_0x10b13f['text']+'\x22';if(this[_0x17be('0x88')](_0x10b13f['options'])){_0x39c1da+=','+_0x10b13f[_0x17be('0x79')];}var _0x5883d5=this['channel'][_0x17be('0x58')]('MRCPSynth',_0x39c1da);if(_0x5883d5['result']===-0x1){return _0x5883d5;}return this[_0x17be('0xe')][_0x17be('0xad')](util[_0x17be('0x28')](_0x17be('0xae'),_0x39c1da));};AGIVertices[_0x17be('0x10')]['sestektts']=function(_0x30d9dd){logger[_0x17be('0x2c')](util['format'](_0x17be('0xc9'),_0x30d9dd[_0x17be('0x35')]));if(!this[_0x17be('0x88')](_0x30d9dd[_0x17be('0x5c')])){return this[_0x17be('0xe')]['noop']('no\x20text\x20configured');}var _0x546b89='\x22'+_0x30d9dd[_0x17be('0x5c')]+'\x22';if(this[_0x17be('0x88')](_0x30d9dd['options'])){_0x546b89+=','+_0x30d9dd[_0x17be('0x79')];}var _0x5ef811=this[_0x17be('0xe')][_0x17be('0x58')]('MRCPSynth',_0x546b89);if(_0x5ef811['result']===-0x1){return _0x5ef811;}return this[_0x17be('0xe')][_0x17be('0xad')](util[_0x17be('0x28')](_0x17be('0xae'),_0x546b89));};AGIVertices[_0x17be('0x10')]['lumenvoxasr']=function(_0x455370){logger[_0x17be('0x2c')](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x455370[_0x17be('0x35')]));if(!this[_0x17be('0x88')](_0x455370[_0x17be('0xb1')])){return this['channel'][_0x17be('0xad')](_0x17be('0xb2'));}var _0x439be0=_0x455370[_0x17be('0xb1')];if(this['isConfigured'](_0x455370[_0x17be('0x79')])){_0x439be0+=','+_0x455370['options'];}var _0x1bb2d9=this[_0x17be('0xe')][_0x17be('0x58')](_0x17be('0xb3'),_0x439be0);if(_0x1bb2d9[_0x17be('0xa6')]===-0x1){return _0x1bb2d9;}var _0x51b736=this[_0x17be('0xb4')](_0x17be('0xb5'),'LUMENVOX_ASR_CONFIDENCE');if(_0x51b736[_0x17be('0xa6')]===-0x1){return _0x51b736;}var _0x3e98bf=this[_0x17be('0xb4')](_0x17be('0xb7'),_0x17be('0xca'));if(_0x3e98bf[_0x17be('0xa6')]===-0x1){return _0x3e98bf;}var _0x251c22=this[_0x17be('0xb4')](_0x17be('0xcb'),_0x17be('0xcc'));if(_0x251c22[_0x17be('0xa6')]===-0x1){return _0x251c22;}return this[_0x17be('0xe')]['noop'](util[_0x17be('0x28')]('Executed\x20command\x20MRCPRecog\x20%s',_0x439be0));};AGIVertices[_0x17be('0x10')][_0x17be('0xcd')]=function(_0xb38423){logger[_0x17be('0x2c')](util[_0x17be('0x28')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0xb38423['label']));if(!this['isConfigured'](_0xb38423['grammar'])){return this[_0x17be('0xe')]['noop'](_0x17be('0xb2'));}var _0x2f73ab=_0xb38423[_0x17be('0xb1')];if(this[_0x17be('0x88')](_0xb38423[_0x17be('0x79')])){_0x2f73ab+=','+_0xb38423['options'];}var _0xe1d9d7=this['channel'][_0x17be('0x58')](_0x17be('0xb3'),_0x2f73ab);if(_0xe1d9d7[_0x17be('0xa6')]===-0x1){return _0xe1d9d7;}var _0x358c04=this[_0x17be('0xb4')](_0x17be('0xb5'),_0x17be('0xce'));if(_0x358c04[_0x17be('0xa6')]===-0x1){return _0x358c04;}var _0x161081=this['getAndSetVariable'](_0x17be('0xb7'),_0x17be('0xcf'));if(_0x161081[_0x17be('0xa6')]===-0x1){return _0x161081;}var _0x227f93=this[_0x17be('0xb4')](_0x17be('0xcb'),_0x17be('0xd0'));if(_0x227f93['result']===-0x1){return _0x227f93;}return this[_0x17be('0xe')][_0x17be('0xad')](util['format'](_0x17be('0xd1'),_0x2f73ab));};AGIVertices['prototype'][_0x17be('0xd2')]=function(_0x16b3a0){logger['info'](util[_0x17be('0x28')](_0x17be('0xd3'),_0x16b3a0[_0x17be('0x35')]));if(!this[_0x17be('0x88')](_0x16b3a0[_0x17be('0xd4')])){return this[_0x17be('0xe')][_0x17be('0x2b')](_0x16b3a0,_0x17be('0xd5'));}var _0x2552b7=this[_0x17be('0x17')]['sync'](this,_0x16b3a0[_0x17be('0xd4')]);if(!_0x2552b7){return this[_0x17be('0xe')][_0x17be('0x2b')](_0x16b3a0,'no\x20odbc\x20database\x20found');}if(!this[_0x17be('0x88')](_0x16b3a0[_0x17be('0x2e')])){return this[_0x17be('0xe')][_0x17be('0x2b')](_0x16b3a0,'no\x20query\x20configured');}var _0x5abd3=_0x16b3a0[_0x17be('0x2e')][_0x17be('0x5a')](/(\r\n|\n|\r)/gm,'\x20');this[_0x17be('0xe')][_0x17be('0xad')](util[_0x17be('0x28')](_0x17be('0xd6'),_0x5abd3));var _0x114ff2=this['getQueryOdbc'][_0x17be('0xaa')](this,_0x2552b7,_0x5abd3);this[_0x17be('0x33')][_0x17be('0xaa')](this,_0x16b3a0,_0x5abd3);if(!this[_0x17be('0x88')](_0x16b3a0['variable_id'])){return this[_0x17be('0xe')][_0x17be('0xad')](_0x17be('0xd7'));}var _0x23cd14=this['getVariable'][_0x17be('0xaa')](this,_0x16b3a0['variable_id']);if(!_0x23cd14){return this[_0x17be('0xe')][_0x17be('0x2b')](_0x16b3a0,_0x17be('0xd8'));}var _0x11e75a=this;_0x114ff2['forEach'](function(_0x4146b7,_0x2bcb91){Object[_0x17be('0xd9')](_0x4146b7)[_0x17be('0xda')](function(_0x31a51c){_0x11e75a['channel'][_0x17be('0xa2')](util[_0x17be('0x28')](_0x17be('0xdb'),_0x23cd14,_0x2bcb91,_0x31a51c),_0x4146b7[_0x31a51c]);});});this[_0x17be('0xe')]['setVariable'](util['format'](_0x17be('0xdc'),_0x23cd14),_0x114ff2[_0x17be('0x9e')]);return this['channel'][_0x17be('0xad')](util[_0x17be('0x28')]('variable\x20%s\x20set',_0x23cd14));};AGIVertices['prototype']['dial']=function(_0x5db52c){logger['debug'](util['format'](_0x17be('0xdd'),_0x5db52c[_0x17be('0x35')]));if(!this[_0x17be('0x88')](_0x5db52c['sip_id'])){return this[_0x17be('0xe')][_0x17be('0x2b')](_0x5db52c,_0x17be('0xde'));}var _0x133097=this[_0x17be('0x19')]['sync'](this,_0x5db52c[_0x17be('0xdf')]);if(!_0x133097){return this['channel']['error'](_0x5db52c,'no\x20user\x20found');}var _0x2e6319=this[_0x17be('0xe')]['exec'](_0x17be('0xe0'),[util[_0x17be('0x28')](_0x17be('0xe1'),_0x133097),_0x5db52c[_0x17be('0x67')],_0x5db52c['opts'],_0x5db52c[_0x17be('0x64')]]);if(_0x2e6319[_0x17be('0xa6')]===-0x1){return _0x2e6319;}return this[_0x17be('0xe')][_0x17be('0xad')](util['format'](_0x17be('0xe2'),_0x17be('0xe0')));};AGIVertices[_0x17be('0x10')][_0x17be('0xe3')]=function(_0xf17c28){logger['info'](util['format']('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0xf17c28[_0x17be('0x35')]));if(!this[_0x17be('0x88')](_0xf17c28[_0x17be('0x7b')])){return this[_0x17be('0xe')][_0x17be('0xad')]('no\x20key\x20configured');}if(!this[_0x17be('0x88')](_0xf17c28[_0x17be('0x5c')])){return this[_0x17be('0xe')][_0x17be('0xad')]('no\x20text\x20configured');}this[_0x17be('0xe')][_0x17be('0xe4')]=!![];this['createSquareDetailsReport'](_0xf17c28);this[_0x17be('0x41')](_0xf17c28[_0x17be('0x5c')],'in','','');this['channel'][_0x17be('0xad')](util['format'](_0x17be('0xe5'),_0xf17c28[_0x17be('0x5c')]));var _0x3cd438=this[_0x17be('0x7a')][_0x17be('0xaa')](this,_0xf17c28);if(_0x3cd438){for(var _0x2739db in _0x3cd438){if(_0x3cd438[_0x17be('0x98')](_0x2739db)){this['channel'][_0x17be('0xa2')](util['format'](_0x17be('0xe6'),_0x2739db['toUpperCase']()),_0x3cd438[_0x2739db]);}}this[_0x17be('0x41')](_0x3cd438[_0x17be('0xe7')],_0x17be('0xe8'),_0x17be('0xe3'),'');return this[_0x17be('0xe')][_0x17be('0xad')](util['format'](_0x17be('0xe9'),_0x3cd438[_0x17be('0xe7')]));}return this[_0x17be('0xe')][_0x17be('0x2b')](_0xf17c28,_0x17be('0xea'));};AGIVertices[_0x17be('0x10')][_0x17be('0xeb')]=function(_0x3c1ef5){logger[_0x17be('0x2c')](util['format'](_0x17be('0xec'),_0x3c1ef5[_0x17be('0x35')]));if(!this['isConfigured'](_0x3c1ef5[_0x17be('0x7e')])){return this[_0x17be('0xe')][_0x17be('0xad')]('no\x20project_id\x20configured');}if(!this[_0x17be('0x88')](_0x3c1ef5[_0x17be('0x7f')])){return this[_0x17be('0xe')]['noop'](_0x17be('0xed'));}if(!this[_0x17be('0x88')](_0x3c1ef5[_0x17be('0x80')])){return this[_0x17be('0xe')][_0x17be('0xad')]('no\x20private_key\x20configured');}if(!this[_0x17be('0x88')](_0x3c1ef5[_0x17be('0x81')])){return this[_0x17be('0xe')][_0x17be('0xad')](_0x17be('0xee'));}if(!this['isConfigured'](_0x3c1ef5[_0x17be('0x5c')])){return this[_0x17be('0xe')][_0x17be('0xad')](_0x17be('0xc8'));}this[_0x17be('0xe')][_0x17be('0xe4')]=!![];this[_0x17be('0x33')](_0x3c1ef5);this['createSquareMessage'](_0x3c1ef5[_0x17be('0x5c')],'in','','');this[_0x17be('0xe')][_0x17be('0xad')](util[_0x17be('0x28')](_0x17be('0xef'),_0x3c1ef5[_0x17be('0x5c')]));var _0x544163=this[_0x17be('0x7d')]['sync'](this,_0x3c1ef5);if(_0x544163){for(var _0x1cd204 in _0x544163){if(_0x544163[_0x17be('0x98')](_0x1cd204)){if(_0x1cd204!==_0x17be('0xf0')){this['channel']['setVariable'](util['format']('DIALOGFLOW_%s',_0x1cd204['toUpperCase']()),_0x544163[_0x1cd204]);}}}this[_0x17be('0x41')](_0x544163[_0x17be('0xe7')],_0x17be('0xe8'),_0x17be('0xeb'),_0x544163[_0x17be('0xf0')]);return this[_0x17be('0xe')][_0x17be('0xad')](util[_0x17be('0x28')](_0x17be('0xf1'),_0x544163['speech']));}return this[_0x17be('0xe')][_0x17be('0x2b')](_0x3c1ef5,_0x17be('0xf2'));};AGIVertices[_0x17be('0x10')][_0x17be('0xf3')]=function(_0x229027){logger['info'](util['format'](_0x17be('0xf4'),_0x229027[_0x17be('0x35')]));if(!this[_0x17be('0x88')](_0x229027[_0x17be('0xf5')])){return this[_0x17be('0xe')][_0x17be('0xad')](_0x17be('0xf6'));}if(!this[_0x17be('0x88')](_0x229027[_0x17be('0xf7')])){return this['channel'][_0x17be('0xad')]('no\x20username\x20configured');}if(!this[_0x17be('0x88')](_0x229027[_0x17be('0xf8')])){return this[_0x17be('0xe')][_0x17be('0xad')]('no\x20password\x20configured');}if(!this[_0x17be('0x88')](_0x229027['ndassistant_url'])){return this['channel'][_0x17be('0xad')](_0x17be('0xc8'));}this[_0x17be('0xe')][_0x17be('0xe4')]=!![];this[_0x17be('0x33')](_0x229027);this['createSquareMessage'](_0x229027[_0x17be('0x5c')],'in','','');this[_0x17be('0xe')][_0x17be('0xad')](util['format'](_0x17be('0xf9'),_0x229027['text']));var _0x2ece22=this['sestekNDA'][_0x17be('0xaa')](this,_0x229027);if(_0x2ece22){for(var _0x94520c in _0x2ece22){if(_0x2ece22[_0x17be('0x98')](_0x94520c)){this['channel'][_0x17be('0xa2')](util[_0x17be('0x28')](_0x17be('0xfa'),_0x94520c[_0x17be('0x6b')]()),_0x2ece22[_0x94520c]);}}this['createSquareMessage'](_0x2ece22[_0x17be('0xe7')],'out',_0x17be('0xf3'),'');if(_0x2ece22['audiofile']){this[_0x17be('0xe')][_0x17be('0xad')](util['format'](_0x17be('0xfb'),_0x2ece22[_0x17be('0xfc')]));var _0x34f85e=this['channel'][_0x17be('0xfd')](_0x2ece22['audiofile']);try{fs[_0x17be('0xfe')](_0x2ece22['audiofile']+_0x17be('0xff'));}catch(_0x4de8ba){logger[_0x17be('0x2b')](_0x4de8ba);}return _0x34f85e;}else{return this['channel'][_0x17be('0xad')](util[_0x17be('0x28')](_0x17be('0x100'),_0x2ece22[_0x17be('0xe7')]));}}return this[_0x17be('0xe')][_0x17be('0x2b')](_0x229027,_0x17be('0x101'));};AGIVertices['prototype'][_0x17be('0x102')]=function(_0x3be309){logger[_0x17be('0x2c')](util[_0x17be('0x28')](_0x17be('0x103'),_0x3be309[_0x17be('0x35')]));return this[_0x17be('0xe')]['noop'](_0x17be('0x102'));};AGIVertices[_0x17be('0x10')][_0x17be('0x104')]=function(_0x5085b0){logger[_0x17be('0x2c')](util[_0x17be('0x28')](_0x17be('0x105'),_0x5085b0[_0x17be('0x35')]));var _0x3b8076='';if(_0x5085b0[_0x17be('0x106')]){if(!this['isConfigured'](_0x5085b0[_0x17be('0x106')])){return this[_0x17be('0xe')][_0x17be('0x2b')](_0x5085b0,'no\x20trunk\x20selected');}else{var _0x5a21c7=parseInt(_0x5085b0[_0x17be('0x106')],0xa);if(isNaN(_0x5a21c7)){_0x3b8076=_0x5085b0[_0x17be('0x106')];}else{_0x3b8076=this[_0x17be('0x1a')][_0x17be('0xaa')](this,_0x5085b0['trunk_id']);if(!_0x3b8076){return this[_0x17be('0xe')][_0x17be('0x2b')](_0x5085b0,_0x17be('0x107'));}}}}else if(_0x5085b0[_0x17be('0x108')]){_0x3b8076=_0x5085b0[_0x17be('0x108')];}else{return this[_0x17be('0xe')][_0x17be('0x2b')](_0x5085b0,_0x17be('0x109'));}var _0x3252c4=this[_0x17be('0xe')][_0x17be('0x58')](_0x17be('0xe0'),[util[_0x17be('0x28')](_0x17be('0x10a'),_0x3b8076,_0x5085b0[_0x17be('0x48')]),_0x5085b0[_0x17be('0x67')],_0x5085b0['opts'],_0x5085b0['url']]);if(_0x3252c4[_0x17be('0xa6')]===-0x1){return _0x3252c4;}return this['channel'][_0x17be('0xad')](util[_0x17be('0x28')](_0x17be('0xe2'),_0x17be('0xe0')));};AGIVertices[_0x17be('0x10')]['finally']=function(_0x4783e0){logger[_0x17be('0x2c')](util[_0x17be('0x28')](_0x17be('0x10b'),_0x4783e0[_0x17be('0x35')]));return this[_0x17be('0xe')][_0x17be('0xad')](_0x17be('0x10c'));};AGIVertices['prototype']['getdigits']=function(_0x27252c){logger[_0x17be('0x2c')](util[_0x17be('0x28')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x27252c[_0x17be('0x35')]));if(_0x27252c[_0x17be('0x10d')]===0x0){return this[_0x17be('0xa9')](_0x27252c);}_0x27252c[_0x17be('0x10d')]-=0x1;if(!this[_0x17be('0x88')](_0x27252c[_0x17be('0x10e')])){return this[_0x17be('0xe')]['error'](_0x27252c,'no\x20file\x20audio\x20selected');}var _0x1e50dd=this[_0x17be('0x1d')]['sync'](this,_0x27252c['file_id']);if(!_0x1e50dd){return this[_0x17be('0xe')]['error'](_0x27252c,'no\x20file\x20audio\x20found');}if(!this[_0x17be('0x88')](_0x27252c[_0x17be('0x10f')])){return this[_0x17be('0xe')][_0x17be('0x2b')](_0x17be('0xd7'));}var _0x142604=this[_0x17be('0xe')][_0x17be('0x110')](_0x1e50dd,_0x27252c[_0x17be('0x111')],_0x27252c['maxdigit']);var _0x37b462=_0x142604[_0x17be('0xa6')]?_0x142604['result'][_0x17be('0x4c')]():'';logger[_0x17be('0x2c')](_0x17be('0x112'),JSON['stringify'](_0x142604));if(_0x142604['result']===-0x1){this[_0x17be('0x33')][_0x17be('0xaa')](this,_0x27252c,_0x37b462);return _0x142604;}else if(_0x142604[_0x17be('0xa8')]===_0x17be('0x67')){_0x142604['result']=_0x37b462[_0x17be('0x9e')]>=parseInt(_0x27252c['mindigit'])?'x':'i';}else{_0x142604[_0x17be('0xa6')]=_0x37b462['length']>=parseInt(_0x27252c[_0x17be('0x113')])&&_0x37b462[_0x17be('0x9e')]<=parseInt(_0x27252c[_0x17be('0x114')])?'x':'i';}var _0x463efe=this[_0x17be('0xa5')][_0x17be('0xaa')](this,_0x27252c[_0x17be('0x10f')]);if(!_0x463efe){return this[_0x17be('0xe')][_0x17be('0x2b')](_0x27252c,_0x17be('0xd8'));}this[_0x17be('0xe')][_0x17be('0xa2')](_0x463efe,_0x37b462);if(this[_0x17be('0x88')](_0x27252c[_0x17be('0x115')])){var _0x2114d2=parseInt(_0x27252c[_0x17be('0x115')],0xa);var _0xd15d42=rs[_0x17be('0x116')]({'charset':'*','length':_0x2114d2});var _0x4a6fdd=_0x37b462['length'];if(_0x4a6fdd>0x0){if(_0x4a6fdd>_0x2114d2){this[_0x17be('0x33')][_0x17be('0xaa')](this,_0x27252c,_0x27252c[_0x17be('0x117')]==='first'?_0xd15d42+_0x37b462[_0x17be('0x118')](_0x2114d2):_0x37b462['substr'](0x0,_0x4a6fdd-_0x2114d2)+_0xd15d42);}else{this[_0x17be('0x33')][_0x17be('0xaa')](this,_0x27252c,rs['generate']({'charset':'*','length':_0x4a6fdd}));}}else{this[_0x17be('0x33')][_0x17be('0xaa')](this,_0x27252c,'');}}else{this[_0x17be('0x33')][_0x17be('0xaa')](this,_0x27252c,_0x37b462);}return _0x142604;};AGIVertices[_0x17be('0x10')][_0x17be('0xd')]=function(_0x517c2c){logger[_0x17be('0x2c')](util[_0x17be('0x28')](_0x17be('0x119'),_0x517c2c[_0x17be('0x35')]));return this[_0x17be('0xc')](_0x517c2c);};AGIVertices[_0x17be('0x10')][_0x17be('0x11a')]=function(_0x16fd52){logger['info'](util[_0x17be('0x28')](_0x17be('0x11b'),_0x16fd52[_0x17be('0x35')]));this[_0x17be('0x33')]['sync'](this,_0x16fd52,_0x16fd52['goalname']);return this[_0x17be('0xe')][_0x17be('0xad')](util['format']('GOAL\x20%s',_0x16fd52[_0x17be('0x11c')]));};AGIVertices[_0x17be('0x10')][_0x17be('0x11d')]=function(_0x1f939c){logger[_0x17be('0x2c')](util[_0x17be('0x28')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x1f939c['label']));if(!this['isConfigured'](_0x1f939c[_0x17be('0x8b')])||!this[_0x17be('0x88')](_0x1f939c['aws_secret_access_key'])){return this[_0x17be('0xe')][_0x17be('0xad')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x17be('0x88')](_0x1f939c['text'])){return this['channel'][_0x17be('0xad')](_0x17be('0xc8'));}this[_0x17be('0xe')]['noop'](util[_0x17be('0x28')](_0x17be('0x11e'),_0x1f939c[_0x17be('0x5c')]));var _0x3a580e=this['awsPolly'][_0x17be('0xaa')](this,_0x1f939c);if(_0x3a580e){this['channel']['noop'](util[_0x17be('0x28')](_0x17be('0x11f'),_0x3a580e));var _0x2c5966=this[_0x17be('0xe')][_0x17be('0xfd')](_0x3a580e);try{fs[_0x17be('0xfe')](_0x3a580e+_0x17be('0xff'));}catch(_0x161179){logger[_0x17be('0x2b')](_0x161179);}return _0x2c5966;}return this[_0x17be('0xe')]['error'](_0x1f939c,_0x17be('0x120'));};AGIVertices[_0x17be('0x10')][_0x17be('0x121')]=function(_0x5a69da){logger[_0x17be('0x2c')](util['format'](_0x17be('0x122'),_0x5a69da[_0x17be('0x35')]));if(!this[_0x17be('0x88')](_0x5a69da[_0x17be('0x8b')])||!this[_0x17be('0x88')](_0x5a69da['aws_secret_access_key'])){return this[_0x17be('0xe')]['noop'](_0x17be('0x123'));}if(!this['isConfigured'](_0x5a69da['aws_bot_name'])){return this[_0x17be('0xe')][_0x17be('0xad')]('no\x20bot\x20name\x20configured');}if(!this['isConfigured'](_0x5a69da[_0x17be('0x5c')])){return this[_0x17be('0xe')][_0x17be('0xad')](_0x17be('0xc8'));}this[_0x17be('0xe')][_0x17be('0xe4')]=!![];this[_0x17be('0x33')](_0x5a69da);this[_0x17be('0x41')](_0x5a69da['text'],'in','','');this['channel'][_0x17be('0xad')](util[_0x17be('0x28')](_0x17be('0x124'),_0x5a69da['text']));var _0x58ad9e=this['awsLex'][_0x17be('0xaa')](this,_0x5a69da);if(_0x58ad9e){for(var _0x2b48c1 in _0x58ad9e){if(_0x58ad9e[_0x17be('0x98')](_0x2b48c1)&&_['isString'](_0x58ad9e[_0x2b48c1])){this['channel']['setVariable'](util[_0x17be('0x28')](_0x17be('0x125'),_0x2b48c1[_0x17be('0x6b')]()),_0x58ad9e[_0x2b48c1]);}}if(_['isNil'](_0x58ad9e['message'])){return this[_0x17be('0xe')][_0x17be('0xad')](_0x17be('0x126'));}else{this['createSquareMessage'](_0x58ad9e[_0x17be('0x77')],_0x17be('0xe8'),'amazonlex','');return this['channel'][_0x17be('0xad')](util[_0x17be('0x28')](_0x17be('0x127'),_0x58ad9e[_0x17be('0x77')]));}}return this[_0x17be('0xe')][_0x17be('0x2b')](_0x5a69da,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x17be('0x10')][_0x17be('0x128')]=function(_0x3eca48){logger[_0x17be('0x2c')](util[_0x17be('0x28')](_0x17be('0x129'),_0x3eca48[_0x17be('0x35')],_0x3eca48[_0x17be('0x67')]));if(!this[_0x17be('0x88')](_0x3eca48['key'])){return this[_0x17be('0xe')]['noop']('no\x20key\x20configured');}var _0x7b1a77=_0x17be('0x12a');var _0x1248b9=util[_0x17be('0x28')](_0x17be('0x12b'),FILES_PATH,rs[_0x17be('0x116')](0x4));var _0x6bee98=util[_0x17be('0x28')](_0x17be('0xa1'),_0x1248b9,_0x7b1a77);var _0x5ed302=!![];if(_0x3eca48[_0x17be('0x12c')]===_0x17be('0x12d')){_0x5ed302=![];}var _0x39077e=this[_0x17be('0xe')][_0x17be('0x12e')](_0x1248b9,_0x7b1a77,_0x3eca48[_0x17be('0x12f')],_0x3eca48[_0x17be('0x67')],undefined,_0x5ed302);if(_0x39077e[_0x17be('0xa6')]!==-0x1){this[_0x17be('0xe')][_0x17be('0xad')](util[_0x17be('0x28')](_0x17be('0x130'),_0x6bee98));var _0x410d9a=this['googleASR'][_0x17be('0xaa')](this,_0x3eca48,_0x6bee98);if(_0x410d9a){for(var _0x2ffe1f in _0x410d9a){if(_0x410d9a[_0x17be('0x98')](_0x2ffe1f)){this[_0x17be('0xe')][_0x17be('0xa2')](util[_0x17be('0x28')](_0x17be('0x131'),_0x2ffe1f[_0x17be('0x6b')]()),_0x410d9a[_0x2ffe1f]);}}return this['channel'][_0x17be('0xad')](util['format'](_0x17be('0x132'),JSON[_0x17be('0x73')](_0x410d9a)));}}return _0x39077e;};AGIVertices[_0x17be('0x10')]['tildeasr']=function(_0x150463){logger[_0x17be('0x2c')](util[_0x17be('0x28')](_0x17be('0x133'),_0x150463[_0x17be('0x35')]));if(!this[_0x17be('0x88')](_0x150463['appid'])){return this[_0x17be('0xe')][_0x17be('0xad')]('no\x20appid\x20configured');}if(!this[_0x17be('0x88')](_0x150463['appsecret'])){return this[_0x17be('0xe')][_0x17be('0xad')](_0x17be('0x134'));}var _0x1f495b=_0x17be('0x12a');var _0x9fcaef=util[_0x17be('0x28')](_0x17be('0x12b'),FILES_PATH,rs[_0x17be('0x116')](0x4));var _0x257336=util[_0x17be('0x28')](_0x17be('0xa1'),_0x9fcaef,_0x1f495b);var _0x33ceb5=!![];if(_0x150463[_0x17be('0x12c')]===_0x17be('0x12d')){_0x33ceb5=![];}var _0x11fdef=this['channel'][_0x17be('0x12e')](_0x9fcaef,_0x1f495b,_0x150463[_0x17be('0x12f')],_0x150463[_0x17be('0x67')],undefined,_0x33ceb5);if(_0x11fdef[_0x17be('0xa6')]!==-0x1){this[_0x17be('0xe')][_0x17be('0xad')](util[_0x17be('0x28')](_0x17be('0x135'),_0x257336));var _0x2fc81e=this[_0x17be('0x94')]['sync'](this,_0x150463,_0x257336);if(_0x2fc81e){for(var _0x2a349b in _0x2fc81e){if(_0x2fc81e[_0x17be('0x98')](_0x2a349b)){this['channel'][_0x17be('0xa2')](util['format'](_0x17be('0x136'),_0x2a349b['toUpperCase']()),_0x2fc81e[_0x2a349b]);}}return this[_0x17be('0xe')][_0x17be('0xad')](util[_0x17be('0x28')]('TildeASR\x20Result\x20%s',JSON['stringify'](_0x2fc81e)));}}return _0x11fdef;};AGIVertices[_0x17be('0x10')]['gotoc']=function(_0x430863){logger[_0x17be('0x2c')](util['format'](_0x17be('0x137'),_0x430863[_0x17be('0x35')]));return this[_0x17be('0xe')][_0x17be('0x138')](_0x430863[_0x17be('0x3a')],_0x430863[_0x17be('0x3b')],_0x430863['priority']);};AGIVertices[_0x17be('0x10')][_0x17be('0x139')]=function(_0x302345){logger[_0x17be('0x2c')](util[_0x17be('0x28')](_0x17be('0x13a'),_0x302345[_0x17be('0x35')]));if(!this[_0x17be('0x88')](_0x302345[_0x17be('0x13b')])){return this[_0x17be('0xe')]['error'](_0x302345,'no\x20condition\x20configured');}try{var _0x24c82c=eval(_0x302345[_0x17be('0x13b')])?_0x17be('0x13c'):_0x17be('0x13d');this[_0x17be('0xe')][_0x17be('0xad')](util[_0x17be('0x28')](_0x17be('0x13e'),_0x302345['condition'],_0x24c82c));return{'code':0xc8,'result':_0x24c82c};}catch(_0x377798){return{'code':0xc8,'result':_0x17be('0x13d')};}};AGIVertices[_0x17be('0x10')]['gotoiftime']=function(_0x192736){logger[_0x17be('0x2c')](util[_0x17be('0x28')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x192736[_0x17be('0x35')]));if(!this[_0x17be('0x88')](_0x192736[_0x17be('0x13f')])){return this[_0x17be('0xe')]['error'](_0x192736,_0x17be('0x140'));}var _0x22904b=this[_0x17be('0x141')][_0x17be('0xaa')](this,_0x192736[_0x17be('0x13f')]);if(!_0x22904b){return this['channel'][_0x17be('0x2b')](_0x192736,'no\x20intervals\x20found');}for(var _0x51ecab=0x0;_0x51ecab<_0x22904b[_0x17be('0x9e')];_0x51ecab+=0x1){var _0x9345a6=this[_0x17be('0xe')]['getVariable'](util['format'](_0x17be('0x142'),_0x22904b[_0x51ecab]));if(_0x9345a6[_0x17be('0xa6')]===-0x1){return _0x9345a6;}logger[_0x17be('0x2c')](util['format']('IFTIME\x20%s\x20%s',_0x22904b[_0x51ecab],_0x9345a6[_0x17be('0xa8')]));if(_0x9345a6[_0x17be('0xa8')]==='true'){logger[_0x17be('0x2c')](util['format'](_0x17be('0x143'),_0x22904b[_0x51ecab],_0x17be('0x13c')));this['channel']['noop'](util['format'](_0x17be('0x143'),_0x22904b[_0x51ecab],_0x17be('0x13c')));return{'code':0xc8,'result':_0x17be('0x13c')};}else{logger['info'](util['format']('IFTIME\x20%s\x20%s',_0x22904b[_0x51ecab],'false'));this[_0x17be('0xe')][_0x17be('0xad')](util[_0x17be('0x28')](_0x17be('0x143'),_0x22904b[_0x51ecab],'false'));}}return{'code':0xc8,'result':_0x17be('0x13d')};};AGIVertices[_0x17be('0x10')][_0x17be('0x144')]=function(_0x40ecf5){logger[_0x17be('0x2c')](util[_0x17be('0x28')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x40ecf5[_0x17be('0x35')]));return this[_0x17be('0xe')][_0x17be('0x144')]();};AGIVertices[_0x17be('0x10')]['ispeechasr']=function(_0x27b729){logger[_0x17be('0x2c')](util[_0x17be('0x28')](_0x17be('0x145'),_0x27b729[_0x17be('0x35')]));if(!this[_0x17be('0x88')](_0x27b729[_0x17be('0x7b')])){return this['channel'][_0x17be('0xad')]('no\x20key\x20configured');}var _0x4b380f=_0x17be('0x12a');var _0x120f45=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x17be('0x116')](0x4));var _0x4748e9=util[_0x17be('0x28')](_0x17be('0xa1'),_0x120f45,_0x4b380f);var _0x58c035=!![];if(_0x27b729[_0x17be('0x12c')]===_0x17be('0x12d')){_0x58c035=![];}var _0x34f8a7=this[_0x17be('0xe')][_0x17be('0x12e')](_0x120f45,_0x4b380f,_0x27b729[_0x17be('0x12f')],_0x27b729[_0x17be('0x67')],undefined,_0x58c035);if(_0x34f8a7[_0x17be('0xa6')]!==-0x1){this['channel']['noop'](util[_0x17be('0x28')]('ispeech\x20%s\x20file\x20created',_0x4748e9));var _0x5ccca6=this[_0x17be('0x87')][_0x17be('0xaa')](this,_0x27b729,_0x4748e9);if(_0x5ccca6){for(var _0x5409aa in _0x5ccca6){if(_0x5ccca6[_0x17be('0x98')](_0x5409aa)){this[_0x17be('0xe')][_0x17be('0xa2')](util[_0x17be('0x28')]('ISPEECH_ASR_%s',_0x5409aa[_0x17be('0x6b')]()),_0x5ccca6[_0x5409aa]);}}return this[_0x17be('0xe')][_0x17be('0xad')](util[_0x17be('0x28')](_0x17be('0x146'),JSON['stringify'](_0x5ccca6)));}}return _0x34f8a7;};AGIVertices[_0x17be('0x10')][_0x17be('0x147')]=function(_0x162d9b){logger[_0x17be('0x2c')](util[_0x17be('0x28')](_0x17be('0x148'),_0x162d9b[_0x17be('0x35')]));if(!this[_0x17be('0x88')](_0x162d9b[_0x17be('0x7b')])){return this['channel']['noop'](_0x17be('0x149'));}if(!this[_0x17be('0x88')](_0x162d9b[_0x17be('0x5c')])){return this[_0x17be('0xe')][_0x17be('0xad')](_0x17be('0xc8'));}this[_0x17be('0xe')][_0x17be('0xad')](util[_0x17be('0x28')](_0x17be('0x14a'),_0x162d9b[_0x17be('0x5c')]));var _0x56988a=this[_0x17be('0x83')]['sync'](this,_0x162d9b);if(_0x56988a){this[_0x17be('0xe')][_0x17be('0xad')](util['format'](_0x17be('0x14b'),_0x56988a));var _0x4ccdbc=this[_0x17be('0xe')][_0x17be('0xfd')](_0x56988a,_0x162d9b[_0x17be('0x12f')]);try{fs[_0x17be('0xfe')](_0x56988a+_0x17be('0xff'));}catch(_0x236377){logger[_0x17be('0x2b')](_0x236377);}return _0x4ccdbc;}return this[_0x17be('0xe')][_0x17be('0x2b')](_0x162d9b,_0x17be('0x14c'));};AGIVertices['prototype'][_0x17be('0x14d')]=function(_0x2c7b09){logger[_0x17be('0x2c')](util['format'](_0x17be('0x14e'),_0x2c7b09[_0x17be('0x35')]));if(!this[_0x17be('0x88')](_0x2c7b09[_0x17be('0x14f')])){return this[_0x17be('0xe')][_0x17be('0x2b')](_0x2c7b09,_0x17be('0x150'));}logger['info'](util[_0x17be('0x28')](_0x17be('0x151'),this[_0x17be('0xe')][_0x17be('0x37')],_0x2c7b09[_0x17be('0x14f')]));var _0x3179a6=this[_0x17be('0x152')][_0x17be('0xaa')](this,_0x2c7b09['findBy']);if(_0x3179a6){logger['info'](util[_0x17be('0x28')](_0x17be('0x153'),this[_0x17be('0xe')][_0x17be('0x37')],_0x2c7b09[_0x17be('0x14f')]));this[_0x17be('0xe')][_0x17be('0xad')](util['format'](_0x17be('0x153'),this[_0x17be('0xe')][_0x17be('0x37')],_0x2c7b09[_0x17be('0x14f')]));return{'code':0xc8,'result':_0x17be('0x154')};}else{logger[_0x17be('0x2c')](util[_0x17be('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x17be('0xe')]['callerid'],_0x2c7b09[_0x17be('0x14f')]));this[_0x17be('0xe')][_0x17be('0xad')](util[_0x17be('0x28')](_0x17be('0x155'),this[_0x17be('0xe')][_0x17be('0x37')],_0x2c7b09[_0x17be('0x14f')]));return{'code':0xc8,'result':_0x17be('0x156')};}};AGIVertices[_0x17be('0x10')][_0x17be('0x157')]=function(_0x561f08){logger[_0x17be('0x2c')](util['format'](_0x17be('0x158'),_0x561f08[_0x17be('0x35')]));if(!this[_0x17be('0x88')](_0x561f08[_0x17be('0x14f')])){return this['channel']['error'](_0x561f08,_0x17be('0x150'));}logger['info'](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x17be('0xe')][_0x17be('0x37')],_0x561f08[_0x17be('0x14f')]));var _0x31c14d=this[_0x17be('0x53')][_0x17be('0xaa')](this,_0x561f08[_0x17be('0x14f')]);if(_0x31c14d){logger['info'](util['format'](_0x17be('0x153'),this[_0x17be('0xe')][_0x17be('0x37')],_0x561f08[_0x17be('0x14f')]));this['channel'][_0x17be('0xad')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x17be('0xe')][_0x17be('0x37')],_0x561f08[_0x17be('0x14f')]));return{'code':0xc8,'result':_0x17be('0x154')};}else{logger[_0x17be('0x2c')](util[_0x17be('0x28')](_0x17be('0x155'),this['channel'][_0x17be('0x37')],_0x561f08['findBy']));this['channel']['noop'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x17be('0xe')]['callerid'],_0x561f08[_0x17be('0x14f')]));return{'code':0xc8,'result':_0x17be('0x156')};}};AGIVertices[_0x17be('0x10')][_0x17be('0x159')]=function(_0x6a9e1){logger['info'](util['format'](_0x17be('0x15a'),_0x6a9e1['label']));if(!this[_0x17be('0x88')](_0x6a9e1['operation'])){return this[_0x17be('0xe')][_0x17be('0x2b')](_0x6a9e1,'no\x20operation\x20configured');}this[_0x17be('0xe')]['noop'](util[_0x17be('0x28')](_0x17be('0x15b'),_0x6a9e1[_0x17be('0x15c')]));var _0x1c5455=eval(_0x6a9e1[_0x17be('0x15c')]);if(!this[_0x17be('0x88')](_0x6a9e1['variable_id'])){return this[_0x17be('0xe')]['noop'](_0x17be('0xd7'));}var _0x2e6839=this['getVariable'][_0x17be('0xaa')](this,_0x6a9e1[_0x17be('0x10f')]);if(!_0x2e6839){return this[_0x17be('0xe')]['error'](_0x6a9e1,_0x17be('0xd8'));}if(_[_0x17be('0x9d')](_0x1c5455)){var _0x4697cc=this;_0x1c5455['forEach'](function(_0x4fa7a0,_0x36c3cf){_0x4697cc[_0x17be('0xe')][_0x17be('0xa2')](util[_0x17be('0x28')](_0x17be('0x15d'),_0x2e6839,_0x36c3cf),_0x4fa7a0);});return this[_0x17be('0xe')][_0x17be('0xad')](util['format'](_0x17be('0x15e'),_0x2e6839));}else{return this[_0x17be('0xe')][_0x17be('0xa2')](_0x2e6839,_0x1c5455);}};AGIVertices[_0x17be('0x10')][_0x17be('0xb')]=function(_0x1b0af5){logger[_0x17be('0x2c')](util[_0x17be('0x28')](_0x17be('0x15f'),_0x1b0af5[_0x17be('0x35')]));if(_0x1b0af5['retry']===0x0){return this['maxRetry'](_0x1b0af5);}_0x1b0af5[_0x17be('0x10d')]-=0x1;if(!this['isConfigured'](_0x1b0af5['file_id'])){return this[_0x17be('0xe')]['error'](_0x1b0af5,'no\x20file\x20audio\x20selected');}var _0x3e7b65=this[_0x17be('0x1d')][_0x17be('0xaa')](this,_0x1b0af5[_0x17be('0x10e')]);if(!_0x3e7b65){return this[_0x17be('0xe')][_0x17be('0x2b')](_0x1b0af5,_0x17be('0x160'));}var _0x4bb9a6=this[_0x17be('0xe')]['getData'](_0x3e7b65,_0x1b0af5['response'],_0x1b0af5[_0x17be('0x161')]);var _0x30f9f2=_0x4bb9a6[_0x17be('0xa6')];if(_0x4bb9a6[_0x17be('0xa6')]===-0x1){this[_0x17be('0x33')]['sync'](this,_0x1b0af5,'-1');return _0x4bb9a6;}else if(_0x4bb9a6[_0x17be('0xa8')]===_0x17be('0x67')){_0x4bb9a6[_0x17be('0xa6')]=_0x4bb9a6[_0x17be('0xa6')][_0x17be('0x9e')]>0x0?_0x4bb9a6['result']:'t';}else if(_[_0x17be('0x43')](_0x4bb9a6[_0x17be('0xa6')])){_0x4bb9a6[_0x17be('0xa6')]='#';_0x30f9f2='#';}if(!this[_0x17be('0x88')](_0x1b0af5[_0x17be('0x10f')])){this[_0x17be('0xe')][_0x17be('0xad')](_0x17be('0xd7'));}else{var _0x557258=this[_0x17be('0xa5')][_0x17be('0xaa')](this,_0x1b0af5[_0x17be('0x10f')]);if(!_0x557258){return this[_0x17be('0xe')][_0x17be('0x2b')](_0x1b0af5,_0x17be('0xd8'));}this['channel'][_0x17be('0xa2')](_0x557258,_0x30f9f2);}this[_0x17be('0x33')][_0x17be('0xaa')](this,_0x1b0af5,_0x30f9f2);return _0x4bb9a6;};AGIVertices[_0x17be('0x10')]['noop']=function(_0x365199){logger[_0x17be('0x2c')](util[_0x17be('0x28')](_0x17be('0x162'),_0x365199['label']));return this[_0x17be('0xe')][_0x17be('0xad')](_0x365199[_0x17be('0x163')]||_0x365199[_0x17be('0x35')]);};AGIVertices[_0x17be('0x10')][_0x17be('0x164')]=function(_0x2aa632){logger[_0x17be('0x2c')](util[_0x17be('0x28')](_0x17be('0x165'),_0x2aa632[_0x17be('0x35')]));if(!this['isConfigured'](_0x2aa632[_0x17be('0x14f')])){return this[_0x17be('0xe')]['error'](_0x2aa632,'no\x20find\x20by\x20configured');}logger[_0x17be('0x2c')](util[_0x17be('0x28')](_0x17be('0x151'),this[_0x17be('0xe')][_0x17be('0x37')],_0x2aa632[_0x17be('0x14f')]));var _0x53e659=this[_0x17be('0x4e')][_0x17be('0xaa')](this,_0x2aa632[_0x17be('0x166')]);var _0x47a401=this[_0x17be('0x50')][_0x17be('0xaa')](this,_0x2aa632[_0x17be('0x14f')],_0x53e659);if(_0x47a401){logger[_0x17be('0x2c')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x17be('0xe')][_0x17be('0x37')],_0x2aa632[_0x17be('0x14f')]));this['channel'][_0x17be('0xad')](util[_0x17be('0x28')](_0x17be('0x153'),this[_0x17be('0xe')][_0x17be('0x37')],_0x2aa632[_0x17be('0x14f')]));return{'code':0xc8,'result':_0x17be('0x154')};}else{logger[_0x17be('0x2c')](util['format'](_0x17be('0x155'),this[_0x17be('0xe')][_0x17be('0x37')],_0x2aa632[_0x17be('0x14f')]));this['channel'][_0x17be('0xad')](util[_0x17be('0x28')](_0x17be('0x153'),this[_0x17be('0xe')][_0x17be('0x37')],_0x2aa632['findBy']));return{'code':0xc8,'result':_0x17be('0x156')};}};AGIVertices[_0x17be('0x10')][_0x17be('0x167')]=function(_0x331854){logger[_0x17be('0x2c')](util[_0x17be('0x28')](_0x17be('0x168'),_0x331854[_0x17be('0x35')]));if(!this['isConfigured'](_0x331854[_0x17be('0x10e')])){return this[_0x17be('0xe')]['error'](_0x331854,_0x17be('0x169'));}var _0x4a889f=this['getSound'][_0x17be('0xaa')](this,_0x331854['file_id']);if(!_0x4a889f){return this[_0x17be('0xe')][_0x17be('0x2b')](_0x331854,_0x17be('0x160'));}var _0x55513a=this['channel'][_0x17be('0x58')](_0x17be('0x16a'),[_0x4a889f,_0x331854[_0x17be('0x16b')]]);if(_0x55513a['result']===-0x1){return _0x55513a;}return this[_0x17be('0xe')][_0x17be('0xad')](util[_0x17be('0x28')](_0x17be('0xc5'),_0x17be('0x16a'),_0x4a889f));};AGIVertices[_0x17be('0x10')][_0x17be('0x16c')]=function(_0x439b17){logger[_0x17be('0x2c')](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x439b17[_0x17be('0x35')]));if(!this[_0x17be('0x88')](_0x439b17[_0x17be('0x16d')])){return this[_0x17be('0xe')][_0x17be('0x2b')](_0x439b17,'no\x20queue\x20selected');}var _0x180b66='';var _0xfecf4c=parseInt(_0x439b17[_0x17be('0x16d')],0xa);if(isNaN(_0xfecf4c)){_0x180b66=_0x439b17[_0x17be('0x16d')];}else{_0x180b66=this[_0x17be('0x14')][_0x17be('0xaa')](this,_0x439b17[_0x17be('0x16d')]);if(!_0x180b66){return this[_0x17be('0xe')][_0x17be('0x2b')](_0x439b17,'no\x20queue\x20found');}}var _0x40364d='';if(this[_0x17be('0x88')](_0x439b17[_0x17be('0x10e')])){var _0x7d2347=this['getSound'][_0x17be('0xaa')](this,_0x439b17[_0x17be('0x10e')]);if(_0x7d2347){_0x40364d=_0x7d2347;}}this[_0x17be('0x33')][_0x17be('0xaa')](this,_0x439b17,_0x180b66);if(_0x439b17['opts'][_0x17be('0x16e')]('x')<0x0){_0x439b17[_0x17be('0x16b')]+='x';}if(_0x439b17['opts'][_0x17be('0x16e')]('X')<0x0){_0x439b17[_0x17be('0x16b')]+='X';}this[_0x17be('0xe')][_0x17be('0xa2')](_0x17be('0x16f'),_0x180b66?_0x180b66[_0x17be('0x170')]():'');var _0x70d20a=this[_0x17be('0xe')][_0x17be('0x58')](_0x17be('0x171'),[_0x180b66,_0x439b17[_0x17be('0x16b')],_0x439b17[_0x17be('0x64')],_0x40364d,_0x439b17[_0x17be('0x67')],_0x439b17[_0x17be('0xb9')],_0x439b17[_0x17be('0x172')],_0x439b17[_0x17be('0x173')],'',_0x439b17[_0x17be('0x174')]]);if(_0x70d20a[_0x17be('0xa6')]===-0x1){return _0x70d20a;}return this[_0x17be('0xe')][_0x17be('0xad')](util[_0x17be('0x28')]('Executed\x20command\x20%s\x20%s','QUEUE',_0x180b66));};AGIVertices['prototype'][_0x17be('0x175')]=function(_0x53bd24){logger[_0x17be('0x2c')](util[_0x17be('0x28')](_0x17be('0x176'),_0x53bd24[_0x17be('0x35')]));var _0x381ee2=_0x53bd24['recordingFormat']||_0x17be('0x12a');var _0x3436d3=util[_0x17be('0x28')]('%s_%s',this[_0x17be('0xe')][_0x17be('0x34')],rs[_0x17be('0x116')](0x5));var _0x199acc=util['format']('%s/recordings/%s.%s',FILES_PATH,_0x3436d3,_0x381ee2);var _0x3a2deb=util[_0x17be('0x28')](_0x17be('0x12b'),FILES_PATH,_0x3436d3);this['createSquareRecording'][_0x17be('0xaa')](this,_0x53bd24,_0x3436d3,_0x199acc);this[_0x17be('0xe')][_0x17be('0xa2')](_0x17be('0x177'),_0x3436d3);logger[_0x17be('0x2c')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x3a2deb,_0x381ee2,_0x53bd24[_0x17be('0x178')],_0x53bd24[_0x17be('0x67')]);return this['channel']['recordFile'](_0x3a2deb,_0x381ee2,_0x53bd24['escape_digits'],_0x53bd24[_0x17be('0x67')],undefined,!![]);};AGIVertices[_0x17be('0x10')][_0x17be('0x179')]=function(_0x37c12c){logger['info'](util[_0x17be('0x28')](_0x17be('0x17a'),_0x37c12c[_0x17be('0x35')]));if(!this[_0x17be('0x88')](_0x37c12c['url'])){return this[_0x17be('0xe')][_0x17be('0xad')](_0x17be('0x17b'));}var _0x340420=this[_0x17be('0x63')]['sync'](this,_0x37c12c);logger[_0x17be('0x2c')](util[_0x17be('0x28')](_0x17be('0x17c'),util[_0x17be('0x17d')](_0x340420,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x37c12c[_0x17be('0x10f')])){return this[_0x17be('0xe')]['noop'](_0x17be('0x17e'));}var _0x5e0208=this['getVariable'][_0x17be('0xaa')](this,_0x37c12c[_0x17be('0x10f')]);if(!_0x5e0208){return this[_0x17be('0xe')][_0x17be('0x2b')](_0x37c12c,_0x17be('0xd8'));}this[_0x17be('0xe')][_0x17be('0xa2')](util['format'](_0x17be('0x17f'),_0x5e0208),_0x340420[_0x17be('0x75')]?_0x340420['statusCode']:_0x17be('0x180'));this[_0x17be('0xe')][_0x17be('0xa2')](util[_0x17be('0x28')]('%s_STATUS_MESSAGE',_0x5e0208),_0x340420['statusMessage']?_0x340420['statusMessage']:'OK');if(_0x340420[_0x17be('0x6c')]){try{this['saveRestApiResult'](_0x340420[_0x17be('0x6c')],_0x5e0208);}catch(_0x50c94c){logger['error'](util['format']('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x5e0208));}}return this[_0x17be('0xe')][_0x17be('0xad')](util[_0x17be('0x28')](_0x17be('0x181'),_0x5e0208));};AGIVertices[_0x17be('0x10')][_0x17be('0x182')]=function(_0x1018ed){logger[_0x17be('0x2c')](util[_0x17be('0x28')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x1018ed[_0x17be('0x35')]));return this[_0x17be('0xe')][_0x17be('0x183')](_0x1018ed[_0x17be('0x184')][_0x17be('0x5a')](/\s+/g,''),_0x1018ed[_0x17be('0x178')]);};AGIVertices[_0x17be('0x10')][_0x17be('0x185')]=function(_0x5b577d){logger[_0x17be('0x2c')](util[_0x17be('0x28')](_0x17be('0x186'),_0x5b577d[_0x17be('0x35')]));return this[_0x17be('0xe')]['sayNumber'](_0x5b577d[_0x17be('0x66')][_0x17be('0x5a')](/\s+/g,''),_0x5b577d['escape_digits']);};AGIVertices['prototype'][_0x17be('0x187')]=function(_0x4ffbd8){logger[_0x17be('0x2c')](util[_0x17be('0x28')](_0x17be('0x188'),_0x4ffbd8['label']));return this['channel'][_0x17be('0x189')](_0x4ffbd8[_0x17be('0x5c')],_0x4ffbd8[_0x17be('0x178')]);};AGIVertices['prototype'][_0x17be('0x18a')]=function(_0x542163){logger[_0x17be('0x2c')](util['format'](_0x17be('0x18b'),_0x542163[_0x17be('0x35')]));if(!this[_0x17be('0x88')](_0x542163[_0x17be('0x18c')])){return this['channel'][_0x17be('0xad')]('no\x20mail\x20account\x20configured');}var _0x4b470e=this[_0x17be('0x20')]['sync'](this,_0x542163[_0x17be('0x18c')]);if(!_0x4b470e||!_0x4b470e[_0x17be('0x18d')]){return this[_0x17be('0xe')][_0x17be('0x2b')](_0x542163,_0x17be('0x18e'));}var _0x5ac421={'from':util[_0x17be('0x28')](_0x17be('0x18f'),_0x4b470e[_0x17be('0x1c')],_0x4b470e[_0x17be('0x190')]||_0x4b470e['Smtp'][_0x17be('0x191')]),'to':_0x542163['to']||'','cc':_0x542163['cc']||'','bcc':_0x542163[_0x17be('0x192')]||'','subject':_0x542163['subject'],'html':_0x542163[_0x17be('0x5c')],'text':_0x542163['text']};if(this['isConfigured'](_0x542163[_0x17be('0x193')])){}logger[_0x17be('0x194')](_0x17be('0x195'),JSON[_0x17be('0x73')](_0x5ac421));this['createSquareDetailsReport']['sync'](this,_0x542163,_0x542163[_0x17be('0x18c')]);this[_0x17be('0xe')][_0x17be('0xad')](util[_0x17be('0x28')](_0x17be('0x196'),_0x4b470e[_0x17be('0x1c')]));this[_0x17be('0x22')][_0x17be('0xaa')](this,_0x4b470e[_0x17be('0x197')],_0x5ac421);return this['channel']['noop']('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x17be('0x10')][_0x17be('0x198')]=function(_0x5867dc){logger['info'](util['format'](_0x17be('0x199'),_0x5867dc[_0x17be('0x35')]));return this[_0x17be('0xe')][_0x17be('0xad')](_0x17be('0x19a'));};AGIVertices['prototype']['sendSMS']=function(_0x5086b7){logger['info'](util[_0x17be('0x28')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x5086b7[_0x17be('0x35')]));if(!this[_0x17be('0x88')](_0x5086b7[_0x17be('0x19b')])){return this[_0x17be('0xe')][_0x17be('0xad')]('no\x20sms\x20account\x20configured');}var _0x173c8c=this['getSmsAccount'][_0x17be('0xaa')](this,_0x5086b7[_0x17be('0x19b')]);if(!_0x173c8c){return this[_0x17be('0xe')][_0x17be('0x2b')](_0x5086b7,_0x17be('0x19c'));}var _0x99e327={'body':_0x5086b7['sms_text'],'phone':_0x5086b7['to']||'','SmsAccountId':_0x173c8c['id']};logger[_0x17be('0x194')](_0x17be('0x19d'),JSON['stringify'](_0x99e327));this[_0x17be('0x33')][_0x17be('0xaa')](this,_0x5086b7,_0x5086b7[_0x17be('0x19b')]);this[_0x17be('0xe')][_0x17be('0xad')](util[_0x17be('0x28')](_0x17be('0x19e'),_0x173c8c[_0x17be('0x1c')]));this['createSmsMessage'][_0x17be('0xaa')](this,_0x99e327);return this['channel'][_0x17be('0xad')](_0x17be('0x19f'));};AGIVertices['prototype'][_0x17be('0x1a0')]=function(_0x3e456a){logger[_0x17be('0x2c')](util[_0x17be('0x28')](_0x17be('0x1a1'),_0x3e456a[_0x17be('0x35')]));if(!this[_0x17be('0x88')](_0x3e456a[_0x17be('0x10f')])){return this['channel'][_0x17be('0x2b')](_0x3e456a,_0x17be('0x1a2'));}var _0x5185fd=this[_0x17be('0xa5')][_0x17be('0xaa')](this,_0x3e456a['variable_id']);if(!_0x5185fd){return this[_0x17be('0xe')][_0x17be('0x2b')](_0x3e456a,'no\x20variable\x20found');}return this['channel']['setVariable'](_0x5185fd,_0x3e456a['variable_value']);};AGIVertices[_0x17be('0x10')][_0x17be('0x1a3')]=function(_0x1db55a){logger['info'](util[_0x17be('0x28')](_0x17be('0x1a4'),_0x1db55a[_0x17be('0x35')]));this[_0x17be('0xe')][_0x17be('0xad')](_0x17be('0x1a5'));if(_0x1db55a[_0x17be('0xbc')]===_0x17be('0x1a6')){this[_0x17be('0xe')][_0x17be('0xad')](_0x17be('0x1a7'));return this[_0x17be('0xe')][_0x17be('0xbc')]();}return this[_0x17be('0xe')]['noop']('Skipped\x20Answer');};AGIVertices['prototype'][_0x17be('0x1a8')]=function(_0x50a4e0){logger[_0x17be('0x2c')](util['format']('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x50a4e0[_0x17be('0x35')]));if(!this[_0x17be('0x88')](_0x50a4e0[_0x17be('0x1a9')])){return this[_0x17be('0xe')][_0x17be('0x2b')](_0x50a4e0,_0x17be('0x1aa'));}var _0x33a74a=this[_0x17be('0x1ab')][_0x17be('0xaa')](this,_0x50a4e0[_0x17be('0x1a9')]);if(!this[_0x17be('0x88')](_0x33a74a)){return this[_0x17be('0xe')][_0x17be('0x2b')](_0x50a4e0,util[_0x17be('0x28')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x50a4e0[_0x17be('0x1a9')]));}if(_0x33a74a===this[_0x17be('0xe')][_0x17be('0x3f')]){return this['channel'][_0x17be('0x2b')](_0x50a4e0,_0x17be('0x1ac'));}this['createSquareDetailsReport']['sync'](this,_0x50a4e0,_0x33a74a);var _0x54fccd=this[_0x17be('0xe')][_0x17be('0x58')](_0x17be('0x1ad'),util[_0x17be('0x28')](_0x17be('0x1ae'),config['agi'][_0x17be('0x1af')]||'127.0.0.1',_0x33a74a,this[_0x17be('0xe')][_0x17be('0x3f')]));if(_0x54fccd['result']===-0x1){return _0x54fccd;}return this[_0x17be('0xe')][_0x17be('0xad')](util['format']('Executed\x20command\x20%s\x20%s','AGI',_0x33a74a));};AGIVertices[_0x17be('0x10')][_0x17be('0x1b0')]=function(_0x1c3ed0){logger[_0x17be('0x2c')](util[_0x17be('0x28')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x1c3ed0[_0x17be('0x35')]));var _0x1d7862=this[_0x17be('0x57')][_0x17be('0xaa')](this,_0x1c3ed0[_0x17be('0xba')]);this[_0x17be('0x33')][_0x17be('0xaa')](this,_0x1c3ed0,_0x1c3ed0['command']);if(this[_0x17be('0x88')](_0x1c3ed0[_0x17be('0x10f')])){var _0x31cf60=this['getVariable']['sync'](this,_0x1c3ed0[_0x17be('0x10f')]);if(_0x31cf60){this[_0x17be('0xe')][_0x17be('0xa2')](_0x31cf60,_0x1d7862);return this[_0x17be('0xe')][_0x17be('0xad')](util[_0x17be('0x28')](_0x17be('0x1b1'),_0x1c3ed0['command'],_0x31cf60));}}return this['channel'][_0x17be('0xad')](util['format'](_0x17be('0x1b2'),_0x1c3ed0[_0x17be('0xba')]));};AGIVertices[_0x17be('0x10')][_0x17be('0x1b3')]=function(_0x16d2b0){logger[_0x17be('0x2c')](util[_0x17be('0x28')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x16d2b0[_0x17be('0x35')]));_0x16d2b0[_0x17be('0x5c')]=_0x16d2b0['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x16d2b0['apiKey'])){return this[_0x17be('0xe')][_0x17be('0xad')]('no\x20apiKey\x20configured');}if(!this[_0x17be('0x88')](_0x16d2b0[_0x17be('0x5c')])){return this[_0x17be('0xe')]['noop'](_0x17be('0xc8'));}this[_0x17be('0xe')]['noop'](util[_0x17be('0x28')](_0x17be('0x1b4'),_0x16d2b0[_0x17be('0x5c')]));var _0x146b2e=this[_0x17be('0x5b')]['sync'](this,_0x16d2b0);if(_0x146b2e){this['channel'][_0x17be('0xad')](util[_0x17be('0x28')](_0x17be('0x1b5'),_0x146b2e));var _0x5e2442=this[_0x17be('0xe')][_0x17be('0xfd')](_0x146b2e);try{fs['unlink'](_0x146b2e+_0x17be('0xff'));}catch(_0x46e81b){logger['error'](_0x46e81b);}return _0x5e2442;}return this[_0x17be('0xe')][_0x17be('0x2b')](_0x16d2b0,_0x17be('0x1b6'));};AGIVertices[_0x17be('0x10')][_0x17be('0x1b7')]=function(_0x3cf279){logger['info'](util['format'](_0x17be('0x1b8'),_0x3cf279[_0x17be('0x35')]));_0x3cf279[_0x17be('0x5c')]=_0x3cf279[_0x17be('0x5c')][_0x17be('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x3cf279['text'])){return this[_0x17be('0xe')][_0x17be('0xad')](_0x17be('0xc8'));}this[_0x17be('0xe')][_0x17be('0xad')](util[_0x17be('0x28')](_0x17be('0x1b9'),_0x3cf279[_0x17be('0x5c')]));var _0x3cf6c0=this[_0x17be('0x61')][_0x17be('0xaa')](this,_0x3cf279);if(_0x3cf6c0){this['channel'][_0x17be('0xad')](util[_0x17be('0x28')](_0x17be('0x1ba'),_0x3cf6c0));var _0x3f75f4=this[_0x17be('0xe')]['streamFile'](_0x3cf6c0);try{fs[_0x17be('0xfe')](_0x3cf6c0+_0x17be('0xff'));}catch(_0x1e768d){logger['error'](_0x1e768d);}return _0x3f75f4;}return this['channel'][_0x17be('0x2b')](_0x3cf279,_0x17be('0x1bb'));};AGIVertices['prototype']['unpause']=function(_0x33f261){logger[_0x17be('0x2c')](util[_0x17be('0x28')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x33f261[_0x17be('0x35')]));if(!this[_0x17be('0x88')](_0x33f261['findBy'])){return this[_0x17be('0xe')][_0x17be('0x2b')](_0x33f261,_0x17be('0x150'));}logger[_0x17be('0x2c')](util[_0x17be('0x28')](_0x17be('0x151'),this['channel']['callerid'],_0x33f261[_0x17be('0x14f')]));var _0xab1e35=this[_0x17be('0x52')][_0x17be('0xaa')](this,_0x33f261[_0x17be('0x14f')]);if(_0xab1e35){logger[_0x17be('0x2c')](util[_0x17be('0x28')](_0x17be('0x153'),this[_0x17be('0xe')][_0x17be('0x37')],_0x33f261[_0x17be('0x14f')]));this[_0x17be('0xe')][_0x17be('0xad')](util[_0x17be('0x28')](_0x17be('0x153'),this[_0x17be('0xe')][_0x17be('0x37')],_0x33f261[_0x17be('0x14f')]));return{'code':0xc8,'result':_0x17be('0x154')};}else{logger[_0x17be('0x2c')](util[_0x17be('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x17be('0xe')][_0x17be('0x37')],_0x33f261[_0x17be('0x14f')]));this[_0x17be('0xe')]['noop'](util[_0x17be('0x28')](_0x17be('0x155'),this[_0x17be('0xe')][_0x17be('0x37')],_0x33f261[_0x17be('0x14f')]));return{'code':0xc8,'result':_0x17be('0x156')};}};AGIVertices[_0x17be('0x10')][_0x17be('0x1bc')]=function(_0x542a73){logger[_0x17be('0x2c')](util[_0x17be('0x28')](_0x17be('0x1bd'),_0x542a73['label']));var _0x3f15dc=this['channel'][_0x17be('0x58')]('VOICEMAIL',[_0x542a73[_0x17be('0x1be')],_0x542a73['options']]);if(_0x3f15dc[_0x17be('0xa6')]===-0x1){return _0x3f15dc;}return this[_0x17be('0xe')]['noop'](util['format'](_0x17be('0xc5'),_0x17be('0x1bf'),_0x542a73[_0x17be('0x1be')]));};AGIVertices['prototype'][_0x17be('0x1c0')]=function(_0x57af76){logger[_0x17be('0x2c')](util[_0x17be('0x28')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x57af76[_0x17be('0x35')]));if(!this[_0x17be('0x88')](_0x57af76[_0x17be('0x10f')])){return this['channel']['error'](_0x57af76,_0x17be('0x1a2'));}var _0x1cb823=this[_0x17be('0xa5')]['sync'](this,_0x57af76[_0x17be('0x10f')]);if(!_0x1cb823){return this[_0x17be('0xe')][_0x17be('0x2b')](_0x57af76,_0x17be('0xd8'));}var _0xf62e88=this[_0x17be('0xe')][_0x17be('0xa5')](_0x1cb823);return{'code':0xc8,'result':_0xf62e88[_0x17be('0xa8')]?_0xf62e88[_0x17be('0xa8')]:'-'};};String[_0x17be('0x10')][_0x17be('0xa4')]=function(_0xda9943,_0x41d346){return this[_0x17be('0xa3')](_0xda9943)[_0x17be('0x1c1')](_0x41d346);};module[_0x17be('0x1c2')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 86c6bef..8f93346 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 _0x844c=['seconds','prototype','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','destlinkedid','savePause','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','info','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','startAcw','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','exports','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind','hanguprequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff'];(function(_0x25c0ff,_0x150029){var _0x19ddc6=function(_0x579d9d){while(--_0x579d9d){_0x25c0ff['push'](_0x25c0ff['shift']());}};_0x19ddc6(++_0x150029);}(_0x844c,0x196));var _0xc844=function(_0x1fa381,_0x758c2a){_0x1fa381=_0x1fa381-0x0;var _0x47eefe=_0x844c[_0x1fa381];return _0x47eefe;};'use strict';var _=require('lodash');var moment=require(_0xc844('0x0'));var ami=require('../ami');var logger=require(_0xc844('0x1'))(_0xc844('0x2'));var RpcUser=require(_0xc844('0x3'));var RpcVoiceAgentReport=require(_0xc844('0x4'));function Acw(_0x4eff60){this[_0xc844('0x5')]=_0x4eff60[_0xc844('0x5')];this[_0xc844('0x6')]=_0x4eff60['agents'];this[_0xc844('0x7')]=_0x4eff60[_0xc844('0x7')];this[_0xc844('0x8')]={};ami['on'](_0xc844('0x9'),this['syncAgentConnect'][_0xc844('0xa')](this));ami['on'](_0xc844('0xb'),this['syncHangupRequest'][_0xc844('0xa')](this));ami['on'](_0xc844('0xc'),this['syncHangup'][_0xc844('0xa')](this));ami['on'](_0xc844('0xd'),this[_0xc844('0xe')][_0xc844('0xa')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer']['bind'](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0xc844('0xa')](this));ami['on'](_0xc844('0xf'),this[_0xc844('0x10')][_0xc844('0xa')](this));}function getDiff(_0x5d1db2){var _0x340c7c=moment()[_0xc844('0x11')](0x0);var _0x257c5e=moment(_0x5d1db2)[_0xc844('0x11')](0x0);return _0x340c7c[_0xc844('0x12')](_0x257c5e,_0xc844('0x13'));}Acw[_0xc844('0x14')]['startAcw']=function(_0xeb1ce7){try{var _0x3d8204=this;var _0x14670f=this['channels'][_0xeb1ce7][_0xc844('0x15')];var _0x470387=this[_0xc844('0x8')][_0xeb1ce7][_0xc844('0x16')];var _0x2706d2=this[_0xc844('0x5')][_0x470387];var _0x533975=![];var _0x2ae5cb=_0xc844('0x17');if(_0x2706d2[_0xc844('0x18')]){if(_0x2706d2[_0xc844('0x19')][_0xc844('0x1a')]){_0x533975=!![];_0x2ae5cb=_0x2706d2[_0xc844('0x19')][_0xc844('0x1a')];}}return ami[_0xc844('0x1b')]({'action':_0xc844('0x1c'),'interface':_0x14670f,'paused':!![],'reason':_0x2ae5cb})[_0xc844('0x1d')](function(){if(_0x3d8204[_0xc844('0x6')][_0x14670f]){return RpcUser[_0xc844('0x1e')](_0x3d8204[_0xc844('0x6')][_0x14670f]['id'])[_0xc844('0x1d')](function(_0x5dfb9f){if(_0x5dfb9f&&!_0x5dfb9f[_0xc844('0x1f')]){logger['info']('[%s][START][AGENT:%s][QUEUE:%s]',_0xeb1ce7,_0x14670f,_0x470387);var _0x5a3ff4=_0x3d8204[_0xc844('0x8')][_0xeb1ce7]['attended']&&_0x3d8204[_0xc844('0x8')][_0xeb1ce7][_0xc844('0x20')]?_0x3d8204[_0xc844('0x8')][_0xeb1ce7][_0xc844('0x20')]:_0xeb1ce7;return RpcUser[_0xc844('0x21')](_0x3d8204[_0xc844('0x6')][_0x14670f],_0x2ae5cb,_0x5a3ff4)[_0xc844('0x1d')](function(){if(!_0x533975){_0x3d8204[_0xc844('0x7')][_0x14670f]={};logger['info']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0xeb1ce7,_0x3d8204[_0xc844('0x5')][_0x470387][_0xc844('0x22')],_0x14670f,_0x470387);_0x3d8204[_0xc844('0x7')][_0x14670f][_0xc844('0x23')]=setTimeout(_0x3d8204[_0xc844('0x24')]['bind'](_0x3d8204,_0x14670f),_0x3d8204[_0xc844('0x5')][_0x470387]['acwTimeout']*0x3e8);_0x3d8204[_0xc844('0x7')][_0x14670f][_0xc844('0x25')]=moment()[_0xc844('0x26')](_0xc844('0x27'));_0x3d8204[_0xc844('0x7')][_0x14670f][_0xc844('0x28')]=_0xeb1ce7;_0x3d8204[_0xc844('0x7')][_0x14670f][_0xc844('0x16')]=_0x470387;_0x3d8204[_0xc844('0x7')][_0x14670f][_0xc844('0x29')]=function(){var _0x3eee80=getDiff(_0x3d8204[_0xc844('0x7')][_0x14670f][_0xc844('0x25')]);clearTimeout(_0x3d8204[_0xc844('0x7')][_0x14670f][_0xc844('0x23')]);_0x3d8204[_0xc844('0x7')][_0x14670f][_0xc844('0x23')]=![];RpcVoiceAgentReport[_0xc844('0x2a')]({'acwtime':_0x3eee80},_0x3d8204[_0xc844('0x7')][_0x14670f]['uniqueid'],_0x14670f)[_0xc844('0x1d')](function(_0x137085){logger[_0xc844('0x2b')](_0xc844('0x2c'),_0xeb1ce7,_0x3eee80,_0x137085);})[_0xc844('0x2d')](function(_0x402a6a){logger[_0xc844('0x2e')](_0xc844('0x2f'),_0xeb1ce7,_0x402a6a);});delete _0x3d8204[_0xc844('0x7')][_0x14670f];};}});}else{logger[_0xc844('0x2b')](_0xc844('0x30'),_0xeb1ce7,_0x14670f,_0x470387);}});}})[_0xc844('0x2d')](function(){logger[_0xc844('0x2e')](_0xc844('0x31'),_0xeb1ce7,_0x3d8204[_0xc844('0x5')][_0x470387][_0xc844('0x22')],_0x14670f,_0x470387);})[_0xc844('0x32')](function(){delete _0x3d8204[_0xc844('0x8')][_0xeb1ce7];});}catch(_0x39eb0d){logger['error'](_0xc844('0x33'),_0x39eb0d[_0xc844('0x34')]);}};Acw[_0xc844('0x14')][_0xc844('0x24')]=function(_0x121840){try{var _0x227d2c=this;if(_0x227d2c[_0xc844('0x7')][_0x121840]){_0x227d2c[_0xc844('0x7')][_0x121840][_0xc844('0x23')]=![];var _0x4ffaa9=_0x227d2c[_0xc844('0x7')][_0x121840][_0xc844('0x28')];var _0x5a034a=_0x227d2c[_0xc844('0x7')][_0x121840][_0xc844('0x16')];var _0x152b49=_0x227d2c[_0xc844('0x5')][_0x5a034a][_0xc844('0x22')];logger[_0xc844('0x2b')]('[%s][TIMER][STOP][AGENT:%s]',_0x4ffaa9,_0x121840);RpcUser['saveUnpause'](this[_0xc844('0x6')][_0x121840]);RpcVoiceAgentReport[_0xc844('0x2a')]({'acwtime':_0x152b49,'agentacw':!![]},_0x4ffaa9,_0x121840)['then'](function(_0xa3ebca){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x4ffaa9,_0x152b49,_0xa3ebca);})[_0xc844('0x2d')](function(_0x1d4d14){logger[_0xc844('0x2e')](_0xc844('0x2f'),_0x4ffaa9,_0x1d4d14);});}else{logger[_0xc844('0x2e')](_0xc844('0x35'),_0x121840);if(_0x227d2c[_0xc844('0x7')]){logger['info'](_0xc844('0x36'),JSON[_0xc844('0x37')](_0x227d2c[_0xc844('0x7')]));}}}catch(_0x4c4091){logger[_0xc844('0x2e')](_0xc844('0x38'),_0x4c4091['message']);}};Acw[_0xc844('0x14')][_0xc844('0x39')]=function(_0x20a530){try{if(this[_0xc844('0x5')][_0x20a530[_0xc844('0x16')]]&&(this[_0xc844('0x5')][_0x20a530[_0xc844('0x16')]][_0xc844('0x2')]||this[_0xc844('0x5')][_0x20a530[_0xc844('0x16')]][_0xc844('0x18')])){if(this[_0xc844('0x6')][_0x20a530[_0xc844('0x15')]]){this[_0xc844('0x8')][_0x20a530[_0xc844('0x28')]]={'queue':_0x20a530[_0xc844('0x16')],'interface':_0x20a530[_0xc844('0x15')],'destlinkedid':_0x20a530[_0xc844('0x20')]};}}}catch(_0x1969a8){logger[_0xc844('0x2e')](_0xc844('0x3a'),_0x1969a8[_0xc844('0x34')]);}};Acw[_0xc844('0x14')][_0xc844('0x10')]=function(_0x4f4c2a){try{if(this[_0xc844('0x5')][_0x4f4c2a[_0xc844('0x16')]]&&(this['voiceQueues'][_0x4f4c2a['queue']][_0xc844('0x2')]||this[_0xc844('0x5')][_0x4f4c2a[_0xc844('0x16')]]['mandatoryDisposition'])){if(this[_0xc844('0x6')][_0x4f4c2a['interface']]){this['channels'][_0x4f4c2a[_0xc844('0x28')]]={'queue':_0x4f4c2a['queue'],'interface':_0x4f4c2a['interface']};}}}catch(_0x2e4728){logger[_0xc844('0x2e')]('[ACW][syncAgentConnectPreview]\x20%s',_0x2e4728[_0xc844('0x34')]);}};Acw['prototype']['syncHangupRequest']=function(_0x2e6dd4){try{if(this[_0xc844('0x8')][_0x2e6dd4[_0xc844('0x28')]]&&_[_0xc844('0x3b')](this['channels'][_0x2e6dd4[_0xc844('0x28')]][_0xc844('0x3c')])){logger['info'](_0xc844('0x3d'),_0x2e6dd4[_0xc844('0x28')]);this['startAcw'](_0x2e6dd4[_0xc844('0x28')]);}else if(this[_0xc844('0x8')][_0x2e6dd4[_0xc844('0x3e')]]&&_[_0xc844('0x3b')](this[_0xc844('0x8')][_0x2e6dd4[_0xc844('0x3e')]][_0xc844('0x3c')])){logger[_0xc844('0x2b')](_0xc844('0x3f'),_0x2e6dd4[_0xc844('0x3e')]);this[_0xc844('0x40')](_0x2e6dd4['linkedid']);}}catch(_0x27913e){logger[_0xc844('0x2e')](_0xc844('0x41'),_0x27913e['message']);}};Acw[_0xc844('0x14')]['syncHangup']=function(_0x547d6d){try{if(this[_0xc844('0x8')][_0x547d6d[_0xc844('0x28')]]&&this[_0xc844('0x8')][_0x547d6d[_0xc844('0x28')]][_0xc844('0x3c')]){logger[_0xc844('0x2b')](_0xc844('0x42'),_0x547d6d[_0xc844('0x28')]);this['startAcw'](_0x547d6d[_0xc844('0x28')]);}else if(this['channels'][_0x547d6d[_0xc844('0x3e')]]&&this[_0xc844('0x8')][_0x547d6d[_0xc844('0x3e')]]['attended']){logger[_0xc844('0x2b')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x547d6d['linkedid']);this[_0xc844('0x40')](_0x547d6d[_0xc844('0x3e')]);}}catch(_0x27131d){logger[_0xc844('0x2e')]('[ACW][syncHangup]\x20%s',_0x27131d['message']);}};Acw[_0xc844('0x14')][_0xc844('0x43')]=function(_0x2cecb7){try{if(!_[_0xc844('0x44')](this[_0xc844('0x8')][_0x2cecb7[_0xc844('0x45')]])){this[_0xc844('0x40')](_0x2cecb7[_0xc844('0x45')]);if(this['channels'][_0x2cecb7[_0xc844('0x46')]]){this['channels'][_0x2cecb7[_0xc844('0x46')]][_0xc844('0x3c')]=!![];this[_0xc844('0x8')][_0x2cecb7['transfertargetuniqueid']]=this[_0xc844('0x8')][_0x2cecb7[_0xc844('0x46')]];delete this['channels'][_0x2cecb7[_0xc844('0x46')]];}}else if(!_['isNil'](this[_0xc844('0x8')][_0x2cecb7[_0xc844('0x47')]])){this[_0xc844('0x40')](_0x2cecb7[_0xc844('0x47')]);if(this['channels'][_0x2cecb7[_0xc844('0x48')]]){this[_0xc844('0x8')][_0x2cecb7[_0xc844('0x48')]][_0xc844('0x3c')]=!![];this[_0xc844('0x8')][_0x2cecb7[_0xc844('0x45')]]=this[_0xc844('0x8')][_0x2cecb7[_0xc844('0x48')]];delete this['channels'][_0x2cecb7[_0xc844('0x48')]];}}}catch(_0x17e813){logger[_0xc844('0x2e')](_0xc844('0x49'),_0x17e813[_0xc844('0x34')]);}};Acw[_0xc844('0x14')][_0xc844('0x4a')]=function(_0x9cc492){try{if(this[_0xc844('0x8')][_0x9cc492['transfereruniqueid']]){logger['info'](_0xc844('0x4b'),JSON[_0xc844('0x37')](_0x9cc492[_0xc844('0x4c')]));this['startAcw'](_0x9cc492['transfereruniqueid']);}else if(this['channels'][_0x9cc492[_0xc844('0x4d')]]){logger[_0xc844('0x2b')](_0xc844('0x4e'),JSON[_0xc844('0x37')](_0x9cc492[_0xc844('0x4d')]));this['startAcw'](_0x9cc492[_0xc844('0x4d')]);}}catch(_0x41693a){logger[_0xc844('0x2e')](_0xc844('0x4f'),_0x41693a[_0xc844('0x34')]);}};Acw[_0xc844('0x14')][_0xc844('0xe')]=function(_0x4ddaf1){try{if(this['voiceQueues'][_0x4ddaf1[_0xc844('0x16')]]&&this[_0xc844('0x5')][_0x4ddaf1[_0xc844('0x16')]][_0xc844('0x50')]===_0xc844('0x51')){if(this[_0xc844('0x6')][_0x4ddaf1[_0xc844('0x15')]]){logger[_0xc844('0x2b')](_0xc844('0x52'),_0x4ddaf1[_0xc844('0x28')],_0x4ddaf1[_0xc844('0x15')],_0x4ddaf1[_0xc844('0x16')]);return RpcUser[_0xc844('0x21')](this[_0xc844('0x6')][_0x4ddaf1[_0xc844('0x15')]],_0xc844('0x53'),_0x4ddaf1[_0xc844('0x28')]);}}}catch(_0x470cf8){logger[_0xc844('0x2e')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x470cf8[_0xc844('0x34')]);}};module[_0xc844('0x54')]=Acw; \ No newline at end of file +var _0x4dfa=['[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','moment','../ami','../../../config/logger','../rpc/user','voiceQueues','agents','timers','channels','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype','startAcw','interface','queue','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','voicePause','info','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','timer','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','stopAcw','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','message','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','all'];(function(_0x386f57,_0x2c701e){var _0x2caad1=function(_0x43da8f){while(--_0x43da8f){_0x386f57['push'](_0x386f57['shift']());}};_0x2caad1(++_0x2c701e);}(_0x4dfa,0x14a));var _0xa4df=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4dfa[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var moment=require(_0xa4df('0x0'));var ami=require(_0xa4df('0x1'));var logger=require(_0xa4df('0x2'))('acw');var RpcUser=require(_0xa4df('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x1c6ff3){this[_0xa4df('0x4')]=_0x1c6ff3[_0xa4df('0x4')];this[_0xa4df('0x5')]=_0x1c6ff3['agents'];this['timers']=_0x1c6ff3[_0xa4df('0x6')];this[_0xa4df('0x7')]={};ami['on']('agentconnect',this[_0xa4df('0x8')][_0xa4df('0x9')](this));ami['on'](_0xa4df('0xa'),this[_0xa4df('0xb')][_0xa4df('0x9')](this));ami['on'](_0xa4df('0xc'),this[_0xa4df('0xd')][_0xa4df('0x9')](this));ami['on'](_0xa4df('0xe'),this['syncAgentRingNoAnswer'][_0xa4df('0x9')](this));ami['on'](_0xa4df('0xf'),this['syncAttendedTransfer'][_0xa4df('0x9')](this));ami['on'](_0xa4df('0x10'),this[_0xa4df('0x11')][_0xa4df('0x9')](this));ami['on'](_0xa4df('0x12'),this[_0xa4df('0x13')]['bind'](this));}function getDiff(_0x11643b){var _0x1b76bb=moment()['milliseconds'](0x0);var _0x1168c4=moment(_0x11643b)[_0xa4df('0x14')](0x0);return _0x1b76bb['diff'](_0x1168c4,_0xa4df('0x15'));}Acw[_0xa4df('0x16')][_0xa4df('0x17')]=function(_0x2a0397){try{var _0x34d0df=this;var _0x5738c3=this[_0xa4df('0x7')][_0x2a0397][_0xa4df('0x18')];var _0x503b56=this[_0xa4df('0x7')][_0x2a0397][_0xa4df('0x19')];var _0x380649=this[_0xa4df('0x4')][_0x503b56];var _0x31a63b=![];var _0x547c71='ACW';if(_0x380649[_0xa4df('0x1a')]){if(_0x380649[_0xa4df('0x1b')][_0xa4df('0x1c')]){_0x31a63b=!![];_0x547c71=_0x380649[_0xa4df('0x1b')]['name'];}}return ami['Action']({'action':_0xa4df('0x1d'),'interface':_0x5738c3,'paused':!![],'reason':_0x547c71})[_0xa4df('0x1e')](function(){if(_0x34d0df[_0xa4df('0x5')][_0x5738c3]){return RpcUser['getAgent'](_0x34d0df['agents'][_0x5738c3]['id'])[_0xa4df('0x1e')](function(_0x480daa){if(_0x480daa&&!_0x480daa[_0xa4df('0x1f')]){logger[_0xa4df('0x20')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x2a0397,_0x5738c3,_0x503b56);var _0x491caa=_0x34d0df['channels'][_0x2a0397][_0xa4df('0x21')]&&_0x34d0df[_0xa4df('0x7')][_0x2a0397][_0xa4df('0x22')]?_0x34d0df[_0xa4df('0x7')][_0x2a0397]['destlinkedid']:_0x2a0397;return RpcUser['savePause'](_0x34d0df[_0xa4df('0x5')][_0x5738c3],_0x547c71,_0x491caa)['then'](function(){if(!_0x31a63b){_0x34d0df['timers'][_0x5738c3]={};logger[_0xa4df('0x20')](_0xa4df('0x23'),_0x2a0397,_0x34d0df[_0xa4df('0x4')][_0x503b56][_0xa4df('0x24')],_0x5738c3,_0x503b56);_0x34d0df[_0xa4df('0x6')][_0x5738c3]['timer']=setTimeout(_0x34d0df['stopAcw'][_0xa4df('0x9')](_0x34d0df,_0x5738c3),_0x34d0df[_0xa4df('0x4')][_0x503b56]['acwTimeout']*0x3e8);_0x34d0df[_0xa4df('0x6')][_0x5738c3][_0xa4df('0x25')]=moment()[_0xa4df('0x26')](_0xa4df('0x27'));_0x34d0df['timers'][_0x5738c3][_0xa4df('0x28')]=_0x2a0397;_0x34d0df[_0xa4df('0x6')][_0x5738c3][_0xa4df('0x19')]=_0x503b56;_0x34d0df[_0xa4df('0x6')][_0x5738c3]['updateAcw']=function(){var _0x2149f8=getDiff(_0x34d0df[_0xa4df('0x6')][_0x5738c3][_0xa4df('0x25')]);clearTimeout(_0x34d0df[_0xa4df('0x6')][_0x5738c3][_0xa4df('0x29')]);_0x34d0df[_0xa4df('0x6')][_0x5738c3]['timer']=![];RpcVoiceAgentReport[_0xa4df('0x2a')]({'acwtime':_0x2149f8},_0x34d0df[_0xa4df('0x6')][_0x5738c3][_0xa4df('0x28')],_0x5738c3)[_0xa4df('0x1e')](function(_0x5c54d5){logger['info'](_0xa4df('0x2b'),_0x2a0397,_0x2149f8,_0x5c54d5);})[_0xa4df('0x2c')](function(_0x464fb1){logger[_0xa4df('0x2d')]('[%s][UPDATE][ERRORS:%s]',_0x2a0397,_0x464fb1);});delete _0x34d0df['timers'][_0x5738c3];};}});}else{logger[_0xa4df('0x20')](_0xa4df('0x2e'),_0x2a0397,_0x5738c3,_0x503b56);}});}})[_0xa4df('0x2c')](function(){logger[_0xa4df('0x2d')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x2a0397,_0x34d0df[_0xa4df('0x4')][_0x503b56][_0xa4df('0x24')],_0x5738c3,_0x503b56);})[_0xa4df('0x2f')](function(){delete _0x34d0df['channels'][_0x2a0397];});}catch(_0x46f42a){logger['error']('[ACW][START]\x20%s',_0x46f42a['message']);}};Acw['prototype'][_0xa4df('0x30')]=function(_0x4040c9){try{var _0x192659=this;if(_0x192659[_0xa4df('0x6')][_0x4040c9]){_0x192659[_0xa4df('0x6')][_0x4040c9]['timer']=![];var _0x120ef7=_0x192659[_0xa4df('0x6')][_0x4040c9][_0xa4df('0x28')];var _0x2906b1=_0x192659[_0xa4df('0x6')][_0x4040c9][_0xa4df('0x19')];var _0x98a070=_0x192659[_0xa4df('0x4')][_0x2906b1]['acwTimeout'];logger[_0xa4df('0x20')](_0xa4df('0x31'),_0x120ef7,_0x4040c9);RpcUser[_0xa4df('0x32')](this[_0xa4df('0x5')][_0x4040c9]);RpcVoiceAgentReport[_0xa4df('0x2a')]({'acwtime':_0x98a070,'agentacw':!![]},_0x120ef7,_0x4040c9)['then'](function(_0x1d67bd){logger[_0xa4df('0x20')](_0xa4df('0x2b'),_0x120ef7,_0x98a070,_0x1d67bd);})[_0xa4df('0x2c')](function(_0x552d55){logger[_0xa4df('0x2d')](_0xa4df('0x33'),_0x120ef7,_0x552d55);});}else{logger[_0xa4df('0x2d')](_0xa4df('0x34'),_0x4040c9);if(_0x192659[_0xa4df('0x6')]){logger['info'](_0xa4df('0x35'),JSON['stringify'](_0x192659[_0xa4df('0x6')]));}}}catch(_0x9ffed0){logger[_0xa4df('0x2d')]('[ACW][STOP]\x20%s',_0x9ffed0[_0xa4df('0x36')]);}};Acw[_0xa4df('0x16')][_0xa4df('0x8')]=function(_0x5e3aea){try{if(this[_0xa4df('0x4')][_0x5e3aea[_0xa4df('0x19')]]&&(this[_0xa4df('0x4')][_0x5e3aea[_0xa4df('0x19')]]['acw']||this['voiceQueues'][_0x5e3aea[_0xa4df('0x19')]][_0xa4df('0x1a')])){if(this[_0xa4df('0x5')][_0x5e3aea[_0xa4df('0x18')]]){this[_0xa4df('0x7')][_0x5e3aea[_0xa4df('0x28')]]={'queue':_0x5e3aea[_0xa4df('0x19')],'interface':_0x5e3aea[_0xa4df('0x18')],'destlinkedid':_0x5e3aea[_0xa4df('0x22')]};}}}catch(_0xf13450){logger[_0xa4df('0x2d')](_0xa4df('0x37'),_0xf13450[_0xa4df('0x36')]);}};Acw[_0xa4df('0x16')][_0xa4df('0x13')]=function(_0x3d8b95){try{if(this[_0xa4df('0x4')][_0x3d8b95['queue']]&&(this[_0xa4df('0x4')][_0x3d8b95[_0xa4df('0x19')]]['acw']||this[_0xa4df('0x4')][_0x3d8b95[_0xa4df('0x19')]][_0xa4df('0x1a')])){if(this['agents'][_0x3d8b95['interface']]){this[_0xa4df('0x7')][_0x3d8b95['uniqueid']]={'queue':_0x3d8b95[_0xa4df('0x19')],'interface':_0x3d8b95['interface']};}}}catch(_0x56e656){logger[_0xa4df('0x2d')](_0xa4df('0x38'),_0x56e656[_0xa4df('0x36')]);}};Acw[_0xa4df('0x16')]['syncHangupRequest']=function(_0x4c7544){try{if(this[_0xa4df('0x7')][_0x4c7544[_0xa4df('0x28')]]&&_[_0xa4df('0x39')](this['channels'][_0x4c7544[_0xa4df('0x28')]][_0xa4df('0x21')])){logger[_0xa4df('0x20')](_0xa4df('0x3a'),_0x4c7544[_0xa4df('0x28')]);this['startAcw'](_0x4c7544[_0xa4df('0x28')]);}else if(this[_0xa4df('0x7')][_0x4c7544[_0xa4df('0x3b')]]&&_[_0xa4df('0x39')](this['channels'][_0x4c7544['linkedid']][_0xa4df('0x21')])){logger[_0xa4df('0x20')](_0xa4df('0x3c'),_0x4c7544[_0xa4df('0x3b')]);this[_0xa4df('0x17')](_0x4c7544[_0xa4df('0x3b')]);}}catch(_0x2af781){logger[_0xa4df('0x2d')](_0xa4df('0x3d'),_0x2af781[_0xa4df('0x36')]);}};Acw[_0xa4df('0x16')][_0xa4df('0xd')]=function(_0x4a525c){try{if(this[_0xa4df('0x7')][_0x4a525c['uniqueid']]&&this[_0xa4df('0x7')][_0x4a525c[_0xa4df('0x28')]][_0xa4df('0x21')]){logger[_0xa4df('0x20')](_0xa4df('0x3e'),_0x4a525c[_0xa4df('0x28')]);this[_0xa4df('0x17')](_0x4a525c['uniqueid']);}else if(this[_0xa4df('0x7')][_0x4a525c['linkedid']]&&this[_0xa4df('0x7')][_0x4a525c['linkedid']]['attended']){logger[_0xa4df('0x20')](_0xa4df('0x3f'),_0x4a525c[_0xa4df('0x3b')]);this[_0xa4df('0x17')](_0x4a525c[_0xa4df('0x3b')]);}}catch(_0x202fc){logger[_0xa4df('0x2d')](_0xa4df('0x40'),_0x202fc[_0xa4df('0x36')]);}};Acw[_0xa4df('0x16')]['syncAttendedTransfer']=function(_0x57972e){try{if(!_[_0xa4df('0x41')](this['channels'][_0x57972e[_0xa4df('0x42')]])){this[_0xa4df('0x17')](_0x57972e['transfereeuniqueid']);if(this[_0xa4df('0x7')][_0x57972e[_0xa4df('0x43')]]){this[_0xa4df('0x7')][_0x57972e['secondtransfereruniqueid']]['attended']=!![];this[_0xa4df('0x7')][_0x57972e['transfertargetuniqueid']]=this['channels'][_0x57972e[_0xa4df('0x43')]];delete this[_0xa4df('0x7')][_0x57972e[_0xa4df('0x43')]];}}else if(!_[_0xa4df('0x41')](this[_0xa4df('0x7')][_0x57972e[_0xa4df('0x44')]])){this[_0xa4df('0x17')](_0x57972e[_0xa4df('0x44')]);if(this[_0xa4df('0x7')][_0x57972e[_0xa4df('0x45')]]){this[_0xa4df('0x7')][_0x57972e['origtransfereruniqueid']][_0xa4df('0x21')]=!![];this[_0xa4df('0x7')][_0x57972e[_0xa4df('0x42')]]=this['channels'][_0x57972e[_0xa4df('0x45')]];delete this[_0xa4df('0x7')][_0x57972e['origtransfereruniqueid']];}}}catch(_0x2fcb27){logger[_0xa4df('0x2d')](_0xa4df('0x46'),_0x2fcb27['message']);}};Acw[_0xa4df('0x16')][_0xa4df('0x11')]=function(_0x932410){try{if(this['channels'][_0x932410[_0xa4df('0x47')]]){logger[_0xa4df('0x20')](_0xa4df('0x48'),JSON[_0xa4df('0x49')](_0x932410['transfereruniqueid']));this[_0xa4df('0x17')](_0x932410['transfereruniqueid']);}else if(this[_0xa4df('0x7')][_0x932410[_0xa4df('0x4a')]]){logger[_0xa4df('0x20')](_0xa4df('0x4b'),JSON[_0xa4df('0x49')](_0x932410[_0xa4df('0x4a')]));this[_0xa4df('0x17')](_0x932410['transfererlinkedid']);}}catch(_0x138926){logger[_0xa4df('0x2d')](_0xa4df('0x4c'),_0x138926[_0xa4df('0x36')]);}};Acw['prototype'][_0xa4df('0x4d')]=function(_0x24cd3a){try{if(this[_0xa4df('0x4')][_0x24cd3a[_0xa4df('0x19')]]&&this[_0xa4df('0x4')][_0x24cd3a[_0xa4df('0x19')]][_0xa4df('0x4e')]===_0xa4df('0x4f')){if(this[_0xa4df('0x5')][_0x24cd3a[_0xa4df('0x18')]]){logger['info'](_0xa4df('0x50'),_0x24cd3a[_0xa4df('0x28')],_0x24cd3a[_0xa4df('0x18')],_0x24cd3a['queue']);return RpcUser['savePause'](this['agents'][_0x24cd3a['interface']],'Auto-Pause',_0x24cd3a[_0xa4df('0x28')]);}}}catch(_0x42310f){logger['error'](_0xa4df('0x51'),_0x42310f['message']);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 8bc1830..5802ea3 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 _0xb0f2=['actionDeviceStateList','sippeerstatus','queuesummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','resolve','then','actionQueueSummary','actionCoreShowChannels','catch','[ami.js][fullybooted]','inspect','exports','bluebird','ami','../../config/environment','asterisk','port','username','password','keepConnected','Action','promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb0f2,0x12b));var _0x2b0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb0f2[_0x3dd15e];return _0x231fd0;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x2b0f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2b0f('0x1'));var config=require(_0x2b0f('0x2'));var ami=new Manager(config[_0x2b0f('0x3')][_0x2b0f('0x4')],config[_0x2b0f('0x3')]['ip'],config[_0x2b0f('0x3')][_0x2b0f('0x5')],config['asterisk'][_0x2b0f('0x6')],!![]);ami[_0x2b0f('0x7')]();ami[_0x2b0f('0x8')]=BPromise[_0x2b0f('0x9')](ami['action']);function error(_0x45e8ad){logger[_0x2b0f('0xa')](util[_0x2b0f('0xb')](_0x2b0f('0xc'),config[_0x2b0f('0x3')][_0x2b0f('0x5')],config['asterisk']['ip'],config['asterisk'][_0x2b0f('0x4')],util['inspect'](_0x45e8ad,![],null)));}function close(){logger[_0x2b0f('0xa')](util['format'](_0x2b0f('0xd'),config[_0x2b0f('0x3')][_0x2b0f('0x5')],config[_0x2b0f('0x3')]['ip'],config[_0x2b0f('0x3')][_0x2b0f('0x4')]));}ami[_0x2b0f('0xe')]=function(){return function(){return ami[_0x2b0f('0x8')]({'action':_0x2b0f('0xf')});};};ami[_0x2b0f('0x10')]=function(){return function(){return ami[_0x2b0f('0x8')]({'action':'devicestatelist'});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0x2b0f('0x8')]({'action':_0x2b0f('0x11')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x2b0f('0x8')]({'action':_0x2b0f('0x12')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x2b0f('0x8')]({'action':_0x2b0f('0x13')});};};function connect(){logger[_0x2b0f('0x14')](util[_0x2b0f('0xb')](_0x2b0f('0x15'),config[_0x2b0f('0x3')][_0x2b0f('0x5')],config[_0x2b0f('0x3')]['ip'],config[_0x2b0f('0x3')][_0x2b0f('0x4')]));ami[_0x2b0f('0x16')](_0x2b0f('0xa'),error);ami[_0x2b0f('0x16')](_0x2b0f('0x17'),close);}ami['on']('connect',connect);ami['on'](_0x2b0f('0x18'),function(_0xaec23b){logger[_0x2b0f('0x14')](util['format'](_0x2b0f('0x19'),config[_0x2b0f('0x3')][_0x2b0f('0x5')],config['asterisk']['ip'],config[_0x2b0f('0x3')][_0x2b0f('0x4')],util['inspect'](_0xaec23b,![],null)));});ami['on'](_0x2b0f('0x1a'),function(){logger[_0x2b0f('0x14')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x2b0f('0x3')][_0x2b0f('0x5')],config['asterisk']['ip'],config[_0x2b0f('0x3')][_0x2b0f('0x4')]));return Promise[_0x2b0f('0x1b')]()[_0x2b0f('0x1c')](ami['actionSipShowRegistry']())[_0x2b0f('0x1c')](ami[_0x2b0f('0x10')]())[_0x2b0f('0x1c')](ami['actionSipPeerStatus']())[_0x2b0f('0x1c')](ami[_0x2b0f('0x1d')]())[_0x2b0f('0x1c')](ami[_0x2b0f('0x1e')]())[_0x2b0f('0x1f')](function(_0x22d99f){logger['error'](_0x2b0f('0x20'),util[_0x2b0f('0x21')](_0x22d99f,{'showHidden':![],'depth':null}));});});ami['once'](_0x2b0f('0xa'),error);ami[_0x2b0f('0x16')]('close',close);module[_0x2b0f('0x22')]=ami; \ No newline at end of file +var _0x4904=['util','../../config/logger','ami','../../config/environment','asterisk','port','password','keepConnected','Action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','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','resolve','then','actionDeviceStateList','catch','[ami.js][fullybooted]','close','exports','bluebird'];(function(_0x1575ca,_0x13d9bb){var _0x204fa0=function(_0x3b2913){while(--_0x3b2913){_0x1575ca['push'](_0x1575ca['shift']());}};_0x204fa0(++_0x13d9bb);}(_0x4904,0x127));var _0x4490=function(_0xceeb5,_0x49d308){_0xceeb5=_0xceeb5-0x0;var _0x4b9a4a=_0x4904[_0xceeb5];return _0x4b9a4a;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x4490('0x0'));var util=require(_0x4490('0x1'));var logger=require(_0x4490('0x2'))(_0x4490('0x3'));var config=require(_0x4490('0x4'));var ami=new Manager(config[_0x4490('0x5')][_0x4490('0x6')],config[_0x4490('0x5')]['ip'],config[_0x4490('0x5')]['username'],config['asterisk'][_0x4490('0x7')],!![]);ami[_0x4490('0x8')]();ami[_0x4490('0x9')]=BPromise['promisify'](ami['action']);function error(_0x63cf64){logger[_0x4490('0xa')](util['format'](_0x4490('0xb'),config['asterisk'][_0x4490('0xc')],config[_0x4490('0x5')]['ip'],config[_0x4490('0x5')][_0x4490('0x6')],util[_0x4490('0xd')](_0x63cf64,![],null)));}function close(){logger[_0x4490('0xa')](util[_0x4490('0xe')](_0x4490('0xf'),config[_0x4490('0x5')]['username'],config[_0x4490('0x5')]['ip'],config['asterisk'][_0x4490('0x6')]));}ami[_0x4490('0x10')]=function(){return function(){return ami[_0x4490('0x9')]({'action':_0x4490('0x11')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x4490('0x9')]({'action':'devicestatelist'});};};ami[_0x4490('0x12')]=function(){return function(){return ami[_0x4490('0x9')]({'action':_0x4490('0x13')});};};ami[_0x4490('0x14')]=function(){return function(){return ami['Action']({'action':_0x4490('0x15')});};};ami[_0x4490('0x16')]=function(){return function(){return ami['Action']({'action':_0x4490('0x17')});};};function connect(){logger[_0x4490('0x18')](util[_0x4490('0xe')](_0x4490('0x19'),config[_0x4490('0x5')][_0x4490('0xc')],config['asterisk']['ip'],config[_0x4490('0x5')][_0x4490('0x6')]));ami[_0x4490('0x1a')](_0x4490('0xa'),error);ami['once']('close',close);}ami['on'](_0x4490('0x1b'),connect);ami['on']('shutdown',function(_0x401d6a){logger[_0x4490('0x18')](util[_0x4490('0xe')](_0x4490('0x1c'),config[_0x4490('0x5')][_0x4490('0xc')],config[_0x4490('0x5')]['ip'],config[_0x4490('0x5')][_0x4490('0x6')],util['inspect'](_0x401d6a,![],null)));});ami['on'](_0x4490('0x1d'),function(){logger[_0x4490('0x18')](util[_0x4490('0xe')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x4490('0x5')][_0x4490('0xc')],config[_0x4490('0x5')]['ip'],config[_0x4490('0x5')][_0x4490('0x6')]));return Promise[_0x4490('0x1e')]()[_0x4490('0x1f')](ami[_0x4490('0x10')]())[_0x4490('0x1f')](ami[_0x4490('0x20')]())[_0x4490('0x1f')](ami['actionSipPeerStatus']())[_0x4490('0x1f')](ami[_0x4490('0x14')]())[_0x4490('0x1f')](ami['actionCoreShowChannels']())[_0x4490('0x21')](function(_0x258ee4){logger['error'](_0x4490('0x22'),util[_0x4490('0xd')](_0x258ee4,{'showHidden':![],'depth':null}));});});ami[_0x4490('0x1a')]('error',error);ami[_0x4490('0x1a')](_0x4490('0x23'),close);module[_0x4490('0x24')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 1af0619..74ef22a 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 _0xcb91=['request','debug','memberReport','error','rpc','message','result','catch','exports','../../config/logger','ami','client','http'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4d8a8f,_0x2afd4c){_0x4d8a8f=_0x4d8a8f-0x0;var _0xfc4adc=_0xcb91[_0x4d8a8f];return _0xfc4adc;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var client=jayson[_0x1cb9('0x2')][_0x1cb9('0x3')]({'port':0x2329});client['Request']=function(_0x8c392f,_0x2c17b8){return new BPromise(function(_0x545a34,_0x13d5fd){return client[_0x1cb9('0x4')](_0x8c392f,_0x2c17b8)['then'](function(_0x226b69){logger[_0x1cb9('0x5')]('rpc',_0x1cb9('0x6'),_0x8c392f,_0x2c17b8,_0x226b69);if(_0x226b69[_0x1cb9('0x7')]){logger['error'](_0x1cb9('0x8'),'memberReport',_0x8c392f,_0x226b69['error'][_0x1cb9('0x9')],_0x2c17b8);return _0x13d5fd(_0x226b69[_0x1cb9('0x7')][_0x1cb9('0x9')]);}else{return _0x545a34(_0x226b69[_0x1cb9('0xa')]);}})[_0x1cb9('0xb')](function(_0x50ce71){logger[_0x1cb9('0x7')](_0x1cb9('0x8'),_0x1cb9('0x6'),_0x8c392f,_0x50ce71,_0x2c17b8);return _0x13d5fd(_0x50ce71);});});};module[_0x1cb9('0xc')]=client; \ No newline at end of file +var _0xaa88=['bluebird','../../config/logger','ami','http','Request','rpc','memberReport','error','message','result','catch','jayson/promise'];(function(_0x5af9cc,_0x22794d){var _0x879561=function(_0x2dce36){while(--_0x2dce36){_0x5af9cc['push'](_0x5af9cc['shift']());}};_0x879561(++_0x22794d);}(_0xaa88,0x137));var _0x8aa8=function(_0x1dfa63,_0x362bd4){_0x1dfa63=_0x1dfa63-0x0;var _0x26f2a9=_0xaa88[_0x1dfa63];return _0x26f2a9;};'use strict';var jayson=require(_0x8aa8('0x0'));var BPromise=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var client=jayson['client'][_0x8aa8('0x4')]({'port':0x2329});client[_0x8aa8('0x5')]=function(_0x43f7e4,_0x3b2c88){return new BPromise(function(_0x3e3b70,_0x350e8b){return client['request'](_0x43f7e4,_0x3b2c88)['then'](function(_0x460042){logger['debug'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x3b2c88,_0x460042);if(_0x460042[_0x8aa8('0x8')]){logger[_0x8aa8('0x8')]('rpc',_0x8aa8('0x7'),_0x43f7e4,_0x460042[_0x8aa8('0x8')][_0x8aa8('0x9')],_0x3b2c88);return _0x350e8b(_0x460042['error'][_0x8aa8('0x9')]);}else{return _0x3e3b70(_0x460042[_0x8aa8('0xa')]);}})[_0x8aa8('0xb')](function(_0x33cc5c){logger['error'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x33cc5c,_0x3b2c88);return _0x350e8b(_0x33cc5c);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 9da219a..0f9728e 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 _0x5f81=['[getContactDialer2][Empty]','state','statedesc','endtime','queueStatusComplete','[unlockQueueStatus][undefined]','stringify','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','SIP/%s','status','unmonitored','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','checkIfTime','ifTimeIvr','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','push','command','iftime\x20%s,%s','interval','content','indexOf','catch','Action','true','all','some','OVERTIME_GLOBAL_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','isIVRCampaignActive','resolve','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','[syncCampaigns]','checkDialMethod','dialMethod','predictive','progressive','handlePower','power','dialPowerLevel','Queue','silly','Dialer::ifTime()','intervalIftime','OVERTIME_INTERVAL','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','AMI\x20IfTime','queue','uniqueid','type','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','ivr','outboundAnswerCallsDay','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','[syncAgentComplete]','droptime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','countdropretry','countglobal','verifyAdditionalPhones','additional','queueCallerAbandonCreateState','rescheduleContact','add','dialDropRetryFrequency','minutes','ContactId','VoiceQueueId','CampaignId','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','callAdditionalPhoneAfterMin','voiceQueue','dialAbandonedMaxRetry','ListId','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncNewExten','actions','channel','syncQueueMember','actionid','strategy','rrmemory','roundrobin','isNil','locked','paused','stateinterface','idHopper','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','finally','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','responsetime','Success','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','exten','value','HANGUP','membername','AMD','emit','custom:amd','[syncHangupInAMD]','dialAMDActive','outboundAnswerAgiCallsDay','Machine','countmachineretry','buildObj','amd','countcongestionretry','countnoanswerretry','countagentrejectretry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','HangupInAMD','saveInDb','[syncHangupInAMDIvr][createHistory]','[syncAgentComplete][createHistory][0]','countbusyretry','countnosuchnumberretry','dialGlobalMaxRetry','createStateFinal','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','moveContactManagedDialer','[syncHangupIvr]','dialQueueProject','AnswerAGI','outboundUnknownCallsDay','cause-txt','Unknow','queuesSummary','running','INACTIVE','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','inUse','talking','pTalking','ACTIVE','compareToOutboundQueue','queueSummaryCountersUpdated','assign','[syncQueueSummary]','throttle','filter','dialPreviewRecallmeReminder','online','reachable','length','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','[emptyContact]','handleIvr','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialer','getCaller','xcally-motion-dialer','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','%s%s','XMD-','toUpper','getCallerId','dialOriginateCallerIdName','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','callerid','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','variables','dialPrefix','trim','dialCutDigit','SIP/%s/%s%s','substring','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','[rescheduleContact][Drop]','dialAbandonedRetryFrequency','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','outboundNoSuchCallsDay','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','custom:agentreject','agentreject','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','predictiveIntervalAvailable','round','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','available','abandonmentRate','busyFactor','[getDataPredictive]','check\x20failure','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','agentBusyFactor','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','limitCalls','temp','getContactDialerIvr','dialOrderByScheduledAt','NO_AVAILABLE_CONTACTS','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','loggerHandler','[getContactCampaign2]','booked','dialLimitQueue','not_inuse','getContactDialer','checkContactEmpty','countReScheduled','[countReScheduled]\x20','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','checkIsBlackList','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','lodash','moment','ioredis','./utils','../preview/util/util','../../../config/environment/','../../../config/logger','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/voiceQueueRt','../rpc/interval','./models/action','./models/queueCallerAbandon','./models/hangup','XCALLY_IP_AGI','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startPredictive','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','syncAgentComplete','custom:queuesummarycomplete','syncQueueSummaryComplete','syncHangup','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','outbound','debug','inspect','format','name','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','predictiveIntervalTotalCalls','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','erlangBusyFactor','merge','getSeconds','startProgressive','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','checkContactLowerLimitOriginate','contactsRescheduled','message','CAMPAIGN_STATUS','[getContactDialer2][ReScheduled]'];(function(_0x176b6c,_0x1c8db3){var _0x24aa00=function(_0x39c91d){while(--_0x39c91d){_0x176b6c['push'](_0x176b6c['shift']());}};_0x24aa00(++_0x1c8db3);}(_0x5f81,0x1bf));var _0x15f8=function(_0x1ff592,_0x440a20){_0x1ff592=_0x1ff592-0x0;var _0x59e98c=_0x5f81[_0x1ff592];return _0x59e98c;};'use strict';var util=require(_0x15f8('0x0'));var _=require(_0x15f8('0x1'));var uuid=require('uuid');var moment=require(_0x15f8('0x2'));var rr=require('rr');var Redis=require(_0x15f8('0x3'));var utils=require(_0x15f8('0x4'));var hopperUtils=require('./utils/hopper');var ut=require(_0x15f8('0x5'));var config=require(_0x15f8('0x6'));var logger=require(_0x15f8('0x7'))('dialer');var loggerBooked=require(_0x15f8('0x7'))('booked');var loggerPredictive=require(_0x15f8('0x7'))('predictive');var loggerPredictiveCalls=require(_0x15f8('0x7'))(_0x15f8('0x8'));var loggerSyncQueueSummary=require(_0x15f8('0x7'))(_0x15f8('0x9'));var ami=require(_0x15f8('0xa'));config[_0x15f8('0xb')]=_[_0x15f8('0xc')](config[_0x15f8('0xb')],{'host':_0x15f8('0xd'),'port':0x18eb});var io=require(_0x15f8('0xe'))(new Redis(config['redis']));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require(_0x15f8('0xf'));var RpcSetting=require('../rpc/setting');var Interval=require(_0x15f8('0x10'));var Action=require(_0x15f8('0x11'));var History=require('./models/history');var Final=require('./models/final');var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require(_0x15f8('0x12'));var Hangup=require(_0x15f8('0x13'));var ipAgi=process['env'][_0x15f8('0x14')]||'127.0.0.1';var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x15f8('0x15')][_0x15f8('0x16')]=function(_0x54b5a5){this['tail']=this[_0x15f8('0x17')]?this[_0x15f8('0x17')]['finally'](_0x54b5a5):_0x54b5a5();};function Dialer(_0x6ba7bc,_0x5f40f1){this[_0x15f8('0x18')]=new Sequence();this[_0x15f8('0x19')]=_0x5f40f1;this[_0x15f8('0x1a')]=_0x6ba7bc['voiceQueues'];this[_0x15f8('0x1b')]=_0x6ba7bc['campaigns'];this[_0x15f8('0x1c')]=_0x6ba7bc['agents'];this[_0x15f8('0x1d')]=_0x6ba7bc[_0x15f8('0x1d')];this[_0x15f8('0x1e')]=config['maxNumberOriginate']||0x2;this[_0x15f8('0x1f')]={};this['actions']={};this[_0x15f8('0x20')]={};this[_0x15f8('0x21')]={};this[_0x15f8('0x22')]={};this[_0x15f8('0x23')]={};this['startProgressive']={};this['ivrOriginated']={};this[_0x15f8('0x24')]={};this[_0x15f8('0x25')]={};this['queuesSummary']={};ami['on'](_0x15f8('0x26'),this[_0x15f8('0x27')][_0x15f8('0x28')](this));ami['on'](_0x15f8('0x29'),this[_0x15f8('0x2a')][_0x15f8('0x28')](this));ami['on']('originateresponse',this[_0x15f8('0x2b')][_0x15f8('0x28')](this));ami['on']('agentcomplete',this[_0x15f8('0x2c')][_0x15f8('0x28')](this));ami['on']('custom:queuesummary',this['syncQueueSummary'][_0x15f8('0x28')](this));ami['on'](_0x15f8('0x2d'),this[_0x15f8('0x2e')]['bind'](this));ami['on']('hangup',this[_0x15f8('0x2f')][_0x15f8('0x28')](this));ami['on']('newexten',this['syncNewExten'][_0x15f8('0x28')](this));ami['on']('varset',this[_0x15f8('0x30')][_0x15f8('0x28')](this));ami['on'](_0x15f8('0x31'),this['syncQueueMember'][_0x15f8('0x28')](this));ami['on'](_0x15f8('0x32'),this[_0x15f8('0x33')][_0x15f8('0x28')](this));this[_0x15f8('0x34')]();this[_0x15f8('0x35')]();RpcSetting[_0x15f8('0x36')]()[_0x15f8('0x37')](function(_0x4e18a8){previewRecallmeReminderInterval=_0x4e18a8[_0x15f8('0x38')];});}function isNotNull(_0x5a2eff){return _0x5a2eff!==null&&!_[_0x15f8('0x39')](_0x5a2eff);}function msgResponse(_0x3aebe7,_0x234020,_0x4593ad){return{'action':_0x3aebe7,'response':_0x234020,'message':_0x4593ad,'stack':_0x4593ad};}function emit(_0x3bcc2b,_0x3e6102,_0x50069b){io['to'](_0x3bcc2b)['emit'](_0x3e6102,_0x50069b);}function emitOutboundVoiceQueueSummary(_0x1fb3bc){if(_0x1fb3bc['type']===_0x15f8('0x3a')){logger[_0x15f8('0x3b')]('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util[_0x15f8('0x3c')](_0x1fb3bc,{'showHidden':![],'depth':null}));emit(util[_0x15f8('0x3d')]('voice:queue:%s',_0x1fb3bc[_0x15f8('0x3e')]),_0x15f8('0x3f'),_0x1fb3bc);}}function checkGetDataPredictive(_0x67503c){if(isNotNull(_0x67503c)&&!_[_0x15f8('0x40')](_0x67503c)){loggerPredictive[_0x15f8('0x41')](_0x15f8('0x42'));loggerPredictive[_0x15f8('0x41')](_0x15f8('0x43'),_0x67503c['predictiveIntervalTotalCalls']);loggerPredictive[_0x15f8('0x41')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x67503c[_0x15f8('0x44')]);loggerPredictive[_0x15f8('0x41')](_0x15f8('0x45'),_0x67503c[_0x15f8('0x46')]);loggerPredictive[_0x15f8('0x41')](_0x15f8('0x47'),_0x67503c[_0x15f8('0x48')]);loggerPredictive[_0x15f8('0x41')](_0x15f8('0x49'),_0x67503c['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x15f8('0x41')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x67503c[_0x15f8('0x4a')]);loggerPredictive[_0x15f8('0x41')](_0x15f8('0x4b'));if(_0x67503c[_0x15f8('0x4c')]>0x0){if(!_[_0x15f8('0x39')](_0x67503c['predictiveIntervalAvgTalktime'])&&_0x67503c[_0x15f8('0x4a')]>0x0){return!![];}loggerPredictive[_0x15f8('0x41')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x15f8('0x39')](_0x67503c[_0x15f8('0x4d')])&&_0x67503c[_0x15f8('0x4d')]>0x0){return!![];}loggerPredictive[_0x15f8('0x41')](_0x15f8('0x4e'));}else{loggerPredictive['info'](_0x15f8('0x4f'));}}else{loggerPredictive[_0x15f8('0x41')](_0x15f8('0x50'));}return![];}function mergeDataErlangB(_0x2c0f35){return function(_0x4bd30f){loggerPredictive[_0x15f8('0x41')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x15f8('0x41')](_0x15f8('0x51'),_0x4bd30f[_0x15f8('0x52')]);loggerPredictive[_0x15f8('0x41')](_0x15f8('0x53'),_0x4bd30f[_0x15f8('0x54')]);loggerPredictive[_0x15f8('0x41')](_0x15f8('0x55'),_0x4bd30f[_0x15f8('0x56')]);loggerPredictive[_0x15f8('0x41')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4bd30f[_0x15f8('0x57')]);loggerPredictive[_0x15f8('0x41')](_0x15f8('0x55'),_0x4bd30f[_0x15f8('0x56')]);loggerPredictive[_0x15f8('0x41')](_0x15f8('0x4b'));_[_0x15f8('0x58')](_0x2c0f35,_0x4bd30f);};}function ifInterval(_0x33ceaf,_0x1d2c0a){if(_[_0x15f8('0x39')](_0x1d2c0a)){return![];}return utils[_0x15f8('0x59')](undefined,_0x1d2c0a)<_0x33ceaf*0x3c;}function clearPredictiveAttributes(_0x58060d){if(_0x58060d[_0x15f8('0x5a')]){_0x58060d[_0x15f8('0x5a')]=undefined;loggerPredictive[_0x15f8('0x3b')](_0x58060d[_0x15f8('0x3e')],_0x15f8('0x5b'));}if(_0x58060d[_0x15f8('0x23')]){_0x58060d[_0x15f8('0x23')]=undefined;loggerPredictive[_0x15f8('0x3b')](_0x58060d[_0x15f8('0x3e')],_0x15f8('0x5c'));}if(_0x58060d['handlePredictive']){clearInterval(_0x58060d[_0x15f8('0x5d')]);_0x58060d[_0x15f8('0x5d')]=undefined;loggerPredictive[_0x15f8('0x3b')](_0x58060d['name'],_0x15f8('0x5e'));}}function loggerCatchPredictive(_0x260e55,_0x2077d5){return function(_0x14d617){loggerPredictive[_0x15f8('0x5f')](_0x2077d5[_0x15f8('0x3e')],_0x260e55);loggerPredictive[_0x15f8('0x5f')](_0x14d617['stack']);clearPredictiveAttributes(_0x2077d5);};}function loggerCatch(_0x230716){return function(_0x2dec8c){logger[_0x15f8('0x5f')](_0x230716,util[_0x15f8('0x3c')](_0x2dec8c,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x56782a,_0x256570,_0x55374b){return function(_0x55b23b){utils[_0x15f8('0x60')](_0x256570,_0x55374b,0x0);logger[_0x15f8('0x5f')](_0x56782a,util[_0x15f8('0x3c')](_0x55b23b,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x157294){return function(_0x1297e4){if(isNotNull(_0x1297e4)&&isNotNull(_0x1297e4[0x0])){if(_0x1297e4[0x0][_0x15f8('0x61')]>0x0){_0x157294[_0x15f8('0x62')]=utils[_0x15f8('0x63')]['CONTACTS_RESCHEDULED'];logger[_0x15f8('0x41')](_0x15f8('0x64')+_0x157294[_0x15f8('0x3e')],_0x1297e4[0x0]['contactsRescheduled'],'contacts');}else{_0x157294[_0x15f8('0x62')]=utils[_0x15f8('0x63')]['NO_AVAILABLE_CONTACTS'];logger[_0x15f8('0x41')](_0x15f8('0x65')+_0x157294[_0x15f8('0x3e')]);}}};}function createObjHistory(_0x4f2589,_0x3fe1b5,_0xb38414,_0x5db91b,_0x1f15ee){_0x4f2589[_0x15f8('0x62')]=_0xb38414;var _0x55247e=new Action(_0x4f2589,_0x3fe1b5);var _0x3989d2=new History(_0x55247e);_0x3989d2[_0x15f8('0x66')]=_0x5db91b;_0x3989d2[_0x15f8('0x67')]=_0x1f15ee;_0x3989d2[_0x15f8('0x68')]=_0x55247e['starttime'];return _0x3989d2;}function unlockQueueStatus(_0x309b31,_0x51d6f9){setTimeout(function(){if(_[_0x15f8('0x39')](_0x309b31[_0x15f8('0x69')])){loggerBooked[_0x15f8('0x5f')](_0x15f8('0x6a'),_0x51d6f9);}_0x309b31['queueStatusComplete']=!![];loggerBooked['info']('[booked][unlockQueueStatus]',_0x51d6f9,JSON[_0x15f8('0x6b')](_[_0x15f8('0x6c')](_0x309b31,[_0x15f8('0x3e'),_0x15f8('0x69')])));},0x1f3);}function checkInterval(_0x18b72e){return function(){if(!isNotNull(_0x18b72e[_0x15f8('0x6d')])){_0x18b72e[_0x15f8('0x62')]=utils[_0x15f8('0x63')][_0x15f8('0x6e')];throw _0x18b72e['name']+_0x15f8('0x6f');}if(!isNotNull(_0x18b72e[_0x15f8('0x6d')][_0x15f8('0x70')])){_0x18b72e[_0x15f8('0x62')]=utils[_0x15f8('0x63')][_0x15f8('0x6e')];throw _0x18b72e['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x15f8('0x40')](_0x18b72e['Interval'][_0x15f8('0x70')]))){_0x18b72e[_0x15f8('0x62')]=utils[_0x15f8('0x63')][_0x15f8('0x6e')];throw _0x18b72e[_0x15f8('0x3e')]+_0x15f8('0x6f');}};}function checkIsIVRCampaignActive(_0x34aadd){return function(){if(!utils['isIVRCampaignActive'](_0x34aadd)){_0x34aadd[_0x15f8('0x62')]=utils[_0x15f8('0x63')]['INACTIVE'];throw _0x34aadd[_0x15f8('0x3e')]+_0x15f8('0x71');}};}function emitCampaignSummary(_0x48e84b){if(utils[_0x15f8('0x72')](_0x48e84b)){emit(util['format'](_0x15f8('0x73'),_0x48e84b['name']),_0x15f8('0x74'),_0x48e84b);}}function loggerCatchQueueSummary(_0x160b19,_0x32f773){return function(_0x3b0bc7){clearPredictiveAttributes(_0x32f773);emitCampaignSummary(_0x32f773);loggerSyncQueueSummary['debug'](_0x160b19,util[_0x15f8('0x3c')](_0x3b0bc7,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x1b7690){if(_0x1b7690[_0x15f8('0x75')]){if(_0x1b7690[_0x15f8('0x76')]===0x0){_0x1b7690['sendMessageOneNotActive']=![];_0x1b7690[_0x15f8('0x62')]=utils[_0x15f8('0x63')]['INACTIVE'];loggerSyncQueueSummary[_0x15f8('0x3b')](_0x15f8('0x77'),_0x1b7690[_0x15f8('0x3e')],'is\x20not\x20active');}else{_0x1b7690[_0x15f8('0x62')]=utils['CAMPAIGN_STATUS']['DISACTIVED'];loggerSyncQueueSummary[_0x15f8('0x3b')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x1b7690[_0x15f8('0x3e')],_0x15f8('0x78'));}emitCampaignSummary(_0x1b7690);}}function myreject(_0xaa187a){return function(_0x5f3aab){return _0xaa187a(msgResponse(_0x15f8('0x79'),_0x15f8('0x7a'),JSON[_0x15f8('0x6b')](_0x5f3aab)));};}Dialer['prototype'][_0x15f8('0x7b')]=function(_0x2e99d){return!_[_0x15f8('0x39')](_0x2e99d)&&_0x2e99d&&!_['isUndefined'](_0x2e99d['name'])&&!_['isUndefined'](_0x2e99d['active'])&&_0x2e99d['active']&&(this[_0x15f8('0x1d')][util[_0x15f8('0x3d')](_0x15f8('0x7c'),_0x2e99d[_0x15f8('0x3e')])][_0x15f8('0x7d')]==='reachable'||this[_0x15f8('0x1d')][util['format'](_0x15f8('0x7c'),_0x2e99d[_0x15f8('0x3e')])][_0x15f8('0x7d')]===_0x15f8('0x7e'));};Dialer[_0x15f8('0x15')]['checkIsTrunkReachable']=function(_0x1820d9){var _0x2028ac=this;return function(){if(!_0x2028ac['isTrunkReachable'](_0x1820d9[_0x15f8('0x7f')])){if(!_0x2028ac['isTrunkReachable'](_0x1820d9[_0x15f8('0x80')])){_0x1820d9['message']=utils[_0x15f8('0x63')][_0x15f8('0x81')];throw _0x1820d9[_0x15f8('0x3e')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer[_0x15f8('0x15')][_0x15f8('0x82')]=function(_0x171c63,_0x1e3184,_0x1a6ca1,_0x3503fd){var _0x30dbee=this;return function(){var _0x1fe5de=!![];return _0x30dbee[_0x15f8('0x83')](_0x171c63,_0x1e3184,_0x1a6ca1,_0x3503fd,_0x1fe5de);};};Dialer[_0x15f8('0x15')][_0x15f8('0x84')]=function(_0x321d7a,_0x3ee6b,_0x43aff2,_0x5d8e02){var _0x2e46ef=this;return function(){var _0x215da7=![];return _0x2e46ef[_0x15f8('0x83')](_0x321d7a[_0x15f8('0x70')],_0x3ee6b,_0x43aff2,_0x5d8e02,_0x215da7);};};Dialer[_0x15f8('0x15')][_0x15f8('0x83')]=function(_0x4acaf4,_0x1df080,_0x14fcaa,_0x3b8c3a,_0x1932ce){var _0x32de3d=[];return new Promise(function(_0x98a0a4,_0x23a423){if(!isNotNull(_0x4acaf4)){_0x3b8c3a['message']=utils[_0x15f8('0x63')][_0x15f8('0x6e')];return _0x23a423(msgResponse(_0x15f8('0x85'),_0x15f8('0x86'),_0x14fcaa+_0x15f8('0x87')));}if(_[_0x15f8('0x40')](_0x4acaf4)){_0x3b8c3a['message']=utils[_0x15f8('0x63')]['EMPTY_INTERVAL'];return _0x23a423(msgResponse(_0x15f8('0x85'),_0x15f8('0x86'),_0x14fcaa+_0x15f8('0x88')));}if(_0x1df080&&_['isUndefined'](config[_0x15f8('0x89')][_0x1df080])){_0x3b8c3a[_0x15f8('0x62')]=utils[_0x15f8('0x63')][_0x15f8('0x8a')];return _0x23a423(msgResponse(_0x15f8('0x85'),_0x15f8('0x86'),_0x14fcaa+_0x15f8('0x8b')+_0x1df080));}if(_['isArray'](_0x4acaf4)){for(var _0x15d2ef=0x0;_0x15d2ef<_0x4acaf4['length'];_0x15d2ef+=0x1){_0x32de3d[_0x15f8('0x8c')](ami['Action']({'action':_0x15f8('0x8d'),'command':util[_0x15f8('0x3d')](_0x15f8('0x8e'),_0x4acaf4[_0x15d2ef][_0x15f8('0x8f')],!_[_0x15f8('0x39')](config[_0x15f8('0x89')][_0x1df080])?_0x1df080:'')})[_0x15f8('0x37')](function(_0x20ac54){return _0x20ac54[_0x15f8('0x90')][_0x15f8('0x91')]('true')>=0x0;})[_0x15f8('0x92')](myreject(_0x23a423)));}}else{_0x32de3d['push'](ami[_0x15f8('0x93')]({'action':_0x15f8('0x8d'),'command':util['format'](_0x15f8('0x8e'),_0x4acaf4,!_['isUndefined'](config[_0x15f8('0x89')][_0x1df080])?_0x1df080:'')})[_0x15f8('0x37')](function(_0x171382){return _0x171382[_0x15f8('0x90')][_0x15f8('0x91')](_0x15f8('0x94'))>=0x0;})['catch'](myreject(_0x23a423)));}Promise[_0x15f8('0x95')](_0x32de3d)[_0x15f8('0x37')](function(_0x58c6d7){var _0x1bb864=_[_0x15f8('0x96')](_0x58c6d7);if(_0x1bb864){return _0x98a0a4(_0x1bb864);}else{_0x3b8c3a[_0x15f8('0x62')]=_0x1932ce?utils['CAMPAIGN_STATUS'][_0x15f8('0x97')]:utils[_0x15f8('0x63')]['OVERTIME_INTERVAL'];return _0x23a423(msgResponse(_0x15f8('0x98'),_0x15f8('0x86'),_0x15f8('0x99')+_0x1932ce+'\x20'+_0x14fcaa+_0x15f8('0x9a')+util[_0x15f8('0x3c')](_0x4acaf4,{'showHidden':![],'depth':null})+_0x15f8('0x9b')+_0x1df080));}})[_0x15f8('0x92')](function(_0x4571b7){return _0x23a423(msgResponse(_0x15f8('0x85'),_0x15f8('0x86'),JSON[_0x15f8('0x6b')](_0x4571b7)));});});};Dialer[_0x15f8('0x15')][_0x15f8('0x34')]=function(){var _0x2afa6f=this;return cmHopper[_0x15f8('0x9c')]({'active':![]},{'where':{'active':!![]}})[_0x15f8('0x37')](function(){setInterval(function(){_0x2afa6f[_0x15f8('0x9d')]();},0x3e8);});};Dialer[_0x15f8('0x15')][_0x15f8('0x9d')]=function(){var _0xe6acd5=this;var _0x1eadb2;for(var _0x5b7021 in this[_0x15f8('0x1b')]){if(typeof this[_0x15f8('0x1b')][_0x5b7021]!==_0x15f8('0x9e')){_0x1eadb2=this[_0x15f8('0x1b')][_0x5b7021];if(utils[_0x15f8('0x72')](_0x1eadb2)&&utils[_0x15f8('0x9f')](_0x1eadb2)){_0x1eadb2[_0x15f8('0x75')]=!![];Promise[_0x15f8('0xa0')]()[_0x15f8('0x37')](checkIsIVRCampaignActive(_0x1eadb2))[_0x15f8('0x37')](checkInterval(_0x1eadb2))['then'](_0xe6acd5[_0x15f8('0xa1')](_0x1eadb2))[_0x15f8('0x37')](_0xe6acd5[_0x15f8('0x82')](_0x1eadb2[_0x15f8('0xa2')],_0x1eadb2[_0x15f8('0xa3')],_0x1eadb2[_0x15f8('0x3e')],_0x1eadb2))[_0x15f8('0x37')](_0xe6acd5[_0x15f8('0x84')](_0x1eadb2[_0x15f8('0x6d')],_0x1eadb2[_0x15f8('0xa3')],_0x1eadb2[_0x15f8('0x3e')],_0x1eadb2))[_0x15f8('0x37')](_0xe6acd5['launchHandleIvr'](_0x1eadb2))[_0x15f8('0x92')](loggerCatchQueueSummary(_0x15f8('0xa4'),_0x1eadb2));}else{notSendMessagesCampaign(_0x1eadb2);}}}};Dialer[_0x15f8('0x15')][_0x15f8('0xa5')]=function(_0x2e13f5){if(_0x2e13f5[_0x15f8('0xa6')]!==_0x15f8('0xa7')){clearPredictiveAttributes(_0x2e13f5);}switch(_0x2e13f5['dialMethod']){case _0x15f8('0xa8'):this[_0x15f8('0xa9')](_0x2e13f5,0x1);break;case _0x15f8('0xaa'):this[_0x15f8('0xa9')](_0x2e13f5,_0x2e13f5[_0x15f8('0xab')]);break;case _0x15f8('0xa7'):this['predictive'](_0x2e13f5);break;case'booked':this[_0x15f8('0xa9')](_0x2e13f5,0x1);break;default:logger[_0x15f8('0x5f')](_0x15f8('0xac'),_0x2e13f5[_0x15f8('0x3e')],'method\x20not\x20recognized');}};Dialer[_0x15f8('0x15')][_0x15f8('0x85')]=function(_0x139d95,_0x4dc68c){var _0x40c89c=_0x139d95[_0x15f8('0xa3')];var _0x207b40=_0x4dc68c?_0x139d95[_0x15f8('0xa2')]:_0x139d95[_0x15f8('0x6d')]['Intervals'];logger[_0x15f8('0xad')](_0x15f8('0xae'),_0x207b40,_0x40c89c,_0x139d95[_0x15f8('0x3e')],util[_0x15f8('0x3d')]('Voice\x20Queue\x20%s\x20$s',_0x139d95[_0x15f8('0x3e')],_0x139d95['id']));var _0x13eb91=null;return Interval[_0x15f8('0xaf')](_0x207b40,_0x40c89c)[_0x15f8('0x37')](function(_0x383631){if(_0x383631===!![]){return _0x383631;}else{_0x139d95[_0x15f8('0x62')]=_0x4dc68c?utils['CAMPAIGN_STATUS'][_0x15f8('0x97')]:utils['CAMPAIGN_STATUS'][_0x15f8('0xb0')];_0x13eb91=msgResponse(_0x15f8('0x98'),_0x15f8('0x86'),_0x15f8('0x99')+_0x4dc68c+'\x20'+_0x139d95['name']+_0x15f8('0x9a')+util[_0x15f8('0x3c')](_0x207b40,{'showHidden':![],'depth':null})+_0x15f8('0x9b')+_0x40c89c);}if(_0x13eb91!==null){logger[_0x15f8('0xad')](_0x15f8('0xb1'),_0x13eb91);_0x13eb91['isGlobal']=_0x4dc68c;throw _0x13eb91;}})['catch'](function(_0x45847d){logger[_0x15f8('0x5f')](_0x15f8('0xb2'),_0x45847d);throw msgResponse(_0x15f8('0x79'),'Error',util[_0x15f8('0x3c')](_0x45847d,{'showHidden':![],'depth':null}));});};Dialer[_0x15f8('0x15')][_0x15f8('0x27')]=function(_0x28143b){if(this[_0x15f8('0x1a')][_0x28143b[_0x15f8('0xb3')]]){if(this[_0x15f8('0x21')][_0x28143b[_0x15f8('0xb4')]]&&this[_0x15f8('0x21')][_0x28143b[_0x15f8('0xb4')]][_0x15f8('0xb5')]!=='ivr'){this[_0x15f8('0xb6')](this[_0x15f8('0x1a')][_0x28143b[_0x15f8('0xb3')]]);this[_0x15f8('0x21')][_0x28143b[_0x15f8('0xb4')]][_0x15f8('0xb7')]=moment()[_0x15f8('0x3d')](_0x15f8('0xb8'));}}};Dialer['prototype']['syncAgentComplete']=function(_0x3a6e8f){var _0x28ad41=this[_0x15f8('0x21')][_0x3a6e8f[_0x15f8('0xb4')]];if(this[_0x15f8('0x1a')][_0x3a6e8f[_0x15f8('0xb3')]]){if(_0x28ad41&&_0x28ad41[_0x15f8('0xb5')]!==_0x15f8('0xb9')){delete this[_0x15f8('0x21')][_0x3a6e8f[_0x15f8('0xb4')]];this[_0x15f8('0x1a')][_0x3a6e8f['queue']][_0x15f8('0xba')]+=0x1;var _0x418840=new AgentComplete(_0x28ad41,_0x3a6e8f);if(_0x3a6e8f['reason']===_0x15f8('0xbb')){_0x418840[_0x15f8('0xbc')]=this[_0x15f8('0x1a')][_0x3a6e8f[_0x15f8('0xb3')]][_0x15f8('0xbd')]&&this['voiceQueues'][_0x3a6e8f[_0x15f8('0xb3')]][_0x15f8('0xbe')]?moment()[_0x15f8('0x3d')](_0x15f8('0xb8')):undefined;}hopperUtils[_0x15f8('0xbf')](_0x418840)[_0x15f8('0x92')](loggerCatch(_0x15f8('0xc0')));hopperUtils['moveContactManagedDialer'](_0x418840)[_0x15f8('0x92')](loggerCatch(_0x15f8('0xc1')));}}};Dialer[_0x15f8('0x15')][_0x15f8('0x2a')]=function(_0x557bd4){var _0x32ec6c=this[_0x15f8('0x21')][_0x557bd4[_0x15f8('0xb4')]];var _0x15a93b=this;var _0x1f9d46=![];var _0x245734;var _0x13b8ff;if(this['voiceQueues'][_0x557bd4[_0x15f8('0xb3')]]){if(_0x32ec6c&&_0x32ec6c[_0x15f8('0xb5')]!=='ivr'){delete this[_0x15f8('0x21')][_0x557bd4['uniqueid']];this[_0x15f8('0xb6')](this[_0x15f8('0x1a')][_0x557bd4[_0x15f8('0xb3')]]);_0x32ec6c[_0x15f8('0xc2')]=moment()[_0x15f8('0x3d')](_0x15f8('0xb8'));var _0x229348=new QueueCallerAbandon(_0x32ec6c,_0x557bd4);if(utils[_0x15f8('0x59')](_0x32ec6c[_0x15f8('0xc2')],_0x32ec6c['responsetime'])>=_0x32ec6c[_0x15f8('0xc3')]){this[_0x15f8('0x1a')][_0x557bd4[_0x15f8('0xb3')]][_0x15f8('0x46')]+=0x1;this['voiceQueues'][_0x557bd4[_0x15f8('0xb3')]][_0x15f8('0xc4')]+=0x1;this[_0x15f8('0x1a')][_0x557bd4['queue']][_0x15f8('0xc5')]+=0x1;_0x229348[_0x15f8('0x66')]=0xa;_0x229348[_0x15f8('0x67')]=_0x15f8('0xc6');_0x229348[_0x15f8('0xc7')]=_0x15f8('0xc8');_0x229348[_0x15f8('0xbc')]=this['voiceQueues'][_0x557bd4[_0x15f8('0xb3')]][_0x15f8('0xbd')]?moment()['format'](_0x15f8('0xb8')):undefined;_0x229348[_0x15f8('0xc9')]+=0x1;_0x229348[_0x15f8('0xca')]+=0x1;_0x245734=this[_0x15f8('0x1a')][_0x557bd4['queue']]['dialDropRetryFrequency'];_0x13b8ff=this['voiceQueues'][_0x557bd4['queue']]['callAdditionalPhoneAfterMin'];hopperUtils[_0x15f8('0xcb')](_0x229348,_0x229348[_0x15f8('0x66')],_0x32ec6c['voiceQueue'])[_0x15f8('0x37')](function(_0x559260){_0x1f9d46=_0x559260[_0x15f8('0xcc')]==0x1;if(_0x229348[_0x15f8('0xc9')]>=_0x15a93b[_0x15f8('0x1a')][_0x557bd4[_0x15f8('0xb3')]]['dialDropMaxRetry']){_0x15a93b[_0x15f8('0xcd')](_0x229348,_0x559260[_0x15f8('0xcc')]);}else{hopperUtils[_0x15f8('0xce')]({'active':![],'countdropretry':_0x229348[_0x15f8('0xc9')],'scheduledat':moment()[_0x15f8('0xcf')](_0x15a93b[_0x15f8('0x1a')][_0x557bd4[_0x15f8('0xb3')]][_0x15f8('0xd0')],_0x15f8('0xd1'))[_0x15f8('0x3d')](_0x15f8('0xb8')),'ContactId':_0x32ec6c[_0x15f8('0xd2')],'ListId':_0x32ec6c['ListId'],'VoiceQueueId':_0x32ec6c[_0x15f8('0xd3')]||undefined,'CampaignId':_0x32ec6c[_0x15f8('0xd4')]||undefined})[_0x15f8('0x92')](loggerCatch('[rescheduleContact][Drop]'));var _0x25daa3=new History(_0x229348);_0x25daa3[_0x15f8('0x66')]=0xa;_0x25daa3[_0x15f8('0x67')]=_0x15f8('0xc6');_0x25daa3[_0x15f8('0xd5')]=moment()['format'](_0x15f8('0xb8'));_0x25daa3['endtime']=_0x25daa3['starttime'];_0x25daa3[_0x15f8('0xd6')]=_0x229348[_0x15f8('0xd6')];_0x25daa3['calleridnum']=_0x229348[_0x15f8('0xd7')];hopperUtils[_0x15f8('0xbf')](_0x25daa3)['catch'](loggerCatch(_0x15f8('0xd8')));}})['then'](function(){if(_0x1f9d46)hopperUtils[_0x15f8('0xd9')](_0x229348,_0x245734,_0x13b8ff)['then'](function(){return 0x1;});});}else{this[_0x15f8('0x1a')][_0x557bd4[_0x15f8('0xb3')]][_0x15f8('0x48')]+=0x1;this[_0x15f8('0x1a')][_0x557bd4[_0x15f8('0xb3')]][_0x15f8('0xda')]+=0x1;_0x229348[_0x15f8('0x66')]=0xb;_0x229348['statedesc']=_0x15f8('0xdb');_0x229348[_0x15f8('0xc7')]=_0x15f8('0xdc');_0x229348[_0x15f8('0xdd')]+=0x1;_0x229348[_0x15f8('0xca')]+=0x1;_0x245734=this['voiceQueues'][_0x557bd4['queue']]['dialAbandonedRetryFrequency'];_0x13b8ff=this[_0x15f8('0x1a')][_0x557bd4['queue']][_0x15f8('0xde')];hopperUtils['verifyAdditionalPhones'](_0x229348,_0x229348[_0x15f8('0x66')],_0x32ec6c[_0x15f8('0xdf')])[_0x15f8('0x37')](function(_0x4abf8f){if(_0x229348[_0x15f8('0xdd')]>=_0x15a93b[_0x15f8('0x1a')][_0x557bd4[_0x15f8('0xb3')]][_0x15f8('0xe0')]){_0x15a93b[_0x15f8('0xcd')](_0x229348,_0x4abf8f[_0x15f8('0xcc')]);}else{hopperUtils[_0x15f8('0xce')]({'active':![],'countabandonedretry':_0x229348[_0x15f8('0xdd')],'scheduledat':moment()['add'](_0x15a93b['voiceQueues'][_0x557bd4[_0x15f8('0xb3')]]['dialAbandonedRetryFrequency'],_0x15f8('0xd1'))[_0x15f8('0x3d')](_0x15f8('0xb8')),'ContactId':_0x32ec6c['ContactId'],'ListId':_0x32ec6c[_0x15f8('0xe1')],'VoiceQueueId':_0x32ec6c[_0x15f8('0xd3')]||undefined,'CampaignId':_0x32ec6c[_0x15f8('0xd4')]||undefined})[_0x15f8('0x92')](loggerCatch(_0x15f8('0xe2')));var _0x517ec9=new History(_0x229348);_0x517ec9[_0x15f8('0x66')]=0xb;_0x517ec9[_0x15f8('0x67')]=_0x15f8('0xdb');_0x517ec9[_0x15f8('0xd5')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x517ec9[_0x15f8('0x68')]=_0x517ec9['starttime'];_0x517ec9[_0x15f8('0xd6')]=_0x229348['calleridname'];_0x517ec9[_0x15f8('0xd7')]=_0x229348[_0x15f8('0xd7')];hopperUtils[_0x15f8('0xbf')](_0x517ec9)[_0x15f8('0x92')](loggerCatch(_0x15f8('0xe3')));}})[_0x15f8('0x37')](function(){if(_0x1f9d46)hopperUtils['swapAdditionalPhones'](_0x229348,_0x245734,_0x13b8ff)['then'](function(){return 0x1;});});}}}};Dialer[_0x15f8('0x15')][_0x15f8('0xe4')]=function(_0x42a197){if(this[_0x15f8('0xe5')][_0x42a197[_0x15f8('0xb4')]]){this[_0x15f8('0xe5')][_0x42a197['uniqueid']][_0x15f8('0xe6')]=_0x42a197[_0x15f8('0xe6')];}if(this[_0x15f8('0x21')][_0x42a197[_0x15f8('0xb4')]]){this[_0x15f8('0x21')][_0x42a197[_0x15f8('0xb4')]][_0x15f8('0xe6')]=_0x42a197[_0x15f8('0xe6')];}};Dialer[_0x15f8('0x15')][_0x15f8('0xe7')]=function(_0x2978db){if(!this[_0x15f8('0xe5')][_0x2978db[_0x15f8('0xe8')]]){return;}var _0x14e735=this[_0x15f8('0x1a')][this[_0x15f8('0xe5')][_0x2978db['actionid']][_0x15f8('0xb3')]][_0x15f8('0xe9')]||_0x15f8('0xea');if(_0x14e735===_0x15f8('0xeb')){if(this[_0x15f8('0xe5')][_0x2978db[_0x15f8('0xe8')]]&&_[_0x15f8('0xec')](this[_0x15f8('0xe5')][_0x2978db['actionid']][_0x15f8('0xed')])&&_0x2978db[_0x15f8('0x7d')]==='1'&&_0x2978db[_0x15f8('0xee')]==='0'){if(this['agents'][_0x2978db[_0x15f8('0xef')]]){if(!this[_0x15f8('0x1c')][_0x2978db[_0x15f8('0xef')]][_0x15f8('0xed')]){this['agents'][_0x2978db[_0x15f8('0xef')]][_0x15f8('0xed')]=!![];this[_0x15f8('0xe5')][_0x2978db[_0x15f8('0xe8')]][_0x15f8('0xed')]=!![];this['actions'][_0x2978db['actionid']][_0x15f8('0xef')]=_0x2978db[_0x15f8('0xef')];}}}}else if(_0x14e735===_0x15f8('0xea')){if(this[_0x15f8('0xe5')][_0x2978db[_0x15f8('0xe8')]]){if(this[_0x15f8('0x1c')][_0x2978db['stateinterface']]){this[_0x15f8('0xe5')][_0x2978db['actionid']]['stateinterface']=_0x2978db['stateinterface'];if(_[_0x15f8('0xec')](this[_0x15f8('0x24')][this[_0x15f8('0xe5')][_0x2978db['actionid']]['queue']])){this[_0x15f8('0x24')][this[_0x15f8('0xe5')][_0x2978db[_0x15f8('0xe8')]]['queue']]=[];}this[_0x15f8('0x24')][this[_0x15f8('0xe5')][_0x2978db[_0x15f8('0xe8')]][_0x15f8('0xb3')]][_0x15f8('0x8c')](_[_0x15f8('0x58')](_[_0x15f8('0x6c')](this[_0x15f8('0xe5')][_0x2978db['actionid']],[_0x15f8('0xf0'),_0x15f8('0xef')]),{'status':_0x2978db[_0x15f8('0x7d')],'paused':_0x2978db['paused']}));}}}};Dialer[_0x15f8('0x15')][_0x15f8('0x33')]=function(_0x4f7f4f){if(!this[_0x15f8('0xe5')][_0x4f7f4f['actionid']]){return;}var _0x2427df=this;var _0xb4fb28=this[_0x15f8('0x1a')][this[_0x15f8('0xe5')][_0x4f7f4f[_0x15f8('0xe8')]][_0x15f8('0xb3')]];var _0x1148f9=_0xb4fb28['strategy']||_0x15f8('0xea');if(_0x1148f9==='roundrobin'){if(this['actions'][_0x4f7f4f[_0x15f8('0xe8')]]&&this[_0x15f8('0xe5')][_0x4f7f4f['actionid']]['stateinterface']){this['preview'][_0x15f8('0xf1')](this[_0x15f8('0xe5')][_0x4f7f4f[_0x15f8('0xe8')]][_0x15f8('0xf0')],this[_0x15f8('0xe5')][_0x4f7f4f[_0x15f8('0xe8')]][_0x15f8('0xef')])[_0x15f8('0x92')](function(_0x55d5df){logger[_0x15f8('0x5f')](_0x15f8('0xf2'),util['inspect'](_0x55d5df,{'showHidden':![],'depth':null}));})['finally'](function(){_0x2427df['updateOriginated'](_0x2427df[_0x15f8('0x1a')][_0x2427df[_0x15f8('0xe5')][_0x4f7f4f[_0x15f8('0xe8')]][_0x15f8('0xb3')]]);_0x2427df[_0x15f8('0x1c')][_0x2427df[_0x15f8('0xe5')][_0x4f7f4f[_0x15f8('0xe8')]][_0x15f8('0xef')]][_0x15f8('0xed')]=![];delete _0x2427df[_0x15f8('0xe5')][_0x4f7f4f[_0x15f8('0xe8')]];unlockQueueStatus(_0xb4fb28);});}else{this[_0x15f8('0xb6')](this['voiceQueues'][this[_0x15f8('0xe5')][_0x4f7f4f[_0x15f8('0xe8')]][_0x15f8('0xb3')]]);hopperUtils[_0x15f8('0xce')]({'active':![],'ContactId':this[_0x15f8('0xe5')][_0x4f7f4f[_0x15f8('0xe8')]][_0x15f8('0xd2')],'ListId':this['actions'][_0x4f7f4f[_0x15f8('0xe8')]][_0x15f8('0xe1')],'VoiceQueueId':this[_0x15f8('0xe5')][_0x4f7f4f[_0x15f8('0xe8')]][_0x15f8('0xd3')]||undefined,'CampaignId':this['actions'][_0x4f7f4f[_0x15f8('0xe8')]][_0x15f8('0xd4')]||undefined})['catch'](loggerCatch(_0x15f8('0xf3')));delete this[_0x15f8('0xe5')][_0x4f7f4f[_0x15f8('0xe8')]];unlockQueueStatus(_0xb4fb28);}}else if(_0x1148f9===_0x15f8('0xea')){var _0x2c5790;if(this[_0x15f8('0xe5')][_0x4f7f4f['actionid']]&&!_[_0x15f8('0x40')](this[_0x15f8('0x24')][this['actions'][_0x4f7f4f['actionid']][_0x15f8('0xb3')]])){if(this[_0x15f8('0x25')][_0x2427df[_0x15f8('0xe5')][_0x4f7f4f[_0x15f8('0xe8')]]['queue']]){this[_0x15f8('0x25')][_0x2427df[_0x15f8('0xe5')][_0x4f7f4f['actionid']][_0x15f8('0xb3')]]=this[_0x15f8('0x25')][this[_0x15f8('0xe5')][_0x4f7f4f['actionid']][_0x15f8('0xb3')]]?this[_0x15f8('0x25')][this[_0x15f8('0xe5')][_0x4f7f4f[_0x15f8('0xe8')]][_0x15f8('0xb3')]]:this[_0x15f8('0x24')][this['actions'][_0x4f7f4f[_0x15f8('0xe8')]][_0x15f8('0xb3')]]?this[_0x15f8('0x24')][this[_0x15f8('0xe5')][_0x4f7f4f[_0x15f8('0xe8')]][_0x15f8('0xb3')]][_0x15f8('0xf4')]||0x0:0x0;}this[_0x15f8('0x24')][this[_0x15f8('0xe5')][_0x4f7f4f[_0x15f8('0xe8')]][_0x15f8('0xb3')]][_0x15f8('0xf4')]=this['queueBookedRR'][this['actions'][_0x4f7f4f['actionid']][_0x15f8('0xb3')]];for(var _0xf13204=0x0;_0xf13204=_0x1aac05['dialGlobalMaxRetry']){_0x1dfc5d[_0x15f8('0x115')](_0x353a69,_0x176b1c,_0xb67d25,_0x15f8('0x116'));}else{if(_0x353a69[_0x15f8('0x10f')]>=_0x1aac05[_0x15f8('0x117')]){_0x1dfc5d['createStateFinal'](_0x353a69,_0x176b1c,_0xb67d25,_0x15f8('0x118'));}else{hopperUtils[_0x15f8('0xce')]({'active':![],'countmachineretry':_0x353a69[_0x15f8('0x10f')],'scheduledat':moment()[_0x15f8('0xcf')](_0x1aac05[_0x15f8('0x119')],_0x15f8('0xd1'))[_0x15f8('0x3d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x353a69[_0x15f8('0xd2')],'ListId':_0x353a69[_0x15f8('0xe1')],'VoiceQueueId':_0x353a69[_0x15f8('0xd3')]||undefined,'CampaignId':_0x353a69['CampaignId']||undefined})[_0x15f8('0x92')](loggerCatch(_0x15f8('0x11a')));_0x176b1c({'reschedule':0x1});}}});}if(_0x142a36[_0x15f8('0xb5')]===_0x15f8('0xb9')&&this[_0x15f8('0x1b')][_0x142a36[_0x15f8('0xb3')]][_0x15f8('0x10c')]&&_0x971bfe[_0x15f8('0x105')]==='HANGUP'){delete this[_0x15f8('0x21')][_0x971bfe[_0x15f8('0xb4')]];this[_0x15f8('0xb6')](this[_0x15f8('0x1b')][_0x142a36[_0x15f8('0xb3')]]);_0x35ff8c=new Hangup(_0x142a36,_0x971bfe);_0x35ff8c[_0x15f8('0x66')]=0x12;_0x35ff8c[_0x15f8('0x67')]=_0x15f8('0x11b');_0x35ff8c[_0x15f8('0x107')]=_0x15f8('0x108');ami[_0x15f8('0x109')]('custom:amd',ut[_0x15f8('0x110')](_0x35ff8c,'amd'));this[_0x15f8('0x11c')](_0x35ff8c,_0x15f8('0x11d'),'[syncHangupInAMDIvr]');}if(_0x142a36['type']==='ivr'&&this[_0x15f8('0x1b')][_0x142a36['queue']][_0x15f8('0x10c')]&&_0x971bfe['value']==='MACHINE'){return new Promise(function(_0x5717f1,_0x22fd29){delete _0x1dfc5d[_0x15f8('0x21')][_0x971bfe[_0x15f8('0xb4')]];_0x1dfc5d['updateOriginated'](_0x1dfc5d[_0x15f8('0x1b')][_0x142a36[_0x15f8('0xb3')]]);_0x1dfc5d[_0x15f8('0x1b')][_0x142a36['queue']][_0x15f8('0xba')]+=0x1;_0x1dfc5d[_0x15f8('0x1b')][_0x142a36[_0x15f8('0xb3')]][_0x15f8('0x10d')]+=0x1;var _0x2b8274=_0x1dfc5d[_0x15f8('0x1b')][_0x142a36['queue']];var _0x110253=new Hangup(_0x142a36,_0x971bfe);_0x110253[_0x15f8('0x66')]=0x13;_0x110253[_0x15f8('0x67')]='Machine';_0x110253['membername']=_0x15f8('0x108');_0x110253[_0x15f8('0x10f')]+=0x1;_0x110253[_0x15f8('0xca')]+=0x1;_0x110253[_0x15f8('0x111')]=!![];ami[_0x15f8('0x109')](_0x15f8('0x10a'),ut[_0x15f8('0x110')](_0x110253,'amd'));hopperUtils[_0x15f8('0xbf')](_0x110253)[_0x15f8('0x92')](loggerCatch(_0x15f8('0x11e')));if(_0x110253[_0x15f8('0x11f')]+_0x110253['countcongestionretry']+_0x110253[_0x15f8('0x113')]+_0x110253[_0x15f8('0x120')]+_0x110253[_0x15f8('0xc9')]+_0x110253[_0x15f8('0xdd')]+_0x110253[_0x15f8('0x10f')]+_0x110253['countagentrejectretry']>=_0x2b8274[_0x15f8('0x121')]){_0x1dfc5d[_0x15f8('0x115')](_0x110253,_0x5717f1,_0x22fd29,'reason19\x20machine....');}else{if(_0x110253[_0x15f8('0x10f')]>=_0x2b8274[_0x15f8('0x117')]){_0x1dfc5d[_0x15f8('0x122')](_0x110253,_0x5717f1,_0x22fd29,'reason\x2019\x20machine....');}else{hopperUtils[_0x15f8('0xce')]({'active':![],'countmachineretry':_0x110253['countmachineretry'],'scheduledat':moment()[_0x15f8('0xcf')](_0x2b8274[_0x15f8('0x119')],_0x15f8('0xd1'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x110253['ContactId'],'ListId':_0x110253[_0x15f8('0xe1')],'VoiceQueueId':_0x110253[_0x15f8('0xd3')]||undefined,'CampaignId':_0x110253[_0x15f8('0xd4')]||undefined})[_0x15f8('0x92')](loggerCatch(_0x15f8('0x11a')));_0x5717f1({'reschedule':0x1});}}});}}};Dialer[_0x15f8('0x15')][_0x15f8('0x2f')]=function(_0x421151){var _0x5af5b6=this[_0x15f8('0x21')][_0x421151[_0x15f8('0xb4')]];var _0x3ce204;if(_0x5af5b6&&_0x5af5b6[_0x15f8('0xb5')]===_0x15f8('0xb9')){delete this[_0x15f8('0x21')][_0x421151[_0x15f8('0xb4')]];this[_0x15f8('0xb6')](this[_0x15f8('0x1b')][_0x5af5b6[_0x15f8('0xb3')]]);this[_0x15f8('0x1b')][_0x5af5b6[_0x15f8('0xb3')]][_0x15f8('0x123')]+=0x1;_0x3ce204=new Hangup(_0x5af5b6,_0x421151);hopperUtils['createHistory'](_0x3ce204)['catch'](loggerCatch(_0x15f8('0x124')));hopperUtils[_0x15f8('0x125')](_0x3ce204)[_0x15f8('0x92')](loggerCatch(_0x15f8('0x126')));}if(_0x5af5b6&&_0x5af5b6['type']!=='ivr'&&isNotNull(this['voiceQueues'][_0x5af5b6[_0x15f8('0xb3')]][_0x15f8('0x127')])){delete this[_0x15f8('0x21')][_0x421151[_0x15f8('0xb4')]];this[_0x15f8('0xb6')](this['voiceQueues'][_0x5af5b6[_0x15f8('0xb3')]]);this[_0x15f8('0x1a')][_0x5af5b6['queue']]['outboundAnswerCallsDay']+=0x1;this[_0x15f8('0x1a')][_0x5af5b6[_0x15f8('0xb3')]]['outboundAnswerAgiCallsDay']+=0x1;_0x3ce204=new Hangup(_0x5af5b6,_0x421151);_0x3ce204[_0x15f8('0x66')]=0x10;_0x3ce204[_0x15f8('0x67')]=_0x15f8('0x128');_0x3ce204[_0x15f8('0x107')]='AGI';hopperUtils[_0x15f8('0xbf')](_0x3ce204)[_0x15f8('0x92')](loggerCatch(_0x15f8('0x124')));hopperUtils[_0x15f8('0x125')](_0x3ce204)[_0x15f8('0x92')](loggerCatch(_0x15f8('0x126')));}if(_0x5af5b6&&_0x5af5b6[_0x15f8('0xb5')]!==_0x15f8('0xb9')&&!isNotNull(this[_0x15f8('0x1a')][_0x5af5b6[_0x15f8('0xb3')]][_0x15f8('0x127')])){delete this[_0x15f8('0x21')][_0x421151[_0x15f8('0xb4')]];this[_0x15f8('0xb6')](this[_0x15f8('0x1a')][_0x5af5b6[_0x15f8('0xb3')]]);this[_0x15f8('0x1a')][_0x5af5b6[_0x15f8('0xb3')]][_0x15f8('0x129')]+=0x1;_0x3ce204=new Hangup(_0x5af5b6,_0x421151);_0x3ce204[_0x15f8('0x66')]=0xc;_0x3ce204[_0x15f8('0x67')]=_0x421151[_0x15f8('0x12a')];_0x3ce204[_0x15f8('0x107')]=_0x15f8('0x12b');hopperUtils[_0x15f8('0xbf')](_0x3ce204)[_0x15f8('0x92')](loggerCatch(_0x15f8('0x124')));hopperUtils[_0x15f8('0x125')](_0x3ce204)[_0x15f8('0x92')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x15f8('0x15')][_0x15f8('0x9')]=function(_0x409404){var _0x1afdce=this;if(!_0x1afdce[_0x15f8('0x12c')][_0x409404[_0x15f8('0x3e')]]){_0x1afdce[_0x15f8('0x12c')][_0x409404[_0x15f8('0x3e')]]={'running':![]};}else if(_0x1afdce[_0x15f8('0x12c')][_0x409404[_0x15f8('0x3e')]]['running']===!![]){return;}else if(_0x1afdce[_0x15f8('0x12c')][_0x409404['name']][_0x15f8('0x12d')]===![]){_0x1afdce[_0x15f8('0x12c')][_0x409404['name']][_0x15f8('0x12d')]=!![];}var _0x1b936b=_0x1afdce[_0x15f8('0x1a')][_0x409404['name']];var _0x1931d3=_0x1b936b[_0x15f8('0x62')]!==utils[_0x15f8('0x63')][_0x15f8('0x12e')];var _0x52a3ba=utils[_0x15f8('0x12f')](_0x1b936b);_0x1b936b[_0x15f8('0x130')]=utils[_0x15f8('0x131')](_0x1b936b,_0x1afdce['trunks']);Promise['resolve']()['then'](function(){if(_0x1b936b[_0x15f8('0x130')]===utils[_0x15f8('0x63')]['INACTIVE']){if(_0x1931d3){clearPredictiveAttributes(_0x1b936b);_0x409404['startPredictive']=undefined;_0x409404[_0x15f8('0x5a')]=undefined;}if(_0x1b936b[_0x15f8('0x130')]===utils[_0x15f8('0x63')][_0x15f8('0x12e')]){_0x409404['available']=0x0;_0x409404['paused']=0x0;_0x409404[_0x15f8('0x132')]=0x0;_0x409404[_0x15f8('0x133')]=0x0;_0x409404[_0x15f8('0x134')]=0x0;}}else if(_0x1b936b[_0x15f8('0x130')]===utils[_0x15f8('0x63')][_0x15f8('0x135')]&&!_0x52a3ba){return _0x1afdce[_0x15f8('0x85')](_0x1b936b,!![])[_0x15f8('0x37')](function(){return _0x1afdce[_0x15f8('0x85')](_0x1b936b,![]);})[_0x15f8('0x37')](function(){return _0x1afdce[_0x15f8('0xa5')](_0x1b936b);})[_0x15f8('0x92')](function(_0x570e0e){loggerSyncQueueSummary[_0x15f8('0x3b')]('[syncQueueSummary]',util['inspect'](_0x570e0e,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x1b936b);});}else{clearPredictiveAttributes(_0x1b936b);}})[_0x15f8('0x37')](function(){var _0x3daa3b=_0x409404[_0x15f8('0x136')](_0x1b936b);if(_0x3daa3b||_0x1b936b[_0x15f8('0x137')]){_0x1b936b[_0x15f8('0x137')]=![];_0x409404['updateReportFromOutboundQueue'](_0x1b936b);Object[_0x15f8('0x138')](_0x1b936b,_0x409404);emitOutboundVoiceQueueSummary(_0x409404);}_0x1afdce[_0x15f8('0x12c')][_0x1b936b[_0x15f8('0x3e')]][_0x15f8('0x12d')]=![];})[_0x15f8('0x92')](function(_0x1706dd){logger[_0x15f8('0x5f')](_0x15f8('0x139'),util['inspect'](_0x1706dd,{'showHidden':![],'depth':null}));_0x1afdce[_0x15f8('0x12c')][_0x1b936b[_0x15f8('0x3e')]]['running']=![];});};Dialer[_0x15f8('0x15')]['syncQueueSummaryComplete']=_[_0x15f8('0x13a')](function(){var _0x53fdc7=_[_0x15f8('0x13b')](this[_0x15f8('0x1a')],function(_0x346bc9){return _0x346bc9[_0x15f8('0x13c')];});var _0x1965d7=_[_0x15f8('0x13b')](this[_0x15f8('0x1c')],function(_0xc1f853){return _0xc1f853[_0x15f8('0x13d')]&&_0xc1f853[_0x15f8('0x7d')]===_0x15f8('0x13e');});if(_0x53fdc7[_0x15f8('0x13f')]>0x0&&_0x1965d7[_0x15f8('0x13f')]>0x0){return Promise[_0x15f8('0xa0')]()[_0x15f8('0x37')](cmHopper[_0x15f8('0x140')](_[_0x15f8('0x141')](_0x53fdc7,'id'),previewRecallmeReminderInterval,_[_0x15f8('0x141')](_0x1965d7,'id')))[_0x15f8('0x37')](function(_0x14a62b){for(var _0x57cc1b=0x0;_0x57cc1b<_0x14a62b['length'];_0x57cc1b++){var _0x168c18=_0x14a62b[_0x57cc1b][_0x15f8('0x142')][_0x15f8('0x3e')];if(_0x168c18)io['to'](util['format'](_0x15f8('0x143'),_0x168c18))['emit'](_0x15f8('0x144'),{'hopper':_0x14a62b[_0x57cc1b]});}})[_0x15f8('0x92')](function(_0x2e8648){logger[_0x15f8('0x5f')](_0x15f8('0x145'),_0x2e8648);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0x15f8('0x35')]=function(){var _0x45e4c8=this;setInterval(function(){_0x45e4c8[_0x15f8('0x146')](_0x45e4c8['uniqueId'],_0x15f8('0x147'));_0x45e4c8[_0x15f8('0x146')](_0x45e4c8[_0x15f8('0xe5')],'[actions]');},0x32c8);};Dialer['prototype'][_0x15f8('0x146')]=function(_0x14dff7,_0x348fef){var _0x4de21e=this;for(var _0x2f46eb in _0x14dff7){if(typeof _0x14dff7[_0x2f46eb]!==_0x15f8('0x9e')){this[_0x15f8('0x18')][_0x15f8('0x16')](function(){if(!_[_0x15f8('0xec')](_0x14dff7[_0x2f46eb])){return ami['Action']({'action':_0x15f8('0x7d'),'channel':_0x14dff7[_0x2f46eb][_0x15f8('0xe6')]})['catch'](function(_0x8fd576){if(_0x8fd576[_0x15f8('0x62')]===_0x15f8('0x148')){setTimeout(function(){if(_0x14dff7[_0x2f46eb]&&_0x14dff7[_0x2f46eb][_0x15f8('0xb5')]!==_0x15f8('0xb9')){_0x4de21e[_0x15f8('0xb6')](_0x4de21e[_0x15f8('0x1a')][_0x14dff7[_0x2f46eb]['queue']]);logger[_0x15f8('0x5f')](_0x15f8('0x149'),_0x348fef,_0x2f46eb,_0x14dff7[_0x2f46eb][_0x15f8('0xb3')]);delete _0x14dff7[_0x2f46eb];}if(_0x14dff7[_0x2f46eb]&&_0x14dff7[_0x2f46eb][_0x15f8('0xb5')]===_0x15f8('0xb9')){_0x4de21e[_0x15f8('0xb6')](_0x4de21e[_0x15f8('0x1b')][_0x14dff7[_0x2f46eb][_0x15f8('0xb3')]]);logger['error'](_0x15f8('0x14a'),_0x348fef,_0x2f46eb,_0x14dff7[_0x2f46eb]['queue']);delete _0x14dff7[_0x2f46eb];}},0x2328);}});}});}}};Dialer[_0x15f8('0x15')][_0x15f8('0x14b')]=function(_0x3ed8bd){return Promise[_0x15f8('0xa0')]()[_0x15f8('0x37')](voiceQueueRt['getVoiceQueueRtPauses'](_0x3ed8bd))[_0x15f8('0x92')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x15f8('0x15')][_0x15f8('0xb6')]=function(_0x36a0d2){if(!_[_0x15f8('0x39')](_0x36a0d2)&&_0x36a0d2!==null){if(typeof _0x36a0d2[_0x15f8('0x76')]!==_0x15f8('0x9e')){if(_0x36a0d2[_0x15f8('0x76')]>0x0){_0x36a0d2['originated']-=0x1;}else{logger[_0x15f8('0x5f')](_0x15f8('0x14c'));}}}else{logger[_0x15f8('0x5f')](_0x15f8('0x14d'));}};Dialer[_0x15f8('0x15')]['loggerHandler']=function(_0x4c65e3,_0x2458b1){var _0x500518=this;return function(_0x1e3aef){_0x500518[_0x15f8('0xb6')](_0x2458b1);logger[_0x15f8('0x5f')](_0x4c65e3,util['inspect'](_0x1e3aef,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x15f8('0x14e')]=function(_0x2a6c3d,_0x560b75,_0x4c2d32){var _0x17d336={'state':0x19,'statedesc':_0x15f8('0x14f')};this[_0x15f8('0xb6')](_0x560b75);this[_0x15f8('0x11c')](_[_0x15f8('0x58')](_0x17d336,_[_0x15f8('0x6c')](_0x4c2d32,[_0x15f8('0xd2'),'ListId','UserId',_0x15f8('0xd3'),_0x15f8('0xd4')])),'[emptyContact][createHistory]',_0x15f8('0x150'));logger['error'](_0x2a6c3d);};Dialer[_0x15f8('0x15')]['saveInDb']=function(_0x24762,_0x50b8ec,_0x5b04dd){hopperUtils['createHistory'](_0x24762)[_0x15f8('0x92')](loggerCatch(_0x50b8ec));hopperUtils[_0x15f8('0x125')](_0x24762)['catch'](loggerCatch(_0x5b04dd));};Dialer[_0x15f8('0x15')][_0x15f8('0xcd')]=function(_0x72a825,_0x13d502){hopperUtils['createHistory'](_0x72a825)[_0x15f8('0x92')](loggerCatch(_0x15f8('0xc0')));if(_0x13d502==0x0){hopperUtils[_0x15f8('0x125')](_0x72a825)[_0x15f8('0x92')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0x15f8('0x15')][_0x15f8('0x145')]=function(_0x3132df){return Promise[_0x15f8('0xa0')]()['then'](cmHopper[_0x15f8('0x140')](_0x3132df['id'],previewRecallmeReminderInterval))[_0x15f8('0x37')](function(_0x552bc9){for(var _0x50165a=0x0;_0x50165a<_0x552bc9[_0x15f8('0x13f')];_0x50165a++){var _0x57b81a=_0x552bc9[_0x50165a][_0x15f8('0x142')]['name'];if(_0x57b81a)io['to'](util['format']('user:%s',_0x57b81a))[_0x15f8('0x109')](_0x15f8('0x144'),{'hopper':_0x552bc9[_0x50165a]});}})[_0x15f8('0x92')](function(){});};Dialer[_0x15f8('0x15')]['launchHandleIvr']=function(_0xcacbad){var _0x264685=this;return function(){_0x264685[_0x15f8('0x151')](_0xcacbad);};};Dialer[_0x15f8('0x15')][_0x15f8('0x152')]=function(_0x203c4a,_0x1fecae){var _0x311acf=this;var _0x14ac76=uuid['v4']();this[_0x15f8('0xe5')][_0x14ac76]=new Action(_0x203c4a,_0x1fecae,_0x14ac76);return new Promise(function(_0x460239,_0x7c9593){if(_[_0x15f8('0x39')](_0x203c4a)&&typeof _0x203c4a!==_0x15f8('0x153')){return _0x7c9593(msgResponse(_0x15f8('0x154'),_0x15f8('0x86'),_0x15f8('0x155')));}if(_[_0x15f8('0x39')](_0x1fecae[_0x15f8('0x156')])||_0x1fecae['phone']===null){return _0x7c9593(msgResponse(_0x15f8('0x154'),_0x15f8('0x86'),_0x15f8('0x157')));}var _0x586f10={'XMD-CALLERID':_0x311acf[_0x15f8('0xe5')][_0x14ac76]['getCaller'](),'XMD-AGI':_0x203c4a[_0x15f8('0x127')]?util[_0x15f8('0x3d')](_0x15f8('0x158'),ipAgi,_0x203c4a[_0x15f8('0x127')]):_0x15f8('0x159'),'XMD-AGIAFTER':_0x203c4a['dialQueueProject2']?util[_0x15f8('0x3d')](_0x15f8('0x158'),ipAgi,_0x203c4a[_0x15f8('0xbd')]):_0x15f8('0x159'),'XMD-QUEUE':utils[_0x15f8('0x15a')](_0x203c4a)?util['format'](_0x15f8('0x15b'),_0x203c4a[_0x15f8('0x3e')],_0x203c4a[_0x15f8('0x15c')]||'',_0x203c4a['dialAgiAfterHangupAgent']?'c':'',_0x203c4a[_0x15f8('0xc3')]||0x3):_0x15f8('0x159'),'XMD-CONTACTID':_0x1fecae[_0x15f8('0xd2')],'XMD-CDRTYPE':_0x15f8('0x15d'),'CALLERID(all)':_0x311acf[_0x15f8('0xe5')][_0x14ac76][_0x15f8('0x15e')](),'XMD-AMD':_0x203c4a[_0x15f8('0x10c')]?_0x15f8('0x135'):_0x15f8('0x159'),'XMD-DESTINATION':_0x15f8('0x15f')};if(_0x203c4a[_0x15f8('0x10c')]){_0x586f10['XMD-AMDINITIALSILENCE']=_0x203c4a[_0x15f8('0x160')]||0x9c4;_0x586f10[_0x15f8('0x161')]=_0x203c4a[_0x15f8('0x162')]||0x5dc;_0x586f10[_0x15f8('0x163')]=_0x203c4a[_0x15f8('0x164')]||0x320;_0x586f10[_0x15f8('0x165')]=_0x203c4a[_0x15f8('0x166')]||0x1388;_0x586f10[_0x15f8('0x167')]=_0x203c4a[_0x15f8('0x168')]||0x64;_0x586f10[_0x15f8('0x169')]=_0x203c4a[_0x15f8('0x16a')]||0x32;_0x586f10[_0x15f8('0x16b')]=_0x203c4a[_0x15f8('0x16c')]||0x3;_0x586f10[_0x15f8('0x16d')]=_0x203c4a[_0x15f8('0x16e')]||0x100;_0x586f10[_0x15f8('0x16f')]=_0x203c4a['dialAMDMaximumWordLength']||0x1388;}if(utils[_0x15f8('0x15a')](_0x203c4a)){_0x586f10[_0x15f8('0x170')]=_0x1fecae['VoiceQueueId'];}else{_0x586f10[_0x15f8('0x171')]=_0x1fecae[_0x15f8('0xd4')];}for(var _0xbd6f02 in _0x1fecae['Contact']){if(typeof _0x1fecae['Contact'][_0xbd6f02]!==_0x15f8('0x9e')){if(isNotNull(_0x1fecae[_0x15f8('0x172')][_0xbd6f02])&&_0xbd6f02!=='id'&&_0xbd6f02!==_0x15f8('0x173')&&_0xbd6f02!==_0x15f8('0x174')&&_0xbd6f02!=='updatedAt'){_0x586f10[util[_0x15f8('0x3d')](_0x15f8('0x175'),_0x15f8('0x176'),_[_0x15f8('0x177')](_0xbd6f02))]=_0x1fecae[_0x15f8('0x172')][_0xbd6f02];}}}var _0x45fb83=_0x311acf[_0x15f8('0x7b')](_0x203c4a[_0x15f8('0x7f')])?utils[_0x15f8('0x178')](_0x203c4a[_0x15f8('0x7f')]['callerid'],_0x203c4a[_0x15f8('0x179')],_0x203c4a['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0x15f8('0x17a')](_0x203c4a[_0x15f8('0x17b')],_0x203c4a[_0x15f8('0x17c')]):_0x203c4a[_0x15f8('0x17b')]):utils[_0x15f8('0x178')](_[_0x15f8('0xec')](_0x203c4a[_0x15f8('0x80')])?_0x203c4a[_0x15f8('0x7f')][_0x15f8('0x17d')]:_0x203c4a['TrunkBackup'][_0x15f8('0x17d')],_0x203c4a['dialOriginateCallerIdName'],_0x203c4a[_0x15f8('0x17c')]>0x0?utils[_0x15f8('0x17a')](_0x203c4a[_0x15f8('0x17b')],_0x203c4a[_0x15f8('0x17c')]):_0x203c4a[_0x15f8('0x17b')]);if(_0x45fb83){_0x586f10[_0x15f8('0x17e')]=_0x311acf['actions'][_0x14ac76][_0x15f8('0x17f')]=utils[_0x15f8('0x180')](_0x45fb83);_0x586f10['XMD-ORIGINATECALLERIDNUM']=_0x1fecae['phone'];}_0x203c4a[_0x15f8('0x181')]=_0x586f10;return ami[_0x15f8('0x93')]({'actionid':_0x14ac76,'action':_0x15f8('0x154'),'channel':_0x311acf[_0x15f8('0x7b')](_0x203c4a['Trunk'])?util[_0x15f8('0x3d')]('SIP/%s/%s%s',_0x203c4a['Trunk'][_0x15f8('0x3e')],isNotNull(_0x203c4a['dialPrefix'])?_0x203c4a[_0x15f8('0x182')][_0x15f8('0x183')]()||'':'',_0x203c4a[_0x15f8('0x184')]>0x0?_0x1fecae[_0x15f8('0x156')]['substring'](_0x203c4a['dialCutDigit']):_0x1fecae['phone']):util['format'](_0x15f8('0x185'),_[_0x15f8('0xec')](_0x203c4a[_0x15f8('0x80')])?_0x203c4a['Trunk'][_0x15f8('0x3e')]:_0x203c4a[_0x15f8('0x80')][_0x15f8('0x3e')],isNotNull(_0x203c4a['dialPrefix'])?_0x203c4a['dialPrefix'][_0x15f8('0x183')]()||'':'',_0x203c4a['dialCutDigit']>0x0?_0x1fecae[_0x15f8('0x156')][_0x15f8('0x186')](_0x203c4a[_0x15f8('0x184')]):_0x1fecae['phone']),'callerid':_0x45fb83,'Exten':_0x15f8('0x15f'),'Context':_0x15f8('0x187'),'Priority':'1','variable':_0x586f10,'timeout':(_0x203c4a[_0x15f8('0x188')]||0x1e)*0x3e8,'async':!![],'channelid':_0x14ac76})[_0x15f8('0x37')](function(_0x4652af){return _0x460239(_0x4652af);})[_0x15f8('0x92')](function(_0x627760){_0x203c4a[_0x15f8('0x189')]+=0x1;var _0x270d91=new History(_0x311acf[_0x15f8('0xe5')][_0x14ac76]);logger[_0x15f8('0x5f')](util[_0x15f8('0x3d')](_0x15f8('0x18a'),JSON['stringify'](_0x627760)));_0x270d91[_0x15f8('0x66')]=0xe;_0x270d91['statedesc']=_0x15f8('0x18b');_0x270d91[_0x15f8('0xd5')]=moment()['format'](_0x15f8('0xb8'));_0x270d91[_0x15f8('0x68')]=_0x270d91['starttime'];hopperUtils['createHistory'](_0x270d91)[_0x15f8('0x92')](loggerCatch(_0x15f8('0x18c')));_0x311acf['moveContactManagedDialer'](_0x270d91)[_0x15f8('0x92')](loggerCatch('[originate][error]'))[_0x15f8('0xf7')](function(){delete _0x311acf[_0x15f8('0xe5')][_0x14ac76];return _0x7c9593(msgResponse(_0x15f8('0x154'),_0x15f8('0x7a'),_0x15f8('0x18d')));});});});};Dialer[_0x15f8('0x15')][_0x15f8('0x18e')]=function(_0x46b6a,_0x29369f,_0x19dee7){var _0x2cb374=new History(_0x29369f);if(_0x2cb374[_0x15f8('0x11f')]+_0x2cb374[_0x15f8('0x112')]+_0x2cb374[_0x15f8('0x113')]+_0x2cb374[_0x15f8('0x120')]+_0x2cb374[_0x15f8('0xc9')]+_0x2cb374[_0x15f8('0xdd')]+_0x2cb374[_0x15f8('0x10f')]+_0x2cb374['countagentrejectretry']>=_0x19dee7['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x46b6a){case 0x3:if(_0x2cb374['countnoanswerretry']>=_0x19dee7['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0x15f8('0xce')]({'active':![],'countnoanswerretry':_0x2cb374[_0x15f8('0x113')]+=0x1,'scheduledat':moment()[_0x15f8('0xcf')](_0x19dee7[_0x15f8('0x18f')],_0x15f8('0xd1'))[_0x15f8('0x3d')](_0x15f8('0xb8')),'ContactId':_0x2cb374[_0x15f8('0xd2')],'ListId':_0x2cb374[_0x15f8('0xe1')],'VoiceQueueId':_0x2cb374[_0x15f8('0xd3')]||undefined,'CampaignId':_0x2cb374[_0x15f8('0xd4')]||undefined})['catch'](loggerCatch(_0x15f8('0x190')));break;case 0x5:if(_0x2cb374[_0x15f8('0x11f')]>=_0x19dee7[_0x15f8('0x191')]-0x1){return!![];}hopperUtils[_0x15f8('0xce')]({'active':![],'countbusyretry':_0x2cb374[_0x15f8('0x11f')]+=0x1,'scheduledat':moment()[_0x15f8('0xcf')](_0x19dee7[_0x15f8('0x192')],'minutes')[_0x15f8('0x3d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2cb374[_0x15f8('0xd2')],'ListId':_0x2cb374[_0x15f8('0xe1')],'VoiceQueueId':_0x2cb374[_0x15f8('0xd3')]||undefined,'CampaignId':_0x2cb374[_0x15f8('0xd4')]||undefined})[_0x15f8('0x92')](loggerCatch(_0x15f8('0x193')));break;case 0x8:if(_0x2cb374[_0x15f8('0x112')]>=_0x19dee7[_0x15f8('0x194')]-0x1){return!![];}hopperUtils[_0x15f8('0xce')]({'active':![],'countcongestionretry':_0x2cb374['countcongestionretry']+=0x1,'scheduledat':moment()[_0x15f8('0xcf')](_0x19dee7[_0x15f8('0x195')],_0x15f8('0xd1'))['format'](_0x15f8('0xb8')),'ContactId':_0x2cb374[_0x15f8('0xd2')],'ListId':_0x2cb374['ListId'],'VoiceQueueId':_0x2cb374[_0x15f8('0xd3')]||undefined,'CampaignId':_0x2cb374[_0x15f8('0xd4')]||undefined})[_0x15f8('0x92')](loggerCatch(_0x15f8('0x196')));break;case 0x0:if(_0x2cb374[_0x15f8('0x120')]>=_0x19dee7['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{hopperUtils[_0x15f8('0xce')]({'active':![],'countnosuchnumberretry':_0x2cb374['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x15f8('0xcf')](_0x19dee7[_0x15f8('0x197')],_0x15f8('0xd1'))[_0x15f8('0x3d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2cb374['ContactId'],'ListId':_0x2cb374[_0x15f8('0xe1')],'VoiceQueueId':_0x2cb374[_0x15f8('0xd3')]||undefined,'CampaignId':_0x2cb374['CampaignId']||undefined})[_0x15f8('0x92')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x2cb374[_0x15f8('0xc9')]>=_0x19dee7[_0x15f8('0x198')]-0x1){return!![];}hopperUtils[_0x15f8('0xce')]({'active':![],'countdropretry':_0x2cb374[_0x15f8('0xc9')]+=0x1,'scheduledat':moment()[_0x15f8('0xcf')](_0x19dee7[_0x15f8('0xd0')],'minutes')['format'](_0x15f8('0xb8')),'ContactId':_0x2cb374[_0x15f8('0xd2')],'ListId':_0x2cb374[_0x15f8('0xe1')],'VoiceQueueId':_0x2cb374[_0x15f8('0xd3')]||undefined,'CampaignId':_0x2cb374[_0x15f8('0xd4')]||undefined})[_0x15f8('0x92')](loggerCatch(_0x15f8('0x199')));break;case 0xb:if(_0x2cb374['countabandonedretry']>=_0x19dee7[_0x15f8('0xe0')]-0x1){return!![];}hopperUtils[_0x15f8('0xce')]({'active':![],'countabandonedretry':_0x2cb374[_0x15f8('0xdd')]+=0x1,'scheduledat':moment()['add'](_0x19dee7[_0x15f8('0x19a')],_0x15f8('0xd1'))[_0x15f8('0x3d')](_0x15f8('0xb8')),'ContactId':_0x2cb374['ContactId'],'ListId':_0x2cb374['ListId'],'VoiceQueueId':_0x2cb374[_0x15f8('0xd3')]||undefined,'CampaignId':_0x2cb374[_0x15f8('0xd4')]||undefined})['catch'](loggerCatch(_0x15f8('0xe2')));break;case 0x13:if(_0x2cb374[_0x15f8('0x10f')]>=_0x19dee7[_0x15f8('0x117')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x2cb374[_0x15f8('0x10f')]+=0x1,'scheduledat':moment()[_0x15f8('0xcf')](_0x19dee7[_0x15f8('0x119')],_0x15f8('0xd1'))['format'](_0x15f8('0xb8')),'ContactId':_0x2cb374[_0x15f8('0xd2')],'ListId':_0x2cb374[_0x15f8('0xe1')],'VoiceQueueId':_0x2cb374[_0x15f8('0xd3')]||undefined,'CampaignId':_0x2cb374[_0x15f8('0xd4')]||undefined})['catch'](loggerCatch(_0x15f8('0x11a')));break;case 0x14:if(_0x2cb374['countagentrejectretry']>=_0x19dee7['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countagentrejectretry':_0x2cb374[_0x15f8('0x114')]+=0x1,'scheduledat':moment()[_0x15f8('0xcf')](_0x19dee7[_0x15f8('0x19b')],_0x15f8('0xd1'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2cb374['ContactId'],'ListId':_0x2cb374[_0x15f8('0xe1')],'VoiceQueueId':_0x2cb374[_0x15f8('0xd3')]||undefined,'CampaignId':_0x2cb374[_0x15f8('0xd4')]||undefined})[_0x15f8('0x92')](loggerCatch(_0x15f8('0x19c')));break;default:return!![];}};Dialer[_0x15f8('0x15')]['callProgressDetecting']=function(_0xaa8666,_0x43a17c,_0x50d77f){var _0x3f8bc1=this;var _0x513c0a=new History(_0xaa8666);var _0x25366=![];var _0x178f99;var _0x454c31;return new Promise(function(_0x5e18af,_0x4982b5){if(_[_0x15f8('0x39')](_0x43a17c)&&typeof _0x43a17c!=='object'){return _0x4982b5(msgResponse(_0x15f8('0x19d'),'Failure',_0x15f8('0x19e')));}if(_[_0x15f8('0x39')](_0x50d77f)&&typeof _0x50d77f!==_0x15f8('0x153')){return _0x4982b5(msgResponse(_0x15f8('0x19d'),_0x15f8('0x86'),_0x15f8('0x19f')));}hopperUtils[_0x15f8('0xcb')](_0x513c0a,_0x50d77f['reason'],_0x43a17c)[_0x15f8('0x37')](function(_0xa3cd98){if(_0xa3cd98['additional']==0x1)_0x25366=!![];switch(_0x50d77f[_0x15f8('0x1a0')]){case'0':_0x43a17c[_0x15f8('0x1a1')]+=0x1;_0x513c0a[_0x15f8('0x66')]=0x0;_0x513c0a[_0x15f8('0x67')]='NoSuchNumber';_0x513c0a['countnosuchnumberretry']+=0x1;_0x513c0a[_0x15f8('0xca')]+=0x1;ami[_0x15f8('0x109')]('custom:agentnosuchnumber',ut['buildObj'](_0xaa8666,_0x15f8('0x1a2')));_0x178f99=_0x43a17c[_0x15f8('0x197')];_0x454c31=_0x43a17c[_0x15f8('0xde')];hopperUtils[_0x15f8('0xbf')](_0x513c0a)['catch'](loggerCatch(_0x15f8('0x11e')));if(_0x3f8bc1[_0x15f8('0x18e')](0x0,_0xaa8666,_0x43a17c)&&!_0x25366){if(_0x513c0a[_0x15f8('0x120')]>=_0x43a17c['dialNoSuchNumberMaxRetry']){_0x3f8bc1[_0x15f8('0x122')](_0x513c0a,_0x5e18af,_0x4982b5,_0x15f8('0x1a3'));}else{_0x3f8bc1[_0x15f8('0x115')](_0x513c0a,_0x5e18af,_0x4982b5,_0x15f8('0x1a3'));}}break;case'3':_0x43a17c[_0x15f8('0x1a4')]+=0x1;_0x513c0a[_0x15f8('0x66')]=0x3;_0x513c0a['statedesc']='NoAnswer';_0x513c0a[_0x15f8('0x113')]+=0x1;_0x513c0a[_0x15f8('0xca')]+=0x1;var _0x1c0fe3=ut[_0x15f8('0x1a5')](_0xaa8666,_0x43a17c);ami[_0x15f8('0x109')](_0x15f8('0x1a6'),_0x1c0fe3);_0x178f99=_0x43a17c[_0x15f8('0x18f')];_0x454c31=_0x43a17c[_0x15f8('0xde')];hopperUtils[_0x15f8('0xbf')](_0x513c0a)[_0x15f8('0x92')](loggerCatch(_0x15f8('0x1a7')));if(_0x3f8bc1[_0x15f8('0x18e')](0x3,_0xaa8666,_0x43a17c)&&!_0x25366){if(_0x513c0a[_0x15f8('0x113')]>=_0x43a17c['dialNoAnswerMaxRetry']){_0x3f8bc1[_0x15f8('0x122')](_0x513c0a,_0x5e18af,_0x4982b5,_0x15f8('0x1a8'));}else{_0x3f8bc1[_0x15f8('0x115')](_0x513c0a,_0x5e18af,_0x4982b5,_0x15f8('0x1a8'));}}break;case'5':_0x43a17c['outboundBusyCallsDay']+=0x1;_0x513c0a['state']=0x5;_0x513c0a[_0x15f8('0x67')]=_0x15f8('0x1a9');_0x513c0a['countbusyretry']+=0x1;_0x513c0a['countglobal']+=0x1;ami[_0x15f8('0x109')](_0x15f8('0x1aa'),ut[_0x15f8('0x110')](_0xaa8666,_0x15f8('0x1ab')));_0x178f99=_0x43a17c[_0x15f8('0x192')];_0x454c31=_0x43a17c['callAdditionalPhoneAfterMin'];hopperUtils[_0x15f8('0xbf')](_0x513c0a)[_0x15f8('0x92')](loggerCatch(_0x15f8('0x1ac')));if(_0x3f8bc1[_0x15f8('0x18e')](0x5,_0xaa8666,_0x43a17c)&&!_0x25366){if(_0x513c0a[_0x15f8('0x11f')]>=_0x43a17c[_0x15f8('0x191')]){_0x3f8bc1[_0x15f8('0x122')](_0x513c0a,_0x5e18af,_0x4982b5,_0x15f8('0x1ad'));}else{_0x3f8bc1[_0x15f8('0x115')](_0x513c0a,_0x5e18af,_0x4982b5,_0x15f8('0x1ad'));}}break;case'8':_0x43a17c[_0x15f8('0x1ae')]+=0x1;_0x513c0a[_0x15f8('0x66')]=0x8;_0x513c0a[_0x15f8('0x67')]='Congestion';_0x513c0a['countcongestionretry']+=0x1;_0x513c0a[_0x15f8('0xca')]+=0x1;_0x178f99=_0x43a17c[_0x15f8('0x195')];_0x454c31=_0x43a17c[_0x15f8('0xde')];ami['emit'](_0x15f8('0x1af'),ut[_0x15f8('0x110')](_0xaa8666,_0x15f8('0x1b0')));hopperUtils[_0x15f8('0xbf')](_0x513c0a)[_0x15f8('0x92')](loggerCatch(_0x15f8('0x1b1')));if(_0x3f8bc1['checkRetriveMax'](0x8,_0xaa8666,_0x43a17c)&&!_0x25366){if(_0x513c0a[_0x15f8('0x112')]>=_0x43a17c[_0x15f8('0x194')]){_0x3f8bc1[_0x15f8('0x122')](_0x513c0a,_0x5e18af,_0x4982b5,'reason\x208\x20congestion');}else{_0x3f8bc1[_0x15f8('0x115')](_0x513c0a,_0x5e18af,_0x4982b5,_0x15f8('0x1b2'));}}break;case'11':_0x43a17c[_0x15f8('0x1b3')]+=0x1;_0x513c0a[_0x15f8('0x66')]=0xb;_0x513c0a['statedesc']='Abandoned';_0x513c0a[_0x15f8('0xdd')]+=0x1;_0x513c0a[_0x15f8('0xca')]+=0x1;_0x178f99=_0x43a17c[_0x15f8('0x19a')];_0x454c31=_0x43a17c[_0x15f8('0xde')];hopperUtils['createHistory'](_0x513c0a)['catch'](loggerCatch(_0x15f8('0xe3')));if(_0x3f8bc1[_0x15f8('0x18e')](0xb,_0xaa8666,_0x43a17c)&&!_0x25366){if(_0x513c0a[_0x15f8('0xdd')]>=_0x43a17c['dialAbandonedMaxRetry']){_0x3f8bc1[_0x15f8('0x122')](_0x513c0a,_0x5e18af,_0x4982b5,_0x15f8('0x1b4'));}else{_0x3f8bc1[_0x15f8('0x115')](_0x513c0a,_0x5e18af,_0x4982b5,'reason\x2011\x20abandoned');}}break;case'20':_0x43a17c['outboundRejectCallsDay']+=0x1;_0x513c0a['state']=0x14;_0x513c0a[_0x15f8('0x67')]='AgentReject';_0x513c0a[_0x15f8('0x114')]+=0x1;_0x513c0a['countglobal']+=0x1;_0x178f99=_0x43a17c['dialAgentRejectRetryFrequency'];_0x454c31=_0x43a17c['callAdditionalPhoneAfterMin'];ami[_0x15f8('0x109')](_0x15f8('0x1b5'),ut['buildObj'](_0xaa8666,_0x15f8('0x1b6')));hopperUtils[_0x15f8('0xbf')](_0x513c0a)[_0x15f8('0x92')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x3f8bc1[_0x15f8('0x18e')](0x14,_0xaa8666,_0x43a17c)&&!_0x25366){if(_0x513c0a[_0x15f8('0x114')]>=_0x43a17c[_0x15f8('0x1b7')]){_0x3f8bc1[_0x15f8('0x122')](_0x513c0a,_0x5e18af,_0x4982b5,_0x15f8('0x1b8'));}else{_0x3f8bc1[_0x15f8('0x115')](_0x513c0a,_0x5e18af,_0x4982b5,'reason\x2020\x20agentreject');}}break;default:_0x43a17c[_0x15f8('0x129')]+=0x1;_0x513c0a[_0x15f8('0x66')]=0xc;_0x513c0a['statedesc']=_0x50d77f[_0x15f8('0x1a0')];_0x178f99=_0x43a17c[_0x15f8('0x19b')];_0x454c31=_0x43a17c['callAdditionalPhoneAfterMin'];hopperUtils[_0x15f8('0xbf')](_0x513c0a)[_0x15f8('0x92')](loggerCatch(_0x15f8('0x1b9')));if(_0x3f8bc1[_0x15f8('0x18e')](_0x50d77f['reason'],_0xaa8666,_0x43a17c)&&!_0x25366){if(_0x513c0a['countbusyretry']+_0x513c0a[_0x15f8('0x112')]+_0x513c0a[_0x15f8('0x113')]+_0x513c0a[_0x15f8('0x120')]+_0x513c0a[_0x15f8('0xc9')]+_0x513c0a[_0x15f8('0xdd')]+_0x513c0a[_0x15f8('0x10f')]+_0x513c0a[_0x15f8('0x114')]>=_0x43a17c['dialGlobalMaxRetry']){_0x3f8bc1[_0x15f8('0x115')](_0x513c0a,_0x5e18af,_0x4982b5,_0x50d77f['reason']);}else{_0x3f8bc1['createStateFinal'](_0x513c0a,_0x5e18af,_0x4982b5,_0x50d77f[_0x15f8('0x1a0')]);}}}})[_0x15f8('0x37')](function(){if(_0x25366){hopperUtils[_0x15f8('0xd9')](_0x513c0a,_0x178f99,_0x454c31)[_0x15f8('0x37')](function(){return _0x5e18af(0x1);});}});});};Dialer['prototype'][_0x15f8('0x115')]=function(_0x5e70e3,_0x29b006,_0xebdaa9,_0x5b3cf8){var _0x338c7c=new Final(_0x5e70e3);_0x338c7c['state']=0xf;_0x338c7c[_0x15f8('0x67')]=_0x15f8('0x1ba');this[_0x15f8('0x122')](_0x338c7c,_0x29b006,_0xebdaa9,_0x5b3cf8);};Dialer[_0x15f8('0x15')]['createStateFinal']=function(_0x43fcbf,_0x2b84b5,_0x475046,_0x216715){hopperUtils[_0x15f8('0x125')](_0x43fcbf)[_0x15f8('0x37')](function(){return _0x2b84b5(msgResponse(_0x15f8('0x19d'),_0x15f8('0xff'),_0x216715));})[_0x15f8('0x92')](function(){return _0x475046(msgResponse(_0x15f8('0x1bb'),_0x15f8('0x86'),'contact\x20not\x20moved'));});};Dialer[_0x15f8('0x15')][_0x15f8('0xa7')]=function(_0x5c5df9){var _0x2cd9f5=_0x5c5df9[_0x15f8('0x1bc')]/0x64;var _0x2efcf7=_0x5c5df9[_0x15f8('0xc4')]/(_0x5c5df9['outboundDropCallsDayTimeout']+_0x5c5df9[_0x15f8('0xba')]);var _0x4fbac0=Math['round'](_0x5c5df9[_0x15f8('0x1bd')]*(_0x5c5df9['predictiveIntervalMaxThreshold']/0x64));var _0x3c450d=Math[_0x15f8('0x1be')](_0x5c5df9[_0x15f8('0x1bd')]*(_0x5c5df9[_0x15f8('0x1bf')]/0x64));var _0x3800dd=_0x5c5df9['available']+_0x5c5df9[_0x15f8('0x133')];var _0x140bf7=Math[_0x15f8('0x1c0')](_0x5c5df9[_0x15f8('0x52')]*_0x5c5df9[_0x15f8('0x56')]*_0x5c5df9[_0x15f8('0x1c1')]*_0x5c5df9[_0x15f8('0x1c2')]);if(_[_0x15f8('0x39')](_0x5c5df9['startProgressive'])){if(!_[_0x15f8('0x39')](_0x5c5df9[_0x15f8('0x23')])){_0x5c5df9[_0x15f8('0x23')]=undefined;loggerPredictive[_0x15f8('0x5f')](_0x15f8('0x1c3'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x15f8('0x39')](_0x5c5df9[_0x15f8('0x5d')])){loggerPredictive['error'](_0x15f8('0x1c3'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x5c5df9[_0x15f8('0x5d')]);_0x5c5df9[_0x15f8('0x5d')]=undefined;}_0x5c5df9[_0x15f8('0x5a')]=moment()[_0x15f8('0x3d')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x5c5df9['name'],_0x15f8('0x1c4'),_0x5c5df9['startProgressive']);this[_0x15f8('0xa9')](_0x5c5df9,0x1);}else if(ifInterval(_0x5c5df9['dialPredictiveInterval'],_0x5c5df9['startProgressive'])){this[_0x15f8('0xa9')](_0x5c5df9,0x1);loggerPredictiveCalls[_0x15f8('0x41')](_0x15f8('0x1c5'),_0x5c5df9['startProgressive'],_0x5c5df9['name']);_0x5c5df9[_0x15f8('0x52')]=0x0;_0x5c5df9[_0x15f8('0xc5')]=0x0;}else if(_0x2cd9f5<_0x2efcf7&&_0x5c5df9[_0x15f8('0x1c6')]==='dropRate'){clearPredictiveAttributes(_0x5c5df9);loggerPredictive[_0x15f8('0x41')](_0x15f8('0x1c7'),_0x15f8('0x1c8'),_0x2efcf7,_0x15f8('0x5a'),_0x5c5df9['name']);}else if(_0x140bf7<_0x5c5df9['predictiveIntervalErlangCallsDroppedCalls']&&_0x5c5df9[_0x15f8('0x1c6')]===_0x15f8('0x1c9')){clearPredictiveAttributes(_0x5c5df9);loggerPredictive[_0x15f8('0x41')](_0x15f8('0x1ca'),'Max\x20Drop\x20',_0x140bf7,_0x15f8('0x1cb'),_0x5c5df9[_0x15f8('0xc5')],_0x15f8('0x5a'),_0x5c5df9[_0x15f8('0x3e')]);}else if(!ifInterval(_0x5c5df9[_0x15f8('0x1cc')],_0x5c5df9[_0x15f8('0x5a')])&&_[_0x15f8('0x39')](_0x5c5df9['startPredictive'])&&!_[_0x15f8('0x39')](_0x5c5df9[_0x15f8('0x5a')])){_0x5c5df9[_0x15f8('0x23')]=moment()[_0x15f8('0x3d')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x5c5df9[_0x15f8('0x3e')],_0x15f8('0x1cd'),_0x5c5df9[_0x15f8('0x23')]);hopperUtils['avgHandleTime'](_0x5c5df9[_0x15f8('0x1cc')])[_0x15f8('0x37')](this[_0x15f8('0x1ce')](_0x5c5df9))[_0x15f8('0x37')](mergeDataErlangB(_0x5c5df9))[_0x15f8('0x37')](this[_0x15f8('0x1cf')](_0x5c5df9))[_0x15f8('0x92')](loggerCatchPredictive(_0x15f8('0x1d0'),_0x5c5df9));}else if(!ifInterval(_0x5c5df9[_0x15f8('0x1cc')],_0x5c5df9['startPredictive'])){_0x5c5df9[_0x15f8('0xc5')]=0x0;_0x5c5df9[_0x15f8('0x23')]=moment()[_0x15f8('0x3d')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x15f8('0x41')](_0x5c5df9[_0x15f8('0x3e')],_0x15f8('0x1d1'),_0x5c5df9[_0x15f8('0x23')]);clearInterval(_0x5c5df9[_0x15f8('0x5d')]);_0x5c5df9[_0x15f8('0x5d')]=undefined;hopperUtils['avgHandleTime'](_0x5c5df9[_0x15f8('0x1cc')])['then'](this[_0x15f8('0x1ce')](_0x5c5df9))[_0x15f8('0x37')](mergeDataErlangB(_0x5c5df9))[_0x15f8('0x37')](this[_0x15f8('0x1cf')](_0x5c5df9))[_0x15f8('0x92')](loggerCatchPredictive(_0x15f8('0x1d2'),_0x5c5df9));}else if(_0x5c5df9[_0x15f8('0x1bd')]&&_0x3800dd<_0x5c5df9['predictiveIntervalAvailable']-_0x3c450d){clearPredictiveAttributes(_0x5c5df9);loggerPredictive[_0x15f8('0x41')](_0x5c5df9[_0x15f8('0x3e')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x3800dd,_0x15f8('0x1d3'),_0x5c5df9[_0x15f8('0x1bd')],'-',_0x3c450d,'=',_0x5c5df9[_0x15f8('0x1bd')]-_0x3c450d,')');}else if(_0x5c5df9[_0x15f8('0x1bd')]&&_0x3800dd>_0x5c5df9[_0x15f8('0x1bd')]+_0x4fbac0){clearPredictiveAttributes(_0x5c5df9);loggerPredictive['info'](_0x5c5df9[_0x15f8('0x3e')],_0x15f8('0x1d4'),_0x3800dd,_0x15f8('0x1d5'),_0x5c5df9['predictiveIntervalAvailable'],'+',_0x4fbac0,'=',_0x5c5df9[_0x15f8('0x1bd')]+_0x4fbac0,')');}};Dialer[_0x15f8('0x15')][_0x15f8('0x1ce')]=function(_0x27f782){var _0xad5317=this;return function(_0x3cdf7f){return new Promise(function(_0x3295bc,_0x5b04a4){_['merge'](_0x27f782,_0x3cdf7f[0x0]);if(checkGetDataPredictive(_0x3cdf7f[0x0])){var _0x2eb362=_0x27f782[_0x15f8('0x1bd')]=_0x27f782['talking']+_0x27f782[_0x15f8('0x1d6')];var _0x45c9df=_0x27f782[_0x15f8('0x1cc')]*0x3c;var _0xd9cfc8=_0x3cdf7f[0x0][_0x15f8('0x4a')]+_0x3cdf7f[0x0][_0x15f8('0x4d')];var _0x438440=(_0x3cdf7f[0x0][_0x15f8('0x44')]+_0x3cdf7f[0x0][_0x15f8('0x46')]+_0x3cdf7f[0x0][_0x15f8('0x48')])/_0x3cdf7f[0x0][_0x15f8('0x4c')];_0x27f782['predictiveIntervalHitRate']=_0x438440>0x0?_0x438440:0x1;switch(_0x27f782[_0x15f8('0x1c6')]){case _0x15f8('0x1c9'):var _0x5d295a=_0x27f782[_0x15f8('0x1bc')]/0x64;return _0xad5317[_0x15f8('0x1d7')](_0x2eb362,_0x45c9df,_0xd9cfc8,_0x438440,_0x5d295a)[_0x15f8('0x37')](function(_0x7a618f){return _0x3295bc(_0x7a618f);});case'agentBusyFactor':var _0x96f777=_0x27f782['dialPredictiveOptimizationPercentage']/0x64;return _0xad5317[_0x15f8('0x1d8')](_0x2eb362,_0x45c9df,_0xd9cfc8,_0x438440,_0x96f777)['then'](function(_0x228529){return _0x3295bc(_0x228529);});default:return _0x5b04a4(msgResponse(_0x15f8('0x1d9'),'Failure','Unknown\x20Predictive'));}}else{return _0x5b04a4(msgResponse(_0x15f8('0x1d9'),_0x15f8('0x86'),_0x15f8('0x1da')));}});};};Dialer[_0x15f8('0x15')]['getDataPredictiveOld']=function(_0x1b0c28){var _0x145ae0=this;return function(_0x25d9d0){return new Promise(function(_0x190f6e,_0x479825){_[_0x15f8('0x58')](_0x1b0c28,_0x25d9d0[0x0]);if(checkGetDataPredictive(_0x25d9d0[0x0])){loggerPredictive['info'](JSON[_0x15f8('0x6b')](_0x25d9d0[0x0]));if(_0x1b0c28['dialPredictiveOptimization']==='dropRate'){return _0x145ae0[_0x15f8('0x14b')](_0x1b0c28['id'])[_0x15f8('0x37')](function(_0x3056d9){var _0xa49e26=_0x1b0c28[_0x15f8('0x1db')]-_0x3056d9[0x0][_0x15f8('0x1dc')];var _0x1c5b58=_0x1b0c28['dialPredictiveInterval']*0x3c;var _0x2cd19e=_0x25d9d0[0x0][_0x15f8('0x4a')]+_0x25d9d0[0x0][_0x15f8('0x4d')];var _0x5f17ed=(_0x25d9d0[0x0]['predictiveIntervalAnsweredCalls']+_0x25d9d0[0x0][_0x15f8('0x46')]+_0x25d9d0[0x0][_0x15f8('0x48')])/_0x25d9d0[0x0][_0x15f8('0x4c')];var _0x67841a=_0x1b0c28[_0x15f8('0x1bc')]/0x64;_0x1b0c28[_0x15f8('0x1dd')]=_0x3056d9[0x0][_0x15f8('0x1dc')]||0x0;_0x1b0c28[_0x15f8('0x1c1')]=_0x5f17ed>0x0?_0x5f17ed:0x1;return _0x145ae0[_0x15f8('0x1d7')](_0xa49e26,_0x1c5b58,_0x2cd19e,_0x5f17ed,_0x67841a);})[_0x15f8('0x37')](function(_0x3a4fd3){return _0x190f6e(_0x3a4fd3);})[_0x15f8('0x92')](function(_0x5a126b){return _0x479825(msgResponse(_0x15f8('0x1de'),_0x15f8('0x86'),JSON[_0x15f8('0x6b')](_0x5a126b)));});}if(_0x1b0c28['dialPredictiveOptimization']===_0x15f8('0x1df')){return _0x145ae0['getVoiceQueueRtPauses'](_0x1b0c28['id'])[_0x15f8('0x37')](function(_0x4e78f2){var _0x1b1ab4=_0x1b0c28[_0x15f8('0x1db')]-_0x4e78f2[0x0][_0x15f8('0x1dc')];var _0x5aae5e=_0x1b0c28[_0x15f8('0x1cc')]*0x3c;var _0x5936d4=_0x25d9d0[0x0][_0x15f8('0x4a')]+_0x25d9d0[0x0]['predictiveIntervalAvgHoldtime'];var _0x13cbed=(_0x25d9d0[0x0][_0x15f8('0x44')]+_0x25d9d0[0x0][_0x15f8('0x46')]+_0x25d9d0[0x0][_0x15f8('0x48')])/_0x25d9d0[0x0][_0x15f8('0x4c')];var _0x2cdb8d=_0x1b0c28[_0x15f8('0x1bc')]/0x64;_0x1b0c28[_0x15f8('0x1dd')]=_0x4e78f2[0x0][_0x15f8('0x1dc')]||0x0;_0x1b0c28['predictiveIntervalHitRate']=_0x13cbed>0x0?_0x13cbed:0x1;return _0x145ae0[_0x15f8('0x1d8')](_0x1b1ab4,_0x5aae5e,_0x5936d4,_0x13cbed,_0x2cdb8d);})[_0x15f8('0x37')](function(_0x510035){return _0x190f6e(_0x510035);})['catch'](function(_0x3bfcbf){return _0x479825(msgResponse(_0x15f8('0x1de'),_0x15f8('0x86'),JSON[_0x15f8('0x6b')](_0x3bfcbf)));});}}else{return _0x479825(msgResponse(_0x15f8('0x1d9'),'Failure','check\x20failure'));}});};};Dialer[_0x15f8('0x15')][_0x15f8('0x1cf')]=function(_0x76b00c){var _0x2ebdfc=this;return function(){var _0x90f1a7=0x0;var _0x32a614=Math[_0x15f8('0x1c0')](_0x76b00c[_0x15f8('0x54')]*0x3e8);if(_0x32a614>0x0){_0x32a614=_0x32a614<0x64?0x64:_0x32a614;loggerPredictive[_0x15f8('0x41')](_0x76b00c[_0x15f8('0x3e')],_0x15f8('0x1e0'),_0x32a614,'milliseconds');_0x76b00c[_0x15f8('0x5d')]=setInterval(function(){_0x2ebdfc[_0x15f8('0x5d')](_0x76b00c);loggerPredictiveCalls['info']('[handlePredictive]',_0x90f1a7+=0x1);},_0x32a614);}else{loggerPredictive[_0x15f8('0x41')](_0x76b00c[_0x15f8('0x3e')],_0x15f8('0x1e1'));}};};Dialer[_0x15f8('0x15')][_0x15f8('0x1e2')]=function(_0x3e37a2,_0x157b39){var _0x40ade9=this;return function(_0x1808fa){if(_[_0x15f8('0x40')](_0x1808fa)){if(_['isNil'](_0x157b39[_0x15f8('0x1e3')])||!_0x157b39['recallme']){if(_0x3e37a2[_0x15f8('0xa6')]==='booked'){_0x3e37a2['queueStatusComplete']=_[_0x15f8('0x39')](_0x3e37a2[_0x15f8('0x69')])?!![]:_0x3e37a2['queueStatusComplete'];var _0x454e01=uuid['v4']();_0x40ade9[_0x15f8('0xe5')][_0x454e01]=new Action(_0x3e37a2,_0x157b39,_0x454e01);loggerBooked['info'](_0x15f8('0x1e4'),_0x454e01,_0x15f8('0x1e5'),JSON['stringify'](_0x3e37a2[_0x15f8('0x69')]),_0x15f8('0x1e6'),_0x3e37a2['name']);if(_0x3e37a2['queueStatusComplete']){_0x3e37a2['queueStatusComplete']=![];_0x40ade9[_0x15f8('0x24')][_0x40ade9['actions'][_0x454e01][_0x15f8('0xb3')]]=[];ami[_0x15f8('0x93')]({'actionid':_0x454e01,'action':_0x15f8('0x1e7'),'queue':_0x3e37a2[_0x15f8('0x3e')]})[_0x15f8('0x92')](function(){_0x40ade9['updateOriginated'](_0x3e37a2);hopperUtils[_0x15f8('0xce')]({'active':![],'ContactId':_0x40ade9[_0x15f8('0xe5')][_0x454e01]['ContactId'],'ListId':_0x40ade9[_0x15f8('0xe5')][_0x454e01][_0x15f8('0xe1')],'VoiceQueueId':_0x40ade9[_0x15f8('0xe5')][_0x454e01][_0x15f8('0xd3')]||undefined,'CampaignId':_0x40ade9[_0x15f8('0xe5')][_0x454e01]['CampaignId']||undefined})[_0x15f8('0x92')](loggerCatch(_0x15f8('0x1e8')));delete _0x40ade9[_0x15f8('0xe5')][_0x454e01];});}else{loggerBooked[_0x15f8('0x41')](_0x15f8('0x1e9'),JSON[_0x15f8('0x6b')](_0x3e37a2['queueStatusComplete']),'Queue:\x20',_0x3e37a2['name']);_0x40ade9[_0x15f8('0xb6')](_0x3e37a2);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x40ade9[_0x15f8('0xe5')][_0x454e01][_0x15f8('0xd2')],'ListId':_0x40ade9[_0x15f8('0xe5')][_0x454e01][_0x15f8('0xe1')],'VoiceQueueId':_0x40ade9['actions'][_0x454e01][_0x15f8('0xd3')]||undefined,'CampaignId':_0x40ade9[_0x15f8('0xe5')][_0x454e01][_0x15f8('0xd4')]||undefined})[_0x15f8('0x92')](loggerCatch(_0x15f8('0x1e8')));delete _0x40ade9[_0x15f8('0xe5')][_0x454e01];}}else{return _0x40ade9[_0x15f8('0x152')](_0x3e37a2,_0x157b39);}}else{if(utils[_0x15f8('0x59')](undefined,_0x157b39[_0x15f8('0x1ea')])<_0x3e37a2[_0x15f8('0x1eb')]*0x3c){if(_0x157b39['Agent']&&!_0x157b39['Agent']['voicePause']){_0x40ade9['preview'][_0x15f8('0xf1')](_0x157b39['id'])[_0x15f8('0xf7')](function(){_0x40ade9[_0x15f8('0xb6')](_0x3e37a2);});}else{hopperUtils['unlockContact']({'active':![]},_0x157b39['id'],0x1)['finally'](function(){_0x40ade9[_0x15f8('0xb6')](_0x3e37a2);});}}else{_0x3e37a2[_0x15f8('0x1ec')]+=0x1;_0x40ade9[_0x15f8('0xb6')](_0x3e37a2);if(_0x3e37a2[_0x15f8('0x1ed')]){hopperUtils[_0x15f8('0xce')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x157b39['ContactId'],'ListId':_0x157b39[_0x15f8('0xe1')],'VoiceQueueId':_0x157b39[_0x15f8('0xd3')]||undefined,'CampaignId':_0x157b39['CampaignId']||undefined})[_0x15f8('0x92')](loggerCatch(_0x15f8('0x1ee')));hopperUtils[_0x15f8('0xbf')](createObjHistory(_0x3e37a2,_0x157b39,utils[_0x15f8('0x63')][_0x15f8('0x1ef')],0x17,'RecallInQueue'))[_0x15f8('0x92')](loggerCatch(_0x15f8('0x1f0')));}else{_0x40ade9['saveInDb'](createObjHistory(_0x3e37a2,_0x157b39,utils['CAMPAIGN_STATUS'][_0x15f8('0x1f1')],0x16,_0x15f8('0x1f2')),_0x15f8('0x1f3'),_0x15f8('0x1f4'));}}}}else{_0x3e37a2[_0x15f8('0x1f5')]+=0x1;_0x40ade9[_0x15f8('0x11c')](createObjHistory(_0x3e37a2,_0x157b39,utils[_0x15f8('0x63')][_0x15f8('0x1f6')],0xd,_0x15f8('0x1f7')),_0x15f8('0x1f8'),'[Originate][MoveBlacklist]');throw _0x15f8('0x1f9');}};};Dialer[_0x15f8('0x15')][_0x15f8('0x151')]=function(_0x559a20){var _0x26eb5b=this;var _0x194782=_0x559a20[_0x15f8('0x1fa')]-_0x559a20[_0x15f8('0x76')]-_0x559a20[_0x15f8('0x1fb')];emitCampaignSummary(_0x559a20);if(_0x194782>0x0){if(_0x194782>this[_0x15f8('0x1e')]){_0x194782=this['maxNumberOriginate'];}_0x559a20[_0x15f8('0x1fb')]+=_0x194782;hopperUtils[_0x15f8('0x1fc')](_0x559a20['id'],_0x194782,_0x559a20[_0x15f8('0x1fd')],_0x559a20)[_0x15f8('0x37')](function(_0xbf402c){_0x559a20[_0x15f8('0x1fb')]-=_0x194782;_0x559a20[_0x15f8('0x1fb')]=_0x559a20['temp']>0x0?_0x559a20[_0x15f8('0x1fb')]:0x0;if(!utils['checkContactEmpty'](_0xbf402c)){_0x559a20[_0x15f8('0x62')]=utils[_0x15f8('0x63')][_0x15f8('0x1fe')];logger[_0x15f8('0x41')](_0x15f8('0x1ff')+_0x559a20['name']);}else{_0x559a20[_0x15f8('0x76')]+=_0xbf402c[_0x15f8('0x13f')];_0x559a20['message']=utils[_0x15f8('0x63')][_0x15f8('0x200')];for(var _0x149f43=0x0;_0x149f43<_0xbf402c[_0x15f8('0x13f')];_0x149f43+=0x1){_0x559a20[_0x15f8('0x201')]+=0x1;if(_[_0x15f8('0xec')](_0xbf402c[_0x149f43])||_['isNil'](_0xbf402c[_0x149f43][_0x15f8('0x172')])||_['isNil'](_0xbf402c[_0x149f43][_0x15f8('0x156')])){_0x26eb5b['emptyContact'](_0x15f8('0x202'),_0x559a20,_0xbf402c[_0x149f43]);}else{hopperUtils[_0x15f8('0x203')](_['pick'](_0xbf402c[_0x149f43],[_0x15f8('0xd4'),'phone']))['then'](_0x26eb5b[_0x15f8('0x1e2')](_0x559a20,_0xbf402c[_0x149f43]))[_0x15f8('0x92')](_0x26eb5b[_0x15f8('0x204')]('[actionOriginateIvr]\x20',_0x559a20));}}}})['catch'](loggerGetContactDialer(_0x15f8('0x205'),_0x559a20,_0x194782));}};Dialer[_0x15f8('0x15')][_0x15f8('0xa9')]=function(_0x1fd30e,_0x47bc45){var _0x27a4f6=this;var _0x291012=[];if(_0x47bc45<0x1||_0x1fd30e['dialMethod']===_0x15f8('0x206')){_0x47bc45=0x1;}var _0x2ce1c9=Math[_0x15f8('0x1c0')](_0x1fd30e[_0x15f8('0x1d6')]*_0x47bc45)-_0x1fd30e[_0x15f8('0x76')]-_0x1fd30e['temp'];if(_0x1fd30e[_0x15f8('0x207')]>0x0){var _0x58a432=_0x1fd30e[_0x15f8('0x207')]-_0x1fd30e[_0x15f8('0x76')]-_0x1fd30e[_0x15f8('0x133')]-_0x1fd30e[_0x15f8('0x1fb')]-_0x1fd30e['pTalking'];if(_0x2ce1c9>_0x58a432){_0x2ce1c9=_0x58a432;}}if(_0x2ce1c9>0x0){if(_0x1fd30e[_0x15f8('0xa6')]==='booked'){_0x2ce1c9=0x1;}if(_0x2ce1c9>this[_0x15f8('0x1e')]){_0x2ce1c9=this['maxNumberOriginate'];}_0x1fd30e[_0x15f8('0x1fb')]+=_0x2ce1c9;for(var _0x5516b0 in this['agents']){if(typeof this[_0x15f8('0x1c')][_0x5516b0]!=='undefined'){if(this['agents'][_0x5516b0][_0x15f8('0x66')]===_0x15f8('0x208')&&this['agents'][_0x5516b0][_0x15f8('0x7d')]===_0x15f8('0x13e')){_0x291012['push'](this[_0x15f8('0x1c')][_0x5516b0]['id']);}}}hopperUtils[_0x15f8('0x209')](_0x1fd30e,_0x291012,_0x2ce1c9)[_0x15f8('0x37')](function(_0x269b86){_0x1fd30e[_0x15f8('0x1fb')]-=_0x2ce1c9;_0x1fd30e[_0x15f8('0x1fb')]=_0x1fd30e[_0x15f8('0x1fb')]>0x0?_0x1fd30e[_0x15f8('0x1fb')]:0x0;if(!utils[_0x15f8('0x20a')](_0x269b86)){hopperUtils[_0x15f8('0x20b')](_0x1fd30e)[_0x15f8('0x37')](sendMessageReschedule(_0x1fd30e))[_0x15f8('0x92')](loggerCatch(_0x15f8('0x20c')));}else{_0x1fd30e['originated']+=_0x269b86[_0x15f8('0x13f')];_0x1fd30e[_0x15f8('0x62')]=_0x1fd30e[_0x15f8('0xa6')]===_0x15f8('0x206')?utils[_0x15f8('0x63')][_0x15f8('0x135')]:utils['CAMPAIGN_STATUS'][_0x15f8('0x200')];for(var _0x73079e=0x0;_0x73079e<_0x269b86[_0x15f8('0x13f')];_0x73079e+=0x1){if(_[_0x15f8('0xec')](_0x269b86[_0x73079e])||_[_0x15f8('0xec')](_0x269b86[_0x73079e][_0x15f8('0x172')])||_[_0x15f8('0xec')](_0x269b86[_0x73079e][_0x15f8('0x156')])){_0x27a4f6[_0x15f8('0x14e')](_0x15f8('0x202'),_0x1fd30e,_0x269b86[_0x73079e]);}else{hopperUtils['checkIsBlackList'](_['pick'](_0x269b86[_0x73079e],[_0x15f8('0xd3'),_0x15f8('0x156')]))['then'](_0x27a4f6[_0x15f8('0x1e2')](_0x1fd30e,_0x269b86[_0x73079e]))['catch'](_0x27a4f6[_0x15f8('0x204')](_0x15f8('0x202'),_0x1fd30e));}}}})[_0x15f8('0x92')](loggerGetContactDialer(_0x15f8('0x20d'),_0x1fd30e,_0x2ce1c9));}};Dialer[_0x15f8('0x15')][_0x15f8('0x5d')]=function(_0x3dead3){if(_0x3dead3['dialLimitQueue']>0x0){var _0x4acff7=_0x3dead3['dialLimitQueue']-_0x3dead3['originated']-_0x3dead3[_0x15f8('0x133')];if(_0x4acff7>0x0){this['tryOriginatePredictive'](_0x3dead3);}else{loggerPredictiveCalls[_0x15f8('0x41')](_0x15f8('0x20e'));}}else{this['tryOriginatePredictive'](_0x3dead3);}};Dialer[_0x15f8('0x15')][_0x15f8('0x20f')]=function(_0x4fab8c){var _0x1ee53b=this;var _0x4b0365=[];_0x4fab8c[_0x15f8('0x76')]+=0x1;for(var _0x229a85 in this[_0x15f8('0x1c')]){if(typeof this['agents'][_0x229a85]!==_0x15f8('0x9e')){if(this[_0x15f8('0x1c')][_0x229a85][_0x15f8('0x66')]===_0x15f8('0x208')&&this[_0x15f8('0x1c')][_0x229a85][_0x15f8('0x7d')]===_0x15f8('0x13e')){_0x4b0365[_0x15f8('0x8c')](this[_0x15f8('0x1c')][_0x229a85]['id']);}}}return this[_0x15f8('0x209')](_0x4fab8c['id'],_0x4b0365,0x1,_0x4fab8c[_0x15f8('0x1fd')],_0x4fab8c)[_0x15f8('0x37')](function(_0x5e314e){if(!utils[_0x15f8('0x20a')](_0x5e314e)){utils['checkContactLowerLimitOriginate'](_0x4fab8c,0x1,0x0);return hopperUtils[_0x15f8('0x20b')](_0x4fab8c)[_0x15f8('0x37')](sendMessageReschedule(_0x4fab8c))[_0x15f8('0x92')](loggerCatch(_0x15f8('0x20c')));}else{_0x4fab8c[_0x15f8('0x62')]=utils[_0x15f8('0x63')][_0x15f8('0x200')];if(_[_0x15f8('0xec')](_0x5e314e[0x0])||_['isNil'](_0x5e314e[0x0][_0x15f8('0x172')])||_['isNil'](_0x5e314e[0x0]['phone'])){_0x1ee53b['emptyContact']('[actionOriginate]\x20',_0x4fab8c,_0x5e314e[0x0]);}else{return hopperUtils[_0x15f8('0x210')](_[_0x15f8('0x6c')](_0x5e314e[0x0],[_0x15f8('0xd3'),_0x15f8('0x156')]))[_0x15f8('0x37')](_0x1ee53b[_0x15f8('0x1e2')](_0x4fab8c,_0x5e314e[0x0]))[_0x15f8('0x92')](_0x1ee53b[_0x15f8('0x204')](_0x15f8('0x211'),_0x4fab8c));}}})[_0x15f8('0x92')](loggerGetContactDialer(_0x15f8('0x212'),_0x4fab8c,0x1));};Dialer['prototype']['abandonmentRate']=function(_0x3c8694,_0xe54362,_0x16fc07,_0xe38379,_0x1500c7,_0x1bbd7a){loggerPredictive['info'](_0x15f8('0x213'));loggerPredictive[_0x15f8('0x41')](_0x15f8('0x214'),_0x3c8694);loggerPredictive[_0x15f8('0x41')](_0x15f8('0x215'),_0xe54362);loggerPredictive[_0x15f8('0x41')](_0x15f8('0x216'),_0x16fc07);loggerPredictive[_0x15f8('0x41')]('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',_0xe38379);loggerPredictive['info'](_0x15f8('0x217'),_0x1500c7);loggerPredictive[_0x15f8('0x41')](_0x15f8('0x4b'));return new Promise(function(_0x1849c0,_0x403d2a){if(_0x3c8694<=0x0||isNaN(_0x3c8694)){return _0x403d2a(msgResponse('[abandonmentRate]',_0x15f8('0x7a'),_0x15f8('0x218')+_0x3c8694));}if(_0x16fc07<=0x0||isNaN(_0x16fc07)){return _0x403d2a(msgResponse(_0x15f8('0x219'),_0x15f8('0x7a'),_0x15f8('0x21a')+_0x16fc07));}if(_0xe38379<=0x0||isNaN(_0xe38379)){return _0x403d2a(msgResponse(_0x15f8('0x219'),_0x15f8('0x7a'),_0x15f8('0x21b')+_0xe38379));}if(_0xe54362<=0x0||isNaN(_0xe54362)){return _0x403d2a(msgResponse('[abandonmentRate]',_0x15f8('0x7a'),_0x15f8('0x21c')+_0xe54362));}if(_0x1500c7<=0x0||isNaN(_0x1500c7)){return _0x403d2a(msgResponse('[abandonmentRate]',_0x15f8('0x7a'),_0x15f8('0x21d')+_0x1500c7));}_0x1bbd7a=_0x1bbd7a||0x0;var _0x160fcf=0x1/_0x16fc07;var _0x48c0f8=0x0;var _0x47647a=0x0;var _0x2c4337=0x0;var _0xfd1b24=0x0;for(var _0x14d878=0x0;_0x2c4337<_0x1500c7;_0x14d878+=0x1){_0x47647a=_0x14d878/_0xe54362;_0x48c0f8=(_0xe38379*_0x47647a+_0x1bbd7a)/_0x160fcf;_0x2c4337=utils['erlangb'](_0x48c0f8,_0x3c8694);_0xfd1b24=_0x48c0f8/_0x3c8694*(0x1-utils[_0x15f8('0x21e')](_0x48c0f8,_0x3c8694));}return _0x1849c0({'erlangCalls':_0x14d878,'erlangCallToSecond':_0xe54362/_0x14d878,'erlangAbandonmentRate':_0x2c4337,'erlangBusyFactor':_0xfd1b24});});};Dialer[_0x15f8('0x15')]['busyFactor']=function(_0x2f538d,_0x585bf2,_0x25b083,_0x157e0a,_0x3e3784,_0x205768){loggerPredictive[_0x15f8('0x41')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x15f8('0x41')](_0x15f8('0x214'),_0x2f538d);loggerPredictive['info'](_0x15f8('0x215'),_0x585bf2);loggerPredictive[_0x15f8('0x41')](_0x15f8('0x216'),_0x25b083);loggerPredictive[_0x15f8('0x41')](_0x15f8('0x21f'),_0x157e0a);loggerPredictive['info'](_0x15f8('0x220'),_0x3e3784);loggerPredictive[_0x15f8('0x41')](_0x15f8('0x4b'));return new Promise(function(_0x3099c2,_0x539174){if(_0x2f538d<=0x0||isNaN(_0x2f538d)){return _0x539174(msgResponse(_0x15f8('0x221'),_0x15f8('0x7a'),_0x15f8('0x218')+_0x2f538d));}if(_0x25b083<=0x0||isNaN(_0x25b083)){return _0x539174(msgResponse(_0x15f8('0x221'),_0x15f8('0x7a'),'Ts\x20=\x20'+_0x25b083));}if(_0x157e0a<=0x0||isNaN(_0x157e0a)){return _0x539174(msgResponse(_0x15f8('0x221'),_0x15f8('0x7a'),_0x15f8('0x21b')+_0x157e0a));}if(_0x585bf2<=0x0||isNaN(_0x585bf2)){return _0x539174(msgResponse(_0x15f8('0x221'),_0x15f8('0x7a'),_0x15f8('0x21c')+_0x585bf2));}if(_0x3e3784<=0x0||isNaN(_0x3e3784)){return _0x539174(msgResponse(_0x15f8('0x221'),_0x15f8('0x7a'),_0x15f8('0x222')+_0x3e3784));}_0x205768=_0x205768||0x0;var _0x49fe05=0x1/_0x25b083;var _0x57e312=0x0;var _0x1f2c9f=0x0;var _0x4ce672=0x0;var _0x28cf37=0x0;for(var _0x2e0729=0x0;_0x28cf37<_0x3e3784;_0x2e0729+=0x1){_0x1f2c9f=_0x2e0729/_0x585bf2;_0x57e312=(_0x157e0a*_0x1f2c9f+_0x205768)/_0x49fe05;_0x4ce672=utils[_0x15f8('0x21e')](_0x57e312,_0x2f538d);_0x28cf37=_0x57e312/_0x2f538d*(0x1-utils[_0x15f8('0x21e')](_0x57e312,_0x2f538d));}return _0x3099c2({'erlangCalls':_0x2e0729,'erlangCallToSecond':_0x585bf2/_0x2e0729,'erlangAbandonmentRate':_0x4ce672,'erlangBusyFactor':_0x28cf37});});};module[_0x15f8('0x223')]=Dialer; \ No newline at end of file +var _0x5813=['dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','Contact','%s%s','XMD-','toUpper','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','dialPrefix','trim','dialCutDigit','substring','SIP/%s/%s%s','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','outboundDropCallsDayTimeout','round','predictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','Dropped\x20calls\x20day','dialPredictiveOptimization','Max\x20Drop\x20','started\x20in\x20predictive\x20at','getDataPredictive','avgHandleTime',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','merge','predictiveIntervalAnsweredCalls','dialPredictiveOptimizationPercentage','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','loggedIn','outboundQueuePauses','abandonmentRate','[CatchErlangB]','startMethodPredictive','one\x20call\x20every:','[handlePredictive]','checkContactBlack','UserId','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','dialRecallMeTimeout','voicePause','unlockContact','outboundReCallsDay','QUEUE_RECALL','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','getContactDialerIvr','[actionOriginate]\x20','checkIsBlackListIvr','loggerHandler','[getContactCampaign2]','dialLimitQueue','countReScheduled','[countReScheduled]\x20','RUNNING','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','getContactDialer','dialOrderByScheduledAt','checkContactEmpty','[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','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','[busyFactor]','m\x20=\x20','interval\x20=\x20','Umin\x20=\x20','util','uuid','moment','./utils','./utils/hopper','../../../config/environment/','../../../config/logger','dialer','booked','predictiveCalls','syncQueueSummary','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','./models/action','./models/history','./models/final','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','syncAgentComplete','custom:queuesummarycomplete','hangup','syncHangup','newexten','varset','syncVarSet','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','type','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','name','voice_queue:save','isEmpty','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','info','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','predictiveIntervalAvgHoldtime','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','getSeconds','startProgressive\x20value\x20cleared','startPredictive','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','checkContactLowerLimitOriginate','contactsRescheduled','message','CONTACTS_RESCHEDULED','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','CAMPAIGN_STATUS','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','INACTIVE','\x20NOT\x20Active','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','DISACTIVED','[ifTime][Action]','Error','isTrunkReachable','SIP/%s','status','trunks','unmonitored','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTimeIvr','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','isArray','push','Action','command','iftime\x20%s,%s','interval','timezones','content','indexOf','true','catch','some','OVERTIME_INTERVAL','Global:\x20','\x20Interval\x20is\x20overtime:\x20','syncCampaigns','isIVRCampaign','resolve','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','predictive','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','[ifTime][promiseAll]','Timezone:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','uniqueid','ivr','queue','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','moveContactManagedDialer','droptime','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','countdropretry','countglobal','callAdditionalPhoneAfterMin','verifyAdditionalPhones','additional','dialDropMaxRetry','queueCallerAbandonCreateState','dialDropRetryFrequency','minutes','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','endtime','calleridname','calleridnum','createHistory','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','voiceQueue','dialAbandonedMaxRetry','rescheduleContact','add','syncNewExten','actions','channel','syncQueueMember','rrmemory','actionid','isNil','paused','stateinterface','locked','idHopper','syncQueueStatusComplete','strategy','roundrobin','run','[Catch][Preview][syncQueueStatusComplete]','updateOriginated','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[unlock][syncQueueStatusComplete]','getQueue','response','Success','callProgressDetecting','variable','amdstatus','exten','xcally-motion-dialer','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','emit','custom:amd','buildObj','amd','[syncHangupInAMD]','dialAMDActive','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','saveInDb','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','outboundUnknownCallsDay','cause-txt','Unknow','running','isPreviewCampaign','statusMessage','available','talking','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','syncQueueSummaryComplete','throttle','filter','dialPreviewRecallmeReminder','online','reachable','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','[uniqueid]','clearZombieChannels','[actions]','undefined','No\x20such\x20channel','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','handleIvr','actionOriginate','object','originate','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','dialQueueOptions','dialQueueTimeout','XMD-AMDINITIALSILENCE'];(function(_0x772156,_0x5b5faa){var _0x79234b=function(_0x54773f){while(--_0x54773f){_0x772156['push'](_0x772156['shift']());}};_0x79234b(++_0x5b5faa);}(_0x5813,0xb7));var _0x3581=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5813[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x3581('0x0'));var _=require('lodash');var uuid=require(_0x3581('0x1'));var moment=require(_0x3581('0x2'));var rr=require('rr');var Redis=require('ioredis');var utils=require(_0x3581('0x3'));var hopperUtils=require(_0x3581('0x4'));var ut=require('../preview/util/util');var config=require(_0x3581('0x5'));var logger=require(_0x3581('0x6'))(_0x3581('0x7'));var loggerBooked=require(_0x3581('0x6'))(_0x3581('0x8'));var loggerPredictive=require(_0x3581('0x6'))('predictive');var loggerPredictiveCalls=require(_0x3581('0x6'))(_0x3581('0x9'));var loggerSyncQueueSummary=require(_0x3581('0x6'))(_0x3581('0xa'));var ami=require(_0x3581('0xb'));config[_0x3581('0xc')]=_['defaults'](config['redis'],{'host':_0x3581('0xd'),'port':0x18eb});var io=require(_0x3581('0xe'))(new Redis(config[_0x3581('0xc')]));var cmHopper=require(_0x3581('0xf'));var voiceQueueRt=require(_0x3581('0x10'));var RpcSetting=require(_0x3581('0x11'));var Interval=require('../rpc/interval');var Action=require(_0x3581('0x12'));var History=require(_0x3581('0x13'));var Final=require(_0x3581('0x14'));var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require(_0x3581('0x15'));var Hangup=require(_0x3581('0x16'));var ipAgi=process[_0x3581('0x17')][_0x3581('0x18')]||_0x3581('0x19');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x3581('0x1a')][_0x3581('0x1b')]=function(_0x28bb80){this[_0x3581('0x1c')]=this[_0x3581('0x1c')]?this[_0x3581('0x1c')][_0x3581('0x1d')](_0x28bb80):_0x28bb80();};function Dialer(_0x35b185,_0x4876f0){this[_0x3581('0x1e')]=new Sequence();this[_0x3581('0x1f')]=_0x4876f0;this['voiceQueues']=_0x35b185[_0x3581('0x20')];this[_0x3581('0x21')]=_0x35b185[_0x3581('0x21')];this[_0x3581('0x22')]=_0x35b185[_0x3581('0x22')];this['trunks']=_0x35b185['trunks'];this[_0x3581('0x23')]=config[_0x3581('0x23')]||0x2;this[_0x3581('0x24')]={};this['actions']={};this[_0x3581('0x25')]={};this[_0x3581('0x26')]={};this[_0x3581('0x27')]={};this['startPredictive']={};this[_0x3581('0x28')]={};this[_0x3581('0x29')]={};this[_0x3581('0x2a')]={};this[_0x3581('0x2b')]={};this[_0x3581('0x2c')]={};ami['on'](_0x3581('0x2d'),this[_0x3581('0x2e')][_0x3581('0x2f')](this));ami['on'](_0x3581('0x30'),this[_0x3581('0x31')][_0x3581('0x2f')](this));ami['on'](_0x3581('0x32'),this[_0x3581('0x33')][_0x3581('0x2f')](this));ami['on']('agentcomplete',this[_0x3581('0x34')][_0x3581('0x2f')](this));ami['on']('custom:queuesummary',this[_0x3581('0xa')][_0x3581('0x2f')](this));ami['on'](_0x3581('0x35'),this['syncQueueSummaryComplete'][_0x3581('0x2f')](this));ami['on'](_0x3581('0x36'),this[_0x3581('0x37')][_0x3581('0x2f')](this));ami['on'](_0x3581('0x38'),this['syncNewExten'][_0x3581('0x2f')](this));ami['on'](_0x3581('0x39'),this[_0x3581('0x3a')]['bind'](this));ami['on']('queuemember',this['syncQueueMember'][_0x3581('0x2f')](this));ami['on'](_0x3581('0x3b'),this['syncQueueStatusComplete'][_0x3581('0x2f')](this));this[_0x3581('0x3c')]();this[_0x3581('0x3d')]();RpcSetting[_0x3581('0x3e')]()[_0x3581('0x3f')](function(_0x2fad00){previewRecallmeReminderInterval=_0x2fad00[_0x3581('0x40')];});}function isNotNull(_0x155ae7){return _0x155ae7!==null&&!_[_0x3581('0x41')](_0x155ae7);}function msgResponse(_0x1a9552,_0x5e4fe6,_0x59f937){return{'action':_0x1a9552,'response':_0x5e4fe6,'message':_0x59f937,'stack':_0x59f937};}function emit(_0x5063d5,_0x5b388f,_0x1b24bc){io['to'](_0x5063d5)['emit'](_0x5b388f,_0x1b24bc);}function emitOutboundVoiceQueueSummary(_0x247b64){if(_0x247b64[_0x3581('0x42')]==='outbound'){logger[_0x3581('0x43')](_0x3581('0x44'),util[_0x3581('0x45')](_0x247b64,{'showHidden':![],'depth':null}));emit(util[_0x3581('0x46')](_0x3581('0x47'),_0x247b64[_0x3581('0x48')]),_0x3581('0x49'),_0x247b64);}}function checkGetDataPredictive(_0x196b24){if(isNotNull(_0x196b24)&&!_[_0x3581('0x4a')](_0x196b24)){loggerPredictive['info'](_0x3581('0x4b'));loggerPredictive['info'](_0x3581('0x4c'),_0x196b24[_0x3581('0x4d')]);loggerPredictive[_0x3581('0x4e')](_0x3581('0x4f'),_0x196b24['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x3581('0x4e')](_0x3581('0x50'),_0x196b24[_0x3581('0x51')]);loggerPredictive['info'](_0x3581('0x52'),_0x196b24[_0x3581('0x53')]);loggerPredictive[_0x3581('0x4e')](_0x3581('0x54'),_0x196b24['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x3581('0x4e')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x196b24[_0x3581('0x55')]);loggerPredictive[_0x3581('0x4e')](_0x3581('0x56'));if(_0x196b24['predictiveIntervalTotalCalls']>0x0){if(!_[_0x3581('0x41')](_0x196b24[_0x3581('0x55')])&&_0x196b24[_0x3581('0x55')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x3581('0x41')](_0x196b24[_0x3581('0x57')])&&_0x196b24[_0x3581('0x57')]>0x0){return!![];}loggerPredictive[_0x3581('0x4e')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x3581('0x4e')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x3581('0x4e')](_0x3581('0x58'));}return![];}function mergeDataErlangB(_0x480c1f){return function(_0x1e0e17){loggerPredictive[_0x3581('0x4e')](_0x3581('0x59'));loggerPredictive[_0x3581('0x4e')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1e0e17[_0x3581('0x5a')]);loggerPredictive['info']('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1e0e17[_0x3581('0x5b')]);loggerPredictive[_0x3581('0x4e')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1e0e17[_0x3581('0x5c')]);loggerPredictive[_0x3581('0x4e')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1e0e17[_0x3581('0x5d')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1e0e17['erlangAbandonmentRate']);loggerPredictive[_0x3581('0x4e')]('---------------------------');_['merge'](_0x480c1f,_0x1e0e17);};}function ifInterval(_0x3432cd,_0x5ad208){if(_['isUndefined'](_0x5ad208)){return![];}return utils[_0x3581('0x5e')](undefined,_0x5ad208)<_0x3432cd*0x3c;}function clearPredictiveAttributes(_0x20e49b){if(_0x20e49b[_0x3581('0x28')]){_0x20e49b['startProgressive']=undefined;loggerPredictive[_0x3581('0x43')](_0x20e49b[_0x3581('0x48')],_0x3581('0x5f'));}if(_0x20e49b[_0x3581('0x60')]){_0x20e49b['startPredictive']=undefined;loggerPredictive[_0x3581('0x43')](_0x20e49b[_0x3581('0x48')],_0x3581('0x61'));}if(_0x20e49b[_0x3581('0x62')]){clearInterval(_0x20e49b[_0x3581('0x62')]);_0x20e49b[_0x3581('0x62')]=undefined;loggerPredictive['debug'](_0x20e49b[_0x3581('0x48')],_0x3581('0x63'));}}function loggerCatchPredictive(_0x53cc62,_0x3bbbf4){return function(_0x2a28b7){loggerPredictive[_0x3581('0x64')](_0x3bbbf4['name'],_0x53cc62);loggerPredictive[_0x3581('0x64')](_0x2a28b7['stack']);clearPredictiveAttributes(_0x3bbbf4);};}function loggerCatch(_0x172f1a){return function(_0x350ad5){logger[_0x3581('0x64')](_0x172f1a,util[_0x3581('0x45')](_0x350ad5,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x215754,_0x8562b3,_0x2826f1){return function(_0x11d22e){utils[_0x3581('0x65')](_0x8562b3,_0x2826f1,0x0);logger[_0x3581('0x64')](_0x215754,util[_0x3581('0x45')](_0x11d22e,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x556462){return function(_0x306bac){if(isNotNull(_0x306bac)&&isNotNull(_0x306bac[0x0])){if(_0x306bac[0x0][_0x3581('0x66')]>0x0){_0x556462[_0x3581('0x67')]=utils['CAMPAIGN_STATUS'][_0x3581('0x68')];logger[_0x3581('0x4e')]('[getContactDialer2][ReScheduled]'+_0x556462[_0x3581('0x48')],_0x306bac[0x0][_0x3581('0x66')],'contacts');}else{_0x556462[_0x3581('0x67')]=utils['CAMPAIGN_STATUS'][_0x3581('0x69')];logger[_0x3581('0x4e')](_0x3581('0x6a')+_0x556462[_0x3581('0x48')]);}}};}function createObjHistory(_0x54b27c,_0x385fe8,_0xcc539,_0x15a87e,_0x5b81b0){_0x54b27c[_0x3581('0x67')]=_0xcc539;var _0x2928d5=new Action(_0x54b27c,_0x385fe8);var _0x2e8a00=new History(_0x2928d5);_0x2e8a00[_0x3581('0x6b')]=_0x15a87e;_0x2e8a00[_0x3581('0x6c')]=_0x5b81b0;_0x2e8a00['endtime']=_0x2928d5[_0x3581('0x6d')];return _0x2e8a00;}function unlockQueueStatus(_0x433794,_0x2cdc85){setTimeout(function(){if(_[_0x3581('0x41')](_0x433794[_0x3581('0x6e')])){loggerBooked['error'](_0x3581('0x6f'),_0x2cdc85);}_0x433794[_0x3581('0x6e')]=!![];loggerBooked[_0x3581('0x4e')](_0x3581('0x70'),_0x2cdc85,JSON[_0x3581('0x71')](_[_0x3581('0x72')](_0x433794,['name',_0x3581('0x6e')])));},0x1f3);}function checkInterval(_0x5302e1){return function(){if(!isNotNull(_0x5302e1[_0x3581('0x73')])){_0x5302e1[_0x3581('0x67')]=utils[_0x3581('0x74')][_0x3581('0x75')];throw _0x5302e1[_0x3581('0x48')]+_0x3581('0x76');}if(!isNotNull(_0x5302e1[_0x3581('0x73')]['Intervals'])){_0x5302e1[_0x3581('0x67')]=utils[_0x3581('0x74')][_0x3581('0x75')];throw _0x5302e1[_0x3581('0x48')]+_0x3581('0x76');}if(!isNotNull(_[_0x3581('0x4a')](_0x5302e1[_0x3581('0x73')][_0x3581('0x77')]))){_0x5302e1[_0x3581('0x67')]=utils['CAMPAIGN_STATUS'][_0x3581('0x75')];throw _0x5302e1[_0x3581('0x48')]+_0x3581('0x76');}};}function checkIsIVRCampaignActive(_0x228aa3){return function(){if(!utils['isIVRCampaignActive'](_0x228aa3)){_0x228aa3[_0x3581('0x67')]=utils['CAMPAIGN_STATUS'][_0x3581('0x78')];throw _0x228aa3['name']+_0x3581('0x79');}};}function emitCampaignSummary(_0x10c347){if(utils['isIVRCampaign'](_0x10c347)){emit(util[_0x3581('0x46')](_0x3581('0x7a'),_0x10c347[_0x3581('0x48')]),_0x3581('0x7b'),_0x10c347);}}function loggerCatchQueueSummary(_0x36f2d5,_0x17bdcd){return function(_0x22804d){clearPredictiveAttributes(_0x17bdcd);emitCampaignSummary(_0x17bdcd);loggerSyncQueueSummary['debug'](_0x36f2d5,util[_0x3581('0x45')](_0x22804d,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x2dacfc){if(_0x2dacfc[_0x3581('0x7c')]){if(_0x2dacfc['originated']===0x0){_0x2dacfc[_0x3581('0x7c')]=![];_0x2dacfc[_0x3581('0x67')]=utils[_0x3581('0x74')][_0x3581('0x78')];loggerSyncQueueSummary[_0x3581('0x43')](_0x3581('0x7d'),_0x2dacfc[_0x3581('0x48')],'is\x20not\x20active');}else{_0x2dacfc[_0x3581('0x67')]=utils[_0x3581('0x74')][_0x3581('0x7e')];loggerSyncQueueSummary[_0x3581('0x43')](_0x3581('0x7d'),_0x2dacfc['name'],'is\x20disactive');}emitCampaignSummary(_0x2dacfc);}}function myreject(_0x12544b){return function(_0x432c4e){return _0x12544b(msgResponse(_0x3581('0x7f'),_0x3581('0x80'),JSON[_0x3581('0x71')](_0x432c4e)));};}Dialer[_0x3581('0x1a')][_0x3581('0x81')]=function(_0x3e3e79){return!_[_0x3581('0x41')](_0x3e3e79)&&_0x3e3e79&&!_[_0x3581('0x41')](_0x3e3e79[_0x3581('0x48')])&&!_['isUndefined'](_0x3e3e79['active'])&&_0x3e3e79['active']&&(this['trunks'][util['format'](_0x3581('0x82'),_0x3e3e79[_0x3581('0x48')])][_0x3581('0x83')]==='reachable'||this[_0x3581('0x84')][util['format'](_0x3581('0x82'),_0x3e3e79[_0x3581('0x48')])][_0x3581('0x83')]===_0x3581('0x85'));};Dialer[_0x3581('0x1a')]['checkIsTrunkReachable']=function(_0x15d287){var _0x4df234=this;return function(){if(!_0x4df234[_0x3581('0x81')](_0x15d287[_0x3581('0x86')])){if(!_0x4df234[_0x3581('0x81')](_0x15d287[_0x3581('0x87')])){_0x15d287[_0x3581('0x67')]=utils[_0x3581('0x74')][_0x3581('0x88')];throw _0x15d287['name']+_0x3581('0x89');}}};};Dialer['prototype'][_0x3581('0x8a')]=function(_0xdab8e0,_0x480c38,_0x1168db,_0x498530){var _0x270b61=this;return function(){var _0xfcc00=!![];return _0x270b61['ifTimeIvr'](_0xdab8e0,_0x480c38,_0x1168db,_0x498530,_0xfcc00);};};Dialer[_0x3581('0x1a')][_0x3581('0x8b')]=function(_0x480879,_0x337f6e,_0x2d67d1,_0x28b9f6){var _0xf5246f=this;return function(){var _0x43253e=![];return _0xf5246f['ifTimeIvr'](_0x480879['Intervals'],_0x337f6e,_0x2d67d1,_0x28b9f6,_0x43253e);};};Dialer[_0x3581('0x1a')][_0x3581('0x8c')]=function(_0x19909c,_0x3c81cd,_0x2005bd,_0x1a6e38,_0x1d6070){var _0xacf19e=[];return new Promise(function(_0x348043,_0xd00540){if(!isNotNull(_0x19909c)){_0x1a6e38[_0x3581('0x67')]=utils[_0x3581('0x74')]['NULL_INTERVAL'];return _0xd00540(msgResponse(_0x3581('0x8d'),_0x3581('0x8e'),_0x2005bd+_0x3581('0x8f')));}if(_['isEmpty'](_0x19909c)){_0x1a6e38[_0x3581('0x67')]=utils['CAMPAIGN_STATUS'][_0x3581('0x90')];return _0xd00540(msgResponse(_0x3581('0x8d'),_0x3581('0x8e'),_0x2005bd+'\x20Intervals\x20is\x20empty\x20'));}if(_0x3c81cd&&_[_0x3581('0x41')](config['timezones'][_0x3c81cd])){_0x1a6e38[_0x3581('0x67')]=utils[_0x3581('0x74')]['UNKNOWN_TIMEZONE'];return _0xd00540(msgResponse('ifTime',_0x3581('0x8e'),_0x2005bd+'\x20Timezone\x20unknow\x20'+_0x3c81cd));}if(_[_0x3581('0x91')](_0x19909c)){for(var _0x788bfa=0x0;_0x788bfa<_0x19909c['length'];_0x788bfa+=0x1){_0xacf19e[_0x3581('0x92')](ami[_0x3581('0x93')]({'action':_0x3581('0x94'),'command':util[_0x3581('0x46')](_0x3581('0x95'),_0x19909c[_0x788bfa][_0x3581('0x96')],!_[_0x3581('0x41')](config[_0x3581('0x97')][_0x3c81cd])?_0x3c81cd:'')})[_0x3581('0x3f')](function(_0x4a570e){return _0x4a570e[_0x3581('0x98')][_0x3581('0x99')](_0x3581('0x9a'))>=0x0;})[_0x3581('0x9b')](myreject(_0xd00540)));}}else{_0xacf19e[_0x3581('0x92')](ami[_0x3581('0x93')]({'action':'command','command':util[_0x3581('0x46')]('iftime\x20%s,%s',_0x19909c,!_[_0x3581('0x41')](config[_0x3581('0x97')][_0x3c81cd])?_0x3c81cd:'')})['then'](function(_0x18b509){return _0x18b509[_0x3581('0x98')][_0x3581('0x99')](_0x3581('0x9a'))>=0x0;})[_0x3581('0x9b')](myreject(_0xd00540)));}Promise['all'](_0xacf19e)[_0x3581('0x3f')](function(_0x3df229){var _0x1c2938=_[_0x3581('0x9c')](_0x3df229);if(_0x1c2938){return _0x348043(_0x1c2938);}else{_0x1a6e38[_0x3581('0x67')]=_0x1d6070?utils[_0x3581('0x74')]['OVERTIME_GLOBAL_INTERVAL']:utils['CAMPAIGN_STATUS'][_0x3581('0x9d')];return _0xd00540(msgResponse('[ifTime][promiseAll]',_0x3581('0x8e'),_0x3581('0x9e')+_0x1d6070+'\x20'+_0x2005bd+_0x3581('0x9f')+util['inspect'](_0x19909c,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x3c81cd));}})[_0x3581('0x9b')](function(_0x23bbbb){return _0xd00540(msgResponse(_0x3581('0x8d'),_0x3581('0x8e'),JSON['stringify'](_0x23bbbb)));});});};Dialer[_0x3581('0x1a')][_0x3581('0x3c')]=function(){var _0x90f3de=this;return cmHopper['resetActiveCalls']({'active':![]},{'where':{'active':!![]}})[_0x3581('0x3f')](function(){setInterval(function(){_0x90f3de[_0x3581('0xa0')]();},0x3e8);});};Dialer[_0x3581('0x1a')][_0x3581('0xa0')]=function(){var _0x4fbb2d=this;var _0x423c8e;for(var _0x43d261 in this[_0x3581('0x21')]){if(typeof this[_0x3581('0x21')][_0x43d261]!=='undefined'){_0x423c8e=this[_0x3581('0x21')][_0x43d261];if(utils[_0x3581('0xa1')](_0x423c8e)&&utils['isIVRCampaignActive'](_0x423c8e)){_0x423c8e[_0x3581('0x7c')]=!![];Promise[_0x3581('0xa2')]()[_0x3581('0x3f')](checkIsIVRCampaignActive(_0x423c8e))[_0x3581('0x3f')](checkInterval(_0x423c8e))[_0x3581('0x3f')](_0x4fbb2d[_0x3581('0xa3')](_0x423c8e))['then'](_0x4fbb2d[_0x3581('0x8a')](_0x423c8e[_0x3581('0xa4')],_0x423c8e[_0x3581('0xa5')],_0x423c8e[_0x3581('0x48')],_0x423c8e))[_0x3581('0x3f')](_0x4fbb2d['checkIfTimeIntervals'](_0x423c8e[_0x3581('0x73')],_0x423c8e[_0x3581('0xa5')],_0x423c8e[_0x3581('0x48')],_0x423c8e))[_0x3581('0x3f')](_0x4fbb2d[_0x3581('0xa6')](_0x423c8e))[_0x3581('0x9b')](loggerCatchQueueSummary(_0x3581('0xa7'),_0x423c8e));}else{notSendMessagesCampaign(_0x423c8e);}}}};Dialer['prototype'][_0x3581('0xa8')]=function(_0x4b3cb0){if(_0x4b3cb0[_0x3581('0xa9')]!==_0x3581('0xaa')){clearPredictiveAttributes(_0x4b3cb0);}switch(_0x4b3cb0[_0x3581('0xa9')]){case _0x3581('0xab'):this[_0x3581('0xac')](_0x4b3cb0,0x1);break;case _0x3581('0xad'):this[_0x3581('0xac')](_0x4b3cb0,_0x4b3cb0[_0x3581('0xae')]);break;case _0x3581('0xaa'):this[_0x3581('0xaa')](_0x4b3cb0);break;case'booked':this[_0x3581('0xac')](_0x4b3cb0,0x1);break;default:logger[_0x3581('0x64')](_0x3581('0xaf'),_0x4b3cb0[_0x3581('0x48')],_0x3581('0xb0'));}};Dialer[_0x3581('0x1a')][_0x3581('0x8d')]=function(_0x1afbe0,_0x23eab4){var _0x2fdcbe=_0x1afbe0[_0x3581('0xa5')];var _0x2ed8d8=_0x23eab4?_0x1afbe0[_0x3581('0xa4')]:_0x1afbe0['Interval'][_0x3581('0x77')];logger['silly'](_0x3581('0xb1'),_0x2ed8d8,_0x2fdcbe,_0x1afbe0[_0x3581('0x48')],util[_0x3581('0x46')](_0x3581('0xb2'),_0x1afbe0['name'],_0x1afbe0['id']));var _0x2ed72e=null;return Interval[_0x3581('0xb3')](_0x2ed8d8,_0x2fdcbe)[_0x3581('0x3f')](function(_0x23ee7b){if(_0x23ee7b===!![]){return _0x23ee7b;}else{_0x1afbe0[_0x3581('0x67')]=_0x23eab4?utils[_0x3581('0x74')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0x3581('0x74')]['OVERTIME_INTERVAL'];_0x2ed72e=msgResponse(_0x3581('0xb4'),_0x3581('0x8e'),'Global:\x20'+_0x23eab4+'\x20'+_0x1afbe0[_0x3581('0x48')]+_0x3581('0x9f')+util[_0x3581('0x45')](_0x2ed8d8,{'showHidden':![],'depth':null})+_0x3581('0xb5')+_0x2fdcbe);}if(_0x2ed72e!==null){logger['silly'](_0x3581('0xb6'),_0x2ed72e);_0x2ed72e[_0x3581('0xb7')]=_0x23eab4;throw _0x2ed72e;}})[_0x3581('0x9b')](function(_0x5dc966){logger[_0x3581('0x64')](_0x3581('0xb8'),_0x5dc966);throw msgResponse('[ifTime][Action]','Error',util['inspect'](_0x5dc966,{'showHidden':![],'depth':null}));});};Dialer['prototype'][_0x3581('0x2e')]=function(_0x1c45bb){if(this[_0x3581('0x20')][_0x1c45bb['queue']]){if(this[_0x3581('0x26')][_0x1c45bb[_0x3581('0xb9')]]&&this[_0x3581('0x26')][_0x1c45bb[_0x3581('0xb9')]]['type']!==_0x3581('0xba')){this['updateOriginated'](this[_0x3581('0x20')][_0x1c45bb[_0x3581('0xbb')]]);this[_0x3581('0x26')][_0x1c45bb['uniqueid']]['answertime']=moment()['format'](_0x3581('0xbc'));}}};Dialer[_0x3581('0x1a')][_0x3581('0x34')]=function(_0x322194){var _0x628a9a=this[_0x3581('0x26')][_0x322194['uniqueid']];if(this[_0x3581('0x20')][_0x322194[_0x3581('0xbb')]]){if(_0x628a9a&&_0x628a9a[_0x3581('0x42')]!==_0x3581('0xba')){delete this['uniqueId'][_0x322194['uniqueid']];this[_0x3581('0x20')][_0x322194[_0x3581('0xbb')]][_0x3581('0xbd')]+=0x1;var _0x1fc350=new AgentComplete(_0x628a9a,_0x322194);if(_0x322194[_0x3581('0xbe')]===_0x3581('0xbf')){_0x1fc350[_0x3581('0xc0')]=this['voiceQueues'][_0x322194[_0x3581('0xbb')]][_0x3581('0xc1')]&&this[_0x3581('0x20')][_0x322194[_0x3581('0xbb')]][_0x3581('0xc2')]?moment()[_0x3581('0x46')](_0x3581('0xbc')):undefined;}hopperUtils['createHistory'](_0x1fc350)[_0x3581('0x9b')](loggerCatch(_0x3581('0xc3')));hopperUtils[_0x3581('0xc4')](_0x1fc350)[_0x3581('0x9b')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x3581('0x1a')]['syncQueueCallerAbandon']=function(_0x90a749){var _0xdfbedd=this[_0x3581('0x26')][_0x90a749[_0x3581('0xb9')]];var _0x2655cc=this;var _0x1dc620=![];var _0x497375;var _0x2b6373;if(this[_0x3581('0x20')][_0x90a749[_0x3581('0xbb')]]){if(_0xdfbedd&&_0xdfbedd[_0x3581('0x42')]!==_0x3581('0xba')){delete this[_0x3581('0x26')][_0x90a749['uniqueid']];this['updateOriginated'](this[_0x3581('0x20')][_0x90a749[_0x3581('0xbb')]]);_0xdfbedd[_0x3581('0xc5')]=moment()[_0x3581('0x46')](_0x3581('0xbc'));var _0x2ee60b=new QueueCallerAbandon(_0xdfbedd,_0x90a749);if(utils['getSeconds'](_0xdfbedd[_0x3581('0xc5')],_0xdfbedd['responsetime'])>=_0xdfbedd['dialQueueTimeout']){this[_0x3581('0x20')][_0x90a749[_0x3581('0xbb')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this['voiceQueues'][_0x90a749[_0x3581('0xbb')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x3581('0x20')][_0x90a749[_0x3581('0xbb')]][_0x3581('0xc6')]+=0x1;_0x2ee60b[_0x3581('0x6b')]=0xa;_0x2ee60b[_0x3581('0x6c')]=_0x3581('0xc7');_0x2ee60b[_0x3581('0xc8')]='TIMEOUT';_0x2ee60b[_0x3581('0xc0')]=this['voiceQueues'][_0x90a749[_0x3581('0xbb')]][_0x3581('0xc1')]?moment()['format'](_0x3581('0xbc')):undefined;_0x2ee60b[_0x3581('0xc9')]+=0x1;_0x2ee60b[_0x3581('0xca')]+=0x1;_0x497375=this[_0x3581('0x20')][_0x90a749[_0x3581('0xbb')]]['dialDropRetryFrequency'];_0x2b6373=this[_0x3581('0x20')][_0x90a749[_0x3581('0xbb')]][_0x3581('0xcb')];hopperUtils[_0x3581('0xcc')](_0x2ee60b,_0x2ee60b[_0x3581('0x6b')],_0xdfbedd['voiceQueue'])[_0x3581('0x3f')](function(_0x590880){_0x1dc620=_0x590880[_0x3581('0xcd')]==0x1;if(_0x2ee60b[_0x3581('0xc9')]>=_0x2655cc[_0x3581('0x20')][_0x90a749[_0x3581('0xbb')]][_0x3581('0xce')]){_0x2655cc[_0x3581('0xcf')](_0x2ee60b,_0x590880['additional']);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x2ee60b[_0x3581('0xc9')],'scheduledat':moment()['add'](_0x2655cc[_0x3581('0x20')][_0x90a749[_0x3581('0xbb')]][_0x3581('0xd0')],_0x3581('0xd1'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xdfbedd[_0x3581('0xd2')],'ListId':_0xdfbedd[_0x3581('0xd3')],'VoiceQueueId':_0xdfbedd[_0x3581('0xd4')]||undefined,'CampaignId':_0xdfbedd[_0x3581('0xd5')]||undefined})[_0x3581('0x9b')](loggerCatch(_0x3581('0xd6')));var _0x3c3c2c=new History(_0x2ee60b);_0x3c3c2c[_0x3581('0x6b')]=0xa;_0x3c3c2c[_0x3581('0x6c')]='Drop';_0x3c3c2c['starttime']=moment()[_0x3581('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x3c3c2c[_0x3581('0xd7')]=_0x3c3c2c[_0x3581('0x6d')];_0x3c3c2c['calleridname']=_0x2ee60b[_0x3581('0xd8')];_0x3c3c2c[_0x3581('0xd9')]=_0x2ee60b[_0x3581('0xd9')];hopperUtils[_0x3581('0xda')](_0x3c3c2c)[_0x3581('0x9b')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0x3581('0x3f')](function(){if(_0x1dc620)hopperUtils[_0x3581('0xdb')](_0x2ee60b,_0x497375,_0x2b6373)[_0x3581('0x3f')](function(){return 0x1;});});}else{this[_0x3581('0x20')][_0x90a749[_0x3581('0xbb')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x3581('0x20')][_0x90a749['queue']][_0x3581('0xdc')]+=0x1;_0x2ee60b[_0x3581('0x6b')]=0xb;_0x2ee60b[_0x3581('0x6c')]=_0x3581('0xdd');_0x2ee60b['dropreason']=_0x3581('0xde');_0x2ee60b[_0x3581('0xdf')]+=0x1;_0x2ee60b[_0x3581('0xca')]+=0x1;_0x497375=this['voiceQueues'][_0x90a749['queue']][_0x3581('0xe0')];_0x2b6373=this[_0x3581('0x20')][_0x90a749['queue']][_0x3581('0xcb')];hopperUtils['verifyAdditionalPhones'](_0x2ee60b,_0x2ee60b[_0x3581('0x6b')],_0xdfbedd[_0x3581('0xe1')])[_0x3581('0x3f')](function(_0x153e93){if(_0x2ee60b[_0x3581('0xdf')]>=_0x2655cc[_0x3581('0x20')][_0x90a749[_0x3581('0xbb')]][_0x3581('0xe2')]){_0x2655cc[_0x3581('0xcf')](_0x2ee60b,_0x153e93[_0x3581('0xcd')]);}else{hopperUtils[_0x3581('0xe3')]({'active':![],'countabandonedretry':_0x2ee60b[_0x3581('0xdf')],'scheduledat':moment()[_0x3581('0xe4')](_0x2655cc[_0x3581('0x20')][_0x90a749[_0x3581('0xbb')]][_0x3581('0xe0')],_0x3581('0xd1'))[_0x3581('0x46')](_0x3581('0xbc')),'ContactId':_0xdfbedd[_0x3581('0xd2')],'ListId':_0xdfbedd[_0x3581('0xd3')],'VoiceQueueId':_0xdfbedd[_0x3581('0xd4')]||undefined,'CampaignId':_0xdfbedd['CampaignId']||undefined})[_0x3581('0x9b')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x2c1265=new History(_0x2ee60b);_0x2c1265[_0x3581('0x6b')]=0xb;_0x2c1265[_0x3581('0x6c')]='Abandoned';_0x2c1265[_0x3581('0x6d')]=moment()[_0x3581('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x2c1265[_0x3581('0xd7')]=_0x2c1265[_0x3581('0x6d')];_0x2c1265[_0x3581('0xd8')]=_0x2ee60b[_0x3581('0xd8')];_0x2c1265[_0x3581('0xd9')]=_0x2ee60b[_0x3581('0xd9')];hopperUtils[_0x3581('0xda')](_0x2c1265)[_0x3581('0x9b')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0x3581('0x3f')](function(){if(_0x1dc620)hopperUtils[_0x3581('0xdb')](_0x2ee60b,_0x497375,_0x2b6373)['then'](function(){return 0x1;});});}}}};Dialer[_0x3581('0x1a')][_0x3581('0xe5')]=function(_0x40deb8){if(this[_0x3581('0xe6')][_0x40deb8[_0x3581('0xb9')]]){this[_0x3581('0xe6')][_0x40deb8['uniqueid']][_0x3581('0xe7')]=_0x40deb8[_0x3581('0xe7')];}if(this[_0x3581('0x26')][_0x40deb8[_0x3581('0xb9')]]){this['uniqueId'][_0x40deb8[_0x3581('0xb9')]][_0x3581('0xe7')]=_0x40deb8['channel'];}};Dialer['prototype'][_0x3581('0xe8')]=function(_0x3be958){if(!this[_0x3581('0xe6')][_0x3be958['actionid']]){return;}var _0x393167=this['voiceQueues'][this[_0x3581('0xe6')][_0x3be958['actionid']][_0x3581('0xbb')]]['strategy']||_0x3581('0xe9');if(_0x393167==='roundrobin'){if(this[_0x3581('0xe6')][_0x3be958[_0x3581('0xea')]]&&_[_0x3581('0xeb')](this['actions'][_0x3be958[_0x3581('0xea')]]['locked'])&&_0x3be958[_0x3581('0x83')]==='1'&&_0x3be958[_0x3581('0xec')]==='0'){if(this[_0x3581('0x22')][_0x3be958['stateinterface']]){if(!this[_0x3581('0x22')][_0x3be958[_0x3581('0xed')]]['locked']){this[_0x3581('0x22')][_0x3be958[_0x3581('0xed')]]['locked']=!![];this[_0x3581('0xe6')][_0x3be958[_0x3581('0xea')]][_0x3581('0xee')]=!![];this[_0x3581('0xe6')][_0x3be958[_0x3581('0xea')]]['stateinterface']=_0x3be958[_0x3581('0xed')];}}}}else if(_0x393167==='rrmemory'){if(this['actions'][_0x3be958[_0x3581('0xea')]]){if(this[_0x3581('0x22')][_0x3be958[_0x3581('0xed')]]){this[_0x3581('0xe6')][_0x3be958['actionid']][_0x3581('0xed')]=_0x3be958[_0x3581('0xed')];if(_[_0x3581('0xeb')](this[_0x3581('0x2a')][this[_0x3581('0xe6')][_0x3be958[_0x3581('0xea')]][_0x3581('0xbb')]])){this[_0x3581('0x2a')][this[_0x3581('0xe6')][_0x3be958[_0x3581('0xea')]][_0x3581('0xbb')]]=[];}this[_0x3581('0x2a')][this[_0x3581('0xe6')][_0x3be958[_0x3581('0xea')]][_0x3581('0xbb')]][_0x3581('0x92')](_['merge'](_['pick'](this[_0x3581('0xe6')][_0x3be958['actionid']],[_0x3581('0xef'),_0x3581('0xed')]),{'status':_0x3be958['status'],'paused':_0x3be958[_0x3581('0xec')]}));}}}};Dialer[_0x3581('0x1a')][_0x3581('0xf0')]=function(_0x247766){if(!this['actions'][_0x247766[_0x3581('0xea')]]){return;}var _0xf26750=this;var _0x3cbc0f=this[_0x3581('0x20')][this['actions'][_0x247766['actionid']]['queue']];var _0xb8781=_0x3cbc0f[_0x3581('0xf1')]||_0x3581('0xe9');if(_0xb8781===_0x3581('0xf2')){if(this[_0x3581('0xe6')][_0x247766[_0x3581('0xea')]]&&this['actions'][_0x247766['actionid']][_0x3581('0xed')]){this[_0x3581('0x1f')][_0x3581('0xf3')](this[_0x3581('0xe6')][_0x247766[_0x3581('0xea')]][_0x3581('0xef')],this[_0x3581('0xe6')][_0x247766['actionid']][_0x3581('0xed')])[_0x3581('0x9b')](function(_0x1aa54c){logger['error'](_0x3581('0xf4'),util['inspect'](_0x1aa54c,{'showHidden':![],'depth':null}));})[_0x3581('0x1d')](function(){_0xf26750[_0x3581('0xf5')](_0xf26750[_0x3581('0x20')][_0xf26750[_0x3581('0xe6')][_0x247766[_0x3581('0xea')]]['queue']]);_0xf26750[_0x3581('0x22')][_0xf26750[_0x3581('0xe6')][_0x247766['actionid']][_0x3581('0xed')]][_0x3581('0xee')]=![];delete _0xf26750[_0x3581('0xe6')][_0x247766[_0x3581('0xea')]];unlockQueueStatus(_0x3cbc0f);});}else{this[_0x3581('0xf5')](this[_0x3581('0x20')][this[_0x3581('0xe6')][_0x247766[_0x3581('0xea')]]['queue']]);hopperUtils[_0x3581('0xe3')]({'active':![],'ContactId':this[_0x3581('0xe6')][_0x247766['actionid']]['ContactId'],'ListId':this[_0x3581('0xe6')][_0x247766[_0x3581('0xea')]]['ListId'],'VoiceQueueId':this['actions'][_0x247766[_0x3581('0xea')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x3581('0xe6')][_0x247766[_0x3581('0xea')]]['CampaignId']||undefined})[_0x3581('0x9b')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x247766[_0x3581('0xea')]];unlockQueueStatus(_0x3cbc0f);}}else if(_0xb8781===_0x3581('0xe9')){var _0x8bb5d7;if(this[_0x3581('0xe6')][_0x247766[_0x3581('0xea')]]&&!_[_0x3581('0x4a')](this[_0x3581('0x2a')][this['actions'][_0x247766['actionid']][_0x3581('0xbb')]])){if(this[_0x3581('0x2b')][_0xf26750[_0x3581('0xe6')][_0x247766['actionid']][_0x3581('0xbb')]]){this['queueBookedRR'][_0xf26750[_0x3581('0xe6')][_0x247766['actionid']][_0x3581('0xbb')]]=this[_0x3581('0x2b')][this[_0x3581('0xe6')][_0x247766[_0x3581('0xea')]]['queue']]?this['queueBookedRR'][this['actions'][_0x247766[_0x3581('0xea')]][_0x3581('0xbb')]]:this[_0x3581('0x2a')][this[_0x3581('0xe6')][_0x247766[_0x3581('0xea')]][_0x3581('0xbb')]]?this[_0x3581('0x2a')][this[_0x3581('0xe6')][_0x247766['actionid']]['queue']]['_rr']||0x0:0x0;}this['queueBooked'][this[_0x3581('0xe6')][_0x247766['actionid']][_0x3581('0xbb')]][_0x3581('0xf6')]=this['queueBookedRR'][this['actions'][_0x247766[_0x3581('0xea')]][_0x3581('0xbb')]];for(var _0x40903b=0x0;_0x40903b=_0x511529[_0x3581('0x119')]){_0x3e750a[_0x3581('0x11a')](_0x5008fd,_0x3e7c93,_0x40d799,_0x3581('0x11b'));}else{if(_0x5008fd[_0x3581('0x112')]>=_0x511529[_0x3581('0x11c')]){_0x3e750a[_0x3581('0x11d')](_0x5008fd,_0x3e7c93,_0x40d799,_0x3581('0x11e'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x5008fd[_0x3581('0x112')],'scheduledat':moment()['add'](_0x511529[_0x3581('0x11f')],_0x3581('0xd1'))[_0x3581('0x46')](_0x3581('0xbc')),'ContactId':_0x5008fd[_0x3581('0xd2')],'ListId':_0x5008fd[_0x3581('0xd3')],'VoiceQueueId':_0x5008fd[_0x3581('0xd4')]||undefined,'CampaignId':_0x5008fd[_0x3581('0xd5')]||undefined})[_0x3581('0x9b')](loggerCatch(_0x3581('0x120')));_0x3e7c93({'reschedule':0x1});}}});}if(_0x27913a['type']===_0x3581('0xba')&&this[_0x3581('0x21')][_0x27913a[_0x3581('0xbb')]][_0x3581('0x111')]&&_0x2dfc14[_0x3581('0x106')]==='HANGUP'){delete this[_0x3581('0x26')][_0x2dfc14[_0x3581('0xb9')]];this[_0x3581('0xf5')](this['campaigns'][_0x27913a[_0x3581('0xbb')]]);_0x196cbb=new Hangup(_0x27913a,_0x2dfc14);_0x196cbb[_0x3581('0x6b')]=0x12;_0x196cbb[_0x3581('0x6c')]='HangupInAMD';_0x196cbb[_0x3581('0x10a')]=_0x3581('0x10b');ami[_0x3581('0x10c')](_0x3581('0x10d'),ut[_0x3581('0x10e')](_0x196cbb,_0x3581('0x10f')));this[_0x3581('0x121')](_0x196cbb,_0x3581('0x122'),_0x3581('0x123'));}if(_0x27913a[_0x3581('0x42')]===_0x3581('0xba')&&this[_0x3581('0x21')][_0x27913a[_0x3581('0xbb')]][_0x3581('0x111')]&&_0x2dfc14[_0x3581('0x106')]===_0x3581('0x124')){return new Promise(function(_0x22c525,_0x3245c3){delete _0x3e750a[_0x3581('0x26')][_0x2dfc14[_0x3581('0xb9')]];_0x3e750a[_0x3581('0xf5')](_0x3e750a[_0x3581('0x21')][_0x27913a[_0x3581('0xbb')]]);_0x3e750a[_0x3581('0x21')][_0x27913a['queue']][_0x3581('0xbd')]+=0x1;_0x3e750a['campaigns'][_0x27913a[_0x3581('0xbb')]][_0x3581('0x108')]+=0x1;var _0x340110=_0x3e750a[_0x3581('0x21')][_0x27913a[_0x3581('0xbb')]];var _0x22581b=new Hangup(_0x27913a,_0x2dfc14);_0x22581b[_0x3581('0x6b')]=0x13;_0x22581b[_0x3581('0x6c')]='Machine';_0x22581b[_0x3581('0x10a')]=_0x3581('0x10b');_0x22581b[_0x3581('0x112')]+=0x1;_0x22581b[_0x3581('0xca')]+=0x1;_0x22581b['amd']=!![];ami['emit']('custom:amd',ut['buildObj'](_0x22581b,'amd'));hopperUtils[_0x3581('0xda')](_0x22581b)[_0x3581('0x9b')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x22581b[_0x3581('0x114')]+_0x22581b[_0x3581('0x115')]+_0x22581b[_0x3581('0x116')]+_0x22581b['countnosuchnumberretry']+_0x22581b[_0x3581('0xc9')]+_0x22581b['countabandonedretry']+_0x22581b['countmachineretry']+_0x22581b[_0x3581('0x118')]>=_0x340110['dialGlobalMaxRetry']){_0x3e750a[_0x3581('0x11a')](_0x22581b,_0x22c525,_0x3245c3,_0x3581('0x11b'));}else{if(_0x22581b['countmachineretry']>=_0x340110[_0x3581('0x11c')]){_0x3e750a[_0x3581('0x11d')](_0x22581b,_0x22c525,_0x3245c3,_0x3581('0x11e'));}else{hopperUtils[_0x3581('0xe3')]({'active':![],'countmachineretry':_0x22581b[_0x3581('0x112')],'scheduledat':moment()[_0x3581('0xe4')](_0x340110[_0x3581('0x11f')],_0x3581('0xd1'))[_0x3581('0x46')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x22581b[_0x3581('0xd2')],'ListId':_0x22581b[_0x3581('0xd3')],'VoiceQueueId':_0x22581b['VoiceQueueId']||undefined,'CampaignId':_0x22581b[_0x3581('0xd5')]||undefined})[_0x3581('0x9b')](loggerCatch('[rescheduleContact][Machine]'));_0x22c525({'reschedule':0x1});}}});}}};Dialer[_0x3581('0x1a')][_0x3581('0x37')]=function(_0x570669){var _0x5095e0=this[_0x3581('0x26')][_0x570669['uniqueid']];var _0x39df5f;if(_0x5095e0&&_0x5095e0[_0x3581('0x42')]==='ivr'){delete this[_0x3581('0x26')][_0x570669[_0x3581('0xb9')]];this[_0x3581('0xf5')](this[_0x3581('0x21')][_0x5095e0[_0x3581('0xbb')]]);this[_0x3581('0x21')][_0x5095e0[_0x3581('0xbb')]][_0x3581('0x125')]+=0x1;_0x39df5f=new Hangup(_0x5095e0,_0x570669);hopperUtils[_0x3581('0xda')](_0x39df5f)[_0x3581('0x9b')](loggerCatch(_0x3581('0x126')));hopperUtils[_0x3581('0xc4')](_0x39df5f)[_0x3581('0x9b')](loggerCatch('[syncHangupIvr]'));}if(_0x5095e0&&_0x5095e0[_0x3581('0x42')]!==_0x3581('0xba')&&isNotNull(this[_0x3581('0x20')][_0x5095e0[_0x3581('0xbb')]][_0x3581('0x127')])){delete this[_0x3581('0x26')][_0x570669[_0x3581('0xb9')]];this[_0x3581('0xf5')](this[_0x3581('0x20')][_0x5095e0[_0x3581('0xbb')]]);this[_0x3581('0x20')][_0x5095e0[_0x3581('0xbb')]][_0x3581('0xbd')]+=0x1;this[_0x3581('0x20')][_0x5095e0[_0x3581('0xbb')]]['outboundAnswerAgiCallsDay']+=0x1;_0x39df5f=new Hangup(_0x5095e0,_0x570669);_0x39df5f['state']=0x10;_0x39df5f[_0x3581('0x6c')]=_0x3581('0x128');_0x39df5f['membername']=_0x3581('0x129');hopperUtils[_0x3581('0xda')](_0x39df5f)[_0x3581('0x9b')](loggerCatch(_0x3581('0x126')));hopperUtils[_0x3581('0xc4')](_0x39df5f)[_0x3581('0x9b')](loggerCatch('[syncHangupIvr]'));}if(_0x5095e0&&_0x5095e0[_0x3581('0x42')]!==_0x3581('0xba')&&!isNotNull(this[_0x3581('0x20')][_0x5095e0[_0x3581('0xbb')]][_0x3581('0x127')])){delete this['uniqueId'][_0x570669['uniqueid']];this['updateOriginated'](this[_0x3581('0x20')][_0x5095e0[_0x3581('0xbb')]]);this[_0x3581('0x20')][_0x5095e0['queue']][_0x3581('0x12a')]+=0x1;_0x39df5f=new Hangup(_0x5095e0,_0x570669);_0x39df5f['state']=0xc;_0x39df5f[_0x3581('0x6c')]=_0x570669[_0x3581('0x12b')];_0x39df5f[_0x3581('0x10a')]=_0x3581('0x12c');hopperUtils[_0x3581('0xda')](_0x39df5f)['catch'](loggerCatch(_0x3581('0x126')));hopperUtils['moveContactManagedDialer'](_0x39df5f)['catch'](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x3581('0x1a')][_0x3581('0xa')]=function(_0x25e187){var _0x575c23=this;if(!_0x575c23[_0x3581('0x2c')][_0x25e187[_0x3581('0x48')]]){_0x575c23[_0x3581('0x2c')][_0x25e187[_0x3581('0x48')]]={'running':![]};}else if(_0x575c23[_0x3581('0x2c')][_0x25e187[_0x3581('0x48')]][_0x3581('0x12d')]===!![]){return;}else if(_0x575c23[_0x3581('0x2c')][_0x25e187[_0x3581('0x48')]][_0x3581('0x12d')]===![]){_0x575c23[_0x3581('0x2c')][_0x25e187[_0x3581('0x48')]][_0x3581('0x12d')]=!![];}var _0x1eead6=_0x575c23[_0x3581('0x20')][_0x25e187[_0x3581('0x48')]];var _0x2cf258=_0x1eead6[_0x3581('0x67')]!==utils[_0x3581('0x74')][_0x3581('0x78')];var _0x2641bb=utils[_0x3581('0x12e')](_0x1eead6);_0x1eead6[_0x3581('0x12f')]=utils['getQueueCampaignStatusMessage'](_0x1eead6,_0x575c23['trunks']);Promise[_0x3581('0xa2')]()['then'](function(){if(_0x1eead6[_0x3581('0x12f')]===utils['CAMPAIGN_STATUS'][_0x3581('0x78')]){if(_0x2cf258){clearPredictiveAttributes(_0x1eead6);_0x25e187[_0x3581('0x60')]=undefined;_0x25e187[_0x3581('0x28')]=undefined;}if(_0x1eead6[_0x3581('0x12f')]===utils[_0x3581('0x74')][_0x3581('0x78')]){_0x25e187[_0x3581('0x130')]=0x0;_0x25e187['paused']=0x0;_0x25e187['inUse']=0x0;_0x25e187[_0x3581('0x131')]=0x0;_0x25e187[_0x3581('0x132')]=0x0;}}else if(_0x1eead6[_0x3581('0x12f')]===utils['CAMPAIGN_STATUS'][_0x3581('0x133')]&&!_0x2641bb){return _0x575c23['ifTime'](_0x1eead6,!![])['then'](function(){return _0x575c23[_0x3581('0x8d')](_0x1eead6,![]);})[_0x3581('0x3f')](function(){return _0x575c23[_0x3581('0xa8')](_0x1eead6);})['catch'](function(_0x2244dd){loggerSyncQueueSummary[_0x3581('0x43')](_0x3581('0x134'),util['inspect'](_0x2244dd,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x1eead6);});}else{clearPredictiveAttributes(_0x1eead6);}})[_0x3581('0x3f')](function(){var _0x3917fc=_0x25e187[_0x3581('0x135')](_0x1eead6);if(_0x3917fc||_0x1eead6[_0x3581('0x136')]){_0x1eead6['queueSummaryCountersUpdated']=![];_0x25e187[_0x3581('0x137')](_0x1eead6);Object[_0x3581('0x138')](_0x1eead6,_0x25e187);emitOutboundVoiceQueueSummary(_0x25e187);}_0x575c23[_0x3581('0x2c')][_0x1eead6[_0x3581('0x48')]][_0x3581('0x12d')]=![];})[_0x3581('0x9b')](function(_0x39d5da){logger[_0x3581('0x64')]('[syncQueueSummary]',util[_0x3581('0x45')](_0x39d5da,{'showHidden':![],'depth':null}));_0x575c23[_0x3581('0x2c')][_0x1eead6[_0x3581('0x48')]][_0x3581('0x12d')]=![];});};Dialer['prototype'][_0x3581('0x139')]=_[_0x3581('0x13a')](function(){var _0x4879ea=_[_0x3581('0x13b')](this['voiceQueues'],function(_0x3e64ef){return _0x3e64ef[_0x3581('0x13c')];});var _0x2f647f=_[_0x3581('0x13b')](this[_0x3581('0x22')],function(_0x54baa6){return _0x54baa6[_0x3581('0x13d')]&&_0x54baa6[_0x3581('0x83')]===_0x3581('0x13e');});if(_0x4879ea['length']>0x0&&_0x2f647f[_0x3581('0xf7')]>0x0){return Promise[_0x3581('0xa2')]()[_0x3581('0x3f')](cmHopper[_0x3581('0x13f')](_[_0x3581('0x140')](_0x4879ea,'id'),previewRecallmeReminderInterval,_[_0x3581('0x140')](_0x2f647f,'id')))['then'](function(_0x20a6a6){for(var _0x370dcf=0x0;_0x370dcf<_0x20a6a6['length'];_0x370dcf++){var _0x1946c3=_0x20a6a6[_0x370dcf][_0x3581('0x141')][_0x3581('0x48')];if(_0x1946c3)io['to'](util[_0x3581('0x46')](_0x3581('0x142'),_0x1946c3))['emit'](_0x3581('0x143'),{'hopper':_0x20a6a6[_0x370dcf]});}})['catch'](function(_0x127c81){logger[_0x3581('0x64')](_0x3581('0x144'),_0x127c81);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x3581('0x1a')][_0x3581('0x3d')]=function(){var _0x9b4921=this;setInterval(function(){_0x9b4921['clearZombieChannels'](_0x9b4921['uniqueId'],_0x3581('0x145'));_0x9b4921[_0x3581('0x146')](_0x9b4921['actions'],_0x3581('0x147'));},0x32c8);};Dialer[_0x3581('0x1a')][_0x3581('0x146')]=function(_0x2c707e,_0x461470){var _0x89a208=this;for(var _0x3f9c85 in _0x2c707e){if(typeof _0x2c707e[_0x3f9c85]!==_0x3581('0x148')){this[_0x3581('0x1e')][_0x3581('0x1b')](function(){if(!_['isNil'](_0x2c707e[_0x3f9c85])){return ami['Action']({'action':_0x3581('0x83'),'channel':_0x2c707e[_0x3f9c85]['channel']})[_0x3581('0x9b')](function(_0x21e9a7){if(_0x21e9a7[_0x3581('0x67')]===_0x3581('0x149')){setTimeout(function(){if(_0x2c707e[_0x3f9c85]&&_0x2c707e[_0x3f9c85][_0x3581('0x42')]!==_0x3581('0xba')){_0x89a208[_0x3581('0xf5')](_0x89a208[_0x3581('0x20')][_0x2c707e[_0x3f9c85][_0x3581('0xbb')]]);logger[_0x3581('0x64')]('[Dialer][checkChannel]',_0x461470,_0x3f9c85,_0x2c707e[_0x3f9c85][_0x3581('0xbb')]);delete _0x2c707e[_0x3f9c85];}if(_0x2c707e[_0x3f9c85]&&_0x2c707e[_0x3f9c85]['type']==='ivr'){_0x89a208[_0x3581('0xf5')](_0x89a208[_0x3581('0x21')][_0x2c707e[_0x3f9c85][_0x3581('0xbb')]]);logger[_0x3581('0x64')](_0x3581('0x14a'),_0x461470,_0x3f9c85,_0x2c707e[_0x3f9c85]['queue']);delete _0x2c707e[_0x3f9c85];}},0x2328);}});}});}}};Dialer[_0x3581('0x1a')][_0x3581('0x14b')]=function(_0x2552e6){return Promise['resolve']()[_0x3581('0x3f')](voiceQueueRt[_0x3581('0x14b')](_0x2552e6))[_0x3581('0x9b')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x3581('0x1a')][_0x3581('0xf5')]=function(_0x460163){if(!_[_0x3581('0x41')](_0x460163)&&_0x460163!==null){if(typeof _0x460163[_0x3581('0x14c')]!=='undefined'){if(_0x460163[_0x3581('0x14c')]>0x0){_0x460163[_0x3581('0x14c')]-=0x1;}else{logger[_0x3581('0x64')](_0x3581('0x14d'));}}}else{logger[_0x3581('0x64')](_0x3581('0x14e'));}};Dialer[_0x3581('0x1a')]['loggerHandler']=function(_0x15247d,_0x3ee936){var _0x5154e4=this;return function(_0x142bce){_0x5154e4['updateOriginated'](_0x3ee936);logger[_0x3581('0x64')](_0x15247d,util[_0x3581('0x45')](_0x142bce,{'showHidden':![],'depth':null}));};};Dialer[_0x3581('0x1a')][_0x3581('0x14f')]=function(_0xee1f2b,_0x3cee8c,_0xf4dda2){var _0x4f0f9d={'state':0x19,'statedesc':_0x3581('0x150')};this[_0x3581('0xf5')](_0x3cee8c);this[_0x3581('0x121')](_['merge'](_0x4f0f9d,_[_0x3581('0x72')](_0xf4dda2,[_0x3581('0xd2'),_0x3581('0xd3'),'UserId',_0x3581('0xd4'),_0x3581('0xd5')])),_0x3581('0x151'),_0x3581('0x152'));logger['error'](_0xee1f2b);};Dialer[_0x3581('0x1a')]['saveInDb']=function(_0x137494,_0x1d73eb,_0x249eb7){hopperUtils[_0x3581('0xda')](_0x137494)[_0x3581('0x9b')](loggerCatch(_0x1d73eb));hopperUtils[_0x3581('0xc4')](_0x137494)[_0x3581('0x9b')](loggerCatch(_0x249eb7));};Dialer[_0x3581('0x1a')][_0x3581('0xcf')]=function(_0xf75878,_0x1a3936){hopperUtils[_0x3581('0xda')](_0xf75878)[_0x3581('0x9b')](loggerCatch(_0x3581('0xc3')));if(_0x1a3936==0x0){hopperUtils['moveContactManagedDialer'](_0xf75878)[_0x3581('0x9b')](loggerCatch(_0x3581('0x153')));}};Dialer['prototype'][_0x3581('0x144')]=function(_0x531afc){return Promise['resolve']()[_0x3581('0x3f')](cmHopper[_0x3581('0x13f')](_0x531afc['id'],previewRecallmeReminderInterval))[_0x3581('0x3f')](function(_0x87486a){for(var _0x446ed1=0x0;_0x446ed1<_0x87486a[_0x3581('0xf7')];_0x446ed1++){var _0xbae372=_0x87486a[_0x446ed1][_0x3581('0x141')][_0x3581('0x48')];if(_0xbae372)io['to'](util[_0x3581('0x46')](_0x3581('0x142'),_0xbae372))[_0x3581('0x10c')](_0x3581('0x143'),{'hopper':_0x87486a[_0x446ed1]});}})[_0x3581('0x9b')](function(){});};Dialer[_0x3581('0x1a')][_0x3581('0xa6')]=function(_0x5eb6bd){var _0x1784f1=this;return function(){_0x1784f1[_0x3581('0x154')](_0x5eb6bd);};};Dialer[_0x3581('0x1a')][_0x3581('0x155')]=function(_0x59a812,_0x48c08f){var _0x2551df=this;var _0xe6e4a0=uuid['v4']();this[_0x3581('0xe6')][_0xe6e4a0]=new Action(_0x59a812,_0x48c08f,_0xe6e4a0);return new Promise(function(_0x43fea5,_0x1f65d6){if(_[_0x3581('0x41')](_0x59a812)&&typeof _0x59a812!==_0x3581('0x156')){return _0x1f65d6(msgResponse(_0x3581('0x157'),_0x3581('0x8e'),'voiceQueue\x20is\x20undefine'));}if(_[_0x3581('0x41')](_0x48c08f[_0x3581('0x158')])||_0x48c08f[_0x3581('0x158')]===null){return _0x1f65d6(msgResponse(_0x3581('0x157'),_0x3581('0x8e'),_0x3581('0x159')));}var _0x203746={'XMD-CALLERID':_0x2551df[_0x3581('0xe6')][_0xe6e4a0][_0x3581('0x15a')](),'XMD-AGI':_0x59a812[_0x3581('0x127')]?util['format'](_0x3581('0x15b'),ipAgi,_0x59a812[_0x3581('0x127')]):_0x3581('0x15c'),'XMD-AGIAFTER':_0x59a812['dialQueueProject2']?util['format'](_0x3581('0x15b'),ipAgi,_0x59a812[_0x3581('0xc1')]):_0x3581('0x15c'),'XMD-QUEUE':utils[_0x3581('0x15d')](_0x59a812)?util[_0x3581('0x46')]('\x22%s,%s%s,,,%s\x22',_0x59a812[_0x3581('0x48')],_0x59a812[_0x3581('0x15e')]||'',_0x59a812[_0x3581('0xc2')]?'c':'',_0x59a812[_0x3581('0x15f')]||0x3):_0x3581('0x15c'),'XMD-CONTACTID':_0x48c08f[_0x3581('0xd2')],'XMD-CDRTYPE':_0x3581('0x7'),'CALLERID(all)':_0x2551df[_0x3581('0xe6')][_0xe6e4a0][_0x3581('0x15a')](),'XMD-AMD':_0x59a812[_0x3581('0x111')]?_0x3581('0x133'):_0x3581('0x15c'),'XMD-DESTINATION':_0x3581('0x105')};if(_0x59a812[_0x3581('0x111')]){_0x203746[_0x3581('0x160')]=_0x59a812[_0x3581('0x161')]||0x9c4;_0x203746[_0x3581('0x162')]=_0x59a812[_0x3581('0x163')]||0x5dc;_0x203746[_0x3581('0x164')]=_0x59a812[_0x3581('0x165')]||0x320;_0x203746[_0x3581('0x166')]=_0x59a812[_0x3581('0x167')]||0x1388;_0x203746[_0x3581('0x168')]=_0x59a812[_0x3581('0x169')]||0x64;_0x203746[_0x3581('0x16a')]=_0x59a812[_0x3581('0x16b')]||0x32;_0x203746['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x59a812[_0x3581('0x16c')]||0x3;_0x203746[_0x3581('0x16d')]=_0x59a812[_0x3581('0x16e')]||0x100;_0x203746['XMD-AMDMAXIMUMWORDLENGTH']=_0x59a812[_0x3581('0x16f')]||0x1388;}if(utils[_0x3581('0x15d')](_0x59a812)){_0x203746[_0x3581('0x170')]=_0x48c08f[_0x3581('0xd4')];}else{_0x203746['XMD-CAMPAIGNID']=_0x48c08f['CampaignId'];}for(var _0x315c0f in _0x48c08f['Contact']){if(typeof _0x48c08f[_0x3581('0x171')][_0x315c0f]!==_0x3581('0x148')){if(isNotNull(_0x48c08f['Contact'][_0x315c0f])&&_0x315c0f!=='id'&&_0x315c0f!=='tags'&&_0x315c0f!=='createdAt'&&_0x315c0f!=='updatedAt'){_0x203746[util[_0x3581('0x46')](_0x3581('0x172'),_0x3581('0x173'),_[_0x3581('0x174')](_0x315c0f))]=_0x48c08f[_0x3581('0x171')][_0x315c0f];}}}var _0x116a61=_0x2551df['isTrunkReachable'](_0x59a812['Trunk'])?utils[_0x3581('0x175')](_0x59a812['Trunk'][_0x3581('0x176')],_0x59a812[_0x3581('0x177')],_0x59a812[_0x3581('0x178')]>0x0?utils['getCallerIdRandom'](_0x59a812[_0x3581('0x179')],_0x59a812[_0x3581('0x178')]):_0x59a812[_0x3581('0x179')]):utils[_0x3581('0x175')](_[_0x3581('0xeb')](_0x59a812[_0x3581('0x87')])?_0x59a812[_0x3581('0x86')][_0x3581('0x176')]:_0x59a812[_0x3581('0x87')][_0x3581('0x176')],_0x59a812[_0x3581('0x177')],_0x59a812[_0x3581('0x178')]>0x0?utils['getCallerIdRandom'](_0x59a812[_0x3581('0x179')],_0x59a812[_0x3581('0x178')]):_0x59a812[_0x3581('0x179')]);if(_0x116a61){_0x203746['XMD-ORIGINATECALLERIDNAME']=_0x2551df['actions'][_0xe6e4a0][_0x3581('0x17a')]=utils[_0x3581('0x17b')](_0x116a61);_0x203746[_0x3581('0x17c')]=_0x48c08f[_0x3581('0x158')];}_0x59a812[_0x3581('0x17d')]=_0x203746;return ami[_0x3581('0x93')]({'actionid':_0xe6e4a0,'action':'originate','channel':_0x2551df[_0x3581('0x81')](_0x59a812[_0x3581('0x86')])?util['format']('SIP/%s/%s%s',_0x59a812[_0x3581('0x86')][_0x3581('0x48')],isNotNull(_0x59a812[_0x3581('0x17e')])?_0x59a812[_0x3581('0x17e')][_0x3581('0x17f')]()||'':'',_0x59a812[_0x3581('0x180')]>0x0?_0x48c08f[_0x3581('0x158')][_0x3581('0x181')](_0x59a812[_0x3581('0x180')]):_0x48c08f['phone']):util[_0x3581('0x46')](_0x3581('0x182'),_[_0x3581('0xeb')](_0x59a812[_0x3581('0x87')])?_0x59a812['Trunk'][_0x3581('0x48')]:_0x59a812[_0x3581('0x87')][_0x3581('0x48')],isNotNull(_0x59a812[_0x3581('0x17e')])?_0x59a812[_0x3581('0x17e')][_0x3581('0x17f')]()||'':'',_0x59a812[_0x3581('0x180')]>0x0?_0x48c08f[_0x3581('0x158')][_0x3581('0x181')](_0x59a812['dialCutDigit']):_0x48c08f[_0x3581('0x158')]),'callerid':_0x116a61,'Exten':_0x3581('0x105'),'Context':_0x3581('0x183'),'Priority':'1','variable':_0x203746,'timeout':(_0x59a812[_0x3581('0x184')]||0x1e)*0x3e8,'async':!![],'channelid':_0xe6e4a0})[_0x3581('0x3f')](function(_0x1cdf70){return _0x43fea5(_0x1cdf70);})['catch'](function(_0x181894){_0x59a812[_0x3581('0x185')]+=0x1;var _0x34802a=new History(_0x2551df[_0x3581('0xe6')][_0xe6e4a0]);logger[_0x3581('0x64')](util['format'](_0x3581('0x186'),JSON[_0x3581('0x71')](_0x181894)));_0x34802a[_0x3581('0x6b')]=0xe;_0x34802a[_0x3581('0x6c')]=_0x3581('0x187');_0x34802a[_0x3581('0x6d')]=moment()[_0x3581('0x46')](_0x3581('0xbc'));_0x34802a[_0x3581('0xd7')]=_0x34802a[_0x3581('0x6d')];hopperUtils[_0x3581('0xda')](_0x34802a)[_0x3581('0x9b')](loggerCatch(_0x3581('0x188')));_0x2551df[_0x3581('0xc4')](_0x34802a)[_0x3581('0x9b')](loggerCatch(_0x3581('0x188')))[_0x3581('0x1d')](function(){delete _0x2551df[_0x3581('0xe6')][_0xe6e4a0];return _0x1f65d6(msgResponse(_0x3581('0x157'),_0x3581('0x80'),_0x3581('0x189')));});});});};Dialer[_0x3581('0x1a')][_0x3581('0x18a')]=function(_0x18eb98,_0x340d38,_0x292e53){var _0x3b6dd8=new History(_0x340d38);if(_0x3b6dd8[_0x3581('0x114')]+_0x3b6dd8[_0x3581('0x115')]+_0x3b6dd8[_0x3581('0x116')]+_0x3b6dd8['countnosuchnumberretry']+_0x3b6dd8[_0x3581('0xc9')]+_0x3b6dd8[_0x3581('0xdf')]+_0x3b6dd8['countmachineretry']+_0x3b6dd8[_0x3581('0x118')]>=_0x292e53[_0x3581('0x119')]-0x1){return!![];}switch(_0x18eb98){case 0x3:if(_0x3b6dd8[_0x3581('0x116')]>=_0x292e53['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0x3581('0xe3')]({'active':![],'countnoanswerretry':_0x3b6dd8[_0x3581('0x116')]+=0x1,'scheduledat':moment()[_0x3581('0xe4')](_0x292e53[_0x3581('0x18b')],_0x3581('0xd1'))[_0x3581('0x46')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3b6dd8[_0x3581('0xd2')],'ListId':_0x3b6dd8[_0x3581('0xd3')],'VoiceQueueId':_0x3b6dd8[_0x3581('0xd4')]||undefined,'CampaignId':_0x3b6dd8['CampaignId']||undefined})[_0x3581('0x9b')](loggerCatch(_0x3581('0x18c')));break;case 0x5:if(_0x3b6dd8['countbusyretry']>=_0x292e53[_0x3581('0x18d')]-0x1){return!![];}hopperUtils[_0x3581('0xe3')]({'active':![],'countbusyretry':_0x3b6dd8['countbusyretry']+=0x1,'scheduledat':moment()[_0x3581('0xe4')](_0x292e53[_0x3581('0x18e')],'minutes')[_0x3581('0x46')](_0x3581('0xbc')),'ContactId':_0x3b6dd8['ContactId'],'ListId':_0x3b6dd8[_0x3581('0xd3')],'VoiceQueueId':_0x3b6dd8[_0x3581('0xd4')]||undefined,'CampaignId':_0x3b6dd8[_0x3581('0xd5')]||undefined})[_0x3581('0x9b')](loggerCatch(_0x3581('0x18f')));break;case 0x8:if(_0x3b6dd8[_0x3581('0x115')]>=_0x292e53[_0x3581('0x190')]-0x1){return!![];}hopperUtils[_0x3581('0xe3')]({'active':![],'countcongestionretry':_0x3b6dd8['countcongestionretry']+=0x1,'scheduledat':moment()[_0x3581('0xe4')](_0x292e53['dialCongestionRetryFrequency'],_0x3581('0xd1'))[_0x3581('0x46')](_0x3581('0xbc')),'ContactId':_0x3b6dd8[_0x3581('0xd2')],'ListId':_0x3b6dd8['ListId'],'VoiceQueueId':_0x3b6dd8[_0x3581('0xd4')]||undefined,'CampaignId':_0x3b6dd8['CampaignId']||undefined})[_0x3581('0x9b')](loggerCatch(_0x3581('0x191')));break;case 0x0:if(_0x3b6dd8[_0x3581('0x117')]>=_0x292e53[_0x3581('0x192')]-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x3b6dd8[_0x3581('0x117')]+=0x1,'scheduledat':moment()['add'](_0x292e53[_0x3581('0x193')],_0x3581('0xd1'))[_0x3581('0x46')](_0x3581('0xbc')),'ContactId':_0x3b6dd8[_0x3581('0xd2')],'ListId':_0x3b6dd8[_0x3581('0xd3')],'VoiceQueueId':_0x3b6dd8[_0x3581('0xd4')]||undefined,'CampaignId':_0x3b6dd8[_0x3581('0xd5')]||undefined})[_0x3581('0x9b')](loggerCatch(_0x3581('0x194')));}break;case 0xa:if(_0x3b6dd8[_0x3581('0xc9')]>=_0x292e53[_0x3581('0xce')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x3b6dd8['countdropretry']+=0x1,'scheduledat':moment()[_0x3581('0xe4')](_0x292e53[_0x3581('0xd0')],_0x3581('0xd1'))[_0x3581('0x46')](_0x3581('0xbc')),'ContactId':_0x3b6dd8['ContactId'],'ListId':_0x3b6dd8['ListId'],'VoiceQueueId':_0x3b6dd8['VoiceQueueId']||undefined,'CampaignId':_0x3b6dd8[_0x3581('0xd5')]||undefined})[_0x3581('0x9b')](loggerCatch(_0x3581('0xd6')));break;case 0xb:if(_0x3b6dd8[_0x3581('0xdf')]>=_0x292e53[_0x3581('0xe2')]-0x1){return!![];}hopperUtils[_0x3581('0xe3')]({'active':![],'countabandonedretry':_0x3b6dd8['countabandonedretry']+=0x1,'scheduledat':moment()[_0x3581('0xe4')](_0x292e53[_0x3581('0xe0')],_0x3581('0xd1'))[_0x3581('0x46')](_0x3581('0xbc')),'ContactId':_0x3b6dd8[_0x3581('0xd2')],'ListId':_0x3b6dd8['ListId'],'VoiceQueueId':_0x3b6dd8['VoiceQueueId']||undefined,'CampaignId':_0x3b6dd8[_0x3581('0xd5')]||undefined})[_0x3581('0x9b')](loggerCatch(_0x3581('0x195')));break;case 0x13:if(_0x3b6dd8[_0x3581('0x112')]>=_0x292e53[_0x3581('0x11c')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x3b6dd8[_0x3581('0x112')]+=0x1,'scheduledat':moment()[_0x3581('0xe4')](_0x292e53[_0x3581('0x11f')],_0x3581('0xd1'))[_0x3581('0x46')](_0x3581('0xbc')),'ContactId':_0x3b6dd8[_0x3581('0xd2')],'ListId':_0x3b6dd8[_0x3581('0xd3')],'VoiceQueueId':_0x3b6dd8[_0x3581('0xd4')]||undefined,'CampaignId':_0x3b6dd8['CampaignId']||undefined})[_0x3581('0x9b')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x3b6dd8['countagentrejectretry']>=_0x292e53[_0x3581('0x196')]-0x1){return!![];}hopperUtils[_0x3581('0xe3')]({'active':![],'countagentrejectretry':_0x3b6dd8[_0x3581('0x118')]+=0x1,'scheduledat':moment()[_0x3581('0xe4')](_0x292e53[_0x3581('0x197')],_0x3581('0xd1'))[_0x3581('0x46')](_0x3581('0xbc')),'ContactId':_0x3b6dd8[_0x3581('0xd2')],'ListId':_0x3b6dd8[_0x3581('0xd3')],'VoiceQueueId':_0x3b6dd8[_0x3581('0xd4')]||undefined,'CampaignId':_0x3b6dd8[_0x3581('0xd5')]||undefined})[_0x3581('0x9b')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x3581('0x1a')][_0x3581('0x101')]=function(_0x175070,_0x1a5735,_0x10fd6a){var _0x4e1f0e=this;var _0x36cf2f=new History(_0x175070);var _0x391085=![];var _0x10430f;var _0x15790e;return new Promise(function(_0x1254ca,_0x5bb66b){if(_[_0x3581('0x41')](_0x1a5735)&&typeof _0x1a5735!==_0x3581('0x156')){return _0x5bb66b(msgResponse(_0x3581('0x198'),'Failure',_0x3581('0x199')));}if(_[_0x3581('0x41')](_0x10fd6a)&&typeof _0x10fd6a!==_0x3581('0x156')){return _0x5bb66b(msgResponse(_0x3581('0x198'),'Failure',_0x3581('0x19a')));}hopperUtils['verifyAdditionalPhones'](_0x36cf2f,_0x10fd6a['reason'],_0x1a5735)['then'](function(_0x2b36b8){if(_0x2b36b8[_0x3581('0xcd')]==0x1)_0x391085=!![];switch(_0x10fd6a[_0x3581('0xbe')]){case'0':_0x1a5735[_0x3581('0x19b')]+=0x1;_0x36cf2f['state']=0x0;_0x36cf2f[_0x3581('0x6c')]=_0x3581('0x19c');_0x36cf2f[_0x3581('0x117')]+=0x1;_0x36cf2f[_0x3581('0xca')]+=0x1;ami[_0x3581('0x10c')](_0x3581('0x19d'),ut[_0x3581('0x10e')](_0x175070,_0x3581('0x19e')));_0x10430f=_0x1a5735[_0x3581('0x193')];_0x15790e=_0x1a5735[_0x3581('0xcb')];hopperUtils['createHistory'](_0x36cf2f)[_0x3581('0x9b')](loggerCatch(_0x3581('0x113')));if(_0x4e1f0e['checkRetriveMax'](0x0,_0x175070,_0x1a5735)&&!_0x391085){if(_0x36cf2f[_0x3581('0x117')]>=_0x1a5735['dialNoSuchNumberMaxRetry']){_0x4e1f0e[_0x3581('0x11d')](_0x36cf2f,_0x1254ca,_0x5bb66b,_0x3581('0x19f'));}else{_0x4e1f0e[_0x3581('0x11a')](_0x36cf2f,_0x1254ca,_0x5bb66b,_0x3581('0x19f'));}}break;case'3':_0x1a5735[_0x3581('0x1a0')]+=0x1;_0x36cf2f[_0x3581('0x6b')]=0x3;_0x36cf2f['statedesc']=_0x3581('0x1a1');_0x36cf2f['countnoanswerretry']+=0x1;_0x36cf2f[_0x3581('0xca')]+=0x1;var _0x16f464=ut['buildNoAnswerEventPayload'](_0x175070,_0x1a5735);ami['emit'](_0x3581('0x1a2'),_0x16f464);_0x10430f=_0x1a5735[_0x3581('0x18b')];_0x15790e=_0x1a5735[_0x3581('0xcb')];hopperUtils['createHistory'](_0x36cf2f)[_0x3581('0x9b')](loggerCatch(_0x3581('0x1a3')));if(_0x4e1f0e['checkRetriveMax'](0x3,_0x175070,_0x1a5735)&&!_0x391085){if(_0x36cf2f[_0x3581('0x116')]>=_0x1a5735['dialNoAnswerMaxRetry']){_0x4e1f0e[_0x3581('0x11d')](_0x36cf2f,_0x1254ca,_0x5bb66b,_0x3581('0x1a4'));}else{_0x4e1f0e[_0x3581('0x11a')](_0x36cf2f,_0x1254ca,_0x5bb66b,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x1a5735[_0x3581('0x1a5')]+=0x1;_0x36cf2f[_0x3581('0x6b')]=0x5;_0x36cf2f[_0x3581('0x6c')]=_0x3581('0x1a6');_0x36cf2f['countbusyretry']+=0x1;_0x36cf2f[_0x3581('0xca')]+=0x1;ami[_0x3581('0x10c')](_0x3581('0x1a7'),ut[_0x3581('0x10e')](_0x175070,_0x3581('0x1a8')));_0x10430f=_0x1a5735[_0x3581('0x18e')];_0x15790e=_0x1a5735['callAdditionalPhoneAfterMin'];hopperUtils[_0x3581('0xda')](_0x36cf2f)[_0x3581('0x9b')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x4e1f0e[_0x3581('0x18a')](0x5,_0x175070,_0x1a5735)&&!_0x391085){if(_0x36cf2f['countbusyretry']>=_0x1a5735[_0x3581('0x18d')]){_0x4e1f0e[_0x3581('0x11d')](_0x36cf2f,_0x1254ca,_0x5bb66b,'reason\x205\x20busy');}else{_0x4e1f0e[_0x3581('0x11a')](_0x36cf2f,_0x1254ca,_0x5bb66b,_0x3581('0x1a9'));}}break;case'8':_0x1a5735[_0x3581('0x1aa')]+=0x1;_0x36cf2f[_0x3581('0x6b')]=0x8;_0x36cf2f[_0x3581('0x6c')]=_0x3581('0x1ab');_0x36cf2f[_0x3581('0x115')]+=0x1;_0x36cf2f['countglobal']+=0x1;_0x10430f=_0x1a5735['dialCongestionRetryFrequency'];_0x15790e=_0x1a5735[_0x3581('0xcb')];ami[_0x3581('0x10c')]('custom:agentcongestion',ut[_0x3581('0x10e')](_0x175070,_0x3581('0x1ac')));hopperUtils[_0x3581('0xda')](_0x36cf2f)[_0x3581('0x9b')](loggerCatch(_0x3581('0x1ad')));if(_0x4e1f0e[_0x3581('0x18a')](0x8,_0x175070,_0x1a5735)&&!_0x391085){if(_0x36cf2f[_0x3581('0x115')]>=_0x1a5735[_0x3581('0x190')]){_0x4e1f0e[_0x3581('0x11d')](_0x36cf2f,_0x1254ca,_0x5bb66b,_0x3581('0x1ae'));}else{_0x4e1f0e['stateGlobal'](_0x36cf2f,_0x1254ca,_0x5bb66b,_0x3581('0x1ae'));}}break;case'11':_0x1a5735[_0x3581('0x1af')]+=0x1;_0x36cf2f[_0x3581('0x6b')]=0xb;_0x36cf2f['statedesc']=_0x3581('0xdd');_0x36cf2f[_0x3581('0xdf')]+=0x1;_0x36cf2f['countglobal']+=0x1;_0x10430f=_0x1a5735[_0x3581('0xe0')];_0x15790e=_0x1a5735[_0x3581('0xcb')];hopperUtils['createHistory'](_0x36cf2f)[_0x3581('0x9b')](loggerCatch(_0x3581('0x1b0')));if(_0x4e1f0e['checkRetriveMax'](0xb,_0x175070,_0x1a5735)&&!_0x391085){if(_0x36cf2f['countabandonedretry']>=_0x1a5735['dialAbandonedMaxRetry']){_0x4e1f0e[_0x3581('0x11d')](_0x36cf2f,_0x1254ca,_0x5bb66b,'reason\x2011\x20abandoned');}else{_0x4e1f0e[_0x3581('0x11a')](_0x36cf2f,_0x1254ca,_0x5bb66b,'reason\x2011\x20abandoned');}}break;case'20':_0x1a5735[_0x3581('0x1b1')]+=0x1;_0x36cf2f['state']=0x14;_0x36cf2f[_0x3581('0x6c')]=_0x3581('0x1b2');_0x36cf2f[_0x3581('0x118')]+=0x1;_0x36cf2f['countglobal']+=0x1;_0x10430f=_0x1a5735[_0x3581('0x197')];_0x15790e=_0x1a5735[_0x3581('0xcb')];ami[_0x3581('0x10c')](_0x3581('0x1b3'),ut[_0x3581('0x10e')](_0x175070,_0x3581('0x1b4')));hopperUtils[_0x3581('0xda')](_0x36cf2f)[_0x3581('0x9b')](loggerCatch(_0x3581('0x1b5')));if(_0x4e1f0e[_0x3581('0x18a')](0x14,_0x175070,_0x1a5735)&&!_0x391085){if(_0x36cf2f[_0x3581('0x118')]>=_0x1a5735[_0x3581('0x196')]){_0x4e1f0e[_0x3581('0x11d')](_0x36cf2f,_0x1254ca,_0x5bb66b,'reason\x2020\x20agentreject');}else{_0x4e1f0e[_0x3581('0x11a')](_0x36cf2f,_0x1254ca,_0x5bb66b,_0x3581('0x1b6'));}}break;default:_0x1a5735[_0x3581('0x12a')]+=0x1;_0x36cf2f[_0x3581('0x6b')]=0xc;_0x36cf2f['statedesc']=_0x10fd6a[_0x3581('0xbe')];_0x10430f=_0x1a5735[_0x3581('0x197')];_0x15790e=_0x1a5735[_0x3581('0xcb')];hopperUtils[_0x3581('0xda')](_0x36cf2f)[_0x3581('0x9b')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x4e1f0e[_0x3581('0x18a')](_0x10fd6a[_0x3581('0xbe')],_0x175070,_0x1a5735)&&!_0x391085){if(_0x36cf2f[_0x3581('0x114')]+_0x36cf2f[_0x3581('0x115')]+_0x36cf2f[_0x3581('0x116')]+_0x36cf2f['countnosuchnumberretry']+_0x36cf2f[_0x3581('0xc9')]+_0x36cf2f[_0x3581('0xdf')]+_0x36cf2f['countmachineretry']+_0x36cf2f[_0x3581('0x118')]>=_0x1a5735[_0x3581('0x119')]){_0x4e1f0e[_0x3581('0x11a')](_0x36cf2f,_0x1254ca,_0x5bb66b,_0x10fd6a[_0x3581('0xbe')]);}else{_0x4e1f0e['createStateFinal'](_0x36cf2f,_0x1254ca,_0x5bb66b,_0x10fd6a[_0x3581('0xbe')]);}}}})[_0x3581('0x3f')](function(){if(_0x391085){hopperUtils[_0x3581('0xdb')](_0x36cf2f,_0x10430f,_0x15790e)['then'](function(){return _0x1254ca(0x1);});}});});};Dialer[_0x3581('0x1a')]['stateGlobal']=function(_0x2f1bf2,_0xf7b50,_0x516456,_0x377f52){var _0x409c56=new Final(_0x2f1bf2);_0x409c56[_0x3581('0x6b')]=0xf;_0x409c56[_0x3581('0x6c')]=_0x3581('0x1b7');this[_0x3581('0x11d')](_0x409c56,_0xf7b50,_0x516456,_0x377f52);};Dialer[_0x3581('0x1a')][_0x3581('0x11d')]=function(_0x95be3f,_0x4de00a,_0x27624a,_0x35c086){hopperUtils[_0x3581('0xc4')](_0x95be3f)['then'](function(){return _0x4de00a(msgResponse(_0x3581('0x198'),_0x3581('0x100'),_0x35c086));})[_0x3581('0x9b')](function(){return _0x27624a(msgResponse(_0x3581('0x1b8'),'Failure',_0x3581('0x1b9')));});};Dialer[_0x3581('0x1a')]['predictive']=function(_0x172ec2){var _0x3f8398=_0x172ec2['dialPredictiveOptimizationPercentage']/0x64;var _0xdbe37c=_0x172ec2[_0x3581('0x1ba')]/(_0x172ec2[_0x3581('0x1ba')]+_0x172ec2['outboundAnswerCallsDay']);var _0x4d0b44=Math[_0x3581('0x1bb')](_0x172ec2['predictiveIntervalAvailable']*(_0x172ec2[_0x3581('0x1bc')]/0x64));var _0x3accf1=Math[_0x3581('0x1bb')](_0x172ec2[_0x3581('0x1bd')]*(_0x172ec2[_0x3581('0x1be')]/0x64));var _0x354056=_0x172ec2[_0x3581('0x130')]+_0x172ec2[_0x3581('0x131')];var _0x220899=Math[_0x3581('0x1bf')](_0x172ec2[_0x3581('0x5a')]*_0x172ec2[_0x3581('0x5c')]*_0x172ec2[_0x3581('0x1c0')]*_0x172ec2[_0x3581('0x1c1')]);if(_[_0x3581('0x41')](_0x172ec2[_0x3581('0x28')])){if(!_[_0x3581('0x41')](_0x172ec2['startPredictive'])){_0x172ec2[_0x3581('0x60')]=undefined;loggerPredictive['error'](_0x3581('0x1c2'),_0x3581('0x1c3'));}if(!_[_0x3581('0x41')](_0x172ec2[_0x3581('0x62')])){loggerPredictive[_0x3581('0x64')](_0x3581('0x1c2'),_0x3581('0x1c4'));clearInterval(_0x172ec2[_0x3581('0x62')]);_0x172ec2[_0x3581('0x62')]=undefined;}_0x172ec2[_0x3581('0x28')]=moment()['format'](_0x3581('0xbc'));loggerPredictive['info'](_0x172ec2['name'],_0x3581('0x1c5'),_0x172ec2[_0x3581('0x28')]);this[_0x3581('0xac')](_0x172ec2,0x1);}else if(ifInterval(_0x172ec2[_0x3581('0x1c6')],_0x172ec2[_0x3581('0x28')])){this[_0x3581('0xac')](_0x172ec2,0x1);loggerPredictiveCalls[_0x3581('0x4e')](_0x3581('0x1c7'),_0x172ec2[_0x3581('0x28')],_0x172ec2[_0x3581('0x48')]);_0x172ec2['erlangCalls']=0x0;_0x172ec2['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x3f8398<_0xdbe37c&&_0x172ec2['dialPredictiveOptimization']===_0x3581('0x1c8')){clearPredictiveAttributes(_0x172ec2);loggerPredictive[_0x3581('0x4e')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x3581('0x1c9'),_0xdbe37c,_0x3581('0x28'),_0x172ec2[_0x3581('0x48')]);}else if(_0x220899<_0x172ec2[_0x3581('0xc6')]&&_0x172ec2[_0x3581('0x1ca')]===_0x3581('0x1c8')){clearPredictiveAttributes(_0x172ec2);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x3581('0x1cb'),_0x220899,'Drop\x20in\x20this\x20interval',_0x172ec2['predictiveIntervalErlangCallsDroppedCalls'],_0x3581('0x28'),_0x172ec2['name']);}else if(!ifInterval(_0x172ec2['dialPredictiveInterval'],_0x172ec2[_0x3581('0x28')])&&_[_0x3581('0x41')](_0x172ec2[_0x3581('0x60')])&&!_[_0x3581('0x41')](_0x172ec2[_0x3581('0x28')])){_0x172ec2[_0x3581('0x60')]=moment()['format'](_0x3581('0xbc'));loggerPredictive['info'](_0x172ec2[_0x3581('0x48')],_0x3581('0x1cc'),_0x172ec2[_0x3581('0x60')]);hopperUtils['avgHandleTime'](_0x172ec2['dialPredictiveInterval'])[_0x3581('0x3f')](this[_0x3581('0x1cd')](_0x172ec2))[_0x3581('0x3f')](mergeDataErlangB(_0x172ec2))[_0x3581('0x3f')](this['startMethodPredictive'](_0x172ec2))[_0x3581('0x9b')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x172ec2));}else if(!ifInterval(_0x172ec2['dialPredictiveInterval'],_0x172ec2['startPredictive'])){_0x172ec2[_0x3581('0xc6')]=0x0;_0x172ec2[_0x3581('0x60')]=moment()[_0x3581('0x46')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x172ec2['name'],'recalculate\x20predictive\x20at',_0x172ec2[_0x3581('0x60')]);clearInterval(_0x172ec2[_0x3581('0x62')]);_0x172ec2[_0x3581('0x62')]=undefined;hopperUtils[_0x3581('0x1ce')](_0x172ec2[_0x3581('0x1c6')])['then'](this[_0x3581('0x1cd')](_0x172ec2))['then'](mergeDataErlangB(_0x172ec2))[_0x3581('0x3f')](this['startMethodPredictive'](_0x172ec2))[_0x3581('0x9b')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x172ec2));}else if(_0x172ec2[_0x3581('0x1bd')]&&_0x354056<_0x172ec2[_0x3581('0x1bd')]-_0x3accf1){clearPredictiveAttributes(_0x172ec2);loggerPredictive[_0x3581('0x4e')](_0x172ec2['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x354056,_0x3581('0x1cf'),_0x172ec2[_0x3581('0x1bd')],'-',_0x3accf1,'=',_0x172ec2[_0x3581('0x1bd')]-_0x3accf1,')');}else if(_0x172ec2[_0x3581('0x1bd')]&&_0x354056>_0x172ec2[_0x3581('0x1bd')]+_0x4d0b44){clearPredictiveAttributes(_0x172ec2);loggerPredictive[_0x3581('0x4e')](_0x172ec2[_0x3581('0x48')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x354056,_0x3581('0x1d0'),_0x172ec2[_0x3581('0x1bd')],'+',_0x4d0b44,'=',_0x172ec2[_0x3581('0x1bd')]+_0x4d0b44,')');}};Dialer[_0x3581('0x1a')][_0x3581('0x1cd')]=function(_0x562d1b){var _0x1ad7fa=this;return function(_0x3536e2){return new Promise(function(_0x2e935a,_0x2015c8){_[_0x3581('0x1d1')](_0x562d1b,_0x3536e2[0x0]);if(checkGetDataPredictive(_0x3536e2[0x0])){var _0x3f0bee=_0x562d1b[_0x3581('0x1bd')]=_0x562d1b[_0x3581('0x131')]+_0x562d1b[_0x3581('0x130')];var _0x33ba15=_0x562d1b[_0x3581('0x1c6')]*0x3c;var _0xe581f7=_0x3536e2[0x0][_0x3581('0x55')]+_0x3536e2[0x0]['predictiveIntervalAvgHoldtime'];var _0x55730a=(_0x3536e2[0x0][_0x3581('0x1d2')]+_0x3536e2[0x0][_0x3581('0x51')]+_0x3536e2[0x0][_0x3581('0x53')])/_0x3536e2[0x0][_0x3581('0x4d')];_0x562d1b[_0x3581('0x1c0')]=_0x55730a>0x0?_0x55730a:0x1;switch(_0x562d1b[_0x3581('0x1ca')]){case _0x3581('0x1c8'):var _0x47a5e6=_0x562d1b[_0x3581('0x1d3')]/0x64;return _0x1ad7fa['abandonmentRate'](_0x3f0bee,_0x33ba15,_0xe581f7,_0x55730a,_0x47a5e6)['then'](function(_0x46b3ce){return _0x2e935a(_0x46b3ce);});case _0x3581('0x1d4'):var _0x2af9ad=_0x562d1b['dialPredictiveOptimizationPercentage']/0x64;return _0x1ad7fa[_0x3581('0x1d5')](_0x3f0bee,_0x33ba15,_0xe581f7,_0x55730a,_0x2af9ad)['then'](function(_0x2a1f23){return _0x2e935a(_0x2a1f23);});default:return _0x2015c8(msgResponse(_0x3581('0x1d6'),_0x3581('0x8e'),_0x3581('0x1d7')));}}else{return _0x2015c8(msgResponse(_0x3581('0x1d6'),_0x3581('0x8e'),_0x3581('0x1d8')));}});};};Dialer['prototype']['getDataPredictiveOld']=function(_0x5849fc){var _0xe63b57=this;return function(_0x2cb8e7){return new Promise(function(_0x59742f,_0x2d2379){_['merge'](_0x5849fc,_0x2cb8e7[0x0]);if(checkGetDataPredictive(_0x2cb8e7[0x0])){loggerPredictive[_0x3581('0x4e')](JSON['stringify'](_0x2cb8e7[0x0]));if(_0x5849fc['dialPredictiveOptimization']===_0x3581('0x1c8')){return _0xe63b57[_0x3581('0x14b')](_0x5849fc['id'])[_0x3581('0x3f')](function(_0x269f6a){var _0x3fbd22=_0x5849fc[_0x3581('0x1d9')]-_0x269f6a[0x0][_0x3581('0x1da')];var _0x51b5b9=_0x5849fc[_0x3581('0x1c6')]*0x3c;var _0x49000c=_0x2cb8e7[0x0][_0x3581('0x55')]+_0x2cb8e7[0x0][_0x3581('0x57')];var _0x517d84=(_0x2cb8e7[0x0][_0x3581('0x1d2')]+_0x2cb8e7[0x0][_0x3581('0x51')]+_0x2cb8e7[0x0][_0x3581('0x53')])/_0x2cb8e7[0x0]['predictiveIntervalTotalCalls'];var _0x4c5165=_0x5849fc['dialPredictiveOptimizationPercentage']/0x64;_0x5849fc['predictiveIntervalPauses']=_0x269f6a[0x0]['outboundQueuePauses']||0x0;_0x5849fc[_0x3581('0x1c0')]=_0x517d84>0x0?_0x517d84:0x1;return _0xe63b57[_0x3581('0x1db')](_0x3fbd22,_0x51b5b9,_0x49000c,_0x517d84,_0x4c5165);})['then'](function(_0x5d3c0d){return _0x59742f(_0x5d3c0d);})['catch'](function(_0x3d264a){return _0x2d2379(msgResponse(_0x3581('0x1dc'),_0x3581('0x8e'),JSON[_0x3581('0x71')](_0x3d264a)));});}if(_0x5849fc[_0x3581('0x1ca')]===_0x3581('0x1d4')){return _0xe63b57[_0x3581('0x14b')](_0x5849fc['id'])['then'](function(_0x47521c){var _0x1c38a3=_0x5849fc[_0x3581('0x1d9')]-_0x47521c[0x0][_0x3581('0x1da')];var _0x36e964=_0x5849fc[_0x3581('0x1c6')]*0x3c;var _0x1ddd22=_0x2cb8e7[0x0][_0x3581('0x55')]+_0x2cb8e7[0x0][_0x3581('0x57')];var _0x30901b=(_0x2cb8e7[0x0][_0x3581('0x1d2')]+_0x2cb8e7[0x0][_0x3581('0x51')]+_0x2cb8e7[0x0][_0x3581('0x53')])/_0x2cb8e7[0x0][_0x3581('0x4d')];var _0x65da6a=_0x5849fc['dialPredictiveOptimizationPercentage']/0x64;_0x5849fc['predictiveIntervalPauses']=_0x47521c[0x0][_0x3581('0x1da')]||0x0;_0x5849fc[_0x3581('0x1c0')]=_0x30901b>0x0?_0x30901b:0x1;return _0xe63b57[_0x3581('0x1d5')](_0x1c38a3,_0x36e964,_0x1ddd22,_0x30901b,_0x65da6a);})[_0x3581('0x3f')](function(_0x482028){return _0x59742f(_0x482028);})['catch'](function(_0x2f49b3){return _0x2d2379(msgResponse(_0x3581('0x1dc'),'Failure',JSON[_0x3581('0x71')](_0x2f49b3)));});}}else{return _0x2d2379(msgResponse(_0x3581('0x1d6'),_0x3581('0x8e'),_0x3581('0x1d8')));}});};};Dialer[_0x3581('0x1a')][_0x3581('0x1dd')]=function(_0x48dd26){var _0x1dfa8a=this;return function(){var _0x12c967=0x0;var _0x315730=Math[_0x3581('0x1bf')](_0x48dd26[_0x3581('0x5b')]*0x3e8);if(_0x315730>0x0){_0x315730=_0x315730<0x64?0x64:_0x315730;loggerPredictive[_0x3581('0x4e')](_0x48dd26[_0x3581('0x48')],_0x3581('0x1de'),_0x315730,'milliseconds');_0x48dd26[_0x3581('0x62')]=setInterval(function(){_0x1dfa8a[_0x3581('0x62')](_0x48dd26);loggerPredictiveCalls[_0x3581('0x4e')](_0x3581('0x1df'),_0x12c967+=0x1);},_0x315730);}else{loggerPredictive[_0x3581('0x4e')](_0x48dd26[_0x3581('0x48')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x3581('0x1a')][_0x3581('0x1e0')]=function(_0x39c515,_0x319b0a){var _0x4dbfbd=this;return function(_0x7a1a1f){if(_[_0x3581('0x4a')](_0x7a1a1f)){if(_[_0x3581('0xeb')](_0x319b0a[_0x3581('0x1e1')])||!_0x319b0a[_0x3581('0x1e2')]){if(_0x39c515[_0x3581('0xa9')]===_0x3581('0x8')){_0x39c515[_0x3581('0x6e')]=_[_0x3581('0x41')](_0x39c515[_0x3581('0x6e')])?!![]:_0x39c515[_0x3581('0x6e')];var _0x130c7b=uuid['v4']();_0x4dbfbd[_0x3581('0xe6')][_0x130c7b]=new Action(_0x39c515,_0x319b0a,_0x130c7b);loggerBooked['info'](_0x3581('0x1e3'),_0x130c7b,_0x3581('0x1e4'),JSON['stringify'](_0x39c515['queueStatusComplete']),_0x3581('0x1e5'),_0x39c515['name']);if(_0x39c515[_0x3581('0x6e')]){_0x39c515[_0x3581('0x6e')]=![];_0x4dbfbd[_0x3581('0x2a')][_0x4dbfbd[_0x3581('0xe6')][_0x130c7b][_0x3581('0xbb')]]=[];ami[_0x3581('0x93')]({'actionid':_0x130c7b,'action':_0x3581('0x1e6'),'queue':_0x39c515['name']})[_0x3581('0x9b')](function(){_0x4dbfbd[_0x3581('0xf5')](_0x39c515);hopperUtils[_0x3581('0xe3')]({'active':![],'ContactId':_0x4dbfbd[_0x3581('0xe6')][_0x130c7b][_0x3581('0xd2')],'ListId':_0x4dbfbd[_0x3581('0xe6')][_0x130c7b][_0x3581('0xd3')],'VoiceQueueId':_0x4dbfbd[_0x3581('0xe6')][_0x130c7b][_0x3581('0xd4')]||undefined,'CampaignId':_0x4dbfbd[_0x3581('0xe6')][_0x130c7b][_0x3581('0xd5')]||undefined})[_0x3581('0x9b')](loggerCatch(_0x3581('0x1e7')));delete _0x4dbfbd[_0x3581('0xe6')][_0x130c7b];});}else{loggerBooked[_0x3581('0x4e')](_0x3581('0x1e8'),JSON[_0x3581('0x71')](_0x39c515['queueStatusComplete']),_0x3581('0x1e5'),_0x39c515[_0x3581('0x48')]);_0x4dbfbd['updateOriginated'](_0x39c515);hopperUtils[_0x3581('0xe3')]({'active':![],'ContactId':_0x4dbfbd[_0x3581('0xe6')][_0x130c7b][_0x3581('0xd2')],'ListId':_0x4dbfbd['actions'][_0x130c7b][_0x3581('0xd3')],'VoiceQueueId':_0x4dbfbd['actions'][_0x130c7b][_0x3581('0xd4')]||undefined,'CampaignId':_0x4dbfbd['actions'][_0x130c7b]['CampaignId']||undefined})['catch'](loggerCatch(_0x3581('0x1e7')));delete _0x4dbfbd[_0x3581('0xe6')][_0x130c7b];}}else{return _0x4dbfbd['actionOriginate'](_0x39c515,_0x319b0a);}}else{if(utils[_0x3581('0x5e')](undefined,_0x319b0a['scheduledat'])<_0x39c515[_0x3581('0x1e9')]*0x3c){if(_0x319b0a[_0x3581('0x141')]&&!_0x319b0a['Agent'][_0x3581('0x1ea')]){_0x4dbfbd[_0x3581('0x1f')][_0x3581('0xf3')](_0x319b0a['id'])[_0x3581('0x1d')](function(){_0x4dbfbd[_0x3581('0xf5')](_0x39c515);});}else{hopperUtils[_0x3581('0x1eb')]({'active':![]},_0x319b0a['id'],0x1)['finally'](function(){_0x4dbfbd[_0x3581('0xf5')](_0x39c515);});}}else{_0x39c515[_0x3581('0x1ec')]+=0x1;_0x4dbfbd['updateOriginated'](_0x39c515);if(_0x39c515['dialRecallInQueue']){hopperUtils[_0x3581('0xe3')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x319b0a[_0x3581('0xd2')],'ListId':_0x319b0a[_0x3581('0xd3')],'VoiceQueueId':_0x319b0a[_0x3581('0xd4')]||undefined,'CampaignId':_0x319b0a[_0x3581('0xd5')]||undefined})[_0x3581('0x9b')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils['createHistory'](createObjHistory(_0x39c515,_0x319b0a,utils['CAMPAIGN_STATUS'][_0x3581('0x1ed')],0x17,'RecallInQueue'))[_0x3581('0x9b')](loggerCatch(_0x3581('0x1ee')));}else{_0x4dbfbd[_0x3581('0x121')](createObjHistory(_0x39c515,_0x319b0a,utils[_0x3581('0x74')]['RECALL_TIMEOUT'],0x16,'RecallFailedTimeout'),_0x3581('0x1ef'),_0x3581('0x1f0'));}}}}else{_0x39c515['outboundBlacklistCallsDay']+=0x1;_0x4dbfbd[_0x3581('0x121')](createObjHistory(_0x39c515,_0x319b0a,utils['CAMPAIGN_STATUS'][_0x3581('0x1f1')],0xd,_0x3581('0x1f2')),_0x3581('0x1f3'),_0x3581('0x1f4'));throw _0x3581('0x1f5');}};};Dialer[_0x3581('0x1a')][_0x3581('0x154')]=function(_0x2057cf){var _0x1573a8=this;var _0x5921e1=_0x2057cf[_0x3581('0x1f6')]-_0x2057cf[_0x3581('0x14c')]-_0x2057cf[_0x3581('0x1f7')];emitCampaignSummary(_0x2057cf);if(_0x5921e1>0x0){if(_0x5921e1>this[_0x3581('0x23')]){_0x5921e1=this[_0x3581('0x23')];}_0x2057cf['temp']+=_0x5921e1;hopperUtils[_0x3581('0x1f8')](_0x2057cf['id'],_0x5921e1,_0x2057cf['dialOrderByScheduledAt'],_0x2057cf)['then'](function(_0x3414f6){_0x2057cf[_0x3581('0x1f7')]-=_0x5921e1;_0x2057cf[_0x3581('0x1f7')]=_0x2057cf[_0x3581('0x1f7')]>0x0?_0x2057cf[_0x3581('0x1f7')]:0x0;if(!utils['checkContactEmpty'](_0x3414f6)){_0x2057cf[_0x3581('0x67')]=utils[_0x3581('0x74')][_0x3581('0x69')];logger['info']('[getContactCampaign2][Empty]'+_0x2057cf[_0x3581('0x48')]);}else{_0x2057cf['originated']+=_0x3414f6[_0x3581('0xf7')];_0x2057cf[_0x3581('0x67')]=utils[_0x3581('0x74')]['RUNNING'];for(var _0xd800c2=0x0;_0xd800c2<_0x3414f6[_0x3581('0xf7')];_0xd800c2+=0x1){_0x2057cf['ivrTotalCallsDays']+=0x1;if(_[_0x3581('0xeb')](_0x3414f6[_0xd800c2])||_[_0x3581('0xeb')](_0x3414f6[_0xd800c2][_0x3581('0x171')])||_[_0x3581('0xeb')](_0x3414f6[_0xd800c2][_0x3581('0x158')])){_0x1573a8[_0x3581('0x14f')](_0x3581('0x1f9'),_0x2057cf,_0x3414f6[_0xd800c2]);}else{hopperUtils[_0x3581('0x1fa')](_[_0x3581('0x72')](_0x3414f6[_0xd800c2],['CampaignId',_0x3581('0x158')]))['then'](_0x1573a8[_0x3581('0x1e0')](_0x2057cf,_0x3414f6[_0xd800c2]))['catch'](_0x1573a8[_0x3581('0x1fb')]('[actionOriginateIvr]\x20',_0x2057cf));}}}})[_0x3581('0x9b')](loggerGetContactDialer(_0x3581('0x1fc'),_0x2057cf,_0x5921e1));}};Dialer[_0x3581('0x1a')][_0x3581('0xac')]=function(_0x15e88e,_0x54c631){var _0x9f76a2=this;var _0x59302e=[];if(_0x54c631<0x1||_0x15e88e['dialMethod']===_0x3581('0x8')){_0x54c631=0x1;}var _0x19b787=Math['floor'](_0x15e88e['available']*_0x54c631)-_0x15e88e['originated']-_0x15e88e['temp'];if(_0x15e88e['dialLimitQueue']>0x0){var _0x48255f=_0x15e88e[_0x3581('0x1fd')]-_0x15e88e[_0x3581('0x14c')]-_0x15e88e[_0x3581('0x131')]-_0x15e88e[_0x3581('0x1f7')]-_0x15e88e[_0x3581('0x132')];if(_0x19b787>_0x48255f){_0x19b787=_0x48255f;}}if(_0x19b787>0x0){if(_0x15e88e[_0x3581('0xa9')]===_0x3581('0x8')){_0x19b787=0x1;}if(_0x19b787>this[_0x3581('0x23')]){_0x19b787=this['maxNumberOriginate'];}_0x15e88e[_0x3581('0x1f7')]+=_0x19b787;for(var _0x2c94fd in this[_0x3581('0x22')]){if(typeof this[_0x3581('0x22')][_0x2c94fd]!=='undefined'){if(this[_0x3581('0x22')][_0x2c94fd][_0x3581('0x6b')]==='not_inuse'&&this[_0x3581('0x22')][_0x2c94fd][_0x3581('0x83')]===_0x3581('0x13e')){_0x59302e['push'](this[_0x3581('0x22')][_0x2c94fd]['id']);}}}hopperUtils['getContactDialer'](_0x15e88e,_0x59302e,_0x19b787)['then'](function(_0x29f488){_0x15e88e[_0x3581('0x1f7')]-=_0x19b787;_0x15e88e[_0x3581('0x1f7')]=_0x15e88e['temp']>0x0?_0x15e88e[_0x3581('0x1f7')]:0x0;if(!utils['checkContactEmpty'](_0x29f488)){hopperUtils[_0x3581('0x1fe')](_0x15e88e)[_0x3581('0x3f')](sendMessageReschedule(_0x15e88e))[_0x3581('0x9b')](loggerCatch(_0x3581('0x1ff')));}else{_0x15e88e[_0x3581('0x14c')]+=_0x29f488['length'];_0x15e88e['message']=_0x15e88e[_0x3581('0xa9')]==='booked'?utils[_0x3581('0x74')][_0x3581('0x133')]:utils[_0x3581('0x74')][_0x3581('0x200')];for(var _0x3f183a=0x0;_0x3f183a<_0x29f488[_0x3581('0xf7')];_0x3f183a+=0x1){if(_[_0x3581('0xeb')](_0x29f488[_0x3f183a])||_[_0x3581('0xeb')](_0x29f488[_0x3f183a][_0x3581('0x171')])||_[_0x3581('0xeb')](_0x29f488[_0x3f183a][_0x3581('0x158')])){_0x9f76a2[_0x3581('0x14f')](_0x3581('0x1f9'),_0x15e88e,_0x29f488[_0x3f183a]);}else{hopperUtils[_0x3581('0x201')](_[_0x3581('0x72')](_0x29f488[_0x3f183a],[_0x3581('0xd4'),'phone']))['then'](_0x9f76a2[_0x3581('0x1e0')](_0x15e88e,_0x29f488[_0x3f183a]))[_0x3581('0x9b')](_0x9f76a2[_0x3581('0x1fb')]('[actionOriginate]\x20',_0x15e88e));}}}})[_0x3581('0x9b')](loggerGetContactDialer(_0x3581('0x202'),_0x15e88e,_0x19b787));}};Dialer[_0x3581('0x1a')]['handlePredictive']=function(_0x2b6d38){if(_0x2b6d38['dialLimitQueue']>0x0){var _0x309c38=_0x2b6d38[_0x3581('0x1fd')]-_0x2b6d38[_0x3581('0x14c')]-_0x2b6d38[_0x3581('0x131')];if(_0x309c38>0x0){this[_0x3581('0x203')](_0x2b6d38);}else{loggerPredictiveCalls[_0x3581('0x4e')](_0x3581('0x204'));}}else{this[_0x3581('0x203')](_0x2b6d38);}};Dialer[_0x3581('0x1a')]['tryOriginatePredictive']=function(_0x43c546){var _0x8a4dd8=this;var _0x37729c=[];_0x43c546['originated']+=0x1;for(var _0x1d259b in this[_0x3581('0x22')]){if(typeof this[_0x3581('0x22')][_0x1d259b]!==_0x3581('0x148')){if(this[_0x3581('0x22')][_0x1d259b][_0x3581('0x6b')]===_0x3581('0x205')&&this[_0x3581('0x22')][_0x1d259b]['status']===_0x3581('0x13e')){_0x37729c[_0x3581('0x92')](this['agents'][_0x1d259b]['id']);}}}return this[_0x3581('0x206')](_0x43c546['id'],_0x37729c,0x1,_0x43c546[_0x3581('0x207')],_0x43c546)[_0x3581('0x3f')](function(_0x4f9c2f){if(!utils[_0x3581('0x208')](_0x4f9c2f)){utils[_0x3581('0x65')](_0x43c546,0x1,0x0);return hopperUtils[_0x3581('0x1fe')](_0x43c546)[_0x3581('0x3f')](sendMessageReschedule(_0x43c546))[_0x3581('0x9b')](loggerCatch(_0x3581('0x1ff')));}else{_0x43c546['message']=utils[_0x3581('0x74')]['RUNNING'];if(_[_0x3581('0xeb')](_0x4f9c2f[0x0])||_[_0x3581('0xeb')](_0x4f9c2f[0x0][_0x3581('0x171')])||_[_0x3581('0xeb')](_0x4f9c2f[0x0]['phone'])){_0x8a4dd8[_0x3581('0x14f')]('[actionOriginate]\x20',_0x43c546,_0x4f9c2f[0x0]);}else{return hopperUtils[_0x3581('0x201')](_[_0x3581('0x72')](_0x4f9c2f[0x0],[_0x3581('0xd4'),_0x3581('0x158')]))[_0x3581('0x3f')](_0x8a4dd8['checkContactBlack'](_0x43c546,_0x4f9c2f[0x0]))[_0x3581('0x9b')](_0x8a4dd8['loggerHandler'](_0x3581('0x209'),_0x43c546));}}})[_0x3581('0x9b')](loggerGetContactDialer(_0x3581('0x20a'),_0x43c546,0x1));};Dialer[_0x3581('0x1a')][_0x3581('0x1db')]=function(_0x599c38,_0x468632,_0x386ed1,_0x5104f9,_0x27aca5,_0x3c7690){loggerPredictive[_0x3581('0x4e')](_0x3581('0x20b'));loggerPredictive[_0x3581('0x4e')](_0x3581('0x20c'),_0x599c38);loggerPredictive[_0x3581('0x4e')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x468632);loggerPredictive['info'](_0x3581('0x20d'),_0x386ed1);loggerPredictive['info'](_0x3581('0x20e'),_0x5104f9);loggerPredictive[_0x3581('0x4e')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x27aca5);loggerPredictive['info'](_0x3581('0x56'));return new Promise(function(_0x44ac7f,_0x17847d){if(_0x599c38<=0x0||isNaN(_0x599c38)){return _0x17847d(msgResponse(_0x3581('0x20f'),'Error','m\x20=\x20'+_0x599c38));}if(_0x386ed1<=0x0||isNaN(_0x386ed1)){return _0x17847d(msgResponse(_0x3581('0x20f'),_0x3581('0x80'),_0x3581('0x210')+_0x386ed1));}if(_0x5104f9<=0x0||isNaN(_0x5104f9)){return _0x17847d(msgResponse(_0x3581('0x20f'),_0x3581('0x80'),_0x3581('0x211')+_0x5104f9));}if(_0x468632<=0x0||isNaN(_0x468632)){return _0x17847d(msgResponse(_0x3581('0x20f'),_0x3581('0x80'),'interval\x20=\x20'+_0x468632));}if(_0x27aca5<=0x0||isNaN(_0x27aca5)){return _0x17847d(msgResponse('[abandonmentRate]','Error','Amax\x20=\x20'+_0x27aca5));}_0x3c7690=_0x3c7690||0x0;var _0x40db2a=0x1/_0x386ed1;var _0x596201=0x0;var _0x4e3430=0x0;var _0x48eb83=0x0;var _0x5a7f6f=0x0;for(var _0x45cfc4=0x0;_0x48eb83<_0x27aca5;_0x45cfc4+=0x1){_0x4e3430=_0x45cfc4/_0x468632;_0x596201=(_0x5104f9*_0x4e3430+_0x3c7690)/_0x40db2a;_0x48eb83=utils['erlangb'](_0x596201,_0x599c38);_0x5a7f6f=_0x596201/_0x599c38*(0x1-utils[_0x3581('0x212')](_0x596201,_0x599c38));}return _0x44ac7f({'erlangCalls':_0x45cfc4,'erlangCallToSecond':_0x468632/_0x45cfc4,'erlangAbandonmentRate':_0x48eb83,'erlangBusyFactor':_0x5a7f6f});});};Dialer[_0x3581('0x1a')][_0x3581('0x1d5')]=function(_0x1facad,_0x23f50d,_0x522156,_0x3b30e3,_0x2fef61,_0x5c0606){loggerPredictive['info'](_0x3581('0x213'));loggerPredictive[_0x3581('0x4e')](_0x3581('0x20c'),_0x1facad);loggerPredictive[_0x3581('0x4e')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x23f50d);loggerPredictive['info'](_0x3581('0x20d'),_0x522156);loggerPredictive['info'](_0x3581('0x20e'),_0x3b30e3);loggerPredictive['info']('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2fef61);loggerPredictive[_0x3581('0x4e')](_0x3581('0x56'));return new Promise(function(_0x3c2932,_0x2be5f0){if(_0x1facad<=0x0||isNaN(_0x1facad)){return _0x2be5f0(msgResponse(_0x3581('0x214'),_0x3581('0x80'),_0x3581('0x215')+_0x1facad));}if(_0x522156<=0x0||isNaN(_0x522156)){return _0x2be5f0(msgResponse(_0x3581('0x214'),_0x3581('0x80'),_0x3581('0x210')+_0x522156));}if(_0x3b30e3<=0x0||isNaN(_0x3b30e3)){return _0x2be5f0(msgResponse(_0x3581('0x214'),_0x3581('0x80'),'p\x20=\x20'+_0x3b30e3));}if(_0x23f50d<=0x0||isNaN(_0x23f50d)){return _0x2be5f0(msgResponse('[busyFactor]',_0x3581('0x80'),_0x3581('0x216')+_0x23f50d));}if(_0x2fef61<=0x0||isNaN(_0x2fef61)){return _0x2be5f0(msgResponse(_0x3581('0x214'),_0x3581('0x80'),_0x3581('0x217')+_0x2fef61));}_0x5c0606=_0x5c0606||0x0;var _0x58f608=0x1/_0x522156;var _0x51a22d=0x0;var _0xeb817e=0x0;var _0x2aa98c=0x0;var _0x3d9b6f=0x0;for(var _0x208bcb=0x0;_0x3d9b6f<_0x2fef61;_0x208bcb+=0x1){_0xeb817e=_0x208bcb/_0x23f50d;_0x51a22d=(_0x3b30e3*_0xeb817e+_0x5c0606)/_0x58f608;_0x2aa98c=utils[_0x3581('0x212')](_0x51a22d,_0x1facad);_0x3d9b6f=_0x51a22d/_0x1facad*(0x1-utils[_0x3581('0x212')](_0x51a22d,_0x1facad));}return _0x3c2932({'erlangCalls':_0x208bcb,'erlangCallToSecond':_0x23f50d/_0x208bcb,'erlangAbandonmentRate':_0x2aa98c,'erlangBusyFactor':_0x3d9b6f});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/models/action.js b/server/services/ami/dialer/models/action.js index 5d2eccf..6c51fa3 100644 --- a/server/services/ami/dialer/models/action.js +++ b/server/services/ami/dialer/models/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3bae=['countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','getQueue','exports','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x3bae,0x18d));var _0xe3ba=function(_0x151dee,_0x3f620f){_0x151dee=_0x151dee-0x0;var _0x36879b=_0x3bae[_0x151dee];return _0x36879b;};'use strict';var util=require('util');var _=require(_0xe3ba('0x0'));var moment=require(_0xe3ba('0x1'));function checkNameSurname(_0x3dfa6c,_0x1a7bf4,_0xed37e7){var _0x4a4ce5='';if(!_[_0xe3ba('0x2')](_0x1a7bf4)&&_0xe3ba('0x3')===typeof _0x1a7bf4){_0x4a4ce5+=_0x1a7bf4;}if(!_[_0xe3ba('0x2')](_0xed37e7)&&_0xe3ba('0x3')===typeof _0xed37e7){_0x4a4ce5+='\x20'+_0xed37e7;}if(_0x4a4ce5!==''){return _0x4a4ce5;}return _0x3dfa6c;}function Action(_0x59c9a2,_0x5b0707,_0x54386a){this[_0xe3ba('0x4')]=_0x59c9a2;this[_0xe3ba('0x5')]=_0x54386a||undefined;this[_0xe3ba('0x6')]=checkNameSurname(_0x5b0707[_0xe3ba('0x7')][_0xe3ba('0x8')],_0x5b0707['Contact'][_0xe3ba('0x9')],_0x5b0707[_0xe3ba('0x7')][_0xe3ba('0xa')]);this[_0xe3ba('0xb')]=_0x5b0707[_0xe3ba('0x8')];this[_0xe3ba('0xc')]=_0x59c9a2[_0xe3ba('0x6')];this[_0xe3ba('0xd')]=_0x5b0707[_0xe3ba('0xd')]||![];this['type']=_0x59c9a2[_0xe3ba('0xe')];this['dialQueueTimeout']=_0x59c9a2[_0xe3ba('0xf')]||0x3;this[_0xe3ba('0x10')]=_0x5b0707[_0xe3ba('0x10')];this[_0xe3ba('0x11')]=_0x5b0707['countbusyretry'];this[_0xe3ba('0x12')]=_0x5b0707[_0xe3ba('0x12')];this['countnoanswerretry']=_0x5b0707[_0xe3ba('0x13')];this[_0xe3ba('0x14')]=_0x5b0707[_0xe3ba('0x14')];this['countdropretry']=_0x5b0707[_0xe3ba('0x15')];this['countabandonedretry']=_0x5b0707[_0xe3ba('0x16')];this[_0xe3ba('0x17')]=_0x5b0707['countmachineretry'];this[_0xe3ba('0x18')]=_0x5b0707['countagentrejectretry'];this[_0xe3ba('0x19')]=_0x5b0707['ContactId'];this['ListId']=_0x5b0707[_0xe3ba('0x1a')];this[_0xe3ba('0x1b')]=_0x5b0707['UserId'];this[_0xe3ba('0x1c')]=_0x5b0707[_0xe3ba('0x1c')];this[_0xe3ba('0x1d')]=_0x5b0707[_0xe3ba('0x1d')];this['idHopper']=_0x5b0707['id'];this[_0xe3ba('0x1e')]=_0x5b0707['Contact'][_0xe3ba('0x9')]||'';this[_0xe3ba('0x1f')]=moment()['format'](_0xe3ba('0x20'));this[_0xe3ba('0x21')]=_0x5b0707[_0xe3ba('0x21')];this[_0xe3ba('0x22')]=_0x5b0707[_0xe3ba('0x22')];this[_0xe3ba('0x23')]=_0x5b0707['callbackat'];this[_0xe3ba('0x24')]=_0x5b0707[_0xe3ba('0x24')];this[_0xe3ba('0x25')]='';this[_0xe3ba('0x26')]='';}Action[_0xe3ba('0x27')][_0xe3ba('0x28')]=function(){return util[_0xe3ba('0x29')](_0xe3ba('0x2a'),this['name'],this[_0xe3ba('0x4')]['dialCutDigit']>0x0?this[_0xe3ba('0xb')]['substring'](this[_0xe3ba('0x4')][_0xe3ba('0x2b')]):this['number']);};Action[_0xe3ba('0x27')][_0xe3ba('0x2c')]=function(){return this['queue'];};module[_0xe3ba('0x2d')]=Action; \ No newline at end of file +var _0xc61f=['type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','getQueue','queue','exports','util','moment','isNil','voiceQueue','name','Contact','firstName','lastName','phone','active'];(function(_0x3b19ea,_0x518b6b){var _0x40ece9=function(_0x3a3386){while(--_0x3a3386){_0x3b19ea['push'](_0x3b19ea['shift']());}};_0x40ece9(++_0x518b6b);}(_0xc61f,0x170));var _0xfc61=function(_0xd04057,_0x3efe70){_0xd04057=_0xd04057-0x0;var _0x24c000=_0xc61f[_0xd04057];return _0x24c000;};'use strict';var util=require(_0xfc61('0x0'));var _=require('lodash');var moment=require(_0xfc61('0x1'));function checkNameSurname(_0x10038a,_0x4ea663,_0x4ce396){var _0xb5f138='';if(!_['isNil'](_0x4ea663)&&'string'===typeof _0x4ea663){_0xb5f138+=_0x4ea663;}if(!_[_0xfc61('0x2')](_0x4ce396)&&'string'===typeof _0x4ce396){_0xb5f138+='\x20'+_0x4ce396;}if(_0xb5f138!==''){return _0xb5f138;}return _0x10038a;}function Action(_0x2c66b7,_0x1c05f3,_0x5cc2ff){this[_0xfc61('0x3')]=_0x2c66b7;this['uniqueid']=_0x5cc2ff||undefined;this[_0xfc61('0x4')]=checkNameSurname(_0x1c05f3[_0xfc61('0x5')]['phone'],_0x1c05f3[_0xfc61('0x5')][_0xfc61('0x6')],_0x1c05f3['Contact'][_0xfc61('0x7')]);this['number']=_0x1c05f3[_0xfc61('0x8')];this['queue']=_0x2c66b7[_0xfc61('0x4')];this[_0xfc61('0x9')]=_0x1c05f3[_0xfc61('0x9')]||![];this[_0xfc61('0xa')]=_0x2c66b7[_0xfc61('0xa')];this[_0xfc61('0xb')]=_0x2c66b7[_0xfc61('0xb')]||0x3;this[_0xfc61('0xc')]=_0x1c05f3['scheduledat'];this[_0xfc61('0xd')]=_0x1c05f3[_0xfc61('0xd')];this['countcongestionretry']=_0x1c05f3[_0xfc61('0xe')];this['countnoanswerretry']=_0x1c05f3['countnoanswerretry'];this[_0xfc61('0xf')]=_0x1c05f3[_0xfc61('0xf')];this['countdropretry']=_0x1c05f3['countdropretry'];this[_0xfc61('0x10')]=_0x1c05f3[_0xfc61('0x10')];this['countmachineretry']=_0x1c05f3[_0xfc61('0x11')];this['countagentrejectretry']=_0x1c05f3[_0xfc61('0x12')];this[_0xfc61('0x13')]=_0x1c05f3['ContactId'];this[_0xfc61('0x14')]=_0x1c05f3[_0xfc61('0x14')];this[_0xfc61('0x15')]=_0x1c05f3[_0xfc61('0x15')];this[_0xfc61('0x16')]=_0x1c05f3['VoiceQueueId'];this[_0xfc61('0x17')]=_0x1c05f3[_0xfc61('0x17')];this[_0xfc61('0x18')]=_0x1c05f3['id'];this[_0xfc61('0x19')]=_0x1c05f3[_0xfc61('0x5')][_0xfc61('0x6')]||'';this[_0xfc61('0x1a')]=moment()[_0xfc61('0x1b')](_0xfc61('0x1c'));this[_0xfc61('0x1d')]=_0x1c05f3['callback'];this[_0xfc61('0x1e')]=_0x1c05f3[_0xfc61('0x1e')];this['callbackat']=_0x1c05f3[_0xfc61('0x1f')];this['recallme']=_0x1c05f3['recallme'];this[_0xfc61('0x20')]='';this[_0xfc61('0x21')]='';}Action['prototype'][_0xfc61('0x22')]=function(){return util['format'](_0xfc61('0x23'),this[_0xfc61('0x4')],this[_0xfc61('0x3')][_0xfc61('0x24')]>0x0?this[_0xfc61('0x25')][_0xfc61('0x26')](this['voiceQueue'][_0xfc61('0x24')]):this[_0xfc61('0x25')]);};Action['prototype'][_0xfc61('0x27')]=function(){return this[_0xfc61('0x28')];};module[_0xfc61('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index f6a47c9..45c50d7 100644 --- a/server/services/ami/dialer/models/agentComplete.js +++ b/server/services/ami/dialer/models/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfabd=['answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','membername','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','agiafterat','exports','moment','state','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','starttime','responsetime'];(function(_0x5da42a,_0xc995ad){var _0x5d16ff=function(_0x3c1806){while(--_0x3c1806){_0x5da42a['push'](_0x5da42a['shift']());}};_0x5d16ff(++_0xc995ad);}(_0xfabd,0x66));var _0xdfab=function(_0x41ac28,_0x148b40){_0x41ac28=_0x41ac28-0x0;var _0x16a1b9=_0xfabd[_0x41ac28];return _0x16a1b9;};'use strict';var moment=require(_0xdfab('0x0'));var utils=require('../utils');function AgentComplete(_0x55eaa6,_0x407c97){this[_0xdfab('0x1')]=0x4;this[_0xdfab('0x2')]=_0xdfab('0x3');this[_0xdfab('0x4')]=_0x55eaa6['scheduledat'];this[_0xdfab('0x5')]=_0x55eaa6['type'];this[_0xdfab('0x6')]=_0x55eaa6['type']==='outbound'?_0xdfab('0x7'):_0x55eaa6['type'];this[_0xdfab('0x8')]=_0x55eaa6[_0xdfab('0x8')];this[_0xdfab('0x9')]=_0x55eaa6['countcongestionretry'];this[_0xdfab('0xa')]=_0x55eaa6[_0xdfab('0xa')];this['countglobal']=_0x55eaa6[_0xdfab('0x8')]+_0x55eaa6[_0xdfab('0x9')]+_0x55eaa6['countnoanswerretry']+_0x55eaa6[_0xdfab('0xb')]+_0x55eaa6[_0xdfab('0xc')]+_0x55eaa6[_0xdfab('0xd')]+_0x55eaa6[_0xdfab('0xe')]+_0x55eaa6[_0xdfab('0xf')];this['countnosuchnumberretry']=_0x55eaa6['countnosuchnumberretry'];this[_0xdfab('0xc')]=_0x55eaa6[_0xdfab('0xc')];this[_0xdfab('0xd')]=_0x55eaa6[_0xdfab('0xd')];this[_0xdfab('0xe')]=_0x55eaa6[_0xdfab('0xe')];this['countagentrejectretry']=_0x55eaa6[_0xdfab('0xf')];this[_0xdfab('0x10')]=_0x407c97[_0xdfab('0x10')];this['calleridname']=_0x55eaa6[_0xdfab('0x11')];this[_0xdfab('0x12')]=_0x55eaa6['number'];this[_0xdfab('0x13')]=_0x55eaa6[_0xdfab('0x13')];this['responsetime']=_0x55eaa6[_0xdfab('0x14')];this['answertime']=_0x55eaa6[_0xdfab('0x15')];this[_0xdfab('0x16')]=moment()['format'](_0xdfab('0x17'));this[_0xdfab('0x18')]=utils[_0xdfab('0x19')](_0x55eaa6[_0xdfab('0x14')],_0x55eaa6[_0xdfab('0x13')]);this[_0xdfab('0x1a')]=utils[_0xdfab('0x19')](_0x55eaa6['answertime'],_0x55eaa6[_0xdfab('0x14')]);this[_0xdfab('0x1b')]=utils[_0xdfab('0x19')](this[_0xdfab('0x16')],_0x55eaa6[_0xdfab('0x15')]);this[_0xdfab('0x7')]=_0x407c97[_0xdfab('0x7')];this[_0xdfab('0x1c')]=_0x407c97[_0xdfab('0x1c')];this[_0xdfab('0x1d')]=_0x407c97[_0xdfab('0x1d')];this[_0xdfab('0x1e')]=_0x55eaa6[_0xdfab('0x1e')];this['callbackuniqueid']=_0x55eaa6['callbackuniqueid'];this[_0xdfab('0x1f')]=_0x55eaa6[_0xdfab('0x1f')];this['recallme']=_0x55eaa6[_0xdfab('0x20')];this[_0xdfab('0x21')]=_0x55eaa6[_0xdfab('0x21')];this[_0xdfab('0x22')]=_0x55eaa6['ListId'];this[_0xdfab('0x23')]=_0x55eaa6[_0xdfab('0x23')];this['VoiceQueueId']=_0x55eaa6[_0xdfab('0x24')];this[_0xdfab('0x25')]=_0x55eaa6['CampaignId'];this['originatecalleridnum']=_0x55eaa6['originatecalleridnum']||'';this[_0xdfab('0x26')]=_0x55eaa6[_0xdfab('0x26')]||'';this['agiafterat']=_0x55eaa6[_0xdfab('0x27')];}module[_0xdfab('0x28')]=AgentComplete; \ No newline at end of file +var _0x9727=['countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','uniqueid','calleridname','calleridnum','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','membername','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','agiafterat','exports','moment','../utils','state','statedesc','Answer','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry'];(function(_0x2c2c63,_0x4239f9){var _0x55cefe=function(_0x45799c){while(--_0x45799c){_0x2c2c63['push'](_0x2c2c63['shift']());}};_0x55cefe(++_0x4239f9);}(_0x9727,0x16e));var _0x7972=function(_0x40015a,_0x415db5){_0x40015a=_0x40015a-0x0;var _0x42f8a4=_0x9727[_0x40015a];return _0x42f8a4;};'use strict';var moment=require(_0x7972('0x0'));var utils=require(_0x7972('0x1'));function AgentComplete(_0x4aa36b,_0x5f250){this[_0x7972('0x2')]=0x4;this[_0x7972('0x3')]=_0x7972('0x4');this['scheduledat']=_0x4aa36b['scheduledat'];this[_0x7972('0x5')]=_0x4aa36b[_0x7972('0x5')];this['campaigntype']=_0x4aa36b[_0x7972('0x5')]===_0x7972('0x6')?_0x7972('0x7'):_0x4aa36b[_0x7972('0x5')];this[_0x7972('0x8')]=_0x4aa36b['countbusyretry'];this[_0x7972('0x9')]=_0x4aa36b[_0x7972('0x9')];this[_0x7972('0xa')]=_0x4aa36b[_0x7972('0xa')];this['countglobal']=_0x4aa36b[_0x7972('0x8')]+_0x4aa36b[_0x7972('0x9')]+_0x4aa36b[_0x7972('0xa')]+_0x4aa36b[_0x7972('0xb')]+_0x4aa36b['countdropretry']+_0x4aa36b[_0x7972('0xc')]+_0x4aa36b[_0x7972('0xd')]+_0x4aa36b['countagentrejectretry'];this['countnosuchnumberretry']=_0x4aa36b[_0x7972('0xb')];this[_0x7972('0xe')]=_0x4aa36b[_0x7972('0xe')];this[_0x7972('0xc')]=_0x4aa36b['countabandonedretry'];this[_0x7972('0xd')]=_0x4aa36b['countmachineretry'];this[_0x7972('0xf')]=_0x4aa36b[_0x7972('0xf')];this[_0x7972('0x10')]=_0x5f250[_0x7972('0x10')];this[_0x7972('0x11')]=_0x4aa36b['name'];this[_0x7972('0x12')]=_0x4aa36b['number'];this['starttime']=_0x4aa36b[_0x7972('0x13')];this[_0x7972('0x14')]=_0x4aa36b[_0x7972('0x14')];this[_0x7972('0x15')]=_0x4aa36b[_0x7972('0x15')];this[_0x7972('0x16')]=moment()[_0x7972('0x17')](_0x7972('0x18'));this[_0x7972('0x19')]=utils[_0x7972('0x1a')](_0x4aa36b[_0x7972('0x14')],_0x4aa36b[_0x7972('0x13')]);this[_0x7972('0x1b')]=utils[_0x7972('0x1a')](_0x4aa36b[_0x7972('0x15')],_0x4aa36b[_0x7972('0x14')]);this[_0x7972('0x1c')]=utils['getSeconds'](this[_0x7972('0x16')],_0x4aa36b[_0x7972('0x15')]);this[_0x7972('0x7')]=_0x5f250[_0x7972('0x7')];this[_0x7972('0x1d')]=_0x5f250[_0x7972('0x1d')];this['reason']=_0x5f250[_0x7972('0x1e')];this[_0x7972('0x1f')]=_0x4aa36b[_0x7972('0x1f')];this[_0x7972('0x20')]=_0x4aa36b[_0x7972('0x20')];this['callbackat']=_0x4aa36b['callbackat'];this[_0x7972('0x21')]=_0x4aa36b[_0x7972('0x21')];this[_0x7972('0x22')]=_0x4aa36b[_0x7972('0x22')];this[_0x7972('0x23')]=_0x4aa36b['ListId'];this[_0x7972('0x24')]=_0x4aa36b[_0x7972('0x24')];this[_0x7972('0x25')]=_0x4aa36b[_0x7972('0x25')];this[_0x7972('0x26')]=_0x4aa36b['CampaignId'];this[_0x7972('0x27')]=_0x4aa36b['originatecalleridnum']||'';this['originatecalleridname']=_0x4aa36b['originatecalleridname']||'';this[_0x7972('0x28')]=_0x4aa36b[_0x7972('0x28')];}module[_0x7972('0x29')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index bdde414..c2a3286 100644 --- a/server/services/ami/dialer/models/final.js +++ b/server/services/ami/dialer/models/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6742=['VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countglobal','countcongestionretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','calleridname','calleridnum','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x38af14,_0x2cc244){var _0x2a64b3=function(_0x17d1d8){while(--_0x17d1d8){_0x38af14['push'](_0x38af14['shift']());}};_0x2a64b3(++_0x2cc244);}(_0x6742,0x6a));var _0x2674=function(_0x27547a,_0x4c08a2){_0x27547a=_0x27547a-0x0;var _0x1d4b50=_0x6742[_0x27547a];return _0x1d4b50;};'use strict';function Final(_0x16ac03){this[_0x2674('0x0')]=_0x16ac03['uniqueid'];this['scheduledat']=_0x16ac03[_0x2674('0x1')];this['type']=_0x16ac03[_0x2674('0x2')];this[_0x2674('0x3')]=_0x16ac03['type']===_0x2674('0x4')?_0x2674('0x5'):_0x16ac03[_0x2674('0x2')];this[_0x2674('0x6')]=_0x16ac03[_0x2674('0x6')];this['countcongestionretry']=_0x16ac03['countcongestionretry'];this['countnoanswerretry']=_0x16ac03['countnoanswerretry'];this[_0x2674('0x7')]=_0x16ac03[_0x2674('0x6')]+_0x16ac03[_0x2674('0x8')]+_0x16ac03['countnoanswerretry']+_0x16ac03[_0x2674('0x9')]+_0x16ac03['countdropretry']+_0x16ac03[_0x2674('0xa')]+_0x16ac03['countmachineretry']+_0x16ac03[_0x2674('0xb')];this[_0x2674('0x9')]=_0x16ac03[_0x2674('0x9')];this[_0x2674('0xc')]=_0x16ac03[_0x2674('0xc')];this['countabandonedretry']=_0x16ac03['countabandonedretry'];this['countmachineretry']=_0x16ac03['countmachineretry'];this[_0x2674('0xb')]=_0x16ac03['countagentrejectretry'];this[_0x2674('0x5')]=_0x16ac03[_0x2674('0x5')];this[_0x2674('0xd')]=_0x16ac03['calleridname'];this['calleridnum']=_0x16ac03[_0x2674('0xe')];this['starttime']=_0x16ac03['starttime'];this[_0x2674('0xf')]=_0x16ac03[_0x2674('0xf')];this['endtime']=_0x16ac03['responsetime'];this[_0x2674('0x10')]=_0x16ac03[_0x2674('0x10')]||0x0;this[_0x2674('0x11')]=_0x16ac03['holdtime']||0x0;this['talktime']=_0x16ac03[_0x2674('0x12')]||0x0;this['callback']=_0x16ac03[_0x2674('0x13')];this[_0x2674('0x14')]=_0x16ac03[_0x2674('0x14')];this[_0x2674('0x15')]=_0x16ac03[_0x2674('0x15')];this['recallme']=_0x16ac03[_0x2674('0x16')];this[_0x2674('0x17')]=_0x16ac03[_0x2674('0x17')];this[_0x2674('0x18')]=_0x16ac03['ListId'];this[_0x2674('0x19')]=_0x16ac03[_0x2674('0x19')];this[_0x2674('0x1a')]=_0x16ac03['VoiceQueueId'];this[_0x2674('0x1b')]=_0x16ac03[_0x2674('0x1b')];this['originatecalleridnum']=_0x16ac03[_0x2674('0x1c')]||'';this[_0x2674('0x1d')]=_0x16ac03[_0x2674('0x1d')]||'';this['state']=_0x16ac03[_0x2674('0x1e')];this[_0x2674('0x1f')]=_0x16ac03[_0x2674('0x1f')];}module[_0x2674('0x20')]=Final; \ No newline at end of file +var _0xc685=['holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','calleridnum','starttime','responsetime','ringtime'];(function(_0x47f46f,_0x28a14d){var _0x31cacf=function(_0x552baa){while(--_0x552baa){_0x47f46f['push'](_0x47f46f['shift']());}};_0x31cacf(++_0x28a14d);}(_0xc685,0x12d));var _0x5c68=function(_0x1be39f,_0x4149e1){_0x1be39f=_0x1be39f-0x0;var _0x205125=_0xc685[_0x1be39f];return _0x205125;};'use strict';function Final(_0xbc5913){this[_0x5c68('0x0')]=_0xbc5913[_0x5c68('0x0')];this[_0x5c68('0x1')]=_0xbc5913[_0x5c68('0x1')];this[_0x5c68('0x2')]=_0xbc5913[_0x5c68('0x2')];this['campaigntype']=_0xbc5913['type']===_0x5c68('0x3')?'queue':_0xbc5913['type'];this[_0x5c68('0x4')]=_0xbc5913[_0x5c68('0x4')];this[_0x5c68('0x5')]=_0xbc5913['countcongestionretry'];this[_0x5c68('0x6')]=_0xbc5913['countnoanswerretry'];this[_0x5c68('0x7')]=_0xbc5913['countbusyretry']+_0xbc5913[_0x5c68('0x5')]+_0xbc5913[_0x5c68('0x6')]+_0xbc5913[_0x5c68('0x8')]+_0xbc5913[_0x5c68('0x9')]+_0xbc5913[_0x5c68('0xa')]+_0xbc5913[_0x5c68('0xb')]+_0xbc5913[_0x5c68('0xc')];this[_0x5c68('0x8')]=_0xbc5913[_0x5c68('0x8')];this[_0x5c68('0x9')]=_0xbc5913['countdropretry'];this[_0x5c68('0xa')]=_0xbc5913['countabandonedretry'];this[_0x5c68('0xb')]=_0xbc5913['countmachineretry'];this[_0x5c68('0xc')]=_0xbc5913['countagentrejectretry'];this[_0x5c68('0xd')]=_0xbc5913['queue'];this['calleridname']=_0xbc5913[_0x5c68('0xe')];this[_0x5c68('0xf')]=_0xbc5913[_0x5c68('0xf')];this['starttime']=_0xbc5913[_0x5c68('0x10')];this['responsetime']=_0xbc5913[_0x5c68('0x11')];this['endtime']=_0xbc5913[_0x5c68('0x11')];this['ringtime']=_0xbc5913[_0x5c68('0x12')]||0x0;this[_0x5c68('0x13')]=_0xbc5913['holdtime']||0x0;this['talktime']=_0xbc5913['talktime']||0x0;this[_0x5c68('0x14')]=_0xbc5913['callback'];this['callbackuniqueid']=_0xbc5913[_0x5c68('0x15')];this[_0x5c68('0x16')]=_0xbc5913[_0x5c68('0x16')];this['recallme']=_0xbc5913[_0x5c68('0x17')];this[_0x5c68('0x18')]=_0xbc5913[_0x5c68('0x18')];this['ListId']=_0xbc5913['ListId'];this[_0x5c68('0x19')]=_0xbc5913['UserId'];this[_0x5c68('0x1a')]=_0xbc5913['VoiceQueueId'];this['CampaignId']=_0xbc5913['CampaignId'];this[_0x5c68('0x1b')]=_0xbc5913[_0x5c68('0x1b')]||'';this[_0x5c68('0x1c')]=_0xbc5913[_0x5c68('0x1c')]||'';this[_0x5c68('0x1d')]=_0xbc5913[_0x5c68('0x1d')];this[_0x5c68('0x1e')]=_0xbc5913[_0x5c68('0x1e')];}module[_0x5c68('0x1f')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index 8903151..127fe14 100644 --- a/server/services/ami/dialer/models/hangup.js +++ b/server/services/ami/dialer/models/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfcb7=['countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','endtime','format','ringtime','responsetime','starttime','talktime','getSeconds','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','state','statedesc','scheduledat','type','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xfcb7,0x16f));var _0x7fcb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfcb7[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x7fcb('0x0'));var utils=require('../utils');function Hangup(_0x57e664,_0xb8ee6){this[_0x7fcb('0x1')]=0x4;this[_0x7fcb('0x2')]='Answer';this[_0x7fcb('0x3')]=_0x57e664[_0x7fcb('0x3')];this[_0x7fcb('0x4')]=_0x57e664[_0x7fcb('0x4')];this['campaigntype']=_0x57e664['type']===_0x7fcb('0x5')?_0x7fcb('0x6'):_0x57e664['type'];this[_0x7fcb('0x7')]=_0x57e664[_0x7fcb('0x7')]||![];this['countbusyretry']=_0x57e664[_0x7fcb('0x8')];this['countcongestionretry']=_0x57e664[_0x7fcb('0x9')];this[_0x7fcb('0xa')]=_0x57e664[_0x7fcb('0xa')];this['countglobal']=_0x57e664[_0x7fcb('0x8')]+_0x57e664[_0x7fcb('0x9')]+_0x57e664[_0x7fcb('0xa')]+_0x57e664[_0x7fcb('0xb')]+_0x57e664[_0x7fcb('0xc')]+_0x57e664[_0x7fcb('0xd')]+_0x57e664[_0x7fcb('0xe')]+_0x57e664[_0x7fcb('0xf')];this[_0x7fcb('0xb')]=_0x57e664[_0x7fcb('0xb')];this[_0x7fcb('0xc')]=_0x57e664['countdropretry'];this['countabandonedretry']=_0x57e664['countabandonedretry'];this[_0x7fcb('0xe')]=_0x57e664['countmachineretry'];this[_0x7fcb('0xf')]=_0x57e664[_0x7fcb('0xf')];this['uniqueid']=_0xb8ee6[_0x7fcb('0x10')];this[_0x7fcb('0x11')]=_0x57e664[_0x7fcb('0x12')];this[_0x7fcb('0x13')]=_0x57e664[_0x7fcb('0x14')];this['starttime']=_0x57e664['starttime'];this['responsetime']=_0x57e664['responsetime'];this[_0x7fcb('0x15')]=moment()[_0x7fcb('0x16')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x7fcb('0x17')]=utils['getSeconds'](_0x57e664[_0x7fcb('0x18')],_0x57e664[_0x7fcb('0x19')]);this['holdtime']=0x0;this[_0x7fcb('0x1a')]=utils[_0x7fcb('0x1b')](this['endtime'],_0x57e664['responsetime']);this[_0x7fcb('0x6')]=_0x57e664['queue'];this[_0x7fcb('0x1c')]=_0x7fcb('0x1d');this[_0x7fcb('0x1e')]=_0xb8ee6[_0x7fcb('0x1f')];this[_0x7fcb('0x20')]=_0x57e664[_0x7fcb('0x20')];this[_0x7fcb('0x21')]=_0x57e664['callbackuniqueid'];this[_0x7fcb('0x22')]=_0x57e664[_0x7fcb('0x22')];this[_0x7fcb('0x23')]=_0x57e664[_0x7fcb('0x23')];this[_0x7fcb('0x24')]=_0x57e664['ContactId'];this[_0x7fcb('0x25')]=_0x57e664[_0x7fcb('0x25')];this[_0x7fcb('0x26')]=_0x57e664['UserId'];this[_0x7fcb('0x27')]=_0x57e664['VoiceQueueId'];this[_0x7fcb('0x28')]=_0x57e664[_0x7fcb('0x28')];}module[_0x7fcb('0x29')]=Hangup; \ No newline at end of file +var _0x8345=['endtime','format','getSeconds','starttime','holdtime','IVR','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','state','statedesc','scheduledat','type','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','responsetime'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8345,0x196));var _0x5834=function(_0x1fa841,_0x37a70c){_0x1fa841=_0x1fa841-0x0;var _0x384b67=_0x8345[_0x1fa841];return _0x384b67;};'use strict';var moment=require(_0x5834('0x0'));var utils=require(_0x5834('0x1'));function Hangup(_0x221f35,_0x14ce1b){this[_0x5834('0x2')]=0x4;this[_0x5834('0x3')]='Answer';this[_0x5834('0x4')]=_0x221f35[_0x5834('0x4')];this[_0x5834('0x5')]=_0x221f35[_0x5834('0x5')];this['campaigntype']=_0x221f35['type']===_0x5834('0x6')?_0x5834('0x7'):_0x221f35[_0x5834('0x5')];this[_0x5834('0x8')]=_0x221f35['amd']||![];this[_0x5834('0x9')]=_0x221f35[_0x5834('0x9')];this[_0x5834('0xa')]=_0x221f35[_0x5834('0xa')];this['countnoanswerretry']=_0x221f35[_0x5834('0xb')];this['countglobal']=_0x221f35[_0x5834('0x9')]+_0x221f35[_0x5834('0xa')]+_0x221f35['countnoanswerretry']+_0x221f35[_0x5834('0xc')]+_0x221f35['countdropretry']+_0x221f35['countabandonedretry']+_0x221f35[_0x5834('0xd')]+_0x221f35[_0x5834('0xe')];this[_0x5834('0xc')]=_0x221f35[_0x5834('0xc')];this['countdropretry']=_0x221f35[_0x5834('0xf')];this[_0x5834('0x10')]=_0x221f35[_0x5834('0x10')];this['countmachineretry']=_0x221f35[_0x5834('0xd')];this[_0x5834('0xe')]=_0x221f35[_0x5834('0xe')];this[_0x5834('0x11')]=_0x14ce1b[_0x5834('0x11')];this[_0x5834('0x12')]=_0x221f35[_0x5834('0x13')];this[_0x5834('0x14')]=_0x221f35[_0x5834('0x15')];this['starttime']=_0x221f35['starttime'];this[_0x5834('0x16')]=_0x221f35['responsetime'];this[_0x5834('0x17')]=moment()[_0x5834('0x18')]('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=utils[_0x5834('0x19')](_0x221f35['responsetime'],_0x221f35[_0x5834('0x1a')]);this[_0x5834('0x1b')]=0x0;this['talktime']=utils[_0x5834('0x19')](this[_0x5834('0x17')],_0x221f35[_0x5834('0x16')]);this['queue']=_0x221f35[_0x5834('0x7')];this['membername']=_0x5834('0x1c');this[_0x5834('0x1d')]=_0x14ce1b['cause-txt'];this['callback']=_0x221f35['callback'];this[_0x5834('0x1e')]=_0x221f35['callbackuniqueid'];this[_0x5834('0x1f')]=_0x221f35['callbackat'];this[_0x5834('0x20')]=_0x221f35[_0x5834('0x20')];this[_0x5834('0x21')]=_0x221f35[_0x5834('0x21')];this[_0x5834('0x22')]=_0x221f35[_0x5834('0x22')];this[_0x5834('0x23')]=_0x221f35[_0x5834('0x23')];this[_0x5834('0x24')]=_0x221f35[_0x5834('0x24')];this[_0x5834('0x25')]=_0x221f35['CampaignId'];}module[_0x5834('0x26')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index 27693a2..917eeee 100644 --- a/server/services/ami/dialer/models/history.js +++ b/server/services/ami/dialer/models/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x69d9=['exports','uniqueid','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','holdtime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state'];(function(_0xd548ea,_0x4ed8f4){var _0x4a83ff=function(_0x512f80){while(--_0x512f80){_0xd548ea['push'](_0xd548ea['shift']());}};_0x4a83ff(++_0x4ed8f4);}(_0x69d9,0x12a));var _0x969d=function(_0x30faee,_0x1c3794){_0x30faee=_0x30faee-0x0;var _0x3a90ab=_0x69d9[_0x30faee];return _0x3a90ab;};'use strict';var utils=require('../utils');function History(_0xbdd054){this['uniqueid']=_0xbdd054[_0x969d('0x0')];this['scheduledat']=_0xbdd054[_0x969d('0x1')]||undefined;this[_0x969d('0x2')]=_0xbdd054[_0x969d('0x2')];this['campaigntype']=_0xbdd054[_0x969d('0x2')]==='outbound'?_0x969d('0x3'):_0xbdd054['type'];this[_0x969d('0x4')]=_0xbdd054[_0x969d('0x4')];this['countcongestionretry']=_0xbdd054[_0x969d('0x5')];this[_0x969d('0x6')]=_0xbdd054[_0x969d('0x6')];this[_0x969d('0x7')]=_0xbdd054[_0x969d('0x4')]+_0xbdd054[_0x969d('0x5')]+_0xbdd054[_0x969d('0x6')]+_0xbdd054[_0x969d('0x8')]+_0xbdd054[_0x969d('0x9')]+_0xbdd054[_0x969d('0xa')]+_0xbdd054[_0x969d('0xb')]+_0xbdd054[_0x969d('0xc')];this[_0x969d('0x8')]=_0xbdd054['countnosuchnumberretry'];this[_0x969d('0x9')]=_0xbdd054['countdropretry'];this[_0x969d('0xa')]=_0xbdd054[_0x969d('0xa')];this[_0x969d('0xb')]=_0xbdd054[_0x969d('0xb')];this[_0x969d('0xc')]=_0xbdd054[_0x969d('0xc')];this[_0x969d('0x3')]=_0xbdd054[_0x969d('0x3')];this[_0x969d('0xd')]=_0xbdd054[_0x969d('0xe')];this[_0x969d('0xf')]=_0xbdd054[_0x969d('0x10')];this['starttime']=_0xbdd054[_0x969d('0x11')];this[_0x969d('0x12')]=_0xbdd054[_0x969d('0x12')];this[_0x969d('0x13')]=_0xbdd054[_0x969d('0x12')];this['ringtime']=utils['getSeconds'](_0xbdd054['responsetime'],_0xbdd054['starttime']);this[_0x969d('0x14')]=0x0;this['talktime']=0x0;this[_0x969d('0x15')]=_0xbdd054['callback'];this[_0x969d('0x16')]=_0xbdd054[_0x969d('0x16')];this[_0x969d('0x17')]=_0xbdd054[_0x969d('0x17')];this['recallme']=_0xbdd054['recallme'];this[_0x969d('0x18')]=_0xbdd054[_0x969d('0x18')];this['ListId']=_0xbdd054[_0x969d('0x19')];this[_0x969d('0x1a')]=_0xbdd054['UserId'];this[_0x969d('0x1b')]=_0xbdd054['VoiceQueueId'];this[_0x969d('0x1c')]=_0xbdd054[_0x969d('0x1c')];this['originatecalleridnum']=_0xbdd054[_0x969d('0x1d')]||'';this[_0x969d('0x1e')]=_0xbdd054[_0x969d('0x1e')]||'';this[_0x969d('0x1f')]=_0xbdd054[_0x969d('0x1f')];this['statedesc']=_0xbdd054['statedesc'];}module[_0x969d('0x20')]=History; \ No newline at end of file +var _0x8947=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','calleridname','calleridnum','number','starttime','responsetime','endtime','ringtime','getSeconds','holdtime'];(function(_0x354ea4,_0x24b5ad){var _0x4cb59d=function(_0x43763){while(--_0x43763){_0x354ea4['push'](_0x354ea4['shift']());}};_0x4cb59d(++_0x24b5ad);}(_0x8947,0x1d6));var _0x7894=function(_0x4a77e1,_0x213125){_0x4a77e1=_0x4a77e1-0x0;var _0x1bd46d=_0x8947[_0x4a77e1];return _0x1bd46d;};'use strict';var utils=require(_0x7894('0x0'));function History(_0x6b48e1){this['uniqueid']=_0x6b48e1[_0x7894('0x1')];this[_0x7894('0x2')]=_0x6b48e1[_0x7894('0x2')]||undefined;this[_0x7894('0x3')]=_0x6b48e1[_0x7894('0x3')];this[_0x7894('0x4')]=_0x6b48e1['type']==='outbound'?_0x7894('0x5'):_0x6b48e1[_0x7894('0x3')];this[_0x7894('0x6')]=_0x6b48e1[_0x7894('0x6')];this[_0x7894('0x7')]=_0x6b48e1[_0x7894('0x7')];this[_0x7894('0x8')]=_0x6b48e1[_0x7894('0x8')];this[_0x7894('0x9')]=_0x6b48e1[_0x7894('0x6')]+_0x6b48e1[_0x7894('0x7')]+_0x6b48e1[_0x7894('0x8')]+_0x6b48e1[_0x7894('0xa')]+_0x6b48e1['countdropretry']+_0x6b48e1[_0x7894('0xb')]+_0x6b48e1['countmachineretry']+_0x6b48e1[_0x7894('0xc')];this[_0x7894('0xa')]=_0x6b48e1[_0x7894('0xa')];this[_0x7894('0xd')]=_0x6b48e1[_0x7894('0xd')];this[_0x7894('0xb')]=_0x6b48e1['countabandonedretry'];this[_0x7894('0xe')]=_0x6b48e1[_0x7894('0xe')];this[_0x7894('0xc')]=_0x6b48e1[_0x7894('0xc')];this[_0x7894('0x5')]=_0x6b48e1[_0x7894('0x5')];this[_0x7894('0xf')]=_0x6b48e1['name'];this[_0x7894('0x10')]=_0x6b48e1[_0x7894('0x11')];this['starttime']=_0x6b48e1[_0x7894('0x12')];this[_0x7894('0x13')]=_0x6b48e1['responsetime'];this[_0x7894('0x14')]=_0x6b48e1[_0x7894('0x13')];this[_0x7894('0x15')]=utils[_0x7894('0x16')](_0x6b48e1['responsetime'],_0x6b48e1[_0x7894('0x12')]);this[_0x7894('0x17')]=0x0;this['talktime']=0x0;this[_0x7894('0x18')]=_0x6b48e1[_0x7894('0x18')];this[_0x7894('0x19')]=_0x6b48e1[_0x7894('0x19')];this[_0x7894('0x1a')]=_0x6b48e1[_0x7894('0x1a')];this[_0x7894('0x1b')]=_0x6b48e1[_0x7894('0x1b')];this['ContactId']=_0x6b48e1[_0x7894('0x1c')];this[_0x7894('0x1d')]=_0x6b48e1[_0x7894('0x1d')];this['UserId']=_0x6b48e1[_0x7894('0x1e')];this['VoiceQueueId']=_0x6b48e1[_0x7894('0x1f')];this[_0x7894('0x20')]=_0x6b48e1[_0x7894('0x20')];this[_0x7894('0x21')]=_0x6b48e1[_0x7894('0x21')]||'';this['originatecalleridname']=_0x6b48e1[_0x7894('0x22')]||'';this[_0x7894('0x23')]=_0x6b48e1[_0x7894('0x23')];this[_0x7894('0x24')]=_0x6b48e1['statedesc'];}module[_0x7894('0x25')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index 99dc3f9..535fdfb 100644 --- a/server/services/ami/dialer/models/queueCallerAbandon.js +++ b/server/services/ami/dialer/models/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1b05=['CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','dropreason','endtime','ringtime','getSeconds','holdtime','talktime','connectedlinename','reason','callback','callbackat','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x1b05,0x88));var _0x51b0=function(_0x5c4274,_0x371430){_0x5c4274=_0x5c4274-0x0;var _0x4306fa=_0x1b05[_0x5c4274];return _0x4306fa;};'use strict';var utils=require(_0x51b0('0x0'));function QueueCallerAbandon(_0x5eaacb,_0x23398c){this[_0x51b0('0x1')]=_0x5eaacb[_0x51b0('0x1')];this[_0x51b0('0x2')]=_0x5eaacb[_0x51b0('0x2')];this[_0x51b0('0x3')]=_0x5eaacb[_0x51b0('0x2')]===_0x51b0('0x4')?_0x51b0('0x5'):_0x5eaacb['type'];this[_0x51b0('0x6')]=_0x5eaacb['countbusyretry'];this[_0x51b0('0x7')]=_0x5eaacb['countcongestionretry'];this[_0x51b0('0x8')]=_0x5eaacb[_0x51b0('0x8')];this[_0x51b0('0x9')]=_0x5eaacb[_0x51b0('0x6')]+_0x5eaacb[_0x51b0('0x7')]+_0x5eaacb['countnoanswerretry']+_0x5eaacb[_0x51b0('0xa')]+_0x5eaacb[_0x51b0('0xb')]+_0x5eaacb['countabandonedretry']+_0x5eaacb['countmachineretry']+_0x5eaacb[_0x51b0('0xc')];this[_0x51b0('0xa')]=_0x5eaacb['countnosuchnumberretry'];this['countdropretry']=_0x5eaacb[_0x51b0('0xb')];this[_0x51b0('0xd')]=_0x5eaacb[_0x51b0('0xd')];this['countmachineretry']=_0x5eaacb[_0x51b0('0xe')];this[_0x51b0('0xc')]=_0x5eaacb['countagentrejectretry'];this['uniqueid']=_0x23398c[_0x51b0('0xf')];this['calleridname']=_0x5eaacb[_0x51b0('0x10')];this[_0x51b0('0x11')]=_0x5eaacb[_0x51b0('0x12')];this[_0x51b0('0x13')]=_0x5eaacb['starttime'];this['responsetime']=_0x5eaacb[_0x51b0('0x14')];this[_0x51b0('0x15')]=_0x5eaacb[_0x51b0('0x15')];this[_0x51b0('0x16')]=_0x5eaacb[_0x51b0('0x16')];this[_0x51b0('0x17')]=this[_0x51b0('0x15')];this[_0x51b0('0x18')]=utils[_0x51b0('0x19')](_0x5eaacb[_0x51b0('0x14')],_0x5eaacb[_0x51b0('0x13')]);this[_0x51b0('0x1a')]=utils[_0x51b0('0x19')](this[_0x51b0('0x15')],_0x5eaacb[_0x51b0('0x14')]);this[_0x51b0('0x1b')]=0x0;this[_0x51b0('0x5')]=_0x23398c[_0x51b0('0x5')];this['membername']=_0x23398c[_0x51b0('0x1c')];this['reason']=_0x23398c[_0x51b0('0x1d')];this[_0x51b0('0x1e')]=_0x5eaacb[_0x51b0('0x1e')];this['callbackuniqueid']=_0x5eaacb['callbackuniqueid'];this[_0x51b0('0x1f')]=_0x5eaacb[_0x51b0('0x1f')];this['recallme']=_0x5eaacb['recallme'];this['ContactId']=_0x5eaacb[_0x51b0('0x20')];this[_0x51b0('0x21')]=_0x5eaacb[_0x51b0('0x21')];this[_0x51b0('0x22')]=_0x5eaacb['UserId'];this['VoiceQueueId']=_0x5eaacb[_0x51b0('0x23')];this[_0x51b0('0x24')]=_0x5eaacb['CampaignId'];this[_0x51b0('0x25')]=_0x5eaacb[_0x51b0('0x25')]||'';this[_0x51b0('0x26')]=_0x5eaacb[_0x51b0('0x26')]||'';this[_0x51b0('0x27')]=_0x5eaacb['agiafterat'];this[_0x51b0('0x28')]=_0x5eaacb['state'];this[_0x51b0('0x29')]=_0x5eaacb[_0x51b0('0x29')];}module[_0x51b0('0x2a')]=QueueCallerAbandon; \ No newline at end of file +var _0x8d13=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','countbusyretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','droptime','dropreason','endtime','ringtime','getSeconds','responsetime','holdtime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x217eb3,_0x3f1dce){var _0x310c3a=function(_0x4d882d){while(--_0x4d882d){_0x217eb3['push'](_0x217eb3['shift']());}};_0x310c3a(++_0x3f1dce);}(_0x8d13,0x169));var _0x38d1=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x8d13[_0x2dafbe];return _0x58a45a;};'use strict';var utils=require(_0x38d1('0x0'));function QueueCallerAbandon(_0x301d0c,_0x5de175){this['scheduledat']=_0x301d0c[_0x38d1('0x1')];this[_0x38d1('0x2')]=_0x301d0c[_0x38d1('0x2')];this[_0x38d1('0x3')]=_0x301d0c[_0x38d1('0x2')]===_0x38d1('0x4')?'queue':_0x301d0c[_0x38d1('0x2')];this[_0x38d1('0x5')]=_0x301d0c['countbusyretry'];this['countcongestionretry']=_0x301d0c['countcongestionretry'];this[_0x38d1('0x6')]=_0x301d0c[_0x38d1('0x6')];this[_0x38d1('0x7')]=_0x301d0c[_0x38d1('0x5')]+_0x301d0c['countcongestionretry']+_0x301d0c[_0x38d1('0x6')]+_0x301d0c[_0x38d1('0x8')]+_0x301d0c[_0x38d1('0x9')]+_0x301d0c['countabandonedretry']+_0x301d0c['countmachineretry']+_0x301d0c['countagentrejectretry'];this['countnosuchnumberretry']=_0x301d0c[_0x38d1('0x8')];this['countdropretry']=_0x301d0c['countdropretry'];this[_0x38d1('0xa')]=_0x301d0c[_0x38d1('0xa')];this['countmachineretry']=_0x301d0c[_0x38d1('0xb')];this[_0x38d1('0xc')]=_0x301d0c['countagentrejectretry'];this['uniqueid']=_0x5de175[_0x38d1('0xd')];this[_0x38d1('0xe')]=_0x301d0c[_0x38d1('0xf')];this[_0x38d1('0x10')]=_0x301d0c[_0x38d1('0x11')];this[_0x38d1('0x12')]=_0x301d0c[_0x38d1('0x12')];this['responsetime']=_0x301d0c['responsetime'];this[_0x38d1('0x13')]=_0x301d0c[_0x38d1('0x13')];this[_0x38d1('0x14')]=_0x301d0c[_0x38d1('0x14')];this[_0x38d1('0x15')]=this['droptime'];this[_0x38d1('0x16')]=utils[_0x38d1('0x17')](_0x301d0c[_0x38d1('0x18')],_0x301d0c[_0x38d1('0x12')]);this[_0x38d1('0x19')]=utils[_0x38d1('0x17')](this[_0x38d1('0x13')],_0x301d0c['responsetime']);this['talktime']=0x0;this[_0x38d1('0x1a')]=_0x5de175[_0x38d1('0x1a')];this[_0x38d1('0x1b')]=_0x5de175['connectedlinename'];this[_0x38d1('0x1c')]=_0x5de175['reason'];this['callback']=_0x301d0c[_0x38d1('0x1d')];this[_0x38d1('0x1e')]=_0x301d0c[_0x38d1('0x1e')];this['callbackat']=_0x301d0c[_0x38d1('0x1f')];this[_0x38d1('0x20')]=_0x301d0c[_0x38d1('0x20')];this[_0x38d1('0x21')]=_0x301d0c[_0x38d1('0x21')];this[_0x38d1('0x22')]=_0x301d0c['ListId'];this[_0x38d1('0x23')]=_0x301d0c[_0x38d1('0x23')];this[_0x38d1('0x24')]=_0x301d0c[_0x38d1('0x24')];this[_0x38d1('0x25')]=_0x301d0c[_0x38d1('0x25')];this[_0x38d1('0x26')]=_0x301d0c[_0x38d1('0x26')]||'';this[_0x38d1('0x27')]=_0x301d0c[_0x38d1('0x27')]||'';this[_0x38d1('0x28')]=_0x301d0c[_0x38d1('0x28')];this['state']=_0x301d0c[_0x38d1('0x29')];this[_0x38d1('0x2a')]=_0x301d0c[_0x38d1('0x2a')];}module[_0x38d1('0x2b')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index 4b834c2..eb99728 100644 --- a/server/services/ami/dialer/utils/hopper.js +++ b/server/services/ami/dialer/utils/hopper.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackListIvr]','checkIsBlackListIvr','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','[createHistory]','createHistory','util','../../../../config/logger','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialerIvr','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]'];(function(_0xc0b549,_0x55ae1a){var _0x1f6767=function(_0x42b7d0){while(--_0x42b7d0){_0xc0b549['push'](_0xc0b549['shift']());}};_0x1f6767(++_0x55ae1a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x0d8b('0x0'));var logger=require(_0x0d8b('0x1'))('dialer');var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x0d8b('0x2'));var cmHopperHistory=require(_0x0d8b('0x3'));function inspectError(_0x43bca1){return util[_0x0d8b('0x4')](_0x43bca1,{'showHidden':![],'depth':null});}function getContactDialer(_0x8196ed,_0x577834,_0x5e15e6){return cmHopper[_0x0d8b('0x5')](_0x8196ed['id'],_0x577834,_0x5e15e6,_0x8196ed[_0x0d8b('0x6')])[_0x0d8b('0x7')](function(_0x4a4470){_0x8196ed[_0x0d8b('0x8')]-=_0x5e15e6;if(_0x8196ed[_0x0d8b('0x8')]<0x0){_0x8196ed['temp']=0x0;}logger[_0x0d8b('0x9')](_0x0d8b('0xa'),inspectError(_0x4a4470));});}exports[_0x0d8b('0x5')]=getContactDialer;function getContactDialerIvr(_0x1f4800,_0x28ff7f){return cmHopper[_0x0d8b('0xb')](_0x1f4800['id'],_0x28ff7f,_0x1f4800[_0x0d8b('0x6')])[_0x0d8b('0x7')](function(_0x48fa16){_0x1f4800[_0x0d8b('0x8')]-=_0x28ff7f;if(_0x1f4800['temp']<0x0){_0x1f4800[_0x0d8b('0x8')]=0x0;}logger[_0x0d8b('0x9')](_0x0d8b('0xc'),inspectError(_0x48fa16));});}exports[_0x0d8b('0xb')]=getContactDialerIvr;function countReScheduled(_0x35a07b){return cmHopper[_0x0d8b('0xd')](_0x35a07b)[_0x0d8b('0x7')](function(_0x31a8cc){logger[_0x0d8b('0x9')](_0x0d8b('0xe'),inspectError(_0x31a8cc));});}exports[_0x0d8b('0xd')]=countReScheduled;function rescheduleContact(_0xe65334){return cmHopper[_0x0d8b('0xf')](_0xe65334)[_0x0d8b('0x7')](function(_0x4f6f21){logger[_0x0d8b('0x9')](_0x0d8b('0x10'),inspectError(_0x4f6f21));});}exports[_0x0d8b('0xf')]=rescheduleContact;function unlockContact(_0xe2e167,_0x2cb03c,_0x5cd485){return cmHopper[_0x0d8b('0x11')](_0xe2e167,_0x2cb03c,_0x5cd485)[_0x0d8b('0x7')](function(_0x2fd0fc){logger[_0x0d8b('0x9')](_0x0d8b('0x12'),inspectError(_0x2fd0fc));});}exports[_0x0d8b('0x11')]=unlockContact;function moveContactManagedDialer(_0x264b39){return cmHopper[_0x0d8b('0x13')](_0x264b39)['catch'](function(_0x27512e){logger[_0x0d8b('0x9')](_0x0d8b('0x14'),inspectError(_0x27512e));});}exports[_0x0d8b('0x13')]=moveContactManagedDialer;function checkIsBlackList(_0x24e8ed){return cmHopperBlack[_0x0d8b('0x15')](_0x24e8ed)[_0x0d8b('0x7')](function(_0x352c17){logger['error']('[checkIsBlackList]',inspectError(_0x352c17));});}exports[_0x0d8b('0x15')]=checkIsBlackList;function checkIsBlackListIvr(_0x54a9a7){return cmHopperBlack['checkIsBlackListIvr'](_0x54a9a7)['catch'](function(_0x238728){logger[_0x0d8b('0x9')](_0x0d8b('0x16'),inspectError(_0x238728));});}exports[_0x0d8b('0x17')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x221071,_0x2c64e2,_0x30980c){return cmHopperAdditionalPhone[_0x0d8b('0x18')](_0x221071,_0x2c64e2,_0x30980c)[_0x0d8b('0x7')](function(_0x5e5bc3){logger[_0x0d8b('0x9')](_0x0d8b('0x19'),inspectError(_0x5e5bc3));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0xe1ef20,_0x4a0ae4,_0x3dd149){return cmHopperAdditionalPhone[_0x0d8b('0x1a')](_0xe1ef20,_0x4a0ae4,_0x3dd149)[_0x0d8b('0x7')](function(_0x4fe6f9){logger['error'](_0x0d8b('0x1b'),inspectError(_0x4fe6f9));});}exports[_0x0d8b('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0x4c05ee){return cmHopperHistory[_0x0d8b('0x1c')](_0x4c05ee)['catch'](function(_0x1b2b59){logger['error'](_0x0d8b('0x1d'),inspectError(_0x1b2b59));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x2ab00d){return cmHopperHistory['createHistory'](_0x2ab00d)[_0x0d8b('0x7')](function(_0x544735){logger[_0x0d8b('0x9')](_0x0d8b('0x1e'),inspectError(_0x544735));});}exports[_0x0d8b('0x1f')]=createHistory; \ No newline at end of file +var _0xd8b0=['moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackListIvr]','checkIsBlackListIvr','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','[createHistory]','createHistory','util','../../../../config/logger','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialerIvr','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]'];(function(_0x3c163f,_0x8fc5f6){var _0x54edb3=function(_0x94799b){while(--_0x94799b){_0x3c163f['push'](_0x3c163f['shift']());}};_0x54edb3(++_0x8fc5f6);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var util=require(_0x0d8b('0x0'));var logger=require(_0x0d8b('0x1'))('dialer');var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x0d8b('0x2'));var cmHopperHistory=require(_0x0d8b('0x3'));function inspectError(_0x43bca1){return util[_0x0d8b('0x4')](_0x43bca1,{'showHidden':![],'depth':null});}function getContactDialer(_0x8196ed,_0x577834,_0x5e15e6){return cmHopper[_0x0d8b('0x5')](_0x8196ed['id'],_0x577834,_0x5e15e6,_0x8196ed[_0x0d8b('0x6')])[_0x0d8b('0x7')](function(_0x4a4470){_0x8196ed[_0x0d8b('0x8')]-=_0x5e15e6;if(_0x8196ed[_0x0d8b('0x8')]<0x0){_0x8196ed['temp']=0x0;}logger[_0x0d8b('0x9')](_0x0d8b('0xa'),inspectError(_0x4a4470));});}exports[_0x0d8b('0x5')]=getContactDialer;function getContactDialerIvr(_0x1f4800,_0x28ff7f){return cmHopper[_0x0d8b('0xb')](_0x1f4800['id'],_0x28ff7f,_0x1f4800[_0x0d8b('0x6')])[_0x0d8b('0x7')](function(_0x48fa16){_0x1f4800[_0x0d8b('0x8')]-=_0x28ff7f;if(_0x1f4800['temp']<0x0){_0x1f4800[_0x0d8b('0x8')]=0x0;}logger[_0x0d8b('0x9')](_0x0d8b('0xc'),inspectError(_0x48fa16));});}exports[_0x0d8b('0xb')]=getContactDialerIvr;function countReScheduled(_0x35a07b){return cmHopper[_0x0d8b('0xd')](_0x35a07b)[_0x0d8b('0x7')](function(_0x31a8cc){logger[_0x0d8b('0x9')](_0x0d8b('0xe'),inspectError(_0x31a8cc));});}exports[_0x0d8b('0xd')]=countReScheduled;function rescheduleContact(_0xe65334){return cmHopper[_0x0d8b('0xf')](_0xe65334)[_0x0d8b('0x7')](function(_0x4f6f21){logger[_0x0d8b('0x9')](_0x0d8b('0x10'),inspectError(_0x4f6f21));});}exports[_0x0d8b('0xf')]=rescheduleContact;function unlockContact(_0xe2e167,_0x2cb03c,_0x5cd485){return cmHopper[_0x0d8b('0x11')](_0xe2e167,_0x2cb03c,_0x5cd485)[_0x0d8b('0x7')](function(_0x2fd0fc){logger[_0x0d8b('0x9')](_0x0d8b('0x12'),inspectError(_0x2fd0fc));});}exports[_0x0d8b('0x11')]=unlockContact;function moveContactManagedDialer(_0x264b39){return cmHopper[_0x0d8b('0x13')](_0x264b39)['catch'](function(_0x27512e){logger[_0x0d8b('0x9')](_0x0d8b('0x14'),inspectError(_0x27512e));});}exports[_0x0d8b('0x13')]=moveContactManagedDialer;function checkIsBlackList(_0x24e8ed){return cmHopperBlack[_0x0d8b('0x15')](_0x24e8ed)[_0x0d8b('0x7')](function(_0x352c17){logger['error']('[checkIsBlackList]',inspectError(_0x352c17));});}exports[_0x0d8b('0x15')]=checkIsBlackList;function checkIsBlackListIvr(_0x54a9a7){return cmHopperBlack['checkIsBlackListIvr'](_0x54a9a7)['catch'](function(_0x238728){logger[_0x0d8b('0x9')](_0x0d8b('0x16'),inspectError(_0x238728));});}exports[_0x0d8b('0x17')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x221071,_0x2c64e2,_0x30980c){return cmHopperAdditionalPhone[_0x0d8b('0x18')](_0x221071,_0x2c64e2,_0x30980c)[_0x0d8b('0x7')](function(_0x5e5bc3){logger[_0x0d8b('0x9')](_0x0d8b('0x19'),inspectError(_0x5e5bc3));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0xe1ef20,_0x4a0ae4,_0x3dd149){return cmHopperAdditionalPhone[_0x0d8b('0x1a')](_0xe1ef20,_0x4a0ae4,_0x3dd149)[_0x0d8b('0x7')](function(_0x4fe6f9){logger['error'](_0x0d8b('0x1b'),inspectError(_0x4fe6f9));});}exports[_0x0d8b('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0x4c05ee){return cmHopperHistory[_0x0d8b('0x1c')](_0x4c05ee)['catch'](function(_0x1b2b59){logger['error'](_0x0d8b('0x1d'),inspectError(_0x1b2b59));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x2ab00d){return cmHopperHistory['createHistory'](_0x2ab00d)[_0x0d8b('0x7')](function(_0x544735){logger[_0x0d8b('0x9')](_0x0d8b('0x1e'),inspectError(_0x544735));});}exports[_0x0d8b('0x1f')]=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index 4437f42..dd27f44 100644 --- a/server/services/ami/dialer/utils/index.js +++ b/server/services/ami/dialer/utils/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9b3e=['dialActive','active','milliseconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','dialTimezone','dialGlobalInterval','Interval','isNil','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','status','TrunkBackup','includes','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','\x5cw{0,','replace','random','toString','getCallerIdRandom','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','moment','util','../../../../config/logger','../../../../config/environment/shared','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','dialMethod','preview','isPreviewCampaign','type','ivr','outbound','isOutboundQueue'];(function(_0x550e05,_0x486851){var _0x1aa351=function(_0x3eb499){while(--_0x3eb499){_0x550e05['push'](_0x550e05['shift']());}};_0x1aa351(++_0x486851);}(_0x9b3e,0x83));var _0xe9b3=function(_0x4bb0af,_0x368c52){_0x4bb0af=_0x4bb0af-0x0;var _0x5dbf2c=_0x9b3e[_0x4bb0af];return _0x5dbf2c;};'use strict';var _=require('lodash');var moment=require(_0xe9b3('0x0'));var util=require(_0xe9b3('0x1'));var logger=require(_0xe9b3('0x2'))('dialer');var timezones=require(_0xe9b3('0x3'))['timezones'];var CAMPAIGN_STATUS={'ACTIVE':_0xe9b3('0x4'),'BLACKLIST':_0xe9b3('0x5'),'CONTACTS_RESCHEDULED':_0xe9b3('0x6'),'DEACTIVATED':_0xe9b3('0x7'),'DISACTIVED':'IS_DISACTIVED','EMPTY_INTERVAL':_0xe9b3('0x8'),'INACTIVE':_0xe9b3('0x9'),'NO_AGENTS_LOGGED':_0xe9b3('0xa'),'NO_AVAILABLE_CONTACTS':_0xe9b3('0xb'),'NULL_INTERVAL':_0xe9b3('0xc'),'OVERTIME_INTERVAL':_0xe9b3('0xd'),'OVERTIME_GLOBAL_INTERVAL':_0xe9b3('0xe'),'QUEUE_RECALL':_0xe9b3('0xf'),'RECALL_TIMEOUT':'RECALLFAILEDTIMEOUT','RUNNING':'RUNNING','UNKNOWN_TIMEZONE':_0xe9b3('0x10'),'UNREACHABLE_TRUNK':_0xe9b3('0x11')};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x10e5de){return _0x10e5de[_0xe9b3('0x12')]===_0xe9b3('0x13');}exports[_0xe9b3('0x14')]=isPreviewCampaign;function isIVRCampaign(_0x5687fe){return _0x5687fe[_0xe9b3('0x15')]===_0xe9b3('0x16');}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0x1a73eb){return _0x1a73eb[_0xe9b3('0x15')]===_0xe9b3('0x17');}exports[_0xe9b3('0x18')]=isOutboundQueue;function isQueueCampaignActive(_0x4dea4b){return _0x4dea4b[_0xe9b3('0x19')];}exports['isQueueCampaignActive']=isQueueCampaignActive;function isIVRCampaignActive(_0x21b17){return _0x21b17[_0xe9b3('0x1a')];}exports['isIVRCampaignActive']=isIVRCampaignActive;function getSeconds(_0x43d5ee,_0x3f1c17){var _0xcec15b=moment(_0x43d5ee)['milliseconds'](0x0);var _0x1c3e07=moment(_0x3f1c17)[_0xe9b3('0x1b')](0x0);return _0xcec15b['diff'](_0x1c3e07,'seconds');}exports[_0xe9b3('0x1c')]=getSeconds;function hasQueueCampaignDataChanged(_0x472efb,_0x1b8e45){var _0x21fe36=![];var _0x506255=_0x472efb[_0xe9b3('0x12')]!==_0x1b8e45[_0xe9b3('0x12')]||_0x472efb[_0xe9b3('0x19')]!==_0x1b8e45[_0xe9b3('0x19')]||_0x472efb['message']!==_0x1b8e45[_0xe9b3('0x1d')];var _0x10f655=_0x472efb[_0xe9b3('0x1e')]!==_0x1b8e45[_0xe9b3('0x1e')]||_0x472efb[_0xe9b3('0x1f')]!==_0x1b8e45[_0xe9b3('0x1f')]||_0x472efb['loggedInDb']!==_0x1b8e45[_0xe9b3('0x20')]||_0x472efb['paused']!==_0x1b8e45[_0xe9b3('0x21')]||_0x472efb[_0xe9b3('0x22')]!==_0x1b8e45[_0xe9b3('0x22')]||_0x472efb['pTalking']!==_0x1b8e45[_0xe9b3('0x23')]||_0x472efb[_0xe9b3('0x24')]!==_0x1b8e45[_0xe9b3('0x24')]||_0x472efb[_0xe9b3('0x25')]!==_0x1b8e45['inUse']||_0x472efb[_0xe9b3('0x26')]!==_0x1b8e45[_0xe9b3('0x26')];if(_0x472efb[_0xe9b3('0x27')]&&_0x1b8e45[_0xe9b3('0x27')]){_0x21fe36=_0x472efb[_0xe9b3('0x27')]['name']!==_0x1b8e45[_0xe9b3('0x27')][_0xe9b3('0x28')]||_0x472efb[_0xe9b3('0x27')][_0xe9b3('0x1a')]!==_0x1b8e45[_0xe9b3('0x27')]['active'];}return _0x506255||_0x10f655||_0x21fe36;}exports['hasQueueCampaignDataChanged']=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x240629){var _0x35f90b=null;var _0x4f34a9=_0x240629[_0xe9b3('0x29')];if(_['isNil'](_0x240629[_0xe9b3('0x2a')])||_['isNil'](_0x240629[_0xe9b3('0x2b')])||_[_0xe9b3('0x2c')](_0x240629[_0xe9b3('0x2b')][_0xe9b3('0x2d')])){_0x35f90b=CAMPAIGN_STATUS[_0xe9b3('0x2e')];}else if(_[_0xe9b3('0x2f')](_0x240629[_0xe9b3('0x2a')])||_[_0xe9b3('0x2f')](_0x240629[_0xe9b3('0x2b')][_0xe9b3('0x2d')])){_0x35f90b=CAMPAIGN_STATUS[_0xe9b3('0x30')];}else if(_0x4f34a9&&!timezones[_0x4f34a9]){_0x35f90b=CAMPAIGN_STATUS[_0xe9b3('0x31')];}return _0x35f90b;}function checkAnyValidTrunk(_0xafe471,_0x815652){var _0x16c4fa=null;var _0x52c517=_0xe9b3('0x32');var _0x59128b=[_0xe9b3('0x33'),_0xe9b3('0x34')];var _0x1c26f6=!![];if(_0xafe471[_0xe9b3('0x27')]&&_0xafe471['Trunk'][_0xe9b3('0x1a')]){_0x52c517+=_0xafe471[_0xe9b3('0x27')][_0xe9b3('0x28')];_0x16c4fa=_0x815652[_0x52c517];_0x1c26f6=_0x59128b['includes'](_0x16c4fa[_0xe9b3('0x35')]);}else if(_0xafe471['TrunkBackup']&&_0xafe471[_0xe9b3('0x36')][_0xe9b3('0x1a')]){_0x52c517+=_0xafe471[_0xe9b3('0x36')][_0xe9b3('0x28')];_0x16c4fa=_0x815652[_0x52c517];_0x1c26f6=_0x59128b[_0xe9b3('0x37')](_0x16c4fa[_0xe9b3('0x35')]);}return _0x1c26f6;}function getQueueCampaignStatusMessage(_0x38ad7c,_0x3f8480){var _0x43a525=CAMPAIGN_STATUS['ACTIVE'];var _0x14bfde=isPreviewCampaign(_0x38ad7c);if(!isQueueCampaignActive(_0x38ad7c)){if(_0x14bfde){_0x43a525=CAMPAIGN_STATUS[_0xe9b3('0x38')];}else{if(_0x38ad7c[_0xe9b3('0x26')]===0x0&&_0x38ad7c[_0xe9b3('0x22')]===0x0&&_0x38ad7c[_0xe9b3('0x24')]===0x0&&(_0x38ad7c[_0xe9b3('0x23')]||0x0)===0x0){_0x43a525=CAMPAIGN_STATUS['INACTIVE'];}else{_0x43a525=CAMPAIGN_STATUS[_0xe9b3('0x39')];}}}else if(_0x38ad7c['loggedIn']===0x0){_0x43a525=CAMPAIGN_STATUS[_0xe9b3('0x3a')];}else if(!checkAnyValidTrunk(_0x38ad7c,_0x3f8480)){_0x43a525=CAMPAIGN_STATUS[_0xe9b3('0x3b')];}else if(!isPreviewCampaign(_0x38ad7c)){var _0x4ebbde=checkAnyValidQueueCampaignInterval(_0x38ad7c);if(_0x4ebbde){_0x43a525=_0x4ebbde;}}return _0x43a525;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x59f5ac){var _0x597bd9=CAMPAIGN_STATUS[_0xe9b3('0x39')];if(_0x59f5ac[_0xe9b3('0x26')]===0x0&&_0x59f5ac['talking']===0x0&&_0x59f5ac[_0xe9b3('0x24')]===0x0&&(_0x59f5ac[_0xe9b3('0x23')]||0x0)===0x0){_0x597bd9=CAMPAIGN_STATUS['INACTIVE'];}return _0x597bd9;}exports[_0xe9b3('0x3c')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x298cc1){var _0x5bdc2f=_0x298cc1[_0xe9b3('0x3d')](/"(.*?)"/);return _0x5bdc2f?_0x5bdc2f[0x1]:_0x298cc1;}exports[_0xe9b3('0x3e')]=extractCalleridName;function getCallerId(_0x135c46,_0x5782aa,_0x4087a6){if(!_[_0xe9b3('0x3f')](_0x4087a6)&&typeof _0x4087a6===_0xe9b3('0x40')&&!_[_0xe9b3('0x2f')](_0x4087a6)){if(!_[_0xe9b3('0x3f')](_0x5782aa)&&typeof _0x5782aa===_0xe9b3('0x40')&&!_['isEmpty'](_0x5782aa)){return util[_0xe9b3('0x41')](_0xe9b3('0x42'),_0x5782aa,_0x4087a6);}return util[_0xe9b3('0x41')](_0xe9b3('0x42'),_0x4087a6,_0x4087a6);}if(!_[_0xe9b3('0x3f')](_0x135c46)&&typeof _0x135c46===_0xe9b3('0x40')&&!_[_0xe9b3('0x2f')](_0x135c46)){return _0x135c46;}return _0xe9b3('0x43');}exports[_0xe9b3('0x44')]=getCallerId;function getCallerIdRandom(_0x4d28f6,_0x41044f){var _0x210636;var _0x2e0863;var _0x47a865;if(_0x41044f<=0x0){_0x41044f=0x1;}_0x210636=new RegExp(_0xe9b3('0x45')+_0x41044f+'}$');_0x2e0863=Math['pow'](0xa,_0x41044f-0x1);_0x47a865=Math['pow'](0xa,_0x41044f)-0x1;return util[_0xe9b3('0x41')]('%s',_[_0xe9b3('0x46')](_0x4d28f6,_0x210636,_[_0xe9b3('0x47')](_0x2e0863,_0x47a865)[_0xe9b3('0x48')]()));}exports[_0xe9b3('0x49')]=getCallerIdRandom;function decrementOriginate(_0x9e668e){if(_0x9e668e[_0xe9b3('0x26')]&&_0x9e668e[_0xe9b3('0x26')]>0x0){_0x9e668e['originated']-=0x1;}else{logger['error'](_0xe9b3('0x4a'));}}exports['decrementOriginate']=decrementOriginate;function checkContactEmpty(_0x33c2f4){return _0x33c2f4&&_0x33c2f4['length']>0x0;}exports[_0xe9b3('0x4b')]=checkContactEmpty;function erlangb(_0x4f1991,_0x91716b){if(_0x91716b===0x0){return 0x0;}var _0x28596e=0x1;for(var _0x4fbddc=0x1;_0x4fbddc<=_0x91716b;_0x4fbddc+=0x1){_0x28596e=0x1+_0x28596e*_0x4fbddc/_0x4f1991;}return 0x1/_0x28596e;}exports[_0xe9b3('0x4c')]=erlangb;function checkContactLowerLimitOriginate(_0x2224d1,_0x1d7e7e,_0x53e0fc){if(_0x1d7e7e>_0x53e0fc){for(var _0x434987=0x0;_0x434987<_0x1d7e7e-_0x53e0fc;_0x434987+=0x1){decrementOriginate(_0x2224d1);}}}exports[_0xe9b3('0x4d')]=checkContactLowerLimitOriginate; \ No newline at end of file +var _0xe7a2=['pTalking','waiting','inUse','originated','Trunk','name','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','EMPTY_INTERVAL','status','TrunkBackup','INACTIVE','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','DISACTIVED','match','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','replace','random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','lodash','moment','util','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','ACTIVE','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','dialMethod','isPreviewCampaign','type','ivr','isIVRCampaign','isOutboundQueue','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking'];(function(_0x2c40ff,_0x69e09){var _0x559eed=function(_0x118fe6){while(--_0x118fe6){_0x2c40ff['push'](_0x2c40ff['shift']());}};_0x559eed(++_0x69e09);}(_0xe7a2,0x1ac));var _0x2e7a=function(_0x33a959,_0x466629){_0x33a959=_0x33a959-0x0;var _0x136245=_0xe7a2[_0x33a959];return _0x136245;};'use strict';var _=require(_0x2e7a('0x0'));var moment=require(_0x2e7a('0x1'));var util=require(_0x2e7a('0x2'));var logger=require(_0x2e7a('0x3'))(_0x2e7a('0x4'));var timezones=require(_0x2e7a('0x5'))[_0x2e7a('0x6')];var CAMPAIGN_STATUS={'ACTIVE':_0x2e7a('0x7'),'BLACKLIST':'BLACKLIST','CONTACTS_RESCHEDULED':_0x2e7a('0x8'),'DEACTIVATED':_0x2e7a('0x9'),'DISACTIVED':_0x2e7a('0xa'),'EMPTY_INTERVAL':_0x2e7a('0xb'),'INACTIVE':_0x2e7a('0xc'),'NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':_0x2e7a('0xd'),'NULL_INTERVAL':_0x2e7a('0xe'),'OVERTIME_INTERVAL':_0x2e7a('0xf'),'OVERTIME_GLOBAL_INTERVAL':_0x2e7a('0x10'),'QUEUE_RECALL':_0x2e7a('0x11'),'RECALL_TIMEOUT':_0x2e7a('0x12'),'RUNNING':_0x2e7a('0x13'),'UNKNOWN_TIMEZONE':_0x2e7a('0x14'),'UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x533dcb){return _0x533dcb[_0x2e7a('0x15')]==='preview';}exports[_0x2e7a('0x16')]=isPreviewCampaign;function isIVRCampaign(_0x2f3112){return _0x2f3112[_0x2e7a('0x17')]===_0x2e7a('0x18');}exports[_0x2e7a('0x19')]=isIVRCampaign;function isOutboundQueue(_0x413a5f){return _0x413a5f[_0x2e7a('0x17')]==='outbound';}exports[_0x2e7a('0x1a')]=isOutboundQueue;function isQueueCampaignActive(_0x93da2e){return _0x93da2e[_0x2e7a('0x1b')];}exports[_0x2e7a('0x1c')]=isQueueCampaignActive;function isIVRCampaignActive(_0x285ba5){return _0x285ba5[_0x2e7a('0x1d')];}exports[_0x2e7a('0x1e')]=isIVRCampaignActive;function getSeconds(_0x26c241,_0x145fa2){var _0x3f4c96=moment(_0x26c241)[_0x2e7a('0x1f')](0x0);var _0x5e87bd=moment(_0x145fa2)['milliseconds'](0x0);return _0x3f4c96['diff'](_0x5e87bd,_0x2e7a('0x20'));}exports[_0x2e7a('0x21')]=getSeconds;function hasQueueCampaignDataChanged(_0x5eba07,_0x253c89){var _0x4bd580=![];var _0x40c8cd=_0x5eba07[_0x2e7a('0x15')]!==_0x253c89[_0x2e7a('0x15')]||_0x5eba07[_0x2e7a('0x1b')]!==_0x253c89[_0x2e7a('0x1b')]||_0x5eba07[_0x2e7a('0x22')]!==_0x253c89[_0x2e7a('0x22')];var _0x4c41c5=_0x5eba07['available']!==_0x253c89[_0x2e7a('0x23')]||_0x5eba07[_0x2e7a('0x24')]!==_0x253c89['loggedIn']||_0x5eba07[_0x2e7a('0x25')]!==_0x253c89[_0x2e7a('0x25')]||_0x5eba07[_0x2e7a('0x26')]!==_0x253c89[_0x2e7a('0x26')]||_0x5eba07[_0x2e7a('0x27')]!==_0x253c89['talking']||_0x5eba07[_0x2e7a('0x28')]!==_0x253c89[_0x2e7a('0x28')]||_0x5eba07[_0x2e7a('0x29')]!==_0x253c89['waiting']||_0x5eba07[_0x2e7a('0x2a')]!==_0x253c89[_0x2e7a('0x2a')]||_0x5eba07[_0x2e7a('0x2b')]!==_0x253c89[_0x2e7a('0x2b')];if(_0x5eba07['Trunk']&&_0x253c89[_0x2e7a('0x2c')]){_0x4bd580=_0x5eba07[_0x2e7a('0x2c')][_0x2e7a('0x2d')]!==_0x253c89[_0x2e7a('0x2c')][_0x2e7a('0x2d')]||_0x5eba07['Trunk'][_0x2e7a('0x1d')]!==_0x253c89[_0x2e7a('0x2c')]['active'];}return _0x40c8cd||_0x4c41c5||_0x4bd580;}exports['hasQueueCampaignDataChanged']=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x5ead56){var _0x3c4f13=null;var _0x344d6c=_0x5ead56[_0x2e7a('0x2e')];if(_[_0x2e7a('0x2f')](_0x5ead56[_0x2e7a('0x30')])||_[_0x2e7a('0x2f')](_0x5ead56[_0x2e7a('0x31')])||_[_0x2e7a('0x2f')](_0x5ead56['Interval'][_0x2e7a('0x32')])){_0x3c4f13=CAMPAIGN_STATUS[_0x2e7a('0x33')];}else if(_['isEmpty'](_0x5ead56[_0x2e7a('0x30')])||_['isEmpty'](_0x5ead56['Interval']['Intervals'])){_0x3c4f13=CAMPAIGN_STATUS[_0x2e7a('0x34')];}else if(_0x344d6c&&!timezones[_0x344d6c]){_0x3c4f13=CAMPAIGN_STATUS['UNKNOWN_TIMEZONE'];}return _0x3c4f13;}function checkAnyValidTrunk(_0x465099,_0x2673e3){var _0x1952ce=null;var _0x380f73='SIP/';var _0x5d0e94=['reachable','unmonitored'];var _0x976eb9=!![];if(_0x465099['Trunk']&&_0x465099[_0x2e7a('0x2c')][_0x2e7a('0x1d')]){_0x380f73+=_0x465099[_0x2e7a('0x2c')][_0x2e7a('0x2d')];_0x1952ce=_0x2673e3[_0x380f73];_0x976eb9=_0x5d0e94['includes'](_0x1952ce[_0x2e7a('0x35')]);}else if(_0x465099[_0x2e7a('0x36')]&&_0x465099['TrunkBackup'][_0x2e7a('0x1d')]){_0x380f73+=_0x465099['TrunkBackup'][_0x2e7a('0x2d')];_0x1952ce=_0x2673e3[_0x380f73];_0x976eb9=_0x5d0e94['includes'](_0x1952ce[_0x2e7a('0x35')]);}return _0x976eb9;}function getQueueCampaignStatusMessage(_0x1698b0,_0x2264d7){var _0x31c7c1=CAMPAIGN_STATUS[_0x2e7a('0x7')];var _0x388d39=isPreviewCampaign(_0x1698b0);if(!isQueueCampaignActive(_0x1698b0)){if(_0x388d39){_0x31c7c1=CAMPAIGN_STATUS[_0x2e7a('0x37')];}else{if(_0x1698b0['originated']===0x0&&_0x1698b0['talking']===0x0&&_0x1698b0['waiting']===0x0&&(_0x1698b0[_0x2e7a('0x28')]||0x0)===0x0){_0x31c7c1=CAMPAIGN_STATUS[_0x2e7a('0x37')];}else{_0x31c7c1=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x1698b0[_0x2e7a('0x24')]===0x0){_0x31c7c1=CAMPAIGN_STATUS['NO_AGENTS_LOGGED'];}else if(!checkAnyValidTrunk(_0x1698b0,_0x2264d7)){_0x31c7c1=CAMPAIGN_STATUS[_0x2e7a('0x38')];}else if(!isPreviewCampaign(_0x1698b0)){var _0x275a50=checkAnyValidQueueCampaignInterval(_0x1698b0);if(_0x275a50){_0x31c7c1=_0x275a50;}}return _0x31c7c1;}exports[_0x2e7a('0x39')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x42c1bf){var _0x4560e3=CAMPAIGN_STATUS[_0x2e7a('0x3a')];if(_0x42c1bf[_0x2e7a('0x2b')]===0x0&&_0x42c1bf[_0x2e7a('0x27')]===0x0&&_0x42c1bf['waiting']===0x0&&(_0x42c1bf['pTalking']||0x0)===0x0){_0x4560e3=CAMPAIGN_STATUS['INACTIVE'];}return _0x4560e3;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x4f641d){var _0x3cfa41=_0x4f641d[_0x2e7a('0x3b')](/"(.*?)"/);return _0x3cfa41?_0x3cfa41[0x1]:_0x4f641d;}exports['extractCalleridName']=extractCalleridName;function getCallerId(_0xca70f9,_0x5bca89,_0x5043d9){if(!_[_0x2e7a('0x3c')](_0x5043d9)&&typeof _0x5043d9===_0x2e7a('0x3d')&&!_['isEmpty'](_0x5043d9)){if(!_[_0x2e7a('0x3c')](_0x5bca89)&&typeof _0x5bca89===_0x2e7a('0x3d')&&!_[_0x2e7a('0x3e')](_0x5bca89)){return util['format']('\x22%s\x22\x20<%s>',_0x5bca89,_0x5043d9);}return util[_0x2e7a('0x3f')](_0x2e7a('0x40'),_0x5043d9,_0x5043d9);}if(!_[_0x2e7a('0x3c')](_0xca70f9)&&typeof _0xca70f9===_0x2e7a('0x3d')&&!_[_0x2e7a('0x3e')](_0xca70f9)){return _0xca70f9;}return _0x2e7a('0x41');}exports[_0x2e7a('0x42')]=getCallerId;function getCallerIdRandom(_0x4e8c76,_0x588caa){var _0xe07a75;var _0xd7bff5;var _0x3fb1d2;if(_0x588caa<=0x0){_0x588caa=0x1;}_0xe07a75=new RegExp(_0x2e7a('0x43')+_0x588caa+'}$');_0xd7bff5=Math[_0x2e7a('0x44')](0xa,_0x588caa-0x1);_0x3fb1d2=Math[_0x2e7a('0x44')](0xa,_0x588caa)-0x1;return util[_0x2e7a('0x3f')]('%s',_[_0x2e7a('0x45')](_0x4e8c76,_0xe07a75,_[_0x2e7a('0x46')](_0xd7bff5,_0x3fb1d2)[_0x2e7a('0x47')]()));}exports[_0x2e7a('0x48')]=getCallerIdRandom;function decrementOriginate(_0xfca4e3){if(_0xfca4e3[_0x2e7a('0x2b')]&&_0xfca4e3[_0x2e7a('0x2b')]>0x0){_0xfca4e3[_0x2e7a('0x2b')]-=0x1;}else{logger[_0x2e7a('0x49')](_0x2e7a('0x4a'));}}exports['decrementOriginate']=decrementOriginate;function checkContactEmpty(_0x3e904a){return _0x3e904a&&_0x3e904a['length']>0x0;}exports[_0x2e7a('0x4b')]=checkContactEmpty;function erlangb(_0x4f7111,_0x135b81){if(_0x135b81===0x0){return 0x0;}var _0x25b8ab=0x1;for(var _0x12283d=0x1;_0x12283d<=_0x135b81;_0x12283d+=0x1){_0x25b8ab=0x1+_0x25b8ab*_0x12283d/_0x4f7111;}return 0x1/_0x25b8ab;}exports[_0x2e7a('0x4c')]=erlangb;function checkContactLowerLimitOriginate(_0x3e59d7,_0x228e9b,_0x2dbc00){if(_0x228e9b>_0x2dbc00){for(var _0x334614=0x0;_0x334614<_0x228e9b-_0x2dbc00;_0x334614+=0x1){decrementOriginate(_0x3e59d7);}}}exports[_0x2e7a('0x4d')]=checkContactLowerLimitOriginate; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 66aeb34..195eb70 100644 --- a/server/services/ami/fax/action.js +++ b/server/services/ami/fax/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x249b80,_0x302689){var _0x36903d=function(_0x24e2ce){while(--_0x24e2ce){_0x249b80['push'](_0x249b80['shift']());}};_0x36903d(++_0x302689);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file +var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x454a9b,_0x49b525){var _0x4d1409=function(_0x2368ff){while(--_0x2368ff){_0x454a9b['push'](_0x454a9b['shift']());}};_0x4d1409(++_0x49b525);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index cfd0ca2..5c5b9a7 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 _0xd5fd=['syncVarSet','newstate','syncNewState','newexten','faxstatus','syncReceiveFax','hangup','syncHangup','originateresponse','prototype','syncNewchannel','context','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channels','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','syncNewExten','operation','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','parse','.pdf','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','pick','response','AttachmentId','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','SUCCESS','updateStatus','SENDING\x20FAILED:\x20','faxstatusstring','send','execOriginate','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','FaxAccountId','Trunk','isValid','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','execute','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isNil','active','SIP/%s','status','reachable','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','uuid','moment','tiff2pdf','./util/gs','fax','../ami','./rpcDb','./channel','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','bind','varset'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0xd5fd,0x1c0));var _0xdd5f=function(_0x522ea3,_0x2384bd){_0x522ea3=_0x522ea3-0x0;var _0x4eb4cb=_0xd5fd[_0x522ea3];return _0x4eb4cb;};'use strict';var util=require(_0xdd5f('0x0'));var _=require(_0xdd5f('0x1'));var BPromise=require('bluebird');var uuid=require(_0xdd5f('0x2'));var moment=require(_0xdd5f('0x3'));var path=require('path');var tiff2pdf=require(_0xdd5f('0x4'));var gs=require(_0xdd5f('0x5'));var logger=require('../../../config/logger')(_0xdd5f('0x6'));var ami=require(_0xdd5f('0x7'));var rpcDb=require(_0xdd5f('0x8'));var Channel=require(_0xdd5f('0x9'));var ut=require('./util/util');var Action=require(_0xdd5f('0xa'));var faxAccount=require(_0xdd5f('0xb'));var attachment=require(_0xdd5f('0xc'));var faxMessage=require(_0xdd5f('0xd'));function Fax(_0x4e51c2){this['channels']={};this['faxAccounts']=_0x4e51c2[_0xdd5f('0xe')];this[_0xdd5f('0xf')]=_0x4e51c2[_0xdd5f('0xf')];this[_0xdd5f('0x10')]={};ami['on'](_0xdd5f('0x11'),this['syncNewchannel'][_0xdd5f('0x12')](this));ami['on'](_0xdd5f('0x13'),this[_0xdd5f('0x14')][_0xdd5f('0x12')](this));ami['on'](_0xdd5f('0x15'),this[_0xdd5f('0x16')][_0xdd5f('0x12')](this));ami['on'](_0xdd5f('0x17'),this['syncNewExten']['bind'](this));ami['on'](_0xdd5f('0x18'),this['syncFaxStatus'][_0xdd5f('0x12')](this));ami['on']('receivefax',this[_0xdd5f('0x19')][_0xdd5f('0x12')](this));ami['on'](_0xdd5f('0x1a'),this[_0xdd5f('0x1b')][_0xdd5f('0x12')](this));ami['on'](_0xdd5f('0x1c'),this['syncOriginateResponse'][_0xdd5f('0x12')](this));}Fax[_0xdd5f('0x1d')][_0xdd5f('0x1e')]=function(_0x42b566){if(_0x42b566[_0xdd5f('0x1f')]===_0xdd5f('0x20')){for(var _0xf61c31 in this[_0xdd5f('0xe')]){if(this['faxAccounts'][_0xdd5f('0x21')](_0xf61c31)){if(_0x42b566['exten']===this[_0xdd5f('0xe')][_0xf61c31][_0xdd5f('0x22')]){this['channels'][_0x42b566[_0xdd5f('0x23')]]={};this[_0xdd5f('0x24')][_0x42b566[_0xdd5f('0x23')]][_0xdd5f('0x25')]=_0x42b566[_0xdd5f('0x25')];this[_0xdd5f('0x24')][_0x42b566[_0xdd5f('0x23')]]['id']=this['faxAccounts'][_0xf61c31]['id'];this[_0xdd5f('0x24')][_0x42b566[_0xdd5f('0x23')]][_0xdd5f('0x26')]=this[_0xdd5f('0xe')][_0xf61c31][_0xdd5f('0x26')];logger[_0xdd5f('0x27')](_0x42b566[_0xdd5f('0x23')],_0xdd5f('0x28'));}}}}if(this[_0xdd5f('0x10')][_0x42b566[_0xdd5f('0x23')]]){this[_0xdd5f('0x24')][_0x42b566[_0xdd5f('0x23')]]={};this[_0xdd5f('0x24')][_0x42b566[_0xdd5f('0x23')]][_0xdd5f('0x25')]=_0x42b566['channel'];logger[_0xdd5f('0x27')](_0x42b566[_0xdd5f('0x23')],_0xdd5f('0x28'));}};Fax[_0xdd5f('0x1d')][_0xdd5f('0x14')]=function(_0x265d53){if(this[_0xdd5f('0x24')][_0x265d53[_0xdd5f('0x23')]]){for(var _0xd82078 in _0x265d53[_0xdd5f('0x29')]){if(_0x265d53['variable'][_0xdd5f('0x21')](_0xd82078)){this[_0xdd5f('0x24')][_0x265d53[_0xdd5f('0x23')]][_0xd82078]=_0x265d53[_0xdd5f('0x2a')];}}}};Fax['prototype'][_0xdd5f('0x16')]=function(_0x3a61fe){if(this[_0xdd5f('0x24')][_0x3a61fe[_0xdd5f('0x23')]]){this[_0xdd5f('0x24')][_0x3a61fe['uniqueid']][_0xdd5f('0x2b')]=_0x3a61fe[_0xdd5f('0x2b')];this[_0xdd5f('0x24')][_0x3a61fe[_0xdd5f('0x23')]][_0xdd5f('0x2c')]=_0x3a61fe['channelstatedesc'];}};Fax[_0xdd5f('0x1d')][_0xdd5f('0x2d')]=function(_0x3646e7){if(this[_0xdd5f('0x24')][_0x3646e7[_0xdd5f('0x23')]]){for(var _0x38ade1 in _0x3646e7[_0xdd5f('0x29')]){if(_0x3646e7[_0xdd5f('0x29')][_0xdd5f('0x21')](_0x38ade1)){this[_0xdd5f('0x24')][_0x3646e7[_0xdd5f('0x23')]][_0x38ade1]=_0x3646e7[_0xdd5f('0x2a')];}}}};Fax[_0xdd5f('0x1d')]['syncFaxStatus']=function(_0x2b7683){if(this[_0xdd5f('0x24')][_0x2b7683['uniqueid']]){this[_0xdd5f('0x24')][_0x2b7683[_0xdd5f('0x23')]][_0xdd5f('0x2e')]=_0x2b7683[_0xdd5f('0x2e')];this[_0xdd5f('0x24')][_0x2b7683[_0xdd5f('0x23')]]['status']=_0x2b7683['status'];this[_0xdd5f('0x24')][_0x2b7683[_0xdd5f('0x23')]][_0xdd5f('0x22')]=_0x2b7683[_0xdd5f('0x22')];this[_0xdd5f('0x24')][_0x2b7683[_0xdd5f('0x23')]][_0xdd5f('0x2f')]=_0x2b7683[_0xdd5f('0x2f')];logger[_0xdd5f('0x27')](_0x2b7683[_0xdd5f('0x23')],_0xdd5f('0x30'));}};Fax[_0xdd5f('0x1d')]['syncReceiveFax']=function(_0x80900d){var _0x47a73a=this;if(this[_0xdd5f('0x24')][_0x80900d[_0xdd5f('0x23')]]){var _0x2cfcb9=this[_0xdd5f('0x24')][_0x80900d[_0xdd5f('0x23')]]['id'];this['channels'][_0x80900d[_0xdd5f('0x23')]][_0xdd5f('0x31')]=_0x80900d[_0xdd5f('0x31')];this['channels'][_0x80900d['uniqueid']][_0xdd5f('0x32')]=_0x80900d['pagestransferred'];this[_0xdd5f('0x24')][_0x80900d[_0xdd5f('0x23')]][_0xdd5f('0x22')]=_0x80900d[_0xdd5f('0x22')];this[_0xdd5f('0x24')][_0x80900d['uniqueid']][_0xdd5f('0x33')]=_0x80900d[_0xdd5f('0x33')];this[_0xdd5f('0x24')][_0x80900d[_0xdd5f('0x23')]][_0xdd5f('0x34')]=_0x80900d[_0xdd5f('0x34')];this[_0xdd5f('0x24')][_0x80900d[_0xdd5f('0x23')]][_0xdd5f('0x2f')]=_0x80900d[_0xdd5f('0x2f')];this[_0xdd5f('0x24')][_0x80900d[_0xdd5f('0x23')]][_0xdd5f('0x35')]=_0x80900d['calleridnum'];if(this['channels'][_0x80900d[_0xdd5f('0x23')]][_0xdd5f('0x32')]>0x0){tiff2pdf(_0x80900d[_0xdd5f('0x2f')],_0xdd5f('0x36'),function(_0xfc5bb9){logger[_0xdd5f('0x27')](_0x80900d[_0xdd5f('0x23')],'\x20result\x20conversion\x20file\x20',_0xfc5bb9[_0xdd5f('0x37')]);attachment['create']({'name':path[_0xdd5f('0x38')](_0x80900d['filename'])[_0xdd5f('0x26')],'basename':path['parse'](_0x80900d[_0xdd5f('0x2f')])[_0xdd5f('0x26')]+_0xdd5f('0x39'),'type':'application/pdf'})['then'](function(_0x3ad2b1){faxAccount[_0xdd5f('0x3a')](_0x2cfcb9,{'from':_0x80900d['calleridnum'],'mapKey':_0xdd5f('0x6'),'body':path['parse'](_0x80900d[_0xdd5f('0x2f')])['name']+_0xdd5f('0x39'),'AttachmentId':_0x3ad2b1['id']})[_0xdd5f('0x3b')](function(_0x1b2c21){logger[_0xdd5f('0x3c')](_0x80900d[_0xdd5f('0x23')],_0xdd5f('0x3d'),JSON[_0xdd5f('0x3e')](_0x1b2c21));});})['catch'](function(_0x48a072){logger[_0xdd5f('0x3c')](_0x80900d[_0xdd5f('0x23')],_0xdd5f('0x3f'),JSON['stringify'](_0x48a072));});});}logger[_0xdd5f('0x27')](_0x80900d[_0xdd5f('0x23')],_0xdd5f('0x3f'));}};Fax[_0xdd5f('0x1d')][_0xdd5f('0x40')]=function(_0x2d549d){if(this[_0xdd5f('0x10')][_0x2d549d[_0xdd5f('0x23')]]){_[_0xdd5f('0x41')](this[_0xdd5f('0x24')][_0x2d549d[_0xdd5f('0x23')]],_[_0xdd5f('0x42')](_0x2d549d,[_0xdd5f('0x43'),'reason']));}};function updateStatus(_0x380b5f){if(_0x380b5f[_0xdd5f('0x44')]){faxMessage[_0xdd5f('0x45')](_0x380b5f[_0xdd5f('0x44')],{'failMessage':_0xdd5f('0x46')})[_0xdd5f('0x47')](function(_0x2647d7){ut[_0xdd5f('0x48')](_0xdd5f('0x49'),_0x2647d7);})[_0xdd5f('0x3b')](function(_0x5ccddd){ut['logger'](_0xdd5f('0x4a'),_0x5ccddd);});}else{ut['logger'](_0xdd5f('0x4b'));}}Fax[_0xdd5f('0x1d')]['updateStatus']=function(_0xd09e7e,_0x7185df,_0x42fa99){var _0x25ec09=this;var _0x55dc2f={};if(_0x7185df){_0x55dc2f={'read':_0x7185df};}else{_0x55dc2f={'failMessage':_0x42fa99};}if(this['actions'][_0xd09e7e][_0xdd5f('0x44')]){faxMessage[_0xdd5f('0x45')](this['actions'][_0xd09e7e][_0xdd5f('0x44')],_0x55dc2f)[_0xdd5f('0x47')](function(_0x4e519f){ut['logger']('[Fax][Message][Updated]',_0x4e519f);})[_0xdd5f('0x3b')](function(_0x1b4252){ut[_0xdd5f('0x48')](_0xdd5f('0x4c'),_0x1b4252);})[_0xdd5f('0x4d')](function(){delete _0x25ec09[_0xdd5f('0x24')][_0xd09e7e];delete _0x25ec09[_0xdd5f('0x10')][_0xd09e7e];});}else{ut[_0xdd5f('0x48')]('[Fax][Message][NoUpdate2]');delete this['channels'][_0xd09e7e];delete this[_0xdd5f('0x10')][_0xd09e7e];}};Fax[_0xdd5f('0x1d')]['syncHangup']=function(_0x3bb42e){var _0x54b7a8=this;if(this[_0xdd5f('0x24')][_0x3bb42e['uniqueid']]){if(this['actions'][_0x3bb42e[_0xdd5f('0x23')]]){this[_0xdd5f('0x24')][_0x3bb42e['uniqueid']]['id']=this[_0xdd5f('0x10')][_0x3bb42e[_0xdd5f('0x23')]]['id'];this[_0xdd5f('0x24')][_0x3bb42e['uniqueid']]['name']=this[_0xdd5f('0x10')][_0x3bb42e[_0xdd5f('0x23')]]['name'];}logger[_0xdd5f('0x27')](_0x3bb42e[_0xdd5f('0x23')],this[_0xdd5f('0x10')][_0x3bb42e[_0xdd5f('0x23')]]?_0xdd5f('0x4e'):_0xdd5f('0x4f'),JSON['stringify'](this[_0xdd5f('0x24')][_0x3bb42e[_0xdd5f('0x23')]]));if(this[_0xdd5f('0x10')][_0x3bb42e[_0xdd5f('0x23')]]){if(this['channels'][_0x3bb42e[_0xdd5f('0x23')]]['faxpages']>0x0&&this['channels'][_0x3bb42e[_0xdd5f('0x23')]][_0xdd5f('0x18')]===_0xdd5f('0x50')){this[_0xdd5f('0x51')](_0x3bb42e[_0xdd5f('0x23')],!![]);}else{this[_0xdd5f('0x51')](_0x3bb42e[_0xdd5f('0x23')],![],this['channels'][_0x3bb42e[_0xdd5f('0x23')]]['faxstatusstring']?_0xdd5f('0x52')+this[_0xdd5f('0x24')][_0x3bb42e[_0xdd5f('0x23')]][_0xdd5f('0x53')]:'SENDING\x20FAILED');}}}};Fax[_0xdd5f('0x1d')][_0xdd5f('0x54')]=function(_0x5eedb5){var _0x25a588=this;return new BPromise(function(_0x1077e5,_0x46ee1e){_0x25a588[_0xdd5f('0x55')](_0x5eedb5,_0x25a588[_0xdd5f('0xe')][_0x5eedb5['FaxAccountId']])[_0xdd5f('0x47')](function(_0x2b9cb6){ut[_0xdd5f('0x48')]('[Fax][execOriginate][success]',_0x2b9cb6);_0x1077e5(ut[_0xdd5f('0x37')]('Fax\x20received'));})[_0xdd5f('0x3b')](function(_0x321ac2){ut[_0xdd5f('0x48')](_0xdd5f('0x56'),_0x321ac2);updateStatus(_0x5eedb5);_0x46ee1e(ut[_0xdd5f('0x37')](_0xdd5f('0x57')));});});};Fax['prototype']['checkAfterSend']=function(_0x133cfb){var _0x2b9f73=this;return new BPromise(function(_0x233f23,_0x503a8d){var _0x28b305=_0x2b9f73[_0xdd5f('0x58')](_0x2b9f73['faxAccounts'][_0x133cfb[_0xdd5f('0x59')]][_0xdd5f('0x5a')],_0x133cfb);if(_0x28b305[_0xdd5f('0x5b')]){_0x233f23(ut[_0xdd5f('0x37')]('Trunk\x20Reachable'));}else{_0x503a8d(ut[_0xdd5f('0x37')](_0x28b305['message']));}});};function originate(_0x4b2797,_0x8229b1,_0x303402){return new BPromise(function(_0x43248a,_0x19b630){if(_0x303402){var _0x1c7b5b=util[_0xdd5f('0x5c')](_0xdd5f('0x5d'),path[_0xdd5f('0x38')](_0x4b2797[_0xdd5f('0x5e')])[_0xdd5f('0x26')],_0x4b2797[_0xdd5f('0x5e')]);gs[_0xdd5f('0x5f')](_0x1c7b5b)[_0xdd5f('0x47')](function(){_0x4b2797['path']=util[_0xdd5f('0x5c')](_0xdd5f('0x60'),path['parse'](_0x4b2797[_0xdd5f('0x5e')])[_0xdd5f('0x61')],path['parse'](_0x4b2797[_0xdd5f('0x5e')])[_0xdd5f('0x26')]);_0x8229b1['XMF-PATH']=_0x4b2797['path'];ut['logger'](_0xdd5f('0x62'),'');ami[_0xdd5f('0x63')](ut['variablesAction'](_0x4b2797,_0x8229b1))[_0xdd5f('0x47')](function(_0xb87bc6){_0x43248a(_0xb87bc6);})['catch'](function(_0xcdd612){_0x19b630(_0xcdd612);});})[_0xdd5f('0x3b')](function(_0x501f5d){_0x19b630(_0x501f5d);});}else{ami[_0xdd5f('0x63')](ut[_0xdd5f('0x64')](_0x4b2797,_0x8229b1))[_0xdd5f('0x47')](function(_0x2bcffc){_0x43248a(_0x2bcffc);})['catch'](function(_0x323584){_0x19b630(_0x323584);});}});}Fax['prototype']['execOriginate']=function(_0x191932,_0x1e12ed){var _0x551eda=this;return new BPromise(function(_0x5423f3,_0x314635){var _0x1400e0=uuid['v4']();var _0x249ea4=ut[_0xdd5f('0x65')](_0x191932,_0x1e12ed);_0x551eda['actions'][_0x1400e0]=new Action(_0x1400e0,_0x1e12ed,_0x191932);var _0x2dbd0c=_0x551eda[_0xdd5f('0x10')][_0x1400e0];if(path['parse'](_0x191932[_0xdd5f('0x5e')])[_0xdd5f('0x66')]==='.pdf'){originate(_0x2dbd0c,_0x249ea4,!![])[_0xdd5f('0x47')](function(_0x20e4da){_0x5423f3(_0x20e4da);})['catch'](function(_0x240f39){_0x314635(_0x240f39);});}else{originate(_0x2dbd0c,_0x249ea4,![])[_0xdd5f('0x47')](function(_0x1d8099){_0x5423f3(_0x1d8099);})[_0xdd5f('0x3b')](function(_0x1c0a1a){_0x314635(_0x1c0a1a);});}});};Fax[_0xdd5f('0x1d')]['isTrunkReachable']=function(_0x5c0e0f){return!_[_0xdd5f('0x67')](_0x5c0e0f)&&!_[_0xdd5f('0x67')](_0x5c0e0f[_0xdd5f('0x26')])&&!_[_0xdd5f('0x67')](_0x5c0e0f[_0xdd5f('0x68')])&&_0x5c0e0f['active']&&!_[_0xdd5f('0x67')](this[_0xdd5f('0xf')][util[_0xdd5f('0x5c')](_0xdd5f('0x69'),_0x5c0e0f['name'])])&&!_[_0xdd5f('0x67')](this[_0xdd5f('0xf')][util[_0xdd5f('0x5c')](_0xdd5f('0x69'),_0x5c0e0f[_0xdd5f('0x26')])]['status'])&&(this[_0xdd5f('0xf')][util[_0xdd5f('0x5c')](_0xdd5f('0x69'),_0x5c0e0f['name'])][_0xdd5f('0x6a')]===_0xdd5f('0x6b')||this[_0xdd5f('0xf')][util[_0xdd5f('0x5c')]('SIP/%s',_0x5c0e0f['name'])][_0xdd5f('0x6a')]===_0xdd5f('0x6c'));};Fax['prototype']['checkTrunk']=function(_0x54b17b,_0x2c5816){if(!this[_0xdd5f('0x6d')](_0x54b17b)){ut[_0xdd5f('0x48')](_0xdd5f('0x6e'),_[_0xdd5f('0x67')](_0x54b17b)?'':_0x54b17b[_0xdd5f('0x26')]+_0xdd5f('0x6f'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_[_0xdd5f('0x67')](_0x2c5816[_0xdd5f('0x6')])){ut[_0xdd5f('0x48')](_0xdd5f('0x70'),JSON[_0xdd5f('0x3e')](_0x2c5816));return{'isValid':![],'message':_0xdd5f('0x71')};}if(_[_0xdd5f('0x67')](_0x2c5816[_0xdd5f('0x5e')])){ut[_0xdd5f('0x48')](_0xdd5f('0x72'),JSON['stringify'](_0x2c5816));return{'isValid':![],'message':_0xdd5f('0x73')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0xdd5f('0x74')]=Fax; \ No newline at end of file +var _0x4387=['SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','FaxAccountId','Trunk','isValid','Trunk\x20Reachable','format','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','.pdf','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','util','lodash','bluebird','uuid','moment','path','tiff2pdf','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','syncFaxStatus','receivefax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','hasOwnProperty','channelstate','channelstatedesc','operation','status','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','filename','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','parse','notify','catch','stringify','error','\x20receiveFax\x20','merge','pick','reason','AttachmentId','update','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SUCCESS','updateStatus','SENDING\x20FAILED:\x20'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0x4387,0xa0));var _0x7438=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4387[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x7438('0x0'));var _=require(_0x7438('0x1'));var BPromise=require(_0x7438('0x2'));var uuid=require(_0x7438('0x3'));var moment=require(_0x7438('0x4'));var path=require(_0x7438('0x5'));var tiff2pdf=require(_0x7438('0x6'));var gs=require('./util/gs');var logger=require(_0x7438('0x7'))(_0x7438('0x8'));var ami=require(_0x7438('0x9'));var rpcDb=require(_0x7438('0xa'));var Channel=require(_0x7438('0xb'));var ut=require(_0x7438('0xc'));var Action=require('./action');var faxAccount=require(_0x7438('0xd'));var attachment=require(_0x7438('0xe'));var faxMessage=require(_0x7438('0xf'));function Fax(_0x3c9f00){this[_0x7438('0x10')]={};this[_0x7438('0x11')]=_0x3c9f00[_0x7438('0x11')];this['trunks']=_0x3c9f00[_0x7438('0x12')];this[_0x7438('0x13')]={};ami['on']('newchannel',this[_0x7438('0x14')][_0x7438('0x15')](this));ami['on'](_0x7438('0x16'),this[_0x7438('0x17')][_0x7438('0x15')](this));ami['on'](_0x7438('0x18'),this[_0x7438('0x19')][_0x7438('0x15')](this));ami['on'](_0x7438('0x1a'),this[_0x7438('0x1b')]['bind'](this));ami['on']('faxstatus',this[_0x7438('0x1c')][_0x7438('0x15')](this));ami['on'](_0x7438('0x1d'),this['syncReceiveFax'][_0x7438('0x15')](this));ami['on'](_0x7438('0x1e'),this[_0x7438('0x1f')]['bind'](this));ami['on'](_0x7438('0x20'),this[_0x7438('0x21')][_0x7438('0x15')](this));}Fax[_0x7438('0x22')][_0x7438('0x14')]=function(_0xe9fc3b){if(_0xe9fc3b[_0x7438('0x23')]===_0x7438('0x24')){for(var _0x193162 in this[_0x7438('0x11')]){if(this[_0x7438('0x11')]['hasOwnProperty'](_0x193162)){if(_0xe9fc3b[_0x7438('0x25')]===this[_0x7438('0x11')][_0x193162][_0x7438('0x26')]){this['channels'][_0xe9fc3b['uniqueid']]={};this['channels'][_0xe9fc3b[_0x7438('0x27')]][_0x7438('0x28')]=_0xe9fc3b[_0x7438('0x28')];this[_0x7438('0x10')][_0xe9fc3b['uniqueid']]['id']=this[_0x7438('0x11')][_0x193162]['id'];this[_0x7438('0x10')][_0xe9fc3b[_0x7438('0x27')]]['name']=this[_0x7438('0x11')][_0x193162][_0x7438('0x29')];logger['info'](_0xe9fc3b[_0x7438('0x27')],'\x20syncNewchannel\x20');}}}}if(this['actions'][_0xe9fc3b[_0x7438('0x27')]]){this['channels'][_0xe9fc3b[_0x7438('0x27')]]={};this[_0x7438('0x10')][_0xe9fc3b['uniqueid']][_0x7438('0x28')]=_0xe9fc3b[_0x7438('0x28')];logger[_0x7438('0x2a')](_0xe9fc3b['uniqueid'],_0x7438('0x2b'));}};Fax[_0x7438('0x22')][_0x7438('0x17')]=function(_0x3bb0f6){if(this['channels'][_0x3bb0f6['uniqueid']]){for(var _0x4fe924 in _0x3bb0f6[_0x7438('0x2c')]){if(_0x3bb0f6[_0x7438('0x2c')][_0x7438('0x2d')](_0x4fe924)){this['channels'][_0x3bb0f6[_0x7438('0x27')]][_0x4fe924]=_0x3bb0f6['value'];}}}};Fax[_0x7438('0x22')][_0x7438('0x19')]=function(_0x4b406f){if(this['channels'][_0x4b406f[_0x7438('0x27')]]){this[_0x7438('0x10')][_0x4b406f['uniqueid']][_0x7438('0x2e')]=_0x4b406f[_0x7438('0x2e')];this[_0x7438('0x10')][_0x4b406f[_0x7438('0x27')]]['channelstatedesc']=_0x4b406f[_0x7438('0x2f')];}};Fax[_0x7438('0x22')]['syncNewExten']=function(_0x5a9881){if(this[_0x7438('0x10')][_0x5a9881['uniqueid']]){for(var _0x581d78 in _0x5a9881['variable']){if(_0x5a9881[_0x7438('0x2c')][_0x7438('0x2d')](_0x581d78)){this[_0x7438('0x10')][_0x5a9881['uniqueid']][_0x581d78]=_0x5a9881['value'];}}}};Fax[_0x7438('0x22')][_0x7438('0x1c')]=function(_0x128d05){if(this[_0x7438('0x10')][_0x128d05['uniqueid']]){this['channels'][_0x128d05[_0x7438('0x27')]][_0x7438('0x30')]=_0x128d05[_0x7438('0x30')];this[_0x7438('0x10')][_0x128d05['uniqueid']][_0x7438('0x31')]=_0x128d05[_0x7438('0x31')];this[_0x7438('0x10')][_0x128d05[_0x7438('0x27')]][_0x7438('0x26')]=_0x128d05[_0x7438('0x26')];this[_0x7438('0x10')][_0x128d05[_0x7438('0x27')]]['filename']=_0x128d05['filename'];logger[_0x7438('0x2a')](_0x128d05[_0x7438('0x27')],_0x7438('0x32'));}};Fax[_0x7438('0x22')][_0x7438('0x33')]=function(_0x268646){var _0x335813=this;if(this[_0x7438('0x10')][_0x268646[_0x7438('0x27')]]){var _0x240537=this['channels'][_0x268646[_0x7438('0x27')]]['id'];this[_0x7438('0x10')][_0x268646[_0x7438('0x27')]][_0x7438('0x34')]=_0x268646[_0x7438('0x34')];this[_0x7438('0x10')][_0x268646[_0x7438('0x27')]][_0x7438('0x35')]=_0x268646[_0x7438('0x35')];this[_0x7438('0x10')][_0x268646[_0x7438('0x27')]][_0x7438('0x26')]=_0x268646[_0x7438('0x26')];this[_0x7438('0x10')][_0x268646[_0x7438('0x27')]][_0x7438('0x36')]=_0x268646['resolution'];this[_0x7438('0x10')][_0x268646[_0x7438('0x27')]][_0x7438('0x37')]=_0x268646[_0x7438('0x37')];this['channels'][_0x268646[_0x7438('0x27')]][_0x7438('0x38')]=_0x268646[_0x7438('0x38')];this[_0x7438('0x10')][_0x268646[_0x7438('0x27')]][_0x7438('0x39')]=_0x268646['calleridnum'];if(this['channels'][_0x268646['uniqueid']][_0x7438('0x35')]>0x0){tiff2pdf(_0x268646['filename'],_0x7438('0x3a'),function(_0x2d6afe){logger['info'](_0x268646[_0x7438('0x27')],_0x7438('0x3b'),_0x2d6afe[_0x7438('0x3c')]);attachment['create']({'name':path[_0x7438('0x3d')](_0x268646['filename'])[_0x7438('0x29')],'basename':path[_0x7438('0x3d')](_0x268646[_0x7438('0x38')])[_0x7438('0x29')]+'.pdf','type':'application/pdf'})['then'](function(_0x4d94b2){faxAccount[_0x7438('0x3e')](_0x240537,{'from':_0x268646[_0x7438('0x39')],'mapKey':_0x7438('0x8'),'body':path[_0x7438('0x3d')](_0x268646['filename'])[_0x7438('0x29')]+'.pdf','AttachmentId':_0x4d94b2['id']})[_0x7438('0x3f')](function(_0x2ef608){logger['error'](_0x268646[_0x7438('0x27')],'\x20notify\x20',JSON[_0x7438('0x40')](_0x2ef608));});})[_0x7438('0x3f')](function(_0x563ef0){logger[_0x7438('0x41')](_0x268646[_0x7438('0x27')],_0x7438('0x42'),JSON['stringify'](_0x563ef0));});});}logger[_0x7438('0x2a')](_0x268646[_0x7438('0x27')],_0x7438('0x42'));}};Fax['prototype'][_0x7438('0x21')]=function(_0x32b995){if(this['actions'][_0x32b995[_0x7438('0x27')]]){_[_0x7438('0x43')](this[_0x7438('0x10')][_0x32b995['uniqueid']],_[_0x7438('0x44')](_0x32b995,['response',_0x7438('0x45')]));}};function updateStatus(_0x4b82bc){if(_0x4b82bc[_0x7438('0x46')]){faxMessage[_0x7438('0x47')](_0x4b82bc[_0x7438('0x46')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x7438('0x48')](function(_0x193eb0){ut[_0x7438('0x49')](_0x7438('0x4a'),_0x193eb0);})[_0x7438('0x3f')](function(_0x127c0e){ut[_0x7438('0x49')](_0x7438('0x4b'),_0x127c0e);});}else{ut[_0x7438('0x49')](_0x7438('0x4c'));}}Fax[_0x7438('0x22')]['updateStatus']=function(_0x18000d,_0x328859,_0x52a95){var _0x1adef4=this;var _0xab99e={};if(_0x328859){_0xab99e={'read':_0x328859};}else{_0xab99e={'failMessage':_0x52a95};}if(this[_0x7438('0x13')][_0x18000d][_0x7438('0x46')]){faxMessage[_0x7438('0x47')](this['actions'][_0x18000d][_0x7438('0x46')],_0xab99e)['then'](function(_0xd9c97){ut[_0x7438('0x49')](_0x7438('0x4d'),_0xd9c97);})[_0x7438('0x3f')](function(_0x32e986){ut['logger'](_0x7438('0x4e'),_0x32e986);})['finally'](function(){delete _0x1adef4[_0x7438('0x10')][_0x18000d];delete _0x1adef4[_0x7438('0x13')][_0x18000d];});}else{ut[_0x7438('0x49')](_0x7438('0x4f'));delete this[_0x7438('0x10')][_0x18000d];delete this['actions'][_0x18000d];}};Fax['prototype'][_0x7438('0x1f')]=function(_0x2bc5c4){var _0x2076da=this;if(this[_0x7438('0x10')][_0x2bc5c4[_0x7438('0x27')]]){if(this[_0x7438('0x13')][_0x2bc5c4[_0x7438('0x27')]]){this[_0x7438('0x10')][_0x2bc5c4[_0x7438('0x27')]]['id']=this[_0x7438('0x13')][_0x2bc5c4[_0x7438('0x27')]]['id'];this[_0x7438('0x10')][_0x2bc5c4[_0x7438('0x27')]]['name']=this[_0x7438('0x13')][_0x2bc5c4['uniqueid']]['name'];}logger[_0x7438('0x2a')](_0x2bc5c4[_0x7438('0x27')],this['actions'][_0x2bc5c4[_0x7438('0x27')]]?'\x20hangup\x20sendFile\x20':_0x7438('0x50'),JSON[_0x7438('0x40')](this[_0x7438('0x10')][_0x2bc5c4[_0x7438('0x27')]]));if(this[_0x7438('0x13')][_0x2bc5c4[_0x7438('0x27')]]){if(this['channels'][_0x2bc5c4[_0x7438('0x27')]][_0x7438('0x51')]>0x0&&this[_0x7438('0x10')][_0x2bc5c4[_0x7438('0x27')]][_0x7438('0x52')]===_0x7438('0x53')){this['updateStatus'](_0x2bc5c4[_0x7438('0x27')],!![]);}else{this[_0x7438('0x54')](_0x2bc5c4[_0x7438('0x27')],![],this[_0x7438('0x10')][_0x2bc5c4[_0x7438('0x27')]]['faxstatusstring']?_0x7438('0x55')+this[_0x7438('0x10')][_0x2bc5c4[_0x7438('0x27')]]['faxstatusstring']:_0x7438('0x56'));}}}};Fax[_0x7438('0x22')][_0x7438('0x57')]=function(_0x390df2){var _0x37f26d=this;return new BPromise(function(_0x4304f6,_0xb2e32c){_0x37f26d[_0x7438('0x58')](_0x390df2,_0x37f26d[_0x7438('0x11')][_0x390df2['FaxAccountId']])[_0x7438('0x48')](function(_0x1acdc4){ut[_0x7438('0x49')](_0x7438('0x59'),_0x1acdc4);_0x4304f6(ut[_0x7438('0x3c')](_0x7438('0x5a')));})[_0x7438('0x3f')](function(_0x11d3aa){ut['logger'](_0x7438('0x5b'),_0x11d3aa);updateStatus(_0x390df2);_0xb2e32c(ut['message'](_0x7438('0x5c')));});});};Fax[_0x7438('0x22')][_0x7438('0x5d')]=function(_0x323793){var _0x474ed8=this;return new BPromise(function(_0x4d3f4e,_0x5726ac){var _0x5af8ef=_0x474ed8['checkTrunk'](_0x474ed8[_0x7438('0x11')][_0x323793[_0x7438('0x5e')]][_0x7438('0x5f')],_0x323793);if(_0x5af8ef[_0x7438('0x60')]){_0x4d3f4e(ut[_0x7438('0x3c')](_0x7438('0x61')));}else{_0x5726ac(ut[_0x7438('0x3c')](_0x5af8ef[_0x7438('0x3c')]));}});};function originate(_0xf50a58,_0x164a7e,_0x51e7d6){return new BPromise(function(_0x52a7ec,_0x464a79){if(_0x51e7d6){var _0x210bb8=util[_0x7438('0x62')]('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[_0x7438('0x3d')](_0xf50a58['path'])['name'],_0xf50a58[_0x7438('0x5')]);gs['execute'](_0x210bb8)[_0x7438('0x48')](function(){_0xf50a58[_0x7438('0x5')]=util['format'](_0x7438('0x63'),path['parse'](_0xf50a58['path'])[_0x7438('0x64')],path[_0x7438('0x3d')](_0xf50a58[_0x7438('0x5')])[_0x7438('0x29')]);_0x164a7e[_0x7438('0x65')]=_0xf50a58[_0x7438('0x5')];ut[_0x7438('0x49')](_0x7438('0x66'),'');ami[_0x7438('0x67')](ut[_0x7438('0x68')](_0xf50a58,_0x164a7e))[_0x7438('0x48')](function(_0x15eea1){_0x52a7ec(_0x15eea1);})[_0x7438('0x3f')](function(_0x5c0f36){_0x464a79(_0x5c0f36);});})[_0x7438('0x3f')](function(_0x5800b9){_0x464a79(_0x5800b9);});}else{ami[_0x7438('0x67')](ut[_0x7438('0x68')](_0xf50a58,_0x164a7e))[_0x7438('0x48')](function(_0x2e230a){_0x52a7ec(_0x2e230a);})[_0x7438('0x3f')](function(_0x2fed81){_0x464a79(_0x2fed81);});}});}Fax[_0x7438('0x22')]['execOriginate']=function(_0x52d68b,_0x503255){var _0x38258e=this;return new BPromise(function(_0x350615,_0x307a4e){var _0x3b6fc5=uuid['v4']();var _0x542fb4=ut[_0x7438('0x69')](_0x52d68b,_0x503255);_0x38258e[_0x7438('0x13')][_0x3b6fc5]=new Action(_0x3b6fc5,_0x503255,_0x52d68b);var _0x23689c=_0x38258e[_0x7438('0x13')][_0x3b6fc5];if(path['parse'](_0x52d68b[_0x7438('0x5')])[_0x7438('0x6a')]===_0x7438('0x6b')){originate(_0x23689c,_0x542fb4,!![])[_0x7438('0x48')](function(_0x230922){_0x350615(_0x230922);})['catch'](function(_0x32d870){_0x307a4e(_0x32d870);});}else{originate(_0x23689c,_0x542fb4,![])[_0x7438('0x48')](function(_0x22f26c){_0x350615(_0x22f26c);})[_0x7438('0x3f')](function(_0x1209d0){_0x307a4e(_0x1209d0);});}});};Fax['prototype'][_0x7438('0x6c')]=function(_0x4153af){return!_['isNil'](_0x4153af)&&!_['isNil'](_0x4153af['name'])&&!_[_0x7438('0x6d')](_0x4153af[_0x7438('0x6e')])&&_0x4153af[_0x7438('0x6e')]&&!_['isNil'](this[_0x7438('0x12')][util['format']('SIP/%s',_0x4153af['name'])])&&!_[_0x7438('0x6d')](this['trunks'][util[_0x7438('0x62')]('SIP/%s',_0x4153af[_0x7438('0x29')])][_0x7438('0x31')])&&(this[_0x7438('0x12')][util[_0x7438('0x62')](_0x7438('0x6f'),_0x4153af[_0x7438('0x29')])][_0x7438('0x31')]===_0x7438('0x70')||this[_0x7438('0x12')][util[_0x7438('0x62')]('SIP/%s',_0x4153af[_0x7438('0x29')])][_0x7438('0x31')]===_0x7438('0x71'));};Fax['prototype'][_0x7438('0x72')]=function(_0x40b03f,_0x512361){if(!this[_0x7438('0x6c')](_0x40b03f)){ut['logger'](_0x7438('0x73'),_[_0x7438('0x6d')](_0x40b03f)?'':_0x40b03f['name']+_0x7438('0x74'));return{'isValid':![],'message':_0x7438('0x75')};}if(_['isNil'](_0x512361[_0x7438('0x8')])){ut[_0x7438('0x49')](_0x7438('0x76'),JSON[_0x7438('0x40')](_0x512361));return{'isValid':![],'message':_0x7438('0x77')};}if(_[_0x7438('0x6d')](_0x512361[_0x7438('0x5')])){ut[_0x7438('0x49')](_0x7438('0x78'),JSON[_0x7438('0x40')](_0x512361));return{'isValid':![],'message':_0x7438('0x79')};}return{'isValid':!![],'message':_0x7438('0x7a')};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index ba290f5..94d7c86 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 _0x830a=['then','catch','util','bluebird','../../../config/logger','preview','error','notify','resolve'];(function(_0x3534dc,_0x3e4409){var _0x2f95db=function(_0x545443){while(--_0x545443){_0x3534dc['push'](_0x3534dc['shift']());}};_0x2f95db(++_0x3e4409);}(_0x830a,0x197));var _0xa830=function(_0x4344d9,_0x10e35c){_0x4344d9=_0x4344d9-0x0;var _0x55a9bf=_0x830a[_0x4344d9];return _0x55a9bf;};'use strict';var util=require(_0xa830('0x0'));var BPromise=require(_0xa830('0x1'));var logger=require(_0xa830('0x2'))(_0xa830('0x3'));var _=require('lodash');var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x11363f){return function(_0x154c6){logger[_0xa830('0x4')](_0x11363f,util['inspect'](_0x154c6,{'showHidden':![],'depth':null}));};}exports[_0xa830('0x5')]=function(_0x38bc12,_0x20951b){return BPromise[_0xa830('0x6')]()[_0xa830('0x7')](faxAccount[_0xa830('0x5')](_0x38bc12,_0x20951b))[_0xa830('0x8')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0x4775=['catch','[Notify]\x20','../../../config/logger','lodash','error','resolve','notify'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x4775,0x79));var _0x5477=function(_0x59b2a1,_0x1f631f){_0x59b2a1=_0x59b2a1-0x0;var _0x4908d1=_0x4775[_0x59b2a1];return _0x4908d1;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x5477('0x0'))('preview');var _=require(_0x5477('0x1'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x1d3805){return function(_0x2216c2){logger[_0x5477('0x2')](_0x1d3805,util['inspect'](_0x2216c2,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x345b67,_0x29d079){return BPromise[_0x5477('0x3')]()['then'](faxAccount[_0x5477('0x4')](_0x345b67,_0x29d079))[_0x5477('0x5')](loggerCatch(_0x5477('0x6')));}; \ 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 4ce41aa..44b3e85 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 _0x3157=['util','../../../../config/logger','fax','bluebird','child_process','info','Exec\x20gs','inspect'];(function(_0x5c89ef,_0x296c7e){var _0x517710=function(_0x4fd0e7){while(--_0x4fd0e7){_0x5c89ef['push'](_0x5c89ef['shift']());}};_0x517710(++_0x296c7e);}(_0x3157,0x180));var _0x7315=function(_0x12c9ec,_0x563fcf){_0x12c9ec=_0x12c9ec-0x0;var _0x37d15c=_0x3157[_0x12c9ec];return _0x37d15c;};'use strict';var util=require(_0x7315('0x0'));var logger=require(_0x7315('0x1'))(_0x7315('0x2'));var BPromise=require(_0x7315('0x3'));var exec=require(_0x7315('0x4'))['exec'];exports['execute']=function(_0xadf82){return new BPromise(function(_0x3261fd,_0x446581){exec(_0xadf82,function(_0x173b67,_0x361078,_0x1082fa){logger[_0x7315('0x5')](_0x7315('0x6'),_0x361078);if(_0x173b67){logger[_0x7315('0x5')]('Exec\x20gs','\x20Error\x20:',util[_0x7315('0x7')](_0x173b67,{'showHidden':![],'depth':null}),_0x361078,_0x1082fa);_0x446581(_0x173b67);}_0x3261fd(_0x361078);});});}; \ No newline at end of file +var _0xbc66=['bluebird','child_process','exec','execute','info','Exec\x20gs','util','fax'];(function(_0x4b48e5,_0xc3c425){var _0x210b17=function(_0x43ccc1){while(--_0x43ccc1){_0x4b48e5['push'](_0x4b48e5['shift']());}};_0x210b17(++_0xc3c425);}(_0xbc66,0x16e));var _0x6bc6=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xbc66[_0x3b380d];return _0x54502b;};'use strict';var util=require(_0x6bc6('0x0'));var logger=require('../../../../config/logger')(_0x6bc6('0x1'));var BPromise=require(_0x6bc6('0x2'));var exec=require(_0x6bc6('0x3'))[_0x6bc6('0x4')];exports[_0x6bc6('0x5')]=function(_0x5c97dc){return new BPromise(function(_0x45c53b,_0x31bfac){exec(_0x5c97dc,function(_0x578e81,_0x101756,_0x461f02){logger[_0x6bc6('0x6')](_0x6bc6('0x7'),_0x101756);if(_0x578e81){logger[_0x6bc6('0x6')](_0x6bc6('0x7'),'\x20Error\x20:',util['inspect'](_0x578e81,{'showHidden':![],'depth':null}),_0x101756,_0x461f02);_0x31bfac(_0x578e81);}_0x45c53b(_0x101756);});});}; \ 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 7a5f195..f20e376 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 _0x722c=['headerinfo','util','lodash','../../../../config/logger','message','logger','inspect','addVariables','ecm','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','path','uniqueid','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>'];(function(_0x2896a4,_0x3b5983){var _0x97ce65=function(_0x16d309){while(--_0x16d309){_0x2896a4['push'](_0x2896a4['shift']());}};_0x97ce65(++_0x3b5983);}(_0x722c,0xa2));var _0xc722=function(_0x38592a,_0x4d91e8){_0x38592a=_0x38592a-0x0;var _0x59ea55=_0x722c[_0x38592a];return _0x59ea55;};'use strict';var util=require(_0xc722('0x0'));var _=require(_0xc722('0x1'));var moment=require('moment');var logger=require(_0xc722('0x2'))('fax');exports[_0xc722('0x3')]=function(_0x386fa1){return{'message':_0x386fa1};};exports[_0xc722('0x4')]=function(_0x4bc098,_0xff2563){logger['info'](_0x4bc098,util[_0xc722('0x5')](_0xff2563,{'showHidden':![],'depth':null}));};exports[_0xc722('0x6')]=function(_0x30726c,_0x1234e7){var _0x89902a={'XMF-ECM':_0x1234e7[_0xc722('0x7')],'XMF-HEADERINFO':_0x1234e7['headerinfo'],'XMF-MINRATE':_0x1234e7[_0xc722('0x8')],'XMF-MAXRATE':_0x1234e7[_0xc722('0x9')],'XMF-MODEM':util[_0xc722('0xa')](_0xc722('0xb'),_0x1234e7[_0xc722('0xc')]),'XMF-GATEWAY':_0x1234e7[_0xc722('0xd')],'XMF-FAXDETECT':_0x1234e7[_0xc722('0xe')],'XMF-T38TIMEOUT':_0x1234e7[_0xc722('0xf')],'XMF-LOCALSTATIONID':_0x1234e7['localstationid'],'XMF-PATH':_0x30726c[_0xc722('0x10')]};return _0x89902a;};exports['variablesAction']=function(_0x5e2f2a,_0x176ab3){return{'actionid':_0x5e2f2a[_0xc722('0x11')],'action':'originate','channel':_0x5e2f2a[_0xc722('0x12')],'Exten':_0xc722('0x13'),'Context':_0xc722('0x14'),'Priority':'1','callerid':util[_0xc722('0xa')](_0xc722('0x15'),_0x5e2f2a[_0xc722('0x16')]?_0x5e2f2a[_0xc722('0x16')]:'',_0x5e2f2a['localstationid']),'variable':_0x176ab3,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x5e2f2a[_0xc722('0x11')]};}; \ No newline at end of file +var _0xadfd=['maxrate','format','\x22%s\x22','modem','gateway','faxdetect','path','originate','channel','from-sip','headerinfo','localstationid','util','lodash','moment','../../../../config/logger','fax','message','logger','info','inspect','addVariables','ecm','minrate'];(function(_0x9d1e6b,_0x3bdc22){var _0x2b3070=function(_0x4c4ced){while(--_0x4c4ced){_0x9d1e6b['push'](_0x9d1e6b['shift']());}};_0x2b3070(++_0x3bdc22);}(_0xadfd,0xfc));var _0xdadf=function(_0x491004,_0x2c1f29){_0x491004=_0x491004-0x0;var _0x55b7bb=_0xadfd[_0x491004];return _0x55b7bb;};'use strict';var util=require(_0xdadf('0x0'));var _=require(_0xdadf('0x1'));var moment=require(_0xdadf('0x2'));var logger=require(_0xdadf('0x3'))(_0xdadf('0x4'));exports[_0xdadf('0x5')]=function(_0x252c8c){return{'message':_0x252c8c};};exports[_0xdadf('0x6')]=function(_0x46a31f,_0xb72e80){logger[_0xdadf('0x7')](_0x46a31f,util[_0xdadf('0x8')](_0xb72e80,{'showHidden':![],'depth':null}));};exports[_0xdadf('0x9')]=function(_0x143318,_0x1bce61){var _0x18544d={'XMF-ECM':_0x1bce61[_0xdadf('0xa')],'XMF-HEADERINFO':_0x1bce61['headerinfo'],'XMF-MINRATE':_0x1bce61[_0xdadf('0xb')],'XMF-MAXRATE':_0x1bce61[_0xdadf('0xc')],'XMF-MODEM':util[_0xdadf('0xd')](_0xdadf('0xe'),_0x1bce61[_0xdadf('0xf')]),'XMF-GATEWAY':_0x1bce61[_0xdadf('0x10')],'XMF-FAXDETECT':_0x1bce61[_0xdadf('0x11')],'XMF-T38TIMEOUT':_0x1bce61['t38timeout'],'XMF-LOCALSTATIONID':_0x1bce61['localstationid'],'XMF-PATH':_0x143318[_0xdadf('0x12')]};return _0x18544d;};exports['variablesAction']=function(_0x1455da,_0x4d25b9){return{'actionid':_0x1455da['uniqueid'],'action':_0xdadf('0x13'),'channel':_0x1455da[_0xdadf('0x14')],'Exten':'xcally-motion-fax','Context':_0xdadf('0x15'),'Priority':'1','callerid':util[_0xdadf('0xd')]('\x22%s\x22\x20<%s>',_0x1455da['headerinfo']?_0x1455da[_0xdadf('0x16')]:'',_0x1455da[_0xdadf('0x17')]),'variable':_0x4d25b9,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1455da['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 9b1c110..9e3d789 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 _0xd4a8=['getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','listen','[index.js][main]','inspect','./server','./report','./acw','./dialer','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','../../config/logger','ami','hour','get','getAgents','then','getTelephones','initTelephones','getTrunks','initTrunks'];(function(_0x2a71d2,_0x35bcda){var _0x200112=function(_0x40735f){while(--_0x40735f){_0x2a71d2['push'](_0x2a71d2['shift']());}};_0x200112(++_0x35bcda);}(_0xd4a8,0xf7));var _0x8d4a=function(_0x358637,_0x293eb8){_0x358637=_0x358637-0x0;var _0x5715d5=_0xd4a8[_0x358637];return _0x5715d5;};'use strict';var util=require('util');var moment=require('moment');var server=require(_0x8d4a('0x0'));var Realtime=require('./realtime');var Report=require(_0x8d4a('0x1'));var Acw=require(_0x8d4a('0x2'));var Trigger=require('./trigger');var Dialer=require(_0x8d4a('0x3'));var Preview=require('./preview');var Fax=require(_0x8d4a('0x4'));var user=require('./rpc/user');var voiceQueue=require(_0x8d4a('0x5'));var voiceQueueReport=require(_0x8d4a('0x6'));var voiceCallReport=require(_0x8d4a('0x7'));var trunk=require(_0x8d4a('0x8'));var trigger=require(_0x8d4a('0x9'));var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require('./rpc/campaign');var voiceExtension=require(_0x8d4a('0xa'));var faxAccount=require(_0x8d4a('0xb'));var zendesk=require(_0x8d4a('0xc'));var salesforce=require(_0x8d4a('0xd'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x8d4a('0xe'));var zoho=require(_0x8d4a('0xf'));var vtiger=require(_0x8d4a('0x10'));var freshsales=require(_0x8d4a('0x11'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x8d4a('0x12'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x8d4a('0x13'))(_0x8d4a('0x14'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x8d4a('0x15'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x8d4a('0x16')](_0x8d4a('0x15'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise['resolve']()['then'](user[_0x8d4a('0x17')]())[_0x8d4a('0x18')](realtime['initAgents']())[_0x8d4a('0x18')](user[_0x8d4a('0x19')]())[_0x8d4a('0x18')](realtime[_0x8d4a('0x1a')]())[_0x8d4a('0x18')](trunk[_0x8d4a('0x1b')]())[_0x8d4a('0x18')](realtime[_0x8d4a('0x1c')]())[_0x8d4a('0x18')](voiceQueue[_0x8d4a('0x1d')]())['then'](realtime[_0x8d4a('0x1e')]())[_0x8d4a('0x18')](trigger[_0x8d4a('0x1f')]())[_0x8d4a('0x18')](realtime[_0x8d4a('0x20')]())['then'](template[_0x8d4a('0x21')]())[_0x8d4a('0x18')](realtime[_0x8d4a('0x22')]())[_0x8d4a('0x18')](zendesk['getZendeskAccounts']())[_0x8d4a('0x18')](realtime[_0x8d4a('0x23')]())[_0x8d4a('0x18')](salesforce[_0x8d4a('0x24')]())[_0x8d4a('0x18')](realtime[_0x8d4a('0x25')]())[_0x8d4a('0x18')](sugarcrm[_0x8d4a('0x26')]())[_0x8d4a('0x18')](realtime[_0x8d4a('0x27')]())[_0x8d4a('0x18')](freshdesk[_0x8d4a('0x28')]())['then'](realtime[_0x8d4a('0x29')]())[_0x8d4a('0x18')](desk[_0x8d4a('0x2a')]())[_0x8d4a('0x18')](realtime[_0x8d4a('0x2b')]())[_0x8d4a('0x18')](zoho[_0x8d4a('0x2c')]())[_0x8d4a('0x18')](realtime['initZohoAccounts']())[_0x8d4a('0x18')](vtiger[_0x8d4a('0x2d')]())[_0x8d4a('0x18')](realtime[_0x8d4a('0x2e')]())[_0x8d4a('0x18')](freshsales[_0x8d4a('0x2f')]())[_0x8d4a('0x18')](realtime[_0x8d4a('0x30')]())[_0x8d4a('0x18')](servicenow[_0x8d4a('0x31')]())[_0x8d4a('0x18')](realtime['initServicenowAccounts']())['then'](dynamics365['getDynamics365Accounts']())[_0x8d4a('0x18')](realtime['initDynamics365Accounts']())[_0x8d4a('0x18')](campaign[_0x8d4a('0x32')]())[_0x8d4a('0x18')](realtime[_0x8d4a('0x33')]())[_0x8d4a('0x18')](voiceExtension[_0x8d4a('0x34')]())['then'](realtime[_0x8d4a('0x35')]())[_0x8d4a('0x18')](faxAccount[_0x8d4a('0x36')]())['then'](realtime[_0x8d4a('0x37')]())['then'](function(){return realtime;});}function initParams(){return Promise[_0x8d4a('0x38')]()['then'](voiceQueueReport['getVoiceQueueReports']())['then'](realtime[_0x8d4a('0x39')]())[_0x8d4a('0x18')](cmHopperHistory[_0x8d4a('0x3a')]())[_0x8d4a('0x18')](realtime['initVoiceQueueHopperHistory']())[_0x8d4a('0x18')](cmHopperHistory[_0x8d4a('0x3b')]())['then'](realtime[_0x8d4a('0x3c')]())[_0x8d4a('0x18')](voiceCallReport[_0x8d4a('0x3d')]())[_0x8d4a('0x18')](realtime[_0x8d4a('0x3e')]())[_0x8d4a('0x3f')](function(_0x2983b2){logger[_0x8d4a('0x40')](_0x8d4a('0x41'),util['inspect'](_0x2983b2,{'showHidden':![],'depth':null}));});}function main(){return server[_0x8d4a('0x42')](realtime,preview,fax)[_0x8d4a('0x18')](function(){return initRealtime();})['then'](function(){return initParams();})[_0x8d4a('0x18')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x8d4a('0x3f')](function(_0x202bec){logger[_0x8d4a('0x40')](_0x8d4a('0x43'),util[_0x8d4a('0x44')](_0x202bec,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x031e=['getZohoAccounts','getVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initCampaigns','getVoiceExtensions','getFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','[index.js][initParams]','inspect','listen','error','util','moment','./server','./report','./trigger','./preview','./fax','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','../../config/logger','ami','get','hour','then','initAgents','getTrunks','getVoiceQueues','initVoiceQueues','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts'];(function(_0x43ad18,_0x21f334){var _0x3bdc6a=function(_0x16fbd5){while(--_0x16fbd5){_0x43ad18['push'](_0x43ad18['shift']());}};_0x3bdc6a(++_0x21f334);}(_0x031e,0x104));var _0xe031=function(_0x44b7d6,_0x4a3f3f){_0x44b7d6=_0x44b7d6-0x0;var _0x5346f0=_0x031e[_0x44b7d6];return _0x5346f0;};'use strict';var util=require(_0xe031('0x0'));var moment=require(_0xe031('0x1'));var server=require(_0xe031('0x2'));var Realtime=require('./realtime');var Report=require(_0xe031('0x3'));var Acw=require('./acw');var Trigger=require(_0xe031('0x4'));var Dialer=require('./dialer');var Preview=require(_0xe031('0x5'));var Fax=require(_0xe031('0x6'));var user=require('./rpc/user');var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0xe031('0x7'));var voiceCallReport=require(_0xe031('0x8'));var trunk=require(_0xe031('0x9'));var trigger=require(_0xe031('0xa'));var template=require(_0xe031('0xb'));var cmHopperHistory=require(_0xe031('0xc'));var campaign=require(_0xe031('0xd'));var voiceExtension=require(_0xe031('0xe'));var faxAccount=require('./rpc/faxAccount');var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0xe031('0xf'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0xe031('0x10'));var desk=require(_0xe031('0x11'));var zoho=require(_0xe031('0x12'));var vtiger=require(_0xe031('0x13'));var freshsales=require(_0xe031('0x14'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xe031('0x15'))(_0xe031('0x16'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xe031('0x17')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xe031('0x17')](_0xe031('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise['resolve']()[_0xe031('0x19')](user['getAgents']())[_0xe031('0x19')](realtime[_0xe031('0x1a')]())['then'](user['getTelephones']())[_0xe031('0x19')](realtime['initTelephones']())[_0xe031('0x19')](trunk[_0xe031('0x1b')]())[_0xe031('0x19')](realtime['initTrunks']())[_0xe031('0x19')](voiceQueue[_0xe031('0x1c')]())['then'](realtime[_0xe031('0x1d')]())[_0xe031('0x19')](trigger['getTriggers']())[_0xe031('0x19')](realtime[_0xe031('0x1e')]())[_0xe031('0x19')](template['getTemplates']())[_0xe031('0x19')](realtime[_0xe031('0x1f')]())[_0xe031('0x19')](zendesk[_0xe031('0x20')]())['then'](realtime[_0xe031('0x21')]())[_0xe031('0x19')](salesforce['getSalesforceAccounts']())['then'](realtime['initSalesforceAccounts']())[_0xe031('0x19')](sugarcrm[_0xe031('0x22')]())[_0xe031('0x19')](realtime[_0xe031('0x23')]())[_0xe031('0x19')](freshdesk[_0xe031('0x24')]())[_0xe031('0x19')](realtime[_0xe031('0x25')]())[_0xe031('0x19')](desk[_0xe031('0x26')]())[_0xe031('0x19')](realtime[_0xe031('0x27')]())['then'](zoho[_0xe031('0x28')]())['then'](realtime['initZohoAccounts']())['then'](vtiger[_0xe031('0x29')]())['then'](realtime['initVtigerAccounts']())[_0xe031('0x19')](freshsales['getFreshsalesAccounts']())[_0xe031('0x19')](realtime[_0xe031('0x2a')]())[_0xe031('0x19')](servicenow[_0xe031('0x2b')]())['then'](realtime['initServicenowAccounts']())['then'](dynamics365[_0xe031('0x2c')]())[_0xe031('0x19')](realtime['initDynamics365Accounts']())[_0xe031('0x19')](campaign['getCampaigns']())[_0xe031('0x19')](realtime[_0xe031('0x2d')]())[_0xe031('0x19')](voiceExtension[_0xe031('0x2e')]())[_0xe031('0x19')](realtime['initVoiceExtensions']())[_0xe031('0x19')](faxAccount[_0xe031('0x2f')]())['then'](realtime['initFaxAccounts']())['then'](function(){return realtime;});}function initParams(){return Promise[_0xe031('0x30')]()[_0xe031('0x19')](voiceQueueReport[_0xe031('0x31')]())[_0xe031('0x19')](realtime[_0xe031('0x32')]())[_0xe031('0x19')](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime[_0xe031('0x33')]())[_0xe031('0x19')](cmHopperHistory[_0xe031('0x34')]())['then'](realtime[_0xe031('0x35')]())[_0xe031('0x19')](voiceCallReport[_0xe031('0x36')]())[_0xe031('0x19')](realtime['initVoiceCallReports']())[_0xe031('0x37')](function(_0x499221){logger['error'](_0xe031('0x38'),util[_0xe031('0x39')](_0x499221,{'showHidden':![],'depth':null}));});}function main(){return server[_0xe031('0x3a')](realtime,preview,fax)[_0xe031('0x19')](function(){return initRealtime();})[_0xe031('0x19')](function(){return initParams();})[_0xe031('0x19')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0xe031('0x37')](function(_0x4432eb){logger[_0xe031('0x3b')]('[index.js][main]',util[_0xe031('0x39')](_0x4432eb,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 6951cdc..e868d71 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 _0x4639=['emit','user:save','user:presence','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','email','accountcode','fullname','unknown','stateTime','status','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','state','toLowerCase','not_inuse','idle','talking','statePause','format','name','stringify','user:%s'];(function(_0x23814d,_0x4e1c78){var _0xce5087=function(_0x9cf0ca){while(--_0x9cf0ca){_0x23814d['push'](_0x23814d['shift']());}};_0xce5087(++_0x4e1c78);}(_0x4639,0x115));var _0x9463=function(_0x119961,_0x38c0a1){_0x119961=_0x119961-0x0;var _0x147fe2=_0x4639[_0x119961];return _0x147fe2;};'use strict';var _=require(_0x9463('0x0'));var util=require('util');var moment=require('moment');var md5=require(_0x9463('0x1'));var Redis=require(_0x9463('0x2'));var config=require(_0x9463('0x3'));config[_0x9463('0x4')]=_[_0x9463('0x5')](config[_0x9463('0x4')],{'host':_0x9463('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9463('0x4')]));function Agent(_0x10d647){this['id']=_0x10d647['id']||0x0;this['name']=_0x10d647['name']||'';this[_0x9463('0x7')]=_0x10d647['email']||'';this['accountcode']=_0x10d647[_0x9463('0x8')]||'';this[_0x9463('0x9')]=_0x10d647[_0x9463('0x9')]||'';this['state']=_0x9463('0xa');this[_0x9463('0xb')]=0x0;this[_0x9463('0xc')]=_0x9463('0xa');this[_0x9463('0xd')]='';this[_0x9463('0xe')]='';this[_0x9463('0xf')]='';this[_0x9463('0x10')]='';this[_0x9463('0x11')]=_0x10d647[_0x9463('0x11')]||![];this[_0x9463('0x12')]=_0x9463('0xa');this[_0x9463('0x13')]=0x0;this[_0x9463('0x14')]='';this[_0x9463('0x15')]='';this[_0x9463('0x16')]=![];this[_0x9463('0x17')]=![];this[_0x9463('0x1')]='';}Agent[_0x9463('0x18')]['updateStatusRealtime']=function(_0xe8cd93){var _0x4a34a0;if(_0xe8cd93&&_0xe8cd93[_0x9463('0x19')]){_0x4a34a0=_0xe8cd93[_0x9463('0x19')][_0x9463('0x1a')]();switch(_0x4a34a0){case _0x9463('0x1b'):_0x4a34a0=_0x9463('0x1c');break;case'inuse':_0x4a34a0=_0x9463('0x1d');break;}}if(_0x4a34a0&&this[_0x9463('0x12')]!==_0x4a34a0||_0xe8cd93[_0x9463('0x1e')]){this['voiceStatusTime']=_['toNumber'](moment()[_0x9463('0x1f')]('x'));}if(_0x4a34a0){this[_0x9463('0x12')]=_0x4a34a0;}var _0x396277={'id':this['id'],'name':this[_0x9463('0x20')],'email':this[_0x9463('0x7')],'accountcode':this[_0x9463('0x8')],'fullname':this[_0x9463('0x9')],'state':this[_0x9463('0x19')],'stateTime':this[_0x9463('0xb')],'status':this[_0x9463('0xc')],'address':this[_0x9463('0xd')],'online':this['online'],'voiceStatus':this[_0x9463('0x12')],'voiceStatusTime':this[_0x9463('0x13')],'voiceStatusCallerIdNumber':this[_0x9463('0x14')],'voiceStatusQueue':this[_0x9463('0x15')],'interface':this['interface'],'onhold':this[_0x9463('0x16')]};var _0x44e03d=md5(JSON[_0x9463('0x21')](_0x396277));if(this[_0x9463('0x1')]!==_0x44e03d){this[_0x9463('0x1')]=_0x44e03d;io['to'](util[_0x9463('0x1f')](_0x9463('0x22'),_0x396277[_0x9463('0x20')]))[_0x9463('0x23')](_0x9463('0x24'),_0x396277);io[_0x9463('0x23')](_0x9463('0x25'),_0x396277);}};module[_0x9463('0x26')]=Agent; \ No newline at end of file +var _0x6614=['lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','state','not_inuse','talking','statePause','toNumber','format','stringify','emit','user:save','user:presence','exports'];(function(_0x23d8d2,_0x2d2cb8){var _0x8fa0b1=function(_0x4589f5){while(--_0x4589f5){_0x23d8d2['push'](_0x23d8d2['shift']());}};_0x8fa0b1(++_0x2d2cb8);}(_0x6614,0x1e0));var _0x4661=function(_0x2542d1,_0xdb7645){_0x2542d1=_0x2542d1-0x0;var _0xec2ce7=_0x6614[_0x2542d1];return _0xec2ce7;};'use strict';var _=require(_0x4661('0x0'));var util=require('util');var moment=require(_0x4661('0x1'));var md5=require(_0x4661('0x2'));var Redis=require(_0x4661('0x3'));var config=require(_0x4661('0x4'));config[_0x4661('0x5')]=_[_0x4661('0x6')](config[_0x4661('0x5')],{'host':_0x4661('0x7'),'port':0x18eb});var io=require(_0x4661('0x8'))(new Redis(config[_0x4661('0x5')]));function Agent(_0x3acc28){this['id']=_0x3acc28['id']||0x0;this[_0x4661('0x9')]=_0x3acc28['name']||'';this[_0x4661('0xa')]=_0x3acc28[_0x4661('0xa')]||'';this[_0x4661('0xb')]=_0x3acc28['accountcode']||'';this['fullname']=_0x3acc28[_0x4661('0xc')]||'';this['state']=_0x4661('0xd');this[_0x4661('0xe')]=0x0;this[_0x4661('0xf')]=_0x4661('0xd');this[_0x4661('0x10')]='';this[_0x4661('0x11')]='';this[_0x4661('0x12')]='';this[_0x4661('0x13')]='';this[_0x4661('0x14')]=_0x3acc28[_0x4661('0x14')]||![];this[_0x4661('0x15')]='unknown';this[_0x4661('0x16')]=0x0;this[_0x4661('0x17')]='';this[_0x4661('0x18')]='';this[_0x4661('0x19')]=![];this[_0x4661('0x1a')]=![];this[_0x4661('0x2')]='';}Agent[_0x4661('0x1b')][_0x4661('0x1c')]=function(_0x33215d){var _0x3166e3;if(_0x33215d&&_0x33215d[_0x4661('0x1d')]){_0x3166e3=_0x33215d['state']['toLowerCase']();switch(_0x3166e3){case _0x4661('0x1e'):_0x3166e3='idle';break;case'inuse':_0x3166e3=_0x4661('0x1f');break;}}if(_0x3166e3&&this['voiceStatus']!==_0x3166e3||_0x33215d[_0x4661('0x20')]){this['voiceStatusTime']=_[_0x4661('0x21')](moment()[_0x4661('0x22')]('x'));}if(_0x3166e3){this[_0x4661('0x15')]=_0x3166e3;}var _0x4c040b={'id':this['id'],'name':this['name'],'email':this[_0x4661('0xa')],'accountcode':this[_0x4661('0xb')],'fullname':this['fullname'],'state':this[_0x4661('0x1d')],'stateTime':this['stateTime'],'status':this[_0x4661('0xf')],'address':this[_0x4661('0x10')],'online':this[_0x4661('0x14')],'voiceStatus':this[_0x4661('0x15')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x4661('0x18')],'interface':this[_0x4661('0x13')],'onhold':this['onhold']};var _0x5b33b1=md5(JSON[_0x4661('0x23')](_0x4c040b));if(this[_0x4661('0x2')]!==_0x5b33b1){this['md5']=_0x5b33b1;io['to'](util[_0x4661('0x22')]('user:%s',_0x4c040b[_0x4661('0x9')]))[_0x4661('0x24')](_0x4661('0x25'),_0x4c040b);io[_0x4661('0x24')](_0x4661('0x26'),_0x4c040b);}};module[_0x4661('0x27')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 43f269d..c2792e1 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 _0xed4f=['dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','temp','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency'];(function(_0x4c472e,_0x476622){var _0x3fa05c=function(_0x2be5ba){while(--_0x2be5ba){_0x4c472e['push'](_0x4c472e['shift']());}};_0x3fa05c(++_0x476622);}(_0xed4f,0x1f1));var _0xfed4=function(_0x3598de,_0x4465e8){_0x3598de=_0x3598de-0x0;var _0x240426=_0xed4f[_0x3598de];return _0x240426;};'use strict';function Campaign(_0x5b4fc6){this['id']=_0x5b4fc6['id']||0x0;this['name']=_0x5b4fc6[_0xfed4('0x0')]||'';this[_0xfed4('0x1')]=_0x5b4fc6[_0xfed4('0x1')]||'campaign';this[_0xfed4('0x2')]=0x0;this[_0xfed4('0x3')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0xfed4('0x4')]=0x0;this[_0xfed4('0x5')]='';this[_0xfed4('0x6')]=!![];this['active']=_0x5b4fc6[_0xfed4('0x7')];this[_0xfed4('0x8')]=_0x5b4fc6[_0xfed4('0x8')];this[_0xfed4('0x9')]=_0x5b4fc6[_0xfed4('0x9')]||null;this[_0xfed4('0xa')]=_0x5b4fc6[_0xfed4('0xa')]?_0x5b4fc6[_0xfed4('0xa')]:null;this[_0xfed4('0xb')]=_0x5b4fc6[_0xfed4('0xb')];this[_0xfed4('0xc')]=_0x5b4fc6[_0xfed4('0xc')];this[_0xfed4('0xd')]=_0x5b4fc6['dialOriginateTimeout']||0x1e;this[_0xfed4('0xe')]=_0x5b4fc6[_0xfed4('0xe')];this[_0xfed4('0xf')]=_0x5b4fc6['dialCongestionRetryFrequency'];this['dialBusyMaxRetry']=_0x5b4fc6[_0xfed4('0x10')];this[_0xfed4('0x11')]=_0x5b4fc6[_0xfed4('0x11')];this['dialNoAnswerMaxRetry']=_0x5b4fc6[_0xfed4('0x12')];this[_0xfed4('0x13')]=_0x5b4fc6[_0xfed4('0x13')];this[_0xfed4('0x14')]=_0x5b4fc6[_0xfed4('0x14')];this[_0xfed4('0x15')]=_0x5b4fc6['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x5b4fc6[_0xfed4('0x16')]||0x96;this['dialDropMaxRetry']=_0x5b4fc6[_0xfed4('0x17')]||0x3;this[_0xfed4('0x18')]=_0x5b4fc6['dialDropRetryFrequency']||0x96;this[_0xfed4('0x19')]=_0x5b4fc6['dialAbandonedMaxRetry']||0x3;this[_0xfed4('0x1a')]=_0x5b4fc6[_0xfed4('0x1a')]||0x96;this[_0xfed4('0x1b')]=_0x5b4fc6[_0xfed4('0x1b')]||0x3;this[_0xfed4('0x1c')]=_0x5b4fc6['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x5b4fc6[_0xfed4('0x1d')]||0x3;this[_0xfed4('0x1e')]=_0x5b4fc6[_0xfed4('0x1e')]||0x96;this[_0xfed4('0x1f')]=_0x5b4fc6['dialOrderByScheduledAt']||_0xfed4('0x20');this[_0xfed4('0x21')]=_0x5b4fc6[_0xfed4('0x21')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x5b4fc6[_0xfed4('0x22')]||undefined;this['dialCutDigit']=_0x5b4fc6[_0xfed4('0x23')]||undefined;this[_0xfed4('0x24')]=_0x5b4fc6[_0xfed4('0x24')]?_0x5b4fc6[_0xfed4('0x24')]:undefined;this['Trunk']=_0x5b4fc6[_0xfed4('0x25')]?_0x5b4fc6[_0xfed4('0x25')]:undefined;this['Interval']=_0x5b4fc6[_0xfed4('0x26')]?_0x5b4fc6[_0xfed4('0x26')]:undefined;this[_0xfed4('0x27')]=_0x5b4fc6['SquareProject']?_0x5b4fc6['SquareProject']:undefined;this[_0xfed4('0x28')]=_0x5b4fc6['SquareProject']?_0x5b4fc6[_0xfed4('0x27')][_0xfed4('0x0')]:undefined;this[_0xfed4('0x29')]=_0x5b4fc6['dialAMDActive']||![];this[_0xfed4('0x2a')]=_0x5b4fc6[_0xfed4('0x2a')];this['dialAMDGreeting']=_0x5b4fc6[_0xfed4('0x2b')];this['dialAMDAfterGreetingSilence']=_0x5b4fc6[_0xfed4('0x2c')];this[_0xfed4('0x2d')]=_0x5b4fc6[_0xfed4('0x2d')];this['dialAMDMinWordLength']=_0x5b4fc6[_0xfed4('0x2e')];this[_0xfed4('0x2f')]=_0x5b4fc6['dialAMDBetweenWordsSilence'];this[_0xfed4('0x30')]=_0x5b4fc6[_0xfed4('0x30')];this['dialAMDSilenceThreshold']=_0x5b4fc6[_0xfed4('0x31')];this[_0xfed4('0x32')]=_0x5b4fc6['dialAMDMaximumWordLength'];}module[_0xfed4('0x33')]=Campaign; \ No newline at end of file +var _0x653a=['limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','TrunkBackup','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','active'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x653a,0x19f));var _0xa653=function(_0xa46b86,_0x5c1465){_0xa46b86=_0xa46b86-0x0;var _0x417360=_0x653a[_0xa46b86];return _0x417360;};'use strict';function Campaign(_0x619b26){this['id']=_0x619b26['id']||0x0;this[_0xa653('0x0')]=_0x619b26['name']||'';this[_0xa653('0x1')]=_0x619b26[_0xa653('0x1')]||_0xa653('0x2');this[_0xa653('0x3')]=0x0;this['temp']=0x0;this[_0xa653('0x4')]=0x0;this[_0xa653('0x5')]=0x0;this[_0xa653('0x6')]='';this['sendMessageOneNotActive']=!![];this[_0xa653('0x7')]=_0x619b26[_0xa653('0x7')];this[_0xa653('0x8')]=_0x619b26['limitCalls'];this[_0xa653('0x9')]=_0x619b26['dialTimezone']||null;this[_0xa653('0xa')]=_0x619b26['dialGlobalInterval']?_0x619b26[_0xa653('0xa')]:null;this[_0xa653('0xb')]=_0x619b26[_0xa653('0xb')];this[_0xa653('0xc')]=_0x619b26[_0xa653('0xc')];this['dialOriginateTimeout']=_0x619b26[_0xa653('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x619b26[_0xa653('0xe')];this[_0xa653('0xf')]=_0x619b26[_0xa653('0xf')];this[_0xa653('0x10')]=_0x619b26[_0xa653('0x10')];this[_0xa653('0x11')]=_0x619b26['dialBusyRetryFrequency'];this['dialNoAnswerMaxRetry']=_0x619b26[_0xa653('0x12')];this[_0xa653('0x13')]=_0x619b26[_0xa653('0x13')];this[_0xa653('0x14')]=_0x619b26[_0xa653('0x14')];this['dialNoSuchNumberMaxRetry']=_0x619b26[_0xa653('0x15')]||0x3;this[_0xa653('0x16')]=_0x619b26[_0xa653('0x16')]||0x96;this[_0xa653('0x17')]=_0x619b26['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x619b26['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x619b26['dialAbandonedMaxRetry']||0x3;this[_0xa653('0x18')]=_0x619b26[_0xa653('0x18')]||0x96;this[_0xa653('0x19')]=_0x619b26[_0xa653('0x19')]||0x3;this[_0xa653('0x1a')]=_0x619b26[_0xa653('0x1a')]||0x96;this[_0xa653('0x1b')]=_0x619b26['dialAgentRejectMaxRetry']||0x3;this[_0xa653('0x1c')]=_0x619b26[_0xa653('0x1c')]||0x96;this[_0xa653('0x1d')]=_0x619b26['dialOrderByScheduledAt']||_0xa653('0x1e');this[_0xa653('0x1f')]=_0x619b26['dialPrefix']||undefined;this[_0xa653('0x20')]=_0x619b26['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x619b26['dialCutDigit']||undefined;this[_0xa653('0x21')]=_0x619b26[_0xa653('0x21')]?_0x619b26[_0xa653('0x21')]:undefined;this['Trunk']=_0x619b26['Trunk']?_0x619b26['Trunk']:undefined;this[_0xa653('0x22')]=_0x619b26[_0xa653('0x22')]?_0x619b26[_0xa653('0x22')]:undefined;this['SquareProject']=_0x619b26['SquareProject']?_0x619b26['SquareProject']:undefined;this['dialQueueProject']=_0x619b26[_0xa653('0x23')]?_0x619b26[_0xa653('0x23')][_0xa653('0x0')]:undefined;this['dialAMDActive']=_0x619b26[_0xa653('0x24')]||![];this[_0xa653('0x25')]=_0x619b26[_0xa653('0x25')];this[_0xa653('0x26')]=_0x619b26[_0xa653('0x26')];this[_0xa653('0x27')]=_0x619b26[_0xa653('0x27')];this[_0xa653('0x28')]=_0x619b26[_0xa653('0x28')];this[_0xa653('0x29')]=_0x619b26[_0xa653('0x29')];this[_0xa653('0x2a')]=_0x619b26[_0xa653('0x2a')];this['dialAMDMaximumNumberOfWords']=_0x619b26[_0xa653('0x2b')];this[_0xa653('0x2c')]=_0x619b26[_0xa653('0x2c')];this['dialAMDMaximumWordLength']=_0x619b26[_0xa653('0x2d')];}module[_0xa653('0x2e')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 1718cb2..99ba558 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 _0x0598=['abandoned','lastapplication','lastdata','duration','holdtime','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferType','exports','starttime','destinationchannel','calleridnum','accountcode','context','uniqueid','linkedid','exten','answered','answertime','unmanaged'];(function(_0x49324f,_0x49093a){var _0x23630a=function(_0x27d1a2){while(--_0x27d1a2){_0x49324f['push'](_0x49324f['shift']());}};_0x23630a(++_0x49093a);}(_0x0598,0x19e));var _0x8059=function(_0x13918a,_0x1f76a7){_0x13918a=_0x13918a-0x0;var _0x36ff45=_0x0598[_0x13918a];return _0x36ff45;};'use strict';function Channel(){this[_0x8059('0x0')]=null;this['channel']='';this[_0x8059('0x1')]='';this[_0x8059('0x2')]=0x0;this['calleridname']='';this['connectedlinenum']=undefined;this['connectedlinename']=undefined;this[_0x8059('0x3')]=0x0;this[_0x8059('0x4')]='';this[_0x8059('0x5')]=0x0;this[_0x8059('0x6')]=0x0;this[_0x8059('0x7')]=0x0;this[_0x8059('0x8')]=![];this[_0x8059('0x9')]=null;this['endtime']=null;this[_0x8059('0xa')]=![];this[_0x8059('0xb')]=![];this[_0x8059('0xc')]='';this[_0x8059('0xd')]='';this[_0x8059('0xe')]=0x0;this['billableseconds']=0x0;this[_0x8059('0xf')]=0x0;this['type']=null;this[_0x8059('0x10')]=null;this[_0x8059('0x11')]=null;this[_0x8059('0x12')]=![];this[_0x8059('0x13')]=null;this[_0x8059('0x14')]=null;this[_0x8059('0x15')]=[];this[_0x8059('0x16')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x8059('0x17')]=undefined;this['mohtime']=0x0;}module[_0x8059('0x18')]=Channel; \ No newline at end of file +var _0x5bd4=['transfercalleridnum','transferType','mohtime','starttime','channel','calleridname','connectedlinename','accountcode','context','linkedid','answered','answertime','unmanaged','abandoned','billableseconds','holdtime','type','tag','monitor','monitorFilename','queue','monitors'];(function(_0x5e34a4,_0x2e63ed){var _0x8d41d7=function(_0x45c61b){while(--_0x45c61b){_0x5e34a4['push'](_0x5e34a4['shift']());}};_0x8d41d7(++_0x2e63ed);}(_0x5bd4,0x163));var _0x45bd=function(_0x7b9953,_0x1ad41e){_0x7b9953=_0x7b9953-0x0;var _0x3c0bac=_0x5bd4[_0x7b9953];return _0x3c0bac;};'use strict';function Channel(){this[_0x45bd('0x0')]=null;this[_0x45bd('0x1')]='';this['destinationchannel']='';this['calleridnum']=0x0;this[_0x45bd('0x2')]='';this['connectedlinenum']=undefined;this[_0x45bd('0x3')]=undefined;this[_0x45bd('0x4')]=0x0;this[_0x45bd('0x5')]='';this['uniqueid']=0x0;this[_0x45bd('0x6')]=0x0;this['exten']=0x0;this[_0x45bd('0x7')]=![];this[_0x45bd('0x8')]=null;this['endtime']=null;this[_0x45bd('0x9')]=![];this[_0x45bd('0xa')]=![];this['lastapplication']='';this['lastdata']='';this['duration']=0x0;this[_0x45bd('0xb')]=0x0;this[_0x45bd('0xc')]=0x0;this[_0x45bd('0xd')]=null;this[_0x45bd('0xe')]=null;this['disposition']=null;this[_0x45bd('0xf')]=![];this[_0x45bd('0x10')]=null;this[_0x45bd('0x11')]=null;this[_0x45bd('0x12')]=[];this[_0x45bd('0x13')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x45bd('0x14')]=undefined;this[_0x45bd('0x15')]=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 22fa2e8..3e9cda8 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 _0xeac2=['name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports'];(function(_0x17bcce,_0x39ec4a){var _0x47fccb=function(_0x4cd19b){while(--_0x4cd19b){_0x17bcce['push'](_0x17bcce['shift']());}};_0x47fccb(++_0x39ec4a);}(_0xeac2,0x1ba));var _0x2eac=function(_0x3ac5bc,_0x4922da){_0x3ac5bc=_0x3ac5bc-0x0;var _0x458c1f=_0xeac2[_0x3ac5bc];return _0x458c1f;};'use strict';function DeskAccount(_0x7a268d){this['id']=_0x7a268d['id']||0x0;this[_0x2eac('0x0')]=_0x7a268d['name']||'';this['username']=_0x7a268d[_0x2eac('0x1')]||'';this[_0x2eac('0x2')]=_0x7a268d[_0x2eac('0x2')]||'';this[_0x2eac('0x3')]=_0x7a268d[_0x2eac('0x3')]||'';this[_0x2eac('0x4')]=_0x7a268d['password']||'';this[_0x2eac('0x5')]=_0x7a268d[_0x2eac('0x5')]||'';this[_0x2eac('0x6')]=_0x7a268d[_0x2eac('0x6')]||'';this[_0x2eac('0x7')]=_0x7a268d[_0x2eac('0x7')]||'';this[_0x2eac('0x8')]=_0x7a268d[_0x2eac('0x8')]||'';this[_0x2eac('0x9')]=_0x7a268d[_0x2eac('0x9')]||'';this[_0x2eac('0xa')]=_0x7a268d[_0x2eac('0xa')]||'';this['Configurations']=_0x7a268d[_0x2eac('0xb')]||{};}module[_0x2eac('0xc')]=DeskAccount; \ No newline at end of file +var _0x9fbb=['token','tokenSecret','type','serverUrl','Configurations','name','username','authType','password','consumerKey','consumerSecret'];(function(_0x434783,_0xff395d){var _0x13efcf=function(_0x235dac){while(--_0x235dac){_0x434783['push'](_0x434783['shift']());}};_0x13efcf(++_0xff395d);}(_0x9fbb,0xc0));var _0xb9fb=function(_0x508fa0,_0x577ea8){_0x508fa0=_0x508fa0-0x0;var _0x1330a4=_0x9fbb[_0x508fa0];return _0x1330a4;};'use strict';function DeskAccount(_0x155931){this['id']=_0x155931['id']||0x0;this[_0xb9fb('0x0')]=_0x155931[_0xb9fb('0x0')]||'';this[_0xb9fb('0x1')]=_0x155931['username']||'';this['remoteUri']=_0x155931['remoteUri']||'';this[_0xb9fb('0x2')]=_0x155931[_0xb9fb('0x2')]||'';this[_0xb9fb('0x3')]=_0x155931[_0xb9fb('0x3')]||'';this[_0xb9fb('0x4')]=_0x155931[_0xb9fb('0x4')]||'';this[_0xb9fb('0x5')]=_0x155931[_0xb9fb('0x5')]||'';this[_0xb9fb('0x6')]=_0x155931['token']||'';this['tokenSecret']=_0x155931[_0xb9fb('0x7')]||'';this[_0xb9fb('0x8')]=_0x155931[_0xb9fb('0x8')]||'';this[_0xb9fb('0x9')]=_0x155931[_0xb9fb('0x9')]||'';this[_0xb9fb('0xa')]=_0x155931[_0xb9fb('0xa')]||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index c7b0191..6f85d63 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 _0xc439=['name','username','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider'];(function(_0x49dcef,_0x5e2310){var _0x2e551a=function(_0x201c3f){while(--_0x201c3f){_0x49dcef['push'](_0x49dcef['shift']());}};_0x2e551a(++_0x5e2310);}(_0xc439,0x19a));var _0x9c43=function(_0x512d75,_0xc5a759){_0x512d75=_0x512d75-0x0;var _0x1ea91d=_0xc439[_0x512d75];return _0x1ea91d;};'use strict';function Dynamics365Account(_0x596e09){this['id']=_0x596e09['id']||0x0;this['name']=_0x596e09[_0x9c43('0x0')]||'';this[_0x9c43('0x1')]=_0x596e09[_0x9c43('0x1')]||'';this['password']=_0x596e09['password']||'';this['remoteUri']=_0x596e09[_0x9c43('0x2')]||'';this[_0x9c43('0x3')]=_0x596e09[_0x9c43('0x3')]||'';this[_0x9c43('0x4')]=_0x596e09[_0x9c43('0x4')]||'';this[_0x9c43('0x5')]=_0x596e09['clientSecret']||{};this[_0x9c43('0x6')]=_0x596e09[_0x9c43('0x6')]||'';this[_0x9c43('0x7')]=_0x596e09[_0x9c43('0x7')]||![];this[_0x9c43('0x8')]=_0x596e09['Configurations']||{};this[_0x9c43('0x9')]=_0x596e09[_0x9c43('0x9')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0xbd41=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider'];(function(_0x38f82d,_0x435ec0){var _0x4961c7=function(_0x3762a9){while(--_0x3762a9){_0x38f82d['push'](_0x38f82d['shift']());}};_0x4961c7(++_0x435ec0);}(_0xbd41,0x154));var _0x1bd4=function(_0x113696,_0x1843cc){_0x113696=_0x113696-0x0;var _0x1fb234=_0xbd41[_0x113696];return _0x1fb234;};'use strict';function Dynamics365Account(_0x33f2cc){this['id']=_0x33f2cc['id']||0x0;this['name']=_0x33f2cc['name']||'';this[_0x1bd4('0x0')]=_0x33f2cc[_0x1bd4('0x0')]||'';this[_0x1bd4('0x1')]=_0x33f2cc['password']||'';this[_0x1bd4('0x2')]=_0x33f2cc[_0x1bd4('0x2')]||'';this[_0x1bd4('0x3')]=_0x33f2cc[_0x1bd4('0x3')]||'';this[_0x1bd4('0x4')]=_0x33f2cc[_0x1bd4('0x4')]||'';this[_0x1bd4('0x5')]=_0x33f2cc[_0x1bd4('0x5')]||{};this[_0x1bd4('0x6')]=_0x33f2cc[_0x1bd4('0x6')]||'';this[_0x1bd4('0x7')]=_0x33f2cc[_0x1bd4('0x7')]||![];this[_0x1bd4('0x8')]=_0x33f2cc['Configurations']||{};this['CloudProvider']=_0x33f2cc[_0x1bd4('0x9')]||{};}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 6fd423c..e15ac47 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 _0x83c8=['v17,v27,v29','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem'];(function(_0x39ee35,_0x4d320f){var _0xb0efcf=function(_0x274e7b){while(--_0x274e7b){_0x39ee35['push'](_0x39ee35['shift']());}};_0xb0efcf(++_0x4d320f);}(_0x83c8,0x88));var _0x883c=function(_0x5f0627,_0x72504a){_0x5f0627=_0x5f0627-0x0;var _0x490fe6=_0x83c8[_0x5f0627];return _0x490fe6;};'use strict';function FaxAccount(_0x543a84){this['id']=_0x543a84['id']||0x0;this['name']=_0x543a84[_0x883c('0x0')]||'';this[_0x883c('0x1')]=_0x543a84['description'];this[_0x883c('0x2')]=_0x543a84[_0x883c('0x2')];this[_0x883c('0x3')]=_0x543a84[_0x883c('0x3')];this[_0x883c('0x4')]=_0x543a84['localstationid'];this[_0x883c('0x5')]=_0x543a84['minrate']||0x960;this[_0x883c('0x6')]=_0x543a84['maxrate']||0x3840;this['modem']=_0x543a84[_0x883c('0x7')]||_0x883c('0x8');this['gateway']=_0x543a84['gateway']||'no';this['faxdetect']=_0x543a84['faxdetect']||'no';this[_0x883c('0x9')]=_0x543a84['t38timeout']||0x1388;this[_0x883c('0xa')]=_0x543a84[_0x883c('0xa')]||_0x883c('0xb');this[_0x883c('0xc')]=_0x543a84['Trunk']?_0x543a84[_0x883c('0xc')]:undefined;this[_0x883c('0xd')]=_0x543a84['ListId'];this[_0x883c('0xe')]=_0x543a84[_0x883c('0xe')];}module[_0x883c('0xf')]=FaxAccount; \ No newline at end of file +var _0x56ee=['ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description'];(function(_0x4e0be0,_0x3617b4){var _0x404049=function(_0x1c24cb){while(--_0x1c24cb){_0x4e0be0['push'](_0x4e0be0['shift']());}};_0x404049(++_0x3617b4);}(_0x56ee,0x1d2));var _0xe56e=function(_0x13ff53,_0x5e1424){_0x13ff53=_0x13ff53-0x0;var _0x290228=_0x56ee[_0x13ff53];return _0x290228;};'use strict';function FaxAccount(_0x2ca51a){this['id']=_0x2ca51a['id']||0x0;this[_0xe56e('0x0')]=_0x2ca51a[_0xe56e('0x0')]||'';this[_0xe56e('0x1')]=_0x2ca51a['description'];this[_0xe56e('0x2')]=_0x2ca51a[_0xe56e('0x2')];this['headerinfo']=_0x2ca51a[_0xe56e('0x3')];this[_0xe56e('0x4')]=_0x2ca51a[_0xe56e('0x4')];this[_0xe56e('0x5')]=_0x2ca51a[_0xe56e('0x5')]||0x960;this[_0xe56e('0x6')]=_0x2ca51a[_0xe56e('0x6')]||0x3840;this[_0xe56e('0x7')]=_0x2ca51a[_0xe56e('0x7')]||_0xe56e('0x8');this[_0xe56e('0x9')]=_0x2ca51a[_0xe56e('0x9')]||'no';this[_0xe56e('0xa')]=_0x2ca51a[_0xe56e('0xa')]||'no';this[_0xe56e('0xb')]=_0x2ca51a[_0xe56e('0xb')]||0x1388;this[_0xe56e('0xc')]=_0x2ca51a[_0xe56e('0xc')]||_0xe56e('0xd');this[_0xe56e('0xe')]=_0x2ca51a[_0xe56e('0xe')]?_0x2ca51a[_0xe56e('0xe')]:undefined;this[_0xe56e('0xf')]=_0x2ca51a[_0xe56e('0xf')];this[_0xe56e('0x10')]=_0x2ca51a[_0xe56e('0x10')];}module[_0xe56e('0x11')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 112b3be..aeaab4e 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 _0x8600=['name','username','apiKey','token','remoteUri','Configurations','exports'];(function(_0x144371,_0x5d31c3){var _0xd69fee=function(_0x53d0ec){while(--_0x53d0ec){_0x144371['push'](_0x144371['shift']());}};_0xd69fee(++_0x5d31c3);}(_0x8600,0x13b));var _0x0860=function(_0x1bd323,_0x1c16ab){_0x1bd323=_0x1bd323-0x0;var _0x13097b=_0x8600[_0x1bd323];return _0x13097b;};'use strict';function FreshdeskAccount(_0x5a0c73){this['id']=_0x5a0c73['id']||0x0;this[_0x0860('0x0')]=_0x5a0c73[_0x0860('0x0')]||'';this[_0x0860('0x1')]=_0x5a0c73[_0x0860('0x1')]||'';this[_0x0860('0x2')]=_0x5a0c73[_0x0860('0x3')]||'';this[_0x0860('0x4')]=_0x5a0c73[_0x0860('0x4')]||'';this['serverUrl']=_0x5a0c73['serverUrl']||'';this[_0x0860('0x5')]=_0x5a0c73[_0x0860('0x5')]||{};}module[_0x0860('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0xbe87=['exports','name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0xbe87,0x199));var _0x7be8=function(_0x496170,_0x33f7d8){_0x496170=_0x496170-0x0;var _0x3d6726=_0xbe87[_0x496170];return _0x3d6726;};'use strict';function FreshdeskAccount(_0x435abc){this['id']=_0x435abc['id']||0x0;this[_0x7be8('0x0')]=_0x435abc[_0x7be8('0x0')]||'';this['username']=_0x435abc[_0x7be8('0x1')]||'';this[_0x7be8('0x2')]=_0x435abc[_0x7be8('0x3')]||'';this[_0x7be8('0x4')]=_0x435abc[_0x7be8('0x4')]||'';this[_0x7be8('0x5')]=_0x435abc[_0x7be8('0x5')]||'';this['Configurations']=_0x435abc[_0x7be8('0x6')]||{};}module[_0x7be8('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index b29be14..8ae065c 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 _0x16d8=['serverUrl','Configurations','exports','name','username','apiKey','token','remoteUri'];(function(_0x6cefea,_0x5d0423){var _0x3076c1=function(_0x1fb511){while(--_0x1fb511){_0x6cefea['push'](_0x6cefea['shift']());}};_0x3076c1(++_0x5d0423);}(_0x16d8,0xa3));var _0x816d=function(_0x274921,_0x1bb5ce){_0x274921=_0x274921-0x0;var _0x1da3e3=_0x16d8[_0x274921];return _0x1da3e3;};'use strict';function FreshsalesAccount(_0x3dbdf3){this['id']=_0x3dbdf3['id']||0x0;this[_0x816d('0x0')]=_0x3dbdf3[_0x816d('0x0')]||'';this[_0x816d('0x1')]=_0x3dbdf3[_0x816d('0x1')]||'';this[_0x816d('0x2')]=_0x3dbdf3[_0x816d('0x3')]||'';this[_0x816d('0x4')]=_0x3dbdf3[_0x816d('0x4')]||'';this[_0x816d('0x5')]=_0x3dbdf3['serverUrl']||'';this[_0x816d('0x6')]=_0x3dbdf3['Configurations']||{};}module[_0x816d('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0xf776=['exports','name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x42cc4d,_0x31c710){var _0x532b6f=function(_0x2ffeaf){while(--_0x2ffeaf){_0x42cc4d['push'](_0x42cc4d['shift']());}};_0x532b6f(++_0x31c710);}(_0xf776,0x169));var _0x6f77=function(_0x33b58a,_0x4e895c){_0x33b58a=_0x33b58a-0x0;var _0xf5a8c4=_0xf776[_0x33b58a];return _0xf5a8c4;};'use strict';function FreshsalesAccount(_0x2992b4){this['id']=_0x2992b4['id']||0x0;this['name']=_0x2992b4[_0x6f77('0x0')]||'';this[_0x6f77('0x1')]=_0x2992b4['username']||'';this[_0x6f77('0x2')]=_0x2992b4[_0x6f77('0x3')]||'';this[_0x6f77('0x4')]=_0x2992b4[_0x6f77('0x4')]||'';this['serverUrl']=_0x2992b4[_0x6f77('0x5')]||'';this['Configurations']=_0x2992b4[_0x6f77('0x6')]||{};}module[_0x6f77('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 d5f9bae..a023834 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 _0x20bc=['assigned','voice','routealias','variables','exports','type','inbound','uniqueid','calleridnum','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','holdtime'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x20bc,0x109));var _0xc20b=function(_0x37de50,_0x27f82a){_0x37de50=_0x37de50-0x0;var _0x2c37dc=_0x20bc[_0x37de50];return _0x2c37dc;};'use strict';function QueueReport(){this[_0xc20b('0x0')]=_0xc20b('0x1');this[_0xc20b('0x2')]='';this[_0xc20b('0x3')]='';this['calleridname']='';this['queue']='';this[_0xc20b('0x4')]=null;this[_0xc20b('0x5')]=null;this['position']=0x1;this[_0xc20b('0x6')]=0x1;this[_0xc20b('0x7')]=![];this[_0xc20b('0x8')]=null;this[_0xc20b('0x9')]=![];this[_0xc20b('0xa')]=null;this[_0xc20b('0xb')]=![];this[_0xc20b('0xc')]=null;this[_0xc20b('0xd')]=0x1;this[_0xc20b('0xe')]='';this[_0xc20b('0xf')]='';this[_0xc20b('0x10')]='';this[_0xc20b('0x11')]='';this[_0xc20b('0x12')]='';this[_0xc20b('0x13')]='';this['priority']='';this[_0xc20b('0x14')]=0x0;this[_0xc20b('0x15')]=![];this['lastAssignedTo']='';this['motionChannel']=_0xc20b('0x16');this[_0xc20b('0x17')]=null;this['mohtime']=0x0;this[_0xc20b('0x18')]={};}module[_0xc20b('0x19')]=QueueReport; \ No newline at end of file +var _0xbd19=['queuecallerexit','queuecallerexitAt','originalposition','connectedlinenum','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','routealias','mohtime','variables','exports','type','inbound','calleridnum','queue','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x53bb62,_0x422d3f){var _0x41706c=function(_0x24c280){while(--_0x24c280){_0x53bb62['push'](_0x53bb62['shift']());}};_0x41706c(++_0x422d3f);}(_0xbd19,0x10d));var _0x9bd1=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0xbd19[_0x5a3cf0];return _0x5a64ee;};'use strict';function QueueReport(){this[_0x9bd1('0x0')]=_0x9bd1('0x1');this['uniqueid']='';this[_0x9bd1('0x2')]='';this['calleridname']='';this[_0x9bd1('0x3')]='';this[_0x9bd1('0x4')]=null;this[_0x9bd1('0x5')]=null;this['position']=0x1;this[_0x9bd1('0x6')]=0x1;this[_0x9bd1('0x7')]=![];this[_0x9bd1('0x8')]=null;this[_0x9bd1('0x9')]=![];this[_0x9bd1('0xa')]=null;this[_0x9bd1('0xb')]=![];this[_0x9bd1('0xc')]=null;this[_0x9bd1('0xd')]=0x1;this['channel']='';this[_0x9bd1('0xe')]='';this['connectedlinename']='';this[_0x9bd1('0xf')]='';this[_0x9bd1('0x10')]='';this[_0x9bd1('0x11')]='';this[_0x9bd1('0x12')]='';this[_0x9bd1('0x13')]=0x0;this[_0x9bd1('0x14')]=![];this[_0x9bd1('0x15')]='';this[_0x9bd1('0x16')]=_0x9bd1('0x17');this[_0x9bd1('0x18')]=null;this[_0x9bd1('0x19')]=0x0;this[_0x9bd1('0x1a')]={};}module[_0x9bd1('0x1b')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 8d23c6d..d113bd3 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 _0xc8f2=['serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab'];(function(_0x43cfd6,_0x1de38f){var _0x43f4c2=function(_0x9dbc9f){while(--_0x9dbc9f){_0x43cfd6['push'](_0x43cfd6['shift']());}};_0x43f4c2(++_0x1de38f);}(_0xc8f2,0xc3));var _0x2c8f=function(_0x1ac570,_0x503bda){_0x1ac570=_0x1ac570-0x0;var _0x24bbb1=_0xc8f2[_0x1ac570];return _0x24bbb1;};'use strict';function SalesforceAccount(_0x13e7d9){this['id']=_0x13e7d9['id']||0x0;this[_0x2c8f('0x0')]=_0x13e7d9[_0x2c8f('0x0')]||'';this['username']=_0x13e7d9[_0x2c8f('0x1')]||'';this[_0x2c8f('0x2')]=_0x13e7d9['remoteUri']||'';this[_0x2c8f('0x3')]=_0x13e7d9['password']||'';this[_0x2c8f('0x4')]=_0x13e7d9[_0x2c8f('0x4')]||'';this[_0x2c8f('0x5')]=_0x13e7d9[_0x2c8f('0x5')]||'';this[_0x2c8f('0x6')]=_0x13e7d9['securityToken']||'';this[_0x2c8f('0x7')]=_0x13e7d9[_0x2c8f('0x7')]||_0x2c8f('0x8');this[_0x2c8f('0x9')]=_0x13e7d9[_0x2c8f('0x9')]||'';this['Configurations']=_0x13e7d9[_0x2c8f('0xa')]||{};}module[_0x2c8f('0xb')]=SalesforceAccount; \ No newline at end of file +var _0xeaec=['securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xeaec,0xde));var _0xceae=function(_0x5615d6,_0x57e6ee){_0x5615d6=_0x5615d6-0x0;var _0x201446=_0xeaec[_0x5615d6];return _0x201446;};'use strict';function SalesforceAccount(_0x386cc3){this['id']=_0x386cc3['id']||0x0;this[_0xceae('0x0')]=_0x386cc3[_0xceae('0x0')]||'';this[_0xceae('0x1')]=_0x386cc3[_0xceae('0x1')]||'';this[_0xceae('0x2')]=_0x386cc3[_0xceae('0x2')]||'';this[_0xceae('0x3')]=_0x386cc3[_0xceae('0x3')]||'';this['clientId']=_0x386cc3[_0xceae('0x4')]||'';this[_0xceae('0x5')]=_0x386cc3[_0xceae('0x5')]||'';this[_0xceae('0x6')]=_0x386cc3[_0xceae('0x6')]||'';this[_0xceae('0x7')]=_0x386cc3['type']||_0xceae('0x8');this[_0xceae('0x9')]=_0x386cc3['serverUrl']||'';this[_0xceae('0xa')]=_0x386cc3[_0xceae('0xa')]||{};}module[_0xceae('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 3787a2a..e0d7b1e 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 _0x8d44=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x47dcf6,_0x2bd422){var _0x2dfdc5=function(_0x5d0eb8){while(--_0x5d0eb8){_0x47dcf6['push'](_0x47dcf6['shift']());}};_0x2dfdc5(++_0x2bd422);}(_0x8d44,0xaa));var _0x48d4=function(_0xf0a925,_0x3bed3c){_0xf0a925=_0xf0a925-0x0;var _0x106799=_0x8d44[_0xf0a925];return _0x106799;};'use strict';function ServicenowAccount(_0x4deda0){this['id']=_0x4deda0['id']||0x0;this[_0x48d4('0x0')]=_0x4deda0[_0x48d4('0x0')]||'';this[_0x48d4('0x1')]=_0x4deda0['username']||'';this[_0x48d4('0x2')]=_0x4deda0['password']||'';this[_0x48d4('0x3')]=_0x4deda0[_0x48d4('0x3')]||'';this['serverUrl']=_0x4deda0[_0x48d4('0x4')]||'';this['Configurations']=_0x4deda0[_0x48d4('0x5')]||{};}module[_0x48d4('0x6')]=ServicenowAccount; \ No newline at end of file +var _0xb524=['serverUrl','Configurations','name','username','password','remoteUri'];(function(_0xb9c45b,_0x30c7b0){var _0x3e16b4=function(_0x40c6be){while(--_0x40c6be){_0xb9c45b['push'](_0xb9c45b['shift']());}};_0x3e16b4(++_0x30c7b0);}(_0xb524,0x80));var _0x4b52=function(_0x6366e1,_0x17ed98){_0x6366e1=_0x6366e1-0x0;var _0x39373d=_0xb524[_0x6366e1];return _0x39373d;};'use strict';function ServicenowAccount(_0x5aad20){this['id']=_0x5aad20['id']||0x0;this['name']=_0x5aad20[_0x4b52('0x0')]||'';this[_0x4b52('0x1')]=_0x5aad20[_0x4b52('0x1')]||'';this[_0x4b52('0x2')]=_0x5aad20[_0x4b52('0x2')]||'';this[_0x4b52('0x3')]=_0x5aad20['remoteUri']||'';this[_0x4b52('0x4')]=_0x5aad20[_0x4b52('0x4')]||'';this[_0x4b52('0x5')]=_0x5aad20[_0x4b52('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 9065b20..fbdca9b 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 _0x8bc2=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0xc0cbf,_0x22f493){var _0x24a0ac=function(_0x33e3c9){while(--_0x33e3c9){_0xc0cbf['push'](_0xc0cbf['shift']());}};_0x24a0ac(++_0x22f493);}(_0x8bc2,0x7a));var _0x28bc=function(_0x1a2c13,_0x1b1ab8){_0x1a2c13=_0x1a2c13-0x0;var _0x177aa1=_0x8bc2[_0x1a2c13];return _0x177aa1;};'use strict';function SugarcrmAccount(_0x4a8e7b){this['id']=_0x4a8e7b['id']||0x0;this[_0x28bc('0x0')]=_0x4a8e7b[_0x28bc('0x0')]||'';this[_0x28bc('0x1')]=_0x4a8e7b[_0x28bc('0x1')]||'';this[_0x28bc('0x2')]=_0x4a8e7b[_0x28bc('0x2')]||'';this[_0x28bc('0x3')]=_0x4a8e7b['remoteUri']||'';this['serverUrl']=_0x4a8e7b[_0x28bc('0x4')]||'';this[_0x28bc('0x5')]=_0x4a8e7b[_0x28bc('0x5')]||{};}module[_0x28bc('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0xaeb7=['username','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x314f8,_0x58f8b3){var _0x7a4b93=function(_0x298fcf){while(--_0x298fcf){_0x314f8['push'](_0x314f8['shift']());}};_0x7a4b93(++_0x58f8b3);}(_0xaeb7,0xad));var _0x7aeb=function(_0x2cf395,_0x13db8c){_0x2cf395=_0x2cf395-0x0;var _0x257a73=_0xaeb7[_0x2cf395];return _0x257a73;};'use strict';function SugarcrmAccount(_0x584279){this['id']=_0x584279['id']||0x0;this[_0x7aeb('0x0')]=_0x584279[_0x7aeb('0x0')]||'';this[_0x7aeb('0x1')]=_0x584279[_0x7aeb('0x1')]||'';this['password']=_0x584279['password']||'';this[_0x7aeb('0x2')]=_0x584279[_0x7aeb('0x2')]||'';this[_0x7aeb('0x3')]=_0x584279[_0x7aeb('0x3')]||'';this[_0x7aeb('0x4')]=_0x584279['Configurations']||{};}module[_0x7aeb('0x5')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 921d6c4..451de8e 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 _0xe7a0=['stateTime','address','exports','name','accountcode','state','unknown'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe7a0,0x10d));var _0x0e7a=function(_0x31ad21,_0x1375d8){_0x31ad21=_0x31ad21-0x0;var _0x1a7bb5=_0xe7a0[_0x31ad21];return _0x1a7bb5;};'use strict';function Telephone(_0x75968b){this['id']=_0x75968b['id']||0x0;this[_0x0e7a('0x0')]=_0x75968b[_0x0e7a('0x0')]||'';this[_0x0e7a('0x1')]=_0x75968b[_0x0e7a('0x1')]||'';this[_0x0e7a('0x2')]=_0x0e7a('0x3');this[_0x0e7a('0x4')]=0x0;this['status']=_0x0e7a('0x3');this[_0x0e7a('0x5')]='';}module[_0x0e7a('0x6')]=Telephone; \ No newline at end of file +var _0x3bbd=['accountcode','state','unknown','address','name'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x3bbd,0x1b2));var _0xd3bb=function(_0x330062,_0x48b95e){_0x330062=_0x330062-0x0;var _0x3fc2f3=_0x3bbd[_0x330062];return _0x3fc2f3;};'use strict';function Telephone(_0x16497d){this['id']=_0x16497d['id']||0x0;this[_0xd3bb('0x0')]=_0x16497d[_0xd3bb('0x0')]||'';this[_0xd3bb('0x1')]=_0x16497d[_0xd3bb('0x1')]||'';this[_0xd3bb('0x2')]=_0xd3bb('0x3');this['stateTime']=0x0;this['status']='unknown';this[_0xd3bb('0x4')]='';}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 7dcd850..ff66050 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','html'];(function(_0x10a6cd,_0x32e41d){var _0x4b4389=function(_0x4a58a1){while(--_0x4a58a1){_0x10a6cd['push'](_0x10a6cd['shift']());}};_0x4b4389(++_0x32e41d);}(_0xb10b,0x12a));var _0xbb10=function(_0x8c6eee,_0x21f601){_0x8c6eee=_0x8c6eee-0x0;var _0x5a03b5=_0xb10b[_0x8c6eee];return _0x5a03b5;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0x3f8753,_0x263ad9){var _0x2589ea=function(_0xc5663f){while(--_0xc5663f){_0x3f8753['push'](_0x3f8753['shift']());}};_0x2589ea(++_0x263ad9);}(_0xb10b,0x12a));var _0xbb10=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0xb10b[_0x2fc012];return _0x2891f9;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 5ebeb35..da42cec 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 _0x14a0=['voice','status','AnyConditions','Actions','name','channel'];(function(_0x2911e2,_0x3052f5){var _0xb47db0=function(_0x1dec4f){while(--_0x1dec4f){_0x2911e2['push'](_0x2911e2['shift']());}};_0xb47db0(++_0x3052f5);}(_0x14a0,0x8e));var _0x014a=function(_0x2df450,_0x391282){_0x2df450=_0x2df450-0x0;var _0x4521c6=_0x14a0[_0x2df450];return _0x4521c6;};'use strict';function Trigger(_0x1ee939){this['id']=_0x1ee939['id']||0x0;this[_0x014a('0x0')]=_0x1ee939[_0x014a('0x0')]||'';this[_0x014a('0x1')]=_0x1ee939[_0x014a('0x1')]||_0x014a('0x2');this[_0x014a('0x3')]=_0x1ee939[_0x014a('0x3')]||![];this['AllConditions']=_0x1ee939['AllConditions']||[];this[_0x014a('0x4')]=_0x1ee939[_0x014a('0x4')]||[];this[_0x014a('0x5')]=_0x1ee939['Actions']||[];}module['exports']=Trigger; \ No newline at end of file +var _0x5eb8=['Actions','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x2c7dc6,_0x3c4ce0){var _0x10002b=function(_0x26f390){while(--_0x26f390){_0x2c7dc6['push'](_0x2c7dc6['shift']());}};_0x10002b(++_0x3c4ce0);}(_0x5eb8,0xb0));var _0x85eb=function(_0x3c5ad6,_0x47b7bf){_0x3c5ad6=_0x3c5ad6-0x0;var _0x3154f2=_0x5eb8[_0x3c5ad6];return _0x3154f2;};'use strict';function Trigger(_0x5ea4df){this['id']=_0x5ea4df['id']||0x0;this['name']=_0x5ea4df[_0x85eb('0x0')]||'';this[_0x85eb('0x1')]=_0x5ea4df[_0x85eb('0x1')]||_0x85eb('0x2');this[_0x85eb('0x3')]=_0x5ea4df[_0x85eb('0x3')]||![];this[_0x85eb('0x4')]=_0x5ea4df[_0x85eb('0x4')]||[];this[_0x85eb('0x5')]=_0x5ea4df[_0x85eb('0x5')]||[];this[_0x85eb('0x6')]=_0x5ea4df[_0x85eb('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index f9d0327..d50d853 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 _0x9721=['active','name','state','unknown','status','registry','indexOf','split','domainport','refresh','registrationtime','defaultuser','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9721,0x8f));var _0x1972=function(_0x10ab3f,_0x56f147){_0x10ab3f=_0x10ab3f-0x0;var _0x23bd0d=_0x9721[_0x10ab3f];return _0x23bd0d;};'use strict';function Trunk(_0x568912){this['id']=_0x568912['id']||0x0;this['active']=_0x568912[_0x1972('0x0')]||![];this[_0x1972('0x1')]=_0x568912[_0x1972('0x1')]||'';this[_0x1972('0x2')]=_0x1972('0x3');this['stateTime']=0x0;this[_0x1972('0x4')]=_0x1972('0x3');this[_0x1972('0x5')]=_0x568912[_0x1972('0x5')]&&_0x568912[_0x1972('0x5')][_0x1972('0x6')](':')?_0x568912[_0x1972('0x5')][_0x1972('0x7')](':')[0x0]:'';this['host']='';this['port']='';this['domain']='';this[_0x1972('0x8')]='';this[_0x1972('0x9')]='';this['stateRegistry']=_0x1972('0x3');this[_0x1972('0xa')]='';this['address']='';this['defaultuser']=_0x568912[_0x1972('0xb')]||'';}module[_0x1972('0xc')]=Trunk; \ No newline at end of file +var _0x85ac=['status','registry','indexOf','split','host','port','domain','refresh','stateRegistry','defaultuser','active','name','state','unknown','stateTime'];(function(_0x133021,_0x5e4b23){var _0x1790b4=function(_0x5a6877){while(--_0x5a6877){_0x133021['push'](_0x133021['shift']());}};_0x1790b4(++_0x5e4b23);}(_0x85ac,0x1ae));var _0xc85a=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x85ac[_0xa1e3e3];return _0xc980e9;};'use strict';function Trunk(_0x184572){this['id']=_0x184572['id']||0x0;this['active']=_0x184572[_0xc85a('0x0')]||![];this[_0xc85a('0x1')]=_0x184572[_0xc85a('0x1')]||'';this[_0xc85a('0x2')]=_0xc85a('0x3');this[_0xc85a('0x4')]=0x0;this[_0xc85a('0x5')]=_0xc85a('0x3');this[_0xc85a('0x6')]=_0x184572[_0xc85a('0x6')]&&_0x184572[_0xc85a('0x6')][_0xc85a('0x7')](':')?_0x184572['registry'][_0xc85a('0x8')](':')[0x0]:'';this[_0xc85a('0x9')]='';this[_0xc85a('0xa')]='';this[_0xc85a('0xb')]='';this['domainport']='';this[_0xc85a('0xc')]='';this[_0xc85a('0xd')]='unknown';this['registrationtime']='';this['address']='';this[_0xc85a('0xe')]=_0x184572[_0xc85a('0xe')]||'';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 24ea36b..d73886d 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 _0x6a51=['recordingFormat','none','mandatoryDisposition','exten'];(function(_0x37bce0,_0x230787){var _0x2bc428=function(_0x3ed038){while(--_0x3ed038){_0x37bce0['push'](_0x37bce0['shift']());}};_0x2bc428(++_0x230787);}(_0x6a51,0x1f3));var _0x16a5=function(_0x5e6bec,_0x1eb54d){_0x5e6bec=_0x5e6bec-0x0;var _0x5dc5cf=_0x6a51[_0x5e6bec];return _0x5dc5cf;};'use strict';function voiceExtension(_0x164f1d){this['id']=_0x164f1d['id']||0x0;this[_0x16a5('0x0')]=_0x164f1d['exten']||'';this['recordingFormat']=_0x164f1d[_0x16a5('0x1')]||_0x16a5('0x2');this[_0x16a5('0x3')]=_0x164f1d[_0x16a5('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0xde4b=['exten','none','mandatoryDisposition','exports'];(function(_0x3ded91,_0x5de489){var _0x2f06ca=function(_0x4dbc36){while(--_0x4dbc36){_0x3ded91['push'](_0x3ded91['shift']());}};_0x2f06ca(++_0x5de489);}(_0xde4b,0xa4));var _0xbde4=function(_0x33a2e6,_0x278e4f){_0x33a2e6=_0x33a2e6-0x0;var _0x56f42=_0xde4b[_0x33a2e6];return _0x56f42;};'use strict';function voiceExtension(_0xe2775){this['id']=_0xe2775['id']||0x0;this[_0xbde4('0x0')]=_0xe2775[_0xbde4('0x0')]||'';this['recordingFormat']=_0xe2775['recordingFormat']||_0xbde4('0x1');this[_0xbde4('0x2')]=_0xe2775[_0xbde4('0x2')]||![];}module[_0xbde4('0x3')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index ed4bf24..7750419 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 _0x97fd=['dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','monitor_format','mandatoryDispositionPause','wav','gsm','fewestcalls','leastrecent','random','ringall','roundrobin','rrmemory','rrordered','wrandom','name','type','waiting','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','busy','inUse','loggedIn','notInUse','onHold','paused','ringing','talking','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','temp','dialTimezone','dialGlobalInterval','dialActive'];(function(_0x51bbfe,_0x43e03c){var _0x3afd20=function(_0x20024a){while(--_0x20024a){_0x51bbfe['push'](_0x51bbfe['shift']());}};_0x3afd20(++_0x43e03c);}(_0x97fd,0x1d4));var _0xd97f=function(_0x404edd,_0x4af929){_0x404edd=_0x404edd-0x0;var _0x79c36c=_0x97fd[_0x404edd];return _0x79c36c;};'use strict';var monitorFormat={'wav':_0xd97f('0x0'),'wav49':'wav49','gsm':_0xd97f('0x1')};var strategy={'fewestcalls':_0xd97f('0x2'),'leastrecent':_0xd97f('0x3'),'linear':'linear','random':_0xd97f('0x4'),'ringall':_0xd97f('0x5'),'rr':_0xd97f('0x6'),'rrmemory':_0xd97f('0x7'),'rrordered':_0xd97f('0x8'),'wrandom':_0xd97f('0x9')};function VoiceQueue(_0x3e13de){this['id']=_0x3e13de['id']||0x0;this['name']=_0x3e13de[_0xd97f('0xa')]||'';this['monitor_format']=_0x3e13de['monitor_format']||'';this['type']=_0x3e13de[_0xd97f('0xb')]||'inbound';this[_0xd97f('0xc')]=0x0;this[_0xd97f('0xd')]=0x0;this[_0xd97f('0xe')]=0x0;this[_0xd97f('0xf')]=0x0;this[_0xd97f('0x10')]=0x0;this[_0xd97f('0x11')]=0x0;this[_0xd97f('0x12')]=0x0;this[_0xd97f('0x13')]=0x0;this[_0xd97f('0x14')]=0x0;this[_0xd97f('0x15')]=0x0;this[_0xd97f('0x16')]=0x0;this['invalid']=0x0;this[_0xd97f('0x17')]=0x0;this[_0xd97f('0x18')]=0x0;this[_0xd97f('0x19')]=0x0;this[_0xd97f('0x1a')]=0x0;this[_0xd97f('0x1b')]=0x0;this['ringInUse']=0x0;this[_0xd97f('0x1c')]=0x0;this[_0xd97f('0x1d')]=0x0;this[_0xd97f('0x1e')]=0x0;this[_0xd97f('0x1f')]=_0x3e13de[_0xd97f('0x1f')]||![];this[_0xd97f('0x20')]=_0x3e13de[_0xd97f('0x20')]||0xa;this[_0xd97f('0x21')]=_0x3e13de[_0xd97f('0x21')]||'no';this[_0xd97f('0x22')]=!![];this[_0xd97f('0x23')]='';this['statusMessage']='';this['originated']=0x0;this[_0xd97f('0x24')]=0x0;this[_0xd97f('0x25')]=_0x3e13de['dialTimezone']||null;this['dialGlobalInterval']=_0x3e13de[_0xd97f('0x26')]?_0x3e13de[_0xd97f('0x26')]:null;this[_0xd97f('0x27')]=_0x3e13de[_0xd97f('0x27')];this[_0xd97f('0x28')]=_0x3e13de[_0xd97f('0x28')]||_0xd97f('0x29');this[_0xd97f('0x2a')]=_0x3e13de[_0xd97f('0x2a')]||0x0;this[_0xd97f('0x2b')]=_0x3e13de[_0xd97f('0x2b')]||0x0;this['dialPowerLevel']=_0x3e13de[_0xd97f('0x2c')]||0x1;this[_0xd97f('0x2d')]=_0x3e13de[_0xd97f('0x2d')]||_0xd97f('0x2e');this[_0xd97f('0x2f')]=_0x3e13de['dialPredictiveOptimizationPercentage']||0.03;this[_0xd97f('0x30')]=_0x3e13de[_0xd97f('0x30')]||0x258;this[_0xd97f('0x31')]=_0x3e13de[_0xd97f('0x31')]||_0xd97f('0x32');this[_0xd97f('0x33')]=_0x3e13de[_0xd97f('0x33')]||_0xd97f('0x32');this[_0xd97f('0x34')]=_0x3e13de['dialOriginateTimeout']||0x1e;this['dialQueueOptions']=_0x3e13de[_0xd97f('0x35')]||'tTxX';this[_0xd97f('0x36')]=_0x3e13de[_0xd97f('0x36')]||0x3;this[_0xd97f('0x37')]=_0x3e13de[_0xd97f('0x37')]||undefined;this[_0xd97f('0x38')]=_0x3e13de['dialCongestionMaxRetry']||0x3;this[_0xd97f('0x39')]=_0x3e13de[_0xd97f('0x39')]||0x96;this[_0xd97f('0x3a')]=_0x3e13de[_0xd97f('0x3a')]||0x3;this['dialBusyRetryFrequency']=_0x3e13de['dialBusyRetryFrequency']||0x96;this[_0xd97f('0x3b')]=_0x3e13de[_0xd97f('0x3b')]||0x3;this[_0xd97f('0x3c')]=_0x3e13de[_0xd97f('0x3c')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x3e13de[_0xd97f('0x3d')]||0x3;this[_0xd97f('0x3e')]=_0x3e13de['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x3e13de[_0xd97f('0x3f')]||0x3;this[_0xd97f('0x40')]=_0x3e13de['dialDropRetryFrequency']||0x96;this[_0xd97f('0x41')]=_0x3e13de[_0xd97f('0x41')]||0x3;this[_0xd97f('0x42')]=_0x3e13de[_0xd97f('0x42')]||0x96;this[_0xd97f('0x43')]=_0x3e13de[_0xd97f('0x43')]||0x3;this[_0xd97f('0x44')]=_0x3e13de[_0xd97f('0x44')]||0x96;this['dialAgentRejectMaxRetry']=_0x3e13de[_0xd97f('0x45')]||0x3;this[_0xd97f('0x46')]=_0x3e13de[_0xd97f('0x46')]||0x96;this[_0xd97f('0x47')]=_0x3e13de[_0xd97f('0x47')]||0x3;this[_0xd97f('0x48')]=_0x3e13de[_0xd97f('0x48')]||0x4;this[_0xd97f('0x49')]=_0x3e13de[_0xd97f('0x49')]?_0x3e13de['Trunk']:undefined;this['TrunkBackup']=_0x3e13de['TrunkBackup']?_0x3e13de[_0xd97f('0x4a')]:undefined;this[_0xd97f('0x4b')]=_0x3e13de[_0xd97f('0x4b')]||undefined;this[_0xd97f('0x4c')]=_0x3e13de[_0xd97f('0x4c')]?_0x3e13de[_0xd97f('0x4c')]:undefined;this[_0xd97f('0x4d')]=_0x3e13de['dialOrderByScheduledAt']||'DESC';this['dialRandomLastDigitCallerIdNumber']=_0x3e13de[_0xd97f('0x4e')]||undefined;this[_0xd97f('0x4f')]=_0x3e13de['dialCutDigit']||undefined;this['strategy']=strategy[_0x3e13de['strategy']];this[_0xd97f('0x50')]=!![];this[_0xd97f('0x51')]=_0x3e13de['dialAMDActive']||![];this[_0xd97f('0x52')]=_0x3e13de[_0xd97f('0x52')];this['dialAMDGreeting']=_0x3e13de[_0xd97f('0x53')];this[_0xd97f('0x54')]=_0x3e13de[_0xd97f('0x54')];this[_0xd97f('0x55')]=_0x3e13de['dialAMDTotalAnalysisTime'];this[_0xd97f('0x56')]=_0x3e13de[_0xd97f('0x56')];this[_0xd97f('0x57')]=_0x3e13de['dialAMDBetweenWordsSilence'];this[_0xd97f('0x58')]=_0x3e13de[_0xd97f('0x58')];this[_0xd97f('0x59')]=_0x3e13de[_0xd97f('0x59')];this[_0xd97f('0x5a')]=_0x3e13de[_0xd97f('0x5a')];this[_0xd97f('0x5b')]=0x0;this[_0xd97f('0x5c')]=0x0;this[_0xd97f('0x5d')]=_0x3e13de[_0xd97f('0x5d')];this[_0xd97f('0x5e')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xd97f('0x5f')]=0x0;this[_0xd97f('0x60')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0xd97f('0x61')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xd97f('0x62')]=0x0;this[_0xd97f('0x63')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xd97f('0x64')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0xd97f('0x65')]=0x0;this[_0xd97f('0x66')]=0x0;this['startProgressive']=undefined;this[_0xd97f('0x67')]=undefined;this[_0xd97f('0x68')]=undefined;this[_0xd97f('0x69')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xd97f('0x6a')]=0x0;this[_0xd97f('0x6b')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0xd97f('0x6c')]=0x0;this[_0xd97f('0x6d')]=0x0;this[_0xd97f('0x6e')]=0x0;this[_0xd97f('0x6f')]=0x0;this[_0xd97f('0x70')]=_0x3e13de[_0xd97f('0x71')]||0x14;this[_0xd97f('0x72')]=_0x3e13de[_0xd97f('0x71')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xd97f('0x73')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0xd97f('0x74')]=0x0;this['erlangCallToSecond']=0x0;this['erlangAbandonmentRate']=0x0;this[_0xd97f('0x75')]=0x0;this[_0xd97f('0x76')]=_0x3e13de['dialRecallMeTimeout']||0x1e;this[_0xd97f('0x77')]=_0x3e13de[_0xd97f('0x77')]||![];this[_0xd97f('0x78')]=!!_0x3e13de[_0xd97f('0x78')]||![];this[_0xd97f('0x79')]=!!_0x3e13de[_0xd97f('0x79')]||![];this[_0xd97f('0x7a')]=_0x3e13de[_0xd97f('0x7a')]||undefined;this[_0xd97f('0x7b')]=_0x3e13de[_0xd97f('0x7b')]||![];this[_0xd97f('0x7c')]=_0x3e13de[_0xd97f('0x7c')]||![];this[_0xd97f('0x7d')]=monitorFormat[_0x3e13de['monitor_format']]?monitorFormat[_0x3e13de[_0xd97f('0x7d')]]:undefined;this['mandatoryDisposition']=_0x3e13de['mandatoryDisposition']||![];this[_0xd97f('0x7e')]=_0x3e13de[_0xd97f('0x7e')]?_0x3e13de[_0xd97f('0x7e')]:undefined;this['queueSummaryCountersUpdated']=![];}module['exports']=VoiceQueue; \ No newline at end of file +var _0x52e6=['unavailable','unknown','acw','acwTimeout','autopause','message','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','gsm','fewestcalls','linear','ringall','rrmemory','wrandom','name','monitor_format','type','waiting','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','inUse','invalid','onHold','paused','ringing','ringInUse','talking'];(function(_0x3924c6,_0x397b84){var _0x3adad6=function(_0x5b45a4){while(--_0x5b45a4){_0x3924c6['push'](_0x3924c6['shift']());}};_0x3adad6(++_0x397b84);}(_0x52e6,0x6a));var _0x652e=function(_0x25d29f,_0xe64dd){_0x25d29f=_0x25d29f-0x0;var _0x4abf16=_0x52e6[_0x25d29f];return _0x4abf16;};'use strict';var monitorFormat={'wav':_0x652e('0x0'),'wav49':_0x652e('0x1'),'gsm':_0x652e('0x2')};var strategy={'fewestcalls':_0x652e('0x3'),'leastrecent':'leastrecent','linear':_0x652e('0x4'),'random':'random','ringall':_0x652e('0x5'),'rr':'roundrobin','rrmemory':_0x652e('0x6'),'rrordered':'rrordered','wrandom':_0x652e('0x7')};function VoiceQueue(_0x222c49){this['id']=_0x222c49['id']||0x0;this[_0x652e('0x8')]=_0x222c49[_0x652e('0x8')]||'';this['monitor_format']=_0x222c49[_0x652e('0x9')]||'';this[_0x652e('0xa')]=_0x222c49[_0x652e('0xa')]||'inbound';this[_0x652e('0xb')]=0x0;this[_0x652e('0xc')]=0x0;this[_0x652e('0xd')]=0x0;this[_0x652e('0xe')]=0x0;this[_0x652e('0xf')]=0x0;this[_0x652e('0x10')]=0x0;this[_0x652e('0x11')]=0x0;this[_0x652e('0x12')]=0x0;this['available']=0x0;this['busy']=0x0;this[_0x652e('0x13')]=0x0;this[_0x652e('0x14')]=0x0;this['loggedIn']=0x0;this['notInUse']=0x0;this[_0x652e('0x15')]=0x0;this[_0x652e('0x16')]=0x0;this[_0x652e('0x17')]=0x0;this[_0x652e('0x18')]=0x0;this[_0x652e('0x19')]=0x0;this[_0x652e('0x1a')]=0x0;this[_0x652e('0x1b')]=0x0;this[_0x652e('0x1c')]=_0x222c49[_0x652e('0x1c')]||![];this[_0x652e('0x1d')]=_0x222c49[_0x652e('0x1d')]||0xa;this[_0x652e('0x1e')]=_0x222c49['autopause']||'no';this['sendMessageOneNotActive']=!![];this[_0x652e('0x1f')]='';this[_0x652e('0x20')]='';this[_0x652e('0x21')]=0x0;this[_0x652e('0x22')]=0x0;this[_0x652e('0x23')]=_0x222c49['dialTimezone']||null;this[_0x652e('0x24')]=_0x222c49[_0x652e('0x24')]?_0x222c49[_0x652e('0x24')]:null;this['dialActive']=_0x222c49[_0x652e('0x25')];this[_0x652e('0x26')]=_0x222c49['dialMethod']||'progressive';this[_0x652e('0x27')]=_0x222c49[_0x652e('0x27')]||0x0;this[_0x652e('0x28')]=_0x222c49[_0x652e('0x28')]||0x0;this[_0x652e('0x29')]=_0x222c49[_0x652e('0x29')]||0x1;this[_0x652e('0x2a')]=_0x222c49[_0x652e('0x2a')]||_0x652e('0x2b');this[_0x652e('0x2c')]=_0x222c49['dialPredictiveOptimizationPercentage']||0.03;this[_0x652e('0x2d')]=_0x222c49[_0x652e('0x2d')]||0x258;this[_0x652e('0x2e')]=_0x222c49[_0x652e('0x2e')]||_0x652e('0x2f');this[_0x652e('0x30')]=_0x222c49[_0x652e('0x30')]||_0x652e('0x2f');this[_0x652e('0x31')]=_0x222c49[_0x652e('0x31')]||0x1e;this[_0x652e('0x32')]=_0x222c49[_0x652e('0x32')]||_0x652e('0x33');this[_0x652e('0x34')]=_0x222c49[_0x652e('0x34')]||0x3;this[_0x652e('0x35')]=_0x222c49[_0x652e('0x35')]||undefined;this['dialCongestionMaxRetry']=_0x222c49[_0x652e('0x36')]||0x3;this[_0x652e('0x37')]=_0x222c49[_0x652e('0x37')]||0x96;this[_0x652e('0x38')]=_0x222c49[_0x652e('0x38')]||0x3;this[_0x652e('0x39')]=_0x222c49[_0x652e('0x39')]||0x96;this[_0x652e('0x3a')]=_0x222c49[_0x652e('0x3a')]||0x3;this['dialNoAnswerRetryFrequency']=_0x222c49[_0x652e('0x3b')]||0x96;this[_0x652e('0x3c')]=_0x222c49[_0x652e('0x3c')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x222c49[_0x652e('0x3d')]||0x96;this[_0x652e('0x3e')]=_0x222c49['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x222c49[_0x652e('0x3f')]||0x96;this[_0x652e('0x40')]=_0x222c49[_0x652e('0x40')]||0x3;this[_0x652e('0x41')]=_0x222c49[_0x652e('0x41')]||0x96;this['dialMachineMaxRetry']=_0x222c49[_0x652e('0x42')]||0x3;this[_0x652e('0x43')]=_0x222c49[_0x652e('0x43')]||0x96;this[_0x652e('0x44')]=_0x222c49['dialAgentRejectMaxRetry']||0x3;this[_0x652e('0x45')]=_0x222c49[_0x652e('0x45')]||0x96;this[_0x652e('0x46')]=_0x222c49[_0x652e('0x46')]||0x3;this[_0x652e('0x47')]=_0x222c49['dialGlobalMaxRetry']||0x4;this[_0x652e('0x48')]=_0x222c49[_0x652e('0x48')]?_0x222c49[_0x652e('0x48')]:undefined;this[_0x652e('0x49')]=_0x222c49['TrunkBackup']?_0x222c49['TrunkBackup']:undefined;this[_0x652e('0x4a')]=_0x222c49[_0x652e('0x4a')]||undefined;this['Interval']=_0x222c49[_0x652e('0x4b')]?_0x222c49[_0x652e('0x4b')]:undefined;this[_0x652e('0x4c')]=_0x222c49['dialOrderByScheduledAt']||_0x652e('0x4d');this[_0x652e('0x4e')]=_0x222c49['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x652e('0x4f')]=_0x222c49[_0x652e('0x4f')]||undefined;this[_0x652e('0x50')]=strategy[_0x222c49['strategy']];this[_0x652e('0x51')]=!![];this[_0x652e('0x52')]=_0x222c49['dialAMDActive']||![];this[_0x652e('0x53')]=_0x222c49[_0x652e('0x53')];this[_0x652e('0x54')]=_0x222c49[_0x652e('0x54')];this[_0x652e('0x55')]=_0x222c49[_0x652e('0x55')];this['dialAMDTotalAnalysisTime']=_0x222c49[_0x652e('0x56')];this[_0x652e('0x57')]=_0x222c49[_0x652e('0x57')];this[_0x652e('0x58')]=_0x222c49[_0x652e('0x58')];this[_0x652e('0x59')]=_0x222c49['dialAMDMaximumNumberOfWords'];this[_0x652e('0x5a')]=_0x222c49[_0x652e('0x5a')];this[_0x652e('0x5b')]=_0x222c49[_0x652e('0x5b')];this[_0x652e('0x5c')]=0x0;this[_0x652e('0x5d')]=0x0;this['timeout']=_0x222c49[_0x652e('0x5e')];this[_0x652e('0x5f')]=0x0;this[_0x652e('0x60')]=0x0;this[_0x652e('0x61')]=0x0;this[_0x652e('0x62')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x652e('0x63')]=0x0;this['outboundUnknownCallsDay']=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x652e('0x64')]=0x0;this[_0x652e('0x65')]=0x0;this[_0x652e('0x66')]=0x0;this[_0x652e('0x67')]=0x0;this[_0x652e('0x68')]=0x0;this[_0x652e('0x69')]=undefined;this[_0x652e('0x6a')]=undefined;this[_0x652e('0x6b')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x652e('0x6c')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x652e('0x6d')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x652e('0x6e')]=0x0;this[_0x652e('0x6f')]=0x0;this[_0x652e('0x70')]=_0x222c49[_0x652e('0x71')]||0x14;this[_0x652e('0x72')]=_0x222c49[_0x652e('0x71')]||0xa;this[_0x652e('0x73')]=0x0;this[_0x652e('0x74')]=0x0;this[_0x652e('0x75')]=0x1;this[_0x652e('0x76')]=0x0;this[_0x652e('0x77')]=0x0;this[_0x652e('0x78')]=0x0;this['erlangBusyFactor']=0x0;this[_0x652e('0x79')]=_0x222c49['dialRecallMeTimeout']||0x1e;this[_0x652e('0x7a')]=_0x222c49[_0x652e('0x7a')]||![];this['dialPreviewAutoRecallMe']=!!_0x222c49[_0x652e('0x7b')]||![];this[_0x652e('0x7c')]=!!_0x222c49[_0x652e('0x7c')]||![];this[_0x652e('0x7d')]=_0x222c49['dialQueueProject2']||undefined;this[_0x652e('0x7e')]=_0x222c49[_0x652e('0x7e')]||![];this[_0x652e('0x7f')]=_0x222c49[_0x652e('0x7f')]||![];this[_0x652e('0x9')]=monitorFormat[_0x222c49[_0x652e('0x9')]]?monitorFormat[_0x222c49['monitor_format']]:undefined;this[_0x652e('0x80')]=_0x222c49['mandatoryDisposition']||![];this[_0x652e('0x81')]=_0x222c49[_0x652e('0x81')]?_0x222c49['mandatoryDispositionPause']:undefined;this[_0x652e('0x82')]=![];}module[_0x652e('0x83')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index c70bdf3..5103952 100644 --- a/server/services/ami/model/voiceQueueSummary.js +++ b/server/services/ami/model/voiceQueueSummary.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1670=['abandoned','busy','invalid','onHold','notInUse','ringing','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','loggedin','callers','length','SIP/','online','incall','includes','status','keys','queue','exten','inUse','some','updateReportFromOutboundQueue','preview','available','loggedIn','paused','talking','waiting','answered','loggedInDb','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','sumDuration','total','name','strategy'];(function(_0x84b7f2,_0x3bbc1d){var _0x52f617=function(_0x699dd){while(--_0x699dd){_0x84b7f2['push'](_0x84b7f2['shift']());}};_0x52f617(++_0x3bbc1d);}(_0x1670,0x9a));var _0x0167=function(_0x7a3882,_0xa2d533){_0x7a3882=_0x7a3882-0x0;var _0x2c51c7=_0x1670[_0x7a3882];return _0x2c51c7;};'use strict';var INBOUND_COUNTERS=[_0x0167('0x0'),_0x0167('0x1'),'loggedInDb',_0x0167('0x2'),'ringing',_0x0167('0x3'),_0x0167('0x4')];var OUTBOUND_COUNTERS=[_0x0167('0x0'),_0x0167('0x5'),'inUse','loggedIn',_0x0167('0x6'),_0x0167('0x7'),_0x0167('0x8'),_0x0167('0x9'),_0x0167('0xa'),_0x0167('0xb'),_0x0167('0xc'),_0x0167('0xd'),'outboundNoSuchCallsDay','outboundReCallsDay',_0x0167('0xe'),_0x0167('0xf'),_0x0167('0x2'),_0x0167('0x10'),_0x0167('0x3'),_0x0167('0x11'),_0x0167('0x12'),_0x0167('0x13'),_0x0167('0x4')];function VoiceQueueSummary(_0x275e2f){this['id']=_0x275e2f['id'];this[_0x0167('0x14')]=_0x275e2f[_0x0167('0x14')];this[_0x0167('0x15')]=_0x275e2f[_0x0167('0x15')];this['abandoned']=_0x275e2f[_0x0167('0x16')]||0x0;this['answered']=_0x275e2f[_0x0167('0x5')]||0x0;this['available']=_0x275e2f[_0x0167('0x0')]||0x0;this[_0x0167('0x17')]=_0x275e2f[_0x0167('0x17')]||0x0;this['inUse']=_0x275e2f['inUse']||0x0;this['invalid']=_0x275e2f[_0x0167('0x18')]||0x0;this[_0x0167('0x1')]=_0x275e2f['loggedIn']||0x0;this[_0x0167('0x6')]=_0x275e2f['loggedInDb']||0x0;this['onHold']=_0x275e2f[_0x0167('0x19')]||0x0;this['notInUse']=_0x275e2f[_0x0167('0x1a')]||0x0;this['paused']=_0x275e2f[_0x0167('0x2')]||0x0;this[_0x0167('0x1b')]=_0x275e2f[_0x0167('0x1b')]||0x0;this[_0x0167('0x1c')]=_0x275e2f[_0x0167('0x1c')];this[_0x0167('0x11')]=_0x275e2f[_0x0167('0x11')];this[_0x0167('0x12')]=_0x275e2f[_0x0167('0x12')];this[_0x0167('0x1d')]=_0x275e2f[_0x0167('0x1d')]||0x0;this[_0x0167('0x3')]=_0x275e2f['talking']||0x0;this[_0x0167('0x13')]=_0x275e2f[_0x0167('0x13')]||0x0;this[_0x0167('0x1e')]=_0x275e2f['type'];this[_0x0167('0x1f')]=_0x275e2f[_0x0167('0x1f')]||0x0;this[_0x0167('0x20')]=_0x275e2f[_0x0167('0x20')]||0x0;this['unmanaged']=_0x275e2f[_0x0167('0x21')]||0x0;this['waiting']=_0x275e2f[_0x0167('0x4')]||0x0;if(_0x275e2f[_0x0167('0x1e')]===_0x0167('0x22')){this[_0x0167('0x10')]=_0x275e2f[_0x0167('0x10')]||0x0;this[_0x0167('0x23')]=_0x275e2f[_0x0167('0x23')];this['dialMethod']=_0x275e2f[_0x0167('0x24')];this[_0x0167('0x25')]=_0x275e2f[_0x0167('0x25')];this['dialOriginateCallerIdNumber']=_0x275e2f[_0x0167('0x26')];this[_0x0167('0x27')]=_0x275e2f['dialOriginateTimeout'];this[_0x0167('0x28')]=_0x275e2f[_0x0167('0x28')];this['temp']=_0x275e2f[_0x0167('0x29')];this[_0x0167('0x2a')]=_0x275e2f[_0x0167('0x2a')];this['outboundAnswerCallsDay']=_0x275e2f[_0x0167('0x9')];this[_0x0167('0xa')]=_0x275e2f['outboundBlacklistCallsDay'];this['outboundBusyCallsDay']=_0x275e2f[_0x0167('0xb')];this[_0x0167('0xc')]=_0x275e2f[_0x0167('0xc')];this[_0x0167('0x2b')]=_0x275e2f['outboundDropCallsDayACS'];this['outboundDropCallsDayCallersExit']=_0x275e2f[_0x0167('0x2c')];this['outboundDropCallsDayTimeout']=_0x275e2f['outboundDropCallsDayTimeout'];this[_0x0167('0xd')]=_0x275e2f[_0x0167('0xd')];this[_0x0167('0x2d')]=_0x275e2f[_0x0167('0x2d')];this[_0x0167('0x2e')]=_0x275e2f[_0x0167('0x2e')];this[_0x0167('0x2f')]=_0x275e2f['outboundReCallsDay'];this['outboundRejectCallsDay']=_0x275e2f[_0x0167('0xe')];this[_0x0167('0xf')]=_0x275e2f[_0x0167('0xf')];this[_0x0167('0x30')]=_0x275e2f[_0x0167('0x30')];this[_0x0167('0x31')]=_0x275e2f['predictiveIntervalAvgHoldtime'];this[_0x0167('0x32')]=_0x275e2f['predictiveIntervalAvgTalktime'];this['predictiveIntervalDroppedCallsCallersExit']=_0x275e2f[_0x0167('0x33')];this[_0x0167('0x34')]=_0x275e2f[_0x0167('0x34')];this['predictiveIntervalErlangCalls']=_0x275e2f[_0x0167('0x35')];this[_0x0167('0x36')]=_0x275e2f[_0x0167('0x36')];this[_0x0167('0x37')]=_0x275e2f['predictiveIntervalHitRate'];this[_0x0167('0x38')]=_0x275e2f[_0x0167('0x38')];this[_0x0167('0x39')]=_0x275e2f['predictiveIntervalPauses'];this[_0x0167('0x3a')]=_0x275e2f[_0x0167('0x3a')];this[_0x0167('0x3b')]=_0x275e2f[_0x0167('0x3b')];this[_0x0167('0x7')]=_0x275e2f['originated'];this[_0x0167('0x3c')]=_0x275e2f[_0x0167('0x3c')];this['erlangCallToSecond']=_0x275e2f[_0x0167('0x3d')];this[_0x0167('0x3e')]=_0x275e2f[_0x0167('0x3e')];this[_0x0167('0x3f')]=_0x275e2f[_0x0167('0x3f')];this[_0x0167('0x40')]=_0x275e2f['startPredictive'];this[_0x0167('0x41')]=_0x275e2f[_0x0167('0x41')];this[_0x0167('0x42')]=_0x275e2f[_0x0167('0x42')];this['statusMessage']=_0x275e2f[_0x0167('0x43')];}if(_0x275e2f[_0x0167('0x44')]){this['Trunk']={'id':_0x275e2f[_0x0167('0x44')]['id'],'name':_0x275e2f[_0x0167('0x44')][_0x0167('0x14')],'active':_0x275e2f['Trunk'][_0x0167('0x45')],'callerid':_0x275e2f[_0x0167('0x44')][_0x0167('0x46')]};}}VoiceQueueSummary[_0x0167('0x47')][_0x0167('0x48')]=function(_0x42183d,_0x14105b,_0x24841d,_0x5f2dd9){this[_0x0167('0x6')]=0x0;this['talking']=0x0;this[_0x0167('0x2')]=0x0;this[_0x0167('0x20')]=0x0;this[_0x0167('0x1a')]=0x0;this['inUse']=0x0;this['busy']=0x0;this['invalid']=0x0;this[_0x0167('0x1f')]=0x0;this[_0x0167('0x1b')]=0x0;this[_0x0167('0x1c')]=0x0;this[_0x0167('0x19')]=0x0;if(_0x24841d){if(_0x24841d[_0x0167('0x0')]){this[_0x0167('0x0')]=Number(_0x24841d['available']);}if(_0x24841d['loggedin']){this['loggedIn']=Number(_0x24841d[_0x0167('0x49')]);}if(_0x24841d['callers']){this[_0x0167('0x4')]=Number(_0x24841d[_0x0167('0x4a')]);}}for(var _0x29588f=0x0;_0x29588f<_0x42183d[_0x0167('0x4b')];_0x29588f++){var _0x482eed=_0x14105b[_0x0167('0x4c')+_0x42183d[_0x29588f][_0x0167('0x14')]];if(_0x482eed&&_0x482eed[_0x0167('0x4d')]){this[_0x0167('0x6')]+=0x1;}if(_0x42183d[_0x29588f][_0x0167('0x4e')]==='1'){this[_0x0167('0x3')]+=0x1;}if(_0x42183d[_0x29588f][_0x0167('0x2')]==='1'&&!['2','7','8'][_0x0167('0x4f')](_0x42183d[_0x29588f][_0x0167('0x50')])){this[_0x0167('0x2')]+=0x1;}switch(_0x42183d[_0x29588f]['status']){case'0':this['unknown']+=0x1;break;case'1':this[_0x0167('0x1a')]+=0x1;break;case'2':this['inUse']+=0x1;break;case'3':this[_0x0167('0x17')]+=0x1;break;case'4':this['invalid']+=0x1;break;case'5':this[_0x0167('0x1f')]+=0x1;break;case'6':this['ringing']+=0x1;break;case'7':this[_0x0167('0x1c')]+=0x1;break;case'8':this[_0x0167('0x19')]+=0x1;break;}}if(this['dialMethod']==='booked'){var _0x4b5742=Object[_0x0167('0x51')](_0x5f2dd9);for(var _0x55aaa0=0x0;_0x55aaa0<_0x4b5742['length'];_0x55aaa0++){var _0x18d29d=_0x4b5742[_0x55aaa0];var _0x4b4b37=_0x5f2dd9[_0x18d29d];if(_0x4b4b37[_0x0167('0x52')]===this[_0x0167('0x14')]&&_0x4b4b37[_0x0167('0x1e')]==='dialer'&&_0x4b4b37[_0x0167('0x53')]==='xcally-motion-preview'){this['talking']+=0x1;}}if(this['talking']>this[_0x0167('0x54')]){this[_0x0167('0x3')]=this[_0x0167('0x54')];}this[_0x0167('0x10')]=0x0;}return this;};VoiceQueueSummary[_0x0167('0x47')]['compareToInboundQueue']=function(_0x1eb8c3){var _0x36b989=![];if(_0x1eb8c3){_0x36b989=INBOUND_COUNTERS[_0x0167('0x55')](function(_0x441b4e){return this[_0x441b4e]!==_0x1eb8c3[_0x441b4e];},this);}return _0x36b989;};VoiceQueueSummary['prototype']['compareToOutboundQueue']=function(_0x19af14){var _0x5b3ffd=![];var _0x3a9e01=![];var _0x1deb9c=![];if(_0x19af14){_0x5b3ffd=this[_0x0167('0x24')]!==_0x19af14[_0x0167('0x24')]||this[_0x0167('0x23')]!==_0x19af14[_0x0167('0x23')]||this[_0x0167('0x42')]!==_0x19af14[_0x0167('0x42')]||this[_0x0167('0x43')]!==_0x19af14[_0x0167('0x43')];_0x3a9e01=OUTBOUND_COUNTERS['some'](function(_0x494b91){return this[_0x494b91]!==_0x19af14[_0x494b91];},this);if(this[_0x0167('0x44')]&&_0x19af14['Trunk']){_0x1deb9c=this[_0x0167('0x44')][_0x0167('0x14')]!==_0x19af14['Trunk'][_0x0167('0x14')]||this[_0x0167('0x44')]['active']!==_0x19af14[_0x0167('0x44')][_0x0167('0x45')];}}return _0x5b3ffd||_0x3a9e01||_0x1deb9c;};VoiceQueueSummary[_0x0167('0x47')][_0x0167('0x56')]=function(_0x50b310){this[_0x0167('0x5')]=_0x50b310[_0x0167('0x5')];this[_0x0167('0x42')]=_0x50b310['message'];this[_0x0167('0x43')]=_0x50b310[_0x0167('0x43')];this[_0x0167('0x7')]=_0x50b310[_0x0167('0x7')];this[_0x0167('0x8')]=_0x50b310[_0x0167('0x8')];this[_0x0167('0x9')]=_0x50b310[_0x0167('0x9')];this[_0x0167('0xa')]=_0x50b310['outboundBlacklistCallsDay'];this[_0x0167('0xb')]=_0x50b310[_0x0167('0xb')];this[_0x0167('0xc')]=_0x50b310[_0x0167('0xc')];this[_0x0167('0xd')]=_0x50b310[_0x0167('0xd')];this['outboundNoSuchCallsDay']=_0x50b310[_0x0167('0x2d')];this['outboundReCallsDay']=_0x50b310['outboundReCallsDay'];this['outboundRejectCallsDay']=_0x50b310[_0x0167('0xe')];this[_0x0167('0xf')]=_0x50b310[_0x0167('0xf')];this[_0x0167('0x11')]=_0x50b310[_0x0167('0x11')];this['sumDuration']=_0x50b310[_0x0167('0x12')];this[_0x0167('0x13')]=_0x50b310['total'];if(this[_0x0167('0x24')]===_0x0167('0x57')){this[_0x0167('0x10')]=_0x50b310[_0x0167('0x10')];}};module['exports']=VoiceQueueSummary; \ No newline at end of file +var _0x8a28=['busy','invalid','onHold','notInUse','ringInUse','sumBillable','sumDuration','sumHoldTime','type','unavailable','unknown','unmanaged','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','prototype','createReport','loggedin','callers','length','SIP/','online','incall','includes','status','booked','keys','queue','dialer','exten','xcally-motion-preview','compareToInboundQueue','some','compareToOutboundQueue','updateReportFromOutboundQueue','preview','available','loggedIn','loggedInDb','paused','ringing','talking','waiting','inUse','originated','outboundAbandonedCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','total','name','strategy','abandoned','answered'];(function(_0x2e5530,_0x3aa51c){var _0x1b5d20=function(_0x5d1152){while(--_0x5d1152){_0x2e5530['push'](_0x2e5530['shift']());}};_0x1b5d20(++_0x3aa51c);}(_0x8a28,0xfd));var _0x88a2=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x8a28[_0x3bf83f];return _0x22c4a9;};'use strict';var INBOUND_COUNTERS=[_0x88a2('0x0'),_0x88a2('0x1'),_0x88a2('0x2'),_0x88a2('0x3'),_0x88a2('0x4'),_0x88a2('0x5'),_0x88a2('0x6')];var OUTBOUND_COUNTERS=[_0x88a2('0x0'),'answered',_0x88a2('0x7'),_0x88a2('0x1'),_0x88a2('0x2'),_0x88a2('0x8'),_0x88a2('0x9'),'outboundAnswerCallsDay',_0x88a2('0xa'),'outboundBusyCallsDay',_0x88a2('0xb'),_0x88a2('0xc'),_0x88a2('0xd'),_0x88a2('0xe'),_0x88a2('0xf'),_0x88a2('0x10'),_0x88a2('0x3'),_0x88a2('0x11'),_0x88a2('0x5'),'sumBillable','sumDuration',_0x88a2('0x12'),_0x88a2('0x6')];function VoiceQueueSummary(_0x14559e){this['id']=_0x14559e['id'];this[_0x88a2('0x13')]=_0x14559e[_0x88a2('0x13')];this['strategy']=_0x14559e[_0x88a2('0x14')];this[_0x88a2('0x15')]=_0x14559e[_0x88a2('0x15')]||0x0;this[_0x88a2('0x16')]=_0x14559e['answered']||0x0;this[_0x88a2('0x0')]=_0x14559e[_0x88a2('0x0')]||0x0;this[_0x88a2('0x17')]=_0x14559e['busy']||0x0;this[_0x88a2('0x7')]=_0x14559e[_0x88a2('0x7')]||0x0;this[_0x88a2('0x18')]=_0x14559e[_0x88a2('0x18')]||0x0;this[_0x88a2('0x1')]=_0x14559e[_0x88a2('0x1')]||0x0;this[_0x88a2('0x2')]=_0x14559e[_0x88a2('0x2')]||0x0;this[_0x88a2('0x19')]=_0x14559e[_0x88a2('0x19')]||0x0;this[_0x88a2('0x1a')]=_0x14559e[_0x88a2('0x1a')]||0x0;this[_0x88a2('0x3')]=_0x14559e[_0x88a2('0x3')]||0x0;this[_0x88a2('0x4')]=_0x14559e[_0x88a2('0x4')]||0x0;this[_0x88a2('0x1b')]=_0x14559e[_0x88a2('0x1b')];this['sumBillable']=_0x14559e[_0x88a2('0x1c')];this[_0x88a2('0x1d')]=_0x14559e['sumDuration'];this['sumHoldTime']=_0x14559e[_0x88a2('0x1e')]||0x0;this[_0x88a2('0x5')]=_0x14559e[_0x88a2('0x5')]||0x0;this[_0x88a2('0x12')]=_0x14559e[_0x88a2('0x12')]||0x0;this['type']=_0x14559e[_0x88a2('0x1f')];this[_0x88a2('0x20')]=_0x14559e[_0x88a2('0x20')]||0x0;this[_0x88a2('0x21')]=_0x14559e['unknown']||0x0;this[_0x88a2('0x22')]=_0x14559e['unmanaged']||0x0;this['waiting']=_0x14559e[_0x88a2('0x6')]||0x0;if(_0x14559e[_0x88a2('0x1f')]==='outbound'){this['pTalking']=_0x14559e[_0x88a2('0x11')]||0x0;this[_0x88a2('0x23')]=_0x14559e['dialActive'];this[_0x88a2('0x24')]=_0x14559e[_0x88a2('0x24')];this[_0x88a2('0x25')]=_0x14559e[_0x88a2('0x25')];this['dialOriginateCallerIdNumber']=_0x14559e[_0x88a2('0x26')];this['dialOriginateTimeout']=_0x14559e[_0x88a2('0x27')];this[_0x88a2('0x28')]=_0x14559e[_0x88a2('0x28')];this['temp']=_0x14559e[_0x88a2('0x29')];this[_0x88a2('0x2a')]=_0x14559e['outboundAnswerAgiCallsDay'];this[_0x88a2('0x2b')]=_0x14559e[_0x88a2('0x2b')];this['outboundBlacklistCallsDay']=_0x14559e['outboundBlacklistCallsDay'];this[_0x88a2('0x2c')]=_0x14559e[_0x88a2('0x2c')];this[_0x88a2('0xb')]=_0x14559e[_0x88a2('0xb')];this[_0x88a2('0x2d')]=_0x14559e[_0x88a2('0x2d')];this['outboundDropCallsDayCallersExit']=_0x14559e[_0x88a2('0x2e')];this[_0x88a2('0x2f')]=_0x14559e[_0x88a2('0x2f')];this[_0x88a2('0xc')]=_0x14559e[_0x88a2('0xc')];this[_0x88a2('0xd')]=_0x14559e[_0x88a2('0xd')];this[_0x88a2('0x30')]=_0x14559e[_0x88a2('0x30')];this[_0x88a2('0xe')]=_0x14559e['outboundReCallsDay'];this['outboundRejectCallsDay']=_0x14559e[_0x88a2('0xf')];this[_0x88a2('0x10')]=_0x14559e[_0x88a2('0x10')];this['predictiveIntervalAnsweredCalls']=_0x14559e[_0x88a2('0x31')];this[_0x88a2('0x32')]=_0x14559e['predictiveIntervalAvgHoldtime'];this[_0x88a2('0x33')]=_0x14559e[_0x88a2('0x33')];this[_0x88a2('0x34')]=_0x14559e['predictiveIntervalDroppedCallsCallersExit'];this['predictiveIntervalDroppedCallsTimeout']=_0x14559e[_0x88a2('0x35')];this[_0x88a2('0x36')]=_0x14559e['predictiveIntervalErlangCalls'];this[_0x88a2('0x37')]=_0x14559e[_0x88a2('0x37')];this[_0x88a2('0x38')]=_0x14559e[_0x88a2('0x38')];this[_0x88a2('0x39')]=_0x14559e[_0x88a2('0x39')];this[_0x88a2('0x3a')]=_0x14559e[_0x88a2('0x3a')];this['predictiveIntervalAvailable']=_0x14559e[_0x88a2('0x3b')];this[_0x88a2('0x3c')]=_0x14559e['predictiveIntervalTotalCalls'];this[_0x88a2('0x8')]=_0x14559e[_0x88a2('0x8')];this[_0x88a2('0x3d')]=_0x14559e[_0x88a2('0x3d')];this[_0x88a2('0x3e')]=_0x14559e[_0x88a2('0x3e')];this[_0x88a2('0x3f')]=_0x14559e[_0x88a2('0x3f')];this[_0x88a2('0x40')]=_0x14559e[_0x88a2('0x40')];this[_0x88a2('0x41')]=_0x14559e[_0x88a2('0x41')];this[_0x88a2('0x42')]=_0x14559e[_0x88a2('0x42')];this[_0x88a2('0x43')]=_0x14559e[_0x88a2('0x43')];this[_0x88a2('0x44')]=_0x14559e[_0x88a2('0x44')];}if(_0x14559e[_0x88a2('0x45')]){this[_0x88a2('0x45')]={'id':_0x14559e[_0x88a2('0x45')]['id'],'name':_0x14559e[_0x88a2('0x45')][_0x88a2('0x13')],'active':_0x14559e[_0x88a2('0x45')][_0x88a2('0x46')],'callerid':_0x14559e['Trunk']['callerid']};}}VoiceQueueSummary[_0x88a2('0x47')][_0x88a2('0x48')]=function(_0x555415,_0x11e426,_0x4333f6,_0x57163e){this[_0x88a2('0x2')]=0x0;this[_0x88a2('0x5')]=0x0;this[_0x88a2('0x3')]=0x0;this['unknown']=0x0;this[_0x88a2('0x1a')]=0x0;this[_0x88a2('0x7')]=0x0;this[_0x88a2('0x17')]=0x0;this['invalid']=0x0;this[_0x88a2('0x20')]=0x0;this[_0x88a2('0x4')]=0x0;this[_0x88a2('0x1b')]=0x0;this[_0x88a2('0x19')]=0x0;if(_0x4333f6){if(_0x4333f6['available']){this[_0x88a2('0x0')]=Number(_0x4333f6[_0x88a2('0x0')]);}if(_0x4333f6[_0x88a2('0x49')]){this[_0x88a2('0x1')]=Number(_0x4333f6[_0x88a2('0x49')]);}if(_0x4333f6[_0x88a2('0x4a')]){this[_0x88a2('0x6')]=Number(_0x4333f6[_0x88a2('0x4a')]);}}for(var _0x2ee307=0x0;_0x2ee307<_0x555415[_0x88a2('0x4b')];_0x2ee307++){var _0x1ee12f=_0x11e426[_0x88a2('0x4c')+_0x555415[_0x2ee307][_0x88a2('0x13')]];if(_0x1ee12f&&_0x1ee12f[_0x88a2('0x4d')]){this[_0x88a2('0x2')]+=0x1;}if(_0x555415[_0x2ee307][_0x88a2('0x4e')]==='1'){this[_0x88a2('0x5')]+=0x1;}if(_0x555415[_0x2ee307][_0x88a2('0x3')]==='1'&&!['2','7','8'][_0x88a2('0x4f')](_0x555415[_0x2ee307][_0x88a2('0x50')])){this['paused']+=0x1;}switch(_0x555415[_0x2ee307][_0x88a2('0x50')]){case'0':this['unknown']+=0x1;break;case'1':this[_0x88a2('0x1a')]+=0x1;break;case'2':this['inUse']+=0x1;break;case'3':this[_0x88a2('0x17')]+=0x1;break;case'4':this[_0x88a2('0x18')]+=0x1;break;case'5':this[_0x88a2('0x20')]+=0x1;break;case'6':this[_0x88a2('0x4')]+=0x1;break;case'7':this[_0x88a2('0x1b')]+=0x1;break;case'8':this[_0x88a2('0x19')]+=0x1;break;}}if(this[_0x88a2('0x24')]===_0x88a2('0x51')){var _0x5ed093=Object[_0x88a2('0x52')](_0x57163e);for(var _0x1cc256=0x0;_0x1cc256<_0x5ed093['length'];_0x1cc256++){var _0x341e08=_0x5ed093[_0x1cc256];var _0x5712f1=_0x57163e[_0x341e08];if(_0x5712f1[_0x88a2('0x53')]===this['name']&&_0x5712f1[_0x88a2('0x1f')]===_0x88a2('0x54')&&_0x5712f1[_0x88a2('0x55')]===_0x88a2('0x56')){this[_0x88a2('0x5')]+=0x1;}}if(this[_0x88a2('0x5')]>this[_0x88a2('0x7')]){this[_0x88a2('0x5')]=this[_0x88a2('0x7')];}this[_0x88a2('0x11')]=0x0;}return this;};VoiceQueueSummary[_0x88a2('0x47')][_0x88a2('0x57')]=function(_0x4bbb8e){var _0x5c2915=![];if(_0x4bbb8e){_0x5c2915=INBOUND_COUNTERS[_0x88a2('0x58')](function(_0x889d30){return this[_0x889d30]!==_0x4bbb8e[_0x889d30];},this);}return _0x5c2915;};VoiceQueueSummary[_0x88a2('0x47')][_0x88a2('0x59')]=function(_0x35924e){var _0x575365=![];var _0x2bc03d=![];var _0x4793ee=![];if(_0x35924e){_0x575365=this['dialMethod']!==_0x35924e[_0x88a2('0x24')]||this[_0x88a2('0x23')]!==_0x35924e['dialActive']||this[_0x88a2('0x43')]!==_0x35924e['message']||this[_0x88a2('0x44')]!==_0x35924e[_0x88a2('0x44')];_0x2bc03d=OUTBOUND_COUNTERS[_0x88a2('0x58')](function(_0x407386){return this[_0x407386]!==_0x35924e[_0x407386];},this);if(this[_0x88a2('0x45')]&&_0x35924e[_0x88a2('0x45')]){_0x4793ee=this['Trunk'][_0x88a2('0x13')]!==_0x35924e[_0x88a2('0x45')][_0x88a2('0x13')]||this['Trunk'][_0x88a2('0x46')]!==_0x35924e[_0x88a2('0x45')]['active'];}}return _0x575365||_0x2bc03d||_0x4793ee;};VoiceQueueSummary[_0x88a2('0x47')][_0x88a2('0x5a')]=function(_0x4d4e72){this['answered']=_0x4d4e72[_0x88a2('0x16')];this[_0x88a2('0x43')]=_0x4d4e72['message'];this[_0x88a2('0x44')]=_0x4d4e72[_0x88a2('0x44')];this[_0x88a2('0x8')]=_0x4d4e72[_0x88a2('0x8')];this[_0x88a2('0x9')]=_0x4d4e72[_0x88a2('0x9')];this[_0x88a2('0x2b')]=_0x4d4e72['outboundAnswerCallsDay'];this[_0x88a2('0xa')]=_0x4d4e72[_0x88a2('0xa')];this[_0x88a2('0x2c')]=_0x4d4e72['outboundBusyCallsDay'];this['outboundCongestionCallsDay']=_0x4d4e72['outboundCongestionCallsDay'];this[_0x88a2('0xc')]=_0x4d4e72[_0x88a2('0xc')];this[_0x88a2('0xd')]=_0x4d4e72['outboundNoSuchCallsDay'];this[_0x88a2('0xe')]=_0x4d4e72[_0x88a2('0xe')];this[_0x88a2('0xf')]=_0x4d4e72[_0x88a2('0xf')];this[_0x88a2('0x10')]=_0x4d4e72[_0x88a2('0x10')];this['sumBillable']=_0x4d4e72['sumBillable'];this[_0x88a2('0x1d')]=_0x4d4e72['sumDuration'];this['total']=_0x4d4e72[_0x88a2('0x12')];if(this[_0x88a2('0x24')]===_0x88a2('0x5b')){this[_0x88a2('0x11')]=_0x4d4e72[_0x88a2('0x11')];}};module['exports']=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 3d1ef65..4478688 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 _0x983e=['remoteUri','serverUrl','Configurations','exports','name','username','accessKey'];(function(_0x209829,_0x1b9431){var _0x53ac9c=function(_0x31e652){while(--_0x31e652){_0x209829['push'](_0x209829['shift']());}};_0x53ac9c(++_0x1b9431);}(_0x983e,0xc1));var _0xe983=function(_0x55e686,_0x354988){_0x55e686=_0x55e686-0x0;var _0x339764=_0x983e[_0x55e686];return _0x339764;};'use strict';function VtigerAccount(_0x493fe5){this['id']=_0x493fe5['id']||0x0;this[_0xe983('0x0')]=_0x493fe5[_0xe983('0x0')]||'';this[_0xe983('0x1')]=_0x493fe5['username']||'';this[_0xe983('0x2')]=_0x493fe5[_0xe983('0x2')]||'';this[_0xe983('0x3')]=_0x493fe5[_0xe983('0x3')]||'';this[_0xe983('0x4')]=_0x493fe5['serverUrl']||'';this[_0xe983('0x5')]=_0x493fe5[_0xe983('0x5')]||{};}module[_0xe983('0x6')]=VtigerAccount; \ No newline at end of file +var _0x17a4=['exports','name','username','remoteUri','serverUrl','Configurations'];(function(_0x31e04c,_0x13b624){var _0x180fe0=function(_0x18a799){while(--_0x18a799){_0x31e04c['push'](_0x31e04c['shift']());}};_0x180fe0(++_0x13b624);}(_0x17a4,0x1c3));var _0x417a=function(_0x1deee5,_0x1d4485){_0x1deee5=_0x1deee5-0x0;var _0x1d6c3a=_0x17a4[_0x1deee5];return _0x1d6c3a;};'use strict';function VtigerAccount(_0x287bf2){this['id']=_0x287bf2['id']||0x0;this[_0x417a('0x0')]=_0x287bf2['name']||'';this[_0x417a('0x1')]=_0x287bf2[_0x417a('0x1')]||'';this['accessKey']=_0x287bf2['accessKey']||'';this[_0x417a('0x2')]=_0x287bf2['remoteUri']||'';this[_0x417a('0x3')]=_0x287bf2['serverUrl']||'';this[_0x417a('0x4')]=_0x287bf2[_0x417a('0x4')]||{};}module[_0x417a('0x5')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index b960d3e..5d46c55 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 _0x729c=['token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x729c,0x1aa));var _0xc729=function(_0x2ce37c,_0x415bc3){_0x2ce37c=_0x2ce37c-0x0;var _0x44e3f4=_0x729c[_0x2ce37c];return _0x44e3f4;};'use strict';function ZendeskAccount(_0xcbd8f4){this['id']=_0xcbd8f4['id']||0x0;this[_0xc729('0x0')]=_0xcbd8f4[_0xc729('0x0')]||'';this[_0xc729('0x1')]=_0xcbd8f4['username']||'';this[_0xc729('0x2')]=_0xcbd8f4[_0xc729('0x2')]||'';this[_0xc729('0x3')]=_0xcbd8f4[_0xc729('0x3')]||'';this[_0xc729('0x4')]=_0xcbd8f4[_0xc729('0x4')]||'';this['authType']=_0xcbd8f4[_0xc729('0x5')]||'';this[_0xc729('0x6')]=_0xcbd8f4[_0xc729('0x6')]||_0xc729('0x7');this[_0xc729('0x8')]=_0xcbd8f4['serverUrl']||'';this[_0xc729('0x9')]=_0xcbd8f4[_0xc729('0x9')]||{};}module[_0xc729('0xa')]=ZendeskAccount; \ No newline at end of file +var _0xbf15=['type','integrationTab','serverUrl','Configurations','name','username','password','token','remoteUri','authType'];(function(_0x319c6d,_0x1f438d){var _0x60a159=function(_0x994e95){while(--_0x994e95){_0x319c6d['push'](_0x319c6d['shift']());}};_0x60a159(++_0x1f438d);}(_0xbf15,0xf4));var _0x5bf1=function(_0x33cb69,_0x50a97d){_0x33cb69=_0x33cb69-0x0;var _0x346ce9=_0xbf15[_0x33cb69];return _0x346ce9;};'use strict';function ZendeskAccount(_0x3c2105){this['id']=_0x3c2105['id']||0x0;this[_0x5bf1('0x0')]=_0x3c2105[_0x5bf1('0x0')]||'';this[_0x5bf1('0x1')]=_0x3c2105[_0x5bf1('0x1')]||'';this[_0x5bf1('0x2')]=_0x3c2105['password']||'';this[_0x5bf1('0x3')]=_0x3c2105['token']||'';this[_0x5bf1('0x4')]=_0x3c2105['remoteUri']||'';this[_0x5bf1('0x5')]=_0x3c2105[_0x5bf1('0x5')]||'';this[_0x5bf1('0x6')]=_0x3c2105[_0x5bf1('0x6')]||_0x5bf1('0x7');this[_0x5bf1('0x8')]=_0x3c2105[_0x5bf1('0x8')]||'';this[_0x5bf1('0x9')]=_0x3c2105[_0x5bf1('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 621221c..8376d2f 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 _0x6568=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports'];(function(_0x3c59b5,_0x40975c){var _0x40a8a1=function(_0x2c38c8){while(--_0x2c38c8){_0x3c59b5['push'](_0x3c59b5['shift']());}};_0x40a8a1(++_0x40975c);}(_0x6568,0x1ef));var _0x8656=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x6568[_0x1928c9];return _0x51b5fb;};'use strict';function ZohoAccount(_0x4eecae){this['id']=_0x4eecae['id']||0x0;this[_0x8656('0x0')]=_0x4eecae[_0x8656('0x0')]||'';this[_0x8656('0x1')]=_0x4eecae['description']||'';this['host']=_0x4eecae[_0x8656('0x2')]||'';this[_0x8656('0x3')]=_0x4eecae[_0x8656('0x3')]||'';this['clientId']=_0x4eecae[_0x8656('0x4')]||'';this[_0x8656('0x5')]=_0x4eecae[_0x8656('0x5')]||'';this[_0x8656('0x6')]=_0x4eecae[_0x8656('0x6')]||'';this['code']=_0x4eecae[_0x8656('0x7')]||'';this[_0x8656('0x8')]=_0x4eecae[_0x8656('0x8')]||'';this[_0x8656('0x9')]=_0x4eecae['Configurations']||{};}module[_0x8656('0xa')]=ZohoAccount; \ No newline at end of file +var _0x969a=['Configurations','name','description','host','zone','clientId','clientSecret','serverUrl','refreshToken'];(function(_0x4df1f5,_0x39c6d2){var _0x56585b=function(_0x287b6e){while(--_0x287b6e){_0x4df1f5['push'](_0x4df1f5['shift']());}};_0x56585b(++_0x39c6d2);}(_0x969a,0x7f));var _0xa969=function(_0x1d3076,_0x1c644d){_0x1d3076=_0x1d3076-0x0;var _0x58bd7c=_0x969a[_0x1d3076];return _0x58bd7c;};'use strict';function ZohoAccount(_0x25248e){this['id']=_0x25248e['id']||0x0;this['name']=_0x25248e[_0xa969('0x0')]||'';this[_0xa969('0x1')]=_0x25248e[_0xa969('0x1')]||'';this[_0xa969('0x2')]=_0x25248e['host']||'';this[_0xa969('0x3')]=_0x25248e[_0xa969('0x3')]||'';this['clientId']=_0x25248e[_0xa969('0x4')]||'';this['clientSecret']=_0x25248e[_0xa969('0x5')]||'';this['serverUrl']=_0x25248e[_0xa969('0x6')]||'';this['code']=_0x25248e['code']||'';this[_0xa969('0x7')]=_0x25248e[_0xa969('0x7')]||'';this[_0xa969('0x8')]=_0x25248e['Configurations']||{};}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 4fa1d90..e786548 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 _0x3d04=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','idContact','queue','name','type','dialAnswer','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry'];(function(_0x3c27e7,_0x471b30){var _0x8c50bd=function(_0xccfaee){while(--_0xccfaee){_0x3c27e7['push'](_0x3c27e7['shift']());}};_0x8c50bd(++_0x471b30);}(_0x3d04,0xbe));var _0x43d0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3d04[_0x501510];return _0x1e6ee5;};'use strict';var util=require(_0x43d0('0x0'));var _=require(_0x43d0('0x1'));var moment=require(_0x43d0('0x2'));function checkNameSurname(_0x105c73,_0x191de5,_0x143fea){var _0x3d6e62='';if(!_[_0x43d0('0x3')](_0x191de5)&&'string'===typeof _0x191de5){_0x3d6e62+=_0x191de5;}if(!_[_0x43d0('0x3')](_0x143fea)&&_0x43d0('0x4')===typeof _0x143fea){_0x3d6e62+='\x20'+_0x143fea;}if(_0x3d6e62!==''){return _0x3d6e62;}return _0x105c73;}function Action(_0x746f5e,_0x617bf,_0x5e284f,_0x484271,_0x50919e){this['uniqueid']=_0x5e284f||undefined;this[_0x43d0('0x5')]=_0x746f5e['id'];this[_0x43d0('0x6')]=_0x617bf[_0x43d0('0x7')];this[_0x43d0('0x8')]=_0x617bf[_0x43d0('0x8')];this['campaigntype']='queue';this[_0x43d0('0x9')]=![];this['membername']=_['isNil'](_0x746f5e[_0x43d0('0xa')])?undefined:_0x746f5e[_0x43d0('0xa')][_0x43d0('0x7')];this[_0x43d0('0xb')]=this['membername']?util[_0x43d0('0xc')](_0x43d0('0xd'),this['membername']):_0x484271||undefined;this[_0x43d0('0xe')]=checkNameSurname(_0x746f5e[_0x43d0('0xf')][_0x43d0('0x10')],_0x746f5e['Contact'][_0x43d0('0x11')],_0x746f5e[_0x43d0('0xf')][_0x43d0('0x12')]);this['active']=_0x746f5e[_0x43d0('0x13')]||![];this[_0x43d0('0x14')]=_0x746f5e[_0x43d0('0x10')];this[_0x43d0('0x15')]=_0x746f5e[_0x43d0('0x15')];this['countbusyretry']=_0x746f5e['countbusyretry']||0x0;this[_0x43d0('0x16')]=_0x746f5e[_0x43d0('0x16')]||0x0;this[_0x43d0('0x17')]=_0x746f5e['countnoanswerretry']||0x0;this[_0x43d0('0x18')]=(_0x746f5e['countbusyretry']||0x0)+(_0x746f5e[_0x43d0('0x16')]||0x0)+(_0x746f5e[_0x43d0('0x17')]||0x0)+(_0x746f5e[_0x43d0('0x19')]||0x0)+(_0x746f5e['countdropretry']||0x0)+(_0x746f5e[_0x43d0('0x1a')]||0x0)+(_0x746f5e[_0x43d0('0x1b')]||0x0)+(_0x746f5e['countagentrejectretry']||0x0);this[_0x43d0('0x19')]=_0x746f5e[_0x43d0('0x19')]||0x0;this[_0x43d0('0x1c')]=_0x746f5e[_0x43d0('0x1c')]||0x0;this[_0x43d0('0x1a')]=_0x746f5e[_0x43d0('0x1a')]||0x0;this[_0x43d0('0x1b')]=_0x746f5e[_0x43d0('0x1b')]||0x0;this[_0x43d0('0x1d')]=_0x746f5e[_0x43d0('0x1d')]||0x0;this[_0x43d0('0x1e')]=_0x746f5e[_0x43d0('0x1e')];this[_0x43d0('0x1f')]=_0x746f5e[_0x43d0('0x1f')];this[_0x43d0('0x20')]=_0x746f5e['callbackat'];this[_0x43d0('0x21')]=_0x746f5e[_0x43d0('0x21')];this['ContactId']=_0x746f5e[_0x43d0('0x22')];this['ListId']=_0x746f5e[_0x43d0('0x23')];this[_0x43d0('0x24')]=_['isNil'](_0x746f5e[_0x43d0('0xa')])?_0x746f5e[_0x43d0('0x24')]:_0x746f5e['Agent']['id'];this[_0x43d0('0x25')]=_0x746f5e[_0x43d0('0x25')];this[_0x43d0('0x26')]='';this['originatecalleridname']='';}Action[_0x43d0('0x27')][_0x43d0('0x28')]=function(){return util[_0x43d0('0xc')](_0x43d0('0x29'),this[_0x43d0('0xe')],this[_0x43d0('0x2a')]);};module[_0x43d0('0x2b')]=Action; \ No newline at end of file +var _0x4213=['name','type','dialAnswer','isNil','Agent','channelAgent','membername','format','calleridname','Contact','phone','firstName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','number','util','lodash','moment','string','uniqueid','idContact','queue'];(function(_0x11b461,_0x4f7af9){var _0x30c380=function(_0x2a83d8){while(--_0x2a83d8){_0x11b461['push'](_0x11b461['shift']());}};_0x30c380(++_0x4f7af9);}(_0x4213,0x77));var _0x3421=function(_0x558459,_0x31a993){_0x558459=_0x558459-0x0;var _0x162862=_0x4213[_0x558459];return _0x162862;};'use strict';var util=require(_0x3421('0x0'));var _=require(_0x3421('0x1'));var moment=require(_0x3421('0x2'));function checkNameSurname(_0x7870a4,_0x2613b6,_0x153f3a){var _0x1bab18='';if(!_['isNil'](_0x2613b6)&&_0x3421('0x3')===typeof _0x2613b6){_0x1bab18+=_0x2613b6;}if(!_['isNil'](_0x153f3a)&&_0x3421('0x3')===typeof _0x153f3a){_0x1bab18+='\x20'+_0x153f3a;}if(_0x1bab18!==''){return _0x1bab18;}return _0x7870a4;}function Action(_0xfe969c,_0x2155f8,_0x2a04e0,_0x5469d8,_0x50e464){this[_0x3421('0x4')]=_0x2a04e0||undefined;this[_0x3421('0x5')]=_0xfe969c['id'];this[_0x3421('0x6')]=_0x2155f8[_0x3421('0x7')];this['type']=_0x2155f8[_0x3421('0x8')];this['campaigntype']='queue';this[_0x3421('0x9')]=![];this['membername']=_[_0x3421('0xa')](_0xfe969c[_0x3421('0xb')])?undefined:_0xfe969c[_0x3421('0xb')][_0x3421('0x7')];this[_0x3421('0xc')]=this[_0x3421('0xd')]?util[_0x3421('0xe')]('SIP/%s',this[_0x3421('0xd')]):_0x5469d8||undefined;this[_0x3421('0xf')]=checkNameSurname(_0xfe969c[_0x3421('0x10')][_0x3421('0x11')],_0xfe969c[_0x3421('0x10')][_0x3421('0x12')],_0xfe969c[_0x3421('0x10')]['lastName']);this[_0x3421('0x13')]=_0xfe969c['active']||![];this[_0x3421('0x14')]=_0xfe969c[_0x3421('0x11')];this['scheduledat']=_0xfe969c[_0x3421('0x15')];this['countbusyretry']=_0xfe969c[_0x3421('0x16')]||0x0;this[_0x3421('0x17')]=_0xfe969c['countcongestionretry']||0x0;this[_0x3421('0x18')]=_0xfe969c[_0x3421('0x18')]||0x0;this[_0x3421('0x19')]=(_0xfe969c[_0x3421('0x16')]||0x0)+(_0xfe969c[_0x3421('0x17')]||0x0)+(_0xfe969c[_0x3421('0x18')]||0x0)+(_0xfe969c[_0x3421('0x1a')]||0x0)+(_0xfe969c[_0x3421('0x1b')]||0x0)+(_0xfe969c[_0x3421('0x1c')]||0x0)+(_0xfe969c[_0x3421('0x1d')]||0x0)+(_0xfe969c[_0x3421('0x1e')]||0x0);this['countnosuchnumberretry']=_0xfe969c[_0x3421('0x1a')]||0x0;this['countdropretry']=_0xfe969c['countdropretry']||0x0;this['countabandonedretry']=_0xfe969c[_0x3421('0x1c')]||0x0;this[_0x3421('0x1d')]=_0xfe969c[_0x3421('0x1d')]||0x0;this[_0x3421('0x1e')]=_0xfe969c[_0x3421('0x1e')]||0x0;this[_0x3421('0x1f')]=_0xfe969c[_0x3421('0x1f')];this[_0x3421('0x20')]=_0xfe969c[_0x3421('0x20')];this[_0x3421('0x21')]=_0xfe969c['callbackat'];this['recallme']=_0xfe969c['recallme'];this[_0x3421('0x22')]=_0xfe969c[_0x3421('0x22')];this[_0x3421('0x23')]=_0xfe969c['ListId'];this['UserId']=_[_0x3421('0xa')](_0xfe969c['Agent'])?_0xfe969c[_0x3421('0x24')]:_0xfe969c['Agent']['id'];this[_0x3421('0x25')]=_0xfe969c[_0x3421('0x25')];this[_0x3421('0x26')]='';this[_0x3421('0x27')]='';}Action[_0x3421('0x28')]['getCaller']=function(){return util[_0x3421('0xe')]('\x22%s\x22\x20<%s>',this['calleridname'],this[_0x3421('0x29')]);};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 1c2ef5c..f74415a 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 _0x4b84=['countbusyretry','scheduledAt','unlockAgent','idContact','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','outboundAbandonedCallsDay','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','countmachineretry','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','loggerError','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','checkInBlack','Contact\x20is\x20undefined','lookAgent','execCall','Queue:\x20','custom:agentcalled','[Preview][execCall][failure]','logBlacklist','createHistory','active','SIP/%s','format','reachable','unmonitored','execRun','getContactPreview','recallme','validateContact','checkIsBlackList','phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','isEmpty','logger','[Preview][validateContact][Empty\x20Contact]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','dialOriginateCallerIdNumber','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','addVariables','toLowerVariables','variables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','isFailure','response','unlockContact','custom:agentringnoanswer','rejected','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','isUndefined','transfer','[syncHangup][talking][transfer]','destuniqueid','filterKey','keys','variable','addVariable','value','error','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','ioredis','preview','../../../config/logger','actionPreview','./action','../dialer/utils','defaults','socket.io-emitter','redis','prototype','tail','finally','sequence','voiceQueues','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','syncHangup','bind','hanguprequest','syncHangupRequest','syncNewExten','syncVarSet','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','campaignsPreview','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','pTalking','available','paused','message','INACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','CAMPAIGN_STATUS','DEACTIVATED','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','enqueue','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','originated','pTalking:\x20','pick','contactId','UserId','VoiceQueueId','ListId','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','loggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','Trunk','TrunkBackup','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','activeContact','actioncountonusuch','incrementPreviewCounters','swapAdditionalPhones','ANSWER','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','custom:agentcomplete','complete','total','answered','[16]','countglobal','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','linkedid','BUSY','dialBusyRetryFrequency','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','Global','[callProgressDetectingCustomer][logBusyGlobal]'];(function(_0x29aa1e,_0x1212fe){var _0x3c3934=function(_0x118d61){while(--_0x118d61){_0x29aa1e['push'](_0x29aa1e['shift']());}};_0x3c3934(++_0x1212fe);}(_0x4b84,0x1cc));var _0x44b8=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x4b84[_0x1d9aa0];return _0x226868;};'use strict';var util=require(_0x44b8('0x0'));var _=require(_0x44b8('0x1'));var uuid=require('uuid');var moment=require('moment');var Redis=require(_0x44b8('0x2'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x44b8('0x3'));var loggerAction=require(_0x44b8('0x4'))(_0x44b8('0x5'));var ami=require('../ami');var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x44b8('0x6'));var ut=require('./util/util');var utils=require(_0x44b8('0x7'));config['redis']=_[_0x44b8('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x44b8('0x9'))(new Redis(config[_0x44b8('0xa')]));var Sequence=function(){};Sequence[_0x44b8('0xb')]['enqueue']=function(_0xc650ec){this[_0x44b8('0xc')]=this[_0x44b8('0xc')]?this[_0x44b8('0xc')][_0x44b8('0xd')](_0xc650ec):_0xc650ec();};function Preview(_0x37e471){this[_0x44b8('0xe')]=new Sequence();this['campaignsPreview']=_0x37e471[_0x44b8('0xf')];this[_0x44b8('0x10')]=_0x37e471['trunks'];this[_0x44b8('0x11')]={};this['agents']=_0x37e471[_0x44b8('0x12')];this[_0x44b8('0x13')]=0x0;ami['on']('originateresponse',this[_0x44b8('0x14')]['bind'](this));ami['on']('hangup',this[_0x44b8('0x15')][_0x44b8('0x16')](this));ami['on'](_0x44b8('0x17'),this[_0x44b8('0x18')]['bind'](this));ami['on']('dialend',this['syncDialEnd'][_0x44b8('0x16')](this));ami['on']('newexten',this[_0x44b8('0x19')][_0x44b8('0x16')](this));ami['on']('varset',this[_0x44b8('0x1a')][_0x44b8('0x16')](this));ami['on']('attendedtransfer',this[_0x44b8('0x1b')][_0x44b8('0x16')](this));ami['on']('blindtransfer',this[_0x44b8('0x1c')][_0x44b8('0x16')](this));this[_0x44b8('0x1d')](this[_0x44b8('0x1e')]);}function emit(_0x102ef9,_0x369c09,_0x452f2f){io['to'](_0x102ef9)[_0x44b8('0x1f')](_0x369c09,_0x452f2f);}function emitVoiceQueueChannelRemove(_0x429461){logger[_0x44b8('0x20')](_0x44b8('0x21'),JSON[_0x44b8('0x22')](_0x429461));emit(util['format'](_0x44b8('0x23'),_0x429461[_0x44b8('0x24')]),_0x44b8('0x25'),_0x429461);io[_0x44b8('0x1f')](_0x44b8('0x26'),_0x429461);}function notSendMessagesQueue(_0x51a34a){if(_0x51a34a[_0x44b8('0x27')]){if(_0x51a34a['originated']===0x0&&_0x51a34a[_0x44b8('0x28')]===0x0){_0x51a34a[_0x44b8('0x27')]=![];_0x51a34a[_0x44b8('0x29')]=0x0;_0x51a34a[_0x44b8('0x2a')]=0x0;_0x51a34a[_0x44b8('0x2b')]=utils['CAMPAIGN_STATUS'][_0x44b8('0x2c')];ut['logger'](_0x44b8('0x2d'),_0x51a34a[_0x44b8('0x24')]+'\x20is\x20not\x20active');}else{_0x51a34a[_0x44b8('0x2b')]=utils[_0x44b8('0x2e')][_0x44b8('0x2f')];ut['logger'](_0x44b8('0x2d'),_0x51a34a[_0x44b8('0x24')]+'\x20is\x20deactivated');}}}Preview[_0x44b8('0xb')]['loopCampaigns']=function(){var _0xfb0028=this;setInterval(function(){_0xfb0028['syncCampaigns']();},0x7cf);};Preview['prototype']['syncCampaigns']=function(){var _0x387293=this[_0x44b8('0x1e')];this[_0x44b8('0x13')]+=0x1;for(var _0x1bd1be in _0x387293){if(_0x387293[_0x44b8('0x30')](_0x1bd1be)&&(_0x387293[_0x1bd1be][_0x44b8('0x31')]===_0x44b8('0x3')||_0x387293[_0x1bd1be][_0x44b8('0x31')]===_0x44b8('0x32'))&&_0x387293[_0x1bd1be][_0x44b8('0x33')]===_0x44b8('0x34')){if(this[_0x44b8('0x13')]>0x7){this[_0x44b8('0x13')]=0x0;this['clearZombieChannels']();}}if(_0x387293[_0x44b8('0x30')](_0x1bd1be)&&_0x387293[_0x1bd1be]['dialMethod']===_0x44b8('0x3')&&_0x387293[_0x1bd1be][_0x44b8('0x33')]===_0x44b8('0x34')){if(_0x387293[_0x1bd1be][_0x44b8('0x35')]){this[_0x44b8('0x36')](_0x387293[_0x1bd1be]);if(_0x387293[_0x1bd1be]['dialPreviewAutoRecallMe'])this[_0x44b8('0x37')](_0x387293[_0x1bd1be]);}else{notSendMessagesQueue(_0x387293[_0x1bd1be]);}}}};Preview[_0x44b8('0xb')][_0x44b8('0x38')]=function(_0x339f0f){var _0x46b008=this;this['sequence'][_0x44b8('0x39')](function(){if(!_[_0x44b8('0x3a')](_0x46b008[_0x44b8('0x11')][_0x339f0f])){loggerAction[_0x44b8('0x20')](_0x44b8('0x3b'),_0x339f0f,_0x44b8('0x3c'),_0x46b008[_0x44b8('0x11')][_0x339f0f][_0x44b8('0x3d')],_0x44b8('0x3e'),JSON[_0x44b8('0x22')](_0x46b008[_0x44b8('0x1e')][_0x46b008[_0x44b8('0x11')][_0x339f0f][_0x44b8('0x3d')]][_0x44b8('0x3f')]),_0x44b8('0x40'),JSON[_0x44b8('0x22')](_0x46b008[_0x44b8('0x1e')][_0x46b008[_0x44b8('0x11')][_0x339f0f][_0x44b8('0x3d')]][_0x44b8('0x28')]),JSON[_0x44b8('0x22')](_0x46b008[_0x44b8('0x11')][_0x339f0f]['dialAnswer']),JSON[_0x44b8('0x22')](_[_0x44b8('0x41')](_0x46b008['actions'][_0x339f0f],[_0x44b8('0x42'),_0x44b8('0x43'),_0x44b8('0x44'),_0x44b8('0x45')])));return ami['Action']({'action':_0x44b8('0x46'),'channel':_0x46b008[_0x44b8('0x11')][_0x339f0f][_0x44b8('0x47')]})[_0x44b8('0x48')](function(_0x9cb2a){if(_0x9cb2a[_0x44b8('0x2b')]===_0x44b8('0x49')){setTimeout(function(){if(_0x46b008[_0x44b8('0x11')][_0x339f0f]){ut[_0x44b8('0x4a')](_0x46b008[_0x44b8('0x1e')][_0x46b008[_0x44b8('0x11')][_0x339f0f][_0x44b8('0x3d')]],_0x44b8('0x4b'));if(_0x46b008[_0x44b8('0x11')][_0x339f0f][_0x44b8('0x4c')]===!![]){ut[_0x44b8('0x4d')](_0x46b008['campaignsPreview'][_0x46b008[_0x44b8('0x11')][_0x339f0f][_0x44b8('0x3d')]],_0x44b8('0x4b'));ut['loggerError'](_0x44b8('0x4e')+_0x339f0f,_0x46b008[_0x44b8('0x11')][_0x339f0f][_0x44b8('0x3d')]);}ut['loggerError'](_0x44b8('0x4f')+_0x339f0f,_0x46b008[_0x44b8('0x11')][_0x339f0f][_0x44b8('0x3d')]);delete _0x46b008[_0x44b8('0x11')][_0x339f0f];}},0x2328);}});}});};Preview[_0x44b8('0xb')]['clearZombieChannels']=function(){var _0x5ae5f9=this;loggerAction[_0x44b8('0x20')](_0x44b8('0x50'),_[_0x44b8('0x51')](this[_0x44b8('0x11')]));for(var _0x43906b in this[_0x44b8('0x11')]){if(_0x5ae5f9[_0x44b8('0x11')][_0x44b8('0x30')](_0x43906b)){_0x5ae5f9[_0x44b8('0x38')](_0x43906b);}}};Preview[_0x44b8('0xb')][_0x44b8('0x37')]=function(_0x2a9b2a){var _0xc1b9de=this;rpcDb[_0x44b8('0x52')](_0x2a9b2a['id'],ut[_0x44b8('0x53')](this[_0x44b8('0x12')]))[_0x44b8('0x54')](function(_0x3b3d5d){if(!_[_0x44b8('0x3a')](_0x3b3d5d)){for(var _0x49c507=0x0;_0x49c507<_0x3b3d5d['length'];_0x49c507+=0x1){if(ut[_0x44b8('0x55')](_0x3b3d5d[_0x49c507][_0x44b8('0x56')])<_0x2a9b2a[_0x44b8('0x57')]*0x3c){if(_0x3b3d5d[_0x49c507][_0x44b8('0x58')]&&!_0x3b3d5d[_0x49c507][_0x44b8('0x58')][_0x44b8('0x59')]){_0xc1b9de[_0x44b8('0x5a')](_0x3b3d5d[_0x49c507]['id'])['then'](ut[_0x44b8('0x5b')]('[RecallMe]'))[_0x44b8('0x48')](ut[_0x44b8('0x5b')](_0x44b8('0x5c')));}else{rpcDb[_0x44b8('0x5d')](_0x3b3d5d[_0x49c507]['id']);}}else{var _0x103d57=new Action(_0x3b3d5d[_0x49c507],_0x2a9b2a);_0x103d57[_0x44b8('0x5e')]=moment()['format'](_0x44b8('0x5f'));_0x2a9b2a[_0x44b8('0x60')]+=0x1;ut[_0x44b8('0x61')](_0x103d57,0x17,_0x44b8('0x62'));if(_0x2a9b2a['dialRecallInQueue']){rpcDb[_0x44b8('0x63')](ut[_0x44b8('0x64')](_0x3b3d5d[_0x49c507]));rpcDb[_0x44b8('0x65')](_0x103d57,_0x44b8('0x66'));}else{ut[_0x44b8('0x61')](_0x103d57,0x16,_0x44b8('0x67'));rpcDb['createCustomerHistory'](_0x103d57,_0x44b8('0x68'));rpcDb[_0x44b8('0x69')](_0x103d57,_0x44b8('0x68'));}}}}})[_0x44b8('0x48')](ut[_0x44b8('0x5b')]('[getContactRecallMe]'));};Preview['prototype'][_0x44b8('0x36')]=function(_0x4eb344){_0x4eb344[_0x44b8('0x27')]=!![];if(ut['IsNotLoggedIn'](_0x4eb344[_0x44b8('0x6a')])){_0x4eb344[_0x44b8('0x2b')]=utils[_0x44b8('0x2e')][_0x44b8('0x6b')];}else if(!ut[_0x44b8('0x6c')](_0x4eb344[_0x44b8('0x35')])){_0x4eb344[_0x44b8('0x2b')]=utils['CAMPAIGN_STATUS'][_0x44b8('0x2c')];}else if(!this[_0x44b8('0x6d')](_0x4eb344[_0x44b8('0x6e')])){if(!this['isTrunkReachable'](_0x4eb344[_0x44b8('0x6f')])){_0x4eb344[_0x44b8('0x2b')]=utils[_0x44b8('0x2e')][_0x44b8('0x70')];}else{_0x4eb344['message']=utils[_0x44b8('0x2e')][_0x44b8('0x71')];}}else{_0x4eb344['message']=utils[_0x44b8('0x2e')][_0x44b8('0x71')];}};Preview[_0x44b8('0xb')][_0x44b8('0x72')]=function(_0xe86e34,_0x546a50,_0x5b99a3){var _0xc181d2=this;var _0x3154bc=this[_0x44b8('0x11')][_0x546a50];var _0x4358aa=this[_0x44b8('0x1e')][_0x3154bc[_0x44b8('0x3d')]];var _0x3c9534;var _0xf0fb0d=![];var _0x10bbd9=0x2;var _0xdff81b=0x3;if(_0x4358aa){switch(_0x5b99a3){case'1':_0x4358aa[_0x44b8('0x73')]+=0x1;_0x3154bc[_0x44b8('0x74')]+=0x1;_0x3154bc['countglobal']=ut[_0x44b8('0x75')](_0x3154bc);ut[_0x44b8('0x61')](_0x3154bc,0x0,_0x44b8('0x76'));ami[_0x44b8('0x1f')](_0x44b8('0x77'),ut[_0x44b8('0x78')](_0x3154bc,_0x44b8('0x79')));rpcDb[_0x44b8('0x65')](_0x3154bc,_0x44b8('0x7a'));_0xc181d2[_0x44b8('0x7b')](_0x3154bc,'0',_0x4358aa)[_0x44b8('0x54')](function(_0x15bcba){_0xf0fb0d=_0x15bcba[_0x44b8('0x7c')]==0x1;_0x10bbd9=_0x4358aa[_0x44b8('0x7d')];_0xdff81b=_0x4358aa[_0x44b8('0x7e')];if(!_0xf0fb0d){if(ut[_0x44b8('0x75')](_0x3154bc)>=_0x4358aa[_0x44b8('0x7f')]){_0x3c9534=ut[_0x44b8('0x80')](_0x3154bc,0xf,'Global');rpcDb[_0x44b8('0x69')](_0x3c9534,_0x44b8('0x81'));}else{if(_0x3154bc[_0x44b8('0x74')]>=_0x4358aa[_0x44b8('0x82')]){rpcDb[_0x44b8('0x69')](_0x3154bc,_0x44b8('0x81'));}else{rpcDb[_0x44b8('0x83')](ut['scheduledAt'](_0x3154bc,_0x44b8('0x74'),_0x4358aa[_0x44b8('0x7d')]),_0x3154bc['unlockAgent'],_0x3154bc[_0x44b8('0x84')]);}}delete this[_0x44b8('0x11')][_0xe86e34['linkedid']];}else{_0x3154bc[_0x44b8('0x74')]++;logger[_0x44b8('0x20')](_0x44b8('0x85'),_0x3154bc['countnosuchnumberretry']);logger[_0x44b8('0x20')]('id',_0x3154bc['idContact']);_0xc181d2[_0x44b8('0x86')]({'id':_0x3154bc['idContact'],'field':{'countnosuchnumberretry':_0x3154bc[_0x44b8('0x74')]}})[_0x44b8('0x54')](function(){_0xc181d2[_0x44b8('0x87')](_0x3154bc,_0x10bbd9,_0xdff81b)[_0x44b8('0x54')](function(){});});}});break;case _0x44b8('0x88'):var _0x230b6a=moment()['format'](_0x44b8('0x5f'));_0x3154bc['responsetime']=_0x230b6a;_0x3154bc[_0x44b8('0x89')]=_0x230b6a;_0x3154bc[_0x44b8('0x4c')]=!![];_0x4358aa['pTalking']+=0x1;logger[_0x44b8('0x20')](_0x44b8('0x8a'),_0x3154bc[_0x44b8('0x8b')],_0x44b8('0x8c'),_0x4358aa[_0x44b8('0x24')],_0x44b8('0x40'),_0x4358aa[_0x44b8('0x28')]);ami[_0x44b8('0x1f')](_0x44b8('0x8d'),ut[_0x44b8('0x78')](_0x3154bc,_0x44b8('0x8e'),this[_0x44b8('0x1e')][_0x3154bc['queue']]));if(_0x4358aa[_0x44b8('0x8f')]){ami[_0x44b8('0x1f')](_0x44b8('0x90'),ut['buildAcw'](_0x3154bc));}break;case'16':ami[_0x44b8('0x1f')](_0x44b8('0x91'),ut['buildObj'](_0x3154bc,_0x44b8('0x92'),this[_0x44b8('0x1e')][_0x3154bc[_0x44b8('0x3d')]]));emitVoiceQueueChannelRemove(ut[_0x44b8('0x78')](_0x3154bc,_0x44b8('0x92')));_0x4358aa['outboundAnswerCallsDay']+=0x1;_0x4358aa[_0x44b8('0x93')]+=0x1;_0x4358aa[_0x44b8('0x94')]+=0x1;ut[_0x44b8('0x4d')](_0x4358aa,_0x44b8('0x95'));_0x3154bc[_0x44b8('0x96')]=ut[_0x44b8('0x75')](_0x3154bc);ut[_0x44b8('0x61')](_0x3154bc,0x4,_0x44b8('0x97'));rpcDb['createCustomerHistory'](_0x3154bc,_0x44b8('0x98'));rpcDb[_0x44b8('0x69')](_0x3154bc,_0x44b8('0x99'));rpcDb[_0x44b8('0x9a')](_0x3154bc);_0x4358aa['sumDuration']+=_0x3154bc['talktime'];_0x4358aa['sumBillable']+=_0x3154bc[_0x44b8('0x9b')];logger[_0x44b8('0x20')](_0x44b8('0x9c'),_0x3154bc[_0x44b8('0x8b')],_0x44b8('0x8c'),_0x4358aa['name'],_0x44b8('0x40'),_0x4358aa['pTalking']);delete this[_0x44b8('0x11')][_0xe86e34[_0x44b8('0x9d')]];break;case _0x44b8('0x9e'):_0x4358aa['outboundBusyCallsDay']+=0x1;_0x3154bc['countbusyretry']+=0x1;_0x3154bc[_0x44b8('0x96')]=ut[_0x44b8('0x75')](_0x3154bc);ut[_0x44b8('0x61')](_0x3154bc,0x5,'Busy');_0x10bbd9=_0x4358aa[_0x44b8('0x9f')];_0xdff81b=_0x4358aa[_0x44b8('0x7e')];ami[_0x44b8('0x1f')](_0x44b8('0xa0'),ut[_0x44b8('0x78')](_0x3154bc,'busy'));rpcDb[_0x44b8('0x65')](_0x3154bc,_0x44b8('0xa1'));_0xc181d2[_0x44b8('0x7b')](_0x3154bc,'5',_0x4358aa)[_0x44b8('0x54')](function(_0x220f1b){_0xf0fb0d=_0x220f1b['additional']==0x1;if(!_0xf0fb0d){if(ut[_0x44b8('0x75')](_0x3154bc)>=_0x4358aa[_0x44b8('0x7f')]){_0x3c9534=ut[_0x44b8('0x80')](_0x3154bc,0xf,_0x44b8('0xa2'));rpcDb[_0x44b8('0x69')](_0x3c9534,_0x44b8('0xa3'));}else{if(_0x3154bc[_0x44b8('0xa4')]>=_0x4358aa['dialBusyMaxRetry']){rpcDb[_0x44b8('0x69')](_0x3154bc,_0x44b8('0xa1'));}else{rpcDb['rescheduleContact'](ut[_0x44b8('0xa5')](_0x3154bc,_0x44b8('0xa4'),_0x4358aa['dialBusyRetryFrequency']),_0x3154bc[_0x44b8('0xa6')],_0x3154bc['activeContact']);}}}else{_0x3154bc['countbusyretry']++;_0xc181d2[_0x44b8('0x86')]({'id':_0x3154bc[_0x44b8('0xa7')],'field':{'countbusyretry':_0x3154bc[_0x44b8('0xa4')]}})['then'](function(){_0xc181d2['swapAdditionalPhones'](_0x3154bc,_0x10bbd9,_0xdff81b)['then'](function(){});});}});break;case _0x44b8('0xa8'):_0x4358aa[_0x44b8('0xa9')]+=0x1;_0x3154bc[_0x44b8('0xaa')]+=0x1;_0x3154bc[_0x44b8('0x96')]=ut[_0x44b8('0x75')](_0x3154bc);ut[_0x44b8('0x61')](_0x3154bc,0x3,_0x44b8('0xab'));_0x10bbd9=_0x4358aa[_0x44b8('0xac')];_0xdff81b=_0x4358aa['callAdditionalPhoneAfterMin'];var _0x388c4c=ut['buildNoAnswerEventPayload'](_0x3154bc,_0x4358aa);ami['emit']('custom:agentnoanswer',_0x388c4c);rpcDb[_0x44b8('0x65')](_0x3154bc,'[callProgressDetectingCustomer][logNoAnswer]');_0xc181d2[_0x44b8('0x7b')](_0x3154bc,'3',_0x4358aa)[_0x44b8('0x54')](function(_0x268e1e){_0xf0fb0d=_0x268e1e[_0x44b8('0x7c')]==0x1;if(!_0xf0fb0d){if(ut[_0x44b8('0x75')](_0x3154bc)>=_0x4358aa[_0x44b8('0x7f')]){_0x3c9534=ut[_0x44b8('0x80')](_0x3154bc,0xf,_0x44b8('0xa2'));rpcDb['createCustomerFinal'](_0x3c9534,_0x44b8('0xad'));}else{if(_0x3154bc[_0x44b8('0xaa')]>=_0x4358aa[_0x44b8('0xae')]){rpcDb[_0x44b8('0x69')](_0x3154bc,_0x44b8('0xaf'));}else{rpcDb[_0x44b8('0x83')](ut[_0x44b8('0xa5')](_0x3154bc,_0x44b8('0xaa'),_0x4358aa[_0x44b8('0xac')]),_0x3154bc['unlockAgent'],_0x3154bc['activeContact']);}}}else{_0x3154bc[_0x44b8('0xaa')]++;_0xc181d2['incrementPreviewCounters']({'id':_0x3154bc[_0x44b8('0xa7')],'field':{'countnoanswerretry':_0x3154bc[_0x44b8('0xaa')]}})[_0x44b8('0x54')](function(){_0xc181d2['swapAdditionalPhones'](_0x3154bc,_0x10bbd9,_0xdff81b)['then'](function(){});});}});break;case'CONGESTION':_0x4358aa[_0x44b8('0xb0')]+=0x1;_0x3154bc['countcongestionretry']+=0x1;_0x3154bc[_0x44b8('0x96')]=ut[_0x44b8('0x75')](_0x3154bc);ut[_0x44b8('0x61')](_0x3154bc,0x8,_0x44b8('0xb1'));_0x10bbd9=_0x4358aa[_0x44b8('0xb2')];_0xdff81b=_0x4358aa[_0x44b8('0x7e')];ami[_0x44b8('0x1f')](_0x44b8('0xb3'),ut[_0x44b8('0x78')](_0x3154bc,_0x44b8('0xb4')));rpcDb[_0x44b8('0x65')](_0x3154bc,_0x44b8('0xb5'));_0xc181d2[_0x44b8('0x7b')](_0x3154bc,'8',_0x4358aa)[_0x44b8('0x54')](function(_0x5de033){_0xf0fb0d=_0x5de033[_0x44b8('0x7c')]==0x1;if(!_0xf0fb0d){if(ut[_0x44b8('0x75')](_0x3154bc)>=_0x4358aa[_0x44b8('0x7f')]){_0x3c9534=ut[_0x44b8('0x80')](_0x3154bc,0xf,_0x44b8('0xa2'));rpcDb[_0x44b8('0x69')](_0x3c9534,_0x44b8('0xb6'));}else{if(_0x3154bc[_0x44b8('0xb7')]>=_0x4358aa[_0x44b8('0xb8')]){rpcDb[_0x44b8('0x69')](_0x3154bc,_0x44b8('0xb5'));}else{rpcDb[_0x44b8('0x83')](ut[_0x44b8('0xa5')](_0x3154bc,'countcongestionretry',_0x4358aa[_0x44b8('0x9f')]),_0x3154bc[_0x44b8('0xa6')],_0x3154bc[_0x44b8('0x84')]);}}}else{_0x3154bc['countcongestionretry']++;_0xc181d2['incrementPreviewCounters']({'id':_0x3154bc[_0x44b8('0xa7')],'field':{'countcongestionretry':_0x3154bc[_0x44b8('0xb7')]}})[_0x44b8('0x54')](function(){_0xc181d2['swapAdditionalPhones'](_0x3154bc,_0x10bbd9,_0xdff81b)[_0x44b8('0x54')](function(){});});}});break;case _0x44b8('0xb9'):_0x4358aa[_0x44b8('0xba')]+=0x1;_0x3154bc[_0x44b8('0xbb')]+=0x1;_0x3154bc[_0x44b8('0x96')]=ut[_0x44b8('0x75')](_0x3154bc);ut[_0x44b8('0x61')](_0x3154bc,0x14,_0x44b8('0xbc'));_0x10bbd9=_0x4358aa['dialAgentRejectRetryFrequency'];_0xdff81b=_0x4358aa[_0x44b8('0x7e')];ami[_0x44b8('0x1f')](_0x44b8('0xbd'),ut[_0x44b8('0x78')](_0x3154bc,_0x44b8('0xbe')));rpcDb[_0x44b8('0x65')](_0x3154bc,_0x44b8('0xbf'));_0xc181d2['verifyAdditionalPhones'](_0x3154bc,'20',_0x4358aa)['then'](function(_0x478f17){_0xf0fb0d=_0x478f17[_0x44b8('0x7c')]==0x1;if(!_0xf0fb0d){if(ut[_0x44b8('0x75')](_0x3154bc)>=_0x4358aa[_0x44b8('0x7f')]){_0x3c9534=ut[_0x44b8('0x80')](_0x3154bc,0x14,_0x44b8('0xbc'));rpcDb[_0x44b8('0x69')](_0x3c9534,_0x44b8('0xc0'));}else{if(_0x3154bc[_0x44b8('0xbb')]>=_0x4358aa[_0x44b8('0xc1')]){rpcDb['createCustomerFinal'](_0x3154bc,_0x44b8('0xc0'));}else{rpcDb[_0x44b8('0x83')](ut['scheduledAt'](_0x3154bc,'countagentrejectretry',_0x4358aa[_0x44b8('0xc2')]),_0x3154bc['unlockAgent'],_0x3154bc[_0x44b8('0x84')]);}}}else{_0x3154bc[_0x44b8('0xaa')]++;_0xc181d2[_0x44b8('0x86')]({'id':_0x3154bc['idContact'],'field':{'countnoanswerretry':_0x3154bc[_0x44b8('0xaa')]}})[_0x44b8('0x54')](function(){_0xc181d2[_0x44b8('0x87')](_0x3154bc,_0x10bbd9,_0xdff81b)[_0x44b8('0x54')](function(){});});}});break;case'ABANDONED':_0x4358aa[_0x44b8('0xc3')]+=0x1;_0x3154bc['countabandonedretry']+=0x1;_0x3154bc[_0x44b8('0x96')]=ut[_0x44b8('0x75')](_0x3154bc);ut[_0x44b8('0x61')](_0x3154bc,0xb,_0x44b8('0xc4'));rpcDb[_0x44b8('0x65')](_0x3154bc,_0x44b8('0xc5'));_0xc181d2[_0x44b8('0x7b')](_0x3154bc,'11',_0x4358aa)['then'](function(_0x4d3b82){_0xf0fb0d=_0x4d3b82['additional']==0x1;if(!_0xf0fb0d){if(ut[_0x44b8('0x75')](_0x3154bc)>=_0x4358aa[_0x44b8('0x7f')]){_0x3c9534=ut[_0x44b8('0x80')](_0x3154bc,0xf,_0x44b8('0xa2'));rpcDb[_0x44b8('0x69')](_0x3c9534,_0x44b8('0xc5'));}else{if(_0x3154bc[_0x44b8('0xc6')]>=_0x4358aa[_0x44b8('0xc7')]){rpcDb[_0x44b8('0x69')](_0x3154bc,_0x44b8('0xc5'));}else{rpcDb[_0x44b8('0x83')](ut[_0x44b8('0xa5')](_0x3154bc,_0x44b8('0xc8'),_0x4358aa[_0x44b8('0xc9')]),_0x3154bc[_0x44b8('0xa6')],_0x3154bc[_0x44b8('0x84')]);}}}else{_0x3154bc[_0x44b8('0xaa')]++;_0xc181d2[_0x44b8('0x86')]({'id':_0x3154bc['idContact'],'field':{'countnoanswerretry':_0x3154bc[_0x44b8('0xaa')]}})['then'](function(){_0xc181d2[_0x44b8('0x87')](_0x3154bc,_0x10bbd9,_0xdff81b)['then'](function(){});});}});break;case'18':_0x4358aa['outboundUnknownCallsDay']+=0x1;_0x3154bc[_0x44b8('0xca')]+=0x1;_0x3154bc['countglobal']=ut['totalGlobal'](_0x3154bc);ut['logCustomer'](_0x3154bc,0x12,_0xe86e34['cause-txt']||_0xe86e34['dialstatus']);ami[_0x44b8('0x1f')](_0x44b8('0xcb'),ut[_0x44b8('0x78')](_0x3154bc,_0x44b8('0xcc')));rpcDb['createCustomerHistory'](_0x3154bc,_0x44b8('0xcd'));_0xc181d2[_0x44b8('0x7b')](_0x3154bc,'18',_0x4358aa)['then'](function(_0x572e5c){_0xf0fb0d=_0x572e5c[_0x44b8('0x7c')]==0x1;if(!_0xf0fb0d){if(ut[_0x44b8('0x75')](_0x3154bc)>=_0x4358aa[_0x44b8('0x7f')]){_0x3c9534=ut['cloneAction'](_0x3154bc,0x12,_0x44b8('0xa2'));rpcDb[_0x44b8('0x69')](_0x3c9534,_0x44b8('0xcd'));}else{rpcDb[_0x44b8('0x69')](_0x3154bc,_0x44b8('0xcd'));}}else{_0x3154bc[_0x44b8('0xaa')]++;_0xc181d2[_0x44b8('0x86')]({'id':_0x3154bc[_0x44b8('0xa7')],'field':{'countnoanswerretry':_0x3154bc[_0x44b8('0xaa')]}})['then'](function(){_0xc181d2[_0x44b8('0x87')](_0x3154bc,_0x10bbd9,_0xdff81b)[_0x44b8('0x54')](function(){});});}});delete this['actions'][_0xe86e34[_0x44b8('0x9d')]];break;case'19':_0x4358aa[_0x44b8('0xce')]+=0x1;_0x3154bc[_0x44b8('0x96')]=ut['totalGlobal'](_0x3154bc);ut[_0x44b8('0x61')](_0x3154bc,0x13,_0xe86e34['cause-txt']||_0xe86e34[_0x44b8('0xcf')]);ami[_0x44b8('0x1f')]('custom:amd',ut[_0x44b8('0x78')](_0x3154bc,_0x44b8('0xcc')));rpcDb[_0x44b8('0x65')](_0x3154bc,_0x44b8('0xd0'));_0xc181d2['verifyAdditionalPhones'](_0x3154bc,'18',_0x4358aa)[_0x44b8('0x54')](function(_0xf73cde){_0xf0fb0d=_0xf73cde[_0x44b8('0x7c')]==0x1;if(!_0xf0fb0d){if(ut[_0x44b8('0x75')](_0x3154bc)>=_0x4358aa[_0x44b8('0x7f')]){_0x3c9534=ut[_0x44b8('0x80')](_0x3154bc,0xf,_0x44b8('0xa2'));rpcDb[_0x44b8('0x69')](_0x3c9534,_0x44b8('0xd0'));}else{rpcDb['createCustomerFinal'](_0x3154bc,'[callProgressDetectingCustomer][machine]');}}else{_0x3154bc[_0x44b8('0xaa')]++;_0xc181d2[_0x44b8('0x86')]({'id':_0x3154bc[_0x44b8('0xa7')],'field':{'countnoanswerretry':_0x3154bc[_0x44b8('0xaa')]}})[_0x44b8('0x54')](function(){_0xc181d2['swapAdditionalPhones'](_0x3154bc,_0x10bbd9,_0xdff81b)[_0x44b8('0x54')](function(){});});}});delete this['actions'][_0xe86e34[_0x44b8('0x9d')]];break;default:if(_0x3154bc['dialAnswer']){ut[_0x44b8('0x4d')](_0x4358aa,_0x44b8('0xd1'));ut[_0x44b8('0xd2')](_0x44b8('0xd3')+_0x4358aa[_0x44b8('0x24')],_0xe86e34);}_0x4358aa[_0x44b8('0xce')]+=0x1;_0x3154bc[_0x44b8('0x96')]=ut[_0x44b8('0x75')](_0x3154bc);ut[_0x44b8('0x61')](_0x3154bc,0xc,_0xe86e34['cause-txt']||_0xe86e34[_0x44b8('0xcf')]);_0x10bbd9=_0x4358aa[_0x44b8('0xc2')];_0xdff81b=_0x4358aa[_0x44b8('0x7e')];rpcDb[_0x44b8('0x65')](_0x3154bc,'[callProgressDetectingCustomer][logUnknown]');_0xc181d2['verifyAdditionalPhones'](_0x3154bc,'20',_0x4358aa)['then'](function(_0xf5e39){_0xf0fb0d=_0xf5e39['additional']==0x1;if(!_0xf0fb0d){if(ut['totalGlobal'](_0x3154bc)>=_0x4358aa[_0x44b8('0x7f')]){_0x3c9534=ut[_0x44b8('0x80')](_0x3154bc,0xf,_0x44b8('0xa2'));rpcDb[_0x44b8('0x69')](_0x3c9534,_0x44b8('0xd4'));}else{rpcDb[_0x44b8('0x69')](_0x3154bc,_0x44b8('0xd4'));}delete this[_0x44b8('0x11')][_0xe86e34['linkedid']];}else{_0xc181d2[_0x44b8('0x87')](_0x3154bc,_0x10bbd9,_0xdff81b)[_0x44b8('0x54')](function(){});}});}if(!(_0x3154bc[_0x44b8('0x4c')]&&_0x5b99a3==='16')){ut[_0x44b8('0x4a')](_0x4358aa,'[callProgressDetectingCustomer]');logger[_0x44b8('0x20')](_0x44b8('0xd5'),_0x3154bc[_0x44b8('0x8b')],'\x20Queue',_0x4358aa['name'],_0x44b8('0x3e'),_0x4358aa[_0x44b8('0x3f')]);}if(_0x5b99a3!==_0x44b8('0x88')){delete this[_0x44b8('0x11')][_0xe86e34[_0x44b8('0x9d')]];delete this['actions'][_0xe86e34[_0x44b8('0xd6')]];}_0x4358aa[_0x44b8('0xd7')]=!![];}};Preview['prototype'][_0x44b8('0xd8')]=function(_0x13942e,_0xcb4c9b,_0x237f67){if(_['isUndefined'](_0xcb4c9b)&&_0x44b8('0xd9')!==typeof _0xcb4c9b){return;}if(_['isUndefined'](_0x237f67)&&_0x44b8('0xd9')!==typeof _0x237f67){return;}switch(_0x237f67[_0x44b8('0xda')]){case'0':ut[_0x44b8('0xdb')](_0x13942e,0x0,_0x44b8('0x76'));rpcDb[_0x44b8('0xdc')](_0x13942e,_0x44b8('0xdd'));break;case'3':ut[_0x44b8('0xdb')](_0x13942e,0x3,_0x44b8('0xab'));rpcDb['createAgentHistory'](_0x13942e,_0x44b8('0xde'));break;case'5':ut[_0x44b8('0xdb')](_0x13942e,0x5,_0x44b8('0xdf'));rpcDb[_0x44b8('0xdc')](_0x13942e,_0x44b8('0xe0'));break;case'8':ut[_0x44b8('0xdb')](_0x13942e,0x8,'Congestion');rpcDb['createAgentHistory'](_0x13942e,_0x44b8('0xe1'));break;case'22':ut[_0x44b8('0xdb')](_0x13942e,0x16,'AnswerAGI');rpcDb[_0x44b8('0xdc')](_0x13942e,_0x44b8('0xe2'));break;default:ut['logAgent'](_0x13942e,0xc,_0x237f67[_0x44b8('0xda')]);rpcDb[_0x44b8('0xdc')](_0x13942e,_0x44b8('0xe1'));}ut[_0x44b8('0x4a')](_0xcb4c9b,_0x44b8('0xe3'));logger[_0x44b8('0x20')](_0x44b8('0xe4'),_0x13942e[_0x44b8('0x8b')],_0x44b8('0x8c'),_0xcb4c9b[_0x44b8('0x24')],_0x44b8('0x3e'),_0xcb4c9b[_0x44b8('0x3f')]);delete this[_0x44b8('0x11')][_0x13942e[_0x44b8('0x8b')]];};Preview[_0x44b8('0xb')]['verifyAdditionalPhones']=function(_0x30fca,_0x3d92a9,_0x13ab7b){return cmHopperAdditionalPhone[_0x44b8('0x7b')](_0x30fca,_0x3d92a9,_0x13ab7b)['catch'](logger[_0x44b8('0x20')](_0x44b8('0xe5')));};Preview['prototype'][_0x44b8('0x87')]=function(_0x4b9731,_0x1cd645,_0x3fee20){return cmHopperAdditionalPhone[_0x44b8('0x87')](_0x4b9731,_0x1cd645,_0x3fee20)[_0x44b8('0x48')](logger['info']('[swapAdditionalPhone]\x20'));};Preview[_0x44b8('0xb')][_0x44b8('0x86')]=function(_0x5a2a9f){return Promise['resolve']()['then'](cmHopperAdditionalPhone[_0x44b8('0x86')](_0x5a2a9f))[_0x44b8('0x48')](logger[_0x44b8('0x20')]('[incrementPreviewCounters]\x20'));};Preview['prototype'][_0x44b8('0xe6')]=function(_0x289fbd,_0x12f78b,_0x24a6a6,_0x2f5451,_0xc54e64){var _0x100295=this;return new Promise(function(_0x287902,_0x2675e9){if(_['isNil'](_0x12f78b)||_[_0x44b8('0x3a')](_0x12f78b['Contact'])||_[_0x44b8('0x3a')](_0x12f78b['phone'])||_['isNil'](_0x12f78b[_0x44b8('0x44')])){_0x2675e9(ut[_0x44b8('0x2b')](_0x44b8('0xe7'),_0x2f5451,_0xc54e64));return;}var _0x13c741=uuid['v4']();var _0x2eec38=_0x100295[_0x44b8('0x1e')][_0x12f78b[_0x44b8('0x3c')][_0x44b8('0x24')]];var _0x17b749=_0x24a6a6?_0x100295['agents'][_0x24a6a6]['id']:undefined;_0x100295[_0x44b8('0x11')][_0x13c741]=new Action(_0x12f78b,_0x2eec38,_0x13c741,_0x24a6a6,_0x17b749);var _0x1e3b5f=_0x100295[_0x44b8('0x11')][_0x13c741];_0x1e3b5f['unlockAgent']=_0x2f5451;_0x1e3b5f['activeContact']=_0xc54e64;_0x1e3b5f[_0x44b8('0xe8')]=_0x24a6a6;if(_['isEmpty'](_0x289fbd)){_0x100295[_0x44b8('0xe9')](_0x1e3b5f,_0x2eec38,_0x12f78b,_0x24a6a6)['then'](function(_0x1ae0bb){logger['info']('[Preview][execCall][success]',_0x44b8('0xea')+_0x1e3b5f[_0x44b8('0x3d')]+'\x20IdHopper:\x20'+_0x1e3b5f[_0x44b8('0xa7')],JSON[_0x44b8('0x22')](_0x1ae0bb));ami[_0x44b8('0x1f')](_0x44b8('0xeb'),ut[_0x44b8('0x78')](_0x1e3b5f,'called',_0x100295[_0x44b8('0x1e')][_0x1e3b5f['queue']]));_0x287902(ut['message']('Calling'));})[_0x44b8('0x48')](function(_0x2818ec){ut['logger'](_0x44b8('0xec'),_0x2818ec);_0x2675e9(ut[_0x44b8('0x2b')]('Call\x20failed',_0x2f5451,_0xc54e64));});}else{_0x2eec38['outboundBlacklistCallsDay']+=0x1;ut[_0x44b8('0xed')](_0x1e3b5f);rpcDb[_0x44b8('0xee')](_0x1e3b5f,'[Blacklist][error]');delete _0x100295[_0x44b8('0x11')][_0x13c741];_0x2675e9(ut[_0x44b8('0x2b')]('Contact\x20in\x20black\x20List',_0x2f5451,_0xc54e64));}});};Preview[_0x44b8('0xb')][_0x44b8('0x6d')]=function(_0x5ce5ed){return!_[_0x44b8('0x3a')](_0x5ce5ed)&&!_[_0x44b8('0x3a')](_0x5ce5ed[_0x44b8('0x24')])&&!_['isNil'](_0x5ce5ed[_0x44b8('0xef')])&&_0x5ce5ed['active']&&!_[_0x44b8('0x3a')](this['trunks'][util['format'](_0x44b8('0xf0'),_0x5ce5ed[_0x44b8('0x24')])])&&!_[_0x44b8('0x3a')](this[_0x44b8('0x10')][util[_0x44b8('0xf1')](_0x44b8('0xf0'),_0x5ce5ed[_0x44b8('0x24')])][_0x44b8('0x46')])&&(this[_0x44b8('0x10')][util[_0x44b8('0xf1')](_0x44b8('0xf0'),_0x5ce5ed['name'])][_0x44b8('0x46')]===_0x44b8('0xf2')||this[_0x44b8('0x10')][util[_0x44b8('0xf1')](_0x44b8('0xf0'),_0x5ce5ed[_0x44b8('0x24')])][_0x44b8('0x46')]===_0x44b8('0xf3'));};Preview['prototype'][_0x44b8('0x5a')]=function(_0x3f33a9,_0x561645){return this[_0x44b8('0xf4')](_0x3f33a9,_0x561645)[_0x44b8('0x54')](function(_0x2a40a3){return _['pick'](_0x2a40a3,['message']);})[_0x44b8('0x48')](function(_0x133da8){if(_0x133da8['unlock']){rpcDb['unlockContact'](_0x3f33a9);}if(_0x133da8[_0x44b8('0xef')]){rpcDb[_0x44b8('0x5d')](_0x3f33a9);}throw _[_0x44b8('0x41')](_0x133da8,[_0x44b8('0x2b')]);});};Preview[_0x44b8('0xb')]['execRun']=function(_0x2ded38,_0x4fbf1d){var _0x444f66=this;var _0x1386c6,_0x36537c;return rpcDb[_0x44b8('0xf5')](_0x2ded38)[_0x44b8('0x54')](function(_0x180c33){if(!_['isNil'](_0x180c33[0x0])){_0x36537c=_0x180c33[0x0][_0x44b8('0xf6')]?![]:!![];_0x1386c6=_0x180c33[0x0]['recallme']?!![]:![];_0x1386c6=_0x4fbf1d?!![]:_0x1386c6;}var _0x2c3e11=_0x444f66[_0x44b8('0xf7')](_0x180c33);if(_0x2c3e11['isValid']){rpcDb[_0x44b8('0xf8')](_['pick'](_0x180c33[0x0],[_0x44b8('0x44'),_0x44b8('0xf9')]))[_0x44b8('0x54')](function(_0x4b0aa0){_0x444f66[_0x44b8('0xe6')](_0x4b0aa0,_0x180c33[0x0],_0x4fbf1d,_0x36537c,_0x1386c6)[_0x44b8('0x54')](function(_0x4ff63e){return _0x4ff63e;})[_0x44b8('0x48')](function(_0x5af83d){throw _0x5af83d;});})['catch'](function(_0x4220b5){ut['logger'](_0x44b8('0xfa'),_0x4220b5);throw ut['message'](_0x44b8('0xfb'),_0x36537c,_0x1386c6);});}else{throw ut[_0x44b8('0x2b')](_0x2c3e11['message'],_0x36537c,_0x1386c6);}})[_0x44b8('0x48')](function(_0x39507e){ut['logger']('[Preview][getContactPreview]',_0x39507e);throw ut[_0x44b8('0x2b')](_0x44b8('0xfb'),![],!![]);});};Preview[_0x44b8('0xb')][_0x44b8('0xf7')]=function(_0x596fa4){if(_[_0x44b8('0x3a')](_0x596fa4)||_[_0x44b8('0xfc')](_0x596fa4)||!_[_0x44b8('0x3a')](_0x596fa4[0x0][_0x44b8('0x58')])&&_['isNil'](_0x596fa4[0x0]['Agent'][_0x44b8('0x24')])){ut[_0x44b8('0xfd')](_0x44b8('0xfe'),_0x596fa4);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x1443bd=this[_0x44b8('0x1e')][_0x596fa4[0x0]['Queue'][_0x44b8('0x24')]];_0x1443bd[_0x44b8('0x2b')]=utils[_0x44b8('0x2e')][_0x44b8('0x71')];if(_[_0x44b8('0x3a')](_0x1443bd)){ut[_0x44b8('0xfd')]('[Preview][validateContact][Empty\x20Campaign]',_0x1443bd);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x44b8('0x6d')](_0x1443bd['Trunk'])){ut[_0x44b8('0xfd')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x44b8('0xff')+_0x1443bd[_0x44b8('0x24')]+_0x44b8('0x100'));if(!this[_0x44b8('0x6d')](_0x1443bd[_0x44b8('0x6f')])){ut[_0x44b8('0xfd')](_0x44b8('0x101'),_0x1443bd[_0x44b8('0x24')]+_0x44b8('0x102'));return{'isValid':![],'message':_0x44b8('0x103')};}}if(!ut[_0x44b8('0x6c')](_0x1443bd[_0x44b8('0x35')])){ut[_0x44b8('0xfd')](_0x44b8('0x104'),_0x1443bd[_0x44b8('0x24')]+_0x44b8('0x105'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x1443bd[_0x44b8('0x24')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x44b8('0x106')};};Preview[_0x44b8('0xb')][_0x44b8('0xe9')]=function(_0x10fd21,_0x420a61,_0x22e5ae,_0x2f3340){var _0x4d98de=this;return new Promise(function(_0x597139,_0x2fffd5){var _0x3c90c2=_0x10fd21[_0x44b8('0x8b')];var _0x43c7ac=_0x4d98de[_0x44b8('0x6d')](_0x420a61['Trunk'])?util[_0x44b8('0xf1')](_0x44b8('0x107'),_0x420a61[_0x44b8('0x6e')][_0x44b8('0x24')],_[_0x44b8('0x3a')](_0x420a61[_0x44b8('0x108')])?'':_0x420a61['dialPrefix'][_0x44b8('0x109')]()||'',_0x420a61[_0x44b8('0x10a')]>0x0?_0x22e5ae[_0x44b8('0xf9')][_0x44b8('0x10b')](_0x420a61[_0x44b8('0x10a')]):_0x22e5ae['phone']):util['format'](_0x44b8('0x107'),_[_0x44b8('0x3a')](_0x420a61['TrunkBackup'])?_0x420a61['Trunk'][_0x44b8('0x24')]:_0x420a61['TrunkBackup'][_0x44b8('0x24')],_[_0x44b8('0x3a')](_0x420a61[_0x44b8('0x108')])?'':_0x420a61[_0x44b8('0x108')][_0x44b8('0x109')]()||'',_0x420a61[_0x44b8('0x10a')]>0x0?_0x22e5ae[_0x44b8('0xf9')][_0x44b8('0x10b')](_0x420a61['dialCutDigit']):_0x22e5ae[_0x44b8('0xf9')]);var _0xf24cdd=_0x4d98de[_0x44b8('0x6d')](_0x420a61['Trunk'])?ut[_0x44b8('0x10c')](_0x420a61[_0x44b8('0x6e')]['callerid'],_0x420a61['dialOriginateCallerIdName'],_0x420a61['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x420a61[_0x44b8('0x10d')],_0x420a61['dialRandomLastDigitCallerIdNumber']):_0x420a61['dialOriginateCallerIdNumber']):ut[_0x44b8('0x10c')](_[_0x44b8('0x3a')](_0x420a61[_0x44b8('0x6f')])?_0x420a61['Trunk'][_0x44b8('0x10e')]:_0x420a61['TrunkBackup'][_0x44b8('0x10e')],_0x420a61[_0x44b8('0x10f')],_0x420a61[_0x44b8('0x110')]>0x0?ut[_0x44b8('0x111')](_0x420a61['dialOriginateCallerIdNumber'],_0x420a61[_0x44b8('0x110')]):_0x420a61[_0x44b8('0x10d')]);if(_0xf24cdd){_0x10fd21[_0x44b8('0x112')]=ut[_0x44b8('0x113')](_0xf24cdd);_0x10fd21['originatecalleridnum']=ut['extractCalleridNumber'](_0xf24cdd);}var _0x35a564=ut[_0x44b8('0x114')](_0x420a61,_0x22e5ae,_0x43c7ac,_0xf24cdd,_0x3c90c2,_0x10fd21);_['merge'](_0x10fd21,ut[_0x44b8('0x115')](_0x35a564));_0x10fd21[_0x44b8('0x5e')]=moment()[_0x44b8('0xf1')](_0x44b8('0x5f'));_0x420a61[_0x44b8('0x116')]=_0x35a564;var _0x2da727=ut[_0x44b8('0x117')](_0x10fd21,_0x420a61,_0x35a564,_0x10fd21[_0x44b8('0x84')],_0x2f3340);return ami['Action'](_0x2da727)[_0x44b8('0x54')](function(_0x3e5fa8){_0x420a61[_0x44b8('0x3f')]+=0x1;logger['info'](_0x44b8('0x118'),_0x3c90c2,'\x20Queue',_0x420a61[_0x44b8('0x24')],'originated:\x20',_0x420a61[_0x44b8('0x3f')]);_0x597139(_0x3e5fa8);})[_0x44b8('0x48')](function(_0x1f5c08){ut[_0x44b8('0xdb')](_0x10fd21,0xe,_0x44b8('0x119'));rpcDb[_0x44b8('0xdc')](_0x10fd21,_0x44b8('0x11a'));_0x2fffd5(_0x1f5c08);});});};Preview[_0x44b8('0xb')][_0x44b8('0x19')]=function(_0x31913d){if(this[_0x44b8('0x11')][_0x31913d[_0x44b8('0x9d')]]){this['actions'][_0x31913d[_0x44b8('0x9d')]]['channel']=_0x31913d[_0x44b8('0x47')];}};Preview['prototype'][_0x44b8('0x14')]=function(_0x31132c){var _0xdfc44b=this;var _0x2c8438=this[_0x44b8('0x11')][_0x31132c[_0x44b8('0x11b')]];if(_0x2c8438){if(_0x2c8438[_0x44b8('0xe8')]&&this['agents'][_0x2c8438[_0x44b8('0xe8')]]){ut[_0x44b8('0x11c')](_0x2c8438,this[_0x44b8('0x12')][_0x2c8438[_0x44b8('0xe8')]][_0x44b8('0x24')],this[_0x44b8('0x12')][_0x2c8438[_0x44b8('0xe8')]]['id']);}var _0x46cdee=_[_0x44b8('0x11d')](_0x2c8438);_0x46cdee[_0x44b8('0x11e')]=moment()[_0x44b8('0xf1')](_0x44b8('0x5f'));var _0xbbc40d=_0xdfc44b[_0x44b8('0x1e')][_0x2c8438['queue']];if(ut[_0x44b8('0x11f')](_0x31132c[_0x44b8('0x120')])){if(_0x2c8438['unlockAgent']){rpcDb[_0x44b8('0x121')](_0x2c8438[_0x44b8('0xa7')]);}if(_0x2c8438[_0x44b8('0x84')]){rpcDb[_0x44b8('0x5d')](_0x2c8438[_0x44b8('0xa7')]);}ami['emit'](_0x44b8('0x122'),ut[_0x44b8('0x78')](_0x2c8438,_0x44b8('0x123'),this[_0x44b8('0x1e')][_0x2c8438['queue']]));this[_0x44b8('0xd8')](_0x46cdee,_0xbbc40d,_0x31132c);}else{_0x2c8438[_0x44b8('0x5e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ut['logAgent'](_0x46cdee,0x4,'Answer');rpcDb[_0x44b8('0xdc')](_0x46cdee,'[callProgressDetectingAgent][logAnswer]');}}};Preview['prototype'][_0x44b8('0x15')]=function(_0xb5c212){var _0x87a38=this['actions'][_0xb5c212[_0x44b8('0x9d')]];var _0x32dafb;if(_0x87a38){_0x32dafb=this[_0x44b8('0x1e')][_0x87a38[_0x44b8('0x3d')]];logger['info'](_0x44b8('0x124'),_0xb5c212['linkedid'],_0x44b8('0x8c'),_0x32dafb[_0x44b8('0x24')],'pTalking:\x20',_0x32dafb[_0x44b8('0x28')]);}if(this[_0x44b8('0x11')][_0xb5c212[_0x44b8('0x9d')]]&&_0xb5c212[_0x44b8('0x9d')]!==_0xb5c212[_0x44b8('0x8b')]){if(_0xb5c212['cause']==='16'&&this['actions'][_0xb5c212[_0x44b8('0x9d')]][_0x44b8('0x4c')]){this[_0x44b8('0x72')](_0xb5c212,_0xb5c212[_0x44b8('0x9d')],_0xb5c212[_0x44b8('0x125')]);}else if(this[_0x44b8('0x11')][_0xb5c212[_0x44b8('0x9d')]][_0x44b8('0x4c')]){logger[_0x44b8('0x20')](_0x44b8('0x126'),_0xb5c212[_0x44b8('0x9d')],_0xb5c212[_0x44b8('0x125')],'\x20Queue',_0x32dafb['name'],_0x44b8('0x40'),_0x32dafb['pTalking']);this[_0x44b8('0x72')](_0xb5c212,_0xb5c212[_0x44b8('0x9d')],_0xb5c212[_0x44b8('0x125')]);}}else if(_0x87a38&&_['isNil'](_0x87a38[_0x44b8('0x127')])&&_0x32dafb[_0x44b8('0x128')]&&_0xb5c212[_0x44b8('0x9d')]===_0xb5c212[_0x44b8('0x8b')]&&_[_0x44b8('0x3a')](_0xb5c212[_0x44b8('0xda')])&&_0xb5c212['cause']==='16'&&_0xb5c212[_0x44b8('0x129')]==='6'&&_[_0x44b8('0x12a')](_0x87a38['transfer'])){if(_0x87a38[_0x44b8('0xa6')]){rpcDb[_0x44b8('0x121')](_0x87a38[_0x44b8('0xa7')]);}if(_0x87a38[_0x44b8('0x84')]){rpcDb[_0x44b8('0x5d')](_0x87a38['idContact']);}_0xb5c212[_0x44b8('0xda')]='22';this[_0x44b8('0xd8')](_0x87a38,_0x32dafb,_0xb5c212);}else if(_0x87a38&&_0x87a38[_0x44b8('0x12b')]){if(_0xb5c212[_0x44b8('0x125')]==='16'&&this[_0x44b8('0x11')][_0xb5c212[_0x44b8('0x9d')]][_0x44b8('0x4c')]){logger[_0x44b8('0x20')](_0x44b8('0x12c'),_0xb5c212[_0x44b8('0x9d')],_0xb5c212['cause'],_0x44b8('0x8c'),_0x32dafb[_0x44b8('0x24')],_0x44b8('0x40'),_0x32dafb['pTalking']);this['callProgressDetectingCustomer'](_0xb5c212,_0xb5c212[_0x44b8('0x9d')],_0xb5c212['cause']);}else if(this[_0x44b8('0x11')][_0xb5c212[_0x44b8('0x9d')]][_0x44b8('0x4c')]){logger[_0x44b8('0x20')](_0x44b8('0x126'),_0xb5c212[_0x44b8('0x9d')],_0xb5c212[_0x44b8('0x125')],'\x20Queue',_0x32dafb['name'],_0x44b8('0x40'),_0x32dafb[_0x44b8('0x28')]);this[_0x44b8('0x72')](_0xb5c212,_0xb5c212[_0x44b8('0x9d')],_0xb5c212[_0x44b8('0x125')]);}}};Preview[_0x44b8('0xb')]['syncDialEnd']=function(_0x4d88a6){if(this[_0x44b8('0x11')][_0x4d88a6[_0x44b8('0xd6')]]&&_0x4d88a6[_0x44b8('0xd6')]!==_0x4d88a6[_0x44b8('0x12d')]){this[_0x44b8('0x72')](_0x4d88a6,_0x4d88a6[_0x44b8('0xd6')],_0x4d88a6[_0x44b8('0xcf')]);}};Preview['prototype'][_0x44b8('0x18')]=function(_0x1f6244){if(this[_0x44b8('0x11')][_0x1f6244['linkedid']]&&_0x1f6244[_0x44b8('0x9d')]!==_0x1f6244[_0x44b8('0x8b')]&&!this[_0x44b8('0x11')][_0x1f6244[_0x44b8('0x9d')]]['dialAnswer']){if(_0x1f6244[_0x44b8('0x125')]==='1'){this[_0x44b8('0x72')](_0x1f6244,_0x1f6244[_0x44b8('0x9d')],_0x1f6244['cause']);}}};Preview['prototype']['addVariable']=function(_0x4b3c64,_0x59a43a,_0x355c5c){if(this[_0x44b8('0x11')][_0x4b3c64]){if(_[_0x44b8('0x3a')](this[_0x44b8('0x11')][_0x4b3c64][_0x44b8('0x116')])){this[_0x44b8('0x11')][_0x4b3c64][_0x44b8('0x116')]={};}this[_0x44b8('0x11')][_0x4b3c64][_0x44b8('0x116')][_0x59a43a]=_0x355c5c;}};Preview[_0x44b8('0xb')][_0x44b8('0x1a')]=function(_0x56aecf){try{if(!_[_0x44b8('0x3a')](_0x56aecf)){if(ut[_0x44b8('0x12e')](_[_0x44b8('0x12f')](_0x56aecf[_0x44b8('0x130')])[0x0])){this[_0x44b8('0x131')](_0x56aecf['uniqueid'],_[_0x44b8('0x12f')](_0x56aecf['variable'])[0x0],_0x56aecf[_0x44b8('0x132')]);}}}catch(_0x3432da){logger[_0x44b8('0x133')]('[syncVarSet][Preview]',util[_0x44b8('0x134')](_0x3432da,{'showHidden':![],'depth':null}));}};Preview[_0x44b8('0xb')]['syncAttendedTransfer']=function(_0xc8e8f4){if(_0xc8e8f4){if(this[_0x44b8('0x11')][_0xc8e8f4[_0x44b8('0x135')]]){this['actions'][_0xc8e8f4[_0x44b8('0x135')]]['transfer']=!![];}}};Preview[_0x44b8('0xb')][_0x44b8('0x1c')]=function(_0x280fe1){if(_0x280fe1){if(this['actions'][_0x280fe1[_0x44b8('0x136')]]){this['actions'][_0x280fe1[_0x44b8('0x136')]][_0x44b8('0x12b')]=!![];}}};module[_0x44b8('0x137')]=Preview; \ No newline at end of file +var _0x9bde=['[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','getContactRecallMe','agentReadyId','then','length','scheduledat','dialRecallMeTimeout','Agent','voicePause','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','dialRecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','IsNotLoggedIn','loggedIn','isActive','isTrunkReachable','Trunk','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','unlockAgent','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','responsetime','answertime','uniqueid','\x20Queue','connect','complete','outboundAnswerCallsDay','total','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','[syncHangup][talking][decrement]','linkedid','BUSY','countbusyretry','dialBusyRetryFrequency','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','activeContact','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','outboundAbandonedCallsDay','countabandonedretry','Abandoned','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','[callProgressDetectingCustomer][hangupInAMD]','custom:amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','outboundUnknownCallsDay','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','isUndefined','object','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[originated][decrement][callProgressDetectingAgent]','[incrementPreviewCounters]\x20','checkInBlack','Contact','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','unmonitored','run','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','merge','toLowerVariables','variables','variablesAction','[originated][increment]','syncNewExten','syncOriginateResponse','actionid','response','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','addVariable','filterKey','keys','variable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','exports','lodash','moment','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','defaults','localhost','socket.io-emitter','prototype','tail','sequence','campaignsPreview','voiceQueues','trunks','agents','clockClearZombieChannels','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','syncDialEnd','newexten','varset','syncVarSet','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','paused','message','CAMPAIGN_STATUS','INACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','DEACTIVATED','logger','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','enqueue','isNil','actions','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','stringify','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError'];(function(_0x513545,_0x158f2e){var _0x18b7c5=function(_0x58514c){while(--_0x58514c){_0x513545['push'](_0x513545['shift']());}};_0x18b7c5(++_0x158f2e);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3fe7f7,_0x5d34a3){_0x3fe7f7=_0x3fe7f7-0x0;var _0x2efe70=_0x9bde[_0x3fe7f7];return _0x2efe70;};'use strict';var util=require('util');var _=require(_0xe9bd('0x0'));var uuid=require('uuid');var moment=require(_0xe9bd('0x1'));var Redis=require('ioredis');var config=require(_0xe9bd('0x2'));var logger=require(_0xe9bd('0x3'))(_0xe9bd('0x4'));var loggerAction=require(_0xe9bd('0x3'))(_0xe9bd('0x5'));var ami=require(_0xe9bd('0x6'));var rpcDb=require(_0xe9bd('0x7'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0xe9bd('0x8'));var ut=require(_0xe9bd('0x9'));var utils=require(_0xe9bd('0xa'));config[_0xe9bd('0xb')]=_[_0xe9bd('0xc')](config[_0xe9bd('0xb')],{'host':_0xe9bd('0xd'),'port':0x18eb});var io=require(_0xe9bd('0xe'))(new Redis(config[_0xe9bd('0xb')]));var Sequence=function(){};Sequence[_0xe9bd('0xf')]['enqueue']=function(_0x5f36c8){this[_0xe9bd('0x10')]=this[_0xe9bd('0x10')]?this[_0xe9bd('0x10')]['finally'](_0x5f36c8):_0x5f36c8();};function Preview(_0x12c96e){this[_0xe9bd('0x11')]=new Sequence();this[_0xe9bd('0x12')]=_0x12c96e[_0xe9bd('0x13')];this['trunks']=_0x12c96e[_0xe9bd('0x14')];this['actions']={};this[_0xe9bd('0x15')]=_0x12c96e[_0xe9bd('0x15')];this[_0xe9bd('0x16')]=0x0;ami['on']('originateresponse',this['syncOriginateResponse'][_0xe9bd('0x17')](this));ami['on'](_0xe9bd('0x18'),this[_0xe9bd('0x19')][_0xe9bd('0x17')](this));ami['on'](_0xe9bd('0x1a'),this[_0xe9bd('0x1b')][_0xe9bd('0x17')](this));ami['on']('dialend',this[_0xe9bd('0x1c')][_0xe9bd('0x17')](this));ami['on'](_0xe9bd('0x1d'),this['syncNewExten'][_0xe9bd('0x17')](this));ami['on'](_0xe9bd('0x1e'),this[_0xe9bd('0x1f')][_0xe9bd('0x17')](this));ami['on']('attendedtransfer',this[_0xe9bd('0x20')]['bind'](this));ami['on'](_0xe9bd('0x21'),this['syncBlindTransfer'][_0xe9bd('0x17')](this));this[_0xe9bd('0x22')](this[_0xe9bd('0x12')]);}function emit(_0x3dda13,_0x1acb82,_0x34ffed){io['to'](_0x3dda13)[_0xe9bd('0x23')](_0x1acb82,_0x34ffed);}function emitVoiceQueueChannelRemove(_0x49165b){logger[_0xe9bd('0x24')](_0xe9bd('0x25'),JSON['stringify'](_0x49165b));emit(util[_0xe9bd('0x26')]('voice:queue:%s',_0x49165b[_0xe9bd('0x27')]),_0xe9bd('0x28'),_0x49165b);io[_0xe9bd('0x23')](_0xe9bd('0x29'),_0x49165b);}function notSendMessagesQueue(_0x5bc4bf){if(_0x5bc4bf[_0xe9bd('0x2a')]){if(_0x5bc4bf[_0xe9bd('0x2b')]===0x0&&_0x5bc4bf[_0xe9bd('0x2c')]===0x0){_0x5bc4bf[_0xe9bd('0x2a')]=![];_0x5bc4bf[_0xe9bd('0x2d')]=0x0;_0x5bc4bf[_0xe9bd('0x2e')]=0x0;_0x5bc4bf[_0xe9bd('0x2f')]=utils[_0xe9bd('0x30')][_0xe9bd('0x31')];ut['logger'](_0xe9bd('0x32'),_0x5bc4bf[_0xe9bd('0x27')]+'\x20is\x20not\x20active');}else{_0x5bc4bf[_0xe9bd('0x2f')]=utils[_0xe9bd('0x30')][_0xe9bd('0x33')];ut[_0xe9bd('0x34')](_0xe9bd('0x32'),_0x5bc4bf[_0xe9bd('0x27')]+'\x20is\x20deactivated');}}}Preview['prototype'][_0xe9bd('0x22')]=function(){var _0x56e409=this;setInterval(function(){_0x56e409[_0xe9bd('0x35')]();},0x7cf);};Preview[_0xe9bd('0xf')][_0xe9bd('0x35')]=function(){var _0x36aa80=this[_0xe9bd('0x12')];this['clockClearZombieChannels']+=0x1;for(var _0x4b7bc2 in _0x36aa80){if(_0x36aa80[_0xe9bd('0x36')](_0x4b7bc2)&&(_0x36aa80[_0x4b7bc2][_0xe9bd('0x37')]===_0xe9bd('0x4')||_0x36aa80[_0x4b7bc2][_0xe9bd('0x37')]===_0xe9bd('0x38'))&&_0x36aa80[_0x4b7bc2][_0xe9bd('0x39')]===_0xe9bd('0x3a')){if(this[_0xe9bd('0x16')]>0x7){this[_0xe9bd('0x16')]=0x0;this['clearZombieChannels']();}}if(_0x36aa80[_0xe9bd('0x36')](_0x4b7bc2)&&_0x36aa80[_0x4b7bc2][_0xe9bd('0x37')]===_0xe9bd('0x4')&&_0x36aa80[_0x4b7bc2]['type']==='outbound'){if(_0x36aa80[_0x4b7bc2][_0xe9bd('0x3b')]){this[_0xe9bd('0x3c')](_0x36aa80[_0x4b7bc2]);if(_0x36aa80[_0x4b7bc2][_0xe9bd('0x3d')])this[_0xe9bd('0x3e')](_0x36aa80[_0x4b7bc2]);}else{notSendMessagesQueue(_0x36aa80[_0x4b7bc2]);}}}};Preview[_0xe9bd('0xf')][_0xe9bd('0x3f')]=function(_0x1e50ac){var _0x1c6173=this;this[_0xe9bd('0x11')][_0xe9bd('0x40')](function(){if(!_[_0xe9bd('0x41')](_0x1c6173[_0xe9bd('0x42')][_0x1e50ac])){loggerAction[_0xe9bd('0x24')](_0xe9bd('0x43'),_0x1e50ac,_0xe9bd('0x44'),_0x1c6173[_0xe9bd('0x42')][_0x1e50ac][_0xe9bd('0x45')],_0xe9bd('0x46'),JSON['stringify'](_0x1c6173[_0xe9bd('0x12')][_0x1c6173[_0xe9bd('0x42')][_0x1e50ac]['queue']][_0xe9bd('0x2b')]),_0xe9bd('0x47'),JSON['stringify'](_0x1c6173['campaignsPreview'][_0x1c6173[_0xe9bd('0x42')][_0x1e50ac][_0xe9bd('0x45')]]['pTalking']),JSON[_0xe9bd('0x48')](_0x1c6173[_0xe9bd('0x42')][_0x1e50ac][_0xe9bd('0x49')]),JSON['stringify'](_[_0xe9bd('0x4a')](_0x1c6173['actions'][_0x1e50ac],[_0xe9bd('0x4b'),_0xe9bd('0x4c'),_0xe9bd('0x4d'),_0xe9bd('0x4e')])));return ami['Action']({'action':_0xe9bd('0x4f'),'channel':_0x1c6173[_0xe9bd('0x42')][_0x1e50ac][_0xe9bd('0x50')]})[_0xe9bd('0x51')](function(_0x253359){if(_0x253359[_0xe9bd('0x2f')]===_0xe9bd('0x52')){setTimeout(function(){if(_0x1c6173[_0xe9bd('0x42')][_0x1e50ac]){ut[_0xe9bd('0x53')](_0x1c6173[_0xe9bd('0x12')][_0x1c6173['actions'][_0x1e50ac]['queue']],_0xe9bd('0x54'));if(_0x1c6173['actions'][_0x1e50ac][_0xe9bd('0x49')]===!![]){ut[_0xe9bd('0x55')](_0x1c6173[_0xe9bd('0x12')][_0x1c6173['actions'][_0x1e50ac][_0xe9bd('0x45')]],_0xe9bd('0x54'));ut[_0xe9bd('0x56')]('[Dialer][checkChannel][pTalking][Preview]'+_0x1e50ac,_0x1c6173[_0xe9bd('0x42')][_0x1e50ac][_0xe9bd('0x45')]);}ut[_0xe9bd('0x56')](_0xe9bd('0x57')+_0x1e50ac,_0x1c6173[_0xe9bd('0x42')][_0x1e50ac][_0xe9bd('0x45')]);delete _0x1c6173[_0xe9bd('0x42')][_0x1e50ac];}},0x2328);}});}});};Preview[_0xe9bd('0xf')][_0xe9bd('0x58')]=function(){var _0x300e07=this;loggerAction[_0xe9bd('0x24')](_0xe9bd('0x59'),_[_0xe9bd('0x5a')](this[_0xe9bd('0x42')]));for(var _0x41da6e in this['actions']){if(_0x300e07['actions'][_0xe9bd('0x36')](_0x41da6e)){_0x300e07[_0xe9bd('0x3f')](_0x41da6e);}}};Preview[_0xe9bd('0xf')]['recallMe']=function(_0x594e80){var _0x43cf7d=this;rpcDb[_0xe9bd('0x5b')](_0x594e80['id'],ut[_0xe9bd('0x5c')](this[_0xe9bd('0x15')]))[_0xe9bd('0x5d')](function(_0x3d4b58){if(!_[_0xe9bd('0x41')](_0x3d4b58)){for(var _0x512899=0x0;_0x512899<_0x3d4b58[_0xe9bd('0x5e')];_0x512899+=0x1){if(ut['getDiff'](_0x3d4b58[_0x512899][_0xe9bd('0x5f')])<_0x594e80[_0xe9bd('0x60')]*0x3c){if(_0x3d4b58[_0x512899][_0xe9bd('0x61')]&&!_0x3d4b58[_0x512899][_0xe9bd('0x61')][_0xe9bd('0x62')]){_0x43cf7d['run'](_0x3d4b58[_0x512899]['id'])[_0xe9bd('0x5d')](ut[_0xe9bd('0x63')](_0xe9bd('0x64')))['catch'](ut[_0xe9bd('0x63')](_0xe9bd('0x64')));}else{rpcDb[_0xe9bd('0x65')](_0x3d4b58[_0x512899]['id']);}}else{var _0x5a466b=new Action(_0x3d4b58[_0x512899],_0x594e80);_0x5a466b[_0xe9bd('0x66')]=moment()[_0xe9bd('0x26')](_0xe9bd('0x67'));_0x594e80[_0xe9bd('0x68')]+=0x1;ut[_0xe9bd('0x69')](_0x5a466b,0x17,'RecallInQueue');if(_0x594e80[_0xe9bd('0x6a')]){rpcDb['rescheduleContactInQueue'](ut[_0xe9bd('0x6b')](_0x3d4b58[_0x512899]));rpcDb[_0xe9bd('0x6c')](_0x5a466b,_0xe9bd('0x6d'));}else{ut[_0xe9bd('0x69')](_0x5a466b,0x16,_0xe9bd('0x6e'));rpcDb['createCustomerHistory'](_0x5a466b,_0xe9bd('0x6f'));rpcDb['createCustomerFinal'](_0x5a466b,_0xe9bd('0x6f'));}}}}})[_0xe9bd('0x51')](ut['logger2']('[getContactRecallMe]'));};Preview[_0xe9bd('0xf')]['setMessage']=function(_0x1ad573){_0x1ad573['sendMessageOneNotActive']=!![];if(ut[_0xe9bd('0x70')](_0x1ad573[_0xe9bd('0x71')])){_0x1ad573['message']=utils[_0xe9bd('0x30')]['NO_AGENTS_LOGGED'];}else if(!ut[_0xe9bd('0x72')](_0x1ad573[_0xe9bd('0x3b')])){_0x1ad573[_0xe9bd('0x2f')]=utils['CAMPAIGN_STATUS'][_0xe9bd('0x31')];}else if(!this[_0xe9bd('0x73')](_0x1ad573[_0xe9bd('0x74')])){if(!this[_0xe9bd('0x73')](_0x1ad573['TrunkBackup'])){_0x1ad573['message']=utils[_0xe9bd('0x30')]['UNREACHABLE_TRUNK'];}else{_0x1ad573[_0xe9bd('0x2f')]=utils[_0xe9bd('0x30')][_0xe9bd('0x75')];}}else{_0x1ad573[_0xe9bd('0x2f')]=utils[_0xe9bd('0x30')][_0xe9bd('0x75')];}};Preview[_0xe9bd('0xf')][_0xe9bd('0x76')]=function(_0x46a099,_0x3be526,_0x1fd5bf){var _0x78fab0=this;var _0x51500d=this['actions'][_0x3be526];var _0x566dd8=this[_0xe9bd('0x12')][_0x51500d['queue']];var _0x2c4ca7;var _0xdd1301=![];var _0x90db01=0x2;var _0x6232e5=0x3;if(_0x566dd8){switch(_0x1fd5bf){case'1':_0x566dd8[_0xe9bd('0x77')]+=0x1;_0x51500d[_0xe9bd('0x78')]+=0x1;_0x51500d[_0xe9bd('0x79')]=ut[_0xe9bd('0x7a')](_0x51500d);ut[_0xe9bd('0x69')](_0x51500d,0x0,'NoSuchNumber');ami[_0xe9bd('0x23')](_0xe9bd('0x7b'),ut[_0xe9bd('0x7c')](_0x51500d,_0xe9bd('0x7d')));rpcDb['createCustomerHistory'](_0x51500d,_0xe9bd('0x7e'));_0x78fab0[_0xe9bd('0x7f')](_0x51500d,'0',_0x566dd8)[_0xe9bd('0x5d')](function(_0x4e05f0){_0xdd1301=_0x4e05f0[_0xe9bd('0x80')]==0x1;_0x90db01=_0x566dd8[_0xe9bd('0x81')];_0x6232e5=_0x566dd8[_0xe9bd('0x82')];if(!_0xdd1301){if(ut[_0xe9bd('0x7a')](_0x51500d)>=_0x566dd8['dialGlobalMaxRetry']){_0x2c4ca7=ut['cloneAction'](_0x51500d,0xf,_0xe9bd('0x83'));rpcDb[_0xe9bd('0x84')](_0x2c4ca7,_0xe9bd('0x85'));}else{if(_0x51500d[_0xe9bd('0x78')]>=_0x566dd8['dialNoSuchNumberMaxRetry']){rpcDb['createCustomerFinal'](_0x51500d,_0xe9bd('0x85'));}else{rpcDb[_0xe9bd('0x86')](ut[_0xe9bd('0x87')](_0x51500d,_0xe9bd('0x78'),_0x566dd8[_0xe9bd('0x81')]),_0x51500d[_0xe9bd('0x88')],_0x51500d['activeContact']);}}delete this[_0xe9bd('0x42')][_0x46a099['linkedid']];}else{_0x51500d[_0xe9bd('0x78')]++;logger[_0xe9bd('0x24')](_0xe9bd('0x89'),_0x51500d[_0xe9bd('0x78')]);logger['info']('id',_0x51500d[_0xe9bd('0x8a')]);_0x78fab0[_0xe9bd('0x8b')]({'id':_0x51500d[_0xe9bd('0x8a')],'field':{'countnosuchnumberretry':_0x51500d['countnosuchnumberretry']}})[_0xe9bd('0x5d')](function(){_0x78fab0[_0xe9bd('0x8c')](_0x51500d,_0x90db01,_0x6232e5)[_0xe9bd('0x5d')](function(){});});}});break;case _0xe9bd('0x8d'):var _0x43dabe=moment()[_0xe9bd('0x26')](_0xe9bd('0x67'));_0x51500d[_0xe9bd('0x8e')]=_0x43dabe;_0x51500d[_0xe9bd('0x8f')]=_0x43dabe;_0x51500d[_0xe9bd('0x49')]=!![];_0x566dd8[_0xe9bd('0x2c')]+=0x1;logger[_0xe9bd('0x24')]('[syncHangup][talking][increment]',_0x51500d[_0xe9bd('0x90')],_0xe9bd('0x91'),_0x566dd8['name'],_0xe9bd('0x47'),_0x566dd8[_0xe9bd('0x2c')]);ami['emit']('custom:agentconnect',ut[_0xe9bd('0x7c')](_0x51500d,_0xe9bd('0x92'),this['campaignsPreview'][_0x51500d['queue']]));if(_0x566dd8['acw']){ami[_0xe9bd('0x23')]('custom:agentConnectPreview',ut['buildAcw'](_0x51500d));}break;case'16':ami['emit']('custom:agentcomplete',ut[_0xe9bd('0x7c')](_0x51500d,_0xe9bd('0x93'),this[_0xe9bd('0x12')][_0x51500d['queue']]));emitVoiceQueueChannelRemove(ut[_0xe9bd('0x7c')](_0x51500d,_0xe9bd('0x93')));_0x566dd8[_0xe9bd('0x94')]+=0x1;_0x566dd8[_0xe9bd('0x95')]+=0x1;_0x566dd8['answered']+=0x1;ut[_0xe9bd('0x55')](_0x566dd8,_0xe9bd('0x96'));_0x51500d[_0xe9bd('0x79')]=ut['totalGlobal'](_0x51500d);ut['logCustomer'](_0x51500d,0x4,_0xe9bd('0x97'));rpcDb[_0xe9bd('0x6c')](_0x51500d,_0xe9bd('0x98'));rpcDb[_0xe9bd('0x84')](_0x51500d,_0xe9bd('0x99'));rpcDb[_0xe9bd('0x9a')](_0x51500d);_0x566dd8[_0xe9bd('0x9b')]+=_0x51500d[_0xe9bd('0x9c')];_0x566dd8['sumBillable']+=_0x51500d[_0xe9bd('0x9c')];logger[_0xe9bd('0x24')](_0xe9bd('0x9d'),_0x51500d[_0xe9bd('0x90')],_0xe9bd('0x91'),_0x566dd8['name'],_0xe9bd('0x47'),_0x566dd8['pTalking']);delete this['actions'][_0x46a099[_0xe9bd('0x9e')]];break;case _0xe9bd('0x9f'):_0x566dd8['outboundBusyCallsDay']+=0x1;_0x51500d[_0xe9bd('0xa0')]+=0x1;_0x51500d[_0xe9bd('0x79')]=ut[_0xe9bd('0x7a')](_0x51500d);ut[_0xe9bd('0x69')](_0x51500d,0x5,'Busy');_0x90db01=_0x566dd8[_0xe9bd('0xa1')];_0x6232e5=_0x566dd8[_0xe9bd('0x82')];ami['emit'](_0xe9bd('0xa2'),ut[_0xe9bd('0x7c')](_0x51500d,_0xe9bd('0xa3')));rpcDb[_0xe9bd('0x6c')](_0x51500d,_0xe9bd('0xa4'));_0x78fab0[_0xe9bd('0x7f')](_0x51500d,'5',_0x566dd8)[_0xe9bd('0x5d')](function(_0x5e127b){_0xdd1301=_0x5e127b[_0xe9bd('0x80')]==0x1;if(!_0xdd1301){if(ut[_0xe9bd('0x7a')](_0x51500d)>=_0x566dd8[_0xe9bd('0xa5')]){_0x2c4ca7=ut[_0xe9bd('0xa6')](_0x51500d,0xf,_0xe9bd('0x83'));rpcDb[_0xe9bd('0x84')](_0x2c4ca7,_0xe9bd('0xa7'));}else{if(_0x51500d[_0xe9bd('0xa0')]>=_0x566dd8[_0xe9bd('0xa8')]){rpcDb['createCustomerFinal'](_0x51500d,_0xe9bd('0xa4'));}else{rpcDb[_0xe9bd('0x86')](ut[_0xe9bd('0x87')](_0x51500d,_0xe9bd('0xa0'),_0x566dd8[_0xe9bd('0xa1')]),_0x51500d[_0xe9bd('0x88')],_0x51500d[_0xe9bd('0xa9')]);}}}else{_0x51500d['countbusyretry']++;_0x78fab0[_0xe9bd('0x8b')]({'id':_0x51500d[_0xe9bd('0x8a')],'field':{'countbusyretry':_0x51500d['countbusyretry']}})[_0xe9bd('0x5d')](function(){_0x78fab0[_0xe9bd('0x8c')](_0x51500d,_0x90db01,_0x6232e5)[_0xe9bd('0x5d')](function(){});});}});break;case _0xe9bd('0xaa'):_0x566dd8[_0xe9bd('0xab')]+=0x1;_0x51500d[_0xe9bd('0xac')]+=0x1;_0x51500d[_0xe9bd('0x79')]=ut['totalGlobal'](_0x51500d);ut['logCustomer'](_0x51500d,0x3,_0xe9bd('0xad'));_0x90db01=_0x566dd8[_0xe9bd('0xae')];_0x6232e5=_0x566dd8[_0xe9bd('0x82')];var _0x1b863f=ut[_0xe9bd('0xaf')](_0x51500d,_0x566dd8);ami[_0xe9bd('0x23')](_0xe9bd('0xb0'),_0x1b863f);rpcDb['createCustomerHistory'](_0x51500d,_0xe9bd('0xb1'));_0x78fab0[_0xe9bd('0x7f')](_0x51500d,'3',_0x566dd8)[_0xe9bd('0x5d')](function(_0x256862){_0xdd1301=_0x256862[_0xe9bd('0x80')]==0x1;if(!_0xdd1301){if(ut[_0xe9bd('0x7a')](_0x51500d)>=_0x566dd8[_0xe9bd('0xa5')]){_0x2c4ca7=ut['cloneAction'](_0x51500d,0xf,'Global');rpcDb['createCustomerFinal'](_0x2c4ca7,_0xe9bd('0xb2'));}else{if(_0x51500d['countnoanswerretry']>=_0x566dd8['dialNoAnswerMaxRetry']){rpcDb['createCustomerFinal'](_0x51500d,_0xe9bd('0xb1'));}else{rpcDb[_0xe9bd('0x86')](ut[_0xe9bd('0x87')](_0x51500d,_0xe9bd('0xac'),_0x566dd8[_0xe9bd('0xae')]),_0x51500d[_0xe9bd('0x88')],_0x51500d[_0xe9bd('0xa9')]);}}}else{_0x51500d[_0xe9bd('0xac')]++;_0x78fab0[_0xe9bd('0x8b')]({'id':_0x51500d['idContact'],'field':{'countnoanswerretry':_0x51500d[_0xe9bd('0xac')]}})['then'](function(){_0x78fab0[_0xe9bd('0x8c')](_0x51500d,_0x90db01,_0x6232e5)[_0xe9bd('0x5d')](function(){});});}});break;case _0xe9bd('0xb3'):_0x566dd8[_0xe9bd('0xb4')]+=0x1;_0x51500d[_0xe9bd('0xb5')]+=0x1;_0x51500d['countglobal']=ut['totalGlobal'](_0x51500d);ut['logCustomer'](_0x51500d,0x8,_0xe9bd('0xb6'));_0x90db01=_0x566dd8[_0xe9bd('0xb7')];_0x6232e5=_0x566dd8['callAdditionalPhoneAfterMin'];ami[_0xe9bd('0x23')](_0xe9bd('0xb8'),ut[_0xe9bd('0x7c')](_0x51500d,_0xe9bd('0xb9')));rpcDb[_0xe9bd('0x6c')](_0x51500d,'[callProgressDetectingCustomer][logCongestion]');_0x78fab0[_0xe9bd('0x7f')](_0x51500d,'8',_0x566dd8)[_0xe9bd('0x5d')](function(_0x2c83fc){_0xdd1301=_0x2c83fc[_0xe9bd('0x80')]==0x1;if(!_0xdd1301){if(ut[_0xe9bd('0x7a')](_0x51500d)>=_0x566dd8[_0xe9bd('0xa5')]){_0x2c4ca7=ut[_0xe9bd('0xa6')](_0x51500d,0xf,_0xe9bd('0x83'));rpcDb[_0xe9bd('0x84')](_0x2c4ca7,_0xe9bd('0xba'));}else{if(_0x51500d['countcongestionretry']>=_0x566dd8['dialCongestionMaxRetry']){rpcDb['createCustomerFinal'](_0x51500d,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0xe9bd('0x86')](ut[_0xe9bd('0x87')](_0x51500d,_0xe9bd('0xb5'),_0x566dd8['dialBusyRetryFrequency']),_0x51500d[_0xe9bd('0x88')],_0x51500d[_0xe9bd('0xa9')]);}}}else{_0x51500d['countcongestionretry']++;_0x78fab0['incrementPreviewCounters']({'id':_0x51500d[_0xe9bd('0x8a')],'field':{'countcongestionretry':_0x51500d[_0xe9bd('0xb5')]}})[_0xe9bd('0x5d')](function(){_0x78fab0[_0xe9bd('0x8c')](_0x51500d,_0x90db01,_0x6232e5)[_0xe9bd('0x5d')](function(){});});}});break;case'CANCEL':_0x566dd8['outboundRejectCallsDay']+=0x1;_0x51500d['countagentrejectretry']+=0x1;_0x51500d[_0xe9bd('0x79')]=ut[_0xe9bd('0x7a')](_0x51500d);ut[_0xe9bd('0x69')](_0x51500d,0x14,_0xe9bd('0xbb'));_0x90db01=_0x566dd8[_0xe9bd('0xbc')];_0x6232e5=_0x566dd8[_0xe9bd('0x82')];ami[_0xe9bd('0x23')](_0xe9bd('0xbd'),ut[_0xe9bd('0x7c')](_0x51500d,_0xe9bd('0xbe')));rpcDb['createCustomerHistory'](_0x51500d,_0xe9bd('0xbf'));_0x78fab0['verifyAdditionalPhones'](_0x51500d,'20',_0x566dd8)[_0xe9bd('0x5d')](function(_0x57736c){_0xdd1301=_0x57736c['additional']==0x1;if(!_0xdd1301){if(ut[_0xe9bd('0x7a')](_0x51500d)>=_0x566dd8['dialGlobalMaxRetry']){_0x2c4ca7=ut[_0xe9bd('0xa6')](_0x51500d,0x14,'AgentReject');rpcDb[_0xe9bd('0x84')](_0x2c4ca7,_0xe9bd('0xc0'));}else{if(_0x51500d[_0xe9bd('0xc1')]>=_0x566dd8[_0xe9bd('0xc2')]){rpcDb[_0xe9bd('0x84')](_0x51500d,_0xe9bd('0xc0'));}else{rpcDb['rescheduleContact'](ut[_0xe9bd('0x87')](_0x51500d,_0xe9bd('0xc1'),_0x566dd8['dialAgentRejectRetryFrequency']),_0x51500d[_0xe9bd('0x88')],_0x51500d[_0xe9bd('0xa9')]);}}}else{_0x51500d[_0xe9bd('0xac')]++;_0x78fab0['incrementPreviewCounters']({'id':_0x51500d[_0xe9bd('0x8a')],'field':{'countnoanswerretry':_0x51500d[_0xe9bd('0xac')]}})[_0xe9bd('0x5d')](function(){_0x78fab0[_0xe9bd('0x8c')](_0x51500d,_0x90db01,_0x6232e5)[_0xe9bd('0x5d')](function(){});});}});break;case'ABANDONED':_0x566dd8[_0xe9bd('0xc3')]+=0x1;_0x51500d[_0xe9bd('0xc4')]+=0x1;_0x51500d['countglobal']=ut[_0xe9bd('0x7a')](_0x51500d);ut[_0xe9bd('0x69')](_0x51500d,0xb,_0xe9bd('0xc5'));rpcDb[_0xe9bd('0x6c')](_0x51500d,'[callProgressDetectingCustomer][logAbandoned]');_0x78fab0[_0xe9bd('0x7f')](_0x51500d,'11',_0x566dd8)[_0xe9bd('0x5d')](function(_0x209899){_0xdd1301=_0x209899[_0xe9bd('0x80')]==0x1;if(!_0xdd1301){if(ut[_0xe9bd('0x7a')](_0x51500d)>=_0x566dd8[_0xe9bd('0xa5')]){_0x2c4ca7=ut[_0xe9bd('0xa6')](_0x51500d,0xf,'Global');rpcDb[_0xe9bd('0x84')](_0x2c4ca7,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x51500d[_0xe9bd('0xc6')]>=_0x566dd8[_0xe9bd('0xc7')]){rpcDb[_0xe9bd('0x84')](_0x51500d,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0xe9bd('0x86')](ut['scheduledAt'](_0x51500d,_0xe9bd('0xc4'),_0x566dd8[_0xe9bd('0xc8')]),_0x51500d[_0xe9bd('0x88')],_0x51500d[_0xe9bd('0xa9')]);}}}else{_0x51500d[_0xe9bd('0xac')]++;_0x78fab0[_0xe9bd('0x8b')]({'id':_0x51500d[_0xe9bd('0x8a')],'field':{'countnoanswerretry':_0x51500d[_0xe9bd('0xac')]}})[_0xe9bd('0x5d')](function(){_0x78fab0[_0xe9bd('0x8c')](_0x51500d,_0x90db01,_0x6232e5)[_0xe9bd('0x5d')](function(){});});}});break;case'18':_0x566dd8['outboundUnknownCallsDay']+=0x1;_0x51500d[_0xe9bd('0xc9')]+=0x1;_0x51500d[_0xe9bd('0x79')]=ut[_0xe9bd('0x7a')](_0x51500d);ut['logCustomer'](_0x51500d,0x12,_0x46a099[_0xe9bd('0xca')]||_0x46a099[_0xe9bd('0xcb')]);ami['emit']('custom:amd',ut['buildObj'](_0x51500d,'amd'));rpcDb[_0xe9bd('0x6c')](_0x51500d,_0xe9bd('0xcc'));_0x78fab0[_0xe9bd('0x7f')](_0x51500d,'18',_0x566dd8)['then'](function(_0x3ad63e){_0xdd1301=_0x3ad63e[_0xe9bd('0x80')]==0x1;if(!_0xdd1301){if(ut['totalGlobal'](_0x51500d)>=_0x566dd8[_0xe9bd('0xa5')]){_0x2c4ca7=ut[_0xe9bd('0xa6')](_0x51500d,0x12,_0xe9bd('0x83'));rpcDb[_0xe9bd('0x84')](_0x2c4ca7,_0xe9bd('0xcc'));}else{rpcDb['createCustomerFinal'](_0x51500d,_0xe9bd('0xcc'));}}else{_0x51500d[_0xe9bd('0xac')]++;_0x78fab0['incrementPreviewCounters']({'id':_0x51500d['idContact'],'field':{'countnoanswerretry':_0x51500d['countnoanswerretry']}})['then'](function(){_0x78fab0[_0xe9bd('0x8c')](_0x51500d,_0x90db01,_0x6232e5)[_0xe9bd('0x5d')](function(){});});}});delete this[_0xe9bd('0x42')][_0x46a099[_0xe9bd('0x9e')]];break;case'19':_0x566dd8['outboundUnknownCallsDay']+=0x1;_0x51500d['countglobal']=ut[_0xe9bd('0x7a')](_0x51500d);ut[_0xe9bd('0x69')](_0x51500d,0x13,_0x46a099[_0xe9bd('0xca')]||_0x46a099['dialstatus']);ami[_0xe9bd('0x23')](_0xe9bd('0xcd'),ut['buildObj'](_0x51500d,'amd'));rpcDb[_0xe9bd('0x6c')](_0x51500d,_0xe9bd('0xce'));_0x78fab0[_0xe9bd('0x7f')](_0x51500d,'18',_0x566dd8)[_0xe9bd('0x5d')](function(_0x16741b){_0xdd1301=_0x16741b[_0xe9bd('0x80')]==0x1;if(!_0xdd1301){if(ut[_0xe9bd('0x7a')](_0x51500d)>=_0x566dd8[_0xe9bd('0xa5')]){_0x2c4ca7=ut[_0xe9bd('0xa6')](_0x51500d,0xf,'Global');rpcDb[_0xe9bd('0x84')](_0x2c4ca7,_0xe9bd('0xce'));}else{rpcDb[_0xe9bd('0x84')](_0x51500d,_0xe9bd('0xce'));}}else{_0x51500d[_0xe9bd('0xac')]++;_0x78fab0[_0xe9bd('0x8b')]({'id':_0x51500d['idContact'],'field':{'countnoanswerretry':_0x51500d[_0xe9bd('0xac')]}})['then'](function(){_0x78fab0[_0xe9bd('0x8c')](_0x51500d,_0x90db01,_0x6232e5)['then'](function(){});});}});delete this[_0xe9bd('0x42')][_0x46a099[_0xe9bd('0x9e')]];break;default:if(_0x51500d['dialAnswer']){ut[_0xe9bd('0x55')](_0x566dd8,_0xe9bd('0xcf'));ut['loggerError'](_0xe9bd('0xd0')+_0x566dd8[_0xe9bd('0x27')],_0x46a099);}_0x566dd8[_0xe9bd('0xd1')]+=0x1;_0x51500d[_0xe9bd('0x79')]=ut['totalGlobal'](_0x51500d);ut[_0xe9bd('0x69')](_0x51500d,0xc,_0x46a099[_0xe9bd('0xca')]||_0x46a099['dialstatus']);_0x90db01=_0x566dd8[_0xe9bd('0xbc')];_0x6232e5=_0x566dd8[_0xe9bd('0x82')];rpcDb[_0xe9bd('0x6c')](_0x51500d,'[callProgressDetectingCustomer][logUnknown]');_0x78fab0[_0xe9bd('0x7f')](_0x51500d,'20',_0x566dd8)[_0xe9bd('0x5d')](function(_0x308fd6){_0xdd1301=_0x308fd6[_0xe9bd('0x80')]==0x1;if(!_0xdd1301){if(ut[_0xe9bd('0x7a')](_0x51500d)>=_0x566dd8[_0xe9bd('0xa5')]){_0x2c4ca7=ut[_0xe9bd('0xa6')](_0x51500d,0xf,'Global');rpcDb[_0xe9bd('0x84')](_0x2c4ca7,_0xe9bd('0xd2'));}else{rpcDb[_0xe9bd('0x84')](_0x51500d,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xe9bd('0x42')][_0x46a099['linkedid']];}else{_0x78fab0['swapAdditionalPhones'](_0x51500d,_0x90db01,_0x6232e5)['then'](function(){});}});}if(!(_0x51500d[_0xe9bd('0x49')]&&_0x1fd5bf==='16')){ut['updateOriginated'](_0x566dd8,'[callProgressDetectingCustomer]');logger[_0xe9bd('0x24')](_0xe9bd('0xd3'),_0x51500d['uniqueid'],_0xe9bd('0x91'),_0x566dd8[_0xe9bd('0x27')],'originated:\x20',_0x566dd8['originated']);}if(_0x1fd5bf!==_0xe9bd('0x8d')){delete this['actions'][_0x46a099['linkedid']];delete this[_0xe9bd('0x42')][_0x46a099[_0xe9bd('0xd4')]];}_0x566dd8[_0xe9bd('0xd5')]=!![];}};Preview[_0xe9bd('0xf')][_0xe9bd('0xd6')]=function(_0xb21467,_0x26aec2,_0x5ebe24){if(_[_0xe9bd('0xd7')](_0x26aec2)&&'object'!==typeof _0x26aec2){return;}if(_['isUndefined'](_0x5ebe24)&&_0xe9bd('0xd8')!==typeof _0x5ebe24){return;}switch(_0x5ebe24[_0xe9bd('0xd9')]){case'0':ut[_0xe9bd('0xda')](_0xb21467,0x0,_0xe9bd('0xdb'));rpcDb[_0xe9bd('0xdc')](_0xb21467,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0xe9bd('0xda')](_0xb21467,0x3,_0xe9bd('0xad'));rpcDb[_0xe9bd('0xdc')](_0xb21467,_0xe9bd('0xdd'));break;case'5':ut[_0xe9bd('0xda')](_0xb21467,0x5,_0xe9bd('0xde'));rpcDb['createAgentHistory'](_0xb21467,_0xe9bd('0xdf'));break;case'8':ut[_0xe9bd('0xda')](_0xb21467,0x8,_0xe9bd('0xb6'));rpcDb[_0xe9bd('0xdc')](_0xb21467,_0xe9bd('0xe0'));break;case'22':ut[_0xe9bd('0xda')](_0xb21467,0x16,'AnswerAGI');rpcDb[_0xe9bd('0xdc')](_0xb21467,_0xe9bd('0xe1'));break;default:ut['logAgent'](_0xb21467,0xc,_0x5ebe24[_0xe9bd('0xd9')]);rpcDb[_0xe9bd('0xdc')](_0xb21467,_0xe9bd('0xe0'));}ut[_0xe9bd('0x53')](_0x26aec2,'[callProgressDetectingAgent]');logger[_0xe9bd('0x24')](_0xe9bd('0xe2'),_0xb21467[_0xe9bd('0x90')],_0xe9bd('0x91'),_0x26aec2[_0xe9bd('0x27')],_0xe9bd('0x46'),_0x26aec2[_0xe9bd('0x2b')]);delete this[_0xe9bd('0x42')][_0xb21467[_0xe9bd('0x90')]];};Preview['prototype'][_0xe9bd('0x7f')]=function(_0x2cc8cc,_0x1f2100,_0x28d533){return cmHopperAdditionalPhone[_0xe9bd('0x7f')](_0x2cc8cc,_0x1f2100,_0x28d533)[_0xe9bd('0x51')](logger[_0xe9bd('0x24')]('[verifyAdditionalPhone]\x20'));};Preview[_0xe9bd('0xf')]['swapAdditionalPhones']=function(_0x43fa2a,_0xbc686e,_0x2db271){return cmHopperAdditionalPhone[_0xe9bd('0x8c')](_0x43fa2a,_0xbc686e,_0x2db271)[_0xe9bd('0x51')](logger[_0xe9bd('0x24')]('[swapAdditionalPhone]\x20'));};Preview[_0xe9bd('0xf')][_0xe9bd('0x8b')]=function(_0x39b54b){return Promise['resolve']()[_0xe9bd('0x5d')](cmHopperAdditionalPhone[_0xe9bd('0x8b')](_0x39b54b))[_0xe9bd('0x51')](logger[_0xe9bd('0x24')](_0xe9bd('0xe3')));};Preview[_0xe9bd('0xf')][_0xe9bd('0xe4')]=function(_0x1c3af9,_0x20a8ce,_0x3b0874,_0x5c0b2d,_0x464f7a){var _0xfc35ff=this;return new Promise(function(_0x31aae8,_0x517b10){if(_[_0xe9bd('0x41')](_0x20a8ce)||_[_0xe9bd('0x41')](_0x20a8ce[_0xe9bd('0xe5')])||_['isNil'](_0x20a8ce['phone'])||_[_0xe9bd('0x41')](_0x20a8ce[_0xe9bd('0x4d')])){_0x517b10(ut[_0xe9bd('0x2f')](_0xe9bd('0xe6'),_0x5c0b2d,_0x464f7a));return;}var _0x25ee5d=uuid['v4']();var _0x464102=_0xfc35ff[_0xe9bd('0x12')][_0x20a8ce['Queue'][_0xe9bd('0x27')]];var _0x297ccc=_0x3b0874?_0xfc35ff['agents'][_0x3b0874]['id']:undefined;_0xfc35ff[_0xe9bd('0x42')][_0x25ee5d]=new Action(_0x20a8ce,_0x464102,_0x25ee5d,_0x3b0874,_0x297ccc);var _0x3335a4=_0xfc35ff[_0xe9bd('0x42')][_0x25ee5d];_0x3335a4[_0xe9bd('0x88')]=_0x5c0b2d;_0x3335a4[_0xe9bd('0xa9')]=_0x464f7a;_0x3335a4[_0xe9bd('0xe7')]=_0x3b0874;if(_[_0xe9bd('0xe8')](_0x1c3af9)){_0xfc35ff[_0xe9bd('0xe9')](_0x3335a4,_0x464102,_0x20a8ce,_0x3b0874)[_0xe9bd('0x5d')](function(_0x10dfc8){logger[_0xe9bd('0x24')](_0xe9bd('0xea'),_0xe9bd('0xeb')+_0x3335a4[_0xe9bd('0x45')]+_0xe9bd('0xec')+_0x3335a4['idContact'],JSON[_0xe9bd('0x48')](_0x10dfc8));ami[_0xe9bd('0x23')](_0xe9bd('0xed'),ut[_0xe9bd('0x7c')](_0x3335a4,_0xe9bd('0xee'),_0xfc35ff['campaignsPreview'][_0x3335a4[_0xe9bd('0x45')]]));_0x31aae8(ut[_0xe9bd('0x2f')](_0xe9bd('0xef')));})[_0xe9bd('0x51')](function(_0x3d980d){ut[_0xe9bd('0x34')](_0xe9bd('0xf0'),_0x3d980d);_0x517b10(ut[_0xe9bd('0x2f')](_0xe9bd('0xf1'),_0x5c0b2d,_0x464f7a));});}else{_0x464102[_0xe9bd('0xf2')]+=0x1;ut[_0xe9bd('0xf3')](_0x3335a4);rpcDb[_0xe9bd('0xf4')](_0x3335a4,_0xe9bd('0xf5'));delete _0xfc35ff['actions'][_0x25ee5d];_0x517b10(ut[_0xe9bd('0x2f')](_0xe9bd('0xf6'),_0x5c0b2d,_0x464f7a));}});};Preview[_0xe9bd('0xf')][_0xe9bd('0x73')]=function(_0x31b9a5){return!_[_0xe9bd('0x41')](_0x31b9a5)&&!_[_0xe9bd('0x41')](_0x31b9a5[_0xe9bd('0x27')])&&!_[_0xe9bd('0x41')](_0x31b9a5[_0xe9bd('0xf7')])&&_0x31b9a5[_0xe9bd('0xf7')]&&!_[_0xe9bd('0x41')](this['trunks'][util[_0xe9bd('0x26')](_0xe9bd('0xf8'),_0x31b9a5[_0xe9bd('0x27')])])&&!_[_0xe9bd('0x41')](this[_0xe9bd('0x14')][util['format'](_0xe9bd('0xf8'),_0x31b9a5[_0xe9bd('0x27')])][_0xe9bd('0x4f')])&&(this['trunks'][util[_0xe9bd('0x26')](_0xe9bd('0xf8'),_0x31b9a5['name'])]['status']==='reachable'||this[_0xe9bd('0x14')][util[_0xe9bd('0x26')]('SIP/%s',_0x31b9a5[_0xe9bd('0x27')])][_0xe9bd('0x4f')]===_0xe9bd('0xf9'));};Preview['prototype'][_0xe9bd('0xfa')]=function(_0x3445f6,_0x20e78e){return this[_0xe9bd('0xfb')](_0x3445f6,_0x20e78e)['then'](function(_0x4678aa){return _[_0xe9bd('0x4a')](_0x4678aa,['message']);})[_0xe9bd('0x51')](function(_0x762a5a){if(_0x762a5a[_0xe9bd('0xfc')]){rpcDb[_0xe9bd('0xfd')](_0x3445f6);}if(_0x762a5a['active']){rpcDb['disableContact'](_0x3445f6);}throw _['pick'](_0x762a5a,[_0xe9bd('0x2f')]);});};Preview['prototype'][_0xe9bd('0xfb')]=function(_0x32023e,_0xff728b){var _0x41b16f=this;var _0x1d5b7e,_0x2ff3b8;return rpcDb['getContactPreview'](_0x32023e)[_0xe9bd('0x5d')](function(_0x389b87){if(!_[_0xe9bd('0x41')](_0x389b87[0x0])){_0x2ff3b8=_0x389b87[0x0][_0xe9bd('0xfe')]?![]:!![];_0x1d5b7e=_0x389b87[0x0][_0xe9bd('0xfe')]?!![]:![];_0x1d5b7e=_0xff728b?!![]:_0x1d5b7e;}var _0x27740c=_0x41b16f[_0xe9bd('0xff')](_0x389b87);if(_0x27740c['isValid']){rpcDb[_0xe9bd('0x100')](_[_0xe9bd('0x4a')](_0x389b87[0x0],[_0xe9bd('0x4d'),_0xe9bd('0x101')]))['then'](function(_0x165180){_0x41b16f[_0xe9bd('0xe4')](_0x165180,_0x389b87[0x0],_0xff728b,_0x2ff3b8,_0x1d5b7e)[_0xe9bd('0x5d')](function(_0x152070){return _0x152070;})[_0xe9bd('0x51')](function(_0x101aa0){throw _0x101aa0;});})[_0xe9bd('0x51')](function(_0x566907){ut[_0xe9bd('0x34')](_0xe9bd('0x102'),_0x566907);throw ut[_0xe9bd('0x2f')](_0xe9bd('0x103'),_0x2ff3b8,_0x1d5b7e);});}else{throw ut[_0xe9bd('0x2f')](_0x27740c['message'],_0x2ff3b8,_0x1d5b7e);}})[_0xe9bd('0x51')](function(_0x10e200){ut['logger'](_0xe9bd('0x104'),_0x10e200);throw ut[_0xe9bd('0x2f')](_0xe9bd('0x103'),![],!![]);});};Preview['prototype'][_0xe9bd('0xff')]=function(_0x1a967a){if(_[_0xe9bd('0x41')](_0x1a967a)||_[_0xe9bd('0xe8')](_0x1a967a)||!_['isNil'](_0x1a967a[0x0][_0xe9bd('0x61')])&&_[_0xe9bd('0x41')](_0x1a967a[0x0][_0xe9bd('0x61')][_0xe9bd('0x27')])){ut[_0xe9bd('0x34')](_0xe9bd('0x105'),_0x1a967a);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x5353da=this['campaignsPreview'][_0x1a967a[0x0]['Queue'][_0xe9bd('0x27')]];_0x5353da['message']=utils[_0xe9bd('0x30')]['ACTIVE'];if(_[_0xe9bd('0x41')](_0x5353da)){ut[_0xe9bd('0x34')]('[Preview][validateContact][Empty\x20Campaign]',_0x5353da);return{'isValid':![],'message':_0xe9bd('0x106')};}if(!this[_0xe9bd('0x73')](_0x5353da[_0xe9bd('0x74')])){ut[_0xe9bd('0x34')](_0xe9bd('0x107'),_0xe9bd('0x108')+_0x5353da[_0xe9bd('0x27')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0xe9bd('0x73')](_0x5353da[_0xe9bd('0x109')])){ut[_0xe9bd('0x34')](_0xe9bd('0x107'),_0x5353da[_0xe9bd('0x27')]+_0xe9bd('0x10a'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0xe9bd('0x72')](_0x5353da[_0xe9bd('0x3b')])){ut[_0xe9bd('0x34')](_0xe9bd('0x10b'),_0x5353da[_0xe9bd('0x27')]+'\x20Not\x20Active');return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x5353da['name']+_0xe9bd('0x10c')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0xe9bd('0xf')][_0xe9bd('0xe9')]=function(_0x4d3c1b,_0x1547e1,_0x3b91ff,_0x29dce8){var _0x3d9732=this;return new Promise(function(_0x7d8c09,_0x1830a5){var _0x914313=_0x4d3c1b['uniqueid'];var _0x4ece76=_0x3d9732[_0xe9bd('0x73')](_0x1547e1['Trunk'])?util['format'](_0xe9bd('0x10d'),_0x1547e1[_0xe9bd('0x74')][_0xe9bd('0x27')],_[_0xe9bd('0x41')](_0x1547e1[_0xe9bd('0x10e')])?'':_0x1547e1[_0xe9bd('0x10e')][_0xe9bd('0x10f')]()||'',_0x1547e1[_0xe9bd('0x110')]>0x0?_0x3b91ff[_0xe9bd('0x101')][_0xe9bd('0x111')](_0x1547e1[_0xe9bd('0x110')]):_0x3b91ff['phone']):util[_0xe9bd('0x26')]('SIP/%s/%s%s',_[_0xe9bd('0x41')](_0x1547e1[_0xe9bd('0x109')])?_0x1547e1[_0xe9bd('0x74')][_0xe9bd('0x27')]:_0x1547e1['TrunkBackup'][_0xe9bd('0x27')],_[_0xe9bd('0x41')](_0x1547e1[_0xe9bd('0x10e')])?'':_0x1547e1['dialPrefix']['trim']()||'',_0x1547e1[_0xe9bd('0x110')]>0x0?_0x3b91ff[_0xe9bd('0x101')][_0xe9bd('0x111')](_0x1547e1[_0xe9bd('0x110')]):_0x3b91ff[_0xe9bd('0x101')]);var _0x170bd8=_0x3d9732['isTrunkReachable'](_0x1547e1[_0xe9bd('0x74')])?ut[_0xe9bd('0x112')](_0x1547e1[_0xe9bd('0x74')][_0xe9bd('0x113')],_0x1547e1['dialOriginateCallerIdName'],_0x1547e1[_0xe9bd('0x114')]>0x0?ut[_0xe9bd('0x115')](_0x1547e1[_0xe9bd('0x116')],_0x1547e1['dialRandomLastDigitCallerIdNumber']):_0x1547e1[_0xe9bd('0x116')]):ut[_0xe9bd('0x112')](_[_0xe9bd('0x41')](_0x1547e1[_0xe9bd('0x109')])?_0x1547e1[_0xe9bd('0x74')][_0xe9bd('0x113')]:_0x1547e1[_0xe9bd('0x109')]['callerid'],_0x1547e1['dialOriginateCallerIdName'],_0x1547e1[_0xe9bd('0x114')]>0x0?ut[_0xe9bd('0x115')](_0x1547e1[_0xe9bd('0x116')],_0x1547e1['dialRandomLastDigitCallerIdNumber']):_0x1547e1['dialOriginateCallerIdNumber']);if(_0x170bd8){_0x4d3c1b[_0xe9bd('0x117')]=ut[_0xe9bd('0x118')](_0x170bd8);_0x4d3c1b[_0xe9bd('0x119')]=ut['extractCalleridNumber'](_0x170bd8);}var _0x8c0d33=ut['addVariables'](_0x1547e1,_0x3b91ff,_0x4ece76,_0x170bd8,_0x914313,_0x4d3c1b);_[_0xe9bd('0x11a')](_0x4d3c1b,ut[_0xe9bd('0x11b')](_0x8c0d33));_0x4d3c1b[_0xe9bd('0x66')]=moment()[_0xe9bd('0x26')](_0xe9bd('0x67'));_0x1547e1[_0xe9bd('0x11c')]=_0x8c0d33;var _0x103791=ut[_0xe9bd('0x11d')](_0x4d3c1b,_0x1547e1,_0x8c0d33,_0x4d3c1b[_0xe9bd('0xa9')],_0x29dce8);return ami['Action'](_0x103791)['then'](function(_0x8ebe70){_0x1547e1[_0xe9bd('0x2b')]+=0x1;logger[_0xe9bd('0x24')](_0xe9bd('0x11e'),_0x914313,_0xe9bd('0x91'),_0x1547e1[_0xe9bd('0x27')],_0xe9bd('0x46'),_0x1547e1[_0xe9bd('0x2b')]);_0x7d8c09(_0x8ebe70);})['catch'](function(_0x45de5a){ut[_0xe9bd('0xda')](_0x4d3c1b,0xe,'OriginateError');rpcDb[_0xe9bd('0xdc')](_0x4d3c1b,'[originateFailure][logOriginateFailure]');_0x1830a5(_0x45de5a);});});};Preview[_0xe9bd('0xf')][_0xe9bd('0x11f')]=function(_0x401924){if(this['actions'][_0x401924[_0xe9bd('0x9e')]]){this[_0xe9bd('0x42')][_0x401924['linkedid']][_0xe9bd('0x50')]=_0x401924[_0xe9bd('0x50')];}};Preview[_0xe9bd('0xf')][_0xe9bd('0x120')]=function(_0x2256c2){var _0x4eb22e=this;var _0x3000a9=this[_0xe9bd('0x42')][_0x2256c2[_0xe9bd('0x121')]];if(_0x3000a9){if(_0x3000a9[_0xe9bd('0xe7')]&&this[_0xe9bd('0x15')][_0x3000a9[_0xe9bd('0xe7')]]){ut['logLookAgent'](_0x3000a9,this[_0xe9bd('0x15')][_0x3000a9['lookAgent']][_0xe9bd('0x27')],this['agents'][_0x3000a9[_0xe9bd('0xe7')]]['id']);}var _0x1ec28e=_['clone'](_0x3000a9);_0x1ec28e[_0xe9bd('0x8e')]=moment()[_0xe9bd('0x26')]('YYYY-MM-DD\x20HH:mm:ss');var _0xd2c2a1=_0x4eb22e['campaignsPreview'][_0x3000a9['queue']];if(ut['isFailure'](_0x2256c2[_0xe9bd('0x122')])){if(_0x3000a9[_0xe9bd('0x88')]){rpcDb['unlockContact'](_0x3000a9['idContact']);}if(_0x3000a9[_0xe9bd('0xa9')]){rpcDb['disableContact'](_0x3000a9[_0xe9bd('0x8a')]);}ami[_0xe9bd('0x23')]('custom:agentringnoanswer',ut[_0xe9bd('0x7c')](_0x3000a9,_0xe9bd('0x123'),this[_0xe9bd('0x12')][_0x3000a9[_0xe9bd('0x45')]]));this[_0xe9bd('0xd6')](_0x1ec28e,_0xd2c2a1,_0x2256c2);}else{_0x3000a9[_0xe9bd('0x66')]=moment()[_0xe9bd('0x26')](_0xe9bd('0x67'));ut[_0xe9bd('0xda')](_0x1ec28e,0x4,_0xe9bd('0x97'));rpcDb[_0xe9bd('0xdc')](_0x1ec28e,_0xe9bd('0x124'));}}};Preview[_0xe9bd('0xf')]['syncHangup']=function(_0x3713fa){var _0x30c944=this[_0xe9bd('0x42')][_0x3713fa[_0xe9bd('0x9e')]];var _0x2feda3;if(_0x30c944){_0x2feda3=this['campaignsPreview'][_0x30c944[_0xe9bd('0x45')]];logger[_0xe9bd('0x24')](_0xe9bd('0x125'),_0x3713fa[_0xe9bd('0x9e')],_0xe9bd('0x91'),_0x2feda3[_0xe9bd('0x27')],_0xe9bd('0x47'),_0x2feda3['pTalking']);}if(this[_0xe9bd('0x42')][_0x3713fa[_0xe9bd('0x9e')]]&&_0x3713fa['linkedid']!==_0x3713fa[_0xe9bd('0x90')]){if(_0x3713fa[_0xe9bd('0x126')]==='16'&&this[_0xe9bd('0x42')][_0x3713fa[_0xe9bd('0x9e')]][_0xe9bd('0x49')]){this[_0xe9bd('0x76')](_0x3713fa,_0x3713fa[_0xe9bd('0x9e')],_0x3713fa[_0xe9bd('0x126')]);}else if(this['actions'][_0x3713fa[_0xe9bd('0x9e')]][_0xe9bd('0x49')]){logger[_0xe9bd('0x24')]('[syncHangup][talking][cause]',_0x3713fa[_0xe9bd('0x9e')],_0x3713fa[_0xe9bd('0x126')],'\x20Queue',_0x2feda3['name'],_0xe9bd('0x47'),_0x2feda3['pTalking']);this[_0xe9bd('0x76')](_0x3713fa,_0x3713fa[_0xe9bd('0x9e')],_0x3713fa[_0xe9bd('0x126')]);}}else if(_0x30c944&&_[_0xe9bd('0x41')](_0x30c944[_0xe9bd('0x127')])&&_0x2feda3[_0xe9bd('0x128')]&&_0x3713fa[_0xe9bd('0x9e')]===_0x3713fa[_0xe9bd('0x90')]&&_['isNil'](_0x3713fa[_0xe9bd('0xd9')])&&_0x3713fa[_0xe9bd('0x126')]==='16'&&_0x3713fa[_0xe9bd('0x129')]==='6'&&_[_0xe9bd('0xd7')](_0x30c944[_0xe9bd('0x12a')])){if(_0x30c944[_0xe9bd('0x88')]){rpcDb['unlockContact'](_0x30c944[_0xe9bd('0x8a')]);}if(_0x30c944[_0xe9bd('0xa9')]){rpcDb[_0xe9bd('0x65')](_0x30c944[_0xe9bd('0x8a')]);}_0x3713fa[_0xe9bd('0xd9')]='22';this[_0xe9bd('0xd6')](_0x30c944,_0x2feda3,_0x3713fa);}else if(_0x30c944&&_0x30c944[_0xe9bd('0x12a')]){if(_0x3713fa[_0xe9bd('0x126')]==='16'&&this['actions'][_0x3713fa['linkedid']][_0xe9bd('0x49')]){logger[_0xe9bd('0x24')](_0xe9bd('0x12b'),_0x3713fa[_0xe9bd('0x9e')],_0x3713fa[_0xe9bd('0x126')],_0xe9bd('0x91'),_0x2feda3[_0xe9bd('0x27')],_0xe9bd('0x47'),_0x2feda3[_0xe9bd('0x2c')]);this[_0xe9bd('0x76')](_0x3713fa,_0x3713fa['linkedid'],_0x3713fa[_0xe9bd('0x126')]);}else if(this[_0xe9bd('0x42')][_0x3713fa[_0xe9bd('0x9e')]][_0xe9bd('0x49')]){logger[_0xe9bd('0x24')](_0xe9bd('0x12c'),_0x3713fa[_0xe9bd('0x9e')],_0x3713fa['cause'],_0xe9bd('0x91'),_0x2feda3[_0xe9bd('0x27')],_0xe9bd('0x47'),_0x2feda3[_0xe9bd('0x2c')]);this[_0xe9bd('0x76')](_0x3713fa,_0x3713fa['linkedid'],_0x3713fa[_0xe9bd('0x126')]);}}};Preview[_0xe9bd('0xf')][_0xe9bd('0x1c')]=function(_0x2cd552){if(this[_0xe9bd('0x42')][_0x2cd552['destlinkedid']]&&_0x2cd552[_0xe9bd('0xd4')]!==_0x2cd552['destuniqueid']){this[_0xe9bd('0x76')](_0x2cd552,_0x2cd552[_0xe9bd('0xd4')],_0x2cd552[_0xe9bd('0xcb')]);}};Preview['prototype']['syncHangupRequest']=function(_0x38096d){if(this[_0xe9bd('0x42')][_0x38096d[_0xe9bd('0x9e')]]&&_0x38096d['linkedid']!==_0x38096d[_0xe9bd('0x90')]&&!this[_0xe9bd('0x42')][_0x38096d[_0xe9bd('0x9e')]][_0xe9bd('0x49')]){if(_0x38096d[_0xe9bd('0x126')]==='1'){this[_0xe9bd('0x76')](_0x38096d,_0x38096d[_0xe9bd('0x9e')],_0x38096d[_0xe9bd('0x126')]);}}};Preview[_0xe9bd('0xf')][_0xe9bd('0x12d')]=function(_0x1bae64,_0x23f104,_0x3b5bca){if(this[_0xe9bd('0x42')][_0x1bae64]){if(_['isNil'](this[_0xe9bd('0x42')][_0x1bae64][_0xe9bd('0x11c')])){this['actions'][_0x1bae64][_0xe9bd('0x11c')]={};}this[_0xe9bd('0x42')][_0x1bae64][_0xe9bd('0x11c')][_0x23f104]=_0x3b5bca;}};Preview[_0xe9bd('0xf')]['syncVarSet']=function(_0xd0d700){try{if(!_[_0xe9bd('0x41')](_0xd0d700)){if(ut[_0xe9bd('0x12e')](_[_0xe9bd('0x12f')](_0xd0d700[_0xe9bd('0x130')])[0x0])){this['addVariable'](_0xd0d700[_0xe9bd('0x90')],_['keys'](_0xd0d700[_0xe9bd('0x130')])[0x0],_0xd0d700[_0xe9bd('0x131')]);}}}catch(_0x8f8874){logger[_0xe9bd('0x132')](_0xe9bd('0x133'),util['inspect'](_0x8f8874,{'showHidden':![],'depth':null}));}};Preview[_0xe9bd('0xf')][_0xe9bd('0x20')]=function(_0x268025){if(_0x268025){if(this[_0xe9bd('0x42')][_0x268025[_0xe9bd('0x134')]]){this[_0xe9bd('0x42')][_0x268025[_0xe9bd('0x134')]]['transfer']=!![];}}};Preview[_0xe9bd('0xf')][_0xe9bd('0x135')]=function(_0x76aaa6){if(_0x76aaa6){if(this[_0xe9bd('0x42')][_0x76aaa6[_0xe9bd('0x136')]]){this['actions'][_0x76aaa6[_0xe9bd('0x136')]][_0xe9bd('0x12a')]=!![];}}};module[_0xe9bd('0x137')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 9c320cc..41198c5 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 _0x5824=['queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','bluebird','preview','error','inspect','createHistory','catch','[createHistory]\x20','resolve','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','then','[getContactPreview]\x20','createCustomerHistory','rescheduleContact','UserId','active','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname'];(function(_0x55d8e9,_0x548b5a){var _0x5484f9=function(_0x22c205){while(--_0x22c205){_0x55d8e9['push'](_0x55d8e9['shift']());}};_0x5484f9(++_0x548b5a);}(_0x5824,0x74));var _0x4582=function(_0x532d1c,_0x48f2d8){_0x532d1c=_0x532d1c-0x0;var _0x134d2d=_0x5824[_0x532d1c];return _0x134d2d;};'use strict';var util=require('util');var BPromise=require(_0x4582('0x0'));var logger=require('../../../config/logger')(_0x4582('0x1'));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x285cba){return function(_0x1b1d2a){logger[_0x4582('0x2')](_0x285cba,util[_0x4582('0x3')](_0x1b1d2a,{'showHidden':![],'depth':null}));};}function create(_0x333b9f){return cmHopperHistory[_0x4582('0x4')](_0x333b9f)[_0x4582('0x5')](loggerCatch(_0x4582('0x6')));}function createAgent(_0x9cc9b1){return BPromise[_0x4582('0x7')]()['then'](agentReportPreview[_0x4582('0x4')](_0x9cc9b1))['catch'](loggerCatch(_0x4582('0x6')));}function moveContact(_0x10d6f0){return cmHopper[_0x4582('0x8')](_0x10d6f0,!![])[_0x4582('0x5')](loggerCatch(_0x4582('0x9')));}exports[_0x4582('0xa')]=function(_0xf49338){return cmHopperBlack[_0x4582('0xa')](_0xf49338)[_0x4582('0x5')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x4582('0xb')]=function(_0x152852){return BPromise[_0x4582('0x7')]()[_0x4582('0xc')](cmHopper['getContactPreview'](_0x152852))[_0x4582('0x5')](loggerCatch(_0x4582('0xd')));};exports['createHistory']=function(_0x522b93,_0x304b2){create(_0x522b93)[_0x4582('0x5')](loggerCatch(_0x304b2));moveContact(_0x522b93)[_0x4582('0x5')](loggerCatch(_0x304b2));};exports['createAgentHistory']=function(_0x2dbc99,_0x268e0a){createAgent(_0x2dbc99)[_0x4582('0x5')](loggerCatch(_0x268e0a));};exports[_0x4582('0xe')]=function(_0x26e772,_0x227e03){create(_0x26e772)[_0x4582('0x5')](loggerCatch(_0x227e03));};exports['createCustomerFinal']=function(_0x4f790a,_0x46ec72){moveContact(_0x4f790a)[_0x4582('0x5')](loggerCatch(_0x46ec72));};exports[_0x4582('0xf')]=function(_0x1f9920,_0x200e7d,_0x348e99){if(_0x200e7d){_0x1f9920[_0x4582('0x10')]=null;}if(_0x348e99){_0x1f9920[_0x4582('0x11')]=![];}return cmHopper['rescheduleContact'](_0x1f9920)[_0x4582('0x5')](loggerCatch('[rescheduleContact]\x20'));};exports[_0x4582('0x12')]=function(_0x5b2cb5){return cmHopper[_0x4582('0x12')](_0x5b2cb5)['catch'](loggerCatch(_0x4582('0x13')));};exports['unlockContact']=function(_0x4198d4){return cmHopper[_0x4582('0x14')]({'UserId':null},_0x4198d4,0x1)['catch'](loggerCatch(_0x4582('0x15')));};exports[_0x4582('0x16')]=function(_0x1665d6){return cmHopper[_0x4582('0x14')]({'active':![]},_0x1665d6,0x1)['catch'](loggerCatch('[activeContact]\x20'));};exports[_0x4582('0x17')]=function(_0x5ed247){var _0x223ace={};_0x223ace[_0x4582('0x18')]=_0x5ed247[_0x4582('0x18')];_0x223ace[_0x4582('0x19')]=_0x5ed247[_0x4582('0x19')];_0x223ace[_0x4582('0x1a')]=_0x5ed247[_0x4582('0x1a')];_0x223ace[_0x4582('0x1b')]=_0x5ed247[_0x4582('0x1b')];_0x223ace[_0x4582('0x1c')]=_0x5ed247[_0x4582('0x1c')];_0x223ace[_0x4582('0x1d')]=_0x5ed247[_0x4582('0x1e')];_0x223ace[_0x4582('0x1f')]=_0x5ed247[_0x4582('0x1e')];_0x223ace[_0x4582('0x20')]=0x1;_0x223ace[_0x4582('0x21')]=_0x5ed247[_0x4582('0x22')];_0x223ace[_0x4582('0x23')]=_0x5ed247[_0x4582('0x24')];_0x223ace[_0x4582('0x25')]=_0x4582('0x26');_0x223ace[_0x4582('0x27')]=_0x4582('0x28');_0x223ace['holdtime']=0x0;_0x223ace[_0x4582('0x29')]=0x1;_0x223ace[_0x4582('0x2a')]=_0x5ed247[_0x4582('0x24')];_0x223ace[_0x4582('0x2b')]=_0x4582('0x2c');return BPromise[_0x4582('0x7')]()[_0x4582('0xc')](voiceQueueReport['create'](_0x223ace))[_0x4582('0x5')](loggerCatch(_0x4582('0x2d')));};exports[_0x4582('0x2e')]=function(_0x5a850b,_0xf3be9c){return BPromise['resolve']()['then'](cmHopper[_0x4582('0x2e')](_0x5a850b,_0xf3be9c))[_0x4582('0x5')](loggerCatch(_0x4582('0x2f')));};exports['rescheduleContactInQueue']=function(_0x393a66){return cmHopper[_0x4582('0xf')](_0x393a66,!![],!![])[_0x4582('0x5')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0xcf0a=['../rpc/voiceQueueReport','error','inspect','createHistory','[createHistory]\x20','resolve','then','catch','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/agentReportPreview'];(function(_0x337a10,_0x5191c7){var _0x575f98=function(_0x3851cd){while(--_0x3851cd){_0x337a10['push'](_0x337a10['shift']());}};_0x575f98(++_0x5191c7);}(_0xcf0a,0x67));var _0xacf0=function(_0x4fa3e1,_0x27a280){_0x4fa3e1=_0x4fa3e1-0x0;var _0x1964ae=_0xcf0a[_0x4fa3e1];return _0x1964ae;};'use strict';var util=require(_0xacf0('0x0'));var BPromise=require(_0xacf0('0x1'));var logger=require(_0xacf0('0x2'))(_0xacf0('0x3'));var cmHopper=require(_0xacf0('0x4'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xacf0('0x5'));var agentReportPreview=require(_0xacf0('0x6'));var voiceQueueReport=require(_0xacf0('0x7'));function loggerCatch(_0x4221f0){return function(_0x543e60){logger[_0xacf0('0x8')](_0x4221f0,util[_0xacf0('0x9')](_0x543e60,{'showHidden':![],'depth':null}));};}function create(_0x5d4ef4){return cmHopperHistory[_0xacf0('0xa')](_0x5d4ef4)['catch'](loggerCatch(_0xacf0('0xb')));}function createAgent(_0xea209e){return BPromise[_0xacf0('0xc')]()[_0xacf0('0xd')](agentReportPreview['createHistory'](_0xea209e))[_0xacf0('0xe')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x40e550){return cmHopper['moveContactManagedDialer'](_0x40e550,!![])[_0xacf0('0xe')](loggerCatch(_0xacf0('0xf')));}exports[_0xacf0('0x10')]=function(_0x1e1a4c){return cmHopperBlack[_0xacf0('0x10')](_0x1e1a4c)['catch'](loggerCatch(_0xacf0('0x11')));};exports[_0xacf0('0x12')]=function(_0x31c7ad){return BPromise[_0xacf0('0xc')]()[_0xacf0('0xd')](cmHopper[_0xacf0('0x12')](_0x31c7ad))[_0xacf0('0xe')](loggerCatch('[getContactPreview]\x20'));};exports[_0xacf0('0xa')]=function(_0x310154,_0xc06972){create(_0x310154)[_0xacf0('0xe')](loggerCatch(_0xc06972));moveContact(_0x310154)['catch'](loggerCatch(_0xc06972));};exports[_0xacf0('0x13')]=function(_0x4fcb88,_0x2fba43){createAgent(_0x4fcb88)[_0xacf0('0xe')](loggerCatch(_0x2fba43));};exports[_0xacf0('0x14')]=function(_0x1b9d12,_0x21dfba){create(_0x1b9d12)[_0xacf0('0xe')](loggerCatch(_0x21dfba));};exports['createCustomerFinal']=function(_0x455269,_0xc546aa){moveContact(_0x455269)['catch'](loggerCatch(_0xc546aa));};exports[_0xacf0('0x15')]=function(_0x320a50,_0x1d318a,_0x34e678){if(_0x1d318a){_0x320a50['UserId']=null;}if(_0x34e678){_0x320a50[_0xacf0('0x16')]=![];}return cmHopper[_0xacf0('0x15')](_0x320a50)[_0xacf0('0xe')](loggerCatch(_0xacf0('0x17')));};exports[_0xacf0('0x18')]=function(_0x33ee9f){return cmHopper[_0xacf0('0x18')](_0x33ee9f)['catch'](loggerCatch(_0xacf0('0x19')));};exports[_0xacf0('0x1a')]=function(_0x3bdfce){return cmHopper[_0xacf0('0x1a')]({'UserId':null},_0x3bdfce,0x1)['catch'](loggerCatch(_0xacf0('0x1b')));};exports[_0xacf0('0x1c')]=function(_0x41fa9a){return cmHopper[_0xacf0('0x1a')]({'active':![]},_0x41fa9a,0x1)[_0xacf0('0xe')](loggerCatch(_0xacf0('0x1d')));};exports[_0xacf0('0x1e')]=function(_0x1e2b58){var _0x4a8e68={};_0x4a8e68[_0xacf0('0x1f')]=_0x1e2b58[_0xacf0('0x1f')];_0x4a8e68[_0xacf0('0x20')]=_0x1e2b58[_0xacf0('0x20')];_0x4a8e68[_0xacf0('0x21')]=_0x1e2b58[_0xacf0('0x21')];_0x4a8e68[_0xacf0('0x22')]=_0x1e2b58[_0xacf0('0x22')];_0x4a8e68['queue']=_0x1e2b58[_0xacf0('0x23')];_0x4a8e68['queuecallerjoinAt']=_0x1e2b58['answertime'];_0x4a8e68[_0xacf0('0x24')]=_0x1e2b58[_0xacf0('0x25')];_0x4a8e68[_0xacf0('0x26')]=0x1;_0x4a8e68[_0xacf0('0x27')]=_0x1e2b58[_0xacf0('0x28')];_0x4a8e68[_0xacf0('0x29')]=_0x1e2b58[_0xacf0('0x2a')];_0x4a8e68[_0xacf0('0x2b')]='from-sip';_0x4a8e68[_0xacf0('0x2c')]=_0xacf0('0x2d');_0x4a8e68[_0xacf0('0x2e')]=0x0;_0x4a8e68[_0xacf0('0x2f')]=0x1;_0x4a8e68[_0xacf0('0x30')]=_0x1e2b58[_0xacf0('0x2a')];_0x4a8e68[_0xacf0('0x31')]=_0xacf0('0x32');return BPromise['resolve']()['then'](voiceQueueReport[_0xacf0('0x33')](_0x4a8e68))[_0xacf0('0xe')](loggerCatch(_0xacf0('0x34')));};exports[_0xacf0('0x35')]=function(_0x1831a9,_0x3f4d25){return BPromise['resolve']()[_0xacf0('0xd')](cmHopper[_0xacf0('0x35')](_0x1831a9,_0x3f4d25))[_0xacf0('0xe')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xacf0('0x36')]=function(_0x44d99c){return cmHopper[_0xacf0('0x15')](_0x44d99c,!![],!![])[_0xacf0('0xe')](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 7f5b9c0..e653c9b 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 _0x81fb=['originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','responsetime','logAgent','state','ringtime','getSeconds','starttime','membername','UserId','logCustomer','endtime','talktime','answertime','isFailure','Failure','variablesAction','uniqueid','channelAgent','from-sip','timeout','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','active','scheduledat','add','minutes','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','lastevent','queue','voice','mandatoryDisposition','buildObj','interface','agentReadyId','status','reachable','getDiff','milliseconds','seconds','createBody','CampaignId','filterKey','idContact','campaigntype','dialAnswer','countbusyretry','countglobal','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialtimeout','xmd-dialoptions','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','\x5cw{0,','pow','replace','random','match','noanswer','keys','variables','forEach','toLowerCase','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','error','inspect','logger','info','message','getCallerId','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','NONE','\x22agi://%s/square,%s\x22','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','Contact','hasOwnProperty','tags','createdAt','%s%s','XMD-','toUpper','updateOriginated'];(function(_0x4ae213,_0x3aedf1){var _0x369d43=function(_0x5d8504){while(--_0x5d8504){_0x4ae213['push'](_0x4ae213['shift']());}};_0x369d43(++_0x3aedf1);}(_0x81fb,0xec));var _0xb81f=function(_0x55c87a,_0xaa9857){_0x55c87a=_0x55c87a-0x0;var _0x5a6740=_0x81fb[_0x55c87a];return _0x5a6740;};'use strict';var util=require(_0xb81f('0x0'));var _=require(_0xb81f('0x1'));var moment=require(_0xb81f('0x2'));var logger=require(_0xb81f('0x3'))(_0xb81f('0x4'));var ipAgi=process[_0xb81f('0x5')][_0xb81f('0x6')]||_0xb81f('0x7');var utils=require(_0xb81f('0x8'));exports[_0xb81f('0x9')]=function(_0x1198fd){return function(_0x536e84){logger[_0xb81f('0xa')](_0x1198fd,util[_0xb81f('0xb')](_0x536e84,{'showHidden':![],'depth':null}));};};exports[_0xb81f('0xc')]=function(_0x41909c,_0x362a76){logger[_0xb81f('0xd')](_0x41909c,util['inspect'](_0x362a76,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x2d28e1,_0x3481d6){logger['error'](_0x2d28e1,util['inspect'](_0x3481d6,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x26127a){return function(_0x2fd52c){logger[_0xb81f('0xd')](_0x26127a,util[_0xb81f('0xb')](_0x2fd52c,{'showHidden':![],'depth':null}));};};exports[_0xb81f('0xe')]=function(_0x349dba,_0x49aa70,_0x34a003){return{'message':_0x349dba,'unlock':_0x49aa70,'active':_0x34a003};};exports[_0xb81f('0xf')]=function(_0x3a8013,_0x1a639f,_0x24754d){if(!_['isUndefined'](_0x24754d)&&_0xb81f('0x10')===typeof _0x24754d&&!_[_0xb81f('0x11')](_0x24754d)){if(!_[_0xb81f('0x12')](_0x1a639f)&&_0xb81f('0x10')===typeof _0x1a639f&&!_[_0xb81f('0x11')](_0x1a639f)){return util[_0xb81f('0x13')](_0xb81f('0x14'),_0x1a639f,_0x24754d);}return util[_0xb81f('0x13')](_0xb81f('0x14'),_0x24754d,_0x24754d);}if(!_[_0xb81f('0x12')](_0x3a8013)&&_0xb81f('0x10')===typeof _0x3a8013&&!_[_0xb81f('0x11')](_0x3a8013)){return _0x3a8013;}return _0xb81f('0x15');};exports[_0xb81f('0x16')]=function(_0x3f2e7c){if(_[_0xb81f('0x17')](_0x3f2e7c)){return![];}return _0x3f2e7c;};exports[_0xb81f('0x18')]=function(_0x2e4089,_0x28651a,_0x1afce0,_0x1009a3,_0x25e050,_0x1cfcd2){var _0x57f811={'XMD-QUEUE':_0x28651a[_0xb81f('0x19')]?_0x28651a[_0xb81f('0x19')][_0xb81f('0x1a')]:'','XMD-CALLERID':_0x1009a3,'XMD-CALLERID-PREVIEW':_0x1cfcd2?util[_0xb81f('0x13')](_0xb81f('0x14'),_0x1cfcd2[_0xb81f('0x1b')],_0x1cfcd2[_0xb81f('0x1c')]):_0x1009a3,'XMD-DIALID':_0x25e050,'XMD-CONTACTID':_0x28651a[_0xb81f('0x1d')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x1009a3,'XMD-VOICEQUEUEID':_0x28651a[_0xb81f('0x1e')],'XMD-DIALCHANNEL':_0x1afce0,'XMD-DIALTIMEOUT':_0x2e4089[_0xb81f('0x1f')]||0x1e,'XMD-DIALOPTIONS':util[_0xb81f('0x13')](_0xb81f('0x20'),_0x2e4089[_0xb81f('0x21')]?'g':'',_[_0xb81f('0x11')](_0x2e4089[_0xb81f('0x22')])?'':_0xb81f('0x23')),'XMD-DIALURL':_0x2e4089[_0xb81f('0x24')]||'','XMD-AGI':_0x2e4089['dialQueueProject']?util[_0xb81f('0x13')]('\x22agi://%s/square,%s\x22',ipAgi,_0x2e4089['dialQueueProject']):_0xb81f('0x25'),'XMD-AGIAFTER':_0x2e4089['dialQueueProject2']?util['format'](_0xb81f('0x26'),ipAgi,_0x2e4089[_0xb81f('0x21')]):_0xb81f('0x25'),'XMD-ORIGINATECALLERIDNUM':_0x1cfcd2?_0x1cfcd2['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x1cfcd2?_0x1cfcd2[_0xb81f('0x27')]:'','XMD-DESTINATION':_0xb81f('0x28'),'SIPADDHEADER':_0xb81f('0x29')};if(!_[_0xb81f('0x11')](_0x2e4089[_0xb81f('0x22')])){_0x57f811[util['format']('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x2e4089[_0xb81f('0x22')];_0x57f811[util['format']('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x25e050;}if(_0x28651a&&_0x28651a['Contact']){for(var _0x3e2292 in _0x28651a[_0xb81f('0x2a')]){if(_0x28651a[_0xb81f('0x2a')][_0xb81f('0x2b')](_0x3e2292)){if(!_[_0xb81f('0x17')](_0x28651a[_0xb81f('0x2a')][_0x3e2292])&&_0x3e2292!=='id'&&_0x3e2292!==_0xb81f('0x2c')&&_0x3e2292!==_0xb81f('0x2d')&&_0x3e2292!=='updatedAt'){_0x57f811[util[_0xb81f('0x13')](_0xb81f('0x2e'),_0xb81f('0x2f'),_[_0xb81f('0x30')](_0x3e2292))]=_0x28651a[_0xb81f('0x2a')][_0x3e2292];}}}}return _0x57f811;};exports['toLowerVariables']=function(_0x35edc9){var _0x3966a8={};for(var _0x410104 in _0x35edc9){if(_0x35edc9['hasOwnProperty'](_0x410104)){_0x3966a8[util[_0xb81f('0x13')]('%s',_['toLower'](_0x410104))]=_0x35edc9[_0x410104];}}return{'variables':_0x3966a8};};exports[_0xb81f('0x31')]=function(_0x149236,_0x525e15){if(!_[_0xb81f('0x17')](_0x149236)){if(_0x149236[_0xb81f('0x2b')]('originated')){if(_0x149236['originated']>0x0){_0x149236[_0xb81f('0x32')]-=0x1;}else{logger[_0xb81f('0xa')](_0xb81f('0x33'),_0x525e15);}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x525e15);}};exports[_0xb81f('0x34')]=function(_0x23c96a){var _0x3f91a0=moment()[_0xb81f('0x13')](_0xb81f('0x35'));_0x23c96a['state']=0xd;_0x23c96a[_0xb81f('0x36')]=_0xb81f('0x37');_0x23c96a['starttime']=_0x3f91a0;_0x23c96a[_0xb81f('0x38')]=_0x3f91a0;_0x23c96a['endtime']=_0x3f91a0;};exports[_0xb81f('0x39')]=function(_0x26b3f6,_0x3a79ff,_0x60d13b){var _0x543cca=moment()[_0xb81f('0x13')](_0xb81f('0x35'));_0x26b3f6[_0xb81f('0x3a')]=_0x3a79ff;_0x26b3f6['statedesc']=_0x60d13b;_0x26b3f6[_0xb81f('0x38')]=_0x543cca;_0x26b3f6[_0xb81f('0x3b')]=utils[_0xb81f('0x3c')](_0x26b3f6['responsetime'],_0x26b3f6[_0xb81f('0x3d')]);};exports['logLookAgent']=function(_0x80705e,_0x4f227f,_0x5ba5e0){_0x80705e[_0xb81f('0x3e')]=_0x4f227f;_0x80705e[_0xb81f('0x3f')]=_0x5ba5e0;};exports[_0xb81f('0x40')]=function(_0x51ece0,_0x1304ef,_0x5f08f0){var _0x24b92d=moment()[_0xb81f('0x13')](_0xb81f('0x35'));_0x51ece0[_0xb81f('0x3a')]=_0x1304ef;_0x51ece0[_0xb81f('0x36')]=_0x5f08f0;_0x51ece0[_0xb81f('0x38')]=_0x51ece0[_0xb81f('0x38')]?_0x51ece0[_0xb81f('0x38')]:_0x24b92d;_0x51ece0[_0xb81f('0x41')]=_0x51ece0[_0xb81f('0x41')]?_0x51ece0[_0xb81f('0x41')]:_0x24b92d;_0x51ece0[_0xb81f('0x3b')]=utils[_0xb81f('0x3c')](_0x51ece0['responsetime']||0x0,_0x51ece0['starttime']||0x0);_0x51ece0[_0xb81f('0x42')]=_0x51ece0[_0xb81f('0x43')]?utils[_0xb81f('0x3c')](_0x51ece0[_0xb81f('0x41')],_0x51ece0[_0xb81f('0x43')]):0x0;};exports[_0xb81f('0x44')]=function(_0x332511){return _0x332511===_0xb81f('0x45');};exports[_0xb81f('0x46')]=function(_0x53ae15,_0x5582af,_0x3f55fa,_0x4631e5,_0x13f511){var _0x5c18b5=_0x4631e5?'RECALL':_0x53ae15[_0xb81f('0x1b')];_0x5c18b5=_0x13f511?'BOOKED':_0x5c18b5;return{'actionid':_0x53ae15[_0xb81f('0x47')],'action':'originate','channel':_0x53ae15[_0xb81f('0x48')],'callerid':util[_0xb81f('0x13')](_0xb81f('0x14'),_0x5c18b5,_0x53ae15[_0xb81f('0x1c')]),'Exten':_0xb81f('0x28'),'Context':_0xb81f('0x49'),'Priority':'1','variable':_0x3f55fa,'timeout':(_0x5582af[_0xb81f('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x53ae15[_0xb81f('0x47')]};};exports['totalGlobal']=function(_0x15c455){return _0x15c455['countbusyretry']+_0x15c455[_0xb81f('0x4b')]+_0x15c455[_0xb81f('0x4c')]+_0x15c455[_0xb81f('0x4d')]+_0x15c455[_0xb81f('0x4e')];};exports[_0xb81f('0x4f')]=function(_0x4cb17c){var _0x2ffb77=_[_0xb81f('0x50')](_0x4cb17c);_0x2ffb77[_0xb81f('0x3a')]=0xf;_0x2ffb77[_0xb81f('0x36')]='Global';return _0x2ffb77;};exports['scheduledAt']=function(_0x1ca737,_0x28bd47,_0x4e260e){var _0x47a914={};_0x47a914[_0x28bd47]=_0x1ca737[_0x28bd47];_0x47a914[_0xb81f('0x51')]=![];_0x47a914[_0xb81f('0x52')]=moment()[_0xb81f('0x53')](_0x4e260e,_0xb81f('0x54'))[_0xb81f('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x47a914['ContactId']=_0x1ca737['ContactId'];_0x47a914['ListId']=_0x1ca737[_0xb81f('0x55')];_0x47a914['VoiceQueueId']=_0x1ca737['VoiceQueueId']||undefined;return _0x47a914;};exports['decrementTalkink']=function(_0x5ec2da,_0x2edb25){if(!_[_0xb81f('0x17')](_0x5ec2da)){if(_0x5ec2da[_0xb81f('0x56')]>0x0){_0x5ec2da[_0xb81f('0x56')]-=0x1;}else{logger[_0xb81f('0xa')](_0x2edb25,_0xb81f('0x57'));}}else{logger[_0xb81f('0xa')](_0x2edb25,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0xb81f('0x58')]=function(_0x1baf10){if(_0x1baf10<=0x0){return!![];}return![];};function buildObj(_0x2482e8,_0x41f6ca,_0x21ef61){_0x2482e8[_0xb81f('0x59')]=_0x41f6ca;_0x2482e8[_0xb81f('0x1a')]=_0x2482e8[_0xb81f('0x5a')];_0x2482e8['interface']=_0x2482e8[_0xb81f('0x48')];_0x2482e8['motionChannel']=_0xb81f('0x5b');if(_0x21ef61){_0x2482e8[_0xb81f('0x5c')]=_0x21ef61['mandatoryDisposition'];}return _0x2482e8;}exports[_0xb81f('0x5d')]=buildObj;exports['buildAcw']=function(_0x3a863e){var _0x3a8aa3={};_0x3a8aa3[_0xb81f('0x5a')]=_0x3a863e[_0xb81f('0x5a')];_0x3a8aa3[_0xb81f('0x5e')]=_0x3a863e['channelAgent'];_0x3a8aa3[_0xb81f('0x47')]=_0x3a863e['uniqueid'];return _0x3a8aa3;};exports[_0xb81f('0x5f')]=function(_0x53b5a6){var _0x1c3320=[];for(var _0xea660c in _0x53b5a6){if(_0x53b5a6[_0xb81f('0x2b')](_0xea660c)){if(!_[_0xb81f('0x17')](_0x53b5a6[_0xea660c])&&_0x53b5a6[_0xea660c]['state']==='not_inuse'&&_0x53b5a6[_0xea660c][_0xb81f('0x60')]===_0xb81f('0x61')){_0x1c3320['push'](_0x53b5a6[_0xea660c]['id']);}}}return _0x1c3320;};exports[_0xb81f('0x62')]=function(_0x97cd3d){var _0x5a0e16=moment()['milliseconds'](0x0);var _0x125d48=moment(_0x97cd3d)[_0xb81f('0x63')](0x0);return _0x5a0e16['diff'](_0x125d48,_0xb81f('0x64'));};exports[_0xb81f('0x65')]=function(_0x183798){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x183798['ContactId'],'ListId':_0x183798[_0xb81f('0x55')],'VoiceQueueId':_0x183798[_0xb81f('0x1e')]||undefined,'CampaignId':_0x183798[_0xb81f('0x66')]||undefined};};exports[_0xb81f('0x67')]=function(_0x32fc8d){if(_0x32fc8d===_0xb81f('0x47')||_0x32fc8d===_0xb81f('0x68')||_0x32fc8d===_0xb81f('0x5a')||_0x32fc8d==='type'||_0x32fc8d===_0xb81f('0x69')||_0x32fc8d===_0xb81f('0x6a')||_0x32fc8d==='membername'||_0x32fc8d===_0xb81f('0x48')||_0x32fc8d===_0xb81f('0x1b')||_0x32fc8d===_0xb81f('0x51')||_0x32fc8d===_0xb81f('0x1c')||_0x32fc8d===_0xb81f('0x52')||_0x32fc8d===_0xb81f('0x6b')||_0x32fc8d==='countcongestionretry'||_0x32fc8d===_0xb81f('0x4c')||_0x32fc8d===_0xb81f('0x6c')||_0x32fc8d==='callback'||_0x32fc8d===_0xb81f('0x6d')||_0x32fc8d===_0xb81f('0x6e')||_0x32fc8d===_0xb81f('0x6f')||_0x32fc8d==='ContactId'||_0x32fc8d===_0xb81f('0x55')||_0x32fc8d===_0xb81f('0x3f')||_0x32fc8d===_0xb81f('0x1e')||_0x32fc8d===_0xb81f('0x70')||_0x32fc8d===_0xb81f('0x71')||_0x32fc8d===_0xb81f('0x72')||_0x32fc8d===_0xb81f('0x73')||_0x32fc8d==='xmd-listid'||_0x32fc8d==='xmd-dialurl'||_0x32fc8d===_0xb81f('0x74')||_0x32fc8d===_0xb81f('0x75')||_0x32fc8d==='xmd-dialid'||_0x32fc8d==='xmd-dialchannel'||_0x32fc8d===_0xb81f('0x76')||_0x32fc8d===_0xb81f('0x77')||_0x32fc8d===_0xb81f('0x78')||_0x32fc8d===_0xb81f('0x79')||_0x32fc8d===_0xb81f('0x7a')||_0x32fc8d===_0xb81f('0x7b')||_0x32fc8d===_0xb81f('0x7c')||_0x32fc8d===_0xb81f('0x7d')||_0x32fc8d===_0xb81f('0x7e')||_0x32fc8d===_0xb81f('0x7f')||_0x32fc8d===_0xb81f('0x80')||_0x32fc8d===_0xb81f('0x81')||_0x32fc8d===_0xb81f('0x82')||_0x32fc8d===_0xb81f('0x7b')||_0x32fc8d===_0xb81f('0x7c')||_0x32fc8d===_0xb81f('0x7d')||_0x32fc8d==='rtpaudioqosjitterbridged'||_0x32fc8d===_0xb81f('0x7f')||_0x32fc8d==='rtpaudioqoslossbridged'||_0x32fc8d===_0xb81f('0x81')||_0x32fc8d===_0xb81f('0x82')||_0x32fc8d===_0xb81f('0x83')||_0x32fc8d==='bridgepvtcallid'||_0x32fc8d===_0xb81f('0x3a')||_0x32fc8d==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x2aee52,_0x2e9f4c){var _0x371b1b,_0x3f4382,_0x3044f9;if(_0x2e9f4c<=0x0){_0x2e9f4c=0x1;}_0x371b1b=new RegExp(_0xb81f('0x84')+_0x2e9f4c+'}$');_0x3f4382=Math[_0xb81f('0x85')](0xa,_0x2e9f4c-0x1);_0x3044f9=Math[_0xb81f('0x85')](0xa,_0x2e9f4c)-0x1;return util['format']('%s',_[_0xb81f('0x86')](_0x2aee52,_0x371b1b,_[_0xb81f('0x87')](_0x3f4382,_0x3044f9)));};exports['extractCalleridName']=function(_0x2046c1){var _0x182170=_0x2046c1[_0xb81f('0x88')](/"(.*?)"/);return _0x182170?_0x182170[0x1]:_0x2046c1;};exports['extractCalleridNumber']=function(_0x31c19d){var _0x263ce4=_0x31c19d[_0xb81f('0x88')](/<(.*?)>/);return _0x263ce4?_0x263ce4[0x1]:_0x31c19d;};function buildNoAnswerEventPayload(_0xcde4ce,_0x376906){var _0x2bdbd8=buildObj(_0xcde4ce,_0xb81f('0x89'));if(!_[_0xb81f('0x11')](_0x376906['variables'])){Object[_0xb81f('0x8a')](_0x376906[_0xb81f('0x8b')])[_0xb81f('0x8c')](function(_0x3464b3){_0x2bdbd8[_0x3464b3[_0xb81f('0x8d')]()]=_0x376906[_0xb81f('0x8b')][_0x3464b3];});}return _0x2bdbd8;}exports[_0xb81f('0x8e')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0xd5f1=['milliseconds','diff','seconds','createBody','CampaignId','filterKey','dialAnswer','callback','callbackuniqueid','callbackat','recallme','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosloss','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','noanswer','variables','forEach','toLowerCase','buildNoAnswerEventPayload','util','lodash','moment','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','error','inspect','logger','info','logger2','message','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','name','ContactId','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','isEmpty','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','XMD-','toUpper','toLowerVariables','updateOriginated','originated','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','getSeconds','membername','UserId','logCustomer','talktime','answertime','Failure','RECALL','calleridname','BOOKED','uniqueid','originate','channelAgent','calleridnum','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','clone','Global','scheduledAt','active','scheduledat','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','queue','motionChannel','voice','mandatoryDisposition','buildObj','interface','agentReadyId','not_inuse','status','reachable','push','getDiff'];(function(_0x359bbe,_0x5b7fcc){var _0x1b3353=function(_0x34b41c){while(--_0x34b41c){_0x359bbe['push'](_0x359bbe['shift']());}};_0x1b3353(++_0x5b7fcc);}(_0xd5f1,0xbe));var _0x1d5f=function(_0x286cec,_0x107ea1){_0x286cec=_0x286cec-0x0;var _0x2a5fa5=_0xd5f1[_0x286cec];return _0x2a5fa5;};'use strict';var util=require(_0x1d5f('0x0'));var _=require(_0x1d5f('0x1'));var moment=require(_0x1d5f('0x2'));var logger=require('../../../../config/logger')(_0x1d5f('0x3'));var ipAgi=process[_0x1d5f('0x4')][_0x1d5f('0x5')]||_0x1d5f('0x6');var utils=require(_0x1d5f('0x7'));exports['loggerCatch']=function(_0x167bc8){return function(_0x2fb186){logger[_0x1d5f('0x8')](_0x167bc8,util[_0x1d5f('0x9')](_0x2fb186,{'showHidden':![],'depth':null}));};};exports[_0x1d5f('0xa')]=function(_0x57f7ea,_0x360a35){logger[_0x1d5f('0xb')](_0x57f7ea,util['inspect'](_0x360a35,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x2b0348,_0x20029e){logger[_0x1d5f('0x8')](_0x2b0348,util[_0x1d5f('0x9')](_0x20029e,{'showHidden':![],'depth':null}));};exports[_0x1d5f('0xc')]=function(_0x3595f4){return function(_0x327b6a){logger[_0x1d5f('0xb')](_0x3595f4,util[_0x1d5f('0x9')](_0x327b6a,{'showHidden':![],'depth':null}));};};exports[_0x1d5f('0xd')]=function(_0x275e05,_0x3499d2,_0x312a43){return{'message':_0x275e05,'unlock':_0x3499d2,'active':_0x312a43};};exports['getCallerId']=function(_0x57e668,_0x4b8a52,_0x57e93e){if(!_[_0x1d5f('0xe')](_0x57e93e)&&_0x1d5f('0xf')===typeof _0x57e93e&&!_['isEmpty'](_0x57e93e)){if(!_[_0x1d5f('0xe')](_0x4b8a52)&&_0x1d5f('0xf')===typeof _0x4b8a52&&!_['isEmpty'](_0x4b8a52)){return util[_0x1d5f('0x10')](_0x1d5f('0x11'),_0x4b8a52,_0x57e93e);}return util[_0x1d5f('0x10')](_0x1d5f('0x11'),_0x57e93e,_0x57e93e);}if(!_[_0x1d5f('0xe')](_0x57e668)&&_0x1d5f('0xf')===typeof _0x57e668&&!_['isEmpty'](_0x57e668)){return _0x57e668;}return _0x1d5f('0x12');};exports['isActive']=function(_0x1182fa){if(_[_0x1d5f('0x13')](_0x1182fa)){return![];}return _0x1182fa;};exports[_0x1d5f('0x14')]=function(_0x1b3d50,_0x5708a4,_0x2858e8,_0x295db1,_0x2e4a35,_0x3f3d85){var _0x4e9c72={'XMD-QUEUE':_0x5708a4[_0x1d5f('0x15')]?_0x5708a4[_0x1d5f('0x15')][_0x1d5f('0x16')]:'','XMD-CALLERID':_0x295db1,'XMD-CALLERID-PREVIEW':_0x3f3d85?util[_0x1d5f('0x10')](_0x1d5f('0x11'),_0x3f3d85['calleridname'],_0x3f3d85['calleridnum']):_0x295db1,'XMD-DIALID':_0x2e4a35,'XMD-CONTACTID':_0x5708a4[_0x1d5f('0x17')],'XMD-CDRTYPE':_0x1d5f('0x18'),'CALLERID(all)':_0x295db1,'XMD-VOICEQUEUEID':_0x5708a4['VoiceQueueId'],'XMD-DIALCHANNEL':_0x2858e8,'XMD-DIALTIMEOUT':_0x1b3d50[_0x1d5f('0x19')]||0x1e,'XMD-DIALOPTIONS':util[_0x1d5f('0x10')](_0x1d5f('0x1a'),_0x1b3d50[_0x1d5f('0x1b')]?'g':'',_[_0x1d5f('0x1c')](_0x1b3d50[_0x1d5f('0x1d')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x1b3d50[_0x1d5f('0x1e')]||'','XMD-AGI':_0x1b3d50[_0x1d5f('0x1f')]?util[_0x1d5f('0x10')](_0x1d5f('0x20'),ipAgi,_0x1b3d50['dialQueueProject']):_0x1d5f('0x21'),'XMD-AGIAFTER':_0x1b3d50[_0x1d5f('0x1b')]?util['format'](_0x1d5f('0x20'),ipAgi,_0x1b3d50[_0x1d5f('0x1b')]):_0x1d5f('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x3f3d85?_0x3f3d85[_0x1d5f('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x3f3d85?_0x3f3d85['originatecalleridname']:'','XMD-DESTINATION':_0x1d5f('0x23'),'SIPADDHEADER':_0x1d5f('0x24')};if(!_[_0x1d5f('0x1c')](_0x1b3d50[_0x1d5f('0x1d')])){_0x4e9c72[util['format']('%s',_0x1d5f('0x25'))]=_0x1b3d50[_0x1d5f('0x1d')];_0x4e9c72[util['format']('%s',_0x1d5f('0x26'))]=_0x2e4a35;}if(_0x5708a4&&_0x5708a4[_0x1d5f('0x27')]){for(var _0x43b645 in _0x5708a4['Contact']){if(_0x5708a4[_0x1d5f('0x27')][_0x1d5f('0x28')](_0x43b645)){if(!_[_0x1d5f('0x13')](_0x5708a4[_0x1d5f('0x27')][_0x43b645])&&_0x43b645!=='id'&&_0x43b645!==_0x1d5f('0x29')&&_0x43b645!==_0x1d5f('0x2a')&&_0x43b645!==_0x1d5f('0x2b')){_0x4e9c72[util[_0x1d5f('0x10')]('%s%s',_0x1d5f('0x2c'),_[_0x1d5f('0x2d')](_0x43b645))]=_0x5708a4[_0x1d5f('0x27')][_0x43b645];}}}}return _0x4e9c72;};exports[_0x1d5f('0x2e')]=function(_0x3e8d10){var _0x278da1={};for(var _0x15c2fb in _0x3e8d10){if(_0x3e8d10['hasOwnProperty'](_0x15c2fb)){_0x278da1[util[_0x1d5f('0x10')]('%s',_['toLower'](_0x15c2fb))]=_0x3e8d10[_0x15c2fb];}}return{'variables':_0x278da1};};exports[_0x1d5f('0x2f')]=function(_0x1ed594,_0x39b9b8){if(!_['isNil'](_0x1ed594)){if(_0x1ed594['hasOwnProperty'](_0x1d5f('0x30'))){if(_0x1ed594[_0x1d5f('0x30')]>0x0){_0x1ed594[_0x1d5f('0x30')]-=0x1;}else{logger[_0x1d5f('0x8')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x39b9b8);}}}else{logger[_0x1d5f('0x8')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x39b9b8);}};exports[_0x1d5f('0x31')]=function(_0x5c2ec){var _0x25d492=moment()[_0x1d5f('0x10')](_0x1d5f('0x32'));_0x5c2ec[_0x1d5f('0x33')]=0xd;_0x5c2ec[_0x1d5f('0x34')]=_0x1d5f('0x35');_0x5c2ec[_0x1d5f('0x36')]=_0x25d492;_0x5c2ec[_0x1d5f('0x37')]=_0x25d492;_0x5c2ec[_0x1d5f('0x38')]=_0x25d492;};exports[_0x1d5f('0x39')]=function(_0x32f1f1,_0x2e72e3,_0x425c34){var _0x2ccbde=moment()[_0x1d5f('0x10')](_0x1d5f('0x32'));_0x32f1f1['state']=_0x2e72e3;_0x32f1f1[_0x1d5f('0x34')]=_0x425c34;_0x32f1f1[_0x1d5f('0x37')]=_0x2ccbde;_0x32f1f1[_0x1d5f('0x3a')]=utils[_0x1d5f('0x3b')](_0x32f1f1[_0x1d5f('0x37')],_0x32f1f1[_0x1d5f('0x36')]);};exports['logLookAgent']=function(_0x3757e6,_0x35e5fd,_0x129b0f){_0x3757e6[_0x1d5f('0x3c')]=_0x35e5fd;_0x3757e6[_0x1d5f('0x3d')]=_0x129b0f;};exports[_0x1d5f('0x3e')]=function(_0x503413,_0x478531,_0xd8f652){var _0x5ea7ba=moment()[_0x1d5f('0x10')](_0x1d5f('0x32'));_0x503413[_0x1d5f('0x33')]=_0x478531;_0x503413[_0x1d5f('0x34')]=_0xd8f652;_0x503413[_0x1d5f('0x37')]=_0x503413['responsetime']?_0x503413['responsetime']:_0x5ea7ba;_0x503413[_0x1d5f('0x38')]=_0x503413[_0x1d5f('0x38')]?_0x503413[_0x1d5f('0x38')]:_0x5ea7ba;_0x503413[_0x1d5f('0x3a')]=utils['getSeconds'](_0x503413['responsetime']||0x0,_0x503413[_0x1d5f('0x36')]||0x0);_0x503413[_0x1d5f('0x3f')]=_0x503413['answertime']?utils[_0x1d5f('0x3b')](_0x503413[_0x1d5f('0x38')],_0x503413[_0x1d5f('0x40')]):0x0;};exports['isFailure']=function(_0x590a65){return _0x590a65===_0x1d5f('0x41');};exports['variablesAction']=function(_0xb9dbce,_0x50a69a,_0x12b5a8,_0x8a87f4,_0x443291){var _0x31b57b=_0x8a87f4?_0x1d5f('0x42'):_0xb9dbce[_0x1d5f('0x43')];_0x31b57b=_0x443291?_0x1d5f('0x44'):_0x31b57b;return{'actionid':_0xb9dbce[_0x1d5f('0x45')],'action':_0x1d5f('0x46'),'channel':_0xb9dbce[_0x1d5f('0x47')],'callerid':util[_0x1d5f('0x10')]('\x22%s\x22\x20<%s>',_0x31b57b,_0xb9dbce[_0x1d5f('0x48')]),'Exten':_0x1d5f('0x23'),'Context':_0x1d5f('0x49'),'Priority':'1','variable':_0x12b5a8,'timeout':(_0x50a69a[_0x1d5f('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0xb9dbce[_0x1d5f('0x45')]};};exports[_0x1d5f('0x4b')]=function(_0x88d300){return _0x88d300[_0x1d5f('0x4c')]+_0x88d300[_0x1d5f('0x4d')]+_0x88d300[_0x1d5f('0x4e')]+_0x88d300[_0x1d5f('0x4f')]+_0x88d300[_0x1d5f('0x50')];};exports['cloneAction']=function(_0x2e7794){var _0x1c5a98=_[_0x1d5f('0x51')](_0x2e7794);_0x1c5a98[_0x1d5f('0x33')]=0xf;_0x1c5a98[_0x1d5f('0x34')]=_0x1d5f('0x52');return _0x1c5a98;};exports[_0x1d5f('0x53')]=function(_0xdf6e0b,_0x3a54ed,_0x28a756){var _0x2b216a={};_0x2b216a[_0x3a54ed]=_0xdf6e0b[_0x3a54ed];_0x2b216a[_0x1d5f('0x54')]=![];_0x2b216a[_0x1d5f('0x55')]=moment()['add'](_0x28a756,_0x1d5f('0x56'))[_0x1d5f('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x2b216a['ContactId']=_0xdf6e0b[_0x1d5f('0x17')];_0x2b216a[_0x1d5f('0x57')]=_0xdf6e0b['ListId'];_0x2b216a[_0x1d5f('0x58')]=_0xdf6e0b['VoiceQueueId']||undefined;return _0x2b216a;};exports[_0x1d5f('0x59')]=function(_0x29119c,_0x7d60ac){if(!_[_0x1d5f('0x13')](_0x29119c)){if(_0x29119c[_0x1d5f('0x5a')]>0x0){_0x29119c['pTalking']-=0x1;}else{logger[_0x1d5f('0x8')](_0x7d60ac,_0x1d5f('0x5b'));}}else{logger[_0x1d5f('0x8')](_0x7d60ac,_0x1d5f('0x5c'));}};exports['IsNotLoggedIn']=function(_0x559e7c){if(_0x559e7c<=0x0){return!![];}return![];};function buildObj(_0x268d39,_0x48902e,_0x47b867){_0x268d39[_0x1d5f('0x5d')]=_0x48902e;_0x268d39[_0x1d5f('0x16')]=_0x268d39[_0x1d5f('0x5e')];_0x268d39['interface']=_0x268d39[_0x1d5f('0x47')];_0x268d39[_0x1d5f('0x5f')]=_0x1d5f('0x60');if(_0x47b867){_0x268d39[_0x1d5f('0x61')]=_0x47b867['mandatoryDisposition'];}return _0x268d39;}exports[_0x1d5f('0x62')]=buildObj;exports['buildAcw']=function(_0x223c79){var _0x443aad={};_0x443aad[_0x1d5f('0x5e')]=_0x223c79['queue'];_0x443aad[_0x1d5f('0x63')]=_0x223c79[_0x1d5f('0x47')];_0x443aad[_0x1d5f('0x45')]=_0x223c79[_0x1d5f('0x45')];return _0x443aad;};exports[_0x1d5f('0x64')]=function(_0x20224a){var _0x59a63d=[];for(var _0x3aa94b in _0x20224a){if(_0x20224a[_0x1d5f('0x28')](_0x3aa94b)){if(!_[_0x1d5f('0x13')](_0x20224a[_0x3aa94b])&&_0x20224a[_0x3aa94b][_0x1d5f('0x33')]===_0x1d5f('0x65')&&_0x20224a[_0x3aa94b][_0x1d5f('0x66')]===_0x1d5f('0x67')){_0x59a63d[_0x1d5f('0x68')](_0x20224a[_0x3aa94b]['id']);}}}return _0x59a63d;};exports[_0x1d5f('0x69')]=function(_0x34aa9b){var _0x300735=moment()[_0x1d5f('0x6a')](0x0);var _0x19f604=moment(_0x34aa9b)['milliseconds'](0x0);return _0x300735[_0x1d5f('0x6b')](_0x19f604,_0x1d5f('0x6c'));};exports[_0x1d5f('0x6d')]=function(_0x101475){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x101475[_0x1d5f('0x17')],'ListId':_0x101475[_0x1d5f('0x57')],'VoiceQueueId':_0x101475[_0x1d5f('0x58')]||undefined,'CampaignId':_0x101475[_0x1d5f('0x6e')]||undefined};};exports[_0x1d5f('0x6f')]=function(_0x5c7792){if(_0x5c7792==='uniqueid'||_0x5c7792==='idContact'||_0x5c7792===_0x1d5f('0x5e')||_0x5c7792==='type'||_0x5c7792==='campaigntype'||_0x5c7792===_0x1d5f('0x70')||_0x5c7792===_0x1d5f('0x3c')||_0x5c7792===_0x1d5f('0x47')||_0x5c7792===_0x1d5f('0x43')||_0x5c7792===_0x1d5f('0x54')||_0x5c7792===_0x1d5f('0x48')||_0x5c7792===_0x1d5f('0x55')||_0x5c7792===_0x1d5f('0x4c')||_0x5c7792===_0x1d5f('0x4d')||_0x5c7792==='countnoanswerretry'||_0x5c7792==='countglobal'||_0x5c7792===_0x1d5f('0x71')||_0x5c7792===_0x1d5f('0x72')||_0x5c7792===_0x1d5f('0x73')||_0x5c7792===_0x1d5f('0x74')||_0x5c7792===_0x1d5f('0x17')||_0x5c7792==='ListId'||_0x5c7792===_0x1d5f('0x3d')||_0x5c7792==='VoiceQueueId'||_0x5c7792==='sipcallid'||_0x5c7792===_0x1d5f('0x75')||_0x5c7792===_0x1d5f('0x76')||_0x5c7792===_0x1d5f('0x77')||_0x5c7792==='xmd-listid'||_0x5c7792===_0x1d5f('0x78')||_0x5c7792===_0x1d5f('0x79')||_0x5c7792==='xmd-dialoptions'||_0x5c7792===_0x1d5f('0x7a')||_0x5c7792==='xmd-dialchannel'||_0x5c7792===_0x1d5f('0x7b')||_0x5c7792===_0x1d5f('0x7c')||_0x5c7792==='xmd-callerid'||_0x5c7792==='xmd-agiafter'||_0x5c7792===_0x1d5f('0x7d')||_0x5c7792===_0x1d5f('0x7e')||_0x5c7792===_0x1d5f('0x7f')||_0x5c7792===_0x1d5f('0x80')||_0x5c7792===_0x1d5f('0x81')||_0x5c7792==='rtpaudioqosloss'||_0x5c7792===_0x1d5f('0x82')||_0x5c7792===_0x1d5f('0x83')||_0x5c7792===_0x1d5f('0x84')||_0x5c7792===_0x1d5f('0x7e')||_0x5c7792===_0x1d5f('0x7f')||_0x5c7792===_0x1d5f('0x80')||_0x5c7792===_0x1d5f('0x81')||_0x5c7792===_0x1d5f('0x85')||_0x5c7792===_0x1d5f('0x82')||_0x5c7792===_0x1d5f('0x83')||_0x5c7792===_0x1d5f('0x84')||_0x5c7792===_0x1d5f('0x86')||_0x5c7792===_0x1d5f('0x87')||_0x5c7792===_0x1d5f('0x33')||_0x5c7792===_0x1d5f('0x34')){return![];}return!![];};exports[_0x1d5f('0x88')]=function(_0x18c67c,_0x1e01be){var _0x1ef61c,_0x145382,_0x1e3b3f;if(_0x1e01be<=0x0){_0x1e01be=0x1;}_0x1ef61c=new RegExp(_0x1d5f('0x89')+_0x1e01be+'}$');_0x145382=Math[_0x1d5f('0x8a')](0xa,_0x1e01be-0x1);_0x1e3b3f=Math[_0x1d5f('0x8a')](0xa,_0x1e01be)-0x1;return util[_0x1d5f('0x10')]('%s',_[_0x1d5f('0x8b')](_0x18c67c,_0x1ef61c,_[_0x1d5f('0x8c')](_0x145382,_0x1e3b3f)));};exports[_0x1d5f('0x8d')]=function(_0x160f71){var _0x2f008a=_0x160f71['match'](/"(.*?)"/);return _0x2f008a?_0x2f008a[0x1]:_0x160f71;};exports['extractCalleridNumber']=function(_0x17cbb5){var _0x84f4b9=_0x17cbb5[_0x1d5f('0x8e')](/<(.*?)>/);return _0x84f4b9?_0x84f4b9[0x1]:_0x17cbb5;};function buildNoAnswerEventPayload(_0x31e28d,_0x536e1){var _0x158c87=buildObj(_0x31e28d,_0x1d5f('0x8f'));if(!_['isEmpty'](_0x536e1['variables'])){Object['keys'](_0x536e1[_0x1d5f('0x90')])[_0x1d5f('0x91')](function(_0x182cbf){_0x158c87[_0x182cbf[_0x1d5f('0x92')]()]=_0x536e1[_0x1d5f('0x90')][_0x182cbf];});}return _0x158c87;}exports[_0x1d5f('0x93')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index bb1c580..b0999d4 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 _0x13d7=['voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','queueremove','queuepause','boolean','reload'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x13d7,0xb8));var _0x713d=function(_0x3f120d,_0x45ec79){_0x3f120d=_0x3f120d-0x0;var _0x1b0bb2=_0x13d7[_0x3f120d];return _0x1b0bb2;};'use strict';exports[_0x713d('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x713d('0x1'),'required':!![]},'membername':{'type':_0x713d('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x713d('0x2')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x713d('0x1'),'required':!![]}};exports[_0x713d('0x3')]={'interface':{'type':_0x713d('0x1'),'required':!![]},'paused':{'type':_0x713d('0x4')},'reason':{'type':_0x713d('0x1'),'required':![]}};exports[_0x713d('0x5')]={'module':{'type':_0x713d('0x1'),'required':![]}};exports[_0x713d('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x713d('0x7')]={'uniqueid':{'type':_0x713d('0x1'),'required':!![]},'filename':{'type':_0x713d('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':'string'}};exports[_0x713d('0x8')]={'uniqueid':{'type':_0x713d('0x1'),'required':!![]}};exports[_0x713d('0x9')]={'uniqueid':{'type':_0x713d('0x1'),'required':!![]},'exten':{'type':_0x713d('0x1'),'required':!![]},'context':{'type':_0x713d('0x1')}}; \ No newline at end of file +var _0x4579=['queueremove','queuepause','boolean','reload','voicequeuechannel','voicequeuechannelredirect','queueadd','string','number'];(function(_0x3d43c5,_0x3b0a84){var _0x3bb138=function(_0x667bd6){while(--_0x667bd6){_0x3d43c5['push'](_0x3d43c5['shift']());}};_0x3bb138(++_0x3b0a84);}(_0x4579,0xc3));var _0x9457=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4579[_0x2dafbe];return _0x58a45a;};'use strict';exports[_0x9457('0x0')]={'queue':{'type':_0x9457('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x9457('0x1'),'required':!![]},'penalty':{'type':_0x9457('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x9457('0x3')]={'queue':{'type':_0x9457('0x1'),'required':!![]},'interface':{'type':_0x9457('0x1'),'required':!![]}};exports[_0x9457('0x4')]={'interface':{'type':_0x9457('0x1'),'required':!![]},'paused':{'type':_0x9457('0x5')},'reason':{'type':_0x9457('0x1'),'required':![]}};exports[_0x9457('0x6')]={'module':{'type':'string','required':![]}};exports[_0x9457('0x7')]={'uniqueid':{'type':_0x9457('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x9457('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0x9457('0x1')},'mixmonitorid':{'type':'string'}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x9457('0x1'),'required':!![]}};exports[_0x9457('0x8')]={'uniqueid':{'type':_0x9457('0x1'),'required':!![]},'exten':{'type':_0x9457('0x1'),'required':!![]},'context':{'type':_0x9457('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 3c63bb9..ea1f1df 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 _0xdb28=['initTriggers','triggers','initTemplates','initZendeskAccounts','zendeskAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','groupBy','uniqueid','queuecallerexit','queuecallerabandon','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','diff','queuecallercomplete','queuecallerleaveAt','initVoiceCallReports','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initVoiceQueues','exports','lodash','moment','util','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','telephones','trunks','voiceQueues','campaigns','templates','voiceExtensions','channels','queueChannels','outboundChannels','timers','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','sumDuration','sumBillable','isEmpty','ivrAnswerCallsDay','total','answered','unmanaged','abandoned','sumHoldTime','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','agents','length','isUndefined','mergeFromDatabase','initTelephones','initTrunks'];(function(_0x8b789c,_0x596ced){var _0x5558ed=function(_0x53a8e7){while(--_0x53a8e7){_0x8b789c['push'](_0x8b789c['shift']());}};_0x5558ed(++_0x596ced);}(_0xdb28,0x106));var _0x8db2=function(_0x44e6ef,_0xd2d7c5){_0x44e6ef=_0x44e6ef-0x0;var _0x69f40d=_0xdb28[_0x44e6ef];return _0x69f40d;};'use strict';var _=require(_0x8db2('0x0'));var moment=require(_0x8db2('0x1'));var util=require(_0x8db2('0x2'));var Agent=require(_0x8db2('0x3'));var Telephone=require('../model/telephone');var Trunk=require(_0x8db2('0x4'));var VoiceQueue=require(_0x8db2('0x5'));var Trigger=require(_0x8db2('0x6'));var Template=require(_0x8db2('0x7'));var Campaign=require(_0x8db2('0x8'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x8db2('0x9'));var SalesforceAccount=require(_0x8db2('0xa'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x8db2('0xb'));var DeskAccount=require(_0x8db2('0xc'));var VtigerAccount=require(_0x8db2('0xd'));var ServicenowAccount=require(_0x8db2('0xe'));var Dynamics365Account=require(_0x8db2('0xf'));var FreshsalesAccount=require(_0x8db2('0x10'));var FaxAccount=require(_0x8db2('0x11'));function Realtime(){this['agents']={};this[_0x8db2('0x12')]={};this[_0x8db2('0x13')]={};this[_0x8db2('0x14')]={};this['triggers']={};this[_0x8db2('0x15')]={};this[_0x8db2('0x16')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x8db2('0x17')]={};this[_0x8db2('0x18')]={};this[_0x8db2('0x19')]={};this[_0x8db2('0x1a')]={};this[_0x8db2('0x1b')]={};this['settings']={};this['zendeskAccounts']={};this[_0x8db2('0x1c')]={};this[_0x8db2('0x1d')]={};this[_0x8db2('0x1e')]={};this[_0x8db2('0x1f')]={};this[_0x8db2('0x20')]={};this[_0x8db2('0x21')]={};this[_0x8db2('0x22')]={};this[_0x8db2('0x23')]={};this[_0x8db2('0x24')]={};this[_0x8db2('0x25')]={};}function freeIsNotKey(_0x5489a9,_0x13b0f5,_0x24da1b){var _0x48101e=_[_0x8db2('0x26')](_0x5489a9,function(_0x44957d){return _0x44957d[_0x24da1b];});for(var _0x21db8c in _0x13b0f5){if(_0x13b0f5[_0x8db2('0x27')](_0x21db8c)){if(!_0x48101e[_0x21db8c]){delete _0x13b0f5[_0x21db8c];}}}}function freeIsNotKeySip(_0x2efd06,_0x46ce14){var _0x51d60d=_['mapKeys'](_0x2efd06,function(_0x77789){return util[_0x8db2('0x28')](_0x8db2('0x29'),_0x77789[_0x8db2('0x2a')]);});for(var _0x58562e in _0x46ce14){if(_0x46ce14[_0x8db2('0x27')](_0x58562e)){if(!_0x51d60d[_0x58562e]){delete _0x46ce14[_0x58562e];}}}}function freeIsNotKeyAgent(_0x36a9ff,_0x260940){var _0x297ba3=_[_0x8db2('0x26')](_0x36a9ff,function(_0x597260){var _0x124467=_[_0x8db2('0x2b')](_0x597260[_0x8db2('0x2c')])?util[_0x8db2('0x28')](_0x8db2('0x29'),_0x597260[_0x8db2('0x2a')]):_0x597260[_0x8db2('0x2c')];return _0x124467;});for(var _0x5c6614 in _0x260940){if(_0x260940[_0x8db2('0x27')](_0x5c6614)){if(!_0x297ba3[_0x5c6614]){delete _0x260940[_0x5c6614];}}}}function clearVoiceCallReports(_0x4f6516){_0x4f6516['total']=0x0;_0x4f6516['answered']=0x0;_0x4f6516['sumHoldTime']=0x0;_0x4f6516[_0x8db2('0x2d')]=0x0;_0x4f6516[_0x8db2('0x2e')]=0x0;}function clearCampaigns(_0x3be281){if(!_[_0x8db2('0x2f')](_0x3be281)){for(var _0x145328 in _0x3be281){if(_0x3be281[_0x8db2('0x27')](_0x145328)){_0x3be281[_0x145328]['ivrTotalCallsDays']=0x0;_0x3be281[_0x145328][_0x8db2('0x30')]=0x0;}}}}function clearVoiceQueues(_0x372311){if(!_[_0x8db2('0x2f')](_0x372311)){for(var _0x8b7cec in _0x372311){if(_0x372311['hasOwnProperty'](_0x8b7cec)){_0x372311[_0x8b7cec][_0x8db2('0x31')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x32')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x33')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x34')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x35')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x2d')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x2e')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x36')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x37')]=0x0;_0x372311[_0x8b7cec]['outboundBusyCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x38')]=0x0;_0x372311[_0x8b7cec]['outboundNoSuchCallsDay']=0x0;_0x372311[_0x8b7cec]['outboundUnknownCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x39')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3a')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3b')]=0x0;_0x372311[_0x8b7cec]['outboundOriginateFailureCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3c')]=0x0;_0x372311[_0x8b7cec]['outboundReCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x36')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3d')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3e')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x35d337,_0x1a460b){for(var _0x4df530 in _0x1a460b){if(_0x35d337['hasOwnProperty'](_0x4df530)){_0x35d337[_0x4df530]=_0x1a460b[_0x4df530];}}};Realtime[_0x8db2('0x3f')][_0x8db2('0x40')]=function(){var _0xc884a=this;return function(_0x2a2d65){if(_0x2a2d65){freeIsNotKeyAgent(_0x2a2d65,_0xc884a[_0x8db2('0x41')]);for(var _0xd39848=0x0,_0x101711={};_0xd39848<_0x2a2d65[_0x8db2('0x42')];_0xd39848+=0x1){_0x101711=_0x2a2d65[_0xd39848];var _0x46e0c8=_[_0x8db2('0x2b')](_0x101711['interface'])?util[_0x8db2('0x28')](_0x8db2('0x29'),_0x101711['name']):_0x101711[_0x8db2('0x2c')];if(_[_0x8db2('0x43')](_0xc884a['agents'][_0x46e0c8])){_0xc884a['agents'][_0x46e0c8]=new Agent(_0x101711);}else{_0xc884a[_0x8db2('0x44')](_0xc884a['agents'][_0x46e0c8],_0x101711);}}}return _0xc884a[_0x8db2('0x41')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x45')]=function(){var _0x22c896=this;return function(_0x5cc419){if(_0x5cc419){freeIsNotKeySip(_0x5cc419,_0x22c896[_0x8db2('0x12')]);for(var _0x5e34e0=0x0,_0x227a08={};_0x5e34e0<_0x5cc419[_0x8db2('0x42')];_0x5e34e0+=0x1){_0x227a08=_0x5cc419[_0x5e34e0];if(_[_0x8db2('0x43')](_0x22c896[_0x8db2('0x12')][util['format']('SIP/%s',_0x227a08[_0x8db2('0x2a')])])){_0x22c896[_0x8db2('0x12')][util['format'](_0x8db2('0x29'),_0x227a08[_0x8db2('0x2a')])]=new Telephone(_0x227a08);}else{_0x22c896[_0x8db2('0x44')](_0x22c896['telephones'][util[_0x8db2('0x28')](_0x8db2('0x29'),_0x227a08[_0x8db2('0x2a')])],_0x227a08);}}}return _0x22c896[_0x8db2('0x12')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x46')]=function(){var _0x380046=this;return function(_0x1575ea){if(_0x1575ea){freeIsNotKeySip(_0x1575ea,_0x380046[_0x8db2('0x13')]);for(var _0x63c561=0x0,_0x21cf7c={};_0x63c561<_0x1575ea[_0x8db2('0x42')];_0x63c561+=0x1){_0x21cf7c=_0x1575ea[_0x63c561];if(_[_0x8db2('0x43')](_0x380046['trunks'][util[_0x8db2('0x28')](_0x8db2('0x29'),_0x21cf7c['name'])])){_0x380046['trunks'][util[_0x8db2('0x28')]('SIP/%s',_0x21cf7c[_0x8db2('0x2a')])]=new Trunk(_0x21cf7c);}else{_0x380046[_0x8db2('0x44')](_0x380046[_0x8db2('0x13')][util[_0x8db2('0x28')](_0x8db2('0x29'),_0x21cf7c[_0x8db2('0x2a')])],_0x21cf7c);}}}return _0x380046[_0x8db2('0x13')];};};Realtime['prototype'][_0x8db2('0x47')]=function(){var _0x3d44de=this;return function(_0x40c69e){if(_0x40c69e){freeIsNotKey(_0x40c69e,_0x3d44de[_0x8db2('0x48')],'id');for(var _0x482b26=0x0,_0x424c27={};_0x482b26<_0x40c69e[_0x8db2('0x42')];_0x482b26+=0x1){_0x424c27=_0x40c69e[_0x482b26];if(_[_0x8db2('0x43')](_0x3d44de[_0x8db2('0x48')][_0x424c27['id']])){_0x3d44de['triggers'][_0x424c27['id']]=new Trigger(_0x424c27);}else{_0x3d44de[_0x8db2('0x44')](_0x3d44de['triggers'][_0x424c27['id']],_0x424c27);}}}return _0x3d44de[_0x8db2('0x48')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x49')]=function(){var _0x4d2164=this;return function(_0x4b0e72){if(_0x4b0e72){freeIsNotKey(_0x4b0e72,_0x4d2164[_0x8db2('0x16')],'id');for(var _0x47c556=0x0,_0x173cc7={};_0x47c556<_0x4b0e72[_0x8db2('0x42')];_0x47c556+=0x1){_0x173cc7=_0x4b0e72[_0x47c556];if(_[_0x8db2('0x43')](_0x4d2164[_0x8db2('0x16')][_0x173cc7['id']])){_0x4d2164[_0x8db2('0x16')][_0x173cc7['id']]=new Template(_0x173cc7);}else{_0x4d2164[_0x8db2('0x44')](_0x4d2164[_0x8db2('0x16')][_0x173cc7['id']],_0x173cc7);}}}return _0x4d2164[_0x8db2('0x16')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4a')]=function(){var _0x1362ed=this;return function(_0x36f9d6){if(_0x36f9d6){freeIsNotKey(_0x36f9d6,_0x1362ed['zendeskAccounts'],'id');for(var _0x449109=0x0,_0x2ada52={};_0x449109<_0x36f9d6[_0x8db2('0x42')];_0x449109+=0x1){_0x2ada52=_0x36f9d6[_0x449109];if(_[_0x8db2('0x43')](_0x1362ed['zendeskAccounts'][_0x2ada52['id']])){_0x1362ed['zendeskAccounts'][_0x2ada52['id']]=new ZendeskAccount(_0x2ada52);}else{_0x1362ed[_0x8db2('0x44')](_0x1362ed[_0x8db2('0x4b')][_0x2ada52['id']],_0x2ada52);}}}return _0x1362ed[_0x8db2('0x4b')];};};Realtime['prototype']['initSalesforceAccounts']=function(){var _0x494d6e=this;return function(_0x44ac56){if(_0x44ac56){freeIsNotKey(_0x44ac56,_0x494d6e[_0x8db2('0x1c')],'id');for(var _0x55c7dd=0x0,_0x383fa1={};_0x55c7dd<_0x44ac56[_0x8db2('0x42')];_0x55c7dd+=0x1){_0x383fa1=_0x44ac56[_0x55c7dd];if(_[_0x8db2('0x43')](_0x494d6e[_0x8db2('0x1c')][_0x383fa1['id']])){_0x494d6e['salesforceAccounts'][_0x383fa1['id']]=new SalesforceAccount(_0x383fa1);}else{_0x494d6e['mergeFromDatabase'](_0x494d6e[_0x8db2('0x1c')][_0x383fa1['id']],_0x383fa1);}}}return _0x494d6e[_0x8db2('0x1c')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4c')]=function(){var _0x3daed6=this;return function(_0x2bf408){if(_0x2bf408){freeIsNotKey(_0x2bf408,_0x3daed6[_0x8db2('0x1e')],'id');for(var _0x3ca2a7=0x0,_0x4187d6={};_0x3ca2a7<_0x2bf408[_0x8db2('0x42')];_0x3ca2a7+=0x1){_0x4187d6=_0x2bf408[_0x3ca2a7];if(_[_0x8db2('0x43')](_0x3daed6[_0x8db2('0x1e')][_0x4187d6['id']])){_0x3daed6[_0x8db2('0x1e')][_0x4187d6['id']]=new FreshdeskAccount(_0x4187d6);}else{_0x3daed6[_0x8db2('0x44')](_0x3daed6[_0x8db2('0x1e')][_0x4187d6['id']],_0x4187d6);}}}return _0x3daed6['freshdeskAccounts'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4d')]=function(){var _0x579317=this;return function(_0x27b644){if(_0x27b644){freeIsNotKey(_0x27b644,_0x579317[_0x8db2('0x1f')],'id');for(var _0x3af298=0x0,_0x547215={};_0x3af298<_0x27b644[_0x8db2('0x42')];_0x3af298+=0x1){_0x547215=_0x27b644[_0x3af298];if(_[_0x8db2('0x43')](_0x579317[_0x8db2('0x1f')][_0x547215['id']])){_0x579317[_0x8db2('0x1f')][_0x547215['id']]=new ZohoAccount(_0x547215);}else{_0x579317[_0x8db2('0x44')](_0x579317['zohoAccounts'][_0x547215['id']],_0x547215);}}}return _0x579317[_0x8db2('0x1f')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4e')]=function(){var _0x58bb60=this;return function(_0x1e7d1a){if(_0x1e7d1a){freeIsNotKey(_0x1e7d1a,_0x58bb60[_0x8db2('0x20')],'id');for(var _0x33dddd=0x0,_0x7b0de8={};_0x33dddd<_0x1e7d1a[_0x8db2('0x42')];_0x33dddd+=0x1){_0x7b0de8=_0x1e7d1a[_0x33dddd];if(_[_0x8db2('0x43')](_0x58bb60[_0x8db2('0x20')][_0x7b0de8['id']])){_0x58bb60['deskAccounts'][_0x7b0de8['id']]=new DeskAccount(_0x7b0de8);}else{_0x58bb60[_0x8db2('0x44')](_0x58bb60[_0x8db2('0x20')][_0x7b0de8['id']],_0x7b0de8);}}}return _0x58bb60['deskAccounts'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4f')]=function(){var _0x533e41=this;return function(_0x107bbe){if(_0x107bbe){freeIsNotKey(_0x107bbe,_0x533e41[_0x8db2('0x1d')],'id');for(var _0x63e8f7=0x0,_0x30f4f3={};_0x63e8f7<_0x107bbe[_0x8db2('0x42')];_0x63e8f7+=0x1){_0x30f4f3=_0x107bbe[_0x63e8f7];if(_[_0x8db2('0x43')](_0x533e41[_0x8db2('0x1d')][_0x30f4f3['id']])){_0x533e41[_0x8db2('0x1d')][_0x30f4f3['id']]=new SugarcrmAccount(_0x30f4f3);}else{_0x533e41[_0x8db2('0x44')](_0x533e41[_0x8db2('0x1d')][_0x30f4f3['id']],_0x30f4f3);}}}return _0x533e41[_0x8db2('0x1d')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x50')]=function(){var _0x1ce89f=this;return function(_0x64ec90){if(_0x64ec90){freeIsNotKey(_0x64ec90,_0x1ce89f[_0x8db2('0x21')],'id');for(var _0x4a20a7=0x0,_0xe0c3e={};_0x4a20a7<_0x64ec90[_0x8db2('0x42')];_0x4a20a7+=0x1){_0xe0c3e=_0x64ec90[_0x4a20a7];if(_[_0x8db2('0x43')](_0x1ce89f[_0x8db2('0x21')][_0xe0c3e['id']])){_0x1ce89f[_0x8db2('0x21')][_0xe0c3e['id']]=new VtigerAccount(_0xe0c3e);}else{_0x1ce89f['mergeFromDatabase'](_0x1ce89f[_0x8db2('0x21')][_0xe0c3e['id']],_0xe0c3e);}}}return _0x1ce89f[_0x8db2('0x21')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x51')]=function(){var _0x2ad70f=this;return function(_0x348da8){if(_0x348da8){freeIsNotKey(_0x348da8,_0x2ad70f[_0x8db2('0x22')],'id');for(var _0x2c7b04=0x0,_0x24cfe9={};_0x2c7b04<_0x348da8[_0x8db2('0x42')];_0x2c7b04+=0x1){_0x24cfe9=_0x348da8[_0x2c7b04];if(_[_0x8db2('0x43')](_0x2ad70f[_0x8db2('0x22')][_0x24cfe9['id']])){_0x2ad70f[_0x8db2('0x22')][_0x24cfe9['id']]=new ServicenowAccount(_0x24cfe9);}else{_0x2ad70f[_0x8db2('0x44')](_0x2ad70f[_0x8db2('0x22')][_0x24cfe9['id']],_0x24cfe9);}}}return _0x2ad70f[_0x8db2('0x22')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x52')]=function(){var _0x5a719f=this;return function(_0x3273dd){if(_0x3273dd){freeIsNotKey(_0x3273dd,_0x5a719f['dynamics365Accounts'],'id');for(var _0x364176=0x0,_0x570c53={};_0x364176<_0x3273dd[_0x8db2('0x42')];_0x364176+=0x1){_0x570c53=_0x3273dd[_0x364176];if(_[_0x8db2('0x43')](_0x5a719f[_0x8db2('0x23')][_0x570c53['id']])){_0x5a719f[_0x8db2('0x23')][_0x570c53['id']]=new Dynamics365Account(_0x570c53);}else{_0x5a719f[_0x8db2('0x44')](_0x5a719f['dynamics365Accounts'][_0x570c53['id']],_0x570c53);}}}return _0x5a719f['dynamics365Accounts'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x53')]=function(){var _0x21ec87=this;return function(_0x3ba1d2){if(_0x3ba1d2){freeIsNotKey(_0x3ba1d2,_0x21ec87[_0x8db2('0x24')],'id');for(var _0x1f28d2=0x0,_0x3e3de3={};_0x1f28d2<_0x3ba1d2[_0x8db2('0x42')];_0x1f28d2+=0x1){_0x3e3de3=_0x3ba1d2[_0x1f28d2];if(_['isUndefined'](_0x21ec87[_0x8db2('0x24')][_0x3e3de3['id']])){_0x21ec87[_0x8db2('0x24')][_0x3e3de3['id']]=new FreshsalesAccount(_0x3e3de3);}else{_0x21ec87[_0x8db2('0x44')](_0x21ec87[_0x8db2('0x24')][_0x3e3de3['id']],_0x3e3de3);}}}return _0x21ec87[_0x8db2('0x24')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x54')]=function(){var _0x20caf0=this;return function(_0x4938bb){for(var _0x54318c=0x0;_0x54318c<_0x4938bb[_0x8db2('0x42')];_0x54318c+=0x1){_[_0x8db2('0x55')](_0x20caf0[_0x8db2('0x14')][_0x4938bb[_0x54318c][_0x8db2('0x2a')]],_0x4938bb[_0x54318c]);}return _0x20caf0[_0x8db2('0x14')];};};Realtime['prototype']['initVoiceQueueReports']=function(){var _0x3611da=this;return function(_0x364807){clearVoiceQueues(_0x3611da['voiceQueues']);if(_0x364807){_0x364807=_[_0x8db2('0x56')](_0x364807,_0x8db2('0x57'));for(var _0x1ab84c in _0x364807){if(_0x364807['hasOwnProperty'](_0x1ab84c)){for(var _0x26523b=0x0;_0x26523b<_0x364807[_0x1ab84c][_0x8db2('0x42')];_0x26523b+=0x1){var _0x2cf731=_0x364807[_0x1ab84c][_0x26523b]['queue'];if(_0x3611da[_0x8db2('0x14')][_0x2cf731]){if(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x58')]){_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x33')]+=0x1;}if(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x59')]){_0x3611da['voiceQueues'][_0x2cf731][_0x8db2('0x34')]+=0x1;}_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x35')]+=moment(_0x364807[_0x1ab84c][_0x26523b]['queuecallerleaveAt'])['diff'](moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5a')]),_0x8db2('0x5b'))||0x0;if(_0x26523b===_0x364807[_0x1ab84c]['length']-0x1){_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x2d')]+=moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5c')]||_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5d')]||_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5e')])[_0x8db2('0x5f')](moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5a')]),_0x8db2('0x5b'))||0x0;_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x31')]+=0x1;if(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x60')]){_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x32')]+=0x1;_0x3611da['voiceQueues'][_0x2cf731][_0x8db2('0x2e')]+=moment(_0x364807[_0x1ab84c][_0x26523b]['queuecallercompleteAt'])[_0x8db2('0x5f')](moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x61')]),'seconds')||0x0;}}else{_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x2d')]+=_0x3611da['voiceQueues'][_0x2cf731][_0x8db2('0x35')]||0x0;}}}}}}return _0x3611da[_0x8db2('0x14')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x62')]=function(){var _0x242379=this;return function(_0x31a095){clearVoiceCallReports(_0x242379[_0x8db2('0x63')]);if(_0x31a095){for(var _0x3ac0fa=0x0;_0x3ac0fa<_0x31a095[_0x8db2('0x42')];_0x3ac0fa+=0x1){_0x242379['outbound']['total']+=0x1;_0x242379[_0x8db2('0x63')]['sumDuration']+=_0x31a095[_0x3ac0fa][_0x8db2('0x64')];if(_0x31a095[_0x3ac0fa][_0x8db2('0x65')]===_0x8db2('0x66')){_0x242379['outbound'][_0x8db2('0x32')]+=0x1;_0x242379[_0x8db2('0x63')][_0x8db2('0x35')]+=_0x31a095[_0x3ac0fa]['duration']-_0x31a095[_0x3ac0fa][_0x8db2('0x67')]||0x0;_0x242379[_0x8db2('0x63')][_0x8db2('0x2e')]+=_0x31a095[_0x3ac0fa][_0x8db2('0x67')];}}}return _0x242379['outbound'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x68')]=function(){var _0x299640=this;return function(_0x1edb1a){if(_0x1edb1a){freeIsNotKey(_0x1edb1a,_0x299640[_0x8db2('0x15')],_0x8db2('0x2a'));for(var _0x1aadfb=0x0,_0x3682bf={};_0x1aadfb<_0x1edb1a[_0x8db2('0x42')];_0x1aadfb+=0x1){_0x3682bf=_0x1edb1a[_0x1aadfb];if(_[_0x8db2('0x43')](_0x299640[_0x8db2('0x15')][_0x3682bf['name']])){_0x299640[_0x8db2('0x15')][_0x3682bf[_0x8db2('0x2a')]]=new Campaign(_0x3682bf);}else{_0x299640[_0x8db2('0x44')](_0x299640['campaigns'][_0x3682bf['name']],_0x3682bf);_0x299640['campaigns'][_0x3682bf[_0x8db2('0x2a')]][_0x8db2('0x69')]=_0x3682bf[_0x8db2('0x6a')]?_0x3682bf[_0x8db2('0x6a')][_0x8db2('0x2a')]:undefined;}}}return _0x299640[_0x8db2('0x15')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x6b')]=function(){var _0x3b1929=this;return function(_0x37cf6d){if(_0x37cf6d){freeIsNotKey(_0x37cf6d,_0x3b1929[_0x8db2('0x17')],'id');for(var _0x4d0ff6=0x0,_0x360a06={};_0x4d0ff6<_0x37cf6d[_0x8db2('0x42')];_0x4d0ff6+=0x1){_0x360a06=_0x37cf6d[_0x4d0ff6];if(_[_0x8db2('0x43')](_0x3b1929[_0x8db2('0x17')][_0x360a06['id']])){_0x3b1929['voiceExtensions'][_0x360a06['id']]=new VoiceExtension(_0x360a06);}else{_0x3b1929['mergeFromDatabase'](_0x3b1929[_0x8db2('0x17')][_0x360a06['id']],_0x360a06);}}}return _0x3b1929[_0x8db2('0x17')];};};Realtime['prototype'][_0x8db2('0x6c')]=function(){var _0x121f31=this;return function(_0x9132b4){clearCampaigns(_0x121f31['campaigns']);for(var _0x5dc46c=0x0;_0x5dc46c<_0x9132b4['length'];_0x5dc46c+=0x1){_[_0x8db2('0x55')](_0x121f31[_0x8db2('0x15')][_0x9132b4[_0x5dc46c][_0x8db2('0x2a')]],_0x9132b4[_0x5dc46c]);}return _0x121f31[_0x8db2('0x15')];};};Realtime[_0x8db2('0x3f')]['initFaxAccounts']=function(){var _0x30930a=this;return function(_0x5e349c){if(_0x5e349c){freeIsNotKey(_0x5e349c,_0x30930a[_0x8db2('0x25')],'id');for(var _0x353101=0x0,_0xa083b1={};_0x353101<_0x5e349c[_0x8db2('0x42')];_0x353101+=0x1){_0xa083b1=_0x5e349c[_0x353101];if(_[_0x8db2('0x43')](_0x30930a['faxAccounts'][_0xa083b1['id']])){_0x30930a['faxAccounts'][_0xa083b1['id']]=new FaxAccount(_0xa083b1);}else{_0x30930a[_0x8db2('0x44')](_0x30930a['faxAccounts'][_0xa083b1['id']],_0xa083b1);}}}return _0x30930a[_0x8db2('0x25')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x6d')]=function(){var _0x1e7bc2=this;return function(_0x2b7224){if(_0x2b7224){freeIsNotKey(_0x2b7224,_0x1e7bc2[_0x8db2('0x14')],'name');for(var _0x19f9a0=0x0,_0x222ea2={};_0x19f9a0<_0x2b7224[_0x8db2('0x42')];_0x19f9a0+=0x1){_0x222ea2=_0x2b7224[_0x19f9a0];if(_['isUndefined'](_0x1e7bc2[_0x8db2('0x14')][_0x222ea2[_0x8db2('0x2a')]])){_0x1e7bc2['voiceQueues'][_0x222ea2[_0x8db2('0x2a')]]=new VoiceQueue(_0x222ea2);}else{_0x1e7bc2[_0x8db2('0x44')](_0x1e7bc2[_0x8db2('0x14')][_0x222ea2[_0x8db2('0x2a')]],_0x222ea2);}}}return _0x1e7bc2[_0x8db2('0x14')];};};module[_0x8db2('0x6e')]=Realtime; \ No newline at end of file +var _0xb10b=['../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','triggers','campaigns','templates','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','name','interface','format','total','answered','sumHoldTime','sumDuration','ivrTotalCallsDays','isEmpty','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isNil','isUndefined','initTelephones','trunks','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initVoiceQueueHopperHistory','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','outbound','duration','billableseconds','initCampaigns','dialQueueProject','initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','lodash','util','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign'];(function(_0x3e6cc4,_0xf760e0){var _0xeb2a39=function(_0x8cc9b6){while(--_0x8cc9b6){_0x3e6cc4['push'](_0x3e6cc4['shift']());}};_0xeb2a39(++_0xf760e0);}(_0xb10b,0x12a));var _0xbb10=function(_0x62cfe,_0x894025){_0x62cfe=_0x62cfe-0x0;var _0x3ecfda=_0xb10b[_0x62cfe];return _0x3ecfda;};'use strict';var _=require(_0xbb10('0x0'));var moment=require('moment');var util=require(_0xbb10('0x1'));var Agent=require(_0xbb10('0x2'));var Telephone=require(_0xbb10('0x3'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0xbb10('0x4'));var Trigger=require(_0xbb10('0x5'));var Template=require(_0xbb10('0x6'));var Campaign=require(_0xbb10('0x7'));var VoiceExtension=require(_0xbb10('0x8'));var ZendeskAccount=require(_0xbb10('0x9'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xbb10('0xa'));var SugarcrmAccount=require(_0xbb10('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xbb10('0xc'));var VtigerAccount=require(_0xbb10('0xd'));var ServicenowAccount=require(_0xbb10('0xe'));var Dynamics365Account=require(_0xbb10('0xf'));var FreshsalesAccount=require(_0xbb10('0x10'));var FaxAccount=require(_0xbb10('0x11'));function Realtime(){this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['trunks']={};this['voiceQueues']={};this[_0xbb10('0x14')]={};this[_0xbb10('0x15')]={};this[_0xbb10('0x16')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xbb10('0x17')]={};this['channels']={};this[_0xbb10('0x18')]={};this[_0xbb10('0x19')]={};this[_0xbb10('0x1a')]={};this[_0xbb10('0x1b')]={};this[_0xbb10('0x1c')]={};this[_0xbb10('0x1d')]={};this['sugarcrmAccounts']={};this[_0xbb10('0x1e')]={};this[_0xbb10('0x1f')]={};this[_0xbb10('0x20')]={};this[_0xbb10('0x21')]={};this[_0xbb10('0x22')]={};this[_0xbb10('0x23')]={};this[_0xbb10('0x24')]={};this[_0xbb10('0x25')]={};}function freeIsNotKey(_0x3e26f4,_0x2b184e,_0x4a2bfc){var _0x2eca0f=_[_0xbb10('0x26')](_0x3e26f4,function(_0x133ac2){return _0x133ac2[_0x4a2bfc];});for(var _0x42db98 in _0x2b184e){if(_0x2b184e[_0xbb10('0x27')](_0x42db98)){if(!_0x2eca0f[_0x42db98]){delete _0x2b184e[_0x42db98];}}}}function freeIsNotKeySip(_0x1682a4,_0x575cca){var _0x30efc6=_[_0xbb10('0x26')](_0x1682a4,function(_0xe1c665){return util['format'](_0xbb10('0x28'),_0xe1c665[_0xbb10('0x29')]);});for(var _0x388fab in _0x575cca){if(_0x575cca[_0xbb10('0x27')](_0x388fab)){if(!_0x30efc6[_0x388fab]){delete _0x575cca[_0x388fab];}}}}function freeIsNotKeyAgent(_0xdf237d,_0x44e563){var _0x4deb49=_[_0xbb10('0x26')](_0xdf237d,function(_0x12ef77){var _0x50aea1=_['isNil'](_0x12ef77[_0xbb10('0x2a')])?util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x12ef77[_0xbb10('0x29')]):_0x12ef77[_0xbb10('0x2a')];return _0x50aea1;});for(var _0x1824b7 in _0x44e563){if(_0x44e563[_0xbb10('0x27')](_0x1824b7)){if(!_0x4deb49[_0x1824b7]){delete _0x44e563[_0x1824b7];}}}}function clearVoiceCallReports(_0x436104){_0x436104[_0xbb10('0x2c')]=0x0;_0x436104[_0xbb10('0x2d')]=0x0;_0x436104[_0xbb10('0x2e')]=0x0;_0x436104[_0xbb10('0x2f')]=0x0;_0x436104['sumBillable']=0x0;}function clearCampaigns(_0x4fedac){if(!_['isEmpty'](_0x4fedac)){for(var _0xc93a04 in _0x4fedac){if(_0x4fedac[_0xbb10('0x27')](_0xc93a04)){_0x4fedac[_0xc93a04][_0xbb10('0x30')]=0x0;_0x4fedac[_0xc93a04]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x2fdde9){if(!_[_0xbb10('0x31')](_0x2fdde9)){for(var _0x6ed43b in _0x2fdde9){if(_0x2fdde9[_0xbb10('0x27')](_0x6ed43b)){_0x2fdde9[_0x6ed43b][_0xbb10('0x2c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2d')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x32')]=0x0;_0x2fdde9[_0x6ed43b]['abandoned']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2e')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2f')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x33')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x34')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x35')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x36')]=0x0;_0x2fdde9[_0x6ed43b]['outboundCongestionCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x37')]=0x0;_0x2fdde9[_0x6ed43b]['outboundUnknownCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x38')]=0x0;_0x2fdde9[_0x6ed43b]['outboundDropCallsDayCallersExit']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x39')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3a')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3b')]=0x0;_0x2fdde9[_0x6ed43b]['outboundReCallsDay']=0x0;_0x2fdde9[_0x6ed43b]['outboundAnswerAgiCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3d')]=!![];}}}}Realtime['prototype'][_0xbb10('0x3e')]=function(_0x37dde7,_0x2f653f){for(var _0x1c0b57 in _0x2f653f){if(_0x37dde7[_0xbb10('0x27')](_0x1c0b57)){_0x37dde7[_0x1c0b57]=_0x2f653f[_0x1c0b57];}}};Realtime[_0xbb10('0x3f')][_0xbb10('0x40')]=function(){var _0x4975f5=this;return function(_0x25acb3){if(_0x25acb3){freeIsNotKeyAgent(_0x25acb3,_0x4975f5[_0xbb10('0x12')]);for(var _0x441d15=0x0,_0x8c1ce6={};_0x441d15<_0x25acb3[_0xbb10('0x41')];_0x441d15+=0x1){_0x8c1ce6=_0x25acb3[_0x441d15];var _0x9de708=_[_0xbb10('0x42')](_0x8c1ce6[_0xbb10('0x2a')])?util[_0xbb10('0x2b')]('SIP/%s',_0x8c1ce6[_0xbb10('0x29')]):_0x8c1ce6[_0xbb10('0x2a')];if(_[_0xbb10('0x43')](_0x4975f5[_0xbb10('0x12')][_0x9de708])){_0x4975f5['agents'][_0x9de708]=new Agent(_0x8c1ce6);}else{_0x4975f5[_0xbb10('0x3e')](_0x4975f5['agents'][_0x9de708],_0x8c1ce6);}}}return _0x4975f5['agents'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x44')]=function(){var _0x26e76a=this;return function(_0x120d21){if(_0x120d21){freeIsNotKeySip(_0x120d21,_0x26e76a[_0xbb10('0x13')]);for(var _0x29d11a=0x0,_0x547062={};_0x29d11a<_0x120d21[_0xbb10('0x41')];_0x29d11a+=0x1){_0x547062=_0x120d21[_0x29d11a];if(_[_0xbb10('0x43')](_0x26e76a['telephones'][util['format']('SIP/%s',_0x547062[_0xbb10('0x29')])])){_0x26e76a[_0xbb10('0x13')][util[_0xbb10('0x2b')]('SIP/%s',_0x547062[_0xbb10('0x29')])]=new Telephone(_0x547062);}else{_0x26e76a[_0xbb10('0x3e')](_0x26e76a[_0xbb10('0x13')][util['format'](_0xbb10('0x28'),_0x547062[_0xbb10('0x29')])],_0x547062);}}}return _0x26e76a[_0xbb10('0x13')];};};Realtime[_0xbb10('0x3f')]['initTrunks']=function(){var _0xd238e9=this;return function(_0x110eb5){if(_0x110eb5){freeIsNotKeySip(_0x110eb5,_0xd238e9['trunks']);for(var _0xe2040f=0x0,_0x2e3214={};_0xe2040f<_0x110eb5[_0xbb10('0x41')];_0xe2040f+=0x1){_0x2e3214=_0x110eb5[_0xe2040f];if(_[_0xbb10('0x43')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')]('SIP/%s',_0x2e3214[_0xbb10('0x29')])])){_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])]=new Trunk(_0x2e3214);}else{_0xd238e9[_0xbb10('0x3e')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])],_0x2e3214);}}}return _0xd238e9[_0xbb10('0x45')];};};Realtime[_0xbb10('0x3f')]['initTriggers']=function(){var _0x5d9a4f=this;return function(_0x38d78f){if(_0x38d78f){freeIsNotKey(_0x38d78f,_0x5d9a4f['triggers'],'id');for(var _0x318984=0x0,_0x180933={};_0x318984<_0x38d78f['length'];_0x318984+=0x1){_0x180933=_0x38d78f[_0x318984];if(_[_0xbb10('0x43')](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']])){_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']]=new Trigger(_0x180933);}else{_0x5d9a4f['mergeFromDatabase'](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']],_0x180933);}}}return _0x5d9a4f[_0xbb10('0x14')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x46')]=function(){var _0x36e1fa=this;return function(_0x19f94d){if(_0x19f94d){freeIsNotKey(_0x19f94d,_0x36e1fa[_0xbb10('0x16')],'id');for(var _0x3efa96=0x0,_0x205bb4={};_0x3efa96<_0x19f94d[_0xbb10('0x41')];_0x3efa96+=0x1){_0x205bb4=_0x19f94d[_0x3efa96];if(_[_0xbb10('0x43')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']])){_0x36e1fa['templates'][_0x205bb4['id']]=new Template(_0x205bb4);}else{_0x36e1fa[_0xbb10('0x3e')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']],_0x205bb4);}}}return _0x36e1fa['templates'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x47')]=function(){var _0x1a7df6=this;return function(_0x5a5226){if(_0x5a5226){freeIsNotKey(_0x5a5226,_0x1a7df6[_0xbb10('0x1c')],'id');for(var _0x39f0de=0x0,_0x3e06b0={};_0x39f0de<_0x5a5226['length'];_0x39f0de+=0x1){_0x3e06b0=_0x5a5226[_0x39f0de];if(_['isUndefined'](_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']])){_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']]=new ZendeskAccount(_0x3e06b0);}else{_0x1a7df6[_0xbb10('0x3e')](_0x1a7df6['zendeskAccounts'][_0x3e06b0['id']],_0x3e06b0);}}}return _0x1a7df6['zendeskAccounts'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x48')]=function(){var _0x1bd054=this;return function(_0xf820fe){if(_0xf820fe){freeIsNotKey(_0xf820fe,_0x1bd054[_0xbb10('0x1d')],'id');for(var _0x22b315=0x0,_0x2f2552={};_0x22b315<_0xf820fe[_0xbb10('0x41')];_0x22b315+=0x1){_0x2f2552=_0xf820fe[_0x22b315];if(_[_0xbb10('0x43')](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']])){_0x1bd054['salesforceAccounts'][_0x2f2552['id']]=new SalesforceAccount(_0x2f2552);}else{_0x1bd054['mergeFromDatabase'](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']],_0x2f2552);}}}return _0x1bd054[_0xbb10('0x1d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x49')]=function(){var _0x36aa7d=this;return function(_0x440f9e){if(_0x440f9e){freeIsNotKey(_0x440f9e,_0x36aa7d[_0xbb10('0x1e')],'id');for(var _0x445870=0x0,_0x1c0d8f={};_0x445870<_0x440f9e[_0xbb10('0x41')];_0x445870+=0x1){_0x1c0d8f=_0x440f9e[_0x445870];if(_[_0xbb10('0x43')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']])){_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']]=new FreshdeskAccount(_0x1c0d8f);}else{_0x36aa7d[_0xbb10('0x3e')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']],_0x1c0d8f);}}}return _0x36aa7d['freshdeskAccounts'];};};Realtime[_0xbb10('0x3f')]['initZohoAccounts']=function(){var _0x33d60a=this;return function(_0x2e21a0){if(_0x2e21a0){freeIsNotKey(_0x2e21a0,_0x33d60a[_0xbb10('0x1f')],'id');for(var _0x3f27ce=0x0,_0x26e66e={};_0x3f27ce<_0x2e21a0[_0xbb10('0x41')];_0x3f27ce+=0x1){_0x26e66e=_0x2e21a0[_0x3f27ce];if(_[_0xbb10('0x43')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']])){_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']]=new ZohoAccount(_0x26e66e);}else{_0x33d60a[_0xbb10('0x3e')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']],_0x26e66e);}}}return _0x33d60a[_0xbb10('0x1f')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4a')]=function(){var _0x4475e1=this;return function(_0x5de0cc){if(_0x5de0cc){freeIsNotKey(_0x5de0cc,_0x4475e1[_0xbb10('0x20')],'id');for(var _0x466eb7=0x0,_0x1b83a9={};_0x466eb7<_0x5de0cc[_0xbb10('0x41')];_0x466eb7+=0x1){_0x1b83a9=_0x5de0cc[_0x466eb7];if(_[_0xbb10('0x43')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']])){_0x4475e1['deskAccounts'][_0x1b83a9['id']]=new DeskAccount(_0x1b83a9);}else{_0x4475e1[_0xbb10('0x3e')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']],_0x1b83a9);}}}return _0x4475e1[_0xbb10('0x20')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4b')]=function(){var _0x22de7f=this;return function(_0x175872){if(_0x175872){freeIsNotKey(_0x175872,_0x22de7f[_0xbb10('0x4c')],'id');for(var _0x205e01=0x0,_0x40c4fb={};_0x205e01<_0x175872[_0xbb10('0x41')];_0x205e01+=0x1){_0x40c4fb=_0x175872[_0x205e01];if(_[_0xbb10('0x43')](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']])){_0x22de7f['sugarcrmAccounts'][_0x40c4fb['id']]=new SugarcrmAccount(_0x40c4fb);}else{_0x22de7f['mergeFromDatabase'](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']],_0x40c4fb);}}}return _0x22de7f[_0xbb10('0x4c')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4d')]=function(){var _0x5573bb=this;return function(_0x506498){if(_0x506498){freeIsNotKey(_0x506498,_0x5573bb[_0xbb10('0x21')],'id');for(var _0xaf2cc3=0x0,_0x410bef={};_0xaf2cc3<_0x506498[_0xbb10('0x41')];_0xaf2cc3+=0x1){_0x410bef=_0x506498[_0xaf2cc3];if(_[_0xbb10('0x43')](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']])){_0x5573bb[_0xbb10('0x21')][_0x410bef['id']]=new VtigerAccount(_0x410bef);}else{_0x5573bb['mergeFromDatabase'](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']],_0x410bef);}}}return _0x5573bb[_0xbb10('0x21')];};};Realtime['prototype']['initServicenowAccounts']=function(){var _0x5a231f=this;return function(_0x32c1e8){if(_0x32c1e8){freeIsNotKey(_0x32c1e8,_0x5a231f[_0xbb10('0x22')],'id');for(var _0x155dc5=0x0,_0x5bd1c0={};_0x155dc5<_0x32c1e8['length'];_0x155dc5+=0x1){_0x5bd1c0=_0x32c1e8[_0x155dc5];if(_['isUndefined'](_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']])){_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']]=new ServicenowAccount(_0x5bd1c0);}else{_0x5a231f[_0xbb10('0x3e')](_0x5a231f['servicenowAccounts'][_0x5bd1c0['id']],_0x5bd1c0);}}}return _0x5a231f[_0xbb10('0x22')];};};Realtime[_0xbb10('0x3f')]['initDynamics365Accounts']=function(){var _0x4a560c=this;return function(_0x27d7b9){if(_0x27d7b9){freeIsNotKey(_0x27d7b9,_0x4a560c[_0xbb10('0x23')],'id');for(var _0xd77753=0x0,_0x237246={};_0xd77753<_0x27d7b9['length'];_0xd77753+=0x1){_0x237246=_0x27d7b9[_0xd77753];if(_[_0xbb10('0x43')](_0x4a560c[_0xbb10('0x23')][_0x237246['id']])){_0x4a560c[_0xbb10('0x23')][_0x237246['id']]=new Dynamics365Account(_0x237246);}else{_0x4a560c['mergeFromDatabase'](_0x4a560c[_0xbb10('0x23')][_0x237246['id']],_0x237246);}}}return _0x4a560c[_0xbb10('0x23')];};};Realtime[_0xbb10('0x3f')]['initFreshsalesAccounts']=function(){var _0x2ca491=this;return function(_0x31e85e){if(_0x31e85e){freeIsNotKey(_0x31e85e,_0x2ca491[_0xbb10('0x24')],'id');for(var _0x37b65f=0x0,_0x5e4a6e={};_0x37b65f<_0x31e85e[_0xbb10('0x41')];_0x37b65f+=0x1){_0x5e4a6e=_0x31e85e[_0x37b65f];if(_[_0xbb10('0x43')](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']])){_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']]=new FreshsalesAccount(_0x5e4a6e);}else{_0x2ca491['mergeFromDatabase'](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']],_0x5e4a6e);}}}return _0x2ca491[_0xbb10('0x24')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4e')]=function(){var _0x12f750=this;return function(_0x17807e){for(var _0x1e4694=0x0;_0x1e4694<_0x17807e['length'];_0x1e4694+=0x1){_['merge'](_0x12f750['voiceQueues'][_0x17807e[_0x1e4694][_0xbb10('0x29')]],_0x17807e[_0x1e4694]);}return _0x12f750[_0xbb10('0x4f')];};};Realtime[_0xbb10('0x3f')]['initVoiceQueueReports']=function(){var _0x5cd089=this;return function(_0x46f462){clearVoiceQueues(_0x5cd089[_0xbb10('0x4f')]);if(_0x46f462){_0x46f462=_[_0xbb10('0x50')](_0x46f462,_0xbb10('0x51'));for(var _0x260e06 in _0x46f462){if(_0x46f462[_0xbb10('0x27')](_0x260e06)){for(var _0x4cf2f3=0x0;_0x4cf2f3<_0x46f462[_0x260e06][_0xbb10('0x41')];_0x4cf2f3+=0x1){var _0x15fae2=_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x52')];if(_0x5cd089[_0xbb10('0x4f')][_0x15fae2]){if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x53')]){_0x5cd089['voiceQueues'][_0x15fae2]['unmanaged']+=0x1;}if(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerabandon']){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x54')]+=0x1;}_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;if(_0x4cf2f3===_0x46f462[_0x260e06]['length']-0x1){_0x5cd089['voiceQueues'][_0x15fae2]['sumDuration']+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x58')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x59')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5a')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;_0x5cd089['voiceQueues'][_0x15fae2]['total']+=0x1;if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5b')]){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2d')]+=0x1;_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x33')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallercompleteAt'])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')]),_0xbb10('0x57'))||0x0;}}else{_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2f')]+=_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]||0x0;}}}}}}return _0x5cd089['voiceQueues'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x5c')]=function(){var _0x30f3ea=this;return function(_0x322b41){clearVoiceCallReports(_0x30f3ea[_0xbb10('0x5d')]);if(_0x322b41){for(var _0x172be3=0x0;_0x172be3<_0x322b41[_0xbb10('0x41')];_0x172be3+=0x1){_0x30f3ea[_0xbb10('0x5d')]['total']+=0x1;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x2f')]+=_0x322b41[_0x172be3][_0xbb10('0x5e')];if(_0x322b41[_0x172be3]['disposition']==='ANSWERED'){_0x30f3ea['outbound'][_0xbb10('0x2d')]+=0x1;_0x30f3ea['outbound']['sumHoldTime']+=_0x322b41[_0x172be3][_0xbb10('0x5e')]-_0x322b41[_0x172be3][_0xbb10('0x5f')]||0x0;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x33')]+=_0x322b41[_0x172be3][_0xbb10('0x5f')];}}}return _0x30f3ea[_0xbb10('0x5d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x60')]=function(){var _0x188b97=this;return function(_0x5206e1){if(_0x5206e1){freeIsNotKey(_0x5206e1,_0x188b97[_0xbb10('0x15')],_0xbb10('0x29'));for(var _0x46b6d2=0x0,_0x35b811={};_0x46b6d2<_0x5206e1['length'];_0x46b6d2+=0x1){_0x35b811=_0x5206e1[_0x46b6d2];if(_['isUndefined'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]])){_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]]=new Campaign(_0x35b811);}else{_0x188b97['mergeFromDatabase'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]],_0x35b811);_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]][_0xbb10('0x61')]=_0x35b811['SquareProject']?_0x35b811['SquareProject'][_0xbb10('0x29')]:undefined;}}}return _0x188b97[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')]['initVoiceExtensions']=function(){var _0x256b35=this;return function(_0x13e2ab){if(_0x13e2ab){freeIsNotKey(_0x13e2ab,_0x256b35['voiceExtensions'],'id');for(var _0x5caa06=0x0,_0x2f667f={};_0x5caa06<_0x13e2ab[_0xbb10('0x41')];_0x5caa06+=0x1){_0x2f667f=_0x13e2ab[_0x5caa06];if(_[_0xbb10('0x43')](_0x256b35['voiceExtensions'][_0x2f667f['id']])){_0x256b35[_0xbb10('0x17')][_0x2f667f['id']]=new VoiceExtension(_0x2f667f);}else{_0x256b35[_0xbb10('0x3e')](_0x256b35[_0xbb10('0x17')][_0x2f667f['id']],_0x2f667f);}}}return _0x256b35[_0xbb10('0x17')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x62')]=function(){var _0x45bd4e=this;return function(_0x226363){clearCampaigns(_0x45bd4e[_0xbb10('0x15')]);for(var _0x479d51=0x0;_0x479d51<_0x226363[_0xbb10('0x41')];_0x479d51+=0x1){_[_0xbb10('0x63')](_0x45bd4e[_0xbb10('0x15')][_0x226363[_0x479d51][_0xbb10('0x29')]],_0x226363[_0x479d51]);}return _0x45bd4e[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x64')]=function(){var _0x305d52=this;return function(_0x17ed20){if(_0x17ed20){freeIsNotKey(_0x17ed20,_0x305d52[_0xbb10('0x25')],'id');for(var _0x15e043=0x0,_0x2a4278={};_0x15e043<_0x17ed20['length'];_0x15e043+=0x1){_0x2a4278=_0x17ed20[_0x15e043];if(_['isUndefined'](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']])){_0x305d52[_0xbb10('0x25')][_0x2a4278['id']]=new FaxAccount(_0x2a4278);}else{_0x305d52[_0xbb10('0x3e')](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']],_0x2a4278);}}}return _0x305d52[_0xbb10('0x25')];};};Realtime['prototype'][_0xbb10('0x65')]=function(){var _0x332fbe=this;return function(_0x3b4d0b){if(_0x3b4d0b){freeIsNotKey(_0x3b4d0b,_0x332fbe[_0xbb10('0x4f')],_0xbb10('0x29'));for(var _0x379d49=0x0,_0x546db5={};_0x379d49<_0x3b4d0b[_0xbb10('0x41')];_0x379d49+=0x1){_0x546db5=_0x3b4d0b[_0x379d49];if(_[_0xbb10('0x43')](_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]])){_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]]=new VoiceQueue(_0x546db5);}else{_0x332fbe[_0xbb10('0x3e')](_0x332fbe[_0xbb10('0x4f')][_0x546db5[_0xbb10('0x29')]],_0x546db5);}}}return _0x332fbe[_0xbb10('0x4f')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index 6f55cd9..98d8b7f 100644 --- a/server/services/ami/realtime/utils.js +++ b/server/services/ami/realtime/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x839e=['mergeDBDataToRealtime'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x839e,0x1ce));var _0xe839=function(_0x3b84dc,_0x5b6a7b){_0x3b84dc=_0x3b84dc-0x0;var _0x2c8da3=_0x839e[_0x3b84dc];return _0x2c8da3;};'use strict';function mergeDBDataToRealtime(_0x58b522,_0x15597f){var _0x1dafad=Object['assign']({},_0x58b522);for(var _0x18d5aa in _0x15597f){if(_0x1dafad['hasOwnProperty'](_0x18d5aa)){_0x1dafad[_0x18d5aa]=_0x15597f[_0x18d5aa];}}return _0x1dafad;}exports[_0xe839('0x0')]=mergeDBDataToRealtime; \ No newline at end of file +var _0xa2cb=['mergeDBDataToRealtime','assign','hasOwnProperty'];(function(_0x260c47,_0x17967b){var _0x4271c4=function(_0x22c07a){while(--_0x22c07a){_0x260c47['push'](_0x260c47['shift']());}};_0x4271c4(++_0x17967b);}(_0xa2cb,0x1ba));var _0xba2c=function(_0x14e020,_0xaa8d3c){_0x14e020=_0x14e020-0x0;var _0x3ac8bf=_0xa2cb[_0x14e020];return _0x3ac8bf;};'use strict';function mergeDBDataToRealtime(_0x367009,_0x2d5e09){var _0x198fe2=Object[_0xba2c('0x0')]({},_0x367009);for(var _0x3f57aa in _0x2d5e09){if(_0x198fe2[_0xba2c('0x1')](_0x3f57aa)){_0x198fe2[_0x3f57aa]=_0x2d5e09[_0x3f57aa];}}return _0x198fe2;}exports[_0xba2c('0x2')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index dda8afe..b001c6b 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 _0x6809=['disposition','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','transfers','uniqueid','type','UserId','membername','monitor','monitors','monitorFilename','filename','createdAt','xcally-motion-preview','connectedlinename','xcally-motion-dialer','isArray','Local','indexOf','mobile','phone','substring','lastIndexOf','transfererlinkedid','exports','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedTransfer','find','accountcode','name','isNil','interface','format','SIP/%s','length','findAgent','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','keys','getCallType','split','calleridnum','internal','destination','exten','dialer','lastapplication','queue','lastdata','context','from-voip-provider','from-sip','channel','destinationchannel','callerid','originatecalleridnum'];(function(_0x422be2,_0x1c439e){var _0x1b820e=function(_0x513cc8){while(--_0x513cc8){_0x422be2['push'](_0x422be2['shift']());}};_0x1b820e(++_0x1c439e);}(_0x6809,0x12f));var _0x9680=function(_0xe3e0af,_0x4564ed){_0xe3e0af=_0xe3e0af-0x0;var _0x4828e9=_0x6809[_0xe3e0af];return _0x4828e9;};'use strict';var _=require('lodash');var moment=require(_0x9680('0x0'));var util=require(_0x9680('0x1'));var config=require(_0x9680('0x2'));var ami=require(_0x9680('0x3'));var RpcVoiceAgentReport=require(_0x9680('0x4'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x9680('0x5'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x9680('0x6'));var RpcVoiceTransferReport=require(_0x9680('0x7'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x9680('0x8'));var VoiceAgentReport=require(_0x9680('0x9'));var VoiceDialReport=require(_0x9680('0xa'));var UserReport=require(_0x9680('0xb'));function Report(_0x46d0e1){this[_0x9680('0xc')]=_0x46d0e1;this[_0x9680('0xd')]=_0x46d0e1[_0x9680('0xd')];this[_0x9680('0xe')]=_0x46d0e1['telephones'];}Report[_0x9680('0xf')]['sync']=function(_0x219a06){var _0x1b28e6=new VoiceQueueReport(this['realtime']);var _0x18487c=new VoiceAgentReport(this[_0x9680('0xc')]);var _0x2abb71=new VoiceDialReport(this[_0x9680('0xc')]);var _0x278cf8=new VoiceCallReport(this[_0x9680('0xc')]);var _0x3c777e=new UserReport(this['realtime']);if(config['xdr']&&config[_0x9680('0x10')][_0x9680('0x11')]){ami['on'](_0x9680('0x12'),this[_0x9680('0x13')][_0x9680('0x14')](this));ami['on'](_0x9680('0x15'),this[_0x9680('0x16')][_0x9680('0x14')](this));ami['on']('custom:voiceAgentReport',this[_0x9680('0x17')][_0x9680('0x14')](this));ami['on'](_0x9680('0x18'),this[_0x9680('0x19')][_0x9680('0x14')](this));ami['on']('blindtransfer',this[_0x9680('0x1a')][_0x9680('0x14')](this));ami['on']('attendedtransfer',this[_0x9680('0x1b')][_0x9680('0x14')](this));}};Report['prototype']['findAgent']=function(_0x4db501){var _0x380002;_0x380002=_[_0x9680('0x1c')](this[_0x9680('0xd')],function(_0x2215d7){return _0x2215d7[_0x9680('0x1d')]==_0x4db501||_0x2215d7[_0x9680('0x1e')]==_0x4db501;});if(_[_0x9680('0x1f')](_0x380002)){var _0x4967b4=_[_0x9680('0x1c')](this[_0x9680('0xe')],function(_0xd48987){return _0xd48987[_0x9680('0x1d')]==_0x4db501||_0xd48987[_0x9680('0x1e')]==_0x4db501;});if(_0x4967b4){_0x380002=_[_0x9680('0x1c')](this[_0x9680('0xd')],function(_0x5023c7){return _0x5023c7[_0x9680('0x20')]==util[_0x9680('0x21')](_0x9680('0x22'),_0x4967b4[_0x9680('0x1e')]);});}}return _0x380002;};Report['prototype']['voiceQueueReport']=function(_0x69a879){for(var _0x25e5a1=0x0;_0x25e5a1<_0x69a879[_0x9680('0x23')];_0x25e5a1+=0x1){var _0x5c8519=this[_0x9680('0x24')](_0x69a879[_0x25e5a1]['connectedlinenum']);if(_0x5c8519){_0x69a879[_0x25e5a1][_0x9680('0x1d')]=_0x5c8519[_0x9680('0x1d')];_0x69a879[_0x25e5a1][_0x9680('0x25')]=!![];_0x69a879[_0x25e5a1][_0x9680('0x26')]=_0x5c8519['name'];_0x69a879[_0x25e5a1][_0x9680('0x20')]=_['isNil'](_0x5c8519['interface'])?util['format'](_0x9680('0x22'),_0x5c8519[_0x9680('0x1e')]):_0x5c8519[_0x9680('0x20')];if(_0x69a879[_0x25e5a1][_0x9680('0x27')]){_0x69a879[_0x25e5a1][_0x9680('0x28')]=moment()[_0x9680('0x21')](_0x9680('0x29'));}if(_0x69a879[_0x25e5a1][_0x9680('0x2a')]){_0x69a879[_0x25e5a1][_0x9680('0x2b')]=moment()[_0x9680('0x21')](_0x9680('0x29'));}RpcMemberReport[_0x9680('0x13')](_0x69a879[_0x25e5a1]);}RpcVoiceQueueReport[_0x9680('0x2c')](_0x69a879[_0x25e5a1]);}};function extractCalleridNumber(_0x14ed4d){var _0x3cbc65=_0x14ed4d[_0x9680('0x2d')](/<(.*?)>/);return _0x3cbc65?_0x3cbc65[0x1]:_0x14ed4d;}Report['prototype'][_0x9680('0x2e')]=function(_0x3ff641){for(var _0x57fd38=0x0;_0x57fd38','transfers','linkedid','transfereelinkedid','uniqueid','UserId','membername','create','monitor','monitors','monitorFilename','filename','connectedlinename','voiceAgentReport','isArray','forEach','voiceDialReport','Local','substring','indexOf','mobile','phone','lastIndexOf','attendedTransfer','lodash','moment','util','../ami','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','sync','xdr','disabled','custom:voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','blindTransfer','attendedtransfer','findAgent','find','accountcode'];(function(_0x16f0c1,_0x1c2a82){var _0x3834d9=function(_0x1599e9){while(--_0x1599e9){_0x16f0c1['push'](_0x16f0c1['shift']());}};_0x3834d9(++_0x1c2a82);}(_0x15c5,0x1a9));var _0x515c=function(_0x12ddb2,_0x5ad61e){_0x12ddb2=_0x12ddb2-0x0;var _0x10b6dd=_0x15c5[_0x12ddb2];return _0x10b6dd;};'use strict';var _=require(_0x515c('0x0'));var moment=require(_0x515c('0x1'));var util=require(_0x515c('0x2'));var config=require('../../../config/environment');var ami=require(_0x515c('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x515c('0x4'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x515c('0x5'));var RpcVoiceRecording=require(_0x515c('0x6'));var RpcVoiceTransferReport=require(_0x515c('0x7'));var VoiceQueueReport=require(_0x515c('0x8'));var VoiceCallReport=require(_0x515c('0x9'));var VoiceAgentReport=require(_0x515c('0xa'));var VoiceDialReport=require(_0x515c('0xb'));var UserReport=require(_0x515c('0xc'));function Report(_0x5c21f8){this[_0x515c('0xd')]=_0x5c21f8;this[_0x515c('0xe')]=_0x5c21f8[_0x515c('0xe')];this[_0x515c('0xf')]=_0x5c21f8[_0x515c('0xf')];}Report['prototype'][_0x515c('0x10')]=function(_0x4af588){var _0x2ff04c=new VoiceQueueReport(this[_0x515c('0xd')]);var _0x39ff21=new VoiceAgentReport(this[_0x515c('0xd')]);var _0x26abf2=new VoiceDialReport(this[_0x515c('0xd')]);var _0x6d3cab=new VoiceCallReport(this[_0x515c('0xd')]);var _0x255d1d=new UserReport(this[_0x515c('0xd')]);if(config[_0x515c('0x11')]&&config[_0x515c('0x11')][_0x515c('0x12')]){ami['on'](_0x515c('0x13'),this['voiceQueueReport'][_0x515c('0x14')](this));ami['on'](_0x515c('0x15'),this[_0x515c('0x16')][_0x515c('0x14')](this));ami['on'](_0x515c('0x17'),this['voiceAgentReport'][_0x515c('0x14')](this));ami['on'](_0x515c('0x18'),this['voiceDialReport'][_0x515c('0x14')](this));ami['on']('blindtransfer',this[_0x515c('0x19')][_0x515c('0x14')](this));ami['on'](_0x515c('0x1a'),this['attendedTransfer'][_0x515c('0x14')](this));}};Report['prototype'][_0x515c('0x1b')]=function(_0x5aed79){var _0xe16bcc;_0xe16bcc=_[_0x515c('0x1c')](this['agents'],function(_0x27e5d9){return _0x27e5d9[_0x515c('0x1d')]==_0x5aed79||_0x27e5d9[_0x515c('0x1e')]==_0x5aed79;});if(_[_0x515c('0x1f')](_0xe16bcc)){var _0x5807cc=_[_0x515c('0x1c')](this['telephones'],function(_0x422f97){return _0x422f97[_0x515c('0x1d')]==_0x5aed79||_0x422f97[_0x515c('0x1e')]==_0x5aed79;});if(_0x5807cc){_0xe16bcc=_[_0x515c('0x1c')](this[_0x515c('0xe')],function(_0x2849d6){return _0x2849d6[_0x515c('0x20')]==util['format'](_0x515c('0x21'),_0x5807cc['name']);});}}return _0xe16bcc;};Report['prototype'][_0x515c('0x22')]=function(_0x1f4e29){for(var _0x3c1f40=0x0;_0x3c1f40<_0x1f4e29[_0x515c('0x23')];_0x3c1f40+=0x1){var _0x2013de=this['findAgent'](_0x1f4e29[_0x3c1f40][_0x515c('0x24')]);if(_0x2013de){_0x1f4e29[_0x3c1f40][_0x515c('0x1d')]=_0x2013de[_0x515c('0x1d')];_0x1f4e29[_0x3c1f40][_0x515c('0x25')]=!![];_0x1f4e29[_0x3c1f40][_0x515c('0x26')]=_0x2013de[_0x515c('0x1e')];_0x1f4e29[_0x3c1f40][_0x515c('0x20')]=_[_0x515c('0x1f')](_0x2013de[_0x515c('0x20')])?util[_0x515c('0x27')]('SIP/%s',_0x2013de['name']):_0x2013de[_0x515c('0x20')];if(_0x1f4e29[_0x3c1f40][_0x515c('0x28')]){_0x1f4e29[_0x3c1f40]['queuecallercompleteAt']=moment()[_0x515c('0x27')](_0x515c('0x29'));}if(_0x1f4e29[_0x3c1f40][_0x515c('0x2a')]){_0x1f4e29[_0x3c1f40][_0x515c('0x2b')]=moment()[_0x515c('0x27')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x515c('0x22')](_0x1f4e29[_0x3c1f40]);}RpcVoiceQueueReport['create'](_0x1f4e29[_0x3c1f40]);}};function extractCalleridNumber(_0xf256dd){var _0xe90441=_0xf256dd[_0x515c('0x2c')](/<(.*?)>/);return _0xe90441?_0xe90441[0x1]:_0xf256dd;}Report['prototype']['getAgentByInternal']=function(_0x4a3c20){for(var _0x5af7ca=0x0;_0x5af7ca0x0?!![]:![];if(!_0x977c5a){return this[_0x7d6a('0x6f')](this[_0x7d6a('0x14')][_0x7d6a('0x70')]);}};VoiceQueueReport[_0x7d6a('0x3b')]['syncQueueMember']=function(_0x16d3fa){var _0x26afc2=this[_0x7d6a('0x14')]['id'];if(this[_0x7d6a('0x14')][_0x7d6a('0x66')][_0x26afc2]&&this[_0x7d6a('0x14')]['queuestatus'][_0x26afc2][_0x16d3fa['actionid']]){this[_0x7d6a('0x14')][_0x7d6a('0x66')][_0x26afc2][_0x16d3fa[_0x7d6a('0x65')]]['agents'][_0x7d6a('0x71')](_0x16d3fa);}};VoiceQueueReport[_0x7d6a('0x3b')][_0x7d6a('0x17')]=function(_0x742dc9){var _0xcfad38=this;try{if(this[_0x7d6a('0x5f')](_0x742dc9)&&this[_0x7d6a('0x5f')](_0x742dc9['queue'])){logger[_0x7d6a('0x4e')](_0x7d6a('0x72'),util[_0x7d6a('0x46')](_0x742dc9,{'showHidden':![],'depth':null}));var _0x339a3a=this[_0x7d6a('0x12')][_0x742dc9[_0x7d6a('0x52')]];if(_0x339a3a){logger['info'](_0x7d6a('0x73'),_0x339a3a['name']);this[_0x7d6a('0x14')][_0x7d6a('0x61')][_0x339a3a[_0x7d6a('0x5d')]]={'summaryEvent':_0x742dc9};this[_0x7d6a('0x14')][_0x7d6a('0x6e')]+=0x1;return ami[_0x7d6a('0x3f')]({'action':_0x7d6a('0x66'),'queue':_0x339a3a[_0x7d6a('0x5d')]})[_0x7d6a('0x64')](function(_0x2dcb4f){if(!_0xcfad38[_0x7d6a('0x14')][_0x7d6a('0x66')][_0x742dc9[_0x7d6a('0x65')]]){_0xcfad38[_0x7d6a('0x14')][_0x7d6a('0x66')][_0x742dc9[_0x7d6a('0x65')]]={};}_0xcfad38[_0x7d6a('0x14')][_0x7d6a('0x66')][_0x742dc9[_0x7d6a('0x65')]][_0x2dcb4f[_0x7d6a('0x65')]]={'queue':_0x339a3a[_0x7d6a('0x5d')],'agents':[]};})[_0x7d6a('0x67')](function(_0x12b733){throw _0x12b733;});}}}catch(_0x5ae7a2){logger['error']('[voiceQueueReport][queuesummary]',util[_0x7d6a('0x46')](_0x5ae7a2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7d6a('0x3b')][_0x7d6a('0x6f')]=function(_0xdcd949){if(this[_0x7d6a('0x14')][_0x7d6a('0x6e')]>0x0){this['summary'][_0x7d6a('0x70')]=_0xdcd949;return;}logger['debug'](_0x7d6a('0x74'),util['inspect'](_0xdcd949,{'showHidden':![],'depth':null}));this[_0x7d6a('0x14')]=initializeSummary();ami[_0x7d6a('0x4c')](_0x7d6a('0x75'),{});};VoiceQueueReport[_0x7d6a('0x3b')]['syncQueueCallerJoin']=function(_0x87dac7){try{if(this[_0x7d6a('0x5f')](_0x87dac7)){logger[_0x7d6a('0x4e')]('[%s][voiceQueueReport][queuecallerjoin]',_0x87dac7[_0x7d6a('0x50')],util[_0x7d6a('0x46')](_0x87dac7,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x7d6a('0xd')][_0x87dac7[_0x7d6a('0x50')]])){this[_0x7d6a('0xd')][_0x87dac7[_0x7d6a('0x50')]]=[];}if(_['isUndefined'](this[_0x7d6a('0x10')][_0x87dac7['uniqueid']])){this[_0x7d6a('0x10')][_0x87dac7[_0x7d6a('0x50')]]={};}var _0x410f5b=new QueueReport();_0x410f5b[_0x7d6a('0x52')]=_0x87dac7[_0x7d6a('0x52')];_0x410f5b[_0x7d6a('0x59')]=this[_0x7d6a('0x12')][_0x410f5b[_0x7d6a('0x52')]]&&this[_0x7d6a('0x12')][_0x410f5b['queue']][_0x7d6a('0x59')]?this[_0x7d6a('0x12')][_0x410f5b[_0x7d6a('0x52')]][_0x7d6a('0x59')]||_0x7d6a('0x5a'):_0x7d6a('0x5a');_0x410f5b[_0x7d6a('0x76')]=moment()[_0x7d6a('0x51')](_0x7d6a('0x77'));_0x410f5b[_0x7d6a('0x78')]=_0x87dac7['position'];_0x410f5b['count']=_0x87dac7[_0x7d6a('0x79')];_0x410f5b[_0x7d6a('0x50')]=_0x87dac7[_0x7d6a('0x50')];_0x410f5b[_0x7d6a('0x7a')]=this['channels'][_0x87dac7[_0x7d6a('0x50')]]['routealias'];logger[_0x7d6a('0x7b')](_0x7d6a('0x7c'),_0x410f5b[_0x7d6a('0x52')],_0x410f5b[_0x7d6a('0x59')]);_[_0x7d6a('0x7d')](_0x410f5b,_['pick'](_0x87dac7,_[_0x7d6a('0x7e')](_0x410f5b)));this[_0x7d6a('0xd')][_0x87dac7['uniqueid']][_0x7d6a('0x71')](_0x410f5b);this[_0x7d6a('0x10')][_0x87dac7[_0x7d6a('0x50')]]=_0x410f5b;this[_0x7d6a('0x4d')](_0x410f5b,_0x7d6a('0x1d'));}}catch(_0x54f842){logger['error'](_0x7d6a('0x7f'),_0x87dac7['uniqueid'],util[_0x7d6a('0x46')](_0x54f842,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7d6a('0x3b')][_0x7d6a('0x20')]=function(_0x538b93){try{if(this[_0x7d6a('0x5f')](_0x538b93)){logger[_0x7d6a('0x4e')](_0x7d6a('0x80'),_0x538b93[_0x7d6a('0x50')],util[_0x7d6a('0x46')](_0x538b93,{'showHidden':![],'depth':null}));if(this[_0x7d6a('0xd')][_0x538b93[_0x7d6a('0x50')]]){var _0x15b092=_['last'](this[_0x7d6a('0xd')][_0x538b93[_0x7d6a('0x50')]]);_0x15b092[_0x7d6a('0x81')]=![];_0x15b092[_0x7d6a('0x82')]=null;_0x15b092[_0x7d6a('0x83')]=_0x538b93['holdtime'];_0x15b092['originalposition']=_0x538b93['originalposition'];_0x15b092[_0x7d6a('0x1f')]=!![];_0x15b092[_0x7d6a('0x84')]=moment()[_0x7d6a('0x51')](_0x7d6a('0x77'));_0x15b092['queuecallerexitreason']=_0x7d6a('0x85');_0x15b092[_0x7d6a('0x86')]=null;logger[_0x7d6a('0x7b')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x15b092[_0x7d6a('0x52')],_0x15b092[_0x7d6a('0x59')]);this['channels'][_0x538b93[_0x7d6a('0x50')]]=_0x15b092;this[_0x7d6a('0x4b')](_0x15b092,_0x7d6a('0x1f'));}}}catch(_0x4197c2){logger[_0x7d6a('0x44')](_0x7d6a('0x80'),_0x538b93[_0x7d6a('0x50')],util[_0x7d6a('0x46')](_0x4197c2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7d6a('0x3b')][_0x7d6a('0x22')]=function(_0x545307){try{if(this['isNotNull'](_0x545307)){logger[_0x7d6a('0x4e')](_0x7d6a('0x87'),_0x545307[_0x7d6a('0x50')],util[_0x7d6a('0x46')](_0x545307,{'showHidden':![],'depth':null}));if(this[_0x7d6a('0xd')][_0x545307[_0x7d6a('0x50')]]){var _0x259d4b=_['last'](this[_0x7d6a('0xd')][_0x545307[_0x7d6a('0x50')]]);_0x259d4b[_0x7d6a('0x88')]=moment()[_0x7d6a('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x259d4b[_0x7d6a('0x89')]=_0x545307[_0x7d6a('0x89')];_0x259d4b[_0x7d6a('0x8a')]=_0x545307[_0x7d6a('0x8a')];logger['info'](_0x7d6a('0x8b'),_0x259d4b[_0x7d6a('0x52')],_0x259d4b[_0x7d6a('0x59')],_0x545307[_0x7d6a('0x89')],_0x545307['connectedlinename']);this['channels'][_0x545307[_0x7d6a('0x50')]]=_0x259d4b;this[_0x7d6a('0x4d')](_0x259d4b,_0x7d6a('0x21'));}}}catch(_0x53b857){logger[_0x7d6a('0x44')](_0x7d6a('0x87'),_0x545307['uniqueid'],util[_0x7d6a('0x46')](_0x53b857,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7d6a('0x3b')]['syncAgentConnect']=function(_0x4ef03b){try{if(this[_0x7d6a('0x5f')](_0x4ef03b)){logger[_0x7d6a('0x4e')](_0x7d6a('0x8c'),_0x4ef03b['uniqueid'],util[_0x7d6a('0x46')](_0x4ef03b,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4ef03b[_0x7d6a('0x50')]]){var _0x237dff=_[_0x7d6a('0x8d')](this[_0x7d6a('0xd')][_0x4ef03b[_0x7d6a('0x50')]]);_0x237dff[_0x7d6a('0x81')]=!![];_0x237dff[_0x7d6a('0x55')]='COMPLETEDBYAGENT';logger[_0x7d6a('0x7b')](_0x7d6a('0x8e'),_0x237dff[_0x7d6a('0x52')],_0x237dff[_0x7d6a('0x59')]);}}}catch(_0x5d80e2){logger['error']('[%s][voiceQueueReport][agentconnect]',_0x4ef03b[_0x7d6a('0x50')],util[_0x7d6a('0x46')](_0x5d80e2,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentComplete']=function(_0x29c56f){try{if(this[_0x7d6a('0x5f')](_0x29c56f)){logger['debug'](_0x7d6a('0x8f'),_0x29c56f[_0x7d6a('0x50')],util[_0x7d6a('0x46')](_0x29c56f,{'showHidden':![],'depth':null}));if(this[_0x7d6a('0xd')][_0x29c56f[_0x7d6a('0x50')]]){var _0x29ab9b=_[_0x7d6a('0x8d')](this[_0x7d6a('0xd')][_0x29c56f[_0x7d6a('0x50')]]);_0x29ab9b['queuecallerabandon']=![];_0x29ab9b[_0x7d6a('0x84')]=null;_0x29ab9b[_0x7d6a('0x90')]=!![];_0x29ab9b[_0x7d6a('0x86')]=_0x29c56f['membername'];_0x29ab9b[_0x7d6a('0x83')]=_0x29c56f[_0x7d6a('0x83')];_0x29ab9b[_0x7d6a('0x81')]=!![];_0x29ab9b[_0x7d6a('0x91')]=![];_0x29ab9b[_0x7d6a('0x92')]=null;if(!_0x29ab9b[_0x7d6a('0x93')]){if(_0x29c56f['reason']==_0x7d6a('0x93')){_0x29ab9b[_0x7d6a('0x55')]=_0x7d6a('0x94');logger[_0x7d6a('0x7b')](_0x7d6a('0x95'),_0x29ab9b[_0x7d6a('0x52')],_0x29ab9b['type']);}else{if(_[_0x7d6a('0x96')](_0x29c56f['channel']['toLowerCase'](),_0x7d6a('0x97'))){if(this['queueReports'][_0x29c56f['linkedid']]){var _0x283ed5=_[_0x7d6a('0x8d')](this['queueReports'][_0x29c56f[_0x7d6a('0x98')]]);_0x283ed5[_0x7d6a('0x81')]=![];_0x283ed5[_0x7d6a('0x91')]=!![];_0x283ed5[_0x7d6a('0x92')]=moment(_0x29ab9b[_0x7d6a('0x76')])['add'](_0x29c56f[_0x7d6a('0x83')],_0x7d6a('0x99'))[_0x7d6a('0x51')](_0x7d6a('0x77'));_0x283ed5['queuecallerexitreason']=_0x7d6a('0x9a');_0x283ed5[_0x7d6a('0x93')]=!![];_0x283ed5['transfertype']=_0x7d6a('0x9b');_0x283ed5['transferexten']=_0x29c56f['destexten'];_0x283ed5[_0x7d6a('0x9c')]=_0x29c56f[_0x7d6a('0x50')];logger[_0x7d6a('0x7b')](_0x7d6a('0x9d'),_0x283ed5[_0x7d6a('0x52')],_0x283ed5[_0x7d6a('0x59')]);var _0x56c5d1=this['queueReports'][_0x29c56f[_0x7d6a('0x98')]];this[_0x7d6a('0xd')][_0x29c56f['linkedid']]=this[_0x7d6a('0xd')][_0x29c56f[_0x7d6a('0x50')]];this[_0x7d6a('0xd')][_0x29c56f['uniqueid']]=_0x56c5d1;}}else{_0x29ab9b[_0x7d6a('0x55')]=_0x7d6a('0x9e')+_0x29c56f['reason']['toUpperCase']();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x29ab9b['queue'],_0x29ab9b[_0x7d6a('0x59')],_0x29ab9b[_0x7d6a('0x55')]);}}}this[_0x7d6a('0x10')][_0x29c56f[_0x7d6a('0x50')]]=_0x29ab9b;this[_0x7d6a('0x4b')](_0x29ab9b,_0x7d6a('0x23'));}}}catch(_0x4d5d64){logger[_0x7d6a('0x44')](_0x7d6a('0x8f'),_0x29c56f[_0x7d6a('0x50')],util[_0x7d6a('0x46')](_0x4d5d64,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7d6a('0x3b')][_0x7d6a('0x28')]=function(_0x5047f7){try{if(this[_0x7d6a('0x5f')](_0x5047f7)){logger[_0x7d6a('0x4e')](_0x7d6a('0x9f'),_0x5047f7[_0x7d6a('0x50')],util[_0x7d6a('0x46')](_0x5047f7,{'showHidden':![],'depth':null}));this[_0x7d6a('0xa0')](_0x5047f7[_0x7d6a('0x50')],_[_0x7d6a('0x7e')](_0x5047f7[_0x7d6a('0xa1')])[0x0],_0x5047f7[_0x7d6a('0xa2')]);if(this[_0x7d6a('0xd')][_0x5047f7[_0x7d6a('0x50')]]){var _0x3165c6=_[_0x7d6a('0x8d')](this[_0x7d6a('0xd')][_0x5047f7[_0x7d6a('0x50')]]);if(_0x3165c6){if(this[_0x7d6a('0x5f')](_0x5047f7['variable'])&&this[_0x7d6a('0x5f')](_0x5047f7[_0x7d6a('0xa1')][_0x7d6a('0x66')])){switch(_0x5047f7['value']){case _0x7d6a('0xa3'):_0x3165c6[_0x7d6a('0x91')]=![];_0x3165c6[_0x7d6a('0x92')]=null;break;case _0x7d6a('0xa4'):_0x3165c6['lastevent']='timeout';_0x3165c6[_0x7d6a('0x91')]=!![];_0x3165c6[_0x7d6a('0x92')]=moment()[_0x7d6a('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x3165c6[_0x7d6a('0x88')]=moment()['format'](_0x7d6a('0x77'));logger[_0x7d6a('0x4e')](_0x7d6a('0xa5'),_0x5047f7[_0x7d6a('0x50')],util['inspect'](_0x3165c6,{'showHidden':![],'depth':null}));ami['emit'](_0x7d6a('0xa6'),_0x3165c6);break;default:_0x3165c6['queuecallerexit']=!![];_0x3165c6[_0x7d6a('0x92')]=moment()[_0x7d6a('0x51')](_0x7d6a('0x77'));_0x3165c6[_0x7d6a('0x88')]=moment()['format'](_0x7d6a('0x77'));}_0x3165c6[_0x7d6a('0x1f')]=![];_0x3165c6[_0x7d6a('0x84')]=null;_0x3165c6['queuecallerexitreason']=_0x5047f7[_0x7d6a('0xa2')];this[_0x7d6a('0x10')][_0x5047f7[_0x7d6a('0x50')]]=_0x3165c6;this[_0x7d6a('0x4b')](_0x3165c6,_0x7d6a('0x27'));}else if(this[_0x7d6a('0x5f')](_0x5047f7[_0x7d6a('0xa1')])&&this[_0x7d6a('0x5f')](_0x5047f7[_0x7d6a('0xa1')][_0x7d6a('0xa7')])){if(!_0x3165c6[_0x7d6a('0x1f')]){_0x3165c6[_0x7d6a('0x91')]=!![];_0x3165c6[_0x7d6a('0x92')]=moment()[_0x7d6a('0x51')](_0x7d6a('0x77'));_0x3165c6[_0x7d6a('0x55')]=_0x7d6a('0xa8');_0x3165c6['queuecallerleaveAt']=moment()['format'](_0x7d6a('0x77'));this[_0x7d6a('0x10')][_0x5047f7[_0x7d6a('0x50')]]=_0x3165c6;}}logger['info']('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x5047f7[_0x7d6a('0x50')],_0x3165c6[_0x7d6a('0x52')],_0x3165c6[_0x7d6a('0x59')],_['keys'](_0x5047f7[_0x7d6a('0xa1')])[0x0],_0x5047f7[_0x7d6a('0xa2')]);_0x3165c6[_0x7d6a('0x15')]=this[_0x7d6a('0x15')][_0x5047f7[_0x7d6a('0x50')]];}}}}catch(_0x35f643){logger[_0x7d6a('0x44')](_0x7d6a('0x9f'),_0x5047f7['uniqueid'],util[_0x7d6a('0x46')](_0x35f643,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7d6a('0x3b')][_0x7d6a('0xa0')]=function(_0xcd12c0,_0x42b4c1,_0x45715e){var _0x5c01eb=[_0x7d6a('0xa9'),_0x7d6a('0xaa'),_0x7d6a('0xab'),_0x7d6a('0xac'),'rtpaudioqosloss',_0x7d6a('0xad'),_0x7d6a('0xae'),'rtpaudioqosrttbridged',_0x7d6a('0xaf'),'sipuri',_0x7d6a('0xb0'),_0x7d6a('0xb1'),_0x7d6a('0xb2'),_0x7d6a('0xb3'),'memberinterface',_0x7d6a('0xb4'),_0x7d6a('0xb5'),_0x7d6a('0xb6'),'memberrealtime'];if(!_[_0x7d6a('0x3e')](_0x42b4c1)&&!_[_0x7d6a('0xb7')](_0x5c01eb,_0x42b4c1)){if(_['isUndefined'](this['variables'][_0xcd12c0])){this[_0x7d6a('0x15')][_0xcd12c0]={};}this['variables'][_0xcd12c0][_0x42b4c1]=_0x45715e;}};VoiceQueueReport[_0x7d6a('0x3b')]['handleHangup']=function(_0x33cafb,_0x40477f,_0x2cc6d9){var _0xf54d05={};for(var _0x5d61b4=0x0;_0x5d61b40x0?!![]:![];if(!_0x1f9450){return this[_0xdee6('0x1a')](this['summary']['completeEvent']);}};VoiceQueueReport[_0xdee6('0xa')][_0xdee6('0x1c')]=function(_0x18ed74){var _0x39ed06=this[_0xdee6('0x15')]['id'];if(this[_0xdee6('0x15')][_0xdee6('0x6b')][_0x39ed06]&&this[_0xdee6('0x15')][_0xdee6('0x6b')][_0x39ed06][_0x18ed74['actionid']]){this[_0xdee6('0x15')][_0xdee6('0x6b')][_0x39ed06][_0x18ed74['actionid']][_0xdee6('0x11')][_0xdee6('0x6c')](_0x18ed74);}};VoiceQueueReport[_0xdee6('0xa')]['syncQueueSummary']=function(_0x22b6e4){var _0x248ca8=this;try{if(this[_0xdee6('0x59')](_0x22b6e4)&&this['isNotNull'](_0x22b6e4[_0xdee6('0x4f')])){logger[_0xdee6('0x4a')](_0xdee6('0x6d'),util[_0xdee6('0x42')](_0x22b6e4,{'showHidden':![],'depth':null}));var _0x511d5c=this[_0xdee6('0x13')][_0x22b6e4['queue']];if(_0x511d5c){logger[_0xdee6('0x6e')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x511d5c[_0xdee6('0x57')]);this[_0xdee6('0x15')]['queues'][_0x511d5c['name']]={'summaryEvent':_0x22b6e4};this[_0xdee6('0x15')][_0xdee6('0x6a')]+=0x1;return ami[_0xdee6('0x5d')]({'action':'queuestatus','queue':_0x511d5c[_0xdee6('0x57')]})['then'](function(_0xb66477){if(!_0x248ca8['summary'][_0xdee6('0x6b')][_0x22b6e4[_0xdee6('0x63')]]){_0x248ca8['summary'][_0xdee6('0x6b')][_0x22b6e4[_0xdee6('0x63')]]={};}_0x248ca8['summary'][_0xdee6('0x6b')][_0x22b6e4['actionid']][_0xb66477['actionid']]={'queue':_0x511d5c['name'],'agents':[]};})[_0xdee6('0x3d')](function(_0x38949c){throw _0x38949c;});}}}catch(_0x5bc50b){logger[_0xdee6('0x40')](_0xdee6('0x6f'),util[_0xdee6('0x42')](_0x5bc50b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xdee6('0xa')]['syncQueueSummaryComplete']=function(_0x34807b){if(this[_0xdee6('0x15')][_0xdee6('0x6a')]>0x0){this[_0xdee6('0x15')]['completeEvent']=_0x34807b;return;}logger[_0xdee6('0x4a')](_0xdee6('0x70'),util['inspect'](_0x34807b,{'showHidden':![],'depth':null}));this[_0xdee6('0x15')]=initializeSummary();ami[_0xdee6('0x48')](_0xdee6('0x71'),{});};VoiceQueueReport[_0xdee6('0xa')][_0xdee6('0x20')]=function(_0x3ac2ce){try{if(this[_0xdee6('0x59')](_0x3ac2ce)){logger[_0xdee6('0x4a')](_0xdee6('0x72'),_0x3ac2ce[_0xdee6('0x4c')],util[_0xdee6('0x42')](_0x3ac2ce,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0xdee6('0xf')][_0x3ac2ce[_0xdee6('0x4c')]])){this['queueReports'][_0x3ac2ce[_0xdee6('0x4c')]]=[];}if(_['isUndefined'](this[_0xdee6('0x12')][_0x3ac2ce[_0xdee6('0x4c')]])){this[_0xdee6('0x12')][_0x3ac2ce[_0xdee6('0x4c')]]={};}var _0x17b1a4=new QueueReport();_0x17b1a4[_0xdee6('0x4f')]=_0x3ac2ce[_0xdee6('0x4f')];_0x17b1a4[_0xdee6('0x54')]=this[_0xdee6('0x13')][_0x17b1a4[_0xdee6('0x4f')]]&&this[_0xdee6('0x13')][_0x17b1a4[_0xdee6('0x4f')]][_0xdee6('0x54')]?this['voiceQueues'][_0x17b1a4['queue']]['type']||_0xdee6('0x55'):'inbound';_0x17b1a4[_0xdee6('0x73')]=moment()[_0xdee6('0x4d')](_0xdee6('0x74'));_0x17b1a4['position']=_0x3ac2ce[_0xdee6('0x75')];_0x17b1a4['count']=_0x3ac2ce[_0xdee6('0x76')];_0x17b1a4[_0xdee6('0x4c')]=_0x3ac2ce['uniqueid'];_0x17b1a4['routealias']=this['channels'][_0x3ac2ce[_0xdee6('0x4c')]][_0xdee6('0x77')];logger['info'](_0xdee6('0x78'),_0x17b1a4[_0xdee6('0x4f')],_0x17b1a4['type']);_[_0xdee6('0x79')](_0x17b1a4,_['pick'](_0x3ac2ce,_[_0xdee6('0x7a')](_0x17b1a4)));this[_0xdee6('0xf')][_0x3ac2ce[_0xdee6('0x4c')]][_0xdee6('0x6c')](_0x17b1a4);this[_0xdee6('0x12')][_0x3ac2ce[_0xdee6('0x4c')]]=_0x17b1a4;this[_0xdee6('0x49')](_0x17b1a4,_0xdee6('0x1f'));}}catch(_0x2e2364){logger[_0xdee6('0x40')](_0xdee6('0x72'),_0x3ac2ce['uniqueid'],util['inspect'](_0x2e2364,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xdee6('0x22')]=function(_0x22a1ba){try{if(this[_0xdee6('0x59')](_0x22a1ba)){logger[_0xdee6('0x4a')](_0xdee6('0x7b'),_0x22a1ba[_0xdee6('0x4c')],util[_0xdee6('0x42')](_0x22a1ba,{'showHidden':![],'depth':null}));if(this[_0xdee6('0xf')][_0x22a1ba[_0xdee6('0x4c')]]){var _0x56e8d8=_[_0xdee6('0x7c')](this[_0xdee6('0xf')][_0x22a1ba[_0xdee6('0x4c')]]);_0x56e8d8[_0xdee6('0x7d')]=![];_0x56e8d8[_0xdee6('0x7e')]=null;_0x56e8d8['holdtime']=_0x22a1ba[_0xdee6('0x7f')];_0x56e8d8['originalposition']=_0x22a1ba[_0xdee6('0x80')];_0x56e8d8[_0xdee6('0x21')]=!![];_0x56e8d8[_0xdee6('0x81')]=moment()[_0xdee6('0x4d')](_0xdee6('0x74'));_0x56e8d8[_0xdee6('0x52')]='ABANDONED';_0x56e8d8['lastAssignedTo']=null;logger['info'](_0xdee6('0x82'),_0x56e8d8[_0xdee6('0x4f')],_0x56e8d8['type']);this[_0xdee6('0x12')][_0x22a1ba['uniqueid']]=_0x56e8d8;this[_0xdee6('0x46')](_0x56e8d8,_0xdee6('0x21'));}}}catch(_0x22753b){logger[_0xdee6('0x40')](_0xdee6('0x7b'),_0x22a1ba[_0xdee6('0x4c')],util['inspect'](_0x22753b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xdee6('0xa')][_0xdee6('0x83')]=function(_0x38ec94){try{if(this[_0xdee6('0x59')](_0x38ec94)){logger[_0xdee6('0x4a')]('[%s][voiceQueueReport][queuecallerleave]',_0x38ec94[_0xdee6('0x4c')],util[_0xdee6('0x42')](_0x38ec94,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x38ec94[_0xdee6('0x4c')]]){var _0x304d7f=_[_0xdee6('0x7c')](this[_0xdee6('0xf')][_0x38ec94[_0xdee6('0x4c')]]);_0x304d7f['queuecallerleaveAt']=moment()[_0xdee6('0x4d')](_0xdee6('0x74'));_0x304d7f[_0xdee6('0x84')]=_0x38ec94[_0xdee6('0x84')];_0x304d7f[_0xdee6('0x85')]=_0x38ec94[_0xdee6('0x85')];logger[_0xdee6('0x6e')](_0xdee6('0x86'),_0x304d7f[_0xdee6('0x4f')],_0x304d7f[_0xdee6('0x54')],_0x38ec94['connectedlinenum'],_0x38ec94[_0xdee6('0x85')]);this[_0xdee6('0x12')][_0x38ec94[_0xdee6('0x4c')]]=_0x304d7f;this[_0xdee6('0x49')](_0x304d7f,_0xdee6('0x23'));}}}catch(_0x219a34){logger[_0xdee6('0x40')](_0xdee6('0x87'),_0x38ec94[_0xdee6('0x4c')],util[_0xdee6('0x42')](_0x219a34,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xdee6('0xa')]['syncAgentConnect']=function(_0x531b36){try{if(this[_0xdee6('0x59')](_0x531b36)){logger['debug'](_0xdee6('0x88'),_0x531b36[_0xdee6('0x4c')],util[_0xdee6('0x42')](_0x531b36,{'showHidden':![],'depth':null}));if(this[_0xdee6('0xf')][_0x531b36[_0xdee6('0x4c')]]){var _0x505fc6=_[_0xdee6('0x7c')](this[_0xdee6('0xf')][_0x531b36[_0xdee6('0x4c')]]);_0x505fc6[_0xdee6('0x7d')]=!![];_0x505fc6[_0xdee6('0x52')]='COMPLETEDBYAGENT';logger[_0xdee6('0x6e')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x505fc6[_0xdee6('0x4f')],_0x505fc6['type']);}}}catch(_0x79b4f9){logger[_0xdee6('0x40')](_0xdee6('0x88'),_0x531b36[_0xdee6('0x4c')],util[_0xdee6('0x42')](_0x79b4f9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xdee6('0xa')]['syncAgentComplete']=function(_0x5ca0dd){try{if(this[_0xdee6('0x59')](_0x5ca0dd)){logger['debug'](_0xdee6('0x89'),_0x5ca0dd[_0xdee6('0x4c')],util[_0xdee6('0x42')](_0x5ca0dd,{'showHidden':![],'depth':null}));if(this[_0xdee6('0xf')][_0x5ca0dd[_0xdee6('0x4c')]]){var _0x15d2be=_['last'](this[_0xdee6('0xf')][_0x5ca0dd[_0xdee6('0x4c')]]);_0x15d2be[_0xdee6('0x21')]=![];_0x15d2be['queuecallerabandonAt']=null;_0x15d2be[_0xdee6('0x8a')]=!![];_0x15d2be[_0xdee6('0x8b')]=_0x5ca0dd[_0xdee6('0x8c')];_0x15d2be[_0xdee6('0x7f')]=_0x5ca0dd[_0xdee6('0x7f')];_0x15d2be['queuecallercomplete']=!![];_0x15d2be[_0xdee6('0x8d')]=![];_0x15d2be['queuecallerexitAt']=null;if(!_0x15d2be[_0xdee6('0x8e')]){if(_0x5ca0dd[_0xdee6('0x8f')]=='transfer'){_0x15d2be[_0xdee6('0x52')]=_0xdee6('0x90');logger[_0xdee6('0x6e')](_0xdee6('0x91'),_0x15d2be[_0xdee6('0x4f')],_0x15d2be['type']);}else{if(_['startsWith'](_0x5ca0dd[_0xdee6('0x3c')][_0xdee6('0x92')](),_0xdee6('0x93'))){if(this[_0xdee6('0xf')][_0x5ca0dd['linkedid']]){var _0x1fa763=_[_0xdee6('0x7c')](this[_0xdee6('0xf')][_0x5ca0dd[_0xdee6('0x94')]]);_0x1fa763[_0xdee6('0x7d')]=![];_0x1fa763[_0xdee6('0x8d')]=!![];_0x1fa763['queuecallerexitAt']=moment(_0x15d2be[_0xdee6('0x73')])[_0xdee6('0x95')](_0x5ca0dd[_0xdee6('0x7f')],_0xdee6('0x96'))[_0xdee6('0x4d')](_0xdee6('0x74'));_0x1fa763['queuecallerexitreason']=_0xdee6('0x97');_0x1fa763[_0xdee6('0x8e')]=!![];_0x1fa763[_0xdee6('0x98')]='FORWARD';_0x1fa763['transferexten']=_0x5ca0dd[_0xdee6('0x99')];_0x1fa763[_0xdee6('0x9a')]=_0x5ca0dd[_0xdee6('0x4c')];logger[_0xdee6('0x6e')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x1fa763[_0xdee6('0x4f')],_0x1fa763[_0xdee6('0x54')]);var _0x457a4a=this[_0xdee6('0xf')][_0x5ca0dd[_0xdee6('0x94')]];this[_0xdee6('0xf')][_0x5ca0dd[_0xdee6('0x94')]]=this['queueReports'][_0x5ca0dd[_0xdee6('0x4c')]];this[_0xdee6('0xf')][_0x5ca0dd['uniqueid']]=_0x457a4a;}}else{_0x15d2be[_0xdee6('0x52')]=_0xdee6('0x9b')+_0x5ca0dd[_0xdee6('0x8f')][_0xdee6('0x9c')]();logger[_0xdee6('0x6e')](_0xdee6('0x9d'),_0x15d2be['queue'],_0x15d2be[_0xdee6('0x54')],_0x15d2be[_0xdee6('0x52')]);}}}this[_0xdee6('0x12')][_0x5ca0dd[_0xdee6('0x4c')]]=_0x15d2be;this[_0xdee6('0x46')](_0x15d2be,_0xdee6('0x9e'));}}}catch(_0x4247ce){logger[_0xdee6('0x40')](_0xdee6('0x89'),_0x5ca0dd['uniqueid'],util[_0xdee6('0x42')](_0x4247ce,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xdee6('0x28')]=function(_0x57afdf){try{if(this[_0xdee6('0x59')](_0x57afdf)){logger['debug'](_0xdee6('0x9f'),_0x57afdf[_0xdee6('0x4c')],util[_0xdee6('0x42')](_0x57afdf,{'showHidden':![],'depth':null}));this[_0xdee6('0xa0')](_0x57afdf[_0xdee6('0x4c')],_[_0xdee6('0x7a')](_0x57afdf['variable'])[0x0],_0x57afdf[_0xdee6('0xa1')]);if(this[_0xdee6('0xf')][_0x57afdf[_0xdee6('0x4c')]]){var _0x1cbe4d=_['last'](this[_0xdee6('0xf')][_0x57afdf[_0xdee6('0x4c')]]);if(_0x1cbe4d){if(this[_0xdee6('0x59')](_0x57afdf['variable'])&&this['isNotNull'](_0x57afdf['variable']['queuestatus'])){switch(_0x57afdf[_0xdee6('0xa1')]){case'CONTINUE':_0x1cbe4d['queuecallerexit']=![];_0x1cbe4d[_0xdee6('0xa2')]=null;break;case _0xdee6('0xa3'):_0x1cbe4d[_0xdee6('0xa4')]='timeout';_0x1cbe4d[_0xdee6('0x8d')]=!![];_0x1cbe4d['queuecallerexitAt']=moment()[_0xdee6('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x1cbe4d['queuecallerleaveAt']=moment()[_0xdee6('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0xdee6('0x4a')](_0xdee6('0xa5'),_0x57afdf[_0xdee6('0x4c')],util[_0xdee6('0x42')](_0x1cbe4d,{'showHidden':![],'depth':null}));ami[_0xdee6('0x48')](_0xdee6('0xa6'),_0x1cbe4d);break;default:_0x1cbe4d[_0xdee6('0x8d')]=!![];_0x1cbe4d[_0xdee6('0xa2')]=moment()[_0xdee6('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x1cbe4d['queuecallerleaveAt']=moment()['format'](_0xdee6('0x74'));}_0x1cbe4d['queuecallerabandon']=![];_0x1cbe4d[_0xdee6('0x81')]=null;_0x1cbe4d[_0xdee6('0x52')]=_0x57afdf[_0xdee6('0xa1')];this[_0xdee6('0x12')][_0x57afdf[_0xdee6('0x4c')]]=_0x1cbe4d;this[_0xdee6('0x46')](_0x1cbe4d,_0xdee6('0x27'));}else if(this['isNotNull'](_0x57afdf['variable'])&&this[_0xdee6('0x59')](_0x57afdf[_0xdee6('0xa7')][_0xdee6('0xa8')])){if(!_0x1cbe4d[_0xdee6('0x21')]){_0x1cbe4d['queuecallerexit']=!![];_0x1cbe4d[_0xdee6('0xa2')]=moment()[_0xdee6('0x4d')](_0xdee6('0x74'));_0x1cbe4d['queuecallerexitreason']=_0xdee6('0xa9');_0x1cbe4d[_0xdee6('0xaa')]=moment()[_0xdee6('0x4d')](_0xdee6('0x74'));this[_0xdee6('0x12')][_0x57afdf[_0xdee6('0x4c')]]=_0x1cbe4d;}}logger[_0xdee6('0x6e')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x57afdf['uniqueid'],_0x1cbe4d['queue'],_0x1cbe4d[_0xdee6('0x54')],_['keys'](_0x57afdf[_0xdee6('0xa7')])[0x0],_0x57afdf[_0xdee6('0xa1')]);_0x1cbe4d[_0xdee6('0x16')]=this[_0xdee6('0x16')][_0x57afdf[_0xdee6('0x4c')]];}}}}catch(_0x27061b){logger[_0xdee6('0x40')]('[%s][voiceQueueReport][varset]',_0x57afdf[_0xdee6('0x4c')],util[_0xdee6('0x42')](_0x27061b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xdee6('0xa')]['addVariable']=function(_0x5b5b4d,_0x333f28,_0xf653f6){var _0x474f50=['rtpaudioqos',_0xdee6('0xab'),_0xdee6('0xac'),'rtpaudioqosjitterbridged',_0xdee6('0xad'),_0xdee6('0xae'),_0xdee6('0xaf'),_0xdee6('0xb0'),_0xdee6('0xb1'),'sipuri',_0xdee6('0xb2'),_0xdee6('0xb3'),_0xdee6('0xb4'),_0xdee6('0xb5'),'memberinterface',_0xdee6('0xb6'),_0xdee6('0x8c'),'memberpenalty','memberrealtime'];if(!_[_0xdee6('0x3a')](_0x333f28)&&!_[_0xdee6('0xb7')](_0x474f50,_0x333f28)){if(_['isUndefined'](this[_0xdee6('0x16')][_0x5b5b4d])){this[_0xdee6('0x16')][_0x5b5b4d]={};}this['variables'][_0x5b5b4d][_0x333f28]=_0xf653f6;}};VoiceQueueReport['prototype']['handleHangup']=function(_0x5a7ce0,_0x2ef2ad,_0x4cb5b2){var _0x6806ab={};for(var _0xbfd846=0x0;_0xbfd846=0x0?moment(_0x20eab2[_0xc642('0x17')])[_0xc642('0xb')](_0x20eab2[_0xc642('0x16')],_0xc642('0xc')):null,'data1':'outbound','data2':_0x20eab2[_0xc642('0x10')],'data3':_0x20eab2[_0xc642('0xe')],'data4':_0x20eab2[_0xc642('0x18')]||null,'role':_0xc642('0x19'),'internal':_0x20eab2[_0xc642('0x10')]?_['toNumber'](_0x20eab2[_0xc642('0x10')]):undefined,'uniqueid':_0x20eab2[_0xc642('0x1a')]},'log':_0xc642('0x12')});}; \ No newline at end of file +var _0x9493=['seconds','inbound','queue','agent','accountcode','uniqueid','voiceDialReport','voice','membername','starttime','endtime','outbound','exten','dialstring','toNumber','lodash','util','../client','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','lastAssignedTo','isNil','interface','format','TALKING','queuecallerleaveAt','diff'];(function(_0xcb60ea,_0x1c6563){var _0x5035f4=function(_0x34ae6c){while(--_0x34ae6c){_0xcb60ea['push'](_0xcb60ea['shift']());}};_0x5035f4(++_0x1c6563);}(_0x9493,0x83));var _0x3949=function(_0x1a1c22,_0x266d72){_0x1a1c22=_0x1a1c22-0x0;var _0x5be771=_0x9493[_0x1a1c22];return _0x5be771;};'use strict';var moment=require('moment');var _=require(_0x3949('0x0'));var util=require(_0x3949('0x1'));var client=require(_0x3949('0x2'));exports['voiceQueueReport']=function(_0x20e46f){var _0x28bc1b=_0x20e46f[_0x3949('0x3')]||_0x20e46f[_0x3949('0x4')];return client[_0x3949('0x5')](_0x3949('0x6'),{'body':{'channel':'voice','membername':_0x20e46f[_0x3949('0x7')],'interface':_[_0x3949('0x8')](_0x20e46f[_0x3949('0x9')])?util[_0x3949('0xa')]('SIP/%s',_0x20e46f['lastAssignedTo']):_0x20e46f[_0x3949('0x9')],'type':_0x3949('0xb'),'enterAt':_0x20e46f[_0x3949('0xc')],'exitAt':_0x28bc1b,'duration':moment(_0x28bc1b)[_0x3949('0xd')](_0x20e46f[_0x3949('0xc')],_0x3949('0xe')),'data1':_0x3949('0xf'),'data2':_0x20e46f['calleridnum'],'data3':_0x20e46f['exten'],'data4':null,'data5':_0x20e46f[_0x3949('0x10')],'role':_0x3949('0x11'),'internal':_0x20e46f[_0x3949('0x12')]?_['toNumber'](_0x20e46f['accountcode']):undefined,'uniqueid':_0x20e46f[_0x3949('0x13')]},'log':_0x3949('0x6')});};exports[_0x3949('0x14')]=function(_0x558d8a){return client[_0x3949('0x5')]('CreateMemberReport',{'body':{'channel':_0x3949('0x15'),'membername':_0x558d8a[_0x3949('0x16')],'interface':_0x558d8a['interface'],'type':'TALKING','enterAt':_0x558d8a[_0x3949('0x17')],'exitAt':_0x558d8a[_0x3949('0x18')],'duration':moment(_0x558d8a['endtime'])['diff'](_0x558d8a[_0x3949('0x17')],_0x3949('0xe'))>=0x0?moment(_0x558d8a[_0x3949('0x18')])[_0x3949('0xd')](_0x558d8a['starttime'],_0x3949('0xe')):null,'data1':_0x3949('0x19'),'data2':_0x558d8a[_0x3949('0x12')],'data3':_0x558d8a[_0x3949('0x1a')],'data4':_0x558d8a[_0x3949('0x1b')]||null,'role':'agent','internal':_0x558d8a[_0x3949('0x12')]?_[_0x3949('0x1c')](_0x558d8a[_0x3949('0x12')]):undefined,'uniqueid':_0x558d8a[_0x3949('0x13')]},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 59cb7a3..bf9bd4f 100644 --- a/server/services/ami/rpc/setting.js +++ b/server/services/ami/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3c2c=['ShowSetting','GetSettings','../client','getSettings','Request'];(function(_0x4c7e33,_0x2418c9){var _0x16e9be=function(_0x36a565){while(--_0x36a565){_0x4c7e33['push'](_0x4c7e33['shift']());}};_0x16e9be(++_0x2418c9);}(_0x3c2c,0x160));var _0xc3c2=function(_0x594f24,_0x21b6a8){_0x594f24=_0x594f24-0x0;var _0x5ee7fa=_0x3c2c[_0x594f24];return _0x5ee7fa;};'use strict';var client=require(_0xc3c2('0x0'));exports[_0xc3c2('0x1')]=function(){return client[_0xc3c2('0x2')](_0xc3c2('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer','previewRecallmeReminderInterval']},'log':_0xc3c2('0x4')});}; \ No newline at end of file +var _0x4f7b=['../client','getSettings','Request','ShowSetting','previewRecallmeReminderInterval','GetSettings'];(function(_0x2f2c39,_0x1c55bb){var _0x2be4db=function(_0x278ee0){while(--_0x278ee0){_0x2f2c39['push'](_0x2f2c39['shift']());}};_0x2be4db(++_0x1c55bb);}(_0x4f7b,0x13e));var _0xb4f7=function(_0x2d0a00,_0x4ad35a){_0x2d0a00=_0x2d0a00-0x0;var _0x11e0da=_0x4f7b[_0x2d0a00];return _0x11e0da;};'use strict';var client=require(_0xb4f7('0x0'));exports[_0xb4f7('0x1')]=function(){return client[_0xb4f7('0x2')](_0xb4f7('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0xb4f7('0x4')]},'log':_0xb4f7('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index c9fbcb1..13639a9 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 _0x0bb9=['GetTemplate','name','../client'];(function(_0x3794e7,_0x512341){var _0x3f09ab=function(_0x31c812){while(--_0x31c812){_0x3794e7['push'](_0x3794e7['shift']());}};_0x3f09ab(++_0x512341);}(_0x0bb9,0xd4));var _0x90bb=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x0bb9[_0x16d10f];return _0x50c823;};'use strict';var client=require(_0x90bb('0x0'));exports['getTemplates']=function(_0x4027cc){return function(_0x31f5f8){return client['Request'](_0x90bb('0x1'),{'options':{'raw':!![],'attributes':['id',_0x90bb('0x2'),'html']},'log':'GetTemplate'});};}; \ No newline at end of file +var _0xe62d=['GetTemplate','name'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xe62d,0x102));var _0xde62=function(_0x412b2a,_0x11fb8a){_0x412b2a=_0x412b2a-0x0;var _0x5872e3=_0xe62d[_0x412b2a];return _0x5872e3;};'use strict';var client=require('../client');exports['getTemplates']=function(_0xef8675){return function(_0x2b4cad){return client['Request'](_0xde62('0x0'),{'options':{'raw':!![],'attributes':['id',_0xde62('0x1'),'html']},'log':_0xde62('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 54dc3c4..e0190a1 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 _0x076d=['Condition','AllConditions','field','operator','AnyConditions','Action','Actions','action','data1','data3','data4','data5','data6','data7','../client','GetTrigger','status'];(function(_0x331937,_0x2c5627){var _0x58aba2=function(_0x54eb75){while(--_0x54eb75){_0x331937['push'](_0x331937['shift']());}};_0x58aba2(++_0x2c5627);}(_0x076d,0x151));var _0xd076=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x076d[_0x36eaaa];return _0x461349;};'use strict';var client=require(_0xd076('0x0'));exports['getTriggers']=function(_0x57f900){return function(_0x48077a){return client['Request'](_0xd076('0x1'),{'options':{'raw':![],'attributes':['id','name','channel',_0xd076('0x2')],'include':[{'model':_0xd076('0x3'),'as':_0xd076('0x4'),'attributes':['id',_0xd076('0x5'),_0xd076('0x6'),'value']},{'model':'Condition','as':_0xd076('0x7'),'attributes':['id',_0xd076('0x5'),_0xd076('0x6'),'value']},{'model':_0xd076('0x8'),'as':_0xd076('0x9'),'attributes':['id',_0xd076('0xa'),_0xd076('0xb'),'data2',_0xd076('0xc'),_0xd076('0xd'),_0xd076('0xe'),_0xd076('0xf'),_0xd076('0x10')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0xabf5=['value','Action','action','data1','data2','data4','data6','data7','getTriggers','Request','GetTrigger','name','channel','status','Condition','AllConditions','field','operator','AnyConditions'];(function(_0x1d7791,_0x2a291f){var _0x2293f8=function(_0x464734){while(--_0x464734){_0x1d7791['push'](_0x1d7791['shift']());}};_0x2293f8(++_0x2a291f);}(_0xabf5,0xff));var _0x5abf=function(_0x108fe3,_0x4b09ed){_0x108fe3=_0x108fe3-0x0;var _0xbd42fc=_0xabf5[_0x108fe3];return _0xbd42fc;};'use strict';var client=require('../client');exports[_0x5abf('0x0')]=function(_0x1f3072){return function(_0x2f9d19){return client[_0x5abf('0x1')](_0x5abf('0x2'),{'options':{'raw':![],'attributes':['id',_0x5abf('0x3'),_0x5abf('0x4'),_0x5abf('0x5')],'include':[{'model':_0x5abf('0x6'),'as':_0x5abf('0x7'),'attributes':['id',_0x5abf('0x8'),_0x5abf('0x9'),'value']},{'model':'Condition','as':_0x5abf('0xa'),'attributes':['id',_0x5abf('0x8'),_0x5abf('0x9'),_0x5abf('0xb')]},{'model':_0x5abf('0xc'),'as':'Actions','attributes':['id',_0x5abf('0xd'),_0x5abf('0xe'),_0x5abf('0xf'),'data3',_0x5abf('0x10'),'data5',_0x5abf('0x11'),_0x5abf('0x12')]}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 38ca00f..ef9889e 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 _0xcdc2=['Request','name','registry','defaultuser','../client'];(function(_0x3bf927,_0x4ecc6d){var _0x4f0b31=function(_0x4d287a){while(--_0x4d287a){_0x3bf927['push'](_0x3bf927['shift']());}};_0x4f0b31(++_0x4ecc6d);}(_0xcdc2,0xae));var _0x2cdc=function(_0x10ef78,_0x54ea7c){_0x10ef78=_0x10ef78-0x0;var _0x57fdb7=_0xcdc2[_0x10ef78];return _0x57fdb7;};'use strict';var client=require(_0x2cdc('0x0'));exports['getTrunks']=function(_0x330c93){return function(_0x5c4d62){return client[_0x2cdc('0x1')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x2cdc('0x2'),_0x2cdc('0x3'),_0x2cdc('0x4')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0xd1a6=['registry','defaultuser','getTrunks','Request','GetTrunk','name'];(function(_0x543b43,_0x38e9be){var _0x31a539=function(_0x596038){while(--_0x596038){_0x543b43['push'](_0x543b43['shift']());}};_0x31a539(++_0x38e9be);}(_0xd1a6,0x176));var _0x6d1a=function(_0x1399d6,_0x2c1661){_0x1399d6=_0x1399d6-0x0;var _0x4a9db4=_0xd1a6[_0x1399d6];return _0x4a9db4;};'use strict';var client=require('../client');exports[_0x6d1a('0x0')]=function(_0x4065d5){return function(_0x5a604d){return client[_0x6d1a('0x1')](_0x6d1a('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x6d1a('0x3'),_0x6d1a('0x4'),_0x6d1a('0x5')]},'log':_0x6d1a('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 551383a..dc3854f 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x272b74,_0x2309f3){var _0x55b834=function(_0x3b8d81){while(--_0x3b8d81){_0x272b74['push'](_0x272b74['shift']());}};_0x55b834(++_0x2309f3);}(_0x9c44,0x178));var _0x49c4=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x9c44[_0x2b7764];return _0x848dcb;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});}; \ No newline at end of file +var _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x5517e0,_0xc13668){var _0x42fbda=function(_0x465484){while(--_0x465484){_0x5517e0['push'](_0x5517e0['shift']());}};_0x42fbda(++_0xc13668);}(_0xedd9,0xfc));var _0x9edd=function(_0x262226,_0x33abd8){_0x262226=_0x262226-0x0;var _0x1b7f1f=_0xedd9[_0x262226];return _0x1b7f1f;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index c5501e6..048aaac 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 _0x7250=['CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','create','Request'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7250,0x1d1));var _0x0725=function(_0x4c1963,_0x19dee9){_0x4c1963=_0x4c1963-0x0;var _0x5ae217=_0x7250[_0x4c1963];return _0x5ae217;};'use strict';var client=require(_0x0725('0x0'));exports[_0x0725('0x1')]=function(_0x182682){return client[_0x0725('0x2')]('CreateVoiceAgentReport',{'body':_0x182682,'log':_0x0725('0x3')});};exports[_0x0725('0x4')]=function(_0x100db5,_0x11c7e8,_0x480a22){return client[_0x0725('0x2')](_0x0725('0x5'),{'body':_0x100db5,'options':{'where':{'uniqueid':_0x11c7e8,'interface':_0x480a22,'agentcomplete':!![]}},'log':_0x0725('0x5')});}; \ No newline at end of file +var _0x8ae8=['update','UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0x8ae8,0x92));var _0x88ae=function(_0x1f1837,_0x4b304e){_0x1f1837=_0x1f1837-0x0;var _0x25ab57=_0x8ae8[_0x1f1837];return _0x25ab57;};'use strict';var client=require(_0x88ae('0x0'));exports[_0x88ae('0x1')]=function(_0x1bf59e){return client[_0x88ae('0x2')](_0x88ae('0x3'),{'body':_0x1bf59e,'log':'CreateVoiceAgentReport'});};exports[_0x88ae('0x4')]=function(_0x16dd90,_0x39249d,_0x5c0496){return client[_0x88ae('0x2')](_0x88ae('0x5'),{'body':_0x16dd90,'options':{'where':{'uniqueid':_0x39249d,'interface':_0x5c0496,'agentcomplete':!![]}},'log':_0x88ae('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 09b744f..8694745 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 _0x75de=['endOf','day','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','billableseconds','GetVoiceCallReports','lodash','create','Request','merge','calleridnum','context','CreateVoiceCallReport','getVoiceCallReports','GetVoiceCallReport','outbound','startOf'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x75de,0x1e3));var _0xe75d=function(_0x5684da,_0xdd4fca){_0x5684da=_0x5684da-0x0;var _0x349ff9=_0x75de[_0x5684da];return _0x349ff9;};'use strict';var moment=require('moment');var util=require('util');var _=require(_0xe75d('0x0'));var client=require('../client');exports[_0xe75d('0x1')]=function(_0x125a4a){return client[_0xe75d('0x2')]('CreateVoiceCallReport',{'body':_[_0xe75d('0x3')](_0x125a4a,{'source':_0x125a4a[_0xe75d('0x4')],'destinationcontext':_0x125a4a[_0xe75d('0x5')],'callerid':_0x125a4a['callerid'],'amaflags':'DOCUMENTATION'}),'log':_0xe75d('0x6')});};exports[_0xe75d('0x7')]=function(){return function(){return client[_0xe75d('0x2')](_0xe75d('0x8'),{'options':{'where':{'type':[_0xe75d('0x9')],'createdAt':{'$between':[moment()[_0xe75d('0xa')]('day')['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xe75d('0xb')](_0xe75d('0xc'))[_0xe75d('0xd')](_0xe75d('0xe'))]}},'attributes':[_0xe75d('0xf'),_0xe75d('0x10'),'duration',_0xe75d('0x11')]},'log':_0xe75d('0x12')});};}; \ No newline at end of file +var _0x00ce=['type','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','create','Request','CreateVoiceCallReport','merge','calleridnum','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','endOf','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4f5b55,_0x46e927){var _0x73e3a7=function(_0x3d27b3){while(--_0x3d27b3){_0x4f5b55['push'](_0x4f5b55['shift']());}};_0x73e3a7(++_0x46e927);}(_0x00ce,0x16a));var _0xe00c=function(_0x1606d6,_0x41385d){_0x1606d6=_0x1606d6-0x0;var _0x5a251a=_0x00ce[_0x1606d6];return _0x5a251a;};'use strict';var moment=require(_0xe00c('0x0'));var util=require(_0xe00c('0x1'));var _=require('lodash');var client=require('../client');exports[_0xe00c('0x2')]=function(_0x2e76a5){return client[_0xe00c('0x3')](_0xe00c('0x4'),{'body':_[_0xe00c('0x5')](_0x2e76a5,{'source':_0x2e76a5[_0xe00c('0x6')],'destinationcontext':_0x2e76a5['context'],'callerid':_0x2e76a5[_0xe00c('0x7')],'amaflags':_0xe00c('0x8')}),'log':_0xe00c('0x4')});};exports[_0xe00c('0x9')]=function(){return function(){return client[_0xe00c('0x3')](_0xe00c('0xa'),{'options':{'where':{'type':[_0xe00c('0xb')],'createdAt':{'$between':[moment()[_0xe00c('0xc')](_0xe00c('0xd'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xe00c('0xe')](_0xe00c('0xd'))['format'](_0xe00c('0xf'))]}},'attributes':[_0xe00c('0x10'),_0xe00c('0x11'),_0xe00c('0x12'),_0xe00c('0x13')]},'log':_0xe00c('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 694b3f8..46fd6c5 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 _0xb7f4=['create','CreateVoiceDialReport','../client'];(function(_0x431cdb,_0x38eca4){var _0x27d5e5=function(_0x301045){while(--_0x301045){_0x431cdb['push'](_0x431cdb['shift']());}};_0x27d5e5(++_0x38eca4);}(_0xb7f4,0x140));var _0x4b7f=function(_0x54d1b8,_0x27d922){_0x54d1b8=_0x54d1b8-0x0;var _0xa9fe6c=_0xb7f4[_0x54d1b8];return _0xa9fe6c;};'use strict';var client=require(_0x4b7f('0x0'));exports[_0x4b7f('0x1')]=function(_0x4fb1db){return client['Request'](_0x4b7f('0x2'),{'body':_0x4fb1db,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0xa4b9=['create','Request','CreateVoiceDialReport'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0xa4b9,0x1d7));var _0x9a4b=function(_0x43df5b,_0x565961){_0x43df5b=_0x43df5b-0x0;var _0x5d1654=_0xa4b9[_0x43df5b];return _0x5d1654;};'use strict';var client=require('../client');exports[_0x9a4b('0x0')]=function(_0x31fec2){return client[_0x9a4b('0x1')](_0x9a4b('0x2'),{'body':_0x31fec2,'log':'CreateVoiceDialReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index d1b1f0c..967d2a9 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 _0x2bc6=['Request','../client','getVoiceExtensions'];(function(_0x4996d5,_0x123daf){var _0x4793f9=function(_0x30c7ec){while(--_0x30c7ec){_0x4996d5['push'](_0x4996d5['shift']());}};_0x4793f9(++_0x123daf);}(_0x2bc6,0x163));var _0x62bc=function(_0x3e4566,_0x1e02e2){_0x3e4566=_0x3e4566-0x0;var _0x2eb60f=_0x2bc6[_0x3e4566];return _0x2eb60f;};'use strict';var client=require(_0x62bc('0x0'));exports[_0x62bc('0x1')]=function(){return function(){return client[_0x62bc('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id','exten','recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0x79d8=['Request','GetVoiceExtension','recordingFormat','../client','getVoiceExtensions'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x79d8,0x67));var _0x879d=function(_0x242671,_0x3bf569){_0x242671=_0x242671-0x0;var _0x32a4ef=_0x79d8[_0x242671];return _0x32a4ef;};'use strict';var client=require(_0x879d('0x0'));exports[_0x879d('0x1')]=function(){return function(){return client[_0x879d('0x2')](_0x879d('0x3'),{'options':{'raw':!![],'attributes':['id','exten',_0x879d('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x879d('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index dc264fb..961b1a6 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 _0xa2f4=['mandatoryDispositionPause','Interval','Intervals','../client','getVoiceQueues','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','dialActive','dialLimitChannel','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPreviewAutoRecallMe','Trunk','callerid','active','Pause'];(function(_0x48721b,_0x2063b7){var _0x5e2426=function(_0x19b071){while(--_0x19b071){_0x48721b['push'](_0x48721b['shift']());}};_0x5e2426(++_0x2063b7);}(_0xa2f4,0x147));var _0x4a2f=function(_0x27e297,_0x789346){_0x27e297=_0x27e297-0x0;var _0x2c1458=_0xa2f4[_0x27e297];return _0x2c1458;};'use strict';var client=require(_0x4a2f('0x0'));exports[_0x4a2f('0x1')]=function(){return function(){return client['Request'](_0x4a2f('0x2'),{'options':{'raw':![],'attributes':['id',_0x4a2f('0x3'),_0x4a2f('0x4'),_0x4a2f('0x5'),_0x4a2f('0x6'),_0x4a2f('0x7'),'type',_0x4a2f('0x8'),'dialMethod',_0x4a2f('0x9'),'dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage',_0x4a2f('0xa'),'dialOriginateCallerIdName',_0x4a2f('0xb'),_0x4a2f('0xc'),'dialQueueOptions','dialQueueTimeout',_0x4a2f('0xd'),_0x4a2f('0xe'),_0x4a2f('0xf'),_0x4a2f('0x10'),_0x4a2f('0x11'),_0x4a2f('0x12'),_0x4a2f('0x13'),_0x4a2f('0x14'),_0x4a2f('0x15'),'dialGlobalInterval',_0x4a2f('0x16'),_0x4a2f('0x17'),_0x4a2f('0x18'),_0x4a2f('0x19'),'dialAMDGreeting',_0x4a2f('0x1a'),_0x4a2f('0x1b'),_0x4a2f('0x1c'),_0x4a2f('0x1d'),_0x4a2f('0x1e'),_0x4a2f('0x1f'),'dialAMDMaximumWordLength','timeout',_0x4a2f('0x20'),_0x4a2f('0x21'),_0x4a2f('0x22'),'dialAgiAfterHangupAgent',_0x4a2f('0x23'),_0x4a2f('0x24'),_0x4a2f('0x7'),'strategy','dialRandomLastDigitCallerIdNumber',_0x4a2f('0x25'),'dialNoSuchNumberMaxRetry',_0x4a2f('0x26'),'dialDropMaxRetry',_0x4a2f('0x27'),'dialAbandonedMaxRetry',_0x4a2f('0x28'),'dialMachineMaxRetry',_0x4a2f('0x29'),_0x4a2f('0x2a'),_0x4a2f('0x2b'),_0x4a2f('0x2c'),_0x4a2f('0x2d'),'dialPredictiveIntervalMinThreshold',_0x4a2f('0x2e'),'dialPreviewRecallmeReminder'],'include':[{'model':'Trunk','as':_0x4a2f('0x2f'),'attributes':['id',_0x4a2f('0x3'),_0x4a2f('0x30'),_0x4a2f('0x31')]},{'model':_0x4a2f('0x32'),'as':_0x4a2f('0x33'),'attributes':['id',_0x4a2f('0x3')]},{'model':'Trunk','as':'TrunkBackup','attributes':['id','name',_0x4a2f('0x30'),'active']},{'model':'Interval','as':_0x4a2f('0x34'),'attributes':['id',_0x4a2f('0x3')],'include':[{'model':'Interval','as':_0x4a2f('0x35'),'attributes':['id',_0x4a2f('0x3'),'interval']}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0x8546=['dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','TrunkBackup','Interval','interval','../client','Request','name','acw','monitor_format','type','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout'];(function(_0x37ceb2,_0x27a12c){var _0xd7c385=function(_0x81340){while(--_0x81340){_0x37ceb2['push'](_0x37ceb2['shift']());}};_0xd7c385(++_0x27a12c);}(_0x8546,0x6b));var _0x6854=function(_0x37092b,_0x1aac6b){_0x37092b=_0x37092b-0x0;var _0x3d93dd=_0x8546[_0x37092b];return _0x3d93dd;};'use strict';var client=require(_0x6854('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x6854('0x1')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x6854('0x2'),_0x6854('0x3'),'acwTimeout','autopause',_0x6854('0x4'),_0x6854('0x5'),'dialActive','dialMethod',_0x6854('0x6'),_0x6854('0x7'),_0x6854('0x8'),'dialPredictiveOptimization','dialPredictiveOptimizationPercentage',_0x6854('0x9'),_0x6854('0xa'),_0x6854('0xb'),_0x6854('0xc'),_0x6854('0xd'),_0x6854('0xe'),_0x6854('0xf'),_0x6854('0x10'),_0x6854('0x11'),_0x6854('0x12'),_0x6854('0x13'),_0x6854('0x14'),_0x6854('0x15'),_0x6854('0x16'),'dialTimezone',_0x6854('0x17'),_0x6854('0x18'),_0x6854('0x19'),_0x6854('0x1a'),'dialAMDInitialSilence',_0x6854('0x1b'),'dialAMDAfterGreetingSilence',_0x6854('0x1c'),_0x6854('0x1d'),_0x6854('0x1e'),_0x6854('0x1f'),_0x6854('0x20'),_0x6854('0x21'),_0x6854('0x22'),_0x6854('0x23'),_0x6854('0x24'),_0x6854('0x25'),_0x6854('0x26'),_0x6854('0x27'),'dialQueueProject2',_0x6854('0x4'),_0x6854('0x28'),_0x6854('0x29'),_0x6854('0x2a'),_0x6854('0x2b'),_0x6854('0x2c'),_0x6854('0x2d'),'dialDropRetryFrequency','dialAbandonedMaxRetry',_0x6854('0x2e'),_0x6854('0x2f'),_0x6854('0x30'),'dialAgentRejectMaxRetry',_0x6854('0x31'),_0x6854('0x32'),'dialPredictiveIntervalMaxThreshold',_0x6854('0x33'),_0x6854('0x34'),_0x6854('0x35')],'include':[{'model':_0x6854('0x36'),'as':_0x6854('0x36'),'attributes':['id',_0x6854('0x2'),_0x6854('0x37'),_0x6854('0x38')]},{'model':_0x6854('0x39'),'as':'mandatoryDispositionPause','attributes':['id',_0x6854('0x2')]},{'model':_0x6854('0x36'),'as':_0x6854('0x3a'),'attributes':['id',_0x6854('0x2'),'callerid','active']},{'model':_0x6854('0x3b'),'as':_0x6854('0x3b'),'attributes':['id',_0x6854('0x2')],'include':[{'model':_0x6854('0x3b'),'as':'Intervals','attributes':['id',_0x6854('0x2'),_0x6854('0x3c')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index ec88744..2fe63a1 100644 --- a/server/services/ami/rpc/voiceQueueReport.js +++ b/server/services/ami/rpc/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x449062,_0x5cb7d6){var _0x585486=function(_0x34f2b5){while(--_0x34f2b5){_0x449062['push'](_0x449062['shift']());}};_0x585486(++_0x5cb7d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file +var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x1aa498,_0x5a18b1){var _0xe74613=function(_0x2ebc97){while(--_0x2ebc97){_0x1aa498['push'](_0x1aa498['shift']());}};_0xe74613(++_0x5a18b1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 0c87fea..0ae0bc6 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 _0xaef0=['getVoiceQueueRtPauses','Request','../client'];(function(_0x1bdc11,_0x8464d7){var _0xa95df6=function(_0x1a1a7a){while(--_0x1a1a7a){_0x1bdc11['push'](_0x1bdc11['shift']());}};_0xa95df6(++_0x8464d7);}(_0xaef0,0x7a));var _0x0aef=function(_0x19e928,_0x26a0e4){_0x19e928=_0x19e928-0x0;var _0x4e941f=_0xaef0[_0x19e928];return _0x4e941f;};'use strict';var client=require(_0x0aef('0x0'));exports[_0x0aef('0x1')]=function(_0x397598){return function(){return client[_0x0aef('0x2')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x397598,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0x0992=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x2175d3,_0x6feef4){var _0x3c32f9=function(_0x20aaa2){while(--_0x20aaa2){_0x2175d3['push'](_0x2175d3['shift']());}};_0x3c32f9(++_0x6feef4);}(_0x0992,0x1a6));var _0x2099=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0x0992[_0x1a72f3];return _0x57ef47;};'use strict';var client=require(_0x2099('0x0'));exports[_0x2099('0x1')]=function(_0x483c25){return function(){return client[_0x2099('0x2')](_0x2099('0x3'),{'options':{'where':{'VoiceQueueId':_0x483c25,'paused':!![]},'raw':!![]},'log':_0x2099('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 0e18cc9..ecf603e 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x438c40,_0x3fddd6){var _0x4b71a0=function(_0xecb439){while(--_0xecb439){_0x438c40['push'](_0x438c40['shift']());}};_0x4b71a0(++_0x3fddd6);}(_0x7a54,0x106));var _0x47a5=function(_0x554f83,_0x2d4e83){_0x554f83=_0x554f83-0x0;var _0x434248=_0x7a54[_0x554f83];return _0x434248;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x376e9b,_0x4f6f37){var _0x48a9bd=function(_0x4022ee){while(--_0x4022ee){_0x376e9b['push'](_0x376e9b['shift']());}};_0x48a9bd(++_0x4f6f37);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index ae3022f..128d559 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 _0xce53=['transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','../client','transfers','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererlinkedid','transfereecalleridnum','transfereeconnectedlinenum','transfereeaccountcode','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','Request','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum'];(function(_0x1c13c9,_0x14b00f){var _0x7cdb8c=function(_0x178fda){while(--_0x178fda){_0x1c13c9['push'](_0x1c13c9['shift']());}};_0x7cdb8c(++_0x14b00f);}(_0xce53,0x151));var _0x3ce5=function(_0xeeb39e,_0x2a6d4f){_0xeeb39e=_0xeeb39e-0x0;var _0x3ccd03=_0xce53[_0xeeb39e];return _0x3ccd03;};'use strict';var client=require(_0x3ce5('0x0'));exports[_0x3ce5('0x1')]={};exports['blindTransfer']=function(_0x1a78b7){return client['Request'](_0x3ce5('0x2'),{'body':{'result':_0x1a78b7[_0x3ce5('0x3')],'transfererchannel':_0x1a78b7[_0x3ce5('0x4')],'transferercalleridnum':_0x1a78b7[_0x3ce5('0x5')],'transferercalleridname':_0x1a78b7[_0x3ce5('0x6')],'transfererconnectedlinenum':_0x1a78b7[_0x3ce5('0x7')],'transfererconnectedlinename':_0x1a78b7[_0x3ce5('0x8')],'transfereraccountcode':_0x1a78b7[_0x3ce5('0x9')],'transferercontext':_0x1a78b7[_0x3ce5('0xa')],'transfererexten':_0x1a78b7['transfererexten'],'transfererlinkedid':_0x1a78b7[_0x3ce5('0xb')],'transfereechannel':_0x1a78b7['transfereechannel'],'transfereecalleridnum':_0x1a78b7[_0x3ce5('0xc')],'transfereecalleridname':_0x1a78b7['transfereecalleridname'],'transfereeconnectedlinenum':_0x1a78b7[_0x3ce5('0xd')],'transfereeconnectedlinename':_0x1a78b7['transfereeconnectedlinename'],'transfereeaccountcode':_0x1a78b7[_0x3ce5('0xe')],'transfereecontext':_0x1a78b7['transfereecontext'],'transfereeexten':_0x1a78b7[_0x3ce5('0xf')],'transfereelinkedid':_0x1a78b7[_0x3ce5('0x10')],'isexternal':_0x1a78b7[_0x3ce5('0x11')],'context':_0x1a78b7[_0x3ce5('0x12')],'extension':_0x1a78b7[_0x3ce5('0x13')],'type':_0x3ce5('0x14')},'log':'CreateVoiceTransferReport'});};exports[_0x3ce5('0x15')]=function(_0x25f765){return client[_0x3ce5('0x16')](_0x3ce5('0x2'),{'body':{'result':_0x25f765[_0x3ce5('0x3')],'transfererchannel':_0x25f765['origtransfererchannel'],'transferercalleridnum':_0x25f765[_0x3ce5('0x17')],'transferercalleridname':_0x25f765[_0x3ce5('0x18')],'transfererconnectedlinenum':_0x25f765[_0x3ce5('0x19')],'transfererconnectedlinename':_0x25f765[_0x3ce5('0x1a')],'transfereraccountcode':_0x25f765[_0x3ce5('0x1b')],'transferercontext':_0x25f765[_0x3ce5('0x1c')],'transfererexten':_0x25f765[_0x3ce5('0x1d')],'transfererlinkedid':_0x25f765[_0x3ce5('0x1e')],'transfereechannel':_0x25f765['transfertargetchannel'],'transfereecalleridnum':_0x25f765[_0x3ce5('0x1f')],'transfereecalleridname':_0x25f765[_0x3ce5('0x20')],'transfereeconnectedlinenum':_0x25f765[_0x3ce5('0x21')],'transfereeconnectedlinename':_0x25f765[_0x3ce5('0x22')],'transfereeaccountcode':_0x25f765[_0x3ce5('0x23')],'transfereecontext':_0x25f765[_0x3ce5('0x24')],'transfereeexten':_0x25f765[_0x3ce5('0x25')],'transfereelinkedid':_0x25f765[_0x3ce5('0x26')],'isexternal':_0x25f765[_0x3ce5('0x11')],'context':_0x25f765[_0x3ce5('0x27')],'extension':_0x25f765[_0x3ce5('0x28')],'type':'attended'},'log':_0x3ce5('0x2')});}; \ No newline at end of file +var _0x514c=['transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','isexternal','extension','blind','attendedTransfer','result','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','transfererchannel'];(function(_0x5bbfd9,_0x382604){var _0x3e8e4a=function(_0x1a028a){while(--_0x1a028a){_0x5bbfd9['push'](_0x5bbfd9['shift']());}};_0x3e8e4a(++_0x382604);}(_0x514c,0x1d3));var _0xc514=function(_0x5317ff,_0x3bf4c4){_0x5317ff=_0x5317ff-0x0;var _0x405982=_0x514c[_0x5317ff];return _0x405982;};'use strict';var client=require(_0xc514('0x0'));exports[_0xc514('0x1')]={};exports[_0xc514('0x2')]=function(_0x209da3){return client[_0xc514('0x3')](_0xc514('0x4'),{'body':{'result':_0x209da3['result'],'transfererchannel':_0x209da3[_0xc514('0x5')],'transferercalleridnum':_0x209da3[_0xc514('0x6')],'transferercalleridname':_0x209da3[_0xc514('0x7')],'transfererconnectedlinenum':_0x209da3[_0xc514('0x8')],'transfererconnectedlinename':_0x209da3[_0xc514('0x9')],'transfereraccountcode':_0x209da3[_0xc514('0xa')],'transferercontext':_0x209da3[_0xc514('0xb')],'transfererexten':_0x209da3[_0xc514('0xc')],'transfererlinkedid':_0x209da3['transfererlinkedid'],'transfereechannel':_0x209da3['transfereechannel'],'transfereecalleridnum':_0x209da3[_0xc514('0xd')],'transfereecalleridname':_0x209da3[_0xc514('0xe')],'transfereeconnectedlinenum':_0x209da3[_0xc514('0xf')],'transfereeconnectedlinename':_0x209da3[_0xc514('0x10')],'transfereeaccountcode':_0x209da3[_0xc514('0x11')],'transfereecontext':_0x209da3[_0xc514('0x12')],'transfereeexten':_0x209da3[_0xc514('0x13')],'transfereelinkedid':_0x209da3['transfereelinkedid'],'isexternal':_0x209da3[_0xc514('0x14')],'context':_0x209da3['context'],'extension':_0x209da3[_0xc514('0x15')],'type':_0xc514('0x16')},'log':_0xc514('0x4')});};exports[_0xc514('0x17')]=function(_0x40a19f){return client[_0xc514('0x3')](_0xc514('0x4'),{'body':{'result':_0x40a19f[_0xc514('0x18')],'transfererchannel':_0x40a19f['origtransfererchannel'],'transferercalleridnum':_0x40a19f['origtransferercalleridnum'],'transferercalleridname':_0x40a19f[_0xc514('0x19')],'transfererconnectedlinenum':_0x40a19f[_0xc514('0x1a')],'transfererconnectedlinename':_0x40a19f[_0xc514('0x1b')],'transfereraccountcode':_0x40a19f[_0xc514('0x1c')],'transferercontext':_0x40a19f[_0xc514('0x1d')],'transfererexten':_0x40a19f['secondtransfererexten'],'transfererlinkedid':_0x40a19f[_0xc514('0x1e')],'transfereechannel':_0x40a19f[_0xc514('0x1f')],'transfereecalleridnum':_0x40a19f[_0xc514('0x20')],'transfereecalleridname':_0x40a19f[_0xc514('0x21')],'transfereeconnectedlinenum':_0x40a19f[_0xc514('0x22')],'transfereeconnectedlinename':_0x40a19f[_0xc514('0x23')],'transfereeaccountcode':_0x40a19f[_0xc514('0x24')],'transfereecontext':_0x40a19f[_0xc514('0x25')],'transfereeexten':_0x40a19f[_0xc514('0x26')],'transfereelinkedid':_0x40a19f[_0xc514('0x27')],'isexternal':_0x40a19f['isexternal'],'context':_0x40a19f[_0xc514('0x28')],'extension':_0x40a19f[_0xc514('0x29')],'type':_0xc514('0x2a')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 31dc630..057c1d7 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 _0x8ca9=['keys','reload','module','Reload','Action','then','message','catch','join','action','Command','content','voiceQueues','hasOwnProperty','length','find','omit','undefined','channels','map','uniqueid','channel','%s.%s','wav','MixMonitor','ai(mixmonitorid)','toLowerCase','isNil','monitors','/var/spool/asterisk/monitor/','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','voicechannel','resolve','StopMixMonitor','stop','filename','StopMixMonitor\x20Success','values','queueChannels','type','inbound','outbound','includes','filter','rows','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','context','trunks','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','moment','../../../config/environment','../properties','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','pick'];(function(_0x424ba4,_0x17003f){var _0x5d80e3=function(_0x184601){while(--_0x184601){_0x424ba4['push'](_0x424ba4['shift']());}};_0x5d80e3(++_0x17003f);}(_0x8ca9,0x9c));var _0x98ca=function(_0x8795e6,_0x3ff497){_0x8795e6=_0x8795e6-0x0;var _0x236c3e=_0x8ca9[_0x8795e6];return _0x236c3e;};'use strict';var _=require(_0x98ca('0x0'));var util=require(_0x98ca('0x1'));var jayson=require(_0x98ca('0x2'));var schema=require(_0x98ca('0x3'));var moment=require(_0x98ca('0x4'));var config=require(_0x98ca('0x5'));var properties=require(_0x98ca('0x6'));var ami=require('../ami');var VoiceQueueSummary=require('../model/voiceQueueSummary');exports[_0x98ca('0x7')]=function(_0x5671b9,_0x442519,_0x48415d){return new Promise(function(_0x219619,_0xca4097){var _0x18c349={'QueuePause':function(_0x2852a0){return new Promise(function(_0x323c95){var _0x28a37a=util[_0x98ca('0x8')](_0x98ca('0x9'),_0x98ca('0xa'),_0x2852a0[_0x98ca('0xb')]);if(_0x5671b9[_0x98ca('0xc')]&&_0x5671b9[_0x98ca('0xc')][_0x28a37a]&&_0x5671b9[_0x98ca('0xc')][_0x28a37a][_0x98ca('0xd')]){_0x5671b9[_0x98ca('0xc')][_0x28a37a][_0x98ca('0xe')]();}if(_0x5671b9[_0x98ca('0xf')][_0x28a37a]){_0x5671b9[_0x98ca('0xf')][_0x28a37a]['updateStatusRealtime']({'statePause':_0x2852a0[_0x98ca('0x10')]?!![]:![]});}_0x323c95({'code':0xc8,'message':_0x98ca('0x11')});});},'Reload':function(_0xba3887){var _0x472e13=this;return new Promise(function(_0x5687ab,_0xf78589){if(ami[_0x98ca('0x12')]()==![]){return _0xf78589(_0x472e13[_0x98ca('0x13')](0x1f4,[config[_0x98ca('0x14')]['ip'],config[_0x98ca('0x14')][_0x98ca('0x15')],_0x98ca('0x16')]['join']('\x20')));}_0xba3887=_[_0x98ca('0x17')](_0xba3887,_[_0x98ca('0x18')](properties[_0x98ca('0x19')][_0x98ca('0x1a')]));_0xba3887['action']=_0x98ca('0x1b');return ami[_0x98ca('0x1c')](_0xba3887)[_0x98ca('0x1d')](function(_0x1ce43a){_0x5687ab({'code':0xc8,'message':_0x1ce43a[_0x98ca('0x1e')]});})[_0x98ca('0x1f')](function(_0x28c8a6){_0xf78589(_0x472e13[_0x98ca('0x13')](0x1f5,_0x28c8a6[_0x98ca('0x1e')]));});});},'Command':function(_0x110f9f){var _0x1b2c69=this;return new Promise(function(_0x4806a3,_0x626b37){if(ami['isConnected']()==![]){return _0x626b37(_0x1b2c69[_0x98ca('0x13')](0x1f4,[config[_0x98ca('0x14')]['ip'],config['asterisk']['username'],_0x98ca('0x16')][_0x98ca('0x20')]('\x20')));}_0x110f9f=_[_0x98ca('0x17')](_0x110f9f,'command');_0x110f9f[_0x98ca('0x21')]=_0x98ca('0x22');return ami['Action'](_0x110f9f)[_0x98ca('0x1d')](function(_0x5dc400){_0x4806a3({'code':0xc8,'message':_0x5dc400[_0x98ca('0x23')]});})[_0x98ca('0x1f')](function(_0x430d16){_0x626b37(_0x1b2c69[_0x98ca('0x13')](0x1f5,_0x430d16[_0x98ca('0x1e')]));});});},'VoiceQueues':function(){return new Promise(function(_0xe5091e){var _0x2a59e3=[];for(var _0x50b1a2 in _0x5671b9[_0x98ca('0x24')]){if(_0x5671b9['voiceQueues'][_0x98ca('0x25')](_0x50b1a2)){var _0x1bdb75=_0x5671b9['voiceQueues'][_0x50b1a2];var _0x1f569b=new VoiceQueueSummary(_0x1bdb75);_0x2a59e3['push'](_0x1f569b);}}_0xe5091e({'count':_0x2a59e3[_0x98ca('0x26')],'rows':_0x2a59e3});});},'UpdateVoiceQueue':function(_0x4f48db){return new Promise(function(_0x5bf77d,_0x14bfb4){var _0x540f45=_[_0x98ca('0x27')](_0x5671b9[_0x98ca('0x24')],{'id':parseInt(_0x4f48db['id'])});var _0x13f766=_[_0x98ca('0x28')](_0x4f48db,['id']);if(_0x540f45){for(var _0x3b3e60 in _0x13f766){if(typeof _0x13f766[_0x3b3e60]!==_0x98ca('0x29')&&typeof _0x540f45[_0x3b3e60]!==_0x98ca('0x29')){_0x540f45[_0x3b3e60]=_0x13f766[_0x3b3e60];}}_0x5bf77d(_0x540f45);}else{_0x14bfb4();}});},'VoiceChannels':function(){return new Promise(function(_0x1bf154){var _0x447881=_['values'](_0x5671b9[_0x98ca('0x2a')]);_0x1bf154({'count':_0x447881['length'],'rows':_0x447881});});},'VoiceChannelMixMonitor':function(_0xb873c5){var _0x34b74d=this;return new Promise(function(_0x4d43fd,_0x4aaa89){if(ami[_0x98ca('0x12')]()==![]){return _0x4aaa89(_0x34b74d['error'](0x1f4,[config[_0x98ca('0x14')]['ip'],config['asterisk'][_0x98ca('0x15')],'ami\x20disconnected'][_0x98ca('0x20')]('\x20')));}var _0x341de3=schema(properties['voicechannel'])[_0x98ca('0x3')](_0xb873c5);if(_0x341de3[_0x98ca('0x26')]>0x0){return _0x4aaa89(_0x34b74d['error'](0x1f4,_[_0x98ca('0x2b')](_0x341de3,_0x98ca('0x1e'))['join'](',\x20')));}var _0x1c9c5b=_[_0x98ca('0x27')](_0x5671b9[_0x98ca('0x2a')],{'uniqueid':_0xb873c5[_0x98ca('0x2c')]});if(_0x1c9c5b&&_0x1c9c5b[_0x98ca('0x2d')]){var _0x47b1c1=util[_0x98ca('0x8')](_0x98ca('0x2e'),_0xb873c5['filename']||_0xb873c5[_0x98ca('0x2c')],_0xb873c5[_0x98ca('0x8')]||_0x98ca('0x2f'));return ami['Action']({'action':_0x98ca('0x30'),'channel':_0x1c9c5b[_0x98ca('0x2d')],'file':_0x47b1c1,'options':_0x98ca('0x31')})['then'](function(_0x3a7515){var _0x1910ae=_[_0x98ca('0x27')](_0x1c9c5b['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x47b1c1[_0x98ca('0x32')]()});if(_[_0x98ca('0x33')](_0x1910ae)){_0x1c9c5b[_0x98ca('0x34')]['push']({'filename':_0x98ca('0x35')+_0x47b1c1[_0x98ca('0x32')](),'createdAt':moment()[_0x98ca('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x3a7515[_0x98ca('0x36')],'status':_0x98ca('0x37')});}else{_0x1910ae[_0x98ca('0x36')]=_0x3a7515[_0x98ca('0x36')];_0x1910ae[_0x98ca('0x38')]='rec';}_0x4d43fd({'code':0xc8,'message':[_0xb873c5['uniqueid'],'MixMonitor\x20Success',_0x3a7515[_0x98ca('0x36')]][_0x98ca('0x20')]('\x20'),'mixmonitorid':_0x3a7515[_0x98ca('0x36')]});})[_0x98ca('0x1f')](function(_0x43ba26){_0x4aaa89(_0x34b74d[_0x98ca('0x13')](0x1f5,[_0xb873c5[_0x98ca('0x2c')],_0x43ba26['message']['toLowerCase']()][_0x98ca('0x20')]('\x20')));});}else{return _0x4aaa89(_0x34b74d[_0x98ca('0x13')](0x1f5,_0x98ca('0x39')));}});},'VoiceChannelStopMixMonitor':function(_0x382989){var _0x17fdc7=this;return new Promise(function(_0x535fdc,_0x55161f){if(ami['isConnected']()==![]){return _0x55161f(_0x17fdc7[_0x98ca('0x13')](0x1f4,[config[_0x98ca('0x14')]['ip'],config[_0x98ca('0x14')][_0x98ca('0x15')],'ami\x20disconnected']['join']('\x20')));}var _0x1ac74c=schema(properties[_0x98ca('0x3a')])[_0x98ca('0x3')](_0x382989);if(_0x1ac74c[_0x98ca('0x26')]>0x0){return _0x55161f(_0x17fdc7[_0x98ca('0x13')](0x1f4,_[_0x98ca('0x2b')](_0x1ac74c,_0x98ca('0x1e'))[_0x98ca('0x20')](',\x20')));}var _0x182300=_[_0x98ca('0x27')](_0x5671b9[_0x98ca('0x2a')],{'uniqueid':_0x382989['uniqueid']});if(_0x182300){return Promise[_0x98ca('0x3b')]()[_0x98ca('0x1d')](function(){if(_0x182300[_0x98ca('0x2d')]){return ami[_0x98ca('0x1c')]({'action':_0x98ca('0x3c'),'channel':_0x182300[_0x98ca('0x2d')],'mixmonitorid':_0x382989[_0x98ca('0x36')]})[_0x98ca('0x1f')](function(){});}})[_0x98ca('0x1d')](function(){if(_0x182300['destinationchannel']){return ami[_0x98ca('0x1c')]({'action':_0x98ca('0x3c'),'channel':_0x182300['destinationchannel'],'mixmonitorid':_0x382989[_0x98ca('0x36')]})['catch'](function(){});}})[_0x98ca('0x1d')](function(){var _0x39f4fd=_[_0x98ca('0x27')](_0x182300[_0x98ca('0x34')],{'mixmonitorid':_0x382989[_0x98ca('0x36')]});if(_0x39f4fd){_0x39f4fd[_0x98ca('0x38')]=_0x98ca('0x3d');}})[_0x98ca('0x1d')](function(){var _0x2c7d53=util[_0x98ca('0x8')](_0x98ca('0x2e'),_0x382989[_0x98ca('0x3e')]||_0x382989['uniqueid'],_0x382989[_0x98ca('0x8')]||_0x98ca('0x2f'));var _0x40498f=_[_0x98ca('0x27')](_0x182300['monitors'],{'filename':_0x98ca('0x35')+_0x2c7d53[_0x98ca('0x32')]()});if(_0x40498f){_0x40498f[_0x98ca('0x38')]=_0x98ca('0x3d');}})[_0x98ca('0x1d')](function(){_0x535fdc({'code':0xc8,'message':[_0x382989[_0x98ca('0x2c')],_0x98ca('0x3f')]['join']('\x20')});})['catch'](function(_0x4dc116){_0x55161f(_0x17fdc7[_0x98ca('0x13')](0x1f5,[_0x382989[_0x98ca('0x2c')],_0x4dc116[_0x98ca('0x1e')][_0x98ca('0x32')]()]['join']('\x20')));});}else{return _0x55161f(_0x17fdc7['error'](0x1f5,_0x98ca('0x39')));}});},'VoiceQueuesChannels':function(_0x385785){var _0x13db05=this;return new Promise(function(_0x408266){var _0x46bb13=_[_0x98ca('0x40')](_0x5671b9[_0x98ca('0x41')]);var _0x2e4e16={'count':_0x46bb13[_0x98ca('0x26')],'rows':_0x46bb13};if(_0x385785&&_0x385785[_0x98ca('0x42')]){if(![_0x98ca('0x43'),_0x98ca('0x44')][_0x98ca('0x45')](_0x385785['type'])){return _0xca4097(_0x13db05[_0x98ca('0x13')](0x190,'Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound'));}var _0x27283c=_[_0x98ca('0x46')](_0x46bb13,function(_0x44cd81){return _0x44cd81[_0x98ca('0x42')]===_0x385785[_0x98ca('0x42')];});_0x2e4e16['count']=_0x27283c[_0x98ca('0x26')];_0x2e4e16[_0x98ca('0x47')]=_0x27283c;}_0x408266(_0x2e4e16);});},'VoiceQueuesChannel':function(_0x5e126d){var _0x19473e=this;return new Promise(function(_0x454bd1,_0x3b0fa1){var _0x5ddaae=schema(properties[_0x98ca('0x48')])[_0x98ca('0x3')](_0x5e126d);if(_0x5ddaae['length']>0x0){return _0x3b0fa1(_0x19473e[_0x98ca('0x13')](0x1f4,_[_0x98ca('0x2b')](_0x5ddaae,_0x98ca('0x1e'))[_0x98ca('0x20')](',\x20')));}var _0x42ca9c=_[_0x98ca('0x27')](_0x5671b9[_0x98ca('0x41')],{'uniqueid':_0x5e126d['uniqueid']});if(_0x42ca9c){_0x454bd1(_0x42ca9c);}else{return _0x3b0fa1(_0x19473e[_0x98ca('0x13')](0x1f5,_0x98ca('0x39')));}});},'VoiceQueuesChannelHangup':function(_0x77898e){var _0x47d650=this;return new Promise(function(_0x5039cd,_0xa73c9a){if(ami[_0x98ca('0x12')]()==![]){return _0xa73c9a(_0x47d650[_0x98ca('0x13')](0x1f4,[config[_0x98ca('0x14')]['ip'],config[_0x98ca('0x14')][_0x98ca('0x15')],_0x98ca('0x16')][_0x98ca('0x20')]('\x20')));}var _0x5dc6a4=schema(properties[_0x98ca('0x49')])['validate'](_0x77898e);if(_0x5dc6a4['length']>0x0){return _0xa73c9a(_0x47d650[_0x98ca('0x13')](0x1f4,_[_0x98ca('0x2b')](_0x5dc6a4,_0x98ca('0x1e'))[_0x98ca('0x20')](',\x20')));}var _0x182fcc=_[_0x98ca('0x27')](_0x5671b9['queueChannels'],{'uniqueid':_0x77898e[_0x98ca('0x2c')]});if(_0x182fcc&&_0x182fcc[_0x98ca('0x2d')]){return ami[_0x98ca('0x1c')]({'action':'Hangup','channel':_0x182fcc['channel']})[_0x98ca('0x1d')](function(_0x2143b2){_0x5039cd({'code':0xc8,'message':[_0x77898e[_0x98ca('0x2c')],_0x2143b2[_0x98ca('0x1e')][_0x98ca('0x32')]()][_0x98ca('0x20')]('\x20')});})[_0x98ca('0x1f')](function(_0x2e2fcb){_0xa73c9a(_0x47d650[_0x98ca('0x13')](0x1f5,[_0x77898e[_0x98ca('0x2c')],_0x2e2fcb[_0x98ca('0x1e')][_0x98ca('0x32')]()]['join']('\x20')));});}else{return _0xa73c9a(_0x47d650[_0x98ca('0x13')](0x1f5,_0x98ca('0x39')));}});},'VoiceQueuesChannelRedirect':function(_0x27b93f){var _0x260177=this;return new Promise(function(_0x1082f4,_0x23344b){if(ami[_0x98ca('0x12')]()==![]){return _0x23344b(_0x260177[_0x98ca('0x13')](0x1f4,[config[_0x98ca('0x14')]['ip'],config['asterisk'][_0x98ca('0x15')],_0x98ca('0x16')][_0x98ca('0x20')]('\x20')));}var _0x47b938=schema(properties[_0x98ca('0x4a')])[_0x98ca('0x3')](_0x27b93f);if(_0x47b938[_0x98ca('0x26')]>0x0){return _0x23344b(_0x260177[_0x98ca('0x13')](0x1f4,_[_0x98ca('0x2b')](_0x47b938,'message')[_0x98ca('0x20')](',\x20')));}var _0x37c0f3=_['find'](_0x5671b9[_0x98ca('0x41')],{'uniqueid':_0x27b93f[_0x98ca('0x2c')]});if(_0x37c0f3&&_0x37c0f3[_0x98ca('0x2d')]){return ami[_0x98ca('0x1c')]({'action':_0x98ca('0x4b'),'channel':_0x37c0f3[_0x98ca('0x2d')],'exten':_0x27b93f['exten'],'context':_0x27b93f[_0x98ca('0x4c')]||_0x37c0f3[_0x98ca('0x4c')],'priority':0x1})[_0x98ca('0x1d')](function(_0xdb7eeb){_0x1082f4({'code':0xc8,'message':[_0x27b93f['uniqueid'],_0xdb7eeb[_0x98ca('0x1e')][_0x98ca('0x32')]()]['join']('\x20')});})[_0x98ca('0x1f')](function(_0x2aac12){_0x23344b(_0x260177['error'](0x1f5,[_0x27b93f[_0x98ca('0x2c')],_0x2aac12[_0x98ca('0x1e')][_0x98ca('0x32')]()][_0x98ca('0x20')]('\x20')));});}else{return _0x23344b(_0x260177[_0x98ca('0x13')](0x1f5,_0x98ca('0x39')));}});},'Agents':function(_0x5a6f09){return new Promise(function(_0x1a2c1d){var _0x3e3c25=_[_0x98ca('0x40')](_0x5671b9[_0x98ca('0xf')]);if(_0x5a6f09&&_0x5a6f09['id']){var _0x1f316a=_[_0x98ca('0x27')](_0x3e3c25,function(_0x2ec431){return _0x2ec431['id']===_0x5a6f09['id'];});_0x1a2c1d(_0x1f316a);}else{_0x1a2c1d({'count':_0x3e3c25['length'],'rows':_0x3e3c25});}});},'Telephones':function(){return new Promise(function(_0x248582){var _0x2179ec=_[_0x98ca('0x40')](_0x5671b9['telephones']);_0x248582({'count':_0x2179ec[_0x98ca('0x26')],'rows':_0x2179ec});});},'Trunks':function(){return new Promise(function(_0x39c158){var _0xd7bc2b=_['values'](_0x5671b9[_0x98ca('0x4d')]);_0x39c158({'count':_0xd7bc2b[_0x98ca('0x26')],'rows':_0xd7bc2b});});},'OutboundChannels':function(){return new Promise(function(_0xb9fcaa){var _0x3e1c0f=_[_0x98ca('0x40')](_0x5671b9['outboundChannels']);_0xb9fcaa({'count':_0x3e1c0f['length'],'rows':_0x3e1c0f});});},'Outbound':function(){return new Promise(function(_0x4657d8){_0x4657d8(_0x5671b9['outbound']);});},'Campaigns':function(){return new Promise(function(_0x51134d){var _0x119ef7=_[_0x98ca('0x40')](_0x5671b9[_0x98ca('0x4e')]);_0x51134d({'count':_0x119ef7['length'],'rows':_0x119ef7});});},'VoiceQueuesPreview':function(_0x2e269b){var _0x3d4824=this;return new Promise(function(_0x55c8c3,_0x1279ff){_0x442519[_0x98ca('0x4f')](_0x2e269b['id'])[_0x98ca('0x1d')](function(_0x1c3d14){_0x55c8c3({'code':0xc8,'message':_0x1c3d14[_0x98ca('0x1e')]});})[_0x98ca('0x1f')](function(_0x1362dd){_0x1279ff(_0x3d4824[_0x98ca('0x13')](0x1f4,_0x1362dd[_0x98ca('0x1e')]));});});},'EventManager':function(_0x13114b){var _0x1ab35f=this;return new Promise(function(_0x21b803,_0x3e6b55){if(!_0x13114b[_0x98ca('0x50')]){return _0x3e6b55(_0x1ab35f[_0x98ca('0x13')](0x1f4,_0x98ca('0x51')));}ami[_0x98ca('0x52')](_0x98ca('0x53')+_0x13114b[_0x98ca('0x50')],_0x13114b[_0x98ca('0x1e')]);_0x21b803({'code':0xc8,'message':_0x13114b});});},'FaxAccounts':function(){return new Promise(function(_0x1dc49e){var _0x4b777f=_[_0x98ca('0x40')](_0x5671b9[_0x98ca('0x54')]);_0x1dc49e({'count':_0x4b777f['length'],'rows':_0x4b777f});});},'SendFax':function(_0x34c7b7){var _0x2f139e=this;return new Promise(function(_0x4af4d6,_0x191c14){_0x48415d['send'](_0x34c7b7)[_0x98ca('0x1d')](function(_0x2e6102){_0x4af4d6({'code':0xc8,'message':_0x2e6102[_0x98ca('0x1e')]});})[_0x98ca('0x1f')](function(_0x3b212d){_0x191c14(_0x2f139e['error'](0x1f4,_0x3b212d['message']));});});},'CheckAfterSend':function(_0x2a997d){var _0x3f1057=this;return new Promise(function(_0x36fcd7,_0x2813af){_0x48415d[_0x98ca('0x55')](_0x2a997d)[_0x98ca('0x1d')](function(_0x5e609a){_0x36fcd7({'code':0xc8,'message':_0x5e609a[_0x98ca('0x1e')]});})[_0x98ca('0x1f')](function(_0x4130ac){_0x2813af(_0x3f1057[_0x98ca('0x13')](0x1f4,_0x4130ac[_0x98ca('0x1e')]));});});}};var _0x3ea525=jayson[_0x98ca('0x56')](_0x18c349)[_0x98ca('0x57')]();_0x3ea525['on'](_0x98ca('0x13'),function(_0x192e43){return _0xca4097(_0x192e43);});_0x3ea525[_0x98ca('0x7')](0x232a,_0x98ca('0x58'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x219619(_0x98ca('0x59')+0x232a);});});}; \ No newline at end of file +var _0xa41a=['exten','context','trunks','outboundChannels','run','event','emit','custom:','faxAccounts','send','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','validate','moment','../../../config/environment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','agents','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','reload','action','Reload','Action','then','message','catch','command','Command','content','hasOwnProperty','push','length','find','voiceQueues','omit','undefined','values','channels','uniqueid','%s.%s','wav','MixMonitor','monitors','isNil','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicechannel','map','channel','destinationchannel','StopMixMonitor','stop','filename','StopMixMonitor\x20Success','queueChannels','type','inbound','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup'];(function(_0x4ce1a4,_0x204510){var _0x28510a=function(_0xdf2195){while(--_0xdf2195){_0x4ce1a4['push'](_0x4ce1a4['shift']());}};_0x28510a(++_0x204510);}(_0xa41a,0x6b));var _0xaa41=function(_0x4a2b6d,_0x31b2ef){_0x4a2b6d=_0x4a2b6d-0x0;var _0x2abf3c=_0xa41a[_0x4a2b6d];return _0x2abf3c;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var jayson=require('jayson/promise');var schema=require(_0xaa41('0x2'));var moment=require(_0xaa41('0x3'));var config=require(_0xaa41('0x4'));var properties=require(_0xaa41('0x5'));var ami=require(_0xaa41('0x6'));var VoiceQueueSummary=require(_0xaa41('0x7'));exports[_0xaa41('0x8')]=function(_0x251efa,_0x5dad7c,_0x2122a0){return new Promise(function(_0x1ec9d4,_0x54bc5a){var _0x5b1fff={'QueuePause':function(_0x179545){return new Promise(function(_0x202cce){var _0x588ab4=util[_0xaa41('0x9')](_0xaa41('0xa'),_0xaa41('0xb'),_0x179545[_0xaa41('0xc')]);if(_0x251efa[_0xaa41('0xd')]&&_0x251efa[_0xaa41('0xd')][_0x588ab4]&&_0x251efa[_0xaa41('0xd')][_0x588ab4][_0xaa41('0xe')]){_0x251efa[_0xaa41('0xd')][_0x588ab4]['updateAcw']();}if(_0x251efa[_0xaa41('0xf')][_0x588ab4]){_0x251efa[_0xaa41('0xf')][_0x588ab4]['updateStatusRealtime']({'statePause':_0x179545['pause']?!![]:![]});}_0x202cce({'code':0xc8,'message':_0xaa41('0x10')});});},'Reload':function(_0x518b5b){var _0x19bd69=this;return new Promise(function(_0x12d9e6,_0x2f64bc){if(ami[_0xaa41('0x11')]()==![]){return _0x2f64bc(_0x19bd69[_0xaa41('0x12')](0x1f4,[config['asterisk']['ip'],config[_0xaa41('0x13')][_0xaa41('0x14')],_0xaa41('0x15')][_0xaa41('0x16')]('\x20')));}_0x518b5b=_[_0xaa41('0x17')](_0x518b5b,_[_0xaa41('0x18')](properties[_0xaa41('0x19')]['module']));_0x518b5b[_0xaa41('0x1a')]=_0xaa41('0x1b');return ami[_0xaa41('0x1c')](_0x518b5b)[_0xaa41('0x1d')](function(_0x230a6a){_0x12d9e6({'code':0xc8,'message':_0x230a6a[_0xaa41('0x1e')]});})[_0xaa41('0x1f')](function(_0x46e6d3){_0x2f64bc(_0x19bd69[_0xaa41('0x12')](0x1f5,_0x46e6d3['message']));});});},'Command':function(_0x5cd936){var _0x1f502a=this;return new Promise(function(_0x22de55,_0x35c753){if(ami['isConnected']()==![]){return _0x35c753(_0x1f502a[_0xaa41('0x12')](0x1f4,[config[_0xaa41('0x13')]['ip'],config['asterisk']['username'],_0xaa41('0x15')]['join']('\x20')));}_0x5cd936=_[_0xaa41('0x17')](_0x5cd936,_0xaa41('0x20'));_0x5cd936[_0xaa41('0x1a')]=_0xaa41('0x21');return ami[_0xaa41('0x1c')](_0x5cd936)['then'](function(_0x43c430){_0x22de55({'code':0xc8,'message':_0x43c430[_0xaa41('0x22')]});})[_0xaa41('0x1f')](function(_0x21f596){_0x35c753(_0x1f502a[_0xaa41('0x12')](0x1f5,_0x21f596[_0xaa41('0x1e')]));});});},'VoiceQueues':function(){return new Promise(function(_0x5c3074){var _0x5795f4=[];for(var _0x16aec5 in _0x251efa['voiceQueues']){if(_0x251efa['voiceQueues'][_0xaa41('0x23')](_0x16aec5)){var _0x59707f=_0x251efa['voiceQueues'][_0x16aec5];var _0x2d0ac0=new VoiceQueueSummary(_0x59707f);_0x5795f4[_0xaa41('0x24')](_0x2d0ac0);}}_0x5c3074({'count':_0x5795f4[_0xaa41('0x25')],'rows':_0x5795f4});});},'UpdateVoiceQueue':function(_0x632fd2){return new Promise(function(_0x3f5272,_0xa7269f){var _0x57ef96=_[_0xaa41('0x26')](_0x251efa[_0xaa41('0x27')],{'id':parseInt(_0x632fd2['id'])});var _0x63c18c=_[_0xaa41('0x28')](_0x632fd2,['id']);if(_0x57ef96){for(var _0x1d8c2b in _0x63c18c){if(typeof _0x63c18c[_0x1d8c2b]!==_0xaa41('0x29')&&typeof _0x57ef96[_0x1d8c2b]!==_0xaa41('0x29')){_0x57ef96[_0x1d8c2b]=_0x63c18c[_0x1d8c2b];}}_0x3f5272(_0x57ef96);}else{_0xa7269f();}});},'VoiceChannels':function(){return new Promise(function(_0x104a95){var _0x4b1800=_[_0xaa41('0x2a')](_0x251efa['channels']);_0x104a95({'count':_0x4b1800['length'],'rows':_0x4b1800});});},'VoiceChannelMixMonitor':function(_0x714537){var _0x1176bd=this;return new Promise(function(_0x534a85,_0x392b5d){if(ami[_0xaa41('0x11')]()==![]){return _0x392b5d(_0x1176bd['error'](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0xaa41('0x14')],_0xaa41('0x15')][_0xaa41('0x16')]('\x20')));}var _0x38afc4=schema(properties['voicechannel'])[_0xaa41('0x2')](_0x714537);if(_0x38afc4[_0xaa41('0x25')]>0x0){return _0x392b5d(_0x1176bd[_0xaa41('0x12')](0x1f4,_['map'](_0x38afc4,_0xaa41('0x1e'))[_0xaa41('0x16')](',\x20')));}var _0x321eb7=_['find'](_0x251efa[_0xaa41('0x2b')],{'uniqueid':_0x714537[_0xaa41('0x2c')]});if(_0x321eb7&&_0x321eb7['channel']){var _0x23eb50=util[_0xaa41('0x9')](_0xaa41('0x2d'),_0x714537['filename']||_0x714537[_0xaa41('0x2c')],_0x714537['format']||_0xaa41('0x2e'));return ami[_0xaa41('0x1c')]({'action':_0xaa41('0x2f'),'channel':_0x321eb7['channel'],'file':_0x23eb50,'options':'ai(mixmonitorid)'})['then'](function(_0x2dc05a){var _0x2e785f=_[_0xaa41('0x26')](_0x321eb7[_0xaa41('0x30')],{'filename':'/var/spool/asterisk/monitor/'+_0x23eb50['toLowerCase']()});if(_[_0xaa41('0x31')](_0x2e785f)){_0x321eb7[_0xaa41('0x30')][_0xaa41('0x24')]({'filename':_0xaa41('0x32')+_0x23eb50[_0xaa41('0x33')](),'createdAt':moment()[_0xaa41('0x9')](_0xaa41('0x34')),'mixmonitorid':_0x2dc05a['mixmonitorid'],'status':_0xaa41('0x35')});}else{_0x2e785f[_0xaa41('0x36')]=_0x2dc05a[_0xaa41('0x36')];_0x2e785f[_0xaa41('0x37')]='rec';}_0x534a85({'code':0xc8,'message':[_0x714537['uniqueid'],_0xaa41('0x38'),_0x2dc05a[_0xaa41('0x36')]]['join']('\x20'),'mixmonitorid':_0x2dc05a[_0xaa41('0x36')]});})['catch'](function(_0x9243d9){_0x392b5d(_0x1176bd[_0xaa41('0x12')](0x1f5,[_0x714537[_0xaa41('0x2c')],_0x9243d9[_0xaa41('0x1e')][_0xaa41('0x33')]()][_0xaa41('0x16')]('\x20')));});}else{return _0x392b5d(_0x1176bd[_0xaa41('0x12')](0x1f5,_0xaa41('0x39')));}});},'VoiceChannelStopMixMonitor':function(_0x5d9b22){var _0x236ff4=this;return new Promise(function(_0x2abf39,_0x35c685){if(ami[_0xaa41('0x11')]()==![]){return _0x35c685(_0x236ff4[_0xaa41('0x12')](0x1f4,[config[_0xaa41('0x13')]['ip'],config['asterisk']['username'],_0xaa41('0x15')]['join']('\x20')));}var _0x1ed366=schema(properties[_0xaa41('0x3a')])[_0xaa41('0x2')](_0x5d9b22);if(_0x1ed366[_0xaa41('0x25')]>0x0){return _0x35c685(_0x236ff4[_0xaa41('0x12')](0x1f4,_[_0xaa41('0x3b')](_0x1ed366,_0xaa41('0x1e'))['join'](',\x20')));}var _0x124992=_['find'](_0x251efa['channels'],{'uniqueid':_0x5d9b22[_0xaa41('0x2c')]});if(_0x124992){return Promise['resolve']()['then'](function(){if(_0x124992['channel']){return ami[_0xaa41('0x1c')]({'action':'StopMixMonitor','channel':_0x124992[_0xaa41('0x3c')],'mixmonitorid':_0x5d9b22[_0xaa41('0x36')]})['catch'](function(){});}})['then'](function(){if(_0x124992[_0xaa41('0x3d')]){return ami[_0xaa41('0x1c')]({'action':_0xaa41('0x3e'),'channel':_0x124992[_0xaa41('0x3d')],'mixmonitorid':_0x5d9b22[_0xaa41('0x36')]})[_0xaa41('0x1f')](function(){});}})[_0xaa41('0x1d')](function(){var _0x37bf5d=_[_0xaa41('0x26')](_0x124992['monitors'],{'mixmonitorid':_0x5d9b22[_0xaa41('0x36')]});if(_0x37bf5d){_0x37bf5d[_0xaa41('0x37')]=_0xaa41('0x3f');}})[_0xaa41('0x1d')](function(){var _0x206d86=util[_0xaa41('0x9')]('%s.%s',_0x5d9b22[_0xaa41('0x40')]||_0x5d9b22[_0xaa41('0x2c')],_0x5d9b22[_0xaa41('0x9')]||_0xaa41('0x2e'));var _0x57d1f6=_[_0xaa41('0x26')](_0x124992['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x206d86[_0xaa41('0x33')]()});if(_0x57d1f6){_0x57d1f6[_0xaa41('0x37')]=_0xaa41('0x3f');}})['then'](function(){_0x2abf39({'code':0xc8,'message':[_0x5d9b22[_0xaa41('0x2c')],_0xaa41('0x41')][_0xaa41('0x16')]('\x20')});})['catch'](function(_0x321cc3){_0x35c685(_0x236ff4[_0xaa41('0x12')](0x1f5,[_0x5d9b22[_0xaa41('0x2c')],_0x321cc3[_0xaa41('0x1e')][_0xaa41('0x33')]()][_0xaa41('0x16')]('\x20')));});}else{return _0x35c685(_0x236ff4[_0xaa41('0x12')](0x1f5,_0xaa41('0x39')));}});},'VoiceQueuesChannels':function(_0x4eab60){var _0x9f0a81=this;return new Promise(function(_0x5bef5f){var _0x5ae65e=_[_0xaa41('0x2a')](_0x251efa[_0xaa41('0x42')]);var _0x3fef3e={'count':_0x5ae65e[_0xaa41('0x25')],'rows':_0x5ae65e};if(_0x4eab60&&_0x4eab60[_0xaa41('0x43')]){if(![_0xaa41('0x44'),_0xaa41('0x45')][_0xaa41('0x46')](_0x4eab60['type'])){return _0x54bc5a(_0x9f0a81[_0xaa41('0x12')](0x190,_0xaa41('0x47')));}var _0x1d518f=_['filter'](_0x5ae65e,function(_0x2e0f53){return _0x2e0f53[_0xaa41('0x43')]===_0x4eab60['type'];});_0x3fef3e[_0xaa41('0x48')]=_0x1d518f[_0xaa41('0x25')];_0x3fef3e[_0xaa41('0x49')]=_0x1d518f;}_0x5bef5f(_0x3fef3e);});},'VoiceQueuesChannel':function(_0x4e5a2e){var _0x2cf32c=this;return new Promise(function(_0xc8e626,_0x4e3b13){var _0x49789a=schema(properties[_0xaa41('0x4a')])[_0xaa41('0x2')](_0x4e5a2e);if(_0x49789a[_0xaa41('0x25')]>0x0){return _0x4e3b13(_0x2cf32c['error'](0x1f4,_[_0xaa41('0x3b')](_0x49789a,_0xaa41('0x1e'))[_0xaa41('0x16')](',\x20')));}var _0x32f2b4=_[_0xaa41('0x26')](_0x251efa['queueChannels'],{'uniqueid':_0x4e5a2e[_0xaa41('0x2c')]});if(_0x32f2b4){_0xc8e626(_0x32f2b4);}else{return _0x4e3b13(_0x2cf32c['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x3ba305){var _0x52ae7f=this;return new Promise(function(_0x3621c0,_0xbbf261){if(ami[_0xaa41('0x11')]()==![]){return _0xbbf261(_0x52ae7f['error'](0x1f4,[config[_0xaa41('0x13')]['ip'],config[_0xaa41('0x13')][_0xaa41('0x14')],_0xaa41('0x15')][_0xaa41('0x16')]('\x20')));}var _0x332a3c=schema(properties[_0xaa41('0x4b')])[_0xaa41('0x2')](_0x3ba305);if(_0x332a3c[_0xaa41('0x25')]>0x0){return _0xbbf261(_0x52ae7f['error'](0x1f4,_[_0xaa41('0x3b')](_0x332a3c,_0xaa41('0x1e'))[_0xaa41('0x16')](',\x20')));}var _0x5a5a55=_[_0xaa41('0x26')](_0x251efa[_0xaa41('0x42')],{'uniqueid':_0x3ba305[_0xaa41('0x2c')]});if(_0x5a5a55&&_0x5a5a55[_0xaa41('0x3c')]){return ami[_0xaa41('0x1c')]({'action':_0xaa41('0x4c'),'channel':_0x5a5a55[_0xaa41('0x3c')]})['then'](function(_0x55a85c){_0x3621c0({'code':0xc8,'message':[_0x3ba305['uniqueid'],_0x55a85c['message']['toLowerCase']()]['join']('\x20')});})[_0xaa41('0x1f')](function(_0x50b598){_0xbbf261(_0x52ae7f['error'](0x1f5,[_0x3ba305[_0xaa41('0x2c')],_0x50b598[_0xaa41('0x1e')][_0xaa41('0x33')]()][_0xaa41('0x16')]('\x20')));});}else{return _0xbbf261(_0x52ae7f['error'](0x1f5,_0xaa41('0x39')));}});},'VoiceQueuesChannelRedirect':function(_0x2a8313){var _0x1ddb6c=this;return new Promise(function(_0x46822f,_0xa71432){if(ami[_0xaa41('0x11')]()==![]){return _0xa71432(_0x1ddb6c[_0xaa41('0x12')](0x1f4,[config[_0xaa41('0x13')]['ip'],config[_0xaa41('0x13')]['username'],_0xaa41('0x15')][_0xaa41('0x16')]('\x20')));}var _0x50170f=schema(properties['voicequeuechannelredirect'])['validate'](_0x2a8313);if(_0x50170f[_0xaa41('0x25')]>0x0){return _0xa71432(_0x1ddb6c['error'](0x1f4,_[_0xaa41('0x3b')](_0x50170f,'message')[_0xaa41('0x16')](',\x20')));}var _0x18d18b=_['find'](_0x251efa[_0xaa41('0x42')],{'uniqueid':_0x2a8313[_0xaa41('0x2c')]});if(_0x18d18b&&_0x18d18b[_0xaa41('0x3c')]){return ami[_0xaa41('0x1c')]({'action':'Redirect','channel':_0x18d18b['channel'],'exten':_0x2a8313[_0xaa41('0x4d')],'context':_0x2a8313[_0xaa41('0x4e')]||_0x18d18b['context'],'priority':0x1})['then'](function(_0x2169b8){_0x46822f({'code':0xc8,'message':[_0x2a8313[_0xaa41('0x2c')],_0x2169b8[_0xaa41('0x1e')][_0xaa41('0x33')]()][_0xaa41('0x16')]('\x20')});})['catch'](function(_0x475ceb){_0xa71432(_0x1ddb6c['error'](0x1f5,[_0x2a8313['uniqueid'],_0x475ceb['message'][_0xaa41('0x33')]()][_0xaa41('0x16')]('\x20')));});}else{return _0xa71432(_0x1ddb6c[_0xaa41('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x229297){return new Promise(function(_0x2adf93){var _0x19ed68=_[_0xaa41('0x2a')](_0x251efa[_0xaa41('0xf')]);if(_0x229297&&_0x229297['id']){var _0x3ffbf8=_[_0xaa41('0x26')](_0x19ed68,function(_0x50a53b){return _0x50a53b['id']===_0x229297['id'];});_0x2adf93(_0x3ffbf8);}else{_0x2adf93({'count':_0x19ed68[_0xaa41('0x25')],'rows':_0x19ed68});}});},'Telephones':function(){return new Promise(function(_0x3031e5){var _0x40b47c=_[_0xaa41('0x2a')](_0x251efa['telephones']);_0x3031e5({'count':_0x40b47c[_0xaa41('0x25')],'rows':_0x40b47c});});},'Trunks':function(){return new Promise(function(_0x4c2c99){var _0x194423=_[_0xaa41('0x2a')](_0x251efa[_0xaa41('0x4f')]);_0x4c2c99({'count':_0x194423[_0xaa41('0x25')],'rows':_0x194423});});},'OutboundChannels':function(){return new Promise(function(_0x491cad){var _0xf456c1=_[_0xaa41('0x2a')](_0x251efa[_0xaa41('0x50')]);_0x491cad({'count':_0xf456c1[_0xaa41('0x25')],'rows':_0xf456c1});});},'Outbound':function(){return new Promise(function(_0x59052d){_0x59052d(_0x251efa[_0xaa41('0x45')]);});},'Campaigns':function(){return new Promise(function(_0x50197b){var _0x55d380=_[_0xaa41('0x2a')](_0x251efa['campaigns']);_0x50197b({'count':_0x55d380[_0xaa41('0x25')],'rows':_0x55d380});});},'VoiceQueuesPreview':function(_0x133368){var _0x2ba160=this;return new Promise(function(_0x582d79,_0x1c5df8){_0x5dad7c[_0xaa41('0x51')](_0x133368['id'])[_0xaa41('0x1d')](function(_0x297ec6){_0x582d79({'code':0xc8,'message':_0x297ec6[_0xaa41('0x1e')]});})[_0xaa41('0x1f')](function(_0x25a064){_0x1c5df8(_0x2ba160['error'](0x1f4,_0x25a064[_0xaa41('0x1e')]));});});},'EventManager':function(_0x1b7fee){var _0x198547=this;return new Promise(function(_0x530982,_0x5ec19b){if(!_0x1b7fee[_0xaa41('0x52')]){return _0x5ec19b(_0x198547[_0xaa41('0x12')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0xaa41('0x53')](_0xaa41('0x54')+_0x1b7fee['event'],_0x1b7fee[_0xaa41('0x1e')]);_0x530982({'code':0xc8,'message':_0x1b7fee});});},'FaxAccounts':function(){return new Promise(function(_0x3dd47e){var _0x3e6926=_[_0xaa41('0x2a')](_0x251efa[_0xaa41('0x55')]);_0x3dd47e({'count':_0x3e6926[_0xaa41('0x25')],'rows':_0x3e6926});});},'SendFax':function(_0x9313fd){var _0x1472be=this;return new Promise(function(_0x5c67d1,_0x4d0390){_0x2122a0[_0xaa41('0x56')](_0x9313fd)['then'](function(_0x654594){_0x5c67d1({'code':0xc8,'message':_0x654594[_0xaa41('0x1e')]});})[_0xaa41('0x1f')](function(_0x53d64c){_0x4d0390(_0x1472be[_0xaa41('0x12')](0x1f4,_0x53d64c[_0xaa41('0x1e')]));});});},'CheckAfterSend':function(_0x2d7493){var _0x521f58=this;return new Promise(function(_0x173549,_0x39052b){_0x2122a0['checkAfterSend'](_0x2d7493)[_0xaa41('0x1d')](function(_0x4de25c){_0x173549({'code':0xc8,'message':_0x4de25c['message']});})[_0xaa41('0x1f')](function(_0x34d0e4){_0x39052b(_0x521f58['error'](0x1f4,_0x34d0e4['message']));});});}};var _0x241e1a=jayson[_0xaa41('0x57')](_0x5b1fff)[_0xaa41('0x58')]();_0x241e1a['on'](_0xaa41('0x12'),function(_0x5be2e7){return _0x54bc5a(_0x5be2e7);});_0x241e1a[_0xaa41('0x8')](0x232a,_0xaa41('0x59'),function(){console[_0xaa41('0x5a')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x1ec9d4(_0xaa41('0x5b')+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index baac0fb..fca646f 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 _0x8403=['info','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridnum','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','action','toLowerCase','merge','lodash','bluebird','util','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','defaults','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','map','destcalleridnum','routeId','firstName','lastName','phone','mobile','fax','createdAt','updatedAt','union','resolve','then','getContacts','length'];(function(_0x5a184b,_0x457876){var _0x713964=function(_0x1f6d49){while(--_0x1f6d49){_0x5a184b['push'](_0x5a184b['shift']());}};_0x713964(++_0x457876);}(_0x8403,0xc2));var _0x3840=function(_0x3aeb09,_0x4bee43){_0x3aeb09=_0x3aeb09-0x0;var _0x4e4623=_0x8403[_0x3aeb09];return _0x4e4623;};'use strict';var _=require(_0x3840('0x0'));var BPromise=require(_0x3840('0x1'));var Redis=require('ioredis');var util=require(_0x3840('0x2'));var config=require(_0x3840('0x3'));var logger=require(_0x3840('0x4'))('trigger');var cmContactRpc=require(_0x3840('0x5'));config[_0x3840('0x6')]=_[_0x3840('0x7')](config[_0x3840('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x5a6265,_0x15efc6,_0x2b26e8,_0x63fe0,_0x28a0b1){logger['info'](_0x3840('0x8'),_0x5a6265,_0x15efc6['id'],_0x2b26e8,_0x63fe0,JSON[_0x3840('0x9')](_0x28a0b1));io['to'](_0x2b26e8)[_0x3840('0xa')](_0x63fe0,_0x28a0b1);}exports[_0x3840('0xb')]=function(_0x83081c,_0x126937,_0x346320,_0x2f89ae){var _0x145352,_0x5aea9;var _0x581894={};var _0x2d1ad0;var _0x29ddc8=Number(_0x346320[_0x3840('0xc')]);var _0x4da674=_0x346320[_0x3840('0xd')]?Boolean(Number(_0x346320['data2'])):![];var _0x38f326;var _0x43b209=![];if(!_[_0x3840('0xe')](_0x346320['data5'])){if(_0x346320[_0x3840('0xf')]=='1')_0x43b209=!![];}if(!_0x43b209){if(_0x2f89ae[_0x3840('0x10')]){_0x581894['id']=_0x2f89ae[_0x3840('0x10')];}}if(!_0x581894['id']){_0x581894[_0x3840('0x11')]=_0x29ddc8;_0x38f326=_0x346320[_0x3840('0x12')]&&_0x346320['data3']!=='0'?_0x346320['data3']['split'](','):['phone'];_0x581894['$or']=_[_0x3840('0x13')](_0x38f326,function(_0x2bedd8){var _0x5d408e={};_0x5d408e[_0x2bedd8]=_0x2f89ae['routeId']?_0x2f89ae[_0x3840('0x14')]:_0x2f89ae['calleridnum'];return _0x5d408e;});_0x2d1ad0=_0x2f89ae[_0x3840('0x15')]?_0x2f89ae[_0x3840('0x14')]:_0x2f89ae['calleridnum'];}var _0x74b159=['id',_0x3840('0x16'),_0x3840('0x17'),_0x3840('0x18'),_0x3840('0x19'),_0x3840('0x1a'),_0x3840('0x11'),_0x3840('0x1b'),'scheduledAt',_0x3840('0x1c')];var _0x245856=_[_0x3840('0x1d')](_0x74b159,_0x38f326);BPromise[_0x3840('0x1e')]()[_0x3840('0x1f')](cmContactRpc[_0x3840('0x20')]({'attributes':_0x245856,'where':_0x581894,'phone':_0x2d1ad0}))['then'](function(_0x4a8cae){_0x5aea9=_0x4a8cae;if(!_['isEmpty'](_0x5aea9)){if(_0x5aea9[_0x3840('0x21')]===0x1){_0x145352=_0x5aea9[0x0];logger[_0x3840('0x22')](_0x3840('0x23'),_0x2f89ae[_0x3840('0x24')],_0x126937['id'],_0x145352['id']);}else{logger['info'](_0x3840('0x25'),_0x2f89ae[_0x3840('0x24')],_0x126937['id'],_[_0x3840('0x13')](_0x5aea9,'id')[_0x3840('0x26')](','));}return;}else{logger['info'](_0x3840('0x27'),_0x2f89ae[_0x3840('0x24')],_0x126937['id']);var _0x44a29f={'ListId':_0x29ddc8};var _0x10ce4d=_0x346320[_0x3840('0x28')]&&_0x346320[_0x3840('0x28')]!=='0'?_0x346320[_0x3840('0x28')]:_0x3840('0x18');if(_0x4da674){logger[_0x3840('0x22')](_0x3840('0x29'),_0x2f89ae[_0x3840('0x24')],_0x126937['id']);_0x44a29f[_0x10ce4d]=_[_0x3840('0xe')](_0x2f89ae[_0x3840('0x15')])?_0x2f89ae[_0x3840('0x2a')]:_0x2f89ae[_0x3840('0x14')];if(_[_0x3840('0xe')](_0x2f89ae[_0x3840('0x15')])){_0x44a29f[_0x3840('0x16')]=_0x2f89ae[_0x3840('0x2b')]&&_0x2f89ae['calleridname']!==_0x3840('0x2c')?_0x2f89ae[_0x3840('0x2b')]:_0x3840('0x2d');}else{_0x44a29f[_0x3840('0x16')]=_0x2f89ae[_0x3840('0x2e')]&&_0x2f89ae[_0x3840('0x2e')]!==_0x3840('0x2c')?_0x2f89ae[_0x3840('0x2e')]:_0x3840('0x2d');}return BPromise[_0x3840('0x1e')]()[_0x3840('0x1f')](cmContactRpc[_0x3840('0x2f')](_0x44a29f))[_0x3840('0x1f')](function(_0x15106e){_0x145352=_0x15106e;_0x5aea9[_0x3840('0x30')](_0x15106e);if(_0x145352){logger[_0x3840('0x22')](_0x3840('0x31'),_0x2f89ae['uniqueid'],_0x126937['id'],_0x145352['id']);}return;});}else{logger[_0x3840('0x22')](_0x3840('0x32'),_0x2f89ae[_0x3840('0x24')],_0x126937['id']);_0x44a29f[_0x10ce4d]=_[_0x3840('0xe')](_0x2f89ae[_0x3840('0x15')])?_0x2f89ae[_0x3840('0x2a')]:_0x2f89ae[_0x3840('0x14')];if(_[_0x3840('0xe')](_0x2f89ae[_0x3840('0x15')])){_0x44a29f[_0x3840('0x16')]=_0x2f89ae['calleridname']&&_0x2f89ae['calleridname']!==''?_0x2f89ae['calleridname']:_0x3840('0x2d');}else{_0x44a29f[_0x3840('0x16')]=_0x2f89ae[_0x3840('0x2e')]&&_0x2f89ae[_0x3840('0x2e')]!==''?_0x2f89ae[_0x3840('0x2e')]:_0x3840('0x2d');}_0x145352=_0x44a29f;_0x5aea9[_0x3840('0x30')](_0x44a29f);return;}}})[_0x3840('0x1f')](function(){if(_0x83081c){emit(_0x2f89ae['uniqueid'],_0x126937,util[_0x3840('0x33')](_0x3840('0x34'),_0x83081c[_0x3840('0x35')]),util['format']('trigger:%s',_0x346320[_0x3840('0x36')][_0x3840('0x37')]()),{'evt':_[_0x3840('0x38')](_0x2f89ae,{'autoCreate':_0x4da674}),'contact':_0x145352===undefined?{}:_0x145352,'contacts':_0x5aea9[_0x3840('0x21')]===0x0?undefined:_0x5aea9});}});}; \ No newline at end of file +var _0x3c7e=['[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','uniqueid','data4','calleridnum','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','name','trigger:%s','action','toLowerCase','merge','lodash','bluebird','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','defaults','socket.io-emitter','info','[CM][%s][%s]','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','map','routeId','destcalleridnum','firstName','lastName','fax','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','isEmpty','length'];(function(_0x6b4e85,_0x4d126c){var _0x2e09e6=function(_0x31aa9c){while(--_0x31aa9c){_0x6b4e85['push'](_0x6b4e85['shift']());}};_0x2e09e6(++_0x4d126c);}(_0x3c7e,0xbf));var _0xe3c7=function(_0x70800b,_0x18c90c){_0x70800b=_0x70800b-0x0;var _0x8db856=_0x3c7e[_0x70800b];return _0x8db856;};'use strict';var _=require(_0xe3c7('0x0'));var BPromise=require(_0xe3c7('0x1'));var Redis=require('ioredis');var util=require(_0xe3c7('0x2'));var config=require(_0xe3c7('0x3'));var logger=require(_0xe3c7('0x4'))(_0xe3c7('0x5'));var cmContactRpc=require(_0xe3c7('0x6'));config['redis']=_[_0xe3c7('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xe3c7('0x8'))(new Redis(config['redis']));function emit(_0x3d3130,_0x7eb974,_0x87c2a3,_0x334750,_0x2be508){logger[_0xe3c7('0x9')](_0xe3c7('0xa'),_0x3d3130,_0x7eb974['id'],_0x87c2a3,_0x334750,JSON['stringify'](_0x2be508));io['to'](_0x87c2a3)[_0xe3c7('0xb')](_0x334750,_0x2be508);}exports[_0xe3c7('0xc')]=function(_0x2a2b3d,_0x5e268d,_0x5120b5,_0x2f5d01){var _0x15c14c,_0x5cef6b;var _0x2974e6={};var _0x54c917;var _0x5c3b04=Number(_0x5120b5[_0xe3c7('0xd')]);var _0xee5208=_0x5120b5[_0xe3c7('0xe')]?Boolean(Number(_0x5120b5['data2'])):![];var _0x46787e;var _0x523a8e=![];if(!_[_0xe3c7('0xf')](_0x5120b5[_0xe3c7('0x10')])){if(_0x5120b5[_0xe3c7('0x10')]=='1')_0x523a8e=!![];}if(!_0x523a8e){if(_0x2f5d01[_0xe3c7('0x11')]){_0x2974e6['id']=_0x2f5d01[_0xe3c7('0x11')];}}if(!_0x2974e6['id']){_0x2974e6[_0xe3c7('0x12')]=_0x5c3b04;_0x46787e=_0x5120b5[_0xe3c7('0x13')]&&_0x5120b5[_0xe3c7('0x13')]!=='0'?_0x5120b5[_0xe3c7('0x13')][_0xe3c7('0x14')](','):[_0xe3c7('0x15')];_0x2974e6['$or']=_[_0xe3c7('0x16')](_0x46787e,function(_0x2360b9){var _0x2174d6={};_0x2174d6[_0x2360b9]=_0x2f5d01[_0xe3c7('0x17')]?_0x2f5d01['destcalleridnum']:_0x2f5d01['calleridnum'];return _0x2174d6;});_0x54c917=_0x2f5d01[_0xe3c7('0x17')]?_0x2f5d01[_0xe3c7('0x18')]:_0x2f5d01['calleridnum'];}var _0x234f47=['id',_0xe3c7('0x19'),_0xe3c7('0x1a'),_0xe3c7('0x15'),'mobile',_0xe3c7('0x1b'),_0xe3c7('0x12'),_0xe3c7('0x1c'),_0xe3c7('0x1d'),_0xe3c7('0x1e')];var _0x5d6412=_[_0xe3c7('0x1f')](_0x234f47,_0x46787e);BPromise[_0xe3c7('0x20')]()[_0xe3c7('0x21')](cmContactRpc[_0xe3c7('0x22')]({'attributes':_0x5d6412,'where':_0x2974e6,'phone':_0x54c917}))[_0xe3c7('0x21')](function(_0x18d7d8){_0x5cef6b=_0x18d7d8;if(!_[_0xe3c7('0x23')](_0x5cef6b)){if(_0x5cef6b[_0xe3c7('0x24')]===0x1){_0x15c14c=_0x5cef6b[0x0];logger[_0xe3c7('0x9')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x2f5d01['uniqueid'],_0x5e268d['id'],_0x15c14c['id']);}else{logger[_0xe3c7('0x9')](_0xe3c7('0x25'),_0x2f5d01['uniqueid'],_0x5e268d['id'],_[_0xe3c7('0x16')](_0x5cef6b,'id')[_0xe3c7('0x26')](','));}return;}else{logger[_0xe3c7('0x9')](_0xe3c7('0x27'),_0x2f5d01[_0xe3c7('0x28')],_0x5e268d['id']);var _0x17d934={'ListId':_0x5c3b04};var _0x911586=_0x5120b5[_0xe3c7('0x29')]&&_0x5120b5[_0xe3c7('0x29')]!=='0'?_0x5120b5[_0xe3c7('0x29')]:_0xe3c7('0x15');if(_0xee5208){logger[_0xe3c7('0x9')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x2f5d01[_0xe3c7('0x28')],_0x5e268d['id']);_0x17d934[_0x911586]=_[_0xe3c7('0xf')](_0x2f5d01[_0xe3c7('0x17')])?_0x2f5d01[_0xe3c7('0x2a')]:_0x2f5d01[_0xe3c7('0x18')];if(_[_0xe3c7('0xf')](_0x2f5d01[_0xe3c7('0x17')])){_0x17d934[_0xe3c7('0x19')]=_0x2f5d01[_0xe3c7('0x2b')]&&_0x2f5d01[_0xe3c7('0x2b')]!==_0xe3c7('0x2c')?_0x2f5d01[_0xe3c7('0x2b')]:_0xe3c7('0x2d');}else{_0x17d934[_0xe3c7('0x19')]=_0x2f5d01['destcalleridname']&&_0x2f5d01['destcalleridname']!==_0xe3c7('0x2c')?_0x2f5d01[_0xe3c7('0x2e')]:_0xe3c7('0x2d');}return BPromise['resolve']()['then'](cmContactRpc[_0xe3c7('0x2f')](_0x17d934))[_0xe3c7('0x21')](function(_0x418e05){_0x15c14c=_0x418e05;_0x5cef6b[_0xe3c7('0x30')](_0x418e05);if(_0x15c14c){logger[_0xe3c7('0x9')](_0xe3c7('0x31'),_0x2f5d01[_0xe3c7('0x28')],_0x5e268d['id'],_0x15c14c['id']);}return;});}else{logger[_0xe3c7('0x9')](_0xe3c7('0x32'),_0x2f5d01[_0xe3c7('0x28')],_0x5e268d['id']);_0x17d934[_0x911586]=_['isNil'](_0x2f5d01['routeId'])?_0x2f5d01['calleridnum']:_0x2f5d01[_0xe3c7('0x18')];if(_[_0xe3c7('0xf')](_0x2f5d01[_0xe3c7('0x17')])){_0x17d934[_0xe3c7('0x19')]=_0x2f5d01[_0xe3c7('0x2b')]&&_0x2f5d01[_0xe3c7('0x2b')]!==_0xe3c7('0x2c')?_0x2f5d01[_0xe3c7('0x2b')]:_0xe3c7('0x2d');}else{_0x17d934['firstName']=_0x2f5d01[_0xe3c7('0x2e')]&&_0x2f5d01[_0xe3c7('0x2e')]!==_0xe3c7('0x2c')?_0x2f5d01[_0xe3c7('0x2e')]:_0xe3c7('0x2d');}_0x15c14c=_0x17d934;_0x5cef6b[_0xe3c7('0x30')](_0x17d934);return;}}})['then'](function(){if(_0x2a2b3d){emit(_0x2f5d01[_0xe3c7('0x28')],_0x5e268d,util[_0xe3c7('0x33')]('user:%s',_0x2a2b3d[_0xe3c7('0x34')]),util[_0xe3c7('0x33')](_0xe3c7('0x35'),_0x5120b5[_0xe3c7('0x36')][_0xe3c7('0x37')]()),{'evt':_[_0xe3c7('0x38')](_0x2f5d01,{'autoCreate':_0xee5208}),'contact':_0x15c14c===undefined?{}:_0x15c14c,'contacts':_0x5cef6b[_0xe3c7('0x24')]===0x0?undefined:_0x5cef6b});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 4b65304..bb4ba63 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 _0xa9e2=['length','action','toLowerCase','contactmanager','browser','TemplateId','data2','html','template\x20not\x20found','uri','buildUri','isNil','data3','data4','location','uriLocation','800','windowHeight','data6','600','winapp','winApplication','render','format','user:%s','name','trigger:%s:%s','data1','jscripty','trigger:%s','exec','integration','queue','voiceExtensions','routeId','urlforward','script','parse','query','replace','checkTrigger','AllConditions','every','checkConditions','channel','AnyConditions','some','field','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','membername','lastevent','mailSubstatus','null','substatus','offlineMessage','created','equals','util','lodash','url','mustache','./urlforward','./script','../../../config/logger','trigger','../ami','redis','defaults','popup','triggers','agents','voiceQueues','templates','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','zendeskAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentnoanswer','custom:agentcongestion','custom:agentreject','custom:amd','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','info','stringify','clone','motionChannel','undefined','voice','checkTriggers','interface','hasOwnProperty','merge','variables','Actions'];(function(_0x2862eb,_0x18ee14){var _0x213dad=function(_0x1a9cbf){while(--_0x1a9cbf){_0x2862eb['push'](_0x2862eb['shift']());}};_0x213dad(++_0x18ee14);}(_0xa9e2,0xc0));var _0x2a9e=function(_0x210359,_0x1ef047){_0x210359=_0x210359-0x0;var _0x1b6da7=_0xa9e2[_0x210359];return _0x1b6da7;};'use strict';var util=require(_0x2a9e('0x0'));var _=require(_0x2a9e('0x1'));var url=require(_0x2a9e('0x2'));var Mustache=require(_0x2a9e('0x3'));var Redis=require('ioredis');var urlforward=require(_0x2a9e('0x4'));var integration=require('./integration');var cmContact=require('./cmContact');var script=require(_0x2a9e('0x5'));var config=require('../../../config/environment');var logger=require(_0x2a9e('0x6'))(_0x2a9e('0x7'));var ami=require(_0x2a9e('0x8'));config[_0x2a9e('0x9')]=_[_0x2a9e('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2a9e('0x9')]));var operators={'equals':function(_0x5b5b7f,_0x51bfdc){return _0x5b5b7f==_0x51bfdc;},'not_equals':function(_0x128a6b,_0x866ce6){return _0x128a6b!=_0x866ce6;}};var barAndWebActions=[_0x2a9e('0xb'),_0x2a9e('0x2'),'winapp'];function Trigger(_0x229368){this[_0x2a9e('0xc')]=_0x229368[_0x2a9e('0xc')];this[_0x2a9e('0xd')]=_0x229368[_0x2a9e('0xd')];this[_0x2a9e('0xe')]=_0x229368['voiceQueues'];this[_0x2a9e('0xf')]=_0x229368[_0x2a9e('0xf')];this['voiceExtensions']=_0x229368['voiceExtensions'];this['zendeskAccounts']=_0x229368['zendeskAccounts'];this[_0x2a9e('0x10')]=_0x229368[_0x2a9e('0x10')];this[_0x2a9e('0x11')]=_0x229368[_0x2a9e('0x11')];this[_0x2a9e('0x12')]=_0x229368['sugarcrmAccounts'];this[_0x2a9e('0x13')]=_0x229368[_0x2a9e('0x13')];this['deskAccounts']=_0x229368[_0x2a9e('0x14')];this[_0x2a9e('0x15')]=_0x229368[_0x2a9e('0x15')];this[_0x2a9e('0x16')]=_0x229368[_0x2a9e('0x16')];this[_0x2a9e('0x17')]=_0x229368[_0x2a9e('0x17')];this[_0x2a9e('0x18')]=_0x229368[_0x2a9e('0x18')];this['accounts']={'zendesk':this[_0x2a9e('0x19')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0x2a9e('0x10')],'sugarcrm':this[_0x2a9e('0x12')],'zoho':this[_0x2a9e('0x13')],'desk':this[_0x2a9e('0x14')],'vtiger':this[_0x2a9e('0x15')],'dynamics365':this[_0x2a9e('0x17')],'freshsales':this[_0x2a9e('0x18')],'servicenow':this[_0x2a9e('0x16')]};ami['on'](_0x2a9e('0x1a'),this[_0x2a9e('0x1b')][_0x2a9e('0x1c')](this));ami['on'](_0x2a9e('0x1d'),this[_0x2a9e('0x1b')][_0x2a9e('0x1c')](this));ami['on'](_0x2a9e('0x1e'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentcomplete',this['syncCustomEvent'][_0x2a9e('0x1c')](this));ami['on']('custom:agentnosuchnumber',this[_0x2a9e('0x1b')][_0x2a9e('0x1c')](this));ami['on'](_0x2a9e('0x1f'),this['syncCustomEvent'][_0x2a9e('0x1c')](this));ami['on']('custom:agentbusy',this[_0x2a9e('0x1b')][_0x2a9e('0x1c')](this));ami['on'](_0x2a9e('0x20'),this[_0x2a9e('0x1b')]['bind'](this));ami['on'](_0x2a9e('0x21'),this[_0x2a9e('0x1b')][_0x2a9e('0x1c')](this));ami['on'](_0x2a9e('0x22'),this[_0x2a9e('0x1b')][_0x2a9e('0x1c')](this));ami['on']('custom:queuecallerabandon',this[_0x2a9e('0x1b')][_0x2a9e('0x1c')](this));ami['on'](_0x2a9e('0x23'),this[_0x2a9e('0x1b')][_0x2a9e('0x1c')](this));ami['on'](_0x2a9e('0x24'),this[_0x2a9e('0x25')][_0x2a9e('0x1c')](this));ami['on']('custom:dialconnect',this[_0x2a9e('0x25')][_0x2a9e('0x1c')](this));ami['on'](_0x2a9e('0x26'),this[_0x2a9e('0x25')][_0x2a9e('0x1c')](this));ami['on'](_0x2a9e('0x27'),this[_0x2a9e('0x1b')][_0x2a9e('0x1c')](this));ami['on'](_0x2a9e('0x28'),this[_0x2a9e('0x1b')][_0x2a9e('0x1c')](this));ami['on']('custom:substatus',this[_0x2a9e('0x1b')][_0x2a9e('0x1c')](this));ami['on'](_0x2a9e('0x29'),this['syncCustomEvent']['bind'](this));ami['on'](_0x2a9e('0x2a'),this[_0x2a9e('0x1b')]['bind'](this));ami['on'](_0x2a9e('0x2b'),this['syncCustomEvent'][_0x2a9e('0x1c')](this));ami['on'](_0x2a9e('0x2c'),this[_0x2a9e('0x1b')][_0x2a9e('0x1c')](this));ami['on'](_0x2a9e('0x2d'),this[_0x2a9e('0x1b')]['bind'](this));}Trigger[_0x2a9e('0x2e')][_0x2a9e('0x2f')]=function(_0xc37165,_0x1d14d9,_0x2fdab3){logger[_0x2a9e('0x30')](_0xc37165,_0x1d14d9,JSON[_0x2a9e('0x31')](_0x2fdab3));io['to'](_0xc37165)[_0x2a9e('0x2f')](_0x1d14d9,_0x2fdab3);};Trigger['prototype'][_0x2a9e('0x1b')]=function(_0x1d9738){var _0x1f81fa=_[_0x2a9e('0x32')](_0x1d9738);if(typeof _0x1f81fa[_0x2a9e('0x33')]===_0x2a9e('0x34')){_0x1f81fa[_0x2a9e('0x33')]=_0x2a9e('0x35');}this[_0x2a9e('0x36')](_0x1f81fa);};Trigger['prototype'][_0x2a9e('0x25')]=function(_0x175dbc){if(this[_0x2a9e('0xd')][_0x175dbc[_0x2a9e('0x37')]]){this[_0x2a9e('0x1b')](_0x175dbc);}};Trigger[_0x2a9e('0x2e')][_0x2a9e('0x36')]=function(_0x24083d){var _0x38ef33;for(var _0x36fc2e in this[_0x2a9e('0xc')]){if(this[_0x2a9e('0xc')][_0x2a9e('0x38')](_0x36fc2e)){if(this[_0x2a9e('0xc')][_0x36fc2e]['status']){_0x38ef33=this['checkTrigger'](this[_0x2a9e('0xc')][_0x36fc2e],_0x24083d);if(_0x38ef33){_[_0x2a9e('0x39')](_0x24083d,_0x24083d[_0x2a9e('0x3a')]);for(var _0x2a5802=0x0,_0x272a1a,_0x121963,_0x5c2d86;_0x2a58020x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});}; \ No newline at end of file +var _0x55ca=['debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','token','%s/token:%s','toString','base64','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','_embedded','entries','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','length','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','string','idField','custom_fields','variable','variableName','customVariable','Variable','name','priority','merge','xCALLY','Motion','CTI','concat','Tags','getString','Descriptions','/api/v2/users/%d','user','Fields','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','lodash','request-promise','./util','../../../../config/environment','desk','redis','defaults','localhost','socket.io-emitter','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','then','total_entries','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me'];(function(_0x399dc6,_0x39f775){var _0x1b4039=function(_0x8d59fd){while(--_0x8d59fd){_0x399dc6['push'](_0x399dc6['shift']());}};_0x1b4039(++_0x39f775);}(_0x55ca,0x126));var _0xa55c=function(_0x170941,_0x38d105){_0x170941=_0x170941-0x0;var _0x50e48d=_0x55ca[_0x170941];return _0x50e48d;};'use strict';var _=require(_0xa55c('0x0'));var rp=require(_0xa55c('0x1'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xa55c('0x2'));var config=require(_0xa55c('0x3'));var logger=require('../../../../config/logger')(_0xa55c('0x4'));config[_0xa55c('0x5')]=_[_0xa55c('0x6')](config[_0xa55c('0x5')],{'host':_0xa55c('0x7'),'port':0x18eb});var io=require(_0xa55c('0x8'))(new Redis(config[_0xa55c('0x5')]));function emit(_0x4d0624,_0x2121fd,_0x2537f0){io['to'](_0x4d0624)['emit'](_0x2121fd,_0x2537f0);}var headers={'Content-Type':_0xa55c('0x9'),'Accept':_0xa55c('0x9')};function getUser(_0x52a3bc,_0x5849ad){if(intUtil[_0xa55c('0xa')](_0x5849ad)===!![]){logger[_0xa55c('0xb')](_0xa55c('0xc'),_0x5849ad);return request({'uri':util[_0xa55c('0xd')](_0xa55c('0xe'),_0x52a3bc[_0xa55c('0xf')])})[_0xa55c('0x10')](function(_0x70c2de){if(_0x70c2de[_0xa55c('0x11')]){return _[_0xa55c('0x12')](_0x70c2de['_embedded']['entries'],{'email':_0x5849ad});}})[_0xa55c('0x10')](function(_0x576044){if(_0x576044){logger['info']('Agent\x20found!');return _0x576044;}else{logger[_0xa55c('0xb')](_0xa55c('0x13'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}});}else{logger[_0xa55c('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}}function request(_0x31e10d){logger[_0xa55c('0x15')](_0xa55c('0x16'),JSON[_0xa55c('0x17')](_0x31e10d));return rp(_[_0xa55c('0x6')](_0x31e10d,{'method':_0xa55c('0x18'),'headers':headers,'json':!![]}));}function getAuth(_0x4cee3c){var _0x3d4c9e;if(_0x4cee3c[_0xa55c('0x19')]===_0xa55c('0x1a')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1b'),_0x4cee3c[_0xa55c('0x1c')],_0x4cee3c['password']);}else if(_0x4cee3c['authType']===_0xa55c('0x1d')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1e'),_0x4cee3c['username'],_0x4cee3c[_0xa55c('0x1d')]);}return util[_0xa55c('0xd')]('Basic\x20%s',new Buffer(_0x3d4c9e)[_0xa55c('0x1f')](_0xa55c('0x20')));}function getEndUser(_0x940f28,_0x1965f1,_0x234372){logger['info'](_0xa55c('0x21'),_0x234372);return request({'uri':util['format']('%s/customers/search',_0x940f28['remoteUri']),'qs':{'phone':_0x234372}})[_0xa55c('0x10')](function(_0x54b038){if(_0x54b038[_0xa55c('0x11')]){logger[_0xa55c('0xb')](_0xa55c('0x22'));return _0x54b038[_0xa55c('0x23')][_0xa55c('0x24')][0x0];}else{logger[_0xa55c('0xb')](_0xa55c('0x25'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x26'),_0x940f28[_0xa55c('0xf')]),'method':_0xa55c('0x27'),'body':{'first_name':_0x1965f1,'title':_0x1965f1,'phone_numbers':[{'type':'work','value':_0x234372}]}});}});}function getTags(_0x430d55,_0x28814f){var _0x1c9f6b=[];if(_0x430d55&&_0x430d55[_0xa55c('0x28')]>0x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index a72685a..16fcd79 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 _0x2ef1=['[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','defaults','redis','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','tenantId','data2','resolve','POST','clientId','password','then','access_token',']\x20Wrong\x20credentials!','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','userEmail','email','length','internalemailaddress','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','userId','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','destcalleridnum','calleridnum','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','toLowerCase','outbound','GET','contacts?$select=','&$filter=','\x20eq\x20\x27','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','nameField','idField','indexOf','content','ticketType','incident','Descriptions','Fields','phonecall','callDirection','queue','/contacts(','Subjects','getString','ticketId','catch','format','user:%s','trigger:browser:url','stripTrailingSlash','data7','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2ef1,0x1c2));var _0x12ef=function(_0x55382a,_0x40d097){_0x55382a=_0x55382a-0x0;var _0x57a456=_0x2ef1[_0x55382a];return _0x57a456;};'use strict';var _=require(_0x12ef('0x0'));var rp=require(_0x12ef('0x1'));var util=require(_0x12ef('0x2'));var intUtil=require(_0x12ef('0x3'));var md5=require(_0x12ef('0x4'));var Redis=require(_0x12ef('0x5'));var logger=require(_0x12ef('0x6'))(_0x12ef('0x7'));var config=require(_0x12ef('0x8'));config['redis']=_[_0x12ef('0x9')](config[_0x12ef('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x12ef('0xb'))(new Redis(config[_0x12ef('0xa')]));function getAuthToken(_0x116c01,_0x3825a2,_0x39fd43){if(_0x116c01[_0x12ef('0xc')]){_0x116c01[_0x12ef('0xd')]=_0x116c01[_0x12ef('0xe')]['data7'];_0x116c01[_0x12ef('0xf')]=_0x116c01[_0x12ef('0xe')][_0x12ef('0x10')];return Promise[_0x12ef('0x11')](_0x116c01['CloudProvider']['data5']);}var _0x2e2531={'method':_0x12ef('0x12'),'uri':_0x3825a2,'form':{'client_id':_0x116c01[_0x12ef('0x13')],'resource':_0x116c01[_0x12ef('0xd')],'username':_0x116c01['username'],'password':_0x116c01[_0x12ef('0x14')],'grant_type':_0x12ef('0x14'),'client_secret':_0x116c01['clientSecret']},'json':!![]};return rp(_0x2e2531)[_0x12ef('0x15')](function(_0x4b2dc3){return _0x4b2dc3[_0x12ef('0x16')];})['catch'](function(_0x5aabc8){logger['error']('['+[_0x39fd43['toUpperCase']()]+_0x12ef('0x17'));return _0x5aabc8[_0x12ef('0x18')];});}function getUser(_0x446387,_0x42115b,_0x108987,_0xe4da3d,_0x4f748c,_0x232581){return new Promise(function(_0x25c550,_0x4f20e9){return getAuthToken(_0x42115b,_0xe4da3d,_0x232581)[_0x12ef('0x15')](function(_0x38015a){var _0x4269e3={'method':'GET','uri':_0x4f748c+_0x12ef('0x19'),'headers':{'Authorization':_0x12ef('0x1a')+_0x38015a,'OData-Version':_0x12ef('0x1b')},'json':!![]};return rp(_0x4269e3);})[_0x12ef('0x15')](function(_0x2c8794){var _0x15daae=_0x2c8794[_0x12ef('0x1c')];var _0x5b066b=![];var _0x5f2c00=null;if(!_['isNil'](_0x108987)){if(intUtil['validateEmail'](_0x108987['email'])){_0x446387[_0x12ef('0x1d')]=_0x108987[_0x12ef('0x1e')];for(_0x5f2c00=0x0;_0x5f2c00<_0x15daae[_0x12ef('0x1f')];_0x5f2c00++){if(_0x15daae[_0x5f2c00][_0x12ef('0x20')]===_0x108987[_0x12ef('0x1e')]&&!_0x15daae[_0x5f2c00][_0x12ef('0x21')]){_0x5b066b=!![];logger[_0x12ef('0x22')]('['+[_0x232581[_0x12ef('0x23')]()]+_0x12ef('0x24')+_0x15daae[_0x5f2c00]['systemuserid']+'!');_0x446387[_0x12ef('0x25')]=_0x15daae[_0x5f2c00][_0x12ef('0x26')];}}}}if(!_0x5b066b){logger[_0x12ef('0x22')]('['+[_0x232581['toUpperCase']()]+_0x12ef('0x27'));_0x446387[_0x12ef('0x1d')]=_0x42115b[_0x12ef('0x28')];for(_0x5f2c00=0x0;_0x5f2c00<_0x15daae[_0x12ef('0x1f')];_0x5f2c00++){if(_0x15daae[_0x5f2c00][_0x12ef('0x20')]===_0x42115b['username']){_0x446387['userId']=_0x15daae[_0x5f2c00][_0x12ef('0x26')];}}}_0x25c550(_0x446387);})['catch'](function(_0x585bc6){_0x4f20e9(_0x585bc6[_0x12ef('0x18')]);});});}function createEndUser(_0x525104,_0x1fe07c,_0x36e430,_0x2c9cf4,_0xac7ced,_0x2f7e93,_0x335c1d){return new Promise(function(_0x16e51c,_0x268290){return getAuthToken(_0x1fe07c,_0x36e430,_0x2f7e93)['then'](function(_0x178ea1){var _0x3b7930=_0x2f7e93['toLowerCase']()==='outbound'?_0xac7ced[_0x12ef('0x29')]:_0xac7ced[_0x12ef('0x2a')];var _0x1b6f39={'method':_0x12ef('0x12'),'uri':_0x2c9cf4+'contacts','body':{'fullname':_0x3b7930,'firstname':_0x3b7930,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x12ef('0x2b')+_0x525104[_0x12ef('0x25')]+')'},'headers':{'Authorization':_0x12ef('0x1a')+_0x178ea1,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x1b6f39['body'][_0x335c1d]=_0x3b7930;return rp(_0x1b6f39);})[_0x12ef('0x15')](function(_0x2d29eb){var _0x2a4d90=_0x2d29eb[_0x12ef('0x2c')][_0x12ef('0x2d')];var _0x22fcdd=_0x2a4d90[_0x12ef('0x2e')](_0x2a4d90['lastIndexOf']('(')+0x1,_0x2a4d90[_0x12ef('0x2f')](')'));_0x525104[_0x12ef('0x30')]=_0x22fcdd;_0x16e51c(_0x525104);})['catch'](function(_0x27ac91){_0x268290(_0x27ac91[_0x12ef('0x18')]);});});}function getEndUser(_0x38a6ec,_0x4a971b,_0x410a4d,_0x12d7db,_0x327b94,_0x59354b,_0x16b605,_0x623d68){var _0x3d04cf=_0x59354b[_0x12ef('0x31')]()===_0x12ef('0x32')?_0x327b94[_0x12ef('0x29')]:_0x327b94[_0x12ef('0x2a')];return getAuthToken(_0x4a971b,_0x410a4d,_0x59354b)['then'](function(_0x104879){_0x623d68=_0x623d68?_0x623d68:'telephone1';var _0x52e107={'method':_0x12ef('0x33'),'uri':_0x12d7db+_0x12ef('0x34')+_0x623d68+_0x12ef('0x35')+_0x623d68+_0x12ef('0x36')+_0x3d04cf['replace']('+','%2b')+'\x27','headers':{'Authorization':_0x12ef('0x1a')+_0x104879,'If-None-Match':null,'OData-Version':_0x12ef('0x1b')},'json':!![]};return rp(_0x52e107);})['then'](function(_0x462e54){var _0x2e66d4=![];if(!_0x462e54)return _0x2e66d4;var _0x1c6ee7=_0x462e54['value'];for(var _0x2f34a3=0x0;_0x2f34a3<_0x1c6ee7[_0x12ef('0x1f')];_0x2f34a3++){if(_0x1c6ee7[_0x2f34a3][_0x623d68]===_0x3d04cf){_0x2e66d4=!![];_0x38a6ec[_0x12ef('0x30')]=_0x1c6ee7[_0x2f34a3][_0x12ef('0x37')];}}return _0x2e66d4;})['then'](function(_0x26675f){if(_0x26675f)return _0x38a6ec;if(_0x16b605===_0x12ef('0x38')){logger[_0x12ef('0x22')]('['+[_0x59354b[_0x12ef('0x23')]()]+_0x12ef('0x39'));return _0x38a6ec;}return createEndUser(_0x38a6ec,_0x4a971b,_0x410a4d,_0x12d7db,_0x327b94,_0x59354b,_0x623d68)[_0x12ef('0x15')](function(_0x495056){logger[_0x12ef('0x22')]('['+[_0x59354b['toUpperCase']()]+_0x12ef('0x3a'),_0x495056[_0x12ef('0x30')]);return _0x495056;});});}function getCustomFields(_0x2bb53b,_0x1a4533,_0x25051b){var _0x582760={};if(_0x2bb53b['length']>0x0){_[_0x12ef('0x3b')](_0x2bb53b,function(_0x317d89){if(_[_0x12ef('0x3c')]([_0x12ef('0x3d'),_0x12ef('0x3e')],_0x317d89[_0x12ef('0x3f')])&&_0x317d89[_0x12ef('0x40')]&&!_0x317d89['customField']){var _0x32a18f=_0x317d89[_0x12ef('0x41')][_0x12ef('0x31')]();var _0x3587ef=_0x32a18f[_0x12ef('0x2e')](0x0,_0x32a18f[_0x12ef('0x42')]('_'));var _0x2efb95=_0x32a18f[_0x12ef('0x2e')](_0x32a18f['indexOf']('_')+0x1);if(_0x3587ef===_0x25051b){_0x582760[_0x2efb95]=_0x317d89[_0x12ef('0x43')];}}});}return _0x582760;}function getTicket(_0x4894d3,_0x2c8693,_0x2fe9c8,_0x570299,_0x9060ec,_0x1a1e7a,_0x49a185){return new Promise(function(_0x5e6c0f,_0x465a64){var _0x3f3d91;return getAuthToken(_0x2c8693,_0x2fe9c8,_0x49a185)[_0x12ef('0x15')](function(_0x52c3f9){if(_0x1a1e7a[_0x12ef('0x44')]===_0x12ef('0x45')){_0x3f3d91={'method':_0x12ef('0x12'),'uri':_0x570299+'incidents','body':Object['assign']({},{'title':intUtil['getString'](_0x1a1e7a['Subjects'],_0x9060ec,'\x20'),'description':intUtil['getString'](_0x1a1e7a[_0x12ef('0x46')],_0x9060ec,'\x0a'),'customerid_contact@odata.bind':_0x4894d3[_0x12ef('0x30')]?'/contacts('+_0x4894d3[_0x12ef('0x30')]+')':undefined,'ownerid@odata.bind':_0x12ef('0x2b')+_0x4894d3[_0x12ef('0x25')]+')','caseorigincode':'1'},getCustomFields(_0x1a1e7a[_0x12ef('0x47')],_0x9060ec,_0x1a1e7a[_0x12ef('0x44')])),'headers':{'Authorization':_0x12ef('0x1a')+_0x52c3f9,'OData-Version':_0x12ef('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x1a1e7a[_0x12ef('0x44')]===_0x12ef('0x48')){var _0x282a00=_0x4894d3[_0x12ef('0x30')]?[{'partyid_systemuser@odata.bind':_0x12ef('0x2b')+_0x4894d3[_0x12ef('0x25')]+')','participationtypemask':_0x4894d3[_0x12ef('0x49')]===_0x12ef('0x4a')?0x2:0x1},{'partyid_contact@odata.bind':_0x12ef('0x4b')+_0x4894d3[_0x12ef('0x30')]+')','participationtypemask':_0x4894d3[_0x12ef('0x49')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x12ef('0x2b')+_0x4894d3[_0x12ef('0x25')]+')','participationtypemask':_0x4894d3[_0x12ef('0x49')]==='queue'?0x2:0x1}];_0x3f3d91={'method':'POST','uri':_0x570299+'phonecalls','body':Object['assign']({},{'subject':intUtil['getString'](_0x1a1e7a[_0x12ef('0x4c')],_0x9060ec,'\x20'),'phonenumber':String(_0x9060ec[_0x12ef('0x2a')]),'description':intUtil[_0x12ef('0x4d')](_0x1a1e7a['Descriptions'],_0x9060ec,'\x0a'),'regardingobjectid_contact@odata.bind':_0x4894d3[_0x12ef('0x30')]?_0x12ef('0x4b')+_0x4894d3[_0x12ef('0x30')]+')':undefined,'ownerid@odata.bind':_0x12ef('0x2b')+_0x4894d3[_0x12ef('0x25')]+')','directioncode':_0x4894d3[_0x12ef('0x49')]===_0x12ef('0x4a')?![]:!![],'phonecall_activity_parties':_0x282a00},getCustomFields(_0x1a1e7a['Fields'],_0x9060ec,_0x1a1e7a[_0x12ef('0x44')])),'headers':{'Authorization':_0x12ef('0x1a')+_0x52c3f9,'OData-Version':_0x12ef('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3f3d91);})[_0x12ef('0x15')](function(_0x4fbf83){var _0x7f9e7a=_0x4fbf83['headers'][_0x12ef('0x2d')];var _0x5d11f9=_0x7f9e7a[_0x12ef('0x2e')](_0x7f9e7a[_0x12ef('0x2f')]('(')+0x1,_0x7f9e7a[_0x12ef('0x2f')](')'));_0x4894d3[_0x12ef('0x4e')]=_0x5d11f9;_0x5e6c0f(_0x4894d3);})[_0x12ef('0x4f')](function(_0x40ae28){_0x465a64(_0x40ae28['message']);});});}function emit(_0xf8cf9c,_0x334696,_0x22fa67,_0x49eb56){var _0x2060a1={'uri':util[_0x12ef('0x50')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0xf8cf9c,_0x22fa67,_0x49eb56)};io['to'](util[_0x12ef('0x50')](_0x12ef('0x51'),_0x334696))['emit'](_0x12ef('0x52'),_0x2060a1);}exports['cs']=function(_0x45f1ae,_0x1079c7,_0xb5efe2,_0x57110c,_0x1a309c,_0x4eadd0,_0x410740,_0x1c9823){var _0x21c93d={};_0x4eadd0[_0x12ef('0xd')]=_0x4eadd0['modernAuthentication']?intUtil[_0x12ef('0x53')](_0x4eadd0[_0x12ef('0xe')][_0x12ef('0x54')]):intUtil[_0x12ef('0x53')](_0x4eadd0[_0x12ef('0xd')]);_0x4eadd0[_0x12ef('0x55')]=intUtil[_0x12ef('0x53')](_0x4eadd0[_0x12ef('0x55')]);_0x21c93d[_0x12ef('0x49')]=_0x1c9823===_0x12ef('0x4a')||_0x1c9823===_0x12ef('0x56')?'queue':_0x12ef('0x32');var _0xfcc4c9=_0x4eadd0[_0x12ef('0xc')]?util[_0x12ef('0x50')]('%s/api/data/v9.0/',_0x4eadd0['CloudProvider']['data7']):util[_0x12ef('0x50')](_0x12ef('0x57'),_0x4eadd0[_0x12ef('0xd')]);var _0x2f02c9=util[_0x12ef('0x50')](_0x12ef('0x58'),_0x4eadd0[_0x12ef('0xf')]);var _0x5659fb=util[_0x12ef('0x50')](_0x12ef('0x59'),_0x4eadd0[_0x12ef('0x55')],_0x1079c7['uniqueid'],md5(_0x1079c7['uniqueid']));if(_0x1a309c&&_0x1a309c['monitor_format']){logger[_0x12ef('0x22')](_0x12ef('0x5a'),_0x12ef('0x5b'));_0x1079c7[_0x12ef('0x5c')]=_0x5659fb;}else if(_0x410740&&_0x410740[_0x12ef('0x5d')]&&_0x410740[_0x12ef('0x5d')]!==_0x12ef('0x5e')){logger['info'](_0x12ef('0x5f'),_0x12ef('0x5b'));_0x1079c7[_0x12ef('0x5c')]=_0x5659fb;}else{_0x1079c7[_0x12ef('0x5c')]='';}return getUser(_0x21c93d,_0x4eadd0,_0x57110c,_0x2f02c9,_0xfcc4c9,_0x1c9823)[_0x12ef('0x15')](function(_0x6315bb){logger['info']('['+_0x1c9823[_0x12ef('0x23')]()+_0x12ef('0x60'),_0x6315bb['userId']);logger[_0x12ef('0x22')]('['+_0x1c9823[_0x12ef('0x23')]()+_0x12ef('0x61'),_0x6315bb[_0x12ef('0x1d')]);return getEndUser(_0x6315bb,_0x4eadd0,_0x2f02c9,_0xfcc4c9,_0x1079c7,_0x1c9823,_0xb5efe2[_0x12ef('0x62')],_0xb5efe2[_0x12ef('0x63')]);})['then'](function(_0x5e6dd9){logger[_0x12ef('0x22')]('['+_0x1c9823[_0x12ef('0x23')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x5e6dd9[_0x12ef('0x30')]);logger[_0x12ef('0x22')]('['+_0x1c9823[_0x12ef('0x23')]()+_0x12ef('0x64'),_0x1079c7[_0x12ef('0x2a')]);return getTicket(_0x5e6dd9,_0x4eadd0,_0x2f02c9,_0xfcc4c9,_0x1079c7,_0xb5efe2,_0x1c9823);})[_0x12ef('0x15')](function(_0x1c6679){logger[_0x12ef('0x22')](util[_0x12ef('0x50')]('['+_0x1c9823[_0x12ef('0x23')]()+_0x12ef('0x65'),_0xb5efe2[_0x12ef('0x44')],_0x1c6679[_0x12ef('0x4e')]));logger[_0x12ef('0x22')](util[_0x12ef('0x50')]('['+_0x1c9823['toUpperCase']()+']\x20Call\x20direction:\x20%s',_0x1c9823));if(_0x1c9823!=='unmanaged'&&_0xb5efe2[_0x12ef('0x66')]){logger['info']('['+_0x1c9823[_0x12ef('0x23')]()+']',_0x12ef('0x67'));emit(_0x4eadd0[_0x12ef('0xd')],_0x57110c[_0x12ef('0x68')],_0xb5efe2['ticketType'],_0x1c6679[_0x12ef('0x4e')]);}})[_0x12ef('0x4f')](function(_0x238921){logger[_0x12ef('0x69')]('['+_0x1c9823[_0x12ef('0x23')]()+_0x12ef('0x6a'),_0x238921[_0x12ef('0x18')]);console['error'](_0x12ef('0x6b'),_0x238921);});}; \ No newline at end of file +var _0x7c8d=['phonecall','callDirection','queue','phonecalls','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','modernAuthentication','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','util','md5','../../../../config/logger','dynamics365','redis','localhost','socket.io-emitter','CloudProvider','data7','resolve','data5','POST','clientId','remoteUri','password','then','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail',']\x20Agent\x20found\x20','userId','systemuserid','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','length','internalemailaddress','catch','toLowerCase','outbound','destcalleridnum','calleridnum','/systemusers(','body','headers','odata-entityid','substring','lastIndexOf','enduserId','telephone1','contacts?$select=','&$filter=','replace','%2b','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','type','customField','idField','indexOf','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts('];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x7c8d,0x1c8));var _0xd7c8=function(_0x12fc65,_0x563d1b){_0x12fc65=_0x12fc65-0x0;var _0xac0ec=_0x7c8d[_0x12fc65];return _0xac0ec;};'use strict';var _=require('lodash');var rp=require('request-promise');var util=require(_0xd7c8('0x0'));var intUtil=require('./util');var md5=require(_0xd7c8('0x1'));var Redis=require('ioredis');var logger=require(_0xd7c8('0x2'))(_0xd7c8('0x3'));var config=require('../../../../config/environment');config[_0xd7c8('0x4')]=_['defaults'](config[_0xd7c8('0x4')],{'host':_0xd7c8('0x5'),'port':0x18eb});var io=require(_0xd7c8('0x6'))(new Redis(config['redis']));function getAuthToken(_0x258558,_0x5dc504,_0x4a06b6){if(_0x258558['modernAuthentication']){_0x258558['remoteUri']=_0x258558[_0xd7c8('0x7')][_0xd7c8('0x8')];_0x258558['tenantId']=_0x258558[_0xd7c8('0x7')]['data2'];return Promise[_0xd7c8('0x9')](_0x258558[_0xd7c8('0x7')][_0xd7c8('0xa')]);}var _0x57e4ba={'method':_0xd7c8('0xb'),'uri':_0x5dc504,'form':{'client_id':_0x258558[_0xd7c8('0xc')],'resource':_0x258558[_0xd7c8('0xd')],'username':_0x258558['username'],'password':_0x258558['password'],'grant_type':_0xd7c8('0xe'),'client_secret':_0x258558['clientSecret']},'json':!![]};return rp(_0x57e4ba)[_0xd7c8('0xf')](function(_0x292fcc){return _0x292fcc[_0xd7c8('0x10')];})['catch'](function(_0x327632){logger[_0xd7c8('0x11')]('['+[_0x4a06b6[_0xd7c8('0x12')]()]+_0xd7c8('0x13'));return _0x327632[_0xd7c8('0x14')];});}function getUser(_0x3f0546,_0x3eb2c3,_0x366857,_0x4f30e7,_0x2f795d,_0x3a38b4){return new Promise(function(_0x5e5c67,_0x1c5d54){return getAuthToken(_0x3eb2c3,_0x4f30e7,_0x3a38b4)['then'](function(_0x26af22){var _0x369c43={'method':_0xd7c8('0x15'),'uri':_0x2f795d+_0xd7c8('0x16'),'headers':{'Authorization':_0xd7c8('0x17')+_0x26af22,'OData-Version':_0xd7c8('0x18')},'json':!![]};return rp(_0x369c43);})[_0xd7c8('0xf')](function(_0x11c036){var _0x2973c4=_0x11c036[_0xd7c8('0x19')];var _0x2e1765=![];var _0x30e5ee=null;if(!_[_0xd7c8('0x1a')](_0x366857)){if(intUtil[_0xd7c8('0x1b')](_0x366857[_0xd7c8('0x1c')])){_0x3f0546[_0xd7c8('0x1d')]=_0x366857['email'];for(_0x30e5ee=0x0;_0x30e5ee<_0x2973c4['length'];_0x30e5ee++){if(_0x2973c4[_0x30e5ee]['internalemailaddress']===_0x366857[_0xd7c8('0x1c')]&&!_0x2973c4[_0x30e5ee]['isdisabled']){_0x2e1765=!![];logger['info']('['+[_0x3a38b4[_0xd7c8('0x12')]()]+_0xd7c8('0x1e')+_0x2973c4[_0x30e5ee]['systemuserid']+'!');_0x3f0546[_0xd7c8('0x1f')]=_0x2973c4[_0x30e5ee][_0xd7c8('0x20')];}}}}if(!_0x2e1765){logger[_0xd7c8('0x21')]('['+[_0x3a38b4[_0xd7c8('0x12')]()]+_0xd7c8('0x22'));_0x3f0546[_0xd7c8('0x1d')]=_0x3eb2c3[_0xd7c8('0x23')];for(_0x30e5ee=0x0;_0x30e5ee<_0x2973c4[_0xd7c8('0x24')];_0x30e5ee++){if(_0x2973c4[_0x30e5ee][_0xd7c8('0x25')]===_0x3eb2c3[_0xd7c8('0x23')]){_0x3f0546[_0xd7c8('0x1f')]=_0x2973c4[_0x30e5ee]['systemuserid'];}}}_0x5e5c67(_0x3f0546);})[_0xd7c8('0x26')](function(_0x44996a){_0x1c5d54(_0x44996a[_0xd7c8('0x14')]);});});}function createEndUser(_0x4b1127,_0x4c40d9,_0x2345bf,_0x415df4,_0x4555b6,_0x45dabd,_0x123aec){return new Promise(function(_0x2f2934,_0x284580){return getAuthToken(_0x4c40d9,_0x2345bf,_0x45dabd)[_0xd7c8('0xf')](function(_0x1d2f9b){var _0x3b5645=_0x45dabd[_0xd7c8('0x27')]()===_0xd7c8('0x28')?_0x4555b6[_0xd7c8('0x29')]:_0x4555b6[_0xd7c8('0x2a')];var _0x44b4a4={'method':_0xd7c8('0xb'),'uri':_0x415df4+'contacts','body':{'fullname':_0x3b5645,'firstname':_0x3b5645,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xd7c8('0x2b')+_0x4b1127['userId']+')'},'headers':{'Authorization':_0xd7c8('0x17')+_0x1d2f9b,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x44b4a4[_0xd7c8('0x2c')][_0x123aec]=_0x3b5645;return rp(_0x44b4a4);})[_0xd7c8('0xf')](function(_0xad1ed1){var _0x2f3c85=_0xad1ed1[_0xd7c8('0x2d')][_0xd7c8('0x2e')];var _0x4d9858=_0x2f3c85[_0xd7c8('0x2f')](_0x2f3c85[_0xd7c8('0x30')]('(')+0x1,_0x2f3c85[_0xd7c8('0x30')](')'));_0x4b1127[_0xd7c8('0x31')]=_0x4d9858;_0x2f2934(_0x4b1127);})['catch'](function(_0x546e83){_0x284580(_0x546e83[_0xd7c8('0x14')]);});});}function getEndUser(_0x3bca36,_0x29e9f2,_0x5efdfb,_0x26d7b8,_0x504e2e,_0x4fba21,_0x343f90,_0x46bdc4){var _0x382487=_0x4fba21['toLowerCase']()===_0xd7c8('0x28')?_0x504e2e[_0xd7c8('0x29')]:_0x504e2e[_0xd7c8('0x2a')];return getAuthToken(_0x29e9f2,_0x5efdfb,_0x4fba21)[_0xd7c8('0xf')](function(_0x5a6904){_0x46bdc4=_0x46bdc4?_0x46bdc4:_0xd7c8('0x32');var _0x2cdb3c={'method':_0xd7c8('0x15'),'uri':_0x26d7b8+_0xd7c8('0x33')+_0x46bdc4+_0xd7c8('0x34')+_0x46bdc4+'\x20eq\x20\x27'+_0x382487[_0xd7c8('0x35')]('+',_0xd7c8('0x36'))+'\x27','headers':{'Authorization':_0xd7c8('0x17')+_0x5a6904,'If-None-Match':null,'OData-Version':_0xd7c8('0x18')},'json':!![]};return rp(_0x2cdb3c);})[_0xd7c8('0xf')](function(_0x10643d){var _0xe57551=![];if(!_0x10643d)return _0xe57551;var _0x560997=_0x10643d[_0xd7c8('0x19')];for(var _0x4f4d38=0x0;_0x4f4d38<_0x560997[_0xd7c8('0x24')];_0x4f4d38++){if(_0x560997[_0x4f4d38][_0x46bdc4]===_0x382487){_0xe57551=!![];_0x3bca36[_0xd7c8('0x31')]=_0x560997[_0x4f4d38][_0xd7c8('0x37')];}}return _0xe57551;})[_0xd7c8('0xf')](function(_0x9fb243){if(_0x9fb243)return _0x3bca36;if(_0x343f90===_0xd7c8('0x38')){logger[_0xd7c8('0x21')]('['+[_0x4fba21[_0xd7c8('0x12')]()]+_0xd7c8('0x39'));return _0x3bca36;}return createEndUser(_0x3bca36,_0x29e9f2,_0x5efdfb,_0x26d7b8,_0x504e2e,_0x4fba21,_0x46bdc4)[_0xd7c8('0xf')](function(_0x458776){logger['info']('['+[_0x4fba21[_0xd7c8('0x12')]()]+_0xd7c8('0x3a'),_0x458776[_0xd7c8('0x31')]);return _0x458776;});});}function getCustomFields(_0xd27975,_0x22646a,_0xac035){var _0x38533a={};if(_0xd27975[_0xd7c8('0x24')]>0x0){_[_0xd7c8('0x3b')](_0xd27975,function(_0x4a0851){if(_[_0xd7c8('0x3c')]([_0xd7c8('0x3d'),'picklist'],_0x4a0851[_0xd7c8('0x3e')])&&_0x4a0851['nameField']&&!_0x4a0851[_0xd7c8('0x3f')]){var _0x537799=_0x4a0851[_0xd7c8('0x40')][_0xd7c8('0x27')]();var _0x536250=_0x537799[_0xd7c8('0x2f')](0x0,_0x537799[_0xd7c8('0x41')]('_'));var _0x342dd9=_0x537799[_0xd7c8('0x2f')](_0x537799['indexOf']('_')+0x1);if(_0x536250===_0xac035){_0x38533a[_0x342dd9]=_0x4a0851['content'];}}});}return _0x38533a;}function getTicket(_0x2eb29d,_0x2c87c1,_0x7a99a7,_0x4005b6,_0xaa9d34,_0x3799a7,_0x5ec983){return new Promise(function(_0x2ae62e,_0x226f74){var _0xf67f5a;return getAuthToken(_0x2c87c1,_0x7a99a7,_0x5ec983)[_0xd7c8('0xf')](function(_0x4aa6b7){if(_0x3799a7[_0xd7c8('0x42')]===_0xd7c8('0x43')){_0xf67f5a={'method':_0xd7c8('0xb'),'uri':_0x4005b6+_0xd7c8('0x44'),'body':Object[_0xd7c8('0x45')]({},{'title':intUtil[_0xd7c8('0x46')](_0x3799a7[_0xd7c8('0x47')],_0xaa9d34,'\x20'),'description':intUtil[_0xd7c8('0x46')](_0x3799a7[_0xd7c8('0x48')],_0xaa9d34,'\x0a'),'customerid_contact@odata.bind':_0x2eb29d[_0xd7c8('0x31')]?_0xd7c8('0x49')+_0x2eb29d[_0xd7c8('0x31')]+')':undefined,'ownerid@odata.bind':_0xd7c8('0x2b')+_0x2eb29d[_0xd7c8('0x1f')]+')','caseorigincode':'1'},getCustomFields(_0x3799a7['Fields'],_0xaa9d34,_0x3799a7[_0xd7c8('0x42')])),'headers':{'Authorization':_0xd7c8('0x17')+_0x4aa6b7,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x3799a7[_0xd7c8('0x42')]===_0xd7c8('0x4a')){var _0x3031bb=_0x2eb29d[_0xd7c8('0x31')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x2eb29d[_0xd7c8('0x1f')]+')','participationtypemask':_0x2eb29d[_0xd7c8('0x4b')]===_0xd7c8('0x4c')?0x2:0x1},{'partyid_contact@odata.bind':_0xd7c8('0x49')+_0x2eb29d[_0xd7c8('0x31')]+')','participationtypemask':_0x2eb29d[_0xd7c8('0x4b')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xd7c8('0x2b')+_0x2eb29d[_0xd7c8('0x1f')]+')','participationtypemask':_0x2eb29d[_0xd7c8('0x4b')]===_0xd7c8('0x4c')?0x2:0x1}];_0xf67f5a={'method':_0xd7c8('0xb'),'uri':_0x4005b6+_0xd7c8('0x4d'),'body':Object[_0xd7c8('0x45')]({},{'subject':intUtil[_0xd7c8('0x46')](_0x3799a7['Subjects'],_0xaa9d34,'\x20'),'phonenumber':String(_0xaa9d34[_0xd7c8('0x2a')]),'description':intUtil[_0xd7c8('0x46')](_0x3799a7[_0xd7c8('0x48')],_0xaa9d34,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2eb29d[_0xd7c8('0x31')]?_0xd7c8('0x49')+_0x2eb29d['enduserId']+')':undefined,'ownerid@odata.bind':_0xd7c8('0x2b')+_0x2eb29d[_0xd7c8('0x1f')]+')','directioncode':_0x2eb29d[_0xd7c8('0x4b')]==='queue'?![]:!![],'phonecall_activity_parties':_0x3031bb},getCustomFields(_0x3799a7['Fields'],_0xaa9d34,_0x3799a7[_0xd7c8('0x42')])),'headers':{'Authorization':_0xd7c8('0x17')+_0x4aa6b7,'OData-Version':_0xd7c8('0x18')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0xf67f5a);})['then'](function(_0xd676b4){var _0x26d169=_0xd676b4[_0xd7c8('0x2d')]['odata-entityid'];var _0x5b1dfb=_0x26d169['substring'](_0x26d169[_0xd7c8('0x30')]('(')+0x1,_0x26d169[_0xd7c8('0x30')](')'));_0x2eb29d[_0xd7c8('0x4e')]=_0x5b1dfb;_0x2ae62e(_0x2eb29d);})[_0xd7c8('0x26')](function(_0x3299d0){_0x226f74(_0x3299d0[_0xd7c8('0x14')]);});});}function emit(_0xef8afe,_0x119ced,_0x483de8,_0x5cce3d){var _0x16aad7={'uri':util[_0xd7c8('0x4f')](_0xd7c8('0x50'),_0xef8afe,_0x483de8,_0x5cce3d)};io['to'](util['format'](_0xd7c8('0x51'),_0x119ced))['emit']('trigger:browser:url',_0x16aad7);}exports['cs']=function(_0x2d15aa,_0x2390f8,_0x3018e6,_0x4ea2ba,_0x1d9024,_0x3234cf,_0x59d935,_0x3b686d){var _0x615e38={};_0x3234cf[_0xd7c8('0xd')]=_0x3234cf[_0xd7c8('0x52')]?intUtil['stripTrailingSlash'](_0x3234cf[_0xd7c8('0x7')][_0xd7c8('0x8')]):intUtil[_0xd7c8('0x53')](_0x3234cf[_0xd7c8('0xd')]);_0x3234cf[_0xd7c8('0x54')]=intUtil[_0xd7c8('0x53')](_0x3234cf[_0xd7c8('0x54')]);_0x615e38[_0xd7c8('0x4b')]=_0x3b686d==='queue'||_0x3b686d===_0xd7c8('0x55')?_0xd7c8('0x4c'):_0xd7c8('0x28');var _0x4bb311=_0x3234cf[_0xd7c8('0x52')]?util[_0xd7c8('0x4f')](_0xd7c8('0x56'),_0x3234cf[_0xd7c8('0x7')][_0xd7c8('0x8')]):util[_0xd7c8('0x4f')]('%s/api/data/v9.0/',_0x3234cf[_0xd7c8('0xd')]);var _0x4ec89a=util[_0xd7c8('0x4f')]('https://login.microsoftonline.com/%s/oauth2/token',_0x3234cf[_0xd7c8('0x57')]);var _0x218d53=util['format'](_0xd7c8('0x58'),_0x3234cf['serverUrl'],_0x2390f8['uniqueid'],md5(_0x2390f8[_0xd7c8('0x59')]));if(_0x1d9024&&_0x1d9024[_0xd7c8('0x5a')]){logger[_0xd7c8('0x21')]('[QUEUE]','Recording\x20is\x20enabled!');_0x2390f8[_0xd7c8('0x5b')]=_0x218d53;}else if(_0x59d935&&_0x59d935[_0xd7c8('0x5c')]&&_0x59d935['recordingFormat']!=='none'){logger[_0xd7c8('0x21')](_0xd7c8('0x5d'),'Recording\x20is\x20enabled!');_0x2390f8[_0xd7c8('0x5b')]=_0x218d53;}else{_0x2390f8['recordingURL']='';}return getUser(_0x615e38,_0x3234cf,_0x4ea2ba,_0x4ec89a,_0x4bb311,_0x3b686d)[_0xd7c8('0xf')](function(_0x1f415d){logger[_0xd7c8('0x21')]('['+_0x3b686d[_0xd7c8('0x12')]()+_0xd7c8('0x5e'),_0x1f415d[_0xd7c8('0x1f')]);logger[_0xd7c8('0x21')]('['+_0x3b686d[_0xd7c8('0x12')]()+_0xd7c8('0x5f'),_0x1f415d['userEmail']);return getEndUser(_0x1f415d,_0x3234cf,_0x4ec89a,_0x4bb311,_0x2390f8,_0x3b686d,_0x3018e6[_0xd7c8('0x60')],_0x3018e6[_0xd7c8('0x61')]);})['then'](function(_0x417198){logger['info']('['+_0x3b686d[_0xd7c8('0x12')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x417198[_0xd7c8('0x31')]);logger[_0xd7c8('0x21')]('['+_0x3b686d[_0xd7c8('0x12')]()+_0xd7c8('0x62'),_0x2390f8[_0xd7c8('0x2a')]);return getTicket(_0x417198,_0x3234cf,_0x4ec89a,_0x4bb311,_0x2390f8,_0x3018e6,_0x3b686d);})[_0xd7c8('0xf')](function(_0x2c206a){logger[_0xd7c8('0x21')](util[_0xd7c8('0x4f')]('['+_0x3b686d['toUpperCase']()+_0xd7c8('0x63'),_0x3018e6[_0xd7c8('0x42')],_0x2c206a[_0xd7c8('0x4e')]));logger[_0xd7c8('0x21')](util[_0xd7c8('0x4f')]('['+_0x3b686d[_0xd7c8('0x12')]()+_0xd7c8('0x64'),_0x3b686d));if(_0x3b686d!=='unmanaged'&&_0x3018e6[_0xd7c8('0x65')]){logger[_0xd7c8('0x21')]('['+_0x3b686d[_0xd7c8('0x12')]()+']',_0xd7c8('0x66'));emit(_0x3234cf[_0xd7c8('0xd')],_0x4ea2ba[_0xd7c8('0x67')],_0x3018e6[_0xd7c8('0x42')],_0x2c206a[_0xd7c8('0x4e')]);}})[_0xd7c8('0x26')](function(_0x336e86){logger[_0xd7c8('0x11')]('['+_0x3b686d['toUpperCase']()+_0xd7c8('0x68'),_0x336e86['message']);console[_0xd7c8('0x11')](_0xd7c8('0x69'),_0x336e86);});}; \ 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 ddfe3f2..9bc0709 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 _0x4475=['Authorization','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','error','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','user:%s','catch','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','defaults','redis','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','name','custom_fields','mapValues','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%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.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','apiKey','toString','base64','debug','[HTTP]','stringify','GET','forEach','string','picklist','type','nameField','customField','toLowerCase','content','includes','idField','variable','variableName','push','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid'];(function(_0x1ce23d,_0x5a5b51){var _0x1793e7=function(_0x230b27){while(--_0x230b27){_0x1ce23d['push'](_0x1ce23d['shift']());}};_0x1793e7(++_0x5a5b51);}(_0x4475,0x1a0));var _0x5447=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x4475[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x5447('0x0'));var rp=require(_0x5447('0x1'));var md5=require(_0x5447('0x2'));var util=require(_0x5447('0x3'));var Redis=require(_0x5447('0x4'));var intUtil=require(_0x5447('0x5'));var config=require(_0x5447('0x6'));var logger=require(_0x5447('0x7'))(_0x5447('0x8'));config['redis']=_[_0x5447('0x9')](config[_0x5447('0xa')],{'host':_0x5447('0xb'),'port':0x18eb});var io=require(_0x5447('0xc'))(new Redis(config[_0x5447('0xa')]));var headers={'Content-Type':_0x5447('0xd'),'Accept':_0x5447('0xd')};function emit(_0x4dbe18,_0x3af379,_0x7246ef){io['to'](_0x4dbe18)[_0x5447('0xe')](_0x3af379,_0x7246ef);}function getTicket(_0xadb07a,_0x1fe549,_0x159564,_0x31e550,_0x24dd52){logger[_0x5447('0xf')](_0x5447('0x10'));var _0x3361b8=_[_0x5447('0x11')]({'responder_id':_0x1fe549['id'],'requester_id':_0x159564['id'],'name':util[_0x5447('0x12')]('Caller\x20-\x20%s',_0x24dd52[_0x5447('0x13')]),'phone':_0x24dd52[_0x5447('0x14')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x5447('0x15')](_0x31e550[_0x5447('0x16')],_0x24dd52,'\x20'),'description':intUtil[_0x5447('0x15')](_0x31e550[_0x5447('0x17')],_0x24dd52,_0x5447('0x18')),'tags':getTags(_0x31e550[_0x5447('0x19')],_0x5447('0x1a'))},getCustomFields(_0x31e550['Fields'],_0x24dd52));_0x3361b8[_0x5447('0x1b')]=_[_0x5447('0x1c')](_['keyBy'](_0x3361b8[_0x5447('0x1b')],'id'),_0x5447('0x1d'));return request({'uri':util['format'](_0x5447('0x1e'),_0xadb07a[_0x5447('0x1f')]),'method':_0x5447('0x20'),'body':_0x3361b8})[_0x5447('0x21')](function(_0x2c41b4){logger[_0x5447('0xf')](_0x5447('0x22'));return _0x2c41b4;});}function getUser(_0xdf3220,_0x3c8c61){if(intUtil[_0x5447('0x23')](_0x3c8c61)){return request({'uri':util[_0x5447('0x12')](_0x5447('0x24'),_0xdf3220['remoteUri']),'qs':{'email':_0x3c8c61}})[_0x5447('0x21')](function(_0xe35dd0){if(_0xe35dd0[_0x5447('0x25')]){logger[_0x5447('0xf')](_0x5447('0x26'));return _[_0x5447('0x27')](_0xe35dd0,function(_0x460371){return _0x460371[_0x5447('0x28')][_0x5447('0x29')]===_0x3c8c61;});}else{logger['info'](_0x5447('0x2a'));return request({'uri':util[_0x5447('0x12')](_0x5447('0x2b'),_0xdf3220[_0x5447('0x1f')])})['then'](function(_0x559800){logger['info'](_0x5447('0x2c'));return _0x559800;});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x5447('0x12')](_0x5447('0x2b'),_0xdf3220['remoteUri'])})[_0x5447('0x21')](function(_0x1042c8){logger[_0x5447('0xf')](_0x5447('0x2c'));return _0x1042c8;});}}function getEndUser(_0x5930b7,_0x5e7b3d,_0xa755e){logger[_0x5447('0xf')](_0x5447('0x2d'),_0xa755e);return request({'uri':util[_0x5447('0x12')](_0x5447('0x2e'),_0x5930b7['remoteUri']),'qs':{'phone':_0xa755e}})[_0x5447('0x21')](function(_0x21470b){if(_0x21470b[_0x5447('0x25')]){logger['info'](_0x5447('0x2f'));return _['find'](_0x21470b,{'phone':_0xa755e});}else{logger['info'](_0x5447('0x30'));return request({'uri':util[_0x5447('0x12')]('%s/api/v2/contacts',_0x5930b7['remoteUri']),'method':_0x5447('0x20'),'body':{'name':_0x5e7b3d,'phone':_0xa755e}})[_0x5447('0x21')](function(_0x3ea25b){logger[_0x5447('0xf')](_0x5447('0x31'));return _0x3ea25b;});}});}function getAuth(_0x937dc2){return util['format']('Basic\x20%s',new Buffer(_0x937dc2[_0x5447('0x32')]+':X')[_0x5447('0x33')](_0x5447('0x34')));}function request(_0x21aa12){logger[_0x5447('0x35')](_0x5447('0x36'),JSON[_0x5447('0x37')](_0x21aa12));return rp(_[_0x5447('0x9')](_0x21aa12,{'method':_0x5447('0x38'),'headers':headers,'json':!![]}));}function getTags(_0xfa48e1,_0xb40a98){var _0x31ce4b=[];if(_0xfa48e1&&_0xfa48e1['length']>0x0){_0x31ce4b=_['map'](_0xfa48e1,_0xb40a98);}return _0x31ce4b;}function getCustomFields(_0x215002,_0x159a6c){var _0xd0aa10=[];var _0x9a11c9={'custom_fields':[]};if(_0x215002[_0x5447('0x25')]>0x0){_[_0x5447('0x39')](_0x215002,function(_0x5db29b){if(_['includes']([_0x5447('0x3a'),_0x5447('0x3b')],_0x5db29b[_0x5447('0x3c')])&&_0x5db29b[_0x5447('0x3d')]&&!_0x5db29b[_0x5447('0x3e')]){_0x9a11c9[_0x5db29b[_0x5447('0x3d')][_0x5447('0x3f')]()]=_0x5db29b[_0x5447('0x40')][_0x5447('0x33')]();}else if(_[_0x5447('0x41')]([_0x5447('0x3a'),_0x5447('0x3b')],_0x5db29b[_0x5447('0x3c')])&&_0x5db29b[_0x5447('0x42')]&&_0x5db29b['customField']){_0x9a11c9['custom_fields']['push']({'id':_0x5db29b[_0x5447('0x42')],'value':_0x5db29b[_0x5447('0x40')][_0x5447('0x33')]()});}else if(_0x5db29b['type']===_0x5447('0x43')&&_0x5db29b[_0x5447('0x44')]&&_0x5db29b[_0x5447('0x42')]&&_0x5db29b[_0x5447('0x3e')]){_0x159a6c[_0x5db29b[_0x5447('0x44')]]&&_0x9a11c9['custom_fields'][_0x5447('0x45')]({'id':_0x5db29b[_0x5447('0x42')],'value':_0x159a6c[_0x5db29b['variableName']]['toString']()});}else if(_0x5db29b['type']==='customVariable'&&_0x5db29b[_0x5447('0x46')]&&_0x5db29b[_0x5447('0x46')][_0x5447('0x1a')]&&_0x5db29b[_0x5447('0x42')]&&_0x5db29b[_0x5447('0x3e')]){_0x159a6c[_0x5db29b['Variable']['name'][_0x5447('0x3f')]()]&&_0x9a11c9[_0x5447('0x1b')][_0x5447('0x45')]({'id':_0x5db29b[_0x5447('0x42')],'value':_0x159a6c[_0x5db29b['Variable'][_0x5447('0x1a')][_0x5447('0x3f')]()]['toString']()});}});}return _0x9a11c9;}exports[_0x5447('0x47')]=function(_0x583cae,_0x5a5df5,_0x50c811,_0x6f3788,_0x54dd7f,_0x14eebf){var _0x133eed,_0x41be6e;_0x14eebf[_0x5447('0x1f')]=intUtil[_0x5447('0x48')](_0x14eebf[_0x5447('0x1f')]);_0x14eebf[_0x5447('0x49')]=intUtil[_0x5447('0x48')](_0x14eebf[_0x5447('0x49')]);if(_0x54dd7f&&_0x54dd7f[_0x5447('0x4a')]){logger[_0x5447('0xf')](_0x5447('0x4b'),_0x5447('0x4c'));_0x5a5df5[_0x5447('0x4d')]=util[_0x5447('0x12')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x14eebf[_0x5447('0x49')],_0x5a5df5[_0x5447('0x4e')],md5(_0x5a5df5['uniqueid']));}else{_0x5a5df5['recordingURL']='';}headers[_0x5447('0x4f')]=getAuth(_0x14eebf);return getUser(_0x14eebf,_0x6f3788[_0x5447('0x29')])[_0x5447('0x21')](function(_0x2b85f6){_0x133eed=_0x2b85f6;logger[_0x5447('0xf')](_0x5447('0x50'),_0x133eed['id']);return getEndUser(_0x14eebf,_0x5a5df5[_0x5447('0x13')],_0x5a5df5[_0x5447('0x14')]);})[_0x5447('0x21')](function(_0x210cd1){_0x41be6e=_0x210cd1;logger[_0x5447('0xf')]('The\x20Enduser\x20ID\x20is:',_0x41be6e['id']);return getTicket(_0x14eebf,_0x133eed,_0x41be6e,_0x50c811,_0x5a5df5);})[_0x5447('0x21')](function(_0x5362dc){if(_0x5362dc&&_0x5362dc['id']){logger[_0x5447('0xf')](_0x5447('0x22'));logger['info'](_0x5447('0x51'),_0x5362dc['id']);logger[_0x5447('0xf')](_0x5447('0x4b'),_0x5447('0x52'));emit(util[_0x5447('0x12')]('user:%s',_0x6f3788[_0x5447('0x1a')]),_0x5447('0x53'),{'uri':util[_0x5447('0x12')](_0x5447('0x54'),_0x14eebf['remoteUri'],_0x5362dc['id'])});}})['catch'](function(_0x5a623a){logger[_0x5447('0x55')]('[QUEUE]',JSON[_0x5447('0x37')](_0x5a623a));});};exports[_0x5447('0x56')]=function(_0x1458dd,_0x2bed80,_0x54c015,_0x24471d,_0x6a661c,_0x5aff26,_0x1bfa87){var _0x3c657a,_0x3789fd;_0x5aff26[_0x5447('0x1f')]=intUtil['stripTrailingSlash'](_0x5aff26[_0x5447('0x1f')]);_0x5aff26['serverUrl']=intUtil[_0x5447('0x48')](_0x5aff26['serverUrl']);if(_0x1bfa87&&_0x1bfa87['recordingFormat']&&_0x1bfa87[_0x5447('0x57')]!==_0x5447('0x58')){logger[_0x5447('0xf')](_0x5447('0x59'),_0x5447('0x4c'));_0x2bed80[_0x5447('0x4d')]=util['format'](_0x5447('0x5a'),_0x5aff26[_0x5447('0x49')],_0x2bed80[_0x5447('0x4e')],md5(_0x2bed80[_0x5447('0x4e')]));}headers[_0x5447('0x4f')]=getAuth(_0x5aff26);return getUser(_0x5aff26,_0x24471d[_0x5447('0x29')])['then'](function(_0x15fe6d){_0x3c657a=_0x15fe6d;logger[_0x5447('0xf')](_0x5447('0x50'),_0x3c657a['id']);return getEndUser(_0x5aff26,_0x2bed80[_0x5447('0x5b')],_0x2bed80[_0x5447('0x5c')]);})[_0x5447('0x21')](function(_0x36d7ef){_0x3789fd=_0x36d7ef;logger[_0x5447('0xf')](_0x5447('0x5d'),_0x3789fd['id']);return getTicket(_0x5aff26,_0x3c657a,_0x3789fd,_0x54c015,_0x2bed80);})[_0x5447('0x21')](function(_0x5c0d00){if(_0x5c0d00&&_0x5c0d00['id']){logger['info'](_0x5447('0x22'));logger['info'](_0x5447('0x51'),_0x5c0d00['id']);logger['info'](_0x5447('0x59'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x5447('0x5e'),_0x24471d[_0x5447('0x1a')]),_0x5447('0x53'),{'uri':util['format'](_0x5447('0x54'),_0x5aff26['remoteUri'],_0x5c0d00['id'])});}})[_0x5447('0x5f')](function(_0x52d718){logger[_0x5447('0x55')]('[OUTBOUND]',JSON[_0x5447('0x37')](_0x52d718));});};exports[_0x5447('0x60')]=function(_0x20c7e0,_0x2fecba,_0x58ae6f,_0x45c43e,_0x5276da,_0x48dc1e){var _0x155a70,_0x3648de;_0x48dc1e['remoteUri']=intUtil[_0x5447('0x48')](_0x48dc1e[_0x5447('0x1f')]);_0x48dc1e[_0x5447('0x49')]=intUtil[_0x5447('0x48')](_0x48dc1e['serverUrl']);if(_0x5276da&&_0x5276da[_0x5447('0x4a')]){logger[_0x5447('0xf')]('['+_0x2fecba[_0x5447('0x61')][_0x5447('0x62')]()+']',_0x5447('0x4c'));_0x2fecba['recordingURL']=util[_0x5447('0x12')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x48dc1e[_0x5447('0x49')],_0x2fecba['uniqueid'],md5(_0x2fecba['uniqueid']));}else{_0x2fecba[_0x5447('0x4d')]='';}headers[_0x5447('0x4f')]=getAuth(_0x48dc1e);return getUser(_0x48dc1e,'')['then'](function(_0x20e824){_0x155a70=_0x20e824;logger['info'](_0x5447('0x50'),_0x155a70['id']);return getEndUser(_0x48dc1e,_0x2fecba['calleridname'],_0x2fecba['calleridnum']);})[_0x5447('0x21')](function(_0x163255){_0x3648de=_0x163255;logger['info'](_0x5447('0x5d'),_0x3648de['id']);return getTicket(_0x48dc1e,_0x155a70,_0x3648de,_0x58ae6f,_0x2fecba);})[_0x5447('0x21')](function(_0x549c20){if(_0x549c20){logger[_0x5447('0xf')](_0x5447('0x22'));logger[_0x5447('0xf')](_0x5447('0x51'),_0x549c20['id']);}})['catch'](function(_0x4a361b){logger[_0x5447('0x55')]('['+_0x2fecba['lastevent']['toUpperCase']()+']',JSON['stringify'](_0x4a361b));});}; \ No newline at end of file +var _0x9612=['recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/helpdesk/tickets/%d','catch','error','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','defaults','localhost','redis','application/json','emit','info','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','name','Fields','custom_fields','mapValues','keyBy','%s/api/v2/tickets','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','length','Agent\x20found!','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','then','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','POST','Enduser\x20created.','Basic\x20%s','debug','[HTTP]','stringify','GET','forEach','includes','string','picklist','type','nameField','toLowerCase','content','toString','idField','customField','variable','variableName','push','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!'];(function(_0x50808c,_0x813456){var _0xdb2077=function(_0x13d07f){while(--_0x13d07f){_0x50808c['push'](_0x50808c['shift']());}};_0xdb2077(++_0x813456);}(_0x9612,0x73));var _0x2961=function(_0x29faef,_0x493c19){_0x29faef=_0x29faef-0x0;var _0x4a5de0=_0x9612[_0x29faef];return _0x4a5de0;};'use strict';var _=require(_0x2961('0x0'));var rp=require(_0x2961('0x1'));var md5=require(_0x2961('0x2'));var util=require(_0x2961('0x3'));var Redis=require(_0x2961('0x4'));var intUtil=require(_0x2961('0x5'));var config=require('../../../../config/environment');var logger=require(_0x2961('0x6'))('freshdesk');config['redis']=_[_0x2961('0x7')](config['redis'],{'host':_0x2961('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2961('0x9')]));var headers={'Content-Type':_0x2961('0xa'),'Accept':'application/json'};function emit(_0x32e2c0,_0x1b7d8c,_0x10f54c){io['to'](_0x32e2c0)[_0x2961('0xb')](_0x1b7d8c,_0x10f54c);}function getTicket(_0x41bc51,_0x3c7db2,_0x1da72d,_0xf1dcdc,_0x2e31cd){logger[_0x2961('0xc')]('Creating\x20new\x20ticket...');var _0x16438f=_[_0x2961('0xd')]({'responder_id':_0x3c7db2['id'],'requester_id':_0x1da72d['id'],'name':util[_0x2961('0xe')](_0x2961('0xf'),_0x2e31cd[_0x2961('0x10')]),'phone':_0x2e31cd[_0x2961('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x2961('0x12')](_0xf1dcdc[_0x2961('0x13')],_0x2e31cd,'\x20'),'description':intUtil[_0x2961('0x12')](_0xf1dcdc[_0x2961('0x14')],_0x2e31cd,_0x2961('0x15')),'tags':getTags(_0xf1dcdc['Tags'],_0x2961('0x16'))},getCustomFields(_0xf1dcdc[_0x2961('0x17')],_0x2e31cd));_0x16438f[_0x2961('0x18')]=_[_0x2961('0x19')](_[_0x2961('0x1a')](_0x16438f[_0x2961('0x18')],'id'),'value');return request({'uri':util[_0x2961('0xe')](_0x2961('0x1b'),_0x41bc51['remoteUri']),'method':'POST','body':_0x16438f})['then'](function(_0x4f8e6c){logger[_0x2961('0xc')](_0x2961('0x1c'));return _0x4f8e6c;});}function getUser(_0x2d5f0b,_0x5790d1){if(intUtil[_0x2961('0x1d')](_0x5790d1)){return request({'uri':util[_0x2961('0xe')](_0x2961('0x1e'),_0x2d5f0b[_0x2961('0x1f')]),'qs':{'email':_0x5790d1}})['then'](function(_0x346668){if(_0x346668[_0x2961('0x20')]){logger[_0x2961('0xc')](_0x2961('0x21'));return _['find'](_0x346668,function(_0x27feb1){return _0x27feb1[_0x2961('0x22')]['email']===_0x5790d1;});}else{logger[_0x2961('0xc')](_0x2961('0x23'));return request({'uri':util[_0x2961('0xe')]('%s/api/v2/agents/me',_0x2d5f0b[_0x2961('0x1f')])})[_0x2961('0x24')](function(_0x222efc){logger[_0x2961('0xc')](_0x2961('0x25'));return _0x222efc;});}});}else{logger['info'](_0x2961('0x26'));return request({'uri':util[_0x2961('0xe')](_0x2961('0x27'),_0x2d5f0b[_0x2961('0x1f')])})[_0x2961('0x24')](function(_0x1f7772){logger[_0x2961('0xc')](_0x2961('0x25'));return _0x1f7772;});}}function getEndUser(_0x49be04,_0x54ce76,_0x187c56){logger[_0x2961('0xc')](_0x2961('0x28'),_0x187c56);return request({'uri':util['format']('%s/api/v2/contacts',_0x49be04[_0x2961('0x1f')]),'qs':{'phone':_0x187c56}})[_0x2961('0x24')](function(_0x5ac536){if(_0x5ac536[_0x2961('0x20')]){logger['info']('Enduser\x20found!');return _[_0x2961('0x29')](_0x5ac536,{'phone':_0x187c56});}else{logger[_0x2961('0xc')](_0x2961('0x2a'));return request({'uri':util['format'](_0x2961('0x2b'),_0x49be04['remoteUri']),'method':_0x2961('0x2c'),'body':{'name':_0x54ce76,'phone':_0x187c56}})[_0x2961('0x24')](function(_0x52673a){logger[_0x2961('0xc')](_0x2961('0x2d'));return _0x52673a;});}});}function getAuth(_0x2c8509){return util[_0x2961('0xe')](_0x2961('0x2e'),new Buffer(_0x2c8509['apiKey']+':X')['toString']('base64'));}function request(_0x32d513){logger[_0x2961('0x2f')](_0x2961('0x30'),JSON[_0x2961('0x31')](_0x32d513));return rp(_[_0x2961('0x7')](_0x32d513,{'method':_0x2961('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x5c0bad,_0x13f4c1){var _0x1f0b72=[];if(_0x5c0bad&&_0x5c0bad[_0x2961('0x20')]>0x0){_0x1f0b72=_['map'](_0x5c0bad,_0x13f4c1);}return _0x1f0b72;}function getCustomFields(_0x2d1846,_0x282563){var _0x3e456d=[];var _0x2cd260={'custom_fields':[]};if(_0x2d1846[_0x2961('0x20')]>0x0){_[_0x2961('0x33')](_0x2d1846,function(_0xb76d40){if(_[_0x2961('0x34')]([_0x2961('0x35'),_0x2961('0x36')],_0xb76d40[_0x2961('0x37')])&&_0xb76d40[_0x2961('0x38')]&&!_0xb76d40['customField']){_0x2cd260[_0xb76d40[_0x2961('0x38')][_0x2961('0x39')]()]=_0xb76d40[_0x2961('0x3a')][_0x2961('0x3b')]();}else if(_[_0x2961('0x34')]([_0x2961('0x35'),_0x2961('0x36')],_0xb76d40[_0x2961('0x37')])&&_0xb76d40[_0x2961('0x3c')]&&_0xb76d40[_0x2961('0x3d')]){_0x2cd260[_0x2961('0x18')]['push']({'id':_0xb76d40['idField'],'value':_0xb76d40[_0x2961('0x3a')][_0x2961('0x3b')]()});}else if(_0xb76d40[_0x2961('0x37')]===_0x2961('0x3e')&&_0xb76d40[_0x2961('0x3f')]&&_0xb76d40[_0x2961('0x3c')]&&_0xb76d40[_0x2961('0x3d')]){_0x282563[_0xb76d40[_0x2961('0x3f')]]&&_0x2cd260[_0x2961('0x18')][_0x2961('0x40')]({'id':_0xb76d40[_0x2961('0x3c')],'value':_0x282563[_0xb76d40[_0x2961('0x3f')]][_0x2961('0x3b')]()});}else if(_0xb76d40[_0x2961('0x37')]===_0x2961('0x41')&&_0xb76d40[_0x2961('0x42')]&&_0xb76d40[_0x2961('0x42')][_0x2961('0x16')]&&_0xb76d40[_0x2961('0x3c')]&&_0xb76d40[_0x2961('0x3d')]){_0x282563[_0xb76d40[_0x2961('0x42')][_0x2961('0x16')][_0x2961('0x39')]()]&&_0x2cd260['custom_fields']['push']({'id':_0xb76d40[_0x2961('0x3c')],'value':_0x282563[_0xb76d40[_0x2961('0x42')]['name']['toLowerCase']()][_0x2961('0x3b')]()});}});}return _0x2cd260;}exports[_0x2961('0x43')]=function(_0x4b8db8,_0x814000,_0xb1a172,_0x254855,_0x172a51,_0xd97fe8){var _0x427ebd,_0xc7b1c3;_0xd97fe8[_0x2961('0x1f')]=intUtil[_0x2961('0x44')](_0xd97fe8[_0x2961('0x1f')]);_0xd97fe8[_0x2961('0x45')]=intUtil[_0x2961('0x44')](_0xd97fe8[_0x2961('0x45')]);if(_0x172a51&&_0x172a51[_0x2961('0x46')]){logger['info'](_0x2961('0x47'),_0x2961('0x48'));_0x814000[_0x2961('0x49')]=util[_0x2961('0xe')](_0x2961('0x4a'),_0xd97fe8['serverUrl'],_0x814000['uniqueid'],md5(_0x814000['uniqueid']));}else{_0x814000[_0x2961('0x49')]='';}headers[_0x2961('0x4b')]=getAuth(_0xd97fe8);return getUser(_0xd97fe8,_0x254855[_0x2961('0x4c')])[_0x2961('0x24')](function(_0x188a0f){_0x427ebd=_0x188a0f;logger['info'](_0x2961('0x4d'),_0x427ebd['id']);return getEndUser(_0xd97fe8,_0x814000['calleridname'],_0x814000[_0x2961('0x11')]);})[_0x2961('0x24')](function(_0x344490){_0xc7b1c3=_0x344490;logger[_0x2961('0xc')](_0x2961('0x4e'),_0xc7b1c3['id']);return getTicket(_0xd97fe8,_0x427ebd,_0xc7b1c3,_0xb1a172,_0x814000);})[_0x2961('0x24')](function(_0x49eac0){if(_0x49eac0&&_0x49eac0['id']){logger['info'](_0x2961('0x1c'));logger[_0x2961('0xc')](_0x2961('0x4f'),_0x49eac0['id']);logger['info'](_0x2961('0x47'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2961('0xe')](_0x2961('0x50'),_0x254855[_0x2961('0x16')]),_0x2961('0x51'),{'uri':util[_0x2961('0xe')]('%s/helpdesk/tickets/%d',_0xd97fe8[_0x2961('0x1f')],_0x49eac0['id'])});}})['catch'](function(_0x3e1825){logger['error'](_0x2961('0x47'),JSON[_0x2961('0x31')](_0x3e1825));});};exports['outbound']=function(_0x1a1089,_0x5d9ab2,_0x374b08,_0x212fc7,_0x47a5d2,_0x837530,_0x132d07){var _0x2da3be,_0x56ca8c;_0x837530[_0x2961('0x1f')]=intUtil[_0x2961('0x44')](_0x837530[_0x2961('0x1f')]);_0x837530[_0x2961('0x45')]=intUtil[_0x2961('0x44')](_0x837530[_0x2961('0x45')]);if(_0x132d07&&_0x132d07[_0x2961('0x52')]&&_0x132d07[_0x2961('0x52')]!==_0x2961('0x53')){logger[_0x2961('0xc')](_0x2961('0x54'),_0x2961('0x48'));_0x5d9ab2[_0x2961('0x49')]=util['format'](_0x2961('0x4a'),_0x837530[_0x2961('0x45')],_0x5d9ab2[_0x2961('0x55')],md5(_0x5d9ab2[_0x2961('0x55')]));}headers[_0x2961('0x4b')]=getAuth(_0x837530);return getUser(_0x837530,_0x212fc7[_0x2961('0x4c')])[_0x2961('0x24')](function(_0xaf9086){_0x2da3be=_0xaf9086;logger[_0x2961('0xc')](_0x2961('0x4d'),_0x2da3be['id']);return getEndUser(_0x837530,_0x5d9ab2['destcalleridname'],_0x5d9ab2[_0x2961('0x56')]);})[_0x2961('0x24')](function(_0x50e3cc){_0x56ca8c=_0x50e3cc;logger[_0x2961('0xc')](_0x2961('0x4e'),_0x56ca8c['id']);return getTicket(_0x837530,_0x2da3be,_0x56ca8c,_0x374b08,_0x5d9ab2);})[_0x2961('0x24')](function(_0x17d134){if(_0x17d134&&_0x17d134['id']){logger[_0x2961('0xc')](_0x2961('0x1c'));logger[_0x2961('0xc')](_0x2961('0x4f'),_0x17d134['id']);logger[_0x2961('0xc')]('[OUTBOUND]',_0x2961('0x57'));emit(util[_0x2961('0xe')](_0x2961('0x50'),_0x212fc7[_0x2961('0x16')]),'trigger:browser:url',{'uri':util[_0x2961('0xe')](_0x2961('0x58'),_0x837530[_0x2961('0x1f')],_0x17d134['id'])});}})[_0x2961('0x59')](function(_0x105bc2){logger[_0x2961('0x5a')](_0x2961('0x54'),JSON['stringify'](_0x105bc2));});};exports[_0x2961('0x5b')]=function(_0x3fcd93,_0x52f8c8,_0x385ac7,_0x300643,_0x8003e4,_0x362537){var _0x3e8545,_0x103554;_0x362537[_0x2961('0x1f')]=intUtil[_0x2961('0x44')](_0x362537['remoteUri']);_0x362537['serverUrl']=intUtil[_0x2961('0x44')](_0x362537[_0x2961('0x45')]);if(_0x8003e4&&_0x8003e4[_0x2961('0x46')]){logger['info']('['+_0x52f8c8[_0x2961('0x5c')][_0x2961('0x5d')]()+']',_0x2961('0x48'));_0x52f8c8['recordingURL']=util['format'](_0x2961('0x4a'),_0x362537[_0x2961('0x45')],_0x52f8c8[_0x2961('0x55')],md5(_0x52f8c8[_0x2961('0x55')]));}else{_0x52f8c8['recordingURL']='';}headers['Authorization']=getAuth(_0x362537);return getUser(_0x362537,'')[_0x2961('0x24')](function(_0x583d43){_0x3e8545=_0x583d43;logger['info']('The\x20User\x20ID\x20is:',_0x3e8545['id']);return getEndUser(_0x362537,_0x52f8c8['calleridname'],_0x52f8c8['calleridnum']);})[_0x2961('0x24')](function(_0x13abcb){_0x103554=_0x13abcb;logger[_0x2961('0xc')]('The\x20Enduser\x20ID\x20is:',_0x103554['id']);return getTicket(_0x362537,_0x3e8545,_0x103554,_0x385ac7,_0x52f8c8);})[_0x2961('0x24')](function(_0x56153d){if(_0x56153d){logger[_0x2961('0xc')](_0x2961('0x1c'));logger[_0x2961('0xc')](_0x2961('0x4f'),_0x56153d['id']);}})[_0x2961('0x59')](function(_0xcbbb6a){logger['error']('['+_0x52f8c8[_0x2961('0x5c')][_0x2961('0x5d')]()+']',JSON[_0x2961('0x31')](_0xcbbb6a));});}; \ 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 593a6d8..05f2247 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 _0x0ef5=['recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','users','length','email','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','error','message','Getting\x20user\x20list','then','Getting\x20user\x20with\x20email','agentEmail','userEmail','userId','User\x20found:','adminEmail','catch','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','contactNumber','mobile_number','endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','toUpperCase','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','add','task','ticketId','/contacts/','user:%s','emit','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','queue','unmanaged','uniqueid','monitor_format','Recording\x20is\x20enabled!'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x0ef5,0x105));var _0x50ef=function(_0x3c7053,_0x5a078b){_0x3c7053=_0x3c7053-0x0;var _0x5bc987=_0x0ef5[_0x3c7053];return _0x5bc987;};'use strict';var _=require(_0x50ef('0x0'));var rp=require(_0x50ef('0x1'));var md5=require(_0x50ef('0x2'));var util=require(_0x50ef('0x3'));var moment=require(_0x50ef('0x4'));var Promise=require(_0x50ef('0x5'));var Redis=require(_0x50ef('0x6'));var intUtil=require(_0x50ef('0x7'));var config=require('../../../../config/environment');var logger=require(_0x50ef('0x8'))(_0x50ef('0x9'));config[_0x50ef('0xa')]=_[_0x50ef('0xb')](config[_0x50ef('0xa')],{'host':_0x50ef('0xc'),'port':0x18eb});var io=require(_0x50ef('0xd'))(new Redis(config[_0x50ef('0xa')]));function getAdminId(_0x1703d4,_0x53253e,_0xeda526,_0x1c635a){return new Promise(function(_0x4764de,_0x52b707){var _0x2f272c=![];var _0x290c4d={'method':_0x50ef('0xe'),'uri':_0x1c635a+_0x50ef('0xf'),'json':!![]};_0x290c4d[_0x50ef('0x10')]=_0xeda526;logger[_0x50ef('0x11')]('Getting\x20admin\x20information');return rp(_0x290c4d)['then'](function(_0x17190f){if(_0x17190f){var _0xc4ccd5=_0x17190f[_0x50ef('0x12')];var _0x53a7e6=null;for(_0x53a7e6=0x0;_0x53a7e6<_0xc4ccd5[_0x50ef('0x13')];_0x53a7e6++){if(_0xc4ccd5[_0x53a7e6][_0x50ef('0x14')]===_0x1703d4['adminEmail']){_0x1703d4['adminId']=_0xc4ccd5[_0x53a7e6]['id'];_0x2f272c=!![];}}if(_0x2f272c){logger['info'](_0x50ef('0x15'),_0x1703d4[_0x50ef('0x16')]);_0x4764de(_0x1703d4);}else{_0x52b707({'statusCode':0x194,'message':_0x50ef('0x17')});}}else{_0x52b707({'statusCode':0x194,'message':_0x50ef('0x17')});}})['catch'](function(_0x15cd10){logger[_0x50ef('0x18')]('['+[_0x53253e['toUpperCase']()]+']',_0x15cd10[_0x50ef('0x19')]);_0x52b707(_0x15cd10);});});}function getUser(_0x20c109,_0x5f1fbe,_0x3a9a51){return function(_0x2c1555){return new Promise(function(_0x3c3d80,_0x20fd7b){var _0x7a2974={'method':_0x50ef('0xe'),'uri':_0x3a9a51+_0x50ef('0xf'),'json':!![]};_0x7a2974[_0x50ef('0x10')]=_0x5f1fbe;logger['info'](_0x50ef('0x1a'));return rp(_0x7a2974)[_0x50ef('0x1b')](function(_0x33d433){if(_0x33d433){var _0x4cbd77=_0x33d433[_0x50ef('0x12')];var _0x5b4519=![];var _0x2d37e7=null;if(_0x2c1555['agentEmail']!==null){logger[_0x50ef('0x11')](_0x50ef('0x1c'),_0x2c1555[_0x50ef('0x1d')]);_0x2c1555[_0x50ef('0x1e')]=_0x2c1555[_0x50ef('0x1d')];for(_0x2d37e7=0x0;_0x2d37e7<_0x4cbd77[_0x50ef('0x13')];_0x2d37e7++){if(_0x4cbd77[_0x2d37e7][_0x50ef('0x14')]===_0x2c1555[_0x50ef('0x1d')]){_0x5b4519=!![];_0x2c1555[_0x50ef('0x1f')]=_0x4cbd77[_0x2d37e7]['id'];logger[_0x50ef('0x11')](_0x50ef('0x20'),_0x2c1555[_0x50ef('0x1f')]);}}}if(!_0x5b4519){logger[_0x50ef('0x11')]('Admin\x20selected');_0x2c1555[_0x50ef('0x1e')]=_0x2c1555[_0x50ef('0x21')];_0x2c1555[_0x50ef('0x1f')]=_0x2c1555[_0x50ef('0x16')];_0x5b4519=!![];}if(_0x5b4519){_0x3c3d80(_0x2c1555);}else{_0x20fd7b({'statusCode':0x194,'message':_0x50ef('0x17')});}}else{_0x20fd7b({'statusCode':0x194,'message':_0x50ef('0x17')});}})[_0x50ef('0x22')](function(_0x3405ee){logger[_0x50ef('0x18')]('['+[_0x20c109['toUpperCase']()]+']',_0x3405ee['message']);_0x20fd7b(_0x3405ee);});});};}function searchContact(_0x150a5c,_0x50fcbb,_0x2b9582,_0x164526){return new Promise(function(_0x47e7f0,_0x4d0ab9){var _0x109d64={'method':_0x50ef('0xe'),'headers':_0x50fcbb,'uri':_0x150a5c+_0x50ef('0x23')+_0x164526+_0x50ef('0x24')+_0x2b9582+_0x50ef('0x25'),'json':!![]};rp(_0x109d64)[_0x50ef('0x1b')](function(_0x532add){var _0x2fe66c=_[_0x50ef('0x26')](_0x532add[_0x50ef('0x27')]['contacts'],[_0x2b9582,_0x164526]);_0x47e7f0(_0x2fe66c);})[_0x50ef('0x22')](function(_0x54b6e9){_0x4d0ab9(_0x54b6e9);});});}function getEndUser(_0x4d80d8,_0x4150c0,_0x57e532){return function(_0x27be84){return new Promise(function(_0x4e056c,_0x182092){logger['info'](util[_0x50ef('0x28')]('Searching\x20contact\x20with\x20phone\x20%s',_0x27be84[_0x50ef('0x29')]));searchContact(_0x57e532,_0x4150c0,_0x50ef('0x2a'),_0x27be84[_0x50ef('0x29')])['then'](function(_0x2368ff){if(_0x2368ff){_0x27be84[_0x50ef('0x2b')]=_0x2368ff['id'];logger[_0x50ef('0x11')]('Contact\x20found\x20mobile_number:',_0x27be84[_0x50ef('0x2b')]);return _0x4e056c(_0x27be84);}searchContact(_0x57e532,_0x4150c0,_0x50ef('0x2c'),_0x27be84['contactNumber'])[_0x50ef('0x1b')](function(_0x802188){if(_0x802188){_0x27be84[_0x50ef('0x2b')]=_0x802188['id'];logger[_0x50ef('0x11')](_0x50ef('0x2d'),_0x27be84['endUserId']);return _0x4e056c(_0x27be84);}createEndUser(_0x27be84,_0x4d80d8,_0x4150c0,_0x57e532)[_0x50ef('0x1b')](function(_0x5b4c56){logger[_0x50ef('0x11')](_0x50ef('0x2e'),_0x5b4c56['endUserId']);return _0x4e056c(_0x5b4c56);});});})[_0x50ef('0x22')](function(_0x106c1d){_0x182092(_0x106c1d);});});};}function createEndUser(_0x15b4de,_0x3dbfa9,_0x53b332,_0x273815){return new Promise(function(_0xc10848,_0x4919f3){var _0x1e937e=moment();var _0x1f95e5={'method':_0x50ef('0x2f'),'uri':_0x273815+_0x50ef('0x30'),'body':{'contact':{'last_name':_0x15b4de[_0x50ef('0x29')],'work_number':_0x15b4de[_0x50ef('0x29')],'mobile_number':_0x15b4de[_0x50ef('0x29')],'owner_id':_0x15b4de[_0x50ef('0x1f')],'created_at':_0x1e937e[_0x50ef('0x28')](_0x50ef('0x31'))}},'json':!![]};_0x1f95e5[_0x50ef('0x10')]=_0x53b332;logger[_0x50ef('0x11')](_0x50ef('0x32'));return rp(_0x1f95e5)[_0x50ef('0x1b')](function(_0xfd993){_0x15b4de[_0x50ef('0x2b')]=_0xfd993[_0x50ef('0x33')]['id'];_0xc10848(_0x15b4de);})[_0x50ef('0x22')](function(_0x5a03f1){logger['error']('['+[_0x3dbfa9[_0x50ef('0x34')]()]+']',_0x5a03f1[_0x50ef('0x19')]);_0x4919f3(_0x5a03f1[_0x50ef('0x19')]);});});}function getTicket(_0x2fcbe0,_0x2512d9,_0x2566da,_0x437ffb,_0x92ab2a){return function(_0x3c5751){logger[_0x50ef('0x11')](_0x50ef('0x35'));return new Promise(function(_0x1bd108,_0x3b40f6){var _0x4cbe34=moment();var _0x315e3a={'method':_0x50ef('0x2f'),'uri':_0x2566da+_0x50ef('0x36'),'body':{'title':intUtil[_0x50ef('0x37')](_0x437ffb[_0x50ef('0x38')],_0x92ab2a,'\x20'),'description':intUtil[_0x50ef('0x37')](_0x437ffb[_0x50ef('0x39')],_0x92ab2a,'\x0a'),'owner_id':_0x3c5751['userId'],'creater_id':_0x3c5751[_0x50ef('0x16')],'targetable_id':_0x3c5751[_0x50ef('0x2b')],'targetable_type':_0x50ef('0x3a'),'created_at':_0x4cbe34[_0x50ef('0x28')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x4cbe34[_0x50ef('0x3b')](0x1e,'m')[_0x50ef('0x28')](_0x50ef('0x31'))},'json':!![]};_0x315e3a[_0x50ef('0x10')]=_0x2512d9;return rp(_0x315e3a)[_0x50ef('0x1b')](function(_0x23fef3){_0x3c5751['ticketId']=_0x23fef3[_0x50ef('0x3c')]['id'];logger['info']('Task\x20created:',_0x3c5751[_0x50ef('0x3d')]);_0x1bd108(_0x3c5751);})[_0x50ef('0x22')](function(_0x4c56ed){logger[_0x50ef('0x18')]('['+[_0x2fcbe0[_0x50ef('0x34')]()]+']',_0x4c56ed[_0x50ef('0x19')]);_0x3b40f6(_0x4c56ed[_0x50ef('0x19')]);});});};}function emit(_0x1371cd,_0x1f203e,_0x991cc5){var _0x2ac9f8={'uri':_0x1371cd+_0x50ef('0x3e')+_0x991cc5};io['to'](util[_0x50ef('0x28')](_0x50ef('0x3f'),_0x1f203e))[_0x50ef('0x40')]('trigger:browser:url',_0x2ac9f8);}exports['cs']=function(_0x5ef900,_0x7236ec,_0x3c19a0,_0x2a7fd7,_0x14c2cd,_0x2edbfa,_0x474d15,_0x4c00c9){var _0xe4c475={};var _0x526df9={'Authorization':'Token\x20token='+_0x2edbfa[_0x50ef('0x41')]};_0x2edbfa[_0x50ef('0x42')]=intUtil[_0x50ef('0x43')](_0x2edbfa[_0x50ef('0x42')]);_0x2edbfa[_0x50ef('0x44')]=intUtil['stripTrailingSlash'](_0x2edbfa[_0x50ef('0x44')]);var _0x2ae99a=_0x2edbfa[_0x50ef('0x42')];_0xe4c475[_0x50ef('0x21')]=_0x2edbfa[_0x50ef('0x45')];_0xe4c475[_0x50ef('0x29')]=_0x4c00c9[_0x50ef('0x46')]()===_0x50ef('0x47')?_0x7236ec[_0x50ef('0x48')]:_0x7236ec[_0x50ef('0x49')];_0xe4c475['callDirection']=_0x4c00c9===_0x50ef('0x4a')||_0x4c00c9===_0x50ef('0x4b')?_0x50ef('0x4a'):_0x50ef('0x47');if(_0x2a7fd7){_0xe4c475['agentEmail']=_0x2a7fd7['email'];}var _0x5c6527=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2edbfa[_0x50ef('0x44')],_0x7236ec['uniqueid'],md5(_0x7236ec[_0x50ef('0x4c')]));if(_0x14c2cd&&_0x14c2cd[_0x50ef('0x4d')]){logger[_0x50ef('0x11')]('[QUEUE]',_0x50ef('0x4e'));_0x7236ec[_0x50ef('0x4f')]=_0x5c6527;}else if(_0x474d15&&_0x474d15['recordingFormat']&&_0x474d15[_0x50ef('0x50')]!==_0x50ef('0x51')){logger[_0x50ef('0x11')]('[OUTBOUND]',_0x50ef('0x4e'));_0x7236ec[_0x50ef('0x4f')]=_0x5c6527;}else{_0x7236ec[_0x50ef('0x4f')]='';}return getAdminId(_0xe4c475,_0x4c00c9,_0x526df9,_0x2ae99a)[_0x50ef('0x1b')](getUser(_0x4c00c9,_0x526df9,_0x2ae99a))[_0x50ef('0x1b')](getEndUser(_0x4c00c9,_0x526df9,_0x2ae99a))['then'](getTicket(_0x4c00c9,_0x526df9,_0x2ae99a,_0x3c19a0,_0x7236ec))['then'](function(_0x400dc6){logger[_0x50ef('0x11')](util[_0x50ef('0x28')](_0x50ef('0x52'),_0x400dc6[_0x50ef('0x3d')]));if(_0x4c00c9!==_0x50ef('0x4b')){logger[_0x50ef('0x11')]('['+[_0x4c00c9[_0x50ef('0x34')]()]+']',_0x50ef('0x53'));emit(_0x2ae99a,_0x2a7fd7['name'],_0x400dc6[_0x50ef('0x2b')]);}})[_0x50ef('0x22')](function(_0x127b70){logger['error']('['+[_0x4c00c9[_0x50ef('0x34')]()]+_0x50ef('0x54'),util['inspect'](_0x127b70,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x10e1=['contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:','POST','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','add','task','Task\x20created:','ticketId','/contacts/','emit','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','remoteUri','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','md5','moment','bluebird','./util','../../../../config/environment','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error','toUpperCase','message','Getting\x20user\x20list','users','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','/api/lookup?q=','&f=','contacts','catch','format','Searching\x20contact\x20with\x20phone\x20%s'];(function(_0x3df871,_0xda2e11){var _0x570f7b=function(_0xfaac78){while(--_0xfaac78){_0x3df871['push'](_0x3df871['shift']());}};_0x570f7b(++_0xda2e11);}(_0x10e1,0x135));var _0x110e=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x10e1[_0x58e469];return _0x4c01c5;};'use strict';var _=require('lodash');var rp=require(_0x110e('0x0'));var md5=require(_0x110e('0x1'));var util=require('util');var moment=require(_0x110e('0x2'));var Promise=require(_0x110e('0x3'));var Redis=require('ioredis');var intUtil=require(_0x110e('0x4'));var config=require(_0x110e('0x5'));var logger=require('../../../../config/logger')(_0x110e('0x6'));config[_0x110e('0x7')]=_[_0x110e('0x8')](config[_0x110e('0x7')],{'host':_0x110e('0x9'),'port':0x18eb});var io=require(_0x110e('0xa'))(new Redis(config[_0x110e('0x7')]));function getAdminId(_0x527a29,_0x4f501f,_0x364651,_0x2e483c){return new Promise(function(_0x38b1c9,_0x454a1f){var _0x4c4784=![];var _0x5cc668={'method':_0x110e('0xb'),'uri':_0x2e483c+_0x110e('0xc'),'json':!![]};_0x5cc668[_0x110e('0xd')]=_0x364651;logger[_0x110e('0xe')](_0x110e('0xf'));return rp(_0x5cc668)[_0x110e('0x10')](function(_0x488580){if(_0x488580){var _0x3b85ca=_0x488580['users'];var _0x268486=null;for(_0x268486=0x0;_0x268486<_0x3b85ca[_0x110e('0x11')];_0x268486++){if(_0x3b85ca[_0x268486][_0x110e('0x12')]===_0x527a29[_0x110e('0x13')]){_0x527a29[_0x110e('0x14')]=_0x3b85ca[_0x268486]['id'];_0x4c4784=!![];}}if(_0x4c4784){logger[_0x110e('0xe')](_0x110e('0x15'),_0x527a29[_0x110e('0x14')]);_0x38b1c9(_0x527a29);}else{_0x454a1f({'statusCode':0x194,'message':_0x110e('0x16')});}}else{_0x454a1f({'statusCode':0x194,'message':_0x110e('0x16')});}})['catch'](function(_0x5cd92f){logger[_0x110e('0x17')]('['+[_0x4f501f[_0x110e('0x18')]()]+']',_0x5cd92f[_0x110e('0x19')]);_0x454a1f(_0x5cd92f);});});}function getUser(_0x19c4bb,_0x47b856,_0x20ccc0){return function(_0x165ff3){return new Promise(function(_0xbf4718,_0x1492c2){var _0x3e258f={'method':_0x110e('0xb'),'uri':_0x20ccc0+_0x110e('0xc'),'json':!![]};_0x3e258f[_0x110e('0xd')]=_0x47b856;logger[_0x110e('0xe')](_0x110e('0x1a'));return rp(_0x3e258f)[_0x110e('0x10')](function(_0x2e47f6){if(_0x2e47f6){var _0x78a8c=_0x2e47f6[_0x110e('0x1b')];var _0x270907=![];var _0x1105ad=null;if(_0x165ff3[_0x110e('0x1c')]!==null){logger[_0x110e('0xe')](_0x110e('0x1d'),_0x165ff3[_0x110e('0x1c')]);_0x165ff3[_0x110e('0x1e')]=_0x165ff3[_0x110e('0x1c')];for(_0x1105ad=0x0;_0x1105ad<_0x78a8c[_0x110e('0x11')];_0x1105ad++){if(_0x78a8c[_0x1105ad][_0x110e('0x12')]===_0x165ff3[_0x110e('0x1c')]){_0x270907=!![];_0x165ff3[_0x110e('0x1f')]=_0x78a8c[_0x1105ad]['id'];logger[_0x110e('0xe')](_0x110e('0x20'),_0x165ff3[_0x110e('0x1f')]);}}}if(!_0x270907){logger[_0x110e('0xe')]('Admin\x20selected');_0x165ff3[_0x110e('0x1e')]=_0x165ff3[_0x110e('0x13')];_0x165ff3[_0x110e('0x1f')]=_0x165ff3['adminId'];_0x270907=!![];}if(_0x270907){_0xbf4718(_0x165ff3);}else{_0x1492c2({'statusCode':0x194,'message':_0x110e('0x16')});}}else{_0x1492c2({'statusCode':0x194,'message':_0x110e('0x16')});}})['catch'](function(_0x1dd3e2){logger[_0x110e('0x17')]('['+[_0x19c4bb[_0x110e('0x18')]()]+']',_0x1dd3e2[_0x110e('0x19')]);_0x1492c2(_0x1dd3e2);});});};}function searchContact(_0x4c0ea6,_0x41f713,_0x2f93fa,_0x4e57b2){return new Promise(function(_0x28350c,_0x17b2e7){var _0x173df2={'method':'GET','headers':_0x41f713,'uri':_0x4c0ea6+_0x110e('0x21')+_0x4e57b2+_0x110e('0x22')+_0x2f93fa+'&entities=contact','json':!![]};rp(_0x173df2)[_0x110e('0x10')](function(_0x37c3fc){var _0x8e0d9d=_['find'](_0x37c3fc[_0x110e('0x23')]['contacts'],[_0x2f93fa,_0x4e57b2]);_0x28350c(_0x8e0d9d);})[_0x110e('0x24')](function(_0x4b7dba){_0x17b2e7(_0x4b7dba);});});}function getEndUser(_0x4905e7,_0x327fcd,_0x2c25be){return function(_0x421dd4){return new Promise(function(_0x5ce1a5,_0x418668){logger['info'](util[_0x110e('0x25')](_0x110e('0x26'),_0x421dd4[_0x110e('0x27')]));searchContact(_0x2c25be,_0x327fcd,_0x110e('0x28'),_0x421dd4['contactNumber'])[_0x110e('0x10')](function(_0x208d61){if(_0x208d61){_0x421dd4[_0x110e('0x29')]=_0x208d61['id'];logger[_0x110e('0xe')](_0x110e('0x2a'),_0x421dd4[_0x110e('0x29')]);return _0x5ce1a5(_0x421dd4);}searchContact(_0x2c25be,_0x327fcd,'work_number',_0x421dd4[_0x110e('0x27')])[_0x110e('0x10')](function(_0x5489f1){if(_0x5489f1){_0x421dd4[_0x110e('0x29')]=_0x5489f1['id'];logger[_0x110e('0xe')](_0x110e('0x2b'),_0x421dd4[_0x110e('0x29')]);return _0x5ce1a5(_0x421dd4);}createEndUser(_0x421dd4,_0x4905e7,_0x327fcd,_0x2c25be)['then'](function(_0x388a70){logger[_0x110e('0xe')]('Contact\x20created:',_0x388a70[_0x110e('0x29')]);return _0x5ce1a5(_0x388a70);});});})[_0x110e('0x24')](function(_0x5438a3){_0x418668(_0x5438a3);});});};}function createEndUser(_0x12e482,_0x1dd577,_0x26940e,_0x572aeb){return new Promise(function(_0x1fb6e7,_0x2f0f4f){var _0x44a49e=moment();var _0x58b8fd={'method':_0x110e('0x2c'),'uri':_0x572aeb+'/api/contacts','body':{'contact':{'last_name':_0x12e482[_0x110e('0x27')],'work_number':_0x12e482[_0x110e('0x27')],'mobile_number':_0x12e482[_0x110e('0x27')],'owner_id':_0x12e482[_0x110e('0x1f')],'created_at':_0x44a49e[_0x110e('0x25')](_0x110e('0x2d'))}},'json':!![]};_0x58b8fd[_0x110e('0xd')]=_0x26940e;logger[_0x110e('0xe')](_0x110e('0x2e'));return rp(_0x58b8fd)[_0x110e('0x10')](function(_0x176105){_0x12e482['endUserId']=_0x176105[_0x110e('0x2f')]['id'];_0x1fb6e7(_0x12e482);})['catch'](function(_0x1ece70){logger[_0x110e('0x17')]('['+[_0x1dd577[_0x110e('0x18')]()]+']',_0x1ece70[_0x110e('0x19')]);_0x2f0f4f(_0x1ece70[_0x110e('0x19')]);});});}function getTicket(_0x294f29,_0xd5ae09,_0xc316cb,_0x24b4fa,_0x14b31a){return function(_0x22837b){logger[_0x110e('0xe')](_0x110e('0x30'));return new Promise(function(_0x2fa24c,_0x460f7f){var _0x2a34bd=moment();var _0x33bf19={'method':'POST','uri':_0xc316cb+_0x110e('0x31'),'body':{'title':intUtil[_0x110e('0x32')](_0x24b4fa[_0x110e('0x33')],_0x14b31a,'\x20'),'description':intUtil[_0x110e('0x32')](_0x24b4fa[_0x110e('0x34')],_0x14b31a,'\x0a'),'owner_id':_0x22837b[_0x110e('0x1f')],'creater_id':_0x22837b['adminId'],'targetable_id':_0x22837b[_0x110e('0x29')],'targetable_type':_0x110e('0x35'),'created_at':_0x2a34bd[_0x110e('0x25')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x2a34bd[_0x110e('0x36')](0x1e,'m')[_0x110e('0x25')](_0x110e('0x2d'))},'json':!![]};_0x33bf19['headers']=_0xd5ae09;return rp(_0x33bf19)[_0x110e('0x10')](function(_0x16757f){_0x22837b['ticketId']=_0x16757f[_0x110e('0x37')]['id'];logger[_0x110e('0xe')](_0x110e('0x38'),_0x22837b[_0x110e('0x39')]);_0x2fa24c(_0x22837b);})['catch'](function(_0x4f5958){logger['error']('['+[_0x294f29[_0x110e('0x18')]()]+']',_0x4f5958[_0x110e('0x19')]);_0x460f7f(_0x4f5958['message']);});});};}function emit(_0x3c777d,_0x2d778e,_0x2a83a3){var _0x52984c={'uri':_0x3c777d+_0x110e('0x3a')+_0x2a83a3};io['to'](util[_0x110e('0x25')]('user:%s',_0x2d778e))[_0x110e('0x3b')](_0x110e('0x3c'),_0x52984c);}exports['cs']=function(_0x492a5a,_0x3393ab,_0x5e2561,_0x198117,_0x41426c,_0x2bd9d4,_0x2f8f0f,_0xd268cd){var _0x599fdf={};var _0x1b7d3c={'Authorization':_0x110e('0x3d')+_0x2bd9d4[_0x110e('0x3e')]};_0x2bd9d4['remoteUri']=intUtil[_0x110e('0x3f')](_0x2bd9d4[_0x110e('0x40')]);_0x2bd9d4[_0x110e('0x41')]=intUtil[_0x110e('0x3f')](_0x2bd9d4['serverUrl']);var _0x5ec513=_0x2bd9d4['remoteUri'];_0x599fdf[_0x110e('0x13')]=_0x2bd9d4[_0x110e('0x42')];_0x599fdf[_0x110e('0x27')]=_0xd268cd[_0x110e('0x43')]()===_0x110e('0x44')?_0x3393ab[_0x110e('0x45')]:_0x3393ab[_0x110e('0x46')];_0x599fdf[_0x110e('0x47')]=_0xd268cd===_0x110e('0x48')||_0xd268cd===_0x110e('0x49')?'queue':_0x110e('0x44');if(_0x198117){_0x599fdf[_0x110e('0x1c')]=_0x198117[_0x110e('0x12')];}var _0x327638=util[_0x110e('0x25')](_0x110e('0x4a'),_0x2bd9d4[_0x110e('0x41')],_0x3393ab[_0x110e('0x4b')],md5(_0x3393ab[_0x110e('0x4b')]));if(_0x41426c&&_0x41426c[_0x110e('0x4c')]){logger['info'](_0x110e('0x4d'),_0x110e('0x4e'));_0x3393ab['recordingURL']=_0x327638;}else if(_0x2f8f0f&&_0x2f8f0f[_0x110e('0x4f')]&&_0x2f8f0f['recordingFormat']!==_0x110e('0x50')){logger['info'](_0x110e('0x51'),_0x110e('0x4e'));_0x3393ab['recordingURL']=_0x327638;}else{_0x3393ab[_0x110e('0x52')]='';}return getAdminId(_0x599fdf,_0xd268cd,_0x1b7d3c,_0x5ec513)[_0x110e('0x10')](getUser(_0xd268cd,_0x1b7d3c,_0x5ec513))[_0x110e('0x10')](getEndUser(_0xd268cd,_0x1b7d3c,_0x5ec513))[_0x110e('0x10')](getTicket(_0xd268cd,_0x1b7d3c,_0x5ec513,_0x5e2561,_0x3393ab))[_0x110e('0x10')](function(_0x43db63){logger[_0x110e('0xe')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x43db63[_0x110e('0x39')]));if(_0xd268cd!=='unmanaged'){logger[_0x110e('0xe')]('['+[_0xd268cd[_0x110e('0x18')]()]+']',_0x110e('0x53'));emit(_0x5ec513,_0x198117[_0x110e('0x54')],_0x43db63[_0x110e('0x29')]);}})[_0x110e('0x24')](function(_0x5766dd){logger['error']('['+[_0xd268cd['toUpperCase']()]+_0x110e('0x55'),util[_0x110e('0x56')](_0x5766dd,{'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 8b428ae..2a29464 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 _0x1567=['format','error','%s\x20account\x20#%s\x20not\x20found','lodash','util','./salesforce','./zoho','./vtiger','./dynamics365','./freshsales','zendesk','zoho','desk','vtiger','freshsales','servicenow','exec','data1','toLowerCase','data2','find','data3','queue','routeId','outbound','EVENT\x20UNKNOWN','unmanaged','salesforce','freshdesk','dynamics365','log','unknown\x20integration','../../../../config/logger','[EXEC]'];(function(_0xd93b26,_0x12bbf2){var _0x25f668=function(_0x133ff7){while(--_0x133ff7){_0xd93b26['push'](_0xd93b26['shift']());}};_0x25f668(++_0x12bbf2);}(_0x1567,0x157));var _0x7156=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1567[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x7156('0x0'));var util=require(_0x7156('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0x7156('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require('./freshdesk');var zoho=require(_0x7156('0x3'));var desk=require('./desk');var vtiger=require(_0x7156('0x4'));var servicenow=require('./servicenow');var dynamics365=require(_0x7156('0x5'));var freshsales=require(_0x7156('0x6'));var integrations=[_0x7156('0x7'),'salesforce','sugarcrm','freshdesk',_0x7156('0x8'),_0x7156('0x9'),_0x7156('0xa'),'dynamics365',_0x7156('0xb'),_0x7156('0xc')];exports[_0x7156('0xd')]=function(_0x1a83f0,_0x1d6388,_0x556dc7,_0x56cab9,_0x4b1f2e,_0x259949){if(_0x556dc7){if(_['includes'](integrations,_0x1a83f0[_0x7156('0xe')][_0x7156('0xf')]())){try{var _0xc13db2=null;var _0x368a87='';var _0x415d86=_0x556dc7[_0x1a83f0[_0x7156('0xe')][_0x7156('0xf')]()];if(_0x415d86){var _0x3e099d=_0x415d86[_0x1a83f0[_0x7156('0x10')]];if(_0x3e099d){var _0x298ccb=_[_0x7156('0x11')](_0x3e099d['Configurations'],{'id':parseInt(_0x1a83f0[_0x7156('0x12')],0xa)});if(_0x298ccb){if(_0x56cab9){if(_0x4b1f2e&&_0x1d6388[_0x7156('0x13')]){_0x368a87=_0x7156('0x13');}else if(_0x1d6388[_0x7156('0x14')]){_0x368a87=_0x7156('0x15');}else{console['log'](_0x7156('0x16'),_0x1d6388);}}else{_0x368a87=_0x7156('0x17');}switch(_0x1a83f0[_0x7156('0xe')]['toLowerCase']()){case _0x7156('0x7'):zendesk[_0x368a87](_0x1a83f0,_0x1d6388,_0x298ccb,_0x56cab9,_0x4b1f2e,_0x3e099d,_0x259949);break;case _0x7156('0x18'):salesforce[_0x368a87](_0x1a83f0,_0x1d6388,_0x298ccb,_0x56cab9,_0x4b1f2e,_0x3e099d,_0x259949);break;case'sugarcrm':sugarcrm[_0x368a87](_0x1a83f0,_0x1d6388,_0x298ccb,_0x56cab9,_0x4b1f2e,_0x3e099d,_0x259949);break;case _0x7156('0x19'):freshdesk[_0x368a87](_0x1a83f0,_0x1d6388,_0x298ccb,_0x56cab9,_0x4b1f2e,_0x3e099d,_0x259949);break;case _0x7156('0x8'):zoho[_0x368a87](_0x1a83f0,_0x1d6388,_0x298ccb,_0x56cab9,_0x4b1f2e,_0x3e099d,_0x259949);break;case _0x7156('0x9'):desk[_0x368a87](_0x1a83f0,_0x1d6388,_0x298ccb,_0x56cab9,_0x4b1f2e,_0x3e099d,_0x259949);break;case _0x7156('0xa'):vtiger[_0x368a87](_0x1a83f0,_0x1d6388,_0x298ccb,_0x56cab9,_0x4b1f2e,_0x3e099d,_0x259949);break;case'freshsales':freshsales['cs'](_0x1a83f0,_0x1d6388,_0x298ccb,_0x56cab9,_0x4b1f2e,_0x3e099d,_0x259949,_0x368a87);break;case _0x7156('0xc'):servicenow['cs'](_0x1a83f0,_0x1d6388,_0x298ccb,_0x56cab9,_0x4b1f2e,_0x3e099d,_0x259949,_0x368a87);break;case _0x7156('0x1a'):dynamics365['cs'](_0x1a83f0,_0x1d6388,_0x298ccb,_0x56cab9,_0x4b1f2e,_0x3e099d,_0x259949,_0x368a87);break;default:console[_0x7156('0x1b')](_0x7156('0x1c'));}}else{_0xc13db2=require(_0x7156('0x1d'))(_0x1a83f0[_0x7156('0xe')][_0x7156('0xf')]());_0xc13db2['error'](_0x7156('0x1e'),util[_0x7156('0x1f')]('%s\x20configuration\x20#%s\x20not\x20found',_0x1a83f0[_0x7156('0xe')][_0x7156('0xf')](),_0x1a83f0[_0x7156('0x12')]));}}else{_0xc13db2=require('../../../../config/logger')(_0x1a83f0[_0x7156('0xe')][_0x7156('0xf')]());_0xc13db2[_0x7156('0x20')](_0x7156('0x1e'),util[_0x7156('0x1f')](_0x7156('0x21'),_0x1a83f0[_0x7156('0xe')][_0x7156('0xf')](),_0x1a83f0['data2']));}}else{}}catch(_0x541a75){console[_0x7156('0x20')](_0x541a75);}}}}; \ No newline at end of file +var _0x68e6=['./vtiger','./servicenow','./freshsales','zendesk','salesforce','freshdesk','zoho','dynamics365','freshsales','servicenow','exec','data1','toLowerCase','data2','find','data3','queue','routeId','log','EVENT\x20UNKNOWN','unmanaged','desk','vtiger','unknown\x20integration','../../../../config/logger','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','error','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk'];(function(_0x597e74,_0x2a2077){var _0x1b2833=function(_0x13a1cb){while(--_0x13a1cb){_0x597e74['push'](_0x597e74['shift']());}};_0x1b2833(++_0x2a2077);}(_0x68e6,0x174));var _0x668e=function(_0x5d21ec,_0x360582){_0x5d21ec=_0x5d21ec-0x0;var _0x4d1fff=_0x68e6[_0x5d21ec];return _0x4d1fff;};'use strict';var _=require(_0x668e('0x0'));var util=require(_0x668e('0x1'));var zendesk=require(_0x668e('0x2'));var salesforce=require(_0x668e('0x3'));var sugarcrm=require(_0x668e('0x4'));var freshdesk=require(_0x668e('0x5'));var zoho=require(_0x668e('0x6'));var desk=require(_0x668e('0x7'));var vtiger=require(_0x668e('0x8'));var servicenow=require(_0x668e('0x9'));var dynamics365=require('./dynamics365');var freshsales=require(_0x668e('0xa'));var integrations=[_0x668e('0xb'),_0x668e('0xc'),'sugarcrm',_0x668e('0xd'),_0x668e('0xe'),'desk','vtiger',_0x668e('0xf'),_0x668e('0x10'),_0x668e('0x11')];exports[_0x668e('0x12')]=function(_0x5d4d6b,_0x384403,_0x44fb6b,_0x3ae25f,_0x54196d,_0x584bcd){if(_0x44fb6b){if(_['includes'](integrations,_0x5d4d6b[_0x668e('0x13')]['toLowerCase']())){try{var _0x3a6822=null;var _0x203f32='';var _0x25ae91=_0x44fb6b[_0x5d4d6b[_0x668e('0x13')][_0x668e('0x14')]()];if(_0x25ae91){var _0x455530=_0x25ae91[_0x5d4d6b[_0x668e('0x15')]];if(_0x455530){var _0x117635=_[_0x668e('0x16')](_0x455530['Configurations'],{'id':parseInt(_0x5d4d6b[_0x668e('0x17')],0xa)});if(_0x117635){if(_0x3ae25f){if(_0x54196d&&_0x384403[_0x668e('0x18')]){_0x203f32=_0x668e('0x18');}else if(_0x384403[_0x668e('0x19')]){_0x203f32='outbound';}else{console[_0x668e('0x1a')](_0x668e('0x1b'),_0x384403);}}else{_0x203f32=_0x668e('0x1c');}switch(_0x5d4d6b[_0x668e('0x13')]['toLowerCase']()){case'zendesk':zendesk[_0x203f32](_0x5d4d6b,_0x384403,_0x117635,_0x3ae25f,_0x54196d,_0x455530,_0x584bcd);break;case _0x668e('0xc'):salesforce[_0x203f32](_0x5d4d6b,_0x384403,_0x117635,_0x3ae25f,_0x54196d,_0x455530,_0x584bcd);break;case'sugarcrm':sugarcrm[_0x203f32](_0x5d4d6b,_0x384403,_0x117635,_0x3ae25f,_0x54196d,_0x455530,_0x584bcd);break;case _0x668e('0xd'):freshdesk[_0x203f32](_0x5d4d6b,_0x384403,_0x117635,_0x3ae25f,_0x54196d,_0x455530,_0x584bcd);break;case _0x668e('0xe'):zoho[_0x203f32](_0x5d4d6b,_0x384403,_0x117635,_0x3ae25f,_0x54196d,_0x455530,_0x584bcd);break;case _0x668e('0x1d'):desk[_0x203f32](_0x5d4d6b,_0x384403,_0x117635,_0x3ae25f,_0x54196d,_0x455530,_0x584bcd);break;case _0x668e('0x1e'):vtiger[_0x203f32](_0x5d4d6b,_0x384403,_0x117635,_0x3ae25f,_0x54196d,_0x455530,_0x584bcd);break;case'freshsales':freshsales['cs'](_0x5d4d6b,_0x384403,_0x117635,_0x3ae25f,_0x54196d,_0x455530,_0x584bcd,_0x203f32);break;case'servicenow':servicenow['cs'](_0x5d4d6b,_0x384403,_0x117635,_0x3ae25f,_0x54196d,_0x455530,_0x584bcd,_0x203f32);break;case _0x668e('0xf'):dynamics365['cs'](_0x5d4d6b,_0x384403,_0x117635,_0x3ae25f,_0x54196d,_0x455530,_0x584bcd,_0x203f32);break;default:console[_0x668e('0x1a')](_0x668e('0x1f'));}}else{_0x3a6822=require(_0x668e('0x20'))(_0x5d4d6b[_0x668e('0x13')][_0x668e('0x14')]());_0x3a6822['error'](_0x668e('0x21'),util['format'](_0x668e('0x22'),_0x5d4d6b['data1']['toLowerCase'](),_0x5d4d6b[_0x668e('0x17')]));}}else{_0x3a6822=require('../../../../config/logger')(_0x5d4d6b[_0x668e('0x13')][_0x668e('0x14')]());_0x3a6822['error'](_0x668e('0x21'),util[_0x668e('0x23')](_0x668e('0x24'),_0x5d4d6b[_0x668e('0x13')][_0x668e('0x14')](),_0x5d4d6b['data2']));}}else{}}catch(_0x2046e7){console[_0x668e('0x25')](_0x2046e7);}}}}; \ 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 be81601..0161bb4 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 _0x21ba=['newTab','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','ioredis','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','socket.io-emitter','emit','getString','Subjects','Descriptions','ticketType','Task','utc','IsRecurrence','endUserType','lead','WhoId','WhatId','Case','contact','ContactId','account','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','then','length','find','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','$or','execute','additionalSearchLead','merge','Lead','account_contact_lead','Account','Contact','additionalSearchAccount','Phone','attributes','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','format','Caller\x20-\x20%s','No\x20Company','upperFirst','forEach','includes','picklist','idField','content','toString','variable','variableName','Variable','name','toLowerCase','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','integrationTab','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.'];(function(_0x595b9b,_0xa58ff){var _0x3be4c6=function(_0x324f94){while(--_0x324f94){_0x595b9b['push'](_0x595b9b['shift']());}};_0x3be4c6(++_0xa58ff);}(_0x21ba,0x181));var _0xa21b=function(_0x6ceb79,_0x5e4f72){_0x6ceb79=_0x6ceb79-0x0;var _0x2187c0=_0x21ba[_0x6ceb79];return _0x2187c0;};'use strict';var _=require(_0xa21b('0x0'));var rp=require(_0xa21b('0x1'));var moment=require(_0xa21b('0x2'));var BPromise=require(_0xa21b('0x3'));var md5=require(_0xa21b('0x4'));var jsforce=require(_0xa21b('0x5'));var util=require('util');var Redis=require(_0xa21b('0x6'));var intUtil=require('./util');var config=require(_0xa21b('0x7'));var logger=require(_0xa21b('0x8'))(_0xa21b('0x9'));config[_0xa21b('0xa')]=_[_0xa21b('0xb')](config[_0xa21b('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0xa21b('0xc'))(new Redis(config[_0xa21b('0xa')]));function emit(_0x178247,_0xcdee0e,_0x1a3c71){io['to'](_0x178247)[_0xa21b('0xd')](_0xcdee0e,_0x1a3c71);}function getTicket(_0x29e229,_0xf7a5b7,_0x2fe2c2,_0x3bb30f,_0xf8a815,_0x3fef42,_0xa34057,_0x1ca3a5){var _0x225ea7=Object['assign']({},{'OwnerId':_0xf7a5b7['id'],'Subject':intUtil[_0xa21b('0xe')](_0x3bb30f[_0xa21b('0xf')],_0xf8a815,'\x20'),'Description':intUtil[_0xa21b('0xe')](_0x3bb30f[_0xa21b('0x10')],_0xf8a815,'\x0a')},getCustomFields(_0x3fef42,_0xf8a815));if(_0x2fe2c2){if(_0x3bb30f[_0xa21b('0x11')]===_0xa21b('0x12')){_0x225ea7['ActivityDate']=moment[_0xa21b('0x13')]();_0x225ea7['IsReminderSet']=![];_0x225ea7[_0xa21b('0x14')]=![];if(_0x2fe2c2[_0xa21b('0x15')]==='contact'||_0x2fe2c2[_0xa21b('0x15')]===_0xa21b('0x16')){_0x225ea7[_0xa21b('0x17')]=_0x2fe2c2['id'];}else if(_0x2fe2c2[_0xa21b('0x15')]==='account'){_0x225ea7[_0xa21b('0x18')]=_0x2fe2c2['id'];}}else if(_0x3bb30f[_0xa21b('0x11')]===_0xa21b('0x19')){if(_0x2fe2c2[_0xa21b('0x15')]===_0xa21b('0x1a')){_0x225ea7[_0xa21b('0x1b')]=_0x2fe2c2['id'];}else if(_0x2fe2c2[_0xa21b('0x15')]===_0xa21b('0x1c')){_0x225ea7[_0xa21b('0x1d')]=_0x2fe2c2['id'];}else if(_0x2fe2c2[_0xa21b('0x15')]===_0xa21b('0x16')&&_0x3bb30f['leadId']){_0x225ea7[_0x3bb30f[_0xa21b('0x1e')]]=_0x2fe2c2['id'];}else{logger[_0xa21b('0x1f')](_0xa21b('0x20'));}}}return _0xa34057[_0xa21b('0x21')](_0x3bb30f[_0xa21b('0x11')])[_0xa21b('0x22')](_0x225ea7);}function getUser(_0x1a7f9c,_0x408b55,_0x31abcf){if(!_[_0xa21b('0x23')](_0x408b55)&&intUtil[_0xa21b('0x24')](_0x408b55)){var _0x1fc144={'Email':_0x408b55};var _0x49850b={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x31abcf[_0xa21b('0x21')](_0xa21b('0x25'))['find'](_0x1fc144,_0x49850b)['execute']()[_0xa21b('0x26')](function(_0x186b1d){if(_0x186b1d[_0xa21b('0x27')]){var _0x3a9437=_[_0xa21b('0x28')](_0x186b1d,function(_0x4737f6){return _0x4737f6[_0xa21b('0x29')]===_0x408b55;});if(_0x3a9437){logger['info'](_0xa21b('0x2a'),_0x408b55);return BPromise[_0xa21b('0x2b')]({'id':_0x3a9437['Id'],'name':_0x3a9437[_0xa21b('0x2c')]});}}else{logger[_0xa21b('0x1f')](_0xa21b('0x2d'),_0x408b55);return _0x31abcf[_0xa21b('0x2e')]()['then'](function(_0x34a40b){return BPromise['resolve']({'id':_0x34a40b[_0xa21b('0x2f')],'name':_0x34a40b[_0xa21b('0x30')]});});}});}else{logger['info'](_0xa21b('0x2d'),_0x408b55);return _0x31abcf[_0xa21b('0x2e')]()[_0xa21b('0x26')](function(_0x299cdf){return BPromise['resolve']({'id':_0x299cdf[_0xa21b('0x2f')],'name':_0x299cdf[_0xa21b('0x30')]});});}}function getEndUser(_0x310d6a,_0x1ac36d,_0xe194b8,_0x37175b,_0x2a54c7){var _0x473e69={'$or':{'Phone':_0x37175b}};var _0x1ba887={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xa21b('0x2b')]()[_0xa21b('0x26')](function(){logger[_0xa21b('0x1f')](_0xa21b('0x31'),_0x37175b,_0x1ac36d[_0xa21b('0x32')]);switch(_0x1ac36d[_0xa21b('0x32')]){case _0xa21b('0x33'):var _0x5b46bb=_[_0xa21b('0x34')](_0x473e69);if(_0x1ac36d[_0xa21b('0x35')]){var _0x3f4c23={};_0x3f4c23[_0x1ac36d[_0xa21b('0x35')]]=_0x37175b;_['merge'](_0x5b46bb[_0xa21b('0x36')],_0x3f4c23);}return _0x2a54c7[_0xa21b('0x21')]('Contact')[_0xa21b('0x28')](_0x5b46bb,_0x1ba887)[_0xa21b('0x37')]()[_0xa21b('0x26')](function(_0x292a92){if(_0x292a92&&_0x292a92[_0xa21b('0x27')]){return _0x292a92;}else{var _0x168d8e=_[_0xa21b('0x34')](_0x473e69);if(_0x1ac36d['additionalSearchLead']){var _0x33d626={};_0x33d626[_0x1ac36d[_0xa21b('0x38')]]=_0x37175b;_[_0xa21b('0x39')](_0x168d8e['$or'],_0x33d626);}return _0x2a54c7[_0xa21b('0x21')](_0xa21b('0x3a'))[_0xa21b('0x28')](_0x168d8e,_0x1ba887);}});case _0xa21b('0x3b'):var _0x8ea93a=_[_0xa21b('0x34')](_0x473e69);if(_0x1ac36d['additionalSearchAccount']){var _0x3f4c23={};_0x3f4c23[_0x1ac36d['additionalSearchAccount']]=_0x37175b;_[_0xa21b('0x39')](_0x8ea93a['$or'],_0x3f4c23);}return _0x2a54c7[_0xa21b('0x21')](_0xa21b('0x3c'))['find'](_0x8ea93a,_0x1ba887)[_0xa21b('0x37')]()[_0xa21b('0x26')](function(_0xed3c16){if(_0xed3c16&&_0xed3c16[_0xa21b('0x27')]){return _0xed3c16;}else{var _0x38356c=_[_0xa21b('0x34')](_0x473e69);if(_0x1ac36d[_0xa21b('0x35')]){var _0x1d5e8e={};_0x1d5e8e[_0x1ac36d[_0xa21b('0x35')]]=_0x37175b;_[_0xa21b('0x39')](_0x38356c[_0xa21b('0x36')],_0x1d5e8e);}return _0x2a54c7[_0xa21b('0x21')](_0xa21b('0x3d'))[_0xa21b('0x28')](_0x38356c,_0x1ba887)[_0xa21b('0x26')](function(_0x939452){if(_0x939452&&_0x939452['length']){return _0x939452;}else{var _0x44aa97=_[_0xa21b('0x34')](_0x473e69);if(_0x1ac36d[_0xa21b('0x38')]){var _0xa44fca={};_0xa44fca[_0x1ac36d[_0xa21b('0x38')]]=_0x37175b;_[_0xa21b('0x39')](_0x44aa97[_0xa21b('0x36')],_0xa44fca);}return _0x2a54c7['sobject'](_0xa21b('0x3a'))[_0xa21b('0x28')](_0x44aa97,_0x1ba887);}});}});case _0xa21b('0x1a'):var _0x5b46bb=_[_0xa21b('0x34')](_0x473e69);if(_0x1ac36d['additionalSearchContact']){var _0x3f4c23={};_0x3f4c23[_0x1ac36d['additionalSearchContact']]=_0x37175b;_[_0xa21b('0x39')](_0x5b46bb['$or'],_0x3f4c23);}return _0x2a54c7[_0xa21b('0x21')](_0xa21b('0x3d'))[_0xa21b('0x28')](_0x5b46bb,_0x1ba887)[_0xa21b('0x37')]();case _0xa21b('0x16'):var _0xc773f3=_[_0xa21b('0x34')](_0x473e69);if(_0x1ac36d['additionalSearchLead']){var _0x3f4c23={};_0x3f4c23[_0x1ac36d[_0xa21b('0x38')]]=_0x37175b;_[_0xa21b('0x39')](_0xc773f3[_0xa21b('0x36')],_0x3f4c23);}return _0x2a54c7['sobject'](_0xa21b('0x3a'))[_0xa21b('0x28')](_0xc773f3,_0x1ba887);case _0xa21b('0x1c'):var _0x8ea93a=_[_0xa21b('0x34')](_0x473e69);if(_0x1ac36d['additionalSearchAccount']){var _0x3f4c23={};_0x3f4c23[_0x1ac36d[_0xa21b('0x3e')]]=_0x37175b;_[_0xa21b('0x39')](_0x8ea93a[_0xa21b('0x36')],_0x3f4c23);}return _0x2a54c7[_0xa21b('0x21')](_0xa21b('0x3c'))[_0xa21b('0x28')](_0x8ea93a,_0x1ba887);default:return null;}})[_0xa21b('0x26')](function(_0x16db05){if(_0x16db05&&_0x16db05[_0xa21b('0x27')]){var _0x1281e8=_['first'](_0x16db05);if(_0x1281e8){return BPromise[_0xa21b('0x2b')]({'id':_0x1281e8['Id'],'name':_0x1281e8['Name'],'phone':_0x1281e8[_0xa21b('0x3f')],'endUserType':_0x1281e8[_0xa21b('0x40')][_0xa21b('0x41')]['toLowerCase']()});}}})[_0xa21b('0x26')](function(_0x5e9305){if(_0x5e9305){logger['info'](_0xa21b('0x42'),_0x5e9305[_0xa21b('0x15')],_0x37175b);return BPromise['resolve'](_0x5e9305);}else{logger[_0xa21b('0x1f')](_0xa21b('0x43'),_0x37175b);var _0x379b54={'Phone':_0x37175b};if(_0x1ac36d[_0xa21b('0x44')]){if(_0x1ac36d[_0xa21b('0x44')]===_0xa21b('0x1a')){logger[_0xa21b('0x1f')](_0xa21b('0x45'),_0x37175b,_0x1ac36d[_0xa21b('0x44')]);_0x379b54['LastName']=_0xe194b8!==_0xa21b('0x46')?_0xe194b8:util[_0xa21b('0x47')](_0xa21b('0x48'),_0x37175b);}else if(_0x1ac36d[_0xa21b('0x44')]===_0xa21b('0x16')){logger[_0xa21b('0x1f')](_0xa21b('0x45'),_0x37175b,_0x1ac36d[_0xa21b('0x44')]);_0x379b54['LastName']=_0xe194b8!==_0xa21b('0x46')?_0xe194b8:util[_0xa21b('0x47')](_0xa21b('0x48'),_0x37175b);_0x379b54['Company']=_0xa21b('0x49');}else if(_0x1ac36d[_0xa21b('0x44')]===_0xa21b('0x1c')){logger['info'](_0xa21b('0x45'),_0x37175b,_0x1ac36d[_0xa21b('0x44')]);_0x379b54[_0xa21b('0x2c')]=_0xe194b8!==''?_0xe194b8:util[_0xa21b('0x47')](_0xa21b('0x48'),_0x37175b);}else{return null;}}return _0x2a54c7['sobject'](_[_0xa21b('0x4a')](_0x1ac36d[_0xa21b('0x44')]))[_0xa21b('0x22')](_0x379b54)[_0xa21b('0x26')](function(_0x16ca50){return BPromise[_0xa21b('0x2b')]({'id':_0x16ca50['id'],'endUserType':_0x1ac36d['moduleCreate']});});}});}function getCustomFields(_0x52c93b,_0x40ca21){var _0x20a28b={};if(_0x52c93b[_0xa21b('0x27')]>0x0){_[_0xa21b('0x4b')](_0x52c93b,function(_0x226f7c){if(_[_0xa21b('0x4c')](['string',_0xa21b('0x4d')],_0x226f7c[_0xa21b('0x41')])&&_0x226f7c[_0xa21b('0x4e')]){_0x20a28b[_0x226f7c[_0xa21b('0x4e')]]=_0x226f7c[_0xa21b('0x4f')][_0xa21b('0x50')]();}else if(_0x226f7c[_0xa21b('0x41')]===_0xa21b('0x51')&&_0x226f7c[_0xa21b('0x52')]&&_0x226f7c[_0xa21b('0x4e')]){_0x40ca21[_0x226f7c[_0xa21b('0x52')]]&&(_0x20a28b[_0x226f7c[_0xa21b('0x4e')]]=_0x40ca21[_0x226f7c[_0xa21b('0x52')]]['toString']());}else if(_0x226f7c[_0xa21b('0x41')]==='customVariable'&&_0x226f7c['Variable']&&_0x226f7c[_0xa21b('0x53')][_0xa21b('0x54')]&&_0x226f7c[_0xa21b('0x4e')]){_0x40ca21[_0x226f7c[_0xa21b('0x53')][_0xa21b('0x54')][_0xa21b('0x55')]()]&&(_0x20a28b[_0x226f7c[_0xa21b('0x4e')]]=_0x40ca21[_0x226f7c['Variable'][_0xa21b('0x54')]['toLowerCase']()][_0xa21b('0x50')]());}});}return _0x20a28b;}function getConnection(_0x3e89d0){var _0x21d55f=_0x3e89d0[_0xa21b('0x56')][_0xa21b('0x57')](_0x3e89d0[_0xa21b('0x58')]);var _0x190fbc=new jsforce[(_0xa21b('0x59'))]({'oauth2':{'loginUrl':_0x3e89d0[_0xa21b('0x5a')]||_0xa21b('0x5b'),'clientId':_0x3e89d0['clientId'],'clientSecret':_0x3e89d0['clientSecret']}});return _0x190fbc['login'](_0x3e89d0['username'],_0x21d55f)[_0xa21b('0x26')](function(){logger['info']('Connection\x20established.');return _0x190fbc;});}exports[_0xa21b('0x5c')]=function(_0x1e6b17,_0x50179e,_0x438f17,_0x882152,_0x706ca3,_0x5b9792){var _0x387b09,_0x29a53b,_0x3f29ab,_0x362c47;_0x5b9792[_0xa21b('0x5d')]=intUtil['stripTrailingSlash'](_0x5b9792['serverUrl']);_0x5b9792[_0xa21b('0x5a')]=intUtil[_0xa21b('0x5e')](_0x5b9792[_0xa21b('0x5a')]);if(_0x706ca3&&_0x706ca3[_0xa21b('0x5f')]){logger[_0xa21b('0x1f')](_0xa21b('0x60'),'Recording\x20is\x20enabled!');_0x50179e[_0xa21b('0x61')]=util[_0xa21b('0x47')](_0xa21b('0x62'),_0x5b9792['serverUrl'],_0x50179e[_0xa21b('0x63')],md5(_0x50179e['uniqueid']));}else{_0x50179e[_0xa21b('0x61')]='';}return getConnection(_0x5b9792)['then'](function(_0x49fa80){_0x362c47=_0x49fa80;return getUser(_0x5b9792,_0x882152[_0xa21b('0x64')],_0x362c47);})[_0xa21b('0x26')](function(_0x5a7aec){_0x387b09=_0x5a7aec;return getEndUser(_0x5b9792,_0x438f17,_0x50179e[_0xa21b('0x65')],_0x50179e[_0xa21b('0x66')],_0x362c47);})[_0xa21b('0x26')](function(_0xca4e47){_0x29a53b=_0xca4e47;return getTicket(_0x5b9792,_0x387b09,_0x29a53b,_0x438f17,_0x50179e,_0x438f17[_0xa21b('0x67')],_0x362c47,_0xa21b('0x5c'));})[_0xa21b('0x26')](function(_0x2b3a22){_0x3f29ab=_0x2b3a22;logger[_0xa21b('0x1f')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x3f29ab['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x3f29ab['id'],_0x882152[_0xa21b('0x54')],_0x5b9792[_0xa21b('0x41')]);switch(_0x5b9792['type']){case _0xa21b('0x68'):emit(util[_0xa21b('0x47')](_0xa21b('0x69'),_0x882152[_0xa21b('0x54')]),_0xa21b('0x6a'),{'recordId':_0x3f29ab['id']});break;case'newTab':emit(util['format'](_0xa21b('0x69'),_0x882152[_0xa21b('0x54')]),_0xa21b('0x6b'),{'uri':util[_0xa21b('0x47')](_0xa21b('0x6c'),_0x362c47[_0xa21b('0x6d')],_0x3f29ab['id'])});break;default:logger[_0xa21b('0x6e')](_0xa21b('0x6f'));}})[_0xa21b('0x70')](function(_0x48579f){logger[_0xa21b('0x6e')](_0xa21b('0x60'),_0x48579f);});};exports[_0xa21b('0x71')]=function(_0x3c8b04,_0x1933b2,_0x31513d,_0x1eb7ec,_0x42ddeb,_0x2e7ab0,_0x2e5c77){var _0x232f66,_0x1bbc5e,_0x4dd144,_0x5af1d8;_0x2e7ab0['serverUrl']=intUtil[_0xa21b('0x5e')](_0x2e7ab0[_0xa21b('0x5d')]);_0x2e7ab0[_0xa21b('0x5a')]=intUtil[_0xa21b('0x5e')](_0x2e7ab0[_0xa21b('0x5a')]);if(_0x2e5c77&&_0x2e5c77[_0xa21b('0x72')]&&_0x2e5c77[_0xa21b('0x72')]!=='none'){logger[_0xa21b('0x1f')](_0xa21b('0x73'),_0xa21b('0x74'));_0x1933b2[_0xa21b('0x61')]=util[_0xa21b('0x47')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2e7ab0[_0xa21b('0x5d')],_0x1933b2['uniqueid'],md5(_0x1933b2[_0xa21b('0x63')]));}return getConnection(_0x2e7ab0)[_0xa21b('0x26')](function(_0x511709){_0x5af1d8=_0x511709;return getUser(_0x2e7ab0,_0x1eb7ec[_0xa21b('0x64')],_0x5af1d8);})[_0xa21b('0x26')](function(_0x20c27f){_0x232f66=_0x20c27f;return getEndUser(_0x2e7ab0,_0x31513d,_0x1933b2['destcalleridname'],_0x1933b2[_0xa21b('0x75')],_0x5af1d8);})[_0xa21b('0x26')](function(_0x4cf8b6){_0x1bbc5e=_0x4cf8b6;return getTicket(_0x2e7ab0,_0x232f66,_0x1bbc5e,_0x31513d,_0x1933b2,_0x31513d[_0xa21b('0x67')],_0x5af1d8,_0xa21b('0x71'));})[_0xa21b('0x26')](function(_0x42593c){_0x4dd144=_0x42593c;logger[_0xa21b('0x1f')](_0xa21b('0x76'),_0x4dd144['id']);logger[_0xa21b('0x1f')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x4dd144['id'],_0x1eb7ec[_0xa21b('0x54')],_0x2e7ab0['type']);switch(_0x2e7ab0[_0xa21b('0x41')]){case _0xa21b('0x68'):emit(util[_0xa21b('0x47')](_0xa21b('0x69'),_0x1eb7ec[_0xa21b('0x54')]),'trigger:salesforce:display',{'recordId':_0x4dd144['id']});break;case _0xa21b('0x77'):emit(util['format']('user:%s',_0x1eb7ec[_0xa21b('0x54')]),_0xa21b('0x6b'),{'uri':util[_0xa21b('0x47')](_0xa21b('0x6c'),_0x5af1d8[_0xa21b('0x6d')],_0x4dd144['id'])});break;default:logger['error']('[OUTBOUND]',_0xa21b('0x78'));}})[_0xa21b('0x70')](function(_0x339f0c){logger[_0xa21b('0x6e')](_0xa21b('0x73'),_0x339f0c);});};exports[_0xa21b('0x79')]=function(_0x2dfc1e,_0x541d36,_0x1d5d4b,_0x27e85f,_0x584455,_0x2bd02d){var _0x1fcbf0,_0x3ffb6f,_0x5fa02b,_0xfdb7b7;_0x2bd02d[_0xa21b('0x5d')]=intUtil[_0xa21b('0x5e')](_0x2bd02d[_0xa21b('0x5d')]);_0x2bd02d[_0xa21b('0x5a')]=intUtil[_0xa21b('0x5e')](_0x2bd02d['remoteUri']);if(_0x584455&&_0x584455['monitor_format']){logger[_0xa21b('0x1f')]('['+_0x541d36[_0xa21b('0x7a')][_0xa21b('0x7b')]()+']',_0xa21b('0x74'));_0x541d36[_0xa21b('0x61')]=util['format'](_0xa21b('0x62'),_0x2bd02d[_0xa21b('0x5d')],_0x541d36[_0xa21b('0x63')],md5(_0x541d36[_0xa21b('0x63')]));}else{_0x541d36[_0xa21b('0x61')]='';}return getConnection(_0x2bd02d)['then'](function(_0x4c8d49){_0xfdb7b7=_0x4c8d49;if(!_[_0xa21b('0x23')](_0x27e85f)){return getUser(_0x2bd02d,_0x27e85f[_0xa21b('0x54')],_0xfdb7b7);}else{return getUser(_0x2bd02d,null,_0xfdb7b7);}})[_0xa21b('0x26')](function(_0x2195b4){_0x1fcbf0=_0x2195b4;return getEndUser(_0x2bd02d,_0x1d5d4b,_0x541d36['calleridname'],_0x541d36['calleridnum'],_0xfdb7b7);})['then'](function(_0x5b9fee){_0x3ffb6f=_0x5b9fee;return getTicket(_0x2bd02d,_0x1fcbf0,_0x3ffb6f,_0x1d5d4b,_0x541d36,_0x1d5d4b['Fields'],_0xfdb7b7);})['then'](function(_0x597f80){_0x5fa02b=_0x597f80;logger[_0xa21b('0x1f')]('['+_0x541d36[_0xa21b('0x7a')][_0xa21b('0x7b')]()+_0xa21b('0x7c'),_0x5fa02b['id']);logger[_0xa21b('0x1f')]('['+_0x541d36[_0xa21b('0x7a')]['toUpperCase']()+_0xa21b('0x7d'),_0x2bd02d['type']);})['catch'](function(_0x564e92){logger[_0xa21b('0x6e')]('['+_0x541d36[_0xa21b('0x7a')][_0xa21b('0x7b')]()+']',_0x564e92);});}; \ No newline at end of file +var _0x2eaa=['resolve','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','then','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','first','Name','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','format','Caller\x20-\x20%s','','No\x20Company','upperFirst','forEach','includes','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','password','concat','Connection','https://login.salesforce.com','clientId','clientSecret','login','username','queue','serverUrl','remoteUri','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridname','calleridnum','Fields','integrationTab','user:%s','newTab','trigger:browser:url','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','instanceUrl','error','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/logger','salesforce','redis','defaults','localhost','emit','assign','getString','Subjects','Descriptions','ticketType','ActivityDate','IsReminderSet','endUserType','WhoId','account','WhatId','Case','contact','ContactId','AccountId','lead','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','execute','length','Email','Agent\x20%s\x20found.'];(function(_0x39ade2,_0x471273){var _0xde9e20=function(_0x174338){while(--_0x174338){_0x39ade2['push'](_0x39ade2['shift']());}};_0xde9e20(++_0x471273);}(_0x2eaa,0x164));var _0xa2ea=function(_0x34862b,_0x4f69a7){_0x34862b=_0x34862b-0x0;var _0x15c76=_0x2eaa[_0x34862b];return _0x15c76;};'use strict';var _=require(_0xa2ea('0x0'));var rp=require('request-promise');var moment=require(_0xa2ea('0x1'));var BPromise=require(_0xa2ea('0x2'));var md5=require(_0xa2ea('0x3'));var jsforce=require(_0xa2ea('0x4'));var util=require(_0xa2ea('0x5'));var Redis=require(_0xa2ea('0x6'));var intUtil=require(_0xa2ea('0x7'));var config=require('../../../../config/environment');var logger=require(_0xa2ea('0x8'))(_0xa2ea('0x9'));config[_0xa2ea('0xa')]=_[_0xa2ea('0xb')](config[_0xa2ea('0xa')],{'host':_0xa2ea('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa2ea('0xa')]));function emit(_0x47bcc3,_0x15c1a3,_0xfd210f){io['to'](_0x47bcc3)[_0xa2ea('0xd')](_0x15c1a3,_0xfd210f);}function getTicket(_0x4b72cb,_0x31b252,_0x51f6da,_0x58bad1,_0x53979e,_0x3bce2b,_0x40c652,_0x1eb9ad){var _0x43589f=Object[_0xa2ea('0xe')]({},{'OwnerId':_0x31b252['id'],'Subject':intUtil[_0xa2ea('0xf')](_0x58bad1[_0xa2ea('0x10')],_0x53979e,'\x20'),'Description':intUtil[_0xa2ea('0xf')](_0x58bad1[_0xa2ea('0x11')],_0x53979e,'\x0a')},getCustomFields(_0x3bce2b,_0x53979e));if(_0x51f6da){if(_0x58bad1[_0xa2ea('0x12')]==='Task'){_0x43589f[_0xa2ea('0x13')]=moment['utc']();_0x43589f[_0xa2ea('0x14')]=![];_0x43589f['IsRecurrence']=![];if(_0x51f6da['endUserType']==='contact'||_0x51f6da[_0xa2ea('0x15')]==='lead'){_0x43589f[_0xa2ea('0x16')]=_0x51f6da['id'];}else if(_0x51f6da[_0xa2ea('0x15')]===_0xa2ea('0x17')){_0x43589f[_0xa2ea('0x18')]=_0x51f6da['id'];}}else if(_0x58bad1[_0xa2ea('0x12')]===_0xa2ea('0x19')){if(_0x51f6da[_0xa2ea('0x15')]===_0xa2ea('0x1a')){_0x43589f[_0xa2ea('0x1b')]=_0x51f6da['id'];}else if(_0x51f6da[_0xa2ea('0x15')]===_0xa2ea('0x17')){_0x43589f[_0xa2ea('0x1c')]=_0x51f6da['id'];}else if(_0x51f6da[_0xa2ea('0x15')]===_0xa2ea('0x1d')&&_0x58bad1[_0xa2ea('0x1e')]){_0x43589f[_0x58bad1[_0xa2ea('0x1e')]]=_0x51f6da['id'];}else{logger[_0xa2ea('0x1f')](_0xa2ea('0x20'));}}}return _0x40c652[_0xa2ea('0x21')](_0x58bad1[_0xa2ea('0x12')])[_0xa2ea('0x22')](_0x43589f);}function getUser(_0xb0b3b2,_0x3a779d,_0x3085f6){if(!_[_0xa2ea('0x23')](_0x3a779d)&&intUtil[_0xa2ea('0x24')](_0x3a779d)){var _0x20ee1f={'Email':_0x3a779d};var _0x36eece={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3085f6[_0xa2ea('0x21')](_0xa2ea('0x25'))[_0xa2ea('0x26')](_0x20ee1f,_0x36eece)[_0xa2ea('0x27')]()['then'](function(_0x4ec032){if(_0x4ec032[_0xa2ea('0x28')]){var _0xd4032e=_[_0xa2ea('0x26')](_0x4ec032,function(_0x4c1ffe){return _0x4c1ffe[_0xa2ea('0x29')]===_0x3a779d;});if(_0xd4032e){logger['info'](_0xa2ea('0x2a'),_0x3a779d);return BPromise[_0xa2ea('0x2b')]({'id':_0xd4032e['Id'],'name':_0xd4032e['Name']});}}else{logger[_0xa2ea('0x1f')](_0xa2ea('0x2c'),_0x3a779d);return _0x3085f6[_0xa2ea('0x2d')]()[_0xa2ea('0x2e')](function(_0x3c54f1){return BPromise[_0xa2ea('0x2b')]({'id':_0x3c54f1[_0xa2ea('0x2f')],'name':_0x3c54f1[_0xa2ea('0x30')]});});}});}else{logger[_0xa2ea('0x1f')](_0xa2ea('0x2c'),_0x3a779d);return _0x3085f6[_0xa2ea('0x2d')]()[_0xa2ea('0x2e')](function(_0x1ed64d){return BPromise[_0xa2ea('0x2b')]({'id':_0x1ed64d[_0xa2ea('0x2f')],'name':_0x1ed64d[_0xa2ea('0x30')]});});}}function getEndUser(_0x356d84,_0x4f33dd,_0x645d86,_0x5bef15,_0x22a32a){var _0x44afd9={'$or':{'Phone':_0x5bef15}};var _0x59db35={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xa2ea('0x2b')]()[_0xa2ea('0x2e')](function(){logger[_0xa2ea('0x1f')](_0xa2ea('0x31'),_0x5bef15,_0x4f33dd[_0xa2ea('0x32')]);switch(_0x4f33dd[_0xa2ea('0x32')]){case _0xa2ea('0x33'):var _0x4c560c=_[_0xa2ea('0x34')](_0x44afd9);if(_0x4f33dd[_0xa2ea('0x35')]){var _0x5575b6={};_0x5575b6[_0x4f33dd[_0xa2ea('0x35')]]=_0x5bef15;_[_0xa2ea('0x36')](_0x4c560c[_0xa2ea('0x37')],_0x5575b6);}return _0x22a32a['sobject'](_0xa2ea('0x38'))[_0xa2ea('0x26')](_0x4c560c,_0x59db35)[_0xa2ea('0x27')]()[_0xa2ea('0x2e')](function(_0x51e089){if(_0x51e089&&_0x51e089['length']){return _0x51e089;}else{var _0x3ecb8b=_['cloneDeep'](_0x44afd9);if(_0x4f33dd[_0xa2ea('0x39')]){var _0x223f36={};_0x223f36[_0x4f33dd['additionalSearchLead']]=_0x5bef15;_[_0xa2ea('0x36')](_0x3ecb8b['$or'],_0x223f36);}return _0x22a32a[_0xa2ea('0x21')](_0xa2ea('0x3a'))[_0xa2ea('0x26')](_0x3ecb8b,_0x59db35);}});case _0xa2ea('0x3b'):var _0x80cc36=_['cloneDeep'](_0x44afd9);if(_0x4f33dd[_0xa2ea('0x3c')]){var _0x5575b6={};_0x5575b6[_0x4f33dd[_0xa2ea('0x3c')]]=_0x5bef15;_[_0xa2ea('0x36')](_0x80cc36[_0xa2ea('0x37')],_0x5575b6);}return _0x22a32a[_0xa2ea('0x21')](_0xa2ea('0x3d'))[_0xa2ea('0x26')](_0x80cc36,_0x59db35)[_0xa2ea('0x27')]()[_0xa2ea('0x2e')](function(_0x415f61){if(_0x415f61&&_0x415f61[_0xa2ea('0x28')]){return _0x415f61;}else{var _0x14a146=_[_0xa2ea('0x34')](_0x44afd9);if(_0x4f33dd[_0xa2ea('0x35')]){var _0x39588d={};_0x39588d[_0x4f33dd[_0xa2ea('0x35')]]=_0x5bef15;_['merge'](_0x14a146[_0xa2ea('0x37')],_0x39588d);}return _0x22a32a['sobject']('Contact')[_0xa2ea('0x26')](_0x14a146,_0x59db35)['then'](function(_0x13ffd0){if(_0x13ffd0&&_0x13ffd0[_0xa2ea('0x28')]){return _0x13ffd0;}else{var _0x265ed8=_[_0xa2ea('0x34')](_0x44afd9);if(_0x4f33dd['additionalSearchLead']){var _0x542507={};_0x542507[_0x4f33dd['additionalSearchLead']]=_0x5bef15;_[_0xa2ea('0x36')](_0x265ed8[_0xa2ea('0x37')],_0x542507);}return _0x22a32a[_0xa2ea('0x21')](_0xa2ea('0x3a'))['find'](_0x265ed8,_0x59db35);}});}});case _0xa2ea('0x1a'):var _0x4c560c=_[_0xa2ea('0x34')](_0x44afd9);if(_0x4f33dd[_0xa2ea('0x35')]){var _0x5575b6={};_0x5575b6[_0x4f33dd[_0xa2ea('0x35')]]=_0x5bef15;_[_0xa2ea('0x36')](_0x4c560c['$or'],_0x5575b6);}return _0x22a32a[_0xa2ea('0x21')](_0xa2ea('0x38'))[_0xa2ea('0x26')](_0x4c560c,_0x59db35)[_0xa2ea('0x27')]();case'lead':var _0x11b2f6=_[_0xa2ea('0x34')](_0x44afd9);if(_0x4f33dd['additionalSearchLead']){var _0x5575b6={};_0x5575b6[_0x4f33dd[_0xa2ea('0x39')]]=_0x5bef15;_[_0xa2ea('0x36')](_0x11b2f6[_0xa2ea('0x37')],_0x5575b6);}return _0x22a32a[_0xa2ea('0x21')](_0xa2ea('0x3a'))[_0xa2ea('0x26')](_0x11b2f6,_0x59db35);case _0xa2ea('0x17'):var _0x80cc36=_[_0xa2ea('0x34')](_0x44afd9);if(_0x4f33dd[_0xa2ea('0x3c')]){var _0x5575b6={};_0x5575b6[_0x4f33dd[_0xa2ea('0x3c')]]=_0x5bef15;_['merge'](_0x80cc36[_0xa2ea('0x37')],_0x5575b6);}return _0x22a32a[_0xa2ea('0x21')](_0xa2ea('0x3d'))['find'](_0x80cc36,_0x59db35);default:return null;}})[_0xa2ea('0x2e')](function(_0x2ecd7c){if(_0x2ecd7c&&_0x2ecd7c[_0xa2ea('0x28')]){var _0x5b3ee0=_[_0xa2ea('0x3e')](_0x2ecd7c);if(_0x5b3ee0){return BPromise[_0xa2ea('0x2b')]({'id':_0x5b3ee0['Id'],'name':_0x5b3ee0[_0xa2ea('0x3f')],'phone':_0x5b3ee0[_0xa2ea('0x40')],'endUserType':_0x5b3ee0[_0xa2ea('0x41')][_0xa2ea('0x42')][_0xa2ea('0x43')]()});}}})[_0xa2ea('0x2e')](function(_0x275d36){if(_0x275d36){logger['info'](_0xa2ea('0x44'),_0x275d36[_0xa2ea('0x15')],_0x5bef15);return BPromise[_0xa2ea('0x2b')](_0x275d36);}else{logger['info'](_0xa2ea('0x45'),_0x5bef15);var _0x29d7ed={'Phone':_0x5bef15};if(_0x4f33dd[_0xa2ea('0x46')]){if(_0x4f33dd['moduleCreate']==='contact'){logger[_0xa2ea('0x1f')](_0xa2ea('0x47'),_0x5bef15,_0x4f33dd['moduleCreate']);_0x29d7ed[_0xa2ea('0x48')]=_0x645d86!==''?_0x645d86:util[_0xa2ea('0x49')](_0xa2ea('0x4a'),_0x5bef15);}else if(_0x4f33dd[_0xa2ea('0x46')]==='lead'){logger[_0xa2ea('0x1f')](_0xa2ea('0x47'),_0x5bef15,_0x4f33dd[_0xa2ea('0x46')]);_0x29d7ed[_0xa2ea('0x48')]=_0x645d86!==_0xa2ea('0x4b')?_0x645d86:util[_0xa2ea('0x49')](_0xa2ea('0x4a'),_0x5bef15);_0x29d7ed['Company']=_0xa2ea('0x4c');}else if(_0x4f33dd[_0xa2ea('0x46')]===_0xa2ea('0x17')){logger[_0xa2ea('0x1f')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x5bef15,_0x4f33dd['moduleCreate']);_0x29d7ed[_0xa2ea('0x3f')]=_0x645d86!==_0xa2ea('0x4b')?_0x645d86:util[_0xa2ea('0x49')](_0xa2ea('0x4a'),_0x5bef15);}else{return null;}}return _0x22a32a['sobject'](_[_0xa2ea('0x4d')](_0x4f33dd[_0xa2ea('0x46')]))[_0xa2ea('0x22')](_0x29d7ed)[_0xa2ea('0x2e')](function(_0x4f9caa){return BPromise[_0xa2ea('0x2b')]({'id':_0x4f9caa['id'],'endUserType':_0x4f33dd['moduleCreate']});});}});}function getCustomFields(_0x2b0904,_0x16319c){var _0x34d613={};if(_0x2b0904['length']>0x0){_[_0xa2ea('0x4e')](_0x2b0904,function(_0x47e436){if(_[_0xa2ea('0x4f')]([_0xa2ea('0x50'),_0xa2ea('0x51')],_0x47e436[_0xa2ea('0x42')])&&_0x47e436[_0xa2ea('0x52')]){_0x34d613[_0x47e436[_0xa2ea('0x52')]]=_0x47e436[_0xa2ea('0x53')][_0xa2ea('0x54')]();}else if(_0x47e436[_0xa2ea('0x42')]===_0xa2ea('0x55')&&_0x47e436[_0xa2ea('0x56')]&&_0x47e436['idField']){_0x16319c[_0x47e436[_0xa2ea('0x56')]]&&(_0x34d613[_0x47e436[_0xa2ea('0x52')]]=_0x16319c[_0x47e436[_0xa2ea('0x56')]]['toString']());}else if(_0x47e436[_0xa2ea('0x42')]===_0xa2ea('0x57')&&_0x47e436[_0xa2ea('0x58')]&&_0x47e436[_0xa2ea('0x58')][_0xa2ea('0x59')]&&_0x47e436['idField']){_0x16319c[_0x47e436[_0xa2ea('0x58')][_0xa2ea('0x59')]['toLowerCase']()]&&(_0x34d613[_0x47e436[_0xa2ea('0x52')]]=_0x16319c[_0x47e436[_0xa2ea('0x58')]['name'][_0xa2ea('0x43')]()]['toString']());}});}return _0x34d613;}function getConnection(_0x59002d){var _0x1d3bef=_0x59002d[_0xa2ea('0x5a')][_0xa2ea('0x5b')](_0x59002d['securityToken']);var _0x2e146d=new jsforce[(_0xa2ea('0x5c'))]({'oauth2':{'loginUrl':_0x59002d['remoteUri']||_0xa2ea('0x5d'),'clientId':_0x59002d[_0xa2ea('0x5e')],'clientSecret':_0x59002d[_0xa2ea('0x5f')]}});return _0x2e146d[_0xa2ea('0x60')](_0x59002d[_0xa2ea('0x61')],_0x1d3bef)[_0xa2ea('0x2e')](function(){logger[_0xa2ea('0x1f')]('Connection\x20established.');return _0x2e146d;});}exports[_0xa2ea('0x62')]=function(_0x240f28,_0x319ad5,_0x1236eb,_0x328ef4,_0x1223cd,_0x43108b){var _0x27e8b3,_0x23d621,_0x2c165d,_0x3f1cf1;_0x43108b[_0xa2ea('0x63')]=intUtil['stripTrailingSlash'](_0x43108b[_0xa2ea('0x63')]);_0x43108b[_0xa2ea('0x64')]=intUtil[_0xa2ea('0x65')](_0x43108b[_0xa2ea('0x64')]);if(_0x1223cd&&_0x1223cd['monitor_format']){logger[_0xa2ea('0x1f')](_0xa2ea('0x66'),_0xa2ea('0x67'));_0x319ad5[_0xa2ea('0x68')]=util[_0xa2ea('0x49')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x43108b[_0xa2ea('0x63')],_0x319ad5['uniqueid'],md5(_0x319ad5[_0xa2ea('0x69')]));}else{_0x319ad5[_0xa2ea('0x68')]='';}return getConnection(_0x43108b)[_0xa2ea('0x2e')](function(_0x4ee40a){_0x3f1cf1=_0x4ee40a;return getUser(_0x43108b,_0x328ef4[_0xa2ea('0x6a')],_0x3f1cf1);})[_0xa2ea('0x2e')](function(_0x22e0aa){_0x27e8b3=_0x22e0aa;return getEndUser(_0x43108b,_0x1236eb,_0x319ad5[_0xa2ea('0x6b')],_0x319ad5[_0xa2ea('0x6c')],_0x3f1cf1);})['then'](function(_0x5b5030){_0x23d621=_0x5b5030;return getTicket(_0x43108b,_0x27e8b3,_0x23d621,_0x1236eb,_0x319ad5,_0x1236eb[_0xa2ea('0x6d')],_0x3f1cf1,_0xa2ea('0x62'));})['then'](function(_0x1f3737){_0x2c165d=_0x1f3737;logger['info']('[QUEUE]\x20Ticket\x20%s\x20created',_0x2c165d['id']);logger[_0xa2ea('0x1f')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x2c165d['id'],_0x328ef4[_0xa2ea('0x59')],_0x43108b['type']);switch(_0x43108b[_0xa2ea('0x42')]){case _0xa2ea('0x6e'):emit(util['format'](_0xa2ea('0x6f'),_0x328ef4[_0xa2ea('0x59')]),'trigger:salesforce:display',{'recordId':_0x2c165d['id']});break;case _0xa2ea('0x70'):emit(util[_0xa2ea('0x49')]('user:%s',_0x328ef4['name']),_0xa2ea('0x71'),{'uri':util[_0xa2ea('0x49')]('%s/%s/e',_0x3f1cf1['instanceUrl'],_0x2c165d['id'])});break;default:logger['error'](_0xa2ea('0x72'));}})[_0xa2ea('0x73')](function(_0x407a3b){logger['error'](_0xa2ea('0x66'),_0x407a3b);});};exports[_0xa2ea('0x74')]=function(_0x4f69e4,_0x42247f,_0x283097,_0x388ada,_0x41f872,_0x11f47d,_0x1b70d3){var _0xdf07f2,_0xad3c07,_0x3118cd,_0x2e5f9f;_0x11f47d[_0xa2ea('0x63')]=intUtil[_0xa2ea('0x65')](_0x11f47d[_0xa2ea('0x63')]);_0x11f47d[_0xa2ea('0x64')]=intUtil[_0xa2ea('0x65')](_0x11f47d[_0xa2ea('0x64')]);if(_0x1b70d3&&_0x1b70d3[_0xa2ea('0x75')]&&_0x1b70d3['recordingFormat']!=='none'){logger[_0xa2ea('0x1f')](_0xa2ea('0x76'),'Recording\x20is\x20enabled!');_0x42247f[_0xa2ea('0x68')]=util[_0xa2ea('0x49')](_0xa2ea('0x77'),_0x11f47d[_0xa2ea('0x63')],_0x42247f[_0xa2ea('0x69')],md5(_0x42247f[_0xa2ea('0x69')]));}return getConnection(_0x11f47d)[_0xa2ea('0x2e')](function(_0x17ad85){_0x2e5f9f=_0x17ad85;return getUser(_0x11f47d,_0x388ada[_0xa2ea('0x6a')],_0x2e5f9f);})[_0xa2ea('0x2e')](function(_0x56f25a){_0xdf07f2=_0x56f25a;return getEndUser(_0x11f47d,_0x283097,_0x42247f['destcalleridname'],_0x42247f[_0xa2ea('0x78')],_0x2e5f9f);})['then'](function(_0x3460be){_0xad3c07=_0x3460be;return getTicket(_0x11f47d,_0xdf07f2,_0xad3c07,_0x283097,_0x42247f,_0x283097[_0xa2ea('0x6d')],_0x2e5f9f,'outbound');})[_0xa2ea('0x2e')](function(_0x3829d7){_0x3118cd=_0x3829d7;logger[_0xa2ea('0x1f')](_0xa2ea('0x79'),_0x3118cd['id']);logger[_0xa2ea('0x1f')](_0xa2ea('0x7a'),_0x3118cd['id'],_0x388ada[_0xa2ea('0x59')],_0x11f47d['type']);switch(_0x11f47d[_0xa2ea('0x42')]){case _0xa2ea('0x6e'):emit(util[_0xa2ea('0x49')](_0xa2ea('0x6f'),_0x388ada[_0xa2ea('0x59')]),_0xa2ea('0x7b'),{'recordId':_0x3118cd['id']});break;case _0xa2ea('0x70'):emit(util[_0xa2ea('0x49')]('user:%s',_0x388ada[_0xa2ea('0x59')]),_0xa2ea('0x71'),{'uri':util[_0xa2ea('0x49')]('%s/%s/e',_0x2e5f9f[_0xa2ea('0x7c')],_0x3118cd['id'])});break;default:logger[_0xa2ea('0x7d')](_0xa2ea('0x76'),_0xa2ea('0x7e'));}})[_0xa2ea('0x73')](function(_0x3c1f0b){logger[_0xa2ea('0x7d')]('[OUTBOUND]',_0x3c1f0b);});};exports[_0xa2ea('0x7f')]=function(_0x42d672,_0x536200,_0x4f9952,_0x19880c,_0x20c6f4,_0x3ded94){var _0x3f0463,_0x1f8061,_0x570fba,_0x592beb;_0x3ded94[_0xa2ea('0x63')]=intUtil[_0xa2ea('0x65')](_0x3ded94[_0xa2ea('0x63')]);_0x3ded94[_0xa2ea('0x64')]=intUtil[_0xa2ea('0x65')](_0x3ded94['remoteUri']);if(_0x20c6f4&&_0x20c6f4[_0xa2ea('0x80')]){logger['info']('['+_0x536200[_0xa2ea('0x81')][_0xa2ea('0x82')]()+']',_0xa2ea('0x67'));_0x536200[_0xa2ea('0x68')]=util[_0xa2ea('0x49')](_0xa2ea('0x77'),_0x3ded94['serverUrl'],_0x536200['uniqueid'],md5(_0x536200[_0xa2ea('0x69')]));}else{_0x536200[_0xa2ea('0x68')]='';}return getConnection(_0x3ded94)[_0xa2ea('0x2e')](function(_0x505572){_0x592beb=_0x505572;if(!_[_0xa2ea('0x23')](_0x19880c)){return getUser(_0x3ded94,_0x19880c['name'],_0x592beb);}else{return getUser(_0x3ded94,null,_0x592beb);}})['then'](function(_0x5dfb6e){_0x3f0463=_0x5dfb6e;return getEndUser(_0x3ded94,_0x4f9952,_0x536200['calleridname'],_0x536200[_0xa2ea('0x6c')],_0x592beb);})['then'](function(_0x4e05ad){_0x1f8061=_0x4e05ad;return getTicket(_0x3ded94,_0x3f0463,_0x1f8061,_0x4f9952,_0x536200,_0x4f9952[_0xa2ea('0x6d')],_0x592beb);})['then'](function(_0x5b8f20){_0x570fba=_0x5b8f20;logger[_0xa2ea('0x1f')]('['+_0x536200[_0xa2ea('0x81')][_0xa2ea('0x82')]()+_0xa2ea('0x83'),_0x570fba['id']);logger[_0xa2ea('0x1f')]('['+_0x536200[_0xa2ea('0x81')][_0xa2ea('0x82')]()+_0xa2ea('0x84'),_0x3ded94['type']);})[_0xa2ea('0x73')](function(_0xf5b5cf){logger[_0xa2ea('0x7d')]('['+_0x536200[_0xa2ea('0x81')]['toUpperCase']()+']',_0xf5b5cf);});}; \ 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 d49d6fa..81161b5 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 _0xa267=['/nav_to.do?uri=incident.do?sys_id%3D','emit','trigger:browser:url','username','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','destcalleridnum','calleridnum','callDirection','queue','format','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','localhost','socket.io-emitter','redis','sys_user?sysparm_query=user_name%3Dadmin','then','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','length','active','true','userId','adminEmail','POST','endUserNumber','user','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','includes','type','nameField','customField','content','toString','string','picklist','idField','toLowerCase','variable','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','ticketId','forEach',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','all','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue'];(function(_0x1a89a1,_0x56d889){var _0x3d5b46=function(_0x56debf){while(--_0x56debf){_0x1a89a1['push'](_0x1a89a1['shift']());}};_0x3d5b46(++_0x56d889);}(_0xa267,0x7e));var _0x7a26=function(_0x11423d,_0x5505f0){_0x11423d=_0x11423d-0x0;var _0x63361d=_0xa267[_0x11423d];return _0x63361d;};'use strict';var _=require('lodash');var Promise=require('bluebird');var rp=require(_0x7a26('0x0'));var util=require(_0x7a26('0x1'));var md5=require('md5');var Redis=require(_0x7a26('0x2'));var intUtil=require(_0x7a26('0x3'));var config=require(_0x7a26('0x4'));var logger=require(_0x7a26('0x5'))('servicenow');config['redis']=_[_0x7a26('0x6')](config['redis'],{'host':_0x7a26('0x7'),'port':0x18eb});var io=require(_0x7a26('0x8'))(new Redis(config[_0x7a26('0x9')]));function getAdminUser(_0x1b6258,_0x215520,_0x35dfd4,_0x4850d8,_0x4e2de0,_0x52084b){return new Promise(function(_0x3d9be9,_0x2f15f3){var _0x2ab3c2={'method':'GET','uri':_0x4850d8+_0x7a26('0xa')+'&'+_0x4e2de0+'&'+_0x52084b,'auth':_0x215520,'json':!![]};return rp(_0x2ab3c2)[_0x7a26('0xb')](function(_0x5a5099){if(_0x5a5099['result']['length']>0x0){_0x35dfd4[_0x7a26('0xc')]=_0x5a5099[_0x7a26('0xd')][0x0][_0x7a26('0xe')];}logger[_0x7a26('0xf')]('['+[_0x1b6258[_0x7a26('0x10')]()]+_0x7a26('0x11'),_0x35dfd4);_0x3d9be9(_0x35dfd4);})[_0x7a26('0x12')](function(_0x5b0622){logger[_0x7a26('0x13')]('['+[_0x1b6258['toUpperCase']()]+']',_0x5b0622[_0x7a26('0x14')]);_0x2f15f3(_0x5b0622['message']);});});}function getUser(_0x5a1e47,_0x1c852e,_0x53a7b6,_0x3b8872,_0x4d512b){return function(_0x3060af){logger[_0x7a26('0xf')]('['+[_0x5a1e47['toUpperCase']()]+_0x7a26('0x15'),_0x3060af);return new Promise(function(_0x2e16cc,_0xe809f2){if(intUtil[_0x7a26('0x16')](_0x3060af[_0x7a26('0x17')])){var _0x2ab9c9={'method':_0x7a26('0x18'),'uri':_0x53a7b6+_0x7a26('0x19')+_0x3060af[_0x7a26('0x17')]+'&'+_0x3b8872+'&'+_0x4d512b,'auth':_0x1c852e,'json':!![]};logger[_0x7a26('0xf')]('['+[_0x5a1e47['toUpperCase']()]+_0x7a26('0x1a'),_0x2ab9c9);return rp(_0x2ab9c9)[_0x7a26('0xb')](function(_0xfce183){logger[_0x7a26('0xf')]('['+[_0x5a1e47[_0x7a26('0x10')]()]+_0x7a26('0x1b'),_0xfce183);if(_0xfce183[_0x7a26('0xd')][_0x7a26('0x1c')]>0x0&&String(_0xfce183[_0x7a26('0xd')][0x0][_0x7a26('0x1d')])===_0x7a26('0x1e')){_0x3060af[_0x7a26('0x1f')]=_0xfce183[_0x7a26('0xd')][0x0]['sys_id'];}else{_0x3060af['userId']=_0x3060af[_0x7a26('0xc')];_0x3060af[_0x7a26('0x17')]=_0x3060af[_0x7a26('0x20')];}logger[_0x7a26('0xf')]('['+[_0x5a1e47[_0x7a26('0x10')]()]+'],\x20getUser\x20crm',_0x3060af);_0x2e16cc(_0x3060af);})[_0x7a26('0x12')](function(_0x588800){logger[_0x7a26('0x13')]('['+[_0x5a1e47[_0x7a26('0x10')]()]+']',_0x588800[_0x7a26('0x14')]);_0xe809f2(_0x588800[_0x7a26('0x14')]);});}else{logger['info']('['+[_0x5a1e47['toUpperCase']()]+']\x20using\x20admin\x20profile');_0x3060af[_0x7a26('0x1f')]=_0x3060af['adminId'];_0x3060af[_0x7a26('0x17')]=_0x3060af[_0x7a26('0x20')];_0x2e16cc(_0x3060af);}});};}function createEndUser(_0x2321dc,_0x7e4544,_0x2b5dd6,_0x7acfd5,_0x52cec9){logger['info']('['+[_0x2321dc[_0x7a26('0x10')]()]+'],\x20createEndUser\x20input\x20crm',_0x2b5dd6);return new Promise(function(_0x5434ca,_0x3af5b4){var _0x5afa9d={'method':_0x7a26('0x21'),'uri':_0x7acfd5+'sys_user?'+_0x52cec9,'body':{'user_name':_0x2b5dd6[_0x7a26('0x22')],'roles':_0x7a26('0x23'),'first_name':_0x2b5dd6[_0x7a26('0x22')],'active':_0x7a26('0x1e'),'date_format':'System','phone':_0x2b5dd6[_0x7a26('0x22')]},'auth':_0x7e4544,'json':!![]};return rp(_0x5afa9d)[_0x7a26('0xb')](function(_0x941abd){logger['info']('['+[_0x2321dc[_0x7a26('0x10')]()]+_0x7a26('0x24'),_0x941abd[_0x7a26('0xd')]);_0x2b5dd6['endUserId']=_0x941abd[_0x7a26('0xd')][_0x7a26('0xe')];_0x5434ca(_0x2b5dd6);})[_0x7a26('0x12')](function(_0x5a3a0c){logger[_0x7a26('0x13')]('['+[_0x2321dc[_0x7a26('0x10')]()]+']',_0x5a3a0c[_0x7a26('0x14')]);_0x3af5b4(_0x5a3a0c[_0x7a26('0x14')]);});});}function getEndUser(_0x3ca8e7,_0x3aa5e5,_0x24d41b,_0x1b336d,_0x2c642d){return function(_0x2e3974){logger[_0x7a26('0xf')]('['+[_0x3ca8e7[_0x7a26('0x10')]()]+_0x7a26('0x25'),_0x2e3974);return new Promise(function(_0x17ca74,_0x1d6a4c){var _0x35dff5={'method':_0x7a26('0x18'),'uri':_0x24d41b+'sys_user?sysparm_query=phone%3D'+_0x2e3974[_0x7a26('0x22')]+'&'+_0x1b336d+'&'+_0x2c642d,'auth':_0x3aa5e5,'json':!![]};return rp(_0x35dff5)[_0x7a26('0xb')](function(_0x1cce21){if(_0x1cce21[_0x7a26('0xd')][_0x7a26('0x1c')]>0x0){_0x2e3974['endUserId']=_0x1cce21[_0x7a26('0xd')][0x0][_0x7a26('0xe')];logger[_0x7a26('0xf')]('['+[_0x3ca8e7[_0x7a26('0x10')]()]+_0x7a26('0x26'),_0x2e3974);_0x17ca74(_0x2e3974);}else{return createEndUser(_0x3ca8e7,_0x3aa5e5,_0x2e3974,_0x24d41b,_0x1b336d)['then'](function(_0x1d6805){logger[_0x7a26('0xf')]('['+[_0x3ca8e7[_0x7a26('0x10')]()]+_0x7a26('0x27'),_0x1d6805);_0x17ca74(_0x1d6805);});}})[_0x7a26('0x12')](function(_0x39fcde){logger['error']('['+[_0x3ca8e7['toUpperCase']()]+']',_0x39fcde[_0x7a26('0x14')]);_0x1d6a4c(_0x39fcde[_0x7a26('0x14')]);});});};}function getCustomFields(_0x94be13,_0x997644){var _0x116055={};if(_0x94be13[_0x7a26('0x1c')]>0x0){_['forEach'](_0x94be13,function(_0x58799f){if(_[_0x7a26('0x28')](['string','picklist'],_0x58799f[_0x7a26('0x29')])&&_0x58799f[_0x7a26('0x2a')]&&!_0x58799f[_0x7a26('0x2b')]){_0x116055[_0x58799f['nameField']['toLowerCase']()]=_0x58799f[_0x7a26('0x2c')][_0x7a26('0x2d')]();}else if(_[_0x7a26('0x28')]([_0x7a26('0x2e'),_0x7a26('0x2f')],_0x58799f[_0x7a26('0x29')])&&_0x58799f['idField']&&_0x58799f['customField']){_0x116055[_0x58799f[_0x7a26('0x30')][_0x7a26('0x31')]()]=_0x58799f[_0x7a26('0x2c')]['toString']();}else if(_0x58799f['type']===_0x7a26('0x32')&&_0x58799f['variableName']&&_0x58799f[_0x7a26('0x30')]&&_0x58799f['customField']){_0x116055[_0x58799f['idField'][_0x7a26('0x31')]()]=_0x997644[_0x58799f['variableName']][_0x7a26('0x2d')]();}else if(_0x58799f[_0x7a26('0x29')]===_0x7a26('0x33')&&_0x58799f[_0x7a26('0x34')]&&_0x58799f[_0x7a26('0x34')][_0x7a26('0x35')]&&_0x58799f[_0x7a26('0x30')]&&_0x58799f['customField']){_0x116055[_0x58799f[_0x7a26('0x30')]['toLowerCase']()]=_0x997644[_0x58799f['Variable']['name'][_0x7a26('0x31')]()]['toString']();}});}return _0x116055;}function getTicket(_0x4361f5,_0x4426e9,_0x4f4efd,_0x13ef09,_0x3abfc3,_0x4fc8ed){return function(_0x44165c){logger[_0x7a26('0xf')]('['+[_0x4361f5[_0x7a26('0x10')]()]+_0x7a26('0x36'),_0x44165c);return new Promise(function(_0x7bc60b,_0x1d45ed){var _0x39f6a8=_0x4361f5['toLowerCase']()===_0x7a26('0x37')?_0x44165c['userId']:_0x44165c['endUserId'];var _0x251584={'method':_0x7a26('0x21'),'uri':_0x4f4efd+_0x7a26('0x38')+'?'+_0x4fc8ed,'body':Object['assign']({},{'active':_0x7a26('0x1e'),'caller_id':_0x39f6a8,'assigned_to':_0x44165c[_0x7a26('0x1f')],'short_description':intUtil[_0x7a26('0x39')](_0x13ef09[_0x7a26('0x3a')],_0x3abfc3,'\x20'),'description':intUtil['getString'](_0x13ef09[_0x7a26('0x3b')],_0x3abfc3,'\x0a')},getCustomFields(_0x13ef09[_0x7a26('0x3c')],_0x3abfc3)),'auth':_0x4426e9,'json':!![]};return rp(_0x251584)['then'](function(_0x8d76f7){logger['info']('['+[_0x4361f5[_0x7a26('0x10')]()]+_0x7a26('0x3d'),_0x8d76f7[_0x7a26('0xd')]);_0x44165c['ticketId']=_0x8d76f7[_0x7a26('0xd')][_0x7a26('0xe')];_0x44165c[_0x7a26('0x3e')]=_0x8d76f7[_0x7a26('0xd')][_0x7a26('0x3f')];logger[_0x7a26('0xf')]('['+[_0x4361f5[_0x7a26('0x10')]()]+_0x7a26('0x40'),_0x44165c);_0x7bc60b(_0x44165c);})[_0x7a26('0x12')](function(_0x6219b8){logger[_0x7a26('0x13')]('['+[_0x4361f5[_0x7a26('0x10')]()]+']',_0x6219b8['message']);_0x1d45ed(_0x6219b8[_0x7a26('0x14')]);});});};}function createRemoteTag(_0x4cfd11,_0x32ff20,_0x24a6a6,_0x34583a){return new Promise(function(_0x155c32,_0x28d98a){var _0x231f0a={'method':_0x7a26('0x21'),'uri':_0x24a6a6+_0x7a26('0x41')+'?'+_0x34583a,'body':{'short_description':_0x4cfd11,'global':!![],'active':!![],'name':_0x4cfd11},'auth':_0x32ff20,'json':!![]};return rp(_0x231f0a)[_0x7a26('0xb')](function(_0x46a53b){var _0x27666a=_0x46a53b[_0x7a26('0xd')][_0x7a26('0xe')];_0x155c32(_0x27666a);});});}function getRemoteTag(_0x650ece,_0x545fab,_0x47bc0a,_0x4ca91a,_0x4fa3af){return new Promise(function(_0x3cea57,_0x5ac46b){var _0x4e5ac3={'method':_0x7a26('0x18'),'uri':_0x47bc0a+_0x7a26('0x41')+_0x7a26('0x42')+_0x650ece+'&'+_0x4ca91a,'auth':_0x545fab,'json':!![]};return rp(_0x4e5ac3)['then'](function(_0x12ab1f){if(_0x12ab1f[_0x7a26('0xd')][_0x7a26('0x1c')]>0x0){var _0x1b7790=_0x12ab1f['result'][0x0][_0x7a26('0xe')];_0x3cea57(_0x1b7790);}else{return createRemoteTag(_0x650ece,_0x545fab,_0x47bc0a,_0x4ca91a)['then'](function(_0x2eff8e){_0x3cea57(_0x2eff8e);});}});});}function assignTagToIncident(_0x1a07d9,_0x1c297b,_0x10a7a6,_0x5bbf3b,_0x229fba){return new Promise(function(_0x3c6e17,_0x56ce65){var _0x31de4f={'method':'POST','uri':_0x10a7a6+_0x7a26('0x43')+'?'+_0x229fba,'body':{'label':_0x1a07d9,'table':_0x7a26('0x38'),'id_type':'Incident','table_key':_0x5bbf3b[_0x7a26('0x44')],'title':'Incident\x20-\x20'+_0x5bbf3b[_0x7a26('0x3e')],'id_display':_0x5bbf3b['ticketNumber']},'auth':_0x1c297b,'json':!![]};return rp(_0x31de4f)[_0x7a26('0xb')](function(_0x18a8ca){_0x3c6e17();})[_0x7a26('0x12')](function(){_0x3c6e17();});});}function manageTags(_0x3a9da5,_0x4a7430,_0x51168b,_0x254a7f,_0xf1c8a3,_0x583753,_0x1d01b0){return new Promise(function(_0x31a1aa,_0x35c87e){var _0x81cfa1=[];_0x4a7430[_0x7a26('0x45')](function(_0x45fdfd){_0x81cfa1['push'](getRemoteTag(_0x45fdfd,_0x51168b,_0x254a7f,_0x583753,_0x1d01b0));});return Promise['all'](_0x81cfa1)[_0x7a26('0xb')](function(_0x494ada){if(_0x494ada[_0x7a26('0x1c')]){logger[_0x7a26('0xf')]('['+[_0x3a9da5[_0x7a26('0x10')]()]+_0x7a26('0x46'),_0x494ada);var _0x209dfc=[];_0x494ada[_0x7a26('0x45')](function(_0x2a6a59){_0x209dfc['push'](assignTagToIncident(_0x2a6a59,_0x51168b,_0x254a7f,_0xf1c8a3,_0x583753));});return Promise[_0x7a26('0x47')](_0x209dfc)['then'](function(){_0x31a1aa();})[_0x7a26('0x12')](function(){_0x31a1aa();});}else{_0x31a1aa();}});});}function getTags(_0x142b4f,_0x251a8b,_0x5d222b,_0x2befcf,_0x4d6b59,_0x382a0f){return function(_0x29b2fe){return new Promise(function(_0x5ab95f,_0x9a955c){var _0x5c756d=[];var _0xfb19be=_0x2befcf[_0x7a26('0x48')];if(_0xfb19be&&_0xfb19be[_0x7a26('0x1c')]>0x0){_0x5c756d=_['map'](_0xfb19be,_0x7a26('0x35'));}if(_0x5c756d[_0x7a26('0x1c')]>0x0){return manageTags(_0x142b4f,_0x5c756d,_0x251a8b,_0x5d222b,_0x29b2fe,_0x4d6b59,_0x382a0f)[_0x7a26('0xb')](function(){_0x5ab95f(_0x29b2fe);});}else{_0x5ab95f(_0x29b2fe);}});};}function emit(_0x48a4d6,_0x4e2faa,_0x448e1c){var _0x337719=_0x7a26('0x49')+_0x7a26('0x4a')+_0x7a26('0x4b')+'%255EORDERBYDESCnumber';var _0x1511a1={'uri':_0x48a4d6+_0x7a26('0x4c')+_0x448e1c+_0x337719};io['to'](util['format']('user:%s',_0x4e2faa))[_0x7a26('0x4d')](_0x7a26('0x4e'),_0x1511a1);}exports['cs']=function(_0x32e3ba,_0x572c4c,_0x448d6a,_0x5f3d79,_0x52f7fd,_0x396123,_0x24b7c7,_0x210d33){var _0x47c32e={};var _0x11ceaa={'user':_0x396123[_0x7a26('0x4f')],'pass':_0x396123['password']};var _0x4b2883='sysparm_limit=1';var _0x307f28=_0x7a26('0x50');_0x396123[_0x7a26('0x51')]=intUtil[_0x7a26('0x52')](_0x396123[_0x7a26('0x51')]);_0x396123[_0x7a26('0x53')]=intUtil['stripTrailingSlash'](_0x396123[_0x7a26('0x53')]);var _0x2362da=util['format'](_0x7a26('0x54'),_0x396123[_0x7a26('0x51')]);_0x47c32e['userEmail']=!_['isNil'](_0x5f3d79)?_0x5f3d79[_0x7a26('0x55')]:null;_0x47c32e[_0x7a26('0x20')]=_0x396123[_0x7a26('0x55')];_0x47c32e['endUserNumber']=_0x210d33[_0x7a26('0x31')]()==='outbound'?_0x572c4c[_0x7a26('0x56')]:_0x572c4c[_0x7a26('0x57')];_0x47c32e[_0x7a26('0x58')]=_0x210d33===_0x7a26('0x59')||_0x210d33==='unmanaged'?_0x7a26('0x59'):'outbound';var _0x317665=util[_0x7a26('0x5a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x396123[_0x7a26('0x53')],_0x572c4c['uniqueid'],md5(_0x572c4c[_0x7a26('0x5b')]));if(_0x52f7fd&&_0x52f7fd[_0x7a26('0x5c')]){logger[_0x7a26('0xf')](_0x7a26('0x5d'),_0x7a26('0x5e'));_0x572c4c['recordingURL']=_0x317665;}else if(_0x24b7c7&&_0x24b7c7['recordingFormat']&&_0x24b7c7[_0x7a26('0x5f')]!=='none'){logger['info']('[OUTBOUND]',_0x7a26('0x5e'));_0x572c4c['recordingURL']=_0x317665;}else{_0x572c4c[_0x7a26('0x60')]='';}return getAdminUser(_0x210d33,_0x11ceaa,_0x47c32e,_0x2362da,_0x307f28,_0x4b2883)[_0x7a26('0xb')](getUser(_0x210d33,_0x11ceaa,_0x2362da,_0x307f28,_0x4b2883))[_0x7a26('0xb')](getEndUser(_0x210d33,_0x11ceaa,_0x2362da,_0x307f28,_0x4b2883))[_0x7a26('0xb')](getTicket(_0x210d33,_0x11ceaa,_0x2362da,_0x448d6a,_0x572c4c,_0x307f28))[_0x7a26('0xb')](function(_0x2cef73){logger[_0x7a26('0xf')](util[_0x7a26('0x5a')](_0x7a26('0x61'),_0x2cef73['ticketId']));logger[_0x7a26('0xf')](util[_0x7a26('0x5a')]('call\x20direction:\x20%s',_0x210d33));if(_0x210d33!==_0x7a26('0x62')){logger[_0x7a26('0xf')]('['+[_0x210d33[_0x7a26('0x10')]()]+']',_0x7a26('0x63'));emit(_0x396123[_0x7a26('0x51')],_0x5f3d79[_0x7a26('0x35')],_0x2cef73[_0x7a26('0x44')]);}})[_0x7a26('0x12')](function(_0x320ade){logger[_0x7a26('0x13')]('['+[_0x210d33[_0x7a26('0x10')]()]+_0x7a26('0x64'),util['inspect'](_0x320ade,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x76dd=['inspect','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','defaults','redis','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','result','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','GET','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','then','length','active','true','userId','],\x20getUser\x20crm','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','customField','toLowerCase','idField','content','toString','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident','Incident\x20-\x20','ticketNumber','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','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','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...'];(function(_0x296e1f,_0x23d147){var _0x431db2=function(_0x57b3b1){while(--_0x57b3b1){_0x296e1f['push'](_0x296e1f['shift']());}};_0x431db2(++_0x23d147);}(_0x76dd,0x14e));var _0xd76d=function(_0x14b147,_0x5d9f40){_0x14b147=_0x14b147-0x0;var _0x104c6b=_0x76dd[_0x14b147];return _0x104c6b;};'use strict';var _=require(_0xd76d('0x0'));var Promise=require('bluebird');var rp=require(_0xd76d('0x1'));var util=require('util');var md5=require(_0xd76d('0x2'));var Redis=require(_0xd76d('0x3'));var intUtil=require(_0xd76d('0x4'));var config=require(_0xd76d('0x5'));var logger=require(_0xd76d('0x6'))(_0xd76d('0x7'));config['redis']=_[_0xd76d('0x8')](config[_0xd76d('0x9')],{'host':_0xd76d('0xa'),'port':0x18eb});var io=require(_0xd76d('0xb'))(new Redis(config['redis']));function getAdminUser(_0x1cd6d3,_0x1db490,_0x506053,_0x1eaad7,_0x578464,_0x427bb1){return new Promise(function(_0x498777,_0x3a0319){var _0x131780={'method':'GET','uri':_0x1eaad7+_0xd76d('0xc')+'&'+_0x578464+'&'+_0x427bb1,'auth':_0x1db490,'json':!![]};return rp(_0x131780)['then'](function(_0x406e6f){if(_0x406e6f[_0xd76d('0xd')]['length']>0x0){_0x506053[_0xd76d('0xe')]=_0x406e6f[_0xd76d('0xd')][0x0][_0xd76d('0xf')];}logger[_0xd76d('0x10')]('['+[_0x1cd6d3[_0xd76d('0x11')]()]+_0xd76d('0x12'),_0x506053);_0x498777(_0x506053);})[_0xd76d('0x13')](function(_0x9dc36e){logger[_0xd76d('0x14')]('['+[_0x1cd6d3[_0xd76d('0x11')]()]+']',_0x9dc36e[_0xd76d('0x15')]);_0x3a0319(_0x9dc36e[_0xd76d('0x15')]);});});}function getUser(_0x57dd83,_0x2e4985,_0x3abecc,_0x1984b3,_0x50fc6b){return function(_0x491b81){logger[_0xd76d('0x10')]('['+[_0x57dd83[_0xd76d('0x11')]()]+_0xd76d('0x16'),_0x491b81);return new Promise(function(_0x16d294,_0xfb28b5){if(intUtil['validateEmail'](_0x491b81['userEmail'])){var _0x59b9f7={'method':_0xd76d('0x17'),'uri':_0x3abecc+_0xd76d('0x18')+_0x491b81[_0xd76d('0x19')]+'&'+_0x1984b3+'&'+_0x50fc6b,'auth':_0x2e4985,'json':!![]};logger[_0xd76d('0x10')]('['+[_0x57dd83['toUpperCase']()]+_0xd76d('0x1a'),_0x59b9f7);return rp(_0x59b9f7)[_0xd76d('0x1b')](function(_0x5e5f0f){logger[_0xd76d('0x10')]('['+[_0x57dd83[_0xd76d('0x11')]()]+'],\x20getUser\x20entity',_0x5e5f0f);if(_0x5e5f0f[_0xd76d('0xd')][_0xd76d('0x1c')]>0x0&&String(_0x5e5f0f['result'][0x0][_0xd76d('0x1d')])===_0xd76d('0x1e')){_0x491b81[_0xd76d('0x1f')]=_0x5e5f0f[_0xd76d('0xd')][0x0]['sys_id'];}else{_0x491b81[_0xd76d('0x1f')]=_0x491b81['adminId'];_0x491b81[_0xd76d('0x19')]=_0x491b81['adminEmail'];}logger[_0xd76d('0x10')]('['+[_0x57dd83['toUpperCase']()]+_0xd76d('0x20'),_0x491b81);_0x16d294(_0x491b81);})[_0xd76d('0x13')](function(_0x188821){logger[_0xd76d('0x14')]('['+[_0x57dd83[_0xd76d('0x11')]()]+']',_0x188821[_0xd76d('0x15')]);_0xfb28b5(_0x188821[_0xd76d('0x15')]);});}else{logger[_0xd76d('0x10')]('['+[_0x57dd83[_0xd76d('0x11')]()]+']\x20using\x20admin\x20profile');_0x491b81[_0xd76d('0x1f')]=_0x491b81[_0xd76d('0xe')];_0x491b81[_0xd76d('0x19')]=_0x491b81[_0xd76d('0x21')];_0x16d294(_0x491b81);}});};}function createEndUser(_0x44d137,_0x2530c0,_0x4b1946,_0x4fd263,_0x2886b2){logger[_0xd76d('0x10')]('['+[_0x44d137[_0xd76d('0x11')]()]+_0xd76d('0x22'),_0x4b1946);return new Promise(function(_0x3a849a,_0x33b934){var _0xb6c5cf={'method':_0xd76d('0x23'),'uri':_0x4fd263+_0xd76d('0x24')+_0x2886b2,'body':{'user_name':_0x4b1946[_0xd76d('0x25')],'roles':'user','first_name':_0x4b1946[_0xd76d('0x25')],'active':_0xd76d('0x1e'),'date_format':_0xd76d('0x26'),'phone':_0x4b1946[_0xd76d('0x25')]},'auth':_0x2530c0,'json':!![]};return rp(_0xb6c5cf)[_0xd76d('0x1b')](function(_0x4c2d41){logger[_0xd76d('0x10')]('['+[_0x44d137[_0xd76d('0x11')]()]+_0xd76d('0x27'),_0x4c2d41[_0xd76d('0xd')]);_0x4b1946[_0xd76d('0x28')]=_0x4c2d41[_0xd76d('0xd')][_0xd76d('0xf')];_0x3a849a(_0x4b1946);})[_0xd76d('0x13')](function(_0x5bf32f){logger[_0xd76d('0x14')]('['+[_0x44d137['toUpperCase']()]+']',_0x5bf32f['message']);_0x33b934(_0x5bf32f[_0xd76d('0x15')]);});});}function getEndUser(_0x391c05,_0x219d41,_0x29c5ae,_0x2a9690,_0x114a6a){return function(_0x493179){logger[_0xd76d('0x10')]('['+[_0x391c05[_0xd76d('0x11')]()]+_0xd76d('0x29'),_0x493179);return new Promise(function(_0x6587a0,_0x42646b){var _0x5e3304={'method':_0xd76d('0x17'),'uri':_0x29c5ae+_0xd76d('0x2a')+_0x493179['endUserNumber']+'&'+_0x2a9690+'&'+_0x114a6a,'auth':_0x219d41,'json':!![]};return rp(_0x5e3304)[_0xd76d('0x1b')](function(_0x521a3c){if(_0x521a3c[_0xd76d('0xd')][_0xd76d('0x1c')]>0x0){_0x493179['endUserId']=_0x521a3c[_0xd76d('0xd')][0x0][_0xd76d('0xf')];logger[_0xd76d('0x10')]('['+[_0x391c05[_0xd76d('0x11')]()]+_0xd76d('0x2b'),_0x493179);_0x6587a0(_0x493179);}else{return createEndUser(_0x391c05,_0x219d41,_0x493179,_0x29c5ae,_0x2a9690)['then'](function(_0x3f96cb){logger[_0xd76d('0x10')]('['+[_0x391c05[_0xd76d('0x11')]()]+_0xd76d('0x2c'),_0x3f96cb);_0x6587a0(_0x3f96cb);});}})[_0xd76d('0x13')](function(_0xbb4f1e){logger['error']('['+[_0x391c05['toUpperCase']()]+']',_0xbb4f1e['message']);_0x42646b(_0xbb4f1e['message']);});});};}function getCustomFields(_0x2790c2,_0x2dff0f){var _0x108785={};if(_0x2790c2['length']>0x0){_[_0xd76d('0x2d')](_0x2790c2,function(_0x411035){if(_[_0xd76d('0x2e')]([_0xd76d('0x2f'),_0xd76d('0x30')],_0x411035[_0xd76d('0x31')])&&_0x411035['nameField']&&!_0x411035[_0xd76d('0x32')]){_0x108785[_0x411035['nameField'][_0xd76d('0x33')]()]=_0x411035['content']['toString']();}else if(_[_0xd76d('0x2e')]([_0xd76d('0x2f'),'picklist'],_0x411035[_0xd76d('0x31')])&&_0x411035[_0xd76d('0x34')]&&_0x411035[_0xd76d('0x32')]){_0x108785[_0x411035[_0xd76d('0x34')][_0xd76d('0x33')]()]=_0x411035[_0xd76d('0x35')][_0xd76d('0x36')]();}else if(_0x411035[_0xd76d('0x31')]===_0xd76d('0x37')&&_0x411035['variableName']&&_0x411035[_0xd76d('0x34')]&&_0x411035['customField']){_0x108785[_0x411035[_0xd76d('0x34')][_0xd76d('0x33')]()]=_0x2dff0f[_0x411035[_0xd76d('0x38')]]['toString']();}else if(_0x411035[_0xd76d('0x31')]===_0xd76d('0x39')&&_0x411035[_0xd76d('0x3a')]&&_0x411035[_0xd76d('0x3a')][_0xd76d('0x3b')]&&_0x411035[_0xd76d('0x34')]&&_0x411035['customField']){_0x108785[_0x411035['idField'][_0xd76d('0x33')]()]=_0x2dff0f[_0x411035[_0xd76d('0x3a')][_0xd76d('0x3b')]['toLowerCase']()][_0xd76d('0x36')]();}});}return _0x108785;}function getTicket(_0x45c798,_0x46b794,_0x33b74b,_0x280670,_0xd6c93a,_0x118b6c){return function(_0x1023a4){logger[_0xd76d('0x10')]('['+[_0x45c798[_0xd76d('0x11')]()]+_0xd76d('0x3c'),_0x1023a4);return new Promise(function(_0x264bb8,_0x4659b7){var _0x25e90d=_0x45c798[_0xd76d('0x33')]()===_0xd76d('0x3d')?_0x1023a4[_0xd76d('0x1f')]:_0x1023a4['endUserId'];var _0x4cab34={'method':'POST','uri':_0x33b74b+_0xd76d('0x3e')+'?'+_0x118b6c,'body':Object[_0xd76d('0x3f')]({},{'active':_0xd76d('0x1e'),'caller_id':_0x25e90d,'assigned_to':_0x1023a4['userId'],'short_description':intUtil['getString'](_0x280670[_0xd76d('0x40')],_0xd6c93a,'\x20'),'description':intUtil['getString'](_0x280670[_0xd76d('0x41')],_0xd6c93a,'\x0a')},getCustomFields(_0x280670[_0xd76d('0x42')],_0xd6c93a)),'auth':_0x46b794,'json':!![]};return rp(_0x4cab34)[_0xd76d('0x1b')](function(_0x1195ba){logger['info']('['+[_0x45c798[_0xd76d('0x11')]()]+_0xd76d('0x43'),_0x1195ba[_0xd76d('0xd')]);_0x1023a4[_0xd76d('0x44')]=_0x1195ba[_0xd76d('0xd')]['sys_id'];_0x1023a4['ticketNumber']=_0x1195ba[_0xd76d('0xd')][_0xd76d('0x45')];logger['info']('['+[_0x45c798[_0xd76d('0x11')]()]+_0xd76d('0x46'),_0x1023a4);_0x264bb8(_0x1023a4);})['catch'](function(_0x2a87da){logger[_0xd76d('0x14')]('['+[_0x45c798[_0xd76d('0x11')]()]+']',_0x2a87da[_0xd76d('0x15')]);_0x4659b7(_0x2a87da[_0xd76d('0x15')]);});});};}function createRemoteTag(_0x299adf,_0x4a6cfa,_0x43a9ad,_0x45902d){return new Promise(function(_0xcf46ab,_0x43cce9){var _0x4a818b={'method':_0xd76d('0x23'),'uri':_0x43a9ad+_0xd76d('0x47')+'?'+_0x45902d,'body':{'short_description':_0x299adf,'global':!![],'active':!![],'name':_0x299adf},'auth':_0x4a6cfa,'json':!![]};return rp(_0x4a818b)[_0xd76d('0x1b')](function(_0xefc842){var _0x3acc20=_0xefc842['result'][_0xd76d('0xf')];_0xcf46ab(_0x3acc20);});});}function getRemoteTag(_0x6b8bff,_0x27a520,_0x12731f,_0x3bc036,_0x4312f2){return new Promise(function(_0x133abd,_0x38cac8){var _0x314372={'method':_0xd76d('0x17'),'uri':_0x12731f+_0xd76d('0x47')+_0xd76d('0x48')+_0x6b8bff+'&'+_0x3bc036,'auth':_0x27a520,'json':!![]};return rp(_0x314372)['then'](function(_0x4f413a){if(_0x4f413a[_0xd76d('0xd')][_0xd76d('0x1c')]>0x0){var _0x450a91=_0x4f413a[_0xd76d('0xd')][0x0]['sys_id'];_0x133abd(_0x450a91);}else{return createRemoteTag(_0x6b8bff,_0x27a520,_0x12731f,_0x3bc036)[_0xd76d('0x1b')](function(_0x6a25a1){_0x133abd(_0x6a25a1);});}});});}function assignTagToIncident(_0x3114a2,_0xa2ee0e,_0x1f8172,_0x481ed9,_0x16fd62){return new Promise(function(_0x102b12,_0x33b559){var _0x21f2e5={'method':_0xd76d('0x23'),'uri':_0x1f8172+'label_entry'+'?'+_0x16fd62,'body':{'label':_0x3114a2,'table':'incident','id_type':_0xd76d('0x49'),'table_key':_0x481ed9[_0xd76d('0x44')],'title':_0xd76d('0x4a')+_0x481ed9[_0xd76d('0x4b')],'id_display':_0x481ed9[_0xd76d('0x4b')]},'auth':_0xa2ee0e,'json':!![]};return rp(_0x21f2e5)[_0xd76d('0x1b')](function(_0x282852){_0x102b12();})['catch'](function(){_0x102b12();});});}function manageTags(_0x56d808,_0x5438ba,_0x29ef08,_0x541d2a,_0x4fbe9b,_0x371696,_0x217338){return new Promise(function(_0x574c0d,_0x25a943){var _0x46790f=[];_0x5438ba[_0xd76d('0x2d')](function(_0x3b5a31){_0x46790f['push'](getRemoteTag(_0x3b5a31,_0x29ef08,_0x541d2a,_0x371696,_0x217338));});return Promise[_0xd76d('0x4c')](_0x46790f)[_0xd76d('0x1b')](function(_0x1bffe2){if(_0x1bffe2['length']){logger[_0xd76d('0x10')]('['+[_0x56d808[_0xd76d('0x11')]()]+_0xd76d('0x4d'),_0x1bffe2);var _0x25fa0f=[];_0x1bffe2[_0xd76d('0x2d')](function(_0x38fce0){_0x25fa0f[_0xd76d('0x4e')](assignTagToIncident(_0x38fce0,_0x29ef08,_0x541d2a,_0x4fbe9b,_0x371696));});return Promise[_0xd76d('0x4c')](_0x25fa0f)['then'](function(){_0x574c0d();})[_0xd76d('0x13')](function(){_0x574c0d();});}else{_0x574c0d();}});});}function getTags(_0x1ae3b2,_0x35647e,_0x22a0e9,_0x54e63d,_0x3dd3e9,_0x5cd869){return function(_0xa175fa){return new Promise(function(_0x213ed4,_0x20e7b2){var _0x430f58=[];var _0xbf441=_0x54e63d['Tags'];if(_0xbf441&&_0xbf441[_0xd76d('0x1c')]>0x0){_0x430f58=_[_0xd76d('0x4f')](_0xbf441,_0xd76d('0x3b'));}if(_0x430f58[_0xd76d('0x1c')]>0x0){return manageTags(_0x1ae3b2,_0x430f58,_0x35647e,_0x22a0e9,_0xa175fa,_0x3dd3e9,_0x5cd869)[_0xd76d('0x1b')](function(){_0x213ed4(_0xa175fa);});}else{_0x213ed4(_0xa175fa);}});};}function emit(_0x4d4406,_0x1bda38,_0xf9b734){var _0x2b1e26=_0xd76d('0x50')+_0xd76d('0x51')+_0xd76d('0x52')+_0xd76d('0x53');var _0x5e470d={'uri':_0x4d4406+_0xd76d('0x54')+_0xf9b734+_0x2b1e26};io['to'](util[_0xd76d('0x55')](_0xd76d('0x56'),_0x1bda38))[_0xd76d('0x57')](_0xd76d('0x58'),_0x5e470d);}exports['cs']=function(_0x2646c3,_0x1b2d2b,_0x5c9b1d,_0x200975,_0x10d415,_0x4657f1,_0x3646c1,_0x259b2e){var _0x1e3cb2={};var _0x3d2a37={'user':_0x4657f1['username'],'pass':_0x4657f1[_0xd76d('0x59')]};var _0x786d51='sysparm_limit=1';var _0x3f7807='sysparm_display_value=true';_0x4657f1['remoteUri']=intUtil[_0xd76d('0x5a')](_0x4657f1[_0xd76d('0x5b')]);_0x4657f1['serverUrl']=intUtil[_0xd76d('0x5a')](_0x4657f1[_0xd76d('0x5c')]);var _0x1812fa=util['format'](_0xd76d('0x5d'),_0x4657f1['remoteUri']);_0x1e3cb2[_0xd76d('0x19')]=!_[_0xd76d('0x5e')](_0x200975)?_0x200975[_0xd76d('0x5f')]:null;_0x1e3cb2[_0xd76d('0x21')]=_0x4657f1[_0xd76d('0x5f')];_0x1e3cb2[_0xd76d('0x25')]=_0x259b2e[_0xd76d('0x33')]()==='outbound'?_0x1b2d2b[_0xd76d('0x60')]:_0x1b2d2b[_0xd76d('0x61')];_0x1e3cb2['callDirection']=_0x259b2e==='queue'||_0x259b2e==='unmanaged'?_0xd76d('0x62'):'outbound';var _0x46e60f=util['format'](_0xd76d('0x63'),_0x4657f1[_0xd76d('0x5c')],_0x1b2d2b['uniqueid'],md5(_0x1b2d2b[_0xd76d('0x64')]));if(_0x10d415&&_0x10d415[_0xd76d('0x65')]){logger[_0xd76d('0x10')](_0xd76d('0x66'),'Recording\x20is\x20enabled!');_0x1b2d2b[_0xd76d('0x67')]=_0x46e60f;}else if(_0x3646c1&&_0x3646c1[_0xd76d('0x68')]&&_0x3646c1['recordingFormat']!=='none'){logger[_0xd76d('0x10')]('[OUTBOUND]',_0xd76d('0x69'));_0x1b2d2b['recordingURL']=_0x46e60f;}else{_0x1b2d2b[_0xd76d('0x67')]='';}return getAdminUser(_0x259b2e,_0x3d2a37,_0x1e3cb2,_0x1812fa,_0x3f7807,_0x786d51)[_0xd76d('0x1b')](getUser(_0x259b2e,_0x3d2a37,_0x1812fa,_0x3f7807,_0x786d51))[_0xd76d('0x1b')](getEndUser(_0x259b2e,_0x3d2a37,_0x1812fa,_0x3f7807,_0x786d51))[_0xd76d('0x1b')](getTicket(_0x259b2e,_0x3d2a37,_0x1812fa,_0x5c9b1d,_0x1b2d2b,_0x3f7807))[_0xd76d('0x1b')](function(_0x3b14e1){logger[_0xd76d('0x10')](util[_0xd76d('0x55')](_0xd76d('0x6a'),_0x3b14e1[_0xd76d('0x44')]));logger[_0xd76d('0x10')](util[_0xd76d('0x55')](_0xd76d('0x6b'),_0x259b2e));if(_0x259b2e!==_0xd76d('0x6c')){logger[_0xd76d('0x10')]('['+[_0x259b2e[_0xd76d('0x11')]()]+']',_0xd76d('0x6d'));emit(_0x4657f1[_0xd76d('0x5b')],_0x200975[_0xd76d('0x3b')],_0x3b14e1[_0xd76d('0x44')]);}})['catch'](function(_0x44fd3f){logger[_0xd76d('0x14')]('['+[_0x259b2e['toUpperCase']()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0xd76d('0x6e')](_0x44fd3f,{'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 54fd647..de2e53d 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 _0x6d8a=['phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Caller\x20-\x20%s','Enduser\x20created.','first_name','debug','[HTTP]','map','type','string','nameField','toLowerCase','idField','customField','custom_fields','push','variable','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','contacts','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','catch','unmanaged','lastevent','toUpperCase','users','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','sugarcrm','redis','defaults','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','created_by','description','Descriptions','toISOString','slice','duration_minutes','parent_id','parent_type','parent_name','direction','length','forEach','variableName','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','Contacts','contacts.phone_home\x20=\x20\x22%s\x22'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x6d8a,0xbe));var _0xa6d8=function(_0x59d0cc,_0xa7c52b){_0x59d0cc=_0x59d0cc-0x0;var _0x2ae79f=_0x6d8a[_0x59d0cc];return _0x2ae79f;};'use strict';var _=require(_0xa6d8('0x0'));var rp=require(_0xa6d8('0x1'));var BPromise=require('bluebird');var md5=require(_0xa6d8('0x2'));var util=require(_0xa6d8('0x3'));var Redis=require(_0xa6d8('0x4'));var intUtil=require(_0xa6d8('0x5'));var config=require(_0xa6d8('0x6'));var logger=require('../../../../config/logger')(_0xa6d8('0x7'));config[_0xa6d8('0x8')]=_[_0xa6d8('0x9')](config[_0xa6d8('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xa6d8('0xa'))(new Redis(config[_0xa6d8('0x8')]));var def={'method':_0xa6d8('0xb'),'json':!![]};function emit(_0x2d6562,_0x4ecb15,_0x1b80b6){io['to'](_0x2d6562)[_0xa6d8('0xc')](_0x4ecb15,_0x1b80b6);}function getTicket(_0x1f4d3f,_0x43efa0,_0x1963f7,_0x2832f6,_0x24d0fe,_0x3efc22,_0x3cc38d,_0x279ad8){logger[_0xa6d8('0xd')](_0xa6d8('0xe'));var _0x3af261=new Date();var _0x3542d2=[{'name':_0xa6d8('0xf'),'value':intUtil[_0xa6d8('0x10')](_0x2832f6[_0xa6d8('0x11')],_0x24d0fe,'\x20')},{'name':'assigned_user_id','value':_0x43efa0['id']},{'name':_0xa6d8('0x12'),'value':_0x43efa0['id']},{'name':_0xa6d8('0x13'),'value':intUtil['getString'](_0x2832f6[_0xa6d8('0x14')],_0x24d0fe,'\x0a')},{'name':'date_start','value':_0x3af261[_0xa6d8('0x15')]()[_0xa6d8('0x16')](0x0,0x13)['replace']('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xa6d8('0x17'),'value':'15'},{'name':_0xa6d8('0x18'),'value':_0x1963f7['id']},{'name':_0xa6d8('0x19'),'value':'Contacts'},{'name':_0xa6d8('0x1a'),'value':_0x1963f7[_0xa6d8('0xf')]},{'name':_0xa6d8('0x1b'),'value':_0x279ad8}];if(_0x3efc22[_0xa6d8('0x1c')]){_[_0xa6d8('0x1d')](_0x3efc22,function(_0x535237){if(_0x24d0fe[_0x535237[_0xa6d8('0x1e')]]){_0x3542d2['push']({'name':_0x535237['idField'],'value':_0x24d0fe[_0x535237['variableName']]});}});}return request({'form':{'method':_0xa6d8('0x1f'),'input_type':_0xa6d8('0x20'),'response_type':_0xa6d8('0x20'),'rest_data':JSON[_0xa6d8('0x21')]({'session':_0x3cc38d['id'],'module_name':_0xa6d8('0x22'),'name_value_list':_0x3542d2})}});}function getAuth(_0x279f0b){return util[_0xa6d8('0x23')](_0xa6d8('0x24'),new Buffer(_0x279f0b[_0xa6d8('0x25')]+':X')[_0xa6d8('0x26')](_0xa6d8('0x27')));}function getServerInfo(_0x2ed10c){return request({'form':{'method':_0xa6d8('0x28'),'input_type':'JSON','response_type':_0xa6d8('0x20'),'rest_data':JSON[_0xa6d8('0x21')]({'session':_0x2ed10c['id']})}});}function getUser(_0x20b2f0,_0x7da046,_0x7d3895){if(!_[_0xa6d8('0x29')](_0x7da046)){logger[_0xa6d8('0xd')]('Getting\x20agent\x20with\x20name',_0x7da046);return request({'form':{'method':_0xa6d8('0x2a'),'input_type':_0xa6d8('0x20'),'response_type':_0xa6d8('0x20'),'rest_data':JSON['stringify']({'session':_0x7d3895['id'],'module_name':_0xa6d8('0x2b'),'query':util['format'](_0xa6d8('0x2c'),_0x7da046),'order_by':'','offset':'0','select_fields':['id',_0xa6d8('0xf'),_0xa6d8('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa6d8('0x2e')](function(_0x36148d){if(_0x36148d[_0xa6d8('0x2f')]['length']){var _0x16ce8c=_[_0xa6d8('0x30')](_0x36148d['entry_list'],function(_0x14ecd7){return _0x14ecd7['name_value_list']['user_name'][_0xa6d8('0x31')]===_0x7da046;});if(_0x16ce8c){logger['info'](_0xa6d8('0x32'));return BPromise[_0xa6d8('0x33')]({'id':_0x16ce8c[_0xa6d8('0x34')]['id']['value'],'name':_0x16ce8c[_0xa6d8('0x34')]['name'][_0xa6d8('0x31')]});}}logger[_0xa6d8('0xd')](_0xa6d8('0x35'));return BPromise[_0xa6d8('0x33')]({'id':_0x7d3895[_0xa6d8('0x34')][_0xa6d8('0x36')][_0xa6d8('0x31')],'name':_0x7d3895['name_value_list']['user_name']['value']});});}else{logger['info']('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x7d3895[_0xa6d8('0x34')][_0xa6d8('0x36')][_0xa6d8('0x31')],'name':_0x7d3895[_0xa6d8('0x34')]['user_name']['value']});}}function getEndUser(_0x90ff89,_0x23f9fe,_0xcd191d,_0x2fe685){logger[_0xa6d8('0xd')](_0xa6d8('0x37'),_0xcd191d);return request({'form':{'method':_0xa6d8('0x2a'),'input_type':_0xa6d8('0x20'),'response_type':_0xa6d8('0x20'),'rest_data':JSON[_0xa6d8('0x21')]({'session':_0x2fe685['id'],'module_name':_0xa6d8('0x38'),'query':util['format'](_0xa6d8('0x39'),_0xcd191d),'order_by':'','offset':'0','select_fields':['id','name',_0xa6d8('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa6d8('0x2e')](function(_0x13fcdb){if(_0x13fcdb[_0xa6d8('0x2f')][_0xa6d8('0x1c')]){var _0x1cc1e5=_[_0xa6d8('0x30')](_0x13fcdb[_0xa6d8('0x2f')],function(_0x4329da){return _0x4329da[_0xa6d8('0x34')][_0xa6d8('0x3a')][_0xa6d8('0x31')]===_0xcd191d;});if(_0x1cc1e5){logger[_0xa6d8('0xd')]('Enduser\x20found!');return BPromise[_0xa6d8('0x33')]({'id':_0x1cc1e5[_0xa6d8('0x34')]['id']['value'],'name':_0x1cc1e5['name_value_list'][_0xa6d8('0xf')][_0xa6d8('0x31')],'phone':_0x1cc1e5['name_value_list'][_0xa6d8('0x3a')][_0xa6d8('0x31')]});}}else{logger[_0xa6d8('0xd')](_0xa6d8('0x3b'));return request({'form':{'method':'set_entry','input_type':_0xa6d8('0x20'),'response_type':_0xa6d8('0x20'),'rest_data':JSON['stringify']({'session':_0x2fe685['id'],'module_name':_0xa6d8('0x38'),'name_value_list':[{'name':'first_name','value':_0x23f9fe!==_0xa6d8('0x3c')?_0x23f9fe:util[_0xa6d8('0x23')](_0xa6d8('0x3d'),_0xcd191d)},{'name':_0xa6d8('0x3a'),'value':_0xcd191d}]})}})['then'](function(_0x51654f){logger[_0xa6d8('0xd')](_0xa6d8('0x3e'));return BPromise['resolve']({'id':_0x51654f['id'],'name':_0x51654f[_0xa6d8('0x2f')][_0xa6d8('0x3f')][_0xa6d8('0x31')],'phone':_0x51654f['entry_list'][_0xa6d8('0x3a')][_0xa6d8('0x31')]});});}});}function request(_0x2ad51d){logger[_0xa6d8('0x40')](_0xa6d8('0x41'),JSON['stringify'](_0x2ad51d));return rp(_['merge'](def,_0x2ad51d));}function getTags(_0x190a82,_0x4d09f3){var _0x118b6f=[];if(_0x190a82&&_0x190a82['length']>0x0){_0x118b6f=_[_0xa6d8('0x42')](_0x190a82,_0x4d09f3);}return _0x118b6f;}function getCustomFields(_0x318131,_0x347667){var _0x14756a=[];var _0x22d6c8={'custom_fields':[]};if(_0x318131['length']>0x0){_['forEach'](_0x318131,function(_0x2935f5){if(_0x2935f5[_0xa6d8('0x43')]===_0xa6d8('0x44')&&_0x2935f5[_0xa6d8('0x45')]&&!_0x2935f5['customField']){_0x22d6c8[_0x2935f5[_0xa6d8('0x45')][_0xa6d8('0x46')]()]=_0x2935f5['content'][_0xa6d8('0x26')]();}else if(_0x2935f5[_0xa6d8('0x43')]==='string'&&_0x2935f5[_0xa6d8('0x47')]&&_0x2935f5[_0xa6d8('0x48')]){_0x22d6c8[_0xa6d8('0x49')][_0xa6d8('0x4a')]({'id':_0x2935f5['idField'],'value':_0x2935f5['content'][_0xa6d8('0x26')]()});}else if(_0x2935f5[_0xa6d8('0x43')]===_0xa6d8('0x4b')&&_0x2935f5[_0xa6d8('0x1e')]&&_0x2935f5[_0xa6d8('0x47')]&&_0x2935f5[_0xa6d8('0x48')]){_0x347667[_0x2935f5[_0xa6d8('0x1e')]]&&_0x22d6c8[_0xa6d8('0x49')]['push']({'id':_0x2935f5[_0xa6d8('0x47')],'value':_0x347667[_0x2935f5[_0xa6d8('0x1e')]][_0xa6d8('0x26')]()});}else if(_0x2935f5[_0xa6d8('0x43')]===_0xa6d8('0x4c')&&_0x2935f5[_0xa6d8('0x4d')]&&_0x2935f5[_0xa6d8('0x4d')][_0xa6d8('0xf')]&&_0x2935f5['idField']&&_0x2935f5[_0xa6d8('0x48')]){_0x347667[_0x2935f5[_0xa6d8('0x4d')][_0xa6d8('0xf')]['toLowerCase']()]&&_0x22d6c8[_0xa6d8('0x49')][_0xa6d8('0x4a')]({'id':_0x2935f5[_0xa6d8('0x47')],'value':_0x347667[_0x2935f5['Variable']['name'][_0xa6d8('0x46')]()][_0xa6d8('0x26')]()});}});}return _0x22d6c8;}function getConnection(_0x1d5a60){return request({'method':'POST','form':{'method':_0xa6d8('0x4e'),'input_type':_0xa6d8('0x20'),'response_type':_0xa6d8('0x20'),'rest_data':JSON[_0xa6d8('0x21')]({'user_auth':{'user_name':_0x1d5a60[_0xa6d8('0x4f')],'password':_0x1d5a60[_0xa6d8('0x50')],'encryption':_0xa6d8('0x51')},'application':_0xa6d8('0x52')})}})[_0xa6d8('0x2e')](function(_0x5ad72f){var _0x16b22e=_0x5ad72f;if(_0x16b22e['id']){def[_0xa6d8('0x53')]=_0x16b22e['id'];return BPromise[_0xa6d8('0x33')](_0x16b22e);}else{throw new Error(util['format'](_0xa6d8('0x54'),_0x1d5a60['id']));}});}function setRelationship(_0x5ade7b,_0x3b59c4,_0x10e05b,_0x5d7a8c){return request({'form':{'method':_0xa6d8('0x55'),'input_type':_0xa6d8('0x20'),'response_type':_0xa6d8('0x20'),'rest_data':JSON['stringify']({'session':_0x5ade7b['id'],'module_name':_0xa6d8('0x22'),'module_id':_0x10e05b['id'],'link_field_name':_0x5d7a8c,'related_ids':[_0x3b59c4['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xa6d8('0x56')]=function(_0x119e72,_0x4e9fdf,_0x368766,_0x2094b2,_0x26e2cb,_0x4352cc){var _0x4f5e0c,_0xdf3997,_0x34db02,_0x5ce0a6;_0x4352cc['remoteUri']=intUtil[_0xa6d8('0x57')](_0x4352cc['remoteUri']);_0x4352cc['serverUrl']=intUtil[_0xa6d8('0x57')](_0x4352cc[_0xa6d8('0x58')]);def[_0xa6d8('0x59')]=util[_0xa6d8('0x23')](_0xa6d8('0x5a'),_0x4352cc[_0xa6d8('0x5b')]);if(_0x26e2cb&&_0x26e2cb[_0xa6d8('0x5c')]){logger[_0xa6d8('0xd')](_0xa6d8('0x5d'),_0xa6d8('0x5e'));_0x4e9fdf[_0xa6d8('0x5f')]=util[_0xa6d8('0x23')](_0xa6d8('0x60'),_0x4352cc[_0xa6d8('0x58')],_0x4e9fdf[_0xa6d8('0x61')],md5(_0x4e9fdf[_0xa6d8('0x61')]));}else{_0x4e9fdf[_0xa6d8('0x5f')]='';}return getConnection(_0x4352cc)['then'](function(_0x48c6ae){_0x5ce0a6=_0x48c6ae;return getUser(_0x4352cc,_0x2094b2['name'],_0x5ce0a6);})[_0xa6d8('0x2e')](function(_0x5727b5){_0x4f5e0c=_0x5727b5;logger[_0xa6d8('0xd')]('The\x20User\x20ID\x20is:',_0x4f5e0c['id']);return getEndUser(_0x4352cc,_0x4e9fdf[_0xa6d8('0x62')],_0x4e9fdf[_0xa6d8('0x63')],_0x5ce0a6);})['then'](function(_0x12c419){_0xdf3997=_0x12c419;logger[_0xa6d8('0xd')]('The\x20Enduser\x20ID\x20is:',_0xdf3997['id']);return getTicket(_0x4352cc,_0x4f5e0c,_0xdf3997,_0x368766,_0x4e9fdf,_0x368766[_0xa6d8('0x64')],_0x5ce0a6,_0xa6d8('0x65'));})[_0xa6d8('0x2e')](function(_0x414b8c){_0x34db02=_0x414b8c;logger[_0xa6d8('0xd')](_0xa6d8('0x66'));logger[_0xa6d8('0xd')](_0xa6d8('0x67'),_0x34db02['id']);return setRelationship(_0x5ce0a6,_0x4f5e0c,_0x34db02,'users');})[_0xa6d8('0x2e')](function(){return setRelationship(_0x5ce0a6,_0xdf3997,_0x34db02,'contacts');})['then'](function(){return getServerInfo(_0x5ce0a6);})[_0xa6d8('0x2e')](function(_0x49c716){var _0x12b077=parseInt(_0x49c716[_0xa6d8('0x68')][_0xa6d8('0x69')](0x0));var _0x1f88c=util[_0xa6d8('0x23')](_0xa6d8('0x6a'),_0x4352cc[_0xa6d8('0x5b')],_0x34db02['id']);if(_0x12b077>0x6){_0x1f88c=util[_0xa6d8('0x23')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x4352cc['remoteUri'],_0x34db02['id']);}logger['info'](_0xa6d8('0x5d'),_0xa6d8('0x6b'));emit(util['format'](_0xa6d8('0x6c'),_0x2094b2['name']),_0xa6d8('0x6d'),{'uri':_0x1f88c});})['catch'](function(_0x562c03){logger[_0xa6d8('0x6e')](_0xa6d8('0x5d'),JSON['stringify'](_0x562c03));});};exports['outbound']=function(_0x4b31b9,_0x21c5b3,_0x1b5824,_0x91d50b,_0x199bbf,_0x27f9a8,_0x1b1605){var _0x11e3bc,_0x110393,_0x720102,_0x17dd7b;_0x27f9a8[_0xa6d8('0x5b')]=intUtil[_0xa6d8('0x57')](_0x27f9a8[_0xa6d8('0x5b')]);_0x27f9a8[_0xa6d8('0x58')]=intUtil[_0xa6d8('0x57')](_0x27f9a8[_0xa6d8('0x58')]);def[_0xa6d8('0x59')]=util['format'](_0xa6d8('0x5a'),_0x27f9a8[_0xa6d8('0x5b')]);if(_0x1b1605&&_0x1b1605['recordingFormat']&&_0x1b1605[_0xa6d8('0x6f')]!=='none'){logger[_0xa6d8('0xd')](_0xa6d8('0x70'),_0xa6d8('0x5e'));_0x21c5b3['recordingURL']=util[_0xa6d8('0x23')](_0xa6d8('0x60'),_0x27f9a8[_0xa6d8('0x58')],_0x21c5b3['uniqueid'],md5(_0x21c5b3[_0xa6d8('0x61')]));}return getConnection(_0x27f9a8)['then'](function(_0x449e94){_0x17dd7b=_0x449e94;return getUser(_0x27f9a8,_0x91d50b['name'],_0x17dd7b);})[_0xa6d8('0x2e')](function(_0x1d7a16){_0x11e3bc=_0x1d7a16;logger[_0xa6d8('0xd')](_0xa6d8('0x71'),_0x11e3bc['id']);return getEndUser(_0x27f9a8,_0x21c5b3[_0xa6d8('0x72')],_0x21c5b3[_0xa6d8('0x73')],_0x17dd7b);})[_0xa6d8('0x2e')](function(_0x3a9c9b){_0x110393=_0x3a9c9b;logger[_0xa6d8('0xd')](_0xa6d8('0x74'),_0x110393['id']);return getTicket(_0x27f9a8,_0x11e3bc,_0x110393,_0x1b5824,_0x21c5b3,_0x1b5824[_0xa6d8('0x64')],_0x17dd7b,'Outbound');})[_0xa6d8('0x2e')](function(_0x286af7){_0x720102=_0x286af7;logger[_0xa6d8('0xd')]('Ticket\x20created!');logger[_0xa6d8('0xd')]('The\x20Ticket\x20ID\x20is:',_0x720102['id']);return setRelationship(_0x17dd7b,_0x11e3bc,_0x720102,'users');})['then'](function(){return setRelationship(_0x17dd7b,_0x110393,_0x720102,_0xa6d8('0x75'));})[_0xa6d8('0x2e')](function(){return getServerInfo(_0x17dd7b);})[_0xa6d8('0x2e')](function(_0x1a5b20){var _0xcc23ac=parseInt(_0x1a5b20[_0xa6d8('0x68')][_0xa6d8('0x69')](0x0));var _0x3d6e1f=util[_0xa6d8('0x23')](_0xa6d8('0x6a'),_0x27f9a8[_0xa6d8('0x5b')],_0x720102['id']);if(_0xcc23ac>0x6){_0x3d6e1f=util[_0xa6d8('0x23')](_0xa6d8('0x76'),_0x27f9a8[_0xa6d8('0x5b')],_0x720102['id']);}logger[_0xa6d8('0xd')](_0xa6d8('0x70'),_0xa6d8('0x6b'));emit(util[_0xa6d8('0x23')]('user:%s',_0x91d50b[_0xa6d8('0xf')]),_0xa6d8('0x6d'),{'uri':_0x3d6e1f});})[_0xa6d8('0x77')](function(_0xf6d9b8){logger['error']('[OUTBOUND]',JSON['stringify'](_0xf6d9b8));});};exports[_0xa6d8('0x78')]=function(_0x4eaa2b,_0x229060,_0x88a256,_0x433243,_0xe0cf0b,_0x3b92ae){var _0x1aba5a,_0x5da400,_0x4c52ea,_0x54c6fd;_0x3b92ae[_0xa6d8('0x5b')]=intUtil[_0xa6d8('0x57')](_0x3b92ae[_0xa6d8('0x5b')]);_0x3b92ae[_0xa6d8('0x58')]=intUtil[_0xa6d8('0x57')](_0x3b92ae[_0xa6d8('0x58')]);def[_0xa6d8('0x59')]=util['format'](_0xa6d8('0x5a'),_0x3b92ae[_0xa6d8('0x5b')]);if(_0xe0cf0b&&_0xe0cf0b[_0xa6d8('0x5c')]){logger[_0xa6d8('0xd')]('['+_0x229060[_0xa6d8('0x79')][_0xa6d8('0x7a')]()+']',_0xa6d8('0x5e'));_0x229060['recordingURL']=util[_0xa6d8('0x23')](_0xa6d8('0x60'),_0x3b92ae[_0xa6d8('0x58')],_0x229060[_0xa6d8('0x61')],md5(_0x229060['uniqueid']));}else{_0x229060[_0xa6d8('0x5f')]='';}return getConnection(_0x3b92ae)['then'](function(_0x293728){_0x54c6fd=_0x293728;if(!_[_0xa6d8('0x29')](_0x433243)){return getUser(_0x3b92ae,_0x433243[_0xa6d8('0xf')],_0x54c6fd);}else{return getUser(_0x3b92ae,null,_0x54c6fd);}})[_0xa6d8('0x2e')](function(_0x1dc9b4){_0x1aba5a=_0x1dc9b4;logger[_0xa6d8('0xd')](_0xa6d8('0x71'),_0x1aba5a['id']);return getEndUser(_0x3b92ae,_0x229060['calleridname'],_0x229060[_0xa6d8('0x63')],_0x54c6fd);})['then'](function(_0x4ee940){_0x5da400=_0x4ee940;logger[_0xa6d8('0xd')]('The\x20Enduser\x20ID\x20is:',_0x5da400['id']);return getTicket(_0x3b92ae,_0x1aba5a,_0x5da400,_0x88a256,_0x229060,_0x88a256[_0xa6d8('0x64')],_0x54c6fd,_0xa6d8('0x65'));})[_0xa6d8('0x2e')](function(_0x42135e){_0x4c52ea=_0x42135e;logger[_0xa6d8('0xd')](_0xa6d8('0x66'));logger[_0xa6d8('0xd')](_0xa6d8('0x67'),_0x4c52ea['id']);return setRelationship(_0x54c6fd,_0x1aba5a,_0x4c52ea,_0xa6d8('0x7b'));})[_0xa6d8('0x2e')](function(){return setRelationship(_0x54c6fd,_0x5da400,_0x4c52ea,'contacts');})['then'](function(){return getServerInfo(_0x54c6fd);})[_0xa6d8('0x77')](function(_0x306a8e){logger['error']('['+_0x229060[_0xa6d8('0x79')][_0xa6d8('0x7a')]()+']',JSON[_0xa6d8('0x21')](_0x306a8e));});}; \ No newline at end of file +var _0x082b=['ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','info','Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','created_by','description','Descriptions','toISOString','slice','duration_hours','parent_id','Contacts','parent_name','name','direction','length','forEach','push','idField','variableName','JSON','Calls','format','toString','base64','get_server_info','stringify','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','Agent\x20found!','resolve','value','name_value_list','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','','Caller\x20-\x20%s','[HTTP]','merge','map','type','nameField','customField','toLowerCase','string','custom_fields','Variable','POST','login','username','password','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','serverUrl','stripTrailingSlash','uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','calleridname','calleridnum','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','outbound','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','user:%s','unmanaged','lastevent','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20Enduser\x20ID\x20is:','users','toUpperCase','lodash','request-promise','md5','util'];(function(_0x1a9b87,_0x4b9987){var _0x3e5a50=function(_0x488ffa){while(--_0x488ffa){_0x1a9b87['push'](_0x1a9b87['shift']());}};_0x3e5a50(++_0x4b9987);}(_0x082b,0xe8));var _0xb082=function(_0x263028,_0x19a701){_0x263028=_0x263028-0x0;var _0x5daa45=_0x082b[_0x263028];return _0x5daa45;};'use strict';var _=require(_0xb082('0x0'));var rp=require(_0xb082('0x1'));var BPromise=require('bluebird');var md5=require(_0xb082('0x2'));var util=require(_0xb082('0x3'));var Redis=require(_0xb082('0x4'));var intUtil=require(_0xb082('0x5'));var config=require(_0xb082('0x6'));var logger=require(_0xb082('0x7'))(_0xb082('0x8'));config[_0xb082('0x9')]=_['defaults'](config[_0xb082('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb082('0x9')]));var def={'method':'POST','json':!![]};function emit(_0x7a9027,_0x15cec0,_0x32b4fd){io['to'](_0x7a9027)['emit'](_0x15cec0,_0x32b4fd);}function getTicket(_0x3ab691,_0x2fecbb,_0x119d30,_0xec95ad,_0x2ee266,_0x1fdd9f,_0x478470,_0x136150){logger[_0xb082('0xa')](_0xb082('0xb'));var _0x2d14c8=new Date();var _0x1a4545=[{'name':'name','value':intUtil[_0xb082('0xc')](_0xec95ad[_0xb082('0xd')],_0x2ee266,'\x20')},{'name':_0xb082('0xe'),'value':_0x2fecbb['id']},{'name':_0xb082('0xf'),'value':_0x2fecbb['id']},{'name':_0xb082('0x10'),'value':intUtil[_0xb082('0xc')](_0xec95ad[_0xb082('0x11')],_0x2ee266,'\x0a')},{'name':'date_start','value':_0x2d14c8[_0xb082('0x12')]()[_0xb082('0x13')](0x0,0x13)['replace']('T','\x20')},{'name':_0xb082('0x14'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0xb082('0x15'),'value':_0x119d30['id']},{'name':'parent_type','value':_0xb082('0x16')},{'name':_0xb082('0x17'),'value':_0x119d30[_0xb082('0x18')]},{'name':_0xb082('0x19'),'value':_0x136150}];if(_0x1fdd9f[_0xb082('0x1a')]){_[_0xb082('0x1b')](_0x1fdd9f,function(_0x1224ca){if(_0x2ee266[_0x1224ca['variableName']]){_0x1a4545[_0xb082('0x1c')]({'name':_0x1224ca[_0xb082('0x1d')],'value':_0x2ee266[_0x1224ca[_0xb082('0x1e')]]});}});}return request({'form':{'method':'set_entry','input_type':_0xb082('0x1f'),'response_type':_0xb082('0x1f'),'rest_data':JSON['stringify']({'session':_0x478470['id'],'module_name':_0xb082('0x20'),'name_value_list':_0x1a4545})}});}function getAuth(_0xc0e49c){return util[_0xb082('0x21')]('Basic\x20%s',new Buffer(_0xc0e49c['apiKey']+':X')[_0xb082('0x22')](_0xb082('0x23')));}function getServerInfo(_0xf268d6){return request({'form':{'method':_0xb082('0x24'),'input_type':_0xb082('0x1f'),'response_type':'JSON','rest_data':JSON[_0xb082('0x25')]({'session':_0xf268d6['id']})}});}function getUser(_0x28ebcc,_0x19b4ae,_0x4cfad3){if(!_[_0xb082('0x26')](_0x19b4ae)){logger[_0xb082('0xa')](_0xb082('0x27'),_0x19b4ae);return request({'form':{'method':_0xb082('0x28'),'input_type':_0xb082('0x1f'),'response_type':_0xb082('0x1f'),'rest_data':JSON[_0xb082('0x25')]({'session':_0x4cfad3['id'],'module_name':_0xb082('0x29'),'query':util[_0xb082('0x21')](_0xb082('0x2a'),_0x19b4ae),'order_by':'','offset':'0','select_fields':['id','name',_0xb082('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xb082('0x2c')](function(_0x161d47){if(_0x161d47[_0xb082('0x2d')]['length']){var _0x378dcf=_[_0xb082('0x2e')](_0x161d47['entry_list'],function(_0x47198d){return _0x47198d['name_value_list']['user_name']['value']===_0x19b4ae;});if(_0x378dcf){logger['info'](_0xb082('0x2f'));return BPromise[_0xb082('0x30')]({'id':_0x378dcf['name_value_list']['id']['value'],'name':_0x378dcf['name_value_list'][_0xb082('0x18')][_0xb082('0x31')]});}}logger[_0xb082('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xb082('0x30')]({'id':_0x4cfad3[_0xb082('0x32')][_0xb082('0x33')][_0xb082('0x31')],'name':_0x4cfad3[_0xb082('0x32')][_0xb082('0x2b')][_0xb082('0x31')]});});}else{logger['info'](_0xb082('0x34'));return BPromise[_0xb082('0x30')]({'id':_0x4cfad3[_0xb082('0x32')][_0xb082('0x33')][_0xb082('0x31')],'name':_0x4cfad3['name_value_list'][_0xb082('0x2b')][_0xb082('0x31')]});}}function getEndUser(_0x266f06,_0x5c561a,_0x1faffb,_0x4c74a2){logger[_0xb082('0xa')]('Searching\x20enduser\x20with\x20phone',_0x1faffb);return request({'form':{'method':_0xb082('0x28'),'input_type':_0xb082('0x1f'),'response_type':'JSON','rest_data':JSON[_0xb082('0x25')]({'session':_0x4c74a2['id'],'module_name':'Contacts','query':util['format'](_0xb082('0x35'),_0x1faffb),'order_by':'','offset':'0','select_fields':['id',_0xb082('0x18'),_0xb082('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xb082('0x2c')](function(_0x4aff19){if(_0x4aff19[_0xb082('0x2d')][_0xb082('0x1a')]){var _0x2091d6=_[_0xb082('0x2e')](_0x4aff19[_0xb082('0x2d')],function(_0x5da63e){return _0x5da63e[_0xb082('0x32')]['phone_home'][_0xb082('0x31')]===_0x1faffb;});if(_0x2091d6){logger[_0xb082('0xa')](_0xb082('0x37'));return BPromise[_0xb082('0x30')]({'id':_0x2091d6[_0xb082('0x32')]['id'][_0xb082('0x31')],'name':_0x2091d6[_0xb082('0x32')]['name'][_0xb082('0x31')],'phone':_0x2091d6[_0xb082('0x32')]['phone_home'][_0xb082('0x31')]});}}else{logger[_0xb082('0xa')](_0xb082('0x38'));return request({'form':{'method':_0xb082('0x39'),'input_type':_0xb082('0x1f'),'response_type':'JSON','rest_data':JSON[_0xb082('0x25')]({'session':_0x4c74a2['id'],'module_name':_0xb082('0x16'),'name_value_list':[{'name':_0xb082('0x3a'),'value':_0x5c561a!==_0xb082('0x3b')?_0x5c561a:util['format'](_0xb082('0x3c'),_0x1faffb)},{'name':'phone_home','value':_0x1faffb}]})}})['then'](function(_0xef6cc8){logger['info']('Enduser\x20created.');return BPromise['resolve']({'id':_0xef6cc8['id'],'name':_0xef6cc8['entry_list'][_0xb082('0x3a')][_0xb082('0x31')],'phone':_0xef6cc8[_0xb082('0x2d')][_0xb082('0x36')][_0xb082('0x31')]});});}});}function request(_0x3006ed){logger['debug'](_0xb082('0x3d'),JSON[_0xb082('0x25')](_0x3006ed));return rp(_[_0xb082('0x3e')](def,_0x3006ed));}function getTags(_0x16e52f,_0x3ece30){var _0x412570=[];if(_0x16e52f&&_0x16e52f[_0xb082('0x1a')]>0x0){_0x412570=_[_0xb082('0x3f')](_0x16e52f,_0x3ece30);}return _0x412570;}function getCustomFields(_0x3c744c,_0x17a095){var _0x48c66b=[];var _0x59fa64={'custom_fields':[]};if(_0x3c744c[_0xb082('0x1a')]>0x0){_['forEach'](_0x3c744c,function(_0x3eb214){if(_0x3eb214[_0xb082('0x40')]==='string'&&_0x3eb214[_0xb082('0x41')]&&!_0x3eb214[_0xb082('0x42')]){_0x59fa64[_0x3eb214[_0xb082('0x41')][_0xb082('0x43')]()]=_0x3eb214['content'][_0xb082('0x22')]();}else if(_0x3eb214['type']===_0xb082('0x44')&&_0x3eb214[_0xb082('0x1d')]&&_0x3eb214[_0xb082('0x42')]){_0x59fa64[_0xb082('0x45')][_0xb082('0x1c')]({'id':_0x3eb214[_0xb082('0x1d')],'value':_0x3eb214['content'][_0xb082('0x22')]()});}else if(_0x3eb214['type']==='variable'&&_0x3eb214[_0xb082('0x1e')]&&_0x3eb214[_0xb082('0x1d')]&&_0x3eb214[_0xb082('0x42')]){_0x17a095[_0x3eb214[_0xb082('0x1e')]]&&_0x59fa64[_0xb082('0x45')][_0xb082('0x1c')]({'id':_0x3eb214[_0xb082('0x1d')],'value':_0x17a095[_0x3eb214['variableName']][_0xb082('0x22')]()});}else if(_0x3eb214[_0xb082('0x40')]==='customVariable'&&_0x3eb214[_0xb082('0x46')]&&_0x3eb214[_0xb082('0x46')]['name']&&_0x3eb214[_0xb082('0x1d')]&&_0x3eb214['customField']){_0x17a095[_0x3eb214['Variable'][_0xb082('0x18')][_0xb082('0x43')]()]&&_0x59fa64[_0xb082('0x45')][_0xb082('0x1c')]({'id':_0x3eb214[_0xb082('0x1d')],'value':_0x17a095[_0x3eb214[_0xb082('0x46')][_0xb082('0x18')][_0xb082('0x43')]()]['toString']()});}});}return _0x59fa64;}function getConnection(_0x2f6540){return request({'method':_0xb082('0x47'),'form':{'method':_0xb082('0x48'),'input_type':_0xb082('0x1f'),'response_type':_0xb082('0x1f'),'rest_data':JSON[_0xb082('0x25')]({'user_auth':{'user_name':_0x2f6540[_0xb082('0x49')],'password':_0x2f6540[_0xb082('0x4a')],'encryption':'PLAIN'},'application':_0xb082('0x4b')})}})['then'](function(_0x3f4228){var _0x308262=_0x3f4228;if(_0x308262['id']){def['sessionID']=_0x308262['id'];return BPromise[_0xb082('0x30')](_0x308262);}else{throw new Error(util['format'](_0xb082('0x4c'),_0x2f6540['id']));}});}function setRelationship(_0x393a20,_0x39fe26,_0x4da463,_0x207e60){return request({'form':{'method':'set_relationship','input_type':_0xb082('0x1f'),'response_type':_0xb082('0x1f'),'rest_data':JSON[_0xb082('0x25')]({'session':_0x393a20['id'],'module_name':_0xb082('0x20'),'module_id':_0x4da463['id'],'link_field_name':_0x207e60,'related_ids':[_0x39fe26['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xb082('0x4d')]=function(_0x211e73,_0x1b267f,_0x4773a7,_0x11910a,_0x55bccb,_0x7a9403){var _0x42cf8b,_0x3e834d,_0x3e48b8,_0x482f47;_0x7a9403['remoteUri']=intUtil['stripTrailingSlash'](_0x7a9403[_0xb082('0x4e')]);_0x7a9403[_0xb082('0x4f')]=intUtil[_0xb082('0x50')](_0x7a9403['serverUrl']);def[_0xb082('0x51')]=util[_0xb082('0x21')]('%s/service/v4_1/rest.php',_0x7a9403[_0xb082('0x4e')]);if(_0x55bccb&&_0x55bccb[_0xb082('0x52')]){logger[_0xb082('0xa')](_0xb082('0x53'),_0xb082('0x54'));_0x1b267f[_0xb082('0x55')]=util[_0xb082('0x21')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x7a9403[_0xb082('0x4f')],_0x1b267f['uniqueid'],md5(_0x1b267f['uniqueid']));}else{_0x1b267f[_0xb082('0x55')]='';}return getConnection(_0x7a9403)['then'](function(_0xc2f9d){_0x482f47=_0xc2f9d;return getUser(_0x7a9403,_0x11910a[_0xb082('0x18')],_0x482f47);})[_0xb082('0x2c')](function(_0xf936e3){_0x42cf8b=_0xf936e3;logger[_0xb082('0xa')]('The\x20User\x20ID\x20is:',_0x42cf8b['id']);return getEndUser(_0x7a9403,_0x1b267f[_0xb082('0x56')],_0x1b267f[_0xb082('0x57')],_0x482f47);})[_0xb082('0x2c')](function(_0x4b1c2a){_0x3e834d=_0x4b1c2a;logger[_0xb082('0xa')]('The\x20Enduser\x20ID\x20is:',_0x3e834d['id']);return getTicket(_0x7a9403,_0x42cf8b,_0x3e834d,_0x4773a7,_0x1b267f,_0x4773a7[_0xb082('0x58')],_0x482f47,_0xb082('0x59'));})[_0xb082('0x2c')](function(_0x194bbf){_0x3e48b8=_0x194bbf;logger[_0xb082('0xa')](_0xb082('0x5a'));logger[_0xb082('0xa')](_0xb082('0x5b'),_0x3e48b8['id']);return setRelationship(_0x482f47,_0x42cf8b,_0x3e48b8,'users');})[_0xb082('0x2c')](function(){return setRelationship(_0x482f47,_0x3e834d,_0x3e48b8,_0xb082('0x5c'));})[_0xb082('0x2c')](function(){return getServerInfo(_0x482f47);})[_0xb082('0x2c')](function(_0x7e461b){var _0xdcc917=parseInt(_0x7e461b[_0xb082('0x5d')][_0xb082('0x5e')](0x0));var _0x5e1001=util['format'](_0xb082('0x5f'),_0x7a9403[_0xb082('0x4e')],_0x3e48b8['id']);if(_0xdcc917>0x6){_0x5e1001=util['format'](_0xb082('0x60'),_0x7a9403[_0xb082('0x4e')],_0x3e48b8['id']);}logger[_0xb082('0xa')]('[QUEUE]',_0xb082('0x61'));emit(util[_0xb082('0x21')]('user:%s',_0x11910a[_0xb082('0x18')]),_0xb082('0x62'),{'uri':_0x5e1001});})[_0xb082('0x63')](function(_0x426326){logger[_0xb082('0x64')]('[QUEUE]',JSON['stringify'](_0x426326));});};exports[_0xb082('0x65')]=function(_0x138849,_0x4d8572,_0x10c340,_0x456552,_0x2201cc,_0x2fb88b,_0x1a0509){var _0x147487,_0x17c411,_0x4bd0ba,_0x572bee;_0x2fb88b[_0xb082('0x4e')]=intUtil['stripTrailingSlash'](_0x2fb88b[_0xb082('0x4e')]);_0x2fb88b['serverUrl']=intUtil[_0xb082('0x50')](_0x2fb88b[_0xb082('0x4f')]);def[_0xb082('0x51')]=util['format'](_0xb082('0x66'),_0x2fb88b[_0xb082('0x4e')]);if(_0x1a0509&&_0x1a0509['recordingFormat']&&_0x1a0509[_0xb082('0x67')]!==_0xb082('0x68')){logger[_0xb082('0xa')](_0xb082('0x69'),_0xb082('0x54'));_0x4d8572[_0xb082('0x55')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2fb88b['serverUrl'],_0x4d8572[_0xb082('0x6a')],md5(_0x4d8572[_0xb082('0x6a')]));}return getConnection(_0x2fb88b)[_0xb082('0x2c')](function(_0x562a99){_0x572bee=_0x562a99;return getUser(_0x2fb88b,_0x456552['name'],_0x572bee);})[_0xb082('0x2c')](function(_0x381f6f){_0x147487=_0x381f6f;logger['info'](_0xb082('0x6b'),_0x147487['id']);return getEndUser(_0x2fb88b,_0x4d8572[_0xb082('0x6c')],_0x4d8572[_0xb082('0x6d')],_0x572bee);})[_0xb082('0x2c')](function(_0x1c0e87){_0x17c411=_0x1c0e87;logger[_0xb082('0xa')]('The\x20Enduser\x20ID\x20is:',_0x17c411['id']);return getTicket(_0x2fb88b,_0x147487,_0x17c411,_0x10c340,_0x4d8572,_0x10c340[_0xb082('0x58')],_0x572bee,_0xb082('0x6e'));})[_0xb082('0x2c')](function(_0x295cbc){_0x4bd0ba=_0x295cbc;logger['info'](_0xb082('0x5a'));logger[_0xb082('0xa')](_0xb082('0x5b'),_0x4bd0ba['id']);return setRelationship(_0x572bee,_0x147487,_0x4bd0ba,'users');})[_0xb082('0x2c')](function(){return setRelationship(_0x572bee,_0x17c411,_0x4bd0ba,_0xb082('0x5c'));})[_0xb082('0x2c')](function(){return getServerInfo(_0x572bee);})[_0xb082('0x2c')](function(_0x3499b9){var _0x80189f=parseInt(_0x3499b9[_0xb082('0x5d')]['charAt'](0x0));var _0x5ebda4=util['format'](_0xb082('0x5f'),_0x2fb88b['remoteUri'],_0x4bd0ba['id']);if(_0x80189f>0x6){_0x5ebda4=util['format'](_0xb082('0x60'),_0x2fb88b[_0xb082('0x4e')],_0x4bd0ba['id']);}logger['info']('[OUTBOUND]',_0xb082('0x61'));emit(util[_0xb082('0x21')](_0xb082('0x6f'),_0x456552[_0xb082('0x18')]),_0xb082('0x62'),{'uri':_0x5ebda4});})[_0xb082('0x63')](function(_0xba7f77){logger[_0xb082('0x64')]('[OUTBOUND]',JSON[_0xb082('0x25')](_0xba7f77));});};exports[_0xb082('0x70')]=function(_0x2b2ae1,_0x53c2b5,_0x1bc1af,_0x186d72,_0x1be44b,_0x13d1f5){var _0x203a97,_0x1b3b46,_0x4100f2,_0x398039;_0x13d1f5[_0xb082('0x4e')]=intUtil['stripTrailingSlash'](_0x13d1f5[_0xb082('0x4e')]);_0x13d1f5['serverUrl']=intUtil[_0xb082('0x50')](_0x13d1f5[_0xb082('0x4f')]);def['uri']=util[_0xb082('0x21')](_0xb082('0x66'),_0x13d1f5['remoteUri']);if(_0x1be44b&&_0x1be44b['monitor_format']){logger[_0xb082('0xa')]('['+_0x53c2b5[_0xb082('0x71')]['toUpperCase']()+']',_0xb082('0x54'));_0x53c2b5[_0xb082('0x55')]=util[_0xb082('0x21')](_0xb082('0x72'),_0x13d1f5[_0xb082('0x4f')],_0x53c2b5[_0xb082('0x6a')],md5(_0x53c2b5['uniqueid']));}else{_0x53c2b5[_0xb082('0x55')]='';}return getConnection(_0x13d1f5)[_0xb082('0x2c')](function(_0x5fca1c){_0x398039=_0x5fca1c;if(!_[_0xb082('0x26')](_0x186d72)){return getUser(_0x13d1f5,_0x186d72[_0xb082('0x18')],_0x398039);}else{return getUser(_0x13d1f5,null,_0x398039);}})[_0xb082('0x2c')](function(_0x451800){_0x203a97=_0x451800;logger[_0xb082('0xa')]('The\x20User\x20ID\x20is:',_0x203a97['id']);return getEndUser(_0x13d1f5,_0x53c2b5[_0xb082('0x56')],_0x53c2b5['calleridnum'],_0x398039);})[_0xb082('0x2c')](function(_0x266472){_0x1b3b46=_0x266472;logger[_0xb082('0xa')](_0xb082('0x73'),_0x1b3b46['id']);return getTicket(_0x13d1f5,_0x203a97,_0x1b3b46,_0x1bc1af,_0x53c2b5,_0x1bc1af[_0xb082('0x58')],_0x398039,'Inbound');})[_0xb082('0x2c')](function(_0x311619){_0x4100f2=_0x311619;logger[_0xb082('0xa')](_0xb082('0x5a'));logger[_0xb082('0xa')](_0xb082('0x5b'),_0x4100f2['id']);return setRelationship(_0x398039,_0x203a97,_0x4100f2,_0xb082('0x74'));})[_0xb082('0x2c')](function(){return setRelationship(_0x398039,_0x1b3b46,_0x4100f2,_0xb082('0x5c'));})['then'](function(){return getServerInfo(_0x398039);})['catch'](function(_0x821803){logger[_0xb082('0x64')]('['+_0x53c2b5[_0xb082('0x71')][_0xb082('0x75')]()+']',JSON[_0xb082('0x25')](_0x821803));});}; \ 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 20ae79d..3e71331 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 _0x4323=['%s:\x20%s','join','stripTrailingSlash','substring','validateEmail','test','getString','length','sortBy','string','content','type','variable','variableName','push','toString','customVariable','Variable','name','toLowerCase','key','keyContent','keyType','format'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4323,0x16e));var _0x3432=function(_0x32974a,_0xd71e64){_0x32974a=_0x32974a-0x0;var _0x29fb8b=_0x4323[_0x32974a];return _0x29fb8b;};'use strict';var _=require('lodash');var util=require('util');exports[_0x3432('0x0')]=function(_0x2b6356,_0x5c19a1,_0x2fbfd9){var _0x5e3d93=[];if(_0x2b6356[_0x3432('0x1')]>0x0){var _0x1c53e9=_[_0x3432('0x2')](_0x2b6356,['id']);for(var _0x248d77=0x0;_0x248d77<_0x1c53e9[_0x3432('0x1')];_0x248d77++){var _0x3ce452=_0x1c53e9[_0x248d77];if(_0x3ce452['type']===_0x3432('0x3')){_0x5e3d93['push'](_0x3ce452[_0x3432('0x4')]);}else if(_0x3ce452[_0x3432('0x5')]===_0x3432('0x6')&&_0x3ce452[_0x3432('0x7')]){_0x5c19a1[_0x3ce452['variableName']]&&_0x5e3d93[_0x3432('0x8')](_0x5c19a1[_0x3ce452[_0x3432('0x7')]][_0x3432('0x9')]());}else if(_0x3ce452[_0x3432('0x5')]===_0x3432('0xa')&&_0x3ce452[_0x3432('0xb')]&&_0x3ce452[_0x3432('0xb')][_0x3432('0xc')]){_0x5c19a1[_0x3ce452[_0x3432('0xb')][_0x3432('0xc')][_0x3432('0xd')]()]&&_0x5e3d93['push'](_0x5c19a1[_0x3ce452[_0x3432('0xb')][_0x3432('0xc')]['toLowerCase']()][_0x3432('0x9')]());}else if(_0x3ce452['type']==='keyValue'){if(_0x3ce452['keyType']===_0x3432('0x3')&&_0x3ce452[_0x3432('0xe')]){_0x5e3d93[_0x3432('0x8')](util['format']('%s:\x20%s',_0x3ce452['key'],_0x3ce452[_0x3432('0xf')]));}else if(_0x3ce452[_0x3432('0x10')]===_0x3432('0x6')&&_0x3ce452[_0x3432('0x7')]&&_0x3ce452[_0x3432('0xe')]){_0x5c19a1[_0x3ce452[_0x3432('0x7')]]&&_0x5e3d93['push'](util[_0x3432('0x11')]('%s:\x20%s',_0x3ce452[_0x3432('0xe')],_0x5c19a1[_0x3ce452[_0x3432('0x7')]]));}else if(_0x3ce452[_0x3432('0x10')]===_0x3432('0xa')&&_0x3ce452['Variable']&&_0x3ce452[_0x3432('0xb')][_0x3432('0xc')]&&_0x3ce452[_0x3432('0xe')]){_0x5c19a1[_0x3ce452[_0x3432('0xb')][_0x3432('0xc')]['toLowerCase']()]&&_0x5e3d93['push'](util[_0x3432('0x11')](_0x3432('0x12'),_0x3ce452[_0x3432('0xe')],_0x5c19a1[_0x3ce452[_0x3432('0xb')][_0x3432('0xc')]['toLowerCase']()]));}}}}return _0x5e3d93[_0x3432('0x13')](_0x2fbfd9);};exports[_0x3432('0x14')]=function(_0x2fc919){var _0x2904c9=_0x2fc919['slice'](-0x1);if(_0x2904c9==='/'){_0x2fc919=_0x2fc919[_0x3432('0x15')](0x0,_0x2fc919['lastIndexOf'](_0x2904c9));}return _0x2fc919;};exports[_0x3432('0x16')]=function(_0x512a82){if(!_['isNil'](_0x512a82)&&_0x512a82!==''){var _0x1cc786=/^(([^<>()\[\]\\.,;:\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 _0x1cc786[_0x3432('0x17')](String(_0x512a82)[_0x3432('0xd')]());}else{return![];}}; \ No newline at end of file +var _0xdcf0=['isNil','test','lodash','getString','length','string','push','content','type','variable','variableName','toString','Variable','name','toLowerCase','keyValue','format','key','%s:\x20%s','keyType','customVariable','join','stripTrailingSlash','slice','substring','lastIndexOf'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0xdcf0,0x1a2));var _0x0dcf=function(_0x2f36f6,_0xcff7b){_0x2f36f6=_0x2f36f6-0x0;var _0xf1cd55=_0xdcf0[_0x2f36f6];return _0xf1cd55;};'use strict';var _=require(_0x0dcf('0x0'));var util=require('util');exports[_0x0dcf('0x1')]=function(_0x4babf9,_0xc71341,_0x15ed01){var _0x1978a9=[];if(_0x4babf9[_0x0dcf('0x2')]>0x0){var _0xb6fd32=_['sortBy'](_0x4babf9,['id']);for(var _0x1a53bf=0x0;_0x1a53bf<_0xb6fd32['length'];_0x1a53bf++){var _0x42e739=_0xb6fd32[_0x1a53bf];if(_0x42e739['type']===_0x0dcf('0x3')){_0x1978a9[_0x0dcf('0x4')](_0x42e739[_0x0dcf('0x5')]);}else if(_0x42e739[_0x0dcf('0x6')]===_0x0dcf('0x7')&&_0x42e739[_0x0dcf('0x8')]){_0xc71341[_0x42e739[_0x0dcf('0x8')]]&&_0x1978a9[_0x0dcf('0x4')](_0xc71341[_0x42e739[_0x0dcf('0x8')]][_0x0dcf('0x9')]());}else if(_0x42e739[_0x0dcf('0x6')]==='customVariable'&&_0x42e739['Variable']&&_0x42e739[_0x0dcf('0xa')]['name']){_0xc71341[_0x42e739[_0x0dcf('0xa')][_0x0dcf('0xb')][_0x0dcf('0xc')]()]&&_0x1978a9['push'](_0xc71341[_0x42e739[_0x0dcf('0xa')]['name'][_0x0dcf('0xc')]()][_0x0dcf('0x9')]());}else if(_0x42e739['type']===_0x0dcf('0xd')){if(_0x42e739['keyType']===_0x0dcf('0x3')&&_0x42e739['key']){_0x1978a9['push'](util[_0x0dcf('0xe')]('%s:\x20%s',_0x42e739[_0x0dcf('0xf')],_0x42e739['keyContent']));}else if(_0x42e739['keyType']===_0x0dcf('0x7')&&_0x42e739['variableName']&&_0x42e739[_0x0dcf('0xf')]){_0xc71341[_0x42e739[_0x0dcf('0x8')]]&&_0x1978a9[_0x0dcf('0x4')](util['format'](_0x0dcf('0x10'),_0x42e739['key'],_0xc71341[_0x42e739[_0x0dcf('0x8')]]));}else if(_0x42e739[_0x0dcf('0x11')]===_0x0dcf('0x12')&&_0x42e739[_0x0dcf('0xa')]&&_0x42e739[_0x0dcf('0xa')][_0x0dcf('0xb')]&&_0x42e739[_0x0dcf('0xf')]){_0xc71341[_0x42e739[_0x0dcf('0xa')][_0x0dcf('0xb')][_0x0dcf('0xc')]()]&&_0x1978a9[_0x0dcf('0x4')](util[_0x0dcf('0xe')](_0x0dcf('0x10'),_0x42e739[_0x0dcf('0xf')],_0xc71341[_0x42e739['Variable'][_0x0dcf('0xb')][_0x0dcf('0xc')]()]));}}}}return _0x1978a9[_0x0dcf('0x13')](_0x15ed01);};exports[_0x0dcf('0x14')]=function(_0x2ca093){var _0xc4d71f=_0x2ca093[_0x0dcf('0x15')](-0x1);if(_0xc4d71f==='/'){_0x2ca093=_0x2ca093[_0x0dcf('0x16')](0x0,_0x2ca093[_0x0dcf('0x17')](_0xc4d71f));}return _0x2ca093;};exports['validateEmail']=function(_0xa8a820){if(!_[_0x0dcf('0x18')](_0xa8a820)&&_0xa8a820!==''){var _0x47fde=/^(([^<>()\[\]\\.,;:\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 _0x47fde[_0x0dcf('0x19')](String(_0xa8a820)[_0x0dcf('0xc')]());}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 89de09f..a50bc42 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x120a26,_0x468946){var _0x3ab752=function(_0x1640cb){while(--_0x1640cb){_0x120a26['push'](_0x120a26['shift']());}};_0x3ab752(++_0x468946);}(_0x9c44,0x178));var _0x49c4=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x9c44[_0x13e741];return _0x3f8bb3;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file +var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');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 emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ 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 41119e4..2a5ad4c 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 _0x7267=['variableName','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','Authorization','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','%s/channels/voice/agents/%d/tickets/%d/display.json','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','calleridname','toUpperCase','request-promise','md5','ioredis','./util','../../../../config/environment','zendesk','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','Tags','name','getString','Subjects','Descriptions','Fields','then','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','type:user\x20role:end-user\x20phone:%s','length','filter','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Caller\x20-\x20%s','Enduser\x20created.','user','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','custom_fields','push','variable'];(function(_0x474376,_0x385824){var _0x9141b=function(_0x229a9f){while(--_0x229a9f){_0x474376['push'](_0x474376['shift']());}};_0x9141b(++_0x385824);}(_0x7267,0x111));var _0x7726=function(_0x2fb76f,_0x530991){_0x2fb76f=_0x2fb76f-0x0;var _0x2706e7=_0x7267[_0x2fb76f];return _0x2706e7;};'use strict';var _=require('lodash');var rp=require(_0x7726('0x0'));var md5=require(_0x7726('0x1'));var util=require('util');var Redis=require(_0x7726('0x2'));var intUtil=require(_0x7726('0x3'));var config=require(_0x7726('0x4'));var logger=require('../../../../config/logger')(_0x7726('0x5'));config[_0x7726('0x6')]=_[_0x7726('0x7')](config[_0x7726('0x6')],{'host':_0x7726('0x8'),'port':0x18eb});var io=require(_0x7726('0x9'))(new Redis(config['redis']));function emit(_0x56867d,_0x2e8c60,_0x4dd10b){io['to'](_0x56867d)['emit'](_0x2e8c60,_0x4dd10b);}var headers={'Content-Type':'application/json','Accept':_0x7726('0xa')};function getTicket(_0x25ac09,_0x3ca7d8,_0x48cdf5,_0x712eb5,_0x1814b7){logger[_0x7726('0xb')](_0x7726('0xc'));return request({'uri':util[_0x7726('0xd')](_0x7726('0xe'),_0x25ac09[_0x7726('0xf')]),'method':_0x7726('0x10'),'body':{'ticket':_['merge']({'requester_id':_0x48cdf5['id'],'submitter_id':_0x3ca7d8?_0x3ca7d8['id']:undefined,'assignee_id':_0x3ca7d8?_0x3ca7d8['id']:undefined,'tags':getTags(_0x712eb5[_0x7726('0x11')],_0x7726('0x12')),'subject':intUtil[_0x7726('0x13')](_0x712eb5[_0x7726('0x14')],_0x1814b7,'\x20'),'description':intUtil[_0x7726('0x13')](_0x712eb5[_0x7726('0x15')],_0x1814b7,'\x0a'),'comment':{'public':![],'body':intUtil[_0x7726('0x13')](_0x712eb5[_0x7726('0x15')],_0x1814b7,'\x0a')}},getCustomFields(_0x712eb5[_0x7726('0x16')],_0x1814b7))}})[_0x7726('0x17')](function(_0x5e76d0){logger[_0x7726('0xb')]('Ticket\x20created!');return _0x5e76d0[_0x7726('0x18')];});}function getUser(_0x4c0ecb,_0x5e6b9f){if(intUtil[_0x7726('0x19')](_0x5e6b9f)){logger['info'](_0x7726('0x1a'),_0x5e6b9f);return request({'uri':util[_0x7726('0xd')](_0x7726('0x1b'),_0x4c0ecb[_0x7726('0xf')]),'qs':{'query':util[_0x7726('0xd')](_0x7726('0x1c'),_0x5e6b9f)}})['then'](function(_0x384866){if(_0x384866[_0x7726('0x1d')]){logger[_0x7726('0xb')](_0x7726('0x1e'));return _[_0x7726('0x1f')](_0x384866[_0x7726('0x20')],{'email':_0x5e6b9f,'role':_0x7726('0x21')});}else{logger[_0x7726('0xb')](_0x7726('0x22'));return request({'uri':util[_0x7726('0xd')](_0x7726('0x23'),_0x4c0ecb[_0x7726('0xf')])})[_0x7726('0x17')](function(_0x2c5ee6){logger[_0x7726('0xb')](_0x7726('0x24'));return _0x2c5ee6['user'];});}});}else{logger[_0x7726('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x7726('0xd')](_0x7726('0x23'),_0x4c0ecb[_0x7726('0xf')])})[_0x7726('0x17')](function(_0x259d75){logger[_0x7726('0xb')]('Admin\x20account\x20selected.');return _0x259d75['user'];});}}function getEndUser(_0x3d5b32,_0x25ce38,_0x23d80d){logger[_0x7726('0xb')]('Searching\x20enduser\x20with\x20phone',_0x23d80d);return request({'uri':util[_0x7726('0xd')](_0x7726('0x1b'),_0x3d5b32[_0x7726('0xf')]),'qs':{'query':util[_0x7726('0xd')](_0x7726('0x25'),_0x23d80d)}})[_0x7726('0x17')](function(_0x30ea52){var _0x583e88;if(_0x30ea52['results'][_0x7726('0x26')]){_0x30ea52[_0x7726('0x20')]=_[_0x7726('0x27')](_0x30ea52[_0x7726('0x20')],{'suspended':![],'role':'end-user'});if(_0x30ea52['results'][_0x7726('0x26')]){_0x583e88=_[_0x7726('0x28')](_0x30ea52[_0x7726('0x20')]);}}if(_0x583e88){logger[_0x7726('0xb')](_0x7726('0x29'));return _0x583e88;}else{logger[_0x7726('0xb')](_0x7726('0x2a'));return request({'uri':util[_0x7726('0xd')](_0x7726('0x2b'),_0x3d5b32[_0x7726('0xf')]),'method':'POST','body':{'user':{'role':_0x7726('0x2c'),'name':util[_0x7726('0xd')](_0x7726('0x2d'),_0x25ce38||_0x23d80d),'phone':_0x23d80d}}})[_0x7726('0x17')](function(_0x184f77){logger['info'](_0x7726('0x2e'));return _0x184f77[_0x7726('0x2f')];});}});}function getAuth(_0x1fce16){var _0x54be74;if(_0x1fce16[_0x7726('0x30')]===_0x7726('0x31')){_0x54be74=util['format'](_0x7726('0x32'),_0x1fce16[_0x7726('0x33')],_0x1fce16[_0x7726('0x31')]);}else if(_0x1fce16[_0x7726('0x30')]===_0x7726('0x34')){_0x54be74=util[_0x7726('0xd')](_0x7726('0x35'),_0x1fce16[_0x7726('0x33')],_0x1fce16['token']);}return util[_0x7726('0xd')](_0x7726('0x36'),new Buffer(_0x54be74)[_0x7726('0x37')](_0x7726('0x38')));}function request(_0x428fc3){logger[_0x7726('0x39')](_0x7726('0x3a'),JSON[_0x7726('0x3b')](_0x428fc3));return rp(_['defaults'](_0x428fc3,{'method':_0x7726('0x3c'),'headers':headers,'json':!![]}));}function getTags(_0x277646,_0x178dda){var _0x585351=[];if(_0x277646&&_0x277646['length']>0x0){_0x585351=_[_0x7726('0x3d')](_0x277646,_0x178dda);}return _0x585351;}function getCustomFields(_0x449cb8,_0x4a3dc5){var _0x30757e=[];var _0x22f40e={'custom_fields':[]};if(_0x449cb8[_0x7726('0x26')]>0x0){_[_0x7726('0x3e')](_0x449cb8,function(_0x30cf8b){if(_[_0x7726('0x3f')]([_0x7726('0x40'),_0x7726('0x41')],_0x30cf8b[_0x7726('0x42')])&&_0x30cf8b[_0x7726('0x43')]&&!_0x30cf8b[_0x7726('0x44')]){_0x22f40e[_0x30cf8b['nameField'][_0x7726('0x45')]()]=_0x30cf8b[_0x7726('0x46')]['toString']();}else if(_[_0x7726('0x3f')]([_0x7726('0x40'),_0x7726('0x41')],_0x30cf8b[_0x7726('0x42')])&&_0x30cf8b[_0x7726('0x47')]&&_0x30cf8b[_0x7726('0x44')]){_0x22f40e[_0x7726('0x48')][_0x7726('0x49')]({'id':_0x30cf8b[_0x7726('0x47')],'value':_0x30cf8b[_0x7726('0x46')][_0x7726('0x37')]()});}else if(_0x30cf8b['type']===_0x7726('0x4a')&&_0x30cf8b[_0x7726('0x4b')]&&_0x30cf8b[_0x7726('0x47')]&&_0x30cf8b[_0x7726('0x44')]){_0x4a3dc5[_0x30cf8b[_0x7726('0x4b')]]&&_0x22f40e[_0x7726('0x48')][_0x7726('0x49')]({'id':_0x30cf8b['idField'],'value':_0x4a3dc5[_0x30cf8b['variableName']][_0x7726('0x37')]()});}else if(_0x30cf8b[_0x7726('0x42')]===_0x7726('0x4c')&&_0x30cf8b['Variable']&&_0x30cf8b[_0x7726('0x4d')][_0x7726('0x12')]&&_0x30cf8b[_0x7726('0x47')]&&_0x30cf8b['customField']){_0x4a3dc5[_0x30cf8b[_0x7726('0x4d')][_0x7726('0x12')]['toLowerCase']()]&&_0x22f40e[_0x7726('0x48')][_0x7726('0x49')]({'id':_0x30cf8b[_0x7726('0x47')],'value':_0x4a3dc5[_0x30cf8b[_0x7726('0x4d')]['name'][_0x7726('0x45')]()][_0x7726('0x37')]()});}});}return _0x22f40e;}exports['queue']=function(_0x452b6d,_0xaf1d71,_0x15c586,_0x198a36,_0x4d9264,_0x42748b){var _0x27e3d0,_0x2e438f;_0x42748b['remoteUri']=intUtil[_0x7726('0x4e')](_0x42748b[_0x7726('0xf')]);_0x42748b[_0x7726('0x4f')]=intUtil['stripTrailingSlash'](_0x42748b[_0x7726('0x4f')]);if(_0x4d9264&&_0x4d9264[_0x7726('0x50')]){logger[_0x7726('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0xaf1d71['recordingURL']=util[_0x7726('0xd')](_0x7726('0x51'),_0x42748b['serverUrl'],_0xaf1d71['uniqueid'],md5(_0xaf1d71[_0x7726('0x52')]));}else{_0xaf1d71[_0x7726('0x53')]='';}headers['Authorization']=getAuth(_0x42748b);return getUser(_0x42748b,_0x198a36[_0x7726('0x54')])[_0x7726('0x17')](function(_0x597f4b){_0x27e3d0=_0x597f4b;logger[_0x7726('0xb')](_0x7726('0x55'),_0x27e3d0['id']);return getEndUser(_0x42748b,_0xaf1d71['calleridname'],_0xaf1d71[_0x7726('0x56')]);})[_0x7726('0x17')](function(_0x337186){_0x2e438f=_0x337186;logger['info'](_0x7726('0x57'),_0x2e438f['id']);return getTicket(_0x42748b,_0x27e3d0,_0x2e438f,_0x15c586,_0xaf1d71);})[_0x7726('0x17')](function(_0x35bb7a){if(_0x35bb7a){logger[_0x7726('0xb')]('The\x20Ticket\x20ID\x20is:',_0x35bb7a['id']);switch(_0x42748b[_0x7726('0x42')]){case _0x7726('0x58'):logger['info']('[QUEUE]',_0x7726('0x59'));return request({'uri':util[_0x7726('0xd')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x42748b['remoteUri'],_0x27e3d0['id'],_0x35bb7a['id']),'method':_0x7726('0x10')});case _0x7726('0x5a'):logger[_0x7726('0xb')](_0x7726('0x5b'),_0x7726('0x5c'));emit(util['format'](_0x7726('0x5d'),_0x198a36[_0x7726('0x12')]),_0x7726('0x5e'),{'uri':util['format'](_0x7726('0x5f'),_0x42748b['remoteUri']['replace'](_0x7726('0x60'),''),_0x35bb7a['id'])});break;default:logger[_0x7726('0x61')](_0x7726('0x5b'),_0x7726('0x62'));}}})[_0x7726('0x63')](function(_0x2d26ff){logger[_0x7726('0x61')](_0x7726('0x64'),util[_0x7726('0x65')](_0x2d26ff,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0xc15d67,_0x37f70b,_0x1f44f1,_0x404a02,_0x1a2b99,_0x4f2613,_0x1c194e){var _0x2710cb,_0x318a7c;_0x4f2613['remoteUri']=intUtil[_0x7726('0x4e')](_0x4f2613['remoteUri']);_0x4f2613[_0x7726('0x4f')]=intUtil[_0x7726('0x4e')](_0x4f2613[_0x7726('0x4f')]);if(_0x1c194e&&_0x1c194e['recordingFormat']&&_0x1c194e[_0x7726('0x66')]!==_0x7726('0x67')){logger[_0x7726('0xb')](_0x7726('0x68'),_0x7726('0x69'));_0x37f70b[_0x7726('0x53')]=util[_0x7726('0xd')](_0x7726('0x51'),_0x4f2613[_0x7726('0x4f')],_0x37f70b['uniqueid'],md5(_0x37f70b[_0x7726('0x52')]));}headers[_0x7726('0x6a')]=getAuth(_0x4f2613);return getUser(_0x4f2613,_0x404a02[_0x7726('0x54')])['then'](function(_0x1af3b6){_0x2710cb=_0x1af3b6;logger[_0x7726('0xb')](_0x7726('0x55'),_0x2710cb['id']);return getEndUser(_0x4f2613,_0x37f70b[_0x7726('0x6b')],_0x37f70b[_0x7726('0x6c')]);})[_0x7726('0x17')](function(_0x3d8b37){_0x318a7c=_0x3d8b37;logger[_0x7726('0xb')](_0x7726('0x57'),_0x318a7c['id']);return getTicket(_0x4f2613,_0x2710cb,_0x318a7c,_0x1f44f1,_0x37f70b);})[_0x7726('0x17')](function(_0x592785){if(_0x592785){logger[_0x7726('0xb')](_0x7726('0x6d'),_0x592785['id']);switch(_0x4f2613['type']){case _0x7726('0x58'):logger[_0x7726('0xb')]('[OUTBOUND]',_0x7726('0x59'));return request({'uri':util[_0x7726('0xd')](_0x7726('0x6e'),_0x4f2613['remoteUri'],_0x2710cb['id'],_0x592785['id']),'method':'POST'});case'newTab':logger[_0x7726('0xb')](_0x7726('0x68'),_0x7726('0x5c'));emit(util[_0x7726('0xd')]('user:%s',_0x404a02[_0x7726('0x12')]),_0x7726('0x5e'),{'uri':util[_0x7726('0xd')]('%s/agent/tickets/%s',_0x4f2613[_0x7726('0xf')]['replace'](_0x7726('0x60'),''),_0x592785['id'])});break;default:logger[_0x7726('0x61')](_0x7726('0x68'),_0x7726('0x62'));}}})['catch'](function(_0x49107f){logger['error'](_0x7726('0x6f'),util['inspect'](_0x49107f,{'showHidden':!![],'depth':null}));});};exports[_0x7726('0x70')]=function(_0x2abfda,_0xd5e632,_0x18c681,_0x534ad1,_0x19f597,_0x1f1823){var _0x25b46e,_0x14104b;_0x1f1823[_0x7726('0xf')]=intUtil[_0x7726('0x4e')](_0x1f1823[_0x7726('0xf')]);_0x1f1823[_0x7726('0x4f')]=intUtil[_0x7726('0x4e')](_0x1f1823[_0x7726('0x4f')]);if(_0x19f597&&_0x19f597[_0x7726('0x50')]){logger['info']('['+_0xd5e632[_0x7726('0x71')]['toUpperCase']()+']',_0x7726('0x69'));_0xd5e632[_0x7726('0x53')]=util[_0x7726('0xd')](_0x7726('0x51'),_0x1f1823[_0x7726('0x4f')],_0xd5e632['uniqueid'],md5(_0xd5e632[_0x7726('0x52')]));}else{_0xd5e632[_0x7726('0x53')]='';}headers['Authorization']=getAuth(_0x1f1823);return getUser(_0x1f1823)[_0x7726('0x17')](function(_0x447342){_0x25b46e=_0x447342;logger[_0x7726('0xb')](_0x7726('0x55'),_0x25b46e['id']);return getEndUser(_0x1f1823,_0xd5e632[_0x7726('0x72')],_0xd5e632['calleridnum']);})[_0x7726('0x17')](function(_0x5023b9){_0x14104b=_0x5023b9;logger[_0x7726('0xb')](_0x7726('0x57'),_0x14104b['id']);return getTicket(_0x1f1823,_0x25b46e,_0x14104b,_0x18c681,_0xd5e632);})[_0x7726('0x17')](function(_0x2d53d3){if(_0x2d53d3){logger['info'](_0x7726('0x6d'),_0x2d53d3['id']);}})['catch'](function(_0x495e29){logger['error']('['+_0xd5e632[_0x7726('0x71')][_0x7726('0x73')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x7726('0x65')](_0x495e29,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x759a=['calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','%s/agent/tickets/%s','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','uniqueid','destcalleridname','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','replace','unmanaged','lastevent','calleridname','toUpperCase','lodash','md5','util','ioredis','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','merge','Tags','name','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','%s/search.json','count','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','length','filter','end-user','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Enduser\x20created.','%s:%s','username','password','authType','token','%s/token:%s','Basic\x20%s','toString','base64','debug','stringify','GET','map','includes','string','picklist','type','nameField','toLowerCase','content','customField','variable','variableName','idField','push','customVariable','Variable','custom_fields','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','The\x20User\x20ID\x20is:'];(function(_0x1f930e,_0x24c403){var _0x5bfa2b=function(_0x2e4893){while(--_0x2e4893){_0x1f930e['push'](_0x1f930e['shift']());}};_0x5bfa2b(++_0x24c403);}(_0x759a,0xf4));var _0xa759=function(_0x4d6a0e,_0x2a87b6){_0x4d6a0e=_0x4d6a0e-0x0;var _0x3a323c=_0x759a[_0x4d6a0e];return _0x3a323c;};'use strict';var _=require(_0xa759('0x0'));var rp=require('request-promise');var md5=require(_0xa759('0x1'));var util=require(_0xa759('0x2'));var Redis=require(_0xa759('0x3'));var intUtil=require('./util');var config=require(_0xa759('0x4'));var logger=require(_0xa759('0x5'))(_0xa759('0x6'));config[_0xa759('0x7')]=_[_0xa759('0x8')](config[_0xa759('0x7')],{'host':_0xa759('0x9'),'port':0x18eb});var io=require(_0xa759('0xa'))(new Redis(config[_0xa759('0x7')]));function emit(_0x1b6288,_0x2a8e15,_0x28a662){io['to'](_0x1b6288)[_0xa759('0xb')](_0x2a8e15,_0x28a662);}var headers={'Content-Type':_0xa759('0xc'),'Accept':'application/json'};function getTicket(_0x59176c,_0x570df7,_0x38e0ba,_0x3bd11e,_0x31c7b3){logger[_0xa759('0xd')](_0xa759('0xe'));return request({'uri':util[_0xa759('0xf')](_0xa759('0x10'),_0x59176c[_0xa759('0x11')]),'method':'POST','body':{'ticket':_[_0xa759('0x12')]({'requester_id':_0x38e0ba['id'],'submitter_id':_0x570df7?_0x570df7['id']:undefined,'assignee_id':_0x570df7?_0x570df7['id']:undefined,'tags':getTags(_0x3bd11e[_0xa759('0x13')],_0xa759('0x14')),'subject':intUtil[_0xa759('0x15')](_0x3bd11e['Subjects'],_0x31c7b3,'\x20'),'description':intUtil[_0xa759('0x15')](_0x3bd11e[_0xa759('0x16')],_0x31c7b3,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x3bd11e[_0xa759('0x16')],_0x31c7b3,'\x0a')}},getCustomFields(_0x3bd11e[_0xa759('0x17')],_0x31c7b3))}})[_0xa759('0x18')](function(_0xb2135b){logger[_0xa759('0xd')](_0xa759('0x19'));return _0xb2135b[_0xa759('0x1a')];});}function getUser(_0xaff0f5,_0x3fd9dc){if(intUtil[_0xa759('0x1b')](_0x3fd9dc)){logger[_0xa759('0xd')]('Getting\x20agent\x20with\x20email',_0x3fd9dc);return request({'uri':util['format'](_0xa759('0x1c'),_0xaff0f5[_0xa759('0x11')]),'qs':{'query':util['format']('type:user\x20role:agent\x20email:%s',_0x3fd9dc)}})[_0xa759('0x18')](function(_0xdd546a){if(_0xdd546a[_0xa759('0x1d')]){logger[_0xa759('0xd')]('Agent\x20found!');return _[_0xa759('0x1e')](_0xdd546a[_0xa759('0x1f')],{'email':_0x3fd9dc,'role':_0xa759('0x20')});}else{logger[_0xa759('0xd')](_0xa759('0x21'));return request({'uri':util['format'](_0xa759('0x22'),_0xaff0f5[_0xa759('0x11')])})['then'](function(_0x3db644){logger[_0xa759('0xd')](_0xa759('0x23'));return _0x3db644['user'];});}});}else{logger[_0xa759('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0xaff0f5[_0xa759('0x11')])})[_0xa759('0x18')](function(_0xc32bc0){logger['info'](_0xa759('0x23'));return _0xc32bc0[_0xa759('0x24')];});}}function getEndUser(_0x48d0d2,_0x354cfe,_0x3f5363){logger['info'](_0xa759('0x25'),_0x3f5363);return request({'uri':util[_0xa759('0xf')]('%s/search.json',_0x48d0d2[_0xa759('0x11')]),'qs':{'query':util['format']('type:user\x20role:end-user\x20phone:%s',_0x3f5363)}})[_0xa759('0x18')](function(_0x3ce80b){var _0x270eef;if(_0x3ce80b[_0xa759('0x1f')][_0xa759('0x26')]){_0x3ce80b['results']=_[_0xa759('0x27')](_0x3ce80b[_0xa759('0x1f')],{'suspended':![],'role':_0xa759('0x28')});if(_0x3ce80b[_0xa759('0x1f')]['length']){_0x270eef=_['first'](_0x3ce80b[_0xa759('0x1f')]);}}if(_0x270eef){logger['info'](_0xa759('0x29'));return _0x270eef;}else{logger[_0xa759('0xd')](_0xa759('0x2a'));return request({'uri':util[_0xa759('0xf')]('%s/users.json',_0x48d0d2[_0xa759('0x11')]),'method':_0xa759('0x2b'),'body':{'user':{'role':_0xa759('0x28'),'name':util[_0xa759('0xf')]('Caller\x20-\x20%s',_0x354cfe||_0x3f5363),'phone':_0x3f5363}}})[_0xa759('0x18')](function(_0x217955){logger['info'](_0xa759('0x2c'));return _0x217955[_0xa759('0x24')];});}});}function getAuth(_0x239792){var _0x45b4ad;if(_0x239792['authType']==='password'){_0x45b4ad=util[_0xa759('0xf')](_0xa759('0x2d'),_0x239792[_0xa759('0x2e')],_0x239792[_0xa759('0x2f')]);}else if(_0x239792[_0xa759('0x30')]===_0xa759('0x31')){_0x45b4ad=util['format'](_0xa759('0x32'),_0x239792['username'],_0x239792[_0xa759('0x31')]);}return util[_0xa759('0xf')](_0xa759('0x33'),new Buffer(_0x45b4ad)[_0xa759('0x34')](_0xa759('0x35')));}function request(_0x75090a){logger[_0xa759('0x36')]('[HTTP]',JSON[_0xa759('0x37')](_0x75090a));return rp(_[_0xa759('0x8')](_0x75090a,{'method':_0xa759('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x41e3ee,_0x4afff2){var _0x4c21ae=[];if(_0x41e3ee&&_0x41e3ee[_0xa759('0x26')]>0x0){_0x4c21ae=_[_0xa759('0x39')](_0x41e3ee,_0x4afff2);}return _0x4c21ae;}function getCustomFields(_0x2dcc41,_0x3f2a62){var _0x4c541d=[];var _0x118ed5={'custom_fields':[]};if(_0x2dcc41[_0xa759('0x26')]>0x0){_['forEach'](_0x2dcc41,function(_0x2778dc){if(_[_0xa759('0x3a')]([_0xa759('0x3b'),_0xa759('0x3c')],_0x2778dc[_0xa759('0x3d')])&&_0x2778dc[_0xa759('0x3e')]&&!_0x2778dc['customField']){_0x118ed5[_0x2778dc[_0xa759('0x3e')][_0xa759('0x3f')]()]=_0x2778dc[_0xa759('0x40')][_0xa759('0x34')]();}else if(_[_0xa759('0x3a')]([_0xa759('0x3b'),_0xa759('0x3c')],_0x2778dc[_0xa759('0x3d')])&&_0x2778dc['idField']&&_0x2778dc[_0xa759('0x41')]){_0x118ed5['custom_fields']['push']({'id':_0x2778dc['idField'],'value':_0x2778dc['content'][_0xa759('0x34')]()});}else if(_0x2778dc[_0xa759('0x3d')]===_0xa759('0x42')&&_0x2778dc[_0xa759('0x43')]&&_0x2778dc[_0xa759('0x44')]&&_0x2778dc['customField']){_0x3f2a62[_0x2778dc['variableName']]&&_0x118ed5['custom_fields'][_0xa759('0x45')]({'id':_0x2778dc['idField'],'value':_0x3f2a62[_0x2778dc['variableName']]['toString']()});}else if(_0x2778dc[_0xa759('0x3d')]===_0xa759('0x46')&&_0x2778dc[_0xa759('0x47')]&&_0x2778dc[_0xa759('0x47')][_0xa759('0x14')]&&_0x2778dc[_0xa759('0x44')]&&_0x2778dc[_0xa759('0x41')]){_0x3f2a62[_0x2778dc[_0xa759('0x47')][_0xa759('0x14')][_0xa759('0x3f')]()]&&_0x118ed5[_0xa759('0x48')][_0xa759('0x45')]({'id':_0x2778dc[_0xa759('0x44')],'value':_0x3f2a62[_0x2778dc[_0xa759('0x47')][_0xa759('0x14')][_0xa759('0x3f')]()][_0xa759('0x34')]()});}});}return _0x118ed5;}exports[_0xa759('0x49')]=function(_0x1dd9be,_0x17eaf5,_0x4444d9,_0x5cfc3d,_0x121623,_0xecf74){var _0x31d129,_0x249e47;_0xecf74['remoteUri']=intUtil[_0xa759('0x4a')](_0xecf74[_0xa759('0x11')]);_0xecf74['serverUrl']=intUtil[_0xa759('0x4a')](_0xecf74[_0xa759('0x4b')]);if(_0x121623&&_0x121623[_0xa759('0x4c')]){logger[_0xa759('0xd')](_0xa759('0x4d'),_0xa759('0x4e'));_0x17eaf5[_0xa759('0x4f')]=util[_0xa759('0xf')](_0xa759('0x50'),_0xecf74['serverUrl'],_0x17eaf5['uniqueid'],md5(_0x17eaf5['uniqueid']));}else{_0x17eaf5[_0xa759('0x4f')]='';}headers[_0xa759('0x51')]=getAuth(_0xecf74);return getUser(_0xecf74,_0x5cfc3d['email'])[_0xa759('0x18')](function(_0x41c1b0){_0x31d129=_0x41c1b0;logger['info'](_0xa759('0x52'),_0x31d129['id']);return getEndUser(_0xecf74,_0x17eaf5['calleridname'],_0x17eaf5[_0xa759('0x53')]);})[_0xa759('0x18')](function(_0xfd85bd){_0x249e47=_0xfd85bd;logger['info'](_0xa759('0x54'),_0x249e47['id']);return getTicket(_0xecf74,_0x31d129,_0x249e47,_0x4444d9,_0x17eaf5);})[_0xa759('0x18')](function(_0x267fca){if(_0x267fca){logger[_0xa759('0xd')](_0xa759('0x55'),_0x267fca['id']);switch(_0xecf74[_0xa759('0x3d')]){case _0xa759('0x56'):logger['info'](_0xa759('0x4d'),_0xa759('0x57'));return request({'uri':util[_0xa759('0xf')](_0xa759('0x58'),_0xecf74[_0xa759('0x11')],_0x31d129['id'],_0x267fca['id']),'method':_0xa759('0x2b')});case _0xa759('0x59'):logger['info'](_0xa759('0x4d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xa759('0xf')](_0xa759('0x5a'),_0x5cfc3d[_0xa759('0x14')]),'trigger:browser:url',{'uri':util['format'](_0xa759('0x5b'),_0xecf74[_0xa759('0x11')]['replace'](_0xa759('0x5c'),''),_0x267fca['id'])});break;default:logger[_0xa759('0x5d')](_0xa759('0x4d'),_0xa759('0x5e'));}}})['catch'](function(_0xd13ad7){logger[_0xa759('0x5d')](_0xa759('0x5f'),util[_0xa759('0x60')](_0xd13ad7,{'showHidden':!![],'depth':null}));});};exports[_0xa759('0x61')]=function(_0x25bb15,_0x5d056e,_0xb145c6,_0x426ac0,_0x429f04,_0x2f8d48,_0x137071){var _0xf84d57,_0x5d4917;_0x2f8d48[_0xa759('0x11')]=intUtil[_0xa759('0x4a')](_0x2f8d48[_0xa759('0x11')]);_0x2f8d48[_0xa759('0x4b')]=intUtil[_0xa759('0x4a')](_0x2f8d48[_0xa759('0x4b')]);if(_0x137071&&_0x137071[_0xa759('0x62')]&&_0x137071[_0xa759('0x62')]!==_0xa759('0x63')){logger[_0xa759('0xd')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x5d056e[_0xa759('0x4f')]=util['format'](_0xa759('0x50'),_0x2f8d48[_0xa759('0x4b')],_0x5d056e[_0xa759('0x64')],md5(_0x5d056e[_0xa759('0x64')]));}headers[_0xa759('0x51')]=getAuth(_0x2f8d48);return getUser(_0x2f8d48,_0x426ac0['email'])[_0xa759('0x18')](function(_0x2c29e6){_0xf84d57=_0x2c29e6;logger[_0xa759('0xd')](_0xa759('0x52'),_0xf84d57['id']);return getEndUser(_0x2f8d48,_0x5d056e[_0xa759('0x65')],_0x5d056e['destcalleridnum']);})['then'](function(_0x59a520){_0x5d4917=_0x59a520;logger[_0xa759('0xd')](_0xa759('0x54'),_0x5d4917['id']);return getTicket(_0x2f8d48,_0xf84d57,_0x5d4917,_0xb145c6,_0x5d056e);})[_0xa759('0x18')](function(_0x309acd){if(_0x309acd){logger[_0xa759('0xd')](_0xa759('0x55'),_0x309acd['id']);switch(_0x2f8d48['type']){case _0xa759('0x56'):logger['info'](_0xa759('0x66'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xa759('0xf')](_0xa759('0x58'),_0x2f8d48[_0xa759('0x11')],_0xf84d57['id'],_0x309acd['id']),'method':_0xa759('0x2b')});case'newTab':logger[_0xa759('0xd')]('[OUTBOUND]',_0xa759('0x67'));emit(util[_0xa759('0xf')](_0xa759('0x5a'),_0x426ac0[_0xa759('0x14')]),'trigger:browser:url',{'uri':util[_0xa759('0xf')](_0xa759('0x5b'),_0x2f8d48['remoteUri'][_0xa759('0x68')](_0xa759('0x5c'),''),_0x309acd['id'])});break;default:logger[_0xa759('0x5d')](_0xa759('0x66'),_0xa759('0x5e'));}}})['catch'](function(_0x595ef1){logger['error']('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xa759('0x60')](_0x595ef1,{'showHidden':!![],'depth':null}));});};exports[_0xa759('0x69')]=function(_0x1da9cf,_0x4fe37b,_0x10515b,_0x5edc0b,_0x3fcaf4,_0x807c6e){var _0x293659,_0x297c1a;_0x807c6e[_0xa759('0x11')]=intUtil['stripTrailingSlash'](_0x807c6e[_0xa759('0x11')]);_0x807c6e[_0xa759('0x4b')]=intUtil[_0xa759('0x4a')](_0x807c6e[_0xa759('0x4b')]);if(_0x3fcaf4&&_0x3fcaf4['monitor_format']){logger[_0xa759('0xd')]('['+_0x4fe37b[_0xa759('0x6a')]['toUpperCase']()+']',_0xa759('0x4e'));_0x4fe37b[_0xa759('0x4f')]=util[_0xa759('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x807c6e[_0xa759('0x4b')],_0x4fe37b['uniqueid'],md5(_0x4fe37b[_0xa759('0x64')]));}else{_0x4fe37b[_0xa759('0x4f')]='';}headers[_0xa759('0x51')]=getAuth(_0x807c6e);return getUser(_0x807c6e)[_0xa759('0x18')](function(_0x2f6823){_0x293659=_0x2f6823;logger[_0xa759('0xd')](_0xa759('0x52'),_0x293659['id']);return getEndUser(_0x807c6e,_0x4fe37b[_0xa759('0x6b')],_0x4fe37b[_0xa759('0x53')]);})['then'](function(_0x4012cf){_0x297c1a=_0x4012cf;logger[_0xa759('0xd')]('The\x20Enduser\x20ID\x20is:',_0x297c1a['id']);return getTicket(_0x807c6e,_0x293659,_0x297c1a,_0x10515b,_0x4fe37b);})['then'](function(_0x156ce9){if(_0x156ce9){logger[_0xa759('0xd')](_0xa759('0x55'),_0x156ce9['id']);}})['catch'](function(_0x10b855){logger[_0xa759('0x5d')]('['+_0x4fe37b[_0xa759('0x6a')][_0xa759('0x6c')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0xa759('0x60')](_0x10b855,{'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 6430cdb..2ab03ba 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 _0x880c=['emit','debug','stringify','length','includes','string','picklist','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','isNil','access_token','isBefore','expires_in','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','clientId','clientSecret','then','add','catch','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','info','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','error','The\x20failing\x20result\x20is','data','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','lead','nothing','Creating\x20new\x20call...','Owner','profile','last_name','Subject','getString','Subjects','Description','Descriptions','enduserType','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','starttime','YYYY-MM-DDTHH:mm:ss','format','lastevent','called','Call_Result','Called','complete','Answered','Rejected','abandoned','Abandoned','Timeout','outbound','Call_Type','merge','Fields','/crm/v2/Calls','code','err','queue','host','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','com','email','The\x20User\x20ID\x20is:','calleridnum','[QUEUE]','trigger:browser:url','https://crm.','recordingFormat','[OUTBOUND]','zoho.eu','destcalleridnum','Outbound','user:%s','/crm/EntityInfo.do?module=Calls&id=','unmanaged','monitor_format','toUpperCase','calleridname','Inbound','The\x20Call\x20ID\x20is:','lodash','md5','./util','moment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter'];(function(_0x3f79e6,_0x2a076d){var _0x15d6d3=function(_0x2857a8){while(--_0x2857a8){_0x3f79e6['push'](_0x3f79e6['shift']());}};_0x15d6d3(++_0x2a076d);}(_0x880c,0x1bb));var _0xc880=function(_0x5b992d,_0x47be52){_0x5b992d=_0x5b992d-0x0;var _0x16a0e7=_0x880c[_0x5b992d];return _0x16a0e7;};'use strict';var _=require(_0xc880('0x0'));var rp=require('request-promise');var md5=require(_0xc880('0x1'));var util=require('util');var intUtil=require(_0xc880('0x2'));var moment=require(_0xc880('0x3'));var Redis=require('ioredis');var BPromise=require('bluebird');var config=require('../../../../config/environment');var logger=require(_0xc880('0x4'))(_0xc880('0x5'));config[_0xc880('0x6')]=_[_0xc880('0x7')](config['redis'],{'host':_0xc880('0x8'),'port':0x18eb});var io=require(_0xc880('0x9'))(new Redis(config['redis']));function emit(_0x14bb15,_0x41502b,_0x437c0d){io['to'](_0x14bb15)[_0xc880('0xa')](_0x41502b,_0x437c0d);}function request(_0x542630){logger[_0xc880('0xb')]('[HTTP]',JSON[_0xc880('0xc')](_0x542630));return rp(_0x542630);}function getCustomFields(_0x9467e5,_0x24dabf){var _0x3f535f={};if(_0x9467e5[_0xc880('0xd')]>0x0){_['forEach'](_0x9467e5,function(_0x31e543){if(_[_0xc880('0xe')]([_0xc880('0xf'),_0xc880('0x10')],_0x31e543[_0xc880('0x11')])&&_0x31e543[_0xc880('0x12')]){_0x3f535f[_0x31e543['idField']]=_0x31e543['content'][_0xc880('0x13')]();}else if(_0x31e543[_0xc880('0x11')]===_0xc880('0x14')&&_0x31e543['variableName']&&_0x31e543[_0xc880('0x12')]&&_0x24dabf[_0x31e543[_0xc880('0x15')]]){_0x3f535f[_0x31e543[_0xc880('0x12')]]=_0x24dabf[_0x31e543[_0xc880('0x15')]][_0xc880('0x13')]();}else if(_0x31e543[_0xc880('0x11')]===_0xc880('0x16')&&_0x31e543[_0xc880('0x17')]&&_0x31e543[_0xc880('0x17')][_0xc880('0x18')]&&_0x31e543[_0xc880('0x12')]&&_0x24dabf[_0x31e543[_0xc880('0x17')]['name'][_0xc880('0x19')]()]){_0x3f535f[_0x31e543[_0xc880('0x12')]]=_0x24dabf[_0x31e543[_0xc880('0x17')]['name']['toLowerCase']()][_0xc880('0x13')]();}});}return _0x3f535f;}function getName(_0x5f3038){if(_0x5f3038[_0xc880('0x1a')]('\x20')>0x0){var _0x115ce9=_0x5f3038['split'](/ (.+)/);if(_0x115ce9[0x1]){return _0x115ce9;}}return[_0x5f3038,_0x5f3038];}var accountsTokens={};function getAccessToken(_0x1057c4){return new Promise(function(_0x4af45d,_0x379cdd){if(!_[_0xc880('0x1b')](accountsTokens[_0x1057c4['id']])&&!_[_0xc880('0x1b')](accountsTokens[_0x1057c4['id']][_0xc880('0x1c')])){if(moment()[_0xc880('0x1d')](accountsTokens[_0x1057c4['id']][_0xc880('0x1e')])){_0x4af45d(accountsTokens[_0x1057c4['id']]['access_token']);}}var _0x357ba4;switch(_0x1057c4['zone']){case'US':_0x357ba4='https://accounts.zoho.com';break;case'AU':_0x357ba4='https://accounts.zoho.com.au';break;case'EU':_0x357ba4=_0xc880('0x1f');break;case'IN':_0x357ba4=_0xc880('0x20');break;case'CN':_0x357ba4='https://accounts.zoho.com.cn';break;default:_0x357ba4=_0xc880('0x1f');break;}var _0x26d518={'method':_0xc880('0x21'),'uri':_0x357ba4+_0xc880('0x22'),'qs':{'refresh_token':_0x1057c4['refreshToken'],'client_id':_0x1057c4[_0xc880('0x23')],'client_secret':_0x1057c4[_0xc880('0x24')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x26d518)[_0xc880('0x25')](function(_0x4a8961){accountsTokens[_0x1057c4['id']]={'access_token':_0x4a8961[_0xc880('0x1c')],'expires_in':moment()[_0xc880('0x26')](_0x4a8961[_0xc880('0x1e')],'seconds')};_0x4af45d(_0x4a8961[_0xc880('0x1c')]);})[_0xc880('0x27')](function(_0x459d01){logger['error'](_0xc880('0x28'),_0x459d01[_0xc880('0x29')]);_0x379cdd(_0x459d01);});});}function getUser(_0x3072d8,_0x4801e4,_0xa5f95e,_0x1060ad){logger['info'](_0xc880('0x2a'));return request({'method':_0xc880('0x2b'),'uri':util['format'](_0xc880('0x2c'),_0x4801e4),'qs':{'type':_0xc880('0x2d')},'headers':{'Authorization':_0xc880('0x2e')+_0x3072d8},'json':!![]})['then'](function(_0x5400cd){if(_0x5400cd[_0xc880('0x2f')]){var _0x30ea0f=-0x1;if(_[_0xc880('0x30')](_0x5400cd[_0xc880('0x2f')])){if(!_['isNil'](_0x1060ad)){_0x30ea0f=_[_0xc880('0x31')](_0x5400cd[_0xc880('0x2f')],function(_0x4a0f72){return _0x4a0f72['email']===_0x1060ad;});}if(_0x30ea0f>=0x0){logger[_0xc880('0x32')](_0xc880('0x33'));}else{logger[_0xc880('0x32')](_0xc880('0x34'));_0x30ea0f=_['findIndex'](_0x5400cd[_0xc880('0x2f')],function(_0x184b8f){return _0x184b8f['profile']['name']===_0xc880('0x35');});}return _0x5400cd[_0xc880('0x2f')][_0x30ea0f];}else{if(_0x5400cd[_0xc880('0x36')]['profile'][_0xc880('0x18')]==='Administrator'){logger[_0xc880('0x32')]('Using\x20the\x20admin\x20account!');user=_0x5400cd['user'];return user;}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0xc880('0xc')](_0x5400cd));throw new Error(_0xc880('0x37')+JSON[_0xc880('0xc')](_0x5400cd));}}}else{logger[_0xc880('0x38')](_0xc880('0x39'),JSON[_0xc880('0xc')](_0x5400cd));throw new Error(_0xc880('0x37')+JSON[_0xc880('0xc')](_0x5400cd));}})[_0xc880('0x27')](function(_0x182ba6){console['error'](_0x182ba6);});}function getZohoUser(_0x51f91d,_0x28186e){return new BPromise(function(_0x246f30,_0x12cf83){request(_0x51f91d)[_0xc880('0x25')](function(_0x5506c8){var _0x228541=null;if(_0x5506c8){_0x228541=_0x5506c8[_0xc880('0x3a')][0x0];_0x228541['enduserType']=_0x28186e;}_0x246f30(_0x228541);})['catch'](function(_0x4bc904){_0x12cf83(_0x4bc904);});});}function createEndUser(_0x44c4d8,_0x35629d,_0x505fe4,_0x13857c,_0x537fc1,_0x3c7fa8){var _0x505fe4=getName(_0x505fe4);return request({'method':_0xc880('0x21'),'uri':_0xc880('0x3b')+_0x35629d+_0xc880('0x3c')+_[_0xc880('0x3d')](_0x3c7fa8[_0xc880('0x3e')])+'s','body':{'data':[{'Last_Name':_0x505fe4[0x1],'First_Name':_0x505fe4[0x0],'Phone':_0x13857c,'Owner':{'name':!_[_0xc880('0x1b')](_0x537fc1[_0xc880('0x3f')]['name'])?_0x537fc1['role'][_0xc880('0x18')]:!_[_0xc880('0x1b')](_0x537fc1[_0xc880('0x40')])?_0x537fc1[_0xc880('0x40')]+'\x20'+_0x537fc1['last_name']:_0x537fc1['last_name'],'id':_0x537fc1['id']}}]},'headers':{'Authorization':_0xc880('0x2e')+_0x44c4d8},'json':!![]})[_0xc880('0x25')](function(_0x3145b9){if(_0x3145b9&&_0x3145b9['data'][0x0]['code']===_0xc880('0x41')){var _0x15c2a3=_0x3145b9['data'][0x0][_0xc880('0x42')];_0x15c2a3['enduserType']=_['startCase'](_0x3c7fa8[_0xc880('0x3e')])+'s';return _0x15c2a3;}logger['error'](_0xc880('0x39'),JSON[_0xc880('0xc')](data));throw new Error(_0xc880('0x43')+JSON[_0xc880('0xc')](data));})[_0xc880('0x27')](function(_0x5dc182){console[_0xc880('0x44')](_0xc880('0x45'),_0x5dc182);});}function getEndUser(_0x33575a,_0x81f060,_0x4193b8,_0x4b8826,_0x204414,_0x26dedc,_0x5e0f9a){var _0x538073={'method':_0xc880('0x2b'),'uri':'','headers':{'Authorization':_0xc880('0x2e')+_0x33575a},'json':!![]};switch(_0x5e0f9a[_0xc880('0x46')]){case _0xc880('0x47'):_0x538073[_0xc880('0x48')]='https://www.zohoapis.'+_0x81f060+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x204414+'))';return getZohoUser(_0x538073,_0xc880('0x49'))[_0xc880('0x25')](function(_0x71e8a7){if(_0x71e8a7)return _0x71e8a7;_0x538073['uri']=_0xc880('0x3b')+_0x81f060+_0xc880('0x4a')+_0x204414+'))';return getZohoUser(_0x538073,_0xc880('0x4b'))[_0xc880('0x25')](function(_0x3193d1){if(_0x3193d1)return _0x3193d1;if(_0x5e0f9a[_0xc880('0x3e')]!='nothing'){return createEndUser(_0x33575a,_0x81f060,_0x4b8826,_0x204414,_0x26dedc,_0x5e0f9a);}else{return{};}});});break;case _0xc880('0x4c'):_0x538073[_0xc880('0x48')]='https://www.zohoapis.'+_0x81f060+_0xc880('0x4d')+_0x204414+'))';return getZohoUser(_0x538073,_0xc880('0x49'))[_0xc880('0x25')](function(_0x475135){if(_0x475135)return _0x475135;if(_0x5e0f9a[_0xc880('0x3e')]!='nothing'){return createEndUser(_0x33575a,_0x81f060,_0x4b8826,_0x204414,_0x26dedc,_0x5e0f9a);}else{return{};}});break;case _0xc880('0x4e'):_0x538073[_0xc880('0x48')]='https://www.zohoapis.'+_0x81f060+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x204414+'))';return getZohoUser(_0x538073,'Leads')[_0xc880('0x25')](function(_0x4f6db7){if(_0x4f6db7)return _0x4f6db7;if(_0x5e0f9a[_0xc880('0x3e')]!=_0xc880('0x4f')){return createEndUser(_0x33575a,_0x81f060,_0x4b8826,_0x204414,_0x26dedc,_0x5e0f9a);}else{return{};}});break;}}function getCall(_0x2757cb,_0x38f620,_0x1e2599,_0xc5bf0c,_0x457d69,_0x58d351,_0x22732b,_0x1c1b37){logger[_0xc880('0x32')](_0xc880('0x50'));var _0x5029b7={};_0x5029b7[_0xc880('0x51')]={'name':!_[_0xc880('0x1b')](_0xc5bf0c['role'][_0xc880('0x18')])&&!_[_0xc880('0x1b')](_0xc5bf0c['profile'][_0xc880('0x18')])&&_0xc5bf0c[_0xc880('0x52')][_0xc880('0x18')]==='administrator'?_0xc5bf0c[_0xc880('0x3f')]['name']:!_[_0xc880('0x1b')](_0xc5bf0c[_0xc880('0x40')])?_0xc5bf0c['first_name']+'\x20'+_0xc5bf0c[_0xc880('0x53')]:_0xc5bf0c[_0xc880('0x53')],'id':_0xc5bf0c['id']};_0x5029b7[_0xc880('0x54')]=intUtil[_0xc880('0x55')](_0x58d351[_0xc880('0x56')],_0x22732b,'\x20');_0x5029b7[_0xc880('0x57')]=intUtil[_0xc880('0x55')](_0x58d351[_0xc880('0x58')],_0x22732b,'\x0a');if(_0x457d69[_0xc880('0x59')]===_0xc880('0x49')){_0x5029b7[_0xc880('0x5a')]={'name':!_[_0xc880('0x1b')](_0x457d69[_0xc880('0x5b')])?_0x457d69[_0xc880('0x5b')]:!_['isNil'](_0x457d69[_0xc880('0x5c')])?_0x457d69[_0xc880('0x5c')]+'\x20'+_0x457d69[_0xc880('0x5d')]:_0x457d69[_0xc880('0x5d')],'id':_0x457d69['id']};}if(_0x457d69[_0xc880('0x59')]==='Leads'){_0x5029b7[_0xc880('0x5e')]={'name':!_[_0xc880('0x1b')](_0x457d69[_0xc880('0x5b')])?_0x457d69[_0xc880('0x5b')]:!_[_0xc880('0x1b')](_0x457d69[_0xc880('0x5c')])?_0x457d69[_0xc880('0x5c')]+'\x20'+_0x457d69[_0xc880('0x5d')]:_0x457d69['Last_Name'],'id':_0x457d69['id']};_0x5029b7[_0xc880('0x5f')]=_[_0xc880('0x3d')](_0x457d69[_0xc880('0x59')]);}if(_0x22732b[_0xc880('0x60')]){_0x5029b7[_0xc880('0x61')]=moment[_0xc880('0x62')](parseInt(_0x22732b[_0xc880('0x60')])*0x3e8)['format'](_0xc880('0x63'));}else if(_0x22732b[_0xc880('0x64')]&&_0x22732b[_0xc880('0x65')]){_0x5029b7[_0xc880('0x61')]=moment[_0xc880('0x62')](moment(_0x22732b[_0xc880('0x65')],'YYYY-MM-DDTHH:mm:ss')['diff'](moment(_0x22732b[_0xc880('0x66')],_0xc880('0x67'))))[_0xc880('0x68')](_0xc880('0x63'));}switch(_0x22732b[_0xc880('0x69')]){case _0xc880('0x6a'):_0x5029b7[_0xc880('0x6b')]=_0xc880('0x6c');break;case _0xc880('0x6d'):case'connect':_0x5029b7[_0xc880('0x6b')]=_0xc880('0x6e');break;case'rejected':_0x5029b7[_0xc880('0x6b')]=_0xc880('0x6f');break;case _0xc880('0x70'):_0x5029b7[_0xc880('0x6b')]=_0xc880('0x71');break;case'timeout':_0x5029b7[_0xc880('0x6b')]=_0xc880('0x72');default:}_0x5029b7['Call_Start_Time']=(_0x1c1b37===_0xc880('0x73')?moment(_0x22732b[_0xc880('0x66')])[_0xc880('0x68')](_0xc880('0x67')):moment(_0x22732b['agentcalledAt'])['format'](_0xc880('0x67')))||moment()['format'](_0xc880('0x67'));_0x5029b7[_0xc880('0x74')]=_0x1c1b37||'Inbound';_0x5029b7=_[_0xc880('0x75')](_0x5029b7,getCustomFields(_0x58d351[_0xc880('0x76')],_0x22732b));return request({'method':_0xc880('0x21'),'uri':_0xc880('0x3b')+_0x38f620+_0xc880('0x77'),'headers':{'Authorization':_0xc880('0x2e')+_0x2757cb},'body':{'data':[_0x5029b7]},'json':!![]})[_0xc880('0x25')](function(_0x385f1b){if(_0x385f1b&&_0x385f1b['data'][0x0][_0xc880('0x78')]===_0xc880('0x41')){logger[_0xc880('0x32')]('Call\x20created!');return{'id':_0x385f1b[_0xc880('0x3a')][0x0][_0xc880('0x42')]['id']};}})[_0xc880('0x27')](function(_0x445690){logger[_0xc880('0x32')]('err',_0x445690['stack']);console['log'](_0xc880('0x79'),_0x445690);});}exports[_0xc880('0x7a')]=function(_0x11413c,_0x6c9577,_0x19e051,_0x3ad356,_0x520f75,_0x4ac68f){var _0x4cca98,_0x43c54d,_0x5db476;_0x4ac68f[_0xc880('0x7b')]=intUtil[_0xc880('0x7c')](_0x4ac68f['host']);_0x4ac68f[_0xc880('0x7d')]=intUtil[_0xc880('0x7c')](_0x4ac68f[_0xc880('0x7d')]);if(_0x520f75&&_0x520f75['monitor_format']){logger[_0xc880('0x32')]('[QUEUE]',_0xc880('0x7e'));_0x6c9577[_0xc880('0x7f')]=_0x4ac68f[_0xc880('0x7d')]+_0xc880('0x80')+_0x6c9577[_0xc880('0x81')]+_0xc880('0x82')+md5(_0x6c9577[_0xc880('0x81')]);}else{_0x6c9577[_0xc880('0x7f')]='';}var _0x408aee=_0x4ac68f[_0xc880('0x7b')]==='zoho.eu'?'eu':_0xc880('0x83');return getAccessToken(_0x4ac68f)[_0xc880('0x25')](function(_0x10cad5){_0x5db476=_0x10cad5;return getUser(_0x5db476,_0x408aee,_0x4ac68f,_0x3ad356[_0xc880('0x84')]);})[_0xc880('0x25')](function(_0x557304){_0x4cca98=_0x557304;logger[_0xc880('0x32')](_0xc880('0x85'),_0x4cca98['id']);return getEndUser(_0x5db476,_0x408aee,_0x4ac68f,_0x6c9577['calleridname'],_0x6c9577[_0xc880('0x86')],_0x4cca98,_0x19e051);})[_0xc880('0x25')](function(_0x3093e4){_0x43c54d=_0x3093e4;return getCall(_0x5db476,_0x408aee,_0x4ac68f,_0x4cca98,_0x43c54d,_0x19e051,_0x6c9577,'Inbound');})[_0xc880('0x25')](function(_0x31efc8){if(_0x31efc8){logger[_0xc880('0x32')]('The\x20Call\x20ID\x20is:',_0x31efc8['id']);logger['info'](_0xc880('0x87'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x3ad356[_0xc880('0x18')]),_0xc880('0x88'),{'uri':_0xc880('0x89')+_0x4ac68f[_0xc880('0x7b')]+'/crm/EntityInfo.do?module=Calls&id='+_0x31efc8['id']});}})[_0xc880('0x27')](function(_0x7ad5c6){logger[_0xc880('0x38')](_0xc880('0x87'),JSON[_0xc880('0xc')](_0x7ad5c6));});};exports[_0xc880('0x73')]=function(_0x500724,_0x4c0c29,_0x48b534,_0x464dcd,_0x4b2c18,_0x2fae4d,_0x1f9174){var _0x415fa6,_0x49852a,_0x3d0350;_0x2fae4d[_0xc880('0x7b')]=intUtil['stripTrailingSlash'](_0x2fae4d[_0xc880('0x7b')]);_0x2fae4d['serverUrl']=intUtil[_0xc880('0x7c')](_0x2fae4d[_0xc880('0x7d')]);if(_0x1f9174&&_0x1f9174[_0xc880('0x8a')]&&_0x1f9174[_0xc880('0x8a')]!=='none'){logger[_0xc880('0x32')](_0xc880('0x8b'),'Recording\x20is\x20enabled!');_0x4c0c29[_0xc880('0x7f')]=_0x2fae4d['serverUrl']+_0xc880('0x80')+_0x4c0c29['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x4c0c29['uniqueid']);}var _0x42547d=_0x2fae4d[_0xc880('0x7b')]===_0xc880('0x8c')?'eu':_0xc880('0x83');return getAccessToken(_0x2fae4d)[_0xc880('0x25')](function(_0x4de1e1){_0x3d0350=_0x4de1e1;return getUser(_0x3d0350,_0x42547d,_0x2fae4d,_0x464dcd['email']);})['then'](function(_0x18b0c8){_0x415fa6=_0x18b0c8;logger[_0xc880('0x32')](_0xc880('0x85'),_0x415fa6['id']);return getEndUser(_0x3d0350,_0x42547d,_0x2fae4d,_0x4c0c29['destcalleridname'],_0x4c0c29[_0xc880('0x8d')],_0x415fa6,_0x48b534);})[_0xc880('0x25')](function(_0x5de374){_0x49852a=_0x5de374;return getCall(_0x3d0350,_0x42547d,_0x2fae4d,_0x415fa6,_0x49852a,_0x48b534,_0x4c0c29,_0xc880('0x8e'));})[_0xc880('0x25')](function(_0x56c1b9){if(_0x56c1b9){logger[_0xc880('0x32')]('The\x20Call\x20ID\x20is:',_0x56c1b9['id']);logger[_0xc880('0x32')](_0xc880('0x8b'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xc880('0x68')](_0xc880('0x8f'),_0x464dcd[_0xc880('0x18')]),'trigger:browser:url',{'uri':'https://crm.'+_0x2fae4d[_0xc880('0x7b')]+_0xc880('0x90')+_0x56c1b9['id']});}})[_0xc880('0x27')](function(_0x5eefde){logger[_0xc880('0x38')]('[OUTBOUND]',JSON['stringify'](_0x5eefde));});};exports[_0xc880('0x91')]=function(_0x3078ad,_0x4a6c91,_0x3a9b6f,_0x18b6f9,_0xf75265,_0x516e82){var _0x37c075,_0x32cd84,_0x44fd3f;_0x516e82['host']=intUtil['stripTrailingSlash'](_0x516e82[_0xc880('0x7b')]);_0x516e82['serverUrl']=intUtil[_0xc880('0x7c')](_0x516e82[_0xc880('0x7d')]);if(_0xf75265&&_0xf75265[_0xc880('0x92')]){logger[_0xc880('0x32')]('['+_0x4a6c91[_0xc880('0x69')][_0xc880('0x93')]()+']',_0xc880('0x7e'));_0x4a6c91[_0xc880('0x7f')]=_0x516e82[_0xc880('0x7d')]+_0xc880('0x80')+_0x4a6c91[_0xc880('0x81')]+_0xc880('0x82')+md5(_0x4a6c91['uniqueid']);}else{_0x4a6c91[_0xc880('0x7f')]='';}var _0x203f91=_0x516e82[_0xc880('0x7b')]===_0xc880('0x8c')?'eu':_0xc880('0x83');return getAccessToken(_0x516e82)[_0xc880('0x25')](function(_0x2b07a6){_0x44fd3f=_0x2b07a6;return getUser(_0x44fd3f,_0x203f91,_0x516e82);})[_0xc880('0x25')](function(_0x5dcdd2){_0x37c075=_0x5dcdd2;logger[_0xc880('0x32')](_0xc880('0x85'),_0x37c075['id']);return getEndUser(_0x44fd3f,_0x203f91,_0x516e82,_0x4a6c91[_0xc880('0x94')],_0x4a6c91[_0xc880('0x86')],_0x37c075,_0x3a9b6f);})[_0xc880('0x25')](function(_0x504aa2){_0x32cd84=_0x504aa2;return getCall(_0x44fd3f,_0x203f91,_0x516e82,_0x37c075,_0x32cd84,_0x3a9b6f,_0x4a6c91,_0xc880('0x95'));})['then'](function(_0x49efe2){if(_0x49efe2){logger['info'](_0xc880('0x96'),_0x49efe2['id']);}})[_0xc880('0x27')](function(_0x577f04){logger[_0xc880('0x38')]('['+_0x4a6c91['lastevent'][_0xc880('0x93')]()+']',JSON[_0xc880('0xc')](_0x577f04));});}; \ No newline at end of file +var _0xa98d=['https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','Outbound','user:%s','unmanaged','monitor_format','toUpperCase','lodash','md5','./util','moment','bluebird','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','[HTTP]','stringify','length','includes','picklist','type','idField','content','toString','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','clientId','refresh_token','then','add','catch','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','email','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','error','data','POST','/crm/v2/','startCase','role','first_name','last_name','code','SUCCESS','details','enduserType','moduleCreate','Error:\x20','log','moduleSearch','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','https://www.zohoapis.','nothing','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','Creating\x20new\x20call...','Owner','profile','administrator','Subject','getString','Subjects','Description','Descriptions','Full_Name','First_Name','Last_Name','What_Id','$se_module','utc','talktime','mm:ss','answertime','endtime','Call_Duration','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','Call_Result','complete','connect','Answered','rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','merge','Fields','/crm/v2/Calls','err','host','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa98d,0xa3));var _0xda98=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa98d[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xda98('0x0'));var rp=require('request-promise');var md5=require(_0xda98('0x1'));var util=require('util');var intUtil=require(_0xda98('0x2'));var moment=require(_0xda98('0x3'));var Redis=require('ioredis');var BPromise=require(_0xda98('0x4'));var config=require(_0xda98('0x5'));var logger=require(_0xda98('0x6'))('zoho');config[_0xda98('0x7')]=_[_0xda98('0x8')](config[_0xda98('0x7')],{'host':_0xda98('0x9'),'port':0x18eb});var io=require(_0xda98('0xa'))(new Redis(config[_0xda98('0x7')]));function emit(_0x59b7fc,_0x3f7a45,_0x4ad603){io['to'](_0x59b7fc)[_0xda98('0xb')](_0x3f7a45,_0x4ad603);}function request(_0x2aa3a3){logger['debug'](_0xda98('0xc'),JSON[_0xda98('0xd')](_0x2aa3a3));return rp(_0x2aa3a3);}function getCustomFields(_0x571b88,_0x2fcd3a){var _0x5bf8f1={};if(_0x571b88[_0xda98('0xe')]>0x0){_['forEach'](_0x571b88,function(_0x3d6a90){if(_[_0xda98('0xf')](['string',_0xda98('0x10')],_0x3d6a90[_0xda98('0x11')])&&_0x3d6a90[_0xda98('0x12')]){_0x5bf8f1[_0x3d6a90[_0xda98('0x12')]]=_0x3d6a90[_0xda98('0x13')][_0xda98('0x14')]();}else if(_0x3d6a90[_0xda98('0x11')]==='variable'&&_0x3d6a90['variableName']&&_0x3d6a90[_0xda98('0x12')]&&_0x2fcd3a[_0x3d6a90[_0xda98('0x15')]]){_0x5bf8f1[_0x3d6a90[_0xda98('0x12')]]=_0x2fcd3a[_0x3d6a90['variableName']][_0xda98('0x14')]();}else if(_0x3d6a90[_0xda98('0x11')]===_0xda98('0x16')&&_0x3d6a90[_0xda98('0x17')]&&_0x3d6a90['Variable'][_0xda98('0x18')]&&_0x3d6a90[_0xda98('0x12')]&&_0x2fcd3a[_0x3d6a90[_0xda98('0x17')][_0xda98('0x18')][_0xda98('0x19')]()]){_0x5bf8f1[_0x3d6a90['idField']]=_0x2fcd3a[_0x3d6a90[_0xda98('0x17')][_0xda98('0x18')][_0xda98('0x19')]()]['toString']();}});}return _0x5bf8f1;}function getName(_0x4f7b17){if(_0x4f7b17[_0xda98('0x1a')]('\x20')>0x0){var _0x26f4f0=_0x4f7b17[_0xda98('0x1b')](/ (.+)/);if(_0x26f4f0[0x1]){return _0x26f4f0;}}return[_0x4f7b17,_0x4f7b17];}var accountsTokens={};function getAccessToken(_0x528c3e){return new Promise(function(_0x12d759,_0x2d264e){if(!_[_0xda98('0x1c')](accountsTokens[_0x528c3e['id']])&&!_[_0xda98('0x1c')](accountsTokens[_0x528c3e['id']][_0xda98('0x1d')])){if(moment()[_0xda98('0x1e')](accountsTokens[_0x528c3e['id']][_0xda98('0x1f')])){_0x12d759(accountsTokens[_0x528c3e['id']]['access_token']);}}var _0x4a533b;switch(_0x528c3e['zone']){case'US':_0x4a533b='https://accounts.zoho.com';break;case'AU':_0x4a533b=_0xda98('0x20');break;case'EU':_0x4a533b=_0xda98('0x21');break;case'IN':_0x4a533b=_0xda98('0x22');break;case'CN':_0x4a533b=_0xda98('0x23');break;default:_0x4a533b=_0xda98('0x21');break;}var _0x52166c={'method':'POST','uri':_0x4a533b+_0xda98('0x24'),'qs':{'refresh_token':_0x528c3e['refreshToken'],'client_id':_0x528c3e[_0xda98('0x25')],'client_secret':_0x528c3e['clientSecret'],'grant_type':_0xda98('0x26')},'json':!![]};return rp(_0x52166c)[_0xda98('0x27')](function(_0x2fad69){accountsTokens[_0x528c3e['id']]={'access_token':_0x2fad69['access_token'],'expires_in':moment()[_0xda98('0x28')](_0x2fad69[_0xda98('0x1f')],'seconds')};_0x12d759(_0x2fad69[_0xda98('0x1d')]);})[_0xda98('0x29')](function(_0x53d5ae){logger['error'](_0xda98('0x2a'),_0x53d5ae[_0xda98('0x2b')]);_0x2d264e(_0x53d5ae);});});}function getUser(_0x3c0be3,_0x21eb8c,_0x49334c,_0x44aa85){logger[_0xda98('0x2c')](_0xda98('0x2d'));return request({'method':_0xda98('0x2e'),'uri':util[_0xda98('0x2f')](_0xda98('0x30'),_0x21eb8c),'qs':{'type':_0xda98('0x31')},'headers':{'Authorization':_0xda98('0x32')+_0x3c0be3},'json':!![]})['then'](function(_0x41e5fd){if(_0x41e5fd[_0xda98('0x33')]){var _0x475b8b=-0x1;if(_[_0xda98('0x34')](_0x41e5fd[_0xda98('0x33')])){if(!_[_0xda98('0x1c')](_0x44aa85)){_0x475b8b=_[_0xda98('0x35')](_0x41e5fd[_0xda98('0x33')],function(_0x1f9685){return _0x1f9685[_0xda98('0x36')]===_0x44aa85;});}if(_0x475b8b>=0x0){logger[_0xda98('0x2c')](_0xda98('0x37'));}else{logger['info'](_0xda98('0x38'));_0x475b8b=_[_0xda98('0x35')](_0x41e5fd[_0xda98('0x33')],function(_0x1f09f7){return _0x1f09f7['profile'][_0xda98('0x18')]===_0xda98('0x39');});}return _0x41e5fd[_0xda98('0x33')][_0x475b8b];}else{if(_0x41e5fd[_0xda98('0x3a')]['profile'][_0xda98('0x18')]===_0xda98('0x39')){logger[_0xda98('0x2c')]('Using\x20the\x20admin\x20account!');user=_0x41e5fd[_0xda98('0x3a')];return user;}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0xda98('0xd')](_0x41e5fd));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x41e5fd));}}}else{logger['error'](_0xda98('0x3b'),JSON['stringify'](_0x41e5fd));throw new Error(_0xda98('0x3c')+JSON['stringify'](_0x41e5fd));}})[_0xda98('0x29')](function(_0xc93605){console[_0xda98('0x3d')](_0xc93605);});}function getZohoUser(_0xe72dec,_0x53c8b6){return new BPromise(function(_0x4a0b1d,_0x4fd27c){request(_0xe72dec)[_0xda98('0x27')](function(_0x55fec0){var _0x232090=null;if(_0x55fec0){_0x232090=_0x55fec0[_0xda98('0x3e')][0x0];_0x232090['enduserType']=_0x53c8b6;}_0x4a0b1d(_0x232090);})[_0xda98('0x29')](function(_0x4b237c){_0x4fd27c(_0x4b237c);});});}function createEndUser(_0x302cc5,_0x524112,_0x56da1b,_0x34111f,_0x100711,_0x3c36c4){var _0x56da1b=getName(_0x56da1b);return request({'method':_0xda98('0x3f'),'uri':'https://www.zohoapis.'+_0x524112+_0xda98('0x40')+_[_0xda98('0x41')](_0x3c36c4['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x56da1b[0x1],'First_Name':_0x56da1b[0x0],'Phone':_0x34111f,'Owner':{'name':!_[_0xda98('0x1c')](_0x100711[_0xda98('0x42')][_0xda98('0x18')])?_0x100711[_0xda98('0x42')][_0xda98('0x18')]:!_[_0xda98('0x1c')](_0x100711['first_name'])?_0x100711[_0xda98('0x43')]+'\x20'+_0x100711[_0xda98('0x44')]:_0x100711[_0xda98('0x44')],'id':_0x100711['id']}}]},'headers':{'Authorization':_0xda98('0x32')+_0x302cc5},'json':!![]})[_0xda98('0x27')](function(_0x255724){if(_0x255724&&_0x255724[_0xda98('0x3e')][0x0][_0xda98('0x45')]===_0xda98('0x46')){var _0x33db1a=_0x255724[_0xda98('0x3e')][0x0][_0xda98('0x47')];_0x33db1a[_0xda98('0x48')]=_[_0xda98('0x41')](_0x3c36c4[_0xda98('0x49')])+'s';return _0x33db1a;}logger['error']('The\x20failing\x20result\x20is',JSON[_0xda98('0xd')](data));throw new Error(_0xda98('0x4a')+JSON['stringify'](data));})[_0xda98('0x29')](function(_0x5a86df){console[_0xda98('0x4b')]('CREATE\x20ERROR',_0x5a86df);});}function getEndUser(_0x3ea1d1,_0x305a29,_0x49476e,_0x53a7be,_0x412f73,_0x378685,_0x47f9c2){var _0x54e0ac={'method':_0xda98('0x2e'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x3ea1d1},'json':!![]};switch(_0x47f9c2[_0xda98('0x4c')]){case'contact_lead':_0x54e0ac[_0xda98('0x4d')]='https://www.zohoapis.'+_0x305a29+_0xda98('0x4e')+_0x412f73+'))';return getZohoUser(_0x54e0ac,'Contacts')['then'](function(_0x59d621){if(_0x59d621)return _0x59d621;_0x54e0ac[_0xda98('0x4d')]=_0xda98('0x4f')+_0x305a29+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x412f73+'))';return getZohoUser(_0x54e0ac,'Leads')[_0xda98('0x27')](function(_0x49c48c){if(_0x49c48c)return _0x49c48c;if(_0x47f9c2[_0xda98('0x49')]!=_0xda98('0x50')){return createEndUser(_0x3ea1d1,_0x305a29,_0x53a7be,_0x412f73,_0x378685,_0x47f9c2);}else{return{};}});});break;case'contact':_0x54e0ac[_0xda98('0x4d')]=_0xda98('0x4f')+_0x305a29+_0xda98('0x4e')+_0x412f73+'))';return getZohoUser(_0x54e0ac,_0xda98('0x51'))[_0xda98('0x27')](function(_0x147e05){if(_0x147e05)return _0x147e05;if(_0x47f9c2[_0xda98('0x49')]!='nothing'){return createEndUser(_0x3ea1d1,_0x305a29,_0x53a7be,_0x412f73,_0x378685,_0x47f9c2);}else{return{};}});break;case'lead':_0x54e0ac['uri']=_0xda98('0x4f')+_0x305a29+_0xda98('0x52')+_0x412f73+'))';return getZohoUser(_0x54e0ac,_0xda98('0x53'))[_0xda98('0x27')](function(_0x55ea93){if(_0x55ea93)return _0x55ea93;if(_0x47f9c2['moduleCreate']!=_0xda98('0x50')){return createEndUser(_0x3ea1d1,_0x305a29,_0x53a7be,_0x412f73,_0x378685,_0x47f9c2);}else{return{};}});break;}}function getCall(_0x49d0ff,_0xa43d9e,_0x81ab24,_0x164a92,_0x14060f,_0x2820ba,_0x405eff,_0x23ab80){logger['info'](_0xda98('0x54'));var _0x3e0d5e={};_0x3e0d5e[_0xda98('0x55')]={'name':!_['isNil'](_0x164a92[_0xda98('0x42')][_0xda98('0x18')])&&!_[_0xda98('0x1c')](_0x164a92[_0xda98('0x56')][_0xda98('0x18')])&&_0x164a92[_0xda98('0x56')][_0xda98('0x18')]===_0xda98('0x57')?_0x164a92[_0xda98('0x42')][_0xda98('0x18')]:!_[_0xda98('0x1c')](_0x164a92[_0xda98('0x43')])?_0x164a92[_0xda98('0x43')]+'\x20'+_0x164a92[_0xda98('0x44')]:_0x164a92[_0xda98('0x44')],'id':_0x164a92['id']};_0x3e0d5e[_0xda98('0x58')]=intUtil[_0xda98('0x59')](_0x2820ba[_0xda98('0x5a')],_0x405eff,'\x20');_0x3e0d5e[_0xda98('0x5b')]=intUtil['getString'](_0x2820ba[_0xda98('0x5c')],_0x405eff,'\x0a');if(_0x14060f[_0xda98('0x48')]===_0xda98('0x51')){_0x3e0d5e['Who_Id']={'name':!_[_0xda98('0x1c')](_0x14060f['Full_Name'])?_0x14060f[_0xda98('0x5d')]:!_[_0xda98('0x1c')](_0x14060f[_0xda98('0x5e')])?_0x14060f['First_Name']+'\x20'+_0x14060f[_0xda98('0x5f')]:_0x14060f['Last_Name'],'id':_0x14060f['id']};}if(_0x14060f[_0xda98('0x48')]===_0xda98('0x53')){_0x3e0d5e[_0xda98('0x60')]={'name':!_['isNil'](_0x14060f[_0xda98('0x5d')])?_0x14060f[_0xda98('0x5d')]:!_[_0xda98('0x1c')](_0x14060f[_0xda98('0x5e')])?_0x14060f[_0xda98('0x5e')]+'\x20'+_0x14060f['Last_Name']:_0x14060f[_0xda98('0x5f')],'id':_0x14060f['id']};_0x3e0d5e[_0xda98('0x61')]=_[_0xda98('0x41')](_0x14060f[_0xda98('0x48')]);}if(_0x405eff['talktime']){_0x3e0d5e['Call_Duration']=moment[_0xda98('0x62')](parseInt(_0x405eff[_0xda98('0x63')])*0x3e8)[_0xda98('0x2f')](_0xda98('0x64'));}else if(_0x405eff[_0xda98('0x65')]&&_0x405eff[_0xda98('0x66')]){_0x3e0d5e[_0xda98('0x67')]=moment[_0xda98('0x62')](moment(_0x405eff[_0xda98('0x66')],_0xda98('0x68'))[_0xda98('0x69')](moment(_0x405eff[_0xda98('0x6a')],'YYYY-MM-DDTHH:mm:ss')))[_0xda98('0x2f')](_0xda98('0x64'));}switch(_0x405eff[_0xda98('0x6b')]){case'called':_0x3e0d5e[_0xda98('0x6c')]='Called';break;case _0xda98('0x6d'):case _0xda98('0x6e'):_0x3e0d5e[_0xda98('0x6c')]=_0xda98('0x6f');break;case _0xda98('0x70'):_0x3e0d5e['Call_Result']='Rejected';break;case _0xda98('0x71'):_0x3e0d5e['Call_Result']=_0xda98('0x72');break;case _0xda98('0x73'):_0x3e0d5e[_0xda98('0x6c')]=_0xda98('0x74');default:}_0x3e0d5e[_0xda98('0x75')]=(_0x23ab80===_0xda98('0x76')?moment(_0x405eff['starttime'])[_0xda98('0x2f')](_0xda98('0x68')):moment(_0x405eff[_0xda98('0x77')])[_0xda98('0x2f')]('YYYY-MM-DDTHH:mm:ss'))||moment()['format'](_0xda98('0x68'));_0x3e0d5e[_0xda98('0x78')]=_0x23ab80||'Inbound';_0x3e0d5e=_[_0xda98('0x79')](_0x3e0d5e,getCustomFields(_0x2820ba[_0xda98('0x7a')],_0x405eff));return request({'method':'POST','uri':'https://www.zohoapis.'+_0xa43d9e+_0xda98('0x7b'),'headers':{'Authorization':_0xda98('0x32')+_0x49d0ff},'body':{'data':[_0x3e0d5e]},'json':!![]})[_0xda98('0x27')](function(_0x491835){if(_0x491835&&_0x491835[_0xda98('0x3e')][0x0][_0xda98('0x45')]===_0xda98('0x46')){logger[_0xda98('0x2c')]('Call\x20created!');return{'id':_0x491835['data'][0x0][_0xda98('0x47')]['id']};}})['catch'](function(_0x2f20a7){logger[_0xda98('0x2c')](_0xda98('0x7c'),_0x2f20a7[_0xda98('0x2b')]);console[_0xda98('0x4b')]('err',_0x2f20a7);});}exports['queue']=function(_0x174544,_0x2cfde8,_0x5d110f,_0x4e64a5,_0x17c736,_0x554ffb){var _0x369577,_0x4760dd,_0x4b1d8e;_0x554ffb[_0xda98('0x7d')]=intUtil['stripTrailingSlash'](_0x554ffb[_0xda98('0x7d')]);_0x554ffb[_0xda98('0x7e')]=intUtil[_0xda98('0x7f')](_0x554ffb['serverUrl']);if(_0x17c736&&_0x17c736['monitor_format']){logger[_0xda98('0x2c')](_0xda98('0x80'),_0xda98('0x81'));_0x2cfde8[_0xda98('0x82')]=_0x554ffb[_0xda98('0x7e')]+_0xda98('0x83')+_0x2cfde8[_0xda98('0x84')]+_0xda98('0x85')+md5(_0x2cfde8[_0xda98('0x84')]);}else{_0x2cfde8[_0xda98('0x82')]='';}var _0x5d2bbd=_0x554ffb['host']===_0xda98('0x86')?'eu':_0xda98('0x87');return getAccessToken(_0x554ffb)[_0xda98('0x27')](function(_0x2cebca){_0x4b1d8e=_0x2cebca;return getUser(_0x4b1d8e,_0x5d2bbd,_0x554ffb,_0x4e64a5[_0xda98('0x36')]);})[_0xda98('0x27')](function(_0x50ceaf){_0x369577=_0x50ceaf;logger[_0xda98('0x2c')](_0xda98('0x88'),_0x369577['id']);return getEndUser(_0x4b1d8e,_0x5d2bbd,_0x554ffb,_0x2cfde8[_0xda98('0x89')],_0x2cfde8[_0xda98('0x8a')],_0x369577,_0x5d110f);})[_0xda98('0x27')](function(_0x3c9a42){_0x4760dd=_0x3c9a42;return getCall(_0x4b1d8e,_0x5d2bbd,_0x554ffb,_0x369577,_0x4760dd,_0x5d110f,_0x2cfde8,_0xda98('0x8b'));})[_0xda98('0x27')](function(_0xae557b){if(_0xae557b){logger[_0xda98('0x2c')](_0xda98('0x8c'),_0xae557b['id']);logger[_0xda98('0x2c')](_0xda98('0x80'),_0xda98('0x8d'));emit(util[_0xda98('0x2f')]('user:%s',_0x4e64a5['name']),_0xda98('0x8e'),{'uri':_0xda98('0x8f')+_0x554ffb[_0xda98('0x7d')]+_0xda98('0x90')+_0xae557b['id']});}})[_0xda98('0x29')](function(_0x15deb7){logger['error']('[QUEUE]',JSON[_0xda98('0xd')](_0x15deb7));});};exports[_0xda98('0x76')]=function(_0x8fd047,_0x2429df,_0x170d84,_0x838f7c,_0x22794e,_0x336b5d,_0x103353){var _0x552f9c,_0x5c3230,_0x14dc58;_0x336b5d[_0xda98('0x7d')]=intUtil[_0xda98('0x7f')](_0x336b5d[_0xda98('0x7d')]);_0x336b5d[_0xda98('0x7e')]=intUtil[_0xda98('0x7f')](_0x336b5d[_0xda98('0x7e')]);if(_0x103353&&_0x103353[_0xda98('0x91')]&&_0x103353[_0xda98('0x91')]!==_0xda98('0x92')){logger[_0xda98('0x2c')](_0xda98('0x93'),'Recording\x20is\x20enabled!');_0x2429df[_0xda98('0x82')]=_0x336b5d['serverUrl']+_0xda98('0x83')+_0x2429df[_0xda98('0x84')]+_0xda98('0x85')+md5(_0x2429df[_0xda98('0x84')]);}var _0x4fc4aa=_0x336b5d[_0xda98('0x7d')]===_0xda98('0x86')?'eu':_0xda98('0x87');return getAccessToken(_0x336b5d)[_0xda98('0x27')](function(_0x138479){_0x14dc58=_0x138479;return getUser(_0x14dc58,_0x4fc4aa,_0x336b5d,_0x838f7c[_0xda98('0x36')]);})[_0xda98('0x27')](function(_0x203ed3){_0x552f9c=_0x203ed3;logger[_0xda98('0x2c')]('The\x20User\x20ID\x20is:',_0x552f9c['id']);return getEndUser(_0x14dc58,_0x4fc4aa,_0x336b5d,_0x2429df['destcalleridname'],_0x2429df['destcalleridnum'],_0x552f9c,_0x170d84);})['then'](function(_0x5e2b04){_0x5c3230=_0x5e2b04;return getCall(_0x14dc58,_0x4fc4aa,_0x336b5d,_0x552f9c,_0x5c3230,_0x170d84,_0x2429df,_0xda98('0x94'));})[_0xda98('0x27')](function(_0x380fe3){if(_0x380fe3){logger['info'](_0xda98('0x8c'),_0x380fe3['id']);logger[_0xda98('0x2c')](_0xda98('0x93'),_0xda98('0x8d'));emit(util['format'](_0xda98('0x95'),_0x838f7c[_0xda98('0x18')]),_0xda98('0x8e'),{'uri':_0xda98('0x8f')+_0x336b5d[_0xda98('0x7d')]+_0xda98('0x90')+_0x380fe3['id']});}})[_0xda98('0x29')](function(_0x57c746){logger[_0xda98('0x3d')](_0xda98('0x93'),JSON[_0xda98('0xd')](_0x57c746));});};exports[_0xda98('0x96')]=function(_0x4aad86,_0x17b687,_0x7609c0,_0x52b2ed,_0x5cbadb,_0x1b483f){var _0x1de8a2,_0x4808fd,_0x24c432;_0x1b483f[_0xda98('0x7d')]=intUtil[_0xda98('0x7f')](_0x1b483f['host']);_0x1b483f[_0xda98('0x7e')]=intUtil[_0xda98('0x7f')](_0x1b483f[_0xda98('0x7e')]);if(_0x5cbadb&&_0x5cbadb[_0xda98('0x97')]){logger[_0xda98('0x2c')]('['+_0x17b687[_0xda98('0x6b')][_0xda98('0x98')]()+']',_0xda98('0x81'));_0x17b687[_0xda98('0x82')]=_0x1b483f['serverUrl']+_0xda98('0x83')+_0x17b687['uniqueid']+_0xda98('0x85')+md5(_0x17b687[_0xda98('0x84')]);}else{_0x17b687[_0xda98('0x82')]='';}var _0x1a6c3=_0x1b483f['host']===_0xda98('0x86')?'eu':_0xda98('0x87');return getAccessToken(_0x1b483f)['then'](function(_0x121c7b){_0x24c432=_0x121c7b;return getUser(_0x24c432,_0x1a6c3,_0x1b483f);})[_0xda98('0x27')](function(_0x574584){_0x1de8a2=_0x574584;logger[_0xda98('0x2c')]('The\x20User\x20ID\x20is:',_0x1de8a2['id']);return getEndUser(_0x24c432,_0x1a6c3,_0x1b483f,_0x17b687[_0xda98('0x89')],_0x17b687['calleridnum'],_0x1de8a2,_0x7609c0);})[_0xda98('0x27')](function(_0xe1e087){_0x4808fd=_0xe1e087;return getCall(_0x24c432,_0x1a6c3,_0x1b483f,_0x1de8a2,_0x4808fd,_0x7609c0,_0x17b687,_0xda98('0x8b'));})[_0xda98('0x27')](function(_0x190be9){if(_0x190be9){logger[_0xda98('0x2c')]('The\x20Call\x20ID\x20is:',_0x190be9['id']);}})[_0xda98('0x29')](function(_0x20861c){logger[_0xda98('0x3d')]('['+_0x17b687[_0xda98('0x6b')][_0xda98('0x98')]()+']',JSON[_0xda98('0xd')](_0x20861c));});}; \ 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 0e16a6b..35490e8 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 _0x8570=['shelljs','mustache','../../../../config/logger','trigger','exec','data2','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util'];(function(_0x595adc,_0x3e9d42){var _0x3a2419=function(_0x2d1d21){while(--_0x2d1d21){_0x595adc['push'](_0x595adc['shift']());}};_0x3a2419(++_0x3e9d42);}(_0x8570,0x12a));var _0x0857=function(_0x149e72,_0x2a3b99){_0x149e72=_0x149e72-0x0;var _0x502e03=_0x8570[_0x149e72];return _0x502e03;};'use strict';var util=require(_0x0857('0x0'));var sh=require(_0x0857('0x1'));var Mustache=require(_0x0857('0x2'));var logger=require(_0x0857('0x3'))(_0x0857('0x4'));exports[_0x0857('0x5')]=function(_0x1c00df,_0x466ecf){var _0x36fb5d=_0x1c00df[_0x0857('0x6')]?_0x1c00df[_0x0857('0x6')]:'Script';var _0x371f27=_0x1c00df['data3']?Mustache[_0x0857('0x7')](_0x1c00df['data3'],_0x466ecf):_0x466ecf;sh[_0x0857('0x5')](_0x371f27,function(_0x57d8e6,_0x3c93f0,_0x477aa0){if(_0x57d8e6!==0x0){logger[_0x0857('0x8')](util[_0x0857('0x9')](_0x0857('0xa'),_0x36fb5d,_0x371f27,_0x57d8e6,_0x477aa0));}else{logger[_0x0857('0xb')](util[_0x0857('0x9')](_0x0857('0xc'),_0x36fb5d,_0x371f27,_0x3c93f0));}});}; \ No newline at end of file +var _0x0324=['render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','trigger','exec','data2','data3'];(function(_0x1d2b26,_0x1d3cd9){var _0x570355=function(_0x5e8ebe){while(--_0x5e8ebe){_0x1d2b26['push'](_0x1d2b26['shift']());}};_0x570355(++_0x1d3cd9);}(_0x0324,0x1e2));var _0x4032=function(_0x209874,_0x327c47){_0x209874=_0x209874-0x0;var _0x5813ac=_0x0324[_0x209874];return _0x5813ac;};'use strict';var util=require(_0x4032('0x0'));var sh=require(_0x4032('0x1'));var Mustache=require(_0x4032('0x2'));var logger=require(_0x4032('0x3'))(_0x4032('0x4'));exports[_0x4032('0x5')]=function(_0x218054,_0x311c97){var _0x2544ff=_0x218054['data2']?_0x218054[_0x4032('0x6')]:'Script';var _0x1fc961=_0x218054[_0x4032('0x7')]?Mustache[_0x4032('0x8')](_0x218054[_0x4032('0x7')],_0x311c97):_0x311c97;sh[_0x4032('0x5')](_0x1fc961,function(_0x4c59c9,_0x2f7c11,_0x2eba0d){if(_0x4c59c9!==0x0){logger[_0x4032('0x9')](util[_0x4032('0xa')](_0x4032('0xb'),_0x2544ff,_0x1fc961,_0x4c59c9,_0x2eba0d));}else{logger[_0x4032('0xc')](util[_0x4032('0xa')](_0x4032('0xd'),_0x2544ff,_0x1fc961,_0x2f7c11));}});}; \ 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 cbd39cf..0139ba7 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 _0x0cc4=['statusCode','name','request-promise','lodash','../../../../config/logger','trigger','exec','data1','data2','number','data5','headers','parse','error','stack','toUpperCase','DELETE','POST','PUT','data7','render','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s'];(function(_0x424b05,_0x526b5b){var _0x4c65cd=function(_0x59e1f3){while(--_0x59e1f3){_0x424b05['push'](_0x424b05['shift']());}};_0x4c65cd(++_0x526b5b);}(_0x0cc4,0xdb));var _0x40cc=function(_0x103478,_0x353eca){_0x103478=_0x103478-0x0;var _0x55d015=_0x0cc4[_0x103478];return _0x55d015;};'use strict';var rp=require(_0x40cc('0x0'));var util=require('util');var _=require(_0x40cc('0x1'));var Mustache=require('mustache');var logger=require(_0x40cc('0x2'))(_0x40cc('0x3'));exports[_0x40cc('0x4')]=function(_0x3b6e7d,_0x335fe4){var _0x572e1e,_0x19a49c;var _0x36700c={'method':_0x3b6e7d[_0x40cc('0x5')]['toUpperCase'](),'uri':Mustache['render'](_0x3b6e7d[_0x40cc('0x6')],_0x335fe4),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x3b6e7d['data5'])===_0x40cc('0x7')&&parseInt(_0x3b6e7d[_0x40cc('0x8')])>=0x1&&parseInt(_0x3b6e7d[_0x40cc('0x8')])<=0xa?parseInt(_0x3b6e7d[_0x40cc('0x8')])*0x3e8:0x5*0x3e8};try{_0x36700c[_0x40cc('0x9')]=_0x3b6e7d['data6']?JSON[_0x40cc('0xa')](Mustache['render'](_0x3b6e7d['data6'],_0x335fe4)):{};}catch(_0x5a2545){logger[_0x40cc('0xb')](_0x5a2545[_0x40cc('0xc')]);}switch(_0x3b6e7d['data1'][_0x40cc('0xd')]()){case'GET':case _0x40cc('0xe'):_0x572e1e=null;_0x36700c['qs']=_0x335fe4;break;case _0x40cc('0xf'):case _0x40cc('0x10'):if(_0x3b6e7d[_0x40cc('0x11')]){try{_0x572e1e=JSON['parse'](Mustache[_0x40cc('0x12')](_0x3b6e7d['data7'],_0x335fe4));_0x36700c[_0x40cc('0x13')]=_0x572e1e;}catch(_0x69214b){logger[_0x40cc('0xb')](_0x69214b['stack']);logger['error'](_0x40cc('0x14'));}}else{_0x572e1e=_0x335fe4;_0x36700c['body']=_0x572e1e;}break;}logger[_0x40cc('0x15')](util[_0x40cc('0x16')](_0x40cc('0x17'),_0x3b6e7d[_0x40cc('0x5')],_0x3b6e7d['data2'],JSON[_0x40cc('0x18')](_0x36700c)));rp(_0x36700c)[_0x40cc('0x19')](function(_0x5d33d3){_0x572e1e=!_['isNil'](_0x572e1e)?_0x40cc('0x1a')+_0x572e1e:'';_0x19a49c=typeof _0x5d33d3['body']===_0x40cc('0x1b')?JSON[_0x40cc('0x18')](_0x5d33d3['body']):_0x5d33d3[_0x40cc('0x13')];logger[_0x40cc('0x15')](util[_0x40cc('0x16')](_0x40cc('0x1c'),_0x3b6e7d['data1'],_0x3b6e7d[_0x40cc('0x6')],_0x5d33d3[_0x40cc('0x1d')],_0x19a49c));})['catch'](function(_0x3fa4ea){logger[_0x40cc('0xb')](util[_0x40cc('0x16')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x3b6e7d[_0x40cc('0x5')],_0x3b6e7d[_0x40cc('0x6')],_0x3fa4ea[_0x40cc('0x1d')],_0x3fa4ea[_0x40cc('0x1e')],_0x3fa4ea['message']));});}; \ No newline at end of file +var _0x94a1=['body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','isNil','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','request-promise','lodash','mustache','exec','data1','toUpperCase','render','data2','data5','number','headers','data6','error','stack','GET','DELETE','POST','PUT','parse','data7'];(function(_0x1ce19b,_0x5207df){var _0x85c319=function(_0x177b01){while(--_0x177b01){_0x1ce19b['push'](_0x1ce19b['shift']());}};_0x85c319(++_0x5207df);}(_0x94a1,0xcc));var _0x194a=function(_0xb30d67,_0x1b0aa5){_0xb30d67=_0xb30d67-0x0;var _0x38e04f=_0x94a1[_0xb30d67];return _0x38e04f;};'use strict';var rp=require(_0x194a('0x0'));var util=require('util');var _=require(_0x194a('0x1'));var Mustache=require(_0x194a('0x2'));var logger=require('../../../../config/logger')('trigger');exports[_0x194a('0x3')]=function(_0x4237a6,_0xd5b66e){var _0x3f19ce,_0xf78e10;var _0x3b49cb={'method':_0x4237a6[_0x194a('0x4')][_0x194a('0x5')](),'uri':Mustache[_0x194a('0x6')](_0x4237a6[_0x194a('0x7')],_0xd5b66e),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x4237a6[_0x194a('0x8')])===_0x194a('0x9')&&parseInt(_0x4237a6[_0x194a('0x8')])>=0x1&&parseInt(_0x4237a6[_0x194a('0x8')])<=0xa?parseInt(_0x4237a6['data5'])*0x3e8:0x5*0x3e8};try{_0x3b49cb[_0x194a('0xa')]=_0x4237a6[_0x194a('0xb')]?JSON['parse'](Mustache[_0x194a('0x6')](_0x4237a6[_0x194a('0xb')],_0xd5b66e)):{};}catch(_0x7295eb){logger[_0x194a('0xc')](_0x7295eb[_0x194a('0xd')]);}switch(_0x4237a6[_0x194a('0x4')][_0x194a('0x5')]()){case _0x194a('0xe'):case _0x194a('0xf'):_0x3f19ce=null;_0x3b49cb['qs']=_0xd5b66e;break;case _0x194a('0x10'):case _0x194a('0x11'):if(_0x4237a6['data7']){try{_0x3f19ce=JSON[_0x194a('0x12')](Mustache['render'](_0x4237a6[_0x194a('0x13')],_0xd5b66e));_0x3b49cb['body']=_0x3f19ce;}catch(_0x43b6a7){logger[_0x194a('0xc')](_0x43b6a7[_0x194a('0xd')]);logger[_0x194a('0xc')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x3f19ce=_0xd5b66e;_0x3b49cb[_0x194a('0x14')]=_0x3f19ce;}break;}logger[_0x194a('0x15')](util[_0x194a('0x16')](_0x194a('0x17'),_0x4237a6[_0x194a('0x4')],_0x4237a6['data2'],JSON['stringify'](_0x3b49cb)));rp(_0x3b49cb)['then'](function(_0x405336){_0x3f19ce=!_[_0x194a('0x18')](_0x3f19ce)?',\x20request\x20body:\x20'+_0x3f19ce:'';_0xf78e10=typeof _0x405336[_0x194a('0x14')]===_0x194a('0x19')?JSON[_0x194a('0x1a')](_0x405336[_0x194a('0x14')]):_0x405336['body'];logger[_0x194a('0x15')](util[_0x194a('0x16')](_0x194a('0x1b'),_0x4237a6['data1'],_0x4237a6[_0x194a('0x7')],_0x405336[_0x194a('0x1c')],_0xf78e10));})[_0x194a('0x1d')](function(_0x4cc921){logger[_0x194a('0xc')](util[_0x194a('0x16')](_0x194a('0x1e'),_0x4237a6['data1'],_0x4237a6[_0x194a('0x7')],_0x4cc921['statusCode'],_0x4cc921[_0x194a('0x1f')],_0x4cc921['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 845a29f..1263768 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 _0x1209=['debug','rpc','error','message','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','then'];(function(_0x20bb74,_0x2310cf){var _0x285307=function(_0x27a737){while(--_0x27a737){_0x20bb74['push'](_0x20bb74['shift']());}};_0x285307(++_0x2310cf);}(_0x1209,0x114));var _0x9120=function(_0x487e23,_0x13f518){_0x487e23=_0x487e23-0x0;var _0x34504c=_0x1209[_0x487e23];return _0x34504c;};'use strict';var jayson=require(_0x9120('0x0'));var BPromise=require(_0x9120('0x1'));var logger=require(_0x9120('0x2'))(_0x9120('0x3'));var client=jayson[_0x9120('0x4')][_0x9120('0x5')]({'port':0x2329});client[_0x9120('0x6')]=function(_0x5774c4,_0x441116){return new BPromise(function(_0x1bc137,_0x53d659){return client[_0x9120('0x7')](_0x5774c4,_0x441116)[_0x9120('0x8')](function(_0x1358f4){logger[_0x9120('0x9')](_0x9120('0xa'),'routing',_0x5774c4,_0x441116,_0x1358f4);if(_0x1358f4[_0x9120('0xb')]){logger[_0x9120('0xb')](_0x9120('0xa'),_0x9120('0x3'),_0x5774c4,_0x1358f4[_0x9120('0xb')][_0x9120('0xc')],_0x441116);return _0x53d659(_0x1358f4['error'][_0x9120('0xc')]);}else{return _0x1bc137(_0x1358f4['result']);}})[_0x9120('0xd')](function(_0xdd3aff){logger['error']('rpc',_0x9120('0x3'),_0x5774c4,_0xdd3aff,_0x441116);return _0x53d659(_0xdd3aff);});});};module[_0x9120('0xe')]=client; \ No newline at end of file +var _0x9bd8=['error','message','catch','jayson/promise','../../config/logger','http','Request','request','debug','rpc','routing'];(function(_0x15b33d,_0x3a17b0){var _0x3b09b6=function(_0xe5870e){while(--_0xe5870e){_0x15b33d['push'](_0x15b33d['shift']());}};_0x3b09b6(++_0x3a17b0);}(_0x9bd8,0x87));var _0x89bd=function(_0x59d471,_0x2b1e92){_0x59d471=_0x59d471-0x0;var _0x5e23b1=_0x9bd8[_0x59d471];return _0x5e23b1;};'use strict';var jayson=require(_0x89bd('0x0'));var BPromise=require('bluebird');var logger=require(_0x89bd('0x1'))('routing');var client=jayson['client'][_0x89bd('0x2')]({'port':0x2329});client[_0x89bd('0x3')]=function(_0x84ac9c,_0x40bc35){return new BPromise(function(_0x160b3e,_0x225d8a){return client[_0x89bd('0x4')](_0x84ac9c,_0x40bc35)['then'](function(_0x507831){logger[_0x89bd('0x5')](_0x89bd('0x6'),_0x89bd('0x7'),_0x84ac9c,_0x40bc35,_0x507831);if(_0x507831[_0x89bd('0x8')]){logger['error']('rpc','routing',_0x84ac9c,_0x507831[_0x89bd('0x8')][_0x89bd('0x9')],_0x40bc35);return _0x225d8a(_0x507831[_0x89bd('0x8')]['message']);}else{return _0x160b3e(_0x507831['result']);}})[_0x89bd('0xa')](function(_0x3f747b){logger[_0x89bd('0x8')](_0x89bd('0x6'),'routing',_0x84ac9c,_0x3f747b,_0x40bc35);return _0x225d8a(_0x3f747b);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index ca0603e..d5af06c 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 _0x0ce9=['error','./server','./lib/email','./rpc/mailAccount','email','then','getMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency'];(function(_0x525847,_0x240458){var _0x4b8fb9=function(_0x421075){while(--_0x421075){_0x525847['push'](_0x525847['shift']());}};_0x4b8fb9(++_0x240458);}(_0x0ce9,0x1c9));var _0x90ce=function(_0x4ab260,_0x2e5555){_0x4ab260=_0x4ab260-0x0;var _0x36d8dc=_0x0ce9[_0x4ab260];return _0x36d8dc;};'use strict';var server=require(_0x90ce('0x0'));var Realtime=require('./realtime');var EmailChannel=require(_0x90ce('0x1'));var mailAccount=require(_0x90ce('0x2'));var setting=require('./rpc/setting');var logger=require('../../config/logger')(_0x90ce('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0x90ce('0x4')](mailAccount[_0x90ce('0x5')]())[_0x90ce('0x4')](realtime['initMailAccounts']())[_0x90ce('0x4')](function(){email[_0x90ce('0x6')](realtime[_0x90ce('0x7')]);return realtime;});}function main(){return server[_0x90ce('0x8')](realtime,email)['then'](function(){return initRealtime();})[_0x90ce('0x4')](function(){return setting[_0x90ce('0x9')]();})[_0x90ce('0x4')](function(_0x53e1e4){return setInterval(initRealtime,_0x53e1e4[_0x90ce('0xa')]*0x3e8);})['catch'](function(_0x2517f2){logger[_0x90ce('0xb')]('Email\x20service\x20initialization',_0x2517f2);});}main(); \ No newline at end of file +var _0x6e25=['getMailAccounts','initMailAccounts','refresh','listen','catch','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/setting','resolve','then'];(function(_0x459592,_0x4c5d5f){var _0x1f25b9=function(_0x5e9e3e){while(--_0x5e9e3e){_0x459592['push'](_0x459592['shift']());}};_0x1f25b9(++_0x4c5d5f);}(_0x6e25,0x18d));var _0x56e2=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x6e25[_0x5f309e];return _0x487b5e;};'use strict';var server=require(_0x56e2('0x0'));var Realtime=require(_0x56e2('0x1'));var EmailChannel=require(_0x56e2('0x2'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0x56e2('0x3'));var logger=require('../../config/logger')('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x56e2('0x4')]()[_0x56e2('0x5')](mailAccount[_0x56e2('0x6')]())[_0x56e2('0x5')](realtime[_0x56e2('0x7')]())[_0x56e2('0x5')](function(){email[_0x56e2('0x8')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x56e2('0x9')](realtime,email)[_0x56e2('0x5')](function(){return initRealtime();})[_0x56e2('0x5')](function(){return setting['getSettings']();})[_0x56e2('0x5')](function(_0x2a0da1){return setInterval(initRealtime,_0x2a0da1['loginMailFrequency']*0x3e8);})[_0x56e2('0xa')](function(_0x4a6492){logger[_0x56e2('0xb')](_0x56e2('0xc'),_0x4a6492);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 88e85b7..c4893de 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 _0x90c6=['Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','sendMail','send','verifySmtp','Smtp','verify','verified','exports','lodash','moment','bluebird','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','prototype','emit','name','Imap','total','isNil','md5','refresh','active','provider','custom','box','handleImapBox','bind','end','handleImapEnd','error','handleImapError','status','disabled','messageStatus','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','notify','then','catch'];(function(_0x4b9208,_0x339810){var _0x59aea8=function(_0x3ad552){while(--_0x3ad552){_0x4b9208['push'](_0x4b9208['shift']());}};_0x59aea8(++_0x339810);}(_0x90c6,0x1c2));var _0x690c=function(_0x38ff8a,_0x384882){_0x38ff8a=_0x38ff8a-0x0;var _0x1b6c15=_0x90c6[_0x38ff8a];return _0x1b6c15;};'use strict';var _=require(_0x690c('0x0'));var moment=require(_0x690c('0x1'));var BPromise=require(_0x690c('0x2'));var md5=require('md5');var Redis=require(_0x690c('0x3'));var config=require(_0x690c('0x4'));var logger=require(_0x690c('0x5'))(_0x690c('0x6'));config[_0x690c('0x7')]=_[_0x690c('0x8')](config[_0x690c('0x7')],{'host':_0x690c('0x9'),'port':0x18eb});var io=require(_0x690c('0xa'))(new Redis(config[_0x690c('0x7')]));var EmailImap=require(_0x690c('0xb'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x690c('0xc'));var md5Accounts={};function EmailChannel(_0x5418f5){logger[_0x690c('0xd')]('start\x20email\x20channel');this[_0x690c('0xe')]=_0x5418f5[_0x690c('0xe')];this[_0x690c('0xf')]={};this[_0x690c('0x10')]=new EmailSmtp();}EmailChannel[_0x690c('0x11')][_0x690c('0x12')]=function(_0x288358){var _0x261dd9=this[_0x690c('0xe')][_0x288358];var _0x6a014={'id':_0x261dd9['id'],'name':_0x261dd9[_0x690c('0x13')],'key':_0x261dd9['key'],'active':_0x261dd9['active'],'Imap':{'status':_0x261dd9[_0x690c('0x14')]['status'],'messageStatus':_0x261dd9[_0x690c('0x14')]['messageStatus'],'total':_0x261dd9['Imap'][_0x690c('0x15')]}};if(_[_0x690c('0x16')](md5Accounts[_0x288358])){md5Accounts[_0x288358]={};}var _0x29b0ad=md5(JSON['stringify'](_0x6a014));if(md5Accounts[_0x288358][_0x690c('0x17')]!==_0x29b0ad){md5Accounts[_0x288358][_0x690c('0x17')]=_0x29b0ad;io['emit']('mailAccount:update',_0x6a014);}};EmailChannel[_0x690c('0x11')][_0x690c('0x18')]=function(_0x310456){for(var _0x274ce4 in _0x310456){if(_0x310456['hasOwnProperty'](_0x274ce4)){if(_0x310456[_0x274ce4][_0x690c('0x14')]&&_0x310456[_0x274ce4][_0x690c('0x19')]){var _0xb68768=_0x310456[_0x274ce4]['Imap'];if(!_0xb68768['service']&&_0x310456[_0x274ce4][_0x690c('0x1a')]!==_0x690c('0x1b'))_0xb68768['service']=_0x310456[_0x274ce4][_0x690c('0x1a')];if(!this[_0x690c('0xf')]['hasOwnProperty'](_0xb68768['id'])){this[_0x690c('0xf')][_0xb68768['id']]=new EmailImap(_0xb68768,_0x310456[_0x274ce4][_0x690c('0x6')]);this[_0x690c('0xf')][_0xb68768['id']]['on'](_0x690c('0x1c'),this[_0x690c('0x1d')][_0x690c('0x1e')](this,_0x274ce4));this[_0x690c('0xf')][_0xb68768['id']]['on'](_0x690c('0x6'),this['handleImapEmail']['bind'](this,_0x274ce4));this[_0x690c('0xf')][_0xb68768['id']]['on'](_0x690c('0x1f'),this[_0x690c('0x20')][_0x690c('0x1e')](this,_0x274ce4));this['imapAccounts'][_0xb68768['id']]['on'](_0x690c('0x21'),this[_0x690c('0x22')][_0x690c('0x1e')](this,_0x274ce4));}}else{if(_['isNil'](this[_0x690c('0xe')][_0x274ce4][_0x690c('0x14')])){this['mailAccounts'][_0x274ce4]['Imap']={};}this[_0x690c('0xe')][_0x274ce4][_0x690c('0x14')][_0x690c('0x23')]=_0x690c('0x24');this[_0x690c('0xe')][_0x274ce4]['Imap'][_0x690c('0x25')]='';this[_0x690c('0x12')](_0x274ce4);}}}};EmailChannel[_0x690c('0x11')][_0x690c('0x1d')]=function(_0x3343b2,_0x52cf91){if(this['mailAccounts'][_0x3343b2]){this[_0x690c('0xe')][_0x3343b2][_0x690c('0x14')]['status']='connected';this[_0x690c('0xe')][_0x3343b2][_0x690c('0x14')][_0x690c('0x25')]=_0x52cf91[_0x690c('0x13')];if(_0x52cf91[_0x690c('0x26')]){this['mailAccounts'][_0x3343b2]['Imap'][_0x690c('0x15')]=_0x52cf91[_0x690c('0x26')][_0x690c('0x15')];}return this[_0x690c('0x12')](_0x3343b2);}};EmailChannel['prototype']['handleImapEmail']=function(_0x4323e9,_0x551978){logger[_0x690c('0xd')](_0x690c('0x27'),_0x551978['firstName'],_0x551978[_0x690c('0x28')],_0x551978[_0x690c('0x29')],_0x4323e9);if(this[_0x690c('0xe')][_0x4323e9]){return mailAccount[_0x690c('0x2a')](_0x4323e9,_0x551978)[_0x690c('0x2b')](function(_0x4232eb){if(_0x4232eb){logger[_0x690c('0xd')]('Mail\x20accepted\x20from\x20routing');}})[_0x690c('0x2c')](function(_0xc28869){logger['error'](_0x690c('0x2d'),JSON[_0x690c('0x2e')](_0xc28869));});}};EmailChannel[_0x690c('0x11')][_0x690c('0x20')]=function(_0x3e92d2){if(this[_0x690c('0xe')][_0x3e92d2]&&this[_0x690c('0xe')][_0x3e92d2][_0x690c('0x14')]){if(this[_0x690c('0xf')][this[_0x690c('0xe')][_0x3e92d2][_0x690c('0x14')]['id']]){delete this['imapAccounts'][this[_0x690c('0xe')][_0x3e92d2][_0x690c('0x14')]['id']];}this['mailAccounts'][_0x3e92d2][_0x690c('0x14')][_0x690c('0x2f')]=moment();this[_0x690c('0x12')](_0x3e92d2);}};EmailChannel['prototype'][_0x690c('0x22')]=function(_0x27db32,_0x1187aa){if(this[_0x690c('0xe')][_0x27db32]){this[_0x690c('0xe')][_0x27db32][_0x690c('0x14')][_0x690c('0x23')]=_0x690c('0x21');this[_0x690c('0xe')][_0x27db32][_0x690c('0x14')][_0x690c('0x25')]=_0x1187aa;return this[_0x690c('0x12')](_0x27db32);}};EmailChannel[_0x690c('0x11')][_0x690c('0x30')]=function(_0x46f53f,_0x25b44b){return this['smtp'][_0x690c('0x31')](_0x46f53f,_0x25b44b);};EmailChannel[_0x690c('0x11')][_0x690c('0x32')]=function(_0x43213b){var _0x4c3ac8=this;if(this['mailAccounts'][_0x43213b['id']]){if(_['isNil'](this[_0x690c('0xe')][_0x43213b['id']][_0x690c('0x33')])){this[_0x690c('0xe')][_0x43213b['id']]['Smtp']={};}this[_0x690c('0xe')][_0x43213b['id']][_0x690c('0x33')][_0x690c('0x2f')]=moment();return new BPromise(function(_0x244e7e,_0x356271){return _0x4c3ac8[_0x690c('0x10')][_0x690c('0x34')](_0x43213b)['then'](function(_0x33d460){_0x4c3ac8[_0x690c('0xe')][_0x43213b['id']][_0x690c('0x33')][_0x690c('0x23')]=_0x690c('0x35');_0x4c3ac8['mailAccounts'][_0x43213b['id']][_0x690c('0x33')][_0x690c('0x25')]='';_0x4c3ac8[_0x690c('0x12')](_0x43213b['id']);_0x244e7e(_0x33d460);})[_0x690c('0x2c')](function(_0x3cfe9f){_0x4c3ac8[_0x690c('0xe')][_0x43213b['id']]['Smtp'][_0x690c('0x23')]='error';_0x4c3ac8[_0x690c('0xe')][_0x43213b['id']]['Smtp'][_0x690c('0x25')]=_0x3cfe9f;_0x4c3ac8[_0x690c('0x12')](_0x43213b['id']);_0x356271(_0x3cfe9f);});});}return this['smtp'][_0x690c('0x34')](_0x43213b);};module[_0x690c('0x36')]=EmailChannel; \ No newline at end of file +var _0x6dd7=['Smtp','verify','verified','exports','lodash','moment','bluebird','md5','ioredis','../../../config/logger','email','defaults','redis','localhost','socket.io-emitter','./imap','./smtp','info','start\x20email\x20channel','mailAccounts','prototype','emit','active','status','Imap','messageStatus','total','isNil','refresh','service','provider','custom','imapAccounts','hasOwnProperty','box','handleImapEmail','bind','end','error','disabled','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','lastSync','sendMail','smtp','send','verifySmtp'];(function(_0x2c3388,_0xa74712){var _0xabb519=function(_0x129d35){while(--_0x129d35){_0x2c3388['push'](_0x2c3388['shift']());}};_0xabb519(++_0xa74712);}(_0x6dd7,0x72));var _0x76dd=function(_0x743701,_0x3e67bb){_0x743701=_0x743701-0x0;var _0x5a141d=_0x6dd7[_0x743701];return _0x5a141d;};'use strict';var _=require(_0x76dd('0x0'));var moment=require(_0x76dd('0x1'));var BPromise=require(_0x76dd('0x2'));var md5=require(_0x76dd('0x3'));var Redis=require(_0x76dd('0x4'));var config=require('../../../config/environment');var logger=require(_0x76dd('0x5'))(_0x76dd('0x6'));config['redis']=_[_0x76dd('0x7')](config[_0x76dd('0x8')],{'host':_0x76dd('0x9'),'port':0x18eb});var io=require(_0x76dd('0xa'))(new Redis(config[_0x76dd('0x8')]));var EmailImap=require(_0x76dd('0xb'));var EmailSmtp=require(_0x76dd('0xc'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x2f67cc){logger[_0x76dd('0xd')](_0x76dd('0xe'));this[_0x76dd('0xf')]=_0x2f67cc[_0x76dd('0xf')];this['imapAccounts']={};this['smtp']=new EmailSmtp();}EmailChannel[_0x76dd('0x10')][_0x76dd('0x11')]=function(_0x48e873){var _0x33bf5a=this['mailAccounts'][_0x48e873];var _0x4b81c0={'id':_0x33bf5a['id'],'name':_0x33bf5a['name'],'key':_0x33bf5a['key'],'active':_0x33bf5a[_0x76dd('0x12')],'Imap':{'status':_0x33bf5a['Imap'][_0x76dd('0x13')],'messageStatus':_0x33bf5a[_0x76dd('0x14')][_0x76dd('0x15')],'total':_0x33bf5a[_0x76dd('0x14')][_0x76dd('0x16')]}};if(_[_0x76dd('0x17')](md5Accounts[_0x48e873])){md5Accounts[_0x48e873]={};}var _0x6a4b9d=md5(JSON['stringify'](_0x4b81c0));if(md5Accounts[_0x48e873][_0x76dd('0x3')]!==_0x6a4b9d){md5Accounts[_0x48e873][_0x76dd('0x3')]=_0x6a4b9d;io[_0x76dd('0x11')]('mailAccount:update',_0x4b81c0);}};EmailChannel[_0x76dd('0x10')][_0x76dd('0x18')]=function(_0x4ecfd0){for(var _0x6c7df1 in _0x4ecfd0){if(_0x4ecfd0['hasOwnProperty'](_0x6c7df1)){if(_0x4ecfd0[_0x6c7df1][_0x76dd('0x14')]&&_0x4ecfd0[_0x6c7df1][_0x76dd('0x12')]){var _0x335313=_0x4ecfd0[_0x6c7df1]['Imap'];if(!_0x335313[_0x76dd('0x19')]&&_0x4ecfd0[_0x6c7df1][_0x76dd('0x1a')]!==_0x76dd('0x1b'))_0x335313[_0x76dd('0x19')]=_0x4ecfd0[_0x6c7df1][_0x76dd('0x1a')];if(!this[_0x76dd('0x1c')][_0x76dd('0x1d')](_0x335313['id'])){this[_0x76dd('0x1c')][_0x335313['id']]=new EmailImap(_0x335313,_0x4ecfd0[_0x6c7df1][_0x76dd('0x6')]);this[_0x76dd('0x1c')][_0x335313['id']]['on'](_0x76dd('0x1e'),this['handleImapBox']['bind'](this,_0x6c7df1));this[_0x76dd('0x1c')][_0x335313['id']]['on'](_0x76dd('0x6'),this[_0x76dd('0x1f')][_0x76dd('0x20')](this,_0x6c7df1));this[_0x76dd('0x1c')][_0x335313['id']]['on'](_0x76dd('0x21'),this['handleImapEnd'][_0x76dd('0x20')](this,_0x6c7df1));this[_0x76dd('0x1c')][_0x335313['id']]['on'](_0x76dd('0x22'),this['handleImapError']['bind'](this,_0x6c7df1));}}else{if(_[_0x76dd('0x17')](this[_0x76dd('0xf')][_0x6c7df1]['Imap'])){this[_0x76dd('0xf')][_0x6c7df1][_0x76dd('0x14')]={};}this['mailAccounts'][_0x6c7df1]['Imap']['status']=_0x76dd('0x23');this[_0x76dd('0xf')][_0x6c7df1]['Imap'][_0x76dd('0x15')]='';this[_0x76dd('0x11')](_0x6c7df1);}}}};EmailChannel[_0x76dd('0x10')]['handleImapBox']=function(_0x1f4623,_0x304f0d){if(this[_0x76dd('0xf')][_0x1f4623]){this['mailAccounts'][_0x1f4623]['Imap'][_0x76dd('0x13')]='connected';this[_0x76dd('0xf')][_0x1f4623][_0x76dd('0x14')]['messageStatus']=_0x304f0d['name'];if(_0x304f0d[_0x76dd('0x24')]){this[_0x76dd('0xf')][_0x1f4623][_0x76dd('0x14')][_0x76dd('0x16')]=_0x304f0d[_0x76dd('0x24')][_0x76dd('0x16')];}return this[_0x76dd('0x11')](_0x1f4623);}};EmailChannel['prototype'][_0x76dd('0x1f')]=function(_0x4d4ac5,_0x2735a7){logger[_0x76dd('0xd')](_0x76dd('0x25'),_0x2735a7[_0x76dd('0x26')],_0x2735a7[_0x76dd('0x27')],_0x2735a7[_0x76dd('0x28')],_0x4d4ac5);if(this['mailAccounts'][_0x4d4ac5]){return mailAccount[_0x76dd('0x29')](_0x4d4ac5,_0x2735a7)[_0x76dd('0x2a')](function(_0x40261e){if(_0x40261e){logger['info'](_0x76dd('0x2b'));}})['catch'](function(_0x1077fa){logger['error'](_0x76dd('0x2c'),JSON['stringify'](_0x1077fa));});}};EmailChannel[_0x76dd('0x10')][_0x76dd('0x2d')]=function(_0x3f6482){if(this[_0x76dd('0xf')][_0x3f6482]&&this[_0x76dd('0xf')][_0x3f6482][_0x76dd('0x14')]){if(this[_0x76dd('0x1c')][this['mailAccounts'][_0x3f6482][_0x76dd('0x14')]['id']]){delete this['imapAccounts'][this['mailAccounts'][_0x3f6482][_0x76dd('0x14')]['id']];}this[_0x76dd('0xf')][_0x3f6482][_0x76dd('0x14')][_0x76dd('0x2e')]=moment();this[_0x76dd('0x11')](_0x3f6482);}};EmailChannel[_0x76dd('0x10')]['handleImapError']=function(_0x1da1f4,_0xa36538){if(this['mailAccounts'][_0x1da1f4]){this['mailAccounts'][_0x1da1f4]['Imap'][_0x76dd('0x13')]='error';this['mailAccounts'][_0x1da1f4][_0x76dd('0x14')][_0x76dd('0x15')]=_0xa36538;return this['emit'](_0x1da1f4);}};EmailChannel['prototype'][_0x76dd('0x2f')]=function(_0x37e157,_0x2fc2c4){return this[_0x76dd('0x30')][_0x76dd('0x31')](_0x37e157,_0x2fc2c4);};EmailChannel[_0x76dd('0x10')][_0x76dd('0x32')]=function(_0x4b56bc){var _0x198e12=this;if(this[_0x76dd('0xf')][_0x4b56bc['id']]){if(_[_0x76dd('0x17')](this[_0x76dd('0xf')][_0x4b56bc['id']]['Smtp'])){this[_0x76dd('0xf')][_0x4b56bc['id']]['Smtp']={};}this[_0x76dd('0xf')][_0x4b56bc['id']][_0x76dd('0x33')][_0x76dd('0x2e')]=moment();return new BPromise(function(_0x129a54,_0x48ef2a){return _0x198e12[_0x76dd('0x30')][_0x76dd('0x34')](_0x4b56bc)[_0x76dd('0x2a')](function(_0x53ffab){_0x198e12[_0x76dd('0xf')][_0x4b56bc['id']]['Smtp']['status']=_0x76dd('0x35');_0x198e12[_0x76dd('0xf')][_0x4b56bc['id']]['Smtp'][_0x76dd('0x15')]='';_0x198e12[_0x76dd('0x11')](_0x4b56bc['id']);_0x129a54(_0x53ffab);})['catch'](function(_0x17d71e){_0x198e12[_0x76dd('0xf')][_0x4b56bc['id']]['Smtp'][_0x76dd('0x13')]=_0x76dd('0x22');_0x198e12[_0x76dd('0xf')][_0x4b56bc['id']][_0x76dd('0x33')]['messageStatus']=_0x17d71e;_0x198e12[_0x76dd('0x11')](_0x4b56bc['id']);_0x48ef2a(_0x17d71e);});});}return this['smtp'][_0x76dd('0x34')](_0x4b56bc);};module[_0x76dd('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 f64fcfa..e10e09e 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 _0x4dca=['body','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','handleMessageAttributes','parser','handleFetchEnd','closeBox','stringify','textCode','hasOwnProperty','upperFirst','lodash','imap','mailparser','simpleParser','iconv','EventEmitter','./utils','../../../config/logger','email','mailbox','account','once','ready','bind','handleEnd','error','handleError','connect','inherits','prototype','getAccount','connTimeout','authTimeout','service','user','modernAuthentication','generateXOAuth2Token','CloudProvider','data5','password','authentication','anonymous@xcally.com','host','port','tls','autotls','handleReady','handleOpenBox','emit','box','readUnseen','end','search','UNSEEN','handleReadUnseen','fetch','message','handleFetchMessage','handleFetchError','handleCloseBox'];(function(_0x4e1a49,_0x4da738){var _0x136aae=function(_0x3ffd93){while(--_0x3ffd93){_0x4e1a49['push'](_0x4e1a49['shift']());}};_0x136aae(++_0x4da738);}(_0x4dca,0x1c6));var _0xa4dc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4dca[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa4dc('0x0'));var util=require('util');var Imap=require(_0xa4dc('0x1'));var simpleParser=require(_0xa4dc('0x2'))[_0xa4dc('0x3')];var Iconv=require(_0xa4dc('0x4'))['Iconv'];var EventEmitter=require('events')[_0xa4dc('0x5')];var utils=require(_0xa4dc('0x6'));var logger=require(_0xa4dc('0x7'))(_0xa4dc('0x8'));function EmailImap(_0x2bad49,_0x376f75){this[_0xa4dc('0x9')]=_0x2bad49['mailbox'];this['account']=this['getAccount'](_0x2bad49,_0x376f75);this['imap']=new Imap(this[_0xa4dc('0xa')]);this['imap'][_0xa4dc('0xb')](_0xa4dc('0xc'),this['handleReady'][_0xa4dc('0xd')](this));this[_0xa4dc('0x1')]['once']('end',this[_0xa4dc('0xe')]['bind'](this));this[_0xa4dc('0x1')]['on'](_0xa4dc('0xf'),this[_0xa4dc('0x10')][_0xa4dc('0xd')](this));this[_0xa4dc('0x1')][_0xa4dc('0x11')]();}util[_0xa4dc('0x12')](EmailImap,EventEmitter);EmailImap[_0xa4dc('0x13')][_0xa4dc('0x14')]=function(_0xd4c14d,_0x14fe91){var _0x1af245={'connTimeout':_0xd4c14d[_0xa4dc('0x15')]?_0xd4c14d[_0xa4dc('0x15')]*0x3e8:0x2710,'authTimeout':_0xd4c14d[_0xa4dc('0x16')]?_0xd4c14d['authTimeout']*0x3e8:0x1388};if(_0xd4c14d[_0xa4dc('0x17')]){_0x1af245['user']=_0xd4c14d[_0xa4dc('0x18')];if(_0xd4c14d[_0xa4dc('0x19')]){_0x1af245['xoauth2']=utils[_0xa4dc('0x1a')](_0xd4c14d[_0xa4dc('0x1b')][_0xa4dc('0x1c')],_0xd4c14d['user']);}else{_0x1af245['password']=_0xd4c14d[_0xa4dc('0x1d')];}}else{if(_0xd4c14d[_0xa4dc('0x1e')]){_0x1af245['user']=_0xd4c14d['user'];_0x1af245[_0xa4dc('0x1d')]=_0xd4c14d['password'];}}_0x1af245[_0xa4dc('0x8')]=_0x14fe91||_0xd4c14d['user']||_0xa4dc('0x1f');_0x1af245[_0xa4dc('0x20')]=_0xd4c14d[_0xa4dc('0x20')];_0x1af245[_0xa4dc('0x21')]=_0xd4c14d[_0xa4dc('0x21')]||0x3e1;if(_0xd4c14d[_0xa4dc('0x22')]){_0x1af245[_0xa4dc('0x22')]=!![];}else{_0x1af245[_0xa4dc('0x22')]=![];_0x1af245[_0xa4dc('0x23')]='required';}return _0x1af245;};EmailImap['prototype'][_0xa4dc('0x24')]=function(){this['imap']['openBox'](this[_0xa4dc('0x9')],![],this['handleOpenBox'][_0xa4dc('0xd')](this));};EmailImap[_0xa4dc('0x13')][_0xa4dc('0x25')]=function(_0xe0e490,_0x3aa175){if(_0xe0e490){this[_0xa4dc('0x10')](_0xe0e490,!![]);}else{this[_0xa4dc('0x26')](_0xa4dc('0x27'),_0x3aa175);this[_0xa4dc('0x28')]();}};EmailImap[_0xa4dc('0x13')]['handleCloseBox']=function(_0x58151b){if(_0x58151b){this['handleError'](_0x58151b,!![]);}else{this[_0xa4dc('0x1')][_0xa4dc('0x29')]();}};EmailImap[_0xa4dc('0x13')][_0xa4dc('0x28')]=function(){this[_0xa4dc('0x1')][_0xa4dc('0x2a')]([_0xa4dc('0x2b')],this[_0xa4dc('0x2c')]['bind'](this));};EmailImap[_0xa4dc('0x13')][_0xa4dc('0x2c')]=function(_0x50cfa8,_0x15331e){if(_0x50cfa8){this[_0xa4dc('0x10')](_0x50cfa8,!![]);}else{if(_0x15331e['length']){try{var _0x5bd5ed=this[_0xa4dc('0x1')][_0xa4dc('0x2d')](_0x15331e,{'bodies':'','markSeen':!![]});_0x5bd5ed['on'](_0xa4dc('0x2e'),this[_0xa4dc('0x2f')][_0xa4dc('0xd')](this));_0x5bd5ed['once'](_0xa4dc('0xf'),this[_0xa4dc('0x30')][_0xa4dc('0xd')](this));_0x5bd5ed['once']('end',this['handleFetchEnd'][_0xa4dc('0xd')](this));}catch(_0x3018e1){logger[_0xa4dc('0xf')](_0x3018e1);}}else{this[_0xa4dc('0x1')]['closeBox'](!![],this[_0xa4dc('0x31')]['bind'](this));}}};EmailImap[_0xa4dc('0x13')][_0xa4dc('0x2f')]=function(_0x13024d){_0x13024d['on'](_0xa4dc('0x32'),this[_0xa4dc('0x33')]['bind'](this));_0x13024d[_0xa4dc('0xb')](_0xa4dc('0x34'),this['handleMessageAttributes']['bind'](this));_0x13024d[_0xa4dc('0xb')]('end',this[_0xa4dc('0x35')][_0xa4dc('0xd')](this));};EmailImap[_0xa4dc('0x13')]['handleMessageBody']=function(_0x318458){simpleParser(_0x318458,{'Iconv':Iconv},this[_0xa4dc('0x36')]['bind'](this));};EmailImap['prototype'][_0xa4dc('0x37')]=function(){};EmailImap[_0xa4dc('0x13')][_0xa4dc('0x35')]=function(){};EmailImap[_0xa4dc('0x13')][_0xa4dc('0x36')]=function(_0x271ff1,_0x410632){if(_0x271ff1){logger['error'](_0x271ff1);}else{var _0x259203=this;utils[_0xa4dc('0x38')](this['account'],_0x410632,function(_0x5b9b47){_0x259203[_0xa4dc('0x26')](_0xa4dc('0x8'),_0x5b9b47);});}};EmailImap[_0xa4dc('0x13')][_0xa4dc('0x39')]=function(){this[_0xa4dc('0x1')][_0xa4dc('0x3a')](!![],this[_0xa4dc('0x31')]['bind'](this));};EmailImap[_0xa4dc('0x13')]['handleFetchError']=function(_0x31fee0){this[_0xa4dc('0x10')](_0x31fee0);this[_0xa4dc('0x1')]['closeBox'](!![],this['handleCloseBox'][_0xa4dc('0xd')](this));};EmailImap['prototype'][_0xa4dc('0xe')]=function(){this[_0xa4dc('0x26')](_0xa4dc('0x29'));};EmailImap[_0xa4dc('0x13')][_0xa4dc('0x10')]=function(_0x3df1e9,_0x45453f){logger[_0xa4dc('0xf')](_0xa4dc('0x10'),this[_0xa4dc('0xa')][_0xa4dc('0x8')],JSON[_0xa4dc('0x3b')](_0x3df1e9));var _0x48be25='';if(_0x3df1e9){if(_0x3df1e9[_0xa4dc('0x3c')]){_0x48be25=_0x3df1e9['textCode'];}else{for(var _0x1b8777 in _0x3df1e9){if(_0x3df1e9[_0xa4dc('0x3d')](_0x1b8777)){_0x48be25+=_[_0xa4dc('0x3e')](_0x1b8777)+':\x20'+_0x3df1e9[_0x1b8777]+'\x0a';}}}}if(_0x45453f){this[_0xa4dc('0x1')][_0xa4dc('0x29')]();}else{this[_0xa4dc('0x26')]('error',_0x48be25);this[_0xa4dc('0x26')](_0xa4dc('0x29'));}};module['exports']=EmailImap; \ No newline at end of file +var _0x74ab=['emit','box','readUnseen','search','UNSEEN','handleReadUnseen','length','message','handleFetchMessage','handleFetchError','handleFetchEnd','error','body','handleMessageBody','handleMessageEnd','handleSimpleParser','closeBox','handleCloseBox','textCode','hasOwnProperty','exports','lodash','imap','iconv','EventEmitter','./utils','../../../config/logger','email','mailbox','account','getAccount','ready','handleReady','bind','once','end','handleEnd','handleError','prototype','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','CloudProvider','data5','password','authentication','anonymous@xcally.com','host','port','tls','autotls','required','handleOpenBox'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x74ab,0x85));var _0xb74a=function(_0x619ea,_0x397707){_0x619ea=_0x619ea-0x0;var _0x4dc846=_0x74ab[_0x619ea];return _0x4dc846;};'use strict';var _=require(_0xb74a('0x0'));var util=require('util');var Imap=require(_0xb74a('0x1'));var simpleParser=require('mailparser')['simpleParser'];var Iconv=require(_0xb74a('0x2'))['Iconv'];var EventEmitter=require('events')[_0xb74a('0x3')];var utils=require(_0xb74a('0x4'));var logger=require(_0xb74a('0x5'))(_0xb74a('0x6'));function EmailImap(_0x3f122d,_0x508e29){this[_0xb74a('0x7')]=_0x3f122d[_0xb74a('0x7')];this[_0xb74a('0x8')]=this[_0xb74a('0x9')](_0x3f122d,_0x508e29);this[_0xb74a('0x1')]=new Imap(this['account']);this[_0xb74a('0x1')]['once'](_0xb74a('0xa'),this[_0xb74a('0xb')][_0xb74a('0xc')](this));this[_0xb74a('0x1')][_0xb74a('0xd')](_0xb74a('0xe'),this[_0xb74a('0xf')][_0xb74a('0xc')](this));this[_0xb74a('0x1')]['on']('error',this[_0xb74a('0x10')][_0xb74a('0xc')](this));this[_0xb74a('0x1')]['connect']();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0xb74a('0x11')][_0xb74a('0x9')]=function(_0x14c99d,_0x519eb3){var _0x8c4bb5={'connTimeout':_0x14c99d[_0xb74a('0x12')]?_0x14c99d['connTimeout']*0x3e8:0x2710,'authTimeout':_0x14c99d[_0xb74a('0x13')]?_0x14c99d[_0xb74a('0x13')]*0x3e8:0x1388};if(_0x14c99d[_0xb74a('0x14')]){_0x8c4bb5[_0xb74a('0x15')]=_0x14c99d[_0xb74a('0x15')];if(_0x14c99d[_0xb74a('0x16')]){_0x8c4bb5[_0xb74a('0x17')]=utils['generateXOAuth2Token'](_0x14c99d[_0xb74a('0x18')][_0xb74a('0x19')],_0x14c99d[_0xb74a('0x15')]);}else{_0x8c4bb5['password']=_0x14c99d[_0xb74a('0x1a')];}}else{if(_0x14c99d[_0xb74a('0x1b')]){_0x8c4bb5['user']=_0x14c99d[_0xb74a('0x15')];_0x8c4bb5[_0xb74a('0x1a')]=_0x14c99d[_0xb74a('0x1a')];}}_0x8c4bb5[_0xb74a('0x6')]=_0x519eb3||_0x14c99d[_0xb74a('0x15')]||_0xb74a('0x1c');_0x8c4bb5['host']=_0x14c99d[_0xb74a('0x1d')];_0x8c4bb5[_0xb74a('0x1e')]=_0x14c99d[_0xb74a('0x1e')]||0x3e1;if(_0x14c99d[_0xb74a('0x1f')]){_0x8c4bb5['tls']=!![];}else{_0x8c4bb5[_0xb74a('0x1f')]=![];_0x8c4bb5[_0xb74a('0x20')]=_0xb74a('0x21');}return _0x8c4bb5;};EmailImap['prototype']['handleReady']=function(){this[_0xb74a('0x1')]['openBox'](this[_0xb74a('0x7')],![],this[_0xb74a('0x22')][_0xb74a('0xc')](this));};EmailImap[_0xb74a('0x11')]['handleOpenBox']=function(_0x2005d3,_0x1bc5bd){if(_0x2005d3){this['handleError'](_0x2005d3,!![]);}else{this[_0xb74a('0x23')](_0xb74a('0x24'),_0x1bc5bd);this[_0xb74a('0x25')]();}};EmailImap[_0xb74a('0x11')]['handleCloseBox']=function(_0x2d96ba){if(_0x2d96ba){this[_0xb74a('0x10')](_0x2d96ba,!![]);}else{this['imap']['end']();}};EmailImap['prototype'][_0xb74a('0x25')]=function(){this[_0xb74a('0x1')][_0xb74a('0x26')]([_0xb74a('0x27')],this[_0xb74a('0x28')][_0xb74a('0xc')](this));};EmailImap[_0xb74a('0x11')][_0xb74a('0x28')]=function(_0x4f8599,_0x223fc7){if(_0x4f8599){this[_0xb74a('0x10')](_0x4f8599,!![]);}else{if(_0x223fc7[_0xb74a('0x29')]){try{var _0x5d8ac1=this[_0xb74a('0x1')]['fetch'](_0x223fc7,{'bodies':'','markSeen':!![]});_0x5d8ac1['on'](_0xb74a('0x2a'),this[_0xb74a('0x2b')][_0xb74a('0xc')](this));_0x5d8ac1[_0xb74a('0xd')]('error',this[_0xb74a('0x2c')][_0xb74a('0xc')](this));_0x5d8ac1[_0xb74a('0xd')](_0xb74a('0xe'),this[_0xb74a('0x2d')]['bind'](this));}catch(_0x24ce23){logger[_0xb74a('0x2e')](_0x24ce23);}}else{this[_0xb74a('0x1')]['closeBox'](!![],this['handleCloseBox'][_0xb74a('0xc')](this));}}};EmailImap[_0xb74a('0x11')]['handleFetchMessage']=function(_0x5c90cb){_0x5c90cb['on'](_0xb74a('0x2f'),this[_0xb74a('0x30')][_0xb74a('0xc')](this));_0x5c90cb[_0xb74a('0xd')]('attributes',this['handleMessageAttributes'][_0xb74a('0xc')](this));_0x5c90cb[_0xb74a('0xd')](_0xb74a('0xe'),this[_0xb74a('0x31')][_0xb74a('0xc')](this));};EmailImap['prototype'][_0xb74a('0x30')]=function(_0x475302){simpleParser(_0x475302,{'Iconv':Iconv},this[_0xb74a('0x32')]['bind'](this));};EmailImap['prototype']['handleMessageAttributes']=function(){};EmailImap[_0xb74a('0x11')][_0xb74a('0x31')]=function(){};EmailImap[_0xb74a('0x11')][_0xb74a('0x32')]=function(_0x4346ba,_0x34ce1b){if(_0x4346ba){logger[_0xb74a('0x2e')](_0x4346ba);}else{var _0x1f5809=this;utils['parser'](this[_0xb74a('0x8')],_0x34ce1b,function(_0x4f2d32){_0x1f5809[_0xb74a('0x23')](_0xb74a('0x6'),_0x4f2d32);});}};EmailImap[_0xb74a('0x11')][_0xb74a('0x2d')]=function(){this[_0xb74a('0x1')][_0xb74a('0x33')](!![],this[_0xb74a('0x34')][_0xb74a('0xc')](this));};EmailImap[_0xb74a('0x11')][_0xb74a('0x2c')]=function(_0x5c129f){this[_0xb74a('0x10')](_0x5c129f);this['imap'][_0xb74a('0x33')](!![],this[_0xb74a('0x34')][_0xb74a('0xc')](this));};EmailImap[_0xb74a('0x11')][_0xb74a('0xf')]=function(){this[_0xb74a('0x23')](_0xb74a('0xe'));};EmailImap[_0xb74a('0x11')]['handleError']=function(_0x5da708,_0x5f4c4b){logger[_0xb74a('0x2e')](_0xb74a('0x10'),this[_0xb74a('0x8')]['email'],JSON['stringify'](_0x5da708));var _0x2e8e2e='';if(_0x5da708){if(_0x5da708[_0xb74a('0x35')]){_0x2e8e2e=_0x5da708[_0xb74a('0x35')];}else{for(var _0x34fa36 in _0x5da708){if(_0x5da708[_0xb74a('0x36')](_0x34fa36)){_0x2e8e2e+=_['upperFirst'](_0x34fa36)+':\x20'+_0x5da708[_0x34fa36]+'\x0a';}}}}if(_0x5f4c4b){this['imap']['end']();}else{this[_0xb74a('0x23')](_0xb74a('0x2e'),_0x2e8e2e);this['emit']('end');}};module[_0xb74a('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 da58b28..5cdfe40 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 _0xb970=['prototype','verify','Not\x20verifired','exports','nodemailer-plugin-inline-base64','send','createTransport','use','compile','sendMail','toString'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0xb970,0x12d));var _0x0b97=function(_0x3c2b2e,_0x3e6e53){_0x3c2b2e=_0x3c2b2e-0x0;var _0x27a338=_0xb970[_0x3c2b2e];return _0x27a338;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x0b97('0x0'));function EmailSmtp(){}EmailSmtp['prototype'][_0x0b97('0x1')]=function(_0x52459f,_0x42086f){return new Promise(function(_0x34eddb,_0x3e9781){var _0x3537e0=nodemailer[_0x0b97('0x2')](_0x52459f);_0x3537e0[_0x0b97('0x3')](_0x0b97('0x4'),inlineBase64());_0x3537e0[_0x0b97('0x5')](_0x42086f,function(_0x2049a4,_0x24b21d){if(_0x2049a4){_0x3e9781(_0x2049a4[_0x0b97('0x6')]());}else{_0x34eddb(_0x24b21d);}});});};EmailSmtp[_0x0b97('0x7')][_0x0b97('0x8')]=function(_0x5a63c8){return new Promise(function(_0x2c32ea,_0x71306a){var _0x14dd98=nodemailer[_0x0b97('0x2')](_0x5a63c8);_0x14dd98[_0x0b97('0x8')](function(_0xaeffd,_0x458b50){if(_0xaeffd){_0x71306a(_0xaeffd[_0x0b97('0x6')]());}else{if(_0x458b50){_0x2c32ea(_0x458b50);}else{_0x71306a(_0x0b97('0x9'));}}});});};module[_0x0b97('0xa')]=EmailSmtp; \ No newline at end of file +var _0xef16=['compile','sendMail','toString','verify','Not\x20verifired','nodemailer','nodemailer-plugin-inline-base64','prototype','createTransport','use'];(function(_0x30b0d8,_0x57470c){var _0x459c09=function(_0x5e51b6){while(--_0x5e51b6){_0x30b0d8['push'](_0x30b0d8['shift']());}};_0x459c09(++_0x57470c);}(_0xef16,0x1db));var _0x6ef1=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xef16[_0x618414];return _0x21c19a;};'use strict';var nodemailer=require(_0x6ef1('0x0'));var inlineBase64=require(_0x6ef1('0x1'));function EmailSmtp(){}EmailSmtp[_0x6ef1('0x2')]['send']=function(_0x4aa730,_0x18fe5e){return new Promise(function(_0x472a48,_0x38e4ed){var _0x5b6c36=nodemailer[_0x6ef1('0x3')](_0x4aa730);_0x5b6c36[_0x6ef1('0x4')](_0x6ef1('0x5'),inlineBase64());_0x5b6c36[_0x6ef1('0x6')](_0x18fe5e,function(_0x4f50c0,_0x242e09){if(_0x4f50c0){_0x38e4ed(_0x4f50c0[_0x6ef1('0x7')]());}else{_0x472a48(_0x242e09);}});});};EmailSmtp['prototype'][_0x6ef1('0x8')]=function(_0x190a28){return new Promise(function(_0x2c524b,_0xe4f240){var _0x26cc7b=nodemailer['createTransport'](_0x190a28);_0x26cc7b[_0x6ef1('0x8')](function(_0x4e46a7,_0x35405d){if(_0x4e46a7){_0xe4f240(_0x4e46a7[_0x6ef1('0x7')]());}else{if(_0x35405d){_0x2c524b(_0x35405d);}else{_0xe4f240(_0x6ef1('0x9'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index cff4c30..645e639 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 _0x63d3=['info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','content','

Empty\x20message

','Attachments','Data','generateXOAuth2Token','user=','auth=Bearer\x20','base64','lodash','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','value','address','generate','name','substring','indexOf','split','length','slice','join','Anonymous','head','pop','isEmpty','@xcally.com','html','test','includes','\x20[Attachment:\x20','\x20]','body','0x1?_0x3ef1ab[_0x363d('0x10')](0x0,-0x1)[_0x363d('0x11')]('\x20'):_0x76f9f2[_0x363d('0xb')];}return _0x363d('0x12');}function getLastName(_0x246c66){var _0xa2a9c6=_[_0x363d('0x13')](_0x246c66[_0x363d('0x8')]);if(_0xa2a9c6&&_0xa2a9c6['name']){var _0x2a6b71=_0xa2a9c6[_0x363d('0xb')]['split'](/\s+/);return _0x2a6b71[_0x363d('0xf')]>0x1?_0x2a6b71[_0x363d('0x14')]():'';}return'';}function getMails(_0x346333,_0x4d0a1b){var _0x31e89d='';for(var _0xce7098=0x0;_0xce7098<_0x4d0a1b['value'][_0x363d('0xf')];_0xce7098+=0x1){if(_0x4d0a1b[_0x363d('0x8')][_0xce7098][_0x363d('0x9')]!==_0x346333){if(!_[_0x363d('0x15')](_0x31e89d)){_0x31e89d+=',';}_0x31e89d+=_0x4d0a1b[_0x363d('0x8')][_0xce7098][_0x363d('0xb')]||_0x4d0a1b[_0x363d('0x8')][_0xce7098][_0x363d('0x9')]||'';_0x31e89d+='\x20<';_0x31e89d+=_0x4d0a1b[_0x363d('0x8')][_0xce7098][_0x363d('0x9')]?_0x4d0a1b['value'][_0xce7098][_0x363d('0x9')]:'anonymous'+random[_0x363d('0xa')](0x6)+_0x363d('0x16');_0x31e89d+='>';}}return _0x31e89d;}function parseEmail(_0x3692cb,_0x519b4b,_0x39098b){if(_0x519b4b[_0x363d('0x17')]){var _0x2f0a6=/)<[^<]*)*<\/script>/gi;while(_0x2f0a6[_0x363d('0x18')](_0x519b4b[_0x363d('0x17')])){_0x519b4b[_0x363d('0x17')]=_0x519b4b[_0x363d('0x17')]['replace'](_0x2f0a6,'');}if(_0x519b4b[_0x363d('0x17')][_0x363d('0x19')](_0x363d('0x1a'))){var _0x3edc17=[];_0x519b4b[_0x363d('0x1b')][_0x363d('0x1c')](_0x35382e=>{_0x3edc17[_0x363d('0x1d')](_0x35382e['filename']);});var _0x339693=/]+>/g;var _0x43acf7=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x1b925c=_0x519b4b['html'][_0x363d('0x1e')](_0x43acf7,_0x363d('0x1f'));var _0x4183b1=_0x1b925c[_0x363d('0x1e')](_0x339693,_0x363d('0x20'));for(let _0x413695=0x0;_0x413695<_0x3edc17[_0x363d('0xf')];_0x413695++){var _0x44326f=_0x4183b1[_0x363d('0x1e')](_0x363d('0x20'),_0x363d('0x21')+_0x3edc17[_0x413695]+_0x363d('0x22'));_0x4183b1=_0x44326f;}_0x519b4b[_0x363d('0x17')]=_0x4183b1;}_0x39098b['body']=_0x519b4b[_0x363d('0x17')];}else{_0x39098b['body']=_0x519b4b['textAsHtml'];}if(_0x39098b[_0x363d('0x23')]){_0x39098b[_0x363d('0x23')]=_0x39098b[_0x363d('0x23')]['replace'](/0x0){var _0x1bc314=['Auto-Submitted:\x20auto-replied',_0x363d('0x2f'),_0x363d('0x30')];for(var _0xb5dbc5=0x0;_0xb5dbc5<_0x519b4b[_0x363d('0x31')][_0x363d('0xf')];_0xb5dbc5++){var _0x166144=_['indexOf'](_0x1bc314,_0x519b4b[_0x363d('0x31')][_0xb5dbc5]['line']);if(_0x166144>=0x0){_0x39098b[_0x363d('0x32')]=!![];}}}return _0x39098b;}exports[_0x363d('0x33')]=function(_0xd72400,_0x3dbbf0,_0x377fa9){var _0x2cb047={'from':getAddress(_0x3dbbf0[_0x363d('0x34')]),'firstName':getFirstName(_0x3dbbf0[_0x363d('0x34')]),'lastName':getLastName(_0x3dbbf0[_0x363d('0x34')]),'mapKey':_0x363d('0x6'),'message':{'from':getMails(_0xd72400['email'],_0x3dbbf0['from']),'to':_0xd72400[_0x363d('0x6')],'cc':'','subject':_0x3dbbf0[_0x363d('0x35')]||'','messageId':_0x3dbbf0[_0x363d('0x36')],'inReplyTo':_0x3dbbf0['inReplyTo'],'sentAt':moment(_0x3dbbf0[_0x363d('0x37')])[_0x363d('0x38')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x3dbbf0[_0x363d('0x17')]&&!_0x3dbbf0[_0x363d('0x39')]){var _0x8a8623=_[_0x363d('0x3a')](_0x3dbbf0[_0x363d('0x1b')],{'contentType':'application/ms-tnef'});if(_0x8a8623[_0x363d('0xf')]){logger[_0x363d('0x3b')](util[_0x363d('0x38')](_0x363d('0x3c'),_0x3dbbf0[_0x363d('0x36')]));tnef[_0x363d('0x3d')](_[_0x363d('0x3e')](_0x8a8623)[_0x363d('0x3f')],function(_0x41035c,_0x109b18){if(_0x109b18){_0x3dbbf0[_0x363d('0x17')]=_0x109b18['BodyHTML']||_0x363d('0x40');if(_0x109b18[_0x363d('0x41')]){for(var _0x52ed4a=0x0;_0x52ed4a<_0x109b18[_0x363d('0x41')][_0x363d('0xf')];_0x52ed4a++){var _0x2b1860=_0x109b18[_0x363d('0x41')][_0x52ed4a];_0x2cb047[_0x363d('0x25')][_0x363d('0x1b')][_0x363d('0x1d')]({'filename':_0x2b1860['Title'],'content':Buffer['from'](_0x2b1860[_0x363d('0x42')])});}}}_0x377fa9(parseEmail(_0xd72400,_0x3dbbf0,_0x2cb047));});}else{_0x3dbbf0[_0x363d('0x17')]=_0x363d('0x40');_0x377fa9(parseEmail(_0xd72400,_0x3dbbf0,_0x2cb047));}}else{_0x377fa9(parseEmail(_0xd72400,_0x3dbbf0,_0x2cb047));}};exports[_0x363d('0x43')]=function(_0x34d4cc,_0x101554){var _0x303c8f=[_0x363d('0x44')+(_0x101554||''),_0x363d('0x45')+_0x34d4cc,'',''];return Buffer[_0x363d('0x34')](_0x303c8f[_0x363d('0x11')](''),'utf-8')['toString'](_0x363d('0x46'));}; \ No newline at end of file +var _0x4932=['messageId','parseBuffer','first','content','BodyHTML','

Empty\x20message

','Title','Data','generateXOAuth2Token','user=','utf-8','toString','base64','path','../../../config/logger','email','value','address','anonymous','@xcally.com','head','substring','name','split','length','join','pop','generate','html','test','replace','\x20[Attachment:\x20','\x20]','body','0x1?_0x5a3363['slice'](0x0,-0x1)[_0x2493('0xc')]('\x20'):_0x299c03['name'];}return'Anonymous';}function getLastName(_0x2ad8fd){var _0xf16478=_['head'](_0x2ad8fd['value']);if(_0xf16478&&_0xf16478[_0x2493('0x9')]){var _0x4791a6=_0xf16478[_0x2493('0x9')][_0x2493('0xa')](/\s+/);return _0x4791a6[_0x2493('0xb')]>0x1?_0x4791a6[_0x2493('0xd')]():'';}return'';}function getMails(_0x58aa89,_0x231899){var _0x3e372f='';for(var _0x5349ff=0x0;_0x5349ff<_0x231899[_0x2493('0x3')][_0x2493('0xb')];_0x5349ff+=0x1){if(_0x231899[_0x2493('0x3')][_0x5349ff][_0x2493('0x4')]!==_0x58aa89){if(!_['isEmpty'](_0x3e372f)){_0x3e372f+=',';}_0x3e372f+=_0x231899[_0x2493('0x3')][_0x5349ff][_0x2493('0x9')]||_0x231899[_0x2493('0x3')][_0x5349ff][_0x2493('0x4')]||'';_0x3e372f+='\x20<';_0x3e372f+=_0x231899[_0x2493('0x3')][_0x5349ff][_0x2493('0x4')]?_0x231899[_0x2493('0x3')][_0x5349ff][_0x2493('0x4')]:_0x2493('0x5')+random[_0x2493('0xe')](0x6)+_0x2493('0x6');_0x3e372f+='>';}}return _0x3e372f;}function parseEmail(_0x397a84,_0x3a0127,_0x5a2bad){if(_0x3a0127[_0x2493('0xf')]){var _0x509432=/)<[^<]*)*<\/script>/gi;while(_0x509432[_0x2493('0x10')](_0x3a0127[_0x2493('0xf')])){_0x3a0127[_0x2493('0xf')]=_0x3a0127['html'][_0x2493('0x11')](_0x509432,'');}if(_0x3a0127[_0x2493('0xf')]['includes'](_0x2493('0x12'))){var _0x40b08b=[];_0x3a0127[_0x2493('0x13')]['forEach'](_0x318989=>{_0x40b08b[_0x2493('0x14')](_0x318989['filename']);});var _0x59c192=/]+>/g;var _0x11a89b=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x7f3c43=_0x3a0127[_0x2493('0xf')][_0x2493('0x11')](_0x11a89b,'_SRC');var _0x5cbfeb=_0x7f3c43[_0x2493('0x11')](_0x59c192,_0x2493('0x15'));for(let _0x36cfb8=0x0;_0x36cfb8<_0x40b08b[_0x2493('0xb')];_0x36cfb8++){var _0x591bdf=_0x5cbfeb['replace'](_0x2493('0x15'),_0x2493('0x16')+_0x40b08b[_0x36cfb8]+_0x2493('0x17'));_0x5cbfeb=_0x591bdf;}_0x3a0127['html']=_0x5cbfeb;}_0x5a2bad[_0x2493('0x18')]=_0x3a0127[_0x2493('0xf')];}else{_0x5a2bad[_0x2493('0x18')]=_0x3a0127['textAsHtml'];}if(_0x5a2bad['body']){_0x5a2bad['body']=_0x5a2bad[_0x2493('0x18')]['replace'](/0x0){var _0x1a31bb=[_0x2493('0x29'),'X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply'];for(var _0x310333=0x0;_0x310333<_0x3a0127[_0x2493('0x28')][_0x2493('0xb')];_0x310333++){var _0x6dda96=_['indexOf'](_0x1a31bb,_0x3a0127['headerLines'][_0x310333][_0x2493('0x2a')]);if(_0x6dda96>=0x0){_0x5a2bad[_0x2493('0x2b')]=!![];}}}return _0x5a2bad;}exports[_0x2493('0x2c')]=function(_0x4fa822,_0x13517b,_0x4cdd00){var _0x390c10={'from':getAddress(_0x13517b[_0x2493('0x2d')]),'firstName':getFirstName(_0x13517b[_0x2493('0x2d')]),'lastName':getLastName(_0x13517b[_0x2493('0x2d')]),'mapKey':_0x2493('0x2'),'message':{'from':getMails(_0x4fa822[_0x2493('0x2')],_0x13517b[_0x2493('0x2d')]),'to':_0x4fa822[_0x2493('0x2')],'cc':'','subject':_0x13517b[_0x2493('0x2e')]||'','messageId':_0x13517b['messageId'],'inReplyTo':_0x13517b[_0x2493('0x2f')],'sentAt':moment(_0x13517b[_0x2493('0x30')])[_0x2493('0x22')](_0x2493('0x31')),'attach':![],'attachments':[]}};if(!_0x13517b[_0x2493('0xf')]&&!_0x13517b[_0x2493('0x32')]){var _0x22527f=_[_0x2493('0x33')](_0x13517b['attachments'],{'contentType':_0x2493('0x34')});if(_0x22527f['length']){logger['info'](util[_0x2493('0x22')](_0x2493('0x35'),_0x13517b[_0x2493('0x36')]));tnef[_0x2493('0x37')](_[_0x2493('0x38')](_0x22527f)[_0x2493('0x39')],function(_0x197a9b,_0x359bcc){if(_0x359bcc){_0x13517b[_0x2493('0xf')]=_0x359bcc[_0x2493('0x3a')]||_0x2493('0x3b');if(_0x359bcc['Attachments']){for(var _0x81522e=0x0;_0x81522e<_0x359bcc['Attachments']['length'];_0x81522e++){var _0x316440=_0x359bcc['Attachments'][_0x81522e];_0x390c10[_0x2493('0x1b')][_0x2493('0x13')][_0x2493('0x14')]({'filename':_0x316440[_0x2493('0x3c')],'content':Buffer[_0x2493('0x2d')](_0x316440[_0x2493('0x3d')])});}}}_0x4cdd00(parseEmail(_0x4fa822,_0x13517b,_0x390c10));});}else{_0x13517b['html']='

Empty\x20message

';_0x4cdd00(parseEmail(_0x4fa822,_0x13517b,_0x390c10));}}else{_0x4cdd00(parseEmail(_0x4fa822,_0x13517b,_0x390c10));}};exports[_0x2493('0x3e')]=function(_0x3a69c4,_0x5e23d8){var _0x44280a=[_0x2493('0x3f')+(_0x5e23d8||''),'auth=Bearer\x20'+_0x3a69c4,'',''];return Buffer[_0x2493('0x2d')](_0x44280a[_0x2493('0xc')](''),_0x2493('0x40'))[_0x2493('0x41')](_0x2493('0x42'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index c528a89..61e6f15 100644 --- a/server/services/email/model/mailAccount.js +++ b/server/services/email/model/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c14=['SERV','active','Imap','exports','name','Service','key'];(function(_0x37a15e,_0x3d833b){var _0x160f3b=function(_0x13fbc5){while(--_0x13fbc5){_0x37a15e['push'](_0x37a15e['shift']());}};_0x160f3b(++_0x3d833b);}(_0x1c14,0x170));var _0x41c1=function(_0x4334c3,_0x4370f3){_0x4334c3=_0x4334c3-0x0;var _0xdff411=_0x1c14[_0x4334c3];return _0xdff411;};'use strict';var _=require('lodash');function MailAccount(_0x55bdeb){this['id']=_0x55bdeb['id']||0x0;this[_0x41c1('0x0')]=_0x55bdeb['name']||_0x41c1('0x1');this[_0x41c1('0x2')]=_0x55bdeb[_0x41c1('0x2')]||_0x41c1('0x3');this[_0x41c1('0x4')]=_0x55bdeb[_0x41c1('0x4')]||![];this[_0x41c1('0x5')]=_0x55bdeb[_0x41c1('0x5')]||[];this['Smtp']=_0x55bdeb['Smtp']||[];}module[_0x41c1('0x6')]=MailAccount; \ No newline at end of file +var _0xf937=['lodash','name','Service','key','SERV','active','Imap','Smtp','exports'];(function(_0x4b55c9,_0x39b284){var _0x31b51c=function(_0x1a105a){while(--_0x1a105a){_0x4b55c9['push'](_0x4b55c9['shift']());}};_0x31b51c(++_0x39b284);}(_0xf937,0xbd));var _0x7f93=function(_0x141e03,_0x18340e){_0x141e03=_0x141e03-0x0;var _0x2074e3=_0xf937[_0x141e03];return _0x2074e3;};'use strict';var _=require(_0x7f93('0x0'));function MailAccount(_0x345daf){this['id']=_0x345daf['id']||0x0;this[_0x7f93('0x1')]=_0x345daf[_0x7f93('0x1')]||_0x7f93('0x2');this[_0x7f93('0x3')]=_0x345daf['key']||_0x7f93('0x4');this['active']=_0x345daf[_0x7f93('0x5')]||![];this[_0x7f93('0x6')]=_0x345daf[_0x7f93('0x6')]||[];this[_0x7f93('0x7')]=_0x345daf[_0x7f93('0x7')]||[];}module[_0x7f93('0x8')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 1e530b1..0179413 100644 --- a/server/services/email/realtime/index.js +++ b/server/services/email/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5165=['exports','lodash','../model/mailAccount','mapKeys','prototype','mergeFromDatabase','hasOwnProperty','mailAccounts','length','merge'];(function(_0x4bd034,_0x1179d2){var _0x2ed9ac=function(_0x456aba){while(--_0x456aba){_0x4bd034['push'](_0x4bd034['shift']());}};_0x2ed9ac(++_0x1179d2);}(_0x5165,0x1d7));var _0x5516=function(_0x3a110e,_0x32ea40){_0x3a110e=_0x3a110e-0x0;var _0x420255=_0x5165[_0x3a110e];return _0x420255;};'use strict';var _=require(_0x5516('0x0'));var MailAccount=require(_0x5516('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0xad5895,_0x5c5177,_0x459356){var _0x259583=_[_0x5516('0x2')](_0xad5895,function(_0x4066a5,_0x2de0e7){return _0x4066a5[_0x459356];});for(var _0xd18606 in _0x5c5177){if(_0x5c5177['hasOwnProperty'](_0xd18606)){if(!_0x259583[_0xd18606]){delete _0x5c5177[_0xd18606];}}}}Realtime[_0x5516('0x3')][_0x5516('0x4')]=function(_0x279e4b,_0x300cba){for(var _0xc2ed90 in _0x300cba){if(_0x279e4b[_0x5516('0x5')](_0xc2ed90)){_0x279e4b[_0xc2ed90]=_0x300cba[_0xc2ed90];}}};Realtime['prototype']['initMailAccounts']=function(){var _0x173b1b=this;return function(_0x5c7086){if(_0x5c7086){freeIsNotKey(_0x5c7086,_0x173b1b[_0x5516('0x6')],'id');for(var _0x584321=0x0,_0x50771f={},_0x4a8c3e={};_0x584321<_0x5c7086[_0x5516('0x7')];_0x584321+=0x1){_0x50771f=_0x5c7086[_0x584321];if(_['isUndefined'](_0x173b1b[_0x5516('0x6')][_0x50771f['id']])){_0x173b1b[_0x5516('0x6')][_0x50771f['id']]=new MailAccount(_0x50771f);}else{_[_0x5516('0x8')](_0x173b1b[_0x5516('0x6')][_0x50771f['id']],_0x50771f);}}}return _0x173b1b[_0x5516('0x6')];};};module[_0x5516('0x9')]=Realtime; \ No newline at end of file +var _0xdd9f=['length','mailAccounts','lodash','../model/mailAccount','mapKeys','mergeFromDatabase','hasOwnProperty','prototype'];(function(_0x13eb45,_0x181604){var _0x32c8f5=function(_0x3a7519){while(--_0x3a7519){_0x13eb45['push'](_0x13eb45['shift']());}};_0x32c8f5(++_0x181604);}(_0xdd9f,0x8a));var _0xfdd9=function(_0x2c7b86,_0x59ef3c){_0x2c7b86=_0x2c7b86-0x0;var _0x256735=_0xdd9f[_0x2c7b86];return _0x256735;};'use strict';var _=require(_0xfdd9('0x0'));var MailAccount=require(_0xfdd9('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0xc27e24,_0x1d8322,_0x297ae4){var _0x3ca6a0=_[_0xfdd9('0x2')](_0xc27e24,function(_0x524aea,_0xefd835){return _0x524aea[_0x297ae4];});for(var _0xd73b97 in _0x1d8322){if(_0x1d8322['hasOwnProperty'](_0xd73b97)){if(!_0x3ca6a0[_0xd73b97]){delete _0x1d8322[_0xd73b97];}}}}Realtime['prototype'][_0xfdd9('0x3')]=function(_0x59a38e,_0x23932c){for(var _0xdc49eb in _0x23932c){if(_0x59a38e[_0xfdd9('0x4')](_0xdc49eb)){_0x59a38e[_0xdc49eb]=_0x23932c[_0xdc49eb];}}};Realtime[_0xfdd9('0x5')]['initMailAccounts']=function(){var _0x2dbfad=this;return function(_0x2c642a){if(_0x2c642a){freeIsNotKey(_0x2c642a,_0x2dbfad['mailAccounts'],'id');for(var _0x29a907=0x0,_0x4247a8={},_0x3533cf={};_0x29a907<_0x2c642a[_0xfdd9('0x6')];_0x29a907+=0x1){_0x4247a8=_0x2c642a[_0x29a907];if(_['isUndefined'](_0x2dbfad[_0xfdd9('0x7')][_0x4247a8['id']])){_0x2dbfad['mailAccounts'][_0x4247a8['id']]=new MailAccount(_0x4247a8);}else{_['merge'](_0x2dbfad[_0xfdd9('0x7')][_0x4247a8['id']],_0x4247a8);}}}return _0x2dbfad[_0xfdd9('0x7')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index f4416a9..a9e177a 100644 --- a/server/services/email/rpc/mailAccount.js +++ b/server/services/email/rpc/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x598a=['getMailAccounts','Request','GetMailAccount','name','service','ListId','TemplateId','MailServerIn','Imap','CloudProvider','type','data5','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount','../client'];(function(_0x38870a,_0x537c99){var _0x828eec=function(_0x5386d4){while(--_0x5386d4){_0x38870a['push'](_0x38870a['shift']());}};_0x828eec(++_0x537c99);}(_0x598a,0xfb));var _0xa598=function(_0x522f45,_0x596c16){_0x522f45=_0x522f45-0x0;var _0x140541=_0x598a[_0x522f45];return _0x140541;};'use strict';var client=require(_0xa598('0x0'));exports[_0xa598('0x1')]=function(){return function(){return client[_0xa598('0x2')](_0xa598('0x3'),{'options':{'attributes':['id',_0xa598('0x4'),'provider',_0xa598('0x5'),'email','active','key',_0xa598('0x6'),_0xa598('0x7')],'raw':![],'include':[{'model':_0xa598('0x8'),'as':_0xa598('0x9'),'include':[{'model':_0xa598('0xa'),'attributes':['id','name','service',_0xa598('0xb'),_0xa598('0xc')],'as':_0xa598('0xa')}]},{'model':_0xa598('0xd'),'as':_0xa598('0xe'),'include':[{'model':_0xa598('0xa'),'attributes':['id','name','service',_0xa598('0xb'),_0xa598('0xc')],'as':_0xa598('0xa')}]}]},'log':_0xa598('0xf')});};};exports[_0xa598('0x10')]=function(_0x4fb7c0,_0x186240){return client[_0xa598('0x2')](_0xa598('0x11'),{'account':{'id':_0x4fb7c0},'body':_0x186240,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0xcaaf=['type','Smtp','data5','getMailAccount','notify','NotifyMailAccount','../client','Request','provider','service','active','TemplateId','MailServerIn','Imap','CloudProvider','name'];(function(_0x420b24,_0x382adc){var _0x4da552=function(_0x4e1623){while(--_0x4e1623){_0x420b24['push'](_0x420b24['shift']());}};_0x4da552(++_0x382adc);}(_0xcaaf,0x66));var _0xfcaa=function(_0x881e07,_0x2e0719){_0x881e07=_0x881e07-0x0;var _0x4035ba=_0xcaaf[_0x881e07];return _0x4035ba;};'use strict';var client=require(_0xfcaa('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0xfcaa('0x1')]('GetMailAccount',{'options':{'attributes':['id','name',_0xfcaa('0x2'),_0xfcaa('0x3'),'email',_0xfcaa('0x4'),'key','ListId',_0xfcaa('0x5')],'raw':![],'include':[{'model':_0xfcaa('0x6'),'as':_0xfcaa('0x7'),'include':[{'model':_0xfcaa('0x8'),'attributes':['id',_0xfcaa('0x9'),_0xfcaa('0x3'),_0xfcaa('0xa'),'data5'],'as':_0xfcaa('0x8')}]},{'model':'MailServerOut','as':_0xfcaa('0xb'),'include':[{'model':'CloudProvider','attributes':['id',_0xfcaa('0x9'),'service','type',_0xfcaa('0xc')],'as':'CloudProvider'}]}]},'log':_0xfcaa('0xd')});};};exports[_0xfcaa('0xe')]=function(_0xb7b580,_0x34448e){return client[_0xfcaa('0x1')](_0xfcaa('0xf'),{'account':{'id':_0xb7b580},'body':_0x34448e,'log':_0xfcaa('0xf')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index c5e90b9..a83930a 100644 --- a/server/services/email/rpc/setting.js +++ b/server/services/email/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6ae4=['../client','getSettings','Request','ShowSetting','loginMailFrequency','GetSettings'];(function(_0x9fd6da,_0x1b76a1){var _0x45daed=function(_0x465e93){while(--_0x465e93){_0x9fd6da['push'](_0x9fd6da['shift']());}};_0x45daed(++_0x1b76a1);}(_0x6ae4,0x1c2));var _0x46ae=function(_0x370845,_0x435370){_0x370845=_0x370845-0x0;var _0x7cd1af=_0x6ae4[_0x370845];return _0x7cd1af;};'use strict';var client=require(_0x46ae('0x0'));exports[_0x46ae('0x1')]=function(){return client[_0x46ae('0x2')](_0x46ae('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x46ae('0x4')]},'log':_0x46ae('0x5')});}; \ No newline at end of file +var _0x2ec1=['loginMailFrequency','GetSettings','Request','ShowSetting'];(function(_0x4cdb3c,_0x17b584){var _0x500916=function(_0x23f043){while(--_0x23f043){_0x4cdb3c['push'](_0x4cdb3c['shift']());}};_0x500916(++_0x17b584);}(_0x2ec1,0xce));var _0x12ec=function(_0x2cf702,_0x333323){_0x2cf702=_0x2cf702-0x0;var _0x15f7a6=_0x2ec1[_0x2cf702];return _0x15f7a6;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0x12ec('0x0')](_0x12ec('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x12ec('0x2')]},'log':_0x12ec('0x3')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 7ba9f1a..e8e998a 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file diff --git a/server/services/express/index.js b/server/services/express/index.js index f93487c..30fb581 100644 --- a/server/services/express/index.js +++ b/server/services/express/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x400f=['exports','lodash','http','express','sticky-session','../../config/environment','createServer','timeout','listen','port','socket.io','polling','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','../../config/socketio','default','../../config/express','../../routes','once','log','Express\x20server\x20listening\x20on\x20port\x20%d!'];(function(_0x43645f,_0x656278){var _0x36f9ab=function(_0x20f6ec){while(--_0x20f6ec){_0x43645f['push'](_0x43645f['shift']());}};_0x36f9ab(++_0x656278);}(_0x400f,0xfb));var _0xf400=function(_0x5c3810,_0x316733){_0x5c3810=_0x5c3810-0x0;var _0x2126d9=_0x400f[_0x5c3810];return _0x2126d9;};'use strict';var _=require(_0xf400('0x0'));var http=require(_0xf400('0x1'));var express=require(_0xf400('0x2'));var sticky=require(_0xf400('0x3'));var Redis=require('ioredis');var config=require(_0xf400('0x4'));var app=express();var server=http[_0xf400('0x5')](app);server[_0xf400('0x6')]=0xdbba0;if(sticky[_0xf400('0x7')](server,config[_0xf400('0x8')])){var socketio=require(_0xf400('0x9'))(server,{'transports':['websocket',_0xf400('0xa')]});config[_0xf400('0xb')]=_[_0xf400('0xc')](config[_0xf400('0xb')],{'host':_0xf400('0xd'),'port':0x18eb});socketio[_0xf400('0xe')](require(_0xf400('0xf'))({'pubClient':new Redis(config[_0xf400('0xb')]),'subClient':new Redis(config[_0xf400('0xb')])}));require(_0xf400('0x10'))['default']();require(_0xf400('0x11'))[_0xf400('0x12')](socketio);require(_0xf400('0x13'))[_0xf400('0x12')](app);require(_0xf400('0x14'))[_0xf400('0x12')](app);}else{server[_0xf400('0x15')]('listening',function(){console[_0xf400('0x16')](_0xf400('0x17'),config[_0xf400('0x8')]);});}exports=module[_0xf400('0x18')]=app; \ No newline at end of file +var _0x5cd8=['exports','express','sticky-session','ioredis','../../config/environment','socket.io','websocket','polling','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','port'];(function(_0x919445,_0x5467dc){var _0x511b3e=function(_0xde10f3){while(--_0xde10f3){_0x919445['push'](_0x919445['shift']());}};_0x511b3e(++_0x5467dc);}(_0x5cd8,0x151));var _0x85cd=function(_0x3ba6ce,_0x34407a){_0x3ba6ce=_0x3ba6ce-0x0;var _0x3d4a57=_0x5cd8[_0x3ba6ce];return _0x3d4a57;};'use strict';var _=require('lodash');var http=require('http');var express=require(_0x85cd('0x0'));var sticky=require(_0x85cd('0x1'));var Redis=require(_0x85cd('0x2'));var config=require(_0x85cd('0x3'));var app=express();var server=http['createServer'](app);server['timeout']=0xdbba0;if(sticky['listen'](server,config['port'])){var socketio=require(_0x85cd('0x4'))(server,{'transports':[_0x85cd('0x5'),_0x85cd('0x6')]});config[_0x85cd('0x7')]=_[_0x85cd('0x8')](config[_0x85cd('0x7')],{'host':_0x85cd('0x9'),'port':0x18eb});socketio[_0x85cd('0xa')](require(_0x85cd('0xb'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x85cd('0x7')])}));require(_0x85cd('0xc'))[_0x85cd('0xd')]();require(_0x85cd('0xe'))[_0x85cd('0xd')](socketio);require(_0x85cd('0xf'))[_0x85cd('0xd')](app);require(_0x85cd('0x10'))[_0x85cd('0xd')](app);}else{server[_0x85cd('0x11')](_0x85cd('0x12'),function(){console['log']('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x85cd('0x13')]);});}exports=module[_0x85cd('0x14')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index b1305b7..de4c2f4 100644 --- a/server/services/routing/client.js +++ b/server/services/routing/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9e6b=['catch','exports','bluebird','../../config/logger','routing','client','request','debug','rpc','error','message','result'];(function(_0x2f86cb,_0x16f405){var _0x47a688=function(_0x4b5a1){while(--_0x4b5a1){_0x2f86cb['push'](_0x2f86cb['shift']());}};_0x47a688(++_0x16f405);}(_0x9e6b,0x92));var _0xb9e6=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x9e6b[_0x42cae2];return _0x5f256f;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xb9e6('0x0'));var logger=require(_0xb9e6('0x1'))(_0xb9e6('0x2'));var client=jayson[_0xb9e6('0x3')]['http']({'port':0x2329});client['Request']=function(_0x3848f9,_0x3b70f4){return new BPromise(function(_0x1597f7,_0x1aff93){return client[_0xb9e6('0x4')](_0x3848f9,_0x3b70f4)['then'](function(_0x39727c){logger[_0xb9e6('0x5')](_0xb9e6('0x6'),_0xb9e6('0x2'),_0x3848f9,_0x3b70f4,_0x39727c);if(_0x39727c[_0xb9e6('0x7')]){logger[_0xb9e6('0x7')]('rpc','routing',_0x3848f9,_0x39727c['error'][_0xb9e6('0x8')],_0x3b70f4);return _0x1aff93(_0x39727c['error'][_0xb9e6('0x8')]);}else{return _0x1597f7(_0x39727c[_0xb9e6('0x9')]);}})[_0xb9e6('0xa')](function(_0x5bcc2c){logger[_0xb9e6('0x7')](_0xb9e6('0x6'),_0xb9e6('0x2'),_0x3848f9,_0x5bcc2c,_0x3b70f4);return _0x1aff93(_0x5bcc2c);});});};module[_0xb9e6('0xb')]=client; \ No newline at end of file +var _0x7993=['result','exports','jayson/promise','bluebird','../../config/logger','routing','client','request','debug','error','rpc','message'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7993,0x12e));var _0x3799=function(_0x34f72b,_0x13913a){_0x34f72b=_0x34f72b-0x0;var _0x3b5482=_0x7993[_0x34f72b];return _0x3b5482;};'use strict';var jayson=require(_0x3799('0x0'));var BPromise=require(_0x3799('0x1'));var logger=require(_0x3799('0x2'))(_0x3799('0x3'));var client=jayson[_0x3799('0x4')]['http']({'port':0x2329});client['Request']=function(_0x532102,_0x31bb61){return new BPromise(function(_0x3bd30e,_0x428e9e){return client[_0x3799('0x5')](_0x532102,_0x31bb61)['then'](function(_0x4ea5bf){logger[_0x3799('0x6')]('rpc',_0x3799('0x3'),_0x532102,_0x31bb61,_0x4ea5bf);if(_0x4ea5bf[_0x3799('0x7')]){logger['error'](_0x3799('0x8'),_0x3799('0x3'),_0x532102,_0x4ea5bf[_0x3799('0x7')][_0x3799('0x9')],_0x31bb61);return _0x428e9e(_0x4ea5bf[_0x3799('0x7')][_0x3799('0x9')]);}else{return _0x3bd30e(_0x4ea5bf[_0x3799('0xa')]);}})['catch'](function(_0x1b1d98){logger[_0x3799('0x7')](_0x3799('0x8'),_0x3799('0x3'),_0x532102,_0x1b1d98,_0x31bb61);return _0x428e9e(_0x1b1d98);});});};module[_0x3799('0xb')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index dd4a691..9f25b04 100644 --- a/server/services/routing/index.js +++ b/server/services/routing/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1709=['./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','then','getAgents','initAgents','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue'];(function(_0xb570a4,_0x19b43a){var _0x41c8fc=function(_0x3d4e85){while(--_0x3d4e85){_0xb570a4['push'](_0xb570a4['shift']());}};_0x41c8fc(++_0x19b43a);}(_0x1709,0x1b4));var _0x9170=function(_0x35de68,_0x165ef8){_0x35de68=_0x35de68-0x0;var _0xf70815=_0x1709[_0x35de68];return _0xf70815;};'use strict';var BPromise=require(_0x9170('0x0'));var server=require(_0x9170('0x1'));var Realtime=require('./realtime');var user=require(_0x9170('0x2'));var interval=require(_0x9170('0x3'));var openchannelQueue=require(_0x9170('0x4'));var chatQueue=require(_0x9170('0x5'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x9170('0x6'));var faxQueue=require(_0x9170('0x7'));var whatsappQueue=require(_0x9170('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x9170('0x9')](user[_0x9170('0xa')]())['then'](realtime[_0x9170('0xb')]())[_0x9170('0x9')](interval['getIntervals']())[_0x9170('0x9')](realtime[_0x9170('0xc')]())[_0x9170('0x9')](openchannelQueue[_0x9170('0xd')]())[_0x9170('0x9')](realtime[_0x9170('0xe')]())[_0x9170('0x9')](chatQueue[_0x9170('0xf')]())[_0x9170('0x9')](realtime[_0x9170('0x10')]())[_0x9170('0x9')](smsQueue['getSmsQueues']())[_0x9170('0x9')](realtime[_0x9170('0x11')]())[_0x9170('0x9')](mailQueue[_0x9170('0x12')]())[_0x9170('0x9')](realtime[_0x9170('0x13')]())[_0x9170('0x9')](faxQueue[_0x9170('0x14')]())[_0x9170('0x9')](realtime[_0x9170('0x15')]())['then'](whatsappQueue['getWhatsappQueues']())['then'](realtime[_0x9170('0x16')]())['then'](function(){return realtime;});}function main(){return server[_0x9170('0x17')](realtime)[_0x9170('0x9')](function(_0x142c26){return initRealtime();})['then'](function(_0x56bcd1){return setInterval(initRealtime,0x1388);})[_0x9170('0x18')](function(_0xea1a87){console[_0x9170('0x19')](_0xea1a87);});}main(); \ No newline at end of file +var _0xa57d=['initSmsQueues','getMailQueues','initMailQueues','getWhatsappQueues','initWhatsappQueues','listen','log','bluebird','./realtime','./rpc/user','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues'];(function(_0x1e6c2a,_0x569ae7){var _0x25228e=function(_0x39ea60){while(--_0x39ea60){_0x1e6c2a['push'](_0x1e6c2a['shift']());}};_0x25228e(++_0x569ae7);}(_0xa57d,0x14b));var _0xda57=function(_0x196257,_0x256195){_0x196257=_0x196257-0x0;var _0x30d5c7=_0xa57d[_0x196257];return _0x30d5c7;};'use strict';var BPromise=require(_0xda57('0x0'));var server=require('./server');var Realtime=require(_0xda57('0x1'));var user=require(_0xda57('0x2'));var interval=require('./rpc/interval');var openchannelQueue=require(_0xda57('0x3'));var chatQueue=require(_0xda57('0x4'));var smsQueue=require(_0xda57('0x5'));var mailQueue=require(_0xda57('0x6'));var faxQueue=require(_0xda57('0x7'));var whatsappQueue=require(_0xda57('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xda57('0x9')]()[_0xda57('0xa')](user[_0xda57('0xb')]())[_0xda57('0xa')](realtime[_0xda57('0xc')]())[_0xda57('0xa')](interval[_0xda57('0xd')]())[_0xda57('0xa')](realtime[_0xda57('0xe')]())['then'](openchannelQueue[_0xda57('0xf')]())[_0xda57('0xa')](realtime[_0xda57('0x10')]())['then'](chatQueue[_0xda57('0x11')]())[_0xda57('0xa')](realtime[_0xda57('0x12')]())[_0xda57('0xa')](smsQueue[_0xda57('0x13')]())[_0xda57('0xa')](realtime[_0xda57('0x14')]())['then'](mailQueue[_0xda57('0x15')]())[_0xda57('0xa')](realtime[_0xda57('0x16')]())[_0xda57('0xa')](faxQueue['getFaxQueues']())[_0xda57('0xa')](realtime['initFaxQueues']())['then'](whatsappQueue[_0xda57('0x17')]())['then'](realtime[_0xda57('0x18')]())['then'](function(){return realtime;});}function main(){return server[_0xda57('0x19')](realtime)[_0xda57('0xa')](function(_0x50a187){return initRealtime();})[_0xda57('0xa')](function(_0x3e738b){return setInterval(initRealtime,0x1388);})['catch'](function(_0x5692ab){console[_0xda57('0x1a')](_0x5692ab);});}main(); \ No newline at end of file diff --git a/server/services/routing/lib/rule-engine.js b/server/services/routing/lib/rule-engine.js index 24cc012..7361190 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['turn','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','exports','lodash','util','events','isNil','register','ignoreFactChanges','inherits','init','rules','activeRules','concat','prototype','sync','filter','orderBy','asc','execute','clone','consequence','ruleRef','name','index_','nextTick','push','call','isEqual','restart','length','condition','matchPath','noop','findRules'];(function(_0x1652c7,_0x400405){var _0x4e13ac=function(_0xac055e){while(--_0xac055e){_0x1652c7['push'](_0x1652c7['shift']());}};_0x4e13ac(++_0x400405);}(_0x7a54,0x106));var _0x47a5=function(_0x1c9d8e,_0x3e309a){_0x1c9d8e=_0x1c9d8e-0x0;var _0x307add=_0x7a54[_0x1c9d8e];return _0x307add;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var EventEmitter=require(_0x47a5('0x2'))['EventEmitter'];function RuleEngine(_0x1d33e,_0x4086cd){this['init']();if(!_[_0x47a5('0x3')](_0x1d33e)){this[_0x47a5('0x4')](_0x1d33e);}if(_0x4086cd){this[_0x47a5('0x5')]=_0x4086cd[_0x47a5('0x5')];}return this;}util[_0x47a5('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x47a5('0x7')]=function(_0x59199c){this[_0x47a5('0x8')]=[];this[_0x47a5('0x9')]=[];};RuleEngine['prototype'][_0x47a5('0x4')]=function(_0x5077f3){if(Array['isArray'](_0x5077f3)){this['rules']=this[_0x47a5('0x8')][_0x47a5('0xa')](_0x5077f3);}else if(_0x5077f3!==null&&_['isObject'](_0x5077f3)){this[_0x47a5('0x8')]['push'](_0x5077f3);}this['sync']();};RuleEngine[_0x47a5('0xb')][_0x47a5('0xc')]=function(){this[_0x47a5('0x9')]=this[_0x47a5('0x8')][_0x47a5('0xd')](function(_0xd308b8){if(_[_0x47a5('0x3')](_0xd308b8['on'])){_0xd308b8['on']=!![];}if(_0xd308b8['on']===!![]){return _0xd308b8;}});this['activeRules']=_[_0x47a5('0xe')](this[_0x47a5('0x9')],['p'],[_0x47a5('0xf')]);};RuleEngine[_0x47a5('0xb')][_0x47a5('0x10')]=function(_0x620ee9,_0x3c6c46){var _0x190faa=![];_0x620ee9['result']=!![];var _0x362359=_[_0x47a5('0x11')](_0x620ee9);var _0x3b001e=_[_0x47a5('0x11')](_0x620ee9);var _0x1ef44c=this['activeRules'];var _0x549de3=[];var _0x138bc0=this['ignoreFactChanges'];(function FnRuleLoop(_0x5247fd){var _0x423a81={'rules':function(){return _0x1ef44c;},'rule':function(){return _0x1ef44c[_0x5247fd];},'when':function(_0xaf70a6){if(_0xaf70a6){var _0x2ce454=_0x1ef44c[_0x5247fd][_0x47a5('0x12')];_0x2ce454[_0x47a5('0x13')]=_0x1ef44c[_0x5247fd]['id']||_0x1ef44c[_0x5247fd][_0x47a5('0x14')]||_0x47a5('0x15')+_0x5247fd;process[_0x47a5('0x16')](function(){_0x549de3[_0x47a5('0x17')](_0x2ce454['ruleRef']);_0x2ce454[_0x47a5('0x18')](_0x362359,_0x423a81);});}else{process[_0x47a5('0x16')](function(){_0x423a81['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190faa=!![];return FnRuleLoop(0x0);},'next':function(_0x2b0360){if(!_0x138bc0&&!_[_0x47a5('0x19')](_0x3b001e,_0x362359)){_0x3b001e=_[_0x47a5('0x11')](_0x362359);process['nextTick'](function(){_0x423a81[_0x47a5('0x1a')]();});}else{process[_0x47a5('0x16')](function(){if(_[_0x47a5('0x3')](_0x2b0360)){return FnRuleLoop(_0x5247fd+0x1);}else{return FnRuleLoop(_0x2b0360);}});}}};if(_0x5247fd<_0x1ef44c[_0x47a5('0x1b')]&&_0x190faa===![]){var _0x5ef1b1=_0x1ef44c[_0x5247fd][_0x47a5('0x1c')];_0x5ef1b1[_0x47a5('0x18')](_0x362359,_0x423a81);}else{process['nextTick'](function(){_0x362359[_0x47a5('0x1d')]=_0x549de3;return _0x3c6c46?_0x3c6c46(_0x362359):_[_0x47a5('0x1e')]();});}}(0x0));};RuleEngine[_0x47a5('0xb')][_0x47a5('0x1f')]=function(_0x3abd6a){if(_['isNil'](_0x3abd6a)){return this['rules'];}else{var _0x136745=_['matches'](_0x3abd6a);return _[_0x47a5('0xd')](this['rules'],_0x136745);}};RuleEngine[_0x47a5('0xb')][_0x47a5('0x20')]=function(_0x36ad34,_0x1dac65){var _0x21f296=_0x36ad34==='on'||_0x36ad34==='ON'?!![]:![];var _0x3ba0b7=this[_0x47a5('0x1f')](_0x1dac65);for(var _0x136b14=0x0,_0x16631f=_0x3ba0b7[_0x47a5('0x1b')];_0x136b14<_0x16631f;_0x136b14+=0x1){_0x3ba0b7[_0x136b14]['on']=_0x21f296;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x21')]=function(_0x528582,_0x243210){_0x528582=parseInt(_0x528582,0xa);var _0x51833b=this[_0x47a5('0x1f')](_0x243210);for(var _0x9ac908=0x0,_0x16901f=_0x51833b['length'];_0x9ac908<_0x16901f;_0x9ac908+=0x1){_0x51833b[_0x9ac908][_0x47a5('0x22')]=_0x528582;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x23')]=function(){var _0x51cc81=this['rules'];if(_0x51cc81 instanceof Array){_0x51cc81=_0x51cc81[_0x47a5('0x24')](function(_0xfb5ddb){_0xfb5ddb['condition']=_0xfb5ddb['condition'][_0x47a5('0x25')]();_0xfb5ddb[_0x47a5('0x12')]=_0xfb5ddb['consequence'][_0x47a5('0x25')]();return _0xfb5ddb;});}else if(!_['isNil'](_0x51cc81)){_0x51cc81[_0x47a5('0x1c')]=_0x51cc81[_0x47a5('0x1c')]['toString']();_0x51cc81['consequence']=_0x51cc81[_0x47a5('0x12')]['toString']();}return _0x51cc81;};RuleEngine[_0x47a5('0xb')][_0x47a5('0x26')]=function(_0xf269a8){this['init']();if(_[_0x47a5('0x27')](_0xf269a8)){_0xf269a8=JSON['parse'](_0xf269a8);}if(_0xf269a8 instanceof Array){_0xf269a8=_0xf269a8['map'](function(_0x65542e){_0x65542e['condition']=eval('('+_0x65542e[_0x47a5('0x1c')]+')');_0x65542e['consequence']=eval('('+_0x65542e[_0x47a5('0x12')]+')');return _0x65542e;});}else if(_0xf269a8!==null&&typeof _0xf269a8==_0x47a5('0x28')){_0xf269a8[_0x47a5('0x1c')]=eval('('+_0xf269a8[_0x47a5('0x1c')]+')');_0xf269a8[_0x47a5('0x12')]=eval('('+_0xf269a8[_0x47a5('0x12')]+')');}this[_0x47a5('0x4')](_0xf269a8);};module[_0x47a5('0x29')]=RuleEngine; \ No newline at end of file +var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x232f9c,_0x3ae9df){var _0x24bb71=function(_0x4fb958){while(--_0x4fb958){_0x232f9c['push'](_0x232f9c['shift']());}};_0x24bb71(++_0x3ae9df);}(_0x326f,0xd1));var _0xf326=function(_0x5300bd,_0x427869){_0x5300bd=_0x5300bd-0x0;var _0x21d4f4=_0x326f[_0x5300bd];return _0x21d4f4;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 75c0e53..007c4f9 100644 --- a/server/services/routing/mailRpc/index.js +++ b/server/services/routing/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1608=['SendMail','bluebird','jayson/promise','client','http','then','error','message','result','catch','sendMailMessage'];(function(_0x51679b,_0x2d621c){var _0x4085f3=function(_0x14c945){while(--_0x14c945){_0x51679b['push'](_0x51679b['shift']());}};_0x4085f3(++_0x2d621c);}(_0x1608,0x109));var _0x8160=function(_0x210258,_0x2d5051){_0x210258=_0x210258-0x0;var _0x561085=_0x1608[_0x210258];return _0x561085;};'use strict';var BPromise=require(_0x8160('0x0'));var jayson=require(_0x8160('0x1'));var client=jayson[_0x8160('0x2')][_0x8160('0x3')]({'port':0x232b});function request(_0x353155,_0x1e8f78){return new BPromise(function(_0x5efa0b,_0x4d8c65){return client['request'](_0x353155,_0x1e8f78)[_0x8160('0x4')](function(_0x5d73eb){if(_0x5d73eb[_0x8160('0x5')]){return _0x4d8c65(_0x5d73eb['error'][_0x8160('0x6')]);}else{return _0x5efa0b(_0x5d73eb[_0x8160('0x7')]);}})[_0x8160('0x8')](function(_0x201aad){return _0x4d8c65(_0x201aad);});});}exports[_0x8160('0x9')]=function(_0x89dca1,_0x552de2){return request(_0x8160('0xa'),{'account':_0x89dca1,'message':_0x552de2});}; \ No newline at end of file +var _0x32f9=['result','sendMailMessage','bluebird','client','http','request','then','error','message'];(function(_0x17de8f,_0x2d5177){var _0xc19ec4=function(_0x3424c0){while(--_0x3424c0){_0x17de8f['push'](_0x17de8f['shift']());}};_0xc19ec4(++_0x2d5177);}(_0x32f9,0x1cd));var _0x932f=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x32f9[_0x2aea9e];return _0x430b92;};'use strict';var BPromise=require(_0x932f('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x932f('0x1')][_0x932f('0x2')]({'port':0x232b});function request(_0xc64c43,_0x36bf7c){return new BPromise(function(_0xb9b8b9,_0xfadd3){return client[_0x932f('0x3')](_0xc64c43,_0x36bf7c)[_0x932f('0x4')](function(_0x5aacbc){if(_0x5aacbc[_0x932f('0x5')]){return _0xfadd3(_0x5aacbc[_0x932f('0x5')][_0x932f('0x6')]);}else{return _0xb9b8b9(_0x5aacbc[_0x932f('0x7')]);}})['catch'](function(_0x2ef447){return _0xfadd3(_0x2ef447);});});}exports[_0x932f('0x8')]=function(_0x30b603,_0x11fda5){return request('SendMail',{'account':_0x30b603,'message':_0x11fda5});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 8d754a8..f8d94f7 100644 --- a/server/services/routing/model/agent.js +++ b/server/services/routing/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x10a2=['whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','prototype','mail','chat','openchannel','sms','whatsapp','StatusTime','toNumber','format','chatPause','smsPause','chatStatusTime','whatsappCurrentCapacity','openchannelCurrentCapacity','busyQueue','openchannelWaitingInteractions','stringify','user:save','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','online','voicePause','mailPause','faxPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity'];(function(_0x3f6ece,_0x530c18){var _0x3ecfa2=function(_0x55717e){while(--_0x55717e){_0x3f6ece['push'](_0x3f6ece['shift']());}};_0x3ecfa2(++_0x530c18);}(_0x10a2,0x132));var _0x210a=function(_0x42801a,_0x582033){_0x42801a=_0x42801a-0x0;var _0x361943=_0x10a2[_0x42801a];return _0x361943;};'use strict';var _=require(_0x210a('0x0'));var moment=require(_0x210a('0x1'));var md5=require(_0x210a('0x2'));var Redis=require(_0x210a('0x3'));var config=require(_0x210a('0x4'));config[_0x210a('0x5')]=_[_0x210a('0x6')](config[_0x210a('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x210a('0x7'))(new Redis(config[_0x210a('0x5')]));function Agent(_0x4103ac){this['id']=_0x4103ac['id']||0x0;this[_0x210a('0x8')]=_0x4103ac['name']||'';this[_0x210a('0x9')]=_0x4103ac[_0x210a('0x9')]||!![];this[_0x210a('0xa')]=_0x4103ac['voicePause']||![];this['chatPause']=_0x4103ac['chatPause']||![];this[_0x210a('0xb')]=_0x4103ac[_0x210a('0xb')]||![];this[_0x210a('0xc')]=_0x4103ac[_0x210a('0xc')]||![];this['smsPause']=_0x4103ac['smsPause']||![];this['openchannelPause']=_0x4103ac['openchannelPause']||![];this[_0x210a('0xd')]=_0x210a('0xe');this['chatStatusTime']=0x0;this[_0x210a('0xf')]=_0x4103ac[_0x210a('0xf')]||0x0;this[_0x210a('0x10')]=0x0;this[_0x210a('0x11')]=_0x210a('0xe');this[_0x210a('0x12')]=0x0;this[_0x210a('0x13')]=_0x4103ac['mailCapacity']||0x0;this[_0x210a('0x14')]=0x0;this[_0x210a('0x15')]=_0x210a('0xe');this[_0x210a('0x16')]=0x0;this[_0x210a('0x17')]=_0x4103ac[_0x210a('0x17')]||0x0;this[_0x210a('0x18')]=0x0;this[_0x210a('0x19')]='unknown';this[_0x210a('0x1a')]=0x0;this[_0x210a('0x1b')]=_0x4103ac[_0x210a('0x1b')]||0x0;this[_0x210a('0x1c')]=0x0;this[_0x210a('0x1d')]=_0x210a('0xe');this[_0x210a('0x1e')]=0x0;this[_0x210a('0x1f')]=_0x4103ac[_0x210a('0x1f')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x210a('0x20')]=_0x210a('0xe');this[_0x210a('0x21')]=0x0;this[_0x210a('0x22')]=_0x4103ac[_0x210a('0x22')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x210a('0x23')]=![];this['busyQueue']=undefined;this[_0x210a('0x2')]='';this[_0x210a('0x24')]={};this[_0x210a('0x25')]={};this[_0x210a('0x26')]={};this['openchannelWaitingInteractions']={};this[_0x210a('0x27')]={};this[_0x210a('0x28')]={};this[_0x210a('0x29')]();}Agent['prototype'][_0x210a('0x2a')]=function(_0x4fe1fa){if(this[_0x4fe1fa+_0x210a('0x2b')]>0x0){if(this[_0x4fe1fa+_0x210a('0x2c')]>0x0&&this[_0x4fe1fa+_0x210a('0x2b')]>=this[_0x4fe1fa+_0x210a('0x2c')]){return _0x210a('0x2d');}else{return _0x210a('0x2e');}}else{return _0x210a('0x2f');}};Agent[_0x210a('0x30')]['updateRealtime']=function(){var _0x4432bb=[_0x210a('0x31'),_0x210a('0x32'),_0x210a('0x33'),'fax',_0x210a('0x34'),_0x210a('0x35')];for(var _0xb1937a=0x0;_0xb1937a<_0x4432bb['length'];_0xb1937a+=0x1){var _0x3444dd=this['getChannelStatus'](_0x4432bb[_0xb1937a]);if(this[_0x4432bb[_0xb1937a]+'Status']!==_0x3444dd){this[_0x4432bb[_0xb1937a]+_0x210a('0x36')]=_[_0x210a('0x37')](moment()[_0x210a('0x38')]('x'));}this[_0x4432bb[_0xb1937a]+'Status']=_0x3444dd;}var _0x4bcacf={'id':this['id'],'name':this['name'],'online':this['online'],'voicePause':this[_0x210a('0xa')],'chatPause':this[_0x210a('0x39')],'mailPause':this[_0x210a('0xb')],'smsPause':this[_0x210a('0x3a')],'faxPause':this[_0x210a('0xc')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x210a('0xd')],'chatStatusTime':this[_0x210a('0x3b')],'chatCapacity':this[_0x210a('0xf')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x210a('0x11')],'mailStatusTime':this[_0x210a('0x12')],'mailCapacity':this[_0x210a('0x13')],'mailCurrentCapacity':this[_0x210a('0x14')],'faxStatus':this[_0x210a('0x15')],'faxStatusTime':this[_0x210a('0x16')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x210a('0x18')],'smsStatus':this[_0x210a('0x19')],'smsStatusTime':this[_0x210a('0x1a')],'smsCapacity':this[_0x210a('0x1b')],'smsCurrentCapacity':this[_0x210a('0x1c')],'whatsappStatus':this[_0x210a('0x1d')],'whatsappStatusTime':this[_0x210a('0x1e')],'whatsappCapacity':this[_0x210a('0x1f')],'whatsappCurrentCapacity':this[_0x210a('0x3c')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x210a('0x21')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x210a('0x3d')],'busy':this[_0x210a('0x23')],'busyQueue':this[_0x210a('0x3e')],'chatWaitingInteractions':this['chatWaitingInteractions'],'faxWaitingInteractions':this['faxWaitingInteractions'],'mailWaitingInteractions':this[_0x210a('0x26')],'openchannelWaitingInteractions':this[_0x210a('0x3f')],'smsWaitingInteractions':this['smsWaitingInteractions'],'whatsappWaitingInteractions':this[_0x210a('0x28')]};var _0x38b74c=md5(JSON[_0x210a('0x40')](_0x4bcacf));if(this[_0x210a('0x2')]!==_0x38b74c){this[_0x210a('0x2')]=_0x38b74c;io['emit'](_0x210a('0x41'),_0x4bcacf);}};module[_0x210a('0x42')]=Agent; \ No newline at end of file +var _0xf354=['whatsapp','StatusTime','toNumber','format','Status','faxCapacity','openchannelStatus','openchannelStatusTime','openchannelCurrentCapacity','stringify','emit','exports','moment','md5','ioredis','redis','defaults','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','idle','updateRealtime','mail','chat','openchannel','fax','sms'];(function(_0x49273,_0x5d8075){var _0x4d7cdd=function(_0x45a644){while(--_0x45a644){_0x49273['push'](_0x49273['shift']());}};_0x4d7cdd(++_0x5d8075);}(_0xf354,0x15b));var _0x4f35=function(_0x155768,_0x427e2c){_0x155768=_0x155768-0x0;var _0x2e29ec=_0xf354[_0x155768];return _0x2e29ec;};'use strict';var _=require('lodash');var moment=require(_0x4f35('0x0'));var md5=require(_0x4f35('0x1'));var Redis=require(_0x4f35('0x2'));var config=require('../../../config/environment');config[_0x4f35('0x3')]=_[_0x4f35('0x4')](config['redis'],{'host':_0x4f35('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function Agent(_0x20436d){this['id']=_0x20436d['id']||0x0;this[_0x4f35('0x6')]=_0x20436d[_0x4f35('0x6')]||'';this[_0x4f35('0x7')]=_0x20436d['online']||!![];this[_0x4f35('0x8')]=_0x20436d[_0x4f35('0x8')]||![];this[_0x4f35('0x9')]=_0x20436d[_0x4f35('0x9')]||![];this[_0x4f35('0xa')]=_0x20436d[_0x4f35('0xa')]||![];this[_0x4f35('0xb')]=_0x20436d[_0x4f35('0xb')]||![];this['smsPause']=_0x20436d[_0x4f35('0xc')]||![];this[_0x4f35('0xd')]=_0x20436d[_0x4f35('0xd')]||![];this[_0x4f35('0xe')]=_0x4f35('0xf');this[_0x4f35('0x10')]=0x0;this['chatCapacity']=_0x20436d[_0x4f35('0x11')]||0x0;this[_0x4f35('0x12')]=0x0;this[_0x4f35('0x13')]=_0x4f35('0xf');this[_0x4f35('0x14')]=0x0;this[_0x4f35('0x15')]=_0x20436d['mailCapacity']||0x0;this[_0x4f35('0x16')]=0x0;this[_0x4f35('0x17')]='unknown';this[_0x4f35('0x18')]=0x0;this['faxCapacity']=_0x20436d['faxCapacity']||0x0;this[_0x4f35('0x19')]=0x0;this[_0x4f35('0x1a')]=_0x4f35('0xf');this[_0x4f35('0x1b')]=0x0;this[_0x4f35('0x1c')]=_0x20436d[_0x4f35('0x1c')]||0x0;this[_0x4f35('0x1d')]=0x0;this[_0x4f35('0x1e')]=_0x4f35('0xf');this[_0x4f35('0x1f')]=0x0;this[_0x4f35('0x20')]=_0x20436d[_0x4f35('0x20')]||0x0;this[_0x4f35('0x21')]=0x0;this['openchannelStatus']=_0x4f35('0xf');this['openchannelStatusTime']=0x0;this[_0x4f35('0x22')]=_0x20436d[_0x4f35('0x22')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x4f35('0x23')]=![];this[_0x4f35('0x24')]=undefined;this['md5']='';this[_0x4f35('0x25')]={};this[_0x4f35('0x26')]={};this[_0x4f35('0x27')]={};this[_0x4f35('0x28')]={};this[_0x4f35('0x29')]={};this[_0x4f35('0x2a')]={};this['updateRealtime']();}Agent[_0x4f35('0x2b')][_0x4f35('0x2c')]=function(_0x231b0c){if(this[_0x231b0c+_0x4f35('0x2d')]>0x0){if(this[_0x231b0c+_0x4f35('0x2e')]>0x0&&this[_0x231b0c+_0x4f35('0x2d')]>=this[_0x231b0c+_0x4f35('0x2e')]){return _0x4f35('0x2f');}else{return'working';}}else{return _0x4f35('0x30');}};Agent[_0x4f35('0x2b')][_0x4f35('0x31')]=function(){var _0x4af1e1=[_0x4f35('0x32'),_0x4f35('0x33'),_0x4f35('0x34'),_0x4f35('0x35'),_0x4f35('0x36'),_0x4f35('0x37')];for(var _0x272fed=0x0;_0x272fed<_0x4af1e1['length'];_0x272fed+=0x1){var _0x18d67b=this[_0x4f35('0x2c')](_0x4af1e1[_0x272fed]);if(this[_0x4af1e1[_0x272fed]+'Status']!==_0x18d67b){this[_0x4af1e1[_0x272fed]+_0x4f35('0x38')]=_[_0x4f35('0x39')](moment()[_0x4f35('0x3a')]('x'));}this[_0x4af1e1[_0x272fed]+_0x4f35('0x3b')]=_0x18d67b;}var _0x5b7c76={'id':this['id'],'name':this['name'],'online':this[_0x4f35('0x7')],'voicePause':this[_0x4f35('0x8')],'chatPause':this[_0x4f35('0x9')],'mailPause':this[_0x4f35('0xa')],'smsPause':this['smsPause'],'faxPause':this[_0x4f35('0xb')],'openchannelPause':this[_0x4f35('0xd')],'chatStatus':this['chatStatus'],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x4f35('0x12')],'mailStatus':this[_0x4f35('0x13')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x4f35('0x15')],'mailCurrentCapacity':this[_0x4f35('0x16')],'faxStatus':this[_0x4f35('0x17')],'faxStatusTime':this[_0x4f35('0x18')],'faxCapacity':this[_0x4f35('0x3c')],'faxCurrentCapacity':this[_0x4f35('0x19')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x4f35('0x1b')],'smsCapacity':this[_0x4f35('0x1c')],'smsCurrentCapacity':this[_0x4f35('0x1d')],'whatsappStatus':this[_0x4f35('0x1e')],'whatsappStatusTime':this[_0x4f35('0x1f')],'whatsappCapacity':this[_0x4f35('0x20')],'whatsappCurrentCapacity':this[_0x4f35('0x21')],'openchannelStatus':this[_0x4f35('0x3d')],'openchannelStatusTime':this[_0x4f35('0x3e')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x4f35('0x3f')],'busy':this[_0x4f35('0x23')],'busyQueue':this[_0x4f35('0x24')],'chatWaitingInteractions':this[_0x4f35('0x25')],'faxWaitingInteractions':this[_0x4f35('0x26')],'mailWaitingInteractions':this[_0x4f35('0x27')],'openchannelWaitingInteractions':this[_0x4f35('0x28')],'smsWaitingInteractions':this[_0x4f35('0x29')],'whatsappWaitingInteractions':this[_0x4f35('0x2a')]};var _0x256e54=md5(JSON[_0x4f35('0x40')](_0x5b7c76));if(this[_0x4f35('0x1')]!==_0x256e54){this['md5']=_0x256e54;io[_0x4f35('0x41')]('user:save',_0x5b7c76);}};module[_0x4f35('0x42')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 7e862d2..a36d119 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 _0x8ab3=['name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','chatPause','available','stringify','format','emit','chat_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0x4fe1c8,_0x1b6b04){var _0x58d72b=function(_0x305882){while(--_0x305882){_0x4fe1c8['push'](_0x4fe1c8['shift']());}};_0x58d72b(++_0x1b6b04);}(_0x8ab3,0x171));var _0x38ab=function(_0x2ceb31,_0x40ecf1){_0x2ceb31=_0x2ceb31-0x0;var _0x168859=_0x8ab3[_0x2ceb31];return _0x168859;};'use strict';var _=require('lodash');var md5=require(_0x38ab('0x0'));var util=require(_0x38ab('0x1'));var Redis=require(_0x38ab('0x2'));var config=require(_0x38ab('0x3'));config[_0x38ab('0x4')]=_[_0x38ab('0x5')](config[_0x38ab('0x4')],{'host':_0x38ab('0x6'),'port':0x18eb});var io=require(_0x38ab('0x7'))(new Redis(config[_0x38ab('0x4')]));function ChatQueue(_0x12250c){this['id']=_0x12250c['id']||0x0;this['name']=_0x12250c[_0x38ab('0x8')]||'';this[_0x38ab('0x9')]=_0x12250c['timeout']||0xa;this[_0x38ab('0xa')]=_0x12250c[_0x38ab('0xa')]||_0x38ab('0xb');this[_0x38ab('0xc')]=_0x12250c[_0x38ab('0xc')];this['mapAgentsId']={};this[_0x38ab('0xd')]=0x0;this['md5']='';this[_0x38ab('0xe')]();this['updateRealtime']();}ChatQueue[_0x38ab('0xf')][_0x38ab('0xe')]=function(){var _0x31b472=this[_0x38ab('0x10')]['_rr'];this[_0x38ab('0x10')]=_[_0x38ab('0x11')](this[_0x38ab('0xc')],'id');this[_0x38ab('0x10')][_0x38ab('0x12')]=_0x31b472;};ChatQueue[_0x38ab('0xf')][_0x38ab('0x13')]=function(){this[_0x38ab('0x14')]=0x0;this[_0x38ab('0x15')]=0x0;for(var _0xee1cb3=0x0;_0xee1cb3=0x0?this['available']:0x0;var _0x80bb46={'id':this['id'],'available':this[_0x38ab('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x38ab('0x8')],'paused':this[_0x38ab('0x15')],'waiting':this['waiting']};var _0x39a22b=md5(JSON[_0x38ab('0x18')](_0x80bb46));if(this[_0x38ab('0x0')]!==_0x39a22b){this[_0x38ab('0x0')]=_0x39a22b;io['to'](util[_0x38ab('0x19')]('chat:queue:%s',_0x80bb46[_0x38ab('0x8')]))[_0x38ab('0x1a')](_0x38ab('0x1b'),_0x80bb46);}};module[_0x38ab('0x1c')]=ChatQueue; \ No newline at end of file +var _0x9c6f=['../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','map','_rr','prototype','paused','length','loggedIn','chatPause','available','stringify','format','chat:queue:%s','chat_queue:save','exports','lodash','md5','util','ioredis'];(function(_0x1e1947,_0x3393fa){var _0x3f4156=function(_0x36eba0){while(--_0x36eba0){_0x1e1947['push'](_0x1e1947['shift']());}};_0x3f4156(++_0x3393fa);}(_0x9c6f,0x18f));var _0xf9c6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c6f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf9c6('0x0'));var md5=require(_0xf9c6('0x1'));var util=require(_0xf9c6('0x2'));var Redis=require(_0xf9c6('0x3'));var config=require(_0xf9c6('0x4'));config['redis']=_[_0xf9c6('0x5')](config[_0xf9c6('0x6')],{'host':_0xf9c6('0x7'),'port':0x18eb});var io=require(_0xf9c6('0x8'))(new Redis(config[_0xf9c6('0x6')]));function ChatQueue(_0x3090b2){this['id']=_0x3090b2['id']||0x0;this['name']=_0x3090b2[_0xf9c6('0x9')]||'';this[_0xf9c6('0xa')]=_0x3090b2['timeout']||0xa;this[_0xf9c6('0xb')]=_0x3090b2[_0xf9c6('0xb')]||_0xf9c6('0xc');this[_0xf9c6('0xd')]=_0x3090b2['Agents'];this[_0xf9c6('0xe')]={};this[_0xf9c6('0xf')]=0x0;this[_0xf9c6('0x1')]='';this[_0xf9c6('0x10')]();this[_0xf9c6('0x11')]();}ChatQueue['prototype'][_0xf9c6('0x10')]=function(){var _0x1c4cb4=this[_0xf9c6('0xe')]['_rr'];this[_0xf9c6('0xe')]=_[_0xf9c6('0x12')](this[_0xf9c6('0xd')],'id');this[_0xf9c6('0xe')][_0xf9c6('0x13')]=_0x1c4cb4;};ChatQueue[_0xf9c6('0x14')][_0xf9c6('0x11')]=function(){this['loggedIn']=0x0;this[_0xf9c6('0x15')]=0x0;for(var _0x802ca9=0x0;_0x802ca9=0x0?this[_0xf9c6('0x19')]:0x0;var _0x253c3f={'id':this['id'],'available':this[_0xf9c6('0x19')],'loggedIn':this[_0xf9c6('0x17')],'name':this[_0xf9c6('0x9')],'paused':this[_0xf9c6('0x15')],'waiting':this[_0xf9c6('0xf')]};var _0x25d43e=md5(JSON[_0xf9c6('0x1a')](_0x253c3f));if(this[_0xf9c6('0x1')]!==_0x25d43e){this[_0xf9c6('0x1')]=_0x25d43e;io['to'](util[_0xf9c6('0x1b')](_0xf9c6('0x1c'),_0x253c3f[_0xf9c6('0x9')]))['emit'](_0xf9c6('0x1d'),_0x253c3f);}};module[_0xf9c6('0x1e')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 33a0d95..20f9fe3 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 _0x9285=['_rr','paused','length','loggedIn','available','stringify','fax:queue:%s','emit','fax_queue:save','lodash','util','../../../config/environment','redis','defaults','localhost','name','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRealtime','prototype'];(function(_0x482504,_0x4dd28d){var _0x48f9db=function(_0x302988){while(--_0x302988){_0x482504['push'](_0x482504['shift']());}};_0x48f9db(++_0x4dd28d);}(_0x9285,0x129));var _0x5928=function(_0xdf59b6,_0x2d7a75){_0xdf59b6=_0xdf59b6-0x0;var _0x1fdd82=_0x9285[_0xdf59b6];return _0x1fdd82;};'use strict';var _=require(_0x5928('0x0'));var md5=require('md5');var util=require(_0x5928('0x1'));var Redis=require('ioredis');var config=require(_0x5928('0x2'));config[_0x5928('0x3')]=_[_0x5928('0x4')](config['redis'],{'host':_0x5928('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function FaxQueue(_0x43d517){this['id']=_0x43d517['id']||0x0;this[_0x5928('0x6')]=_0x43d517['name']||'';this['timeout']=_0x43d517['timeout']||0xa;this[_0x5928('0x7')]=_0x43d517[_0x5928('0x7')]||_0x5928('0x8');this['Agents']=_0x43d517[_0x5928('0x9')];this[_0x5928('0xa')]={};this[_0x5928('0xb')]=0x0;this[_0x5928('0xc')]='';this['updateRouting']();this[_0x5928('0xd')]();}FaxQueue[_0x5928('0xe')]['updateRouting']=function(){var _0x423d3d=this[_0x5928('0xa')][_0x5928('0xf')];this[_0x5928('0xa')]=_['map'](this[_0x5928('0x9')],'id');this['mapAgentsId'][_0x5928('0xf')]=_0x423d3d;};FaxQueue[_0x5928('0xe')][_0x5928('0xd')]=function(){this['loggedIn']=0x0;this[_0x5928('0x10')]=0x0;for(var _0x3a6c31=0x0;_0x3a6c31=0x0?this[_0x5928('0x13')]:0x0;var _0x31c1b2={'id':this['id'],'available':this[_0x5928('0x13')],'loggedIn':this[_0x5928('0x12')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x5928('0xb')]};var _0x2b5889=md5(JSON[_0x5928('0x14')](_0x31c1b2));if(this[_0x5928('0xc')]!==_0x2b5889){this[_0x5928('0xc')]=_0x2b5889;io['to'](util['format'](_0x5928('0x15'),_0x31c1b2[_0x5928('0x6')]))[_0x5928('0x16')](_0x5928('0x17'),_0x31c1b2);}};module['exports']=FaxQueue; \ No newline at end of file +var _0x0e4c=['prototype','_rr','map','loggedIn','paused','length','faxPause','available','format','fax:queue:%s','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0e4c,0xd0));var _0xc0e4=function(_0x4f6f8a,_0x1469eb){_0x4f6f8a=_0x4f6f8a-0x0;var _0x5908d7=_0x0e4c[_0x4f6f8a];return _0x5908d7;};'use strict';var _=require(_0xc0e4('0x0'));var md5=require(_0xc0e4('0x1'));var util=require(_0xc0e4('0x2'));var Redis=require(_0xc0e4('0x3'));var config=require(_0xc0e4('0x4'));config[_0xc0e4('0x5')]=_[_0xc0e4('0x6')](config[_0xc0e4('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xc0e4('0x7'))(new Redis(config[_0xc0e4('0x5')]));function FaxQueue(_0x3f039a){this['id']=_0x3f039a['id']||0x0;this[_0xc0e4('0x8')]=_0x3f039a[_0xc0e4('0x8')]||'';this[_0xc0e4('0x9')]=_0x3f039a[_0xc0e4('0x9')]||0xa;this[_0xc0e4('0xa')]=_0x3f039a[_0xc0e4('0xa')]||'beepall';this['Agents']=_0x3f039a[_0xc0e4('0xb')];this[_0xc0e4('0xc')]={};this[_0xc0e4('0xd')]=0x0;this[_0xc0e4('0x1')]='';this[_0xc0e4('0xe')]();this[_0xc0e4('0xf')]();}FaxQueue[_0xc0e4('0x10')][_0xc0e4('0xe')]=function(){var _0x44e838=this[_0xc0e4('0xc')][_0xc0e4('0x11')];this[_0xc0e4('0xc')]=_[_0xc0e4('0x12')](this['Agents'],'id');this[_0xc0e4('0xc')][_0xc0e4('0x11')]=_0x44e838;};FaxQueue[_0xc0e4('0x10')][_0xc0e4('0xf')]=function(){this[_0xc0e4('0x13')]=0x0;this[_0xc0e4('0x14')]=0x0;for(var _0x1e27a4=0x0;_0x1e27a4=0x0?this['available']:0x0;var _0x3278a5={'id':this['id'],'available':this['available'],'loggedIn':this[_0xc0e4('0x13')],'name':this[_0xc0e4('0x8')],'paused':this[_0xc0e4('0x14')],'waiting':this[_0xc0e4('0xd')]};var _0x4bff44=md5(JSON['stringify'](_0x3278a5));if(this[_0xc0e4('0x1')]!==_0x4bff44){this[_0xc0e4('0x1')]=_0x4bff44;io['to'](util[_0xc0e4('0x18')](_0xc0e4('0x19'),_0x3278a5[_0xc0e4('0x8')]))['emit'](_0xc0e4('0x1a'),_0x3278a5);}};module[_0xc0e4('0x1b')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 1c1b38d..a26686d 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 _0xd4b8=['Intervals','exports','name'];(function(_0x6760ef,_0x4c7ef3){var _0xc54146=function(_0x186e76){while(--_0x186e76){_0x6760ef['push'](_0x6760ef['shift']());}};_0xc54146(++_0x4c7ef3);}(_0xd4b8,0x158));var _0x8d4b=function(_0x431333,_0x450942){_0x431333=_0x431333-0x0;var _0x2083ed=_0xd4b8[_0x431333];return _0x2083ed;};'use strict';function Interval(_0x13cdf5){this['id']=_0x13cdf5['id']||0x0;this[_0x8d4b('0x0')]=_0x13cdf5[_0x8d4b('0x0')]||'';this[_0x8d4b('0x1')]=_0x13cdf5[_0x8d4b('0x1')]||{};}module[_0x8d4b('0x2')]=Interval; \ No newline at end of file +var _0xd64b=['exports','name','Intervals'];(function(_0x42182d,_0x125b1a){var _0x26459b=function(_0x1b88ab){while(--_0x1b88ab){_0x42182d['push'](_0x42182d['shift']());}};_0x26459b(++_0x125b1a);}(_0xd64b,0xa3));var _0xbd64=function(_0x5ec61d,_0x36c73c){_0x5ec61d=_0x5ec61d-0x0;var _0x2e0e5c=_0xd64b[_0x5ec61d];return _0x2e0e5c;};'use strict';function Interval(_0x32752b){this['id']=_0x32752b['id']||0x0;this[_0xbd64('0x0')]=_0x32752b['name']||'';this[_0xbd64('0x1')]=_0x32752b['Intervals']||{};}module[_0xbd64('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 60d6895..85ea16d 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 _0xb16e=['mailPause','available','stringify','format','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online'];(function(_0x54fbff,_0x53470e){var _0x5cf619=function(_0x28765b){while(--_0x28765b){_0x54fbff['push'](_0x54fbff['shift']());}};_0x5cf619(++_0x53470e);}(_0xb16e,0x101));var _0xeb16=function(_0x3050ca,_0x3e36b0){_0x3050ca=_0x3050ca-0x0;var _0x1eed1d=_0xb16e[_0x3050ca];return _0x1eed1d;};'use strict';var _=require(_0xeb16('0x0'));var md5=require(_0xeb16('0x1'));var util=require(_0xeb16('0x2'));var Redis=require(_0xeb16('0x3'));var config=require(_0xeb16('0x4'));config[_0xeb16('0x5')]=_[_0xeb16('0x6')](config['redis'],{'host':_0xeb16('0x7'),'port':0x18eb});var io=require(_0xeb16('0x8'))(new Redis(config[_0xeb16('0x5')]));function MailQueue(_0x295fd8){this['id']=_0x295fd8['id']||0x0;this['name']=_0x295fd8[_0xeb16('0x9')]||'';this[_0xeb16('0xa')]=_0x295fd8['timeout']||0xa;this['strategy']=_0x295fd8['strategy']||'beepall';this[_0xeb16('0xb')]=_0x295fd8[_0xeb16('0xb')];this[_0xeb16('0xc')]={};this[_0xeb16('0xd')]=0x0;this[_0xeb16('0x1')]='';this[_0xeb16('0xe')]();this[_0xeb16('0xf')]();}MailQueue[_0xeb16('0x10')]['updateRouting']=function(){var _0x3b62e0=this[_0xeb16('0xc')][_0xeb16('0x11')];this[_0xeb16('0xc')]=_[_0xeb16('0x12')](this[_0xeb16('0xb')],'id');this[_0xeb16('0xc')]['_rr']=_0x3b62e0;};MailQueue[_0xeb16('0x10')]['updateRealtime']=function(){this[_0xeb16('0x13')]=0x0;this[_0xeb16('0x14')]=0x0;for(var _0x2d864d=0x0;_0x2d864d=0x0?this[_0xeb16('0x18')]:0x0;var _0x21f158={'id':this['id'],'available':this[_0xeb16('0x18')],'loggedIn':this[_0xeb16('0x13')],'name':this['name'],'paused':this[_0xeb16('0x14')],'waiting':this[_0xeb16('0xd')]};var _0x107ab0=md5(JSON[_0xeb16('0x19')](_0x21f158));if(this[_0xeb16('0x1')]!==_0x107ab0){this['md5']=_0x107ab0;io['to'](util[_0xeb16('0x1a')]('mail:queue:%s',_0x21f158[_0xeb16('0x9')]))['emit']('mail_queue:save',_0x21f158);}};module[_0xeb16('0x1b')]=MailQueue; \ No newline at end of file +var _0x1975=['ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','online','loggedIn','mailPause','paused','available','stringify','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5'];(function(_0xbeb808,_0x881ddf){var _0x5d6909=function(_0x37d652){while(--_0x37d652){_0xbeb808['push'](_0xbeb808['shift']());}};_0x5d6909(++_0x881ddf);}(_0x1975,0x148));var _0x5197=function(_0xa76664,_0x5e32db){_0xa76664=_0xa76664-0x0;var _0x3f7743=_0x1975[_0xa76664];return _0x3f7743;};'use strict';var _=require(_0x5197('0x0'));var md5=require(_0x5197('0x1'));var util=require('util');var Redis=require(_0x5197('0x2'));var config=require(_0x5197('0x3'));config['redis']=_[_0x5197('0x4')](config[_0x5197('0x5')],{'host':_0x5197('0x6'),'port':0x18eb});var io=require(_0x5197('0x7'))(new Redis(config[_0x5197('0x5')]));function MailQueue(_0x3747ba){this['id']=_0x3747ba['id']||0x0;this[_0x5197('0x8')]=_0x3747ba[_0x5197('0x8')]||'';this[_0x5197('0x9')]=_0x3747ba['timeout']||0xa;this[_0x5197('0xa')]=_0x3747ba[_0x5197('0xa')]||_0x5197('0xb');this[_0x5197('0xc')]=_0x3747ba[_0x5197('0xc')];this[_0x5197('0xd')]={};this[_0x5197('0xe')]=0x0;this['md5']='';this['updateRouting']();this[_0x5197('0xf')]();}MailQueue[_0x5197('0x10')][_0x5197('0x11')]=function(){var _0x2c1944=this[_0x5197('0xd')][_0x5197('0x12')];this['mapAgentsId']=_[_0x5197('0x13')](this[_0x5197('0xc')],'id');this[_0x5197('0xd')][_0x5197('0x12')]=_0x2c1944;};MailQueue[_0x5197('0x10')]['updateRealtime']=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x15c359=0x0;_0x15c359=0x0?this[_0x5197('0x18')]:0x0;var _0x286c10={'id':this['id'],'available':this[_0x5197('0x18')],'loggedIn':this[_0x5197('0x15')],'name':this[_0x5197('0x8')],'paused':this[_0x5197('0x17')],'waiting':this[_0x5197('0xe')]};var _0x39689e=md5(JSON[_0x5197('0x19')](_0x286c10));if(this[_0x5197('0x1')]!==_0x39689e){this[_0x5197('0x1')]=_0x39689e;io['to'](util['format'](_0x5197('0x1a'),_0x286c10['name']))[_0x5197('0x1b')](_0x5197('0x1c'),_0x286c10);}};module[_0x5197('0x1d')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 7ffadf6..f6354de 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 _0x2ef3=['stringify','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','paused','length','online','available','loggedIn','name'];(function(_0x212a37,_0xf35b2e){var _0x5d0bf9=function(_0x51850f){while(--_0x51850f){_0x212a37['push'](_0x212a37['shift']());}};_0x5d0bf9(++_0xf35b2e);}(_0x2ef3,0xba));var _0x32ef=function(_0x401722,_0x366acf){_0x401722=_0x401722-0x0;var _0xdd42a2=_0x2ef3[_0x401722];return _0xdd42a2;};'use strict';var _=require(_0x32ef('0x0'));var md5=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var Redis=require(_0x32ef('0x3'));var config=require(_0x32ef('0x4'));config[_0x32ef('0x5')]=_['defaults'](config[_0x32ef('0x5')],{'host':_0x32ef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x32ef('0x5')]));function OpenchannelQueue(_0x37dd1d){this['id']=_0x37dd1d['id']||0x0;this['name']=_0x37dd1d['name']||'';this[_0x32ef('0x7')]=_0x37dd1d[_0x32ef('0x7')]||0xa;this[_0x32ef('0x8')]=_0x37dd1d[_0x32ef('0x8')]||_0x32ef('0x9');this[_0x32ef('0xa')]=_0x37dd1d[_0x32ef('0xa')];this[_0x32ef('0xb')]={};this[_0x32ef('0xc')]=0x0;this[_0x32ef('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x32ef('0xd')][_0x32ef('0xe')]=function(){var _0x45bfd5=this[_0x32ef('0xb')]['_rr'];this[_0x32ef('0xb')]=_['map'](this[_0x32ef('0xa')],'id');this['mapAgentsId'][_0x32ef('0xf')]=_0x45bfd5;};OpenchannelQueue[_0x32ef('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x32ef('0x10')]=0x0;for(var _0x4d8009=0x0;_0x4d8009=0x0?this[_0x32ef('0x13')]:0x0;var _0x286bfb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32ef('0x14')],'name':this[_0x32ef('0x15')],'paused':this['paused'],'waiting':this[_0x32ef('0xc')]};var _0x314ef1=md5(JSON[_0x32ef('0x16')](_0x286bfb));if(this[_0x32ef('0x1')]!==_0x314ef1){this[_0x32ef('0x1')]=_0x314ef1;io['to'](util[_0x32ef('0x17')]('openchannel:queue:%s',_0x286bfb[_0x32ef('0x15')]))['emit'](_0x32ef('0x18'),_0x286bfb);}};module[_0x32ef('0x19')]=OpenchannelQueue; \ No newline at end of file +var _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0x299eb8,_0x2a3c76){var _0x59ee49=function(_0x482d53){while(--_0x482d53){_0x299eb8['push'](_0x299eb8['shift']());}};_0x59ee49(++_0x2a3c76);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3a6e4b,_0x118cd9){_0x3a6e4b=_0x3a6e4b-0x0;var _0x36572d=_0x5fc3[_0x3a6e4b];return _0x36572d;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 322afc9..e005dab 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 _0x44ae=['mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','smsPause','available','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','util','ioredis','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents'];(function(_0x233c1b,_0x173b9f){var _0x5d8d78=function(_0x14a545){while(--_0x14a545){_0x233c1b['push'](_0x233c1b['shift']());}};_0x5d8d78(++_0x173b9f);}(_0x44ae,0x17d));var _0xe44a=function(_0x24e8db,_0x89fc47){_0x24e8db=_0x24e8db-0x0;var _0x576cc1=_0x44ae[_0x24e8db];return _0x576cc1;};'use strict';var _=require(_0xe44a('0x0'));var md5=require(_0xe44a('0x1'));var util=require(_0xe44a('0x2'));var Redis=require(_0xe44a('0x3'));var config=require('../../../config/environment');config[_0xe44a('0x4')]=_['defaults'](config[_0xe44a('0x4')],{'host':_0xe44a('0x5'),'port':0x18eb});var io=require(_0xe44a('0x6'))(new Redis(config[_0xe44a('0x4')]));function SmsQueue(_0x1a8842){this['id']=_0x1a8842['id']||0x0;this[_0xe44a('0x7')]=_0x1a8842['name']||'';this[_0xe44a('0x8')]=_0x1a8842[_0xe44a('0x8')]||0xa;this[_0xe44a('0x9')]=_0x1a8842[_0xe44a('0x9')]||'beepall';this[_0xe44a('0xa')]=_0x1a8842[_0xe44a('0xa')];this[_0xe44a('0xb')]={};this[_0xe44a('0xc')]=0x0;this['md5']='';this[_0xe44a('0xd')]();this[_0xe44a('0xe')]();}SmsQueue[_0xe44a('0xf')][_0xe44a('0xd')]=function(){var _0xe19628=this[_0xe44a('0xb')][_0xe44a('0x10')];this['mapAgentsId']=_['map'](this['Agents'],'id');this[_0xe44a('0xb')][_0xe44a('0x10')]=_0xe19628;};SmsQueue[_0xe44a('0xf')]['updateRealtime']=function(){this[_0xe44a('0x11')]=0x0;this[_0xe44a('0x12')]=0x0;for(var _0x3656b2=0x0;_0x3656b2=0x0?this[_0xe44a('0x16')]:0x0;var _0x509f30={'id':this['id'],'available':this[_0xe44a('0x16')],'loggedIn':this[_0xe44a('0x11')],'name':this[_0xe44a('0x7')],'paused':this[_0xe44a('0x12')],'waiting':this[_0xe44a('0xc')]};var _0x33e9ac=md5(JSON['stringify'](_0x509f30));if(this[_0xe44a('0x1')]!==_0x33e9ac){this['md5']=_0x33e9ac;io['to'](util[_0xe44a('0x17')](_0xe44a('0x18'),_0x509f30[_0xe44a('0x7')]))[_0xe44a('0x19')](_0xe44a('0x1a'),_0x509f30);}};module[_0xe44a('0x1b')]=SmsQueue; \ No newline at end of file +var _0x8d9b=['smsPause','available','name','stringify','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','timeout','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','paused','online'];(function(_0x405385,_0x56f573){var _0x43837b=function(_0x30e20e){while(--_0x30e20e){_0x405385['push'](_0x405385['shift']());}};_0x43837b(++_0x56f573);}(_0x8d9b,0x104));var _0xb8d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d9b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb8d9('0x0'));var md5=require(_0xb8d9('0x1'));var util=require(_0xb8d9('0x2'));var Redis=require(_0xb8d9('0x3'));var config=require(_0xb8d9('0x4'));config['redis']=_['defaults'](config[_0xb8d9('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xb8d9('0x6'))(new Redis(config[_0xb8d9('0x5')]));function SmsQueue(_0x56deeb){this['id']=_0x56deeb['id']||0x0;this['name']=_0x56deeb['name']||'';this[_0xb8d9('0x7')]=_0x56deeb['timeout']||0xa;this['strategy']=_0x56deeb['strategy']||_0xb8d9('0x8');this[_0xb8d9('0x9')]=_0x56deeb[_0xb8d9('0x9')];this[_0xb8d9('0xa')]={};this[_0xb8d9('0xb')]=0x0;this[_0xb8d9('0x1')]='';this[_0xb8d9('0xc')]();this['updateRealtime']();}SmsQueue[_0xb8d9('0xd')]['updateRouting']=function(){var _0x206075=this[_0xb8d9('0xa')][_0xb8d9('0xe')];this[_0xb8d9('0xa')]=_[_0xb8d9('0xf')](this[_0xb8d9('0x9')],'id');this[_0xb8d9('0xa')][_0xb8d9('0xe')]=_0x206075;};SmsQueue[_0xb8d9('0xd')][_0xb8d9('0x10')]=function(){this[_0xb8d9('0x11')]=0x0;this[_0xb8d9('0x12')]=0x0;for(var _0x1bcb02=0x0;_0x1bcb02=0x0?this[_0xb8d9('0x15')]:0x0;var _0x4fec1e={'id':this['id'],'available':this[_0xb8d9('0x15')],'loggedIn':this['loggedIn'],'name':this[_0xb8d9('0x16')],'paused':this[_0xb8d9('0x12')],'waiting':this[_0xb8d9('0xb')]};var _0x3ff41e=md5(JSON[_0xb8d9('0x17')](_0x4fec1e));if(this['md5']!==_0x3ff41e){this['md5']=_0x3ff41e;io['to'](util['format'](_0xb8d9('0x18'),_0x4fec1e[_0xb8d9('0x16')]))[_0xb8d9('0x19')](_0xb8d9('0x1a'),_0x4fec1e);}};module[_0xb8d9('0x1b')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 4b33a84..2f46723 100644 --- a/server/services/routing/model/whatsappQueue.js +++ b/server/services/routing/model/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe471=['_rr','map','loggedIn','length','online','paused','available','waiting','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','lodash','md5','util','../../../config/environment','redis','defaults','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype'];(function(_0x1ad9b4,_0x5df9ed){var _0xbbee74=function(_0x39c75f){while(--_0x39c75f){_0x1ad9b4['push'](_0x1ad9b4['shift']());}};_0xbbee74(++_0x5df9ed);}(_0xe471,0xca));var _0x1e47=function(_0x36cbf2,_0x4814c1){_0x36cbf2=_0x36cbf2-0x0;var _0x4c0f65=_0xe471[_0x36cbf2];return _0x4c0f65;};'use strict';var _=require(_0x1e47('0x0'));var md5=require(_0x1e47('0x1'));var util=require(_0x1e47('0x2'));var Redis=require('ioredis');var config=require(_0x1e47('0x3'));config[_0x1e47('0x4')]=_[_0x1e47('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1e47('0x4')]));function WhatsappQueue(_0x547e3b){this['id']=_0x547e3b['id']||0x0;this[_0x1e47('0x6')]=_0x547e3b[_0x1e47('0x6')]||'';this[_0x1e47('0x7')]=_0x547e3b['timeout']||0xa;this[_0x1e47('0x8')]=_0x547e3b['strategy']||_0x1e47('0x9');this[_0x1e47('0xa')]=_0x547e3b['Agents'];this[_0x1e47('0xb')]={};this['waiting']=0x0;this[_0x1e47('0x1')]='';this[_0x1e47('0xc')]();this['updateRealtime']();}WhatsappQueue[_0x1e47('0xd')][_0x1e47('0xc')]=function(){var _0x3cc60f=this[_0x1e47('0xb')][_0x1e47('0xe')];this[_0x1e47('0xb')]=_[_0x1e47('0xf')](this[_0x1e47('0xa')],'id');this['mapAgentsId'][_0x1e47('0xe')]=_0x3cc60f;};WhatsappQueue['prototype']['updateRealtime']=function(){this[_0x1e47('0x10')]=0x0;this['paused']=0x0;for(var _0x1b4b53=0x0;_0x1b4b53=0x0?this['available']:0x0;var _0x5e80d0={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x1e47('0x13')],'waiting':this[_0x1e47('0x15')]};var _0x1211e3=md5(JSON[_0x1e47('0x16')](_0x5e80d0));if(this['md5']!==_0x1211e3){this[_0x1e47('0x1')]=_0x1211e3;io['to'](util[_0x1e47('0x17')](_0x1e47('0x18'),_0x5e80d0['name']))[_0x1e47('0x19')](_0x1e47('0x1a'),_0x5e80d0);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0x7951=['waiting','stringify','format','whatsapp:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime','prototype','map','loggedIn','paused','length','available'];(function(_0x40a49f,_0xc2316d){var _0x10b721=function(_0x59ae74){while(--_0x59ae74){_0x40a49f['push'](_0x40a49f['shift']());}};_0x10b721(++_0xc2316d);}(_0x7951,0xca));var _0x1795=function(_0x5ed7b7,_0x19018b){_0x5ed7b7=_0x5ed7b7-0x0;var _0x54ace2=_0x7951[_0x5ed7b7];return _0x54ace2;};'use strict';var _=require(_0x1795('0x0'));var md5=require(_0x1795('0x1'));var util=require(_0x1795('0x2'));var Redis=require(_0x1795('0x3'));var config=require(_0x1795('0x4'));config[_0x1795('0x5')]=_[_0x1795('0x6')](config[_0x1795('0x5')],{'host':_0x1795('0x7'),'port':0x18eb});var io=require(_0x1795('0x8'))(new Redis(config[_0x1795('0x5')]));function WhatsappQueue(_0x5c1fb5){this['id']=_0x5c1fb5['id']||0x0;this[_0x1795('0x9')]=_0x5c1fb5[_0x1795('0x9')]||'';this[_0x1795('0xa')]=_0x5c1fb5[_0x1795('0xa')]||0xa;this[_0x1795('0xb')]=_0x5c1fb5[_0x1795('0xb')]||_0x1795('0xc');this[_0x1795('0xd')]=_0x5c1fb5[_0x1795('0xd')];this[_0x1795('0xe')]={};this['waiting']=0x0;this[_0x1795('0x1')]='';this['updateRouting']();this[_0x1795('0xf')]();}WhatsappQueue[_0x1795('0x10')]['updateRouting']=function(){var _0x102bad=this[_0x1795('0xe')]['_rr'];this[_0x1795('0xe')]=_[_0x1795('0x11')](this[_0x1795('0xd')],'id');this['mapAgentsId']['_rr']=_0x102bad;};WhatsappQueue[_0x1795('0x10')][_0x1795('0xf')]=function(){this[_0x1795('0x12')]=0x0;this[_0x1795('0x13')]=0x0;for(var _0x51cdcf=0x0;_0x51cdcf=0x0?this[_0x1795('0x15')]:0x0;var _0x4f0a0e={'id':this['id'],'available':this[_0x1795('0x15')],'loggedIn':this[_0x1795('0x12')],'name':this['name'],'paused':this[_0x1795('0x13')],'waiting':this[_0x1795('0x16')]};var _0x2cfaf0=md5(JSON[_0x1795('0x17')](_0x4f0a0e));if(this[_0x1795('0x1')]!==_0x2cfaf0){this[_0x1795('0x1')]=_0x2cfaf0;io['to'](util[_0x1795('0x18')](_0x1795('0x19'),_0x4f0a0e[_0x1795('0x9')]))[_0x1795('0x1a')]('whatsapp_queue:save',_0x4f0a0e);}};module[_0x1795('0x1b')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index d44d4c2..fb52636 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x175bb6,_0x5f36f8){var _0x4c29e9=function(_0x823ec5){while(--_0x823ec5){_0x175bb6['push'](_0x175bb6['shift']());}};_0x4c29e9(++_0x5f36f8);}(_0xb10b,0x12a));var _0xbb10=function(_0x40a107,_0x5acc82){_0x40a107=_0x40a107-0x0;var _0x4beb59=_0xb10b[_0x40a107];return _0x4beb59;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x3794b5,_0xd6d4c3){var _0x3b37fb=function(_0x178348){while(--_0x178348){_0x3794b5['push'](_0x3794b5['shift']());}};_0x3b37fb(++_0xd6d4c3);}(_0xb10b,0x12a));var _0xbb10=function(_0x2fb356,_0x567092){_0x2fb356=_0x2fb356-0x0;var _0x27fb4b=_0xb10b[_0x2fb356];return _0x27fb4b;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 43ffaf2..cf96aea 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 _0x49e4=['addTagsToChatInteraction','../client','update','updateChatInteraction','addTags','AddTagsToChatInteraction'];(function(_0x14211b,_0x276c60){var _0x5c14b0=function(_0x115fcb){while(--_0x115fcb){_0x14211b['push'](_0x14211b['shift']());}};_0x5c14b0(++_0x276c60);}(_0x49e4,0x1cf));var _0x449e=function(_0x5aaaa4,_0x1b65b3){_0x5aaaa4=_0x5aaaa4-0x0;var _0x5aa86a=_0x49e4[_0x5aaaa4];return _0x5aa86a;};'use strict';var client=require(_0x449e('0x0'));exports[_0x449e('0x1')]=function(_0x3a331d,_0x3276e8){return client['Request']('UpdateChatInteraction',{'body':_0x3276e8,'options':{'where':{'id':_0x3a331d}},'log':_0x449e('0x2')});};exports[_0x449e('0x3')]=function(_0x1421ce,_0x2f97c9){return client['Request'](_0x449e('0x4'),{'body':_0x2f97c9,'options':{'where':{'id':_0x1421ce}},'log':_0x449e('0x5')});}; \ No newline at end of file +var _0xca21=['../client','Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x2ed9ed,_0x365e99){var _0xd3c220=function(_0x453154){while(--_0x453154){_0x2ed9ed['push'](_0x2ed9ed['shift']());}};_0xd3c220(++_0x365e99);}(_0xca21,0x70));var _0x1ca2=function(_0x30ed4f,_0x3d4599){_0x30ed4f=_0x30ed4f-0x0;var _0x4137ee=_0xca21[_0x30ed4f];return _0x4137ee;};'use strict';var client=require(_0x1ca2('0x0'));exports['update']=function(_0x11f659,_0xd6e89f){return client[_0x1ca2('0x1')](_0x1ca2('0x2'),{'body':_0xd6e89f,'options':{'where':{'id':_0x11f659}},'log':_0x1ca2('0x3')});};exports[_0x1ca2('0x4')]=function(_0x5aab73,_0x2e2036){return client[_0x1ca2('0x1')](_0x1ca2('0x5'),{'body':_0x2e2036,'options':{'where':{'id':_0x5aab73}},'log':_0x1ca2('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index f992758..92236c1 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 _0x957f=['create','Request','CreateChatMessage'];(function(_0x3fa3e5,_0x11296d){var _0x212765=function(_0x3f04ac){while(--_0x3f04ac){_0x3fa3e5['push'](_0x3fa3e5['shift']());}};_0x212765(++_0x11296d);}(_0x957f,0x8d));var _0xf957=function(_0x2f3794,_0x3c3bec){_0x2f3794=_0x2f3794-0x0;var _0x1c9fbe=_0x957f[_0x2f3794];return _0x1c9fbe;};'use strict';var client=require('../client');exports[_0xf957('0x0')]=function(_0x4977fd){return client[_0xf957('0x1')](_0xf957('0x2'),{'body':_0x4977fd,'log':'createChatMessage'});}; \ No newline at end of file +var _0x2727=['CreateChatMessage','createChatMessage','create','Request'];(function(_0x51e0a1,_0x7b2025){var _0x1f3cb1=function(_0x2c28d3){while(--_0x2c28d3){_0x51e0a1['push'](_0x51e0a1['shift']());}};_0x1f3cb1(++_0x7b2025);}(_0x2727,0x11a));var _0x7272=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x2727[_0x40ac5e];return _0x2839d6;};'use strict';var client=require('../client');exports[_0x7272('0x0')]=function(_0xceff50){return client[_0x7272('0x1')](_0x7272('0x2'),{'body':_0xceff50,'log':_0x7272('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index ca953ca..b56edc3 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 _0x14f5=['name','timeout','User','Agents','online','chatPause','getChatQueues','GetChatQueue'];(function(_0x2e583a,_0x413256){var _0xacb1c7=function(_0x2f48f0){while(--_0x2f48f0){_0x2e583a['push'](_0x2e583a['shift']());}};_0xacb1c7(++_0x413256);}(_0x14f5,0xae));var _0x514f=function(_0x345aab,_0x18b7af){_0x345aab=_0x345aab-0x0;var _0x37d787=_0x14f5[_0x345aab];return _0x37d787;};'use strict';var client=require('../client');exports[_0x514f('0x0')]=function(){return function(){return client['Request'](_0x514f('0x1'),{'options':{'raw':![],'attributes':['id',_0x514f('0x2'),_0x514f('0x3'),'strategy'],'include':[{'model':_0x514f('0x4'),'as':_0x514f('0x5'),'attributes':['id','name',_0x514f('0x6'),_0x514f('0x7')]}]},'log':_0x514f('0x0')});};}; \ No newline at end of file +var _0x4873=['getChatQueues','Request','name','User','Agents','online','chatPause','../client'];(function(_0x288802,_0x224edf){var _0x1ad1b8=function(_0x3ae43f){while(--_0x3ae43f){_0x288802['push'](_0x288802['shift']());}};_0x1ad1b8(++_0x224edf);}(_0x4873,0x1df));var _0x3487=function(_0x2348ad,_0x1be809){_0x2348ad=_0x2348ad-0x0;var _0x2faab7=_0x4873[_0x2348ad];return _0x2faab7;};'use strict';var client=require(_0x3487('0x0'));exports[_0x3487('0x1')]=function(){return function(){return client[_0x3487('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x3487('0x3'),'timeout','strategy'],'include':[{'model':_0x3487('0x4'),'as':_0x3487('0x5'),'attributes':['id',_0x3487('0x3'),_0x3487('0x6'),_0x3487('0x7')]}]},'log':_0x3487('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 5b58741..e1b6321 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 _0x87df=['create','Request','CreateChatQueueReport','update','UpdateChatQueueReport','../client'];(function(_0x4bdeef,_0x3a0661){var _0x350394=function(_0x9893f0){while(--_0x9893f0){_0x4bdeef['push'](_0x4bdeef['shift']());}};_0x350394(++_0x3a0661);}(_0x87df,0x167));var _0xf87d=function(_0x5a64eb,_0x286782){_0x5a64eb=_0x5a64eb-0x0;var _0x3ad930=_0x87df[_0x5a64eb];return _0x3ad930;};'use strict';var client=require(_0xf87d('0x0'));exports[_0xf87d('0x1')]=function(_0x34023a){return client[_0xf87d('0x2')](_0xf87d('0x3'),{'body':_0x34023a,'log':_0xf87d('0x3')});};exports[_0xf87d('0x4')]=function(_0xb0fb5a,_0x25290a){return client[_0xf87d('0x2')]('UpdateChatQueueReport',{'body':_0x25290a,'options':{'where':{'uniqueid':_0xb0fb5a},'order':[['id','DESC']],'limit':0x1},'log':_0xf87d('0x5')});}; \ No newline at end of file +var _0xbb53=['UpdateChatQueueReport','../client','create','Request','CreateChatQueueReport','update'];(function(_0x142364,_0x4c52f4){var _0x4f393d=function(_0x44292a){while(--_0x44292a){_0x142364['push'](_0x142364['shift']());}};_0x4f393d(++_0x4c52f4);}(_0xbb53,0x121));var _0x3bb5=function(_0x3e20f8,_0x57a9c5){_0x3e20f8=_0x3e20f8-0x0;var _0x657a6e=_0xbb53[_0x3e20f8];return _0x657a6e;};'use strict';var client=require(_0x3bb5('0x0'));exports[_0x3bb5('0x1')]=function(_0x3409b4){return client[_0x3bb5('0x2')](_0x3bb5('0x3'),{'body':_0x3409b4,'log':_0x3bb5('0x3')});};exports[_0x3bb5('0x4')]=function(_0x3918b9,_0x83e44b){return client[_0x3bb5('0x2')]('UpdateChatQueueReport',{'body':_0x83e44b,'options':{'where':{'uniqueid':_0x3918b9},'order':[['id','DESC']],'limit':0x1},'log':_0x3bb5('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 4ffeabb..9e08d79 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x1e5cc3,_0x238a87){var _0x15c596=function(_0x27bb04){while(--_0x27bb04){_0x1e5cc3['push'](_0x1e5cc3['shift']());}};_0x15c596(++_0x238a87);}(_0x7a54,0x106));var _0x47a5=function(_0x178166,_0x64b2e2){_0x178166=_0x178166-0x0;var _0x4f5c6b=_0x7a54[_0x178166];return _0x4f5c6b;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x2ecc65,_0xd75c48){var _0x103cc3=function(_0x3f856b){while(--_0x3f856b){_0x2ecc65['push'](_0x2ecc65['shift']());}};_0x103cc3(++_0xd75c48);}(_0x7a54,0x106));var _0x47a5=function(_0x2fd539,_0x311627){_0x2fd539=_0x2fd539-0x0;var _0x5d9bd4=_0x7a54[_0x2fd539];return _0x5d9bd4;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 2f72678..5e3ae61 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 _0x8f2d=['../client','create','Request','CreateFaxMessage'];(function(_0x2f1343,_0x59bd6a){var _0x2d8268=function(_0x2844e9){while(--_0x2844e9){_0x2f1343['push'](_0x2f1343['shift']());}};_0x2d8268(++_0x59bd6a);}(_0x8f2d,0x1a0));var _0xd8f2=function(_0x3a08a6,_0x22ffa3){_0x3a08a6=_0x3a08a6-0x0;var _0x460bfb=_0x8f2d[_0x3a08a6];return _0x460bfb;};'use strict';var client=require(_0xd8f2('0x0'));exports[_0xd8f2('0x1')]=function(_0x4faaf5){return client[_0xd8f2('0x2')](_0xd8f2('0x3'),{'body':_0x4faaf5,'log':'createFaxMessage'});}; \ No newline at end of file +var _0x82dc=['CreateFaxMessage','../client','create','Request'];(function(_0x19a5d8,_0x347207){var _0x30104a=function(_0x292695){while(--_0x292695){_0x19a5d8['push'](_0x19a5d8['shift']());}};_0x30104a(++_0x347207);}(_0x82dc,0x125));var _0xc82d=function(_0x520b5c,_0x211b92){_0x520b5c=_0x520b5c-0x0;var _0xc58a31=_0x82dc[_0x520b5c];return _0xc58a31;};'use strict';var client=require(_0xc82d('0x0'));exports[_0xc82d('0x1')]=function(_0x4c2cba){return client[_0xc82d('0x2')](_0xc82d('0x3'),{'body':_0x4c2cba,'log':'createFaxMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 9b8f8c0..7327837 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 _0xc81c=['timeout','User','online','../client','getFaxQueues','Request','GetFaxQueue','name'];(function(_0x548627,_0x4ec392){var _0x844a84=function(_0x2ffdd2){while(--_0x2ffdd2){_0x548627['push'](_0x548627['shift']());}};_0x844a84(++_0x4ec392);}(_0xc81c,0x153));var _0xcc81=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0xc81c[_0x23e7c1];return _0x1add43;};'use strict';var client=require(_0xcc81('0x0'));exports[_0xcc81('0x1')]=function(){return function(){return client[_0xcc81('0x2')](_0xcc81('0x3'),{'options':{'raw':![],'attributes':['id',_0xcc81('0x4'),_0xcc81('0x5'),'strategy'],'include':[{'model':_0xcc81('0x6'),'as':'Agents','attributes':['id',_0xcc81('0x4'),_0xcc81('0x7'),'faxPause']}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x9c73=['getFaxQueues','../client','Request','name','online'];(function(_0x3e9ba9,_0x3d41cc){var _0x241f6a=function(_0xce1336){while(--_0xce1336){_0x3e9ba9['push'](_0x3e9ba9['shift']());}};_0x241f6a(++_0x3d41cc);}(_0x9c73,0xbf));var _0x39c7=function(_0x3edd5b,_0x77556f){_0x3edd5b=_0x3edd5b-0x0;var _0x390bc9=_0x9c73[_0x3edd5b];return _0x390bc9;};'use strict';var client=require(_0x39c7('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x39c7('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x39c7('0x2'),'timeout','strategy'],'include':[{'model':'User','as':'Agents','attributes':['id','name',_0x39c7('0x3'),'faxPause']}]},'log':_0x39c7('0x4')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index a7a5797..dc2999d 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 _0xaea9=['update','UpdateFaxQueueReport','DESC','../client','create','Request','CreateFaxQueueReport'];(function(_0x2902d7,_0x2d3ea2){var _0x375d64=function(_0x2f6cae){while(--_0x2f6cae){_0x2902d7['push'](_0x2902d7['shift']());}};_0x375d64(++_0x2d3ea2);}(_0xaea9,0x81));var _0x9aea=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xaea9[_0xf0bcac];return _0x4e4c65;};'use strict';var client=require(_0x9aea('0x0'));exports[_0x9aea('0x1')]=function(_0x644ef6){return client[_0x9aea('0x2')]('CreateFaxQueueReport',{'body':_0x644ef6,'log':_0x9aea('0x3')});};exports[_0x9aea('0x4')]=function(_0x10d4e8,_0x125499){return client[_0x9aea('0x2')](_0x9aea('0x5'),{'body':_0x125499,'options':{'where':{'uniqueid':_0x10d4e8},'order':[['id',_0x9aea('0x6')]],'limit':0x1},'log':_0x9aea('0x5')});}; \ No newline at end of file +var _0x02e2=['../client','CreateFaxQueueReport','update','Request','UpdateFaxQueueReport','DESC'];(function(_0x12c1f8,_0x2b88c2){var _0x2d3931=function(_0x332fc2){while(--_0x332fc2){_0x12c1f8['push'](_0x12c1f8['shift']());}};_0x2d3931(++_0x2b88c2);}(_0x02e2,0xa8));var _0x202e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x02e2[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x202e('0x0'));exports['create']=function(_0x5811f6){return client['Request']('CreateFaxQueueReport',{'body':_0x5811f6,'log':_0x202e('0x1')});};exports[_0x202e('0x2')]=function(_0x3e4194,_0x237bdb){return client[_0x202e('0x3')](_0x202e('0x4'),{'body':_0x237bdb,'options':{'where':{'uniqueid':_0x3e4194},'order':[['id',_0x202e('0x5')]],'limit':0x1},'log':_0x202e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 0170c49..74fa8c3 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 _0x6cd4=['Request','GetInterval','name','Intervals','getIntervals'];(function(_0x2d9b64,_0x7ea1b6){var _0xbf8b54=function(_0x2ce0ce){while(--_0x2ce0ce){_0x2d9b64['push'](_0x2d9b64['shift']());}};_0xbf8b54(++_0x7ea1b6);}(_0x6cd4,0x9a));var _0x46cd=function(_0x457ef8,_0x1a19ae){_0x457ef8=_0x457ef8-0x0;var _0x596c56=_0x6cd4[_0x457ef8];return _0x596c56;};'use strict';var client=require('../client');exports[_0x46cd('0x0')]=function(){return function(){return client[_0x46cd('0x1')](_0x46cd('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x46cd('0x3')],'include':[{'model':'Interval','as':_0x46cd('0x4'),'attributes':['id','name','interval']}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0xfb29=['interval','../client','getIntervals','GetInterval','Intervals','name'];(function(_0x832db3,_0x52f6bd){var _0xbd5246=function(_0x40e8b4){while(--_0x40e8b4){_0x832db3['push'](_0x832db3['shift']());}};_0xbd5246(++_0x52f6bd);}(_0xfb29,0x10f));var _0x9fb2=function(_0x24066b,_0x50e580){_0x24066b=_0x24066b-0x0;var _0x2229ea=_0xfb29[_0x24066b];return _0x2229ea;};'use strict';var client=require(_0x9fb2('0x0'));exports[_0x9fb2('0x1')]=function(){return function(){return client['Request'](_0x9fb2('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':'Interval','as':_0x9fb2('0x3'),'attributes':['id',_0x9fb2('0x4'),_0x9fb2('0x5')]}]},'log':_0x9fb2('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index fc81be8..3176204 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 _0xd943=['addTagsToChatInteraction','../client','update','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0x395410,_0x122809){var _0x101300=function(_0x5574a7){while(--_0x5574a7){_0x395410['push'](_0x395410['shift']());}};_0x101300(++_0x122809);}(_0xd943,0x15d));var _0x3d94=function(_0x11e857,_0x2a799c){_0x11e857=_0x11e857-0x0;var _0x1911a0=_0xd943[_0x11e857];return _0x1911a0;};'use strict';var client=require(_0x3d94('0x0'));exports[_0x3d94('0x1')]=function(_0x55353d,_0x440dd8){return client['Request'](_0x3d94('0x2'),{'body':_0x440dd8,'options':{'where':{'id':_0x55353d}},'log':_0x3d94('0x3')});};exports[_0x3d94('0x4')]=function(_0xc13b61,_0xaf8962){return client['Request']('AddTagsToMailInteraction',{'body':_0xaf8962,'options':{'where':{'id':_0xc13b61}},'log':_0x3d94('0x5')});}; \ No newline at end of file +var _0x7708=['update','AddTagsToMailInteraction','../client'];(function(_0x1e1685,_0x17f783){var _0x5e18f5=function(_0x5d6e15){while(--_0x5d6e15){_0x1e1685['push'](_0x1e1685['shift']());}};_0x5e18f5(++_0x17f783);}(_0x7708,0x188));var _0x8770=function(_0x323419,_0x2a6172){_0x323419=_0x323419-0x0;var _0x4c0be7=_0x7708[_0x323419];return _0x4c0be7;};'use strict';var client=require(_0x8770('0x0'));exports[_0x8770('0x1')]=function(_0x5ce108,_0x141ddf){return client['Request']('UpdateMailInteraction',{'body':_0x141ddf,'options':{'where':{'id':_0x5ce108}},'log':'updateMailInteraction'});};exports['addTags']=function(_0x182d52,_0x1a796d){return client['Request'](_0x8770('0x2'),{'body':_0x1a796d,'options':{'where':{'id':_0x182d52}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 0654363..c2ff9a5 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 _0xac77=['CreateMailMessage','../client','create','Request'];(function(_0x3d902a,_0x1ec9b1){var _0x894aac=function(_0x3b79d6){while(--_0x3b79d6){_0x3d902a['push'](_0x3d902a['shift']());}};_0x894aac(++_0x1ec9b1);}(_0xac77,0x79));var _0x7ac7=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xac77[_0x4b055c];return _0x4b62bb;};'use strict';var client=require(_0x7ac7('0x0'));exports[_0x7ac7('0x1')]=function(_0x17fd75){return client[_0x7ac7('0x2')](_0x7ac7('0x3'),{'body':_0x17fd75,'log':'createMailMessage'});}; \ No newline at end of file +var _0xb29e=['Request','CreateMailMessage','createMailMessage'];(function(_0x55b32d,_0x496cc1){var _0x20e779=function(_0x54964b){while(--_0x54964b){_0x55b32d['push'](_0x55b32d['shift']());}};_0x20e779(++_0x496cc1);}(_0xb29e,0x1da));var _0xeb29=function(_0x4dd0a7,_0xb4399f){_0x4dd0a7=_0x4dd0a7-0x0;var _0x487e9b=_0xb29e[_0x4dd0a7];return _0x487e9b;};'use strict';var client=require('../client');exports['create']=function(_0x3144b3){return client[_0xeb29('0x0')](_0xeb29('0x1'),{'body':_0x3144b3,'log':_0xeb29('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 58b4f0f..60e2524 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 _0x889e=['name','timeout','strategy','User','Agents','online','mailPause','../client','getMailQueues','GetMailQueue'];(function(_0x1d054c,_0x4d8a67){var _0x1f57fe=function(_0x42b1a8){while(--_0x42b1a8){_0x1d054c['push'](_0x1d054c['shift']());}};_0x1f57fe(++_0x4d8a67);}(_0x889e,0x183));var _0xe889=function(_0x697b06,_0x32d71c){_0x697b06=_0x697b06-0x0;var _0x343145=_0x889e[_0x697b06];return _0x343145;};'use strict';var client=require(_0xe889('0x0'));exports[_0xe889('0x1')]=function(){return function(){return client['Request'](_0xe889('0x2'),{'options':{'raw':![],'attributes':['id',_0xe889('0x3'),_0xe889('0x4'),_0xe889('0x5')],'include':[{'model':_0xe889('0x6'),'as':_0xe889('0x7'),'attributes':['id',_0xe889('0x3'),_0xe889('0x8'),_0xe889('0x9')]}]},'log':_0xe889('0x1')});};}; \ No newline at end of file +var _0x3123=['name','timeout','strategy','Agents','online','mailPause','../client','Request','GetMailQueue'];(function(_0x5d49ca,_0x43fcb2){var _0x53e0c9=function(_0x16867d){while(--_0x16867d){_0x5d49ca['push'](_0x5d49ca['shift']());}};_0x53e0c9(++_0x43fcb2);}(_0x3123,0xc3));var _0x3312=function(_0x102a83,_0x7dd17e){_0x102a83=_0x102a83-0x0;var _0x318f72=_0x3123[_0x102a83];return _0x318f72;};'use strict';var client=require(_0x3312('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x3312('0x1')](_0x3312('0x2'),{'options':{'raw':![],'attributes':['id',_0x3312('0x3'),_0x3312('0x4'),_0x3312('0x5')],'include':[{'model':'User','as':_0x3312('0x6'),'attributes':['id',_0x3312('0x3'),_0x3312('0x7'),_0x3312('0x8')]}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 50af164..f54fdee 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 _0xf6b5=['CreateMailQueueReport','update','DESC','UpdateMailQueueReport','../client','create','Request'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf6b5,0x1a1));var _0x5f6b=function(_0x513047,_0x2199c5){_0x513047=_0x513047-0x0;var _0x15b779=_0xf6b5[_0x513047];return _0x15b779;};'use strict';var client=require(_0x5f6b('0x0'));exports[_0x5f6b('0x1')]=function(_0x193f6d){return client[_0x5f6b('0x2')](_0x5f6b('0x3'),{'body':_0x193f6d,'log':_0x5f6b('0x3')});};exports[_0x5f6b('0x4')]=function(_0x24e697,_0x4e8cac){return client[_0x5f6b('0x2')]('UpdateMailQueueReport',{'body':_0x4e8cac,'options':{'where':{'uniqueid':_0x24e697},'order':[['id',_0x5f6b('0x5')]],'limit':0x1},'log':_0x5f6b('0x6')});}; \ No newline at end of file +var _0xc037=['CreateMailQueueReport','update','UpdateMailQueueReport','create','Request'];(function(_0x3a75d2,_0x300b9d){var _0x28d608=function(_0x219c1a){while(--_0x219c1a){_0x3a75d2['push'](_0x3a75d2['shift']());}};_0x28d608(++_0x300b9d);}(_0xc037,0x12a));var _0x7c03=function(_0x460459,_0x36d04c){_0x460459=_0x460459-0x0;var _0x15f70e=_0xc037[_0x460459];return _0x15f70e;};'use strict';var client=require('../client');exports[_0x7c03('0x0')]=function(_0x517d27){return client[_0x7c03('0x1')](_0x7c03('0x2'),{'body':_0x517d27,'log':_0x7c03('0x2')});};exports[_0x7c03('0x3')]=function(_0x4a5ce4,_0x3db67d){return client['Request']('UpdateMailQueueReport',{'body':_0x3db67d,'options':{'where':{'uniqueid':_0x4a5ce4},'order':[['id','DESC']],'limit':0x1},'log':_0x7c03('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 0aa523a..3a7c21c 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 _0x268f=['addTagsToChatInteraction','../client','update','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction'];(function(_0x4d2c9f,_0x56b303){var _0x14bfd5=function(_0x28f87a){while(--_0x28f87a){_0x4d2c9f['push'](_0x4d2c9f['shift']());}};_0x14bfd5(++_0x56b303);}(_0x268f,0x120));var _0xf268=function(_0x5f063e,_0x369330){_0x5f063e=_0x5f063e-0x0;var _0x2c9bae=_0x268f[_0x5f063e];return _0x2c9bae;};'use strict';var client=require(_0xf268('0x0'));exports[_0xf268('0x1')]=function(_0x25dacf,_0x162d35){return client['Request'](_0xf268('0x2'),{'body':_0x162d35,'options':{'where':{'id':_0x25dacf}},'log':_0xf268('0x3')});};exports[_0xf268('0x4')]=function(_0x503cdb,_0xeb7ef){return client['Request'](_0xf268('0x5'),{'body':_0xeb7ef,'options':{'where':{'id':_0x503cdb}},'log':_0xf268('0x6')});}; \ No newline at end of file +var _0x2e3f=['update','updateOpenchannelInteraction','addTags','Request','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x263040,_0x52968f){var _0x366100=function(_0x5dd3ab){while(--_0x5dd3ab){_0x263040['push'](_0x263040['shift']());}};_0x366100(++_0x52968f);}(_0x2e3f,0x18c));var _0xf2e3=function(_0x1e3e34,_0x1e7dfe){_0x1e3e34=_0x1e3e34-0x0;var _0x167846=_0x2e3f[_0x1e3e34];return _0x167846;};'use strict';var client=require('../client');exports[_0xf2e3('0x0')]=function(_0x552393,_0x13b1fb){return client['Request']('UpdateOpenchannelInteraction',{'body':_0x13b1fb,'options':{'where':{'id':_0x552393}},'log':_0xf2e3('0x1')});};exports[_0xf2e3('0x2')]=function(_0x4105b1,_0x3ae49){return client[_0xf2e3('0x3')](_0xf2e3('0x4'),{'body':_0x3ae49,'options':{'where':{'id':_0x4105b1}},'log':_0xf2e3('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 56241c8..f94f6cf 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 _0x8147=['../client','Request'];(function(_0x3a1620,_0x4452ee){var _0x23f77d=function(_0x20023c){while(--_0x20023c){_0x3a1620['push'](_0x3a1620['shift']());}};_0x23f77d(++_0x4452ee);}(_0x8147,0x146));var _0x7814=function(_0x1e72c5,_0x570107){_0x1e72c5=_0x1e72c5-0x0;var _0x526b43=_0x8147[_0x1e72c5];return _0x526b43;};'use strict';var client=require(_0x7814('0x0'));exports['create']=function(_0xfbed9e){return client[_0x7814('0x1')]('CreateOpenchannelMessage',{'body':_0xfbed9e,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0x4138=['CreateOpenchannelMessage','../client','create','Request'];(function(_0x2252f9,_0x52db78){var _0x1e0f22=function(_0x424a27){while(--_0x424a27){_0x2252f9['push'](_0x2252f9['shift']());}};_0x1e0f22(++_0x52db78);}(_0x4138,0xcd));var _0x8413=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x4138[_0x6c993a];return _0x27f547;};'use strict';var client=require(_0x8413('0x0'));exports[_0x8413('0x1')]=function(_0xaa6e89){return client[_0x8413('0x2')](_0x8413('0x3'),{'body':_0xaa6e89,'log':'createOpenchannelMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index d532569..7f7162b 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 _0xf99f=['GetOpenchannelQueue','name','strategy','User','Agents','openchannelPause','../client','getOpenchannelQueues','Request'];(function(_0x2e7048,_0x7d3095){var _0x9575ee=function(_0x568fde){while(--_0x568fde){_0x2e7048['push'](_0x2e7048['shift']());}};_0x9575ee(++_0x7d3095);}(_0xf99f,0x180));var _0xff99=function(_0x533e4e,_0x4eba54){_0x533e4e=_0x533e4e-0x0;var _0x1f14bb=_0xf99f[_0x533e4e];return _0x1f14bb;};'use strict';var client=require(_0xff99('0x0'));exports[_0xff99('0x1')]=function(){return function(){return client[_0xff99('0x2')](_0xff99('0x3'),{'options':{'raw':![],'attributes':['id',_0xff99('0x4'),'timeout',_0xff99('0x5')],'include':[{'model':_0xff99('0x6'),'as':_0xff99('0x7'),'attributes':['id','name','online',_0xff99('0x8')]}]},'log':_0xff99('0x1')});};}; \ No newline at end of file +var _0x37dc=['GetOpenchannelQueue','timeout','User','../client','getOpenchannelQueues','Request'];(function(_0x129e27,_0x4f87d3){var _0x802f6b=function(_0x1f257f){while(--_0x1f257f){_0x129e27['push'](_0x129e27['shift']());}};_0x802f6b(++_0x4f87d3);}(_0x37dc,0x1e9));var _0xc37d=function(_0x489c25,_0x4cad82){_0x489c25=_0x489c25-0x0;var _0x5e41ee=_0x37dc[_0x489c25];return _0x5e41ee;};'use strict';var client=require(_0xc37d('0x0'));exports[_0xc37d('0x1')]=function(){return function(){return client[_0xc37d('0x2')](_0xc37d('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xc37d('0x4'),'strategy'],'include':[{'model':_0xc37d('0x5'),'as':'Agents','attributes':['id','name','online','openchannelPause']}]},'log':_0xc37d('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index e404422..e4250a9 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 _0xbd48=['UpdateOpenchannelQueueReport','DESC','../client','create','Request','CreateOpenchannelQueueReport','update'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xbd48,0x191));var _0x8bd4=function(_0x5d9035,_0x8c30eb){_0x5d9035=_0x5d9035-0x0;var _0x463920=_0xbd48[_0x5d9035];return _0x463920;};'use strict';var client=require(_0x8bd4('0x0'));exports[_0x8bd4('0x1')]=function(_0x3f9823){return client[_0x8bd4('0x2')]('CreateOpenchannelQueueReport',{'body':_0x3f9823,'log':_0x8bd4('0x3')});};exports[_0x8bd4('0x4')]=function(_0x222143,_0x3ded77){return client['Request'](_0x8bd4('0x5'),{'body':_0x3ded77,'options':{'where':{'uniqueid':_0x222143},'order':[['id',_0x8bd4('0x6')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0xb74d=['DESC','../client','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x335ced,_0x2bd662){var _0xc92ace=function(_0xe4dd17){while(--_0xe4dd17){_0x335ced['push'](_0x335ced['shift']());}};_0xc92ace(++_0x2bd662);}(_0xb74d,0x16e));var _0xdb74=function(_0x4ac60a,_0x503a99){_0x4ac60a=_0x4ac60a-0x0;var _0x4b22e8=_0xb74d[_0x4ac60a];return _0x4b22e8;};'use strict';var client=require(_0xdb74('0x0'));exports['create']=function(_0x350d0d){return client['Request'](_0xdb74('0x1'),{'body':_0x350d0d,'log':'CreateOpenchannelQueueReport'});};exports[_0xdb74('0x2')]=function(_0x30d1e5,_0x61bd15){return client['Request'](_0xdb74('0x3'),{'body':_0x61bd15,'options':{'where':{'uniqueid':_0x30d1e5},'order':[['id',_0xdb74('0x4')]],'limit':0x1},'log':_0xdb74('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index e9cf2cb..8b9fefd 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 _0x20d7=['Request'];(function(_0x2deeab,_0x3ca922){var _0x29a9a0=function(_0x51e567){while(--_0x51e567){_0x2deeab['push'](_0x2deeab['shift']());}};_0x29a9a0(++_0x3ca922);}(_0x20d7,0x146));var _0x720d=function(_0xa39c4e,_0x14741e){_0xa39c4e=_0xa39c4e-0x0;var _0x441665=_0x20d7[_0xa39c4e];return _0x441665;};'use strict';var client=require('../client');exports['update']=function(_0x5583f5,_0x686ffb){return client[_0x720d('0x0')]('UpdateSmsInteraction',{'body':_0x686ffb,'options':{'where':{'id':_0x5583f5}},'log':'updateSmsInteraction'});};exports['addTags']=function(_0x3a9884,_0x241e8d){return client['Request']('AddTagsToSmsInteraction',{'body':_0x241e8d,'options':{'where':{'id':_0x3a9884}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0x4bc3=['AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request','updateSmsInteraction','addTags'];(function(_0x4f668f,_0x2e75c0){var _0x313d61=function(_0x5ddb8d){while(--_0x5ddb8d){_0x4f668f['push'](_0x4f668f['shift']());}};_0x313d61(++_0x2e75c0);}(_0x4bc3,0x16e));var _0x34bc=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0x4bc3[_0x31ced5];return _0x10d9e5;};'use strict';var client=require(_0x34bc('0x0'));exports[_0x34bc('0x1')]=function(_0x4a6fe8,_0x14787d){return client[_0x34bc('0x2')]('UpdateSmsInteraction',{'body':_0x14787d,'options':{'where':{'id':_0x4a6fe8}},'log':_0x34bc('0x3')});};exports[_0x34bc('0x4')]=function(_0x3ce1c3,_0x2e043e){return client[_0x34bc('0x2')](_0x34bc('0x5'),{'body':_0x2e043e,'options':{'where':{'id':_0x3ce1c3}},'log':_0x34bc('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 218a3c4..0e182f4 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 _0xa03f=['CreateSmsMessage','createSmsMessage','../client'];(function(_0x368e09,_0x2c1517){var _0x14b7df=function(_0x5002af){while(--_0x5002af){_0x368e09['push'](_0x368e09['shift']());}};_0x14b7df(++_0x2c1517);}(_0xa03f,0x68));var _0xfa03=function(_0x2d03ac,_0x281e77){_0x2d03ac=_0x2d03ac-0x0;var _0x2f55d2=_0xa03f[_0x2d03ac];return _0x2f55d2;};'use strict';var client=require(_0xfa03('0x0'));exports['create']=function(_0x467246){return client['Request'](_0xfa03('0x1'),{'body':_0x467246,'log':_0xfa03('0x2')});}; \ No newline at end of file +var _0x8cd1=['../client','create','CreateSmsMessage','createSmsMessage'];(function(_0x1cd633,_0x21c3db){var _0x5bf6d8=function(_0x19de57){while(--_0x19de57){_0x1cd633['push'](_0x1cd633['shift']());}};_0x5bf6d8(++_0x21c3db);}(_0x8cd1,0x134));var _0x18cd=function(_0xf0f0f8,_0x57d063){_0xf0f0f8=_0xf0f0f8-0x0;var _0x15007b=_0x8cd1[_0xf0f0f8];return _0x15007b;};'use strict';var client=require(_0x18cd('0x0'));exports[_0x18cd('0x1')]=function(_0x12ef18){return client['Request'](_0x18cd('0x2'),{'body':_0x12ef18,'log':_0x18cd('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index ac0b749..2de3455 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 _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x580b15,_0x28afa4){var _0x1adb1b=function(_0x47a01f){while(--_0x47a01f){_0x580b15['push'](_0x580b15['shift']());}};_0x1adb1b(++_0x28afa4);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file +var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x467b39,_0xcb5ca7){var _0x3f78b2=function(_0x5e17f6){while(--_0x5e17f6){_0x467b39['push'](_0x467b39['shift']());}};_0x3f78b2(++_0xcb5ca7);}(_0x70e0,0x17b));var _0x070e=function(_0x17a825,_0x24161b){_0x17a825=_0x17a825-0x0;var _0x57e2f6=_0x70e0[_0x17a825];return _0x57e2f6;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index aab6731..b104674 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 _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0x30ad5d,_0x1ac088){var _0x3a86e9=function(_0x4f2b90){while(--_0x4f2b90){_0x30ad5d['push'](_0x30ad5d['shift']());}};_0x3a86e9(++_0x1ac088);}(_0x55ca,0x126));var _0xa55c=function(_0x2f71c1,_0x319017){_0x2f71c1=_0x2f71c1-0x0;var _0x411bb7=_0x55ca[_0x2f71c1];return _0x411bb7;};'use strict';var client=require(_0xa55c('0x0'));exports[_0xa55c('0x1')]=function(_0x4e78b4){return client['Request']('CreateSmsQueueReport',{'body':_0x4e78b4,'log':_0xa55c('0x2')});};exports[_0xa55c('0x3')]=function(_0x5dc716,_0x3b478a){return client[_0xa55c('0x4')](_0xa55c('0x5'),{'body':_0x3b478a,'options':{'where':{'uniqueid':_0x5dc716},'order':[['id',_0xa55c('0x6')]],'limit':0x1},'log':_0xa55c('0x5')});}; \ No newline at end of file +var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x3d905,_0x7b688d){var _0x3a990b=function(_0x5b79a6){while(--_0x5b79a6){_0x3d905['push'](_0x3d905['shift']());}};_0x3a990b(++_0x7b688d);}(_0x008c,0x188));var _0xc008=function(_0x5f49a2,_0x54b7ed){_0x5f49a2=_0x5f49a2-0x0;var _0x2e49ac=_0x008c[_0x5f49a2];return _0x2e49ac;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 5c62f5c..1051589 100644 --- a/server/services/routing/rpc/user.js +++ b/server/services/routing/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x19df30,_0x59a15e){var _0x5ae3ca=function(_0x577ca3){while(--_0x577ca3){_0x19df30['push'](_0x19df30['shift']());}};_0x5ae3ca(++_0x59a15e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file +var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x39ea26,_0x5947b2){var _0x6109ec=function(_0x3a645c){while(--_0x3a645c){_0x39ea26['push'](_0x39ea26['shift']());}};_0x6109ec(++_0x5947b2);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index a496091..7908276 100644 --- a/server/services/routing/rpc/whatsappInteraction.js +++ b/server/services/routing/rpc/whatsappInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x81c6=['update','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','Request','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction'];(function(_0x2d706d,_0x55a681){var _0x2d8645=function(_0x2e1773){while(--_0x2e1773){_0x2d706d['push'](_0x2d706d['shift']());}};_0x2d8645(++_0x55a681);}(_0x81c6,0x1d5));var _0x681c=function(_0x37644a,_0x1a223a){_0x37644a=_0x37644a-0x0;var _0x48c516=_0x81c6[_0x37644a];return _0x48c516;};'use strict';var client=require('../client');exports[_0x681c('0x0')]=function(_0x5e54d4,_0x59c03c){return client['Request'](_0x681c('0x1'),{'body':_0x59c03c,'options':{'where':{'id':_0x5e54d4}},'log':_0x681c('0x2')});};exports[_0x681c('0x3')]=function(_0x5566e5,_0x44c18e){return client[_0x681c('0x4')](_0x681c('0x5'),{'body':_0x44c18e,'options':{'where':{'id':_0x5566e5}},'log':_0x681c('0x6')});}; \ No newline at end of file +var _0xac6a=['AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','updateWhatsappInteraction'];(function(_0x4a771a,_0x241c0b){var _0x5ba097=function(_0x1913bf){while(--_0x1913bf){_0x4a771a['push'](_0x4a771a['shift']());}};_0x5ba097(++_0x241c0b);}(_0xac6a,0xc2));var _0xaac6=function(_0x45fd62,_0x4098c9){_0x45fd62=_0x45fd62-0x0;var _0x391178=_0xac6a[_0x45fd62];return _0x391178;};'use strict';var client=require(_0xaac6('0x0'));exports[_0xaac6('0x1')]=function(_0x2e9ec8,_0x10ccdc){return client[_0xaac6('0x2')]('UpdateWhatsappInteraction',{'body':_0x10ccdc,'options':{'where':{'id':_0x2e9ec8}},'log':_0xaac6('0x3')});};exports['addTags']=function(_0x9dc043,_0x1a0d76){return client[_0xaac6('0x2')](_0xaac6('0x4'),{'body':_0x1a0d76,'options':{'where':{'id':_0x9dc043}},'log':_0xaac6('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index e612e93..98a0baa 100644 --- a/server/services/routing/rpc/whatsappMessage.js +++ b/server/services/routing/rpc/whatsappMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcfab=['../client','Request'];(function(_0x29e7fa,_0x231b9c){var _0x93b500=function(_0x23d559){while(--_0x23d559){_0x29e7fa['push'](_0x29e7fa['shift']());}};_0x93b500(++_0x231b9c);}(_0xcfab,0x1cc));var _0xbcfa=function(_0x2e1b21,_0x506b7b){_0x2e1b21=_0x2e1b21-0x0;var _0x5b0802=_0xcfab[_0x2e1b21];return _0x5b0802;};'use strict';var client=require(_0xbcfa('0x0'));exports['create']=function(_0x32976a){return client[_0xbcfa('0x1')]('CreateWhatsappMessage',{'body':_0x32976a,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0xc5c6=['CreateWhatsappMessage','createWhatsappMessage','Request'];(function(_0x19c01d,_0x195bf3){var _0x7be3b0=function(_0x2a6000){while(--_0x2a6000){_0x19c01d['push'](_0x19c01d['shift']());}};_0x7be3b0(++_0x195bf3);}(_0xc5c6,0x6b));var _0x6c5c=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xc5c6[_0x1203f];return _0x365f0a;};'use strict';var client=require('../client');exports['create']=function(_0x288d81){return client[_0x6c5c('0x0')](_0x6c5c('0x1'),{'body':_0x288d81,'log':_0x6c5c('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 7837196..652394c 100644 --- a/server/services/routing/rpc/whatsappQueue.js +++ b/server/services/routing/rpc/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x22ce=['strategy','online','getWhatsappQueues','../client','Request','GetWhatsappQueue','name','timeout'];(function(_0x8b4966,_0x1f4ec3){var _0x4e3470=function(_0x3edd92){while(--_0x3edd92){_0x8b4966['push'](_0x8b4966['shift']());}};_0x4e3470(++_0x1f4ec3);}(_0x22ce,0x113));var _0xe22c=function(_0x35631e,_0x241ac0){_0x35631e=_0x35631e-0x0;var _0x19d065=_0x22ce[_0x35631e];return _0x19d065;};'use strict';var client=require(_0xe22c('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0xe22c('0x1')](_0xe22c('0x2'),{'options':{'raw':![],'attributes':['id',_0xe22c('0x3'),_0xe22c('0x4'),_0xe22c('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id',_0xe22c('0x3'),_0xe22c('0x6'),'whatsappPause']}]},'log':_0xe22c('0x7')});};}; \ No newline at end of file +var _0x173d=['whatsappPause','getWhatsappQueues','Request','GetWhatsappQueue','name','strategy','User'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x173d,0xcd));var _0xd173=function(_0x166891,_0x3b58d7){_0x166891=_0x166891-0x0;var _0x5b6aaf=_0x173d[_0x166891];return _0x5b6aaf;};'use strict';var client=require('../client');exports['getWhatsappQueues']=function(){return function(){return client[_0xd173('0x0')](_0xd173('0x1'),{'options':{'raw':![],'attributes':['id',_0xd173('0x2'),'timeout',_0xd173('0x3')],'include':[{'model':_0xd173('0x4'),'as':'Agents','attributes':['id',_0xd173('0x2'),'online',_0xd173('0x5')]}]},'log':_0xd173('0x6')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index dea9b52..53cfb2d 100644 --- a/server/services/routing/rpc/whatsappQueueReport.js +++ b/server/services/routing/rpc/whatsappQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa67=['create','Request','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','DESC'];(function(_0x4d6726,_0xd1cdc2){var _0x4d0398=function(_0x171ce0){while(--_0x171ce0){_0x4d6726['push'](_0x4d6726['shift']());}};_0x4d0398(++_0xd1cdc2);}(_0xfa67,0xf5));var _0x7fa6=function(_0x3d0fb4,_0x529218){_0x3d0fb4=_0x3d0fb4-0x0;var _0x3f58c2=_0xfa67[_0x3d0fb4];return _0x3f58c2;};'use strict';var client=require('../client');exports[_0x7fa6('0x0')]=function(_0x594e3c){return client[_0x7fa6('0x1')](_0x7fa6('0x2'),{'body':_0x594e3c,'log':_0x7fa6('0x2')});};exports['update']=function(_0x2b7539,_0x1d5836){return client[_0x7fa6('0x1')](_0x7fa6('0x3'),{'body':_0x1d5836,'options':{'where':{'uniqueid':_0x2b7539},'order':[['id',_0x7fa6('0x4')]],'limit':0x1},'log':_0x7fa6('0x3')});}; \ No newline at end of file +var _0x9761=['UpdateWhatsappQueueReport','DESC','../client','create','Request'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9761,0x8e));var _0x1976=function(_0x2d796c,_0x210c1b){_0x2d796c=_0x2d796c-0x0;var _0x20bf06=_0x9761[_0x2d796c];return _0x20bf06;};'use strict';var client=require(_0x1976('0x0'));exports[_0x1976('0x1')]=function(_0x54a292){return client[_0x1976('0x2')]('CreateWhatsappQueueReport',{'body':_0x54a292,'log':'CreateWhatsappQueueReport'});};exports['update']=function(_0x22d9be,_0x115dda){return client[_0x1976('0x2')](_0x1976('0x3'),{'body':_0x115dda,'options':{'where':{'uniqueid':_0x22d9be},'order':[['id',_0x1976('0x4')]],'limit':0x1},'log':_0x1976('0x3')});}; \ 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 1a27c3b..63c0294 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 _0xc05b=['util','seq-queue','routing','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','format','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','timeout','atimeout','channel','START:%s','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][AGENT]\x20ROUTING\x20END','next','log','stack','validate','lodash'];(function(_0xfa4326,_0x116ce8){var _0x25357c=function(_0x43c582){while(--_0x43c582){_0xfa4326['push'](_0xfa4326['shift']());}};_0x25357c(++_0x116ce8);}(_0xc05b,0x152));var _0xbc05=function(_0x457b64,_0x49a219){_0x457b64=_0x457b64-0x0;var _0x437111=_0xc05b[_0x457b64];return _0x437111;};'use strict';var schema=require(_0xbc05('0x0'));var _=require(_0xbc05('0x1'));var util=require(_0xbc05('0x2'));var seqqueue=require(_0xbc05('0x3'));var logger=require('../../../../config/logger')(_0xbc05('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':_0xbc05('0x5')},'timeout':{'type':_0xbc05('0x6'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x12fda7,_0x21adfc,_0x2fd775){return logger['info'](util[_0xbc05('0x7')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x12fda7,_0x21adfc[_0xbc05('0x8')],_0x2fd775));}function handleFindAgent(_0x4fa1a6){return function(_0x38dbc8){return _0x38dbc8[_0xbc05('0x8')][_0xbc05('0x9')]()===_0x4fa1a6[_0xbc05('0x9')]();};}exports[_0xbc05('0xa')]=function(_0x258a00,_0x12f0cb,_0x86778e,_0x24f75f){return function(_0x69746c){try{var _0x492fa2={'name':_0x12f0cb[0x0],'timeout':_0x12f0cb[0x1]};var _0x4ab01a=queue[_0xbc05('0x0')](_0x492fa2,{'typecast':!![]});if(_0x4ab01a[_0xbc05('0xb')]){logger[_0xbc05('0xc')](_0xbc05('0xd'),_0x258a00,_[_0xbc05('0xe')](_0x4ab01a,_0xbc05('0xf'))[_0xbc05('0x10')](',\x20'));_0x69746c[_0xbc05('0x11')]();}else{var _0x2110da=_[_0xbc05('0x12')](_0x86778e[_0xbc05('0x13')],handleFindAgent(_0x492fa2[_0xbc05('0x8')]));if(_0x2110da){var _0x4850b5=(_0x492fa2[_0xbc05('0x14')]||0xa)*0x3e8;var _0x5e2f6f,_0x59d1e5;var _0x3ddc24=seqqueue['createQueue'](_0x4850b5);_0x3ddc24['id']=_0x258a00;_0x3ddc24[_0xbc05('0x15')]=_0x4850b5;_0x3ddc24[_0xbc05('0x16')]=_0x24f75f[_0xbc05('0x16')];writeLog(_0x258a00,_0x2110da,util[_0xbc05('0x7')](_0xbc05('0x17'),_0x4850b5));_0x86778e['rules'][_0x258a00]['on'](_0xbc05('0x18'),function(){logger[_0xbc05('0x19')](_0xbc05('0x1a'),_0x258a00);clearTimeout(_0x59d1e5);_0x59d1e5=undefined;_0x3ddc24[_0xbc05('0x1b')]();if(_0x86778e['rules'][_0x258a00]){delete _0x86778e[_0xbc05('0x1c')][_0x258a00];}_0x69746c['stop']();});_0x86778e[_0xbc05('0x1c')][_0x258a00]['on'](_0xbc05('0x1d'),function(){if(_0x86778e[_0xbc05('0x1c')][_0x258a00]){delete _0x86778e['rules'][_0x258a00];}});_0x59d1e5=setTimeout(function(){logger[_0xbc05('0x19')](_0xbc05('0x1e'),_0x258a00);clearTimeout(_0x59d1e5);_0x3ddc24[_0xbc05('0x1b')]();_0x69746c[_0xbc05('0x1f')]();},_0x4850b5);strategy['agent'](_0x3ddc24,_0x2110da,_0x86778e,_0x24f75f);}else{logger[_0xbc05('0xc')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x258a00,_0x492fa2[_0xbc05('0x8')]);_0x69746c['stop']();}}}catch(_0x2d6884){console[_0xbc05('0x20')](_0x2d6884);logger[_0xbc05('0xc')]('[%s][QUEUE]\x20%s',_0x258a00,_0x2d6884[_0xbc05('0x21')]);_0x69746c[_0xbc05('0x11')]();}};}; \ No newline at end of file +var _0xf838=['[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','stop','validate','util','seq-queue','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','message','timeout','createQueue','atimeout','channel','START:%s','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','complete','next'];(function(_0x3fb9db,_0x4f721c){var _0xd0ab15=function(_0x4a055e){while(--_0x4a055e){_0x3fb9db['push'](_0x3fb9db['shift']());}};_0xd0ab15(++_0x4f721c);}(_0xf838,0x159));var _0x8f83=function(_0x1f36b9,_0x2e160e){_0x1f36b9=_0x1f36b9-0x0;var _0x288444=_0xf838[_0x1f36b9];return _0x288444;};'use strict';var schema=require(_0x8f83('0x0'));var _=require('lodash');var util=require(_0x8f83('0x1'));var seqqueue=require(_0x8f83('0x2'));var logger=require('../../../../config/logger')('routing');var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':_0x8f83('0x3')},'timeout':{'type':_0x8f83('0x4'),'message':_0x8f83('0x5')}});function writeLog(_0x146965,_0x2431bb,_0x39c42e){return logger[_0x8f83('0x6')](util[_0x8f83('0x7')](_0x8f83('0x8'),_0x146965,_0x2431bb[_0x8f83('0x9')],_0x39c42e));}function handleFindAgent(_0x2e7a21){return function(_0x4cc756){return _0x4cc756['name']['toLowerCase']()===_0x2e7a21[_0x8f83('0xa')]();};}exports[_0x8f83('0xb')]=function(_0x38d4a8,_0x37e8d9,_0x4b6f91,_0xe6feb0){return function(_0x180df8){try{var _0x4b1fae={'name':_0x37e8d9[0x0],'timeout':_0x37e8d9[0x1]};var _0x78d003=queue[_0x8f83('0x0')](_0x4b1fae,{'typecast':!![]});if(_0x78d003[_0x8f83('0xc')]){logger[_0x8f83('0xd')](_0x8f83('0xe'),_0x38d4a8,_['map'](_0x78d003,_0x8f83('0xf'))['join'](',\x20'));_0x180df8['stop']();}else{var _0x5bd37c=_['find'](_0x4b6f91['agents'],handleFindAgent(_0x4b1fae[_0x8f83('0x9')]));if(_0x5bd37c){var _0x52b9f4=(_0x4b1fae[_0x8f83('0x10')]||0xa)*0x3e8;var _0x15a3a4,_0x5d977a;var _0xf4606d=seqqueue[_0x8f83('0x11')](_0x52b9f4);_0xf4606d['id']=_0x38d4a8;_0xf4606d[_0x8f83('0x12')]=_0x52b9f4;_0xf4606d['channel']=_0xe6feb0[_0x8f83('0x13')];writeLog(_0x38d4a8,_0x5bd37c,util['format'](_0x8f83('0x14'),_0x52b9f4));_0x4b6f91['rules'][_0x38d4a8]['on'](_0x8f83('0x15'),function(){logger[_0x8f83('0x6')](_0x8f83('0x16'),_0x38d4a8);clearTimeout(_0x5d977a);_0x5d977a=undefined;_0xf4606d[_0x8f83('0x17')]();if(_0x4b6f91[_0x8f83('0x18')][_0x38d4a8]){delete _0x4b6f91['rules'][_0x38d4a8];}_0x180df8['stop']();});_0x4b6f91[_0x8f83('0x18')][_0x38d4a8]['on'](_0x8f83('0x19'),function(){if(_0x4b6f91[_0x8f83('0x18')][_0x38d4a8]){delete _0x4b6f91[_0x8f83('0x18')][_0x38d4a8];}});_0x5d977a=setTimeout(function(){logger[_0x8f83('0x6')]('[%s][AGENT]\x20ROUTING\x20END',_0x38d4a8);clearTimeout(_0x5d977a);_0xf4606d[_0x8f83('0x17')]();_0x180df8[_0x8f83('0x1a')]();},_0x52b9f4);strategy['agent'](_0xf4606d,_0x5bd37c,_0x4b6f91,_0xe6feb0);}else{logger[_0x8f83('0xd')](_0x8f83('0x1b'),_0x38d4a8,_0x4b1fae[_0x8f83('0x9')]);_0x180df8['stop']();}}}catch(_0x4b8e93){console['log'](_0x4b8e93);logger[_0x8f83('0xd')](_0x8f83('0x1c'),_0x38d4a8,_0x4b8e93[_0x8f83('0x1d')]);_0x180df8[_0x8f83('0x1e')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 4361ec5..9101ad8 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 _0xae36=['../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','upperFirst','AccountId','InteractionId','create','then','info','[%s][AMAZONLEX]\x20%s','body','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','message','toString','postText','amazonlex','providerName','providerResponse','dialogState','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xae36,0x1d3));var _0x6ae3=function(_0x2be39b,_0x30ad22){_0x2be39b=_0x2be39b-0x0;var _0xfacd2e=_0xae36[_0x2be39b];return _0xfacd2e;};'use strict';var _=require('lodash');var moment=require(_0x6ae3('0x0'));var AWS=require('aws-sdk');var utils=require(_0x6ae3('0x1'));var logger=require(_0x6ae3('0x2'))(_0x6ae3('0x3'));var rpc={'chatMessage':require(_0x6ae3('0x4')),'openchannelMessage':require(_0x6ae3('0x5')),'mailMessage':require(_0x6ae3('0x6')),'smsMessage':require(_0x6ae3('0x7')),'faxMessage':require(_0x6ae3('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x6ae3('0x9')]=function(_0x55661d,_0x3e57e6){return function(_0x1695b3){try{if(!_[_0x6ae3('0xa')](this[_0x6ae3('0xb')][_0x6ae3('0xc')])){logger['info']('[%s][AMAZONLEX]\x20%s',_0x55661d,_0x6ae3('0xd'));return _0x1695b3[_0x6ae3('0xe')]();}var _0x18941d={'ContactId':this[_0x6ae3('0xf')]['id'],'sentAt':moment()['format'](_0x6ae3('0x10')),'direction':_0x6ae3('0x11')};if(this[_0x6ae3('0x12')]===_0x6ae3('0x13')||this[_0x6ae3('0x12')]===_0x6ae3('0x14')){_0x18941d['phone']=this[_0x6ae3('0xb')][_0x6ae3('0x15')];}var _0x3ec1a5=this[_0x6ae3('0x12')];if(_0x3ec1a5===_0x6ae3('0x16')){_0x18941d['ChatWebsiteId']=this['account']['id'];}else{_0x18941d[_[_0x6ae3('0x17')](_0x3ec1a5)+_0x6ae3('0x18')]=this['account']['id'];}_0x18941d[_[_0x6ae3('0x17')](_0x3ec1a5)+_0x6ae3('0x19')]=this['interaction']['id'];if(this[_0x6ae3('0xb')]['created']){var _0xe63148=_0x3e57e6[0x4];if(!_['isEmpty'](_0xe63148)){_0x18941d['body']=utils['getMustacheRender'](_0xe63148,this);return rpc[_0x3ec1a5+'Message'][_0x6ae3('0x1a')](_0x18941d)[_0x6ae3('0x1b')](function(_0x479b1e){logger[_0x6ae3('0x1c')](_0x6ae3('0x1d'),_0x55661d,_0x18941d[_0x6ae3('0x1e')]);})['catch'](function(_0x47655a){logger[_0x6ae3('0x1f')](_0x6ae3('0x1d'),_0x55661d,JSON[_0x6ae3('0x20')](_0x47655a));})[_0x6ae3('0x21')](function(){logger[_0x6ae3('0x1c')](_0x6ae3('0x22'),_0x55661d);_0x1695b3['stop']();});}else{logger[_0x6ae3('0x1c')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x55661d);_0x1695b3[_0x6ae3('0x23')]();}}else{var _0x5bde71=this;var _0x44935c=new AWS['LexRuntime']({'accessKeyId':_0x3e57e6[0x0],'secretAccessKey':_0x3e57e6[0x1],'region':_0x3e57e6[0x2]});var _0x1e8791={'botAlias':'$LATEST','botName':_0x3e57e6[0x3],'inputText':this[_0x6ae3('0x24')]['body'],'userId':this[_0x6ae3('0x12')]+':'+this['interaction']['id'][_0x6ae3('0x25')]()};_0x44935c[_0x6ae3('0x26')](_0x1e8791,function(_0x558f15,_0x401e48){if(_0x558f15){logger[_0x6ae3('0x1f')](_0x6ae3('0x1d'),_0x55661d,_0x558f15[_0x6ae3('0x24')]);_0x1695b3[_0x6ae3('0xe')]();}else if(_0x401e48&&_0x401e48[_0x6ae3('0x24')]){_0x5bde71[_0x6ae3('0x1e')][_0x6ae3('0x27')]=_0x401e48;_0x18941d[_0x6ae3('0x1e')]=_0x401e48[_0x6ae3('0x24')];_0x18941d[_0x6ae3('0x28')]=_0x6ae3('0x27');_0x18941d[_0x6ae3('0x29')]=JSON['stringify'](_0x401e48);return rpc[_0x3ec1a5+'Message'][_0x6ae3('0x1a')](_0x18941d)[_0x6ae3('0x1b')](function(_0x5abf37){logger[_0x6ae3('0x1c')](_0x6ae3('0x1d'),_0x55661d,_0x18941d['body']);if(_0x401e48[_0x6ae3('0x2a')]=='Failed'){_0x1695b3[_0x6ae3('0xe')]();}else{_0x1695b3[_0x6ae3('0x23')]();}})['catch'](function(_0x5cd94a){logger[_0x6ae3('0x1f')](_0x6ae3('0x1d'),_0x55661d,JSON[_0x6ae3('0x20')](_0x5cd94a));_0x1695b3[_0x6ae3('0xe')]();});}else{_0x1695b3[_0x6ae3('0xe')]();}});}}catch(_0x3ada80){logger[_0x6ae3('0x1f')](_0x6ae3('0x1d'),_0x55661d,JSON[_0x6ae3('0x20')](_0x3ada80));_0x1695b3[_0x6ae3('0x23')]();}};}; \ No newline at end of file +var _0xb977=['error','amazonlex','providerName','create','dialogState','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','then','catch','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','message','toString','postText'];(function(_0x162877,_0x33e9c7){var _0x1e482e=function(_0xc3b288){while(--_0xc3b288){_0x162877['push'](_0x162877['shift']());}};_0x1e482e(++_0x33e9c7);}(_0xb977,0x196));var _0x7b97=function(_0x52a44d,_0x11b6d0){_0x52a44d=_0x52a44d-0x0;var _0x35b962=_0xb977[_0x52a44d];return _0x35b962;};'use strict';var _=require(_0x7b97('0x0'));var moment=require(_0x7b97('0x1'));var AWS=require(_0x7b97('0x2'));var utils=require(_0x7b97('0x3'));var logger=require(_0x7b97('0x4'))(_0x7b97('0x5'));var rpc={'chatMessage':require(_0x7b97('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x7b97('0x7')),'smsMessage':require(_0x7b97('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x7b97('0x9'))};exports[_0x7b97('0xa')]=function(_0x5a4102,_0x583d2f){return function(_0x1c737a){try{if(!_[_0x7b97('0xb')](this[_0x7b97('0xc')][_0x7b97('0xd')])){logger[_0x7b97('0xe')](_0x7b97('0xf'),_0x5a4102,_0x7b97('0x10'));return _0x1c737a[_0x7b97('0x11')]();}var _0x1a7818={'ContactId':this[_0x7b97('0x12')]['id'],'sentAt':moment()[_0x7b97('0x13')](_0x7b97('0x14')),'direction':_0x7b97('0x15')};if(this['channel']===_0x7b97('0x16')||this[_0x7b97('0x17')]==='whatsapp'){_0x1a7818['phone']=this[_0x7b97('0xc')][_0x7b97('0x18')];}var _0x263fdd=this[_0x7b97('0x17')];if(_0x263fdd===_0x7b97('0x19')){_0x1a7818[_0x7b97('0x1a')]=this[_0x7b97('0x1b')]['id'];}else{_0x1a7818[_[_0x7b97('0x1c')](_0x263fdd)+_0x7b97('0x1d')]=this[_0x7b97('0x1b')]['id'];}_0x1a7818[_[_0x7b97('0x1c')](_0x263fdd)+_0x7b97('0x1e')]=this[_0x7b97('0xc')]['id'];if(this[_0x7b97('0xc')][_0x7b97('0x1f')]){var _0x4103e9=_0x583d2f[0x4];if(!_[_0x7b97('0x20')](_0x4103e9)){_0x1a7818[_0x7b97('0x21')]=utils[_0x7b97('0x22')](_0x4103e9,this);return rpc[_0x263fdd+_0x7b97('0x23')]['create'](_0x1a7818)[_0x7b97('0x24')](function(_0x2cd0b5){logger[_0x7b97('0xe')](_0x7b97('0xf'),_0x5a4102,_0x1a7818[_0x7b97('0x21')]);})[_0x7b97('0x25')](function(_0x46d1a6){logger['error']('[%s][AMAZONLEX]\x20%s',_0x5a4102,JSON[_0x7b97('0x26')](_0x46d1a6));})['finally'](function(){logger[_0x7b97('0xe')](_0x7b97('0x27'),_0x5a4102);_0x1c737a[_0x7b97('0x28')]();});}else{logger[_0x7b97('0xe')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x5a4102);_0x1c737a[_0x7b97('0x28')]();}}else{var _0x52672e=this;var _0x25d593=new AWS['LexRuntime']({'accessKeyId':_0x583d2f[0x0],'secretAccessKey':_0x583d2f[0x1],'region':_0x583d2f[0x2]});var _0xa14c0e={'botAlias':'$LATEST','botName':_0x583d2f[0x3],'inputText':this[_0x7b97('0x29')]['body'],'userId':this['channel']+':'+this[_0x7b97('0xc')]['id'][_0x7b97('0x2a')]()};_0x25d593[_0x7b97('0x2b')](_0xa14c0e,function(_0x3e5f1e,_0x12baa6){if(_0x3e5f1e){logger[_0x7b97('0x2c')](_0x7b97('0xf'),_0x5a4102,_0x3e5f1e[_0x7b97('0x29')]);_0x1c737a[_0x7b97('0x11')]();}else if(_0x12baa6&&_0x12baa6['message']){_0x52672e[_0x7b97('0x21')][_0x7b97('0x2d')]=_0x12baa6;_0x1a7818[_0x7b97('0x21')]=_0x12baa6['message'];_0x1a7818[_0x7b97('0x2e')]='amazonlex';_0x1a7818['providerResponse']=JSON[_0x7b97('0x26')](_0x12baa6);return rpc[_0x263fdd+_0x7b97('0x23')][_0x7b97('0x2f')](_0x1a7818)[_0x7b97('0x24')](function(_0x37e9eb){logger[_0x7b97('0xe')](_0x7b97('0xf'),_0x5a4102,_0x1a7818[_0x7b97('0x21')]);if(_0x12baa6[_0x7b97('0x30')]==_0x7b97('0x31')){_0x1c737a[_0x7b97('0x11')]();}else{_0x1c737a[_0x7b97('0x28')]();}})[_0x7b97('0x25')](function(_0x52e67c){logger[_0x7b97('0x2c')](_0x7b97('0xf'),_0x5a4102,JSON['stringify'](_0x52e67c));_0x1c737a[_0x7b97('0x11')]();});}else{_0x1c737a[_0x7b97('0x11')]();}});}}catch(_0x3527fb){logger[_0x7b97('0x2c')](_0x7b97('0xf'),_0x5a4102,JSON['stringify'](_0x3527fb));_0x1c737a[_0x7b97('0x28')]();}};}; \ 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 0a91683..d97d3f1 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 _0x43ec=['catch','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','[%s][AUTOREPLY]\x20%s','next','interaction','created','info','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','','replace','';_0x3f42d8[_0xc43e('0x32')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':'All','Precedence':_0xc43e('0x33')};return mailRpc[_0xc43e('0x34')](this['account']['smtpOptions'],_0x3f42d8)[_0xc43e('0x35')](function(_0x2ce665){logger[_0xc43e('0x19')](_0xc43e('0x36'),_0x248e3a);_0x3f42d8[_0xc43e('0x37')]=_0x2ce665[_0xc43e('0x21')][_0xc43e('0x37')];return rpc[_0x42e705+_0xc43e('0x38')][_0xc43e('0x39')](_0x3f42d8);})[_0xc43e('0x35')](function(_0x566e07){logger[_0xc43e('0x19')](_0xc43e('0x15'),_0x248e3a,JSON[_0xc43e('0x3a')](_0x566e07));})['catch'](function(_0x44f21c){logger['error'](_0xc43e('0x3b'),_0x248e3a,JSON['stringify'](_0x44f21c));})[_0xc43e('0x3c')](function(){Promise['resolve']()[_0xc43e('0x35')](function(){if(_0x2b7fe5[0x0]!=='2'||_0x415bd9[_0xc43e('0x1b')])return;return rpc[_0x42e705+_0xc43e('0x3d')][_0xc43e('0x3e')](_0x415bd9['id'],{'autoreplyExecuted':!![]})[_0xc43e('0x35')](function(_0x23de05){logger[_0xc43e('0x19')](_0xc43e('0x1c'),_0x248e3a,JSON['stringify'](_0x23de05));})[_0xc43e('0x3f')](function(_0x4266a0){logger[_0xc43e('0x40')](_0xc43e('0x41'),_0x248e3a,JSON[_0xc43e('0x3a')](_0x4266a0));});})['then'](function(){_0x1812d0['next']();});});}else{return rpc[this[_0xc43e('0x11')]+_0xc43e('0x38')][_0xc43e('0x39')](_0x3f42d8)[_0xc43e('0x35')](function(){logger[_0xc43e('0x19')](_0xc43e('0x15'),_0x248e3a,_0x3f42d8[_0xc43e('0x13')]);})[_0xc43e('0x3f')](function(_0x63b1a8){logger[_0xc43e('0x40')](_0xc43e('0x15'),_0x248e3a,JSON['stringify'](_0x63b1a8));})[_0xc43e('0x3c')](function(){Promise['resolve']()[_0xc43e('0x35')](function(){if(_0x2b7fe5[0x0]!=='2'||_0x415bd9[_0xc43e('0x1b')])return;return rpc[_0x42e705+_0xc43e('0x3d')][_0xc43e('0x3e')](_0x415bd9['id'],{'autoreplyExecuted':!![]})[_0xc43e('0x35')](function(_0x9554b0){logger[_0xc43e('0x19')](_0xc43e('0x1c'),_0x248e3a,JSON[_0xc43e('0x3a')](_0x9554b0));})['catch'](function(_0x3d0822){logger[_0xc43e('0x40')](_0xc43e('0x41'),_0x248e3a,JSON[_0xc43e('0x3a')](_0x3d0822));});})[_0xc43e('0x35')](function(){_0x1812d0[_0xc43e('0x16')]();});});}}}catch(_0x145087){logger[_0xc43e('0x40')](_0xc43e('0x15'),_0x248e3a,JSON[_0xc43e('0x3a')](_0x145087));_0x1812d0[_0xc43e('0x42')]();}};}; \ No newline at end of file +var _0x664f=['from','phone','read','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','messageId','html','','replace','','headers','All','auto_reply','smtpOptions','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','then','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','autoreplyExecuted','update','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../mailRpc','consequence','channel','mail','isAutoreply','[%s][AUTOREPLY]\x20%s','next','isNil','interaction','created','info','Autoreply\x20already\x20sent','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','YYYY-MM-DD\x20HH:mm:ss','out','body','getMustacheRender','message'];(function(_0x1c1831,_0x39bbc2){var _0x2620f1=function(_0x459838){while(--_0x459838){_0x1c1831['push'](_0x1c1831['shift']());}};_0x2620f1(++_0x39bbc2);}(_0x664f,0x1b8));var _0xf664=function(_0x2868ec,_0x3aef29){_0x2868ec=_0x2868ec-0x0;var _0x2ad998=_0x664f[_0x2868ec];return _0x2ad998;};'use strict';var _=require(_0xf664('0x0'));var moment=require('moment');var utils=require(_0xf664('0x1'));var logger=require(_0xf664('0x2'))(_0xf664('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xf664('0x4')),'mailMessage':require(_0xf664('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0xf664('0x6')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0xf664('0x7')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0xf664('0x8')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0xf664('0x9'));exports[_0xf664('0xa')]=function(_0x3e3da7,_0x98cac,_0x3ec1c2,_0x541363){return function(_0x1743a0){try{var _0x50ada7=this[_0xf664('0xb')];if(_0x50ada7===_0xf664('0xc')&&_0x541363['body'][_0xf664('0xd')]){logger['info'](_0xf664('0xe'),_0x3e3da7,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x1743a0[_0xf664('0xf')]();}if(_0x98cac[0x0]==='1'&&(_[_0xf664('0x10')](this[_0xf664('0x11')][_0xf664('0x12')])||!this['interaction'][_0xf664('0x12')])){logger[_0xf664('0x13')](_0xf664('0xe'),_0x3e3da7,_0xf664('0x14'));return _0x1743a0[_0xf664('0xf')]();}if(_0x98cac[0x0]==='2'&&this['interaction']['autoreplyExecuted']){logger[_0xf664('0x13')](_0xf664('0x15'),_0x3e3da7,_0xf664('0x16'));return _0x1743a0[_0xf664('0xf')]();}var _0x29086e={'ContactId':this[_0xf664('0x17')]['id'],'sentAt':moment()['format'](_0xf664('0x18')),'direction':_0xf664('0x19')};if(this['channel']==='mail'){_0x29086e[_0xf664('0x1a')]=utils[_0xf664('0x1b')](_0x98cac[0x2],this);}else{_0x29086e['body']=utils['getMustacheRender'](_0x98cac[0x1],this);}if(this[_0xf664('0x1c')]){_0x29086e['to']=this[_0xf664('0x1c')][_0xf664('0x1d')]||'';if(this['channel']===_0xf664('0xc')&&_0x98cac[0x1]==='1'){_0x29086e['cc']=this['message']['cc']||'';}_0x29086e[_0xf664('0x1d')]=this[_0xf664('0x1c')]['to']||'';_0x29086e['phone']=this['message'][_0xf664('0x1e')]||'';_0x29086e[_0xf664('0x1f')]=!![];if(this[_0xf664('0x1c')][_0xf664('0x20')]){_0x29086e[_0xf664('0x20')]='';_0x29086e[_0xf664('0x20')]+=_[_0xf664('0x21')](this[_0xf664('0x1c')]['subject'],_0xf664('0x22'))?'':_0xf664('0x23');_0x29086e['subject']+=this[_0xf664('0x1c')][_0xf664('0x20')];}}if(this['channel']===_0xf664('0x24')){_0x29086e[_0xf664('0x25')]=this[_0xf664('0x26')]['id'];}else{_0x29086e[_[_0xf664('0x27')](this[_0xf664('0xb')])+_0xf664('0x28')]=this[_0xf664('0x26')]['id'];}_0x29086e[_[_0xf664('0x27')](this['channel'])+_0xf664('0x29')]=this[_0xf664('0x11')]['id'];var _0x35c56b=this[_0xf664('0x11')];if(rpc[this[_0xf664('0xb')]+_0xf664('0x2a')]){if(this['channel']==='mail'){_0x29086e['inReplyTo']=this['message'][_0xf664('0x2b')];_0x29086e[_0xf664('0x2c')]=_0xf664('0x2d')+_[_0xf664('0x2e')](_0x29086e[_0xf664('0x1a')],_0xf664('0x2f'),']+(>|$)/g,''),'priorityTrue':_0x1a77c2[0x1],'priorityFalse':_0x1a77c2[0x2]};var _0x2c7b7d=gotoif['validate'](_0x52eaf3,{'typecast':!![]});if(_0x2c7b7d[_0x1703('0xa')]){logger[_0x1703('0xb')](_0x1703('0xc'),_0x1f84b3,_[_0x1703('0xd')](_0x2c7b7d,_0x1703('0xe'))[_0x1703('0xf')](',\x20'));_0x3e22c1[_0x1703('0x10')]();}else{try{var _0x2dfb52=eval('('+_0x52eaf3['condition']+')');var _0x3c7e06=_0x2dfb52?_0x52eaf3[_0x1703('0x11')]:_0x52eaf3[_0x1703('0x12')];logger['info'](_0x1703('0x13'),_0x1f84b3,_0x52eaf3[_0x1703('0x14')],_0x2dfb52,_0x3c7e06||_0x1703('0x15'));if(_0x3c7e06){var _0x393319=_[_0x1703('0x16')](_0x3e22c1[_0x1703('0x17')](),{'p':_0x3c7e06});if(_0x393319>=0x0){logger['info'](_0x1703('0x18'),_0x1f84b3,_0x3c7e06||_0x1703('0x15'),_0x393319);_0x3e22c1[_0x1703('0x15')](_0x393319);}else{logger[_0x1703('0x19')](_0x1703('0x1a'),_0x1f84b3,_0x3c7e06||'next');_0x3e22c1[_0x1703('0x10')]();}}else{_0x3e22c1['next']();}}catch(_0xf31d29){logger[_0x1703('0xb')](_0x1703('0x1b'),_0x1f84b3,_0xf31d29[_0x1703('0xe')]);_0x3e22c1[_0x1703('0x10')]();}}}catch(_0x427348){logger['error'](_0x1703('0xc'),_0x1f84b3,JSON['stringify'](_0x427348));_0x3e22c1[_0x1703('0x10')]();}};}; \ No newline at end of file +var _0x5796=['[%s][GOTOIF]\x20%s','map','message','stop','priorityTrue','priorityFalse','info','condition','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','html-to-text','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','length','error'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5796,0x9a));var _0x6579=function(_0x8fc2b2,_0x359c8b){_0x8fc2b2=_0x8fc2b2-0x0;var _0x385dd7=_0x5796[_0x8fc2b2];return _0x385dd7;};'use strict';var schema=require(_0x6579('0x0'));var _=require(_0x6579('0x1'));var htmlToText=require(_0x6579('0x2'));var utils=require('./utils');var logger=require(_0x6579('0x3'))(_0x6579('0x4'));var gotoif=schema({'condition':{'type':_0x6579('0x5'),'required':!![],'message':_0x6579('0x6')},'priorityTrue':{'type':_0x6579('0x7'),'message':_0x6579('0x8')},'priorityFalse':{'type':_0x6579('0x7'),'message':_0x6579('0x9')}});exports['consequence']=function(_0x820f6c,_0x360c3a){return function(_0x723cce){try{var _0x1503de={'condition':htmlToText[_0x6579('0xa')](utils[_0x6579('0xb')](_0x360c3a[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x360c3a[0x1],'priorityFalse':_0x360c3a[0x2]};var _0x166bac=gotoif[_0x6579('0x0')](_0x1503de,{'typecast':!![]});if(_0x166bac[_0x6579('0xc')]){logger[_0x6579('0xd')](_0x6579('0xe'),_0x820f6c,_[_0x6579('0xf')](_0x166bac,_0x6579('0x10'))['join'](',\x20'));_0x723cce[_0x6579('0x11')]();}else{try{var _0x27f9e6=eval('('+_0x1503de['condition']+')');var _0x383eb6=_0x27f9e6?_0x1503de[_0x6579('0x12')]:_0x1503de[_0x6579('0x13')];logger[_0x6579('0x14')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x820f6c,_0x1503de[_0x6579('0x15')],_0x27f9e6,_0x383eb6||_0x6579('0x16'));if(_0x383eb6){var _0x3bf01a=_[_0x6579('0x17')](_0x723cce[_0x6579('0x18')](),{'p':_0x383eb6});if(_0x3bf01a>=0x0){logger[_0x6579('0x14')](_0x6579('0x19'),_0x820f6c,_0x383eb6||_0x6579('0x16'),_0x3bf01a);_0x723cce[_0x6579('0x16')](_0x3bf01a);}else{logger['info'](_0x6579('0x1a'),_0x820f6c,_0x383eb6||_0x6579('0x16'));_0x723cce[_0x6579('0x11')]();}}else{_0x723cce[_0x6579('0x16')]();}}catch(_0x5ba975){logger[_0x6579('0xd')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x820f6c,_0x5ba975[_0x6579('0x10')]);_0x723cce[_0x6579('0x11')]();}}}catch(_0x11538b){logger['error'](_0x6579('0xe'),_0x820f6c,JSON[_0x6579('0x1b')](_0x11538b));_0x723cce['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 413e4fa..d969790 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 _0x3fc8=['error','[%s][GOTOP]\x20%s','map','message','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','stringify','validate','lodash','../../../../config/logger','routing','number','consequence','length'];(function(_0x133ac7,_0x3b06aa){var _0x178a3f=function(_0x2b9ac3){while(--_0x2b9ac3){_0x133ac7['push'](_0x133ac7['shift']());}};_0x178a3f(++_0x3b06aa);}(_0x3fc8,0xe9));var _0x83fc=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x3fc8[_0x2b10c6];return _0x3789d2;};'use strict';var schema=require(_0x83fc('0x0'));var _=require(_0x83fc('0x1'));var logger=require(_0x83fc('0x2'))(_0x83fc('0x3'));var gotop=schema({'priority':{'type':_0x83fc('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x83fc('0x5')]=function(_0x34f1bb,_0xf39135){return function(_0x4f6002){try{var _0x37dc5a={'priority':_0xf39135[0x0]};var _0x4318cc=gotop[_0x83fc('0x0')](_0x37dc5a,{'typecast':!![]});if(_0x4318cc[_0x83fc('0x6')]){logger[_0x83fc('0x7')](_0x83fc('0x8'),_0x34f1bb,_[_0x83fc('0x9')](_0x4318cc,_0x83fc('0xa'))['join'](',\x20'));_0x4f6002['stop']();}else{logger[_0x83fc('0xb')](_0x83fc('0xc'),_0x34f1bb,_0x37dc5a[_0x83fc('0xd')]);if(_0x37dc5a['priority']){var _0x6ae979=_['findIndex'](_0x4f6002[_0x83fc('0xe')](),{'p':_0x37dc5a[_0x83fc('0xd')]});if(_0x6ae979>=0x0){logger[_0x83fc('0xb')](_0x83fc('0xf'),_0x34f1bb,_0x37dc5a[_0x83fc('0xd')]||_0x83fc('0x10'),_0x6ae979);_0x4f6002['next'](_0x6ae979);}else{logger[_0x83fc('0xb')](_0x83fc('0x11'),_0x34f1bb,_0x37dc5a[_0x83fc('0xd')]||'next');_0x4f6002[_0x83fc('0x12')]();}}else{_0x4f6002['next']();}}}catch(_0x5b2dc7){logger[_0x83fc('0x7')]('[%s][GOTOP]\x20%s',_0x34f1bb,JSON[_0x83fc('0x13')](_0x5b2dc7));_0x4f6002[_0x83fc('0x12')]();}};}; \ No newline at end of file +var _0x266d=['stringify','validate','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','[%s][GOTOP]\x20%s','map','message','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','error'];(function(_0x1e03a6,_0xf0349){var _0x295b64=function(_0x1ad0a5){while(--_0x1ad0a5){_0x1e03a6['push'](_0x1e03a6['shift']());}};_0x295b64(++_0xf0349);}(_0x266d,0x88));var _0xd266=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x266d[_0x42cae2];return _0x5f256f;};'use strict';var schema=require(_0xd266('0x0'));var _=require('lodash');var logger=require('../../../../config/logger')('routing');var gotop=schema({'priority':{'type':_0xd266('0x1'),'required':!![],'message':_0xd266('0x2')}});exports[_0xd266('0x3')]=function(_0x5cbe21,_0x272960){return function(_0xe62b55){try{var _0x8d7060={'priority':_0x272960[0x0]};var _0x1b4fbf=gotop[_0xd266('0x0')](_0x8d7060,{'typecast':!![]});if(_0x1b4fbf['length']){logger['error'](_0xd266('0x4'),_0x5cbe21,_[_0xd266('0x5')](_0x1b4fbf,_0xd266('0x6'))['join'](',\x20'));_0xe62b55[_0xd266('0x7')]();}else{logger[_0xd266('0x8')](_0xd266('0x9'),_0x5cbe21,_0x8d7060['priority']);if(_0x8d7060[_0xd266('0xa')]){var _0x5420ad=_['findIndex'](_0xe62b55['rules'](),{'p':_0x8d7060['priority']});if(_0x5420ad>=0x0){logger[_0xd266('0x8')](_0xd266('0xb'),_0x5cbe21,_0x8d7060[_0xd266('0xa')]||'next',_0x5420ad);_0xe62b55['next'](_0x5420ad);}else{logger[_0xd266('0x8')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x5cbe21,_0x8d7060[_0xd266('0xa')]||_0xd266('0xc'));_0xe62b55[_0xd266('0x7')]();}}else{_0xe62b55[_0xd266('0xc')]();}}}catch(_0xfb569a){logger[_0xd266('0xd')](_0xd266('0x4'),_0x5cbe21,JSON[_0xd266('0xe')](_0xfb569a));_0xe62b55[_0xd266('0x7')]();}};}; \ 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 b74e74d..21b711b 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 _0x98ef=['../../rpc/whatsappMessage','consequence','getMustacheRender','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','Message','info','[%s][MESSAGE]\x20%s','body','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage'];(function(_0x1c0a1e,_0x404ad2){var _0x1b61cf=function(_0x2aaaa2){while(--_0x2aaaa2){_0x1c0a1e['push'](_0x1c0a1e['shift']());}};_0x1b61cf(++_0x404ad2);}(_0x98ef,0x197));var _0xf98e=function(_0x5b19f9,_0x1b0d27){_0x5b19f9=_0x5b19f9-0x0;var _0x19a71b=_0x98ef[_0x5b19f9];return _0x19a71b;};'use strict';var _=require(_0xf98e('0x0'));var utils=require(_0xf98e('0x1'));var logger=require(_0xf98e('0x2'))(_0xf98e('0x3'));var rpc={'chatMessage':require(_0xf98e('0x4')),'openchannelMessage':require(_0xf98e('0x5')),'mailMessage':require(_0xf98e('0x6')),'smsMessage':require(_0xf98e('0x7')),'faxMessage':require(_0xf98e('0x8')),'whatsappMessage':require(_0xf98e('0x9'))};exports[_0xf98e('0xa')]=function(_0x10b508,_0x212147){return function(_0x53ec74){try{var _0x3e8573={'body':utils[_0xf98e('0xb')](_0x212147[0x0],this),'ContactId':this['contact']['id']};if(this[_0xf98e('0xc')]===_0xf98e('0xd')){_0x3e8573[_0xf98e('0xe')]=this[_0xf98e('0xf')]['id'];}else{_0x3e8573[_[_0xf98e('0x10')](this[_0xf98e('0xc')])+'AccountId']=this[_0xf98e('0xf')]['id'];}_0x3e8573[_[_0xf98e('0x10')](this[_0xf98e('0xc')])+_0xf98e('0x11')]=this['interaction']['id'];if(rpc[this[_0xf98e('0xc')]+'Message']){return rpc[this[_0xf98e('0xc')]+_0xf98e('0x12')]['create'](_0x3e8573)['then'](function(_0x45a7e1){logger[_0xf98e('0x13')](_0xf98e('0x14'),_0x10b508,_0x3e8573[_0xf98e('0x15')]);_0x53ec74['next']();})[_0xf98e('0x16')](function(_0x201b9b){logger[_0xf98e('0x17')](_0xf98e('0x14'),_0x10b508,JSON[_0xf98e('0x18')](_0x201b9b));_0x53ec74[_0xf98e('0x19')]();});}}catch(_0x2311d6){logger[_0xf98e('0x17')](_0xf98e('0x14'),_0x10b508,JSON['stringify'](_0x2311d6));_0x53ec74[_0xf98e('0x19')]();}};}; \ No newline at end of file +var _0x0ae3=['../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','chat','account','channel','AccountId','upperFirst','create','[%s][MESSAGE]\x20%s','next','error','stop','lodash'];(function(_0x3adc3c,_0xc12e22){var _0x289fbc=function(_0x33797){while(--_0x33797){_0x3adc3c['push'](_0x3adc3c['shift']());}};_0x289fbc(++_0xc12e22);}(_0x0ae3,0x99));var _0x30ae=function(_0x581025,_0x1efba5){_0x581025=_0x581025-0x0;var _0x10dadc=_0x0ae3[_0x581025];return _0x10dadc;};'use strict';var _=require(_0x30ae('0x0'));var utils=require('./utils');var logger=require(_0x30ae('0x1'))(_0x30ae('0x2'));var rpc={'chatMessage':require(_0x30ae('0x3')),'openchannelMessage':require(_0x30ae('0x4')),'mailMessage':require(_0x30ae('0x5')),'smsMessage':require(_0x30ae('0x6')),'faxMessage':require(_0x30ae('0x7')),'whatsappMessage':require(_0x30ae('0x8'))};exports[_0x30ae('0x9')]=function(_0x3a301e,_0x2a7b4b){return function(_0x3a4ce3){try{var _0x35afab={'body':utils[_0x30ae('0xa')](_0x2a7b4b[0x0],this),'ContactId':this[_0x30ae('0xb')]['id']};if(this['channel']===_0x30ae('0xc')){_0x35afab['ChatWebsiteId']=this[_0x30ae('0xd')]['id'];}else{_0x35afab[_['upperFirst'](this[_0x30ae('0xe')])+_0x30ae('0xf')]=this['account']['id'];}_0x35afab[_[_0x30ae('0x10')](this[_0x30ae('0xe')])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0x30ae('0xe')]+'Message']){return rpc[this[_0x30ae('0xe')]+'Message'][_0x30ae('0x11')](_0x35afab)['then'](function(_0x3dba0b){logger['info'](_0x30ae('0x12'),_0x3a301e,_0x35afab['body']);_0x3a4ce3[_0x30ae('0x13')]();})['catch'](function(_0x5115b7){logger[_0x30ae('0x14')](_0x30ae('0x12'),_0x3a301e,JSON['stringify'](_0x5115b7));_0x3a4ce3[_0x30ae('0x15')]();});}}catch(_0x4f3de4){logger['error'](_0x30ae('0x12'),_0x3a301e,JSON['stringify'](_0x4f3de4));_0x3a4ce3[_0x30ae('0x15')]();}};}; \ 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 a65aa7d..bba85cd 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 _0x7472=['error','stringify','stop','./utils','consequence','info','[%s][NOOP]\x20%s','next'];(function(_0x542aee,_0x4c69eb){var _0x2fca37=function(_0x163e0b){while(--_0x163e0b){_0x542aee['push'](_0x542aee['shift']());}};_0x2fca37(++_0x4c69eb);}(_0x7472,0xb3));var _0x2747=function(_0x4a8fea,_0x4603f4){_0x4a8fea=_0x4a8fea-0x0;var _0x5e23a4=_0x7472[_0x4a8fea];return _0x5e23a4;};'use strict';var utils=require(_0x2747('0x0'));var logger=require('../../../../config/logger')('routing');exports[_0x2747('0x1')]=function(_0x4f0404,_0x41ad6c){return function(_0x491ca3){try{logger[_0x2747('0x2')](_0x2747('0x3'),_0x4f0404,utils['getMustacheRender'](_0x41ad6c[0x0],this));_0x491ca3[_0x2747('0x4')]();}catch(_0xd6efa3){logger[_0x2747('0x5')](_0x2747('0x3'),_0x4f0404,JSON[_0x2747('0x6')](_0xd6efa3));_0x491ca3[_0x2747('0x7')]();}};}; \ No newline at end of file +var _0x5115=['routing','info','next','error','[%s][NOOP]\x20%s','stringify','./utils','../../../../config/logger'];(function(_0x5e25fb,_0x568bb4){var _0x7a5a37=function(_0x956a14){while(--_0x956a14){_0x5e25fb['push'](_0x5e25fb['shift']());}};_0x7a5a37(++_0x568bb4);}(_0x5115,0x19e));var _0x5511=function(_0x195342,_0x2858be){_0x195342=_0x195342-0x0;var _0x2f760b=_0x5115[_0x195342];return _0x2f760b;};'use strict';var utils=require(_0x5511('0x0'));var logger=require(_0x5511('0x1'))(_0x5511('0x2'));exports['consequence']=function(_0x489a65,_0x48c7d7){return function(_0x2606bb){try{logger[_0x5511('0x3')]('[%s][NOOP]\x20%s',_0x489a65,utils['getMustacheRender'](_0x48c7d7[0x0],this));_0x2606bb[_0x5511('0x4')]();}catch(_0x123583){logger[_0x5511('0x5')](_0x5511('0x6'),_0x489a65,JSON[_0x5511('0x7')](_0x123583));_0x2606bb['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 9a5bd0c..8ea054d 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 _0x1e1f=['format','%sQueuesWaitingInteractions','pick','%s:queue:%s','save','remove','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','accepted','update','catch','error','update\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','map','join','stop','find','Queues','createQueue','atimeout','qtimeout','end','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','next','strategy','rrmemory','beepall','log','[%s][QUEUE]\x20%s','stack','validate','util','moment','ioredis','../../../../config/environment','../../../../config/logger','redis','localhost','queue_id','account','queue','from','joinAt','emit','clone','push','capitalize','InteractionId'];(function(_0x3afec4,_0x3ab530){var _0x10ae68=function(_0x395657){while(--_0x395657){_0x3afec4['push'](_0x3afec4['shift']());}};_0x10ae68(++_0x3ab530);}(_0x1e1f,0x8c));var _0xf1e1=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x1e1f[_0x2d7f0e];return _0x110b07;};'use strict';var schema=require(_0xf1e1('0x0'));var _=require('lodash');var util=require(_0xf1e1('0x1'));var seqqueue=require('seq-queue');var moment=require(_0xf1e1('0x2'));var Redis=require(_0xf1e1('0x3'));var config=require(_0xf1e1('0x4'));var logger=require(_0xf1e1('0x5'))('routing');var strategy=require('./strategy');config[_0xf1e1('0x6')]=_['defaults'](config[_0xf1e1('0x6')],{'host':_0xf1e1('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf1e1('0x6')]));var attributes=['id',_0xf1e1('0x8'),_0xf1e1('0x9'),_0xf1e1('0xa'),_0xf1e1('0xb'),_0xf1e1('0xc')];function emit(_0x151ae9,_0x5b4c38,_0x3765ad){io['to'](_0x151ae9)[_0xf1e1('0xd')](_0x5b4c38,_0x3765ad);}function emitChannelQueueInteraction(_0x530cda,_0x2e3308,_0xfb373f,_0x7298c4,_0x2cbbb4,_0x46ea9d,_0x2064ed,_0x4da5c1){var _0x233848=_[_0xf1e1('0xe')](_0xfb373f);_0x233848[_0xf1e1('0x8')]=_0x4da5c1;_0x233848[_0xf1e1('0xa')]=_0x2e3308;_0x233848['account']=_0x7298c4;_0x233848['id']=_0x2cbbb4;if(_0x46ea9d){attributes[_0xf1e1('0xf')](_[_0xf1e1('0x10')](_0x530cda)+_0xf1e1('0x11'));_0x2064ed[util[_0xf1e1('0x12')](_0xf1e1('0x13'),_0x530cda)][_0x2cbbb4]=_[_0xf1e1('0x14')](_0x233848,attributes);}else{delete _0x2064ed[util['format'](_0xf1e1('0x13'),_0x530cda)][_0x2cbbb4];}emit(util[_0xf1e1('0x12')](_0xf1e1('0x15'),_0x530cda,_0x2e3308),util[_0xf1e1('0x12')]('%s_queue_waiting_interaction:%s',_0x530cda,_0x46ea9d?_0xf1e1('0x16'):_0xf1e1('0x17')),_['pick'](_0x233848,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xf1e1('0x18')),'chatQueueReport':require(_0xf1e1('0x19')),'smsQueueReport':require(_0xf1e1('0x1a')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xf1e1('0x1b'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0xf1e1('0x1c')},'timeout':{'type':_0xf1e1('0x1d'),'message':_0xf1e1('0x1e')}});function startRouting(_0x50bc02,_0x419057,_0x32fdd6,_0x1a7c2f){if(_0x50bc02&&_0x419057&&_0x32fdd6){_0x419057[_0xf1e1('0x1f')]+=0x1;var _0x229705={'uniqueid':_0x50bc02,'from':_0x32fdd6[_0xf1e1('0x20')]?_0x32fdd6[_0xf1e1('0x20')]['from']:'','joinAt':moment()[_0xf1e1('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x32fdd6[_0xf1e1('0x21')]?_0x32fdd6['contact']['id']:null,'ListId':_0x32fdd6[_0xf1e1('0x22')]?_0x32fdd6['list']['id']:null};_0x229705[_[_0xf1e1('0x23')](_0x32fdd6[_0xf1e1('0x24')])+_0xf1e1('0x25')]=_0x419057['id']||null;_0x229705[_[_0xf1e1('0x23')](_0x32fdd6[_0xf1e1('0x24')])+_0xf1e1('0x11')]=_0x32fdd6[_0xf1e1('0x26')]?_0x32fdd6[_0xf1e1('0x26')]['id']:null;_0x229705[_['upperFirst'](_0x32fdd6[_0xf1e1('0x24')])+_0xf1e1('0x27')]=_0x32fdd6[_0xf1e1('0x28')]?_0x32fdd6[_0xf1e1('0x28')]['id']:null;_0x229705[_['upperFirst'](_0x32fdd6[_0xf1e1('0x24')])+(_0x32fdd6[_0xf1e1('0x24')]!==_0xf1e1('0x29')?'AccountId':_0xf1e1('0x2a'))]=_0x32fdd6[_0xf1e1('0x9')]?_0x32fdd6[_0xf1e1('0x9')]['id']:null;logger[_0xf1e1('0x2b')](util[_0xf1e1('0x12')](_0xf1e1('0x2c'),_0x50bc02,_0x419057[_0xf1e1('0x2d')]));emitChannelQueueInteraction(_0x32fdd6[_0xf1e1('0x24')],_0x419057[_0xf1e1('0x2d')],_0x229705,_0x32fdd6[_0xf1e1('0x9')][_0xf1e1('0x2d')],_0x32fdd6['message']['id'],!![],_0x1a7c2f,_0x419057['id']);if(rpc[_0x32fdd6[_0xf1e1('0x24')]+_0xf1e1('0x2e')]){return rpc[_0x32fdd6[_0xf1e1('0x24')]+_0xf1e1('0x2e')][_0xf1e1('0x2f')](_0x229705)['catch'](function(_0x1a9437){logger['error']('create\x20queue\x20report');});}}}function stopRouting(_0x43c548,_0xfc79c,_0x3625f9,_0x35e3f5){if(_0x43c548&&_0xfc79c){_0xfc79c[_0xf1e1('0x1f')]-=0x1;var _0x32977e={'leaveAt':moment()[_0xf1e1('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xf1e1('0x30')};logger[_0xf1e1('0x2b')](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x43c548,_0xfc79c[_0xf1e1('0x2d')]));emitChannelQueueInteraction(_0x3625f9['channel'],_0xfc79c['name'],_0x3625f9['body'],_0x3625f9['account'][_0xf1e1('0x2d')],_0x3625f9[_0xf1e1('0x28')]['id'],![],_0x35e3f5,_0xfc79c['id']);if(rpc[_0x3625f9['channel']+_0xf1e1('0x2e')]){return rpc[_0x3625f9['channel']+_0xf1e1('0x2e')][_0xf1e1('0x31')](_0x43c548,_0x32977e)[_0xf1e1('0x32')](function(_0x482ebf){logger[_0xf1e1('0x33')](_0xf1e1('0x34'));});}}}function endRouting(_0x11920d,_0x27dd18,_0x1b76ef,_0x1b4538){if(_0x11920d&&_0x27dd18){_0x27dd18[_0xf1e1('0x1f')]-=0x1;var _0x37f8e6={'leaveAt':moment()[_0xf1e1('0x12')](_0xf1e1('0x35')),'exitAt':moment()[_0xf1e1('0x12')](_0xf1e1('0x35')),'reason':_0xf1e1('0x36')};logger[_0xf1e1('0x2b')](util['format'](_0xf1e1('0x37'),_0x11920d,_0x27dd18[_0xf1e1('0x2d')]));emitChannelQueueInteraction(_0x1b76ef[_0xf1e1('0x24')],_0x27dd18[_0xf1e1('0x2d')],_0x1b76ef[_0xf1e1('0x20')],_0x1b76ef[_0xf1e1('0x9')][_0xf1e1('0x2d')],_0x1b76ef[_0xf1e1('0x28')]['id'],![],_0x1b4538);if(rpc[_0x1b76ef[_0xf1e1('0x24')]+_0xf1e1('0x2e')]){return rpc[_0x1b76ef['channel']+_0xf1e1('0x2e')][_0xf1e1('0x31')](_0x11920d,_0x37f8e6)[_0xf1e1('0x32')](function(_0x590e2c){logger[_0xf1e1('0x33')](_0xf1e1('0x34'));});}}}function handleFindQueue(_0x3c6260){return function(_0x567152){return _0x567152['name'][_0xf1e1('0x38')]()===_0x3c6260[_0xf1e1('0x38')]();};}exports[_0xf1e1('0x39')]=function(_0x57d92e,_0xb8e0b0,_0x2976e2,_0x1eecbd){return function(_0x1ff578){try{var _0x44981a={'name':_0xb8e0b0[0x0],'timeout':_0xb8e0b0[0x1]};var _0x5605e7=queue[_0xf1e1('0x0')](_0x44981a,{'typecast':!![]});if(_0x5605e7[_0xf1e1('0x3a')]){logger['error']('[%s][QUEUE]\x20%s',_0x57d92e,_[_0xf1e1('0x3b')](_0x5605e7,'message')[_0xf1e1('0x3c')](',\x20'));_0x1ff578[_0xf1e1('0x3d')]();}else{var _0x2e3aed=_[_0xf1e1('0x3e')](_0x2976e2[_0x1eecbd[_0xf1e1('0x24')]+_0xf1e1('0x3f')],handleFindQueue(_0x44981a[_0xf1e1('0x2d')]));if(_0x2e3aed){startRouting(_0x57d92e,_0x2e3aed,_0x1eecbd,_0x2976e2);var _0x1884cc=(_0x2e3aed[_0xf1e1('0x36')]||0xa)*0x3e8;var _0x28053f=(_0x44981a[_0xf1e1('0x36')]||0x14)*0x3e8;var _0x38d58e;if(_0x1884cc>_0x28053f){_0x28053f=_0x1884cc;}var _0x3e0ca2=seqqueue[_0xf1e1('0x40')](_0x1884cc);_0x3e0ca2['id']=_0x57d92e;_0x3e0ca2[_0xf1e1('0x41')]=_0x1884cc;_0x3e0ca2[_0xf1e1('0x42')]=_0x28053f;_0x3e0ca2[_0xf1e1('0x24')]=_0x1eecbd[_0xf1e1('0x24')];_0x2976e2['rules'][_0x57d92e]['on'](_0xf1e1('0x43'),function(){logger['info']('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x57d92e);stopRouting(_0x57d92e,_0x2e3aed,_0x1eecbd,_0x2976e2);clearTimeout(_0x38d58e);_0x38d58e=undefined;_0x3e0ca2['close'](!![]);if(_0x2976e2[_0xf1e1('0x44')][_0x57d92e]){delete _0x2976e2[_0xf1e1('0x44')][_0x57d92e];}_0x1ff578['stop']();});_0x2976e2[_0xf1e1('0x44')][_0x57d92e]['on'](_0xf1e1('0x45'),function(){if(_0x2976e2[_0xf1e1('0x44')][_0x57d92e]){delete _0x2976e2[_0xf1e1('0x44')][_0x57d92e];}});_0x38d58e=setTimeout(function(){logger[_0xf1e1('0x2b')](_0xf1e1('0x46'),_0x57d92e);endRouting(_0x57d92e,_0x2e3aed,_0x1eecbd,_0x2976e2);clearTimeout(_0x38d58e);_0x3e0ca2[_0xf1e1('0x47')](!![]);_0x1ff578[_0xf1e1('0x48')]();},_0x28053f);switch(_0x2e3aed[_0xf1e1('0x49')]){case _0xf1e1('0x4a'):strategy[_0xf1e1('0x4a')](_0x3e0ca2,_0x2e3aed,_0x2976e2,_0x1eecbd);break;default:strategy[_0xf1e1('0x4b')](_0x3e0ca2,_0x2e3aed,_0x2976e2,_0x1eecbd);}}else{logger[_0xf1e1('0x33')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x57d92e,_0x44981a['name']);_0x1ff578[_0xf1e1('0x3d')]();}}}catch(_0x1114f0){console[_0xf1e1('0x4c')](_0x1114f0);logger['error'](_0xf1e1('0x4d'),_0x57d92e,_0x1114f0[_0xf1e1('0x4e')]);_0x1ff578['stop']();}};}; \ No newline at end of file +var _0x0d51=['stack','validate','util','seq-queue','moment','ioredis','../../../../config/logger','./strategy','localhost','socket.io-emitter','redis','from','joinAt','clone','account','push','capitalize','InteractionId','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','number','waiting','body','contact','list','upperFirst','QueueId','channel','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','update','error','timeout','update\x20queue\x20report','toLowerCase','consequence','[%s][QUEUE]\x20%s','map','join','find','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','stop','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log'];(function(_0x54945e,_0x42f71a){var _0x36eabd=function(_0x178ecf){while(--_0x178ecf){_0x54945e['push'](_0x54945e['shift']());}};_0x36eabd(++_0x42f71a);}(_0x0d51,0xeb));var _0x10d5=function(_0xd22d95,_0xc59f8f){_0xd22d95=_0xd22d95-0x0;var _0x15d7a3=_0x0d51[_0xd22d95];return _0x15d7a3;};'use strict';var schema=require(_0x10d5('0x0'));var _=require('lodash');var util=require(_0x10d5('0x1'));var seqqueue=require(_0x10d5('0x2'));var moment=require(_0x10d5('0x3'));var Redis=require(_0x10d5('0x4'));var config=require('../../../../config/environment');var logger=require(_0x10d5('0x5'))('routing');var strategy=require(_0x10d5('0x6'));config['redis']=_['defaults'](config['redis'],{'host':_0x10d5('0x7'),'port':0x18eb});var io=require(_0x10d5('0x8'))(new Redis(config[_0x10d5('0x9')]));var attributes=['id','queue_id','account','queue',_0x10d5('0xa'),_0x10d5('0xb')];function emit(_0x4053e7,_0x57cf4e,_0x5a909f){io['to'](_0x4053e7)['emit'](_0x57cf4e,_0x5a909f);}function emitChannelQueueInteraction(_0x1bc202,_0x519b0f,_0x1e99b7,_0x5978f3,_0x2abde8,_0xa83ce6,_0x527577,_0x573b19){var _0xdd316a=_[_0x10d5('0xc')](_0x1e99b7);_0xdd316a['queue_id']=_0x573b19;_0xdd316a['queue']=_0x519b0f;_0xdd316a[_0x10d5('0xd')]=_0x5978f3;_0xdd316a['id']=_0x2abde8;if(_0xa83ce6){attributes[_0x10d5('0xe')](_[_0x10d5('0xf')](_0x1bc202)+_0x10d5('0x10'));_0x527577[util[_0x10d5('0x11')]('%sQueuesWaitingInteractions',_0x1bc202)][_0x2abde8]=_[_0x10d5('0x12')](_0xdd316a,attributes);}else{delete _0x527577[util[_0x10d5('0x11')](_0x10d5('0x13'),_0x1bc202)][_0x2abde8];}emit(util[_0x10d5('0x11')](_0x10d5('0x14'),_0x1bc202,_0x519b0f),util['format'](_0x10d5('0x15'),_0x1bc202,_0xa83ce6?'save':_0x10d5('0x16')),_[_0x10d5('0x12')](_0xdd316a,attributes));}var rpc={'openchannelQueueReport':require(_0x10d5('0x17')),'mailQueueReport':require(_0x10d5('0x18')),'chatQueueReport':require(_0x10d5('0x19')),'smsQueueReport':require(_0x10d5('0x1a')),'faxQueueReport':require(_0x10d5('0x1b')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0x10d5('0x1c'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x10d5('0x1d'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x5894e9,_0x5323a8,_0x87541f,_0x421398){if(_0x5894e9&&_0x5323a8&&_0x87541f){_0x5323a8[_0x10d5('0x1e')]+=0x1;var _0xaeafb7={'uniqueid':_0x5894e9,'from':_0x87541f[_0x10d5('0x1f')]?_0x87541f['body'][_0x10d5('0xa')]:'','joinAt':moment()[_0x10d5('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x87541f['contact']?_0x87541f[_0x10d5('0x20')]['id']:null,'ListId':_0x87541f[_0x10d5('0x21')]?_0x87541f['list']['id']:null};_0xaeafb7[_[_0x10d5('0x22')](_0x87541f['channel'])+_0x10d5('0x23')]=_0x5323a8['id']||null;_0xaeafb7[_[_0x10d5('0x22')](_0x87541f[_0x10d5('0x24')])+'InteractionId']=_0x87541f[_0x10d5('0x25')]?_0x87541f[_0x10d5('0x25')]['id']:null;_0xaeafb7[_['upperFirst'](_0x87541f['channel'])+_0x10d5('0x26')]=_0x87541f[_0x10d5('0x27')]?_0x87541f['message']['id']:null;_0xaeafb7[_[_0x10d5('0x22')](_0x87541f[_0x10d5('0x24')])+(_0x87541f['channel']!==_0x10d5('0x28')?_0x10d5('0x29'):_0x10d5('0x2a'))]=_0x87541f[_0x10d5('0xd')]?_0x87541f[_0x10d5('0xd')]['id']:null;logger[_0x10d5('0x2b')](util[_0x10d5('0x11')](_0x10d5('0x2c'),_0x5894e9,_0x5323a8[_0x10d5('0x2d')]));emitChannelQueueInteraction(_0x87541f[_0x10d5('0x24')],_0x5323a8[_0x10d5('0x2d')],_0xaeafb7,_0x87541f[_0x10d5('0xd')][_0x10d5('0x2d')],_0x87541f[_0x10d5('0x27')]['id'],!![],_0x421398,_0x5323a8['id']);if(rpc[_0x87541f['channel']+'QueueReport']){return rpc[_0x87541f['channel']+_0x10d5('0x2e')]['create'](_0xaeafb7)[_0x10d5('0x2f')](function(_0x4d3565){logger['error'](_0x10d5('0x30'));});}}}function stopRouting(_0x4c4c29,_0x24f332,_0x51e043,_0x2e344f){if(_0x4c4c29&&_0x24f332){_0x24f332[_0x10d5('0x1e')]-=0x1;var _0x5242a3={'leaveAt':moment()['format'](_0x10d5('0x31')),'acceptAt':moment()[_0x10d5('0x11')](_0x10d5('0x31')),'reason':_0x10d5('0x32')};logger['info'](util[_0x10d5('0x11')](_0x10d5('0x33'),_0x4c4c29,_0x24f332[_0x10d5('0x2d')]));emitChannelQueueInteraction(_0x51e043[_0x10d5('0x24')],_0x24f332['name'],_0x51e043[_0x10d5('0x1f')],_0x51e043[_0x10d5('0xd')][_0x10d5('0x2d')],_0x51e043[_0x10d5('0x27')]['id'],![],_0x2e344f,_0x24f332['id']);if(rpc[_0x51e043[_0x10d5('0x24')]+_0x10d5('0x2e')]){return rpc[_0x51e043[_0x10d5('0x24')]+_0x10d5('0x2e')][_0x10d5('0x34')](_0x4c4c29,_0x5242a3)['catch'](function(_0x2502bb){logger[_0x10d5('0x35')]('update\x20queue\x20report');});}}}function endRouting(_0x393bc5,_0x3dd7e6,_0x4988a3,_0xc13b76){if(_0x393bc5&&_0x3dd7e6){_0x3dd7e6['waiting']-=0x1;var _0x120bc9={'leaveAt':moment()[_0x10d5('0x11')](_0x10d5('0x31')),'exitAt':moment()[_0x10d5('0x11')](_0x10d5('0x31')),'reason':_0x10d5('0x36')};logger[_0x10d5('0x2b')](util['format']('[%s][END:QUEUE][NAME:%s]',_0x393bc5,_0x3dd7e6[_0x10d5('0x2d')]));emitChannelQueueInteraction(_0x4988a3[_0x10d5('0x24')],_0x3dd7e6[_0x10d5('0x2d')],_0x4988a3[_0x10d5('0x1f')],_0x4988a3['account'][_0x10d5('0x2d')],_0x4988a3[_0x10d5('0x27')]['id'],![],_0xc13b76);if(rpc[_0x4988a3[_0x10d5('0x24')]+_0x10d5('0x2e')]){return rpc[_0x4988a3[_0x10d5('0x24')]+_0x10d5('0x2e')][_0x10d5('0x34')](_0x393bc5,_0x120bc9)[_0x10d5('0x2f')](function(_0x383326){logger[_0x10d5('0x35')](_0x10d5('0x37'));});}}}function handleFindQueue(_0x1130f7){return function(_0x772ae3){return _0x772ae3['name'][_0x10d5('0x38')]()===_0x1130f7['toLowerCase']();};}exports[_0x10d5('0x39')]=function(_0x13296e,_0x187afd,_0x3d3c36,_0x5b09e2){return function(_0x6ef6e0){try{var _0x4000f1={'name':_0x187afd[0x0],'timeout':_0x187afd[0x1]};var _0x38eccd=queue[_0x10d5('0x0')](_0x4000f1,{'typecast':!![]});if(_0x38eccd['length']){logger['error'](_0x10d5('0x3a'),_0x13296e,_[_0x10d5('0x3b')](_0x38eccd,_0x10d5('0x27'))[_0x10d5('0x3c')](',\x20'));_0x6ef6e0['stop']();}else{var _0x2832a8=_[_0x10d5('0x3d')](_0x3d3c36[_0x5b09e2[_0x10d5('0x24')]+_0x10d5('0x3e')],handleFindQueue(_0x4000f1[_0x10d5('0x2d')]));if(_0x2832a8){startRouting(_0x13296e,_0x2832a8,_0x5b09e2,_0x3d3c36);var _0x1a5e74=(_0x2832a8[_0x10d5('0x36')]||0xa)*0x3e8;var _0x281067=(_0x4000f1[_0x10d5('0x36')]||0x14)*0x3e8;var _0x56923f;if(_0x1a5e74>_0x281067){_0x281067=_0x1a5e74;}var _0x2971b2=seqqueue[_0x10d5('0x3f')](_0x1a5e74);_0x2971b2['id']=_0x13296e;_0x2971b2[_0x10d5('0x40')]=_0x1a5e74;_0x2971b2[_0x10d5('0x41')]=_0x281067;_0x2971b2[_0x10d5('0x24')]=_0x5b09e2['channel'];_0x3d3c36[_0x10d5('0x42')][_0x13296e]['on'](_0x10d5('0x43'),function(){logger[_0x10d5('0x2b')](_0x10d5('0x44'),_0x13296e);stopRouting(_0x13296e,_0x2832a8,_0x5b09e2,_0x3d3c36);clearTimeout(_0x56923f);_0x56923f=undefined;_0x2971b2['close'](!![]);if(_0x3d3c36[_0x10d5('0x42')][_0x13296e]){delete _0x3d3c36[_0x10d5('0x42')][_0x13296e];}_0x6ef6e0[_0x10d5('0x45')]();});_0x3d3c36[_0x10d5('0x42')][_0x13296e]['on']('complete',function(){if(_0x3d3c36['rules'][_0x13296e]){delete _0x3d3c36[_0x10d5('0x42')][_0x13296e];}});_0x56923f=setTimeout(function(){logger['info'](_0x10d5('0x46'),_0x13296e);endRouting(_0x13296e,_0x2832a8,_0x5b09e2,_0x3d3c36);clearTimeout(_0x56923f);_0x2971b2['close'](!![]);_0x6ef6e0[_0x10d5('0x47')]();},_0x281067);switch(_0x2832a8[_0x10d5('0x48')]){case _0x10d5('0x49'):strategy[_0x10d5('0x49')](_0x2971b2,_0x2832a8,_0x3d3c36,_0x5b09e2);break;default:strategy[_0x10d5('0x4a')](_0x2971b2,_0x2832a8,_0x3d3c36,_0x5b09e2);}}else{logger[_0x10d5('0x35')](_0x10d5('0x4b'),_0x13296e,_0x4000f1['name']);_0x6ef6e0[_0x10d5('0x45')]();}}}catch(_0x518c23){console[_0x10d5('0x4c')](_0x518c23);logger[_0x10d5('0x35')](_0x10d5('0x3a'),_0x13296e,_0x518c23[_0x10d5('0x4d')]);_0x6ef6e0[_0x10d5('0x45')]();}};}; \ 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 7097878..70b6dcc 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 _0xd2ea=['push','handleRun','handleTimeout','bind','timeout','drained','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','debug','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','busy','busyQueue','saveWaitingNotification','channel','showNotification','writeLog',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','removeWaitingNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime'];(function(_0x3f6784,_0x15f4e8){var _0x2743f3=function(_0x547274){while(--_0x547274){_0x3f6784['push'](_0x3f6784['shift']());}};_0x2743f3(++_0x15f4e8);}(_0xd2ea,0x15f));var _0xad2e=function(_0x30ebbc,_0x481b0f){_0x30ebbc=_0x30ebbc-0x0;var _0x2fd850=_0xd2ea[_0x30ebbc];return _0x2fd850;};'use strict';var _=require(_0xad2e('0x0'));var uuid=require(_0xad2e('0x1'));var util=require(_0xad2e('0x2'));var logger=require(_0xad2e('0x3'))(_0xad2e('0x4'));var Agent=function(_0x5c9fa9,_0x3a9d11,_0x46a911,_0xcba7cb){this[_0xad2e('0x5')]=uuid['v4']();this[_0xad2e('0x6')]=_0x5c9fa9;this[_0xad2e('0x7')]=_0x3a9d11;this[_0xad2e('0x8')]=_0x46a911;this['routing']=_0xcba7cb;this[_0xad2e('0x6')][_0xad2e('0x9')](this[_0xad2e('0xa')]['bind'](this),this[_0xad2e('0xb')][_0xad2e('0xc')](this));this['squeue']['on'](_0xad2e('0xd'),this['handleTimeout'][_0xad2e('0xc')](this));this[_0xad2e('0x6')]['on'](_0xad2e('0xe'),this[_0xad2e('0xf')]['bind'](this));};Agent[_0xad2e('0x10')]['push']=function(){this[_0xad2e('0x6')][_0xad2e('0x9')](this[_0xad2e('0xa')][_0xad2e('0xc')](this),this['handleTimeout'][_0xad2e('0xc')](this));};Agent['prototype'][_0xad2e('0xf')]=function(){this['handleTimeout'](!![]);};Agent['prototype']['handleRun']=function(){logger['debug'](_0xad2e('0x11'),this[_0xad2e('0x6')]['id'],this[_0xad2e('0x7')]['id']);if(_[_0xad2e('0x12')](this[_0xad2e('0x8')][_0xad2e('0x13')][this[_0xad2e('0x7')]['id']])){logger[_0xad2e('0x14')](_0xad2e('0x15'),this[_0xad2e('0x6')]['id'],this[_0xad2e('0x7')]['id']);setTimeout(this[_0xad2e('0x9')][_0xad2e('0xc')](this),0x3e8);}else{if(this[_0xad2e('0x4')][_0xad2e('0x16')]||util['isAgentAvailable'](this[_0xad2e('0x6')]['id'],this[_0xad2e('0x8')]['agents'][this['agent']['id']],this['squeue']['channel'],![])){this[_0xad2e('0x8')][_0xad2e('0x13')][this[_0xad2e('0x7')]['id']][_0xad2e('0x17')]=!![];this[_0xad2e('0x8')][_0xad2e('0x13')][this[_0xad2e('0x7')]['id']][_0xad2e('0x18')]=undefined;util[_0xad2e('0x19')](this[_0xad2e('0x8')],this[_0xad2e('0x4')],this[_0xad2e('0x7')],this[_0xad2e('0x6')][_0xad2e('0x1a')]);util[_0xad2e('0x1b')](this[_0xad2e('0x5')],this['squeue']['id'],this[_0xad2e('0x8')][_0xad2e('0x13')][this[_0xad2e('0x7')]['id']],null,this[_0xad2e('0x4')]);util[_0xad2e('0x1c')](this[_0xad2e('0x6')]['id'],this[_0xad2e('0x8')][_0xad2e('0x13')][this[_0xad2e('0x7')]['id']],'RINGING'+(this[_0xad2e('0x4')]['forcedOwnership']?_0xad2e('0x1d'):''));}else{logger[_0xad2e('0x14')](_0xad2e('0x1e'),this[_0xad2e('0x6')]['id'],this[_0xad2e('0x7')]['id']);setTimeout(this[_0xad2e('0x9')][_0xad2e('0xc')](this),0x3e8);}}};Agent[_0xad2e('0x10')][_0xad2e('0xb')]=function(_0x31857f){if(_['isNil'](this[_0xad2e('0x8')][_0xad2e('0x13')][this[_0xad2e('0x7')]['id']])){return logger[_0xad2e('0x14')](_0xad2e('0x15'),this[_0xad2e('0x6')]['id'],this[_0xad2e('0x7')]['id']);}else{logger[_0xad2e('0x14')](_0xad2e('0x1f'),this[_0xad2e('0x6')]['id'],this[_0xad2e('0x7')]['id']);util['hideNotification'](this[_0xad2e('0x5')],this['squeue']['id'],this[_0xad2e('0x8')][_0xad2e('0x13')][this[_0xad2e('0x7')]['id']],null,this[_0xad2e('0x4')]);this[_0xad2e('0x8')]['agents'][this[_0xad2e('0x7')]['id']][_0xad2e('0x17')]=![];this['realtime'][_0xad2e('0x13')][this[_0xad2e('0x7')]['id']]['busyQueue']=undefined;util[_0xad2e('0x20')](this[_0xad2e('0x8')],this[_0xad2e('0x4')],this[_0xad2e('0x7')],this[_0xad2e('0x6')][_0xad2e('0x1a')]);util[_0xad2e('0x1c')](this['squeue']['id'],this[_0xad2e('0x8')][_0xad2e('0x13')][this['agent']['id']],_0x31857f?_0xad2e('0x21'):_0xad2e('0x22'));}if(!_0x31857f){setTimeout(this[_0xad2e('0x9')][_0xad2e('0xc')](this),0x3e8);}};function agent(_0x48c77b,_0xf4ae70,_0x4fe4f6,_0x5d6ac1){return new Agent(_0x48c77b,_0xf4ae70,_0x4fe4f6,_0x5d6ac1);}module[_0xad2e('0x23')]=agent; \ No newline at end of file +var _0x24ca=['busy','busyQueue','saveWaitingNotification','showNotification','RINGING','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','removeWaitingNotification','writeLog','STOP','exports','lodash','../../../../../config/logger','notificationId','squeue','agent','push','handleRun','bind','handleTimeout','prototype','handleDrained','[%s][AGENT]\x20try\x20with\x20%s','realtime','agents','debug','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','routing','forcedOwnership','isAgentAvailable','channel'];(function(_0x3101ff,_0x1562f7){var _0x4eb0df=function(_0x4aa200){while(--_0x4aa200){_0x3101ff['push'](_0x3101ff['shift']());}};_0x4eb0df(++_0x1562f7);}(_0x24ca,0x8c));var _0xa24c=function(_0x1ee62e,_0x159bb2){_0x1ee62e=_0x1ee62e-0x0;var _0x27c6c8=_0x24ca[_0x1ee62e];return _0x27c6c8;};'use strict';var _=require(_0xa24c('0x0'));var uuid=require('uuid');var util=require('./util');var logger=require(_0xa24c('0x1'))('routing');var Agent=function(_0x155c49,_0x1efd39,_0xe69cdd,_0x49f276){this[_0xa24c('0x2')]=uuid['v4']();this[_0xa24c('0x3')]=_0x155c49;this[_0xa24c('0x4')]=_0x1efd39;this['realtime']=_0xe69cdd;this['routing']=_0x49f276;this['squeue'][_0xa24c('0x5')](this[_0xa24c('0x6')][_0xa24c('0x7')](this),this[_0xa24c('0x8')][_0xa24c('0x7')](this));this[_0xa24c('0x3')]['on']('timeout',this[_0xa24c('0x8')][_0xa24c('0x7')](this));this[_0xa24c('0x3')]['on']('drained',this['handleDrained'][_0xa24c('0x7')](this));};Agent[_0xa24c('0x9')][_0xa24c('0x5')]=function(){this[_0xa24c('0x3')][_0xa24c('0x5')](this[_0xa24c('0x6')]['bind'](this),this['handleTimeout']['bind'](this));};Agent[_0xa24c('0x9')][_0xa24c('0xa')]=function(){this[_0xa24c('0x8')](!![]);};Agent[_0xa24c('0x9')][_0xa24c('0x6')]=function(){logger['debug'](_0xa24c('0xb'),this['squeue']['id'],this['agent']['id']);if(_['isNil'](this[_0xa24c('0xc')][_0xa24c('0xd')][this[_0xa24c('0x4')]['id']])){logger[_0xa24c('0xe')](_0xa24c('0xf'),this[_0xa24c('0x3')]['id'],this[_0xa24c('0x4')]['id']);setTimeout(this[_0xa24c('0x5')][_0xa24c('0x7')](this),0x3e8);}else{if(this[_0xa24c('0x10')][_0xa24c('0x11')]||util[_0xa24c('0x12')](this[_0xa24c('0x3')]['id'],this[_0xa24c('0xc')]['agents'][this[_0xa24c('0x4')]['id']],this['squeue'][_0xa24c('0x13')],![])){this[_0xa24c('0xc')][_0xa24c('0xd')][this[_0xa24c('0x4')]['id']][_0xa24c('0x14')]=!![];this[_0xa24c('0xc')][_0xa24c('0xd')][this[_0xa24c('0x4')]['id']][_0xa24c('0x15')]=undefined;util[_0xa24c('0x16')](this[_0xa24c('0xc')],this['routing'],this['agent'],this[_0xa24c('0x3')][_0xa24c('0x13')]);util[_0xa24c('0x17')](this[_0xa24c('0x2')],this[_0xa24c('0x3')]['id'],this[_0xa24c('0xc')][_0xa24c('0xd')][this[_0xa24c('0x4')]['id']],null,this[_0xa24c('0x10')]);util['writeLog'](this[_0xa24c('0x3')]['id'],this['realtime'][_0xa24c('0xd')][this[_0xa24c('0x4')]['id']],_0xa24c('0x18')+(this[_0xa24c('0x10')]['forcedOwnership']?':FORCED':''));}else{logger['debug']('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0xa24c('0x3')]['id'],this[_0xa24c('0x4')]['id']);setTimeout(this[_0xa24c('0x5')][_0xa24c('0x7')](this),0x3e8);}}};Agent[_0xa24c('0x9')]['handleTimeout']=function(_0x5c8113){if(_[_0xa24c('0x19')](this[_0xa24c('0xc')][_0xa24c('0xd')][this[_0xa24c('0x4')]['id']])){return logger[_0xa24c('0xe')](_0xa24c('0xf'),this[_0xa24c('0x3')]['id'],this[_0xa24c('0x4')]['id']);}else{logger[_0xa24c('0xe')](_0xa24c('0x1a'),this['squeue']['id'],this[_0xa24c('0x4')]['id']);util[_0xa24c('0x1b')](this['notificationId'],this[_0xa24c('0x3')]['id'],this[_0xa24c('0xc')][_0xa24c('0xd')][this[_0xa24c('0x4')]['id']],null,this[_0xa24c('0x10')]);this[_0xa24c('0xc')][_0xa24c('0xd')][this[_0xa24c('0x4')]['id']][_0xa24c('0x14')]=![];this[_0xa24c('0xc')]['agents'][this['agent']['id']]['busyQueue']=undefined;util[_0xa24c('0x1c')](this['realtime'],this[_0xa24c('0x10')],this[_0xa24c('0x4')],this[_0xa24c('0x3')]['channel']);util[_0xa24c('0x1d')](this[_0xa24c('0x3')]['id'],this[_0xa24c('0xc')]['agents'][this[_0xa24c('0x4')]['id']],_0x5c8113?_0xa24c('0x1e'):'TIMEOUT');}if(!_0x5c8113){setTimeout(this[_0xa24c('0x5')][_0xa24c('0x7')](this),0x3e8);}};function agent(_0xd837dc,_0x570d7c,_0x45c429,_0x2c63da){return new Agent(_0xd837dc,_0x570d7c,_0x45c429,_0x2c63da);}module[_0xa24c('0x1f')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index d5177cf..4e916a6 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 _0xcb32=['STOP','TIMEOUT','busy','removeWaitingNotification','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','push','bind','handleTimeout','timeout','handleDrained','prototype','handleRun','isNil','Agents','length','agents','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','busyQueue','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification'];(function(_0x5264ab,_0x1dbb91){var _0x4f0142=function(_0x5aa18c){while(--_0x5aa18c){_0x5264ab['push'](_0x5264ab['shift']());}};_0x4f0142(++_0x1dbb91);}(_0xcb32,0xe3));var _0x2cb3=function(_0x36dc04,_0x8baaf6){_0x36dc04=_0x36dc04-0x0;var _0x23fd14=_0xcb32[_0x36dc04];return _0x23fd14;};'use strict';var _=require(_0x2cb3('0x0'));var uuid=require(_0x2cb3('0x1'));var util=require(_0x2cb3('0x2'));var logger=require(_0x2cb3('0x3'))(_0x2cb3('0x4'));var Beepall=function(_0x25cc65,_0x352886,_0x1c5a46,_0x3721a5){this[_0x2cb3('0x5')]=uuid['v4']();this[_0x2cb3('0x6')]=_0x25cc65;this[_0x2cb3('0x7')]=_0x352886;this[_0x2cb3('0x8')]=_0x1c5a46;this[_0x2cb3('0x4')]=_0x3721a5;this[_0x2cb3('0x6')][_0x2cb3('0x9')](this['handleRun'][_0x2cb3('0xa')](this),this[_0x2cb3('0xb')][_0x2cb3('0xa')](this));this[_0x2cb3('0x6')]['on'](_0x2cb3('0xc'),this[_0x2cb3('0xb')][_0x2cb3('0xa')](this));this[_0x2cb3('0x6')]['on']('drained',this[_0x2cb3('0xd')][_0x2cb3('0xa')](this));};Beepall[_0x2cb3('0xe')]['push']=function(){this[_0x2cb3('0x6')]['push'](this[_0x2cb3('0xf')][_0x2cb3('0xa')](this),this[_0x2cb3('0xb')]['bind'](this));};Beepall[_0x2cb3('0xe')][_0x2cb3('0xd')]=function(){this[_0x2cb3('0xb')](!![]);};Beepall[_0x2cb3('0xe')][_0x2cb3('0xf')]=function(){var _0x23f9c0=!![];if(!_['isNil'](this[_0x2cb3('0x7')])&&!_[_0x2cb3('0x10')](this[_0x2cb3('0x7')][_0x2cb3('0x11')])&&this[_0x2cb3('0x7')][_0x2cb3('0x11')][_0x2cb3('0x12')]>0x0){for(var _0x22d9e7=0x0,_0x1d4ab9;_0x22d9e70x0){for(var _0x280e9c=0x0,_0xc3a8d6;_0x280e9c0x0&&_0x3dd915[_0x3ff0b4+_0x54f4('0x23')]>=_0x3dd915[_0x3ff0b4+_0x54f4('0x22')]){writeLog(_0x460d2d,_0x3dd915,_0x3ff0b4['toUpperCase']()+_0x54f4('0x24'));return![];}}return!![];};exports[_0x54f4('0x25')]=function(_0x30bc6d,_0x58340f,_0x4d7893,_0x52992e,_0x3aa35f){return sendNotification(!![],_0x30bc6d,_0x58340f,_0x4d7893,_0x52992e,_0x3aa35f);};exports[_0x54f4('0x26')]=function(_0x5666cd,_0x488335,_0x4856fd,_0x19c657,_0x4967d5){return sendNotification(![],_0x5666cd,_0x488335,_0x4856fd,_0x19c657,_0x4967d5);};exports[_0x54f4('0x27')]=function(_0x331abf,_0x47733a,_0x2df152){var _0x4d63b7=_0x47733a[_0x54f4('0x28')][_0x54f4('0x29')];if(!_0x4d63b7&&_0x2df152){_0x4d63b7=_0x2df152['id'];}var _0x5a248c=_[_0x54f4('0x2a')](_0x331abf[_0x47733a[_0x54f4('0x2b')]+_0x54f4('0x2c')],function(_0x35b93a){var _0x16c2c2=_['capitalize'](_0x47733a[_0x54f4('0x2b')])+_0x54f4('0x2d');return _0x35b93a[_0x16c2c2]===_0x47733a['interaction']['id'];});if(!_0x5a248c&&_0x4d63b7){_0x5a248c=_['some'](_0x331abf[_0x54f4('0x2e')][_0x4d63b7][_0x47733a[_0x54f4('0x2b')]+'WaitingInteractions'],function(_0x5565aa){return _0x5565aa['id']===_0x47733a['interaction']['id'];});}return _0x5a248c;};exports['saveWaitingNotification']=function(_0x5d98e3,_0x32d98c,_0x569937,_0x5a34cd){_0x5d98e3['agents'][_0x569937['id']][_0x5a34cd+_0x54f4('0x2f')][_0x32d98c[_0x54f4('0x18')]['id']]={'id':_0x32d98c[_0x54f4('0x28')]['id']};};exports[_0x54f4('0x30')]=function(_0x598ffe,_0x4df38b,_0x5717be,_0x1f7c1e){delete _0x598ffe[_0x54f4('0x2e')][_0x5717be['id']][_0x1f7c1e+_0x54f4('0x2f')][_0x4df38b['message']['id']];};exports[_0x54f4('0x31')]=writeLog; \ No newline at end of file +var _0x6c6b=['routing','redis','defaults','localhost','socket.io-emitter','format','user:%s','name','emit','user:save','split','\x20interaction','account','notificationSound','body','queue','msg','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','notification:%s','save','remove','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','online','OFFLINE','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','showNotification','hideNotification','checkWaitingNotifications','interaction','UserId','channel','QueuesWaitingInteractions','capitalize','some','agents','WaitingInteractions','saveWaitingNotification','writeLog','lodash','util','../../../../../config/environment','../../../../../config/logger'];(function(_0x30d042,_0x467a10){var _0x41c3ec=function(_0x160250){while(--_0x160250){_0x30d042['push'](_0x30d042['shift']());}};_0x41c3ec(++_0x467a10);}(_0x6c6b,0x1a4));var _0xb6c6=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x6c6b[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0xb6c6('0x0'));var util=require(_0xb6c6('0x1'));var utils=require('../utils');var Redis=require('ioredis');var config=require(_0xb6c6('0x2'));var logger=require(_0xb6c6('0x3'))(_0xb6c6('0x4'));config[_0xb6c6('0x5')]=_[_0xb6c6('0x6')](config[_0xb6c6('0x5')],{'host':_0xb6c6('0x7'),'port':0x18eb});var io=require(_0xb6c6('0x8'))(new Redis(config['redis']));function sendNotification(_0x29065a,_0x173ba8,_0x24a754,_0x2700b2,_0x1259a2,_0x46c090){io['to'](util[_0xb6c6('0x9')](_0xb6c6('0xa'),_0x2700b2[_0xb6c6('0xb')]))[_0xb6c6('0xc')](_0xb6c6('0xd'),_0x2700b2);var _0xf5b0b7=_0x46c090||{};var _0xd60a74=_0x24a754[_0xb6c6('0xe')]('.');var _0x26c6cc={'uniqueid':_0x173ba8,'channel':_0xd60a74[0x0],'id':_0xd60a74[0x1],'title':_0xd60a74[0x0]+_0xb6c6('0xf'),'interactionId':_0xd60a74[0x2],'queue':_0x1259a2?_0x1259a2[_0xb6c6('0xb')]:null,'sound':_0xf5b0b7[_0xb6c6('0x10')][_0xb6c6('0x11')],'shake':_0xf5b0b7[_0xb6c6('0x10')]['notificationShake']};try{if(!_0xf5b0b7[_0xb6c6('0x12')]){_0xf5b0b7[_0xb6c6('0x12')]={};}if(_0x1259a2){_0xf5b0b7[_0xb6c6('0x12')][_0xb6c6('0x13')]=_0x1259a2;}else if(_0xf5b0b7[_0xb6c6('0x12')][_0xb6c6('0x13')]){delete _0xf5b0b7['body'][_0xb6c6('0x13')];}_0x26c6cc[_0xb6c6('0x14')]=utils['getMustacheRender'](_0xf5b0b7[_0xb6c6('0x10')][_0xb6c6('0x15')],_0xf5b0b7);}catch(_0x44d552){_0x26c6cc[_0xb6c6('0x14')]=_0xb6c6('0x16');logger[_0xb6c6('0x17')](util[_0xb6c6('0x9')](_0xb6c6('0x18'),_0x173ba8,_0x44d552[_0xb6c6('0x19')]));}io['to'](util[_0xb6c6('0x9')]('user:%s',_0x2700b2[_0xb6c6('0xb')]))[_0xb6c6('0xc')](util[_0xb6c6('0x9')](_0xb6c6('0x1a'),_0x29065a?_0xb6c6('0x1b'):_0xb6c6('0x1c')),_0x26c6cc);}function writeLog(_0x3b4384,_0x2df711,_0x49a35b){return logger[_0xb6c6('0x1d')](util[_0xb6c6('0x9')](_0xb6c6('0x1e'),_0x3b4384,_0x2df711['name'],_0x49a35b));}exports[_0xb6c6('0x1f')]=function(_0x4fc8ff,_0x150bb1,_0x38ee57,_0x6c863f){if(_0x150bb1['busy']){writeLog(_0x4fc8ff,_0x150bb1,_0xb6c6('0x20'));return![];}if(!_0x150bb1[_0xb6c6('0x21')]){writeLog(_0x4fc8ff,_0x150bb1,_0xb6c6('0x22'));return![];}if(_0x150bb1[_0x38ee57+'Pause']){writeLog(_0x4fc8ff,_0x150bb1,_0xb6c6('0x23'));return![];}if(_0x6c863f&&_0x150bb1[_0xb6c6('0x24')](_0x38ee57+_0xb6c6('0x25'))&&_0x150bb1[_0xb6c6('0x24')](_0x38ee57+_0xb6c6('0x26'))){if(_0x150bb1[_0x38ee57+_0xb6c6('0x25')]>0x0&&_0x150bb1[_0x38ee57+_0xb6c6('0x26')]>=_0x150bb1[_0x38ee57+'Capacity']){writeLog(_0x4fc8ff,_0x150bb1,_0x38ee57[_0xb6c6('0x27')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0xb6c6('0x28')]=function(_0x29d944,_0x1978f2,_0x3d961f,_0x355568,_0x298fa6){return sendNotification(!![],_0x29d944,_0x1978f2,_0x3d961f,_0x355568,_0x298fa6);};exports[_0xb6c6('0x29')]=function(_0x323f02,_0x5dd8ba,_0x5ec4ae,_0x5421ba,_0x119c23){return sendNotification(![],_0x323f02,_0x5dd8ba,_0x5ec4ae,_0x5421ba,_0x119c23);};exports[_0xb6c6('0x2a')]=function(_0x5466fe,_0x22665c,_0x1aadd3){var _0x54ebf=_0x22665c[_0xb6c6('0x2b')][_0xb6c6('0x2c')];if(!_0x54ebf&&_0x1aadd3){_0x54ebf=_0x1aadd3['id'];}var _0x52d543=_['some'](_0x5466fe[_0x22665c[_0xb6c6('0x2d')]+_0xb6c6('0x2e')],function(_0x520ba7){var _0x5ccbc6=_[_0xb6c6('0x2f')](_0x22665c[_0xb6c6('0x2d')])+'InteractionId';return _0x520ba7[_0x5ccbc6]===_0x22665c[_0xb6c6('0x2b')]['id'];});if(!_0x52d543&&_0x54ebf){_0x52d543=_[_0xb6c6('0x30')](_0x5466fe[_0xb6c6('0x31')][_0x54ebf][_0x22665c[_0xb6c6('0x2d')]+_0xb6c6('0x32')],function(_0x269621){return _0x269621['id']===_0x22665c[_0xb6c6('0x2b')]['id'];});}return _0x52d543;};exports[_0xb6c6('0x33')]=function(_0x5b8ca4,_0x38388d,_0x4a0010,_0x4dff89){_0x5b8ca4[_0xb6c6('0x31')][_0x4a0010['id']][_0x4dff89+_0xb6c6('0x32')][_0x38388d[_0xb6c6('0x19')]['id']]={'id':_0x38388d[_0xb6c6('0x2b')]['id']};};exports['removeWaitingNotification']=function(_0x3e5cd1,_0x3b51a4,_0x3d9808,_0x39567c){delete _0x3e5cd1[_0xb6c6('0x31')][_0x3d9808['id']][_0x39567c+_0xb6c6('0x32')][_0x3b51a4['message']['id']];};exports[_0xb6c6('0x34')]=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 c467a0b..4fdcc57 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 _0xdf49=['[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','lodash','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','[%s][SYSTEM]\x20%s','map','message','info','[%s][SYSTEM]\x20commnad:\x20%s','exec','replace','isNil','isEmpty'];(function(_0x15a8fa,_0x4652b2){var _0x1355c2=function(_0x203292){while(--_0x203292){_0x15a8fa['push'](_0x15a8fa['shift']());}};_0x1355c2(++_0x4652b2);}(_0xdf49,0x19f));var _0x9df4=function(_0x32e264,_0x41cee8){_0x32e264=_0x32e264-0x0;var _0x1d7175=_0xdf49[_0x32e264];return _0x1d7175;};'use strict';var schema=require(_0x9df4('0x0'));var sh=require(_0x9df4('0x1'));var _=require(_0x9df4('0x2'));var utils=require('./utils');var logger=require(_0x9df4('0x3'))('routing');var system=schema({'command':{'type':_0x9df4('0x4'),'required':!![],'message':_0x9df4('0x5')}});exports['consequence']=function(_0x4041af,_0x40e859){return function(_0x18e49c){try{var _0x3a7fb7={'command':_0x40e859[0x0]};var _0x1c9ee2=system['validate'](_0x3a7fb7,{'typecast':!![]});if(_0x1c9ee2[_0x9df4('0x6')]){logger[_0x9df4('0x7')](_0x9df4('0x8'),_0x4041af,_[_0x9df4('0x9')](_0x1c9ee2,_0x9df4('0xa'))['join'](',\x20'));logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x4041af);_0x18e49c['next']();}else{var _0x520133=this;var _0x3d8206=utils['getMustacheRender'](_0x40e859[0x0],this);logger[_0x9df4('0xb')](_0x9df4('0xc'),_0x4041af,_0x3d8206);sh[_0x9df4('0xd')](_['trim'](_0x3d8206),function(_0x32776d,_0x22a644){logger[_0x9df4('0xb')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x4041af,_0x32776d);if(_0x32776d==0x0){var _0x51c81c=_0x22a644[_0x9df4('0xe')](/(\r\n|\n|\r)/gm,'');if(_[_0x9df4('0xf')](_0x40e859[0x1])||_[_0x9df4('0x10')](_0x40e859[0x1])){logger[_0x9df4('0xb')](_0x9df4('0x11'),_0x4041af);_0x520133[_0x9df4('0x12')][_0x40e859[0x1]]=_0x51c81c;}else{logger['info'](_0x9df4('0x13'),_0x4041af,_0x40e859[0x1],_0x51c81c);_0x520133[_0x9df4('0x12')][_0x40e859[0x1]]=_0x51c81c;}}_0x18e49c[_0x9df4('0x14')]();});}}catch(_0x792af4){logger[_0x9df4('0x7')](_0x9df4('0x8'),_0x4041af,_[_0x9df4('0x15')](_0x792af4)?JSON[_0x9df4('0x16')](_0x792af4):_0x792af4);logger[_0x9df4('0xb')](_0x9df4('0x17'),_0x4041af);_0x18e49c[_0x9df4('0x14')]();}};}; \ No newline at end of file +var _0x8d88=['routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','error','[%s][SYSTEM]\x20%s','isObject','validate','shelljs','lodash','./utils','../../../../config/logger'];(function(_0x4a1d1a,_0x47f52f){var _0x160b94=function(_0x339e4c){while(--_0x339e4c){_0x4a1d1a['push'](_0x4a1d1a['shift']());}};_0x160b94(++_0x47f52f);}(_0x8d88,0x7d));var _0x88d8=function(_0xfe36de,_0x303b03){_0xfe36de=_0xfe36de-0x0;var _0x2072ce=_0x8d88[_0xfe36de];return _0x2072ce;};'use strict';var schema=require(_0x88d8('0x0'));var sh=require(_0x88d8('0x1'));var _=require(_0x88d8('0x2'));var utils=require(_0x88d8('0x3'));var logger=require(_0x88d8('0x4'))(_0x88d8('0x5'));var system=schema({'command':{'type':_0x88d8('0x6'),'required':!![],'message':_0x88d8('0x7')}});exports[_0x88d8('0x8')]=function(_0x29c3df,_0x3e6e80){return function(_0xb19405){try{var _0x4c0f53={'command':_0x3e6e80[0x0]};var _0x3cd223=system[_0x88d8('0x0')](_0x4c0f53,{'typecast':!![]});if(_0x3cd223['length']){logger['error']('[%s][SYSTEM]\x20%s',_0x29c3df,_['map'](_0x3cd223,'message')[_0x88d8('0x9')](',\x20'));logger[_0x88d8('0xa')](_0x88d8('0xb'),_0x29c3df);_0xb19405['next']();}else{var _0x4ab3c7=this;var _0x3799fc=utils['getMustacheRender'](_0x3e6e80[0x0],this);logger[_0x88d8('0xa')](_0x88d8('0xc'),_0x29c3df,_0x3799fc);sh[_0x88d8('0xd')](_[_0x88d8('0xe')](_0x3799fc),function(_0xef27e7,_0x5a2a69){logger[_0x88d8('0xa')](_0x88d8('0xf'),_0x29c3df,_0xef27e7);if(_0xef27e7==0x0){var _0x223a1c=_0x5a2a69[_0x88d8('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0x88d8('0x11')](_0x3e6e80[0x1])||_[_0x88d8('0x12')](_0x3e6e80[0x1])){logger['info'](_0x88d8('0x13'),_0x29c3df);_0x4ab3c7[_0x88d8('0x14')][_0x3e6e80[0x1]]=_0x223a1c;}else{logger[_0x88d8('0xa')](_0x88d8('0x15'),_0x29c3df,_0x3e6e80[0x1],_0x223a1c);_0x4ab3c7[_0x88d8('0x14')][_0x3e6e80[0x1]]=_0x223a1c;}}_0xb19405[_0x88d8('0x16')]();});}}catch(_0x1bc699){logger[_0x88d8('0x17')](_0x88d8('0x18'),_0x29c3df,_[_0x88d8('0x19')](_0x1bc699)?JSON['stringify'](_0x1bc699):_0x1bc699);logger[_0x88d8('0xa')](_0x88d8('0xb'),_0x29c3df);_0xb19405[_0x88d8('0x16')]();}};}; \ 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 00eea9c..0424daf 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 _0x34d1=['../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','addTags','then','interaction','catch','stringify','next','isObject','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction'];(function(_0x1d1219,_0x23fc71){var _0x5b5b89=function(_0x3d85e5){while(--_0x3d85e5){_0x1d1219['push'](_0x1d1219['shift']());}};_0x5b5b89(++_0x23fc71);}(_0x34d1,0xba));var _0x134d=function(_0x3fb217,_0x1f5cc2){_0x3fb217=_0x3fb217-0x0;var _0xd68e3e=_0x34d1[_0x3fb217];return _0xd68e3e;};'use strict';var schema=require('validate');var _=require(_0x134d('0x0'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x134d('0x1')),'smsInteraction':require(_0x134d('0x2')),'mailInteraction':require(_0x134d('0x3')),'faxInteraction':require(_0x134d('0x4')),'whatsappInteraction':require(_0x134d('0x5'))};var logger=require(_0x134d('0x6'))(_0x134d('0x7'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x134d('0x8')}});exports[_0x134d('0x9')]=function(_0x29461f,_0x47b74e,_0x558aa4,_0x5ede91){return function(_0x512f0f){try{var _0x5a5829={'tag':_0x47b74e[0x0]};var _0x521c52=tag[_0x134d('0xa')](_0x5a5829,{'typecast':!![]});if(_0x521c52['length']){logger[_0x134d('0xb')](_0x134d('0xc'),_0x29461f,_[_0x134d('0xd')](_0x521c52,_0x134d('0xe'))[_0x134d('0xf')](',\x20'));logger[_0x134d('0x10')](_0x134d('0x11'),_0x29461f);_0x512f0f['next']();}else{var _0x229ec1={'ids':[_0x47b74e[0x0]]};if(rpc[_0x5ede91[_0x134d('0x12')]+_0x134d('0x13')]){rpc[_0x5ede91[_0x134d('0x12')]+'Interaction'][_0x134d('0x14')](_0x5ede91['interaction']['id'],_0x229ec1)[_0x134d('0x15')](function(_0x241528){logger[_0x134d('0x10')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x29461f,_0x47b74e[0x1],_0x5ede91[_0x134d('0x12')],_0x5ede91[_0x134d('0x16')]['id']);})[_0x134d('0x17')](function(_0x351820){logger[_0x134d('0xb')]('[%s][TAG]\x20%s',_0x29461f,JSON[_0x134d('0x18')](_0x351820));logger[_0x134d('0x10')](_0x134d('0x11'),_0x29461f);})['finally'](function(){_0x512f0f[_0x134d('0x19')]();});}}}catch(_0x2d3a1b){logger[_0x134d('0xb')]('[%s][TAG]\x20%s',_0x29461f,_[_0x134d('0x1a')](_0x2d3a1b)?JSON['stringify'](_0x2d3a1b):_0x2d3a1b);logger[_0x134d('0x10')](_0x134d('0x11'),_0x29461f);_0x512f0f['next']();}};}; \ No newline at end of file +var _0xc492=['../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][TAG]\x20%s','map','message','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','stringify','finally','isObject','lodash'];(function(_0x435acb,_0x1a4d8c){var _0x1c9eff=function(_0x3baf32){while(--_0x3baf32){_0x435acb['push'](_0x435acb['shift']());}};_0x1c9eff(++_0x1a4d8c);}(_0xc492,0x1a8));var _0x2c49=function(_0x5e9ed8,_0x17c676){_0x5e9ed8=_0x5e9ed8-0x0;var _0x2ac329=_0xc492[_0x5e9ed8];return _0x2ac329;};'use strict';var schema=require('validate');var _=require(_0x2c49('0x0'));var rpc={'chatInteraction':require(_0x2c49('0x1')),'openchannelInteraction':require(_0x2c49('0x2')),'smsInteraction':require(_0x2c49('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x2c49('0x4')),'whatsappInteraction':require(_0x2c49('0x5'))};var logger=require('../../../../config/logger')('routing');var tag=schema({'tag':{'type':_0x2c49('0x6'),'required':!![],'message':_0x2c49('0x7')}});exports[_0x2c49('0x8')]=function(_0x5d407d,_0x5b1037,_0x315cba,_0x5d6a69){return function(_0x503d5c){try{var _0x4a77d0={'tag':_0x5b1037[0x0]};var _0x261701=tag[_0x2c49('0x9')](_0x4a77d0,{'typecast':!![]});if(_0x261701[_0x2c49('0xa')]){logger[_0x2c49('0xb')](_0x2c49('0xc'),_0x5d407d,_[_0x2c49('0xd')](_0x261701,_0x2c49('0xe'))['join'](',\x20'));logger[_0x2c49('0xf')](_0x2c49('0x10'),_0x5d407d);_0x503d5c['next']();}else{var _0x853355={'ids':[_0x5b1037[0x0]]};if(rpc[_0x5d6a69[_0x2c49('0x11')]+'Interaction']){rpc[_0x5d6a69[_0x2c49('0x11')]+'Interaction'][_0x2c49('0x12')](_0x5d6a69[_0x2c49('0x13')]['id'],_0x853355)[_0x2c49('0x14')](function(_0x462c42){logger[_0x2c49('0xf')](_0x2c49('0x15'),_0x5d407d,_0x5b1037[0x1],_0x5d6a69['channel'],_0x5d6a69[_0x2c49('0x13')]['id']);})['catch'](function(_0x57e7b2){logger[_0x2c49('0xb')](_0x2c49('0xc'),_0x5d407d,JSON[_0x2c49('0x16')](_0x57e7b2));logger[_0x2c49('0xf')](_0x2c49('0x10'),_0x5d407d);})[_0x2c49('0x17')](function(){_0x503d5c['next']();});}}}catch(_0x1e5398){logger['error'](_0x2c49('0xc'),_0x5d407d,_[_0x2c49('0x18')](_0x1e5398)?JSON[_0x2c49('0x16')](_0x1e5398):_0x1e5398);logger[_0x2c49('0xf')](_0x2c49('0x10'),_0x5d407d);_0x503d5c['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index 9400383..089de6c 100644 --- a/server/services/routing/server/applications/tvox.js +++ b/server/services/routing/server/applications/tvox.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc8d4=['&serviceId=','&data=','stringify','then','info','stop','catch','error','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','lodash','\x20-\x20','replace','includes','push','urlOnAnswer','?params=','title','2.0','login','params','utf8','POST','result','logged','channelId='];(function(_0x61b3ab,_0x1fc298){var _0x57097f=function(_0x25970b){while(--_0x25970b){_0x61b3ab['push'](_0x61b3ab['shift']());}};_0x57097f(++_0x1fc298);}(_0xc8d4,0x155));var _0x4c8d=function(_0x24a721,_0x59acbf){_0x24a721=_0x24a721-0x0;var _0x3e1abd=_0xc8d4[_0x24a721];return _0x3e1abd;};'use strict';var rp=require(_0x4c8d('0x0'));var logger=require(_0x4c8d('0x1'))(_0x4c8d('0x2'));var _=require(_0x4c8d('0x3'));var arr=[];exports['consequence']=function(_0x5542a5,_0xb18302){return function(_0xe15ae7){var _0x3c0bea=_0xb18302[0xa];var _0x5001ff=_0xb18302[0xb];var _0x10d488=_0xb18302[0xc];var _0x348859=_0xb18302[0xd];var _0x33dfec=_0xb18302[0xe];var _0x595d7f=_0xb18302[0xf]['replace'](/\n/g,_0x4c8d('0x4'));var _0x3e2596=_0xb18302[0x10][_0x4c8d('0x5')](/\n/g,'\x20');if(!arr[_0x4c8d('0x6')](_0x5001ff)){arr[_0x4c8d('0x7')](_0x5001ff);var _0x445459=_0xb18302[0x3];var _0x4ae435=_0xb18302[0x4];var _0xeccd14=_0xb18302[0x1];var _0x2e1b21=_0xb18302[0x0];var _0x4e2613={};_0x4e2613[_0x4c8d('0x8')]=_0xb18302[0x8]+_0x4c8d('0x9')+_0x10d488+'|'+_0x3c0bea+'|'+_0x348859+'|'+_0x5001ff+'|'+_0x33dfec;_0x4e2613['urlOnRing']=_0xb18302[0x7]+_0x4c8d('0x9')+_0x10d488+'|'+_0x3c0bea+'|'+_0x348859+'|'+_0x5001ff+'|'+_0x33dfec+'|'+_0x595d7f+'|'+_0x3e2596;_0x4e2613[_0x4c8d('0xa')]=_0xb18302[0x9];var _0x42d537={};_0x42d537['jsonrpc']=_0x4c8d('0xb');_0x42d537['method']=_0x4c8d('0xc');var _0x4f505f=[];_0x4f505f[_0x4c8d('0x7')](_0xb18302[0x2]);_0x4f505f[_0x4c8d('0x7')](_0xb18302[0x5]);_0x4f505f[_0x4c8d('0x7')](_0xb18302[0x6]);_0x42d537[_0x4c8d('0xd')]=_0x4f505f;_0x42d537['id']=0x1;var _0x1a89ba=JSON['stringify'](_0x42d537);var _0x5ccce7={'encoding':_0x4c8d('0xe'),'method':_0x4c8d('0xf'),'timeout':0x2710,'url':_0x445459,'headers':{'Content-Type':'application/json-rpc'},'body':_0x1a89ba};return rp(_0x5ccce7)['then'](function(_0x41113e){const _0x41738c=JSON['parse'](_0x41113e);if(!_0x41738c[_0x4c8d('0x10')][_0x4c8d('0x11')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x1c3564=_0x5001ff;var _0x5eec9d=_0x4c8d('0x12')+_0xeccd14+_0x4c8d('0x13')+_0x2e1b21+'&sessionId='+_0x1c3564+_0x4c8d('0x14')+JSON[_0x4c8d('0x15')](_0x4e2613);var _0x248d4a=_0x4ae435+'?'+_0x5eec9d;return rp(_0x248d4a);})[_0x4c8d('0x16')](function(_0x36c1e0){logger[_0x4c8d('0x17')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x5542a5,_0x36c1e0);_0xe15ae7[_0x4c8d('0x18')]();})[_0x4c8d('0x19')](function(_0x2565eb){logger[_0x4c8d('0x1a')]('[%s][TVOX]\x20%s',_0x5542a5,_[_0x4c8d('0x1b')](_0x2565eb)?JSON[_0x4c8d('0x15')](_0x2565eb):_0x2565eb);_0xe15ae7[_0x4c8d('0x18')]();});}else{logger[_0x4c8d('0x17')](_0x4c8d('0x1c'),_0x5542a5);_0xe15ae7[_0x4c8d('0x1d')]();}};}; \ No newline at end of file +var _0x701d=['push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','login','params','stringify','POST','application/json-rpc','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','&serviceId=','&sessionId=','&data=','then','stop','catch','error','isObject','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','request-promise','../../../../config/logger','consequence','replace','\x20-\x20'];(function(_0x1ba248,_0x2ca110){var _0x3f4fbd=function(_0x3e5b1b){while(--_0x3e5b1b){_0x1ba248['push'](_0x1ba248['shift']());}};_0x3f4fbd(++_0x2ca110);}(_0x701d,0x127));var _0xd701=function(_0x3f96fc,_0x339725){_0x3f96fc=_0x3f96fc-0x0;var _0x3ade76=_0x701d[_0x3f96fc];return _0x3ade76;};'use strict';var rp=require(_0xd701('0x0'));var logger=require(_0xd701('0x1'))('routing');var _=require('lodash');var arr=[];exports[_0xd701('0x2')]=function(_0x94054e,_0x3fc14a){return function(_0x33f1f4){var _0x4b3273=_0x3fc14a[0xa];var _0x33c9ff=_0x3fc14a[0xb];var _0x5f4eea=_0x3fc14a[0xc];var _0x31aea3=_0x3fc14a[0xd];var _0x4d7a5a=_0x3fc14a[0xe];var _0x786e20=_0x3fc14a[0xf][_0xd701('0x3')](/\n/g,_0xd701('0x4'));var _0x5edf22=_0x3fc14a[0x10][_0xd701('0x3')](/\n/g,'\x20');if(!arr['includes'](_0x33c9ff)){arr[_0xd701('0x5')](_0x33c9ff);var _0x4727a6=_0x3fc14a[0x3];var _0x55c56b=_0x3fc14a[0x4];var _0x23dd96=_0x3fc14a[0x1];var _0x3ae164=_0x3fc14a[0x0];var _0x584f74={};_0x584f74[_0xd701('0x6')]=_0x3fc14a[0x8]+_0xd701('0x7')+_0x5f4eea+'|'+_0x4b3273+'|'+_0x31aea3+'|'+_0x33c9ff+'|'+_0x4d7a5a;_0x584f74[_0xd701('0x8')]=_0x3fc14a[0x7]+_0xd701('0x7')+_0x5f4eea+'|'+_0x4b3273+'|'+_0x31aea3+'|'+_0x33c9ff+'|'+_0x4d7a5a+'|'+_0x786e20+'|'+_0x5edf22;_0x584f74[_0xd701('0x9')]=_0x3fc14a[0x9];var _0x551847={};_0x551847[_0xd701('0xa')]='2.0';_0x551847['method']=_0xd701('0xb');var _0x59ed0d=[];_0x59ed0d[_0xd701('0x5')](_0x3fc14a[0x2]);_0x59ed0d[_0xd701('0x5')](_0x3fc14a[0x5]);_0x59ed0d[_0xd701('0x5')](_0x3fc14a[0x6]);_0x551847[_0xd701('0xc')]=_0x59ed0d;_0x551847['id']=0x1;var _0x48a40c=JSON[_0xd701('0xd')](_0x551847);var _0x1bc90f={'encoding':'utf8','method':_0xd701('0xe'),'timeout':0x2710,'url':_0x4727a6,'headers':{'Content-Type':_0xd701('0xf')},'body':_0x48a40c};return rp(_0x1bc90f)['then'](function(_0x443233){const _0x4fd05c=JSON[_0xd701('0x10')](_0x443233);if(!_0x4fd05c[_0xd701('0x11')][_0xd701('0x12')]){throw new Error(_0xd701('0x13'));}var _0x557024=_0x33c9ff;var _0x2ba848='channelId='+_0x23dd96+_0xd701('0x14')+_0x3ae164+_0xd701('0x15')+_0x557024+_0xd701('0x16')+JSON[_0xd701('0xd')](_0x584f74);var _0x32437d=_0x55c56b+'?'+_0x2ba848;return rp(_0x32437d);})[_0xd701('0x17')](function(_0x3ded0d){logger['info']('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x94054e,_0x3ded0d);_0x33f1f4[_0xd701('0x18')]();})[_0xd701('0x19')](function(_0x3c4873){logger[_0xd701('0x1a')]('[%s][TVOX]\x20%s',_0x94054e,_[_0xd701('0x1b')](_0x3c4873)?JSON['stringify'](_0x3c4873):_0x3c4873);_0x33f1f4[_0xd701('0x18')]();});}else{logger[_0xd701('0x1c')](_0xd701('0x1d'),_0x94054e);_0x33f1f4['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 e701243..92c866c 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 _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x33a923,_0x248569){var _0x3f2628=function(_0x5f5d15){while(--_0x5f5d15){_0x33a923['push'](_0x33a923['shift']());}};_0x3f2628(++_0x248569);}(_0xe706,0xa3));var _0x6e70=function(_0x5c47d8,_0x47eff2){_0x5c47d8=_0x5c47d8-0x0;var _0x5988c7=_0xe706[_0x5c47d8];return _0x5988c7;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file +var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x456ba5,_0x4ec7d6){var _0x238899=function(_0x2b1008){while(--_0x2b1008){_0x456ba5['push'](_0x456ba5['shift']());}};_0x238899(++_0x4ec7d6);}(_0xe706,0xa3));var _0x6e70=function(_0x2606e7,_0xcbe32c){_0x2606e7=_0x2606e7-0x0;var _0x56d2b6=_0xe706[_0x2606e7];return _0x56d2b6;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index b57e904..d7fceb5 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 _0x0366=['openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','stringify','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','listen','rules','message','interaction','checkWaitingNotifications','isArray','applications','length','join','.js','app','appdata','split','channel','push','slice','dialogflow','dialogflowv2','amazonlex','TagId','tvox','getMustacheRender','account','notificationTemplate','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','error','Applications\x20executed','matchPath','emit','format','Skipped\x20routing\x20for\x20%s','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','QueueReport','update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','end','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','find','chatQueues','available','loggedIn','waiting','mailQueues','name','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x0366,0xd1));var _0x6036=function(_0xf3c6bc,_0x53eecd){_0xf3c6bc=_0xf3c6bc-0x0;var _0x43776b=_0x0366[_0xf3c6bc];return _0x43776b;};'use strict';var _=require(_0x6036('0x0'));var util=require(_0x6036('0x1'));var path=require(_0x6036('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x6036('0x3'));var utils=require(_0x6036('0x4'));var sUtils=require(_0x6036('0x5'));var logger=require(_0x6036('0x6'))(_0x6036('0x7'));var rpc={'openchannelQueueReport':require(_0x6036('0x8')),'mailQueueReport':require(_0x6036('0x9')),'chatQueueReport':require(_0x6036('0xa')),'smsQueueReport':require(_0x6036('0xb')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x6036('0xc'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x5be01c,_0x38ad09,_0x460c59){return util['format'](_0x6036('0xd'),_0x5be01c,_0x38ad09||0x0,_0x460c59||0x0);}function getIntervals(_0x26b7ce,_0xe09b37){var _0x2e50ee=[];if(!_[_0x6036('0xe')](_0xe09b37['IntervalId'])&&!_[_0x6036('0xe')](_0x26b7ce[_0xe09b37[_0x6036('0xf')]])&&!_[_0x6036('0xe')](_0x26b7ce[_0xe09b37[_0x6036('0xf')]]['Intervals'])){_0x2e50ee=_[_0x6036('0x10')](_0x26b7ce[_0xe09b37[_0x6036('0xf')]][_0x6036('0x11')],'interval');}else if(!_['isNil'](_0xe09b37[_0x6036('0x12')])){_0x2e50ee=[_0xe09b37[_0x6036('0x12')]];}return _0x2e50ee;}exports[_0x6036('0x13')]=function(_0x516a98){_0x516a98[_0x6036('0x14')]={};return new BPromise(function(_0x4e516e,_0x1737e5){var _0x3c3094={'Start':function(_0x5b6f32){var _0x502ada=this;return new Promise(function(_0x4cfd3f,_0x543e00){if(_0x5b6f32){try{var _0x4daf1c=[];var _0x1a5768=getId(_0x5b6f32['channel'],_0x5b6f32[_0x6036('0x15')]?_0x5b6f32['message']['id']:0x0,_0x5b6f32[_0x6036('0x16')]?_0x5b6f32[_0x6036('0x16')]['id']:0x0);var _0xd06aa1=sUtils[_0x6036('0x17')](_0x516a98,_0x5b6f32);if(!_0xd06aa1&&_0x5b6f32['applications']&&_[_0x6036('0x18')](_0x5b6f32[_0x6036('0x19')])&&_0x5b6f32[_0x6036('0x19')]['length']){for(var _0x2ffe09=0x0;_0x2ffe09<_0x5b6f32[_0x6036('0x19')][_0x6036('0x1a')];_0x2ffe09+=0x1){var _0x5b6ae3=_0x5b6f32['applications'][_0x2ffe09];if(fs['existsSync'](path[_0x6036('0x1b')](__dirname,'applications',_0x5b6ae3['app']+_0x6036('0x1c')))){var _0x18d5c4=[];switch(_0x5b6ae3[_0x6036('0x1d')]['toLowerCase']()){case'autoreply':var _0x3905ef=_0x5b6ae3[_0x6036('0x1e')][_0x6036('0x1f')](',');if(_0x5b6f32[_0x6036('0x20')]==='mail'){_0x18d5c4[_0x6036('0x21')](_0x3905ef[0x0]);_0x18d5c4['push'](_0x3905ef[0x1]);_0x18d5c4['push'](_0x3905ef[_0x6036('0x22')](0x2,_0x3905ef[_0x6036('0x1a')])[_0x6036('0x1b')](','));}else{_0x18d5c4[_0x6036('0x21')](_0x3905ef[0x0]);_0x18d5c4[_0x6036('0x21')](_0x3905ef[_0x6036('0x22')](0x1,_0x3905ef[_0x6036('0x1a')])['join'](','));}break;case _0x6036('0x23'):var _0x364d55=_0x5b6ae3[_0x6036('0x1e')][_0x6036('0x1f')](',');_0x18d5c4[_0x6036('0x21')](_0x364d55[0x0]);_0x18d5c4[_0x6036('0x21')](_0x364d55[0x1]);_0x18d5c4[_0x6036('0x21')](_0x364d55[_0x6036('0x22')](0x2,_0x364d55['length'])[_0x6036('0x1b')](','));break;case _0x6036('0x24'):var _0x489a45=_0x5b6ae3[_0x6036('0x1e')][_0x6036('0x1f')](',');_0x18d5c4[_0x6036('0x21')](_0x489a45[0x0]);_0x18d5c4[_0x6036('0x21')](_0x489a45[0x1]);_0x18d5c4[_0x6036('0x21')](_0x489a45[0x2]);_0x18d5c4['push'](_0x489a45[0x3]);_0x18d5c4[_0x6036('0x21')](_0x489a45[_0x6036('0x22')](0x4,_0x489a45[_0x6036('0x1a')])['join'](','));break;case _0x6036('0x25'):var _0x180b58=_0x5b6ae3[_0x6036('0x1e')][_0x6036('0x1f')](',');_0x18d5c4[_0x6036('0x21')](_0x180b58[0x0]);_0x18d5c4[_0x6036('0x21')](_0x180b58[0x1]);_0x18d5c4[_0x6036('0x21')](_0x180b58[0x2]);_0x18d5c4[_0x6036('0x21')](_0x180b58[0x3]);_0x18d5c4[_0x6036('0x21')](_0x180b58[_0x6036('0x22')](0x4,_0x180b58[_0x6036('0x1a')])[_0x6036('0x1b')](','));break;case _0x6036('0x15'):_0x18d5c4[_0x6036('0x21')](_0x5b6ae3[_0x6036('0x1e')]);break;case'tag':_0x18d5c4[_0x6036('0x21')](_0x5b6ae3[_0x6036('0x26')]);_0x18d5c4[_0x6036('0x21')](_0x5b6ae3[_0x6036('0x1e')]);break;case _0x6036('0x27'):var _0x4bc0fe=utils[_0x6036('0x28')](_0x5b6f32[_0x6036('0x29')][_0x6036('0x2a')],_0x5b6f32);var _0x59e745=_0x5b6ae3[_0x6036('0x1e')][_0x6036('0x1f')](',');_0x18d5c4[_0x6036('0x21')](_0x59e745[0x0]);_0x18d5c4[_0x6036('0x21')](_0x59e745[0x1]);_0x18d5c4[_0x6036('0x21')](_0x59e745[0x2]);_0x18d5c4['push'](_0x59e745[0x3]);_0x18d5c4[_0x6036('0x21')](_0x59e745[0x4]);_0x18d5c4[_0x6036('0x21')](_0x59e745[0x5]);_0x18d5c4[_0x6036('0x21')](_0x59e745[0x6]);_0x18d5c4[_0x6036('0x21')](_0x59e745[0x7]);_0x18d5c4[_0x6036('0x21')](_0x59e745[0x8]);_0x18d5c4[_0x6036('0x21')](_0x59e745[0x9]);_0x18d5c4[_0x6036('0x21')](_0x59e745[0xa]);_0x18d5c4[_0x6036('0x21')](_0x5b6f32[_0x6036('0x16')]['id']);_0x18d5c4['push'](_0x5b6f32['message']['id']);_0x18d5c4['push'](_0x5b6ae3['ChatWebsiteId']);_0x18d5c4['push'](_0x5b6f32[_0x6036('0x16')][_0x6036('0x2b')]);_0x18d5c4[_0x6036('0x21')](_0x5b6f32[_0x6036('0x2c')]['body']);_0x18d5c4[_0x6036('0x21')](_0x4bc0fe);break;default:_0x18d5c4=_[_0x6036('0xe')](_0x5b6ae3[_0x6036('0x1e')])?[]:_0x5b6ae3[_0x6036('0x1e')][_0x6036('0x1f')](',');}var _0x4fee3a={'id':util['format'](_0x6036('0x2d'),_0x1a5768,_0x5b6ae3['id'],_0x5b6ae3['app']),'condition':require(_0x6036('0x2e'))[_0x6036('0x2f')](_0x1a5768,getIntervals(_0x516a98[_0x6036('0x30')],_0x5b6ae3),_0x516a98),'consequence':require(_0x6036('0x31')+_0x5b6ae3['app'])[_0x6036('0x32')](_0x1a5768,_0x18d5c4,_0x516a98,_0x5b6f32),'p':_0x5b6ae3[_0x6036('0x33')]||0x0};logger[_0x6036('0x34')](_0x6036('0x35'),_0x4fee3a['id'],_0x6036('0x36'),getIntervals(_0x516a98[_0x6036('0x30')],_0x5b6ae3)['join']('\x20|\x20'));_0x4daf1c['push'](_0x4fee3a);}else{logger[_0x6036('0x37')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0x6036('0x1b')](__dirname,_0x6036('0x19'),_0x5b6ae3['app']+_0x6036('0x1c')));}}_0x516a98[_0x6036('0x14')][_0x1a5768]=new RuleEngine(_0x4daf1c);_0x516a98[_0x6036('0x14')][_0x1a5768]['execute'](_0x5b6f32,function(_0x4d614b){logger['info'](_0x6036('0x38'),JSON['stringify'](_0x4d614b[_0x6036('0x39')]));if(_0x516a98['rules'][_0x1a5768]){_0x516a98['rules'][_0x1a5768][_0x6036('0x3a')]('complete');}});return _0x4cfd3f({'code':0xc8,'message':_0x5b6f32});}else{if(_0xd06aa1){logger[_0x6036('0x34')](util[_0x6036('0x3b')](_0x6036('0x3c'),_0x1a5768));}else{logger[_0x6036('0x34')]('No\x20applications\x20to\x20execute');}return _0x4cfd3f({'code':0xc8,'message':_0x5b6f32});}}catch(_0x4bb789){logger['error'](_0x4bb789[_0x6036('0x3d')]);return _0x543e00(_0x502ada[_0x6036('0x37')](0x1f4,_0x4bb789));}}return _0x543e00(_0x6036('0x3e'));});},'AcceptMessage':function(_0xb4163d){var _0x2f3dcc=this;return new Promise(function(_0x3b2474,_0x38e118){if(_0xb4163d[_0x6036('0x3f')]&&_0xb4163d[_0x6036('0x3f')]['id']){if(_0x516a98[_0x6036('0x40')][_0xb4163d[_0x6036('0x3f')]['id']]){_0x516a98['agents'][_0xb4163d[_0x6036('0x3f')]['id']][_0x6036('0x41')]=![];_0x516a98['agents'][_0xb4163d[_0x6036('0x3f')]['id']][_0x6036('0x42')]=undefined;}}if(_0xb4163d['message']&&_0xb4163d[_0x6036('0x15')]['id']){try{var _0x18c8e5=getId(_0xb4163d[_0x6036('0x20')],_0xb4163d['message']?_0xb4163d[_0x6036('0x15')]['id']:0x0,_0xb4163d[_0x6036('0x16')]?_0xb4163d['interaction']['id']:0x0);if(_0x516a98[_0x6036('0x14')][_0x18c8e5]){_0x516a98[_0x6036('0x14')][_0x18c8e5][_0x6036('0x3a')]('end');if(rpc[_0xb4163d[_0x6036('0x20')]+_0x6036('0x43')]){rpc[_0xb4163d[_0x6036('0x20')]+_0x6036('0x43')][_0x6036('0x44')](_0x18c8e5,{'UserId':_0xb4163d['message'][_0x6036('0x45')]})['catch'](function(){logger[_0x6036('0x37')](_0x6036('0x46'));});}}return _0x3b2474({'code':0xc8,'message':_0xb4163d});}catch(_0xbf6d8d){logger['error'](_0xbf6d8d['stack']);return _0x38e118(_0x2f3dcc[_0x6036('0x37')](0x1f4,_0xbf6d8d));}}logger[_0x6036('0x37')](_0x6036('0x47'));return _0x38e118(_0x2f3dcc[_0x6036('0x37')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x5a873b){var _0x3a02d4=this;return new Promise(function(_0x54e86f,_0x5d1bc3){if(_0x5a873b[_0x6036('0x3f')]&&_0x5a873b['agent']['id']){try{if(_0x516a98[_0x6036('0x40')][_0x5a873b[_0x6036('0x3f')]['id']]){_0x516a98['agents'][_0x5a873b[_0x6036('0x3f')]['id']][_0x6036('0x41')]=![];_0x516a98['agents'][_0x5a873b[_0x6036('0x3f')]['id']][_0x6036('0x42')]=undefined;}return _0x54e86f({'code':0xc8,'message':_0x5a873b});}catch(_0x6a5e53){logger[_0x6036('0x37')](_0x6a5e53[_0x6036('0x3d')]);return _0x5d1bc3(_0x3a02d4[_0x6036('0x37')](0x1f4,_0x6a5e53));}}logger[_0x6036('0x37')]('message\x20is\x20empty');return _0x5d1bc3(_0x3a02d4[_0x6036('0x37')](0x1f4,_0x6036('0x47')));});},'AbandonInteraction':function(_0x161811){var _0x1d119a=this;return new Promise(function(_0x1f423e,_0x837746){if(_0x161811['channel']&&_0x161811[_0x6036('0x16')]&&_0x161811[_0x6036('0x16')]['id']){try{var _0x422212=getId(_0x161811[_0x6036('0x20')],_0x161811[_0x6036('0x15')]?_0x161811[_0x6036('0x15')]['id']:0x0,_0x161811[_0x6036('0x16')]?_0x161811[_0x6036('0x16')]['id']:0x0);if(_0x516a98['rules'][_0x422212]){_0x516a98['rules'][_0x422212]['emit'](_0x6036('0x48'));}return _0x1f423e({'code':0xc8,'message':_0x161811});}catch(_0x68b589){logger[_0x6036('0x37')](_0x68b589[_0x6036('0x3d')]);return _0x837746(_0x1d119a[_0x6036('0x37')](0x1f4,_0x68b589));}}logger[_0x6036('0x37')](_0x6036('0x47'));return _0x837746(_0x1d119a[_0x6036('0x37')](0x1f4,_0x6036('0x47')));});},'AgentCapacity':function(_0x4cc513){var _0x292877=this;return new Promise(function(_0x3fa23d,_0x524c3c){if(_0x516a98['agents'][_0x6036('0x49')](_0x4cc513['id'])){for(var _0x1d509c in _0x4cc513['capacity']){if(_0x4cc513[_0x6036('0x4a')]['hasOwnProperty'](_0x1d509c)){if(_0x516a98[_0x6036('0x40')][_0x4cc513['id']][_0x6036('0x49')](_0x1d509c+_0x6036('0x4b'))){_0x516a98[_0x6036('0x40')][_0x4cc513['id']][_0x1d509c+_0x6036('0x4b')]=parseInt(_0x4cc513[_0x6036('0x4a')][_0x1d509c],0xa);}}}_0x516a98[_0x6036('0x40')][_0x4cc513['id']]['updateRealtime']();return _0x3fa23d({'code':0xc8,'message':_0x516a98[_0x6036('0x40')][_0x4cc513['id']]});}else{return _0x524c3c(_0x292877['error'](0x1f4,_0x6036('0x4c')));}});},'Agents':function(_0x4b78f3){return new Promise(function(_0x1c6a38){var _0x41806b=_[_0x6036('0x4d')](_0x516a98[_0x6036('0x40')]);if(_0x4b78f3&&_0x4b78f3['id']){var _0x425e7f=_[_0x6036('0x4e')](_0x41806b,function(_0x55f368){return _0x55f368['id']===_0x4b78f3['id'];});_0x1c6a38(_0x425e7f);}else{_0x1c6a38({'count':_0x41806b[_0x6036('0x1a')],'rows':_0x41806b});}});},'ChatQueues':function(){return new Promise(function(_0x7019ce){var _0x20722f=[];for(var _0x15bd2a in _0x516a98[_0x6036('0x4f')]){if(_0x516a98[_0x6036('0x4f')][_0x6036('0x49')](_0x15bd2a)){var _0x37e630=_0x516a98[_0x6036('0x4f')][_0x15bd2a];var _0x2adff5={'id':_0x37e630['id'],'available':_0x37e630[_0x6036('0x50')],'loggedIn':_0x37e630[_0x6036('0x51')],'name':_0x37e630['name'],'paused':_0x37e630['paused'],'waiting':_0x37e630[_0x6036('0x52')]};_0x20722f[_0x6036('0x21')](_0x2adff5);}}_0x7019ce({'count':_0x20722f[_0x6036('0x1a')],'rows':_0x20722f});});},'MailQueues':function(){return new Promise(function(_0x533f62){var _0x4b4086=[];for(var _0x56ba6 in _0x516a98[_0x6036('0x53')]){if(_0x516a98[_0x6036('0x53')][_0x6036('0x49')](_0x56ba6)){var _0x473301=_0x516a98['mailQueues'][_0x56ba6];var _0x11cc48={'id':_0x473301['id'],'available':_0x473301[_0x6036('0x50')],'loggedIn':_0x473301[_0x6036('0x51')],'name':_0x473301[_0x6036('0x54')],'paused':_0x473301[_0x6036('0x55')],'waiting':_0x473301[_0x6036('0x52')]};_0x4b4086[_0x6036('0x21')](_0x11cc48);}}_0x533f62({'count':_0x4b4086[_0x6036('0x1a')],'rows':_0x4b4086});});},'OpenchannelQueues':function(){return new Promise(function(_0x3cc1cf){var _0x18dcfb=[];for(var _0x1d100b in _0x516a98[_0x6036('0x56')]){if(_0x516a98[_0x6036('0x56')][_0x6036('0x49')](_0x1d100b)){var _0x488f04=_0x516a98[_0x6036('0x56')][_0x1d100b];var _0x10343c={'id':_0x488f04['id'],'available':_0x488f04[_0x6036('0x50')],'loggedIn':_0x488f04['loggedIn'],'name':_0x488f04[_0x6036('0x54')],'paused':_0x488f04[_0x6036('0x55')],'waiting':_0x488f04[_0x6036('0x52')]};_0x18dcfb['push'](_0x10343c);}}_0x3cc1cf({'count':_0x18dcfb[_0x6036('0x1a')],'rows':_0x18dcfb});});},'SmsQueues':function(){return new Promise(function(_0x4f3592){var _0x488972=[];for(var _0x13ba9c in _0x516a98['smsQueues']){if(_0x516a98[_0x6036('0x57')][_0x6036('0x49')](_0x13ba9c)){var _0x2873e4=_0x516a98['smsQueues'][_0x13ba9c];var _0x428428={'id':_0x2873e4['id'],'available':_0x2873e4['available'],'loggedIn':_0x2873e4[_0x6036('0x51')],'name':_0x2873e4[_0x6036('0x54')],'paused':_0x2873e4['paused'],'waiting':_0x2873e4[_0x6036('0x52')]};_0x488972['push'](_0x428428);}}_0x4f3592({'count':_0x488972['length'],'rows':_0x488972});});},'FaxQueues':function(){return new Promise(function(_0x29e4d8){var _0x5a4260=[];for(var _0x5a3146 in _0x516a98[_0x6036('0x58')]){if(_0x516a98['faxQueues']['hasOwnProperty'](_0x5a3146)){var _0x439d3d=_0x516a98[_0x6036('0x58')][_0x5a3146];var _0x44da43={'id':_0x439d3d['id'],'available':_0x439d3d['available'],'loggedIn':_0x439d3d['loggedIn'],'name':_0x439d3d['name'],'paused':_0x439d3d[_0x6036('0x55')],'waiting':_0x439d3d['waiting']};_0x5a4260[_0x6036('0x21')](_0x44da43);}}_0x29e4d8({'count':_0x5a4260[_0x6036('0x1a')],'rows':_0x5a4260});});},'WhatsappQueues':function(){return new Promise(function(_0x12c538){var _0xb8aca5=[];for(var _0x33486f in _0x516a98[_0x6036('0x59')]){if(_0x516a98[_0x6036('0x59')][_0x6036('0x49')](_0x33486f)){var _0x39b4ea=_0x516a98[_0x6036('0x59')][_0x33486f];var _0x20b8d8={'id':_0x39b4ea['id'],'available':_0x39b4ea[_0x6036('0x50')],'loggedIn':_0x39b4ea[_0x6036('0x51')],'name':_0x39b4ea[_0x6036('0x54')],'paused':_0x39b4ea[_0x6036('0x55')],'waiting':_0x39b4ea[_0x6036('0x52')]};_0xb8aca5[_0x6036('0x21')](_0x20b8d8);}}_0x12c538({'count':_0xb8aca5[_0x6036('0x1a')],'rows':_0xb8aca5});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x8cb65){var _0x46ae93=_[_0x6036('0x4d')](_0x516a98[_0x6036('0x5a')]);_0x8cb65({'count':_0x46ae93[_0x6036('0x1a')],'rows':_0x46ae93});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x135bfb){var _0xa1240c=_[_0x6036('0x4d')](_0x516a98['mailQueuesWaitingInteractions']);_0x135bfb({'count':_0xa1240c[_0x6036('0x1a')],'rows':_0xa1240c});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x1987a0){var _0x4f735b=_['values'](_0x516a98[_0x6036('0x5b')]);_0x1987a0({'count':_0x4f735b[_0x6036('0x1a')],'rows':_0x4f735b});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0xacf2e0){var _0x1ba7e7=_[_0x6036('0x4d')](_0x516a98['smsQueuesWaitingInteractions']);_0xacf2e0({'count':_0x1ba7e7[_0x6036('0x1a')],'rows':_0x1ba7e7});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x2a4048){var _0x37da56=_[_0x6036('0x4d')](_0x516a98[_0x6036('0x5c')]);_0x2a4048({'count':_0x37da56['length'],'rows':_0x37da56});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x415394){var _0x319b08=_[_0x6036('0x4d')](_0x516a98[_0x6036('0x5d')]);_0x415394({'count':_0x319b08['length'],'rows':_0x319b08});});}};var _0x17cded=jayson[_0x6036('0x5e')](_0x3c3094)[_0x6036('0x5f')]();_0x17cded['on'](_0x6036('0x37'),function(_0x3807e8){logger[_0x6036('0x37')](JSON[_0x6036('0x60')](_0x3807e8));return _0x1737e5(_0x3807e8);});_0x17cded['listen'](0x232c,_0x6036('0x61'),function(){console['log'](_0x6036('0x62'),0x232c);return _0x4e516e(_0x6036('0x63')+0x232c);});});}; \ No newline at end of file +var _0x9e1d=['priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','rules','execute','Applications\x20executed','stringify','matchPath','emit','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','busy','agents','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','./applications/strategy/util','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','listen','channel','message','interaction','checkWaitingNotifications','applications','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflow','dialogflowv2','amazonlex','tag','tvox','notificationTemplate','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/'];(function(_0x13f05d,_0x18e8a3){var _0x1383b4=function(_0x175fd4){while(--_0x175fd4){_0x13f05d['push'](_0x13f05d['shift']());}};_0x1383b4(++_0x18e8a3);}(_0x9e1d,0x169));var _0xd9e1=function(_0x1c4782,_0x1e01ba){_0x1c4782=_0x1c4782-0x0;var _0x254980=_0x9e1d[_0x1c4782];return _0x254980;};'use strict';var _=require('lodash');var util=require(_0xd9e1('0x0'));var path=require('path');var fs=require('fs');var jayson=require(_0xd9e1('0x1'));var BPromise=require('bluebird');var utils=require('./applications/utils');var sUtils=require(_0xd9e1('0x2'));var logger=require('../../../config/logger')(_0xd9e1('0x3'));var rpc={'openchannelQueueReport':require(_0xd9e1('0x4')),'mailQueueReport':require(_0xd9e1('0x5')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0xd9e1('0x6')),'whatsappQueueReport':require(_0xd9e1('0x7'))};var RuleEngine=require(_0xd9e1('0x8'));function getId(_0x3ca6a0,_0x538ee5,_0x5f5820){return util[_0xd9e1('0x9')](_0xd9e1('0xa'),_0x3ca6a0,_0x538ee5||0x0,_0x5f5820||0x0);}function getIntervals(_0x7d56e8,_0x637c12){var _0x1e47cb=[];if(!_['isNil'](_0x637c12[_0xd9e1('0xb')])&&!_[_0xd9e1('0xc')](_0x7d56e8[_0x637c12['IntervalId']])&&!_[_0xd9e1('0xc')](_0x7d56e8[_0x637c12[_0xd9e1('0xb')]][_0xd9e1('0xd')])){_0x1e47cb=_[_0xd9e1('0xe')](_0x7d56e8[_0x637c12['IntervalId']]['Intervals'],_0xd9e1('0xf'));}else if(!_['isNil'](_0x637c12[_0xd9e1('0xf')])){_0x1e47cb=[_0x637c12[_0xd9e1('0xf')]];}return _0x1e47cb;}exports[_0xd9e1('0x10')]=function(_0x267d8b){_0x267d8b['rules']={};return new BPromise(function(_0x1ec16f,_0x1de35f){var _0x19a17b={'Start':function(_0x545ee5){var _0x522809=this;return new Promise(function(_0xb29455,_0x5d25dc){if(_0x545ee5){try{var _0x28fb99=[];var _0x2b3f6e=getId(_0x545ee5[_0xd9e1('0x11')],_0x545ee5[_0xd9e1('0x12')]?_0x545ee5['message']['id']:0x0,_0x545ee5[_0xd9e1('0x13')]?_0x545ee5[_0xd9e1('0x13')]['id']:0x0);var _0x289a7e=sUtils[_0xd9e1('0x14')](_0x267d8b,_0x545ee5);if(!_0x289a7e&&_0x545ee5[_0xd9e1('0x15')]&&_['isArray'](_0x545ee5[_0xd9e1('0x15')])&&_0x545ee5['applications'][_0xd9e1('0x16')]){for(var _0x554a8a=0x0;_0x554a8a<_0x545ee5['applications'][_0xd9e1('0x16')];_0x554a8a+=0x1){var _0x390936=_0x545ee5[_0xd9e1('0x15')][_0x554a8a];if(fs[_0xd9e1('0x17')](path[_0xd9e1('0x18')](__dirname,_0xd9e1('0x15'),_0x390936[_0xd9e1('0x19')]+_0xd9e1('0x1a')))){var _0x222651=[];switch(_0x390936[_0xd9e1('0x19')][_0xd9e1('0x1b')]()){case _0xd9e1('0x1c'):var _0x262455=_0x390936[_0xd9e1('0x1d')][_0xd9e1('0x1e')](',');if(_0x545ee5[_0xd9e1('0x11')]===_0xd9e1('0x1f')){_0x222651[_0xd9e1('0x20')](_0x262455[0x0]);_0x222651[_0xd9e1('0x20')](_0x262455[0x1]);_0x222651[_0xd9e1('0x20')](_0x262455[_0xd9e1('0x21')](0x2,_0x262455[_0xd9e1('0x16')])['join'](','));}else{_0x222651[_0xd9e1('0x20')](_0x262455[0x0]);_0x222651[_0xd9e1('0x20')](_0x262455[_0xd9e1('0x21')](0x1,_0x262455[_0xd9e1('0x16')])[_0xd9e1('0x18')](','));}break;case _0xd9e1('0x22'):var _0x593352=_0x390936['appdata'][_0xd9e1('0x1e')](',');_0x222651['push'](_0x593352[0x0]);_0x222651['push'](_0x593352[0x1]);_0x222651[_0xd9e1('0x20')](_0x593352[_0xd9e1('0x21')](0x2,_0x593352[_0xd9e1('0x16')])[_0xd9e1('0x18')](','));break;case _0xd9e1('0x23'):var _0x5811ea=_0x390936[_0xd9e1('0x1d')][_0xd9e1('0x1e')](',');_0x222651[_0xd9e1('0x20')](_0x5811ea[0x0]);_0x222651[_0xd9e1('0x20')](_0x5811ea[0x1]);_0x222651['push'](_0x5811ea[0x2]);_0x222651[_0xd9e1('0x20')](_0x5811ea[0x3]);_0x222651[_0xd9e1('0x20')](_0x5811ea['slice'](0x4,_0x5811ea['length'])[_0xd9e1('0x18')](','));break;case _0xd9e1('0x24'):var _0x6a99d=_0x390936[_0xd9e1('0x1d')][_0xd9e1('0x1e')](',');_0x222651[_0xd9e1('0x20')](_0x6a99d[0x0]);_0x222651[_0xd9e1('0x20')](_0x6a99d[0x1]);_0x222651[_0xd9e1('0x20')](_0x6a99d[0x2]);_0x222651[_0xd9e1('0x20')](_0x6a99d[0x3]);_0x222651['push'](_0x6a99d[_0xd9e1('0x21')](0x4,_0x6a99d[_0xd9e1('0x16')])[_0xd9e1('0x18')](','));break;case _0xd9e1('0x12'):_0x222651[_0xd9e1('0x20')](_0x390936[_0xd9e1('0x1d')]);break;case _0xd9e1('0x25'):_0x222651[_0xd9e1('0x20')](_0x390936['TagId']);_0x222651[_0xd9e1('0x20')](_0x390936['appdata']);break;case _0xd9e1('0x26'):var _0x1bf884=utils['getMustacheRender'](_0x545ee5['account'][_0xd9e1('0x27')],_0x545ee5);var _0x2385c4=_0x390936['appdata'][_0xd9e1('0x1e')](',');_0x222651[_0xd9e1('0x20')](_0x2385c4[0x0]);_0x222651['push'](_0x2385c4[0x1]);_0x222651[_0xd9e1('0x20')](_0x2385c4[0x2]);_0x222651['push'](_0x2385c4[0x3]);_0x222651[_0xd9e1('0x20')](_0x2385c4[0x4]);_0x222651[_0xd9e1('0x20')](_0x2385c4[0x5]);_0x222651[_0xd9e1('0x20')](_0x2385c4[0x6]);_0x222651[_0xd9e1('0x20')](_0x2385c4[0x7]);_0x222651[_0xd9e1('0x20')](_0x2385c4[0x8]);_0x222651[_0xd9e1('0x20')](_0x2385c4[0x9]);_0x222651[_0xd9e1('0x20')](_0x2385c4[0xa]);_0x222651['push'](_0x545ee5[_0xd9e1('0x13')]['id']);_0x222651[_0xd9e1('0x20')](_0x545ee5['message']['id']);_0x222651[_0xd9e1('0x20')](_0x390936['ChatWebsiteId']);_0x222651['push'](_0x545ee5[_0xd9e1('0x13')][_0xd9e1('0x28')]);_0x222651['push'](_0x545ee5['body'][_0xd9e1('0x29')]);_0x222651[_0xd9e1('0x20')](_0x1bf884);break;default:_0x222651=_[_0xd9e1('0xc')](_0x390936[_0xd9e1('0x1d')])?[]:_0x390936[_0xd9e1('0x1d')][_0xd9e1('0x1e')](',');}var _0x1e5ff8={'id':util[_0xd9e1('0x9')](_0xd9e1('0x2a'),_0x2b3f6e,_0x390936['id'],_0x390936['app']),'condition':require(_0xd9e1('0x2b'))[_0xd9e1('0x2c')](_0x2b3f6e,getIntervals(_0x267d8b[_0xd9e1('0x2d')],_0x390936),_0x267d8b),'consequence':require(_0xd9e1('0x2e')+_0x390936[_0xd9e1('0x19')])['consequence'](_0x2b3f6e,_0x222651,_0x267d8b,_0x545ee5),'p':_0x390936[_0xd9e1('0x2f')]||0x0};logger[_0xd9e1('0x30')](_0xd9e1('0x31'),_0x1e5ff8['id'],_0xd9e1('0x32'),getIntervals(_0x267d8b[_0xd9e1('0x2d')],_0x390936)['join'](_0xd9e1('0x33')));_0x28fb99[_0xd9e1('0x20')](_0x1e5ff8);}else{logger[_0xd9e1('0x34')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0xd9e1('0x18')](__dirname,_0xd9e1('0x15'),_0x390936['app']+_0xd9e1('0x1a')));}}_0x267d8b['rules'][_0x2b3f6e]=new RuleEngine(_0x28fb99);_0x267d8b[_0xd9e1('0x35')][_0x2b3f6e][_0xd9e1('0x36')](_0x545ee5,function(_0x20c400){logger['info'](_0xd9e1('0x37'),JSON[_0xd9e1('0x38')](_0x20c400[_0xd9e1('0x39')]));if(_0x267d8b['rules'][_0x2b3f6e]){_0x267d8b['rules'][_0x2b3f6e][_0xd9e1('0x3a')]('complete');}});return _0xb29455({'code':0xc8,'message':_0x545ee5});}else{if(_0x289a7e){logger[_0xd9e1('0x30')](util[_0xd9e1('0x9')](_0xd9e1('0x3b'),_0x2b3f6e));}else{logger[_0xd9e1('0x30')](_0xd9e1('0x3c'));}return _0xb29455({'code':0xc8,'message':_0x545ee5});}}catch(_0x473677){logger['error'](_0x473677[_0xd9e1('0x3d')]);return _0x5d25dc(_0x522809['error'](0x1f4,_0x473677));}}return _0x5d25dc(_0xd9e1('0x3e'));});},'AcceptMessage':function(_0x32f7cf){var _0x9b5b48=this;return new Promise(function(_0xfb4fa9,_0x3f157f){if(_0x32f7cf['agent']&&_0x32f7cf[_0xd9e1('0x3f')]['id']){if(_0x267d8b['agents'][_0x32f7cf[_0xd9e1('0x3f')]['id']]){_0x267d8b['agents'][_0x32f7cf[_0xd9e1('0x3f')]['id']][_0xd9e1('0x40')]=![];_0x267d8b[_0xd9e1('0x41')][_0x32f7cf[_0xd9e1('0x3f')]['id']]['busyQueue']=undefined;}}if(_0x32f7cf[_0xd9e1('0x12')]&&_0x32f7cf['message']['id']){try{var _0x3fb258=getId(_0x32f7cf['channel'],_0x32f7cf[_0xd9e1('0x12')]?_0x32f7cf[_0xd9e1('0x12')]['id']:0x0,_0x32f7cf[_0xd9e1('0x13')]?_0x32f7cf[_0xd9e1('0x13')]['id']:0x0);if(_0x267d8b[_0xd9e1('0x35')][_0x3fb258]){_0x267d8b[_0xd9e1('0x35')][_0x3fb258][_0xd9e1('0x3a')](_0xd9e1('0x42'));if(rpc[_0x32f7cf[_0xd9e1('0x11')]+_0xd9e1('0x43')]){rpc[_0x32f7cf[_0xd9e1('0x11')]+_0xd9e1('0x43')][_0xd9e1('0x44')](_0x3fb258,{'UserId':_0x32f7cf[_0xd9e1('0x12')][_0xd9e1('0x45')]})[_0xd9e1('0x46')](function(){logger[_0xd9e1('0x34')](_0xd9e1('0x47'));});}}return _0xfb4fa9({'code':0xc8,'message':_0x32f7cf});}catch(_0x23f2bb){logger['error'](_0x23f2bb[_0xd9e1('0x3d')]);return _0x3f157f(_0x9b5b48[_0xd9e1('0x34')](0x1f4,_0x23f2bb));}}logger['error']('message\x20is\x20empty');return _0x3f157f(_0x9b5b48[_0xd9e1('0x34')](0x1f4,_0xd9e1('0x48')));});},'RejectMessage':function(_0x2c3ba7){var _0x2d5b42=this;return new Promise(function(_0x330ccc,_0x510cfd){if(_0x2c3ba7['agent']&&_0x2c3ba7['agent']['id']){try{if(_0x267d8b[_0xd9e1('0x41')][_0x2c3ba7[_0xd9e1('0x3f')]['id']]){_0x267d8b['agents'][_0x2c3ba7[_0xd9e1('0x3f')]['id']][_0xd9e1('0x40')]=![];_0x267d8b[_0xd9e1('0x41')][_0x2c3ba7['agent']['id']][_0xd9e1('0x49')]=undefined;}return _0x330ccc({'code':0xc8,'message':_0x2c3ba7});}catch(_0x432b85){logger[_0xd9e1('0x34')](_0x432b85[_0xd9e1('0x3d')]);return _0x510cfd(_0x2d5b42['error'](0x1f4,_0x432b85));}}logger[_0xd9e1('0x34')](_0xd9e1('0x48'));return _0x510cfd(_0x2d5b42[_0xd9e1('0x34')](0x1f4,_0xd9e1('0x48')));});},'AbandonInteraction':function(_0xd24808){var _0x18bfc3=this;return new Promise(function(_0x5789ca,_0x17ffba){if(_0xd24808[_0xd9e1('0x11')]&&_0xd24808['interaction']&&_0xd24808[_0xd9e1('0x13')]['id']){try{var _0x437f01=getId(_0xd24808[_0xd9e1('0x11')],_0xd24808[_0xd9e1('0x12')]?_0xd24808['message']['id']:0x0,_0xd24808['interaction']?_0xd24808[_0xd9e1('0x13')]['id']:0x0);if(_0x267d8b['rules'][_0x437f01]){_0x267d8b['rules'][_0x437f01][_0xd9e1('0x3a')](_0xd9e1('0x42'));}return _0x5789ca({'code':0xc8,'message':_0xd24808});}catch(_0x3de8cf){logger['error'](_0x3de8cf[_0xd9e1('0x3d')]);return _0x17ffba(_0x18bfc3['error'](0x1f4,_0x3de8cf));}}logger[_0xd9e1('0x34')](_0xd9e1('0x48'));return _0x17ffba(_0x18bfc3['error'](0x1f4,_0xd9e1('0x48')));});},'AgentCapacity':function(_0x4f6ca2){var _0x30cdf9=this;return new Promise(function(_0x11593e,_0x4eb21f){if(_0x267d8b[_0xd9e1('0x41')][_0xd9e1('0x4a')](_0x4f6ca2['id'])){for(var _0x28cc35 in _0x4f6ca2[_0xd9e1('0x4b')]){if(_0x4f6ca2[_0xd9e1('0x4b')]['hasOwnProperty'](_0x28cc35)){if(_0x267d8b[_0xd9e1('0x41')][_0x4f6ca2['id']]['hasOwnProperty'](_0x28cc35+_0xd9e1('0x4c'))){_0x267d8b[_0xd9e1('0x41')][_0x4f6ca2['id']][_0x28cc35+_0xd9e1('0x4c')]=parseInt(_0x4f6ca2[_0xd9e1('0x4b')][_0x28cc35],0xa);}}}_0x267d8b[_0xd9e1('0x41')][_0x4f6ca2['id']][_0xd9e1('0x4d')]();return _0x11593e({'code':0xc8,'message':_0x267d8b[_0xd9e1('0x41')][_0x4f6ca2['id']]});}else{return _0x4eb21f(_0x30cdf9[_0xd9e1('0x34')](0x1f4,_0xd9e1('0x4e')));}});},'Agents':function(_0x1025b7){return new Promise(function(_0x16d36f){var _0x1e7104=_[_0xd9e1('0x4f')](_0x267d8b[_0xd9e1('0x41')]);if(_0x1025b7&&_0x1025b7['id']){var _0x53e3c6=_[_0xd9e1('0x50')](_0x1e7104,function(_0x4e76ae){return _0x4e76ae['id']===_0x1025b7['id'];});_0x16d36f(_0x53e3c6);}else{_0x16d36f({'count':_0x1e7104[_0xd9e1('0x16')],'rows':_0x1e7104});}});},'ChatQueues':function(){return new Promise(function(_0x196b73){var _0x598b55=[];for(var _0x1cb995 in _0x267d8b[_0xd9e1('0x51')]){if(_0x267d8b[_0xd9e1('0x51')][_0xd9e1('0x4a')](_0x1cb995)){var _0x32bd14=_0x267d8b[_0xd9e1('0x51')][_0x1cb995];var _0x2ec8f2={'id':_0x32bd14['id'],'available':_0x32bd14[_0xd9e1('0x52')],'loggedIn':_0x32bd14[_0xd9e1('0x53')],'name':_0x32bd14[_0xd9e1('0x54')],'paused':_0x32bd14[_0xd9e1('0x55')],'waiting':_0x32bd14[_0xd9e1('0x56')]};_0x598b55[_0xd9e1('0x20')](_0x2ec8f2);}}_0x196b73({'count':_0x598b55[_0xd9e1('0x16')],'rows':_0x598b55});});},'MailQueues':function(){return new Promise(function(_0x43e380){var _0x192232=[];for(var _0x59c3a8 in _0x267d8b['mailQueues']){if(_0x267d8b[_0xd9e1('0x57')][_0xd9e1('0x4a')](_0x59c3a8)){var _0x11062b=_0x267d8b[_0xd9e1('0x57')][_0x59c3a8];var _0x4a46dd={'id':_0x11062b['id'],'available':_0x11062b[_0xd9e1('0x52')],'loggedIn':_0x11062b[_0xd9e1('0x53')],'name':_0x11062b[_0xd9e1('0x54')],'paused':_0x11062b[_0xd9e1('0x55')],'waiting':_0x11062b[_0xd9e1('0x56')]};_0x192232[_0xd9e1('0x20')](_0x4a46dd);}}_0x43e380({'count':_0x192232[_0xd9e1('0x16')],'rows':_0x192232});});},'OpenchannelQueues':function(){return new Promise(function(_0x5c96c4){var _0x10ebad=[];for(var _0x58b822 in _0x267d8b[_0xd9e1('0x58')]){if(_0x267d8b['openchannelQueues'][_0xd9e1('0x4a')](_0x58b822)){var _0x5ab4b8=_0x267d8b[_0xd9e1('0x58')][_0x58b822];var _0x417fae={'id':_0x5ab4b8['id'],'available':_0x5ab4b8[_0xd9e1('0x52')],'loggedIn':_0x5ab4b8[_0xd9e1('0x53')],'name':_0x5ab4b8['name'],'paused':_0x5ab4b8[_0xd9e1('0x55')],'waiting':_0x5ab4b8[_0xd9e1('0x56')]};_0x10ebad[_0xd9e1('0x20')](_0x417fae);}}_0x5c96c4({'count':_0x10ebad[_0xd9e1('0x16')],'rows':_0x10ebad});});},'SmsQueues':function(){return new Promise(function(_0x5f07ea){var _0x1cb54c=[];for(var _0x3714af in _0x267d8b[_0xd9e1('0x59')]){if(_0x267d8b['smsQueues'][_0xd9e1('0x4a')](_0x3714af)){var _0x2c834a=_0x267d8b[_0xd9e1('0x59')][_0x3714af];var _0x4bb704={'id':_0x2c834a['id'],'available':_0x2c834a[_0xd9e1('0x52')],'loggedIn':_0x2c834a[_0xd9e1('0x53')],'name':_0x2c834a['name'],'paused':_0x2c834a[_0xd9e1('0x55')],'waiting':_0x2c834a[_0xd9e1('0x56')]};_0x1cb54c['push'](_0x4bb704);}}_0x5f07ea({'count':_0x1cb54c[_0xd9e1('0x16')],'rows':_0x1cb54c});});},'FaxQueues':function(){return new Promise(function(_0xd5adc6){var _0x1879d6=[];for(var _0x2b33ad in _0x267d8b[_0xd9e1('0x5a')]){if(_0x267d8b[_0xd9e1('0x5a')]['hasOwnProperty'](_0x2b33ad)){var _0x42bd87=_0x267d8b['faxQueues'][_0x2b33ad];var _0x377941={'id':_0x42bd87['id'],'available':_0x42bd87['available'],'loggedIn':_0x42bd87[_0xd9e1('0x53')],'name':_0x42bd87['name'],'paused':_0x42bd87[_0xd9e1('0x55')],'waiting':_0x42bd87['waiting']};_0x1879d6[_0xd9e1('0x20')](_0x377941);}}_0xd5adc6({'count':_0x1879d6[_0xd9e1('0x16')],'rows':_0x1879d6});});},'WhatsappQueues':function(){return new Promise(function(_0x289359){var _0x3fde31=[];for(var _0x572385 in _0x267d8b[_0xd9e1('0x5b')]){if(_0x267d8b[_0xd9e1('0x5b')][_0xd9e1('0x4a')](_0x572385)){var _0x3f92f8=_0x267d8b[_0xd9e1('0x5b')][_0x572385];var _0x5d393f={'id':_0x3f92f8['id'],'available':_0x3f92f8[_0xd9e1('0x52')],'loggedIn':_0x3f92f8[_0xd9e1('0x53')],'name':_0x3f92f8[_0xd9e1('0x54')],'paused':_0x3f92f8[_0xd9e1('0x55')],'waiting':_0x3f92f8[_0xd9e1('0x56')]};_0x3fde31[_0xd9e1('0x20')](_0x5d393f);}}_0x289359({'count':_0x3fde31[_0xd9e1('0x16')],'rows':_0x3fde31});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x8cd7a6){var _0x447287=_['values'](_0x267d8b[_0xd9e1('0x5c')]);_0x8cd7a6({'count':_0x447287[_0xd9e1('0x16')],'rows':_0x447287});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x5cd3e4){var _0x52c8c4=_['values'](_0x267d8b['mailQueuesWaitingInteractions']);_0x5cd3e4({'count':_0x52c8c4[_0xd9e1('0x16')],'rows':_0x52c8c4});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x4de5c1){var _0x518600=_[_0xd9e1('0x4f')](_0x267d8b[_0xd9e1('0x5d')]);_0x4de5c1({'count':_0x518600[_0xd9e1('0x16')],'rows':_0x518600});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x5595b7){var _0x2bc3a8=_[_0xd9e1('0x4f')](_0x267d8b[_0xd9e1('0x5e')]);_0x5595b7({'count':_0x2bc3a8['length'],'rows':_0x2bc3a8});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x5ab71a){var _0xcdc5b4=_[_0xd9e1('0x4f')](_0x267d8b[_0xd9e1('0x5f')]);_0x5ab71a({'count':_0xcdc5b4[_0xd9e1('0x16')],'rows':_0xcdc5b4});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0xe37a90){var _0x4a69ae=_[_0xd9e1('0x4f')](_0x267d8b[_0xd9e1('0x60')]);_0xe37a90({'count':_0x4a69ae['length'],'rows':_0x4a69ae});});}};var _0x2850b3=jayson[_0xd9e1('0x61')](_0x19a17b)[_0xd9e1('0x62')]();_0x2850b3['on'](_0xd9e1('0x34'),function(_0xab0933){logger[_0xd9e1('0x34')](JSON[_0xd9e1('0x38')](_0xab0933));return _0x1de35f(_0xab0933);});_0x2850b3[_0xd9e1('0x10')](0x232c,'127.0.0.1',function(){console[_0xd9e1('0x63')](_0xd9e1('0x64'),0x232c);return _0x1ec16f(_0xd9e1('0x65')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 85d3b92..80a87f8 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 _0xcba1=['client','then','error','message','result','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','format','iftime\x20%s','catch','all','\x20|\x20','log','stack','util','jayson/promise','lodash','../../../config/logger','routing'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xcba1,0xa3));var _0x1cba=function(_0x412686,_0x3fde24){_0x412686=_0x412686-0x0;var _0x18619e=_0xcba1[_0x412686];return _0x18619e;};'use strict';var util=require(_0x1cba('0x0'));var BPromise=require('bluebird');var jayson=require(_0x1cba('0x1'));var _=require(_0x1cba('0x2'));var logger=require(_0x1cba('0x3'))(_0x1cba('0x4'));var client=jayson[_0x1cba('0x5')]['http']({'port':0x232a});function request(_0x4bd08b,_0x35b2cb){return new BPromise(function(_0x1ed823,_0x37f26a){return client['request'](_0x4bd08b,_0x35b2cb)[_0x1cba('0x6')](function(_0x482656){if(_0x482656[_0x1cba('0x7')]){return _0x37f26a(_0x482656['error'][_0x1cba('0x8')]);}else{return _0x1ed823(_0x482656[_0x1cba('0x9')]);}})['catch'](function(_0x49c7e5){return _0x37f26a(_0x49c7e5);});});}exports[_0x1cba('0xa')]=function(_0x236ee8,_0xda47ef,_0x355b8a){return function(_0x24cf63){if(_0x355b8a['rules']&&!_0x355b8a[_0x1cba('0xb')][_0x236ee8]){logger[_0x1cba('0xc')](_0x1cba('0xd'),_0x236ee8);return _0x24cf63[_0x1cba('0xe')]();}var _0x153e78=[];for(var _0x12c9f5=0x0;_0x12c9f5<_0xda47ef[_0x1cba('0xf')];_0x12c9f5+=0x1){_0x153e78[_0x1cba('0x10')](request('Command',{'command':util[_0x1cba('0x11')](_0x1cba('0x12'),_0xda47ef[_0x12c9f5])})[_0x1cba('0x6')](function(_0x5dbd52){return _0x5dbd52&&_0x5dbd52[_0x1cba('0x8')]&&_0x5dbd52[_0x1cba('0x8')]['indexOf']('true')>=0x0?!![]:![];})[_0x1cba('0x13')](function(_0xe8e97a){logger['error']('[%s][INTERVAL]\x20%s',_0x236ee8,_0xda47ef[_0x12c9f5]);}));}BPromise[_0x1cba('0x14')](_0x153e78)[_0x1cba('0x6')](function(_0x2a02d2){var _0x153461=_['some'](_0x2a02d2);logger[_0x1cba('0xc')]('[%s][INTERVAL]\x20%s\x20%s',_0x236ee8,_0xda47ef['join'](_0x1cba('0x15')),_0x153461);_0x24cf63['when'](_0x153461);})[_0x1cba('0x13')](function(_0x5de295){console[_0x1cba('0x16')](_0x5de295);logger[_0x1cba('0x7')]('[%s][INTERVAL]\x20%s\x20%s',_0x236ee8,_0xda47ef['join'](_0x1cba('0x15')),_0x5de295[_0x1cba('0x17')]);_0x24cf63[_0x1cba('0xe')]();});};}; \ No newline at end of file +var _0x827d=['routing','client','http','request','then','error','message','catch','condition','rules','stop','length','push','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','some','info','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','bluebird','jayson/promise','lodash','../../../config/logger'];(function(_0x41ad1b,_0x1f1300){var _0x176957=function(_0x1c1ea7){while(--_0x1c1ea7){_0x41ad1b['push'](_0x41ad1b['shift']());}};_0x176957(++_0x1f1300);}(_0x827d,0x13b));var _0xd827=function(_0x81b09d,_0x5042fa){_0x81b09d=_0x81b09d-0x0;var _0x4731d1=_0x827d[_0x81b09d];return _0x4731d1;};'use strict';var util=require('util');var BPromise=require(_0xd827('0x0'));var jayson=require(_0xd827('0x1'));var _=require(_0xd827('0x2'));var logger=require(_0xd827('0x3'))(_0xd827('0x4'));var client=jayson[_0xd827('0x5')][_0xd827('0x6')]({'port':0x232a});function request(_0x1dd1f0,_0x3ec41e){return new BPromise(function(_0x42d7f3,_0x56c720){return client[_0xd827('0x7')](_0x1dd1f0,_0x3ec41e)[_0xd827('0x8')](function(_0x2e5f96){if(_0x2e5f96[_0xd827('0x9')]){return _0x56c720(_0x2e5f96[_0xd827('0x9')][_0xd827('0xa')]);}else{return _0x42d7f3(_0x2e5f96['result']);}})[_0xd827('0xb')](function(_0x46daa8){return _0x56c720(_0x46daa8);});});}exports[_0xd827('0xc')]=function(_0x13b47f,_0x236a1c,_0x10b8e2){return function(_0x1952f8){if(_0x10b8e2[_0xd827('0xd')]&&!_0x10b8e2[_0xd827('0xd')][_0x13b47f]){logger['info']('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x13b47f);return _0x1952f8[_0xd827('0xe')]();}var _0x172cdf=[];for(var _0x1bb364=0x0;_0x1bb364<_0x236a1c[_0xd827('0xf')];_0x1bb364+=0x1){_0x172cdf[_0xd827('0x10')](request('Command',{'command':util['format'](_0xd827('0x11'),_0x236a1c[_0x1bb364])})[_0xd827('0x8')](function(_0x290c93){return _0x290c93&&_0x290c93[_0xd827('0xa')]&&_0x290c93[_0xd827('0xa')][_0xd827('0x12')](_0xd827('0x13'))>=0x0?!![]:![];})[_0xd827('0xb')](function(_0x1ba481){logger['error'](_0xd827('0x14'),_0x13b47f,_0x236a1c[_0x1bb364]);}));}BPromise['all'](_0x172cdf)[_0xd827('0x8')](function(_0x3ef21a){var _0x54a650=_[_0xd827('0x15')](_0x3ef21a);logger[_0xd827('0x16')](_0xd827('0x17'),_0x13b47f,_0x236a1c[_0xd827('0x18')](_0xd827('0x19')),_0x54a650);_0x1952f8[_0xd827('0x1a')](_0x54a650);})[_0xd827('0xb')](function(_0x8b397c){console[_0xd827('0x1b')](_0x8b397c);logger['error']('[%s][INTERVAL]\x20%s\x20%s',_0x13b47f,_0x236a1c[_0xd827('0x18')](_0xd827('0x19')),_0x8b397c[_0xd827('0x1c')]);_0x1952f8[_0xd827('0xe')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index cebe19f..19f7827 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 _0x80ed=['secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','clone','calleridname','hangup','[%s][agents][hangup]','timeout','cause','rejected','indexOf','splice','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','agent','lodash','./utils','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','interface','calleridnum','lastevent','queue','getVoiceQueueByName','then','type','agentacw','agentcomplete','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','[%s][agents][agentcalled]','agentcalledAt','called','connectedlinenum','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','now','reason','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','debug','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','[%s][agents][agentcomplete]','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfererexten','transfereeuniqueid','agententerreason'];(function(_0x4bf784,_0x5e484b){var _0x221167=function(_0x18486c){while(--_0x18486c){_0x4bf784['push'](_0x4bf784['shift']());}};_0x221167(++_0x5e484b);}(_0x80ed,0x11c));var _0xd80e=function(_0x526e68,_0x256cca){_0x526e68=_0x526e68-0x0;var _0x44f3e6=_0x80ed[_0x526e68];return _0x44f3e6;};'use strict';var _=require(_0xd80e('0x0'));var util=require('util');var utils=require(_0xd80e('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x182da3,_0x4329e5){utils['info'](util[_0xd80e('0x2')](_0xd80e('0x3'),_0x182da3[_0xd80e('0x4')],_0x182da3[_0xd80e('0x5')],_0x182da3['queue'],_0x182da3[_0xd80e('0x6')],_0x182da3[_0xd80e('0x7')],_0x182da3[_0xd80e('0x8')],_0x182da3['connectedlinenum'],_0x182da3[_0xd80e('0x9')]));if(_0x182da3[_0xd80e('0xa')]){utils[_0xd80e('0xb')](_0x182da3[_0xd80e('0xa')])[_0xd80e('0xc')](function(_0x298c29){if(_0x298c29){_0x182da3[_0xd80e('0xd')]=_0x298c29[_0xd80e('0xd')];_0x182da3[_0xd80e('0xe')]=_0x182da3[_0xd80e('0xf')]?_0x298c29['acw']:![];_0x182da3[_0xd80e('0x10')]=_0x182da3[_0xd80e('0xe')]?_0x298c29[_0xd80e('0x11')]:0x0;}utils[_0xd80e('0x12')](_0xd80e('0x13'),_0x182da3);});}else{utils[_0xd80e('0x12')](_0xd80e('0x13'),_0x182da3);}if(_0x4329e5){delete transfers[_0x182da3[_0xd80e('0x4')]];}else{delete agents[_0x182da3[_0xd80e('0x14')]];}}exports['agentcalled']=function(_0x5691a1){try{utils['debug'](util['format'](_0xd80e('0x15'),_0x5691a1[_0xd80e('0x4')]),_0x5691a1);agents[_0x5691a1[_0xd80e('0x14')]]=_0x5691a1;agents[_0x5691a1[_0xd80e('0x14')]][_0xd80e('0x16')]=utils['now']();agents[_0x5691a1[_0xd80e('0x14')]][_0xd80e('0x9')]=_0xd80e('0x17');agents[_0x5691a1[_0xd80e('0x14')]][_0xd80e('0x18')]=null;agents[_0x5691a1[_0xd80e('0x14')]][_0xd80e('0x19')]=null;utils[_0xd80e('0x1a')](util['format'](_0xd80e('0x1b'),_0x5691a1[_0xd80e('0x4')],agents[_0x5691a1[_0xd80e('0x14')]][_0xd80e('0x6')],_0x5691a1['destuniqueid']));}catch(_0x39397a){utils[_0xd80e('0x1c')](util[_0xd80e('0x2')]('[%s][agents][agentcalled]',_0x5691a1[_0xd80e('0x4')]),_0x39397a);}};exports[_0xd80e('0x1d')]=function(_0x2765ea){try{if(!_[_0xd80e('0x1e')](agents[_0x2765ea[_0xd80e('0x14')]])){utils['debug'](util['format'](_0xd80e('0x1f'),_0x2765ea[_0xd80e('0x4')]),_0x2765ea);utils[_0xd80e('0x1a')](util[_0xd80e('0x2')](_0xd80e('0x20'),_0x2765ea[_0xd80e('0x4')],agents[_0x2765ea[_0xd80e('0x14')]]['membername'],_0x2765ea[_0xd80e('0x14')]));agents[_0x2765ea[_0xd80e('0x14')]][_0xd80e('0x1d')]=!![];agents[_0x2765ea['destuniqueid']][_0xd80e('0x21')]=utils[_0xd80e('0x22')]();agents[_0x2765ea[_0xd80e('0x14')]]['lastevent']='timeout';agents[_0x2765ea['destuniqueid']][_0xd80e('0x23')]='timeout';agents[_0x2765ea[_0xd80e('0x14')]][_0xd80e('0x24')]=_0x2765ea['ringtime']?parseInt(_0x2765ea[_0xd80e('0x25')])/0x3e8:0x0;agents[_0x2765ea[_0xd80e('0x14')]][_0xd80e('0x26')]=0x0;unanswered[_0xd80e('0x27')](_0x2765ea['destuniqueid']);}}catch(_0x15f317){utils[_0xd80e('0x1c')](util[_0xd80e('0x2')](_0xd80e('0x1f'),_0x2765ea[_0xd80e('0x4')]),_0x15f317);}};exports[_0xd80e('0x28')]=function(_0x289685){try{_[_0xd80e('0x29')](agents,function(_0x5522dd,_0x54504e){if(_0x5522dd[_0xd80e('0x4')]==_0x289685[_0xd80e('0x4')]&&!_[_0xd80e('0x2a')](unanswered,_0x5522dd[_0xd80e('0x14')])){utils[_0xd80e('0x2b')](util[_0xd80e('0x2')]('[%s][agents][queuecallerabandon]',_0x289685['uniqueid']),_0x289685);utils[_0xd80e('0x1a')](util[_0xd80e('0x2')](_0xd80e('0x2c'),_0x289685[_0xd80e('0x4')],_0x5522dd[_0xd80e('0x6')],_0x5522dd[_0xd80e('0x14')]));_0x5522dd[_0xd80e('0x1d')]=!![];_0x5522dd[_0xd80e('0x21')]=utils['now']();_0x5522dd['lastevent']=_0xd80e('0x2d');_0x5522dd[_0xd80e('0x23')]=_0xd80e('0x2d');_0x5522dd[_0xd80e('0x24')]=_0x289685[_0xd80e('0x24')];_0x5522dd[_0xd80e('0x26')]=0x0;writeDB(_0x5522dd);}});}catch(_0x17b8c7){utils[_0xd80e('0x1c')](util[_0xd80e('0x2')](_0xd80e('0x2e'),_0x289685['uniqueid']),_0x17b8c7);}};exports[_0xd80e('0x2f')]=function(_0x490432){try{if(agents[_0x490432[_0xd80e('0x14')]]){utils[_0xd80e('0x2b')](util[_0xd80e('0x2')](_0xd80e('0x30'),_0x490432['uniqueid']),_0x490432);utils[_0xd80e('0x1a')](util['format'](_0xd80e('0x31'),_0x490432['uniqueid'],agents[_0x490432[_0xd80e('0x14')]][_0xd80e('0x6')],_0x490432['destuniqueid']));agents[_0x490432[_0xd80e('0x14')]][_0xd80e('0x32')]=utils[_0xd80e('0x22')]();agents[_0x490432['destuniqueid']][_0xd80e('0x18')]=_0x490432[_0xd80e('0x18')];agents[_0x490432[_0xd80e('0x14')]][_0xd80e('0x19')]=_0x490432[_0xd80e('0x19')];agents[_0x490432[_0xd80e('0x14')]][_0xd80e('0x24')]=_0x490432[_0xd80e('0x25')];agents[_0x490432[_0xd80e('0x14')]]['lastevent']='connect';_['forIn'](agents,function(_0x161455,_0x3ff4b4){if(_0x161455['destuniqueid']!=_0x490432[_0xd80e('0x14')]&&_0x161455['uniqueid']==_0x490432[_0xd80e('0x4')]){_0x161455['talktime']=0x0;_0x161455[_0xd80e('0x24')]=_0x490432[_0xd80e('0x25')];_0x161455['agentringnoanswer']=!![];_0x161455['agentringnoanswerAt']=utils[_0xd80e('0x22')]();_0x161455[_0xd80e('0x9')]=_0xd80e('0x33');_0x161455[_0xd80e('0x23')]=_0xd80e('0x33');_0x161455[_0xd80e('0x34')]=_0x490432[_0xd80e('0x14')];_0x161455[_0xd80e('0x35')]=_0x490432[_0xd80e('0x6')];writeDB(_0x161455);}});}}catch(_0x2da5f5){utils[_0xd80e('0x1c')](util[_0xd80e('0x2')](_0xd80e('0x30'),_0x490432[_0xd80e('0x4')]),_0x2da5f5);}};exports[_0xd80e('0xf')]=function(_0x7f80a){try{if(!_['isNil'](agents[_0x7f80a['destuniqueid']])){utils['debug'](util[_0xd80e('0x2')]('[%s][agents][agentcomplete]',_0x7f80a[_0xd80e('0x4')]),_0x7f80a);utils[_0xd80e('0x1a')](util[_0xd80e('0x2')](_0xd80e('0x36'),_0x7f80a[_0xd80e('0x4')],agents[_0x7f80a[_0xd80e('0x14')]]['membername'],_0x7f80a['destuniqueid']));agents[_0x7f80a['destuniqueid']][_0xd80e('0xf')]=!![];agents[_0x7f80a['destuniqueid']][_0xd80e('0x37')]=utils[_0xd80e('0x22')]();agents[_0x7f80a[_0xd80e('0x14')]][_0xd80e('0x26')]=utils[_0xd80e('0x38')](agents[_0x7f80a['destuniqueid']][_0xd80e('0x37')],agents[_0x7f80a[_0xd80e('0x14')]][_0xd80e('0x32')]);agents[_0x7f80a['destuniqueid']][_0xd80e('0x23')]=_0x7f80a[_0xd80e('0x23')];agents[_0x7f80a[_0xd80e('0x14')]]['lastevent']=_0xd80e('0x39');writeDB(agents[_0x7f80a[_0xd80e('0x14')]]);}}catch(_0xf0d5aa){utils[_0xd80e('0x1c')](util[_0xd80e('0x2')](_0xd80e('0x3a'),_0x7f80a['uniqueid']),_0xf0d5aa);}};exports['blindtransfer']=function(_0x275985){try{if(!_[_0xd80e('0x1e')](agents[_0x275985[_0xd80e('0x3b')]])){utils['debug'](util['format'](_0xd80e('0x3c'),_0x275985[_0xd80e('0x4')]),_0x275985);utils[_0xd80e('0x1a')](util[_0xd80e('0x2')](_0xd80e('0x3d'),_0x275985['uniqueid'],agents[_0x275985[_0xd80e('0x3b')]]['membername'],agents[_0x275985[_0xd80e('0x3b')]][_0xd80e('0x4')]));agents[_0x275985['transfereruniqueid']][_0xd80e('0x3e')]=!![];agents[_0x275985[_0xd80e('0x3b')]][_0xd80e('0x3f')]=_0xd80e('0x40');agents[_0x275985[_0xd80e('0x3b')]][_0xd80e('0x41')]=_0x275985[_0xd80e('0x42')];agents[_0x275985['transfereruniqueid']][_0xd80e('0x43')]=agents[_0x275985[_0xd80e('0x3b')]][_0xd80e('0x4')];}}catch(_0x4a66ca){utils['error'](util[_0xd80e('0x2')](_0xd80e('0x3c'),_0x275985[_0xd80e('0x4')]),_0x4a66ca);}};exports[_0xd80e('0x44')]=function(_0x2f66eb){try{utils[_0xd80e('0x2b')](util[_0xd80e('0x2')](_0xd80e('0x45'),_0x2f66eb['origtransfereruniqueid']),_0x2f66eb);if(_0x2f66eb[_0xd80e('0x46')]==_0x2f66eb['origtransfererlinkedid']){if(!_[_0xd80e('0x1e')](agents[_0x2f66eb[_0xd80e('0x47')]])){utils[_0xd80e('0x1a')](util[_0xd80e('0x2')](_0xd80e('0x48'),_0x2f66eb[_0xd80e('0x46')],agents[_0x2f66eb['secondtransfereruniqueid']][_0xd80e('0x6')]));agents[_0x2f66eb['secondtransfereruniqueid']][_0xd80e('0x3e')]=!![];agents[_0x2f66eb[_0xd80e('0x47')]]['transfertype']='ATTENDED';agents[_0x2f66eb[_0xd80e('0x47')]][_0xd80e('0x41')]=_0x2f66eb[_0xd80e('0x49')];agents[_0x2f66eb['secondtransfereruniqueid']]['transferuniqueid']=_0x2f66eb[_0xd80e('0x46')];}if(_0x2f66eb[_0xd80e('0x4a')]&&agents[_0x2f66eb['transfereeuniqueid']]){agents[_0x2f66eb[_0xd80e('0x4a')]][_0xd80e('0x4b')]=0x1;transfers[_0x2f66eb[_0xd80e('0x4a')]]=_['clone'](agents[_0x2f66eb[_0xd80e('0x4a')]]);transfers[_0x2f66eb['transfereeuniqueid']][_0xd80e('0x8')]=agents[_0x2f66eb[_0xd80e('0x47')]][_0xd80e('0x8')];transfers[_0x2f66eb[_0xd80e('0x4a')]]['calleridname']=agents[_0x2f66eb[_0xd80e('0x47')]]['calleridname'];transfers[_0x2f66eb[_0xd80e('0x4a')]]['agentcalledAt']=utils[_0xd80e('0x22')]();transfers[_0x2f66eb[_0xd80e('0x4a')]][_0xd80e('0x32')]=utils[_0xd80e('0x22')]();transfers[_0x2f66eb['transfereeuniqueid']][_0xd80e('0x24')]=0x0;transfers[_0x2f66eb[_0xd80e('0x4a')]]['agententerreason']=0x2;}}else if(_0x2f66eb[_0xd80e('0x47')]==_0x2f66eb[_0xd80e('0x4c')]){if(!_[_0xd80e('0x1e')](agents[_0x2f66eb[_0xd80e('0x46')]])){utils['info'](util[_0xd80e('0x2')](_0xd80e('0x48'),_0x2f66eb['origtransfereruniqueid'],agents[_0x2f66eb[_0xd80e('0x46')]][_0xd80e('0x6')]));agents[_0x2f66eb[_0xd80e('0x46')]]['transfer']=!![];agents[_0x2f66eb['origtransfereruniqueid']]['transfertype']='ATTENDED';agents[_0x2f66eb[_0xd80e('0x46')]]['transferexten']=_0x2f66eb[_0xd80e('0x4d')];agents[_0x2f66eb[_0xd80e('0x46')]][_0xd80e('0x43')]=_0x2f66eb['secondtransfereruniqueid'];}if(_0x2f66eb[_0xd80e('0x4e')]&&agents[_0x2f66eb[_0xd80e('0x4e')]]){agents[_0x2f66eb[_0xd80e('0x4e')]][_0xd80e('0x4b')]=0x1;transfers[_0x2f66eb[_0xd80e('0x4e')]]=_[_0xd80e('0x4f')](agents[_0x2f66eb[_0xd80e('0x4e')]]);transfers[_0x2f66eb[_0xd80e('0x4e')]][_0xd80e('0x8')]=agents[_0x2f66eb['origtransfereruniqueid']]['calleridnum'];transfers[_0x2f66eb[_0xd80e('0x4e')]][_0xd80e('0x50')]=agents[_0x2f66eb[_0xd80e('0x46')]][_0xd80e('0x50')];transfers[_0x2f66eb['transfertargetuniqueid']][_0xd80e('0x16')]=utils[_0xd80e('0x22')]();transfers[_0x2f66eb[_0xd80e('0x4e')]][_0xd80e('0x32')]=utils[_0xd80e('0x22')]();transfers[_0x2f66eb['transfertargetuniqueid']][_0xd80e('0x24')]=0x0;transfers[_0x2f66eb[_0xd80e('0x4e')]][_0xd80e('0x4b')]=0x2;}}}catch(_0x1676c7){utils['error'](util[_0xd80e('0x2')](_0xd80e('0x45'),_0x2f66eb[_0xd80e('0x46')]),_0x1676c7);}};exports[_0xd80e('0x51')]=function(_0x433782){try{utils[_0xd80e('0x2b')](util['format'](_0xd80e('0x52'),_0x433782[_0xd80e('0x4')]),_0x433782);if(agents[_0x433782['uniqueid']]&&agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x23')]===_0xd80e('0x53')){if(_0x433782[_0xd80e('0x54')]==='21'){agents[_0x433782['uniqueid']][_0xd80e('0x23')]='rejected';agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x9')]=_0xd80e('0x55');}utils[_0xd80e('0x1a')](util[_0xd80e('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x433782[_0xd80e('0x4')],agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x6')],agents[_0x433782[_0xd80e('0x4')]]['reason'],agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x9')]));writeDB(agents[_0x433782['uniqueid']]);var _0x2597a3=unanswered[_0xd80e('0x56')](_0x433782[_0xd80e('0x4')]);if(_0x2597a3>-0x1){unanswered[_0xd80e('0x57')](_0x2597a3,0x1);}}if(transfers[_0x433782[_0xd80e('0x4')]]){transfers[_0x433782[_0xd80e('0x4')]]['agentcomplete']=!![];transfers[_0x433782['uniqueid']][_0xd80e('0x37')]=utils['now']();transfers[_0x433782['uniqueid']][_0xd80e('0x26')]=utils[_0xd80e('0x38')](transfers[_0x433782[_0xd80e('0x4')]][_0xd80e('0x37')],transfers[_0x433782[_0xd80e('0x4')]][_0xd80e('0x32')]);transfers[_0x433782[_0xd80e('0x4')]][_0xd80e('0x23')]='agent';transfers[_0x433782[_0xd80e('0x4')]][_0xd80e('0x9')]=_0xd80e('0x39');utils[_0xd80e('0x1a')](util['format'](_0xd80e('0x58'),_0x433782[_0xd80e('0x4')],transfers[_0x433782['uniqueid']][_0xd80e('0x6')],transfers[_0x433782[_0xd80e('0x4')]]['reason'],transfers[_0x433782[_0xd80e('0x4')]][_0xd80e('0x9')]));writeDB(transfers[_0x433782[_0xd80e('0x4')]],!![]);}if(agents[_0x433782[_0xd80e('0x4')]]&&agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x32')]){agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0xf')]=!![];agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x37')]=utils['now']();agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x26')]=utils['diffTime'](agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x37')],agents[_0x433782[_0xd80e('0x4')]]['agentconnectAt']);agents[_0x433782[_0xd80e('0x4')]]['reason']=agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x3e')]?_0xd80e('0x3e'):_0xd80e('0x59');agents[_0x433782[_0xd80e('0x4')]]['lastevent']=_0xd80e('0x39');utils[_0xd80e('0x1a')](util[_0xd80e('0x2')](_0xd80e('0x58'),_0x433782[_0xd80e('0x4')],agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x6')],agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x23')],agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x9')]));writeDB(agents[_0x433782[_0xd80e('0x4')]]);}}catch(_0x31fd22){utils[_0xd80e('0x1c')](util['format'](_0xd80e('0x52'),_0x433782['uniqueid']),_0x31fd22);}}; \ No newline at end of file +var _0xbee3=['answeredelsewheremembername','[%s][agents][agentconnect]','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','complete','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','transferexten','transfereeuniqueid','agententerreason','clone','calleridnum','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfererexten','transfertargetuniqueid','calleridname','agentconnectAt','hangup','[%s][agents][hangup]','timeout','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agentcompleteAt','agent','util','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','interface','connectedlinenum','lastevent','queue','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','format','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswer','agentringnoanswerAt','now','reason','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','abandoned','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','answered_elsewhere','answeredelsewheredestinationuniqueid'];(function(_0x1198f1,_0x37b5dd){var _0x258491=function(_0x57dad4){while(--_0x57dad4){_0x1198f1['push'](_0x1198f1['shift']());}};_0x258491(++_0x37b5dd);}(_0xbee3,0xd5));var _0x3bee=function(_0x507e6b,_0xa06980){_0x507e6b=_0x507e6b-0x0;var _0x5295db=_0xbee3[_0x507e6b];return _0x5295db;};'use strict';var _=require('lodash');var util=require(_0x3bee('0x0'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x56a879,_0x45a1bf){utils[_0x3bee('0x1')](util['format'](_0x3bee('0x2'),_0x56a879[_0x3bee('0x3')],_0x56a879[_0x3bee('0x4')],_0x56a879['queue'],_0x56a879[_0x3bee('0x5')],_0x56a879[_0x3bee('0x6')],_0x56a879['calleridnum'],_0x56a879[_0x3bee('0x7')],_0x56a879[_0x3bee('0x8')]));if(_0x56a879[_0x3bee('0x9')]){utils[_0x3bee('0xa')](_0x56a879[_0x3bee('0x9')])[_0x3bee('0xb')](function(_0x3485b8){if(_0x3485b8){_0x56a879['type']=_0x3485b8[_0x3bee('0xc')];_0x56a879[_0x3bee('0xd')]=_0x56a879[_0x3bee('0xe')]?_0x3485b8[_0x3bee('0xf')]:![];_0x56a879[_0x3bee('0x10')]=_0x56a879[_0x3bee('0xd')]?_0x3485b8['acwTimeout']:0x0;}utils[_0x3bee('0x11')]('CreateVoiceAgentReport',_0x56a879);});}else{utils[_0x3bee('0x11')](_0x3bee('0x12'),_0x56a879);}if(_0x45a1bf){delete transfers[_0x56a879[_0x3bee('0x3')]];}else{delete agents[_0x56a879[_0x3bee('0x13')]];}}exports[_0x3bee('0x14')]=function(_0x459129){try{utils[_0x3bee('0x15')](util['format'](_0x3bee('0x16'),_0x459129[_0x3bee('0x3')]),_0x459129);agents[_0x459129[_0x3bee('0x13')]]=_0x459129;agents[_0x459129[_0x3bee('0x13')]][_0x3bee('0x17')]=utils['now']();agents[_0x459129['destuniqueid']][_0x3bee('0x8')]='called';agents[_0x459129[_0x3bee('0x13')]][_0x3bee('0x7')]=null;agents[_0x459129['destuniqueid']]['connectedlinename']=null;utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x19'),_0x459129[_0x3bee('0x3')],agents[_0x459129['destuniqueid']][_0x3bee('0x5')],_0x459129[_0x3bee('0x13')]));}catch(_0x440644){utils[_0x3bee('0x1a')](util[_0x3bee('0x18')](_0x3bee('0x16'),_0x459129[_0x3bee('0x3')]),_0x440644);}};exports['agentringnoanswer']=function(_0x4f36af){try{if(!_[_0x3bee('0x1b')](agents[_0x4f36af[_0x3bee('0x13')]])){utils['debug'](util[_0x3bee('0x18')](_0x3bee('0x1c'),_0x4f36af[_0x3bee('0x3')]),_0x4f36af);utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x1d'),_0x4f36af[_0x3bee('0x3')],agents[_0x4f36af['destuniqueid']][_0x3bee('0x5')],_0x4f36af[_0x3bee('0x13')]));agents[_0x4f36af[_0x3bee('0x13')]][_0x3bee('0x1e')]=!![];agents[_0x4f36af['destuniqueid']][_0x3bee('0x1f')]=utils[_0x3bee('0x20')]();agents[_0x4f36af[_0x3bee('0x13')]]['lastevent']='timeout';agents[_0x4f36af[_0x3bee('0x13')]][_0x3bee('0x21')]='timeout';agents[_0x4f36af[_0x3bee('0x13')]][_0x3bee('0x22')]=_0x4f36af[_0x3bee('0x23')]?parseInt(_0x4f36af['ringtime'])/0x3e8:0x0;agents[_0x4f36af[_0x3bee('0x13')]][_0x3bee('0x24')]=0x0;unanswered[_0x3bee('0x25')](_0x4f36af['destuniqueid']);}}catch(_0x239fa4){utils[_0x3bee('0x1a')](util[_0x3bee('0x18')]('[%s][agents][agentringnoanswer]',_0x4f36af[_0x3bee('0x3')]),_0x239fa4);}};exports[_0x3bee('0x26')]=function(_0x27ed99){try{_[_0x3bee('0x27')](agents,function(_0x3433aa,_0x559c2b){if(_0x3433aa['uniqueid']==_0x27ed99[_0x3bee('0x3')]&&!_[_0x3bee('0x28')](unanswered,_0x3433aa[_0x3bee('0x13')])){utils[_0x3bee('0x15')](util['format']('[%s][agents][queuecallerabandon]',_0x27ed99[_0x3bee('0x3')]),_0x27ed99);utils[_0x3bee('0x1')](util['format']('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x27ed99[_0x3bee('0x3')],_0x3433aa[_0x3bee('0x5')],_0x3433aa[_0x3bee('0x13')]));_0x3433aa[_0x3bee('0x1e')]=!![];_0x3433aa[_0x3bee('0x1f')]=utils[_0x3bee('0x20')]();_0x3433aa[_0x3bee('0x8')]=_0x3bee('0x29');_0x3433aa[_0x3bee('0x21')]=_0x3bee('0x29');_0x3433aa['holdtime']=_0x27ed99['holdtime'];_0x3433aa[_0x3bee('0x24')]=0x0;writeDB(_0x3433aa);}});}catch(_0x4a4706){utils['error'](util[_0x3bee('0x18')](_0x3bee('0x2a'),_0x27ed99[_0x3bee('0x3')]),_0x4a4706);}};exports[_0x3bee('0x2b')]=function(_0xd926f8){try{if(agents[_0xd926f8[_0x3bee('0x13')]]){utils[_0x3bee('0x15')](util[_0x3bee('0x18')]('[%s][agents][agentconnect]',_0xd926f8[_0x3bee('0x3')]),_0xd926f8);utils[_0x3bee('0x1')](util['format'](_0x3bee('0x2c'),_0xd926f8[_0x3bee('0x3')],agents[_0xd926f8[_0x3bee('0x13')]][_0x3bee('0x5')],_0xd926f8[_0x3bee('0x13')]));agents[_0xd926f8['destuniqueid']]['agentconnectAt']=utils[_0x3bee('0x20')]();agents[_0xd926f8[_0x3bee('0x13')]][_0x3bee('0x7')]=_0xd926f8[_0x3bee('0x7')];agents[_0xd926f8[_0x3bee('0x13')]][_0x3bee('0x2d')]=_0xd926f8[_0x3bee('0x2d')];agents[_0xd926f8[_0x3bee('0x13')]][_0x3bee('0x22')]=_0xd926f8[_0x3bee('0x23')];agents[_0xd926f8[_0x3bee('0x13')]][_0x3bee('0x8')]='connect';_[_0x3bee('0x27')](agents,function(_0x1b5eca,_0x25158b){if(_0x1b5eca[_0x3bee('0x13')]!=_0xd926f8[_0x3bee('0x13')]&&_0x1b5eca[_0x3bee('0x3')]==_0xd926f8[_0x3bee('0x3')]){_0x1b5eca[_0x3bee('0x24')]=0x0;_0x1b5eca[_0x3bee('0x22')]=_0xd926f8[_0x3bee('0x23')];_0x1b5eca[_0x3bee('0x1e')]=!![];_0x1b5eca[_0x3bee('0x1f')]=utils[_0x3bee('0x20')]();_0x1b5eca['lastevent']=_0x3bee('0x2e');_0x1b5eca[_0x3bee('0x21')]=_0x3bee('0x2e');_0x1b5eca[_0x3bee('0x2f')]=_0xd926f8[_0x3bee('0x13')];_0x1b5eca[_0x3bee('0x30')]=_0xd926f8[_0x3bee('0x5')];writeDB(_0x1b5eca);}});}}catch(_0xd1140d){utils['error'](util[_0x3bee('0x18')](_0x3bee('0x31'),_0xd926f8[_0x3bee('0x3')]),_0xd1140d);}};exports['agentcomplete']=function(_0x4567f2){try{if(!_['isNil'](agents[_0x4567f2[_0x3bee('0x13')]])){utils['debug'](util['format'](_0x3bee('0x32'),_0x4567f2[_0x3bee('0x3')]),_0x4567f2);utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x33'),_0x4567f2['uniqueid'],agents[_0x4567f2['destuniqueid']][_0x3bee('0x5')],_0x4567f2['destuniqueid']));agents[_0x4567f2[_0x3bee('0x13')]]['agentcomplete']=!![];agents[_0x4567f2[_0x3bee('0x13')]]['agentcompleteAt']=utils[_0x3bee('0x20')]();agents[_0x4567f2[_0x3bee('0x13')]][_0x3bee('0x24')]=utils[_0x3bee('0x34')](agents[_0x4567f2['destuniqueid']]['agentcompleteAt'],agents[_0x4567f2[_0x3bee('0x13')]]['agentconnectAt']);agents[_0x4567f2['destuniqueid']]['reason']=_0x4567f2[_0x3bee('0x21')];agents[_0x4567f2['destuniqueid']][_0x3bee('0x8')]=_0x3bee('0x35');writeDB(agents[_0x4567f2[_0x3bee('0x13')]]);}}catch(_0x593427){utils[_0x3bee('0x1a')](util['format'](_0x3bee('0x32'),_0x4567f2['uniqueid']),_0x593427);}};exports[_0x3bee('0x36')]=function(_0x16b096){try{if(!_[_0x3bee('0x1b')](agents[_0x16b096['transfereruniqueid']])){utils[_0x3bee('0x15')](util[_0x3bee('0x18')](_0x3bee('0x37'),_0x16b096['uniqueid']),_0x16b096);utils['info'](util[_0x3bee('0x18')](_0x3bee('0x38'),_0x16b096[_0x3bee('0x3')],agents[_0x16b096[_0x3bee('0x39')]][_0x3bee('0x5')],agents[_0x16b096[_0x3bee('0x39')]][_0x3bee('0x3')]));agents[_0x16b096['transfereruniqueid']][_0x3bee('0x3a')]=!![];agents[_0x16b096[_0x3bee('0x39')]]['transfertype']='blind';agents[_0x16b096[_0x3bee('0x39')]]['transferexten']=_0x16b096[_0x3bee('0x3b')];agents[_0x16b096[_0x3bee('0x39')]][_0x3bee('0x3c')]=agents[_0x16b096['transfereruniqueid']][_0x3bee('0x3')];}}catch(_0x3beac9){utils[_0x3bee('0x1a')](util['format'](_0x3bee('0x37'),_0x16b096[_0x3bee('0x3')]),_0x3beac9);}};exports['attendedtransfer']=function(_0x7e37ed){try{utils[_0x3bee('0x15')](util['format'](_0x3bee('0x3d'),_0x7e37ed[_0x3bee('0x3e')]),_0x7e37ed);if(_0x7e37ed[_0x3bee('0x3e')]==_0x7e37ed[_0x3bee('0x3f')]){if(!_[_0x3bee('0x1b')](agents[_0x7e37ed[_0x3bee('0x40')]])){utils[_0x3bee('0x1')](util[_0x3bee('0x18')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x7e37ed['origtransfereruniqueid'],agents[_0x7e37ed[_0x3bee('0x40')]]['membername']));agents[_0x7e37ed[_0x3bee('0x40')]][_0x3bee('0x3a')]=!![];agents[_0x7e37ed[_0x3bee('0x40')]]['transfertype']=_0x3bee('0x41');agents[_0x7e37ed[_0x3bee('0x40')]][_0x3bee('0x42')]=_0x7e37ed['origtransfererexten'];agents[_0x7e37ed[_0x3bee('0x40')]]['transferuniqueid']=_0x7e37ed[_0x3bee('0x3e')];}if(_0x7e37ed[_0x3bee('0x43')]&&agents[_0x7e37ed[_0x3bee('0x43')]]){agents[_0x7e37ed['transfereeuniqueid']][_0x3bee('0x44')]=0x1;transfers[_0x7e37ed[_0x3bee('0x43')]]=_[_0x3bee('0x45')](agents[_0x7e37ed['transfereeuniqueid']]);transfers[_0x7e37ed['transfereeuniqueid']][_0x3bee('0x46')]=agents[_0x7e37ed[_0x3bee('0x40')]][_0x3bee('0x46')];transfers[_0x7e37ed['transfereeuniqueid']]['calleridname']=agents[_0x7e37ed[_0x3bee('0x40')]]['calleridname'];transfers[_0x7e37ed['transfereeuniqueid']][_0x3bee('0x17')]=utils[_0x3bee('0x20')]();transfers[_0x7e37ed[_0x3bee('0x43')]]['agentconnectAt']=utils['now']();transfers[_0x7e37ed[_0x3bee('0x43')]][_0x3bee('0x22')]=0x0;transfers[_0x7e37ed['transfereeuniqueid']][_0x3bee('0x44')]=0x2;}}else if(_0x7e37ed['secondtransfereruniqueid']==_0x7e37ed[_0x3bee('0x47')]){if(!_[_0x3bee('0x1b')](agents[_0x7e37ed[_0x3bee('0x3e')]])){utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x48'),_0x7e37ed[_0x3bee('0x3e')],agents[_0x7e37ed[_0x3bee('0x3e')]][_0x3bee('0x5')]));agents[_0x7e37ed[_0x3bee('0x3e')]][_0x3bee('0x3a')]=!![];agents[_0x7e37ed['origtransfereruniqueid']]['transfertype']='ATTENDED';agents[_0x7e37ed[_0x3bee('0x3e')]][_0x3bee('0x42')]=_0x7e37ed[_0x3bee('0x49')];agents[_0x7e37ed[_0x3bee('0x3e')]]['transferuniqueid']=_0x7e37ed[_0x3bee('0x40')];}if(_0x7e37ed[_0x3bee('0x4a')]&&agents[_0x7e37ed['transfertargetuniqueid']]){agents[_0x7e37ed['transfertargetuniqueid']][_0x3bee('0x44')]=0x1;transfers[_0x7e37ed[_0x3bee('0x4a')]]=_[_0x3bee('0x45')](agents[_0x7e37ed['transfertargetuniqueid']]);transfers[_0x7e37ed[_0x3bee('0x4a')]][_0x3bee('0x46')]=agents[_0x7e37ed[_0x3bee('0x3e')]]['calleridnum'];transfers[_0x7e37ed[_0x3bee('0x4a')]][_0x3bee('0x4b')]=agents[_0x7e37ed[_0x3bee('0x3e')]][_0x3bee('0x4b')];transfers[_0x7e37ed['transfertargetuniqueid']]['agentcalledAt']=utils[_0x3bee('0x20')]();transfers[_0x7e37ed[_0x3bee('0x4a')]][_0x3bee('0x4c')]=utils[_0x3bee('0x20')]();transfers[_0x7e37ed[_0x3bee('0x4a')]]['holdtime']=0x0;transfers[_0x7e37ed[_0x3bee('0x4a')]]['agententerreason']=0x2;}}}catch(_0xddc56b){utils[_0x3bee('0x1a')](util[_0x3bee('0x18')](_0x3bee('0x3d'),_0x7e37ed[_0x3bee('0x3e')]),_0xddc56b);}};exports[_0x3bee('0x4d')]=function(_0x3f7dad){try{utils['debug'](util[_0x3bee('0x18')](_0x3bee('0x4e'),_0x3f7dad[_0x3bee('0x3')]),_0x3f7dad);if(agents[_0x3f7dad[_0x3bee('0x3')]]&&agents[_0x3f7dad['uniqueid']][_0x3bee('0x21')]===_0x3bee('0x4f')){if(_0x3f7dad[_0x3bee('0x50')]==='21'){agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x21')]=_0x3bee('0x51');agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x8')]='rejected';}utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x52'),_0x3f7dad['uniqueid'],agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x5')],agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x21')],agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x8')]));writeDB(agents[_0x3f7dad[_0x3bee('0x3')]]);var _0x204843=unanswered[_0x3bee('0x53')](_0x3f7dad[_0x3bee('0x3')]);if(_0x204843>-0x1){unanswered[_0x3bee('0x54')](_0x204843,0x1);}}if(transfers[_0x3f7dad[_0x3bee('0x3')]]){transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0xe')]=!![];transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x55')]=utils[_0x3bee('0x20')]();transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x24')]=utils[_0x3bee('0x34')](transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x55')],transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x4c')]);transfers[_0x3f7dad[_0x3bee('0x3')]]['reason']=_0x3bee('0x56');transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x8')]=_0x3bee('0x35');utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x52'),_0x3f7dad[_0x3bee('0x3')],transfers[_0x3f7dad[_0x3bee('0x3')]]['membername'],transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x21')],transfers[_0x3f7dad['uniqueid']][_0x3bee('0x8')]));writeDB(transfers[_0x3f7dad['uniqueid']],!![]);}if(agents[_0x3f7dad[_0x3bee('0x3')]]&&agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x4c')]){agents[_0x3f7dad['uniqueid']]['agentcomplete']=!![];agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x55')]=utils[_0x3bee('0x20')]();agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x24')]=utils[_0x3bee('0x34')](agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x55')],agents[_0x3f7dad['uniqueid']][_0x3bee('0x4c')]);agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x21')]=agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x3a')]?_0x3bee('0x3a'):_0x3bee('0x56');agents[_0x3f7dad['uniqueid']][_0x3bee('0x8')]=_0x3bee('0x35');utils['info'](util[_0x3bee('0x18')](_0x3bee('0x52'),_0x3f7dad['uniqueid'],agents[_0x3f7dad[_0x3bee('0x3')]]['membername'],agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x21')],agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x8')]));writeDB(agents[_0x3f7dad['uniqueid']]);}}catch(_0x62900b){utils[_0x3bee('0x1a')](util[_0x3bee('0x18')]('[%s][agents][hangup]',_0x3f7dad[_0x3bee('0x3')]),_0x62900b);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index ff09597..92f6c66 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 _0x3e99=['toNumber','ANSWERED','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','secondtransfererchannel','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','userfield','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','value','destination','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','cdr','split','substring','lastIndexOf','includes','hangup','noop','execif','gotoif','[%s][calls][newexten]','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','blinds','uniqueid','transfereeuniqueid','info','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','then','UserId','request','CreateVoiceCallReport','debug','channel','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','DOCUMENTATION','error','format','[%s][calls][newchannel]','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','linkedid','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition'];(function(_0x800dee,_0x3e130b){var _0x2df102=function(_0x3abce8){while(--_0x3abce8){_0x800dee['push'](_0x800dee['shift']());}};_0x2df102(++_0x3e130b);}(_0x3e99,0x122));var _0x93e9=function(_0x3bba1e,_0x99126){_0x3bba1e=_0x3bba1e-0x0;var _0x4fe1ac=_0x3e99[_0x3bba1e];return _0x4fe1ac;};'use strict';var _=require(_0x93e9('0x0'));var util=require(_0x93e9('0x1'));var utils=require(_0x93e9('0x2'));var transfers=require(_0x93e9('0x3'));var dispositions=[_0x93e9('0x4'),_0x93e9('0x5'),'FAILED','NO\x20ANSWER',_0x93e9('0x4'),_0x93e9('0x4'),'ANSWERED','BUSY',_0x93e9('0x5'),_0x93e9('0x5'),_0x93e9('0x5')];var channels={};function writeDB(_0x972ed1){var _0x13d1e5;if(transfers[_0x93e9('0x6')][_0x972ed1[_0x93e9('0x7')]]){_0x13d1e5=_0x972ed1['uniqueid'];_0x972ed1['uniqueid']=transfers['blinds'][_0x972ed1[_0x93e9('0x7')]][_0x93e9('0x8')];}utils[_0x93e9('0x9')](util['format']('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x972ed1[_0x93e9('0x7')],_0x972ed1['channel'],_0x972ed1[_0x93e9('0xa')],_0x972ed1[_0x93e9('0xb')],_0x972ed1[_0x93e9('0xc')],_0x972ed1[_0x93e9('0xd')],_0x972ed1[_0x93e9('0xe')],_0x972ed1[_0x93e9('0xf')]));if(_0x972ed1['accountcode']){utils['getUserByInternal'](_0x972ed1[_0x93e9('0x10')])[_0x93e9('0x11')](function(_0x30c555){if(_0x30c555){_0x972ed1[_0x93e9('0x12')]=_0x30c555['id'];}utils[_0x93e9('0x13')](_0x93e9('0x14'),_0x972ed1);});}else{utils[_0x93e9('0x13')](_0x93e9('0x14'),_0x972ed1);}if(channels[_0x972ed1[_0x93e9('0x7')]]){delete channels[_0x972ed1[_0x93e9('0x7')]];}else if(_0x13d1e5&&channels[_0x13d1e5]){if(!transfers[_0x93e9('0x6')][_0x13d1e5]['recording'])delete transfers[_0x93e9('0x6')][_0x13d1e5];delete channels[_0x13d1e5];}}exports['newchannel']=function(_0x34f8c3){try{utils[_0x93e9('0x15')](util['format']('[%s][calls][newchannel]',_0x34f8c3[_0x93e9('0x7')]),_0x34f8c3);if(_0x34f8c3[_0x93e9('0x7')]==_0x34f8c3['linkedid']&&_0x34f8c3[_0x93e9('0x16')]!='OutgoingSpoolFailed'){utils[_0x93e9('0x9')](util['format'](_0x93e9('0x17'),_0x34f8c3['uniqueid'],_0x34f8c3[_0x93e9('0x18')],_0x34f8c3[_0x93e9('0x19')]));channels[_0x34f8c3[_0x93e9('0x7')]]={'uniqueid':_0x34f8c3['uniqueid'],'accountcode':_0x34f8c3[_0x93e9('0x10')],'source':_0x34f8c3[_0x93e9('0xd')],'destination':_0x34f8c3[_0x93e9('0x19')],'destinationcontext':_0x34f8c3[_0x93e9('0x18')],'channel':_0x34f8c3[_0x93e9('0x16')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x93e9('0x1a')};}}catch(_0x1a1867){utils[_0x93e9('0x1b')](util[_0x93e9('0x1c')](_0x93e9('0x1d'),_0x34f8c3[_0x93e9('0x7')]),_0x1a1867);}};exports[_0x93e9('0x1e')]=function(_0x5bdc8b){try{utils[_0x93e9('0x15')](util[_0x93e9('0x1c')](_0x93e9('0x1f'),_0x5bdc8b[_0x93e9('0x7')]),_0x5bdc8b);if(!_[_0x93e9('0x20')](channels[_0x5bdc8b[_0x93e9('0x7')]])&&_0x5bdc8b[_0x93e9('0x21')]==0x6){utils[_0x93e9('0x9')](util['format'](_0x93e9('0x22'),_0x5bdc8b[_0x93e9('0x7')],_0x5bdc8b['context'],_0x5bdc8b[_0x93e9('0x16')]));if(_['isNil'](channels[_0x5bdc8b['uniqueid']][_0x93e9('0x23')])){channels[_0x5bdc8b[_0x93e9('0x7')]][_0x93e9('0x23')]=utils[_0x93e9('0x24')]();}}else if(!_['isNil'](channels[_0x5bdc8b[_0x93e9('0x25')]])&&_0x5bdc8b['channelstate']==0x6&&_0x5bdc8b[_0x93e9('0x18')]!=_0x93e9('0x26')){utils['info'](util[_0x93e9('0x1c')](_0x93e9('0x27'),_0x5bdc8b[_0x93e9('0x7')],_0x5bdc8b[_0x93e9('0x25')],_0x5bdc8b[_0x93e9('0x18')],_0x5bdc8b[_0x93e9('0x16')]));channels[_0x5bdc8b[_0x93e9('0x25')]]['accountcode']=_0x5bdc8b[_0x93e9('0x10')];channels[_0x5bdc8b[_0x93e9('0x25')]][_0x93e9('0x28')]=_0x5bdc8b[_0x93e9('0x16')];if(_[_0x93e9('0x20')](channels[_0x5bdc8b[_0x93e9('0x25')]][_0x93e9('0x29')])){channels[_0x5bdc8b[_0x93e9('0x25')]][_0x93e9('0x29')]=utils[_0x93e9('0x24')]();}channels[_0x5bdc8b[_0x93e9('0x25')]][_0x93e9('0x2a')]=dispositions[_[_0x93e9('0x2b')](_0x5bdc8b[_0x93e9('0x21')])]||_0x93e9('0x2c');}}catch(_0x33b979){utils[_0x93e9('0x1b')](util[_0x93e9('0x1c')](_0x93e9('0x1f'),_0x5bdc8b[_0x93e9('0x7')]),_0x33b979);}};exports['hangup']=function(_0xe31979){try{if(!_[_0x93e9('0x20')](channels[_0xe31979[_0x93e9('0x7')]])){utils[_0x93e9('0x15')](util[_0x93e9('0x1c')](_0x93e9('0x2d'),_0xe31979[_0x93e9('0x7')]),_0xe31979);if(_[_0x93e9('0x20')](channels[_0xe31979[_0x93e9('0x7')]]['callerid'])){channels[_0xe31979['uniqueid']][_0x93e9('0x2e')]=_0xe31979['calleridname']+'\x20<'+_0xe31979['calleridnum']+'>';}utils[_0x93e9('0x9')](util[_0x93e9('0x1c')](_0x93e9('0x2f'),_0xe31979[_0x93e9('0x7')],channels[_0xe31979[_0x93e9('0x7')]]['callerid'],_0xe31979[_0x93e9('0x30')]));channels[_0xe31979[_0x93e9('0x7')]][_0x93e9('0x31')]=utils[_0x93e9('0x24')]();channels[_0xe31979[_0x93e9('0x7')]][_0x93e9('0x32')]=utils[_0x93e9('0x33')](channels[_0xe31979[_0x93e9('0x7')]][_0x93e9('0x31')],channels[_0xe31979['uniqueid']]['starttime']);channels[_0xe31979[_0x93e9('0x7')]][_0x93e9('0x34')]=channels[_0xe31979[_0x93e9('0x7')]][_0x93e9('0x29')]?utils[_0x93e9('0x33')](channels[_0xe31979[_0x93e9('0x7')]]['endtime'],channels[_0xe31979[_0x93e9('0x7')]][_0x93e9('0x29')]):0x0;writeDB(channels[_0xe31979[_0x93e9('0x7')]]);}}catch(_0x3c0dbb){utils['error'](util[_0x93e9('0x1c')](_0x93e9('0x2d'),_0xe31979[_0x93e9('0x7')]),_0x3c0dbb);}};exports[_0x93e9('0x35')]=function(_0x162eda){try{if(!_['isNil'](channels[_0x162eda[_0x93e9('0x36')]])){utils[_0x93e9('0x15')](util[_0x93e9('0x1c')](_0x93e9('0x37'),_0x162eda[_0x93e9('0x38')]),_0x162eda);if(channels[_0x162eda[_0x93e9('0x36')]][_0x93e9('0x16')]==_0x162eda[_0x93e9('0x39')]){utils[_0x93e9('0x9')](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x162eda[_0x93e9('0x38')],_0x162eda[_0x93e9('0x36')],_0x162eda[_0x93e9('0x3a')]));channels[_0x162eda['localtwolinkedid']][_0x93e9('0x28')]=_0x162eda['secondtransfererchannel'];channels[_0x162eda[_0x93e9('0x36')]]['userfield']=_0x93e9('0x3b');}else if(channels[_0x162eda['localtwolinkedid']][_0x93e9('0x16')]=_0x162eda[_0x93e9('0x3c')]){utils['info'](util['format'](_0x93e9('0x3d'),_0x162eda[_0x93e9('0x38')],_0x162eda[_0x93e9('0x36')],_0x162eda[_0x93e9('0x3e')]));channels[_0x162eda[_0x93e9('0x36')]][_0x93e9('0x28')]=_0x162eda[_0x93e9('0x3e')];channels[_0x162eda['localtwolinkedid']][_0x93e9('0x3f')]=_0x93e9('0x3b');}}}catch(_0x4c5e6a){utils[_0x93e9('0x1b')](util[_0x93e9('0x1c')]('[%s][calls][attendedtransfer]',_0x162eda[_0x93e9('0x38')]),_0x4c5e6a);}};exports['musiconholdstart']=function(_0x4c4993){try{if(!_[_0x93e9('0x20')](channels[_0x4c4993[_0x93e9('0x7')]])){utils[_0x93e9('0x15')](util[_0x93e9('0x1c')](_0x93e9('0x40'),_0x4c4993[_0x93e9('0x7')]),_0x4c4993);channels[_0x4c4993['uniqueid']][_0x93e9('0x41')]=utils[_0x93e9('0x24')]();utils['info'](util[_0x93e9('0x1c')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x4c4993[_0x93e9('0x7')],channels[_0x4c4993[_0x93e9('0x7')]]['musiconholdstartAt']));}}catch(_0x30e465){utils[_0x93e9('0x1b')](util[_0x93e9('0x1c')](_0x93e9('0x40'),_0x4c4993[_0x93e9('0x7')]),_0x30e465);}};exports[_0x93e9('0x42')]=function(_0x1a4d23){try{if(!_[_0x93e9('0x20')](channels[_0x1a4d23[_0x93e9('0x7')]])){utils[_0x93e9('0x15')](util[_0x93e9('0x1c')](_0x93e9('0x43'),_0x1a4d23['uniqueid']),_0x1a4d23);if(!_[_0x93e9('0x20')](channels[_0x1a4d23[_0x93e9('0x7')]][_0x93e9('0x41')])){channels[_0x1a4d23[_0x93e9('0x7')]][_0x93e9('0x44')]+=utils['diffTime'](utils[_0x93e9('0x24')](),channels[_0x1a4d23[_0x93e9('0x7')]]['musiconholdstartAt']);utils['info'](util['format']('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x1a4d23[_0x93e9('0x7')],channels[_0x1a4d23[_0x93e9('0x7')]]['mohtime']));delete channels[_0x1a4d23[_0x93e9('0x7')]]['musiconholdstartAt'];}}}catch(_0x4c0c4c){utils[_0x93e9('0x1b')](util[_0x93e9('0x1c')](_0x93e9('0x43'),_0x1a4d23['uniqueid']),_0x4c0c4c);}};exports[_0x93e9('0x45')]=function(_0x3d65b2){try{if(!_[_0x93e9('0x20')](channels[_0x3d65b2['uniqueid']])){utils[_0x93e9('0x15')](util[_0x93e9('0x1c')](_0x93e9('0x46'),_0x3d65b2['uniqueid']),_0x3d65b2);if(!_[_0x93e9('0x20')](_0x3d65b2[_0x93e9('0x47')][_0x93e9('0x48')])){utils[_0x93e9('0x9')](util[_0x93e9('0x1c')](_0x93e9('0x49'),_0x3d65b2['uniqueid'],_0x3d65b2['value']));channels[_0x3d65b2['uniqueid']][_0x93e9('0x4a')]=_0x3d65b2['value'];}if(!_[_0x93e9('0x20')](_0x3d65b2[_0x93e9('0x47')][_0x93e9('0x4b')])){utils[_0x93e9('0x9')](util[_0x93e9('0x1c')](_0x93e9('0x4c'),_0x3d65b2['uniqueid'],_0x3d65b2[_0x93e9('0x4d')]));channels[_0x3d65b2[_0x93e9('0x7')]][_0x93e9('0x4e')]=_0x3d65b2[_0x93e9('0x4d')];channels[_0x3d65b2[_0x93e9('0x7')]][_0x93e9('0x2e')]='\x22'+_0x3d65b2[_0x93e9('0x4d')]+'\x22\x20<'+_0x3d65b2[_0x93e9('0x4d')]+'>';}if(!_[_0x93e9('0x20')](_0x3d65b2['variable'][_0x93e9('0x4f')])||!_[_0x93e9('0x20')](_0x3d65b2[_0x93e9('0x47')]['xmd-callerid'])){utils['info'](util[_0x93e9('0x1c')](_0x93e9('0x50'),_0x3d65b2[_0x93e9('0x7')],!_[_0x93e9('0x20')](_0x3d65b2[_0x93e9('0x47')][_0x93e9('0x4f')])?_0x93e9('0x4f'):_0x93e9('0x51'),_0x3d65b2[_0x93e9('0x4d')]));channels[_0x3d65b2[_0x93e9('0x7')]][_0x93e9('0x2e')]=_0x3d65b2['value'];}if(!_[_0x93e9('0x20')](_0x3d65b2[_0x93e9('0x47')][_0x93e9('0x52')])||!_[_0x93e9('0x20')](_0x3d65b2[_0x93e9('0x47')][_0x93e9('0x53')])){utils[_0x93e9('0x9')](util[_0x93e9('0x1c')](_0x93e9('0x50'),_0x3d65b2[_0x93e9('0x7')],!_[_0x93e9('0x20')](_0x3d65b2[_0x93e9('0x47')][_0x93e9('0x52')])?_0x93e9('0x52'):'xmcs-queue',_0x3d65b2[_0x93e9('0x4d')]));channels[_0x3d65b2[_0x93e9('0x7')]][_0x93e9('0x54')]='Queue';channels[_0x3d65b2[_0x93e9('0x7')]][_0x93e9('0x55')]=_0x3d65b2[_0x93e9('0x4d')];channels[_0x3d65b2['uniqueid']][_0x93e9('0xa')]=!![];}if(!_[_0x93e9('0x20')](_0x3d65b2[_0x93e9('0x47')][_0x93e9('0x56')])){utils[_0x93e9('0x9')](util['format'](_0x93e9('0x57'),_0x3d65b2['uniqueid'],_0x3d65b2[_0x93e9('0x4d')]));channels[_0x3d65b2[_0x93e9('0x7')]][_0x93e9('0x58')]=_0x3d65b2['value'];}if(!_[_0x93e9('0x20')](_0x3d65b2[_0x93e9('0x47')][_0x93e9('0x59')])){utils[_0x93e9('0x9')](util['format'](_0x93e9('0x5a'),_0x3d65b2[_0x93e9('0x7')],_0x3d65b2[_0x93e9('0x4d')]));channels[_0x3d65b2[_0x93e9('0x7')]][_0x93e9('0x5b')]=_0x3d65b2[_0x93e9('0x4d')];}if(!_[_0x93e9('0x20')](_0x3d65b2[_0x93e9('0x47')]['outboundrouteid'])){utils[_0x93e9('0x9')](util[_0x93e9('0x1c')](_0x93e9('0x5c'),_0x3d65b2[_0x93e9('0x7')],_0x3d65b2[_0x93e9('0x4d')]));channels[_0x3d65b2[_0x93e9('0x7')]]['routeid']=_0x3d65b2[_0x93e9('0x4d')];}if(!_['isNil'](_0x3d65b2[_0x93e9('0x47')][_0x93e9('0x5d')])){utils['info'](util[_0x93e9('0x1c')](_0x93e9('0x5e'),_0x3d65b2[_0x93e9('0x7')],_0x3d65b2[_0x93e9('0x4d')]));channels[_0x3d65b2[_0x93e9('0x7')]][_0x93e9('0x5d')]=_0x3d65b2[_0x93e9('0x4d')];}}}catch(_0x2009f9){utils[_0x93e9('0x1b')](util[_0x93e9('0x1c')](_0x93e9('0x46'),_0x3d65b2[_0x93e9('0x7')]),_0x2009f9);}};exports['newexten']=function(_0xb082bd){try{if(!_[_0x93e9('0x20')](channels[_0xb082bd[_0x93e9('0x7')]])){utils[_0x93e9('0x15')](util[_0x93e9('0x1c')]('[%s][calls][newexten]',_0xb082bd['uniqueid']),_0xb082bd);utils[_0x93e9('0x9')](util[_0x93e9('0x1c')](_0x93e9('0x5f'),_0xb082bd['uniqueid'],_0xb082bd[_0x93e9('0x60')],_0xb082bd[_0x93e9('0x61')]));if(_0xb082bd[_0x93e9('0x60')]['toLowerCase']()==_0x93e9('0x62')&&_[_0x93e9('0x63')](_0xb082bd[_0x93e9('0x61')][_0x93e9('0x64')](),_0x93e9('0x65'))){var _0x335398=_0xb082bd[_0x93e9('0x61')][_0x93e9('0x66')]('=');var _0x3ba98f=_0x335398[0x0][_0x93e9('0x67')](_0x335398[0x0][_0x93e9('0x68')]('(')+0x1,_0x335398[0x0][_0x93e9('0x68')](')'));var _0x58103f=_0x335398[0x1];channels[_0xb082bd[_0x93e9('0x7')]][_0x3ba98f]=_0x58103f;}if(!_[_0x93e9('0x69')]([_0x93e9('0x6a'),_0x93e9('0x6b'),_0x93e9('0x6c'),_0x93e9('0x62'),_0x93e9('0x6d')],_0xb082bd[_0x93e9('0x60')]['toLowerCase']())){channels[_0xb082bd[_0x93e9('0x7')]][_0x93e9('0x54')]=_0xb082bd[_0x93e9('0x60')];channels[_0xb082bd[_0x93e9('0x7')]][_0x93e9('0x55')]=_0xb082bd[_0x93e9('0x61')];}}}catch(_0x1a7358){utils['error'](util[_0x93e9('0x1c')](_0x93e9('0x6e'),_0xb082bd[_0x93e9('0x7')]),_0x1a7358);}}; \ No newline at end of file +var _0x9b09=['accountcode','then','request','CreateVoiceCallReport','recording','newchannel','debug','[%s][calls][newchannel]','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','linkedid','transfer','destinationchannel','answertime','toNumber','[%s][calls][newstate]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','diffTime','endtime','starttime','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','transfereechannel','secondtransfererchannel','userfield','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','[%s][calls][attendedtransfer]','musiconholdstart','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr','split','substring','lastIndexOf','includes','noop','execif','set','gotoif','lodash','util','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum'];(function(_0x673b8e,_0x105f4c){var _0xee868d=function(_0x21534d){while(--_0x21534d){_0x673b8e['push'](_0x673b8e['shift']());}};_0xee868d(++_0x105f4c);}(_0x9b09,0x1ad));var _0x99b0=function(_0x11de83,_0x49e1c1){_0x11de83=_0x11de83-0x0;var _0x45bdb0=_0x9b09[_0x11de83];return _0x45bdb0;};'use strict';var _=require(_0x99b0('0x0'));var util=require(_0x99b0('0x1'));var utils=require('./utils');var transfers=require(_0x99b0('0x2'));var dispositions=[_0x99b0('0x3'),'FAILED',_0x99b0('0x4'),'NO\x20ANSWER',_0x99b0('0x3'),'NO\x20ANSWER',_0x99b0('0x5'),_0x99b0('0x6'),'FAILED',_0x99b0('0x4'),_0x99b0('0x4')];var channels={};function writeDB(_0x5cfd09){var _0x278d98;if(transfers[_0x99b0('0x7')][_0x5cfd09[_0x99b0('0x8')]]){_0x278d98=_0x5cfd09[_0x99b0('0x8')];_0x5cfd09[_0x99b0('0x8')]=transfers['blinds'][_0x5cfd09[_0x99b0('0x8')]][_0x99b0('0x9')];}utils[_0x99b0('0xa')](util[_0x99b0('0xb')](_0x99b0('0xc'),_0x5cfd09['uniqueid'],_0x5cfd09[_0x99b0('0xd')],_0x5cfd09[_0x99b0('0xe')],_0x5cfd09[_0x99b0('0xf')],_0x5cfd09[_0x99b0('0x10')],_0x5cfd09[_0x99b0('0x11')],_0x5cfd09[_0x99b0('0x12')],_0x5cfd09['lastevent']));if(_0x5cfd09[_0x99b0('0x13')]){utils['getUserByInternal'](_0x5cfd09[_0x99b0('0x13')])[_0x99b0('0x14')](function(_0x5baf0c){if(_0x5baf0c){_0x5cfd09['UserId']=_0x5baf0c['id'];}utils[_0x99b0('0x15')](_0x99b0('0x16'),_0x5cfd09);});}else{utils[_0x99b0('0x15')]('CreateVoiceCallReport',_0x5cfd09);}if(channels[_0x5cfd09['uniqueid']]){delete channels[_0x5cfd09['uniqueid']];}else if(_0x278d98&&channels[_0x278d98]){if(!transfers[_0x99b0('0x7')][_0x278d98][_0x99b0('0x17')])delete transfers['blinds'][_0x278d98];delete channels[_0x278d98];}}exports[_0x99b0('0x18')]=function(_0x25b923){try{utils[_0x99b0('0x19')](util[_0x99b0('0xb')](_0x99b0('0x1a'),_0x25b923[_0x99b0('0x8')]),_0x25b923);if(_0x25b923[_0x99b0('0x8')]==_0x25b923['linkedid']&&_0x25b923[_0x99b0('0xd')]!=_0x99b0('0x1b')){utils[_0x99b0('0xa')](util[_0x99b0('0xb')](_0x99b0('0x1c'),_0x25b923[_0x99b0('0x8')],_0x25b923[_0x99b0('0x1d')],_0x25b923[_0x99b0('0x1e')]));channels[_0x25b923[_0x99b0('0x8')]]={'uniqueid':_0x25b923[_0x99b0('0x8')],'accountcode':_0x25b923[_0x99b0('0x13')],'source':_0x25b923[_0x99b0('0x11')],'destination':_0x25b923[_0x99b0('0x1e')],'destinationcontext':_0x25b923[_0x99b0('0x1d')],'channel':_0x25b923[_0x99b0('0xd')],'starttime':utils[_0x99b0('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x99b0('0x3'),'amaflags':_0x99b0('0x20')};}}catch(_0x1d7022){utils[_0x99b0('0x21')](util[_0x99b0('0xb')](_0x99b0('0x1a'),_0x25b923[_0x99b0('0x8')]),_0x1d7022);}};exports[_0x99b0('0x22')]=function(_0x4b2aa4){try{utils[_0x99b0('0x19')](util['format']('[%s][calls][newstate]',_0x4b2aa4[_0x99b0('0x8')]),_0x4b2aa4);if(!_[_0x99b0('0x23')](channels[_0x4b2aa4[_0x99b0('0x8')]])&&_0x4b2aa4[_0x99b0('0x24')]==0x6){utils[_0x99b0('0xa')](util['format'](_0x99b0('0x25'),_0x4b2aa4[_0x99b0('0x8')],_0x4b2aa4[_0x99b0('0x1d')],_0x4b2aa4[_0x99b0('0xd')]));if(_['isNil'](channels[_0x4b2aa4[_0x99b0('0x8')]][_0x99b0('0x26')])){channels[_0x4b2aa4['uniqueid']][_0x99b0('0x26')]=utils[_0x99b0('0x1f')]();}}else if(!_[_0x99b0('0x23')](channels[_0x4b2aa4[_0x99b0('0x27')]])&&_0x4b2aa4[_0x99b0('0x24')]==0x6&&_0x4b2aa4[_0x99b0('0x1d')]!=_0x99b0('0x28')){utils[_0x99b0('0xa')](util[_0x99b0('0xb')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x4b2aa4[_0x99b0('0x8')],_0x4b2aa4[_0x99b0('0x27')],_0x4b2aa4[_0x99b0('0x1d')],_0x4b2aa4[_0x99b0('0xd')]));channels[_0x4b2aa4[_0x99b0('0x27')]][_0x99b0('0x13')]=_0x4b2aa4['accountcode'];channels[_0x4b2aa4[_0x99b0('0x27')]][_0x99b0('0x29')]=_0x4b2aa4[_0x99b0('0xd')];if(_[_0x99b0('0x23')](channels[_0x4b2aa4[_0x99b0('0x27')]][_0x99b0('0x2a')])){channels[_0x4b2aa4[_0x99b0('0x27')]][_0x99b0('0x2a')]=utils['now']();}channels[_0x4b2aa4[_0x99b0('0x27')]]['disposition']=dispositions[_[_0x99b0('0x2b')](_0x4b2aa4[_0x99b0('0x24')])]||'ANSWERED';}}catch(_0x421be7){utils['error'](util['format'](_0x99b0('0x2c'),_0x4b2aa4[_0x99b0('0x8')]),_0x421be7);}};exports['hangup']=function(_0x4e47ce){try{if(!_[_0x99b0('0x23')](channels[_0x4e47ce[_0x99b0('0x8')]])){utils['debug'](util[_0x99b0('0xb')]('[%s][calls][hangup]',_0x4e47ce[_0x99b0('0x8')]),_0x4e47ce);if(_['isNil'](channels[_0x4e47ce[_0x99b0('0x8')]][_0x99b0('0x2d')])){channels[_0x4e47ce[_0x99b0('0x8')]]['callerid']=_0x4e47ce[_0x99b0('0x2e')]+'\x20<'+_0x4e47ce['calleridnum']+'>';}utils[_0x99b0('0xa')](util['format'](_0x99b0('0x2f'),_0x4e47ce[_0x99b0('0x8')],channels[_0x4e47ce[_0x99b0('0x8')]][_0x99b0('0x2d')],_0x4e47ce[_0x99b0('0x30')]));channels[_0x4e47ce[_0x99b0('0x8')]]['endtime']=utils['now']();channels[_0x4e47ce[_0x99b0('0x8')]][_0x99b0('0x31')]=utils[_0x99b0('0x32')](channels[_0x4e47ce[_0x99b0('0x8')]][_0x99b0('0x33')],channels[_0x4e47ce['uniqueid']][_0x99b0('0x34')]);channels[_0x4e47ce['uniqueid']]['billableseconds']=channels[_0x4e47ce[_0x99b0('0x8')]][_0x99b0('0x2a')]?utils[_0x99b0('0x32')](channels[_0x4e47ce['uniqueid']]['endtime'],channels[_0x4e47ce[_0x99b0('0x8')]]['answertime']):0x0;writeDB(channels[_0x4e47ce['uniqueid']]);}}catch(_0x49fb9d){utils['error'](util[_0x99b0('0xb')](_0x99b0('0x35'),_0x4e47ce['uniqueid']),_0x49fb9d);}};exports[_0x99b0('0x36')]=function(_0x5abef0){try{if(!_[_0x99b0('0x23')](channels[_0x5abef0[_0x99b0('0x37')]])){utils[_0x99b0('0x19')](util[_0x99b0('0xb')]('[%s][calls][attendedtransfer]',_0x5abef0['origtransfereruniqueid']),_0x5abef0);if(channels[_0x5abef0['localtwolinkedid']][_0x99b0('0xd')]==_0x5abef0[_0x99b0('0x38')]){utils[_0x99b0('0xa')](util[_0x99b0('0xb')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x5abef0['origtransfereruniqueid'],_0x5abef0[_0x99b0('0x37')],_0x5abef0[_0x99b0('0x39')]));channels[_0x5abef0[_0x99b0('0x37')]][_0x99b0('0x29')]=_0x5abef0['secondtransfererchannel'];channels[_0x5abef0[_0x99b0('0x37')]][_0x99b0('0x3a')]=_0x99b0('0x3b');}else if(channels[_0x5abef0['localtwolinkedid']][_0x99b0('0xd')]=_0x5abef0[_0x99b0('0x3c')]){utils['info'](util['format'](_0x99b0('0x3d'),_0x5abef0['origtransfereruniqueid'],_0x5abef0[_0x99b0('0x37')],_0x5abef0[_0x99b0('0x3e')]));channels[_0x5abef0[_0x99b0('0x37')]]['destinationchannel']=_0x5abef0[_0x99b0('0x3e')];channels[_0x5abef0[_0x99b0('0x37')]][_0x99b0('0x3a')]=_0x99b0('0x3b');}}}catch(_0x4ebc4f){utils['error'](util['format'](_0x99b0('0x3f'),_0x5abef0['origtransfereruniqueid']),_0x4ebc4f);}};exports[_0x99b0('0x40')]=function(_0x2206d7){try{if(!_[_0x99b0('0x23')](channels[_0x2206d7[_0x99b0('0x8')]])){utils[_0x99b0('0x19')](util[_0x99b0('0xb')]('[%s][calls][musiconholdstart]',_0x2206d7['uniqueid']),_0x2206d7);channels[_0x2206d7[_0x99b0('0x8')]]['musiconholdstartAt']=utils[_0x99b0('0x1f')]();utils[_0x99b0('0xa')](util[_0x99b0('0xb')](_0x99b0('0x41'),_0x2206d7[_0x99b0('0x8')],channels[_0x2206d7[_0x99b0('0x8')]][_0x99b0('0x42')]));}}catch(_0x18aa86){utils[_0x99b0('0x21')](util['format'](_0x99b0('0x43'),_0x2206d7[_0x99b0('0x8')]),_0x18aa86);}};exports[_0x99b0('0x44')]=function(_0x11275a){try{if(!_[_0x99b0('0x23')](channels[_0x11275a[_0x99b0('0x8')]])){utils[_0x99b0('0x19')](util[_0x99b0('0xb')](_0x99b0('0x45'),_0x11275a[_0x99b0('0x8')]),_0x11275a);if(!_[_0x99b0('0x23')](channels[_0x11275a[_0x99b0('0x8')]][_0x99b0('0x42')])){channels[_0x11275a[_0x99b0('0x8')]]['mohtime']+=utils[_0x99b0('0x32')](utils[_0x99b0('0x1f')](),channels[_0x11275a['uniqueid']][_0x99b0('0x42')]);utils[_0x99b0('0xa')](util[_0x99b0('0xb')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x11275a[_0x99b0('0x8')],channels[_0x11275a['uniqueid']]['mohtime']));delete channels[_0x11275a[_0x99b0('0x8')]]['musiconholdstartAt'];}}}catch(_0x5ee59c){utils[_0x99b0('0x21')](util['format']('[%s][calls][musiconholdstop]',_0x11275a[_0x99b0('0x8')]),_0x5ee59c);}};exports[_0x99b0('0x46')]=function(_0x2424e1){try{if(!_['isNil'](channels[_0x2424e1[_0x99b0('0x8')]])){utils[_0x99b0('0x19')](util[_0x99b0('0xb')](_0x99b0('0x47'),_0x2424e1[_0x99b0('0x8')]),_0x2424e1);if(!_[_0x99b0('0x23')](_0x2424e1[_0x99b0('0x48')][_0x99b0('0x49')])){utils[_0x99b0('0xa')](util[_0x99b0('0xb')](_0x99b0('0x4a'),_0x2424e1[_0x99b0('0x8')],_0x2424e1[_0x99b0('0x4b')]));channels[_0x2424e1[_0x99b0('0x8')]][_0x99b0('0x4c')]=_0x2424e1['value'];}if(!_['isNil'](_0x2424e1[_0x99b0('0x48')][_0x99b0('0x4d')])){utils['info'](util['format'](_0x99b0('0x4e'),_0x2424e1['uniqueid'],_0x2424e1[_0x99b0('0x4b')]));channels[_0x2424e1[_0x99b0('0x8')]][_0x99b0('0x4f')]=_0x2424e1[_0x99b0('0x4b')];channels[_0x2424e1[_0x99b0('0x8')]][_0x99b0('0x2d')]='\x22'+_0x2424e1['value']+_0x99b0('0x50')+_0x2424e1[_0x99b0('0x4b')]+'>';}if(!_['isNil'](_0x2424e1[_0x99b0('0x48')][_0x99b0('0x51')])||!_[_0x99b0('0x23')](_0x2424e1['variable'][_0x99b0('0x52')])){utils[_0x99b0('0xa')](util['format'](_0x99b0('0x53'),_0x2424e1[_0x99b0('0x8')],!_[_0x99b0('0x23')](_0x2424e1['variable']['xmd-callerid-preview'])?_0x99b0('0x51'):_0x99b0('0x52'),_0x2424e1[_0x99b0('0x4b')]));channels[_0x2424e1[_0x99b0('0x8')]][_0x99b0('0x2d')]=_0x2424e1['value'];}if(!_[_0x99b0('0x23')](_0x2424e1['variable'][_0x99b0('0x54')])||!_['isNil'](_0x2424e1[_0x99b0('0x48')][_0x99b0('0x55')])){utils[_0x99b0('0xa')](util['format'](_0x99b0('0x53'),_0x2424e1[_0x99b0('0x8')],!_[_0x99b0('0x23')](_0x2424e1[_0x99b0('0x48')][_0x99b0('0x54')])?_0x99b0('0x54'):_0x99b0('0x55'),_0x2424e1[_0x99b0('0x4b')]));channels[_0x2424e1[_0x99b0('0x8')]][_0x99b0('0x56')]='Queue';channels[_0x2424e1[_0x99b0('0x8')]][_0x99b0('0x57')]=_0x2424e1[_0x99b0('0x4b')];channels[_0x2424e1[_0x99b0('0x8')]]['queue']=!![];}if(!_[_0x99b0('0x23')](_0x2424e1['variable']['xmd-contactid'])){utils[_0x99b0('0xa')](util['format'](_0x99b0('0x58'),_0x2424e1[_0x99b0('0x8')],_0x2424e1[_0x99b0('0x4b')]));channels[_0x2424e1['uniqueid']][_0x99b0('0x59')]=_0x2424e1[_0x99b0('0x4b')];}if(!_['isNil'](_0x2424e1[_0x99b0('0x48')][_0x99b0('0x5a')])){utils[_0x99b0('0xa')](util['format'](_0x99b0('0x5b'),_0x2424e1[_0x99b0('0x8')],_0x2424e1[_0x99b0('0x4b')]));channels[_0x2424e1['uniqueid']][_0x99b0('0x5c')]=_0x2424e1[_0x99b0('0x4b')];}if(!_['isNil'](_0x2424e1[_0x99b0('0x48')][_0x99b0('0x5d')])){utils['info'](util[_0x99b0('0xb')](_0x99b0('0x5e'),_0x2424e1[_0x99b0('0x8')],_0x2424e1[_0x99b0('0x4b')]));channels[_0x2424e1[_0x99b0('0x8')]][_0x99b0('0x5f')]=_0x2424e1[_0x99b0('0x4b')];}if(!_[_0x99b0('0x23')](_0x2424e1[_0x99b0('0x48')][_0x99b0('0x60')])){utils[_0x99b0('0xa')](util['format']('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x2424e1[_0x99b0('0x8')],_0x2424e1[_0x99b0('0x4b')]));channels[_0x2424e1[_0x99b0('0x8')]][_0x99b0('0x60')]=_0x2424e1[_0x99b0('0x4b')];}}}catch(_0x32d446){utils[_0x99b0('0x21')](util['format'](_0x99b0('0x47'),_0x2424e1[_0x99b0('0x8')]),_0x32d446);}};exports['newexten']=function(_0x588550){try{if(!_[_0x99b0('0x23')](channels[_0x588550[_0x99b0('0x8')]])){utils[_0x99b0('0x19')](util['format'](_0x99b0('0x61'),_0x588550[_0x99b0('0x8')]),_0x588550);utils[_0x99b0('0xa')](util['format'](_0x99b0('0x62'),_0x588550[_0x99b0('0x8')],_0x588550[_0x99b0('0x63')],_0x588550[_0x99b0('0x64')]));if(_0x588550[_0x99b0('0x63')][_0x99b0('0x65')]()=='set'&&_[_0x99b0('0x66')](_0x588550[_0x99b0('0x64')][_0x99b0('0x65')](),_0x99b0('0x67'))){var _0x15a556=_0x588550[_0x99b0('0x64')][_0x99b0('0x68')]('=');var _0xe9c094=_0x15a556[0x0][_0x99b0('0x69')](_0x15a556[0x0][_0x99b0('0x6a')]('(')+0x1,_0x15a556[0x0][_0x99b0('0x6a')](')'));var _0x3ea8c8=_0x15a556[0x1];channels[_0x588550[_0x99b0('0x8')]][_0xe9c094]=_0x3ea8c8;}if(!_[_0x99b0('0x6b')](['hangup',_0x99b0('0x6c'),_0x99b0('0x6d'),_0x99b0('0x6e'),_0x99b0('0x6f')],_0x588550['application'][_0x99b0('0x65')]())){channels[_0x588550['uniqueid']][_0x99b0('0x56')]=_0x588550['application'];channels[_0x588550[_0x99b0('0x8')]][_0x99b0('0x57')]=_0x588550[_0x99b0('0x64')];}}}catch(_0x10e52e){utils[_0x99b0('0x21')](util[_0x99b0('0xb')]('[%s][calls][newexten]',_0x588550[_0x99b0('0x8')]),_0x10e52e);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 72e28d9..dc98b36 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 _0x4757=['[core]\x20close','managerevent','info','[core]\x20connected','[core]\x20shutdown','fullybooted','error','[core]\x20error'];(function(_0x57d648,_0x19c802){var _0x281ce2=function(_0x11aeb8){while(--_0x11aeb8){_0x57d648['push'](_0x57d648['shift']());}};_0x281ce2(++_0x19c802);}(_0x4757,0x1c2));var _0x7475=function(_0x2405bc,_0x2f28a1){_0x2405bc=_0x2405bc-0x0;var _0x5272d4=_0x4757[_0x2405bc];return _0x5272d4;};'use strict';var utils=require('./utils');exports['connect']=function(){utils[_0x7475('0x0')](_0x7475('0x1'));};exports['shutdown']=function(){utils[_0x7475('0x0')](_0x7475('0x2'));};exports[_0x7475('0x3')]=function(){utils[_0x7475('0x0')]('[core]\x20fullybooted');};exports[_0x7475('0x4')]=function(_0x3aa18c){utils[_0x7475('0x4')](_0x7475('0x5'),_0x3aa18c);};exports['close']=function(){utils['info'](_0x7475('0x6'));};exports[_0x7475('0x7')]=function(_0x2ea466){}; \ No newline at end of file +var _0x1a14=['close','[core]\x20close','managerevent','./utils','connect','info','[core]\x20connected','shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x1a14,0x15f));var _0x41a1=function(_0x302871,_0x30fa77){_0x302871=_0x302871-0x0;var _0x106558=_0x1a14[_0x302871];return _0x106558;};'use strict';var utils=require(_0x41a1('0x0'));exports[_0x41a1('0x1')]=function(){utils[_0x41a1('0x2')](_0x41a1('0x3'));};exports[_0x41a1('0x4')]=function(){utils['info']('[core]\x20shutdown');};exports[_0x41a1('0x5')]=function(){utils[_0x41a1('0x2')](_0x41a1('0x6'));};exports[_0x41a1('0x7')]=function(_0x2d23e0){utils['error'](_0x41a1('0x8'),_0x2d23e0);};exports[_0x41a1('0x9')]=function(){utils['info'](_0x41a1('0xa'));};exports[_0x41a1('0xb')]=function(_0x189fac){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index dd4f299..609f77f 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 _0x7d9c=['[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','duration','endtime','holdtime','diffTime','billableseconds','[%s][dials][hangup]','lodash','util','./utils','format','uniqueid','channel','calleridnum','connectedlinenum','dialstatus','request','newexten','debug','[%s][dials][newexten]','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','error','varset','[%s][dials][varset]','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','dialend'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0x7d9c,0x1b8));var _0xc7d9=function(_0x1091fd,_0x5a9b79){_0x1091fd=_0x1091fd-0x0;var _0x32ceae=_0x7d9c[_0x1091fd];return _0x32ceae;};'use strict';var _=require(_0xc7d9('0x0'));var util=require(_0xc7d9('0x1'));var utils=require(_0xc7d9('0x2'));var dials={};function writeDB(_0x5a272d){utils['info'](util[_0xc7d9('0x3')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x5a272d[_0xc7d9('0x4')],_0x5a272d[_0xc7d9('0x5')],_0x5a272d['dialstring'],_0x5a272d[_0xc7d9('0x6')],_0x5a272d[_0xc7d9('0x7')],_0x5a272d[_0xc7d9('0x8')]));utils[_0xc7d9('0x9')]('CreateVoiceDialReport',_0x5a272d);delete dials[_0x5a272d['uniqueid']];}exports[_0xc7d9('0xa')]=function(_0x543c84){try{utils[_0xc7d9('0xb')](util['format'](_0xc7d9('0xc'),_0x543c84[_0xc7d9('0x4')]),_0x543c84);utils[_0xc7d9('0xd')](util['format'](_0xc7d9('0xe'),_0x543c84['uniqueid'],_0x543c84[_0xc7d9('0xf')],_0x543c84[_0xc7d9('0x10')]));if(_0x543c84[_0xc7d9('0xf')][_0xc7d9('0x11')]()==_0xc7d9('0x12')&&_[_0xc7d9('0x13')](_0x543c84[_0xc7d9('0x10')]['toLowerCase'](),_0xc7d9('0x14'))){var _0x35ae5a=_0x543c84[_0xc7d9('0x10')][_0xc7d9('0x15')]('=');dials[_0x543c84[_0xc7d9('0x4')]]={'routeId':_0x35ae5a[0x1]};}}catch(_0x4958a7){utils[_0xc7d9('0x16')](util[_0xc7d9('0x3')]('[%s][dials][newexten]',_0x543c84[_0xc7d9('0x4')]),_0x4958a7);}};exports[_0xc7d9('0x17')]=function(_0x38a735){try{utils[_0xc7d9('0xb')](util['format'](_0xc7d9('0x18'),_0x38a735[_0xc7d9('0x4')]),_0x38a735);if(!_[_0xc7d9('0x19')](_0x38a735['variable'][_0xc7d9('0x1a')])){utils[_0xc7d9('0xd')](util[_0xc7d9('0x3')](_0xc7d9('0x1b'),_0x38a735[_0xc7d9('0x4')],_0x38a735[_0xc7d9('0x1c')]));dials[_0x38a735['uniqueid']]={'routeId':_0x38a735['value']};}}catch(_0x45474b){utils['error'](util[_0xc7d9('0x3')](_0xc7d9('0x18'),_0x38a735['uniqueid']),_0x45474b);}};exports[_0xc7d9('0x1d')]=function(_0x2d7ee2){try{if(!_['isNil'](dials[_0x2d7ee2[_0xc7d9('0x4')]])){utils[_0xc7d9('0xb')](util['format'](_0xc7d9('0x1e'),_0x2d7ee2[_0xc7d9('0x4')]),_0x2d7ee2);dials[_0x2d7ee2[_0xc7d9('0x4')]]=_[_0xc7d9('0x1f')](dials[_0x2d7ee2['uniqueid']],_0x2d7ee2);dials[_0x2d7ee2[_0xc7d9('0x4')]][_0xc7d9('0x20')]=utils[_0xc7d9('0x21')]();dials[_0x2d7ee2[_0xc7d9('0x4')]][_0xc7d9('0x22')]=_0xc7d9('0x23');utils[_0xc7d9('0xd')](util['format']('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x2d7ee2['uniqueid'],dials[_0x2d7ee2[_0xc7d9('0x4')]]['starttime']));}}catch(_0x3e818b){utils[_0xc7d9('0x16')](util[_0xc7d9('0x3')]('[%s][dials][dialbegin]',_0x2d7ee2['uniqueid']),_0x3e818b);}};exports[_0xc7d9('0x24')]=function(_0x546516){try{if(!_[_0xc7d9('0x19')](dials[_0x546516['uniqueid']])){utils[_0xc7d9('0xb')](util[_0xc7d9('0x3')](_0xc7d9('0x25'),_0x546516['uniqueid']),_0x546516);dials[_0x546516[_0xc7d9('0x4')]][_0xc7d9('0x8')]=_0x546516[_0xc7d9('0x8')];if(_0x546516[_0xc7d9('0x8')]==_0xc7d9('0x26')){dials[_0x546516['uniqueid']]=_[_0xc7d9('0x1f')](dials[_0x546516[_0xc7d9('0x4')]],_0x546516);dials[_0x546516['uniqueid']][_0xc7d9('0x27')]=utils[_0xc7d9('0x21')]();dials[_0x546516[_0xc7d9('0x4')]][_0xc7d9('0x22')]=_0xc7d9('0x28');utils['info'](util['format'](_0xc7d9('0x29'),_0x546516[_0xc7d9('0x4')],_0x546516[_0xc7d9('0x8')],dials[_0x546516['uniqueid']][_0xc7d9('0x27')]));}else{utils[_0xc7d9('0xd')](util[_0xc7d9('0x3')](_0xc7d9('0x2a'),_0x546516[_0xc7d9('0x4')],_0x546516[_0xc7d9('0x8')]));}}}catch(_0x57359f){utils[_0xc7d9('0x16')](util[_0xc7d9('0x3')](_0xc7d9('0x25'),_0x546516[_0xc7d9('0x4')]),_0x57359f);}};exports[_0xc7d9('0x2b')]=function(_0x501e77){try{if(!_[_0xc7d9('0x19')](dials[_0x501e77[_0xc7d9('0x4')]])){utils[_0xc7d9('0xb')](util[_0xc7d9('0x3')]('[%s][dials][hangup]',_0x501e77[_0xc7d9('0x4')]),_0x501e77);utils[_0xc7d9('0xd')](util[_0xc7d9('0x3')](_0xc7d9('0x2c'),_0x501e77[_0xc7d9('0x4')],_0x501e77[_0xc7d9('0x6')],_0x501e77[_0xc7d9('0x2d')],_0x501e77[_0xc7d9('0x2e')]));dials[_0x501e77[_0xc7d9('0x4')]]=_['assign'](dials[_0x501e77['uniqueid']],{'endtime':utils[_0xc7d9('0x21')](),'lastevent':'complete'});dials[_0x501e77[_0xc7d9('0x4')]][_0xc7d9('0x2f')]=utils['diffTime'](dials[_0x501e77[_0xc7d9('0x4')]][_0xc7d9('0x30')],dials[_0x501e77['uniqueid']]['starttime']);dials[_0x501e77[_0xc7d9('0x4')]][_0xc7d9('0x31')]=utils[_0xc7d9('0x32')](dials[_0x501e77[_0xc7d9('0x4')]]['answertime']||dials[_0x501e77[_0xc7d9('0x4')]]['endtime'],dials[_0x501e77['uniqueid']][_0xc7d9('0x20')]);dials[_0x501e77[_0xc7d9('0x4')]][_0xc7d9('0x33')]=dials[_0x501e77[_0xc7d9('0x4')]][_0xc7d9('0x27')]?utils[_0xc7d9('0x32')](dials[_0x501e77[_0xc7d9('0x4')]][_0xc7d9('0x30')],dials[_0x501e77[_0xc7d9('0x4')]][_0xc7d9('0x27')]):0x0;writeDB(dials[_0x501e77['uniqueid']]);}}catch(_0x501151){utils[_0xc7d9('0x16')](util[_0xc7d9('0x3')](_0xc7d9('0x34'),_0x501e77[_0xc7d9('0x4')]),_0x501151);}}; \ No newline at end of file +var _0x8c3f=['[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','cdr(routeid)','split','error','varset','[%s][dials][varset]','isNil','outboundrouteid','value','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','dialend','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup'];(function(_0x32f05c,_0x273aef){var _0x4307ed=function(_0x1be4da){while(--_0x1be4da){_0x32f05c['push'](_0x32f05c['shift']());}};_0x4307ed(++_0x273aef);}(_0x8c3f,0xd9));var _0xf8c3=function(_0x2c4a4d,_0x36facd){_0x2c4a4d=_0x2c4a4d-0x0;var _0x4cb9ad=_0x8c3f[_0x2c4a4d];return _0x4cb9ad;};'use strict';var _=require(_0xf8c3('0x0'));var util=require(_0xf8c3('0x1'));var utils=require(_0xf8c3('0x2'));var dials={};function writeDB(_0xbdd003){utils['info'](util[_0xf8c3('0x3')](_0xf8c3('0x4'),_0xbdd003[_0xf8c3('0x5')],_0xbdd003[_0xf8c3('0x6')],_0xbdd003['dialstring'],_0xbdd003[_0xf8c3('0x7')],_0xbdd003[_0xf8c3('0x8')],_0xbdd003[_0xf8c3('0x9')]));utils[_0xf8c3('0xa')](_0xf8c3('0xb'),_0xbdd003);delete dials[_0xbdd003['uniqueid']];}exports[_0xf8c3('0xc')]=function(_0xe38c37){try{utils[_0xf8c3('0xd')](util[_0xf8c3('0x3')](_0xf8c3('0xe'),_0xe38c37['uniqueid']),_0xe38c37);utils[_0xf8c3('0xf')](util[_0xf8c3('0x3')](_0xf8c3('0x10'),_0xe38c37[_0xf8c3('0x5')],_0xe38c37[_0xf8c3('0x11')],_0xe38c37[_0xf8c3('0x12')]));if(_0xe38c37[_0xf8c3('0x11')]['toLowerCase']()==_0xf8c3('0x13')&&_[_0xf8c3('0x14')](_0xe38c37[_0xf8c3('0x12')][_0xf8c3('0x15')](),_0xf8c3('0x16'))){var _0x5be583=_0xe38c37['appdata'][_0xf8c3('0x17')]('=');dials[_0xe38c37[_0xf8c3('0x5')]]={'routeId':_0x5be583[0x1]};}}catch(_0x15173a){utils[_0xf8c3('0x18')](util[_0xf8c3('0x3')](_0xf8c3('0xe'),_0xe38c37[_0xf8c3('0x5')]),_0x15173a);}};exports[_0xf8c3('0x19')]=function(_0x567984){try{utils[_0xf8c3('0xd')](util['format'](_0xf8c3('0x1a'),_0x567984[_0xf8c3('0x5')]),_0x567984);if(!_[_0xf8c3('0x1b')](_0x567984['variable'][_0xf8c3('0x1c')])){utils[_0xf8c3('0xf')](util[_0xf8c3('0x3')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x567984[_0xf8c3('0x5')],_0x567984['value']));dials[_0x567984[_0xf8c3('0x5')]]={'routeId':_0x567984[_0xf8c3('0x1d')]};}}catch(_0x2a663e){utils['error'](util[_0xf8c3('0x3')]('[%s][dials][varset]',_0x567984['uniqueid']),_0x2a663e);}};exports['dialbegin']=function(_0x2bad06){try{if(!_[_0xf8c3('0x1b')](dials[_0x2bad06[_0xf8c3('0x5')]])){utils['debug'](util[_0xf8c3('0x3')](_0xf8c3('0x1e'),_0x2bad06[_0xf8c3('0x5')]),_0x2bad06);dials[_0x2bad06[_0xf8c3('0x5')]]=_[_0xf8c3('0x1f')](dials[_0x2bad06[_0xf8c3('0x5')]],_0x2bad06);dials[_0x2bad06[_0xf8c3('0x5')]][_0xf8c3('0x20')]=utils[_0xf8c3('0x21')]();dials[_0x2bad06[_0xf8c3('0x5')]][_0xf8c3('0x22')]=_0xf8c3('0x23');utils[_0xf8c3('0xf')](util['format']('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x2bad06[_0xf8c3('0x5')],dials[_0x2bad06['uniqueid']][_0xf8c3('0x20')]));}}catch(_0x23e744){utils['error'](util['format'](_0xf8c3('0x1e'),_0x2bad06[_0xf8c3('0x5')]),_0x23e744);}};exports[_0xf8c3('0x24')]=function(_0x4b24f2){try{if(!_[_0xf8c3('0x1b')](dials[_0x4b24f2[_0xf8c3('0x5')]])){utils[_0xf8c3('0xd')](util[_0xf8c3('0x3')]('[%s][dials][dialend]',_0x4b24f2[_0xf8c3('0x5')]),_0x4b24f2);dials[_0x4b24f2[_0xf8c3('0x5')]][_0xf8c3('0x9')]=_0x4b24f2[_0xf8c3('0x9')];if(_0x4b24f2[_0xf8c3('0x9')]==_0xf8c3('0x25')){dials[_0x4b24f2[_0xf8c3('0x5')]]=_[_0xf8c3('0x1f')](dials[_0x4b24f2[_0xf8c3('0x5')]],_0x4b24f2);dials[_0x4b24f2[_0xf8c3('0x5')]][_0xf8c3('0x26')]=utils[_0xf8c3('0x21')]();dials[_0x4b24f2['uniqueid']][_0xf8c3('0x22')]=_0xf8c3('0x27');utils[_0xf8c3('0xf')](util['format']('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x4b24f2['uniqueid'],_0x4b24f2[_0xf8c3('0x9')],dials[_0x4b24f2['uniqueid']][_0xf8c3('0x26')]));}else{utils[_0xf8c3('0xf')](util['format'](_0xf8c3('0x28'),_0x4b24f2['uniqueid'],_0x4b24f2[_0xf8c3('0x9')]));}}}catch(_0x14b66f){utils[_0xf8c3('0x18')](util['format'](_0xf8c3('0x29'),_0x4b24f2[_0xf8c3('0x5')]),_0x14b66f);}};exports[_0xf8c3('0x2a')]=function(_0x17e980){try{if(!_[_0xf8c3('0x1b')](dials[_0x17e980['uniqueid']])){utils[_0xf8c3('0xd')](util['format'](_0xf8c3('0x2b'),_0x17e980['uniqueid']),_0x17e980);utils[_0xf8c3('0xf')](util[_0xf8c3('0x3')](_0xf8c3('0x2c'),_0x17e980[_0xf8c3('0x5')],_0x17e980[_0xf8c3('0x7')],_0x17e980[_0xf8c3('0x2d')],_0x17e980[_0xf8c3('0x2e')]));dials[_0x17e980[_0xf8c3('0x5')]]=_[_0xf8c3('0x1f')](dials[_0x17e980[_0xf8c3('0x5')]],{'endtime':utils[_0xf8c3('0x21')](),'lastevent':_0xf8c3('0x2f')});dials[_0x17e980[_0xf8c3('0x5')]]['duration']=utils[_0xf8c3('0x30')](dials[_0x17e980[_0xf8c3('0x5')]][_0xf8c3('0x31')],dials[_0x17e980[_0xf8c3('0x5')]]['starttime']);dials[_0x17e980['uniqueid']][_0xf8c3('0x32')]=utils[_0xf8c3('0x30')](dials[_0x17e980[_0xf8c3('0x5')]][_0xf8c3('0x26')]||dials[_0x17e980[_0xf8c3('0x5')]][_0xf8c3('0x31')],dials[_0x17e980['uniqueid']]['starttime']);dials[_0x17e980['uniqueid']][_0xf8c3('0x33')]=dials[_0x17e980['uniqueid']][_0xf8c3('0x26')]?utils['diffTime'](dials[_0x17e980[_0xf8c3('0x5')]]['endtime'],dials[_0x17e980[_0xf8c3('0x5')]][_0xf8c3('0x26')]):0x0;writeDB(dials[_0x17e980['uniqueid']]);}}catch(_0x2ff783){utils[_0xf8c3('0x18')](util[_0xf8c3('0x3')](_0xf8c3('0x2b'),_0x17e980[_0xf8c3('0x5')]),_0x2ff783);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 8ee0649..c55f317 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 _0x5c49=['newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','../../config/environment','./utils','xdr','disabled','production','local','asterisk','username','password','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./queues.controller','./members.controller','./dials.controller','./transfers.controller','connect','fullybooted','close','managerevent','devicestatechange','device','error','format','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','debug','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]'];(function(_0xf47487,_0xec2cf8){var _0x47d576=function(_0x153cef){while(--_0x153cef){_0xf47487['push'](_0xf47487['shift']());}};_0x47d576(++_0xec2cf8);}(_0x5c49,0x1e2));var _0x95c4=function(_0x7729b1,_0x468322){_0x7729b1=_0x7729b1-0x0;var _0x349504=_0x5c49[_0x7729b1];return _0x349504;};var AsteriskManager=require('asterisk-manager');var config=require(_0x95c4('0x0'));var utils=require(_0x95c4('0x1'));var util=require('util');var isXDREnabled=config[_0x95c4('0x2')]&&config[_0x95c4('0x2')][_0x95c4('0x3')]?!config[_0x95c4('0x2')][_0x95c4('0x3')]:!![];var isProduction=config['env']===_0x95c4('0x4')||![];var isLocalAsterisk=config[_0x95c4('0x2')]&&config['xdr'][_0x95c4('0x5')]===!![]||![];var ami=new AsteriskManager(config[_0x95c4('0x6')]['port'],config[_0x95c4('0x6')]['ip'],config['asterisk'][_0x95c4('0x7')],config[_0x95c4('0x6')][_0x95c4('0x8')],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0x95c4('0x9')](_0x95c4('0xa'));}else if(!isProduction&&!isLocalAsterisk){utils['info'](_0x95c4('0xb'));}else{var agents=require(_0x95c4('0xc'));var calls=require('./calls.controller');var queues=require(_0x95c4('0xd'));var recordings=require('./recordings.controller');var members=require(_0x95c4('0xe'));var dials=require(_0x95c4('0xf'));var transfers=require(_0x95c4('0x10'));var core=require('./core.controller');ami['on'](_0x95c4('0x11'),core[_0x95c4('0x11')]);ami['on']('shutdown',core['shutdown']);ami['on'](_0x95c4('0x12'),core[_0x95c4('0x12')]);ami['on']('error',core['error']);ami['on']('close',core[_0x95c4('0x13')]);ami['on'](_0x95c4('0x14'),core['managerevent']);ami['on'](_0x95c4('0x15'),function(_0xa1492c){try{utils['debug'](util['format']('[%s][index][devicestatechange]',_0xa1492c[_0x95c4('0x16')]),_0xa1492c);members[_0x95c4('0x15')](_0xa1492c);}catch(_0x3bdea9){utils[_0x95c4('0x17')](util[_0x95c4('0x18')](_0x95c4('0x19'),_0xa1492c['device']),_0x3bdea9);}});ami['on'](_0x95c4('0x1a'),function(_0x16fd17){try{utils['debug'](util[_0x95c4('0x18')](_0x95c4('0x1b'),_0x16fd17[_0x95c4('0x1c')]),_0x16fd17);agents['agentcalled'](_0x16fd17);}catch(_0x3a2c05){utils[_0x95c4('0x17')](util[_0x95c4('0x18')]('[%s][index][agentcalled]',_0x16fd17[_0x95c4('0x1c')]),_0x3a2c05);}});ami['on'](_0x95c4('0x1d'),function(_0x5eefde){try{utils['debug'](util[_0x95c4('0x18')](_0x95c4('0x1e'),_0x5eefde['uniqueid']),_0x5eefde);agents[_0x95c4('0x1d')](_0x5eefde);}catch(_0x511a16){utils['error'](util[_0x95c4('0x18')](_0x95c4('0x1e'),_0x5eefde[_0x95c4('0x1c')]),_0x511a16);}});ami['on'](_0x95c4('0x1f'),function(_0x2cddab){try{utils[_0x95c4('0x20')](util['format'](_0x95c4('0x21'),_0x2cddab['uniqueid']),_0x2cddab);agents[_0x95c4('0x1f')](_0x2cddab);queues['agentconnect'](_0x2cddab);}catch(_0x1d6e8d){utils['error'](util[_0x95c4('0x18')](_0x95c4('0x21'),_0x2cddab[_0x95c4('0x1c')]),_0x1d6e8d);}});ami['on']('agentcomplete',function(_0x419854){try{utils['debug'](util['format'](_0x95c4('0x22'),_0x419854[_0x95c4('0x1c')]),_0x419854);agents[_0x95c4('0x23')](_0x419854);queues['agentcomplete'](_0x419854);members[_0x95c4('0x23')](_0x419854);}catch(_0x616672){utils['error'](util[_0x95c4('0x18')](_0x95c4('0x22'),_0x419854[_0x95c4('0x1c')]),_0x616672);}});ami['on'](_0x95c4('0x24'),function(_0xc8ede8){try{utils[_0x95c4('0x20')](util[_0x95c4('0x18')](_0x95c4('0x25'),_0xc8ede8['uniqueid']),_0xc8ede8);agents['queuecallerabandon'](_0xc8ede8);queues[_0x95c4('0x24')](_0xc8ede8);}catch(_0x13e586){utils['error'](util[_0x95c4('0x18')](_0x95c4('0x25'),_0xc8ede8[_0x95c4('0x1c')]),_0x13e586);}});ami['on'](_0x95c4('0x26'),function(_0x15c61c){try{utils[_0x95c4('0x20')](util[_0x95c4('0x18')](_0x95c4('0x27'),_0x15c61c['uniqueid']),_0x15c61c);queues[_0x95c4('0x26')](_0x15c61c);recordings['queuecallerjoin'](_0x15c61c);}catch(_0x53200e){utils[_0x95c4('0x17')](util[_0x95c4('0x18')](_0x95c4('0x27'),_0x15c61c[_0x95c4('0x1c')]),_0x53200e);}});ami['on']('queuecallerleave',function(_0x279911){try{utils[_0x95c4('0x20')](util[_0x95c4('0x18')](_0x95c4('0x28'),_0x279911[_0x95c4('0x1c')]),_0x279911);queues[_0x95c4('0x29')](_0x279911);}catch(_0x89f340){utils[_0x95c4('0x17')](util[_0x95c4('0x18')](_0x95c4('0x28'),_0x279911[_0x95c4('0x1c')]),_0x89f340);}});ami['on'](_0x95c4('0x2a'),function(_0x59b6d7){try{utils[_0x95c4('0x20')](util[_0x95c4('0x18')](_0x95c4('0x2b'),_0x59b6d7['uniqueid']),_0x59b6d7);queues[_0x95c4('0x2a')](_0x59b6d7);calls[_0x95c4('0x2a')](_0x59b6d7);}catch(_0x2de671){utils['error'](util[_0x95c4('0x18')]('[%s][index][musiconholdstart]',_0x59b6d7[_0x95c4('0x1c')]),_0x2de671);}});ami['on']('musiconholdstop',function(_0x94a821){try{utils['debug'](util[_0x95c4('0x18')](_0x95c4('0x2c'),_0x94a821[_0x95c4('0x1c')]),_0x94a821);queues['musiconholdstop'](_0x94a821);calls[_0x95c4('0x2d')](_0x94a821);}catch(_0x2951a9){utils[_0x95c4('0x17')](util[_0x95c4('0x18')](_0x95c4('0x2c'),_0x94a821['uniqueid']),_0x2951a9);}});ami['on'](_0x95c4('0x2e'),function(_0x440d90){try{utils[_0x95c4('0x20')](util[_0x95c4('0x18')](_0x95c4('0x2f'),_0x440d90['uniqueid']),_0x440d90);calls[_0x95c4('0x2e')](_0x440d90);recordings[_0x95c4('0x2e')](_0x440d90);}catch(_0x32360e){utils[_0x95c4('0x17')](util['format'](_0x95c4('0x2f'),_0x440d90[_0x95c4('0x1c')]),_0x32360e);}});ami['on']('hangup',function(_0x3ed528){try{utils[_0x95c4('0x20')](util['format']('[%s][index][hangup]',_0x3ed528['uniqueid']),_0x3ed528);calls[_0x95c4('0x30')](_0x3ed528);recordings[_0x95c4('0x30')](_0x3ed528);dials[_0x95c4('0x30')](_0x3ed528);agents[_0x95c4('0x30')](_0x3ed528);queues[_0x95c4('0x30')](_0x3ed528);}catch(_0x2f016b){utils[_0x95c4('0x17')](util[_0x95c4('0x18')](_0x95c4('0x31'),_0x3ed528[_0x95c4('0x1c')]),_0x2f016b);}});ami['on'](_0x95c4('0x32'),function(_0x25d5b6){try{utils['debug'](util['format']('[%s][index][cdr]',_0x25d5b6['uniqueid']),_0x25d5b6);members[_0x95c4('0x32')](_0x25d5b6);}catch(_0x3c6389){utils[_0x95c4('0x17')](util[_0x95c4('0x18')](_0x95c4('0x33'),_0x25d5b6['uniqueid']),_0x3c6389);}});ami['on']('blindtransfer',function(_0x3858ec){try{utils[_0x95c4('0x20')](util[_0x95c4('0x18')]('[%s][index][blindtransfer]',_0x3858ec[_0x95c4('0x1c')]),_0x3858ec);queues[_0x95c4('0x34')](_0x3858ec);agents['blindtransfer'](_0x3858ec);transfers[_0x95c4('0x34')](_0x3858ec);recordings[_0x95c4('0x34')](_0x3858ec);}catch(_0x5ec6ad){utils['error'](util['format'](_0x95c4('0x35'),_0x3858ec[_0x95c4('0x1c')]),_0x5ec6ad);}});ami['on'](_0x95c4('0x36'),function(_0x592e1d){try{utils[_0x95c4('0x20')](util['format'](_0x95c4('0x37'),_0x592e1d[_0x95c4('0x38')]),_0x592e1d);queues[_0x95c4('0x36')](_0x592e1d);transfers[_0x95c4('0x36')](_0x592e1d);agents[_0x95c4('0x36')](_0x592e1d);calls[_0x95c4('0x36')](_0x592e1d);}catch(_0x3ab534){utils[_0x95c4('0x17')](util['format'](_0x95c4('0x37'),_0x592e1d[_0x95c4('0x38')]),_0x3ab534);}});ami['on'](_0x95c4('0x39'),function(_0x4698a6){try{utils[_0x95c4('0x20')](util[_0x95c4('0x18')](_0x95c4('0x3a'),_0x4698a6[_0x95c4('0x1c')]),_0x4698a6);queues[_0x95c4('0x39')](_0x4698a6);recordings[_0x95c4('0x39')](_0x4698a6);calls[_0x95c4('0x39')](_0x4698a6);dials[_0x95c4('0x39')](_0x4698a6);}catch(_0x580af9){utils[_0x95c4('0x17')](util[_0x95c4('0x18')]('[%s][index][varset]',_0x4698a6['uniqueid']),_0x580af9);}});ami['on'](_0x95c4('0x3b'),function(_0x1632c4){try{utils[_0x95c4('0x20')](util[_0x95c4('0x18')]('[%s][index][newexten]',_0x1632c4[_0x95c4('0x1c')]),_0x1632c4);calls[_0x95c4('0x3b')](_0x1632c4);recordings[_0x95c4('0x3b')](_0x1632c4);dials[_0x95c4('0x3b')](_0x1632c4);}catch(_0x17f1fd){utils['error'](util[_0x95c4('0x18')](_0x95c4('0x3c'),_0x1632c4[_0x95c4('0x1c')]),_0x17f1fd);}});ami['on']('newchannel',function(_0x160501){try{utils[_0x95c4('0x20')](util[_0x95c4('0x18')](_0x95c4('0x3d'),_0x160501['uniqueid']),_0x160501);calls['newchannel'](_0x160501);recordings[_0x95c4('0x3e')](_0x160501);}catch(_0x3d1888){utils[_0x95c4('0x17')](util[_0x95c4('0x18')](_0x95c4('0x3d'),_0x160501[_0x95c4('0x1c')]),_0x3d1888);}});ami['on'](_0x95c4('0x3f'),function(_0x45705c){try{utils['debug'](util[_0x95c4('0x18')](_0x95c4('0x40'),_0x45705c[_0x95c4('0x1c')]),_0x45705c);dials[_0x95c4('0x3f')](_0x45705c);}catch(_0x38dcd7){utils[_0x95c4('0x17')](util[_0x95c4('0x18')](_0x95c4('0x41'),_0x45705c['uniqueid']),_0x38dcd7);}});ami['on'](_0x95c4('0x42'),function(_0x3d33ce){try{utils[_0x95c4('0x20')](util[_0x95c4('0x18')](_0x95c4('0x43'),_0x3d33ce['uniqueid']),_0x3d33ce);dials[_0x95c4('0x42')](_0x3d33ce);}catch(_0x5d840d){utils[_0x95c4('0x17')](util[_0x95c4('0x18')](_0x95c4('0x43'),_0x3d33ce[_0x95c4('0x1c')]),_0x5d840d);}});} \ No newline at end of file +var _0x576a=['./dials.controller','./core.controller','connect','fullybooted','error','close','managerevent','debug','format','device','devicestatechange','uniqueid','agentcalled','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','env','production','local','asterisk','port','username','password','keepConnected','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./members.controller'];(function(_0x114532,_0x32e1b4){var _0x3b5531=function(_0x578965){while(--_0x578965){_0x114532['push'](_0x114532['shift']());}};_0x3b5531(++_0x32e1b4);}(_0x576a,0xfc));var _0xa576=function(_0x52d898,_0x91fa8){_0x52d898=_0x52d898-0x0;var _0x1645cc=_0x576a[_0x52d898];return _0x1645cc;};var AsteriskManager=require(_0xa576('0x0'));var config=require(_0xa576('0x1'));var utils=require(_0xa576('0x2'));var util=require(_0xa576('0x3'));var isXDREnabled=config[_0xa576('0x4')]&&config[_0xa576('0x4')][_0xa576('0x5')]?!config[_0xa576('0x4')][_0xa576('0x5')]:!![];var isProduction=config[_0xa576('0x6')]===_0xa576('0x7')||![];var isLocalAsterisk=config[_0xa576('0x4')]&&config['xdr'][_0xa576('0x8')]===!![]||![];var ami=new AsteriskManager(config[_0xa576('0x9')][_0xa576('0xa')],config[_0xa576('0x9')]['ip'],config[_0xa576('0x9')][_0xa576('0xb')],config[_0xa576('0x9')][_0xa576('0xc')],!![]);ami[_0xa576('0xd')]();if(!isXDREnabled){utils['info']('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0xa576('0xe')](_0xa576('0xf'));}else{var agents=require(_0xa576('0x10'));var calls=require(_0xa576('0x11'));var queues=require(_0xa576('0x12'));var recordings=require('./recordings.controller');var members=require(_0xa576('0x13'));var dials=require(_0xa576('0x14'));var transfers=require('./transfers.controller');var core=require(_0xa576('0x15'));ami['on'](_0xa576('0x16'),core[_0xa576('0x16')]);ami['on']('shutdown',core['shutdown']);ami['on'](_0xa576('0x17'),core[_0xa576('0x17')]);ami['on'](_0xa576('0x18'),core[_0xa576('0x18')]);ami['on'](_0xa576('0x19'),core['close']);ami['on'](_0xa576('0x1a'),core['managerevent']);ami['on']('devicestatechange',function(_0x5440fe){try{utils[_0xa576('0x1b')](util[_0xa576('0x1c')]('[%s][index][devicestatechange]',_0x5440fe[_0xa576('0x1d')]),_0x5440fe);members[_0xa576('0x1e')](_0x5440fe);}catch(_0x1d8361){utils[_0xa576('0x18')](util['format']('[%s][index][devicestatechange]',_0x5440fe[_0xa576('0x1d')]),_0x1d8361);}});ami['on']('agentcalled',function(_0x11fee4){try{utils[_0xa576('0x1b')](util[_0xa576('0x1c')]('[%s][index][agentcalled]',_0x11fee4[_0xa576('0x1f')]),_0x11fee4);agents[_0xa576('0x20')](_0x11fee4);}catch(_0x311eee){utils[_0xa576('0x18')](util[_0xa576('0x1c')](_0xa576('0x21'),_0x11fee4[_0xa576('0x1f')]),_0x311eee);}});ami['on'](_0xa576('0x22'),function(_0x2ab3ac){try{utils['debug'](util[_0xa576('0x1c')](_0xa576('0x23'),_0x2ab3ac[_0xa576('0x1f')]),_0x2ab3ac);agents['agentringnoanswer'](_0x2ab3ac);}catch(_0x4770cc){utils[_0xa576('0x18')](util[_0xa576('0x1c')](_0xa576('0x23'),_0x2ab3ac[_0xa576('0x1f')]),_0x4770cc);}});ami['on'](_0xa576('0x24'),function(_0x38e8f3){try{utils[_0xa576('0x1b')](util[_0xa576('0x1c')]('[%s][index][agentconnect]',_0x38e8f3[_0xa576('0x1f')]),_0x38e8f3);agents[_0xa576('0x24')](_0x38e8f3);queues[_0xa576('0x24')](_0x38e8f3);}catch(_0x11f77d){utils['error'](util[_0xa576('0x1c')]('[%s][index][agentconnect]',_0x38e8f3['uniqueid']),_0x11f77d);}});ami['on'](_0xa576('0x25'),function(_0xccb2cb){try{utils[_0xa576('0x1b')](util[_0xa576('0x1c')](_0xa576('0x26'),_0xccb2cb[_0xa576('0x1f')]),_0xccb2cb);agents[_0xa576('0x25')](_0xccb2cb);queues[_0xa576('0x25')](_0xccb2cb);members['agentcomplete'](_0xccb2cb);}catch(_0x118ae5){utils[_0xa576('0x18')](util[_0xa576('0x1c')](_0xa576('0x26'),_0xccb2cb['uniqueid']),_0x118ae5);}});ami['on']('queuecallerabandon',function(_0x4d76cb){try{utils[_0xa576('0x1b')](util['format'](_0xa576('0x27'),_0x4d76cb[_0xa576('0x1f')]),_0x4d76cb);agents[_0xa576('0x28')](_0x4d76cb);queues[_0xa576('0x28')](_0x4d76cb);}catch(_0x189b39){utils['error'](util[_0xa576('0x1c')](_0xa576('0x27'),_0x4d76cb[_0xa576('0x1f')]),_0x189b39);}});ami['on'](_0xa576('0x29'),function(_0x7c49a){try{utils[_0xa576('0x1b')](util['format'](_0xa576('0x2a'),_0x7c49a[_0xa576('0x1f')]),_0x7c49a);queues[_0xa576('0x29')](_0x7c49a);recordings[_0xa576('0x29')](_0x7c49a);}catch(_0x54fddb){utils[_0xa576('0x18')](util['format'](_0xa576('0x2a'),_0x7c49a[_0xa576('0x1f')]),_0x54fddb);}});ami['on'](_0xa576('0x2b'),function(_0x4cb693){try{utils[_0xa576('0x1b')](util[_0xa576('0x1c')](_0xa576('0x2c'),_0x4cb693[_0xa576('0x1f')]),_0x4cb693);queues['queuecallerleave'](_0x4cb693);}catch(_0x411fa2){utils[_0xa576('0x18')](util[_0xa576('0x1c')](_0xa576('0x2c'),_0x4cb693['uniqueid']),_0x411fa2);}});ami['on']('musiconholdstart',function(_0x34067b){try{utils[_0xa576('0x1b')](util[_0xa576('0x1c')](_0xa576('0x2d'),_0x34067b[_0xa576('0x1f')]),_0x34067b);queues[_0xa576('0x2e')](_0x34067b);calls[_0xa576('0x2e')](_0x34067b);}catch(_0x18b1c1){utils['error'](util[_0xa576('0x1c')]('[%s][index][musiconholdstart]',_0x34067b['uniqueid']),_0x18b1c1);}});ami['on']('musiconholdstop',function(_0x1df366){try{utils['debug'](util[_0xa576('0x1c')](_0xa576('0x2f'),_0x1df366[_0xa576('0x1f')]),_0x1df366);queues[_0xa576('0x30')](_0x1df366);calls['musiconholdstop'](_0x1df366);}catch(_0x17085c){utils['error'](util[_0xa576('0x1c')](_0xa576('0x2f'),_0x1df366['uniqueid']),_0x17085c);}});ami['on'](_0xa576('0x31'),function(_0x31cdf1){try{utils['debug'](util[_0xa576('0x1c')]('[%s][index][newstate]',_0x31cdf1['uniqueid']),_0x31cdf1);calls[_0xa576('0x31')](_0x31cdf1);recordings[_0xa576('0x31')](_0x31cdf1);}catch(_0x509d66){utils[_0xa576('0x18')](util[_0xa576('0x1c')]('[%s][index][newstate]',_0x31cdf1[_0xa576('0x1f')]),_0x509d66);}});ami['on']('hangup',function(_0x10c1f2){try{utils['debug'](util[_0xa576('0x1c')](_0xa576('0x32'),_0x10c1f2[_0xa576('0x1f')]),_0x10c1f2);calls['hangup'](_0x10c1f2);recordings['hangup'](_0x10c1f2);dials[_0xa576('0x33')](_0x10c1f2);agents[_0xa576('0x33')](_0x10c1f2);queues[_0xa576('0x33')](_0x10c1f2);}catch(_0x383bff){utils['error'](util[_0xa576('0x1c')](_0xa576('0x32'),_0x10c1f2[_0xa576('0x1f')]),_0x383bff);}});ami['on'](_0xa576('0x34'),function(_0x1a2da2){try{utils['debug'](util[_0xa576('0x1c')](_0xa576('0x35'),_0x1a2da2[_0xa576('0x1f')]),_0x1a2da2);members[_0xa576('0x34')](_0x1a2da2);}catch(_0x1fae1b){utils['error'](util[_0xa576('0x1c')](_0xa576('0x35'),_0x1a2da2[_0xa576('0x1f')]),_0x1fae1b);}});ami['on'](_0xa576('0x36'),function(_0x3d411c){try{utils[_0xa576('0x1b')](util['format'](_0xa576('0x37'),_0x3d411c[_0xa576('0x1f')]),_0x3d411c);queues[_0xa576('0x36')](_0x3d411c);agents['blindtransfer'](_0x3d411c);transfers[_0xa576('0x36')](_0x3d411c);recordings[_0xa576('0x36')](_0x3d411c);}catch(_0x421619){utils[_0xa576('0x18')](util['format'](_0xa576('0x37'),_0x3d411c[_0xa576('0x1f')]),_0x421619);}});ami['on'](_0xa576('0x38'),function(_0x56b5e7){try{utils[_0xa576('0x1b')](util[_0xa576('0x1c')]('[%s][index][attendedtransfer]',_0x56b5e7[_0xa576('0x39')]),_0x56b5e7);queues[_0xa576('0x38')](_0x56b5e7);transfers[_0xa576('0x38')](_0x56b5e7);agents[_0xa576('0x38')](_0x56b5e7);calls['attendedtransfer'](_0x56b5e7);}catch(_0x239566){utils['error'](util[_0xa576('0x1c')]('[%s][index][attendedtransfer]',_0x56b5e7[_0xa576('0x39')]),_0x239566);}});ami['on']('varset',function(_0x3d16f8){try{utils[_0xa576('0x1b')](util[_0xa576('0x1c')]('[%s][index][varset]',_0x3d16f8[_0xa576('0x1f')]),_0x3d16f8);queues['varset'](_0x3d16f8);recordings['varset'](_0x3d16f8);calls[_0xa576('0x3a')](_0x3d16f8);dials['varset'](_0x3d16f8);}catch(_0x362d95){utils[_0xa576('0x18')](util[_0xa576('0x1c')](_0xa576('0x3b'),_0x3d16f8['uniqueid']),_0x362d95);}});ami['on']('newexten',function(_0x8a0558){try{utils['debug'](util[_0xa576('0x1c')](_0xa576('0x3c'),_0x8a0558[_0xa576('0x1f')]),_0x8a0558);calls[_0xa576('0x3d')](_0x8a0558);recordings['newexten'](_0x8a0558);dials[_0xa576('0x3d')](_0x8a0558);}catch(_0x358421){utils['error'](util[_0xa576('0x1c')](_0xa576('0x3c'),_0x8a0558[_0xa576('0x1f')]),_0x358421);}});ami['on'](_0xa576('0x3e'),function(_0x393e87){try{utils[_0xa576('0x1b')](util['format'](_0xa576('0x3f'),_0x393e87['uniqueid']),_0x393e87);calls[_0xa576('0x3e')](_0x393e87);recordings[_0xa576('0x3e')](_0x393e87);}catch(_0x16c10f){utils[_0xa576('0x18')](util['format'](_0xa576('0x3f'),_0x393e87[_0xa576('0x1f')]),_0x16c10f);}});ami['on'](_0xa576('0x40'),function(_0x4cc944){try{utils[_0xa576('0x1b')](util['format']('[%s][index][dialbegin]',_0x4cc944[_0xa576('0x1f')]),_0x4cc944);dials['dialbegin'](_0x4cc944);}catch(_0x3fbf2f){utils[_0xa576('0x18')](util[_0xa576('0x1c')](_0xa576('0x41'),_0x4cc944[_0xa576('0x1f')]),_0x3fbf2f);}});ami['on'](_0xa576('0x42'),function(_0xdf3844){try{utils[_0xa576('0x1b')](util[_0xa576('0x1c')](_0xa576('0x43'),_0xdf3844[_0xa576('0x1f')]),_0xdf3844);dials[_0xa576('0x42')](_0xdf3844);}catch(_0x372392){utils[_0xa576('0x18')](util['format'](_0xa576('0x43'),_0xdf3844[_0xa576('0x1f')]),_0x372392);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 8ba7aa2..fe18283 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 _0x599f=['[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','[%s][members][cdr]','channel','assign','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','data2','destinationchannel','type','source','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','membername','interface','getUserByInterface','then','name','internal','CreateMemberReport','getUserByName','split','error','some','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','TALKING','now','agent','isNil','duration','diffTime','exitAt','enterAt','agentcomplete'];(function(_0x586fa2,_0x1a45bc){var _0x515be9=function(_0x4e90d5){while(--_0x4e90d5){_0x586fa2['push'](_0x586fa2['shift']());}};_0x515be9(++_0x1a45bc);}(_0x599f,0x74));var _0xf599=function(_0x1ec82a,_0x25ff0a){_0x1ec82a=_0x1ec82a-0x0;var _0xab4dc0=_0x599f[_0x1ec82a];return _0xab4dc0;};'use strict';var _=require(_0xf599('0x0'));var util=require(_0xf599('0x1'));var utils=require(_0xf599('0x2'));var members={};var exclude=[_0xf599('0x3'),_0xf599('0x4')];function writeDB(_0x4008b6){utils[_0xf599('0x5')](util[_0xf599('0x6')](_0xf599('0x7'),_0x4008b6[_0xf599('0x8')],_0x4008b6['interface'],_0x4008b6['channel'],_0x4008b6['data2'],_0x4008b6[_0xf599('0x9')],_0x4008b6['type']));if(_0x4008b6[_0xf599('0xa')]){utils[_0xf599('0xb')](_0x4008b6[_0xf599('0xa')])[_0xf599('0xc')](function(_0x762cec){if(_0x762cec){_0x4008b6[_0xf599('0x9')]=_0x762cec[_0xf599('0xd')];_0x4008b6[_0xf599('0xe')]=_0x762cec[_0xf599('0xe')];utils['request'](_0xf599('0xf'),_0x4008b6);}else{utils[_0xf599('0x10')](_0x4008b6[_0xf599('0xa')][_0xf599('0x11')]('/')[0x1])[_0xf599('0xc')](function(_0x22c119){if(_0x22c119){_0x4008b6[_0xf599('0x9')]=_0x22c119['name'];_0x4008b6[_0xf599('0xe')]=_0x22c119['internal'];utils['request']('CreateMemberReport',_0x4008b6);}});}})['catch'](function(_0x332c7b){utils[_0xf599('0x12')](util[_0xf599('0x6')]('[%s][members][writeDB]',_0x4008b6['uniqueid']),_0x332c7b);});}delete members[_0x4008b6[_0xf599('0xa')]];}function startsWith(_0x58f810,_0x5d5bc8){return _[_0xf599('0x13')](_0x58f810,function(_0x1ead22){return _['startsWith'](_0x5d5bc8,_0x1ead22);});}exports[_0xf599('0x14')]=function(_0x17e544){try{utils[_0xf599('0x15')](util[_0xf599('0x6')](_0xf599('0x16'),members[_0x17e544[_0xf599('0x17')]]?members[_0x17e544[_0xf599('0x17')]][_0xf599('0x8')]:_0x17e544[_0xf599('0x17')]),_0x17e544);utils['info'](util['format'](_0xf599('0x18'),members[_0x17e544[_0xf599('0x17')]]?members[_0x17e544[_0xf599('0x17')]][_0xf599('0x8')]:_0x17e544[_0xf599('0x17')],_0x17e544[_0xf599('0x19')],_0x17e544[_0xf599('0x17')]));switch(_0x17e544['state']){case _0xf599('0x1a'):case _0xf599('0x1b'):if(!startsWith(exclude,_0x17e544['device'])){members[_0x17e544[_0xf599('0x17')]]={'channel':'voice','interface':_0x17e544[_0xf599('0x17')],'type':_0xf599('0x1c'),'enterAt':utils[_0xf599('0x1d')](),'role':_0xf599('0x1e')};}break;case'NOT_INUSE':if(!_[_0xf599('0x1f')](members[_0x17e544['device']])){members[_0x17e544[_0xf599('0x17')]]['exitAt']=utils[_0xf599('0x1d')]();members[_0x17e544[_0xf599('0x17')]][_0xf599('0x20')]=utils[_0xf599('0x21')](members[_0x17e544['device']][_0xf599('0x22')],members[_0x17e544['device']][_0xf599('0x23')]);if(members[_0x17e544['device']][_0xf599('0x8')]){writeDB(members[_0x17e544[_0xf599('0x17')]]);}}break;default:break;}}catch(_0x40ed53){utils['error'](util[_0xf599('0x6')](_0xf599('0x16'),members[_0x17e544['device']]?members[_0x17e544[_0xf599('0x17')]][_0xf599('0x8')]:_0x17e544['device']),_0x40ed53);}};exports[_0xf599('0x24')]=function(_0x4ea078){try{if(!_[_0xf599('0x1f')](members[_0x4ea078[_0xf599('0xa')]])){utils[_0xf599('0x15')](util['format'](_0xf599('0x25'),_0x4ea078['uniqueid']),_0x4ea078);utils['info'](util[_0xf599('0x6')](_0xf599('0x26'),_0x4ea078[_0xf599('0x8')],_0x4ea078[_0xf599('0xa')],_0x4ea078[_0xf599('0x27')]));members[_0x4ea078[_0xf599('0xa')]]=_['assign'](members[_0x4ea078[_0xf599('0xa')]],{'data4':_0x4ea078[_0xf599('0x27')],'uniqueid':_0x4ea078[_0xf599('0x8')]});}}catch(_0xd73c96){utils[_0xf599('0x12')](util[_0xf599('0x6')](_0xf599('0x25'),_0x4ea078[_0xf599('0x8')]),_0xd73c96);}};exports['cdr']=function(_0xcdc26b){try{utils[_0xf599('0x15')](util[_0xf599('0x6')](_0xf599('0x28'),_0xcdc26b[_0xf599('0x8')]),_0xcdc26b);if(_0xcdc26b[_0xf599('0x29')]){var _0x49a5dd=_0xcdc26b[_0xf599('0x29')][_0xf599('0x11')]('-')[0x0];if(!_[_0xf599('0x1f')](members[_0x49a5dd])){members[_0x49a5dd]=_[_0xf599('0x2a')](members[_0x49a5dd],{'data1':members[_0x49a5dd]['data1']||_0xcdc26b['type'],'data2':members[_0x49a5dd]['data2']||_0xcdc26b['source'],'data3':members[_0x49a5dd][_0xf599('0x2b')]||_0xcdc26b[_0xf599('0x2c')],'uniqueid':members[_0x49a5dd][_0xf599('0x8')]||_0xcdc26b[_0xf599('0x8')]});utils[_0xf599('0x5')](util[_0xf599('0x6')](_0xf599('0x2d'),_0xcdc26b['uniqueid'],members[_0x49a5dd][_0xf599('0x2e')],members[_0x49a5dd][_0xf599('0x2f')],members[_0x49a5dd]['data3']));if(members[_0x49a5dd]['exitAt']){writeDB(members[_0x49a5dd]);}}}if(_0xcdc26b[_0xf599('0x30')]){var _0x21fb5d=_0xcdc26b[_0xf599('0x30')][_0xf599('0x11')]('-')[0x0];if(!_[_0xf599('0x1f')](members[_0x21fb5d])){members[_0x21fb5d]=_[_0xf599('0x2a')](members[_0x21fb5d],{'data1':members[_0x21fb5d][_0xf599('0x2e')]||_0xcdc26b[_0xf599('0x31')],'data2':members[_0x21fb5d]['data2']||_0xcdc26b[_0xf599('0x32')],'data3':members[_0x21fb5d]['data3']||_0xcdc26b['destination'],'uniqueid':members[_0x21fb5d][_0xf599('0x8')]||_0xcdc26b[_0xf599('0x8')]});utils[_0xf599('0x5')](util[_0xf599('0x6')](_0xf599('0x2d'),_0xcdc26b[_0xf599('0x8')],members[_0x21fb5d][_0xf599('0x2e')],members[_0x21fb5d][_0xf599('0x2f')],members[_0x21fb5d][_0xf599('0x2b')]));if(members[_0x21fb5d][_0xf599('0x22')]){writeDB(members[_0x21fb5d]);}}}}catch(_0x73d7a6){utils[_0xf599('0x12')](util['format'](_0xf599('0x28'),_0xcdc26b[_0xf599('0x8')]),_0x73d7a6);}}; \ No newline at end of file +var _0x3379=['format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','channel','data2','membername','then','name','internal','request','CreateMemberReport','getUserByName','error','[%s][members][writeDB]','startsWith','devicestatechange','debug','device','uniqueid','state','INUSE','voice','now','NOT_INUSE','exitAt','duration','enterAt','[%s][members][devicestatechange]','agentcomplete','isNil','queue','assign','[%s][members][agentcomplete]','cdr','[%s][members][cdr]','split','data1','type','source','data3','destination','destinationchannel','lodash','util','./utils','Local/_attended@transfer','info'];(function(_0x126fb9,_0x122c59){var _0xc8a3b1=function(_0x355744){while(--_0x355744){_0x126fb9['push'](_0x126fb9['shift']());}};_0xc8a3b1(++_0x122c59);}(_0x3379,0x115));var _0x9337=function(_0x155398,_0x286a1f){_0x155398=_0x155398-0x0;var _0x19543e=_0x3379[_0x155398];return _0x19543e;};'use strict';var _=require(_0x9337('0x0'));var util=require(_0x9337('0x1'));var utils=require(_0x9337('0x2'));var members={};var exclude=[_0x9337('0x3'),'Queue:'];function writeDB(_0x369104){utils[_0x9337('0x4')](util[_0x9337('0x5')](_0x9337('0x6'),_0x369104['uniqueid'],_0x369104[_0x9337('0x7')],_0x369104[_0x9337('0x8')],_0x369104[_0x9337('0x9')],_0x369104[_0x9337('0xa')],_0x369104['type']));if(_0x369104[_0x9337('0x7')]){utils['getUserByInterface'](_0x369104[_0x9337('0x7')])[_0x9337('0xb')](function(_0x240bfc){if(_0x240bfc){_0x369104[_0x9337('0xa')]=_0x240bfc[_0x9337('0xc')];_0x369104['internal']=_0x240bfc[_0x9337('0xd')];utils[_0x9337('0xe')](_0x9337('0xf'),_0x369104);}else{utils[_0x9337('0x10')](_0x369104[_0x9337('0x7')]['split']('/')[0x1])[_0x9337('0xb')](function(_0x46b22e){if(_0x46b22e){_0x369104[_0x9337('0xa')]=_0x46b22e[_0x9337('0xc')];_0x369104[_0x9337('0xd')]=_0x46b22e[_0x9337('0xd')];utils[_0x9337('0xe')]('CreateMemberReport',_0x369104);}});}})['catch'](function(_0xa58254){utils[_0x9337('0x11')](util[_0x9337('0x5')](_0x9337('0x12'),_0x369104['uniqueid']),_0xa58254);});}delete members[_0x369104['interface']];}function startsWith(_0x13515e,_0x594b51){return _['some'](_0x13515e,function(_0x35e805){return _[_0x9337('0x13')](_0x594b51,_0x35e805);});}exports[_0x9337('0x14')]=function(_0x48644e){try{utils[_0x9337('0x15')](util[_0x9337('0x5')]('[%s][members][devicestatechange]',members[_0x48644e['device']]?members[_0x48644e[_0x9337('0x16')]][_0x9337('0x17')]:_0x48644e['device']),_0x48644e);utils[_0x9337('0x4')](util[_0x9337('0x5')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x48644e[_0x9337('0x16')]]?members[_0x48644e[_0x9337('0x16')]]['uniqueid']:_0x48644e[_0x9337('0x16')],_0x48644e[_0x9337('0x18')],_0x48644e['device']));switch(_0x48644e['state']){case _0x9337('0x19'):case'BUSY':if(!startsWith(exclude,_0x48644e[_0x9337('0x16')])){members[_0x48644e['device']]={'channel':_0x9337('0x1a'),'interface':_0x48644e['device'],'type':'TALKING','enterAt':utils[_0x9337('0x1b')](),'role':'agent'};}break;case _0x9337('0x1c'):if(!_['isNil'](members[_0x48644e[_0x9337('0x16')]])){members[_0x48644e[_0x9337('0x16')]][_0x9337('0x1d')]=utils[_0x9337('0x1b')]();members[_0x48644e[_0x9337('0x16')]][_0x9337('0x1e')]=utils['diffTime'](members[_0x48644e['device']][_0x9337('0x1d')],members[_0x48644e[_0x9337('0x16')]][_0x9337('0x1f')]);if(members[_0x48644e[_0x9337('0x16')]]['uniqueid']){writeDB(members[_0x48644e[_0x9337('0x16')]]);}}break;default:break;}}catch(_0x48e884){utils[_0x9337('0x11')](util[_0x9337('0x5')](_0x9337('0x20'),members[_0x48644e[_0x9337('0x16')]]?members[_0x48644e['device']]['uniqueid']:_0x48644e[_0x9337('0x16')]),_0x48e884);}};exports[_0x9337('0x21')]=function(_0x118972){try{if(!_[_0x9337('0x22')](members[_0x118972[_0x9337('0x7')]])){utils['debug'](util[_0x9337('0x5')]('[%s][members][agentcomplete]',_0x118972[_0x9337('0x17')]),_0x118972);utils['info'](util['format']('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x118972['uniqueid'],_0x118972[_0x9337('0x7')],_0x118972[_0x9337('0x23')]));members[_0x118972[_0x9337('0x7')]]=_[_0x9337('0x24')](members[_0x118972[_0x9337('0x7')]],{'data4':_0x118972['queue'],'uniqueid':_0x118972['uniqueid']});}}catch(_0x13f75f){utils[_0x9337('0x11')](util[_0x9337('0x5')](_0x9337('0x25'),_0x118972[_0x9337('0x17')]),_0x13f75f);}};exports[_0x9337('0x26')]=function(_0x57df97){try{utils[_0x9337('0x15')](util[_0x9337('0x5')](_0x9337('0x27'),_0x57df97['uniqueid']),_0x57df97);if(_0x57df97[_0x9337('0x8')]){var _0x55b529=_0x57df97[_0x9337('0x8')][_0x9337('0x28')]('-')[0x0];if(!_[_0x9337('0x22')](members[_0x55b529])){members[_0x55b529]=_[_0x9337('0x24')](members[_0x55b529],{'data1':members[_0x55b529][_0x9337('0x29')]||_0x57df97[_0x9337('0x2a')],'data2':members[_0x55b529][_0x9337('0x9')]||_0x57df97[_0x9337('0x2b')],'data3':members[_0x55b529][_0x9337('0x2c')]||_0x57df97[_0x9337('0x2d')],'uniqueid':members[_0x55b529][_0x9337('0x17')]||_0x57df97[_0x9337('0x17')]});utils[_0x9337('0x4')](util[_0x9337('0x5')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x57df97[_0x9337('0x17')],members[_0x55b529][_0x9337('0x29')],members[_0x55b529]['data2'],members[_0x55b529][_0x9337('0x2c')]));if(members[_0x55b529][_0x9337('0x1d')]){writeDB(members[_0x55b529]);}}}if(_0x57df97[_0x9337('0x2e')]){var _0x267c0b=_0x57df97['destinationchannel'][_0x9337('0x28')]('-')[0x0];if(!_['isNil'](members[_0x267c0b])){members[_0x267c0b]=_[_0x9337('0x24')](members[_0x267c0b],{'data1':members[_0x267c0b][_0x9337('0x29')]||_0x57df97[_0x9337('0x2a')],'data2':members[_0x267c0b]['data2']||_0x57df97[_0x9337('0x2b')],'data3':members[_0x267c0b]['data3']||_0x57df97['destination'],'uniqueid':members[_0x267c0b][_0x9337('0x17')]||_0x57df97['uniqueid']});utils['info'](util[_0x9337('0x5')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x57df97[_0x9337('0x17')],members[_0x267c0b]['data1'],members[_0x267c0b]['data2'],members[_0x267c0b][_0x9337('0x2c')]));if(members[_0x267c0b]['exitAt']){writeDB(members[_0x267c0b]);}}}}catch(_0x523025){utils['error'](util[_0x9337('0x5')](_0x9337('0x27'),_0x57df97['uniqueid']),_0x523025);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 436f855..42241b9 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 _0xcfa0=['queuecallerexit','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','[%s][queues][hangup]','varset','[%s][queues][varset]','isNil','variable','queuestatus','value','queuecallerabandonAt','queuecallerexitAt','toUpperCase','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','diffTime','queuecallerjoinAt','count','[%s][queues][agentconnect]','membername','destaccountcode','accountcode','assigned','reason','transfer','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','BLIND','transferexten','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfertype','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','holdtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','secondtransfererexten','ATTENDED','transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','uniqueid','channel','queue','lastAssignedTo','calleridnum','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','error','hangup','queuecallerleaveAt','queuecallerabandon'];(function(_0x39d993,_0x451c6e){var _0x49b4f1=function(_0x1ff7d3){while(--_0x1ff7d3){_0x39d993['push'](_0x39d993['shift']());}};_0x49b4f1(++_0x451c6e);}(_0xcfa0,0x10c));var _0x0cfa=function(_0xe58887,_0x51ae5e){_0xe58887=_0xe58887-0x0;var _0x263605=_0xcfa0[_0xe58887];return _0x263605;};'use strict';var _=require(_0x0cfa('0x0'));var util=require(_0x0cfa('0x1'));var utils=require(_0x0cfa('0x2'));var queues={};function writeDB(_0x23ab79){utils[_0x0cfa('0x3')](util[_0x0cfa('0x4')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x23ab79[_0x0cfa('0x5')],_0x23ab79[_0x0cfa('0x6')],_0x23ab79[_0x0cfa('0x7')],_0x23ab79[_0x0cfa('0x8')],_0x23ab79[_0x0cfa('0x9')],_0x23ab79['accountcode'],_0x23ab79[_0x0cfa('0xa')]));if(_0x23ab79[_0x0cfa('0x7')]){utils[_0x0cfa('0xb')](_0x23ab79[_0x0cfa('0x7')])[_0x0cfa('0xc')](function(_0x5cb1e6){if(_0x5cb1e6){_0x23ab79[_0x0cfa('0xd')]=_0x5cb1e6['type'];}utils[_0x0cfa('0xe')]('CreateVoiceQueueReport',_0x23ab79);});}else{utils[_0x0cfa('0xe')](_0x0cfa('0xf'),_0x23ab79);}if(_0x23ab79[_0x0cfa('0x10')]){delete queues[_0x23ab79[_0x0cfa('0x10')]];}else{delete queues[_0x23ab79['uniqueid']];}}exports[_0x0cfa('0x11')]=function(_0x2f8c2f){try{utils[_0x0cfa('0x12')](util[_0x0cfa('0x4')]('[%s][queues][queuecallerjoin]',_0x2f8c2f['uniqueid']),_0x2f8c2f);utils[_0x0cfa('0x3')](util[_0x0cfa('0x4')](_0x0cfa('0x13'),_0x2f8c2f[_0x0cfa('0x5')],_0x2f8c2f[_0x0cfa('0x7')],_0x2f8c2f[_0x0cfa('0x14')]));queues[_0x2f8c2f[_0x0cfa('0x5')]]=_['assign'](_0x2f8c2f,{'originalposition':_0x2f8c2f[_0x0cfa('0x14')],'queuecallerjoinAt':utils[_0x0cfa('0x15')](),'mohtime':0x0});}catch(_0x44f854){utils[_0x0cfa('0x16')](util['format']('[%s][queues][queuecallerjoin]',_0x2f8c2f[_0x0cfa('0x5')]),_0x44f854);}};exports[_0x0cfa('0x17')]=function(_0x18cf7b){try{if(!_['isNil'](queues[_0x18cf7b[_0x0cfa('0x5')]])){utils['debug'](util[_0x0cfa('0x4')]('[%s][queues][hangup]',_0x18cf7b[_0x0cfa('0x5')]),_0x18cf7b);if(queues[_0x18cf7b['uniqueid']][_0x0cfa('0x18')]){if(!queues[_0x18cf7b['uniqueid']][_0x0cfa('0x19')]&&!queues[_0x18cf7b[_0x0cfa('0x5')]][_0x0cfa('0x1a')]){queues[_0x18cf7b[_0x0cfa('0x5')]]['queuecallercomplete']=!![];queues[_0x18cf7b[_0x0cfa('0x5')]]['queuecallercompleteAt']=utils[_0x0cfa('0x15')]();queues[_0x18cf7b[_0x0cfa('0x5')]][_0x0cfa('0xa')]=_0x0cfa('0x1b');}utils[_0x0cfa('0x3')](util[_0x0cfa('0x4')](_0x0cfa('0x1c'),_0x18cf7b[_0x0cfa('0x5')],queues[_0x18cf7b['uniqueid']]['name'],queues[_0x18cf7b[_0x0cfa('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x18cf7b[_0x0cfa('0x5')]]);}else if(queues[_0x18cf7b['uniqueid']]['transfereduniqueid']){utils[_0x0cfa('0x3')](util[_0x0cfa('0x4')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x18cf7b[_0x0cfa('0x5')],queues[_0x18cf7b[_0x0cfa('0x5')]][_0x0cfa('0x1d')],queues[_0x18cf7b[_0x0cfa('0x5')]][_0x0cfa('0x10')]));queues[queues[_0x18cf7b[_0x0cfa('0x5')]][_0x0cfa('0x10')]]=queues[_0x18cf7b['uniqueid']];queues[queues[_0x18cf7b[_0x0cfa('0x5')]]['transfereduniqueid']][_0x0cfa('0x1e')]=0x2;delete queues[_0x18cf7b[_0x0cfa('0x5')]];}}}catch(_0x1159e9){utils[_0x0cfa('0x16')](util[_0x0cfa('0x4')](_0x0cfa('0x1f'),_0x18cf7b['uniqueid']),_0x1159e9);}};exports[_0x0cfa('0x20')]=function(_0x4f28a5){try{utils[_0x0cfa('0x12')](util['format'](_0x0cfa('0x21'),_0x4f28a5[_0x0cfa('0x5')]),_0x4f28a5);if(!_[_0x0cfa('0x22')](_0x4f28a5[_0x0cfa('0x23')][_0x0cfa('0x24')])&&_0x4f28a5[_0x0cfa('0x25')]['toUpperCase']()!=='CONTINUE'){if(!_[_0x0cfa('0x22')](queues[_0x4f28a5[_0x0cfa('0x5')]])){queues[_0x4f28a5[_0x0cfa('0x5')]]['queuecallerabandon']=![];queues[_0x4f28a5[_0x0cfa('0x5')]][_0x0cfa('0x26')]=null;queues[_0x4f28a5['uniqueid']]['queuecallerexit']=!![];queues[_0x4f28a5[_0x0cfa('0x5')]][_0x0cfa('0x27')]=utils['now']();queues[_0x4f28a5[_0x0cfa('0x5')]][_0x0cfa('0xa')]=_0x4f28a5[_0x0cfa('0x25')][_0x0cfa('0x28')]();utils[_0x0cfa('0x3')](util[_0x0cfa('0x4')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x4f28a5[_0x0cfa('0x5')],queues[_0x4f28a5['uniqueid']][_0x0cfa('0x1d')],_0x4f28a5[_0x0cfa('0x25')],queues[_0x4f28a5[_0x0cfa('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x4f28a5[_0x0cfa('0x5')]]);}}else if(!_[_0x0cfa('0x22')](_0x4f28a5[_0x0cfa('0x23')]['queueposition'])){if(!_['isNil'](queues[_0x4f28a5['uniqueid']])&&!queues[_0x4f28a5['uniqueid']][_0x0cfa('0x19')]){queues[_0x4f28a5[_0x0cfa('0x5')]][_0x0cfa('0x19')]=![];queues[_0x4f28a5[_0x0cfa('0x5')]]['queuecallerabandonAt']=null;queues[_0x4f28a5[_0x0cfa('0x5')]]['queuecallerexit']=!![];queues[_0x4f28a5[_0x0cfa('0x5')]]['queuecallerexitAt']=utils[_0x0cfa('0x15')]();queues[_0x4f28a5['uniqueid']]['queuecallerexitreason']=_0x0cfa('0x29');utils['info'](util[_0x0cfa('0x4')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x4f28a5[_0x0cfa('0x5')],queues[_0x4f28a5['uniqueid']][_0x0cfa('0x1d')],_0x4f28a5[_0x0cfa('0x25')],queues[_0x4f28a5[_0x0cfa('0x5')]][_0x0cfa('0xa')]));}}}catch(_0x5b6c9e){utils[_0x0cfa('0x16')](util[_0x0cfa('0x4')](_0x0cfa('0x21'),_0x4f28a5[_0x0cfa('0x5')]),_0x5b6c9e);}};exports['queuecallerabandon']=function(_0x33ea9e){try{if(!_[_0x0cfa('0x22')](queues[_0x33ea9e[_0x0cfa('0x5')]])){utils[_0x0cfa('0x12')](util['format'](_0x0cfa('0x2a'),_0x33ea9e['uniqueid']),_0x33ea9e);queues[_0x33ea9e[_0x0cfa('0x5')]][_0x0cfa('0x1a')]=![];queues[_0x33ea9e[_0x0cfa('0x5')]][_0x0cfa('0x27')]=null;queues[_0x33ea9e[_0x0cfa('0x5')]][_0x0cfa('0x19')]=!![];queues[_0x33ea9e[_0x0cfa('0x5')]]['queuecallerabandonAt']=utils[_0x0cfa('0x15')]();queues[_0x33ea9e[_0x0cfa('0x5')]][_0x0cfa('0xa')]=_0x0cfa('0x2b');utils[_0x0cfa('0x3')](util[_0x0cfa('0x4')](_0x0cfa('0x2c'),_0x33ea9e[_0x0cfa('0x5')],queues[_0x33ea9e[_0x0cfa('0x5')]]['name'],queues[_0x33ea9e[_0x0cfa('0x5')]]['queuecallerexitreason']));}}catch(_0x73f8){utils['error'](util[_0x0cfa('0x4')]('[%s][queues][queuecallerabandon]',_0x33ea9e['uniqueid']),_0x73f8);}};exports[_0x0cfa('0x2d')]=function(_0x4b6585){try{if(!_['isNil'](queues[_0x4b6585[_0x0cfa('0x5')]])){utils[_0x0cfa('0x12')](util['format'](_0x0cfa('0x2e'),_0x4b6585['uniqueid']),_0x4b6585);utils[_0x0cfa('0x3')](util[_0x0cfa('0x4')](_0x0cfa('0x2f'),_0x4b6585[_0x0cfa('0x5')],queues[_0x4b6585[_0x0cfa('0x5')]]['name'],_0x4b6585[_0x0cfa('0x30')],_0x4b6585[_0x0cfa('0x31')]));queues[_0x4b6585['uniqueid']][_0x0cfa('0x2d')]=!![];queues[_0x4b6585['uniqueid']][_0x0cfa('0x18')]=utils[_0x0cfa('0x15')]();queues[_0x4b6585[_0x0cfa('0x5')]]['holdtime']=utils[_0x0cfa('0x32')](queues[_0x4b6585[_0x0cfa('0x5')]][_0x0cfa('0x18')],queues[_0x4b6585['uniqueid']][_0x0cfa('0x33')]);queues[_0x4b6585['uniqueid']]['position']=_0x4b6585[_0x0cfa('0x14')];queues[_0x4b6585['uniqueid']][_0x0cfa('0x34')]=_0x4b6585[_0x0cfa('0x34')];queues[_0x4b6585['uniqueid']][_0x0cfa('0x30')]=_0x4b6585[_0x0cfa('0x30')];queues[_0x4b6585['uniqueid']]['connectedlinename']=_0x4b6585[_0x0cfa('0x31')];}}catch(_0x43bf9c){utils[_0x0cfa('0x16')](util[_0x0cfa('0x4')](_0x0cfa('0x2e'),_0x4b6585['uniqueid']),_0x43bf9c);}};exports['agentconnect']=function(_0x58c022){try{if(!_[_0x0cfa('0x22')](queues[_0x58c022[_0x0cfa('0x5')]])){utils[_0x0cfa('0x12')](util[_0x0cfa('0x4')](_0x0cfa('0x35'),_0x58c022['uniqueid']),_0x58c022);utils['info'](util[_0x0cfa('0x4')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x58c022[_0x0cfa('0x5')],queues[_0x58c022[_0x0cfa('0x5')]][_0x0cfa('0x1d')],_0x58c022[_0x0cfa('0x36')],_0x58c022[_0x0cfa('0x37')]));queues[_0x58c022[_0x0cfa('0x5')]]['queuecallerabandon']=![];queues[_0x58c022[_0x0cfa('0x5')]][_0x0cfa('0x19')]=![];queues[_0x58c022[_0x0cfa('0x5')]]['queuecallerabandonAt']=null;queues[_0x58c022[_0x0cfa('0x5')]]['queuecallerexit']=![];queues[_0x58c022['uniqueid']][_0x0cfa('0xa')]=null;queues[_0x58c022[_0x0cfa('0x5')]]['queuecallerexitAt']=null;queues[_0x58c022[_0x0cfa('0x5')]]['assigned']=!![];queues[_0x58c022[_0x0cfa('0x5')]][_0x0cfa('0x38')]=_0x58c022[_0x0cfa('0x37')];queues[_0x58c022[_0x0cfa('0x5')]][_0x0cfa('0x8')]=_0x58c022[_0x0cfa('0x36')];}}catch(_0x133981){utils[_0x0cfa('0x16')](util[_0x0cfa('0x4')]('[%s][queues][agentconnect]',_0x58c022[_0x0cfa('0x5')]),_0x133981);}};exports['agentcomplete']=function(_0x319ebd){try{if(!_['isNil'](queues[_0x319ebd[_0x0cfa('0x5')]])){if(queues[_0x319ebd['uniqueid']][_0x0cfa('0x18')]){utils[_0x0cfa('0x12')](util[_0x0cfa('0x4')]('[%s][queues][agentcomplete]',_0x319ebd[_0x0cfa('0x5')]),_0x319ebd);queues[_0x319ebd[_0x0cfa('0x5')]][_0x0cfa('0x19')]=![];queues[_0x319ebd[_0x0cfa('0x5')]][_0x0cfa('0x19')]=![];queues[_0x319ebd['uniqueid']][_0x0cfa('0x26')]=null;queues[_0x319ebd[_0x0cfa('0x5')]]['queuecallerexit']=![];queues[_0x319ebd['uniqueid']]['queuecallerexitAt']=null;queues[_0x319ebd[_0x0cfa('0x5')]][_0x0cfa('0x39')]=!![];queues[_0x319ebd[_0x0cfa('0x5')]]['lastAssignedTo']=_0x319ebd['membername'];queues[_0x319ebd[_0x0cfa('0x5')]]['queuecallercomplete']=!![];queues[_0x319ebd[_0x0cfa('0x5')]]['queuecallercompleteAt']=utils[_0x0cfa('0x15')]();if(_0x319ebd[_0x0cfa('0x3a')]==_0x0cfa('0x3b')){if(!queues[_0x319ebd['uniqueid']][_0x0cfa('0x3b')]){queues[_0x319ebd[_0x0cfa('0x5')]][_0x0cfa('0xa')]='TRANSFER';}}else{queues[_0x319ebd[_0x0cfa('0x5')]][_0x0cfa('0xa')]=_0x0cfa('0x3c')+_0x319ebd[_0x0cfa('0x3a')][_0x0cfa('0x28')]();}utils['info'](util[_0x0cfa('0x4')](_0x0cfa('0x3d'),_0x319ebd['uniqueid'],queues[_0x319ebd[_0x0cfa('0x5')]][_0x0cfa('0x1d')],_0x319ebd['membername'],queues[_0x319ebd[_0x0cfa('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x319ebd[_0x0cfa('0x5')]]);}}}catch(_0x3ff4dd){utils[_0x0cfa('0x16')](util[_0x0cfa('0x4')](_0x0cfa('0x3e'),_0x319ebd[_0x0cfa('0x5')]),_0x3ff4dd);}};exports[_0x0cfa('0x3f')]=function(_0x5718b1){try{if(!_[_0x0cfa('0x22')](queues[_0x5718b1[_0x0cfa('0x40')]])){utils['debug'](util['format'](_0x0cfa('0x41'),_0x5718b1[_0x0cfa('0x5')]),_0x5718b1);queues[_0x5718b1['transfereeuniqueid']][_0x0cfa('0x3b')]=!![];queues[_0x5718b1[_0x0cfa('0x40')]]['transfertype']=_0x0cfa('0x42');queues[_0x5718b1[_0x0cfa('0x40')]][_0x0cfa('0x43')]=_0x5718b1[_0x0cfa('0x44')];queues[_0x5718b1[_0x0cfa('0x40')]][_0x0cfa('0x45')]=_0x5718b1[_0x0cfa('0x40')];queues[_0x5718b1[_0x0cfa('0x40')]][_0x0cfa('0xa')]='BLINDTRANSFER';utils[_0x0cfa('0x3')](util[_0x0cfa('0x4')](_0x0cfa('0x46'),_0x5718b1[_0x0cfa('0x5')],queues[_0x5718b1[_0x0cfa('0x40')]][_0x0cfa('0x1d')],_0x5718b1[_0x0cfa('0x40')],_0x5718b1[_0x0cfa('0x44')]));}}catch(_0x2dd44f){utils[_0x0cfa('0x16')](util[_0x0cfa('0x4')](_0x0cfa('0x41'),_0x5718b1[_0x0cfa('0x5')]),_0x2dd44f);}};exports[_0x0cfa('0x47')]=function(_0x1e4b75){try{utils['debug'](util[_0x0cfa('0x4')](_0x0cfa('0x48'),_0x1e4b75['origtransfereruniqueid']),_0x1e4b75);if(_0x1e4b75[_0x0cfa('0x49')]==_0x1e4b75[_0x0cfa('0x4a')]){if(!_['isNil'](queues[_0x1e4b75[_0x0cfa('0x4b')]])){utils[_0x0cfa('0x3')](util[_0x0cfa('0x4')](_0x0cfa('0x4c'),_0x1e4b75[_0x0cfa('0x49')],queues[_0x1e4b75[_0x0cfa('0x4b')]][_0x0cfa('0x1d')],_0x1e4b75[_0x0cfa('0x4d')]));queues[_0x1e4b75[_0x0cfa('0x4b')]][_0x0cfa('0x3b')]=!![];queues[_0x1e4b75[_0x0cfa('0x4b')]][_0x0cfa('0x4e')]='ATTENDED';queues[_0x1e4b75[_0x0cfa('0x4b')]]['transferexten']=_0x1e4b75[_0x0cfa('0x4d')];queues[_0x1e4b75[_0x0cfa('0x4b')]]['transferuniqueid']=_0x1e4b75[_0x0cfa('0x49')];queues[_0x1e4b75[_0x0cfa('0x4b')]][_0x0cfa('0xa')]=_0x0cfa('0x4f');}if(!_['isNil'](queues[_0x1e4b75[_0x0cfa('0x4a')]])){if(_0x1e4b75[_0x0cfa('0x50')]&&queues[_0x1e4b75['transfereelinkedid']]){queues[_0x1e4b75['transfereelinkedid']]['queuecallerenterreason']=0x1;queues[_0x1e4b75[_0x0cfa('0x40')]]=_[_0x0cfa('0x51')](queues[_0x1e4b75[_0x0cfa('0x50')]]);queues[_0x1e4b75[_0x0cfa('0x40')]][_0x0cfa('0x10')]=_0x1e4b75[_0x0cfa('0x52')];queues[_0x1e4b75[_0x0cfa('0x40')]][_0x0cfa('0x1e')]=0x2;queues[_0x1e4b75[_0x0cfa('0x40')]][_0x0cfa('0x9')]=queues[_0x1e4b75[_0x0cfa('0x4b')]][_0x0cfa('0x9')];queues[_0x1e4b75['transfereeuniqueid']][_0x0cfa('0x53')]=queues[_0x1e4b75[_0x0cfa('0x4b')]][_0x0cfa('0x53')];queues[_0x1e4b75[_0x0cfa('0x40')]][_0x0cfa('0x33')]=utils[_0x0cfa('0x15')]();queues[_0x1e4b75[_0x0cfa('0x40')]][_0x0cfa('0x18')]=utils[_0x0cfa('0x15')]();queues[_0x1e4b75['transfereeuniqueid']][_0x0cfa('0x54')]=0x0;queues[_0x1e4b75[_0x0cfa('0x40')]]['mohtime']=0x0;utils[_0x0cfa('0x3')](util[_0x0cfa('0x4')](_0x0cfa('0x55'),_0x1e4b75['origtransfereruniqueid'],queues[_0x1e4b75['transfereeuniqueid']]['name'],queues[_0x1e4b75[_0x0cfa('0x40')]][_0x0cfa('0x9')],queues[_0x1e4b75[_0x0cfa('0x40')]][_0x0cfa('0x53')]));}else{utils[_0x0cfa('0x3')](util[_0x0cfa('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x1e4b75['origtransfereruniqueid'],queues[_0x1e4b75['origtransfererlinkedid']][_0x0cfa('0x1d')],_0x1e4b75[_0x0cfa('0x4b')]));queues[_0x1e4b75[_0x0cfa('0x4a')]][_0x0cfa('0x10')]=_0x1e4b75[_0x0cfa('0x4b')];}}}else if(_0x1e4b75['secondtransfereruniqueid']==_0x1e4b75['secondtransfererlinkedid']){if(!_[_0x0cfa('0x22')](queues[_0x1e4b75[_0x0cfa('0x4a')]])){utils[_0x0cfa('0x3')](util[_0x0cfa('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x1e4b75[_0x0cfa('0x49')],queues[_0x1e4b75[_0x0cfa('0x4a')]][_0x0cfa('0x1d')],_0x1e4b75[_0x0cfa('0x56')],_0x1e4b75[_0x0cfa('0x57')]));queues[_0x1e4b75['origtransfererlinkedid']]['transfer']=!![];queues[_0x1e4b75[_0x0cfa('0x4a')]][_0x0cfa('0x4e')]=_0x0cfa('0x58');queues[_0x1e4b75[_0x0cfa('0x4a')]][_0x0cfa('0x43')]=_0x1e4b75[_0x0cfa('0x57')];queues[_0x1e4b75[_0x0cfa('0x4a')]][_0x0cfa('0x45')]=_0x1e4b75['secondtransfereruniqueid'];queues[_0x1e4b75[_0x0cfa('0x4a')]]['queuecallerexitreason']=_0x0cfa('0x4f');}if(!_[_0x0cfa('0x22')](queues[_0x1e4b75[_0x0cfa('0x4b')]])){if(_0x1e4b75[_0x0cfa('0x59')]&&queues[_0x1e4b75[_0x0cfa('0x59')]]){queues[_0x1e4b75[_0x0cfa('0x59')]][_0x0cfa('0x1e')]=0x1;queues[_0x1e4b75['transfertargetuniqueid']]=_['clone'](queues[_0x1e4b75['transfertargetlinkedid']]);queues[_0x1e4b75[_0x0cfa('0x52')]][_0x0cfa('0x10')]=_0x1e4b75['transfertargetuniqueid'];queues[_0x1e4b75['transfertargetuniqueid']][_0x0cfa('0x1e')]=0x2;queues[_0x1e4b75['transfertargetuniqueid']][_0x0cfa('0x9')]=queues[_0x1e4b75['origtransfererlinkedid']][_0x0cfa('0x9')];queues[_0x1e4b75[_0x0cfa('0x52')]][_0x0cfa('0x53')]=queues[_0x1e4b75[_0x0cfa('0x4a')]]['calleridname'];queues[_0x1e4b75[_0x0cfa('0x52')]][_0x0cfa('0x33')]=utils[_0x0cfa('0x15')]();queues[_0x1e4b75[_0x0cfa('0x52')]]['queuecallerleaveAt']=utils[_0x0cfa('0x15')]();queues[_0x1e4b75[_0x0cfa('0x52')]][_0x0cfa('0x54')]=0x0;queues[_0x1e4b75[_0x0cfa('0x52')]][_0x0cfa('0x5a')]=0x0;utils['info'](util[_0x0cfa('0x4')](_0x0cfa('0x5b'),_0x1e4b75['origtransfereruniqueid'],queues[_0x1e4b75[_0x0cfa('0x52')]][_0x0cfa('0x1d')],queues[_0x1e4b75[_0x0cfa('0x52')]][_0x0cfa('0x10')],queues[_0x1e4b75[_0x0cfa('0x52')]]['calleridnum'],queues[_0x1e4b75['transfertargetuniqueid']]['calleridname']));}else{utils[_0x0cfa('0x3')](util[_0x0cfa('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x1e4b75[_0x0cfa('0x49')],queues[_0x1e4b75[_0x0cfa('0x4b')]][_0x0cfa('0x1d')],_0x1e4b75[_0x0cfa('0x4a')]));queues[_0x1e4b75[_0x0cfa('0x4b')]][_0x0cfa('0x10')]=_0x1e4b75[_0x0cfa('0x4a')];}}}}catch(_0x572878){utils[_0x0cfa('0x16')](util['format']('[%s][queues][attendedtransfer]',_0x1e4b75[_0x0cfa('0x49')]),_0x572878);}};exports[_0x0cfa('0x5c')]=function(_0x3233a6){try{if(!_['isNil'](queues[_0x3233a6[_0x0cfa('0x5')]])){utils['debug'](util[_0x0cfa('0x4')](_0x0cfa('0x5d'),_0x3233a6[_0x0cfa('0x5')]),_0x3233a6);queues[_0x3233a6[_0x0cfa('0x5')]][_0x0cfa('0x5e')]=utils['now']();utils[_0x0cfa('0x3')](util['format'](_0x0cfa('0x5f'),_0x3233a6[_0x0cfa('0x5')],queues[_0x3233a6[_0x0cfa('0x5')]][_0x0cfa('0x1d')],queues[_0x3233a6[_0x0cfa('0x5')]][_0x0cfa('0x5e')]));}}catch(_0x1c07df){utils[_0x0cfa('0x16')](util[_0x0cfa('0x4')](_0x0cfa('0x5d'),_0x3233a6['uniqueid']),_0x1c07df);}};exports['musiconholdstop']=function(_0x17426d){try{if(!_[_0x0cfa('0x22')](queues[_0x17426d['uniqueid']])){if(!_[_0x0cfa('0x22')](queues[_0x17426d[_0x0cfa('0x5')]]['musiconholdstartAt'])){utils[_0x0cfa('0x12')](util['format'](_0x0cfa('0x60'),_0x17426d['uniqueid']),_0x17426d);queues[_0x17426d[_0x0cfa('0x5')]][_0x0cfa('0x5a')]+=utils['diffTime'](utils[_0x0cfa('0x15')](),queues[_0x17426d[_0x0cfa('0x5')]][_0x0cfa('0x5e')]);utils['info'](util['format'](_0x0cfa('0x61'),_0x17426d[_0x0cfa('0x5')],queues[_0x17426d[_0x0cfa('0x5')]]['name'],queues[_0x17426d[_0x0cfa('0x5')]]['mohtime']));delete queues[_0x17426d[_0x0cfa('0x5')]][_0x0cfa('0x5e')];}}}catch(_0x2031e0){utils['error'](util['format']('[%s][queues][musiconholdstop]',_0x17426d[_0x0cfa('0x5')]),_0x2031e0);}}; \ No newline at end of file +var _0x98b8=['assigned','accountcode','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','BLIND','extension','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','transferexten','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridname','queuecallerjoinAt','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','musiconholdstartAt','[%s][queues][musiconholdstop]','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','calleridnum','queuecallerexitreason','queue','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','error','hangup','isNil','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','now','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleave','queuecallerleaveAt','holdtime','diffTime','count','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode'];(function(_0x27bd2c,_0x24bd98){var _0x3784ea=function(_0x4ca802){while(--_0x4ca802){_0x27bd2c['push'](_0x27bd2c['shift']());}};_0x3784ea(++_0x24bd98);}(_0x98b8,0x162));var _0x898b=function(_0x22ba2d,_0x3f59ea){_0x22ba2d=_0x22ba2d-0x0;var _0x49366c=_0x98b8[_0x22ba2d];return _0x49366c;};'use strict';var _=require(_0x898b('0x0'));var util=require(_0x898b('0x1'));var utils=require(_0x898b('0x2'));var queues={};function writeDB(_0x29ddcb){utils[_0x898b('0x3')](util[_0x898b('0x4')](_0x898b('0x5'),_0x29ddcb[_0x898b('0x6')],_0x29ddcb[_0x898b('0x7')],_0x29ddcb['queue'],_0x29ddcb[_0x898b('0x8')],_0x29ddcb[_0x898b('0x9')],_0x29ddcb['accountcode'],_0x29ddcb[_0x898b('0xa')]));if(_0x29ddcb[_0x898b('0xb')]){utils['getVoiceQueueByName'](_0x29ddcb['queue'])[_0x898b('0xc')](function(_0x3964bd){if(_0x3964bd){_0x29ddcb[_0x898b('0xd')]=_0x3964bd[_0x898b('0xd')];}utils[_0x898b('0xe')]('CreateVoiceQueueReport',_0x29ddcb);});}else{utils[_0x898b('0xe')](_0x898b('0xf'),_0x29ddcb);}if(_0x29ddcb[_0x898b('0x10')]){delete queues[_0x29ddcb[_0x898b('0x10')]];}else{delete queues[_0x29ddcb[_0x898b('0x6')]];}}exports[_0x898b('0x11')]=function(_0x3163a2){try{utils[_0x898b('0x12')](util['format'](_0x898b('0x13'),_0x3163a2[_0x898b('0x6')]),_0x3163a2);utils[_0x898b('0x3')](util['format'](_0x898b('0x14'),_0x3163a2['uniqueid'],_0x3163a2[_0x898b('0xb')],_0x3163a2[_0x898b('0x15')]));queues[_0x3163a2['uniqueid']]=_[_0x898b('0x16')](_0x3163a2,{'originalposition':_0x3163a2[_0x898b('0x15')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x565b94){utils[_0x898b('0x17')](util[_0x898b('0x4')](_0x898b('0x13'),_0x3163a2['uniqueid']),_0x565b94);}};exports[_0x898b('0x18')]=function(_0x44c2af){try{if(!_[_0x898b('0x19')](queues[_0x44c2af[_0x898b('0x6')]])){utils[_0x898b('0x12')](util['format']('[%s][queues][hangup]',_0x44c2af['uniqueid']),_0x44c2af);if(queues[_0x44c2af['uniqueid']]['queuecallerleaveAt']){if(!queues[_0x44c2af[_0x898b('0x6')]][_0x898b('0x1a')]&&!queues[_0x44c2af[_0x898b('0x6')]][_0x898b('0x1b')]){queues[_0x44c2af[_0x898b('0x6')]][_0x898b('0x1c')]=!![];queues[_0x44c2af[_0x898b('0x6')]][_0x898b('0x1d')]=utils[_0x898b('0x1e')]();queues[_0x44c2af[_0x898b('0x6')]]['queuecallerexitreason']=_0x898b('0x1f');}utils[_0x898b('0x3')](util[_0x898b('0x4')](_0x898b('0x20'),_0x44c2af['uniqueid'],queues[_0x44c2af[_0x898b('0x6')]][_0x898b('0x21')],queues[_0x44c2af[_0x898b('0x6')]][_0x898b('0xa')]));writeDB(queues[_0x44c2af[_0x898b('0x6')]]);}else if(queues[_0x44c2af[_0x898b('0x6')]][_0x898b('0x10')]){utils[_0x898b('0x3')](util['format'](_0x898b('0x22'),_0x44c2af['uniqueid'],queues[_0x44c2af[_0x898b('0x6')]][_0x898b('0x21')],queues[_0x44c2af[_0x898b('0x6')]][_0x898b('0x10')]));queues[queues[_0x44c2af['uniqueid']][_0x898b('0x10')]]=queues[_0x44c2af[_0x898b('0x6')]];queues[queues[_0x44c2af[_0x898b('0x6')]][_0x898b('0x10')]][_0x898b('0x23')]=0x2;delete queues[_0x44c2af[_0x898b('0x6')]];}}}catch(_0x3647ca){utils[_0x898b('0x17')](util[_0x898b('0x4')]('[%s][queues][hangup]',_0x44c2af[_0x898b('0x6')]),_0x3647ca);}};exports[_0x898b('0x24')]=function(_0x22aca2){try{utils[_0x898b('0x12')](util[_0x898b('0x4')](_0x898b('0x25'),_0x22aca2[_0x898b('0x6')]),_0x22aca2);if(!_['isNil'](_0x22aca2[_0x898b('0x26')]['queuestatus'])&&_0x22aca2[_0x898b('0x27')][_0x898b('0x28')]()!==_0x898b('0x29')){if(!_[_0x898b('0x19')](queues[_0x22aca2[_0x898b('0x6')]])){queues[_0x22aca2[_0x898b('0x6')]]['queuecallerabandon']=![];queues[_0x22aca2[_0x898b('0x6')]][_0x898b('0x2a')]=null;queues[_0x22aca2[_0x898b('0x6')]][_0x898b('0x1b')]=!![];queues[_0x22aca2[_0x898b('0x6')]][_0x898b('0x2b')]=utils[_0x898b('0x1e')]();queues[_0x22aca2['uniqueid']][_0x898b('0xa')]=_0x22aca2[_0x898b('0x27')][_0x898b('0x28')]();utils[_0x898b('0x3')](util[_0x898b('0x4')](_0x898b('0x2c'),_0x22aca2[_0x898b('0x6')],queues[_0x22aca2[_0x898b('0x6')]][_0x898b('0x21')],_0x22aca2[_0x898b('0x27')],queues[_0x22aca2['uniqueid']][_0x898b('0xa')]));writeDB(queues[_0x22aca2['uniqueid']]);}}else if(!_[_0x898b('0x19')](_0x22aca2['variable'][_0x898b('0x2d')])){if(!_[_0x898b('0x19')](queues[_0x22aca2[_0x898b('0x6')]])&&!queues[_0x22aca2[_0x898b('0x6')]][_0x898b('0x1a')]){queues[_0x22aca2['uniqueid']][_0x898b('0x1a')]=![];queues[_0x22aca2['uniqueid']]['queuecallerabandonAt']=null;queues[_0x22aca2['uniqueid']]['queuecallerexit']=!![];queues[_0x22aca2[_0x898b('0x6')]][_0x898b('0x2b')]=utils[_0x898b('0x1e')]();queues[_0x22aca2[_0x898b('0x6')]][_0x898b('0xa')]=_0x898b('0x2e');utils[_0x898b('0x3')](util[_0x898b('0x4')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x22aca2[_0x898b('0x6')],queues[_0x22aca2[_0x898b('0x6')]][_0x898b('0x21')],_0x22aca2['value'],queues[_0x22aca2[_0x898b('0x6')]][_0x898b('0xa')]));}}}catch(_0x5cdbf1){utils[_0x898b('0x17')](util[_0x898b('0x4')](_0x898b('0x25'),_0x22aca2[_0x898b('0x6')]),_0x5cdbf1);}};exports['queuecallerabandon']=function(_0x2b0ee4){try{if(!_[_0x898b('0x19')](queues[_0x2b0ee4[_0x898b('0x6')]])){utils['debug'](util[_0x898b('0x4')](_0x898b('0x2f'),_0x2b0ee4[_0x898b('0x6')]),_0x2b0ee4);queues[_0x2b0ee4[_0x898b('0x6')]][_0x898b('0x1b')]=![];queues[_0x2b0ee4['uniqueid']][_0x898b('0x2b')]=null;queues[_0x2b0ee4[_0x898b('0x6')]][_0x898b('0x1a')]=!![];queues[_0x2b0ee4[_0x898b('0x6')]][_0x898b('0x2a')]=utils[_0x898b('0x1e')]();queues[_0x2b0ee4[_0x898b('0x6')]]['queuecallerexitreason']='ABANDONED';utils[_0x898b('0x3')](util[_0x898b('0x4')](_0x898b('0x30'),_0x2b0ee4['uniqueid'],queues[_0x2b0ee4['uniqueid']][_0x898b('0x21')],queues[_0x2b0ee4[_0x898b('0x6')]]['queuecallerexitreason']));}}catch(_0x1ef061){utils[_0x898b('0x17')](util['format'](_0x898b('0x2f'),_0x2b0ee4[_0x898b('0x6')]),_0x1ef061);}};exports['queuecallerleave']=function(_0x1cd799){try{if(!_[_0x898b('0x19')](queues[_0x1cd799[_0x898b('0x6')]])){utils[_0x898b('0x12')](util[_0x898b('0x4')](_0x898b('0x31'),_0x1cd799[_0x898b('0x6')]),_0x1cd799);utils[_0x898b('0x3')](util[_0x898b('0x4')](_0x898b('0x32'),_0x1cd799['uniqueid'],queues[_0x1cd799[_0x898b('0x6')]][_0x898b('0x21')],_0x1cd799[_0x898b('0x33')],_0x1cd799[_0x898b('0x34')]));queues[_0x1cd799[_0x898b('0x6')]][_0x898b('0x35')]=!![];queues[_0x1cd799[_0x898b('0x6')]][_0x898b('0x36')]=utils[_0x898b('0x1e')]();queues[_0x1cd799[_0x898b('0x6')]][_0x898b('0x37')]=utils[_0x898b('0x38')](queues[_0x1cd799['uniqueid']]['queuecallerleaveAt'],queues[_0x1cd799[_0x898b('0x6')]]['queuecallerjoinAt']);queues[_0x1cd799[_0x898b('0x6')]]['position']=_0x1cd799[_0x898b('0x15')];queues[_0x1cd799[_0x898b('0x6')]][_0x898b('0x39')]=_0x1cd799[_0x898b('0x39')];queues[_0x1cd799['uniqueid']][_0x898b('0x33')]=_0x1cd799['connectedlinenum'];queues[_0x1cd799[_0x898b('0x6')]][_0x898b('0x34')]=_0x1cd799[_0x898b('0x34')];}}catch(_0x4ef7d3){utils[_0x898b('0x17')](util[_0x898b('0x4')](_0x898b('0x31'),_0x1cd799[_0x898b('0x6')]),_0x4ef7d3);}};exports[_0x898b('0x3a')]=function(_0x222c28){try{if(!_[_0x898b('0x19')](queues[_0x222c28[_0x898b('0x6')]])){utils[_0x898b('0x12')](util['format'](_0x898b('0x3b'),_0x222c28[_0x898b('0x6')]),_0x222c28);utils[_0x898b('0x3')](util[_0x898b('0x4')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x222c28[_0x898b('0x6')],queues[_0x222c28[_0x898b('0x6')]][_0x898b('0x21')],_0x222c28[_0x898b('0x3c')],_0x222c28[_0x898b('0x3d')]));queues[_0x222c28[_0x898b('0x6')]][_0x898b('0x1a')]=![];queues[_0x222c28[_0x898b('0x6')]][_0x898b('0x1a')]=![];queues[_0x222c28[_0x898b('0x6')]][_0x898b('0x2a')]=null;queues[_0x222c28[_0x898b('0x6')]]['queuecallerexit']=![];queues[_0x222c28[_0x898b('0x6')]]['queuecallerexitreason']=null;queues[_0x222c28[_0x898b('0x6')]][_0x898b('0x2b')]=null;queues[_0x222c28[_0x898b('0x6')]][_0x898b('0x3e')]=!![];queues[_0x222c28[_0x898b('0x6')]][_0x898b('0x3f')]=_0x222c28[_0x898b('0x3d')];queues[_0x222c28[_0x898b('0x6')]][_0x898b('0x8')]=_0x222c28[_0x898b('0x3c')];}}catch(_0x89375e){utils['error'](util[_0x898b('0x4')](_0x898b('0x3b'),_0x222c28[_0x898b('0x6')]),_0x89375e);}};exports[_0x898b('0x40')]=function(_0x1bcfd4){try{if(!_[_0x898b('0x19')](queues[_0x1bcfd4['uniqueid']])){if(queues[_0x1bcfd4['uniqueid']]['queuecallerleaveAt']){utils[_0x898b('0x12')](util['format'](_0x898b('0x41'),_0x1bcfd4[_0x898b('0x6')]),_0x1bcfd4);queues[_0x1bcfd4[_0x898b('0x6')]][_0x898b('0x1a')]=![];queues[_0x1bcfd4[_0x898b('0x6')]]['queuecallerabandon']=![];queues[_0x1bcfd4[_0x898b('0x6')]][_0x898b('0x2a')]=null;queues[_0x1bcfd4[_0x898b('0x6')]]['queuecallerexit']=![];queues[_0x1bcfd4[_0x898b('0x6')]][_0x898b('0x2b')]=null;queues[_0x1bcfd4[_0x898b('0x6')]][_0x898b('0x3e')]=!![];queues[_0x1bcfd4['uniqueid']]['lastAssignedTo']=_0x1bcfd4['membername'];queues[_0x1bcfd4[_0x898b('0x6')]][_0x898b('0x1c')]=!![];queues[_0x1bcfd4[_0x898b('0x6')]][_0x898b('0x1d')]=utils[_0x898b('0x1e')]();if(_0x1bcfd4[_0x898b('0x42')]==_0x898b('0x43')){if(!queues[_0x1bcfd4[_0x898b('0x6')]][_0x898b('0x43')]){queues[_0x1bcfd4[_0x898b('0x6')]][_0x898b('0xa')]=_0x898b('0x44');}}else{queues[_0x1bcfd4[_0x898b('0x6')]][_0x898b('0xa')]='COMPLETEDBY'+_0x1bcfd4['reason']['toUpperCase']();}utils[_0x898b('0x3')](util[_0x898b('0x4')](_0x898b('0x45'),_0x1bcfd4['uniqueid'],queues[_0x1bcfd4[_0x898b('0x6')]]['name'],_0x1bcfd4[_0x898b('0x3c')],queues[_0x1bcfd4[_0x898b('0x6')]][_0x898b('0xa')]));writeDB(queues[_0x1bcfd4['uniqueid']]);}}}catch(_0x1c079e){utils[_0x898b('0x17')](util['format']('[%s][queues][agentcomplete]',_0x1bcfd4[_0x898b('0x6')]),_0x1c079e);}};exports[_0x898b('0x46')]=function(_0x5374ec){try{if(!_[_0x898b('0x19')](queues[_0x5374ec[_0x898b('0x47')]])){utils['debug'](util[_0x898b('0x4')]('[%s][queues][blindtransfer]',_0x5374ec[_0x898b('0x6')]),_0x5374ec);queues[_0x5374ec['transfereeuniqueid']][_0x898b('0x43')]=!![];queues[_0x5374ec['transfereeuniqueid']][_0x898b('0x48')]=_0x898b('0x49');queues[_0x5374ec[_0x898b('0x47')]]['transferexten']=_0x5374ec[_0x898b('0x4a')];queues[_0x5374ec[_0x898b('0x47')]]['transferuniqueid']=_0x5374ec[_0x898b('0x47')];queues[_0x5374ec[_0x898b('0x47')]]['queuecallerexitreason']=_0x898b('0x4b');utils[_0x898b('0x3')](util['format'](_0x898b('0x4c'),_0x5374ec[_0x898b('0x6')],queues[_0x5374ec[_0x898b('0x47')]][_0x898b('0x21')],_0x5374ec[_0x898b('0x47')],_0x5374ec[_0x898b('0x4a')]));}}catch(_0x483784){utils[_0x898b('0x17')](util[_0x898b('0x4')](_0x898b('0x4d'),_0x5374ec[_0x898b('0x6')]),_0x483784);}};exports[_0x898b('0x4e')]=function(_0x11b9fd){try{utils[_0x898b('0x12')](util[_0x898b('0x4')](_0x898b('0x4f'),_0x11b9fd[_0x898b('0x50')]),_0x11b9fd);if(_0x11b9fd['origtransfereruniqueid']==_0x11b9fd[_0x898b('0x51')]){if(!_['isNil'](queues[_0x11b9fd[_0x898b('0x52')]])){utils['info'](util['format'](_0x898b('0x53'),_0x11b9fd[_0x898b('0x50')],queues[_0x11b9fd['secondtransfererlinkedid']][_0x898b('0x21')],_0x11b9fd[_0x898b('0x54')]));queues[_0x11b9fd['secondtransfererlinkedid']][_0x898b('0x43')]=!![];queues[_0x11b9fd['secondtransfererlinkedid']]['transfertype']=_0x898b('0x55');queues[_0x11b9fd[_0x898b('0x52')]][_0x898b('0x56')]=_0x11b9fd['origtransfererexten'];queues[_0x11b9fd['secondtransfererlinkedid']][_0x898b('0x57')]=_0x11b9fd[_0x898b('0x50')];queues[_0x11b9fd[_0x898b('0x52')]][_0x898b('0xa')]=_0x898b('0x58');}if(!_[_0x898b('0x19')](queues[_0x11b9fd['origtransfererlinkedid']])){if(_0x11b9fd[_0x898b('0x59')]&&queues[_0x11b9fd['transfereelinkedid']]){queues[_0x11b9fd['transfereelinkedid']][_0x898b('0x23')]=0x1;queues[_0x11b9fd[_0x898b('0x47')]]=_['clone'](queues[_0x11b9fd[_0x898b('0x59')]]);queues[_0x11b9fd['transfereeuniqueid']][_0x898b('0x10')]=_0x11b9fd[_0x898b('0x5a')];queues[_0x11b9fd[_0x898b('0x47')]][_0x898b('0x23')]=0x2;queues[_0x11b9fd['transfereeuniqueid']][_0x898b('0x9')]=queues[_0x11b9fd[_0x898b('0x52')]][_0x898b('0x9')];queues[_0x11b9fd[_0x898b('0x47')]][_0x898b('0x5b')]=queues[_0x11b9fd[_0x898b('0x52')]][_0x898b('0x5b')];queues[_0x11b9fd[_0x898b('0x47')]][_0x898b('0x5c')]=utils['now']();queues[_0x11b9fd['transfereeuniqueid']]['queuecallerleaveAt']=utils[_0x898b('0x1e')]();queues[_0x11b9fd[_0x898b('0x47')]]['holdtime']=0x0;queues[_0x11b9fd[_0x898b('0x47')]]['mohtime']=0x0;utils['info'](util[_0x898b('0x4')](_0x898b('0x5d'),_0x11b9fd['origtransfereruniqueid'],queues[_0x11b9fd['transfereeuniqueid']][_0x898b('0x21')],queues[_0x11b9fd[_0x898b('0x47')]][_0x898b('0x9')],queues[_0x11b9fd[_0x898b('0x47')]][_0x898b('0x5b')]));}else{utils[_0x898b('0x3')](util[_0x898b('0x4')](_0x898b('0x5e'),_0x11b9fd[_0x898b('0x50')],queues[_0x11b9fd[_0x898b('0x51')]][_0x898b('0x21')],_0x11b9fd[_0x898b('0x52')]));queues[_0x11b9fd['origtransfererlinkedid']]['transfereduniqueid']=_0x11b9fd['secondtransfererlinkedid'];}}}else if(_0x11b9fd['secondtransfereruniqueid']==_0x11b9fd['secondtransfererlinkedid']){if(!_['isNil'](queues[_0x11b9fd[_0x898b('0x51')]])){utils[_0x898b('0x3')](util[_0x898b('0x4')](_0x898b('0x5f'),_0x11b9fd[_0x898b('0x50')],queues[_0x11b9fd[_0x898b('0x51')]]['name'],_0x11b9fd[_0x898b('0x60')],_0x11b9fd[_0x898b('0x61')]));queues[_0x11b9fd[_0x898b('0x51')]][_0x898b('0x43')]=!![];queues[_0x11b9fd[_0x898b('0x51')]][_0x898b('0x48')]=_0x898b('0x55');queues[_0x11b9fd[_0x898b('0x51')]][_0x898b('0x56')]=_0x11b9fd[_0x898b('0x61')];queues[_0x11b9fd[_0x898b('0x51')]][_0x898b('0x57')]=_0x11b9fd['secondtransfereruniqueid'];queues[_0x11b9fd[_0x898b('0x51')]][_0x898b('0xa')]='ATTENDEDTRANSFER';}if(!_[_0x898b('0x19')](queues[_0x11b9fd['secondtransfererlinkedid']])){if(_0x11b9fd[_0x898b('0x62')]&&queues[_0x11b9fd[_0x898b('0x62')]]){queues[_0x11b9fd['transfertargetlinkedid']]['queuecallerenterreason']=0x1;queues[_0x11b9fd['transfertargetuniqueid']]=_['clone'](queues[_0x11b9fd[_0x898b('0x62')]]);queues[_0x11b9fd[_0x898b('0x5a')]][_0x898b('0x10')]=_0x11b9fd[_0x898b('0x5a')];queues[_0x11b9fd[_0x898b('0x5a')]][_0x898b('0x23')]=0x2;queues[_0x11b9fd[_0x898b('0x5a')]][_0x898b('0x9')]=queues[_0x11b9fd[_0x898b('0x51')]][_0x898b('0x9')];queues[_0x11b9fd[_0x898b('0x5a')]][_0x898b('0x5b')]=queues[_0x11b9fd[_0x898b('0x51')]][_0x898b('0x5b')];queues[_0x11b9fd[_0x898b('0x5a')]][_0x898b('0x5c')]=utils[_0x898b('0x1e')]();queues[_0x11b9fd['transfertargetuniqueid']][_0x898b('0x36')]=utils['now']();queues[_0x11b9fd[_0x898b('0x5a')]][_0x898b('0x37')]=0x0;queues[_0x11b9fd['transfertargetuniqueid']][_0x898b('0x63')]=0x0;utils['info'](util['format'](_0x898b('0x64'),_0x11b9fd['origtransfereruniqueid'],queues[_0x11b9fd[_0x898b('0x5a')]][_0x898b('0x21')],queues[_0x11b9fd['transfertargetuniqueid']]['transfereduniqueid'],queues[_0x11b9fd[_0x898b('0x5a')]][_0x898b('0x9')],queues[_0x11b9fd[_0x898b('0x5a')]][_0x898b('0x5b')]));}else{utils['info'](util['format'](_0x898b('0x5e'),_0x11b9fd[_0x898b('0x50')],queues[_0x11b9fd['secondtransfererlinkedid']]['name'],_0x11b9fd[_0x898b('0x51')]));queues[_0x11b9fd['secondtransfererlinkedid']][_0x898b('0x10')]=_0x11b9fd[_0x898b('0x51')];}}}}catch(_0x17d26e){utils[_0x898b('0x17')](util[_0x898b('0x4')](_0x898b('0x4f'),_0x11b9fd[_0x898b('0x50')]),_0x17d26e);}};exports[_0x898b('0x65')]=function(_0x4e0085){try{if(!_[_0x898b('0x19')](queues[_0x4e0085['uniqueid']])){utils[_0x898b('0x12')](util['format']('[%s][queues][musiconholdstart]',_0x4e0085['uniqueid']),_0x4e0085);queues[_0x4e0085['uniqueid']][_0x898b('0x66')]=utils[_0x898b('0x1e')]();utils[_0x898b('0x3')](util[_0x898b('0x4')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x4e0085['uniqueid'],queues[_0x4e0085[_0x898b('0x6')]]['name'],queues[_0x4e0085[_0x898b('0x6')]][_0x898b('0x66')]));}}catch(_0x255748){utils[_0x898b('0x17')](util[_0x898b('0x4')]('[%s][queues][musiconholdstart]',_0x4e0085[_0x898b('0x6')]),_0x255748);}};exports['musiconholdstop']=function(_0x3a2b87){try{if(!_[_0x898b('0x19')](queues[_0x3a2b87[_0x898b('0x6')]])){if(!_[_0x898b('0x19')](queues[_0x3a2b87[_0x898b('0x6')]][_0x898b('0x66')])){utils[_0x898b('0x12')](util[_0x898b('0x4')](_0x898b('0x67'),_0x3a2b87[_0x898b('0x6')]),_0x3a2b87);queues[_0x3a2b87['uniqueid']][_0x898b('0x63')]+=utils['diffTime'](utils[_0x898b('0x1e')](),queues[_0x3a2b87['uniqueid']][_0x898b('0x66')]);utils[_0x898b('0x3')](util[_0x898b('0x4')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x3a2b87[_0x898b('0x6')],queues[_0x3a2b87[_0x898b('0x6')]]['name'],queues[_0x3a2b87[_0x898b('0x6')]]['mohtime']));delete queues[_0x3a2b87[_0x898b('0x6')]]['musiconholdstartAt'];}}}catch(_0x423336){utils[_0x898b('0x17')](util[_0x898b('0x4')]('[%s][queues][musiconholdstop]',_0x3a2b87[_0x898b('0x6')]),_0x423336);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index b80bbd1..00f934d 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 _0x6aa0=['split','substring','lastIndexOf','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','transfereruniqueid','lodash','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','membername','name','UserId','CreateVoiceRecording','request','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','[%s][recordings][newstate]','isNil','channelstate','transfer','varset','variable','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','value','.wav49','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','outbound','clone','[%s][recordings][hangup]','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','cdr'];(function(_0x292784,_0x250ed4){var _0x54aa0a=function(_0x4caca5){while(--_0x4caca5){_0x292784['push'](_0x292784['shift']());}};_0x54aa0a(++_0x250ed4);}(_0x6aa0,0x175));var _0x06aa=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x6aa0[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0x06aa('0x0'));var util=require('util');var utils=require(_0x06aa('0x1'));var transfers=require(_0x06aa('0x2'));var recordings={};function writeDB(_0x20732c){var _0x10f926;utils[_0x06aa('0x3')](util[_0x06aa('0x4')](_0x06aa('0x5'),_0x20732c[_0x06aa('0x6')]));if(transfers[_0x06aa('0x7')][_0x20732c[_0x06aa('0x6')]]){_0x10f926=_0x20732c['uniqueid'];_0x20732c[_0x06aa('0x6')]=transfers['blinds'][_0x20732c[_0x06aa('0x6')]][_0x06aa('0x8')];}if(_0x20732c[_0x06aa('0x9')]){utils[_0x06aa('0xa')](_0x20732c[_0x06aa('0x9')])['then'](function(_0x20d4cb){if(_0x20d4cb){_0x20732c[_0x06aa('0xb')]=_0x20d4cb[_0x06aa('0xc')];_0x20732c[_0x06aa('0xd')]=_0x20d4cb['id'];}utils['request'](_0x06aa('0xe'),_0x20732c);});}else{utils[_0x06aa('0xf')]('CreateVoiceRecording',_0x20732c);}if(_0x10f926)delete transfers[_0x06aa('0x7')][_0x10f926];}exports[_0x06aa('0x10')]=function(_0xbde789){try{utils[_0x06aa('0x11')](util[_0x06aa('0x4')](_0x06aa('0x12'),_0xbde789['uniqueid']),_0xbde789);if(_0xbde789['uniqueid']==_0xbde789[_0x06aa('0x13')]){utils[_0x06aa('0x3')](util[_0x06aa('0x4')](_0x06aa('0x14'),_0xbde789['uniqueid'],_0xbde789[_0x06aa('0x15')],_0xbde789[_0x06aa('0x16')]));recordings[_0xbde789['uniqueid']]={'uniqueid':_0xbde789[_0x06aa('0x6')],'accountcode':_0xbde789[_0x06aa('0x9')],'exten':_0xbde789['exten'],'context':_0xbde789[_0x06aa('0x15')],'channel':_0xbde789[_0x06aa('0x17')],'monitors':[]};}}catch(_0x384b95){utils[_0x06aa('0x18')](util[_0x06aa('0x4')](_0x06aa('0x12'),_0xbde789[_0x06aa('0x6')]),_0x384b95);}};exports[_0x06aa('0x19')]=function(_0x3bd924){try{utils[_0x06aa('0x11')](util[_0x06aa('0x4')](_0x06aa('0x1a'),_0x3bd924['uniqueid']),_0x3bd924);if(!_[_0x06aa('0x1b')](recordings[_0x3bd924['uniqueid']])&&_0x3bd924[_0x06aa('0x1c')]==0x6){utils[_0x06aa('0x3')](util[_0x06aa('0x4')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x3bd924['uniqueid'],_0x3bd924[_0x06aa('0x15')],_0x3bd924[_0x06aa('0x17')]));}else if(!_['isNil'](recordings[_0x3bd924[_0x06aa('0x13')]])&&_0x3bd924[_0x06aa('0x1c')]==0x6&&_0x3bd924[_0x06aa('0x15')]!=_0x06aa('0x1d')){utils[_0x06aa('0x3')](util[_0x06aa('0x4')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x3bd924[_0x06aa('0x6')],_0x3bd924[_0x06aa('0x13')],_0x3bd924[_0x06aa('0x15')],_0x3bd924[_0x06aa('0x17')]));recordings[_0x3bd924[_0x06aa('0x13')]][_0x06aa('0x9')]=_0x3bd924[_0x06aa('0x9')];}}catch(_0x38ef74){utils[_0x06aa('0x18')](util[_0x06aa('0x4')]('[%s][recordings][newstate]',_0x3bd924[_0x06aa('0x6')]),_0x38ef74);}};exports[_0x06aa('0x1e')]=function(_0x216375){try{if(!_['isNil'](_0x216375[_0x06aa('0x1f')])&&!_[_0x06aa('0x1b')](_0x216375['variable']['mixmonitor_filename'])){utils['debug'](util[_0x06aa('0x4')](_0x06aa('0x20'),_0x216375[_0x06aa('0x6')]),_0x216375);utils[_0x06aa('0x3')](util[_0x06aa('0x4')](_0x06aa('0x21'),_0x216375[_0x06aa('0x6')],_0x216375['variable'],_0x216375['value']));if(_[_0x06aa('0x22')](_0x216375[_0x06aa('0x23')],_0x06aa('0x24'))){_0x216375['value']=_0x216375['value'][_0x06aa('0x25')](_0x06aa('0x24'),_0x06aa('0x26'));}if(recordings[_0x216375[_0x06aa('0x13')]]){var _0x1b4501=_[_0x06aa('0x27')](recordings[_0x216375['linkedid']][_0x06aa('0x28')],{'value':_0x216375['value']});if(_[_0x06aa('0x1b')](_0x1b4501)){recordings[_0x216375[_0x06aa('0x13')]][_0x06aa('0x28')][_0x06aa('0x29')]({'value':_0x216375[_0x06aa('0x23')]});}}}}catch(_0x10faed){utils['error'](util[_0x06aa('0x4')](_0x06aa('0x20'),_0x216375['uniqueid']),_0x10faed);}};exports[_0x06aa('0x2a')]=function(_0xfc8de2){try{if(!_['isNil'](recordings[_0xfc8de2[_0x06aa('0x6')]])){utils['debug'](util['format']('[%s][recordings][hangup]',_0xfc8de2[_0x06aa('0x6')]),_0xfc8de2);utils[_0x06aa('0x3')](util[_0x06aa('0x4')](_0x06aa('0x2b'),_0xfc8de2[_0x06aa('0x6')],_0xfc8de2['calleridnum'],_0xfc8de2[_0x06aa('0x2c')],_0xfc8de2[_0x06aa('0x2d')]));recordings[_0xfc8de2[_0x06aa('0x6')]][_0x06aa('0x2e')]=_0xfc8de2['calleridnum'];recordings[_0xfc8de2[_0x06aa('0x6')]][_0x06aa('0x2c')]=_0xfc8de2['calleridname'];recordings[_0xfc8de2[_0x06aa('0x6')]][_0x06aa('0x2f')]=_0xfc8de2[_0x06aa('0x2f')];recordings[_0xfc8de2[_0x06aa('0x6')]][_0x06aa('0x30')]=_0xfc8de2['connectedlinename'];if(recordings[_0xfc8de2[_0x06aa('0x6')]]['type']==_0x06aa('0x31')&&recordings[_0xfc8de2[_0x06aa('0x6')]]['accountcode']){recordings[_0xfc8de2[_0x06aa('0x6')]][_0x06aa('0x2f')]=recordings[_0xfc8de2[_0x06aa('0x6')]][_0x06aa('0x9')];recordings[_0xfc8de2[_0x06aa('0x6')]][_0x06aa('0x30')]='';}recordings[_0xfc8de2['uniqueid']][_0x06aa('0x28')]['forEach'](function(_0x22a0f7){var _0xa04b77=_[_0x06aa('0x32')](recordings[_0xfc8de2[_0x06aa('0x6')]]);_0xa04b77[_0x06aa('0x23')]=_0x22a0f7[_0x06aa('0x23')];writeDB(_0xa04b77);});delete recordings[_0xfc8de2[_0x06aa('0x6')]];}}catch(_0x151fe9){utils['error'](util[_0x06aa('0x4')](_0x06aa('0x33'),_0xfc8de2[_0x06aa('0x6')]),_0x151fe9);}};exports[_0x06aa('0x34')]=function(_0x391979){try{if(!_[_0x06aa('0x1b')](recordings[_0x391979[_0x06aa('0x6')]])){utils[_0x06aa('0x11')](util[_0x06aa('0x4')](_0x06aa('0x35'),_0x391979[_0x06aa('0x6')]),_0x391979);utils['info'](util[_0x06aa('0x4')](_0x06aa('0x36'),_0x391979['uniqueid'],_0x391979[_0x06aa('0x37')],_0x391979[_0x06aa('0x38')]));if(_0x391979['application'][_0x06aa('0x39')]()=='set'&&_['startsWith'](_0x391979[_0x06aa('0x38')][_0x06aa('0x39')](),_0x06aa('0x3a'))){var _0x4d9ed5=_0x391979[_0x06aa('0x38')][_0x06aa('0x3b')]('=');var _0x1d427a=_0x4d9ed5[0x0][_0x06aa('0x3c')](_0x4d9ed5[0x0][_0x06aa('0x3d')]('(')+0x1,_0x4d9ed5[0x0][_0x06aa('0x3d')](')'));var _0xab2b3e=_0x4d9ed5[0x1];recordings[_0x391979[_0x06aa('0x6')]][_0x1d427a]=_0xab2b3e;}}}catch(_0x247cfa){utils[_0x06aa('0x18')](util[_0x06aa('0x4')](_0x06aa('0x35'),_0x391979['uniqueid']),_0x247cfa);}};exports['queuecallerjoin']=function(_0x4df630){try{if(!_[_0x06aa('0x1b')](recordings[_0x4df630[_0x06aa('0x6')]])){utils['debug'](util[_0x06aa('0x4')](_0x06aa('0x3e'),_0x4df630[_0x06aa('0x6')]),_0x4df630);utils[_0x06aa('0x3')](util[_0x06aa('0x4')](_0x06aa('0x3f'),_0x4df630['uniqueid'],_0x4df630[_0x06aa('0x40')]));recordings[_0x4df630[_0x06aa('0x6')]]['queue']=_0x4df630['queue'];}}catch(_0x3f8680){utils[_0x06aa('0x18')](util[_0x06aa('0x4')](_0x06aa('0x3e'),_0x4df630['uniqueid']),_0x3f8680);}};exports[_0x06aa('0x41')]=function(_0x405d49){try{utils[_0x06aa('0x11')](util[_0x06aa('0x4')](_0x06aa('0x42'),_0x405d49[_0x06aa('0x6')]),_0x405d49);utils['info'](util[_0x06aa('0x4')](_0x06aa('0x43'),_0x405d49[_0x06aa('0x6')],_0x405d49[_0x06aa('0x44')],_0x405d49['transferercalleridname'],_0x405d49[_0x06aa('0x45')],_0x405d49[_0x06aa('0x46')]));if(recordings[_0x405d49['transfereruniqueid']]&&transfers[_0x06aa('0x7')][_0x405d49[_0x06aa('0x47')]]){transfers[_0x06aa('0x7')][_0x405d49[_0x06aa('0x47')]]['recording']=!![];}}catch(_0x1f2c8e){utils[_0x06aa('0x18')](util[_0x06aa('0x4')](_0x06aa('0x42'),_0x405d49[_0x06aa('0x6')]),_0x1f2c8e);}}; \ No newline at end of file +var _0xa241=['forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','appdata','cdr','split','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','blindtransfer','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','[%s][recordings][blindtransfer]','lodash','util','./utils','./transfers.controller','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','UserId','CreateVoiceRecording','request','newchannel','debug','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','[%s][recordings][newchannel]','newstate','[%s][recordings][newstate]','isNil','channelstate','transfer','linkedid','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','replace','.WAV','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','outbound'];(function(_0x5a19d5,_0x5e9f76){var _0x15b484=function(_0x5d471d){while(--_0x5d471d){_0x5a19d5['push'](_0x5a19d5['shift']());}};_0x15b484(++_0x5e9f76);}(_0xa241,0x1ed));var _0x1a24=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa241[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x1a24('0x0'));var util=require(_0x1a24('0x1'));var utils=require(_0x1a24('0x2'));var transfers=require(_0x1a24('0x3'));var recordings={};function writeDB(_0x4ad5c5){var _0x45caff;utils['info'](util[_0x1a24('0x4')](_0x1a24('0x5'),_0x4ad5c5[_0x1a24('0x6')]));if(transfers[_0x1a24('0x7')][_0x4ad5c5[_0x1a24('0x6')]]){_0x45caff=_0x4ad5c5[_0x1a24('0x6')];_0x4ad5c5[_0x1a24('0x6')]=transfers['blinds'][_0x4ad5c5['uniqueid']][_0x1a24('0x8')];}if(_0x4ad5c5[_0x1a24('0x9')]){utils[_0x1a24('0xa')](_0x4ad5c5[_0x1a24('0x9')])[_0x1a24('0xb')](function(_0x3e7054){if(_0x3e7054){_0x4ad5c5[_0x1a24('0xc')]=_0x3e7054[_0x1a24('0xd')];_0x4ad5c5[_0x1a24('0xe')]=_0x3e7054['id'];}utils['request'](_0x1a24('0xf'),_0x4ad5c5);});}else{utils[_0x1a24('0x10')](_0x1a24('0xf'),_0x4ad5c5);}if(_0x45caff)delete transfers[_0x1a24('0x7')][_0x45caff];}exports[_0x1a24('0x11')]=function(_0x141e7f){try{utils[_0x1a24('0x12')](util[_0x1a24('0x4')]('[%s][recordings][newchannel]',_0x141e7f['uniqueid']),_0x141e7f);if(_0x141e7f[_0x1a24('0x6')]==_0x141e7f['linkedid']){utils[_0x1a24('0x13')](util[_0x1a24('0x4')](_0x1a24('0x14'),_0x141e7f[_0x1a24('0x6')],_0x141e7f[_0x1a24('0x15')],_0x141e7f[_0x1a24('0x16')]));recordings[_0x141e7f['uniqueid']]={'uniqueid':_0x141e7f[_0x1a24('0x6')],'accountcode':_0x141e7f[_0x1a24('0x9')],'exten':_0x141e7f[_0x1a24('0x16')],'context':_0x141e7f['context'],'channel':_0x141e7f[_0x1a24('0x17')],'monitors':[]};}}catch(_0x4ef589){utils[_0x1a24('0x18')](util[_0x1a24('0x4')](_0x1a24('0x19'),_0x141e7f[_0x1a24('0x6')]),_0x4ef589);}};exports[_0x1a24('0x1a')]=function(_0x4f63b9){try{utils[_0x1a24('0x12')](util[_0x1a24('0x4')](_0x1a24('0x1b'),_0x4f63b9[_0x1a24('0x6')]),_0x4f63b9);if(!_[_0x1a24('0x1c')](recordings[_0x4f63b9['uniqueid']])&&_0x4f63b9[_0x1a24('0x1d')]==0x6){utils['info'](util[_0x1a24('0x4')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x4f63b9['uniqueid'],_0x4f63b9[_0x1a24('0x15')],_0x4f63b9[_0x1a24('0x17')]));}else if(!_[_0x1a24('0x1c')](recordings[_0x4f63b9['linkedid']])&&_0x4f63b9[_0x1a24('0x1d')]==0x6&&_0x4f63b9[_0x1a24('0x15')]!=_0x1a24('0x1e')){utils[_0x1a24('0x13')](util[_0x1a24('0x4')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x4f63b9['uniqueid'],_0x4f63b9[_0x1a24('0x1f')],_0x4f63b9['context'],_0x4f63b9[_0x1a24('0x17')]));recordings[_0x4f63b9[_0x1a24('0x1f')]][_0x1a24('0x9')]=_0x4f63b9['accountcode'];}}catch(_0xc4fd4c){utils['error'](util[_0x1a24('0x4')](_0x1a24('0x1b'),_0x4f63b9['uniqueid']),_0xc4fd4c);}};exports[_0x1a24('0x20')]=function(_0x4bc38a){try{if(!_[_0x1a24('0x1c')](_0x4bc38a['variable'])&&!_['isNil'](_0x4bc38a[_0x1a24('0x21')][_0x1a24('0x22')])){utils[_0x1a24('0x12')](util[_0x1a24('0x4')](_0x1a24('0x23'),_0x4bc38a['uniqueid']),_0x4bc38a);utils[_0x1a24('0x13')](util[_0x1a24('0x4')](_0x1a24('0x24'),_0x4bc38a[_0x1a24('0x6')],_0x4bc38a[_0x1a24('0x21')],_0x4bc38a[_0x1a24('0x25')]));if(_['endsWith'](_0x4bc38a[_0x1a24('0x25')],_0x1a24('0x26'))){_0x4bc38a['value']=_0x4bc38a['value'][_0x1a24('0x27')]('.wav49',_0x1a24('0x28'));}if(recordings[_0x4bc38a[_0x1a24('0x1f')]]){var _0x56f66c=_['find'](recordings[_0x4bc38a['linkedid']][_0x1a24('0x29')],{'value':_0x4bc38a[_0x1a24('0x25')]});if(_[_0x1a24('0x1c')](_0x56f66c)){recordings[_0x4bc38a[_0x1a24('0x1f')]]['monitors'][_0x1a24('0x2a')]({'value':_0x4bc38a['value']});}}}}catch(_0x221ed4){utils[_0x1a24('0x18')](util['format'](_0x1a24('0x23'),_0x4bc38a[_0x1a24('0x6')]),_0x221ed4);}};exports[_0x1a24('0x2b')]=function(_0x4dd10a){try{if(!_[_0x1a24('0x1c')](recordings[_0x4dd10a[_0x1a24('0x6')]])){utils[_0x1a24('0x12')](util[_0x1a24('0x4')](_0x1a24('0x2c'),_0x4dd10a[_0x1a24('0x6')]),_0x4dd10a);utils[_0x1a24('0x13')](util[_0x1a24('0x4')](_0x1a24('0x2d'),_0x4dd10a['uniqueid'],_0x4dd10a['calleridnum'],_0x4dd10a[_0x1a24('0x2e')],_0x4dd10a[_0x1a24('0x2f')]));recordings[_0x4dd10a['uniqueid']][_0x1a24('0x30')]=_0x4dd10a[_0x1a24('0x30')];recordings[_0x4dd10a[_0x1a24('0x6')]][_0x1a24('0x2e')]=_0x4dd10a['calleridname'];recordings[_0x4dd10a[_0x1a24('0x6')]]['connectedlinenum']=_0x4dd10a[_0x1a24('0x31')];recordings[_0x4dd10a[_0x1a24('0x6')]][_0x1a24('0x32')]=_0x4dd10a[_0x1a24('0x32')];if(recordings[_0x4dd10a[_0x1a24('0x6')]][_0x1a24('0x33')]==_0x1a24('0x34')&&recordings[_0x4dd10a[_0x1a24('0x6')]][_0x1a24('0x9')]){recordings[_0x4dd10a[_0x1a24('0x6')]][_0x1a24('0x31')]=recordings[_0x4dd10a[_0x1a24('0x6')]][_0x1a24('0x9')];recordings[_0x4dd10a[_0x1a24('0x6')]][_0x1a24('0x32')]='';}recordings[_0x4dd10a[_0x1a24('0x6')]]['monitors'][_0x1a24('0x35')](function(_0x1f7910){var _0x1a0454=_[_0x1a24('0x36')](recordings[_0x4dd10a[_0x1a24('0x6')]]);_0x1a0454[_0x1a24('0x25')]=_0x1f7910[_0x1a24('0x25')];writeDB(_0x1a0454);});delete recordings[_0x4dd10a[_0x1a24('0x6')]];}}catch(_0x3c8cde){utils[_0x1a24('0x18')](util[_0x1a24('0x4')](_0x1a24('0x2c'),_0x4dd10a['uniqueid']),_0x3c8cde);}};exports[_0x1a24('0x37')]=function(_0x4f3dfc){try{if(!_[_0x1a24('0x1c')](recordings[_0x4f3dfc['uniqueid']])){utils[_0x1a24('0x12')](util[_0x1a24('0x4')](_0x1a24('0x38'),_0x4f3dfc['uniqueid']),_0x4f3dfc);utils[_0x1a24('0x13')](util['format'](_0x1a24('0x39'),_0x4f3dfc['uniqueid'],_0x4f3dfc[_0x1a24('0x3a')],_0x4f3dfc['appdata']));if(_0x4f3dfc[_0x1a24('0x3a')][_0x1a24('0x3b')]()==_0x1a24('0x3c')&&_['startsWith'](_0x4f3dfc[_0x1a24('0x3d')]['toLowerCase'](),_0x1a24('0x3e'))){var _0x35fdef=_0x4f3dfc['appdata'][_0x1a24('0x3f')]('=');var _0x44f10d=_0x35fdef[0x0]['substring'](_0x35fdef[0x0][_0x1a24('0x40')]('(')+0x1,_0x35fdef[0x0][_0x1a24('0x40')](')'));var _0x428f20=_0x35fdef[0x1];recordings[_0x4f3dfc[_0x1a24('0x6')]][_0x44f10d]=_0x428f20;}}}catch(_0x2c42bf){utils[_0x1a24('0x18')](util[_0x1a24('0x4')](_0x1a24('0x38'),_0x4f3dfc[_0x1a24('0x6')]),_0x2c42bf);}};exports[_0x1a24('0x41')]=function(_0x315947){try{if(!_['isNil'](recordings[_0x315947['uniqueid']])){utils[_0x1a24('0x12')](util[_0x1a24('0x4')]('[%s][recordings][queuecallerjoin]',_0x315947[_0x1a24('0x6')]),_0x315947);utils[_0x1a24('0x13')](util['format'](_0x1a24('0x42'),_0x315947[_0x1a24('0x6')],_0x315947[_0x1a24('0x43')]));recordings[_0x315947[_0x1a24('0x6')]]['queue']=_0x315947['queue'];}}catch(_0x5b81fb){utils[_0x1a24('0x18')](util[_0x1a24('0x4')](_0x1a24('0x44'),_0x315947[_0x1a24('0x6')]),_0x5b81fb);}};exports[_0x1a24('0x45')]=function(_0x138722){try{utils[_0x1a24('0x12')](util[_0x1a24('0x4')]('[%s][recordings][blindtransfer]',_0x138722[_0x1a24('0x6')]),_0x138722);utils[_0x1a24('0x13')](util[_0x1a24('0x4')](_0x1a24('0x46'),_0x138722[_0x1a24('0x6')],_0x138722[_0x1a24('0x47')],_0x138722[_0x1a24('0x48')],_0x138722[_0x1a24('0x49')],_0x138722[_0x1a24('0x4a')]));if(recordings[_0x138722[_0x1a24('0x4b')]]&&transfers[_0x1a24('0x7')][_0x138722[_0x1a24('0x4b')]]){transfers[_0x1a24('0x7')][_0x138722[_0x1a24('0x4b')]][_0x1a24('0x4c')]=!![];}}catch(_0x14e41e){utils[_0x1a24('0x18')](util['format'](_0x1a24('0x4d'),_0x138722[_0x1a24('0x6')]),_0x14e41e);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index acbe11c..0e05d80 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 _0xcc7c=['origtransfererlinkedid','origtransfererexten','isNil','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','info','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','blinds','blindtransfer','format','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','blind','transfereruniqueid','error','debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext'];(function(_0x323ed6,_0x10dcc0){var _0x40e80c=function(_0x39a55e){while(--_0x39a55e){_0x323ed6['push'](_0x323ed6['shift']());}};_0x40e80c(++_0x10dcc0);}(_0xcc7c,0x127));var _0xccc7=function(_0x40ae7b,_0x145433){_0x40ae7b=_0x40ae7b-0x0;var _0x1d01ff=_0xcc7c[_0x40ae7b];return _0x1d01ff;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');function writeDB(_0x5caccb){utils[_0xccc7('0x0')](util['format'](_0xccc7('0x1'),_0x5caccb[_0xccc7('0x2')]===_0xccc7('0x3')?_0x5caccb[_0xccc7('0x4')]:_0x5caccb[_0xccc7('0x5')],_0x5caccb[_0xccc7('0x2')]));utils['request']('CreateVoiceTransferReport',_0x5caccb);}exports[_0xccc7('0x6')]={};exports[_0xccc7('0x7')]=function(_0x5c73da){try{utils['debug'](util[_0xccc7('0x8')](_0xccc7('0x9'),_0x5c73da[_0xccc7('0x5')]),_0x5c73da);utils[_0xccc7('0x0')](util['format'](_0xccc7('0xa'),_0x5c73da['uniqueid'],_0x5c73da[_0xccc7('0xb')],_0x5c73da[_0xccc7('0xc')],_0x5c73da[_0xccc7('0xd')],_0x5c73da['transfereecalleridname']));_0x5c73da['type']=_0xccc7('0xe');exports['blinds'][_0x5c73da[_0xccc7('0xf')]]=_0x5c73da;writeDB(_0x5c73da);}catch(_0xdf3411){utils[_0xccc7('0x10')](util['format'](_0xccc7('0x9'),_0x5c73da[_0xccc7('0x5')]),_0xdf3411);}};exports['attendedtransfer']=function(_0x2cb10d){try{utils[_0xccc7('0x11')](util[_0xccc7('0x8')](_0xccc7('0x12'),_0x2cb10d[_0xccc7('0x4')]),_0x2cb10d);utils['info'](util[_0xccc7('0x8')](_0xccc7('0x13'),_0x2cb10d[_0xccc7('0x4')],_0x2cb10d[_0xccc7('0x14')],_0x2cb10d[_0xccc7('0x15')],_0x2cb10d['transfertargetcalleridnum'],_0x2cb10d[_0xccc7('0x16')]));_0x2cb10d=_[_0xccc7('0x17')](_0x2cb10d,{'transfererchannel':_0x2cb10d[_0xccc7('0x18')],'transferercalleridnum':_0x2cb10d[_0xccc7('0x14')],'transferercalleridname':_0x2cb10d[_0xccc7('0x15')],'transfererconnectedlinenum':_0x2cb10d[_0xccc7('0x19')],'transfererconnectedlinename':_0x2cb10d[_0xccc7('0x1a')],'transfereraccountcode':_0x2cb10d[_0xccc7('0x1b')],'transferercontext':_0x2cb10d[_0xccc7('0x1c')],'transfererexten':_0x2cb10d['secondtransfererexten'],'transfererlinkedid':_0x2cb10d[_0xccc7('0x1d')],'context':_0x2cb10d['origtransferercontext'],'extension':_0x2cb10d[_0xccc7('0x1e')],'type':_0xccc7('0x3')});if(_[_0xccc7('0x1f')](_0x2cb10d['transfereechannel'])){_0x2cb10d=_['assign'](_0x2cb10d,{'transfereechannel':_0x2cb10d['transfertargetchannel'],'transfereecalleridnum':_0x2cb10d['transfertargetcalleridnum'],'transfereecalleridname':_0x2cb10d[_0xccc7('0x16')],'transfereeconnectedlinenum':_0x2cb10d['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x2cb10d['transfertargetconnectedlinename'],'transfereeaccountcode':_0x2cb10d[_0xccc7('0x20')],'transfereecontext':_0x2cb10d[_0xccc7('0x21')],'transfereeexten':_0x2cb10d[_0xccc7('0x22')],'transfereelinkedid':_0x2cb10d[_0xccc7('0x23')]});}writeDB(_0x2cb10d);}catch(_0x1437ae){utils[_0xccc7('0x10')](util[_0xccc7('0x8')](_0xccc7('0x12'),_0x2cb10d[_0xccc7('0x4')]),_0x1437ae);}}; \ No newline at end of file +var _0xc4a3=['type','request','blindtransfer','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','blinds','error','attendedtransfer','debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','origtransfererexten','isNil','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','attended','origtransfereruniqueid','uniqueid'];(function(_0x2e8e19,_0x3616af){var _0x13300a=function(_0x26cb0d){while(--_0x26cb0d){_0x2e8e19['push'](_0x2e8e19['shift']());}};_0x13300a(++_0x3616af);}(_0xc4a3,0xd4));var _0x3c4a=function(_0x459471,_0x248ded){_0x459471=_0x459471-0x0;var _0x4b91f3=_0xc4a3[_0x459471];return _0x4b91f3;};'use strict';var _=require('lodash');var util=require(_0x3c4a('0x0'));var utils=require(_0x3c4a('0x1'));function writeDB(_0x3fafde){utils[_0x3c4a('0x2')](util[_0x3c4a('0x3')](_0x3c4a('0x4'),_0x3fafde['type']===_0x3c4a('0x5')?_0x3fafde[_0x3c4a('0x6')]:_0x3fafde[_0x3c4a('0x7')],_0x3fafde[_0x3c4a('0x8')]));utils[_0x3c4a('0x9')]('CreateVoiceTransferReport',_0x3fafde);}exports['blinds']={};exports[_0x3c4a('0xa')]=function(_0x495758){try{utils['debug'](util[_0x3c4a('0x3')](_0x3c4a('0xb'),_0x495758['uniqueid']),_0x495758);utils[_0x3c4a('0x2')](util[_0x3c4a('0x3')](_0x3c4a('0xc'),_0x495758[_0x3c4a('0x7')],_0x495758[_0x3c4a('0xd')],_0x495758[_0x3c4a('0xe')],_0x495758[_0x3c4a('0xf')],_0x495758[_0x3c4a('0x10')]));_0x495758[_0x3c4a('0x8')]=_0x3c4a('0x11');exports[_0x3c4a('0x12')][_0x495758['transfereruniqueid']]=_0x495758;writeDB(_0x495758);}catch(_0x426f99){utils[_0x3c4a('0x13')](util[_0x3c4a('0x3')](_0x3c4a('0xb'),_0x495758[_0x3c4a('0x7')]),_0x426f99);}};exports[_0x3c4a('0x14')]=function(_0x39496a){try{utils[_0x3c4a('0x15')](util[_0x3c4a('0x3')](_0x3c4a('0x16'),_0x39496a[_0x3c4a('0x6')]),_0x39496a);utils[_0x3c4a('0x2')](util[_0x3c4a('0x3')](_0x3c4a('0x17'),_0x39496a['origtransfereruniqueid'],_0x39496a[_0x3c4a('0x18')],_0x39496a['origtransferercalleridname'],_0x39496a['transfertargetcalleridnum'],_0x39496a[_0x3c4a('0x19')]));_0x39496a=_[_0x3c4a('0x1a')](_0x39496a,{'transfererchannel':_0x39496a[_0x3c4a('0x1b')],'transferercalleridnum':_0x39496a['origtransferercalleridnum'],'transferercalleridname':_0x39496a[_0x3c4a('0x1c')],'transfererconnectedlinenum':_0x39496a[_0x3c4a('0x1d')],'transfererconnectedlinename':_0x39496a[_0x3c4a('0x1e')],'transfereraccountcode':_0x39496a[_0x3c4a('0x1f')],'transferercontext':_0x39496a[_0x3c4a('0x20')],'transfererexten':_0x39496a[_0x3c4a('0x21')],'transfererlinkedid':_0x39496a['origtransfererlinkedid'],'context':_0x39496a[_0x3c4a('0x22')],'extension':_0x39496a[_0x3c4a('0x23')],'type':'attended'});if(_[_0x3c4a('0x24')](_0x39496a['transfereechannel'])){_0x39496a=_[_0x3c4a('0x1a')](_0x39496a,{'transfereechannel':_0x39496a[_0x3c4a('0x25')],'transfereecalleridnum':_0x39496a[_0x3c4a('0x26')],'transfereecalleridname':_0x39496a[_0x3c4a('0x19')],'transfereeconnectedlinenum':_0x39496a['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x39496a[_0x3c4a('0x27')],'transfereeaccountcode':_0x39496a[_0x3c4a('0x28')],'transfereecontext':_0x39496a[_0x3c4a('0x29')],'transfereeexten':_0x39496a[_0x3c4a('0x2a')],'transfereelinkedid':_0x39496a[_0x3c4a('0x2b')]});}writeDB(_0x39496a);}catch(_0x1ea7f0){utils['error'](util['format'](_0x3c4a('0x16'),_0x39496a[_0x3c4a('0x6')]),_0x1ea7f0);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 29784a8..8b90986 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 _0xfca0=['GetUser','internal','name','interface','then','[utils][getUser]\x20where:%s','stringify','result','length','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','add','YYYY-MM-DD\x20HH:mm:ss','subtract','seconds','format','diff','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','[utils][request]\x20name:%s','catch'];(function(_0x499df7,_0x317b03){var _0x3349f7=function(_0x2ee172){while(--_0x2ee172){_0x499df7['push'](_0x499df7['shift']());}};_0x3349f7(++_0x317b03);}(_0xfca0,0x171));var _0x0fca=function(_0x4a3c24,_0x5ec8a9){_0x4a3c24=_0x4a3c24-0x0;var _0x1b0ff0=_0xfca0[_0x4a3c24];return _0x1b0ff0;};'use strict';var BPromise=require(_0x0fca('0x0'));var jayson=require(_0x0fca('0x1'));var moment=require(_0x0fca('0x2'));var util=require(_0x0fca('0x3'));var client=jayson[_0x0fca('0x4')][_0x0fca('0x5')]({'port':0x2329});var logger=require(_0x0fca('0x6'))(_0x0fca('0x7'));exports['info']=function(_0x226056,_0xb474bc){logger[_0x0fca('0x8')](_0x226056,_0xb474bc?util[_0x0fca('0x9')](_0xb474bc,{'showHidden':![],'depth':null}):'');};exports[_0x0fca('0xa')]=function(_0x706948,_0x2bba5e){logger[_0x0fca('0xa')](_0x706948,_0x2bba5e?util[_0x0fca('0x9')](_0x2bba5e,{'showHidden':![],'depth':null}):'');};exports[_0x0fca('0xb')]=function(_0x4682c4,_0x43e7aa){logger[_0x0fca('0xb')](_0x4682c4,_0x43e7aa?util[_0x0fca('0x9')](_0x43e7aa,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x5bddeb,_0x14b929){return client[_0x0fca('0xc')](_0x5bddeb,{'body':_0x14b929})['then'](function(_0x117230){logger['debug'](_0x0fca('0xd'),_0x5bddeb,_0x117230?util[_0x0fca('0x9')](_0x117230,{'showHidden':![],'depth':null}):'');})[_0x0fca('0xe')](function(_0x1ad9fa){logger[_0x0fca('0xb')]('[utils][request]\x20name:%s',_0x5bddeb,_0x1ad9fa?util[_0x0fca('0x9')](_0x1ad9fa,{'showHidden':![],'depth':null}):'');});};function getUser(_0x415cb6){return client[_0x0fca('0xc')](_0x0fca('0xf'),{'options':{'raw':!![],'attributes':['id',_0x0fca('0x10'),_0x0fca('0x11'),_0x0fca('0x12')],'where':_0x415cb6,'limit':0x1}})[_0x0fca('0x13')](function(_0x19526f){logger[_0x0fca('0xa')](_0x0fca('0x14'),JSON[_0x0fca('0x15')](_0x415cb6),_0x19526f?util[_0x0fca('0x9')](_0x19526f,{'showHidden':![],'depth':null}):'');return _0x19526f[_0x0fca('0x16')][_0x0fca('0x17')]?_0x19526f[_0x0fca('0x16')][0x0]:null;});}exports['getUserByInternal']=function(_0x2e347c){return new BPromise(function(_0x864681,_0x263984){if(_0x2e347c){return getUser({'internal':_0x2e347c})[_0x0fca('0x13')](function(_0x51e419){logger['info'](_0x0fca('0x18'),_0x2e347c,_0x51e419?_0x0fca('0x19'):_0x0fca('0x1a'));return _0x864681(_0x51e419);})[_0x0fca('0xe')](function(_0x37ec9b){logger['error'](_0x0fca('0x1b'),_0x37ec9b?util[_0x0fca('0x9')](_0x37ec9b,{'showHidden':![],'depth':null}):'');return _0x864681(null);});}return _0x864681(null);});};exports[_0x0fca('0x1c')]=function(_0xc636a2){return new BPromise(function(_0x26f6a6,_0x5f58d0){if(_0xc636a2){return getUser({'interface':_0xc636a2})[_0x0fca('0x13')](function(_0x43ac51){logger[_0x0fca('0x8')](_0x0fca('0x1d'),_0xc636a2,_0x43ac51?_0x0fca('0x19'):_0x0fca('0x1a'));return _0x26f6a6(_0x43ac51);})[_0x0fca('0xe')](function(_0x513997){logger[_0x0fca('0xb')]('[utils][getUserByInterface]',_0x513997?util[_0x0fca('0x9')](_0x513997,{'showHidden':![],'depth':null}):'');return _0x26f6a6(null);});}return _0x26f6a6(null);});};exports[_0x0fca('0x1e')]=function(_0x2b468e){return new BPromise(function(_0x1ed9b0,_0x21bd9b){if(_0x2b468e){return getUser({'name':_0x2b468e})[_0x0fca('0x13')](function(_0x5aaf78){logger[_0x0fca('0x8')]('[utils][getUserByName]\x20name:%s\x20%s',_0x2b468e,_0x5aaf78?_0x0fca('0x19'):_0x0fca('0x1a'));return _0x1ed9b0(_0x5aaf78);})[_0x0fca('0xe')](function(_0x245f4f){logger[_0x0fca('0xb')](_0x0fca('0x1f'),_0x245f4f?util['inspect'](_0x245f4f,{'showHidden':![],'depth':null}):'');return _0x1ed9b0(null);});}return _0x1ed9b0(null);});};exports[_0x0fca('0x20')]=function(_0x1b7474){return new BPromise(function(_0xd56047,_0x1bcf6d){if(_0x1b7474){return client['request'](_0x0fca('0x21'),{'options':{'raw':!![],'attributes':['id','name','type',_0x0fca('0x22'),_0x0fca('0x23')],'where':{'name':_0x1b7474},'limit':0x1}})[_0x0fca('0x13')](function(_0x46004e){logger[_0x0fca('0xa')](_0x0fca('0x24'),_0x1b7474,_0x46004e?util[_0x0fca('0x9')](_0x46004e,{'showHidden':![],'depth':null}):'');logger['info'](_0x0fca('0x25'),_0x1b7474,_0x46004e?'found':_0x0fca('0x1a'));return _0xd56047(_0x46004e[_0x0fca('0x16')][_0x0fca('0x17')]?_0x46004e[_0x0fca('0x16')][0x0]:null);})[_0x0fca('0xe')](function(_0x49c287){logger[_0x0fca('0xb')](_0x0fca('0x26'),_0x49c287?util[_0x0fca('0x9')](_0x49c287,{'showHidden':![],'depth':null}):'');return _0xd56047(null);});}return _0xd56047(null);});};exports['addTime']=function(_0x2a86ef,_0x1de840){return moment(_0x2a86ef)[_0x0fca('0x27')](_0x1de840,'seconds')['format'](_0x0fca('0x28'));};exports['subtractTime']=function(_0x14a3e9,_0x5f45b9){return moment(_0x14a3e9)[_0x0fca('0x29')](_0x5f45b9,_0x0fca('0x2a'))[_0x0fca('0x2b')](_0x0fca('0x28'));};exports['diffTime']=function(_0x33f5cd,_0x25824e){return moment(_0x33f5cd)[_0x0fca('0x2c')](moment(_0x25824e),'seconds');};exports['sumTime']=function(_0x527e72,_0x5cbc7c){return parseInt(_0x527e72,0xa)+parseInt(_0x5cbc7c,0xa);};exports[_0x0fca('0x2d')]=function(){return moment()['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x0fca('0x2e')]=function(_0x156d87,_0x29ba33){if(_0x29ba33){return moment(_0x156d87)[_0x0fca('0x2e')](_0x29ba33);}return!![];};exports[_0x0fca('0x2f')]=function(_0xf1ae68,_0x23bfed){if(_0x23bfed){return moment(_0xf1ae68)['isBefore'](_0x23bfed);}else if(_0xf1ae68){return!![];}return![];}; \ No newline at end of file +var _0x2145=['request','then','[utils][request]\x20name:%s','GetUser','internal','name','interface','stringify','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','catch','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diff','now','isAfter','isBefore','jayson/promise','util','client','http','../../config/logger','xdr','info','debug','inspect','error'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2145,0x1d6));var _0x5214=function(_0x215b2a,_0x5bee72){_0x215b2a=_0x215b2a-0x0;var _0x49ca85=_0x2145[_0x215b2a];return _0x49ca85;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x5214('0x0'));var moment=require('moment');var util=require(_0x5214('0x1'));var client=jayson[_0x5214('0x2')][_0x5214('0x3')]({'port':0x2329});var logger=require(_0x5214('0x4'))(_0x5214('0x5'));exports[_0x5214('0x6')]=function(_0x5ba782,_0x4b2f4b){logger['info'](_0x5ba782,_0x4b2f4b?util['inspect'](_0x4b2f4b,{'showHidden':![],'depth':null}):'');};exports[_0x5214('0x7')]=function(_0x288609,_0x1b40e4){logger[_0x5214('0x7')](_0x288609,_0x1b40e4?util[_0x5214('0x8')](_0x1b40e4,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x46cdc7,_0x2a17ec){logger[_0x5214('0x9')](_0x46cdc7,_0x2a17ec?util[_0x5214('0x8')](_0x2a17ec,{'showHidden':![],'depth':null}):'');};exports[_0x5214('0xa')]=function(_0x2b23c2,_0x523833){return client[_0x5214('0xa')](_0x2b23c2,{'body':_0x523833})[_0x5214('0xb')](function(_0x597534){logger['debug'](_0x5214('0xc'),_0x2b23c2,_0x597534?util[_0x5214('0x8')](_0x597534,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x17f58a){logger['error'](_0x5214('0xc'),_0x2b23c2,_0x17f58a?util[_0x5214('0x8')](_0x17f58a,{'showHidden':![],'depth':null}):'');});};function getUser(_0x1db97d){return client[_0x5214('0xa')](_0x5214('0xd'),{'options':{'raw':!![],'attributes':['id',_0x5214('0xe'),_0x5214('0xf'),_0x5214('0x10')],'where':_0x1db97d,'limit':0x1}})[_0x5214('0xb')](function(_0x426303){logger['debug']('[utils][getUser]\x20where:%s',JSON[_0x5214('0x11')](_0x1db97d),_0x426303?util[_0x5214('0x8')](_0x426303,{'showHidden':![],'depth':null}):'');return _0x426303['result']['length']?_0x426303[_0x5214('0x12')][0x0]:null;});}exports[_0x5214('0x13')]=function(_0x4c6180){return new BPromise(function(_0x20ada2,_0x429550){if(_0x4c6180){return getUser({'internal':_0x4c6180})[_0x5214('0xb')](function(_0x5036ba){logger[_0x5214('0x6')](_0x5214('0x14'),_0x4c6180,_0x5036ba?_0x5214('0x15'):_0x5214('0x16'));return _0x20ada2(_0x5036ba);})[_0x5214('0x17')](function(_0x6a0e90){logger['error'](_0x5214('0x18'),_0x6a0e90?util[_0x5214('0x8')](_0x6a0e90,{'showHidden':![],'depth':null}):'');return _0x20ada2(null);});}return _0x20ada2(null);});};exports[_0x5214('0x19')]=function(_0x4e6d3e){return new BPromise(function(_0x5064ff,_0x369d86){if(_0x4e6d3e){return getUser({'interface':_0x4e6d3e})[_0x5214('0xb')](function(_0x31c602){logger[_0x5214('0x6')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x4e6d3e,_0x31c602?_0x5214('0x15'):_0x5214('0x16'));return _0x5064ff(_0x31c602);})[_0x5214('0x17')](function(_0x220649){logger[_0x5214('0x9')](_0x5214('0x1a'),_0x220649?util['inspect'](_0x220649,{'showHidden':![],'depth':null}):'');return _0x5064ff(null);});}return _0x5064ff(null);});};exports[_0x5214('0x1b')]=function(_0x275dba){return new BPromise(function(_0x2bb832,_0x36dfea){if(_0x275dba){return getUser({'name':_0x275dba})[_0x5214('0xb')](function(_0x448711){logger['info'](_0x5214('0x1c'),_0x275dba,_0x448711?_0x5214('0x15'):_0x5214('0x16'));return _0x2bb832(_0x448711);})[_0x5214('0x17')](function(_0x2e7a73){logger['error'](_0x5214('0x1d'),_0x2e7a73?util[_0x5214('0x8')](_0x2e7a73,{'showHidden':![],'depth':null}):'');return _0x2bb832(null);});}return _0x2bb832(null);});};exports['getVoiceQueueByName']=function(_0x38d4b9){return new BPromise(function(_0x20a512,_0x3d9f08){if(_0x38d4b9){return client['request'](_0x5214('0x1e'),{'options':{'raw':!![],'attributes':['id',_0x5214('0xf'),_0x5214('0x1f'),_0x5214('0x20'),_0x5214('0x21')],'where':{'name':_0x38d4b9},'limit':0x1}})[_0x5214('0xb')](function(_0x9d6fb3){logger[_0x5214('0x7')](_0x5214('0x22'),_0x38d4b9,_0x9d6fb3?util[_0x5214('0x8')](_0x9d6fb3,{'showHidden':![],'depth':null}):'');logger[_0x5214('0x6')](_0x5214('0x23'),_0x38d4b9,_0x9d6fb3?_0x5214('0x15'):_0x5214('0x16'));return _0x20a512(_0x9d6fb3['result'][_0x5214('0x24')]?_0x9d6fb3[_0x5214('0x12')][0x0]:null);})['catch'](function(_0x38ff31){logger[_0x5214('0x9')](_0x5214('0x25'),_0x38ff31?util[_0x5214('0x8')](_0x38ff31,{'showHidden':![],'depth':null}):'');return _0x20a512(null);});}return _0x20a512(null);});};exports[_0x5214('0x26')]=function(_0x123415,_0x121532){return moment(_0x123415)[_0x5214('0x27')](_0x121532,_0x5214('0x28'))[_0x5214('0x29')](_0x5214('0x2a'));};exports['subtractTime']=function(_0x3d8daa,_0x3c67d3){return moment(_0x3d8daa)[_0x5214('0x2b')](_0x3c67d3,'seconds')[_0x5214('0x29')]('YYYY-MM-DD\x20HH:mm:ss');};exports['diffTime']=function(_0x188434,_0x36c48b){return moment(_0x188434)[_0x5214('0x2c')](moment(_0x36c48b),_0x5214('0x28'));};exports['sumTime']=function(_0x3ed6ea,_0xc6d53d){return parseInt(_0x3ed6ea,0xa)+parseInt(_0xc6d53d,0xa);};exports[_0x5214('0x2d')]=function(){return moment()[_0x5214('0x29')](_0x5214('0x2a'));};exports[_0x5214('0x2e')]=function(_0x49d893,_0xdae3ca){if(_0xdae3ca){return moment(_0x49d893)[_0x5214('0x2e')](_0xdae3ca);}return!![];};exports['isBefore']=function(_0x418515,_0x2c43d3){if(_0x2c43d3){return moment(_0x418515)[_0x5214('0x2f')](_0x2c43d3);}else if(_0x418515){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index ef880c6..7e3d826 100644 --- a/server/utils/client-side-logger.js +++ b/server/utils/client-side-logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x81f8=['then','join','catch','log','user','data','error','api','auth','client-side-logger','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format','headers','x-forwarded-for','connection','remoteAddress','statusCode','name','inspect','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','method','url','other','agent_name','test','setupLoggers','lodash','express-winston','util','fileLogger','./safe-template','maskSensitiveData','/var','xcally','client','role','ensureDir'];(function(_0x550e4c,_0x2fb105){var _0x4db009=function(_0xb4f6e4){while(--_0xb4f6e4){_0x550e4c['push'](_0x550e4c['shift']());}};_0x4db009(++_0x2fb105);}(_0x81f8,0xcc));var _0x881f=function(_0xcf6701,_0x1c77dd){_0xcf6701=_0xcf6701-0x0;var _0x22bb1d=_0x81f8[_0xcf6701];return _0x22bb1d;};var fs=require('fs-extra');var _=require(_0x881f('0x0'));var ewinston=require(_0x881f('0x1'));var path=require('path');var util=require(_0x881f('0x2'));var fileLogger=require('./loggers')[_0x881f('0x3')];var safeTemplate=require(_0x881f('0x4'))['safeTemplate'];var maskSensitiveData=require('./mask-sensitive-data')[_0x881f('0x5')];function ClientSideLogger(){function _0x2f951e(_0x268d6f){var _0x54cbf2=path['join'](_0x881f('0x6'),'log',_0x881f('0x7'));var _0x581710=path['join'](_0x881f('0x8'),_0x268d6f[_0x881f('0x9')]+'-'+_0x268d6f['name']);return fs[_0x881f('0xa')](path['join'](_0x54cbf2,_0x581710))[_0x881f('0xb')](function(){var _0x16fef8=fileLogger(_0x881f('0x8'),path[_0x881f('0xc')](_0x54cbf2,_0x581710));return _0x16fef8;})[_0x881f('0xd')](function(_0x1d5b39){throw _0x1d5b39;});}this[_0x881f('0xe')]=function(_0x438b2a,_0x384a86,_0x4ad0e0,_0x10652a){return _0x2f951e(_0x438b2a[_0x881f('0xf')])[_0x881f('0xb')](function(_0x79bd6f){var _0x21ab2e=_0x79bd6f[_0x384a86];return _0x21ab2e;})[_0x881f('0xb')](function(_0xa7098b){var _0x4d9f26=_0x438b2a[_0x881f('0xf')]?_0x438b2a[_0x881f('0xf')]['id']:'no-user';var _0x8716f5=_0x10652a[_0x881f('0x10')];var _0x224b29=_0x10652a['timestamp'];var _0x1e4bd1=new Date(Number(_0x224b29));return _0xa7098b(_0x4d9f26,_0x1e4bd1,_0x4ad0e0,_0x8716f5);})[_0x881f('0xd')](function(_0xa59f90){fileLogger(_0x881f('0x8'))[_0x881f('0x11')](_0xa59f90);});};}function setupLoggers(_0x1a68f2){return new Promise(function(_0x165925){var _0x16fa53=new ClientSideLogger();var _0x30d2d1=fileLogger(_0x881f('0x12'));var _0x1451f8=fileLogger(_0x881f('0x13'));_0x1a68f2['set'](_0x881f('0x14'),_0x16fa53);_0x1a68f2['use'](ewinston[_0x881f('0x15')]({'winstonInstance':_0x30d2d1,'meta':![],'statusLevels':!![],'msg':function(_0x4097c4,_0x362f39){var _0x383852=_0x881f('0x16');if(!_[_0x881f('0x17')](_0x4097c4[_0x881f('0x18')])){_0x383852+='\x20body=%s';var _0x5c7866=_0x4097c4[_0x881f('0x18')];maskSensitiveData(_0x5c7866);}return safeTemplate(util[_0x881f('0x19')](_0x383852,_0x4097c4['method'],_0x4097c4[_0x881f('0x1a')][_0x881f('0x1b')]?_0x4097c4[_0x881f('0x1a')][_0x881f('0x1b')]:_0x4097c4[_0x881f('0x1c')][_0x881f('0x1d')]||_0x4097c4['ip'],_0x4097c4['url'],_0x362f39[_0x881f('0x1e')],_0x362f39['responseTime'],_0x4097c4[_0x881f('0xf')]?_0x4097c4['user']['id']:null,_0x4097c4[_0x881f('0xf')]?_0x4097c4['user'][_0x881f('0x1f')]:null,_0x4097c4[_0x881f('0xf')]?_0x4097c4[_0x881f('0xf')]['role']:null,_0x5c7866?util[_0x881f('0x20')](_0x5c7866,![],null):''));}}));_0x1a68f2[_0x881f('0x21')](ewinston[_0x881f('0x15')]({'winstonInstance':_0x1451f8,'meta':![],'statusLevels':!![],'msg':function(_0x3e53fb,_0x2be0da){var _0x1416a8=_0x881f('0x22');if(_0x3e53fb['body']&&_0x3e53fb[_0x881f('0x18')][_0x881f('0x23')]&&_0x3e53fb[_0x881f('0x18')][_0x881f('0x24')]){_0x1416a8='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util['format'](_0x1416a8,_0x3e53fb[_0x881f('0x25')],_0x3e53fb[_0x881f('0x1a')][_0x881f('0x1b')]?_0x3e53fb[_0x881f('0x1a')][_0x881f('0x1b')]:_0x3e53fb[_0x881f('0x1c')][_0x881f('0x1d')]||_0x3e53fb['ip'],_0x3e53fb[_0x881f('0x26')],_0x2be0da['statusCode'],_0x2be0da['responseTime'],_0x3e53fb['user']?_0x3e53fb[_0x881f('0xf')]['id']:null,_0x3e53fb[_0x881f('0xf')]?_0x3e53fb['user'][_0x881f('0x1f')]:null,_0x3e53fb[_0x881f('0xf')]?_0x3e53fb[_0x881f('0xf')][_0x881f('0x9')]:null,_0x3e53fb['body']&&_0x3e53fb[_0x881f('0x18')][_0x881f('0x23')]?_0x3e53fb[_0x881f('0x18')][_0x881f('0x23')]:_0x881f('0x27'),_0x3e53fb['body']&&_0x3e53fb[_0x881f('0x18')]['agent_id']?_0x3e53fb[_0x881f('0x18')][_0x881f('0x24')]:'',_0x3e53fb['body']&&_0x3e53fb[_0x881f('0x18')][_0x881f('0x28')]?_0x3e53fb[_0x881f('0x18')][_0x881f('0x28')]:'');},'ignoreRoute':function(_0x263803){var _0x53607d=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x53607d[_0x881f('0x29')](_0x263803[_0x881f('0x26')]);}}));return _0x165925();});}exports[_0x881f('0x2a')]=setupLoggers; \ No newline at end of file +var _0x2d04=['method','device','other','agent_id','agent_name','test','fs-extra','lodash','express-winston','path','./loggers','fileLogger','./safe-template','safeTemplate','/var','log','client','name','ensureDir','join','user','then','timestamp','catch','error','api','auth','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','x-forwarded-for','headers','connection','remoteAddress','url','statusCode','responseTime','role','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)'];(function(_0x528c64,_0x1d452d){var _0x4d8c2c=function(_0x68cb74){while(--_0x68cb74){_0x528c64['push'](_0x528c64['shift']());}};_0x4d8c2c(++_0x1d452d);}(_0x2d04,0x13a));var _0x42d0=function(_0x320b8d,_0x233935){_0x320b8d=_0x320b8d-0x0;var _0x2079f7=_0x2d04[_0x320b8d];return _0x2079f7;};var fs=require(_0x42d0('0x0'));var _=require(_0x42d0('0x1'));var ewinston=require(_0x42d0('0x2'));var path=require(_0x42d0('0x3'));var util=require('util');var fileLogger=require(_0x42d0('0x4'))[_0x42d0('0x5')];var safeTemplate=require(_0x42d0('0x6'))[_0x42d0('0x7')];var maskSensitiveData=require('./mask-sensitive-data')['maskSensitiveData'];function ClientSideLogger(){function _0x422580(_0x624444){var _0x3f77fa=path['join'](_0x42d0('0x8'),_0x42d0('0x9'),'xcally');var _0x429288=path['join'](_0x42d0('0xa'),_0x624444['role']+'-'+_0x624444[_0x42d0('0xb')]);return fs[_0x42d0('0xc')](path[_0x42d0('0xd')](_0x3f77fa,_0x429288))['then'](function(){var _0x241e85=fileLogger(_0x42d0('0xa'),path[_0x42d0('0xd')](_0x3f77fa,_0x429288));return _0x241e85;})['catch'](function(_0x3fca1a){throw _0x3fca1a;});}this['log']=function(_0x1d5b60,_0x310900,_0x2a5479,_0x539654){return _0x422580(_0x1d5b60[_0x42d0('0xe')])[_0x42d0('0xf')](function(_0x3959f4){var _0x4aa924=_0x3959f4[_0x310900];return _0x4aa924;})[_0x42d0('0xf')](function(_0x4f2835){var _0xded4f2=_0x1d5b60[_0x42d0('0xe')]?_0x1d5b60[_0x42d0('0xe')]['id']:'no-user';var _0x537e54=_0x539654['data'];var _0x382cb1=_0x539654[_0x42d0('0x10')];var _0x406bd3=new Date(Number(_0x382cb1));return _0x4f2835(_0xded4f2,_0x406bd3,_0x2a5479,_0x537e54);})[_0x42d0('0x11')](function(_0xc978f7){fileLogger(_0x42d0('0xa'))[_0x42d0('0x12')](_0xc978f7);});};}function setupLoggers(_0x471023){return new Promise(function(_0x9ad36f){var _0x282cdf=new ClientSideLogger();var _0xc9b983=fileLogger(_0x42d0('0x13'));var _0x763e94=fileLogger(_0x42d0('0x14'));_0x471023['set'](_0x42d0('0x15'),_0x282cdf);_0x471023[_0x42d0('0x16')](ewinston[_0x42d0('0x17')]({'winstonInstance':_0xc9b983,'meta':![],'statusLevels':!![],'msg':function(_0x1f2aee,_0x4091de){var _0x551821=_0x42d0('0x18');if(!_[_0x42d0('0x19')](_0x1f2aee[_0x42d0('0x1a')])){_0x551821+=_0x42d0('0x1b');var _0xbb9ce2=_0x1f2aee[_0x42d0('0x1a')];maskSensitiveData(_0xbb9ce2);}return safeTemplate(util[_0x42d0('0x1c')](_0x551821,_0x1f2aee['method'],_0x1f2aee['headers'][_0x42d0('0x1d')]?_0x1f2aee[_0x42d0('0x1e')][_0x42d0('0x1d')]:_0x1f2aee[_0x42d0('0x1f')][_0x42d0('0x20')]||_0x1f2aee['ip'],_0x1f2aee[_0x42d0('0x21')],_0x4091de[_0x42d0('0x22')],_0x4091de[_0x42d0('0x23')],_0x1f2aee[_0x42d0('0xe')]?_0x1f2aee[_0x42d0('0xe')]['id']:null,_0x1f2aee[_0x42d0('0xe')]?_0x1f2aee[_0x42d0('0xe')][_0x42d0('0xb')]:null,_0x1f2aee['user']?_0x1f2aee[_0x42d0('0xe')][_0x42d0('0x24')]:null,_0xbb9ce2?util['inspect'](_0xbb9ce2,![],null):''));}}));_0x471023[_0x42d0('0x16')](ewinston[_0x42d0('0x17')]({'winstonInstance':_0x763e94,'meta':![],'statusLevels':!![],'msg':function(_0x3a2672,_0xe29b92){var _0xdacaba='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x3a2672['body']&&_0x3a2672['body']['device']&&_0x3a2672[_0x42d0('0x1a')]['agent_id']){_0xdacaba=_0x42d0('0x25');}return util[_0x42d0('0x1c')](_0xdacaba,_0x3a2672[_0x42d0('0x26')],_0x3a2672[_0x42d0('0x1e')][_0x42d0('0x1d')]?_0x3a2672[_0x42d0('0x1e')][_0x42d0('0x1d')]:_0x3a2672['connection'][_0x42d0('0x20')]||_0x3a2672['ip'],_0x3a2672[_0x42d0('0x21')],_0xe29b92[_0x42d0('0x22')],_0xe29b92[_0x42d0('0x23')],_0x3a2672[_0x42d0('0xe')]?_0x3a2672['user']['id']:null,_0x3a2672[_0x42d0('0xe')]?_0x3a2672[_0x42d0('0xe')][_0x42d0('0xb')]:null,_0x3a2672[_0x42d0('0xe')]?_0x3a2672['user'][_0x42d0('0x24')]:null,_0x3a2672[_0x42d0('0x1a')]&&_0x3a2672[_0x42d0('0x1a')][_0x42d0('0x27')]?_0x3a2672[_0x42d0('0x1a')][_0x42d0('0x27')]:_0x42d0('0x28'),_0x3a2672[_0x42d0('0x1a')]&&_0x3a2672[_0x42d0('0x1a')][_0x42d0('0x29')]?_0x3a2672[_0x42d0('0x1a')][_0x42d0('0x29')]:'',_0x3a2672[_0x42d0('0x1a')]&&_0x3a2672[_0x42d0('0x1a')]['agent_name']?_0x3a2672[_0x42d0('0x1a')][_0x42d0('0x2a')]:'');},'ignoreRoute':function(_0x3e2b84){var _0x55418c=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x55418c[_0x42d0('0x2b')](_0x3e2b84[_0x42d0('0x21')]);}}));return _0x9ad36f();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index e371848..959815e 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7be8=['hours','minutes','isBefore','startOf','day','isBetween','timeCompare','format','ddd','dowCompare','date','min','max','domCompare','MMM','includes','guess','test','length','padStart','lodash','map','join','Interval\x20string\x20not\x20valid','isValid','split','locale','toLowerCase','indexOf','slice','concat','exports','circularDoWInterval','monthsShort','circularMonthInterval','clone'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x7be8,0x1a0));var _0x87be=function(_0x701f71,_0x52e0b2){_0x701f71=_0x701f71-0x0;var _0x5597a9=_0x7be8[_0x701f71];return _0x5597a9;};var _=require(_0x87be('0x0'));var moment=require('moment-timezone');var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x87be('0x1')](function(_0x1d6a5a){return _0x1d6a5a['source'];})[_0x87be('0x2')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x87be('0x3');var EINVALID_DATE='Date\x20not\x20valid';function throwIfDateNotValid(_0x12f2cd){if(!_0x12f2cd[_0x87be('0x4')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x44a371){var _0x2521f0=_0x44a371[_0x87be('0x5')](':')['map'](function(_0x566c42){return parseInt(_0x566c42,0xa);});var _0x478433=_0x2521f0[0x0];var _0x43020f=_0x2521f0[0x1];if(_0x478433<0x0||_0x478433>0x17||_0x43020f<0x0||_0x43020f>0x3b){throw new Error(EINVALID_DATE);}return[_0x478433,_0x43020f];}function circularDoWInterval(_0x49baf8,_0x50cf0c){if(_0x49baf8===_0x50cf0c){return[_0x49baf8];}else{var _0xb16211=moment[_0x87be('0x6')]();moment[_0x87be('0x6')]('en');var _0x42b498=moment['weekdaysShort']()[_0x87be('0x1')](function(_0x25c2d2){return _0x25c2d2[_0x87be('0x7')]();});moment[_0x87be('0x6')](_0xb16211);var _0x4f6bfe=_0x42b498[_0x87be('0x8')](_0x49baf8);var _0x365cb7=_0x42b498[_0x87be('0x8')](_0x50cf0c);if(_0x365cb7>_0x4f6bfe){return _0x42b498['slice'](_0x4f6bfe,_0x365cb7+0x1);}else{var _0x1d6729=_0x42b498[_0x87be('0x9')](0x0,_0x365cb7+0x1);var _0x2bcc77=_0x42b498['slice'](_0x4f6bfe);return _0x2bcc77[_0x87be('0xa')](_0x1d6729);}}}module[_0x87be('0xb')][_0x87be('0xc')]=circularDoWInterval;function circularMonthInterval(_0x5cd00a,_0x3aacac){if(_0x5cd00a===_0x3aacac){return[_0x5cd00a];}else{var _0x4e80b4=moment[_0x87be('0x6')]();moment[_0x87be('0x6')]('en');var _0x4cc9e5=moment[_0x87be('0xd')]()[_0x87be('0x1')](function(_0x5e8f4e){return _0x5e8f4e[_0x87be('0x7')]();});moment[_0x87be('0x6')](_0x4e80b4);var _0x322626=_0x4cc9e5[_0x87be('0x8')](_0x5cd00a);var _0x22ff31=_0x4cc9e5['indexOf'](_0x3aacac);if(_0x22ff31>_0x322626){return _0x4cc9e5[_0x87be('0x9')](_0x322626,_0x22ff31+0x1);}else{var _0x181e4a=_0x4cc9e5[_0x87be('0x9')](0x0,_0x22ff31+0x1);var _0x1c0eec=_0x4cc9e5[_0x87be('0x9')](_0x322626);return _0x1c0eec[_0x87be('0xa')](_0x181e4a);}}}module[_0x87be('0xb')][_0x87be('0xe')]=circularMonthInterval;function parseDom(_0x59d701){var _0x3c3ebd=parseInt(_0x59d701,0xa);if(_0x3c3ebd<0x1||_0x3c3ebd>0x1f){throw new Error(EINVALID_DATE);}return _0x3c3ebd;}function timeCompare(_0x2441f6,_0x133b93,_0x544681){var _0x2c6896=_0x2441f6['clone']();var _0x4b751d=extractTime(_0x133b93);var _0x2aa4fd=_0x4b751d[0x0];var _0x2700bb=_0x4b751d[0x1];var _0x36c33b=_0x2441f6[_0x87be('0xf')]()[_0x87be('0x10')](_0x2aa4fd)['minutes'](_0x2700bb);throwIfDateNotValid(_0x36c33b);var _0x431c4a=extractTime(_0x544681);var _0x323b4f=_0x431c4a[0x0];var _0x3eff43=_0x431c4a[0x1];var _0x5c77b7=_0x2441f6[_0x87be('0xf')]()['hours'](_0x323b4f)[_0x87be('0x11')](_0x3eff43);throwIfDateNotValid(_0x5c77b7);if(_0x5c77b7[_0x87be('0x12')](_0x36c33b)){var _0x3770d1=_0x2c6896['clone']()[_0x87be('0x13')]('day');var _0x5c2aa3=_0x2c6896[_0x87be('0xf')]()['endOf'](_0x87be('0x14'));return _0x2c6896['isBetween'](_0x36c33b,_0x5c2aa3,undefined,'[]')||_0x2c6896[_0x87be('0x15')](_0x3770d1,_0x5c77b7,undefined,'[]');}else{return _0x2c6896['isBetween'](_0x36c33b,_0x5c77b7,undefined,'[]');}}module[_0x87be('0xb')][_0x87be('0x16')]=timeCompare;function dowCompare(_0x807cc4,_0x237b33,_0x51e713){var _0x41b33b=_0x807cc4[_0x87be('0x6')]('en')[_0x87be('0x17')](_0x87be('0x18'))[_0x87be('0x7')]();return circularDoWInterval(_0x237b33,_0x51e713)['includes'](_0x41b33b);}module[_0x87be('0xb')][_0x87be('0x19')]=dowCompare;function domCompare(_0x15dd2b,_0x316856,_0xc649da){var _0x2d768f=_0x15dd2b[_0x87be('0x1a')]();if(_0x316856===_0xc649da){return _0x2d768f===_0x316856;}else{var _0x1e30cf=_0x15dd2b['daysInMonth']();var _0x4491b5=_0x316856<_0xc649da;let _0x5cc18d=![];var _0x45f872=0x0;var _0x372531=0x0;if(_0x4491b5){_0x45f872=Math['max'](0x1,_0x316856);_0x372531=Math[_0x87be('0x1b')](_0xc649da,_0x1e30cf);_0x5cc18d=_0x2d768f>=_0x45f872&&_0x2d768f<=_0x372531;}else{_0x45f872=Math[_0x87be('0x1b')](_0x316856,_0x1e30cf);_0x372531=Math[_0x87be('0x1c')](0x1,_0xc649da);_0x5cc18d=_0x2d768f>=_0x45f872||_0x2d768f<=_0x372531;}return _0x5cc18d;}}module['exports'][_0x87be('0x1d')]=domCompare;function monthCompare(_0x49024c,_0x3ebed5,_0x8e8831){var _0x25e676=_0x49024c['locale']('en')[_0x87be('0x17')](_0x87be('0x1e'))['toLowerCase']();return circularMonthInterval(_0x3ebed5,_0x8e8831)[_0x87be('0x1f')](_0x25e676);}module[_0x87be('0xb')]['monthCompare']=monthCompare;function iftime(_0x43f8cd,_0x562e73=moment['tz'][_0x87be('0x20')](),_0x2cda87=moment()){if(!validateRx[_0x87be('0x21')](_0x43f8cd)){throw new Error(EINVALID_STRING);}else{var _0x6718b6=(moment['isMoment'](_0x2cda87)?_0x2cda87[_0x87be('0xf')]():moment(_0x2cda87))['tz'](_0x562e73)[_0x87be('0x6')]('en');throwIfDateNotValid(_0x6718b6);var _0x407b34=_0x43f8cd[_0x87be('0x5')](',');var _0x430e96=_0x407b34[0x0];var _0x37b56d=_0x407b34[0x1];var _0x699084=_0x407b34[0x2];var _0x3f01a0=_0x407b34[0x3];let _0x231d1a=!![];if(_0x430e96!=='*'){var _0x3bb7b3=_0x430e96[_0x87be('0x5')]('-');var _0x24f625=_['padStart'](_0x3bb7b3[0x0],0x5,'0');var _0x5351dc=_0x3bb7b3[_0x87be('0x22')]===0x2?_[_0x87be('0x23')](_0x3bb7b3[0x1],0x5,'0'):_0x24f625;_0x231d1a=timeCompare(_0x6718b6,_0x24f625,_0x5351dc);}let _0x44482a=!![];if(_0x37b56d!=='*'){var _0x49cb8f=_0x37b56d['split']('-');var _0x108f7b=_0x49cb8f[0x0];var _0x114bfa=_0x49cb8f[_0x87be('0x22')]===0x2?_0x49cb8f[0x1]:_0x108f7b;_0x44482a=dowCompare(_0x6718b6,_0x108f7b,_0x114bfa);}let _0x158583=!![];if(_0x699084!=='*'){var _0x53e67d=_0x699084['split']('-');var _0x106664=parseDom(_0x53e67d[0x0]);var _0x53b462=_0x53e67d['length']===0x2?parseDom(_0x53e67d[0x1]):_0x106664;_0x158583=domCompare(_0x6718b6,_0x106664,_0x53b462);}let _0x2641b7=!![];if(_0x3f01a0!=='*'){var _0x1baab0=_0x3f01a0[_0x87be('0x5')]('-');var _0x47ce8f=_0x1baab0[0x0];var _0x68b9a0=_0x1baab0['length']===0x2?_0x1baab0[0x1]:_0x1baab0[0x0];_0x2641b7=monthCompare(_0x6718b6,_0x47ce8f,_0x68b9a0);}return _0x231d1a&&_0x44482a&&_0x158583&&_0x2641b7;}}module[_0x87be('0xb')]['iftime']=iftime; \ No newline at end of file +var _0xde54=['format','dowCompare','date','daysInMonth','min','max','MMM','includes','monthCompare','guess','test','isMoment','padStart','split','length','iftime','lodash','moment-timezone','map','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','locale','weekdaysShort','toLowerCase','indexOf','slice','exports','circularDoWInterval','monthsShort','clone','hours','day','endOf','isBetween','timeCompare'];(function(_0x1f8bfb,_0x25e15f){var _0x189e4e=function(_0x50230f){while(--_0x50230f){_0x1f8bfb['push'](_0x1f8bfb['shift']());}};_0x189e4e(++_0x25e15f);}(_0xde54,0x140));var _0x4de5=function(_0x3a4b24,_0x35ef80){_0x3a4b24=_0x3a4b24-0x0;var _0x446d38=_0xde54[_0x3a4b24];return _0x446d38;};var _=require(_0x4de5('0x0'));var moment=require(_0x4de5('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x4de5('0x2')](function(_0x258c95){return _0x258c95[_0x4de5('0x3')];})[_0x4de5('0x4')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x4de5('0x5');var EINVALID_DATE=_0x4de5('0x6');function throwIfDateNotValid(_0x5de9a7){if(!_0x5de9a7[_0x4de5('0x7')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x15b457){var _0x3665d8=_0x15b457['split'](':')[_0x4de5('0x2')](function(_0x31cda2){return parseInt(_0x31cda2,0xa);});var _0xbacfa3=_0x3665d8[0x0];var _0x4676a7=_0x3665d8[0x1];if(_0xbacfa3<0x0||_0xbacfa3>0x17||_0x4676a7<0x0||_0x4676a7>0x3b){throw new Error(EINVALID_DATE);}return[_0xbacfa3,_0x4676a7];}function circularDoWInterval(_0x4a4bd5,_0x23e3e6){if(_0x4a4bd5===_0x23e3e6){return[_0x4a4bd5];}else{var _0xe8b790=moment[_0x4de5('0x8')]();moment['locale']('en');var _0x1f091d=moment[_0x4de5('0x9')]()[_0x4de5('0x2')](function(_0x4d9e1d){return _0x4d9e1d[_0x4de5('0xa')]();});moment[_0x4de5('0x8')](_0xe8b790);var _0x366a24=_0x1f091d[_0x4de5('0xb')](_0x4a4bd5);var _0x262e60=_0x1f091d[_0x4de5('0xb')](_0x23e3e6);if(_0x262e60>_0x366a24){return _0x1f091d[_0x4de5('0xc')](_0x366a24,_0x262e60+0x1);}else{var _0x150bfb=_0x1f091d[_0x4de5('0xc')](0x0,_0x262e60+0x1);var _0x19254f=_0x1f091d[_0x4de5('0xc')](_0x366a24);return _0x19254f['concat'](_0x150bfb);}}}module[_0x4de5('0xd')][_0x4de5('0xe')]=circularDoWInterval;function circularMonthInterval(_0xa20372,_0x271011){if(_0xa20372===_0x271011){return[_0xa20372];}else{var _0x50775b=moment[_0x4de5('0x8')]();moment[_0x4de5('0x8')]('en');var _0x82933=moment[_0x4de5('0xf')]()[_0x4de5('0x2')](function(_0x2e585b){return _0x2e585b[_0x4de5('0xa')]();});moment[_0x4de5('0x8')](_0x50775b);var _0x54e6dc=_0x82933['indexOf'](_0xa20372);var _0x3633e0=_0x82933[_0x4de5('0xb')](_0x271011);if(_0x3633e0>_0x54e6dc){return _0x82933['slice'](_0x54e6dc,_0x3633e0+0x1);}else{var _0x171a9f=_0x82933[_0x4de5('0xc')](0x0,_0x3633e0+0x1);var _0x18c128=_0x82933['slice'](_0x54e6dc);return _0x18c128['concat'](_0x171a9f);}}}module[_0x4de5('0xd')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0x4f233a){var _0x4be6cb=parseInt(_0x4f233a,0xa);if(_0x4be6cb<0x1||_0x4be6cb>0x1f){throw new Error(EINVALID_DATE);}return _0x4be6cb;}function timeCompare(_0x16fe9b,_0x5059a6,_0x202e0d){var _0x312c4c=_0x16fe9b[_0x4de5('0x10')]();var _0x5b6c6b=extractTime(_0x5059a6);var _0x2a70d9=_0x5b6c6b[0x0];var _0x24312d=_0x5b6c6b[0x1];var _0x1b825c=_0x16fe9b['clone']()[_0x4de5('0x11')](_0x2a70d9)['minutes'](_0x24312d);throwIfDateNotValid(_0x1b825c);var _0x4c677a=extractTime(_0x202e0d);var _0x4156e9=_0x4c677a[0x0];var _0x5dccc9=_0x4c677a[0x1];var _0x287681=_0x16fe9b['clone']()[_0x4de5('0x11')](_0x4156e9)['minutes'](_0x5dccc9);throwIfDateNotValid(_0x287681);if(_0x287681['isBefore'](_0x1b825c)){var _0x1f0e68=_0x312c4c[_0x4de5('0x10')]()['startOf'](_0x4de5('0x12'));var _0x1367b0=_0x312c4c['clone']()[_0x4de5('0x13')]('day');return _0x312c4c[_0x4de5('0x14')](_0x1b825c,_0x1367b0,undefined,'[]')||_0x312c4c[_0x4de5('0x14')](_0x1f0e68,_0x287681,undefined,'[]');}else{return _0x312c4c[_0x4de5('0x14')](_0x1b825c,_0x287681,undefined,'[]');}}module[_0x4de5('0xd')][_0x4de5('0x15')]=timeCompare;function dowCompare(_0x2940c3,_0x3157b5,_0x2db3d1){var _0x14a320=_0x2940c3[_0x4de5('0x8')]('en')[_0x4de5('0x16')]('ddd')[_0x4de5('0xa')]();return circularDoWInterval(_0x3157b5,_0x2db3d1)['includes'](_0x14a320);}module[_0x4de5('0xd')][_0x4de5('0x17')]=dowCompare;function domCompare(_0x5d13aa,_0x2371c5,_0x2361e6){var _0x4a14a6=_0x5d13aa[_0x4de5('0x18')]();if(_0x2371c5===_0x2361e6){return _0x4a14a6===_0x2371c5;}else{var _0x5b9dd3=_0x5d13aa[_0x4de5('0x19')]();var _0x429328=_0x2371c5<_0x2361e6;let _0x111afa=![];var _0x11dbee=0x0;var _0x542afe=0x0;if(_0x429328){_0x11dbee=Math['max'](0x1,_0x2371c5);_0x542afe=Math[_0x4de5('0x1a')](_0x2361e6,_0x5b9dd3);_0x111afa=_0x4a14a6>=_0x11dbee&&_0x4a14a6<=_0x542afe;}else{_0x11dbee=Math[_0x4de5('0x1a')](_0x2371c5,_0x5b9dd3);_0x542afe=Math[_0x4de5('0x1b')](0x1,_0x2361e6);_0x111afa=_0x4a14a6>=_0x11dbee||_0x4a14a6<=_0x542afe;}return _0x111afa;}}module['exports']['domCompare']=domCompare;function monthCompare(_0x2b2e17,_0x5f0ee8,_0x140e8a){var _0x53abd2=_0x2b2e17[_0x4de5('0x8')]('en')[_0x4de5('0x16')](_0x4de5('0x1c'))['toLowerCase']();return circularMonthInterval(_0x5f0ee8,_0x140e8a)[_0x4de5('0x1d')](_0x53abd2);}module['exports'][_0x4de5('0x1e')]=monthCompare;function iftime(_0x406304,_0x8210cd=moment['tz'][_0x4de5('0x1f')](),_0x3e0a2c=moment()){if(!validateRx[_0x4de5('0x20')](_0x406304)){throw new Error(EINVALID_STRING);}else{var _0x10bdc6=(moment[_0x4de5('0x21')](_0x3e0a2c)?_0x3e0a2c[_0x4de5('0x10')]():moment(_0x3e0a2c))['tz'](_0x8210cd)[_0x4de5('0x8')]('en');throwIfDateNotValid(_0x10bdc6);var _0x1045e6=_0x406304['split'](',');var _0x208793=_0x1045e6[0x0];var _0x12a193=_0x1045e6[0x1];var _0x3b6c6b=_0x1045e6[0x2];var _0x61cf49=_0x1045e6[0x3];let _0x1852b5=!![];if(_0x208793!=='*'){var _0x4323fb=_0x208793['split']('-');var _0x518096=_[_0x4de5('0x22')](_0x4323fb[0x0],0x5,'0');var _0x161305=_0x4323fb['length']===0x2?_[_0x4de5('0x22')](_0x4323fb[0x1],0x5,'0'):_0x518096;_0x1852b5=timeCompare(_0x10bdc6,_0x518096,_0x161305);}let _0x2ad10a=!![];if(_0x12a193!=='*'){var _0x3db2b2=_0x12a193[_0x4de5('0x23')]('-');var _0x2808e7=_0x3db2b2[0x0];var _0x2cfa9a=_0x3db2b2[_0x4de5('0x24')]===0x2?_0x3db2b2[0x1]:_0x2808e7;_0x2ad10a=dowCompare(_0x10bdc6,_0x2808e7,_0x2cfa9a);}let _0x44045c=!![];if(_0x3b6c6b!=='*'){var _0x3e568c=_0x3b6c6b[_0x4de5('0x23')]('-');var _0x438130=parseDom(_0x3e568c[0x0]);var _0x589757=_0x3e568c[_0x4de5('0x24')]===0x2?parseDom(_0x3e568c[0x1]):_0x438130;_0x44045c=domCompare(_0x10bdc6,_0x438130,_0x589757);}let _0x3a9dc7=!![];if(_0x61cf49!=='*'){var _0x1c52d3=_0x61cf49[_0x4de5('0x23')]('-');var _0x2db222=_0x1c52d3[0x0];var _0x5e0d95=_0x1c52d3['length']===0x2?_0x1c52d3[0x1]:_0x1c52d3[0x0];_0x3a9dc7=monthCompare(_0x10bdc6,_0x2db222,_0x5e0d95);}return _0x1852b5&&_0x2ad10a&&_0x44045c&&_0x3a9dc7;}}module[_0x4de5('0xd')][_0x4de5('0x25')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 20d478b..5d22d5c 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1db5=['replace','{{{','}}}','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','Console','warn','transports','File','%s-%s','error','consoleLogger','fileLogger','util','moment','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white','bold\x20white','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','/var/log/xcally','join','format','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1db5,0x86));var _0x51db=function(_0x24466c,_0x19933a){_0x24466c=_0x24466c-0x0;var _0x1752a1=_0x1db5[_0x24466c];return _0x1752a1;};'use strict';var path=require('path');var util=require(_0x51db('0x0'));var moment=require(_0x51db('0x1'));var winston=require('winston');var config=require('../config/environment');var debugLevel=config['debugLevel']?config[_0x51db('0x2')][_0x51db('0x3')]():_0x51db('0x4');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x51db('0x5'),'error':_0x51db('0x6'),'warn':_0x51db('0x7'),'info':_0x51db('0x8'),'print':_0x51db('0x9'),'success':'bold\x20green','http':_0x51db('0xa'),'verbose':_0x51db('0xb'),'debug':_0x51db('0xc'),'silly':_0x51db('0xd')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x5c9cc2,_0xfe7dd0,_0x35da9c){var _0x47bdad=_0x5c9cc2||_0x51db('0xe');return path[_0x51db('0xf')](_0x47bdad,util[_0x51db('0x10')]('%s-%s.log',_0xfe7dd0,_0x35da9c));}function formatter(_0x3d60c2,_0x1ae2de){_0x1ae2de[_0x51db('0x11')]=_0x1ae2de[_0x51db('0x11')][_0x51db('0x12')](/@@{/g,_0x51db('0x13'))[_0x51db('0x12')](/}@@/g,_0x51db('0x14'))[_0x51db('0x12')](/@{/g,'{{')[_0x51db('0x12')](/}@/g,'}}');return util[_0x51db('0x10')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x51db('0x10')](_0x51db('0x15')),_0x1ae2de[_0x51db('0x16')][_0x51db('0x17')](),_0x3d60c2,_0x1ae2de[_0x51db('0x11')]);}function fileFormat(_0x23f7e0,_0x569f4b){_0x569f4b[_0x51db('0x11')]=_0x569f4b[_0x51db('0x11')][_0x51db('0x12')](/@@{/g,'{{{')['replace'](/}@@/g,_0x51db('0x14'))[_0x51db('0x12')](/@{/g,'{{')[_0x51db('0x12')](/}@/g,'}}');var _0x348677=_0x569f4b[_0x51db('0x18')]&&Object[_0x51db('0x19')](_0x569f4b[_0x51db('0x18')])[_0x51db('0x1a')]?'\x0a\x09'+JSON[_0x51db('0x1b')](_0x569f4b[_0x51db('0x18')]):'';return util[_0x51db('0x10')](_0x51db('0x1c'),moment()[_0x51db('0x10')](_0x51db('0x15')),_0x569f4b[_0x51db('0x16')][_0x51db('0x17')](),_0x23f7e0,_0x569f4b[_0x51db('0x11')],_0x348677);}function consoleLogger(){var _0x2381aa=new winston[(_0x51db('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x51db('0x1e'))]({'level':_0x51db('0x1f'),'json':![],'formatter':function(_0x5b9548){return formatter('',_0x5b9548);}})]});return _0x2381aa;}function fileLogger(_0x1b1d53,_0x29f4a1){var _0x1ca858=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x51db('0x20'))][(_0x51db('0x21'))]({'name':util[_0x51db('0x10')](_0x51db('0x22'),_0x1b1d53,'error'),'filename':getLogFileName(_0x29f4a1,_0x1b1d53,_0x51db('0x23')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x6825b0){return fileFormat(_0x1b1d53,_0x6825b0);}}),new winston[(_0x51db('0x20'))][(_0x51db('0x21'))]({'name':util[_0x51db('0x10')]('%s-%s',_0x1b1d53,debugLevel),'filename':getLogFileName(_0x29f4a1,_0x1b1d53,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2fc00f){return fileFormat(_0x1b1d53,_0x2fc00f);}}),new winston[(_0x51db('0x20'))]['Console']({'level':_0x51db('0x1f'),'json':![],'formatter':function(_0x176483){return fileFormat(_0x1b1d53,_0x176483);}})]});return _0x1ca858;}exports[_0x51db('0x24')]=consoleLogger;exports[_0x51db('0x25')]=fileLogger; \ No newline at end of file +var _0x9559=['bold\x20green','gray','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','keys','length','stringify','Logger','transports','Console','warn','File','%s-%s','error','consoleLogger','fileLogger','path','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white','bold\x20white'];(function(_0x12e73c,_0x2cbe1d){var _0x4c41cb=function(_0x10283b){while(--_0x10283b){_0x12e73c['push'](_0x12e73c['shift']());}};_0x4c41cb(++_0x2cbe1d);}(_0x9559,0x144));var _0x9955=function(_0x37d0bc,_0x109b96){_0x37d0bc=_0x37d0bc-0x0;var _0x170e60=_0x9559[_0x37d0bc];return _0x170e60;};'use strict';var path=require(_0x9955('0x0'));var util=require('util');var moment=require(_0x9955('0x1'));var winston=require(_0x9955('0x2'));var config=require(_0x9955('0x3'));var debugLevel=config['debugLevel']?config[_0x9955('0x4')][_0x9955('0x5')]():_0x9955('0x6');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x9955('0x7'),'error':_0x9955('0x8'),'warn':_0x9955('0x9'),'info':_0x9955('0xa'),'print':_0x9955('0xb'),'success':_0x9955('0xc'),'http':_0x9955('0xd'),'verbose':'bold\x20magenta','debug':_0x9955('0xe'),'silly':_0x9955('0xf')};winston[_0x9955('0x10')](XC_LOG_COLORS);function getLogFileName(_0x5625e1,_0x1d3cc5,_0x5f33be){var _0x8ef176=_0x5625e1||_0x9955('0x11');return path[_0x9955('0x12')](_0x8ef176,util[_0x9955('0x13')](_0x9955('0x14'),_0x1d3cc5,_0x5f33be));}function formatter(_0x3c1d79,_0x3ccfea){_0x3ccfea[_0x9955('0x15')]=_0x3ccfea[_0x9955('0x15')][_0x9955('0x16')](/@@{/g,_0x9955('0x17'))['replace'](/}@@/g,_0x9955('0x18'))['replace'](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x9955('0x13')](_0x9955('0x19'),moment()['format'](_0x9955('0x1a')),_0x3ccfea[_0x9955('0x1b')][_0x9955('0x1c')](),_0x3c1d79,_0x3ccfea[_0x9955('0x15')]);}function fileFormat(_0xbb3cfc,_0x2403c2){_0x2403c2['message']=_0x2403c2[_0x9955('0x15')][_0x9955('0x16')](/@@{/g,_0x9955('0x17'))['replace'](/}@@/g,_0x9955('0x18'))[_0x9955('0x16')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x4c8608=_0x2403c2[_0x9955('0x1d')]&&Object[_0x9955('0x1e')](_0x2403c2[_0x9955('0x1d')])[_0x9955('0x1f')]?'\x0a\x09'+JSON[_0x9955('0x20')](_0x2403c2['meta']):'';return util[_0x9955('0x13')]('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()[_0x9955('0x13')](_0x9955('0x1a')),_0x2403c2[_0x9955('0x1b')][_0x9955('0x1c')](),_0xbb3cfc,_0x2403c2['message'],_0x4c8608);}function consoleLogger(){var _0x4e3f9f=new winston[(_0x9955('0x21'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x9955('0x22'))][(_0x9955('0x23'))]({'level':_0x9955('0x24'),'json':![],'formatter':function(_0x13dbf7){return formatter('',_0x13dbf7);}})]});return _0x4e3f9f;}function fileLogger(_0x1ad6ea,_0x4edbfe){var _0x72b96f=new winston[(_0x9955('0x21'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x9955('0x25'))]({'name':util[_0x9955('0x13')](_0x9955('0x26'),_0x1ad6ea,_0x9955('0x27')),'filename':getLogFileName(_0x4edbfe,_0x1ad6ea,'error'),'level':_0x9955('0x27'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4dc064){return fileFormat(_0x1ad6ea,_0x4dc064);}}),new winston['transports'][(_0x9955('0x25'))]({'name':util[_0x9955('0x13')](_0x9955('0x26'),_0x1ad6ea,debugLevel),'filename':getLogFileName(_0x4edbfe,_0x1ad6ea,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4d5dc5){return fileFormat(_0x1ad6ea,_0x4d5dc5);}}),new winston[(_0x9955('0x22'))][(_0x9955('0x23'))]({'level':'warn','json':![],'formatter':function(_0x194ed2){return fileFormat(_0x1ad6ea,_0x194ed2);}})]});return _0x72b96f;}exports[_0x9955('0x28')]=consoleLogger;exports[_0x9955('0x29')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 57958ea..ac1ce9f 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['tenantId','token','channelSecret','accessTokenSecret','authToken','consumerKey','membername','exten','vidaooApiKey','privateKey','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','exports','lodash','username','password','newPassword','apiKey','firstName','lastName','street','fax','email','clientId','clientSecret','securityToken','code'];(function(_0x20bd7a,_0x15aed9){var _0x22bad3=function(_0x4f0150){while(--_0x4f0150){_0x20bd7a['push'](_0x20bd7a['shift']());}};_0x22bad3(++_0x15aed9);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1511fb,_0x99c62f){_0x1511fb=_0x1511fb-0x0;var _0x259ce2=_0x5f2f[_0x1511fb];return _0x259ce2;};var _=require(_0xf5f2('0x0'));var sensitiveFields=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3'),_0xf5f2('0x4'),_0xf5f2('0x5'),_0xf5f2('0x6'),_0xf5f2('0x7'),'phone','mobile',_0xf5f2('0x8'),_0xf5f2('0x9'),_0xf5f2('0xa'),_0xf5f2('0xb'),_0xf5f2('0xc'),_0xf5f2('0xd'),'accessKey',_0xf5f2('0xe'),_0xf5f2('0xf'),_0xf5f2('0x10'),'accessToken',_0xf5f2('0x11'),_0xf5f2('0x12'),_0xf5f2('0x13'),'consumerSecret',_0xf5f2('0x14'),'calleridname','calleridnum',_0xf5f2('0x15'),_0xf5f2('0x16'),'clientEmail',_0xf5f2('0x17'),_0xf5f2('0x18'),_0xf5f2('0x19'),_0xf5f2('0x1a'),_0xf5f2('0x1b'),_0xf5f2('0x1c'),'accountSid',_0xf5f2('0x1d'),_0xf5f2('0x1e'),_0xf5f2('0x1f'),_0xf5f2('0x20'),_0xf5f2('0x21')];function maskSensitiveData(_0x4d97fc){const _0xafe430=/(?!^)[\s\S](?!$)/g;if(_[_0xf5f2('0x22')](_0x4d97fc)){for(const _0x17d656 in _0x4d97fc){if(_[_0xf5f2('0x23')](_0x4d97fc[_0x17d656])){for(let _0x23e23a=0x0;_0x23e23a<_0x4d97fc[_0x17d656][_0xf5f2('0x24')];_0x23e23a++){maskSensitiveData(_0x4d97fc[_0x17d656][_0x23e23a]);}}else if(_[_0xf5f2('0x22')](_0x4d97fc[_0x17d656])){maskSensitiveData(_0x4d97fc[_0x17d656]);}else if(_[_0xf5f2('0x25')](_0x4d97fc[_0x17d656])){_0x4d97fc[_0x17d656]=_0x4d97fc[_0x17d656][_0xf5f2('0x26')](/{{{/g,_0xf5f2('0x27'))[_0xf5f2('0x26')](/}}}/g,_0xf5f2('0x28'))[_0xf5f2('0x26')](/{{/g,'@{')[_0xf5f2('0x26')](/}}/g,'}@');if(_[_0xf5f2('0x29')](sensitiveFields,_0x17d656)){_0x4d97fc[_0x17d656]=_0x4d97fc[_0x17d656][_0xf5f2('0x26')](_0xafe430,'*');}}}}}module[_0xf5f2('0x2a')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0x57ca=['accesskeyid','secretaccesskey','key','user','accountSid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','@@{','replace','}@@','includes','exports','username','password','apiKey','firstName','lastName','street','phone','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessTokenSecret','authToken','consumerSecret','calleridname','calleridnum','vidaooApiKey','privateKey'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x57ca,0x108));var _0xa57c=function(_0xeef081,_0x410eb3){_0xeef081=_0xeef081-0x0;var _0x5739e0=_0x57ca[_0xeef081];return _0x5739e0;};var _=require('lodash');var sensitiveFields=[_0xa57c('0x0'),_0xa57c('0x1'),'newPassword',_0xa57c('0x2'),_0xa57c('0x3'),_0xa57c('0x4'),_0xa57c('0x5'),_0xa57c('0x6'),'mobile',_0xa57c('0x7'),_0xa57c('0x8'),_0xa57c('0x9'),_0xa57c('0xa'),_0xa57c('0xb'),_0xa57c('0xc'),_0xa57c('0xd'),_0xa57c('0xe'),'token',_0xa57c('0xf'),'accessToken',_0xa57c('0x10'),_0xa57c('0x11'),'consumerKey',_0xa57c('0x12'),'membername',_0xa57c('0x13'),_0xa57c('0x14'),'exten',_0xa57c('0x15'),'clientEmail',_0xa57c('0x16'),_0xa57c('0x17'),_0xa57c('0x18'),_0xa57c('0x19'),_0xa57c('0x1a'),'pass',_0xa57c('0x1b'),'localstationid',_0xa57c('0x1c'),_0xa57c('0x1d'),_0xa57c('0x1e'),_0xa57c('0x1f')];function maskSensitiveData(_0x3238ff){const _0x37a323=/(?!^)[\s\S](?!$)/g;if(_[_0xa57c('0x20')](_0x3238ff)){for(const _0x4b4bdb in _0x3238ff){if(_[_0xa57c('0x21')](_0x3238ff[_0x4b4bdb])){for(let _0xdf7ff6=0x0;_0xdf7ff6<_0x3238ff[_0x4b4bdb][_0xa57c('0x22')];_0xdf7ff6++){maskSensitiveData(_0x3238ff[_0x4b4bdb][_0xdf7ff6]);}}else if(_['isPlainObject'](_0x3238ff[_0x4b4bdb])){maskSensitiveData(_0x3238ff[_0x4b4bdb]);}else if(_[_0xa57c('0x23')](_0x3238ff[_0x4b4bdb])){_0x3238ff[_0x4b4bdb]=_0x3238ff[_0x4b4bdb]['replace'](/{{{/g,_0xa57c('0x24'))[_0xa57c('0x25')](/}}}/g,_0xa57c('0x26'))[_0xa57c('0x25')](/{{/g,'@{')[_0xa57c('0x25')](/}}/g,'}@');if(_[_0xa57c('0x27')](sensitiveFields,_0x4b4bdb)){_0x3238ff[_0x4b4bdb]=_0x3238ff[_0x4b4bdb][_0xa57c('0x25')](_0x37a323,'*');}}}}}module[_0xa57c('0x28')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index d08ce12..36398a7 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x80ed=['replace','isArray','map','isPlainObject','keys','reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string'];(function(_0x33e93d,_0x1a8423){var _0x19e99d=function(_0x194faa){while(--_0x194faa){_0x33e93d['push'](_0x33e93d['shift']());}};_0x19e99d(++_0x1a8423);}(_0x80ed,0x11c));var _0xd80e=function(_0x27b751,_0x46286c){_0x27b751=_0x27b751-0x0;var _0x45c321=_0x80ed[_0x27b751];return _0x45c321;};var _=require(_0xd80e('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x5a14b2){return _0x5a14b2==='{{'?_0xd80e('0x1'):_0xd80e('0x2');}function safeTemplate(_0x4329e5){var _0x5052d7=_0x4329e5;if(typeof _0x4329e5===_0xd80e('0x3')){_0x5052d7=_0x4329e5[_0xd80e('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xd80e('0x5')](_0x4329e5)){_0x5052d7=_0x4329e5[_0xd80e('0x6')](function(_0x5ae6c6){return safeTemplate(_0x5ae6c6);});}else if(_[_0xd80e('0x7')](_0x4329e5)){_0x5052d7=Object[_0xd80e('0x8')](_0x4329e5)[_0xd80e('0x9')](function(_0x51c361,_0x411b3a){_0x51c361[_0x411b3a]=safeTemplate(_0x4329e5[_0x411b3a]);return _0x51c361;},{});}return _0x5052d7;}module[_0xd80e('0xa')][_0xd80e('0xb')]=safeTemplate; \ No newline at end of file +var _0x80ed=['replace','isArray','map','isPlainObject','keys','reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string'];(function(_0x39efbf,_0x118364){var _0xcbd510=function(_0x4e152f){while(--_0x4e152f){_0x39efbf['push'](_0x39efbf['shift']());}};_0xcbd510(++_0x118364);}(_0x80ed,0x11c));var _0xd80e=function(_0x36b7f2,_0x174201){_0x36b7f2=_0x36b7f2-0x0;var _0x55a8ff=_0x80ed[_0x36b7f2];return _0x55a8ff;};var _=require(_0xd80e('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x5a14b2){return _0x5a14b2==='{{'?_0xd80e('0x1'):_0xd80e('0x2');}function safeTemplate(_0x4329e5){var _0x5052d7=_0x4329e5;if(typeof _0x4329e5===_0xd80e('0x3')){_0x5052d7=_0x4329e5[_0xd80e('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xd80e('0x5')](_0x4329e5)){_0x5052d7=_0x4329e5[_0xd80e('0x6')](function(_0x5ae6c6){return safeTemplate(_0x5ae6c6);});}else if(_[_0xd80e('0x7')](_0x4329e5)){_0x5052d7=Object[_0xd80e('0x8')](_0x4329e5)[_0xd80e('0x9')](function(_0x51c361,_0x411b3a){_0x51c361[_0x411b3a]=safeTemplate(_0x4329e5[_0x411b3a]);return _0x51c361;},{});}return _0x5052d7;}module[_0xd80e('0xa')][_0xd80e('0xb')]=safeTemplate; \ No newline at end of file diff --git a/snippet/3.1.0/assets/images/00fe515d7113c2841e5d.svg b/snippet/3.0.0/assets/images/00fe515d7113c2841e5d.svg similarity index 100% rename from snippet/3.1.0/assets/images/00fe515d7113c2841e5d.svg rename to snippet/3.0.0/assets/images/00fe515d7113c2841e5d.svg diff --git a/snippet/3.1.0/assets/images/3b24a6b94b2631f4d565.svg b/snippet/3.0.0/assets/images/3b24a6b94b2631f4d565.svg similarity index 100% rename from snippet/3.1.0/assets/images/3b24a6b94b2631f4d565.svg rename to snippet/3.0.0/assets/images/3b24a6b94b2631f4d565.svg diff --git a/snippet/3.1.0/assets/images/c9f502ad417b1b987198.svg b/snippet/3.0.0/assets/images/c9f502ad417b1b987198.svg similarity index 100% rename from snippet/3.1.0/assets/images/c9f502ad417b1b987198.svg rename to snippet/3.0.0/assets/images/c9f502ad417b1b987198.svg diff --git a/snippet/3.1.0/index.html b/snippet/3.0.0/index.html similarity index 69% rename from snippet/3.1.0/index.html rename to snippet/3.0.0/index.html index ed7f7b2..ed8eb58 100644 --- a/snippet/3.1.0/index.html +++ b/snippet/3.0.0/index.html @@ -26,4 +26,4 @@ status != 'online' && status != 'offline' && status != 'unmanaged' - " ng-click="vm.close(); $event.stopPropagation();">
\ No newline at end of file + " ng-click="vm.close(); $event.stopPropagation();">
\ No newline at end of file diff --git a/snippet/3.1.0/scripts/app.js b/snippet/3.0.0/scripts/app.js similarity index 100% rename from snippet/3.1.0/scripts/app.js rename to snippet/3.0.0/scripts/app.js diff --git a/snippet/3.1.0/scripts/app.js.LICENSE.txt b/snippet/3.0.0/scripts/app.js.LICENSE.txt similarity index 100% rename from snippet/3.1.0/scripts/app.js.LICENSE.txt rename to snippet/3.0.0/scripts/app.js.LICENSE.txt diff --git a/snippet/3.0.0/scripts/chat.js b/snippet/3.0.0/scripts/chat.js new file mode 100644 index 0000000..dae50a6 --- /dev/null +++ b/snippet/3.0.0/scripts/chat.js @@ -0,0 +1,3 @@ +/*! For license information please see chat.js.LICENSE.txt */ +(self.webpackChunkmotion_chat=self.webpackChunkmotion_chat||[]).push([["chat"],{"./node_modules/@flowjs/ng-flow/dist/ng-flow.js":(e,t,n)=>{var o=n("./node_modules/@flowjs/flow.js/src/flow.js");angular.module("flow.provider",[]).provider("flowFactory",(function(){"use strict";this.defaults={},this.factory=function(e){return new o(e)},this.events=[],this.on=function(e,t){this.events.push([e,t])},this.$get=function(){var e=this.factory,t=this.defaults,n=this.events;return{create:function(o){var r=e(angular.extend({},t,o));return angular.forEach(n,(function(e){r.on(e[0],e[1])})),r}}}})),angular.module("flow.init",["flow.provider"]).controller("flowCtrl",["$scope","$attrs","$parse","flowFactory",function(e,t,n,o){var r=angular.extend({},e.$eval(t.flowInit)),s=e.$eval(t.flowObject)||o.create(r),a=function(t){var n=Array.prototype.slice.call(arguments);n.shift();var o=e.$broadcast.apply(e,["flow::"+t,s].concat(n));if({progress:1,filesSubmitted:1,fileSuccess:1,fileError:1,complete:1}[t]&&e.$applyAsync(),o.defaultPrevented)return!1};s.on("catchAll",a),e.$on("$destroy",(function(){s.off("catchAll",a)})),e.$flow=s,t.hasOwnProperty("flowName")&&(n(t.flowName).assign(e,s),e.$on("$destroy",(function(){n(t.flowName).assign(e)})))}]).directive("flowInit",[function(){return{scope:!0,controller:"flowCtrl"}}]),angular.module("flow.btn",["flow.init"]).directive("flowBtn",[function(){return{restrict:"EA",scope:!1,require:"^flowInit",link:function(e,t,n){var o=n.hasOwnProperty("flowDirectory"),r=n.hasOwnProperty("flowSingleFile"),s=n.hasOwnProperty("flowAttrs")&&e.$eval(n.flowAttrs);e.$flow.assignBrowse(t,o,r,s)}}}]),angular.module("flow.dragEvents",["flow.init"]).directive("flowPreventDrop",(function(){return{scope:!1,link:function(e,t,n){t.bind("drop dragover",(function(e){e.preventDefault()}))}}})).directive("flowDragEnter",["$timeout",function(e){return{scope:!1,link:function(t,n,o){var r,s=!1;n.bind("dragover",(function(n){var a,i,d;i=!1,d=(a=n).dataTransfer||a.originalEvent.dataTransfer,angular.forEach(d&&d.types,(function(e){"Files"===e&&(i=!0)})),i&&(s||(t.$apply(o.flowDragEnter),s=!0),e.cancel(r),n.preventDefault())})),n.bind("dragleave drop",(function(n){e.cancel(r),r=e((function(){t.$eval(o.flowDragLeave),r=null,s=!1}),100)}))}}}]),angular.module("flow.drop",["flow.init"]).directive("flowDrop",(function(){return{scope:!1,require:"^flowInit",link:function(e,t,n){function o(){e.$flow.assignDrop(t)}n.flowDropEnabled?e.$watch(n.flowDropEnabled,(function(n){n?o():e.$flow.unAssignDrop(t)})):o()}}})),function(e){"use strict";var t=e.module("flow.events",["flow.init"]);e.forEach({fileSuccess:["$file","$message"],fileProgress:["$file"],fileAdded:["$file","$event"],filesAdded:["$files","$event"],filesSubmitted:["$files","$event"],fileRetry:["$file"],fileRemoved:["$file"],fileError:["$file","$message"],uploadStart:[],complete:[],progress:[],error:["$message","$file"]},(function(n,o){var r,s="flow"+((r=o).charAt(0).toUpperCase()+r.slice(1));"flowUploadStart"==s&&(s="flowUploadStarted"),t.directive(s,[function(){return{require:"^flowInit",controller:["$scope","$attrs",function(t,r){t.$on("flow::"+o,(function(){var o=Array.prototype.slice.call(arguments),a=o.shift();if(t.$flow===o.shift()){var i={};e.forEach(n,(function(e,t){i[e]=o[t]})),!1===t.$eval(r[s],i)&&a.preventDefault()}}))}]}}])}))}(angular),angular.module("flow.img",["flow.init"]).directive("flowImg",[function(){return{scope:!1,require:"^flowInit",link:function(e,t,n){var o=n.flowImg;e.$watch(o,(function(t){if(t){var o=new FileReader;o.readAsDataURL(t.file),o.onload=function(t){e.$apply((function(){n.$set("src",t.target.result)}))}}}))}}}]),angular.module("flow.transfers",["flow.init"]).directive("flowTransfers",[function(){return{scope:!0,require:"^flowInit",link:function(e){e.transfers=e.$flow.files}}}]),angular.module("flow",["flow.provider","flow.init","flow.events","flow.btn","flow.drop","flow.transfers","flow.img","flow.dragEvents"])},"./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js":(e,t,n)=>{"use strict";var o,r=n("./node_modules/@uirouter/core/lib-esm/index.js"),s=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js"),a=n("./node_modules/@uirouter/angularjs/lib-esm/services.js"),i=n("./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js");function d(e,t,n,o,i){var d=(0,r.parse)("viewDecl.controllerAs"),u=(0,r.parse)("viewDecl.resolveAs");return{restrict:"ECA",priority:-400,compile:function(o){var m=o.html();return o.empty(),function(o,_){var c=_.data("$uiView");if(!c)return _.html(m),void e(_.contents())(o);var h=c.$cfg||{viewDecl:{},getTemplate:r.noop},f=h.path&&new r.ResolveContext(h.path);_.html(h.getTemplate(_,f)||m),r.trace.traceUIViewFill(c.$uiView,_.html());var p=e(_.contents()),M=h.controller,y=d(h),L=u(h),Y=f&&(0,a.D)(f);if(o[L]=Y,M){var g=t(M,(0,r.extend)({},Y,{$scope:o,$element:_}));y&&(o[y]=g,o[y][L]=Y),_.data("$ngControllerController",g),_.children().data("$ngControllerController",g),l(i,n,g,o,h)}if((0,r.isString)(h.component))var v=(0,r.kebobString)(h.component),k=new RegExp("^(x-|data-)?"+v+"$","i"),j=o.$watch((function(){var e=[].slice.call(_[0].children).filter((function(e){return e&&e.tagName&&k.exec(e.tagName)}));return e&&s.ng.element(e).data("$"+h.component+"Controller")}),(function(e){e&&(l(i,n,e,o,h),j())}));p(o)}}}}o=["$view","$animate","$uiViewScroll","$interpolate","$q",function(e,t,n,o,a){var d={$cfg:{viewDecl:{$context:e._pluginapi._rootViewContext()}},$uiView:{}},u={count:0,restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(m,l,_){return function(m,l,c){var h,f,p,M,y=c.onload||"",L=c.autoscroll,Y=function(e,n,o){s.ng.version.minor>2?t.enter(e,null,n).then(o):t.enter(e,null,n,o)},g=function(e,n){s.ng.version.minor>2?t.leave(e).then(n):t.leave(e,n)},v=l.inheritedData("$uiView")||d,k=o(c.uiView||c.name||"")(m)||"$default",j={$type:"ng1",id:u.count++,name:k,fqn:v.$uiView.fqn?v.$uiView.fqn+"."+k:k,config:null,configUpdated:function(e){(!e||e instanceof i.qO)&&(M!==e&&(r.trace.traceUIViewConfigUpdated(j,e&&e.viewDecl&&e.viewDecl.$context),M=e,b(e)))},get creationContext(){var e=(0,r.parse)("$cfg.viewDecl.$context")(v),t=(0,r.parse)("$uiView.creationContext")(v);return e||t}};r.trace.traceUIViewEvent("Linking",j),l.data("$uiView",{$uiView:j}),b();var w=e.registerUIView(j);function b(e){var t=m.$new(),o=a.defer(),s=a.defer(),i={$cfg:e,$uiView:j},d={$animEnter:o.promise,$animLeave:s.promise,$$animLeave:s};t.$emit("$viewContentLoading",k);var u=_(t,(function(e){e.data("$uiViewAnim",d),e.data("$uiView",i),Y(e,l,(function(){o.resolve(),p&&p.$emit("$viewContentAnimationEnded"),((0,r.isDefined)(L)&&!L||m.$eval(L))&&n(e)})),function(){if(h&&(r.trace.traceUIViewEvent("Removing (previous) el",h.data("$uiView")),h.remove(),h=null),p&&(r.trace.traceUIViewEvent("Destroying scope",j),p.$destroy(),p=null),f){var e=f.data("$uiViewAnim");r.trace.traceUIViewEvent("Animate out",e),g(f,(function(){e.$$animLeave.resolve(),h=null})),h=f,f=null}}()}));f=u,(p=t).$emit("$viewContentLoaded",e||M),p.$eval(y)}m.$on("$destroy",(function(){r.trace.traceUIViewEvent("Destroying/Unregistering",j),w()}))}}};return u}],d.$inject=["$compile","$controller","$transitions","$view","$q"];var u="function"==typeof s.ng.module("ui.router").component,m=0;function l(e,t,n,o,s){!(0,r.isFunction)(n.$onInit)||(s.viewDecl.component||s.viewDecl.componentProvider)&&u||n.$onInit();var a=(0,r.tail)(s.path).state.self,i={bind:n};if((0,r.isFunction)(n.uiOnParamsChanged)){var d=new r.ResolveContext(s.path).getResolvable("$transition$").data;o.$on("$destroy",t.onSuccess({},(function(e){if(e!==d&&-1===e.exiting().indexOf(a)){var t=e.params("to"),o=e.params("from"),s=function(e){return e.paramSchema},i=e.treeChanges("to").map(s).reduce(r.unnestR,[]),u=e.treeChanges("from").map(s).reduce(r.unnestR,[]),m=i.filter((function(e){var n=u.indexOf(e);return-1===n||!u[n].type.equals(t[e.id],o[e.id])}));if(m.length){var l=m.map((function(e){return e.id})),_=(0,r.filter)(t,(function(e,t){return-1!==l.indexOf(t)}));n.uiOnParamsChanged(_,e)}}}),i))}if((0,r.isFunction)(n.uiCanExit)){var l=m++,_="_uiCanExitIds",c=function(e){return!!e&&(e[_]&&!0===e[_][l]||c(e.redirectedFrom()))},h={exiting:a.name};o.$on("$destroy",t.onBefore(h,(function(t){var o,r=t[_]=t[_]||{};return c(t)||(o=e.when(n.uiCanExit(t))).then((function(e){return r[l]=!1!==e})),o}),i))}}s.ng.module("ui.router.state").directive("uiView",o),s.ng.module("ui.router.state").directive("uiView",d)},"./node_modules/@uirouter/angularjs/lib-esm/services.js":(e,t,n)=>{"use strict";n.d(t,{D:()=>k});var o=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js"),r=n("./node_modules/@uirouter/core/lib-esm/index.js"),s=n("./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js"),a=function(){function e(){var e=this;this._useHttp=o.ng.version.minor<3,this.$get=["$http","$templateCache","$injector",function(t,n,o){return e.$templateRequest=o.has&&o.has("$templateRequest")&&o.get("$templateRequest"),e.$http=t,e.$templateCache=n,e}]}return e.prototype.useHttpService=function(e){this._useHttp=e},e.prototype.fromConfig=function(e,t,n){var o=function(e){return r.services.$q.when(e).then((function(e){return{template:e}}))},s=function(e){return r.services.$q.when(e).then((function(e){return{component:e}}))};return(0,r.isDefined)(e.template)?o(this.fromString(e.template,t)):(0,r.isDefined)(e.templateUrl)?o(this.fromUrl(e.templateUrl,t)):(0,r.isDefined)(e.templateProvider)?o(this.fromProvider(e.templateProvider,t,n)):(0,r.isDefined)(e.component)?s(e.component):(0,r.isDefined)(e.componentProvider)?s(this.fromComponentProvider(e.componentProvider,t,n)):o("")},e.prototype.fromString=function(e,t){return(0,r.isFunction)(e)?e(t):e},e.prototype.fromUrl=function(e,t){return(0,r.isFunction)(e)&&(e=e(t)),null==e?null:this._useHttp?this.$http.get(e,{cache:this.$templateCache,headers:{Accept:"text/html"}}).then((function(e){return e.data})):this.$templateRequest(e)},e.prototype.fromProvider=function(e,t,n){var o=r.services.$injector.annotate(e),s=(0,r.isArray)(e)?(0,r.tail)(e):e;return new r.Resolvable("",s,o).get(n)},e.prototype.fromComponentProvider=function(e,t,n){var o=r.services.$injector.annotate(e),s=(0,r.isArray)(e)?(0,r.tail)(e):e;return new r.Resolvable("",s,o).get(n)},e.prototype.makeComponentTemplate=function(e,t,n,s){s=s||{};var a=o.ng.version.minor>=3?"::":"",d=function(e){var t=(0,r.kebobString)(e);return/^(x|data)-/.exec(t)?"x-"+t:t},u=function(e){var t=r.services.$injector.get(e+"Directive");if(!t||!t.length)throw new Error("Unable to find component named '"+e+"'");return t.map(i).reduce(r.unnestR,[])}(n).map((function(n){var o=n.name,i=n.type,u=d(o);if(e.attr(u)&&!s[o])return u+"='"+e.attr(u)+"'";var m=s[o]||o;if("@"===i)return u+"='{{"+a+"$resolve."+m+"}}'";if("&"===i){var l=t.getResolvable(m),_=l&&l.data,c=_&&r.services.$injector.annotate(_)||[];return u+"='$resolve."+m+((0,r.isArray)(_)?"["+(_.length-1)+"]":"")+"("+c.join(",")+")'"}return u+"='"+a+"$resolve."+m+"'"})).join(" "),m=d(n);return"<"+m+" "+u+">"},e}(),i=function(e){return(0,r.isObject)(e.bindToController)?d(e.bindToController):d(e.scope)},d=function(e){return Object.keys(e||{}).map((function(t){return[t,/^([=<@&])[?]?(.*)/.exec(e[t])]})).filter((function(e){return(0,r.isDefined)(e)&&(0,r.isArray)(e[1])})).map((function(e){return{name:e[1][2]||e[0],type:e[1][1]}}))},u=n("./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js"),m=function(e){return function(t){var n=t[e],o="onExit"===e?"from":"to";return n?function(e,t){var s=new r.ResolveContext(e.treeChanges(o)).subContext(t.$$state()),a=(0,r.extend)(k(s),{$state$:t,$transition$:e});return r.services.$injector.invoke(n,this,a)}:void 0}},l=function(){function e(e){this._urlListeners=[],this.$locationProvider=e;var t=(0,r.val)(e);(0,r.createProxyFunctions)(t,this,t,["hashPrefix"])}return e.monkeyPatchPathParameterType=function(e){var t=e.urlMatcherFactory.type("path");t.encode=function(e){return null!=e?e.toString().replace(/(~|\/)/g,(function(e){return{"~":"~~","/":"~2F"}[e]})):e},t.decode=function(e){return null!=e?e.toString().replace(/(~~|~2F)/g,(function(e){return{"~~":"~","~2F":"/"}[e]})):e}},e.prototype.dispose=function(){},e.prototype.onChange=function(e){var t=this;return this._urlListeners.push(e),function(){return(0,r.removeFrom)(t._urlListeners)(e)}},e.prototype.html5Mode=function(){var e=this.$locationProvider.html5Mode();return(e=(0,r.isObject)(e)?e.enabled:e)&&this.$sniffer.history},e.prototype.baseHref=function(){return this._baseHref||(this._baseHref=this.$browser.baseHref()||this.$window.location.pathname)},e.prototype.url=function(e,t,n){return void 0===t&&(t=!1),(0,r.isDefined)(e)&&this.$location.url(e),t&&this.$location.replace(),n&&this.$location.state(n),this.$location.url()},e.prototype._runtimeServices=function(e,t,n,o,s){var a=this;this.$location=t,this.$sniffer=n,this.$browser=o,this.$window=s,e.$on("$locationChangeSuccess",(function(e){return a._urlListeners.forEach((function(t){return t(e)}))}));var i=(0,r.val)(t);(0,r.createProxyFunctions)(i,this,i,["replace","path","search","hash"]),(0,r.createProxyFunctions)(i,this,i,["port","protocol","host"])},e}(),_=n("./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js");o.ng.module("ui.router.angular1",[]);var c=o.ng.module("ui.router.init",["ng"]),h=o.ng.module("ui.router.util",["ui.router.init"]),f=o.ng.module("ui.router.router",["ui.router.util"]),p=o.ng.module("ui.router.state",["ui.router.router","ui.router.util","ui.router.angular1"]),M=o.ng.module("ui.router",["ui.router.init","ui.router.state","ui.router.angular1"]),y=(o.ng.module("ui.router.compat",["ui.router"]),null);function L(e){(y=this.router=new r.UIRouter).stateProvider=new u.X(y.stateRegistry,y.stateService),y.stateRegistry.decorator("views",s.LB),y.stateRegistry.decorator("onExit",m("onExit")),y.stateRegistry.decorator("onRetain",m("onRetain")),y.stateRegistry.decorator("onEnter",m("onEnter")),y.viewService._pluginapi._viewConfigFactory("ng1",(0,s.OB)()),y.urlService.config._decodeParams=!1;var t=y.locationService=y.locationConfig=new l(e);function n(e,n,o,r,s,a,i){return t._runtimeServices(s,e,r,n,o),delete y.router,delete y.$get,y}return l.monkeyPatchPathParameterType(y),y.router=y,y.$get=n,n.$inject=["$location","$browser","$window","$sniffer","$rootScope","$http","$templateCache"],y}L.$inject=["$locationProvider"];var Y=function(e){return["$uiRouterProvider",function(t){var n=t.router[e];return n.$get=function(){return n},n}]};function g(e,t,n){if(r.services.$injector=e,r.services.$q=t,!Object.prototype.hasOwnProperty.call(e,"strictDi"))try{e.invoke((function(e){}))}catch(t){e.strictDi=!!/strict mode/.exec(t&&t.toString())}n.stateRegistry.get().map((function(e){return e.$$state().resolvables})).reduce(r.unnestR,[]).filter((function(e){return"deferred"===e.deps})).forEach((function(t){return t.deps=e.annotate(t.resolveFn,e.strictDi)}))}function v(e){e.$watch((function(){r.trace.approximateDigests++}))}g.$inject=["$injector","$q","$uiRouter"],v.$inject=["$rootScope"],c.provider("$uiRouter",L),f.provider("$urlRouter",["$uiRouterProvider",function(e){return e.urlRouterProvider=new _.L(e)}]),h.provider("$urlService",Y("urlService")),h.provider("$urlMatcherFactory",["$uiRouterProvider",function(){return y.urlMatcherFactory}]),h.provider("$templateFactory",(function(){return new a})),p.provider("$stateRegistry",Y("stateRegistry")),p.provider("$uiRouterGlobals",Y("globals")),p.provider("$transitions",Y("transitionService")),p.provider("$state",["$uiRouterProvider",function(){return(0,r.extend)(y.stateProvider,{$get:function(){return y.stateService}})}]),p.factory("$stateParams",["$uiRouter",function(e){return e.globals.params}]),M.factory("$view",(function(){return y.viewService})),M.service("$trace",(function(){return r.trace})),M.run(v),h.run(["$urlMatcherFactory",function(e){}]),p.run(["$state",function(e){}]),f.run(["$urlRouter",function(e){}]),c.run(g);var k=function(e){return e.getTokens().filter(r.isString).map((function(t){var n=e.getResolvable(t);return[t,"NOWAIT"===e.getPolicy(n).async?n.promise:n.data]})).reduce(r.applyPairs,{})}},"./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js":(e,t,n)=>{"use strict";var o=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js");function r(e){var t=function(t,n,o){return e.is(t,n,o)};return t.$stateful=!0,t}function s(e){var t=function(t,n,o){return e.includes(t,n,o)};return t.$stateful=!0,t}r.$inject=["$state"],s.$inject=["$state"],o.ng.module("ui.router.state").filter("isState",r).filter("includedByState",s)},"./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js":(e,t,n)=>{"use strict";n.d(t,{X:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/index.js"),r=function(){function e(t,n){this.stateRegistry=t,this.stateService=n,(0,o.createProxyFunctions)((0,o.val)(e.prototype),this,(0,o.val)(this))}return e.prototype.decorator=function(e,t){return this.stateRegistry.decorator(e,t)||this},e.prototype.state=function(e,t){return(0,o.isObject)(e)?t=e:t.name=e,this.stateRegistry.register(t),this},e.prototype.onInvalid=function(e){return this.stateService.onInvalid(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js":(e,t,n)=>{"use strict";n.d(t,{OB:()=>r,LB:()=>a,qO:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/index.js");function r(){var e=null;return function(t,n){return e=e||o.services.$injector.get("$templateFactory"),[new d(t,n,e)]}}var s=function(e,t){return e.reduce((function(e,n){return e||(0,o.isDefined)(t[n])}),!1)};function a(e){if(!e.parent)return{};var t=["component","bindings","componentProvider"],n=["templateProvider","templateUrl","template","notify","async"].concat(["controller","controllerProvider","controllerAs","resolveAs"]),r=t.concat(n);if((0,o.isDefined)(e.views)&&s(r,e))throw new Error("State '"+e.name+"' has a 'views' object. It cannot also have \"view properties\" at the state level. Move the following properties into a view (in the 'views' object): "+r.filter((function(t){return(0,o.isDefined)(e[t])})).join(", "));var a={},i=e.views||{$default:(0,o.pick)(e,r)};return(0,o.forEach)(i,(function(r,i){if(i=i||"$default",(0,o.isString)(r)&&(r={component:r}),r=(0,o.extend)({},r),s(t,r)&&s(n,r))throw new Error("Cannot combine: "+t.join("|")+" with: "+n.join("|")+" in stateview: '"+i+"@"+e.name+"'");r.resolveAs=r.resolveAs||"$resolve",r.$type="ng1",r.$context=e,r.$name=i;var d=o.ViewService.normalizeUIViewTarget(r.$context,r.$name);r.$uiViewName=d.uiViewName,r.$uiViewContextAnchor=d.uiViewContextAnchor,a[i]=r})),a}var i=0,d=function(){function e(e,t,n){var o=this;this.path=e,this.viewDecl=t,this.factory=n,this.$id=i++,this.loaded=!1,this.getTemplate=function(e,t){return o.component?o.factory.makeComponentTemplate(e,t,o.component,o.viewDecl.bindings):o.template}}return e.prototype.load=function(){var e=this,t=o.services.$q,n=new o.ResolveContext(this.path),r=this.path.reduce((function(e,t){return(0,o.extend)(e,t.paramValues)}),{}),s={template:t.when(this.factory.fromConfig(this.viewDecl,r,n)),controller:t.when(this.getController(n))};return t.all(s).then((function(t){return o.trace.traceViewServiceEvent("Loaded",e),e.controller=t.controller,(0,o.extend)(e,t.template),e}))},e.prototype.getController=function(e){var t=this.viewDecl.controllerProvider;if(!(0,o.isInjectable)(t))return this.viewDecl.controller;var n=o.services.$injector.annotate(t),r=(0,o.isArray)(t)?(0,o.tail)(t):t;return new o.Resolvable("",r,n).get(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/index.js"),r=function(){function e(e){this.router=e}return e.injectableHandler=function(e,t){return function(n){return o.services.$injector.invoke(t,null,{$match:n,$stateParams:e.globals.params})}},e.prototype.$get=function(){var e=this.router.urlService;return this.router.urlRouter.update(!0),e.interceptDeferred||e.listen(),this.router.urlRouter},e.prototype.rule=function(e){var t=this;if(!(0,o.isFunction)(e))throw new Error("'rule' must be a function");var n=new o.BaseUrlRule((function(){return e(o.services.$injector,t.router.locationService)}),o.identity);return this.router.urlService.rules.rule(n),this},e.prototype.otherwise=function(e){var t=this,n=this.router.urlService.rules;if((0,o.isString)(e))n.otherwise(e);else{if(!(0,o.isFunction)(e))throw new Error("'rule' must be a string or function");n.otherwise((function(){return e(o.services.$injector,t.router.locationService)}))}return this},e.prototype.when=function(t,n){return((0,o.isArray)(n)||(0,o.isFunction)(n))&&(n=e.injectableHandler(this.router,n)),this.router.urlService.rules.when(t,n),this},e.prototype.deferIntercept=function(e){this.router.urlService.deferIntercept(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/angularjs/lib-esm/angular.js").ng.module("ui.router.state").provider("$uiViewScroll",(function(){var e=!1;this.useAnchorScroll=function(){e=!0},this.$get=["$anchorScroll","$timeout",function(t,n){return e?t:function(e){return n((function(){e[0].scrollIntoView()}),0,!1)}}]}))},"./node_modules/@uirouter/core/lib-esm/common/common.js":(e,t,n)=>{"use strict";n.d(t,{Jz:()=>i,xZ:()=>u,Qs:()=>m,Ed:()=>l,l7:()=>_,fS:()=>c,yR:()=>h,ZT:()=>f,WR:()=>p,ED:()=>M,d3:()=>y,nA:()=>L,LH:()=>Y,Wk:()=>g,ce:()=>v,LQ:()=>k,mX:()=>j,ei:()=>w,CE:()=>b,hX:()=>D,sE:()=>T,js:()=>S,UI:()=>H,VO:()=>x,XC:()=>E,o8:()=>P,M7:()=>O,FN:()=>$,Ez:()=>A,v_:()=>F,UW:()=>R,sp:()=>W,ym:()=>C,bb:()=>z,Gb:()=>I,JG:()=>J,HX:()=>V,jv:()=>N});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),a=function(){for(var e=0,t=0,n=arguments.length;t=0&&e.splice(n,1),e})),Y=(0,r.WA)((function(e,t){return e.push(t),t})),g=function(e){return e.slice().forEach((function(t){"function"==typeof t&&t(),L(e,t)}))};function v(e){for(var t=[],n=1;n{"use strict";n.d(t,{H:()=>o,u:()=>r});var o=function(e,t){return t.reduce((function(t,n){return t[n]=(o=e+"."+n+"()",function(){throw new Error("No implementation for "+o+". The framework specific code did not implement this method.")}),t;var o}),{})},r={$q:void 0,$injector:void 0}},"./node_modules/@uirouter/core/lib-esm/common/glob.js":(e,t,n)=>{"use strict";n.d(t,{r:()=>o});var o=function(){function e(e){this.text=e,this.glob=e.split(".");var t=this.text.split(".").map((function(e){return"**"===e?"(?:|(?:\\.[^.]*)*)":"*"===e?"\\.[^.]*":"\\."+e})).join("");this.regexp=new RegExp("^"+t+"$")}return e.is=function(e){return!!/[!,*]+/.exec(e)},e.fromString=function(t){return e.is(t)?new e(t):null},e.prototype.matches=function(e){return this.regexp.test("."+e)},e}()},"./node_modules/@uirouter/core/lib-esm/common/hof.js":(e,t,n)=>{"use strict";n.d(t,{WA:()=>r,zG:()=>a,vg:()=>i,OH:()=>d,Qc:()=>u,ff:()=>m,xD:()=>l,or:()=>_,$6:()=>c,Yj:()=>h,is:()=>f,P0:()=>p,uj:()=>M});var o=function(){for(var e=0,t=0,n=arguments.length;t=e.length)return e.apply(this,arguments);var n=Array.prototype.slice.call(arguments);return t.bind.apply(t,o([this],n))}}function s(){var e=arguments,t=e.length-1;return function(){for(var n=t,o=e[t].apply(this,arguments);n--;)o=e[n].call(this,o);return o}}function a(){for(var e=[],t=0;t{"use strict";n.d(t,{o8:()=>a,$K:()=>i,Ft:()=>d,le:()=>u,mf:()=>m,hj:()=>l,HD:()=>_,Kn:()=>c,kJ:()=>h,J_:()=>f,Kj:()=>p,Qh:()=>M,tI:()=>y});var o=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),r=Object.prototype.toString,s=function(e){return function(t){return typeof t===e}},a=s("undefined"),i=(0,o.ff)(a),d=function(e){return null===e},u=(0,o.or)(d,a),m=s("function"),l=s("number"),_=s("string"),c=function(e){return null!==e&&"object"==typeof e},h=Array.isArray,f=function(e){return"[object Date]"===r.call(e)},p=function(e){return"[object RegExp]"===r.call(e)};function M(e){if(h(e)&&e.length){var t=e.slice(0,-1),n=e.slice(-1);return!(t.filter((0,o.ff)(_)).length||n.filter((0,o.ff)(m)).length)}return m(e)}var y=(0,o.xD)(c,(0,o.zG)((0,o.vg)("then"),m))},"./node_modules/@uirouter/core/lib-esm/common/queue.js":(e,t,n)=>{"use strict";n.d(t,{c:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=function(){function e(e,t){void 0===e&&(e=[]),void 0===t&&(t=null),this._items=e,this._limit=t,this._evictListeners=[],this.onEvict=(0,o.LH)(this._evictListeners)}return e.prototype.enqueue=function(e){var t=this._items;return t.push(e),this._limit&&t.length>this._limit&&this.evict(),e},e.prototype.evict=function(){var e=this._items.shift();return this._evictListeners.forEach((function(t){return t(e)})),e},e.prototype.dequeue=function(){if(this.size())return this._items.splice(0,1)[0]},e.prototype.clear=function(){var e=this._items;return this._items=[],e},e.prototype.size=function(){return this._items.length},e.prototype.remove=function(e){var t=this._items.indexOf(e);return t>-1&&this._items.splice(t,1)[0]},e.prototype.peekTail=function(){return this._items[this._items.length-1]},e.prototype.peekHead=function(){if(this.size())return this._items[0]},e}()},"./node_modules/@uirouter/core/lib-esm/common/safeConsole.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r={log:o.ZT,error:o.ZT,table:o.ZT},s="undefined"!=typeof document&&document.documentMode&&9===document.documentMode?window&&window.console?function(e){var t=function(t){return Function.prototype.bind.call(t,e)};return{log:t(e.log),error:t(e.log),table:t(e.log)}}(window.console):r:console.table&&console.error?console:function(e){var t=e.log.bind(e);return{log:t,error:e.error?e.error.bind(e):t,table:e.table?e.table.bind(e):t}}(console)},"./node_modules/@uirouter/core/lib-esm/common/strings.js":(e,t,n)=>{"use strict";n.d(t,{BS:()=>i,NE:()=>d,L$:()=>u,XF:()=>m,iC:()=>l,Pz:()=>h,Lb:()=>p,cW:()=>M,C7:()=>y,Fb:()=>L,HV:()=>Y,PX:()=>g,iV:()=>v});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js");function i(e,t){return t.length<=e?t:t.substr(0,e-3)+"..."}function d(e,t){for(;t.length{"use strict";n.d(t,{g4:()=>c});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/safeConsole.js");function d(e){if(!e)return"ui-view (defunct)";var t=e.creationContext?e.creationContext.name||"(root)":"(none)";return"[ui-view#"+e.id+" "+e.$type+":"+e.fqn+" ("+e.name+"@"+t+")]"}function u(e){return(0,s.hj)(e)?o[e]:o[o[e]]}!function(e){e[e.RESOLVE=0]="RESOLVE",e[e.TRANSITION=1]="TRANSITION",e[e.HOOK=2]="HOOK",e[e.UIVIEW=3]="UIVIEW",e[e.VIEWCONFIG=4]="VIEWCONFIG"}(o||(o={}));var m=(0,r.Qc)("$id"),l=(0,r.Qc)("router.$id"),_=function(e){return"Transition #"+m(e)+"-"+l(e)},c=new(function(){function e(){this._enabled={},this.approximateDigests=0}return e.prototype._set=function(e,t){var n=this;t.length||(t=Object.keys(o).map((function(e){return parseInt(e,10)})).filter((function(e){return!isNaN(e)})).map((function(e){return o[e]}))),t.map(u).forEach((function(t){return n._enabled[t]=e}))},e.prototype.enable=function(){for(var e=[],t=0;t "+(0,a.Pz)(e))},e.prototype.traceTransitionIgnored=function(e){this.enabled(o.TRANSITION)&&i.L.log(_(e)+": Ignored <> "+(0,a.Pz)(e))},e.prototype.traceHookInvocation=function(e,t,n){if(this.enabled(o.HOOK)){var s=(0,r.Qc)("traceData.hookType")(n)||"internal",d=(0,r.Qc)("traceData.context.state.name")(n)||(0,r.Qc)("traceData.context")(n)||"unknown",u=(0,a.XF)(e.registeredHook.callback);i.L.log(_(t)+": Hook -> "+s+" context: "+d+", "+(0,a.BS)(200,u))}},e.prototype.traceHookResult=function(e,t,n){this.enabled(o.HOOK)&&i.L.log(_(t)+": <- Hook returned: "+(0,a.BS)(200,(0,a.Pz)(e)))},e.prototype.traceResolvePath=function(e,t,n){this.enabled(o.RESOLVE)&&i.L.log(_(n)+": Resolving "+e+" ("+t+")")},e.prototype.traceResolvableResolved=function(e,t){this.enabled(o.RESOLVE)&&i.L.log(_(t)+": <- Resolved "+e+" to: "+(0,a.BS)(200,(0,a.Pz)(e.data)))},e.prototype.traceError=function(e,t){this.enabled(o.TRANSITION)&&i.L.log(_(t)+": <- Rejected "+(0,a.Pz)(t)+", reason: "+e)},e.prototype.traceSuccess=function(e,t){this.enabled(o.TRANSITION)&&i.L.log(_(t)+": <- Success "+(0,a.Pz)(t)+", final state: "+e.name)},e.prototype.traceUIViewEvent=function(e,t,n){void 0===n&&(n=""),this.enabled(o.UIVIEW)&&i.L.log("ui-view: "+(0,a.NE)(30,e)+" "+d(t)+n)},e.prototype.traceUIViewConfigUpdated=function(e,t){this.enabled(o.UIVIEW)&&this.traceUIViewEvent("Updating",e," with ViewConfig from context='"+t+"'")},e.prototype.traceUIViewFill=function(e,t){this.enabled(o.UIVIEW)&&this.traceUIViewEvent("Fill",e," with: "+(0,a.BS)(200,t))},e.prototype.traceViewSync=function(e){if(this.enabled(o.VIEWCONFIG)){var t="uiview component fqn",n=e.map((function(e){var n,o=e.uiView,r=e.viewConfig,s=o&&o.fqn,a=r&&r.viewDecl.$context.name+": ("+r.viewDecl.$name+")";return(n={})[t]=s,n["view config state (view name)"]=a,n})).sort((function(e,n){return(e[t]||"").localeCompare(n[t]||"")}));i.L.table(n)}},e.prototype.traceViewServiceEvent=function(e,t){this.enabled(o.VIEWCONFIG)&&i.L.log("VIEWCONFIG: "+e+" "+function(e){var t=e.viewDecl,n=t.$context.name||"(root)";return"[View#"+e.$id+" from '"+n+"' state]: target ui-view: '"+t.$uiViewName+"@"+t.$uiViewContextAnchor+"'"}(t))},e.prototype.traceViewServiceUIViewEvent=function(e,t){this.enabled(o.VIEWCONFIG)&&i.L.log("VIEWCONFIG: "+e+" "+d(t))},e}())},"./node_modules/@uirouter/core/lib-esm/globals.js":(e,t,n)=>{"use strict";n.d(t,{k:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/params/stateParams.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/queue.js"),s=function(){function e(){this.params=new o.i,this.lastStartedTransitionId=-1,this.transitionHistory=new r.c([],1),this.successfulTransitions=new r.c([],1)}return e.prototype.dispose=function(){this.transitionHistory.clear(),this.successfulTransitions.clear(),this.transition=null},e}()},"./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js":(e,t,n)=>{"use strict";n.d(t,{v:()=>s,A:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),r=function(e){var t=e.router,n=e.entering().filter((function(e){return!!e.$$state().lazyLoad})).map((function(t){return a(e,t)}));return o.u.$q.all(n).then((function(){if("url"!==e.originalTransition().options().source){var n=e.targetState();return t.stateService.target(n.identifier(),n.params(),n.options())}var o=t.urlService,r=o.match(o.parts()),s=r&&r.rule;if(s&&"STATE"===s.type){var a=s.state,i=r.match;return t.stateService.target(a,i,e.options())}t.urlService.sync()}))},s=function(e){return e.onBefore({entering:function(e){return!!e.lazyLoad}},r)};function a(e,t){var n=t.$$state().lazyLoad,r=n._promise;return r||(r=n._promise=o.u.$q.when(n(e,t)).then((function(t){return t&&Array.isArray(t.states)&&t.states.forEach((function(t){return e.router.stateRegistry.register(t)})),t})).then((function(e){return delete t.lazyLoad,delete t.$$state().lazyLoad,delete n._promise,e}),(function(e){return delete n._promise,o.u.$q.reject(e)}))),r}},"./node_modules/@uirouter/core/lib-esm/interface.js":(e,t,n)=>{},"./node_modules/@uirouter/core/lib-esm/params/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/params/param.js":(e,t,n)=>{"use strict";n.d(t,{_:()=>o,d:()=>m});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),d=n("./node_modules/@uirouter/core/lib-esm/params/paramType.js"),u=Object.prototype.hasOwnProperty;!function(e){e[e.PATH=0]="PATH",e[e.SEARCH=1]="SEARCH",e[e.CONFIG=2]="CONFIG"}(o||(o={}));var m=function(){function e(e,t,n,i,m){var l=function(e,t,n){var s=!1===n.reloadOnSearch&&t===o.SEARCH||void 0,i=(0,r.sE)([n.dynamic,s],a.$K),d=(0,a.$K)(i)?{dynamic:i}:{},m=function(e){function t(){return e.value}e=function(e){return 0===["value","type","squash","array","dynamic"].filter(u.bind(e||{})).length}(e)?{value:e}:e,t.__cacheable=!0;var n=(0,a.Qh)(e.value)?e.value:t;return(0,r.l7)(e,{$$fn:n})}(n&&n.params&&n.params[e]);return(0,r.l7)(d,m)}(e,n,m);t=function(e,t,n,r,s){if(e.type&&t&&"string"!==t.name)throw new Error("Param '"+r+"' has two type configurations.");if(e.type&&t&&"string"===t.name&&s.type(e.type))return s.type(e.type);if(t)return t;if(!e.type){var a=n===o.CONFIG?"any":n===o.PATH?"path":n===o.SEARCH?"query":"string";return s.type(a)}return e.type instanceof d._?e.type:s.type(e.type)}(l,t,n,e,i.paramTypes);var _,c,h=(_={array:n===o.SEARCH&&"auto"},c=e.match(/\[\]$/)?{array:!0}:{},(0,r.l7)(_,c,l).array);t=h?t.$asArray(h,n===o.SEARCH):t;var f=void 0!==l.value||n===o.SEARCH,p=(0,a.$K)(l.dynamic)?!!l.dynamic:!!t.dynamic,M=(0,a.$K)(l.raw)?!!l.raw:!!t.raw,y=function(e,t,n){var o=e.squash;if(!t||!1===o)return!1;if(!(0,a.$K)(o)||null==o)return n;if(!0===o||(0,a.HD)(o))return o;throw new Error("Invalid squash policy: '"+o+"'. Valid policies: false, true, or arbitrary string")}(l,f,i.defaultSquashPolicy()),L=function(e,t,n,o){var i=[{from:"",to:n||t?void 0:""},{from:null,to:n||t?void 0:""}],d=(0,a.kJ)(e.replace)?e.replace:[];(0,a.HD)(o)&&d.push({from:o,to:void 0});var u=(0,r.UI)(d,(0,s.vg)("from"));return(0,r.hX)(i,(function(e){return-1===u.indexOf(e.from)})).concat(d)}(l,h,f,y),Y=(0,a.$K)(l.inherit)?!!l.inherit:!!t.inherit;(0,r.l7)(this,{id:e,type:t,location:n,isOptional:f,dynamic:p,raw:M,squash:y,replace:L,inherit:Y,array:h,config:l})}return e.values=function(e,t){void 0===t&&(t={});for(var n={},o=0,r=e;o{"use strict";n.d(t,{_:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=function(){function e(e){this.pattern=/.*/,this.inherit=!0,(0,o.l7)(this,e)}return e.prototype.is=function(e,t){return!0},e.prototype.encode=function(e,t){return e},e.prototype.decode=function(e,t){return e},e.prototype.equals=function(e,t){return e==t},e.prototype.$subPattern=function(){var e=this.pattern.toString();return e.substr(1,e.length-2)},e.prototype.toString=function(){return"{ParamType:"+this.name+"}"},e.prototype.$normalize=function(e){return this.is(e)?e:this.decode(e)},e.prototype.$asArray=function(e,t){if(!e)return this;if("auto"===e&&!t)throw new Error("'auto' array mode is for query parameters only");return new a(this,e)},e}();function a(e,t){var n=this;function s(e){return(0,r.kJ)(e)?e:(0,r.$K)(e)?[e]:[]}function a(e,n){return function(a){if((0,r.kJ)(a)&&0===a.length)return a;var i=s(a),d=(0,o.UI)(i,e);return!0===n?0===(0,o.hX)(d,(function(e){return!e})).length:function(e){switch(e.length){case 0:return;case 1:return"auto"===t?e[0]:e;default:return e}}(d)}}function i(e){return function(t,n){var o=s(t),r=s(n);if(o.length!==r.length)return!1;for(var a=0;a{"use strict";n.d(t,{p:()=>u});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),d=n("./node_modules/@uirouter/core/lib-esm/params/paramType.js"),u=function(){function e(){this.enqueue=!0,this.typeQueue=[],this.defaultTypes=(0,r.ei)(e.prototype,["hash","string","query","path","int","bool","date","json","any"]),this.types=(0,r.ED)((0,r.UI)(this.defaultTypes,(function(e,t){return new d._((0,r.l7)({name:t},e))})),{})}return e.prototype.dispose=function(){this.types={}},e.prototype.type=function(e,t,n){if(!(0,s.$K)(t))return this.types[e];if(this.types.hasOwnProperty(e))throw new Error("A type named '"+e+"' has already been defined.");return this.types[e]=new d._((0,r.l7)({name:e},t)),n&&(this.typeQueue.push({name:e,def:n}),this.enqueue||this._flushTypeQueue()),this},e.prototype._flushTypeQueue=function(){for(;this.typeQueue.length;){var e=this.typeQueue.shift();if(e.pattern)throw new Error("You cannot override a type's .pattern at runtime.");(0,r.l7)(this.types[e.name],i.u.$injector.invoke(e.def))}},e}();o=function(e){var t=function(e){return null!=e?e.toString():e},n={encode:t,decode:t,is:(0,a.is)(String),pattern:/.*/,equals:function(e,t){return e==t}};return(0,r.l7)({},n,e)},(0,r.l7)(u.prototype,{string:o({}),path:o({pattern:/[^/]*/}),query:o({}),hash:o({inherit:!1}),int:o({decode:function(e){return parseInt(e,10)},is:function(e){return!(0,s.le)(e)&&this.decode(e.toString())===e},pattern:/-?\d+/}),bool:o({encode:function(e){return e?1:0},decode:function(e){return 0!==parseInt(e,10)},is:(0,a.is)(Boolean),pattern:/0|1/}),date:o({encode:function(e){return this.is(e)?[e.getFullYear(),("0"+(e.getMonth()+1)).slice(-2),("0"+e.getDate()).slice(-2)].join("-"):void 0},decode:function(e){if(this.is(e))return e;var t=this.capture.exec(e);return t?new Date(t[1],t[2]-1,t[3]):void 0},is:function(e){return e instanceof Date&&!isNaN(e.valueOf())},equals:function(e,t){return["getFullYear","getMonth","getDate"].reduce((function(n,o){return n&&e[o]()===t[o]()}),!0)},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/}),json:o({encode:r.Qs,decode:r.xZ,is:(0,a.is)(Object),equals:r.fS,pattern:/[^/]*/}),any:o({encode:r.yR,decode:r.yR,is:function(){return!0},equals:r.fS})})},"./node_modules/@uirouter/core/lib-esm/params/stateParams.js":(e,t,n)=>{"use strict";n.d(t,{i:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=function(){function e(e){void 0===e&&(e={}),(0,o.l7)(this,e)}return e.prototype.$inherit=function(e,t,n){var r,s=(0,o.mX)(t,n),a={},i=[];for(var d in s)if(s[d]&&s[d].params&&(r=Object.keys(s[d].params)).length)for(var u in r)i.indexOf(r[u])>=0||(i.push(r[u]),a[r[u]]=this[r[u]]);return(0,o.l7)({},a,e)},e}()},"./node_modules/@uirouter/core/lib-esm/path/pathNode.js":(e,t,n)=>{"use strict";n.d(t,{V:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/params/param.js"),a=function(){function e(t){if(t instanceof e){var n=t;this.state=n.state,this.paramSchema=n.paramSchema.slice(),this.paramValues=(0,o.l7)({},n.paramValues),this.resolvables=n.resolvables.slice(),this.views=n.views&&n.views.slice()}else{var r=t;this.state=r,this.paramSchema=r.parameters({inherit:!1}),this.paramValues={},this.resolvables=r.resolvables.map((function(e){return e.clone()}))}}return e.prototype.clone=function(){return new e(this)},e.prototype.applyRawParams=function(e){return this.paramValues=this.paramSchema.reduce((function(t,n){return(0,o.bb)(t,[(r=n).id,r.value(e[r.id])]);var r}),{}),this},e.prototype.parameter=function(e){return(0,o.sE)(this.paramSchema,(0,r.OH)("id",e))},e.prototype.equals=function(e,t){var n=this.diff(e,t);return n&&0===n.length},e.prototype.diff=function(e,t){if(this.state!==e.state)return!1;var n=t?t(this):this.paramSchema;return s.d.changed(n,this.paramValues,e.paramValues)},e.clone=function(e){return e.clone()},e}()},"./node_modules/@uirouter/core/lib-esm/path/pathUtils.js":(e,t,n)=>{"use strict";n.d(t,{C:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),a=n("./node_modules/@uirouter/core/lib-esm/path/pathNode.js"),i=function(){function e(){}return e.makeTargetState=function(e,t){var n=(0,o.Gb)(t).state;return new s.F(e,n,t.map((0,r.vg)("paramValues")).reduce(o.LQ,{}),{})},e.buildPath=function(e){var t=e.params();return e.$state().path.map((function(e){return new a.V(e).applyRawParams(t)}))},e.buildToPath=function(t,n){var o=e.buildPath(n);return n.options().inherit?e.inheritParams(t,o,Object.keys(n.params())):o},e.applyViewConfigs=function(t,n,r){n.filter((function(e){return(0,o.d3)(r,e.state)})).forEach((function(r){var s=(0,o.VO)(r.state.views||{}),a=e.subPath(n,(function(e){return e===r})),i=s.map((function(e){return t.createViewConfig(a,e)}));r.views=i.reduce(o.M7,[])}))},e.inheritParams=function(e,t,n){void 0===n&&(n=[]);var s=e.map((function(e){return e.paramSchema})).reduce(o.M7,[]).filter((function(e){return!e.inherit})).map((0,r.vg)("id"));return t.map((function(t){var i=(0,o.l7)({},t&&t.paramValues),d=(0,o.ei)(i,n);i=(0,o.CE)(i,n);var u,m,l,_=(0,o.CE)((u=e,m=t.state,l=(0,o.sE)(u,(0,r.OH)("state",m)),(0,o.l7)({},l&&l.paramValues)||{}),s),c=(0,o.l7)(i,_,d);return new a.V(t.state).applyRawParams(c)}))},e.treeChanges=function(t,n,o){for(var r,s,a,i,d,u,m=Math.min(t.length,n.length),l=0;l{"use strict";n.d(t,{u:()=>o});var o={when:{LAZY:"LAZY",EAGER:"EAGER"},async:{WAIT:"WAIT",NOWAIT:"NOWAIT"}}},"./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js":(e,t,n)=>{"use strict";n.d(t,{X:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),d=function(){function e(t,n,s,a,d){if(this.resolved=!1,this.promise=void 0,t instanceof e)(0,o.l7)(this,t);else if((0,i.mf)(n)){if((0,i.le)(t))throw new Error("new Resolvable(): token argument is required");if(!(0,i.mf)(n))throw new Error("new Resolvable(): resolveFn argument must be a function");this.token=t,this.policy=a,this.resolveFn=n,this.deps=s||[],this.data=d,this.resolved=void 0!==d,this.promise=this.resolved?r.u.$q.when(this.data):void 0}else if((0,i.Kn)(t)&&t.token&&(t.hasOwnProperty("resolveFn")||t.hasOwnProperty("data"))){var u=t;return new e(u.token,u.resolveFn,u.deps,u.policy,u.data)}}return e.prototype.getPolicy=function(e){var t=this.policy||{},n=e&&e.resolvePolicy||{};return{when:t.when||n.when||"LAZY",async:t.async||n.async||"WAIT"}},e.prototype.resolve=function(e,t){var n=this,a=r.u.$q,d=e.findNode(this),u=d&&d.state,m=this.getPolicy(u).async,l=(0,i.mf)(m)?m:o.yR;return this.promise=a.when().then((function(){return a.all(e.getDependencies(n).map((function(n){return n.get(e,t)})))})).then((function(e){return n.resolveFn.apply(null,e)})).then(l).then((function(e){return n.data=e,n.resolved=!0,n.resolveFn=null,s.g4.traceResolvableResolved(n,t),n.data}))},e.prototype.get=function(e,t){return this.promise||this.resolve(e,t)},e.prototype.toString=function(){return"Resolvable(token: "+(0,a.Pz)(this.token)+", requires: ["+this.deps.map(a.Pz)+"])"},e.prototype.clone=function(){return new e(this)},e.fromData=function(t,n){return new e(t,(function(){return n}),null,null,n)},e}()},"./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js":(e,t,n)=>{"use strict";n.d(t,{l:()=>f});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/interface.js"),d=n("./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"),u=n("./node_modules/@uirouter/core/lib-esm/path/pathUtils.js"),m=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),l=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),_=i.u.when,c=[_.EAGER,_.LAZY],h=[_.EAGER],f=function(){function e(e){this._path=e}return e.prototype.getTokens=function(){return this._path.reduce((function(e,t){return e.concat(t.resolvables.map((function(e){return e.token})))}),[]).reduce(o.v_,[])},e.prototype.getResolvable=function(e){var t=this._path.map((function(e){return e.resolvables})).reduce(o.M7,[]).filter((function(t){return t.token===e}));return(0,o.Gb)(t)},e.prototype.getPolicy=function(e){var t=this.findNode(e);return e.getPolicy(t.state)},e.prototype.subContext=function(t){return new e(u.C.subPath(this._path,(function(e){return e.state===t})))},e.prototype.addResolvables=function(e,t){var n=(0,o.sE)(this._path,(0,r.OH)("state",t)),s=e.map((function(e){return e.token}));n.resolvables=n.resolvables.filter((function(e){return-1===s.indexOf(e.token)})).concat(e)},e.prototype.resolvePath=function(e,t){var n=this;void 0===e&&(e="LAZY");var d=((0,o.d3)(c,e)?e:"LAZY")===i.u.when.EAGER?h:c;s.g4.traceResolvePath(this._path,e,t);var u=function(e,t){return function(r){return(0,o.d3)(e,n.getPolicy(r)[t])}},m=this._path.reduce((function(e,o){var s=o.resolvables.filter(u(d,"when")),a=s.filter(u(["NOWAIT"],"async")),i=s.filter((0,r.ff)(u(["NOWAIT"],"async"))),m=n.subContext(o.state),l=function(e){return e.get(m,t).then((function(t){return{token:e.token,value:t}}))};return a.forEach(l),e.concat(i.map(l))}),[]);return a.u.$q.all(m)},e.prototype.injector=function(){return this._injector||(this._injector=new p(this))},e.prototype.findNode=function(e){return(0,o.sE)(this._path,(function(t){return(0,o.d3)(t.resolvables,e)}))},e.prototype.getDependencies=function(e){var t=this,n=this.findNode(e),r=(u.C.subPath(this._path,(function(e){return e===n}))||this._path).reduce((function(e,t){return e.concat(t.resolvables)}),[]).filter((function(t){return t!==e}));return e.deps.map((function(e){var n=r.filter((function(t){return t.token===e}));if(n.length)return(0,o.Gb)(n);var s=t.injector().getNative(e);if((0,l.wV)(s))throw new Error("Could not find Dependency Injection token: "+(0,m.Pz)(e));return new d.X(e,(function(){return s}),[],s)}))},e}(),p=function(){function e(e){this.context=e,this.native=this.get("Native Injector")||a.u.$injector}return e.prototype.get=function(e){var t=this.context.getResolvable(e);if(t){if("NOWAIT"===this.context.getPolicy(t).async)return t.get(this.context);if(!t.resolved)throw new Error("Resolvable async .get() not complete:"+(0,m.Pz)(t.token));return t.data}return this.getNative(e)},e.prototype.getAsync=function(e){var t=this.context.getResolvable(e);return t?t.get(this.context):a.u.$q.when(this.native.get(e))},e.prototype.getNative=function(e){return this.native&&this.native.get(e)},e}()},"./node_modules/@uirouter/core/lib-esm/router.js":(e,t,n)=>{"use strict";n.d(t,{a:()=>y});var o=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRouter.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/transitionService.js"),a=n("./node_modules/@uirouter/core/lib-esm/view/view.js"),i=n("./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js"),d=n("./node_modules/@uirouter/core/lib-esm/state/stateService.js"),u=n("./node_modules/@uirouter/core/lib-esm/globals.js"),m=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),l=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),_=n("./node_modules/@uirouter/core/lib-esm/url/urlService.js"),c=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),h=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),f=0,p=(0,h.HV)("LocationServices",["url","path","search","hash","onChange"]),M=(0,h.HV)("LocationConfig",["port","protocol","host","baseHref","html5Mode","hashPrefix"]),y=function(){function e(e,t){void 0===e&&(e=p),void 0===t&&(t=M),this.locationService=e,this.locationConfig=t,this.$id=f++,this._disposed=!1,this._disposables=[],this.trace=c.g4,this.viewService=new a.s(this),this.globals=new u.k,this.transitionService=new s.Z(this),this.urlMatcherFactory=new o.y(this),this.urlRouter=new r.g(this),this.urlService=new _.i(this),this.stateRegistry=new i.q(this),this.stateService=new d.b(this),this._plugins={},this.viewService._pluginapi._rootViewContext(this.stateRegistry.root()),this.globals.$current=this.stateRegistry.root(),this.globals.current=this.globals.$current.self,this.disposable(this.globals),this.disposable(this.stateService),this.disposable(this.stateRegistry),this.disposable(this.transitionService),this.disposable(this.urlService),this.disposable(e),this.disposable(t)}return e.prototype.disposable=function(e){this._disposables.push(e)},e.prototype.dispose=function(e){var t=this;e&&(0,l.mf)(e.dispose)?e.dispose(this):(this._disposed=!0,this._disposables.slice().forEach((function(e){try{"function"==typeof e.dispose&&e.dispose(t),(0,m.nA)(t._disposables,e)}catch(e){}})))},e.prototype.plugin=function(e,t){void 0===t&&(t={});var n=new e(this,t);if(!n.name)throw new Error("Required property `name` missing on plugin: "+n);return this._disposables.push(n),this._plugins[n.name]=n},e.prototype.getPlugin=function(e){return e?this._plugins[e]:(0,m.VO)(this._plugins)},e}()},"./node_modules/@uirouter/core/lib-esm/state/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js":(e,t,n)=>{"use strict";n.d(t,{t:()=>M});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js");function u(e){return e.name}function m(e){return e.self.$$state=function(){return e},e.self}function l(e){return e.parent&&e.parent.data&&(e.data=e.self.data=(0,o.ED)(e.parent.data,e.data)),e.data}var _=function(e,t){return function(n){var s=n.self;if(s&&s.url&&s.name&&s.name.match(/\.\*\*$/)){var a={};(0,o.JG)(s,a),a.url+="{remainder:any}",s=a}var i=n.parent,d=function(e){if(!(0,r.HD)(e))return!1;var t="^"===e.charAt(0);return{val:t?e.substring(1):e,root:t}}(s.url),u=d?e.compile(d.val,{state:s}):s.url;if(!u)return null;if(!e.isMatcher(u))throw new Error("Invalid url '"+u+"' in state '"+n+"'");return d&&d.root?u:(i&&i.navigable||t()).url.append(u)}},c=function(e){return function(t){return!e(t)&&t.url?t:t.parent?t.parent.navigable:null}};function h(e){return e.parent?e.parent.path.concat(e):[e]}function f(e){var t=e.parent?(0,o.l7)({},e.parent.includes):{};return t[e.name]=!0,t}function p(e){var t,n,u=function(e){return e.provide||e.token},m=(0,a.uj)([[(0,a.vg)("resolveFn"),function(e){return new i.X(u(e),e.resolveFn,e.deps,e.policy)}],[(0,a.vg)("useFactory"),function(e){return new i.X(u(e),e.useFactory,e.deps||e.dependencies,e.policy)}],[(0,a.vg)("useClass"),function(e){return new i.X(u(e),(function(){return new e.useClass}),[],e.policy)}],[(0,a.vg)("useValue"),function(e){return new i.X(u(e),(function(){return e.useValue}),[],e.policy,e.useValue)}],[(0,a.vg)("useExisting"),function(e){return new i.X(u(e),o.yR,[e.useExisting],e.policy)}]]),l=(0,a.uj)([[(0,a.zG)((0,a.vg)("val"),r.HD),function(e){return new i.X(e.token,o.yR,[e.val],e.policy)}],[(0,a.zG)((0,a.vg)("val"),r.kJ),function(e){return new i.X(e.token,(0,o.Gb)(e.val),e.val.slice(0,-1),e.policy)}],[(0,a.zG)((0,a.vg)("val"),r.mf),function(e){return new i.X(e.token,e.val,(t=e.val,n=d.u.$injector,t.$inject||n&&n.annotate(t,n.strictDi)||"deferred"),e.policy);var t,n}]]),_=(0,a.uj)([[(0,a.is)(i.X),function(e){return e}],[function(e){return!(!e.token||!e.resolveFn)},m],[function(e){return!(!e.provide&&!e.token||!(e.useValue||e.useFactory||e.useExisting||e.useClass))},m],[function(e){return!!(e&&e.val&&((0,r.HD)(e.val)||(0,r.kJ)(e.val)||(0,r.mf)(e.val)))},l],[(0,a.P0)(!0),function(e){throw new Error("Invalid resolve value: "+(0,s.Pz)(e))}]]),c=e.resolve;return((0,r.kJ)(c)?c:(t=c,n=e.resolvePolicy||{},Object.keys(t||{}).map((function(e){return{token:e,val:t[e],deps:void 0,policy:n[e]}})))).map(_)}var M=function(){function e(e,t){this.matcher=e;var n,r=this,s=function(){return e.find("")},i=function(e){return""===e.name};this.builders={name:[u],self:[m],parent:[function(t){return i(t)?null:e.find(r.parentName(t))||s()}],data:[l],url:[_(t,s)],navigable:[c(i)],params:[(n=t.paramFactory,function(e){var t=e.url&&e.url.parameters({inherit:!1})||[],r=(0,o.VO)((0,o.js)((0,o.CE)(e.params||{},t.map((0,a.vg)("id"))),(function(t,o){return n.fromConfig(o,null,e.self)})));return t.concat(r).map((function(e){return[e.id,e]})).reduce(o.bb,{})})],views:[],path:[h],includes:[f],resolvables:[p]}}return e.prototype.builder=function(e,t){var n=this.builders,o=n[e]||[];return(0,r.HD)(e)&&!(0,r.$K)(t)?o.length>1?o:o[0]:(0,r.HD)(e)&&(0,r.mf)(t)?(n[e]=o,n[e].push(t),function(){return n[e].splice(n[e].indexOf(t,1))&&null}):void 0},e.prototype.build=function(e){var t=this.matcher,n=this.builders,r=this.parentName(e);if(r&&!t.find(r,void 0,!1))return null;for(var s in n)if(n.hasOwnProperty(s)){var a=n[s].reduce((function(e,t){return function(n){return t(n,e)}}),o.ZT);e[s]=a(e)}return e},e.prototype.parentName=function(e){var t=e.name||"",n=t.split(".");if("**"===n.pop()&&n.pop(),n.length){if(e.parent)throw new Error("States that specify the 'parent:' property should not have a '.' in their name ("+t+")");return n.join(".")}return e.parent?(0,r.HD)(e.parent)?e.parent:e.parent.name:""},e.prototype.name=function(e){var t=e.name;if(-1!==t.indexOf(".")||!e.parent)return t;var n=(0,r.HD)(e.parent)?e.parent:e.parent.name;return n?n+"."+t:t},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js":(e,t,n)=>{"use strict";n.d(t,{Q:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/safeConsole.js"),a=function(){function e(e){this._states=e}return e.prototype.isRelative=function(e){return 0===(e=e||"").indexOf(".")||0===e.indexOf("^")},e.prototype.find=function(e,t,n){if(void 0===n&&(n=!0),e||""===e){var a=(0,o.HD)(e),i=a?e:e.name;this.isRelative(i)&&(i=this.resolvePath(i,t));var d=this._states[i];if(d&&(a||!(a||d!==e&&d.self!==e)))return d;if(a&&n){var u=(0,r.VO)(this._states).filter((function(e){return e.__stateObjectCache.nameGlob&&e.__stateObjectCache.nameGlob.matches(i)}));return u.length>1&&s.L.error("stateMatcher.find: Found multiple matches for "+i+" using glob: ",u.map((function(e){return e.name}))),u[0]}}},e.prototype.resolvePath=function(e,t){if(!t)throw new Error("No reference point given for path '"+e+"'");for(var n=this.find(t),o=e.split("."),r=o.length,s=0,a=n;s{"use strict";n.d(t,{l:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/glob.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=function(){function e(t){return e.create(t||{})}return e.create=function(t){t=e.isStateClass(t)?new t:t;var n=(0,o.ED)((0,o.ED)(t,e.prototype));return t.$$state=function(){return n},n.self=t,n.__stateObjectCache={nameGlob:s.r.fromString(n.name)},n},e.prototype.is=function(e){return this===e||this.self===e||this.fqn()===e},e.prototype.fqn=function(){if(!(this.parent&&this.parent instanceof this.constructor))return this.name;var e=this.parent.fqn();return e?e+"."+this.name:this.name},e.prototype.root=function(){return this.parent&&this.parent.root()||this},e.prototype.parameters=function(e){return((e=(0,o.ce)(e,{inherit:!0,matchingKeys:null})).inherit&&this.parent&&this.parent.parameters()||[]).concat((0,o.VO)(this.params)).filter((function(t){return!e.matchingKeys||e.matchingKeys.hasOwnProperty(t.id)}))},e.prototype.parameter=function(e,t){return void 0===t&&(t={}),this.url&&this.url.parameter(e,t)||(0,o.sE)((0,o.VO)(this.params),(0,r.OH)("id",e))||t.inherit&&this.parent&&this.parent.parameter(e)},e.prototype.toString=function(){return this.fqn()},e.isStateClass=function(e){return(0,a.mf)(e)&&!0===e.__uiRouterState},e.isStateDeclaration=function(e){return(0,a.mf)(e.$$state)},e.isState=function(e){return(0,a.Kn)(e.__stateObjectCache)},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/state/stateObject.js"),s=function(){function e(e,t,n,o){this.router=e,this.states=t,this.builder=n,this.listeners=o,this.queue=[]}return e.prototype.dispose=function(){this.queue=[]},e.prototype.register=function(e){var t=this.queue,n=r.l.create(e),s=n.name;if(!(0,o.HD)(s))throw new Error("State must have a valid name");if(this.states.hasOwnProperty(s)||(0,o.d3)(t.map((0,o.vg)("name")),s))throw new Error("State '"+s+"' is already defined");return t.push(n),this.flush(),n},e.prototype.flush=function(){for(var e=this,t=this,n=t.queue,o=t.states,r=t.builder,s=[],a=[],i={},d=function(t){return e.states.hasOwnProperty(t)&&e.states[t]},u=function(){s.length&&e.listeners.forEach((function(e){return e("registered",s.map((function(e){return e.self})))}))};n.length>0;){var m=n.shift(),l=m.name,_=r.build(m),c=a.indexOf(m);if(_){var h=d(l);if(h&&h.name===l)throw new Error("State '"+l+"' is already defined");var f=d(l+".**");f&&this.router.stateRegistry.deregister(f),o[l]=m,this.attachRoute(m),c>=0&&a.splice(c,1),s.push(m)}else{var p=i[l];if(i[l]=n.length,c>=0&&p===n.length)return n.push(m),u(),o;c<0&&a.push(m),n.push(m)}}return u(),o},e.prototype.attachRoute=function(e){if(!e.abstract&&e.url){var t=this.router.urlService.rules;t.rule(t.urlRuleFactory.create(e))}},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js":(e,t,n)=>{"use strict";n.d(t,{q:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js"),r=n("./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js"),s=n("./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),d=function(){function e(e){this.router=e,this.states={},this.listeners=[],this.matcher=new o.Q(this.states),this.builder=new r.t(this.matcher,e.urlMatcherFactory),this.stateQueue=new s.L(e,this.states,this.builder,this.listeners),this._registerRoot()}return e.prototype._registerRoot=function(){(this._root=this.stateQueue.register({name:"",url:"^",views:null,params:{"#":{value:null,type:"hash",dynamic:!0}},abstract:!0})).navigable=null},e.prototype.dispose=function(){var e=this;this.stateQueue.dispose(),this.listeners=[],this.get().forEach((function(t){return e.get(t)&&e.deregister(t)}))},e.prototype.onStatesChanged=function(e){return this.listeners.push(e),function(){(0,a.nA)(this.listeners)(e)}.bind(this)},e.prototype.root=function(){return this._root},e.prototype.register=function(e){return this.stateQueue.register(e)},e.prototype._deregisterTree=function(e){var t=this,n=this.get().map((function(e){return e.$$state()})),o=function(e){var t=n.filter((function(t){return-1!==e.indexOf(t.parent)}));return 0===t.length?t:t.concat(o(t))},r=o([e]),s=[e].concat(r).reverse();return s.forEach((function(e){var n=t.router.urlService.rules;n.rules().filter((0,i.OH)("state",e)).forEach((function(e){return n.removeRule(e)})),delete t.states[e.name]})),s},e.prototype.deregister=function(e){var t=this.get(e);if(!t)throw new Error("Can't deregister state; not found: "+e);var n=this._deregisterTree(t.$$state());return this.listeners.forEach((function(e){return e("deregistered",n.map((function(e){return e.self})))})),n},e.prototype.get=function(e,t){var n=this;if(0===arguments.length)return Object.keys(this.states).map((function(e){return n.states[e].self}));var o=this.matcher.find(e,t);return o&&o.self||null},e.prototype.decorator=function(e,t){return this.builder.builder(e,t)},e}()},"./node_modules/@uirouter/core/lib-esm/state/targetState.js":(e,t,n)=>{"use strict";n.d(t,{F:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),a=function(){function e(e,t,n,o){this._stateRegistry=e,this._identifier=t,this._identifier=t,this._params=(0,s.l7)({},n||{}),this._options=(0,s.l7)({},o||{}),this._definition=e.matcher.find(t,this._options.relative)}return e.prototype.name=function(){return this._definition&&this._definition.name||this._identifier},e.prototype.identifier=function(){return this._identifier},e.prototype.params=function(){return this._params},e.prototype.$state=function(){return this._definition},e.prototype.state=function(){return this._definition&&this._definition.self},e.prototype.options=function(){return this._options},e.prototype.exists=function(){return!(!this._definition||!this._definition.self)},e.prototype.valid=function(){return!this.error()},e.prototype.error=function(){var e=this.options().relative;if(!this._definition&&e){var t=e.name?e.name:e;return"Could not resolve '"+this.name()+"' from state '"+t+"'"}return this._definition?this._definition.self?void 0:"State '"+this.name()+"' has an invalid definition":"No such state '"+this.name()+"'"},e.prototype.toString=function(){return"'"+this.name()+"'"+(0,r.Pz)(this.params())},e.prototype.withState=function(t){return new e(this._stateRegistry,t,this._params,this._options)},e.prototype.withParams=function(t,n){void 0===n&&(n=!1);var o=n?t:(0,s.l7)({},this._params,t);return new e(this._stateRegistry,this._identifier,o,this._options)},e.prototype.withOptions=function(t,n){void 0===n&&(n=!1);var o=n?t:(0,s.l7)({},this._options,t);return new e(this._stateRegistry,this._identifier,this._params,o)},e.isDef=function(e){return e&&e.state&&((0,o.HD)(e.state)||(0,o.Kn)(e.state)&&(0,o.HD)(e.state.name))},e}()},"./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js":(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),a=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),i=function(){function e(e){this.transition=e}return e.prototype.buildHooksForPhase=function(e){var t=this;return this.transition.router.transitionService._pluginapi._getEvents(e).map((function(e){return t.buildHooks(e)})).reduce(o.M7,[]).filter(o.yR)},e.prototype.buildHooks=function(e){var t=this.transition,n=t.treeChanges(),r=this.getMatchingHooks(e,n,t);if(!r)return[];var i,d={transition:t,current:t.options().current};return r.map((function(r){return r.matches(n,t)[e.criteriaMatchPath.name].map((function(n){var i=(0,o.l7)({bind:r.bind,traceData:{hookType:e.name,context:n}},d),u=e.criteriaMatchPath.scope===s.c.STATE?n.state.self:null,m=new a.I(t,u,r,i);return{hook:r,node:n,transitionHook:m}}))})).reduce(o.M7,[]).sort((i=e.reverseSort,void 0===i&&(i=!1),function(e,t){var n=i?-1:1,o=(e.node.state.path.length-t.node.state.path.length)*n;return 0!==o?o:t.hook.priority-e.hook.priority})).map((function(e){return e.transitionHook}))},e.prototype.getMatchingHooks=function(e,t,n){var a=e.hookPhase===s.k.CREATE,i=this.transition.router.transitionService;return(a?[i]:[this.transition,i]).map((function(t){return t.getHooks(e.name)})).filter((0,o.sp)(r.kJ,"broken event named: "+e.name)).reduce(o.M7,[]).filter((function(e){return e.matches(t,n)}))},e}()},"./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js":(e,t,n)=>{"use strict";n.d(t,{cN:()=>s,BU:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js");function s(e,t,n){var r=(0,o.HD)(t)?[t]:t;return!!((0,o.mf)(r)?r:function(e){for(var t=r,n=0;n{"use strict";var o,r;n.d(t,{k:()=>o,c:()=>r}),function(e){e[e.CREATE=0]="CREATE",e[e.BEFORE=1]="BEFORE",e[e.RUN=2]="RUN",e[e.SUCCESS=3]="SUCCESS",e[e.ERROR=4]="ERROR"}(o||(o={})),function(e){e[e.TRANSITION=0]="TRANSITION",e[e.STATE=1]="STATE"}(r||(r={}))},"./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js":(e,t,n)=>{"use strict";n.d(t,{K:()=>o,i:()=>d});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js");!function(e){e[e.SUPERSEDED=2]="SUPERSEDED",e[e.ABORTED=3]="ABORTED",e[e.INVALID=4]="INVALID",e[e.IGNORED=5]="IGNORED",e[e.ERROR=6]="ERROR"}(o||(o={}));var i=0,d=function(){function e(e,t,n){this.$id=i++,this.type=e,this.message=t,this.detail=n}return e.isRejectionPromise=function(t){return t&&"function"==typeof t.then&&(0,a.is)(e)(t._transitionRejection)},e.superseded=function(t,n){var r=new e(o.SUPERSEDED,"The transition has been superseded by a different transition",t);return n&&n.redirected&&(r.redirected=!0),r},e.redirected=function(t){return e.superseded(t,{redirected:!0})},e.invalid=function(t){return new e(o.INVALID,"This transition is invalid",t)},e.ignored=function(t){return new e(o.IGNORED,"The transition was ignored",t)},e.aborted=function(t){return new e(o.ABORTED,"The transition has been aborted",t)},e.errored=function(t){return new e(o.ERROR,"The transition errored",t)},e.normalize=function(t){return(0,a.is)(e)(t)?t:e.errored(t)},e.prototype.toString=function(){var e,t=(e=this.detail)&&e.toString!==Object.prototype.toString?e.toString():(0,s.Pz)(e),n=this;return"Transition Rejection($id: "+n.$id+" type: "+n.type+", message: "+n.message+", detail: "+t+")"},e.prototype.toPromise=function(){return(0,r.l7)((0,r.jv)(this),{_transitionRejection:this})},e}()},"./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js":(e,t,n)=>{"use strict";n.d(t,{t:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),r=function(e,t,n,r,s,a,i,d){void 0===s&&(s=!1),void 0===a&&(a=o.I.HANDLE_RESULT),void 0===i&&(i=o.I.REJECT_ERROR),void 0===d&&(d=!1),this.name=e,this.hookPhase=t,this.hookOrder=n,this.criteriaMatchPath=r,this.reverseSort=s,this.getResultHandler=a,this.getErrorHandler=i,this.synchronous=d}},"./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>c});var o=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),u=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),m=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"),l=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),_={current:r.ZT,transition:null,traceData:{},bind:null},c=function(){function e(e,t,n,s){var a=this;this.transition=e,this.stateContext=t,this.registeredHook=n,this.options=s,this.isSuperseded=function(){return a.type.hookPhase===o.k.RUN&&!a.options.transition.isActive()},this.options=(0,r.ce)(s,_),this.type=n.eventType}return e.chain=function(e,t){return e.reduce((function(e,t){return e.then((function(){return t.invokeHook()}))}),t||u.u.$q.when())},e.invokeHooks=function(t,n){for(var o=0;o=t.invokeLimit&&t.deregister()}}},e.prototype.handleHookResult=function(e){var t=this;return this.getNotCurrentRejection()||((0,a.tI)(e)?e.then((function(e){return t.handleHookResult(e)})):(d.g4.traceHookResult(e,this.transition,this.options),!1===e?m.i.aborted("Hook aborted transition").toPromise():(0,i.is)(l.F)(e)?m.i.redirected(e).toPromise():void 0))},e.prototype.getNotCurrentRejection=function(){var e=this.transition.router;return e._disposed?m.i.aborted("UIRouter instance #"+e.$id+" has been stopped (disposed)").toPromise():this.transition._aborted?m.i.aborted().toPromise():this.isSuperseded()?m.i.superseded(this.options.current()).toPromise():void 0},e.prototype.toString=function(){var e=this.options,t=this.registeredHook,n=(0,i.Qc)("traceData.hookType")(e)||"internal",o=(0,i.Qc)("traceData.context.state.name")(e)||(0,i.Qc)("traceData.context")(e)||"unknown",r=(0,s.iC)(t.callback);return n+" context: "+o+", "+(0,s.BS)(200,r)},e.HANDLE_RESULT=function(e){return function(t){return e.handleHookResult(t)}},e.LOG_REJECTED_RESULT=function(e){return function(t){(0,a.tI)(t)&&t.catch((function(t){return e.logError(m.i.normalize(t))}))}},e.LOG_ERROR=function(e){return function(t){return e.logError(t)}},e.REJECT_ERROR=function(e){return function(e){return(0,r.jv)(e)}},e.THROW_ERROR=function(e){return function(e){throw e}},e}()},"./node_modules/@uirouter/core/lib-esm/transition/transitionService.js":(e,t,n)=>{"use strict";n.d(t,{Z:()=>C,q:()=>W});var o=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/transition.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js"),a=n("./node_modules/@uirouter/core/lib-esm/router.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/index.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/index.js");function u(e){e.addResolvable(i.XU.fromData(a.a,e.router),""),e.addResolvable(i.XU.fromData(r.u,e),""),e.addResolvable(i.XU.fromData("$transition$",e),""),e.addResolvable(i.XU.fromData("$stateParams",e.params()),""),e.entering().forEach((function(t){e.addResolvable(i.XU.fromData("$state$",t),t)}))}var m=["$transition$",r.u],l=(0,d.d3)(m),_=function(e){var t=(0,d.VO)(e.treeChanges()).reduce(d.M7,[]).reduce(d.v_,[]),n=function(e){return l(e.token)?i.XU.fromData(e.token,null):e};t.forEach((function(e){e.resolvables=e.resolvables.map(n)}))},c=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),h=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),f=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),p=function(e){var t=e.to().redirectTo;if(t){var n=e.router.stateService;return(0,c.mf)(t)?h.u.$q.when(t(e)).then(o):o(t)}function o(t){if(t)return t instanceof f.F?t:(0,c.HD)(t)?n.target(t,e.params(),e.options()):t.state||t.params?n.target(t.state||e.to(),t.params||e.params(),e.options()):void 0}};function M(e){return function(t,n){return(0,n.$$state()[e])(t,n)}}var y=M("onExit"),L=M("onRetain"),Y=M("onEnter"),g=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),v=n("./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js"),k=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),j=1e3,w=function(e){return new v.l(e.treeChanges().to).resolvePath("EAGER",e).then(g.ZT)},b=function(e,t){return new v.l(e.treeChanges().to).subContext(t.$$state()).resolvePath("LAZY",e).then(g.ZT)},D=function(e){return new v.l(e.treeChanges().to).resolvePath("LAZY",e).then(g.ZT)},T=function(e){var t=h.u.$q,n=e.views("entering");if(n.length)return t.all(n.map((function(e){return t.when(e.load())}))).then(g.ZT)},S=function(e){var t=e.views("entering"),n=e.views("exiting");if(t.length||n.length){var o=e.router.viewService;n.forEach((function(e){return o.deactivateViewConfig(e)})),t.forEach((function(e){return o.activateViewConfig(e)})),o.sync()}},H=function(e){var t=e.router.globals,n=function(){t.transition===e&&(t.transition=null)};e.onSuccess({},(function(){t.successfulTransitions.enqueue(e),t.$current=e.$to(),t.current=t.$current.self,(0,g.JG)(e.params(),t.params)}),{priority:1e4}),e.promise.then(n,n)},x=function(e){var t=e.options(),n=e.router.stateService,o=e.router.urlRouter;if("url"!==t.source&&t.location&&n.$current.navigable){var r={replace:"replace"===t.location};o.push(n.$current.navigable.url,n.params,r)}o.update(!0)},E=n("./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js"),P=n("./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js"),O=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),$=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),A=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js");function F(e){var t=e._ignoredReason();if(t){$.g4.traceTransitionIgnored(e);var n=e.router.globals.transition;return"SameAsCurrent"===t&&n&&n.abort(),A.i.ignored().toPromise()}}function R(e){if(!e.valid())throw new Error(e.error().toString())}var W={location:!0,relative:null,inherit:!1,notify:!0,reload:!1,supercede:!0,custom:{},current:function(){return null},source:"unknown"},C=function(){function e(e){this._transitionCount=0,this._eventTypes=[],this._registeredHooks={},this._criteriaPaths={},this._router=e,this.$view=e.viewService,this._deregisterHookFns={},this._pluginapi=(0,g.WR)((0,k.P0)(this),{},(0,k.P0)(this),["_definePathType","_defineEvent","_getPathTypes","_getEvents","getHooks"]),this._defineCorePaths(),this._defineCoreEvents(),this._registerCoreTransitionHooks(),e.globals.successfulTransitions.onEvict(_)}return e.prototype.onCreate=function(e,t,n){},e.prototype.onBefore=function(e,t,n){},e.prototype.onStart=function(e,t,n){},e.prototype.onExit=function(e,t,n){},e.prototype.onRetain=function(e,t,n){},e.prototype.onEnter=function(e,t,n){},e.prototype.onFinish=function(e,t,n){},e.prototype.onSuccess=function(e,t,n){},e.prototype.onError=function(e,t,n){},e.prototype.dispose=function(e){(0,g.VO)(this._registeredHooks).forEach((function(e){return e.forEach((function(t){t._deregistered=!0,(0,g.nA)(e,t)}))}))},e.prototype.create=function(e,t){return new r.u(e,t,this._router)},e.prototype._defineCoreEvents=function(){var e=o.k,t=O.I,n=this._criteriaPaths,r=!1,s=!0;this._defineEvent("onCreate",e.CREATE,0,n.to,r,t.LOG_REJECTED_RESULT,t.THROW_ERROR,s),this._defineEvent("onBefore",e.BEFORE,0,n.to),this._defineEvent("onStart",e.RUN,0,n.to),this._defineEvent("onExit",e.RUN,100,n.exiting,!0),this._defineEvent("onRetain",e.RUN,200,n.retained),this._defineEvent("onEnter",e.RUN,300,n.entering),this._defineEvent("onFinish",e.RUN,400,n.to),this._defineEvent("onSuccess",e.SUCCESS,0,n.to,r,t.LOG_REJECTED_RESULT,t.LOG_ERROR,s),this._defineEvent("onError",e.ERROR,0,n.to,r,t.LOG_REJECTED_RESULT,t.LOG_ERROR,s)},e.prototype._defineCorePaths=function(){var e=o.c.STATE,t=o.c.TRANSITION;this._definePathType("to",t),this._definePathType("from",t),this._definePathType("exiting",e),this._definePathType("retained",e),this._definePathType("entering",e)},e.prototype._defineEvent=function(e,t,n,o,r,a,i,d){void 0===r&&(r=!1),void 0===a&&(a=O.I.HANDLE_RESULT),void 0===i&&(i=O.I.REJECT_ERROR),void 0===d&&(d=!1);var u=new P.t(e,t,n,o,r,a,i,d);this._eventTypes.push(u),(0,s.BU)(this,this,u)},e.prototype._getEvents=function(e){return((0,c.$K)(e)?this._eventTypes.filter((function(t){return t.hookPhase===e})):this._eventTypes.slice()).sort((function(e,t){var n=e.hookPhase-t.hookPhase;return 0===n?e.hookOrder-t.hookOrder:n}))},e.prototype._definePathType=function(e,t){this._criteriaPaths[e]={name:e,scope:t}},e.prototype._getPathTypes=function(){return this._criteriaPaths},e.prototype.getHooks=function(e){return this._registeredHooks[e]},e.prototype._registerCoreTransitionHooks=function(){var e=this._deregisterHookFns;e.addCoreResolves=this.onCreate({},u),e.ignored=this.onBefore({},F,{priority:-9999}),e.invalid=function(e){return e.onBefore({},R,{priority:-1e4})}(this),e.redirectTo=function(e){return e.onStart({to:function(e){return!!e.redirectTo}},p)}(this),e.onExit=function(e){return e.onExit({exiting:function(e){return!!e.onExit}},y)}(this),e.onRetain=function(e){return e.onRetain({retained:function(e){return!!e.onRetain}},L)}(this),e.onEnter=function(e){return e.onEnter({entering:function(e){return!!e.onEnter}},Y)}(this),e.eagerResolve=function(e){return e.onStart({},w,{priority:j})}(this),e.lazyResolve=function(e){return e.onEnter({entering:(0,k.P0)(!0)},b,{priority:j})}(this),e.resolveAll=function(e){return e.onFinish({},D,{priority:j})}(this),e.loadViews=function(e){return e.onFinish({},T)}(this),e.activateViews=function(e){return e.onSuccess({},S)}(this),e.updateGlobals=function(e){return e.onCreate({},H)}(this),e.updateUrl=function(e){return e.onSuccess({},x,{priority:9999})}(this),e.lazyLoad=(0,E.v)(this)},e}()},"./node_modules/@uirouter/core/lib-esm/url/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/url/urlConfig.js":(e,t,n)=>{"use strict";n.d(t,{F:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/params/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),s=function(){function e(e){var t=this;this.router=e,this.paramTypes=new o.ParamTypes,this._decodeParams=!0,this._isCaseInsensitive=!1,this._isStrictMode=!0,this._defaultSquashPolicy=!1,this.dispose=function(){return t.paramTypes.dispose()},this.baseHref=function(){return t.router.locationConfig.baseHref()},this.hashPrefix=function(e){return t.router.locationConfig.hashPrefix(e)},this.host=function(){return t.router.locationConfig.host()},this.html5Mode=function(){return t.router.locationConfig.html5Mode()},this.port=function(){return t.router.locationConfig.port()},this.protocol=function(){return t.router.locationConfig.protocol()}}return e.prototype.caseInsensitive=function(e){return this._isCaseInsensitive=(0,r.$K)(e)?e:this._isCaseInsensitive},e.prototype.defaultSquashPolicy=function(e){if((0,r.$K)(e)&&!0!==e&&!1!==e&&!(0,r.HD)(e))throw new Error("Invalid squash policy: "+e+". Valid policies: false, true, arbitrary-string");return this._defaultSquashPolicy=(0,r.$K)(e)?e:this._defaultSquashPolicy},e.prototype.strictMode=function(e){return this._isStrictMode=(0,r.$K)(e)?e:this._isStrictMode},e.prototype.type=function(e,t,n){var o=this.paramTypes.type(e,t,n);return(0,r.$K)(t)?this:o},e}()},"./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js":(e,t,n)=>{"use strict";n.d(t,{y:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),s=n("./node_modules/@uirouter/core/lib-esm/params/index.js"),a=function(){return(a=Object.assign||function(e){for(var t,n=1,o=arguments.length;n{"use strict";n.d(t,{g:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRule.js"),s=function(){function e(e){var t=this;this.router=e,this.sync=function(e){return t.router.urlService.sync(e)},this.listen=function(e){return t.router.urlService.listen(e)},this.deferIntercept=function(e){return t.router.urlService.deferIntercept(e)},this.match=function(e){return t.router.urlService.match(e)},this.initial=function(e){return t.router.urlService.rules.initial(e)},this.otherwise=function(e){return t.router.urlService.rules.otherwise(e)},this.removeRule=function(e){return t.router.urlService.rules.removeRule(e)},this.rule=function(e){return t.router.urlService.rules.rule(e)},this.rules=function(){return t.router.urlService.rules.rules()},this.sort=function(e){return t.router.urlService.rules.sort(e)},this.when=function(e,n,o){return t.router.urlService.rules.when(e,n,o)},this.urlRuleFactory=new r.I(e)}return e.prototype.update=function(e){var t=this.router.locationService;e?this.location=t.url():t.url()!==this.location&&t.url(this.location,!0)},e.prototype.push=function(e,t,n){var o=n&&!!n.replace;this.router.urlService.url(e.format(t||{}),o)},e.prototype.href=function(e,t,n){var r=e.format(t);if(null==r)return null;n=n||{absolute:!1};var s=this.router.urlService.config,a=s.html5Mode();if(a||null===r||(r="#"+s.hashPrefix()+r),r=function(e,t,n,r){return"/"===r?e:t?(0,o.Lb)(r)+e:n?r.slice(1)+e:e}(r,a,n.absolute,s.baseHref()),!n.absolute||!r)return r;var i=!a&&r?"/":"",d=s.port(),u=80===d||443===d?"":":"+d;return[s.protocol(),"://",s.host(),u,i,r].join("")},Object.defineProperty(e.prototype,"interceptDeferred",{get:function(){return this.router.urlService.interceptDeferred},enumerable:!1,configurable:!0}),e}()},"./node_modules/@uirouter/core/lib-esm/url/urlRule.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>d,n:()=>u});var o=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/state/stateObject.js"),d=function(){function e(e){this.router=e}return e.prototype.compile=function(e){return this.router.urlMatcherFactory.compile(e)},e.prototype.create=function(e,t){var n=this,s=i.l.isState,d=i.l.isStateDeclaration,m=(0,a.uj)([[r.HD,function(e){return m(n.compile(e))}],[(0,a.is)(o.x),function(e){return n.fromUrlMatcher(e,t)}],[(0,a.or)(s,d),function(e){return n.fromState(e,n.router)}],[(0,a.is)(RegExp),function(e){return n.fromRegExp(e,t)}],[r.mf,function(e){return new u(e,t)}]]),l=m(e);if(!l)throw new Error("invalid 'what' in when()");return l},e.prototype.fromUrlMatcher=function(e,t){var n=t;(0,r.HD)(t)&&(t=this.router.urlMatcherFactory.compile(t)),(0,a.is)(o.x)(t)&&(n=function(e){return t.format(e)});var i={urlMatcher:e,matchPriority:function(t){var n=e.parameters().filter((function(e){return e.isOptional}));return n.length?n.filter((function(e){return t[e.id]})).length/n.length:1e-6},type:"URLMATCHER"};return(0,s.l7)(new u((function(t){var n=e.exec(t.path,t.search,t.hash);return e.validates(n)&&n}),n),i)},e.prototype.fromState=function(e,t){var n=i.l.isStateDeclaration(e)?e.$$state():e,o={state:n,type:"STATE"};return(0,s.l7)(this.fromUrlMatcher(n.url,(function(e){var o=t.stateService,r=t.globals;o.href(n,e)!==o.href(r.current,r.params)&&o.transitionTo(n,e,{inherit:!0,source:"url"})})),o)},e.prototype.fromRegExp=function(e,t){if(e.global||e.sticky)throw new Error("Rule RegExp must not be global or sticky");var n=(0,r.HD)(t)?function(e){return t.replace(/\$(\$|\d{1,2})/,(function(t,n){return e["$"===n?0:Number(n)]}))}:t,o={regexp:e,type:"REGEXP"};return(0,s.l7)(new u((function(t){return e.exec(t.path)}),n),o)},e.isUrlRule=function(e){return e&&["type","match","handler"].every((function(t){return(0,r.$K)(e[t])}))},e}(),u=function(e,t){var n=this;this.match=e,this.type="RAW",this.matchPriority=function(e){return 0-n.$id},this.handler=t||s.yR}},"./node_modules/@uirouter/core/lib-esm/url/urlRules.js":(e,t,n)=>{"use strict";n.d(t,{h:()=>u});var o,r=n("./node_modules/@uirouter/core/lib-esm/state/index.js"),s=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),i=n("./node_modules/@uirouter/core/lib-esm/url/urlRule.js");function d(e){if(!((0,a.mf)(e)||(0,a.HD)(e)||(0,a.is)(r.TargetState)(e)||r.TargetState.isDef(e)))throw new Error("'handler' must be a string, function, TargetState, or have a state: 'newtarget' property");return(0,a.mf)(e)?e:(0,a.P0)(e)}o=function(e,t){var n=function(e,t){return(t.priority||0)-(e.priority||0)}(e,t);return 0!==n||0!==(n=function(e,t){var n={STATE:4,URLMATCHER:4,REGEXP:3,RAW:2,OTHER:1};return(n[e.type]||0)-(n[t.type]||0)}(e,t))||0!==(n=function(e,t){return e.urlMatcher&&t.urlMatcher?s.x.compare(e.urlMatcher,t.urlMatcher):0}(e,t))?n:function(e,t){var n={STATE:!0,URLMATCHER:!0};return n[e.type]&&n[t.type]?0:(e.$id||0)-(t.$id||0)}(e,t)};var u=function(){function e(e){this.router=e,this._sortFn=o,this._rules=[],this._id=0,this.urlRuleFactory=new i.I(e)}return e.prototype.dispose=function(e){this._rules=[],delete this._otherwiseFn},e.prototype.initial=function(e){var t=d(e);this.rule(this.urlRuleFactory.create((function(e,t){return 0===t.globals.transitionHistory.size()&&!!/^\/?$/.exec(e.path)}),t))},e.prototype.otherwise=function(e){var t=d(e);this._otherwiseFn=this.urlRuleFactory.create((0,a.P0)(!0),t),this._sorted=!1},e.prototype.removeRule=function(e){(0,a.nA)(this._rules,e)},e.prototype.rule=function(e){var t=this;if(!i.I.isUrlRule(e))throw new Error("invalid rule");return e.$id=this._id++,e.priority=e.priority||0,this._rules.push(e),this._sorted=!1,function(){return t.removeRule(e)}},e.prototype.rules=function(){return this.ensureSorted(),this._rules.concat(this._otherwiseFn?[this._otherwiseFn]:[])},e.prototype.sort=function(e){for(var t=this.stableSort(this._rules,this._sortFn=e||this._sortFn),n=0,o=0;o{"use strict";n.d(t,{i:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRules.js"),s=n("./node_modules/@uirouter/core/lib-esm/url/urlConfig.js"),a=n("./node_modules/@uirouter/core/lib-esm/state/index.js"),i=function(){function e(e){var t=this;this.router=e,this.interceptDeferred=!1,this.rules=new r.h(this.router),this.config=new s.F(this.router),this.url=function(e,n,o){return t.router.locationService.url(e,n,o)},this.path=function(){return t.router.locationService.path()},this.search=function(){return t.router.locationService.search()},this.hash=function(){return t.router.locationService.hash()},this.onChange=function(e){return t.router.locationService.onChange(e)}}return e.prototype.dispose=function(){this.listen(!1),this.rules.dispose()},e.prototype.parts=function(){return{path:this.path(),search:this.search(),hash:this.hash()}},e.prototype.sync=function(e){if(!e||!e.defaultPrevented){var t=this.router,n=t.urlService,r=t.stateService,s={path:n.path(),search:n.search(),hash:n.hash()},i=this.match(s);(0,o.uj)([[o.HD,function(e){return n.url(e,!0)}],[a.TargetState.isDef,function(e){return r.go(e.state,e.params,e.options)}],[(0,o.is)(a.TargetState),function(e){return r.go(e.state(),e.params(),e.options())}]])(i&&i.rule.handler(i.match,s,this.router))}},e.prototype.listen=function(e){var t=this;if(!1!==e)return this._stopListeningFn=this._stopListeningFn||this.router.urlService.onChange((function(e){return t.sync(e)}));this._stopListeningFn&&this._stopListeningFn(),delete this._stopListeningFn},e.prototype.deferIntercept=function(e){void 0===e&&(e=!0),this.interceptDeferred=e},e.prototype.match=function(e){e=(0,o.l7)({path:"",search:{},hash:""},e);for(var t,n,r,s=this.rules.rules(),a=0;at.weight?i:t}return t},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/core/lib-esm/vanilla/index.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js":(e,t,n)=>{"use strict";n.d(t,{U:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"),s=function(){function e(e,t){var n=this;this.fireAfterUpdate=t,this._listeners=[],this._listener=function(e){return n._listeners.forEach((function(t){return t(e)}))},this.hash=function(){return(0,r.en)(n._get()).hash},this.path=function(){return(0,r.en)(n._get()).path},this.search=function(){return(0,r.Qf)((0,r.en)(n._get()).search)},this._location=o.Jz.location,this._history=o.Jz.history}return e.prototype.url=function(e,t){return void 0===t&&(t=!0),(0,o.$K)(e)&&e!==this._get()&&(this._set(null,null,e,t),this.fireAfterUpdate&&this._listeners.forEach((function(t){return t({url:e})}))),(0,r.Q2)(this)},e.prototype.onChange=function(e){var t=this;return this._listeners.push(e),function(){return(0,o.nA)(t._listeners,e)}},e.prototype.dispose=function(e){(0,o.Wk)(this._listeners)},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js":(e,t,n)=>{"use strict";n.d(t,{u:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=function(){function e(e,t){void 0===t&&(t=!1),this._isHtml5=t,this._baseHref=void 0,this._hashPrefix=""}return e.prototype.port=function(){return location.port?Number(location.port):"https"===this.protocol()?443:80},e.prototype.protocol=function(){return location.protocol.replace(/:/g,"")},e.prototype.host=function(){return location.hostname},e.prototype.html5Mode=function(){return this._isHtml5},e.prototype.hashPrefix=function(e){return(0,o.$K)(e)?this._hashPrefix=e:this._hashPrefix},e.prototype.baseHref=function(e){return(0,o.$K)(e)&&(this._baseHref=e),(0,o.o8)(this._baseHref)&&(this._baseHref=this.getBaseHref()),this._baseHref},e.prototype.getBaseHref=function(){var e=document.getElementsByTagName("base")[0];return e&&e.href?e.href.replace(/^([^/:]*:)?\/\/[^/]*/,""):this._isHtml5?"/":location.pathname||"/"},e.prototype.dispose=function(){},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js":(e,t,n)=>{"use strict";n.d(t,{R:()=>i});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),s=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),a=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(t){var n=e.call(this,t,!1)||this;return r.Jz.addEventListener("hashchange",n._listener,!1),n}return a(t,e),t.prototype._get=function(){return(0,r.Ld)(this._location.hash)},t.prototype._set=function(e,t,n,o){this._location.hash=n},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),r.Jz.removeEventListener("hashchange",this._listener)},t}(s.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/injector.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/core/lib-esm/common/index.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js":(e,t,n)=>{"use strict";n.d(t,{W:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=function(){var e=this;this.dispose=r.ZT,this._baseHref="",this._port=80,this._protocol="http",this._host="localhost",this._hashPrefix="",this.port=function(){return e._port},this.protocol=function(){return e._protocol},this.host=function(){return e._host},this.baseHref=function(){return e._baseHref},this.html5Mode=function(){return!1},this.hashPrefix=function(t){return(0,o.$K)(t)?e._hashPrefix=t:e._hashPrefix}}},"./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>a});var o,r=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),s=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=function(e){function t(t){return e.call(this,t,!0)||this}return s(t,e),t.prototype._get=function(){return this._url},t.prototype._set=function(e,t,n,o){this._url=n},t}(r.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js":(e,t,n)=>{"use strict";var o=n("./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js"),r=n("./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js"),s=n("./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"),a=n("./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js"),i=n("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js"),d=n("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js");n("./node_modules/@uirouter/core/lib-esm/vanilla/injector.js"),n("./node_modules/@uirouter/core/lib-esm/vanilla/q.js"),n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),(0,s._D)("vanilla.hashBangLocation",!1,r.R,o.u),(0,s._D)("vanilla.pushStateLocation",!0,a.h,o.u),(0,s._D)("vanilla.memoryLocation",!1,i.I,d.W)},"./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js":(e,t,n)=>{"use strict";n.d(t,{h:()=>i});var o,r=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),a=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(t){var n=e.call(this,t,!0)||this;return n._config=t.urlService.config,s.Jz.addEventListener("popstate",n._listener,!1),n}return a(t,e),t.prototype._getBasePrefix=function(){return(0,s.Lb)(this._config.baseHref())},t.prototype._get=function(){var e=this._location,t=e.pathname,n=e.hash,o=e.search;o=(0,s.C7)(o)[1],n=(0,s.cW)(n)[1];var r=this._getBasePrefix(),a=t===this._config.baseHref(),i=t.substr(0,r.length)===r;return(t=a?"/":i?t.substring(r.length):t)+(o?"?"+o:"")+(n?"#"+n:"")},t.prototype._set=function(e,t,n,o){var r=this._getBasePrefix(),s=n&&"/"!==n[0]?"/":"",a=""===n||"/"===n?this._config.baseHref():r+s+n;o?this._history.replaceState(e,t,a):this._history.pushState(e,t,a)},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),s.Jz.removeEventListener("popstate",this._listener)},t}(r.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/q.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/core/lib-esm/common/index.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/utils.js":(e,t,n)=>{"use strict";n.d(t,{Qf:()=>s,en:()=>a,Q2:()=>i,_D:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=function(e,t){var n=t[0],r=t[1];return e.hasOwnProperty(n)?(0,o.kJ)(e[n])?e[n].push(r):e[n]=[e[n],r]:e[n]=r,e},s=function(e){return e.split("&").filter(o.yR).map(o.Fb).reduce(r,{})};function a(e){var t=function(e){return e||""},n=(0,o.cW)(e).map(t),r=n[0],s=n[1],a=(0,o.C7)(r).map(t);return{path:a[0],search:a[1],hash:s,url:e}}var i=function(e){var t=e.path(),n=e.search(),r=e.hash(),s=Object.keys(n).map((function(e){var t=n[e];return((0,o.kJ)(t)?t:[t]).map((function(t){return e+"="+t}))})).reduce(o.M7,[]).join("&");return t+(s?"?"+s:"")+(r?"#"+r:"")};function d(e,t,n,o){return function(r){var s=r.locationService=new n(r),a=r.locationConfig=new o(r,t);return{name:e,service:s,configuration:a,dispose:function(e){e.dispose(s),e.dispose(a)}}}}},"./node_modules/@uirouter/core/lib-esm/view/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/view/view.js":(e,t,n)=>{"use strict";n.d(t,{s:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),i=function(){function e(e){var t=this;this.router=e,this._uiViews=[],this._viewConfigs=[],this._viewConfigFactories={},this._listeners=[],this._pluginapi={_rootViewContext:this._rootViewContext.bind(this),_viewConfigFactory:this._viewConfigFactory.bind(this),_registeredUIView:function(e){return(0,o.sE)(t._uiViews,(function(n){return t.router.$id+"."+n.id===e}))},_registeredUIViews:function(){return t._uiViews},_activeViewConfigs:function(){return t._viewConfigs},_onSync:function(e){return t._listeners.push(e),function(){return(0,o.nA)(t._listeners,e)}}}}return e.normalizeUIViewTarget=function(e,t){void 0===t&&(t="");var n=t.split("@"),o=n[0]||"$default",r=(0,s.HD)(n[1])?n[1]:"^",a=/^(\^(?:\.\^)*)\.(.*$)/.exec(o);if(a&&(r=a[1],o=a[2]),"!"===o.charAt(0)&&(o=o.substr(1),r=""),/^(\^(?:\.\^)*)$/.exec(r)){var i=r.split(".").reduce((function(e,t){return e.parent}),e);r=i.name}else"."===r&&(r=e.name);return{uiViewName:o,uiViewContextAnchor:r}},e.prototype._rootViewContext=function(e){return this._rootContext=e||this._rootContext},e.prototype._viewConfigFactory=function(e,t){this._viewConfigFactories[e]=t},e.prototype.createViewConfig=function(e,t){var n=this._viewConfigFactories[t.$type];if(!n)throw new Error("ViewService: No view config factory registered for type "+t.$type);var o=n(e,t);return(0,s.kJ)(o)?o:[o]},e.prototype.deactivateViewConfig=function(e){a.g4.traceViewServiceEvent("<- Removing",e),(0,o.nA)(this._viewConfigs,e)},e.prototype.activateViewConfig=function(e){a.g4.traceViewServiceEvent("-> Registering",e),this._viewConfigs.push(e)},e.prototype.sync=function(){var t=this,n=this._uiViews.map((function(e){return[e.fqn,e]})).reduce(o.bb,{});function s(e){for(var t=e.viewDecl.$context,n=0;++n&&t.parent;)t=t.parent;return n}var i=(0,r.WA)((function(e,t,n,o){return t*(e(n)-e(o))})),d=this._uiViews.sort(i((function(e){var t=function(e){return e&&e.parent?t(e.parent)+1:1};return 1e4*e.fqn.split(".").length+t(e.creationContext)}),1)).map((function(o){var r=t._viewConfigs.filter(e.matches(n,o));return r.length>1&&r.sort(i(s,-1)),{uiView:o,viewConfig:r[0]}})),u=d.map((function(e){return e.viewConfig})),m=this._viewConfigs.filter((function(e){return!(0,o.d3)(u,e)})).map((function(e){return{uiView:void 0,viewConfig:e}}));d.forEach((function(e){-1!==t._uiViews.indexOf(e.uiView)&&e.uiView.configUpdated(e.viewConfig)}));var l=d.concat(m);this._listeners.forEach((function(e){return e(l)})),a.g4.traceViewSync(l)},e.prototype.registerUIView=function(e){a.g4.traceViewServiceUIViewEvent("-> Registering",e);var t=this._uiViews;return t.filter((function(t){return t.fqn===e.fqn&&t.$type===e.$type})).length&&a.g4.traceViewServiceUIViewEvent("!!!! duplicate uiView named:",e),t.push(e),this.sync(),function(){-1!==t.indexOf(e)?(a.g4.traceViewServiceUIViewEvent("<- Deregistering",e),(0,o.nA)(t)(e)):a.g4.traceViewServiceUIViewEvent("Tried removing non-registered uiView",e)}},e.prototype.available=function(){return this._uiViews.map((0,r.vg)("fqn"))},e.prototype.active=function(){return this._uiViews.filter((0,r.vg)("$config")).map((0,r.vg)("name"))},e.matches=function(e,t){return function(n){if(t.$type!==n.viewDecl.$type)return!1;var r=n.viewDecl,s=r.$uiViewName.split("."),a=t.fqn.split(".");if(!(0,o.fS)(s,a.slice(0-s.length)))return!1;var i=1-s.length||void 0,d=a.slice(0,i).join("."),u=e[d].creationContext;return r.$uiViewContextAnchor===(u&&u.name)}},e}()},"./node_modules/angular-aria/angular-aria.js":()=>{!function(e,t){"use strict";var n="ngAriaDisable",o=t.module("ngAria",["ng"]).info({angularVersion:"1.8.2"}).provider("$aria",(function(){var e={ariaHidden:!0,ariaChecked:!0,ariaReadonly:!0,ariaDisabled:!0,ariaRequired:!0,ariaInvalid:!0,ariaValue:!0,tabindex:!0,bindKeydown:!0,bindRoleForClick:!0};function o(t,o,r,a){return function(i,d,u){if(!u.hasOwnProperty(n)){var m=u.$normalize(o);!e[m]||s(d,r)||u[m]||i.$watch(u[t],(function(e){e=a?!e:!!e,d.attr(o,e)}))}}}this.config=function(n){e=t.extend(e,n)},this.$get=function(){return{config:function(t){return e[t]},$$watchExpr:o}}})),r=["BUTTON","A","INPUT","TEXTAREA","SELECT","DETAILS","SUMMARY"],s=function(e,t){if(-1!==t.indexOf(e[0].nodeName))return!0};o.directive("ngShow",["$aria",function(e){return e.$$watchExpr("ngShow","aria-hidden",[],!0)}]).directive("ngHide",["$aria",function(e){return e.$$watchExpr("ngHide","aria-hidden",[],!1)}]).directive("ngValue",["$aria",function(e){return e.$$watchExpr("ngValue","aria-checked",r,!1)}]).directive("ngChecked",["$aria",function(e){return e.$$watchExpr("ngChecked","aria-checked",r,!1)}]).directive("ngReadonly",["$aria",function(e){return e.$$watchExpr("ngReadonly","aria-readonly",r,!1)}]).directive("ngRequired",["$aria",function(e){return e.$$watchExpr("ngRequired","aria-required",r,!1)}]).directive("ngModel",["$aria",function(e){function t(t,n,o,a){return e.config(n)&&!o.attr(t)&&(a||!s(o,r))&&("hidden"!==o.attr("type")||"INPUT"!==o[0].nodeName)}function o(e,t){return!t.attr("role")&&t.attr("type")===e&&!s(t,r)}return{restrict:"A",require:"ngModel",priority:200,compile:function(r,s){if(!s.hasOwnProperty(n)){var a=function(e,t){var n=e.type,o=e.role;return"checkbox"===(n||o)||"menuitemcheckbox"===o?"checkbox":"radio"===(n||o)||"menuitemradio"===o?"radio":"range"===n||"progressbar"===o||"slider"===o?"range":""}(s);return{post:function(n,r,s,i){var d=t("tabindex","tabindex",r,!1);function u(){return i.$modelValue}switch(a){case"radio":case"checkbox":o(a,r)&&r.attr("role",a),t("aria-checked","ariaChecked",r,!1)&&n.$watch(u,"radio"===a?function(e){var t=s.value==i.$viewValue;r.attr("aria-checked",t)}:function(){r.attr("aria-checked",!i.$isEmpty(i.$viewValue))}),d&&r.attr("tabindex",0);break;case"range":if(o(a,r)&&r.attr("role","slider"),e.config("ariaValue")){var m=!r.attr("aria-valuemin")&&(s.hasOwnProperty("min")||s.hasOwnProperty("ngMin")),l=!r.attr("aria-valuemax")&&(s.hasOwnProperty("max")||s.hasOwnProperty("ngMax")),_=!r.attr("aria-valuenow");m&&s.$observe("min",(function(e){r.attr("aria-valuemin",e)})),l&&s.$observe("max",(function(e){r.attr("aria-valuemax",e)})),_&&n.$watch(u,(function(e){r.attr("aria-valuenow",e)}))}d&&r.attr("tabindex",0)}!s.hasOwnProperty("ngRequired")&&i.$validators.required&&t("aria-required","ariaRequired",r,!1)&&s.$observe("required",(function(){r.attr("aria-required",!!s.required)})),t("aria-invalid","ariaInvalid",r,!0)&&n.$watch((function(){return i.$invalid}),(function(e){r.attr("aria-invalid",!!e)}))}}}}}}]).directive("ngDisabled",["$aria",function(e){return e.$$watchExpr("ngDisabled","aria-disabled",r,!1)}]).directive("ngMessages",(function(){return{restrict:"A",require:"?ngMessages",link:function(e,t,o,r){o.hasOwnProperty(n)||t.attr("aria-live")||t.attr("aria-live","assertive")}}})).directive("ngClick",["$aria","$parse",function(e,t){return{restrict:"A",compile:function(o,a){if(!a.hasOwnProperty(n)){var i=t(a.ngClick);return function(t,n,o){s(n,r)||(e.config("bindRoleForClick")&&!n.attr("role")&&n.attr("role","button"),e.config("tabindex")&&!n.attr("tabindex")&&n.attr("tabindex",0),!e.config("bindKeydown")||o.ngKeydown||o.ngKeypress||o.ngKeyup||n.on("keydown",(function(e){var n=e.which||e.keyCode;13!==n&&32!==n||(-1!==r.indexOf(e.target.nodeName)||e.target.isContentEditable||e.preventDefault(),t.$apply((function(){i(t,{$event:e})})))})))}}}}}]).directive("ngDblclick",["$aria",function(e){return function(t,o,a){a.hasOwnProperty(n)||!e.config("tabindex")||o.attr("tabindex")||s(o,r)||o.attr("tabindex",0)}}])}(window,window.angular)},"./node_modules/angular-rateit/dist/ng-rateit.js":()=>{angular.module("ngRateIt",["ng"]).directive("ngRateIt",["$q",function(e){"use strict";return{scope:{ngModel:"=",min:"=?min",max:"=?max",step:"=?step",readOnly:"&?readOnly",pristine:"=?pristine",resetable:"&?resetable",starWidth:"=?starWidth",starHeight:"=?starHeight",canelWidth:"=?canelWidth",cancelHeight:"=?cancelHeight",rated:"&?rated",reset:"&?reset",beforeRated:"&?beforeRated",beforeReset:"&?beforeReset"},templateUrl:"ngRateIt/ng-rate-it.html",require:"ngModel",replace:!0,link:function(t,n,o){o.readOnly||(t.readOnly=function(){return!1}),o.resetable||(t.resetable=function(){return!0}),o.beforeRated||(t.beforeRated=function(){var t=e.defer();return t.resolve(),t.promise}),o.rated||(t.rated=function(){}),o.beforeReset||(t.beforeReset=function(){var t=e.defer();return t.resolve(),t.promise}),o.reset||(t.reset=function(){})},controller:"ngRateItController"}}]).controller("ngRateItController",["$scope","$timeout",function(e,t){"use strict";e.isTouch=!!window.hasOwnProperty("ontouchstart")||window.navigator.msMaxTouchPoints>0,e.orgValue=angular.copy(e.ngModel),e.min=e.min||0,e.max=e.max||5,e.step=e.step||.5,e.pristine=e.orgValue===e.ngModel,e.starWidth=e.starWidth||16,e.starPartWidth=e.starWidth*e.step,e.starHeight=e.starHeight||16,e.canelWidth=e.canelWidth||e.starWidth,e.cancelHeight=e.cancelHeight||e.starHeight;var n=e.max-e.min,o=n/e.step,r=e.$watch("ngModel",(function(){e.pristine=e.orgValue===e.ngModel})),s=function(e){return(e+1)/o*n};e.getStartParts=function(){return new Array(o)},e.getStarOffset=function(t){var n=1/e.step;return-e.starWidth/n*(t%n)},e.isSelected=function(t){return s(t)<=e.ngModel-e.min},e.removeRating=function(){e.resetable()&&!e.readOnly()&&e.beforeReset({rating:e.ngModel}).then((function(){e.ngModel=e.min,e.reset({rating:e.ngModel})}))},e.setValue=function(n){if(!e.readOnly()){var o=angular.copy(e.min+s(n));e.beforeRated({rating:o}).then((function(){e.ngModel=o,t((function(){e.rated({rating:e.ngModel})}))}))}},e.$on("$destroy",(function(){r()}))}]).run(["$templateCache",function(e){"use strict";e.put("ngRateIt/ng-rate-it.html",'
')}])},"./src/js/index.module.js":(e,t,n)=>{"use strict";n("./node_modules/angular-animate/index.js"),n("./node_modules/angular-aria/index.js"),n("./node_modules/angular-messages/index.js"),n("./node_modules/angular-material/index.js"),n("./node_modules/angular-resource/index.js"),n("./node_modules/angular-sanitize/index.js"),n("./node_modules/ng-csv/build/ng-csv.min.js"),n("./node_modules/ng-embed/src/ng-embed.js"),n("./node_modules/@uirouter/angularjs/lib-esm/index.js"),n("./node_modules/angular-local-storage/index.js"),n("./node_modules/angular-rateit/dist/ng-rateit.js"),n("./node_modules/@flowjs/ng-flow/dist/ng-flow.js"),n("./node_modules/emojionearea/dist/emojionearea.js"),n("./node_modules/jquery-textcomplete/dist/jquery.textcomplete.js");var o=n("./node_modules/moment/moment.js"),r=n.n(o),s=n("./node_modules/lodash.map/index.js"),a=n.n(s);function i(e,t,n,o,s,i,d,u,m){const l=this;function _(t,n,o){const r=i.get(t)||{};o?delete r[e.location]:r[e.location]=n,i.set(t,r)}function c(n){var o;e.layout.up=n,_(u,e.layout),o=n?"show":"hide",t.parent.postMessage({cmd:o},"*"),e.$$phase||e.$apply()}e.location=e.settings.location,l.$onInit=function(){e.status="init";const o=e.settings.color,r=e.settings.textColor,s=e.settings.textButtonColor||e.settings.textColor,a=e.settings.color_button,d=e.settings.backgroundColor,l=Math.max(document.documentElement.clientHeight,window.innerHeight||0),_=document.documentElement.clientWidth;document.documentElement.style.setProperty("--xc-ws-div-color",o),document.documentElement.style.setProperty("--xc-ws-text-color",r),document.documentElement.style.setProperty("--xc-ws-text-button-color",s),document.documentElement.style.setProperty("--xc-ws-button-color",a),document.documentElement.style.setProperty("--xc-ws-background-color",d),document.documentElement.style.setProperty("--xc-ws-client-height",l),document.documentElement.style.setProperty("--xc-ws-client-width",_);let h=!1;const f=i.get(m)||{},p=i.get(u)||{};e.visitor=f[e.location]?f[e.location]:{},e.layout=p[e.location]?p[e.location]:{},e.visitor.interaction&&e.layout.up?h=!0:e.layout.up=!0,"bottom_right"===e.settings.alignment&&c(h),n.go(function(){const t=e.settings.online,n=!!(e.visitor&&e.visitor.interaction&&e.visitor.interaction.id),o=Number(e.settings.maxInteractions)&&Number(e.settings.openedInteractions)>=Number(e.settings.maxInteractions);return!!(n||!o&&t)}()?"app.online":"app.offline",null,{location:"replace"});let M="";M=e.settings.online||!e.settings.hideWhenOffline?"init":"offline",t.parent.postMessage({cmd:M,div_color:o,text_color:r,client_height:l,client_width:_},"*");const y=document.createElement("style");document.head.appendChild(y),y.sheet.insertRule(".mdi-send:before {color:"+e.settings.color+"!important}")},l.close=function(){const t=e.visitor.interaction;if(t&&t.id){const s=o.confirm().parent(angular.element(document.querySelector("#chat-app"))).clickOutsideToClose(!0).title(e.settings.closingQuestion||"Do you want to close the interaction?").ok("Ok").cancel("Cancel");o.show(s).then((function(){return d.chatInteraction.customUpdate({id:t.id,closed:!0,closeReason:"contact",closedAt:r()().format("YYYY-MM-DD HH:mm:ss")}).$promise})).then((function(){n.go("app.closing",null,{location:"replace"})})).catch((function(e){console.error("keep open",e)}))}},l.toggle=c,l.download=function(){const t=s.defer(),n=e.visitor.interaction;return n&&n.id&&d.chatInteraction.getMessages({intid:n.id,includeAll:!0}).$promise.then((function(n){t.resolve(a()(n.rows.slice(1),(function(t){let n;if("in"===t.direction&&(n=e.settings.customerAlias||e.visitor.from||"Visitor"+t.ContactId),"out"===t.direction)switch(e.settings.agentIdentifier){case"website_alias":n=t.UserId?e.settings.agentAlias+t.UserId:"System";break;case"agent_alias":n=t.UserId?t.User.alias||t.User.fullname:"System";break;case"agent_fullname":n=t.UserId?t.User.fullname:"System";break;default:n=t.UserId?e.settings.agentAlias+t.UserId:"System"}return{sender:n,message:t.body,createdAt:r()(t.createdAt).format("MM/DD/YYYY HH:mm:ss")}})))})).catch((function(e){console.error(e)})),t.promise},l.getHeaderShape=function(){return"rounded"===e.settings.header_shape?"15px":"0px"};const h={online:["online","chat","waiting","closing","unmanaged"],offline:["offline"]};Object.defineProperty(e,"actualTitle",{get(){let t=e.settings.defaultTitle;return h.online.includes(e.status)?t=e.settings.header_online:h.offline.includes(e.status)&&(t=e.settings.header_offline),t}}),e.updateStorage=_,window.addEventListener("message",(function(e){"show"===e.data.evt?c(!0):"hide"===e.data.evt&&c(!1)}),!1)}i.$inject=["$rootScope","$window","$state","$mdDialog","$q","localStorageService","api","STORAGE_LAYOUT","STORAGE_VISITOR"];var d=n("./node_modules/lodash.forin/index.js"),u=n.n(d),m=n("./node_modules/lodash.isnil/index.js"),l=n.n(m),_=n("./src/js/chat/index.tpl.html"),c=n("./src/js/closing/index.tpl.html"),h=n("./src/js/offline/index.tpl.html"),f=n("./src/js/online/index.tpl.html"),p=n("./src/js/unmanaged/index.tpl.html"),M=n("./src/js/waiting/index.tpl.html");function y(e,t){const n=t.search();e.settings={cursor:"pointer",hide:!0},u()(n,(function(t,n){""===t||l()(t)||("true"===t&&(t=!0),"false"===t&&(t=!1),e.settings[n]=t)}))}function L(e,t,n,o,r,s){n.html5Mode(!0),o.defaults.headers.get||(o.defaults.headers.get={}),o.defaults.headers.get["If-Modified-Since"]="Mon, 26 Jul 1997 05:00:00 GMT",o.defaults.headers.get["Cache-Control"]="no-cache",o.defaults.headers.get.Pragma="no-cache",r.setPrefix(s),e.state("app",{abstract:!0}).state("app.waiting",{url:"/waiting",templateUrl:M,controller:"WaitingController as vm"}).state("app.online",{url:"/online",templateUrl:f,controller:"OnlineController as vm"}).state("app.offline",{url:"/offline",templateUrl:h,controller:"OfflineController as vm"}).state("app.chat",{url:"/chat",templateUrl:_,controller:"ChatController as vm"}).state("app.unmanaged",{url:"/unmanaged",templateUrl:p,controller:"UnmanagedController as vm"}).state("app.closing",{url:"/closing",templateUrl:c,controller:"ClosingController as vm"})}L.$inject=["$stateProvider","$urlRouterProvider","$locationProvider","$httpProvider","localStorageServiceProvider","STORAGE_PREFIX"],y.$inject=["$rootScope","$location"];var Y=n("./node_modules/lodash.merge/index.js"),g=n.n(Y);function v(e,t,n,o,r,s){const a=this;function i(t){return function(o){a.errors[t]=o.data;const r=n.simple().textContent(e.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").position("top");n.show(r)}}function d(){e.loading=!1}function u(){e.settings.online?t.go("app.online",null,{location:"replace"}):t.go("app.offline",null,{location:"replace"})}function m(){a.form={},a.upColor=null,a.downColor=null,a.userForm.$setPristine(),a.userForm.$setUntouched(),delete e.visitor.interaction,e.enableDownload=!1}a.$onInit=function(){e.status="closing",e.updateStorage(r,null,!0),e.updateStorage(s,null,!0),e.loading=!1},a.submit=function(){e.loading=!0,e.visitor.interaction&&e.visitor.interaction.id?o.chatInteraction.close(g()({id:e.visitor.interaction.id,ratingType:e.settings.ratingType,customer:e.settings.customerAlias||e.visitor.from},a.form)).$promise.then((function(){delete a.errors.submit;const t=n.simple().textContent(e.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(t)})).then(m).then(u).catch(i("submit")).finally(d):(d(),i("submit"))},a.skip=function(){m(),u()},a.form={},a.errors={}}function k(e,t){const n={id:"@id",token:e.settings.token},o={};return o.baseUrl=e.settings.remote+"/api/",o.chatWebsite=t(o.baseUrl+"chat/websites/:id",n,{notify:{method:"POST",url:o.baseUrl+"chat/websites/:id/notify"},offline:{method:"POST",url:o.baseUrl+"chat/websites/:id/offline"},getFields:{method:"GET",url:o.baseUrl+"chat/websites/:id/fields"}}),o.chatInteraction=t(o.baseUrl+"chat/interactions/:id",n,{update:{method:"PUT",url:o.baseUrl+"chat/interactions/:id"},customUpdate:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/custom_update"},close:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/close"},getMessages:{method:"GET",url:o.baseUrl+"chat/interactions/:intid/my_messages"},uploadAttachment:{method:"POST",url:o.baseUrl+"chat/interactions/:id/attachment_upload",headers:{"Content-Type":void 0},transformRequest:angular.identity},downloadAttachment:{method:"GET",url:o.baseUrl+"chat/interactions/:id/attachment_download"}}),o.chatMessage=t(o.baseUrl+"chat/messages/:id",n,{update:{method:"PUT",url:o.baseUrl+"chat/messages/:id"}}),o}v.$inject=["$rootScope","$state","$mdToast","api","STORAGE_VISITOR","STORAGE_LAYOUT"],k.$inject=["$rootScope","$resource"];var j=n("./node_modules/lodash.find/index.js"),w=n.n(j),b=n("./node_modules/lodash.values/index.js"),D=n.n(b),T=n("./node_modules/jquery/dist/jquery.js");function S(e,t,n,o,r,s,a,i,d,u){const m=this;let _,c,h,f;function p(){n((function(){const e=r[0].getElementsByClassName("chat-messages")[0];e&&(e.scrollTop=e.scrollHeight)}))}function M(e){return function(t){m.errors[e]=t.data,p()}}function y(e){i.chatWebsite.notify(e).$promise.then((function(e){delete m.errors.chatMessageError,l()(t.visitor.interaction)&&(t.visitor.interaction={id:e.interaction.id},t.updateStorage(d,t.visitor)),_[0].emojioneArea.setText(""),p()})).catch(M("chatMessageError"))}function L(){t.settings.online?s.go("app.online",null,{location:"replace"}):s.go("app.offline",null,{location:"replace"})}function Y(){t.visitor&&t.visitor.interaction&&t.visitor.interaction.id&&i.chatInteraction.get({id:t.visitor.interaction.id}).$promise.then((function(e){delete m.errors.getInteraction,e.closed&&(t.visitor.interaction.closed=!0,t.updateStorage(d,t.visitor),"unmanaged"===e.disposition?s.go("app.unmanaged",null,{location:"replace"}):s.go("app.closing",null,{location:"replace"}))})).catch((function(e){switch(e.status){case 403:s.go("app.closing",null,{location:"replace"});break;case 404:t.updateStorage(d,null,!0),t.updateStorage(u,null,!0),L();break;case 405:s.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}function v(e){const n=_[0].emojioneArea.getText();e&&13===e.keyCode&&e.shiftKey||e&&13!==e.keyCode||""!==n&&y(g()({body:n},t.visitor))}function k(){t.visitor&&t.visitor.interaction&&t.visitor.interaction.id&&i.chatInteraction.getMessages({intid:t.visitor.interaction.id,includeAgent:!0,id:f||void 0}).$promise.then((function(e){if(delete m.errors.interaction,e.count){let o=!1,r=0;for(r=0,o=!1;r'+e.name+"",AttachmentId:e.id},t.visitor))):M("sendAttachment")}),M("sendAttachment"))},e.$on("$destroy",(function(){o.cancel(c),o.cancel(h),c=null,h=null})),t.$on("$download",(function(e,n){n&&n(D()(t.messages))}))}S.$inject=["$scope","$rootScope","$timeout","$interval","$document","$state","$http","api","STORAGE_VISITOR","STORAGE_LAYOUT"];var H=n("./node_modules/lodash.random/index.js"),x=n.n(H),E=n("./node_modules/lodash.clonedeep/index.js"),P=n.n(E),O=n("./node_modules/json-form-data/src/jsonToFormData.js"),$=n.n(O);function A(e,t,n,o,r,s,a){const i=this;let d=null,u=null;t.typeField="";const m={showLeafArrayIndexes:!0,includeNullValues:!1,mapping:function(e){return"boolean"==typeof e?+e?"1":"0":e}};function _(){delete i.errors.submit,t.$emit("hide"),i.fields=P()(u),i.form={},i.userForm.$setPristine(),i.userForm.$setUntouched();const e=r.simple().textContent(t.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));r.show(e)}i.trustAsHtml=function(e){return n.trustAsHtml(e)},i.initUploadButton=function(t){const n=i.fields[t],o=s.find(".upload-item");if(o.length){const t=angular.element(o[0].querySelector(".upload-button")),r=angular.element(o[0].querySelector("input[type=file]")),s=t.find("label");s.length&&s.css("display","none"),t.on("click",(()=>{s.css("display","none"),"function"==typeof r.trigger?r.trigger("click"):r[0].click()})),r.on("change",(t=>{e.$apply((function(){"string"==typeof n.props.error&&(n.props.error=null);const e=Array.from(t.target.files),o=1048576*n.config.size;e.some((e=>e.size>=o))?(n.options=[],n.props.error=n.config.sizeErrMessage):n.options=e.map((e=>{const{name:t,size:n,type:o}=e;return{name:t,size:n,type:o,file:e}})),i.form[n.props.title]=n.options}))}))}},i.removeFileItem=function(e,t){e.options.splice(t,1),i.form[e.props.title]=e.options},i.setupFileInput=function(e){console.log("form item setup",e);const t=s.find(".upload-item"),n=angular.element(t[0].querySelector("input[type=file]")),{multipleUpload:o,accept:r}=e.config;o&&n.attr("multiple","multiple"),r&&n[0].setAttribute("accept",r)},i.makeFileOptionsVisible=function(){const e=Array.from(s.find(".filename-label")),t=e[e.length-1];t&&t.scrollIntoView&&t.scrollIntoView()},i.$onInit=function(){t.status="offline",i.visitor={id:t.settings.id,mapKeyOffline:"firstName",from:"Anonymous"+x()(1,1e6)},t.settings.showMenu=!1,t.loading=!1,o.chatWebsite.getFields({id:t.settings.id,online:!1}).$promise.then((function(e){e.count&&(d=e.fromKey,u=P()(e.rows),i.fields=P()(u))})).then((function(){for(let e=0;e]+)>)/i);i.checkHTML[e]=t(n.props.helpText)}}})).catch((function(e){console.error(e)}))},i.submit=function(){t.loading=!0;const e={...i.form};for(let n=0;ne.file))))}const n=Array.isArray(i.fields)?i.fields.filter((e=>"upload"===e.type)):[],s=g()({body:e},i.visitor),u=null!=e&&n.length>0,c=null!==e&&"{}"!==JSON.stringify(e);var h,f;(u?(h=s,a({url:`${o.baseUrl}chat/websites/${h.id}/offline`,headers:{"Content-Type":void 0},data:$()(h,{...m,initialFormData:new FormData}),method:"POST"})):c?o.chatWebsite.offline(s).$promise:Promise.reject("INVALID_FORM")).then(_).catch((f="submit",function(e){const n=r.simple().textContent(t.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").parent(angular.element(document.querySelector("#chat-toolbar")));r.show(n),i.errors[f]=e.data})).finally((()=>{i.form.invalid||(i.form={}),t.loading=!1}))},i.toggle=function(e,t){i.form[e]||(i.form[e]=[]);const n=i.form[e].indexOf(t);n>-1?i.form[e].splice(n,1):i.form[e].push(t)},i.exists=function(e,t){return i.form[e]||(i.form[e]=[]),i.form[e].indexOf(t)>-1},i.checkHTML=[],i.form={},i.errors={},i.userForm={}}function F(e,t,n,o,s,a){const i=this;let d=null;function u(){return"Anonymous"+x()(1,1e6)}i.checkHTML=[],i.form={},i.errors={},i.userForm={},i.disableItem=!1,i.trustAsHtml=function(e){return n.trustAsHtml(e)},i.$onInit=function(){if(e.status="online",e.visitor&&e.visitor.interaction)if(e.visitor.interaction.id)if(e.visitor.interaction.UserId)t.go("app.chat",null,{location:"replace"});else{const t=e.visitor.interaction.id,n=JSON.stringify({channel:"chat",interaction:{id:t},message:{id:e.visitor.message.id},disposition:"abandoned",closed:!0,closeReason:"contact",closedAt:r()().format("YYYY-MM-DD HH:mm:ss")});o({url:`${e.settings.remote}/api/chat/interactions/${t}/abandon?token=${e.settings.token}`,headers:{"Content-Type":"application/json; charset=utf-8"},data:n,method:"PUT"}),e.visitor={id:e.settings.id,mapKey:"firstName",from:u()},e.settings.showMenu=!1,e.updateStorage(a,e.visitor),s.chatWebsite.getFields({id:e.settings.id,online:!0}).$promise.then((function(e){e.count&&(d=e.fromKey,i.fields=e.rows)})).then((function(){for(let e=0;e]+)>)/i);i.checkHTML[e]=n(t.props.helpText)}}})).catch((function(e){console.error(e)}))}else t.go("app.waiting",null,{location:"replace"});else e.visitor={id:e.settings.id,mapKey:"firstName",from:u()},e.settings.showMenu=!1,e.updateStorage(a,e.visitor),s.chatWebsite.getFields({id:e.settings.id,online:!0}).$promise.then((function(e){e.count&&(d=e.fromKey,i.fields=e.rows)})).then((function(){for(let e=0;e]+)>)/i);i.checkHTML[e]=n(t.props.helpText)}}})).catch((function(e){console.error(e)}))},i.submit=function(){let n="New chat request \n";for(let t=0;t-1?i.form[e].splice(n,1):i.form[e].push(t)},i.exists=function(e,t){return i.form[e]||(i.form[e]=[]),i.form[e].indexOf(t)>-1}}function R(e,t,n,o,r,s){const a=this;function i(){e.settings.online?t.go("app.online",null,{location:"replace"}):t.go("app.offline",null,{location:"replace"})}function d(){a.form={},a.upColor=null,a.downColor=null,a.userForm.$setPristine(),a.userForm.$setUntouched(),e.visitor={},e.enableDownload=!1,e.$emit("hide")}function u(t){return function(o){a.errors[t]=o.data;const r=n.simple().textContent(e.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(r)}}function m(){e.loading=!1}a.form={},a.errors={},a.$onInit=function(){e.status="unmanaged",e.updateStorage(r,null,!0),e.updateStorage(s,null,!0),e.loading=!1},a.submit=function(){e.loading=!0,e.visitor.interaction&&e.visitor.interaction.id?o.chatInteraction.customUpdate({id:e.visitor.interaction.id,note:a.form.note}).$promise.then((function(){delete a.errors.submit;const t=n.simple().textContent(e.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(t)})).then(d).then(i).catch(u("submit")).finally(m):(m(),u("submit"))},a.skip=function(){d(),i()}}function W(e,t,n,o,s,a,i,d){let u,m=!1;function l(){let t={},n=!1;a.chatInteraction.get({id:e.visitor.interaction.id}).$promise.then((function(n){return t=n,a.chatInteraction.getMessages({intid:e.visitor.interaction.id}).$promise})).then((function(r){n=r.rows.length>1,t.closed?(e.visitor.interaction.closed=!0,e.updateStorage(i,e.visitor),"unmanaged"===t.disposition&&o.go("app.unmanaged",null,{location:"replace"})):t.UserId?(e.visitor.interaction.UserId=t.UserId,e.updateStorage(i,e.visitor),o.go("app.chat",null,{location:"replace"})):n&&o.go("app.chat",null,{location:"replace"})})).catch((function(e){switch(e.status){case 403:o.go("app.closing",null,{location:"replace"});break;case 405:o.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}function _(){if(e.visitor&&e.visitor.interaction&&e.visitor.interaction.id&&!m){m=!0;const t=new XMLHttpRequest;t.open("PUT",e.settings.remote+"/api/chat/interactions/"+e.visitor.interaction.id+"/abandon?token="+e.settings.token,!1),t.setRequestHeader("Content-type","application/json; charset=utf-8"),t.send(JSON.stringify({channel:"chat",interaction:{id:e.visitor.interaction.id},message:{id:e.visitor.message.id},disposition:"abandoned",closed:!0,closeReason:"contact",closedAt:r()().format("YYYY-MM-DD HH:mm:ss")})),4===t.readyState&&200===t.status&&(e.updateStorage(i,null,!0),e.updateStorage(d,null,!0))}}this.$onInit=function(){e.status="waiting",e.visitor&&e.visitor.interaction&&e.visitor.interaction.id&&(u=n(l,3e3))},t.$on("$destroy",(function(){s.removeEventListener("beforeunload",_),s.removeEventListener("unload",_),n.cancel(u)})),s.addEventListener("beforeunload",_),s.addEventListener("unload",_)}function C(e){return function(t){return e.trustAsHtml(t)}}A.$inject=["$scope","$rootScope","$sce","api","$mdToast","$element","$http"],F.$inject=["$rootScope","$state","$sce","$http","api","STORAGE_VISITOR"],R.$inject=["$rootScope","$state","$mdToast","api","STORAGE_VISITOR","STORAGE_LAYOUT"],W.$inject=["$rootScope","$scope","$interval","$state","$window","api","STORAGE_VISITOR","STORAGE_LAYOUT"],C.$inject=["$sce"],angular.module("motion-chat",["ngAnimate","ngAria","ngMessages","ngMaterial","ngResource","ngSanitize","ngCsv","ngEmbed","ui.router","LocalStorageModule","ngRateIt","flow"]).filter("toTrusted",C).constant("STORAGE_PREFIX","motion_chat").constant("STORAGE_VISITOR","visitor").constant("STORAGE_LAYOUT","layout").directive("ngEnter",(function(){return function(e,t,n){t.bind("keydown keypress",(function(t){13===t.which&&(e.$apply((function(){e.$eval(n.ngEnter)})),t.preventDefault())}))}})).directive("ngPrint",(function(){return{link:function(e,t){t.on("click",(function(){document.getElementById("chatContent1")&&function(e,t){const n=document.createElement("div"),o=t.visitor,s=t.settings;let a;for(let e=0;e"+document.title+""),i.document.write(""),i.document.write("

Website: "+s.referer+"

"),i.document.write("

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

"),i.document.write("

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

"),i.document.write(n.innerHTML),i.document.write(""),i.document.close(),i.focus(),i.print(),i.close()}(0,e)}))},restrict:"A"}})).controller("ChatController",S).controller("ClosingController",v).config(["$mdGestureProvider",function(e){e.skipClickHijack()}]).controller("IndexController",i).factory("api",k).config(L).run(y).controller("OfflineController",A).config(["$mdGestureProvider",function(e){e.skipClickHijack()}]).controller("OnlineController",F).controller("UnmanagedController",R).controller("WaitingController",W)},"./node_modules/expose-loader/dist/runtime/getGlobalThis.js":(e,t,n)=>{"use strict";e.exports=function(){if("object"==typeof globalThis)return globalThis;var e;try{e=this||new Function("return this")()}catch(e){if("object"==typeof window)return window;if("object"==typeof self)return self;if(void 0!==n.g)return n.g}return e}()},"./node_modules/json-form-data/src/jsonToFormData.js":function(e,t){var n,o;(o=this)||(o={}),void 0===(n=function(){return o.jsonToFormData=function(){function e(e){return"[object Array]"==={}.toString.call(e)}function t(t){return!(e(t)||"object"!=typeof t||!t||t instanceof Blob||t instanceof Date)}function n(){return"function"==typeof FormData}function o(){if(n())return new FormData}function r(n,o,s,a){var i=0;for(var d in n){if(n.hasOwnProperty(d)){var u=a||d,m=o.mapping(n[d]);if(a&&t(n)&&(u=a+"["+d+"]"),a&&e(n)&&(u=e(m)||o.showLeafArrayIndexes?a+"["+i+"]":a+"[]"),e(m)||t(m))r(m,o,s,u);else if(m instanceof FileList)for(var l=0;l=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-dz.js":function(e,t,n){!function(e){"use strict";var t=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},n={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},o=function(e){return function(o,r,s,a){var i=t(o),d=n[e][t(o)];return 2===i&&(d=d[r?0:1]),d.replace(/%d/i,o)}},r=["جانفي","فيفري","مارس","أفريل","ماي","جوان","جويلية","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-dz",{months:r,monthsShort:r,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:o("s"),ss:o("s"),m:o("m"),mm:o("m"),h:o("h"),hh:o("h"),d:o("d"),dd:o("d"),M:o("M"),MM:o("M"),y:o("y"),yy:o("y")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:0,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-kw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-kw",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:0,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-ly.js":function(e,t,n){!function(e){"use strict";var t={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},n=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},o={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},r=function(e){return function(t,r,s,a){var i=n(t),d=o[e][n(t)];return 2===i&&(d=d[r?0:1]),d.replace(/%d/i,t)}},s=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-ly",{months:s,monthsShort:s,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:r("s"),ss:r("s"),m:r("m"),mm:r("m"),h:r("h"),hh:r("h"),d:r("d"),dd:r("d"),M:r("M"),MM:r("M"),y:r("y"),yy:r("y")},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-ma.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-sa.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"};e.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-tn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-tn",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},o=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},r={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},s=function(e){return function(t,n,s,a){var i=o(t),d=r[e][o(t)];return 2===i&&(d=d[n?0:1]),d.replace(/%d/i,t)}},a=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar",{months:a,monthsShort:a,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:s("s"),ss:s("s"),m:s("m"),mm:s("m"),h:s("h"),hh:s("h"),d:s("d"),dd:s("d"),M:s("M"),MM:s("M"),y:s("y"),yy:s("y")},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/az.js":function(e,t,n){!function(e){"use strict";var t={1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"};e.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"bir neçə saniyə",ss:"%d saniyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(e){return/^(gündüz|axşam)$/.test(e)},meridiem:function(e,t,n){return e<4?"gecə":e<12?"səhər":e<17?"gündüz":"axşam"},dayOfMonthOrdinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(e){if(0===e)return e+"-ıncı";var n=e%10;return e+(t[n]||t[e%100-n]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/be.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"хвіліна":"хвіліну":"h"===n?t?"гадзіна":"гадзіну":e+" "+(o=+e,r={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:t?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}e.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:t,mm:t,h:t,hh:t,d:"дзень",dd:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(e){return/^(дня|вечара)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночы":e<12?"раніцы":e<17?"дня":"вечара"},dayOfMonthOrdinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e%10!=2&&e%10!=3||e%100==12||e%100==13?e+"-ы":e+"-і";case"D":return e+"-га";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bg.js":function(e,t,n){!function(e){"use strict";e.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"яну_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Миналата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[Миналия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",ss:"%d секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",w:"седмица",ww:"%d седмици",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bm.js":function(e,t,n){!function(e){"use strict";e.defineLocale("bm",{months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo".split("_"),monthsShort:"Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des".split("_"),weekdays:"Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),weekdaysShort:"Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm"},calendar:{sameDay:"[Bi lɛrɛ] LT",nextDay:"[Sini lɛrɛ] LT",nextWeek:"dddd [don lɛrɛ] LT",lastDay:"[Kunu lɛrɛ] LT",lastWeek:"dddd [tɛmɛnen lɛrɛ] LT",sameElse:"L"},relativeTime:{future:"%s kɔnɔ",past:"a bɛ %s bɔ",s:"sanga dama dama",ss:"sekondi %d",m:"miniti kelen",mm:"miniti %d",h:"lɛrɛ kelen",hh:"lɛrɛ %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bn-bd.js":function(e,t,n){!function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn-bd",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/রাত|ভোর|সকাল|দুপুর|বিকাল|সন্ধ্যা|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t?e<4?e:e+12:"ভোর"===t||"সকাল"===t?e:"দুপুর"===t?e>=3?e:e+12:"বিকাল"===t||"সন্ধ্যা"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"রাত":e<6?"ভোর":e<12?"সকাল":e<15?"দুপুর":e<18?"বিকাল":e<20?"সন্ধ্যা":"রাত"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bn.js":function(e,t,n){!function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t&&e>=4||"দুপুর"===t&&e<5||"বিকাল"===t?e+12:e},meridiem:function(e,t,n){return e<4?"রাত":e<10?"সকাল":e<17?"দুপুর":e<20?"বিকাল":"রাত"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bo.js":function(e,t,n){!function(e){"use strict";var t={1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"},n={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"};e.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་1_ཟླ་2_ཟླ་3_ཟླ་4_ཟླ་5_ཟླ་6_ཟླ་7_ཟླ་8_ཟླ་9_ཟླ་10_ཟླ་11_ཟླ་12".split("_"),monthsShortRegex:/^(ཟླ་\d{1,2})/,monthsParseExact:!0,weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི_ཟླ_མིག_ལྷག_ཕུར_སངས_སྤེན".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",ss:"%d སྐར་ཆ།",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(e){return e.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,meridiemHour:function(e,t){return 12===e&&(e=0),"མཚན་མོ"===t&&e>=4||"ཉིན་གུང"===t&&e<5||"དགོང་དག"===t?e+12:e},meridiem:function(e,t,n){return e<4?"མཚན་མོ":e<10?"ཞོགས་ཀས":e<17?"ཉིན་གུང":e<20?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/br.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return e+" "+function(e,t){return 2===t?function(e){var t={m:"v",b:"v",d:"z"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}(e):e}({mm:"munutenn",MM:"miz",dd:"devezh"}[n],e)}function n(e){return e>9?n(e%10):e}var o=[/^gen/i,/^c[ʼ\']hwe/i,/^meu/i,/^ebr/i,/^mae/i,/^(mez|eve)/i,/^gou/i,/^eos/i,/^gwe/i,/^her/i,/^du/i,/^ker/i],r=/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,s=[/^Su/i,/^Lu/i,/^Me([^r]|$)/i,/^Mer/i,/^Ya/i,/^Gw/i,/^Sa/i];e.defineLocale("br",{months:"Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),weekdaysParse:s,fullWeekdaysParse:[/^sul/i,/^lun/i,/^meurzh/i,/^merc[ʼ\']her/i,/^yaou/i,/^gwener/i,/^sadorn/i],shortWeekdaysParse:[/^Sul/i,/^Lun/i,/^Meu/i,/^Mer/i,/^Yao/i,/^Gwe/i,/^Sad/i],minWeekdaysParse:s,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,monthsShortStrictRegex:/^(gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY HH:mm",LLLL:"dddd, D [a viz] MMMM YYYY HH:mm"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warcʼhoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Decʼh da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s ʼzo",s:"un nebeud segondennoù",ss:"%d eilenn",m:"ur vunutenn",mm:t,h:"un eur",hh:"%d eur",d:"un devezh",dd:t,M:"ur miz",MM:t,y:"ur bloaz",yy:function(e){switch(n(e)){case 1:case 3:case 4:case 5:case 9:return e+" bloaz";default:return e+" vloaz"}}},dayOfMonthOrdinalParse:/\d{1,2}(añ|vet)/,ordinal:function(e){return e+(1===e?"añ":"vet")},week:{dow:1,doy:4},meridiemParse:/a.m.|g.m./,isPM:function(e){return"g.m."===e},meridiem:function(e,t,n){return e<12?"a.m.":"g.m."}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bs.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=e+" ";switch(n){case"ss":return o+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return o+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return o+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return o+(1===e?"dan":"dana");case"MM":return o+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return o+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ca",{months:{standalone:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),format:"de gener_de febrer_de març_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.".split("_"),monthsParseExact:!0,weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dt_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"uns segons",ss:"%d segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cs.js":function(e,t,n){!function(e){"use strict";var t="leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),n="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),o=[/^led/i,/^úno/i,/^bře/i,/^dub/i,/^kvě/i,/^(čvn|červen$|června)/i,/^(čvc|červenec|července)/i,/^srp/i,/^zář/i,/^říj/i,/^lis/i,/^pro/i],r=/^(leden|únor|březen|duben|květen|červenec|července|červen|června|srpen|září|říjen|listopad|prosinec|led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i;function s(e){return e>1&&e<5&&1!=~~(e/10)}function a(e,t,n,o){var r=e+" ";switch(n){case"s":return t||o?"pár sekund":"pár sekundami";case"ss":return t||o?r+(s(e)?"sekundy":"sekund"):r+"sekundami";case"m":return t?"minuta":o?"minutu":"minutou";case"mm":return t||o?r+(s(e)?"minuty":"minut"):r+"minutami";case"h":return t?"hodina":o?"hodinu":"hodinou";case"hh":return t||o?r+(s(e)?"hodiny":"hodin"):r+"hodinami";case"d":return t||o?"den":"dnem";case"dd":return t||o?r+(s(e)?"dny":"dní"):r+"dny";case"M":return t||o?"měsíc":"měsícem";case"MM":return t||o?r+(s(e)?"měsíce":"měsíců"):r+"měsíci";case"y":return t||o?"rok":"rokem";case"yy":return t||o?r+(s(e)?"roky":"let"):r+"lety"}}e.defineLocale("cs",{months:t,monthsShort:n,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(leden|ledna|února|únor|březen|března|duben|dubna|květen|května|červenec|července|červen|června|srpen|srpna|září|říjen|října|listopadu|listopad|prosinec|prosince)/i,monthsShortStrictRegex:/^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:a,ss:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("cv",{months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ӗнер] LT [сехетре]",nextWeek:"[Ҫитес] dddd LT [сехетре]",lastWeek:"[Иртнӗ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(e){return e+(/сехет$/i.exec(e)?"рен":/ҫул$/i.exec(e)?"тан":"ран")},past:"%s каялла",s:"пӗр-ик ҫеккунт",ss:"%d ҫеккунт",m:"пӗр минут",mm:"%d минут",h:"пӗр сехет",hh:"%d сехет",d:"пӗр кун",dd:"%d кун",M:"пӗр уйӑх",MM:"%d уйӑх",y:"пӗр ҫул",yy:"%d ҫул"},dayOfMonthOrdinalParse:/\d{1,2}-мӗш/,ordinal:"%d-мӗш",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cy.js":function(e,t,n){!function(e){"use strict";e.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",ss:"%d eiliad",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},dayOfMonthOrdinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(e){var t="";return e>20?t=40===e||50===e||60===e||80===e||100===e?"fed":"ain":e>0&&(t=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"][e]),e+t},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/da.js":function(e,t,n){!function(e){"use strict";e.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"på dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[i] dddd[s kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",ss:"%d sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de-at.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de-ch.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-ch",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/dv.js":function(e,t,n){!function(e){"use strict";var t=["ޖެނުއަރީ","ފެބްރުއަރީ","މާރިޗު","އޭޕްރީލު","މޭ","ޖޫން","ޖުލައި","އޯގަސްޓު","ސެޕްޓެމްބަރު","އޮކްޓޯބަރު","ނޮވެމްބަރު","ޑިސެމްބަރު"],n=["އާދިއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"];e.defineLocale("dv",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/މކ|މފ/,isPM:function(e){return"މފ"===e},meridiem:function(e,t,n){return e<12?"މކ":"މފ"},calendar:{sameDay:"[މިއަދު] LT",nextDay:"[މާދަމާ] LT",nextWeek:"dddd LT",lastDay:"[އިއްޔެ] LT",lastWeek:"[ފާއިތުވި] dddd LT",sameElse:"L"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",ss:"d% ސިކުންތު",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:7,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/el.js":function(e,t,n){!function(e){"use strict";e.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(e,t){return e?"string"==typeof t&&/D/.test(t.substring(0,t.indexOf("MMMM")))?this._monthsGenitiveEl[e.month()]:this._monthsNominativeEl[e.month()]:this._monthsNominativeEl},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(e,t,n){return e>11?n?"μμ":"ΜΜ":n?"πμ":"ΠΜ"},isPM:function(e){return"μ"===(e+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){switch(this.day()){case 6:return"[το προηγούμενο] dddd [{}] LT";default:return"[την προηγούμενη] dddd [{}] LT"}},sameElse:"L"},calendar:function(e,t){var n,o=this._calendarEl[e],r=t&&t.hours();return n=o,("undefined"!=typeof Function&&n instanceof Function||"[object Function]"===Object.prototype.toString.call(n))&&(o=o.apply(t)),o.replace("{}",r%12==1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",ss:"%d δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},dayOfMonthOrdinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-au.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-gb.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-ie.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-il.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-il",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-in.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-in",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-nz.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-sg.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-sg",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/eo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mart_apr_maj_jun_jul_aŭg_sept_okt_nov_dec".split("_"),weekdays:"dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato".split("_"),weekdaysShort:"dim_lun_mard_merk_ĵaŭ_ven_sab".split("_"),weekdaysMin:"di_lu_ma_me_ĵa_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"[la] D[-an de] MMMM, YYYY",LLL:"[la] D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd[n], [la] D[-an de] MMMM, YYYY HH:mm",llll:"ddd, [la] D[-an de] MMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(e){return"p"===e.charAt(0).toLowerCase()},meridiem:function(e,t,n){return e>11?n?"p.t.m.":"P.T.M.":n?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd[n je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasintan] dddd[n je] LT",sameElse:"L"},relativeTime:{future:"post %s",past:"antaŭ %s",s:"kelkaj sekundoj",ss:"%d sekundoj",m:"unu minuto",mm:"%d minutoj",h:"unu horo",hh:"%d horoj",d:"unu tago",dd:"%d tagoj",M:"unu monato",MM:"%d monatoj",y:"unu jaro",yy:"%d jaroj"},dayOfMonthOrdinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-do.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-do",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-mx.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-mx",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:4},invalidDate:"Fecha inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-us.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-us",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4},invalidDate:"Fecha inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/et.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["mõne sekundi","mõni sekund","paar sekundit"],ss:[e+"sekundi",e+"sekundit"],m:["ühe minuti","üks minut"],mm:[e+" minuti",e+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[e+" tunni",e+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[e+" kuu",e+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[e+" aasta",e+" aastat"]};return t?r[n][2]?r[n][2]:r[n][1]:o?r[n][0]:r[n][1]}e.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:"%d päeva",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/eu.js":function(e,t,n){!function(e){"use strict";e.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),monthsParseExact:!0,weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",ss:"%d segundo",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fa.js":function(e,t,n){!function(e){"use strict";var t={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},n={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"};e.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(e){return/بعد از ظهر/.test(e)},meridiem:function(e,t,n){return e<12?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",ss:"%d ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(e){return e.replace(/[۰-۹]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},dayOfMonthOrdinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fi.js":function(e,t,n){!function(e){"use strict";var t="nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" "),n=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",t[7],t[8],t[9]];function o(e,o,r,s){var a="";switch(r){case"s":return s?"muutaman sekunnin":"muutama sekunti";case"ss":a=s?"sekunnin":"sekuntia";break;case"m":return s?"minuutin":"minuutti";case"mm":a=s?"minuutin":"minuuttia";break;case"h":return s?"tunnin":"tunti";case"hh":a=s?"tunnin":"tuntia";break;case"d":return s?"päivän":"päivä";case"dd":a=s?"päivän":"päivää";break;case"M":return s?"kuukauden":"kuukausi";case"MM":a=s?"kuukauden":"kuukautta";break;case"y":return s?"vuoden":"vuosi";case"yy":a=s?"vuoden":"vuotta"}return function(e,o){return e<10?o?n[e]:t[e]:e}(e,s)+" "+a}e.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fil.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fil",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",ss:"%d sekundir",m:"ein minuttur",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaður",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr-ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr-ch.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ch",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr.js":function(e,t,n){!function(e){"use strict";var t=/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,n=[/^janv/i,/^févr/i,/^mars/i,/^avr/i,/^mai/i,/^juin/i,/^juil/i,/^août/i,/^sept/i,/^oct/i,/^nov/i,/^déc/i];e.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsRegex:t,monthsShortRegex:t,monthsStrictRegex:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,monthsShortStrictRegex:/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?)/i,monthsParse:n,longMonthsParse:n,shortMonthsParse:n,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",w:"une semaine",ww:"%d semaines",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|)/,ordinal:function(e,t){switch(t){case"D":return e+(1===e?"er":"");default:case"M":case"Q":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fy.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),n="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_");e.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsParseExact:!0,weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",ss:"%d sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ga.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ga",{months:["Eanáir","Feabhra","Márta","Aibreán","Bealtaine","Meitheamh","Iúil","Lúnasa","Meán Fómhair","Deireadh Fómhair","Samhain","Nollaig"],monthsShort:["Ean","Feabh","Márt","Aib","Beal","Meith","Iúil","Lún","M.F.","D.F.","Samh","Noll"],monthsParseExact:!0,weekdays:["Dé Domhnaigh","Dé Luain","Dé Máirt","Dé Céadaoin","Déardaoin","Dé hAoine","Dé Sathairn"],weekdaysShort:["Domh","Luan","Máirt","Céad","Déar","Aoine","Sath"],weekdaysMin:["Do","Lu","Má","Cé","Dé","A","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Inniu ag] LT",nextDay:"[Amárach ag] LT",nextWeek:"dddd [ag] LT",lastDay:"[Inné ag] LT",lastWeek:"dddd [seo caite] [ag] LT",sameElse:"L"},relativeTime:{future:"i %s",past:"%s ó shin",s:"cúpla soicind",ss:"%d soicind",m:"nóiméad",mm:"%d nóiméad",h:"uair an chloig",hh:"%d uair an chloig",d:"lá",dd:"%d lá",M:"mí",MM:"%d míonna",y:"bliain",yy:"%d bliain"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gd.js":function(e,t,n){!function(e){"use strict";e.defineLocale("gd",{months:["Am Faoilleach","An Gearran","Am Màrt","An Giblean","An Cèitean","An t-Ògmhios","An t-Iuchar","An Lùnastal","An t-Sultain","An Dàmhair","An t-Samhain","An Dùbhlachd"],monthsShort:["Faoi","Gear","Màrt","Gibl","Cèit","Ògmh","Iuch","Lùn","Sult","Dàmh","Samh","Dùbh"],monthsParseExact:!0,weekdays:["Didòmhnaich","Diluain","Dimàirt","Diciadain","Diardaoin","Dihaoine","Disathairne"],weekdaysShort:["Did","Dil","Dim","Dic","Dia","Dih","Dis"],weekdaysMin:["Dò","Lu","Mà","Ci","Ar","Ha","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-màireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-dè aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",ss:"%d diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gl.js":function(e,t,n){!function(e){"use strict";e.defineLocale("gl",{months:"xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro".split("_"),monthsShort:"xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"domingo_luns_martes_mércores_xoves_venres_sábado".split("_"),weekdaysShort:"dom._lun._mar._mér._xov._ven._sáb.".split("_"),weekdaysMin:"do_lu_ma_mé_xo_ve_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(e){return 0===e.indexOf("un")?"n"+e:"en "+e},past:"hai %s",s:"uns segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gom-deva.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["थोडया सॅकंडांनी","थोडे सॅकंड"],ss:[e+" सॅकंडांनी",e+" सॅकंड"],m:["एका मिणटान","एक मिनूट"],mm:[e+" मिणटांनी",e+" मिणटां"],h:["एका वरान","एक वर"],hh:[e+" वरांनी",e+" वरां"],d:["एका दिसान","एक दीस"],dd:[e+" दिसांनी",e+" दीस"],M:["एका म्हयन्यान","एक म्हयनो"],MM:[e+" म्हयन्यानी",e+" म्हयने"],y:["एका वर्सान","एक वर्स"],yy:[e+" वर्सांनी",e+" वर्सां"]};return o?r[n][0]:r[n][1]}e.defineLocale("gom-deva",{months:{standalone:"जानेवारी_फेब्रुवारी_मार्च_एप्रील_मे_जून_जुलय_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),format:"जानेवारीच्या_फेब्रुवारीच्या_मार्चाच्या_एप्रीलाच्या_मेयाच्या_जूनाच्या_जुलयाच्या_ऑगस्टाच्या_सप्टेंबराच्या_ऑक्टोबराच्या_नोव्हेंबराच्या_डिसेंबराच्या".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"जाने._फेब्रु._मार्च_एप्री._मे_जून_जुल._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"आयतार_सोमार_मंगळार_बुधवार_बिरेस्तार_सुक्रार_शेनवार".split("_"),weekdaysShort:"आयत._सोम._मंगळ._बुध._ब्रेस्त._सुक्र._शेन.".split("_"),weekdaysMin:"आ_सो_मं_बु_ब्रे_सु_शे".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [वाजतां]",LTS:"A h:mm:ss [वाजतां]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [वाजतां]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [वाजतां]",llll:"ddd, D MMM YYYY, A h:mm [वाजतां]"},calendar:{sameDay:"[आयज] LT",nextDay:"[फाल्यां] LT",nextWeek:"[फुडलो] dddd[,] LT",lastDay:"[काल] LT",lastWeek:"[फाटलो] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s आदीं",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(वेर)/,ordinal:function(e,t){switch(t){case"D":return e+"वेर";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:0,doy:3},meridiemParse:/राती|सकाळीं|दनपारां|सांजे/,meridiemHour:function(e,t){return 12===e&&(e=0),"राती"===t?e<4?e:e+12:"सकाळीं"===t?e:"दनपारां"===t?e>12?e:e+12:"सांजे"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"राती":e<12?"सकाळीं":e<16?"दनपारां":e<20?"सांजे":"राती"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gom-latn.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["thoddea sekondamni","thodde sekond"],ss:[e+" sekondamni",e+" sekond"],m:["eka mintan","ek minut"],mm:[e+" mintamni",e+" mintam"],h:["eka voran","ek vor"],hh:[e+" voramni",e+" voram"],d:["eka disan","ek dis"],dd:[e+" disamni",e+" dis"],M:["eka mhoinean","ek mhoino"],MM:[e+" mhoineamni",e+" mhoine"],y:["eka vorsan","ek voros"],yy:[e+" vorsamni",e+" vorsam"]};return o?r[n][0]:r[n][1]}e.defineLocale("gom-latn",{months:{standalone:"Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr".split("_"),format:"Janerachea_Febrerachea_Marsachea_Abrilachea_Maiachea_Junachea_Julaiachea_Agostachea_Setembrachea_Otubrachea_Novembrachea_Dezembrachea".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Aitar_Somar_Mongllar_Budhvar_Birestar_Sukrar_Son'var".split("_"),weekdaysShort:"Ait._Som._Mon._Bud._Bre._Suk._Son.".split("_"),weekdaysMin:"Ai_Sm_Mo_Bu_Br_Su_Sn".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [vazta]",LTS:"A h:mm:ss [vazta]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [vazta]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [vazta]",llll:"ddd, D MMM YYYY, A h:mm [vazta]"},calendar:{sameDay:"[Aiz] LT",nextDay:"[Faleam] LT",nextWeek:"[Fuddlo] dddd[,] LT",lastDay:"[Kal] LT",lastWeek:"[Fattlo] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s adim",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(er)/,ordinal:function(e,t){switch(t){case"D":return e+"er";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:0,doy:3},meridiemParse:/rati|sokallim|donparam|sanje/,meridiemHour:function(e,t){return 12===e&&(e=0),"rati"===t?e<4?e:e+12:"sokallim"===t?e:"donparam"===t?e>12?e:e+12:"sanje"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"rati":e<12?"sokallim":e<16?"donparam":e<20?"sanje":"rati"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gu.js":function(e,t,n){!function(e){"use strict";var t={1:"૧",2:"૨",3:"૩",4:"૪",5:"૫",6:"૬",7:"૭",8:"૮",9:"૯",0:"૦"},n={"૧":"1","૨":"2","૩":"3","૪":"4","૫":"5","૬":"6","૭":"7","૮":"8","૯":"9","૦":"0"};e.defineLocale("gu",{months:"જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર".split("_"),monthsShort:"જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.".split("_"),monthsParseExact:!0,weekdays:"રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર".split("_"),weekdaysShort:"રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ".split("_"),weekdaysMin:"ર_સો_મં_બુ_ગુ_શુ_શ".split("_"),longDateFormat:{LT:"A h:mm વાગ્યે",LTS:"A h:mm:ss વાગ્યે",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm વાગ્યે",LLLL:"dddd, D MMMM YYYY, A h:mm વાગ્યે"},calendar:{sameDay:"[આજ] LT",nextDay:"[કાલે] LT",nextWeek:"dddd, LT",lastDay:"[ગઇકાલે] LT",lastWeek:"[પાછલા] dddd, LT",sameElse:"L"},relativeTime:{future:"%s મા",past:"%s પહેલા",s:"અમુક પળો",ss:"%d સેકંડ",m:"એક મિનિટ",mm:"%d મિનિટ",h:"એક કલાક",hh:"%d કલાક",d:"એક દિવસ",dd:"%d દિવસ",M:"એક મહિનો",MM:"%d મહિનો",y:"એક વર્ષ",yy:"%d વર્ષ"},preparse:function(e){return e.replace(/[૧૨૩૪૫૬૭૮૯૦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/રાત|બપોર|સવાર|સાંજ/,meridiemHour:function(e,t){return 12===e&&(e=0),"રાત"===t?e<4?e:e+12:"સવાર"===t?e:"બપોર"===t?e>=10?e:e+12:"સાંજ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"રાત":e<10?"સવાર":e<17?"બપોર":e<20?"સાંજ":"રાત"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/he.js":function(e,t,n){!function(e){"use strict";e.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",ss:"%d שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(e){return 2===e?"שעתיים":e+" שעות"},d:"יום",dd:function(e){return 2===e?"יומיים":e+" ימים"},M:"חודש",MM:function(e){return 2===e?"חודשיים":e+" חודשים"},y:"שנה",yy:function(e){return 2===e?"שנתיים":e%10==0&&10!==e?e+" שנה":e+" שנים"}},meridiemParse:/אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,isPM:function(e){return/^(אחה"צ|אחרי הצהריים|בערב)$/.test(e)},meridiem:function(e,t,n){return e<5?"לפנות בוקר":e<10?"בבוקר":e<12?n?'לפנה"צ':"לפני הצהריים":e<18?n?'אחה"צ':"אחרי הצהריים":"בערב"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hi.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},o=[/^जन/i,/^फ़र|फर/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सितं|सित/i,/^अक्टू/i,/^नव|नवं/i,/^दिसं|दिस/i];e.defineLocale("hi",{months:{format:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),standalone:"जनवरी_फरवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितंबर_अक्टूबर_नवंबर_दिसंबर".split("_")},monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},monthsParse:o,longMonthsParse:o,shortMonthsParse:[/^जन/i,/^फ़र/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सित/i,/^अक्टू/i,/^नव/i,/^दिस/i],monthsRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsShortRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsStrictRegex:/^(जनवरी?|फ़रवरी|फरवरी?|मार्च?|अप्रैल?|मई?|जून?|जुलाई?|अगस्त?|सितम्बर|सितंबर|सित?\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर?|दिसम्बर|दिसंबर?)/i,monthsShortStrictRegex:/^(जन\.?|फ़र\.?|मार्च?|अप्रै\.?|मई?|जून?|जुल\.?|अग\.?|सित\.?|अक्टू\.?|नव\.?|दिस\.?)/i,calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",ss:"%d सेकंड",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(e,t){return 12===e&&(e=0),"रात"===t?e<4?e:e+12:"सुबह"===t?e:"दोपहर"===t?e>=10?e:e+12:"शाम"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"रात":e<10?"सुबह":e<17?"दोपहर":e<20?"शाम":"रात"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hr.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=e+" ";switch(n){case"ss":return o+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return o+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return o+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return o+(1===e?"dan":"dana");case"MM":return o+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return o+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"Do MMMM YYYY",LLL:"Do MMMM YYYY H:mm",LLLL:"dddd, Do MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:return"[prošlu] [nedjelju] [u] LT";case 3:return"[prošlu] [srijedu] [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hu.js":function(e,t,n){!function(e){"use strict";var t="vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ");function n(e,t,n,o){var r=e;switch(n){case"s":return o||t?"néhány másodperc":"néhány másodperce";case"ss":return r+(o||t)?" másodperc":" másodperce";case"m":return"egy"+(o||t?" perc":" perce");case"mm":return r+(o||t?" perc":" perce");case"h":return"egy"+(o||t?" óra":" órája");case"hh":return r+(o||t?" óra":" órája");case"d":return"egy"+(o||t?" nap":" napja");case"dd":return r+(o||t?" nap":" napja");case"M":return"egy"+(o||t?" hónap":" hónapja");case"MM":return r+(o||t?" hónap":" hónapja");case"y":return"egy"+(o||t?" év":" éve");case"yy":return r+(o||t?" év":" éve")}return""}function o(e){return(e?"":"[múlt] ")+"["+t[this.day()]+"] LT[-kor]"}e.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan._feb._márc._ápr._máj._jún._júl._aug._szept._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(e){return"u"===e.charAt(1).toLowerCase()},meridiem:function(e,t,n){return e<12?!0===n?"de":"DE":!0===n?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return o.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return o.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:n,ss:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hy-am.js":function(e,t,n){!function(e){"use strict";e.defineLocale("hy-am",{months:{format:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),standalone:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_")},monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",ss:"%d վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(e){return/^(ցերեկվա|երեկոյան)$/.test(e)},meridiem:function(e){return e<4?"գիշերվա":e<12?"առավոտվա":e<17?"ցերեկվա":"երեկոյան"},dayOfMonthOrdinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(e,t){switch(t){case"DDD":case"w":case"W":case"DDDo":return 1===e?e+"-ին":e+"-րդ";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/id.js":function(e,t,n){!function(e){"use strict";e.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"siang"===t?e>=11?e:e+12:"sore"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"siang":e<19?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",ss:"%d detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/is.js":function(e,t,n){!function(e){"use strict";function t(e){return e%100==11||e%10!=1}function n(e,n,o,r){var s=e+" ";switch(o){case"s":return n||r?"nokkrar sekúndur":"nokkrum sekúndum";case"ss":return t(e)?s+(n||r?"sekúndur":"sekúndum"):s+"sekúnda";case"m":return n?"mínúta":"mínútu";case"mm":return t(e)?s+(n||r?"mínútur":"mínútum"):n?s+"mínúta":s+"mínútu";case"hh":return t(e)?s+(n||r?"klukkustundir":"klukkustundum"):s+"klukkustund";case"d":return n?"dagur":r?"dag":"degi";case"dd":return t(e)?n?s+"dagar":s+(r?"daga":"dögum"):n?s+"dagur":s+(r?"dag":"degi");case"M":return n?"mánuður":r?"mánuð":"mánuði";case"MM":return t(e)?n?s+"mánuðir":s+(r?"mánuði":"mánuðum"):n?s+"mánuður":s+(r?"mánuð":"mánuði");case"y":return n||r?"ár":"ári";case"yy":return t(e)?s+(n||r?"ár":"árum"):s+(n||r?"ár":"ári")}}e.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:n,ss:n,m:n,mm:n,h:"klukkustund",hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/it-ch.js":function(e,t,n){!function(e){"use strict";e.defineLocale("it-ch",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/it.js":function(e,t,n){!function(e){"use strict";e.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:function(){return"[Oggi a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextDay:function(){return"[Domani a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextWeek:function(){return"dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastDay:function(){return"[Ieri a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastWeek:function(){switch(this.day()){case 0:return"[La scorsa] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT";default:return"[Lo scorso] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"}},sameElse:"L"},relativeTime:{future:"tra %s",past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",w:"una settimana",ww:"%d settimane",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ja.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ja",{eras:[{since:"2019-05-01",offset:1,name:"令和",narrow:"㋿",abbr:"R"},{since:"1989-01-08",until:"2019-04-30",offset:1,name:"平成",narrow:"㍻",abbr:"H"},{since:"1926-12-25",until:"1989-01-07",offset:1,name:"昭和",narrow:"㍼",abbr:"S"},{since:"1912-07-30",until:"1926-12-24",offset:1,name:"大正",narrow:"㍽",abbr:"T"},{since:"1873-01-01",until:"1912-07-29",offset:6,name:"明治",narrow:"㍾",abbr:"M"},{since:"0001-01-01",until:"1873-12-31",offset:1,name:"西暦",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"紀元前",narrow:"BC",abbr:"BC"}],eraYearOrdinalRegex:/(元|\d+)年/,eraYearOrdinalParse:function(e,t){return"元"===t[1]?1:parseInt(t[1]||e,10)},months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiemParse:/午前|午後/i,isPM:function(e){return"午後"===e},meridiem:function(e,t,n){return e<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:function(e){return e.week()!==this.week()?"[来週]dddd LT":"dddd LT"},lastDay:"[昨日] LT",lastWeek:function(e){return this.week()!==e.week()?"[先週]dddd LT":"dddd LT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}日/,ordinal:function(e,t){switch(t){case"y":return 1===e?"元年":e+"年";case"d":case"D":case"DDD":return e+"日";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"数秒",ss:"%d秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/jv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(e,t){return 12===e&&(e=0),"enjing"===t?e:"siyang"===t?e>=11?e:e+12:"sonten"===t||"ndalu"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"enjing":e<15?"siyang":e<19?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",ss:"%d detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ka.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ka",{months:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:{standalone:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),format:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_"),isFormat:/(წინა|შემდეგ)/},weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(e){return e.replace(/(წამ|წუთ|საათ|წელ|დღ|თვ)(ი|ე)/,(function(e,t,n){return"ი"===n?t+"ში":t+n+"ში"}))},past:function(e){return/(წამი|წუთი|საათი|დღე|თვე)/.test(e)?e.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(e)?e.replace(/წელი$/,"წლის წინ"):e},s:"რამდენიმე წამი",ss:"%d წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},dayOfMonthOrdinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(e){return 0===e?e:1===e?e+"-ლი":e<20||e<=100&&e%20==0||e%100==0?"მე-"+e:e+"-ე"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/kk.js":function(e,t,n){!function(e){"use strict";var t={0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"};e.defineLocale("kk",{months:"қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел".split("_"),weekdays:"жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгін сағат] LT",nextDay:"[Ертең сағат] LT",nextWeek:"dddd [сағат] LT",lastDay:"[Кеше сағат] LT",lastWeek:"[Өткен аптаның] dddd [сағат] LT",sameElse:"L"},relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",ss:"%d секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(ші|шы)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/km.js":function(e,t,n){!function(e){"use strict";var t={1:"១",2:"២",3:"៣",4:"៤",5:"៥",6:"៦",7:"៧",8:"៨",9:"៩",0:"០"},n={"១":"1","២":"2","៣":"3","៤":"4","៥":"5","៦":"6","៧":"7","៨":"8","៩":"9","០":"0"};e.defineLocale("km",{months:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysMin:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ព្រឹក|ល្ងាច/,isPM:function(e){return"ល្ងាច"===e},meridiem:function(e,t,n){return e<12?"ព្រឹក":"ល្ងាច"},calendar:{sameDay:"[ថ្ងៃនេះ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",ss:"%d វិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},dayOfMonthOrdinalParse:/ទី\d{1,2}/,ordinal:"ទី%d",preparse:function(e){return e.replace(/[១២៣៤៥៦៧៨៩០]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/kn.js":function(e,t,n){!function(e){"use strict";var t={1:"೧",2:"೨",3:"೩",4:"೪",5:"೫",6:"೬",7:"೭",8:"೮",9:"೯",0:"೦"},n={"೧":"1","೨":"2","೩":"3","೪":"4","೫":"5","೬":"6","೭":"7","೮":"8","೯":"9","೦":"0"};e.defineLocale("kn",{months:"ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್".split("_"),monthsShort:"ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ".split("_"),monthsParseExact:!0,weekdays:"ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ".split("_"),weekdaysShort:"ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ".split("_"),weekdaysMin:"ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[ಇಂದು] LT",nextDay:"[ನಾಳೆ] LT",nextWeek:"dddd, LT",lastDay:"[ನಿನ್ನೆ] LT",lastWeek:"[ಕೊನೆಯ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ನಂತರ",past:"%s ಹಿಂದೆ",s:"ಕೆಲವು ಕ್ಷಣಗಳು",ss:"%d ಸೆಕೆಂಡುಗಳು",m:"ಒಂದು ನಿಮಿಷ",mm:"%d ನಿಮಿಷ",h:"ಒಂದು ಗಂಟೆ",hh:"%d ಗಂಟೆ",d:"ಒಂದು ದಿನ",dd:"%d ದಿನ",M:"ಒಂದು ತಿಂಗಳು",MM:"%d ತಿಂಗಳು",y:"ಒಂದು ವರ್ಷ",yy:"%d ವರ್ಷ"},preparse:function(e){return e.replace(/[೧೨೩೪೫೬೭೮೯೦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ರಾತ್ರಿ"===t?e<4?e:e+12:"ಬೆಳಿಗ್ಗೆ"===t?e:"ಮಧ್ಯಾಹ್ನ"===t?e>=10?e:e+12:"ಸಂಜೆ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ರಾತ್ರಿ":e<10?"ಬೆಳಿಗ್ಗೆ":e<17?"ಮಧ್ಯಾಹ್ನ":e<20?"ಸಂಜೆ":"ರಾತ್ರಿ"},dayOfMonthOrdinalParse:/\d{1,2}(ನೇ)/,ordinal:function(e){return e+"ನೇ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ko.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",ss:"%d초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"},dayOfMonthOrdinalParse:/\d{1,2}(일|월|주)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"일";case"M":return e+"월";case"w":case"W":return e+"주";default:return e}},meridiemParse:/오전|오후/,isPM:function(e){return"오후"===e},meridiem:function(e,t,n){return e<12?"오전":"오후"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ku.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},o=["کانونی دووەم","شوبات","ئازار","نیسان","ئایار","حوزەیران","تەمموز","ئاب","ئەیلوول","تشرینی یەكەم","تشرینی دووەم","كانونی یەکەم"];e.defineLocale("ku",{months:o,monthsShort:o,weekdays:"یه‌كشه‌ممه‌_دووشه‌ممه‌_سێشه‌ممه‌_چوارشه‌ممه‌_پێنجشه‌ممه‌_هه‌ینی_شه‌ممه‌".split("_"),weekdaysShort:"یه‌كشه‌م_دووشه‌م_سێشه‌م_چوارشه‌م_پێنجشه‌م_هه‌ینی_شه‌ممه‌".split("_"),weekdaysMin:"ی_د_س_چ_پ_ه_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ئێواره‌|به‌یانی/,isPM:function(e){return/ئێواره‌/.test(e)},meridiem:function(e,t,n){return e<12?"به‌یانی":"ئێواره‌"},calendar:{sameDay:"[ئه‌مرۆ كاتژمێر] LT",nextDay:"[به‌یانی كاتژمێر] LT",nextWeek:"dddd [كاتژمێر] LT",lastDay:"[دوێنێ كاتژمێر] LT",lastWeek:"dddd [كاتژمێر] LT",sameElse:"L"},relativeTime:{future:"له‌ %s",past:"%s",s:"چه‌ند چركه‌یه‌ك",ss:"چركه‌ %d",m:"یه‌ك خوله‌ك",mm:"%d خوله‌ك",h:"یه‌ك كاتژمێر",hh:"%d كاتژمێر",d:"یه‌ك ڕۆژ",dd:"%d ڕۆژ",M:"یه‌ك مانگ",MM:"%d مانگ",y:"یه‌ك ساڵ",yy:"%d ساڵ"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ky.js":function(e,t,n){!function(e){"use strict";var t={0:"-чү",1:"-чи",2:"-чи",3:"-чү",4:"-чү",5:"-чи",6:"-чы",7:"-чи",8:"-чи",9:"-чу",10:"-чу",20:"-чы",30:"-чу",40:"-чы",50:"-чү",60:"-чы",70:"-чи",80:"-чи",90:"-чу",100:"-чү"};e.defineLocale("ky",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdays:"Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),weekdaysShort:"Жек_Дүй_Шей_Шар_Бей_Жум_Ише".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгүн саат] LT",nextDay:"[Эртең саат] LT",nextWeek:"dddd [саат] LT",lastDay:"[Кечээ саат] LT",lastWeek:"[Өткөн аптанын] dddd [күнү] [саат] LT",sameElse:"L"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",ss:"%d секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(чи|чы|чү|чу)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lb.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return t?r[n][0]:r[n][1]}function n(e){if(e=parseInt(e,10),isNaN(e))return!1;if(e<0)return!0;if(e<10)return 4<=e&&e<=7;if(e<100){var t=e%10;return n(0===t?e/10:t)}if(e<1e4){for(;e>=10;)e/=10;return n(e)}return n(e/=1e3)}e.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:function(e){return n(e.substr(0,e.indexOf(" ")))?"a "+e:"an "+e},past:function(e){return n(e.substr(0,e.indexOf(" ")))?"viru "+e:"virun "+e},s:"e puer Sekonnen",ss:"%d Sekonnen",m:t,mm:"%d Minutten",h:t,hh:"%d Stonnen",d:t,dd:"%d Deeg",M:t,MM:"%d Méint",y:t,yy:"%d Joer"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("lo",{months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},meridiemParse:/ຕອນເຊົ້າ|ຕອນແລງ/,isPM:function(e){return"ຕອນແລງ"===e},meridiem:function(e,t,n){return e<12?"ຕອນເຊົ້າ":"ຕອນແລງ"},calendar:{sameDay:"[ມື້ນີ້ເວລາ] LT",nextDay:"[ມື້ອື່ນເວລາ] LT",nextWeek:"[ວັນ]dddd[ໜ້າເວລາ] LT",lastDay:"[ມື້ວານນີ້ເວລາ] LT",lastWeek:"[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT",sameElse:"L"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",ss:"%d ວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"},dayOfMonthOrdinalParse:/(ທີ່)\d{1,2}/,ordinal:function(e){return"ທີ່"+e}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lt.js":function(e,t,n){!function(e){"use strict";var t={ss:"sekundė_sekundžių_sekundes",m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"};function n(e,t,n,o){return t?r(n)[0]:o?r(n)[1]:r(n)[2]}function o(e){return e%10==0||e>10&&e<20}function r(e){return t[e].split("_")}function s(e,t,s,a){var i=e+" ";return 1===e?i+n(0,t,s[0],a):t?i+(o(e)?r(s)[1]:r(s)[0]):a?i+r(s)[1]:i+(o(e)?r(s)[1]:r(s)[2])}e.defineLocale("lt",{months:{format:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),isFormat:/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:function(e,t,n,o){return t?"kelios sekundės":o?"kelių sekundžių":"kelias sekundes"},ss:s,m:n,mm:s,h:n,hh:s,d:n,dd:s,M:n,MM:s,y:n,yy:s},dayOfMonthOrdinalParse:/\d{1,2}-oji/,ordinal:function(e){return e+"-oji"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lv.js":function(e,t,n){!function(e){"use strict";var t={ss:"sekundes_sekundēm_sekunde_sekundes".split("_"),m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")};function n(e,t,n){return n?t%10==1&&t%100!=11?e[2]:e[3]:t%10==1&&t%100!=11?e[0]:e[1]}function o(e,o,r){return e+" "+n(t[r],e,o)}function r(e,o,r){return n(t[r],e,o)}e.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:function(e,t){return t?"dažas sekundes":"dažām sekundēm"},ss:o,m:r,mm:o,h:r,hh:o,d:r,dd:o,M:r,MM:o,y:r,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/me.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["sekund","sekunda","sekundi"],m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("me",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mjesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mi.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mi",{months:"Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),monthsRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,weekdays:"Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei".split("_"),weekdaysShort:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),weekdaysMin:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},calendar:{sameDay:"[i teie mahana, i] LT",nextDay:"[apopo i] LT",nextWeek:"dddd [i] LT",lastDay:"[inanahi i] LT",lastWeek:"dddd [whakamutunga i] LT",sameElse:"L"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te hēkona ruarua",ss:"%d hēkona",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mk.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"за %s",past:"пред %s",s:"неколку секунди",ss:"%d секунди",m:"една минута",mm:"%d минути",h:"еден час",hh:"%d часа",d:"еден ден",dd:"%d дена",M:"еден месец",MM:"%d месеци",y:"една година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ml.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),monthsParseExact:!0,weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",ss:"%d സെക്കൻഡ്",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,meridiemHour:function(e,t){return 12===e&&(e=0),"രാത്രി"===t&&e>=4||"ഉച്ച കഴിഞ്ഞ്"===t||"വൈകുന്നേരം"===t?e+12:e},meridiem:function(e,t,n){return e<4?"രാത്രി":e<12?"രാവിലെ":e<17?"ഉച്ച കഴിഞ്ഞ്":e<20?"വൈകുന്നേരം":"രാത്രി"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mn.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){switch(n){case"s":return t?"хэдхэн секунд":"хэдхэн секундын";case"ss":return e+(t?" секунд":" секундын");case"m":case"mm":return e+(t?" минут":" минутын");case"h":case"hh":return e+(t?" цаг":" цагийн");case"d":case"dd":return e+(t?" өдөр":" өдрийн");case"M":case"MM":return e+(t?" сар":" сарын");case"y":case"yy":return e+(t?" жил":" жилийн");default:return e}}e.defineLocale("mn",{months:"Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар".split("_"),monthsShort:"1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар".split("_"),monthsParseExact:!0,weekdays:"Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба".split("_"),weekdaysShort:"Ням_Дав_Мяг_Лха_Пүр_Баа_Бям".split("_"),weekdaysMin:"Ня_Да_Мя_Лх_Пү_Ба_Бя".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY оны MMMMын D",LLL:"YYYY оны MMMMын D HH:mm",LLLL:"dddd, YYYY оны MMMMын D HH:mm"},meridiemParse:/ҮӨ|ҮХ/i,isPM:function(e){return"ҮХ"===e},meridiem:function(e,t,n){return e<12?"ҮӨ":"ҮХ"},calendar:{sameDay:"[Өнөөдөр] LT",nextDay:"[Маргааш] LT",nextWeek:"[Ирэх] dddd LT",lastDay:"[Өчигдөр] LT",lastWeek:"[Өнгөрсөн] dddd LT",sameElse:"L"},relativeTime:{future:"%s дараа",past:"%s өмнө",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2} өдөр/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+" өдөр";default:return e}}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mr.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};function o(e,t,n,o){var r="";if(t)switch(n){case"s":r="काही सेकंद";break;case"ss":r="%d सेकंद";break;case"m":r="एक मिनिट";break;case"mm":r="%d मिनिटे";break;case"h":r="एक तास";break;case"hh":r="%d तास";break;case"d":r="एक दिवस";break;case"dd":r="%d दिवस";break;case"M":r="एक महिना";break;case"MM":r="%d महिने";break;case"y":r="एक वर्ष";break;case"yy":r="%d वर्षे"}else switch(n){case"s":r="काही सेकंदां";break;case"ss":r="%d सेकंदां";break;case"m":r="एका मिनिटा";break;case"mm":r="%d मिनिटां";break;case"h":r="एका तासा";break;case"hh":r="%d तासां";break;case"d":r="एका दिवसा";break;case"dd":r="%d दिवसां";break;case"M":r="एका महिन्या";break;case"MM":r="%d महिन्यां";break;case"y":r="एका वर्षा";break;case"yy":r="%d वर्षां"}return r.replace(/%d/i,e)}e.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%sमध्ये",past:"%sपूर्वी",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/पहाटे|सकाळी|दुपारी|सायंकाळी|रात्री/,meridiemHour:function(e,t){return 12===e&&(e=0),"पहाटे"===t||"सकाळी"===t?e:"दुपारी"===t||"सायंकाळी"===t||"रात्री"===t?e>=12?e:e+12:void 0},meridiem:function(e,t,n){return e>=0&&e<6?"पहाटे":e<12?"सकाळी":e<17?"दुपारी":e<20?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ms-my.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ms.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mt.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mt",{months:"Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru".split("_"),monthsShort:"Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ".split("_"),weekdays:"Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt".split("_"),weekdaysShort:"Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib".split("_"),weekdaysMin:"Ħa_Tn_Tl_Er_Ħa_Ġi_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Illum fil-]LT",nextDay:"[Għada fil-]LT",nextWeek:"dddd [fil-]LT",lastDay:"[Il-bieraħ fil-]LT",lastWeek:"dddd [li għadda] [fil-]LT",sameElse:"L"},relativeTime:{future:"f’ %s",past:"%s ilu",s:"ftit sekondi",ss:"%d sekondi",m:"minuta",mm:"%d minuti",h:"siegħa",hh:"%d siegħat",d:"ġurnata",dd:"%d ġranet",M:"xahar",MM:"%d xhur",y:"sena",yy:"%d sni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/my.js":function(e,t,n){!function(e){"use strict";var t={1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:"၀"},n={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","၀":"0"};e.defineLocale("my",{months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",ss:"%d စက္ကန့်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(e){return e.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nb.js":function(e,t,n){!function(e){"use strict";e.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"noen sekunder",ss:"%d sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",w:"en uke",ww:"%d uker",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ne.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};e.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),monthsParseExact:!0,weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(e,t){return 12===e&&(e=0),"राति"===t?e<4?e:e+12:"बिहान"===t?e:"दिउँसो"===t?e>=10?e:e+12:"साँझ"===t?e+12:void 0},meridiem:function(e,t,n){return e<3?"राति":e<12?"बिहान":e<16?"दिउँसो":e<20?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",ss:"%d सेकेण्ड",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nl-be.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),o=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl-be",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nl.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),o=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",w:"één week",ww:"%d weken",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"su._må._ty._on._to._fr._lau.".split("_"),weekdaysMin:"su_må_ty_on_to_fr_la".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s sidan",s:"nokre sekund",ss:"%d sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",w:"ei veke",ww:"%d veker",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/oc-lnc.js":function(e,t,n){!function(e){"use strict";e.defineLocale("oc-lnc",{months:{standalone:"genièr_febrièr_març_abril_mai_junh_julhet_agost_setembre_octòbre_novembre_decembre".split("_"),format:"de genièr_de febrièr_de març_d'abril_de mai_de junh_de julhet_d'agost_de setembre_d'octòbre_de novembre_de decembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._mai_junh_julh._ago._set._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"dimenge_diluns_dimars_dimècres_dijòus_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dm._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dm_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:"[uèi a] LT",nextDay:"[deman a] LT",nextWeek:"dddd [a] LT",lastDay:"[ièr a] LT",lastWeek:"dddd [passat a] LT",sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"unas segondas",ss:"%d segondas",m:"una minuta",mm:"%d minutas",h:"una ora",hh:"%d oras",d:"un jorn",dd:"%d jorns",M:"un mes",MM:"%d meses",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pa-in.js":function(e,t,n){!function(e){"use strict";var t={1:"੧",2:"੨",3:"੩",4:"੪",5:"੫",6:"੬",7:"੭",8:"੮",9:"੯",0:"੦"},n={"੧":"1","੨":"2","੩":"3","੪":"4","੫":"5","੬":"6","੭":"7","੮":"8","੯":"9","੦":"0"};e.defineLocale("pa-in",{months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),longDateFormat:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},calendar:{sameDay:"[ਅਜ] LT",nextDay:"[ਕਲ] LT",nextWeek:"[ਅਗਲਾ] dddd, LT",lastDay:"[ਕਲ] LT",lastWeek:"[ਪਿਛਲੇ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",ss:"%d ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"},preparse:function(e){return e.replace(/[੧੨੩੪੫੬੭੮੯੦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ਰਾਤ"===t?e<4?e:e+12:"ਸਵੇਰ"===t?e:"ਦੁਪਹਿਰ"===t?e>=10?e:e+12:"ਸ਼ਾਮ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ਰਾਤ":e<10?"ਸਵੇਰ":e<17?"ਦੁਪਹਿਰ":e<20?"ਸ਼ਾਮ":"ਰਾਤ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pl.js":function(e,t,n){!function(e){"use strict";var t="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),n="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),o=[/^sty/i,/^lut/i,/^mar/i,/^kwi/i,/^maj/i,/^cze/i,/^lip/i,/^sie/i,/^wrz/i,/^paź/i,/^lis/i,/^gru/i];function r(e){return e%10<5&&e%10>1&&~~(e/10)%10!=1}function s(e,t,n){var o=e+" ";switch(n){case"ss":return o+(r(e)?"sekundy":"sekund");case"m":return t?"minuta":"minutę";case"mm":return o+(r(e)?"minuty":"minut");case"h":return t?"godzina":"godzinę";case"hh":return o+(r(e)?"godziny":"godzin");case"ww":return o+(r(e)?"tygodnie":"tygodni");case"MM":return o+(r(e)?"miesiące":"miesięcy");case"yy":return o+(r(e)?"lata":"lat")}}e.defineLocale("pl",{months:function(e,o){return e?/D MMMM/.test(o)?n[e.month()]:t[e.month()]:t},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_śr_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:function(){switch(this.day()){case 0:return"[W niedzielę o] LT";case 2:return"[We wtorek o] LT";case 3:return"[W środę o] LT";case 6:return"[W sobotę o] LT";default:return"[W] dddd [o] LT"}},lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",ss:s,m:s,mm:s,h:s,hh:s,d:"1 dzień",dd:"%d dni",w:"tydzień",ww:s,M:"miesiąc",MM:s,y:"rok",yy:s},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pt-br.js":function(e,t,n){!function(e){"use strict";e.defineLocale("pt-br",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sáb".split("_"),weekdaysMin:"do_2ª_3ª_4ª_5ª_6ª_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"poucos segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",invalidDate:"Data inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pt.js":function(e,t,n){!function(e){"use strict";e.defineLocale("pt",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",w:"uma semana",ww:"%d semanas",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ro.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=" ";return(e%100>=20||e>=100&&e%100==0)&&(o=" de "),e+o+{ss:"secunde",mm:"minute",hh:"ore",dd:"zile",ww:"săptămâni",MM:"luni",yy:"ani"}[n]}e.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",ss:t,m:"un minut",mm:t,h:"o oră",hh:t,d:"o zi",dd:t,w:"o săptămână",ww:t,M:"o lună",MM:t,y:"un an",yy:t},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ru.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"минута":"минуту":e+" "+(o=+e,r={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",ww:"неделя_недели_недель",MM:"месяц_месяца_месяцев",yy:"год_года_лет"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}var n=[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i];e.defineLocale("ru",{months:{format:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),standalone:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_")},monthsShort:{format:"янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),standalone:"янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_")},weekdays:{standalone:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),format:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?] ?dddd/},weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:n,longMonthsParse:n,shortMonthsParse:n,monthsRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsShortRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsStrictRegex:/^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,monthsShortStrictRegex:/^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},calendar:{sameDay:"[Сегодня, в] LT",nextDay:"[Завтра, в] LT",lastDay:"[Вчера, в] LT",nextWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В следующее] dddd, [в] LT";case 1:case 2:case 4:return"[В следующий] dddd, [в] LT";case 3:case 5:case 6:return"[В следующую] dddd, [в] LT"}},lastWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd, [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd, [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd, [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",ss:t,m:t,mm:t,h:"час",hh:t,d:"день",dd:t,w:"неделя",ww:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(e){return/^(дня|вечера)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночи":e<12?"утра":e<17?"дня":"вечера"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":return e+"-й";case"D":return e+"-го";case"w":case"W":return e+"-я";default:return e}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sd.js":function(e,t,n){!function(e){"use strict";var t=["جنوري","فيبروري","مارچ","اپريل","مئي","جون","جولاءِ","آگسٽ","سيپٽمبر","آڪٽوبر","نومبر","ڊسمبر"],n=["آچر","سومر","اڱارو","اربع","خميس","جمع","ڇنڇر"];e.defineLocale("sd",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[اڄ] LT",nextDay:"[سڀاڻي] LT",nextWeek:"dddd [اڳين هفتي تي] LT",lastDay:"[ڪالهه] LT",lastWeek:"[گزريل هفتي] dddd [تي] LT",sameElse:"L"},relativeTime:{future:"%s پوء",past:"%s اڳ",s:"چند سيڪنڊ",ss:"%d سيڪنڊ",m:"هڪ منٽ",mm:"%d منٽ",h:"هڪ ڪلاڪ",hh:"%d ڪلاڪ",d:"هڪ ڏينهن",dd:"%d ڏينهن",M:"هڪ مهينو",MM:"%d مهينا",y:"هڪ سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/se.js":function(e,t,n){!function(e){"use strict";e.defineLocale("se",{months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",ss:"%d sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/si.js":function(e,t,n){!function(e){"use strict";e.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",ss:"තත්පර %d",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},dayOfMonthOrdinalParse:/\d{1,2} වැනි/,ordinal:function(e){return e+" වැනි"},meridiemParse:/පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,isPM:function(e){return"ප.ව."===e||"පස් වරු"===e},meridiem:function(e,t,n){return e>11?n?"ප.ව.":"පස් වරු":n?"පෙ.ව.":"පෙර වරු"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sk.js":function(e,t,n){!function(e){"use strict";var t="január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),n="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_");function o(e){return e>1&&e<5}function r(e,t,n,r){var s=e+" ";switch(n){case"s":return t||r?"pár sekúnd":"pár sekundami";case"ss":return t||r?s+(o(e)?"sekundy":"sekúnd"):s+"sekundami";case"m":return t?"minúta":r?"minútu":"minútou";case"mm":return t||r?s+(o(e)?"minúty":"minút"):s+"minútami";case"h":return t?"hodina":r?"hodinu":"hodinou";case"hh":return t||r?s+(o(e)?"hodiny":"hodín"):s+"hodinami";case"d":return t||r?"deň":"dňom";case"dd":return t||r?s+(o(e)?"dni":"dní"):s+"dňami";case"M":return t||r?"mesiac":"mesiacom";case"MM":return t||r?s+(o(e)?"mesiace":"mesiacov"):s+"mesiacmi";case"y":return t||r?"rok":"rokom";case"yy":return t||r?s+(o(e)?"roky":"rokov"):s+"rokmi"}}e.defineLocale("sk",{months:t,monthsShort:n,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:r,ss:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sl.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r=e+" ";switch(n){case"s":return t||o?"nekaj sekund":"nekaj sekundami";case"ss":return r+(1===e?t?"sekundo":"sekundi":2===e?t||o?"sekundi":"sekundah":e<5?t||o?"sekunde":"sekundah":"sekund");case"m":return t?"ena minuta":"eno minuto";case"mm":return r+(1===e?t?"minuta":"minuto":2===e?t||o?"minuti":"minutama":e<5?t||o?"minute":"minutami":t||o?"minut":"minutami");case"h":return t?"ena ura":"eno uro";case"hh":return r+(1===e?t?"ura":"uro":2===e?t||o?"uri":"urama":e<5?t||o?"ure":"urami":t||o?"ur":"urami");case"d":return t||o?"en dan":"enim dnem";case"dd":return r+(1===e?t||o?"dan":"dnem":2===e?t||o?"dni":"dnevoma":t||o?"dni":"dnevi");case"M":return t||o?"en mesec":"enim mesecem";case"MM":return r+(1===e?t||o?"mesec":"mesecem":2===e?t||o?"meseca":"mesecema":e<5?t||o?"mesece":"meseci":t||o?"mesecev":"meseci");case"y":return t||o?"eno leto":"enim letom";case"yy":return r+(1===e?t||o?"leto":"letom":2===e?t||o?"leti":"letoma":e<5?t||o?"leta":"leti":t||o?"let":"leti")}}e.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sq.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),weekdaysParseExact:!0,meridiemParse:/PD|MD/,isPM:function(e){return"M"===e.charAt(0)},meridiem:function(e,t,n){return e<12?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",ss:"%d sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sr-cyrl.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["секунда","секунде","секунди"],m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr-cyrl",{months:"јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар".split("_"),monthsShort:"јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.".split("_"),monthsParseExact:!0,weekdays:"недеља_понедељак_уторак_среда_четвртак_петак_субота".split("_"),weekdaysShort:"нед._пон._уто._сре._чет._пет._суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){return["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"дан",dd:t.translate,M:"месец",MM:t.translate,y:"годину",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sr.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["sekunda","sekunde","sekundi"],m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sre._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ss.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ss",{months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Namuhla nga] LT",nextDay:"[Kusasa nga] LT",nextWeek:"dddd [nga] LT",lastDay:"[Itolo nga] LT",lastWeek:"dddd [leliphelile] [nga] LT",sameElse:"L"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",ss:"%d mzuzwana",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"},meridiemParse:/ekuseni|emini|entsambama|ebusuku/,meridiem:function(e,t,n){return e<11?"ekuseni":e<15?"emini":e<19?"entsambama":"ebusuku"},meridiemHour:function(e,t){return 12===e&&(e=0),"ekuseni"===t?e:"emini"===t?e>=11?e:e+12:"entsambama"===t||"ebusuku"===t?0===e?0:e+12:void 0},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:"%d",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",ss:"%d sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}(\:e|\:a)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?":e":1===t||2===t?":a":":e")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"hh:mm A",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",ss:"sekunde %d",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"siku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ta.js":function(e,t,n){!function(e){"use strict";var t={1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:"௦"},n={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","௦":"0"};e.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",ss:"%d விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},dayOfMonthOrdinalParse:/\d{1,2}வது/,ordinal:function(e){return e+"வது"},preparse:function(e){return e.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(e,t,n){return e<2?" யாமம்":e<6?" வைகறை":e<10?" காலை":e<14?" நண்பகல்":e<18?" எற்பாடு":e<22?" மாலை":" யாமம்"},meridiemHour:function(e,t){return 12===e&&(e=0),"யாமம்"===t?e<2?e:e+12:"வைகறை"===t||"காலை"===t||"நண்பகல்"===t&&e>=10?e:e+12},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/te.js":function(e,t,n){!function(e){"use strict";e.defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),monthsParseExact:!0,weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",ss:"%d సెకన్లు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},dayOfMonthOrdinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(e,t){return 12===e&&(e=0),"రాత్రి"===t?e<4?e:e+12:"ఉదయం"===t?e:"మధ్యాహ్నం"===t?e>=10?e:e+12:"సాయంత్రం"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"రాత్రి":e<10?"ఉదయం":e<17?"మధ్యాహ్నం":e<20?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tet.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tet",{months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu".split("_"),weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sest_Sab".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Ses_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Ohin iha] LT",nextDay:"[Aban iha] LT",nextWeek:"dddd [iha] LT",lastDay:"[Horiseik iha] LT",lastWeek:"dddd [semana kotuk] [iha] LT",sameElse:"L"},relativeTime:{future:"iha %s",past:"%s liuba",s:"segundu balun",ss:"segundu %d",m:"minutu ida",mm:"minutu %d",h:"oras ida",hh:"oras %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tg.js":function(e,t,n){!function(e){"use strict";var t={0:"-ум",1:"-ум",2:"-юм",3:"-юм",4:"-ум",5:"-ум",6:"-ум",7:"-ум",8:"-ум",9:"-ум",10:"-ум",12:"-ум",13:"-ум",20:"-ум",30:"-юм",40:"-ум",50:"-ум",60:"-ум",70:"-ум",80:"-ум",90:"-ум",100:"-ум"};e.defineLocale("tg",{months:{format:"январи_феврали_марти_апрели_майи_июни_июли_августи_сентябри_октябри_ноябри_декабри".split("_"),standalone:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_")},monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе".split("_"),weekdaysShort:"яшб_дшб_сшб_чшб_пшб_ҷум_шнб".split("_"),weekdaysMin:"яш_дш_сш_чш_пш_ҷм_шб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Имрӯз соати] LT",nextDay:"[Фардо соати] LT",lastDay:"[Дирӯз соати] LT",nextWeek:"dddd[и] [ҳафтаи оянда соати] LT",lastWeek:"dddd[и] [ҳафтаи гузашта соати] LT",sameElse:"L"},relativeTime:{future:"баъди %s",past:"%s пеш",s:"якчанд сония",m:"як дақиқа",mm:"%d дақиқа",h:"як соат",hh:"%d соат",d:"як рӯз",dd:"%d рӯз",M:"як моҳ",MM:"%d моҳ",y:"як сол",yy:"%d сол"},meridiemParse:/шаб|субҳ|рӯз|бегоҳ/,meridiemHour:function(e,t){return 12===e&&(e=0),"шаб"===t?e<4?e:e+12:"субҳ"===t?e:"рӯз"===t?e>=11?e:e+12:"бегоҳ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"шаб":e<11?"субҳ":e<16?"рӯз":e<19?"бегоҳ":"шаб"},dayOfMonthOrdinalParse:/\d{1,2}-(ум|юм)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/th.js":function(e,t,n){!function(e){"use strict";e.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.".split("_"),monthsParseExact:!0,weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H:mm",LLLL:"วันddddที่ D MMMM YYYY เวลา H:mm"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(e){return"หลังเที่ยง"===e},meridiem:function(e,t,n){return e<12?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",ss:"%d วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",w:"1 สัปดาห์",ww:"%d สัปดาห์",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tk.js":function(e,t,n){!function(e){"use strict";var t={1:"'inji",5:"'inji",8:"'inji",70:"'inji",80:"'inji",2:"'nji",7:"'nji",20:"'nji",50:"'nji",3:"'ünji",4:"'ünji",100:"'ünji",6:"'njy",9:"'unjy",10:"'unjy",30:"'unjy",60:"'ynjy",90:"'ynjy"};e.defineLocale("tk",{months:"Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr".split("_"),monthsShort:"Ýan_Few_Mar_Apr_Maý_Iýn_Iýl_Awg_Sen_Okt_Noý_Dek".split("_"),weekdays:"Ýekşenbe_Duşenbe_Sişenbe_Çarşenbe_Penşenbe_Anna_Şenbe".split("_"),weekdaysShort:"Ýek_Duş_Siş_Çar_Pen_Ann_Şen".split("_"),weekdaysMin:"Ýk_Dş_Sş_Çr_Pn_An_Şn".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün sagat] LT",nextDay:"[ertir sagat] LT",nextWeek:"[indiki] dddd [sagat] LT",lastDay:"[düýn] LT",lastWeek:"[geçen] dddd [sagat] LT",sameElse:"L"},relativeTime:{future:"%s soň",past:"%s öň",s:"birnäçe sekunt",m:"bir minut",mm:"%d minut",h:"bir sagat",hh:"%d sagat",d:"bir gün",dd:"%d gün",M:"bir aý",MM:"%d aý",y:"bir ýyl",yy:"%d ýyl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'unjy";var o=e%10;return e+(t[o]||t[e%100-o]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tl-ph.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tlh.js":function(e,t,n){!function(e){"use strict";var t="pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_");function n(e,n,o,r){var s=function(e){var n=Math.floor(e%1e3/100),o=Math.floor(e%100/10),r=e%10,s="";return n>0&&(s+=t[n]+"vatlh"),o>0&&(s+=(""!==s?" ":"")+t[o]+"maH"),r>0&&(s+=(""!==s?" ":"")+t[r]),""===s?"pagh":s}(e);switch(o){case"ss":return s+" lup";case"mm":return s+" tup";case"hh":return s+" rep";case"dd":return s+" jaj";case"MM":return s+" jar";case"yy":return s+" DIS"}}e.defineLocale("tlh",{months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),monthsParseExact:!0,weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa’leS] LT",nextWeek:"LLL",lastDay:"[wa’Hu’] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"leS":-1!==e.indexOf("jar")?t.slice(0,-3)+"waQ":-1!==e.indexOf("DIS")?t.slice(0,-3)+"nem":t+" pIq"},past:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"Hu’":-1!==e.indexOf("jar")?t.slice(0,-3)+"wen":-1!==e.indexOf("DIS")?t.slice(0,-3)+"ben":t+" ret"},s:"puS lup",ss:n,m:"wa’ tup",mm:n,h:"wa’ rep",hh:n,d:"wa’ jaj",dd:n,M:"wa’ jar",MM:n,y:"wa’ DIS",yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tr.js":function(e,t,n){!function(e){"use strict";var t={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"};e.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),meridiem:function(e,t,n){return e<12?n?"öö":"ÖÖ":n?"ös":"ÖS"},meridiemParse:/öö|ÖÖ|ös|ÖS/,isPM:function(e){return"ös"===e||"ÖS"===e},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[gelecek] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",ss:"%d saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",w:"bir hafta",ww:"%d hafta",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'ıncı";var o=e%10;return e+(t[o]||t[e%100-o]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzl.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["viensas secunds","'iensas secunds"],ss:[e+" secunds",e+" secunds"],m:["'n míut","'iens míut"],mm:[e+" míuts",e+" míuts"],h:["'n þora","'iensa þora"],hh:[e+" þoras",e+" þoras"],d:["'n ziua","'iensa ziua"],dd:[e+" ziuas",e+" ziuas"],M:["'n mes","'iens mes"],MM:[e+" mesen",e+" mesen"],y:["'n ar","'iens ar"],yy:[e+" ars",e+" ars"]};return o||t?r[n][0]:r[n][1]}e.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiemParse:/d\'o|d\'a/i,isPM:function(e){return"d'o"===e.toLowerCase()},meridiem:function(e,t,n){return e>11?n?"d'o":"D'O":n?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzm-latn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",ss:"%d imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzm.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",ss:"%d ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ug-cn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ug-cn",{months:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),monthsShort:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),weekdays:"يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە".split("_"),weekdaysShort:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),weekdaysMin:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY-يىلىM-ئاينىڭD-كۈنى",LLL:"YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm",LLLL:"dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm"},meridiemParse:/يېرىم كېچە|سەھەر|چۈشتىن بۇرۇن|چۈش|چۈشتىن كېيىن|كەچ/,meridiemHour:function(e,t){return 12===e&&(e=0),"يېرىم كېچە"===t||"سەھەر"===t||"چۈشتىن بۇرۇن"===t?e:"چۈشتىن كېيىن"===t||"كەچ"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var o=100*e+t;return o<600?"يېرىم كېچە":o<900?"سەھەر":o<1130?"چۈشتىن بۇرۇن":o<1230?"چۈش":o<1800?"چۈشتىن كېيىن":"كەچ"},calendar:{sameDay:"[بۈگۈن سائەت] LT",nextDay:"[ئەتە سائەت] LT",nextWeek:"[كېلەركى] dddd [سائەت] LT",lastDay:"[تۆنۈگۈن] LT",lastWeek:"[ئالدىنقى] dddd [سائەت] LT",sameElse:"L"},relativeTime:{future:"%s كېيىن",past:"%s بۇرۇن",s:"نەچچە سېكونت",ss:"%d سېكونت",m:"بىر مىنۇت",mm:"%d مىنۇت",h:"بىر سائەت",hh:"%d سائەت",d:"بىر كۈن",dd:"%d كۈن",M:"بىر ئاي",MM:"%d ئاي",y:"بىر يىل",yy:"%d يىل"},dayOfMonthOrdinalParse:/\d{1,2}(-كۈنى|-ئاي|-ھەپتە)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"-كۈنى";case"w":case"W":return e+"-ھەپتە";default:return e}},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uk.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"хвилина":"хвилину":"h"===n?t?"година":"годину":e+" "+(o=+e,r={ss:t?"секунда_секунди_секунд":"секунду_секунди_секунд",mm:t?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:t?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}function n(e){return function(){return e+"о"+(11===this.hours()?"б":"")+"] LT"}}e.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:function(e,t){var n={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")};return!0===e?n.nominative.slice(1,7).concat(n.nominative.slice(0,1)):e?n[/(\[[ВвУу]\]) ?dddd/.test(t)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(t)?"genitive":"nominative"][e.day()]:n.nominative},weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:n("[Сьогодні "),nextDay:n("[Завтра "),lastDay:n("[Вчора "),nextWeek:n("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return n("[Минулої] dddd [").call(this);case 1:case 2:case 4:return n("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",ss:t,m:t,mm:t,h:"годину",hh:t,d:"день",dd:t,M:"місяць",MM:t,y:"рік",yy:t},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(e){return/^(дня|вечора)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночі":e<12?"ранку":e<17?"дня":"вечора"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e+"-й";case"D":return e+"-го";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ur.js":function(e,t,n){!function(e){"use strict";var t=["جنوری","فروری","مارچ","اپریل","مئی","جون","جولائی","اگست","ستمبر","اکتوبر","نومبر","دسمبر"],n=["اتوار","پیر","منگل","بدھ","جمعرات","جمعہ","ہفتہ"];e.defineLocale("ur",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[آج بوقت] LT",nextDay:"[کل بوقت] LT",nextWeek:"dddd [بوقت] LT",lastDay:"[گذشتہ روز بوقت] LT",lastWeek:"[گذشتہ] dddd [بوقت] LT",sameElse:"L"},relativeTime:{future:"%s بعد",past:"%s قبل",s:"چند سیکنڈ",ss:"%d سیکنڈ",m:"ایک منٹ",mm:"%d منٹ",h:"ایک گھنٹہ",hh:"%d گھنٹے",d:"ایک دن",dd:"%d دن",M:"ایک ماہ",MM:"%d ماہ",y:"ایک سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uz-latn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("uz-latn",{months:"Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr".split("_"),monthsShort:"Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek".split("_"),weekdays:"Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba".split("_"),weekdaysShort:"Yak_Dush_Sesh_Chor_Pay_Jum_Shan".split("_"),weekdaysMin:"Ya_Du_Se_Cho_Pa_Ju_Sha".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Bugun soat] LT [da]",nextDay:"[Ertaga] LT [da]",nextWeek:"dddd [kuni soat] LT [da]",lastDay:"[Kecha soat] LT [da]",lastWeek:"[O'tgan] dddd [kuni soat] LT [da]",sameElse:"L"},relativeTime:{future:"Yaqin %s ichida",past:"Bir necha %s oldin",s:"soniya",ss:"%d soniya",m:"bir daqiqa",mm:"%d daqiqa",h:"bir soat",hh:"%d soat",d:"bir kun",dd:"%d kun",M:"bir oy",MM:"%d oy",y:"bir yil",yy:"%d yil"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uz.js":function(e,t,n){!function(e){"use strict";e.defineLocale("uz",{months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",ss:"%d фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/vi.js":function(e,t,n){!function(e){"use strict";e.defineLocale("vi",{months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),monthsShort:"Thg 01_Thg 02_Thg 03_Thg 04_Thg 05_Thg 06_Thg 07_Thg 08_Thg 09_Thg 10_Thg 11_Thg 12".split("_"),monthsParseExact:!0,weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysParseExact:!0,meridiemParse:/sa|ch/i,isPM:function(e){return/^ch$/i.test(e)},meridiem:function(e,t,n){return e<12?n?"sa":"SA":n?"ch":"CH"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[Ngày mai lúc] LT",nextWeek:"dddd [tuần tới lúc] LT",lastDay:"[Hôm qua lúc] LT",lastWeek:"dddd [tuần trước lúc] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",ss:"%d giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",w:"một tuần",ww:"%d tuần",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/x-pseudo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("x-pseudo",{months:"J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér".split("_"),monthsShort:"J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc".split("_"),monthsParseExact:!0,weekdays:"S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý".split("_"),weekdaysShort:"S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát".split("_"),weekdaysMin:"S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[T~ódá~ý át] LT",nextDay:"[T~ómó~rró~w át] LT",nextWeek:"dddd [át] LT",lastDay:"[Ý~ést~érdá~ý át] LT",lastWeek:"[L~ást] dddd [át] LT",sameElse:"L"},relativeTime:{future:"í~ñ %s",past:"%s á~gó",s:"á ~féw ~sécó~ñds",ss:"%d s~écóñ~ds",m:"á ~míñ~úté",mm:"%d m~íñú~tés",h:"á~ñ hó~úr",hh:"%d h~óúrs",d:"á ~dáý",dd:"%d d~áýs",M:"á ~móñ~th",MM:"%d m~óñt~hs",y:"á ~ýéár",yy:"%d ý~éárs"},dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/yo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("yo",{months:"Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀".split("_"),monthsShort:"Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀".split("_"),weekdays:"Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta".split("_"),weekdaysShort:"Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá".split("_"),weekdaysMin:"Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Ònì ni] LT",nextDay:"[Ọ̀la ni] LT",nextWeek:"dddd [Ọsẹ̀ tón'bọ] [ni] LT",lastDay:"[Àna ni] LT",lastWeek:"dddd [Ọsẹ̀ tólọ́] [ni] LT",sameElse:"L"},relativeTime:{future:"ní %s",past:"%s kọjá",s:"ìsẹjú aayá die",ss:"aayá %d",m:"ìsẹjú kan",mm:"ìsẹjú %d",h:"wákati kan",hh:"wákati %d",d:"ọjọ́ kan",dd:"ọjọ́ %d",M:"osù kan",MM:"osù %d",y:"ọdún kan",yy:"ọdún %d"},dayOfMonthOrdinalParse:/ọjọ́\s\d{1,2}/,ordinal:"ọjọ́ %d",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-cn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"下午"===t||"晚上"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:function(e){return e.week()!==this.week()?"[下]dddLT":"[本]dddLT"},lastDay:"[昨天]LT",lastWeek:function(e){return this.week()!==e.week()?"[上]dddLT":"[本]dddLT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|周)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"周";default:return e}},relativeTime:{future:"%s后",past:"%s前",s:"几秒",ss:"%d 秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",w:"1 周",ww:"%d 周",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-hk.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-hk",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1200?"上午":1200===o?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-mo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-mo",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"D/M/YYYY",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-tw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale sync recursive ^\\.\\/.*$":(e,t,n)=>{var o={"./af":"./node_modules/moment/locale/af.js","./af.js":"./node_modules/moment/locale/af.js","./ar":"./node_modules/moment/locale/ar.js","./ar-dz":"./node_modules/moment/locale/ar-dz.js","./ar-dz.js":"./node_modules/moment/locale/ar-dz.js","./ar-kw":"./node_modules/moment/locale/ar-kw.js","./ar-kw.js":"./node_modules/moment/locale/ar-kw.js","./ar-ly":"./node_modules/moment/locale/ar-ly.js","./ar-ly.js":"./node_modules/moment/locale/ar-ly.js","./ar-ma":"./node_modules/moment/locale/ar-ma.js","./ar-ma.js":"./node_modules/moment/locale/ar-ma.js","./ar-sa":"./node_modules/moment/locale/ar-sa.js","./ar-sa.js":"./node_modules/moment/locale/ar-sa.js","./ar-tn":"./node_modules/moment/locale/ar-tn.js","./ar-tn.js":"./node_modules/moment/locale/ar-tn.js","./ar.js":"./node_modules/moment/locale/ar.js","./az":"./node_modules/moment/locale/az.js","./az.js":"./node_modules/moment/locale/az.js","./be":"./node_modules/moment/locale/be.js","./be.js":"./node_modules/moment/locale/be.js","./bg":"./node_modules/moment/locale/bg.js","./bg.js":"./node_modules/moment/locale/bg.js","./bm":"./node_modules/moment/locale/bm.js","./bm.js":"./node_modules/moment/locale/bm.js","./bn":"./node_modules/moment/locale/bn.js","./bn-bd":"./node_modules/moment/locale/bn-bd.js","./bn-bd.js":"./node_modules/moment/locale/bn-bd.js","./bn.js":"./node_modules/moment/locale/bn.js","./bo":"./node_modules/moment/locale/bo.js","./bo.js":"./node_modules/moment/locale/bo.js","./br":"./node_modules/moment/locale/br.js","./br.js":"./node_modules/moment/locale/br.js","./bs":"./node_modules/moment/locale/bs.js","./bs.js":"./node_modules/moment/locale/bs.js","./ca":"./node_modules/moment/locale/ca.js","./ca.js":"./node_modules/moment/locale/ca.js","./cs":"./node_modules/moment/locale/cs.js","./cs.js":"./node_modules/moment/locale/cs.js","./cv":"./node_modules/moment/locale/cv.js","./cv.js":"./node_modules/moment/locale/cv.js","./cy":"./node_modules/moment/locale/cy.js","./cy.js":"./node_modules/moment/locale/cy.js","./da":"./node_modules/moment/locale/da.js","./da.js":"./node_modules/moment/locale/da.js","./de":"./node_modules/moment/locale/de.js","./de-at":"./node_modules/moment/locale/de-at.js","./de-at.js":"./node_modules/moment/locale/de-at.js","./de-ch":"./node_modules/moment/locale/de-ch.js","./de-ch.js":"./node_modules/moment/locale/de-ch.js","./de.js":"./node_modules/moment/locale/de.js","./dv":"./node_modules/moment/locale/dv.js","./dv.js":"./node_modules/moment/locale/dv.js","./el":"./node_modules/moment/locale/el.js","./el.js":"./node_modules/moment/locale/el.js","./en-au":"./node_modules/moment/locale/en-au.js","./en-au.js":"./node_modules/moment/locale/en-au.js","./en-ca":"./node_modules/moment/locale/en-ca.js","./en-ca.js":"./node_modules/moment/locale/en-ca.js","./en-gb":"./node_modules/moment/locale/en-gb.js","./en-gb.js":"./node_modules/moment/locale/en-gb.js","./en-ie":"./node_modules/moment/locale/en-ie.js","./en-ie.js":"./node_modules/moment/locale/en-ie.js","./en-il":"./node_modules/moment/locale/en-il.js","./en-il.js":"./node_modules/moment/locale/en-il.js","./en-in":"./node_modules/moment/locale/en-in.js","./en-in.js":"./node_modules/moment/locale/en-in.js","./en-nz":"./node_modules/moment/locale/en-nz.js","./en-nz.js":"./node_modules/moment/locale/en-nz.js","./en-sg":"./node_modules/moment/locale/en-sg.js","./en-sg.js":"./node_modules/moment/locale/en-sg.js","./eo":"./node_modules/moment/locale/eo.js","./eo.js":"./node_modules/moment/locale/eo.js","./es":"./node_modules/moment/locale/es.js","./es-do":"./node_modules/moment/locale/es-do.js","./es-do.js":"./node_modules/moment/locale/es-do.js","./es-mx":"./node_modules/moment/locale/es-mx.js","./es-mx.js":"./node_modules/moment/locale/es-mx.js","./es-us":"./node_modules/moment/locale/es-us.js","./es-us.js":"./node_modules/moment/locale/es-us.js","./es.js":"./node_modules/moment/locale/es.js","./et":"./node_modules/moment/locale/et.js","./et.js":"./node_modules/moment/locale/et.js","./eu":"./node_modules/moment/locale/eu.js","./eu.js":"./node_modules/moment/locale/eu.js","./fa":"./node_modules/moment/locale/fa.js","./fa.js":"./node_modules/moment/locale/fa.js","./fi":"./node_modules/moment/locale/fi.js","./fi.js":"./node_modules/moment/locale/fi.js","./fil":"./node_modules/moment/locale/fil.js","./fil.js":"./node_modules/moment/locale/fil.js","./fo":"./node_modules/moment/locale/fo.js","./fo.js":"./node_modules/moment/locale/fo.js","./fr":"./node_modules/moment/locale/fr.js","./fr-ca":"./node_modules/moment/locale/fr-ca.js","./fr-ca.js":"./node_modules/moment/locale/fr-ca.js","./fr-ch":"./node_modules/moment/locale/fr-ch.js","./fr-ch.js":"./node_modules/moment/locale/fr-ch.js","./fr.js":"./node_modules/moment/locale/fr.js","./fy":"./node_modules/moment/locale/fy.js","./fy.js":"./node_modules/moment/locale/fy.js","./ga":"./node_modules/moment/locale/ga.js","./ga.js":"./node_modules/moment/locale/ga.js","./gd":"./node_modules/moment/locale/gd.js","./gd.js":"./node_modules/moment/locale/gd.js","./gl":"./node_modules/moment/locale/gl.js","./gl.js":"./node_modules/moment/locale/gl.js","./gom-deva":"./node_modules/moment/locale/gom-deva.js","./gom-deva.js":"./node_modules/moment/locale/gom-deva.js","./gom-latn":"./node_modules/moment/locale/gom-latn.js","./gom-latn.js":"./node_modules/moment/locale/gom-latn.js","./gu":"./node_modules/moment/locale/gu.js","./gu.js":"./node_modules/moment/locale/gu.js","./he":"./node_modules/moment/locale/he.js","./he.js":"./node_modules/moment/locale/he.js","./hi":"./node_modules/moment/locale/hi.js","./hi.js":"./node_modules/moment/locale/hi.js","./hr":"./node_modules/moment/locale/hr.js","./hr.js":"./node_modules/moment/locale/hr.js","./hu":"./node_modules/moment/locale/hu.js","./hu.js":"./node_modules/moment/locale/hu.js","./hy-am":"./node_modules/moment/locale/hy-am.js","./hy-am.js":"./node_modules/moment/locale/hy-am.js","./id":"./node_modules/moment/locale/id.js","./id.js":"./node_modules/moment/locale/id.js","./is":"./node_modules/moment/locale/is.js","./is.js":"./node_modules/moment/locale/is.js","./it":"./node_modules/moment/locale/it.js","./it-ch":"./node_modules/moment/locale/it-ch.js","./it-ch.js":"./node_modules/moment/locale/it-ch.js","./it.js":"./node_modules/moment/locale/it.js","./ja":"./node_modules/moment/locale/ja.js","./ja.js":"./node_modules/moment/locale/ja.js","./jv":"./node_modules/moment/locale/jv.js","./jv.js":"./node_modules/moment/locale/jv.js","./ka":"./node_modules/moment/locale/ka.js","./ka.js":"./node_modules/moment/locale/ka.js","./kk":"./node_modules/moment/locale/kk.js","./kk.js":"./node_modules/moment/locale/kk.js","./km":"./node_modules/moment/locale/km.js","./km.js":"./node_modules/moment/locale/km.js","./kn":"./node_modules/moment/locale/kn.js","./kn.js":"./node_modules/moment/locale/kn.js","./ko":"./node_modules/moment/locale/ko.js","./ko.js":"./node_modules/moment/locale/ko.js","./ku":"./node_modules/moment/locale/ku.js","./ku.js":"./node_modules/moment/locale/ku.js","./ky":"./node_modules/moment/locale/ky.js","./ky.js":"./node_modules/moment/locale/ky.js","./lb":"./node_modules/moment/locale/lb.js","./lb.js":"./node_modules/moment/locale/lb.js","./lo":"./node_modules/moment/locale/lo.js","./lo.js":"./node_modules/moment/locale/lo.js","./lt":"./node_modules/moment/locale/lt.js","./lt.js":"./node_modules/moment/locale/lt.js","./lv":"./node_modules/moment/locale/lv.js","./lv.js":"./node_modules/moment/locale/lv.js","./me":"./node_modules/moment/locale/me.js","./me.js":"./node_modules/moment/locale/me.js","./mi":"./node_modules/moment/locale/mi.js","./mi.js":"./node_modules/moment/locale/mi.js","./mk":"./node_modules/moment/locale/mk.js","./mk.js":"./node_modules/moment/locale/mk.js","./ml":"./node_modules/moment/locale/ml.js","./ml.js":"./node_modules/moment/locale/ml.js","./mn":"./node_modules/moment/locale/mn.js","./mn.js":"./node_modules/moment/locale/mn.js","./mr":"./node_modules/moment/locale/mr.js","./mr.js":"./node_modules/moment/locale/mr.js","./ms":"./node_modules/moment/locale/ms.js","./ms-my":"./node_modules/moment/locale/ms-my.js","./ms-my.js":"./node_modules/moment/locale/ms-my.js","./ms.js":"./node_modules/moment/locale/ms.js","./mt":"./node_modules/moment/locale/mt.js","./mt.js":"./node_modules/moment/locale/mt.js","./my":"./node_modules/moment/locale/my.js","./my.js":"./node_modules/moment/locale/my.js","./nb":"./node_modules/moment/locale/nb.js","./nb.js":"./node_modules/moment/locale/nb.js","./ne":"./node_modules/moment/locale/ne.js","./ne.js":"./node_modules/moment/locale/ne.js","./nl":"./node_modules/moment/locale/nl.js","./nl-be":"./node_modules/moment/locale/nl-be.js","./nl-be.js":"./node_modules/moment/locale/nl-be.js","./nl.js":"./node_modules/moment/locale/nl.js","./nn":"./node_modules/moment/locale/nn.js","./nn.js":"./node_modules/moment/locale/nn.js","./oc-lnc":"./node_modules/moment/locale/oc-lnc.js","./oc-lnc.js":"./node_modules/moment/locale/oc-lnc.js","./pa-in":"./node_modules/moment/locale/pa-in.js","./pa-in.js":"./node_modules/moment/locale/pa-in.js","./pl":"./node_modules/moment/locale/pl.js","./pl.js":"./node_modules/moment/locale/pl.js","./pt":"./node_modules/moment/locale/pt.js","./pt-br":"./node_modules/moment/locale/pt-br.js","./pt-br.js":"./node_modules/moment/locale/pt-br.js","./pt.js":"./node_modules/moment/locale/pt.js","./ro":"./node_modules/moment/locale/ro.js","./ro.js":"./node_modules/moment/locale/ro.js","./ru":"./node_modules/moment/locale/ru.js","./ru.js":"./node_modules/moment/locale/ru.js","./sd":"./node_modules/moment/locale/sd.js","./sd.js":"./node_modules/moment/locale/sd.js","./se":"./node_modules/moment/locale/se.js","./se.js":"./node_modules/moment/locale/se.js","./si":"./node_modules/moment/locale/si.js","./si.js":"./node_modules/moment/locale/si.js","./sk":"./node_modules/moment/locale/sk.js","./sk.js":"./node_modules/moment/locale/sk.js","./sl":"./node_modules/moment/locale/sl.js","./sl.js":"./node_modules/moment/locale/sl.js","./sq":"./node_modules/moment/locale/sq.js","./sq.js":"./node_modules/moment/locale/sq.js","./sr":"./node_modules/moment/locale/sr.js","./sr-cyrl":"./node_modules/moment/locale/sr-cyrl.js","./sr-cyrl.js":"./node_modules/moment/locale/sr-cyrl.js","./sr.js":"./node_modules/moment/locale/sr.js","./ss":"./node_modules/moment/locale/ss.js","./ss.js":"./node_modules/moment/locale/ss.js","./sv":"./node_modules/moment/locale/sv.js","./sv.js":"./node_modules/moment/locale/sv.js","./sw":"./node_modules/moment/locale/sw.js","./sw.js":"./node_modules/moment/locale/sw.js","./ta":"./node_modules/moment/locale/ta.js","./ta.js":"./node_modules/moment/locale/ta.js","./te":"./node_modules/moment/locale/te.js","./te.js":"./node_modules/moment/locale/te.js","./tet":"./node_modules/moment/locale/tet.js","./tet.js":"./node_modules/moment/locale/tet.js","./tg":"./node_modules/moment/locale/tg.js","./tg.js":"./node_modules/moment/locale/tg.js","./th":"./node_modules/moment/locale/th.js","./th.js":"./node_modules/moment/locale/th.js","./tk":"./node_modules/moment/locale/tk.js","./tk.js":"./node_modules/moment/locale/tk.js","./tl-ph":"./node_modules/moment/locale/tl-ph.js","./tl-ph.js":"./node_modules/moment/locale/tl-ph.js","./tlh":"./node_modules/moment/locale/tlh.js","./tlh.js":"./node_modules/moment/locale/tlh.js","./tr":"./node_modules/moment/locale/tr.js","./tr.js":"./node_modules/moment/locale/tr.js","./tzl":"./node_modules/moment/locale/tzl.js","./tzl.js":"./node_modules/moment/locale/tzl.js","./tzm":"./node_modules/moment/locale/tzm.js","./tzm-latn":"./node_modules/moment/locale/tzm-latn.js","./tzm-latn.js":"./node_modules/moment/locale/tzm-latn.js","./tzm.js":"./node_modules/moment/locale/tzm.js","./ug-cn":"./node_modules/moment/locale/ug-cn.js","./ug-cn.js":"./node_modules/moment/locale/ug-cn.js","./uk":"./node_modules/moment/locale/uk.js","./uk.js":"./node_modules/moment/locale/uk.js","./ur":"./node_modules/moment/locale/ur.js","./ur.js":"./node_modules/moment/locale/ur.js","./uz":"./node_modules/moment/locale/uz.js","./uz-latn":"./node_modules/moment/locale/uz-latn.js","./uz-latn.js":"./node_modules/moment/locale/uz-latn.js","./uz.js":"./node_modules/moment/locale/uz.js","./vi":"./node_modules/moment/locale/vi.js","./vi.js":"./node_modules/moment/locale/vi.js","./x-pseudo":"./node_modules/moment/locale/x-pseudo.js","./x-pseudo.js":"./node_modules/moment/locale/x-pseudo.js","./yo":"./node_modules/moment/locale/yo.js","./yo.js":"./node_modules/moment/locale/yo.js","./zh-cn":"./node_modules/moment/locale/zh-cn.js","./zh-cn.js":"./node_modules/moment/locale/zh-cn.js","./zh-hk":"./node_modules/moment/locale/zh-hk.js","./zh-hk.js":"./node_modules/moment/locale/zh-hk.js","./zh-mo":"./node_modules/moment/locale/zh-mo.js","./zh-mo.js":"./node_modules/moment/locale/zh-mo.js","./zh-tw":"./node_modules/moment/locale/zh-tw.js","./zh-tw.js":"./node_modules/moment/locale/zh-tw.js"};function r(e){var t=s(e);return n(t)}function s(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}r.keys=function(){return Object.keys(o)},r.resolve=s,e.exports=r,r.id="./node_modules/moment/locale sync recursive ^\\.\\/.*$"},"./node_modules/ng-csv/build/ng-csv.min.js":(e,t)=>{var n;n=window,document,angular.module("ngCsv.config",[]).value("ngCsv.config",{debug:!0}).config(["$compileProvider",function(e){angular.isDefined(e.urlSanitizationWhitelist)?e.urlSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|data):/):e.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|data):/)}]),angular.module("ngCsv.directives",["ngCsv.services"]),angular.module("ngCsv.services",[]),angular.module("ngCsv",["ngCsv.config","ngCsv.services","ngCsv.directives","ngSanitize"]),e.exports===t&&(e.exports="ngCsv"),angular.module("ngCsv.services").service("CSV",["$q",function(e){var t="\r\n",n={"\\t":"\t","\\b":"\b","\\v":"\v","\\f":"\f","\\r":"\r"};this.stringifyField=function(e,t){return"locale"===t.decimalSep&&this.isFloat(e)?e.toLocaleString():"."!==t.decimalSep&&this.isFloat(e)?e.toString().replace(".",t.decimalSep):"string"==typeof e?(e=e.replace(/"/g,'""'),(t.quoteStrings||e.indexOf(",")>-1||e.indexOf("\n")>-1||e.indexOf("\r")>-1)&&(e=t.txtDelim+e+t.txtDelim),e):"boolean"==typeof e?e?"TRUE":"FALSE":e},this.isFloat=function(e){return+e===e&&(!isFinite(e)||Boolean(e%1))},this.stringify=function(n,o){var r=e.defer(),s=this,a="",i="",d=e.when(n).then((function(e){var n,d;angular.isDefined(o.header)&&o.header&&(n=[],angular.forEach(o.header,(function(e){this.push(s.stringifyField(e,o))}),n),d=n.join(o.fieldSep?o.fieldSep:","),i+=d+t);var u,m,l=[];angular.isArray(e)?l=e:angular.isFunction(e)&&(l=e()),angular.isDefined(o.label)&&o.label&&"boolean"==typeof o.label&&(u=[],angular.forEach(l[0],(function(e,t){this.push(s.stringifyField(t,o))}),u),m=u.join(o.fieldSep?o.fieldSep:","),i+=m+t),angular.forEach(l,(function(e,n){var r,a,d=angular.copy(l[n]);a=[];var u=o.columnOrder?o.columnOrder:d;angular.forEach(u,(function(e){var t=o.columnOrder?d[e]:e;this.push(s.stringifyField(t,o))}),a),r=a.join(o.fieldSep?o.fieldSep:","),i+=n'),i=angular.element(a.children()[0]);i.attr("href",n.URL.createObjectURL(o)),i.attr("download",e.getFilename()),i.attr("target","_blank"),r.find("body").append(a),s((function(){i[0].click(),i.remove()}),null)}}()})),e.$apply()}))}}}])},"./src/js/chat/index.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/5e32f2e1a6d11e8f150e.html"},"./src/js/closing/index.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/00860aee362cdeeb1080.html"},"./src/js/offline/index.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/1b90d6b0c511f3791069.html"},"./src/js/online/index.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/26fbe83f4ba96d6e6cf1.html"},"./src/js/unmanaged/index.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/3f18dac5f545add792db.html"},"./src/js/waiting/index.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/6043a16afdb829ba5934.html"}},e=>{var t=t=>e(e.s=t);e.O(0,["vendor-index","vendor-angular-76f2ed34","vendor-angular-58d021f3","vendor-ng-embed","vendor-moment","vendor-jquery","vendor-jquery.textcomplete","vendor-emojionearea","vendor-emojione","vendor-angular-sanitize","vendor-angular-resource","vendor-angular-messages","vendor-angular-material","vendor-angular-local-storage","vendor-angular-animate","vendor-urlMatcher","vendor-transition","vendor-stateService","vendor-stateDirectives","vendor-flow"],(()=>(t("./node_modules/jquery/dist/jquery.js"),t("./node_modules/angular/index-exposed.js"),t("./node_modules/moment/moment.js"),t("./node_modules/@flowjs/flow.js/src/flow.js"),t("./node_modules/emojione/lib/js/emojione.js"),t("./src/js/index.module.js")))),e.O()}]); +//# sourceMappingURL=chat.js.map \ No newline at end of file diff --git a/snippet/3.1.0/scripts/chat.js.LICENSE.txt b/snippet/3.0.0/scripts/chat.js.LICENSE.txt similarity index 100% rename from snippet/3.1.0/scripts/chat.js.LICENSE.txt rename to snippet/3.0.0/scripts/chat.js.LICENSE.txt diff --git a/snippet/3.0.0/scripts/chat.js.map b/snippet/3.0.0/scripts/chat.js.map new file mode 100644 index 0000000..3b8e818 --- /dev/null +++ b/snippet/3.0.0/scripts/chat.js.map @@ -0,0 +1 @@ +{"version":3,"file":"scripts/chat.js","mappings":";iMAOAA,QAAQC,OAAO,gBAAiB,IAC/BC,SAAS,eAAe,WACvB,aAMAC,KAAKC,SAAW,GAQhBD,KAAKE,QAAU,SAAUC,GACvB,OAAO,IAAIC,EAAKD,IASlBH,KAAKK,OAAS,GASdL,KAAKM,GAAK,SAAUC,EAAOC,GACzBR,KAAKK,OAAOI,KAAK,CAACF,EAAOC,KAG3BR,KAAKU,KAAO,WACV,IAAIC,EAAKX,KAAKE,QACVD,EAAWD,KAAKC,SAChBI,EAASL,KAAKK,OAClB,MAAO,CACL,OAAU,SAASO,GAEjB,IAAIC,EAAOF,EAAGd,QAAQiB,OAAO,GAAIb,EAAUW,IAI3C,OAHAf,QAAQkB,QAAQV,GAAQ,SAAUE,GAChCM,EAAKP,GAAGC,EAAM,GAAIA,EAAM,OAEnBM,QAKfhB,QAAQC,OAAO,YAAa,CAAC,kBAC1BkB,WAAW,WAAY,CAAC,SAAU,SAAU,SAAU,cACvD,SAAUC,EAAQC,EAAQC,EAAQC,GAEhC,IAAIjB,EAAUN,QAAQiB,OAAO,GAAIG,EAAOI,MAAMH,EAAOI,WAGjDT,EAAQI,EAAOI,MAAMH,EAAOK,aAAeH,EAAYI,OAAOrB,GAE9DsB,EAAkB,SAASC,GAC7B,IAAIC,EAAOC,MAAMC,UAAUC,MAAMC,KAAKC,WACtCL,EAAKM,QACL,IAAI1B,EAAQU,EAAOiB,WAAWC,MAAMlB,EAAQ,CAAC,SAAWS,EAAWb,GAAMuB,OAAOT,IAMhF,GALI,CACF,SAAW,EAAG,eAAiB,EAAG,YAAe,EAAG,UAAa,EAAG,SAAY,GAChFD,IACAT,EAAOoB,cAEL9B,EAAM+B,iBACR,OAAO,GAIXzB,EAAKP,GAAG,WAAYmB,GACpBR,EAAOsB,IAAI,YAAY,WACnB1B,EAAK2B,IAAI,WAAYf,MAGzBR,EAAOwB,MAAQ5B,EAEXK,EAAOwB,eAAe,cACxBvB,EAAOD,EAAOyB,UAAUC,OAAO3B,EAAQJ,GACvCI,EAAOsB,IAAI,YAAY,WACrBpB,EAAOD,EAAOyB,UAAUC,OAAO3B,UAIpC4B,UAAU,WAAY,CAAC,WACtB,MAAO,CACLC,OAAO,EACP9B,WAAY,eAGlBnB,QAAQC,OAAO,WAAY,CAAC,cAC3B+C,UAAU,UAAW,CAAC,WACrB,MAAO,CACL,SAAY,KACZ,OAAS,EACT,QAAW,YACX,KAAQ,SAASC,EAAOC,EAASC,GAC/B,IAAIC,EAAcD,EAAMN,eAAe,iBACnCQ,EAAeF,EAAMN,eAAe,kBACpCS,EAAaH,EAAMN,eAAe,cAAgBI,EAAMzB,MAAM2B,EAAMI,WACxEN,EAAML,MAAMY,aAAaN,EAASE,EAAaC,EAAcC,QAInEtD,QAAQC,OAAO,kBAAmB,CAAC,cAKhC+C,UAAU,mBAAmB,WAC5B,MAAO,CACL,OAAS,EACT,KAAQ,SAASC,EAAOC,EAASC,GAC/BD,EAAQO,KAAK,iBAAiB,SAAU/C,GACtCA,EAAMgD,yBASbV,UAAU,gBAAiB,CAAC,WAAY,SAASW,GAChD,MAAO,CACL,OAAS,EACT,KAAQ,SAASV,EAAOC,EAASC,GAC/B,IAAIS,EACAC,GAAQ,EACZX,EAAQO,KAAK,YAAY,SAAU/C,GAmBnC,IAAoBoD,EACdC,EACAC,EADAD,GAAW,EACXC,GAFcF,EAlBFpD,GAoBasD,cAAgBF,EAAUG,cAAcD,aACrEhE,QAAQkB,QAAQ8C,GAAgBA,EAAaE,OAAO,SAASC,GAC/C,UAARA,IACFJ,GAAW,MAGRA,IAvBFF,IACHZ,EAAMmB,OAAOjB,EAAMkB,eACnBR,GAAQ,GAEVF,EAASW,OAAOV,GAChBlD,EAAMgD,qBAERR,EAAQO,KAAK,kBAAkB,SAAU/C,GACvCiD,EAASW,OAAOV,GAChBA,EAAUD,GAAS,WACjBV,EAAMzB,MAAM2B,EAAMoB,eAClBX,EAAU,KACVC,GAAQ,IACP,aAgBb7D,QAAQC,OAAO,YAAa,CAAC,cAC5B+C,UAAU,YAAY,WACrB,MAAO,CACL,OAAS,EACT,QAAW,YACX,KAAQ,SAASC,EAAOC,EAASC,GAY/B,SAASqB,IACPvB,EAAML,MAAM4B,WAAWtB,GAZrBC,EAAMsB,gBACRxB,EAAMyB,OAAOvB,EAAMsB,iBAAiB,SAAUE,GACxCA,EACFH,IAYJvB,EAAML,MAAMgC,aAAa1B,MANzBsB,SAYP,SAAUxE,GAAU,aACnB,IAAIC,EAASD,EAAQC,OAAO,cAAe,CAAC,cAgB5CD,EAAQkB,QAfK,CACX2D,YAAa,CAAC,QAAS,YACvBC,aAAc,CAAC,SACfC,UAAW,CAAC,QAAS,UACrBC,WAAY,CAAC,SAAU,UACvBC,eAAgB,CAAC,SAAU,UAC3BC,UAAW,CAAC,SACZC,YAAa,CAAC,SACdC,UAAW,CAAC,QAAS,YACrBC,YAAa,GACbC,SAAU,GACVC,SAAU,GACVC,MAAO,CAAC,WAAY,WAGE,SAAUC,EAAW5D,GAC3C,IA4B6B6D,EA5BzBC,EAAO,SA4BkBD,EA5Ba7D,GA6B5B+D,OAAO,GAAGC,cAAgBH,EAAOzD,MAAM,IA5BzC,mBAAR0D,IACFA,EAAO,qBAET1F,EAAO+C,UAAU2C,EAAM,CAAC,WACtB,MAAO,CACLG,QAAS,YACT3E,WAAY,CAAC,SAAU,SAAU,SAAUC,EAAQC,GACjDD,EAAOsB,IAAI,SAAWb,GAAW,WAC/B,IAAIkE,EAAWhE,MAAMC,UAAUC,MAAMC,KAAKC,WACtCzB,EAAQqF,EAAS3D,QAErB,GAAIhB,EAAOwB,QAAUmD,EAAS3D,QAA9B,CAGA,IAAIN,EAAO,GACX9B,EAAQkB,QAAQuE,GAAW,SAASd,EAAOqB,GACzClE,EAAK6C,GAASoB,EAASC,OAEgB,IAArC5E,EAAOI,MAAMH,EAAOsE,GAAO7D,IAC7BpB,EAAMgD,8BAtCnB,CAiDC1D,SAEFA,QAAQC,OAAO,WAAY,CAAC,cAC3B+C,UAAU,UAAW,CAAC,WACrB,MAAO,CACL,OAAS,EACT,QAAW,YACX,KAAQ,SAASC,EAAOC,EAASC,GAC/B,IAAI8C,EAAO9C,EAAM+C,QACjBjD,EAAMyB,OAAOuB,GAAM,SAAUA,GAC3B,GAAKA,EAAL,CAGA,IAAIE,EAAa,IAAIC,WACrBD,EAAWE,cAAcJ,EAAKA,MAC9BE,EAAWG,OAAS,SAAU5F,GAC5BuC,EAAMmB,QAAO,WACXjB,EAAMoD,KAAK,MAAO7F,EAAM8F,OAAOC,qBAO3CzG,QAAQC,OAAO,iBAAkB,CAAC,cACjC+C,UAAU,gBAAiB,CAAC,WAC3B,MAAO,CACL,OAAS,EACT,QAAW,YACX,KAAQ,SAASC,GACfA,EAAMyD,UAAYzD,EAAML,MAAM+D,WAIpC3G,QAAQC,OAAO,OAAQ,CAAC,gBAAiB,YAAa,cAAe,WACnE,YAAa,iBAAkB,WAAY,yHC9JlC2G,4PAkKX,SAASC,EAAmBC,EAAUC,EAAaC,EAAcC,EAAOC,GACpE,IAAIC,GAAkB,IAAAC,OAAM,yBACxBC,GAAe,IAAAD,OAAM,sBACzB,MAAO,CACHE,SAAU,MACVC,UAAW,IACXC,QAAS,SAAUC,GACf,IAAIC,EAAUD,EAASE,OAEvB,OADAF,EAASG,QACF,SAAU3E,EAAO4E,GACpB,IAAIC,EAAOD,EAASC,KAAK,WACzB,IAAKA,EAGD,OAFAD,EAASF,KAAKD,QACdZ,EAASe,EAASE,WAAlBjB,CAA8B7D,GAGlC,IAAI+E,EAAMF,EAAKG,MAAQ,CAAEC,SAAU,GAAIC,YAAa,EAAAC,MAChDC,EAAaL,EAAIM,MAAQ,IAAI,EAAAC,eAAeP,EAAIM,MACpDT,EAASF,KAAKK,EAAIG,YAAYN,EAAUQ,IAAeX,GACvD,EAAAc,MAAA,gBAAsBV,EAAKW,QAASZ,EAASF,QAC7C,IAAIe,EAAO5B,EAASe,EAASE,YACzB5G,EAAa6G,EAAI7G,WACjBwH,EAAexB,EAAgBa,GAC/BY,EAAYvB,EAAaW,GACzBa,EAASR,IAAc,OAAUA,GAErC,GADApF,EAAM2F,GAAaC,EACf1H,EAAY,CACZ,IAAI2H,EAAsB/B,EAAY5F,GAAY,IAAAF,QAAO,GAAI4H,EAAQ,CAAEzH,OAAQ6B,EAAO4E,SAAUA,KAC5Fc,IACA1F,EAAM0F,GAAgBG,EACtB7F,EAAM0F,GAAcC,GAAaC,GAMrChB,EAASC,KAAK,0BAA2BgB,GACzCjB,EAASkB,WAAWjB,KAAK,0BAA2BgB,GACpDE,EAA4B9B,EAAIF,EAAc8B,EAAoB7F,EAAO+E,GAG7E,IAAI,IAAAiB,UAASjB,EAAIkB,WACb,IAAIC,GAAY,IAAAC,aAAYpB,EAAIkB,WAC5BG,EAAc,IAAIC,OAAO,eAAiBH,EAAY,IAAK,KAO3DI,EAAoBtG,EAAMyB,QAND,WACzB,IAAI8E,EAAc,GAAGvH,MAChBC,KAAK2F,EAAS,GAAGkB,UACjBU,QAAO,SAAUC,GAAM,OAAOA,GAAMA,EAAGC,SAAWN,EAAYO,KAAKF,EAAGC,YAC3E,OAAOH,GAAe,aAAgBA,GAAa1B,KAAK,IAAME,EAAIkB,UAAY,iBAErB,SAAUW,GAC9DA,IAELb,EAA4B9B,EAAIF,EAAc6C,EAAc5G,EAAO+E,GACnEuB,QAGRb,EAAKzF,MAzNrB2D,EAAS,CACL,QACA,WACA,gBACA,eACA,KACA,SAAwBK,EAAO6C,EAAUC,EAAeC,EAAc9C,GAwBlE,IAAI+C,EAAW,CACXhC,KAAM,CAAEC,SAAU,CAAEgC,SAAUjD,EAAMkD,WAAWC,qBAC/C3B,QAAS,IAETzF,EAAY,CACZqH,MAAO,EACP/C,SAAU,MACVgD,UAAU,EACV/C,SAAU,IACVgD,WAAY,UACZ/C,QAAS,SAAUC,EAAU+C,EAAQC,GACjC,OAAO,SAAUxH,EAAO4E,EAAU1E,GAC9B,IACIuH,EAAYC,EAAWC,EAAcC,EADrCC,EAAY3H,EAAc,QAAK,GAAI4H,EAAgB5H,EAAkB,WAAG6H,EAjCzE,SAAU9H,EAASsD,EAAQyE,GAC1B,mBAAwB,EACxBnB,EAASjG,MAAMX,EAAS,KAAMsD,GAAQ0E,KAAKD,GAG3CnB,EAASjG,MAAMX,EAAS,KAAMsD,EAAQyE,IA4BkCD,EAzBzE,SAAU9H,EAAS+H,GAClB,mBAAwB,EACxBnB,EAASqB,MAAMjI,GAASgI,KAAKD,GAG7BnB,EAASqB,MAAMjI,EAAS+H,IAoB0EG,EAAYvD,EAASwD,cAAc,YAAcpB,EAAUtE,EAAOqE,EAAa7G,EAAc,QAAKA,EAAY,MAAK,GAAjD6G,CAAqD/G,IAAU,WAEnOqI,EAAe,CACfC,MAAO,MACPC,GAAIxI,EAAUqH,QACd1E,KAAMA,EACN8F,IAAKL,EAAU3C,QAAQgD,IAAML,EAAU3C,QAAQgD,IAAM,IAAM9F,EAAOA,EAClE+F,OAAQ,KACRC,cAWJ,SAA+BD,KACvBA,GAAYA,aAAkB,QAEjBb,IAAYa,IAE7B,EAAAlD,MAAA,yBAA+B8C,EAAcI,GAAUA,EAAOxD,UAAYwD,EAAOxD,SAASgC,UAC1FW,EAAaa,EACbE,EAAWF,MAjBX,sBAEI,IAAIG,GAAsB,IAAAzE,OAAM,yBAAN,CAAgCgE,GAGtDU,GAAgB,IAAA1E,OAAM,0BAAN,CAAiCgE,GACrD,OAAOS,GAAuBC,IAGtC,EAAAtD,MAAA,iBAAuB,UAAW8C,GAUlCzD,EAASC,KAAK,UAAW,CAAEW,QAAS6C,IACpCM,IACA,IAAIG,EAAa9E,EAAM+E,eAAeV,GA2BtC,SAASM,EAAWF,GAChB,IAAIO,EAAWhJ,EAAMiJ,OACjBC,EAAYjF,EAAGkF,QAASC,EAAYnF,EAAGkF,QACvCE,EAAc,CACdrE,KAAMyD,EACNjD,QAAS6C,GAETiB,EAAc,CACdC,WAAYL,EAAUvI,QACtB6I,WAAYJ,EAAUzI,QACtB8I,YAAaL,GAcjBJ,EAASU,MAAM,sBAAuBhH,GACtC,IAAIiH,EAASnC,EAAYwB,GAAU,SAAUY,GACzCA,EAAM/E,KAAK,cAAeyE,GAC1BM,EAAM/E,KAAK,UAAWwE,GACtBtB,EAAe6B,EAAOhF,GAAU,WAC5BsE,EAAUW,UACNlC,GACAA,EAAa+B,MAAM,gCAClB,IAAAI,WAAUhC,KAAmBA,GAAkB9H,EAAMzB,MAAMuJ,KAC5DhB,EAAc8C,MAvD9B,WAWI,GAVInC,IACA,EAAAlC,MAAA,iBAAuB,yBAA0BkC,EAAW5C,KAAK,YACjE4C,EAAWsC,SACXtC,EAAa,MAEbE,IACA,EAAApC,MAAA,iBAAuB,mBAAoB8C,GAC3CV,EAAaqC,WACbrC,EAAe,MAEfD,EAAW,CACX,IAAIuC,EAAcvC,EAAU7C,KAAK,eACjC,EAAAU,MAAA,iBAAuB,cAAe0E,GACtClC,EAAeL,GAAW,WACtBuC,EAAYR,YAAYI,UACxBpC,EAAa,QAEjBA,EAAaC,EACbA,EAAY,MAuCZwC,MAEJxC,EAAYiC,GACZhC,EAAeqB,GAWFU,MAAM,qBAAsBjB,GAAUb,GACnDD,EAAapJ,MAAMsJ,GA7EvB7H,EAAMP,IAAI,YAAY,WAClB,EAAA8F,MAAA,iBAAuB,2BAA4B8C,GACnDS,UAgFhB,OAAO/I,IAGf6D,EAAmBuG,QAAU,CAAC,WAAY,cAAe,eAAgB,QAAS,MAiElF,IAAIC,EAAuE,mBAA7C,YAAe,aAAwB,UAEjEC,EAAe,EAEnB,SAAStE,EAA4B9B,EAAIF,EAAc8B,EAAoB1H,EAAQ4G,KAE3E,IAAAuF,YAAWzE,EAAmB0E,WAC3BxF,EAAIE,SAASgB,WAAalB,EAAIE,SAASuF,oBAAsBJ,GAChEvE,EAAmB0E,UAEvB,IAAIE,GAAY,IAAAC,MAAK3F,EAAIM,MAAMsF,MAAMC,KACjCC,EAAc,CAAErK,KAAMqF,GAE1B,IAAI,IAAAyE,YAAWzE,EAAmBiF,mBAAoB,CAClD,IACIC,EADiB,IAAI,EAAAzF,eAAeP,EAAIM,MACH2F,cAAc,gBAAgBnG,KAyBvE1G,EAAOsB,IAAI,WAAYsE,EAAakH,UAAU,IAvB1B,SAAUC,GAG1B,GAAIA,IAAiBH,IAAsE,IAA/CG,EAAaC,UAAUC,QAAQX,GAA3E,CAEA,IAAIY,EAAWH,EAAaI,OAAO,MAC/BC,EAAaL,EAAaI,OAAO,QACjCE,EAAgB,SAAUC,GAAQ,OAAOA,EAAKC,aAC9CC,EAAWT,EAAaU,YAAY,MAAMC,IAAIL,GAAeM,OAAO,EAAAC,QAAS,IAC7EC,EAAad,EAAaU,YAAY,QAAQC,IAAIL,GAAeM,OAAO,EAAAC,QAAS,IAEjFE,EAAkBN,EAASnF,QAAO,SAAU0F,GAC5C,IAAIC,EAAMH,EAAWZ,QAAQc,GAC7B,OAAgB,IAATC,IAAeH,EAAWG,GAAKC,KAAKC,OAAOhB,EAASa,EAAM3D,IAAKgD,EAAWW,EAAM3D,QAG3F,GAAI0D,EAAgBK,OAAQ,CACxB,IAAIC,EAAgBN,EAAgBJ,KAAI,SAAUW,GAAK,OAAOA,EAAEjE,MAE5DkE,GAAY,IAAAjG,QAAO6E,GAAU,SAAUnK,EAAK6B,GAAO,OAAuC,IAAhCwJ,EAAcnB,QAAQrI,MACpF8C,EAAmBiF,kBAAkB2B,EAAWvB,OAGSL,IAGrE,IAAI,IAAAP,YAAWzE,EAAmB6G,WAAY,CAC1C,IAAIC,EAAOtC,IACPuC,EAAc,gBAEdC,EAAqB,SAAUC,GAC/B,QAASA,IAAWA,EAAMF,KAA6C,IAA7BE,EAAMF,GAAaD,IAAmBE,EAAmBC,EAAMC,oBAYzGC,EAAW,CAAE7B,QAASV,EAAU/H,MACpCvE,EAAOsB,IAAI,WAAYsE,EAAakJ,SAASD,GAV3B,SAAUF,GACxB,IAAInM,EACAuM,EAAOJ,EAAMF,GAAeE,EAAMF,IAAgB,GAKtD,OAJKC,EAAmBC,KACpBnM,EAAUsD,EAAGkJ,KAAKtH,EAAmB6G,UAAUI,KACvC7E,MAAK,SAAU/G,GAAO,OAAQgM,EAAIP,IAAgB,IAARzL,KAE/CP,IAGyDkK,KAG5E,YAAe,mBAAmB9K,UAAU,SAAU4D,GACtD,YAAe,mBAAmB5D,UAAU,SAAU6D,qSC9ZlDwJ,EAAiC,WACjC,SAASA,IACL,IAAIC,EAAQnQ,KACGA,KAAKoQ,SAAWvQ,EAAQ,GAAR,cAAwB,EACxCG,KAAKU,KAAO,CACvB,QACA,iBACA,YACA,SAAU2P,EAAOC,EAAgBC,GAI7B,OAHAJ,EAAMK,iBAAmBD,EAAUE,KAAOF,EAAUE,IAAI,qBAAuBF,EAAUG,IAAI,oBAC7FP,EAAME,MAAQA,EACdF,EAAMG,eAAiBA,EAChBH,IAyJnB,OApJAD,EAAgBrO,UAAU8O,eAAiB,SAAUnM,GACjDxE,KAAKoQ,SAAW5L,GAepB0L,EAAgBrO,UAAU+O,WAAa,SAAUrF,EAAQ6C,EAAQyC,GAC7D,IACIC,EAAa,SAAUxK,GAAU,OAAO,EAAAyK,SAAA,QAAiBzK,GAAQyE,MAAK,SAAUiG,GAAO,MAAO,CAAGC,SAAUD,OAC3GE,EAAc,SAAU5K,GAAU,OAAO,EAAAyK,SAAA,QAAiBzK,GAAQyE,MAAK,SAAUiG,GAAO,MAAO,CAAGjI,UAAWiI,OACjH,OAAO,IAAApE,WAAUrB,EAAO0F,UAClBH,EAAW9Q,KAAKmR,WAAW5F,EAAO0F,SAAU7C,KAC5C,IAAAxB,WAAUrB,EAAO6F,aACbN,EAAW9Q,KAAKqR,QAAQ9F,EAAO6F,YAAahD,KAC5C,IAAAxB,WAAUrB,EAAO+F,kBACbR,EAAW9Q,KAAKuR,aAAahG,EAAO+F,iBAAkBlD,EAAQyC,KAC9D,IAAAjE,WAAUrB,EAAOxC,WACbmI,EAAY3F,EAAOxC,YACnB,IAAA6D,WAAUrB,EAAO+B,mBACb4D,EAAYlR,KAAKwR,sBAAsBjG,EAAO+B,kBAAmBc,EAAQyC,IACzEC,EAbA,wBAwB1BZ,EAAgBrO,UAAUsP,WAAa,SAAUF,EAAU7C,GACvD,OAAO,IAAAhB,YAAW6D,GAAYA,EAAS7C,GAAU6C,GAWrDf,EAAgBrO,UAAUwP,QAAU,SAAUI,EAAKrD,GAG/C,OAFI,IAAAhB,YAAWqE,KACXA,EAAMA,EAAIrD,IACH,MAAPqD,EACO,KACPzR,KAAKoQ,SACEpQ,KAAKqQ,MACPK,IAAIe,EAAK,CAAEC,MAAO1R,KAAKsQ,eAAgBqB,QAAS,CAAEC,OAAQ,eAC1D7G,MAAK,SAAU8G,GAChB,OAAOA,EAASlK,QAGjB3H,KAAKwQ,iBAAiBiB,IAUjCvB,EAAgBrO,UAAU0P,aAAe,SAAUxR,EAAUqO,EAAQyC,GACjE,IAAIiB,EAAO,EAAAf,SAAA,mBAA4BhR,GACnCgS,GAAa,IAAAC,SAAQjS,IAAY,IAAAyN,MAAKzN,GAAYA,EAEtD,OADiB,IAAI,EAAAkS,WAAW,GAAIF,EAAYD,GAC9BpB,IAAIG,IAS1BX,EAAgBrO,UAAU2P,sBAAwB,SAAUzR,EAAUqO,EAAQyC,GAC1E,IAAIiB,EAAO,EAAAf,SAAA,mBAA4BhR,GACnCgS,GAAa,IAAAC,SAAQjS,IAAY,IAAAyN,MAAKzN,GAAYA,EAEtD,OADiB,IAAI,EAAAkS,WAAW,GAAIF,EAAYD,GAC9BpB,IAAIG,IAgB1BX,EAAgBrO,UAAUqQ,sBAAwB,SAAUzL,EAAQoK,EAAS9H,EAAWoJ,GACpFA,EAAWA,GAAY,GAEvB,IAAIC,EAASvS,EAAQ,GAAR,eAAyB,EAAI,KAAO,GAE7CwS,EAAQ,SAAUC,GAClB,IAAIC,GAAU,IAAAtJ,aAAYqJ,GAC1B,MAAO,aAAa7I,KAAK8I,GAAW,KAAOA,EAAUA,GA6BrDvP,EAQZ,SAA8BwC,GAC1B,IAAIgN,EAAU,EAAAzB,SAAA,cAAuBvL,EAAO,aAC5C,IAAKgN,IAAYA,EAAQpD,OACrB,MAAM,IAAIqD,MAAM,mCAAqCjN,EAAO,KAChE,OAAOgN,EAAQ7D,IAAI+D,GAAa9D,OAAO,EAAAC,QAAS,IAZhC8D,CAAqB5J,GAAW4F,KA3BzB,SAAUiE,GACzB,IAAIpN,EAAOoN,EAAMpN,KAAM0J,EAAO0D,EAAM1D,KAChC2D,EAAWR,EAAM7M,GAIrB,GAAIiB,EAAOqM,KAAKD,KAAcV,EAAS3M,GACnC,OAAOqN,EAAW,KAAOpM,EAAOqM,KAAKD,GAAY,IACrD,IAAIE,EAAcZ,EAAS3M,IAASA,EAGpC,GAAa,MAAT0J,EACA,OAAO2D,EAAW,OAAST,EAAS,YAAcW,EAAc,MAIpE,GAAa,MAAT7D,EAAc,CACd,IAAI8D,EAAMnC,EAAQ/C,cAAciF,GAC5BpS,EAAKqS,GAAOA,EAAIrL,KAChBhG,EAAQhB,GAAM,EAAAoQ,SAAA,mBAA4BpQ,IAAQ,GAGtD,OAAOkS,EAAW,cAAgBE,IADhB,IAAAf,SAAQrR,GAAM,KAAOA,EAAGyO,OAAS,GAAK,IAAM,IACA,IAAMzN,EAAKsR,KAAK,KAAO,KAGzF,OAAOJ,EAAW,KAAOT,EAAS,YAAcW,EAAc,OAEJE,KAAK,KAC/DjK,EAAYqJ,EAAMtJ,GACtB,MAAO,IAAMC,EAAY,IAAMhG,EAAQ,MAAQgG,EAAY,KAExDkH,EArKyB,GAiLhCwC,EAAc,SAAUQ,GACxB,OAAI,IAAAC,UAASD,EAAIE,kBACNC,EAAcH,EAAIE,kBACtBC,EAAcH,EAAIpQ,QAIzBuQ,EAAgB,SAAUC,GAC1B,OAAOC,OAAOC,KAAKF,GAAe,IAE7B3E,KAAI,SAAU9I,GAAO,MAAO,CAACA,EAAK,oBAAoB4D,KAAK6J,EAAYzN,QAEvEyD,QAAO,SAAUmK,GAAS,OAAO,IAAA7G,WAAU6G,KAAU,IAAAzB,SAAQyB,EAAM,OAEnE9E,KAAI,SAAU8E,GAAS,MAAO,CAAGjO,KAAMiO,EAAM,GAAG,IAAMA,EAAM,GAAIvE,KAAMuE,EAAM,GAAG,2ECzL7EC,EAAsB,SAAUC,GACvC,OAAO,SAA0BC,GAC7B,IAAIC,EAAOD,EAAYD,GACnBG,EAAwB,WAAbH,EAAwB,OAAS,KAOhD,OAAOE,EANP,SAA0BjE,EAAOnC,GAC7B,IACIsG,EADiB,IAAI,EAAA3L,eAAewH,EAAMlB,YAAYoF,IAC1BC,WAAWtG,EAAMuG,WAC7CtL,GAAS,IAAA5H,QAAOmT,EAAUF,GAAa,CAAEG,QAASzG,EAAOO,aAAc4B,IAC3E,OAAO,EAAAmB,SAAA,iBAA0B8C,EAAM7T,KAAM0I,SAEhByL,ICfrCC,EAAqC,WACrC,SAASA,EAAoBC,GAEzBrU,KAAKsU,cAAgB,GACrBtU,KAAKqU,kBAAoBA,EACzB,IAAIE,GAAM,IAAAvQ,KAAIqQ,IACd,IAAAG,sBAAqBD,EAAKvU,KAAMuU,EAAK,CAAC,eA8D1C,OAhDAH,EAAoBK,6BAA+B,SAAUC,GACzD,IAAIC,EAAWD,EAAOE,kBAAkB1F,KAAK,QAC7CyF,EAASE,OAAS,SAAUvF,GACxB,OAAY,MAALA,EAAYA,EAAEwF,WAAWC,QAAQ,WAAW,SAAUC,GAAK,MAAQ,CAAE,IAAK,KAAM,IAAK,OAAQA,MAAU1F,GAElHqF,EAASM,OAAS,SAAU3F,GACxB,OAAY,MAALA,EAAYA,EAAEwF,WAAWC,QAAQ,aAAa,SAAUC,GAAK,MAAQ,CAAE,KAAM,IAAK,MAAO,KAAMA,MAAU1F,IAIxH8E,EAAoBvS,UAAUqT,QAAU,aACxCd,EAAoBvS,UAAUsT,SAAW,SAAU3U,GAC/C,IAAI2P,EAAQnQ,KAEZ,OADAA,KAAKsU,cAAc7T,KAAKD,GACjB,WAAc,OAAO,IAAA4U,YAAWjF,EAAMmE,cAAjB,CAAgC9T,KAEhE4T,EAAoBvS,UAAUwT,UAAY,WACtC,IAAIA,EAAYrV,KAAKqU,kBAAkBgB,YAEvC,OADAA,GAAY,IAAAlC,UAASkC,GAAaA,EAAUC,QAAUD,IAClCrV,KAAKuV,SAASC,SAEtCpB,EAAoBvS,UAAU4T,SAAW,WACrC,OAAOzV,KAAK0V,YAAc1V,KAAK0V,UAAY1V,KAAK2V,SAASF,YAAczV,KAAK4V,QAAQC,SAAS/B,WAEjGM,EAAoBvS,UAAU4P,IAAM,SAAUqE,EAAQf,EAAStH,GAQ3D,YAPgB,IAAZsH,IAAsBA,GAAU,IAChC,IAAAnI,WAAUkJ,IACV9V,KAAK+V,UAAUtE,IAAIqE,GACnBf,GACA/U,KAAK+V,UAAUhB,UACftH,GACAzN,KAAK+V,UAAUtI,MAAMA,GAClBzN,KAAK+V,UAAUtE,OAE1B2C,EAAoBvS,UAAUmU,iBAAmB,SAAUC,EAAYF,EAAWR,EAAUI,EAAUC,GAClG,IAAIzF,EAAQnQ,KACZA,KAAK+V,UAAYA,EACjB/V,KAAKuV,SAAWA,EAChBvV,KAAK2V,SAAWA,EAChB3V,KAAK4V,QAAUA,EAEfK,EAAW1T,IAAI,0BAA0B,SAAU2T,GAAO,OAAO/F,EAAMmE,cAAcvT,SAAQ,SAAUJ,GAAM,OAAOA,EAAGuV,SACvH,IAAIC,GAAO,IAAAnS,KAAI+R,IAEf,IAAAvB,sBAAqB2B,EAAMnW,KAAMmW,EAAM,CAAC,UAAW,OAAQ,SAAU,UAErE,IAAA3B,sBAAqB2B,EAAMnW,KAAMmW,EAAM,CAAC,OAAQ,WAAY,UAEzD/B,EApE6B,0ECaxCvU,EAAQ,GAAR,OAAe,qBAAsB,IACrC,IAAIuW,EAAWvW,EAAQ,GAAR,OAAe,iBAAkB,CAAC,OAC7CwW,EAAWxW,EAAQ,GAAR,OAAe,iBAAkB,CAAC,mBAC7CyW,EAAUzW,EAAQ,GAAR,OAAe,mBAAoB,CAAC,mBAC9C0W,EAAY1W,EAAQ,GAAR,OAAe,kBAAmB,CAAC,mBAAoB,iBAAkB,uBACrF2W,EAAW3W,EAAQ,GAAR,OAAe,YAAa,CAAC,iBAAkB,kBAAmB,uBAE7E6U,GADW7U,EAAQ,GAAR,OAAe,mBAAoB,CAAC,cACtC,MAGb,SAAS4W,EAAkBpC,IAEvBK,EAAS1U,KAAK0U,OAAS,IAAI,EAAAgC,UACpBC,cAAgB,IAAI,IAAcjC,EAAOkC,cAAelC,EAAOmC,cAEtEnC,EAAOkC,cAAcE,UAAU,QAAS,MACxCpC,EAAOkC,cAAcE,UAAU,SAAUpD,EAAoB,WAC7DgB,EAAOkC,cAAcE,UAAU,WAAYpD,EAAoB,aAC/DgB,EAAOkC,cAAcE,UAAU,UAAWpD,EAAoB,YAC9DgB,EAAOqC,YAAY/M,WAAWgN,mBAAmB,OAAO,WAExDtC,EAAOuC,WAAW1L,OAAO2L,eAAgB,EACzC,IAAIC,EAAsBzC,EAAO0C,gBAAkB1C,EAAO2C,eAAiB,IAAIjD,EAAoBC,GAMnG,SAAS3T,EAAKqV,EAAWJ,EAAUC,EAASL,EAAUU,EAAY5F,EAAOC,GAIrE,OAHA6G,EAAmBnB,iBAAiBC,EAAYF,EAAWR,EAAUI,EAAUC,UACxElB,EAAe,cACfA,EAAa,KACbA,EAEX,OAXAN,EAAoBK,6BAA6BC,GAEjDA,EAAe,OAAIA,EACnBA,EAAa,KAAIhU,EACjBA,EAAKuM,QAAU,CAAC,YAAa,WAAY,UAAW,WAAY,aAAc,QAAS,kBAOhFyH,EA1BX+B,EAAkBxJ,QAAU,CAAC,qBA4B7B,IAAIqK,EAAiB,SAAUC,GAAe,MAAO,CACjD,oBACA,SAAUC,GACN,IAAIC,EAAUD,EAAK9C,OAAO6C,GAE1B,OADAE,EAAc,KAAI,WAAc,OAAOA,GAChCA,KAKf,SAASC,EAASnH,EAAWxJ,EAAI4Q,GAI7B,GAHA,EAAA5G,SAAA,UAAqBR,EACrB,EAAAQ,SAAA,GAAchK,GAETwM,OAAO1R,UAAUa,eAAeX,KAAKwO,EAAW,YACjD,IACIA,EAAUqH,QAAO,SAAUC,OAE/B,MAAOxS,GACHkL,EAAUuH,WAAa,cAAcrO,KAAKpE,GAASA,EAAMyP,YAKjE6C,EAAUf,cACLlG,MACA/B,KAAI,SAAUW,GAAK,OAAOA,EAAE0E,UAAU+D,eACtCnJ,OAAO,EAAAC,QAAS,IAChBvF,QAAO,SAAUgG,GAAK,MAAkB,aAAXA,EAAEwC,QAC/B/Q,SAAQ,SAAUiX,GAAc,OAAQA,EAAWlG,KAAOvB,EAAU0H,SAASD,EAAWE,UAAW3H,EAAUuH,aAQ/G,SAASK,EAAalC,GACzBA,EAAW1R,QAAO,WACd,EAAA8D,MAAA,wBA9BRqP,EAASzK,QAAU,CAAC,YAAa,KAAM,aA2BvCkL,EAAalL,QAAU,CAAC,cAMxBmJ,EAASrW,SAAS,YAAa0W,GAC/BH,EAAQvW,SAAS,aAAc,CAAC,oBAXL,SAAUqY,GAAY,OAAQA,EAASC,kBAAoB,IAAI,IAAkBD,MAY5G/B,EAAStW,SAAS,cAAeuX,EAAe,eAChDjB,EAAStW,SAAS,qBAAsB,CAAC,oBAAqB,WAAc,OAAO2U,EAAOE,qBAC1FyB,EAAStW,SAAS,oBAAoB,WAAc,OAAO,IAAImQ,KAC/DqG,EAAUxW,SAAS,iBAAkBuX,EAAe,kBACpDf,EAAUxW,SAAS,mBAAoBuX,EAAe,YACtDf,EAAUxW,SAAS,eAAgBuX,EAAe,sBAClDf,EAAUxW,SAAS,SAAU,CAAC,oBAfP,WAAc,OAAO,IAAAe,QAAO4T,EAAOiC,cAAe,CAAEjW,KAAM,WAAc,OAAOgU,EAAOmC,mBAgB7GN,EAAUrW,QAAQ,eAAgB,CAAC,YAAa,SAAUyX,GAAa,OAAOA,EAAUW,QAAQlK,UAChGoI,EAAStW,QAAQ,SAAS,WAAc,OAAOwU,EAAOqC,eACtDP,EAASiB,QAAQ,UAAU,WAAc,OAAO,EAAApP,SAChDmO,EAAS+B,IAAIJ,GACb9B,EAASkC,IAAI,CAAC,qBAAsB,SAAUC,OAC9CjC,EAAUgC,IAAI,CAAC,SAAU,SAAUE,OACnCnC,EAAQiC,IAAI,CAAC,aAAc,SAAUG,OACrCtC,EAASmC,IAAIb,GAEN,IAAIzD,EAAY,SAAU0E,GAO7B,OANaA,EAAIC,YAAYtP,OAAO,EAAAR,UAChB6F,KAAI,SAAU9I,GAC9B,IAAImS,EAAaW,EAAI7K,cAAcjI,GAEnC,MAAO,CAACA,EAAoB,WADX8S,EAAIE,UAAUb,GAAYc,MACJd,EAAWvU,QAAUuU,EAAWrQ,SAE7DiH,OAAO,EAAAmK,WAAY,2JC9GrC,SAASC,EAAeP,GACpB,IAAIQ,EAAW,SAAUxL,EAAOW,EAAQjO,GACpC,OAAOsY,EAAOS,GAAGzL,EAAOW,EAAQjO,IAGpC,OADA8Y,EAASE,WAAY,EACdF,EAaX,SAASG,EAAuBX,GAC5B,IAAIY,EAAiB,SAAU5L,EAAOW,EAAQjO,GAC1C,OAAOsY,EAAOa,SAAS7L,EAAOW,EAAQjO,IAG1C,OADAkZ,EAAeF,WAAY,EACpBE,EAxBXL,EAAe/L,QAAU,CAAC,UAkB1BmM,EAAuBnM,QAAU,CAAC,UAQlC,YAAe,mBAAmB3D,OAAO,UAAW0P,GAAgB1P,OAAO,kBAAmB8P,oKCpB1FG,EAA+B,WAC/B,SAASA,EAAc3C,EAAeC,GAClC7W,KAAK4W,cAAgBA,EACrB5W,KAAK6W,aAAeA,GACpB,IAAArC,uBAAqB,IAAAxQ,KAAIuV,EAAc1X,WAAY7B,MAAM,IAAAgE,KAAIhE,OAgHjE,OArBAuZ,EAAc1X,UAAUiV,UAAY,SAAUtR,EAAMgU,GAChD,OAAOxZ,KAAK4W,cAAcE,UAAUtR,EAAMgU,IAASxZ,MAEvDuZ,EAAc1X,UAAU4L,MAAQ,SAAUjI,EAAMiU,GAQ5C,OAPI,IAAAtG,UAAS3N,GACTiU,EAAajU,EAGbiU,EAAWjU,KAAOA,EAEtBxF,KAAK4W,cAAc8C,SAASD,GACrBzZ,MAOXuZ,EAAc1X,UAAU8X,UAAY,SAAUnZ,GAC1C,OAAOR,KAAK6W,aAAa8C,UAAUnZ,IAEhC+Y,EApHuB,6LCf3B,SAASK,IACZ,IAAIC,EAAkB,KACtB,OAAO,SAAU1R,EAAM2R,GAEnB,OADAD,EAAkBA,GAAmB,EAAA9I,SAAA,cAAuB,oBACrD,CAAC,IAAIgJ,EAAc5R,EAAM2R,EAAMD,KAI9C,IAAIG,EAAY,SAAUxG,EAAMyG,GAAO,OAAOzG,EAAK5E,QAAO,SAAUsL,EAAKrU,GAAO,OAAOqU,IAAO,IAAAtN,WAAUqN,EAAIpU,OAAU,IAY/G,SAASsU,EAAgB1M,GAE5B,IAAKA,EAAM2M,OACP,MAAO,GACX,IAAgKC,EAAW,CAAC,YAAa,WAAY,qBAAsBC,EAA7M,CAAC,mBAAoB,cAAe,WAAY,SAAU,SAAyKlY,OAApJ,CAAC,aAAc,qBAAsB,eAAgB,cAAiHmY,EAAcF,EAASjY,OAAOkY,GAIjS,IAAI,IAAA1N,WAAUa,EAAM+M,QAAUR,EAAUO,EAAa9M,GACjD,MAAM,IAAIgF,MAAM,UAAYhF,EAAMjI,KAAlB,4JAGL+U,EAAYjR,QAAO,SAAUzD,GAAO,OAAO,IAAA+G,WAAUa,EAAM5H,OAAUoN,KAAK,OAEzF,IAAIuH,EAAQ,GAAIC,EAAchN,EAAM+M,OAAS,CAAEE,UAAU,IAAAC,MAAKlN,EAAO8M,IAsBrE,OArBA,IAAAxZ,SAAQ0Z,GAAa,SAAUlP,EAAQ/F,GASnC,GAPAA,EAAOA,GAAQ,YAEX,IAAAsD,UAASyC,KACTA,EAAS,CAAExC,UAAWwC,IAE1BA,GAAS,IAAAzK,QAAO,GAAIyK,GAEhByO,EAAUK,EAAU9O,IAAWyO,EAAUM,EAAa/O,GACtD,MAAM,IAAIkH,MAAM,mBAAqB4H,EAASpH,KAAK,KAAO,UAAYqH,EAAYrH,KAAK,KAAO,mBAAqBzN,EAAO,IAAMiI,EAAMjI,KAAO,KAEjJ+F,EAAO9C,UAAY8C,EAAO9C,WAAa,WACvC8C,EAAOH,MAAQ,MACfG,EAAOxB,SAAW0D,EAClBlC,EAAOqP,MAAQpV,EACf,IAAIqV,EAAa,EAAAC,YAAA,sBAAkCvP,EAAOxB,SAAUwB,EAAOqP,OAC3ErP,EAAOwP,YAAcF,EAAWG,WAChCzP,EAAO0P,qBAAuBJ,EAAWK,oBACzCV,EAAMhV,GAAQ+F,KAEXiP,EAGX,IAAInP,EAAK,EAEL0O,EAA+B,WAC/B,SAASA,EAAc5R,EAAMJ,EAAU7H,GACnC,IAAIiQ,EAAQnQ,KACZA,KAAKmI,KAAOA,EACZnI,KAAK+H,SAAWA,EAChB/H,KAAKE,QAAUA,EACfF,KAAKmb,IAAM9P,IACXrL,KAAKob,QAAS,EACdpb,KAAKgI,YAAc,SAAUvB,EAAQoK,GACjC,OAAOV,EAAMpH,UACPoH,EAAMjQ,QAAQgS,sBAAsBzL,EAAQoK,EAASV,EAAMpH,UAAWoH,EAAMpI,SAASoK,UACrFhC,EAAMc,UAiCpB,OA9BA8I,EAAclY,UAAUwZ,KAAO,WAC3B,IAAIlL,EAAQnQ,KACR+G,EAAK,EAAAgK,SAAA,GACLF,EAAU,IAAI,EAAAzI,eAAepI,KAAKmI,MAClCiG,EAASpO,KAAKmI,KAAKyG,QAAO,SAAUsL,EAAK3L,GAAQ,OAAO,IAAAzN,QAAOoZ,EAAK3L,EAAK+M,eAAiB,IAC1FC,EAAW,CACXtK,SAAUlK,EAAGkJ,KAAKjQ,KAAKE,QAAQ0Q,WAAW5Q,KAAK+H,SAAUqG,EAAQyC,IACjE7P,WAAY+F,EAAGkJ,KAAKjQ,KAAKwb,cAAc3K,KAE3C,OAAO9J,EAAG0U,IAAIF,GAAUxQ,MAAK,SAAU2Q,GAInC,OAHA,EAAArT,MAAA,sBAA4B,SAAU8H,GACtCA,EAAMnP,WAAa0a,EAAQ1a,YAC3B,IAAAF,QAAOqP,EAAOuL,EAAQzK,UACfd,MAQf4J,EAAclY,UAAU2Z,cAAgB,SAAU3K,GAC9C,IAAI9Q,EAAWC,KAAK+H,SAAS4T,mBAC7B,KAAK,IAAAC,cAAa7b,GACd,OAAOC,KAAK+H,SAAS/G,WACzB,IAAI8Q,EAAO,EAAAf,SAAA,mBAA4BhR,GACnCgS,GAAa,IAAAC,SAAQjS,IAAY,IAAAyN,MAAKzN,GAAYA,EAEtD,OADiB,IAAI,EAAAkS,WAAW,GAAIF,EAAYD,GAC9BpB,IAAIG,IAEnBkJ,EA5CuB,wKC9C9B8B,EAAmC,WAEnC,SAASA,EAAiCnH,GACtC1U,KAAK0U,OAASA,EA2KlB,OAzKAmH,EAAkBC,kBAAoB,SAAUpH,EAAQqH,GACpD,OAAO,SAAUC,GAAS,OAAO,EAAAjL,SAAA,iBAA0BgL,EAAS,KAAM,CAAEE,OAAQD,EAAOE,aAAcxH,EAAO4D,QAAQlK,WAG5HyN,EAAkBha,UAAUnB,KAAO,WAC/B,IAAIuW,EAAajX,KAAK0U,OAAOuC,WAI7B,OAHAjX,KAAK0U,OAAOyH,UAAUC,QAAO,GACxBnF,EAAWoF,mBACZpF,EAAWqF,SACRtc,KAAK0U,OAAOyH,WAiCvBN,EAAkBha,UAAU0a,KAAO,SAAUC,GACzC,IAAIrM,EAAQnQ,KACZ,KAAK,IAAAoN,YAAWoP,GACZ,MAAM,IAAI/J,MAAM,6BACpB,IACI8J,EAAO,IAAI,EAAAE,aADH,WAAc,OAAOD,EAAO,EAAAzL,SAAA,UAAoBZ,EAAMuE,OAAO0C,mBACvC,EAAAsF,UAElC,OADA1c,KAAK0U,OAAOuC,WAAW0F,MAAMJ,KAAKA,GAC3Bvc,MA4BX6b,EAAkBha,UAAU+a,UAAY,SAAUL,GAC9C,IAAIpM,EAAQnQ,KACR6c,EAAW7c,KAAK0U,OAAOuC,WAAW0F,MACtC,IAAI,IAAA7T,UAASyT,GACTM,EAASD,UAAUL,OAElB,MAAI,IAAAnP,YAAWmP,GAIhB,MAAM,IAAI9J,MAAM,uCAHhBoK,EAASD,WAAU,WAAc,OAAOL,EAAK,EAAAxL,SAAA,UAAoBZ,EAAMuE,OAAO0C,oBAKlF,OAAOpX,MAwCX6b,EAAkBha,UAAUoO,KAAO,SAAU6M,EAAMf,GAK/C,QAJI,IAAA/J,SAAQ+J,KAAY,IAAA3O,YAAW2O,MAC/BA,EAAUF,EAAkBC,kBAAkB9b,KAAK0U,OAAQqH,IAE/D/b,KAAK0U,OAAOuC,WAAW0F,MAAM1M,KAAK6M,EAAMf,GACjC/b,MAgCX6b,EAAkBha,UAAUkb,eAAiB,SAAU9Q,GACnDjM,KAAK0U,OAAOuC,WAAW8F,eAAe9Q,IAEnC4P,EA9K2B,iJCKtC,UAAe,mBAAmB9b,SAAS,iBApB3C,WACI,IAAIid,GAAkB,EACtBhd,KAAKgd,gBAAkB,WACnBA,GAAkB,GAEtBhd,KAAKU,KAAO,CACR,gBACA,WACA,SAAUuc,EAAezZ,GACrB,OAAIwZ,EACOC,EAEJ,SAAUvV,GACb,OAAOlE,GAAS,WACZkE,EAAS,GAAGwV,mBACb,GAAG,8nBClBlBC,EAAkD,WAClD,IAAK,IAAIC,EAAI,EAAGC,EAAI,EAAGC,EAAKtb,UAAUoN,OAAQiO,EAAIC,EAAID,IAAKD,GAAKpb,UAAUqb,GAAGjO,OACxE,IAAImO,EAAI3b,MAAMwb,GAAII,EAAI,EAA3B,IAA8BH,EAAI,EAAGA,EAAIC,EAAID,IACzC,IAAK,IAAII,EAAIzb,UAAUqb,GAAIK,EAAI,EAAGC,EAAKF,EAAErO,OAAQsO,EAAIC,EAAID,IAAKF,IAC1DD,EAAEC,GAAKC,EAAEC,GACjB,OAAOH,GAaAK,EAAwB,iBAATlQ,MAAqBA,KAAKA,OAASA,MAAQA,MAC9C,iBAAX,EAAAmQ,GAAuB,EAAAA,EAAOC,SAAW,EAAAD,GAAU,EAAAA,QAC3D,EACAhe,EAAU+d,EAAK/d,SAAW,GACnBke,EAAWle,EAAQke,UAAYC,KAAK/W,MAAM3D,KAAK0a,MAC/CC,EAASpe,EAAQoe,QAAUD,KAAKE,UAAU5a,KAAK0a,MAC/Cjd,EAAUlB,EAAQkB,SAqc7B,SAAkBkZ,EAAKnP,EAAIqF,GACvB,IAAI,QAAQ8J,GACR,OAAOA,EAAIlZ,QAAQ+J,EAAIqF,GAC3BoD,OAAOC,KAAKyG,GAAKlZ,SAAQ,SAAU8E,GAAO,OAAOiF,EAAGmP,EAAIpU,GAAMA,OAvcvD/E,EAASyS,OAAO3Q,QAycpB,SAAiBub,GACpB,IAAK,IAAId,EAAI,EAAGA,EAAIrb,UAAUoN,OAAQiO,IAAK,CACvC,IAAIpD,EAAMjY,UAAUqb,GACpB,GAAKpD,EAGL,IADA,IAAIzG,EAAOD,OAAOC,KAAKyG,GACdyD,EAAI,EAAGA,EAAIlK,EAAKpE,OAAQsO,IAC7BS,EAAM3K,EAAKkK,IAAMzD,EAAIzG,EAAKkK,IAGlC,OAAOS,GAldAhP,EAAStP,EAAQsP,QAod5B,SAASiP,EAAQC,EAAIC,GACjB,GAAID,IAAOC,EACP,OAAO,EACX,GAAW,OAAPD,GAAsB,OAAPC,EACf,OAAO,EACX,GAAID,GAAOA,GAAMC,GAAOA,EACpB,OAAO,EACX,IAAIC,SAAYF,EAChB,GAAIE,WAD4BD,GACR,WAAPC,EACb,OAAO,EACX,IAyBeC,EAAIC,EAzBfC,EAAM,CAACL,EAAIC,GACf,IAAI,QAAI,KAAJ,CAAaI,GACb,OAuBeD,EAvBMH,GAuBVE,EAvBMH,GAwBdjP,SAAWqP,EAAGrP,QAEduP,EAAYH,EAAIC,GAAI7P,QAAO,SAAUgQ,EAAGC,GAAK,OAAOD,GAAKR,EAAQS,EAAE,GAAIA,EAAE,OAAQ,GAzBxF,IAAI,QAAI,KAAJ,CAAYH,GACZ,OAAOL,EAAGS,YAAcR,EAAGQ,UAC/B,IAAI,QAAI,KAAJ,CAAcJ,GACd,OAAOL,EAAGvJ,aAAewJ,EAAGxJ,WAChC,IAAI,QAAI,KAAJ,CAAgB4J,GAChB,OAAO,EAEX,GADiB,CAAC,KAAY,KAAS,KAAQ,MAChC/P,IAAI,MAAKC,QAAO,SAAUgQ,EAAGje,GAAM,OAAOie,KAAOje,EAAG+d,MAAS,GACxE,OAAO,EACX,IAAIlL,EAAO,GAEX,IAAK,IAAI3N,KAAOwY,EAAI,CAChB,IAAKD,EAAQC,EAAGxY,GAAMyY,EAAGzY,IACrB,OAAO,EACX2N,EAAK3N,IAAO,EAEhB,IAAK,IAAIA,KAAOyY,EACZ,IAAK9K,EAAK3N,GACN,OAAO,EAEf,OAAO,GApfJ,SAAS6W,EAASpN,GACrB,OAAOA,EAEJ,SAASrH,KAyDT,SAASuM,EAAqBuK,EAAQ1Y,EAAQ/C,EAAM0b,EAASC,QAC/C,IAAbA,IAAuBA,GAAW,GACtC,IAAIC,EAAe,SAAUC,GAAU,OAAOJ,IAASI,GAAQ7b,KAAKA,MAQpE,OADA0b,EAAUA,GAAWzL,OAAOC,KAAKuL,MAClBnQ,QAAO,SAAUsL,EAAK1U,GAPd,IAAU2Z,EAS7B,OADAjF,EAAI1U,GAAQyZ,GARiBE,EAQW3Z,EAPjC,WAEH,OADAa,EAAO8Y,GAAUD,EAAaC,GACvB9Y,EAAO8Y,GAAQhd,MAAM,KAAMH,aAKUkd,EAAa1Z,GACtD0U,IACR7T,GAMA,IAAI+Y,EAAU,SAAUhF,EAAQiF,GAAS,OAAOve,EAAOyS,OAAO/R,OAAO4Y,GAASiF,IAE1EC,GAAU,SACd,SAAkBC,EAAOtF,GAC5B,OAA+B,IAAxBsF,EAAMrR,QAAQ+L,MAMd7E,GAAa,SACjB,SAAqBmK,EAAOtF,GAC/B,IAAIhL,EAAMsQ,EAAMrR,QAAQ+L,GAGxB,OAFIhL,GAAO,GACPsQ,EAAMC,OAAOvQ,EAAK,GACfsQ,KAGAE,GAAS,SACb,SAAiBC,EAAK1b,GACzB,OAAO0b,EAAIjf,KAAKuD,GAAMA,KAGf2b,EAAW,SAAUC,GAC5B,OAAOA,EAAU9d,QAAQf,SAAQ,SAAUJ,GACzB,mBAAPA,GAAqBA,IAC5ByU,EAAWwK,EAAWjf,OAQvB,SAASV,EAASW,GAErB,IADA,IAAIif,EAAe,GACVC,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCD,EAAaC,EAAK,GAAK9d,UAAU8d,GAErC,IAAIC,EAAcjf,EAAOqB,WAAM,EAAQgb,EAAe,CAAC,IAAK0C,EAAaG,YACzE,OAAOlf,EAAOif,EAAapF,EAAK/Z,GAAQ,GAAI2S,OAAOC,KAAKuM,KAGrD,IAAIE,EAAS,SAAUC,EAAMC,GAAQ,OAAOrf,EAAOof,EAAMC,IAQzD,SAASC,EAAUC,EAAOC,GAC7B,IAAInY,EAAO,GAEX,IAAK,IAAIoY,KAAKF,EAAMlY,KAAM,CACtB,GAAIkY,EAAMlY,KAAKoY,KAAOD,EAAOnY,KAAKoY,GAC9B,MACJpY,EAAK1H,KAAK4f,EAAMlY,KAAKoY,IAEzB,OAAOpY,EAaJ,SAASwS,EAAKV,EAAKuG,GACtB,IAAIC,EAAU,GACd,IAAK,IAAIC,KAASzG,GACoB,IAA9BuG,EAAUtS,QAAQwS,KAClBD,EAAQC,GAASzG,EAAIyG,IAG7B,OAAOD,EAcJ,SAASE,EAAK1G,EAAKuG,GACtB,OAAOjN,OAAOC,KAAKyG,GACd3Q,QAAO,QAAIgW,EAAQkB,KACnB5R,QAAO,SAAUsL,EAAKrU,GAAO,OAASqU,EAAIrU,GAAOoU,EAAIpU,GAAOqU,IAAS,IASvE,SAAS5Q,EAAOsX,EAAYpgB,GAC/B,IAAIkf,GAAM,QAAQkB,GAAata,EAASoZ,EAAM,GAAK,GAC/CmB,EAASnB,EAAM,SAAUpQ,GAAK,OAAOhJ,EAAO7F,KAAK6O,IAAQ,SAAUA,EAAGzJ,GAAO,OAAQS,EAAOT,GAAOyJ,GAKvG,OAJAvO,EAAQ6f,GAAY,SAAUT,EAAM9C,GAC5B7c,EAAS2f,EAAM9C,IACfwD,EAAOV,EAAM9C,MAEd/W,EAGJ,SAASwa,EAAKF,EAAYpgB,GAC7B,IAAI8F,EAOJ,OANAvF,EAAQ6f,GAAY,SAAUT,EAAM9C,GAC5B/W,GAEA9F,EAAS2f,EAAM9C,KACf/W,EAAS6Z,MAEV7Z,EAGJ,IAAIya,EAASpS,EAEb,SAASA,EAAIiS,EAAYpgB,EAAU6F,GAGtC,OAFAA,EAASA,KAAW,QAAQua,GAAc,GAAK,IAC/C7f,EAAQ6f,GAAY,SAAUT,EAAM9C,GAAK,OAAQhX,EAAOgX,GAAK7c,EAAS2f,EAAM9C,MACrEhX,EAYJ,IAAI2a,EAAS,SAAU/G,GAAO,OAAO1G,OAAOC,KAAKyG,GAAKtL,KAAI,SAAU9I,GAAO,OAAOoU,EAAIpU,OAclFob,EAAW,SAAUf,EAAMgB,GAAQ,OAAOhB,GAAQgB,GAclDC,EAAW,SAAUjB,EAAMgB,GAAQ,OAAOhB,GAAQgB,GAUlDrS,EAAU,SAAUqR,EAAMgB,GAAQ,OAAOhB,EAAK9d,OAAO8e,IAWrDE,EAAW,SAAUlB,EAAMgB,GAClC,OAAO,QAAQA,GAAQhB,EAAK9d,OAAO8e,EAAKtS,OAAOwS,EAAU,KAAOC,EAAMnB,EAAMgB,IAMzE,SAASG,EAAM3B,EAAKzF,GAEvB,OADAyF,EAAIjf,KAAKwZ,GACFyF,EAGJ,IAAI4B,EAAQ,SAAUpH,EAAKqH,GAAS,OAAQjC,EAAQpF,EAAKqH,GAASrH,EAAMmH,EAAMnH,EAAKqH,IAW/EC,EAAS,SAAU9B,GAAO,OAAOA,EAAI9Q,OAAOC,EAAS,KAyBrD4S,EAkBJ,SAAkBC,EAAgBC,GAErC,YADe,IAAXA,IAAqBA,EAAS,kBAC3B,SAAU1H,GACb,IAAI3T,EAASob,EAAezH,GAC5B,IAAK3T,EACD,MAAM,IAAImM,OAAM,QAAWkP,GAAUA,EAAO1H,GAAO0H,GAEvD,OAAOrb,IA2BR,SAASqY,IAEZ,IADA,IAAIhd,EAAO,GACFme,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCne,EAAKme,GAAM9d,UAAU8d,GAEzB,GAAoB,IAAhBne,EAAKyN,OACL,MAAO,GAwBX,IAvBA,IAAIwS,EAAcjgB,EAAKiN,QAAO,SAAUiT,EAAKnC,GAAO,OAAOoC,KAAKD,IAAInC,EAAItQ,OAAQyS,KAAS,kBACrFvb,EAAS,GACTyb,EAAU,SAAU1E,GAGpB,OAAQ1b,EAAKyN,QACT,KAAK,EACD9I,EAAO7F,KAAK,CAACkB,EAAK,GAAG0b,KACrB,MACJ,KAAK,EACD/W,EAAO7F,KAAK,CAACkB,EAAK,GAAG0b,GAAI1b,EAAK,GAAG0b,KACjC,MACJ,KAAK,EACD/W,EAAO7F,KAAK,CAACkB,EAAK,GAAG0b,GAAI1b,EAAK,GAAG0b,GAAI1b,EAAK,GAAG0b,KAC7C,MACJ,KAAK,EACD/W,EAAO7F,KAAK,CAACkB,EAAK,GAAG0b,GAAI1b,EAAK,GAAG0b,GAAI1b,EAAK,GAAG0b,GAAI1b,EAAK,GAAG0b,KACzD,MACJ,QACI/W,EAAO7F,KAAKkB,EAAKgN,KAAI,SAAU4Q,GAAS,OAAOA,EAAMlC,SAIxDA,EAAI,EAAGA,EAAIuE,EAAavE,IAC7B0E,EAAQ1E,GAEZ,OAAO/W,EAsBJ,SAASyS,EAAWmH,EAAM8B,GAC7B,IAAInc,EAAKrB,EAGT,IAFI,QAAQwd,KACRnc,EAAMmc,EAAY,GAAIxd,EAAQwd,EAAY,MACzC,QAASnc,GACV,MAAM,IAAI4M,MAAM,oCAEpB,OADAyN,EAAKra,GAAOrB,EACL0b,EAGJ,SAAS1S,EAAKkS,GACjB,OAAQA,EAAItQ,QAAUsQ,EAAIA,EAAItQ,OAAS,SAAO+E,EAK3C,SAAS8N,EAAKC,EAAKC,GAKtB,OAJIA,GACA5O,OAAOC,KAAK2O,GAAMphB,SAAQ,SAAU8E,GAAO,cAAcsc,EAAKtc,MAC7Dsc,IACDA,EAAO,IACJrhB,EAAOqhB,EAAMD,GA6DjB,IAAIE,EAA2B,SAAU3e,GAAW,OAAOA,EAAQ4e,OAAM,SAAUC,GAAK,OAAO,MAAS7e,GACpG8e,EAAkB,SAAUld,GAAS,OAAO+c,EAAyB,cAAmB/c,qHCxhBnG,IAGWmd,EAAW,SAAU/K,EAASgL,GACrC,OAAOA,EAAQ7T,QAAO,SAAUsL,EAAKrU,GAAO,OAASqU,EAAIrU,IAJtC6c,EAIoDjL,EAAU,IAAM5R,EAAM,KAJzD,WACpC,MAAM,IAAI4M,MAAM,yBAA2BiQ,EAAS,kEAGiDxI,EAJ5F,IAAUwI,IAI2F,KAE9G3R,EAAW,CACXhK,QAAIoN,EACJ5D,eAAW4D,mGCyCf,IAAIwO,EAAsB,WACtB,SAASA,EAAKC,GACV5iB,KAAK4iB,KAAOA,EACZ5iB,KAAK6iB,KAAOD,EAAKE,MAAM,KACvB,IAAIC,EAAe/iB,KAAK4iB,KACnBE,MAAM,KACNnU,KAAI,SAAUqU,GACf,MAAY,OAARA,EACO,qBACC,MAARA,EACO,WACJ,MAAQA,KAEd/P,KAAK,IACVjT,KAAKijB,OAAS,IAAI9Z,OAAO,IAAM4Z,EAAe,KAalD,OAVAJ,EAAKzJ,GAAK,SAAU0J,GAChB,QAAS,SAASnZ,KAAKmZ,IAG3BD,EAAKxR,WAAa,SAAUyR,GACxB,OAAOD,EAAKzJ,GAAG0J,GAAQ,IAAID,EAAKC,GAAQ,MAE5CD,EAAK9gB,UAAUqhB,QAAU,SAAU1d,GAC/B,OAAOxF,KAAKijB,OAAOE,KAAK,IAAM3d,IAE3Bmd,EA3Bc,+MC1CzB,IAAIxF,EAAkD,WAClD,IAAK,IAAIC,EAAI,EAAGC,EAAI,EAAGC,EAAKtb,UAAUoN,OAAQiO,EAAIC,EAAID,IAAKD,GAAKpb,UAAUqb,GAAGjO,OACxE,IAAImO,EAAI3b,MAAMwb,GAAII,EAAI,EAA3B,IAA8BH,EAAI,EAAGA,EAAIC,EAAID,IACzC,IAAK,IAAII,EAAIzb,UAAUqb,GAAIK,EAAI,EAAGC,EAAKF,EAAErO,OAAQsO,EAAIC,EAAID,IAAKF,IAC1DD,EAAEC,GAAKC,EAAEC,GACjB,OAAOH,GA2CJ,SAAS6F,EAAMziB,GAClB,OAAO,SAAS0iB,IACZ,GAAIrhB,UAAUoN,QAAUzO,EAAGyO,OACvB,OAAOzO,EAAGwB,MAAMnC,KAAMgC,WAE1B,IAAIL,EAAOC,MAAMC,UAAUC,MAAMC,KAAKC,WACtC,OAAOqhB,EAAQ/f,KAAKnB,MAAMkhB,EAASlG,EAAe,CAACnd,MAAO2B,KAS3D,SAAS2hB,IACZ,IAAI3hB,EAAOK,UACPuhB,EAAQ5hB,EAAKyN,OAAS,EAC1B,OAAO,WAEH,IADA,IAAIiO,EAAIkG,EAAOjd,EAAS3E,EAAK4hB,GAAOphB,MAAMnC,KAAMgC,WACzCqb,KACH/W,EAAS3E,EAAK0b,GAAGtb,KAAK/B,KAAMsG,GAChC,OAAOA,GASR,SAASkd,IAEZ,IADA,IAAIC,EAAQ,GACH3D,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpC2D,EAAM3D,GAAM9d,UAAU8d,GAE1B,OAAOwD,EAAQnhB,MAAM,KAAM,GAAGL,MAAMC,KAAKC,WAAWge,WAQjD,IAAI0D,EAAO,SAAUle,GAAQ,OAAO,SAAUyU,GAAO,OAAOA,GAAOA,EAAIzU,KAQnEme,EAASP,GAAM,SAAU5d,EAAMoe,EAAM3J,GAAO,OAAOA,GAAOA,EAAIzU,KAAUoe,KASxE3c,EAAQ,SAAUzB,GAAQ,OAAOge,EAAKrhB,MAAM,KAAMqD,EAAKsd,MAAM,KAAKnU,IAAI+U,KAKtEG,EAAM,SAAUljB,GAAM,OAAO,WAEpC,IADA,IAAIgB,EAAO,GACFme,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCne,EAAKme,GAAM9d,UAAU8d,GAEzB,OAAQnf,EAAGwB,MAAM,KAAMR,KAMpB,SAASmiB,EAAIC,EAAKC,GACrB,OAAO,WAEH,IADA,IAAIriB,EAAO,GACFme,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCne,EAAKme,GAAM9d,UAAU8d,GAEzB,OAAOiE,EAAI5hB,MAAM,KAAMR,IAASqiB,EAAI7hB,MAAM,KAAMR,IAOjD,SAASsiB,EAAGF,EAAKC,GACpB,OAAO,WAEH,IADA,IAAIriB,EAAO,GACFme,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCne,EAAKme,GAAM9d,UAAU8d,GAEzB,OAAOiE,EAAI5hB,MAAM,KAAMR,IAASqiB,EAAI7hB,MAAM,KAAMR,IASjD,IAAI8Z,EAAM,SAAUsI,GAAO,OAAO,SAAUrE,GAAO,OAAOA,EAAI9Q,QAAO,SAAUgQ,EAAGtP,GAAK,OAAOsP,KAAOmF,EAAIzU,MAAO,KAE5G4U,EAAM,SAAUH,GAAO,OAAO,SAAUrE,GAAO,OAAOA,EAAI9Q,QAAO,SAAUgQ,EAAGtP,GAAK,OAAOsP,KAAOmF,EAAIzU,MAAO,KAE5G4J,EAAK,SAAUiL,GAAQ,OAAO,SAAUlK,GAC/C,OAAe,MAAPA,GAAeA,EAAImK,cAAgBD,GAASlK,aAAekK,IAK5DngB,EAAM,SAAUqgB,GAAK,OAAO,WAAc,OAAOA,IA4CrD,SAASC,EAAQC,GACpB,OAAO,SAAUjV,GACb,IAAK,IAAI+N,EAAI,EAAGA,EAAIkH,EAAOnV,OAAQiO,IAC/B,GAAIkH,EAAOlH,GAAG,GAAG/N,GACb,OAAOiV,EAAOlH,GAAG,GAAG/N,uRCjNhCkV,EAAQjR,OAAO1R,UAAUiT,SACzB2P,EAAM,SAAU5F,GAAK,OAAO,SAAUvP,GAAK,cAAcA,IAAMuP,IACxD6F,EAAcD,EAAI,aAClB7X,GAAY,QAAI8X,GAChBC,EAAS,SAAUC,GAAK,OAAa,OAANA,GAC/BC,GAAoB,IAAAZ,IAAGU,EAAQD,GAC/BtX,EAAaqX,EAAI,YACjBK,EAAWL,EAAI,UACf3b,EAAW2b,EAAI,UACftR,EAAW,SAAU7D,GAAK,OAAa,OAANA,GAA2B,iBAANA,GACtD0C,EAAUpQ,MAAMoQ,QAChB+S,EAAS,SAAWzV,GAAK,MAAyB,kBAAlBkV,EAAMziB,KAAKuN,IAC3C0V,EAAW,SAAW1V,GAAK,MAAyB,oBAAlBkV,EAAMziB,KAAKuN,IAOjD,SAASsM,EAAa5X,GACzB,GAAIgO,EAAQhO,IAAQA,EAAIoL,OAAQ,CAC5B,IAAI6V,EAAOjhB,EAAIlC,MAAM,GAAI,GAAI0L,EAAOxJ,EAAIlC,OAAO,GAC/C,QAASmjB,EAAK3b,QAAO,QAAIR,IAAWsG,QAAU5B,EAAKlE,QAAO,QAAI8D,IAAagC,QAE/E,OAAOhC,EAAWpJ,GAOf,IAAIkhB,GAAY,QAAI/R,GAAU,SAAK,QAAK,QAAS/F,uKCvCpD+X,EAAuB,WACvB,SAASA,EAAMC,EAAQC,QACJ,IAAXD,IAAqBA,EAAS,SACnB,IAAXC,IAAqBA,EAAS,MAClCrlB,KAAKolB,OAASA,EACdplB,KAAKqlB,OAASA,EACdrlB,KAAKslB,gBAAkB,GACvBtlB,KAAKulB,SAAU,QAAOvlB,KAAKslB,iBAqC/B,OAnCAH,EAAMtjB,UAAU2jB,QAAU,SAAUrF,GAChC,IAAIsF,EAAQzlB,KAAKolB,OAIjB,OAHAK,EAAMhlB,KAAK0f,GACPngB,KAAKqlB,QAAUI,EAAMrW,OAASpP,KAAKqlB,QACnCrlB,KAAK0lB,QACFvF,GAEXgF,EAAMtjB,UAAU6jB,MAAQ,WACpB,IAAIvF,EAAOngB,KAAKolB,OAAOnjB,QAEvB,OADAjC,KAAKslB,gBAAgBvkB,SAAQ,SAAUJ,GAAM,OAAOA,EAAGwf,MAChDA,GAEXgF,EAAMtjB,UAAU8jB,QAAU,WACtB,GAAI3lB,KAAK4lB,OACL,OAAO5lB,KAAKolB,OAAO5F,OAAO,EAAG,GAAG,IAExC2F,EAAMtjB,UAAUgkB,MAAQ,WACpB,IAAIC,EAAU9lB,KAAKolB,OAEnB,OADAplB,KAAKolB,OAAS,GACPU,GAEXX,EAAMtjB,UAAU+jB,KAAO,WACnB,OAAO5lB,KAAKolB,OAAOhW,QAEvB+V,EAAMtjB,UAAUgL,OAAS,SAAUsT,GAC/B,IAAIlR,EAAMjP,KAAKolB,OAAOlX,QAAQiS,GAC9B,OAAOlR,GAAO,GAAKjP,KAAKolB,OAAO5F,OAAOvQ,EAAK,GAAG,IAElDkW,EAAMtjB,UAAUkkB,SAAW,WACvB,OAAO/lB,KAAKolB,OAAOplB,KAAKolB,OAAOhW,OAAS,IAE5C+V,EAAMtjB,UAAUmkB,SAAW,WACvB,GAAIhmB,KAAK4lB,OACL,OAAO5lB,KAAKolB,OAAO,IAEpBD,EA5Ce,4KCKtBc,EAAkB,CAAEC,IAAK,KAAM7gB,MAAO,KAAM8gB,MAAO,MA4B5CC,EAXyB,oBAAbC,UAA4BA,SAASC,cAA0C,IAA1BD,SAASC,aAEtEC,QAAUA,OAAOC,QAlBhC,SAAoBA,GAChB,IAAIC,EAAQ,SAAU9lB,GAAM,OAAO+lB,SAAS7kB,UAAUyB,KAAKvB,KAAKpB,EAAI6lB,IACpE,MAAO,CACHN,IAAKO,EAAMD,EAAQN,KACnB7gB,MAAOohB,EAAMD,EAAQN,KACrBC,MAAOM,EAAMD,EAAQN,MAaaS,CAAWJ,OAAOC,SAAWP,EAEzDO,QAAQL,OAAUK,QAAQnhB,MAIzBmhB,QAhBf,SAAyBA,GACrB,IAAIN,EAAMM,EAAQN,IAAI5iB,KAAKkjB,GAG3B,MAAO,CAAEN,IAAKA,EAAK7gB,MAFPmhB,EAAQnhB,MAAQmhB,EAAQnhB,MAAM/B,KAAKkjB,GAAWN,EAEzBC,MADrBK,EAAQL,MAAQK,EAAQL,MAAM7iB,KAAKkjB,GAAWN,GAU/CU,CAAgBJ,ieCRxB,SAASK,EAAUC,EAAK9V,GAC3B,OAAIA,EAAI5B,QAAU0X,EACP9V,EACJA,EAAI+V,OAAO,EAAGD,EAAM,GAAK,MAW7B,SAASE,EAAU5X,EAAQ4B,GAC9B,KAAOA,EAAI5B,OAASA,GAChB4B,GAAO,IACX,OAAOA,EAEJ,SAAS/H,EAAYqJ,GACxB,OAAOA,EACFyC,QAAQ,YAAY,SAAUkS,GAAM,OAAOA,EAAGC,iBAC9CnS,QAAQ,YAAY,SAAUkS,GAAM,MAAO,IAAMA,EAAGC,iBAEtD,SAASC,EAAiBxmB,GAC7B,IAAIymB,EAAQC,EAAW1mB,GACnB2mB,EAAqBF,EAAMpL,MAAM,8BACjCwI,EAAQ8C,EAAqBA,EAAmB,GAAKF,EACrDjI,EAASxe,EAAS,MAAK,GAC3B,OAAIwe,GAAUqF,EAAMxI,MAAM,eACf,YAAcmD,EAASqF,EAAMuC,OAAO,GAExCvC,EAEJ,SAAS6C,EAAW1mB,GACvB,IAAI4mB,GAAM,QAAQ5mB,GAAMA,EAAGmB,OAAO,GAAG,GAAKnB,EAC1C,OAAQ4mB,GAAOA,EAAIzS,YAAe,YAEtC,IAAI0S,EAAc,uBAIdC,GAAmB,QAAQ,CAC3B,CAAC,MAAa,QAAI,cAClB,CAAC,MAAQ,QAAI,SACb,CAAC,MAAW,QAAI,cAChB,CAACD,EAAa,SAAUlY,GAAK,OAAOA,EAAEoY,qBAAqB5S,aAC3D,CARc,SAAUmF,GACxB,OAAO,QAASA,MAAS,QAAQA,IAAQA,EAAImK,cAAgB7Q,SAAU,QAAW0G,EAAInF,WAOxE,SAAUxF,GAAK,OAAOA,EAAEwF,aACtC,CAAC,KAAcqS,GACf,EAAC,SAAI,GAAO,QAET,SAASjJ,EAAU0G,GACtB,IAAI+C,EAAO,GACX,SAASC,EAAOpjB,GACZ,IAAI,QAASA,GAAQ,CACjB,IAA6B,IAAzBmjB,EAAKzZ,QAAQ1J,GACb,MAAO,iBACXmjB,EAAKlnB,KAAK+D,GAEd,OAAOijB,EAAiBjjB,GAE5B,OAAI,QAAYogB,GAILgD,EAAOhD,GAEX5G,KAAKE,UAAU0G,GAAG,SAAU/e,EAAKrB,GAAS,OAAOojB,EAAOpjB,MAAWuQ,QAAQ,OAAQ,KAGvF,IAAI8S,EAAoB,SAAUC,GAAQ,OAAO,SAAU9W,GAC9D,IAAKA,EACD,MAAO,CAAC,GAAI,IAChB,IAAI/B,EAAM+B,EAAI9C,QAAQ4Z,GACtB,OAAa,IAAT7Y,EACO,CAAC+B,EAAK,IACV,CAACA,EAAI+V,OAAO,EAAG9X,GAAM+B,EAAI+V,OAAO9X,EAAM,MAGtC8Y,EAAuB,SAAU/W,GAAO,OAAOA,EAAI+D,QAAQ,WAAY,KACvEiT,EAAYH,EAAkB,KAC9BI,EAAaJ,EAAkB,KAC/BK,EAAaL,EAAkB,KAC/BM,EAAc,SAAUnX,GAAO,OAAQA,EAAMA,EAAI+D,QAAQ,KAAM,IAAM,IAWzE,SAASqT,EAAaC,GACzB,IAAIC,EAAK,IAAInf,OAAO,IAAMkf,EAAQ,IAAK,KACvC,OAAO,SAAUrX,GAAO,OAAOA,EAAI8R,MAAMwF,GAAIhf,OAAO,OAcjD,SAASif,EAAerO,EAAK5K,GAChC,OAAI,SAAS,QAAK4K,MAAS,QAAS5K,GACzB4K,EAAIpY,MAAM,GAAI,GAAGM,QAAO,QAAK8X,GAAO5K,IACxC,QAAM4K,EAAK5K,0GCpElBkZ,iQA3BJ,SAASC,EAAaC,GAClB,IAAKA,EACD,MAAO,oBACX,IAAIjb,EAAQib,EAAOC,gBAAkBD,EAAOC,gBAAgBnjB,MAAQ,SAAW,SAC/E,MAAO,YAAckjB,EAAOrd,GAAK,IAAMqd,EAAOtd,MAAQ,IAAMsd,EAAOpd,IAAM,KAAOod,EAAOljB,KAAO,IAAMiI,EAAQ,KAOhH,SAASmb,EAAchW,GACnB,OAAO,QAASA,GAAS4V,EAAS5V,GAAS4V,EAASA,EAAS5V,KAgBjE,SAAW4V,GACPA,EAASA,EAAkB,QAAI,GAAK,UACpCA,EAASA,EAAqB,WAAI,GAAK,aACvCA,EAASA,EAAe,KAAI,GAAK,OACjCA,EAASA,EAAiB,OAAI,GAAK,SACnCA,EAASA,EAAqB,WAAI,GAAK,aAL3C,CAMGA,IAAaA,EAAW,KAE3B,IAAIK,GAAO,QAAM,OACbC,GAAO,QAAM,cACbC,EAAW,SAAUnZ,GAAS,MAAO,eAAiBiZ,EAAKjZ,GAAS,IAAMkZ,EAAKlZ,IA6J/EvH,EAAQ,IAzJe,WAEvB,SAAS2gB,IAELhpB,KAAKipB,SAAW,GAChBjpB,KAAKkpB,mBAAqB,EAwI9B,OArIAF,EAAMnnB,UAAUsnB,KAAO,SAAU7T,EAAS8T,GACtC,IAAIjZ,EAAQnQ,KACPopB,EAAWha,SACZga,EAAa7V,OAAOC,KAAKgV,GACpB7Z,KAAI,SAAU6O,GAAK,OAAO6L,SAAS7L,EAAG,OACtClU,QAAO,SAAUkU,GAAK,OAAQ8L,MAAM9L,MACpC7O,KAAI,SAAU9I,GAAO,OAAO2iB,EAAS3iB,OAE9CujB,EAAWza,IAAIia,GAAe7nB,SAAQ,SAAUwoB,GAAY,OAAQpZ,EAAM8Y,SAASM,GAAYjU,MAEnG0T,EAAMnnB,UAAU2nB,OAAS,WAErB,IADA,IAAIJ,EAAa,GACRtJ,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCsJ,EAAWtJ,GAAM9d,UAAU8d,GAE/B9f,KAAKmpB,MAAK,EAAMC,IAEpBJ,EAAMnnB,UAAU4nB,QAAU,WAEtB,IADA,IAAIL,EAAa,GACRtJ,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCsJ,EAAWtJ,GAAM9d,UAAU8d,GAE/B9f,KAAKmpB,MAAK,EAAOC,IAWrBJ,EAAMnnB,UAAUyT,QAAU,SAAUiU,GAChC,QAASvpB,KAAKipB,SAASL,EAAcW,KAGzCP,EAAMnnB,UAAU6nB,qBAAuB,SAAU9Z,GACxC5P,KAAKsV,QAAQkT,EAASmB,aAE3B,QAAgBZ,EAASnZ,GAAS,kBAAmB,QAAUA,KAGnEoZ,EAAMnnB,UAAU+nB,uBAAyB,SAAUha,GAC1C5P,KAAKsV,QAAQkT,EAASmB,aAE3B,QAAgBZ,EAASnZ,GAAS,kBAAmB,QAAUA,KAGnEoZ,EAAMnnB,UAAUgoB,oBAAsB,SAAUC,EAAMla,EAAOzP,GACzD,GAAKH,KAAKsV,QAAQkT,EAASuB,MAA3B,CAEA,IAAIxpB,GAAQ,QAAM,qBAAN,CAA4BJ,IAAY,WAAY0Q,GAAU,QAAM,+BAAN,CAAsC1Q,KAAY,QAAM,oBAAN,CAA2BA,IAAY,UAAWqF,GAAO,QAAiBskB,EAAKE,eAAexpB,UAC1N,QAAgBuoB,EAASnZ,GAAS,eAAiBrP,EAAQ,aAAesQ,EAAU,MAAO,QAAU,IAAKrL,MAG9GwjB,EAAMnnB,UAAUooB,gBAAkB,SAAUC,EAAYta,EAAOua,GACtDnqB,KAAKsV,QAAQkT,EAASuB,OAE3B,QAAgBhB,EAASnZ,GAAS,0BAA2B,QAAU,KAAK,QAAUsa,MAG1FlB,EAAMnnB,UAAUuoB,iBAAmB,SAAUjiB,EAAM8H,EAAML,GAChD5P,KAAKsV,QAAQkT,EAAS6B,UAE3B,QAAgBtB,EAASnZ,GAAS,uBAAyBzH,EAAO,KAAO8H,EAAO,MAGpF+Y,EAAMnnB,UAAUyoB,wBAA0B,SAAUtS,EAAYpI,GACvD5P,KAAKsV,QAAQkT,EAAS6B,UAE3B,QAAgBtB,EAASnZ,GAAS,gCAAkCoI,EAAa,SAAU,QAAU,KAAK,QAAUA,EAAWrQ,SAGnIqhB,EAAMnnB,UAAU0oB,WAAa,SAAUC,EAAQ5a,GACtC5P,KAAKsV,QAAQkT,EAASmB,aAE3B,QAAgBZ,EAASnZ,GAAS,kBAAmB,QAAUA,GAAS,aAAe4a,IAG3FxB,EAAMnnB,UAAU4oB,aAAe,SAAUC,EAAY9a,GAC5C5P,KAAKsV,QAAQkT,EAASmB,aAE3B,QAAgBZ,EAASnZ,GAAS,kBAAmB,QAAUA,GAAS,kBAAoB8a,EAAWllB,OAG3GwjB,EAAMnnB,UAAU8oB,iBAAmB,SAAUpqB,EAAOqqB,EAAUvL,QAC5C,IAAVA,IAAoBA,EAAQ,IAC3Brf,KAAKsV,QAAQkT,EAASqC,SAE3B,QAAgB,aAAc,QAAU,GAAItqB,GAAS,IAAMkoB,EAAamC,GAAYvL,IAGxF2J,EAAMnnB,UAAUipB,yBAA2B,SAAUF,EAAU/Z,GACtD7Q,KAAKsV,QAAQkT,EAASqC,SAE3B7qB,KAAK2qB,iBAAiB,WAAYC,EAAU,kCAAoC/Z,EAAU,MAG9FmY,EAAMnnB,UAAUkpB,gBAAkB,SAAUH,EAAUpjB,GAC7CxH,KAAKsV,QAAQkT,EAASqC,SAE3B7qB,KAAK2qB,iBAAiB,OAAQC,EAAU,WAAY,QAAU,IAAKpjB,KAGvEwhB,EAAMnnB,UAAUmpB,cAAgB,SAAUC,GACtC,GAAKjrB,KAAKsV,QAAQkT,EAAS0C,YAA3B,CAEA,IAAIC,EAAY,uBAEZC,EAAUH,EACTtc,KAAI,SAAU0c,GACf,IAAIC,EACA7kB,EAAS4kB,EAAG5kB,OAAQiE,EAAa2gB,EAAG3gB,WACpC6gB,EAAM9kB,GAAUA,EAAO6E,IACvBzD,EAAM6C,GAAcA,EAAW3C,SAASgC,SAASvE,KAAO,MAAQkF,EAAW3C,SAAS6S,MAAQ,IAChG,OAAO0Q,EAAK,IAAOH,GAAaI,EAAKD,EAPzB,iCAOyCzjB,EAAKyjB,KAEzDE,MAAK,SAAU/N,EAAGmB,GAAK,OAAQnB,EAAE0N,IAAc,IAAIM,cAAc7M,EAAEuM,IAAc,OACtF,UAAkBC,KAGtBpC,EAAMnnB,UAAU6pB,sBAAwB,SAAUnrB,EAAOmK,GAChD1K,KAAKsV,QAAQkT,EAAS0C,aAE3B,QAAgB,eAAiB3qB,EAAQ,IAzK1B,SAAUmK,GAC7B,IAAIoP,EAAOpP,EAAW3C,SAClB0F,EAAQqM,EAAK/P,SAASvE,MAAQ,SAClC,MAAO,SAAWkF,EAAWyQ,IAAM,UAAY1N,EAAQ,8BAAgCqM,EAAKiB,YAAc,IAAMjB,EAAKmB,qBAAuB,IAsKzF0Q,CAAiBjhB,KAGpEse,EAAMnnB,UAAU+pB,4BAA8B,SAAUrrB,EAAOqqB,GACtD5qB,KAAKsV,QAAQkT,EAAS0C,aAE3B,QAAgB,eAAiB3qB,EAAQ,IAAMkoB,EAAamC,KAEzD5B,EA7Ie,oOCxEtB6C,EAAiC,WACjC,SAASA,IAML7rB,KAAKoO,OAAS,IAAI,IAElBpO,KAAK8rB,yBAA2B,EAEhC9rB,KAAK+rB,kBAAoB,IAAI,IAAM,GAAI,GAEvC/rB,KAAKgsB,sBAAwB,IAAI,IAAM,GAAI,GAO/C,OALAH,EAAgBhqB,UAAUqT,QAAU,WAChClV,KAAK+rB,kBAAkBlG,QACvB7lB,KAAKgsB,sBAAsBnG,QAC3B7lB,KAAKisB,WAAa,MAEfJ,EApByB,sLCiBhCK,EAAe,SAAUD,GACzB,IAAIvX,EAASuX,EAAWvX,OAuBpB6G,EAAW0Q,EACVE,WACA7iB,QAAO,SAAUmE,GAAS,QAASA,EAAMuG,UAAUoY,YACnDzd,KAAI,SAAUlB,GAAS,OAAO4e,EAAcJ,EAAYxe,MAC7D,OAAO,WAAgB8N,GAAUxQ,MA1BjC,WACI,GAAyD,QAArDkhB,EAAWK,qBAAqBnsB,UAAU4e,OAAkB,CAG5D,IAAIwN,EAAON,EAAWO,cACtB,OAAO9X,EAAOmC,aAAaxQ,OAAOkmB,EAAKE,aAAcF,EAAKne,SAAUme,EAAKpsB,WAI7E,IAAIusB,EAAOhY,EAAOuC,WACd3Q,EAASomB,EAAK1Q,MAAM0Q,EAAKC,SACzBpQ,EAAOjW,GAAUA,EAAOiW,KAG5B,GAAIA,GAAsB,UAAdA,EAAKrN,KAAkB,CAC/B,IAAIzB,EAAQ8O,EAAK9O,MACbW,EAAS9H,EAAO0V,MACpB,OAAOtH,EAAOmC,aAAaxQ,OAAOoH,EAAOW,EAAQ6d,EAAW9rB,WAGhEuU,EAAOuC,WAAW2V,WAQfC,EAAuB,SAAUC,GACxC,OAAOA,EAAkB/c,SAAS,CAAEoc,SAAU,SAAU1e,GAAS,QAASA,EAAM2e,WAAeF,IAS5F,SAASG,EAAcJ,EAAYxe,GACtC,IAAIsf,EAAatf,EAAMuG,UAAUoY,SAE7B3oB,EAAUspB,EAAqB,SAwBnC,OAvBKtpB,IAWDA,EAAUspB,EAAqB,SAAI,YACzBA,EAAWd,EAAYxe,IAC5B1C,MAIT,SAA6BzE,GAIzB,OAHIA,GAAU1E,MAAMoQ,QAAQ1L,EAAO0mB,SAC/B1mB,EAAO0mB,OAAOjsB,SAAQ,SAAUksB,GAAU,OAAOhB,EAAWvX,OAAOkC,cAAc8C,SAASuT,MAEvF3mB,KAPFyE,MAbS,SAAUzE,GAIpB,cAHOmH,EAAM2e,gBACN3e,EAAMuG,UAAUoY,gBAChBW,EAAqB,SACrBzmB,KAEC,SAAU4mB,GAElB,cADOH,EAAqB,SACrB,cAAmBG,OAc3BzpB,oPCnFP0pB,kUAJAC,EAAS7Z,OAAO1R,UAAUa,gBAK9B,SAAWyqB,GACPA,EAAQA,EAAc,KAAI,GAAK,OAC/BA,EAAQA,EAAgB,OAAI,GAAK,SACjCA,EAAQA,EAAgB,OAAI,GAAK,SAHrC,CAIGA,IAAYA,EAAU,KA2DzB,IAAIE,EAAuB,WACvB,SAASA,EAAMhiB,EAAI6D,EAAM2G,EAAUyX,EAAW7f,GAC1C,IAAIlC,EA3DZ,SAA6BgiB,EAAW1X,EAAUpI,GAC9C,IAAI+f,GAA6C,IAAzB/f,EAAMggB,gBAA4B5X,IAAasX,EAAQO,aAAWvZ,EACtFwZ,GAAU,QAAK,CAAClgB,EAAMkgB,QAASH,GAAmB,MAClDI,GAAgB,QAAUD,GAAW,CAAEA,QAASA,GAAY,GAC5DE,EAGR,SAAyBhmB,GAGrB,SAASimB,IACL,OAAOjmB,EAAIrD,MAHfqD,EAlBc,SAAUA,GACxB,OAAiG,IAA1F,CAAC,QAAS,OAAQ,SAAU,QAAS,WAAWyB,OAAO8jB,EAAO9pB,KAAKuE,GAAO,KAAKuH,OAiBhF2e,CAAYlmB,GAAO,CAAErD,MAAOqD,GAAQA,EAC1CimB,EAAmC,aAAI,EAIvC,IAAIE,GAAO,QAAanmB,EAAIrD,OAASqD,EAAIrD,MAAQspB,EACjD,OAAO,QAAOjmB,EAAK,CAAEmmB,KAAMA,IAVTC,CAAgBxgB,GAASA,EAAMW,QAAUX,EAAMW,OAAOmf,IACxE,OAAO,QAAOK,EAAeC,GAsDZK,CAAoB7iB,EAAIwK,EAAUpI,GAC/CyB,EA5CR,SAAiBrH,EAAKsmB,EAAStY,EAAUxK,EAAI+iB,GACzC,GAAIvmB,EAAIqH,MAAQif,GAA4B,WAAjBA,EAAQ3oB,KAC/B,MAAM,IAAIiN,MAAM,UAAYpH,EAAK,kCACrC,GAAIxD,EAAIqH,MAAQif,GAA4B,WAAjBA,EAAQ3oB,MAAqB4oB,EAAWlf,KAAKrH,EAAIqH,MACxE,OAAOkf,EAAWlf,KAAKrH,EAAIqH,MAC/B,GAAIif,EACA,OAAOA,EACX,IAAKtmB,EAAIqH,KAAM,CACX,IAAIA,EAAO2G,IAAasX,EAAQkB,OAC1B,MACAxY,IAAasX,EAAQmB,KACjB,OACAzY,IAAasX,EAAQO,OACjB,QACA,SACd,OAAOU,EAAWlf,KAAKA,GAE3B,OAAOrH,EAAIqH,gBAAgB,IAAYrH,EAAIqH,KAAOkf,EAAWlf,KAAKrH,EAAIqH,MA2B3Dqf,CAAQhjB,EAAQ2D,EAAM2G,EAAUxK,EAAIiiB,EAAUc,YACrD,IAUQI,EACAC,EAXJC,GAUIF,EAAgB,CAAEjP,MAAO1J,IAAasX,EAAQO,QAAS,QACvDe,EAAyBpjB,EAAG2Q,MAAM,SAAW,CAAEuD,OAAO,GAAS,IAC5D,QAAOiP,EAAeC,EAAwBljB,GAAQgU,OAXjErQ,EAAOwf,EAAYxf,EAAKyf,SAASD,EAAW7Y,IAAasX,EAAQO,QAAUxe,EAC3E,IAAI0f,OAA8Bza,IAAjB5I,EAAO/G,OAAuBqR,IAAasX,EAAQO,OAChEC,GAAU,QAAUpiB,EAAOoiB,WAAapiB,EAAOoiB,UAAYze,EAAKye,QAChEkB,GAAM,QAAUtjB,EAAOsjB,OAAStjB,EAAOsjB,MAAQ3f,EAAK2f,IACpDC,EA9BZ,SAAyBvjB,EAAQqjB,EAAYG,GACzC,IAAID,EAASvjB,EAAOujB,OACpB,IAAKF,IAAyB,IAAXE,EACf,OAAO,EACX,KAAK,QAAUA,IAAqB,MAAVA,EACtB,OAAOC,EACX,IAAe,IAAXD,IAAmB,QAASA,GAC5B,OAAOA,EACX,MAAM,IAAIrc,MAAM,2BAA6Bqc,EAAS,uDAsBrCE,CAAgBzjB,EAAQqjB,EAAYtB,EAAU2B,uBACvDla,EArBZ,SAAoBxJ,EAAQmjB,EAAWE,EAAYE,GAC/C,IAAIC,EAAgB,CAChB,CAAEG,KAAM,GAAIC,GAAIP,GAAcF,OAAYva,EAAY,IACtD,CAAE+a,KAAM,KAAMC,GAAIP,GAAcF,OAAYva,EAAY,KAExDY,GAAU,QAAQxJ,EAAOwJ,SAAWxJ,EAAOwJ,QAAU,IACrD,QAAS+Z,IACT/Z,EAAQtU,KAAK,CAAEyuB,KAAMJ,EAAQK,QAAIhb,IACrC,IAAIib,GAAiB,QAAIra,GAAS,QAAK,SACvC,OAAO,QAAOga,GAAe,SAAU5O,GAAQ,OAA8C,IAAvCiP,EAAelhB,QAAQiS,EAAK+O,SAAiB9sB,OAAO2S,GAYxFsa,CAAW9jB,EAAQmjB,EAAWE,EAAYE,GACpD1P,GAAU,QAAU7T,EAAO6T,WAAa7T,EAAO6T,UAAYlQ,EAAKkQ,SAOpE,QAAOpf,KAAM,CAAEqL,GAAIA,EAAI6D,KAAMA,EAAM2G,SAAUA,EAAU+Y,WAAYA,EAAYjB,QAASA,EAASkB,IAAKA,EAAKC,OAAQA,EAAQ/Z,QAASA,EAASqK,QAASA,EAASG,MAAOmP,EAAWnjB,OAAQA,IAoG7L,OAlGA8hB,EAAMrM,OAAS,SAAU5S,EAAQ4S,QACd,IAAXA,IAAqBA,EAAS,IAElC,IADA,IAAI1F,EAAc,GACTwE,EAAK,EAAGwP,EAAWlhB,EAAQ0R,EAAKwP,EAASlgB,OAAQ0Q,IAAM,CAC5D,IAAI9Q,EAAQsgB,EAASxP,GACrBxE,EAAYtM,EAAM3D,IAAM2D,EAAMxK,MAAMwc,EAAOhS,EAAM3D,KAErD,OAAOiQ,GAaX+R,EAAMkC,QAAU,SAAUnhB,EAAQohB,EAASC,GAGvC,YAFgB,IAAZD,IAAsBA,EAAU,SACpB,IAAZC,IAAsBA,EAAU,IAC7BrhB,EAAO9E,QAAO,SAAU0F,GAAS,OAAQA,EAAME,KAAKC,OAAOqgB,EAAQxgB,EAAM3D,IAAKokB,EAAQzgB,EAAM3D,SAWvGgiB,EAAMle,OAAS,SAAUf,EAAQohB,EAASC,GAGtC,YAFgB,IAAZD,IAAsBA,EAAU,SACpB,IAAZC,IAAsBA,EAAU,IACsB,IAAnDpC,EAAMkC,QAAQnhB,EAAQohB,EAASC,GAASrgB,QAGnDie,EAAMqC,UAAY,SAAUthB,EAAQ4S,GAEhC,YADe,IAAXA,IAAqBA,EAAS,IAC3B5S,EAAOO,KAAI,SAAUK,GAAS,OAAOA,EAAM0gB,UAAU1O,EAAOhS,EAAM3D,QAASuD,OAAO,MAAU,IAEvGye,EAAMxrB,UAAU8tB,eAAiB,SAAUnrB,GACvC,OAAOxE,KAAK4uB,YAAc5uB,KAAKkP,KAAKC,OAAOnP,KAAKwE,QAASA,IAM7D6oB,EAAMxrB,UAAU2C,MAAQ,SAAUA,GAC9B,IAAI2L,EAAQnQ,KA0BZ,OADAwE,EAR2B,SAAUR,GACjC,IAAK,IAAI8b,EAAK,EAAGuL,EAAKlb,EAAM4E,QAAS+K,EAAKuL,EAAGjc,OAAQ0Q,IAAM,CACvD,IAAIrM,EAAQ4X,EAAGvL,GACf,GAAIrM,EAAMyb,OAASlrB,EACf,OAAOyP,EAAM0b,GAErB,OAAOnrB,EAEH4rB,CAAqBprB,IACtB,QAAYA,GAtBG,WAClB,GAAI2L,EAAM0f,mBACN,OAAO1f,EAAM0f,mBAAmBC,aACpC,IAAK,cACD,MAAM,IAAIrd,MAAM,+DACpB,IAAIqd,EAAe,qBAA0B3f,EAAM5E,OAAOyiB,MAC1D,GAAI8B,MAAAA,IAAwD3f,EAAMjB,KAAKgK,GAAG4W,GACtE,MAAM,IAAIrd,MAAM,kBAAoBqd,EAAe,oBAAsB3f,EAAM9E,GAAK,sCAAwC8E,EAAMjB,KAAK1J,KAAO,KAIlJ,OAHI2K,EAAM5E,OAAOyiB,KAAkB,cAC/B7d,EAAM0f,mBAAqB,CAAEC,aAAcA,IAExCA,EAWiBC,GAAoB/vB,KAAKkP,KAAK8gB,WAAWxrB,IAEzE6oB,EAAMxrB,UAAUouB,SAAW,WACvB,OAAOjwB,KAAK6V,WAAasX,EAAQO,QAErCL,EAAMxrB,UAAU6tB,UAAY,SAAUlrB,GAElC,KAAK,QAAYA,IAAoB,OAAVA,IAAmBxE,KAAK4uB,WAC/C,OAAO,EAEX,IAAI/T,EAAa7a,KAAKkP,KAAK8gB,WAAWxrB,GACtC,IAAKxE,KAAKkP,KAAKgK,GAAG2B,GACd,OAAO,EAEX,IAAIqV,EAAUlwB,KAAKkP,KAAK2F,OAAOgG,GAC/B,SAAS,QAASqV,KAAalwB,KAAKkP,KAAKoV,QAAQ7a,KAAKymB,KAE1D7C,EAAMxrB,UAAUiT,SAAW,WACvB,MAAO,UAAY9U,KAAKqL,GAAK,IAAMrL,KAAKkP,KAAO,aAAelP,KAAK8uB,OAAS,eAAiB9uB,KAAK4uB,WAAa,KAE5GvB,EAtHe,4OChDtB8C,EAA2B,WAM3B,SAASA,EAAUjd,GAEflT,KAAKskB,QAAU,KAEftkB,KAAKof,SAAU,GACf,QAAOpf,KAAMkT,GAgDjB,OA5CAid,EAAUtuB,UAAUqX,GAAK,SAAUlV,EAAK6B,GACpC,OAAO,GAGXsqB,EAAUtuB,UAAUgT,OAAS,SAAU7Q,EAAK6B,GACxC,OAAO7B,GAGXmsB,EAAUtuB,UAAUoT,OAAS,SAAUjR,EAAK6B,GACxC,OAAO7B,GAGXmsB,EAAUtuB,UAAUsN,OAAS,SAAUsO,EAAGmB,GAEtC,OAAOnB,GAAKmB,GAEhBuR,EAAUtuB,UAAUuuB,YAAc,WAC9B,IAAIC,EAAMrwB,KAAKskB,QAAQxP,WACvB,OAAOub,EAAItJ,OAAO,EAAGsJ,EAAIjhB,OAAS,IAEtC+gB,EAAUtuB,UAAUiT,SAAW,WAC3B,MAAO,cAAgB9U,KAAKwF,KAAO,KAGvC2qB,EAAUtuB,UAAUmuB,WAAa,SAAUhsB,GACvC,OAAOhE,KAAKkZ,GAAGlV,GAAOA,EAAMhE,KAAKiV,OAAOjR,IAY5CmsB,EAAUtuB,UAAU8sB,SAAW,SAAU2B,EAAML,GAC3C,IAAKK,EACD,OAAOtwB,KACX,GAAa,SAATswB,IAAoBL,EACpB,MAAM,IAAIxd,MAAM,kDACpB,OAAO,IAAI8d,EAAUvwB,KAAMswB,IAExBH,EA3DmB,GA+D9B,SAASI,EAAUrhB,EAAMohB,GACrB,IAAIngB,EAAQnQ,KAEZ,SAASwwB,EAAUxsB,GACf,OAAO,QAAQA,GAAOA,GAAM,QAAUA,GAAO,CAACA,GAAO,GAczD,SAASysB,EAAajwB,EAAUkwB,GAC5B,OAAO,SAAqB1sB,GACxB,IAAI,QAAQA,IAAuB,IAAfA,EAAIoL,OACpB,OAAOpL,EACX,IAAI0b,EAAM8Q,EAAUxsB,GAChBsC,GAAS,QAAIoZ,EAAKlf,GACtB,OAAyB,IAAlBkwB,EAAgF,KAAvD,QAAOpqB,GAAQ,SAAUgJ,GAAK,OAAQA,KAAMF,OAjBpF,SAAqBpL,GACjB,OAAQA,EAAIoL,QACR,KAAK,EACD,OACJ,KAAK,EACD,MAAgB,SAATkhB,EAAkBtsB,EAAI,GAAKA,EACtC,QACI,OAAOA,GAUgF2sB,CAAYrqB,IAI/G,SAASsqB,EAAmBpwB,GACxB,OAAO,SAAqBqwB,EAAMC,GAC9B,IAAIC,EAAOP,EAAUK,GAAOG,EAAQR,EAAUM,GAC9C,GAAIC,EAAK3hB,SAAW4hB,EAAM5hB,OACtB,OAAO,EACX,IAAK,IAAIiO,EAAI,EAAGA,EAAI0T,EAAK3hB,OAAQiO,IAC7B,IAAK7c,EAASuwB,EAAK1T,GAAI2T,EAAM3T,IACzB,OAAO,EAEf,OAAO,GAGf,CAAC,SAAU,SAAU,SAAU,cAActc,SAAQ,SAAUyE,GAC3D,IAAIyrB,EAAc/hB,EAAK1J,GAAMlC,KAAK4L,GAC9BgiB,EAAqB,WAAT1rB,EAAoBorB,EAAqBH,EACzDtgB,EAAM3K,GAAQ0rB,EAAUD,OAE5B,QAAOjxB,KAAM,CACT2tB,QAASze,EAAKye,QACdnoB,KAAM0J,EAAK1J,KACX8e,QAASpV,EAAKoV,QACdlF,QAASlQ,EAAKkQ,QACdyP,IAAK3f,EAAK2f,IACV3V,GAAIuX,EAAavhB,EAAKgK,GAAG5V,KAAK4L,IAAO,GACrCiiB,WAAYb,+GC5DZc,kUApDJC,EAA4B,WAC5B,SAASA,IACLrxB,KAAKwlB,SAAU,EACfxlB,KAAKsxB,UAAY,GACjBtxB,KAAKuxB,cAAe,QAAKF,EAAWxvB,UAAW,CAC3C,OACA,SACA,QACA,OACA,MACA,OACA,OACA,OACA,QAIJ7B,KAAK+D,OAAQ,SAAQ,QAAI/D,KAAKuxB,cADf,SAAU9X,EAAYjU,GAAQ,OAAO,IAAI,KAAU,QAAO,CAAEA,KAAMA,GAAQiU,OAClC,IA+B3D,OA7BA4X,EAAWxvB,UAAUqT,QAAU,WAC3BlV,KAAK+D,MAAQ,IAOjBstB,EAAWxvB,UAAUqN,KAAO,SAAU1J,EAAMiU,EAAY+X,GACpD,KAAK,QAAU/X,GACX,OAAOzZ,KAAK+D,MAAMyB,GACtB,GAAIxF,KAAK+D,MAAMrB,eAAe8C,GAC1B,MAAM,IAAIiN,MAAM,iBAAmBjN,EAAO,+BAO9C,OANAxF,KAAK+D,MAAMyB,GAAQ,IAAI,KAAU,QAAO,CAAEA,KAAMA,GAAQiU,IACpD+X,IACAxxB,KAAKsxB,UAAU7wB,KAAK,CAAE+E,KAAMA,EAAM0N,IAAKse,IAClCxxB,KAAKwlB,SACNxlB,KAAKyxB,mBAENzxB,MAEXqxB,EAAWxvB,UAAU4vB,gBAAkB,WACnC,KAAOzxB,KAAKsxB,UAAUliB,QAAQ,CAC1B,IAAIF,EAAOlP,KAAKsxB,UAAUrvB,QAC1B,GAAIiN,EAAKoV,QACL,MAAM,IAAI7R,MAAM,sDACpB,QAAOzS,KAAK+D,MAAMmL,EAAK1J,MAAO,qBAA0B0J,EAAKgE,QAG9Dme,EAhDoB,GAoDvBD,EAAkB,SAAUle,GAC5B,IAAIwe,EAAc,SAAU1tB,GAAO,OAAe,MAAPA,EAAcA,EAAI8Q,WAAa9Q,GACtE2tB,EAAkB,CAClB9c,OAAQ6c,EACRzc,OAAQyc,EACRxY,IAAI,IAAAA,IAAG0Y,QACPtN,QAAS,KAETnV,OAAQ,SAAUsO,EAAGmB,GAAK,OAAOnB,GAAKmB,IAE1C,OAAO,QAAO,GAAI+S,EAAiBze,KAGvC,QAAOme,EAAWxvB,UAAW,CACzB0D,OAAQ6rB,EAAgB,IACxBjpB,KAAMipB,EAAgB,CAClB9M,QAAS,UAEbuN,MAAOT,EAAgB,IACvBU,KAAMV,EAAgB,CAClBhS,SAAS,IAEb2S,IAAKX,EAAgB,CACjBnc,OAAQ,SAAUjR,GAAO,OAAOqlB,SAASrlB,EAAK,KAC9CkV,GAAI,SAAUlV,GACV,QAAQ,QAAkBA,IAAQhE,KAAKiV,OAAOjR,EAAI8Q,cAAgB9Q,GAEtEsgB,QAAS,UAEb0N,KAAMZ,EAAgB,CAClBvc,OAAQ,SAAU7Q,GAAO,OAAQA,EAAO,EAAM,GAC9CiR,OAAQ,SAAUjR,GAAO,OAA6B,IAAtBqlB,SAASrlB,EAAK,KAC9CkV,IAAI,IAAAA,IAAG+Y,SACP3N,QAAS,QAEb4N,KAAMd,EAAgB,CAClBvc,OAAQ,SAAU7Q,GACd,OAAQhE,KAAKkZ,GAAGlV,GAEV,CAACA,EAAImuB,eAAgB,KAAOnuB,EAAIouB,WAAa,IAAItwB,OAAO,IAAK,IAAMkC,EAAIquB,WAAWvwB,OAAO,IAAImR,KAAK,UADlGkB,GAGVc,OAAQ,SAAUjR,GACd,GAAIhE,KAAKkZ,GAAGlV,GACR,OAAOA,EACX,IAAIgY,EAAQhc,KAAKsyB,QAAQ7oB,KAAKzF,GAC9B,OAAOgY,EAAQ,IAAIuW,KAAKvW,EAAM,GAAIA,EAAM,GAAK,EAAGA,EAAM,SAAM7H,GAEhE+E,GAAI,SAAUlV,GAAO,OAAOA,aAAeuuB,OAASjJ,MAAMtlB,EAAIwuB,YAC9DrjB,OAAQ,SAAUsjB,EAAGlV,GACjB,MAAO,CAAC,cAAe,WAAY,WAAW3O,QAAO,SAAUsL,EAAKvZ,GAAM,OAAOuZ,GAAOuY,EAAE9xB,OAAU4c,EAAE5c,QAAU,IAEpH2jB,QAAS,0DACTgO,QAAS,0DAEbI,KAAMtB,EAAgB,CAClBvc,OAAQ,KACRI,OAAQ,KACRiE,IAAI,IAAAA,IAAG3F,QACPpE,OAAQ,KACRmV,QAAS,UAGbJ,IAAKkN,EAAgB,CACjBvc,OAAQ,KACRI,OAAQ,KACRiE,GAAI,WAAc,OAAO,GACzB/J,OAAQ,kLCjJhBwjB,EAA6B,WAC7B,SAASA,EAAYvkB,QACF,IAAXA,IAAqBA,EAAS,KAClC,QAAOpO,KAAMoO,GA4BjB,OAlBAukB,EAAY9wB,UAAU+wB,SAAW,SAAUC,EAAWC,EAAUC,GAC5D,IAAIC,EACAC,GAAU,QAAUH,EAAUC,GAAM9nB,EAAY,GAAIioB,EAAc,GACtE,IAAK,IAAI7V,KAAK4V,EACV,GAAKA,EAAQ5V,IAAO4V,EAAQ5V,GAAGjP,SAE/B4kB,EAAezf,OAAOC,KAAKyf,EAAQ5V,GAAGjP,SACpBgB,OAElB,IAAK,IAAIsO,KAAKsV,EACNE,EAAYhlB,QAAQ8kB,EAAatV,KAAO,IAE5CwV,EAAYzyB,KAAKuyB,EAAatV,IAC9BzS,EAAU+nB,EAAatV,IAAM1d,KAAKgzB,EAAatV,KAGvD,OAAO,QAAO,GAAIzS,EAAW4nB,IAE1BF,EA/BqB,+RCS5BQ,EAA0B,WAC1B,SAASA,EAASC,GACd,GAAIA,aAAuBD,EAAU,CACjC,IAAI5kB,EAAO6kB,EACXpzB,KAAKyN,MAAQc,EAAKd,MAClBzN,KAAKwO,YAAcD,EAAKC,YAAY1M,QACpC9B,KAAKsb,aAAc,QAAO,GAAI/M,EAAK+M,aACnCtb,KAAK+X,YAAcxJ,EAAKwJ,YAAYjW,QACpC9B,KAAKwa,MAAQjM,EAAKiM,OAASjM,EAAKiM,MAAM1Y,YAErC,CACD,IAAI2L,EAAQ2lB,EACZpzB,KAAKyN,MAAQA,EACbzN,KAAKwO,YAAcf,EAAM4lB,WAAW,CAAEjU,SAAS,IAC/Cpf,KAAKsb,YAAc,GACnBtb,KAAK+X,YAActK,EAAMsK,YAAYpJ,KAAI,SAAUqE,GAAO,OAAOA,EAAItG,YA+C7E,OA5CAymB,EAAStxB,UAAU6K,MAAQ,WACvB,OAAO,IAAIymB,EAASnzB,OAGxBmzB,EAAStxB,UAAUyxB,eAAiB,SAAUllB,GAG1C,OADApO,KAAKsb,YAActb,KAAKwO,YAAYI,QAAO,SAAUsR,EAAMqT,GAAQ,OAAO,QAAWrT,EADtC,EAAnBsT,EAC2ED,GAD9CloB,GAAImoB,EAAShvB,MAAM4J,EAAOolB,EAASnoB,OAA1E,IAAUmoB,IACsF,IAC3GxzB,MAGXmzB,EAAStxB,UAAU4xB,UAAY,SAAUjuB,GACrC,OAAO,QAAKxF,KAAKwO,aAAa,QAAO,KAAMhJ,KAM/C2tB,EAAStxB,UAAUsN,OAAS,SAAUZ,EAAMmlB,GACxC,IAAIC,EAAO3zB,KAAK2zB,KAAKplB,EAAMmlB,GAC3B,OAAOC,GAAwB,IAAhBA,EAAKvkB,QAcxB+jB,EAAStxB,UAAU8xB,KAAO,SAAUplB,EAAMmlB,GACtC,GAAI1zB,KAAKyN,QAAUc,EAAKd,MACpB,OAAO,EACX,IAAIW,EAASslB,EAAWA,EAAS1zB,MAAQA,KAAKwO,YAC9C,OAAO,YAAcJ,EAAQpO,KAAKsb,YAAa/M,EAAK+M,cAMxD6X,EAASzmB,MAAQ,SAAU6B,GAAQ,OAAOA,EAAK7B,SACxCymB,EA9DkB,mWCHzBS,EAA2B,WAC3B,SAASA,KA4JT,OAzJAA,EAAUC,gBAAkB,SAAUC,EAAU3rB,GAC5C,IAAIsF,GAAQ,QAAKtF,GAAMsF,MACvB,OAAO,IAAI,IAAYqmB,EAAUrmB,EAAOtF,EAAKwG,KAAI,QAAK,gBAAgBC,OAAO,KAAQ,IAAK,KAE9FglB,EAAUG,UAAY,SAAUvH,GAC5B,IAAIre,EAAWqe,EAAYpe,SAC3B,OAAOoe,EAAY/T,SAAStQ,KAAKwG,KAAI,SAAUlB,GAAS,OAAO,IAAI,IAASA,GAAO6lB,eAAenlB,OAGtGylB,EAAUI,YAAc,SAAUC,EAAUzH,GACxC,IAAI0H,EAASN,EAAUG,UAAUvH,GACjC,OAAIA,EAAYrsB,UAAUif,QACfwU,EAAUO,cAAcF,EAAUC,EAAQ3gB,OAAOC,KAAKgZ,EAAYpe,WAEtE8lB,GAOXN,EAAUQ,iBAAmB,SAAUttB,EAAOqB,EAAM6kB,GAEhD7kB,EACKmB,QAAO,SAAUiF,GAAQ,OAAO,QAAQye,EAAQze,EAAKd,UACrD1M,SAAQ,SAAUwN,GACnB,IAAI8lB,GAAY,QAAO9lB,EAAKd,MAAM+M,OAAS,IACvC8Z,EAAUV,EAAUU,QAAQnsB,GAAM,SAAUoY,GAAK,OAAOA,IAAMhS,KAC9DgmB,EAAcF,EAAU1lB,KAAI,SAAUmL,GAAQ,OAAOhT,EAAM0tB,iBAAiBF,EAASxa,MACzFvL,EAAKiM,MAAQ+Z,EAAY3lB,OAAO,KAAS,QAcjDglB,EAAUO,cAAgB,SAAUF,EAAUC,EAAQO,QACnC,IAAXA,IAAqBA,EAAS,IAKlC,IAAIC,EAAYT,EACXtlB,KAAI,SAAUJ,GAAQ,OAAOA,EAAKC,eAClCI,OAAO,KAAS,IAChBtF,QAAO,SAAU0F,GAAS,OAAQA,EAAMoQ,WACxCzQ,KAAI,QAAK,OAiBd,OAAOulB,EAAOvlB,KAZd,SAAiCgmB,GAE7B,IAAIC,GAAc,QAAO,GAAID,GAAUA,EAAOrZ,aAE1CuZ,GAAoB,QAAKD,EAAaH,GAC1CG,GAAc,QAAKA,EAAaH,GAChC,IAnBmBtsB,EAAMsF,EACrBc,EAkBAumB,GAAgB,SAnBD3sB,EAmBoB8rB,EAnBdxmB,EAmBwBknB,EAAOlnB,MAlBpDc,GAAO,QAAKpG,GAAM,QAAO,QAASsF,KAC/B,QAAO,GAAIc,GAAQA,EAAK+M,cAiBmC,IAAIoZ,GAElEK,GAAe,QAAOH,EAAaE,EAAeD,GACtD,OAAO,IAAI,IAASF,EAAOlnB,OAAO6lB,eAAeyB,OAQzDnB,EAAUllB,YAAc,SAAUulB,EAAUC,EAAQc,GAIhD,IAHA,IAE2BC,EAAOC,EAU9BhG,EAAMiG,EAAUlnB,EAASke,EAZzBrF,EAAMhF,KAAKD,IAAIoS,EAAS7kB,OAAQ8kB,EAAO9kB,QACvCgmB,EAAO,EAEJA,EAAOtO,GAAOmN,EAASmB,GAAM3nB,QAAUunB,IADnBC,EAC6ChB,EAASmB,GAD/CF,EACsDhB,EAAOkB,GAD7CH,EAAM9lB,OAAO+lB,EAAOtB,EAAUyB,oBAE5ED,IAUJD,GADAjG,EAAO+E,GACSnyB,MAAM,EAAGszB,GACzBnnB,EAAUihB,EAAKptB,MAAMszB,GAErB,IAAIE,EAAuBH,EAASxmB,KAVpC,SAAuB4mB,EAActmB,GACjC,IAAIxC,EAAS8oB,EAAa7oB,QAE1B,OADAD,EAAO6O,YAAc4Y,EAAOjlB,GAAKqM,YAC1B7O,KAUX,OAFA0f,EAAW+H,EAAOpyB,MAAMszB,GAEjB,CAAElG,KAAMA,EAAMC,GADhBmG,EAAqBlzB,OAAO+pB,GACJgJ,SAAUA,EAAUG,qBAAsBA,EAAsBrnB,QAASA,EAASke,SAAUA,IAiB7HyH,EAAU4B,SAAW,SAAUC,EAAOC,EAAOhC,GACzC,IAAIiC,GAAO,EAEX,OADa,QAAYF,EAAOC,GAClB9mB,QAAO,SAAU4mB,EAAUnK,GACrC,IAAIuK,EAAQvK,EAAG,GAAIwK,EAAQxK,EAAG,GAE9B,OADAsK,EAAOA,IAASC,EAAMzmB,OAAO0mB,EAAOnC,IACtB8B,EAAWA,EAASpzB,OAAOwzB,KAC1C,KAUPhC,EAAUzkB,OAAS,SAAUsmB,EAAOC,EAAOhC,GACvC,OAAO+B,EAAMrmB,SAAWsmB,EAAMtmB,QAAUwkB,EAAU4B,SAASC,EAAOC,EAAOhC,GAAUtkB,SAAWqmB,EAAMrmB,QAYxGwkB,EAAUU,QAAU,SAAUnsB,EAAM2tB,GAChC,IAAIvnB,GAAO,QAAKpG,EAAM2tB,GAClBC,EAAa5tB,EAAK+F,QAAQK,GAC9B,OAAuB,IAAhBwnB,OAAoB5hB,EAAYhM,EAAKrG,MAAM,EAAGi0B,EAAa,IAEtEnC,EAAUyB,iBAAmB,SAAU9mB,GACnC,OAAOA,EAAKd,MAAM4lB,WAAW,CAAEjU,SAAS,IAAS9V,QAAO,SAAU0F,GAAS,OAAQA,EAAM2e,YAG7FiG,EAAUtY,YAAc,SAAUnT,GAAQ,OAAOA,EAAKyG,QAAO,SAAUsL,EAAK3L,GAAQ,OAAO,QAAO2L,EAAK3L,EAAK+M,eAAiB,KACtHsY,EA7JmB,yGCPvB,IAAIoC,EAAkB,CACzB/lB,KAAM,CACFgmB,KAAM,OACNC,MAAO,SAEXpd,MAAO,CACHqd,KAAM,OACNC,OAAQ,sbCgBZnkB,EAA4B,WAC5B,SAASA,EAAWokB,EAAMne,EAAWpG,EAAMwkB,EAAQ3uB,GAG/C,GAFA3H,KAAKu2B,UAAW,EAChBv2B,KAAKyD,aAAU0Q,EACXkiB,aAAgBpkB,GAChB,QAAOjS,KAAMq2B,QAEZ,IAAI,QAAWne,GAAY,CAC5B,IAAI,QAAkBme,GAClB,MAAM,IAAI5jB,MAAM,gDACpB,KAAK,QAAWyF,GACZ,MAAM,IAAIzF,MAAM,2DACpBzS,KAAKuhB,MAAQ8U,EACbr2B,KAAKs2B,OAASA,EACdt2B,KAAKkY,UAAYA,EACjBlY,KAAK8R,KAAOA,GAAQ,GACpB9R,KAAK2H,KAAOA,EACZ3H,KAAKu2B,cAAoBpiB,IAATxM,EAChB3H,KAAKyD,QAAUzD,KAAKu2B,SAAW,YAAiBv2B,KAAK2H,WAAQwM,OAE5D,IAAI,QAASkiB,IAASA,EAAK9U,QAAU8U,EAAK3zB,eAAe,cAAgB2zB,EAAK3zB,eAAe,SAAU,CACxG,IAAI8zB,EAAUH,EACd,OAAO,IAAIpkB,EAAWukB,EAAQjV,MAAOiV,EAAQte,UAAWse,EAAQ1kB,KAAM0kB,EAAQF,OAAQE,EAAQ7uB,OA+DtG,OA5DAsK,EAAWpQ,UAAUgX,UAAY,SAAUpL,GACvC,IAAIgpB,EAAaz2B,KAAKs2B,QAAU,GAC5BI,EAAejpB,GAASA,EAAMkpB,eAAkB,GACpD,MAAO,CACH1mB,KAAMwmB,EAAWxmB,MAAQymB,EAAYzmB,MA5CvC,OA6CE6I,MAAO2d,EAAW3d,OAAS4d,EAAY5d,OA5CxC,SAsDP7G,EAAWpQ,UAAU8K,QAAU,SAAUiqB,EAAgBhnB,GACrD,IAAIO,EAAQnQ,KACR+G,EAAK,OAOLwH,EAAOqoB,EAAeC,SAAS72B,MAC/ByN,EAAQc,GAAQA,EAAKd,MACrBqpB,EAAc92B,KAAK6Y,UAAUpL,GAAOqL,MACpCie,GAAoB,QAAWD,GAAeA,EAAc,KAUhE,OAAQ92B,KAAKyD,QAAUsD,EAClBkJ,OACAlF,MApB2B,WAC5B,OAAOhE,EAAG0U,IAAImb,EAAeI,gBAAgB7mB,GAAOxB,KAAI,SAAUqJ,GAAc,OAAOA,EAAWtH,IAAIkmB,EAAgBhnB,UAoBrH7E,MAjBiB,SAAUksB,GAAgB,OAAO9mB,EAAM+H,UAAU/V,MAAM,KAAM80B,MAkB9ElsB,KAAKgsB,GACLhsB,MAboB,SAAUmsB,GAK/B,OAJA/mB,EAAMxI,KAAOuvB,EACb/mB,EAAMomB,UAAW,EACjBpmB,EAAM+H,UAAY,KAClB,6BAA8B/H,EAAOP,GAC9BO,EAAMxI,SAgBrBsK,EAAWpQ,UAAU6O,IAAM,SAAUkmB,EAAgBhnB,GACjD,OAAO5P,KAAKyD,SAAWzD,KAAK2M,QAAQiqB,EAAgBhnB,IAExDqC,EAAWpQ,UAAUiT,SAAW,WAC5B,MAAO,sBAAuB,QAAU9U,KAAKuhB,OAAS,gBAAkBvhB,KAAK8R,KAAKnD,IAAI,MAAa,MAEvGsD,EAAWpQ,UAAU6K,MAAQ,WACzB,OAAO,IAAIuF,EAAWjS,OAE1BiS,EAAWklB,SAAW,SAAU5V,EAAO5Z,GAAQ,OAAO,IAAIsK,EAAWsP,GAAO,WAAc,OAAO5Z,IAAS,KAAM,KAAMA,IAC/GsK,EArFoB,4qBCd3BmlB,EAAQ,SACRC,EAAY,CAACD,EAAMlB,MAAOkB,EAAMnB,MAChCqB,EAAc,CAACF,EAAMlB,OAarB9tB,EAAgC,WAChC,SAASA,EAAemvB,GACpBv3B,KAAKu3B,MAAQA,EA8IjB,OA3IAnvB,EAAevG,UAAU+W,UAAY,WACjC,OAAO5Y,KAAKu3B,MAAM3oB,QAAO,SAAUsL,EAAK3L,GAAQ,OAAO2L,EAAI9X,OAAOmM,EAAKwJ,YAAYpJ,KAAI,SAAU4O,GAAK,OAAOA,EAAEgE,YAAe,IAAI3S,OAAO,KAAO,KAQpJxG,EAAevG,UAAUiM,cAAgB,SAAUyT,GAC/C,IAAIiU,EAAWx1B,KAAKu3B,MACf5oB,KAAI,SAAUJ,GAAQ,OAAOA,EAAKwJ,eAClCnJ,OAAO,KAAS,IAChBtF,QAAO,SAAUiU,GAAK,OAAOA,EAAEgE,QAAUA,KAC9C,OAAO,QAAKiU,IAGhBptB,EAAevG,UAAUgX,UAAY,SAAUb,GAC3C,IAAIzJ,EAAOvO,KAAK62B,SAAS7e,GACzB,OAAOA,EAAWa,UAAUtK,EAAKd,QAyBrCrF,EAAevG,UAAUkS,WAAa,SAAUtG,GAC5C,OAAO,IAAIrF,EAAe,YAAkBpI,KAAKu3B,OAAO,SAAUhpB,GAAQ,OAAOA,EAAKd,QAAUA,OAiBpGrF,EAAevG,UAAU21B,eAAiB,SAAUC,EAAgBhqB,GAChE,IAAIc,GAAO,QAAKvO,KAAKu3B,OAAO,QAAO,QAAS9pB,IACxC+F,EAAOikB,EAAe9oB,KAAI,SAAU4O,GAAK,OAAOA,EAAEgE,SACtDhT,EAAKwJ,YAAcxJ,EAAKwJ,YAAYzO,QAAO,SAAUiU,GAAK,OAAkC,IAA3B/J,EAAKtF,QAAQqP,EAAEgE,UAAkBnf,OAAOq1B,IAS7GrvB,EAAevG,UAAU61B,YAAc,SAAUznB,EAAML,GACnD,IAAIO,EAAQnQ,UACC,IAATiQ,IAAmBA,EAAO,QAE9B,IAGI0nB,IAHa,QAAQN,EAAWpnB,GAAQA,EAAO,UAGjB,eAA6BqnB,EAAcD,EAE7E,sBAAuBr3B,KAAKu3B,MAAOtnB,EAAML,GACzC,IAAIgoB,EAAgB,SAAUC,EAAcC,GAAe,OAAO,SAAU9f,GACxE,OAAO,QAAQ6f,EAAc1nB,EAAM0I,UAAUb,GAAY8f,MAIzDvc,EAAWvb,KAAKu3B,MAAM3oB,QAAO,SAAUsL,EAAK3L,GAC5C,IAAIwpB,EAAkBxpB,EAAKwJ,YAAYzO,OAAOsuB,EAAcD,EAAc,SACtEK,EAASD,EAAgBzuB,OAAOsuB,EAAc,CAAC,UAAW,UAC1DK,EAAOF,EAAgBzuB,QAAO,QAAIsuB,EAAc,CAAC,UAAW,WAE5D7jB,EAAa5D,EAAM4D,WAAWxF,EAAKd,OACnCyqB,EAAY,SAAU3a,GACtB,OAAOA,EACF7M,IAAIqD,EAAYnE,GAEhB7E,MAAK,SAAUvG,GAAS,MAAO,CAAG+c,MAAOhE,EAAEgE,MAAO/c,MAAOA,OAGlE,OADAwzB,EAAOj3B,QAAQm3B,GACRhe,EAAI9X,OAAO61B,EAAKtpB,IAAIupB,MAC5B,IAEH,OAAO,WAAgB3c,IAE3BnT,EAAevG,UAAUs2B,SAAW,WAChC,OAAOn4B,KAAKo4B,YAAcp4B,KAAKo4B,UAAY,IAAIC,EAAer4B,QAElEoI,EAAevG,UAAUg1B,SAAW,SAAU7e,GAC1C,OAAO,QAAKhY,KAAKu3B,OAAO,SAAUhpB,GAAQ,OAAO,QAAQA,EAAKwJ,YAAaC,OAO/E5P,EAAevG,UAAUm1B,gBAAkB,SAAUhf,GACjD,IAAI7H,EAAQnQ,KACRuO,EAAOvO,KAAK62B,SAAS7e,GAIrBsgB,GADU,YAAkBt4B,KAAKu3B,OAAO,SAAUjoB,GAAK,OAAOA,IAAMf,MAAYvO,KAAKu3B,OAEpF3oB,QAAO,SAAUsL,EAAKqe,GAAS,OAAOre,EAAI9X,OAAOm2B,EAAMxgB,eAAiB,IACxEzO,QAAO,SAAU0J,GAAO,OAAOA,IAAQgF,KAW5C,OAAOA,EAAWlG,KAAKnD,KAVH,SAAU4S,GAC1B,IAAIiU,EAAW8C,EAAqBhvB,QAAO,SAAUiU,GAAK,OAAOA,EAAEgE,QAAUA,KAC7E,GAAIiU,EAASpmB,OACT,OAAO,QAAKomB,GAChB,IAAIgD,EAAeroB,EAAMgoB,WAAWM,UAAUlX,GAC9C,IAAI,QAAYiX,GACZ,MAAM,IAAI/lB,MAAM,+CAAgD,QAAU8O,IAE9E,OAAO,IAAI,IAAWA,GAAO,WAAc,OAAOiX,IAAiB,GAAIA,OAIxEpwB,EAhJwB,GAoJ/BiwB,EAAgC,WAChC,SAASA,EAAexnB,GACpB7Q,KAAK6Q,QAAUA,EACf7Q,KAAK04B,OAAS14B,KAAK0Q,IAlKQ,oBAkKsB,cAwBrD,OAtBA2nB,EAAex2B,UAAU6O,IAAM,SAAU6Q,GACrC,IAAIvJ,EAAahY,KAAK6Q,QAAQ/C,cAAcyT,GAC5C,GAAIvJ,EAAY,CACZ,GAAiD,WAA7ChY,KAAK6Q,QAAQgI,UAAUb,GAAYc,MACnC,OAAOd,EAAWtH,IAAI1Q,KAAK6Q,SAE/B,IAAKmH,EAAWue,SACZ,MAAM,IAAI9jB,MAAM,yCAA0C,QAAUuF,EAAWuJ,QAEnF,OAAOvJ,EAAWrQ,KAEtB,OAAO3H,KAAKy4B,UAAUlX,IAE1B8W,EAAex2B,UAAU82B,SAAW,SAAUpX,GAC1C,IAAIvJ,EAAahY,KAAK6Q,QAAQ/C,cAAcyT,GAC5C,OAAIvJ,EACOA,EAAWtH,IAAI1Q,KAAK6Q,SACxB,YAAiB7Q,KAAK04B,OAAOhoB,IAAI6Q,KAE5C8W,EAAex2B,UAAU42B,UAAY,SAAUlX,GAC3C,OAAOvhB,KAAK04B,QAAU14B,KAAK04B,OAAOhoB,IAAI6Q,IAEnC8W,EA3BwB,q2BC/J/BO,EAAkB,EAMlBC,GAAsB,QAAS,mBAJnB,CAAC,MAAO,OAAQ,SAAU,OAAQ,aAM9CC,GAAqB,QAAS,iBAJlB,CAAC,OAAQ,WAAY,OAAQ,WAAY,YAAa,eAUlEpiB,EAA0B,WAQ1B,SAASA,EAASU,EAAiBC,QACP,IAApBD,IAA8BA,EAAkByhB,QAC7B,IAAnBxhB,IAA6BA,EAAiByhB,GAClD94B,KAAKoX,gBAAkBA,EACvBpX,KAAKqX,eAAiBA,EACLrX,KAAKmb,IAAMyd,IACX54B,KAAK+4B,WAAY,EACjB/4B,KAAKg5B,aAAe,GAErCh5B,KAAKqI,MAAQ,KAEbrI,KAAK+W,YAAc,IAAI,IAAY/W,MAEnCA,KAAKsY,QAAU,IAAI,IAEnBtY,KAAK8sB,kBAAoB,IAAI,IAAkB9sB,MAK/CA,KAAK4U,kBAAoB,IAAI,IAAkB5U,MAK/CA,KAAKmc,UAAY,IAAI,IAAUnc,MAE/BA,KAAKiX,WAAa,IAAI,IAAWjX,MAEjCA,KAAK4W,cAAgB,IAAI,IAAc5W,MAEvCA,KAAK6W,aAAe,IAAI,IAAa7W,MAErCA,KAAKi5B,SAAW,GAChBj5B,KAAK+W,YAAY/M,WAAWC,iBAAiBjK,KAAK4W,cAAcgH,QAChE5d,KAAKsY,QAAQwa,SAAW9yB,KAAK4W,cAAcgH,OAC3C5d,KAAKsY,QAAQwN,QAAU9lB,KAAKsY,QAAQwa,SAASplB,KAC7C1N,KAAKk5B,WAAWl5B,KAAKsY,SACrBtY,KAAKk5B,WAAWl5B,KAAK6W,cACrB7W,KAAKk5B,WAAWl5B,KAAK4W,eACrB5W,KAAKk5B,WAAWl5B,KAAK8sB,mBACrB9sB,KAAKk5B,WAAWl5B,KAAKiX,YACrBjX,KAAKk5B,WAAW9hB,GAChBpX,KAAKk5B,WAAW7hB,GAgGpB,OA7FAX,EAAS7U,UAAUq3B,WAAa,SAAUA,GACtCl5B,KAAKg5B,aAAav4B,KAAKy4B,IAa3BxiB,EAAS7U,UAAUqT,QAAU,SAAUgkB,GACnC,IAAI/oB,EAAQnQ,KACRk5B,IAAc,QAAWA,EAAWhkB,SACpCgkB,EAAWhkB,QAAQlV,OAGvBA,KAAK+4B,WAAY,EACjB/4B,KAAKg5B,aAAal3B,QAAQf,SAAQ,SAAUo4B,GACxC,IACyB,mBAAdA,EAAEjkB,SAA0BikB,EAAEjkB,QAAQ/E,IAC7C,QAAWA,EAAM6oB,aAAcG,GAEnC,MAAOC,UAwDf1iB,EAAS7U,UAAUw3B,OAAS,SAAUA,EAAQl5B,QAC1B,IAAZA,IAAsBA,EAAU,IACpC,IAAIm5B,EAAiB,IAAID,EAAOr5B,KAAMG,GACtC,IAAKm5B,EAAe9zB,KAChB,MAAM,IAAIiN,MAAM,+CAAiD6mB,GAErE,OADAt5B,KAAKg5B,aAAav4B,KAAK64B,GACft5B,KAAKi5B,SAASK,EAAe9zB,MAAQ8zB,GAEjD5iB,EAAS7U,UAAU03B,UAAY,SAAUC,GACrC,OAAOA,EAAax5B,KAAKi5B,SAASO,IAAc,QAAOx5B,KAAKi5B,WAEzDviB,EAnJkB,ijBCf7B,SAAS+iB,EAAYhsB,GACjB,OAAOA,EAAMjI,KAEjB,SAASk0B,EAAYjsB,GAEjB,OADAA,EAAMC,KAAKsG,QAAU,WAAc,OAAOvG,GACnCA,EAAMC,KAEjB,SAASisB,EAAYlsB,GAIjB,OAHIA,EAAM2M,QAAU3M,EAAM2M,OAAOzS,OAC7B8F,EAAM9F,KAAO8F,EAAMC,KAAK/F,MAAO,QAAQ8F,EAAM2M,OAAOzS,KAAM8F,EAAM9F,OAE7D8F,EAAM9F,KAEjB,IAAIiyB,EAAgB,SAAUC,EAA4Bjc,GACtD,OAAO,SAAoBhK,GACvB,IAAIkmB,EAAWlmB,EAAYlG,KAG3B,GAAIosB,GAAYA,EAASroB,KAAOqoB,EAASt0B,MAAQs0B,EAASt0B,KAAKwW,MAAM,WAAY,CAC7E,IAAI+d,EAAc,IAClB,QAAKD,EAAUC,GACfA,EAAYtoB,KAAO,kBACnBqoB,EAAWC,EAEf,IAAI3f,EAASxG,EAAYwG,OACrB4f,EA/BG,SAAUvoB,GACrB,KAAK,QAASA,GACV,OAAO,EACX,IAAImM,EAAyB,MAAlBnM,EAAIhM,OAAO,GACtB,MAAO,CAAEzB,IAAK4Z,EAAOnM,EAAIwoB,UAAU,GAAKxoB,EAAKmM,KAAMA,GA2BlCsc,CAASJ,EAASroB,KAC3BA,EAAOuoB,EAAwBH,EAA2BxyB,QAAQ2yB,EAAOh2B,IAAK,CAAEyJ,MAAOqsB,IAAvEA,EAASroB,IAC7B,IAAKA,EACD,OAAO,KACX,IAAKooB,EAA2BM,UAAU1oB,GACtC,MAAM,IAAIgB,MAAM,gBAAkBhB,EAAM,eAAiBmC,EAAc,KAC3E,OAAOomB,GAAUA,EAAOpc,KAAOnM,GAAQ2I,GAAUA,EAAOggB,WAAcxc,KAAQnM,IAAI4oB,OAAO5oB,KAG7F6oB,EAAsB,SAAUC,GAChC,OAAO,SAA0B9sB,GAC7B,OAAQ8sB,EAAO9sB,IAAUA,EAAMgE,IAAMhE,EAAQA,EAAM2M,OAAS3M,EAAM2M,OAAOggB,UAAY,OAc7F,SAASI,EAAY/sB,GACjB,OAAOA,EAAM2M,OAAS3M,EAAM2M,OAAOjS,KAAK/F,OAAOqL,GAAkB,CAACA,GAEtE,SAASgtB,EAAgBhtB,GACrB,IAAI6L,EAAW7L,EAAM2M,QAAS,QAAO,GAAI3M,EAAM2M,OAAOd,UAAY,GAElE,OADAA,EAAS7L,EAAMjI,OAAQ,EAChB8T,EA2CJ,SAASohB,EAAmBjtB,GAE/B,IAA+BktB,EAAY3E,EA2BvC4E,EAAW,SAAUC,GAAK,OAAOA,EAAEC,SAAWD,EAAEtZ,OAEhDwZ,GAAqB,QAAQ,CAC7B,EAAC,QAAK,aAAc,SAAUF,GAAK,OAAO,IAAI,IAAWD,EAASC,GAAIA,EAAE3iB,UAAW2iB,EAAE/oB,KAAM+oB,EAAEvE,UAC7F,EAAC,QAAK,cAAe,SAAUuE,GAAK,OAAO,IAAI,IAAWD,EAASC,GAAIA,EAAEG,WAAYH,EAAE/oB,MAAQ+oB,EAAEI,aAAcJ,EAAEvE,UACjH,EAAC,QAAK,YAAa,SAAUuE,GAAK,OAAO,IAAI,IAAWD,EAASC,IAAI,WAAc,OAAO,IAAIA,EAAEK,WAAe,GAAIL,EAAEvE,UACrH,EAAC,QAAK,YAAa,SAAUuE,GAAK,OAAO,IAAI,IAAWD,EAASC,IAAI,WAAc,OAAOA,EAAEM,WAAa,GAAIN,EAAEvE,OAAQuE,EAAEM,YACzH,EAAC,QAAK,eAAgB,SAAUN,GAAK,OAAO,IAAI,IAAWD,EAASC,GAAI,KAAU,CAACA,EAAEO,aAAcP,EAAEvE,YAGrG+E,GAAmB,QAAQ,CAC3B,EAAC,SAAK,QAAK,OAAQ,MAAW,SAAU5nB,GAAS,OAAO,IAAI,IAAWA,EAAM8N,MAAO,KAAU,CAAC9N,EAAMzP,KAAMyP,EAAM6iB,UACjH,EAAC,SAAK,QAAK,OAAQ,MAAU,SAAU7iB,GAAS,OAAO,IAAI,IAAWA,EAAM8N,OAAO,QAAK9N,EAAMzP,KAAMyP,EAAMzP,IAAIlC,MAAM,GAAI,GAAI2R,EAAM6iB,UAClI,EAAC,SAAK,QAAK,OAAQ,MAAa,SAAU7iB,GAAS,OAAO,IAAI,IAAWA,EAAM8N,MAAO9N,EAAMzP,KA/BvErD,EA+BqF8S,EAAMzP,IA9B5GuM,EAAY,cAIT5P,EAAY,SAAM4P,GAAaA,EAAU0H,SAAStX,EAAI4P,EAAUuH,WAAc,YA0BiCrE,EAAM6iB,QA/BjH,IAAU31B,EACjB4P,MAiCJ+qB,GAAkB,QAAQ,CAC1B,EAAC,IAAApiB,IAAG,KAAa,SAAUqE,GAAK,OAAOA,IACvC,CA5BmB,SAAUtD,GAAO,SAAUA,EAAIsH,QAAStH,EAAI/B,YA4B5C6iB,GACnB,CA3BoB,SAAU9gB,GAC9B,SAAWA,EAAI6gB,UAAW7gB,EAAIsH,SAAWtH,EAAIkhB,UAAYlhB,EAAI+gB,YAAc/gB,EAAImhB,aAAenhB,EAAIihB,YA0B9EH,GACpB,CAxBiB,SAAU9gB,GAC3B,SAAUA,GAAOA,EAAIjW,OAAQ,QAASiW,EAAIjW,OAAQ,QAAQiW,EAAIjW,OAAQ,QAAWiW,EAAIjW,QAuBpEq3B,GACjB,EAAC,SAAI,GAAO,SAAUphB,GAAO,MAAM,IAAIxH,MAAM,2BAA4B,QAAUwH,QAInFshB,EAAO9tB,EAAMd,QAEjB,QADY,QAAQ4uB,GAAQA,GArDGZ,EAqDmBY,EArDPvF,EAqDavoB,EAAMkpB,eAAiB,GApDpEpjB,OAAOC,KAAKmnB,GAAc,IAAIhsB,KAAI,SAAU4S,GAAS,MAAO,CAC/DA,MAAOA,EACPvd,IAAK22B,EAAWpZ,GAChBzP,UAAMqC,EACNmiB,OAAQN,EAAgBzU,SAiDnB5S,IAAI2sB,GAcrB,IAAIE,EAA8B,WAC9B,SAASA,EAAaC,EAAS7mB,GAC3B5U,KAAKy7B,QAAUA,EACf,IArIyBC,EAqIrBhuB,EAAO1N,KACP4d,EAAO,WAAc,OAAO6d,EAAQ3a,KAAK,KACzCyZ,EAAS,SAAU9sB,GAAS,MAAsB,KAAfA,EAAMjI,MAM7CxF,KAAK27B,SAAW,CACZn2B,KAAM,CAACi0B,GACP/rB,KAAM,CAACgsB,GACPtf,OAAQ,CARZ,SAAuB3M,GACnB,OAAI8sB,EAAO9sB,GACA,KACJguB,EAAQ3a,KAAKpT,EAAKkuB,WAAWnuB,KAAWmQ,MAM/CjW,KAAM,CAACgyB,GAEPloB,IAAK,CAACmoB,EAAchlB,EAAmBgJ,IAEvCwc,UAAW,CAACE,EAAoBC,IAChCnsB,OAAQ,EAtJastB,EAsJK9mB,EAAkB8mB,aArJ7C,SAAuBjuB,GAC1B,IACIouB,EAAapuB,EAAMgE,KAAOhE,EAAMgE,IAAI4hB,WAAW,CAAEjU,SAAS,KAAa,GACvE0c,GAAe,SAAO,SAAO,QAAKruB,EAAMW,QAAU,GAAIytB,EAAUltB,KAAI,QAAK,SAFvD,SAAUpD,EAAQF,GAAM,OAAOqwB,EAAa9qB,WAAWvF,EAAI,KAAMoC,EAAMC,UAG7F,OAAOmuB,EACFz5B,OAAO05B,GACPntB,KAAI,SAAUksB,GAAK,MAAO,CAACA,EAAExvB,GAAIwvB,MACjCjsB,OAAO,KAAY,OAiJpB4L,MAAO,GAEPrS,KAAM,CAACqyB,GAEPlhB,SAAU,CAACmhB,GACX1iB,YAAa,CAAC2iB,IAgEtB,OA7DAc,EAAa35B,UAAUk6B,QAAU,SAAUv2B,EAAM7E,GAC7C,IAAIg7B,EAAW37B,KAAK27B,SAChBpc,EAAQoc,EAASn2B,IAAS,GAE9B,OAAI,QAASA,MAAU,QAAU7E,GACtB4e,EAAMnQ,OAAS,EAAImQ,EAAQA,EAAM,IACvC,QAAS/Z,KAAU,QAAW7E,IAEnCg7B,EAASn2B,GAAQ+Z,EACjBoc,EAASn2B,GAAM/E,KAAKE,GACb,WAAc,OAAOg7B,EAASn2B,GAAMga,OAAOmc,EAASn2B,GAAM0I,QAAQvN,EAAI,KAAO,YAJpF,GAaJ66B,EAAa35B,UAAUm6B,MAAQ,SAAUvuB,GACrC,IAAeguB,EAANz7B,KAAmBy7B,QAASE,EAA5B37B,KAA0C27B,SAC/CvhB,EAASpa,KAAK47B,WAAWnuB,GAC7B,GAAI2M,IAAWqhB,EAAQ3a,KAAK1G,OAAQjG,GAAW,GAC3C,OAAO,KAEX,IAAK,IAAItO,KAAO81B,EACZ,GAAKA,EAASj5B,eAAemD,GAA7B,CAEA,IAAIo2B,EAAQN,EAAS91B,GAAK+I,QAAO,SAAUstB,EAAUpS,GAAQ,OAAO,SAAUmD,GAAU,OAAOnD,EAAKmD,EAAQiP,MAAiB,MAC7HzuB,EAAM5H,GAAOo2B,EAAMxuB,GAEvB,OAAOA,GAEX+tB,EAAa35B,UAAU+5B,WAAa,SAAUnuB,GAE1C,IAAIjI,EAAOiI,EAAMjI,MAAQ,GAErB22B,EAAW32B,EAAKsd,MAAM,KAM1B,GAFoB,OAFFqZ,EAASC,OAGvBD,EAASC,MACTD,EAAS/sB,OAAQ,CACjB,GAAI3B,EAAM2M,OACN,MAAM,IAAI3H,MAAM,mFAAqFjN,EAAO,KAGhH,OAAO22B,EAASlpB,KAAK,KAEzB,OAAKxF,EAAM2M,QAEJ,QAAS3M,EAAM2M,QAAU3M,EAAM2M,OAAS3M,EAAM2M,OAAO5U,KADjD,IAGfg2B,EAAa35B,UAAU2D,KAAO,SAAUiI,GACpC,IAAIjI,EAAOiI,EAAMjI,KACjB,IAA2B,IAAvBA,EAAK0I,QAAQ,OAAgBT,EAAM2M,OACnC,OAAO5U,EACX,IAAIo2B,GAAa,QAASnuB,EAAM2M,QAAU3M,EAAM2M,OAAS3M,EAAM2M,OAAO5U,KACtE,OAAOo2B,EAAaA,EAAa,IAAMp2B,EAAOA,GAE3Cg2B,EA5FsB,iTClL7Ba,EAA8B,WAC9B,SAASA,EAAaC,GAClBt8B,KAAKs8B,QAAUA,EAmDnB,OAjDAD,EAAax6B,UAAU06B,WAAa,SAAUC,GAE1C,OAAkC,KADlCA,EAAYA,GAAa,IACRtuB,QAAQ,MAAyC,IAA3BsuB,EAAUtuB,QAAQ,MAE7DmuB,EAAax6B,UAAUif,KAAO,SAAU2b,EAAaC,EAAMC,GAEvD,QADkB,IAAdA,IAAwBA,GAAY,GACnCF,GAA+B,KAAhBA,EAApB,CAEA,IAAIG,GAAQ,QAASH,GACjBj3B,EAAOo3B,EAAQH,EAAcA,EAAYj3B,KACzCxF,KAAKu8B,WAAW/2B,KAChBA,EAAOxF,KAAK03B,YAAYlyB,EAAMk3B,IAClC,IAAIjvB,EAAQzN,KAAKs8B,QAAQ92B,GACzB,GAAIiI,IAAUmvB,KAAWA,GAAUnvB,IAAUgvB,GAAehvB,EAAMC,OAAS+uB,IACvE,OAAOhvB,EAEN,GAAImvB,GAASD,EAAW,CACzB,IACIzZ,GADU,QAAOljB,KAAKs8B,SACJhzB,QAAO,SAAU2jB,GAAU,OAAOA,EAAO4P,mBAAmBC,UAAY7P,EAAO4P,mBAAmBC,SAAS5Z,QAAQ1d,MAIzI,OAHI0d,EAAQ9T,OAAS,GACjB,UAAkB,iDAAmD5J,EAAO,gBAAiB0d,EAAQvU,KAAI,SAAUqN,GAAS,OAAOA,EAAMxW,SAEtI0d,EAAQ,MAIvBmZ,EAAax6B,UAAU61B,YAAc,SAAUlyB,EAAMk3B,GACjD,IAAKA,EACD,MAAM,IAAIjqB,MAAM,sCAAwCjN,EAAO,KAKnE,IAJA,IAAIu3B,EAAY/8B,KAAK8gB,KAAK4b,GACtBM,EAAYx3B,EAAKsd,MAAM,KACvBma,EAAaD,EAAU5tB,OACvBiO,EAAI,EAAGyI,EAAUiX,EACd1f,EAAI4f,EAAY5f,IACnB,GAAqB,KAAjB2f,EAAU3f,IAAmB,IAANA,EAA3B,CAIA,GAAqB,MAAjB2f,EAAU3f,GAMd,MALI,IAAKyI,EAAQ1L,OACT,MAAM,IAAI3H,MAAM,SAAWjN,EAAO,0BAA4Bu3B,EAAUv3B,KAAO,KACnFsgB,EAAUA,EAAQ1L,YANlB0L,EAAUiX,EAWlB,IAAIG,EAAUF,EAAUl7B,MAAMub,GAAGpK,KAAK,KACtC,OAAO6S,EAAQtgB,MAAQsgB,EAAQtgB,MAAQ03B,EAAU,IAAM,IAAMA,GAE1Db,EArDsB,oWCW7Bc,EAA6B,WAE7B,SAASA,EAAY5xB,GACjB,OAAO4xB,EAAY37B,OAAO+J,GAAU,IA4FxC,OAlFA4xB,EAAY37B,OAAS,SAAU47B,GAC3BA,EAAYD,EAAYE,aAAaD,GAAa,IAAIA,EAAcA,EACpE,IAAI3vB,GAAQ,SAAQ,QAAQ2vB,EAAWD,EAAYt7B,YAMnD,OALAu7B,EAAUppB,QAAU,WAAc,OAAOvG,GACzCA,EAAMC,KAAO0vB,EACb3vB,EAAMovB,mBAAqB,CACvBC,SAAU,eAAgBrvB,EAAMjI,OAE7BiI,GAaX0vB,EAAYt7B,UAAUqX,GAAK,SAAUokB,GACjC,OAAOt9B,OAASs9B,GAAOt9B,KAAK0N,OAAS4vB,GAAOt9B,KAAKsL,QAAUgyB,GAM/DH,EAAYt7B,UAAUyJ,IAAM,WACxB,KAAKtL,KAAKoa,QAAYpa,KAAKoa,kBAAkBpa,KAAKokB,aAC9C,OAAOpkB,KAAKwF,KAChB,IAAIA,EAAOxF,KAAKoa,OAAO9O,MACvB,OAAO9F,EAAOA,EAAO,IAAMxF,KAAKwF,KAAOxF,KAAKwF,MAOhD23B,EAAYt7B,UAAU+b,KAAO,WACzB,OAAQ5d,KAAKoa,QAAUpa,KAAKoa,OAAOwD,QAAW5d,MAWlDm9B,EAAYt7B,UAAUwxB,WAAa,SAAUzyB,GAGzC,QAFAA,GAAO,QAASA,EAAM,CAAEwe,SAAS,EAAMme,aAAc,QAC/Bne,SAAWpf,KAAKoa,QAAUpa,KAAKoa,OAAOiZ,cAAiB,IAExEjxB,QAAO,QAAOpC,KAAKoO,SACnB9E,QAAO,SAAU0F,GAAS,OAAQpO,EAAK28B,cAAgB38B,EAAK28B,aAAa76B,eAAesM,EAAM3D,QASvG8xB,EAAYt7B,UAAU4xB,UAAY,SAAUpoB,EAAIzK,GAE5C,YADa,IAATA,IAAmBA,EAAO,IACrBZ,KAAKyR,KAAOzR,KAAKyR,IAAIgiB,UAAUpoB,EAAIzK,KACxC,SAAK,QAAOZ,KAAKoO,SAAS,QAAO,KAAM/C,KACtCzK,EAAKwe,SAAWpf,KAAKoa,QAAUpa,KAAKoa,OAAOqZ,UAAUpoB,IAE9D8xB,EAAYt7B,UAAUiT,SAAW,WAC7B,OAAO9U,KAAKsL,OAGhB6xB,EAAYE,aAAe,SAAUD,GACjC,OAAO,QAAWA,KAA+C,IAAjCA,EAA2B,iBAG/DD,EAAYK,mBAAqB,SAAUvjB,GAAO,OAAO,QAAWA,EAAa,UAEjFkjB,EAAYM,QAAU,SAAUxjB,GAAO,OAAO,QAASA,EAAwB,qBACxEkjB,EA/FqB,kPCZ5BO,EAAmC,WACnC,SAASA,EAAkBhpB,EAAQsY,EAAQ+O,EAAS4B,GAChD39B,KAAK0U,OAASA,EACd1U,KAAKgtB,OAASA,EACdhtB,KAAK+7B,QAAUA,EACf/7B,KAAK29B,UAAYA,EACjB39B,KAAK49B,MAAQ,GA4EjB,OA1EAF,EAAkB77B,UAAUqT,QAAU,WAClClV,KAAK49B,MAAQ,IAEjBF,EAAkB77B,UAAU6X,SAAW,SAAU0jB,GAC7C,IAAIQ,EAAQ59B,KAAK49B,MACbnwB,EAAQ,WAAmB2vB,GAC3B53B,EAAOiI,EAAMjI,KACjB,KAAK,QAASA,GACV,MAAM,IAAIiN,MAAM,gCACpB,GAAIzS,KAAKgtB,OAAOtqB,eAAe8C,KAAS,QAAQo4B,EAAMjvB,KAAI,QAAK,SAAUnJ,GACrE,MAAM,IAAIiN,MAAM,UAAYjN,EAAO,wBAGvC,OAFAo4B,EAAMn9B,KAAKgN,GACXzN,KAAK69B,QACEpwB,GAEXiwB,EAAkB77B,UAAUg8B,MAAQ,WAchC,IAbA,IAAI1tB,EAAQnQ,KACRqrB,EAAKrrB,KAAM49B,EAAQvS,EAAGuS,MAAO5Q,EAAS3B,EAAG2B,OAAQ+O,EAAU1Q,EAAG0Q,QAC9D+B,EAAa,GACjBC,EAAU,GACVC,EAAsB,GAClBC,EAAW,SAAUz4B,GAAQ,OAAO2K,EAAM6c,OAAOtqB,eAAe8C,IAAS2K,EAAM6c,OAAOxnB,IACtF04B,EAAkB,WACdJ,EAAW1uB,QACXe,EAAMwtB,UAAU58B,SAAQ,SAAUo9B,GAC9B,OAAOA,EAAS,aAAcL,EAAWnvB,KAAI,SAAUyO,GAAK,OAAOA,EAAE1P,aAI1EkwB,EAAMxuB,OAAS,GAAG,CACrB,IAAI3B,EAAQmwB,EAAM37B,QACdm8B,EAAS3wB,EAAMjI,KACfc,EAASy1B,EAAQC,MAAMvuB,GACvB4wB,EAAYN,EAAQ7vB,QAAQT,GAChC,GAAInH,EAAJ,CACI,IAAIg4B,EAAgBL,EAASG,GAC7B,GAAIE,GAAiBA,EAAc94B,OAAS44B,EACxC,MAAM,IAAI3rB,MAAM,UAAY2rB,EAAS,wBAEzC,IAAIG,EAAsBN,EAASG,EAAS,OACxCG,GAEAv+B,KAAK0U,OAAOkC,cAAc4nB,WAAWD,GAEzCvR,EAAOoR,GAAU3wB,EACjBzN,KAAKy+B,YAAYhxB,GACb4wB,GAAa,GACbN,EAAQve,OAAO6e,EAAW,GAC9BP,EAAWr9B,KAAKgN,OAdpB,CAiBA,IAAIixB,EAAOV,EAAoBI,GAE/B,GADAJ,EAAoBI,GAAUR,EAAMxuB,OAChCivB,GAAa,GAAKK,IAASd,EAAMxuB,OAKjC,OAFAwuB,EAAMn9B,KAAKgN,GACXywB,IACOlR,EAEFqR,EAAY,GACjBN,EAAQt9B,KAAKgN,GAEjBmwB,EAAMn9B,KAAKgN,IAGf,OADAywB,IACOlR,GAEX0Q,EAAkB77B,UAAU48B,YAAc,SAAUhxB,GAChD,IAAIA,EAAMkxB,UAAalxB,EAAMgE,IAA7B,CAEA,IAAImtB,EAAW5+B,KAAK0U,OAAOuC,WAAW0F,MACtCiiB,EAASriB,KAAKqiB,EAASC,eAAer9B,OAAOiM,MAE1CiwB,EAlF2B,sbCQlCoB,EAA+B,WAE/B,SAASA,EAAcpqB,GACnB1U,KAAK0U,OAASA,EACd1U,KAAKgtB,OAAS,GAEdhtB,KAAK29B,UAAY,GACjB39B,KAAKy7B,QAAU,IAAI,IAAaz7B,KAAKgtB,QACrChtB,KAAK+7B,QAAU,IAAI,IAAa/7B,KAAKy7B,QAAS/mB,EAAOE,mBACrD5U,KAAK++B,WAAa,IAAI,IAAkBrqB,EAAQ1U,KAAKgtB,OAAQhtB,KAAK+7B,QAAS/7B,KAAK29B,WAChF39B,KAAKg/B,gBAmJT,OAhJAF,EAAcj9B,UAAUm9B,cAAgB,YAUvBh/B,KAAKi/B,MAAQj/B,KAAK++B,WAAWrlB,SATvB,CACflU,KAAM,GACNiM,IAAK,IACL+I,MAAO,KACPpM,OAAQ,CACJ,IAAK,CAAE5J,MAAO,KAAM0K,KAAM,OAAQye,SAAS,IAE/CgR,UAAU,KAGRvE,UAAY,MAGtB0E,EAAcj9B,UAAUqT,QAAU,WAC9B,IAAI/E,EAAQnQ,KACZA,KAAK++B,WAAW7pB,UAChBlV,KAAK29B,UAAY,GACjB39B,KAAK0Q,MAAM3P,SAAQ,SAAU0M,GAAS,OAAO0C,EAAMO,IAAIjD,IAAU0C,EAAMquB,WAAW/wB,OAgCtFqxB,EAAcj9B,UAAUq9B,gBAAkB,SAAUf,GAEhD,OADAn+B,KAAK29B,UAAUl9B,KAAK09B,GACb,YACH,QAAWn+B,KAAK29B,UAAhB,CAA2BQ,IAC7B76B,KAAKtD,OAWX8+B,EAAcj9B,UAAU+b,KAAO,WAC3B,OAAO5d,KAAKi/B,OAchBH,EAAcj9B,UAAU6X,SAAW,SAAUylB,GACzC,OAAOn/B,KAAK++B,WAAWrlB,SAASylB,IAGpCL,EAAcj9B,UAAUu9B,gBAAkB,SAAU3xB,GAChD,IAAI0C,EAAQnQ,KACRyb,EAAMzb,KAAK0Q,MAAM/B,KAAI,SAAUyO,GAAK,OAAOA,EAAEpJ,aAC7CqrB,EAAc,SAAUrS,GACxB,IAAIsS,EAAY7jB,EAAInS,QAAO,SAAU8T,GAAK,OAAqC,IAA9B4P,EAAO9e,QAAQkP,EAAEhD,WAClE,OAA4B,IAArBklB,EAAUlwB,OAAekwB,EAAYA,EAAUl9B,OAAOi9B,EAAYC,KAEzE12B,EAAWy2B,EAAY,CAAC5xB,IACxB8xB,EAAe,CAAC9xB,GAAOrL,OAAOwG,GAAUoX,UAW5C,OAVAuf,EAAax+B,SAAQ,SAAUksB,GAC3B,IAAI2R,EAAWzuB,EAAMuE,OAAOuC,WAAW0F,MAEvCiiB,EACKjiB,QACArT,QAAO,QAAO,QAAS2jB,IACvBlsB,SAAQ,SAAUwb,GAAQ,OAAOqiB,EAASY,WAAWjjB,aAEnDpM,EAAM6c,OAAOC,EAAOznB,SAExB+5B,GAWXT,EAAcj9B,UAAU28B,WAAa,SAAU/B,GAC3C,IAAIxP,EAASjtB,KAAK0Q,IAAI+rB,GACtB,IAAKxP,EACD,MAAM,IAAIxa,MAAM,sCAAwCgqB,GAC5D,IAAIgD,EAAqBz/B,KAAKo/B,gBAAgBnS,EAAOjZ,WAIrD,OAHAhU,KAAK29B,UAAU58B,SAAQ,SAAUo9B,GAC7B,OAAOA,EAAS,eAAgBsB,EAAmB9wB,KAAI,SAAUyO,GAAK,OAAOA,EAAE1P,YAE5E+xB,GAEXX,EAAcj9B,UAAU6O,IAAM,SAAU+rB,EAAaC,GACjD,IAAIvsB,EAAQnQ,KACZ,GAAyB,IAArBgC,UAAUoN,OACV,OAAOmE,OAAOC,KAAKxT,KAAKgtB,QAAQre,KAAI,SAAUnJ,GAAQ,OAAO2K,EAAM6c,OAAOxnB,GAAMkI,QACpF,IAAIgyB,EAAQ1/B,KAAKy7B,QAAQ3a,KAAK2b,EAAaC,GAC3C,OAAQgD,GAASA,EAAMhyB,MAAS,MAYpCoxB,EAAcj9B,UAAUiV,UAAY,SAAU6oB,EAAUC,GACpD,OAAO5/B,KAAK+7B,QAAQA,QAAQ4D,EAAUC,IAEnCd,EA7JuB,2SCsB9Be,EAA6B,WAe7B,SAASA,EAAYC,EAAgBC,EAAaC,EAASC,GACvDjgC,KAAK8/B,eAAiBA,EACtB9/B,KAAK+/B,YAAcA,EACnB//B,KAAK+/B,YAAcA,EACnB//B,KAAKggC,SAAU,QAAO,GAAIA,GAAW,IACrChgC,KAAKigC,UAAW,QAAO,GAAIA,GAAY,IACvCjgC,KAAKkgC,YAAcJ,EAAerE,QAAQ3a,KAAKif,EAAa//B,KAAKigC,SAASE,UAsF9E,OAnFAN,EAAYh+B,UAAU2D,KAAO,WACzB,OAAQxF,KAAKkgC,aAAelgC,KAAKkgC,YAAY16B,MAASxF,KAAK+/B,aAG/DF,EAAYh+B,UAAU4qB,WAAa,WAC/B,OAAOzsB,KAAK+/B,aAGhBF,EAAYh+B,UAAUuM,OAAS,WAC3B,OAAOpO,KAAKggC,SAGhBH,EAAYh+B,UAAU4W,OAAS,WAC3B,OAAOzY,KAAKkgC,aAGhBL,EAAYh+B,UAAU4L,MAAQ,WAC1B,OAAOzN,KAAKkgC,aAAelgC,KAAKkgC,YAAYxyB,MAGhDmyB,EAAYh+B,UAAU1B,QAAU,WAC5B,OAAOH,KAAKigC,UAGhBJ,EAAYh+B,UAAUu+B,OAAS,WAC3B,SAAUpgC,KAAKkgC,cAAelgC,KAAKkgC,YAAYxyB,OAGnDmyB,EAAYh+B,UAAUw+B,MAAQ,WAC1B,OAAQrgC,KAAKqF,SAGjBw6B,EAAYh+B,UAAUwD,MAAQ,WAC1B,IAAIq3B,EAAO18B,KAAKG,UAAUggC,SAC1B,IAAKngC,KAAKkgC,aAAiBxD,EAAM,CAC7B,IAAIF,EAAYE,EAAKl3B,KAAOk3B,EAAKl3B,KAAOk3B,EACxC,MAAO,sBAAwB18B,KAAKwF,OAAS,iBAAmBg3B,EAAY,IAEhF,OAAKx8B,KAAKkgC,YAELlgC,KAAKkgC,YAAYxyB,UAAtB,EACW,UAAY1N,KAAKwF,OAAS,8BAF1B,kBAAoBxF,KAAKwF,OAAS,KAIjDq6B,EAAYh+B,UAAUiT,SAAW,WAC7B,MAAO,IAAM9U,KAAKwF,OAAS,KAAM,QAAUxF,KAAKoO,WAQpDyxB,EAAYh+B,UAAUy+B,UAAY,SAAU7yB,GACxC,OAAO,IAAIoyB,EAAY7/B,KAAK8/B,eAAgBryB,EAAOzN,KAAKggC,QAAShgC,KAAKigC,WAS1EJ,EAAYh+B,UAAU0+B,WAAa,SAAUnyB,EAAQ2G,QACjC,IAAZA,IAAsBA,GAAU,GACpC,IAAI8d,EAAY9d,EAAU3G,GAAS,QAAO,GAAIpO,KAAKggC,QAAS5xB,GAC5D,OAAO,IAAIyxB,EAAY7/B,KAAK8/B,eAAgB9/B,KAAK+/B,YAAalN,EAAW7yB,KAAKigC,WASlFJ,EAAYh+B,UAAU2+B,YAAc,SAAUrgC,EAAS4U,QACnC,IAAZA,IAAsBA,GAAU,GACpC,IAAI0rB,EAAU1rB,EAAU5U,GAAU,QAAO,GAAIH,KAAKigC,SAAU9/B,GAC5D,OAAO,IAAI0/B,EAAY7/B,KAAK8/B,eAAgB9/B,KAAK+/B,YAAa//B,KAAKggC,QAASS,IAGhFZ,EAAYa,MAAQ,SAAUzmB,GAC1B,OAAOA,GAAOA,EAAIxM,SAAU,QAASwM,EAAIxM,SAAW,QAASwM,EAAIxM,SAAU,QAASwM,EAAIxM,MAAMjI,QAE3Fq6B,EA3GqB,iYCf5Bc,EAA6B,WAC7B,SAASA,EAAY1U,GACjBjsB,KAAKisB,WAAaA,EA2EtB,OAzEA0U,EAAY9+B,UAAU++B,mBAAqB,SAAUC,GACjD,IAAI1wB,EAAQnQ,KAEZ,OADmBA,KAAKisB,WAAWvX,OAAOoY,kBACtB9iB,WACf82B,WAAWD,GACXlyB,KAAI,SAAUO,GAAQ,OAAOiB,EAAM4wB,WAAW7xB,MAC9CN,OAAO,KAAS,IAChBtF,OAAO,OAWhBq3B,EAAY9+B,UAAUk/B,WAAa,SAAUC,GACzC,IAAI/U,EAAajsB,KAAKisB,WAClBvd,EAAcud,EAAWvd,cAEzBuyB,EAAgBjhC,KAAKkhC,iBAAiBF,EAAUtyB,EAAaud,GACjE,IAAKgV,EACD,MAAO,GACX,IA4DWE,EA5DPC,EAAkB,CAClBnV,WAAYA,EACZnG,QAASmG,EAAW9rB,UAAU2lB,SAkBlC,OAAOmb,EACFtyB,KAjBqB,SAAUkF,GAMhC,OAJcA,EAAKqP,QAAQxU,EAAaud,GAEZ+U,EAASK,kBAAkB77B,MAElCmJ,KAAI,SAAUJ,GAC/B,IAAI0xB,GAAW,QAAO,CAClB38B,KAAMuQ,EAAKvQ,KACXg+B,UAAW,CAAEN,SAAUA,EAASx7B,KAAMqL,QAAStC,IAChD6yB,GACC3zB,EAAQuzB,EAASK,kBAAkBv+B,QAAU,UAA4ByL,EAAKd,MAAMC,KAAO,KAC3F6zB,EAAiB,IAAI,IAAetV,EAAYxe,EAAOoG,EAAMosB,GACjE,MAAO,CAAEpsB,KAAMA,EAAMtF,KAAMA,EAAMgzB,eAAgBA,SAKpD3yB,OAAO,KAAS,IAChB4c,MAqCM2V,EArCSH,EAASQ,iBAsCR,IAArBL,IAA+BA,GAAmB,GAC/C,SAA+B1O,EAAGlV,GACrC,IAAIkkB,EAASN,GAAoB,EAAI,EACjCO,GAAcjP,EAAElkB,KAAKd,MAAMtF,KAAKiH,OAASmO,EAAEhP,KAAKd,MAAMtF,KAAKiH,QAAUqyB,EACzE,OAAsB,IAAfC,EAAmBA,EAAankB,EAAE1J,KAAKzM,SAAWqrB,EAAE5e,KAAKzM,YAzC3DuH,KAAI,SAAU8E,GAAS,OAAOA,EAAM8tB,mBAa7CZ,EAAY9+B,UAAUq/B,iBAAmB,SAAUF,EAAUtyB,EAAaud,GACtE,IAAI0V,EAAWX,EAASY,YAAc,WAElC/6B,EAAe7G,KAAKisB,WAAWvX,OAAOoY,kBAE1C,OADiB6U,EAAW,CAAC96B,GAAgB,CAAC7G,KAAKisB,WAAYplB,IAE1D8H,KAAI,SAAUkzB,GAAO,OAAOA,EAAIC,SAASd,EAASx7B,SAClD8D,QAAO,QAAgB,KAAS,uBAAyB03B,EAASx7B,OAClEoJ,OAAO,KAAS,IAChBtF,QAAO,SAAUuK,GAAQ,OAAOA,EAAKqP,QAAQxU,EAAaud,OAE5D0U,EA7EqB,+PCDzB,SAASoB,EAAWt0B,EAAOu0B,EAAW/V,GACzC,IAAIgW,GAAU,QAASD,GAAa,CAACA,GAAaA,EAYlD,UADe,QAAWC,GAAWA,EAVrC,SAAoBhV,GAEhB,IADA,IAAIiV,EAAcD,EACT5kB,EAAI,EAAGA,EAAI6kB,EAAY9yB,OAAQiO,IAAK,CACzC,IAAIwF,EAAO,IAAI,KAAKqf,EAAY7kB,IAChC,GAAKwF,GAAQA,EAAKK,QAAQ+J,EAAOznB,QAAYqd,GAAQqf,EAAY7kB,KAAO4P,EAAOznB,KAC3E,OAAO,EAGf,OAAO,IAGMiI,EAAOwe,GAK5B,IAAIkW,EAAgC,WAChC,SAASA,EAAeC,EAASC,EAAW7hC,EAAU8hC,EAAeC,EAAwBpiC,QACzE,IAAZA,IAAsBA,EAAU,IACpCH,KAAKoiC,QAAUA,EACfpiC,KAAKqiC,UAAYA,EACjBriC,KAAKQ,SAAWA,EAChBR,KAAKsiC,cAAgBA,EACrBtiC,KAAKuiC,uBAAyBA,EAC9BviC,KAAKwiC,YAAc,EACnBxiC,KAAKyiC,eAAgB,EACrBziC,KAAKoH,SAAWjH,EAAQiH,UAAY,EACpCpH,KAAKsD,KAAOnD,EAAQmD,MAAQ,KAC5BtD,KAAK0iC,YAAcviC,EAAQuiC,YAqF/B,OApEAP,EAAetgC,UAAU8gC,eAAiB,SAAUC,EAAOZ,EAAW/V,GAClE,IAAkB,IAAd+V,EACA,OAAOY,EACX,IAAIpN,EAAWoN,EAAMt5B,QAAO,SAAUiF,GAAQ,OAAOwzB,EAAWxzB,EAAKd,MAAOu0B,EAAW/V,MACvF,OAAOuJ,EAASpmB,OAASomB,EAAW,MAgBxC2M,EAAetgC,UAAUghC,yBAA2B,WAChD,OAAO,QAAO7iC,KAAKoiC,QAAQp4B,WAAW84B,iBAAiB,WAAc,OAAO,MAiBhFX,EAAetgC,UAAUkhC,kBAAoB,SAAUr0B,EAAaud,GAChE,IAAI9b,EAAQnQ,KACR8P,GAAW,QAAO9P,KAAK6iC,2BAA4B7iC,KAAKsiC,eAE5D,OADY,QAAOtiC,KAAKoiC,QAAQp4B,WAAW84B,iBAC9Bl0B,QAAO,SAAUo0B,EAAIC,GAG9B,IAAIC,EAAcD,EAASngC,QAAU,UACjCqF,EAAOuG,EAAYu0B,EAASz9B,OAAS,GACrCo9B,EAAQM,EAAc/6B,EAAO,EAAC,QAAKA,IAEvC,OADA66B,EAAGC,EAASz9B,MAAQ2K,EAAMwyB,eAAeC,EAAO9yB,EAASmzB,EAASz9B,MAAOymB,GAClE+W,IACR,KAQPb,EAAetgC,UAAUqhB,QAAU,SAAUxU,EAAaud,GACtD,IAAI/I,EAAUljB,KAAK+iC,kBAAkBr0B,EAAaud,GAGlD,OADiB,QAAO/I,GAASigB,MAAM,MACnBjgB,EAAU,MAElCif,EAAetgC,UAAU28B,WAAa,WAClCx+B,KAAKuiC,uBAAuBviC,MAC5BA,KAAKyiC,eAAgB,GAElBN,EAjGwB,GAqG5B,SAASiB,EAAUtP,EAAUhH,EAAmBuV,GAEnD,IACIgB,GADoBvP,EAASwP,iBAAmBxP,EAASwP,kBAAoB,IACnDjB,EAAU78B,MAAQ,GAC5C+9B,GAAe,QAAWF,GAG9B,SAASG,EAAmBC,EAAajjC,EAAUL,QAC/B,IAAZA,IAAsBA,EAAU,IACpC,IAAI6pB,EAAiB,IAAImY,EAAerV,EAAmBuV,EAAW7hC,EAAUijC,EAAaF,EAAcpjC,GAE3G,OADAkjC,EAAM5iC,KAAKupB,GACJA,EAAewU,WAAWl7B,KAAK0mB,GAE1C,OAPA8J,EAASuO,EAAU78B,MAAQg+B,EAOpBA,2FCpJX,IAAIE,EAQAC,2BAPJ,SAAWD,GACPA,EAAoBA,EAA4B,OAAI,GAAK,SACzDA,EAAoBA,EAA4B,OAAI,GAAK,SACzDA,EAAoBA,EAAyB,IAAI,GAAK,MACtDA,EAAoBA,EAA6B,QAAI,GAAK,UAC1DA,EAAoBA,EAA2B,MAAI,GAAK,QAL5D,CAMGA,IAAwBA,EAAsB,KAEjD,SAAWC,GACPA,EAAoBA,EAAgC,WAAI,GAAK,aAC7DA,EAAoBA,EAA2B,MAAI,GAAK,QAF5D,CAGGA,IAAwBA,EAAsB,8HCP7CC,2LACJ,SAAWA,GAOPA,EAAWA,EAAuB,WAAI,GAAK,aAM3CA,EAAWA,EAAoB,QAAI,GAAK,UAMxCA,EAAWA,EAAoB,QAAI,GAAK,UAWxCA,EAAWA,EAAoB,QAAI,GAAK,UAMxCA,EAAWA,EAAkB,MAAI,GAAK,QApC1C,CAqCGA,IAAeA,EAAa,KAG/B,IAAIv4B,EAAK,EACLw4B,EAA2B,WAC3B,SAASA,EAAU30B,EAAM40B,EAASC,GAE9B/jC,KAAKmb,IAAM9P,IACXrL,KAAKkP,KAAOA,EACZlP,KAAK8jC,QAAUA,EACf9jC,KAAK+jC,OAASA,EA4DlB,OAzDAF,EAAUG,mBAAqB,SAAU/pB,GACrC,OAAOA,GAA2B,mBAAbA,EAAIlP,OAAuB,IAAAmO,IAAG2qB,EAAH,CAAc5pB,EAAIyN,uBAGtEmc,EAAUI,WAAa,SAAUF,EAAQ5jC,GACrC,IACI+jC,EAAY,IAAIL,EAAUD,EAAWO,WAD3B,+DACgDJ,GAI9D,OAHI5jC,GAAWA,EAAQikC,aACnBF,EAAUE,YAAa,GAEpBF,GAGXL,EAAUO,WAAa,SAAUL,GAC7B,OAAOF,EAAUI,WAAWF,EAAQ,CAAEK,YAAY,KAGtDP,EAAUQ,QAAU,SAAUN,GAE1B,OAAO,IAAIF,EAAUD,EAAWU,QADlB,6BACoCP,IAGtDF,EAAUzK,QAAU,SAAU2K,GAE1B,OAAO,IAAIF,EAAUD,EAAWW,QADlB,6BACoCR,IAGtDF,EAAUW,QAAU,SAAUT,GAE1B,OAAO,IAAIF,EAAUD,EAAWa,QADlB,kCACoCV,IAGtDF,EAAUa,QAAU,SAAUX,GAE1B,OAAO,IAAIF,EAAUD,EAAWe,MADlB,yBACkCZ,IAWpDF,EAAUe,UAAY,SAAUb,GAC5B,OAAO,IAAA7qB,IAAG2qB,EAAH,CAAcE,GAAUA,EAASF,EAAUa,QAAQX,IAE9DF,EAAUhiC,UAAUiT,SAAW,WAC3B,IAA6BqkB,EACzB4K,GADyB5K,EACHn5B,KAAK+jC,SADgB5K,EAAErkB,WAAavB,OAAO1R,UAAUiT,SAAWqkB,EAAErkB,YAAa,QAAUqkB,GAE/G9N,EAAKrrB,KACT,MAAO,6BADcqrB,EAAGlQ,IACoB,UADRkQ,EAAGnc,KACwB,cADRmc,EAAGyY,QAC+B,aAAeC,EAAS,KAErHF,EAAUhiC,UAAUgjC,UAAY,WAC5B,OAAO,SAAO,QAAgB7kC,MAAO,CAAE0nB,qBAAsB1nB,QAE1D6jC,EAlEmB,oMC1C1BiB,EAEA,SAA6Bt/B,EAAMo8B,EAAWmD,EAAW1D,EAAmBG,EAAawD,EAAkBC,EAAiBC,QACpG,IAAhB1D,IAA0BA,GAAc,QACnB,IAArBwD,IAA+BA,EAAmB,wBAC9B,IAApBC,IAA8BA,EAAkB,uBAChC,IAAhBC,IAA0BA,GAAc,GAC5CllC,KAAKwF,KAAOA,EACZxF,KAAK4hC,UAAYA,EACjB5hC,KAAK+kC,UAAYA,EACjB/kC,KAAKqhC,kBAAoBA,EACzBrhC,KAAKwhC,YAAcA,EACnBxhC,KAAKglC,iBAAmBA,EACxBhlC,KAAKilC,gBAAkBA,EACvBjlC,KAAKklC,YAAcA,gsBCVvBC,EAAiB,CACjBrf,QAAS,KACTmG,WAAY,KACZqV,UAAW,GACXh+B,KAAM,MAEN8hC,EAAgC,WAChC,SAASA,EAAenZ,EAAYoZ,EAAcrb,EAAgB7pB,GAC9D,IAAIgQ,EAAQnQ,KACZA,KAAKisB,WAAaA,EAClBjsB,KAAKqlC,aAAeA,EACpBrlC,KAAKgqB,eAAiBA,EACtBhqB,KAAKG,QAAUA,EACfH,KAAKslC,aAAe,WAAc,OAAOn1B,EAAMjB,KAAK0yB,YAAc,UAA4BzxB,EAAMhQ,QAAQ8rB,WAAWsZ,YACvHvlC,KAAKG,SAAU,QAASA,EAASglC,GACjCnlC,KAAKkP,KAAO8a,EAAeqY,UAyK/B,OArJA+C,EAAenJ,MAAQ,SAAUoH,EAAOmC,GAGpC,OAAOnC,EAAMz0B,QADU,SAAU8vB,EAAM+G,GAAY,OAAO/G,EAAK3zB,MAAK,WAAc,OAAO06B,EAASC,kBAC5DF,GAAW,gBAarDJ,EAAeO,YAAc,SAAUtC,EAAOuC,GAC1C,IAAK,IAAI32B,EAAM,EAAGA,EAAMo0B,EAAMj0B,OAAQH,IAAO,CACzC,IAAIib,EAAamZ,EAAMp0B,GAAKy2B,aAC5B,IAAI,QAAUxb,GAAa,CACvB,IAAI2b,EAAiBxC,EAAMvhC,MAAMmN,EAAM,GACvC,OAAOm2B,EAAenJ,MAAM4J,EAAgB3b,GAAYnf,KAAK66B,IAGrE,OAAOA,KAKXR,EAAeU,YAAc,SAAUzC,GACnCA,EAAMtiC,SAAQ,SAAU8S,GAAQ,OAAOA,EAAK6xB,iBAEhDN,EAAevjC,UAAUkkC,SAAW,SAAU7Y,GAC1CltB,KAAKisB,WAAWvX,OAAOmC,aAAamvB,qBAApChmC,CAA0DktB,IAE9DkY,EAAevjC,UAAU6jC,WAAa,WAClC,IAAIv1B,EAAQnQ,KACR6T,EAAO7T,KAAKgqB,eAChB,IAAInW,EAAK4uB,cAAT,CAEA,IAAIwD,EAAajmC,KAAKkmC,yBACtB,GAAID,EACA,OAAOA,EACX,IAAI9lC,EAAUH,KAAKG,QACnB,yBAA0BH,KAAMA,KAAKisB,WAAY9rB,GACjD,IAEIgmC,EAAc,SAAUjZ,GAAO,OAAOrZ,EAAKwuB,UAAU4C,gBAAgB90B,EAA/B0D,CAAsCqZ,IAC5EkZ,EAAe,SAAU9/B,GAAU,OAAOuN,EAAKwuB,UAAU2C,iBAAiB70B,EAAhC0D,CAAuCvN,IACrF,IACI,IAAIA,EALkCuN,EAAKrT,SAASuB,KAAK5B,EAAQmD,KAAM6M,EAAM8b,WAAY9b,EAAMk1B,cAM/F,OAAKrlC,KAAKkP,KAAKg2B,cAAe,QAAU5+B,GAC7BA,EAAO+b,OANH,SAAU6K,GAAO,OAAO,cAAoBA,GAAK2X,eAM1B95B,KAAKq7B,EAAcD,GAG9CC,EAAa9/B,GAG5B,MAAO4mB,GAEH,OAAOiZ,EAAY,cAAoBjZ,IAE3C,QACQrZ,EAAK6uB,eAAiB7uB,EAAK2uB,aAAe3uB,EAAK6uB,aAC/C7uB,EAAK2qB,gBAajB4G,EAAevjC,UAAUwkC,iBAAmB,SAAU//B,GAClD,IAAI6J,EAAQnQ,KAEZ,OADiBA,KAAKkmC,4BAIlB,QAAU5/B,GAEHA,EAAOyE,MAAK,SAAU/G,GAAO,OAAOmM,EAAMk2B,iBAAiBriC,OAEtE,qBAAsBsC,EAAQtG,KAAKisB,WAAYjsB,KAAKG,UAErC,IAAXmG,EAEO,YAAkB,2BAA2Bu+B,aAEpC,IAAA3rB,IAAG,IAEnBotB,CAAchgC,GAEP,eAAqBA,GAAQu+B,iBAFxC,KASJO,EAAevjC,UAAUqkC,uBAAyB,WAC9C,IAAIxxB,EAAS1U,KAAKisB,WAAWvX,OAE7B,OAAIA,EAAOqkB,UACA,YAAkB,sBAAwBrkB,EAAOyG,IAAM,gCAAgC0pB,YAE9F7kC,KAAKisB,WAAWsa,SACT,cAAoB1B,YAI3B7kC,KAAKslC,eAEE,eAAqBtlC,KAAKG,QAAQ2lB,WAAW+e,iBAFxD,GAKJO,EAAevjC,UAAUiT,SAAW,WAChC,IAAe3U,EAANH,KAAmBG,QAAS6pB,EAA5BhqB,KAAgDgqB,eACrDzpB,GAAQ,QAAM,qBAAN,CAA4BJ,IAAY,WAAY0Q,GAAU,QAAM,+BAAN,CAAsC1Q,KAAY,QAAM,oBAAN,CAA2BA,IAAY,UAAWqF,GAAO,QAAWwkB,EAAexpB,UAC/M,OAAOD,EAAQ,aAAesQ,EAAU,MAAO,QAAU,IAAKrL,IAMlE4/B,EAAeoB,cAAgB,SAAU3yB,GAAQ,OAAO,SAAUvN,GAC9D,OAAOuN,EAAKwyB,iBAAiB//B,KAMjC8+B,EAAeqB,oBAAsB,SAAU5yB,GAAQ,OAAO,SAAUvN,IACpE,QAAUA,IAAWA,EAAO+b,OAAM,SAAU6K,GAAO,OAAOrZ,EAAKkyB,SAAS,cAAoB7Y,SAOhGkY,EAAesB,UAAY,SAAU7yB,GAAQ,OAAO,SAAUxO,GAAS,OAAOwO,EAAKkyB,SAAS1gC,KAC5F+/B,EAAeuB,aAAe,SAAU9yB,GAAQ,OAAO,SAAUxO,GAAS,OAAO,QAAgBA,KACjG+/B,EAAewB,YAAc,SAAU/yB,GAAQ,OAAO,SAAUxO,GAC5D,MAAMA,IAEH+/B,EAlLwB,qgBCXnC,SAASyB,EAAmBj3B,GACxBA,EAAMk3B,cAAc,cAAoB,IAAUl3B,EAAM8E,QAAS,IACjE9E,EAAMk3B,cAAc,cAAoB,IAAYl3B,GAAQ,IAC5DA,EAAMk3B,cAAc,cAAoB,eAAgBl3B,GAAQ,IAChEA,EAAMk3B,cAAc,cAAoB,eAAgBl3B,EAAMxB,UAAW,IACzEwB,EAAMuc,WAAWprB,SAAQ,SAAU0M,GAC/BmC,EAAMk3B,cAAc,cAAoB,UAAWr5B,GAAQA,MAG5D,IAGHs5B,EAAoB,CAAC,eAAgB,KACrCC,GAAe,QAAQD,GAKhBE,EAAqB,SAAUr3B,GACtC,IAAIgzB,GAAQ,QAAOhzB,EAAMlB,eAAeE,OAAO,KAAS,IAAIA,OAAO,KAAO,IAEtEs4B,EAA4B,SAAU3pB,GACtC,OAAOypB,EAAazpB,EAAEgE,OAAS,cAAoBhE,EAAEgE,MAAO,MAAQhE,GAExEqlB,EAAM7hC,SAAQ,SAAUwN,GACpBA,EAAKwJ,YAAcxJ,EAAKwJ,YAAYpJ,IAAIu4B,+MCnB5CC,EAAiB,SAAUv3B,GAC3B,IAAIw3B,EAAWx3B,EAAMuf,KAAKkY,WAC1B,GAAKD,EAAL,CAEA,IAAI3uB,EAAS7I,EAAM8E,OAAOmC,aAW1B,OAAI,QAAWuwB,GACJ,YAAiBA,EAASx3B,IAAQ7E,KAAKq7B,GAE3CA,EAAagB,GAbpB,SAAShB,EAAa9/B,GAClB,GAAKA,EAEL,OAAIA,aAAkB,IACXA,GACP,QAASA,GACFmS,EAAOpS,OAAOC,EAAQsJ,EAAMxB,SAAUwB,EAAMzP,WACnDmG,EAAc,OAAKA,EAAe,OAC3BmS,EAAOpS,OAAOC,EAAc,OAAKsJ,EAAMuf,KAAM7oB,EAAe,QAAKsJ,EAAMxB,SAAUwB,EAAMzP,gBADlG,IChBR,SAASmnC,EAAwB3zB,GAC7B,OAAO,SAAUsY,EAAYxe,GAGzB,OAAO85B,EAFM95B,EAAMuG,UACCL,IACNsY,EAAYxe,IAYlC,IAAI+5B,EAAaF,EAAwB,UAarCG,EAAeH,EAAwB,YAavCI,EAAcJ,EAAwB,2MC7C/BK,EAAwB,IAU/BC,EAAmB,SAAUh4B,GAC7B,OAAO,IAAI,IAAeA,EAAMlB,cAAcygB,IAAIuI,YAAY,QAAS9nB,GAAO7E,KAAK,OAcnF88B,EAAmB,SAAUj4B,EAAOnC,GACpC,OAAO,IAAI,IAAemC,EAAMlB,cAAcygB,IAAIpb,WAAWtG,EAAMuG,WAAW0jB,YAAY,OAAQ9nB,GAAO7E,KAAK,OAe9G+8B,EAAmB,SAAUl4B,GAC7B,OAAO,IAAI,IAAeA,EAAMlB,cAAcygB,IAAIuI,YAAY,OAAQ9nB,GAAO7E,KAAK,OCnClFg9B,EAAoB,SAAU9b,GAC9B,IAAIllB,EAAK,OACLihC,EAAgB/b,EAAWzR,MAAM,YACrC,GAAKwtB,EAAc54B,OAEnB,OAAOrI,EAAG0U,IAAIusB,EAAcr5B,KAAI,SAAUmL,GAAQ,OAAO/S,EAAGkJ,KAAK6J,EAAKuB,YAAatQ,KAAK,OAexFk9B,EAAgB,SAAUhc,GAC1B,IAAI+b,EAAgB/b,EAAWzR,MAAM,YACjC0tB,EAAejc,EAAWzR,MAAM,WACpC,GAAKwtB,EAAc54B,QAAW84B,EAAa94B,OAA3C,CAEA,IAAItI,EAAQmlB,EAAWvX,OAAOqC,YAC9BmxB,EAAannC,SAAQ,SAAUonC,GAAM,OAAOrhC,EAAMshC,qBAAqBD,MACvEH,EAAcjnC,SAAQ,SAAUonC,GAAM,OAAOrhC,EAAMuhC,mBAAmBF,MACtErhC,EAAM8lB,SCzBN0b,EAAoB,SAAU14B,GAC9B,IAAI0I,EAAU1I,EAAM8E,OAAO4D,QAOvBiwB,EAAyB,WAErBjwB,EAAQ2T,aAAerc,IACvB0I,EAAQ2T,WAAa,OAE7Brc,EAAM7B,UAAU,IAXW,WACvBuK,EAAQ0T,sBAAsBxG,QAAQ5V,GACtC0I,EAAQwa,SAAWljB,EAAMmjB,MACzBza,EAAQwN,QAAUxN,EAAQwa,SAASplB,MACnC,QAAKkC,EAAMxB,SAAUkK,EAAQlK,UAOS,CAAEhH,SAAU,MACtDwI,EAAMnM,QAAQsH,KAAKw9B,EAAwBA,ICtB3CC,EAAY,SAAUvc,GACtB,IAAI9rB,EAAU8rB,EAAW9rB,UACrBsY,EAASwT,EAAWvX,OAAOmC,aAC3B6B,EAAauT,EAAWvX,OAAOyH,UAKnC,GAAuB,QAAnBhc,EAAQ4e,QAAoB5e,EAAQ0V,UAAY4C,EAAOqa,SAASsH,UAAW,CAC3E,IAAIqO,EAAa,CAAE1zB,QAA8B,YAArB5U,EAAQ0V,UACpC6C,EAAWjY,KAAKgY,EAAOqa,SAASsH,UAAU3oB,IAAKgH,EAAOrK,OAAQq6B,GAElE/vB,EAAW0D,QAAO,kWCPtB,SAASssB,EAAY94B,GACjB,IAAI+4B,EAAgB/4B,EAAMg5B,iBAC1B,GAAKD,EAAL,CAEAtgC,EAAA,0BAA6BuH,GAC7B,IAAIi5B,EAAUj5B,EAAM8E,OAAO4D,QAAQ2T,WAOnC,MAHsB,kBAAlB0c,GAAqCE,GACrCA,EAAQC,QAEL,cAAoBjE,aCf/B,SAASkE,EAAsBn5B,GAC3B,IAAKA,EAAMywB,QACP,MAAM,IAAI5tB,MAAM7C,EAAMvK,QAAQyP,YAG/B,ICaIk0B,EAAmB,CAC1BnzB,UAAU,EACVsqB,SAAU,KACV/gB,SAAS,EACT6pB,QAAQ,EACRC,QAAQ,EACRC,WAAW,EACXC,OAAQ,GACRtjB,QAAS,WAAc,OAAO,MAC9B/G,OAAQ,WAaRsqB,EAAmC,WAEnC,SAASA,EAAkBC,GAEvBtpC,KAAKupC,iBAAmB,EAExBvpC,KAAKwpC,YAAc,GAEnBxpC,KAAKsjC,iBAAmB,GAExBtjC,KAAKypC,eAAiB,GACtBzpC,KAAKspC,QAAUA,EACftpC,KAAK8G,MAAQwiC,EAAQvyB,YACrB/W,KAAK0pC,mBAAqB,GAC1B1pC,KAAKgK,YAAc,SAAqB,QAAIhK,MAAO,IAAI,QAAIA,MAAO,CAC9D,kBACA,eACA,gBACA,aACA,aAEJA,KAAK2pC,mBACL3pC,KAAK4pC,oBACL5pC,KAAK6pC,+BACLP,EAAQhxB,QAAQ0T,sBAAsBzG,QAAQ0hB,GAuLlD,OA9JAoC,EAAkBxnC,UAAUioC,SAAW,SAAUh6B,EAAUtP,EAAUL,KAIrEkpC,EAAkBxnC,UAAUkO,SAAW,SAAUD,EAAUtP,EAAUL,KAIrEkpC,EAAkBxnC,UAAUkoC,QAAU,SAAUj6B,EAAUtP,EAAUL,KAIpEkpC,EAAkBxnC,UAAUmoC,OAAS,SAAUl6B,EAAUtP,EAAUL,KAInEkpC,EAAkBxnC,UAAUooC,SAAW,SAAUn6B,EAAUtP,EAAUL,KAIrEkpC,EAAkBxnC,UAAUqoC,QAAU,SAAUp6B,EAAUtP,EAAUL,KAIpEkpC,EAAkBxnC,UAAUsoC,SAAW,SAAUr6B,EAAUtP,EAAUL,KAIrEkpC,EAAkBxnC,UAAUkM,UAAY,SAAU+B,EAAUtP,EAAUL,KAItEkpC,EAAkBxnC,UAAUuoC,QAAU,SAAUt6B,EAAUtP,EAAUL,KAOpEkpC,EAAkBxnC,UAAUqT,QAAU,SAAUR,IAC5C,QAAO1U,KAAKsjC,kBAAkBviC,SAAQ,SAAUspC,GAC5C,OAAOA,EAAWtpC,SAAQ,SAAU8S,GAChCA,EAAK4uB,eAAgB,GACrB,QAAW4H,EAAYx2B,UAenCw1B,EAAkBxnC,UAAUL,OAAS,SAAUyyB,EAAUzH,GACrD,OAAO,IAAI,IAAWyH,EAAUzH,EAAaxsB,KAAKspC,UAGtDD,EAAkBxnC,UAAU+nC,kBAAoB,WAC5C,IAAIU,EAAQ,IACRC,EAAK,IACLC,EAAQxqC,KAAKypC,eACbgB,GAAc,EACdC,GAAc,EAClB1qC,KAAK2qC,aAAa,WAAYL,EAAMM,OAAQ,EAAGJ,EAAMrb,GAAIsb,EAAaF,EAAG9D,oBAAqB8D,EAAG3D,YAAa8D,GAC9G1qC,KAAK2qC,aAAa,WAAYL,EAAMO,OAAQ,EAAGL,EAAMrb,IACrDnvB,KAAK2qC,aAAa,UAAWL,EAAMQ,IAAK,EAAGN,EAAMrb,IACjDnvB,KAAK2qC,aAAa,SAAUL,EAAMQ,IAAK,IAAKN,EAAMv8B,SALV,GAMxCjO,KAAK2qC,aAAa,WAAYL,EAAMQ,IAAK,IAAKN,EAAMrV,UACpDn1B,KAAK2qC,aAAa,UAAWL,EAAMQ,IAAK,IAAKN,EAAMre,UACnDnsB,KAAK2qC,aAAa,WAAYL,EAAMQ,IAAK,IAAKN,EAAMrb,IACpDnvB,KAAK2qC,aAAa,YAAaL,EAAMS,QAAS,EAAGP,EAAMrb,GAAIsb,EAAaF,EAAG9D,oBAAqB8D,EAAG7D,UAAWgE,GAC9G1qC,KAAK2qC,aAAa,UAAWL,EAAM3F,MAAO,EAAG6F,EAAMrb,GAAIsb,EAAaF,EAAG9D,oBAAqB8D,EAAG7D,UAAWgE,IAG9GrB,EAAkBxnC,UAAU8nC,iBAAmB,WAC3C,IAAIqB,EAAQ,UAA2BrhB,EAAa,eACpD3pB,KAAKirC,gBAAgB,KAAMthB,GAC3B3pB,KAAKirC,gBAAgB,OAAQthB,GAC7B3pB,KAAKirC,gBAAgB,UAAWD,GAChChrC,KAAKirC,gBAAgB,WAAYD,GACjChrC,KAAKirC,gBAAgB,WAAYD,IAGrC3B,EAAkBxnC,UAAU8oC,aAAe,SAAUnlC,EAAMo8B,EAAWmD,EAAW1D,EAAmBG,EAAawD,EAAkBC,EAAiBC,QAC5H,IAAhB1D,IAA0BA,GAAc,QACnB,IAArBwD,IAA+BA,EAAmB,wBAC9B,IAApBC,IAA8BA,EAAkB,uBAChC,IAAhBC,IAA0BA,GAAc,GAC5C,IAAI7C,EAAY,IAAI,IAAoB78B,EAAMo8B,EAAWmD,EAAW1D,EAAmBG,EAAawD,EAAkBC,EAAiBC,GACvIllC,KAAKwpC,YAAY/oC,KAAK4hC,IACtB,QAAUriC,KAAMA,KAAMqiC,IAG1BgH,EAAkBxnC,UAAUi/B,WAAa,SAAUD,GAI/C,QAH0B,QAAUA,GAC9B7gC,KAAKwpC,YAAYlgC,QAAO,SAAU4F,GAAQ,OAAOA,EAAK0yB,YAAcf,KACpE7gC,KAAKwpC,YAAY1nC,SACI0pB,MAAK,SAAUiH,EAAGlV,GACzC,IAAI2tB,EAAazY,EAAEmP,UAAYrkB,EAAEqkB,UACjC,OAAsB,IAAfsJ,EAAmBzY,EAAEsS,UAAYxnB,EAAEwnB,UAAYmG,MAgB9D7B,EAAkBxnC,UAAUopC,gBAAkB,SAAUzlC,EAAM2lC,GAC1DnrC,KAAKypC,eAAejkC,GAAQ,CAAEA,KAAMA,EAAM1C,MAAOqoC,IAIrD9B,EAAkBxnC,UAAUihC,cAAgB,WACxC,OAAO9iC,KAAKypC,gBAGhBJ,EAAkBxnC,UAAUigC,SAAW,SAAUnuB,GAC7C,OAAO3T,KAAKsjC,iBAAiB3vB,IAGjC01B,EAAkBxnC,UAAUgoC,6BAA+B,WACvD,IAAIuB,EAAMprC,KAAK0pC,mBACf0B,EAAIC,gBAA6CrrC,KTzN5B8pC,SAAS,GAAIjD,GS0NlCuE,EAAIhS,QAAwCp5B,KF/MvB+P,SAAS,GAAI24B,EAAa,CAAEthC,UAAW,OEgN5DgkC,EAAI/G,QD7N+B,SAAUvX,GACjD,OAAOA,EAAkB/c,SAAS,GAAIg5B,EAAuB,CAAE3hC,UAAW,MC4NxDkkC,CAA8BtrC,MAE5CorC,EAAI/D,WR7MwB,SAAUva,GAC1C,OAAOA,EAAkBid,QAAQ,CAAE5a,GAAI,SAAU1hB,GAAS,QAASA,EAAM45B,aAAiBF,GQ4MrEoE,CAAuBvrC,MAExCorC,EAAIpB,OPtNoB,SAAUld,GACtC,OAAOA,EAAkBkd,OAAO,CAAE/7B,QAAS,SAAUR,GAAS,QAASA,EAAMu8B,SAAaxC,GOqNzEgE,CAAmBxrC,MAChCorC,EAAInB,SP1MsB,SAAUnd,GACxC,OAAOA,EAAkBmd,SAAS,CAAE9U,SAAU,SAAU1nB,GAAS,QAASA,EAAMw8B,WAAexC,GOyM5EgE,CAAqBzrC,MACpCorC,EAAIlB,QP9LqB,SAAUpd,GACvC,OAAOA,EAAkBod,QAAQ,CAAE/d,SAAU,SAAU1e,GAAS,QAASA,EAAMy8B,UAAcxC,GO6L3EgE,CAAoB1rC,MAElCorC,EAAIO,aNjO0B,SAAU7e,GAC5C,OAAOA,EAAkBid,QAAQ,GAAInC,EAAkB,CAAExgC,SAAUugC,IMgO5CiE,CAAyB5rC,MAC5CorC,EAAIS,YNnN0B,SAAU/e,GAC5C,OAAOA,EAAkBod,QAAQ,CAAE/d,UAAU,SAAI,IAAS0b,EAAkB,CAAEzgC,SAAUugC,IMkNlEmE,CAAyB9rC,MAC3CorC,EAAIW,WNpM0B,SAAUjf,GAC5C,OAAOA,EAAkBqd,SAAS,GAAIrC,EAAkB,CAAE1gC,SAAUugC,IMmM/CqE,CAAyBhsC,MAE1CorC,EAAIa,ULpO2B,SAAUnf,GAC7C,OAAOA,EAAkBqd,SAAS,GAAIpC,GKmOlBmE,CAA0BlsC,MAC1CorC,EAAInD,cL9MuB,SAAUnb,GACzC,OAAOA,EAAkB/e,UAAU,GAAIk6B,GK6MfkE,CAAsBnsC,MAE1CorC,EAAIgB,cJ3N2B,SAAUtf,GAC7C,OAAOA,EAAkBgd,SAAS,GAAIxB,GI0Nd+D,CAA0BrsC,MAE9CorC,EAAI5C,UHvOmB,SAAU1b,GACrC,OAAOA,EAAkB/e,UAAU,GAAIy6B,EAAW,CAAEphC,SAAU,OGsO1CklC,CAAkBtsC,MAElCorC,EAAIhf,UAAW,OAAqBpsB,OAEjCqpC,EA/M2B,mSChClCkD,EAA2B,WACV,SAASA,EAA2B73B,GACjD,IAAIvE,EAAQnQ,KACZA,KAAK0U,OAASA,EACG1U,KAAKouB,WAAa,IAAI,EAAAiD,WACtBrxB,KAAKkX,eAAgB,EACrBlX,KAAKwsC,oBAAqB,EAC1BxsC,KAAKysC,eAAgB,EACrBzsC,KAAK0sC,sBAAuB,EAC5B1sC,KAAKkV,QAAU,WAAc,OAAO/E,EAAMie,WAAWlZ,WAOtElV,KAAKyV,SAAW,WAAc,OAAOtF,EAAMuE,OAAO2C,eAAe5B,YAUjEzV,KAAK2sC,WAAa,SAAUC,GAAa,OAAOz8B,EAAMuE,OAAO2C,eAAes1B,WAAWC,IAMvF5sC,KAAK6sC,KAAO,WAAc,OAAO18B,EAAMuE,OAAO2C,eAAew1B,QAM7D7sC,KAAKqV,UAAY,WAAc,OAAOlF,EAAMuE,OAAO2C,eAAehC,aAMlErV,KAAK8sC,KAAO,WAAc,OAAO38B,EAAMuE,OAAO2C,eAAey1B,QAM7D9sC,KAAK+sC,SAAW,WAAc,OAAO58B,EAAMuE,OAAO2C,eAAe01B,YAwFrE,OA1EAR,EAAU1qC,UAAUmrC,gBAAkB,SAAUxoC,GAC5C,OAAQxE,KAAKwsC,oBAAqB,QAAUhoC,GAASA,EAAQxE,KAAKwsC,oBAmBtED,EAAU1qC,UAAUotB,oBAAsB,SAAUzqB,GAChD,IAAI,QAAUA,KAAoB,IAAVA,IAA4B,IAAVA,KAAoB,QAASA,GACnE,MAAM,IAAIiO,MAAM,0BAA4BjO,EAAQ,mDACxD,OAAQxE,KAAK0sC,sBAAuB,QAAUloC,GAASA,EAAQxE,KAAK0sC,sBAcxEH,EAAU1qC,UAAUorC,WAAa,SAAUzoC,GACvC,OAAQxE,KAAKysC,eAAgB,QAAUjoC,GAASA,EAAQxE,KAAKysC,eAgCjEF,EAAU1qC,UAAUqN,KAAO,SAAU1J,EAAMiU,EAAY+X,GACnD,IAAItiB,EAAOlP,KAAKouB,WAAWlf,KAAK1J,EAAMiU,EAAY+X,GAClD,OAAQ,QAAU/X,GAAqBzZ,KAAPkP,GAE7Bq9B,EA1ImB,0SCf1BW,EAAsC,WAStC,OARAA,EAAW35B,OAAO3Q,QAAU,SAASic,GACjC,IAAK,IAAIzB,EAAGC,EAAI,EAAGkD,EAAIve,UAAUoN,OAAQiO,EAAIkD,EAAGlD,IAE5C,IAAK,IAAIwd,KADTzd,EAAIpb,UAAUqb,GACO9J,OAAO1R,UAAUa,eAAeX,KAAKqb,EAAGyd,KACzDhc,EAAEgc,GAAKzd,EAAEyd,IAEjB,OAAOhc,IAEK1c,MAAMnC,KAAMgC,YAK5BmrC,EAA8B,WAC9B,SAASA,EAAaz4B,GAClB1U,KAAK0U,OAASA,EAWlB,OATAy4B,EAAatrC,UAAU+O,WAAa,SAAUvF,EAAI6D,EAAMzB,GACpD,OAAO,IAAI,EAAA4f,MAAMhiB,EAAI6D,EAAM,EAAAie,QAAA,OAAgBntB,KAAK0U,OAAOuC,WAAW1L,OAAQkC,IAE9E0/B,EAAatrC,UAAUoyB,SAAW,SAAU5oB,EAAI6D,EAAMzB,GAClD,OAAO,IAAI,EAAA4f,MAAMhiB,EAAI6D,EAAM,EAAAie,QAAA,KAAcntB,KAAK0U,OAAOuC,WAAW1L,OAAQkC,IAE5E0/B,EAAatrC,UAAUurC,WAAa,SAAU/hC,EAAI6D,EAAMzB,GACpD,OAAO,IAAI,EAAA4f,MAAMhiB,EAAI6D,EAAM,EAAAie,QAAA,OAAgBntB,KAAK0U,OAAOuC,WAAW1L,OAAQkC,IAEvE0/B,EAbsB,GAsB7BE,EAAmC,WAEnC,SAASA,EAAmC34B,GACxC,IAAIvE,EAAQnQ,KACZA,KAAK0U,OAASA,EAEd1U,KAAK07B,aAAe,IAAIyR,EAAantC,KAAK0U,QAE1C1U,KAAKstC,WAAa,IAClBttC,KAAKqtB,MAAQ,EAAAA,MAEbrtB,KAAKgtC,gBAAkB,SAAUxoC,GAAS,OAAO2L,EAAMuE,OAAOuC,WAAW1L,OAAOyhC,gBAAgBxoC,IAEhGxE,KAAKivB,oBAAsB,SAAUzqB,GAAS,OAAO2L,EAAMuE,OAAOuC,WAAW1L,OAAO0jB,oBAAoBzqB,IAExGxE,KAAKitC,WAAa,SAAUzoC,GAAS,OAAO2L,EAAMuE,OAAOuC,WAAW1L,OAAO0hC,WAAWzoC,IAEtFxE,KAAKkP,KAAO,SAAU1J,EAAMiU,EAAY+X,GACpC,OAAOrhB,EAAMuE,OAAOuC,WAAW1L,OAAO2D,KAAK1J,EAAMiU,EAAY+X,IAAiBrhB,GA+CtF,OArCAk9B,EAAkBxrC,UAAUwF,QAAU,SAAUid,EAAS/Y,GACrD,IAAI+hB,EAAYttB,KAAK0U,OAAOuC,WAAW1L,OAEnC6C,EAAS7C,IAAWA,EAAOkC,OAASlC,EAAO6C,OAC/C7C,EAAS6C,EAAS8+B,EAAS,CAAEz/B,MAAO,CAAEW,OAAQA,IAAY7C,GAAUA,EACpE,IAAIgiC,EAAe,CACfC,OAAQlgB,EAAUmf,cAClBO,gBAAiB1f,EAAUkf,mBAC3BiB,aAAcngB,EAAUpW,eAE5B,OAAO,IAAI,IAAWoN,EAASgJ,EAAUc,WAAYpuB,KAAK07B,cAAc,QAAO6R,EAAchiC,KASjG8hC,EAAkBxrC,UAAUs4B,UAAY,SAAUuT,GAE9C,KAAK,QAASA,GACV,OAAO,EACX,IAAIpnC,GAAS,EAKb,OAJA,QAAQ,eAAsB,SAAUtC,EAAKwB,IACrC,QAAWxB,KACXsC,EAASA,IAAU,QAAUonC,EAAOloC,MAAU,QAAWkoC,EAAOloC,QAEjEc,GAGX+mC,EAAkBxrC,UAAUnB,KAAO,WAC/B,IAAI4sB,EAAYttB,KAAK0U,OAAOuC,WAAW1L,OAGvC,OAFA+hB,EAAUc,WAAW5I,SAAU,EAC/B8H,EAAUc,WAAWqD,kBACdzxB,MAEJqtC,EAjE2B,kOCjBlCM,EAA2B,WAE3B,SAASA,EAA2Bj5B,GAChC,IAAIvE,EAAQnQ,KACZA,KAAK0U,OAASA,EAGd1U,KAAK4sB,KAAO,SAAU1W,GAAO,OAAO/F,EAAMuE,OAAOuC,WAAW2V,KAAK1W,IAEjElW,KAAKsc,OAAS,SAAUhH,GAAW,OAAOnF,EAAMuE,OAAOuC,WAAWqF,OAAOhH,IAEzEtV,KAAK+c,eAAiB,SAAU9Q,GAAS,OAAOkE,EAAMuE,OAAOuC,WAAW8F,eAAe9Q,IAEvFjM,KAAKgc,MAAQ,SAAU4xB,GAAY,OAAOz9B,EAAMuE,OAAOuC,WAAW+E,MAAM4xB,IAGxE5tC,KAAKuH,QAAU,SAAUwU,GACrB,OAAO5L,EAAMuE,OAAOuC,WAAW0F,MAAMpV,QAAQwU,IAGjD/b,KAAK4c,UAAY,SAAUb,GACvB,OAAO5L,EAAMuE,OAAOuC,WAAW0F,MAAMC,UAAUb,IAGnD/b,KAAKw/B,WAAa,SAAUjjB,GAAQ,OAAOpM,EAAMuE,OAAOuC,WAAW0F,MAAM6iB,WAAWjjB,IAEpFvc,KAAKuc,KAAO,SAAUA,GAAQ,OAAOpM,EAAMuE,OAAOuC,WAAW0F,MAAMJ,KAAKA,IAExEvc,KAAK2c,MAAQ,WAAc,OAAOxM,EAAMuE,OAAOuC,WAAW0F,MAAMA,SAEhE3c,KAAKwrB,KAAO,SAAUqiB,GAAa,OAAO19B,EAAMuE,OAAOuC,WAAW0F,MAAM6O,KAAKqiB,IAE7E7tC,KAAKiQ,KAAO,SAAUwrB,EAAS1f,EAAS5b,GAAW,OAAOgQ,EAAMuE,OAAOuC,WAAW0F,MAAM1M,KAAKwrB,EAAS1f,EAAS5b,IAC/GH,KAAK6+B,eAAiB,IAAI,IAAenqB,GAyE7C,OAtEAi5B,EAAU9rC,UAAUua,OAAS,SAAU0xB,GACnC,IAAIphB,EAAO1sB,KAAK0U,OAAO0C,gBACnB02B,EACA9tC,KAAK6V,SAAW6W,EAAKjb,MAGrBib,EAAKjb,QAAUzR,KAAK6V,UAExB6W,EAAKjb,IAAIzR,KAAK6V,UAAU,IAY5B83B,EAAU9rC,UAAUpB,KAAO,SAAUstC,EAAY3/B,EAAQjO,GACrD,IAAI4U,EAAU5U,KAAaA,EAAQ4U,QACnC/U,KAAK0U,OAAOuC,WAAWxF,IAAIs8B,EAAWnmB,OAAOxZ,GAAU,IAAK2G,IAqBhE44B,EAAU9rC,UAAUmsC,KAAO,SAAUD,EAAY3/B,EAAQjO,GACrD,IAAIsR,EAAMs8B,EAAWnmB,OAAOxZ,GAC5B,GAAW,MAAPqD,EACA,OAAO,KACXtR,EAAUA,GAAW,CAAE8tC,UAAU,GACjC,IAAIpmC,EAAM7H,KAAK0U,OAAOuC,WAAW1L,OAC7B2iC,EAAUrmC,EAAIwN,YAKlB,GAJK64B,GAAmB,OAARz8B,IACZA,EAAM,IAAM5J,EAAI8kC,aAAel7B,GAEnCA,EA1GR,SAAwBA,EAAKy8B,EAASD,EAAUx4B,GAC5C,MAAiB,MAAbA,EACOhE,EACPy8B,GACO,QAAqBz4B,GAAYhE,EACxCw8B,EACOx4B,EAAS3T,MAAM,GAAK2P,EACxBA,EAmGG08B,CAAe18B,EAAKy8B,EAAS/tC,EAAQ8tC,SAAUpmC,EAAI4N,aACpDtV,EAAQ8tC,WAAax8B,EACtB,OAAOA,EAEX,IAAI28B,GAASF,GAAWz8B,EAAM,IAAM,GAChC48B,EAAUxmC,EAAIilC,OACdA,EAAoB,KAAZuB,GAA8B,MAAZA,EAAkB,GAAK,IAAMA,EAC3D,MAAO,CAACxmC,EAAIklC,WAAY,MAAOllC,EAAIglC,OAAQC,EAAMsB,EAAO38B,GAAKwB,KAAK,KAEtEM,OAAO+6B,eAAeX,EAAU9rC,UAAW,oBAAqB,CAE5D6O,IAAK,WACD,OAAO1Q,KAAK0U,OAAOuC,WAAWoF,mBAElCkyB,YAAY,EACZC,cAAc,IAEXb,EA1GmB,2aCJ1Bc,EAAgC,WAChC,SAASA,EAAe/5B,GACpB1U,KAAK0U,OAASA,EAiKlB,OA/JA+5B,EAAe5sC,UAAUwF,QAAU,SAAU2J,GACzC,OAAOhR,KAAK0U,OAAOE,kBAAkBvN,QAAQ2J,IAEjDy9B,EAAe5sC,UAAUL,OAAS,SAAUsb,EAAMf,GAC9C,IAAI5L,EAAQnQ,KACRy9B,EAAU,YAAqBD,EAAqB,uBACpDkR,GAAW,QAAQ,CACnB,CAAC,KAAU,SAAUC,GAAS,OAAOD,EAASv+B,EAAM9I,QAAQsnC,MAC5D,EAAC,IAAAz1B,IAAG,KAAa,SAAUy1B,GAAS,OAAOx+B,EAAMy+B,eAAeD,EAAO5yB,KACvE,EAAC,IAAAkI,IAAGwZ,EAASD,GAAqB,SAAUmR,GAAS,OAAOx+B,EAAM0+B,UAAUF,EAAOx+B,EAAMuE,UACzF,EAAC,IAAAwE,IAAG/P,QAAS,SAAUwlC,GAAS,OAAOx+B,EAAM2+B,WAAWH,EAAO5yB,KAC/D,CAAC,KAAY,SAAU4yB,GAAS,OAAO,IAAIlyB,EAAYkyB,EAAO5yB,OAE9DQ,EAAOmyB,EAAS5xB,GACpB,IAAKP,EACD,MAAM,IAAI9J,MAAM,4BACpB,OAAO8J,GAsCXkyB,EAAe5sC,UAAU+sC,eAAiB,SAAUb,EAAYhyB,GAC5D,IAAIgzB,EAAWhzB,GACX,QAASA,KACTA,EAAU/b,KAAK0U,OAAOE,kBAAkBvN,QAAQ0U,KAChD,IAAA7C,IAAG,IAAH,CAAe6C,KACfgzB,EAAW,SAAU/yB,GAAS,OAAOD,EAAQ6L,OAAO5L,KAiBxD,IAAIgzB,EAAU,CAAEjB,WAAYA,EAAYkB,cAPxC,SAAuB7gC,GACnB,IAAI8gC,EAAWnB,EAAW1a,aAAa/pB,QAAO,SAAU0F,GAAS,OAAOA,EAAM4f,cAC9E,OAAKsgB,EAAS9/B,OAEA8/B,EAAS5lC,QAAO,SAAU0F,GAAS,OAAOZ,EAAOY,EAAM3D,OACtD+D,OAAS8/B,EAAS9/B,OAFtB,MAIuDF,KAAM,cAC5E,OAAO,QAAO,IAAIuN,GAjBlB,SAA2BhL,GACvB,IAAIrD,EAAS2/B,EAAWtkC,KAAKgI,EAAItJ,KAAMsJ,EAAI09B,OAAQ19B,EAAIqgB,MACvD,OAAOic,EAAWre,UAAUthB,IAAWA,IAeM2gC,GAAWC,IAahEP,EAAe5sC,UAAUgtC,UAAY,SAAUO,EAAa16B,GACxD,IAAIjH,EAAQ,uBAA+B2hC,GAAeA,EAAYp7B,UAAYo7B,EAe9EJ,EAAU,CAAEvhC,MAAOA,EAAOyB,KAAM,SACpC,OAAO,QAAOlP,KAAK4uC,eAAenhC,EAAMgE,KAR1B,SAAUuK,GACpB,IAAIvD,EAAS/D,EAAOmC,aAChByB,EAAU5D,EAAO4D,QACjBG,EAAOu1B,KAAKvgC,EAAOuO,KAAWvD,EAAOu1B,KAAK11B,EAAQwN,QAASxN,EAAQlK,SACnEqK,EAAO42B,aAAa5hC,EAAOuO,EAAO,CAAEoD,SAAS,EAAML,OAAQ,WAIZiwB,IAkC3DP,EAAe5sC,UAAUitC,WAAa,SAAU7rB,EAAQlH,GACpD,GAAIkH,EAAOnF,QAAUmF,EAAOqsB,OACxB,MAAM,IAAI78B,MAAM,4CAMpB,IAIIs8B,GAAW,QAAShzB,GAJJ,SAAUC,GAE1B,OAAOD,EAAQhH,QAAQ,kBAAkB,SAAUC,EAAG8H,GAAQ,OAAOd,EAAe,MAATc,EAAe,EAAIyyB,OAAOzyB,QAEtDf,EAE/CizB,EAAU,CAAE/rB,OAAQA,EAAQ/T,KAAM,UACtC,OAAO,QAAO,IAAIuN,GAFU,SAAUhL,GAAO,OAAOwR,EAAOxZ,KAAKgI,EAAItJ,QAEf4mC,GAAWC,IAEpEP,EAAee,UAAY,SAAUv1B,GAAO,OAAOA,GAAO,CAAC,OAAQ,QAAS,WAAWkpB,OAAM,SAAUt9B,GAAO,OAAO,QAAUoU,EAAIpU,QAC5H4oC,EAnKwB,GA4K/BhyB,EACA,SAAqBT,EAAOD,GACxB,IAAI5L,EAAQnQ,KACZA,KAAKgc,MAAQA,EACbhc,KAAKkP,KAAO,MACZlP,KAAKivC,cAAgB,SAAUjzB,GAAS,OAAO,EAAI7L,EAAMgL,KACzDnb,KAAK+b,QAAUA,GAAW,2GCnK9B0zB,sPAaJ,SAASC,EAAa3zB,GAClB,MAAK,QAAWA,KAAa,QAASA,KAAa,IAAA7C,IAAG,EAAA2mB,YAAH,CAAgB9jB,IAAa,EAAA8jB,YAAA,MAAkB9jB,IAC9F,MAAM,IAAItJ,MAAM,4FAEpB,OAAO,QAAWsJ,GAAWA,GAAU,QAAIA,GAhB/C0zB,EAAoB,SAAUhyB,EAAGmB,GAC7B,IAAI+wB,EA5BW,SAAUlyB,EAAGmB,GAAK,OAAQA,EAAExX,UAAY,IAAMqW,EAAErW,UAAY,GA4BjEwoC,CAAanyB,EAAGmB,GAC1B,OAAY,IAAR+wB,GAGQ,KADZA,EA9BW,SAAUlyB,EAAGmB,GACxB,IAAIixB,EAAU,CAAE7E,MAAO,EAAG8E,WAAY,EAAGC,OAAQ,EAAGC,IAAK,EAAGC,MAAO,GACnE,OAAQJ,EAAQpyB,EAAEvO,OAAS,IAAM2gC,EAAQjxB,EAAE1P,OAAS,GA4B9CghC,CAASzyB,EAAGmB,KAIN,KADZ+wB,EA7BiB,SAAUlyB,EAAGmB,GAC9B,OAAQnB,EAAEswB,YAAenvB,EAAEmvB,WAAiB,YAAmBtwB,EAAEswB,WAAYnvB,EAAEmvB,YAAvC,EA4BlCoC,CAAe1yB,EAAGmB,IAJb+wB,EAtBF,SAAUlyB,EAAGmB,GAEtB,IAAIwxB,EAAmB,CAAEpF,OAAO,EAAM8E,YAAY,GAElD,OADYM,EAAiB3yB,EAAEvO,OAASkhC,EAAiBxxB,EAAE1P,MAC5C,GAAKuO,EAAEtC,KAAO,IAAMyD,EAAEzD,KAAO,GAyBrCk1B,CAAO5yB,EAAGmB,IAkBrB,IAAI0xB,EAA0B,WAE1B,SAASA,EAA0B57B,GAC/B1U,KAAK0U,OAASA,EACG1U,KAAKuwC,QAAUd,EACfzvC,KAAKwwC,OAAS,GACdxwC,KAAKywC,IAAM,EAC5BzwC,KAAK6+B,eAAiB,IAAI,IAAenqB,GA8Q7C,OA3QA47B,EAASzuC,UAAUqT,QAAU,SAAUR,GACnC1U,KAAKwwC,OAAS,UACPxwC,KAAK0wC,cAqChBJ,EAASzuC,UAAU0F,QAAU,SAAUwU,GACnC,IAAI40B,EAAYjB,EAAa3zB,GAI7B/b,KAAKuc,KAAKvc,KAAK6+B,eAAer9B,QAHhB,SAAUosC,EAAUl5B,GAC9B,OAAmD,IAA5CA,EAAO4D,QAAQyT,kBAAkBnG,UAAkB,QAAQnc,KAAKmkC,EAASzlC,QAEtCwoC,KA6ClDL,EAASzuC,UAAU+a,UAAY,SAAUb,GACrC,IAAI40B,EAAYjB,EAAa3zB,GAC7B/b,KAAK0wC,aAAe1wC,KAAK6+B,eAAer9B,QAAO,SAAI,GAAOmvC,GAC1D3wC,KAAK4wC,SAAU,GAOnBN,EAASzuC,UAAU29B,WAAa,SAAUjjB,IACtC,QAAWvc,KAAKwwC,OAAQj0B,IAc5B+zB,EAASzuC,UAAU0a,KAAO,SAAUA,GAChC,IAAIpM,EAAQnQ,KACZ,IAAK,cAAyBuc,GAC1B,MAAM,IAAI9J,MAAM,gBAKpB,OAJA8J,EAAKpB,IAAMnb,KAAKywC,MAChBl0B,EAAKnV,SAAWmV,EAAKnV,UAAY,EACjCpH,KAAKwwC,OAAO/vC,KAAK8b,GACjBvc,KAAK4wC,SAAU,EACR,WAAc,OAAOzgC,EAAMqvB,WAAWjjB,KAOjD+zB,EAASzuC,UAAU8a,MAAQ,WAEvB,OADA3c,KAAK6wC,eACE7wC,KAAKwwC,OAAOpuC,OAAOpC,KAAK0wC,aAAe,CAAC1wC,KAAK0wC,cAAgB,KA4CxEJ,EAASzuC,UAAU2pB,KAAO,SAAUqiB,GAIhC,IAHA,IAAIiD,EAAS9wC,KAAK+wC,WAAW/wC,KAAKwwC,OAASxwC,KAAKuwC,QAAU1C,GAAa7tC,KAAKuwC,SAExES,EAAQ,EACH3zB,EAAI,EAAGA,EAAIyzB,EAAO1hC,OAAQiO,IAC/ByzB,EAAOzzB,GAAG4zB,OAASD,EACf3zB,EAAIyzB,EAAO1hC,OAAS,GAAgD,IAA3CpP,KAAKuwC,QAAQO,EAAOzzB,GAAIyzB,EAAOzzB,EAAI,KAC5D2zB,IAGRhxC,KAAKwwC,OAASM,EACd9wC,KAAK4wC,SAAU,GAGnBN,EAASzuC,UAAUgvC,aAAe,WAC9B7wC,KAAK4wC,SAAW5wC,KAAKwrB,QAGzB8kB,EAASzuC,UAAUkvC,WAAa,SAAUrxB,EAAKmuB,GAC3C,IAAIqD,EAAexxB,EAAI/Q,KAAI,SAAUuS,EAAMjS,GAAO,MAAO,CAAGiS,KAAMA,EAAMjS,IAAKA,MAK7E,OAJAiiC,EAAa1lB,MAAK,SAAU2lB,EAAUC,GAClC,IAAIC,EAAUxD,EAAUsD,EAASjwB,KAAMkwB,EAASlwB,MAChD,OAAmB,IAAZmwB,EAAgBF,EAASliC,IAAMmiC,EAASniC,IAAMoiC,KAElDH,EAAaviC,KAAI,SAAU2iC,GAAW,OAAOA,EAAQpwB,SA6DhEovB,EAASzuC,UAAUoO,KAAO,SAAUwrB,EAAS1f,EAAS5b,GAClD,IAAIoc,EAAOvc,KAAK6+B,eAAer9B,OAAOi6B,EAAS1f,GAI/C,OAHI,QAAU5b,GAAWA,EAAQiH,YAC7BmV,EAAKnV,SAAWjH,EAAQiH,UAC5BpH,KAAKuc,KAAKA,GACHA,GAEJ+zB,EArRkB,8VCpDzBiB,EAA4B,WAE5B,SAASA,EAA4B78B,GACjC,IAAIvE,EAAQnQ,KACZA,KAAK0U,OAASA,EACG1U,KAAKqc,mBAAoB,EAM1Crc,KAAK2c,MAAQ,IAAI,IAAS3c,KAAK0U,QAM/B1U,KAAKuL,OAAS,IAAI,IAAUvL,KAAK0U,QAsDjC1U,KAAKyR,IAAM,SAAU+/B,EAAQz8B,EAAStH,GAClC,OAAO0C,EAAMuE,OAAO0C,gBAAgB3F,IAAI+/B,EAAQz8B,EAAStH,IAS7DzN,KAAKmI,KAAO,WAAc,OAAOgI,EAAMuE,OAAO0C,gBAAgBjP,QAQ9DnI,KAAKmvC,OAAS,WAAc,OAAOh/B,EAAMuE,OAAO0C,gBAAgB+3B,UAQhEnvC,KAAK8xB,KAAO,WAAc,OAAO3hB,EAAMuE,OAAO0C,gBAAgB0a,QAgB9D9xB,KAAKmV,SAAW,SAAU3U,GAAY,OAAO2P,EAAMuE,OAAO0C,gBAAgBjC,SAAS3U,IA4IvF,OAzIA+wC,EAAW1vC,UAAUqT,QAAU,WAC3BlV,KAAKsc,QAAO,GACZtc,KAAK2c,MAAMzH,WAOfq8B,EAAW1vC,UAAU8qB,MAAQ,WACzB,MAAO,CAAExkB,KAAMnI,KAAKmI,OAAQgnC,OAAQnvC,KAAKmvC,SAAUrd,KAAM9xB,KAAK8xB,SAsBlEyf,EAAW1vC,UAAU+qB,KAAO,SAAU1W,GAClC,IAAIA,IAAOA,EAAI5T,iBAAf,CAEA,IAAI+oB,EAAKrrB,KAAK0U,OAAQuC,EAAaoU,EAAGpU,WAAYJ,EAAewU,EAAGxU,aAChEpF,EAAM,CAAEtJ,KAAM8O,EAAW9O,OAAQgnC,OAAQl4B,EAAWk4B,SAAUrd,KAAM7a,EAAW6a,QAC/E2f,EAAOzxC,KAAKgc,MAAMvK,IACJ,QAAQ,CACtB,CAAC,KAAU,SAAU+/B,GAAU,OAAOv6B,EAAWxF,IAAI+/B,GAAQ,KAC7D,CAAC,EAAA3R,YAAA,MAAmB,SAAU3sB,GAAO,OAAO2D,EAAa66B,GAAGx+B,EAAIzF,MAAOyF,EAAI9E,OAAQ8E,EAAI/S,WACvF,EAAC,IAAA+Y,IAAG,EAAA2mB,aAAc,SAAUx5B,GAAU,OAAOwQ,EAAa66B,GAAGrrC,EAAOoH,QAASpH,EAAO+H,SAAU/H,EAAOlG,cAEzGwxC,CAAYF,GAAQA,EAAKl1B,KAAKR,QAAQ01B,EAAKz1B,MAAOvK,EAAKzR,KAAK0U,WAwBhE68B,EAAW1vC,UAAUya,OAAS,SAAUhH,GACpC,IAAInF,EAAQnQ,KACZ,IAAgB,IAAZsV,EAKA,OAAQtV,KAAK4xC,iBACT5xC,KAAK4xC,kBAAoB5xC,KAAK0U,OAAOuC,WAAW9B,UAAS,SAAUe,GAAO,OAAO/F,EAAMyc,KAAK1W,MALhGlW,KAAK4xC,kBAAoB5xC,KAAK4xC,0BACvB5xC,KAAK4xC,kBA+BpBL,EAAW1vC,UAAUkb,eAAiB,SAAU9Q,QAC9BkI,IAAVlI,IACAA,GAAQ,GACZjM,KAAKqc,kBAAoBpQ,GAQ7BslC,EAAW1vC,UAAUma,MAAQ,SAAUvK,GAEnCA,GAAM,QAAO,CAAEtJ,KAAM,GAAIgnC,OAAQ,GAAIrd,KAAM,IAAMrgB,GAYjD,IAXA,IAUIggC,EARsBl1B,EAClBP,EAHJW,EAAQ3c,KAAK2c,MAAMA,QAWdU,EAAI,EAAGA,EAAIV,EAAMvN,UAElBqiC,GAAQA,EAAKl1B,KAAK00B,SAAWt0B,EAAMU,GAAG4zB,QAFZ5zB,IAAK,CAInC,IAAIyI,QAZA9J,GAAAA,GADkBO,EAaEI,EAAMU,IAZbrB,MAAMvK,EALfzR,KAK0B0U,UAClB,CAAEsH,MAAOA,EAAOO,KAAMA,EAAMs1B,OAAQt1B,EAAK0yB,cAAcjzB,KAavEy1B,GAAQA,GAAS3rB,GAAWA,EAAQ+rB,OAASJ,EAAKI,OAAU/rB,EAAU2rB,EAE1E,OAAOA,GAEJF,EA7PoB,yXCJ3BO,EAAsC,WACtC,SAASA,EAAqBp9B,EAAQq9B,GAClC,IAAI5hC,EAAQnQ,KACZA,KAAK+xC,gBAAkBA,EACvB/xC,KAAKgyC,WAAa,GAClBhyC,KAAKiyC,UAAY,SAAU/7B,GAAO,OAAO/F,EAAM6hC,WAAWjxC,SAAQ,SAAU+J,GAAM,OAAOA,EAAGoL,OAC5FlW,KAAK8xB,KAAO,WAAc,OAAO,QAAS3hB,EAAM+hC,QAAQpgB,MACxD9xB,KAAKmI,KAAO,WAAc,OAAO,QAASgI,EAAM+hC,QAAQ/pC,MACxDnI,KAAKmvC,OAAS,WAAc,OAAO,SAAU,QAASh/B,EAAM+hC,QAAQ/C,SACpEnvC,KAAKmyC,UAAY,cACjBnyC,KAAKoyC,SAAW,aAoBpB,OAlBAN,EAAqBjwC,UAAU4P,IAAM,SAAUA,EAAKsD,GAQhD,YAPgB,IAAZA,IAAsBA,GAAU,IAChC,QAAUtD,IAAQA,IAAQzR,KAAKkyC,SAC/BlyC,KAAKmpB,KAAK,KAAM,KAAM1X,EAAKsD,GACvB/U,KAAK+xC,iBACL/xC,KAAKgyC,WAAWjxC,SAAQ,SAAU+J,GAAM,OAAOA,EAAG,CAAE2G,IAAKA,SAG1D,QAASzR,OAEpB8xC,EAAqBjwC,UAAUsT,SAAW,SAAUrK,GAChD,IAAIqF,EAAQnQ,KAEZ,OADAA,KAAKgyC,WAAWvxC,KAAKqK,GACd,WAAc,OAAO,QAAWqF,EAAM6hC,WAAYlnC,KAE7DgnC,EAAqBjwC,UAAUqT,QAAU,SAAUR,IAC/C,QAAS1U,KAAKgyC,aAEXF,EA9B8B,2LCDrCO,EAAuC,WACvC,SAASA,EAAsB39B,EAAQ49B,QAClB,IAAbA,IAAuBA,GAAW,GACtCtyC,KAAKsyC,SAAWA,EAChBtyC,KAAK0V,eAAYvB,EACjBnU,KAAKuyC,YAAc,GAmCvB,OAjCAF,EAAsBxwC,UAAUirC,KAAO,WACnC,OAAIj3B,SAASi3B,KACFyC,OAAO15B,SAASi3B,MAEA,UAApB9sC,KAAK+sC,WAAyB,IAAM,IAE/CsF,EAAsBxwC,UAAUkrC,SAAW,WACvC,OAAOl3B,SAASk3B,SAASh4B,QAAQ,KAAM,KAE3Cs9B,EAAsBxwC,UAAUgrC,KAAO,WACnC,OAAOh3B,SAAS28B,UAEpBH,EAAsBxwC,UAAUwT,UAAY,WACxC,OAAOrV,KAAKsyC,UAEhBD,EAAsBxwC,UAAU8qC,WAAa,SAAUC,GACnD,OAAO,QAAUA,GAAc5sC,KAAKuyC,YAAc3F,EAAa5sC,KAAKuyC,aAExEF,EAAsBxwC,UAAU4T,SAAW,SAAUu4B,GAKjD,OAJI,QAAUA,KACVhuC,KAAK0V,UAAYs4B,IACjB,QAAYhuC,KAAK0V,aACjB1V,KAAK0V,UAAY1V,KAAKyyC,eACnBzyC,KAAK0V,WAEhB28B,EAAsBxwC,UAAU4wC,YAAc,WAC1C,IAAIC,EAAUrsB,SAASssB,qBAAqB,QAAQ,GACpD,OAAID,GAAWA,EAAQ1E,KACZ0E,EAAQ1E,KAAKj5B,QAAQ,uBAAwB,IAEjD/U,KAAKsyC,SAAW,IAAMz8B,SAAS/B,UAAY,KAEtDu+B,EAAsBxwC,UAAUqT,QAAU,aACnCm9B,EAxC+B,uHCDlCO,2IADJC,GACID,EAAgB,SAAUzZ,EAAGva,GAI7B,OAHAg0B,EAAgBr/B,OAAOu/B,gBAClB,CAAEC,UAAW,cAAgBnxC,OAAS,SAAUu3B,EAAGva,GAAKua,EAAE4Z,UAAYn0B,IACvE,SAAUua,EAAGva,GAAK,IAAK,IAAIic,KAAKjc,EAAOA,EAAElc,eAAem4B,KAAI1B,EAAE0B,GAAKjc,EAAEic,MACpD1B,EAAGva,IAErB,SAAUua,EAAGva,GAEhB,SAASo0B,IAAOhzC,KAAKokB,YAAc+U,EADnCyZ,EAAczZ,EAAGva,GAEjBua,EAAEt3B,UAAkB,OAAN+c,EAAarL,OAAO/R,OAAOod,IAAMo0B,EAAGnxC,UAAY+c,EAAE/c,UAAW,IAAImxC,KAMnFC,EAAqC,SAAUC,GAE/C,SAASD,EAAoBv+B,GACzB,IAAIvE,EAAQ+iC,EAAOnxC,KAAK/B,KAAM0U,GAAQ,IAAU1U,KAEhD,OADA,sBAAsB,aAAcmQ,EAAM8hC,WAAW,GAC9C9hC,EAYX,OAhBA0iC,EAAUI,EAAqBC,GAM/BD,EAAoBpxC,UAAUqwC,KAAO,WACjC,OAAO,QAAYlyC,KAAKmyC,UAAUrgB,OAEtCmhB,EAAoBpxC,UAAUsnB,KAAO,SAAU1b,EAAO0lC,EAAO1hC,EAAKsD,GAC9D/U,KAAKmyC,UAAUrgB,KAAOrgB,GAE1BwhC,EAAoBpxC,UAAUqT,QAAU,SAAUR,GAC9Cw+B,EAAOrxC,UAAUqT,QAAQnT,KAAK/B,KAAM0U,GACpC,yBAAyB,aAAc1U,KAAKiyC,YAEzCgB,EAjB6B,CAkBtC,yYC/BEG,EACA,WACI,IAAIjjC,EAAQnQ,KACZA,KAAKkV,QAAU,KACflV,KAAK0V,UAAY,GACjB1V,KAAKqzC,MAAQ,GACbrzC,KAAKszC,UAAY,OACjBtzC,KAAKuzC,MAAQ,YACbvzC,KAAKuyC,YAAc,GACnBvyC,KAAK8sC,KAAO,WAAc,OAAO38B,EAAMkjC,OACvCrzC,KAAK+sC,SAAW,WAAc,OAAO58B,EAAMmjC,WAC3CtzC,KAAK6sC,KAAO,WAAc,OAAO18B,EAAMojC,OACvCvzC,KAAKyV,SAAW,WAAc,OAAOtF,EAAMuF,WAC3C1V,KAAKqV,UAAY,WAAc,OAAO,GACtCrV,KAAK2sC,WAAa,SAAU6G,GAAU,OAAQ,QAAUA,GAAWrjC,EAAMoiC,YAAciB,EAAUrjC,EAAMoiC,oIChBvGK,8EADJC,GACID,EAAgB,SAAUzZ,EAAGva,GAI7B,OAHAg0B,EAAgBr/B,OAAOu/B,gBAClB,CAAEC,UAAW,cAAgBnxC,OAAS,SAAUu3B,EAAGva,GAAKua,EAAE4Z,UAAYn0B,IACvE,SAAUua,EAAGva,GAAK,IAAK,IAAIic,KAAKjc,EAAOA,EAAElc,eAAem4B,KAAI1B,EAAE0B,GAAKjc,EAAEic,MACpD1B,EAAGva,IAErB,SAAUua,EAAGva,GAEhB,SAASo0B,IAAOhzC,KAAKokB,YAAc+U,EADnCyZ,EAAczZ,EAAGva,GAEjBua,EAAEt3B,UAAkB,OAAN+c,EAAarL,OAAO/R,OAAOod,IAAMo0B,EAAGnxC,UAAY+c,EAAE/c,UAAW,IAAImxC,KAKnFS,EAAuC,SAAUP,GAEjD,SAASO,EAAsB/+B,GAC3B,OAAOw+B,EAAOnxC,KAAK/B,KAAM0U,GAAQ,IAAS1U,KAQ9C,OAVA6yC,EAAUY,EAAuBP,GAIjCO,EAAsB5xC,UAAUqwC,KAAO,WACnC,OAAOlyC,KAAK0zC,MAEhBD,EAAsB5xC,UAAUsnB,KAAO,SAAU1b,EAAO0lC,EAAO1hC,EAAKsD,GAChE/U,KAAK0zC,KAAOjiC,GAETgiC,EAX+B,CAYxC,0tBCZ8B,QAAsB,4BAA4B,EAAO,IAAqB,MAEzE,QAAsB,6BAA6B,EAAM,IAA0B,MAEtF,QAAsB,0BAA0B,EAAO,IAAuB,8HClBxGb,2IADJC,GACID,EAAgB,SAAUzZ,EAAGva,GAI7B,OAHAg0B,EAAgBr/B,OAAOu/B,gBAClB,CAAEC,UAAW,cAAgBnxC,OAAS,SAAUu3B,EAAGva,GAAKua,EAAE4Z,UAAYn0B,IACvE,SAAUua,EAAGva,GAAK,IAAK,IAAIic,KAAKjc,EAAOA,EAAElc,eAAem4B,KAAI1B,EAAE0B,GAAKjc,EAAEic,MACpD1B,EAAGva,IAErB,SAAUua,EAAGva,GAEhB,SAASo0B,IAAOhzC,KAAKokB,YAAc+U,EADnCyZ,EAAczZ,EAAGva,GAEjBua,EAAEt3B,UAAkB,OAAN+c,EAAarL,OAAO/R,OAAOod,IAAMo0B,EAAGnxC,UAAY+c,EAAE/c,UAAW,IAAImxC,KAUnFW,EAA0C,SAAUT,GAEpD,SAASS,EAAyBj/B,GAC9B,IAAIvE,EAAQ+iC,EAAOnxC,KAAK/B,KAAM0U,GAAQ,IAAS1U,KAG/C,OAFAmQ,EAAMyjC,QAAUl/B,EAAOuC,WAAW1L,OAClC,sBAAsB,WAAY4E,EAAM8hC,WAAW,GAC5C9hC,EA8CX,OAnDA0iC,EAAUc,EAA0BT,GAuBpCS,EAAyB9xC,UAAUgyC,eAAiB,WAChD,OAAO,QAAqB7zC,KAAK4zC,QAAQn+B,aAE7Ck+B,EAAyB9xC,UAAUqwC,KAAO,WACtC,IAAI7mB,EAAKrrB,KAAKmyC,UAAWr+B,EAAWuX,EAAGvX,SAAUge,EAAOzG,EAAGyG,KAAMqd,EAAS9jB,EAAG8jB,OAC7EA,GAAS,QAAWA,GAAQ,GAC5Brd,GAAO,QAAUA,GAAM,GACvB,IAAIgiB,EAAa9zC,KAAK6zC,iBAClBE,EAAqBjgC,IAAa9T,KAAK4zC,QAAQn+B,WAC/Cu+B,EAAiBlgC,EAASiT,OAAO,EAAG+sB,EAAW1kC,UAAY0kC,EAE/D,OADAhgC,EAAWigC,EAAqB,IAAMC,EAAiBlgC,EAASmmB,UAAU6Z,EAAW1kC,QAAU0E,IAC5Eq7B,EAAS,IAAMA,EAAS,KAAOrd,EAAO,IAAMA,EAAO,KAE1E6hB,EAAyB9xC,UAAUsnB,KAAO,SAAU1b,EAAO0lC,EAAO1hC,EAAKsD,GACnE,IAAI++B,EAAa9zC,KAAK6zC,iBAClBzF,EAAQ38B,GAAkB,MAAXA,EAAI,GAAa,IAAM,GACtCwiC,EAAkB,KAARxiC,GAAsB,MAARA,EAAczR,KAAK4zC,QAAQn+B,WAAaq+B,EAAa1F,EAAQ38B,EACrFsD,EACA/U,KAAKoyC,SAAS8B,aAAazmC,EAAO0lC,EAAOc,GAGzCj0C,KAAKoyC,SAAS+B,UAAU1mC,EAAO0lC,EAAOc,IAG9CN,EAAyB9xC,UAAUqT,QAAU,SAAUR,GACnDw+B,EAAOrxC,UAAUqT,QAAQnT,KAAK/B,KAAM0U,GACpC,yBAAyB,WAAY1U,KAAKiyC,YAEvC0B,EApDkC,CAqD3C,4UCxESS,EAAmB,SAAUC,EAAOhpB,GAC3C,IAAIxlB,EAAMwlB,EAAG,GAAIrnB,EAAMqnB,EAAG,GAU1B,OATKgpB,EAAM3xC,eAAemD,IAGjB,QAAQwuC,EAAMxuC,IACnBwuC,EAAMxuC,GAAKpF,KAAKuD,GAGhBqwC,EAAMxuC,GAAO,CAACwuC,EAAMxuC,GAAM7B,GAN1BqwC,EAAMxuC,GAAO7B,EAQVqwC,GAEAC,EAAY,SAAUC,GAC7B,OAAOA,EAAYzxB,MAAM,KAAKxZ,OAAO,MAAUqF,IAAI,MAAYC,OAAOwlC,EAAkB,KAErF,SAASla,EAASzoB,GACrB,IAAI+iC,EAAgB,SAAUllC,GAAK,OAAOA,GAAK,IAC3C+b,GAAK,QAAU5Z,GAAK9C,IAAI6lC,GAAgBC,EAAappB,EAAG,GAAIyG,EAAOzG,EAAG,GACtEC,GAAK,QAAWmpB,GAAY9lC,IAAI6lC,GACpC,MAAO,CAAErsC,KADkDmjB,EAAG,GACzC6jB,OADsD7jB,EAAG,GACzCwG,KAAMA,EAAMrgB,IAAKA,GAEnD,IAAIijC,EAAW,SAAUC,GAC5B,IAAIxsC,EAAOwsC,EAAIxsC,OACXysC,EAAeD,EAAIxF,SACnBrd,EAAO6iB,EAAI7iB,OACXqd,EAAS57B,OAAOC,KAAKohC,GACpBjmC,KAAI,SAAU9I,GACf,IAAImJ,EAAQ4lC,EAAa/uC,GAEzB,QADW,QAAQmJ,GAASA,EAAQ,CAACA,IACzBL,KAAI,SAAU3K,GAAO,OAAO6B,EAAM,IAAM7B,QAEnD4K,OAAO,KAAS,IAChBqE,KAAK,KACV,OAAO9K,GAAQgnC,EAAS,IAAMA,EAAS,KAAOrd,EAAO,IAAMA,EAAO,KAE/D,SAAS+iB,EAAsBrvC,EAAM0oC,EAAS4G,EAAcC,GAC/D,OAAO,SAAU38B,GACb,IAAIX,EAAWW,EAAShB,gBAAkB,IAAI09B,EAAa18B,GACvD48B,EAAiB58B,EAASf,eAAiB,IAAI09B,EAAmB38B,EAAU81B,GAKhF,MAAO,CAAE1oC,KAAMA,EAAMiS,QAASA,EAASu9B,cAAeA,EAAe9/B,QAJrE,SAAiBR,GACbA,EAAOQ,QAAQuC,GACf/C,EAAOQ,QAAQ8/B,kaCvBvBl6B,EAA6B,WAE7B,SAASA,EAA6BpG,GAClC,IAAIvE,EAAQnQ,KACZA,KAAK0U,OAASA,EACG1U,KAAKi1C,SAAW,GAChBj1C,KAAKk1C,aAAe,GACpBl1C,KAAKm1C,qBAAuB,GAC5Bn1C,KAAKgyC,WAAa,GAEnChyC,KAAKgK,WAAa,CACdC,iBAAkBjK,KAAKiK,iBAAiB3G,KAAKtD,MAC7CgX,mBAAoBhX,KAAKgX,mBAAmB1T,KAAKtD,MACjDo1C,kBAAmB,SAAU/pC,GAAM,OAAO,QAAK8E,EAAM8kC,UAAU,SAAUn7B,GAAQ,OAAO3J,EAAMuE,OAAOyG,IAAM,IAAMrB,EAAKzO,KAAOA,MAC7HgqC,mBAAoB,WAAc,OAAOllC,EAAM8kC,UAC/CK,mBAAoB,WAAc,OAAOnlC,EAAM+kC,cAC/CK,QAAS,SAAUpX,GAEf,OADAhuB,EAAM6hC,WAAWvxC,KAAK09B,GACf,WAAc,OAAO,QAAWhuB,EAAM6hC,WAAY7T,MAwPrE,OAzOArjB,EAAY06B,sBAAwB,SAAU3kC,EAAS4kC,QAC/B,IAAhBA,IAA0BA,EAAc,IAI5C,IAAIC,EAAgBD,EAAY3yB,MAAM,KAClC9H,EAAa06B,EAAc,IAAM,WACjCx6B,GAAsB,QAASw6B,EAAc,IAAMA,EAAc,GAAK,IAGtEC,EAAwB,wBAAwBlsC,KAAKuR,GAYzD,GAXI26B,IAEAz6B,EAAsBy6B,EAAsB,GAC5C36B,EAAa26B,EAAsB,IAEV,MAAzB36B,EAAWvV,OAAO,KAClBuV,EAAaA,EAAW+L,OAAO,GAC/B7L,EAAsB,IAGN,kBACFzR,KAAKyR,GAAsB,CACzC,IAAI06B,EAAc16B,EAAoB4H,MAAM,KAAKlU,QAAO,SAAUinC,EAAQvmC,GAAK,OAAOumC,EAAOz7B,SAAWvJ,GACxGqK,EAAsB06B,EAAYpwC,SAEL,MAAxB0V,IACLA,EAAsBrK,EAAQrL,MAElC,MAAO,CAAEwV,WAAYA,EAAYE,oBAAqBA,IAG1DJ,EAAYjZ,UAAUoI,iBAAmB,SAAU4G,GAC/C,OAAQ7Q,KAAK81C,aAAejlC,GAAW7Q,KAAK81C,cAGhDh7B,EAAYjZ,UAAUmV,mBAAqB,SAAU++B,EAAU71C,GAC3DF,KAAKm1C,qBAAqBY,GAAY71C,GAE1C4a,EAAYjZ,UAAU2yB,iBAAmB,SAAUrsB,EAAMozB,GACrD,IAAIya,EAAah2C,KAAKm1C,qBAAqB5Z,EAAKnwB,OAChD,IAAK4qC,EACD,MAAM,IAAIvjC,MAAM,2DAA6D8oB,EAAKnwB,OACtF,IAAI6qC,EAAOD,EAAW7tC,EAAMozB,GAC5B,OAAO,QAAQ0a,GAAQA,EAAO,CAACA,IAUnCn7B,EAAYjZ,UAAUumC,qBAAuB,SAAU19B,GACnD,2BAA4B,cAAeA,IAC3C,QAAW1K,KAAKk1C,aAAcxqC,IAElCoQ,EAAYjZ,UAAUwmC,mBAAqB,SAAU39B,GACjD,2BAA4B,iBAAkBA,GAC9C1K,KAAKk1C,aAAaz0C,KAAKiK,IAE3BoQ,EAAYjZ,UAAU+qB,KAAO,WACzB,IAAIzc,EAAQnQ,KACRk2C,EAAel2C,KAAKi1C,SAAStmC,KAAI,SAAU4c,GAAO,MAAO,CAACA,EAAIjgB,IAAKigB,MAAS3c,OAAO,KAAY,IASnG,SAASunC,EAAgB5qC,GAErB,IADA,IAAIsF,EAAUtF,EAAOxD,SAASgC,SAAUG,EAAQ,IACvCA,GAAS2G,EAAQuJ,QACtBvJ,EAAUA,EAAQuJ,OACtB,OAAOlQ,EAGX,IAAIksC,GAAe,SAAM,SAAUC,EAASC,EAAQvlB,EAAMC,GAAS,OAAOslB,GAAUD,EAAQtlB,GAAQslB,EAAQrlB,OAkBxGulB,EAAev2C,KAAKi1C,SAASzpB,KAAK4qB,GA9BtC,SAAqB3vC,GACjB,IAAI+vC,EAAa,SAAU3lC,GAAW,OAAQA,GAAWA,EAAQuJ,OAASo8B,EAAW3lC,EAAQuJ,QAAU,EAAI,GAC3G,OAAsC,IAA/B3T,EAAO6E,IAAIwX,MAAM,KAAK1T,OAAiBonC,EAAW/vC,EAAOkiB,mBA4BJ,IAAIha,KAjB3C,SAAUlI,GAC/B,IAAIgwC,EAAkBtmC,EAAM+kC,aAAa5rC,OAAOwR,EAAYoI,QAAQgzB,EAAczvC,IAOlF,OANIgwC,EAAgBrnC,OAAS,GAIzBqnC,EAAgBjrB,KAAK4qB,EAAaD,GAAkB,IAEjD,CAAE1vC,OAAQA,EAAQiE,WAAY+rC,EAAgB,OAUrDC,EAAqBH,EAAa5nC,KAAI,SAAU8E,GAAS,OAAOA,EAAM/I,cACtEisC,EAAwB32C,KAAKk1C,aAC5B5rC,QAAO,SAAUiC,GAAU,QAAQ,QAAQmrC,EAAoBnrC,MAC/DoD,KAAI,SAAUjE,GAAc,MAAO,CAAGjE,YAAQ0N,EAAWzJ,WAAYA,MAC1E6rC,EAAax1C,SAZS,SAAU0S,IAGkB,IAA1CtD,EAAM8kC,SAAS/mC,QAAQuF,EAAMhN,SAC7BgN,EAAMhN,OAAO+E,cAAciI,EAAM/I,eASzC,IAAIksC,EAAYL,EAAan0C,OAAOu0C,GACpC32C,KAAKgyC,WAAWjxC,SAAQ,SAAU+J,GAAM,OAAOA,EAAG8rC,MAClD,mBAAoBA,IAiBxB97B,EAAYjZ,UAAUgK,eAAiB,SAAUpF,GAC7C,iCAAkC,iBAAkBA,GACpD,IAAIowC,EAAU72C,KAAKi1C,SAMnB,OAJI4B,EAAQvtC,QADY,SAAUiiB,GAAO,OAAOA,EAAIjgB,MAAQ7E,EAAO6E,KAAOigB,EAAIngB,QAAU3E,EAAO2E,SACzDgE,QAClC,iCAAkC,+BAAgC3I,GACtEowC,EAAQp2C,KAAKgG,GACbzG,KAAK4sB,OACE,YAEU,IADHiqB,EAAQ3oC,QAAQzH,IAK1B,iCAAkC,mBAAoBA,IACtD,QAAWowC,EAAX,CAAoBpwC,IAJhB,iCAAkC,uCAAwCA,KAYtFqU,EAAYjZ,UAAUi1C,UAAY,WAC9B,OAAO92C,KAAKi1C,SAAStmC,KAAI,QAAK,SAOlCmM,EAAYjZ,UAAUk1C,OAAS,WAC3B,OAAO/2C,KAAKi1C,SAAS3rC,QAAO,QAAK,YAAYqF,KAAI,QAAK,UA2D1DmM,EAAYoI,QAAU,SAAUgzB,EAAczvC,GAAU,OAAO,SAAUiE,GAErE,GAAIjE,EAAO2E,QAAUV,EAAW3C,SAASqD,MACrC,OAAO,EAEX,IAAI+8B,EAAKz9B,EAAW3C,SAChBivC,EAAa7O,EAAGptB,YAAY+H,MAAM,KAClCm0B,EAAcxwC,EAAO6E,IAAIwX,MAAM,KAGnC,KAAK,QAAOk0B,EAAYC,EAAYn1C,MAAM,EAAIk1C,EAAW5nC,SACrD,OAAO,EAGX,IAAI8nC,EAAY,EAAIF,EAAW5nC,aAAU+E,EACrCgjC,EAAoBF,EAAYn1C,MAAM,EAAGo1C,GAAWjkC,KAAK,KACzDmkC,EAAgBlB,EAAaiB,GAAmBxuB,gBACpD,OAAOwf,EAAGltB,wBAA0Bm8B,GAAiBA,EAAc5xC,QAEhEsV,EA1QqB,wDCfhC,SAAUyL,EAAQ1mB,GAAU,aAyD5B,IAAIw3C,EAAoB,gBAEpBC,EAAez3C,EAAQC,OAAO,SAAU,CAAC,OACrBy3C,KAAK,CAAEC,eAAgB,UACvBz3C,SAAS,SAkCjC,WACE,IAAIwL,EAAS,CACXksC,YAAY,EACZC,aAAa,EACbC,cAAc,EACdC,cAAc,EACdC,cAAc,EACdC,aAAa,EACbC,WAAW,EACXC,UAAU,EACVC,aAAa,EACbC,kBAAkB,GAgCpB,SAASC,EAAUtlC,EAAUulC,EAAUC,EAAqBC,GAC1D,OAAO,SAASx1C,EAAOoe,EAAMpO,GAC3B,IAAIA,EAAKpQ,eAAe20C,GAAxB,CAEA,IAAIkB,EAAgBzlC,EAAKkd,WAAWooB,IAChC7sC,EAAOgtC,IAAmBC,EAAYt3B,EAAMm3B,IAAyBvlC,EAAKylC,IAC5Ez1C,EAAMyB,OAAOuO,EAAKD,IAAW,SAAS4lC,GAEpCA,EAAUH,GAAUG,IAAYA,EAChCv3B,EAAKpO,KAAKslC,EAAUK,QAb5Bz4C,KAAKuL,OAAS,SAASmtC,GACrBntC,EAAS1L,EAAQiB,OAAOyK,EAAQmtC,IAkElC14C,KAAKU,KAAO,WACV,MAAO,CACL6K,OAAQ,SAAS1F,GACf,OAAO0F,EAAO1F,IAEhB8yC,YAAaR,OA5IfE,EAAsB,CAAC,SAAU,IAAK,QAAS,WAAY,SAAU,UAAW,WAEhFG,EAAc,SAASt3B,EAAM03B,GAC/B,IAAiD,IAA7CA,EAAc1qC,QAAQgT,EAAK,GAAG23B,UAChC,OAAO,GA8IXvB,EAAaz0C,UAAU,SAAU,CAAC,QAAS,SAASi2C,GAClD,OAAOA,EAAMH,YAAY,SAAU,cAAe,IAAI,MAEvD91C,UAAU,SAAU,CAAC,QAAS,SAASi2C,GACtC,OAAOA,EAAMH,YAAY,SAAU,cAAe,IAAI,MAEvD91C,UAAU,UAAW,CAAC,QAAS,SAASi2C,GACvC,OAAOA,EAAMH,YAAY,UAAW,eAAgBN,GAAqB,MAE1Ex1C,UAAU,YAAa,CAAC,QAAS,SAASi2C,GACzC,OAAOA,EAAMH,YAAY,YAAa,eAAgBN,GAAqB,MAE5Ex1C,UAAU,aAAc,CAAC,QAAS,SAASi2C,GAC1C,OAAOA,EAAMH,YAAY,aAAc,gBAAiBN,GAAqB,MAE9Ex1C,UAAU,aAAc,CAAC,QAAS,SAASi2C,GAC1C,OAAOA,EAAMH,YAAY,aAAc,gBAAiBN,GAAqB,MAE9Ex1C,UAAU,UAAW,CAAC,QAAS,SAASi2C,GAEvC,SAASC,EAAiBjmC,EAAMkmC,EAAgB93B,EAAM+3B,GACpD,OAAOH,EAAMvtC,OAAOytC,KACjB93B,EAAKpO,KAAKA,KACVmmC,IAAsBT,EAAYt3B,EAAMm3B,MAClB,WAAtBn3B,EAAKpO,KAAK,SAA6C,UAArBoO,EAAK,GAAG23B,UAG/C,SAASK,EAAiBC,EAAMj4B,GAI9B,OAAQA,EAAKpO,KAAK,SAAYoO,EAAKpO,KAAK,UAAYqmC,IAAUX,EAAYt3B,EAAMm3B,GAYlF,MAAO,CACLlxC,SAAU,IACVxB,QAAS,UACTyB,SAAU,IACVC,QAAS,SAAS6Z,EAAMpO,GACtB,IAAIA,EAAKpQ,eAAe20C,GAAxB,CAEA,IAAI+B,EAhBR,SAAkBtmC,EAAMoO,GACtB,IAAIhS,EAAO4D,EAAK5D,KACZiqC,EAAOrmC,EAAKqmC,KAEhB,MAA2B,cAAlBjqC,GAAQiqC,IAAiC,qBAATA,EAA+B,WAC7C,WAAlBjqC,GAAQiqC,IAAiC,kBAATA,EAA4B,QACpD,UAATjqC,GAA0C,gBAATiqC,GAAmC,WAATA,EAAqB,QAAU,GAUpFE,CAASvmC,GAErB,MAAO,CACLwmC,KAAM,SAASx2C,EAAOoe,EAAMpO,EAAMymC,GAChC,IAAIC,EAAgBT,EAAiB,WAAY,WAAY73B,GAAM,GAEnE,SAASu4B,IACP,OAAOF,EAAQG,YAcjB,OAAQN,GACN,IAAK,QACL,IAAK,WACCF,EAAiBE,EAAOl4B,IAC1BA,EAAKpO,KAAK,OAAQsmC,GAEhBL,EAAiB,eAAgB,cAAe73B,GAAM,IACxDpe,EAAMyB,OAAOk1C,EAAiC,UAAVL,EAlB1C,SAA0BO,GAGxB,IAAIlB,EAAW3lC,EAAKtO,OAAS+0C,EAAQK,WACrC14B,EAAKpO,KAAK,eAAgB2lC,IAG5B,WACEv3B,EAAKpO,KAAK,gBAAiBymC,EAAQM,SAASN,EAAQK,eAa9CJ,GACFt4B,EAAKpO,KAAK,WAAY,GAExB,MACF,IAAK,QAIH,GAHIomC,EAAiBE,EAAOl4B,IAC1BA,EAAKpO,KAAK,OAAQ,UAEhBgmC,EAAMvtC,OAAO,aAAc,CAC7B,IAAIuuC,GAAqB54B,EAAKpO,KAAK,mBAC9BA,EAAKpQ,eAAe,QAAUoQ,EAAKpQ,eAAe,UACnDq3C,GAAqB74B,EAAKpO,KAAK,mBAC9BA,EAAKpQ,eAAe,QAAUoQ,EAAKpQ,eAAe,UACnDs3C,GAAqB94B,EAAKpO,KAAK,iBAE/BgnC,GACFhnC,EAAKmnC,SAAS,OAAO,SAAgCN,GACnDz4B,EAAKpO,KAAK,gBAAiB6mC,MAG3BI,GACFjnC,EAAKmnC,SAAS,OAAO,SAAgCN,GACnDz4B,EAAKpO,KAAK,gBAAiB6mC,MAG3BK,GACFl3C,EAAMyB,OAAOk1C,GAAuB,SAAgCE,GAClEz4B,EAAKpO,KAAK,gBAAiB6mC,MAI7BH,GACFt4B,EAAKpO,KAAK,WAAY,IAKvBA,EAAKpQ,eAAe,eAAiB62C,EAAQW,YAAYC,UACzDpB,EAAiB,gBAAiB,eAAgB73B,GAAM,IAE3DpO,EAAKmnC,SAAS,YAAY,WACxB/4B,EAAKpO,KAAK,kBAAmBA,EAAe,aAI5CimC,EAAiB,eAAgB,cAAe73B,GAAM,IACxDpe,EAAMyB,QAAO,WACX,OAAOg1C,EAAQa,YACd,SAA+BT,GAChCz4B,EAAKpO,KAAK,iBAAkB6mC,cAQzC92C,UAAU,aAAc,CAAC,QAAS,SAASi2C,GAC1C,OAAOA,EAAMH,YAAY,aAAc,gBAAiBN,GAAqB,MAE9Ex1C,UAAU,cAAc,WACvB,MAAO,CACLsE,SAAU,IACVxB,QAAS,cACT4C,KAAM,SAASzF,EAAOoe,EAAMpO,EAAMunC,GAC5BvnC,EAAKpQ,eAAe20C,IAEnBn2B,EAAKpO,KAAK,cACboO,EAAKpO,KAAK,YAAa,kBAK9BjQ,UAAU,UAAU,CAAC,QAAS,SAAU,SAASi2C,EAAO33C,GACvD,MAAO,CACLgG,SAAU,IACVE,QAAS,SAAS6Z,EAAMpO,GACtB,IAAIA,EAAKpQ,eAAe20C,GAAxB,CAEA,IAAI12C,EAAKQ,EAAO2R,EAAKwnC,SACrB,OAAO,SAASx3C,EAAOoe,EAAMpO,GAEtB0lC,EAAYt3B,EAAMm3B,KAEjBS,EAAMvtC,OAAO,sBAAwB2V,EAAKpO,KAAK,SACjDoO,EAAKpO,KAAK,OAAQ,UAGhBgmC,EAAMvtC,OAAO,cAAgB2V,EAAKpO,KAAK,aACzCoO,EAAKpO,KAAK,WAAY,IAGpBgmC,EAAMvtC,OAAO,gBAAmBuH,EAAKynC,WAAcznC,EAAK0nC,YAAe1nC,EAAK2nC,SAC9Ev5B,EAAK5gB,GAAG,WAAW,SAASC,GAC1B,IAAIm6C,EAAUn6C,EAAMo6C,OAASp6C,EAAMm6C,QAEnB,KAAZA,GAA8B,KAAZA,KAEwC,IAAxDrC,EAAoBnqC,QAAQ3N,EAAM8F,OAAOwyC,WAAqBt4C,EAAM8F,OAAOu0C,mBAG7Er6C,EAAMgD,iBAERT,EAAMmB,QAGR,WACEtD,EAAGmC,EAAO,CAAE+3C,OAAQt6C,mBASnCsC,UAAU,aAAc,CAAC,QAAS,SAASi2C,GAC1C,OAAO,SAASh2C,EAAOoe,EAAMpO,GACvBA,EAAKpQ,eAAe20C,KAEpByB,EAAMvtC,OAAO,aAAgB2V,EAAKpO,KAAK,aAAgB0lC,EAAYt3B,EAAMm3B,IAC3En3B,EAAKpO,KAAK,WAAY,OA9Z5B,CAoaGyT,OAAQA,OAAO1mB,iECzalBA,QAAQC,OAAO,WAAY,CAAC,OAC3B+C,UAAU,WAAY,CAAC,KAAM,SAAUkE,GACvC,aAgCA,MAAO,CACNjE,MAAM,CACLy2C,QAAe,IACf13B,IAAe,QACfiF,IAAe,QACfgD,KAAe,SACfgxB,SAAe,aACfC,SAAe,aACfC,UAAe,cACfC,UAAe,cACfC,WAAe,eACfC,WAAe,eACfC,aAAe,iBACfC,MAAe,UACfC,MAAe,UACfC,YAAe,gBACfC,YAAe,iBAEhBpqC,YAAa,2BACPzL,QAAS,UACToP,SAAS,EACTxM,KAlDI,SAAUtH,EAAQyG,EAAUxG,GAElCA,EAAO45C,WACV75C,EAAO65C,SAAW,WAAW,OAAO,IAGjC55C,EAAO85C,YACV/5C,EAAO+5C,UAAY,WAAW,OAAO,IAGlC95C,EAAOq6C,cACVt6C,EAAOs6C,YAAc,WAAW,IAAIpiB,EAAIpyB,EAAGkF,QAAsB,OAAbktB,EAAExsB,UAAkBwsB,EAAE11B,UAGvEvC,EAAOm6C,QACVp6C,EAAOo6C,MAAQ,cAGZn6C,EAAOs6C,cACVv6C,EAAOu6C,YAAc,WAAW,IAAIriB,EAAIpyB,EAAGkF,QAAsB,OAAbktB,EAAExsB,UAAkBwsB,EAAE11B,UAGvEvC,EAAOo6C,QACVr6C,EAAOq6C,MAAQ,eA4BVt6C,WAAY,yBAInBA,WAAW,qBAAsB,CAAC,SAAU,WAAY,SAAWC,EAAQuC,GAC3E,aAEAvC,EAAOw6C,UAAal1B,OAAO7jB,eAAe,iBAAmB6jB,OAAOm1B,UAAUC,iBAAmB,EACjG16C,EAAO26C,SAAW/7C,QAAQoiB,KAAKhhB,EAAOs4C,SAEtCt4C,EAAO4gB,IAAM5gB,EAAO4gB,KAAO,EAC3B5gB,EAAO6lB,IAAM7lB,EAAO6lB,KAAO,EAC3B7lB,EAAO6oB,KAAO7oB,EAAO6oB,MAAQ,GAE7B7oB,EAAO85C,SAAW95C,EAAO26C,WAAa36C,EAAOs4C,QAE7Ct4C,EAAOg6C,UAAYh6C,EAAOg6C,WAAa,GACvCh6C,EAAO46C,cAAgB56C,EAAOg6C,UAAYh6C,EAAO6oB,KACjD7oB,EAAOi6C,WAAaj6C,EAAOi6C,YAAc,GACzCj6C,EAAOk6C,WAAal6C,EAAOk6C,YAAcl6C,EAAOg6C,UAChDh6C,EAAOm6C,aAAen6C,EAAOm6C,cAAgBn6C,EAAOi6C,WAEpD,IAAIvnB,EAAO1yB,EAAO6lB,IAAM7lB,EAAO4gB,IAC/Bi6B,EAAQnoB,EAAO1yB,EAAO6oB,KACtBiyB,EAAU96C,EAAOsD,OAAO,WAAW,WAClCtD,EAAO85C,SAAW95C,EAAO26C,WAAa36C,EAAOs4C,WAG9CyC,EAAW,SAAUC,GACpB,OAAQA,EAAM,GAAKH,EAAQnoB,GAG5B1yB,EAAOi7C,cAAgB,WACtB,OAAO,IAAIt6C,MAAMk6C,IAGlB76C,EAAOk7C,cAAgB,SAAUF,GAChC,IAAIG,EAAQ,EAAEn7C,EAAO6oB,KAErB,OADW7oB,EAAOg6C,UAAUmB,GAAQH,EAAMG,IAI3Cn7C,EAAOo7C,WAAa,SAAUJ,GAC7B,OAAOD,EAASC,IAAUh7C,EAAOs4C,QAAQt4C,EAAO4gB,KAGjD5gB,EAAOq7C,aAAe,WACjBr7C,EAAO+5C,cAAgB/5C,EAAO65C,YACjC75C,EAAOu6C,YAAY,CAACe,OAAOt7C,EAAOs4C,UAAUxuC,MAAK,WAChD9J,EAAOs4C,QAAUt4C,EAAO4gB,IACxB5gB,EAAOq6C,MAAM,CAACiB,OAAOt7C,EAAOs4C,cAK/Bt4C,EAAOu7C,SAAW,SAAUP,GAC3B,IAAKh7C,EAAO65C,WAAY,CACvB,IAAI2B,EAAW58C,QAAQoiB,KAAKhhB,EAAO4gB,IAAMm6B,EAASC,IAElDh7C,EAAOs6C,YAAY,CAACgB,OAAOE,IAAW1xC,MAAK,WAC1C9J,EAAOs4C,QAAUkD,EACjBj5C,GAAS,WACRvC,EAAOo6C,MAAM,CAACkB,OAAOt7C,EAAOs4C,kBAMhCt4C,EAAOsB,IAAI,YAAY,WACtBw5C,UAIDxjC,IAAI,CAAC,iBAAkB,SAAUjI,GACjC,aAEAA,EAAeosC,IAAI,2BAElB,siDCvHF,SAASC,EACP1mC,EACAL,EACA6C,EACAmkC,EACA71C,EACA81C,EACAC,EACAC,EACAC,GAEA,MAAMC,EAAKj9C,KA+FX,SAASk9C,EAAcr3C,EAAK8B,EAAMkF,GAChC,MAAMswC,EAAUN,EAAoBnsC,IAAI7K,IAAQ,GAE5CgH,SACKswC,EAAQlnC,EAAWJ,UAE1BsnC,EAAQlnC,EAAWJ,UAAYlO,EAGjCk1C,EAAoBO,IAAIv3C,EAAKs3C,GAG/B,SAASE,EAAOC,GA3BhB,IAAqBC,EA4BnBtnC,EAAWunC,OAAOF,GAAKA,EACvBJ,EAAcH,EAAgB9mC,EAAWunC,QA7BtBD,EA8BPD,EAAK,OAAS,OA7B1B1nC,EAAQwE,OAAOqjC,YACb,CACEF,IAAKA,GAEP,KA0BGtnC,EAAWynC,SACdznC,EAAWhS,SA7GfgS,EAAWJ,SAAWI,EAAW0nC,SAAS9nC,SAoT1ConC,EAAG5vC,QA9FH,WACE4I,EAAW2nC,OAAS,OAEpB,MAAMC,EAAY5nC,EAAW0nC,SAASG,MAChCC,EAAa9nC,EAAW0nC,SAASK,UACjCC,EAAoBhoC,EAAW0nC,SAASO,iBAAmBjoC,EAAW0nC,SAASK,UAC/EG,EAAeloC,EAAW0nC,SAASS,aACnCC,EAAmBpoC,EAAW0nC,SAASW,gBACvCC,EAAgBz8B,KAAKgF,IACzBT,SAASm4B,gBAAgBC,aACzBl4B,OAAOm4B,aAAe,GAElBC,EAAet4B,SAASm4B,gBAAgBI,YAG9Cv4B,SAASm4B,gBAAgBK,MAAMC,YAAY,oBAAqBjB,GAChEx3B,SAASm4B,gBAAgBK,MAAMC,YAAY,qBAAsBf,GACjE13B,SAASm4B,gBAAgBK,MAAMC,YAAY,4BAA6Bb,GACxE53B,SAASm4B,gBAAgBK,MAAMC,YAC7B,uBACAX,GAEF93B,SAASm4B,gBAAgBK,MAAMC,YAC7B,2BACAT,GAEFh4B,SAASm4B,gBAAgBK,MAAMC,YAC7B,wBACAP,GAEFl4B,SAASm4B,gBAAgBK,MAAMC,YAC7B,uBACAH,GAGF,IAAII,GAAK,EACT,MAAMC,EAAiBnC,EAAoBnsC,IAAIssC,IAAoB,GAC7DiC,EAAgBpC,EAAoBnsC,IAAIqsC,IAAmB,GAEjE9mC,EAAWipC,QAAUF,EAAe/oC,EAAWJ,UAC3CmpC,EAAe/oC,EAAWJ,UAC1B,GACJI,EAAWunC,OAASyB,EAAchpC,EAAWJ,UACzCopC,EAAchpC,EAAWJ,UACzB,GAEAI,EAAWipC,QAAQC,aAAelpC,EAAWunC,OAAOF,GACtDyB,GAAK,EAEL9oC,EAAWunC,OAAOF,IAAK,EAGa,iBAAlCrnC,EAAW0nC,SAASyB,WACtB/B,EAAO0B,GAvMTtmC,EAAOi5B,GA/DT,WACE,MAAM2N,EAASppC,EAAW0nC,SAAS0B,OAC7BH,KACJjpC,EAAWipC,SACXjpC,EAAWipC,QAAQC,aACnBlpC,EAAWipC,QAAQC,YAAY9zC,IAG3Bi0C,EACJ/P,OAAOt5B,EAAW0nC,SAAS4B,kBAC3BhQ,OAAOt5B,EAAW0nC,SAAS6B,qBACzBjQ,OAAOt5B,EAAW0nC,SAAS4B,iBAE/B,SAAML,IAAaI,GAAYD,GAkDrBI,GAAa,aAAe,cAAe,KAAM,CACzD5pC,SAAU,YA4MZ,IAAI0nC,EAAM,GAERA,EADEtnC,EAAW0nC,SAAS0B,SAAWppC,EAAW0nC,SAAS+B,gBAC/C,OAEA,UAGR9pC,EAAQwE,OAAOqjC,YACb,CACEF,IAAAA,EACAM,UAAAA,EACAE,WAAAA,EACAQ,cAAAA,EACAI,aAAAA,GAEF,KAGF,MAAME,EAAQx4B,SAASs5B,cAAc,SACrCt5B,SAASpB,KAAK26B,YAAYf,GAC1BA,EAAMgB,MAAMC,WACV,2BAA6B7pC,EAAW0nC,SAASG,MAAQ,gBAe7Db,EAAG8C,MApMH,WACE,MAAMZ,EAAclpC,EAAWipC,QAAQC,YAEvC,GAAIA,GAAeA,EAAY9zC,GAAI,CAEjC,MAAM20C,EAAUpD,EACboD,UACA5lC,OAAOva,QAAQkD,QAAQsjB,SAAS45B,cAAc,eAC9CC,qBAAoB,GACpB/M,MACCl9B,EAAW0nC,SAASwC,iBAClB,yCAEHC,GAAG,MACHj8C,OAAO,UAEVy4C,EACGyD,KAAKL,GACLj1C,MAAK,WACJ,OAAO+xC,EAAIwD,gBAAgBC,aAAa,CACtCl1C,GAAI8zC,EAAY9zC,GAChBm1C,QAAQ,EACRC,YAAa,UACbC,SAAUC,GAAAA,GAAS/4B,OAAO,yBACzBg5B,YAEJ71C,MAAK,WACJ0N,EAAOi5B,GAAG,cAAe,KAAM,CAC7B77B,SAAU,eAGbwM,OAAM,SAAU6K,GACf1G,QAAQnhB,MAAM,YAAa6nB,QAqKnC+vB,EAAGI,OAASA,EACZJ,EAAG4D,SAjKH,WACE,MAAMC,EAAW/5C,EAAGkF,QACdkzC,EAAclpC,EAAWipC,QAAQC,YA2DvC,OAzDIA,GAAeA,EAAY9zC,IAC7ByxC,EAAIwD,gBACDS,YAAY,CACXC,MAAO7B,EAAY9zC,GACnB41C,YAAY,IAEbL,SAAS71C,MAAK,SAAUpD,GACvBm5C,EAASn0C,QACPu0C,GAAAA,CAAKv5C,EAAKw5C,KAAKr/C,MAAM,IAAI,SAAUs/C,GACjC,IAAIC,EASJ,GAPsB,OAAlBD,EAAIE,YACND,EACEprC,EAAW0nC,SAAS4D,eACpBtrC,EAAWipC,QAAQhwB,MACnB,UAAYkyB,EAAII,WAGE,QAAlBJ,EAAIE,UACN,OAAQrrC,EAAW0nC,SAAS8D,iBAC1B,IAAK,gBACHJ,EAASD,EAAIM,OACTzrC,EAAW0nC,SAASgE,WAAaP,EAAIM,OACrC,SACJ,MAEF,IAAK,cACHL,EAASD,EAAIM,OACTN,EAAIQ,KAAKC,OAAST,EAAIQ,KAAKE,SAC3B,SACJ,MAEF,IAAK,iBACHT,EAASD,EAAIM,OAASN,EAAIQ,KAAKE,SAAW,SAC1C,MAEF,QACET,EAASD,EAAIM,OACTzrC,EAAW0nC,SAASgE,WAAaP,EAAIM,OACrC,SAKV,MAAO,CACLL,OAAQA,EACRvd,QAASsd,EAAIW,KACbC,UAAWrB,GAAAA,CAAOS,EAAIY,WAAWp6B,OAAO,+BAK/CvF,OAAM,SAAU6K,GACf1G,QAAQnhB,MAAM6nB,MAIb4zB,EAASr9C,SAqGlBw5C,EAAGgF,eA/OH,WACE,MAA4C,YAArChsC,EAAW0nC,SAASuE,aAA6B,OAAS,OA+OnE,MAAMC,EAAgB,CACpB9C,OAAQ,CAAC,SAAU,OAAQ,UAAW,UAAW,aACjD+C,QAAS,CAAC,YAKZ7uC,OAAO+6B,eAAer4B,EAAY,cAAe,CAC/CvF,MACE,IAAIpK,EAAS2P,EAAW0nC,SAAS0E,aAKjC,OAJIF,EAAc9C,OAAO/lC,SAASrD,EAAW2nC,QAC3Ct3C,EAAS2P,EAAW0nC,SAAS2E,cACtBH,EAAcC,QAAQ9oC,SAASrD,EAAW2nC,UACjDt3C,EAAS2P,EAAW0nC,SAAS4E,gBACxBj8C,KAKX2P,EAAWinC,cAAgBA,EAE3B32B,OAAOi8B,iBACL,WACA,SAAUtsC,GACa,SAAjBA,EAAIvO,KAAKuO,IACXmnC,GAAO,GACmB,SAAjBnnC,EAAIvO,KAAKuO,KAClBmnC,GAAO,MAGX,qdC1WJ,SAASoF,EAASxsC,EAAYF,GAE5B,MAAM3H,EAAS2H,EAAUo5B,SAEzBl5B,EAAW0nC,SAAW,CACpB+E,OAAQ,UACRC,MAAM,GAGRC,GAAAA,CAAOx0C,GAAQ,SAAU5J,EAAOqB,GAChB,KAAVrB,GAAiBq+C,GAAAA,CAAOr+C,KACZ,SAAVA,IACFA,GAAQ,GAGI,UAAVA,IACFA,GAAQ,GAGVyR,EAAW0nC,SAAS93C,GAAOrB,MAcjC,SAASs+C,EACPC,EACAC,EACA3uC,EACA4uC,EACAC,EACAC,GAEA9uC,EAAkBgB,WAAU,GAIvB4tC,EAAchjD,SAAS0R,QAAQjB,MAClCuyC,EAAchjD,SAAS0R,QAAQjB,IAAM,IAIvCuyC,EAAchjD,SAAS0R,QAAQjB,IAAI,qBACjC,gCAEFuyC,EAAchjD,SAAS0R,QAAQjB,IAAI,iBAAmB,WACtDuyC,EAAchjD,SAAS0R,QAAQjB,IAAI0yC,OAAS,WAG5CF,EAA4BG,UAAUF,GAGtCJ,EACGt1C,MAAM,MAAO,CACZkxB,UAAU,IAEXlxB,MAAM,cAAe,CACpBgE,IAAK,WACLL,YAAakyC,EACbtiD,WAAY,4BAEbyM,MAAM,aAAc,CACnBgE,IAAK,UACLL,YAAamyC,EACbviD,WAAY,2BAEbyM,MAAM,cAAe,CACpBgE,IAAK,WACLL,YAAaoyC,EACbxiD,WAAY,4BAEbyM,MAAM,WAAY,CACjBgE,IAAK,QACLL,YAAaqyC,EACbziD,WAAY,yBAEbyM,MAAM,gBAAiB,CACtBgE,IAAK,aACLL,YAAasyC,EACb1iD,WAAY,8BAEbyM,MAAM,cAAe,CACpBgE,IAAK,WACLL,YAAauyC,EACb3iD,WAAY,+PCnGlB,SAAS4iD,EACP3tC,EACAwC,EACAorC,EACA/G,EACAE,EACAD,GAEA,MAAME,EAAKj9C,KAIX,SAASmmC,EAAY3gC,GACnB,OAAO,SAAU0nB,GACf+vB,EAAG6G,OAAOt+C,GAAQ0nB,EAAIvlB,KAEtB,MAAMo8C,EAAQF,EACXG,SACAC,YACChuC,EAAW0nC,SAASuG,0BAClB,yBAEHC,WAAW,oBACXC,SAAS,OAEZP,EAASxD,KAAK0D,IAIlB,SAASM,IACPpuC,EAAWquC,SAAU,EAYvB,SAASC,IACHtuC,EAAW0nC,SAAS0B,OACtB5mC,EAAOi5B,GAAG,aAAc,KAAM,CAAE77B,SAAU,YAE1C4C,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,YAI/C,SAASylC,IACP2B,EAAGuH,KAAO,GACVvH,EAAGwH,QAAU,KACbxH,EAAGyH,UAAY,KACfzH,EAAG0H,SAASC,eACZ3H,EAAG0H,SAASE,uBAEL5uC,EAAWipC,QAAQC,YAE1BlpC,EAAW6uC,gBAAiB,EAiD9B7H,EAAG5vC,QA3EH,WACE4I,EAAW2nC,OAAS,UAGpB3nC,EAAWinC,cAAcF,EAAiB,MAAM,GAChD/mC,EAAWinC,cAAcH,EAAgB,MAAM,GAC/C9mC,EAAWquC,SAAU,GAsEvBrH,EAAG8H,OA1CH,WACE9uC,EAAWquC,SAAU,EAEjBruC,EAAWipC,QAAQC,aAAelpC,EAAWipC,QAAQC,YAAY9zC,GACnEyxC,EAAIwD,gBACDP,MACCiF,GAAAA,CACE,CACE35C,GAAI4K,EAAWipC,QAAQC,YAAY9zC,GACnC45C,WAAYhvC,EAAW0nC,SAASsH,WAChCC,SACEjvC,EAAW0nC,SAAS4D,eAAiBtrC,EAAWipC,QAAQhwB,MAE5D+tB,EAAGuH,OAGN5D,SAAS71C,MAAK,kBACNkyC,EAAG6G,OAAOiB,OAEjB,MAAMhB,EAAQF,EACXG,SACAC,YACChuC,EAAW0nC,SAASwH,0BAClB,2BAEHhB,WAAW,oBACX/pC,OAAOva,QAAQkD,QAAQsjB,SAAS45B,cAAc,mBAEjD4D,EAASxD,KAAK0D,MAEfh5C,KAAKuwC,GACLvwC,KAAKw5C,GACLliC,MAAM8jB,EAAY,WAClBif,QAAQf,IAEXA,IACAle,EAAY,YAOhB8W,EAAGoI,KAhDH,WACE/J,IACAiJ,KAgDFtH,EAAGuH,KAAO,GACVvH,EAAG6G,OAAS,GC/Gd,SAASwB,EAAWrvC,EAAYsvC,GAC9B,MAAMC,EAAgB,CACpBn6C,GAAI,MACJkW,MAAOtL,EAAW0nC,SAASp8B,OAGvBu7B,EAAM,GAqEZ,OAnEAA,EAAI2I,QAAUxvC,EAAW0nC,SAAS+H,OAAS,QAE3C5I,EAAI6I,YAAcJ,EAChBzI,EAAI2I,QAAU,oBACdD,EACA,CACEvc,OAAQ,CACN2c,OAAQ,OACRn0C,IAAKqrC,EAAI2I,QAAU,4BAErBrD,QAAS,CACPwD,OAAQ,OACRn0C,IAAKqrC,EAAI2I,QAAU,6BAErBI,UAAW,CACTD,OAAQ,MACRn0C,IAAKqrC,EAAI2I,QAAU,8BAKzB3I,EAAIwD,gBAAkBiF,EACpBzI,EAAI2I,QAAU,wBACdD,EACA,CACEppC,OAAQ,CACNwpC,OAAQ,MACRn0C,IAAKqrC,EAAI2I,QAAU,yBAErBlF,aAAc,CACZqF,OAAQ,MACRn0C,IAAKqrC,EAAI2I,QAAU,uCAErB1F,MAAO,CACL6F,OAAQ,MACRn0C,IAAKqrC,EAAI2I,QAAU,+BAErB1E,YAAa,CACX6E,OAAQ,MACRn0C,IAAKqrC,EAAI2I,QAAU,wCAErBK,iBAAkB,CAChBF,OAAQ,OACRn0C,IAAKqrC,EAAI2I,QAAU,0CACnB9zC,QAAS,CACP,oBAAgBwC,GAElB4xC,iBAAkBlmD,QAAQ6c,UAE5BspC,mBAAoB,CAClBJ,OAAQ,MACRn0C,IAAKqrC,EAAI2I,QAAU,+CAKzB3I,EAAImJ,YAAcV,EAChBzI,EAAI2I,QAAU,oBACdD,EACA,CACEppC,OAAQ,CACNwpC,OAAQ,MACRn0C,IAAKqrC,EAAI2I,QAAU,uBAKlB3I,uRC9DT,SAASoJ,EACPjlD,EACAgV,EACAzS,EACA2iD,EACAC,EACA3tC,EACApI,EACAysC,EACAE,EACAD,GAEA,MAAME,EAAKj9C,KACX,IAAIqmD,EACAC,EACAC,EACAC,EAmBJ,SAASC,IACPjjD,GAAS,WACP,MAAMT,EAAUqjD,EAAU,GAAGM,uBAAuB,iBAAiB,GAEjE3jD,IACFA,EAAQ4jD,UAAY5jD,EAAQ6jD,iBAMlC,SAASzgB,EAAY3gC,GACnB,OAAO,SAAU0nB,GACf+vB,EAAG6G,OAAOt+C,GAAQ0nB,EAAIvlB,KAEtB8+C,KAIJ,SAASI,EAAY/iB,GACnBgZ,EAAI6I,YACD1c,OAAOnF,GACP8c,SAAS71C,MAAK,SAAUpD,UAChBs1C,EAAG6G,OAAOgD,iBAEbjE,GAAAA,CAAO5sC,EAAWipC,QAAQC,eAC5BlpC,EAAWipC,QAAQC,YAAc,CAC/B9zC,GAAI1D,EAAKw3C,YAAY9zC,IAGvB4K,EAAWinC,cAAcF,EAAiB/mC,EAAWipC,UAGvDmH,EAAU,GAAGU,aAAaC,QAAQ,IAElCP,OAEDpkC,MAAM8jB,EAAY,qBAwDvB,SAASoe,IACHtuC,EAAW0nC,SAAS0B,OACtB5mC,EAAOi5B,GAAG,aAAc,KAAM,CAAE77B,SAAU,YAE1C4C,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,YAkB/C,SAASoxC,IAELhxC,EAAWipC,SACXjpC,EAAWipC,QAAQC,aACnBlpC,EAAWipC,QAAQC,YAAY9zC,IAE/ByxC,EAAIwD,gBACD5vC,IAAI,CACHrF,GAAI4K,EAAWipC,QAAQC,YAAY9zC,KAEpCu1C,SAAS71C,MAAK,SAAUpD,UAChBs1C,EAAG6G,OAAOmD,eAGbt/C,EAAK64C,SACPvqC,EAAWipC,QAAQC,YAAYqB,QAAS,EACxCvqC,EAAWinC,cAAcF,EAAiB/mC,EAAWipC,SAE5B,cAArBv3C,EAAKu/C,YACPzuC,EAAOi5B,GAAG,gBAAiB,KAAM,CAAE77B,SAAU,YAE7C4C,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,gBAIhDwM,OAAM,SAAU6K,GACf,OAAQA,EAAI0wB,QACV,KAAK,IACHnlC,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,YAC3C,MACF,KAAK,IAEHI,EAAWinC,cAAcF,EAAiB,MAAM,GAChD/mC,EAAWinC,cAAcH,EAAgB,MAAM,GAC/CwH,IACA,MACF,KAAK,IACH9rC,EAAOi5B,GAAG,gBAAiB,KAAM,CAAE77B,SAAU,YAC7C,MACF,QACE2Q,QAAQnhB,MAAM6nB,OAQ1B,SAASi6B,EAAMtM,GACb,MAAMkH,EAAOsE,EAAU,GAAGU,aAAaK,UAEnCvM,GAA6B,KAAnBA,EAAOH,SAAkBG,EAAOwM,UAK1CxM,GAA6B,KAAnBA,EAAOH,SAKR,KAATqH,GAKJ8E,EACE7B,GAAAA,CACE,CACEjD,KAAMA,GAER9rC,EAAWipC,UAqCjB,SAAS6B,IAEL9qC,EAAWipC,SACXjpC,EAAWipC,QAAQC,aACnBlpC,EAAWipC,QAAQC,YAAY9zC,IAE/ByxC,EAAIwD,gBACDS,YAAY,CACXC,MAAO/qC,EAAWipC,QAAQC,YAAY9zC,GACtCi8C,cAAc,EACdj8C,GAAIm7C,QAAiBryC,IAEtBysC,SAAS71C,MAAK,SAAUpD,GAIvB,UAHOs1C,EAAG6G,OAAO3E,YAGbx3C,EAAKuC,MAAO,CACd,IAAIq9C,GAAQ,EACRlqC,EAAI,EACR,IAAKA,EAAI,EAAGkqC,GAAQ,EAAOlqC,EAAI1V,EAAKw5C,KAAK/xC,OAAQiO,IAAK,CACpD,MAAMrI,EAAIwyC,GAAAA,CAAMvxC,EAAWwxC,SAAU,CACnCp8C,GAAI1D,EAAKw5C,KAAK9jC,GAAGhS,KAEd2J,EAGMrN,EAAKw5C,KAAK9jC,GAAGywB,OACtB94B,EAAE84B,MAAO,IAHTyZ,GAAQ,EACRtxC,EAAWwxC,SAAShnD,KAAKkH,EAAKw5C,KAAK9jC,KAMN,QAA3B1V,EAAKw5C,KAAK9jC,GAAGikC,WAAwB35C,EAAKw5C,KAAK9jC,GAAGywB,OA1C3CziC,EA2CK1D,EAAKw5C,KAAK9jC,GAAGhS,GA1ChCyxC,EAAImJ,YACR7pC,OAAO,CACN/Q,GAAIA,EACJyiC,MAAM,IAEP8S,SAASv+B,OAAM,SAAU6K,GACxB1G,QAAQnhB,MAAM6nB,OAwCNq6B,GAEFd,IAGE9+C,EAAKw5C,KAAK9jC,EAAI,GAAGywB,OACnB0Y,EAAgB7+C,EAAKw5C,KAAK9jC,EAAI,GAAGhS,IArD7C,IAAuBA,KAyDhBgX,OAAM,SAAU6K,GACf,OAAQA,EAAI0wB,QACV,KAAK,IACHnlC,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,YAC3C,MACF,KAAK,IACH4C,EAAOi5B,GAAG,gBAAiB,KAAM,CAAE77B,SAAU,YAC7C,MACF,QACE2Q,QAAQnhB,MAAM6nB,OAtS1B+vB,EAAG6G,OAAS,GACZ7tC,EAAWwxC,SAAW,GACtBxK,EAAGyK,aAAe,CAChBC,gBAAgB,EAChBC,YAAY,EACZC,OAAO,EACPt/C,MAAM,EACNu/C,WAAY,UA4Ud7K,EAAG5vC,QAvCH,WACE4I,EAAW2nC,OAAS,OACpB3nC,EAAWquC,SAAU,EACrBruC,EAAW0nC,SAASoK,UAAW,EAE/B9K,EAAG+K,aAAe,GAGhB/xC,EAAWipC,QAAQC,aACnBlpC,EAAWipC,QAAQC,YAAYqB,QAG/BvqC,EAAWinC,cAAcF,EAAiB,MAAM,GAChD/mC,EAAWinC,cAAcH,EAAgB,MAAM,GAE/CwH,MAGA0C,IAGAX,EAAsBH,EAAUpF,EAAa,KAC7CwF,EAAyBJ,EAAUc,EAAgB,MAGrDZ,EAAY4B,EAAE,iBAAiBlB,aAAa,CAC1CmB,YAAajyC,EAAW0nC,SAASwK,oBAAsB,iBACvD9nD,OAAQ,CACN+nD,MAAO,SAAUC,EAAQxN,GACvBsM,EAAMtM,IAERyN,MAAO,WACLtoD,KAAKuoD,gBAQbtL,EAAGkK,MAAQA,EACXlK,EAAGuL,aAtIH,WACE,MAAMzG,EAAOsE,EAAU,GAAGU,aAAaK,UAG1B,KAATrF,IAKJ8E,EACE7B,GAAAA,CACE,CACEjD,KAAMA,GAER9rC,EAAWipC,UAIfmH,EAAU,GAAGU,aAAawB,aAqH5BtL,EAAGr4C,UA9RH,SAAmB+C,GACjB,MAAM8gD,EAAK,IAAIC,SAEfD,EAAGpuB,OAAO,OAAQ1yB,EAAK7B,MAEvBuK,EACGipC,KACCrjC,EAAW0nC,SAAS+H,OAClB,0BACAzvC,EAAWipC,QAAQC,YAAY9zC,GAC/B,4BACA4K,EAAW0nC,SAASp8B,MACtBknC,EACA,CACE1C,iBAAkBlmD,QAAQ6c,SAC1B/K,QAAS,CACP,oBAAgBwC,KAIrBpJ,MAAK,SAAUpD,IACdA,EAAOA,EAAKA,MAEH0D,WACA4xC,EAAG6G,OAAO6E,eAGjB9B,EACE7B,GAAAA,CACE,CACEjD,KACE,YACA9rC,EAAW0nC,SAAS+H,OACpB,0BACAzvC,EAAWipC,QAAQC,YAAY9zC,GAC/B,iCACA1D,EAAK0D,GACL,UACA4K,EAAW0nC,SAASp8B,MACpB,qBACA5Z,EAAKnC,KACL,OACFojD,aAAcjhD,EAAK0D,IAErB4K,EAAWipC,WAIf/Y,EAAY,oBAEbA,EAAY,oBA+OnBllC,EAAOsB,IAAI,YApOX,WACE4jD,EAAUhiD,OAAOmiD,GACjBH,EAAUhiD,OAAOoiD,GAEjBD,EAAsB,KACtBC,EAAyB,QAgO3BtwC,EAAW1T,IAAI,aA7Nf,SAAoBoF,EAAMnH,GACpBA,GACFA,EAASqoD,GAAAA,CAAQ5yC,EAAWwxC,oUClJlC,SAASqB,EACP7nD,EACAgV,EACA8yC,EACAjM,EACA+G,EACAn8C,EACA2I,GAEA,MAAM4sC,EAAKj9C,KACX,IAAIgpD,EAAU,KACVC,EAAgB,KACpBhzC,EAAWizC,UAAY,GAEvB,MAAMC,EAAkB,CACtBC,sBAAsB,EACtBC,mBAAmB,EACnBj+B,QAAS,SAAU5mB,GACjB,MAAqB,kBAAVA,GACDA,EAAQ,IAAM,IAEjBA,IA4GX,SAAS8kD,WACArM,EAAG6G,OAAOiB,OACjB9uC,EAAWzJ,MAAM,QAGjBywC,EAAGsM,OAASC,GAAAA,CAAWP,GAEvBhM,EAAGuH,KAAO,GACVvH,EAAG0H,SAASC,eACZ3H,EAAG0H,SAASE,gBAEZ,MAAMd,EAAQF,EACXG,SACAC,YACChuC,EAAW0nC,SAASwH,0BAClB,2BAEHhB,WAAW,oBACX/pC,OAAOva,QAAQkD,QAAQsjB,SAAS45B,cAAc,mBAEjD4D,EAASxD,KAAK0D,GA5HhB9G,EAAGwM,YAAc,SAAUlkD,GACzB,OAAOwjD,EAAKU,YAAYlkD,IA8Q1B03C,EAAGyM,iBArDH,SAA0BzN,GAExB,MAAM0N,EAAW1M,EAAGsM,OAAOtN,GACrB2N,EAAaliD,EAASoZ,KAAK,gBACjC,GAAI8oC,EAAWx6C,OAAQ,CACrB,MAAMy6C,EAAShqD,QAAQkD,QACrB6mD,EAAW,GAAG3J,cAAc,mBAExBrtC,EAAQ/S,QAAQkD,QACpB6mD,EAAW,GAAG3J,cAAc,qBAExB6J,EAAQD,EAAO/oC,KAAK,SAEtBgpC,EAAM16C,QACR06C,EAAMC,IAAI,UAAW,QAGvBF,EAAOvpD,GAAG,SAAS,KACjBwpD,EAAMC,IAAI,UAAW,QACI,mBAAlBn3C,EAAMo3C,QACTp3C,EAAMo3C,QAAQ,SACdp3C,EAAM,GAAGq3C,WAGfr3C,EAAMtS,GAAG,UAAWgiB,IAClBrhB,EAAOgD,QAAO,WACwB,iBAAzB0lD,EAASO,MAAM7kD,QACxBskD,EAASO,MAAM7kD,MAAQ,MAKzB,MAAMmB,EAAQ5E,MAAMstB,KAAK5M,EAAEjc,OAAOG,OAE5B2jD,EAhSL,QAgSiBR,EAASp+C,OAAOqa,KACdpf,EAAM4jD,MAAMtkD,GAASA,EAAK8f,MAAQukC,KAKpDR,EAASxpD,QAAU,GACnBwpD,EAASO,MAAM7kD,MAAQskD,EAASp+C,OAAO8+C,gBAEvCV,EAASxpD,QAAUqG,EAAMmI,KAAK7I,IAC5B,MAAM,KAAEN,EAAF,KAAQogB,EAAR,KAAc1W,GAASpJ,EAC7B,MAAO,CAAEN,KAAAA,EAAMogB,KAAAA,EAAM1W,KAAAA,EAAMpJ,KAAAA,MAG/Bm3C,EAAGuH,KAAKmF,EAASO,MAAM/W,OAASwW,EAASxpD,gBAkBjD88C,EAAGqN,eANH,SAAwBX,EAAU1N,GAGhC0N,EAASxpD,QAAQqf,OAAOy8B,EAAO,GAC/BgB,EAAGuH,KAAKmF,EAASO,MAAM/W,OAASwW,EAASxpD,SAuB3C88C,EAAGsN,eAfH,SAAwBZ,GACtBnjC,QAAQN,IAAI,kBAAmByjC,GAC/B,MAAMC,EAAaliD,EAASoZ,KAAK,gBAC3BlO,EAAQ/S,QAAQkD,QACpB6mD,EAAW,GAAG3J,cAAc,sBAExB,eAAEuK,EAAF,OAAkB3pC,GAAW8oC,EAASp+C,OACxCi/C,GACF53C,EAAME,KAAK,WAAY,YAErB+N,GACFjO,EAAM,GAAG63C,aAAa,SAAU5pC,IAapCo8B,EAAGyN,uBAPH,WACE,MAAMC,EAAW/oD,MAAMstB,KAAKxnB,EAASoZ,KAAK,oBACpC8pC,EAAUD,EAASA,EAASv7C,OAAS,GACvCw7C,GAAWA,EAAQ1tC,gBACrB0tC,EAAQ1tC,kBAMZ+/B,EAAG5vC,QAhTH,WACE4I,EAAW2nC,OAAS,UAGpBX,EAAGiC,QAAU,CACX7zC,GAAI4K,EAAW0nC,SAAStyC,GACxBw/C,cAAe,YACf37B,KAfK,YAAc47B,GAAAA,CAAQ,EAAG,MAkBhC70C,EAAW0nC,SAASoK,UAAW,EAC/B9xC,EAAWquC,SAAU,EAErBxH,EAAI6I,YACDE,UAAU,CACTx6C,GAAI4K,EAAW0nC,SAAStyC,GACxBg0C,QAAQ,IAETuB,SAAS71C,MAAK,SAAUpD,GACnBA,EAAKuC,QACP8+C,EAAUrhD,EAAKqhD,QACfC,EAAgBO,GAAAA,CAAW7hD,EAAKw5C,MAChClE,EAAGsM,OAASC,GAAAA,CAAWP,OAG1Bl+C,MAAK,WACJ,IAAK,IAAIsS,EAAI,EAAGA,EAAI4/B,EAAGsM,OAAOn6C,OAAQiO,IAAK,CACzC,MAAM0tC,EAAQ9N,EAAGsM,OAAOlsC,GAExB,GADApH,EAAWizC,WAAa6B,EAAM77C,UACH,IAAhB67C,EAAMb,OACXa,EAAMb,MAAMc,SAAU,CACxB,MAAMC,EAAS9hD,OAAOtH,UAAUshB,KAAK7f,KAAK,gBAC1C25C,EAAGiO,UAAU7tC,GAAK4tC,EAAOF,EAAMb,MAAMc,eAK5C3oC,OAAM,SAAU6K,GACf1G,QAAQnhB,MAAM6nB,OA2QpB+vB,EAAG8H,OA5LH,WAEE9uC,EAAWquC,SAAU,EAErB,MAAM38C,EAAO,IAAKs1C,EAAGuH,MAErB,IAAK,IAAInnC,EAAI,EAAGA,EAAI4/B,EAAGsM,OAAOn6C,OAAQiO,IAAK,CACzC,MAAM0tC,EAAQ9N,EAAGsM,OAAOlsC,GACpB0tC,EAAMb,YAA4C,IAA5BviD,EAAKojD,EAAMb,MAAM/W,SAEpC0P,GAAAA,CAAOkI,EAAMI,WAChBlO,EAAGiC,QAAQ6L,EAAMI,SAAWvpD,MAAMoQ,QAAQrK,EAAKojD,EAAMb,MAAM/W,QACvDxrC,EAAKojD,EAAMb,MAAM/W,OAAOlgC,OACxBtL,EAAKojD,EAAMb,MAAM/W,QAGnB91B,IAAM2rC,IACHnG,GAAAA,CAAO5sC,EAAW0nC,SAASkN,iBAC9B5N,EAAGiC,QAAQ2L,cAAgB50C,EAAW0nC,SAASkN,cAC/C5N,EAAGiC,QAAQhwB,KAAOttB,MAAMoQ,QAAQrK,EAAKojD,EAAMb,MAAM/W,QAC7CxrC,EAAKojD,EAAMb,MAAM/W,OAAOlgC,OACxBtL,EAAKojD,EAAMb,MAAM/W,SAIN,WAAf4X,EAAM77C,OACRvH,EAAKojD,EAAMb,MAAM/W,OAASxrC,EAAKojD,EAAMb,MAAM/W,OAAOxkC,KAC/C+U,GAASA,EAAK5d,SAMvB,MAAMslD,EAAexpD,MAAMoQ,QAAQirC,EAAGsM,QAClCtM,EAAGsM,OAAOjgD,QAAQyhD,GAAyB,WAAfA,EAAM77C,OAClC,GAEEm8C,EAAUrG,GAAAA,CACd,CACEjD,KAAMp6C,GAERs1C,EAAGiC,SAGCoM,EAA4B,MAAR3jD,GAAgByjD,EAAah8C,OAAS,EAC1Dm8C,EAAyB,OAAT5jD,GAA0C,OAAzBqW,KAAKE,UAAUvW,GAnFxD,IAAgB6jD,EApCKhmD,GAwHG8lD,GApFRE,EAqFHH,EApFJh7C,EAAM,CACXoB,IAAM,GAAEqrC,EAAI2I,wBAAwB+F,EAAQngD,aAC5CsG,QAAS,CAAE,oBAAgBwC,GAC3BxM,KAAM8jD,GAAAA,CAAeD,EAAS,IACzBrC,EACHuC,gBAAiB,IAAIhD,WAEvB9C,OAAQ,UA8EN2F,EACAzO,EAAI6I,YAAYvD,QAAQiJ,GAASzK,SACjC+K,QAAQC,OAAO,iBAGhB7gD,KAAKu+C,GACLjnC,OAhIgB7c,EAgIE,SAjHZ,SAAU0nB,GACf,MAAM62B,EAAQF,EACXG,SACAC,YACChuC,EAAW0nC,SAASuG,0BAClB,yBAEHC,WAAW,oBACX/pC,OAAOva,QAAQkD,QAAQsjB,SAAS45B,cAAc,mBAEjD4D,EAASxD,KAAK0D,GAEd9G,EAAG6G,OAAOt+C,GAAQ0nB,EAAIvlB,QAsGvBy9C,SAAQ,KACFnI,EAAGuH,KAAKngB,UACX4Y,EAAGuH,KAAO,IAjLhBvuC,EAAWquC,SAAU,MAqTvBrH,EAAGI,OA9HH,SAAgB73C,EAAM2a,GACf88B,EAAGuH,KAAKh/C,KACXy3C,EAAGuH,KAAKh/C,GAAQ,IAGlB,MAAMyJ,EAAMguC,EAAGuH,KAAKh/C,GAAM0I,QAAQiS,GAC9BlR,GAAO,EACTguC,EAAGuH,KAAKh/C,GAAMga,OAAOvQ,EAAK,GAE1BguC,EAAGuH,KAAKh/C,GAAM/E,KAAK0f,IAsHvB88B,EAAG7c,OAlHH,SAAgB56B,EAAM2a,GAKpB,OAJK88B,EAAGuH,KAAKh/C,KACXy3C,EAAGuH,KAAKh/C,GAAQ,IAGXy3C,EAAGuH,KAAKh/C,GAAM0I,QAAQiS,IAAS,GA8GxC88B,EAAGiO,UAAY,GAEfjO,EAAGuH,KAAO,GACVvH,EAAG6G,OAAS,GACZ7G,EAAG0H,SAAW,GC1WhB,SAASkH,EACP51C,EACAwC,EACAswC,EACA14C,EACAysC,EACAE,GAEA,MAAMC,EAAKj9C,KACX,IAAIgpD,EAAU,KAkHd,SAAS8C,IACP,MAAO,YAAchB,GAAAA,CAAQ,EAAG,KAlHlC7N,EAAGiO,UAAY,GAGfjO,EAAGuH,KAAO,GACVvH,EAAG6G,OAAS,GACZ7G,EAAG0H,SAAW,GACd1H,EAAG8O,aAAc,EAEjB9O,EAAGwM,YAAc,SAAUlkD,GACzB,OAAOwjD,EAAKU,YAAYlkD,IAmP1B03C,EAAG5vC,QAlHH,WAGE,GAFA4I,EAAW2nC,OAAS,SAEhB3nC,EAAWipC,SAAWjpC,EAAWipC,QAAQC,YAC3C,GAAIlpC,EAAWipC,QAAQC,YAAY9zC,GACjC,GAAI4K,EAAWipC,QAAQC,YAAYuC,OAEjCjpC,EAAOi5B,GAAG,WAAY,KAAM,CAC1B77B,SAAU,gBAEP,CACL,MAAMm2C,EAAoB/1C,EAAWipC,QAAQC,YAAY9zC,GAEnD1D,EAAOqW,KAAKE,UAAU,CAC1B+tC,QAAS,OACT9M,YAAa,CACX9zC,GAAI2gD,GAENloB,QAAS,CACPz4B,GAAI4K,EAAWipC,QAAQpb,QAAQz4B,IAEjC67C,YAAa,YACb1G,QAAQ,EACRC,YAAa,UACbC,SAAUC,GAAAA,GAAS/4B,OAAO,yBAG5BvX,EAAM,CACJoB,IAAM,GAAEwE,EAAW0nC,SAAS+H,gCAAgCsG,mBAAmC/1C,EAAW0nC,SAASp8B,QACnH5P,QAAS,CAAE,eAAgB,mCAC3BhK,KAAMA,EACNi+C,OAAQ,QAIV3vC,EAAWipC,QAAU,CACnB7zC,GAAI4K,EAAW0nC,SAAStyC,GACxB6gD,OAAQ,YACRh9B,KAAM48B,KAGR71C,EAAW0nC,SAASoK,UAAW,EAE/B9xC,EAAWinC,cAAcF,EAAiB/mC,EAAWipC,SAErDpC,EAAI6I,YACDE,UAAU,CACTx6C,GAAI4K,EAAW0nC,SAAStyC,GACxBg0C,QAAQ,IAETuB,SAAS71C,MAAK,SAAUpD,GACnBA,EAAKuC,QACP8+C,EAAUrhD,EAAKqhD,QACf/L,EAAGsM,OAAS5hD,EAAKw5C,SAGpBp2C,MAAK,WACJ,IAAK,IAAIsS,EAAI,EAAGA,EAAI4/B,EAAGsM,OAAOn6C,OAAQiO,IAAK,CACzC,MAAM0tC,EAAQ9N,EAAGsM,OAAOlsC,GACxB,GAAI0tC,EAAMb,MAAMc,SAAU,CACxB,MAAMC,EAAS9hD,OAAOtH,UAAUshB,KAAK7f,KAAK,gBAC1C25C,EAAGiO,UAAU7tC,GAAK4tC,EAAOF,EAAMb,MAAMc,eAI1C3oC,OAAM,SAAU6K,GACf1G,QAAQnhB,MAAM6nB,WAKpBzU,EAAOi5B,GAAG,cAAe,KAAM,CAC7B77B,SAAU,iBAKdI,EAAWipC,QAAU,CACnB7zC,GAAI4K,EAAW0nC,SAAStyC,GACxB6gD,OAAQ,YACRh9B,KAAM48B,KAGR71C,EAAW0nC,SAASoK,UAAW,EAE/B9xC,EAAWinC,cAAcF,EAAiB/mC,EAAWipC,SAErDpC,EAAI6I,YACDE,UAAU,CACTx6C,GAAI4K,EAAW0nC,SAAStyC,GACxBg0C,QAAQ,IAETuB,SAAS71C,MAAK,SAAUpD,GACnBA,EAAKuC,QACP8+C,EAAUrhD,EAAKqhD,QACf/L,EAAGsM,OAAS5hD,EAAKw5C,SAGpBp2C,MAAK,WACJ,IAAK,IAAIsS,EAAI,EAAGA,EAAI4/B,EAAGsM,OAAOn6C,OAAQiO,IAAK,CACzC,MAAM0tC,EAAQ9N,EAAGsM,OAAOlsC,GACxB,GAAI0tC,EAAMb,MAAMc,SAAU,CACxB,MAAMC,EAAS9hD,OAAOtH,UAAUshB,KAAK7f,KAAK,gBAC1C25C,EAAGiO,UAAU7tC,GAAK4tC,EAAOF,EAAMb,MAAMc,eAI1C3oC,OAAM,SAAU6K,GACf1G,QAAQnhB,MAAM6nB,OAOtB+vB,EAAG8H,OAhMH,WACE,IAAIhD,EAAO,sBAEX,IAAK,IAAI1kC,EAAI,EAAGA,EAAI4/B,EAAGsM,OAAOn6C,OAAQiO,IAAK,CACzC,MAAM0tC,EAAQ9N,EAAGsM,OAAOlsC,GAEpB0tC,EAAMb,YAA+C,IAA/BjN,EAAGuH,KAAKuG,EAAMb,MAAM/W,SAEvC0P,GAAAA,CAAOkI,EAAMoB,YAChBl2C,EAAWipC,QAAQ6L,EAAMoB,UAAYvqD,MAAMoQ,QACzCirC,EAAGuH,KAAKuG,EAAMb,MAAM/W,QAElB8J,EAAGuH,KAAKuG,EAAMb,MAAM/W,OAAOlgC,OAC3BgqC,EAAGuH,KAAKuG,EAAMb,MAAM/W,QAGrB0P,GAAAA,CAAOkI,EAAMI,WAChBl1C,EAAWipC,QAAQ6L,EAAMI,SAAWvpD,MAAMoQ,QACxCirC,EAAGuH,KAAKuG,EAAMb,MAAM/W,QAElB8J,EAAGuH,KAAKuG,EAAMb,MAAM/W,OAAOlgC,OAC3BgqC,EAAGuH,KAAKuG,EAAMb,MAAM/W,QAGtB91B,IAAM2rC,IACHnG,GAAAA,CAAO5sC,EAAW0nC,SAASuO,UAC9Bj2C,EAAWipC,QAAQgN,OAASj2C,EAAW0nC,SAASuO,OAChDj2C,EAAWipC,QAAQhwB,KAAOttB,MAAMoQ,QAAQirC,EAAGuH,KAAKuG,EAAMb,MAAM/W,QACxD8J,EAAGuH,KAAKuG,EAAMb,MAAM/W,OAAOlgC,OAC3BgqC,EAAGuH,KAAKuG,EAAMb,MAAM/W,SAIxB8J,EAAGuH,KAAKuG,EAAMb,MAAM/W,SACtB4O,GAAQgJ,EAAMb,MAAM/W,MAAQ,KAAO8J,EAAGuH,KAAKuG,EAAMb,MAAM/W,OAAS,OAnExE,IAAqBrP,EAAAA,EA0EjBkhB,GAAAA,CACE,CACEjD,KAAMA,EACNqK,QAASn2C,EAAW0nC,SAASyO,QAC7BC,WAAYp2C,EAAW0nC,SAAS0O,YAElCp2C,EAAWipC,SA/EfjC,EAAG8O,aAAc,EAEjBjP,EAAI6I,YACD1c,OAAOnF,GACP8c,SAAS71C,MAAK,SAAUpD,UAChBs1C,EAAG6G,OAAOgD,iBAEjB7wC,EAAWipC,QAAQpb,QAAU,CAC3Bz4B,GAAI1D,EAAKm8B,QAAQz4B,IAGnB4K,EAAWipC,QAAQC,YAAc,CAC/B9zC,GAAI1D,EAAKw3C,YAAY9zC,IAIvB4K,EAAWinC,cAAcF,EAAiB/mC,EAAWipC,SAGrDjC,EAAG8O,aAAc,EAjChB91C,EAAW0nC,SAAS2O,sBAOvB7zC,EAAOi5B,GAAG,WAAY,KAAM,CAC1B77B,SAAU,YANZ4C,EAAOi5B,GAAG,cAAe,KAAM,CAC7B77B,SAAU,eAmCXwM,OAAM,SAAU6K,GAEf+vB,EAAG8O,aAAc,EAEjBvlC,QAAQnhB,MAAM6nB,OAqMpB+vB,EAAGI,OAzIH,SAAgB73C,EAAM2a,GACf88B,EAAGuH,KAAKh/C,KACXy3C,EAAGuH,KAAKh/C,GAAQ,IAGlB,MAAMyJ,EAAMguC,EAAGuH,KAAKh/C,GAAM0I,QAAQiS,GAC9BlR,GAAO,EACTguC,EAAGuH,KAAKh/C,GAAMga,OAAOvQ,EAAK,GAE1BguC,EAAGuH,KAAKh/C,GAAM/E,KAAK0f,IAiIvB88B,EAAG7c,OA7HH,SAAgB56B,EAAM2a,GAKpB,OAJK88B,EAAGuH,KAAKh/C,KACXy3C,EAAGuH,KAAKh/C,GAAQ,IAGXy3C,EAAGuH,KAAKh/C,GAAM0I,QAAQiS,IAAS,GCtJ1C,SAASosC,EACPt2C,EACAwC,EACAorC,EACA/G,EACAE,EACAD,GAEA,MAAME,EAAKj9C,KAQX,SAASukD,IACHtuC,EAAW0nC,SAAS0B,OACtB5mC,EAAOi5B,GAAG,aAAc,KAAM,CAAE77B,SAAU,YAE1C4C,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,YAI/C,SAASylC,IACP2B,EAAGuH,KAAO,GACVvH,EAAGwH,QAAU,KACbxH,EAAGyH,UAAY,KACfzH,EAAG0H,SAASC,eACZ3H,EAAG0H,SAASE,gBAEZ5uC,EAAWipC,QAAU,GAErBjpC,EAAW6uC,gBAAiB,EAC5B7uC,EAAWzJ,MAAM,QAQnB,SAAS25B,EAAY3gC,GACnB,OAAO,SAAU0nB,GACf+vB,EAAG6G,OAAOt+C,GAAQ0nB,EAAIvlB,KAEtB,MAAMo8C,EAAQF,EACXG,SACAC,YACChuC,EAAW0nC,SAASuG,0BAClB,yBAEHC,WAAW,oBACX/pC,OAAOva,QAAQkD,QAAQsjB,SAAS45B,cAAc,mBAEjD4D,EAASxD,KAAK0D,IAIlB,SAASM,IACPpuC,EAAWquC,SAAU,EAjDvBrH,EAAGuH,KAAO,GACVvH,EAAG6G,OAAS,GA+FZ7G,EAAG5vC,QAXH,WACE4I,EAAW2nC,OAAS,YAGpB3nC,EAAWinC,cAAcF,EAAiB,MAAM,GAChD/mC,EAAWinC,cAAcH,EAAgB,MAAM,GAE/C9mC,EAAWquC,SAAU,GAKvBrH,EAAG8H,OA7CH,WACE9uC,EAAWquC,SAAU,EAEjBruC,EAAWipC,QAAQC,aAAelpC,EAAWipC,QAAQC,YAAY9zC,GACnEyxC,EAAIwD,gBACDC,aAAa,CACZl1C,GAAI4K,EAAWipC,QAAQC,YAAY9zC,GACnCmhD,KAAMvP,EAAGuH,KAAKgI,OAEf5L,SAAS71C,MAAK,kBACNkyC,EAAG6G,OAAOiB,OAEjB,MAAMhB,EAAQF,EACXG,SACAC,YACChuC,EAAW0nC,SAASwH,0BAClB,2BAEHhB,WAAW,oBACX/pC,OAAOva,QAAQkD,QAAQsjB,SAAS45B,cAAc,mBAEjD4D,EAASxD,KAAK0D,MAEfh5C,KAAKuwC,GACLvwC,KAAKw5C,GACLliC,MAAM8jB,EAAY,WAClBif,QAAQf,IAEXA,IACAle,EAAY,YAiBhB8W,EAAGoI,KAxEH,WACE/J,IACAiJ,KCrCJ,SAASkI,EACPx2C,EACAhV,EACAklD,EACA1tC,EACA7C,EACAknC,EACAE,EACAD,GAGA,IACIwJ,EADAmG,GAAS,EAIb,SAASzF,IACP,IAAI9H,EAAc,GACdwN,GAAO,EAEX7P,EAAIwD,gBACD5vC,IAAI,CACHrF,GAAI4K,EAAWipC,QAAQC,YAAY9zC,KAEpCu1C,SAAS71C,MAAK,SAAUpD,GAGvB,OAFAw3C,EAAcx3C,EAEPm1C,EAAIwD,gBAAgBS,YAAY,CACrCC,MAAO/qC,EAAWipC,QAAQC,YAAY9zC,KACrCu1C,YAEJ71C,MAAK,SAAUpD,GACdglD,EAAOhlD,EAAKw5C,KAAK/xC,OAAS,EAEtB+vC,EAAYqB,QACdvqC,EAAWipC,QAAQC,YAAYqB,QAAS,EACxCvqC,EAAWinC,cAAcF,EAAiB/mC,EAAWipC,SAErB,cAA5BC,EAAY+H,aACdzuC,EAAOi5B,GAAG,gBAAiB,KAAM,CAAE77B,SAAU,aAEtCspC,EAAYuC,QAErBzrC,EAAWipC,QAAQC,YAAYuC,OAASvC,EAAYuC,OACpDzrC,EAAWinC,cAAcF,EAAiB/mC,EAAWipC,SAErDzmC,EAAOi5B,GAAG,WAAY,KAAM,CAAE77B,SAAU,aAC/B82C,GACTl0C,EAAOi5B,GAAG,WAAY,KAAM,CAAE77B,SAAU,eAG3CwM,OAAM,SAAU6K,GACf,OAAQA,EAAI0wB,QACV,KAAK,IACHnlC,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,YAC3C,MACF,KAAK,IACH4C,EAAOi5B,GAAG,gBAAiB,KAAM,CAAE77B,SAAU,YAC7C,MACF,QACE2Q,QAAQnhB,MAAM6nB,OAKxB,SAAS0/B,IACP,GACE32C,EAAWipC,SACXjpC,EAAWipC,QAAQC,aACnBlpC,EAAWipC,QAAQC,YAAY9zC,KAC9BqhD,EACD,CAEAA,GAAS,EAGT,MAAMG,EAAM,IAAIC,eAEhBD,EAAIF,KACF,MACA12C,EAAW0nC,SAAS+H,OAClB,0BACAzvC,EAAWipC,QAAQC,YAAY9zC,GAC/B,kBACA4K,EAAW0nC,SAASp8B,OACtB,GAEFsrC,EAAIE,iBAAiB,eAAgB,mCAErCF,EAAIG,KACFhvC,KAAKE,UAAU,CACb+tC,QAAS,OACT9M,YAAa,CACX9zC,GAAI4K,EAAWipC,QAAQC,YAAY9zC,IAErCy4B,QAAS,CACPz4B,GAAI4K,EAAWipC,QAAQpb,QAAQz4B,IAEjC67C,YAAa,YACb1G,QAAQ,EACRC,YAAa,UACbC,SAAUC,GAAAA,GAAS/4B,OAAO,0BAIP,IAAnBilC,EAAII,YAAmC,MAAfJ,EAAIjP,SAE9B3nC,EAAWinC,cAAcF,EAAiB,MAAM,GAChD/mC,EAAWinC,cAAcH,EAAgB,MAAM,KAjG1C/8C,KA0HRqN,QAbH,WACE4I,EAAW2nC,OAAS,UAGlB3nC,EAAWipC,SACXjpC,EAAWipC,QAAQC,aACnBlpC,EAAWipC,QAAQC,YAAY9zC,KAG/Bk7C,EAAyBJ,EAAUc,EAAgB,OAQvDhmD,EAAOsB,IAAI,YAxBX,WACEqT,EAAQs3C,oBAAoB,eAAgBN,GAC5Ch3C,EAAQs3C,oBAAoB,SAAUN,GAEtCzG,EAAUhiD,OAAOoiD,MAqBnB3wC,EAAQ4sC,iBAAiB,eAAgBoK,GACzCh3C,EAAQ4sC,iBAAiB,SAAUoK,GC/GrC,SAASO,EAAgBpE,GACvB,OAAO,SAAUvkD,GACf,OAAOukD,EAAKU,YAAYjlD,6WAqI5B3E,QACGC,OAFiB,cAEG,CACnB,YACA,SACA,aACA,aACA,aACA,aACA,QACA,UACA,YACA,qBACA,WACA,SAEDwJ,OAAO,YAAa6jD,GACpBC,SAAS,iBAAkB,eAC3BA,SAAS,kBAAmB,WAC5BA,SAAS,iBAAkB,UAC3BvqD,UAAU,WAlCb,WACE,OAAO,SAAUC,EAAOC,EAASC,GAC/BD,EAAQO,KAAK,oBAAoB,SAAU/C,GACrB,KAAhBA,EAAMo6C,QACR73C,EAAMmB,QAAO,WACXnB,EAAMzB,MAAM2B,EAAMqqD,YAEpB9sD,EAAMgD,yBA4BXV,UAAU,WApJb,WA0GE,MAAO,CACL0F,KAVF,SAAczF,EAAOC,GACnBA,EAAQzC,GAAG,SAAS,WACE+lB,SAASinC,eAAe,iBAlGhD,SAAsBpsC,EAAMpe,GAE1B,MAAMyqD,EAAMlnC,SAASs5B,cAAc,OAC7BT,EAAUp8C,EAAMo8C,QAChBvB,EAAW76C,EAAM66C,SACvB,IAAI6P,EAEJ,IAAK,IAAInwC,EAAI,EAAGA,EAAIva,EAAM2kD,SAASr4C,OAAQiO,IAAK,CAC9C,MAAMymB,EAAUhhC,EAAM2kD,SAASpqC,GAC/B,IAAIgkC,EAAS,WACb,MAAMU,EAAO,YAAcje,EAAQie,KAC7B0L,EACJ,YAAc9M,GAAAA,CAAO7c,EAAQke,WAAWp6B,OAAO,uBAEjD,GAAU,IAANvK,EAAJ,CAKA,OAAQva,EAAM66C,SAAS8D,iBACrB,IAAK,gBACHJ,GACwB,QAAtBvd,EAAQwd,UACJxd,EAAQ4d,OACN/D,EAASgE,WAAa7d,EAAQ4d,OAC9B,SACF/D,EAAS4D,eACTrC,EAAQhwB,MACR,UAAY4U,EAAQ0d,UAC1B,MAEF,IAAK,cACHH,GACwB,QAAtBvd,EAAQwd,UACJxd,EAAQ4d,OACN5d,EAAQ8d,KAAKC,OAAS/d,EAAQ8d,KAAKE,SACnC,SACFnE,EAAS4D,eACTrC,EAAQhwB,MACR,UAAY4U,EAAQ0d,UAC1B,MAEF,IAAK,iBACHH,GACwB,QAAtBvd,EAAQwd,UACJxd,EAAQ4d,OACN5d,EAAQ8d,KAAKE,SACb,SACFnE,EAAS4D,eACTrC,EAAQhwB,MACR,UAAY4U,EAAQ0d,UAC1B,MAEF,QACEH,GACwB,QAAtBvd,EAAQwd,UACJxd,EAAQ4d,QACL/D,EAASgE,YAAc,SAAW7d,EAAQ4d,OAC3C,SACF/D,EAAS4D,eACTrC,EAAQhwB,MACR,UAAY4U,EAAQ0d,UAG9B+L,EAAI3N,YAAYv5B,SAASqnC,eAAerM,IACxCkM,EAAI3N,YAAYv5B,SAASs5B,cAAc,OACvC4N,EAAI3N,YAAYv5B,SAASqnC,eAAe3L,IACxCwL,EAAI3N,YAAYv5B,SAASs5B,cAAc,OACvC4N,EAAI3N,YAAYv5B,SAASqnC,eAAeD,IACxCF,EAAI3N,YAAYv5B,SAASs5B,cAAc,OACvC4N,EAAI3N,YAAYv5B,SAASs5B,cAAc,YAvDrC6N,EAAY1pB,EAAQke,UA0DxB,MAAM2L,EAAWpnC,OAAOomC,OAExBgB,EAAStnC,SAASunC,MAAM,sBAAwBvnC,SAAS8sB,MAAQ,YACjEwa,EAAStnC,SAASunC,MAAM,kBACxBD,EAAStnC,SAASunC,MAAM,iBAAmBjQ,EAASyO,QAAU,SAC9DuB,EAAStnC,SAASunC,MAChB,oBACEjN,GAAAA,CAAO6M,GAAW5lC,OAAO,uBACzB,SAEJ+lC,EAAStnC,SAASunC,MAChB,oBAAsBjN,GAAAA,GAAS/4B,OAAO,uBAAyB,SAEjE+lC,EAAStnC,SAASunC,MAAML,EAAIM,WAC5BF,EAAStnC,SAASunC,MAAM,kBAExBD,EAAStnC,SAAS05B,QAClB4N,EAASG,QAETH,EAASI,QACTJ,EAAS5N,QAOLiO,CAAaC,EAAanrD,OAO9BqE,SAAU,QA0CXnG,WAAW,iBAAkBklD,GAE7BllD,WAAW,oBAAqB4iD,GAEhCr4C,OA1BH,sBA0BU,SAAU2iD,GAChBA,EAAmBC,qBAEpBntD,WAAW,kBAAmB27C,GAE9Bz8C,QAAQ,MAAOolD,GAEf/5C,OAAOu3C,GACPvqC,IAAIkqC,GAEJzhD,WAAW,oBAAqB8nD,GAEhCv9C,OAtCH,sBAsCU,SAAU2iD,GAChBA,EAAmBC,qBAEpBntD,WAAW,mBAAoB6qD,GAE/B7qD,WAAW,sBAAuBurD,GAElCvrD,WAAW,oBAAqByrD,wFC/MnC3sD,EAAOsuD,QAAU,WACf,GAA0B,iBAAfC,WACT,OAAOA,WAGT,IAAIxwC,EAEJ,IAGEA,EAAI7d,MAAQ,IAAI0mB,SAAS,cAAb,GACZ,MAAOpE,GAEP,GAAsB,iBAAXiE,OACT,OAAOA,OAIT,GAAoB,iBAAT7Y,KACT,OAAOA,KAIT,QAAsB,IAAX,EAAAmQ,EACT,OAAO,EAAAA,EAIX,OAAOA,EA5BQ,wECHjB,WAoBE7d,QAjBM4d,EAAO,SAON,KAFU,EAAF,WACL,OAAQA,EAAK6tC,eAWjB,WAWJ,SAASz5C,EAAQhO,GAEb,MAAmC,mBAA5B,GAAK8Q,SAAS/S,KAAKiC,GAG9B,SAASsqD,EAAatqD,GAElB,QAAQgO,EAAQhO,IAAuB,iBAARA,IAAsBA,GAASA,aAAeuqD,MAAWvqD,aAAeuuB,MAQ3G,SAASi8B,IAEL,MAA2B,mBAAb9F,SAGlB,SAAS+F,IAEL,GAAID,IACA,OAAO,IAAI9F,SAkCnB,SAASgG,EAAmBC,EAAYxuD,EAASyuD,EAAUC,GAEvD,IAAI5S,EAAQ,EAEZ,IAAK,IAAIp2C,KAAO8oD,EAAY,CAExB,GAAIA,EAAWjsD,eAAemD,GAAM,CAEhC,IAAIipD,EAAWD,GAAahpD,EACxBrB,EAAQrE,EAAQirB,QAAQujC,EAAW9oD,IAevC,GAbIgpD,GAAaP,EAAaK,KAC1BG,EAAWD,EAAY,IAAMhpD,EAAM,KAGnCgpD,GAAa78C,EAAQ28C,KAGjBG,EADA98C,EAAQxN,IAAUrE,EAAQipD,qBACfyF,EAAY,IAAM5S,EAAQ,IAE1B4S,EAAY,MAI3B78C,EAAQxN,IAAU8pD,EAAa9pD,GAE/BkqD,EAAmBlqD,EAAOrE,EAASyuD,EAAUE,QAE1C,GAAItqD,aAAiBuqD,SAExB,IAAK,IAAIrxC,EAAI,EAAGA,EAAIlZ,EAAM4K,OAAQsO,IAC9BkxC,EAASv0B,OAAOy0B,EAAW,IAAMpxC,EAAI,IAAKlZ,EAAM2b,KAAKzC,SAElDlZ,aAAiB+pD,KAExBK,EAASv0B,OAAOy0B,EAAUtqD,EAAOA,EAAMgB,MAEhChB,aAAiB+tB,KAExBq8B,EAASv0B,OAAOy0B,EAAUtqD,EAAMwqD,gBAEb,OAAVxqD,GAAkBrE,EAAQkpD,mBAAgC,OAAV7kD,SAA6B2P,IAAV3P,GAE5EoqD,EAASv0B,OAAOy0B,EAAUtqD,GAGlCy3C,IAEJ,OAAO2S,EAEX,OAhFA,SAAiBD,EAAYxuD,GAEzB,GAAIA,GAAWA,EAAQurD,iBAEnB,GAnB8B,mBAmBDvrD,EAAQurD,gBAnBlBrxB,OAqBf,KAAM,qDAEP,IAAKm0B,IAER,KAAM,8FA3Bd,IA0CQS,EA5DG,CAgDc,CACjBvD,gBAAiB+C,IACjBrF,sBAAsB,EACtBC,mBAAmB,EACnBj+B,QAAS,SAAS5mB,GACd,MAAqB,kBAAVA,GACCA,EAAQ,IAAK,IAElBA,IAIkCrE,GAAW,IA5DlCyO,QAAO,SAAUsgD,EAAOC,GAI9C,OAHA57C,OAAOC,KAAK27C,GAAepuD,SAAQ,SAAUquD,GACzCF,EAAME,GAAaD,EAAcC,MAE9BF,IACR,IAyDH,OAAOR,EAAmBC,EAAYM,EAAeA,EAAcvD,kBA5EjCxrD,IACjC,QAFM,OAEN,oECDD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,8FAA8FxsC,MAClG,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,4DAA4D1sC,MAClE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C6sC,cAAe,SACfC,KAAM,SAAUh9C,GACZ,MAAO,QAAQuQ,KAAKvQ,IAExBi9C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,KAAO,KAEjBA,EAAU,KAAO,MAGhCC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,eACTC,SAAU,eACVC,QAAS,iBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,YACN7zC,EAAG,mBACH8zC,GAAI,cACJl8C,EAAG,YACHm8C,GAAI,YACJC,EAAG,SACHC,GAAI,SACJl4B,EAAG,SACHm4B,GAAI,SACJC,EAAG,WACHC,GAAI,YACJC,EAAG,UACHC,GAAI,WAERC,uBAAwB,kBACxBC,QAAS,SAAUC,GACf,OACIA,GACY,IAAXA,GAA2B,IAAXA,GAAgBA,GAAU,GAAK,MAAQ,OAGhEC,KAAM,CACFC,IAAK,EACLC,IAAK,KArEyB9xD,CAAQ,EAAQ,8FCOlD,SAAWygD,GAAU,aAIzB,IAAIsR,EAAa,SAAU1xC,GACnB,OAAa,IAANA,EACD,EACM,IAANA,EACA,EACM,IAANA,EACA,EACAA,EAAI,KAAO,GAAKA,EAAI,KAAO,GAC3B,EACAA,EAAI,KAAO,GACX,EACA,GAEV2xC,EAAU,CACN90C,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,UACA,WACA,YAEJpI,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,WACA,WACA,YAEJo8C,EAAG,CACC,cACA,aACA,CAAC,SAAU,UACX,WACA,UACA,WAEJj4B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,WACA,UAEJo4B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,UACA,UAEJE,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,WACA,WACA,WAGRU,EAAY,SAAUC,GAClB,OAAO,SAAUP,EAAQQ,EAAe9sD,EAAQ+sD,GAC5C,IAAIC,EAAIN,EAAWJ,GACf7gD,EAAMkhD,EAAQE,GAAGH,EAAWJ,IAIhC,OAHU,IAANU,IACAvhD,EAAMA,EAAIqhD,EAAgB,EAAI,IAE3BrhD,EAAI+D,QAAQ,MAAO88C,KAGlCvC,EAAS,CACL,QACA,QACA,OACA,QACA,MACA,OACA,SACA,MACA,SACA,SACA,SACA,UAGG3O,EAAO0O,aAAa,QAAS,CACpCC,OAAQA,EACRC,YAAaD,EACbE,SAAU,sDAAsD1sC,MAAM,KACtE2sC,cAAe,wCAAwC3sC,MAAM,KAC7D4sC,YAAa,gBAAgB5sC,MAAM,KACnC0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVZ,cAAe,MACfC,KAAM,SAAUh9C,GACZ,MAAO,MAAQA,GAEnBi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,IAEA,KAGfjC,SAAU,CACNC,QAAS,wBACTC,QAAS,uBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN7zC,EAAG+0C,EAAU,KACbjB,GAAIiB,EAAU,KACdn9C,EAAGm9C,EAAU,KACbhB,GAAIgB,EAAU,KACdf,EAAGe,EAAU,KACbd,GAAIc,EAAU,KACdh5B,EAAGg5B,EAAU,KACbb,GAAIa,EAAU,KACdZ,EAAGY,EAAU,KACbX,GAAIW,EAAU,KACdV,EAAGU,EAAU,KACbT,GAAIS,EAAU,MAElBQ,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC+8C,KAAM,CACFC,IAAK,EACLC,IAAK,KAtJyB9xD,CAAQ,EAAQ,8FCDlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,wEAAwExsC,MAC5E,KAEJysC,YAAa,wEAAwEzsC,MACjF,KAEJ0sC,SAAU,sDAAsD1sC,MAAM,KACtE2sC,cAAe,wCAAwC3sC,MAAM,KAC7D4sC,YAAa,gBAAgB5sC,MAAM,KACnC0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,wBACTC,QAAS,sBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,OACH8zC,GAAI,WACJl8C,EAAG,QACHm8C,GAAI,WACJC,EAAG,OACHC,GAAI,WACJl4B,EAAG,MACHm4B,GAAI,UACJC,EAAG,MACHC,GAAI,UACJC,EAAG,MACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,MApDyB9xD,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPX,EAAa,SAAU1xC,GACnB,OAAa,IAANA,EACD,EACM,IAANA,EACA,EACM,IAANA,EACA,EACAA,EAAI,KAAO,GAAKA,EAAI,KAAO,GAC3B,EACAA,EAAI,KAAO,GACX,EACA,GAEV2xC,EAAU,CACN90C,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,UACA,WACA,YAEJpI,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,WACA,WACA,YAEJo8C,EAAG,CACC,cACA,aACA,CAAC,SAAU,UACX,WACA,UACA,WAEJj4B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,WACA,UAEJo4B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,UACA,UAEJE,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,WACA,WACA,WAGRU,EAAY,SAAUC,GAClB,OAAO,SAAUP,EAAQQ,EAAe9sD,EAAQ+sD,GAC5C,IAAIC,EAAIN,EAAWJ,GACf7gD,EAAMkhD,EAAQE,GAAGH,EAAWJ,IAIhC,OAHU,IAANU,IACAvhD,EAAMA,EAAIqhD,EAAgB,EAAI,IAE3BrhD,EAAI+D,QAAQ,MAAO88C,KAGlCvC,EAAS,CACL,QACA,SACA,OACA,QACA,OACA,QACA,QACA,QACA,SACA,SACA,SACA,UAGG3O,EAAO0O,aAAa,QAAS,CACpCC,OAAQA,EACRC,YAAaD,EACbE,SAAU,sDAAsD1sC,MAAM,KACtE2sC,cAAe,wCAAwC3sC,MAAM,KAC7D4sC,YAAa,gBAAgB5sC,MAAM,KACnC0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVZ,cAAe,MACfC,KAAM,SAAUh9C,GACZ,MAAO,MAAQA,GAEnBi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,IAEA,KAGfjC,SAAU,CACNC,QAAS,wBACTC,QAAS,uBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN7zC,EAAG+0C,EAAU,KACbjB,GAAIiB,EAAU,KACdn9C,EAAGm9C,EAAU,KACbhB,GAAIgB,EAAU,KACdf,EAAGe,EAAU,KACbd,GAAIc,EAAU,KACdh5B,EAAGg5B,EAAU,KACbb,GAAIa,EAAU,KACdZ,EAAGY,EAAU,KACbX,GAAIW,EAAU,KACdV,EAAGU,EAAU,KACbT,GAAIS,EAAU,MAElBU,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC49C,WAAY,SAAUptD,GAClB,OAAOA,EACFwP,QAAQ,OAAO,SAAUiH,GACtB,OAAO42C,EAAU52C,MAEpBjH,QAAQ,KAAM,MAEvB+8C,KAAM,CACFC,IAAK,EACLC,IAAK,MAzKyB9xD,CAAQ,EAAQ,8FCIlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,wEAAwExsC,MAC5E,KAEJysC,YAAa,wEAAwEzsC,MACjF,KAEJ0sC,SAAU,sDAAsD1sC,MAAM,KACtE2sC,cAAe,wCAAwC3sC,MAAM,KAC7D4sC,YAAa,gBAAgB5sC,MAAM,KACnC0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,wBACTC,QAAS,sBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,OACH8zC,GAAI,WACJl8C,EAAG,QACHm8C,GAAI,WACJC,EAAG,OACHC,GAAI,WACJl4B,EAAG,MACHm4B,GAAI,UACJC,EAAG,MACHC,GAAI,UACJC,EAAG,MACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KApDyB9xD,CAAQ,EAAQ,8FCElD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGFnS,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,6EAA6ExsC,MACjF,KAEJysC,YAAa,6EAA6EzsC,MACtF,KAEJ0sC,SAAU,sDAAsD1sC,MAAM,KACtE2sC,cAAe,wCAAwC3sC,MAAM,KAC7D4sC,YAAa,gBAAgB5sC,MAAM,KACnC0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVZ,cAAe,MACfC,KAAM,SAAUh9C,GACZ,MAAO,MAAQA,GAEnBi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,IAEA,KAGfjC,SAAU,CACNC,QAAS,wBACTC,QAAS,sBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,OACH8zC,GAAI,WACJl8C,EAAG,QACHm8C,GAAI,WACJC,EAAG,OACHC,GAAI,WACJl4B,EAAG,MACHm4B,GAAI,UACJC,EAAG,MACHC,GAAI,UACJC,EAAG,MACHC,GAAI,YAERmB,SAAU,SAAUttD,GAChB,OAAOA,EACFwP,QAAQ,iBAAiB,SAAUiH,GAChC,OAAO82C,EAAU92C,MAEpBjH,QAAQ,KAAM,MAEvB49C,WAAY,SAAUptD,GAClB,OAAOA,EACFwP,QAAQ,OAAO,SAAUiH,GACtB,OAAO42C,EAAU52C,MAEpBjH,QAAQ,KAAM,MAEvB+8C,KAAM,CACFC,IAAK,EACLC,IAAK,KAtGyB9xD,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,yEAAyExsC,MAC7E,KAEJysC,YAAa,yEAAyEzsC,MAClF,KAEJ0sC,SAAU,sDAAsD1sC,MAAM,KACtE2sC,cAAe,wCAAwC3sC,MAAM,KAC7D4sC,YAAa,gBAAgB5sC,MAAM,KACnC0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,wBACTC,QAAS,sBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,OACH8zC,GAAI,WACJl8C,EAAG,QACHm8C,GAAI,WACJC,EAAG,OACHC,GAAI,WACJl4B,EAAG,MACHm4B,GAAI,UACJC,EAAG,MACHC,GAAI,UACJC,EAAG,MACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KApDyB9xD,CAAQ,EAAQ,2FCKlD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAETb,EAAa,SAAU1xC,GACnB,OAAa,IAANA,EACD,EACM,IAANA,EACA,EACM,IAANA,EACA,EACAA,EAAI,KAAO,GAAKA,EAAI,KAAO,GAC3B,EACAA,EAAI,KAAO,GACX,EACA,GAEV2xC,EAAU,CACN90C,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,UACA,WACA,YAEJpI,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,WACA,WACA,YAEJo8C,EAAG,CACC,cACA,aACA,CAAC,SAAU,UACX,WACA,UACA,WAEJj4B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,WACA,UAEJo4B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,UACA,UAEJE,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,WACA,WACA,WAGRU,EAAY,SAAUC,GAClB,OAAO,SAAUP,EAAQQ,EAAe9sD,EAAQ+sD,GAC5C,IAAIC,EAAIN,EAAWJ,GACf7gD,EAAMkhD,EAAQE,GAAGH,EAAWJ,IAIhC,OAHU,IAANU,IACAvhD,EAAMA,EAAIqhD,EAAgB,EAAI,IAE3BrhD,EAAI+D,QAAQ,MAAO88C,KAGlCvC,EAAS,CACL,QACA,SACA,OACA,QACA,OACA,QACA,QACA,QACA,SACA,SACA,SACA,UAGC3O,EAAO0O,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaD,EACbE,SAAU,sDAAsD1sC,MAAM,KACtE2sC,cAAe,wCAAwC3sC,MAAM,KAC7D4sC,YAAa,gBAAgB5sC,MAAM,KACnC0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVZ,cAAe,MACfC,KAAM,SAAUh9C,GACZ,MAAO,MAAQA,GAEnBi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,IAEA,KAGfjC,SAAU,CACNC,QAAS,wBACTC,QAAS,uBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN7zC,EAAG+0C,EAAU,KACbjB,GAAIiB,EAAU,KACdn9C,EAAGm9C,EAAU,KACbhB,GAAIgB,EAAU,KACdf,EAAGe,EAAU,KACbd,GAAIc,EAAU,KACdh5B,EAAGg5B,EAAU,KACbb,GAAIa,EAAU,KACdZ,EAAGY,EAAU,KACbX,GAAIW,EAAU,KACdV,EAAGU,EAAU,KACbT,GAAIS,EAAU,MAElBU,SAAU,SAAUttD,GAChB,OAAOA,EACFwP,QAAQ,iBAAiB,SAAUiH,GAChC,OAAO82C,EAAU92C,MAEpBjH,QAAQ,KAAM,MAEvB49C,WAAY,SAAUptD,GAClB,OAAOA,EACFwP,QAAQ,OAAO,SAAUiH,GACtB,OAAO42C,EAAU52C,MAEpBjH,QAAQ,KAAM,MAEvB+8C,KAAM,CACFC,IAAK,EACLC,IAAK,MAzLyB9xD,CAAQ,EAAQ,2FCClD,SAAWygD,GAAU,aAIzB,IAAIoS,EAAW,CACX,EAAG,QACH,EAAG,QACH,EAAG,QACH,GAAI,QACJ,GAAI,QACJ,EAAG,OACH,EAAG,OACH,GAAI,OACJ,GAAI,OACJ,EAAG,QACH,EAAG,QACH,IAAK,QACL,EAAG,OACH,EAAG,QACH,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,SAGCpS,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,+EAA+ExsC,MACnF,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,qEAAqE1sC,MAC3E,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,kBACTC,SAAU,+BACVC,QAAS,aACTC,SAAU,+BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,WACN7zC,EAAG,kBACH8zC,GAAI,YACJl8C,EAAG,aACHm8C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJl4B,EAAG,UACHm4B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,SACHC,GAAI,SAER/B,cAAe,0BACfC,KAAM,SAAUh9C,GACZ,MAAO,mBAAmBuQ,KAAKvQ,IAEnCi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,QACAA,EAAO,GACP,SAEA,SAGfd,uBAAwB,wCACxBC,QAAS,SAAUC,GACf,GAAe,IAAXA,EAEA,OAAOA,EAAS,QAEpB,IAAIp0C,EAAIo0C,EAAS,GAGjB,OAAOA,GAAUkB,EAASt1C,IAAMs1C,EAFvBlB,EAAS,IAAOp0C,IAEsBs1C,EADvClB,GAAU,IAAM,IAAM,QAGlCC,KAAM,CACFC,IAAK,EACLC,IAAK,KAnGyB9xD,CAAQ,EAAQ,2FCKlD,SAAWygD,GAAU,aAYzB,SAASqS,EAAuBnB,EAAQQ,EAAexsD,GASnD,MAAY,MAARA,EACOwsD,EAAgB,UAAY,UACpB,MAARxsD,EACAwsD,EAAgB,UAAY,UAE5BR,EAAS,KAtBFoB,GAsB6BpB,EArB3CqB,EAQS,CACThC,GAAImB,EAAgB,yBAA2B,yBAC/ClB,GAAIkB,EAAgB,yBAA2B,yBAC/ChB,GAAIgB,EAAgB,yBAA2B,yBAC/Cf,GAAI,iBACJE,GAAI,uBACJE,GAAI,kBAOgC7rD,GArBvBid,MAAM,KAChBmwC,EAAM,IAAO,GAAKA,EAAM,KAAQ,GACjCC,EAAM,GACND,EAAM,IAAM,GAAKA,EAAM,IAAM,IAAMA,EAAM,IAAM,IAAMA,EAAM,KAAO,IAClEC,EAAM,GACNA,EAAM,IANhB,IAAsBD,EACdC,EAyBCvS,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,CACJ1nC,OAAQ,uGAAuG9E,MAC3G,KAEJqwC,WAAY,qGAAqGrwC,MAC7G,MAGRysC,YAAa,0DAA0DzsC,MACnE,KAEJ0sC,SAAU,CACN5nC,OAAQ,0DAA0D9E,MAC9D,KAEJqwC,WAAY,0DAA0DrwC,MAClE,KAEJswC,SAAU,+CAEd3D,cAAe,uBAAuB3sC,MAAM,KAC5C4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,iBACJC,IAAK,wBACLC,KAAM,+BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,gBACTE,QAAS,eACTD,SAAU,WACN,MAAO,mBAEXE,SAAU,WACN,OAAQ7wD,KAAKqzD,OACT,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,0BACX,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,2BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,UACN7zC,EAAG,kBACHpI,EAAGg+C,EACH7B,GAAI6B,EACJ5B,EAAG4B,EACH3B,GAAI2B,EACJ75B,EAAG,QACHm4B,GAAI0B,EACJzB,EAAG,QACHC,GAAIwB,EACJvB,EAAG,MACHC,GAAIsB,GAERrD,cAAe,yBACfC,KAAM,SAAUh9C,GACZ,MAAO,iBAAiBuQ,KAAKvQ,IAEjCi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,SACAA,EAAO,GACP,MAEA,UAGfd,uBAAwB,mBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACL,IAAK,IACD,OAAQzB,EAAS,IAAO,GAAKA,EAAS,IAAO,GACzCA,EAAS,KAAQ,IACjBA,EAAS,KAAQ,GAEfA,EAAS,KADTA,EAAS,KAEnB,IAAK,IACD,OAAOA,EAAS,MACpB,QACI,OAAOA,IAGnBC,KAAM,CACFC,IAAK,EACLC,IAAK,KAzIyB9xD,CAAQ,EAAQ,2FCClD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,oFAAoFxsC,MACxF,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,yDAAyD1sC,MAC/D,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,YACHC,GAAI,cACJC,IAAK,mBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,cACTC,SAAU,cACVC,QAAS,eACTC,SAAU,WACN,OAAQ7wD,KAAKqzD,OACT,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,yBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,0BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,WACN7zC,EAAG,kBACH8zC,GAAI,aACJl8C,EAAG,SACHm8C,GAAI,YACJC,EAAG,MACHC,GAAI,UACJl4B,EAAG,MACHm4B,GAAI,UACJiC,EAAG,UACHC,GAAI,aACJjC,EAAG,QACHC,GAAI,YACJC,EAAG,SACHC,GAAI,aAERC,uBAAwB,8BACxBC,QAAS,SAAUC,GACf,IAAI4B,EAAY5B,EAAS,GACrB6B,EAAc7B,EAAS,IAC3B,OAAe,IAAXA,EACOA,EAAS,MACO,IAAhB6B,EACA7B,EAAS,MACT6B,EAAc,IAAMA,EAAc,GAClC7B,EAAS,MACK,IAAd4B,EACA5B,EAAS,MACK,IAAd4B,EACA5B,EAAS,MACK,IAAd4B,GAAiC,IAAdA,EACnB5B,EAAS,MAETA,EAAS,OAGxBC,KAAM,CACFC,IAAK,EACLC,IAAK,KArFyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,8IAA8IxsC,MAClJ,KAEJysC,YAAa,iDAAiDzsC,MAAM,KACpE0sC,SAAU,+CAA+C1sC,MAAM,KAC/D2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,2BACJC,IAAK,wCACLC,KAAM,8CAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,iBACTC,SAAU,qBACVC,QAAS,iBACTC,SAAU,yBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,aACN7zC,EAAG,kBACH8zC,GAAI,aACJl8C,EAAG,eACHm8C,GAAI,YACJC,EAAG,aACHC,GAAI,UACJl4B,EAAG,aACHm4B,GAAI,UACJC,EAAG,aACHC,GAAI,UACJC,EAAG,YACHC,GAAI,UAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAjDyB9xD,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGFnS,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,0FAA0FxsC,MAC9F,KAEJysC,YAAa,mEAAmEzsC,MAC5E,KAEJ0sC,SAAU,4DAA4D1sC,MAClE,KAEJ2sC,cAAe,uCAAuC3sC,MAAM,KAC5D4sC,YAAa,kCAAkC5sC,MAAM,KACrDmtC,eAAgB,CACZC,GAAI,aACJC,IAAK,gBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,0BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,UACTC,QAAS,gBACTC,SAAU,WACVC,QAAS,aACTC,SAAU,gBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN7zC,EAAG,eACH8zC,GAAI,aACJl8C,EAAG,WACHm8C,GAAI,WACJC,EAAG,WACHC,GAAI,WACJl4B,EAAG,SACHm4B,GAAI,SACJC,EAAG,SACHC,GAAI,SACJC,EAAG,SACHC,GAAI,UAERmB,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO82C,EAAU92C,OAGzB22C,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO42C,EAAU52C,OAIzB2zC,cAAe,uCACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,QAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,QAAb5C,GAEa,SAAbA,EADA4C,EAGa,UAAb5C,EACA4C,GAAQ,EAAIA,EAAOA,EAAO,GACb,UAAb5C,GAEa,YAAbA,EADA4C,EAAO,QACX,GAKX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,MACAA,EAAO,EACP,MACAA,EAAO,GACP,OACAA,EAAO,GACP,QACAA,EAAO,GACP,QACAA,EAAO,GACP,UAEA,OAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KA9HyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJnS,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,0FAA0FxsC,MAC9F,KAEJysC,YAAa,mEAAmEzsC,MAC5E,KAEJ0sC,SAAU,4DAA4D1sC,MAClE,KAEJ2sC,cAAe,uCAAuC3sC,MAAM,KAC5D4sC,YAAa,kCAAkC5sC,MAAM,KACrDmtC,eAAgB,CACZC,GAAI,aACJC,IAAK,gBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,0BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,UACTC,QAAS,gBACTC,SAAU,WACVC,QAAS,aACTC,SAAU,gBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN7zC,EAAG,eACH8zC,GAAI,aACJl8C,EAAG,WACHm8C,GAAI,WACJC,EAAG,WACHC,GAAI,WACJl4B,EAAG,SACHm4B,GAAI,SACJC,EAAG,SACHC,GAAI,SACJC,EAAG,SACHC,GAAI,UAERmB,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO82C,EAAU92C,OAGzB22C,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO42C,EAAU52C,OAGzB2zC,cAAe,2BACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAGO,QAAb5C,GAAsB4C,GAAQ,GACjB,UAAb5C,GAAwB4C,EAAO,GACnB,UAAb5C,EAEO4C,EAAO,GAEPA,GAGf5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,MACAA,EAAO,GACP,OACAA,EAAO,GACP,QACAA,EAAO,GACP,QAEA,OAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KApHyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJnS,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,qJAAqJxsC,MACzJ,KAEJysC,YAAa,iEAAiEzsC,MAC1E,KAEJ8wC,iBAAkB,gBAClBC,kBAAkB,EAClBrE,SAAU,gFAAgF1sC,MACtF,KAEJ2sC,cAAe,oDAAoD3sC,MAC/D,KAEJ4sC,YAAa,6BAA6B5sC,MAAM,KAChDmtC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,sBACLC,KAAM,6BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,cACTC,SAAU,wBACVC,QAAS,YACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN7zC,EAAG,QACH8zC,GAAI,YACJl8C,EAAG,aACHm8C,GAAI,WACJC,EAAG,cACHC,GAAI,YACJl4B,EAAG,WACHm4B,GAAI,UACJC,EAAG,YACHC,GAAI,UACJC,EAAG,UACHC,GAAI,SAERmB,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO82C,EAAU92C,OAGzB22C,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO42C,EAAU52C,OAGzB2zC,cAAe,wCACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAGO,WAAb5C,GAAyB4C,GAAQ,GACpB,YAAb5C,GAA0B4C,EAAO,GACrB,YAAb5C,EAEO4C,EAAO,GAEPA,GAGf5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,SACAA,EAAO,GACP,UACAA,EAAO,GACP,UACAA,EAAO,GACP,UAEA,UAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KAxHyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,SAASmT,EAAyBjC,EAAQQ,EAAexsD,GAMrD,OAAOgsD,EAAS,IAoBpB,SAAkBjvC,EAAMivC,GACpB,OAAe,IAAXA,EAKR,SAAsBjvC,GAClB,IAAImxC,EAAgB,CAChB/+C,EAAG,IACH4J,EAAG,IACHua,EAAG,KAEP,YAAsChlB,IAAlC4/C,EAAcnxC,EAAKnd,OAAO,IACnBmd,EAEJmxC,EAAcnxC,EAAKnd,OAAO,IAAMmd,EAAKqX,UAAU,GAb3C+5B,CAAapxC,GAEjBA,EAxBeqxC,CALT,CACT9C,GAAI,WACJK,GAAI,MACJF,GAAI,UAE8BzrD,GAAMgsD,GAchD,SAASqC,EAAWrC,GAChB,OAAIA,EAAS,EACFqC,EAAWrC,EAAS,IAExBA,EAoBX,IAAIsC,EAAc,CACV,QACA,cACA,QACA,QACA,QACA,cACA,QACA,QACA,QACA,QACA,OACA,SAEJC,EAAc,6IAqBdC,EAAmB,CACf,OACA,OACA,eACA,QACA,OACA,OACA,QAGC1T,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,gFAAgFxsC,MACpF,KAEJysC,YAAa,mDAAmDzsC,MAAM,KACtE0sC,SAAU,6CAA6C1sC,MAAM,KAC7D2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,wBAAwB5sC,MAAM,KAC3CwxC,cAAeD,EACfE,kBArCoB,CAChB,QACA,QACA,WACA,iBACA,SACA,WACA,YA+BJC,mBA7BqB,CACjB,QACA,QACA,QACA,QACA,QACA,QACA,SAuBJH,iBAAkBA,EAElBD,YAAaA,EACbR,iBAAkBQ,EAClBK,kBA7CoB,wFA8CpBC,uBA7CyB,2DA8CzBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAElBlE,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,sBACJC,IAAK,4BACLC,KAAM,mCAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,qBACTC,SAAU,eACVC,QAAS,gBACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,SACN7zC,EAAG,wBACH8zC,GAAI,YACJl8C,EAAG,cACHm8C,GAAI2C,EACJ1C,EAAG,SACHC,GAAI,SACJl4B,EAAG,YACHm4B,GAAIwC,EACJvC,EAAG,SACHC,GAAIsC,EACJrC,EAAG,WACHC,GApIR,SAAiCG,GAC7B,OAAQqC,EAAWrC,IACf,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,OAAOA,EAAS,SACpB,QACI,OAAOA,EAAS,YA6HxBF,uBAAwB,kBACxBC,QAAS,SAAUC,GAEf,OAAOA,GADiB,IAAXA,EAAe,KAAO,QAGvCC,KAAM,CACFC,IAAK,EACLC,IAAK,GAETrC,cAAe,YACfC,KAAM,SAAUruC,GACZ,MAAiB,SAAVA,GAEXsuC,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAOyC,EAAO,GAAK,OAAS,UAnKEvyD,CAAQ,EAAQ,2FCIlD,SAAWygD,GAAU,aAIzB,SAASkU,EAAUhD,EAAQQ,EAAexsD,GACtC,IAAIS,EAASurD,EAAS,IACtB,OAAQhsD,GACJ,IAAK,KAQD,OANIS,GADW,IAAXurD,EACU,UACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,UAEA,WAGlB,IAAK,IACD,OAAOQ,EAAgB,eAAiB,eAC5C,IAAK,KAQD,OANI/rD,GADW,IAAXurD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,SAEA,UAGlB,IAAK,IACD,OAAOQ,EAAgB,YAAc,cACzC,IAAK,KAQD,OANI/rD,GADW,IAAXurD,EACU,MACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,OAEA,QAGlB,IAAK,KAMD,OAJIvrD,GADW,IAAXurD,EACU,MAEA,QAGlB,IAAK,KAQD,OANIvrD,GADW,IAAXurD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,UAEA,WAGlB,IAAK,KAQD,OANIvrD,GADW,IAAXurD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,SAEA,WAMjBlR,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,qFAAqFxsC,MACzF,KAEJysC,YAAa,8DAA8DzsC,MACvE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,4DAA4D1sC,MAClE,KAEJ2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,WACN,OAAQ3wD,KAAKqzD,OACT,KAAK,EACD,MAAO,wBACX,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,sBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,oBAGnBzC,QAAS,eACTC,SAAU,WACN,OAAQ7wD,KAAKqzD,OACT,KAAK,EACL,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,2BACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,yBAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN7zC,EAAG,cACH8zC,GAAI2D,EACJ7/C,EAAG6/C,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJ17B,EAAG,MACHm4B,GAAIuD,EACJtD,EAAG,SACHC,GAAIqD,EACJpD,EAAG,SACHC,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAlJyB9xD,CAAQ,EAAQ,2FCElD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,CACJ6D,WAAY,oFAAoFrwC,MAC5F,KAEJ8E,OAAQ,qHAAqH9E,MACzH,KAEJswC,SAAU,mBAEd7D,YAAa,8DAA8DzsC,MACvE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,8DAA8D1sC,MACpE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,mBACJyE,GAAI,aACJxE,IAAK,gCACLyE,IAAK,mBACLxE,KAAM,qCACNyE,KAAM,wBAEVxE,SAAU,CACNC,QAAS,WACL,MAAO,YAA+B,IAAjBzwD,KAAK8vD,QAAgB,MAAQ,MAAQ,QAE9DY,QAAS,WACL,MAAO,YAA+B,IAAjB1wD,KAAK8vD,QAAgB,MAAQ,MAAQ,QAE9Da,SAAU,WACN,MAAO,YAA+B,IAAjB3wD,KAAK8vD,QAAgB,MAAQ,MAAQ,QAE9Dc,QAAS,WACL,MAAO,YAA+B,IAAjB5wD,KAAK8vD,QAAgB,MAAQ,MAAQ,QAE9De,SAAU,WACN,MACI,wBACkB,IAAjB7wD,KAAK8vD,QAAgB,MAAQ,MAC9B,QAGRgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,QACN7zC,EAAG,aACH8zC,GAAI,YACJl8C,EAAG,WACHm8C,GAAI,YACJC,EAAG,WACHC,GAAI,WACJl4B,EAAG,SACHm4B,GAAI,UACJC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,qBACxBC,QAAS,SAAUC,EAAQyB,GACvB,IAAI2B,EACW,IAAXpD,EACM,IACW,IAAXA,EACA,IACW,IAAXA,EACA,IACW,IAAXA,EACA,IACA,IAIV,MAHe,MAAXyB,GAA6B,MAAXA,IAClB2B,EAAS,KAENpD,EAASoD,GAEpBnD,KAAM,CACFC,IAAK,EACLC,IAAK,KA/FyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAI2O,EAAS,oFAAoFxsC,MACzF,KAEJysC,EAAc,kDAAkDzsC,MAAM,KACtEqxC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,yBACA,4BACA,QACA,QACA,QACA,QACA,SAIJC,EAAc,wJAElB,SAASc,EAAO30C,GACZ,OAAOA,EAAI,GAAKA,EAAI,GAAoB,MAAZA,EAAI,IAEpC,SAASs0C,EAAUhD,EAAQQ,EAAexsD,EAAKysD,GAC3C,IAAIhsD,EAASurD,EAAS,IACtB,OAAQhsD,GACJ,IAAK,IACD,OAAOwsD,GAAiBC,EAAW,aAAe,gBACtD,IAAK,KACD,OAAID,GAAiBC,EACVhsD,GAAU4uD,EAAOrD,GAAU,UAAY,UAEvCvrD,EAAS,YAExB,IAAK,IACD,OAAO+rD,EAAgB,SAAWC,EAAW,SAAW,UAC5D,IAAK,KACD,OAAID,GAAiBC,EACVhsD,GAAU4uD,EAAOrD,GAAU,SAAW,SAEtCvrD,EAAS,WAExB,IAAK,IACD,OAAO+rD,EAAgB,SAAWC,EAAW,SAAW,UAC5D,IAAK,KACD,OAAID,GAAiBC,EACVhsD,GAAU4uD,EAAOrD,GAAU,SAAW,SAEtCvrD,EAAS,WAExB,IAAK,IACD,OAAO+rD,GAAiBC,EAAW,MAAQ,OAC/C,IAAK,KACD,OAAID,GAAiBC,EACVhsD,GAAU4uD,EAAOrD,GAAU,MAAQ,OAEnCvrD,EAAS,MAExB,IAAK,IACD,OAAO+rD,GAAiBC,EAAW,QAAU,UACjD,IAAK,KACD,OAAID,GAAiBC,EACVhsD,GAAU4uD,EAAOrD,GAAU,SAAW,UAEtCvrD,EAAS,SAExB,IAAK,IACD,OAAO+rD,GAAiBC,EAAW,MAAQ,QAC/C,IAAK,KACD,OAAID,GAAiBC,EACVhsD,GAAU4uD,EAAOrD,GAAU,OAAS,OAEpCvrD,EAAS,QAKvBq6C,EAAO0O,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaA,EACb6E,YAAaA,EACbR,iBAAkBQ,EAGlBK,kBAAmB,uKACnBC,uBAAwB,sDACxBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,mDAAmD1sC,MAAM,KACnE2sC,cAAe,uBAAuB3sC,MAAM,KAC5C4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,yBACN99B,EAAG,cAEP+9B,SAAU,CACNC,QAAS,cACTC,QAAS,eACTC,SAAU,WACN,OAAQ3wD,KAAKqzD,OACT,KAAK,EACD,MAAO,kBACX,KAAK,EACL,KAAK,EACD,MAAO,kBACX,KAAK,EACD,MAAO,mBACX,KAAK,EACD,MAAO,oBACX,KAAK,EACD,MAAO,iBACX,KAAK,EACD,MAAO,oBAGnBzC,QAAS,eACTC,SAAU,WACN,OAAQ7wD,KAAKqzD,OACT,KAAK,EACD,MAAO,wBACX,KAAK,EACL,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,wBACX,KAAK,EACL,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,0BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN7zC,EAAGy3C,EACH3D,GAAI2D,EACJ7/C,EAAG6/C,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJ17B,EAAG07B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzKyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,gEAAgExsC,MACpE,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,oEAAoE1sC,MAC1E,KAEJ2sC,cAAe,6BAA6B3sC,MAAM,KAClD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,sCACJC,IAAK,6CACLC,KAAM,oDAEVC,SAAU,CACNC,QAAS,sBACTC,QAAS,sBACTE,QAAS,sBACTD,SAAU,4BACVE,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SAAUiE,GAMd,OAAOA,GALK,UAAUxrD,KAAKwrD,GACrB,MACA,QAAQxrD,KAAKwrD,GACb,MACA,QAGVhE,KAAM,YACN7zC,EAAG,iBACH8zC,GAAI,aACJl8C,EAAG,YACHm8C,GAAI,WACJC,EAAG,YACHC,GAAI,WACJl4B,EAAG,UACHm4B,GAAI,SACJC,EAAG,WACHC,GAAI,UACJC,EAAG,UACHC,GAAI,UAERC,uBAAwB,cACxBC,QAAS,SACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA5DyB9xD,CAAQ,EAAQ,2FCIlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,yFAAyFxsC,MAC7F,KAEJysC,YAAa,qDAAqDzsC,MAC9D,KAEJ0sC,SAAU,+EAA+E1sC,MACrF,KAEJ2sC,cAAe,+BAA+B3sC,MAAM,KACpD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EAEpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,gBACTC,SAAU,eACVC,QAAS,eACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,WACN7zC,EAAG,mBACH8zC,GAAI,YACJl8C,EAAG,QACHm8C,GAAI,WACJC,EAAG,MACHC,GAAI,SACJl4B,EAAG,UACHm4B,GAAI,aACJC,EAAG,MACHC,GAAI,SACJC,EAAG,WACHC,GAAI,cAERC,uBAAwB,mCAExBC,QAAS,SAAUC,GACf,IACIoD,EAAS,GAiCb,OAlCQpD,EAyBA,GAEAoD,EADM,KA1BNpD,GA0BkB,KA1BlBA,GA0B8B,KA1B9BA,GA0B0C,KA1B1CA,GA0BsD,MA1BtDA,EA2BS,MAEA,MA7BTA,EA+BO,IACXoD,EA9BS,CACL,GACA,KACA,KACA,MACA,MACA,KACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,KACA,MACA,KACA,OAvBApD,IAkCDA,EAASoD,GAEpBnD,KAAM,CACFC,IAAK,EACLC,IAAK,KA9FyB9xD,CAAQ,EAAQ,2FCElD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,sFAAsFxsC,MAC1F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,qDAAqD1sC,MAAM,KACrE2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,eACJC,IAAK,qBACLC,KAAM,sCAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,oBACTC,SAAU,mBACVC,QAAS,iBACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN7zC,EAAG,cACH8zC,GAAI,cACJl8C,EAAG,WACHm8C,GAAI,cACJC,EAAG,UACHC,GAAI,WACJl4B,EAAG,SACHm4B,GAAI,UACJC,EAAG,WACHC,GAAI,aACJC,EAAG,QACHC,GAAI,SAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAnDyB9xD,CAAQ,EAAQ,8FCMlD,SAAWygD,GAAU,aAIzB,SAASwU,EAAoBtD,EAAQQ,EAAexsD,EAAKysD,GACrD,IAAI1qC,EAAS,CACT5S,EAAG,CAAC,cAAe,gBACnBo8C,EAAG,CAAC,cAAe,gBACnBj4B,EAAG,CAAC,UAAW,aACfm4B,GAAI,CAACO,EAAS,QAASA,EAAS,UAChC0B,EAAG,CAAC,aAAc,eAClBhC,EAAG,CAAC,YAAa,eACjBC,GAAI,CAACK,EAAS,UAAWA,EAAS,YAClCJ,EAAG,CAAC,WAAY,cAChBC,GAAI,CAACG,EAAS,SAAUA,EAAS,YAErC,OAAOQ,EAAgBzqC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAG7C86C,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,qFAAqFxsC,MACzF,KAEJysC,YAAa,6DAA6DzsC,MACtE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,8DAA8D1sC,MACpE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,eACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,sBACTK,SAAU,IACVJ,QAAS,uBACTC,SAAU,qBACVC,QAAS,wBACTC,SAAU,gCAEdE,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,oBACH8zC,GAAI,cACJl8C,EAAGmgD,EACHhE,GAAI,aACJC,EAAG+D,EACH9D,GAAI,aACJl4B,EAAGg8B,EACH7D,GAAI6D,EACJ5B,EAAG4B,EACH3B,GAAI,YACJjC,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA1EyB9xD,CAAQ,EAAQ,8FCAlD,SAAWygD,GAAU,aAIzB,SAASwU,EAAoBtD,EAAQQ,EAAexsD,EAAKysD,GACrD,IAAI1qC,EAAS,CACT5S,EAAG,CAAC,cAAe,gBACnBo8C,EAAG,CAAC,cAAe,gBACnBj4B,EAAG,CAAC,UAAW,aACfm4B,GAAI,CAACO,EAAS,QAASA,EAAS,UAChC0B,EAAG,CAAC,aAAc,eAClBhC,EAAG,CAAC,YAAa,eACjBC,GAAI,CAACK,EAAS,UAAWA,EAAS,YAClCJ,EAAG,CAAC,WAAY,cAChBC,GAAI,CAACG,EAAS,SAAUA,EAAS,YAErC,OAAOQ,EAAgBzqC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAG7C86C,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,qFAAqFxsC,MACzF,KAEJysC,YAAa,6DAA6DzsC,MACtE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,8DAA8D1sC,MACpE,KAEJ2sC,cAAe,uBAAuB3sC,MAAM,KAC5C4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,eACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,sBACTK,SAAU,IACVJ,QAAS,uBACTC,SAAU,qBACVC,QAAS,wBACTC,SAAU,gCAEdE,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,oBACH8zC,GAAI,cACJl8C,EAAGmgD,EACHhE,GAAI,aACJC,EAAG+D,EACH9D,GAAI,aACJl4B,EAAGg8B,EACH7D,GAAI6D,EACJ5B,EAAG4B,EACH3B,GAAI,YACJjC,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA1EyB9xD,CAAQ,EAAQ,2FCKlD,SAAWygD,GAAU,aAIzB,SAASwU,EAAoBtD,EAAQQ,EAAexsD,EAAKysD,GACrD,IAAI1qC,EAAS,CACT5S,EAAG,CAAC,cAAe,gBACnBo8C,EAAG,CAAC,cAAe,gBACnBj4B,EAAG,CAAC,UAAW,aACfm4B,GAAI,CAACO,EAAS,QAASA,EAAS,UAChC0B,EAAG,CAAC,aAAc,eAClBhC,EAAG,CAAC,YAAa,eACjBC,GAAI,CAACK,EAAS,UAAWA,EAAS,YAClCJ,EAAG,CAAC,WAAY,cAChBC,GAAI,CAACG,EAAS,SAAUA,EAAS,YAErC,OAAOQ,EAAgBzqC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAG/C86C,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,qFAAqFxsC,MACzF,KAEJysC,YAAa,6DAA6DzsC,MACtE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,8DAA8D1sC,MACpE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,eACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,sBACTK,SAAU,IACVJ,QAAS,uBACTC,SAAU,qBACVC,QAAS,wBACTC,SAAU,gCAEdE,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,oBACH8zC,GAAI,cACJl8C,EAAGmgD,EACHhE,GAAI,aACJC,EAAG+D,EACH9D,GAAI,aACJl4B,EAAGg8B,EACH7D,GAAI6D,EACJ5B,EAAG4B,EACH3B,GAAI,YACJjC,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA1EyB9xD,CAAQ,EAAQ,2FCClD,SAAWygD,GAAU,aAIzB,IAAI2O,EAAS,CACL,WACA,aACA,SACA,WACA,KACA,OACA,SACA,WACA,eACA,aACA,aACA,cAEJE,EAAW,CACP,WACA,OACA,WACA,OACA,aACA,SACA,YAGC7O,EAAO0O,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaD,EACbE,SAAUA,EACVC,cAAeD,EACfE,YAAa,qCAAqC5sC,MAAM,KACxDmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,WACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVZ,cAAe,QACfC,KAAM,SAAUh9C,GACZ,MAAO,OAASA,GAEpBi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,KAEA,MAGfjC,SAAU,CACNC,QAAS,cACTC,QAAS,cACTC,SAAU,UACVC,QAAS,cACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,cACRC,KAAM,YACN7zC,EAAG,iBACH8zC,GAAI,cACJl8C,EAAG,WACHm8C,GAAI,YACJC,EAAG,aACHC,GAAI,cACJl4B,EAAG,WACHm4B,GAAI,YACJC,EAAG,SACHC,GAAI,UACJC,EAAG,WACHC,GAAI,aAERmB,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC49C,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC+8C,KAAM,CACFC,IAAK,EACLC,IAAK,MAxFyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAWhBA,EAAO0O,aAAa,KAAM,CAC/B+F,mBAAoB,qHAAqHtyC,MACrI,KAEJuyC,iBAAkB,qHAAqHvyC,MACnI,KAEJwsC,OAAQ,SAAUgG,EAAgB1tC,GAC9B,OAAK0tC,EAGiB,iBAAX1tC,GACP,IAAIzE,KAAKyE,EAAOqS,UAAU,EAAGrS,EAAO1Z,QAAQ,UAGrClO,KAAKu1D,kBAAkBD,EAAeE,SAEtCx1D,KAAKy1D,oBAAoBH,EAAeE,SARxCx1D,KAAKy1D,qBAWpBlG,YAAa,oDAAoDzsC,MAAM,KACvE0sC,SAAU,yDAAyD1sC,MAC/D,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C+sC,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,KAAO,KAEjBA,EAAU,KAAO,MAGhCJ,KAAM,SAAUh9C,GACZ,MAAyC,OAAjCA,EAAQ,IAAIsU,cAAc,IAEtCyoC,cAAe,gBACfM,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVmF,WAAY,CACRjF,QAAS,iBACTC,QAAS,gBACTC,SAAU,eACVC,QAAS,eACTC,SAAU,WACN,OAAQ7wD,KAAKqzD,OACT,KAAK,EACD,MAAO,gCACX,QACI,MAAO,mCAGnBvC,SAAU,KAEdN,SAAU,SAAU3qD,EAAK8vD,GACrB,IApEY/iD,EAoERqiD,EAASj1D,KAAK41D,YAAY/vD,GAC1BiqD,EAAQ6F,GAAOA,EAAI7F,QAIvB,OAzEYl9C,EAsEGqiD,GApEM,oBAAbvuC,UAA4B9T,aAAiB8T,UACX,sBAA1CnT,OAAO1R,UAAUiT,SAAS/S,KAAK6Q,MAoE3BqiD,EAASA,EAAO9yD,MAAMwzD,IAEnBV,EAAOlgD,QAAQ,KAAM+6C,EAAQ,IAAO,EAAI,MAAQ,SAE3DiB,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN7zC,EAAG,oBACH8zC,GAAI,kBACJl8C,EAAG,YACHm8C,GAAI,WACJC,EAAG,UACHC,GAAI,UACJl4B,EAAG,WACHm4B,GAAI,WACJC,EAAG,aACHC,GAAI,WACJC,EAAG,cACHC,GAAI,aAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAtGyB9xD,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,wFAAwFxsC,MAC5F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,2DAA2D1sC,MACjE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,gBACH8zC,GAAI,aACJl8C,EAAG,WACHm8C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJl4B,EAAG,QACHm4B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAIjzC,EAAIizC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANjzC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBkzC,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB9xD,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,wFAAwFxsC,MAC5F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,2DAA2D1sC,MACjE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,eACJC,IAAK,sBACLC,KAAM,6BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,gBACH8zC,GAAI,aACJl8C,EAAG,WACHm8C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJl4B,EAAG,QACHm4B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAIjzC,EAAIizC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANjzC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,SA7DgB1e,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,wFAAwFxsC,MAC5F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,2DAA2D1sC,MACjE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,gBACH8zC,GAAI,aACJl8C,EAAG,WACHm8C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJl4B,EAAG,QACHm4B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAIjzC,EAAIizC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANjzC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBkzC,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB9xD,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,wFAAwFxsC,MAC5F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,2DAA2D1sC,MACjE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,gBACH8zC,GAAI,aACJl8C,EAAG,WACHm8C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJl4B,EAAG,QACHm4B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAIjzC,EAAIizC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANjzC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBkzC,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB9xD,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,wFAAwFxsC,MAC5F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,2DAA2D1sC,MACjE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,gBACH8zC,GAAI,aACJl8C,EAAG,WACHm8C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJl4B,EAAG,QACHm4B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAIjzC,EAAIizC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANjzC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,SA7DgB1e,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,wFAAwFxsC,MAC5F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,2DAA2D1sC,MACjE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,gBACH8zC,GAAI,aACJl8C,EAAG,WACHm8C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJl4B,EAAG,QACHm4B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAIjzC,EAAIizC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANjzC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBkzC,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB9xD,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,wFAAwFxsC,MAC5F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,2DAA2D1sC,MACjE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,gBACH8zC,GAAI,aACJl8C,EAAG,WACHm8C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJl4B,EAAG,QACHm4B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAIjzC,EAAIizC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANjzC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBkzC,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB9xD,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,wFAAwFxsC,MAC5F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,2DAA2D1sC,MACjE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,gBACH8zC,GAAI,aACJl8C,EAAG,WACHm8C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJl4B,EAAG,QACHm4B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAIjzC,EAAIizC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANjzC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBkzC,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB9xD,CAAQ,EAAQ,2FCMlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,6FAA6FxsC,MACjG,KAEJysC,YAAa,oDAAoDzsC,MAAM,KACvE0sC,SAAU,qDAAqD1sC,MAAM,KACrE2sC,cAAe,gCAAgC3sC,MAAM,KACrD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,4BACJC,IAAK,kCACLC,KAAM,2CACNyE,KAAM,uCAEVrF,cAAe,cACfC,KAAM,SAAUh9C,GACZ,MAAyC,MAAlCA,EAAMnN,OAAO,GAAGyhB,eAE3B2oC,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,SAAW,SAErBA,EAAU,SAAW,UAGpCQ,SAAU,CACNC,QAAS,iBACTC,QAAS,iBACTC,SAAU,gBACVC,QAAS,iBACTC,SAAU,2BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,WACN7zC,EAAG,kBACH8zC,GAAI,cACJl8C,EAAG,aACHm8C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJl4B,EAAG,WACHm4B,GAAI,WACJC,EAAG,aACHC,GAAI,aACJC,EAAG,WACHC,GAAI,YAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA/DyB9xD,CAAQ,EAAQ,8FCDlD,SAAWygD,GAAU,aAIzB,IAAIkV,EAAiB,8DAA8D/yC,MAC3E,KAEJysC,EAAc,kDAAkDzsC,MAAM,KACtEqxC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,mLAEPzT,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,2FAA2FxsC,MAC/F,KAEJysC,YAAa,SAAUv6C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACb2nC,EAAYv6C,EAAEwgD,SAEdK,EAAe7gD,EAAEwgD,SAJjBK,GAOfzB,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,+FACnBC,uBAAwB,0FACxBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,uDAAuD1sC,MAAM,KACvE2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,+BACLC,KAAM,sCAEVC,SAAU,CACNC,QAAS,WACL,MAAO,aAAgC,IAAjBzwD,KAAK8vD,QAAgB,IAAM,IAAM,QAE3DY,QAAS,WACL,MAAO,gBAAmC,IAAjB1wD,KAAK8vD,QAAgB,IAAM,IAAM,QAE9Da,SAAU,WACN,MAAO,cAAiC,IAAjB3wD,KAAK8vD,QAAgB,IAAM,IAAM,QAE5Dc,QAAS,WACL,MAAO,cAAiC,IAAjB5wD,KAAK8vD,QAAgB,IAAM,IAAM,QAE5De,SAAU,WACN,MACI,0BACkB,IAAjB7wD,KAAK8vD,QAAgB,IAAM,IAC5B,QAGRgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN7zC,EAAG,gBACH8zC,GAAI,cACJl8C,EAAG,YACHm8C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJl4B,EAAG,SACHm4B,GAAI,UACJiC,EAAG,aACHC,GAAI,aACJjC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAvGyB9xD,CAAQ,EAAQ,8FCIlD,SAAWygD,GAAU,aAIzB,IAAIkV,EAAiB,8DAA8D/yC,MAC3E,KAEJysC,EAAc,kDAAkDzsC,MAAM,KACtEqxC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,mLAEPzT,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,2FAA2FxsC,MAC/F,KAEJysC,YAAa,SAAUv6C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACb2nC,EAAYv6C,EAAEwgD,SAEdK,EAAe7gD,EAAEwgD,SAJjBK,GAOfzB,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,+FACnBC,uBAAwB,0FACxBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,uDAAuD1sC,MAAM,KACvE2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,6BACLC,KAAM,oCAEVC,SAAU,CACNC,QAAS,WACL,MAAO,aAAgC,IAAjBzwD,KAAK8vD,QAAgB,IAAM,IAAM,QAE3DY,QAAS,WACL,MAAO,gBAAmC,IAAjB1wD,KAAK8vD,QAAgB,IAAM,IAAM,QAE9Da,SAAU,WACN,MAAO,cAAiC,IAAjB3wD,KAAK8vD,QAAgB,IAAM,IAAM,QAE5Dc,QAAS,WACL,MAAO,cAAiC,IAAjB5wD,KAAK8vD,QAAgB,IAAM,IAAM,QAE5De,SAAU,WACN,MACI,0BACkB,IAAjB7wD,KAAK8vD,QAAgB,IAAM,IAC5B,QAGRgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN7zC,EAAG,gBACH8zC,GAAI,cACJl8C,EAAG,YACHm8C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJl4B,EAAG,SACHm4B,GAAI,UACJiC,EAAG,aACHC,GAAI,aACJjC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,GAET8D,YAAa,mBAzGqB51D,CAAQ,EAAQ,8FCIlD,SAAWygD,GAAU,aAIzB,IAAIkV,EAAiB,8DAA8D/yC,MAC3E,KAEJysC,EAAc,kDAAkDzsC,MAAM,KACtEqxC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,mLAEPzT,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,2FAA2FxsC,MAC/F,KAEJysC,YAAa,SAAUv6C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACb2nC,EAAYv6C,EAAEwgD,SAEdK,EAAe7gD,EAAEwgD,SAJjBK,GAOfzB,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,+FACnBC,uBAAwB,0FACxBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,uDAAuD1sC,MAAM,KACvE2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,+BACLC,KAAM,sCAEVC,SAAU,CACNC,QAAS,WACL,MAAO,aAAgC,IAAjBzwD,KAAK8vD,QAAgB,IAAM,IAAM,QAE3DY,QAAS,WACL,MAAO,gBAAmC,IAAjB1wD,KAAK8vD,QAAgB,IAAM,IAAM,QAE9Da,SAAU,WACN,MAAO,cAAiC,IAAjB3wD,KAAK8vD,QAAgB,IAAM,IAAM,QAE5Dc,QAAS,WACL,MAAO,cAAiC,IAAjB5wD,KAAK8vD,QAAgB,IAAM,IAAM,QAE5De,SAAU,WACN,MACI,0BACkB,IAAjB7wD,KAAK8vD,QAAgB,IAAM,IAC5B,QAGRgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN7zC,EAAG,gBACH8zC,GAAI,cACJl8C,EAAG,YACHm8C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJl4B,EAAG,SACHm4B,GAAI,UACJiC,EAAG,aACHC,GAAI,aACJjC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAvGyB9xD,CAAQ,EAAQ,2FCElD,SAAWygD,GAAU,aAIzB,IAAIkV,EAAiB,8DAA8D/yC,MAC3E,KAEJysC,EAAc,kDAAkDzsC,MAAM,KACtEqxC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,mLAETzT,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,2FAA2FxsC,MAC/F,KAEJysC,YAAa,SAAUv6C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACb2nC,EAAYv6C,EAAEwgD,SAEdK,EAAe7gD,EAAEwgD,SAJjBK,GAOfzB,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,+FACnBC,uBAAwB,0FACxBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,uDAAuD1sC,MAAM,KACvE2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,6BACLC,KAAM,oCAEVC,SAAU,CACNC,QAAS,WACL,MAAO,aAAgC,IAAjBzwD,KAAK8vD,QAAgB,IAAM,IAAM,QAE3DY,QAAS,WACL,MAAO,gBAAmC,IAAjB1wD,KAAK8vD,QAAgB,IAAM,IAAM,QAE9Da,SAAU,WACN,MAAO,cAAiC,IAAjB3wD,KAAK8vD,QAAgB,IAAM,IAAM,QAE5Dc,QAAS,WACL,MAAO,cAAiC,IAAjB5wD,KAAK8vD,QAAgB,IAAM,IAAM,QAE5De,SAAU,WACN,MACI,0BACkB,IAAjB7wD,KAAK8vD,QAAgB,IAAM,IAC5B,QAGRgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN7zC,EAAG,gBACH8zC,GAAI,cACJl8C,EAAG,YACHm8C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJl4B,EAAG,SACHm4B,GAAI,UACJiC,EAAG,aACHC,GAAI,aACJjC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,GAET8D,YAAa,mBAzGqB51D,CAAQ,EAAQ,2FCIlD,SAAWygD,GAAU,aAIzB,SAASwU,EAAoBtD,EAAQQ,EAAexsD,EAAKysD,GACrD,IAAI1qC,EAAS,CACTxK,EAAG,CAAC,eAAgB,cAAe,iBACnC8zC,GAAI,CAACW,EAAS,UAAWA,EAAS,YAClC78C,EAAG,CAAC,aAAc,aAClBm8C,GAAI,CAACU,EAAS,UAAWA,EAAS,YAClCT,EAAG,CAAC,YAAa,YAAa,YAC9BC,GAAI,CAACQ,EAAS,SAAUA,EAAS,UACjC14B,EAAG,CAAC,YAAa,YACjBo4B,EAAG,CAAC,UAAW,WAAY,WAC3BC,GAAI,CAACK,EAAS,OAAQA,EAAS,SAC/BJ,EAAG,CAAC,YAAa,QAAS,aAC1BC,GAAI,CAACG,EAAS,SAAUA,EAAS,YAErC,OAAIQ,EACOzqC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAElDysD,EAAW1qC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAG1C86C,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,6FAA6FxsC,MACjG,KAEJysC,YAAa,6DAA6DzsC,MACtE,KAEJ0sC,SAAU,iEAAiE1sC,MACvE,KAEJ2sC,cAAe,gBAAgB3sC,MAAM,KACrC4sC,YAAa,gBAAgB5sC,MAAM,KACnCmtC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,aACTC,QAAS,cACTC,SAAU,qBACVC,QAAS,aACTC,SAAU,oBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,YACN7zC,EAAG+3C,EACHjE,GAAIiE,EACJngD,EAAGmgD,EACHhE,GAAIgE,EACJ/D,EAAG+D,EACH9D,GAAI8D,EACJh8B,EAAGg8B,EACH7D,GAAI,WACJC,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA3EyB9xD,CAAQ,EAAQ,2FCElD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,+FAA+FxsC,MACnG,KAEJysC,YAAa,8DAA8DzsC,MACvE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,sEAAsE1sC,MAC5E,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,0BACJC,IAAK,gCACLC,KAAM,sCACN99B,EAAG,WACHqiC,GAAI,oBACJC,IAAK,0BACLC,KAAM,gCAEVxE,SAAU,CACNC,QAAS,kBACTC,QAAS,mBACTC,SAAU,gBACVC,QAAS,kBACTC,SAAU,0BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,WACN7zC,EAAG,iBACH8zC,GAAI,aACJl8C,EAAG,aACHm8C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJl4B,EAAG,WACHm4B,GAAI,UACJC,EAAG,eACHC,GAAI,cACJC,EAAG,WACHC,GAAI,WAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA7DyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJnS,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,wEAAwExsC,MAC5E,KAEJysC,YAAa,wEAAwEzsC,MACjF,KAEJ0sC,SAAU,qDAAoE1sC,MAC1E,KAEJ2sC,cAAe,qDAAoE3sC,MAC/E,KAEJ4sC,YAAa,gBAAgB5sC,MAAM,KACnC0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVZ,cAAe,wBACfC,KAAM,SAAUh9C,GACZ,MAAO,aAAauQ,KAAKvQ,IAE7Bi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,aAEA,cAGfjC,SAAU,CACNC,QAAS,kBACTC,QAAS,iBACTC,SAAU,iBACVC,QAAS,kBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,YACH8zC,GAAI,WACJl8C,EAAG,WACHm8C,GAAI,WACJC,EAAG,UACHC,GAAI,UACJl4B,EAAG,SACHm4B,GAAI,SACJC,EAAG,SACHC,GAAI,SACJC,EAAG,SACHC,GAAI,UAERmB,SAAU,SAAUttD,GAChB,OAAOA,EACFwP,QAAQ,UAAU,SAAUiH,GACzB,OAAO82C,EAAU92C,MAEpBjH,QAAQ,KAAM,MAEvB49C,WAAY,SAAUptD,GAClB,OAAOA,EACFwP,QAAQ,OAAO,SAAUiH,GACtB,OAAO42C,EAAU52C,MAEpBjH,QAAQ,KAAM,MAEvB48C,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,MA5GyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAIoV,EAAc,wEAAwEjzC,MAClF,KAEJkzC,EAAgB,CACZ,QACA,QACA,SACA,SACA,SACA,SACA,SACAD,EAAY,GACZA,EAAY,GACZA,EAAY,IAEpB,SAASlB,EAAUhD,EAAQQ,EAAexsD,EAAKysD,GAC3C,IAAIhsD,EAAS,GACb,OAAQT,GACJ,IAAK,IACD,OAAOysD,EAAW,oBAAsB,kBAC5C,IAAK,KACDhsD,EAASgsD,EAAW,WAAa,WACjC,MACJ,IAAK,IACD,OAAOA,EAAW,WAAa,WACnC,IAAK,KACDhsD,EAASgsD,EAAW,WAAa,YACjC,MACJ,IAAK,IACD,OAAOA,EAAW,SAAW,QACjC,IAAK,KACDhsD,EAASgsD,EAAW,SAAW,SAC/B,MACJ,IAAK,IACD,OAAOA,EAAW,SAAW,QACjC,IAAK,KACDhsD,EAASgsD,EAAW,SAAW,SAC/B,MACJ,IAAK,IACD,OAAOA,EAAW,YAAc,WACpC,IAAK,KACDhsD,EAASgsD,EAAW,YAAc,YAClC,MACJ,IAAK,IACD,OAAOA,EAAW,SAAW,QACjC,IAAK,KACDhsD,EAASgsD,EAAW,SAAW,SAIvC,OAEJ,SAAsBT,EAAQS,GAC1B,OAAOT,EAAS,GACVS,EACI0D,EAAcnE,GACdkE,EAAYlE,GAChBA,EARGoE,CAAapE,EAAQS,GAAY,IAAMhsD,EAW3Cq6C,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,2GAA2GxsC,MAC/G,KAEJysC,YAAa,uEAAuEzsC,MAChF,KAEJ0sC,SAAU,qEAAqE1sC,MAC3E,KAEJ2sC,cAAe,uBAAuB3sC,MAAM,KAC5C4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,mBACJC,IAAK,gCACLC,KAAM,sCACN99B,EAAG,WACHqiC,GAAI,cACJC,IAAK,2BACLC,KAAM,iCAEVxE,SAAU,CACNC,QAAS,oBACTC,QAAS,sBACTC,SAAU,gBACVC,QAAS,mBACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,YACN7zC,EAAGy3C,EACH3D,GAAI2D,EACJ7/C,EAAG6/C,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJ17B,EAAG07B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAvHyB9xD,CAAQ,EAAQ,4FCIlD,SAAWygD,GAAU,aAIfA,EAAO0O,aAAa,MAAO,CACjCC,OAAQ,0FAA0FxsC,MAC9F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,yDAAyD1sC,MAC/D,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,wBAAwB5sC,MAAM,KAC3CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,YACHC,GAAI,eACJC,IAAK,qBACLC,KAAM,6BAEVC,SAAU,CACNC,QAAS,oBACTC,QAAS,gBACTC,SAAU,0BACVC,QAAS,eACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,gBACRC,KAAM,mBACN7zC,EAAG,gBACH8zC,GAAI,aACJl8C,EAAG,eACHm8C,GAAI,YACJC,EAAG,aACHC,GAAI,UACJl4B,EAAG,aACHm4B,GAAI,UACJC,EAAG,cACHC,GAAI,WACJC,EAAG,aACHC,GAAI,WAERC,uBAAwB,UACxBC,QAAS,SAAUC,GACf,OAAOA,GAEXC,KAAM,CACFC,IAAK,EACLC,IAAK,KAvDyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,qFAAqFxsC,MACzF,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,4EAA4E1sC,MAClF,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,oBACTC,SAAU,gBACVC,QAAS,kBACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,YACN7zC,EAAG,YACH8zC,GAAI,cACJl8C,EAAG,eACHm8C,GAAI,cACJC,EAAG,WACHC,GAAI,WACJl4B,EAAG,YACHm4B,GAAI,WACJC,EAAG,cACHC,GAAI,aACJC,EAAG,UACHC,GAAI,SAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KArDyB9xD,CAAQ,EAAQ,8FCElD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,uFAAuFxsC,MAC3F,KAEJysC,YAAa,iEAAiEzsC,MAC1E,KAEJ+wC,kBAAkB,EAClBrE,SAAU,sDAAsD1sC,MAAM,KACtE2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,qBACTC,QAAS,gBACTC,SAAU,cACVC,QAAS,cACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,YACN7zC,EAAG,oBACH8zC,GAAI,cACJl8C,EAAG,aACHm8C,GAAI,aACJC,EAAG,YACHC,GAAI,YACJl4B,EAAG,UACHm4B,GAAI,WACJC,EAAG,UACHC,GAAI,UACJC,EAAG,QACHC,GAAI,UAERC,uBAAwB,gBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GAEJ,QACA,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACD,OAAOzB,GAAqB,IAAXA,EAAe,KAAO,KAG3C,IAAK,IACL,IAAK,IACD,OAAOA,GAAqB,IAAXA,EAAe,KAAO,SAlEjB3xD,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,uFAAuFxsC,MAC3F,KAEJysC,YAAa,iEAAiEzsC,MAC1E,KAEJ+wC,kBAAkB,EAClBrE,SAAU,sDAAsD1sC,MAAM,KACtE2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,qBACTC,QAAS,gBACTC,SAAU,cACVC,QAAS,cACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,YACN7zC,EAAG,oBACH8zC,GAAI,cACJl8C,EAAG,aACHm8C,GAAI,aACJC,EAAG,YACHC,GAAI,YACJl4B,EAAG,UACHm4B,GAAI,WACJC,EAAG,UACHC,GAAI,UACJC,EAAG,QACHC,GAAI,UAERC,uBAAwB,gBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GAEJ,QACA,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACD,OAAOzB,GAAqB,IAAXA,EAAe,KAAO,KAG3C,IAAK,IACL,IAAK,IACD,OAAOA,GAAqB,IAAXA,EAAe,KAAO,OAGnDC,KAAM,CACFC,IAAK,EACLC,IAAK,KAvEyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAEIyT,EAAc,yKACdD,EAAc,CACV,SACA,SACA,SACA,QACA,QACA,SACA,SACA,SACA,SACA,QACA,QACA,SAGCxT,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,uFAAuFxsC,MAC3F,KAEJysC,YAAa,iEAAiEzsC,MAC1E,KAEJsxC,YAAaA,EACbR,iBAAkBQ,EAClBK,kBA3BoB,2FA4BpBC,uBA3ByB,oFA4BzBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,sDAAsD1sC,MAAM,KACtE2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,qBACTC,QAAS,gBACTC,SAAU,cACVC,QAAS,cACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,YACN7zC,EAAG,oBACH8zC,GAAI,cACJl8C,EAAG,aACHm8C,GAAI,aACJC,EAAG,YACHC,GAAI,YACJl4B,EAAG,UACHm4B,GAAI,WACJiC,EAAG,cACHC,GAAI,cACJjC,EAAG,UACHC,GAAI,UACJC,EAAG,QACHC,GAAI,UAERC,uBAAwB,eACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GAIJ,IAAK,IACD,OAAOzB,GAAqB,IAAXA,EAAe,KAAO,IAG3C,QACA,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACD,OAAOA,GAAqB,IAAXA,EAAe,KAAO,KAG3C,IAAK,IACL,IAAK,IACD,OAAOA,GAAqB,IAAXA,EAAe,KAAO,OAGnDC,KAAM,CACFC,IAAK,EACLC,IAAK,KAtGyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAIuV,EAAsB,6DAA6DpzC,MAC/E,KAEJqzC,EAAyB,kDAAkDrzC,MACvE,KAGC69B,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,iGAAiGxsC,MACrG,KAEJysC,YAAa,SAAUv6C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACbuuC,EAAuBnhD,EAAEwgD,SAEzBU,EAAoBlhD,EAAEwgD,SAJtBU,GAOfrC,kBAAkB,EAClBrE,SAAU,wDAAwD1sC,MAC9D,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,gBACTC,SAAU,eACVC,QAAS,iBACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN7zC,EAAG,mBACH8zC,GAAI,cACJl8C,EAAG,YACHm8C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJl4B,EAAG,UACHm4B,GAAI,WACJC,EAAG,aACHC,GAAI,aACJC,EAAG,WACHC,GAAI,cAERC,uBAAwB,kBACxBC,QAAS,SAAUC,GACf,OACIA,GACY,IAAXA,GAA2B,IAAXA,GAAgBA,GAAU,GAAK,MAAQ,OAGhEC,KAAM,CACFC,IAAK,EACLC,IAAK,KA3EyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aA4ChBA,EAAO0O,aAAa,KAAM,CAC/BC,OAzCS,CACL,SACA,UACA,QACA,UACA,YACA,YACA,OACA,SACA,eACA,mBACA,UACA,WA8BJC,YA5Bc,CACV,MACA,QACA,OACA,MACA,OACA,QACA,OACA,MACA,OACA,OACA,OACA,QAiBJsE,kBAAkB,EAClBrE,SAhBW,CACP,eACA,WACA,WACA,cACA,YACA,YACA,eAUJC,cARgB,CAAC,OAAQ,OAAQ,QAAS,OAAQ,OAAQ,QAAS,QASnEC,YARc,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,IAAK,MASlDO,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,kBACTC,SAAU,eACVC,QAAS,eACTC,SAAU,2BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,OACRC,KAAM,YACN7zC,EAAG,gBACH8zC,GAAI,aACJl8C,EAAG,UACHm8C,GAAI,aACJC,EAAG,iBACHC,GAAI,oBACJl4B,EAAG,KACHm4B,GAAI,QACJC,EAAG,KACHC,GAAI,YACJC,EAAG,SACHC,GAAI,aAERC,uBAAwB,mBACxBC,QAAS,SAAUC,GAEf,OAAOA,GADiB,IAAXA,EAAe,IAAMA,EAAS,IAAO,EAAI,KAAO,OAGjEC,KAAM,CACFC,IAAK,EACLC,IAAK,KA7FyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aA4ChBA,EAAO0O,aAAa,KAAM,CAC/BC,OAzCS,CACL,gBACA,aACA,UACA,aACA,aACA,eACA,cACA,cACA,eACA,aACA,eACA,gBA8BJC,YA5Bc,CACV,OACA,OACA,OACA,OACA,OACA,OACA,OACA,MACA,OACA,OACA,OACA,QAiBJsE,kBAAkB,EAClBrE,SAhBW,CACP,cACA,UACA,UACA,YACA,YACA,WACA,eAUJC,cARgB,CAAC,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,OAS3DC,YARc,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,MASnDO,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,oBACTC,QAAS,sBACTC,SAAU,gBACVC,QAAS,iBACTC,SAAU,6BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,gBACN7zC,EAAG,gBACH8zC,GAAI,YACJl8C,EAAG,UACHm8C,GAAI,gBACJC,EAAG,OACHC,GAAI,aACJl4B,EAAG,QACHm4B,GAAI,WACJC,EAAG,OACHC,GAAI,YACJC,EAAG,WACHC,GAAI,eAERC,uBAAwB,mBACxBC,QAAS,SAAUC,GAEf,OAAOA,GADiB,IAAXA,EAAe,IAAMA,EAAS,IAAO,EAAI,KAAO,OAGjEC,KAAM,CACFC,IAAK,EACLC,IAAK,KA7FyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,yFAAyFxsC,MAC7F,KAEJysC,YAAa,8DAA8DzsC,MACvE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,mDAAmD1sC,MAAM,KACnE2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,6BACLC,KAAM,oCAEVC,SAAU,CACNC,QAAS,WACL,MAAO,UAA6B,IAAjBzwD,KAAK8vD,QAAgB,KAAO,KAAO,QAE1DY,QAAS,WACL,MAAO,UAA6B,IAAjB1wD,KAAK8vD,QAAgB,KAAO,KAAO,QAE1Da,SAAU,WACN,MAAO,UAA6B,IAAjB3wD,KAAK8vD,QAAgB,KAAO,KAAO,QAE1Dc,QAAS,WACL,MAAO,UAA6B,IAAjB5wD,KAAK8vD,QAAgB,IAAM,KAAO,QAEzDe,SAAU,WACN,MACI,qBAAwC,IAAjB7wD,KAAK8vD,QAAgB,KAAO,KAAO,QAGlEgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,SAAUhgD,GACd,OAA0B,IAAtBA,EAAI9C,QAAQ,MACL,IAAM8C,EAEV,MAAQA,GAEnBigD,KAAM,SACN7zC,EAAG,eACH8zC,GAAI,cACJl8C,EAAG,YACHm8C,GAAI,aACJC,EAAG,YACHC,GAAI,WACJl4B,EAAG,SACHm4B,GAAI,UACJC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAxEyB9xD,CAAQ,EAAQ,iGCGlD,SAAWygD,GAAU,aAIzB,SAASwU,EAAoBtD,EAAQQ,EAAexsD,EAAKysD,GACrD,IAAI1qC,EAAS,CACTxK,EAAG,CAAC,kBAAmB,cACvB8zC,GAAI,CAACW,EAAS,aAAcA,EAAS,UACrC78C,EAAG,CAAC,aAAc,YAClBm8C,GAAI,CAACU,EAAS,YAAaA,EAAS,WACpCT,EAAG,CAAC,WAAY,SAChBC,GAAI,CAACQ,EAAS,UAAWA,EAAS,SAClC14B,EAAG,CAAC,YAAa,UACjBm4B,GAAI,CAACO,EAAS,WAAYA,EAAS,QACnCN,EAAG,CAAC,gBAAiB,aACrBC,GAAI,CAACK,EAAS,cAAeA,EAAS,WACtCJ,EAAG,CAAC,aAAc,WAClBC,GAAI,CAACG,EAAS,YAAaA,EAAS,YAExC,OAAOS,EAAW1qC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAGrC86C,EAAO0O,aAAa,WAAY,CAC1CC,OAAQ,CACJ6D,WAAY,wFAAwFrwC,MAChG,KAEJ8E,OAAQ,mJAAmJ9E,MACvJ,KAEJswC,SAAU,mBAEd7D,YAAa,4EAA4EzsC,MACrF,KAEJ+wC,kBAAkB,EAClBrE,SAAU,qDAAqD1sC,MAAM,KACrE2sC,cAAe,4CAA4C3sC,MAAM,KACjE4sC,YAAa,wBAAwB5sC,MAAM,KAC3C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,kBACJC,IAAK,qBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,8BACLC,KAAM,uCACNyE,KAAM,oCAEVxE,SAAU,CACNC,QAAS,WACTC,QAAS,eACTC,SAAU,qBACVC,QAAS,WACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,KACRC,KAAM,UACN7zC,EAAG+3C,EACHjE,GAAIiE,EACJngD,EAAGmgD,EACHhE,GAAIgE,EACJ/D,EAAG+D,EACH9D,GAAI8D,EACJh8B,EAAGg8B,EACH7D,GAAI6D,EACJ5D,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,eACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GAEJ,IAAK,IACD,OAAOzB,EAAS,MACpB,QACA,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACL,IAAK,IACL,IAAK,IACD,OAAOA,IAGnBC,KAAM,CACFC,IAAK,EACLC,IAAK,GAETrC,cAAe,4BACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,SAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,WAAb5C,EACA4C,EACa,YAAb5C,EACA4C,EAAO,GAAKA,EAAOA,EAAO,GACb,UAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,SACAA,EAAO,GACP,UACAA,EAAO,GACP,QAEA,UAzHmBvyD,CAAQ,EAAQ,iGCGlD,SAAWygD,GAAU,aAIzB,SAASwU,EAAoBtD,EAAQQ,EAAexsD,EAAKysD,GACrD,IAAI1qC,EAAS,CACTxK,EAAG,CAAC,qBAAsB,iBAC1B8zC,GAAI,CAACW,EAAS,cAAeA,EAAS,WACtC78C,EAAG,CAAC,aAAc,YAClBm8C,GAAI,CAACU,EAAS,YAAaA,EAAS,WACpCT,EAAG,CAAC,YAAa,UACjBC,GAAI,CAACQ,EAAS,WAAYA,EAAS,UACnC14B,EAAG,CAAC,YAAa,UACjBm4B,GAAI,CAACO,EAAS,WAAYA,EAAS,QACnCN,EAAG,CAAC,eAAgB,aACpBC,GAAI,CAACK,EAAS,cAAeA,EAAS,WACtCJ,EAAG,CAAC,aAAc,YAClBC,GAAI,CAACG,EAAS,YAAaA,EAAS,YAExC,OAAOS,EAAW1qC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAGrC86C,EAAO0O,aAAa,WAAY,CAC1CC,OAAQ,CACJ6D,WAAY,4EAA4ErwC,MACpF,KAEJ8E,OAAQ,wIAAwI9E,MAC5I,KAEJswC,SAAU,mBAEd7D,YAAa,4DAA4DzsC,MACrE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,uDAAuD1sC,MAAM,KACvE2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,iBACJC,IAAK,oBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,6BACLC,KAAM,sCACNyE,KAAM,mCAEVxE,SAAU,CACNC,QAAS,WACTC,QAAS,cACTC,SAAU,sBACVC,QAAS,WACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,KACRC,KAAM,UACN7zC,EAAG+3C,EACHjE,GAAIiE,EACJngD,EAAGmgD,EACHhE,GAAIgE,EACJ/D,EAAG+D,EACH9D,GAAI8D,EACJh8B,EAAGg8B,EACH7D,GAAI6D,EACJ5D,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,cACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GAEJ,IAAK,IACD,OAAOzB,EAAS,KACpB,QACA,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACL,IAAK,IACL,IAAK,IACD,OAAOA,IAGnBC,KAAM,CACFC,IAAK,EACLC,IAAK,GAETrC,cAAe,+BACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,SAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,aAAb5C,EACA4C,EACa,aAAb5C,EACA4C,EAAO,GAAKA,EAAOA,EAAO,GACb,UAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,WACAA,EAAO,GACP,WACAA,EAAO,GACP,QAEA,UAzHmBvyD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJnS,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,yFAAyFxsC,MAC7F,KAEJysC,YAAa,yEAAyEzsC,MAClF,KAEJ+wC,kBAAkB,EAClBrE,SAAU,wDAAwD1sC,MAC9D,KAEJ2sC,cAAe,mCAAmC3sC,MAAM,KACxD4sC,YAAa,qBAAqB5sC,MAAM,KACxCmtC,eAAgB,CACZC,GAAI,gBACJC,IAAK,mBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,6BACLC,KAAM,oCAEVC,SAAU,CACNC,QAAS,UACTC,QAAS,YACTC,SAAU,WACVC,QAAS,cACTC,SAAU,mBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN7zC,EAAG,WACH8zC,GAAI,WACJl8C,EAAG,WACHm8C,GAAI,WACJC,EAAG,UACHC,GAAI,UACJl4B,EAAG,UACHm4B,GAAI,UACJC,EAAG,WACHC,GAAI,WACJC,EAAG,UACHC,GAAI,WAERmB,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO82C,EAAU92C,OAGzB22C,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO42C,EAAU52C,OAKzB2zC,cAAe,qBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,QAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,SAAb5C,EACA4C,EACa,SAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,SAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,MACAA,EAAO,GACP,OACAA,EAAO,GACP,OACAA,EAAO,GACP,OAEA,OAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KAvHyB9xD,CAAQ,EAAQ,2FCKlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,0EAA0ExsC,MAC9E,KAEJysC,YAAa,4DAA4DzsC,MACrE,KAEJ0sC,SAAU,uCAAuC1sC,MAAM,KACvD2sC,cAAe,uBAAuB3sC,MAAM,KAC5C4sC,YAAa,gBAAgB5sC,MAAM,KACnCmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,iBACJC,IAAK,uBACLC,KAAM,6BACN99B,EAAG,WACHqiC,GAAI,aACJC,IAAK,mBACLC,KAAM,yBAEVxE,SAAU,CACNC,QAAS,cACTC,QAAS,aACTC,SAAU,iBACVC,QAAS,eACTC,SAAU,+BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,UACN7zC,EAAG,aACH8zC,GAAI,WACJl8C,EAAG,MACHm8C,GAAI,UACJC,EAAG,MACHC,GAAI,SAAUQ,GACV,OAAe,IAAXA,EACO,SAEJA,EAAS,SAEpB14B,EAAG,MACHm4B,GAAI,SAAUO,GACV,OAAe,IAAXA,EACO,SAEJA,EAAS,SAEpBN,EAAG,OACHC,GAAI,SAAUK,GACV,OAAe,IAAXA,EACO,UAEJA,EAAS,WAEpBJ,EAAG,MACHC,GAAI,SAAUG,GACV,OAAe,IAAXA,EACO,SACAA,EAAS,IAAO,GAAgB,KAAXA,EACrBA,EAAS,OAEbA,EAAS,UAGxBlC,cAAe,gEACfC,KAAM,SAAUh9C,GACZ,MAAO,8BAA8BuQ,KAAKvQ,IAE9Ci9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,aACAA,EAAO,GACP,QACAA,EAAO,GACPzC,EAAU,SAAW,eACrByC,EAAO,GACPzC,EAAU,QAAU,eAEpB,UAzFmB9vD,CAAQ,EAAQ,2FCClD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAETqB,EAAc,CACV,OACA,WACA,UACA,UACA,OACA,QACA,QACA,OACA,aACA,UACA,WACA,cAiBCxT,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,CACJ1nC,OAAQ,8EAA8E9E,MAClF,KAEJqwC,WAAY,0EAA0ErwC,MAClF,MAGRysC,YAAa,6DAA6DzsC,MACtE,KAEJ0sC,SAAU,uDAAuD1sC,MAAM,KACvE2sC,cAAe,kCAAkC3sC,MAAM,KACvD4sC,YAAa,qBAAqB5sC,MAAM,KACxCmtC,eAAgB,CACZC,GAAI,aACJC,IAAK,gBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,0BACLC,KAAM,iCAGV4D,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAzCmB,CACf,OACA,QACA,UACA,UACA,OACA,QACA,QACA,OACA,QACA,UACA,OACA,SA+BJR,YAAa,+KAEbR,iBAAkB,+KAElBa,kBAAmB,uIAEnBC,uBAAwB,sFAExBlE,SAAU,CACNC,QAAS,UACTC,QAAS,UACTC,SAAU,WACVC,QAAS,UACTC,SAAU,mBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,UACN7zC,EAAG,cACH8zC,GAAI,WACJl8C,EAAG,UACHm8C,GAAI,UACJC,EAAG,UACHC,GAAI,UACJl4B,EAAG,SACHm4B,GAAI,SACJC,EAAG,WACHC,GAAI,WACJC,EAAG,UACHC,GAAI,WAERmB,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO82C,EAAU92C,OAGzB22C,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO42C,EAAU52C,OAKzB2zC,cAAe,qBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,QAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,SAAb5C,EACA4C,EACa,UAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,QAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,MACAA,EAAO,GACP,OACAA,EAAO,GACP,QACAA,EAAO,GACP,MAEA,OAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KAlKyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,SAASkU,EAAUhD,EAAQQ,EAAexsD,GACtC,IAAIS,EAASurD,EAAS,IACtB,OAAQhsD,GACJ,IAAK,KAQD,OANIS,GADW,IAAXurD,EACU,UACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,UAEA,WAGlB,IAAK,IACD,OAAOQ,EAAgB,eAAiB,eAC5C,IAAK,KAQD,OANI/rD,GADW,IAAXurD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,SAEA,UAGlB,IAAK,IACD,OAAOQ,EAAgB,YAAc,cACzC,IAAK,KAQD,OANI/rD,GADW,IAAXurD,EACU,MACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,OAEA,QAGlB,IAAK,KAMD,OAJIvrD,GADW,IAAXurD,EACU,MAEA,QAGlB,IAAK,KAQD,OANIvrD,GADW,IAAXurD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,UAEA,WAGlB,IAAK,KAQD,OANIvrD,GADW,IAAXurD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,SAEA,WAMjBlR,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,CACJ1nC,OAAQ,oGAAoG9E,MACxG,KAEJqwC,WAAY,gGAAgGrwC,MACxG,MAGRysC,YAAa,+DAA+DzsC,MACxE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,4DAA4D1sC,MAClE,KAEJ2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,WACN,OAAQ3wD,KAAKqzD,OACT,KAAK,EACD,MAAO,wBACX,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,sBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,oBAGnBzC,QAAS,eACTC,SAAU,WACN,OAAQ7wD,KAAKqzD,OACT,KAAK,EACD,MAAO,6BACX,KAAK,EACD,MAAO,4BACX,KAAK,EACD,MAAO,2BACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,yBAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN7zC,EAAG,cACH8zC,GAAI2D,EACJ7/C,EAAG6/C,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJ17B,EAAG,MACHm4B,GAAIuD,EACJtD,EAAG,SACHC,GAAIqD,EACJpD,EAAG,SACHC,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAxJyB9xD,CAAQ,EAAQ,2FCIlD,SAAWygD,GAAU,aAIzB,IAAIyV,EAAc,gEAAgEtzC,MAC9E,KAEJ,SAAS+xC,EAAUhD,EAAQQ,EAAexsD,EAAKysD,GAC3C,IAAIW,EAAMpB,EACV,OAAQhsD,GACJ,IAAK,IACD,OAAOysD,GAAYD,EACb,mBACA,oBACV,IAAK,KACD,OAAOY,GAAOX,GAAYD,GACpB,aACA,cACV,IAAK,IACD,MAAO,OAASC,GAAYD,EAAgB,QAAU,UAC1D,IAAK,KACD,OAAOY,GAAOX,GAAYD,EAAgB,QAAU,UACxD,IAAK,IACD,MAAO,OAASC,GAAYD,EAAgB,OAAS,UACzD,IAAK,KACD,OAAOY,GAAOX,GAAYD,EAAgB,OAAS,UACvD,IAAK,IACD,MAAO,OAASC,GAAYD,EAAgB,OAAS,UACzD,IAAK,KACD,OAAOY,GAAOX,GAAYD,EAAgB,OAAS,UACvD,IAAK,IACD,MAAO,OAASC,GAAYD,EAAgB,SAAW,YAC3D,IAAK,KACD,OAAOY,GAAOX,GAAYD,EAAgB,SAAW,YACzD,IAAK,IACD,MAAO,OAASC,GAAYD,EAAgB,MAAQ,QACxD,IAAK,KACD,OAAOY,GAAOX,GAAYD,EAAgB,MAAQ,QAE1D,MAAO,GAEX,SAASP,EAAKQ,GACV,OACKA,EAAW,GAAK,WACjB,IACA8D,EAAYp2D,KAAKqzD,OACjB,aAIC1S,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,oGAAoGxsC,MACxG,KAEJysC,YAAa,iEAAiEzsC,MAC1E,KAEJ+wC,kBAAkB,EAClBrE,SAAU,sDAAsD1sC,MAAM,KACtE2sC,cAAe,gCAAgC3sC,MAAM,KACrD4sC,YAAa,qBAAqB5sC,MAAM,KACxCmtC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,cACHC,GAAI,gBACJC,IAAK,qBACLC,KAAM,4BAEVZ,cAAe,SACfC,KAAM,SAAUh9C,GACZ,MAAyC,MAAlCA,EAAMnN,OAAO,GAAGyhB,eAE3B2oC,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,IACW,IAAZE,EAAmB,KAAO,MAEd,IAAZA,EAAmB,KAAO,MAGzCQ,SAAU,CACNC,QAAS,gBACTC,QAAS,oBACTC,SAAU,WACN,OAAOmB,EAAK/vD,KAAK/B,MAAM,IAE3B4wD,QAAS,oBACTC,SAAU,WACN,OAAOiB,EAAK/vD,KAAK/B,MAAM,IAE3B8wD,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,KACN7zC,EAAGy3C,EACH3D,GAAI2D,EACJ7/C,EAAG6/C,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJ17B,EAAG07B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAnHyB9xD,CAAQ,EAAQ,8FCElD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,CACJ1nC,OAAQ,4GAA4G9E,MAChH,KAEJqwC,WAAY,gGAAgGrwC,MACxG,MAGRysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,gEAAgE1sC,MACtE,KAEJ2sC,cAAe,+BAA+B3sC,MAAM,KACpD4sC,YAAa,+BAA+B5sC,MAAM,KAClDmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,iBACJC,IAAK,wBACLC,KAAM,+BAEVC,SAAU,CACNC,QAAS,aACTC,QAAS,YACTE,QAAS,YACTD,SAAU,WACN,MAAO,sBAEXE,SAAU,WACN,MAAO,8BAEXC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,UACN7zC,EAAG,mBACH8zC,GAAI,cACJl8C,EAAG,OACHm8C,GAAI,UACJC,EAAG,MACHC,GAAI,SACJl4B,EAAG,KACHm4B,GAAI,QACJC,EAAG,OACHC,GAAI,UACJC,EAAG,OACHC,GAAI,WAER/B,cAAe,oCACfC,KAAM,SAAUh9C,GACZ,MAAO,uBAAuBuQ,KAAKvQ,IAEvCi9C,SAAU,SAAU4C,GAChB,OAAIA,EAAO,EACA,UACAA,EAAO,GACP,WACAA,EAAO,GACP,UAEA,YAGfd,uBAAwB,0BACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,MACL,IAAK,IACL,IAAK,IACL,IAAK,OACD,OAAe,IAAXzB,EACOA,EAAS,MAEbA,EAAS,MACpB,QACI,OAAOA,IAGnBC,KAAM,CACFC,IAAK,EACLC,IAAK,KA1FyB9xD,CAAQ,EAAQ,2FCIlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,yFAAyFxsC,MAC7F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,6CAA6C1sC,MAAM,KAC7D2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,4BACLC,KAAM,mCAEVZ,cAAe,wBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,SAAb5C,EACO4C,EACa,UAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,SAAb5C,GAAoC,UAAbA,EACvB4C,EAAO,QADX,GAIX5C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACD,OACAA,EAAQ,GACR,QACAA,EAAQ,GACR,OAEA,SAGfU,SAAU,CACNC,QAAS,sBACTC,QAAS,mBACTC,SAAU,kBACVC,QAAS,qBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,eACN7zC,EAAG,iBACH8zC,GAAI,WACJl8C,EAAG,UACHm8C,GAAI,WACJC,EAAG,QACHC,GAAI,SACJl4B,EAAG,SACHm4B,GAAI,UACJC,EAAG,UACHC,GAAI,WACJC,EAAG,UACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAzEyB9xD,CAAQ,EAAQ,2FCElD,SAAWygD,GAAU,aAIzB,SAASuU,EAAO30C,GACZ,OAAIA,EAAI,KAAQ,IAELA,EAAI,IAAO,EAK1B,SAASs0C,EAAUhD,EAAQQ,EAAexsD,EAAKysD,GAC3C,IAAIhsD,EAASurD,EAAS,IACtB,OAAQhsD,GACJ,IAAK,IACD,OAAOwsD,GAAiBC,EAClB,mBACA,mBACV,IAAK,KACD,OAAI4C,EAAOrD,GAEHvrD,GACC+rD,GAAiBC,EAAW,WAAa,YAG3ChsD,EAAS,UACpB,IAAK,IACD,OAAO+rD,EAAgB,SAAW,SACtC,IAAK,KACD,OAAI6C,EAAOrD,GAEHvrD,GAAU+rD,GAAiBC,EAAW,UAAY,WAE/CD,EACA/rD,EAAS,SAEbA,EAAS,SACpB,IAAK,KACD,OAAI4uD,EAAOrD,GAEHvrD,GACC+rD,GAAiBC,EACZ,gBACA,iBAGPhsD,EAAS,cACpB,IAAK,IACD,OAAI+rD,EACO,QAEJC,EAAW,MAAQ,OAC9B,IAAK,KACD,OAAI4C,EAAOrD,GACHQ,EACO/rD,EAAS,QAEbA,GAAUgsD,EAAW,OAAS,SAC9BD,EACA/rD,EAAS,QAEbA,GAAUgsD,EAAW,MAAQ,QACxC,IAAK,IACD,OAAID,EACO,UAEJC,EAAW,QAAU,SAChC,IAAK,KACD,OAAI4C,EAAOrD,GACHQ,EACO/rD,EAAS,UAEbA,GAAUgsD,EAAW,SAAW,WAChCD,EACA/rD,EAAS,UAEbA,GAAUgsD,EAAW,QAAU,UAC1C,IAAK,IACD,OAAOD,GAAiBC,EAAW,KAAO,MAC9C,IAAK,KACD,OAAI4C,EAAOrD,GACAvrD,GAAU+rD,GAAiBC,EAAW,KAAO,QAEjDhsD,GAAU+rD,GAAiBC,EAAW,KAAO,QAIvD3R,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,oFAAoFxsC,MACxF,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,mFAAmF1sC,MACzF,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,0BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,oBACTC,SAAU,gBACVC,QAAS,iBACTC,SAAU,0BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,iBACN7zC,EAAGy3C,EACH3D,GAAI2D,EACJ7/C,EAAG6/C,EACH1D,GAAI0D,EACJzD,EAAG,cACHC,GAAIwD,EACJ17B,EAAG07B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzIyB9xD,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,gGAAgGxsC,MACpG,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,2DAA2D1sC,MACjE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,mBACTC,SAAU,iBACVC,QAAS,iBACTC,SAAU,WACN,OAAQ7wD,KAAKqzD,OACT,KAAK,EACD,MAAO,6BACX,QACI,MAAO,+BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SAAU5zC,GACd,OAAQ,YAAY+F,KAAK/F,GAAK,MAAQ,MAAQ,IAAMA,GAExD6zC,KAAM,QACN7zC,EAAG,iBACH8zC,GAAI,aACJl8C,EAAG,YACHm8C,GAAI,YACJC,EAAG,SACHC,GAAI,SACJl4B,EAAG,YACHm4B,GAAI,YACJC,EAAG,UACHC,GAAI,UACJC,EAAG,UACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA9DyB9xD,CAAQ,EAAQ,2FCKlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,gGAAgGxsC,MACpG,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,2DAA2D1sC,MACjE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,WACL,MACI,WACCzwD,KAAK8vD,QAAU,EAAI,OAA0B,IAAjB9vD,KAAK8vD,QAAgB,IAAM,OACxD,OAGRY,QAAS,WACL,MACI,aACC1wD,KAAK8vD,QAAU,EAAI,OAA0B,IAAjB9vD,KAAK8vD,QAAgB,IAAM,OACxD,OAGRa,SAAU,WACN,MACI,WACC3wD,KAAK8vD,QAAU,EAAI,OAA0B,IAAjB9vD,KAAK8vD,QAAgB,IAAM,OACxD,OAGRc,QAAS,WACL,MACI,WACC5wD,KAAK8vD,QAAU,EAAI,OAA0B,IAAjB9vD,KAAK8vD,QAAgB,IAAM,OACxD,OAGRe,SAAU,WACN,OAAQ7wD,KAAKqzD,OACT,KAAK,EACD,MACI,uBACCrzD,KAAK8vD,QAAU,EACV,OACiB,IAAjB9vD,KAAK8vD,QACL,IACA,OACN,MAER,QACI,MACI,uBACC9vD,KAAK8vD,QAAU,EACV,OACiB,IAAjB9vD,KAAK8vD,QACL,IACA,OACN,QAIhBgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,QACN7zC,EAAG,iBACH8zC,GAAI,aACJl8C,EAAG,YACHm8C,GAAI,YACJC,EAAG,SACHC,GAAI,SACJl4B,EAAG,YACHm4B,GAAI,YACJiC,EAAG,gBACHC,GAAI,eACJjC,EAAG,UACHC,GAAI,UACJC,EAAG,UACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAtGyB9xD,CAAQ,EAAQ,2FCClD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BgH,KAAM,CACF,CACIC,MAAO,aACPC,OAAQ,EACR/wD,KAAM,KACNgxD,OAAQ,IACRC,KAAM,KAEV,CACIH,MAAO,aACPI,MAAO,aACPH,OAAQ,EACR/wD,KAAM,KACNgxD,OAAQ,IACRC,KAAM,KAEV,CACIH,MAAO,aACPI,MAAO,aACPH,OAAQ,EACR/wD,KAAM,KACNgxD,OAAQ,IACRC,KAAM,KAEV,CACIH,MAAO,aACPI,MAAO,aACPH,OAAQ,EACR/wD,KAAM,KACNgxD,OAAQ,IACRC,KAAM,KAEV,CACIH,MAAO,aACPI,MAAO,aACPH,OAAQ,EACR/wD,KAAM,KACNgxD,OAAQ,IACRC,KAAM,KAEV,CACIH,MAAO,aACPI,MAAO,aACPH,OAAQ,EACR/wD,KAAM,KACNgxD,OAAQ,KACRC,KAAM,MAEV,CACIH,MAAO,aACPI,OAAO,IACPH,OAAQ,EACR/wD,KAAM,MACNgxD,OAAQ,KACRC,KAAM,OAGdE,oBAAqB,WACrBC,oBAAqB,SAAUhkD,EAAOoJ,GAClC,MAAoB,MAAbA,EAAM,GAAa,EAAIqN,SAASrN,EAAM,IAAMpJ,EAAO,KAE9D08C,OAAQ,yCAAyCxsC,MAAM,KACvDysC,YAAa,yCAAyCzsC,MAClD,KAEJ0sC,SAAU,8BAA8B1sC,MAAM,KAC9C2sC,cAAe,gBAAgB3sC,MAAM,KACrC4sC,YAAa,gBAAgB5sC,MAAM,KACnCmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,YACJC,IAAK,kBACLC,KAAM,uBACN99B,EAAG,aACHqiC,GAAI,YACJC,IAAK,kBACLC,KAAM,wBAEVrF,cAAe,SACfC,KAAM,SAAUh9C,GACZ,MAAiB,OAAVA,GAEXi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,KAEA,MAGfjC,SAAU,CACNC,QAAS,UACTC,QAAS,UACTC,SAAU,SAAUkG,GAChB,OAAIA,EAAI/E,SAAW9xD,KAAK8xD,OACb,cAEA,WAGflB,QAAS,UACTC,SAAU,SAAUgG,GAChB,OAAI72D,KAAK8xD,SAAW+E,EAAI/E,OACb,cAEA,WAGfhB,SAAU,KAEda,uBAAwB,WACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACD,OAAkB,IAAXzB,EAAe,KAAOA,EAAS,IAC1C,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOA,EAAS,IACpB,QACI,OAAOA,IAGnBd,aAAc,CACVC,OAAQ,MACRC,KAAM,MACN7zC,EAAG,KACH8zC,GAAI,MACJl8C,EAAG,KACHm8C,GAAI,MACJC,EAAG,MACHC,GAAI,OACJl4B,EAAG,KACHm4B,GAAI,MACJC,EAAG,MACHC,GAAI,OACJC,EAAG,KACHC,GAAI,SAlJ0BxxD,CAAQ,EAAQ,2FCIlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,yFAAyFxsC,MAC7F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,+CAA+C1sC,MAAM,KAC/D2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,4BACLC,KAAM,mCAEVZ,cAAe,6BACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,WAAb5C,EACO4C,EACa,WAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,WAAb5C,GAAsC,UAAbA,EACzB4C,EAAO,QADX,GAIX5C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACD,SACAA,EAAQ,GACR,SACAA,EAAQ,GACR,SAEA,SAGfU,SAAU,CACNC,QAAS,2BACTC,QAAS,sBACTC,SAAU,kBACVC,QAAS,wBACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,gBACRC,KAAM,uBACN7zC,EAAG,kBACH8zC,GAAI,WACJl8C,EAAG,kBACHm8C,GAAI,WACJC,EAAG,gBACHC,GAAI,SACJl4B,EAAG,WACHm4B,GAAI,YACJC,EAAG,UACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAzEyB9xD,CAAQ,EAAQ,2FCElD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,qGAAqGxsC,MACzG,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,CACN2D,WAAY,gEAAgErwC,MACxE,KAEJ8E,OAAQ,iEAAiE9E,MACrE,KAEJswC,SAAU,iBAEd3D,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,iBACTE,QAAS,kBACTD,SAAU,wBACVE,SAAU,oBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SAAU5zC,GACd,OAAOA,EAAErI,QAAQ,iCAAiC,SAC9C+hD,EACA7vC,EACA8vC,GAEA,MAAc,MAAPA,EAAa9vC,EAAK,KAAOA,EAAK8vC,EAAK,SAGlD9F,KAAM,SAAU7zC,GACZ,MAAI,4BAA4B+F,KAAK/F,GAC1BA,EAAErI,QAAQ,SAAU,UAE3B,OAAOoO,KAAK/F,GACLA,EAAErI,QAAQ,QAAS,YAEvBqI,GAEXA,EAAG,iBACH8zC,GAAI,UACJl8C,EAAG,OACHm8C,GAAI,UACJC,EAAG,QACHC,GAAI,WACJl4B,EAAG,MACHm4B,GAAI,SACJC,EAAG,MACHC,GAAI,SACJC,EAAG,OACHC,GAAI,WAERC,uBAAwB,8BACxBC,QAAS,SAAUC,GACf,OAAe,IAAXA,EACOA,EAEI,IAAXA,EACOA,EAAS,MAGhBA,EAAS,IACRA,GAAU,KAAOA,EAAS,IAAO,GAClCA,EAAS,KAAQ,EAEV,MAAQA,EAEZA,EAAS,MAEpBC,KAAM,CACFC,IAAK,EACLC,IAAK,KA1FyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAIoS,EAAW,CACX,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,IAAK,OAGApS,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,qFAAqFxsC,MACzF,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,0DAA0D1sC,MAChE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,mBACTC,QAAS,mBACTC,SAAU,kBACVC,QAAS,kBACTC,SAAU,kCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,WACN7zC,EAAG,iBACH8zC,GAAI,YACJl8C,EAAG,YACHm8C,GAAI,WACJC,EAAG,YACHC,GAAI,WACJl4B,EAAG,UACHm4B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,UACHC,GAAI,UAERC,uBAAwB,kBACxBC,QAAS,SAAUC,GAGf,OAAOA,GAAUkB,EAASlB,IAAWkB,EAF7BlB,EAAS,KAEmCkB,EAD5ClB,GAAU,IAAM,IAAM,QAGlCC,KAAM,CACFC,IAAK,EACLC,IAAK,KAhFyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJnS,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,yEAAyExsC,MAC7E,KAEJysC,YAAa,yEAAyEzsC,MAClF,KAEJ0sC,SAAU,iDAAiD1sC,MAAM,KACjE2sC,cAAe,oBAAoB3sC,MAAM,KACzC4sC,YAAa,oBAAoB5sC,MAAM,KACvC0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVZ,cAAe,cACfC,KAAM,SAAUh9C,GACZ,MAAiB,UAAVA,GAEXi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,QAEA,SAGfjC,SAAU,CACNC,QAAS,oBACTC,QAAS,kBACTC,SAAU,iBACVC,QAAS,qBACTC,SAAU,8BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,QACN7zC,EAAG,iBACH8zC,GAAI,YACJl8C,EAAG,UACHm8C,GAAI,UACJC,EAAG,UACHC,GAAI,UACJl4B,EAAG,UACHm4B,GAAI,UACJC,EAAG,QACHC,GAAI,QACJC,EAAG,WACHC,GAAI,YAERC,uBAAwB,YACxBC,QAAS,OACTiB,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO82C,EAAU92C,OAGzB22C,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO42C,EAAU52C,OAGzB81C,KAAM,CACFC,IAAK,EACLC,IAAK,KApGyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJnS,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,6FAA6FxsC,MACjG,KAEJysC,YAAa,2EAA2EzsC,MACpF,KAEJ+wC,kBAAkB,EAClBrE,SAAU,0DAA0D1sC,MAChE,KAEJ2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,wBAAwB5sC,MAAM,KAC3CmtC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,sBACLC,KAAM,6BAEVC,SAAU,CACNC,QAAS,YACTC,QAAS,YACTC,SAAU,WACVC,QAAS,cACTC,SAAU,oBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,WACN7zC,EAAG,gBACH8zC,GAAI,gBACJl8C,EAAG,aACHm8C,GAAI,WACJC,EAAG,YACHC,GAAI,UACJl4B,EAAG,WACHm4B,GAAI,SACJC,EAAG,cACHC,GAAI,YACJC,EAAG,YACHC,GAAI,WAERmB,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO82C,EAAU92C,OAGzB22C,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO42C,EAAU52C,OAGzB2zC,cAAe,gCACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,WAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,aAAb5C,EACA4C,EACa,aAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,SAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,SACAA,EAAO,GACP,WACAA,EAAO,GACP,WACAA,EAAO,GACP,OAEA,UAGfd,uBAAwB,eACxBC,QAAS,SAAUC,GACf,OAAOA,EAAS,OAEpBC,KAAM,CACFC,IAAK,EACLC,IAAK,KAzHyB9xD,CAAQ,EAAQ,2FCIlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,yCAAyCxsC,MAAM,KACvDysC,YAAa,yCAAyCzsC,MAClD,KAEJ0sC,SAAU,8BAA8B1sC,MAAM,KAC9C2sC,cAAe,gBAAgB3sC,MAAM,KACrC4sC,YAAa,gBAAgB5sC,MAAM,KACnCmtC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,cACHC,GAAI,gBACJC,IAAK,uBACLC,KAAM,4BACN99B,EAAG,cACHqiC,GAAI,gBACJC,IAAK,uBACLC,KAAM,6BAEVxE,SAAU,CACNC,QAAS,QACTC,QAAS,QACTC,SAAU,UACVC,QAAS,QACTC,SAAU,cACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,OACRC,KAAM,OACN7zC,EAAG,MACH8zC,GAAI,MACJl8C,EAAG,KACHm8C,GAAI,MACJC,EAAG,OACHC,GAAI,OACJl4B,EAAG,KACHm4B,GAAI,MACJC,EAAG,MACHC,GAAI,MACJC,EAAG,MACHC,GAAI,OAERC,uBAAwB,iBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,IACpB,IAAK,IACD,OAAOA,EAAS,IACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,IACpB,QACI,OAAOA,IAGnBlC,cAAe,QACfC,KAAM,SAAUruC,GACZ,MAAiB,OAAVA,GAEXsuC,SAAU,SAAU4C,EAAMC,EAAQsE,GAC9B,OAAOvE,EAAO,GAAK,KAAO,QAxEIvyD,CAAQ,EAAQ,2FCElD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAETxD,EAAS,CACL,eACA,QACA,QACA,QACA,QACA,WACA,SACA,MACA,UACA,eACA,eACA,gBAGC3O,EAAO0O,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaD,EACbE,SAAU,0EAA0E1sC,MAChF,KAEJ2sC,cAAe,2DAA2D3sC,MACtE,KAEJ4sC,YAAa,gBAAgB5sC,MAAM,KACnC0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVZ,cAAe,kBACfC,KAAM,SAAUh9C,GACZ,MAAO,UAAUuQ,KAAKvQ,IAE1Bi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,UAEA,WAGfjC,SAAU,CACNC,QAAS,sBACTC,QAAS,uBACTC,SAAU,oBACVC,QAAS,qBACTC,SAAU,oBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,KACN7zC,EAAG,kBACH8zC,GAAI,WACJl8C,EAAG,cACHm8C,GAAI,YACJC,EAAG,eACHC,GAAI,aACJl4B,EAAG,WACHm4B,GAAI,SACJC,EAAG,YACHC,GAAI,UACJC,EAAG,WACHC,GAAI,UAERmB,SAAU,SAAUttD,GAChB,OAAOA,EACFwP,QAAQ,iBAAiB,SAAUiH,GAChC,OAAO82C,EAAU92C,MAEpBjH,QAAQ,KAAM,MAEvB49C,WAAY,SAAUptD,GAClB,OAAOA,EACFwP,QAAQ,OAAO,SAAUiH,GACtB,OAAO42C,EAAU52C,MAEpBjH,QAAQ,KAAM,MAEvB+8C,KAAM,CACFC,IAAK,EACLC,IAAK,MApHyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAIoS,EAAW,CACX,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,IAAK,OAGApS,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,kFAAkFxsC,MACtF,KAEJysC,YAAa,qDAAqDzsC,MAC9D,KAEJ0sC,SAAU,2DAA2D1sC,MACjE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,kBACTC,SAAU,iBACVC,QAAS,kBACTC,SAAU,wCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,WACN7zC,EAAG,iBACH8zC,GAAI,YACJl8C,EAAG,YACHm8C,GAAI,WACJC,EAAG,WACHC,GAAI,UACJl4B,EAAG,UACHm4B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,UACHC,GAAI,UAERC,uBAAwB,wBACxBC,QAAS,SAAUC,GAGf,OAAOA,GAAUkB,EAASlB,IAAWkB,EAF7BlB,EAAS,KAEmCkB,EAD5ClB,GAAU,IAAM,IAAM,QAGlCC,KAAM,CACFC,IAAK,EACLC,IAAK,KAlFyB9xD,CAAQ,EAAQ,2FCIlD,SAAWygD,GAAU,aAIzB,SAASwU,EAAoBtD,EAAQQ,EAAexsD,EAAKysD,GACrD,IAAI1qC,EAAS,CACT5S,EAAG,CAAC,aAAc,gBAClBo8C,EAAG,CAAC,YAAa,eACjBj4B,EAAG,CAAC,UAAW,aACfo4B,EAAG,CAAC,WAAY,eAChBE,EAAG,CAAC,UAAW,eAEnB,OAAOY,EAAgBzqC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAuBxD,SAASoxD,EAA4BpF,GAEjC,GADAA,EAASxoC,SAASwoC,EAAQ,IACtBvoC,MAAMuoC,GACN,OAAO,EAEX,GAAIA,EAAS,EAET,OAAO,EACJ,GAAIA,EAAS,GAEhB,OAAI,GAAKA,GAAUA,GAAU,EAI1B,GAAIA,EAAS,IAAK,CAErB,IAAI4B,EAAY5B,EAAS,GAEzB,OACWoF,EADO,IAAdxD,EADa5B,EAAS,GAIS4B,GAChC,GAAI5B,EAAS,IAAO,CAEvB,KAAOA,GAAU,IACbA,GAAkB,GAEtB,OAAOoF,EAA4BpF,GAInC,OAAOoF,EADPpF,GAAkB,KAKjBlR,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,uFAAuFxsC,MAC3F,KAEJysC,YAAa,+DAA+DzsC,MACxE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,mEAAmE1sC,MACzE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,cACJC,IAAK,iBACLC,EAAG,aACHC,GAAI,eACJC,IAAK,2BACLC,KAAM,kCAEVC,SAAU,CACNC,QAAS,eACTK,SAAU,IACVJ,QAAS,eACTC,SAAU,eACVC,QAAS,mBACTC,SAAU,WAEN,OAAQ7wD,KAAKqzD,OACT,KAAK,EACL,KAAK,EACD,MAAO,0BACX,QACI,MAAO,4BAIvBtC,aAAc,CACVC,OAhGR,SAA2BzrD,GAEvB,OAAI0xD,EADS1xD,EAAOwhB,OAAO,EAAGxhB,EAAO2I,QAAQ,OAElC,KAAO3I,EAEX,MAAQA,GA4FX0rD,KA1FR,SAAyB1rD,GAErB,OAAI0xD,EADS1xD,EAAOwhB,OAAO,EAAGxhB,EAAO2I,QAAQ,OAElC,QAAU3I,EAEd,SAAWA,GAsFd6X,EAAG,kBACH8zC,GAAI,cACJl8C,EAAGmgD,EACHhE,GAAI,cACJC,EAAG+D,EACH9D,GAAI,aACJl4B,EAAGg8B,EACH7D,GAAI,UACJC,EAAG4D,EACH3D,GAAI,WACJC,EAAG0D,EACHzD,GAAI,WAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KApIyB9xD,CAAQ,EAAQ,2FCElD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,6EAA6ExsC,MACjF,KAEJysC,YAAa,6EAA6EzsC,MACtF,KAEJ0sC,SAAU,sCAAsC1sC,MAAM,KACtD2sC,cAAe,oCAAoC3sC,MAAM,KACzD4sC,YAAa,mBAAmB5sC,MAAM,KACtC0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,6BAEVZ,cAAe,kBACfC,KAAM,SAAUh9C,GACZ,MAAiB,WAAVA,GAEXi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,WAEA,UAGfjC,SAAU,CACNC,QAAS,kBACTC,QAAS,mBACTC,SAAU,wBACVC,QAAS,qBACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,WACN7zC,EAAG,mBACH8zC,GAAI,YACJl8C,EAAG,SACHm8C,GAAI,UACJC,EAAG,YACHC,GAAI,aACJl4B,EAAG,QACHm4B,GAAI,SACJC,EAAG,UACHC,GAAI,WACJC,EAAG,OACHC,GAAI,SAERC,uBAAwB,eACxBC,QAAS,SAAUC,GACf,MAAO,MAAQA,KA/De3xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAIuW,EAAQ,CACRhG,GAAI,6BACJl8C,EAAG,wBACHm8C,GAAI,0BACJC,EAAG,2BACHC,GAAI,4BACJl4B,EAAG,qBACHm4B,GAAI,sBACJC,EAAG,uBACHC,GAAI,4BACJC,EAAG,mBACHC,GAAI,oBASR,SAASyF,EAAkBtF,EAAQQ,EAAexsD,EAAKysD,GACnD,OAAOD,EACDa,EAAMrtD,GAAK,GACXysD,EACAY,EAAMrtD,GAAK,GACXqtD,EAAMrtD,GAAK,GAErB,SAASuxD,EAAQvF,GACb,OAAOA,EAAS,IAAO,GAAMA,EAAS,IAAMA,EAAS,GAEzD,SAASqB,EAAMrtD,GACX,OAAOqxD,EAAMrxD,GAAKid,MAAM,KAE5B,SAAS+xC,EAAUhD,EAAQQ,EAAexsD,EAAKysD,GAC3C,IAAIhsD,EAASurD,EAAS,IACtB,OAAe,IAAXA,EAEIvrD,EAAS6wD,EAAkBtF,EAAQQ,EAAexsD,EAAI,GAAIysD,GAEvDD,EACA/rD,GAAU8wD,EAAQvF,GAAUqB,EAAMrtD,GAAK,GAAKqtD,EAAMrtD,GAAK,IAE1DysD,EACOhsD,EAAS4sD,EAAMrtD,GAAK,GAEpBS,GAAU8wD,EAAQvF,GAAUqB,EAAMrtD,GAAK,GAAKqtD,EAAMrtD,GAAK,IAIjE86C,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,CACJ1nC,OAAQ,oGAAoG9E,MACxG,KAEJqwC,WAAY,kGAAkGrwC,MAC1G,KAEJswC,SAAU,+DAEd7D,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,CACN5nC,OAAQ,oFAAoF9E,MACxF,KAEJqwC,WAAY,2FAA2FrwC,MACnG,KAEJswC,SAAU,cAEd3D,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,iBAAiB5sC,MAAM,KACpC0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,sCACLC,KAAM,4CACN99B,EAAG,aACHqiC,GAAI,wBACJC,IAAK,sCACLC,KAAM,4CAEVxE,SAAU,CACNC,QAAS,gBACTC,QAAS,aACTC,SAAU,UACVC,QAAS,aACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN7zC,EAlFR,SAA0By0C,EAAQQ,EAAexsD,EAAKysD,GAClD,OAAID,EACO,kBAEAC,EAAW,kBAAoB,mBA+EtCpB,GAAI2D,EACJ7/C,EAAGmiD,EACHhG,GAAI0D,EACJzD,EAAG+F,EACH9F,GAAIwD,EACJ17B,EAAGg+B,EACH7F,GAAIuD,EACJtD,EAAG4F,EACH3F,GAAIqD,EACJpD,EAAG0F,EACHzF,GAAImD,GAERlD,uBAAwB,cACxBC,QAAS,SAAUC,GACf,OAAOA,EAAS,QAEpBC,KAAM,CACFC,IAAK,EACLC,IAAK,KAzHyB9xD,CAAQ,EAAQ,2FCIlD,SAAWygD,GAAU,aAIzB,IAAIuW,EAAQ,CACRhG,GAAI,qCAAqCpuC,MAAM,KAC/C9N,EAAG,iCAAiC8N,MAAM,KAC1CquC,GAAI,iCAAiCruC,MAAM,KAC3CsuC,EAAG,iCAAiCtuC,MAAM,KAC1CuuC,GAAI,iCAAiCvuC,MAAM,KAC3CqW,EAAG,6BAA6BrW,MAAM,KACtCwuC,GAAI,6BAA6BxuC,MAAM,KACvCyuC,EAAG,iCAAiCzuC,MAAM,KAC1C0uC,GAAI,iCAAiC1uC,MAAM,KAC3C2uC,EAAG,wBAAwB3uC,MAAM,KACjC4uC,GAAI,wBAAwB5uC,MAAM,MAKtC,SAAS8E,EAAOsrC,EAAOrB,EAAQQ,GAC3B,OAAIA,EAEOR,EAAS,IAAO,GAAKA,EAAS,KAAQ,GAAKqB,EAAM,GAAKA,EAAM,GAI5DrB,EAAS,IAAO,GAAKA,EAAS,KAAQ,GAAKqB,EAAM,GAAKA,EAAM,GAG3E,SAASF,EAAuBnB,EAAQQ,EAAexsD,GACnD,OAAOgsD,EAAS,IAAMjqC,EAAOsvC,EAAMrxD,GAAMgsD,EAAQQ,GAErD,SAASgF,EAAyBxF,EAAQQ,EAAexsD,GACrD,OAAO+hB,EAAOsvC,EAAMrxD,GAAMgsD,EAAQQ,GAM7B1R,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,uGAAuGxsC,MAC3G,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,0EAA0E1sC,MAChF,KAEJ2sC,cAAe,kBAAkB3sC,MAAM,KACvC4sC,YAAa,kBAAkB5sC,MAAM,KACrC0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,cACHC,GAAI,uBACJC,IAAK,8BACLC,KAAM,qCAEVC,SAAU,CACNC,QAAS,uBACTC,QAAS,oBACTC,SAAU,qBACVC,QAAS,sBACTC,SAAU,gCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,WACN7zC,EAlCR,SAAyBy0C,EAAQQ,GAC7B,OAAOA,EAAgB,iBAAmB,kBAkCtCnB,GAAI8B,EACJh+C,EAAGqiD,EACHlG,GAAI6B,EACJ5B,EAAGiG,EACHhG,GAAI2B,EACJ75B,EAAGk+B,EACH/F,GAAI0B,EACJzB,EAAG8F,EACH7F,GAAIwB,EACJvB,EAAG4F,EACH3F,GAAIsB,GAERrB,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA1FyB9xD,CAAQ,EAAQ,2FCElD,SAAWygD,GAAU,aAIzB,IAAI2W,EAAa,CACbC,MAAO,CAEHrG,GAAI,CAAC,SAAU,UAAW,WAC1Bl8C,EAAG,CAAC,cAAe,iBACnBm8C,GAAI,CAAC,QAAS,SAAU,UACxBC,EAAG,CAAC,YAAa,eACjBC,GAAI,CAAC,MAAO,OAAQ,QACpBC,GAAI,CAAC,MAAO,OAAQ,QACpBE,GAAI,CAAC,SAAU,UAAW,WAC1BE,GAAI,CAAC,SAAU,SAAU,WAE7B8F,uBAAwB,SAAU3F,EAAQ4F,GACtC,OAAkB,IAAX5F,EACD4F,EAAQ,GACR5F,GAAU,GAAKA,GAAU,EACzB4F,EAAQ,GACRA,EAAQ,IAElB5C,UAAW,SAAUhD,EAAQQ,EAAexsD,GACxC,IAAI4xD,EAAUH,EAAWC,MAAM1xD,GAC/B,OAAmB,IAAfA,EAAIuJ,OACGijD,EAAgBoF,EAAQ,GAAKA,EAAQ,GAGxC5F,EACA,IACAyF,EAAWE,uBAAuB3F,EAAQ4F,KAMjD9W,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,mFAAmFxsC,MACvF,KAEJysC,YAAa,2DAA2DzsC,MACpE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,4DAA4D1sC,MAClE,KAEJ2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,gBAETC,SAAU,WACN,OAAQ3wD,KAAKqzD,OACT,KAAK,EACD,MAAO,wBACX,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,sBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,oBAGnBzC,QAAS,cACTC,SAAU,WAUN,MATmB,CACf,6BACA,iCACA,4BACA,4BACA,8BACA,2BACA,4BAEgB7wD,KAAKqzD,QAE7BvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN7zC,EAAG,mBACH8zC,GAAIoG,EAAWzC,UACf7/C,EAAGsiD,EAAWzC,UACd1D,GAAImG,EAAWzC,UACfzD,EAAGkG,EAAWzC,UACdxD,GAAIiG,EAAWzC,UACf17B,EAAG,MACHm4B,GAAIgG,EAAWzC,UACftD,EAAG,SACHC,GAAI8F,EAAWzC,UACfpD,EAAG,SACHC,GAAI4F,EAAWzC,WAEnBlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KApHyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,8IAA8IxsC,MAClJ,KAEJysC,YAAa,iEAAiEzsC,MAC1E,KAEJsxC,YAAa,yCACbK,kBAAmB,yCACnBb,iBAAkB,yCAClBc,uBAAwB,yCACxBlF,SAAU,kDAAkD1sC,MAAM,KAClE2sC,cAAe,wBAAwB3sC,MAAM,KAC7C4sC,YAAa,wBAAwB5sC,MAAM,KAC3CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,wBACLC,KAAM,+BAEVC,SAAU,CACNC,QAAS,wBACTC,QAAS,eACTC,SAAU,cACVC,QAAS,iBACTC,SAAU,2BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,cACRC,KAAM,WACN7zC,EAAG,mBACH8zC,GAAI,YACJl8C,EAAG,YACHm8C,GAAI,YACJC,EAAG,WACHC,GAAI,WACJl4B,EAAG,QACHm4B,GAAI,QACJC,EAAG,YACHC,GAAI,YACJC,EAAG,SACHC,GAAI,UAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzDyB9xD,CAAQ,EAAQ,2FCIlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,uFAAuFxsC,MAC3F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,wDAAwD1sC,MAC9D,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,YACHC,GAAI,cACJC,IAAK,mBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,eACTC,SAAU,oBACVC,QAAS,gBACTC,SAAU,WACN,OAAQ7wD,KAAKqzD,OACT,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,4BACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,8BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN7zC,EAAG,kBACH8zC,GAAI,aACJl8C,EAAG,cACHm8C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJl4B,EAAG,WACHm4B,GAAI,UACJC,EAAG,aACHC,GAAI,YACJC,EAAG,cACHC,GAAI,aAERC,uBAAwB,8BACxBC,QAAS,SAAUC,GACf,IAAI4B,EAAY5B,EAAS,GACrB6B,EAAc7B,EAAS,IAC3B,OAAe,IAAXA,EACOA,EAAS,MACO,IAAhB6B,EACA7B,EAAS,MACT6B,EAAc,IAAMA,EAAc,GAClC7B,EAAS,MACK,IAAd4B,EACA5B,EAAS,MACK,IAAd4B,EACA5B,EAAS,MACK,IAAd4B,GAAiC,IAAdA,EACnB5B,EAAS,MAETA,EAAS,OAGxBC,KAAM,CACFC,IAAK,EACLC,IAAK,KAnFyB9xD,CAAQ,EAAQ,2FCElD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,yFAAyFxsC,MAC7F,KAEJysC,YAAa,yEAAyEzsC,MAClF,KAEJ+wC,kBAAkB,EAClBrE,SAAU,wEAAwE1sC,MAC9E,KAEJ2sC,cAAe,2CAA2C3sC,MAAM,KAChE4sC,YAAa,wBAAwB5sC,MAAM,KAC3CmtC,eAAgB,CACZC,GAAI,aACJC,IAAK,gBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,0BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,aACTC,QAAS,YACTC,SAAU,WACVC,QAAS,cACTC,SAAU,oBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,aACRC,KAAM,WACN7zC,EAAG,gBACH8zC,GAAI,cACJl8C,EAAG,eACHm8C,GAAI,cACJC,EAAG,eACHC,GAAI,cACJl4B,EAAG,YACHm4B,GAAI,WACJC,EAAG,WACHC,GAAI,UACJC,EAAG,WACHC,GAAI,WAER/B,cAAe,gDACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAGO,WAAb5C,GAAyB4C,GAAQ,GACrB,iBAAb5C,GACa,eAAbA,EAEO4C,EAAO,GAEPA,GAGf5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,SACAA,EAAO,GACP,SACAA,EAAO,GACP,eACAA,EAAO,GACP,aAEA,YA7EmBvyD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,SAASkU,EAAUhD,EAAQQ,EAAexsD,EAAKysD,GAC3C,OAAQzsD,GACJ,IAAK,IACD,OAAOwsD,EAAgB,gBAAkB,kBAC7C,IAAK,KACD,OAAOR,GAAUQ,EAAgB,UAAY,aACjD,IAAK,IACL,IAAK,KACD,OAAOR,GAAUQ,EAAgB,SAAW,YAChD,IAAK,IACL,IAAK,KACD,OAAOR,GAAUQ,EAAgB,OAAS,WAC9C,IAAK,IACL,IAAK,KACD,OAAOR,GAAUQ,EAAgB,QAAU,WAC/C,IAAK,IACL,IAAK,KACD,OAAOR,GAAUQ,EAAgB,OAAS,UAC9C,IAAK,IACL,IAAK,KACD,OAAOR,GAAUQ,EAAgB,OAAS,WAC9C,QACI,OAAOR,GAIVlR,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,+LAA+LxsC,MACnM,KAEJysC,YAAa,6EAA6EzsC,MACtF,KAEJ+wC,kBAAkB,EAClBrE,SAAU,6CAA6C1sC,MAAM,KAC7D2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,oBACJC,IAAK,0BACLC,KAAM,iCAEVZ,cAAe,SACfC,KAAM,SAAUh9C,GACZ,MAAiB,OAAVA,GAEXi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,KAEA,MAGfjC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,iBACVC,QAAS,eACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,UACN7zC,EAAGy3C,EACH3D,GAAI2D,EACJ7/C,EAAG6/C,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJ17B,EAAG07B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,eACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,QACpB,QACI,OAAOA,MAhGe3xD,CAAQ,EAAQ,2FCIlD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGb,SAAS4E,EAAe7F,EAAQQ,EAAe9sD,EAAQ+sD,GACnD,IAAI2C,EAAS,GACb,GAAI5C,EACA,OAAQ9sD,GACJ,IAAK,IACD0vD,EAAS,aACT,MACJ,IAAK,KACDA,EAAS,WACT,MACJ,IAAK,IACDA,EAAS,WACT,MACJ,IAAK,KACDA,EAAS,YACT,MACJ,IAAK,IACDA,EAAS,SACT,MACJ,IAAK,KACDA,EAAS,SACT,MACJ,IAAK,IACDA,EAAS,UACT,MACJ,IAAK,KACDA,EAAS,UACT,MACJ,IAAK,IACDA,EAAS,WACT,MACJ,IAAK,KACDA,EAAS,WACT,MACJ,IAAK,IACDA,EAAS,UACT,MACJ,IAAK,KACDA,EAAS,gBAIjB,OAAQ1vD,GACJ,IAAK,IACD0vD,EAAS,eACT,MACJ,IAAK,KACDA,EAAS,aACT,MACJ,IAAK,IACDA,EAAS,aACT,MACJ,IAAK,KACDA,EAAS,aACT,MACJ,IAAK,IACDA,EAAS,WACT,MACJ,IAAK,KACDA,EAAS,WACT,MACJ,IAAK,IACDA,EAAS,YACT,MACJ,IAAK,KACDA,EAAS,YACT,MACJ,IAAK,IACDA,EAAS,cACT,MACJ,IAAK,KACDA,EAAS,cACT,MACJ,IAAK,IACDA,EAAS,YACT,MACJ,IAAK,KACDA,EAAS,YAIrB,OAAOA,EAAOlgD,QAAQ,MAAO88C,GAGxBlR,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,wFAAwFxsC,MAC5F,KAEJysC,YAAa,gFAAgFzsC,MACzF,KAEJ+wC,kBAAkB,EAClBrE,SAAU,uDAAuD1sC,MAAM,KACvE2sC,cAAe,kCAAkC3sC,MAAM,KACvD4sC,YAAa,qBAAqB5sC,MAAM,KACxCmtC,eAAgB,CACZC,GAAI,eACJC,IAAK,kBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,4BACLC,KAAM,mCAEVC,SAAU,CACNC,QAAS,UACTC,QAAS,aACTC,SAAU,WACVC,QAAS,WACTC,SAAU,mBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,WACN7zC,EAAGs6C,EACHxG,GAAIwG,EACJ1iD,EAAG0iD,EACHvG,GAAIuG,EACJtG,EAAGsG,EACHrG,GAAIqG,EACJv+B,EAAGu+B,EACHpG,GAAIoG,EACJnG,EAAGmG,EACHlG,GAAIkG,EACJjG,EAAGiG,EACHhG,GAAIgG,GAER7E,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO82C,EAAU92C,OAGzB22C,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO42C,EAAU52C,OAGzB2zC,cAAe,qCACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,UAAb5C,GAAqC,UAAbA,EACjB4C,EAEM,WAAb5C,GACa,aAAbA,GACa,WAAbA,EAEO4C,GAAQ,GAAKA,EAAOA,EAAO,QAL/B,GAQX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,GAAQ,GAAKA,EAAO,EACb,QACAA,EAAO,GACP,QACAA,EAAO,GACP,SACAA,EAAO,GACP,WAEA,UAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KAvMyB9xD,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,oFAAoFxsC,MACxF,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,6CAA6C1sC,MAAM,KAC7D2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,4BACLC,KAAM,mCAEVZ,cAAe,8BACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,SAAb5C,EACO4C,EACa,cAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,WAAb5C,GAAsC,UAAbA,EACzB4C,EAAO,QADX,GAIX5C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACD,OACAA,EAAQ,GACR,YACAA,EAAQ,GACR,SAEA,SAGfU,SAAU,CACNC,QAAS,sBACTC,QAAS,kBACTC,SAAU,kBACVC,QAAS,sBACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,gBACN7zC,EAAG,gBACH8zC,GAAI,UACJl8C,EAAG,UACHm8C,GAAI,WACJC,EAAG,QACHC,GAAI,SACJl4B,EAAG,SACHm4B,GAAI,UACJC,EAAG,UACHC,GAAI,WACJC,EAAG,UACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAzEyB9xD,CAAQ,EAAQ,2FCElD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,oFAAoFxsC,MACxF,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,6CAA6C1sC,MAAM,KAC7D2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,4BACLC,KAAM,mCAEVZ,cAAe,8BACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,SAAb5C,EACO4C,EACa,cAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,WAAb5C,GAAsC,UAAbA,EACzB4C,EAAO,QADX,GAIX5C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACD,OACAA,EAAQ,GACR,YACAA,EAAQ,GACR,SAEA,SAGfU,SAAU,CACNC,QAAS,sBACTC,QAAS,kBACTC,SAAU,kBACVC,QAAS,sBACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,gBACN7zC,EAAG,gBACH8zC,GAAI,UACJl8C,EAAG,UACHm8C,GAAI,WACJC,EAAG,QACHC,GAAI,SACJl4B,EAAG,SACHm4B,GAAI,UACJC,EAAG,UACHC,GAAI,WACJC,EAAG,UACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAzEyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,wFAAwFxsC,MAC5F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,iEAAiE1sC,MACvE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,iBACTC,SAAU,gBACVC,QAAS,qBACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,eACH8zC,GAAI,aACJl8C,EAAG,SACHm8C,GAAI,YACJC,EAAG,SACHC,GAAI,aACJl4B,EAAG,UACHm4B,GAAI,YACJC,EAAG,QACHC,GAAI,UACJC,EAAG,OACHC,GAAI,UAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KArDyB9xD,CAAQ,EAAQ,2FCKlD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJnS,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,2FAA2FxsC,MAC/F,KAEJysC,YAAa,mDAAmDzsC,MAAM,KACtE0sC,SAAU,wDAAwD1sC,MAC9D,KAEJ2sC,cAAe,2BAA2B3sC,MAAM,KAChD4sC,YAAa,2BAA2B5sC,MAAM,KAE9CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,sBACTC,SAAU,gBACVC,QAAS,mBACTC,SAAU,6BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,gBACRC,KAAM,kBACN7zC,EAAG,kBACH8zC,GAAI,aACJl8C,EAAG,WACHm8C,GAAI,WACJC,EAAG,UACHC,GAAI,UACJl4B,EAAG,SACHm4B,GAAI,SACJC,EAAG,OACHC,GAAI,OACJC,EAAG,UACHC,GAAI,WAERmB,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO82C,EAAU92C,OAGzB22C,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO42C,EAAU52C,OAGzB81C,KAAM,CACFC,IAAK,EACLC,IAAK,KAvFyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,qFAAqFxsC,MACzF,KAEJysC,YAAa,6DAA6DzsC,MACtE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,qDAAqD1sC,MAAM,KACrE2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,eACJC,IAAK,2BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,oBACTC,SAAU,gBACVC,QAAS,iBACTC,SAAU,0BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN7zC,EAAG,gBACH8zC,GAAI,cACJl8C,EAAG,aACHm8C,GAAI,cACJC,EAAG,UACHC,GAAI,WACJl4B,EAAG,SACHm4B,GAAI,WACJiC,EAAG,SACHC,GAAI,UACJjC,EAAG,WACHC,GAAI,aACJC,EAAG,SACHC,GAAI,SAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzDyB9xD,CAAQ,EAAQ,2FCClD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJnS,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,uFAAuFxsC,MAC3F,KAEJysC,YAAa,uEAAuEzsC,MAChF,KAEJ+wC,kBAAkB,EAClBrE,SAAU,wDAAwD1sC,MAC9D,KAEJ2sC,cAAe,0CAA0C3sC,MAAM,KAC/D4sC,YAAa,4BAA4B5sC,MAAM,KAC/C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,eACJC,IAAK,kBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,4BACLC,KAAM,mCAEVsC,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO82C,EAAU92C,OAGzB22C,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO42C,EAAU52C,OAGzB2zC,cAAe,yBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,SAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,UAAb5C,EACA4C,EACa,WAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,SAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,QACAA,EAAO,GACP,SACAA,EAAO,GACP,OAEA,QAGfjC,SAAU,CACNC,QAAS,UACTC,QAAS,YACTC,SAAU,qBACVC,QAAS,YACTC,SAAU,oBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,OACRC,KAAM,WACN7zC,EAAG,YACH8zC,GAAI,aACJl8C,EAAG,WACHm8C,GAAI,WACJC,EAAG,WACHC,GAAI,WACJl4B,EAAG,SACHm4B,GAAI,SACJC,EAAG,WACHC,GAAI,WACJC,EAAG,UACHC,GAAI,WAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAtHyB9xD,CAAQ,EAAQ,8FCIlD,SAAWygD,GAAU,aAIzB,IAAIuV,EAAsB,6DAA6DpzC,MAC/E,KAEJqzC,EAAyB,kDAAkDrzC,MACvE,KAEJqxC,EAAc,CACV,QACA,QACA,iBACA,QACA,SACA,cACA,cACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,qKAEPzT,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,0FAA0FxsC,MAC9F,KAEJysC,YAAa,SAAUv6C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACbuuC,EAAuBnhD,EAAEwgD,SAEzBU,EAAoBlhD,EAAEwgD,SAJtBU,GAQf9B,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,4FACnBC,uBAAwB,mFAExBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAElB3E,SAAU,6DAA6D1sC,MACnE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,iBACTC,SAAU,eACVC,QAAS,mBACTC,SAAU,2BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,aACN7zC,EAAG,oBACH8zC,GAAI,cACJl8C,EAAG,aACHm8C,GAAI,aACJC,EAAG,UACHC,GAAI,SACJl4B,EAAG,UACHm4B,GAAI,WACJC,EAAG,YACHC,GAAI,aACJC,EAAG,WACHC,GAAI,WAERC,uBAAwB,kBACxBC,QAAS,SAAUC,GACf,OACIA,GACY,IAAXA,GAA2B,IAAXA,GAAgBA,GAAU,GAAK,MAAQ,OAGhEC,KAAM,CACFC,IAAK,EACLC,IAAK,KAnGyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAIuV,EAAsB,6DAA6DpzC,MAC/E,KAEJqzC,EAAyB,kDAAkDrzC,MACvE,KAEJqxC,EAAc,CACV,QACA,QACA,iBACA,QACA,SACA,cACA,cACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,qKAETzT,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,0FAA0FxsC,MAC9F,KAEJysC,YAAa,SAAUv6C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACbuuC,EAAuBnhD,EAAEwgD,SAEzBU,EAAoBlhD,EAAEwgD,SAJtBU,GAQf9B,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,4FACnBC,uBAAwB,mFAExBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAElB3E,SAAU,6DAA6D1sC,MACnE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,iBACTC,SAAU,eACVC,QAAS,mBACTC,SAAU,2BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,aACN7zC,EAAG,oBACH8zC,GAAI,cACJl8C,EAAG,aACHm8C,GAAI,aACJC,EAAG,UACHC,GAAI,SACJl4B,EAAG,UACHm4B,GAAI,WACJiC,EAAG,WACHC,GAAI,WACJjC,EAAG,YACHC,GAAI,aACJC,EAAG,WACHC,GAAI,WAERC,uBAAwB,kBACxBC,QAAS,SAAUC,GACf,OACIA,GACY,IAAXA,GAA2B,IAAXA,GAAgBA,GAAU,GAAK,MAAQ,OAGhEC,KAAM,CACFC,IAAK,EACLC,IAAK,KArGyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,qFAAqFxsC,MACzF,KAEJysC,YAAa,6DAA6DzsC,MACtE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,qDAAqD1sC,MAAM,KACrE2sC,cAAe,+BAA+B3sC,MAAM,KACpD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,eACJC,IAAK,0BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,oBACTC,QAAS,uBACTC,SAAU,mBACVC,QAAS,oBACTC,SAAU,gCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN7zC,EAAG,eACH8zC,GAAI,YACJl8C,EAAG,aACHm8C,GAAI,YACJC,EAAG,WACHC,GAAI,WACJl4B,EAAG,UACHm4B,GAAI,WACJiC,EAAG,UACHC,GAAI,WACJjC,EAAG,YACHC,GAAI,aACJC,EAAG,SACHC,GAAI,SAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzDyB9xD,CAAQ,EAAQ,+FCElD,SAAWygD,GAAU,aAIbA,EAAO0O,aAAa,SAAU,CACtCC,OAAQ,CACJ6D,WAAY,qFAAqFrwC,MAC7F,KAEJ8E,OAAQ,sHAAsH9E,MAC1H,KAEJswC,SAAU,mBAEd7D,YAAa,+DAA+DzsC,MACxE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,2DAA2D1sC,MACjE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,mBACJyE,GAAI,aACJxE,IAAK,4BACLyE,IAAK,mBACLxE,KAAM,iCACNyE,KAAM,wBAEVxE,SAAU,CACNC,QAAS,aACTC,QAAS,eACTC,SAAU,cACVC,QAAS,aACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,QACN7zC,EAAG,gBACH8zC,GAAI,cACJl8C,EAAG,aACHm8C,GAAI,aACJC,EAAG,UACHC,GAAI,UACJl4B,EAAG,UACHm4B,GAAI,WACJC,EAAG,SACHC,GAAI,WACJC,EAAG,QACHC,GAAI,UAERC,uBAAwB,qBACxBC,QAAS,SAAUC,EAAQyB,GACvB,IAAI2B,EACW,IAAXpD,EACM,IACW,IAAXA,EACA,IACW,IAAXA,EACA,IACW,IAAXA,EACA,IACA,IAIV,MAHe,MAAXyB,GAA6B,MAAXA,IAClB2B,EAAS,KAENpD,EAASoD,GAEpBnD,KAAM,CACFC,IAAK,EACLC,IAAK,KAjFyB9xD,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGFnS,EAAO0O,aAAa,QAAS,CAEpCC,OAAQ,sEAAsExsC,MAC1E,KAEJysC,YAAa,sEAAsEzsC,MAC/E,KAEJ0sC,SAAU,yDAAyD1sC,MAC/D,KAEJ2sC,cAAe,iCAAiC3sC,MAAM,KACtD4sC,YAAa,iCAAiC5sC,MAAM,KACpDmtC,eAAgB,CACZC,GAAI,aACJC,IAAK,gBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,0BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,UACTC,QAAS,UACTC,SAAU,kBACVC,QAAS,UACTC,SAAU,mBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,WACN7zC,EAAG,YACH8zC,GAAI,WACJl8C,EAAG,UACHm8C,GAAI,UACJC,EAAG,WACHC,GAAI,UACJl4B,EAAG,UACHm4B,GAAI,SACJC,EAAG,YACHC,GAAI,WACJC,EAAG,UACHC,GAAI,UAERmB,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO82C,EAAU92C,OAGzB22C,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO42C,EAAU52C,OAKzB2zC,cAAe,uBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,QAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,SAAb5C,EACA4C,EACa,WAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,SAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,MACAA,EAAO,GACP,OACAA,EAAO,GACP,SACAA,EAAO,GACP,OAEA,OAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KAvHyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAIgX,EAAmB,mGAAmG70C,MAClH,KAEJ80C,EAAmB,qGAAqG90C,MACpH,KAEJqxC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,SAER,SAASe,EAAO30C,GACZ,OAAOA,EAAI,GAAK,GAAKA,EAAI,GAAK,MAAQA,EAAI,IAAM,IAAO,EAE3D,SAASs0C,EAAUhD,EAAQQ,EAAexsD,GACtC,IAAIS,EAASurD,EAAS,IACtB,OAAQhsD,GACJ,IAAK,KACD,OAAOS,GAAU4uD,EAAOrD,GAAU,UAAY,UAClD,IAAK,IACD,OAAOQ,EAAgB,SAAW,SACtC,IAAK,KACD,OAAO/rD,GAAU4uD,EAAOrD,GAAU,SAAW,SACjD,IAAK,IACD,OAAOQ,EAAgB,UAAY,UACvC,IAAK,KACD,OAAO/rD,GAAU4uD,EAAOrD,GAAU,UAAY,UAClD,IAAK,KACD,OAAOvrD,GAAU4uD,EAAOrD,GAAU,WAAa,WACnD,IAAK,KACD,OAAOvrD,GAAU4uD,EAAOrD,GAAU,WAAa,YACnD,IAAK,KACD,OAAOvrD,GAAU4uD,EAAOrD,GAAU,OAAS,QAI9ClR,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,SAAUgG,EAAgB1tC,GAC9B,OAAK0tC,EAEM,SAASnyC,KAAKyE,GACdgwC,EAAiBtC,EAAeE,SAEhCmC,EAAiBrC,EAAeE,SAJhCmC,GAOfpI,YAAa,kDAAkDzsC,MAAM,KACrEqxC,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,6DAA6D1sC,MACnE,KAEJ2sC,cAAe,2BAA2B3sC,MAAM,KAChD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,eACTC,SAAU,WACN,OAAQ3wD,KAAKqzD,OACT,KAAK,EACD,MAAO,qBAEX,KAAK,EACD,MAAO,mBAEX,KAAK,EACD,MAAO,iBAEX,KAAK,EACD,MAAO,kBAEX,QACI,MAAO,oBAGnBzC,QAAS,iBACTC,SAAU,WACN,OAAQ7wD,KAAKqzD,OACT,KAAK,EACD,MAAO,4BACX,KAAK,EACD,MAAO,wBACX,KAAK,EACD,MAAO,yBACX,QACI,MAAO,2BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN7zC,EAAG,eACH8zC,GAAI2D,EACJ7/C,EAAG6/C,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJ17B,EAAG,UACHm4B,GAAI,SACJiC,EAAG,UACHC,GAAIqB,EACJtD,EAAG,UACHC,GAAIqD,EACJpD,EAAG,MACHC,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzIyB9xD,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,2FAA2FxsC,MAC/F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,iFAAiF1sC,MACvF,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,mCACLC,KAAM,0CAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,iBACTC,SAAU,eACVC,QAAS,gBACTC,SAAU,WACN,OAAsB,IAAf7wD,KAAKqzD,OAA8B,IAAfrzD,KAAKqzD,MAC1B,wBACA,yBAEVvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,QACN7zC,EAAG,kBACH8zC,GAAI,cACJl8C,EAAG,YACHm8C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJl4B,EAAG,SACHm4B,GAAI,UACJC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTkE,YAAa,kBAxDqB51D,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,2FAA2FxsC,MAC/F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,iFAAiF1sC,MACvF,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,8BACLC,KAAM,qCAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,iBACTC,SAAU,eACVC,QAAS,gBACTC,SAAU,WACN,OAAsB,IAAf7wD,KAAKqzD,OAA8B,IAAfrzD,KAAKqzD,MAC1B,wBACA,yBAEVvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,QACN7zC,EAAG,WACH8zC,GAAI,cACJl8C,EAAG,YACHm8C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJl4B,EAAG,SACHm4B,GAAI,UACJiC,EAAG,aACHC,GAAI,aACJjC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA5DyB9xD,CAAQ,EAAQ,2FCKlD,SAAWygD,GAAU,aAIzB,SAASqS,EAAuBnB,EAAQQ,EAAexsD,GACnD,IASIgyD,EAAY,IAIhB,OAHIhG,EAAS,KAAO,IAAOA,GAAU,KAAOA,EAAS,KAAQ,KACzDgG,EAAY,QAEThG,EAASgG,EAbH,CACL3G,GAAI,UACJC,GAAI,SACJE,GAAI,MACJC,GAAI,OACJkC,GAAI,YACJhC,GAAI,OACJE,GAAI,OAMuB7rD,GAG9B86C,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,oGAAoGxsC,MACxG,KAEJysC,YAAa,+DAA+DzsC,MACxE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,kDAAkD1sC,MAAM,KAClE2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,cACJC,IAAK,mBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,gBACTC,SAAU,eACVC,QAAS,eACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,aACN7zC,EAAG,iBACH8zC,GAAI8B,EACJh+C,EAAG,WACHm8C,GAAI6B,EACJ5B,EAAG,QACHC,GAAI2B,EACJ75B,EAAG,OACHm4B,GAAI0B,EACJO,EAAG,cACHC,GAAIR,EACJzB,EAAG,SACHC,GAAIwB,EACJvB,EAAG,QACHC,GAAIsB,GAERlB,KAAM,CACFC,IAAK,EACLC,IAAK,KAvEyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAYzB,SAASqS,EAAuBnB,EAAQQ,EAAexsD,GAUnD,MAAY,MAARA,EACOwsD,EAAgB,SAAW,SAE3BR,EAAS,KArBFoB,GAqB6BpB,EApB3CqB,EAQS,CACThC,GAAImB,EAAgB,yBAA2B,yBAC/ClB,GAAIkB,EAAgB,sBAAwB,sBAC5ChB,GAAI,iBACJC,GAAI,gBACJkC,GAAI,uBACJhC,GAAI,uBACJE,GAAI,gBAKgC7rD,GApBvBid,MAAM,KAChBmwC,EAAM,IAAO,GAAKA,EAAM,KAAQ,GACjCC,EAAM,GACND,EAAM,IAAM,GAAKA,EAAM,IAAM,IAAMA,EAAM,IAAM,IAAMA,EAAM,KAAO,IAClEC,EAAM,GACNA,EAAM,IANhB,IAAsBD,EACdC,EAuBR,IAAIiB,EAAc,CACd,QACA,QACA,QACA,QACA,WACA,QACA,QACA,QACA,QACA,QACA,QACA,SAMKxT,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,CACJ1nC,OAAQ,oFAAoF9E,MACxF,KAEJqwC,WAAY,kFAAkFrwC,MAC1F,MAGRysC,YAAa,CAET3nC,OAAQ,gEAAgE9E,MACpE,KAEJqwC,WAAY,gEAAgErwC,MACxE,MAGR0sC,SAAU,CACN2D,WAAY,gEAAgErwC,MACxE,KAEJ8E,OAAQ,gEAAgE9E,MACpE,KAEJswC,SAAU,iDAEd3D,cAAe,uBAAuB3sC,MAAM,KAC5C4sC,YAAa,uBAAuB5sC,MAAM,KAC1CqxC,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAGlBC,YAAa,2MAGbR,iBAAkB,2MAGlBa,kBAAmB,wHAGnBC,uBAAwB,6FACxBzE,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,iBACJC,IAAK,uBACLC,KAAM,8BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,iBACTE,QAAS,gBACTD,SAAU,SAAUkG,GAChB,GAAIA,EAAI/E,SAAW9xD,KAAK8xD,OAcpB,OAAmB,IAAf9xD,KAAKqzD,MACE,oBAEA,mBAhBX,OAAQrzD,KAAKqzD,OACT,KAAK,EACD,MAAO,6BACX,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,6BACX,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,+BAUvBxC,SAAU,SAAUgG,GAChB,GAAIA,EAAI/E,SAAW9xD,KAAK8xD,OAcpB,OAAmB,IAAf9xD,KAAKqzD,MACE,oBAEA,mBAhBX,OAAQrzD,KAAKqzD,OACT,KAAK,EACD,MAAO,2BACX,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,2BACX,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,6BAUvBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,WACN7zC,EAAG,mBACH8zC,GAAI8B,EACJh+C,EAAGg+C,EACH7B,GAAI6B,EACJ5B,EAAG,MACHC,GAAI2B,EACJ75B,EAAG,OACHm4B,GAAI0B,EACJO,EAAG,SACHC,GAAIR,EACJzB,EAAG,QACHC,GAAIwB,EACJvB,EAAG,MACHC,GAAIsB,GAERrD,cAAe,wBACfC,KAAM,SAAUh9C,GACZ,MAAO,iBAAiBuQ,KAAKvQ,IAEjCi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,OACAA,EAAO,GACP,MAEA,UAGfd,uBAAwB,mBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,KACpB,IAAK,IACD,OAAOA,EAAS,MACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,KACpB,QACI,OAAOA,IAGnBC,KAAM,CACFC,IAAK,EACLC,IAAK,KA1MyB9xD,CAAQ,EAAQ,2FCClD,SAAWygD,GAAU,aAIzB,IAAI2O,EAAS,CACL,QACA,UACA,OACA,QACA,MACA,MACA,SACA,OACA,UACA,SACA,QACA,SAEJwI,EAAO,CAAC,MAAO,OAAQ,QAAS,OAAQ,OAAQ,MAAO,QAElDnX,EAAO0O,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaD,EACbE,SAAUsI,EACVrI,cAAeqI,EACfpI,YAAaoI,EACb7H,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVZ,cAAe,UACfC,KAAM,SAAUh9C,GACZ,MAAO,QAAUA,GAErBi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,MAEJ,OAEXjC,SAAU,CACNC,QAAS,UACTC,QAAS,aACTC,SAAU,yBACVC,QAAS,aACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,QACN7zC,EAAG,YACH8zC,GAAI,WACJl8C,EAAG,SACHm8C,GAAI,SACJC,EAAG,UACHC,GAAI,UACJl4B,EAAG,WACHm4B,GAAI,WACJC,EAAG,WACHC,GAAI,WACJC,EAAG,SACHC,GAAI,UAERmB,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC49C,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC+8C,KAAM,CACFC,IAAK,EACLC,IAAK,KA/EyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,mJAAmJxsC,MACvJ,KAEJysC,YAAa,6DAA6DzsC,MACtE,KAEJ0sC,SAAU,6EAA6E1sC,MACnF,KAEJ2sC,cAAe,mCAAmC3sC,MAAM,KACxD4sC,YAAa,gBAAgB5sC,MAAM,KACnCmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,oBACJC,IAAK,gCACLC,KAAM,uCAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,iBACTC,SAAU,eACVC,QAAS,eACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,WACN7zC,EAAG,mBACH8zC,GAAI,eACJl8C,EAAG,eACHm8C,GAAI,cACJC,EAAG,cACHC,GAAI,aACJl4B,EAAG,cACHm4B,GAAI,cACJC,EAAG,aACHC,GAAI,WACJC,EAAG,aACHC,GAAI,YAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAvDyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAKhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,kGAAkGxsC,MACtG,KAEJysC,YAAa,wDAAwDzsC,MACjE,KAEJ0sC,SAAU,gEAAgE1sC,MACtE,KAEJ2sC,cAAe,gCAAgC3sC,MAAM,KACrD4sC,YAAa,qBAAqB5sC,MAAM,KACxC0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,sBACLC,KAAM,sCAEVC,SAAU,CACNC,QAAS,aACTC,QAAS,cACTC,SAAU,aACVC,QAAS,cACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,WACN7zC,EAAG,eACH8zC,GAAI,WACJl8C,EAAG,YACHm8C,GAAI,cACJC,EAAG,MACHC,GAAI,SACJl4B,EAAG,OACHm4B,GAAI,SACJC,EAAG,OACHC,GAAI,SACJC,EAAG,MACHC,GAAI,UAERC,uBAAwB,eACxBC,QAAS,SAAUC,GACf,OAAOA,EAAS,SAEpBlC,cAAe,4BACfC,KAAM,SAAUh9C,GACZ,MAAiB,SAAVA,GAA8B,YAAVA,GAE/Bi9C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,OAAS,UAEnBA,EAAU,QAAU,aAjED9vD,CAAQ,EAAQ,2FCIlD,SAAWygD,GAAU,aAIzB,IAAI2O,EAAS,oFAAoFxsC,MACzF,KAEJysC,EAAc,kDAAkDzsC,MAAM,KAC1E,SAASoyC,EAAO30C,GACZ,OAAOA,EAAI,GAAKA,EAAI,EAExB,SAASs0C,EAAUhD,EAAQQ,EAAexsD,EAAKysD,GAC3C,IAAIhsD,EAASurD,EAAS,IACtB,OAAQhsD,GACJ,IAAK,IACD,OAAOwsD,GAAiBC,EAAW,aAAe,gBACtD,IAAK,KACD,OAAID,GAAiBC,EACVhsD,GAAU4uD,EAAOrD,GAAU,UAAY,UAEvCvrD,EAAS,YAExB,IAAK,IACD,OAAO+rD,EAAgB,SAAWC,EAAW,SAAW,UAC5D,IAAK,KACD,OAAID,GAAiBC,EACVhsD,GAAU4uD,EAAOrD,GAAU,SAAW,SAEtCvrD,EAAS,WAExB,IAAK,IACD,OAAO+rD,EAAgB,SAAWC,EAAW,SAAW,UAC5D,IAAK,KACD,OAAID,GAAiBC,EACVhsD,GAAU4uD,EAAOrD,GAAU,SAAW,SAEtCvrD,EAAS,WAExB,IAAK,IACD,OAAO+rD,GAAiBC,EAAW,MAAQ,OAC/C,IAAK,KACD,OAAID,GAAiBC,EACVhsD,GAAU4uD,EAAOrD,GAAU,MAAQ,OAEnCvrD,EAAS,QAExB,IAAK,IACD,OAAO+rD,GAAiBC,EAAW,SAAW,WAClD,IAAK,KACD,OAAID,GAAiBC,EACVhsD,GAAU4uD,EAAOrD,GAAU,UAAY,YAEvCvrD,EAAS,WAExB,IAAK,IACD,OAAO+rD,GAAiBC,EAAW,MAAQ,QAC/C,IAAK,KACD,OAAID,GAAiBC,EACVhsD,GAAU4uD,EAAOrD,GAAU,OAAS,SAEpCvrD,EAAS,SAKvBq6C,EAAO0O,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaA,EACbC,SAAU,sDAAsD1sC,MAAM,KACtE2sC,cAAe,uBAAuB3sC,MAAM,KAC5C4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,gBACTC,SAAU,WACN,OAAQ3wD,KAAKqzD,OACT,KAAK,EACD,MAAO,kBACX,KAAK,EACL,KAAK,EACD,MAAO,kBACX,KAAK,EACD,MAAO,kBACX,KAAK,EACD,MAAO,oBACX,KAAK,EACD,MAAO,kBACX,KAAK,EACD,MAAO,oBAGnBzC,QAAS,eACTC,SAAU,WACN,OAAQ7wD,KAAKqzD,OACT,KAAK,EACD,MAAO,uBACX,KAAK,EACL,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,uBACX,KAAK,EACL,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,yBAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN7zC,EAAGy3C,EACH3D,GAAI2D,EACJ7/C,EAAG6/C,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJ17B,EAAG07B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA7IyB9xD,CAAQ,EAAQ,2FCElD,SAAWygD,GAAU,aAIzB,SAASwU,EAAoBtD,EAAQQ,EAAexsD,EAAKysD,GACrD,IAAIhsD,EAASurD,EAAS,IACtB,OAAQhsD,GACJ,IAAK,IACD,OAAOwsD,GAAiBC,EAClB,eACA,kBACV,IAAK,KAUD,OARIhsD,GADW,IAAXurD,EACUQ,EAAgB,UAAY,UACpB,IAAXR,EACGQ,GAAiBC,EAAW,UAAY,WAC3CT,EAAS,EACNQ,GAAiBC,EAAW,UAAY,WAExC,UAGlB,IAAK,IACD,OAAOD,EAAgB,aAAe,aAC1C,IAAK,KAUD,OARI/rD,GADW,IAAXurD,EACUQ,EAAgB,SAAW,SACnB,IAAXR,EACGQ,GAAiBC,EAAW,SAAW,WAC1CT,EAAS,EACNQ,GAAiBC,EAAW,SAAW,WAEvCD,GAAiBC,EAAW,QAAU,YAGxD,IAAK,IACD,OAAOD,EAAgB,UAAY,UACvC,IAAK,KAUD,OARI/rD,GADW,IAAXurD,EACUQ,EAAgB,MAAQ,MAChB,IAAXR,EACGQ,GAAiBC,EAAW,MAAQ,QACvCT,EAAS,EACNQ,GAAiBC,EAAW,MAAQ,QAEpCD,GAAiBC,EAAW,KAAO,SAGrD,IAAK,IACD,OAAOD,GAAiBC,EAAW,SAAW,YAClD,IAAK,KAQD,OANIhsD,GADW,IAAXurD,EACUQ,GAAiBC,EAAW,MAAQ,OAC5B,IAAXT,EACGQ,GAAiBC,EAAW,MAAQ,UAEpCD,GAAiBC,EAAW,MAAQ,SAGtD,IAAK,IACD,OAAOD,GAAiBC,EAAW,WAAa,eACpD,IAAK,KAUD,OARIhsD,GADW,IAAXurD,EACUQ,GAAiBC,EAAW,QAAU,UAC9B,IAAXT,EACGQ,GAAiBC,EAAW,SAAW,WAC1CT,EAAS,EACNQ,GAAiBC,EAAW,SAAW,SAEvCD,GAAiBC,EAAW,UAAY,UAG1D,IAAK,IACD,OAAOD,GAAiBC,EAAW,WAAa,aACpD,IAAK,KAUD,OARIhsD,GADW,IAAXurD,EACUQ,GAAiBC,EAAW,OAAS,QAC7B,IAAXT,EACGQ,GAAiBC,EAAW,OAAS,SACxCT,EAAS,EACNQ,GAAiBC,EAAW,OAAS,OAErCD,GAAiBC,EAAW,MAAQ,SAMrD3R,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,wFAAwFxsC,MAC5F,KAEJysC,YAAa,8DAA8DzsC,MACvE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,sDAAsD1sC,MAAM,KACtE2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,eACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,gBAETC,SAAU,WACN,OAAQ3wD,KAAKqzD,OACT,KAAK,EACD,MAAO,wBACX,KAAK,EACD,MAAO,sBACX,KAAK,EACD,MAAO,uBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,qBAGnBzC,QAAS,iBACTC,SAAU,WACN,OAAQ7wD,KAAKqzD,OACT,KAAK,EACD,MAAO,+BACX,KAAK,EACD,MAAO,6BACX,KAAK,EACD,MAAO,8BACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,4BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,UACN7zC,EAAG+3C,EACHjE,GAAIiE,EACJngD,EAAGmgD,EACHhE,GAAIgE,EACJ/D,EAAG+D,EACH9D,GAAI8D,EACJh8B,EAAGg8B,EACH7D,GAAI6D,EACJ5D,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAxKyB9xD,CAAQ,EAAQ,2FCKlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,gFAAgFxsC,MACpF,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,4DAA4D1sC,MAClE,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,mBAAmB5sC,MAAM,KACtC0vC,oBAAoB,EACpB7C,cAAe,QACfC,KAAM,SAAUh9C,GACZ,MAA2B,MAApBA,EAAMnN,OAAO,IAExBoqD,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAOF,EAAQ,GAAK,KAAO,MAE/BG,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,gBACTC,SAAU,eACVC,QAAS,cACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,aACN7zC,EAAG,eACH8zC,GAAI,aACJl8C,EAAG,aACHm8C,GAAI,YACJC,EAAG,UACHC,GAAI,SACJl4B,EAAG,WACHm4B,GAAI,UACJC,EAAG,WACHC,GAAI,UACJC,EAAG,UACHC,GAAI,WAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA7DyB9xD,CAAQ,EAAQ,gGCElD,SAAWygD,GAAU,aAIzB,IAAI2W,EAAa,CACbC,MAAO,CAEHrG,GAAI,CAAC,UAAW,UAAW,WAC3Bl8C,EAAG,CAAC,cAAe,gBACnBm8C,GAAI,CAAC,QAAS,SAAU,UACxBC,EAAG,CAAC,YAAa,eACjBC,GAAI,CAAC,MAAO,OAAQ,QACpBC,GAAI,CAAC,MAAO,OAAQ,QACpBE,GAAI,CAAC,QAAS,SAAU,UACxBE,GAAI,CAAC,SAAU,SAAU,WAE7B8F,uBAAwB,SAAU3F,EAAQ4F,GACtC,OAAkB,IAAX5F,EACD4F,EAAQ,GACR5F,GAAU,GAAKA,GAAU,EACzB4F,EAAQ,GACRA,EAAQ,IAElB5C,UAAW,SAAUhD,EAAQQ,EAAexsD,GACxC,IAAI4xD,EAAUH,EAAWC,MAAM1xD,GAC/B,OAAmB,IAAfA,EAAIuJ,OACGijD,EAAgBoF,EAAQ,GAAKA,EAAQ,GAGxC5F,EACA,IACAyF,EAAWE,uBAAuB3F,EAAQ4F,KAM7C9W,EAAO0O,aAAa,UAAW,CACxCC,OAAQ,mFAAmFxsC,MACvF,KAEJysC,YAAa,2DAA2DzsC,MACpE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,sDAAsD1sC,MAAM,KACtE2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,cACHC,GAAI,gBACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,WACN,OAAQ3wD,KAAKqzD,OACT,KAAK,EACD,MAAO,sBACX,KAAK,EACD,MAAO,qBACX,KAAK,EACD,MAAO,sBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,oBAGnBzC,QAAS,cACTC,SAAU,WAUN,MATmB,CACf,2BACA,+BACA,4BACA,0BACA,8BACA,2BACA,4BAEgB7wD,KAAKqzD,QAE7BvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,mBACH8zC,GAAIoG,EAAWzC,UACf7/C,EAAGsiD,EAAWzC,UACd1D,GAAImG,EAAWzC,UACfzD,EAAGkG,EAAWzC,UACdxD,GAAIiG,EAAWzC,UACf17B,EAAG,MACHm4B,GAAIgG,EAAWzC,UACftD,EAAG,QACHC,GAAI8F,EAAWzC,UACfpD,EAAG,SACHC,GAAI4F,EAAWzC,WAEnBlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAjHyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAI2W,EAAa,CACbC,MAAO,CAEHrG,GAAI,CAAC,UAAW,UAAW,WAC3Bl8C,EAAG,CAAC,cAAe,gBACnBm8C,GAAI,CAAC,QAAS,SAAU,UACxBC,EAAG,CAAC,YAAa,eACjBC,GAAI,CAAC,MAAO,OAAQ,QACpBC,GAAI,CAAC,MAAO,OAAQ,QACpBE,GAAI,CAAC,QAAS,SAAU,UACxBE,GAAI,CAAC,SAAU,SAAU,WAE7B8F,uBAAwB,SAAU3F,EAAQ4F,GACtC,OAAkB,IAAX5F,EACD4F,EAAQ,GACR5F,GAAU,GAAKA,GAAU,EACzB4F,EAAQ,GACRA,EAAQ,IAElB5C,UAAW,SAAUhD,EAAQQ,EAAexsD,GACxC,IAAI4xD,EAAUH,EAAWC,MAAM1xD,GAC/B,OAAmB,IAAfA,EAAIuJ,OACGijD,EAAgBoF,EAAQ,GAAKA,EAAQ,GAGxC5F,EACA,IACAyF,EAAWE,uBAAuB3F,EAAQ4F,KAMjD9W,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,mFAAmFxsC,MACvF,KAEJysC,YAAa,2DAA2DzsC,MACpE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,wDAAwD1sC,MAC9D,KAEJ2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,cACHC,GAAI,gBACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,WACN,OAAQ3wD,KAAKqzD,OACT,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,qBACX,KAAK,EACD,MAAO,sBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,oBAGnBzC,QAAS,cACTC,SAAU,WAUN,MATmB,CACf,4BACA,gCACA,4BACA,0BACA,8BACA,2BACA,4BAEgB7wD,KAAKqzD,QAE7BvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN7zC,EAAG,mBACH8zC,GAAIoG,EAAWzC,UACf7/C,EAAGsiD,EAAWzC,UACd1D,GAAImG,EAAWzC,UACfzD,EAAGkG,EAAWzC,UACdxD,GAAIiG,EAAWzC,UACf17B,EAAG,MACHm4B,GAAIgG,EAAWzC,UACftD,EAAG,QACHC,GAAI8F,EAAWzC,UACfpD,EAAG,SACHC,GAAI4F,EAAWzC,WAEnBlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAnHyB9xD,CAAQ,EAAQ,2FCElD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,mHAAmHxsC,MACvH,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,sEAAsE1sC,MAC5E,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,mBACTC,QAAS,kBACTC,SAAU,gBACVC,QAAS,iBACTC,SAAU,8BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,iBACN7zC,EAAG,qBACH8zC,GAAI,cACJl8C,EAAG,SACHm8C,GAAI,aACJC,EAAG,SACHC,GAAI,aACJl4B,EAAG,UACHm4B,GAAI,cACJC,EAAG,UACHC,GAAI,cACJC,EAAG,UACHC,GAAI,eAER/B,cAAe,mCACfE,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACD,UACAA,EAAQ,GACR,QACAA,EAAQ,GACR,aAEA,WAGf6D,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,YAAb5C,EACO4C,EACa,UAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,eAAb5C,GAA0C,YAAbA,EACvB,IAAT4C,EACO,EAEJA,EAAO,QAJX,GAOXd,uBAAwB,UACxBC,QAAS,KACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAjFyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,wFAAwFxsC,MAC5F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,oDAAoD1sC,MAAM,KACpE2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,0BACLC,KAAM,+BACNwE,IAAK,mBACLC,KAAM,wBAEVxE,SAAU,CACNC,QAAS,YACTC,QAAS,eACTE,QAAS,YACTD,SAAU,eACVE,SAAU,iBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,eACN7zC,EAAG,iBACH8zC,GAAI,cACJl8C,EAAG,WACHm8C,GAAI,aACJC,EAAG,WACHC,GAAI,YACJl4B,EAAG,SACHm4B,GAAI,WACJC,EAAG,WACHC,GAAI,aACJC,EAAG,SACHC,GAAI,SAERC,uBAAwB,mBACxBC,QAAS,SAAUC,GACf,IAAIjzC,EAAIizC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANjzC,GAEM,IAANA,EADA,KAIA,OAIlBkzC,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,sFAAsFxsC,MAC1F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,8DAA8D1sC,MACpE,KAEJ2sC,cAAe,kCAAkC3sC,MAAM,KACvD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,UACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,iBACTC,SAAU,8BACVC,QAAS,YACTC,SAAU,kCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,aACRC,KAAM,WACN7zC,EAAG,aACH8zC,GAAI,aACJl8C,EAAG,cACHm8C,GAAI,YACJC,EAAG,aACHC,GAAI,WACJl4B,EAAG,YACHm4B,GAAI,UACJC,EAAG,cACHC,GAAI,WACJC,EAAG,cACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KApDyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAIiS,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJnS,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,0FAA0FxsC,MAC9F,KAEJysC,YAAa,0FAA0FzsC,MACnG,KAEJ0sC,SAAU,8FAA8F1sC,MACpG,KAEJ2sC,cAAe,mDAAmD3sC,MAC9D,KAEJ4sC,YAAa,sBAAsB5sC,MAAM,KACzCmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,aACTC,QAAS,YACTC,SAAU,WACVC,QAAS,cACTC,SAAU,yBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,UACN7zC,EAAG,oBACH8zC,GAAI,eACJl8C,EAAG,cACHm8C,GAAI,gBACJC,EAAG,gBACHC,GAAI,eACJl4B,EAAG,WACHm4B,GAAI,aACJC,EAAG,YACHC,GAAI,cACJC,EAAG,aACHC,GAAI,eAERC,uBAAwB,aACxBC,QAAS,SAAUC,GACf,OAAOA,EAAS,OAEpBgB,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO82C,EAAU92C,OAGzB22C,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO42C,EAAU52C,OAIzB2zC,cAAe,wCACfE,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,SACAA,EAAO,EACP,SACAA,EAAO,GACP,QACAA,EAAO,GACP,WACAA,EAAO,GACP,WACAA,EAAO,GACP,QAEA,UAGfkB,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,UAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,UAAb5C,GAAqC,SAAbA,GAEX,YAAbA,GACA4C,GAAQ,GAFRA,EAIAA,EAAO,IAGtBX,KAAM,CACFC,IAAK,EACLC,IAAK,KA/HyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,wFAAwFxsC,MAC5F,KAEJysC,YAAa,mEAAmEzsC,MAC5E,KAEJ+wC,kBAAkB,EAClBrE,SAAU,8DAA8D1sC,MACpE,KAEJ2sC,cAAe,kCAAkC3sC,MAAM,KACvD4sC,YAAa,qBAAqB5sC,MAAM,KACxCmtC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,sBACLC,KAAM,6BAEVC,SAAU,CACNC,QAAS,YACTC,QAAS,YACTC,SAAU,WACVC,QAAS,aACTC,SAAU,gBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,YACN7zC,EAAG,iBACH8zC,GAAI,aACJl8C,EAAG,YACHm8C,GAAI,cACJC,EAAG,SACHC,GAAI,WACJl4B,EAAG,UACHm4B,GAAI,YACJC,EAAG,SACHC,GAAI,WACJC,EAAG,cACHC,GAAI,iBAERC,uBAAwB,WACxBC,QAAS,MACTjC,cAAe,iCACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,WAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,SAAb5C,EACA4C,EACa,cAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,aAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,SACAA,EAAO,GACP,OACAA,EAAO,GACP,YACAA,EAAO,GACP,WAEA,UAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KApFyB9xD,CAAQ,EAAQ,4FCKlD,SAAWygD,GAAU,aAIfA,EAAO0O,aAAa,MAAO,CACjCC,OAAQ,0FAA0FxsC,MAC9F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,kDAAkD1sC,MAAM,KAClE2sC,cAAe,iCAAiC3sC,MAAM,KACtD4sC,YAAa,yBAAyB5sC,MAAM,KAC5CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,gBACTC,SAAU,gBACVC,QAAS,oBACTC,SAAU,+BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,WACN7zC,EAAG,gBACH8zC,GAAI,aACJl8C,EAAG,aACHm8C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJl4B,EAAG,YACHm4B,GAAI,WACJC,EAAG,YACHC,GAAI,WACJC,EAAG,YACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAIjzC,EAAIizC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANjzC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBkzC,KAAM,CACFC,IAAK,EACLC,IAAK,KAhEyB9xD,CAAQ,EAAQ,2FCClD,SAAWygD,GAAU,aAIzB,IAAIoS,EAAW,CACX,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,IAAK,OAGApS,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,CACJ1nC,OAAQ,qFAAqF9E,MACzF,KAEJqwC,WAAY,yEAAyErwC,MACjF,MAGRysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,yDAAyD1sC,MAC/D,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,mBACTC,QAAS,mBACTE,QAAS,mBACTD,SAAU,kCACVE,SAAU,oCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,SACN7zC,EAAG,eACHpI,EAAG,YACHm8C,GAAI,YACJC,EAAG,UACHC,GAAI,UACJl4B,EAAG,SACHm4B,GAAI,SACJC,EAAG,SACHC,GAAI,SACJC,EAAG,SACHC,GAAI,UAER/B,cAAe,qBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,QAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,SAAb5C,EACA4C,EACa,QAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,UAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,MACAA,EAAO,GACP,OACAA,EAAO,GACP,MACAA,EAAO,GACP,QAEA,OAGfd,uBAAwB,kBACxBC,QAAS,SAAUC,GAGf,OAAOA,GAAUkB,EAASlB,IAAWkB,EAF7BlB,EAAS,KAEmCkB,EAD5ClB,GAAU,IAAM,IAAM,QAGlCC,KAAM,CACFC,IAAK,EACLC,IAAK,KAlHyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,oGAAoGxsC,MACxG,KAEJysC,YAAa,iEAAiEzsC,MAC1E,KAEJ+wC,kBAAkB,EAClBrE,SAAU,iDAAiD1sC,MAAM,KACjE2sC,cAAe,8CAA8C3sC,MAAM,KACnE4sC,YAAa,yBAAyB5sC,MAAM,KAC5C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,cACJC,IAAK,wBACLC,KAAM,oCAEVZ,cAAe,wBACfC,KAAM,SAAUh9C,GACZ,MAAiB,eAAVA,GAEXi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,aAEA,cAGfjC,SAAU,CACNC,QAAS,mBACTC,QAAS,qBACTC,SAAU,qBACVC,QAAS,wBACTC,SAAU,6BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,YACN7zC,EAAG,eACH8zC,GAAI,YACJl8C,EAAG,SACHm8C,GAAI,UACJC,EAAG,YACHC,GAAI,aACJl4B,EAAG,QACHm4B,GAAI,SACJiC,EAAG,YACHC,GAAI,aACJjC,EAAG,UACHC,GAAI,WACJC,EAAG,OACHC,GAAI,WA9D0BxxD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAIoS,EAAW,CACX,EAAG,QACH,EAAG,QACH,EAAG,QACH,GAAI,QACJ,GAAI,QACJ,EAAG,OACH,EAAG,OACH,GAAI,OACJ,GAAI,OACJ,EAAG,QACH,EAAG,QACH,IAAK,QACL,EAAG,OACH,EAAG,QACH,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,SAGCpS,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,+EAA+ExsC,MACnF,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,wDAAwD1sC,MAC9D,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,mBACTC,QAAS,mBACTC,SAAU,2BACVC,QAAS,YACTC,SAAU,0BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,QACN7zC,EAAG,iBACHpI,EAAG,YACHm8C,GAAI,WACJC,EAAG,YACHC,GAAI,WACJl4B,EAAG,UACHm4B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,UACHC,GAAI,UAERE,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,KACL,IAAK,KACD,OAAOzB,EACX,QACI,GAAe,IAAXA,EAEA,OAAOA,EAAS,QAEpB,IAAIp0C,EAAIo0C,EAAS,GAGjB,OAAOA,GAAUkB,EAASt1C,IAAMs1C,EAFvBlB,EAAS,IAAOp0C,IAEsBs1C,EADvClB,GAAU,IAAM,IAAM,SAI1CC,KAAM,CACFC,IAAK,EACLC,IAAK,KAzFyB9xD,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,0FAA0FxsC,MAC9F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,yDAAyD1sC,MAC/D,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,wBAAwB5sC,MAAM,KAC3CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,YACHC,GAAI,eACJC,IAAK,qBACLC,KAAM,6BAEVC,SAAU,CACNC,QAAS,oBACTC,QAAS,gBACTC,SAAU,0BACVC,QAAS,eACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,gBACRC,KAAM,mBACN7zC,EAAG,gBACH8zC,GAAI,aACJl8C,EAAG,eACHm8C,GAAI,YACJC,EAAG,aACHC,GAAI,UACJl4B,EAAG,aACHm4B,GAAI,UACJC,EAAG,cACHC,GAAI,WACJC,EAAG,aACHC,GAAI,WAERC,uBAAwB,UACxBC,QAAS,SAAUC,GACf,OAAOA,GAEXC,KAAM,CACFC,IAAK,EACLC,IAAK,KAvDyB9xD,CAAQ,EAAQ,4FCGlD,SAAWygD,GAAU,aAIzB,IAAIoX,EAAe,iDAAiDj1C,MAAM,KA4B1E,SAAS+xC,EAAUhD,EAAQQ,EAAe9sD,EAAQ+sD,GAC9C,IAAI0F,EAiBR,SAAsBnG,GAClB,IAAIoG,EAAUn2C,KAAKo2C,MAAOrG,EAAS,IAAQ,KACvCsG,EAAMr2C,KAAKo2C,MAAOrG,EAAS,IAAO,IAClCuG,EAAMvG,EAAS,GACfwG,EAAO,GAUX,OATIJ,EAAU,IACVI,GAAQN,EAAaE,GAAW,SAEhCE,EAAM,IACNE,IAAkB,KAATA,EAAc,IAAM,IAAMN,EAAaI,GAAO,OAEvDC,EAAM,IACNC,IAAkB,KAATA,EAAc,IAAM,IAAMN,EAAaK,IAEpC,KAATC,EAAc,OAASA,EA/BbC,CAAazG,GAC9B,OAAQtsD,GACJ,IAAK,KACD,OAAOyyD,EAAa,OACxB,IAAK,KACD,OAAOA,EAAa,OACxB,IAAK,KACD,OAAOA,EAAa,OACxB,IAAK,KACD,OAAOA,EAAa,OACxB,IAAK,KACD,OAAOA,EAAa,OACxB,IAAK,KACD,OAAOA,EAAa,QAqBtBrX,EAAO0O,aAAa,MAAO,CACjCC,OAAQ,kMAAkMxsC,MACtM,KAEJysC,YAAa,0HAA0HzsC,MACnI,KAEJ+wC,kBAAkB,EAClBrE,SAAU,2DAA2D1sC,MACjE,KAEJ2sC,cAAe,2DAA2D3sC,MACtE,KAEJ4sC,YAAa,2DAA2D5sC,MACpE,KAEJmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,cACTC,SAAU,MACVC,QAAS,cACTC,SAAU,MACVC,SAAU,KAEdC,aAAc,CACVC,OA/FR,SAAyBiE,GACrB,IAAIsD,EAAOtD,EASX,OAP+B,IAA3BA,EAAO/mD,QAAQ,OACTqqD,EAAKz2D,MAAM,GAAI,GAAK,OACO,IAA3BmzD,EAAO/mD,QAAQ,OACfqqD,EAAKz2D,MAAM,GAAI,GAAK,OACO,IAA3BmzD,EAAO/mD,QAAQ,OACfqqD,EAAKz2D,MAAM,GAAI,GAAK,MACpBy2D,EAAO,QAuFbtH,KAnFR,SAAuBgE,GACnB,IAAIsD,EAAOtD,EASX,OAP+B,IAA3BA,EAAO/mD,QAAQ,OACTqqD,EAAKz2D,MAAM,GAAI,GAAK,OACO,IAA3BmzD,EAAO/mD,QAAQ,OACfqqD,EAAKz2D,MAAM,GAAI,GAAK,OACO,IAA3BmzD,EAAO/mD,QAAQ,OACfqqD,EAAKz2D,MAAM,GAAI,GAAK,MACpBy2D,EAAO,QA2Ebn7C,EAAG,UACH8zC,GAAI2D,EACJ7/C,EAAG,UACHm8C,GAAI0D,EACJzD,EAAG,UACHC,GAAIwD,EACJ17B,EAAG,UACHm4B,GAAIuD,EACJtD,EAAG,UACHC,GAAIqD,EACJpD,EAAG,UACHC,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA3HyB9xD,CAAQ,EAAQ,2FCIlD,SAAWygD,GAAU,aAIzB,IAAIoS,EAAW,CACX,EAAG,QACH,EAAG,QACH,EAAG,QACH,GAAI,QACJ,GAAI,QACJ,EAAG,OACH,EAAG,OACH,GAAI,OACJ,GAAI,OACJ,EAAG,QACH,EAAG,QACH,IAAK,QACL,EAAG,OACH,EAAG,QACH,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,SAGCpS,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,6EAA6ExsC,MACjF,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,wDAAwD1sC,MAC9D,KAEJ2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1C+sC,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,KAAO,KAEjBA,EAAU,KAAO,MAGhCL,cAAe,cACfC,KAAM,SAAUh9C,GACZ,MAAiB,OAAVA,GAA4B,OAAVA,GAE7Bq9C,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,kBACTC,SAAU,2BACVC,QAAS,WACTC,SAAU,yBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,UACN7zC,EAAG,gBACH8zC,GAAI,YACJl8C,EAAG,aACHm8C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJl4B,EAAG,UACHm4B,GAAI,SACJiC,EAAG,YACHC,GAAI,WACJjC,EAAG,SACHC,GAAI,QACJC,EAAG,UACHC,GAAI,UAERE,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,KACL,IAAK,KACD,OAAOzB,EACX,QACI,GAAe,IAAXA,EAEA,OAAOA,EAAS,QAEpB,IAAIp0C,EAAIo0C,EAAS,GAGjB,OAAOA,GAAUkB,EAASt1C,IAAMs1C,EAFvBlB,EAAS,IAAOp0C,IAEsBs1C,EADvClB,GAAU,IAAM,IAAM,SAI1CC,KAAM,CACFC,IAAK,EACLC,IAAK,KAvGyB9xD,CAAQ,EAAQ,4FCGlD,SAAWygD,GAAU,aAiEzB,SAASwU,EAAoBtD,EAAQQ,EAAexsD,EAAKysD,GACrD,IAAI1qC,EAAS,CACTxK,EAAG,CAAC,kBAAmB,mBACvB8zC,GAAI,CAACW,EAAS,WAAiBA,EAAS,YACxC78C,EAAG,CAAC,UAAW,cACfm8C,GAAI,CAACU,EAAS,SAAeA,EAAS,UACtCT,EAAG,CAAC,UAAW,eACfC,GAAI,CAACQ,EAAS,SAAeA,EAAS,UACtC14B,EAAG,CAAC,UAAW,eACfm4B,GAAI,CAACO,EAAS,SAAeA,EAAS,UACtCN,EAAG,CAAC,SAAU,aACdC,GAAI,CAACK,EAAS,SAAeA,EAAS,UACtCJ,EAAG,CAAC,QAAS,YACbC,GAAI,CAACG,EAAS,OAAaA,EAAS,SAExC,OAAOS,GAEDD,EADAzqC,EAAO/hB,GAAK,GAGZ+hB,EAAO/hB,GAAK,GA9EZ86C,EAAO0O,aAAa,MAAO,CACjCC,OAAQ,sFAAsFxsC,MAC1F,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,sDAAsD1sC,MAAM,KACtE2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,8BACLC,KAAM,0CAEVZ,cAAe,aACfC,KAAM,SAAUh9C,GACZ,MAAO,QAAUA,EAAMsU,eAE3B2oC,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,MAAQ,MAElBA,EAAU,MAAQ,OAGjCQ,SAAU,CACNC,QAAS,cACTC,QAAS,cACTC,SAAU,cACVC,QAAS,eACTC,SAAU,8BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,OACN7zC,EAAG+3C,EACHjE,GAAIiE,EACJngD,EAAGmgD,EACHhE,GAAIgE,EACJ/D,EAAG+D,EACH9D,GAAI8D,EACJh8B,EAAGg8B,EACH7D,GAAI6D,EACJ5D,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAhEyB9xD,CAAQ,EAAQ,iGCElD,SAAWygD,GAAU,aAIXA,EAAO0O,aAAa,WAAY,CAC1CC,OAAQ,wFAAwFxsC,MAC5F,KAEJysC,YAAa,wFAAwFzsC,MACjG,KAEJ0sC,SAAU,kDAAkD1sC,MAAM,KAClE2sC,cAAe,kDAAkD3sC,MAAM,KACvE4sC,YAAa,kDAAkD5sC,MAAM,KACrEmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,cACTC,SAAU,cACVC,QAAS,gBACTC,SAAU,cACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,iBACRC,KAAM,SACN7zC,EAAG,OACH8zC,GAAI,UACJl8C,EAAG,QACHm8C,GAAI,WACJC,EAAG,OACHC,GAAI,cACJl4B,EAAG,MACHm4B,GAAI,WACJC,EAAG,QACHC,GAAI,YACJC,EAAG,QACHC,GAAI,aAERI,KAAM,CACFC,IAAK,EACLC,IAAK,MAnDyB9xD,CAAQ,EAAQ,4FCGlD,SAAWygD,GAAU,aAIfA,EAAO0O,aAAa,MAAO,CACjCC,OAAQ,kFAAkFxsC,MACtF,KAEJysC,YAAa,kFAAkFzsC,MAC3F,KAEJ0sC,SAAU,kDAAkD1sC,MAAM,KAClE2sC,cAAe,kDAAkD3sC,MAAM,KACvE4sC,YAAa,kDAAkD5sC,MAAM,KACrEmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,cACTC,SAAU,cACVC,QAAS,eACTC,SAAU,cACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,gBACRC,KAAM,SACN7zC,EAAG,OACH8zC,GAAI,UACJl8C,EAAG,QACHm8C,GAAI,WACJC,EAAG,OACHC,GAAI,cACJl4B,EAAG,MACHm4B,GAAI,WACJC,EAAG,QACHC,GAAI,YACJC,EAAG,QACHC,GAAI,aAERI,KAAM,CACFC,IAAK,EACLC,IAAK,MAnDyB9xD,CAAQ,EAAQ,8FCGlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,sFAAsFxsC,MAC1F,KAEJysC,YAAa,sFAAsFzsC,MAC/F,KAEJ0sC,SAAU,yDAAyD1sC,MAC/D,KAEJ2sC,cAAe,uBAAuB3sC,MAAM,KAC5C4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,0BACJC,IAAK,iCACLC,KAAM,wCAEVZ,cAAe,qDACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAGM,eAAb5C,GACa,UAAbA,GACa,iBAAbA,EAEO4C,EACa,iBAAb5C,GAA4C,QAAbA,EAC/B4C,EAAO,GAEPA,GAAQ,GAAKA,EAAOA,EAAO,IAG1C5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,IAAIwI,EAAY,IAAP/F,EAAaC,EACtB,OAAI8F,EAAK,IACE,aACAA,EAAK,IACL,QACAA,EAAK,KACL,eACAA,EAAK,KACL,MACAA,EAAK,KACL,eAEA,OAGfhI,SAAU,CACNC,QAAS,mBACTC,QAAS,kBACTC,SAAU,4BACVC,QAAS,eACTC,SAAU,6BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,WACN7zC,EAAG,eACH8zC,GAAI,YACJl8C,EAAG,YACHm8C,GAAI,WACJC,EAAG,YACHC,GAAI,WACJl4B,EAAG,UACHm4B,GAAI,SACJC,EAAG,UACHC,GAAI,SACJC,EAAG,UACHC,GAAI,UAGRC,uBAAwB,6BACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,QACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,SACpB,QACI,OAAOA,IAGnBgB,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC49C,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC+8C,KAAM,CAEFC,IAAK,EACLC,IAAK,KA5GyB9xD,CAAQ,EAAQ,2FCIlD,SAAWygD,GAAU,aAYzB,SAASqS,EAAuBnB,EAAQQ,EAAexsD,GASnD,MAAY,MAARA,EACOwsD,EAAgB,UAAY,UACpB,MAARxsD,EACAwsD,EAAgB,SAAW,SAE3BR,EAAS,KAtBFoB,GAsB6BpB,EArB3CqB,EAQS,CACThC,GAAImB,EAAgB,yBAA2B,yBAC/ClB,GAAIkB,EAAgB,yBAA2B,yBAC/ChB,GAAIgB,EAAgB,sBAAwB,sBAC5Cf,GAAI,gBACJE,GAAI,wBACJE,GAAI,kBAOgC7rD,GArBvBid,MAAM,KAChBmwC,EAAM,IAAO,GAAKA,EAAM,KAAQ,GACjCC,EAAM,GACND,EAAM,IAAM,GAAKA,EAAM,IAAM,IAAMA,EAAM,IAAM,IAAMA,EAAM,KAAO,IAClEC,EAAM,GACNA,EAAM,IANhB,IAAsBD,EACdC,EAsDR,SAASuF,EAAqBznD,GAC1B,OAAO,WACH,OAAOA,EAAM,KAAwB,KAAjBhR,KAAK8vD,QAAiB,IAAM,IAAM,QAIrDnP,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,CACJ1nC,OAAQ,yFAAyF9E,MAC7F,KAEJqwC,WAAY,iGAAiGrwC,MACzG,MAGRysC,YAAa,yDAAyDzsC,MAClE,KAEJ0sC,SAhDJ,SAA6Bx6C,EAAG4S,GAC5B,IAAI4nC,EAAW,CACPkJ,WAAY,0DAA0D51C,MAClE,KAEJ61C,WAAY,0DAA0D71C,MAClE,KAEJ81C,SAAU,4DAA4D91C,MAClE,MAKZ,OAAU,IAAN9N,EACOw6C,EAAqB,WACvB1tD,MAAM,EAAG,GACTM,OAAOotD,EAAqB,WAAE1tD,MAAM,EAAG,IAE3CkT,EASEw6C,EALI,qBAAqBrsC,KAAKyE,GAC/B,aACA,sCAAsCzE,KAAKyE,GAC3C,WACA,cACoB5S,EAAEq+C,OARjB7D,EAAqB,YA6BhCC,cAAe,uBAAuB3sC,MAAM,KAC5C4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,iBACJC,IAAK,wBACLC,KAAM,+BAEVC,SAAU,CACNC,QAASgI,EAAqB,cAC9B/H,QAAS+H,EAAqB,YAC9B7H,QAAS6H,EAAqB,WAC9B9H,SAAU8H,EAAqB,cAC/B5H,SAAU,WACN,OAAQ7wD,KAAKqzD,OACT,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,OAAOoF,EAAqB,oBAAoB12D,KAAK/B,MACzD,KAAK,EACL,KAAK,EACL,KAAK,EACD,OAAOy4D,EAAqB,qBAAqB12D,KAAK/B,QAGlE8wD,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN7zC,EAAG,kBACH8zC,GAAI8B,EACJh+C,EAAGg+C,EACH7B,GAAI6B,EACJ5B,EAAG,SACHC,GAAI2B,EACJ75B,EAAG,OACHm4B,GAAI0B,EACJzB,EAAG,SACHC,GAAIwB,EACJvB,EAAG,MACHC,GAAIsB,GAGRrD,cAAe,wBACfC,KAAM,SAAUh9C,GACZ,MAAO,iBAAiBuQ,KAAKvQ,IAEjCi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,QACAA,EAAO,GACP,MAEA,UAGfd,uBAAwB,iBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACL,IAAK,IACD,OAAOzB,EAAS,KACpB,IAAK,IACD,OAAOA,EAAS,MACpB,QACI,OAAOA,IAGnBC,KAAM,CACFC,IAAK,EACLC,IAAK,KAhKyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIzB,IAAI2O,EAAS,CACL,QACA,QACA,OACA,QACA,MACA,MACA,SACA,OACA,QACA,SACA,QACA,SAEJwI,EAAO,CAAC,QAAS,MAAO,OAAQ,MAAO,SAAU,OAAQ,QAEpDnX,EAAO0O,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaD,EACbE,SAAUsI,EACVrI,cAAeqI,EACfpI,YAAaoI,EACb7H,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVZ,cAAe,UACfC,KAAM,SAAUh9C,GACZ,MAAO,QAAUA,GAErBi9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,MAEJ,OAEXjC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,iBACVC,QAAS,sBACTC,SAAU,yBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN7zC,EAAG,YACH8zC,GAAI,WACJl8C,EAAG,UACHm8C,GAAI,SACJC,EAAG,YACHC,GAAI,WACJl4B,EAAG,SACHm4B,GAAI,QACJC,EAAG,UACHC,GAAI,SACJC,EAAG,UACHC,GAAI,UAERmB,SAAU,SAAUttD,GAChB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC49C,WAAY,SAAUptD,GAClB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC+8C,KAAM,CACFC,IAAK,EACLC,IAAK,KA/EyB9xD,CAAQ,EAAQ,gGCElD,SAAWygD,GAAU,aAIZA,EAAO0O,aAAa,UAAW,CACxCC,OAAQ,6EAA6ExsC,MACjF,KAEJysC,YAAa,oDAAoDzsC,MAAM,KACvE0sC,SAAU,+DAA+D1sC,MACrE,KAEJ2sC,cAAe,kCAAkC3sC,MAAM,KACvD4sC,YAAa,yBAAyB5sC,MAAM,KAC5CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,uBACTC,QAAS,mBACTC,SAAU,2BACVC,QAAS,uBACTC,SAAU,oCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,kBACRC,KAAM,qBACN7zC,EAAG,SACH8zC,GAAI,YACJl8C,EAAG,aACHm8C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJl4B,EAAG,UACHm4B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,UACHC,GAAI,UAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAnDyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,yEAAyExsC,MAC7E,KAEJysC,YAAa,kDAAkDzsC,MAAM,KACrE0sC,SAAU,uDAAuD1sC,MAAM,KACvE2sC,cAAe,8BAA8B3sC,MAAM,KACnD4sC,YAAa,uBAAuB5sC,MAAM,KAC1CmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,uBACTC,QAAS,mBACTC,SAAU,2BACVC,QAAS,sBACTC,SAAU,mCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,gBACRC,KAAM,oBACN7zC,EAAG,SACH8zC,GAAI,YACJl8C,EAAG,aACHm8C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJl4B,EAAG,UACHm4B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,UACHC,GAAI,UAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAjDyB9xD,CAAQ,EAAQ,2FCIlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,qGAAqGxsC,MACzG,KAEJysC,YAAa,sFAAsFzsC,MAC/F,KAEJ+wC,kBAAkB,EAClBrE,SAAU,yDAAyD1sC,MAC/D,KAEJ2sC,cAAe,uBAAuB3sC,MAAM,KAC5C4sC,YAAa,uBAAuB5sC,MAAM,KAC1C0vC,oBAAoB,EACpB7C,cAAe,SACfC,KAAM,SAAUh9C,GACZ,MAAO,QAAQuQ,KAAKvQ,IAExBi9C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,KAAO,KAEjBA,EAAU,KAAO,MAGhCC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,oBACJC,IAAK,0BACLC,KAAM,gCACN99B,EAAG,YACHqiC,GAAI,aACJC,IAAK,mBACLC,KAAM,yBAEVxE,SAAU,CACNC,QAAS,mBACTC,QAAS,oBACTC,SAAU,yBACVC,QAAS,mBACTC,SAAU,2BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,WACN7zC,EAAG,WACH8zC,GAAI,UACJl8C,EAAG,WACHm8C,GAAI,UACJC,EAAG,UACHC,GAAI,SACJl4B,EAAG,WACHm4B,GAAI,UACJiC,EAAG,WACHC,GAAI,UACJjC,EAAG,YACHC,GAAI,WACJC,EAAG,UACHC,GAAI,UAERC,uBAAwB,UACxBC,QAAS,SAAUC,GACf,OAAOA,GAEXC,KAAM,CACFC,IAAK,EACLC,IAAK,KA5EyB9xD,CAAQ,EAAQ,iGCElD,SAAWygD,GAAU,aAIXA,EAAO0O,aAAa,WAAY,CAC1CC,OAAQ,6GAA6GxsC,MACjH,KAEJysC,YAAa,8DAA8DzsC,MACvE,KAEJ+wC,kBAAkB,EAClBrE,SAAU,yEAAyE1sC,MAC/E,KAEJ2sC,cAAe,qCAAqC3sC,MAAM,KAC1D4sC,YAAa,4BAA4B5sC,MAAM,KAC/C0vC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJE,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,sBACTC,SAAU,eACVC,QAAS,uBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,UACN7zC,EAAG,mBACH8zC,GAAI,eACJl8C,EAAG,aACHm8C,GAAI,eACJC,EAAG,YACHC,GAAI,YACJl4B,EAAG,SACHm4B,GAAI,WACJC,EAAG,YACHC,GAAI,cACJC,EAAG,UACHC,GAAI,aAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAIjzC,EAAIizC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANjzC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBkzC,KAAM,CACFC,IAAK,EACLC,IAAK,KArEyB9xD,CAAQ,EAAQ,2FCGlD,SAAWygD,GAAU,aAIhBA,EAAO0O,aAAa,KAAM,CAC/BC,OAAQ,0FAA0FxsC,MAC9F,KAEJysC,YAAa,gEAAgEzsC,MAAM,KACnF0sC,SAAU,uDAAuD1sC,MAAM,KACvE2sC,cAAe,sCAAsC3sC,MAAM,KAC3D4sC,YAAa,2BAA2B5sC,MAAM,KAC9CmtC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,eACTC,SAAU,8BACVC,QAAS,eACTC,SAAU,6BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,WACN7zC,EAAG,oBACH8zC,GAAI,WACJl8C,EAAG,cACHm8C,GAAI,aACJC,EAAG,cACHC,GAAI,aACJl4B,EAAG,WACHm4B,GAAI,UACJC,EAAG,WACHC,GAAI,UACJC,EAAG,YACHC,GAAI,YAERC,uBAAwB,gBACxBC,QAAS,UACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAnDyB9xD,CAAQ,EAAQ,8FCKlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,wCAAwCxsC,MAC5C,KAEJysC,YAAa,yCAAyCzsC,MAClD,KAEJ0sC,SAAU,8BAA8B1sC,MAAM,KAC9C2sC,cAAe,uBAAuB3sC,MAAM,KAC5C4sC,YAAa,gBAAgB5sC,MAAM,KACnCmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,YACJC,IAAK,kBACLC,KAAM,sBACN99B,EAAG,WACHqiC,GAAI,YACJC,IAAK,kBACLC,KAAM,uBAEVrF,cAAe,oBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,OAAb5C,GAAkC,OAAbA,GAAkC,OAAbA,EACnC4C,EACa,OAAb5C,GAAkC,OAAbA,EACrB4C,EAAO,GAGPA,GAAQ,GAAKA,EAAOA,EAAO,IAG1C5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,IAAIwI,EAAY,IAAP/F,EAAaC,EACtB,OAAI8F,EAAK,IACE,KACAA,EAAK,IACL,KACAA,EAAK,KACL,KACAA,EAAK,KACL,KACAA,EAAK,KACL,KAEA,MAGfhI,SAAU,CACNC,QAAS,SACTC,QAAS,SACTC,SAAU,SAAUkG,GAChB,OAAIA,EAAI/E,SAAW9xD,KAAK8xD,OACb,WAEA,YAGflB,QAAS,SACTC,SAAU,SAAUgG,GAChB,OAAI72D,KAAK8xD,SAAW+E,EAAI/E,OACb,WAEA,YAGfhB,SAAU,KAEda,uBAAwB,iBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,IACpB,IAAK,IACD,OAAOA,EAAS,IACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,IACpB,QACI,OAAOA,IAGnBd,aAAc,CACVC,OAAQ,MACRC,KAAM,MACN7zC,EAAG,KACH8zC,GAAI,OACJl8C,EAAG,OACHm8C,GAAI,QACJC,EAAG,OACHC,GAAI,QACJl4B,EAAG,MACHm4B,GAAI,OACJiC,EAAG,MACHC,GAAI,OACJjC,EAAG,OACHC,GAAI,QACJC,EAAG,MACHC,GAAI,QAERI,KAAM,CAEFC,IAAK,EACLC,IAAK,KApHyB9xD,CAAQ,EAAQ,8FCIlD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,wCAAwCxsC,MAC5C,KAEJysC,YAAa,yCAAyCzsC,MAClD,KAEJ0sC,SAAU,8BAA8B1sC,MAAM,KAC9C2sC,cAAe,uBAAuB3sC,MAAM,KAC5C4sC,YAAa,gBAAgB5sC,MAAM,KACnCmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,YACJC,IAAK,kBACLC,KAAM,sBACN99B,EAAG,WACHqiC,GAAI,YACJC,IAAK,kBACLC,KAAM,uBAEVrF,cAAe,oBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,OAAb5C,GAAkC,OAAbA,GAAkC,OAAbA,EACnC4C,EACa,OAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,OAAb5C,GAAkC,OAAbA,EACrB4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,IAAIwI,EAAY,IAAP/F,EAAaC,EACtB,OAAI8F,EAAK,IACE,KACAA,EAAK,IACL,KACAA,EAAK,KACL,KACO,OAAPA,EACA,KACAA,EAAK,KACL,KAEA,MAGfhI,SAAU,CACNC,QAAS,SACTC,QAAS,SACTC,SAAU,YACVC,QAAS,SACTC,SAAU,YACVC,SAAU,KAEda,uBAAwB,iBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,IACpB,IAAK,IACD,OAAOA,EAAS,IACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,IACpB,QACI,OAAOA,IAGnBd,aAAc,CACVC,OAAQ,MACRC,KAAM,MACN7zC,EAAG,KACH8zC,GAAI,OACJl8C,EAAG,OACHm8C,GAAI,QACJC,EAAG,OACHC,GAAI,QACJl4B,EAAG,MACHm4B,GAAI,OACJC,EAAG,OACHC,GAAI,QACJC,EAAG,MACHC,GAAI,UAhG0BxxD,CAAQ,EAAQ,8FCElD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,wCAAwCxsC,MAC5C,KAEJysC,YAAa,yCAAyCzsC,MAClD,KAEJ0sC,SAAU,8BAA8B1sC,MAAM,KAC9C2sC,cAAe,uBAAuB3sC,MAAM,KAC5C4sC,YAAa,gBAAgB5sC,MAAM,KACnCmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,YACJC,IAAK,kBACLC,KAAM,sBACN99B,EAAG,WACHqiC,GAAI,YACJC,IAAK,kBACLC,KAAM,uBAEVrF,cAAe,oBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,OAAb5C,GAAkC,OAAbA,GAAkC,OAAbA,EACnC4C,EACa,OAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,OAAb5C,GAAkC,OAAbA,EACrB4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,IAAIwI,EAAY,IAAP/F,EAAaC,EACtB,OAAI8F,EAAK,IACE,KACAA,EAAK,IACL,KACAA,EAAK,KACL,KACAA,EAAK,KACL,KACAA,EAAK,KACL,KAEA,MAGfhI,SAAU,CACNC,QAAS,UACTC,QAAS,UACTC,SAAU,aACVC,QAAS,UACTC,SAAU,aACVC,SAAU,KAEda,uBAAwB,iBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,IACpB,IAAK,IACD,OAAOA,EAAS,IACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,IACpB,QACI,OAAOA,IAGnBd,aAAc,CACVC,OAAQ,MACRC,KAAM,MACN7zC,EAAG,KACH8zC,GAAI,OACJl8C,EAAG,OACHm8C,GAAI,QACJC,EAAG,OACHC,GAAI,QACJl4B,EAAG,MACHm4B,GAAI,OACJC,EAAG,OACHC,GAAI,QACJC,EAAG,MACHC,GAAI,UAhG0BxxD,CAAQ,EAAQ,8FCElD,SAAWygD,GAAU,aAIdA,EAAO0O,aAAa,QAAS,CACpCC,OAAQ,wCAAwCxsC,MAC5C,KAEJysC,YAAa,yCAAyCzsC,MAClD,KAEJ0sC,SAAU,8BAA8B1sC,MAAM,KAC9C2sC,cAAe,uBAAuB3sC,MAAM,KAC5C4sC,YAAa,gBAAgB5sC,MAAM,KACnCmtC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,YACJC,IAAK,kBACLC,KAAM,sBACN99B,EAAG,WACHqiC,GAAI,YACJC,IAAK,kBACLC,KAAM,uBAEVrF,cAAe,oBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,OAAb5C,GAAkC,OAAbA,GAAkC,OAAbA,EACnC4C,EACa,OAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,OAAb5C,GAAkC,OAAbA,EACrB4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,IAAIwI,EAAY,IAAP/F,EAAaC,EACtB,OAAI8F,EAAK,IACE,KACAA,EAAK,IACL,KACAA,EAAK,KACL,KACAA,EAAK,KACL,KACAA,EAAK,KACL,KAEA,MAGfhI,SAAU,CACNC,QAAS,UACTC,QAAS,UACTC,SAAU,aACVC,QAAS,UACTC,SAAU,aACVC,SAAU,KAEda,uBAAwB,iBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,IACpB,IAAK,IACD,OAAOA,EAAS,IACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,IACpB,QACI,OAAOA,IAGnBd,aAAc,CACVC,OAAQ,MACRC,KAAM,MACN7zC,EAAG,KACH8zC,GAAI,OACJl8C,EAAG,OACHm8C,GAAI,QACJC,EAAG,OACHC,GAAI,QACJl4B,EAAG,MACHm4B,GAAI,OACJC,EAAG,OACHC,GAAI,QACJC,EAAG,MACHC,GAAI,UAhG0BxxD,CAAQ,EAAQ,wGCP1D,IAAIyO,EAAM,CACT,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,QAAS,sCACT,WAAY,sCACZ,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,aAAc,2CACd,gBAAiB,2CACjB,aAAc,2CACd,gBAAiB,2CACjB,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,UAAW,wCACX,aAAc,wCACd,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,WAAY,yCACZ,cAAe,yCACf,UAAW,wCACX,aAAc,wCACd,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,YAAa,0CACb,eAAgB,0CAChB,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,QAAS,sCACT,WAAY,sCACZ,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,UAAW,wCACX,aAAc,wCACd,QAAS,sCACT,WAAY,sCACZ,OAAQ,qCACR,UAAW,qCACX,QAAS,sCACT,WAAY,sCACZ,QAAS,sCACT,aAAc,2CACd,gBAAiB,2CACjB,WAAY,sCACZ,UAAW,wCACX,aAAc,wCACd,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,YAAa,0CACb,eAAgB,0CAChB,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,aAAc,2CACd,gBAAiB,2CACjB,OAAQ,qCACR,UAAW,qCACX,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,yCAIf,SAASkqD,EAAeC,GACvB,IAAIztD,EAAK0tD,EAAsBD,GAC/B,OAAOE,EAAoB3tD,GAE5B,SAAS0tD,EAAsBD,GAC9B,IAAIE,EAAoBp0C,EAAEjW,EAAKmqD,GAAM,CACpC,IAAIx2C,EAAI,IAAI7P,MAAM,uBAAyBqmD,EAAM,KAEjD,MADAx2C,EAAE22C,KAAO,mBACH32C,EAEP,OAAO3T,EAAImqD,GAEZD,EAAerlD,KAAO,WACrB,OAAOD,OAAOC,KAAK7E,IAEpBkqD,EAAelsD,QAAUosD,EACzBj5D,EAAOsuD,QAAUyK,EACjBA,EAAextD,GAAK,8GClSnB,IAASoS,EAAAA,EAAqiI8I,OAAOF,SAAziIxmB,QAAQC,OAAO,eAAe,IAAI0E,MAAM,eAAe,CAAC00D,OAAM,IAAK3tD,OAAO,CAAC,mBAAmB,SAASkS,GAAG5d,QAAQ+M,UAAU6Q,EAAE07C,0BAA0B17C,EAAE07C,yBAAyB,sCAAsC17C,EAAE27C,2BAA2B,yCAAyCv5D,QAAQC,OAAO,mBAAmB,CAAC,mBAAmBD,QAAQC,OAAO,iBAAiB,IAAID,QAAQC,OAAO,QAAQ,CAAC,eAAe,iBAAiB,mBAAmB,eAAwEA,EAAOsuD,UAAUA,IAAUtuD,EAAOsuD,QAAQ,SAASvuD,QAAQC,OAAO,kBAAkB2X,QAAQ,MAAM,CAAC,KAAK,SAASgG,GAAG,IAAImB,EAAE,OAAaua,EAAE,CAAC,MAAM,KAAI,MAAM,KAAK,MAAM,KAAI,MAAM,KAAK,MAAM,MAAMn5B,KAAKq5D,eAAe,SAAS57C,EAAEmB,GAAG,MAAM,WAAWA,EAAE06C,YAAYt5D,KAAKu5D,QAAQ97C,GAAGA,EAAE+7C,iBAAiB,MAAM56C,EAAE06C,YAAYt5D,KAAKu5D,QAAQ97C,GAAGA,EAAE3I,WAAWC,QAAQ,IAAI6J,EAAE06C,YAAY,iBAAiB77C,GAAGA,EAAEA,EAAE1I,QAAQ,KAAK,OAAO6J,EAAE66C,cAAch8C,EAAEvP,QAAQ,MAAM,GAAGuP,EAAEvP,QAAQ,OAAO,GAAGuP,EAAEvP,QAAQ,OAAO,KAAKuP,EAAEmB,EAAE86C,SAASj8C,EAAEmB,EAAE86C,UAAUj8C,GAAG,kBAAkBA,EAAEA,EAAE,OAAO,QAAQA,GAAGzd,KAAKu5D,QAAQ,SAAS97C,GAAG,OAAOA,IAAIA,KAAKk8C,SAASl8C,IAAIwU,QAAQxU,EAAE,KAAKzd,KAAKke,UAAU,SAASib,EAAE7W,GAAG,IAAIiwC,EAAE90C,EAAExR,QAAQ4R,EAAE7d,KAAKoxD,EAAE,GAAG/zC,EAAE,GAAGK,EAAED,EAAExN,KAAKkpB,GAAGpuB,MAAK,SAAS0S,GAA6C,IAAI0b,EAAEzb,EAA7C7d,QAAQ+M,UAAU0V,EAAEs3C,SAASt3C,EAAEs3C,SAAgBzgC,EAAE,GAAGt5B,QAAQkB,QAAQuhB,EAAEs3C,QAAO,SAASn8C,GAAGzd,KAAKS,KAAKod,EAAEw7C,eAAe57C,EAAE6E,MAAK6W,GAAGzb,EAAEyb,EAAElmB,KAAKqP,EAAEu3C,SAASv3C,EAAEu3C,SAAS,KAAKx8C,GAAGK,EAAEkB,GAAE,IAAsI6T,EAAEzd,EAApIwI,EAAE,GAAM3d,QAAQmS,QAAQyL,GAAGD,EAAEC,EAAE5d,QAAQuN,WAAWqQ,KAAKD,EAAEC,KAAK5d,QAAQ+M,UAAU0V,EAAEwnC,QAAQxnC,EAAEwnC,OAAO,kBAAkBxnC,EAAEwnC,QAAer3B,EAAE,GAAG5yB,QAAQkB,QAAQyc,EAAE,IAAG,SAASC,EAAEmB,GAAG5e,KAAKS,KAAKod,EAAEw7C,eAAez6C,EAAE0D,MAAKmQ,GAAGzd,EAAEyd,EAAExf,KAAKqP,EAAEu3C,SAASv3C,EAAEu3C,SAAS,KAAKx8C,GAAGrI,EAAE4J,GAAE/e,QAAQkB,QAAQyc,GAAE,SAASC,EAAEq8C,GAAG,IAAI3gC,EAAEo5B,EAAEnB,EAAEvxD,QAAQoiB,KAAKzE,EAAEs8C,IAAIvH,EAAE,GAAG,IAAI70C,EAAE4E,EAAEy3C,YAAYz3C,EAAEy3C,YAAY3I,EAAEvxD,QAAQkB,QAAQ2c,GAAE,SAASD,GAAG,IAAImB,EAAE0D,EAAEy3C,YAAY3I,EAAE3zC,GAAGA,EAAEzd,KAAKS,KAAKod,EAAEw7C,eAAez6C,EAAE0D,MAAKiwC,GAAGp5B,EAAEo5B,EAAEt/C,KAAKqP,EAAEu3C,SAASv3C,EAAEu3C,SAAS,KAAKx8C,GAAGy8C,EAAEt8C,EAAEpO,OAAO+pB,EAAEva,EAAEua,KAAI7W,EAAE03C,qBAAqB5I,GAA9wC,UAAoxCA,GAAG/zC,EAAEk1C,EAAE5lD,QAAQykD,MAAK,MAAM,mBAAmB1zC,EAAS,OAAGA,EAAS,OAAE,SAASD,GAAG80C,EAAE3G,OAAOnuC,MAAK80C,EAAE9uD,SAASzD,KAAKi6D,cAAc,SAASx8C,GAAG,YAAO,IAAS0b,EAAE1b,IAAIzd,KAAKk6D,eAAe,SAASz8C,GAAG,OAAO0b,EAAE1b,OAAO5d,QAAQC,OAAO,oBAAoB+C,UAAU,QAAQ,CAAC,SAAS,KAAK,MAAM,YAAY,WAAW,SAAS+b,EAAEk7C,EAAE3gC,EAAE7W,EAAEiwC,GAAG,MAAM,CAACprD,SAAS,KAAKrE,MAAM,CAAC6E,KAAK,SAASwyD,SAAS,YAAYP,OAAO,aAAaG,YAAY,kBAAkBL,SAAS,iBAAiBJ,WAAW,oBAAoBG,aAAa,gBAAgBI,SAAS,kBAAkBztC,SAAS,YAAY4tC,mBAAmB,UAAU1f,QAAQ,IAAI8f,QAAQ,WAAWtQ,MAAM,aAAa9oD,WAAW,CAAC,SAAS,WAAW,SAAS,cAAc,SAASyc,EAAEmB,EAAE0D,GAAwe7E,EAAE48C,IAAI,GAAGx6D,QAAQ+M,UAAU6Q,EAAE2O,WAAW,QAAQ3O,EAAE2O,UAAUvsB,QAAQmS,QAAQyL,EAAE9V,OAAO8V,EAAElZ,OAAO,QAAO,WAAWkZ,EAAE68C,cAAY,GAAI78C,EAAE88C,YAAY,WAAW,OAAO98C,EAAE08C,UAAU,gBAAgB18C,EAAE68C,SAAS,WAAW,IAAIz8C,EAAEi8C,EAAE7tD,QAAQ,OAAO2S,EAAE47C,SAASl4C,EAAEm4C,mBAAmB,kBAAkBthC,EAAEjb,UAAUT,EAAE9V,OAAhxB,WAAa,IAAIiX,EAAE,CAAC86C,SAASj8C,EAAEi8C,SAASj8C,EAAEi8C,SAAS,IAAIJ,WAAW77C,EAAE67C,WAAW77C,EAAE67C,WAAW,IAAIG,aAAah8C,EAAEg8C,aAAaO,mBAAmBv8C,EAAEu8C,oBAAoB,OAAOn6D,QAAQ+M,UAAU0V,EAAEo4C,aAAa97C,EAAEg7C,OAAOn8C,EAAEpc,MAAMoc,EAAEm8C,SAAS/5D,QAAQ+M,UAAU0V,EAAEq4C,kBAAkB/7C,EAAEm7C,YAAYt8C,EAAEpc,MAAMoc,EAAEs8C,cAAcl6D,QAAQ+M,UAAU0V,EAAEs4C,YAAYh8C,EAAEkrC,MAAMrsC,EAAEpc,MAAMoc,EAAEqsC,QAAQlrC,EAAEi7C,SAASp8C,EAAEo8C,SAASp8C,EAAEo8C,SAAS,IAAIj7C,EAAEi7C,SAAS1gC,EAAE8gC,cAAcr7C,EAAEi7C,UAAU1gC,EAAE+gC,eAAet7C,EAAEi7C,UAAUj7C,EAAEi7C,SAASj7C,EAAoT2zC,IAAKxnD,MAAK,SAAS+uD,GAAGr8C,EAAE48C,IAAIP,EAAEl7C,EAAEi8C,YAAYv4C,EAAEm4C,mBAAmB,kBAAkB58C,EAAElR,QAAQmtD,MAAKr8C,EAAExZ,SAAS4Z,EAAEpa,WAAW8E,KAAK,SAASqW,EAAEk7C,GAA8bA,EAAEx2D,KAAK,SAAQ,WAAWsb,EAAE07C,WAAWvvD,MAAK,YAAve,WAAa,IAAI+uD,EAAEl7C,EAAEw7C,SAAS,QAAQjhC,EAAE,IAAIo1B,KAAK,CAAC3vC,EAAEy7C,KAAK,CAACnrD,KAAK,oBAAoB4qD,EAAE,MAAM,GAAGr8C,EAAEi+B,UAAUof,iBAAiBpf,UAAUqf,WAAW5hC,EAAEva,EAAE27C,mBAAmB,CAAC,IAAI18C,EAAEhe,QAAQkD,QAAQ,+CAA+CquD,EAAEvxD,QAAQkD,QAAQ8a,EAAEjV,WAAW,IAAIwoD,EAAEt+C,KAAK,OAAO2K,EAAEu9C,IAAIC,gBAAgB9hC,IAAIi4B,EAAEt+C,KAAK,WAAW8L,EAAE27C,eAAenJ,EAAEt+C,KAAK,SAAS,UAAUwP,EAAExB,KAAK,QAAQuZ,OAAOxc,GAAG00C,GAAE,WAAWnB,EAAE,GAAGnH,QAAQmH,EAAEvkD,WAAU,OAA8DssB,MAAMva,EAAE3a","sources":["webpack://motion-chat/./node_modules/@flowjs/ng-flow/dist/ng-flow.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/templateFactory.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/statebuilders/onEnterExitRetain.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/locationServices.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/services.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/common.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/coreservices.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/glob.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/hof.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/predicates.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/queue.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/safeConsole.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/strings.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/trace.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/globals.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/param.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/paramType.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/paramTypes.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/stateParams.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/path/pathNode.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/path/pathUtils.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/interface.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/router.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateObject.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/targetState.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/interface.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/coreResolvables.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/redirectTo.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/onEnterExitRetain.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/resolve.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/views.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/updateGlobals.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/url.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/ignoredTransition.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/invalidTransition.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRouter.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRule.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRules.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/utils.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/view/view.js","webpack://motion-chat/./node_modules/angular-aria/angular-aria.js","webpack://motion-chat/./node_modules/angular-rateit/dist/ng-rateit.js","webpack://motion-chat/./src/js/index.controller.js","webpack://motion-chat/./src/js/index.route.js","webpack://motion-chat/./src/js/closing/index.controller.js","webpack://motion-chat/./src/js/index.factory.js","webpack://motion-chat/./src/js/chat/index.controller.js","webpack://motion-chat/./src/js/offline/index.controller.js","webpack://motion-chat/./src/js/online/index.controller.js","webpack://motion-chat/./src/js/unmanaged/index.controller.js","webpack://motion-chat/./src/js/waiting/index.controller.js","webpack://motion-chat/./src/js/index.module.js","webpack://motion-chat/./node_modules/expose-loader/dist/runtime/getGlobalThis.js","webpack://motion-chat/./node_modules/json-form-data/src/jsonToFormData.js","webpack://motion-chat/./node_modules/moment/locale/af.js","webpack://motion-chat/./node_modules/moment/locale/ar-dz.js","webpack://motion-chat/./node_modules/moment/locale/ar-kw.js","webpack://motion-chat/./node_modules/moment/locale/ar-ly.js","webpack://motion-chat/./node_modules/moment/locale/ar-ma.js","webpack://motion-chat/./node_modules/moment/locale/ar-sa.js","webpack://motion-chat/./node_modules/moment/locale/ar-tn.js","webpack://motion-chat/./node_modules/moment/locale/ar.js","webpack://motion-chat/./node_modules/moment/locale/az.js","webpack://motion-chat/./node_modules/moment/locale/be.js","webpack://motion-chat/./node_modules/moment/locale/bg.js","webpack://motion-chat/./node_modules/moment/locale/bm.js","webpack://motion-chat/./node_modules/moment/locale/bn-bd.js","webpack://motion-chat/./node_modules/moment/locale/bn.js","webpack://motion-chat/./node_modules/moment/locale/bo.js","webpack://motion-chat/./node_modules/moment/locale/br.js","webpack://motion-chat/./node_modules/moment/locale/bs.js","webpack://motion-chat/./node_modules/moment/locale/ca.js","webpack://motion-chat/./node_modules/moment/locale/cs.js","webpack://motion-chat/./node_modules/moment/locale/cv.js","webpack://motion-chat/./node_modules/moment/locale/cy.js","webpack://motion-chat/./node_modules/moment/locale/da.js","webpack://motion-chat/./node_modules/moment/locale/de-at.js","webpack://motion-chat/./node_modules/moment/locale/de-ch.js","webpack://motion-chat/./node_modules/moment/locale/de.js","webpack://motion-chat/./node_modules/moment/locale/dv.js","webpack://motion-chat/./node_modules/moment/locale/el.js","webpack://motion-chat/./node_modules/moment/locale/en-au.js","webpack://motion-chat/./node_modules/moment/locale/en-ca.js","webpack://motion-chat/./node_modules/moment/locale/en-gb.js","webpack://motion-chat/./node_modules/moment/locale/en-ie.js","webpack://motion-chat/./node_modules/moment/locale/en-il.js","webpack://motion-chat/./node_modules/moment/locale/en-in.js","webpack://motion-chat/./node_modules/moment/locale/en-nz.js","webpack://motion-chat/./node_modules/moment/locale/en-sg.js","webpack://motion-chat/./node_modules/moment/locale/eo.js","webpack://motion-chat/./node_modules/moment/locale/es-do.js","webpack://motion-chat/./node_modules/moment/locale/es-mx.js","webpack://motion-chat/./node_modules/moment/locale/es-us.js","webpack://motion-chat/./node_modules/moment/locale/es.js","webpack://motion-chat/./node_modules/moment/locale/et.js","webpack://motion-chat/./node_modules/moment/locale/eu.js","webpack://motion-chat/./node_modules/moment/locale/fa.js","webpack://motion-chat/./node_modules/moment/locale/fi.js","webpack://motion-chat/./node_modules/moment/locale/fil.js","webpack://motion-chat/./node_modules/moment/locale/fo.js","webpack://motion-chat/./node_modules/moment/locale/fr-ca.js","webpack://motion-chat/./node_modules/moment/locale/fr-ch.js","webpack://motion-chat/./node_modules/moment/locale/fr.js","webpack://motion-chat/./node_modules/moment/locale/fy.js","webpack://motion-chat/./node_modules/moment/locale/ga.js","webpack://motion-chat/./node_modules/moment/locale/gd.js","webpack://motion-chat/./node_modules/moment/locale/gl.js","webpack://motion-chat/./node_modules/moment/locale/gom-deva.js","webpack://motion-chat/./node_modules/moment/locale/gom-latn.js","webpack://motion-chat/./node_modules/moment/locale/gu.js","webpack://motion-chat/./node_modules/moment/locale/he.js","webpack://motion-chat/./node_modules/moment/locale/hi.js","webpack://motion-chat/./node_modules/moment/locale/hr.js","webpack://motion-chat/./node_modules/moment/locale/hu.js","webpack://motion-chat/./node_modules/moment/locale/hy-am.js","webpack://motion-chat/./node_modules/moment/locale/id.js","webpack://motion-chat/./node_modules/moment/locale/is.js","webpack://motion-chat/./node_modules/moment/locale/it-ch.js","webpack://motion-chat/./node_modules/moment/locale/it.js","webpack://motion-chat/./node_modules/moment/locale/ja.js","webpack://motion-chat/./node_modules/moment/locale/jv.js","webpack://motion-chat/./node_modules/moment/locale/ka.js","webpack://motion-chat/./node_modules/moment/locale/kk.js","webpack://motion-chat/./node_modules/moment/locale/km.js","webpack://motion-chat/./node_modules/moment/locale/kn.js","webpack://motion-chat/./node_modules/moment/locale/ko.js","webpack://motion-chat/./node_modules/moment/locale/ku.js","webpack://motion-chat/./node_modules/moment/locale/ky.js","webpack://motion-chat/./node_modules/moment/locale/lb.js","webpack://motion-chat/./node_modules/moment/locale/lo.js","webpack://motion-chat/./node_modules/moment/locale/lt.js","webpack://motion-chat/./node_modules/moment/locale/lv.js","webpack://motion-chat/./node_modules/moment/locale/me.js","webpack://motion-chat/./node_modules/moment/locale/mi.js","webpack://motion-chat/./node_modules/moment/locale/mk.js","webpack://motion-chat/./node_modules/moment/locale/ml.js","webpack://motion-chat/./node_modules/moment/locale/mn.js","webpack://motion-chat/./node_modules/moment/locale/mr.js","webpack://motion-chat/./node_modules/moment/locale/ms-my.js","webpack://motion-chat/./node_modules/moment/locale/ms.js","webpack://motion-chat/./node_modules/moment/locale/mt.js","webpack://motion-chat/./node_modules/moment/locale/my.js","webpack://motion-chat/./node_modules/moment/locale/nb.js","webpack://motion-chat/./node_modules/moment/locale/ne.js","webpack://motion-chat/./node_modules/moment/locale/nl-be.js","webpack://motion-chat/./node_modules/moment/locale/nl.js","webpack://motion-chat/./node_modules/moment/locale/nn.js","webpack://motion-chat/./node_modules/moment/locale/oc-lnc.js","webpack://motion-chat/./node_modules/moment/locale/pa-in.js","webpack://motion-chat/./node_modules/moment/locale/pl.js","webpack://motion-chat/./node_modules/moment/locale/pt-br.js","webpack://motion-chat/./node_modules/moment/locale/pt.js","webpack://motion-chat/./node_modules/moment/locale/ro.js","webpack://motion-chat/./node_modules/moment/locale/ru.js","webpack://motion-chat/./node_modules/moment/locale/sd.js","webpack://motion-chat/./node_modules/moment/locale/se.js","webpack://motion-chat/./node_modules/moment/locale/si.js","webpack://motion-chat/./node_modules/moment/locale/sk.js","webpack://motion-chat/./node_modules/moment/locale/sl.js","webpack://motion-chat/./node_modules/moment/locale/sq.js","webpack://motion-chat/./node_modules/moment/locale/sr-cyrl.js","webpack://motion-chat/./node_modules/moment/locale/sr.js","webpack://motion-chat/./node_modules/moment/locale/ss.js","webpack://motion-chat/./node_modules/moment/locale/sv.js","webpack://motion-chat/./node_modules/moment/locale/sw.js","webpack://motion-chat/./node_modules/moment/locale/ta.js","webpack://motion-chat/./node_modules/moment/locale/te.js","webpack://motion-chat/./node_modules/moment/locale/tet.js","webpack://motion-chat/./node_modules/moment/locale/tg.js","webpack://motion-chat/./node_modules/moment/locale/th.js","webpack://motion-chat/./node_modules/moment/locale/tk.js","webpack://motion-chat/./node_modules/moment/locale/tl-ph.js","webpack://motion-chat/./node_modules/moment/locale/tlh.js","webpack://motion-chat/./node_modules/moment/locale/tr.js","webpack://motion-chat/./node_modules/moment/locale/tzl.js","webpack://motion-chat/./node_modules/moment/locale/tzm-latn.js","webpack://motion-chat/./node_modules/moment/locale/tzm.js","webpack://motion-chat/./node_modules/moment/locale/ug-cn.js","webpack://motion-chat/./node_modules/moment/locale/uk.js","webpack://motion-chat/./node_modules/moment/locale/ur.js","webpack://motion-chat/./node_modules/moment/locale/uz-latn.js","webpack://motion-chat/./node_modules/moment/locale/uz.js","webpack://motion-chat/./node_modules/moment/locale/vi.js","webpack://motion-chat/./node_modules/moment/locale/x-pseudo.js","webpack://motion-chat/./node_modules/moment/locale/yo.js","webpack://motion-chat/./node_modules/moment/locale/zh-cn.js","webpack://motion-chat/./node_modules/moment/locale/zh-hk.js","webpack://motion-chat/./node_modules/moment/locale/zh-mo.js","webpack://motion-chat/./node_modules/moment/locale/zh-tw.js","webpack://motion-chat//Users/andreabianco/Documents/Developments/motion-v3/motion-chat/node_modules/moment/locale|sync|/^\\.\\/.*$/","webpack://motion-chat/./node_modules/ng-csv/build/ng-csv.min.js"],"names":["angular","module","provider","this","defaults","factory","options","Flow","events","on","event","callback","push","$get","fn","opts","flow","extend","forEach","controller","$scope","$attrs","$parse","flowFactory","$eval","flowInit","flowObject","create","catchAllHandler","eventName","args","Array","prototype","slice","call","arguments","shift","$broadcast","apply","concat","$applyAsync","defaultPrevented","$on","off","$flow","hasOwnProperty","flowName","assign","directive","scope","element","attrs","isDirectory","isSingleFile","inputAttrs","flowAttrs","assignBrowse","bind","preventDefault","$timeout","promise","enter","dragEvent","fileDrag","dataTransfer","originalEvent","types","val","$apply","flowDragEnter","cancel","flowDragLeave","assignDrop","flowDropEnabled","$watch","value","unAssignDrop","fileSuccess","fileProgress","fileAdded","filesAdded","filesSubmitted","fileRetry","fileRemoved","fileError","uploadStart","complete","progress","error","eventArgs","string","name","charAt","toUpperCase","require","funcArgs","key","file","flowImg","fileReader","FileReader","readAsDataURL","onload","$set","target","result","transfers","files","uiView","$ViewDirectiveFill","$compile","$controller","$transitions","$view","$q","getControllerAs","parse","getResolveAs","restrict","priority","compile","tElement","initial","html","empty","$element","data","contents","cfg","$cfg","viewDecl","getTemplate","noop","resolveCtx","path","ResolveContext","trace","$uiView","link","controllerAs","resolveAs","locals","controllerInstance","children","registerControllerCallbacks","isString","component","kebobName","kebobString","tagRegexp_1","RegExp","deregisterWatch_1","directiveEl","filter","el","tagName","exec","ctrlInstance","$animate","$uiViewScroll","$interpolate","rootData","$context","_pluginapi","_rootViewContext","count","terminal","transclude","tAttrs","$transclude","previousEl","currentEl","currentScope","viewConfig","onloadExp","autoScrollExp","renderer","cb","then","leave","inherited","inheritedData","activeUIView","$type","id","fqn","config","configUpdated","updateView","fromParentTagConfig","fromParentTag","unregister","registerUIView","newScope","$new","animEnter","defer","animLeave","$uiViewData","$uiViewAnim","$animEnter","$animLeave","$$animLeave","$emit","cloned","clone","resolve","isDefined","remove","$destroy","_viewData_1","cleanupLastView","$inject","hasComponentImpl","_uiCanExitId","isFunction","$onInit","componentProvider","viewState","tail","state","self","hookOptions","uiOnParamsChanged","viewCreationTrans_1","getResolvable","onSuccess","$transition$","exiting","indexOf","toParams","params","fromParams","getNodeSchema","node","paramSchema","toSchema","treeChanges","map","reduce","unnestR","fromSchema","changedToParams","param","idx","type","equals","length","changedKeys_1","x","newValues","uiCanExit","id_1","cacheProp_1","prevTruthyAnswer_1","trans","redirectedFrom","criteria","onBefore","ids","when","TemplateFactory","_this","_useHttp","$http","$templateCache","$injector","$templateRequest","has","get","useHttpService","fromConfig","context","asTemplate","services","str","template","asComponent","fromString","templateUrl","fromUrl","templateProvider","fromProvider","fromComponentProvider","url","cache","headers","Accept","response","deps","providerFn","isArray","Resolvable","makeComponentTemplate","bindings","prefix","kebob","camelCase","kebobed","cmpDefs","Error","getBindings","getComponentBindings","input","attrName","attr","resolveName","res","join","def","isObject","bindToController","scopeBindings","bindingsObj","Object","keys","tuple","getStateHookBuilder","hookName","stateObject","hook","pathname","subContext","$$state","getLocals","$state$","undefined","Ng1LocationServices","$locationProvider","_urlListeners","_lp","createProxyFunctions","monkeyPatchPathParameterType","router","pathType","urlMatcherFactory","encode","toString","replace","m","decode","dispose","onChange","removeFrom","html5Mode","enabled","$sniffer","history","baseHref","_baseHref","$browser","$window","location","newUrl","$location","_runtimeServices","$rootScope","evt","_loc","mod_init","mod_util","mod_rtr","mod_state","mod_main","$uiRouterProvider","UIRouter","stateProvider","stateRegistry","stateService","decorator","viewService","_viewConfigFactory","urlService","_decodeParams","ng1LocationService","locationService","locationConfig","getProviderFor","serviceName","$urp","service","runBlock","$uiRouter","invoke","checkStrictDi","strictDi","resolvables","resolvable","annotate","resolveFn","watchDigests","uiRouter","urlRouterProvider","globals","run","$urlMatcherFactory","$state","$urlRouter","ctx","getTokens","getPolicy","async","applyPairs","$IsStateFilter","isFilter","is","$stateful","$IncludedByStateFilter","includesFilter","includes","StateProvider","func","definition","register","onInvalid","getNg1ViewConfigFactory","templateFactory","view","Ng1ViewConfig","hasAnyKey","obj","acc","ng1ViewsBuilder","parent","compKeys","nonCompKeys","allViewKeys","views","viewsObject","$default","pick","$name","normalized","ViewService","$uiViewName","uiViewName","$uiViewContextAnchor","uiViewContextAnchor","$id","loaded","load","paramValues","promises","getController","all","results","controllerProvider","isInjectable","UrlRouterProvider","injectableHandler","handler","match","$match","$stateParams","urlRouter","update","interceptDeferred","listen","rule","ruleFn","BaseUrlRule","identity","rules","otherwise","urlRules","what","deferIntercept","useAnchorScroll","$anchorScroll","scrollIntoView","__spreadArrays","s","i","il","r","k","a","j","jl","root","g","global","fromJson","JSON","toJson","stringify","toObj","_equals","o1","o2","t1","a1","a2","tup","arrayTuples","b","t","getTime","source","fnNames","latebind","bindFunction","fnName","inherit","extra","inArray","array","splice","pushTo","arr","deregAll","functions","defaultsList","_i","defaultVals","reverse","mergeR","memo","item","ancestors","first","second","n","propNames","objCopy","_prop","omit","collection","accept","find","mapObj","values","allTrueR","elem","anyTrueR","flattenR","pushR","uniqR","token","unnest","assertPredicate","predicateOrMap","errMsg","maxArrayLen","min","Math","_loop_1","keyValTuple","copy","src","dest","silenceUncaughtInPromise","catch","e","silentRejection","makeStub","methods","fnname","Glob","text","glob","split","regexpString","seg","regexp","matches","test","curry","curried","compose","start","pipe","funcs","prop","propEq","_val","not","and","fn1","fn2","or","any","ctor","constructor","v","pattern","struct","toStr","tis","isUndefined","isNull","o","isNullOrUndefined","isNumber","isDate","isRegExp","head","isPromise","Queue","_items","_limit","_evictListeners","onEvict","enqueue","items","evict","dequeue","size","clear","current","peekTail","peekHead","noopConsoleStub","log","table","safeConsole","document","documentMode","window","console","bound","Function","ie9Console","fallbackConsole","maxLength","max","substr","padString","$1","toLowerCase","functionToString","fnStr","fnToString","namedFunctionMatch","_fn","isRejection","stringifyPattern","_transitionRejection","seen","format","beforeAfterSubstr","char","stripLastPathElement","splitHash","splitQuery","splitEqual","trimHashVal","splitOnDelim","delim","re","joinNeighborsR","Category","uiViewString","uiview","creationContext","normalizedCat","_tid","_rid","transLbl","Trace","_enabled","approximateDigests","_set","categories","parseInt","isNaN","category","enable","disable","traceTransitionStart","TRANSITION","traceTransitionIgnored","traceHookInvocation","step","HOOK","registeredHook","traceHookResult","hookResult","transitionOptions","traceResolvePath","RESOLVE","traceResolvableResolved","traceError","reason","traceSuccess","finalState","traceUIViewEvent","viewData","UIVIEW","traceUIViewConfigUpdated","traceUIViewFill","traceViewSync","pairs","VIEWCONFIG","uivheader","mapping","_a","_b","uiv","sort","localeCompare","traceViewServiceEvent","viewConfigString","traceViewServiceUIViewEvent","UIRouterGlobals","lastStartedTransitionId","transitionHistory","successfulTransitions","transition","lazyLoadHook","entering","lazyLoad","lazyLoadState","originalTransition","orig","targetState","identifier","$url","parts","sync","registerLazyLoadHook","transitionService","lazyLoadFn","states","_state","err","DefType","hasOwn","Param","urlConfig","paramName","noReloadOnSearch","reloadOnSearch","SEARCH","dynamic","defaultConfig","paramConfig","getStaticDefaultValue","isShorthand","$$fn","unwrapShorthand","getParamDeclaration","urlType","paramTypes","CONFIG","PATH","getType","arrayDefaults","arrayParamNomenclature","arrayMode","$asArray","isOptional","raw","squash","defaultPolicy","getSquashPolicy","defaultSquashPolicy","from","to","configuredKeys","getReplace","params_1","changed","values1","values2","validates","isDefaultValue","replaceSpecialValues","_defaultValueCache","defaultValue","getDefaultValue","$normalize","isSearch","encoded","ParamType","$subPattern","sub","mode","ArrayType","arrayWrap","arrayHandler","allTruthyMode","arrayUnwrap","arrayEqualsHandler","val1","val2","left","right","paramTypeFn","wrapperFn","$arrayMode","makeDefaultType","ParamTypes","typeQueue","defaultTypes","definitionFn","_flushTypeQueue","valToString","defaultTypeBase","String","query","hash","int","bool","Boolean","date","getFullYear","getMonth","getDate","capture","Date","valueOf","l","json","StateParams","$inherit","newParams","$current","$to","parentParams","parents","inheritList","PathNode","stateOrNode","parameters","applyRawParams","pDef","paramDef","parameter","paramsFn","diff","PathUtils","makeTargetState","registry","buildPath","buildToPath","fromPath","toPath","inheritParams","applyViewConfigs","viewDecls","subPath","viewConfigs","createViewConfig","toKeys","noInherit","toNode","toParamVals","incomingParamVals","fromParamVals","ownParamVals","reloadState","node1","node2","retained","keep","nonDynamicParams","retainedWithToParams","retainedNode","matching","pathA","pathB","done","nodeA","nodeB","predicate","elementIdx","resolvePolicies","LAZY","EAGER","WAIT","NOWAIT","arg1","policy","resolved","literal","thisPolicy","statePolicy","resolvePolicy","resolveContext","findNode","asyncPolicy","customAsyncPolicy","getDependencies","resolvedDeps","resolvedValue","fromData","whens","ALL_WHENS","EAGER_WHENS","_path","addResolvables","newResolvables","resolvePath","matchedWhens","matchesPolicy","acceptedVals","whenOrAsync","nodeResolvables","nowait","wait","getResult","injector","_injector","UIInjectorImpl","availableResolvables","_node","fromInjector","getNative","native","getAsync","_routerInstance","locationServiceStub","locationConfigStub","_disposed","_disposables","_plugins","disposable","d","ignored","plugin","pluginInstance","getPlugin","pluginName","nameBuilder","selfBuilder","dataBuilder","getUrlBuilder","$urlMatcherFactoryProvider","stateDec","newStateDec","parsed","substring","parseUrl","isMatcher","navigable","append","getNavigableBuilder","isRoot","pathBuilder","includesBuilder","resolvablesBuilder","resolveObj","getToken","p","provide","literal2Resolvable","useFactory","dependencies","useClass","useValue","useExisting","tuple2Resolvable","item2Resolvable","decl","StateBuilder","matcher","paramFactory","builders","parentName","urlParams","nonUrlParams","builder","build","chain","parentFn","segments","pop","StateMatcher","_states","isRelative","stateName","stateOrName","base","matchGlob","isStr","__stateObjectCache","nameGlob","baseState","splitName","pathLength","relName","StateObject","stateDecl","isStateClass","ref","matchingKeys","isStateDeclaration","isState","StateQueueManager","listeners","queue","flush","registered","orphans","previousQueueLength","getState","notifyListeners","listener","name_1","orphanIdx","existingState","existingFutureState","deregister","attachRoute","prev","abstract","rulesApi","urlRuleFactory","StateRegistry","stateQueue","_registerRoot","_root","onStatesChanged","stateDefinition","_deregisterTree","getChildren","_children","deregistered","removeRule","deregisteredStates","found","property","builderFunction","TargetState","_stateRegistry","_identifier","_params","_options","_definition","relative","exists","valid","withState","withParams","withOptions","newOpts","isDef","HookBuilder","buildHooksForPhase","phase","_getEvents","buildHooks","hookType","matchingHooks","getMatchingHooks","reverseDepthSort","baseHookOptions","criteriaMatchPath","traceData","transitionHook","reverseSort","factor","depthDelta","isCreate","hookPhase","reg","getHooks","matchState","criterion","toMatch","globStrings","RegisteredHook","tranSvc","eventType","matchCriteria","removeHookFromRegistry","invokeCount","_deregistered","invokeLimit","_matchingNodes","nodes","_getDefaultMatchCriteria","_getPathTypes","_getMatchingNodes","mn","pathtype","isStateHook","every","makeEvent","hooks","_registeredHooks","removeHookFn","hookRegistrationFn","matchObject","TransitionHookPhase","TransitionHookScope","RejectType","Rejection","message","detail","isRejectionPromise","superseded","rejection","SUPERSEDED","redirected","invalid","INVALID","IGNORED","aborted","ABORTED","errored","ERROR","normalize","toPromise","TransitionEventType","hookOrder","getResultHandler","getErrorHandler","synchronous","defaultOptions","TransitionHook","stateContext","isSuperseded","isActive","waitFor","nextHook","invokeHook","invokeHooks","doneCallback","remainingHooks","runAllHooks","logError","defaultErrorHandler","notCurrent","getNotCurrentRejection","handleError","handleResult","handleHookResult","isTargetState","_aborted","HANDLE_RESULT","LOG_REJECTED_RESULT","LOG_ERROR","REJECT_ERROR","THROW_ERROR","addCoreResolvables","addResolvable","TRANSITION_TOKENS","isTransition","treeChangesCleanup","replaceTransitionWithNull","redirectToHook","redirect","redirectTo","makeEnterExitRetainHook","hookFn","onExitHook","onRetainHook","onEnterHook","RESOLVE_HOOK_PRIORITY","eagerResolvePath","lazyResolveState","resolveRemaining","loadEnteringViews","enteringViews","activateViews","exitingViews","vc","deactivateViewConfig","activateViewConfig","updateGlobalState","clearCurrentTransition","updateUrl","urlOptions","ignoredHook","ignoredReason","_ignoredReason","pending","abort","invalidTransitionHook","defaultTransOpts","notify","reload","supercede","custom","TransitionService","_router","_transitionCount","_eventTypes","_criteriaPaths","_deregisterHookFns","_defineCorePaths","_defineCoreEvents","_registerCoreTransitionHooks","onCreate","onStart","onExit","onRetain","onEnter","onFinish","onError","hooksArray","Phase","TH","paths","NORMAL_SORT","SYNCHRONOUS","_defineEvent","CREATE","BEFORE","RUN","SUCCESS","STATE","_definePathType","cmpByPhase","hookScope","fns","addCoreResolves","registerInvalidTransitionHook","registerRedirectToHook","registerOnExitHook","registerOnRetainHook","registerOnEnterHook","eagerResolve","registerEagerResolvePath","lazyResolve","registerLazyResolveState","resolveAll","registerResolveRemaining","loadViews","registerLoadEnteringViews","registerActivateViews","updateGlobals","registerUpdateGlobalState","registerUpdateUrl","UrlConfig","_isCaseInsensitive","_isStrictMode","_defaultSquashPolicy","hashPrefix","newprefix","host","port","protocol","caseInsensitive","strictMode","__assign","ParamFactory","fromSearch","UrlMatcherFactory","UrlMatcher","globalConfig","strict","decodeParams","object","UrlRouter","urlParts","compareFn","read","urlMatcher","href","absolute","isHtml5","appendBasePath","slash","cfgPort","defineProperty","enumerable","configurable","UrlRuleFactory","makeRule","_what","fromUrlMatcher","fromState","fromRegExp","_handler","details","matchPriority","optional","search","stateOrDecl","transitionTo","sticky","Number","isUrlRule","defaultRuleSortFn","getHandlerFn","cmp","prioritySort","weights","URLMATCHER","REGEXP","RAW","OTHER","typeSort","urlMatcherSort","useMatchPriority","idSort","UrlRules","_sortFn","_rules","_id","_otherwiseFn","handlerFn","_sorted","ensureSorted","sorted","stableSort","group","_group","arrOfWrapper","wrapperA","wrapperB","cmpDiff","wrapper","UrlService","newurl","best","go","applyResult","_stopListeningFn","weight","BaseLocationServices","fireAfterUpdate","_listeners","_listener","_get","_location","_history","BrowserLocationConfig","_isHtml5","_hashPrefix","hostname","getBaseHref","baseTag","getElementsByTagName","extendStatics","__extends","setPrototypeOf","__proto__","__","HashLocationService","_super","title","MemoryLocationConfig","_port","_protocol","_host","newval","MemoryLocationService","_url","PushStateLocationService","_config","_getBasePrefix","basePrefix","exactBaseHrefMatch","startsWithBase","fullUrl","replaceState","pushState","keyValsToObjectR","accum","getParams","queryString","orEmptyString","beforehash","buildUrl","loc","searchObject","locationPluginFactory","serviceClass","configurationClass","configuration","_uiViews","_viewConfigs","_viewConfigFactories","_registeredUIView","_registeredUIViews","_activeViewConfigs","_onSync","normalizeUIViewTarget","rawViewName","viewAtContext","relativeViewNameSugar","anchorState","anchor","_rootContext","viewType","cfgFactory","cfgs","uiViewsByFqn","viewConfigDepth","depthCompare","depthFn","posNeg","uiViewTuples","stateDepth","matchingConfigs","matchedViewConfigs","unmatchedConfigTuples","allTuples","uiViews","available","active","vcSegments","uivSegments","negOffset","fqnToFirstSegment","uiViewContext","ARIA_DISABLE_ATTR","ngAriaModule","info","angularVersion","ariaHidden","ariaChecked","ariaReadonly","ariaDisabled","ariaRequired","ariaInvalid","ariaValue","tabindex","bindKeydown","bindRoleForClick","watchExpr","ariaAttr","nativeAriaNodeNames","negate","ariaCamelName","isNodeOneOf","boolVal","newConfig","$$watchExpr","nodeTypeArray","nodeName","$aria","shouldAttachAttr","normalizedAttr","allowNonAriaNodes","shouldAttachRole","role","shape","getShape","post","ngModel","needsTabIndex","ngAriaWatchModelValue","$modelValue","newVal","$viewValue","$isEmpty","needsAriaValuemin","needsAriaValuemax","needsAriaValuenow","$observe","$validators","required","$invalid","ngMessages","ngClick","ngKeydown","ngKeypress","ngKeyup","keyCode","which","isContentEditable","$event","readOnly","pristine","resetable","starWidth","starHeight","canelWidth","cancelHeight","rated","reset","beforeRated","beforeReset","isTouch","navigator","msMaxTouchPoints","orgValue","starPartWidth","steps","garbage","getValue","index","getStartParts","getStarOffset","ratio","isSelected","removeRating","rating","setValue","tmpValue","put","IndexController","$mdDialog","localStorageService","api","STORAGE_LAYOUT","STORAGE_VISITOR","vm","updateStorage","storage","set","toggle","up","cmd","layout","postMessage","$$phase","settings","status","div_color","color","text_color","textColor","text_button_color","textButtonColor","button_color","color_button","background_color","backgroundColor","client_height","documentElement","clientHeight","innerHeight","client_width","clientWidth","style","setProperty","tg","visitorStorage","layoutStorage","visitor","interaction","alignment","online","exceeded","maxInteractions","openedInteractions","isOnline","hideWhenOffline","createElement","appendChild","sheet","insertRule","close","confirm","querySelector","clickOutsideToClose","closingQuestion","ok","show","chatInteraction","customUpdate","closed","closeReason","closedAt","moment","$promise","download","deferred","getMessages","intid","includeAll","_map","rows","row","sender","direction","customerAlias","ContactId","agentIdentifier","UserId","agentAlias","User","alias","fullname","body","createdAt","getHeaderShape","header_shape","CHAT_STATUSES","offline","defaultTitle","header_online","header_offline","addEventListener","routeRun","cursor","hide","_forIn","_isNil","routeConfig","$stateProvider","$urlRouterProvider","$httpProvider","localStorageServiceProvider","STORAGE_PREFIX","Pragma","setPrefix","waitingTemplate","onlineTemplate","offlineTemplate","chatTemplate","unmanagedTemplate","closingTemplate","ClosingController","$mdToast","errors","toast","simple","textContent","formSubmitFailureMessage","toastClass","position","stopLoading","loading","goToIfTime","form","upColor","downColor","userForm","$setPristine","$setUntouched","enableDownload","submit","_merge","ratingType","customer","formSubmitSuccessMessage","finally","skip","apiService","$resource","paramDefaults","baseUrl","remote","chatWebsite","method","getFields","uploadAttachment","transformRequest","downloadAttachment","chatMessage","ChatController","$interval","$document","emojiArea","getMessagesInterval","getInteractionInterval","lastMessageId","scrollToBottomOfChat","getElementsByClassName","scrollTop","scrollHeight","sendMessage","chatMessageError","emojioneArea","setText","getInteraction","disposition","reply","getText","shiftKey","includeAgent","added","_find","messages","emojiOptions","watchEmbedData","fontSmiley","emoji","linkTarget","showMenu","replyMessage","$","placeholder","placeholderMessage","keyup","editor","ready","setFocus","reply_button","fd","FormData","sendAttachment","AttachmentId","_values","OfflineController","$sce","fromKey","initialFields","typeField","optJsonFormData","showLeafArrayIndexes","includeNullValues","onSubmitSuccess","fields","_cloneDeep","trustAsHtml","initUploadButton","formItem","uploadItem","button","label","css","trigger","click","props","maxSizeMB","some","sizeErrMessage","removeFileItem","setupFileInput","multipleUpload","setAttribute","makeFileOptionsVisible","fileOpts","lastOpt","mapKeyOffline","_random","field","helpText","isHTML","checkHTML","cmField","uploadFields","payLoad","isFormDataPayload","isJsonPayload","payload","jsonToFormData","initialFormData","Promise","reject","OnlineController","getAnonymous","disableItem","chatInteractionId","channel","mapKey","variable","referer","customerIp","enableCustomerWriting","UnmanagedController","note","WaitingController","called","open","unload","xhr","XMLHttpRequest","setRequestHeader","send","readyState","removeEventListener","toTrustedFilter","constant","ngEnter","getElementById","div","startTime","sentAt","createTextNode","myWindow","write","innerHTML","focus","print","printElement","elemToPrint","$mdGestureProvider","skipClickHijack","exports","globalThis","isJsonObject","Blob","isGlobalFormDataPresent","getDefaultFormData","convertRecursively","jsonObject","formData","parentKey","propName","FileList","toISOString","mergedOptions","carry","objectToMerge","objectKey","defineLocale","months","monthsShort","weekdays","weekdaysShort","weekdaysMin","meridiemParse","isPM","meridiem","hours","minutes","isLower","longDateFormat","LT","LTS","L","LL","LLL","LLLL","calendar","sameDay","nextDay","nextWeek","lastDay","lastWeek","sameElse","relativeTime","future","past","ss","mm","h","hh","dd","M","MM","y","yy","dayOfMonthOrdinalParse","ordinal","number","week","dow","doy","pluralForm","plurals","pluralize","u","withoutSuffix","isFuture","f","weekdaysParseExact","hour","minute","postformat","symbolMap","preparse","numberMap","suffixes","relativeTimeWithPlural","num","forms","standalone","isFormat","day","period","w","ww","lastDigit","last2Digits","meridiemHour","monthsShortRegex","monthsParseExact","relativeTimeWithMutation","mutationTable","softMutation","mutation","lastNumber","monthsParse","monthsRegex","minWeekdaysParse","weekdaysParse","fullWeekdaysParse","shortWeekdaysParse","monthsStrictRegex","monthsShortStrictRegex","longMonthsParse","shortMonthsParse","translate","ll","lll","llll","output","plural","processRelativeTime","monthsNominativeEl","monthsGenitiveEl","momentToFormat","_monthsGenitiveEl","month","_monthsNominativeEl","calendarEl","mom","_calendarEl","monthsShortDot","invalidDate","numbersPast","numbersFuture","verbalNumber","monthsShortWithDots","monthsShortWithoutDots","weekEndings","eras","since","offset","narrow","abbr","until","eraYearOrdinalRegex","eraYearOrdinalParse","now","$0","$2","isUpper","eifelerRegelAppliesToNumber","units","translateSingular","special","relativeTimeWithSingular","translator","words","correctGrammaticalCase","wordKey","relativeTimeMr","monthsNominative","monthsSubjective","separator","days","numbersNouns","numberNoun","hundred","floor","ten","one","word","numberAsNoun","time","hm","processHoursFunction","nominative","accusative","genitive","webpackContext","req","webpackContextResolve","__webpack_require__","code","debug","urlSanitizationWhitelist","aHrefSanitizationWhitelist","stringifyField","decimalSep","isFloat","toLocaleString","quoteStrings","txtDelim","isFinite","header","fieldSep","c","columnOrder","addByteOrderMarker","isSpecialChar","getSpecialChar","filename","charset","csv","buildCSV","getFilename","addClass","ngCsvLoadingClass","csvHeader","csvColumnOrder","csvLabel","removeClass","msSaveOrOpenBlob","msSaveBlob","URL","createObjectURL"],"sourceRoot":""} \ No newline at end of file diff --git a/snippet/3.1.0/scripts/mobile.js b/snippet/3.0.0/scripts/mobile.js similarity index 100% rename from snippet/3.1.0/scripts/mobile.js rename to snippet/3.0.0/scripts/mobile.js diff --git a/snippet/3.1.0/scripts/runtime.js b/snippet/3.0.0/scripts/runtime.js similarity index 100% rename from snippet/3.1.0/scripts/runtime.js rename to snippet/3.0.0/scripts/runtime.js diff --git a/snippet/3.1.0/scripts/runtime.js.map b/snippet/3.0.0/scripts/runtime.js.map similarity index 100% rename from snippet/3.1.0/scripts/runtime.js.map rename to snippet/3.0.0/scripts/runtime.js.map diff --git a/snippet/3.1.0/scripts/vendor-angular-58d021f3.js b/snippet/3.0.0/scripts/vendor-angular-58d021f3.js similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-58d021f3.js rename to snippet/3.0.0/scripts/vendor-angular-58d021f3.js diff --git a/snippet/3.1.0/scripts/vendor-angular-58d021f3.js.map b/snippet/3.0.0/scripts/vendor-angular-58d021f3.js.map similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-58d021f3.js.map rename to snippet/3.0.0/scripts/vendor-angular-58d021f3.js.map diff --git a/snippet/3.1.0/scripts/vendor-angular-76f2ed34.js b/snippet/3.0.0/scripts/vendor-angular-76f2ed34.js similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-76f2ed34.js rename to snippet/3.0.0/scripts/vendor-angular-76f2ed34.js diff --git a/snippet/3.1.0/scripts/vendor-angular-76f2ed34.js.LICENSE.txt b/snippet/3.0.0/scripts/vendor-angular-76f2ed34.js.LICENSE.txt similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-76f2ed34.js.LICENSE.txt rename to snippet/3.0.0/scripts/vendor-angular-76f2ed34.js.LICENSE.txt diff --git a/snippet/3.1.0/scripts/vendor-angular-76f2ed34.js.map b/snippet/3.0.0/scripts/vendor-angular-76f2ed34.js.map similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-76f2ed34.js.map rename to snippet/3.0.0/scripts/vendor-angular-76f2ed34.js.map diff --git a/snippet/3.1.0/scripts/vendor-angular-animate.js b/snippet/3.0.0/scripts/vendor-angular-animate.js similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-animate.js rename to snippet/3.0.0/scripts/vendor-angular-animate.js diff --git a/snippet/3.1.0/scripts/vendor-angular-animate.js.LICENSE.txt b/snippet/3.0.0/scripts/vendor-angular-animate.js.LICENSE.txt similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-animate.js.LICENSE.txt rename to snippet/3.0.0/scripts/vendor-angular-animate.js.LICENSE.txt diff --git a/snippet/3.1.0/scripts/vendor-angular-animate.js.map b/snippet/3.0.0/scripts/vendor-angular-animate.js.map similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-animate.js.map rename to snippet/3.0.0/scripts/vendor-angular-animate.js.map diff --git a/snippet/3.1.0/scripts/vendor-angular-local-storage.js b/snippet/3.0.0/scripts/vendor-angular-local-storage.js similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-local-storage.js rename to snippet/3.0.0/scripts/vendor-angular-local-storage.js diff --git a/snippet/3.1.0/scripts/vendor-angular-local-storage.js.LICENSE.txt b/snippet/3.0.0/scripts/vendor-angular-local-storage.js.LICENSE.txt similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-local-storage.js.LICENSE.txt rename to snippet/3.0.0/scripts/vendor-angular-local-storage.js.LICENSE.txt diff --git a/snippet/3.1.0/scripts/vendor-angular-local-storage.js.map b/snippet/3.0.0/scripts/vendor-angular-local-storage.js.map similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-local-storage.js.map rename to snippet/3.0.0/scripts/vendor-angular-local-storage.js.map diff --git a/snippet/3.1.0/scripts/vendor-angular-material.js b/snippet/3.0.0/scripts/vendor-angular-material.js similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-material.js rename to snippet/3.0.0/scripts/vendor-angular-material.js diff --git a/snippet/3.1.0/scripts/vendor-angular-material.js.LICENSE.txt b/snippet/3.0.0/scripts/vendor-angular-material.js.LICENSE.txt similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-material.js.LICENSE.txt rename to snippet/3.0.0/scripts/vendor-angular-material.js.LICENSE.txt diff --git a/snippet/3.1.0/scripts/vendor-angular-material.js.map b/snippet/3.0.0/scripts/vendor-angular-material.js.map similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-material.js.map rename to snippet/3.0.0/scripts/vendor-angular-material.js.map diff --git a/snippet/3.1.0/scripts/vendor-angular-messages.js b/snippet/3.0.0/scripts/vendor-angular-messages.js similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-messages.js rename to snippet/3.0.0/scripts/vendor-angular-messages.js diff --git a/snippet/3.1.0/scripts/vendor-angular-messages.js.LICENSE.txt b/snippet/3.0.0/scripts/vendor-angular-messages.js.LICENSE.txt similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-messages.js.LICENSE.txt rename to snippet/3.0.0/scripts/vendor-angular-messages.js.LICENSE.txt diff --git a/snippet/3.1.0/scripts/vendor-angular-messages.js.map b/snippet/3.0.0/scripts/vendor-angular-messages.js.map similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-messages.js.map rename to snippet/3.0.0/scripts/vendor-angular-messages.js.map diff --git a/snippet/3.1.0/scripts/vendor-angular-resource.js b/snippet/3.0.0/scripts/vendor-angular-resource.js similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-resource.js rename to snippet/3.0.0/scripts/vendor-angular-resource.js diff --git a/snippet/3.1.0/scripts/vendor-angular-resource.js.LICENSE.txt b/snippet/3.0.0/scripts/vendor-angular-resource.js.LICENSE.txt similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-resource.js.LICENSE.txt rename to snippet/3.0.0/scripts/vendor-angular-resource.js.LICENSE.txt diff --git a/snippet/3.1.0/scripts/vendor-angular-resource.js.map b/snippet/3.0.0/scripts/vendor-angular-resource.js.map similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-resource.js.map rename to snippet/3.0.0/scripts/vendor-angular-resource.js.map diff --git a/snippet/3.1.0/scripts/vendor-angular-sanitize.js b/snippet/3.0.0/scripts/vendor-angular-sanitize.js similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-sanitize.js rename to snippet/3.0.0/scripts/vendor-angular-sanitize.js diff --git a/snippet/3.1.0/scripts/vendor-angular-sanitize.js.LICENSE.txt b/snippet/3.0.0/scripts/vendor-angular-sanitize.js.LICENSE.txt similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-sanitize.js.LICENSE.txt rename to snippet/3.0.0/scripts/vendor-angular-sanitize.js.LICENSE.txt diff --git a/snippet/3.1.0/scripts/vendor-angular-sanitize.js.map b/snippet/3.0.0/scripts/vendor-angular-sanitize.js.map similarity index 100% rename from snippet/3.1.0/scripts/vendor-angular-sanitize.js.map rename to snippet/3.0.0/scripts/vendor-angular-sanitize.js.map diff --git a/snippet/3.1.0/scripts/vendor-emojione.js b/snippet/3.0.0/scripts/vendor-emojione.js similarity index 100% rename from snippet/3.1.0/scripts/vendor-emojione.js rename to snippet/3.0.0/scripts/vendor-emojione.js diff --git a/snippet/3.1.0/scripts/vendor-emojione.js.map b/snippet/3.0.0/scripts/vendor-emojione.js.map similarity index 100% rename from snippet/3.1.0/scripts/vendor-emojione.js.map rename to snippet/3.0.0/scripts/vendor-emojione.js.map diff --git a/snippet/3.1.0/scripts/vendor-emojionearea.js b/snippet/3.0.0/scripts/vendor-emojionearea.js similarity index 100% rename from snippet/3.1.0/scripts/vendor-emojionearea.js rename to snippet/3.0.0/scripts/vendor-emojionearea.js diff --git a/snippet/3.1.0/scripts/vendor-emojionearea.js.LICENSE.txt b/snippet/3.0.0/scripts/vendor-emojionearea.js.LICENSE.txt similarity index 100% rename from snippet/3.1.0/scripts/vendor-emojionearea.js.LICENSE.txt rename to snippet/3.0.0/scripts/vendor-emojionearea.js.LICENSE.txt diff --git a/snippet/3.1.0/scripts/vendor-emojionearea.js.map b/snippet/3.0.0/scripts/vendor-emojionearea.js.map similarity index 100% rename from snippet/3.1.0/scripts/vendor-emojionearea.js.map rename to snippet/3.0.0/scripts/vendor-emojionearea.js.map diff --git a/snippet/3.1.0/scripts/vendor-flow.js b/snippet/3.0.0/scripts/vendor-flow.js similarity index 100% rename from snippet/3.1.0/scripts/vendor-flow.js rename to snippet/3.0.0/scripts/vendor-flow.js diff --git a/snippet/3.1.0/scripts/vendor-flow.js.LICENSE.txt b/snippet/3.0.0/scripts/vendor-flow.js.LICENSE.txt similarity index 100% rename from snippet/3.1.0/scripts/vendor-flow.js.LICENSE.txt rename to snippet/3.0.0/scripts/vendor-flow.js.LICENSE.txt diff --git a/snippet/3.1.0/scripts/vendor-flow.js.map b/snippet/3.0.0/scripts/vendor-flow.js.map similarity index 100% rename from snippet/3.1.0/scripts/vendor-flow.js.map rename to snippet/3.0.0/scripts/vendor-flow.js.map diff --git a/snippet/3.0.0/scripts/vendor-index.js b/snippet/3.0.0/scripts/vendor-index.js new file mode 100644 index 0000000..f98a4ec --- /dev/null +++ b/snippet/3.0.0/scripts/vendor-index.js @@ -0,0 +1,2 @@ +(self.webpackChunkmotion_chat=self.webpackChunkmotion_chat||[]).push([["vendor-index"],{"./node_modules/@uirouter/angularjs/lib-esm/index.js":(e,t,r)=>{"use strict";r("./node_modules/@uirouter/angularjs/lib-esm/services.js"),r("./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js"),r("./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js"),r("./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js"),r("./node_modules/@uirouter/angularjs/lib-esm/directives/stateDirectives.js"),r("./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js"),r("./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js"),r("./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js"),r("./node_modules/@uirouter/core/lib-esm/index.js")},"./node_modules/@uirouter/core/lib-esm/common/index.js":(e,t,r)=>{"use strict";r.d(t,{bb:()=>n.bb,sp:()=>n.sp,WR:()=>n.WR,ce:()=>n.ce,Wk:()=>n.Wk,l7:()=>n.l7,hX:()=>n.hX,FN:()=>n.FN,Ed:()=>n.Ed,yR:()=>n.yR,d3:()=>n.d3,js:()=>n.js,ZT:()=>n.ZT,ei:()=>n.ei,nA:()=>n.nA,Jz:()=>n.Jz,Gb:()=>n.Gb,v_:()=>n.v_,M7:()=>n.M7,VO:()=>n.VO,HV:()=>o.H,uZ:()=>o.u,rR:()=>u.r,is:()=>i.is,Qc:()=>i.Qc,uj:()=>i.uj,vg:()=>i.vg,P0:()=>i.P0,kJ:()=>a.kJ,$K:()=>a.$K,mf:()=>a.mf,Qh:()=>a.Qh,Kn:()=>a.Kn,HD:()=>a.HD,wV:()=>a.o8,L$:()=>c.L$,Fb:()=>c.Fb,cW:()=>c.cW,C7:()=>c.C7,Lb:()=>c.Lb,Ld:()=>c.HV,g4:()=>s.g4});var n=r("./node_modules/@uirouter/core/lib-esm/common/common.js"),o=r("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),u=r("./node_modules/@uirouter/core/lib-esm/common/glob.js"),i=r("./node_modules/@uirouter/core/lib-esm/common/hof.js"),a=r("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),c=(r("./node_modules/@uirouter/core/lib-esm/common/queue.js"),r("./node_modules/@uirouter/core/lib-esm/common/strings.js")),s=r("./node_modules/@uirouter/core/lib-esm/common/trace.js")},"./node_modules/@uirouter/core/lib-esm/index.js":(e,t,r)=>{"use strict";r.d(t,{applyPairs:()=>n.bb,createProxyFunctions:()=>n.WR,extend:()=>n.l7,filter:()=>n.hX,forEach:()=>n.Ed,identity:()=>n.yR,inArray:()=>n.d3,isArray:()=>n.kJ,isDefined:()=>n.$K,isFunction:()=>n.mf,isInjectable:()=>n.Qh,isObject:()=>n.Kn,isString:()=>n.HD,kebobString:()=>n.L$,noop:()=>n.ZT,parse:()=>n.Qc,pick:()=>n.ei,removeFrom:()=>n.nA,services:()=>n.uZ,tail:()=>n.Gb,trace:()=>n.g4,uniqR:()=>n.v_,unnestR:()=>n.M7,val:()=>n.P0,Resolvable:()=>u.XU,ResolveContext:()=>u.l1,BaseUrlRule:()=>a.BaseUrlRule,ViewService:()=>c.ViewService,UIRouter:()=>s.a});var n=r("./node_modules/@uirouter/core/lib-esm/common/index.js"),o=r("./node_modules/@uirouter/core/lib-esm/params/index.js");r.o(o,"BaseUrlRule")&&r.d(t,{BaseUrlRule:function(){return o.BaseUrlRule}}),r.o(o,"Resolvable")&&r.d(t,{Resolvable:function(){return o.Resolvable}}),r.o(o,"ResolveContext")&&r.d(t,{ResolveContext:function(){return o.ResolveContext}}),r.o(o,"UIRouter")&&r.d(t,{UIRouter:function(){return o.UIRouter}}),r.o(o,"ViewService")&&r.d(t,{ViewService:function(){return o.ViewService}}),r("./node_modules/@uirouter/core/lib-esm/path/index.js");var u=r("./node_modules/@uirouter/core/lib-esm/resolve/index.js"),i=r("./node_modules/@uirouter/core/lib-esm/state/index.js");r.o(i,"BaseUrlRule")&&r.d(t,{BaseUrlRule:function(){return i.BaseUrlRule}}),r.o(i,"UIRouter")&&r.d(t,{UIRouter:function(){return i.UIRouter}}),r.o(i,"ViewService")&&r.d(t,{ViewService:function(){return i.ViewService}}),r("./node_modules/@uirouter/core/lib-esm/transition/index.js");var a=r("./node_modules/@uirouter/core/lib-esm/url/index.js");r.o(a,"UIRouter")&&r.d(t,{UIRouter:function(){return a.UIRouter}}),r.o(a,"ViewService")&&r.d(t,{ViewService:function(){return a.ViewService}});var c=r("./node_modules/@uirouter/core/lib-esm/view/index.js");r.o(c,"UIRouter")&&r.d(t,{UIRouter:function(){return c.UIRouter}}),r("./node_modules/@uirouter/core/lib-esm/globals.js");var s=r("./node_modules/@uirouter/core/lib-esm/router.js");r("./node_modules/@uirouter/core/lib-esm/vanilla.js"),r("./node_modules/@uirouter/core/lib-esm/interface.js")},"./node_modules/@uirouter/core/lib-esm/params/index.js":(e,t,r)=>{"use strict";r.d(t,{DefType:()=>o._,Param:()=>o.d,ParamTypes:()=>u.p});var n=r("./node_modules/@uirouter/core/lib-esm/params/interface.js");r.o(n,"BaseUrlRule")&&r.d(t,{BaseUrlRule:function(){return n.BaseUrlRule}}),r.o(n,"DefType")&&r.d(t,{DefType:function(){return n.DefType}}),r.o(n,"Param")&&r.d(t,{Param:function(){return n.Param}}),r.o(n,"ParamTypes")&&r.d(t,{ParamTypes:function(){return n.ParamTypes}}),r.o(n,"Resolvable")&&r.d(t,{Resolvable:function(){return n.Resolvable}}),r.o(n,"ResolveContext")&&r.d(t,{ResolveContext:function(){return n.ResolveContext}}),r.o(n,"UIRouter")&&r.d(t,{UIRouter:function(){return n.UIRouter}}),r.o(n,"ViewService")&&r.d(t,{ViewService:function(){return n.ViewService}});var o=r("./node_modules/@uirouter/core/lib-esm/params/param.js"),u=r("./node_modules/@uirouter/core/lib-esm/params/paramTypes.js");r("./node_modules/@uirouter/core/lib-esm/params/stateParams.js"),r("./node_modules/@uirouter/core/lib-esm/params/paramType.js")},"./node_modules/@uirouter/core/lib-esm/path/index.js":(e,t,r)=>{"use strict";r("./node_modules/@uirouter/core/lib-esm/path/pathNode.js"),r("./node_modules/@uirouter/core/lib-esm/path/pathUtils.js")},"./node_modules/@uirouter/core/lib-esm/resolve/index.js":(e,t,r)=>{"use strict";r.d(t,{XU:()=>n.X,l1:()=>o.l}),r("./node_modules/@uirouter/core/lib-esm/resolve/interface.js");var n=r("./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"),o=r("./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js")},"./node_modules/@uirouter/core/lib-esm/state/index.js":(e,t,r)=>{"use strict";r.d(t,{TargetState:()=>o.F});var n=r("./node_modules/@uirouter/core/lib-esm/state/interface.js");r.o(n,"BaseUrlRule")&&r.d(t,{BaseUrlRule:function(){return n.BaseUrlRule}}),r.o(n,"TargetState")&&r.d(t,{TargetState:function(){return n.TargetState}}),r.o(n,"UIRouter")&&r.d(t,{UIRouter:function(){return n.UIRouter}}),r.o(n,"ViewService")&&r.d(t,{ViewService:function(){return n.ViewService}}),r("./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js"),r("./node_modules/@uirouter/core/lib-esm/state/stateObject.js"),r("./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js"),r("./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js"),r("./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js"),r("./node_modules/@uirouter/core/lib-esm/state/stateService.js");var o=r("./node_modules/@uirouter/core/lib-esm/state/targetState.js")},"./node_modules/@uirouter/core/lib-esm/transition/index.js":(e,t,r)=>{"use strict";r("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),r("./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js"),r("./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js"),r("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"),r("./node_modules/@uirouter/core/lib-esm/transition/transition.js"),r("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),r("./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js"),r("./node_modules/@uirouter/core/lib-esm/transition/transitionService.js")},"./node_modules/@uirouter/core/lib-esm/url/index.js":(e,t,r)=>{"use strict";r.d(t,{BaseUrlRule:()=>o.n});var n=r("./node_modules/@uirouter/core/lib-esm/url/interface.js");r.o(n,"BaseUrlRule")&&r.d(t,{BaseUrlRule:function(){return n.BaseUrlRule}}),r.o(n,"UIRouter")&&r.d(t,{UIRouter:function(){return n.UIRouter}}),r.o(n,"ViewService")&&r.d(t,{ViewService:function(){return n.ViewService}}),r("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),r("./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js"),r("./node_modules/@uirouter/core/lib-esm/url/urlRouter.js");var o=r("./node_modules/@uirouter/core/lib-esm/url/urlRule.js");r("./node_modules/@uirouter/core/lib-esm/url/urlService.js"),r("./node_modules/@uirouter/core/lib-esm/url/urlRules.js"),r("./node_modules/@uirouter/core/lib-esm/url/urlConfig.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/index.js":(e,t,r)=>{"use strict";r("./node_modules/@uirouter/core/lib-esm/vanilla/q.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/injector.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js")},"./node_modules/@uirouter/core/lib-esm/view/index.js":(e,t,r)=>{"use strict";r.d(t,{ViewService:()=>o.s});var n=r("./node_modules/@uirouter/core/lib-esm/view/interface.js");r.o(n,"UIRouter")&&r.d(t,{UIRouter:function(){return n.UIRouter}}),r.o(n,"ViewService")&&r.d(t,{ViewService:function(){return n.ViewService}});var o=r("./node_modules/@uirouter/core/lib-esm/view/view.js")},"./node_modules/angular-animate/index.js":(e,t,r)=>{r("./node_modules/angular-animate/angular-animate.js"),e.exports="ngAnimate"},"./node_modules/angular-aria/index.js":(e,t,r)=>{r("./node_modules/angular-aria/angular-aria.js"),e.exports="ngAria"},"./node_modules/angular-local-storage/index.js":(e,t,r)=>{r("./node_modules/angular-local-storage/dist/angular-local-storage.js"),e.exports="LocalStorageModule"},"./node_modules/angular-material/index.js":(e,t,r)=>{r("./node_modules/angular/index-exposed.js"),r("./node_modules/angular-animate/index.js"),r("./node_modules/angular-aria/index.js"),r("./node_modules/angular-material/angular-material.js"),e.exports="ngMaterial"},"./node_modules/angular-messages/index.js":(e,t,r)=>{r("./node_modules/angular-messages/angular-messages.js"),e.exports="ngMessages"},"./node_modules/angular-resource/index.js":(e,t,r)=>{r("./node_modules/angular-resource/angular-resource.js"),e.exports="ngResource"},"./node_modules/angular-sanitize/index.js":(e,t,r)=>{r("./node_modules/angular-sanitize/angular-sanitize.js"),e.exports="ngSanitize"},"./node_modules/angular/index.js":(e,t,r)=>{r("./node_modules/angular/angular.js"),e.exports=angular},"./node_modules/angular/index-exposed.js":(e,t,r)=>{var n=r("./node_modules/angular/index.js");r("./node_modules/expose-loader/dist/runtime/getGlobalThis.js").angular=n,e.exports=n},"./node_modules/lodash.clonedeep/index.js":(e,t,r)=>{e=r.nmd(e);var n="__lodash_hash_undefined__",o=9007199254740991,u="[object Arguments]",i="[object Boolean]",a="[object Date]",c="[object Function]",s="[object GeneratorFunction]",l="[object Map]",f="[object Number]",d="[object Object]",_="[object Promise]",v="[object RegExp]",p="[object Set]",h="[object String]",b="[object Symbol]",y="[object WeakMap]",m="[object ArrayBuffer]",j="[object DataView]",g="[object Float32Array]",w="[object Float64Array]",O="[object Int8Array]",A="[object Int16Array]",x="[object Int32Array]",S="[object Uint8Array]",R="[object Uint8ClampedArray]",U="[object Uint16Array]",I="[object Uint32Array]",$=/\w*$/,k=/^\[object .+?Constructor\]$/,F=/^(?:0|[1-9]\d*)$/,P={};P[u]=P["[object Array]"]=P[m]=P[j]=P[i]=P[a]=P[g]=P[w]=P[O]=P[A]=P[x]=P[l]=P[f]=P[d]=P[v]=P[p]=P[h]=P[b]=P[S]=P[R]=P[U]=P[I]=!0,P["[object Error]"]=P[c]=P[y]=!1;var E="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,T="object"==typeof self&&self&&self.Object===Object&&self,z=E||T||Function("return this")(),V=t&&!t.nodeType&&t,B=V&&e&&!e.nodeType&&e,M=B&&B.exports===V;function C(e,t){return e.set(t[0],t[1]),e}function L(e,t){return e.add(t),e}function D(e,t,r,n){var o=-1,u=e?e.length:0;for(n&&u&&(r=e[++o]);++o-1},Re.prototype.set=function(e,t){var r=this.__data__,n=ke(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},Ue.prototype.clear=function(){this.__data__={hash:new Se,map:new(ve||Re),string:new Se}},Ue.prototype.delete=function(e){return Te(this,e).delete(e)},Ue.prototype.get=function(e){return Te(this,e).get(e)},Ue.prototype.has=function(e){return Te(this,e).has(e)},Ue.prototype.set=function(e,t){return Te(this,e).set(e,t),this},Ie.prototype.clear=function(){this.__data__=new Re},Ie.prototype.delete=function(e){return this.__data__.delete(e)},Ie.prototype.get=function(e){return this.__data__.get(e)},Ie.prototype.has=function(e){return this.__data__.has(e)},Ie.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Re){var n=r.__data__;if(!ve||n.length<199)return n.push([e,t]),this;r=this.__data__=new Ue(n)}return r.set(e,t),this};var Ve=le?G(le,Object):function(){return[]},Be=function(e){return te.call(e)};function Me(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||F.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=o}(e.length)&&!He(e)}var Ge=fe||function(){return!1};function He(e){var t=Qe(e)?te.call(e):"";return t==c||t==s}function Qe(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ke(e){return We(e)?function(e,t){var r=Ne(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&We(e)}(e)&&ee.call(e,"callee")&&(!ce.call(e,"callee")||te.call(e)==u)}(e)?function(e,t){for(var r=-1,n=Array(e);++r{e=r.nmd(e);var n="__lodash_hash_undefined__",o=9007199254740991,u="[object Arguments]",i="[object Array]",a="[object Boolean]",c="[object Date]",s="[object Error]",l="[object Function]",f="[object Map]",d="[object Number]",_="[object Object]",v="[object Promise]",p="[object RegExp]",h="[object Set]",b="[object String]",y="[object Symbol]",m="[object WeakMap]",j="[object ArrayBuffer]",g="[object DataView]",w=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,O=/^\w*$/,A=/^\./,x=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,S=/^\s+|\s+$/g,R=/\\(\\)?/g,U=/^[-+]0x[0-9a-f]+$/i,I=/^0b[01]+$/i,$=/^\[object .+?Constructor\]$/,k=/^0o[0-7]+$/i,F=/^(?:0|[1-9]\d*)$/,P={};P["[object Float32Array]"]=P["[object Float64Array]"]=P["[object Int8Array]"]=P["[object Int16Array]"]=P["[object Int32Array]"]=P["[object Uint8Array]"]=P["[object Uint8ClampedArray]"]=P["[object Uint16Array]"]=P["[object Uint32Array]"]=!0,P[u]=P[i]=P[j]=P[a]=P[g]=P[c]=P[s]=P[l]=P[f]=P[d]=P[_]=P[p]=P[h]=P[b]=P[m]=!1;var E=parseInt,T="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,z="object"==typeof self&&self&&self.Object===Object&&self,V=T||z||Function("return this")(),B=t&&!t.nodeType&&t,M=B&&e&&!e.nodeType&&e,C=M&&M.exports===B&&T.process,L=function(){try{return C&&C.binding("util")}catch(e){}}(),D=L&&L.isTypedArray;function N(e,t){for(var r=-1,n=e?e.length:0;++ra))return!1;var s=u.get(e);if(s&&u.get(t))return s==t;var l=-1,f=!0,d=1&o?new Ue:void 0;for(u.set(e,t),u.set(t,e);++l-1},Se.prototype.set=function(e,t){var r=this.__data__,n=$e(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},Re.prototype.clear=function(){this.__data__={hash:new xe,map:new(de||Se),string:new xe}},Re.prototype.delete=function(e){return Ve(this,e).delete(e)},Re.prototype.get=function(e){return Ve(this,e).get(e)},Re.prototype.has=function(e){return Ve(this,e).has(e)},Re.prototype.set=function(e,t){return Ve(this,e).set(e,t),this},Ue.prototype.add=Ue.prototype.push=function(e){return this.__data__.set(e,n),this},Ue.prototype.has=function(e){return this.__data__.has(e)},Ie.prototype.clear=function(){this.__data__=new Se},Ie.prototype.delete=function(e){return this.__data__.delete(e)},Ie.prototype.get=function(e){return this.__data__.get(e)},Ie.prototype.has=function(e){return this.__data__.has(e)},Ie.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Se){var n=r.__data__;if(!de||n.length<199)return n.push([e,t]),this;r=this.__data__=new Re(n)}return r.set(e,t),this};var Me=function(e){return ne.call(e)};function Ce(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||F.test(e))&&e>-1&&e%1==0&&e-1?n[o?e[u]:u]:void 0});function Xe(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],u=r.cache;if(u.has(o))return u.get(o);var i=e.apply(this,n);return r.cache=u.set(o,i),i};return r.cache=new(Xe.Cache||Re),r}function qe(e,t){return e===t||e!=e&&t!=t}function Je(e){return function(e){return nt(e)&&Ye(e)}(e)&&re.call(e,"callee")&&(!ae.call(e,"callee")||ne.call(e)==u)}Xe.Cache=Re;var Ze=Array.isArray;function Ye(e){return null!=e&&tt(e.length)&&!et(e)}function et(e){var t=rt(e)?ne.call(e):"";return t==l||"[object GeneratorFunction]"==t}function tt(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function rt(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function nt(e){return!!e&&"object"==typeof e}function ot(e){return"symbol"==typeof e||nt(e)&&ne.call(e)==y}var ut=D?function(e){return function(t){return e(t)}}(D):function(e){return nt(e)&&tt(e.length)&&!!P[ne.call(e)]};function it(e){return Ye(e)?function(e,t){var r=Ze(e)||Je(e)?function(e,t){for(var r=-1,n=Array(e);++r{var t=9007199254740991,r=/^(?:0|[1-9]\d*)$/,n=Object.prototype,o=n.hasOwnProperty,u=n.toString,i=n.propertyIsEnumerable;function a(e,n){return!!(n=null==n?t:n)&&("number"==typeof e||r.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=t}(e.length)&&!function(e){var t=l(e)?u.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}(e)}function l(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function f(e){return s(e)?function(e,t){var r=c(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&s(e)}(e)&&o.call(e,"callee")&&(!i.call(e,"callee")||"[object Arguments]"==u.call(e))}(e)?function(e,t){for(var r=-1,n=Array(e);++r{e.exports=function(e){return null==e}},"./node_modules/lodash.map/index.js":(e,t,r)=>{e=r.nmd(e);var n="__lodash_hash_undefined__",o=9007199254740991,u="[object Arguments]",i="[object Array]",a="[object Boolean]",c="[object Date]",s="[object Error]",l="[object Function]",f="[object Map]",d="[object Number]",_="[object Object]",v="[object Promise]",p="[object RegExp]",h="[object Set]",b="[object String]",y="[object Symbol]",m="[object WeakMap]",j="[object ArrayBuffer]",g="[object DataView]",w=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,O=/^\w*$/,A=/^\./,x=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,S=/\\(\\)?/g,R=/^\[object .+?Constructor\]$/,U=/^(?:0|[1-9]\d*)$/,I={};I["[object Float32Array]"]=I["[object Float64Array]"]=I["[object Int8Array]"]=I["[object Int16Array]"]=I["[object Int32Array]"]=I["[object Uint8Array]"]=I["[object Uint8ClampedArray]"]=I["[object Uint16Array]"]=I["[object Uint32Array]"]=!0,I[u]=I[i]=I[j]=I[a]=I[g]=I[c]=I[s]=I[l]=I[f]=I[d]=I[_]=I[p]=I[h]=I[b]=I[m]=!1;var $="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,k="object"==typeof self&&self&&self.Object===Object&&self,F=$||k||Function("return this")(),P=t&&!t.nodeType&&t,E=P&&e&&!e.nodeType&&e,T=E&&E.exports===P&&$.process,z=function(){try{return T&&T.binding("util")}catch(e){}}(),V=z&&z.isTypedArray;function B(e,t){for(var r=-1,n=e?e.length:0,o=Array(n);++r-1},ge.prototype.set=function(e,t){var r=this.__data__,n=xe(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},we.prototype.clear=function(){this.__data__={hash:new je,map:new(ae||ge),string:new je}},we.prototype.delete=function(e){return Te(this,e).delete(e)},we.prototype.get=function(e){return Te(this,e).get(e)},we.prototype.has=function(e){return Te(this,e).has(e)},we.prototype.set=function(e,t){return Te(this,e).set(e,t),this},Oe.prototype.add=Oe.prototype.push=function(e){return this.__data__.set(e,n),this},Oe.prototype.has=function(e){return this.__data__.has(e)},Ae.prototype.clear=function(){this.__data__=new ge},Ae.prototype.delete=function(e){return this.__data__.delete(e)},Ae.prototype.get=function(e){return this.__data__.get(e)},Ae.prototype.has=function(e){return this.__data__.has(e)},Ae.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ge){var n=r.__data__;if(!ae||n.length<199)return n.push([e,t]),this;r=this.__data__=new we(n)}return r.set(e,t),this};var Se,Re=(Se=function(e,t){return e&&Ue(e,t,rt)},function(e,t){if(null==e)return e;if(!Xe(e))return Se(e,t);for(var r=e.length,n=-1,o=Object(e);++na))return!1;var s=u.get(e);if(s&&u.get(t))return s==t;var l=-1,f=!0,d=1&o?new Oe:void 0;for(u.set(e,t),u.set(t,e);++l-1&&e%1==0&&e-1&&e%1==0&&e<=o}function Ze(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ye(e){return!!e&&"object"==typeof e}function et(e){return"symbol"==typeof e||Ye(e)&&Y.call(e)==y}var tt=V?function(e){return function(t){return e(t)}}(V):function(e){return Ye(e)&&Je(e.length)&&!!I[Y.call(e)]};function rt(e){return Xe(e)?function(e,t){var r=Ke(e)||Qe(e)?function(e,t){for(var r=-1,n=Array(e);++r{e=r.nmd(e);var n="__lodash_hash_undefined__",o=9007199254740991,u="[object Arguments]",i="[object Function]",a="[object Object]",c=/^\[object .+?Constructor\]$/,s=/^(?:0|[1-9]\d*)$/,l={};l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l[u]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object Boolean]"]=l["[object DataView]"]=l["[object Date]"]=l["[object Error]"]=l[i]=l["[object Map]"]=l["[object Number]"]=l[a]=l["[object RegExp]"]=l["[object Set]"]=l["[object String]"]=l["[object WeakMap]"]=!1;var f="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,d="object"==typeof self&&self&&self.Object===Object&&self,_=f||d||Function("return this")(),v=t&&!t.nodeType&&t,p=v&&e&&!e.nodeType&&e,h=p&&p.exports===v,b=h&&f.process,y=function(){try{return p&&p.require&&p.require("util").types||b&&b.binding&&b.binding("util")}catch(e){}}(),m=y&&y.isTypedArray;function j(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var g,w,O,A=Array.prototype,x=Function.prototype,S=Object.prototype,R=_["__core-js_shared__"],U=x.toString,I=S.hasOwnProperty,$=(g=/[^.]+$/.exec(R&&R.keys&&R.keys.IE_PROTO||""))?"Symbol(src)_1."+g:"",k=S.toString,F=U.call(Object),P=RegExp("^"+U.call(I).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),E=h?_.Buffer:void 0,T=_.Symbol,z=_.Uint8Array,V=(E&&E.allocUnsafe,w=Object.getPrototypeOf,O=Object,function(e){return w(O(e))}),B=Object.create,M=S.propertyIsEnumerable,C=A.splice,L=T?T.toStringTag:void 0,D=function(){try{var e=ae(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),N=E?E.isBuffer:void 0,W=Math.max,G=Date.now,H=ae(_,"Map"),Q=ae(Object,"create"),K=function(){function e(){}return function(t){if(!me(t))return{};if(B)return B(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function X(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1},q.prototype.set=function(e,t){var r=this.__data__,n=te(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},J.prototype.clear=function(){this.size=0,this.__data__={hash:new X,map:new(H||q),string:new X}},J.prototype.delete=function(e){var t=ie(this,e).delete(e);return this.size-=t?1:0,t},J.prototype.get=function(e){return ie(this,e).get(e)},J.prototype.has=function(e){return ie(this,e).has(e)},J.prototype.set=function(e,t){var r=ie(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Z.prototype.clear=function(){this.__data__=new q,this.size=0},Z.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Z.prototype.get=function(e){return this.__data__.get(e)},Z.prototype.has=function(e){return this.__data__.has(e)},Z.prototype.set=function(e,t){var r=this.__data__;if(r instanceof q){var n=r.__data__;if(!H||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new J(n)}return r.set(e,t),this.size=r.size,this};function ne(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":L&&L in Object(e)?function(e){var t=I.call(e,L),r=e[L];try{e[L]=void 0;var n=!0}catch(e){}var o=k.call(e);return n&&(t?e[L]=r:delete e[L]),o}(e):function(e){return k.call(e)}(e)}function oe(e){return je(e)&&ne(e)==u}function ue(e,t,r,n,o){e!==t&&function(e,t,r){for(var n=-1,o=Object(e),u=r(e),i=u.length;i--;){var a=u[++n];if(!1===t(o[a],a,o))break}}(t,(function(u,i){if(o||(o=new Z),me(u))!function(e,t,r,n,o,u,i){var c=le(e,r),s=le(t,r),l=i.get(s);if(l)Y(e,r,l);else{var f,d,_,v,p,h=u?u(c,s,r+"",e,t,i):void 0,b=void 0===h;if(b){var y=ve(s),m=!y&&he(s),j=!y&&!m&&ge(s);h=s,y||m||j?ve(c)?h=c:je(p=c)&&pe(p)?h=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r-1&&e%1==0&&e0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(D?function(e,t){return D(e,"toString",{configurable:!0,enumerable:!1,value:(r=t,function(){return r}),writable:!0});var r}:xe);function de(e,t){return e===t||e!=e&&t!=t}var _e=oe(function(){return arguments}())?oe:function(e){return je(e)&&I.call(e,"callee")&&!M.call(e,"callee")},ve=Array.isArray;function pe(e){return null!=e&&ye(e.length)&&!be(e)}var he=N||function(){return!1};function be(e){if(!me(e))return!1;var t=ne(e);return t==i||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ye(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function me(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function je(e){return null!=e&&"object"==typeof e}var ge=m?function(e){return function(t){return e(t)}}(m):function(e){return je(e)&&ye(e.length)&&!!l[ne(e)]};function we(e){return pe(e)?function(e,t){var r=ve(e),n=!r&&_e(e),o=!r&&!n&&he(e),u=!r&&!n&&!o&&ge(e),i=r||n||o||u,a=i?function(e,t){for(var r=-1,n=Array(e);++r1?t[n-1]:void 0,u=n>2?t[2]:void 0;for(o=Oe.length>3&&"function"==typeof o?(n--,o):void 0,u&&function(e,t,r){if(!me(r))return!1;var n=typeof t;return!!("number"==n?pe(r)&&ce(t,r.length):"string"==n&&t in r)&&de(r[t],e)}(t[0],t[1],u)&&(o=n<3?void 0:o,n=1),e=Object(e);++r{var t=9007199254740991,r=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,u=/^0o[0-7]+$/i,i=/^(?:0|[1-9]\d*)$/,a=parseFloat,c=parseInt,s=Object.prototype.toString,l=Math.floor,f=Math.min,d=Math.random;function _(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function v(e){return e?Infinity===(e=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==s.call(e)}(e))return NaN;if(_(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=_(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(r,"");var i=o.test(e);return i||u.test(e)?c(e.slice(2),i?2:8):n.test(e)?NaN:+e}(e))||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}e.exports=function(e,r,n){if(n&&"boolean"!=typeof n&&function(e,r,n){if(!_(n))return!1;var o=typeof r;return!!("number"==o?function(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=t}(e.length)&&!function(e){var t=_(e)?s.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}(e)}(n)&&function(e,r){return!!(r=null==r?t:r)&&("number"==typeof e||i.test(e))&&e>-1&&e%1==0&&er){var o=e;e=r,r=o}if(n||e%1||r%1){var u=d();return f(e+u*(r-e+a("1e-"+((u+"").length-1))),r)}return function(e,t){return e+l(d()*(t-e+1))}(e,r)}},"./node_modules/lodash.values/index.js":e=>{var t=9007199254740991,r=/^(?:0|[1-9]\d*)$/;var n,o,u=Object.prototype,i=u.hasOwnProperty,a=u.toString,c=u.propertyIsEnumerable,s=(n=Object.keys,o=Object,function(e){return n(o(e))});function l(e,n){return!!(n=null==n?t:n)&&("number"==typeof e||r.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=t}(e.length)&&!function(e){var t=function(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}(e)?a.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}(e)}e.exports=function(e){return e?function(e,t){return function(t,r){for(var n=-1,o=t?t.length:0,u=Array(o);++n{var o=n("./node_modules/@flowjs/flow.js/src/flow.js");angular.module("flow.provider",[]).provider("flowFactory",(function(){"use strict";this.defaults={},this.factory=function(e){return new o(e)},this.events=[],this.on=function(e,t){this.events.push([e,t])},this.$get=function(){var e=this.factory,t=this.defaults,n=this.events;return{create:function(o){var r=e(angular.extend({},t,o));return angular.forEach(n,(function(e){r.on(e[0],e[1])})),r}}}})),angular.module("flow.init",["flow.provider"]).controller("flowCtrl",["$scope","$attrs","$parse","flowFactory",function(e,t,n,o){var r=angular.extend({},e.$eval(t.flowInit)),s=e.$eval(t.flowObject)||o.create(r),a=function(t){var n=Array.prototype.slice.call(arguments);n.shift();var o=e.$broadcast.apply(e,["flow::"+t,s].concat(n));if({progress:1,filesSubmitted:1,fileSuccess:1,fileError:1,complete:1}[t]&&e.$applyAsync(),o.defaultPrevented)return!1};s.on("catchAll",a),e.$on("$destroy",(function(){s.off("catchAll",a)})),e.$flow=s,t.hasOwnProperty("flowName")&&(n(t.flowName).assign(e,s),e.$on("$destroy",(function(){n(t.flowName).assign(e)})))}]).directive("flowInit",[function(){return{scope:!0,controller:"flowCtrl"}}]),angular.module("flow.btn",["flow.init"]).directive("flowBtn",[function(){return{restrict:"EA",scope:!1,require:"^flowInit",link:function(e,t,n){var o=n.hasOwnProperty("flowDirectory"),r=n.hasOwnProperty("flowSingleFile"),s=n.hasOwnProperty("flowAttrs")&&e.$eval(n.flowAttrs);e.$flow.assignBrowse(t,o,r,s)}}}]),angular.module("flow.dragEvents",["flow.init"]).directive("flowPreventDrop",(function(){return{scope:!1,link:function(e,t,n){t.bind("drop dragover",(function(e){e.preventDefault()}))}}})).directive("flowDragEnter",["$timeout",function(e){return{scope:!1,link:function(t,n,o){var r,s=!1;n.bind("dragover",(function(n){var a,i,d;i=!1,d=(a=n).dataTransfer||a.originalEvent.dataTransfer,angular.forEach(d&&d.types,(function(e){"Files"===e&&(i=!0)})),i&&(s||(t.$apply(o.flowDragEnter),s=!0),e.cancel(r),n.preventDefault())})),n.bind("dragleave drop",(function(n){e.cancel(r),r=e((function(){t.$eval(o.flowDragLeave),r=null,s=!1}),100)}))}}}]),angular.module("flow.drop",["flow.init"]).directive("flowDrop",(function(){return{scope:!1,require:"^flowInit",link:function(e,t,n){function o(){e.$flow.assignDrop(t)}n.flowDropEnabled?e.$watch(n.flowDropEnabled,(function(n){n?o():e.$flow.unAssignDrop(t)})):o()}}})),function(e){"use strict";var t=e.module("flow.events",["flow.init"]);e.forEach({fileSuccess:["$file","$message"],fileProgress:["$file"],fileAdded:["$file","$event"],filesAdded:["$files","$event"],filesSubmitted:["$files","$event"],fileRetry:["$file"],fileRemoved:["$file"],fileError:["$file","$message"],uploadStart:[],complete:[],progress:[],error:["$message","$file"]},(function(n,o){var r,s="flow"+((r=o).charAt(0).toUpperCase()+r.slice(1));"flowUploadStart"==s&&(s="flowUploadStarted"),t.directive(s,[function(){return{require:"^flowInit",controller:["$scope","$attrs",function(t,r){t.$on("flow::"+o,(function(){var o=Array.prototype.slice.call(arguments),a=o.shift();if(t.$flow===o.shift()){var i={};e.forEach(n,(function(e,t){i[e]=o[t]})),!1===t.$eval(r[s],i)&&a.preventDefault()}}))}]}}])}))}(angular),angular.module("flow.img",["flow.init"]).directive("flowImg",[function(){return{scope:!1,require:"^flowInit",link:function(e,t,n){var o=n.flowImg;e.$watch(o,(function(t){if(t){var o=new FileReader;o.readAsDataURL(t.file),o.onload=function(t){e.$apply((function(){n.$set("src",t.target.result)}))}}}))}}}]),angular.module("flow.transfers",["flow.init"]).directive("flowTransfers",[function(){return{scope:!0,require:"^flowInit",link:function(e){e.transfers=e.$flow.files}}}]),angular.module("flow",["flow.provider","flow.init","flow.events","flow.btn","flow.drop","flow.transfers","flow.img","flow.dragEvents"])},"./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js":(e,t,n)=>{"use strict";var o,r=n("./node_modules/@uirouter/core/lib-esm/index.js"),s=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js"),a=n("./node_modules/@uirouter/angularjs/lib-esm/services.js"),i=n("./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js");function d(e,t,n,o,i){var d=(0,r.parse)("viewDecl.controllerAs"),u=(0,r.parse)("viewDecl.resolveAs");return{restrict:"ECA",priority:-400,compile:function(o){var m=o.html();return o.empty(),function(o,_){var c=_.data("$uiView");if(!c)return _.html(m),void e(_.contents())(o);var h=c.$cfg||{viewDecl:{},getTemplate:r.noop},f=h.path&&new r.ResolveContext(h.path);_.html(h.getTemplate(_,f)||m),r.trace.traceUIViewFill(c.$uiView,_.html());var p=e(_.contents()),M=h.controller,y=d(h),L=u(h),g=f&&(0,a.D)(f);if(o[L]=g,M){var Y=t(M,(0,r.extend)({},g,{$scope:o,$element:_}));y&&(o[y]=Y,o[y][L]=g),_.data("$ngControllerController",Y),_.children().data("$ngControllerController",Y),l(i,n,Y,o,h)}if((0,r.isString)(h.component))var v=(0,r.kebobString)(h.component),k=new RegExp("^(x-|data-)?"+v+"$","i"),j=o.$watch((function(){var e=[].slice.call(_[0].children).filter((function(e){return e&&e.tagName&&k.exec(e.tagName)}));return e&&s.ng.element(e).data("$"+h.component+"Controller")}),(function(e){e&&(l(i,n,e,o,h),j())}));p(o)}}}}o=["$view","$animate","$uiViewScroll","$interpolate","$q",function(e,t,n,o,a){var d={$cfg:{viewDecl:{$context:e._pluginapi._rootViewContext()}},$uiView:{}},u={count:0,restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(m,l,_){return function(m,l,c){var h,f,p,M,y=c.onload||"",L=c.autoscroll,g=function(e,n,o){s.ng.version.minor>2?t.enter(e,null,n).then(o):t.enter(e,null,n,o)},Y=function(e,n){s.ng.version.minor>2?t.leave(e).then(n):t.leave(e,n)},v=l.inheritedData("$uiView")||d,k=o(c.uiView||c.name||"")(m)||"$default",j={$type:"ng1",id:u.count++,name:k,fqn:v.$uiView.fqn?v.$uiView.fqn+"."+k:k,config:null,configUpdated:function(e){(!e||e instanceof i.qO)&&(M!==e&&(r.trace.traceUIViewConfigUpdated(j,e&&e.viewDecl&&e.viewDecl.$context),M=e,b(e)))},get creationContext(){var e=(0,r.parse)("$cfg.viewDecl.$context")(v),t=(0,r.parse)("$uiView.creationContext")(v);return e||t}};r.trace.traceUIViewEvent("Linking",j),l.data("$uiView",{$uiView:j}),b();var w=e.registerUIView(j);function b(e){var t=m.$new(),o=a.defer(),s=a.defer(),i={$cfg:e,$uiView:j},d={$animEnter:o.promise,$animLeave:s.promise,$$animLeave:s};t.$emit("$viewContentLoading",k);var u=_(t,(function(e){e.data("$uiViewAnim",d),e.data("$uiView",i),g(e,l,(function(){o.resolve(),p&&p.$emit("$viewContentAnimationEnded"),((0,r.isDefined)(L)&&!L||m.$eval(L))&&n(e)})),function(){if(h&&(r.trace.traceUIViewEvent("Removing (previous) el",h.data("$uiView")),h.remove(),h=null),p&&(r.trace.traceUIViewEvent("Destroying scope",j),p.$destroy(),p=null),f){var e=f.data("$uiViewAnim");r.trace.traceUIViewEvent("Animate out",e),Y(f,(function(){e.$$animLeave.resolve(),h=null})),h=f,f=null}}()}));f=u,(p=t).$emit("$viewContentLoaded",e||M),p.$eval(y)}m.$on("$destroy",(function(){r.trace.traceUIViewEvent("Destroying/Unregistering",j),w()}))}}};return u}],d.$inject=["$compile","$controller","$transitions","$view","$q"];var u="function"==typeof s.ng.module("ui.router").component,m=0;function l(e,t,n,o,s){!(0,r.isFunction)(n.$onInit)||(s.viewDecl.component||s.viewDecl.componentProvider)&&u||n.$onInit();var a=(0,r.tail)(s.path).state.self,i={bind:n};if((0,r.isFunction)(n.uiOnParamsChanged)){var d=new r.ResolveContext(s.path).getResolvable("$transition$").data;o.$on("$destroy",t.onSuccess({},(function(e){if(e!==d&&-1===e.exiting().indexOf(a)){var t=e.params("to"),o=e.params("from"),s=function(e){return e.paramSchema},i=e.treeChanges("to").map(s).reduce(r.unnestR,[]),u=e.treeChanges("from").map(s).reduce(r.unnestR,[]),m=i.filter((function(e){var n=u.indexOf(e);return-1===n||!u[n].type.equals(t[e.id],o[e.id])}));if(m.length){var l=m.map((function(e){return e.id})),_=(0,r.filter)(t,(function(e,t){return-1!==l.indexOf(t)}));n.uiOnParamsChanged(_,e)}}}),i))}if((0,r.isFunction)(n.uiCanExit)){var l=m++,_="_uiCanExitIds",c=function(e){return!!e&&(e[_]&&!0===e[_][l]||c(e.redirectedFrom()))},h={exiting:a.name};o.$on("$destroy",t.onBefore(h,(function(t){var o,r=t[_]=t[_]||{};return c(t)||(o=e.when(n.uiCanExit(t))).then((function(e){return r[l]=!1!==e})),o}),i))}}s.ng.module("ui.router.state").directive("uiView",o),s.ng.module("ui.router.state").directive("uiView",d)},"./node_modules/@uirouter/angularjs/lib-esm/interface.js":()=>{},"./node_modules/@uirouter/angularjs/lib-esm/services.js":(e,t,n)=>{"use strict";n.d(t,{D:()=>k});var o=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js"),r=n("./node_modules/@uirouter/core/lib-esm/index.js"),s=n("./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js"),a=function(){function e(){var e=this;this._useHttp=o.ng.version.minor<3,this.$get=["$http","$templateCache","$injector",function(t,n,o){return e.$templateRequest=o.has&&o.has("$templateRequest")&&o.get("$templateRequest"),e.$http=t,e.$templateCache=n,e}]}return e.prototype.useHttpService=function(e){this._useHttp=e},e.prototype.fromConfig=function(e,t,n){var o=function(e){return r.services.$q.when(e).then((function(e){return{template:e}}))},s=function(e){return r.services.$q.when(e).then((function(e){return{component:e}}))};return(0,r.isDefined)(e.template)?o(this.fromString(e.template,t)):(0,r.isDefined)(e.templateUrl)?o(this.fromUrl(e.templateUrl,t)):(0,r.isDefined)(e.templateProvider)?o(this.fromProvider(e.templateProvider,t,n)):(0,r.isDefined)(e.component)?s(e.component):(0,r.isDefined)(e.componentProvider)?s(this.fromComponentProvider(e.componentProvider,t,n)):o("")},e.prototype.fromString=function(e,t){return(0,r.isFunction)(e)?e(t):e},e.prototype.fromUrl=function(e,t){return(0,r.isFunction)(e)&&(e=e(t)),null==e?null:this._useHttp?this.$http.get(e,{cache:this.$templateCache,headers:{Accept:"text/html"}}).then((function(e){return e.data})):this.$templateRequest(e)},e.prototype.fromProvider=function(e,t,n){var o=r.services.$injector.annotate(e),s=(0,r.isArray)(e)?(0,r.tail)(e):e;return new r.Resolvable("",s,o).get(n)},e.prototype.fromComponentProvider=function(e,t,n){var o=r.services.$injector.annotate(e),s=(0,r.isArray)(e)?(0,r.tail)(e):e;return new r.Resolvable("",s,o).get(n)},e.prototype.makeComponentTemplate=function(e,t,n,s){s=s||{};var a=o.ng.version.minor>=3?"::":"",d=function(e){var t=(0,r.kebobString)(e);return/^(x|data)-/.exec(t)?"x-"+t:t},u=function(e){var t=r.services.$injector.get(e+"Directive");if(!t||!t.length)throw new Error("Unable to find component named '"+e+"'");return t.map(i).reduce(r.unnestR,[])}(n).map((function(n){var o=n.name,i=n.type,u=d(o);if(e.attr(u)&&!s[o])return u+"='"+e.attr(u)+"'";var m=s[o]||o;if("@"===i)return u+"='{{"+a+"$resolve."+m+"}}'";if("&"===i){var l=t.getResolvable(m),_=l&&l.data,c=_&&r.services.$injector.annotate(_)||[];return u+"='$resolve."+m+((0,r.isArray)(_)?"["+(_.length-1)+"]":"")+"("+c.join(",")+")'"}return u+"='"+a+"$resolve."+m+"'"})).join(" "),m=d(n);return"<"+m+" "+u+">"},e}(),i=function(e){return(0,r.isObject)(e.bindToController)?d(e.bindToController):d(e.scope)},d=function(e){return Object.keys(e||{}).map((function(t){return[t,/^([=<@&])[?]?(.*)/.exec(e[t])]})).filter((function(e){return(0,r.isDefined)(e)&&(0,r.isArray)(e[1])})).map((function(e){return{name:e[1][2]||e[0],type:e[1][1]}}))},u=n("./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js"),m=function(e){return function(t){var n=t[e],o="onExit"===e?"from":"to";return n?function(e,t){var s=new r.ResolveContext(e.treeChanges(o)).subContext(t.$$state()),a=(0,r.extend)(k(s),{$state$:t,$transition$:e});return r.services.$injector.invoke(n,this,a)}:void 0}},l=function(){function e(e){this._urlListeners=[],this.$locationProvider=e;var t=(0,r.val)(e);(0,r.createProxyFunctions)(t,this,t,["hashPrefix"])}return e.monkeyPatchPathParameterType=function(e){var t=e.urlMatcherFactory.type("path");t.encode=function(e){return null!=e?e.toString().replace(/(~|\/)/g,(function(e){return{"~":"~~","/":"~2F"}[e]})):e},t.decode=function(e){return null!=e?e.toString().replace(/(~~|~2F)/g,(function(e){return{"~~":"~","~2F":"/"}[e]})):e}},e.prototype.dispose=function(){},e.prototype.onChange=function(e){var t=this;return this._urlListeners.push(e),function(){return(0,r.removeFrom)(t._urlListeners)(e)}},e.prototype.html5Mode=function(){var e=this.$locationProvider.html5Mode();return(e=(0,r.isObject)(e)?e.enabled:e)&&this.$sniffer.history},e.prototype.baseHref=function(){return this._baseHref||(this._baseHref=this.$browser.baseHref()||this.$window.location.pathname)},e.prototype.url=function(e,t,n){return void 0===t&&(t=!1),(0,r.isDefined)(e)&&this.$location.url(e),t&&this.$location.replace(),n&&this.$location.state(n),this.$location.url()},e.prototype._runtimeServices=function(e,t,n,o,s){var a=this;this.$location=t,this.$sniffer=n,this.$browser=o,this.$window=s,e.$on("$locationChangeSuccess",(function(e){return a._urlListeners.forEach((function(t){return t(e)}))}));var i=(0,r.val)(t);(0,r.createProxyFunctions)(i,this,i,["replace","path","search","hash"]),(0,r.createProxyFunctions)(i,this,i,["port","protocol","host"])},e}(),_=n("./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js");o.ng.module("ui.router.angular1",[]);var c=o.ng.module("ui.router.init",["ng"]),h=o.ng.module("ui.router.util",["ui.router.init"]),f=o.ng.module("ui.router.router",["ui.router.util"]),p=o.ng.module("ui.router.state",["ui.router.router","ui.router.util","ui.router.angular1"]),M=o.ng.module("ui.router",["ui.router.init","ui.router.state","ui.router.angular1"]),y=(o.ng.module("ui.router.compat",["ui.router"]),null);function L(e){(y=this.router=new r.UIRouter).stateProvider=new u.X(y.stateRegistry,y.stateService),y.stateRegistry.decorator("views",s.LB),y.stateRegistry.decorator("onExit",m("onExit")),y.stateRegistry.decorator("onRetain",m("onRetain")),y.stateRegistry.decorator("onEnter",m("onEnter")),y.viewService._pluginapi._viewConfigFactory("ng1",(0,s.OB)()),y.urlService.config._decodeParams=!1;var t=y.locationService=y.locationConfig=new l(e);function n(e,n,o,r,s,a,i){return t._runtimeServices(s,e,r,n,o),delete y.router,delete y.$get,y}return l.monkeyPatchPathParameterType(y),y.router=y,y.$get=n,n.$inject=["$location","$browser","$window","$sniffer","$rootScope","$http","$templateCache"],y}L.$inject=["$locationProvider"];var g=function(e){return["$uiRouterProvider",function(t){var n=t.router[e];return n.$get=function(){return n},n}]};function Y(e,t,n){if(r.services.$injector=e,r.services.$q=t,!Object.prototype.hasOwnProperty.call(e,"strictDi"))try{e.invoke((function(e){}))}catch(t){e.strictDi=!!/strict mode/.exec(t&&t.toString())}n.stateRegistry.get().map((function(e){return e.$$state().resolvables})).reduce(r.unnestR,[]).filter((function(e){return"deferred"===e.deps})).forEach((function(t){return t.deps=e.annotate(t.resolveFn,e.strictDi)}))}function v(e){e.$watch((function(){r.trace.approximateDigests++}))}Y.$inject=["$injector","$q","$uiRouter"],v.$inject=["$rootScope"],c.provider("$uiRouter",L),f.provider("$urlRouter",["$uiRouterProvider",function(e){return e.urlRouterProvider=new _.L(e)}]),h.provider("$urlService",g("urlService")),h.provider("$urlMatcherFactory",["$uiRouterProvider",function(){return y.urlMatcherFactory}]),h.provider("$templateFactory",(function(){return new a})),p.provider("$stateRegistry",g("stateRegistry")),p.provider("$uiRouterGlobals",g("globals")),p.provider("$transitions",g("transitionService")),p.provider("$state",["$uiRouterProvider",function(){return(0,r.extend)(y.stateProvider,{$get:function(){return y.stateService}})}]),p.factory("$stateParams",["$uiRouter",function(e){return e.globals.params}]),M.factory("$view",(function(){return y.viewService})),M.service("$trace",(function(){return r.trace})),M.run(v),h.run(["$urlMatcherFactory",function(e){}]),p.run(["$state",function(e){}]),f.run(["$urlRouter",function(e){}]),c.run(Y);var k=function(e){return e.getTokens().filter(r.isString).map((function(t){var n=e.getResolvable(t);return[t,"NOWAIT"===e.getPolicy(n).async?n.promise:n.data]})).reduce(r.applyPairs,{})}},"./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js":(e,t,n)=>{"use strict";var o=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js");function r(e){var t=function(t,n,o){return e.is(t,n,o)};return t.$stateful=!0,t}function s(e){var t=function(t,n,o){return e.includes(t,n,o)};return t.$stateful=!0,t}r.$inject=["$state"],s.$inject=["$state"],o.ng.module("ui.router.state").filter("isState",r).filter("includedByState",s)},"./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js":(e,t,n)=>{"use strict";n.d(t,{X:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/index.js"),r=function(){function e(t,n){this.stateRegistry=t,this.stateService=n,(0,o.createProxyFunctions)((0,o.val)(e.prototype),this,(0,o.val)(this))}return e.prototype.decorator=function(e,t){return this.stateRegistry.decorator(e,t)||this},e.prototype.state=function(e,t){return(0,o.isObject)(e)?t=e:t.name=e,this.stateRegistry.register(t),this},e.prototype.onInvalid=function(e){return this.stateService.onInvalid(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js":(e,t,n)=>{"use strict";n.d(t,{OB:()=>r,LB:()=>a,qO:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/index.js");function r(){var e=null;return function(t,n){return e=e||o.services.$injector.get("$templateFactory"),[new d(t,n,e)]}}var s=function(e,t){return e.reduce((function(e,n){return e||(0,o.isDefined)(t[n])}),!1)};function a(e){if(!e.parent)return{};var t=["component","bindings","componentProvider"],n=["templateProvider","templateUrl","template","notify","async"].concat(["controller","controllerProvider","controllerAs","resolveAs"]),r=t.concat(n);if((0,o.isDefined)(e.views)&&s(r,e))throw new Error("State '"+e.name+"' has a 'views' object. It cannot also have \"view properties\" at the state level. Move the following properties into a view (in the 'views' object): "+r.filter((function(t){return(0,o.isDefined)(e[t])})).join(", "));var a={},i=e.views||{$default:(0,o.pick)(e,r)};return(0,o.forEach)(i,(function(r,i){if(i=i||"$default",(0,o.isString)(r)&&(r={component:r}),r=(0,o.extend)({},r),s(t,r)&&s(n,r))throw new Error("Cannot combine: "+t.join("|")+" with: "+n.join("|")+" in stateview: '"+i+"@"+e.name+"'");r.resolveAs=r.resolveAs||"$resolve",r.$type="ng1",r.$context=e,r.$name=i;var d=o.ViewService.normalizeUIViewTarget(r.$context,r.$name);r.$uiViewName=d.uiViewName,r.$uiViewContextAnchor=d.uiViewContextAnchor,a[i]=r})),a}var i=0,d=function(){function e(e,t,n){var o=this;this.path=e,this.viewDecl=t,this.factory=n,this.$id=i++,this.loaded=!1,this.getTemplate=function(e,t){return o.component?o.factory.makeComponentTemplate(e,t,o.component,o.viewDecl.bindings):o.template}}return e.prototype.load=function(){var e=this,t=o.services.$q,n=new o.ResolveContext(this.path),r=this.path.reduce((function(e,t){return(0,o.extend)(e,t.paramValues)}),{}),s={template:t.when(this.factory.fromConfig(this.viewDecl,r,n)),controller:t.when(this.getController(n))};return t.all(s).then((function(t){return o.trace.traceViewServiceEvent("Loaded",e),e.controller=t.controller,(0,o.extend)(e,t.template),e}))},e.prototype.getController=function(e){var t=this.viewDecl.controllerProvider;if(!(0,o.isInjectable)(t))return this.viewDecl.controller;var n=o.services.$injector.annotate(t),r=(0,o.isArray)(t)?(0,o.tail)(t):t;return new o.Resolvable("",r,n).get(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/index.js"),r=function(){function e(e){this.router=e}return e.injectableHandler=function(e,t){return function(n){return o.services.$injector.invoke(t,null,{$match:n,$stateParams:e.globals.params})}},e.prototype.$get=function(){var e=this.router.urlService;return this.router.urlRouter.update(!0),e.interceptDeferred||e.listen(),this.router.urlRouter},e.prototype.rule=function(e){var t=this;if(!(0,o.isFunction)(e))throw new Error("'rule' must be a function");var n=new o.BaseUrlRule((function(){return e(o.services.$injector,t.router.locationService)}),o.identity);return this.router.urlService.rules.rule(n),this},e.prototype.otherwise=function(e){var t=this,n=this.router.urlService.rules;if((0,o.isString)(e))n.otherwise(e);else{if(!(0,o.isFunction)(e))throw new Error("'rule' must be a string or function");n.otherwise((function(){return e(o.services.$injector,t.router.locationService)}))}return this},e.prototype.when=function(t,n){return((0,o.isArray)(n)||(0,o.isFunction)(n))&&(n=e.injectableHandler(this.router,n)),this.router.urlService.rules.when(t,n),this},e.prototype.deferIntercept=function(e){this.router.urlService.deferIntercept(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/angularjs/lib-esm/angular.js").ng.module("ui.router.state").provider("$uiViewScroll",(function(){var e=!1;this.useAnchorScroll=function(){e=!0},this.$get=["$anchorScroll","$timeout",function(t,n){return e?t:function(e){return n((function(){e[0].scrollIntoView()}),0,!1)}}]}))},"./node_modules/@uirouter/core/lib-esm/common/common.js":(e,t,n)=>{"use strict";n.d(t,{Jz:()=>i,xZ:()=>u,Qs:()=>m,Ed:()=>l,l7:()=>_,fS:()=>c,yR:()=>h,ZT:()=>f,WR:()=>p,ED:()=>M,d3:()=>y,nA:()=>L,LH:()=>g,Wk:()=>Y,ce:()=>v,LQ:()=>k,mX:()=>j,ei:()=>w,CE:()=>b,hX:()=>D,sE:()=>T,js:()=>S,UI:()=>H,VO:()=>x,XC:()=>E,o8:()=>P,M7:()=>O,FN:()=>$,Ez:()=>A,v_:()=>R,UW:()=>F,sp:()=>W,ym:()=>C,bb:()=>I,Gb:()=>z,JG:()=>J,HX:()=>V,jv:()=>N});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),a=function(){for(var e=0,t=0,n=arguments.length;t=0&&e.splice(n,1),e})),g=(0,r.WA)((function(e,t){return e.push(t),t})),Y=function(e){return e.slice().forEach((function(t){"function"==typeof t&&t(),L(e,t)}))};function v(e){for(var t=[],n=1;n{"use strict";n.d(t,{H:()=>o,u:()=>r});var o=function(e,t){return t.reduce((function(t,n){return t[n]=(o=e+"."+n+"()",function(){throw new Error("No implementation for "+o+". The framework specific code did not implement this method.")}),t;var o}),{})},r={$q:void 0,$injector:void 0}},"./node_modules/@uirouter/core/lib-esm/common/glob.js":(e,t,n)=>{"use strict";n.d(t,{r:()=>o});var o=function(){function e(e){this.text=e,this.glob=e.split(".");var t=this.text.split(".").map((function(e){return"**"===e?"(?:|(?:\\.[^.]*)*)":"*"===e?"\\.[^.]*":"\\."+e})).join("");this.regexp=new RegExp("^"+t+"$")}return e.is=function(e){return!!/[!,*]+/.exec(e)},e.fromString=function(t){return e.is(t)?new e(t):null},e.prototype.matches=function(e){return this.regexp.test("."+e)},e}()},"./node_modules/@uirouter/core/lib-esm/common/hof.js":(e,t,n)=>{"use strict";n.d(t,{WA:()=>r,zG:()=>a,vg:()=>i,OH:()=>d,Qc:()=>u,ff:()=>m,xD:()=>l,or:()=>_,$6:()=>c,Yj:()=>h,is:()=>f,P0:()=>p,uj:()=>M});var o=function(){for(var e=0,t=0,n=arguments.length;t=e.length)return e.apply(this,arguments);var n=Array.prototype.slice.call(arguments);return t.bind.apply(t,o([this],n))}}function s(){var e=arguments,t=e.length-1;return function(){for(var n=t,o=e[t].apply(this,arguments);n--;)o=e[n].call(this,o);return o}}function a(){for(var e=[],t=0;t{"use strict";n.d(t,{o8:()=>a,$K:()=>i,Ft:()=>d,le:()=>u,mf:()=>m,hj:()=>l,HD:()=>_,Kn:()=>c,kJ:()=>h,J_:()=>f,Kj:()=>p,Qh:()=>M,tI:()=>y});var o=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),r=Object.prototype.toString,s=function(e){return function(t){return typeof t===e}},a=s("undefined"),i=(0,o.ff)(a),d=function(e){return null===e},u=(0,o.or)(d,a),m=s("function"),l=s("number"),_=s("string"),c=function(e){return null!==e&&"object"==typeof e},h=Array.isArray,f=function(e){return"[object Date]"===r.call(e)},p=function(e){return"[object RegExp]"===r.call(e)};function M(e){if(h(e)&&e.length){var t=e.slice(0,-1),n=e.slice(-1);return!(t.filter((0,o.ff)(_)).length||n.filter((0,o.ff)(m)).length)}return m(e)}var y=(0,o.xD)(c,(0,o.zG)((0,o.vg)("then"),m))},"./node_modules/@uirouter/core/lib-esm/common/queue.js":(e,t,n)=>{"use strict";n.d(t,{c:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=function(){function e(e,t){void 0===e&&(e=[]),void 0===t&&(t=null),this._items=e,this._limit=t,this._evictListeners=[],this.onEvict=(0,o.LH)(this._evictListeners)}return e.prototype.enqueue=function(e){var t=this._items;return t.push(e),this._limit&&t.length>this._limit&&this.evict(),e},e.prototype.evict=function(){var e=this._items.shift();return this._evictListeners.forEach((function(t){return t(e)})),e},e.prototype.dequeue=function(){if(this.size())return this._items.splice(0,1)[0]},e.prototype.clear=function(){var e=this._items;return this._items=[],e},e.prototype.size=function(){return this._items.length},e.prototype.remove=function(e){var t=this._items.indexOf(e);return t>-1&&this._items.splice(t,1)[0]},e.prototype.peekTail=function(){return this._items[this._items.length-1]},e.prototype.peekHead=function(){if(this.size())return this._items[0]},e}()},"./node_modules/@uirouter/core/lib-esm/common/safeConsole.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r={log:o.ZT,error:o.ZT,table:o.ZT},s="undefined"!=typeof document&&document.documentMode&&9===document.documentMode?window&&window.console?function(e){var t=function(t){return Function.prototype.bind.call(t,e)};return{log:t(e.log),error:t(e.log),table:t(e.log)}}(window.console):r:console.table&&console.error?console:function(e){var t=e.log.bind(e);return{log:t,error:e.error?e.error.bind(e):t,table:e.table?e.table.bind(e):t}}(console)},"./node_modules/@uirouter/core/lib-esm/common/strings.js":(e,t,n)=>{"use strict";n.d(t,{BS:()=>i,NE:()=>d,L$:()=>u,XF:()=>m,iC:()=>l,Pz:()=>h,Lb:()=>p,cW:()=>M,C7:()=>y,Fb:()=>L,HV:()=>g,PX:()=>Y,iV:()=>v});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js");function i(e,t){return t.length<=e?t:t.substr(0,e-3)+"..."}function d(e,t){for(;t.length{"use strict";n.d(t,{g4:()=>c});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/safeConsole.js");function d(e){if(!e)return"ui-view (defunct)";var t=e.creationContext?e.creationContext.name||"(root)":"(none)";return"[ui-view#"+e.id+" "+e.$type+":"+e.fqn+" ("+e.name+"@"+t+")]"}function u(e){return(0,s.hj)(e)?o[e]:o[o[e]]}!function(e){e[e.RESOLVE=0]="RESOLVE",e[e.TRANSITION=1]="TRANSITION",e[e.HOOK=2]="HOOK",e[e.UIVIEW=3]="UIVIEW",e[e.VIEWCONFIG=4]="VIEWCONFIG"}(o||(o={}));var m=(0,r.Qc)("$id"),l=(0,r.Qc)("router.$id"),_=function(e){return"Transition #"+m(e)+"-"+l(e)},c=new(function(){function e(){this._enabled={},this.approximateDigests=0}return e.prototype._set=function(e,t){var n=this;t.length||(t=Object.keys(o).map((function(e){return parseInt(e,10)})).filter((function(e){return!isNaN(e)})).map((function(e){return o[e]}))),t.map(u).forEach((function(t){return n._enabled[t]=e}))},e.prototype.enable=function(){for(var e=[],t=0;t "+(0,a.Pz)(e))},e.prototype.traceTransitionIgnored=function(e){this.enabled(o.TRANSITION)&&i.L.log(_(e)+": Ignored <> "+(0,a.Pz)(e))},e.prototype.traceHookInvocation=function(e,t,n){if(this.enabled(o.HOOK)){var s=(0,r.Qc)("traceData.hookType")(n)||"internal",d=(0,r.Qc)("traceData.context.state.name")(n)||(0,r.Qc)("traceData.context")(n)||"unknown",u=(0,a.XF)(e.registeredHook.callback);i.L.log(_(t)+": Hook -> "+s+" context: "+d+", "+(0,a.BS)(200,u))}},e.prototype.traceHookResult=function(e,t,n){this.enabled(o.HOOK)&&i.L.log(_(t)+": <- Hook returned: "+(0,a.BS)(200,(0,a.Pz)(e)))},e.prototype.traceResolvePath=function(e,t,n){this.enabled(o.RESOLVE)&&i.L.log(_(n)+": Resolving "+e+" ("+t+")")},e.prototype.traceResolvableResolved=function(e,t){this.enabled(o.RESOLVE)&&i.L.log(_(t)+": <- Resolved "+e+" to: "+(0,a.BS)(200,(0,a.Pz)(e.data)))},e.prototype.traceError=function(e,t){this.enabled(o.TRANSITION)&&i.L.log(_(t)+": <- Rejected "+(0,a.Pz)(t)+", reason: "+e)},e.prototype.traceSuccess=function(e,t){this.enabled(o.TRANSITION)&&i.L.log(_(t)+": <- Success "+(0,a.Pz)(t)+", final state: "+e.name)},e.prototype.traceUIViewEvent=function(e,t,n){void 0===n&&(n=""),this.enabled(o.UIVIEW)&&i.L.log("ui-view: "+(0,a.NE)(30,e)+" "+d(t)+n)},e.prototype.traceUIViewConfigUpdated=function(e,t){this.enabled(o.UIVIEW)&&this.traceUIViewEvent("Updating",e," with ViewConfig from context='"+t+"'")},e.prototype.traceUIViewFill=function(e,t){this.enabled(o.UIVIEW)&&this.traceUIViewEvent("Fill",e," with: "+(0,a.BS)(200,t))},e.prototype.traceViewSync=function(e){if(this.enabled(o.VIEWCONFIG)){var t="uiview component fqn",n=e.map((function(e){var n,o=e.uiView,r=e.viewConfig,s=o&&o.fqn,a=r&&r.viewDecl.$context.name+": ("+r.viewDecl.$name+")";return(n={})[t]=s,n["view config state (view name)"]=a,n})).sort((function(e,n){return(e[t]||"").localeCompare(n[t]||"")}));i.L.table(n)}},e.prototype.traceViewServiceEvent=function(e,t){this.enabled(o.VIEWCONFIG)&&i.L.log("VIEWCONFIG: "+e+" "+function(e){var t=e.viewDecl,n=t.$context.name||"(root)";return"[View#"+e.$id+" from '"+n+"' state]: target ui-view: '"+t.$uiViewName+"@"+t.$uiViewContextAnchor+"'"}(t))},e.prototype.traceViewServiceUIViewEvent=function(e,t){this.enabled(o.VIEWCONFIG)&&i.L.log("VIEWCONFIG: "+e+" "+d(t))},e}())},"./node_modules/@uirouter/core/lib-esm/globals.js":(e,t,n)=>{"use strict";n.d(t,{k:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/params/stateParams.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/queue.js"),s=function(){function e(){this.params=new o.i,this.lastStartedTransitionId=-1,this.transitionHistory=new r.c([],1),this.successfulTransitions=new r.c([],1)}return e.prototype.dispose=function(){this.transitionHistory.clear(),this.successfulTransitions.clear(),this.transition=null},e}()},"./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js":(e,t,n)=>{"use strict";n.d(t,{v:()=>s,A:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),r=function(e){var t=e.router,n=e.entering().filter((function(e){return!!e.$$state().lazyLoad})).map((function(t){return a(e,t)}));return o.u.$q.all(n).then((function(){if("url"!==e.originalTransition().options().source){var n=e.targetState();return t.stateService.target(n.identifier(),n.params(),n.options())}var o=t.urlService,r=o.match(o.parts()),s=r&&r.rule;if(s&&"STATE"===s.type){var a=s.state,i=r.match;return t.stateService.target(a,i,e.options())}t.urlService.sync()}))},s=function(e){return e.onBefore({entering:function(e){return!!e.lazyLoad}},r)};function a(e,t){var n=t.$$state().lazyLoad,r=n._promise;return r||(r=n._promise=o.u.$q.when(n(e,t)).then((function(t){return t&&Array.isArray(t.states)&&t.states.forEach((function(t){return e.router.stateRegistry.register(t)})),t})).then((function(e){return delete t.lazyLoad,delete t.$$state().lazyLoad,delete n._promise,e}),(function(e){return delete n._promise,o.u.$q.reject(e)}))),r}},"./node_modules/@uirouter/core/lib-esm/interface.js":(e,t,n)=>{},"./node_modules/@uirouter/core/lib-esm/params/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/params/param.js":(e,t,n)=>{"use strict";n.d(t,{_:()=>o,d:()=>m});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),d=n("./node_modules/@uirouter/core/lib-esm/params/paramType.js"),u=Object.prototype.hasOwnProperty;!function(e){e[e.PATH=0]="PATH",e[e.SEARCH=1]="SEARCH",e[e.CONFIG=2]="CONFIG"}(o||(o={}));var m=function(){function e(e,t,n,i,m){var l=function(e,t,n){var s=!1===n.reloadOnSearch&&t===o.SEARCH||void 0,i=(0,r.sE)([n.dynamic,s],a.$K),d=(0,a.$K)(i)?{dynamic:i}:{},m=function(e){function t(){return e.value}e=function(e){return 0===["value","type","squash","array","dynamic"].filter(u.bind(e||{})).length}(e)?{value:e}:e,t.__cacheable=!0;var n=(0,a.Qh)(e.value)?e.value:t;return(0,r.l7)(e,{$$fn:n})}(n&&n.params&&n.params[e]);return(0,r.l7)(d,m)}(e,n,m);t=function(e,t,n,r,s){if(e.type&&t&&"string"!==t.name)throw new Error("Param '"+r+"' has two type configurations.");if(e.type&&t&&"string"===t.name&&s.type(e.type))return s.type(e.type);if(t)return t;if(!e.type){var a=n===o.CONFIG?"any":n===o.PATH?"path":n===o.SEARCH?"query":"string";return s.type(a)}return e.type instanceof d._?e.type:s.type(e.type)}(l,t,n,e,i.paramTypes);var _,c,h=(_={array:n===o.SEARCH&&"auto"},c=e.match(/\[\]$/)?{array:!0}:{},(0,r.l7)(_,c,l).array);t=h?t.$asArray(h,n===o.SEARCH):t;var f=void 0!==l.value||n===o.SEARCH,p=(0,a.$K)(l.dynamic)?!!l.dynamic:!!t.dynamic,M=(0,a.$K)(l.raw)?!!l.raw:!!t.raw,y=function(e,t,n){var o=e.squash;if(!t||!1===o)return!1;if(!(0,a.$K)(o)||null==o)return n;if(!0===o||(0,a.HD)(o))return o;throw new Error("Invalid squash policy: '"+o+"'. Valid policies: false, true, or arbitrary string")}(l,f,i.defaultSquashPolicy()),L=function(e,t,n,o){var i=[{from:"",to:n||t?void 0:""},{from:null,to:n||t?void 0:""}],d=(0,a.kJ)(e.replace)?e.replace:[];(0,a.HD)(o)&&d.push({from:o,to:void 0});var u=(0,r.UI)(d,(0,s.vg)("from"));return(0,r.hX)(i,(function(e){return-1===u.indexOf(e.from)})).concat(d)}(l,h,f,y),g=(0,a.$K)(l.inherit)?!!l.inherit:!!t.inherit;(0,r.l7)(this,{id:e,type:t,location:n,isOptional:f,dynamic:p,raw:M,squash:y,replace:L,inherit:g,array:h,config:l})}return e.values=function(e,t){void 0===t&&(t={});for(var n={},o=0,r=e;o{"use strict";n.d(t,{_:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=function(){function e(e){this.pattern=/.*/,this.inherit=!0,(0,o.l7)(this,e)}return e.prototype.is=function(e,t){return!0},e.prototype.encode=function(e,t){return e},e.prototype.decode=function(e,t){return e},e.prototype.equals=function(e,t){return e==t},e.prototype.$subPattern=function(){var e=this.pattern.toString();return e.substr(1,e.length-2)},e.prototype.toString=function(){return"{ParamType:"+this.name+"}"},e.prototype.$normalize=function(e){return this.is(e)?e:this.decode(e)},e.prototype.$asArray=function(e,t){if(!e)return this;if("auto"===e&&!t)throw new Error("'auto' array mode is for query parameters only");return new a(this,e)},e}();function a(e,t){var n=this;function s(e){return(0,r.kJ)(e)?e:(0,r.$K)(e)?[e]:[]}function a(e,n){return function(a){if((0,r.kJ)(a)&&0===a.length)return a;var i=s(a),d=(0,o.UI)(i,e);return!0===n?0===(0,o.hX)(d,(function(e){return!e})).length:function(e){switch(e.length){case 0:return;case 1:return"auto"===t?e[0]:e;default:return e}}(d)}}function i(e){return function(t,n){var o=s(t),r=s(n);if(o.length!==r.length)return!1;for(var a=0;a{"use strict";n.d(t,{p:()=>u});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),d=n("./node_modules/@uirouter/core/lib-esm/params/paramType.js"),u=function(){function e(){this.enqueue=!0,this.typeQueue=[],this.defaultTypes=(0,r.ei)(e.prototype,["hash","string","query","path","int","bool","date","json","any"]),this.types=(0,r.ED)((0,r.UI)(this.defaultTypes,(function(e,t){return new d._((0,r.l7)({name:t},e))})),{})}return e.prototype.dispose=function(){this.types={}},e.prototype.type=function(e,t,n){if(!(0,s.$K)(t))return this.types[e];if(this.types.hasOwnProperty(e))throw new Error("A type named '"+e+"' has already been defined.");return this.types[e]=new d._((0,r.l7)({name:e},t)),n&&(this.typeQueue.push({name:e,def:n}),this.enqueue||this._flushTypeQueue()),this},e.prototype._flushTypeQueue=function(){for(;this.typeQueue.length;){var e=this.typeQueue.shift();if(e.pattern)throw new Error("You cannot override a type's .pattern at runtime.");(0,r.l7)(this.types[e.name],i.u.$injector.invoke(e.def))}},e}();o=function(e){var t=function(e){return null!=e?e.toString():e},n={encode:t,decode:t,is:(0,a.is)(String),pattern:/.*/,equals:function(e,t){return e==t}};return(0,r.l7)({},n,e)},(0,r.l7)(u.prototype,{string:o({}),path:o({pattern:/[^/]*/}),query:o({}),hash:o({inherit:!1}),int:o({decode:function(e){return parseInt(e,10)},is:function(e){return!(0,s.le)(e)&&this.decode(e.toString())===e},pattern:/-?\d+/}),bool:o({encode:function(e){return e?1:0},decode:function(e){return 0!==parseInt(e,10)},is:(0,a.is)(Boolean),pattern:/0|1/}),date:o({encode:function(e){return this.is(e)?[e.getFullYear(),("0"+(e.getMonth()+1)).slice(-2),("0"+e.getDate()).slice(-2)].join("-"):void 0},decode:function(e){if(this.is(e))return e;var t=this.capture.exec(e);return t?new Date(t[1],t[2]-1,t[3]):void 0},is:function(e){return e instanceof Date&&!isNaN(e.valueOf())},equals:function(e,t){return["getFullYear","getMonth","getDate"].reduce((function(n,o){return n&&e[o]()===t[o]()}),!0)},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/}),json:o({encode:r.Qs,decode:r.xZ,is:(0,a.is)(Object),equals:r.fS,pattern:/[^/]*/}),any:o({encode:r.yR,decode:r.yR,is:function(){return!0},equals:r.fS})})},"./node_modules/@uirouter/core/lib-esm/params/stateParams.js":(e,t,n)=>{"use strict";n.d(t,{i:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=function(){function e(e){void 0===e&&(e={}),(0,o.l7)(this,e)}return e.prototype.$inherit=function(e,t,n){var r,s=(0,o.mX)(t,n),a={},i=[];for(var d in s)if(s[d]&&s[d].params&&(r=Object.keys(s[d].params)).length)for(var u in r)i.indexOf(r[u])>=0||(i.push(r[u]),a[r[u]]=this[r[u]]);return(0,o.l7)({},a,e)},e}()},"./node_modules/@uirouter/core/lib-esm/path/pathNode.js":(e,t,n)=>{"use strict";n.d(t,{V:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/params/param.js"),a=function(){function e(t){if(t instanceof e){var n=t;this.state=n.state,this.paramSchema=n.paramSchema.slice(),this.paramValues=(0,o.l7)({},n.paramValues),this.resolvables=n.resolvables.slice(),this.views=n.views&&n.views.slice()}else{var r=t;this.state=r,this.paramSchema=r.parameters({inherit:!1}),this.paramValues={},this.resolvables=r.resolvables.map((function(e){return e.clone()}))}}return e.prototype.clone=function(){return new e(this)},e.prototype.applyRawParams=function(e){return this.paramValues=this.paramSchema.reduce((function(t,n){return(0,o.bb)(t,[(r=n).id,r.value(e[r.id])]);var r}),{}),this},e.prototype.parameter=function(e){return(0,o.sE)(this.paramSchema,(0,r.OH)("id",e))},e.prototype.equals=function(e,t){var n=this.diff(e,t);return n&&0===n.length},e.prototype.diff=function(e,t){if(this.state!==e.state)return!1;var n=t?t(this):this.paramSchema;return s.d.changed(n,this.paramValues,e.paramValues)},e.clone=function(e){return e.clone()},e}()},"./node_modules/@uirouter/core/lib-esm/path/pathUtils.js":(e,t,n)=>{"use strict";n.d(t,{C:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),a=n("./node_modules/@uirouter/core/lib-esm/path/pathNode.js"),i=function(){function e(){}return e.makeTargetState=function(e,t){var n=(0,o.Gb)(t).state;return new s.F(e,n,t.map((0,r.vg)("paramValues")).reduce(o.LQ,{}),{})},e.buildPath=function(e){var t=e.params();return e.$state().path.map((function(e){return new a.V(e).applyRawParams(t)}))},e.buildToPath=function(t,n){var o=e.buildPath(n);return n.options().inherit?e.inheritParams(t,o,Object.keys(n.params())):o},e.applyViewConfigs=function(t,n,r){n.filter((function(e){return(0,o.d3)(r,e.state)})).forEach((function(r){var s=(0,o.VO)(r.state.views||{}),a=e.subPath(n,(function(e){return e===r})),i=s.map((function(e){return t.createViewConfig(a,e)}));r.views=i.reduce(o.M7,[])}))},e.inheritParams=function(e,t,n){void 0===n&&(n=[]);var s=e.map((function(e){return e.paramSchema})).reduce(o.M7,[]).filter((function(e){return!e.inherit})).map((0,r.vg)("id"));return t.map((function(t){var i=(0,o.l7)({},t&&t.paramValues),d=(0,o.ei)(i,n);i=(0,o.CE)(i,n);var u,m,l,_=(0,o.CE)((u=e,m=t.state,l=(0,o.sE)(u,(0,r.OH)("state",m)),(0,o.l7)({},l&&l.paramValues)||{}),s),c=(0,o.l7)(i,_,d);return new a.V(t.state).applyRawParams(c)}))},e.treeChanges=function(t,n,o){for(var r,s,a,i,d,u,m=Math.min(t.length,n.length),l=0;l{"use strict";n.d(t,{u:()=>o});var o={when:{LAZY:"LAZY",EAGER:"EAGER"},async:{WAIT:"WAIT",NOWAIT:"NOWAIT"}}},"./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js":(e,t,n)=>{"use strict";n.d(t,{X:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),d=function(){function e(t,n,s,a,d){if(this.resolved=!1,this.promise=void 0,t instanceof e)(0,o.l7)(this,t);else if((0,i.mf)(n)){if((0,i.le)(t))throw new Error("new Resolvable(): token argument is required");if(!(0,i.mf)(n))throw new Error("new Resolvable(): resolveFn argument must be a function");this.token=t,this.policy=a,this.resolveFn=n,this.deps=s||[],this.data=d,this.resolved=void 0!==d,this.promise=this.resolved?r.u.$q.when(this.data):void 0}else if((0,i.Kn)(t)&&t.token&&(t.hasOwnProperty("resolveFn")||t.hasOwnProperty("data"))){var u=t;return new e(u.token,u.resolveFn,u.deps,u.policy,u.data)}}return e.prototype.getPolicy=function(e){var t=this.policy||{},n=e&&e.resolvePolicy||{};return{when:t.when||n.when||"LAZY",async:t.async||n.async||"WAIT"}},e.prototype.resolve=function(e,t){var n=this,a=r.u.$q,d=e.findNode(this),u=d&&d.state,m=this.getPolicy(u).async,l=(0,i.mf)(m)?m:o.yR;return this.promise=a.when().then((function(){return a.all(e.getDependencies(n).map((function(n){return n.get(e,t)})))})).then((function(e){return n.resolveFn.apply(null,e)})).then(l).then((function(e){return n.data=e,n.resolved=!0,n.resolveFn=null,s.g4.traceResolvableResolved(n,t),n.data}))},e.prototype.get=function(e,t){return this.promise||this.resolve(e,t)},e.prototype.toString=function(){return"Resolvable(token: "+(0,a.Pz)(this.token)+", requires: ["+this.deps.map(a.Pz)+"])"},e.prototype.clone=function(){return new e(this)},e.fromData=function(t,n){return new e(t,(function(){return n}),null,null,n)},e}()},"./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js":(e,t,n)=>{"use strict";n.d(t,{l:()=>f});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/interface.js"),d=n("./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"),u=n("./node_modules/@uirouter/core/lib-esm/path/pathUtils.js"),m=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),l=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),_=i.u.when,c=[_.EAGER,_.LAZY],h=[_.EAGER],f=function(){function e(e){this._path=e}return e.prototype.getTokens=function(){return this._path.reduce((function(e,t){return e.concat(t.resolvables.map((function(e){return e.token})))}),[]).reduce(o.v_,[])},e.prototype.getResolvable=function(e){var t=this._path.map((function(e){return e.resolvables})).reduce(o.M7,[]).filter((function(t){return t.token===e}));return(0,o.Gb)(t)},e.prototype.getPolicy=function(e){var t=this.findNode(e);return e.getPolicy(t.state)},e.prototype.subContext=function(t){return new e(u.C.subPath(this._path,(function(e){return e.state===t})))},e.prototype.addResolvables=function(e,t){var n=(0,o.sE)(this._path,(0,r.OH)("state",t)),s=e.map((function(e){return e.token}));n.resolvables=n.resolvables.filter((function(e){return-1===s.indexOf(e.token)})).concat(e)},e.prototype.resolvePath=function(e,t){var n=this;void 0===e&&(e="LAZY");var d=((0,o.d3)(c,e)?e:"LAZY")===i.u.when.EAGER?h:c;s.g4.traceResolvePath(this._path,e,t);var u=function(e,t){return function(r){return(0,o.d3)(e,n.getPolicy(r)[t])}},m=this._path.reduce((function(e,o){var s=o.resolvables.filter(u(d,"when")),a=s.filter(u(["NOWAIT"],"async")),i=s.filter((0,r.ff)(u(["NOWAIT"],"async"))),m=n.subContext(o.state),l=function(e){return e.get(m,t).then((function(t){return{token:e.token,value:t}}))};return a.forEach(l),e.concat(i.map(l))}),[]);return a.u.$q.all(m)},e.prototype.injector=function(){return this._injector||(this._injector=new p(this))},e.prototype.findNode=function(e){return(0,o.sE)(this._path,(function(t){return(0,o.d3)(t.resolvables,e)}))},e.prototype.getDependencies=function(e){var t=this,n=this.findNode(e),r=(u.C.subPath(this._path,(function(e){return e===n}))||this._path).reduce((function(e,t){return e.concat(t.resolvables)}),[]).filter((function(t){return t!==e}));return e.deps.map((function(e){var n=r.filter((function(t){return t.token===e}));if(n.length)return(0,o.Gb)(n);var s=t.injector().getNative(e);if((0,l.wV)(s))throw new Error("Could not find Dependency Injection token: "+(0,m.Pz)(e));return new d.X(e,(function(){return s}),[],s)}))},e}(),p=function(){function e(e){this.context=e,this.native=this.get("Native Injector")||a.u.$injector}return e.prototype.get=function(e){var t=this.context.getResolvable(e);if(t){if("NOWAIT"===this.context.getPolicy(t).async)return t.get(this.context);if(!t.resolved)throw new Error("Resolvable async .get() not complete:"+(0,m.Pz)(t.token));return t.data}return this.getNative(e)},e.prototype.getAsync=function(e){var t=this.context.getResolvable(e);return t?t.get(this.context):a.u.$q.when(this.native.get(e))},e.prototype.getNative=function(e){return this.native&&this.native.get(e)},e}()},"./node_modules/@uirouter/core/lib-esm/router.js":(e,t,n)=>{"use strict";n.d(t,{a:()=>y});var o=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRouter.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/transitionService.js"),a=n("./node_modules/@uirouter/core/lib-esm/view/view.js"),i=n("./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js"),d=n("./node_modules/@uirouter/core/lib-esm/state/stateService.js"),u=n("./node_modules/@uirouter/core/lib-esm/globals.js"),m=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),l=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),_=n("./node_modules/@uirouter/core/lib-esm/url/urlService.js"),c=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),h=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),f=0,p=(0,h.HV)("LocationServices",["url","path","search","hash","onChange"]),M=(0,h.HV)("LocationConfig",["port","protocol","host","baseHref","html5Mode","hashPrefix"]),y=function(){function e(e,t){void 0===e&&(e=p),void 0===t&&(t=M),this.locationService=e,this.locationConfig=t,this.$id=f++,this._disposed=!1,this._disposables=[],this.trace=c.g4,this.viewService=new a.s(this),this.globals=new u.k,this.transitionService=new s.Z(this),this.urlMatcherFactory=new o.y(this),this.urlRouter=new r.g(this),this.urlService=new _.i(this),this.stateRegistry=new i.q(this),this.stateService=new d.b(this),this._plugins={},this.viewService._pluginapi._rootViewContext(this.stateRegistry.root()),this.globals.$current=this.stateRegistry.root(),this.globals.current=this.globals.$current.self,this.disposable(this.globals),this.disposable(this.stateService),this.disposable(this.stateRegistry),this.disposable(this.transitionService),this.disposable(this.urlService),this.disposable(e),this.disposable(t)}return e.prototype.disposable=function(e){this._disposables.push(e)},e.prototype.dispose=function(e){var t=this;e&&(0,l.mf)(e.dispose)?e.dispose(this):(this._disposed=!0,this._disposables.slice().forEach((function(e){try{"function"==typeof e.dispose&&e.dispose(t),(0,m.nA)(t._disposables,e)}catch(e){}})))},e.prototype.plugin=function(e,t){void 0===t&&(t={});var n=new e(this,t);if(!n.name)throw new Error("Required property `name` missing on plugin: "+n);return this._disposables.push(n),this._plugins[n.name]=n},e.prototype.getPlugin=function(e){return e?this._plugins[e]:(0,m.VO)(this._plugins)},e}()},"./node_modules/@uirouter/core/lib-esm/state/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js":(e,t,n)=>{"use strict";n.d(t,{t:()=>M});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js");function u(e){return e.name}function m(e){return e.self.$$state=function(){return e},e.self}function l(e){return e.parent&&e.parent.data&&(e.data=e.self.data=(0,o.ED)(e.parent.data,e.data)),e.data}var _=function(e,t){return function(n){var s=n.self;if(s&&s.url&&s.name&&s.name.match(/\.\*\*$/)){var a={};(0,o.JG)(s,a),a.url+="{remainder:any}",s=a}var i=n.parent,d=function(e){if(!(0,r.HD)(e))return!1;var t="^"===e.charAt(0);return{val:t?e.substring(1):e,root:t}}(s.url),u=d?e.compile(d.val,{state:s}):s.url;if(!u)return null;if(!e.isMatcher(u))throw new Error("Invalid url '"+u+"' in state '"+n+"'");return d&&d.root?u:(i&&i.navigable||t()).url.append(u)}},c=function(e){return function(t){return!e(t)&&t.url?t:t.parent?t.parent.navigable:null}};function h(e){return e.parent?e.parent.path.concat(e):[e]}function f(e){var t=e.parent?(0,o.l7)({},e.parent.includes):{};return t[e.name]=!0,t}function p(e){var t,n,u=function(e){return e.provide||e.token},m=(0,a.uj)([[(0,a.vg)("resolveFn"),function(e){return new i.X(u(e),e.resolveFn,e.deps,e.policy)}],[(0,a.vg)("useFactory"),function(e){return new i.X(u(e),e.useFactory,e.deps||e.dependencies,e.policy)}],[(0,a.vg)("useClass"),function(e){return new i.X(u(e),(function(){return new e.useClass}),[],e.policy)}],[(0,a.vg)("useValue"),function(e){return new i.X(u(e),(function(){return e.useValue}),[],e.policy,e.useValue)}],[(0,a.vg)("useExisting"),function(e){return new i.X(u(e),o.yR,[e.useExisting],e.policy)}]]),l=(0,a.uj)([[(0,a.zG)((0,a.vg)("val"),r.HD),function(e){return new i.X(e.token,o.yR,[e.val],e.policy)}],[(0,a.zG)((0,a.vg)("val"),r.kJ),function(e){return new i.X(e.token,(0,o.Gb)(e.val),e.val.slice(0,-1),e.policy)}],[(0,a.zG)((0,a.vg)("val"),r.mf),function(e){return new i.X(e.token,e.val,(t=e.val,n=d.u.$injector,t.$inject||n&&n.annotate(t,n.strictDi)||"deferred"),e.policy);var t,n}]]),_=(0,a.uj)([[(0,a.is)(i.X),function(e){return e}],[function(e){return!(!e.token||!e.resolveFn)},m],[function(e){return!(!e.provide&&!e.token||!(e.useValue||e.useFactory||e.useExisting||e.useClass))},m],[function(e){return!!(e&&e.val&&((0,r.HD)(e.val)||(0,r.kJ)(e.val)||(0,r.mf)(e.val)))},l],[(0,a.P0)(!0),function(e){throw new Error("Invalid resolve value: "+(0,s.Pz)(e))}]]),c=e.resolve;return((0,r.kJ)(c)?c:(t=c,n=e.resolvePolicy||{},Object.keys(t||{}).map((function(e){return{token:e,val:t[e],deps:void 0,policy:n[e]}})))).map(_)}var M=function(){function e(e,t){this.matcher=e;var n,r=this,s=function(){return e.find("")},i=function(e){return""===e.name};this.builders={name:[u],self:[m],parent:[function(t){return i(t)?null:e.find(r.parentName(t))||s()}],data:[l],url:[_(t,s)],navigable:[c(i)],params:[(n=t.paramFactory,function(e){var t=e.url&&e.url.parameters({inherit:!1})||[],r=(0,o.VO)((0,o.js)((0,o.CE)(e.params||{},t.map((0,a.vg)("id"))),(function(t,o){return n.fromConfig(o,null,e.self)})));return t.concat(r).map((function(e){return[e.id,e]})).reduce(o.bb,{})})],views:[],path:[h],includes:[f],resolvables:[p]}}return e.prototype.builder=function(e,t){var n=this.builders,o=n[e]||[];return(0,r.HD)(e)&&!(0,r.$K)(t)?o.length>1?o:o[0]:(0,r.HD)(e)&&(0,r.mf)(t)?(n[e]=o,n[e].push(t),function(){return n[e].splice(n[e].indexOf(t,1))&&null}):void 0},e.prototype.build=function(e){var t=this.matcher,n=this.builders,r=this.parentName(e);if(r&&!t.find(r,void 0,!1))return null;for(var s in n)if(n.hasOwnProperty(s)){var a=n[s].reduce((function(e,t){return function(n){return t(n,e)}}),o.ZT);e[s]=a(e)}return e},e.prototype.parentName=function(e){var t=e.name||"",n=t.split(".");if("**"===n.pop()&&n.pop(),n.length){if(e.parent)throw new Error("States that specify the 'parent:' property should not have a '.' in their name ("+t+")");return n.join(".")}return e.parent?(0,r.HD)(e.parent)?e.parent:e.parent.name:""},e.prototype.name=function(e){var t=e.name;if(-1!==t.indexOf(".")||!e.parent)return t;var n=(0,r.HD)(e.parent)?e.parent:e.parent.name;return n?n+"."+t:t},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js":(e,t,n)=>{"use strict";n.d(t,{Q:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/safeConsole.js"),a=function(){function e(e){this._states=e}return e.prototype.isRelative=function(e){return 0===(e=e||"").indexOf(".")||0===e.indexOf("^")},e.prototype.find=function(e,t,n){if(void 0===n&&(n=!0),e||""===e){var a=(0,o.HD)(e),i=a?e:e.name;this.isRelative(i)&&(i=this.resolvePath(i,t));var d=this._states[i];if(d&&(a||!(a||d!==e&&d.self!==e)))return d;if(a&&n){var u=(0,r.VO)(this._states).filter((function(e){return e.__stateObjectCache.nameGlob&&e.__stateObjectCache.nameGlob.matches(i)}));return u.length>1&&s.L.error("stateMatcher.find: Found multiple matches for "+i+" using glob: ",u.map((function(e){return e.name}))),u[0]}}},e.prototype.resolvePath=function(e,t){if(!t)throw new Error("No reference point given for path '"+e+"'");for(var n=this.find(t),o=e.split("."),r=o.length,s=0,a=n;s{"use strict";n.d(t,{l:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/glob.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=function(){function e(t){return e.create(t||{})}return e.create=function(t){t=e.isStateClass(t)?new t:t;var n=(0,o.ED)((0,o.ED)(t,e.prototype));return t.$$state=function(){return n},n.self=t,n.__stateObjectCache={nameGlob:s.r.fromString(n.name)},n},e.prototype.is=function(e){return this===e||this.self===e||this.fqn()===e},e.prototype.fqn=function(){if(!(this.parent&&this.parent instanceof this.constructor))return this.name;var e=this.parent.fqn();return e?e+"."+this.name:this.name},e.prototype.root=function(){return this.parent&&this.parent.root()||this},e.prototype.parameters=function(e){return((e=(0,o.ce)(e,{inherit:!0,matchingKeys:null})).inherit&&this.parent&&this.parent.parameters()||[]).concat((0,o.VO)(this.params)).filter((function(t){return!e.matchingKeys||e.matchingKeys.hasOwnProperty(t.id)}))},e.prototype.parameter=function(e,t){return void 0===t&&(t={}),this.url&&this.url.parameter(e,t)||(0,o.sE)((0,o.VO)(this.params),(0,r.OH)("id",e))||t.inherit&&this.parent&&this.parent.parameter(e)},e.prototype.toString=function(){return this.fqn()},e.isStateClass=function(e){return(0,a.mf)(e)&&!0===e.__uiRouterState},e.isStateDeclaration=function(e){return(0,a.mf)(e.$$state)},e.isState=function(e){return(0,a.Kn)(e.__stateObjectCache)},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/state/stateObject.js"),s=function(){function e(e,t,n,o){this.router=e,this.states=t,this.builder=n,this.listeners=o,this.queue=[]}return e.prototype.dispose=function(){this.queue=[]},e.prototype.register=function(e){var t=this.queue,n=r.l.create(e),s=n.name;if(!(0,o.HD)(s))throw new Error("State must have a valid name");if(this.states.hasOwnProperty(s)||(0,o.d3)(t.map((0,o.vg)("name")),s))throw new Error("State '"+s+"' is already defined");return t.push(n),this.flush(),n},e.prototype.flush=function(){for(var e=this,t=this,n=t.queue,o=t.states,r=t.builder,s=[],a=[],i={},d=function(t){return e.states.hasOwnProperty(t)&&e.states[t]},u=function(){s.length&&e.listeners.forEach((function(e){return e("registered",s.map((function(e){return e.self})))}))};n.length>0;){var m=n.shift(),l=m.name,_=r.build(m),c=a.indexOf(m);if(_){var h=d(l);if(h&&h.name===l)throw new Error("State '"+l+"' is already defined");var f=d(l+".**");f&&this.router.stateRegistry.deregister(f),o[l]=m,this.attachRoute(m),c>=0&&a.splice(c,1),s.push(m)}else{var p=i[l];if(i[l]=n.length,c>=0&&p===n.length)return n.push(m),u(),o;c<0&&a.push(m),n.push(m)}}return u(),o},e.prototype.attachRoute=function(e){if(!e.abstract&&e.url){var t=this.router.urlService.rules;t.rule(t.urlRuleFactory.create(e))}},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js":(e,t,n)=>{"use strict";n.d(t,{q:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js"),r=n("./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js"),s=n("./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),d=function(){function e(e){this.router=e,this.states={},this.listeners=[],this.matcher=new o.Q(this.states),this.builder=new r.t(this.matcher,e.urlMatcherFactory),this.stateQueue=new s.L(e,this.states,this.builder,this.listeners),this._registerRoot()}return e.prototype._registerRoot=function(){(this._root=this.stateQueue.register({name:"",url:"^",views:null,params:{"#":{value:null,type:"hash",dynamic:!0}},abstract:!0})).navigable=null},e.prototype.dispose=function(){var e=this;this.stateQueue.dispose(),this.listeners=[],this.get().forEach((function(t){return e.get(t)&&e.deregister(t)}))},e.prototype.onStatesChanged=function(e){return this.listeners.push(e),function(){(0,a.nA)(this.listeners)(e)}.bind(this)},e.prototype.root=function(){return this._root},e.prototype.register=function(e){return this.stateQueue.register(e)},e.prototype._deregisterTree=function(e){var t=this,n=this.get().map((function(e){return e.$$state()})),o=function(e){var t=n.filter((function(t){return-1!==e.indexOf(t.parent)}));return 0===t.length?t:t.concat(o(t))},r=o([e]),s=[e].concat(r).reverse();return s.forEach((function(e){var n=t.router.urlService.rules;n.rules().filter((0,i.OH)("state",e)).forEach((function(e){return n.removeRule(e)})),delete t.states[e.name]})),s},e.prototype.deregister=function(e){var t=this.get(e);if(!t)throw new Error("Can't deregister state; not found: "+e);var n=this._deregisterTree(t.$$state());return this.listeners.forEach((function(e){return e("deregistered",n.map((function(e){return e.self})))})),n},e.prototype.get=function(e,t){var n=this;if(0===arguments.length)return Object.keys(this.states).map((function(e){return n.states[e].self}));var o=this.matcher.find(e,t);return o&&o.self||null},e.prototype.decorator=function(e,t){return this.builder.builder(e,t)},e}()},"./node_modules/@uirouter/core/lib-esm/state/targetState.js":(e,t,n)=>{"use strict";n.d(t,{F:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),a=function(){function e(e,t,n,o){this._stateRegistry=e,this._identifier=t,this._identifier=t,this._params=(0,s.l7)({},n||{}),this._options=(0,s.l7)({},o||{}),this._definition=e.matcher.find(t,this._options.relative)}return e.prototype.name=function(){return this._definition&&this._definition.name||this._identifier},e.prototype.identifier=function(){return this._identifier},e.prototype.params=function(){return this._params},e.prototype.$state=function(){return this._definition},e.prototype.state=function(){return this._definition&&this._definition.self},e.prototype.options=function(){return this._options},e.prototype.exists=function(){return!(!this._definition||!this._definition.self)},e.prototype.valid=function(){return!this.error()},e.prototype.error=function(){var e=this.options().relative;if(!this._definition&&e){var t=e.name?e.name:e;return"Could not resolve '"+this.name()+"' from state '"+t+"'"}return this._definition?this._definition.self?void 0:"State '"+this.name()+"' has an invalid definition":"No such state '"+this.name()+"'"},e.prototype.toString=function(){return"'"+this.name()+"'"+(0,r.Pz)(this.params())},e.prototype.withState=function(t){return new e(this._stateRegistry,t,this._params,this._options)},e.prototype.withParams=function(t,n){void 0===n&&(n=!1);var o=n?t:(0,s.l7)({},this._params,t);return new e(this._stateRegistry,this._identifier,o,this._options)},e.prototype.withOptions=function(t,n){void 0===n&&(n=!1);var o=n?t:(0,s.l7)({},this._options,t);return new e(this._stateRegistry,this._identifier,this._params,o)},e.isDef=function(e){return e&&e.state&&((0,o.HD)(e.state)||(0,o.Kn)(e.state)&&(0,o.HD)(e.state.name))},e}()},"./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js":(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),a=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),i=function(){function e(e){this.transition=e}return e.prototype.buildHooksForPhase=function(e){var t=this;return this.transition.router.transitionService._pluginapi._getEvents(e).map((function(e){return t.buildHooks(e)})).reduce(o.M7,[]).filter(o.yR)},e.prototype.buildHooks=function(e){var t=this.transition,n=t.treeChanges(),r=this.getMatchingHooks(e,n,t);if(!r)return[];var i,d={transition:t,current:t.options().current};return r.map((function(r){return r.matches(n,t)[e.criteriaMatchPath.name].map((function(n){var i=(0,o.l7)({bind:r.bind,traceData:{hookType:e.name,context:n}},d),u=e.criteriaMatchPath.scope===s.c.STATE?n.state.self:null,m=new a.I(t,u,r,i);return{hook:r,node:n,transitionHook:m}}))})).reduce(o.M7,[]).sort((i=e.reverseSort,void 0===i&&(i=!1),function(e,t){var n=i?-1:1,o=(e.node.state.path.length-t.node.state.path.length)*n;return 0!==o?o:t.hook.priority-e.hook.priority})).map((function(e){return e.transitionHook}))},e.prototype.getMatchingHooks=function(e,t,n){var a=e.hookPhase===s.k.CREATE,i=this.transition.router.transitionService;return(a?[i]:[this.transition,i]).map((function(t){return t.getHooks(e.name)})).filter((0,o.sp)(r.kJ,"broken event named: "+e.name)).reduce(o.M7,[]).filter((function(e){return e.matches(t,n)}))},e}()},"./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js":(e,t,n)=>{"use strict";n.d(t,{cN:()=>s,BU:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js");function s(e,t,n){var r=(0,o.HD)(t)?[t]:t;return!!((0,o.mf)(r)?r:function(e){for(var t=r,n=0;n{"use strict";var o,r;n.d(t,{k:()=>o,c:()=>r}),function(e){e[e.CREATE=0]="CREATE",e[e.BEFORE=1]="BEFORE",e[e.RUN=2]="RUN",e[e.SUCCESS=3]="SUCCESS",e[e.ERROR=4]="ERROR"}(o||(o={})),function(e){e[e.TRANSITION=0]="TRANSITION",e[e.STATE=1]="STATE"}(r||(r={}))},"./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js":(e,t,n)=>{"use strict";n.d(t,{K:()=>o,i:()=>d});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js");!function(e){e[e.SUPERSEDED=2]="SUPERSEDED",e[e.ABORTED=3]="ABORTED",e[e.INVALID=4]="INVALID",e[e.IGNORED=5]="IGNORED",e[e.ERROR=6]="ERROR"}(o||(o={}));var i=0,d=function(){function e(e,t,n){this.$id=i++,this.type=e,this.message=t,this.detail=n}return e.isRejectionPromise=function(t){return t&&"function"==typeof t.then&&(0,a.is)(e)(t._transitionRejection)},e.superseded=function(t,n){var r=new e(o.SUPERSEDED,"The transition has been superseded by a different transition",t);return n&&n.redirected&&(r.redirected=!0),r},e.redirected=function(t){return e.superseded(t,{redirected:!0})},e.invalid=function(t){return new e(o.INVALID,"This transition is invalid",t)},e.ignored=function(t){return new e(o.IGNORED,"The transition was ignored",t)},e.aborted=function(t){return new e(o.ABORTED,"The transition has been aborted",t)},e.errored=function(t){return new e(o.ERROR,"The transition errored",t)},e.normalize=function(t){return(0,a.is)(e)(t)?t:e.errored(t)},e.prototype.toString=function(){var e,t=(e=this.detail)&&e.toString!==Object.prototype.toString?e.toString():(0,s.Pz)(e),n=this;return"Transition Rejection($id: "+n.$id+" type: "+n.type+", message: "+n.message+", detail: "+t+")"},e.prototype.toPromise=function(){return(0,r.l7)((0,r.jv)(this),{_transitionRejection:this})},e}()},"./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js":(e,t,n)=>{"use strict";n.d(t,{t:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),r=function(e,t,n,r,s,a,i,d){void 0===s&&(s=!1),void 0===a&&(a=o.I.HANDLE_RESULT),void 0===i&&(i=o.I.REJECT_ERROR),void 0===d&&(d=!1),this.name=e,this.hookPhase=t,this.hookOrder=n,this.criteriaMatchPath=r,this.reverseSort=s,this.getResultHandler=a,this.getErrorHandler=i,this.synchronous=d}},"./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>c});var o=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),u=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),m=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"),l=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),_={current:r.ZT,transition:null,traceData:{},bind:null},c=function(){function e(e,t,n,s){var a=this;this.transition=e,this.stateContext=t,this.registeredHook=n,this.options=s,this.isSuperseded=function(){return a.type.hookPhase===o.k.RUN&&!a.options.transition.isActive()},this.options=(0,r.ce)(s,_),this.type=n.eventType}return e.chain=function(e,t){return e.reduce((function(e,t){return e.then((function(){return t.invokeHook()}))}),t||u.u.$q.when())},e.invokeHooks=function(t,n){for(var o=0;o=t.invokeLimit&&t.deregister()}}},e.prototype.handleHookResult=function(e){var t=this;return this.getNotCurrentRejection()||((0,a.tI)(e)?e.then((function(e){return t.handleHookResult(e)})):(d.g4.traceHookResult(e,this.transition,this.options),!1===e?m.i.aborted("Hook aborted transition").toPromise():(0,i.is)(l.F)(e)?m.i.redirected(e).toPromise():void 0))},e.prototype.getNotCurrentRejection=function(){var e=this.transition.router;return e._disposed?m.i.aborted("UIRouter instance #"+e.$id+" has been stopped (disposed)").toPromise():this.transition._aborted?m.i.aborted().toPromise():this.isSuperseded()?m.i.superseded(this.options.current()).toPromise():void 0},e.prototype.toString=function(){var e=this.options,t=this.registeredHook,n=(0,i.Qc)("traceData.hookType")(e)||"internal",o=(0,i.Qc)("traceData.context.state.name")(e)||(0,i.Qc)("traceData.context")(e)||"unknown",r=(0,s.iC)(t.callback);return n+" context: "+o+", "+(0,s.BS)(200,r)},e.HANDLE_RESULT=function(e){return function(t){return e.handleHookResult(t)}},e.LOG_REJECTED_RESULT=function(e){return function(t){(0,a.tI)(t)&&t.catch((function(t){return e.logError(m.i.normalize(t))}))}},e.LOG_ERROR=function(e){return function(t){return e.logError(t)}},e.REJECT_ERROR=function(e){return function(e){return(0,r.jv)(e)}},e.THROW_ERROR=function(e){return function(e){throw e}},e}()},"./node_modules/@uirouter/core/lib-esm/transition/transitionService.js":(e,t,n)=>{"use strict";n.d(t,{Z:()=>C,q:()=>W});var o=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/transition.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js"),a=n("./node_modules/@uirouter/core/lib-esm/router.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/index.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/index.js");function u(e){e.addResolvable(i.XU.fromData(a.a,e.router),""),e.addResolvable(i.XU.fromData(r.u,e),""),e.addResolvable(i.XU.fromData("$transition$",e),""),e.addResolvable(i.XU.fromData("$stateParams",e.params()),""),e.entering().forEach((function(t){e.addResolvable(i.XU.fromData("$state$",t),t)}))}var m=["$transition$",r.u],l=(0,d.d3)(m),_=function(e){var t=(0,d.VO)(e.treeChanges()).reduce(d.M7,[]).reduce(d.v_,[]),n=function(e){return l(e.token)?i.XU.fromData(e.token,null):e};t.forEach((function(e){e.resolvables=e.resolvables.map(n)}))},c=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),h=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),f=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),p=function(e){var t=e.to().redirectTo;if(t){var n=e.router.stateService;return(0,c.mf)(t)?h.u.$q.when(t(e)).then(o):o(t)}function o(t){if(t)return t instanceof f.F?t:(0,c.HD)(t)?n.target(t,e.params(),e.options()):t.state||t.params?n.target(t.state||e.to(),t.params||e.params(),e.options()):void 0}};function M(e){return function(t,n){return(0,n.$$state()[e])(t,n)}}var y=M("onExit"),L=M("onRetain"),g=M("onEnter"),Y=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),v=n("./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js"),k=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),j=1e3,w=function(e){return new v.l(e.treeChanges().to).resolvePath("EAGER",e).then(Y.ZT)},b=function(e,t){return new v.l(e.treeChanges().to).subContext(t.$$state()).resolvePath("LAZY",e).then(Y.ZT)},D=function(e){return new v.l(e.treeChanges().to).resolvePath("LAZY",e).then(Y.ZT)},T=function(e){var t=h.u.$q,n=e.views("entering");if(n.length)return t.all(n.map((function(e){return t.when(e.load())}))).then(Y.ZT)},S=function(e){var t=e.views("entering"),n=e.views("exiting");if(t.length||n.length){var o=e.router.viewService;n.forEach((function(e){return o.deactivateViewConfig(e)})),t.forEach((function(e){return o.activateViewConfig(e)})),o.sync()}},H=function(e){var t=e.router.globals,n=function(){t.transition===e&&(t.transition=null)};e.onSuccess({},(function(){t.successfulTransitions.enqueue(e),t.$current=e.$to(),t.current=t.$current.self,(0,Y.JG)(e.params(),t.params)}),{priority:1e4}),e.promise.then(n,n)},x=function(e){var t=e.options(),n=e.router.stateService,o=e.router.urlRouter;if("url"!==t.source&&t.location&&n.$current.navigable){var r={replace:"replace"===t.location};o.push(n.$current.navigable.url,n.params,r)}o.update(!0)},E=n("./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js"),P=n("./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js"),O=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),$=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),A=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js");function R(e){var t=e._ignoredReason();if(t){$.g4.traceTransitionIgnored(e);var n=e.router.globals.transition;return"SameAsCurrent"===t&&n&&n.abort(),A.i.ignored().toPromise()}}function F(e){if(!e.valid())throw new Error(e.error().toString())}var W={location:!0,relative:null,inherit:!1,notify:!0,reload:!1,supercede:!0,custom:{},current:function(){return null},source:"unknown"},C=function(){function e(e){this._transitionCount=0,this._eventTypes=[],this._registeredHooks={},this._criteriaPaths={},this._router=e,this.$view=e.viewService,this._deregisterHookFns={},this._pluginapi=(0,Y.WR)((0,k.P0)(this),{},(0,k.P0)(this),["_definePathType","_defineEvent","_getPathTypes","_getEvents","getHooks"]),this._defineCorePaths(),this._defineCoreEvents(),this._registerCoreTransitionHooks(),e.globals.successfulTransitions.onEvict(_)}return e.prototype.onCreate=function(e,t,n){},e.prototype.onBefore=function(e,t,n){},e.prototype.onStart=function(e,t,n){},e.prototype.onExit=function(e,t,n){},e.prototype.onRetain=function(e,t,n){},e.prototype.onEnter=function(e,t,n){},e.prototype.onFinish=function(e,t,n){},e.prototype.onSuccess=function(e,t,n){},e.prototype.onError=function(e,t,n){},e.prototype.dispose=function(e){(0,Y.VO)(this._registeredHooks).forEach((function(e){return e.forEach((function(t){t._deregistered=!0,(0,Y.nA)(e,t)}))}))},e.prototype.create=function(e,t){return new r.u(e,t,this._router)},e.prototype._defineCoreEvents=function(){var e=o.k,t=O.I,n=this._criteriaPaths,r=!1,s=!0;this._defineEvent("onCreate",e.CREATE,0,n.to,r,t.LOG_REJECTED_RESULT,t.THROW_ERROR,s),this._defineEvent("onBefore",e.BEFORE,0,n.to),this._defineEvent("onStart",e.RUN,0,n.to),this._defineEvent("onExit",e.RUN,100,n.exiting,!0),this._defineEvent("onRetain",e.RUN,200,n.retained),this._defineEvent("onEnter",e.RUN,300,n.entering),this._defineEvent("onFinish",e.RUN,400,n.to),this._defineEvent("onSuccess",e.SUCCESS,0,n.to,r,t.LOG_REJECTED_RESULT,t.LOG_ERROR,s),this._defineEvent("onError",e.ERROR,0,n.to,r,t.LOG_REJECTED_RESULT,t.LOG_ERROR,s)},e.prototype._defineCorePaths=function(){var e=o.c.STATE,t=o.c.TRANSITION;this._definePathType("to",t),this._definePathType("from",t),this._definePathType("exiting",e),this._definePathType("retained",e),this._definePathType("entering",e)},e.prototype._defineEvent=function(e,t,n,o,r,a,i,d){void 0===r&&(r=!1),void 0===a&&(a=O.I.HANDLE_RESULT),void 0===i&&(i=O.I.REJECT_ERROR),void 0===d&&(d=!1);var u=new P.t(e,t,n,o,r,a,i,d);this._eventTypes.push(u),(0,s.BU)(this,this,u)},e.prototype._getEvents=function(e){return((0,c.$K)(e)?this._eventTypes.filter((function(t){return t.hookPhase===e})):this._eventTypes.slice()).sort((function(e,t){var n=e.hookPhase-t.hookPhase;return 0===n?e.hookOrder-t.hookOrder:n}))},e.prototype._definePathType=function(e,t){this._criteriaPaths[e]={name:e,scope:t}},e.prototype._getPathTypes=function(){return this._criteriaPaths},e.prototype.getHooks=function(e){return this._registeredHooks[e]},e.prototype._registerCoreTransitionHooks=function(){var e=this._deregisterHookFns;e.addCoreResolves=this.onCreate({},u),e.ignored=this.onBefore({},R,{priority:-9999}),e.invalid=function(e){return e.onBefore({},F,{priority:-1e4})}(this),e.redirectTo=function(e){return e.onStart({to:function(e){return!!e.redirectTo}},p)}(this),e.onExit=function(e){return e.onExit({exiting:function(e){return!!e.onExit}},y)}(this),e.onRetain=function(e){return e.onRetain({retained:function(e){return!!e.onRetain}},L)}(this),e.onEnter=function(e){return e.onEnter({entering:function(e){return!!e.onEnter}},g)}(this),e.eagerResolve=function(e){return e.onStart({},w,{priority:j})}(this),e.lazyResolve=function(e){return e.onEnter({entering:(0,k.P0)(!0)},b,{priority:j})}(this),e.resolveAll=function(e){return e.onFinish({},D,{priority:j})}(this),e.loadViews=function(e){return e.onFinish({},T)}(this),e.activateViews=function(e){return e.onSuccess({},S)}(this),e.updateGlobals=function(e){return e.onCreate({},H)}(this),e.updateUrl=function(e){return e.onSuccess({},x,{priority:9999})}(this),e.lazyLoad=(0,E.v)(this)},e}()},"./node_modules/@uirouter/core/lib-esm/url/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/url/urlConfig.js":(e,t,n)=>{"use strict";n.d(t,{F:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/params/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),s=function(){function e(e){var t=this;this.router=e,this.paramTypes=new o.ParamTypes,this._decodeParams=!0,this._isCaseInsensitive=!1,this._isStrictMode=!0,this._defaultSquashPolicy=!1,this.dispose=function(){return t.paramTypes.dispose()},this.baseHref=function(){return t.router.locationConfig.baseHref()},this.hashPrefix=function(e){return t.router.locationConfig.hashPrefix(e)},this.host=function(){return t.router.locationConfig.host()},this.html5Mode=function(){return t.router.locationConfig.html5Mode()},this.port=function(){return t.router.locationConfig.port()},this.protocol=function(){return t.router.locationConfig.protocol()}}return e.prototype.caseInsensitive=function(e){return this._isCaseInsensitive=(0,r.$K)(e)?e:this._isCaseInsensitive},e.prototype.defaultSquashPolicy=function(e){if((0,r.$K)(e)&&!0!==e&&!1!==e&&!(0,r.HD)(e))throw new Error("Invalid squash policy: "+e+". Valid policies: false, true, arbitrary-string");return this._defaultSquashPolicy=(0,r.$K)(e)?e:this._defaultSquashPolicy},e.prototype.strictMode=function(e){return this._isStrictMode=(0,r.$K)(e)?e:this._isStrictMode},e.prototype.type=function(e,t,n){var o=this.paramTypes.type(e,t,n);return(0,r.$K)(t)?this:o},e}()},"./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js":(e,t,n)=>{"use strict";n.d(t,{y:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),s=n("./node_modules/@uirouter/core/lib-esm/params/index.js"),a=function(){return(a=Object.assign||function(e){for(var t,n=1,o=arguments.length;n{"use strict";n.d(t,{g:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRule.js"),s=function(){function e(e){var t=this;this.router=e,this.sync=function(e){return t.router.urlService.sync(e)},this.listen=function(e){return t.router.urlService.listen(e)},this.deferIntercept=function(e){return t.router.urlService.deferIntercept(e)},this.match=function(e){return t.router.urlService.match(e)},this.initial=function(e){return t.router.urlService.rules.initial(e)},this.otherwise=function(e){return t.router.urlService.rules.otherwise(e)},this.removeRule=function(e){return t.router.urlService.rules.removeRule(e)},this.rule=function(e){return t.router.urlService.rules.rule(e)},this.rules=function(){return t.router.urlService.rules.rules()},this.sort=function(e){return t.router.urlService.rules.sort(e)},this.when=function(e,n,o){return t.router.urlService.rules.when(e,n,o)},this.urlRuleFactory=new r.I(e)}return e.prototype.update=function(e){var t=this.router.locationService;e?this.location=t.url():t.url()!==this.location&&t.url(this.location,!0)},e.prototype.push=function(e,t,n){var o=n&&!!n.replace;this.router.urlService.url(e.format(t||{}),o)},e.prototype.href=function(e,t,n){var r=e.format(t);if(null==r)return null;n=n||{absolute:!1};var s=this.router.urlService.config,a=s.html5Mode();if(a||null===r||(r="#"+s.hashPrefix()+r),r=function(e,t,n,r){return"/"===r?e:t?(0,o.Lb)(r)+e:n?r.slice(1)+e:e}(r,a,n.absolute,s.baseHref()),!n.absolute||!r)return r;var i=!a&&r?"/":"",d=s.port(),u=80===d||443===d?"":":"+d;return[s.protocol(),"://",s.host(),u,i,r].join("")},Object.defineProperty(e.prototype,"interceptDeferred",{get:function(){return this.router.urlService.interceptDeferred},enumerable:!1,configurable:!0}),e}()},"./node_modules/@uirouter/core/lib-esm/url/urlRule.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>d,n:()=>u});var o=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/state/stateObject.js"),d=function(){function e(e){this.router=e}return e.prototype.compile=function(e){return this.router.urlMatcherFactory.compile(e)},e.prototype.create=function(e,t){var n=this,s=i.l.isState,d=i.l.isStateDeclaration,m=(0,a.uj)([[r.HD,function(e){return m(n.compile(e))}],[(0,a.is)(o.x),function(e){return n.fromUrlMatcher(e,t)}],[(0,a.or)(s,d),function(e){return n.fromState(e,n.router)}],[(0,a.is)(RegExp),function(e){return n.fromRegExp(e,t)}],[r.mf,function(e){return new u(e,t)}]]),l=m(e);if(!l)throw new Error("invalid 'what' in when()");return l},e.prototype.fromUrlMatcher=function(e,t){var n=t;(0,r.HD)(t)&&(t=this.router.urlMatcherFactory.compile(t)),(0,a.is)(o.x)(t)&&(n=function(e){return t.format(e)});var i={urlMatcher:e,matchPriority:function(t){var n=e.parameters().filter((function(e){return e.isOptional}));return n.length?n.filter((function(e){return t[e.id]})).length/n.length:1e-6},type:"URLMATCHER"};return(0,s.l7)(new u((function(t){var n=e.exec(t.path,t.search,t.hash);return e.validates(n)&&n}),n),i)},e.prototype.fromState=function(e,t){var n=i.l.isStateDeclaration(e)?e.$$state():e,o={state:n,type:"STATE"};return(0,s.l7)(this.fromUrlMatcher(n.url,(function(e){var o=t.stateService,r=t.globals;o.href(n,e)!==o.href(r.current,r.params)&&o.transitionTo(n,e,{inherit:!0,source:"url"})})),o)},e.prototype.fromRegExp=function(e,t){if(e.global||e.sticky)throw new Error("Rule RegExp must not be global or sticky");var n=(0,r.HD)(t)?function(e){return t.replace(/\$(\$|\d{1,2})/,(function(t,n){return e["$"===n?0:Number(n)]}))}:t,o={regexp:e,type:"REGEXP"};return(0,s.l7)(new u((function(t){return e.exec(t.path)}),n),o)},e.isUrlRule=function(e){return e&&["type","match","handler"].every((function(t){return(0,r.$K)(e[t])}))},e}(),u=function(e,t){var n=this;this.match=e,this.type="RAW",this.matchPriority=function(e){return 0-n.$id},this.handler=t||s.yR}},"./node_modules/@uirouter/core/lib-esm/url/urlRules.js":(e,t,n)=>{"use strict";n.d(t,{h:()=>u});var o,r=n("./node_modules/@uirouter/core/lib-esm/state/index.js"),s=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),i=n("./node_modules/@uirouter/core/lib-esm/url/urlRule.js");function d(e){if(!((0,a.mf)(e)||(0,a.HD)(e)||(0,a.is)(r.TargetState)(e)||r.TargetState.isDef(e)))throw new Error("'handler' must be a string, function, TargetState, or have a state: 'newtarget' property");return(0,a.mf)(e)?e:(0,a.P0)(e)}o=function(e,t){var n=function(e,t){return(t.priority||0)-(e.priority||0)}(e,t);return 0!==n||0!==(n=function(e,t){var n={STATE:4,URLMATCHER:4,REGEXP:3,RAW:2,OTHER:1};return(n[e.type]||0)-(n[t.type]||0)}(e,t))||0!==(n=function(e,t){return e.urlMatcher&&t.urlMatcher?s.x.compare(e.urlMatcher,t.urlMatcher):0}(e,t))?n:function(e,t){var n={STATE:!0,URLMATCHER:!0};return n[e.type]&&n[t.type]?0:(e.$id||0)-(t.$id||0)}(e,t)};var u=function(){function e(e){this.router=e,this._sortFn=o,this._rules=[],this._id=0,this.urlRuleFactory=new i.I(e)}return e.prototype.dispose=function(e){this._rules=[],delete this._otherwiseFn},e.prototype.initial=function(e){var t=d(e);this.rule(this.urlRuleFactory.create((function(e,t){return 0===t.globals.transitionHistory.size()&&!!/^\/?$/.exec(e.path)}),t))},e.prototype.otherwise=function(e){var t=d(e);this._otherwiseFn=this.urlRuleFactory.create((0,a.P0)(!0),t),this._sorted=!1},e.prototype.removeRule=function(e){(0,a.nA)(this._rules,e)},e.prototype.rule=function(e){var t=this;if(!i.I.isUrlRule(e))throw new Error("invalid rule");return e.$id=this._id++,e.priority=e.priority||0,this._rules.push(e),this._sorted=!1,function(){return t.removeRule(e)}},e.prototype.rules=function(){return this.ensureSorted(),this._rules.concat(this._otherwiseFn?[this._otherwiseFn]:[])},e.prototype.sort=function(e){for(var t=this.stableSort(this._rules,this._sortFn=e||this._sortFn),n=0,o=0;o{"use strict";n.d(t,{i:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRules.js"),s=n("./node_modules/@uirouter/core/lib-esm/url/urlConfig.js"),a=n("./node_modules/@uirouter/core/lib-esm/state/index.js"),i=function(){function e(e){var t=this;this.router=e,this.interceptDeferred=!1,this.rules=new r.h(this.router),this.config=new s.F(this.router),this.url=function(e,n,o){return t.router.locationService.url(e,n,o)},this.path=function(){return t.router.locationService.path()},this.search=function(){return t.router.locationService.search()},this.hash=function(){return t.router.locationService.hash()},this.onChange=function(e){return t.router.locationService.onChange(e)}}return e.prototype.dispose=function(){this.listen(!1),this.rules.dispose()},e.prototype.parts=function(){return{path:this.path(),search:this.search(),hash:this.hash()}},e.prototype.sync=function(e){if(!e||!e.defaultPrevented){var t=this.router,n=t.urlService,r=t.stateService,s={path:n.path(),search:n.search(),hash:n.hash()},i=this.match(s);(0,o.uj)([[o.HD,function(e){return n.url(e,!0)}],[a.TargetState.isDef,function(e){return r.go(e.state,e.params,e.options)}],[(0,o.is)(a.TargetState),function(e){return r.go(e.state(),e.params(),e.options())}]])(i&&i.rule.handler(i.match,s,this.router))}},e.prototype.listen=function(e){var t=this;if(!1!==e)return this._stopListeningFn=this._stopListeningFn||this.router.urlService.onChange((function(e){return t.sync(e)}));this._stopListeningFn&&this._stopListeningFn(),delete this._stopListeningFn},e.prototype.deferIntercept=function(e){void 0===e&&(e=!0),this.interceptDeferred=e},e.prototype.match=function(e){e=(0,o.l7)({path:"",search:{},hash:""},e);for(var t,n,r,s=this.rules.rules(),a=0;at.weight?i:t}return t},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla.js":(e,t,n)=>{"use strict";n.d(t,{$q:()=>o.$q});var o=n("./node_modules/@uirouter/core/lib-esm/vanilla/index.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js":(e,t,n)=>{"use strict";n.d(t,{U:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"),s=function(){function e(e,t){var n=this;this.fireAfterUpdate=t,this._listeners=[],this._listener=function(e){return n._listeners.forEach((function(t){return t(e)}))},this.hash=function(){return(0,r.en)(n._get()).hash},this.path=function(){return(0,r.en)(n._get()).path},this.search=function(){return(0,r.Qf)((0,r.en)(n._get()).search)},this._location=o.Jz.location,this._history=o.Jz.history}return e.prototype.url=function(e,t){return void 0===t&&(t=!0),(0,o.$K)(e)&&e!==this._get()&&(this._set(null,null,e,t),this.fireAfterUpdate&&this._listeners.forEach((function(t){return t({url:e})}))),(0,r.Q2)(this)},e.prototype.onChange=function(e){var t=this;return this._listeners.push(e),function(){return(0,o.nA)(t._listeners,e)}},e.prototype.dispose=function(e){(0,o.Wk)(this._listeners)},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js":(e,t,n)=>{"use strict";n.d(t,{u:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=function(){function e(e,t){void 0===t&&(t=!1),this._isHtml5=t,this._baseHref=void 0,this._hashPrefix=""}return e.prototype.port=function(){return location.port?Number(location.port):"https"===this.protocol()?443:80},e.prototype.protocol=function(){return location.protocol.replace(/:/g,"")},e.prototype.host=function(){return location.hostname},e.prototype.html5Mode=function(){return this._isHtml5},e.prototype.hashPrefix=function(e){return(0,o.$K)(e)?this._hashPrefix=e:this._hashPrefix},e.prototype.baseHref=function(e){return(0,o.$K)(e)&&(this._baseHref=e),(0,o.o8)(this._baseHref)&&(this._baseHref=this.getBaseHref()),this._baseHref},e.prototype.getBaseHref=function(){var e=document.getElementsByTagName("base")[0];return e&&e.href?e.href.replace(/^([^/:]*:)?\/\/[^/]*/,""):this._isHtml5?"/":location.pathname||"/"},e.prototype.dispose=function(){},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js":(e,t,n)=>{"use strict";n.d(t,{R:()=>i});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),s=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),a=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(t){var n=e.call(this,t,!1)||this;return r.Jz.addEventListener("hashchange",n._listener,!1),n}return a(t,e),t.prototype._get=function(){return(0,r.Ld)(this._location.hash)},t.prototype._set=function(e,t,n,o){this._location.hash=n},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),r.Jz.removeEventListener("hashchange",this._listener)},t}(s.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/injector.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/core/lib-esm/common/index.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js":(e,t,n)=>{"use strict";n.d(t,{W:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=function(){var e=this;this.dispose=r.ZT,this._baseHref="",this._port=80,this._protocol="http",this._host="localhost",this._hashPrefix="",this.port=function(){return e._port},this.protocol=function(){return e._protocol},this.host=function(){return e._host},this.baseHref=function(){return e._baseHref},this.html5Mode=function(){return!1},this.hashPrefix=function(t){return(0,o.$K)(t)?e._hashPrefix=t:e._hashPrefix}}},"./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>a});var o,r=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),s=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=function(e){function t(t){return e.call(this,t,!0)||this}return s(t,e),t.prototype._get=function(){return this._url},t.prototype._set=function(e,t,n,o){this._url=n},t}(r.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js":(e,t,n)=>{"use strict";var o=n("./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js"),r=n("./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js"),s=n("./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"),a=n("./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js"),i=n("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js"),d=n("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js");n("./node_modules/@uirouter/core/lib-esm/vanilla/injector.js"),n("./node_modules/@uirouter/core/lib-esm/vanilla/q.js"),n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),(0,s._D)("vanilla.hashBangLocation",!1,r.R,o.u),(0,s._D)("vanilla.pushStateLocation",!0,a.h,o.u),(0,s._D)("vanilla.memoryLocation",!1,i.I,d.W)},"./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js":(e,t,n)=>{"use strict";n.d(t,{h:()=>i});var o,r=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),a=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(t){var n=e.call(this,t,!0)||this;return n._config=t.urlService.config,s.Jz.addEventListener("popstate",n._listener,!1),n}return a(t,e),t.prototype._getBasePrefix=function(){return(0,s.Lb)(this._config.baseHref())},t.prototype._get=function(){var e=this._location,t=e.pathname,n=e.hash,o=e.search;o=(0,s.C7)(o)[1],n=(0,s.cW)(n)[1];var r=this._getBasePrefix(),a=t===this._config.baseHref(),i=t.substr(0,r.length)===r;return(t=a?"/":i?t.substring(r.length):t)+(o?"?"+o:"")+(n?"#"+n:"")},t.prototype._set=function(e,t,n,o){var r=this._getBasePrefix(),s=n&&"/"!==n[0]?"/":"",a=""===n||"/"===n?this._config.baseHref():r+s+n;o?this._history.replaceState(e,t,a):this._history.pushState(e,t,a)},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),s.Jz.removeEventListener("popstate",this._listener)},t}(r.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/q.js":(e,t,n)=>{"use strict";n.d(t,{$q:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r={when:function(e){return new Promise((function(t,n){return t(e)}))},reject:function(e){return new Promise((function(t,n){n(e)}))},defer:function(){var e={};return e.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),e},all:function(e){if((0,o.kJ)(e))return Promise.all(e);if((0,o.Kn)(e)){var t=Object.keys(e).map((function(t){return e[t].then((function(e){return{key:t,val:e}}))}));return r.all(t).then((function(e){return e.reduce((function(e,t){return e[t.key]=t.val,e}),{})}))}}}},"./node_modules/@uirouter/core/lib-esm/vanilla/utils.js":(e,t,n)=>{"use strict";n.d(t,{Qf:()=>s,en:()=>a,Q2:()=>i,_D:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=function(e,t){var n=t[0],r=t[1];return e.hasOwnProperty(n)?(0,o.kJ)(e[n])?e[n].push(r):e[n]=[e[n],r]:e[n]=r,e},s=function(e){return e.split("&").filter(o.yR).map(o.Fb).reduce(r,{})};function a(e){var t=function(e){return e||""},n=(0,o.cW)(e).map(t),r=n[0],s=n[1],a=(0,o.C7)(r).map(t);return{path:a[0],search:a[1],hash:s,url:e}}var i=function(e){var t=e.path(),n=e.search(),r=e.hash(),s=Object.keys(n).map((function(e){var t=n[e];return((0,o.kJ)(t)?t:[t]).map((function(t){return e+"="+t}))})).reduce(o.M7,[]).join("&");return t+(s?"?"+s:"")+(r?"#"+r:"")};function d(e,t,n,o){return function(r){var s=r.locationService=new n(r),a=r.locationConfig=new o(r,t);return{name:e,service:s,configuration:a,dispose:function(e){e.dispose(s),e.dispose(a)}}}}},"./node_modules/@uirouter/core/lib-esm/view/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/view/view.js":(e,t,n)=>{"use strict";n.d(t,{s:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),i=function(){function e(e){var t=this;this.router=e,this._uiViews=[],this._viewConfigs=[],this._viewConfigFactories={},this._listeners=[],this._pluginapi={_rootViewContext:this._rootViewContext.bind(this),_viewConfigFactory:this._viewConfigFactory.bind(this),_registeredUIView:function(e){return(0,o.sE)(t._uiViews,(function(n){return t.router.$id+"."+n.id===e}))},_registeredUIViews:function(){return t._uiViews},_activeViewConfigs:function(){return t._viewConfigs},_onSync:function(e){return t._listeners.push(e),function(){return(0,o.nA)(t._listeners,e)}}}}return e.normalizeUIViewTarget=function(e,t){void 0===t&&(t="");var n=t.split("@"),o=n[0]||"$default",r=(0,s.HD)(n[1])?n[1]:"^",a=/^(\^(?:\.\^)*)\.(.*$)/.exec(o);if(a&&(r=a[1],o=a[2]),"!"===o.charAt(0)&&(o=o.substr(1),r=""),/^(\^(?:\.\^)*)$/.exec(r)){var i=r.split(".").reduce((function(e,t){return e.parent}),e);r=i.name}else"."===r&&(r=e.name);return{uiViewName:o,uiViewContextAnchor:r}},e.prototype._rootViewContext=function(e){return this._rootContext=e||this._rootContext},e.prototype._viewConfigFactory=function(e,t){this._viewConfigFactories[e]=t},e.prototype.createViewConfig=function(e,t){var n=this._viewConfigFactories[t.$type];if(!n)throw new Error("ViewService: No view config factory registered for type "+t.$type);var o=n(e,t);return(0,s.kJ)(o)?o:[o]},e.prototype.deactivateViewConfig=function(e){a.g4.traceViewServiceEvent("<- Removing",e),(0,o.nA)(this._viewConfigs,e)},e.prototype.activateViewConfig=function(e){a.g4.traceViewServiceEvent("-> Registering",e),this._viewConfigs.push(e)},e.prototype.sync=function(){var t=this,n=this._uiViews.map((function(e){return[e.fqn,e]})).reduce(o.bb,{});function s(e){for(var t=e.viewDecl.$context,n=0;++n&&t.parent;)t=t.parent;return n}var i=(0,r.WA)((function(e,t,n,o){return t*(e(n)-e(o))})),d=this._uiViews.sort(i((function(e){var t=function(e){return e&&e.parent?t(e.parent)+1:1};return 1e4*e.fqn.split(".").length+t(e.creationContext)}),1)).map((function(o){var r=t._viewConfigs.filter(e.matches(n,o));return r.length>1&&r.sort(i(s,-1)),{uiView:o,viewConfig:r[0]}})),u=d.map((function(e){return e.viewConfig})),m=this._viewConfigs.filter((function(e){return!(0,o.d3)(u,e)})).map((function(e){return{uiView:void 0,viewConfig:e}}));d.forEach((function(e){-1!==t._uiViews.indexOf(e.uiView)&&e.uiView.configUpdated(e.viewConfig)}));var l=d.concat(m);this._listeners.forEach((function(e){return e(l)})),a.g4.traceViewSync(l)},e.prototype.registerUIView=function(e){a.g4.traceViewServiceUIViewEvent("-> Registering",e);var t=this._uiViews;return t.filter((function(t){return t.fqn===e.fqn&&t.$type===e.$type})).length&&a.g4.traceViewServiceUIViewEvent("!!!! duplicate uiView named:",e),t.push(e),this.sync(),function(){-1!==t.indexOf(e)?(a.g4.traceViewServiceUIViewEvent("<- Deregistering",e),(0,o.nA)(t)(e)):a.g4.traceViewServiceUIViewEvent("Tried removing non-registered uiView",e)}},e.prototype.available=function(){return this._uiViews.map((0,r.vg)("fqn"))},e.prototype.active=function(){return this._uiViews.filter((0,r.vg)("$config")).map((0,r.vg)("name"))},e.matches=function(e,t){return function(n){if(t.$type!==n.viewDecl.$type)return!1;var r=n.viewDecl,s=r.$uiViewName.split("."),a=t.fqn.split(".");if(!(0,o.fS)(s,a.slice(0-s.length)))return!1;var i=1-s.length||void 0,d=a.slice(0,i).join("."),u=e[d].creationContext;return r.$uiViewContextAnchor===(u&&u.name)}},e}()},"./node_modules/angular-aria/angular-aria.js":()=>{!function(e,t){"use strict";var n="ngAriaDisable",o=t.module("ngAria",["ng"]).info({angularVersion:"1.8.2"}).provider("$aria",(function(){var e={ariaHidden:!0,ariaChecked:!0,ariaReadonly:!0,ariaDisabled:!0,ariaRequired:!0,ariaInvalid:!0,ariaValue:!0,tabindex:!0,bindKeydown:!0,bindRoleForClick:!0};function o(t,o,r,a){return function(i,d,u){if(!u.hasOwnProperty(n)){var m=u.$normalize(o);!e[m]||s(d,r)||u[m]||i.$watch(u[t],(function(e){e=a?!e:!!e,d.attr(o,e)}))}}}this.config=function(n){e=t.extend(e,n)},this.$get=function(){return{config:function(t){return e[t]},$$watchExpr:o}}})),r=["BUTTON","A","INPUT","TEXTAREA","SELECT","DETAILS","SUMMARY"],s=function(e,t){if(-1!==t.indexOf(e[0].nodeName))return!0};o.directive("ngShow",["$aria",function(e){return e.$$watchExpr("ngShow","aria-hidden",[],!0)}]).directive("ngHide",["$aria",function(e){return e.$$watchExpr("ngHide","aria-hidden",[],!1)}]).directive("ngValue",["$aria",function(e){return e.$$watchExpr("ngValue","aria-checked",r,!1)}]).directive("ngChecked",["$aria",function(e){return e.$$watchExpr("ngChecked","aria-checked",r,!1)}]).directive("ngReadonly",["$aria",function(e){return e.$$watchExpr("ngReadonly","aria-readonly",r,!1)}]).directive("ngRequired",["$aria",function(e){return e.$$watchExpr("ngRequired","aria-required",r,!1)}]).directive("ngModel",["$aria",function(e){function t(t,n,o,a){return e.config(n)&&!o.attr(t)&&(a||!s(o,r))&&("hidden"!==o.attr("type")||"INPUT"!==o[0].nodeName)}function o(e,t){return!t.attr("role")&&t.attr("type")===e&&!s(t,r)}return{restrict:"A",require:"ngModel",priority:200,compile:function(r,s){if(!s.hasOwnProperty(n)){var a=function(e,t){var n=e.type,o=e.role;return"checkbox"===(n||o)||"menuitemcheckbox"===o?"checkbox":"radio"===(n||o)||"menuitemradio"===o?"radio":"range"===n||"progressbar"===o||"slider"===o?"range":""}(s);return{post:function(n,r,s,i){var d=t("tabindex","tabindex",r,!1);function u(){return i.$modelValue}switch(a){case"radio":case"checkbox":o(a,r)&&r.attr("role",a),t("aria-checked","ariaChecked",r,!1)&&n.$watch(u,"radio"===a?function(e){var t=s.value==i.$viewValue;r.attr("aria-checked",t)}:function(){r.attr("aria-checked",!i.$isEmpty(i.$viewValue))}),d&&r.attr("tabindex",0);break;case"range":if(o(a,r)&&r.attr("role","slider"),e.config("ariaValue")){var m=!r.attr("aria-valuemin")&&(s.hasOwnProperty("min")||s.hasOwnProperty("ngMin")),l=!r.attr("aria-valuemax")&&(s.hasOwnProperty("max")||s.hasOwnProperty("ngMax")),_=!r.attr("aria-valuenow");m&&s.$observe("min",(function(e){r.attr("aria-valuemin",e)})),l&&s.$observe("max",(function(e){r.attr("aria-valuemax",e)})),_&&n.$watch(u,(function(e){r.attr("aria-valuenow",e)}))}d&&r.attr("tabindex",0)}!s.hasOwnProperty("ngRequired")&&i.$validators.required&&t("aria-required","ariaRequired",r,!1)&&s.$observe("required",(function(){r.attr("aria-required",!!s.required)})),t("aria-invalid","ariaInvalid",r,!0)&&n.$watch((function(){return i.$invalid}),(function(e){r.attr("aria-invalid",!!e)}))}}}}}}]).directive("ngDisabled",["$aria",function(e){return e.$$watchExpr("ngDisabled","aria-disabled",r,!1)}]).directive("ngMessages",(function(){return{restrict:"A",require:"?ngMessages",link:function(e,t,o,r){o.hasOwnProperty(n)||t.attr("aria-live")||t.attr("aria-live","assertive")}}})).directive("ngClick",["$aria","$parse",function(e,t){return{restrict:"A",compile:function(o,a){if(!a.hasOwnProperty(n)){var i=t(a.ngClick);return function(t,n,o){s(n,r)||(e.config("bindRoleForClick")&&!n.attr("role")&&n.attr("role","button"),e.config("tabindex")&&!n.attr("tabindex")&&n.attr("tabindex",0),!e.config("bindKeydown")||o.ngKeydown||o.ngKeypress||o.ngKeyup||n.on("keydown",(function(e){var n=e.which||e.keyCode;13!==n&&32!==n||(-1!==r.indexOf(e.target.nodeName)||e.target.isContentEditable||e.preventDefault(),t.$apply((function(){i(t,{$event:e})})))})))}}}}}]).directive("ngDblclick",["$aria",function(e){return function(t,o,a){a.hasOwnProperty(n)||!e.config("tabindex")||o.attr("tabindex")||s(o,r)||o.attr("tabindex",0)}}])}(window,window.angular)},"./node_modules/angular-rateit/dist/ng-rateit.js":()=>{angular.module("ngRateIt",["ng"]).directive("ngRateIt",["$q",function(e){"use strict";return{scope:{ngModel:"=",min:"=?min",max:"=?max",step:"=?step",readOnly:"&?readOnly",pristine:"=?pristine",resetable:"&?resetable",starWidth:"=?starWidth",starHeight:"=?starHeight",canelWidth:"=?canelWidth",cancelHeight:"=?cancelHeight",rated:"&?rated",reset:"&?reset",beforeRated:"&?beforeRated",beforeReset:"&?beforeReset"},templateUrl:"ngRateIt/ng-rate-it.html",require:"ngModel",replace:!0,link:function(t,n,o){o.readOnly||(t.readOnly=function(){return!1}),o.resetable||(t.resetable=function(){return!0}),o.beforeRated||(t.beforeRated=function(){var t=e.defer();return t.resolve(),t.promise}),o.rated||(t.rated=function(){}),o.beforeReset||(t.beforeReset=function(){var t=e.defer();return t.resolve(),t.promise}),o.reset||(t.reset=function(){})},controller:"ngRateItController"}}]).controller("ngRateItController",["$scope","$timeout",function(e,t){"use strict";e.isTouch=!!window.hasOwnProperty("ontouchstart")||window.navigator.msMaxTouchPoints>0,e.orgValue=angular.copy(e.ngModel),e.min=e.min||0,e.max=e.max||5,e.step=e.step||.5,e.pristine=e.orgValue===e.ngModel,e.starWidth=e.starWidth||16,e.starPartWidth=e.starWidth*e.step,e.starHeight=e.starHeight||16,e.canelWidth=e.canelWidth||e.starWidth,e.cancelHeight=e.cancelHeight||e.starHeight;var n=e.max-e.min,o=n/e.step,r=e.$watch("ngModel",(function(){e.pristine=e.orgValue===e.ngModel})),s=function(e){return(e+1)/o*n};e.getStartParts=function(){return new Array(o)},e.getStarOffset=function(t){var n=1/e.step;return-e.starWidth/n*(t%n)},e.isSelected=function(t){return s(t)<=e.ngModel-e.min},e.removeRating=function(){e.resetable()&&!e.readOnly()&&e.beforeReset({rating:e.ngModel}).then((function(){e.ngModel=e.min,e.reset({rating:e.ngModel})}))},e.setValue=function(n){if(!e.readOnly()){var o=angular.copy(e.min+s(n));e.beforeRated({rating:o}).then((function(){e.ngModel=o,t((function(){e.rated({rating:e.ngModel})}))}))}},e.$on("$destroy",(function(){r()}))}]).run(["$templateCache",function(e){"use strict";e.put("ngRateIt/ng-rate-it.html",'
')}])},"./src/js/index.module.js":(e,t,n)=>{"use strict";n("./node_modules/angular-animate/index.js"),n("./node_modules/angular-aria/index.js"),n("./node_modules/angular-messages/index.js"),n("./node_modules/angular-material/index.js"),n("./node_modules/angular-resource/index.js"),n("./node_modules/angular-sanitize/index.js"),n("./node_modules/ng-csv/build/ng-csv.min.js"),n("./node_modules/ng-embed/src/ng-embed.js");var o=n("./node_modules/@uirouter/angularjs/lib-esm/index.js"),r=(n("./node_modules/angular-local-storage/index.js"),n("./node_modules/angular-rateit/dist/ng-rateit.js"),n("./node_modules/@flowjs/ng-flow/dist/ng-flow.js"),n("./node_modules/emojionearea/dist/emojionearea.js"),n("./node_modules/jquery-textcomplete/dist/jquery.textcomplete.js"),n("./node_modules/moment/moment.js")),s=n.n(r),a=n("./node_modules/lodash.map/index.js"),i=n.n(a);function d(e,t,n,o,r,a,d,u,m,l){const _=this;function c(n){a.updateStorage(u,{up:n}).then((o=>{var r;e.layout=o,r=!0===n?"show":"hide",t.parent.postMessage({cmd:r},"*"),l((()=>{e.$apply()}))})).catch(a.onStorageError)}_.$onInit=function(){console.debug("IndexController::onInit() VISITOR",e.visitor),e.status="init";const o=e.settings.color,s=e.settings.textColor,i=e.settings.textButtonColor||e.settings.textColor,d=e.settings.color_button,l=e.settings.backgroundColor,_=Math.max(document.documentElement.clientHeight,window.innerHeight||0),h=document.documentElement.clientWidth;document.documentElement.style.setProperty("--xc-ws-div-color",o),document.documentElement.style.setProperty("--xc-ws-text-color",s),document.documentElement.style.setProperty("--xc-ws-text-button-color",i),document.documentElement.style.setProperty("--xc-ws-button-color",d),document.documentElement.style.setProperty("--xc-ws-background-color",l),document.documentElement.style.setProperty("--xc-ws-client-height",_),document.documentElement.style.setProperty("--xc-ws-client-width",h);let f=!1;const p=t=>null!==t&&t[e.location]||{},M=a.getItem(m).then(p),y=a.getItem(u).then(p);r.all([M,y]).then((r=>{let[a,i]=r;e.visitor=a,e.layout=i,e.visitor.interaction&&e.layout.up?f=!0:e.layout.up=!0,"bottom_right"===e.settings.alignment&&c(f),n.go(function(){var t,n;const o=e.settings.online,r=!(null==e||null===(t=e.visitor)||void 0===t||null===(n=t.interaction)||void 0===n||!n.id),s=Number(e.settings.maxInteractions)&&Number(e.settings.openedInteractions)>=Number(e.settings.maxInteractions);return!!(r||!s&&o)}()?"app.online":"app.offline",null,{location:"replace"});let d="";d=e.settings.online||!e.settings.hideWhenOffline?"init":"offline",t.parent.postMessage({cmd:d,div_color:o,text_color:s,client_height:_,client_width:h},"*");const u=document.createElement("style");document.head.appendChild(u),u.sheet.insertRule(".mdi-send:before {color:"+e.settings.color+"!important}")})).catch(a.onStorageError)},_.close=function(){const t=e.visitor.interaction;if(t&&t.id){const r=o.confirm().parent(angular.element(document.querySelector("#chat-app"))).clickOutsideToClose(!0).title(e.settings.closingQuestion||"Do you want to close the interaction?").ok("Ok").cancel("Cancel");o.show(r).then((function(){return d.chatInteraction.customUpdate({id:t.id,closed:!0,closeReason:"contact"}).$promise})).then((function(){n.go("app.closing",null,{location:"replace"})})).catch((function(e){console.error("keep open",e)}))}},_.toggle=c,_.download=function(){const t=r.defer(),n=e.visitor.interaction;return n&&n.id&&d.chatInteraction.getMessages({intid:n.id,includeAll:!0}).$promise.then((function(n){t.resolve(i()(n.rows.slice(1),(function(t){let n;if("in"===t.direction&&(n=e.settings.customerAlias||e.visitor.from||"Visitor"+t.ContactId),"out"===t.direction)switch(e.settings.agentIdentifier){case"website_alias":n=t.UserId?e.settings.agentAlias+t.UserId:"System";break;case"agent_alias":n=t.UserId?t.User.alias||t.User.fullname:"System";break;case"agent_fullname":n=t.UserId?t.User.fullname:"System";break;default:n=t.UserId?e.settings.agentAlias+t.UserId:"System"}return{sender:n,message:t.body,createdAt:s()(t.createdAt).format("MM/DD/YYYY HH:mm:ss")}})))})).catch((function(e){console.error(e)})),t.promise},_.getHeaderShape=function(){return"rounded"===e.settings.header_shape?"15px":"0px"};const h={online:["online","chat","waiting","closing","unmanaged"],offline:["offline"]};Object.defineProperty(e,"actualTitle",{get(){let t=e.settings.defaultTitle;return h.online.includes(e.status)?t=e.settings.header_online:h.offline.includes(e.status)&&(t=e.settings.header_offline),t}}),window.addEventListener("message",(function(e){"show"===e.data.evt?c(!0):"hide"===e.data.evt&&c(!1)}),!1)}d.$inject=["$rootScope","$window","$state","$mdDialog","$q","RemoteStorageService","api","STORAGE_LAYOUT","STORAGE_VISITOR","$timeout"];var u=n("./node_modules/lodash.forin/index.js"),m=n.n(u),l=n("./node_modules/lodash.isnil/index.js"),_=n.n(l),c=n("./src/js/chat/chat.tpl.html"),h=n("./src/js/closing/closing.tpl.html"),f=n("./src/js/offline/offline.tpl.html"),p=n("./src/js/online/online.tpl.html"),M=n("./src/js/unmanaged/unmanaged.tpl.html"),y=n("./src/js/waiting/waiting.tpl.html");function L(e,t){const n=t.search();e.settings={cursor:"pointer",hide:!0},m()(n,(function(t,n){""===t||_()(t)||("true"===t&&(t=!0),"false"===t&&(t=!1),e.settings[n]=t)})),e.location=e.settings.location,e.layout={up:!1},e.visitor={}}function g(e,t,n,o,r){t.html5Mode(!0),n.defaults.headers.get||(n.defaults.headers.get={}),n.defaults.headers.get["If-Modified-Since"]="Mon, 26 Jul 1997 05:00:00 GMT",n.defaults.headers.get["Cache-Control"]="no-cache",n.defaults.headers.get.Pragma="no-cache",o.setPrefix(r),e.state("app",{abstract:!0}).state("app.waiting",{url:"/waiting",templateUrl:y,controller:"WaitingController as vm"}).state("app.online",{url:"/online",templateUrl:p,controller:"OnlineController as vm"}).state("app.offline",{url:"/offline",templateUrl:f,controller:"OfflineController as vm"}).state("app.chat",{url:"/chat",templateUrl:c,controller:"ChatController as vm"}).state("app.unmanaged",{url:"/unmanaged",templateUrl:M,controller:"UnmanagedController as vm"}).state("app.closing",{url:"/closing",templateUrl:h,controller:"ClosingController as vm"})}g.$inject=["$stateProvider","$locationProvider","$httpProvider","localStorageServiceProvider","STORAGE_PREFIX"],L.$inject=["$rootScope","$location"];var Y=n("./node_modules/lodash.merge/index.js"),v=n.n(Y);function k(e,t,n,o,r,s,a,i){const d=this;function u(t){return function(o){d.errors[t]=o.data;const r=n.simple().textContent(e.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").position("top");n.show(r)}}function m(){e.loading=!1}function l(){e.settings.online?t.go("app.online",null,{location:"replace"}):t.go("app.offline",null,{location:"replace"})}function _(){d.form={},d.upColor=null,d.downColor=null,d.userForm.$setPristine(),d.userForm.$setUntouched(),delete e.visitor.interaction,e.enableDownload=!1}d.$onInit=function(){console.debug("ClosingController::onInit() VISITOR",e.visitor),e.status="closing",r.all([s.removeItem(a).then((()=>console.debug("STORAGE_VISITOR cleared"))).catch(s.onStorageError),s.removeItem(i).then((()=>console.debug("STORAGE_LAYOUT cleared"))).catch(s.onStorageError)]).then((()=>e.loading=!1))},d.submit=function(){e.loading=!0,e.visitor.interaction&&e.visitor.interaction.id?o.chatInteraction.close(v()({id:e.visitor.interaction.id,ratingType:e.settings.ratingType,customer:e.settings.customerAlias||e.visitor.from},d.form)).$promise.then((function(){delete d.errors.submit;const t=n.simple().textContent(e.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(t)})).then(_).then(l).catch(u("submit")).finally(m):(m(),u("submit"))},d.skip=function(){_(),l()},d.form={},d.errors={}}function j(e,t){const n={id:"@id",token:e.settings.token},o={};return o.baseUrl=e.settings.remote+"/api/",o.chatWebsite=t(o.baseUrl+"chat/websites/:id",n,{notify:{method:"POST",url:o.baseUrl+"chat/websites/:id/notify"},offline:{method:"POST",url:o.baseUrl+"chat/websites/:id/offline"},getFields:{method:"GET",url:o.baseUrl+"chat/websites/:id/fields"}}),o.chatInteraction=t(o.baseUrl+"chat/interactions/:id",n,{update:{method:"PUT",url:o.baseUrl+"chat/interactions/:id"},customUpdate:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/custom_update"},close:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/close"},getMessages:{method:"GET",url:o.baseUrl+"chat/interactions/:intid/my_messages"},uploadAttachment:{method:"POST",url:o.baseUrl+"chat/interactions/:id/attachment_upload",headers:{"Content-Type":void 0},transformRequest:angular.identity},downloadAttachment:{method:"GET",url:o.baseUrl+"chat/interactions/:id/attachment_download"},abandon:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/abandon"}}),o.chatMessage=t(o.baseUrl+"chat/messages/:id",n,{update:{method:"PUT",url:o.baseUrl+"chat/messages/:id"}}),o}k.$inject=["$rootScope","$state","$mdToast","api","$q","RemoteStorageService","STORAGE_VISITOR","STORAGE_LAYOUT"],j.$inject=["$rootScope","$resource"];var w=n("./node_modules/lodash.find/index.js"),b=n.n(w),D=n("./node_modules/lodash.values/index.js"),T=n.n(D),S=n("./node_modules/jquery/dist/jquery.js");function H(e,t,n,r,s,a,i,d,u,m,l){const c=this;let h,f,p,M;function y(){o.$q.all([u.removeItem(m).then((()=>console.debug("STORAGE_VISITOR cleared"))).catch(u.onStorageError),u.removeItem(l).then((()=>console.debug("STORAGE_LAYOUT cleared"))).catch(u.onStorageError)]).then((()=>{t.settings.online?a.go("app.online",null,{location:"replace"}):a.go("app.offline",null,{location:"replace"})}))}function L(){n((function(){const e=s[0].getElementsByClassName("chat-messages")[0];e&&(e.scrollTop=e.scrollHeight)}))}function g(e){return function(t){c.errors[e]=t.data,L()}}function Y(e){d.chatWebsite.notify(e).$promise.then((function(e){delete c.errors.chatMessageError;let n=!1;_()(t.visitor.interaction)&&(t.visitor.interaction={id:e.interaction.id},n=!0),t.visitor.interactionStarted||(t.visitor.interactionStarted=!0,n=!0),n&&u.updateStorage(m,t.visitor).then((e=>{t.visitor=e})).catch(u.onStorageError),h[0].emojioneArea.setText(""),L()})).catch(g("chatMessageError"))}function k(){t.visitor&&t.visitor.interaction&&t.visitor.interaction.id&&d.chatInteraction.get({id:t.visitor.interaction.id}).$promise.then((function(e){delete c.errors.getInteraction,e.closed&&(t.visitor.interaction.closed=!0,u.updateStorage(m,t.visitor).then((e=>{t.visitor=e})).catch(u.onStorageError),"unmanaged"===e.disposition?a.go("app.unmanaged",null,{location:"replace"}):a.go("app.closing",null,{location:"replace"}))})).catch((function(e){switch(e.status){case 403:a.go("app.closing",null,{location:"replace"});break;case 404:y();break;case 405:a.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}function j(e){const n=h[0].emojioneArea.getText();e&&13===e.keyCode&&e.shiftKey||e&&13!==e.keyCode||""!==n&&Y(v()({body:n},t.visitor))}function w(){var e,n;null!=t&&null!==(e=t.visitor)&&void 0!==e&&null!==(n=e.interaction)&&void 0!==n&&n.id&&d.chatInteraction.getMessages({intid:t.visitor.interaction.id,includeAgent:!0,id:M||void 0}).$promise.then((function(e){if(delete c.errors.interaction,e.count){let o=!1,r=0;for(r=0,o=!1;r{t.visitor=e}))}var n})).catch((function(e){switch(e.status){case 403:a.go("app.closing",null,{location:"replace"});break;case 405:a.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}c.errors={},t.messages=[],c.emojiOptions={watchEmbedData:!1,fontSmiley:!1,emoji:!0,link:!0,linkTarget:"_blank"},c.$onInit=function(){console.debug("ChatController::onInit() VISITOR",t.visitor),t.status="chat",t.loading=!1,t.settings.showMenu=!0,c.replyMessage="",t.visitor.interaction&&t.visitor.interaction.closed?y():(k(),f=r(w,2e3),p=r(k,3e3)),h=S("#emojionearea").emojioneArea({placeholder:t.settings.placeholderMessage||"Type a message",events:{keyup:function(e,t){j(t)},ready:function(){this.setFocus()}}})},c.reply=j,c.reply_button=function(){const e=h[0].emojioneArea.getText();""!==e&&(Y(v()({body:e},t.visitor)),h[0].emojioneArea.setFocus())},c.fileAdded=function(e){const n=new FormData;n.append("file",e.file),i.post(t.settings.remote+"/api/chat/interactions/"+t.visitor.interaction.id+"/attachment_upload?token="+t.settings.token,n,{transformRequest:angular.identity,headers:{"Content-Type":void 0}}).then((function(e){(e=e.data).id?(delete c.errors.sendAttachment,Y(v()({body:''+e.name+"",AttachmentId:e.id},t.visitor))):g("sendAttachment")}),g("sendAttachment"))},e.$on("$destroy",(function(){r.cancel(f),r.cancel(p),f=null,p=null})),t.$on("$download",(function(e,n){n&&n(T()(t.messages))}))}H.$inject=["$scope","$rootScope","$timeout","$interval","$document","$state","$http","api","RemoteStorageService","STORAGE_VISITOR","STORAGE_LAYOUT"];var x=n("./node_modules/lodash.random/index.js"),E=n.n(x),P=n("./node_modules/lodash.clonedeep/index.js"),O=n.n(P),$=n("./node_modules/json-form-data/src/jsonToFormData.js"),A=n.n($);function R(e,t,n,o,r,s,a){const i=this;let d=null,u=null;t.typeField="";const m={showLeafArrayIndexes:!0,includeNullValues:!1,mapping:function(e){return"boolean"==typeof e?+e?"1":"0":e}};function l(){delete i.errors.submit,t.$emit("hide"),i.fields=O()(u),i.form={},i.userForm.$setPristine(),i.userForm.$setUntouched();const e=r.simple().textContent(t.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));r.show(e)}i.trustAsHtml=function(e){return n.trustAsHtml(e)},i.initUploadButton=function(t){const n=i.fields[t],o=s.find(".upload-item");if(o.length){const t=angular.element(o[0].querySelector(".upload-button")),r=angular.element(o[0].querySelector("input[type=file]")),s=t.find("label");s.length&&s.css("display","none"),t.on("click",(()=>{s.css("display","none"),"function"==typeof r.trigger?r.trigger("click"):r[0].click()})),r.on("change",(t=>{e.$apply((function(){"string"==typeof n.props.error&&(n.props.error=null);const e=Array.from(t.target.files),o=1048576*n.config.size;e.some((e=>e.size>=o))?(n.options=[],n.props.error=n.config.sizeErrMessage):n.options=e.map((e=>{const{name:t,size:n,type:o}=e;return{name:t,size:n,type:o,file:e}})),i.form[n.props.title]=n.options}))}))}},i.removeFileItem=function(e,t){e.options.splice(t,1),i.form[e.props.title]=e.options},i.setupFileInput=function(e){console.log("form item setup",e);const t=s.find(".upload-item"),n=angular.element(t[0].querySelector("input[type=file]")),{multipleUpload:o,accept:r}=e.config;o&&n.attr("multiple","multiple"),r&&n[0].setAttribute("accept",r)},i.makeFileOptionsVisible=function(){const e=Array.from(s.find(".filename-label")),t=e[e.length-1];t&&t.scrollIntoView&&t.scrollIntoView()},i.$onInit=function(){console.debug("OfflineController::onInit() VISITOR",t.visitor),t.status="offline",i.visitor={id:t.settings.id,mapKeyOffline:"firstName",from:"Anonymous"+E()(1,1e6)},t.settings.showMenu=!1,t.loading=!1,o.chatWebsite.getFields({id:t.settings.id,online:!1}).$promise.then((function(e){e.count&&(d=e.fromKey,u=O()(e.rows),i.fields=O()(u))})).then((function(){for(let e=0;e]+)>)/i);i.checkHTML[e]=t(n.props.helpText)}}})).catch((function(e){console.error(e)}))},i.submit=function(){t.loading=!0;const e={...i.form};for(let n=0;ne.file))))}const n=Array.isArray(i.fields)?i.fields.filter((e=>"upload"===e.type)):[],s=v()({body:e},i.visitor),u=null!=e&&n.length>0,c=null!==e&&"{}"!==JSON.stringify(e);var h,f;(u?(h=s,a({url:`${o.baseUrl}chat/websites/${h.id}/offline`,headers:{"Content-Type":void 0},data:A()(h,{...m,initialFormData:new FormData}),method:"POST"})):c?o.chatWebsite.offline(s).$promise:Promise.reject("INVALID_FORM")).then(l).catch((f="submit",function(e){const n=r.simple().textContent(t.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").parent(angular.element(document.querySelector("#chat-toolbar")));r.show(n),i.errors[f]=e.data})).finally((()=>{i.form.invalid||(i.form={}),t.loading=!1}))},i.toggle=function(e,t){i.form[e]||(i.form[e]=[]);const n=i.form[e].indexOf(t);n>-1?i.form[e].splice(n,1):i.form[e].push(t)},i.exists=function(e,t){return i.form[e]||(i.form[e]=[]),i.form[e].indexOf(t)>-1},i.checkHTML=[],i.form={},i.errors={},i.userForm={}}function F(e,t,n,o,r,s){const a=this;let i=null;function d(){return e.visitor={id:e.settings.id,mapKey:"firstName",from:"Anonymous"+E()(1,1e6)},e.settings.showMenu=!1,r.updateStorage(s,e.visitor).then((t=>(e.visitor=t,o.chatWebsite.getFields({id:e.settings.id,online:!0}).$promise.then((function(e){e.count&&(i=e.fromKey,a.fields=e.rows)})).then((function(){for(let e=0;e]+)>)/i);a.checkHTML[e]=n(t.props.helpText)}}})).catch((function(e){console.error(e)}))))).catch(r.onStorageError)}a.checkHTML=[],a.form={},a.errors={},a.userForm={},a.disableItem=!1,a.trustAsHtml=function(e){return n.trustAsHtml(e)},a.$onInit=function(){if(console.debug("OnlineController::onInit() VISITOR",e.visitor),e.status="online",e.visitor&&e.visitor.interaction)if(e.visitor.interaction.id)if(!0===e.visitor.interactionStarted)t.go("app.chat",null,{location:"replace"});else{var n,r;const t=e.visitor.interaction.id,s=null==e||null===(n=e.visitor)||void 0===n||null===(r=n.message)||void 0===r?void 0:r.id;if(s){const e={id:t,channel:"chat",interaction:{id:t},message:{id:s},disposition:"abandoned",closed:!0,closeReason:"contact"};o.chatInteraction.abandon(e).$promise.finally((()=>d()))}}else t.go("app.waiting",null,{location:"replace"});else d()},a.submit=function(){let n="New chat request \n";for(let t=0;t{e.visitor=t})).catch(r.onStorageError),a.disableItem=!1,e.settings.enableCustomerWriting?t.go("app.chat",null,{location:"replace"}):t.go("app.waiting",null,{location:"replace"})})).catch((function(e){a.disableItem=!1,console.error(e)}))},a.toggle=function(e,t){a.form[e]||(a.form[e]=[]);const n=a.form[e].indexOf(t);n>-1?a.form[e].splice(n,1):a.form[e].push(t)},a.exists=function(e,t){return a.form[e]||(a.form[e]=[]),a.form[e].indexOf(t)>-1}}function W(e,t,n,o,r,s,a,i){const d=this;function u(){e.settings.online?t.go("app.online",null,{location:"replace"}):t.go("app.offline",null,{location:"replace"})}function m(){d.form={},d.upColor=null,d.downColor=null,d.userForm.$setPristine(),d.userForm.$setUntouched(),e.visitor={},e.enableDownload=!1,e.$emit("hide")}function l(t){return function(o){d.errors[t]=o.data;const r=n.simple().textContent(e.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(r)}}function _(){e.loading=!1}d.form={},d.errors={},d.$onInit=function(){console.debug("UnmanagedController::onInit() VISITOR",e.visitor),e.status="unmanaged",r.all([s.removeItem(a).then((()=>console.debug("STORAGE_VISITOR cleared"))).catch(s.onStorageError),s.removeItem(i).then((()=>console.debug("STORAGE_LAYOUT cleared"))).catch(s.onStorageError)]).then((()=>e.loading=!1))},d.submit=function(){e.loading=!0,e.visitor.interaction&&e.visitor.interaction.id?o.chatInteraction.customUpdate({id:e.visitor.interaction.id,note:d.form.note}).$promise.then((function(){delete d.errors.submit;const t=n.simple().textContent(e.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(t)})).then(m).then(u).catch(l("submit")).finally(_):(_(),l("submit"))},d.skip=function(){m(),u()}}function C(e,t,n,o,r,s,a){let i=null;function d(){let t={},n=!1;r.chatInteraction.get({id:e.visitor.interaction.id}).$promise.then((function(n){return t=n,r.chatInteraction.getMessages({intid:e.visitor.interaction.id}).$promise})).then((function(r){n=r.rows.length>1,t.closed?(e.visitor.interaction.closed=!0,s.updateStorage(a,e.visitor).then((n=>{e.visitor=n,"unmanaged"===t.disposition&&o.go("app.unmanaged",null,{location:"replace"})})).catch(s.onStorageError)):(t.UserId||n)&&(t.UserId&&(e.visitor.interaction.UserId=t.UserId),s.updateStorage(a,{...e.visitor,interactionStarted:!0}).then((t=>{e.visitor=t,o.go("app.chat",null,{location:"replace"})})).catch(s.onStorageError))})).catch((function(e){switch(e.status){case 403:o.go("app.closing",null,{location:"replace"});break;case 405:o.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}this.$onInit=function(){console.debug("WaitingController::onInit() VISITOR",e.visitor),e.status="waiting",e.visitor&&e.visitor.interaction&&e.visitor.interaction.id&&(i=n(d,3e3))},t.$on("$destroy",(function(){n.cancel(i)}))}function I(e,t){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.add(e)}function z(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}R.$inject=["$scope","$rootScope","$sce","api","$mdToast","$element","$http"],F.$inject=["$rootScope","$state","$sce","api","RemoteStorageService","STORAGE_VISITOR"],W.$inject=["$rootScope","$state","$mdToast","api","$q","RemoteStorageService","STORAGE_VISITOR","STORAGE_LAYOUT"],C.$inject=["$rootScope","$scope","$interval","$state","api","RemoteStorageService","STORAGE_VISITOR"];var J=new WeakSet,V=new WeakSet;class N{constructor(e,t,n){I(this,V),I(this,J),this.remoteAddress=new URL(t.settings.address).origin,this.location=t.settings.location,this.$q=n,this.$window=e}setItem(e,t){const n="setItem";return this.$q((o=>{z(this,J,U).call(this,n,e,(()=>{o()})),this.$window.parent.postMessage({action:n,key:e,value:t},this.remoteAddress)}))}getItem(e){const t="getItem";return this.$q((n=>{z(this,J,U).call(this,t,e,((e,t)=>{n(t)})),this.$window.parent.postMessage({action:t,key:e},this.remoteAddress)}))}removeItem(e){const t="removeItem";return this.$q((n=>{z(this,J,U).call(this,t,e,(()=>{n()})),this.$window.parent.postMessage({action:t,key:e},this.remoteAddress)}))}updateStorage(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.getItem(e).then((o=>{const r=z(this,V,q).call(this,o)||{};return n?delete r[this.location]:r[this.location]=t,this.setItem(e,r).then((()=>r[this.location]))}))}onStorageError(e){console.error("Storage Error",e)}}function U(e,t,n){const o=r=>{const s=`${e}Result`;if(r.origin===this.remoteAddress&&t===r.data.key&&s===r.data.action){const{action:e,item:s}=r.data;switch(console.debug(`[Key = ${t}] Action "${e}" event from parent`,r),e){case"setItemResult":n(t);break;case"getItemResult":n(t,s);break;case"removeItemResult":n(t);break;default:console.debug("Unsupported action",e)}this.$window.removeEventListener("message",o,!1)}};this.$window.addEventListener("message",o,!1)}function q(e){let t=e;if("string"==typeof t)try{t=JSON.parse(e)}catch(n){console.warn(`Could not parse "${e}"`,n),t=e}return t}function G(e){return function(t){return e.trustAsHtml(t)}}N.$inject=["$window","$rootScope","$q"],G.$inject=["$sce"],angular.module("motion-chat",["ngAnimate","ngAria","ngMessages","ngMaterial","ngResource","ngSanitize","ngCsv","ngEmbed","ui.router","LocalStorageModule","ngRateIt","flow"]).filter("toTrusted",G).constant("STORAGE_PREFIX","motion_chat").constant("STORAGE_VISITOR","visitor").constant("STORAGE_LAYOUT","layout").service("RemoteStorageService",N).directive("ngEnter",(function(){return function(e,t,n){t.bind("keydown keypress",(function(t){13===t.which&&(e.$apply((function(){e.$eval(n.ngEnter)})),t.preventDefault())}))}})).directive("ngPrint",(function(){return{link:function(e,t){t.on("click",(function(){document.getElementById("chatContent1")&&function(e,t){const n=document.createElement("div"),o=t.visitor,r=t.settings;let a;for(let e=0;e"+document.title+""),i.document.write(""),i.document.write("

Website: "+r.referer+"

"),i.document.write("

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

"),i.document.write("

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

"),i.document.write(n.innerHTML),i.document.write(""),i.document.close(),i.focus(),i.print(),i.close()}(0,e)}))},restrict:"A"}})).controller("ChatController",H).controller("ClosingController",k).config(["$mdGestureProvider",function(e){e.skipClickHijack()}]).controller("IndexController",d).factory("api",j).config(g).run(L).controller("OfflineController",R).config(["$mdGestureProvider",function(e){e.skipClickHijack()}]).controller("OnlineController",F).controller("UnmanagedController",W).controller("WaitingController",C)},"./node_modules/expose-loader/dist/runtime/getGlobalThis.js":(e,t,n)=>{"use strict";e.exports=function(){if("object"==typeof globalThis)return globalThis;var e;try{e=this||new Function("return this")()}catch(e){if("object"==typeof window)return window;if("object"==typeof self)return self;if(void 0!==n.g)return n.g}return e}()},"./node_modules/json-form-data/src/jsonToFormData.js":function(e,t){var n,o;(o=this)||(o={}),void 0===(n=function(){return o.jsonToFormData=function(){function e(e){return"[object Array]"==={}.toString.call(e)}function t(t){return!(e(t)||"object"!=typeof t||!t||t instanceof Blob||t instanceof Date)}function n(){return"function"==typeof FormData}function o(){if(n())return new FormData}function r(n,o,s,a){var i=0;for(var d in n){if(n.hasOwnProperty(d)){var u=a||d,m=o.mapping(n[d]);if(a&&t(n)&&(u=a+"["+d+"]"),a&&e(n)&&(u=e(m)||o.showLeafArrayIndexes?a+"["+i+"]":a+"[]"),e(m)||t(m))r(m,o,s,u);else if(m instanceof FileList)for(var l=0;l=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-dz.js":function(e,t,n){!function(e){"use strict";var t=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},n={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},o=function(e){return function(o,r,s,a){var i=t(o),d=n[e][t(o)];return 2===i&&(d=d[r?0:1]),d.replace(/%d/i,o)}},r=["جانفي","فيفري","مارس","أفريل","ماي","جوان","جويلية","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-dz",{months:r,monthsShort:r,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:o("s"),ss:o("s"),m:o("m"),mm:o("m"),h:o("h"),hh:o("h"),d:o("d"),dd:o("d"),M:o("M"),MM:o("M"),y:o("y"),yy:o("y")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:0,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-kw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-kw",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:0,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-ly.js":function(e,t,n){!function(e){"use strict";var t={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},n=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},o={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},r=function(e){return function(t,r,s,a){var i=n(t),d=o[e][n(t)];return 2===i&&(d=d[r?0:1]),d.replace(/%d/i,t)}},s=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-ly",{months:s,monthsShort:s,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:r("s"),ss:r("s"),m:r("m"),mm:r("m"),h:r("h"),hh:r("h"),d:r("d"),dd:r("d"),M:r("M"),MM:r("M"),y:r("y"),yy:r("y")},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-ma.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-sa.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"};e.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-tn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-tn",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},o=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},r={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},s=function(e){return function(t,n,s,a){var i=o(t),d=r[e][o(t)];return 2===i&&(d=d[n?0:1]),d.replace(/%d/i,t)}},a=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar",{months:a,monthsShort:a,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:s("s"),ss:s("s"),m:s("m"),mm:s("m"),h:s("h"),hh:s("h"),d:s("d"),dd:s("d"),M:s("M"),MM:s("M"),y:s("y"),yy:s("y")},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/az.js":function(e,t,n){!function(e){"use strict";var t={1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"};e.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"bir neçə saniyə",ss:"%d saniyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(e){return/^(gündüz|axşam)$/.test(e)},meridiem:function(e,t,n){return e<4?"gecə":e<12?"səhər":e<17?"gündüz":"axşam"},dayOfMonthOrdinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(e){if(0===e)return e+"-ıncı";var n=e%10;return e+(t[n]||t[e%100-n]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/be.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"хвіліна":"хвіліну":"h"===n?t?"гадзіна":"гадзіну":e+" "+(o=+e,r={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:t?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}e.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:t,mm:t,h:t,hh:t,d:"дзень",dd:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(e){return/^(дня|вечара)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночы":e<12?"раніцы":e<17?"дня":"вечара"},dayOfMonthOrdinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e%10!=2&&e%10!=3||e%100==12||e%100==13?e+"-ы":e+"-і";case"D":return e+"-га";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bg.js":function(e,t,n){!function(e){"use strict";e.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"яну_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Миналата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[Миналия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",ss:"%d секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",w:"седмица",ww:"%d седмици",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bm.js":function(e,t,n){!function(e){"use strict";e.defineLocale("bm",{months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo".split("_"),monthsShort:"Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des".split("_"),weekdays:"Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),weekdaysShort:"Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm"},calendar:{sameDay:"[Bi lɛrɛ] LT",nextDay:"[Sini lɛrɛ] LT",nextWeek:"dddd [don lɛrɛ] LT",lastDay:"[Kunu lɛrɛ] LT",lastWeek:"dddd [tɛmɛnen lɛrɛ] LT",sameElse:"L"},relativeTime:{future:"%s kɔnɔ",past:"a bɛ %s bɔ",s:"sanga dama dama",ss:"sekondi %d",m:"miniti kelen",mm:"miniti %d",h:"lɛrɛ kelen",hh:"lɛrɛ %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bn-bd.js":function(e,t,n){!function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn-bd",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/রাত|ভোর|সকাল|দুপুর|বিকাল|সন্ধ্যা|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t?e<4?e:e+12:"ভোর"===t||"সকাল"===t?e:"দুপুর"===t?e>=3?e:e+12:"বিকাল"===t||"সন্ধ্যা"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"রাত":e<6?"ভোর":e<12?"সকাল":e<15?"দুপুর":e<18?"বিকাল":e<20?"সন্ধ্যা":"রাত"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bn.js":function(e,t,n){!function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t&&e>=4||"দুপুর"===t&&e<5||"বিকাল"===t?e+12:e},meridiem:function(e,t,n){return e<4?"রাত":e<10?"সকাল":e<17?"দুপুর":e<20?"বিকাল":"রাত"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bo.js":function(e,t,n){!function(e){"use strict";var t={1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"},n={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"};e.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་1_ཟླ་2_ཟླ་3_ཟླ་4_ཟླ་5_ཟླ་6_ཟླ་7_ཟླ་8_ཟླ་9_ཟླ་10_ཟླ་11_ཟླ་12".split("_"),monthsShortRegex:/^(ཟླ་\d{1,2})/,monthsParseExact:!0,weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི_ཟླ_མིག_ལྷག_ཕུར_སངས_སྤེན".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",ss:"%d སྐར་ཆ།",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(e){return e.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,meridiemHour:function(e,t){return 12===e&&(e=0),"མཚན་མོ"===t&&e>=4||"ཉིན་གུང"===t&&e<5||"དགོང་དག"===t?e+12:e},meridiem:function(e,t,n){return e<4?"མཚན་མོ":e<10?"ཞོགས་ཀས":e<17?"ཉིན་གུང":e<20?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/br.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return e+" "+function(e,t){return 2===t?function(e){var t={m:"v",b:"v",d:"z"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}(e):e}({mm:"munutenn",MM:"miz",dd:"devezh"}[n],e)}function n(e){return e>9?n(e%10):e}var o=[/^gen/i,/^c[ʼ\']hwe/i,/^meu/i,/^ebr/i,/^mae/i,/^(mez|eve)/i,/^gou/i,/^eos/i,/^gwe/i,/^her/i,/^du/i,/^ker/i],r=/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,s=[/^Su/i,/^Lu/i,/^Me([^r]|$)/i,/^Mer/i,/^Ya/i,/^Gw/i,/^Sa/i];e.defineLocale("br",{months:"Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),weekdaysParse:s,fullWeekdaysParse:[/^sul/i,/^lun/i,/^meurzh/i,/^merc[ʼ\']her/i,/^yaou/i,/^gwener/i,/^sadorn/i],shortWeekdaysParse:[/^Sul/i,/^Lun/i,/^Meu/i,/^Mer/i,/^Yao/i,/^Gwe/i,/^Sad/i],minWeekdaysParse:s,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,monthsShortStrictRegex:/^(gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY HH:mm",LLLL:"dddd, D [a viz] MMMM YYYY HH:mm"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warcʼhoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Decʼh da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s ʼzo",s:"un nebeud segondennoù",ss:"%d eilenn",m:"ur vunutenn",mm:t,h:"un eur",hh:"%d eur",d:"un devezh",dd:t,M:"ur miz",MM:t,y:"ur bloaz",yy:function(e){switch(n(e)){case 1:case 3:case 4:case 5:case 9:return e+" bloaz";default:return e+" vloaz"}}},dayOfMonthOrdinalParse:/\d{1,2}(añ|vet)/,ordinal:function(e){return e+(1===e?"añ":"vet")},week:{dow:1,doy:4},meridiemParse:/a.m.|g.m./,isPM:function(e){return"g.m."===e},meridiem:function(e,t,n){return e<12?"a.m.":"g.m."}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bs.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=e+" ";switch(n){case"ss":return o+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return o+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return o+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return o+(1===e?"dan":"dana");case"MM":return o+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return o+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ca",{months:{standalone:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),format:"de gener_de febrer_de març_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.".split("_"),monthsParseExact:!0,weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dt_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"uns segons",ss:"%d segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cs.js":function(e,t,n){!function(e){"use strict";var t="leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),n="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),o=[/^led/i,/^úno/i,/^bře/i,/^dub/i,/^kvě/i,/^(čvn|červen$|června)/i,/^(čvc|červenec|července)/i,/^srp/i,/^zář/i,/^říj/i,/^lis/i,/^pro/i],r=/^(leden|únor|březen|duben|květen|červenec|července|červen|června|srpen|září|říjen|listopad|prosinec|led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i;function s(e){return e>1&&e<5&&1!=~~(e/10)}function a(e,t,n,o){var r=e+" ";switch(n){case"s":return t||o?"pár sekund":"pár sekundami";case"ss":return t||o?r+(s(e)?"sekundy":"sekund"):r+"sekundami";case"m":return t?"minuta":o?"minutu":"minutou";case"mm":return t||o?r+(s(e)?"minuty":"minut"):r+"minutami";case"h":return t?"hodina":o?"hodinu":"hodinou";case"hh":return t||o?r+(s(e)?"hodiny":"hodin"):r+"hodinami";case"d":return t||o?"den":"dnem";case"dd":return t||o?r+(s(e)?"dny":"dní"):r+"dny";case"M":return t||o?"měsíc":"měsícem";case"MM":return t||o?r+(s(e)?"měsíce":"měsíců"):r+"měsíci";case"y":return t||o?"rok":"rokem";case"yy":return t||o?r+(s(e)?"roky":"let"):r+"lety"}}e.defineLocale("cs",{months:t,monthsShort:n,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(leden|ledna|února|únor|březen|března|duben|dubna|květen|května|červenec|července|červen|června|srpen|srpna|září|říjen|října|listopadu|listopad|prosinec|prosince)/i,monthsShortStrictRegex:/^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:a,ss:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("cv",{months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ӗнер] LT [сехетре]",nextWeek:"[Ҫитес] dddd LT [сехетре]",lastWeek:"[Иртнӗ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(e){return e+(/сехет$/i.exec(e)?"рен":/ҫул$/i.exec(e)?"тан":"ран")},past:"%s каялла",s:"пӗр-ик ҫеккунт",ss:"%d ҫеккунт",m:"пӗр минут",mm:"%d минут",h:"пӗр сехет",hh:"%d сехет",d:"пӗр кун",dd:"%d кун",M:"пӗр уйӑх",MM:"%d уйӑх",y:"пӗр ҫул",yy:"%d ҫул"},dayOfMonthOrdinalParse:/\d{1,2}-мӗш/,ordinal:"%d-мӗш",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cy.js":function(e,t,n){!function(e){"use strict";e.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",ss:"%d eiliad",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},dayOfMonthOrdinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(e){var t="";return e>20?t=40===e||50===e||60===e||80===e||100===e?"fed":"ain":e>0&&(t=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"][e]),e+t},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/da.js":function(e,t,n){!function(e){"use strict";e.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"på dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[i] dddd[s kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",ss:"%d sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de-at.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de-ch.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-ch",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/dv.js":function(e,t,n){!function(e){"use strict";var t=["ޖެނުއަރީ","ފެބްރުއަރީ","މާރިޗު","އޭޕްރީލު","މޭ","ޖޫން","ޖުލައި","އޯގަސްޓު","ސެޕްޓެމްބަރު","އޮކްޓޯބަރު","ނޮވެމްބަރު","ޑިސެމްބަރު"],n=["އާދިއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"];e.defineLocale("dv",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/މކ|މފ/,isPM:function(e){return"މފ"===e},meridiem:function(e,t,n){return e<12?"މކ":"މފ"},calendar:{sameDay:"[މިއަދު] LT",nextDay:"[މާދަމާ] LT",nextWeek:"dddd LT",lastDay:"[އިއްޔެ] LT",lastWeek:"[ފާއިތުވި] dddd LT",sameElse:"L"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",ss:"d% ސިކުންތު",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:7,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/el.js":function(e,t,n){!function(e){"use strict";e.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(e,t){return e?"string"==typeof t&&/D/.test(t.substring(0,t.indexOf("MMMM")))?this._monthsGenitiveEl[e.month()]:this._monthsNominativeEl[e.month()]:this._monthsNominativeEl},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(e,t,n){return e>11?n?"μμ":"ΜΜ":n?"πμ":"ΠΜ"},isPM:function(e){return"μ"===(e+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){switch(this.day()){case 6:return"[το προηγούμενο] dddd [{}] LT";default:return"[την προηγούμενη] dddd [{}] LT"}},sameElse:"L"},calendar:function(e,t){var n,o=this._calendarEl[e],r=t&&t.hours();return n=o,("undefined"!=typeof Function&&n instanceof Function||"[object Function]"===Object.prototype.toString.call(n))&&(o=o.apply(t)),o.replace("{}",r%12==1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",ss:"%d δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},dayOfMonthOrdinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-au.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-gb.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-ie.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-il.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-il",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-in.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-in",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-nz.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-sg.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-sg",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/eo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mart_apr_maj_jun_jul_aŭg_sept_okt_nov_dec".split("_"),weekdays:"dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato".split("_"),weekdaysShort:"dim_lun_mard_merk_ĵaŭ_ven_sab".split("_"),weekdaysMin:"di_lu_ma_me_ĵa_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"[la] D[-an de] MMMM, YYYY",LLL:"[la] D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd[n], [la] D[-an de] MMMM, YYYY HH:mm",llll:"ddd, [la] D[-an de] MMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(e){return"p"===e.charAt(0).toLowerCase()},meridiem:function(e,t,n){return e>11?n?"p.t.m.":"P.T.M.":n?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd[n je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasintan] dddd[n je] LT",sameElse:"L"},relativeTime:{future:"post %s",past:"antaŭ %s",s:"kelkaj sekundoj",ss:"%d sekundoj",m:"unu minuto",mm:"%d minutoj",h:"unu horo",hh:"%d horoj",d:"unu tago",dd:"%d tagoj",M:"unu monato",MM:"%d monatoj",y:"unu jaro",yy:"%d jaroj"},dayOfMonthOrdinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-do.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-do",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-mx.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-mx",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:4},invalidDate:"Fecha inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-us.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-us",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4},invalidDate:"Fecha inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/et.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["mõne sekundi","mõni sekund","paar sekundit"],ss:[e+"sekundi",e+"sekundit"],m:["ühe minuti","üks minut"],mm:[e+" minuti",e+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[e+" tunni",e+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[e+" kuu",e+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[e+" aasta",e+" aastat"]};return t?r[n][2]?r[n][2]:r[n][1]:o?r[n][0]:r[n][1]}e.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:"%d päeva",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/eu.js":function(e,t,n){!function(e){"use strict";e.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),monthsParseExact:!0,weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",ss:"%d segundo",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fa.js":function(e,t,n){!function(e){"use strict";var t={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},n={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"};e.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(e){return/بعد از ظهر/.test(e)},meridiem:function(e,t,n){return e<12?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",ss:"%d ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(e){return e.replace(/[۰-۹]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},dayOfMonthOrdinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fi.js":function(e,t,n){!function(e){"use strict";var t="nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" "),n=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",t[7],t[8],t[9]];function o(e,o,r,s){var a="";switch(r){case"s":return s?"muutaman sekunnin":"muutama sekunti";case"ss":a=s?"sekunnin":"sekuntia";break;case"m":return s?"minuutin":"minuutti";case"mm":a=s?"minuutin":"minuuttia";break;case"h":return s?"tunnin":"tunti";case"hh":a=s?"tunnin":"tuntia";break;case"d":return s?"päivän":"päivä";case"dd":a=s?"päivän":"päivää";break;case"M":return s?"kuukauden":"kuukausi";case"MM":a=s?"kuukauden":"kuukautta";break;case"y":return s?"vuoden":"vuosi";case"yy":a=s?"vuoden":"vuotta"}return function(e,o){return e<10?o?n[e]:t[e]:e}(e,s)+" "+a}e.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fil.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fil",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",ss:"%d sekundir",m:"ein minuttur",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaður",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr-ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr-ch.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ch",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr.js":function(e,t,n){!function(e){"use strict";var t=/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,n=[/^janv/i,/^févr/i,/^mars/i,/^avr/i,/^mai/i,/^juin/i,/^juil/i,/^août/i,/^sept/i,/^oct/i,/^nov/i,/^déc/i];e.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsRegex:t,monthsShortRegex:t,monthsStrictRegex:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,monthsShortStrictRegex:/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?)/i,monthsParse:n,longMonthsParse:n,shortMonthsParse:n,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",w:"une semaine",ww:"%d semaines",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|)/,ordinal:function(e,t){switch(t){case"D":return e+(1===e?"er":"");default:case"M":case"Q":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fy.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),n="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_");e.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsParseExact:!0,weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",ss:"%d sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ga.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ga",{months:["Eanáir","Feabhra","Márta","Aibreán","Bealtaine","Meitheamh","Iúil","Lúnasa","Meán Fómhair","Deireadh Fómhair","Samhain","Nollaig"],monthsShort:["Ean","Feabh","Márt","Aib","Beal","Meith","Iúil","Lún","M.F.","D.F.","Samh","Noll"],monthsParseExact:!0,weekdays:["Dé Domhnaigh","Dé Luain","Dé Máirt","Dé Céadaoin","Déardaoin","Dé hAoine","Dé Sathairn"],weekdaysShort:["Domh","Luan","Máirt","Céad","Déar","Aoine","Sath"],weekdaysMin:["Do","Lu","Má","Cé","Dé","A","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Inniu ag] LT",nextDay:"[Amárach ag] LT",nextWeek:"dddd [ag] LT",lastDay:"[Inné ag] LT",lastWeek:"dddd [seo caite] [ag] LT",sameElse:"L"},relativeTime:{future:"i %s",past:"%s ó shin",s:"cúpla soicind",ss:"%d soicind",m:"nóiméad",mm:"%d nóiméad",h:"uair an chloig",hh:"%d uair an chloig",d:"lá",dd:"%d lá",M:"mí",MM:"%d míonna",y:"bliain",yy:"%d bliain"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gd.js":function(e,t,n){!function(e){"use strict";e.defineLocale("gd",{months:["Am Faoilleach","An Gearran","Am Màrt","An Giblean","An Cèitean","An t-Ògmhios","An t-Iuchar","An Lùnastal","An t-Sultain","An Dàmhair","An t-Samhain","An Dùbhlachd"],monthsShort:["Faoi","Gear","Màrt","Gibl","Cèit","Ògmh","Iuch","Lùn","Sult","Dàmh","Samh","Dùbh"],monthsParseExact:!0,weekdays:["Didòmhnaich","Diluain","Dimàirt","Diciadain","Diardaoin","Dihaoine","Disathairne"],weekdaysShort:["Did","Dil","Dim","Dic","Dia","Dih","Dis"],weekdaysMin:["Dò","Lu","Mà","Ci","Ar","Ha","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-màireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-dè aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",ss:"%d diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gl.js":function(e,t,n){!function(e){"use strict";e.defineLocale("gl",{months:"xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro".split("_"),monthsShort:"xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"domingo_luns_martes_mércores_xoves_venres_sábado".split("_"),weekdaysShort:"dom._lun._mar._mér._xov._ven._sáb.".split("_"),weekdaysMin:"do_lu_ma_mé_xo_ve_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(e){return 0===e.indexOf("un")?"n"+e:"en "+e},past:"hai %s",s:"uns segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gom-deva.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["थोडया सॅकंडांनी","थोडे सॅकंड"],ss:[e+" सॅकंडांनी",e+" सॅकंड"],m:["एका मिणटान","एक मिनूट"],mm:[e+" मिणटांनी",e+" मिणटां"],h:["एका वरान","एक वर"],hh:[e+" वरांनी",e+" वरां"],d:["एका दिसान","एक दीस"],dd:[e+" दिसांनी",e+" दीस"],M:["एका म्हयन्यान","एक म्हयनो"],MM:[e+" म्हयन्यानी",e+" म्हयने"],y:["एका वर्सान","एक वर्स"],yy:[e+" वर्सांनी",e+" वर्सां"]};return o?r[n][0]:r[n][1]}e.defineLocale("gom-deva",{months:{standalone:"जानेवारी_फेब्रुवारी_मार्च_एप्रील_मे_जून_जुलय_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),format:"जानेवारीच्या_फेब्रुवारीच्या_मार्चाच्या_एप्रीलाच्या_मेयाच्या_जूनाच्या_जुलयाच्या_ऑगस्टाच्या_सप्टेंबराच्या_ऑक्टोबराच्या_नोव्हेंबराच्या_डिसेंबराच्या".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"जाने._फेब्रु._मार्च_एप्री._मे_जून_जुल._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"आयतार_सोमार_मंगळार_बुधवार_बिरेस्तार_सुक्रार_शेनवार".split("_"),weekdaysShort:"आयत._सोम._मंगळ._बुध._ब्रेस्त._सुक्र._शेन.".split("_"),weekdaysMin:"आ_सो_मं_बु_ब्रे_सु_शे".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [वाजतां]",LTS:"A h:mm:ss [वाजतां]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [वाजतां]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [वाजतां]",llll:"ddd, D MMM YYYY, A h:mm [वाजतां]"},calendar:{sameDay:"[आयज] LT",nextDay:"[फाल्यां] LT",nextWeek:"[फुडलो] dddd[,] LT",lastDay:"[काल] LT",lastWeek:"[फाटलो] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s आदीं",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(वेर)/,ordinal:function(e,t){switch(t){case"D":return e+"वेर";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:0,doy:3},meridiemParse:/राती|सकाळीं|दनपारां|सांजे/,meridiemHour:function(e,t){return 12===e&&(e=0),"राती"===t?e<4?e:e+12:"सकाळीं"===t?e:"दनपारां"===t?e>12?e:e+12:"सांजे"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"राती":e<12?"सकाळीं":e<16?"दनपारां":e<20?"सांजे":"राती"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gom-latn.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["thoddea sekondamni","thodde sekond"],ss:[e+" sekondamni",e+" sekond"],m:["eka mintan","ek minut"],mm:[e+" mintamni",e+" mintam"],h:["eka voran","ek vor"],hh:[e+" voramni",e+" voram"],d:["eka disan","ek dis"],dd:[e+" disamni",e+" dis"],M:["eka mhoinean","ek mhoino"],MM:[e+" mhoineamni",e+" mhoine"],y:["eka vorsan","ek voros"],yy:[e+" vorsamni",e+" vorsam"]};return o?r[n][0]:r[n][1]}e.defineLocale("gom-latn",{months:{standalone:"Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr".split("_"),format:"Janerachea_Febrerachea_Marsachea_Abrilachea_Maiachea_Junachea_Julaiachea_Agostachea_Setembrachea_Otubrachea_Novembrachea_Dezembrachea".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Aitar_Somar_Mongllar_Budhvar_Birestar_Sukrar_Son'var".split("_"),weekdaysShort:"Ait._Som._Mon._Bud._Bre._Suk._Son.".split("_"),weekdaysMin:"Ai_Sm_Mo_Bu_Br_Su_Sn".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [vazta]",LTS:"A h:mm:ss [vazta]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [vazta]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [vazta]",llll:"ddd, D MMM YYYY, A h:mm [vazta]"},calendar:{sameDay:"[Aiz] LT",nextDay:"[Faleam] LT",nextWeek:"[Fuddlo] dddd[,] LT",lastDay:"[Kal] LT",lastWeek:"[Fattlo] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s adim",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(er)/,ordinal:function(e,t){switch(t){case"D":return e+"er";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:0,doy:3},meridiemParse:/rati|sokallim|donparam|sanje/,meridiemHour:function(e,t){return 12===e&&(e=0),"rati"===t?e<4?e:e+12:"sokallim"===t?e:"donparam"===t?e>12?e:e+12:"sanje"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"rati":e<12?"sokallim":e<16?"donparam":e<20?"sanje":"rati"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gu.js":function(e,t,n){!function(e){"use strict";var t={1:"૧",2:"૨",3:"૩",4:"૪",5:"૫",6:"૬",7:"૭",8:"૮",9:"૯",0:"૦"},n={"૧":"1","૨":"2","૩":"3","૪":"4","૫":"5","૬":"6","૭":"7","૮":"8","૯":"9","૦":"0"};e.defineLocale("gu",{months:"જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર".split("_"),monthsShort:"જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.".split("_"),monthsParseExact:!0,weekdays:"રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર".split("_"),weekdaysShort:"રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ".split("_"),weekdaysMin:"ર_સો_મં_બુ_ગુ_શુ_શ".split("_"),longDateFormat:{LT:"A h:mm વાગ્યે",LTS:"A h:mm:ss વાગ્યે",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm વાગ્યે",LLLL:"dddd, D MMMM YYYY, A h:mm વાગ્યે"},calendar:{sameDay:"[આજ] LT",nextDay:"[કાલે] LT",nextWeek:"dddd, LT",lastDay:"[ગઇકાલે] LT",lastWeek:"[પાછલા] dddd, LT",sameElse:"L"},relativeTime:{future:"%s મા",past:"%s પહેલા",s:"અમુક પળો",ss:"%d સેકંડ",m:"એક મિનિટ",mm:"%d મિનિટ",h:"એક કલાક",hh:"%d કલાક",d:"એક દિવસ",dd:"%d દિવસ",M:"એક મહિનો",MM:"%d મહિનો",y:"એક વર્ષ",yy:"%d વર્ષ"},preparse:function(e){return e.replace(/[૧૨૩૪૫૬૭૮૯૦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/રાત|બપોર|સવાર|સાંજ/,meridiemHour:function(e,t){return 12===e&&(e=0),"રાત"===t?e<4?e:e+12:"સવાર"===t?e:"બપોર"===t?e>=10?e:e+12:"સાંજ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"રાત":e<10?"સવાર":e<17?"બપોર":e<20?"સાંજ":"રાત"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/he.js":function(e,t,n){!function(e){"use strict";e.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",ss:"%d שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(e){return 2===e?"שעתיים":e+" שעות"},d:"יום",dd:function(e){return 2===e?"יומיים":e+" ימים"},M:"חודש",MM:function(e){return 2===e?"חודשיים":e+" חודשים"},y:"שנה",yy:function(e){return 2===e?"שנתיים":e%10==0&&10!==e?e+" שנה":e+" שנים"}},meridiemParse:/אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,isPM:function(e){return/^(אחה"צ|אחרי הצהריים|בערב)$/.test(e)},meridiem:function(e,t,n){return e<5?"לפנות בוקר":e<10?"בבוקר":e<12?n?'לפנה"צ':"לפני הצהריים":e<18?n?'אחה"צ':"אחרי הצהריים":"בערב"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hi.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},o=[/^जन/i,/^फ़र|फर/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सितं|सित/i,/^अक्टू/i,/^नव|नवं/i,/^दिसं|दिस/i];e.defineLocale("hi",{months:{format:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),standalone:"जनवरी_फरवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितंबर_अक्टूबर_नवंबर_दिसंबर".split("_")},monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},monthsParse:o,longMonthsParse:o,shortMonthsParse:[/^जन/i,/^फ़र/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सित/i,/^अक्टू/i,/^नव/i,/^दिस/i],monthsRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsShortRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsStrictRegex:/^(जनवरी?|फ़रवरी|फरवरी?|मार्च?|अप्रैल?|मई?|जून?|जुलाई?|अगस्त?|सितम्बर|सितंबर|सित?\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर?|दिसम्बर|दिसंबर?)/i,monthsShortStrictRegex:/^(जन\.?|फ़र\.?|मार्च?|अप्रै\.?|मई?|जून?|जुल\.?|अग\.?|सित\.?|अक्टू\.?|नव\.?|दिस\.?)/i,calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",ss:"%d सेकंड",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(e,t){return 12===e&&(e=0),"रात"===t?e<4?e:e+12:"सुबह"===t?e:"दोपहर"===t?e>=10?e:e+12:"शाम"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"रात":e<10?"सुबह":e<17?"दोपहर":e<20?"शाम":"रात"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hr.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=e+" ";switch(n){case"ss":return o+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return o+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return o+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return o+(1===e?"dan":"dana");case"MM":return o+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return o+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"Do MMMM YYYY",LLL:"Do MMMM YYYY H:mm",LLLL:"dddd, Do MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:return"[prošlu] [nedjelju] [u] LT";case 3:return"[prošlu] [srijedu] [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hu.js":function(e,t,n){!function(e){"use strict";var t="vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ");function n(e,t,n,o){var r=e;switch(n){case"s":return o||t?"néhány másodperc":"néhány másodperce";case"ss":return r+(o||t)?" másodperc":" másodperce";case"m":return"egy"+(o||t?" perc":" perce");case"mm":return r+(o||t?" perc":" perce");case"h":return"egy"+(o||t?" óra":" órája");case"hh":return r+(o||t?" óra":" órája");case"d":return"egy"+(o||t?" nap":" napja");case"dd":return r+(o||t?" nap":" napja");case"M":return"egy"+(o||t?" hónap":" hónapja");case"MM":return r+(o||t?" hónap":" hónapja");case"y":return"egy"+(o||t?" év":" éve");case"yy":return r+(o||t?" év":" éve")}return""}function o(e){return(e?"":"[múlt] ")+"["+t[this.day()]+"] LT[-kor]"}e.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan._feb._márc._ápr._máj._jún._júl._aug._szept._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(e){return"u"===e.charAt(1).toLowerCase()},meridiem:function(e,t,n){return e<12?!0===n?"de":"DE":!0===n?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return o.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return o.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:n,ss:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hy-am.js":function(e,t,n){!function(e){"use strict";e.defineLocale("hy-am",{months:{format:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),standalone:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_")},monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",ss:"%d վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(e){return/^(ցերեկվա|երեկոյան)$/.test(e)},meridiem:function(e){return e<4?"գիշերվա":e<12?"առավոտվա":e<17?"ցերեկվա":"երեկոյան"},dayOfMonthOrdinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(e,t){switch(t){case"DDD":case"w":case"W":case"DDDo":return 1===e?e+"-ին":e+"-րդ";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/id.js":function(e,t,n){!function(e){"use strict";e.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"siang"===t?e>=11?e:e+12:"sore"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"siang":e<19?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",ss:"%d detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/is.js":function(e,t,n){!function(e){"use strict";function t(e){return e%100==11||e%10!=1}function n(e,n,o,r){var s=e+" ";switch(o){case"s":return n||r?"nokkrar sekúndur":"nokkrum sekúndum";case"ss":return t(e)?s+(n||r?"sekúndur":"sekúndum"):s+"sekúnda";case"m":return n?"mínúta":"mínútu";case"mm":return t(e)?s+(n||r?"mínútur":"mínútum"):n?s+"mínúta":s+"mínútu";case"hh":return t(e)?s+(n||r?"klukkustundir":"klukkustundum"):s+"klukkustund";case"d":return n?"dagur":r?"dag":"degi";case"dd":return t(e)?n?s+"dagar":s+(r?"daga":"dögum"):n?s+"dagur":s+(r?"dag":"degi");case"M":return n?"mánuður":r?"mánuð":"mánuði";case"MM":return t(e)?n?s+"mánuðir":s+(r?"mánuði":"mánuðum"):n?s+"mánuður":s+(r?"mánuð":"mánuði");case"y":return n||r?"ár":"ári";case"yy":return t(e)?s+(n||r?"ár":"árum"):s+(n||r?"ár":"ári")}}e.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:n,ss:n,m:n,mm:n,h:"klukkustund",hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/it-ch.js":function(e,t,n){!function(e){"use strict";e.defineLocale("it-ch",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/it.js":function(e,t,n){!function(e){"use strict";e.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:function(){return"[Oggi a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextDay:function(){return"[Domani a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextWeek:function(){return"dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastDay:function(){return"[Ieri a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastWeek:function(){switch(this.day()){case 0:return"[La scorsa] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT";default:return"[Lo scorso] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"}},sameElse:"L"},relativeTime:{future:"tra %s",past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",w:"una settimana",ww:"%d settimane",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ja.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ja",{eras:[{since:"2019-05-01",offset:1,name:"令和",narrow:"㋿",abbr:"R"},{since:"1989-01-08",until:"2019-04-30",offset:1,name:"平成",narrow:"㍻",abbr:"H"},{since:"1926-12-25",until:"1989-01-07",offset:1,name:"昭和",narrow:"㍼",abbr:"S"},{since:"1912-07-30",until:"1926-12-24",offset:1,name:"大正",narrow:"㍽",abbr:"T"},{since:"1873-01-01",until:"1912-07-29",offset:6,name:"明治",narrow:"㍾",abbr:"M"},{since:"0001-01-01",until:"1873-12-31",offset:1,name:"西暦",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"紀元前",narrow:"BC",abbr:"BC"}],eraYearOrdinalRegex:/(元|\d+)年/,eraYearOrdinalParse:function(e,t){return"元"===t[1]?1:parseInt(t[1]||e,10)},months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiemParse:/午前|午後/i,isPM:function(e){return"午後"===e},meridiem:function(e,t,n){return e<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:function(e){return e.week()!==this.week()?"[来週]dddd LT":"dddd LT"},lastDay:"[昨日] LT",lastWeek:function(e){return this.week()!==e.week()?"[先週]dddd LT":"dddd LT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}日/,ordinal:function(e,t){switch(t){case"y":return 1===e?"元年":e+"年";case"d":case"D":case"DDD":return e+"日";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"数秒",ss:"%d秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/jv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(e,t){return 12===e&&(e=0),"enjing"===t?e:"siyang"===t?e>=11?e:e+12:"sonten"===t||"ndalu"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"enjing":e<15?"siyang":e<19?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",ss:"%d detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ka.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ka",{months:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:{standalone:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),format:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_"),isFormat:/(წინა|შემდეგ)/},weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(e){return e.replace(/(წამ|წუთ|საათ|წელ|დღ|თვ)(ი|ე)/,(function(e,t,n){return"ი"===n?t+"ში":t+n+"ში"}))},past:function(e){return/(წამი|წუთი|საათი|დღე|თვე)/.test(e)?e.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(e)?e.replace(/წელი$/,"წლის წინ"):e},s:"რამდენიმე წამი",ss:"%d წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},dayOfMonthOrdinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(e){return 0===e?e:1===e?e+"-ლი":e<20||e<=100&&e%20==0||e%100==0?"მე-"+e:e+"-ე"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/kk.js":function(e,t,n){!function(e){"use strict";var t={0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"};e.defineLocale("kk",{months:"қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел".split("_"),weekdays:"жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгін сағат] LT",nextDay:"[Ертең сағат] LT",nextWeek:"dddd [сағат] LT",lastDay:"[Кеше сағат] LT",lastWeek:"[Өткен аптаның] dddd [сағат] LT",sameElse:"L"},relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",ss:"%d секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(ші|шы)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/km.js":function(e,t,n){!function(e){"use strict";var t={1:"១",2:"២",3:"៣",4:"៤",5:"៥",6:"៦",7:"៧",8:"៨",9:"៩",0:"០"},n={"១":"1","២":"2","៣":"3","៤":"4","៥":"5","៦":"6","៧":"7","៨":"8","៩":"9","០":"0"};e.defineLocale("km",{months:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysMin:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ព្រឹក|ល្ងាច/,isPM:function(e){return"ល្ងាច"===e},meridiem:function(e,t,n){return e<12?"ព្រឹក":"ល្ងាច"},calendar:{sameDay:"[ថ្ងៃនេះ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",ss:"%d វិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},dayOfMonthOrdinalParse:/ទី\d{1,2}/,ordinal:"ទី%d",preparse:function(e){return e.replace(/[១២៣៤៥៦៧៨៩០]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/kn.js":function(e,t,n){!function(e){"use strict";var t={1:"೧",2:"೨",3:"೩",4:"೪",5:"೫",6:"೬",7:"೭",8:"೮",9:"೯",0:"೦"},n={"೧":"1","೨":"2","೩":"3","೪":"4","೫":"5","೬":"6","೭":"7","೮":"8","೯":"9","೦":"0"};e.defineLocale("kn",{months:"ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್".split("_"),monthsShort:"ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ".split("_"),monthsParseExact:!0,weekdays:"ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ".split("_"),weekdaysShort:"ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ".split("_"),weekdaysMin:"ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[ಇಂದು] LT",nextDay:"[ನಾಳೆ] LT",nextWeek:"dddd, LT",lastDay:"[ನಿನ್ನೆ] LT",lastWeek:"[ಕೊನೆಯ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ನಂತರ",past:"%s ಹಿಂದೆ",s:"ಕೆಲವು ಕ್ಷಣಗಳು",ss:"%d ಸೆಕೆಂಡುಗಳು",m:"ಒಂದು ನಿಮಿಷ",mm:"%d ನಿಮಿಷ",h:"ಒಂದು ಗಂಟೆ",hh:"%d ಗಂಟೆ",d:"ಒಂದು ದಿನ",dd:"%d ದಿನ",M:"ಒಂದು ತಿಂಗಳು",MM:"%d ತಿಂಗಳು",y:"ಒಂದು ವರ್ಷ",yy:"%d ವರ್ಷ"},preparse:function(e){return e.replace(/[೧೨೩೪೫೬೭೮೯೦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ರಾತ್ರಿ"===t?e<4?e:e+12:"ಬೆಳಿಗ್ಗೆ"===t?e:"ಮಧ್ಯಾಹ್ನ"===t?e>=10?e:e+12:"ಸಂಜೆ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ರಾತ್ರಿ":e<10?"ಬೆಳಿಗ್ಗೆ":e<17?"ಮಧ್ಯಾಹ್ನ":e<20?"ಸಂಜೆ":"ರಾತ್ರಿ"},dayOfMonthOrdinalParse:/\d{1,2}(ನೇ)/,ordinal:function(e){return e+"ನೇ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ko.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",ss:"%d초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"},dayOfMonthOrdinalParse:/\d{1,2}(일|월|주)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"일";case"M":return e+"월";case"w":case"W":return e+"주";default:return e}},meridiemParse:/오전|오후/,isPM:function(e){return"오후"===e},meridiem:function(e,t,n){return e<12?"오전":"오후"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ku.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},o=["کانونی دووەم","شوبات","ئازار","نیسان","ئایار","حوزەیران","تەمموز","ئاب","ئەیلوول","تشرینی یەكەم","تشرینی دووەم","كانونی یەکەم"];e.defineLocale("ku",{months:o,monthsShort:o,weekdays:"یه‌كشه‌ممه‌_دووشه‌ممه‌_سێشه‌ممه‌_چوارشه‌ممه‌_پێنجشه‌ممه‌_هه‌ینی_شه‌ممه‌".split("_"),weekdaysShort:"یه‌كشه‌م_دووشه‌م_سێشه‌م_چوارشه‌م_پێنجشه‌م_هه‌ینی_شه‌ممه‌".split("_"),weekdaysMin:"ی_د_س_چ_پ_ه_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ئێواره‌|به‌یانی/,isPM:function(e){return/ئێواره‌/.test(e)},meridiem:function(e,t,n){return e<12?"به‌یانی":"ئێواره‌"},calendar:{sameDay:"[ئه‌مرۆ كاتژمێر] LT",nextDay:"[به‌یانی كاتژمێر] LT",nextWeek:"dddd [كاتژمێر] LT",lastDay:"[دوێنێ كاتژمێر] LT",lastWeek:"dddd [كاتژمێر] LT",sameElse:"L"},relativeTime:{future:"له‌ %s",past:"%s",s:"چه‌ند چركه‌یه‌ك",ss:"چركه‌ %d",m:"یه‌ك خوله‌ك",mm:"%d خوله‌ك",h:"یه‌ك كاتژمێر",hh:"%d كاتژمێر",d:"یه‌ك ڕۆژ",dd:"%d ڕۆژ",M:"یه‌ك مانگ",MM:"%d مانگ",y:"یه‌ك ساڵ",yy:"%d ساڵ"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ky.js":function(e,t,n){!function(e){"use strict";var t={0:"-чү",1:"-чи",2:"-чи",3:"-чү",4:"-чү",5:"-чи",6:"-чы",7:"-чи",8:"-чи",9:"-чу",10:"-чу",20:"-чы",30:"-чу",40:"-чы",50:"-чү",60:"-чы",70:"-чи",80:"-чи",90:"-чу",100:"-чү"};e.defineLocale("ky",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdays:"Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),weekdaysShort:"Жек_Дүй_Шей_Шар_Бей_Жум_Ише".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгүн саат] LT",nextDay:"[Эртең саат] LT",nextWeek:"dddd [саат] LT",lastDay:"[Кечээ саат] LT",lastWeek:"[Өткөн аптанын] dddd [күнү] [саат] LT",sameElse:"L"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",ss:"%d секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(чи|чы|чү|чу)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lb.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return t?r[n][0]:r[n][1]}function n(e){if(e=parseInt(e,10),isNaN(e))return!1;if(e<0)return!0;if(e<10)return 4<=e&&e<=7;if(e<100){var t=e%10;return n(0===t?e/10:t)}if(e<1e4){for(;e>=10;)e/=10;return n(e)}return n(e/=1e3)}e.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:function(e){return n(e.substr(0,e.indexOf(" ")))?"a "+e:"an "+e},past:function(e){return n(e.substr(0,e.indexOf(" ")))?"viru "+e:"virun "+e},s:"e puer Sekonnen",ss:"%d Sekonnen",m:t,mm:"%d Minutten",h:t,hh:"%d Stonnen",d:t,dd:"%d Deeg",M:t,MM:"%d Méint",y:t,yy:"%d Joer"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("lo",{months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},meridiemParse:/ຕອນເຊົ້າ|ຕອນແລງ/,isPM:function(e){return"ຕອນແລງ"===e},meridiem:function(e,t,n){return e<12?"ຕອນເຊົ້າ":"ຕອນແລງ"},calendar:{sameDay:"[ມື້ນີ້ເວລາ] LT",nextDay:"[ມື້ອື່ນເວລາ] LT",nextWeek:"[ວັນ]dddd[ໜ້າເວລາ] LT",lastDay:"[ມື້ວານນີ້ເວລາ] LT",lastWeek:"[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT",sameElse:"L"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",ss:"%d ວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"},dayOfMonthOrdinalParse:/(ທີ່)\d{1,2}/,ordinal:function(e){return"ທີ່"+e}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lt.js":function(e,t,n){!function(e){"use strict";var t={ss:"sekundė_sekundžių_sekundes",m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"};function n(e,t,n,o){return t?r(n)[0]:o?r(n)[1]:r(n)[2]}function o(e){return e%10==0||e>10&&e<20}function r(e){return t[e].split("_")}function s(e,t,s,a){var i=e+" ";return 1===e?i+n(0,t,s[0],a):t?i+(o(e)?r(s)[1]:r(s)[0]):a?i+r(s)[1]:i+(o(e)?r(s)[1]:r(s)[2])}e.defineLocale("lt",{months:{format:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),isFormat:/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:function(e,t,n,o){return t?"kelios sekundės":o?"kelių sekundžių":"kelias sekundes"},ss:s,m:n,mm:s,h:n,hh:s,d:n,dd:s,M:n,MM:s,y:n,yy:s},dayOfMonthOrdinalParse:/\d{1,2}-oji/,ordinal:function(e){return e+"-oji"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lv.js":function(e,t,n){!function(e){"use strict";var t={ss:"sekundes_sekundēm_sekunde_sekundes".split("_"),m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")};function n(e,t,n){return n?t%10==1&&t%100!=11?e[2]:e[3]:t%10==1&&t%100!=11?e[0]:e[1]}function o(e,o,r){return e+" "+n(t[r],e,o)}function r(e,o,r){return n(t[r],e,o)}e.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:function(e,t){return t?"dažas sekundes":"dažām sekundēm"},ss:o,m:r,mm:o,h:r,hh:o,d:r,dd:o,M:r,MM:o,y:r,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/me.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["sekund","sekunda","sekundi"],m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("me",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mjesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mi.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mi",{months:"Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),monthsRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,weekdays:"Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei".split("_"),weekdaysShort:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),weekdaysMin:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},calendar:{sameDay:"[i teie mahana, i] LT",nextDay:"[apopo i] LT",nextWeek:"dddd [i] LT",lastDay:"[inanahi i] LT",lastWeek:"dddd [whakamutunga i] LT",sameElse:"L"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te hēkona ruarua",ss:"%d hēkona",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mk.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"за %s",past:"пред %s",s:"неколку секунди",ss:"%d секунди",m:"една минута",mm:"%d минути",h:"еден час",hh:"%d часа",d:"еден ден",dd:"%d дена",M:"еден месец",MM:"%d месеци",y:"една година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ml.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),monthsParseExact:!0,weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",ss:"%d സെക്കൻഡ്",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,meridiemHour:function(e,t){return 12===e&&(e=0),"രാത്രി"===t&&e>=4||"ഉച്ച കഴിഞ്ഞ്"===t||"വൈകുന്നേരം"===t?e+12:e},meridiem:function(e,t,n){return e<4?"രാത്രി":e<12?"രാവിലെ":e<17?"ഉച്ച കഴിഞ്ഞ്":e<20?"വൈകുന്നേരം":"രാത്രി"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mn.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){switch(n){case"s":return t?"хэдхэн секунд":"хэдхэн секундын";case"ss":return e+(t?" секунд":" секундын");case"m":case"mm":return e+(t?" минут":" минутын");case"h":case"hh":return e+(t?" цаг":" цагийн");case"d":case"dd":return e+(t?" өдөр":" өдрийн");case"M":case"MM":return e+(t?" сар":" сарын");case"y":case"yy":return e+(t?" жил":" жилийн");default:return e}}e.defineLocale("mn",{months:"Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар".split("_"),monthsShort:"1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар".split("_"),monthsParseExact:!0,weekdays:"Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба".split("_"),weekdaysShort:"Ням_Дав_Мяг_Лха_Пүр_Баа_Бям".split("_"),weekdaysMin:"Ня_Да_Мя_Лх_Пү_Ба_Бя".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY оны MMMMын D",LLL:"YYYY оны MMMMын D HH:mm",LLLL:"dddd, YYYY оны MMMMын D HH:mm"},meridiemParse:/ҮӨ|ҮХ/i,isPM:function(e){return"ҮХ"===e},meridiem:function(e,t,n){return e<12?"ҮӨ":"ҮХ"},calendar:{sameDay:"[Өнөөдөр] LT",nextDay:"[Маргааш] LT",nextWeek:"[Ирэх] dddd LT",lastDay:"[Өчигдөр] LT",lastWeek:"[Өнгөрсөн] dddd LT",sameElse:"L"},relativeTime:{future:"%s дараа",past:"%s өмнө",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2} өдөр/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+" өдөр";default:return e}}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mr.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};function o(e,t,n,o){var r="";if(t)switch(n){case"s":r="काही सेकंद";break;case"ss":r="%d सेकंद";break;case"m":r="एक मिनिट";break;case"mm":r="%d मिनिटे";break;case"h":r="एक तास";break;case"hh":r="%d तास";break;case"d":r="एक दिवस";break;case"dd":r="%d दिवस";break;case"M":r="एक महिना";break;case"MM":r="%d महिने";break;case"y":r="एक वर्ष";break;case"yy":r="%d वर्षे"}else switch(n){case"s":r="काही सेकंदां";break;case"ss":r="%d सेकंदां";break;case"m":r="एका मिनिटा";break;case"mm":r="%d मिनिटां";break;case"h":r="एका तासा";break;case"hh":r="%d तासां";break;case"d":r="एका दिवसा";break;case"dd":r="%d दिवसां";break;case"M":r="एका महिन्या";break;case"MM":r="%d महिन्यां";break;case"y":r="एका वर्षा";break;case"yy":r="%d वर्षां"}return r.replace(/%d/i,e)}e.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%sमध्ये",past:"%sपूर्वी",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/पहाटे|सकाळी|दुपारी|सायंकाळी|रात्री/,meridiemHour:function(e,t){return 12===e&&(e=0),"पहाटे"===t||"सकाळी"===t?e:"दुपारी"===t||"सायंकाळी"===t||"रात्री"===t?e>=12?e:e+12:void 0},meridiem:function(e,t,n){return e>=0&&e<6?"पहाटे":e<12?"सकाळी":e<17?"दुपारी":e<20?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ms-my.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ms.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mt.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mt",{months:"Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru".split("_"),monthsShort:"Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ".split("_"),weekdays:"Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt".split("_"),weekdaysShort:"Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib".split("_"),weekdaysMin:"Ħa_Tn_Tl_Er_Ħa_Ġi_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Illum fil-]LT",nextDay:"[Għada fil-]LT",nextWeek:"dddd [fil-]LT",lastDay:"[Il-bieraħ fil-]LT",lastWeek:"dddd [li għadda] [fil-]LT",sameElse:"L"},relativeTime:{future:"f’ %s",past:"%s ilu",s:"ftit sekondi",ss:"%d sekondi",m:"minuta",mm:"%d minuti",h:"siegħa",hh:"%d siegħat",d:"ġurnata",dd:"%d ġranet",M:"xahar",MM:"%d xhur",y:"sena",yy:"%d sni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/my.js":function(e,t,n){!function(e){"use strict";var t={1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:"၀"},n={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","၀":"0"};e.defineLocale("my",{months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",ss:"%d စက္ကန့်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(e){return e.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nb.js":function(e,t,n){!function(e){"use strict";e.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"noen sekunder",ss:"%d sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",w:"en uke",ww:"%d uker",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ne.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};e.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),monthsParseExact:!0,weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(e,t){return 12===e&&(e=0),"राति"===t?e<4?e:e+12:"बिहान"===t?e:"दिउँसो"===t?e>=10?e:e+12:"साँझ"===t?e+12:void 0},meridiem:function(e,t,n){return e<3?"राति":e<12?"बिहान":e<16?"दिउँसो":e<20?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",ss:"%d सेकेण्ड",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nl-be.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),o=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl-be",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nl.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),o=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",w:"één week",ww:"%d weken",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"su._må._ty._on._to._fr._lau.".split("_"),weekdaysMin:"su_må_ty_on_to_fr_la".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s sidan",s:"nokre sekund",ss:"%d sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",w:"ei veke",ww:"%d veker",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/oc-lnc.js":function(e,t,n){!function(e){"use strict";e.defineLocale("oc-lnc",{months:{standalone:"genièr_febrièr_març_abril_mai_junh_julhet_agost_setembre_octòbre_novembre_decembre".split("_"),format:"de genièr_de febrièr_de març_d'abril_de mai_de junh_de julhet_d'agost_de setembre_d'octòbre_de novembre_de decembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._mai_junh_julh._ago._set._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"dimenge_diluns_dimars_dimècres_dijòus_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dm._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dm_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:"[uèi a] LT",nextDay:"[deman a] LT",nextWeek:"dddd [a] LT",lastDay:"[ièr a] LT",lastWeek:"dddd [passat a] LT",sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"unas segondas",ss:"%d segondas",m:"una minuta",mm:"%d minutas",h:"una ora",hh:"%d oras",d:"un jorn",dd:"%d jorns",M:"un mes",MM:"%d meses",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pa-in.js":function(e,t,n){!function(e){"use strict";var t={1:"੧",2:"੨",3:"੩",4:"੪",5:"੫",6:"੬",7:"੭",8:"੮",9:"੯",0:"੦"},n={"੧":"1","੨":"2","੩":"3","੪":"4","੫":"5","੬":"6","੭":"7","੮":"8","੯":"9","੦":"0"};e.defineLocale("pa-in",{months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),longDateFormat:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},calendar:{sameDay:"[ਅਜ] LT",nextDay:"[ਕਲ] LT",nextWeek:"[ਅਗਲਾ] dddd, LT",lastDay:"[ਕਲ] LT",lastWeek:"[ਪਿਛਲੇ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",ss:"%d ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"},preparse:function(e){return e.replace(/[੧੨੩੪੫੬੭੮੯੦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ਰਾਤ"===t?e<4?e:e+12:"ਸਵੇਰ"===t?e:"ਦੁਪਹਿਰ"===t?e>=10?e:e+12:"ਸ਼ਾਮ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ਰਾਤ":e<10?"ਸਵੇਰ":e<17?"ਦੁਪਹਿਰ":e<20?"ਸ਼ਾਮ":"ਰਾਤ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pl.js":function(e,t,n){!function(e){"use strict";var t="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),n="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),o=[/^sty/i,/^lut/i,/^mar/i,/^kwi/i,/^maj/i,/^cze/i,/^lip/i,/^sie/i,/^wrz/i,/^paź/i,/^lis/i,/^gru/i];function r(e){return e%10<5&&e%10>1&&~~(e/10)%10!=1}function s(e,t,n){var o=e+" ";switch(n){case"ss":return o+(r(e)?"sekundy":"sekund");case"m":return t?"minuta":"minutę";case"mm":return o+(r(e)?"minuty":"minut");case"h":return t?"godzina":"godzinę";case"hh":return o+(r(e)?"godziny":"godzin");case"ww":return o+(r(e)?"tygodnie":"tygodni");case"MM":return o+(r(e)?"miesiące":"miesięcy");case"yy":return o+(r(e)?"lata":"lat")}}e.defineLocale("pl",{months:function(e,o){return e?/D MMMM/.test(o)?n[e.month()]:t[e.month()]:t},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_śr_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:function(){switch(this.day()){case 0:return"[W niedzielę o] LT";case 2:return"[We wtorek o] LT";case 3:return"[W środę o] LT";case 6:return"[W sobotę o] LT";default:return"[W] dddd [o] LT"}},lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",ss:s,m:s,mm:s,h:s,hh:s,d:"1 dzień",dd:"%d dni",w:"tydzień",ww:s,M:"miesiąc",MM:s,y:"rok",yy:s},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pt-br.js":function(e,t,n){!function(e){"use strict";e.defineLocale("pt-br",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sáb".split("_"),weekdaysMin:"do_2ª_3ª_4ª_5ª_6ª_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"poucos segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",invalidDate:"Data inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pt.js":function(e,t,n){!function(e){"use strict";e.defineLocale("pt",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",w:"uma semana",ww:"%d semanas",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ro.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=" ";return(e%100>=20||e>=100&&e%100==0)&&(o=" de "),e+o+{ss:"secunde",mm:"minute",hh:"ore",dd:"zile",ww:"săptămâni",MM:"luni",yy:"ani"}[n]}e.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",ss:t,m:"un minut",mm:t,h:"o oră",hh:t,d:"o zi",dd:t,w:"o săptămână",ww:t,M:"o lună",MM:t,y:"un an",yy:t},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ru.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"минута":"минуту":e+" "+(o=+e,r={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",ww:"неделя_недели_недель",MM:"месяц_месяца_месяцев",yy:"год_года_лет"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}var n=[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i];e.defineLocale("ru",{months:{format:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),standalone:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_")},monthsShort:{format:"янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),standalone:"янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_")},weekdays:{standalone:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),format:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?] ?dddd/},weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:n,longMonthsParse:n,shortMonthsParse:n,monthsRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsShortRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsStrictRegex:/^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,monthsShortStrictRegex:/^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},calendar:{sameDay:"[Сегодня, в] LT",nextDay:"[Завтра, в] LT",lastDay:"[Вчера, в] LT",nextWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В следующее] dddd, [в] LT";case 1:case 2:case 4:return"[В следующий] dddd, [в] LT";case 3:case 5:case 6:return"[В следующую] dddd, [в] LT"}},lastWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd, [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd, [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd, [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",ss:t,m:t,mm:t,h:"час",hh:t,d:"день",dd:t,w:"неделя",ww:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(e){return/^(дня|вечера)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночи":e<12?"утра":e<17?"дня":"вечера"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":return e+"-й";case"D":return e+"-го";case"w":case"W":return e+"-я";default:return e}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sd.js":function(e,t,n){!function(e){"use strict";var t=["جنوري","فيبروري","مارچ","اپريل","مئي","جون","جولاءِ","آگسٽ","سيپٽمبر","آڪٽوبر","نومبر","ڊسمبر"],n=["آچر","سومر","اڱارو","اربع","خميس","جمع","ڇنڇر"];e.defineLocale("sd",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[اڄ] LT",nextDay:"[سڀاڻي] LT",nextWeek:"dddd [اڳين هفتي تي] LT",lastDay:"[ڪالهه] LT",lastWeek:"[گزريل هفتي] dddd [تي] LT",sameElse:"L"},relativeTime:{future:"%s پوء",past:"%s اڳ",s:"چند سيڪنڊ",ss:"%d سيڪنڊ",m:"هڪ منٽ",mm:"%d منٽ",h:"هڪ ڪلاڪ",hh:"%d ڪلاڪ",d:"هڪ ڏينهن",dd:"%d ڏينهن",M:"هڪ مهينو",MM:"%d مهينا",y:"هڪ سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/se.js":function(e,t,n){!function(e){"use strict";e.defineLocale("se",{months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",ss:"%d sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/si.js":function(e,t,n){!function(e){"use strict";e.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",ss:"තත්පර %d",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},dayOfMonthOrdinalParse:/\d{1,2} වැනි/,ordinal:function(e){return e+" වැනි"},meridiemParse:/පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,isPM:function(e){return"ප.ව."===e||"පස් වරු"===e},meridiem:function(e,t,n){return e>11?n?"ප.ව.":"පස් වරු":n?"පෙ.ව.":"පෙර වරු"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sk.js":function(e,t,n){!function(e){"use strict";var t="január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),n="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_");function o(e){return e>1&&e<5}function r(e,t,n,r){var s=e+" ";switch(n){case"s":return t||r?"pár sekúnd":"pár sekundami";case"ss":return t||r?s+(o(e)?"sekundy":"sekúnd"):s+"sekundami";case"m":return t?"minúta":r?"minútu":"minútou";case"mm":return t||r?s+(o(e)?"minúty":"minút"):s+"minútami";case"h":return t?"hodina":r?"hodinu":"hodinou";case"hh":return t||r?s+(o(e)?"hodiny":"hodín"):s+"hodinami";case"d":return t||r?"deň":"dňom";case"dd":return t||r?s+(o(e)?"dni":"dní"):s+"dňami";case"M":return t||r?"mesiac":"mesiacom";case"MM":return t||r?s+(o(e)?"mesiace":"mesiacov"):s+"mesiacmi";case"y":return t||r?"rok":"rokom";case"yy":return t||r?s+(o(e)?"roky":"rokov"):s+"rokmi"}}e.defineLocale("sk",{months:t,monthsShort:n,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:r,ss:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sl.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r=e+" ";switch(n){case"s":return t||o?"nekaj sekund":"nekaj sekundami";case"ss":return r+(1===e?t?"sekundo":"sekundi":2===e?t||o?"sekundi":"sekundah":e<5?t||o?"sekunde":"sekundah":"sekund");case"m":return t?"ena minuta":"eno minuto";case"mm":return r+(1===e?t?"minuta":"minuto":2===e?t||o?"minuti":"minutama":e<5?t||o?"minute":"minutami":t||o?"minut":"minutami");case"h":return t?"ena ura":"eno uro";case"hh":return r+(1===e?t?"ura":"uro":2===e?t||o?"uri":"urama":e<5?t||o?"ure":"urami":t||o?"ur":"urami");case"d":return t||o?"en dan":"enim dnem";case"dd":return r+(1===e?t||o?"dan":"dnem":2===e?t||o?"dni":"dnevoma":t||o?"dni":"dnevi");case"M":return t||o?"en mesec":"enim mesecem";case"MM":return r+(1===e?t||o?"mesec":"mesecem":2===e?t||o?"meseca":"mesecema":e<5?t||o?"mesece":"meseci":t||o?"mesecev":"meseci");case"y":return t||o?"eno leto":"enim letom";case"yy":return r+(1===e?t||o?"leto":"letom":2===e?t||o?"leti":"letoma":e<5?t||o?"leta":"leti":t||o?"let":"leti")}}e.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sq.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),weekdaysParseExact:!0,meridiemParse:/PD|MD/,isPM:function(e){return"M"===e.charAt(0)},meridiem:function(e,t,n){return e<12?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",ss:"%d sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sr-cyrl.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["секунда","секунде","секунди"],m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr-cyrl",{months:"јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар".split("_"),monthsShort:"јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.".split("_"),monthsParseExact:!0,weekdays:"недеља_понедељак_уторак_среда_четвртак_петак_субота".split("_"),weekdaysShort:"нед._пон._уто._сре._чет._пет._суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){return["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"дан",dd:t.translate,M:"месец",MM:t.translate,y:"годину",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sr.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["sekunda","sekunde","sekundi"],m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sre._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ss.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ss",{months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Namuhla nga] LT",nextDay:"[Kusasa nga] LT",nextWeek:"dddd [nga] LT",lastDay:"[Itolo nga] LT",lastWeek:"dddd [leliphelile] [nga] LT",sameElse:"L"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",ss:"%d mzuzwana",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"},meridiemParse:/ekuseni|emini|entsambama|ebusuku/,meridiem:function(e,t,n){return e<11?"ekuseni":e<15?"emini":e<19?"entsambama":"ebusuku"},meridiemHour:function(e,t){return 12===e&&(e=0),"ekuseni"===t?e:"emini"===t?e>=11?e:e+12:"entsambama"===t||"ebusuku"===t?0===e?0:e+12:void 0},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:"%d",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",ss:"%d sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}(\:e|\:a)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?":e":1===t||2===t?":a":":e")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"hh:mm A",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",ss:"sekunde %d",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"siku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ta.js":function(e,t,n){!function(e){"use strict";var t={1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:"௦"},n={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","௦":"0"};e.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",ss:"%d விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},dayOfMonthOrdinalParse:/\d{1,2}வது/,ordinal:function(e){return e+"வது"},preparse:function(e){return e.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(e,t,n){return e<2?" யாமம்":e<6?" வைகறை":e<10?" காலை":e<14?" நண்பகல்":e<18?" எற்பாடு":e<22?" மாலை":" யாமம்"},meridiemHour:function(e,t){return 12===e&&(e=0),"யாமம்"===t?e<2?e:e+12:"வைகறை"===t||"காலை"===t||"நண்பகல்"===t&&e>=10?e:e+12},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/te.js":function(e,t,n){!function(e){"use strict";e.defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),monthsParseExact:!0,weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",ss:"%d సెకన్లు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},dayOfMonthOrdinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(e,t){return 12===e&&(e=0),"రాత్రి"===t?e<4?e:e+12:"ఉదయం"===t?e:"మధ్యాహ్నం"===t?e>=10?e:e+12:"సాయంత్రం"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"రాత్రి":e<10?"ఉదయం":e<17?"మధ్యాహ్నం":e<20?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tet.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tet",{months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu".split("_"),weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sest_Sab".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Ses_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Ohin iha] LT",nextDay:"[Aban iha] LT",nextWeek:"dddd [iha] LT",lastDay:"[Horiseik iha] LT",lastWeek:"dddd [semana kotuk] [iha] LT",sameElse:"L"},relativeTime:{future:"iha %s",past:"%s liuba",s:"segundu balun",ss:"segundu %d",m:"minutu ida",mm:"minutu %d",h:"oras ida",hh:"oras %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tg.js":function(e,t,n){!function(e){"use strict";var t={0:"-ум",1:"-ум",2:"-юм",3:"-юм",4:"-ум",5:"-ум",6:"-ум",7:"-ум",8:"-ум",9:"-ум",10:"-ум",12:"-ум",13:"-ум",20:"-ум",30:"-юм",40:"-ум",50:"-ум",60:"-ум",70:"-ум",80:"-ум",90:"-ум",100:"-ум"};e.defineLocale("tg",{months:{format:"январи_феврали_марти_апрели_майи_июни_июли_августи_сентябри_октябри_ноябри_декабри".split("_"),standalone:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_")},monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе".split("_"),weekdaysShort:"яшб_дшб_сшб_чшб_пшб_ҷум_шнб".split("_"),weekdaysMin:"яш_дш_сш_чш_пш_ҷм_шб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Имрӯз соати] LT",nextDay:"[Фардо соати] LT",lastDay:"[Дирӯз соати] LT",nextWeek:"dddd[и] [ҳафтаи оянда соати] LT",lastWeek:"dddd[и] [ҳафтаи гузашта соати] LT",sameElse:"L"},relativeTime:{future:"баъди %s",past:"%s пеш",s:"якчанд сония",m:"як дақиқа",mm:"%d дақиқа",h:"як соат",hh:"%d соат",d:"як рӯз",dd:"%d рӯз",M:"як моҳ",MM:"%d моҳ",y:"як сол",yy:"%d сол"},meridiemParse:/шаб|субҳ|рӯз|бегоҳ/,meridiemHour:function(e,t){return 12===e&&(e=0),"шаб"===t?e<4?e:e+12:"субҳ"===t?e:"рӯз"===t?e>=11?e:e+12:"бегоҳ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"шаб":e<11?"субҳ":e<16?"рӯз":e<19?"бегоҳ":"шаб"},dayOfMonthOrdinalParse:/\d{1,2}-(ум|юм)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/th.js":function(e,t,n){!function(e){"use strict";e.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.".split("_"),monthsParseExact:!0,weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H:mm",LLLL:"วันddddที่ D MMMM YYYY เวลา H:mm"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(e){return"หลังเที่ยง"===e},meridiem:function(e,t,n){return e<12?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",ss:"%d วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",w:"1 สัปดาห์",ww:"%d สัปดาห์",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tk.js":function(e,t,n){!function(e){"use strict";var t={1:"'inji",5:"'inji",8:"'inji",70:"'inji",80:"'inji",2:"'nji",7:"'nji",20:"'nji",50:"'nji",3:"'ünji",4:"'ünji",100:"'ünji",6:"'njy",9:"'unjy",10:"'unjy",30:"'unjy",60:"'ynjy",90:"'ynjy"};e.defineLocale("tk",{months:"Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr".split("_"),monthsShort:"Ýan_Few_Mar_Apr_Maý_Iýn_Iýl_Awg_Sen_Okt_Noý_Dek".split("_"),weekdays:"Ýekşenbe_Duşenbe_Sişenbe_Çarşenbe_Penşenbe_Anna_Şenbe".split("_"),weekdaysShort:"Ýek_Duş_Siş_Çar_Pen_Ann_Şen".split("_"),weekdaysMin:"Ýk_Dş_Sş_Çr_Pn_An_Şn".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün sagat] LT",nextDay:"[ertir sagat] LT",nextWeek:"[indiki] dddd [sagat] LT",lastDay:"[düýn] LT",lastWeek:"[geçen] dddd [sagat] LT",sameElse:"L"},relativeTime:{future:"%s soň",past:"%s öň",s:"birnäçe sekunt",m:"bir minut",mm:"%d minut",h:"bir sagat",hh:"%d sagat",d:"bir gün",dd:"%d gün",M:"bir aý",MM:"%d aý",y:"bir ýyl",yy:"%d ýyl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'unjy";var o=e%10;return e+(t[o]||t[e%100-o]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tl-ph.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tlh.js":function(e,t,n){!function(e){"use strict";var t="pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_");function n(e,n,o,r){var s=function(e){var n=Math.floor(e%1e3/100),o=Math.floor(e%100/10),r=e%10,s="";return n>0&&(s+=t[n]+"vatlh"),o>0&&(s+=(""!==s?" ":"")+t[o]+"maH"),r>0&&(s+=(""!==s?" ":"")+t[r]),""===s?"pagh":s}(e);switch(o){case"ss":return s+" lup";case"mm":return s+" tup";case"hh":return s+" rep";case"dd":return s+" jaj";case"MM":return s+" jar";case"yy":return s+" DIS"}}e.defineLocale("tlh",{months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),monthsParseExact:!0,weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa’leS] LT",nextWeek:"LLL",lastDay:"[wa’Hu’] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"leS":-1!==e.indexOf("jar")?t.slice(0,-3)+"waQ":-1!==e.indexOf("DIS")?t.slice(0,-3)+"nem":t+" pIq"},past:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"Hu’":-1!==e.indexOf("jar")?t.slice(0,-3)+"wen":-1!==e.indexOf("DIS")?t.slice(0,-3)+"ben":t+" ret"},s:"puS lup",ss:n,m:"wa’ tup",mm:n,h:"wa’ rep",hh:n,d:"wa’ jaj",dd:n,M:"wa’ jar",MM:n,y:"wa’ DIS",yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tr.js":function(e,t,n){!function(e){"use strict";var t={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"};e.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),meridiem:function(e,t,n){return e<12?n?"öö":"ÖÖ":n?"ös":"ÖS"},meridiemParse:/öö|ÖÖ|ös|ÖS/,isPM:function(e){return"ös"===e||"ÖS"===e},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[gelecek] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",ss:"%d saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",w:"bir hafta",ww:"%d hafta",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'ıncı";var o=e%10;return e+(t[o]||t[e%100-o]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzl.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["viensas secunds","'iensas secunds"],ss:[e+" secunds",e+" secunds"],m:["'n míut","'iens míut"],mm:[e+" míuts",e+" míuts"],h:["'n þora","'iensa þora"],hh:[e+" þoras",e+" þoras"],d:["'n ziua","'iensa ziua"],dd:[e+" ziuas",e+" ziuas"],M:["'n mes","'iens mes"],MM:[e+" mesen",e+" mesen"],y:["'n ar","'iens ar"],yy:[e+" ars",e+" ars"]};return o||t?r[n][0]:r[n][1]}e.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiemParse:/d\'o|d\'a/i,isPM:function(e){return"d'o"===e.toLowerCase()},meridiem:function(e,t,n){return e>11?n?"d'o":"D'O":n?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzm-latn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",ss:"%d imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzm.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",ss:"%d ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ug-cn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ug-cn",{months:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),monthsShort:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),weekdays:"يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە".split("_"),weekdaysShort:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),weekdaysMin:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY-يىلىM-ئاينىڭD-كۈنى",LLL:"YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm",LLLL:"dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm"},meridiemParse:/يېرىم كېچە|سەھەر|چۈشتىن بۇرۇن|چۈش|چۈشتىن كېيىن|كەچ/,meridiemHour:function(e,t){return 12===e&&(e=0),"يېرىم كېچە"===t||"سەھەر"===t||"چۈشتىن بۇرۇن"===t?e:"چۈشتىن كېيىن"===t||"كەچ"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var o=100*e+t;return o<600?"يېرىم كېچە":o<900?"سەھەر":o<1130?"چۈشتىن بۇرۇن":o<1230?"چۈش":o<1800?"چۈشتىن كېيىن":"كەچ"},calendar:{sameDay:"[بۈگۈن سائەت] LT",nextDay:"[ئەتە سائەت] LT",nextWeek:"[كېلەركى] dddd [سائەت] LT",lastDay:"[تۆنۈگۈن] LT",lastWeek:"[ئالدىنقى] dddd [سائەت] LT",sameElse:"L"},relativeTime:{future:"%s كېيىن",past:"%s بۇرۇن",s:"نەچچە سېكونت",ss:"%d سېكونت",m:"بىر مىنۇت",mm:"%d مىنۇت",h:"بىر سائەت",hh:"%d سائەت",d:"بىر كۈن",dd:"%d كۈن",M:"بىر ئاي",MM:"%d ئاي",y:"بىر يىل",yy:"%d يىل"},dayOfMonthOrdinalParse:/\d{1,2}(-كۈنى|-ئاي|-ھەپتە)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"-كۈنى";case"w":case"W":return e+"-ھەپتە";default:return e}},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uk.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"хвилина":"хвилину":"h"===n?t?"година":"годину":e+" "+(o=+e,r={ss:t?"секунда_секунди_секунд":"секунду_секунди_секунд",mm:t?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:t?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}function n(e){return function(){return e+"о"+(11===this.hours()?"б":"")+"] LT"}}e.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:function(e,t){var n={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")};return!0===e?n.nominative.slice(1,7).concat(n.nominative.slice(0,1)):e?n[/(\[[ВвУу]\]) ?dddd/.test(t)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(t)?"genitive":"nominative"][e.day()]:n.nominative},weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:n("[Сьогодні "),nextDay:n("[Завтра "),lastDay:n("[Вчора "),nextWeek:n("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return n("[Минулої] dddd [").call(this);case 1:case 2:case 4:return n("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",ss:t,m:t,mm:t,h:"годину",hh:t,d:"день",dd:t,M:"місяць",MM:t,y:"рік",yy:t},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(e){return/^(дня|вечора)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночі":e<12?"ранку":e<17?"дня":"вечора"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e+"-й";case"D":return e+"-го";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ur.js":function(e,t,n){!function(e){"use strict";var t=["جنوری","فروری","مارچ","اپریل","مئی","جون","جولائی","اگست","ستمبر","اکتوبر","نومبر","دسمبر"],n=["اتوار","پیر","منگل","بدھ","جمعرات","جمعہ","ہفتہ"];e.defineLocale("ur",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[آج بوقت] LT",nextDay:"[کل بوقت] LT",nextWeek:"dddd [بوقت] LT",lastDay:"[گذشتہ روز بوقت] LT",lastWeek:"[گذشتہ] dddd [بوقت] LT",sameElse:"L"},relativeTime:{future:"%s بعد",past:"%s قبل",s:"چند سیکنڈ",ss:"%d سیکنڈ",m:"ایک منٹ",mm:"%d منٹ",h:"ایک گھنٹہ",hh:"%d گھنٹے",d:"ایک دن",dd:"%d دن",M:"ایک ماہ",MM:"%d ماہ",y:"ایک سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uz-latn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("uz-latn",{months:"Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr".split("_"),monthsShort:"Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek".split("_"),weekdays:"Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba".split("_"),weekdaysShort:"Yak_Dush_Sesh_Chor_Pay_Jum_Shan".split("_"),weekdaysMin:"Ya_Du_Se_Cho_Pa_Ju_Sha".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Bugun soat] LT [da]",nextDay:"[Ertaga] LT [da]",nextWeek:"dddd [kuni soat] LT [da]",lastDay:"[Kecha soat] LT [da]",lastWeek:"[O'tgan] dddd [kuni soat] LT [da]",sameElse:"L"},relativeTime:{future:"Yaqin %s ichida",past:"Bir necha %s oldin",s:"soniya",ss:"%d soniya",m:"bir daqiqa",mm:"%d daqiqa",h:"bir soat",hh:"%d soat",d:"bir kun",dd:"%d kun",M:"bir oy",MM:"%d oy",y:"bir yil",yy:"%d yil"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uz.js":function(e,t,n){!function(e){"use strict";e.defineLocale("uz",{months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",ss:"%d фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/vi.js":function(e,t,n){!function(e){"use strict";e.defineLocale("vi",{months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),monthsShort:"Thg 01_Thg 02_Thg 03_Thg 04_Thg 05_Thg 06_Thg 07_Thg 08_Thg 09_Thg 10_Thg 11_Thg 12".split("_"),monthsParseExact:!0,weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysParseExact:!0,meridiemParse:/sa|ch/i,isPM:function(e){return/^ch$/i.test(e)},meridiem:function(e,t,n){return e<12?n?"sa":"SA":n?"ch":"CH"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[Ngày mai lúc] LT",nextWeek:"dddd [tuần tới lúc] LT",lastDay:"[Hôm qua lúc] LT",lastWeek:"dddd [tuần trước lúc] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",ss:"%d giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",w:"một tuần",ww:"%d tuần",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/x-pseudo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("x-pseudo",{months:"J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér".split("_"),monthsShort:"J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc".split("_"),monthsParseExact:!0,weekdays:"S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý".split("_"),weekdaysShort:"S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát".split("_"),weekdaysMin:"S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[T~ódá~ý át] LT",nextDay:"[T~ómó~rró~w át] LT",nextWeek:"dddd [át] LT",lastDay:"[Ý~ést~érdá~ý át] LT",lastWeek:"[L~ást] dddd [át] LT",sameElse:"L"},relativeTime:{future:"í~ñ %s",past:"%s á~gó",s:"á ~féw ~sécó~ñds",ss:"%d s~écóñ~ds",m:"á ~míñ~úté",mm:"%d m~íñú~tés",h:"á~ñ hó~úr",hh:"%d h~óúrs",d:"á ~dáý",dd:"%d d~áýs",M:"á ~móñ~th",MM:"%d m~óñt~hs",y:"á ~ýéár",yy:"%d ý~éárs"},dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/yo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("yo",{months:"Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀".split("_"),monthsShort:"Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀".split("_"),weekdays:"Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta".split("_"),weekdaysShort:"Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá".split("_"),weekdaysMin:"Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Ònì ni] LT",nextDay:"[Ọ̀la ni] LT",nextWeek:"dddd [Ọsẹ̀ tón'bọ] [ni] LT",lastDay:"[Àna ni] LT",lastWeek:"dddd [Ọsẹ̀ tólọ́] [ni] LT",sameElse:"L"},relativeTime:{future:"ní %s",past:"%s kọjá",s:"ìsẹjú aayá die",ss:"aayá %d",m:"ìsẹjú kan",mm:"ìsẹjú %d",h:"wákati kan",hh:"wákati %d",d:"ọjọ́ kan",dd:"ọjọ́ %d",M:"osù kan",MM:"osù %d",y:"ọdún kan",yy:"ọdún %d"},dayOfMonthOrdinalParse:/ọjọ́\s\d{1,2}/,ordinal:"ọjọ́ %d",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-cn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"下午"===t||"晚上"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:function(e){return e.week()!==this.week()?"[下]dddLT":"[本]dddLT"},lastDay:"[昨天]LT",lastWeek:function(e){return this.week()!==e.week()?"[上]dddLT":"[本]dddLT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|周)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"周";default:return e}},relativeTime:{future:"%s后",past:"%s前",s:"几秒",ss:"%d 秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",w:"1 周",ww:"%d 周",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-hk.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-hk",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1200?"上午":1200===o?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-mo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-mo",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"D/M/YYYY",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-tw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale sync recursive ^\\.\\/.*$":(e,t,n)=>{var o={"./af":"./node_modules/moment/locale/af.js","./af.js":"./node_modules/moment/locale/af.js","./ar":"./node_modules/moment/locale/ar.js","./ar-dz":"./node_modules/moment/locale/ar-dz.js","./ar-dz.js":"./node_modules/moment/locale/ar-dz.js","./ar-kw":"./node_modules/moment/locale/ar-kw.js","./ar-kw.js":"./node_modules/moment/locale/ar-kw.js","./ar-ly":"./node_modules/moment/locale/ar-ly.js","./ar-ly.js":"./node_modules/moment/locale/ar-ly.js","./ar-ma":"./node_modules/moment/locale/ar-ma.js","./ar-ma.js":"./node_modules/moment/locale/ar-ma.js","./ar-sa":"./node_modules/moment/locale/ar-sa.js","./ar-sa.js":"./node_modules/moment/locale/ar-sa.js","./ar-tn":"./node_modules/moment/locale/ar-tn.js","./ar-tn.js":"./node_modules/moment/locale/ar-tn.js","./ar.js":"./node_modules/moment/locale/ar.js","./az":"./node_modules/moment/locale/az.js","./az.js":"./node_modules/moment/locale/az.js","./be":"./node_modules/moment/locale/be.js","./be.js":"./node_modules/moment/locale/be.js","./bg":"./node_modules/moment/locale/bg.js","./bg.js":"./node_modules/moment/locale/bg.js","./bm":"./node_modules/moment/locale/bm.js","./bm.js":"./node_modules/moment/locale/bm.js","./bn":"./node_modules/moment/locale/bn.js","./bn-bd":"./node_modules/moment/locale/bn-bd.js","./bn-bd.js":"./node_modules/moment/locale/bn-bd.js","./bn.js":"./node_modules/moment/locale/bn.js","./bo":"./node_modules/moment/locale/bo.js","./bo.js":"./node_modules/moment/locale/bo.js","./br":"./node_modules/moment/locale/br.js","./br.js":"./node_modules/moment/locale/br.js","./bs":"./node_modules/moment/locale/bs.js","./bs.js":"./node_modules/moment/locale/bs.js","./ca":"./node_modules/moment/locale/ca.js","./ca.js":"./node_modules/moment/locale/ca.js","./cs":"./node_modules/moment/locale/cs.js","./cs.js":"./node_modules/moment/locale/cs.js","./cv":"./node_modules/moment/locale/cv.js","./cv.js":"./node_modules/moment/locale/cv.js","./cy":"./node_modules/moment/locale/cy.js","./cy.js":"./node_modules/moment/locale/cy.js","./da":"./node_modules/moment/locale/da.js","./da.js":"./node_modules/moment/locale/da.js","./de":"./node_modules/moment/locale/de.js","./de-at":"./node_modules/moment/locale/de-at.js","./de-at.js":"./node_modules/moment/locale/de-at.js","./de-ch":"./node_modules/moment/locale/de-ch.js","./de-ch.js":"./node_modules/moment/locale/de-ch.js","./de.js":"./node_modules/moment/locale/de.js","./dv":"./node_modules/moment/locale/dv.js","./dv.js":"./node_modules/moment/locale/dv.js","./el":"./node_modules/moment/locale/el.js","./el.js":"./node_modules/moment/locale/el.js","./en-au":"./node_modules/moment/locale/en-au.js","./en-au.js":"./node_modules/moment/locale/en-au.js","./en-ca":"./node_modules/moment/locale/en-ca.js","./en-ca.js":"./node_modules/moment/locale/en-ca.js","./en-gb":"./node_modules/moment/locale/en-gb.js","./en-gb.js":"./node_modules/moment/locale/en-gb.js","./en-ie":"./node_modules/moment/locale/en-ie.js","./en-ie.js":"./node_modules/moment/locale/en-ie.js","./en-il":"./node_modules/moment/locale/en-il.js","./en-il.js":"./node_modules/moment/locale/en-il.js","./en-in":"./node_modules/moment/locale/en-in.js","./en-in.js":"./node_modules/moment/locale/en-in.js","./en-nz":"./node_modules/moment/locale/en-nz.js","./en-nz.js":"./node_modules/moment/locale/en-nz.js","./en-sg":"./node_modules/moment/locale/en-sg.js","./en-sg.js":"./node_modules/moment/locale/en-sg.js","./eo":"./node_modules/moment/locale/eo.js","./eo.js":"./node_modules/moment/locale/eo.js","./es":"./node_modules/moment/locale/es.js","./es-do":"./node_modules/moment/locale/es-do.js","./es-do.js":"./node_modules/moment/locale/es-do.js","./es-mx":"./node_modules/moment/locale/es-mx.js","./es-mx.js":"./node_modules/moment/locale/es-mx.js","./es-us":"./node_modules/moment/locale/es-us.js","./es-us.js":"./node_modules/moment/locale/es-us.js","./es.js":"./node_modules/moment/locale/es.js","./et":"./node_modules/moment/locale/et.js","./et.js":"./node_modules/moment/locale/et.js","./eu":"./node_modules/moment/locale/eu.js","./eu.js":"./node_modules/moment/locale/eu.js","./fa":"./node_modules/moment/locale/fa.js","./fa.js":"./node_modules/moment/locale/fa.js","./fi":"./node_modules/moment/locale/fi.js","./fi.js":"./node_modules/moment/locale/fi.js","./fil":"./node_modules/moment/locale/fil.js","./fil.js":"./node_modules/moment/locale/fil.js","./fo":"./node_modules/moment/locale/fo.js","./fo.js":"./node_modules/moment/locale/fo.js","./fr":"./node_modules/moment/locale/fr.js","./fr-ca":"./node_modules/moment/locale/fr-ca.js","./fr-ca.js":"./node_modules/moment/locale/fr-ca.js","./fr-ch":"./node_modules/moment/locale/fr-ch.js","./fr-ch.js":"./node_modules/moment/locale/fr-ch.js","./fr.js":"./node_modules/moment/locale/fr.js","./fy":"./node_modules/moment/locale/fy.js","./fy.js":"./node_modules/moment/locale/fy.js","./ga":"./node_modules/moment/locale/ga.js","./ga.js":"./node_modules/moment/locale/ga.js","./gd":"./node_modules/moment/locale/gd.js","./gd.js":"./node_modules/moment/locale/gd.js","./gl":"./node_modules/moment/locale/gl.js","./gl.js":"./node_modules/moment/locale/gl.js","./gom-deva":"./node_modules/moment/locale/gom-deva.js","./gom-deva.js":"./node_modules/moment/locale/gom-deva.js","./gom-latn":"./node_modules/moment/locale/gom-latn.js","./gom-latn.js":"./node_modules/moment/locale/gom-latn.js","./gu":"./node_modules/moment/locale/gu.js","./gu.js":"./node_modules/moment/locale/gu.js","./he":"./node_modules/moment/locale/he.js","./he.js":"./node_modules/moment/locale/he.js","./hi":"./node_modules/moment/locale/hi.js","./hi.js":"./node_modules/moment/locale/hi.js","./hr":"./node_modules/moment/locale/hr.js","./hr.js":"./node_modules/moment/locale/hr.js","./hu":"./node_modules/moment/locale/hu.js","./hu.js":"./node_modules/moment/locale/hu.js","./hy-am":"./node_modules/moment/locale/hy-am.js","./hy-am.js":"./node_modules/moment/locale/hy-am.js","./id":"./node_modules/moment/locale/id.js","./id.js":"./node_modules/moment/locale/id.js","./is":"./node_modules/moment/locale/is.js","./is.js":"./node_modules/moment/locale/is.js","./it":"./node_modules/moment/locale/it.js","./it-ch":"./node_modules/moment/locale/it-ch.js","./it-ch.js":"./node_modules/moment/locale/it-ch.js","./it.js":"./node_modules/moment/locale/it.js","./ja":"./node_modules/moment/locale/ja.js","./ja.js":"./node_modules/moment/locale/ja.js","./jv":"./node_modules/moment/locale/jv.js","./jv.js":"./node_modules/moment/locale/jv.js","./ka":"./node_modules/moment/locale/ka.js","./ka.js":"./node_modules/moment/locale/ka.js","./kk":"./node_modules/moment/locale/kk.js","./kk.js":"./node_modules/moment/locale/kk.js","./km":"./node_modules/moment/locale/km.js","./km.js":"./node_modules/moment/locale/km.js","./kn":"./node_modules/moment/locale/kn.js","./kn.js":"./node_modules/moment/locale/kn.js","./ko":"./node_modules/moment/locale/ko.js","./ko.js":"./node_modules/moment/locale/ko.js","./ku":"./node_modules/moment/locale/ku.js","./ku.js":"./node_modules/moment/locale/ku.js","./ky":"./node_modules/moment/locale/ky.js","./ky.js":"./node_modules/moment/locale/ky.js","./lb":"./node_modules/moment/locale/lb.js","./lb.js":"./node_modules/moment/locale/lb.js","./lo":"./node_modules/moment/locale/lo.js","./lo.js":"./node_modules/moment/locale/lo.js","./lt":"./node_modules/moment/locale/lt.js","./lt.js":"./node_modules/moment/locale/lt.js","./lv":"./node_modules/moment/locale/lv.js","./lv.js":"./node_modules/moment/locale/lv.js","./me":"./node_modules/moment/locale/me.js","./me.js":"./node_modules/moment/locale/me.js","./mi":"./node_modules/moment/locale/mi.js","./mi.js":"./node_modules/moment/locale/mi.js","./mk":"./node_modules/moment/locale/mk.js","./mk.js":"./node_modules/moment/locale/mk.js","./ml":"./node_modules/moment/locale/ml.js","./ml.js":"./node_modules/moment/locale/ml.js","./mn":"./node_modules/moment/locale/mn.js","./mn.js":"./node_modules/moment/locale/mn.js","./mr":"./node_modules/moment/locale/mr.js","./mr.js":"./node_modules/moment/locale/mr.js","./ms":"./node_modules/moment/locale/ms.js","./ms-my":"./node_modules/moment/locale/ms-my.js","./ms-my.js":"./node_modules/moment/locale/ms-my.js","./ms.js":"./node_modules/moment/locale/ms.js","./mt":"./node_modules/moment/locale/mt.js","./mt.js":"./node_modules/moment/locale/mt.js","./my":"./node_modules/moment/locale/my.js","./my.js":"./node_modules/moment/locale/my.js","./nb":"./node_modules/moment/locale/nb.js","./nb.js":"./node_modules/moment/locale/nb.js","./ne":"./node_modules/moment/locale/ne.js","./ne.js":"./node_modules/moment/locale/ne.js","./nl":"./node_modules/moment/locale/nl.js","./nl-be":"./node_modules/moment/locale/nl-be.js","./nl-be.js":"./node_modules/moment/locale/nl-be.js","./nl.js":"./node_modules/moment/locale/nl.js","./nn":"./node_modules/moment/locale/nn.js","./nn.js":"./node_modules/moment/locale/nn.js","./oc-lnc":"./node_modules/moment/locale/oc-lnc.js","./oc-lnc.js":"./node_modules/moment/locale/oc-lnc.js","./pa-in":"./node_modules/moment/locale/pa-in.js","./pa-in.js":"./node_modules/moment/locale/pa-in.js","./pl":"./node_modules/moment/locale/pl.js","./pl.js":"./node_modules/moment/locale/pl.js","./pt":"./node_modules/moment/locale/pt.js","./pt-br":"./node_modules/moment/locale/pt-br.js","./pt-br.js":"./node_modules/moment/locale/pt-br.js","./pt.js":"./node_modules/moment/locale/pt.js","./ro":"./node_modules/moment/locale/ro.js","./ro.js":"./node_modules/moment/locale/ro.js","./ru":"./node_modules/moment/locale/ru.js","./ru.js":"./node_modules/moment/locale/ru.js","./sd":"./node_modules/moment/locale/sd.js","./sd.js":"./node_modules/moment/locale/sd.js","./se":"./node_modules/moment/locale/se.js","./se.js":"./node_modules/moment/locale/se.js","./si":"./node_modules/moment/locale/si.js","./si.js":"./node_modules/moment/locale/si.js","./sk":"./node_modules/moment/locale/sk.js","./sk.js":"./node_modules/moment/locale/sk.js","./sl":"./node_modules/moment/locale/sl.js","./sl.js":"./node_modules/moment/locale/sl.js","./sq":"./node_modules/moment/locale/sq.js","./sq.js":"./node_modules/moment/locale/sq.js","./sr":"./node_modules/moment/locale/sr.js","./sr-cyrl":"./node_modules/moment/locale/sr-cyrl.js","./sr-cyrl.js":"./node_modules/moment/locale/sr-cyrl.js","./sr.js":"./node_modules/moment/locale/sr.js","./ss":"./node_modules/moment/locale/ss.js","./ss.js":"./node_modules/moment/locale/ss.js","./sv":"./node_modules/moment/locale/sv.js","./sv.js":"./node_modules/moment/locale/sv.js","./sw":"./node_modules/moment/locale/sw.js","./sw.js":"./node_modules/moment/locale/sw.js","./ta":"./node_modules/moment/locale/ta.js","./ta.js":"./node_modules/moment/locale/ta.js","./te":"./node_modules/moment/locale/te.js","./te.js":"./node_modules/moment/locale/te.js","./tet":"./node_modules/moment/locale/tet.js","./tet.js":"./node_modules/moment/locale/tet.js","./tg":"./node_modules/moment/locale/tg.js","./tg.js":"./node_modules/moment/locale/tg.js","./th":"./node_modules/moment/locale/th.js","./th.js":"./node_modules/moment/locale/th.js","./tk":"./node_modules/moment/locale/tk.js","./tk.js":"./node_modules/moment/locale/tk.js","./tl-ph":"./node_modules/moment/locale/tl-ph.js","./tl-ph.js":"./node_modules/moment/locale/tl-ph.js","./tlh":"./node_modules/moment/locale/tlh.js","./tlh.js":"./node_modules/moment/locale/tlh.js","./tr":"./node_modules/moment/locale/tr.js","./tr.js":"./node_modules/moment/locale/tr.js","./tzl":"./node_modules/moment/locale/tzl.js","./tzl.js":"./node_modules/moment/locale/tzl.js","./tzm":"./node_modules/moment/locale/tzm.js","./tzm-latn":"./node_modules/moment/locale/tzm-latn.js","./tzm-latn.js":"./node_modules/moment/locale/tzm-latn.js","./tzm.js":"./node_modules/moment/locale/tzm.js","./ug-cn":"./node_modules/moment/locale/ug-cn.js","./ug-cn.js":"./node_modules/moment/locale/ug-cn.js","./uk":"./node_modules/moment/locale/uk.js","./uk.js":"./node_modules/moment/locale/uk.js","./ur":"./node_modules/moment/locale/ur.js","./ur.js":"./node_modules/moment/locale/ur.js","./uz":"./node_modules/moment/locale/uz.js","./uz-latn":"./node_modules/moment/locale/uz-latn.js","./uz-latn.js":"./node_modules/moment/locale/uz-latn.js","./uz.js":"./node_modules/moment/locale/uz.js","./vi":"./node_modules/moment/locale/vi.js","./vi.js":"./node_modules/moment/locale/vi.js","./x-pseudo":"./node_modules/moment/locale/x-pseudo.js","./x-pseudo.js":"./node_modules/moment/locale/x-pseudo.js","./yo":"./node_modules/moment/locale/yo.js","./yo.js":"./node_modules/moment/locale/yo.js","./zh-cn":"./node_modules/moment/locale/zh-cn.js","./zh-cn.js":"./node_modules/moment/locale/zh-cn.js","./zh-hk":"./node_modules/moment/locale/zh-hk.js","./zh-hk.js":"./node_modules/moment/locale/zh-hk.js","./zh-mo":"./node_modules/moment/locale/zh-mo.js","./zh-mo.js":"./node_modules/moment/locale/zh-mo.js","./zh-tw":"./node_modules/moment/locale/zh-tw.js","./zh-tw.js":"./node_modules/moment/locale/zh-tw.js"};function r(e){var t=s(e);return n(t)}function s(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}r.keys=function(){return Object.keys(o)},r.resolve=s,e.exports=r,r.id="./node_modules/moment/locale sync recursive ^\\.\\/.*$"},"./node_modules/ng-csv/build/ng-csv.min.js":(e,t)=>{var n;n=window,document,angular.module("ngCsv.config",[]).value("ngCsv.config",{debug:!0}).config(["$compileProvider",function(e){angular.isDefined(e.urlSanitizationWhitelist)?e.urlSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|data):/):e.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|data):/)}]),angular.module("ngCsv.directives",["ngCsv.services"]),angular.module("ngCsv.services",[]),angular.module("ngCsv",["ngCsv.config","ngCsv.services","ngCsv.directives","ngSanitize"]),e.exports===t&&(e.exports="ngCsv"),angular.module("ngCsv.services").service("CSV",["$q",function(e){var t="\r\n",n={"\\t":"\t","\\b":"\b","\\v":"\v","\\f":"\f","\\r":"\r"};this.stringifyField=function(e,t){return"locale"===t.decimalSep&&this.isFloat(e)?e.toLocaleString():"."!==t.decimalSep&&this.isFloat(e)?e.toString().replace(".",t.decimalSep):"string"==typeof e?(e=e.replace(/"/g,'""'),(t.quoteStrings||e.indexOf(",")>-1||e.indexOf("\n")>-1||e.indexOf("\r")>-1)&&(e=t.txtDelim+e+t.txtDelim),e):"boolean"==typeof e?e?"TRUE":"FALSE":e},this.isFloat=function(e){return+e===e&&(!isFinite(e)||Boolean(e%1))},this.stringify=function(n,o){var r=e.defer(),s=this,a="",i="",d=e.when(n).then((function(e){var n,d;angular.isDefined(o.header)&&o.header&&(n=[],angular.forEach(o.header,(function(e){this.push(s.stringifyField(e,o))}),n),d=n.join(o.fieldSep?o.fieldSep:","),i+=d+t);var u,m,l=[];angular.isArray(e)?l=e:angular.isFunction(e)&&(l=e()),angular.isDefined(o.label)&&o.label&&"boolean"==typeof o.label&&(u=[],angular.forEach(l[0],(function(e,t){this.push(s.stringifyField(t,o))}),u),m=u.join(o.fieldSep?o.fieldSep:","),i+=m+t),angular.forEach(l,(function(e,n){var r,a,d=angular.copy(l[n]);a=[];var u=o.columnOrder?o.columnOrder:d;angular.forEach(u,(function(e){var t=o.columnOrder?d[e]:e;this.push(s.stringifyField(t,o))}),a),r=a.join(o.fieldSep?o.fieldSep:","),i+=n'),i=angular.element(a.children()[0]);i.attr("href",n.URL.createObjectURL(o)),i.attr("download",e.getFilename()),i.attr("target","_blank"),r.find("body").append(a),s((function(){i[0].click(),i.remove()}),null)}}()})),e.$apply()}))}}}])},"./src/js/chat/chat.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/5e32f2e1a6d11e8f150e.html"},"./src/js/closing/closing.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/00860aee362cdeeb1080.html"},"./src/js/offline/offline.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/1b90d6b0c511f3791069.html"},"./src/js/online/online.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/26fbe83f4ba96d6e6cf1.html"},"./src/js/unmanaged/unmanaged.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/3f18dac5f545add792db.html"},"./src/js/waiting/waiting.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/6043a16afdb829ba5934.html"}},e=>{var t=t=>e(e.s=t);e.O(0,["vendor-index","vendor-angular-76f2ed34","vendor-angular-58d021f3","vendor-ng-embed","vendor-moment","vendor-jquery","vendor-jquery.textcomplete","vendor-emojionearea","vendor-emojione","vendor-angular-sanitize","vendor-angular-resource","vendor-angular-messages","vendor-angular-material","vendor-angular-local-storage","vendor-angular-animate","vendor-urlMatcher","vendor-transition","vendor-stateService","vendor-stateDirectives","vendor-flow"],(()=>(t("./node_modules/jquery/dist/jquery.js"),t("./node_modules/angular/index-exposed.js"),t("./node_modules/moment/moment.js"),t("./node_modules/@flowjs/flow.js/src/flow.js"),t("./node_modules/emojione/lib/js/emojione.js"),t("./src/js/index.module.js")))),e.O()}]); -//# sourceMappingURL=chat.js.map \ No newline at end of file diff --git a/snippet/3.1.0/scripts/chat.js.map b/snippet/3.1.0/scripts/chat.js.map deleted file mode 100644 index 271f324..0000000 --- a/snippet/3.1.0/scripts/chat.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scripts/chat.js","mappings":"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","sources":["webpack://motion-chat/./node_modules/@flowjs/ng-flow/dist/ng-flow.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/templateFactory.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/statebuilders/onEnterExitRetain.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/locationServices.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/services.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/common.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/coreservices.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/glob.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/hof.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/predicates.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/queue.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/safeConsole.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/strings.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/trace.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/globals.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/param.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/paramType.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/paramTypes.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/stateParams.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/path/pathNode.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/path/pathUtils.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/interface.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/router.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateObject.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/targetState.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/interface.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/coreResolvables.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/redirectTo.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/onEnterExitRetain.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/resolve.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/views.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/updateGlobals.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/url.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/ignoredTransition.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/invalidTransition.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRouter.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRule.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRules.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/q.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/utils.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/view/view.js","webpack://motion-chat/./node_modules/angular-aria/angular-aria.js","webpack://motion-chat/./node_modules/angular-rateit/dist/ng-rateit.js","webpack://motion-chat/./src/js/index.controller.js","webpack://motion-chat/./src/js/index.route.js","webpack://motion-chat/./src/js/closing/closing.controller.js","webpack://motion-chat/./src/js/index.factory.js","webpack://motion-chat/./src/js/chat/chat.controller.js","webpack://motion-chat/./src/js/offline/offline.controller.js","webpack://motion-chat/./src/js/online/online.controller.js","webpack://motion-chat/./src/js/unmanaged/unmanaged.controller.js","webpack://motion-chat/./src/js/waiting/waiting.controller.js","webpack://motion-chat/./src/js/common/remote-storage.service.js","webpack://motion-chat/./src/js/index.module.js","webpack://motion-chat/./node_modules/expose-loader/dist/runtime/getGlobalThis.js","webpack://motion-chat/./node_modules/json-form-data/src/jsonToFormData.js","webpack://motion-chat/./node_modules/moment/locale/af.js","webpack://motion-chat/./node_modules/moment/locale/ar-dz.js","webpack://motion-chat/./node_modules/moment/locale/ar-kw.js","webpack://motion-chat/./node_modules/moment/locale/ar-ly.js","webpack://motion-chat/./node_modules/moment/locale/ar-ma.js","webpack://motion-chat/./node_modules/moment/locale/ar-sa.js","webpack://motion-chat/./node_modules/moment/locale/ar-tn.js","webpack://motion-chat/./node_modules/moment/locale/ar.js","webpack://motion-chat/./node_modules/moment/locale/az.js","webpack://motion-chat/./node_modules/moment/locale/be.js","webpack://motion-chat/./node_modules/moment/locale/bg.js","webpack://motion-chat/./node_modules/moment/locale/bm.js","webpack://motion-chat/./node_modules/moment/locale/bn-bd.js","webpack://motion-chat/./node_modules/moment/locale/bn.js","webpack://motion-chat/./node_modules/moment/locale/bo.js","webpack://motion-chat/./node_modules/moment/locale/br.js","webpack://motion-chat/./node_modules/moment/locale/bs.js","webpack://motion-chat/./node_modules/moment/locale/ca.js","webpack://motion-chat/./node_modules/moment/locale/cs.js","webpack://motion-chat/./node_modules/moment/locale/cv.js","webpack://motion-chat/./node_modules/moment/locale/cy.js","webpack://motion-chat/./node_modules/moment/locale/da.js","webpack://motion-chat/./node_modules/moment/locale/de-at.js","webpack://motion-chat/./node_modules/moment/locale/de-ch.js","webpack://motion-chat/./node_modules/moment/locale/de.js","webpack://motion-chat/./node_modules/moment/locale/dv.js","webpack://motion-chat/./node_modules/moment/locale/el.js","webpack://motion-chat/./node_modules/moment/locale/en-au.js","webpack://motion-chat/./node_modules/moment/locale/en-ca.js","webpack://motion-chat/./node_modules/moment/locale/en-gb.js","webpack://motion-chat/./node_modules/moment/locale/en-ie.js","webpack://motion-chat/./node_modules/moment/locale/en-il.js","webpack://motion-chat/./node_modules/moment/locale/en-in.js","webpack://motion-chat/./node_modules/moment/locale/en-nz.js","webpack://motion-chat/./node_modules/moment/locale/en-sg.js","webpack://motion-chat/./node_modules/moment/locale/eo.js","webpack://motion-chat/./node_modules/moment/locale/es-do.js","webpack://motion-chat/./node_modules/moment/locale/es-mx.js","webpack://motion-chat/./node_modules/moment/locale/es-us.js","webpack://motion-chat/./node_modules/moment/locale/es.js","webpack://motion-chat/./node_modules/moment/locale/et.js","webpack://motion-chat/./node_modules/moment/locale/eu.js","webpack://motion-chat/./node_modules/moment/locale/fa.js","webpack://motion-chat/./node_modules/moment/locale/fi.js","webpack://motion-chat/./node_modules/moment/locale/fil.js","webpack://motion-chat/./node_modules/moment/locale/fo.js","webpack://motion-chat/./node_modules/moment/locale/fr-ca.js","webpack://motion-chat/./node_modules/moment/locale/fr-ch.js","webpack://motion-chat/./node_modules/moment/locale/fr.js","webpack://motion-chat/./node_modules/moment/locale/fy.js","webpack://motion-chat/./node_modules/moment/locale/ga.js","webpack://motion-chat/./node_modules/moment/locale/gd.js","webpack://motion-chat/./node_modules/moment/locale/gl.js","webpack://motion-chat/./node_modules/moment/locale/gom-deva.js","webpack://motion-chat/./node_modules/moment/locale/gom-latn.js","webpack://motion-chat/./node_modules/moment/locale/gu.js","webpack://motion-chat/./node_modules/moment/locale/he.js","webpack://motion-chat/./node_modules/moment/locale/hi.js","webpack://motion-chat/./node_modules/moment/locale/hr.js","webpack://motion-chat/./node_modules/moment/locale/hu.js","webpack://motion-chat/./node_modules/moment/locale/hy-am.js","webpack://motion-chat/./node_modules/moment/locale/id.js","webpack://motion-chat/./node_modules/moment/locale/is.js","webpack://motion-chat/./node_modules/moment/locale/it-ch.js","webpack://motion-chat/./node_modules/moment/locale/it.js","webpack://motion-chat/./node_modules/moment/locale/ja.js","webpack://motion-chat/./node_modules/moment/locale/jv.js","webpack://motion-chat/./node_modules/moment/locale/ka.js","webpack://motion-chat/./node_modules/moment/locale/kk.js","webpack://motion-chat/./node_modules/moment/locale/km.js","webpack://motion-chat/./node_modules/moment/locale/kn.js","webpack://motion-chat/./node_modules/moment/locale/ko.js","webpack://motion-chat/./node_modules/moment/locale/ku.js","webpack://motion-chat/./node_modules/moment/locale/ky.js","webpack://motion-chat/./node_modules/moment/locale/lb.js","webpack://motion-chat/./node_modules/moment/locale/lo.js","webpack://motion-chat/./node_modules/moment/locale/lt.js","webpack://motion-chat/./node_modules/moment/locale/lv.js","webpack://motion-chat/./node_modules/moment/locale/me.js","webpack://motion-chat/./node_modules/moment/locale/mi.js","webpack://motion-chat/./node_modules/moment/locale/mk.js","webpack://motion-chat/./node_modules/moment/locale/ml.js","webpack://motion-chat/./node_modules/moment/locale/mn.js","webpack://motion-chat/./node_modules/moment/locale/mr.js","webpack://motion-chat/./node_modules/moment/locale/ms-my.js","webpack://motion-chat/./node_modules/moment/locale/ms.js","webpack://motion-chat/./node_modules/moment/locale/mt.js","webpack://motion-chat/./node_modules/moment/locale/my.js","webpack://motion-chat/./node_modules/moment/locale/nb.js","webpack://motion-chat/./node_modules/moment/locale/ne.js","webpack://motion-chat/./node_modules/moment/locale/nl-be.js","webpack://motion-chat/./node_modules/moment/locale/nl.js","webpack://motion-chat/./node_modules/moment/locale/nn.js","webpack://motion-chat/./node_modules/moment/locale/oc-lnc.js","webpack://motion-chat/./node_modules/moment/locale/pa-in.js","webpack://motion-chat/./node_modules/moment/locale/pl.js","webpack://motion-chat/./node_modules/moment/locale/pt-br.js","webpack://motion-chat/./node_modules/moment/locale/pt.js","webpack://motion-chat/./node_modules/moment/locale/ro.js","webpack://motion-chat/./node_modules/moment/locale/ru.js","webpack://motion-chat/./node_modules/moment/locale/sd.js","webpack://motion-chat/./node_modules/moment/locale/se.js","webpack://motion-chat/./node_modules/moment/locale/si.js","webpack://motion-chat/./node_modules/moment/locale/sk.js","webpack://motion-chat/./node_modules/moment/locale/sl.js","webpack://motion-chat/./node_modules/moment/locale/sq.js","webpack://motion-chat/./node_modules/moment/locale/sr-cyrl.js","webpack://motion-chat/./node_modules/moment/locale/sr.js","webpack://motion-chat/./node_modules/moment/locale/ss.js","webpack://motion-chat/./node_modules/moment/locale/sv.js","webpack://motion-chat/./node_modules/moment/locale/sw.js","webpack://motion-chat/./node_modules/moment/locale/ta.js","webpack://motion-chat/./node_modules/moment/locale/te.js","webpack://motion-chat/./node_modules/moment/locale/tet.js","webpack://motion-chat/./node_modules/moment/locale/tg.js","webpack://motion-chat/./node_modules/moment/locale/th.js","webpack://motion-chat/./node_modules/moment/locale/tk.js","webpack://motion-chat/./node_modules/moment/locale/tl-ph.js","webpack://motion-chat/./node_modules/moment/locale/tlh.js","webpack://motion-chat/./node_modules/moment/locale/tr.js","webpack://motion-chat/./node_modules/moment/locale/tzl.js","webpack://motion-chat/./node_modules/moment/locale/tzm-latn.js","webpack://motion-chat/./node_modules/moment/locale/tzm.js","webpack://motion-chat/./node_modules/moment/locale/ug-cn.js","webpack://motion-chat/./node_modules/moment/locale/uk.js","webpack://motion-chat/./node_modules/moment/locale/ur.js","webpack://motion-chat/./node_modules/moment/locale/uz-latn.js","webpack://motion-chat/./node_modules/moment/locale/uz.js","webpack://motion-chat/./node_modules/moment/locale/vi.js","webpack://motion-chat/./node_modules/moment/locale/x-pseudo.js","webpack://motion-chat/./node_modules/moment/locale/yo.js","webpack://motion-chat/./node_modules/moment/locale/zh-cn.js","webpack://motion-chat/./node_modules/moment/locale/zh-hk.js","webpack://motion-chat/./node_modules/moment/locale/zh-mo.js","webpack://motion-chat/./node_modules/moment/locale/zh-tw.js","webpack://motion-chat//home/vito/Development/MOTION_V3/motion-server/motion-chat/node_modules/moment/locale|sync|/^\\.\\/.*$/","webpack://motion-chat/./node_modules/ng-csv/build/ng-csv.min.js"],"names":["angular","module","provider","this","defaults","factory","options","Flow","events","on","event","callback","push","$get","fn","opts","flow","extend","forEach","controller","$scope","$attrs","$parse","flowFactory","$eval","flowInit","flowObject","create","catchAllHandler","eventName","args","Array","prototype","slice","call","arguments","shift","$broadcast","apply","concat","$applyAsync","defaultPrevented","$on","off","$flow","hasOwnProperty","flowName","assign","directive","scope","element","attrs","isDirectory","isSingleFile","inputAttrs","flowAttrs","assignBrowse","bind","preventDefault","$timeout","promise","enter","dragEvent","fileDrag","dataTransfer","originalEvent","types","val","$apply","flowDragEnter","cancel","flowDragLeave","assignDrop","flowDropEnabled","$watch","value","unAssignDrop","fileSuccess","fileProgress","fileAdded","filesAdded","filesSubmitted","fileRetry","fileRemoved","fileError","uploadStart","complete","progress","error","eventArgs","string","name","charAt","toUpperCase","require","funcArgs","key","file","flowImg","fileReader","FileReader","readAsDataURL","onload","$set","target","result","transfers","files","uiView","$ViewDirectiveFill","$compile","$controller","$transitions","$view","$q","getControllerAs","parse","getResolveAs","restrict","priority","compile","tElement","initial","html","empty","$element","data","contents","cfg","$cfg","viewDecl","getTemplate","noop","resolveCtx","path","ResolveContext","trace","$uiView","link","controllerAs","resolveAs","locals","controllerInstance","children","registerControllerCallbacks","isString","component","kebobName","kebobString","tagRegexp_1","RegExp","deregisterWatch_1","directiveEl","filter","el","tagName","exec","ctrlInstance","$animate","$uiViewScroll","$interpolate","rootData","$context","_pluginapi","_rootViewContext","count","terminal","transclude","tAttrs","$transclude","previousEl","currentEl","currentScope","viewConfig","onloadExp","autoScrollExp","renderer","cb","then","leave","inherited","inheritedData","activeUIView","$type","id","fqn","config","configUpdated","updateView","fromParentTagConfig","fromParentTag","unregister","registerUIView","newScope","$new","animEnter","defer","animLeave","$uiViewData","$uiViewAnim","$animEnter","$animLeave","$$animLeave","$emit","cloned","clone","resolve","isDefined","remove","$destroy","_viewData_1","cleanupLastView","$inject","hasComponentImpl","_uiCanExitId","isFunction","$onInit","componentProvider","viewState","tail","state","self","hookOptions","uiOnParamsChanged","viewCreationTrans_1","getResolvable","onSuccess","$transition$","exiting","indexOf","toParams","params","fromParams","getNodeSchema","node","paramSchema","toSchema","treeChanges","map","reduce","unnestR","fromSchema","changedToParams","param","idx","type","equals","length","changedKeys_1","x","newValues","uiCanExit","id_1","cacheProp_1","prevTruthyAnswer_1","trans","redirectedFrom","criteria","onBefore","ids","when","TemplateFactory","_this","_useHttp","$http","$templateCache","$injector","$templateRequest","has","get","useHttpService","fromConfig","context","asTemplate","services","str","template","asComponent","fromString","templateUrl","fromUrl","templateProvider","fromProvider","fromComponentProvider","url","cache","headers","Accept","response","deps","providerFn","isArray","Resolvable","makeComponentTemplate","bindings","prefix","kebob","camelCase","kebobed","cmpDefs","Error","getBindings","getComponentBindings","input","attrName","attr","resolveName","res","join","def","isObject","bindToController","scopeBindings","bindingsObj","Object","keys","tuple","getStateHookBuilder","hookName","stateObject","hook","pathname","subContext","$$state","getLocals","$state$","undefined","Ng1LocationServices","$locationProvider","_urlListeners","_lp","createProxyFunctions","monkeyPatchPathParameterType","router","pathType","urlMatcherFactory","encode","toString","replace","m","decode","dispose","onChange","removeFrom","html5Mode","enabled","$sniffer","history","baseHref","_baseHref","$browser","$window","location","newUrl","$location","_runtimeServices","$rootScope","evt","_loc","mod_init","mod_util","mod_rtr","mod_state","mod_main","$uiRouterProvider","UIRouter","stateProvider","stateRegistry","stateService","decorator","viewService","_viewConfigFactory","urlService","_decodeParams","ng1LocationService","locationService","locationConfig","getProviderFor","serviceName","$urp","service","runBlock","$uiRouter","invoke","checkStrictDi","strictDi","resolvables","resolvable","annotate","resolveFn","watchDigests","uiRouter","urlRouterProvider","globals","run","$urlMatcherFactory","$state","$urlRouter","ctx","getTokens","getPolicy","async","applyPairs","$IsStateFilter","isFilter","is","$stateful","$IncludedByStateFilter","includesFilter","includes","StateProvider","func","definition","register","onInvalid","getNg1ViewConfigFactory","templateFactory","view","Ng1ViewConfig","hasAnyKey","obj","acc","ng1ViewsBuilder","parent","compKeys","nonCompKeys","allViewKeys","views","viewsObject","$default","pick","$name","normalized","ViewService","$uiViewName","uiViewName","$uiViewContextAnchor","uiViewContextAnchor","$id","loaded","load","paramValues","promises","getController","all","results","controllerProvider","isInjectable","UrlRouterProvider","injectableHandler","handler","match","$match","$stateParams","urlRouter","update","interceptDeferred","listen","rule","ruleFn","BaseUrlRule","identity","rules","otherwise","urlRules","what","deferIntercept","useAnchorScroll","$anchorScroll","scrollIntoView","__spreadArrays","s","i","il","r","k","a","j","jl","root","g","global","fromJson","JSON","toJson","stringify","toObj","_equals","o1","o2","t1","a1","a2","tup","arrayTuples","b","t","getTime","source","fnNames","latebind","bindFunction","fnName","inherit","extra","inArray","array","splice","pushTo","arr","deregAll","functions","defaultsList","_i","defaultVals","reverse","mergeR","memo","item","ancestors","first","second","n","propNames","objCopy","_prop","omit","collection","accept","find","mapObj","values","allTrueR","elem","anyTrueR","flattenR","pushR","uniqR","token","unnest","assertPredicate","predicateOrMap","errMsg","maxArrayLen","min","Math","_loop_1","keyValTuple","copy","src","dest","silenceUncaughtInPromise","catch","e","silentRejection","makeStub","methods","fnname","Glob","text","glob","split","regexpString","seg","regexp","matches","test","curry","curried","compose","start","pipe","funcs","prop","propEq","_val","not","and","fn1","fn2","or","any","ctor","constructor","v","pattern","struct","toStr","tis","isUndefined","isNull","o","isNullOrUndefined","isNumber","isDate","isRegExp","head","isPromise","Queue","_items","_limit","_evictListeners","onEvict","enqueue","items","evict","dequeue","size","clear","current","peekTail","peekHead","noopConsoleStub","log","table","safeConsole","document","documentMode","window","console","bound","Function","ie9Console","fallbackConsole","maxLength","max","substr","padString","$1","toLowerCase","functionToString","fnStr","fnToString","namedFunctionMatch","_fn","isRejection","stringifyPattern","_transitionRejection","seen","format","beforeAfterSubstr","char","stripLastPathElement","splitHash","splitQuery","splitEqual","trimHashVal","splitOnDelim","delim","re","joinNeighborsR","Category","uiViewString","uiview","creationContext","normalizedCat","_tid","_rid","transLbl","Trace","_enabled","approximateDigests","_set","categories","parseInt","isNaN","category","enable","disable","traceTransitionStart","TRANSITION","traceTransitionIgnored","traceHookInvocation","step","HOOK","registeredHook","traceHookResult","hookResult","transitionOptions","traceResolvePath","RESOLVE","traceResolvableResolved","traceError","reason","traceSuccess","finalState","traceUIViewEvent","viewData","UIVIEW","traceUIViewConfigUpdated","traceUIViewFill","traceViewSync","pairs","VIEWCONFIG","uivheader","mapping","_a","_b","uiv","sort","localeCompare","traceViewServiceEvent","viewConfigString","traceViewServiceUIViewEvent","UIRouterGlobals","lastStartedTransitionId","transitionHistory","successfulTransitions","transition","lazyLoadHook","entering","lazyLoad","lazyLoadState","originalTransition","orig","targetState","identifier","$url","parts","sync","registerLazyLoadHook","transitionService","lazyLoadFn","states","_state","err","DefType","hasOwn","Param","urlConfig","paramName","noReloadOnSearch","reloadOnSearch","SEARCH","dynamic","defaultConfig","paramConfig","getStaticDefaultValue","isShorthand","$$fn","unwrapShorthand","getParamDeclaration","urlType","paramTypes","CONFIG","PATH","getType","arrayDefaults","arrayParamNomenclature","arrayMode","$asArray","isOptional","raw","squash","defaultPolicy","getSquashPolicy","defaultSquashPolicy","from","to","configuredKeys","getReplace","params_1","changed","values1","values2","validates","isDefaultValue","replaceSpecialValues","_defaultValueCache","defaultValue","getDefaultValue","$normalize","isSearch","encoded","ParamType","$subPattern","sub","mode","ArrayType","arrayWrap","arrayHandler","allTruthyMode","arrayUnwrap","arrayEqualsHandler","val1","val2","left","right","paramTypeFn","wrapperFn","$arrayMode","makeDefaultType","ParamTypes","typeQueue","defaultTypes","definitionFn","_flushTypeQueue","valToString","defaultTypeBase","String","query","hash","int","bool","Boolean","date","getFullYear","getMonth","getDate","capture","Date","valueOf","l","json","StateParams","$inherit","newParams","$current","$to","parentParams","parents","inheritList","PathNode","stateOrNode","parameters","applyRawParams","pDef","paramDef","parameter","paramsFn","diff","PathUtils","makeTargetState","registry","buildPath","buildToPath","fromPath","toPath","inheritParams","applyViewConfigs","viewDecls","subPath","viewConfigs","createViewConfig","toKeys","noInherit","toNode","toParamVals","incomingParamVals","fromParamVals","ownParamVals","reloadState","node1","node2","retained","keep","nonDynamicParams","retainedWithToParams","retainedNode","matching","pathA","pathB","done","nodeA","nodeB","predicate","elementIdx","resolvePolicies","LAZY","EAGER","WAIT","NOWAIT","arg1","policy","resolved","literal","thisPolicy","statePolicy","resolvePolicy","resolveContext","findNode","asyncPolicy","customAsyncPolicy","getDependencies","resolvedDeps","resolvedValue","fromData","whens","ALL_WHENS","EAGER_WHENS","_path","addResolvables","newResolvables","resolvePath","matchedWhens","matchesPolicy","acceptedVals","whenOrAsync","nodeResolvables","nowait","wait","getResult","injector","_injector","UIInjectorImpl","availableResolvables","_node","fromInjector","getNative","native","getAsync","_routerInstance","locationServiceStub","locationConfigStub","_disposed","_disposables","_plugins","disposable","d","ignored","plugin","pluginInstance","getPlugin","pluginName","nameBuilder","selfBuilder","dataBuilder","getUrlBuilder","$urlMatcherFactoryProvider","stateDec","newStateDec","parsed","substring","parseUrl","isMatcher","navigable","append","getNavigableBuilder","isRoot","pathBuilder","includesBuilder","resolvablesBuilder","resolveObj","getToken","p","provide","literal2Resolvable","useFactory","dependencies","useClass","useValue","useExisting","tuple2Resolvable","item2Resolvable","decl","StateBuilder","matcher","paramFactory","builders","parentName","urlParams","nonUrlParams","builder","build","chain","parentFn","segments","pop","StateMatcher","_states","isRelative","stateName","stateOrName","base","matchGlob","isStr","__stateObjectCache","nameGlob","baseState","splitName","pathLength","relName","StateObject","stateDecl","isStateClass","ref","matchingKeys","isStateDeclaration","isState","StateQueueManager","listeners","queue","flush","registered","orphans","previousQueueLength","getState","notifyListeners","listener","name_1","orphanIdx","existingState","existingFutureState","deregister","attachRoute","prev","abstract","rulesApi","urlRuleFactory","StateRegistry","stateQueue","_registerRoot","_root","onStatesChanged","stateDefinition","_deregisterTree","getChildren","_children","deregistered","removeRule","deregisteredStates","found","property","builderFunction","TargetState","_stateRegistry","_identifier","_params","_options","_definition","relative","exists","valid","withState","withParams","withOptions","newOpts","isDef","HookBuilder","buildHooksForPhase","phase","_getEvents","buildHooks","hookType","matchingHooks","getMatchingHooks","reverseDepthSort","baseHookOptions","criteriaMatchPath","traceData","transitionHook","reverseSort","factor","depthDelta","isCreate","hookPhase","reg","getHooks","matchState","criterion","toMatch","globStrings","RegisteredHook","tranSvc","eventType","matchCriteria","removeHookFromRegistry","invokeCount","_deregistered","invokeLimit","_matchingNodes","nodes","_getDefaultMatchCriteria","_getPathTypes","_getMatchingNodes","mn","pathtype","isStateHook","every","makeEvent","hooks","_registeredHooks","removeHookFn","hookRegistrationFn","matchObject","TransitionHookPhase","TransitionHookScope","RejectType","Rejection","message","detail","isRejectionPromise","superseded","rejection","SUPERSEDED","redirected","invalid","INVALID","IGNORED","aborted","ABORTED","errored","ERROR","normalize","toPromise","TransitionEventType","hookOrder","getResultHandler","getErrorHandler","synchronous","defaultOptions","TransitionHook","stateContext","isSuperseded","isActive","waitFor","nextHook","invokeHook","invokeHooks","doneCallback","remainingHooks","runAllHooks","logError","defaultErrorHandler","notCurrent","getNotCurrentRejection","handleError","handleResult","handleHookResult","isTargetState","_aborted","HANDLE_RESULT","LOG_REJECTED_RESULT","LOG_ERROR","REJECT_ERROR","THROW_ERROR","addCoreResolvables","addResolvable","TRANSITION_TOKENS","isTransition","treeChangesCleanup","replaceTransitionWithNull","redirectToHook","redirect","redirectTo","makeEnterExitRetainHook","hookFn","onExitHook","onRetainHook","onEnterHook","RESOLVE_HOOK_PRIORITY","eagerResolvePath","lazyResolveState","resolveRemaining","loadEnteringViews","enteringViews","activateViews","exitingViews","vc","deactivateViewConfig","activateViewConfig","updateGlobalState","clearCurrentTransition","updateUrl","urlOptions","ignoredHook","ignoredReason","_ignoredReason","pending","abort","invalidTransitionHook","defaultTransOpts","notify","reload","supercede","custom","TransitionService","_router","_transitionCount","_eventTypes","_criteriaPaths","_deregisterHookFns","_defineCorePaths","_defineCoreEvents","_registerCoreTransitionHooks","onCreate","onStart","onExit","onRetain","onEnter","onFinish","onError","hooksArray","Phase","TH","paths","NORMAL_SORT","SYNCHRONOUS","_defineEvent","CREATE","BEFORE","RUN","SUCCESS","STATE","_definePathType","cmpByPhase","hookScope","fns","addCoreResolves","registerInvalidTransitionHook","registerRedirectToHook","registerOnExitHook","registerOnRetainHook","registerOnEnterHook","eagerResolve","registerEagerResolvePath","lazyResolve","registerLazyResolveState","resolveAll","registerResolveRemaining","loadViews","registerLoadEnteringViews","registerActivateViews","updateGlobals","registerUpdateGlobalState","registerUpdateUrl","UrlConfig","_isCaseInsensitive","_isStrictMode","_defaultSquashPolicy","hashPrefix","newprefix","host","port","protocol","caseInsensitive","strictMode","__assign","ParamFactory","fromSearch","UrlMatcherFactory","UrlMatcher","globalConfig","strict","decodeParams","object","UrlRouter","urlParts","compareFn","read","urlMatcher","href","absolute","isHtml5","appendBasePath","slash","cfgPort","defineProperty","enumerable","configurable","UrlRuleFactory","makeRule","_what","fromUrlMatcher","fromState","fromRegExp","_handler","details","matchPriority","optional","search","stateOrDecl","transitionTo","sticky","Number","isUrlRule","defaultRuleSortFn","getHandlerFn","cmp","prioritySort","weights","URLMATCHER","REGEXP","RAW","OTHER","typeSort","urlMatcherSort","useMatchPriority","idSort","UrlRules","_sortFn","_rules","_id","_otherwiseFn","handlerFn","_sorted","ensureSorted","sorted","stableSort","group","_group","arrOfWrapper","wrapperA","wrapperB","cmpDiff","wrapper","UrlService","newurl","best","go","applyResult","_stopListeningFn","weight","BaseLocationServices","fireAfterUpdate","_listeners","_listener","_get","_location","_history","BrowserLocationConfig","_isHtml5","_hashPrefix","hostname","getBaseHref","baseTag","getElementsByTagName","extendStatics","__extends","setPrototypeOf","__proto__","__","HashLocationService","_super","title","MemoryLocationConfig","_port","_protocol","_host","newval","MemoryLocationService","_url","PushStateLocationService","_config","_getBasePrefix","basePrefix","exactBaseHrefMatch","startsWithBase","fullUrl","replaceState","pushState","Promise","reject","deferred","keyValsToObjectR","accum","getParams","queryString","orEmptyString","beforehash","buildUrl","loc","searchObject","locationPluginFactory","serviceClass","configurationClass","configuration","_uiViews","_viewConfigs","_viewConfigFactories","_registeredUIView","_registeredUIViews","_activeViewConfigs","_onSync","normalizeUIViewTarget","rawViewName","viewAtContext","relativeViewNameSugar","anchorState","anchor","_rootContext","viewType","cfgFactory","cfgs","uiViewsByFqn","viewConfigDepth","depthCompare","depthFn","posNeg","uiViewTuples","stateDepth","matchingConfigs","matchedViewConfigs","unmatchedConfigTuples","allTuples","uiViews","available","active","vcSegments","uivSegments","negOffset","fqnToFirstSegment","uiViewContext","ARIA_DISABLE_ATTR","ngAriaModule","info","angularVersion","ariaHidden","ariaChecked","ariaReadonly","ariaDisabled","ariaRequired","ariaInvalid","ariaValue","tabindex","bindKeydown","bindRoleForClick","watchExpr","ariaAttr","nativeAriaNodeNames","negate","ariaCamelName","isNodeOneOf","boolVal","newConfig","$$watchExpr","nodeTypeArray","nodeName","$aria","shouldAttachAttr","normalizedAttr","allowNonAriaNodes","shouldAttachRole","role","shape","getShape","post","ngModel","needsTabIndex","ngAriaWatchModelValue","$modelValue","newVal","$viewValue","$isEmpty","needsAriaValuemin","needsAriaValuemax","needsAriaValuenow","$observe","$validators","required","$invalid","ngMessages","ngClick","ngKeydown","ngKeypress","ngKeyup","keyCode","which","isContentEditable","$event","readOnly","pristine","resetable","starWidth","starHeight","canelWidth","cancelHeight","rated","reset","beforeRated","beforeReset","isTouch","navigator","msMaxTouchPoints","orgValue","starPartWidth","steps","garbage","getValue","index","getStartParts","getStarOffset","ratio","isSelected","removeRating","rating","setValue","tmpValue","put","IndexController","$mdDialog","RemoteStorageService","api","STORAGE_LAYOUT","STORAGE_VISITOR","vm","toggle","up","updateStorage","cmd","layout","postMessage","onStorageError","debug","visitor","status","div_color","settings","color","text_color","textColor","text_button_color","textButtonColor","button_color","color_button","background_color","backgroundColor","client_height","documentElement","clientHeight","innerHeight","client_width","clientWidth","style","setProperty","tg","getStoredValueWithLocation","visitorStoragePromise","getItem","layoutStoragePromise","visitorValue","layoutValue","interaction","alignment","online","exceeded","maxInteractions","openedInteractions","isOnline","hideWhenOffline","createElement","appendChild","sheet","insertRule","close","confirm","querySelector","clickOutsideToClose","closingQuestion","ok","show","chatInteraction","customUpdate","closed","closeReason","$promise","download","getMessages","intid","includeAll","_map","rows","row","sender","direction","customerAlias","ContactId","agentIdentifier","UserId","agentAlias","User","alias","fullname","body","createdAt","moment","getHeaderShape","header_shape","CHAT_STATUSES","offline","defaultTitle","header_online","header_offline","addEventListener","routeRun","cursor","hide","_forIn","_isNil","routeConfig","$stateProvider","$httpProvider","localStorageServiceProvider","STORAGE_PREFIX","Pragma","setPrefix","waitingTemplate","onlineTemplate","offlineTemplate","chatTemplate","unmanagedTemplate","closingTemplate","ClosingController","$mdToast","errors","toast","simple","textContent","formSubmitFailureMessage","toastClass","position","stopLoading","loading","goToIfTime","form","upColor","downColor","userForm","$setPristine","$setUntouched","enableDownload","removeItem","submit","_merge","ratingType","customer","formSubmitSuccessMessage","finally","skip","apiService","$resource","paramDefaults","baseUrl","remote","chatWebsite","method","getFields","uploadAttachment","transformRequest","downloadAttachment","abandon","chatMessage","ChatController","$interval","$document","emojiArea","getMessagesInterval","getInteractionInterval","lastMessageId","clearStorage","scrollToBottomOfChat","getElementsByClassName","scrollTop","scrollHeight","sendMessage","chatMessageError","updateRootscope","interactionStarted","emojioneArea","setText","getInteraction","disposition","reply","getText","shiftKey","includeAgent","added","_find","messages","emojiOptions","watchEmbedData","fontSmiley","emoji","linkTarget","showMenu","replyMessage","$","placeholder","placeholderMessage","keyup","editor","ready","setFocus","reply_button","fd","FormData","sendAttachment","AttachmentId","_values","OfflineController","$sce","fromKey","initialFields","typeField","optJsonFormData","showLeafArrayIndexes","includeNullValues","onSubmitSuccess","fields","_cloneDeep","trustAsHtml","initUploadButton","formItem","uploadItem","button","label","css","trigger","click","props","maxSizeMB","some","sizeErrMessage","removeFileItem","setupFileInput","multipleUpload","setAttribute","makeFileOptionsVisible","fileOpts","lastOpt","mapKeyOffline","_random","field","helpText","isHTML","checkHTML","cmField","uploadFields","payLoad","isFormDataPayload","isJsonPayload","payload","jsonToFormData","initialFormData","OnlineController","initVisitorForm","mapKey","disableItem","chatInteractionId","messageId","channel","variable","referer","customerIp","enableCustomerWriting","UnmanagedController","note","WaitingController","getInteractionIntervalHandle","open","remoteAddress","URL","address","origin","setItem","action","storage","expectedAction","removeEventListener","stringData","warn","toTrustedFilter","constant","ngEnter","getElementById","div","startTime","sentAt","createTextNode","myWindow","write","innerHTML","focus","print","printElement","elemToPrint","$mdGestureProvider","skipClickHijack","exports","globalThis","isJsonObject","Blob","isGlobalFormDataPresent","getDefaultFormData","convertRecursively","jsonObject","formData","parentKey","propName","FileList","toISOString","mergedOptions","carry","objectToMerge","objectKey","defineLocale","months","monthsShort","weekdays","weekdaysShort","weekdaysMin","meridiemParse","isPM","meridiem","hours","minutes","isLower","longDateFormat","LT","LTS","L","LL","LLL","LLLL","calendar","sameDay","nextDay","nextWeek","lastDay","lastWeek","sameElse","relativeTime","future","past","ss","mm","h","hh","dd","M","MM","y","yy","dayOfMonthOrdinalParse","ordinal","number","week","dow","doy","pluralForm","plurals","pluralize","u","withoutSuffix","isFuture","f","weekdaysParseExact","hour","minute","postformat","symbolMap","preparse","numberMap","suffixes","relativeTimeWithPlural","num","forms","standalone","isFormat","day","period","w","ww","lastDigit","last2Digits","meridiemHour","monthsShortRegex","monthsParseExact","relativeTimeWithMutation","mutationTable","softMutation","mutation","lastNumber","monthsParse","monthsRegex","minWeekdaysParse","weekdaysParse","fullWeekdaysParse","shortWeekdaysParse","monthsStrictRegex","monthsShortStrictRegex","longMonthsParse","shortMonthsParse","translate","ll","lll","llll","output","plural","processRelativeTime","monthsNominativeEl","monthsGenitiveEl","momentToFormat","_monthsGenitiveEl","month","_monthsNominativeEl","calendarEl","mom","_calendarEl","monthsShortDot","invalidDate","numbersPast","numbersFuture","verbalNumber","monthsShortWithDots","monthsShortWithoutDots","weekEndings","eras","since","offset","narrow","abbr","until","eraYearOrdinalRegex","eraYearOrdinalParse","now","$0","$2","isUpper","eifelerRegelAppliesToNumber","units","translateSingular","special","relativeTimeWithSingular","translator","words","correctGrammaticalCase","wordKey","relativeTimeMr","monthsNominative","monthsSubjective","separator","days","numbersNouns","numberNoun","hundred","floor","ten","one","word","numberAsNoun","time","hm","processHoursFunction","nominative","accusative","genitive","webpackContext","req","webpackContextResolve","__webpack_require__","code","urlSanitizationWhitelist","aHrefSanitizationWhitelist","stringifyField","decimalSep","isFloat","toLocaleString","quoteStrings","txtDelim","isFinite","header","fieldSep","c","columnOrder","addByteOrderMarker","isSpecialChar","getSpecialChar","filename","charset","csv","buildCSV","getFilename","addClass","ngCsvLoadingClass","csvHeader","csvColumnOrder","csvLabel","removeClass","msSaveOrOpenBlob","msSaveBlob","createObjectURL"],"sourceRoot":""} \ No newline at end of file diff --git a/snippet/3.1.0/scripts/vendor-index.js b/snippet/3.1.0/scripts/vendor-index.js deleted file mode 100644 index 5884b52..0000000 --- a/snippet/3.1.0/scripts/vendor-index.js +++ /dev/null @@ -1,2 +0,0 @@ -(self.webpackChunkmotion_chat=self.webpackChunkmotion_chat||[]).push([["vendor-index"],{"./node_modules/@uirouter/angularjs/lib-esm/index.js":(e,t,r)=>{"use strict";var n=r("./node_modules/@uirouter/angularjs/lib-esm/interface.js");r.o(n,"$q")&&r.d(t,{$q:function(){return n.$q}}),r("./node_modules/@uirouter/angularjs/lib-esm/services.js"),r("./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js"),r("./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js"),r("./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js"),r("./node_modules/@uirouter/angularjs/lib-esm/directives/stateDirectives.js"),r("./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js"),r("./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js"),r("./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js");var o=r("./node_modules/@uirouter/core/lib-esm/index.js");r.o(o,"$q")&&r.d(t,{$q:function(){return o.$q}})},"./node_modules/@uirouter/core/lib-esm/common/index.js":(e,t,r)=>{"use strict";r.d(t,{bb:()=>n.bb,sp:()=>n.sp,WR:()=>n.WR,ce:()=>n.ce,Wk:()=>n.Wk,l7:()=>n.l7,hX:()=>n.hX,FN:()=>n.FN,Ed:()=>n.Ed,yR:()=>n.yR,d3:()=>n.d3,js:()=>n.js,ZT:()=>n.ZT,ei:()=>n.ei,nA:()=>n.nA,Jz:()=>n.Jz,Gb:()=>n.Gb,v_:()=>n.v_,M7:()=>n.M7,VO:()=>n.VO,HV:()=>o.H,uZ:()=>o.u,rR:()=>u.r,is:()=>i.is,Qc:()=>i.Qc,uj:()=>i.uj,vg:()=>i.vg,P0:()=>i.P0,kJ:()=>a.kJ,$K:()=>a.$K,mf:()=>a.mf,Qh:()=>a.Qh,Kn:()=>a.Kn,HD:()=>a.HD,wV:()=>a.o8,L$:()=>c.L$,Fb:()=>c.Fb,cW:()=>c.cW,C7:()=>c.C7,Lb:()=>c.Lb,Ld:()=>c.HV,g4:()=>s.g4});var n=r("./node_modules/@uirouter/core/lib-esm/common/common.js"),o=r("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),u=r("./node_modules/@uirouter/core/lib-esm/common/glob.js"),i=r("./node_modules/@uirouter/core/lib-esm/common/hof.js"),a=r("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),c=(r("./node_modules/@uirouter/core/lib-esm/common/queue.js"),r("./node_modules/@uirouter/core/lib-esm/common/strings.js")),s=r("./node_modules/@uirouter/core/lib-esm/common/trace.js")},"./node_modules/@uirouter/core/lib-esm/index.js":(e,t,r)=>{"use strict";r.d(t,{applyPairs:()=>n.bb,createProxyFunctions:()=>n.WR,extend:()=>n.l7,filter:()=>n.hX,forEach:()=>n.Ed,identity:()=>n.yR,inArray:()=>n.d3,isArray:()=>n.kJ,isDefined:()=>n.$K,isFunction:()=>n.mf,isInjectable:()=>n.Qh,isObject:()=>n.Kn,isString:()=>n.HD,kebobString:()=>n.L$,noop:()=>n.ZT,parse:()=>n.Qc,pick:()=>n.ei,removeFrom:()=>n.nA,services:()=>n.uZ,tail:()=>n.Gb,trace:()=>n.g4,uniqR:()=>n.v_,unnestR:()=>n.M7,val:()=>n.P0,Resolvable:()=>u.XU,ResolveContext:()=>u.l1,BaseUrlRule:()=>a.BaseUrlRule,ViewService:()=>c.ViewService,UIRouter:()=>s.a});var n=r("./node_modules/@uirouter/core/lib-esm/common/index.js"),o=r("./node_modules/@uirouter/core/lib-esm/params/index.js");r.o(o,"$q")&&r.d(t,{$q:function(){return o.$q}}),r.o(o,"BaseUrlRule")&&r.d(t,{BaseUrlRule:function(){return o.BaseUrlRule}}),r.o(o,"Resolvable")&&r.d(t,{Resolvable:function(){return o.Resolvable}}),r.o(o,"ResolveContext")&&r.d(t,{ResolveContext:function(){return o.ResolveContext}}),r.o(o,"UIRouter")&&r.d(t,{UIRouter:function(){return o.UIRouter}}),r.o(o,"ViewService")&&r.d(t,{ViewService:function(){return o.ViewService}}),r("./node_modules/@uirouter/core/lib-esm/path/index.js");var u=r("./node_modules/@uirouter/core/lib-esm/resolve/index.js"),i=r("./node_modules/@uirouter/core/lib-esm/state/index.js");r.o(i,"$q")&&r.d(t,{$q:function(){return i.$q}}),r.o(i,"BaseUrlRule")&&r.d(t,{BaseUrlRule:function(){return i.BaseUrlRule}}),r.o(i,"UIRouter")&&r.d(t,{UIRouter:function(){return i.UIRouter}}),r.o(i,"ViewService")&&r.d(t,{ViewService:function(){return i.ViewService}}),r("./node_modules/@uirouter/core/lib-esm/transition/index.js");var a=r("./node_modules/@uirouter/core/lib-esm/url/index.js");r.o(a,"$q")&&r.d(t,{$q:function(){return a.$q}}),r.o(a,"UIRouter")&&r.d(t,{UIRouter:function(){return a.UIRouter}}),r.o(a,"ViewService")&&r.d(t,{ViewService:function(){return a.ViewService}});var c=r("./node_modules/@uirouter/core/lib-esm/view/index.js");r.o(c,"$q")&&r.d(t,{$q:function(){return c.$q}}),r.o(c,"UIRouter")&&r.d(t,{UIRouter:function(){return c.UIRouter}}),r("./node_modules/@uirouter/core/lib-esm/globals.js");var s=r("./node_modules/@uirouter/core/lib-esm/router.js"),l=r("./node_modules/@uirouter/core/lib-esm/vanilla.js");r.o(l,"$q")&&r.d(t,{$q:function(){return l.$q}}),r("./node_modules/@uirouter/core/lib-esm/interface.js")},"./node_modules/@uirouter/core/lib-esm/params/index.js":(e,t,r)=>{"use strict";r.d(t,{DefType:()=>o._,Param:()=>o.d,ParamTypes:()=>u.p});var n=r("./node_modules/@uirouter/core/lib-esm/params/interface.js");r.o(n,"$q")&&r.d(t,{$q:function(){return n.$q}}),r.o(n,"BaseUrlRule")&&r.d(t,{BaseUrlRule:function(){return n.BaseUrlRule}}),r.o(n,"DefType")&&r.d(t,{DefType:function(){return n.DefType}}),r.o(n,"Param")&&r.d(t,{Param:function(){return n.Param}}),r.o(n,"ParamTypes")&&r.d(t,{ParamTypes:function(){return n.ParamTypes}}),r.o(n,"Resolvable")&&r.d(t,{Resolvable:function(){return n.Resolvable}}),r.o(n,"ResolveContext")&&r.d(t,{ResolveContext:function(){return n.ResolveContext}}),r.o(n,"UIRouter")&&r.d(t,{UIRouter:function(){return n.UIRouter}}),r.o(n,"ViewService")&&r.d(t,{ViewService:function(){return n.ViewService}});var o=r("./node_modules/@uirouter/core/lib-esm/params/param.js"),u=r("./node_modules/@uirouter/core/lib-esm/params/paramTypes.js");r("./node_modules/@uirouter/core/lib-esm/params/stateParams.js"),r("./node_modules/@uirouter/core/lib-esm/params/paramType.js")},"./node_modules/@uirouter/core/lib-esm/path/index.js":(e,t,r)=>{"use strict";r("./node_modules/@uirouter/core/lib-esm/path/pathNode.js"),r("./node_modules/@uirouter/core/lib-esm/path/pathUtils.js")},"./node_modules/@uirouter/core/lib-esm/resolve/index.js":(e,t,r)=>{"use strict";r.d(t,{XU:()=>n.X,l1:()=>o.l}),r("./node_modules/@uirouter/core/lib-esm/resolve/interface.js");var n=r("./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"),o=r("./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js")},"./node_modules/@uirouter/core/lib-esm/state/index.js":(e,t,r)=>{"use strict";r.d(t,{TargetState:()=>o.F});var n=r("./node_modules/@uirouter/core/lib-esm/state/interface.js");r.o(n,"$q")&&r.d(t,{$q:function(){return n.$q}}),r.o(n,"BaseUrlRule")&&r.d(t,{BaseUrlRule:function(){return n.BaseUrlRule}}),r.o(n,"TargetState")&&r.d(t,{TargetState:function(){return n.TargetState}}),r.o(n,"UIRouter")&&r.d(t,{UIRouter:function(){return n.UIRouter}}),r.o(n,"ViewService")&&r.d(t,{ViewService:function(){return n.ViewService}}),r("./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js"),r("./node_modules/@uirouter/core/lib-esm/state/stateObject.js"),r("./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js"),r("./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js"),r("./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js"),r("./node_modules/@uirouter/core/lib-esm/state/stateService.js");var o=r("./node_modules/@uirouter/core/lib-esm/state/targetState.js")},"./node_modules/@uirouter/core/lib-esm/transition/index.js":(e,t,r)=>{"use strict";r("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),r("./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js"),r("./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js"),r("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"),r("./node_modules/@uirouter/core/lib-esm/transition/transition.js"),r("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),r("./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js"),r("./node_modules/@uirouter/core/lib-esm/transition/transitionService.js")},"./node_modules/@uirouter/core/lib-esm/url/index.js":(e,t,r)=>{"use strict";r.d(t,{BaseUrlRule:()=>o.n});var n=r("./node_modules/@uirouter/core/lib-esm/url/interface.js");r.o(n,"$q")&&r.d(t,{$q:function(){return n.$q}}),r.o(n,"BaseUrlRule")&&r.d(t,{BaseUrlRule:function(){return n.BaseUrlRule}}),r.o(n,"UIRouter")&&r.d(t,{UIRouter:function(){return n.UIRouter}}),r.o(n,"ViewService")&&r.d(t,{ViewService:function(){return n.ViewService}}),r("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),r("./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js"),r("./node_modules/@uirouter/core/lib-esm/url/urlRouter.js");var o=r("./node_modules/@uirouter/core/lib-esm/url/urlRule.js");r("./node_modules/@uirouter/core/lib-esm/url/urlService.js"),r("./node_modules/@uirouter/core/lib-esm/url/urlRules.js"),r("./node_modules/@uirouter/core/lib-esm/url/urlConfig.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/index.js":(e,t,r)=>{"use strict";r.d(t,{$q:()=>o.$q});var n=r("./node_modules/@uirouter/core/lib-esm/vanilla/interface.js");r.o(n,"$q")&&r.d(t,{$q:function(){return n.$q}});var o=r("./node_modules/@uirouter/core/lib-esm/vanilla/q.js");r("./node_modules/@uirouter/core/lib-esm/vanilla/injector.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"),r("./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js")},"./node_modules/@uirouter/core/lib-esm/view/index.js":(e,t,r)=>{"use strict";r.d(t,{ViewService:()=>o.s});var n=r("./node_modules/@uirouter/core/lib-esm/view/interface.js");r.o(n,"$q")&&r.d(t,{$q:function(){return n.$q}}),r.o(n,"UIRouter")&&r.d(t,{UIRouter:function(){return n.UIRouter}}),r.o(n,"ViewService")&&r.d(t,{ViewService:function(){return n.ViewService}});var o=r("./node_modules/@uirouter/core/lib-esm/view/view.js")},"./node_modules/angular-animate/index.js":(e,t,r)=>{r("./node_modules/angular-animate/angular-animate.js"),e.exports="ngAnimate"},"./node_modules/angular-aria/index.js":(e,t,r)=>{r("./node_modules/angular-aria/angular-aria.js"),e.exports="ngAria"},"./node_modules/angular-local-storage/index.js":(e,t,r)=>{r("./node_modules/angular-local-storage/dist/angular-local-storage.js"),e.exports="LocalStorageModule"},"./node_modules/angular-material/index.js":(e,t,r)=>{r("./node_modules/angular/index-exposed.js"),r("./node_modules/angular-animate/index.js"),r("./node_modules/angular-aria/index.js"),r("./node_modules/angular-material/angular-material.js"),e.exports="ngMaterial"},"./node_modules/angular-messages/index.js":(e,t,r)=>{r("./node_modules/angular-messages/angular-messages.js"),e.exports="ngMessages"},"./node_modules/angular-resource/index.js":(e,t,r)=>{r("./node_modules/angular-resource/angular-resource.js"),e.exports="ngResource"},"./node_modules/angular-sanitize/index.js":(e,t,r)=>{r("./node_modules/angular-sanitize/angular-sanitize.js"),e.exports="ngSanitize"},"./node_modules/angular/index.js":(e,t,r)=>{r("./node_modules/angular/angular.js"),e.exports=angular},"./node_modules/angular/index-exposed.js":(e,t,r)=>{var n=r("./node_modules/angular/index.js");r("./node_modules/expose-loader/dist/runtime/getGlobalThis.js").angular=n,e.exports=n},"./node_modules/lodash.clonedeep/index.js":(e,t,r)=>{e=r.nmd(e);var n="__lodash_hash_undefined__",o=9007199254740991,u="[object Arguments]",i="[object Boolean]",a="[object Date]",c="[object Function]",s="[object GeneratorFunction]",l="[object Map]",f="[object Number]",d="[object Object]",v="[object Promise]",_="[object RegExp]",p="[object Set]",h="[object String]",b="[object Symbol]",y="[object WeakMap]",m="[object ArrayBuffer]",j="[object DataView]",g="[object Float32Array]",w="[object Float64Array]",O="[object Int8Array]",A="[object Int16Array]",x="[object Int32Array]",S="[object Uint8Array]",$="[object Uint8ClampedArray]",R="[object Uint16Array]",U="[object Uint32Array]",I=/\w*$/,k=/^\[object .+?Constructor\]$/,q=/^(?:0|[1-9]\d*)$/,F={};F[u]=F["[object Array]"]=F[m]=F[j]=F[i]=F[a]=F[g]=F[w]=F[O]=F[A]=F[x]=F[l]=F[f]=F[d]=F[_]=F[p]=F[h]=F[b]=F[S]=F[$]=F[R]=F[U]=!0,F["[object Error]"]=F[c]=F[y]=!1;var P="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,E="object"==typeof self&&self&&self.Object===Object&&self,T=P||E||Function("return this")(),z=t&&!t.nodeType&&t,V=z&&e&&!e.nodeType&&e,B=V&&V.exports===z;function M(e,t){return e.set(t[0],t[1]),e}function C(e,t){return e.add(t),e}function L(e,t,r,n){var o=-1,u=e?e.length:0;for(n&&u&&(r=e[++o]);++o-1},$e.prototype.set=function(e,t){var r=this.__data__,n=ke(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},Re.prototype.clear=function(){this.__data__={hash:new Se,map:new(_e||$e),string:new Se}},Re.prototype.delete=function(e){return Ee(this,e).delete(e)},Re.prototype.get=function(e){return Ee(this,e).get(e)},Re.prototype.has=function(e){return Ee(this,e).has(e)},Re.prototype.set=function(e,t){return Ee(this,e).set(e,t),this},Ue.prototype.clear=function(){this.__data__=new $e},Ue.prototype.delete=function(e){return this.__data__.delete(e)},Ue.prototype.get=function(e){return this.__data__.get(e)},Ue.prototype.has=function(e){return this.__data__.has(e)},Ue.prototype.set=function(e,t){var r=this.__data__;if(r instanceof $e){var n=r.__data__;if(!_e||n.length<199)return n.push([e,t]),this;r=this.__data__=new Re(n)}return r.set(e,t),this};var ze=le?W(le,Object):function(){return[]},Ve=function(e){return te.call(e)};function Be(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||q.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=o}(e.length)&&!Ge(e)}var We=fe||function(){return!1};function Ge(e){var t=He(e)?te.call(e):"";return t==c||t==s}function He(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Qe(e){return Ne(e)?function(e,t){var r=De(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ne(e)}(e)&&ee.call(e,"callee")&&(!ce.call(e,"callee")||te.call(e)==u)}(e)?function(e,t){for(var r=-1,n=Array(e);++r{e=r.nmd(e);var n="__lodash_hash_undefined__",o=9007199254740991,u="[object Arguments]",i="[object Array]",a="[object Boolean]",c="[object Date]",s="[object Error]",l="[object Function]",f="[object Map]",d="[object Number]",v="[object Object]",_="[object Promise]",p="[object RegExp]",h="[object Set]",b="[object String]",y="[object Symbol]",m="[object WeakMap]",j="[object ArrayBuffer]",g="[object DataView]",w=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,O=/^\w*$/,A=/^\./,x=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,S=/^\s+|\s+$/g,$=/\\(\\)?/g,R=/^[-+]0x[0-9a-f]+$/i,U=/^0b[01]+$/i,I=/^\[object .+?Constructor\]$/,k=/^0o[0-7]+$/i,q=/^(?:0|[1-9]\d*)$/,F={};F["[object Float32Array]"]=F["[object Float64Array]"]=F["[object Int8Array]"]=F["[object Int16Array]"]=F["[object Int32Array]"]=F["[object Uint8Array]"]=F["[object Uint8ClampedArray]"]=F["[object Uint16Array]"]=F["[object Uint32Array]"]=!0,F[u]=F[i]=F[j]=F[a]=F[g]=F[c]=F[s]=F[l]=F[f]=F[d]=F[v]=F[p]=F[h]=F[b]=F[m]=!1;var P=parseInt,E="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,T="object"==typeof self&&self&&self.Object===Object&&self,z=E||T||Function("return this")(),V=t&&!t.nodeType&&t,B=V&&e&&!e.nodeType&&e,M=B&&B.exports===V&&E.process,C=function(){try{return M&&M.binding("util")}catch(e){}}(),L=C&&C.isTypedArray;function D(e,t){for(var r=-1,n=e?e.length:0;++ra))return!1;var s=u.get(e);if(s&&u.get(t))return s==t;var l=-1,f=!0,d=1&o?new Re:void 0;for(u.set(e,t),u.set(t,e);++l-1},Se.prototype.set=function(e,t){var r=this.__data__,n=Ie(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},$e.prototype.clear=function(){this.__data__={hash:new xe,map:new(de||Se),string:new xe}},$e.prototype.delete=function(e){return ze(this,e).delete(e)},$e.prototype.get=function(e){return ze(this,e).get(e)},$e.prototype.has=function(e){return ze(this,e).has(e)},$e.prototype.set=function(e,t){return ze(this,e).set(e,t),this},Re.prototype.add=Re.prototype.push=function(e){return this.__data__.set(e,n),this},Re.prototype.has=function(e){return this.__data__.has(e)},Ue.prototype.clear=function(){this.__data__=new Se},Ue.prototype.delete=function(e){return this.__data__.delete(e)},Ue.prototype.get=function(e){return this.__data__.get(e)},Ue.prototype.has=function(e){return this.__data__.has(e)},Ue.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Se){var n=r.__data__;if(!de||n.length<199)return n.push([e,t]),this;r=this.__data__=new $e(n)}return r.set(e,t),this};var Be=function(e){return ne.call(e)};function Me(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||q.test(e))&&e>-1&&e%1==0&&e-1?n[o?e[u]:u]:void 0});function Ke(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],u=r.cache;if(u.has(o))return u.get(o);var i=e.apply(this,n);return r.cache=u.set(o,i),i};return r.cache=new(Ke.Cache||$e),r}function Xe(e,t){return e===t||e!=e&&t!=t}function Je(e){return function(e){return nt(e)&&Ye(e)}(e)&&re.call(e,"callee")&&(!ae.call(e,"callee")||ne.call(e)==u)}Ke.Cache=$e;var Ze=Array.isArray;function Ye(e){return null!=e&&tt(e.length)&&!et(e)}function et(e){var t=rt(e)?ne.call(e):"";return t==l||"[object GeneratorFunction]"==t}function tt(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function rt(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function nt(e){return!!e&&"object"==typeof e}function ot(e){return"symbol"==typeof e||nt(e)&&ne.call(e)==y}var ut=L?function(e){return function(t){return e(t)}}(L):function(e){return nt(e)&&tt(e.length)&&!!F[ne.call(e)]};function it(e){return Ye(e)?function(e,t){var r=Ze(e)||Je(e)?function(e,t){for(var r=-1,n=Array(e);++r{var t=9007199254740991,r=/^(?:0|[1-9]\d*)$/,n=Object.prototype,o=n.hasOwnProperty,u=n.toString,i=n.propertyIsEnumerable;function a(e,n){return!!(n=null==n?t:n)&&("number"==typeof e||r.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=t}(e.length)&&!function(e){var t=l(e)?u.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}(e)}function l(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function f(e){return s(e)?function(e,t){var r=c(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&s(e)}(e)&&o.call(e,"callee")&&(!i.call(e,"callee")||"[object Arguments]"==u.call(e))}(e)?function(e,t){for(var r=-1,n=Array(e);++r{e.exports=function(e){return null==e}},"./node_modules/lodash.map/index.js":(e,t,r)=>{e=r.nmd(e);var n="__lodash_hash_undefined__",o=9007199254740991,u="[object Arguments]",i="[object Array]",a="[object Boolean]",c="[object Date]",s="[object Error]",l="[object Function]",f="[object Map]",d="[object Number]",v="[object Object]",_="[object Promise]",p="[object RegExp]",h="[object Set]",b="[object String]",y="[object Symbol]",m="[object WeakMap]",j="[object ArrayBuffer]",g="[object DataView]",w=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,O=/^\w*$/,A=/^\./,x=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,S=/\\(\\)?/g,$=/^\[object .+?Constructor\]$/,R=/^(?:0|[1-9]\d*)$/,U={};U["[object Float32Array]"]=U["[object Float64Array]"]=U["[object Int8Array]"]=U["[object Int16Array]"]=U["[object Int32Array]"]=U["[object Uint8Array]"]=U["[object Uint8ClampedArray]"]=U["[object Uint16Array]"]=U["[object Uint32Array]"]=!0,U[u]=U[i]=U[j]=U[a]=U[g]=U[c]=U[s]=U[l]=U[f]=U[d]=U[v]=U[p]=U[h]=U[b]=U[m]=!1;var I="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,k="object"==typeof self&&self&&self.Object===Object&&self,q=I||k||Function("return this")(),F=t&&!t.nodeType&&t,P=F&&e&&!e.nodeType&&e,E=P&&P.exports===F&&I.process,T=function(){try{return E&&E.binding("util")}catch(e){}}(),z=T&&T.isTypedArray;function V(e,t){for(var r=-1,n=e?e.length:0,o=Array(n);++r-1},ge.prototype.set=function(e,t){var r=this.__data__,n=xe(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},we.prototype.clear=function(){this.__data__={hash:new je,map:new(ae||ge),string:new je}},we.prototype.delete=function(e){return Ee(this,e).delete(e)},we.prototype.get=function(e){return Ee(this,e).get(e)},we.prototype.has=function(e){return Ee(this,e).has(e)},we.prototype.set=function(e,t){return Ee(this,e).set(e,t),this},Oe.prototype.add=Oe.prototype.push=function(e){return this.__data__.set(e,n),this},Oe.prototype.has=function(e){return this.__data__.has(e)},Ae.prototype.clear=function(){this.__data__=new ge},Ae.prototype.delete=function(e){return this.__data__.delete(e)},Ae.prototype.get=function(e){return this.__data__.get(e)},Ae.prototype.has=function(e){return this.__data__.has(e)},Ae.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ge){var n=r.__data__;if(!ae||n.length<199)return n.push([e,t]),this;r=this.__data__=new we(n)}return r.set(e,t),this};var Se,$e=(Se=function(e,t){return e&&Re(e,t,rt)},function(e,t){if(null==e)return e;if(!Ke(e))return Se(e,t);for(var r=e.length,n=-1,o=Object(e);++na))return!1;var s=u.get(e);if(s&&u.get(t))return s==t;var l=-1,f=!0,d=1&o?new Oe:void 0;for(u.set(e,t),u.set(t,e);++l-1&&e%1==0&&e-1&&e%1==0&&e<=o}function Ze(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ye(e){return!!e&&"object"==typeof e}function et(e){return"symbol"==typeof e||Ye(e)&&Y.call(e)==y}var tt=z?function(e){return function(t){return e(t)}}(z):function(e){return Ye(e)&&Je(e.length)&&!!U[Y.call(e)]};function rt(e){return Ke(e)?function(e,t){var r=Qe(e)||He(e)?function(e,t){for(var r=-1,n=Array(e);++r{e=r.nmd(e);var n="__lodash_hash_undefined__",o=9007199254740991,u="[object Arguments]",i="[object Function]",a="[object Object]",c=/^\[object .+?Constructor\]$/,s=/^(?:0|[1-9]\d*)$/,l={};l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l[u]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object Boolean]"]=l["[object DataView]"]=l["[object Date]"]=l["[object Error]"]=l[i]=l["[object Map]"]=l["[object Number]"]=l[a]=l["[object RegExp]"]=l["[object Set]"]=l["[object String]"]=l["[object WeakMap]"]=!1;var f="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,d="object"==typeof self&&self&&self.Object===Object&&self,v=f||d||Function("return this")(),_=t&&!t.nodeType&&t,p=_&&e&&!e.nodeType&&e,h=p&&p.exports===_,b=h&&f.process,y=function(){try{return p&&p.require&&p.require("util").types||b&&b.binding&&b.binding("util")}catch(e){}}(),m=y&&y.isTypedArray;function j(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var g,w,O,A=Array.prototype,x=Function.prototype,S=Object.prototype,$=v["__core-js_shared__"],R=x.toString,U=S.hasOwnProperty,I=(g=/[^.]+$/.exec($&&$.keys&&$.keys.IE_PROTO||""))?"Symbol(src)_1."+g:"",k=S.toString,q=R.call(Object),F=RegExp("^"+R.call(U).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),P=h?v.Buffer:void 0,E=v.Symbol,T=v.Uint8Array,z=(P&&P.allocUnsafe,w=Object.getPrototypeOf,O=Object,function(e){return w(O(e))}),V=Object.create,B=S.propertyIsEnumerable,M=A.splice,C=E?E.toStringTag:void 0,L=function(){try{var e=ae(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),D=P?P.isBuffer:void 0,N=Math.max,W=Date.now,G=ae(v,"Map"),H=ae(Object,"create"),Q=function(){function e(){}return function(t){if(!me(t))return{};if(V)return V(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function K(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1},X.prototype.set=function(e,t){var r=this.__data__,n=te(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},J.prototype.clear=function(){this.size=0,this.__data__={hash:new K,map:new(G||X),string:new K}},J.prototype.delete=function(e){var t=ie(this,e).delete(e);return this.size-=t?1:0,t},J.prototype.get=function(e){return ie(this,e).get(e)},J.prototype.has=function(e){return ie(this,e).has(e)},J.prototype.set=function(e,t){var r=ie(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Z.prototype.clear=function(){this.__data__=new X,this.size=0},Z.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Z.prototype.get=function(e){return this.__data__.get(e)},Z.prototype.has=function(e){return this.__data__.has(e)},Z.prototype.set=function(e,t){var r=this.__data__;if(r instanceof X){var n=r.__data__;if(!G||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new J(n)}return r.set(e,t),this.size=r.size,this};function ne(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":C&&C in Object(e)?function(e){var t=U.call(e,C),r=e[C];try{e[C]=void 0;var n=!0}catch(e){}var o=k.call(e);return n&&(t?e[C]=r:delete e[C]),o}(e):function(e){return k.call(e)}(e)}function oe(e){return je(e)&&ne(e)==u}function ue(e,t,r,n,o){e!==t&&function(e,t,r){for(var n=-1,o=Object(e),u=r(e),i=u.length;i--;){var a=u[++n];if(!1===t(o[a],a,o))break}}(t,(function(u,i){if(o||(o=new Z),me(u))!function(e,t,r,n,o,u,i){var c=le(e,r),s=le(t,r),l=i.get(s);if(l)Y(e,r,l);else{var f,d,v,_,p,h=u?u(c,s,r+"",e,t,i):void 0,b=void 0===h;if(b){var y=_e(s),m=!y&&he(s),j=!y&&!m&&ge(s);h=s,y||m||j?_e(c)?h=c:je(p=c)&&pe(p)?h=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r-1&&e%1==0&&e0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(L?function(e,t){return L(e,"toString",{configurable:!0,enumerable:!1,value:(r=t,function(){return r}),writable:!0});var r}:xe);function de(e,t){return e===t||e!=e&&t!=t}var ve=oe(function(){return arguments}())?oe:function(e){return je(e)&&U.call(e,"callee")&&!B.call(e,"callee")},_e=Array.isArray;function pe(e){return null!=e&&ye(e.length)&&!be(e)}var he=D||function(){return!1};function be(e){if(!me(e))return!1;var t=ne(e);return t==i||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ye(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function me(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function je(e){return null!=e&&"object"==typeof e}var ge=m?function(e){return function(t){return e(t)}}(m):function(e){return je(e)&&ye(e.length)&&!!l[ne(e)]};function we(e){return pe(e)?function(e,t){var r=_e(e),n=!r&&ve(e),o=!r&&!n&&he(e),u=!r&&!n&&!o&&ge(e),i=r||n||o||u,a=i?function(e,t){for(var r=-1,n=Array(e);++r1?t[n-1]:void 0,u=n>2?t[2]:void 0;for(o=Oe.length>3&&"function"==typeof o?(n--,o):void 0,u&&function(e,t,r){if(!me(r))return!1;var n=typeof t;return!!("number"==n?pe(r)&&ce(t,r.length):"string"==n&&t in r)&&de(r[t],e)}(t[0],t[1],u)&&(o=n<3?void 0:o,n=1),e=Object(e);++r{var t=9007199254740991,r=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,u=/^0o[0-7]+$/i,i=/^(?:0|[1-9]\d*)$/,a=parseFloat,c=parseInt,s=Object.prototype.toString,l=Math.floor,f=Math.min,d=Math.random;function v(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function _(e){return e?Infinity===(e=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==s.call(e)}(e))return NaN;if(v(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=v(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(r,"");var i=o.test(e);return i||u.test(e)?c(e.slice(2),i?2:8):n.test(e)?NaN:+e}(e))||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}e.exports=function(e,r,n){if(n&&"boolean"!=typeof n&&function(e,r,n){if(!v(n))return!1;var o=typeof r;return!!("number"==o?function(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=t}(e.length)&&!function(e){var t=v(e)?s.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}(e)}(n)&&function(e,r){return!!(r=null==r?t:r)&&("number"==typeof e||i.test(e))&&e>-1&&e%1==0&&er){var o=e;e=r,r=o}if(n||e%1||r%1){var u=d();return f(e+u*(r-e+a("1e-"+((u+"").length-1))),r)}return function(e,t){return e+l(d()*(t-e+1))}(e,r)}},"./node_modules/lodash.values/index.js":e=>{var t=9007199254740991,r=/^(?:0|[1-9]\d*)$/;var n,o,u=Object.prototype,i=u.hasOwnProperty,a=u.toString,c=u.propertyIsEnumerable,s=(n=Object.keys,o=Object,function(e){return n(o(e))});function l(e,n){return!!(n=null==n?t:n)&&("number"==typeof e||r.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=t}(e.length)&&!function(e){var t=function(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}(e)?a.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}(e)}e.exports=function(e){return e?function(e,t){return function(t,r){for(var n=-1,o=t?t.length:0,u=Array(o);++n